From: Andrea Bianco Date: Tue, 24 Sep 2019 13:22:23 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.3.4 X-Git-Tag: 2.3.4 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=e86ac2ffa486b3a672a4c48c1964dc2df6c55ab1;p=motion2.git Built motion from commit (unavailable).|2.3.4 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 137f84a..583ccaa 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.3.3", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-09-20T13:47:53.330Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); +define({ "name": "xCALLY Motion API", "version": "2.3.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-09-24T13:16:41.179Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 9a8ddab..508754a 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.3.3", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-09-20T13:47:53.330Z", "url": "http://apidocjs.com", "version": "0.17.7" } } +{ "name": "xCALLY Motion API", "version": "2.3.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H "Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2019-09-24T13:16:41.179Z", "url": "http://apidocjs.com", "version": "0.17.7" } } diff --git a/package.json b/package.json index 4e2c630..99a88f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.3.3", + "version": "2.3.4", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { @@ -20,7 +20,8 @@ "Fabio Lodato ", "Andrea Cuccaro ", "Donatella Soldi ", - "Afnan Imtiaz " + "Afnan Imtiaz ", + "Cristian Di Sclafani " ], "private": true, "license": "EULA", @@ -93,10 +94,10 @@ "sequelize": "^3.24.3", "serve-favicon": "^2.3.0", "simple-git": "^1.73.0", - "socket.io": "^2.2.0", - "socket.io-emitter": "^3.1.1", - "socket.io-redis": "^5.2.0", - "socketio-jwt": "^4.5.0", + "socket.io": "2.2.0", + "socket.io-emitter": "3.1.1", + "socket.io-redis": "5.2.0", + "socketio-jwt": "4.5.0", "sox": "github:gcareri/node-sox", "squel": "^5.5.0", "sticky-session": "^1.1.2", @@ -109,7 +110,7 @@ "user-agent-parser": "^0.6.0", "validate": "^3.0.1", "winston": "^2.2.0", - "ws": "^4.0.0", + "ws": "4.1.0", "xml2json": "^0.11.0", "zip-dir": "^1.0.2" }, diff --git a/public/index.html b/public/index.html index 55d68ab..9ad02d4 100644 --- a/public/index.html +++ b/public/index.html @@ -10,7 +10,7 @@ - + diff --git a/public/styles/vendor.9b1343bb.css b/public/styles/vendor.8f98e2f0.css similarity index 99% rename from public/styles/vendor.9b1343bb.css rename to public/styles/vendor.8f98e2f0.css index d7b45d4..45a55c8 100644 --- a/public/styles/vendor.9b1343bb.css +++ b/public/styles/vendor.8f98e2f0.css @@ -5,12 +5,12 @@ table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;bor */.fc{direction:ltr;text-align:left}.fc-rtl{text-align:right}body .fc{font-size:1em}.fc-unthemed .fc-divider,.fc-unthemed .fc-popover,.fc-unthemed .fc-row,.fc-unthemed tbody,.fc-unthemed td,.fc-unthemed th,.fc-unthemed thead{border-color:#ddd}.fc-unthemed .fc-popover{background-color:#fff}.fc-unthemed .fc-divider,.fc-unthemed .fc-popover .fc-header{background:#eee}.fc-unthemed .fc-popover .fc-header .fc-close{color:#666}.fc-unthemed .fc-today{background:#fcf8e3}.fc-highlight{background:#bce8f1;opacity:.3}.fc-bgevent{background:#8fdf82;opacity:.3}.fc-nonbusiness{background:#d7d7d7}.fc-icon{display:inline-block;width:1em;height:1em;line-height:1em;font-size:1em;text-align:center;overflow:hidden;font-family:"Courier New",Courier,monospace}.fc-icon:after{position:relative;margin:0 -1em}.fc-icon-left-single-arrow:after{content:"\02039";font-weight:700;font-size:200%;top:-7%;left:3%}.fc-icon-right-single-arrow:after{content:"\0203A";font-weight:700;font-size:200%;top:-7%;left:-3%}.fc-icon-left-double-arrow:after{content:"\000AB";font-size:160%;top:-7%}.fc-icon-right-double-arrow:after{content:"\000BB";font-size:160%;top:-7%}.fc-icon-left-triangle:after{content:"\25C4";font-size:125%;top:3%;left:-2%}.fc-icon-right-triangle:after{content:"\25BA";font-size:125%;top:3%;left:2%}.fc-icon-down-triangle:after{content:"\25BC";font-size:125%;top:2%}.fc-icon-x:after{content:"\000D7";font-size:200%;top:6%}.fc button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;height:2.1em;padding:0 .6em;font-size:1em;white-space:nowrap;cursor:pointer}.fc button::-moz-focus-inner{margin:0;padding:0}.fc-state-default{border:1px solid}.fc-state-default.fc-corner-left{border-top-left-radius:4px;border-bottom-left-radius:4px}.fc-state-default.fc-corner-right{border-top-right-radius:4px;border-bottom-right-radius:4px}.fc button .fc-icon{position:relative;top:-.05em;margin:0 .2em;vertical-align:middle}.fc-state-default{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);color:#333;text-shadow:0 1px 1px rgba(255,255,255,.75);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.fc-state-active,.fc-state-disabled,.fc-state-down,.fc-state-hover{color:#333;background-color:#e6e6e6}.fc-state-hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.fc-state-active,.fc-state-down{background-color:#ccc;background-image:none;box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.fc-state-disabled{cursor:default;background-image:none;opacity:.65;box-shadow:none}.fc-button-group{display:inline-block}.fc .fc-button-group>*{float:left;margin:0 0 0 -1px}.fc .fc-button-group>:first-child{margin-left:0}.fc-popover{position:absolute;box-shadow:0 2px 6px rgba(0,0,0,.15)}.fc-popover .fc-header{padding:2px 4px}.fc-popover .fc-header .fc-title{margin:0 2px}.fc-popover .fc-header .fc-close{cursor:pointer}.fc-ltr .fc-popover .fc-header .fc-title,.fc-rtl .fc-popover .fc-header .fc-close{float:left}.fc-ltr .fc-popover .fc-header .fc-close,.fc-rtl .fc-popover .fc-header .fc-title{float:right}.fc-unthemed .fc-popover{border-width:1px;border-style:solid}.fc-unthemed .fc-popover .fc-header .fc-close{font-size:.9em;margin-top:2px}.fc-popover>.ui-widget-header+.ui-widget-content{border-top:0}.fc-divider{border-style:solid;border-width:1px}hr.fc-divider{height:0;margin:0;padding:0 0 2px;border-width:1px 0}.fc-clear{clear:both}.fc-bg,.fc-bgevent-skeleton,.fc-helper-skeleton,.fc-highlight-skeleton{position:absolute;top:0;left:0;right:0}.fc-bg{bottom:0}.fc-bg table{height:100%}.fc table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0;font-size:1em}.fc th{text-align:center}.fc td,.fc th{border-style:solid;border-width:1px;padding:0;vertical-align:top}.fc td.fc-today{border-style:double}.fc .fc-row{border-style:solid;border-width:0}.fc-row table{border-left:0 hidden transparent;border-right:0 hidden transparent;border-bottom:0 hidden transparent}.fc-row:first-child table{border-top:0 hidden transparent}.fc-row{position:relative}.fc-row .fc-bg{z-index:1}.fc-row .fc-bgevent-skeleton,.fc-row .fc-highlight-skeleton{bottom:0}.fc-row .fc-bgevent-skeleton table,.fc-row .fc-highlight-skeleton table{height:100%}.fc-row .fc-bgevent-skeleton td,.fc-row .fc-highlight-skeleton td{border-color:transparent}.fc-row .fc-bgevent-skeleton{z-index:2}.fc-row .fc-highlight-skeleton{z-index:3}.fc-row .fc-content-skeleton{position:relative;z-index:4;padding-bottom:2px}.fc-row .fc-helper-skeleton{z-index:5}.fc-row .fc-content-skeleton td,.fc-row .fc-helper-skeleton td{background:0 0;border-color:transparent;border-bottom:0}.fc-row .fc-content-skeleton tbody td,.fc-row .fc-helper-skeleton tbody td{border-top:0}.fc-scroller{overflow-y:scroll;overflow-x:hidden}.fc-scroller>*{position:relative;width:100%;overflow:hidden}.fc-event{position:relative;display:block;font-size:.85em;line-height:1.3;border-radius:3px;border:1px solid #3a87ad;background-color:#3a87ad;font-weight:400}.fc-event,.fc-event:hover,.ui-widget .fc-event{color:#fff;text-decoration:none}.fc-event.fc-draggable,.fc-event[href]{cursor:pointer}.fc-not-allowed,.fc-not-allowed .fc-event{cursor:not-allowed}.fc-event .fc-bg{z-index:1;background:#fff;opacity:.25}.fc-event .fc-content{position:relative;z-index:2}.fc-event .fc-resizer{position:absolute;z-index:3}.fc-ltr .fc-h-event.fc-not-start,.fc-rtl .fc-h-event.fc-not-end{margin-left:0;border-left-width:0;padding-left:1px;border-top-left-radius:0;border-bottom-left-radius:0}.fc-ltr .fc-h-event.fc-not-end,.fc-rtl .fc-h-event.fc-not-start{margin-right:0;border-right-width:0;padding-right:1px;border-top-right-radius:0;border-bottom-right-radius:0}.fc-h-event .fc-resizer{top:-1px;bottom:-1px;left:-1px;right:-1px;width:5px}.fc-ltr .fc-h-event .fc-start-resizer,.fc-ltr .fc-h-event .fc-start-resizer:after,.fc-ltr .fc-h-event .fc-start-resizer:before,.fc-rtl .fc-h-event .fc-end-resizer,.fc-rtl .fc-h-event .fc-end-resizer:after,.fc-rtl .fc-h-event .fc-end-resizer:before{right:auto;cursor:w-resize}.fc-ltr .fc-h-event .fc-end-resizer,.fc-ltr .fc-h-event .fc-end-resizer:after,.fc-ltr .fc-h-event .fc-end-resizer:before,.fc-rtl .fc-h-event .fc-start-resizer,.fc-rtl .fc-h-event .fc-start-resizer:after,.fc-rtl .fc-h-event .fc-start-resizer:before{left:auto;cursor:e-resize}.fc-day-grid-event{margin:1px 2px 0;padding:0 1px}.fc-day-grid-event .fc-content{white-space:nowrap;overflow:hidden}.fc-day-grid-event .fc-time{font-weight:700}.fc-day-grid-event .fc-resizer{left:-3px;right:-3px;width:7px}a.fc-more{margin:1px 3px;font-size:.85em;cursor:pointer;text-decoration:none}a.fc-more:hover{text-decoration:underline}.fc-limited{display:none}.fc-day-grid .fc-row{z-index:1}.fc-more-popover{z-index:2;width:220px}.fc-more-popover .fc-event-container{padding:10px}.fc-toolbar{text-align:center;margin-bottom:1em}.fc-toolbar .fc-left{float:left}.fc-toolbar .fc-right{float:right}.fc-toolbar .fc-center{display:inline-block}.fc .fc-toolbar>*>*{float:left;margin-left:.75em}.fc .fc-toolbar>*>:first-child{margin-left:0}.fc-toolbar h2{margin:0}.fc-toolbar button{position:relative}.fc-toolbar .fc-state-hover,.fc-toolbar .ui-state-hover{z-index:2}.fc-toolbar .fc-state-down{z-index:3}.fc-toolbar .fc-state-active,.fc-toolbar .ui-state-active{z-index:4}.fc-toolbar button:focus{z-index:5}.fc-view-container *,.fc-view-container :after,.fc-view-container :before{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.fc-view,.fc-view>table{position:relative;z-index:1}.fc-basicDay-view .fc-content-skeleton,.fc-basicWeek-view .fc-content-skeleton{padding-top:1px;padding-bottom:1em}.fc-basic-view .fc-body .fc-row{min-height:4em}.fc-row.fc-rigid{overflow:hidden}.fc-row.fc-rigid .fc-content-skeleton{position:absolute;top:0;left:0;right:0}.fc-basic-view .fc-day-number,.fc-basic-view .fc-week-number{padding:0 2px}.fc-basic-view td.fc-day-number,.fc-basic-view td.fc-week-number span{padding-top:2px;padding-bottom:2px}.fc-basic-view .fc-week-number{text-align:center}.fc-basic-view .fc-week-number span{display:inline-block;min-width:1.25em}.fc-ltr .fc-basic-view .fc-day-number{text-align:right}.fc-rtl .fc-basic-view .fc-day-number{text-align:left}.fc-day-number.fc-other-month{opacity:.3}.fc-agenda-view .fc-day-grid{position:relative;z-index:2}.fc-agenda-view .fc-day-grid .fc-row{min-height:3em}.fc-agenda-view .fc-day-grid .fc-row .fc-content-skeleton{padding-top:1px;padding-bottom:1em}.fc .fc-axis{vertical-align:middle;padding:0 4px;white-space:nowrap}.fc-ltr .fc-axis{text-align:right}.fc-rtl .fc-axis{text-align:left}.ui-widget td.fc-axis{font-weight:400}.fc-time-grid,.fc-time-grid-container{position:relative;z-index:1}.fc-time-grid{min-height:100%}.fc-time-grid table{border:0 hidden transparent}.fc-time-grid>.fc-bg{z-index:1}.fc-time-grid .fc-slats,.fc-time-grid>hr{position:relative;z-index:2}.fc-time-grid .fc-bgevent-skeleton,.fc-time-grid .fc-content-skeleton{position:absolute;top:0;left:0;right:0}.fc-time-grid .fc-bgevent-skeleton{z-index:3}.fc-time-grid .fc-highlight-skeleton{z-index:4}.fc-time-grid .fc-content-skeleton{z-index:5}.fc-time-grid .fc-helper-skeleton{z-index:6}.fc-time-grid .fc-slats td{height:1.5em;border-bottom:0}.fc-time-grid .fc-slats .fc-minor td{border-top-style:dotted}.fc-time-grid .fc-slats .ui-widget-content{background:0 0}.fc-time-grid .fc-highlight-container{position:relative}.fc-time-grid .fc-highlight{position:absolute;left:0;right:0}.fc-time-grid .fc-bgevent-container,.fc-time-grid .fc-event-container{position:relative}.fc-ltr .fc-time-grid .fc-event-container{margin:0 2.5% 0 2px}.fc-rtl .fc-time-grid .fc-event-container{margin:0 2px 0 2.5%}.fc-time-grid .fc-bgevent,.fc-time-grid .fc-event{position:absolute;z-index:1}.fc-time-grid .fc-bgevent{left:0;right:0}.fc-v-event.fc-not-start{border-top-width:0;padding-top:1px;border-top-left-radius:0;border-top-right-radius:0}.fc-v-event.fc-not-end{border-bottom-width:0;padding-bottom:1px;border-bottom-left-radius:0;border-bottom-right-radius:0}.fc-time-grid-event{overflow:hidden}.fc-time-grid-event .fc-time,.fc-time-grid-event .fc-title{padding:0 1px}.fc-time-grid-event .fc-time{font-size:.85em;white-space:nowrap}.fc-time-grid-event.fc-short .fc-content{white-space:nowrap}.fc-time-grid-event.fc-short .fc-time,.fc-time-grid-event.fc-short .fc-title{display:inline-block;vertical-align:top}.fc-time-grid-event.fc-short .fc-time span{display:none}.fc-time-grid-event.fc-short .fc-time:before{content:attr(data-start)}.fc-time-grid-event.fc-short .fc-time:after{content:"\000A0-\000A0"}.fc-time-grid-event.fc-short .fc-title{font-size:.85em;padding:0}.fc-time-grid-event .fc-resizer{left:0;right:0;bottom:0;height:8px;overflow:hidden;line-height:8px;font-size:11px;font-family:monospace;text-align:center;cursor:s-resize}.fc-time-grid-event .fc-resizer:after{content:"="}.angular-ui-tree-empty{border:1px dashed #bbb;min-height:100px;background-color:#e5e5e5;background-image:-webkit-linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff),-webkit-linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff);background-image:-moz-linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff),-moz-linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff);background-image:linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff),linear-gradient(45deg,#fff 25%,transparent 25%,transparent 75%,#fff 75%,#fff);background-size:60px 60px;background-position:0 0,30px 30px}.angular-ui-tree-nodes{position:relative;margin:0;padding:0;list-style:none}.angular-ui-tree-nodes .angular-ui-tree-nodes{padding-left:20px}.angular-ui-tree-node,.angular-ui-tree-placeholder{position:relative;margin:0;padding:0;min-height:20px;line-height:20px}.angular-ui-tree-hidden{display:none}.angular-ui-tree-placeholder{margin:5px 0;padding:0;min-height:30px}.angular-ui-tree-handle{cursor:move;text-decoration:none;font-weight:700;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;min-height:20px;line-height:20px}.angular-ui-tree-drag{position:absolute;pointer-events:none;z-index:999;opacity:.8}.hljs{display:block;overflow-x:auto;padding:.5em;background:#f0f0f0;-webkit-text-size-adjust:none}.hljs,.hljs-subst,.hljs-tag .hljs-title,.nginx .hljs-title{color:#000}.apache .hljs-cbracket,.apache .hljs-tag,.asciidoc .hljs-header,.bash .hljs-variable,.coffeescript .hljs-attribute,.django .hljs-variable,.erlang_repl .hljs-function_or_atom,.haml .hljs-symbol,.hljs-addition,.hljs-constant,.hljs-flow,.hljs-name,.hljs-parent,.hljs-pragma,.hljs-preprocessor,.hljs-rule .hljs-value,.hljs-stream,.hljs-string,.hljs-tag .hljs-value,.hljs-template_tag,.hljs-title,.markdown .hljs-header,.pf .hljs-variable,.ruby .hljs-symbol,.ruby .hljs-symbol .hljs-string,.smalltalk .hljs-class,.tex .hljs-command,.tex .hljs-special,.tp .hljs-variable{color:#800}.asciidoc .hljs-blockquote,.diff .hljs-header,.hljs-annotation,.hljs-chunk,.hljs-comment,.markdown .hljs-blockquote,.smartquote{color:#888}.asciidoc .hljs-bullet,.asciidoc .hljs-link_url,.go .hljs-constant,.hljs-change,.hljs-date,.hljs-hexcolor,.hljs-literal,.hljs-number,.hljs-regexp,.lasso .hljs-variable,.makefile .hljs-variable,.markdown .hljs-bullet,.markdown .hljs-link_url,.smalltalk .hljs-char,.smalltalk .hljs-symbol{color:#080}.apache .hljs-sqbracket,.asciidoc .hljs-attribute,.asciidoc .hljs-link_label,.clojure .hljs-attribute,.coffeescript .hljs-property,.erlang_repl .hljs-reserved,.haml .hljs-bullet,.hljs-array,.hljs-attr_selector,.hljs-decorator,.hljs-deletion,.hljs-doctype,.hljs-envvar,.hljs-filter .hljs-argument,.hljs-important,.hljs-label,.hljs-localvars,.hljs-phony,.hljs-pi,.hljs-prompt,.hljs-pseudo,.hljs-shebang,.lasso .hljs-attribute,.markdown .hljs-link_label,.nginx .hljs-built_in,.ruby .hljs-string,.tex .hljs-formula,.vhdl .hljs-attribute{color:#88f}.apache .hljs-tag,.asciidoc .hljs-strong,.bash .hljs-variable,.css .hljs-tag,.hljs-built_in,.hljs-doctag,.hljs-id,.hljs-keyword,.hljs-request,.hljs-status,.hljs-title,.hljs-type,.hljs-typename,.hljs-winutils,.markdown .hljs-strong,.pf .hljs-variable,.smalltalk .hljs-class,.tex .hljs-command,.tp .hljs-data,.tp .hljs-io{font-weight:700}.asciidoc .hljs-emphasis,.markdown .hljs-emphasis,.tp .hljs-units{font-style:italic}.nginx .hljs-built_in{font-weight:400}.coffeescript .javascript,.javascript .xml,.lasso .markup,.tex .hljs-formula,.xml .css,.xml .hljs-cdata,.xml .javascript,.xml .vbscript{opacity:.5}.moment-picker{position:relative;display:inline-block}.moment-picker .moment-picker-contents{cursor:pointer}.moment-picker .moment-picker-container{color:#404040;min-width:15em;background:#fff;padding:4px;border:1px solid #f0f3f4;border-radius:4px;position:absolute;top:100%;margin-top:4px;margin-left:-.5em;box-shadow:0 2px 4px rgba(0,0,0,.075);z-index:5}.moment-picker .moment-picker-container:after,.moment-picker .moment-picker-container:before{content:'';display:block;width:0;height:0;border:8px solid transparent;border-top:none;position:absolute;top:-9px;left:15px}.moment-picker .moment-picker-container:before{border-bottom-color:#f0f3f4;border-width:9px}.moment-picker .moment-picker-container:after{border-bottom-color:#fff;margin-top:1px;margin-left:1px}.moment-picker table{border-collapse:collapse;border-spacing:0;width:100%;table-layout:fixed}.moment-picker th{font-weight:700}.moment-picker th:first-child,.moment-picker th:last-child{width:2em}.moment-picker td,.moment-picker th{padding:0;text-align:center;min-width:2em;height:2em;text-shadow:0 1px 0 rgba(255,255,255,.9);cursor:pointer;border-radius:4px}.moment-picker td:hover,.moment-picker th:hover{background:#fafbfb;background-image:-webkit-linear-gradient(#f0f3f4,#fafbfb);background-image:-moz-linear-gradient(#f0f3f4,#fafbfb);background-image:-ms-linear-gradient(#f0f3f4,#fafbfb);background-image:-o-linear-gradient(#f0f3f4,#fafbfb);background-image:linear-gradient(#f0f3f4,#fafbfb)}.moment-picker td.selected{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.3);border-color:#3ca0dd;background:#45b1e8;background-image:-webkit-linear-gradient(#45b1e8,#3097de);background-image:-moz-linear-gradient(#45b1e8,#3097de);background-image:-ms-linear-gradient(#45b1e8,#3097de);background-image:-o-linear-gradient(#45b1e8,#3097de);background-image:linear-gradient(#45b1e8,#3097de)}.moment-picker td.disabled,.moment-picker td.disabled:hover,.moment-picker th.disabled,.moment-picker th.disabled:hover{color:#abbbc7;background:0 0;cursor:default}.moment-picker .year-view td{height:3.4em}.moment-picker .month-view .moment-picker-specific-views th{background:0 0;cursor:default}.moment-picker .month-view td{width:2.1428571429em}.moment-picker .day-view td,.moment-picker .hour-view td{height:2.3333333333em}.moment-picker .minute-view td{height:1.8em}.ps-container{-ms-touch-action:none;touch-action:none;overflow:hidden!important;-ms-overflow-style:none}@supports (-ms-overflow-style:none){.ps-container{overflow:auto!important}}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.ps-container{overflow:auto!important}}.ps-container.ps-active-x>.ps-scrollbar-x-rail,.ps-container.ps-active-y>.ps-scrollbar-y-rail{display:block;background-color:transparent}.ps-container.ps-in-scrolling{pointer-events:none}.ps-container.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail{background-color:#eee;opacity:.9}.ps-container.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail>.ps-scrollbar-x{background-color:#999}.ps-container.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail{background-color:#eee;opacity:.9}.ps-container.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail>.ps-scrollbar-y{background-color:#999}.ps-container>.ps-scrollbar-x-rail{display:none;position:absolute;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;-o-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear;bottom:3px;height:8px}.ps-container>.ps-scrollbar-x-rail>.ps-scrollbar-x{position:absolute;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-transition:background-color .2s linear;-moz-transition:background-color .2s linear;-o-transition:background-color .2s linear;transition:background-color .2s linear;bottom:0;height:8px}.ps-container>.ps-scrollbar-y-rail{display:none;position:absolute;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0;-webkit-transition:background-color .2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;-o-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear;right:3px;width:8px}.ps-container>.ps-scrollbar-y-rail>.ps-scrollbar-y{position:absolute;background-color:#aaa;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-transition:background-color .2s linear;-moz-transition:background-color .2s linear;-o-transition:background-color .2s linear;transition:background-color .2s linear;right:0;width:8px}.ps-container:hover.ps-in-scrolling{pointer-events:none}.ps-container:hover.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail{background-color:#eee;opacity:.9}.ps-container:hover.ps-in-scrolling.ps-x>.ps-scrollbar-x-rail>.ps-scrollbar-x{background-color:#999}.ps-container:hover.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail{background-color:#eee;opacity:.9}.ps-container:hover.ps-in-scrolling.ps-y>.ps-scrollbar-y-rail>.ps-scrollbar-y{background-color:#999}.ps-container:hover>.ps-scrollbar-x-rail,.ps-container:hover>.ps-scrollbar-y-rail{opacity:.6}.ps-container:hover>.ps-scrollbar-x-rail:hover{background-color:#eee;opacity:.9}.ps-container:hover>.ps-scrollbar-x-rail:hover>.ps-scrollbar-x{background-color:#999}.ps-container:hover>.ps-scrollbar-y-rail:hover{background-color:#eee;opacity:.9}.ps-container:hover>.ps-scrollbar-y-rail:hover>.ps-scrollbar-y{background-color:#999}md-backdrop.md-edit-dialog-backdrop{z-index:80}md-edit-dialog{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;position:fixed;z-index:81;background-color:#f9f9f9;border-radius:2px;cursor:default}md-edit-dialog>.md-content{padding:16px 24px 0}md-edit-dialog>.md-content .md-title{color:rgba(0,0,0,.87);margin-bottom:8px}md-edit-dialog>.md-content md-input-container{margin:0;font-size:13px}md-edit-dialog>.md-content md-input-container input{float:none}md-edit-dialog>.md-content md-input-container .md-errors-spacer{min-height:auto;min-width:auto;color:rgba(0,0,0,.54)}md-edit-dialog>.md-content md-input-container .md-errors-spacer .md-char-counter{padding:5px 2px 5px 0}md-edit-dialog>.md-content md-input-container [ng-message]{padding:5px 0 5px 2px}md-edit-dialog>.md-actions{margin:0 16px 8px}md-edit-dialog>.md-actions .md-button{margin:0;min-width:initial}md-edit-dialog>.md-actions .md-button+.md-button{margin-left:8px}.md-table-pagination{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;-webkit-flex-wrap:wrap-reverse;-ms-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse;box-sizing:border-box;padding:0 24px;font-size:12px;color:rgba(0,0,0,.54);border-top:1px rgba(0,0,0,.12) solid}.md-table-pagination md-select{-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;min-width:64px}.md-table-pagination md-select:not([disabled]):focus .md-select-value{color:rgba(0,0,0,.54)}.md-table-pagination md-select .md-select-value{-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.md-table-pagination md-select .md-select-value span.md-select-icon{-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;margin-right:-6px!important}.md-table-pagination md-select .md-select-value span.md-select-icon:after{top:initial;-webkit-transform:scaleY(.5) scaleX(1);transform:scaleY(.5) scaleX(1)}.md-table-pagination>*{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:56px}.md-table-pagination>.buttons:not(:first-child),.md-table-pagination>.limit-select:not(:first-child){margin-left:32px}.md-table-pagination>.buttons{margin-right:-16px}.md-table-pagination>.buttons>.md-button.md-icon-button{margin:0}.md-table-pagination>.buttons>.label+.md-button.md-icon-button{margin-left:20px}md-select.md-table-select{margin:0}md-select.md-table-select>.md-select-value{padding:0;min-width:0;min-height:24px;border-bottom:0!important}md-select.md-table-select>.md-select-value>span{display:block;height:auto;-webkit-transform:none!important;transform:none!important}md-select.md-table-select>.md-select-value>span>.md-text{display:inherit;height:inherit;-webkit-transform:inherit;transform:inherit}md-select.md-table-select>.md-select-value>span.md-select-icon{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:24px;margin:0}md-select.md-table-select>.md-select-value>span.md-select-icon:after{top:initial}.md-select-menu-container.md-pagination-select,.md-select-menu-container.md-table-select{margin-left:-2px;border-radius:2px}.md-select-menu-container.md-pagination-select md-content,.md-select-menu-container.md-pagination-select md-select-menu,.md-select-menu-container.md-table-select md-content,.md-select-menu-container.md-table-select md-select-menu{border-radius:inherit}.md-select-menu-container.md-pagination-select md-content,.md-select-menu-container.md-table-select md-content{padding:0}.md-select-menu-container.md-table-select .md-text{font-size:13px}.md-select-menu-container.md-pagination-select .md-text{font-size:12px}md-toolbar.md-table-toolbar{box-shadow:none}md-toolbar.md-table-toolbar.md-default-theme:not(.md-menu-toolbar).md-default,md-toolbar.md-table-toolbar:not(.md-menu-toolbar).md-default{background-color:#fff;color:rgba(0,0,0,.87)}md-toolbar.md-table-toolbar.md-default-theme:not(.md-menu-toolbar).md-default .md-button,md-toolbar.md-table-toolbar:not(.md-menu-toolbar).md-default .md-button{color:rgba(0,0,0,.87)}@media only screen and (max-width:959px) and (min-width:0) and (orientation:landscape){md-toolbar.md-table-toolbar .md-toolbar-tools{height:64px;max-height:initial}}md-toolbar.md-table-toolbar .md-toolbar-tools{padding:0 24px}md-toolbar.md-table-toolbar .md-toolbar-tools md-icon{color:rgba(0,0,0,.54)}md-toolbar.md-table-toolbar .md-toolbar-tools>.md-button.md-icon-button{margin:0}md-toolbar.md-table-toolbar .md-toolbar-tools>.md-button.md-icon-button:first-child{margin-left:-12px}md-toolbar.md-table-toolbar .md-toolbar-tools>.md-button.md-icon-button:last-child{margin-right:-12px}md-card>md-table-container:first-child,md-card>md-toolbar.md-table-toolbar:first-child{border-top-left-radius:2px;border-top-right-radius:2px}md-card>md-table-container:last-child,md-card>md-toolbar.md-table-toolbar:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}md-table-container{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}table.md-table{width:100%;border-spacing:0;overflow:hidden}table.md-table thead.md-head>tr.md-row{height:56px}table.md-table tbody.md-body>tr.md-row,table.md-table tfoot.md-foot>tr.md-row{height:48px}table.md-table thead.md-head+.md-table-progress md-progress-linear{top:-3px}table.md-table .md-table-progress th{padding:0}table.md-table .md-table-progress th md-progress-linear{height:0;transition:opacity 1s}table.md-table .md-table-progress th md-progress-linear.ng-hide{opacity:0}table.md-table .md-table-progress th md-progress-linear>.md-container{height:3px;top:0;transition:none}table.md-table .md-table-progress th md-progress-linear>.md-container>.md-bar{height:3px}table.md-table th.md-column{color:rgba(0,0,0,.54);font-size:12px;font-weight:700;white-space:nowrap}table.md-table th.md-column.md-sort{cursor:pointer}table.md-table th.md-column md-icon{height:16px;width:16px;font-size:16px!important;line-height:16px!important}table.md-table th.md-column md-icon.md-sort-icon{color:rgba(0,0,0,.26);opacity:0;transition:-webkit-transform .25s,opacity .25s;transition:transform .25s,opacity .25s}table.md-table th.md-column md-icon.md-sort-icon.md-asc{-webkit-transform:rotate(0);transform:rotate(0)}table.md-table th.md-column md-icon.md-sort-icon.md-desc{-webkit-transform:rotate(180deg);transform:rotate(180deg)}table.md-table th.md-column md-icon:not(:first-child){margin-left:8px}table.md-table th.md-column md-icon:not(:last-child){margin-right:8px}table.md-table th.md-column.md-active,table.md-table th.md-column.md-active md-icon{color:rgba(0,0,0,.87)}table.md-table th.md-column.md-active md-icon.md-sort-icon,table.md-table th.md-column:hover md-icon.md-sort-icon{opacity:1}table.md-table tr.md-row[data-ng-repeat].ng-leave,table.md-table tr.md-row[ng-repeat].ng-leave,table.md-table tr.md-row[ng\:repeat].ng-leave,table.md-table tr.md-row[x-ng-repeat].ng-leave{display:none}table.md-table.md-row-select tbody.md-body>tr.md-row{transition:background-color .2s}table.md-table.md-row-select tbody.md-body>tr.md-row:not([disabled]):hover{background-color:#eee!important}table.md-table.md-row-select tbody.md-body>tr.md-row.md-selected{background-color:#f5f5f5}table.md-table.md-row-select td.md-cell:first-child,table.md-table.md-row-select th.md-column:first-child{width:20px;padding:0 0 0 24px}table.md-table.md-row-select td.md-cell:nth-child(2),table.md-table.md-row-select th.md-column:nth-child(2){padding:0 24px}table.md-table.md-row-select td.md-cell:nth-child(n+3):nth-last-child(n+2),table.md-table.md-row-select th.md-column:nth-child(n+3):nth-last-child(n+2){padding:0 56px 0 0}table.md-table:not(.md-row-select) td.md-cell:first-child,table.md-table:not(.md-row-select) th.md-column:first-child{padding:0 24px}table.md-table:not(.md-row-select) td.md-cell:nth-child(n+2):nth-last-child(n+2),table.md-table:not(.md-row-select) th.md-column:nth-child(n+2):nth-last-child(n+2){padding:0 56px 0 0}table.md-table td.md-cell,table.md-table th.md-column{vertical-align:middle;text-align:left}table.md-table td.md-cell>*,table.md-table th.md-column>*{vertical-align:middle}table.md-table td.md-cell:last-child,table.md-table th.md-column:last-child{padding:0 24px 0 0}table.md-table td.md-cell.md-clickable,table.md-table th.md-column.md-clickable{cursor:pointer}table.md-table td.md-cell.md-clickable:focus,table.md-table th.md-column.md-clickable:focus{outline:0}table.md-table td.md-cell.md-numeric,table.md-table th.md-column.md-numeric{text-align:right}table.md-table td.md-cell md-checkbox,table.md-table th.md-column md-checkbox{margin:0;width:20px}table.md-table td.md-cell{color:rgba(0,0,0,.87);font-size:13px;border-top:1px rgba(0,0,0,.12) solid}table.md-table td.md-cell.md-numeric md-select{-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end}table.md-table td.md-cell.md-numeric md-select .md-select-value{-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}table.md-table td.md-cell.md-placeholder{color:rgba(0,0,0,.26)}table.md-table td.md-cell md-select>.md-select-value>span.md-select-icon{-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;color:rgba(0,0,0,.54);width:18px;text-align:right}table.md-table td.md-cell md-select>.md-select-value>span.md-select-icon:after{-webkit-transform:scaleY(.4) scaleX(.8);transform:scaleY(.4) scaleX(.8)}/*! * angular-toasty */@font-face{font-family:Roboto;font-style:normal;font-weight:400;src:url(data:font/ttf;base64,AAEAAAASAQAABAAgR0RFRgUwBPIAAHGoAAAATEdQT1PO9uRJAABx9AAADQ5HU1VClCaeUgAAfwQAAACIT1MvMqCnsaYAAGkIAAAAYGNtYXDigyFaAABqUAAAAzhjdnQgJEEG5QAAcCAAAABMZnBnbWf0XKsAAG2IAAABvGdhc3AACAATAABxnAAAAAxnbHlmCBgu+gAAASwAAGImaGRteAQC+OIAAGloAAAA6GhlYWT4RqsOAABlNAAAADZoaGVhCroGfQAAaOQAAAAkaG10eIFaUZ8AAGVsAAADdmxvY2E6/CGoAABjdAAAAb5tYXhwAw4C+QAAY1QAAAAgbmFtZRBvLKkAAHBsAAABEHBvc3T/bQBkAABxfAAAACBwcmVwdKCP7AAAb0QAAADbAAUAZAAAAygFsAADAAYACQAMAA8AcbIMEBEREjmwDBCwANCwDBCwBtCwDBCwCdCwDBCwDdAAsABFWLACLxuxAhw+WbAARViwAC8bsQAQPlmyBAIAERI5sgUCABESObIHAgAREjmyCAIAERI5sQoM9LIMAgAREjmyDQIAERI5sAIQsQ4M9DAxISERIQMRAQERAQMhATUBIQMo/TwCxDb+7v66AQzkAgP+/gEC/f0FsPqkBQf9fQJ3+xECeP1eAl6IAl4AAgCg//UBewWwAAMADAAvALAARViwAi8bsQIcPlmwAEVYsAsvG7ELED5ZsgYFCitYIdgb9FmyAQYCERI5MDEBIwMzAzQ2MhYUBiImAVunDcLJN2w4OGw3AZsEFfqtLT09Wjs7AAIAiAQSAiMGAAAEAAkAGQCwAy+yAgoDERI5sAIvsAfQsAMQsAjQMDEBAyMTMwUDIxMzARUebwGMAQ4ebwGMBXj+mgHuiP6aAe4AAgB3AAAE0wWwABsAHwCPALAARViwDC8bsQwcPlmwAEVYsBAvG7EQHD5ZsABFWLACLxuxAhA+WbAARViwGi8bsRoQPlmyHQwCERI5fLAdLxiyAAMKK1gh2Bv0WbAE0LAdELAG0LAdELAL0LALL7IIAworWCHYG/RZsAsQsA7QsAsQsBLQsAgQsBTQsB0QsBbQsAAQsBjQsAgQsB7QMDEBIQMjEyM1IRMhNSETMwMhEzMDMxUjAzMVIwMjAyETIQL9/vhQj1DvAQlF/v4BHVKPUgEIUpBSzOdF4ftQkJ4BCEX++AGa/mYBmokBYosBoP5gAaD+YIv+non+ZgIjAWIAAAEAbv8wBBEGnAArAGYAsABFWLAJLxuxCRw+WbAARViwIi8bsSIQPlmyAiIJERI5sAkQsAzQsAkQsBDQsAkQshMBCitYIdgb9FmwAhCyGQEKK1gh2Bv0WbAiELAf0LAiELAm0LAiELIpAQorWCHYG/RZMDEBNCYnJiY1NDY3NTMVFhYVIzQmIyIGFRQWBBYWFRQGBxUjNSYmNTMUFjMyNgNYgZnVw7+nlai7uIZyd36FATGrUcu3lLrTuZKGg5YBd1x+M0HRoaTSFNvcF+zNjaZ7bmZ5Y3eeaqnOE7+/EefGi5Z+AAUAaf/rBYMFxQANABoAJgA0ADgAeACwAEVYsAMvG7EDHD5ZsABFWLAjLxuxIxA+WbADELAK0LAKL7IRBAorWCHYG/RZsAMQshgECitYIdgb9FmwIxCwHdCwHS+wIxCyKgQKK1gh2Bv0WbAdELIxBAorWCHYG/RZsjUjAxESObA1L7I3AyMREjmwNy8wMRM0NjMyFhUVFAYjIiY1FxQWMzI2NTU0JiIGFQE0NiAWFRUUBiAmNRcUFjMyNjU1NCYjIgYVBScBF2mng4Wlp4GCqopYSkdXVpRWAjunAQaop/78qopYSkhWV0lHWf4HaQLHaQSYg6qriEeEp6eLB05lYlVJTmZmUvzRg6moi0eDqaeLBk9lY1VKT2RjVPNCBHJCAAMAZf/sBPMFxAAeACcAMwCFALAARViwCS8bsQkcPlmwAEVYsBwvG7EcED5ZsABFWLAYLxuxGBA+WbIiHAkREjmyKgkcERI5sgMiKhESObIQKiIREjmyEQkcERI5shMcCRESObIZHAkREjmyFhEZERI5sBwQsh8BCitYIdgb9FmyIR8RERI5sAkQsjEBCitYIdgb9FkwMRM0NjcmJjU0NjMyFhUUBgcHATY1MxQHFyMnBgYjIiQFMjcBBwYVFBYDFBc3NjY1NCYjIgZldaVhQsSolsRZb2sBRESne9DeYUrHZ9X+/gHXk3r+nSGnmSJ2dkQyZExSYAGHabB1dpBHpryvhViVUk/+fYKf/6j5c0JF4ktwAakYe4J2jgPlYJBTMFc+Q1lvAAEAZwQhAP0GAAAEABAAsAMvsgIFAxESObACLzAxEwMjEzP9FYEBlQWR/pAB3wABAIX+KgKVBmsAEQAJALAOL7AELzAxEzQSEjcXBgIDBxATFhcHJicChXnwgSaSuwkBjVV1JoV57AJP4gGgAVRGenD+NP7jVf5+/uSqYHFKrgFUAAABACb+KgI3BmsAEQAJALAOL7AELzAxARQCAgcnNhITNTQCAic3FhISAjd18YQnmrsCWJ1iJ4TvdwJF3/5n/qZJcXYB8QEvINIBaQEeUHFJ/qr+ZAABABwCYQNVBbAADgAgALAARViwBC8bsQQcPlmwANAZsAAvGLAJ0BmwCS8YMDEBJTcFAzMDJRcFEwcDAycBSv7SLgEuCZkKASku/s3GfLq0fQPXWpdwAVj+o26YW/7xXgEg/udbAAABAE4AkgQ0BLYACwAaALAJL7AA0LAJELIGAQorWCHYG/RZsAPQMDEBIRUhESMRITUhETMCngGW/mq6/moBlroDDa/+NAHMrwGpAAEAHf7eATQA2wAIABcAsAkvsgQFCitYIdgb9FmwANCwAC8wMRMnNjc1MxUUBoZpXgS1Y/7eSIOLp5FlygAAAQAlAh8CDQK2AAMAEQCwAi+yAQEKK1gh2Bv0WTAxASE1IQIN/hgB6AIflwABAJD/9QF2ANEACQAbALAARViwBy8bsQcQPlmyAgUKK1gh2Bv0WTAxNzQ2MhYVFAYiJpA5cjs7cjlhMEBAMC4+PgABABL/gwMQBbAAAwATALAAL7AARViwAi8bsQIcPlkwMRcjATOxnwJgnn0GLQAAAgBz/+wECgXEAA0AGwA5ALAARViwCi8bsQocPlmwAEVYsAMvG7EDED5ZsAoQshEBCitYIdgb9FmwAxCyGAEKK1gh2Bv0WTAxARACIyICAzUQEjMyEhMnNCYjIgYHERQWMzI2NwQK3uzp4ATe7eveA7mEj46CAomLiYUDAm3+u/7EATUBM/cBQQE4/tP+xg3r19be/tjs4dTkAAEAqgAAAtkFtwAGADkAsABFWLAFLxuxBRw+WbAARViwAC8bsQAQPlmyBAAFERI5sAQvsgMBCitYIdgb9FmyAgMFERI5MDEhIxEFNSUzAtm6/osCEh0E0YmoxwAAAQBdAAAEMwXEABcATQCwAEVYsBAvG7EQHD5ZsABFWLAALxuxABA+WbIXAQorWCHYG/RZsALQsgMQFxESObAQELIJAQorWCHYG/RZsBAQsAzQshUXEBESOTAxISE1ATY2NTQmIyIGFSM0JDMyFhUUAQEhBDP8RgH4cFWKc4qZuQED2cvs/u7+egLbhQIwf59VcpKdjMn41bHX/tf+WQABAF7/7AP5BcQAJgB4ALAARViwDS8bsQ0cPlmwAEVYsBkvG7EZED5ZsgANGRESObAAL7LPAAFdsp8AAXGyLwABXbJfAAFysA0QsgYBCitYIdgb9FmwDRCwCdCwABCyJgEKK1gh2Bv0WbITJgAREjmwGRCwHNCwGRCyHwEKK1gh2Bv0WTAxATM2NjUQIyIGFSM0NjMyFhUUBgcWFhUUBCAkNTMUFjMyNjU0JicjAYaLg5b/eI+5/cPO6ntqeIP/AP5m/v+6ln6GjpyTiwMyAoZyAQCJca3l2sJfsiwmsH/E5t62c4qMg3+IAgACADUAAARQBbAACgAOAEkAsABFWLAJLxuxCRw+WbAARViwBC8bsQQQPlmyAQkEERI5sAEvsgIBCitYIdgb9FmwBtCwARCwC9CyCAYLERI5sg0JBBESOTAxATMVIxEjESE1ATMBIREHA4bKyrr9aQKMxf2BAcUWAemX/q4BUm0D8fw5AsooAAEAmv/sBC0FsAAdAGEAsABFWLABLxuxARw+WbAARViwDS8bsQ0QPlmwARCyBAEKK1gh2Bv0WbIHDQEREjmwBy+yGgEKK1gh2Bv0WbIFBxoREjmwDRCwEdCwDRCyFAEKK1gh2Bv0WbAHELAd0DAxExMhFSEDNjMyEhUUAiMiJiczFhYzMjY1NCYjIgcHzkoC6v2zLGuIx+rz2sH0Ea8RkHaBk5+EeUUxAtoC1qv+cz/++eDh/v3WvX1/sJuSsTUoAAIAhP/sBBwFsQAUACEATgCwAEVYsAAvG7EAHD5ZsABFWLANLxuxDRA+WbAAELIBAQorWCHYG/RZsgcNABESObAHL7IVAQorWCHYG/RZsA0QshwBCitYIdgb9FkwMQEVIwYEBzYzMhIVFAIjIgA1NRAAJQMiBgcVFBYzMjY1NCYDTyLY/wAUc8e+4/XO0f78AVcBU9JfoB+ieX2PkQWxnQT44YT+9NTh/vIBQf1HAZIBqQX9cHJWRLTcuJWWuQABAE0AAAQlBbAABgAyALAARViwBS8bsQUcPlmwAEVYsAEvG7EBED5ZsAUQsgMBCitYIdgb9FmyAAMFERI5MDEBASMBITUhBCX9pcICWfzsA9gFSPq4BRiYAAADAHD/7AQOBcQAFwAhACsAYQCwAEVYsBUvG7EVHD5ZsABFWLAJLxuxCRA+WbInCRUREjmwJy+yzycBXbIaAQorWCHYG/RZsgMaJxESObIPJxoREjmwCRCyHwEKK1gh2Bv0WbAVELIiAQorWCHYG/RZMDEBFAYHFhYVFAYjIiY1NDY3JiY1NDYzMhYDNCYiBhQWMzI2ASIGFRQWMjY0JgPsc2Jyhf/Q0v2BcmFw7MHA7Zeb+peTg4KU/upth4XehYoENG2qMDG8d73g4bx2vjEwqmy42Nj8oXqamPiOjwQah3RviYnejAAAAgBk//8D+AXEABcAJABYALAARViwCy8bsQscPlmwAEVYsBMvG7ETED5ZsgMTCxESObADL7IAAwsREjmwExCyFAEKK1gh2Bv0WbADELIYAQorWCHYG/RZsAsQsh8BCitYIdgb9FkwMQEGBiMiJiY1NDY2MzISERUQAAUjNTM2NiUyNjc1NCYjIgYVFBYDPjqhYH67Zm/MiNj5/rD+rSQn5fb+7l2dJJ55epSPAoBFVHzhiJLqfP69/uk2/lf+eQWcBOf6clRKtuS7mZXBAP//AIb/9QFtBEQAJgAS9gABBwAS//cDcwAQALAARViwDS8bsQ0YPlkwMf//ACn+3gFVBEQAJwAS/98DcwEGABAMAAAQALAARViwAy8bsQMYPlkwMQABAEgAwwN6BEoABgAWALAARViwBS8bsQUYPlmwAtCwAi8wMQEFFQE1ARUBCAJy/M4DMgKE/cQBe5IBesQAAAIAmAGPA9oDzwADAAcAJQCwBy+wA9CwAy+yAAEKK1gh2Bv0WbAHELIEAQorWCHYG/RZMDEBITUhESE1IQPa/L4DQvy+A0IDLqH9wKAAAAEAhgDEA9wESwAGABYAsABFWLACLxuxAhg+WbAF0LAFLzAxAQE1ARUBNQMb/WsDVvyqAooBA77+hpL+hcAAAgBL//UDdgXEABgAIQBRALAARViwEC8bsRAcPlmwAEVYsCAvG7EgED5ZshsFCitYIdgb9FmyABsQERI5sgQQABESObAQELIJAQorWCHYG/RZsBAQsAzQshUAEBESOTAxATY2Nzc2NTQmIyIGFSM2NjMyFhUUBwcGFQM0NjIWFAYiJgFlAjJNg1RuaWZ8uQLjtr3Tom1JwTdsODhsNwGad4pUh19taXdsW6LHy7GvqmxRmP7DLT09Wjs7AAACAGr+OwbWBZcANQBCAGgAsDIvsABFWLAILxuxCBA+WbAD0LIPMggREjmwDy+yBQgPERI5sAgQsjkCCitYIdgb9FmwFdCwMhCyGwIKK1gh2Bv0WbAIELAq0LAqL7IjAgorWCHYG/RZsA8QskACCitYIdgb9FkwMQEGAiMiJwYGIyImNzYSNjMyFhcDBjMyNjcSACEiBAIHBhIEMzI2NxcGBiMiJAITEhIkMzIEEgEGFjMyNjc3EyYjIgYGygzYtbs1NotKjpITD3m/aVGAUDQTk3GMBhP+uf6yyf7ItAsMkAEn0Vq1PCU+zWn6/pizDAzeAXzv+QFkrvvyDlFYPG8kAS44QHWZAfby/uioVVPozaUBA5QrP/3W5+C0AYUBmMf+iPb4/pPBLCNzJzLhAacBGwETAbfv4P5a/pCOmGZfCQH3He4AAAIAHAAABR0FsAAHAAoARgCwAEVYsAQvG7EEHD5ZsABFWLACLxuxAhA+WbAARViwBi8bsQYQPlmyCQQCERI5sAkvsgABCitYIdgb9FmyCgQCERI5MDEBIQMjATMBIwEhAwPN/Z6JxgIsqAItxf1NAe/4AXz+hAWw+lACGgKpAAMAqQAABIgFsAAOABYAHwBVALAARViwAS8bsQEcPlmwAEVYsAAvG7EAED5ZshcAARESObAXL7IPAQorWCHYG/RZsggPFxESObAAELIQAQorWCHYG/RZsAEQsh8BCitYIdgb9FkwMTMRITIWFRQGBxYWFRQGIwERITI2NRAhJSEyNjU0JiMhqQHc7e90ZHaJ/uj+xwE9hpv+4v7AASJ+l4yP/uQFsMTAZp0rIbmAxOACqf30i3oBB5p+bHhtAAABAHf/7ATYBcQAHABFALAARViwCy8bsQscPlmwAEVYsAMvG7EDED5ZsAsQsA/QsAsQshIBCitYIdgb9FmwAxCyGQEKK1gh2Bv0WbADELAc0DAxAQYEIyAAETU0EiQzMgAXIyYmIyICFRUUEjMyNjcE2Bv+4e7+/v7JkQEKr+gBGBfBGaeWuNHGsqCrHAHO5/sBcgE2jMsBNKX+/eWunP7w+43t/uiRtAACAKkAAATGBbAACwAVADkAsABFWLABLxuxARw+WbAARViwAC8bsQAQPlmwARCyDAEKK1gh2Bv0WbAAELINAQorWCHYG/RZMDEzESEyBBIXFRQCBAcDETMyEjU1NAInqQGbvgEknwGf/tnE08re9+nWBbCo/srJXc7+yqYCBRL7iwEU/1X4ARMCAAABAKkAAARGBbAACwBOALAARViwBi8bsQYcPlmwAEVYsAQvG7EEED5ZsgsEBhESObALL7IAAQorWCHYG/RZsAQQsgIBCitYIdgb9FmwBhCyCAEKK1gh2Bv0WTAxASERIRUhESEVIREhA+D9iQLd/GMDk/0tAncCof38nQWwnv4sAAEAqQAABC8FsAAJAEAAsABFWLAELxuxBBw+WbAARViwAi8bsQIQPlmyCQIEERI5sAkvsgABCitYIdgb9FmwBBCyBgEKK1gh2Bv0WTAxASERIxEhFSERIQPM/Z3AA4b9OgJjAoP9fQWwnv4OAAEAev/sBNwFxAAfAGIAsABFWLALLxuxCxw+WbAARViwAy8bsQMQPlmwCxCwD9CwCxCyEQEKK1gh2Bv0WbADELIYAQorWCHYG/RZsh4DCxESObAeL7QPHh8eAl20Px5PHgJdsh0BCitYIdgb9FkwMSUGBCMiJAInNRAAITIEFyMCISICAxUUEjMyNjcRITUhBNxK/vewsv7slwIBMwEW5AEWH8A2/t7BxwHgv2yiNf6vAhC/ammnATTLfwFJAWrp1gEh/vH+/3f1/t8wOQFHnAABAKkAAAUIBbAACwBVALAARViwBi8bsQYcPlmwAEVYsAovG7EKHD5ZsABFWLAALxuxABA+WbAARViwBC8bsQQQPlmwABCwCdCwCS+ynwkBcrIvCQFdsgIBCitYIdgb9FkwMSEjESERIxEzESERMwUIwf0iwMAC3sECof1fBbD9jgJyAAABALcAAAF3BbAAAwAdALAARViwAi8bsQIcPlmwAEVYsAAvG7EAED5ZMDEhIxEzAXfAwAWwAAABADX/7APMBbAADwAuALAARViwAC8bsQAcPlmwAEVYsAUvG7EFED5ZsAnQsAUQsgwBCitYIdgb9FkwMQEzERQGIyImNTMUFjMyNjcDC8H70dnywImCd5MBBbD7+dHs3sh9jJaHAAABAKkAAAUFBbAACwB0ALAARViwBS8bsQUcPlmwAEVYsAcvG7EHHD5ZsABFWLACLxuxAhA+WbAARViwCy8bsQsQPlmyAAIFERI5QBFKAFoAagB6AIoAmgCqALoACF2yOQABXbIGBQIREjlAEzYGRgZWBmYGdgaGBpYGpga2BgldMDEBBxEjETMRATMBASMCG7LAwAKH6P3DAmrmAqW5/hQFsP0wAtD9ffzTAAEAqQAABBwFsAAFACgAsABFWLAELxuxBBw+WbAARViwAi8bsQIQPlmyAAEKK1gh2Bv0WTAxJSEVIREzAWoCsvyNwZ2dBbAAAAEAqQAABlIFsAAOAFkAsABFWLAALxuxABw+WbAARViwAi8bsQIcPlmwAEVYsAQvG7EEED5ZsABFWLAILxuxCBA+WbAARViwDC8bsQwQPlmyAQAEERI5sgcABBESObIKAAQREjkwMQkCMxEjERMBIwETESMRAaEB3AHc+cAS/iKT/iMTwAWw+1wEpPpQAjcCZPtlBJj9n/3JBbAAAAEAqQAABQgFsAAJAEyyAQoLERI5ALAARViwBS8bsQUcPlmwAEVYsAgvG7EIHD5ZsABFWLAALxuxABA+WbAARViwAy8bsQMQPlmyAgUAERI5sgcFABESOTAxISMBESMRMwERMwUIwf0jwcEC378EYvueBbD7mQRnAAIAdv/sBQkFxAARAB8AOQCwAEVYsA0vG7ENHD5ZsABFWLAELxuxBBA+WbANELIVAQorWCHYG/RZsAQQshwBCitYIdgb9FkwMQEUAgQjIiQCJzU0EiQzMgQSFScQAiMiAgcVFBIzMhI3BQmQ/viwrP72kwKSAQusrwELkL/Qu7bRA9O5uswDAqnW/sGoqQE5zmnSAUKrqf6/1QIBAwEV/uv2a/v+4QEP/QAAAgCpAAAEwAWwAAoAEwBNsgoUFRESObAKELAM0ACwAEVYsAMvG7EDHD5ZsABFWLABLxuxARA+WbILAwEREjmwCy+yAAEKK1gh2Bv0WbADELISAQorWCHYG/RZMDEBESMRITIEFRQEIyUhMjY1NCYnIQFpwAIZ7wEP/vf3/qkBWZqkpI/+nAI6/cYFsPTJ1OWdkYmCnAMAAgBt/woFBgXEABUAIgBNsggjJBESObAIELAZ0ACwAEVYsBEvG7ERHD5ZsABFWLAILxuxCBA+WbIDCBEREjmwERCyGQEKK1gh2Bv0WbAIELIgAQorWCHYG/RZMDEBFAIHBQclBiMiJAInNTQSJDMyBBIVJxACIyICBxUUEiASNwUBhnkBBIP+zUhQrP72kwKSAQussAELkMDNvrXRA9EBdMwDAqnT/s9WzHn0EqkBOc5p0gFCq6r+wdUBAQEBF/7r9mv6/uABD/0AAAIAqAAABMkFsAAOABcAYbIFGBkREjmwBRCwFtAAsABFWLAELxuxBBw+WbAARViwAi8bsQIQPlmwAEVYsA0vG7ENED5ZshAEAhESObAQL7IAAQorWCHYG/RZsgsABBESObAEELIWAQorWCHYG/RZMDEBIREjESEyBBUUBgcBFSMBITI2NTQmJyECv/6qwQHi9gEJk4MBVs79bgEnj6mhmP7aAk39swWw4NaIyjL9lgwC6pR8h5ABAAABAFD/7ARyBcQAJgBhsgAnKBESOQCwAEVYsAYvG7EGHD5ZsABFWLAaLxuxGhA+WbAGELAL0LAGELIOAQorWCHYG/RZsiYaBhESObAmELIUAQorWCHYG/RZsBoQsB/QsBoQsiIBCitYIdgb9FkwMQEmJjU0JDMyFhYVIzQmIyIGFRQWBBYWFRQEIyIkJjUzFBYzMjY0JgJW9+EBE9yW64HBqJmOn5cBa81j/uznlv78jcHDo5iilgKJR8+YrOF0zHmEl31vWXtme6RvsdVzyH+EmXzWdQAAAQAxAAAElwWwAAcALgCwAEVYsAYvG7EGHD5ZsABFWLACLxuxAhA+WbAGELIAAQorWCHYG/RZsATQMDEBIREjESE1IQSX/iy//i0EZgUS+u4FEp4AAQCM/+wEqgWwABIAPLIFExQREjkAsABFWLAALxuxABw+WbAARViwCS8bsQkcPlmwAEVYsAUvG7EFED5Zsg4BCitYIdgb9FkwMQERBgAHByIAJxEzERQWMzI2NREEqgH+/9wz7/7kAr6uoaOtBbD8Is7++hACAQLiA+D8Jp6vrp4D2wAAAQAcAAAE/QWwAAYAOLIABwgREjkAsABFWLABLxuxARw+WbAARViwBS8bsQUcPlmwAEVYsAMvG7EDED5ZsgABAxESOTAxJQEzASMBMwKLAaDS/eSq/eXR/wSx+lAFsAAAAQA9AAAG7QWwABIAWQCwAEVYsAMvG7EDHD5ZsABFWLAILxuxCBw+WbAARViwES8bsREcPlmwAEVYsAovG7EKED5ZsABFWLAPLxuxDxA+WbIBAwoREjmyBgMKERI5sg0DChESOTAxARc3ATMBFzcTMwEjAScHASMBMwHjHCkBIKIBGSgf4sH+n6/+1BcX/smv/qDAAcvArQP4/AiwxAPk+lAEJW9v+9sFsAABADkAAATOBbAACwBrALAARViwAS8bsQEcPlmwAEVYsAovG7EKHD5ZsABFWLAELxuxBBA+WbAARViwBy8bsQcQPlmyAAEEERI5QAmGAJYApgC2AARdsgYBBBESOUAJiQaZBqkGuQYEXbIDAAYREjmyCQYAERI5MDEBATMBASMBASMBATMChAFd4v40Adfk/pr+mOMB2P4z4QOCAi79Lv0iAjj9yALeAtIAAAEADwAABLsFsAAIADEAsABFWLABLxuxARw+WbAARViwBy8bsQccPlmwAEVYsAQvG7EEED5ZsgABBBESOTAxAQEzAREjEQEzAmUBfNr+CsD+CtwC1QLb/G/94QIfA5EAAAEAVgAABHoFsAAJAEQAsABFWLAHLxuxBxw+WbAARViwAi8bsQIQPlmyAAEKK1gh2Bv0WbIEAAIREjmwBxCyBQEKK1gh2Bv0WbIJBQcREjkwMSUhFSE1ASE1IRUBOQNB+9wDHvzvA/ednZAEgp6NAAABAJL+yAILBoAABwAiALAEL7AHL7IAAQorWCHYG/RZsAQQsgMBCitYIdgb9FkwMQEjETMVIREhAgu/v/6HAXkF6Pl4mAe4AAABACj/gwM4BbAAAwATALACL7AARViwAC8bsQAcPlkwMRMzASMosAJgsAWw+dMAAQAJ/sgBgwaAAAcAJQCwAi+wAS+wAhCyBQEKK1gh2Bv0WbABELIGAQorWCHYG/RZMDETIREhNTMRIwkBev6GwcEGgPhImAaIAAABAEAC2QMUBbAABgAnsgAHCBESOQCwAEVYsAMvG7EDHD5ZsADQsgEHAxESObABL7AF0DAxAQMjATMBIwGqvqwBK38BKqsEu/4eAtf9KQABAAT/aQOYAAAAAwAbALAARViwAy8bsQMQPlmyAAEKK1gh2Bv0WTAxBSE1IQOY/GwDlJeXAAABADkE2AHaBf4AAwAjALABL7IPAQFdsADQGbAALxiwARCwAtCwAi+0DwIfAgJdMDEBIwEzAdqf/v7fBNgBJgAAAgBt/+wD6gROAB4AKAB5shcpKhESObAXELAg0ACwAEVYsBcvG7EXGD5ZsABFWLAELxuxBBA+WbAARViwAC8bsQAQPlmyAhcEERI5sgsXBBESObALL7AXELIPAQorWCHYG/RZshILFxESObAEELIfAQorWCHYG/RZsAsQsiMBCitYIdgb9FkwMSEmJwYjIiY1NCQzMzU0JiMiBhUjNDY2MzIWFxEUFxUlMjY3NSMgFRQWAygQCoGzoM0BAem0dHFjhrpzxXa71AQm/gtXnCOR/qx0IFKGtYupu1Vhc2RHUZdYu6T+DpVYEI1aSN7HV2IAAgCM/+wEIAYAAA4AGQBkshIaGxESObASELAD0ACwCC+wAEVYsAwvG7EMGD5ZsABFWLADLxuxAxA+WbAARViwBi8bsQYQPlmyBQgDERI5sgoMAxESObAMELISAQorWCHYG/RZsAMQshcBCitYIdgb9FkwMQEUAiMiJwcjETMRNiASESc0JiMiBxEWMzI2BCDkwM1wCaq5cAGK4bmSibdQVbSFlAIR+P7TkX0GAP3Di/7W/v0Fvc6q/iyqzgABAFz/7APsBE4AHQBJshAeHxESOQCwAEVYsBAvG7EQGD5ZsABFWLAILxuxCBA+WbIAAQorWCHYG/RZsAgQsAPQsBAQsBTQsBAQshcBCitYIdgb9FkwMSUyNjczDgIjIgARNTQ2NjMyFhcjJiYjIgYVFRQWAj5jlAivBXbFbt3++3TZlLbxCK8Ij2mNm5qDeFpdqGQBJwEAH572iNquaYfLwCO7ygAAAgBf/+wD8AYAAA8AGgBkshgbHBESObAYELAD0ACwBi+wAEVYsAMvG7EDGD5ZsABFWLAMLxuxDBA+WbAARViwCC8bsQgQPlmyBQMMERI5sgoDDBESObAMELITAQorWCHYG/RZsAMQshgBCitYIdgb9FkwMRM0EjMyFxEzESMnBiMiAjUXFBYzMjcRJiMiBl/sv75vuaoJb8a87bmYhrBRU6yImAIm+QEvggI0+gB0iAE0+Ae40J4B8ZnSAAACAF3/7APzBE4AFQAdAGmyCB4fERI5sAgQsBbQALAARViwCC8bsQgYPlmwAEVYsAAvG7EAED5ZshoIABESObAaL7S/Gs8aAl2yDAEKK1gh2Bv0WbAAELIQAQorWCHYG/RZshMIABESObAIELIWAQorWCHYG/RZMDEFIgA1NTQ2NjMyEhEVIRYWMzI2NxcGASIGByE1JiYCTdz+7HvdgdPq/SMEs4piiDNxiP7ZcJgSAh4IiBQBIfIiof2P/ur+/U2gxVBCWNEDyqOTDo2bAAEAPAAAAsoGFQAVAGOyDxYXERI5ALAARViwCC8bsQgePlmwAEVYsAMvG7EDGD5ZsABFWLARLxuxERg+WbAARViwAC8bsQAQPlmwAxCyAQEKK1gh2Bv0WbAIELINAQorWCHYG/RZsAEQsBPQsBTQMDEzESM1MzU0NjMyFwcmIyIGFRUzFSMR56uruqpAPwovNVpi5+cDq49vrr4RlglpYnKP/FUAAgBg/lYD8gROABkAJACDsiIlJhESObAiELAL0ACwAEVYsAMvG7EDGD5ZsABFWLAGLxuxBhg+WbAARViwCy8bsQsSPlmwAEVYsBcvG7EXED5ZsgUDFxESObIPFwsREjmwCxCyEQEKK1gh2Bv0WbIVAxcREjmwFxCyHQEKK1gh2Bv0WbADELIiAQorWCHYG/RZMDETNBIzMhc3MxEUBiMiJic3FjMyNjU1BiMiAjcUFjMyNxEmIyIGYOrBxm8JqfnSdeA7YHesh5dvwL7rupaHr1JVqoeYAib9ASuMePvg0vJkV2+TmIpdgAEy87fRnwHum9IAAAEAjAAAA98GAAARAEmyChITERI5ALAQL7AARViwAi8bsQIYPlmwAEVYsAUvG7EFED5ZsABFWLAOLxuxDhA+WbIAAgUREjmwAhCyCgEKK1gh2Bv0WTAxATYzIBMRIxEmJiMiBgcRIxEzAUV7xQFXA7kBaW9aiCa5uQO3l/59/TUCzHVwYE78/QYAAAIAjQAAAWgFxAADAAwAPrIGDQ4REjmwBhCwAdAAsABFWLACLxuxAhg+WbAARViwAC8bsQAQPlmwAhCwCtCwCi+yBgUKK1gh2Bv0WTAxISMRMwM0NjIWFAYiJgFVubnIN2w4OGw3BDoBHy0+Plo8PAAC/7/+SwFZBcQADAAWAEmyEBcYERI5sBAQsADQALAARViwDC8bsQwYPlmwAEVYsAMvG7EDEj5ZsggBCitYIdgb9FmwDBCwFdCwFS+yEAUKK1gh2Bv0WTAxAREQISInNRYzMjY1EQM0NjMyFhQGIiYBS/7lPTQgND5BEzc1Njg4bDYEOvtJ/sgSlAhDUwS7AR8sPz5aPDwAAAEAjQAABAwGAAAMAHUAsABFWLAELxuxBB4+WbAARViwCC8bsQgYPlmwAEVYsAIvG7ECED5ZsABFWLALLxuxCxA+WbIACAIREjlAFToASgBaAGoAegCKAJoAqgC6AMoACl2yBggCERI5QBU2BkYGVgZmBnYGhgaWBqYGtgbGBgpdMDEBBxEjETMRNwEzAQEjAbp0ubljAVHh/lsB1tkB9Xn+hAYA/F93AWT+PP2KAAEAnAAAAVUGAAADAB0AsABFWLACLxuxAh4+WbAARViwAC8bsQAQPlkwMSEjETMBVbm5BgAAAAEAiwAABngETgAdAHeyBB4fERI5ALAARViwAy8bsQMYPlmwAEVYsAgvG7EIGD5ZsABFWLAALxuxABg+WbAARViwCy8bsQsQPlmwAEVYsBQvG7EUED5ZsABFWLAbLxuxGxA+WbIBCAsREjmyBQgLERI5sAgQshABCitYIdgb9FmwGNAwMQEXNjMyFzY2MyATESMRNCYjIgYHESMRNCMiBxEjEQE6BXfK41I2rXYBZAa5an1niAu657ZDuQQ6eIyuTmD+h/0rAsp0c3to/TICxeyb/OoEOgABAIwAAAPfBE4AEQBTsgsSExESOQCwAEVYsAMvG7EDGD5ZsABFWLAALxuxABg+WbAARViwBi8bsQYQPlmwAEVYsA8vG7EPED5ZsgEDBhESObADELILAQorWCHYG/RZMDEBFzYzIBMRIxEmJiMiBgcRIxEBOwZ8yAFXA7kBaW9aiCa5BDqInP59/TUCzHVwYE78/QQ6AAACAFv/7AQ0BE4ADwAbAEOyDBwdERI5sAwQsBPQALAARViwBC8bsQQYPlmwAEVYsAwvG7EMED5ZshMBCitYIdgb9FmwBBCyGQEKK1gh2Bv0WTAxEzQ2NjMyABUVFAYGIyIANRcUFjMyNjU0JiMiBlt934/dARF54ZLc/u+6p4yNpqmMiagCJ5/+iv7O/g2e+4wBMvwJtNrdx7Ld2gACAIz+YAQeBE4ADwAaAG6yExscERI5sBMQsAzQALAARViwDC8bsQwYPlmwAEVYsAkvG7EJGD5ZsABFWLAGLxuxBhI+WbAARViwAy8bsQMQPlmyBQwDERI5sgoMAxESObAMELITAQorWCHYG/RZsAMQshgBCitYIdgb9FkwMQEUAiMiJxEjETMXNjMyEhEnNCYjIgcRFjMyNgQe4sHFcbmpCXHJw+O5nIioVFOrhZ0CEff+0n399wXaeIz+2v76BLfUlf37lNMAAAIAX/5gA+8ETgAPABoAa7IYGxwREjmwGBCwA9AAsABFWLADLxuxAxg+WbAARViwBi8bsQYYPlmwAEVYsAgvG7EIEj5ZsABFWLAMLxuxDBA+WbIFAwwREjmyCgMMERI5shMBCitYIdgb9FmwAxCyGAEKK1gh2Bv0WTAxEzQSMzIXNzMRIxEGIyICNRcUFjMyNxEmIyIGX+rFwG8IqrlwusTpuZ2FpVdYooaeAib/ASmBbfomAgR4ATH8CLrUkgISj9UAAQCMAAAClwROAA0ARrIEDg8REjkAsABFWLALLxuxCxg+WbAARViwCC8bsQgYPlmwAEVYsAUvG7EFED5ZsAsQsgIBCitYIdgb9FmyCQsFERI5MDEBJiMiBxEjETMXNjMyFwKXKjG2Qbm0A1unNhwDlAeb/QAEOn2RDgABAF//7AO7BE4AJgBhsgknKBESOQCwAEVYsAkvG7EJGD5ZsABFWLAcLxuxHBA+WbIDHAkREjmwCRCwDdCwCRCyEAEKK1gh2Bv0WbADELIVAQorWCHYG/RZsBwQsCHQsBwQsiQBCitYIdgb9FkwMQE0JiQmJjU0NjMyFhUjNCYjIgYVFBYEFhYVFAYjIiYmNTMWFjMyNgMCcf7npU/hr7jluoFiZXJqARWsU+i5gshxuQWLcml/AR9LUzxUdFCFuL6UTG5YR0NEPlZ5V5GvXKVgXW1VAAEACf/sAlYFQAAVAF+yDhYXERI5ALAARViwAS8bsQEYPlmwAEVYsBMvG7ETGD5ZsABFWLANLxuxDRA+WbABELAA0LAAL7ABELIDAQorWCHYG/RZsA0QsggBCitYIdgb9FmwAxCwEdCwEtAwMQERMxUjERQWMzI3FQYjIiY1ESM1MxEBh8rKNkEgOElFfH7FxQVA/vqP/WFBQQyWFJaKAp+PAQYAAQCI/+wD3AQ6ABAAU7IKERIREjkAsABFWLAGLxuxBhg+WbAARViwDS8bsQ0YPlmwAEVYsAIvG7ECED5ZsABFWLAQLxuxEBA+WbIADQIREjmwAhCyCgEKK1gh2Bv0WTAxJQYjIiYnETMRFDMyNxEzESMDKGzRrbUBucjURrmwa3/JxQLA/UX2ngMT+8YAAAEAIQAAA7oEOgAGADiyAAcIERI5ALAARViwAS8bsQEYPlmwAEVYsAUvG7EFGD5ZsABFWLADLxuxAxA+WbIABQMREjkwMSUBMwEjATMB8QEMvf58jf54vfsDP/vGBDoAAAEAKwAABdMEOgAMAGCyBQ0OERI5ALAARViwAS8bsQEYPlmwAEVYsAgvG7EIGD5ZsABFWLALLxuxCxg+WbAARViwAy8bsQMQPlmwAEVYsAYvG7EGED5ZsgALAxESObIFCwMREjmyCgsDERI5MDElEzMBIwEBIwEzExMzBErQuf7Flv75/wCW/sa41fyV/wM7+8YDNPzMBDr81gMqAAEAKQAAA8oEOgALAFMAsABFWLABLxuxARg+WbAARViwCi8bsQoYPlmwAEVYsAQvG7EEED5ZsABFWLAHLxuxBxA+WbIACgQREjmyBgoEERI5sgMABhESObIJBgAREjkwMQETMwEBIwMDIwEBMwH38Nj+ngFt1vr61wFt/p7WAq8Bi/3p/d0Blf5rAiMCFwABABb+SwOwBDoADwBJsgAQERESOQCwAEVYsAEvG7EBGD5ZsABFWLAOLxuxDhg+WbAARViwBS8bsQUSPlmyAA4FERI5sgkBCitYIdgb9FmwABCwDdAwMQETMwECIycnNRcyNjc3ATMB7vzG/k1l3CNFMl5pIin+fsoBDwMr+x/+8gMNlgRMZW4ELgABAFgAAAOzBDoACQBEALAARViwBy8bsQcYPlmwAEVYsAIvG7ECED5ZsgABCitYIdgb9FmyBAACERI5sAcQsgUBCitYIdgb9FmyCQUHERI5MDElIRUhNQEhNSEVAToCefylAlX9tAM0l5eIAxmZgwAAAQBA/pICngY9ABgAMbITGRoREjkAsA0vsAAvsgcNABESObAHL7IfBwFdsgYDCitYIdgb9FmyEwYHERI5MDEBJiY1NTQjNTI1NTY2NxcGERUUBxYVFRIXAnixs9TUAq+zJtGnpwPO/pIy5bzH85Hy0LfhM3ND/ubK41la5c7+7UIAAAEAr/7yAUQFsAADABMAsAAvsABFWLACLxuxAhw+WTAxASMRMwFElZX+8ga+AAABABP+kgJyBj0AGAAxsgUZGhESOQCwCy+wGC+yEQsYERI5sBEvsh8RAV2yEgMKK1gh2Bv0WbIFEhEREjkwMRc2EzU0NyY1NRAnNxYWFxUUMxUiFRUUBgcTywe1tdEmsbIB1NS1r/tBAQrc51RS6csBGkNzMuG50u+R88q84jIAAAEAgwGSBO8DIgAXAEKyERgZERI5ALAARViwDy8bsQ8WPlmwANCwDxCwFNCwFC+yAwEKK1gh2Bv0WbAPELIIAQorWCHYG/RZsAMQsAvQMDEBFAYjIi4CIyIGFQc0NjMyFhYXFzI2NQTvu4lIgKlKKk5UobiLTIywQB1MXwMJntk1lCRrXgKgzkChCgJ0XwACAIv+mAFmBE0AAwAMADKyBg0OERI5sAYQsADQALACL7AARViwCy8bsQsYPlmyBgUKK1gh2Bv0WbIBAgYREjkwMRMzEyMTFAYiJjQ2MhaqqA3CyTdsODhsNwKs++wFTC0+Plo8PAABAGn/CwP5BSYAIQBSsgAiIxESOQCwAEVYsBQvG7EUGD5ZsABFWLAKLxuxChA+WbAH0LIAAQorWCHYG/RZsAoQsAPQsBQQsBHQsBQQsBjQsBQQshsBCitYIdgb9FkwMSUyNjczBgYHFSM1JgI1NTQSNzUzFRYWFyMmJiMiBhUVFBYCSmSUCK8GxpC5s8jKsbmWwAavCI9pjZubg3lZfska6eoiARzcI9QBHSHi3xfUlmmHy8Aju8oAAQBbAAAEaAXEACEAfLIcIiMREjkAsABFWLAULxuxFBw+WbAARViwBS8bsQUQPlmyHxQFERI5sB8vsl8fAXKyjx8BcbK/HwFdsgABCitYIdgb9FmwBRCyAwEKK1gh2Bv0WbAH0LAI0LAAELAN0LAfELAP0LAUELAY0LAUELIbAQorWCHYG/RZMDEBFxQHIQchNTM2Njc1JyM1MwM0NjMyFhUjNCYjIgYVEyEVAcEIPgLdAfv4TSgyAgiloAn1yL7ev39vaYIJAT8CbtyaW52dCYNgCN2dAQTH7tSxa3yaff78nQAAAgBp/+UFWwTxABsAKgA/sgIrLBESObACELAn0ACwAEVYsAIvG7ECED5ZsBDQsBAvsAIQsh8BCitYIdgb9FmwEBCyJwEKK1gh2Bv0WTAxJQYjIicHJzcmNTQ3JzcXNjMyFzcXBxYVFAcXBwEUFhYyNjY1NCYmIyIGBgRPn9HPn4aCi2hwk4KTnsPEn5WEl25mj4T8YHPE4sRxccVwccRzcISCiIeNnMrOo5eIlnh5mImao8vEn5CIAnt71Hp703t603l41AAAAQAfAAAErQWwABYAawCwAEVYsBYvG7EWHD5ZsABFWLABLxuxARw+WbAARViwDC8bsQwQPlmyDxMDK7IADBYREjm0DxMfEwJdsBMQsAPQsBMQshICCitYIdgb9FmwBtCwDxCwB9CwDxCyDgIKK1gh2Bv0WbAK0DAxAQEzASEVIRUhFSERIxEhNSE1ITUhATMCZgFs2/5eATj+gAGA/oDB/oYBev6GATn+XtwDDgKi/TB9pXz+vgFCfKV9AtAAAAIAk/7yAU0FsAADAAcAGACwAC+wAEVYsAYvG7EGHD5ZsgUBAyswMRMRMxERIxEzk7q6uv7yAxf86QPIAvYAAgBa/hEEeQXEADQARACAsiNFRhESObAjELA10ACwCC+wAEVYsCMvG7EjHD5ZshYIIxESObAWELI/AQorWCHYG/RZsgIWPxESObAIELAO0LAIELIRAQorWCHYG/RZsjAjCBESObAwELI3AQorWCHYG/RZsh03MBESObAjELAn0LAjELIqAQorWCHYG/RZMDEBFAcWFhUUBCMiJicmNTcUFjMyNjU0JicuAjU0NyYmNTQkMzIEFSM0JiMiBhUUFhYEHgIlJicGBhUUFhYEFzY2NTQmBHm6RUj+/ORwyUaLurSciKaO0bbAXbZCRwEL3ugBBLmoi46hOIcBH6lxOv3hWktQSzaFARwsTlSLAa+9VTGIZKjHODlxzQKCl3VgWWk+MG+bb7pYMYhkpsjizX2bc2JFUEFQSGGBqxgbE2VFRlBCUhEUZUVYbQAAAgBmBPAC7wXFAAgAEQAdALAHL7ICBQorWCHYG/RZsAvQsAcQsBDQsBAvMDETNDYyFhQGIiYlNDYyFhQGIiZmN2w4OGw3Aa43bDg4bDcFWy09PVo8PCstPj5aPDwAAAMAW//rBeYFxAAbACoAOQCVsic6OxESObAnELAD0LAnELA20ACwAEVYsC4vG7EuHD5ZsABFWLA2LxuxNhA+WbIDNi4REjmwAy+0DwMfAwJdsgouNhESObAKL7QAChAKAl2yDgoDERI5shECCitYIdgb9FmwAxCyGAIKK1gh2Bv0WbIbAwoREjmwNhCyIAQKK1gh2Bv0WbAuELInBAorWCHYG/RZMDEBFAYjIiY1NTQ2MzIWFSM0JiMiBhUVFBYzMjY1JRQSBCAkEjU0AiQjIgQCBzQSJCAEEhUUAgQjIiQCBF+tnp29v5ugrJJfW15sbF5cXf0BoAETAUABEqCe/u2hoP7sn3O7AUsBgAFKu7T+tcbF/rW2AlWZodO2brDTpJVjVYp7cXiKVGWErP7bpqYBJayqASKnpf7cqsoBWsfH/qbKxf6o0c8BWAAAAgCTArMDDwXEABsAJQBssg4mJxESObAOELAd0ACwAEVYsBUvG7EVHD5ZsgQmFRESObAEL7AA0LICBBUREjmyCwQVERI5sAsvsBUQsg4DCitYIdgb9FmyEQsVERI5sAQQshwDCitYIdgb9FmwCxCyIAQKK1gh2Bv0WTAxASYnBiMiJjU0NjMzNTQjIgYVJzQ2MzIWFREUFyUyNjc1IwYGFRQCagwGTIB3gqesbHxFT6GsiYWaGv6kK1gccFNZAsEiJlZ8Z294NIc2Mwxngo+G/sRhUXsoG44BPzNe//8AZgCXA2QDswAmAJr6/gAHAJoBRP/+AAEAfwF3A74DIAAFABoAsAQvsAHQsAEvsAQQsgIBCitYIdgb9FkwMQEjESE1IQO+uv17Az8BdwEIoQAEAFr/6wXlBcQADgAeADQAPQCpsjY+PxESObA2ELAL0LA2ELAT0LA2ELAj0ACwAEVYsAMvG7EDHD5ZsABFWLALLxuxCxA+WbITBAorWCHYG/RZsAMQshsECitYIdgb9FmyIAsDERI5sCAvsiIDCxESObAiL7QAIhAiAl2yNSAiERI5sDUvsr81AV20ADUQNQJdsh8CCitYIdgb9FmyKB81ERI5sCAQsC/QsC8vsCIQsj0CCitYIdgb9FkwMRM0EiQgBBIVFAIEIyIkAjcUEgQzMiQSNTQCJCMiBAIFESMRITIWFRQHFhcVFBcVIyY0JyYnJzM2NjU0JiMjWrsBSwGAAUq7tP61xsX+tbZzoAEToKEBFJ2d/uyhoP7snwHAjQEUmamAegERkQ4DEHOwnEhYTmSKAtnKAVrHx/6mysX+qNHPAVjHrP7bpqkBIqyrASGnpf7c9f6uA1GDfXtBMpo9ViYQJLkRYASAAkI2ST0AAAEAeAUhA0IFsAADABEAsAEvsgIDCitYIdgb9FkwMQEhNSEDQv02AsoFIY8AAgCCA8ACfAXEAAsAFgAvALAARViwAy8bsQMcPlmwDNCwDC+yCQIKK1gh2Bv0WbADELISAgorWCHYG/RZMDETNDYzMhYVFAYjIiYXMjY1NCYjIgYUFoKVamiTk2hplv82Sko2N0tLBMBonJtpapaWFkc5OktPbEoAAgBhAAAD9QTzAAsADwBGALAJL7AARViwDS8bsQ0QPlmwCRCwANCwCRCyBgEKK1gh2Bv0WbAD0LANELIOAQorWCHYG/RZsgUOBhESObQLBRsFAl0wMQEhFSERIxEhNSERMwEhNSECiQFs/pSn/n8BgacBQfy9A0MDVpf+YgGelwGd+w2YAAABAEICmwKrBbsAFgBUsggXGBESOQCwAEVYsA4vG7EOHD5ZsABFWLAALxuxABQ+WbIWAgorWCHYG/RZsALQsgMOFhESObAOELIIAgorWCHYG/RZsA4QsAvQshQWDhESOTAxASE1ATY1NCYjIgYVIzQ2IBYVFA8CIQKr/akBLG1APEtHnacBCJprVLABjwKbbAEaZkUxPUw5cpR/bmhrT5EAAQA+Ao8CmgW6ACYAibIgJygREjkAsABFWLAOLxuxDhw+WbAARViwGS8bsRkUPlmyABkOERI5sAAvtm8AfwCPAANdsj8AAXG2DwAfAC8AA12yXwABcrAOELIHAgorWCHYG/RZsgoOGRESObAAELImBAorWCHYG/RZshQmABESObIdGQ4REjmwGRCyIAIKK1gh2Bv0WTAxATMyNjU0JiMiBhUjNDYzMhYVFAYHFhUUBiMiJjUzFBYzMjY1NCcjAQlUSkg/RjlLnaN8iZxGQpWqiISmnk9DRkmcWARlPTAtOjMpYnt5aDdbGSmPan1+ay08PDNxAgAAAQB7BNgCHAX+AAMAIwCwAi+yDwIBXbAA0LAAL7QPAB8AAl2wAhCwA9AZsAMvGDAxATMBIwE84P70lQX+/toAAAEAmv5gA+4EOgASAFCyDRMUERI5ALAARViwAC8bsQAYPlmwAEVYsAcvG7EHGD5ZsABFWLAQLxuxEBI+WbAARViwDS8bsQ0QPlmyBAEKK1gh2Bv0WbILBw0REjkwMQERFhYzMjcRMxEjJwYjIicRIxEBUwFndMc+uqcJXaqTUbkEOv2Ho5yYAyD7xnOHSf4rBdoAAQBDAAADQAWwAAoAK7ICCwwREjkAsABFWLAILxuxCBw+WbAARViwAC8bsQAQPlmyAQAIERI5MDEhESMiJDU0JDMhEQKGVOb+9wEK5gENAgj+1tX/+lAAAAEAkwJrAXkDSQAJABayAwoLERI5ALACL7EICitY2BvcWTAxEzQ2MhYVFAYiJpM5cjs7cjkC2TBAQDAvPz8AAQB0/k0BqgAAAA4AQbIFDxAREjkAsABFWLAALxuxABA+WbAARViwBi8bsQYSPlm0EwYjBgJdsgEGABESObEHCitY2BvcWbABELAN0DAxIQcWFRQGIycyNjU0Jic3AR0MmaCPB09XQGIgNBuSYXFrNC8sKgmGAAEAegKiAe8FtwAGAECyAQcIERI5ALAARViwBS8bsQUcPlmwAEVYsAAvG7EAFD5ZsgQABRESObAEL7IDAgorWCHYG/RZsgIDBRESOTAxASMRBzUlMwHvndgBYxICogJZOYB1AAACAHoCsgMnBcQADAAaAECyAxscERI5sAMQsBDQALAARViwAy8bsQMcPlmyChsDERI5sAovshADCitYIdgb9FmwAxCyFwMKK1gh2Bv0WTAxEzQ2MzIWFRUUBiAmNRcUFjMyNjU1NCYjIgYHeryam7y7/sy+o2FUU19hU1FgAgRjnsPBpkqfwsKlBmRyc2VOY3JuYQD//wBmAJgDeAO1ACYAmw0AAAcAmwFqAAD//wBVAAAFkQWtACcAov/bApgAJwCcARgACAEHAKUC1gAAABAAsABFWLAFLxuxBRw+WTAx//8AUAAABckFrQAnAJwA7AAIACcAov/WApgBBwCjAx4AAAAQALAARViwCS8bsQkcPlkwMf//AG8AAAXtBbsAJwCcAZcACAAnAKUDMgAAAQcApAAxApsAEACwAEVYsCEvG7EhHD5ZMDEAAgBE/n8DeARNABgAIgBXsgkjJBESObAJELAc0ACwEC+wAEVYsCEvG7EhGD5ZsgAQIRESObIDEAAREjmwEBCyCQEKK1gh2Bv0WbAQELAM0LIVABAREjmwIRCyGwUKK1gh2Bv0WTAxAQ4DBwcUFjMyNjUzBgYjIiY1NDc3NjUTFAYiJjU0NjIWAkwBKWC4CwJ0bWR9uQLht8TWoG1CwTdsODhsNwKoan92wWMlbXNxW6HMybOtr3FOkgE9LT4+LSw8PAAC//IAAAdXBbAADwASAHcAsABFWLAGLxuxBhw+WbAARViwAC8bsQAQPlmwAEVYsAQvG7EEED5ZshEGABESObARL7ICAQorWCHYG/RZsAYQsggBCitYIdgb9FmyCwAGERI5sAsvsgwBCitYIdgb9FmwABCyDgEKK1gh2Bv0WbISBgAREjkwMSEhAyEDIwEhFSETIRUhEyEBIQMHV/yND/3MzeIDcAO3/U0UAk79uBYCwfqvAcgfAWH+nwWwmP4pl/3tAXgC3QABAFkAzgPdBGMACwA4ALADL7IJDAMREjmwCS+yCgkDERI5sgQDCRESObIBCgQREjmwAxCwBdCyBwQKERI5sAkQsAvQMDETAQE3AQEXAQEHAQFZAUr+uHcBSQFJd/64AUp3/rX+tQFJAVABT3v+sQFPe/6x/rB7AVH+rwAAAwB2/6MFHQXsABcAIAApAGayBCorERI5sAQQsB3QsAQQsCbQALAARViwEC8bsRAcPlmwAEVYsAQvG7EEED5ZshoQBBESObIjEAQREjmwIxCwG9CwEBCyHQEKK1gh2Bv0WbAaELAk0LAEELImAQorWCHYG/RZMDEBFAIEIyInByM3JhE1NBIkMzIXNzMHFhMFFBcBJiMiAgcFNCcBFjMyEjcFCZD++LCrg2GOkL6SAQus1pRnjZ+JAvwsYgI0Zqa20QMDFTj921t5uswDAqnW/sGoUpvnwAFoU9IBQqt9pf+7/tpj9I0DiG/+6/YNtoP8j0ABD/0AAgCmAAAEXQWwAA0AFgBXsgkXGBESObAJELAQ0ACwAEVYsAAvG7EAHD5ZsABFWLALLxuxCxA+WbIBAAsREjmwAS+yEAALERI5sBAvsgkBCitYIdgb9FmwARCyDgEKK1gh2Bv0WTAxAREhMhYWFRQEIyERIxETESEyNjU0JicBYAEXk9x3/vjj/u66ugEVjqCgiAWw/ttpwn7C5/7HBbD+Q/3el3h7lwEAAQCL/+wEagYSACoAabIhKywREjkAsABFWLAFLxuxBR4+WbAARViwEy8bsRMQPlmwAEVYsAAvG7EAED5ZsgoTBRESObIOBRMREjmwExCyGgEKK1gh2Bv0WbIgEwUREjmyIwUTERI5sAUQsigBCitYIdgb9FkwMSEjETQ2MzIWFRQGFRQeAhUUBiMiJic3FhYzMjY1NC4CNTQ2NTQmIyIRAUS5z7q0xYBLvFbLtlG1JisxhzVrcUq9V4toWNoEV9Drs599y0UzX5CITJ+yLBybICxeUjRgk4pRWc9UXmv+2wADAE7/7AZ8BE4AKgA1AD0AxrICPj8REjmwAhCwLtCwAhCwOdAAsABFWLAXLxuxFxg+WbAARViwHS8bsR0YPlmwAEVYsAAvG7EAED5ZsABFWLAFLxuxBRA+WbICHQAREjmyDAUXERI5sAwvtL8MzwwCXbAXELIQAQorWCHYG/RZshMMFxESObIaHQAREjmyOh0AERI5sDovtL86zzoCXbIhAQorWCHYG/RZsAAQsiUBCitYIdgb9FmyKB0AERI5sCvQsAwQsi8BCitYIdgb9FmwEBCwNtAwMQUgJwYGIyImNTQ2MzM1NCYjIgYVJzQ2MzIWFzY2MzISFRUhFhYzMjc3FwYlMjY3NSMGBhUUFgEiBgchNTQmBO7++4hB4o2nvOPd325oaYy48rtzsDI/rmnS6P0oB66VlHkvQJ78CUieMuR1jGoDUHOVEQIahhS0Vl6tl52uVWt7blETj7VTU09X/v/pc7C/TB+IeZZKNu0CblNNXQM0q4sfhJMAAAIAfv/sBC0GLAAdACsAVLIHLC0REjmwBxCwKNAAsABFWLAZLxuxGR4+WbAARViwBy8bsQcQPlmyDxkHERI5sA8vshEZBxESObIiAQorWCHYG/RZsAcQsigBCitYIdgb9FkwMQESERUUBgYjIiYmNTQ2NjMyFyYnByc3Jic3Fhc3FwMnJiYjIgYVFBYzMjY1AzT5ddiGh9x5cM+Bo3kwjdpJwIS3Oe+vvUloAiGLXJGip4B9mQUV/vj+Z12e/ZCB4IaT6YJyw42UY4NbMZ82i4Fk/PM4PUm/p4zE4rgAAAMARwCsBC0EugADAA0AFwBOsgcYGRESObAHELAA0LAHELAR0ACwAi+yAQEKK1gh2Bv0WbACELEMCitY2BvcWbEGCitY2BvcWbABELEQCitY2BvcWbEWCitY2BvcWTAxASE1IQE0NjIWFRQGIiYRNDYyFhUUBiImBC38GgPm/aA5cjs7cjk5cjs7cjkCWLgBOjBAQDAvPj78/jBAQDAuPz8AAAMAW/96BDQEuAAVAB0AJgBjsgQnKBESObAEELAb0LAEELAj0ACwAEVYsAQvG7EEGD5ZsABFWLAPLxuxDxA+WbIjAQorWCHYG/RZsiEjBBESObAhELAY0LAEELIbAQorWCHYG/RZshkbDxESObAZELAg0DAxEzQ2NjMyFzczBxYRFAYGIyInByM3JhMUFwEmIyIGBTQnARYzMjY1W3vhj25eSXxmw3zgkGhWSnxkzblhAVc+SIqoAmZX/qw3QounAief/YsqlM2a/sCe/okjlcuVATfCbwK2INq1tm/9UBnbuQACAJX+YAQnBgAADwAaAGSyGBscERI5sBgQsAzQALAIL7AARViwDC8bsQwYPlmwAEVYsAYvG7EGEj5ZsABFWLADLxuxAxA+WbIFDAMREjmyCgwDERI5sAwQshMBCitYIdgb9FmwAxCyGAEKK1gh2Bv0WTAxARQCIyInESMRMxE2MzISESc0JiMiBxEWMzI2BCfiwcVxublxwsPjuZyIqFRTq4WdAhH3/tJ9/fcHoP3KhP7a/voEt9SV/fuU0wAAAQCbAAABVQQ6AAMAHQCwAEVYsAIvG7ECGD5ZsABFWLAALxuxABA+WTAxISMRMwFVuroEOgAAAgBo/+sHCQXEABcAIwCRsgEkJRESObABELAa0ACwAEVYsAwvG7EMHD5ZsABFWLAOLxuxDhw+WbAARViwAC8bsQAQPlmwAEVYsAMvG7EDED5ZsA4QshABCitYIdgb9FmyEwAOERI5sBMvshQBCitYIdgb9FmwABCyFgEKK1gh2Bv0WbADELIYAQorWCHYG/RZsAwQsh0BCitYIdgb9FkwMSEhBiMiJgInETQSNjMyFyEVIREhFSERIQUyNxEmIyIGBxEUFgcJ/LCycqL+jAGL/qJ8qgNG/S0Cd/2JAt37jHFmbWytwgLDFZYBD6sBNawBEZcUnv4snf38Gw4Ejg/lz/7H0+sAAAMAYf/sBwAETgAgACwANACWsgY1NhESObAGELAm0LAGELAw0ACwAEVYsAQvG7EEGD5ZsABFWLAKLxuxChg+WbAARViwFy8bsRcQPlmwAEVYsB0vG7EdED5ZsgcKFxESObIxChcREjmwMS+yDgEKK1gh2Bv0WbAXELISAQorWCHYG/RZshQKFxESObIaChcREjmwJNCwBBCyKgEKK1gh2Bv0WbAt0DAxEzQ2NjMyFhc2NjMyFhUVIRYWMzI3FwYjIiYnBgYjIgA1FxQWMzI2NTQmIyIGJSIGByE1NCZheduOick9QcRwz+r9Mgekhrx4Son1h80/PseG3P74uaCLiaChioeiBC1jlhYCDokCJ6D+iXVkZnP+63SqxWx+hHBkY3EBMP4Jt9jXzrbZ1tajihp9lgAAAQCpBOQDBgYAAAgANACwBC+wB9CwBy+0DwcfBwJdsgUEBxESORmwBS8YsAHQGbABLxiwBBCwAtCyAwQHERI5MDEBFSMnByM1EzMDBpmWlZn2cATuCqqqDAEQAAACAHkEtAInBlAACQAUACqyAxUWERI5sAMQsA3QALADL7AH0LAHL7I/BwFdsAMQsA3QsAcQsBLQMDEBFAYjIiY0NjIWBRQWMzI2NCYjIgYCJ3xbXHt7uHv+tUMxMERDMTJCBYBXdXasenpWL0RCYkVGAAABAHsE2QM+BegAFwA+ALADL7AI0LAIL7QPCB8IAl2wAxCwC9CwCy+wCBCyDwMKK1gh2Bv0WbADELIUAworWCHYG/RZsA8QsBfQMDEBFAYjIi4CIyIGFSc0NjMyHgIzMjY1Az57XCk8YSscKTp8eV0jOGAzHys5BdxshhQ+DT8xB2uMFDoSRC3//wCiAosEjQMiAEYAn9kATM1AAP//AJACiwXJAyIARgCfhABmZkAAAAEAYAQxAXgGEwAIACGyCAkKERI5ALAARViwAC8bsQAePlmyBQkAERI5sAUvMDEBFwYHFSM1NDYBDmpdA7hhBhNIf5OIdGbIAAEAMAQWAUcGAAAIACGyCAkKERI5ALAARViwBC8bsQQePlmyAAkEERI5sAAvMDETJzY3NTMVBgaZaV0DtwFhBBZIgpCQgmTHAAEAJP7lATsAtQAIAB6yCAkKERI5ALAJL7IEBQorWCHYG/RZsADQsAAvMDETJzY3NTMVFAaNaVsDuWP+5Ul/knZkZcr//wBoBDECuwYTACYAkwgAAAcAkwFDAAD//wA8BBYChgYAACYAlAwAAAcAlAE/AAAAAgAk/tMCZAD2AAgAEQAwsgoSExESObAKELAF0ACwEi+yBAUKK1gh2Bv0WbAA0LAAL7AJ0LAJL7AEELAN0DAxEyc2NzUzFRQGFyc2NzUzFRQGjWlbA7lj3WlbA7ph/tNIiZm5pGzTQEiJmbmka9EAAAEAigIXAiIDywANABayCg4PERI5ALADL7EKCitY2BvcWTAxEzQ2MzIWFRUUBiMiJjWKb1xbcm5eXW8DBFdwbV0lV25vWAABAGwAmQIgA7UABgAQALAFL7ICBwUREjmwAi8wMQEBIwE1ATMBHgECjf7ZASeNAib+cwGEEwGFAAEAWQCYAg4DtQAGABAAsAAvsgMHABESObADLzAxEwEVASMBAecBJ/7ZjgEC/v4Dtf57E/57AY4BjwABADsAbgNqBSIAAwAJALAAL7ACLzAxNycBF6NoAsdobkIEckIA//8ANgKQArsFpQMHAKUAAAKQABMAsABFWLAJLxuxCRw+WbAN0DAxAAABAF//7AQcBcQAIwCHshUkJRESOQCwAEVYsBYvG7EWHD5ZsABFWLAJLxuxCRA+WbIjCRYREjmwIy+yAAIKK1gh2Bv0WbAJELIEAQorWCHYG/RZsAAQsAzQsCMQsA/QsCMQsB/QsB8vtg8fHx8vHwNdsiACCitYIdgb9FmwENCwHxCwE9CwFhCyGwEKK1gh2Bv0WTAxASEWFjMyNxcGIyIAAyM1MzUjNTMSADMyFwcmIyIGByEVIRUhA1H+gAS0pXRmFHh4+P7jBrKysrIKAR3zaocUbW6ksQYBf/6AAYACHcPSIqAeASUBDHyJfQEGAR8foiPLvH2JAAEAqAKLA+sDIgADABsAsABFWLACLxuxAhY+WbIBAQorWCHYG/RZMDEBITUhA+v8vQNDAouXAAIAHwAAA80GFQAVABkAg7IIGhsREjmwCBCwF9AAsABFWLAILxuxCB4+WbAARViwAy8bsQMYPlmwAEVYsBEvG7ERGD5ZsABFWLAYLxuxGBg+WbAARViwAC8bsQAQPlmwAEVYsBYvG7EWED5ZsAMQsgEBCitYIdgb9FmwCBCyDQEKK1gh2Bv0WbABELAT0LAU0DAxMxEjNTM1NDYzMhcHJiMiBhUVMxUjESEjETPKq6vPvXCrH31xd2nd3QJJuroDq49ctco9nDJra16P/FUEOgABADwAAAPpBhUAFgBcALAARViwEi8bsRIePlmwAEVYsAYvG7EGGD5ZsABFWLAJLxuxCRA+WbAARViwFi8bsRYQPlmwEhCyAgEKK1gh2Bv0WbAGELIHAQorWCHYG/RZsAvQsAYQsA7QMDEBJiMiFRUzFSMRIxEjNTM1NjYzMgURIwMwfEzI5+e5q6sBwLFlASu5BWMU0muP/FUDq492rbg9+igAAAEAegAAAe8DFQAGADUAsABFWLAFLxuxBRY+WbAARViwAS8bsQEQPlmyBAUBERI5sAQvsgMCCitYIdgb9FmwAtAwMSEjEQc1JTMB753YAWMSAlk5gHUAAQBCAAACqwMgABYAVLIIFxgREjkAsABFWLAOLxuxDhY+WbAARViwAC8bsQAQPlmyFQIKK1gh2Bv0WbAC0LIUFQ4REjmyAw4UERI5sA4QsggCCitYIdgb9FmwDhCwC9AwMSEhNQE2NTQmIyIGFSM0NiAWFRQPAiECq/2pASxtQDxLR52nAQiaa1SwAY9sARpmRTE9TDlylH9uaGtPkQABAD7/9QKaAyAAJgBxALAARViwDi8bsQ4WPlmwAEVYsBkvG7EZED5ZsgAZDhESOXywAC8YtoAAkACgAANdsA4QsgcCCitYIdgb9FmyCgAHERI5sAAQsiYCCitYIdgb9FmyFCYAERI5sBkQsiACCitYIdgb9FmyHSYgERI5MDEBMzI2NTQmIyIGFSM0NjMyFhUUBgcWFRQGIyImNTMUFjMyNjU0JyMBCVRKSD9GOUudo3yJnEZClaqIhKaeT0NGSZxYAcs9MC06Mylie3loN1sZKY9qfX5rLTw8M3ECAAACADYAAAK7AxUACgAOAEkAsABFWLAJLxuxCRY+WbAARViwBC8bsQQQPlmyAQkEERI5sAEvsgICCitYIdgb9FmwBtCwARCwC9CyCAsGERI5sg0JBBESOTAxATMVIxUjNSEnATMBMxEHAlBra53+iQYBeaH+hN8RASuCqalmAgb+FgEhHP//ACUCHwINArYCBgARAAAAAgAlAAAE5AWwAA8AHQBmALAARViwBS8bsQUcPlmwAEVYsAAvG7EAED5ZsgQABRESObAEL7LPBAFdsi8EAV2ynwQBcbIBAQorWCHYG/RZsBHQsAAQshIBCitYIdgb9FmwBRCyGwEKK1gh2Bv0WbAEELAc0DAxMxEjNTMRITIEEhcVFAIEBxMhETMyEjc1NAInIxEhx6KiAZu+ASSfAZ/+2cRH/ubJ3vcB6dbgARoCmpcCf6j+ysldzv7KpgICmv4DARL5XfgBEwL+HwD//wAcAAAFHQc0AiYAJQAAAQcARAEwATYAFACwAEVYsAQvG7EEHD5ZsQwI9DAx//8AHAAABR0HNAImACUAAAEHAHUBvwE2ABQAsABFWLAFLxuxBRw+WbENCPQwMf//ABwAAAUdBzYCJgAlAAABBwCOAMkBNgAUALAARViwBC8bsQQcPlmxDwb0MDH//wAcAAAFHQciAiYAJQAAAQcAkADFAToAFACwAEVYsAUvG7EFHD5ZsQ4E9DAx//8AHAAABR0G+wImACUAAAEHAGoA+QE2ABcAsABFWLAELxuxBBw+WbERBPSwG9AwMQD//wAcAAAFHQeRAiYAJQAAAQcAjwFQAUEAFwCwAEVYsAQvG7EEHD5ZsQ4G9LAY0DAxAP//AHf+RATYBcQCJgAnAAAABwB5AdL/9///AKkAAARGB0ACJgApAAABBwBEAPsBQgAUALAARViwBi8bsQYcPlmxDQj0MDH//wCpAAAERgdAAiYAKQAAAQcAdQGKAUIAFACwAEVYsAYvG7EGHD5ZsQ4I9DAx//8AqQAABEYHQgImACkAAAEHAI4AlAFCABQAsABFWLAGLxuxBhw+WbEQBvQwMf//AKkAAARGBwcCJgApAAABBwBqAMQBQgAXALAARViwBi8bsQYcPlmxEgT0sBvQMDEA////4AAAAYEHQAImAC0AAAEHAET/pwFCABQAsABFWLACLxuxAhw+WbEFCPQwMf//ALAAAAJRB0ACJgAtAAABBwB1ADUBQgAUALAARViwAy8bsQMcPlmxBgj0MDH////pAAACRgdCAiYALQAAAQcAjv9AAUIAFACwAEVYsAIvG7ECHD5ZsQgG9DAx////1gAAAl8HBwImAC0AAAEHAGr/cAFCABcAsABFWLACLxuxAhw+WbEKBPSwFNAwMQD//wCpAAAFCAciAiYAMgAAAQcAkAD7AToAFACwAEVYsAYvG7EGHD5ZsQ0E9DAx//8Adv/sBQkHNgImADMAAAEHAEQBUgE4ABQAsABFWLANLxuxDRw+WbEhCPQwMf//AHb/7AUJBzYCJgAzAAABBwB1AeEBOAAUALAARViwDS8bsQ0cPlmxIgj0MDH//wB2/+wFCQc4AiYAMwAAAQcAjgDrATgAFACwAEVYsA0vG7ENHD5ZsSIG9DAx//8Adv/sBQkHJAImADMAAAEHAJAA5wE8ABQAsABFWLANLxuxDRw+WbEjBPQwMf//AHb/7AUJBv0CJgAzAAABBwBqARsBOAAXALAARViwDS8bsQ0cPlmxJwT0sDDQMDEA//8AjP/sBKoHNAImADkAAAEHAEQBKwE2ABQAsABFWLAKLxuxChw+WbEUCPQwMf//AIz/7ASqBzQCJgA5AAABBwB1AboBNgAUALAARViwEi8bsRIcPlmxFQj0MDH//wCM/+wEqgc2AiYAOQAAAQcAjgDEATYAFACwAEVYsAovG7EKHD5ZsRcG9DAx//8AjP/sBKoG+wImADkAAAEHAGoA9AE2ABcAsABFWLAKLxuxChw+WbEZBPSwI9AwMQD//wAPAAAEuwc0AiYAPQAAAQcAdQGIATYAFACwAEVYsAEvG7EBHD5ZsQsI9DAx//8Abf/sA+oF/gImAEUAAAEHAEQA1QAAABQAsABFWLAXLxuxFxg+WbEqCfQwMf//AG3/7APqBf4CJgBFAAABBwB1AWQAAAAUALAARViwFy8bsRcYPlmxKwn0MDH//wBt/+wD6gYAAiYARQAAAQYAjm4AABQAsABFWLAXLxuxFxg+WbErAfQwMf//AG3/7APqBewCJgBFAAABBgCQagQAFACwAEVYsBcvG7EXGD5ZsSwB9DAx//8Abf/sA+oFxQImAEUAAAEHAGoAngAAABcAsABFWLAXLxuxFxg+WbEwAfSwOdAwMQD//wBt/+wD6gZbAiYARQAAAQcAjwD1AAsAFwCwAEVYsBcvG7EXGD5ZsSwE9LA20DAxAP//AFz+RAPsBE4CJgBHAAAABwB5AT//9///AF3/7APzBf4CJgBJAAABBwBEAMUAAAAUALAARViwCC8bsQgYPlmxHwn0MDH//wBd/+wD8wX+AiYASQAAAQcAdQFUAAAAFACwAEVYsAgvG7EIGD5ZsSAJ9DAx//8AXf/sA/MGAAImAEkAAAEGAI5eAAAUALAARViwCC8bsQgYPlmxIAH0MDH//wBd/+wD8wXFAiYASQAAAQcAagCOAAAAFwCwAEVYsAgvG7EIGD5ZsSUB9LAu0DAxAP///8YAAAFnBf0CJgCLAAABBgBEjf8AFACwAEVYsAIvG7ECGD5ZsQUJ9DAx//8AlgAAAjcF/QImAIsAAAEGAHUb/wAUALAARViwAy8bsQMYPlmxBgn0MDH////PAAACLAX/AiYAiwAAAQcAjv8m//8AFACwAEVYsAIvG7ECGD5ZsQgB9DAx////vAAAAkUFxAImAIsAAAEHAGr/Vv//ABcAsABFWLACLxuxAhg+WbELAfSwFNAwMQD//wCMAAAD3wXsAiYAUgAAAQYAkGEEABQAsABFWLADLxuxAxg+WbEVAfQwMf//AFv/7AQ0Bf4CJgBTAAABBwBEAM8AAAAUALAARViwBC8bsQQYPlmxHQn0MDH//wBb/+wENAX+AiYAUwAAAQcAdQFeAAAAFACwAEVYsAQvG7EEGD5ZsR4J9DAx//8AW//sBDQGAAImAFMAAAEGAI5oAAAUALAARViwBC8bsQQYPlmxHgH0MDH//wBb/+wENAXsAiYAUwAAAQYAkGQEABQAsABFWLAELxuxBBg+WbEfAfQwMf//AFv/7AQ0BcUCJgBTAAABBwBqAJgAAAAXALAARViwBC8bsQQYPlmxIwH0sCzQMDEA//8AiP/sA9wF/gImAFkAAAEHAEQAxwAAABQAsABFWLAHLxuxBxg+WbESCfQwMf//AIj/7APcBf4CJgBZAAABBwB1AVYAAAAUALAARViwDS8bsQ0YPlmxEwn0MDH//wCI/+wD3AYAAiYAWQAAAQYAjmAAABQAsABFWLAHLxuxBxg+WbEVAfQwMf//AIj/7APcBcUCJgBZAAABBwBqAJAAAAAXALAARViwBy8bsQcYPlmxGAH0sCHQMDEA//8AFv5LA7AF/gImAF0AAAEHAHUBGwAAABQAsABFWLABLxuxARg+WbESCfQwMf//ABb+SwOwBcUCJgBdAAABBgBqVQAAFwCwAEVYsA8vG7EPGD5ZsRcB9LAg0DAxAAAAAAEAAADeAI8AFgBUAAUAAQAAAAAADgAAAgACFAAGAAEAAABhAGEAYQBhAGEAkwC4ATgBqgI6As0C5AMOAzgDawOQA68DxQPmA/0ESgR4BMcFPAV/Bd8GPgZrBt8HRgdbB3AHjwe2B9UIMwjWCRUJdAnICg0KTQqDCusLLQtIC3sL0Av0DEIMfgzTDR4Ngw3fDkoOdA62DuYPOw+QD8AP+BAcEDMQWBB/EJoQuhEyEZAR4xJBEqgS+hN0E7kT8RQ9FJQUrxUaFWUVsxYXFngWtRcfF3EXuBfoGDYYfRjCGPoZOxlSGZIZ2RoMGmga2hs9G5wbuxxgHI8dNR2jHa8dzB6EHpoe1h8ZH2kf5CAEIE0geSCYINMhBSFPIVshdSGPIakiCiJtIqsjJiN6I+okqCUXJWgl2SY4JlMm1idwJ54n1ygbKCUoLyhTKHcomSilKLEo6SkMKSgpRSlYKWwp6CoDKmsqvSroKzcrpivoK+gr8CxWLG0shCybLLIsyyzkLPAtBy0eLTUtTi1lLXwtky2sLcMt2i3xLgguHy44Lk8uZi59LpYurS7ELtsu8S8HLyAvOS9FL1wvcy+JL6IvuC/OL+Uv/jAUMCswQjBYMG4whzCeMLUwyzDkMPsxEwAAAAEAAAACAAAwG1GuXw889QAbCAAAAAAAxPARLgAAAADQ206a+hv91QkwCHMAAAAJAAIAAAAAAAADjABkAAAAAAAAAAAB+wAAAfsAAAIPAKACjwCIBO0AdwR+AG4F3ABpBPkAZQFlAGcCvACFAsgAJgNyABwEiQBOAZIAHQI1ACUCGwCQA0wAEgR+AHMEfgCqBH4AXQR+AF4EfgA1BH4AmgR+AIQEfgBNBH4AcAR+AGQB8ACGAbEAKQQRAEgEZACYBC4AhgPHAEsHLwBqBTgAHAT7AKkFNQB3BT8AqQSMAKkEbACpBXMAegW0AKkCLQC3BGoANQUEAKkETgCpBvwAqQW0AKkFgAB2BQwAqQWAAG0E7QCoBL8AUATGADEFMACMBRcAHAcZAD0FBAA5BM4ADwTKAFYCHwCSA0gAKAIfAAkDWABAA5wABAJ5ADkEWgBtBH0AjAQwAFwEgwBfBD0AXQLHADwEfQBgBGgAjAHxAI0B6f+/BA4AjQHxAJwHAwCLBGoAjASQAFsEfQCMBIwAXwK1AIwEIABfAp0ACQRpAIgD4AAhBgMAKwP3ACkDyQAWA/cAWAK1AEAB8wCvArUAEwVxAIMB8wCLBGAAaQSmAFsFtABpBNgAHwHrAJME6ABaA1gAZgZJAFsDkwCTA8EAZgRuAH8GSgBaA6oAeAL9AIIERgBhAu8AQgLvAD4CggB7BIgAmgPpAEMCFgCTAfsAdALvAHoDowB6A8AAZgXcAFUGNQBQBjkAbwPJAEQHev/yBEQAWQWAAHYEugCmBMIAiwbBAE4EsAB+BJEARwSIAFsEnACVAfoAmwehAGgHRABhA8QAqQKtAHkDxgB7BUAAogY/AJABmQBgAZkAMAGXACQC1ABoAtsAPALBACQCsgCKAmYAbAJmAFkDowA7Au8ANgR+AF8EkgCoBG4AHwSLADwC7wB6Au8AQgLvAD4C7wA2AfsAAAI1ACUFXQAlBTgAHAU4ABwFOAAcBTgAHAU4ABwFOAAcBTUAdwSMAKkEjACpBIwAqQSMAKkCLf/gAi0AsAIt/+kCLf/WBbQAqQWAAHYFgAB2BYAAdgWAAHYFgAB2BTAAjAUwAIwFMACMBTAAjATOAA8EWgBtBFoAbQRaAG0EWgBtBFoAbQRaAG0EMABcBD0AXQQ9AF0EPQBdBD0AXQH6/8YB+gCWAfr/zwH6/7wEagCMBJAAWwSQAFsEkABbBJAAWwSQAFsEaQCIBGkAiARpAIgEaQCIA8kAFgAWAAAAAQAAB2z+DAAACUn6G/5KCTAAAQAAAAAAAAAAAAAAAAAAAN0AAwSFAZAABQAABZoFMwAAAR8FmgUzAAAD0QBmAgAAAAIAAAAAAAAAAADgAAr/UAAhfwAAACEAAAAAR09PRwBAAAD//QYA/gAAZgeaAgAgAAGfAAAAAAQ6BbAAIAAgAAIAAAABAAAA4AkJBAAAAgICAwYFBwYCAwMEBQICAgQFBQUFBQUFBQUFAgIFBQUECAYGBgYFBQYGAgUGBQgGBgYGBgUFBgYIBgUFAgQCBAQDBQUFBQUDBQUCAgUCCAUFBQUDBQMFBAcEBAQDAgMGAgUFBgUCBgQHBAQFBwQDBQMDAwUEAgIDBAQHBwcECAUGBQUIBQUFBQIJCAQDBAYHAgICAwMDAwMDBAMFBQUFAwMDAwICBgYGBgYGBgYFBQUFAgICAgYGBgYGBgYGBgYFBQUFBQUFBQUFBQUCAgICBQUFBQUFBQUFBQQEAAAAAwAAAAMAAAAcAAMAAQAAABwAAwAKAAABYAAEAUQAAAA2ACAABAAWAAAADQB+AKAArACtAL8AxgDPAOYA7wD/ATEBUwLGAtoC3CAUIBogHiAiIDogRCB0IKwiEv//AAAAAAANACAAoAChAK0ArgDAAMcA0ADnAPABMQFSAsYC2gLcIBMgGCAcICIgOSBEIHQgrCIS//8AAf/2/+QABv/C//r/wQAA/+gAAP/iAAD/Wv86/cj9tf204H7ge+B64HfgYeBY4Cnf8t6NAAEAAAAAAAAAAAAAAAAAAAAoAAAAMgAAAFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqQCqAKsArACtAK4AgQCoALgAuQC6ALsAvAC9AIIAgwC+AL8AwADBAMIAhACFAMMAxADFAMYAxwDIAIYAhwDSANMA1ADVANYA1wCIAIkA2ADZANoA2wDcAIoA3QAMAAAAAAHYAAAAAAAAACYAAAAAAAAAAAAAAAEAAAANAAAADQAAAAMAAAAgAAAAfgAAAAQAAACgAAAAoAAAAKYAAAChAAAArAAAAGMAAACtAAAArQAAAKcAAACuAAAAvwAAAG8AAADAAAAAxQAAAKkAAADGAAAAxgAAAIEAAADHAAAAzwAAAK8AAADQAAAA0AAAAKgAAADRAAAA1gAAALgAAADXAAAA2AAAAIIAAADZAAAA3QAAAL4AAADeAAAA3wAAAIQAAADgAAAA5QAAAMMAAADmAAAA5gAAAIYAAADnAAAA7wAAAMkAAADwAAAA8AAAAIcAAADxAAAA9gAAANIAAAD3AAAA+AAAAIgAAAD5AAAA/QAAANgAAAD+AAAA/gAAAIoAAAD/AAAA/wAAAN0AAAExAAABMQAAAIsAAAFSAAABUwAAAIwAAALGAAACxgAAAI4AAALaAAAC2gAAAI8AAALcAAAC3AAAAJAAACATAAAgFAAAAJEAACAYAAAgGgAAAJMAACAcAAAgHgAAAJYAACAiAAAgIgAAAJkAACA5AAAgOgAAAJoAACBEAAAgRAAAAJwAACB0AAAgdAAAAJ0AACCsAAAgrAAAAJ4AACISAAAiEgAAAJ+wACxLsAlQWLEBAY5ZuAH/hbCEHbEJA19eLbABLCAgRWlEsAFgLbACLLABKiEtsAMsIEawAyVGUlgjWSCKIIpJZIogRiBoYWSwBCVGIGhhZFJYI2WKWS8gsABTWGkgsABUWCGwQFkbaSCwAFRYIbBAZVlZOi2wBCwgRrAEJUZSWCOKWSBGIGphZLAEJUYgamFkUlgjilkv/S2wBSxLILADJlBYUViwgEQbsEBEWRshISBFsMBQWLDARBshWVktsAYsICBFaUSwAWAgIEV9aRhEsAFgLbAHLLAGKi2wCCxLILADJlNYsEAbsABZioogsAMmU1gjIbCAioobiiNZILADJlNYIyGwwIqKG4ojWSCwAyZTWCMhuAEAioobiiNZILADJlNYIyG4AUCKihuKI1kgsAMmU1iwAyVFuAGAUFgjIbgBgCMhG7ADJUUjISMhWRshWUQtsAksS1NYRUQbISFZLbAKLLAkRS2wCyywJUUtsAwssScBiCCKU1i5QAAEAGO4CACIVFi5ACQD6HBZG7AjU1iwIIi4EABUWLkAJAPocFlZWS2wDSywQIi4IABaWLElAEQbuQAlA+hEWS2wDCuwACsAsgEOAisBsg8BAisBtw86MCUbEAAIKwC3AUg7LiEUAAgrtwJYSDgoFAAIK7cDUkM0JRYACCu3BF5NPCsZAAgrtwU2LCIZDwAIK7cGcV1GMhsACCu3B5F3XDojAAgrtwh+Z1A5GgAIK7cJVEU2JhcACCu3CnZgSzYdAAgrtwuDZE46IwAIK7cM2bKKYzwACCu3DRQRDQkGAAgrtw48MiccEQAIKwCyEAoHK7AAIEV9aRhEsjASAXOysBQBc7JQFAF0soAUAXSycBQBdbIPHAFzsm8cAXUAACoAnQCAAIoAeADUAGQATgBaAIcAYABWADQCPAC8AMQAAAAU/mAAFAKbACADIQALBDoAFASNABAFsAAUBhgAFQGmABEGwAAOAAAAAAAAAAcAWgADAAEECQABAAwAAAADAAEECQACAA4ADAADAAEECQADAAwAAAADAAEECQAEAAwAAAADAAEECQAFACwAGgADAAEECQAGABwARgADAAEECQAOAFQAYgBSAG8AYgBvAHQAbwBSAGUAZwB1AGwAYQByAFYAZQByAHMAaQBvAG4AIAAyAC4AMAAwADEAMQAwADEAOwAgADIAMAAxADQAUgBvAGIAbwB0AG8ALQBSAGUAZwB1AGwAYQByAGgAdAB0AHAAOgAvAC8AdwB3AHcALgBhAHAAYQBjAGgAZQAuAG8AcgBnAC8AbABpAGMAZQBuAHMAZQBzAC8ATABJAEMARQBOAFMARQAtADIALgAwAAMAAAAAAAD/agBkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQACAAgAAv//AA8AAQAAAAwAAAAAAAAAAgAKACUAPgABAEUAXgABAHkAeQADAIEAgQABAIMAgwABAIYAhgABAIkAiQABAIsAjQABAKAAoQACAKgA3QABAAEAAAAKAFQAdAAEREZMVAAaY3lybAAmZ3JlawAybGF0bgA+AAQAAAAA//8AAQAAAAQAAAAA//8AAQABAAQAAAAA//8AAQACAAQAAAAA//8AAQADAARrZXJuABprZXJuABprZXJuABprZXJuABoAAAABAAAAAQAEAAIAAAAEAA4CDgOSBFIAAQCCAAQAAAA8AYgBiAD+AY4BnAG0AaoBBAEKARABtAEWASABQgFUAboBZgH0AWwB9AH0AfQB9AF6AfoB+gGIAYgBiAGIAbQBjgGOAY4BjgGOAY4BnAGqAaoBqgGqAbQBtAG0AbQBtAG6AfQB9AH0AfQB9AH0AfQB9AH0AfQB+gH6AAEAPAAGAAsAEwAlACcAKAApACoALwAwADMANAA4ADoAOwA9AD4ASQBKAEwAUQBSAFMAVgBaAF0AkwCUAJYAlwCoAKkAqgCrAKwArQCuAK8AsACxALIAswC5ALoAuwC8AL0AwgDKAMsAzADNANIA0wDUANUA1gDXANwA3QABABP/IAABAFb/5gABAFv/wQABAFv/pAACAFgADgCB/58ACAAE/9gAVv+1AFv/xwBt/rgAfP8oAIH/TQCG/44Aif+hAAQADQAUAEEAEQBW/+IAYQATAAQADQAPAEEADABW/+sAYQAOAAEAW//lAAMADQAUAEEAEgBhABMAAwBKAA8AWAAyAFsAEQABAFsACwADACP/wwBY/+8AW//fAAMADf/mAEH/9ABh/+8AAgBK/+4AW//qAAEAgf/fAA4ACv/iAA0AFAAO/88AQQASAEr/6gBW/9gAWP/qAGEAEwBt/64AfP/NAIH/oACG/8EAif/AAJn/0wABAJT/sAABAEoADQABABgABAAAAAcAKgAwAEIA/AESASQBPgABAAcABAAMACoANQA2AD8ASgABADj/2AAEADoAFAA7ABIAPQAWAMIAFgAuABD/FgAS/xYAJf9WAC7++AA4ABQARf/eAEf/6wBI/+sASf/rAEv/6wBT/+sAVf/rAFn/6gBa/+gAXf/oAI3/6wCV/xYAmP8WAKn/VgCq/1YAq/9WAKz/VgCt/1YArv9WAMP/3gDE/94Axf/eAMb/3gDH/94AyP/eAMn/6wDK/+sAy//rAMz/6wDN/+sA0//rANT/6wDV/+sA1v/rANf/6wDY/+oA2f/qANr/6gDb/+oA3P/oAN3/6AAFADj/1QA6/+QAO//sAD3/3QDC/90ABAA4/7AAOv/tAD3/0ADC/9AABgAu/+4AOf/uAL7/7gC//+4AwP/uAMH/7gARAAYAEAALABAAR//oAEj/6ABJ/+gAS//oAFX/6ACN/+gAkwAQAJQAEACWABAAlwAQAMn/6ADK/+gAy//oAMz/6ADN/+gAAQAUAAQAAAAFACIAUABqAHwAlgABAAUATwBYAFsAXwCUAAsAR//sAEj/7ABJ/+wAS//sAFX/7ACN/+wAyf/sAMr/7ADL/+wAzP/sAM3/7AAGAFP/7ADT/+wA1P/sANX/7ADW/+wA1//sAAQAEP+EABL/hACV/4QAmP+EAAYALv/sADn/7AC+/+wAv//sAMD/7ADB/+wACgBMACAATwAgAFAAIABT/4AAV/+QANP/gADU/4AA1f+AANb/gADX/4AAAgVQAAQAAAXGBwgAHAAYAAD/zv/1/+//iP/0/7v/f//1AAz/qf+iAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/5QAAAAD/6P/JAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/4wAAAAAAAP/kABIAEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/5QAAAAD/6v/V/+v/6v+a/+kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/4wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/5gAAAAAAAP/tAAAAFP/vAAAAAAAAAAAAAAAAAAD/7QAAAAAAAAAAAAAAAAAAAAD/uP/kAAAAAP+dAA8AEP+h/8QAEAAQ/7EAAP8mAAD/nf+z/xj/k//w/4//jP8QAAD/2P/hAAAAAP/lAAAAAP/pAAAAAAAAAAAAAAAAAAD/5gAA/8D/6QAAAAAAAAAAAAD/e/+//8r+sAAA/3H+7f/UAAD/Uf8RABMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAAAAP/zAAAAAAAAAAAAAAAA/3b/4f68/+b/8wAAAAAAAAAA//UAAP84AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/9f/zAAAAAP/SAAAAAP/kAAAAAAAA/7UAAP8fAAD/1AAA/9sAAAAA/9IAAAAAAAD/4f/nAAAAAP/rAAAAAP/rAAAADgAAAAAAAAAAAAD/5gAA/9IAAAAAAAAAAAAAAAD/7P/j/6AAAP+/ABEAEf/Z/+IAEgAS/6IADf8tAAD/v//p/8z/2P/w/7f/xv+gAAAAAAAAAAAAAP/hAAAADv/tAAAAAAAA/9UAAP+FAAD/4QAA/8QAAAAA/98AAAAAAAD/5f/mAAAAAP/rAAAAAP/tAAAAAAAAAA0AAAAAAAD/6wAAAAAAAAAAAAAAAAAAAAD/8QAAAAD/vQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/9QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/9QAAAAD/4wAAAAAAAAAA//EAAAAAAAAAAAAAAAAAAP/xAAAAAAAAAAAAAAAAAAD/8wAAAAD/8gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/mAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/8QAAAAD/eAAAAAAAAAAA//AAAAAAAAAAAAAAAAAAAP/rAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//xAAAAAAAAAAAAAAAAAAAAAP+VAAD/8wAAAAAAAAAA//EAAAAAAAAAEgAAAAAAEP/sAAAAAAAAAAAAAAAAAAAAAP+FAAD/7QAAAAAAAAAA/9gAAAAAAAAAAAAAAAAAAP/sAAAAAAAAAAAAAAAAAAAAAAAAAAD/7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/wAAAAAAAAAAAAAAAAAAAAAAAAAAD/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/lf/DAAAAAAAAAAAAAAAA/4gAAAAAAAD/xQAAAAD/7AAA/87/sAAAAAAAAAAAAAD/VgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAEwAGAAYAAAALAAsAAQAQABAAAgASABIAAwAlACkABAAsADQACQA4AD4AEgBFAEcAGQBJAEkAHABMAEwAHQBRAFQAHgBWAFYAIgBaAFoAIwBcAF4AJACKAIoAJwCTAJgAKACoAM0ALgDSANcAVADcAN0AWgACADUABgAGABoACwALABoAEAAQABsAEgASABsAJgAmAAEAJwAnAAQAKAAoAAMAKQApAAUALAAtAAIALgAuAAoALwAvAAcAMAAwAAgAMQAyAAIAMwAzAAMANAA0AAkAOAA4AAYAOQA5AAoAOgA6AAsAOwA7AA4APAA8AAwAPQA9AA0APgA+AA8ARQBFABAARgBGABIARwBHABEASQBJABMATABMABQAUQBSABQAUwBTABUAVABUABIAVgBWABcAWgBaABYAXABcABgAXQBdABYAXgBeABkAigCKABIAkwCUABoAlQCVABsAlgCXABoAmACYABsAqACoAAMArwCvAAQAsACzAAUAtAC4AAIAuQC9AAMAvgDBAAoAwgDCAA0AwwDIABAAyQDJABEAygDNABMA0gDSABQA0wDXABUA3ADdABYAAgA0AAYABgAEAAsACwAEABAAEAAOABEAEQASABIAEgAOACUAJQAMACcAJwACACsAKwACAC4ALgAXADMAMwACADUANQACADcANwAUADgAOAAHADkAOQADADoAOgAKADsAOwAGADwAPAANAD0APQALAD4APgAPAEUARQAVAEcASQAQAEsASwAQAFEAUgATAFMAUwAFAFQAVAATAFUAVQAQAFcAVwAWAFkAWQAIAFoAWgABAFwAXAARAF0AXQABAF4AXgAJAIMAgwACAIwAjAACAI0AjQAQAJEAkgASAJMAlAAEAJUAlQAOAJYAlwAEAJgAmAAOAKcApwASAKkArgAMAK8ArwACALkAvQACAL4AwQADAMIAwgALAMMAyAAVAMkAzQAQANIA0gATANMA1wAFANgA2wAIANwA3QABAAAAAQAAAAoALABIAAFsYXRuAAgACgABVFVSIAASAAD//wABAAAAAP//AAEAAQACbGlnYQAObGlnYQAWAAAAAgAAAAEAAAABAAEAAgAGACAABAAAAAEACAABACwAAQAIAAEABACgAAIATQAEAAAAAQAIAAEAEgABAAgAAQAEAKEAAgBQAAEAAQBK) format('truetype')}#toasty .toast.toasty-theme-default{font-family:Tahoma,Geneva,sans-serif!important;font-size:12px;border-radius:0}#toasty .toast.toasty-theme-default .close-button:after{content:'x';color:#fff;font-size:17px;font-weight:100}#toasty .toast.toasty-theme-default .toast-text{color:#fff}#toasty .toast.toasty-theme-default .toast-text .toast-title{font-size:13px}#toasty .toast.toasty-theme-default .toast-text a,#toasty .toast.toasty-theme-default .toast-text label{color:#fff}#toasty .toast.toasty-theme-default .toast-text a:hover,#toasty .toast.toasty-theme-default .toast-text label:hover{color:#f2f2f2}#toasty .toast.toasty-theme-default.toasty-type-default{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NEEzQTA1RTUzMjJBMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NEEzQTA1RTYzMjJBMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0QTNBMDVFMzMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0QTNBMDVFNDMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pr4ktvwAAADlSURBVHja7NrRDYIwEIDh1jAAozhKN/BWcgJ0A0dgBEbRCbCNkphaTAsPXpv/kkugELgv5eCh2HmeTQtxMI0EEG3RxQPW2mXT+Tz57JXUevd59XkLO1+9HQY+8x1DOKQ0h2TdCYhTjFjSxXWnekQqaAnJafa+AkjP6xcIECBAgAABAgQIECBAgAABAgQIECC7Y2oB8vB5qR0SEJKakW7Dxc7mtejyj8dpXL13Yn0knLy2LiFapiZnoWfUjtgDEW3NsgUiGru+FCJaX18lELWIEohqRC7kWMOXMa7b8ncQECA/4ynAAPBVcVo7OMcUAAAAAElFTkSuQmCC)!important;background-color:#efefef}#toasty .toast.toasty-theme-default.toasty-type-default .close-button:after{color:#000!important}#toasty .toast.toasty-theme-default.toasty-type-default .toast-text{color:#4b4b4b}#toasty .toast.toasty-theme-default.toasty-type-default .toast-text a,#toasty .toast.toasty-theme-default.toasty-type-default .toast-text label{color:#4b4b4b}#toasty .toast.toasty-theme-default.toasty-type-default .toast-text a:hover,#toasty .toast.toasty-theme-default.toasty-type-default .toast-text label:hover{color:#585858}#toasty .toast.toasty-theme-default.toasty-type-info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NEEzQTA1RTkzMjJBMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NEEzQTA1RUEzMjJBMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0QTNBMDVFNzMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0QTNBMDVFODMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvCIVOQAAALtSURBVHja3Jq9axRBGMZnj+ViAhbaaISLR1AUBBNjEq7zD7gUiqIIgraKVf4Ay9gljYVFiliJEklyJE26dJsPYy5pE/AQtNNC8SMXHJ/BN7C3O/exe+/c7twLP5jmZp7ndnZ25n3HkVKKboiM6JJwmfrpA6fACCiAIXAB5H1/1l/wEeyDMvDANvgGfrYrwGlzavWDcfAQ3IrZxwJ4BTbAl9hKlJEY5MADsCv5Ypf6zMXRFPUHLigCT5oLj8ZwTRk5C57LzoUaq5/byFWwLDsfS+Ayl5EC87sQNTZJQ0OdzVYttYS+oWU1yVDL9D1auiN/EM+BmRSYEKRhhjRFMpIFT0ExRR/vImnKRvkgqh+9Az0p24n8AbfBSitPZAA8YzJRBT+IKkN/PaRtoJkRB9ygbQdHzILTxCxTn+Ok0WlkRO2dJhmnwhE9iSq1uWKStGqNOOR2mHHAM7TijFCbK4ZJq6N72U+A1+Am44C/wHdqnwS9jH0vgvvgd9CIWqM/WXTYUuebHPgcnFqjlp0YM6Q59I4UDAymDkuPiQ0D/Rd0R90hQ0ZeUvsK47Ie0uw3Mmjo8WcNJjoGdVMrb2Agp06bK/I6I66wL9yuy2tlAtsJ2+JIZ6RioZGKzsiBhUYOdEbKFhop64x4FhrxdEa2VAbVIhOSNIeMfAUli4yUSHPIiDrYz1lkZI40h4xI2uTtWGBih7TKel92VZ+YNjCXud+9aRGopbiaQdfILceWewJcpPYlxqPBWvDPqZegUwLmRToTdHfAcqO9lj9W6fGlaTmWpGm12abRH4fghdCkJhOMFdJ0qD34tFBWeAuuJWziA7grYpYVBP3wifhfn0gqtknDfuOJ11rpTZW/SglUq0qcpbdjVGFyqoMmpkwUQ/3l6QmwbtDAOo3hmqyzBy8M7DEa2GvnwkC7VzhUvngMPBLxk9+LtAHcFJTHjZV3YrrmdHyp5rqovVRzXtReqqmI2ks170VKLtWkMh1kdfwTYADvtL/RevtcWAAAAABJRU5ErkJggg==)!important;background-color:#3ebfa8}#toasty .toast.toasty-theme-default.toasty-type-wait{background-image:url(data:image/gif;base64,R0lGODlhIAAgAPcAAAAAACZOTh5eXiJSViZUVCRUViZUVlp+gCJWVjxmaC5cXGKEhlyAgE50dM7Y2MzY2GCEhDRgYjhiZDhkZDhkZkJsbFZ8fDpmZjxmZkZucEhwckpwckpyckpydExydEx0dFB2eFp+flJ4elZ6elZ6fKq8vFh+fmCAgmKGhsbS0maGiJywsGSEhrTExJiurn6amrLCwhhMTCJUVq7AwCJUVBxUVCRSVCJSVCRSViRSUiJSUmyKjChWVj5oajJeYE50djZiYjpkZkRsblh8fkhwcFJ4eFR4elh8fChYWCpUVCpYWCpYWixaWixaXC5aXIagoDRgYCRUVD5oaEBqakRubkBqbEJqbE52diZWVjBcXjZgYihWWDJgYCZWWCRaWi5cXjBeXlB2dlp8fjJeXiRWVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEFAGUAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAIAAgAAAI/gDLCBxIsEyUAgUG0KCBsACBghAjliEwwEbDiw1xFNAhMWIBjRgbZkGCseNAHg15SGCCMcKBAwkw0uiIgGEBHkYOgCBwscLLCiEfQuRhswCSEC8jNCQAImlIHDMLhvR54AdPoy8PoHwqNaQSpAeUFgDy8sdFAhF6GEg4kADIs0LKIqQ6pefLHgVqChxgNAvGJVl9FGjgtACTpi8/NBRoUYNOClsLZDhgQkGBCBs6YCkgwUTWDiQRGsSa1UIPkkgmhL6YICtMjFcJVAD7MkTMkAh7vBRhGXdDJD0sZOXgu4CBDBlWY+SLUUJTscWL47jhW7nvCUJ6XADiQ8HaAdSD/q6NbmABivPoDyREcBGJhAwWLFjHyAO9fQgfES7pccX1ASDRETBBBhw0IIIFDBDHnmT+HWBBb7jxdFWEBbRWVg8KTBjUCymEUFwZOPAwhQQ8TOiDBcmd9YMDLJ5gUUll+IaFCC/FpEAFUxjgQwssOsDCi4uVocOCdlHGEmEHCBYBDD3u8CINZAwUkg9Z3bbBSxIg5MMMPaoQZFsNzfiSB1fF9RpCCpTA4hMEREVQUVSZsERDuh0AVEMKrODCEgTkEJFbBdQ5wUUTvKQBbAQQgEVHNGgUQQIaUnlAAyHR4KdJZQxAJJ4vgXARQ5i+iZsECUBYQJShQnQVDgMMgMOCA5gGBAAh+QQBBQBcACwAAAAAIAAgAIcAAAAmTk4eXl4iUlYmVFQkVFYmVFZafoAiVlY6ZmYsWlpmhohKcHKetLQyYGCesrI2YmI4YmQ4ZGQ4ZGZAampQdnhCbGxEbG5Ebm5GbnBIcHBIcHJOdHZWenpSeHhQdnZWfHxSeHpUeHpUenpWenxYfHxYenxYfH5Yfn5afn6csrKYrq4YTEwiVFYiVFQcVFQiUlQkUlaMpKYkUlIiUlKKoqSGoKKEnqB6lph4lJZqiowoVlY+aGguXFxMcnQ0YGJAamxOdnYoWFgqVFQqWFgqWFouXF4wXF4wXl4yXmBKcnRKcnIkVFQ8Zmg+aGpCamw8ZmYmVlYuWlw0YGAoVlhMdHQwXFwmVlhOdHQkWlosWlwkVlYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gC5CBxIkAuTAgUGuHCBsACBghAjciEwYEbDiw1jFKAhMWIBjRgbGhGCsePAHQ13RFCA8ceBAwkwuuiIgGGBHSIOVCBw0cJLCyEfQtxhs4AQFC8hNCRQ4eWPkDFmFgzp8wAHnkZfHkAJdWpIIkgPOEAI4SWHiwQcUDCQcCABkGgvmEVYlULPl3ZrChxg9AhGBVqRFODgFKGCpi+rNBRokYHOBFwLYDhwokcBBwx8RCkQ4YRWHyQRGsyqtQMFkkIkhL7IQ+uBJhixErAQ9iUKHiEbtj4QwnLuhkJ4gPj8u4CBDBhWY+SLMULTp8Wjx4DxW/lvCBQSRPhxRMHmAdSD+7KNTsC11hAJEVwUEiEDiA7WMUYxb/sjwiIUPphXGh07hswVjJBBAepJRh8IvuVGwHi/8dSEVhzw0ANWuRmwwAo+UFhSDDtQEMEOFCIBQgbKzdZAAw+cFZJAv0XhwUu49WDBWj3IcGIDHqzIBQ0F3nVACSwRJlYBR9RwYwkNubDFQCE5oFVMBTh2QAQI9WDDjSJgVRCFLr6UIUJyHYCbYTecqAMBUhFUVFUnsITQbkA1pAAOORBBwAwRvVUABS9JcJEELzEQGwEERNGRCxpBkICGTloVkgt4msTFAD021MNLFVzEkKRq5hZBAgkWsCSnEGEVwwADxFCgpAEBACH5BAEFAGQALAAAAAAgACAAhwAAACZOTh5eXiJSViZUVCRUViZUVlp+gCJWVj5oaCxaWmCCgl6Agk50dtji4jRgYqq8vDhiZDhkZDpmZjxmZjxmaERublZ6fD5maEpyckx0dE50dFJ4eFh+flR6elh8fFp+flZ6elh8fm6OjrTExmyMjq6+wHSSkp6ytBhMTCJUViJUVBxUVCRSVCJSVCRSViRSUiJSUiJQUmqKjISenmSGhihWWEBqbDBeXlB2djZiYjhkZkZucFZ8fEpydFJ4eoCcnIigoipUVGKEhCpYWk52djRgYHiUlCRUVIykpEZubpywsD5oakJsbEhwcExydEBqakJqbERsbkpwciZWVi5cXChYWDJgYFB2eFR4eipYWCZWWChWViRaWmaGhi5cXjJeYDBcXiRWVkhwcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+AMkIHEiQDJICBQasWIGwAIGCECOSITCgRcOLDV8UiCExYgGNGBviIIKx40AbDW1EUIDxwYEDEzCu6IiAYQEbHg5wIHCxycsbIR9CtGHzZoeXDxoSyIE05IuZBUP6PNCA582XB1A6jRqSyNEDSQvoeNngIoEHTAwkHEgApFkLZBFOBdpwKpMCNQUOuIkDowKsfRs0LaCA6UsNDQVazKBzgtYCcDtUKfAggwYqBSJ8PaCBJEKDV7FeYELShgTPFxNgPUABo1UCTTYf6JAgZEPVBzxMtp0ywQWsGXgXMMDDwmOMezFG4ABWuPOPLngf562DyYQID3AowDwgelC1zgn8rMbqISGCi0Qi8PhwYTpGKuNfdviIkAgTw1h1PNdxw4LlHB7wgBdCcI13wW68WZVgARVg1UACVSgYVAYzUCDhRWS8YMMNEdigIA4f8KAVASRGMMKJCVxYgEC8UcHcASnyQAMQNhAxxIkj3HChQDGch9FUHShAAAQOOFCWAjee2IRVK4gxUEhXYBUTASgUOQRCCiyA45KfEaSgi4fxREASRZ5gFREMnFgWVAQVdYN8LDl0RJFBKOhVewTAEFFbBTDxkgQXeVHkEha5RkVHK2j0wAQSclCkCYU2tIKeJpExgI+pFUlCpAxV2mZQNYyQQKROegqRVS9094KPlQYEACH5BAEFAF0ALAAAAAAgACAAhwAAACZOTh5eXiJSViZUVCRUViZUVlp+gCJWVjxmaCxaWl6Agk50dqi8vDRgYo6mpjhiZDhkZDhkZkJsbFZ6ejpkZjpmZjxmZkZubkhwcEpwckpyckpydExydEx0dE50dFB2eFh+flJ4eFR4eFJ4elh8fFp+flR4elR6elh8foqipBhMTCJUViJUVBxUVCJSVCRSVoagoiRSUiJSUnyYmnyYmHCOjm6MjmqKjChWVkBqajJeYGiIilB2djZiYkRsblZ6fEZucEhwclJ2eChYWCpUVGKEhCpYWCpYWk52djRgYCRUVDZiZD5oaEJqbERubkBqbD5oaiZWVi5cXChWWDJgYCZWWCRaWi5cXjBcXjBeXlZ8fCRWVgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+ALsIHEiwy5ICBQa0aIGwAIGCECN2ITBARsOLDWEUmCExYgGNGBtiIYKx48AcDXNAUIDRwYEDCTC26IiAYYEcJw6AIHBxwssJIR9CzGGzAJEQLx00JAAiaUgYMwuG9HmAAU+jLw+gfCo15BGkB5QW8PGSwUUCDnQYSDiQAMizP8oipKqj58u6NQUOMJoFo4KsOwowcFpAQdOXHhoKtKhBp4StBTAcCDGlgAMNHKQUgAD2AAeSCA1izUpBB0kiEUBfTJAVJsarBCZ0nhwzJMImL0lUtt2QSBMgWTfwLmAgCAbVGPdihNBU7PDhMF7wRs7bh44EEBxkUaB5gPSga5/2E2idlURCBBeJQMhQggJ1jFLIvwzxESESHT3I+3g+VgeGDB2AgEIQBaAXmXxA7MYfbzyxVlYTU1zFm2z78dYFDDnoAEEOEu5QQhDU7ZAVBBIq1gVvUojwUgIENIEDDzkQQUJWEZRYgEAzGGjXZAoQEEMDDQB1xGEwXdUCFwOFJOKKDtEApAgIEUFkBSa21VCKL3VwlQ1ALnCVlC/9UEBUBBVFVQgsIWQEkDdImMMGGkhBgAwRuVWADi9FcNEJQNJgGwFSdNSCRg6weBEGQKoQUgt0mtTFADo2BAGQD1zEkKNlBjXCARBchCSmEF0FwwADwGCgowEBACH5BAEFAGYALAAAAAAgACAAhwAAACZOTh5eXiJSViZUVCRUViZUVlp+gCJWVj5oaC5cXF6AgFyAgFB2duTq6tjg4jZiYjhiZDpiZDhkZDhkZjpkZjpmZjxmZjxmaERublh8fj5maHiWluLo6EpwckpydNri4kxydEx0dE50dE50dk52dlJ4elp+flR6elZ6elZ6fFh+flZ8fHSSknqWmHKQkMjU1IykpIiiotbe4JqwsBhMTCJUViJUVBxUVCRSVCJSVCRSVoCanLDAwiRSUiJSUsbS0myKjChWWEJqbDRgYFB2eEZucEpyclR4emiIiGSGhmKEhihYWCpUVCpYWCpYWixYWixaWi5aXDRgYiRUVEBqakJsbEhwcD5oakBqbERsbkhwciZWVjBcXiZWWChWViRaWi5cXjBeXjJeYCRWVjJgYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+AM0IHEjQDJUCBQbcuIGwAIGCECOaITAgR8OLDXcU+CExYgGNGBt2YYKx40AhDYVEiIKRyIEDFjDe6IiAYQEhKA4UIXDRysshIR9CFGLz5omXEBoSaPBySsgdMwuG9HmgAc+bLw+gfCo1pJOjB4gghPCywUUCRKoYSDiQAMizGV6SQEgVaMMhL6sUqClwwM0uGJ9kFVNgRFOEUZi+FNFQoEUPOilsLRBXg4ICRDx84FIggoasH0giNIg1a4oqJIVMEH0xQdYDFzBeJTAE7MsTCUI2dH3AxGXdKROoAA28gAEjGSZj9IsxQpGwxaN/1AFcOXAIVSxEINIlCucB1IP+ro1O4HVWEwkRXGQSwQiLFNYxcjF/+yPCJ1UUZ00aHcKQDB6E0AAKRuyFUFzmqfCbdMDxhEFWDSSgAAEEWKTbEBrwp5sZOwhRRQRCXFWACDPQsCBCLr0UgYiNmQGcE0A44IALBEBQRANCMGFCVhOwWIBAP6h3VgwygpCbEhxwMEEBTjz30gVX3UDGQCE1IKMDL/C0QJJ2MaFfBS221RAUMMjYw1UoJOlBSoplUEBUBNlEgAwyPiBBQyEkiYKIQnzgARcE+BCRWwTwIGMQIlqRJAM+OsRFRzfsQMACLbBYQZJK+HiDoCaZMQACPnaRZBIiMtRpnEFZYYQYIk55KkQKV+0wwAA7CNlpQAAh+QQBBQBcACwAAAAAIAAgAIcAAAAmTk4eXl4iUlYmVFQkVFYmVFZafoAiVlY8ZmgsWlxegIJOdHS0xMSyxMQ2YmI4YmQ4ZGQ6ZGZCbGxWenw6ZmY8ZmZEbm5Gbm5GbnBIcHBIcHJKcHJKcnJKcnRMcnRMdHRQdnZafn5QdnhSeHpYfn5UeHpUenpWenquwMCsvr6qvLyetLScsrIYTEwiVFaMpKYiVFQcVFQiUlQkUlZ+mpokUlIiUlJykJJwjpAoVlhAamoyXmBoiIpOdnY4ZGZEbG5YfH5khoZWfHwoWFgqVFQqWFgqWFosWlpggoJOdHY0YGA0YGIkVFQ+aGpCamw+aGhAamwmVlYuXFwyYGAmVlgoVlYkWlouXF4wXl4kVlYwXF4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gC5CBxIkEuTAgUGxIiBsACBghAjciEwwEbDiw1pFLghMWIBjRgbYiGCseNAHQ11QFCAccmBAwkwxuiIgGEBHSYOjCBwccLLCSEfQtRh86aIlw8aEgjxkklIGjMLhvR5IATPmy8PoHwqNaSRoweWIHzwMsRFAkt2GEg4kADIsxde+kBIdUfPl3ZrChxwMwvGI1l5FGDQFKECpi9BNBRocYNOCVsLxC0xpcASDh6kFIBQIqsHkggNYs1KYQdJHRFAX0yQFSbGqwQmgH0pImZIhE5ekqh8O6UTClk79C5gIMOFyBj5YoQwIuzw5x9n9Ebe+8GOBBCWZFGgeYD0oGuf+BNonZVEQgQXiUDIMIQCdYxSyNP+iPDIDsRZkz63fkHDhxAnZFAAepLJRwFv0PXGE2tlOTEFbLdNUIJ+t3FBgw47QKDDVQVMsEINLF3EQ1YQcLgYF70Z0UIDDQhRwBQTqEUECVlFYGIBAt1AoFI4sJhCUoQdIJgRzb2UwFUxaDFQSBiw2MACPHHwEgQIEYGfBCe21dARLLAIw1VxuYaQDohdUEBUBBWVA4sqiIXbTxfp0AEHUhBgQ0RuFdADiwdwGMFLGtxGgBQdxUDDUkmYOOIBDIQUw50mcTEAAjcqUNZFDEWa5m0QJBAiQkpqCtFVNAwwAA0ERhoQACH5BAEFAGkALAAAAAAgACAAhwAAACZOTh5eXiJSViZUVCRUViZUVlp+gCJWVj5oaC5cXGiIiGCCgk50du7y8tzk5GSEhjZiYjhkZIKenuzw8DpkZjpmZjxmZjxmaEZucFh8ft7m5kpyckxydEx0dE50dFB2eFp+flJ4elR4elR6elZ6elZ6fFh+flh8fH6amoSennyamsDMzhhMTCJUVp6ystri4iJUVBxUVCRSVCJSVCRSVoiioiRSUiJSUqS4uHSSlIagoMDMzGqKiihWWEJqbDJeYGqIilB2djhiZDhkZkpwcEpydFJ4eChYWCpUVCpYWCpYWixaWixaXC5aXDJgYDRgYDRgYkhwcCRUVHqWlnSSkkBqakJsbEpwckhwcj5oakBqbERsbkRubiZWVjBcXiZWWChWViRaWi5cXjJcXDBeXjJeXiRWVjBcXAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+ANMIHEgwzZQCBQbEiIGwAIGCECOmITBgRsOLDWsUwCExYgGNGBt+QYKx40AfDX1IYIIRyoEDFjDG6IiAYQEfIw6AIHDxyssfIR9C9GHzZoiXERoSAPEySsgaMwuG9HmgAc+bLw+gfCo1pJKjB54gjPCywUUCT6wYSDiQAMizXMoipAq04Y+XVgrUFDjg5heMS7ICKdCgKUImTF96aCjQIgedFbYWyHBAg4ICTzh08FJAgoasHUgiNIg1awkrJFWKvpgg64ELGK8S+AH2ZYgEIRu2PiDicu6UCUxk5fC7gIEMGSRj7ItRAlMoxaN/pPFb+e8IVixIgPKFCecB1GP+G1By9TcB11lFJESAkMAMID1ybHjwt7gX9LY/Ooywg4WD//9BIF0EP2SgGQgkZKCXQy8ACOADxElXHE9UAMiCCkUQoGF5F/2gQVK/pVGDAjYsQIZFCEmQAgNKYAREVhJwOFoaDtWYkg4TTGCWAj+ohYQIMMooEA7snaVBjikMVtgBgymR2GtXxXDGQCFVkOMEHPD02AESIITEkxUwRlB5PuA4QQ8oxnUAbgj5kBgXBURFUFEmIOlbAbtdcZEPHHDgBQE3RORWASLkKEV5ErwUYWxedBSDRj90wOGLVYUUQ6AmpTEAAjIq8BIIFzGU6Zy5SWDBnQVMOSpEV9UwwAAFNRSZaUAAIfkEAQUAXQAsAAAAACAAIACHAAAAJk5OHl5eIlJWJlRUJFRWJlRWWn6AIlZWPGZoLlpcZoaITnR0vszMvMzMNGBiOGJkOGRkOGRmQmxsVnx8OmZmPGZmRm5wSHBySnBySnJySnJ0THJ0THR0UHZ4WH5+Unh4Unh6VHh6VHp6Vnp6Vnp8WHx+Wn5+sMLCsMDCrsDAmrCwGExMIlRWhqCgIlRUHFRUJFJUIlJUJFJWJFJSIlJSgJqccpCQbo6OboyMKFZWQGpqMl5gUHZ2NmJiOmRmRGxuWHx8SHBwKFhYKlRUKlhYKlhaLFpaLFpcTnR2MmBgNGBgJFRUPmhqQGpsRG5uPmhoQGhqQmpqQmpsJlZWMFxeKFZYJlZYJFpaLlxcMF5eJFZWLlxeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP4AuwgcSLALkwIFBrx4gbAAgYIQI3YhMCBGw4sNZxSoITFiAY0YG1YZgrHjQB0NdUA4gvHBgQMJML7oiIBhAR0iDnggcHHCywkhH0LUYbPAkA8vHzQk4CFpyBkzC4b0eaAHT6MvD6B8KjVkEaQHlBbw8bLHRQIPdhhIOJAAyLNAXiZBSHVHz5d2awocYLQKRiNZeRRg4LTAkaYvOzQUaBGDTglbC1w48MHvgwwbqBSAAPbABpIIDWLNSmEHySERQF9MkBUmxqsEJnSmHDMkwiYvQ/i13XBIEwpZNfAuYODCBdUY+WKE0FTs8OEzZPBGztvHjgQQHlQ5onmA9NcEdPZc5U2gddYQCRFcrPLBBQoUCp5TMf/yw0eEPHCsaMCf/4jnY+1wAQYceDDCBQWoV4AN/fWngl0ADsfTAv2tkIMU49kmmw/DdTHDETd8oEAMV/FAwXEY8ZAVBBmG1oVDLVIBwksxVTGBWkOEkFUELQpUg4J3UcYSYQcIVgRiMF31whYDhaQijQhl8BIECA2BZAWLETSejC9xcFVcrlWJGBAFREVQUVR9YERDuB0AVEoaZEAFATRE5FYBO7wUwUURvISBbQRQ0dELGj2QQIZPMhDSC3Wa1MUAQDakwEseXMSQo2faBkEC8TXEJKYQXTXDAAPMoKCjAQEAIfkEAQUAaQAsAAAAACAAIACHAAAAJk5OHl5eIlJWJlRUJFRWJlRWWn6AIlZWPGZoLlpcZoiIYoKETnR2+Pr61NzcZIaGjqao9vj4NGBi8PT08PLyOGJkOGRkOmRmRG5uWHx+OmZmPGZm5urq4ujoSnBySnJ0THJ0THR0TnR0Unh4Wn5+VHh6Vnx8WH5+WHx8hqCglqysdpSUjKamztjYvsrMjKSkgpycGExMIlRWsMDAIlRUHFRUJFJUIlJUJFJWdJKShJ6gJFJSIlJShKCgcI6OKlRUQmpsMl5gUHZ2NmJiSHBwSnJyUnh6VHp6KlhYLFhaLFpaLFpcMmBgNGBgJFRURm5uPmhqRGxuRm5wPmhoQGpqQmxsUHZ4Vnp8JlZWMFxeKFhYKlhaKFZWJFpaLlxcMlxeMF5eQGpsJFZWKFZYJlZYLlxeKFRWKlZYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP4A0wgcSDDNkwIFBtSogbAAgYIQI6YhMOBGw4sNcxToITFiAY0YG2pJgrHjwC0Ns1hYgnHCgQMJMNboiIBhgSwmDpAgcFHKyyAhH0LcYrPAlhIvJzQkMCRpyBwzC4b0eaABT6MvD2QJ+VFqyCRIDygtQORlg4sEJkQxkHAgAZBoM5hFSBVowyAvoxSoKXBAAQVWrxZQklVIgQZOCyxp+lJEQ4E3CNBw8EBHkqtyNWgpMOEDiK0WNGQFQRKhwb8OUjvoAEMIgS0XSl9MkBUmxqsEVlBQ7YBCDK4Io7w0sRl4gRtgVHhQ/cIiVwNTMqDk6vdilx8uHDAwzv0jjqAEXP53JxIlgYUJWpZsHfA9pIGt3AnUzmoiIYKlSz4sUKFCNtcs871UwkcIaaEBCxEkmCAU4wWRwQchDIHEFHshBIGCCu5gQXfxFUCCgiycsCF3QWhAhHFp5ABWEUo4hJAQGkwxXUNCZGWBYI+lgRCON5HwUkxaBFGFAUnk9NIFPArUw30YUaUBS4gdYFgSPv54VQ1jDBRSjT8i9MFLIybB2AEY5OhWSlWGgFmXCG3BWAYFREVQUXgdoEGLwb0kxUVZgPBBFgTwENFbBQh3wAUXXfDSB1wRkEVHNWg0QQI4cnmWTIKalMYATF6kwEtDXMSQpnNyZUECClyUJakQXZXDAAcD5MCkpgEBACH5BAEFAGIALAAAAAAgACAAhwAAACZOTh5eXiJSViZUVCRUViZUVlp+gCJWVjpmZixaWlyAglyAgEpycsjU1DJgYMbU1DZiYjZiZDhiZDhkZDpkZkBqbFJ4ekRsbkRubkZucEZwcEhwcEpwclB2dlh8flB2eFh8fFh+flJ4eFp+fqi6ul6AgsLQ0JCoqMLO0HCOkJywsLrKyrjGxmKEhHSQkhhMTCJUViJUVBxUVCJSVCRSVqy+vnyYmCRSUiJSUihUVj5oajBaXE50dDRgYkJqbFR4eihYWCpUVCpYWCpYWixYWmyMjDJeYExydEpydCRUVDxmaEBqakJsbDxmZj5oaE50dkx0dCZWVi5cXDRgYChWWDBcXiZWWCRaWixaXFR6ei5cXjBcXDBeXiRWVihWVi5aXFZ8fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+AMUIHEhQjJICBQbIkIGwAIGCECOKITAAR8OLDWsUyCExYgGNGBtaCYKx40CSCKVMUIDRx4EDCTDK6IiAYQEpQA6AIHARw0sLIR9CDGKzQBARLyM0JODhpY+QNWYWDOnzgAeeRl8ekBLy49SQQ5AeeIAwwksPFwk82GEg4UACINNWhYKwKtCGP17uKFBT4IACCjAQwApY65ECPZwiVND0ZZSGAnEQQOHAhosqWDMc+DClwIMGSLhO+KAVCcoCBgE7WO2AxQsrBIJQON1widYDSzBiJXDjBGsHJ4wQxrjj5YXOXRvyUNGC9YrkBQxoyED74t+lOkyUcAAEuvePNIL+EpgyvGuEHQkm+LCigOuA8CENcPVO4LbWCwkRXJTdQMSH6hhJYd9LInyE0BAWeLDAggtK8F0EFmQAmgdaaMAXQhswyOAHVnxHXwFLMOiBBVa0Bd0PHyiVnBg1SGHBbIQd8YEG1T2g1QTloSZGclJc8FJuU1hggQFB+PgSBeUJlIN+GFX1AUuJjVXAECBotQRWMngxUEg2vhRTAQ28NAFCQTQGE2QEEdbjS0hgVVVuZDaGQQFSEVSUBS892VBxB8zZkBQNNCAFAThEBFcBfFJwEQUvNdAVAVJ0JINGESQwXJc9hCRDoSaJMQCTF01x1kUMdWpnVxMkgBxCWpoKEVYJNQwwQA1MdhoQACH5BAEFAFcALAAAAAAgACAAhwAAACZOTh5eXiJSViZUVCRUViZUVlp+gCJWVjpmZixaWlyAgEpwcpiurjJgYJSsrDZiYjhiZDhkZDpkZkBqbFB2dkRsbkRubkZubkZucEhwcE50dlJ4eFB2eE52dlJ4elR4elR6elZ6elZ6fFZ8fFh8fFh8flh+flp+fo6mqIykphhMTCJUViJUVBxUVCJSVCRSViRSUiJSUoSeoIKcnniUlnCQkChWVj5oaC5cXEx0dDRgYkJsbGKEhihYWCpUVCpYWCpYWi5cXjBeXjJeYEpydEpyciRUVEJqbDxmaD5oakBqajxmZiZWVixaXDRgYChWWE50dDBcXkxydCRaWiRWViZWWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+AK8IHEjwypECBQa0aIGwAIGCECNeITAgRsOLDWEUkCExYgGNGBsK8YGx48AbDW9EUIBxx4EDCTC26IiAYYEbIA5wIHDRwksKIR9CvGGzgI8TLyE0JFDh5Y6QMGYWDOnzQAWeRl8eQAl1akggSA84QAjhZYWLBBwoMZBwIAGQaKtuQFgVaEMeL5UUqClwQAEgSdg2VKB1SIENThEqaPpSR0OBMQjYaDCjgg+sFw6YyFHAAQMdTQpEMKFVB0mEBv82WN0gxQKWPiScvohD64EkGLEW6PGAdYMHJHRjrH3gA+eQSxWgUMG6hvCLBjJcmI3R71IDOmg0wIC8O0YYL5D+G1DwPCQEJQki7BiiIPSA8EEFeydgW+uHhAgu+oiQgYQI6iE1Ud9LJ3yEUBBKMKaVUt4VAAEFF3xWQQgZ7IVQZvWNcFyD8xWQhFYV4JBDeRfxYAKDyF0Bww0URHCDbkOQkAGADmgVQXkCddcEBy/hUEAOFFBggA8faCXBcwLJkB9GVZXAEmJi/cXjS0lg1UIVA4VU40sxFcDASxEg5IOCXRZQkG47NoZVVT6KyZgFBUhFUFEUvGQCSwgRB2dKRTDQBAExRPRWAUq8JMFFErzEAHIENNFRCxpBkIBwW84lU6AmXTHAkhflYNZFDGU6J3IRJLBhAViKChFWMAwwAAwES2YaEAAh+QQBBQBnACwAAAAAIAAgAIcAAAAmTk4eXl4iUlYmVFQkVFYmVFZafoAiVlY8ZmguXFxcgIBMcnTS3NzQ2to2YmI4YmQ4ZGQ6ZGZCbGxWeno6ZmY8ZmZEbm5Gbm5GbnBIcHBKcHJKcnJMcnJKcnRQdnZafn5QdnhSeHhSeHpoiopYfHxUenpYfH5Yfn5oiIqGnqBmiIi+zMyourrO2NiKoqKsvr4YTEwiVFYiVFQcVFQkUlQiUlQkUlYkUlIiUlLK1taOpqaywsLM2NgqVFRAamoyXmBihIZOdnY4YmJEbG5WfHxWenwqWFhggoIsWlosWlwuWlxOdHRMdHQyYGA0YGA0YGI2YGAkVFQ+aGhCamxAamw+aGpOdHYmVlYwXF4oWFgqWFooVlYkWlouXF5mhoZihIQwXl5YenwkVlYoVlgmVlgwXFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gDPCBxI8IyUAgUGzJiBsACBghAjniEwoEbDiw1vFMghMWIBjRgbZjmCseNALQ2PIJGA8cmBAwkwzuiIgCEBBSwa8CBwccLLCSEfQtTCEGEWFw0alGhI4MNLKCFvzCwYUkVSGDwLaHl5AEvIj1RDRkHaQATCBy8/XCTg5IeBhAMJgLxY40XSFgh9HvjR8yXfmgIHFMACJCtCCA6SMigg5CnCJE5fNmko0GIIEgumeEW4o4EODGw3MPAK4QRXBiQRGtRKojWJIBdIZlmRxTDCBFxhYsxKQMMK1yRWAP1aYMrLEQqIIyRw5EIQ1xRsXzSQ4QLKr4KnJ1hAIoLy7x9t/nxlDr7Agx8JIDzJksTrAPFB334nkJvriIQILh6BkKEEhevEYVHfSyB8hNAWP0TG1QPgnXeBBgx8YEIGBeRXwAUDFpFcecTxhFtaUyggHUYTnMAgcWfcgMUPEHBhGBAlZAAgQkBwBcGIAgUowksxKTCBW0eMwFUE0gmUg4V9HVBCEgUw8RIQBRwRAlcJZDXDGAOFVCOPCG3wEgQIHaEgS6oRZBgWOx7AQFYY6oaQFpFdUMBUBBVVgF4nMImQcQcMhxAWHGyABQE4RCRXAT+85F1DEbykwXhYdDSDRg9UedGWQoQ0Q6EmnTEAkg0pkNZFDHVa51cQJLAhQliaClFWCTcMMMANFnYaEAAh+QQBBQBeACwAAAAAIAAgAIcAAAAmTk4eXl4iUlYmVFQkVFYmVFZafoAiVlY8ZmguXFxsioxKcnSkuLigtrY2YmI4YmQ4ZGQ6ZGZCamxSeHo6ZmY8ZmZEbm5GbnBIcHBIcHJKcHJKcnJQdnZYfHxQdnhWenpYfn5SeHhWenxWfHxYfH5afn6gtLSetLSesrKUqqwYTEwiVFYiVFQcVFQiUlQkUlYkUlIiUlKKpKSIoqKEnqBwjpBujI4oVlg+aGoyXmBOdHY4ZGZCbGxUeHpGbm4qVFQsWlosWlwuWlxMdHRMcnQyYGA0YGA0YGIkVFQ+aGhAampEbG5AamwmVlYwXl4oWFhOdnYqWFpOdHQmVlgoVlYkWlouXF4yXl4kVlZUenoqWFgwXF4wXFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gC9CBxI0EuSAgUGtGiBsACBghAjeiEwIEbDiw1hFJAhMWIBjRgbPoGCseNAHA1xdHiA8ciBAwkwtuiIgGGBICoazMDY4+WEkA8h4rB580SDBhsaEujwEklIGDMLYiSw4CiNlC8PoHwqNSQXB0cxIHzwssNFAkZyGEg4kABIjDeO1iBQoOeBnw0nvMxRoKbAAQVwPMGoA2yDnzuaIgzC9CWRhgItajjwQcJWAjYaoEiAdgMDJwUghMjKgCRCg4GzHgCRg2QQHwroXkygOuZZhAQmjM4awnbIAjleUlDw+yKOHCNIFy9gAMOFrSEBY4Tw4cCR5dg/vigOffmDHAkg+Bx5EgT0gO1A12InoDorhYQILkKBgMEDiO4hnbR/GeIjQik5NJYVS9g9MMEFGRDRgRZixVfABfuNQFx2y9FFW1k5xIadbgT+5gUMOCwBAQ6yFaCDBxjgp0NWEJQImRfFOUHBSzEpMMESBkAx40sRuFiAQDI4eJFdHgRRQGIH6FCAFNXRKFsLWQwU0oo0IrTBSxAgBIWAErzYVkMyOiYbhDCl1NgFBURFEFF6HRCCkQgFd0APxjGwgRMExBCRW8DxeFEEL2XwGwFOdNSCRg9wdhGVO4TUgp4meTGAkA0pUNZFDEW65m8QJDAhQlFqCpFsMAwwAAwORhoQACH5BAEFAGkALAAAAAAgACAAhwAAACZOTh5eXiJSViZUVCRUViZUVlp+gCJWVjxmaC5cXGCCglx+gE50dN7m5tzk5DhiZDpkZkJsbFZ6fDxmZkhwcHKSkt7k5EpyckpydExydEx0dFJ4eFh+flR4elZ8fFp+flZ6elh8fFh8fnCQkIagoG6OkLLCwoykprrIyqS4uBhMTCJUViJUVBxUVCRSVCJSVCRSVoykpLTExKi6uiRSUiJSUmiKiipUVD5oajRgYFB2djhkZDpmZkRublh6fEpwclJ4elR6emSGhipYWGKEhCpYWixYWixaWixaXC5aXDBaXE52dk50djZiYkhwciRUVDZiZDhkZj5oaERsbkBqakZubkBqbEJqbEZucFB2eCZWVjBcXihYWDRgYiZWWChWViRaWi5cXjJeXjBeXjJeYCRWVihWWDJgYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+ANMIHEgwDZQCBQa0aIGwAIGCECOmITDgRcOLDWMUsCExYgGNGBG+qDCGwMWOA7s03JKDC0YRDhyQMNmwRUcEDAsQuWFhCE2HKGKW+InwIcQuOXWSsGAhQcMXKWJOCBnDZkGMBHYwLUJzScwHR0J+vBryyFILERAyiDnjIgEdOQwkHEgApFsOTBcQIBDUwdCGEg4cyFEAp8ABBbq4vKjgLAQCJ6QiRLJD8IENDQVaxHCAQ4QtRT1YIKGDwAQVNIwUgNDBcgYimQ92sXxgQg7YRiSoLvqCQALaTt0WldDacofgYnMI9qBA7MUuOSZYxuC8gIEsPlSKRYwRAocDOqr+i/8Iw7l28U5yJICggwsS0APKhyQgVzwB2pY9JERwkQiECh9McJ5YW+AnWAcfIWREDpXR5sR4TlThQwUa7CBEFoUh5IOBEzQ3XnUm/SbYDjkoQFRIxD3oXBoxbFEFBGD8NMYHWQxYgA6WPRaSQM5t8d0BTikgQRUGEOGBZRGcKJAN/GEU2AEdIFFAA4KVodOPQNLUghkDhVSGZcFxdgAECBHR4AFpIVTQTz4KpgFNGwLZUBcN+lCAVQQl9WQHuxWg3AESXLQFBhhsQUANEdXlp2BpIsSDYBWIRcAWHbWgkRMJEPXlAQ2E1AKiKKUxQJOMjXgRQ6HmKRYECXiIEJcNqUJEUwwDDBBDk6EGBAAh+QQBBQBZACwAAAAAIAAgAIcAAAAmTk4eXl4iUlYmVFQkVFYmVFZafoAiVlY8ZmgsWlpegIJMcnSuwMA0YGCsvr44YmQ4ZGQ4ZGZCbGxUeno6ZmY8ZmZGbnBIcHBIcHJKcHJKcnJKcnRQdnZYfn5QdnhSeHhSeHpWfHxafn5UeHpYfHxYfH6UqqqQqKgYTEwiVFYiVFQcVFQkUlQiUlQkUlaMpqYkUlIiUlKGoKCCnp5ykJBsjI5sjIwoVlg+aGouXFxOdHY2YmI6ZGZEbm5WenxWenoqVFQqWFowXF5OdHQwXl4yXmBMdHQyYGAkVFQ+aGhEbG5AampAamxCamwmVlYsWlw0YGIoWFhOdnYqWFgmVlgoVlYkWlokVlYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gCzCBxIMEuSAgUGrFiBsACBghAjZiEwoEXDiw1fFJAhMWIBjRgb5tBB4GLHgTga4oCgAKOGBg0WYFzREQHDAjgoHPhQEiGBGjBthHwIEcdNnB4OHODRsMUJmAxCvqBZMOQEpR16KoD5oKXUqiGFJD3gAGEHmCh6OnSQw0DCgQRAXiTgQ+kOh0AbCG149UCOAjYFDsA5BKMCpQeKEIABFaGCDoiPNBRoMcNOCSkRXjjgQUeBDDRmCCkAYewBBqMRGsSJ+ICIHKNxREjt0GGC1gkw9iQwwTTn3CER5lBKwXNwlTlEII563MCFC5lDDsYI4QPZ49gzujgeHTuPHAkg9DgYouBJwu1D3WYn0BoxhYQILgqBcEGEiO4hn7RX6uEjQiE5QNYaU9nxwMQFGDDQAQUXAKbZfiIYlx12Jd2G1UhqBdcbgcFl8QIOTECAg1pFiAAdRg4gBkGGqmVx3BMgKJWbDhMwYYAQOikVAYsCyRAfRn150NIOShlRgBDWydjTClgMFJIRiAGngVIQ/CfgARVMRpBaT+TIQE91HQAcTgL6UABVBB0VpFcFDHfABBfhsIEGTxAQQ0RxtanjRREohUFwBDzR0Qoa8ZBAhlAecNdMd56UxQA/XqQDVhcx5GiawUGQgIQFNHkpRD29MMAAL/zoaEAAIfkEAQUAaQAsAAAAACAAIACHAAAAJk5OHl5eIlJWJlRUJFRWJlRWWn6AIlZWPmZmLFpcaIqKYoSETnR26O7uytbWZIaGNmJiOGJkOGRkOGRmQmxsVnp8OmZmPGZmfpqa5OrqSHBw3ubmSnBySnJyTHJ0THR0TnR0Unh4WH5+VHh6WHx8Wn5+VHp6Vnp6WHx+fJqagJycfJiawMzOlqysjqamnLKyGExMIlRWIlRUHFRUJFJUIlJUsMDAJFJWJFJSIlJSgpyessLCfJiYaoqKKFZWPmhqMl5gUHZ2OmRmRG5uVnx8SnBwUnh6KFZYKFhYKlRUKlhYKlhaLFpaTnZ2NGBgNGBiJFRUbIyMPGZoRGxuQGpqRm5wSHByQGhqQGpsPmhoQmpsUHZ4JlZWMFxeMmBgepaWJlZYJFpaLlxcMF5eLlpcWHp8JFZWKFRWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP4A0wgcSDBNlAIFBsyYgbAAgYIQI6YhMKBGw4sNcRTQITFiAY0YERKIwITAxY4DfzT8IUEBxikZMnTAOKMjAoYFfpA4IMKkSAsxSYR8CPEHzgJIRhw4EOGilJhAQuKoWTBkhaUNfC6JmQHJRZ84qoZcovTAE4RVYvrwWaBGiRUqBwwkAPIrEawIgWYQivDHCwcOdhC4KXAAUi8YmSw9EITAAqgIE7QA7ICHT4EWO/CkoBLh3RGIpzCA4NUHB8o3ziI0iHTxAQtAkiCdIFskAQI9KGsAw9ahyApll46YElJkBsAPZhZviASIhcUelueE4WLMcsMYJYgwK13kchw2lv577V4gApALEp54UdAlYfihBsgTcL1Y6AAEF5NI2FDCwvjlXdAn3EcIMQGEEPQ11V0EVRCxwQdCnGBFAfgVcBd9FlhHnnQmTbFYA0B40ZtVIyhYXBo4/FCFBD+wFUQJVvyHUBCLSTBiAQIBuN0BxHlRQRUGJLHTUhOMKJAOFV501QEjuNTAUkEUsMSOB2Dg0wxnDBQSjUtdgJBmB0iAUBIIdtlQQWx1seMHPl1IHEJIlElEAVQRdNSSIzDREBBLVXDRDx500AUBOUREVwF8HjDBRRMstUFxBHTR0QwaRXBBb1w2ENIMhaKUxn0hKbCUEBcx5KmdxUlwgUsNZXkqRAlgDTAADhV6GhAAIfkEAQUAYAAsAAAAACAAIACHAAAAJk5OHl5eIlJWJlRUJFRWJlRWWn6AIlZWPGZmLFpaZIaGTnR2uMjINGBitMbGOGJkOGRkOGRmQmxsVnx8OmZmRm5wSHBySnBySnJySnJ0THJ0THR0TnR0UHZ4Wn5+Unh4Unh6VHh6VHp6Vnp6Vnp8WHx+WH5+ssLCora2mrCwkKioGExMIlRWjqamIlRUHFRUJFJUIlJUJFJWJFJSIlJSgJycepaYdJKSbIqMKFZWQGpqMFxeaoqKaIiKUHZ2NmJiOmRmRGxuWHx8SHBwZoaIKFhYKlRUKlhYKlhaTnZ2Ml5gMmBgNGBgJFRUOGJiPmhqQGpsRG5uPmhoQGhqQmpsPGZoJlZWLlxcKFZYMF5eJlZYJFpaLFpcLlxeJFZWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP4AwQgcSBCMkwIFBrx4gbAAgYIQI4IhMCBGw4sNZxSoITFiAY0YG/IwgrHjQB0NdUBQgNHBgQMJML7oiIBhAR0iDnggcHHCywkhH0LUYbOAkQ8vHTQk4CFpyBkzC4b0eYABT6MvD6C8yHOG1JBIkB5QWgDISwYXY2TogXLAQAIguQo5i5DqjoYGcDRokKNATYEDjPLAqCDrkgIMnBKAoGJvgxVXBVq8oFPC1gIWDpgY7ACDhisEPqBw7GIwQoNYs1LYQdJIBJIYizh+sADjVQITxL78MCVkQx97U+y46tsoFApZMxS/aeMGS9+BMUJoSrY4AeIYZ8goDnt52R0JIPs44KHgSsLtQQ14d5i1fYiECC4agWCBAoXuvq+0z/rhI8IkO/ywHxDrAbGDBRds4MEIFviFUGb7UYDFet7xZEVWDEDBA3ZTmUBgcWDMoMMOEOhA3BIUWIBfAUtkBQGHBQhU3BUgvNQbDxPsYIARIWQVAYcC1RAfRlSZwFJiBxyGRFMvJXDVC18MFFKLTSKEwUsQIGQEkwdU0FBBxNH40gZXzXVAb1oyKUQBURFUVJHPFQDFTxfpkAEGoNEQEVwF7PBSBBdF8NIFvhFwRUcvaOSAkxdRiZZMepoExgBDXoTFSx5cxJCkbvoGQQITNhQlpxBdNcMAA8wwpKQBAQAh+QQBBQBtACwAAAAAIAAgAIcAAAAmTk4eXl4iUlYmVFQkVFYmVFZafoAiVlY8ZmgsWlxcfn5OdHb09vaesrQ2YmKIoqLw8vI4ZGTs8PA6ZGZEbG5Weno6ZmY8ZmZKcHJKcnRMcnRMdHTY4OBOdHS8yspQdnhYfn5SeHhSeHpYfHxafn5UeHpUenpYfH5sjIysvr6KoqTK1tZ6lpaitraEnqDW3t6GoKCSqKgYTEwiVFYiVFQcVFQkUlQiUlQkUlYkUlIiUlJmiIh4lpZykpJghIRsioooVlZAamoyXmBQdnY4YmQ4ZGZGbnBWenxKcnJOcnJegIJmhogoWFgqVFQqWFgqWFosWFosWlpOdnY0YGA0YGIkVFQ+aGpEbm5CamxIcHA+aGhAaGhAamxCbGxqioxIcHImVlYuXFwoVlgyYGAmVlgkWlouXF4wXl5WfHwyXl4kVlYwXF4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gDbCBxIsI2VAgUG1KiBsACBghAjtiEw4EbDiw1zFNghMWIBjRgbnmmCsePAIA2DSFCAkcqBAwkw1uiIgGGBICYOgCBwscLLLCEfQgxis0CTEC8fNCQA4mWVkDlmFgzp8wADnkZfHkB5kWeOqSGfID1ABeGDlwy6XjERJuFAAiC7Vk1boKqQhgYOQIBgoUBNgQOMosEIReuQAgycOhziYy+EFA0FWsygkwLXAkcOhBBTgEoGDWEIHHnhOAVLhAazarUghGQTCSQxgnAc42pXhASyjH0ZImZIhCL2tniA9bfRK0i0ajBewMCPJbFDBsYooWlZ5jwJaMeYA4fx6MYJ/vBY0QLIAg9cniT0HtQAc9wRGsifD+PGAAQXXx8hYQF8yCjzBTjBDSBBIQQRWiX13g08yOCACh+w0IELBOCHWYIvIcHZew5tV4BFuBWQgFYMXCFGcb/pppRxbeQQhBASBFHcECQc4d8QWkmAImptGBeGCC/FJEYWQhjQxAg57ijQDhb2xBtLiR1w2BNNBYlVDWsMFBKOQSJE2QESINRElQdQEBlBxf340gZYVeWbUVVWUIBUBBWVBW9QNHTFS3KmpEEGoekQEVwFCPFSmA1J8FIGvxEQRkc1aPRAAihySddFNQhqUhv3haTASyBgWsCmdf4mQQKnIZQlqRBhlcMABwPkYOGmAQEAIfkEAQUAXQAsAAAAACAAIACHAAAAJk5OHl5eIlJWJlRUJFRWJlRWWn6AIlZWPGZoLFpaXH5+TnR0wtDQNGBiwM7OOGJkOGRkOGRmQmxsVnp8OmZmPGZmRG5uRm5wSHBwSHBySnBySnJySnJ0THJ0THR0UHZ4WH5+Unh6WHx8Wn5+Vnp6WHx+vMzMrsDArL6+ora2mK6uGExMIlRWIlRUHFRUIlJUJFJWjqamJFJSIlJShKCggpyeeJSWcpCQZoaIKFZWQGpqMF5eUHR2NmJiOmRmRGxuVnx8Unh4VHh6KFhYKlRUKlhYKlhaTnR2MmBgNGBgJFRUPmhoRGxsQmpsQGpsPmhqUHZ2JlZWLlxcKFZYMl5gTnZ2JlZYJFpaLFpcLlxeMFxeJFZWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP4AuwgcSLDLkgIFBrhwgbAAgYIQI3YhMGBGw4sNYxSgITFiAY0YG/IggrHjQB0NdUBQgNHBgQMJMLroiIBhAR1DDoAgcHHCywkhH0LUYbMAkRAvHTQkACJpyBgzC4b0eaAHT6MvD6B8KjWkEaQHlBbw8bLHRQIOdhhIOJAAyLMXXiJBSHVHz5d2awocYJQHRgVZ/TJwWkBB05cfGgq0qEGnhK0F4oaYUsDBhg5SCkAAe6ADSYQGsWalsIMkkQifLybIChPjVQITOB8IETMkQiYvRVC23ZAIEwpZOfAuYADDhdQY+WKE0FTs8OExYPBGbpsABRw5FvRoAoEIRelB1/Q+J/CggfnzKRIiuEgEAoYRFKhjNHK+/omPCI/siML6gI/nBVBwgw0yrKACCjUQsF5k/R1AwW4AEiAhT68VsFpZTExxFW+x/cdbFzHosAMEOmzIwwgYUJdEVhBsqFgXvEkhwksxTTGBWkTM+FIELhYgEA0L3jUbS4MdkEQBRhwG01UucDFQSCvSiNAGL0GAEBFKVvBiWw3J+JIHV8XV2pWHXVBAVAQVRVUILN3200U6cLCBFATMEJFbBeyw40URvJRBdVJ05IJGDiTgYpQMhOSCnSZ1MUCQDU3xEggXMdRomrZBkACEBTh5KURXxTDAADEs2GhAADs=)!important;background-color:#255556}#toasty .toast.toasty-theme-default.toasty-type-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkQyQUI3Q0EzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkQyQUI3Q0IzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0QTNBMDVFQjMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0QTNBMDVFQzMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po9jTrYAAAKTSURBVHja7Jq/SyNBFMfNuSYB0cbCUzmtTvwbbPwb7KPV/Rmnu5tYWR1XX6WFpYL2giBW/igUFCxEuMJeZMXg3Bt4kcmwiftm3kuG5R58mc0G3ptPZnfmzZtUlFIjZbBKWUC+CPqOQA3QLSjDtoH3+U2PiIBqoE2Vb5v4PWtMCYh6HwgTph4yiO5coopZwgnDCVElQJgw1ZBAIgcIEyYKBSRVfpaGAJIoHkuGCZIqXkuHAdIEvTODvKPfgYG0QG9Kxt7QvziIDvKqZO2VCuMCkRE7dQPawZZiGQWGOjtRIf6AZkCT2KZEH1nR2YwCQX2crkDfcpLJY4fHLPEFifBXbDs854c9fG45TBRt7EfkAqJzoNjjhT0CVXL87nn4jHvlZv2y2Nhz5jnH98L0Owo68fQb52XNvql4P3sArVi+F0HXTOlMvR9IjWEkOvYM+mH5XwU9MfmPzZ2mPexcEB3btkB+Mqc1Mfa7C6QhsELvg8aMGL8FYuh+d1VRNgRqG1OgSbyugeYFYmzY5aAFgSAa4iteVw0oTluwQR6FQKrGiEwIxHi0K41roB3mIC+gM9Bf0AxoGTTOHGMdtMtVQBiWfRQuJNcRaeu5jnCv7GbCd++YeDqv7NwwB6DvoGlsDyQgimS/PjA6p1qyfC555loJNfvl2I+c5vxydbzv8ng670fs+hV1h3gJmrX8zOF96g7x03oXtRhH2W+/4Myi349xbLeJo5sVLdoNoopyAfqFbRBVlFLVtcwCQlsIoo3+B1b7bQnVflvqfzU+DBivwx6uE6umJ0RTBXSGmHqMRDBniJ3cLHWACOpU18ylUgJEkOfspfrnQ5GdZtfOLnSQESzM6eLZHaYcd/h5TCJeaf6v9U+AAQAvyHBRYhRQ4wAAAABJRU5ErkJggg==)!important;background-color:#f1432a}#toasty .toast.toasty-theme-default.toasty-type-success{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkQyQUI3Q0UzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkQyQUI3Q0YzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRDJBQjdDQzMyMkIxMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoyRDJBQjdDRDMyMkIxMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvQVuMwAAAORSURBVHja7JpNaBNBFMebNsZacih+FFFsrB4qVIw9lByEWNtCC/VSRS14UjSx1V4UvbUKFaFUD178OniPB28KgsYeFBVqRFDQgx9paE1bNVKKta3N+h94hTWZ3ezOTiYh9MEPwmZ39v2TmTdv3oxL07SyUjDXipBsW0NsA37gAx7gpe9nwQKIg7fgM5gjCi6EOboZNIEDoFPneC5jwh6A++Al+AYWVQtxg3pwBPSBaoc/6Di4Q6I+gL8qhGwBx0EvqJHc1afADXAXJGw9yYTYoBVEtfxblN5l2Tc7InrApKbO2LtCMoV4wGUwr6m3OTAAVjsV4iIRS1rhLA36nQo5Rb9KoW0WnDTz1SxqtYB7YF2RTN4/wSEQtRO1asGIVnw2Qr5l+VzO0VYBjoFgEaZUQZqEXVYmxAbwGGxU5Nw8eEqT6y7KGswsCdrAe7Ou5QaDirvLVYqO5fR5ysIzl8hXw6i1FUwrFDEK6jJ86AAzOZ6LA5+REPardCsU8QO0cwZuBfhq4flu8jlrsLO1RJfCgcsSw0ec6+doLZPLusjnrDHiBSlF/8YbgzDqB78stpEin7O6VpMiEWwwt3BEsMH7zGZbAV7X8ivoTmype9Ngdr4A9thsr275g16IT4GQGLjGuc4EnBZor54nxKMgVzoLZjjr/kGwSaDNKp4Qr6CDabCU4x5WVLgOXnC+uwKaBd/t5QkRsRQ4Q10jZnLfKBjmXN8PjvJyJ9umixpDAhNaT0bojHHuY+G0kROlaiRk2EO88Gsnx1oEfRzndoPXGfeGDULtsIRQfpEn5ISNBtj6/aDBWqaRcihmD/VphI52i8mhlTTF8YSYAEETMUxEg0GXei5pcg3whIikKOOg2UBMZR67lGmKUgUiAg2OgX0W608dVEiQYRHyWWoaH7cgZj34KDFn+y+N5y2svgs2nDBIBpfXGLckijBdWMlY6hqNGdalFiQKybnUZewESQcvmQB7de1Vgy8SRSTJx5yVRjcpTjt4GetmvaBTcn2M+XSeNzeVTIHOrGTaSiXTtUVUMj0Mnohs9IQkxn2nReyQ0/2RfofjpSi2Fcpok2WgQNsL0jZ69IQlZax2qi3hfOwhMtoURbMRepdl30S2p2t129MbJEemaVoSR8CYqgMDO+i0Q1iwAqK3CXCbDgy8K8QRjlUkIuDwCMcrEqP8CIdRjakSbLd4qOYT+AN+rxxzKkUh/wQYAIxbfwhIUivlAAAAAElFTkSuQmCC)!important;background-color:#06bc5a}#toasty .toast.toasty-theme-default.toasty-type-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkQyQUI3RDIzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkQyQUI3RDMzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRDJBQjdEMDMyMkIxMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoyRDJBQjdEMTMyMkIxMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PhxHKhwAAAN7SURBVHja7JrfS1RBFMf37q7mj6SySMWMMqnQLEsKMg2yH4SC2g+wrKcIg7SX3ouiP6BfEFRPEdRLFFlBIEVQvfcgFrJBLxFBEWG9mHb7Hjgrl+vMzr13Zuyu+IUP7M7Pc+7MnJm5u47ruom5oGRijmjOOJK22PYScBrs5u8vwA3ww0ZnjqU1sgg8Ba2+9NegE4znw9QqBg8FTpDawF0uE3tHBkFLjvz9XCbWU2sZT5/1inIfeHS+xXVELoK6AOXquGwsp9ZGcDhgJExz2U1xc6QEXADLQ9ShsudMbQGmHDkE9kSoR3tMd1wcoSd7CpRFqLsYnA05ktYcOQGac+T/ZmTawm381/BL0ecR2CDI+wyug4/8fQ04A6oFZUfAAZCJbAk5osFVMOmK1SMo3yMpS21c07FFx4m94LvEsFcgLahDaS8ldb6AnVHtibpGaGGfBOWS/PuyqQyeSPIqNYJGZEeO8ClWJnIwJdkIq3LU6+a2Z8WRGtAHSnOUWQcKBOkphSOl3HbNbDjSpzjdkupBoSCd0tYq6rZwH1aj1jaQcdWaAJWC+hWcp1KG+7Ky2OlpHgW1AcrStFohuTkWBKhfy30V2phaHWCAI08QrfK1T58bg27UoB+0m3akhsNtQQjH23xPlCJWU8gT9WDQhZ8M+HT2KcKtSKt97ac4LYw6ue+kCUfqeUqFVa3vrpHmy1dYDXA413KEptIxsDmCAQ2+TTElCQAqUd8HlRcwRVhrA+NudFV72irXaOcX2xIp/JbxsC7UOOZnFzyN7EqNdkrZlrKwr0xpGuwCvZr3nQ7PvtOo2RbZcg88A1NBL1YV4HnIcDkbescv+L4GGRGHb2smnHgDPnk2yFbN9prYttszRkWwcBr4kqOry6DK0y59vmmgXbKtTnVDdAx1NgKKBQ9pAefp6ooqam0Hxw1MqTvgjyB9ivN01e+/SngdoVf9l/iMo6u05HDpGHqzmLW12O+Iw9fMdkPRpVdy1U0ZCOlZtbPNjnexl4BR16xu8ZrI9rGU00xqlG2f3ke6wGMLcf8teM9PjQ6MWy30QaMylJ2vzZY2sB2MTZHtQ9k1UpTIXxV5F/tYHjsy5nXkARjOQyeG2fZpR35yWDyfsPAbuAWNs629bPuM02+a7w+F/DMAnYL/xsT4JJ966WeKCWZSdYzPO83/O2jeEUv6J8AAuUNANq3q2uMAAAAASUVORK5CYII=)!important;background-color:#f97a1f}#toasty .toast.toasty-theme-material{font-family:Roboto,sans-serif!important;font-size:12px;background-color:#323232}#toasty .toast.toasty-theme-material .close-button:after{content:'x';color:#fff;font-size:17px;font-weight:100}#toasty .toast.toasty-theme-material .toast-text{color:#fff}#toasty .toast.toasty-theme-material .toast-text .toast-title{text-transform:uppercase;font-size:13px}#toasty .toast.toasty-theme-material .toast-text a,#toasty .toast.toasty-theme-material .toast-text label{color:#fff}#toasty .toast.toasty-theme-material .toast-text a:hover,#toasty .toast.toasty-theme-material .toast-text label:hover{color:#f2f2f2}#toasty .toast.toasty-theme-material.toasty-type-default{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjdGQ0YwNTUzMjJFMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjdGQ0YwNTYzMjJFMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGN0ZDRjA1MzMyMkUxMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGN0ZDRjA1NDMyMkUxMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvdUzSUAAADVSURBVHja7NixDcIwFIThGFGDoCYzQM100FAyCEzAGHQMQA0iDGDOElWUYKfiPeW3dE2K6L7YjqOEGGPleUwq5wOAVUCtnJRGiX9O8+1SdxUNHZt4pVyVpbGH/VS2yi03A0eD5dNYKIeSGXgpM6NLPi2neQ5g/WAIvEYBAAAAAAAAAAAAAAAAAAAAAABGB2i8Ay7tC57+zD2UtXL3NgNv5axs2uXTmA682V7Zed3E5soPAZgsXwowW74EYLp8DmC+/C+Ai/J9ADfl+05iPuYAjAnwEWAAlI5MOXu7aeEAAAAASUVORK5CYII=)!important}#toasty .toast.toasty-theme-material.toasty-type-info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTY3QkFBRDYzMjMwMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTY3QkFBRDczMjMwMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBNjdCQUFENDMyMzAxMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBNjdCQUFENTMyMzAxMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pqvvb2MAAAJWSURBVHja7JlBSwJBFMfXKA+FJ70EQlCReM46hnSOQAhKugYdsr5BRPQNsgIhb4YFncRzRMeyD2BUEAhe8iR1sND+Q28hlnV31pndnSUf/JmL7Px/82adN29DvV5PC3KMaAGPIYDfMSr6gNm7V30hFqBlaB6ag+LQBP3sA2pAT9AjdAM9QN3npWmh+UMiLzHMM5M5aJMMOwkGdAGdAKLhKQCMxzAcQltQWDCJHegcOgDIu+sAMJ/FcAzFJG9nZn4PEGVXAGB8DEMe2nb5vSywbQmQb2kAMD+O4Qpa8ejPpQqtA+JTGIBW/hpa9fgfsgKtAeJL9BzI+2BeoznzQhnA6m9gKGv+RhZZuHQMAPNRDHUo6jNAC0oAouV0Cx0Jmg8ZNGhEyQt/BuiEfRE8pIymRep2dtjNmJ3Y/TKwI+GElRlh8mSfAaw+g3oboLZxMwN67TSFLHTtMrAowbxu+K9EI07ebLdQWuHyP80DkFIYIMUDkFAYIMFzI5uUNJnsl9jUm1kGIgpnIPIvuhJthf22eQCaCgM0eQDqCgPUeQBqCgPUeABuFQa45QG4p8JJtWiQN2sAqvZKCgKUjJWo1TlwSpcIVaJDnviulHTzKSoEUOzXP7U6iffpQu33faBFXjRHANQFyCmw+rl+HQnbWoj6MQUfzResekK8xdyu9tvm8zoqNLcmBEC9SdZSr3pons2VteuLcpfT1CXOeLSd2BwZns60aVvFLlT7wOH4QkMTJKEzSYddh56VdGp+oAwYshHMj3wGCD2TwfvMquqdeAgwBHAQPwIMAIRS2XfVn5FFAAAAAElFTkSuQmCC)!important}#toasty .toast.toasty-theme-material.toasty-type-wait{background-image:url(data:image/gif;base64,R0lGODlhJgAmAIQAADQyNDxerDRGZDxuzDRShDxy5DxmxDROfDQ+TDx67DRKdDQ2RDxirDRKbDxy3DRWjDx25DxqxDQ2PDRGbDxu1DRSjDROhDQ+VDx69DxitDx27DxqzDIyMgAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBwAcACwAAAAAJgAmAAAF/iAnjqQIXESwFZpWbIx1AWVtkxKxaVjfJ77ehiC5GTkAiyPIbGIKBNqRhIhgeE5sD8vbXKaiSSHIvZKdhcZUoXX62k3NwTgpb81wnv5+VdcQY0BuZoSDGBBfJABWhYaOPhtFIwSPlU4VIxIUlpw+BQsiFp2jGA9IG6SdFCeCjVmDcHcolrGcDwF8r6RcGZupuYYUY7DEb8ZMLYR2cb+1v8w9w82VL8+cFLjHzM66PRmibs7L2ncVF9zWbzOowNrobqsc4M/oFiKa6YOfIwfk3OJB7I0AYCBfkw1SRgB6VKtWgUQlBIwrFkfDBCNsUsFRMEWMtQIXwSAomMoLmIEWIVggO7OlgIWEJ+9Z2GFIw4YKoGLaOGEhw4oWL75dyHkkBAAh+QQJBwBEACwAAAAAJgAmAIY0MjScQjwsYrxkOjRcWpw8bsw0RmTMRkREXqx8VoRcSmy0Rjx8Ojw0UoQ8ZsQ8cuRMNjR0OjQ0TnzUSkQ0PkycUmw8Xqy0Tlw8euxsWow0SnTETlQ8MjQ0YrRsOjQ8ctw0SmxMXqS8RjyEPjxEVpQ8asQ8duR0PkSsUmTMTkw0NjykQjxkWpQ8btQ0RmyEVnxcTnS0RkR8Pjw0UoxUNjR0Ojw0ToTcSkQ0PlSkUmw8YrS8Tlw8evR0Wow0YrxsPkRMXqw8asw8duzMTlQyMjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/oBEgoOEggAQDAEiBxMTByIrMhAAhZWWhBwyIjecnZ6cIgwcl6REAAwHn6qfBzKUpYQQC6u0nyIQsIIDqasTOzsiGym0EwOwHhOeEzkJIR0dAtECzyEJFcmeEaQD2DcoLNLh4tIdLDmexpUQvCgh4+/vIec3E7iEALMp4PD84wSpIl4JknFjB4J+CMVZuHBDxiAOBy5AS0gxWgcUB0YRYbBjYsWKHXaMMLXA3ceTIWJwgPDipEsBCWj8sPDypIUfCmq6VEBC50kSNH1WtOBRaEIhQnggXcr0AVKnUKMKcdp0alMeWLNq3cq1a1KuD4J0HUu2LNYWHbR+NcuWqw8bjVjXtp0bdwYFuWbxthWCA4DYsnqVcg3cghLcrHITexWMOC4PG4JUtKBLmccDFYMkMJ4bmCvkQQB80O3MVQBmQjhMsA2MNylfSy5ccyYrxAUpDaQBq/1MysWDylsf2M5FwQHtsgJw5AJtw6nurA9snF4+SIWNIGtlIxYwYzr1QgBw2BAQ5DfSaDNweL8UCAAh+QQJBwBGACwAAAAAJgAmAIY0MjScQjwsYrxUWpRkOjS8Rjw8bsw0RmSkQjxEXqzUSkQ8ZsR8VoTMRjw8cuQ0TnxMNjSMSmR8Ojw8XqxsWoyMVnQ0Pky8TlQ8euw0XrR0OjQ0SnSkUmw0UoyUUnQ8MjRkWpQ8ctw0Smw8asTMTlQ8duQ0UoSEPjx0WozETlQ0YrQ0NjxcWpxsOjTERjw8btQ0Rmy0RjxMWpzcSkSEVnzMRkQ0ToRUNjSMTmR8Pjw8YrRsWpSMVnw0PlS8Tlw8evR0Ojy0TlyUVnQ8asw8duw0YrwyMjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/oBGgoOEggAQEgEFNQoKDQUIORAAhZWWhB85BTOcnZ6cBRIfl6RGABINn6qfDTmUpYQQMau0nwUQsIIENbW9nQoEsC0KvsWcGqQExMbGwZUQvMzGCriEALPSzAWjgzm+KUEcHuMcHEEXy7Qngx+pnykeFAkqAvX29xkJIB4pqgrcEjzVoJHgnsGDBhPQIOFp3TVONVDQQ0iRYgYK0Vx8gMDJg46KIAVkQKhCCKcbASmEXFkRhIITAVCwnImQAoIINHMajDBAp08BMkbqFCpyJhEiP44eTaq0qdOnTh00/eHgh9WrWLMizcq1a9IhXsOKDfsiA9etY9NaRariAVa0h1rVhu3QA67ctWqJ9AAANi/eu0Mo2Xjb1W7cq2iRdhC04sXdx1RXDHJr2DBitTasFYGcdKwAyYR6lOD8N6uDHpYOWL68WisMUhtai4VLZAMsGFVJW3XwOpeFzWOR2hWAOhdjGyEqe3VgA7TxQSs6CJj9Q0AH588LrehhQ8ACqVRfCLDRA/ulQAAh+QQJBwBBACwAAAAAJgAmAIY0MjScQjwsYrxkOjRUXqS8Rjw8bsw0RmTUSkS0RjxEXqx8VoQ8cuQ0TnxMNjQ8ZsR8OjzMRjw0PkyUVnRsWpQ8euw8Xqx0OjQ0SnS0SlQ0UozMTkw8MjRkWpS8Tlw8ctw0SmzcSkQ8duQ0UoQ8asSEPjykUmy0TlQ0NjykQjw0YrRsOjRcWpzERjw8btQ0RmzUSkxMXqSEVoQ0ToRUNjR8PjzMRkQ0PlScUmx0Wow8evQ8YrR0OjzMTlQ8duw8asy0TlwyMjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/oBBgoOEggAOEAEFNggIEQUpNQ4AhZWWhBw1BSGcnZ6cBRAcl6RBABARn6qfETWUpYQOCau0nwUOsIIDNrW9nQgDsCsIvsWcF6QDxMbGwZUOvMzGCLiEALPSzAWjgzXZ2SWDHKnfzAjcEOXgptjqxi0cDu7ZNOm0GyY4EwsLFBQdHfzxm4DDxIZlqkqk8ARERgcFAiJKnEiRogIWMoB4SrDJRAcVFUOKDKmig4kQLTIQGMmy5UQWGSC6nMlSgQ8fFW7qwHmzp8+bDHwEDfqzqA8dDHQoXcq0qdOnS49G/QG1qtWqLlQwlXq161YdKhoo5bqz6VGpZM0+1XAjrde3eWNvAKBq1S1cHT8ozfh61+5YHRoEoXBx9y4DFIPEuk3LlWxjpjOsPbjq16oAxIQkJC1slcENSy8qV7Xr4wUpDKLf+sAA68BmzkoZmM4lYfJfuAI+5zI044NXqQxmYN49CMWMH47NuhBO/BKAGzME/CDK4IeAGXJzBQIAIfkECQcALwAsAAAAACYAJgCFNDI0nEI8PF6sZDo0NEZkPG7MxEY8NE58PHLk1EZETDY0fDo8ND5MPGbEPHrstEY8dDo0NEp0zEY8NFKM1E5MPDI0NEpsPHLcNFKEPHbk3EpEhD48PGrEzEpMNDY8pEI8PGK0bDo0NEZsPG7UNE6E1EpEVDY0fD48ND5UPHr0vEY8dDo8zEZEPHbsPGrMMjIyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABv7Al3BIFAIUi4CKVUpIVJ+TAlCsWomVk0rD7Xq5qkXlSn4BFpKv+is5UctExWNN/6oUcOGAVe93SwNwIQl+hVwQZAOEhoaBVQp8jIYJeEQAc5KMKmNDJ5mZG0MVaZ+MCZwLpaBmmKqGBhUKrpkmqbOMGx+3jA9bu4USpL99CSUlw34tKcvLDs0pLcrR09TV1tIpGczbytve3+DeLS7h5eblIwLc5+zfyiAk4N3Q9PPt2xMo9vf80CgA5JbtMzcwnAsq8cLNK1iv3AQhHkb0YwgOgYchB/qdW0jCUoON7s4dLMIAgcZzCFBYITCQokB5IshEcFnOXouOZQiYPMkMQTHMPAw+8nShMo8REhewvRS3DAGJN0aHeJgQsOYIEhejWgGAggQIFwiiIXABD0XWMkEAACH5BAkHAEAALAAAAAAmACYAhjQyNJxCPDxerGQ6NMRGPGRyzDxuzDRGZMxeZEx25JRmlDxy5NxKRDROfEw2NHw6PKxmhDx67DQ+TDxmxNRGRLRGPHQ6NHRuvDRKdNxaVKRmjDRSjDwyNMxGPDxy3DRKbJxmlDx25ORSRDRShIQ+PER67DxqxDQ2PKRCPDxitGw6NGxyxDxu1DRGbNReXFR23JRqnNxORDROhFQ2NHw+PLxidDx69DQ+VNRKRLxGPHQ6PHxutORaTMxGRDx27DxqzDIyMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf+gECCg4SCAA4PATk9OBQdOSg0DgCFlZaEHDQ5DJydnpw5DxyXpEAADx2fqp8dNJSlhA4Vq7SfOQ6wggM9tb2dOAOwKhS+xZwWpAPExsbBlQ68zMYUuIQAs54i0rU5o4M02du02gwkgxyp4swU3g/q2+bX79IEHA7z2zPu+MwkKPzMKmwCWKxDOoK9KMQQwbChNoYMIEp8SDFixYkKeIjQyJAjx40OQ4oMqVGDhx0IeKhcybKly5csM+wo8cNGiRUgXMDcudMFhAslbLAQYKNo0RcXYECokSEDT5UZXNSAAGLHi6BGU8gwasMHV5slXrwosGLFhQtlC4hNUALr16KJG254fUuXrtu6RW8AqIm3r1+jPyhtNTr3r2G4gk6wOFz48IITgxp07dv4sI0R1iZYLlqZbuBCEhZs/rvghqUDnQt7rdy5awtSGFqP9tEA1gHRo7n6eJ1LgubcNn5IyDUIQAMPqwnrJrxAxivig05s4Ktc948NkKFbAnBDRoofPsL7+JEi7nNSgQAAIfkECQcAQwAsAAAAACYAJgCGNDI0nEI8PF6sxEY8ZDo0bHLEPG7MNEZkzF5cVHbcnGKEPHLk3EpENE58TDY0TGa8fDo8THbktGJ8PHrsND5MPGbE1EZE3FpUtEY8dDo0NEp0rGaENFKMPDI0zEY8jGqkPHLcNEpspGKEPHbk5FJENFKEhD48RHrsPGrE5FpMNDY8pEI8PGK0bDo0dG68PG7UNEZs1F5cZHLM3E5ENE6EVDY0VGq8fD48vGJ0PHr0ND5U1EpE3F5UvEY8dDo8zEZEpGaMPHbsPGrMMjIyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/6AQ4KDhIIADhABPT87Fh49KzcOAIWVloQdNz0MnJ2enD0QHZekQwAQHp+qnx43lKWEDhirtJ89DrCCBD+1vZ07BLAtFr7FnBmkBMTGxsGVDrzMxha4hACzniTStT2jgzfZ27TaDCaDHanizBbeEOrb5tfv0gMdDvPbNe74zCYr/MwwbAJYzEM6gr0szCDBsKE2hgwgSnxIMWLFiQhSkNDIkCPHjQ5Digyp8YKCFChTqlzJsqVLEQ9iuJxJ06UNAQUu1NxJ0wULGjlkxNjIs2gKHgVycKAQZEKEDUZ5SkiQI4cOAEKqBt2gMypLCUmrCqEEVGuQBB8keE2B4wNVrY9KBal4AVfriQIfNuCIcUGnTh4xcEj44OJE3aoLVAxqkCPI4aoTHJ+IMPnEiSCGH2stYa2C5s+OP4t9NYjCAtGoH4/QYelAaM2OX4sOAoOUBtmpNU/QAOvA6dyaR9TORcEz8LpCWOcy1ABEbLNwXwdZQIP0crklskavG0QIB8XXLQHQQYOFkCDou7PgcDVXIAAh+QQJBwBIACwAAAAAJgAmAIY0MjScQjw8YrTERjxkOjRkWoQ0RmQ8ctzEWmScWmw0TnzcSkRkVoRcctS0YnxMNjR8OjxkcsQ8euw8asTcWlScZpQ8Tnx8brQ0PkzURkS0Rjx0OjQ0SnQ8duzUXlw0Uow8btSsZoQ8MjTMRjw0Smw8duTMXmQ0UoTkUkSEPjxsbsREeuw8bsykZoyEaqw0NjykQjw8ZsRsOjQ0Rmw8cuTEXmykWmw0ToTcTkS8YnRUNjR8Pjw8evQ8aszkWkycapQ8UoQ0PlTUSkS8Rjx0OjzMRkRscsSEbqwyMjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/oBIgoOEggAPEAFDRUIZI0MwOw8AhZWWhCI7QwucnZ6cQxAil6RIABAjn6qfIzuUpYQPGqu0n0MPsIIERbW9nUIEsDIZvsWcG6QExMbGwZUPvMzGGbiEALOeKNK1Q6ODO9nbtNoLKYMiqeLMGd4Q6tvm1+/SAyIP89s67vjMKTD8zDRsAlhsRDqCvTLgQMGwoTaGCyBKfEgxYsWJFHyg0MiQI8eNDkOKDKnRBwIfKFOqXMmypUsTCVzKnCnTBoOMNHPSLGAhh86fLU0AwRABqNGUKoIA6FHhKNAWICjdkODAac4cKz4IenFgRYiNVltiPfBikIIOEn7gdAk2Z4sVlDxuWIvBg4eRGi3b0vRgpG6PV4Mw0Kgr4YgJpx5cwOVBI4glAx3qdlihooUHmWAphFCxmEeHGaQ4RK7LQ8KKBhcqhMiRo0aOED+ONOgsWQEsA4NJl94tQbdv0jRI5EKCga7n45JJ9/7dA8NwQzcO/PY92jONG4CfI3lxowd16j0+lNVeCUCQGwJ6dFjfoYeAD0pzBQIAIfkECQcAFwAsAAAAACYAJgCENDI0nEI8xEY8ZDo01EY8fDo8tEI8TDY0dDo03EpEzEY81EpEhD48vEY8PDI0pEI8bDo01EZEfD48tEY8VDY0dDo8zEZEMjIyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABfDgJY6kCBxF0FgLYTWPdABlbZOO1CR87/ONguNGvAAKip/yp5DQiqTDZEn9NQ5Q0cBS7fYWAygk4i3zEMQB2WwO1w5ctpmAJQGmcnZjOJLk8wwjDkl/bAR8BYWARniKZgIOB455FImTbAwPl2wGO5tlCoSfXQSjZgumXqKOpWWeqUsKmoWtPLVUBpawSgWSu0oUAK9ltz6txQkKQ7p/yEsFIoNztnKHIwi/PIEjwr8KTyMHzpMEFDYD40ul6wm3BGg3EMTE0EXol+9ZFwcGjgrm+i44KJBOnZCAOJC4M5asF0IbACgwMCDgmIJcFPgUCQEAIfkECQcAVQAsAAAAACYAJgCGNDI0nIY8nEI8lGo81LJEXFY0ZDo07MZExEY81G5MREI0zHZE7IZM/NJM1F5MTDY09LJMfG48/MZMzKpEXFI0PDo0tGJEdDo01EZE5GZMtEY89M5E7HZM9KZM5G5MPDI0lH483L5EdGY85FpM/L5MjHY8fDo87H5MZF409MpMzEY8VE409JJMhHY8/M5M3EpEvEI89K5M7G5MrIJE5GJMNDY0nIo8pEI83LpEZFo0bDo07MpMTEY07IpM/NZMVDY0/LpMhHI8/MpM3K5ERD40dDo81EpE5GpM9M5M7HpM9KpMPDY0lII85MJE5F5M/MJMfD487IJMzEZEvEY87HJMMjIyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/6AVYKDhIIAD1ACU1IvCQkLM0ErNYWVloQfUDAvnJ0jnyNUMQQtFZenVQAmKp2tL6CgUS5NJZSohA8arq6woDISPgQrt4IGjLutvaBHwCkitzrIu8qgHC4+DRGnBkbSvNSfLD7Yz5UPx96e4J8k4ykUhQC66cnrI0njPjimgyb03/aA5GMy6AOCf/Xs9cDmI4UCQVAQJlxH49q4AKnmSXxl7xOEcQ2a1HiwUV1HFg1A5vBXkmNHDvl8BBDQ0qU9GinHTZhSc4RNcELyHWDVsqNPJ0/yNcDQ0+iIdvm6FXUKdRzRqaB+sgPpgyfWjkHHHaD5dZ2TnD4msCzp1ENMG4cky4JjEDMHgINylXUAeWBJlbUSnSa9KOgD041GYWLbwKMf2457CQ8CsAnxugwW9xV6cPgf5HEb4FWKhhDcKyops526UBqWSxpJG5S4ZaCzN3AxfGzQRuxHZWnglOgTTazKBxO2J36iAeEACL/FMa1CBivKEBBEol/68MMEDBVMQVkYQOEBsUAAIfkECQcAUAAsAAAAACYAJgCGNDI0nIY8nEI81LJEXFY0lH48ZDo07MZEzIZExEY8REI03J5E3GZM/NJM5FpMTDY0/LZMfG48XFI0/MZM5HpMPDo0dDo01EZE9JpMtEY89M5E7IZMPDI0tJpE3L5EdGY8/L5M7IJMfDo89KpM9JJMZF409MpMzEY8VE405GZM5GJMjHY87HpM3EpE9KJMvEI8NDY0nIo8pEI83LpEZFo0lII8bDo07MpMTEY0zKpE/NZM5F5MVDY0/LpMhHY8/M5MRD40dDo81EpE9J5M9M5M7I5MPDY0vKJE5MJE/MJMfD489JZMzEZE5GpM7H5MvEY8MjIyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/6AUIKDhIIAD0oCT0wtOwwIHT4oMIWVloQcSi8tnJ07Dg4hPw0DKxWXqFAAIiedro2gDk4NOjoHPpSphA8Zr6+xoCS1tQMouoIGjL6un8AgOrQ6Jh+6Nsu+zbEsw7UNEagGQte/wKA93NDUlQ/K453loEXo0hKFAL3urvAOKtHcM6cGichHDh6EeTpqDOKQgCCzfcL80TKhQJASh/r2bUMYQBU+jC328fM3rAESGA9AvhOZpBu0bjQGqgwp8iBHATNp7huBUEeOJzlFOhjS80CrmUIx0IrG9EJQkUt66hCHVKSwnkdVCo06jxbQqvuIIjyAEyw8nghzyNRas2eMlItmy03oSQNAQ7bw+nU9YATKWowiN87rCIWDU5BQ0dHSgEMg3nI2X9YibGgT4LwkawEs9OAwQYjzNNSrZM3hvmfcvKGyYLpciJdLV+gy4PkavJbDNHw7xsOybWAYXM4YfaywiNoZQYWIpqFA3+KYWPmKtaFBgxkFgEC/xIGHiBcnnKpgsWBBDQLPUwUCACH5BAkHAFIALAAAAAAmACYAhjQyNJyGPJxCPNSyRFxWNOzGRJR+PGQ6NOyGTMRGPPSyTERCNPzSTMyqRORaTEw2NPzGTHxuPORmTFxSNNRGRDw6NNy+RHQ6NPTCTPSeTLRGPPTOROx6TPSqTDwyNLSaRHRmPPSWTNxORHw6PNy6RGReNPTKTMxGPPy2TFRONPzOTIx2POxuTNxKROS+RPy+TPSmTLxCPDQ2NJyKPKRCPNS2RGRaNOzKTJSCPGw6NOSOTPS2TExGNPzWTOReTFQ2NPzKTIR2PNRKREQ+NHQ6PPSiTPTOTOx+TPSuTDw2NMSiRPSaTHw+PMxGROxyTOTCRPzCTLxGPDIyMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf+gFKCg4SCAA9MAlFNLTpPNR9BKTKFlZaEHkwxLZycIg4ZPaIMAysVl6hSACMnna6fEiqiswVBlKmEDxquvJ8ORbPBAym4ggeMvLwODhzBwSYguDnJyb4+sqPZDBGoB0LUycsOKM7BDNGVD8jgruJL5c8ThQC77K/iCAzwsySngyP2wi1zkm0fjkEeEgRUtizWvlEmFghispChAx8QzMELoKpexRa+lkEpWI6BCxkPPrYTR26fPlE2AKrkJM4BklkvSwYQMJOmOBgle+Ts0SBKzxY1Qz2k1apnUpLwGFA4WvOds5w5vzl1tzRY05lVu44yunWZ0q4FeJZ1AFRsA5mVYMV1ENtjRsq1KIbuswFAYdxlLR8yKJBECtyP4jCK5SjFw1SV4hwKnayv8gYe//6y0FuOsaFNiJc1W+qicK7HC8WFuBpsg7xK0yrK5TyK26ULspdlpIxzBa4DqMEtY7Fvg21cP0ALdxACqygSr4s1HhF85cjWBkxLR8gqHIJRJg0M2X7Jw48RMU5MZfHChRIcE26lCgQAIfkECQcAOQAsAAAAACYAJgCFNDI0nIY8nEI8XFY01LJEZDo0jHY87MZEREI0xEY8TDY03L5EXFI0/NJMPDo0fG48dDo01EZEtJpEtEY89M5EPDI0dGY87MJEfDo8ZF403LpElH489MpMVE40zEY85L5E3EpEzKpEvEI8NDY0nIo8pEI8ZFo01LZEbDo07MpMTEY0VDY0/NZMRD40hHY8dDo81EpExKJE9M5MPDY0fD48lII8zEZE5MJEvEY8MjIyAAAAAAAAAAAAAAAAAAAAAAAABv7AnHBIFAIUNAHOBkpdThJXZ1SsWokVmgjE7TZYYFaDYHBczzkAxtNtg77h8MVFRRMVE7cbHg8TOnZCBUx6bRR9fRwWdiiFenyIYA0PZwUwjm6HkXENi1UKhJhem4kMRQB5ooZ9X5BgGmZDGKp7pIg1QxUJtKtivpFfHAhCNLxtroiQAWmpxiCarL9hDR8jCs5d0K22LCaz2M/c02ABAuDhrnyQDSE459DiYAds4PDxDRHvtuphl/Xxfehhs4eMlbt/AOWZQ5gwxLeBCcGQuMYQoAkAuyBGA3bBzENj9riREFIhnzNtnHy1oqBC1sCCkZYNAbAFJMAPM4ooMEkrpE00MBRMVWnEiwK/ZJSuQCi6jpUBOwV4OvIJh0JSOytqToXjSoPQQDkqYJDaq8+BDTnBYlmjBx61DS3UXqmwAoMID/koUPgQowaDtGiCAAAh+QQJBwBTACwAAAAAJgAmAIY0MjScijycQjzUtkRcVjSUfjz0zkRkOjTERjzsilTswkTUVkREQjTMqkTURkRMNjTkZkz82mx8bjxcUjTsxkQ8OjT8zmR0OjT0olzUUkS0RjzcvkTsglQ8MjR0Zjz81kzsmlT8ymR8Ojzssly0mkRkXjSchjz80kzMRjz0umTkYkxUTjTcSkTkckyMdjz0ykz0qlzcTkS8QjzkvkQ0NjSkQjzcukRkWjSUgjz0zkxsOjTsklTkWkRMRjTUskTUSkRUNjT83myEdjzsykxEPjT81mx0Ojz0plzshlQ8NjT0nlx8PjzEokTMRkT0vmTkdkzcUkS8RjzkwkQyMjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/oBTgoOEggAPSwJRGSM5UgMkQis0hZWWhB1LMiycLEdBH6GhJz4uFZeoUwAiKJ2cKhGgorMKQpSphA8arp0gQUEns8I+K7iCB028nSG/osHCHy8euDrKnbDN0MInEqgHP9acHL+y2rMn05UPyeEsSuTm0C8ThQC77Swp8M+jH/yiNk4NEoGPRYwT8OJBwzGoA4KCPCyQexbs37loDAQtKchCBbly8f6ZUHUPX4uP5ipum0HjAUcW4xKqtAjtBkGOSD7STBnKhICXCVBq4/fvRIMoL98lVAiNQiuOSmIFieCv6s5tDpJKBTnUmShwULcyNfe0YNSlY50h5bhDaFpRpBR+cgw68a2oBjcL5kT7NoBLjjGz2f1wA8DDgi2kUt0WUsGpvO08or06K4CgDlnxRazbdaaBHgM5IhScduQgAJvw6ftFWdiMJIUeZA6Hga/XWQboVarWLjBjaNxQXYgs1aJxF7gOzObFjOttA92MAUnN66zVqgB1G5vSQcTyjrHMGSgAezsmVq5gcD0xowAR85c6ABEhAwGUFB8MzGCCY8KtVIEAACH5BAkHAFYALAAAAAAmACYAhjQyNJyKPJxCPNS2RJR+PFxWNPTORGQ6NMxGPOyKVOzCRERCNMRmTPzabMReRPTOZMyqREw2NOyGVHxuPFxSNNxORPzCZORmTDw6NHQ6NOSmXORyTLRGPNy+RPzWTNxKRDwyNHRmPNRGROzKTPzWbHw6PPSqXLSaRJyGPGReNPzSTOySVFRONORaRPzSZIx2PPzKZORuTOx2TLxCPOS+RDQ2NKRCPNy6RJSCPGRaNPTOTGw6NMxGROyOVOzGRExGNPzebNSyRFQ2NIR2PNxSRPzGZORqTEQ+NHQ6POyuXOR2TPzWVDw2NNRKRPTKTHw+PPSuXMSiROReRPzSbLxGPOTCRDIyMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf+gFaCg4SCABFPAg4aDzoKAydDLDWFlZaEIE8zHx8SJEANSx6jHipBLxiXqlYAJQicnQ1As6S1HgpDlKuEERywHzGys0C2tkEsu4IHPL8VFsO0xbVOIbs7v5wS0NHSpCoTqgdN2BVF28TdtSrVlRHM2DJL5+m2ThSFAL7YHybn6PSkbqQaVGLfhwou/BVTkQ7HIBCv9hmBJo8bQIZOFgjKUMFgD3//FkpDwYqKQX4g1Y1iKE0FjRoRTn54pjAdw5ukchQ0WEFFypbdVKAQcLKFsHkqAUIwaVAKyJAASfmIuO/C04ulspYScXLiOXlRpY0z6LVm2FpUsVkFUrEiVK24QT0w3ef059lRPogabOF2m82kHiDs3Ffh06yjb6MGiHnSnNm7OQBsMmii7zCgLRWkGoxthd2zAQSB4Crx88rTLBka+DHoyUnLFqOSHCTZIBRQbC+fpcGkUATSv2Q8tsVylIF7la6Rg4H0IrhLGfYlsEwcbqkXuw4AP8gcGkADz3cJmcwpmHdv6G8gT2YFBOePuosZINCbPSZXnHpUJE6DwBH7lwAgRAk2MJCECx4YQEMUOFCgyyqBAAAh+QQJBwBaACwAAAAAJgAmAIY0MjScijycQjzUtkRcVjT0zkSsakRkOjT0tlzESjzUnlRMRjTswkTkVkTMqkRMNjT82mz8wmTkfkx8OjxEPjR8bjz80mTURkT0olzswmQ8OjTcvkT81kyUfjw8MjS0Rjx0Zjx0OjTsjlTsykzkXkR8QjzcTkT0rly0mkRkXjT80kz0umTMRjxUTjTUskT8ymTshlSMdjzcSkTkvkSchjy8Qjz0nlw0NjTcukRkWjT0zkysdkxsOjT0tmTsxkTkWkTUplxUNjT83mz8xmTsglR8PjxEQjSEdjz81mzUSkT0plz0ymT81lSUgjw8NjR0OjzsklT0ykzkYkyERjz0slzEokTMRkRcUjTkwkS8RjwyMjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/oBagoOEggAPJQYKGRY6DAMoRy03hZWWhB5FWRIRQp5CTByiHCouMRqXqVoAEywNJxCfnqO0HAxHlKqEDx8yJJ2ynqG1oy4tuoIHVjINwMFCxLVRILo8MjImVJ+xnrHRtSoVqQdJ1yLPst/g1JUPy8xI6J/q0leFAL3XSt3y9LU4qAZNuCbjBxJu/cCpazLIQwKC5z4xQedvlAoOUYwIKkJQhjN50L5dJEZjVT5fCEHSGjmSmIoZNx50JAIynbqLOEflGEjQRs150VqCoyGgI4Kfs1ZWdJCl4xCkISvS8sGi40Sk/nKyvNAxHih5E6USK3etgQWoYmtVJXg22NWrvlEt0rvYlOALWXCDpR3loyjBo1hFKhXlgOc1n+hS7hUVQCZBmoH35gBQgyAJuHltKgzKAJVhGU9/Lg4gyAPXa1AiyyXFmnWBBYM4Xrv8LO/ekoMoE9wnjKLYGU4KPThNwmvCoLQK2Kt0gGBqlRXDpQpxzQRg33KFqoih6wDXH6Gf+SsgDtmDyiTuil/NGsdyZKuKsPihTW+0Ah2Cw8dUJAER9UlZNEMHFOx3CQBBlLADEEOEUsAMVTRxRS6qBAIAIfkECQcAMgAsAAAAACYAJgCFNDI0nIY81LJEZF407MZEVEo0tJ5EhHY8RD40/NJM3L5EdGo8zKpE9M5EdGY8XFY0xKJEPDo0rJJEbF489MpMlH48TEY07MJEPDY03LpE7MpEXFI0vJ5ETEI05L5ENDY0nIo81LZEZF48VE40jHY8REI0/NZMfG48zK5E9M5MZFo0xKZEtJpEbGI8lII87MpMvKJE5MJEMjIyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABv5AmXBIFAI6JwkqRmlcQqzD6FOsWokfx6ph6nYTXlNCQIpczzJAKwQOu92XAxVNRLDe4TZeMKILRxl4gngUDnQbBF56eYt4CSdnBTGDlI6GVQiBlV+bJhQbRQB3nWJuYI0mGWZDA22oipykLkMAKG+LuJyvpRQlQhOksJSLAUKjgqivp6YeHwgasK7Cy8EmKi3Vw7ddAS6lwbmmeQwc2d/BBAJ529TSnQkZydqDenqa1buUtubZCeX92QgEMKdsEANs/KqBQMAFXzYVMv6dmxaLVIILZhzkcyRuEAgj6ja5m7jsVAMLQybIk0eqGC0D4Eh5wFAkU0JhXRqAqoJo4km0jV8gXVHRINw6XecSkDjkoWJHQQ2E0ikBAVlSWBl2+kmzoOnIVw0q0NxKBMMJAQ1xivFQAQHZKwAKkDCQoWiCBh4guNgwB00QACH5BAkHAFEALAAAAAAmACYAhjQyNCSOVLSaRCxeRKTKZHySVOS+RCxKPNTSbGxiPCSmXPTSTCxCPIRyPCSeXLy2XExKNCSCVOzKTES2ZCxqROzabNSyRDQ6NCSWXFy6ZCxWPCSuZIx6POTSZHRqPDw+NPTKTNy6RDw2NCSSVCxmRMzSbOzGRCSqZPzSTIx2PCSiXFxSNDxqRPzebNy2RIzCZCxaRPTORDQ2NLyiRCxiRLTObHyaVOTCRCxSPNTWbHRmPCSmZCxGPIR2PCyaXLy6ZFRONEy2ZPTabNS2RDw6NCyWXGy+ZCxWRDSyZJR+POTWbHxuPEQ+NCSSXPzWTDxuTPTOTDIyMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf+gFGCg4SCMkA9AkMmUDEmQwIpQDKFlZaERCkWKE6dnp8oQxwfl6VRMg03n52cq54mHJSmhBAWrre3FkCzggkmuMCrIDqzHjGswa6trEulCcfBy8koxJUQv8nZnyC7hDK20Z7SwUMihCmt4+PKwRyDRKqr6sj0uJwmTII92trrTkmnwPGzByyECCDLOM3zt9CJQicrOAycBiyJAIf80okj6HCGi4kgPRnAVq9kRlcxHoLaiJHlwBYwY8qcSbOmTZgdburcSbPDA55Adz4oELRozQIshBjl6WSmEBY8Xixd+uIAgCI5azadKrNDEUo0JlTgunPBBAqCLjjIMNbmVre0MN+2WJBBxYVBNE4EySpTbtEOQTaQIAQgwAYkNWL6jcvYZg0kG5rIGsRAxQkFGRCQRZBBwQYVPCzhOLHBc4YaSnc2FVKj84bSGkrB8Fz6sBECJYSkhqm7BAEjSE6QvkxjlgYVr4cLP4FkQpAgE4IvJ/1aBQxeURgYHr6BtILLwj1TF75hRGjsp2g4qP26vfvu1UkAQO+NAgbxyWlfLk+BAX1LABxAQgQjfPcZBhFQcMBkpQQCACH5BAkHAE8ALAAAAAAmACYAhjQyNCSOVLSaRCxeRNSyRGymXMzKZCxKPGxiPCSmXOzKTOzabCxCPIRyPCSCVExKNEy2ZJTGZOS+RCSeXDyyZPzSTDQ6NCxmRGy+ZCxWPCSuZPTSTPzWTIx6PLzObCSWXNy6RHRqPPTKTDw+NDw2NCSSVNy2RCSqZPTabIx2PCyCVFxSNKzObOzGRCxqRITCZCxaRPTORDQ2NLyiRCxiRNS2RGyqXCxSPHRmPCSmZCxGPIR2PFRONFS6ZJzKZOTCRCSiXDw6NCxWRCyuZPzebJR+PMTSbHxuPEQ+NCSSXPTebCyGVCxqTIzGZPTOTDIyMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf+gE+Cg4SCMjw7AjUtTjEtNQIpPDKFlZaEQSkEFRydnp8VNR0jl6VPMg0/n52cq54tHZSmhA8Erre3BDyzgggtuMCrIjizITGswa6trEelCMfBy8kVxJUPv8nZnyK7hDK20Z7SwTUkhCmt4+PKwR2DQaqr6sj0uJwtSII72trrHEWnwPGzBwwECR7LOM3zt5CDQg4rOgycBqyIAIf80okj6HCGiYkgPUnAVq9kRlcxHoLaiJHlQBREYsqcSbPmTA43aXIwIBNnTps6gcbEaaCA0J5Hk8a0ocKDz581n9qUGtODAxoaPCgFSrWmhyEudJzQEAHm1rMcmmg4cQBACQ3KGiA45Xq2KoSxHyhdWAsXgo8FdWku8HGXrwtDE/iOjdvEyAKzUDksMNLk7uKxQCwMwrpY8VgKPTC8aBIhQpMXGHpQUAy3tYYLhAAE4OtaQ4K1Y090zg137O3bJ0rIGsQASG++t1snp127dgIdlm4Ad+46ue7rtqtnKAXDN3K4y5lnB297wKwbxpurH+8aCAxeTxjMTk4/e/i1t0tAh3+KRuL1yrUGxAXD8RcfDSWcsNyCcJXgAgMGWgLAARc4UEICCibwgQMutMVLIAAh+QQJBwBOACwAAAAAJgAmAIY0MjQkjlS0mkQsXkScxmTkvkRsvmQsSjwkplxsYjzU1mwsQjxMqlyEcjxMSjQkmlwkglTsykz00kzUskS8zmw8smQ0OjQsZkQsVjwkrmSMejzs2mwkllx0ajw8PjT0ykzcukQ8NjQkklSsymzsxkSMwmQkqmRUumSMdjxcUjQkolz80kzctkTM0mwsakQsWkT0zkQ0NjS8okQsYkScymTkwkR0vmQsUjwkpmR0Zjzc1mwsRjxMrmSEdjxUTjQknlwkhlTUtkTE0mw8OjQsVkQsrmSUfjz83mx8bjxEPjQkklz81kwsakz0zkwyMjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/oBOgoOEgjE+PQJBJE0wJEECKD4xhZWWhEMoEytLnZ6fK0EaHpelTjENNZ+dnKueJBqUpoQOE663txM+s4IJJLjAqx85sx0wrMGuraxIpQnHwcvJK8SVDr/J2Z8fu4QxttGe0sFBIYQorePjysEag0Oqq+rI9LicJEmCPdra60tGp8DxswcMRAgfyzjN87dwicIlKTQMnAbMiACH/NKJI+hQBouJID0VwFavZEZXMB6C2oiR5UAdR2LKnEmzps2bOhgouMmzp82cIorYaOGzqM0WNhA8gJDBRAahBBRsMGpzQwsCNiogyJAByAyuYLcWqXDCRgkCIyhQaCGErdoRtARK2DjBoMjWrVwRuNjhFG/eDHcBCw6MNzDYwxkOABARFrHjx5AHc6B0oenhwn8Fazas+bALQz8yP/br9zLirSoWDPrqtLHo06MPXyAEIIBr2KUzl94qQtagBSpau86d2zTgHZZumCAOW7doBBhKvejbuTppxwhmzMKgonnkzCqi81pgmzlmzBlEIOdlaEbo6pFVXPDNXtCCGYwtW0/vQnV9SwDscAEEItyFgAhAuHAAfZcEAgAh+QQJBwA8ACwAAAAAJgAmAIU0MjQkhlQsXkS0mkQsSjzcukRsYjwknlzsykwsQjyEcjxMSjT00kwkklQkglQkqmQ0OjQsZkTUskQsVjyMejzkwkR0ajwkplz0ykw8PjQkmlw8NjSMdjxcUjT80kwkllwsakTctkQsWkT0zkQ0NjQkjlQsYkS8okQsUjzkvkR0ZjwkolwsRjyEdjxUTjQkklwkrmQ8OjTUtkQsVkSUfjzsxkR8bjwkpmREPjT81kwsakz0zkwyMjIAAAAAAAAAAAAG/kCecEgUklytgay2G9VkA46LVKxaiTGOxJPrer8eGSVzLfNIisq3y117axSqmbiQuO93iWsuNNTwgGsYKnMWI2yBbm1sNmUGh4GLiR6EVQt/iZlfGHtEJHaRXpKBMhtEHG2jo4qBFEMxamuqiLR4XDU4Qi2amqs5NGegvLaABRsui1yzvss5yjkdFMOTgDQDzryposTOJyHT4F4pmLXl2W4jz2Db2OzDDzDxF/H08/Ty9zD29vj7MCvw7vHTR7BePn4D630omK9hw4QP42lwYBDfQYYVL9ILYMKhRYjzBoa8CIJFwIIQPapESQBAAxgnERoc2e/jPQ1UIsDEuLKneUEQRg449EcUJc94KxIM6Qgvpc+K9kwQAVDiJEN/Gj02kDMkwQqLR7FCRcrCCoqUNCM+nFBGxAOxAo0S3CdgzoSvcZ8iZcsnQQmeNLHOa1CWjxETQp02XAECgOEiCUx8CDyzAQilj62QYBEhQIMLby80CACCANcyQQAAIfkECQcAVAAsAAAAACYAJgCGNDI0JIZUtJpELF5EXKZM1LJEJJ5cLEo8bGI87MZERKJUHJJULEI8nLpMhHI87NJMJKpkTEo0NJpUhLJMJJpczL5MJIJU5L5EPJ5MJJJUNDo0LGZELFY89MpMjHo8bKpM3LpEJKZcdGo8PD40rL5M/NJMJJZUPDY03LZE5M5MVKZMjHY8XFI0jLJMzMZMLGpELFpEtL5MNDY0JI5UvKJELGJEZKpM1LZEJKJcLFI8dGY87MpMTKJUHJZULEY8hHY89NJMJK5kVE40zMJM5MJEPJ5UJJJcPDo0LFZE9M5MlH48dK5MJKZkfG48RD40/NZMJJZcjLZMLGpMtMJMMjIyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/6AVIKDhIIyQj8CNwlJSQk3AitCMoWVloRHKwUlT52enyU3HiOXpVQyDkSfnZyrngkelKaEEQWut7cFQrOCCAm4wKsdOrMiSazBrq2sTaUIx8HLySXElRG/ydmfHbuEMrbRntLBNyeEK63j48rBHoNHqqvqyPS4nAlOgj/a2utPSqfA8bMHDMQJIcs4zfO38InCJyw83CqRwkWMBi2WfLBhQ4UKjh+WtGgQw0UKILeUCHD4BMiUCSokmOixYAFNmjVz6rwpQcWEGCgd0kDxJAYBEzZr3ryZtGmPp0lx3iQA9EIFBUx1alW6VatUpQqGYOC69OnSqDa/MoWqEwOEIM9w44aAOzeu3SB178q1OxfH27l59wKmyxcv4cN4TehdzLix3h4W3hYObLiyYcqE6waogfguZsaD9b7wIdkyaMegDwBY4Dkz4sGh68oO0oPSBgilUesWLUiDgSB/9x6O7bowDgaDOOfevZhyDUKrS88Obfkz4NqFGOD4XLi56RA+LOUIXtm6ab4cSsHgPrv15RDPTXHAUd4x5hAweFFhwFq668B1LRCeflQAUEMPnelVVw8vyEJgby+wNtxhDCL3YCUA+LCBBT2EcF0AG6jGSyAAIfkECQcAUgAsAAAAACYAJgCGNDI0JIZUlKJELF5EXKZM1LJEJJ5cLEo8bGI8zMZMTJpMHJJU7MZELJpULEI8hHI8lLZMTEo0JJpUhLJMRJ5M9NJMJIJUJKpkJJJUNDo0LGZEbKpMLFY8jHo8tJpE5MJEJKZcdGo83MpM9M5MPD40tMJMJJZUPDY03LpE9MpMjHY8pLpMXFI0/NJMLGpEdK5MLFpENDY0JI5UlKZMLGJEZKpM1LZEJKJcLFI8dGY81MpMHJZU7MpMNJpULEY8hHY8nLpMVE40JJpcjLZMJK5kJJJcPDo0bK5MLFZElH48vKJEJKZkfG485M5MRD40JJZc/NZMLGpMMjIyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/6AUoKDhIIxQT8eNgwjIww2HipBMYWVloRGKgUtUJ2eny02HSSXpVIxDx+fnZyrngwdlKaEEQWut7cFQbOCCAy4wKspObMhI6zBrq2sTKUIx8HLyS3ElRG/ydmfKbuEMbbRntLBNieEKq3jLU06JStAEENAKyU6TeOfHYNGqqs6EAR6mFhAsKDBHT0IQEiwjBMDJ4J+fBIxocfBBTsI7si4EaPHHQ0miPiU5BS4JhsGfrzokeXHGk06oTgRhBOQBhpXctTZUSdBExA4sehQYUPOnTtXtuyItGONCkk8vDhKFWPGnFWTcqyhREBPn0y1fmx6VICCglcNqkW7dm3aHeMUTCC1upHjXKs832q8QKSvXyIg/gb+K5jwYMJEbvANfLhv48GNASOGDNgEYseFJxu+TGSHBb6ZL0eWrNlvABqYS0dmnPkxERc+QJOezbn25AMAFmz2S5l1asqSA++gpOGCbNvIObsQlMEAkcW/o7MGzjuxg0GojyfnHFkDodzagY8OzXh4IQc3qKtOPdmHJRzQq9OWPxsECA6lYBzeH50+YxqzcHDDbqIhtsMAvEjhwAIXjKYeaQsckKAgANAw4IPs7eCCLBMaosEOx4mn4XUdVgKADxpYsINi9u0QgAYHcFhKIAAh+QQJBwBbACwAAAAAJgAmAIY0MjQkhlS0mkQsXkRchkQknlysvkxsYjzkwkQsSjw8ikwcklR8cjz0ykwslkw8nlQsQjxMSjQkmlRcgkRcpkwkqmTExkyMdjwkglTcykwkklSEskw0OjTMrkQsZkQ0nlQsVjz00kwkplx0ajx8ejw8PjRsrkzUykzsykwkllTMtkQ8NjS8wkw0mlSEcjwsmlREnlRcUjTMxkyUfjwsakQsWkT80kw0NjQkjlQsYkQkoly0wkx0ZjzsxkQsUjw8jkwcllT0zkwsllQsRjxUTjQkmlxkqkwkrmSMejzkzkwkklyMskw8OjTUskQsVkQkpmR8bjxEPjR0rkzszkwkllzUtkSEdjxEolTMykwsakz81kwyMjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/oBbgoOEgjdEVgJVPUFBPVUCF0Q3hZWWhEwXTTZanZ6fNlVIJZelWzcuCJ+dnKuePUiUpoQRTa63t01Es4IHPbhJJycyJ0mtqw08syNBrFpTBlIwKUALC9VAKTBSBkmgUKUHzVo2LBTU1tjX6elAFDutNsqVEb9aLFfr19Xs/ED81h7s6NRgF6EbtqYYWfevn76G+/RR8FZlBaELNmS0YOjQn8d+1RzI0IJkEBMEFl6oi7jyozps/1Kw6BFFkJUMDhi25Njwpb59QE7MONUhH0BrP9klBQix2gMVK4gsAckz4kN/DxluIMJAZVWfX322BEJiAtKdWI865OmPgAKI8WF1ihWr70dOpUjz6t3LN++/nnJ7zh0stkKFI4gTi0h8ZDHjxogdK4Y8WUdkypMzP8bMWLKIFIc3S+Y8uvNmxEAwaD59eXLpy44D5DgSWvNr1o5f0xhS+3Zryr4fi0gAYMHpxchtZ859GQglD4Z/s54+nYYgDgVorwYOOXly0zogDJpdWzp104xzECpe4fZ30qIbOy8EwXLr0sFJD7Hko338+Mx1BkIpNfSG3mueNaaeKSDoUF5wrwExAC9bQLCAfwfCd8QCCVAoCAA5WJYfZUDQIIuHhngAhH8BOlaieChWAkACHmAAhAjIARGAB8TxEggAIfkECQcAHQAsAAAAACYAJgCENDI0JIJULFI8JJpcLGJEJKZcLEI8JI5ULFpELGpEJK5kJJZcNDo0LFY8JKJcJKpkLEo8JJJULG5MNDY0JIZUJJ5cLGZEJKZkLEY8LF5ELGpMLFZEJJJcMjIyAAAAAAAABf5gJ46kCGBWEDlX4SyBhQFlbZOMxT288ii+3y+SYNyOnQmhAmw6nz6HZYIsGSK+rDCr/TUjmKqo4dhqz9ygr7CpIi5ps6LQpHu3j8yxAW9651CBfg8NNgYOQH+AT3R1QI1NDmEkEwdcP5CAmZmOQBFUIxaCo5CNmUIJIwxMQpidj6OwWQ5GHRaKTqVQprJPqQAcaq5+uYy7agsTGHeBvMXFnHQQoomL1q+9xk0JAT1/m8a6vVsUC9jZnLHWA4jfza+8znUFPcfX58eQXuL2z+oKiPCliyZLVwEsuK7J++dkQABi9wTRSQerEQUCabQtdDRxl4Rl6GJtFAQBAJaKz3NGavRE5VZCdXYWUUzVYVVBa/HwOapgYATGlwxvNrFAAoClfDiFFvtkpUxEnZ0mTiohANxTlQUK3UDwgCJWmQSqkMlCkeMTB1qrGDh6s6MxMGJGKKkA1JiDBDTiUrIQwa3BAQl66rUxYRqFvl0PUkhQUkwIACH5BAkHAE0ALAAAAAAmACYAhjQyNCR6VBySVCxaRCyCvDRerCxGPCSKhDxy3CSiXCxiRDQ6NCSGVDxqzDR+3DRGZCSaXCxufCSSXDRmtCxqRDQ6TByObDRShCyGnCSqZDx67DROZBySZDR+1Dx27DQ2NCSCVByWVDxerDRCXCSKlDx25CSmXCxmXDQ6RByOVDxuzDx+5DRKdDxmvCxuTDQ+TCSOfDRWhBySXCxeRDSCxCxKPCSOhDxy5CxmRDQ+NDR+5DRGbCSWXCxqTByOdDRSjCyGpCSuZDx69DROfDSCzDQ2PCSCbDxivCSmZByOZDxu1DxmxDQ+VDIyMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf+gE2Cg4SCACMxEUZJMkgJPCA4Bh+FlZaERTFKQDICAiECGRlBoxkSFAuXqk1FFzcOPp4hoCGjQbe4CTiUq4RMDUIdnaCenqKkyLYCBr2COyXBn9K0Aia3ttekJgO9LB5COknS45/Wt9bmyQqqO99CB9SytOm49aQZ3JVM0EIEw5/xQtDDZc5WAmaEAAATIiRWwGICCQYZeC0EL0EXGPaTNU1eNXv10F2jMKjIDY0HOtIiFnGiy3P1RiVI1SQjQx0dOa6kaI8eSYUaCRQDOFQaPXMicYmyyIThNxI5V8pKxxMmqRo2GVqgxnVa1ZcxKRTQKKSTzrMfkx51OSrFQiH+DlQS3QlSor0MIU4K8RC3qF9PVK2GJOgu2MpZUufVtSuRXzRiZ+kKXqsUgcYOUYvOGshTpIm3cVkepvaVZ4ixN1OQgwwRKdjBuBgMcdpQNESALXsKduniRWGoXQN+rWuiBoAJQePdnirRtesgFpvMZtgX8SyVw0GSZKVEYyy/rJ8nlRgCYRMWezcexr74dZDthpBrfSjZPUwT0QlV0Cs0OHPdR9VgyQh6OXQbMc4RNwM70OiQwnW2UeQcDr2M0B1m07BEGUH59FIBcv5ENh5MIQjYjCEsKEGABezZFUIAAJxYCABDTECCav+ZE4IL5sk4YwUbnBCAaibglwIONVwDpEogACH5BAkHAEgALAAAAAAmACYAhjQyNCxyjBySVCxaRDR2rDRapCxGPCSCVDxy3CSiXCSKhCxiRDQ6NDR+1DxmvCSaXDRGZCyGnCSSXDQ6TDRShCSKfCSqZCxqRDx67BySZCyGrDxivDx27CSKlDxu1DROfDQ2NByWVDxerDRCXCSGZDx25CSmXCSOhDQ6RDR+5DxqzDRKdCyKnDQ+TDRWjCxuTDSCvBySXCxeRDRerCxKPCSGVDxy5CSKjCxmRDQ+NDR+3DxmxDRGbCyGpCSWXDRSjCSOfCSuZCxqTDx69CyGtDQ2PCSmZDQ+VDIyMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf+gEiCg4SCACMuGwQVMUYJPgc4BiCFlZaERS4eQxgdAiECFhZBoxYSFwyXqkhFFDZDsDefn6NBtrcJOJSrhEcqsBxDGgLExKKkyLUCBryCPCWwsDoxn6AhJra12aQmA7wrweFDsqDE17bY2LWlC6o8wdFD0+bW2Lf3t6LelUfQ8UM9qhU7h8/eOhPMCAH4NQQerAzmZhFMhy9fiF2CKPyD1cBaRAH28I2iSOrCoCKvNg6zVo5gEHsh8wVJkAqJxo1DKkRkGfMezHsmF+IckqHcQJA+K+azcPEIsH8pjoaodyskyZAWaNzc2EDizp5KkwW5MOMfPCLFBH6i+POlW3T+QWow3Ih2qleXYeHaCpHSYbBhadNa1UsYncN4HDpQ80g1bEyD/ujebfy4YD4EQ1cGnlrZss+5/9BWswsKbFXLIcpGg8ehbuC1p9/GtlXjw9N4XXc2VgrWxIsWh6NFZWzOdG9bNADsMPvw6KyfPdteRGIbZwXisD0rNclq0+0hnj6W1jsYboiESFY0/NeV9O68t14odLAxBUSP2WVDDzKdEIqU8YTHmGkVIWTJCABKs1N2V/kkgzuRNXRDS/kRlg4OvIzgnYIDwtdNM0hMsAEsKYD3EVt6nQeiISvMpQA9poXwAkYrsrLCDhykIEt+2MiIXo0KTbBCAQHUEIoJIdQHcAENNF4SCAAh+QQJBwBIACwAAAAAJgAmAIY0MjQkglQcklQsWkQ0drw0WqQsRjw8ctwkjnwkolwsYkQ0ftQ0OjQ8Zrw0RmQkipQkmlw8euw0Okwcjlwkklw0UoQshqwkqmQsakQ8Yrw8duw8euQ8btQ0Tnwshpw0gsw0NjQckmQ8Xqw0Qlw8duQkiowkplw0OkQ8asw0SnQ0PkwcjnQ0Vow0grwsbkwsipQkhlQcllQsXkQ0XqwsSjw8cuQkjoQsZkQ0ftw0PjQ8ZsQ0Rmw8evQkllw0UowsgrwkrmQsakw8fuQ0NjwkpmQ0PlQkjnQsipwyMjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/oBIgoOEggAjLBkHCytECT0BNwYghZWWhEMsHDycEUYCFxdAohcUGAyXqUhDFTWcrz8CMaJAtbYJN5SqhEUonBqvPAgCoKSjx0ACBruCOyTBrzjEs7W01aMmA7spwN083R/ExUAm5MikCqk7wNCvD9PWtvKjF9qVRc/tryvT5eW2/2hdMLGMEABf3/TxmBBDlrV/86rF0CWogsKE0mQJKGdN1D+OozAMGuLqIo8FDR0CjGhLVAJUSCya5PEjRkqItT6akyfyIDR2wSxMA2UOpzyQMQAU+XVRg4WUMYzmZBmKhsyZ7xpGnQdRpy0MM0yyK5Fy41SWXYFMQDiTn1aj+mmvjYpR0hvQVyWGxt25MufdduzcypKKszCQfG2nbT2LVt6BmZz4aYTLcqoJtibJyqJW2WutGGFfsQOGY584s0Ur74TRgenFd5ul8p3tQsVffbBVHt19lAYAHZBjifM3m/JEJK1F6xNuM15nWy4EDdlkcsFpr55txSiIJEVCfRqkvVXNWOQgAA1M4lgxnjHc44ROlAwGVPLixv5oWBpRt11ukMRFZI8lzigUi02yEWfCDbuMQB00GXHGWE4DqiJBaNBINhBf/8SgHzPSpfAgJwc695kLFIFoSAoYasAPLf7E4AJ3KhYCgAQpFKADAROYkEAME2BAQ4qXBAIAIfkECQcAMwAsAAAAACYAJgCFNDI0JIJULFpENFqkLEY8JJJcLGJENDo0PGa8PHLcJKJcNEZkNDpMPHrsNFKELGpEPG7UJKpkPGK8PHbsNE58NDY0PF6sNEJcJJpcNDpEPGrMPHbkJKZcNEp0ND5MNFaMLG5MJIZULF5ENF6sLEo8JJZcLGZEND40PGbEPHLkNEZsPHr0NFKMLGpMPG7cJK5kNDY8JKZkND5UMjIyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABv7AmXBIFAIuH0lisoopSgEToVKsWomwD2TF7UYiL3Ck8DhczzOYI9Vtr8CvuFxhoqKJMg2X2WVOvmGBcAUEd0IqG26KcHBxYhwCdx1+K5SUTXAcL5qOYQZnKnyKbo1ypmERkVUyiaN7XmJynIwchUQAepWubY2cp44ldkIOu6Jdmr2BmrMPQzBsu4uyv3JgCmYzxNGKMYGmnL5xzbhuxqOx4b7LL8Eyr9u6sXHhvxEk2vC8mafg1Q8j0fiI+uNt3rROL0LkyueF2i9fJaBZesftkcGL38zBI+jw26YwrRhyAfQRI70ICUR26ebxoayFIuXxe4gBYB+KAvewjKDOI5+nEBQowmPZ8dcDDxq37bzYTxYJACgY+iFZyuQLDFSC3txKqmDTU83SuFAZQ0wyjwpszeigaxuTqvR8hTWCwO1KZTPlBCuSIWU+oi0/1rJyAZpSQSVNRRABKuQukj2XmbhzYWw0wAU3qbqTwabGP4D2sSNhaAiADpbNAeak4IGw0kIqdEBhjCBJDGVgXwHAoMOAES5SRFCAIcQDEq+vBAEAIfkECQcARwAsAAAAACYAJgCGNDI0LHKkLFpEJJJcNFqkLHKsLEY8JKJcLGa8JIJULGJENDo0JKpkPGrMJJZ0PHLcNEZkJIKUNDpMPHrsNFKEPF6sJKJ0PGa8LGpELHqkJJpcPHbsNE58JIqMNDY0JJJsLGK8NEJcJKZcLG6sNDpEJK5kPG7cJJp8PHbkNEp0ND5MNFaMLG5MLHakLF5EJJZcNF6sLEo8LGq0JIZULGZEND40JKpsPG7UJJKEPHLkNEZsJIKcPHr0NFKMPGK8JKZsPGbELGpMLH6cJI6ENDY8JKZkND5UMjIyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/6AR4KDhIIAISs+Dxs8Ix8vCTQGHoWVloREKzc8nJ0gIwwlJQwDGAuXqEdEFDmdrjwIIDijoiUHNJSphEYNnIydvyAgAbShoQMGuoI6KK/OwiBFtbS2AropjNk82sHCOAzG1AwuqDq/zsCwwhGh08YM1pVGzei+nsIjoqEi07bJhAB6bavnCpqMIu1q8Rv1IpcgCgTP3RNmgdZCfaMwDCLSiqCzWMIc9CuxMNSBU0cgenwGbQhJURenaQz4SiI6aCA6JFT4kkFDI/ZWDgQJIgLPmPpiqBRaEBq7nRgXYoDh8ZdEnC3Cvdw6aoZApp2ItqgFddqLjtyCumKEMwC4reIL+cm1ybTtyLsM6IHl1FYrTLglHuydOIwaUoVf92KlNnKhBqrpBqodiHNHzLjTZnCYjO5cZWOHX2JQQXclTnZ3ucYAAGTwBqI62+2bJkIDpc2RJ3cT5rLsVo2qTAzG6aCd3H4H/h1JIVkozoplF9IAiGClZ2EIpEU161AQCcF1hRGLTlI5oRAdq4JEPVshuUvMnPO2+FfE9FQhhHuE9oMxzPe6kAACZ9vE4pY4JbwQgzKDAJDCJjfJ4s4BGHTH4BEOIiDRBp+AA84LGJh3IUASpEAACCbkMIIDGiSAQQwWWhIIACH5BAkHAEcALAAAAAAmACYAhjQyNCSCVCxaRCSSXDRapDxy3CxGPCxqpCx2pCSiXCxiRDxmxDQ6NCSGjDRGZCSShDx67DxmvCSqZDQ6TDRShDxerCxupCxqRCR+dDx27CxmtCSClCSibDxu1CSOjDROfDQ2NCSaXCxivDx25DRCXCSmXDQ6RCSKjDRKdCSafDQ+TDRWjCxuTCxqtCSGVCxeRCSWXDRerDxy5CxKPCx6pCxmRDxqzDQ+NCSGlDRGbDx69CSuZDRSjDxivCxqTCR+fCxmvCx+nDxu3DQ2PCSmZCSedDQ+VDIyMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf+gEeCg4SCACQrPQUZOhoHGAE1BiCFlZaEQysdOpydIp80EhIDFwyXp0dDFDKdrY2fIqE7Owk1lKiERjacjJ29sJ8NEjvDAwa4gjkjrszAIhpFs8MlArgojNg62b/OG0TSxC+nOb3Mvq/ORcPExNWVRsvmvJ7OIhvr7AnHhAC72vKt6j3DJw3GLUEUAJajVy8FMVHSLgwawgogMyACN8yaVWJWAlNHElpsJhBBx44bJUjs52qhOYEDN3LcYdDIvJH/MApMAG6dhBkicQaEmWIdSmIXYljstRCmiAcQN3Z04U9oJ531TkiVGaLitpstnQo7irKES6FYu8lEKSqeVU7JYmfK3FHgLcN6wuaerPrWqdats0IoPffvJtO0wB6UleniA1icTmHM5chCxdmRTjkMMzprBoAFVrEh/qQBIkGDRxwTfnwXGAKCKCWmEmIXpsbN0vQNQlEYssCik2vwizCynMDS7E6iJmSiLs4MGTnvKDHDEomKmOupkylB3CVlvl1LODldOCoStC1qX+sOlwkRrLWlbcCO5j5kRwCg2PQS1mtiCVxwEH6GoABENtrA4o0EIZRC4CUATIACAUAIIYMGFkBywQwDXhIIACH5BAkHAEsALAAAAAAmACYAhjQyNCSGVCxaRDRapCSSXCxivCxGPCSiXCxiRDxy3DQ6NCxmnCSShDxqzCxidDRGZCSqZCx2pDRShCxqRDx67DQ6TDxivCSibCxurCSafDxerCSaXDx27CxmrDROfCSGlDQ2NCxeRCxilCSWXDRCXCSmXCxiVDx25DQ6RCSWfDxu3DRKdDRWjCxuTDQ+TDxmvCxqtCSOXDRerCxmvCxKPCxmRDxy5DQ+NDxu1CxmdDRGbCSuZCx+nDRSjCxqTDx69CSidCSedCxmtCSOhDQ2PCxeTCSWZCSmZCSWhDQ+VDxmxDIyMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf+gEuCg4SCACQsFgkcP0IdIg5FBiCFlZaERCw4P5ydBZ8FMB8xEwqXp0tEEjadrY2gnxhBBzWUqIRJDZyMnbywsCk7BAa3gjonrsm/oEIZOwcCtyuM1D/VvsufMBc7EAinOrzJvT8z2Z8R3RDRlUnI47ue558MO8/EhAC61vCt87EQuo2wJUhCP3Hy/jEICGHCICKs+iUz9y9CwGemlhiUqOzfpwPddjjU5wrhOI+fhjAcmCQeR34U//FgCIHGxpf+UHa4KFKGRF4IUX6iGWAfzk4x/124OCLiNZetGAkt4MxeCZM4pxqh+e4op6nBQibwmtCjs4AljHqdeuDiBp+r5PhB5Tf1yMUAHuaOEyd0gb1uE1xg5Sj0w5GQNAAoIcsh6bkPKynljTsXm8e29hymUkEWJQaGB/AtWSH3Jcohf2vke8GR778FdiEMLIRibNZ/qHeUEE2IRMSfjmFhUBcCXNd+8zq09XaLBGeJ84KVYHcLRQG91oIXMLJjBO9bAFZsOvlrQYYDPggWGxR+BkIOvz4QaJFxvSUAFVYMKKDChhAhIuSAAA3qXRIIADs=)!important}#toasty .toast.toasty-theme-material.toasty-type-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTY3QkFBREEzMjMwMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6REZBRTRCMkMzMjMxMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBNjdCQUFEODMyMzAxMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBNjdCQUFEOTMyMzAxMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pu2cWHAAAADmSURBVHja7JlNCsIwEEYTcWsXrvUGBbvqFep59Bz2Il7AXsGd4A103UV7gHQwXQkRGqFJ6PvgC5QUOq+TX0YbY1TKWqnEBQAASwdY/+zNy720F/FRvJk5tl58E5/V8/5yvaSdy2he7qR9iLeBf3IrPgjEe+oQqiMIXo0x1D5zoIpoqFc+AFlEABnLKABB9oH/pL+eDRkAAAAAAAAAAAAWdBYyZAAA7gPcBwBgHyADACQM0EUUZ+cD0EQE0PgAnJQtLoRWO8YyEcBWRArxVdlyz9zqx28XrurM57xCpR4AAAAIqkGAAQAoXCj9X4moZwAAAABJRU5ErkJggg==)!important}#toasty .toast.toasty-theme-material.toasty-type-success{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjdGQ0YwNTEzMjJFMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjdGQ0YwNTIzMjJFMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRDJBQjdENDMyMkIxMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGN0ZDRjA1MDMyMkUxMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp4tcFEAAAEgSURBVHja7NjPCcIwFAZwK9LexAE8dBS9WQURPLiBNwfwZLuBUyhebHEBXUVwCi/1C7yClCZN2sQUzIOPGsH4I38eopfnea9L1e91rBzIgRzIdA3aTjC+bVQ/4iNr5MwGr+XF6goxzBU5IQfbW8YwKbKgcYxMbIEKzPzrvQR52ADxMLGNLVPCaLllNZgMiWQxJleoEcYUqDHGBKgVRniG0IFDPPbIDt30LTFXQAe4MYa7QoS5I1v2JRj7v8CItmyFhPSaXdlMgNKG4YKwRUeatKiIUEFpJbVihIcaqLgClRYoemY6MbW3TIAaEmamEyN17TmopwmMdB+qQI1MYJQaYwVKO0a5U5dQCY3t/sgnxNQEhpXn/mxwIAf6N9BHgAEA0JpdHXf3fp4AAAAASUVORK5CYII=)!important}#toasty .toast.toasty-theme-material.toasty-type-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6REZBRTRCMkYzMjMxMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6REZBRTRCMzAzMjMxMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpERkFFNEIyRDMyMzExMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpERkFFNEIyRTMyMzExMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po80HzoAAAIcSURBVHja7Fm7agJBFHWX2NhY2doFDAwBIa3kA5La9H7AdtrZWohNPmP62KQLtgEhBCKks7WysRHc3IEr8bGPOztzZ3dhDxzUndGZs2d29p7VC8OwVmZ4lYBKQN4CpEhqfcLXeWyPl2+j4W8YT04dOMP378A9xyA+o4AA2EEGXINwCWgBxyefx3isNAImwObJ5yYeK4WALnAQcXyAbYUW4AFfY37XxzavyAL6wF5Cew/7FFJAAzgl9Jti38IJGALbhH5t7FsoAWpSI43+I6JYZwJ0lwV1uTkRkPXCTLvgHRRzUqgT8Gmwvy+BD1DQHfJywPTmFHfTc+CAFKo8+LVQ42yAt+DC1rUDaQWad0Fq4efAASlUifyFNX+SgFMkDaSywj24sHLlwCxl8ibhh9kBKVRMfCMWdlQHjngGF+Z8AqSo49LpMAlY4VLacy2hgDj5rNCOn3QHpGjhttnUyAa6DihscVvd2HZgojF5E2jFT5oDUnSxZPBrbnDAEmNpLkAKtRQ+bBRemlgAH0FEaLqE+jlMnlzlJjsgharbf2yFjwxYA+/AhV1WB4YGk6fWQkbxM94BKdp49hsGArJso5fYoQtrXQesPj3getoR7YAUPdx5TB5C2XLg+F21Iy3SBZjHRC5Exk+fISZyITJ+njtgLyZy4Sp++poxMW9cxc9/B2gxsQg4i58+Y0zkwln8rP5mrQRUAioB+eJPgAEAEga0oSjgsNgAAAAASUVORK5CYII=)!important}#toasty .toast.toasty-theme-bootstrap{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:12px;border-radius:4px;border:1px solid transparent}#toasty .toast.toasty-theme-bootstrap .close-button:after{content:'x';color:#fff;font-size:17px;font-weight:100}#toasty .toast.toasty-theme-bootstrap .toast-text{color:#fff}#toasty .toast.toasty-theme-bootstrap .toast-text .toast-title{font-size:13px}#toasty .toast.toasty-theme-bootstrap .toast-text a,#toasty .toast.toasty-theme-bootstrap .toast-text label{color:#fff}#toasty .toast.toasty-theme-bootstrap .toast-text a:hover,#toasty .toast.toasty-theme-bootstrap .toast-text label:hover{color:#f2f2f2}#toasty .toast.toasty-theme-bootstrap.toasty-type-default{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NEEzQTA1RTUzMjJBMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NEEzQTA1RTYzMjJBMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0QTNBMDVFMzMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0QTNBMDVFNDMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pr4ktvwAAADlSURBVHja7NrRDYIwEIDh1jAAozhKN/BWcgJ0A0dgBEbRCbCNkphaTAsPXpv/kkugELgv5eCh2HmeTQtxMI0EEG3RxQPW2mXT+Tz57JXUevd59XkLO1+9HQY+8x1DOKQ0h2TdCYhTjFjSxXWnekQqaAnJafa+AkjP6xcIECBAgAABAgQIECBAgAABAgQIECC7Y2oB8vB5qR0SEJKakW7Dxc7mtejyj8dpXL13Yn0knLy2LiFapiZnoWfUjtgDEW3NsgUiGru+FCJaX18lELWIEohqRC7kWMOXMa7b8ncQECA/4ynAAPBVcVo7OMcUAAAAAElFTkSuQmCC)!important;background-color:#fff}#toasty .toast.toasty-theme-bootstrap.toasty-type-default .close-button:after{color:#000!important}#toasty .toast.toasty-theme-bootstrap.toasty-type-default .toast-text{color:#4b4b4b}#toasty .toast.toasty-theme-bootstrap.toasty-type-default .toast-text a,#toasty .toast.toasty-theme-bootstrap.toasty-type-default .toast-text label{color:#4b4b4b}#toasty .toast.toasty-theme-bootstrap.toasty-type-default .toast-text a:hover,#toasty .toast.toasty-theme-bootstrap.toasty-type-default .toast-text label:hover{color:#585858}#toasty .toast.toasty-theme-bootstrap.toasty-type-info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NEEzQTA1RTkzMjJBMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NEEzQTA1RUEzMjJBMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0QTNBMDVFNzMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0QTNBMDVFODMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvCIVOQAAALtSURBVHja3Jq9axRBGMZnj+ViAhbaaISLR1AUBBNjEq7zD7gUiqIIgraKVf4Ay9gljYVFiliJEklyJE26dJsPYy5pE/AQtNNC8SMXHJ/BN7C3O/exe+/c7twLP5jmZp7ndnZ25n3HkVKKboiM6JJwmfrpA6fACCiAIXAB5H1/1l/wEeyDMvDANvgGfrYrwGlzavWDcfAQ3IrZxwJ4BTbAl9hKlJEY5MADsCv5Ypf6zMXRFPUHLigCT5oLj8ZwTRk5C57LzoUaq5/byFWwLDsfS+Ayl5EC87sQNTZJQ0OdzVYttYS+oWU1yVDL9D1auiN/EM+BmRSYEKRhhjRFMpIFT0ExRR/vImnKRvkgqh+9Az0p24n8AbfBSitPZAA8YzJRBT+IKkN/PaRtoJkRB9ygbQdHzILTxCxTn+Ok0WlkRO2dJhmnwhE9iSq1uWKStGqNOOR2mHHAM7TijFCbK4ZJq6N72U+A1+Am44C/wHdqnwS9jH0vgvvgd9CIWqM/WXTYUuebHPgcnFqjlp0YM6Q59I4UDAymDkuPiQ0D/Rd0R90hQ0ZeUvsK47Ie0uw3Mmjo8WcNJjoGdVMrb2Agp06bK/I6I66wL9yuy2tlAtsJ2+JIZ6RioZGKzsiBhUYOdEbKFhop64x4FhrxdEa2VAbVIhOSNIeMfAUli4yUSHPIiDrYz1lkZI40h4xI2uTtWGBih7TKel92VZ+YNjCXud+9aRGopbiaQdfILceWewJcpPYlxqPBWvDPqZegUwLmRToTdHfAcqO9lj9W6fGlaTmWpGm12abRH4fghdCkJhOMFdJ0qD34tFBWeAuuJWziA7grYpYVBP3wifhfn0gqtknDfuOJ11rpTZW/SglUq0qcpbdjVGFyqoMmpkwUQ/3l6QmwbtDAOo3hmqyzBy8M7DEa2GvnwkC7VzhUvngMPBLxk9+LtAHcFJTHjZV3YrrmdHyp5rqovVRzXtReqqmI2ks170VKLtWkMh1kdfwTYADvtL/RevtcWAAAAABJRU5ErkJggg==)!important;background-color:#5bc0de;border-color:#46b8da}#toasty .toast.toasty-theme-bootstrap.toasty-type-wait{background-image:url(data:image/gif;base64,R0lGODlhIAAgAPcAAAAAADhwqCp+vi5yuDR4sjR2sDJ+sjp0sDZ4sjJ4tjR4tFyQwDB0sHKexnyozkKAuGaaxnCgzHyq0Hyo0H6q0ISs0E6KvjB4tjB2tIau0oau1Iaw0oaw1Iiw0jB4tIiw1Iqy1DJ2tjJ2tDJ2sjJ2sFaOwIqy1oyy1DJ0tjJ0sJK01FiOvlqOvlaQwpK21FiQwliQxFqQwFqQwlqSwpK21pS21pS42Ja62pi62Ji62pi82pq82G6gyqTC3nKgyHakzqTE3nimzqbC3Hqmzq7K4nqozoKs0pC01JC21p6+2q7I4LDK4LLM4jJ4uGKWxnqo0EKCvGyeyoKs0FCMwFSOwliOwJy82nSizKrG4I601py+3LLM5LbQ5sDW6DB8ujJ4tDB2uDB2tjp8uLzS5sLW6DJ2ukCAuD6Auj5+vkqGvEqIvqDA3EyIvk6IvlSMwFKOwlaOws7e7mSayLrQ5Mrc6tLg7rjQ5jB4uNzo8qbE3jR4tkKCulSKvDh8tkiGvD5+uE6IvFSOwJy82DR6tjZ4tDZ6tDZ6tjh6tMze7OLs9F6UxGKYyDp8tlKKvGKYxjx8tqzI4Nrm8ujw9oCq0FCKvj5+tubu9u70+F6Uwj6AuFqSxF6SwnKiykqGvkSCuMja6tjk8Pb4/GycyGiayGaayGKWwlySxEiEunCeyG6eyMja7F6UxkSEvEqGul6WxmCUxEKCuMTY6mqcyGqcxk6IumCWxmSWxFSMvlKMvlCKwNTi7k6KvGSYxDp+uESCujJ6tjR8tjR6tDh8uDx+uDh6tjZ+tgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEFAMYAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAIAAgAAAI/gCNCRxIsFiTBAgTJixGsKHDgcASYFBIMcGFBF4ePjRgsWICBYpkiKEYQONABQpn2ACR0E2XLkgoXmhi8tdFhCJ6bNliASGPlycSikAYotBDBTcTTtrpAGGGl1cQEqBxok+CEDQJDgiRwFCahJR2YlEgYs1LGQlGnIgTh0bCkgMRKtAA5AfKETq3yBhh5+UDET7YxmmaEOJFC0ASb2D05crODw9echmxQDAOlAmzJlTgIDEQG3s87SRS4qWVVrHYKjlU0VgZhQpkedbShgYRCgquZHlBhO2YBwlEFCilKAGYAwcViiixJnEOBVaFdoijysIIPi7i4Im0R6EwNSMT/nxJowNIFI8KeMWo0AWPe/eyFP7QoSOLg1El0pTwmPDIe/d0VIWQBwmAQN+BOuTwB38+uaeLFYoQkFAIBCrCwQ0I6hAefwhUMAsCQylEIU4EPOAGBEGcx+BHSTBRgw98FDDCUCEklVAfuLyix4p7SOLjj3RUIAJXm6URxQcmmDDFiqf86CQdItzUxyJGJGmlIwwqgAoLPtCwRB0+5qHQFFYmOcEMfqjhkQg7hJLICjOK8EgV4RVzQS9JGuHEX3tMIIEmFA0igiWhhHJJAwwoBIYAxiDkRxqY9fKDBBJEwYopU+hBhRwv2CJJoaGoQIJCAnkxUUKGREBpEH8sEkEEqA/IIasYgIAC6hKEJODBL3EpRAqlErCiBw+v9tGCrGwkUAkZoGKCEEEcIdQCsD2J8WoUIkAhqysIESJEKHOghEZDTXDlBKUzIMTKq7UkMMgisp6RUAmFhKDAQ/UOskpxCE3xagv9yrrkhGCY1ISNCWjyqpoJnCHrKrCZJFAAEiVkyqtmJNQCDFDomsC4Eg90EBjuQsFKRSTzGrJDByB0QQgw14gQoyYFBAAh+QQBBQDIACwAAAAAIAAgAIcAAAA4cKgqfr4ucrgyfrI0drIyeLY6dLA2eLI0eLRaksQydK42drB2pMyCrtJAgrponMp4ps6IrtKErNBOisCMstQweLYyeLKGrtIweLQydrYydrQwdrQydrIydrBWkMAydLYydLCOstJYkMCOtNaQtthYkMKSttZakMBYksSWuthaksKYutiYvNqavNqcvtxqnMagwNpwnshwoMqqxNxwoMxyoMhyosxyos50osx0pMyAqs6qyOCAqtKsxt6CrNC2zuSCrNKIsNSOtNSWuNamxN6qxt6wyuC60OSKsNSKstQ2erZkmMh0pM5Ihrx6ps6GsNRQjMAwfLoyeLQwdrgwdrZWkMKStthsnMiiwt5uoMqAqtCsyOCmxOCwzOK40OYyeLi80uQ6fLgydro8frhAgLg+frpAgLo+fr5Khr7E2OhMiL5Oir5UjsBWjsDE2OrG2OrG2urI2uponMhunMjU4vBunsi0zOIweLh+qs56qNDA1OjS4O7c5vJ8qNDC1ujg6vQ0eLZEgrpYjLxYjr6gwNw4erZMhrxSjsA2frZCgLg2erRclMRomsg+frY6fLRmmshkmsg4fLY6fLaGrtRSirxSjMCuyuLS4u7o7vZQirxcksR+qtBCgLa80ubM3uzg6vLu9PhcksJwnsZilsRglMBeksDe6PK+1Ob4+vz8/P5GhLxglMJIhLpCgrpelMRkmMZilsZIhrpmmMZMhrpCgrhmmsbM3OxOiLxomsZUjL5Qir5SjL4yerY0fLY2eLRGgrpMiLxUjMBCgrxglsY0erZEgrg0erQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gCRCRxIMBEYAwgTJkxEsKHDgb4McFBI0YAFA1IePiRgsaKBBJtGGKIYQOPABApNkICScNeXLxUoWgBjstdFhBde8OCxBiGMl0ISbkCoYdHDBDcTPtkZAeGPlzMQJqggZIkBDTQJDtBgYImThGx2ZklwwcXLEQY6SIgTJybCkgOl9nhxw2oHnTw+dPDy8sEFGWzjNFAI8eKaF4gdjJyx04Gil5cuoHjD9gTFrAkTRED8goQrQTuLtHmpQhYqtkUWVUQ2RmGCWZxVHKrQ5UmCGUncFGELpIyBDQVYoTBA5cBBhRvatEB8JYFVoRPi7FnToVIFOHUwPVDoVQzCKU6u/ryY49EAqRE7kNRZv76RwhklSkBpAKuNkzblEVZgv/6PhJEGZGCAA/EVWAIJZORnABbrfaICCgUkpIGACvRAgoEleJcfAjvkgsBQCk2IEHCKWBJLDuQpmAALXAwhQyUIdEBUUgktwcYmKOUnCCA88niKGltswFVCgaTRSA8OOECBgq2c0mOPamxw0xKv+JHklYzkl4AMI9BRgQ+f8JiFQhRcmaQOHwjyVUUXqBBKH4PIeMEjHwCYiAViJKnHK349gEMTJiD3SAGnhBJKJjLImBAVAiCDkBNO5CjGDE00AYkgVqyRwBGpqFEKIIaGIoKiCAkkxUQ1QlBpDWQwAgEErYKkoooqtODCR6g+qJZBL3EpREylTQgSCCSvLhHGrERc4IgnoYpS6kAcIdQGsEuK8SoTU9gwKyALGLBIDKEAgRIaDYHBFSOVBmqAIK8q4G0os5aSUBtLaJDAQ4tosIQC7iK0xqtRIOTDrDRcICEVJoFBowFWvLomKduSeq9JyAQgUUINQ2CGVGHIgcUFApJL8UAHUdHVA8Mgt0EVBvA6skMHIGSBBjRrcFOjJgUEACH5BAEFAMAALAAAAAAgACAAhwAAADhwqCp+vi5yuDR4sjZ2sjJ+sjp0sDZ4sjJ4tjR4tFiQwjJ0sDR2sm6cxnqmzkCAumSayG6eynqo0HymzHyozoCq0k6KvoSs0DB4tjB2tISu0oau0oaw1Iiw0jB4tFSOwIiw1Iqu0DJ2tjB2tjJ2tDJ2sjJ2sJK01DJ0tlSOwlaOvlaOwliOwFiQwJK21pK42JS42JS62pa62qDA3GiaxmycxmycyGyeyHSkzGyeyqLC3KLC3qTC3HimzqrG3nim0HqmzH6ozoKs0I601pC21p6+2qbE3K7K4n6qzqrG4LDM4n6q0q7K4LLM4jZ6tmaYxmyezHqozkaEvHKizHyo0E6KwIqy1Jy82mqaxnSkzqbC3KbE3r7U5rbO5LzU6DB8ujJ4tDB2uDJ4uDh8uDJ2ujx+uD5+uD6AuECAuD5+vkqGvL7U6EyIvEqGvlKMwMLW6EqIvkyIvlKOwszc7KjE4GKYyGicyrbO4rjQ5src7NTi7mqcynSizNjm8DB4uLrQ5pq82trm8DZ4tG6eyEaCulaMvDh6tkaGvFSMvjZ+tjp8uEyGvObu9jZ6tD5+tjp6tGCUwoqw0jh8tjp8tlCKvFCIulCMwDp8tNjk8ODq8uju9lqSwnCgzHakzEB+tvT4+liQxMTY6tbk8PD0+kyGuGKWxF6UxF6SwFqQwmCWxl6SwkiEvFqSxEKCuEKAuFCKvkyGumKYxkiEukKCukCCumSYxjJ6tjR8tjR6tkaEumCUxFKMvkSEvDR6tDR4tgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+AIEJHEhQ0ZgECBMmVESwocOBuBJoUEgxQYYEYB4+NGCxIkJOIMhQDKBxoAKFLEJYSAhryZINFDOMKXnrIsISM3jwiIOwhsshCUsgHOHooQKbCT3pzIGwgksJCAl42PAkwYiZBAeMSPBkSsI2OrEoKBHDJYgEJjCwYRMiIcmBCHM9kCHhJIEYOkEQUOISQokba9lQUQjx4hoZiCeIvKFTSBqXdUq0+LKWCEWsCRVQQSyjAwRXOmmAcFlklpe1NKpSBFZGYQlTnIms4UAjxxMcGxLtWIskTYISBFYtSEDiwEHXIGAgvqJAdcIkbPK0MVHJAxs6eiAo7CoSoa4rMiL+eEwQacUDJ3TSp4eiUEcIlZ1UvWH1ZjxCDurTA8JwCOGHBFW8J2AIHZhhXwI1pCfKCwucNNR/C/jQwYAhdDceARTUMIhQCo3wH0IKpHHBKRLIcmACCsTAhSQOVFIAhyMgldATbTR4oCt+5KhjFxWUsJVCU9jhwwQTyHFgITom2UUJNj3BiRZERjnceArcsIINHvQgSo5YKBRHlERKAAItiHhUwguN7GGIUCVAEhJCimSwCJE5cAJBGBDoEIUKrlFCQCaNNKKJAyYoRIIAwCDUyxQOknFHFFGoQosKcSjwAyldoCJIoI2IwABhwIAx0Yx2QHrHIq1EEIErpIACSimsbdDB6REIJPDBLXAllEsrkEqgnaoRPOGFqyiU8IgXnHKCEEEcIWQFpFG4kQAZqtoRBiGuCvIpAUY0gsRJajQ0xlYLQHpWArSoGgpXm7iKSkJvPDGCAg85MkIuKvCJUByqXoLQEa72wKFVYpQ0howJqKCqVwns4qofhYJYkkABSJSQwhEYiKIXcNhQwn/hTjzQQSQkkAsEtLhWQsm4iuzQAQhlMMLMMSKEaEkBAQAh+QQBBQDRACwAAAAAIAAgAIcAAAA4cKgqfr4ucrg0eLI0drIyfrI6dLA2eLIyeLY0eLRckMAydK40drByosyAqsxCgrhomsZ0pMyAqtKAqtCCrNBOir6ErNAweLYwdrSErtKGrNCGrtCGsNSIsNIweLSKstQydrYwdrYydrQydrIydrBUjMCKstaMstQydLYydLAwdLBUjsKMtNaOstJWjr6QttZYjsBWkMKWuthYkMBYkMJakL5akMBaksSYutiYutqavNpunsiavNycvNqiwNxyoMpwosymxN54ps6oxOB6qNCoxuB+qNCqxt5+qs6CrNKQtNSSttagwNqkwtqyzOKwzOJ+qtC0zuQ0fLZkmsh+qtJIhLxomsh4pMyArNJSjL5SjsKOtNRuoMqgvtpwoMx6qM6uyuKOtNaUuNigwNyiwt62zuK2zuQwfLoyeLQwdrg6fLa40OQ2frYyeLgydrrC2Oo4fLg6frg8frg+frhAfrg+gLhAgLg+gLpAgLo+fr5MiL5QisBOiL6gwN5QjMBSjMDE2OjO3u5unMhmmshqnMpwoMp2pM4weLjA1ujO3uzQ4O7S4O7e6PKsyOA0eLZEhLxUirxUjsA2erZIhr5UjL48fLY4erQ4erZglsbg6vTY5PDs8vjq8Pbu9PhclMS80ujM3OzS4u7o8Pb4+vxcksRcksJ2pMxsnspqmsRIhrxonMhGgrhmmMRimMhilsJeksJunspkmMhelMRqmsZGhLxglsRKhrrM3uxEgrhEgLZKhrxklsRCgLrI2OhMhrpMhrxOiLpOiLxQir5snMZEgrpCgrpQjL5Sir4yera80uY2eLRkmMY0erY0erQ2erS80uQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gCjCRxIsI2bBAgTJmxDsKHDgVMSZFBIMQGGBGgePjRgsSJCGSziUAygcaAChSw0FElowYiRCRQxuCmZ7CLCETB69NiFkJnLIwlHIAzh7KECmwkd6OyCcIjLKwgVVJgwKUGImQQHhEgwCVJCYDrHKBghxiWLBAQonDmjISHJgQgfSWhR6CQBMTq1ECjj0s6ICGvPBFEI8SKlFogPrUkQQeeQOi7LjHghZa0HilgTPuqCuIWSPBB06tDiEgSrMGt3VKUY7Y3CEbM6d7AyQUeQSREmaPGxlgidBCMILIiRQMSBg6+HnUCsQcHqhEXOPNlFQtiFM3Dg5FEYB5JIhJA0/rTI5DEBrEpYHGVfTz4hlQkThhT6ZKGWhfIIK6zP/uQIJoQfJCABfATCJwd+CTCTHSgoxHDSUAGy4EAVBU7wXXkEYMHLJUIpFEKAUdFhAQ6rfIJgAgrA8AMHtARDQIchIJXQJJSY8AiCECyio46CnDHECFspBAkOQTjgACUIsiLIjjueMYJNk8jQhZFUnlWeAhG8EMEFPyij4wwKUUKlkYTw0YtXFY3ARSOCRCLUCGuYsFgCbWAQh5GosDBHAnNQQYUFJHQIJwGCNNLIJqmQoJAIAkQDHpoJxJGJnzXwYAYMlwgxChsLiGJoIxsompBAaEw04yd+urJGKKSQ8soor5xw8sstgXz6AwIJfJAMXCj5SQUeBHjSqi5PxOrCCJY88SkNCBHEEUJ7+GpFAre0ygkDPMTKSAko5tAIEifp0ZAbW7Hg530J8NCqLyQso0msCySkxSQhKPCQMyE0w8cfCTHRqhNC/RBrEx1apUZJbsiYgBmtPoCQKdoWbG9J0QQgUUJntBovik8oE8EIAYpL8UAHiZDAGhHQQkBQI5i868gOHYAQBiOkEEKMCDVaUkAAIfkEAQUAywAsAAAAACAAIACHAAAAOHCoKn6+LnK4Mn6yNHa0Mni2OnSwNHi0XJLCMnSuNHayNHaweKbOQIC4apzIgqrOeqbOhK7UTIi+hK7Shq7SMni0MniyirLUMHi0Uoy+Mna2MHa2Mna0MHa0MnayMHawjrTUMnS2MnSwMHSwVI7AkLTWVo7AWI6+VpDCkLbYWJDAkrbWWpC+WpDAWpDCXJDAWJLCkrjYWpLClLjWmrzanLzYbJzInLzacqLMoL7aoMDcoMDeosDadqTMqMbgdqTOdqbOfqjMqsbgfqjOfqjQgKjMfKrQrMjgfqrQgKrQrMjisMrgiLDUjLLSmLrYpMLcqsbesszisMriirDStM7kirDUjLTWNnq2ZJjGQoK8apzKgqzSUIq+hrDUMHi2UozAMHa4lLjYbqDKdKLMosDcfKjQmLrapMLets7kuNDmNHy2MHi4utLmMni4Nnq4Mna6MHy6OHy4PH64Pn64PoC4Pn6+SIa8vtLmTIa8Uoq+xtrqUIrAUIzAqMTepsTgZJjIyNrsZJrIytzsaJzKgqzQcqLK1uTwcKDMdKTOxtjq0ODu2OTwNHi2QoK6Toi+OHq2RoS8Nn62PH62Soa85Oz0Nni0Ony2OHi0YJbGZpjGaprGaJrIOnq2Onq0PHy2XpTEYJTCToi84Or06O728Pb6XJLEbJ7KRIK6YpjGaJrGZJbEYpTCwNTmzNzs8PT4+Pr8xNjoSIS67PL2/v7+SIS8bp7KZpjEZJTC/Pz+SoS4TIa6zt7sYpbGaJjESoS6Soa6TIa4QoC0aprEQIC6Uoq8vtTmToq+Mnq2NHq0RoK6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP4AlwkcSFCSGwMIEyaURLChw4FrDHhQSNHAFwNxHj4kYLEiwhJgsFAMoHEgAoVgjgBJmIcHjwgUv7ApiewiQgtNZMi4gzCVywYJLSDckOwhApsJT+l8gJCMyywIERCJIHLDTIIDNhjAoiXhHZ1XsFio4BKMgQIRliwpkpDkQISNxkgAdLJAThldCtRwSceCJrVLmCaEeDGShMNjIBnIojOHA5dnCmgATIHi1YQIOB2W0ICOA50murikoOyHWjEiKS6Do9DCjM1KIkVQsQVBlghdxKjdQQfhghUlDHA4cJDiBC6HjyBIjbBAgyU/7iwQpWRKGzUOFL7RwtzREQmmPP4aeKHBEJo26NFnUpipQYMcgFJMcDShkXgDSdKjHxJBzk0DY7gnoHuX3LcYelVUUMJJQ2VgABinADFgA/7dh4APoWAilEIbOBgVHZSkkEUMBhqAAAY4FKLJLgt00GBFWNzRhX33ORDIjTfuMYUPFmilkBYpbCFkJAaisgeOOE5hgU1YgCGIkFDysWFFCGiigSZK1JDGjSwoFAmUQmYyQRY+MNgaBofsUYxQFlyigWIGSPKFHEICAsYcBSQACy09fDDlJQvsccghi/jiYkIcCLAMQsQ4kpAss9BCyyKbSOGEJWWMIoULgwx6CAQfKCRQHBMl9AkjkpayiyKllMLKKLaVVKLLL8Z4ioMlBmSAzFsJFYCHpLngsgAprQqDRKxUWDDHEJ6egBBBHCH0hKS0gJpHq5Uo8ECsroSKAA2HQHGSHQ2xoZUUkvZpwA2ttvKBJYzE2kJCXWCxAQIPJbMBJH5EsQBCIbSqg1A4xGrDlBuEURIbX1hwqAFMtCoEQglw+zC+JS0TgEQJSdEqCgkhkYYmFjhIbsYDsSGcAZCsokoBFHFgwK4oO3QAQl8UIMIGG9ikaEkBAQAh+QQBBQDFACwAAAAAIAAgAIcAAAA4cKgqfr4ucrgyfrI0drIyeLY6dLA0eLI0eLRilMAydK5woMx6psxAgrpomsZ0osp+qMx8qM58qtB+qNB+qtCGrtBOir4weLYwdrSIrtIweLSIsNSKsNIwdrYydrQydrIwdrJUjsCKstaMstQydLYydLAwdLCUuNhYjr5YjsBYkMJakMJaksRcksJcksReksJclMSWuNiWutiYutiYutqYvNqavNhwoMqiwtykwt52pMykxN52pM6mxN52ps6qxuCCrNCGrtKOtNaWuNacvtqkwtyqxt6sxuCsyOCCrNKuyOCErtKuyuCwyuCwzOSyzOS4zuI0fLZkmMh8ps5EhLxuoMxyos5+qM6ArNJQir4wfLoyeLQydrZWjsKMtNacvNqgwN6oxuCUuNaevtq+1OgwdriQtti+1OY4fLbA1Og2frY+frYyeLgydro4fLg6fLg8frg+frhAgLhAgLo+fr5IhrxMiLxOiLxKiL5SjL6evtxMiL5OisBOiL7A1uhSjMDE2OjO3u680uRkmsjI2urQ4OxmmsgweLi2zuR6qNB0pM7c6PJ4ps54ptA0eLZIhLpSirxWjsA2erZGhLw6fLZKhrw2eLQ6erSevNg8fLY6fLTg6vJelsbY5vDo8Pbk7PTw9PpilsRglsRglMJ6ps5yosxIhLzQ4O72+Pzy9vpuoMpqnMpomshMhLhEgrpCgLZqmsZkmMRglsZklsRunsponMhMhrpilsZUjsJmmMQyerY0erZKhLpEhLpEgrhonMp0pMw0erRKhrpGhLoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gCLCRxIcE0bAwgTJlxDsKHDgVIMZFBI0QAGA1sePiRgsSJCERcmUQygcWAChRd+MEiYx4aNHhQxtCm562JCJSNGUELowqWpil2EPUxgM2GrnIcQ4nCJC2GCRjtEdplJcEAXA5McJLSTk8mjD0pcXjCQYAcPHo0SkhyY0NaEWY/I4hxx4QMKl3E+iDrLo5VCiBerTBjM6o2BUTlXsXF55oMWvhQoUk2YYMrgCVfkzMnJ4YLLCq/2nB0ikmIxNwo/eLmsqMoODocSzOpxYcjZGnEQFlChx4CHAwcp5lE0uMej0glN8Qhjp8AdCUCgPJGjMGuahA56TFjh0YAKLTj2/kAZP/6FwhYMGLDqlMuOAztxu5ciP15Hj+sGNhg4lL5/evzdjTJeEkHocRJCXejXByH+/dedUwzAcAkXFCVIWRx2ABKDCA8mpMEMEshyRwEfIFhUQpNUwUeHBszxx4svlgEEDgZcpZADuUxBCCFVdPhKGTDCCERHWPUxy45I9vFgArLoIYoEMjTxIgkKVYHkji/YQQoEB6YmhCBlRFLiB5Vogd8aGKSx4ywXwGGAC6GkUgQIJSJUCQJqCCJIIbrUiZAHAhSDkANaIWQHKKmkUsgDSGgwSRGeLJFCIHoKggUIfxWzxUQJVWJIop+4gsYnn5DiCSOM9GJHIpXKcEl+pLuwlVABUSSqigIFcEIqLD6gagEXmvhQKYcGEMQRQigkmkoEIFhCKiMLPIBqIJgmMIQgZJxUR0NtXJVEoplgGgupg4BwCSqoppBQSB4k8JAwXaSRgw4FINQBqTeUSAOqMvjpgRkltYHBB34CQWoDCLEwrZ/ullRMABIllASp6iLkgxOyfKDftg4PdJAHBqQhii5d/mlArB07dABCA5fgsk2BlhQQACH5BAEFANQALAAAAAAgACAAhwAAADhwqCp+vi5yuDR4sjR2sjJ+sjp0sDJ4tjR4tGCUwDB0sHakzIKs0D6AumqcxnikzIau0k6KvIKu0pC01oSs0DJ4tDB2tDB4tFaOvjJ2tjB2tjJ2tDJ2sjB2sjJ0tjJ0sFqQwpC22FqSxJK21F6SwJi41lyUxF6Uwpi62pi82py+3GqcyJ6+2G6eyqDA2nCeyG6gzKDA3HCgyqDC3nCgzKLC3nKgynSizKTE3nSkzHimzqbE3nqmyqjE3nqmznymzn6o0KjG3nyq0KjG4KrG4ICs0qrI4LDK4oyw0pC21pa42Ji62J6+3LjQ5LTM4oiy1LjQ5jR8tmKWxnSkzkSEvGicynimzIaw1FCKvliQwFqSwlySxJK21myeyp6+2m6gynKizrLM4oqw1Ja62LbQ5oqy1LzS5jB4tjB2uDZ+tjB4uD5+tjJ4uMba6jJ2ujB8ujZ6uDp8uDx+uD5+uD6AuD5+vkaEvEiEvEqIvEyIvEqGvlKMwEqIvlSMwEyIvlSOwlSOwFiQxFiQwmaayMja6miayNTi8HikzsLW6NTi7tbi7jZ4skaEuk6KvlaOwDZ6tkqGulCMvjp8tkJ+tlaMvoiw1ODq9DZ6tJa41jh6tjx8tDh8tjx+tmCWxGKYyIaw0mSYxmKYxubu9F6UxNzo8u70+GKUwk6IvrzS6NDg7tjk8Ory+Ojw9vT4+vz8/mqcykiEusDW6GKWxGaYxl6Uxvj6/GycyGCUxGCWxmSWxGKWwmSWwkKCuGSYxECAusrc6lCIvGaYxFiOwFCKvFSKvHqkzL7S5jJ6tjZ4tEiEuDh6tESEukKCukKAuDR6tECCumSayDR6tjR4tgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+AKkJHEhQTRsECBMmVEOwocOBUhBcUEgRARoEcB4+NGCxIsIsf+JQDKBxYAKFf2rASohHhIgYFNGsKYnsYsIdEyZUQTjCpYuKGjA9TGAz4aecUxCycEkKYQIcNURqmElwgAYEkBwkrJJzSAILP1z+QZBgxooVOhKSHGiUyghpZHFO6GPBjMs5FlCcXRFKIcSLVagIJiTyRE5DbFxCsZBl7w6KVBMmICWYipc5bHIa0eNyR68UZ7FAqkjtjUILfCrXaObCyJQEJ2rksXRWxByEBADxQbDhwEGKeCrHkCZSoYsVKqoQiMSAxhEiWhPGcVAcwa8YVAB5RPBIwq0UR8L+hw+hEJAVK58EZbnT7A7c7QzEh29yo7gFBFPO6z/PaTtCUuHlEAQfJyGkAQYI7FHLfudV51ECLoSACVAIJiRHFY4MkoV/CTWgxA6zRELAfQgcSJEFmwCxBCMcOhDFizDa8NNVCRHwwBOuvPIKBBz2AuOPNnSEABsvtKLjkV+QWFECUxDjCQQiEPEiFgpBcKSOiyTBCwwFntaAG04Ec58FkziiCUJqoHGHLa+M0kIxC2jRiilMdKDQJAQ44YYbiZzCgUIbCEANQrMIA8J9jZRiiimJ+MJDBcmkoIoQGaSypxvG2JmQQHBMlNAkwCx6SSROXHJJCaocckgsjSBxaRetJ2GADFuSPbEoKwoQsIqplMigagNkvnCpHwgRxBFCFCxqSg8c4GHqISDQouoxdiYwhhspnGRHQ2tc5cOiJiyAAC2mPtEBJIWomkFCeiSgQQIPYaKBJl+8QABCEZhqwn1dqEqCkhqkUdIaaFjwJ0I8mMojAlqoesbBZJUkUAASJZTwJesiJEMRnliA4LYSD7QGbwjI4UkoXSK0AQKzhuzQAQihwcEHGmhgk6AlBQQAIfkEAQUAzgAsAAAAACAAIACHAAAAOHCoKn6+LnK4NHiyNHayMn6yOnSwMni2NHi0XpLAMHSwbp7IdqLKeqjQQIK6ZJrIbp7KeKbQfKjOgqzQToq+hK7UMHi4Mna0hq7SiLDSMni0MHi0iLDUirLUMna2MHa2MHa0MnayMHayMnawWJDAkLTWMnS2MnSwWpLCkrbUXJLCkrbWXJLElLbWlLjWlLjYlLramrrWmrzaaJrEnLzYaJzInLzaaJzKnL7capzIoMDcapzKbJzIbJ7KcqLMoMLeosDcdKLKosLcdKLMosLepMLcsMrggKrOgqzSjLLUkLbYmrrarsrgsMzigKrSgKzQsMrisszissriNnq2ZJjIbJ7MeKbORIS8cKDMfqjOVIy+VpDCWpLElrraaJrIrsjgjrTUmLzarsrivtTouNDkwtboMHy6MHi2Mna6MHa4Nn62Mni4Ony4On64PH64Pn64QIC4Pn66PoC6Pn6+TIi8SIa+Vo6+zNzsSoi+TorATIi+TIrAUIzAUozAVo7AVI7CWJLEVo7Cts7kcKLMuNDmyNrs0ODs2ObwtM7kvNLm1OLw3uryeKTMqMbgdqTMNHq0eKLKRoS6Uoy+XJDAOHq2SIa8PHy2Nnq4Toq8Nni0mLrYOny0OHy2Ony25u72YJbEUoq6PH62QH62YpbCYJTCXpTCdKTO4uz07PL49Pj6cKDKbqDKxNjo0ODu4Or08Pb6ZprISIS6QoK6aJrGRoS8Soa8YpjGYJbGXJTGXJTESoa4YpbEXpTEToa6QoC4ZJbCYpTCXpTGZJjEYJTERIK6Mnq2NHy2NHq2cqLKRoK4RoS4eqTMNHi2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP4AnQkcSHANGwQIEyZcQ7Chw4HHEIRQSBHBBQRnHj40YLEiwgp5qFAMoHFgAoV5bEBIWKtDBx4UL1woaexiwh8OHGBByMWljYofID1MYDNhr5wtEMZymQJhgiw+RH6YSXDABwRU5CTEkvPUSSIu8yDA0CNGjCwJSQ5MmMsKF6c4HdjBYMFlGwQrzMbApRDixQdWAgsTySVnlTcuk2CoA8Psj5gCEyLrEtgKBDdwcjqw5PLHLBNmn5yk6CwNxQqVcTywISHXZB52KJj18MapnwoIQBw4SLEWj8A4sFK0EWNJMQKWfswoAqR2wqwiEcLBYaWPRwS3bSwpwp3724RcIP5AwMVFD5Y5WJBdR/CjO3cvEaJvQCBMvH3xndYjSME9x5UKoyHwAQcI2JHLfeJhoh8BNpSgCVAEJtQGFnpwgZt+CEzgwSOgyEIABggNSBEGnDDzwoPrweHEiitGkYMOAiqUAA1HpKKKKkLo90AULLKYQ0cIvHEDKjcWOQOIHiUASgUrEOHBDismoVADRd54iAakMBCgQhOQ4YQv82FQSR2VILTGBZLAogojMoSywB2ofPKCCAp1QoAUZJBRSClIIgSCAM4gxAswBYAoySKffKIIKTsgQQALhgSxRSJ5ktEAnQkJdMZECV3SSqKI7CIFIoisYAgeeEgiiSOVKnESB6TGrJVQAk0kiooCBLhC6igzoIrEBm/MUKkfCBHEEUJKJPpJJBhYQioeJPCCahl0JpABGSycREdDF1w1RKIuLIDAMKQegQEVZqC6RUJ1JPBBAg9B8kElM9RAAEIUkKoCiGGgqkSfU5UkEwZ97kBqAzxN2ye8JTkTgEQJBUHqugjNYASfBG7b8EAXgYBAJaaAsmVuCMS6sUMHIIQGBid8MBVCgJYUEAAh+QQBBQDFACwAAAAAIAAgAIcAAAA4cKgqfr4ucrg0eLI0drIyfrI6dLA6erIyeLY0eLRcksIwdLA0drByoMiAqtJAgLpkmshyosyErNCArNBQir6IsNIyeLQydrIweLSIsNSIstSKsNIydrowdrYydrQwdrQwdrIydrBUjsKKstSMstQydLaMtNaOtNRYkMKUuNZYkMRakMBYksRaksJcksCUuNiWuNaWuNiWutqYuNaYutiYvNqavNpmmsaavNxsnMacvNhsnsqmxOBunspuoMpwoMpwoMx0osh6ps6oxN58qM6oxuB8qNCqxt5+qM60zOKIrtKQtNSevtqsyOC2zuQ0fLZelsZyospGhLyErtRSjL5WkMKOtNZqnMhqnsqcvNp4psx6qM6qxuCQtNagwNquyuC60uYweLYydraSttjC2OoyeLgwfLowdrg6fLg8frhAgLg+gLo+fr5KhrxOiLxKiL5UjL6iwt5MiL5QjMBOiL5SjMBSjsBUjsDE2OrQ4O5kmMZimMhqnMqwyuJkmMiwzOJ6psx4ps4weLjA1OjO3uzS4O7e6PI0eLZyoMpGgrhSirxWjsI2erZIhrw2frZ0oMg4erQ4erY8frY6erY6fLbk7PRclMSErtJSirpimMZAfrbY5vDs8vhglsZelMK+1ObI2urY5PDo8Pbk7vba5vL0+Pz4+vxeksJ4pMzA1Obc6PJ0osr2+vxmmshsnshGhLpIhLhglMJelMZIhLpglMRMhrpCgrpilsJilsRmmMS80uTW4u4yerY2eLRGgrqGrtJEgrg0erZEhLo0erQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gCLCRxI8JGZBAgTJnxEsKHDgVASgFBIMYGYBGcePjRgsSJCOI4aUQygcaAChVMiREk45cGDCBTFmCnZ62JCHhIkQEBox+WeimOIPVRgM2GKnCkQanJpBaECHq5EjplJcMCYBMLUJLyVkweiBD9cOkpwAceJEzwSkhyIENGKCHQSZsk55cIRl2kSpDh74pJCiBchRBjcQuSInJfUuBxywQ1fHxSpKhwxWGUaNTkltHzAY42Gs0NEUizWgSKcynwg8JGwApGVCFOKnKWSN4GCCnUSeDhwkOIt1IhEJ4xwYsMtAo58kMlhQ2tCNZ/WYLiQQA2fCHM8JqjgZg+JHODB/o9QqOTUKUuEdmypslN7Ah7hwXvBIvrChUPm85uH5V4v+BkS1HESQmNkcAEHvJii3ylr9KfAHngIl1CBZDHQwCJC0LDLF9T1twUwQCwACwEdUqgQBggIgQIB/alhxIsv9gADDglclZACOCBBSiedSNAfBD3ACCMMHVVXQyk8JqlChxUpsMAbCwBBxQ0vHqGQBEnyGMoEsugwIEVDPGGELR1K4oZoj4gxxSidcBLDIgzEwckhTGCgUCQKdPHEE4B8wqRuAhSD0Ce4FECdIoUccsgTstxQBAElEHJDFU7s+YQDLCYk0BkTJUQJKIoaEgsSeujBAiFllKGIInJYasFJpRn0wtaNRCi6ygIEhFLqJjKkylgaMFhaAUIEcYSQBYoewgoGsJSaBwa1pOqHnQpQ8MQVJ7XRkBlXNaEoEwwkkEupRGDQSBipVpHQmR4o8BAxY0iiggyZJlFqCdRZkKoFTHqARklmXMTkDaU6gFAcqYLBpLslFROARAlpUaq6CMnQxAIXZJCAtg0PdJAHCUiywCdfIgSyrB07dABCYnxgwss2BVpSQAAh+QQBBQDMACwAAAAAIAAgAIcAAAA4cKgqfr4ucrg0eLI0drIyfrI6dLA2eLIyeLY0eLReksIwdLA0drB4ps5EgrhsnsiErtR+qtCIsNJSir4weLYwdrSGrtCMstQweLQydrYwdrYydrQydrIwdrIydrBYkMIydLYydLCOtNaQttZckMCStNRcksSSuNheksCUttRclMSYutiYutqavNqcvNpynsaewNx0osygwNygwN6iwNx2osqoxN50pMx0pM54psysxt6ErtKsyOKwyuCIsNSSttaWuNikwtyoxuC60OS2zuKKstK60uY0fLZkmMZ6ps5IhrxqnMqAqtJYkMBakMJcksKUttZunspyos6iwtyyzOKWutimwt640Oa40OSKstS+1OaMstIwfLoyeLQwdrgyeLjI2uwydro8frhAgLhCgLg+gLpAgLpCgro+fr5QirxKiL5OiL5Oir5Qir5OisBSjsJQisBYkMRYksSkxN5UjsJomshwoMrK3OxqnMhonMpyoszW5PAweLh8qNCwyuKCrNLG2OrQ4O7c6PKErNI0eLZGgrhSjMBakMA6fLZKhrw6fLg2erbk7PRakL44erLG2uo4erTI2upglsZmmshonMg+frY8fLhSjL5kmMhAfrbU4u5glMSCrNCCqtDU4vDW4u5elMTq8PZunsh0oMZyoMhGgrpimMZomsZglsRglMLA1ujQ4Ozg7PTw9vpGhLxklsRIhLjg6vLu9PjC1uj4+vxwnshynshkmMRKhLrs8vj+/v5elMZmmMRQiLpEgrrO3uxWjsAyerY2frY2eLREhLw8fLZEhLo0erQ0erY4erY4fLYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gCZCRxIcBiYBAgTJhxGsKHDgUgSWFBIMUGFBF0ePjRgsSLCJa8YUQygcaAChcVWzEmIxoGDSRQrgCkpjGImJkzMIIzjEiZFDcgenqRYBycchCdcHk2gIEkSkRpmEhyAMNGToWdwUiqUQI/LVwk4JIkQIUlCkgMRKgi0awcxhDeZoOGQw+WiBMHIRgChEOLFJLsCSyKT4A1OOYlc5kiwRC8TilITIigSeFcrNWNwMinm0g6ZJmRliKTITIzCDyoqu+p1gkmdQnAmvcJBVsLdBATYrEmw4cBBhQxI1QosqsDQhJMiACrT4YEdDChQjFE4ZgGZDhw6OBK1iwUHj22W/qSKEL38UoQ+XLkaRISFjRK2jlesVD76D0qjM3Dgo76/q1mGeJRQHdGNIMUax2mg3wWCzOKfK4QJyNQkh4ymkIJhdVCALzCoUMQL30mYgAxNQACCKQSEqMFFCnHwSCkYICDiGDTUWGMMI5ilgUIEwHLFII00IoWIZMRgo40jdJTAGFFsEuSTJEioAAiKgACBBCjU6IBCdzwZJC2dLGCHfAnJ0MMMuXhR1RqjDVOBKa00IogJajCAiSB8YBBiVQTU0EMPQ5SwJ28CMIPQApwU8N0DYfDBxx8LsOAAAT8cYQUFdPzZgxQE9MVMFxMllAgWjuIRixBhhAHCEaw+8IsLrJoCclIGwqSVkAI1OPoJIgWskqomJLBqgxeJYKBpGwgRxBFCPDjKRykcmJLqFh2EwuoNHTClRA8/nJRGQ2Ds2IKjGGTLSapCcMBIFaxSgFAhSzCigQIPIaMBIyQAUQBCSqQ6wXc8sArIhV+UBMZFewaR6pAJHMLqEHvSWxIzAUiUkMJhuIsQCSw8kUAGCXw78UAHbZCAMk8sQKbJtY7s0AEIVcCBBjSzWGhJAQEAIfkEAQUAxgAsAAAAACAAIACHAAAAOHCoKn6+LnK4Mn6yNHayMni2OnSwNniyMnq2XJDAMHSwNHawcqDIfKrQQIC6ZprGdKLMfqrQfqjOhq7QToi8MHi2MHa0hrDShrDUiLDSMHi0Vo6+iLDUirLUMHa2Mna0MnayMHayMnawirLWjLLUMnS2MnSwkLTWVpDAkLbWWJDAkrbWWJDCWpC+WpDAWpDCWJLElLbWWpLClLjWlLjYmLrYmLramLzamrzaaprGoL7abJ7Kbp7Gbp7Ibp7KcJ7GcKDKosLefKjOpMTepsTcsMrifKjQgqzQhq7SjLLWnLzaoMDcqsbgsszkgqzShKzQsMzits7kjrLSkLTUNnq2YJbGcKDMQoK8ZJrIdqTOgKzShK7UTIrAMHy6Mni0WI7AMna2bJ7IeqjQqsbenL7csMrgwNbovNLkNn62MHa4wtboMni4Mna6Ony4PHy4PH64Pn64QIC4PoC6SIa8Pn6+nsDcwNToTIi+UIzAVI7CUozAzt7sZJjGZJjIaJrIttDmytrqzt7uuNDmMHi4eKbQ1uTw3OjyNHi0cqDKRIK6UIi6WI6+OHy2RoS8TorAPn62OHy4Soa8NHi2Nni0Onq0yNzs4uz0zNzsOny22uby6PD2YpbEYpjGYpjI5u727vT4WpLEgKrQToq8XpLCXJLCXJLAdKTOyNrq2ubw9vj8bJzIRoK4ZpjEXJLEapzIToi6SIS6XpTERIK4XpTGXJTEQoK6QIK6ZJbEeqbOVo7AdqTMUIy+UIq+Toq+Uoq8NHy2NHq0NHq2RoS6QoK4OHq2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP4AjQkcSDANGwMIEyZMQ7Chw4HADFxQSNGABQNeHj4kYLEiQkdYqlAMoHEgIoVYYuhJiOXKlVAULbApmeBiQitZssxBiMclTIphgj1EZDNhnpx5ELZw+QghIiuyRIaZSXBAGANuVnxBGCenJ4SdXGIxAMKKAwdWEpIciLDKGVVFKCHEmQULCB4u3RjIc9bByoQQL3JSRXgNJANdcurJ5JKHATp9+1CkmpCSGcKqNFVwk7OuSytxxpzlIZKisTYKR1DBvAlXiyx5JuUJpejHWS16DSDCQ8fAhwMHFS4AAorwpQInFYZyMOZBCEUQuJAgkRshnFJxQIAI4eKSKhogPP52cSTLwfTzSRM22bTJkBQZDRT4SO6xz/npT6yU3gCCD/v/7CniUUJ7TJfBK70lFAZ/SATyCYCbyDFgW67wQp+CG5AVAgOLAIGCETaEN6EBPxzxRwqKFCBiGEUhBEIlPWCAwIhw4GCjjTd0kNZVCSHCyQ6GHHKIYxPGccONN3bQkQFvoICJkFCWMGIKkqQAwRhK2BiBQjxAKSQaE5DSylYVBUFEDnSQ2QgdpaVhgSKaHBLIFIuE8IslgmggIkKNIJIDEUQIscKevglgDEIKkMJAeIqcIYggTSigQgSIPOGEChWUASgROhAqkBcTJdSIEY+uwQoTZ5zBgROsKqJIDaybTnDSBgmw1eMSj2KyQgGDpAqJB6wm8oUbGGyKB0IEcYSQKI8K0gMIjZ4BSAgwsCpECAZUoQURT0xiQB0NsXFVDY9SgC0pqS4BQhVNsDoKQpOw+QEiDwUTRhUllFAAQrukSgFCErAqgUIfqFESGxftqUKqOiCUh7V70luSMQFIlBALqVaQkAcsrGBAhuBOPNBBHxjQyAozkJlQybWK7NABCFkAggk022RoSQEBACH5BAEFANEALAAAAAAgACAAhwAAADhwqCp+vi5yuDJ+sjR2tDJ4tjp0sDZ4sjJ6tlqSwjh6sjB0sDR2sHimzIKs0kKAuGicynqmzIKu0k6IvISs0ISu0jB4tjB2tIqw0jB4tFSOwDB2tjJ2tDJ2sjB2sjJ2sIqy1Iyw0jJ0tjJ0sIyy0oyy1Iy01o601FiOvI601liOwJC01FiQwJC22FiQwpK21lqQwFqQwpi62pq82py+3GqcxqLA3G6cxm6eynCeyHKgynCizKjG4HKiynKizHSkzH6q0KrG4IKs0KrI4KzG3rjQ5Iau0oqw1Ja62Jq61qjE3K7K4rjQ5oiw0jZ6tmSYxnSkzkKCvH6qzk6KwDB8ujJ4tFSOwjJ2tlaOwpK42GqcyKTC3G6eyICq0qzI3pi82qTC3rDM4rrQ5jJ4uDB2uDp8uMTY6jJ2ujx+uD5+uECAuD6AukCAuj5+vkiGvEqGvEyGvEqIvlSMwEyIvlKOwqjE3sba6miayMzc7LbO5NTi8DB4uHakznyo0HimzsDW6NLi7trm8H6o0ODq9MTY6DR4tESCuk6IvlaOvliOvqLC3Dh6tkaEvFKMwD5+tjx8uDR4tjR6tjZ4tDZ6tDh6tFyUxGaayGSYyDh8tjp8tlKMvuLs9O70+FySxICq0FySwlqSxHqmzmycxm6exmCWxmSayGCUwF6SwrzS5s7e7sLW6N7o8tzo8uzy+Oju9vT4/Pz8/kiEuvb6/GSWxGKUwESAuESEvF6UxmKYxk6IutLg7kKCuM7e7GCUxGaYxuTs9Hyoztrm8lCIulaOwE6KvlCKvDR8tjh8uEaCuFSMvjR6tEKCumCWxESEukSCuDZ+tgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+AKMJHEgQGhkDCBMmhEawocOBxwxgUEjRwAUDVR4+JGARYYcOCm9JeUIxgMaBhhJ22JEnlRWEbCJEuELxApmTCS4iZAAsVixUCN/IpEkRC6WHhnR6/OJzCcIrMukgNGRJAUksNwkOwGKA0YqXBmr57DTJgCWZUgx0UBAliqWEJgcifDKm042yIDj51GHlkkxkBqi0jVJHIcSLvjopTqWmgxKfRhjJxGSg0eBSFLMmnFREcadAFIb5nGVLpqU0PNpGIEkxGhqFHkp4JnTqDiw7BeRcaYOnbQ4zU+G8McDhwEHYOF4pFtSgEsiEL6L8aAyhVJAJD4AnTNOisQEPKVr+dWLxnOKbQwr6TFi/nopCLoQIqWLCQoeiLSkrIizFfr0oS6xp0MEd8RVICCuH6JcQFesFAcVwCWEhYBCrsGIgIWsoOJUCFLCmkIQIedCALjiIIAQM5Sm4BRBQbHCIIc9hoZRHC+BQAQIaGmCGCzzyqIIXb3GVkCG+0KDKHntskaMaKvTYoxcd6RjCGUhW6UQBGm4giyNQ/GABjzkotEWVSOohgQJQqFiDFm+A9cQbrEFzATOB7HFGBhR4YAwgdzyQIiOGaFFDDTRskCIHAkSDkAKgNADSIU3ccQcXK4TggyFB9BACBUkMWsMvWCYkUBUTJcSIEJKmkswMTTSxQQ+vRBDBCzMnePoHSRokIFdCBSQh6RmJFCBGq49YEGuYZjzgKRwIEcQRQn5IeocNHUDaBBMevBArDVg+8UMNQURigBsNkcEVCpJWAJICrc7QwRNhxEoBQpE08gQHhjxECRZPHJFBqD+0+glCosTqgEIclHESGReVF0KrvyCEyLbl5XtSNAFIlJAJrc6LkAUmbGCABuNeTNBBHHSVxQtgJZSyriY7dABCFxQwws06JXpSQAAh+QQBBQDIACwAAAAAIAAgAIcAAAA4cKgqfr4ucrg0eLI0drQyfrI6dLA2eLIyeLYyerZakMAwdLA0drBwnsh+qtBAgrpmmsZ6qNCGsNSGrtKIsNRQir4weLYwdrSIrtAweLSKsNKIrtIydrYwdrYydrQydrIwdrIydrBWjr6OtNYydLYydLBWjsCSttZYjr5YjsBWkMJYkMBYkMJYkMRYksSSuNiUuNiUutqWuNagwN5snsxunshuoMqiwtyiwt6kwtyqxuB+qM5+qs6uyuKwzOKMstaQttacvtqiwNqmxN60zOK60ua0zuS+1OYyeLhimMh4ps6ErNBEhLxomshSjMCMstRUjsKcvNpunsqmxNx8qNCOstSevtqoxOCwzOS80ua2zuS+1OgwfLoyeLQwdrg4fLgydro+frhAgLhCgLg+gLrA1ug+fr5KhrxMhrxKhr6evtxKiL5MiL5OisBUjsDK3OxSjsJkmshqnsqCrNCErtLM3OxsnsrS4u4weLh6ps660OZ8ps56qM54ptB2pMzY5vDG2urW5PDa5vB0osxyosymwtzm7vY0eLREgrpWjLyWuNg4erZIhrxUjMA8frjK3Oo2eLQ2erZelMKKsNRkmsY4erRSir46fLY6erQ+fLZaksR0pM5cksJeksA+frbg6vLs8vj0+PrC1ujU5PDc6PLu9PjG2OpmmshsnMRGhLxqnMhGgrpilsRelMRglMBeksJqmsZomsZglsZGhLpMhrpCgrpCgrjU4u5UjL5QjMB2ps5kmMRSjL5OiLpCgrw2frY6fLjc5vA0erY0fLY0erRqnMpsnMYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gCRCRxIEFiSBAgTJgRGsKHDgcQSYFBIMcGFBF0ePjRgEeGHDwqbQJBEMYDGgYgSfnAQaIsXhGXkyFlB8UKSkwouImRQSpSoTggbyYxSsUOxh4h0eiTiEwfCJzLZJFyxYliCDjcJDuiQgNGJhK98HoqUYJNMCAhX1KhBE6HJgQgRHTkkhECCBj1F2fCiRCaYBGzW1nCjEOLFSYcSb/n0YYbPIoxkKklgS/ALilkTIiCS+BCcNL58mkok08WjOWuVkKSILIxCEBk6D/I0KpSOAmyijFGy1snfBIgaNUng4cDB16lAJcZDgBHIhE/WivkAYRMnCRJ+I3zEYnqCDyNw/h2C8pyiqkQrbmBfr0bhFUCAAu3YYCOFk5QVEW5aj71Qi9UafGAGfATCl0h+CbWB3RKuDJdQBwHyYYQgBQIiBoJxnYAGfgpB6FEDtcTCAREkYJhQBDfMYoEtHHaglEeZxPKAXRgGU8GNN04gQQtXKYTIJIsEYocdEZgoxgQ44ihBRwlgMgESQ0ZZh4lPqGKBKzc8cKMTCjkR5ZA+/DFCKwg6IQMQtCQERhO/AXMBBHDYoQUFtYBggRFcPFBeAmAgAoQMMsDwxJ4eCIAMQiosAAJIZGTBBRdrnDDBDYhIQEMdaJAAqAyt7ClQFxMlxAgOjx7BCgo//HAJDTnkQAYEpxNsSkhKGigAV0JeoPCoFiMQsEOqmjzQ6ipdSbApGggRxBFCSzzKhSwfkJEqFgSc0GoMdiEyhQxLIHRGQ0lwRcmjeibQQqoofICIEK0ii1ATknSAyEPFdCAJHUzQeEOqeiD0R6t/dPjFSUlcVN4EqfKCUBvXljfvScgEIFFCCP+QRkIPTPBEAhok8C3EAx3kAZ9vfEXRyLaC7NABCF1QQAcw62ToSQEBACH5BAEFAM8ALAAAAAAgACAAhwAAADhwqCp+vi5yuDR4sjR2sjJ+sjp0sDJ4tjR4tFyQwDJ0rnKizICqzkCAumSayHakzICq0oCq0ICs0E6Kvoas0DB4tjB2tIaw1Iiw0jB4tIqw1DJ2tjB2tjJ2tDJ2sjB2slSMwIqy1Iqy1oyy1DJ0tjJ0sDB0sFaOvoyy1oy01o6y1FaOwpi82liOwFaQwlqQwlqSwpq83GiaxJ6+2mqcxqLA2mqcyGqcymyeyGyeym6eym6gynCgyHCgynCizKjE3HKiynqmzn6qzqjE3qjG4KrG4ISszoau0pi62Jq82qDA3KLC3LLM4rLK4rTM4oSs0ISu0jR8tmaYxnSizH6q0kSEvHSkzoKs0lCKwISu1FSOwlaOwJC01mqaxqDA2micyK7K4KDA3qLC3rLM5LTO5LbO5DB8ujJ4tDB2uLrQ5Dp8tjZ+tjx+tj5+tjJ4uDJ2ujh8uDp8uDx+uD5+uD6AuECAuD5+vsLY6kqGvEqIvlCMwEyIvlKMwMTY6M7e7mSYyGiayGicynSkzMDU6Mzc7NDg7n6q0DB4uHakztLi7qzI4N7o8sDW6JS42DR4tkaCuFSMvFSOwDZ6tkiEvFSMvjx8tk6IvDh6tJy+3Dh6tsze7JK01Dp6tt7q8uzy+F6UxGKYyGiYxtjk8Orw9u70+FqSxL7U6Mzc6tbk8Obu9vj6/FySwl6SwHqmzHikzGqaxGaWwmCUwl6SwkqGukaGvGCWxmSYxEKCukiGvGCWxEKCuMja6kyGumSYxmaYxFCKvk6KvNTi7kiEtkSCuFCMvlKKvjJ6trrS5jZ4skSCujh8tkSEujR6tjR6tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+AJ8JHEiQzRsECBMmZEOwocOBUhBcUEgRgQUEZx4+NGARoQcPCQn0qLGGYgCNAxMk9JCjUROVCGStWvWEooU3KI9dRPgh1adPMBBWmNmkIgdnDxPs9GjjJw0EHoDMXJGwz55mCDjgJDiAA4I1IRK2+ukp2YdCM2sgzPLgQZ+EJwciTBCGURKVJnx+qrGg1ExICHK1faBHIcSLrBgpbuLGA6efYYbN/ETAwWAWFLcmTGZDMSM/eXr9VBVrJq81g009qvgMjsIPFTwrUoBM1ZJkJJqIMtXWVpy5VnAh6HDg4OsZoxQXIoAJJFQPFNrOQeDghQ4GDH4nXMOiDUgPkQr+McpQEaEVB3twYF9fS6ESQ4YIMclQA8UUmOVfrMeOY8skhBp4oAZ8BBryh3DlIZQHdjzEgCBCHAT4yhN/FGgIHQki9EgWueCXUIQeEdDLDFAssUGGCdlygykUOIAfB0t5hMkUQhCA4hoR5KjjFZh5lVACrHRxCh54+ILiHDomeUVHCMgRhRlERikBihRYQYEpYCSS4wMKPRAlkUQE4QIoCT6gAgZWJDQJLv8hwIYFDhBZRgO0fHAJGWYI4RxCcSSAgQoqjJDFnsMJ8AxCXLhQAEgOGGGGGS2EMMENCVzRggR5/AkoKIQKdMZE22Xy6CLEkFBEERS0IIMMdjgQAaCoKuywmgbHyPUjCY+WYQwBY5zahhCrTvFVIrC2hwBBHCFExaNmTOGBA6eKQcAWq6qgUgJgqMAAQnc09IZXSDyqJwIsnCqCB5M4smoeCbHJQQIPOcPBJBI0YCMCN5wKAUIMrOqDQhykgdIbF+0Zwam6IKTHqinsCS9KzwQgUUJYnMouQkJEsAcCGiDQLcQDHdQBAnHsERZFI9cKskMHIGSBBxzEvJOhKAUEACH5BAEFANIALAAAAAAgACAAhwAAADhwqCp+vi5yuDJ+sjR2sjJ4tjp0sDR4sjJ6tmCUwjJ0rjR2sHimzkCAumqcyoKs0nqmzoau0k6KvoSu1Iyy0jB4tjJ4sjB4tDJ2tjJ2tDB2tDJ2sjB2sjJ2sFSMvpC21jJ0tjJ0sFiQwJC22FiQwpK42FqQwFqQwlySwJS21lySwlySxF6Swl6Uwpq82py82G6eyJy82p6+2m6eyqDA3nCgyqLA3HCgzHKiyqjG3nSiynSizHakzHamzoCqzqrE3ICq0KrG3oKszqzG3oKs0KzI4KzI4q7I4Iiuzoyy1pi62KTC3qjG4LTM5LDK4Iiw0rjO4oqw0pC01DZ6tmaYxnim0ESEvISu0nyozoau1FKMvoqy1DB8ujJ4tDB2uDB2tlSOwFaQwpa62Gyeym6gyqTC3H6q0K7K4oaw1Ji62qjE3rbO5LjQ5LjQ5jJ4uDh8uDJ2urrQ5j6AuECAuD5+vkqIvLrS5r7S5kyIvlCMwMba6k6IvlSOwlKMwGicysja7Mrc7Nbk8DB4uHyo0MTY6tDg7t7o8n6q0q7I4jR4tEKCulKKvFaOvjh6tkiGvDZ+tj5+uEyGvDR4tjZ4tOTs9Dx8tjh6tMbY6Dh8tjp8tmCWxpS42GSayKLC3mSYyNLg7tbi7mKWxGCWxFCKvFCKul6UxHyq0ESCuOju9nqozkSEukaCuMTY6M7e7N7q8vD2+kqIvmSWxGiayGSWwl6UxkiEuOjw9vT2+v7+/kyGukqEuvz+/kaEvEqGumKYxmKWxmSYxGaYxGiYxEKAuPb4/ECCumqcyH6ozsDU5liOvlCKvjR8tjR6tDZ6tGaaxkaGvDR6tgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+AKUJHEgQ0hsDCBMmhESwocOBzAxsUEjRgAUDXR4+JGCxooECMapoohhA40BFCTUck2MkYQtYsJ5UfGMywUWEHAxVqjQC4RCYRFJqQNjsoaKbCDXA2PnCwAUzMKUgRPBEhyOENAkOyGDA0ZaEKXYKosQBE8wqBjwAyZVLJsKSAxFS0SFIBcoCrnYOW5AKJisOSdjmAqEQ4kUUghILseSlwk4dtmBW8jBMcBQECrMmpCQjsSA8u3TtfCULZjJGuNiCukpRWhyFHH54DnSCzaEXl6AgkSWI7S1UCL1cWWTgy4GDCjUIM5S4UAHWBjRwuJGrmDINc/x0evCAikJNYSz+XXDKaI8gCR4R7FAwYRP391cUjgEEqM2MIsI+iELp0Yue99x1ood3BmCggRP0JQjIHsR5hNAj3P0hRoMIZWAgD2jsoSAgcziI0CQT9EKgQhYmVYAuVQTxAnoeIsRCJyXk4QB/BmSAVHCOyNIDjR7B0cCPQJKhR40KUVGCEmzccccvLVoC5JNkdGQAHGegoeSVWXgI4iJ2lPAJDj9uotAmVyp5gw0frODgJhScQSEVixAIiQUOuHGHEVn4woEkTRzRw1AJUaEIIhRQAMEEFH0hgDQIfdBIAQjR4ckRR4CwRRZVKEIDCQ30EkShFKAAKEICdTFRQo6MQSkTqEhQQw2sE5Bgggl0zGEFqLOghEECcSXkhQSUHkGKBi+8agkPs4oypQ2gxmcAQRwhZEOwomjgwKtqaODHrFoMpcgnFERpQB0NvcFVEJT2MF4Yr0qgARVKzPpIQotMkoEiDzWTARUNRMDfLK/mgBAZs4pb4RcmvXHRqIS86sKDs6ahEL4mSROARAk1XMO8CPEQAaIYjFsxQQd9YQAVevhRkcm8juzQAQhZoEEGNN+0qEkBAQAh+QQBBQDIACwAAAAAIAAgAIcAAAA4cKgqfr4ucrg0eLI0drAyfrI6dLA2eLIyeLY0eLRelMIydK5yoMp8ps4+gLpkmshyosp+qMx8qMx8qtB+qM5+qtCCqtBOiL6GrtIweLYwdrSIrtAweLRSjMCIstSKstQydrYydrQydrIwdrIydrCKstaMstQydLYydLBYjr6UuNhakL5YksRaksJaksRcksBcksKWuNiYutiYvNqcvNpomsakwtxqnMpsnMhunspuoMxwoMp2pMykwt52pM6kxN54pMymxN54ps6oxuCqxt6AqtCEqs6QttagvtqoxN6syOCArNCErtKuyuCuyuKwzOKwzOSyzOI2erZkmMhwoMx6qNBEhLx0osxQir5WjsCOtNZWkMJYkMKavNxmmsiQttiiwt6oxOCyzOS0zOK+1OgwfLoyeLQwdrgwdra+0ubA1ugyeLiUuNY4fLgydro8frg+frg+gLg+fr5GhrxKhrxKhr5SjL6+1OZMiL5MisDA1OZSjsLE2OhQisBUjsLO3u5onMq60ubI2urQ4O640OR0pMwweLjc6PJ4ptA0eLZCgLhQiLpWjL5YkMA4erZIhLo2frY6fLhIhrxOisCQtNaevto2eLQ4erQ8frbM3Oo6fLacvtzg6vLO3uw8fLZglsTW5PDo8Pbs8vhilsJclMRilMJOir5yosxEgrpIgrjG2Or2+Pz0+PpglsZelMRGhLpIhLxmlsJklsJKhLhimMZelMZkmMRglMRAgLhUjMBimMhSirxmmMQyerY0fLY0erREgrhCgro4fLY0erZEhLpAgLpAgroAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gCRCRxIMBKbBAgTJoxEsKHDgb8SbFBIMYGGBGYePjRgsWICBTluSaIYQONABQlF2CAjJCEMUaKKUNTAxqSviwhHDEKESAtCCTBbIhQhIkEIYA8V4Bw6g+eKBCKSwMyAkECRG26M1iQ4IESCRx4SsuBJ6NKIPTBvJShxgxUrmQhLDkSowAcgJCgL7ETUi0EnmKlGHHHL6oRCiBe7AFosBM4ZDjxvqIKJaIQswlJQJtya8JKMxYAK1aHFMxQpmIIYjXKr6VFFZG8UjpAAuo8KJ6FkIMhAhJQnt51SJRT2IAGaAwcVipA1aHEZAphSjrDEapQKEXD8uIIAIWtCSR7g/hQVwasMoAseFTRYYKcU9/dXFCJZswbKjAq37oDS7DHLe+6u6KEIQh0ksAR9CK5RRi4eJXTFex48MCBCIRTYABFlJLgGHA0mlMcV/CVU4VAFQEKKAyug1yFCXNjyxyQP8BfCUgid8QgoEYRYkRtV9NjjDl9QYpRCCmiRwRNjjPHKipLs4KOPX3SUgCRDEJHklT10qEgei9DBRyk49NiCQqBcmWQNOdzRRYMvUPDDIglN8cAUCEWiwQNRjCFEEJCMUEcYQKBC0RQK/EABBVbUQREaAiCDkAe6EIDQA14AAQQIWfxABTE4fIDFFVYcSgEXRSUkkBkTJfQIEpZysogRrTTQkMcHJpggxwOoiAoBSh34MpdCTFjqQxYKrBBrJjrUuuQUOIgaXwIEcYQQDpYCsYAID8QKhgiU1GpBUYqAQkGUCczREBteWWFpA0V5EOu3U2RQKywJGaNICAo8BEwIU2DRg2a1xKoDQl/USi6FaJjEBo0J9BCrCwjR4S2RJgkUgEQJ/RDrJAnpYEgeCRRobsUDHYRGAlNgkEVFJ/tKskMHIKRBCDTPiFCjJgUEACH5BAEFAM0ALAAAAAAgACAAhwAAADhwqCp+vi5yuDR4sjR2sjJ+sjp0sDZ4sjJ4tjR4tGCUwjh6sjJ0rjR2sHikyoKs0ECAumicynymzIiw1E6KvoKu0pC22ISs0DB4tjB2tIiw0jB4tDJ2tjJ2tDJ2sjB2slSOwDJ0tjJ0sFiOvliQwpK01FqQwFiSwpS42FqSwlySwlySxF6Swl6Uwpq62F6UxJq82py82mycxpy+2m6eypy+3J6+2nCeyKDA3G6gyqLA3G6gzHCgynCgzHCizKLC3HKiyqTA2nKiznSiynSkzKTC3KTC3qbC3oCozKbE4KjG4IKq0KrG3oCs0qrG4KrI4KzI4LbO5Iqy1JK21pi62KC+2rTM4rjO5DR8tmiaxnSkzkiEvHqmzoiy1FCKvoSu0laOwFqOvpa62myeyp6+3HyozoCs0LDK4JC01JS21rbQ5o601jB8ujJ4tDB2uDB2tjZ+tpK42LjQ5jJ4uDx8uDJ2urzS6Dx+uD5+uECAuD5+uj6Auj5+vkyIvsba6lCMwFaQwlSOwlKMwFKOwGiayMja6tTi8DB4uHqozn6q0sbY6NTi7tjk8Him0K7I4DR4tnikzHakzEaCuFCKvFaOvjZ6tkqGvFKMvjp8tjx+tuDq9Dh6tDh6tjh8tjx8tmCWxoqw1GaayGSayLDK4uTs9F6UxmKUwnimztzm8O70+Ozy+PL2+sDW6M7e7ubu9vz8/mqcykaEvEiEuEiGvGKWxGKWwvj6/EqGukqIvmKYxmSWwk6IukyGvESCuGaYxE6IvEKCus7e7FSKvGaYxurw9kaEukSCujJ6tjZ4tESEvDR6tjR6tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+AJsJHEgwDp0ECBMmjEOwocOBWRJoUEgxQYYEbR4+NGCxYgIFWmplohhA40AFCT0Qe7Qj4YlNm4xQzEDHJLKLCD20OnQoBMIJMFvm9JCgA7OHCnDmTMEzTQIPL2BCQEjASI5ORWsSHNAhgaUKCUnwNGTpAxaYtRJ8sKJKFZKEJQcihETjzxSUBXYeqjWiEUxfHpK0VUVBIcSLYf4ovqHJDQaeNybBPPRh1+AoKBNqTaiAiuI/pIzh4ulqAcwrlEq1XcSpYjM7Cj9E+nyHRBNXVBBAALLgT9tGvp46mPErwZsDBxV6qNVKsRQCrRNqeKHq1bAGYoSsgnXLmMJMgOr+EPVAScofMx4V4DhlIhWs9++JKJwyZ86TFF1qfXGRuaKHHfC9V4oMIyXAQQJH1KfgHGvo4VFCXbzHChq/EJBQBwfWkIMUC86Bx4MIIUDFAwwQpRCGOREwywKRsIEeiAgNgkIFsuDRXwdKJcRJCzX055ElEgQpJCh+FKWQAiFAoAQUULAAYyZCRglKRwlkUkQOTGYZBIiQcBGBLBWUAEqQgijEQpZMpqDFFyU8WMIWPESQkCV7WIJQHBnksQQUORBhzAdcxGBDDRRZooAPW2wxxCUUvSFAMwh9MYiFCeSRgg02gFFBD6AsI4oTNQSDaKIhmIiQQG1MNCcFmI4RQResF1xwiRMWWIAHHmQkugUMKHGAjFwKmYGpDb0oMEWsmcRSqwpeiaJrMKcOxBFChQy7ggd5xDqFB37U6ghRkKiwxZQJ9NEQHV0VgWkNRFUQKyoeWKJIrbIkFAEkHSjwEDMdWNJDD5nBEGshCOlSqy4nvmESHTkm4EOsbSYgi7dHmiRQABIl9EOs9SIUiw6MHmiuxQMd9IZXfoDVaAK/kuzQAQhl0MHMOCL0qEkBAQAh+QQBBQDMACwAAAAAIAAgAIcAAAA4cKgqfr4ucrgyfrI0drIyeLY6dLA0eLI0eLReksA4erIydLA0drBunsp2pMx8psxAgLpkmshwoMp6qM56qNB+qM6ErtJQirwweLgydrSGrtKIsNQyeLQweLSKsNQydrYwdrYwdrQydrIwdrJYkMCOtNQydLaQtNRYksSSuNhcksKUuNZcksSUuNiUutqWuNaavNpqmsacvNhonMqcvNpqnMievthqnMpsnMhsnsqevtqevtyewNygwNx0osqgwt6iwt50pM6kwt6uyuKAqs6ErtSMstSOtNaautiqxuCwyuKCrNKwzOKyzOKMsta+1OiOstI2erZkmMhsnsx4pMxEhLxwoMx+qs5OisAwfLoweLYydrowdrhWkMJaksSWuthonMh0pMyqxN6YutquyuC60ubA1Og6fLY2frYyeLg4fLg8fLg6frg8frg+frhAfrg+fr5Ihr5MiL7M3OxOiL5Oir5MisBUjMBUjsBSjsJYkMJakMK40ObI2urQ4O54ps5yoszY5vC0zuR+qtB4ptA0eLZGgrhYjrxaksKoxN44erZGhrxQisBKhr5uoMo0erY2eLSYutjc6PI4eLQ4fLY4erTm7vaoxuBglsRSirzU4u7k7vbq8PZilsJQir5clMRelMJglMD0+PpKiLzA1ujS4O7e6vLw9vrG2upyosp2ospGhLpKhrxIhLhomshmmshGhLxIhrpOiLpCgrpmmMZkmMZglsZclMZilMJCgrhilsRimMZelMZAgrpglMTk7PRSjMDe6PJGgrpWjL5UjL5IhrxSjL5EgroyerY0fLY0erQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI/gCZCRxIMI0aAwgTJkxDsKHDgcoMiFBI0UAGA1oePiRgsaKBBLUyoaEYQOPABAk12MJUI2EJQYJ2UMyQwWSyiwg1mKFDBw/CKjBnpNRgAMSyhwlw5jTB84gBDSxgFkFYwEeMRUVrEhwAwoCUOQmJ8SyVQIMTmJkMMJhx6ZKPhCUHIpQCBsoGlAx20snE4A9MWhogtL20QSHEi3mgKI6BpkMRnjEOwaTDwNNgJSgTak2Y4IhiKEpYueLpZwVMIrMmtT2DlSIzLgpHPPg8qNgQPyakWOCh4ExbU7SeFpDhyUCIAwcVaghlRjGRAq1zwrh0ShMDRDc4jUJlRSGaLGiI/naYtQQKII8JcogysWmUe/cTFF5o0iSIiQeZMKzIXFHDjvfuncIYQh0YwAN9CDZBBBweJfSAe52M4Ql/IHhggA0xEJFgE2w0iFAkKPywAFEKVZhTAYes8MMHVXiYUCNeZGGFGxRaSBElK+SAgItSSODjj7jIUZRCCQRDQQ9BBLGHi2v86CQuHRmwxgRkJGllfA0aEssbVmThxS0+6qHQF1YmiUQtdfjkkR5U0PBGQlK4IQVCaWTwBhBBkOEAKyOwosILNFAkhSE0UEEFDrFQFIIAzCCUxScFIPTGEy+8QMgcOrQgxS0VhEFLoYZm4RozWkwE5wWVIgGHEBxwIEsFo7C60YYEhlKRgiEGeJCMXAo9UKkLpBhgRKtoSACrF171UmsECBHEEUJTVPpCCQa80SoTGjgC6xUkekFFC7jG0VAGXU1QqQ1EzdGqEB8JAWt3CLkBCQgJPLQMCFLgkENmLbQqAUKgwApKiVo9RBNFOLSaB0JWbEukSQIFIFFCOrSKTEIS0CCkheJCPNBFIXglhyMVhbyrxw4dgBC5ILSME6MmBQQAIfkEAQUAywAsAAAAACAAIACHAAAAOHCoKn6+LnK4Mn6yNHayMni2OnSwOHiyNHi0YJTCMHSwNHiyNnawNHawdKLKgKrSQoK6ZprGeKLKgqzQiLDSUIzAMHi2MHa0MHi0irDSMna2MHa2Mna0MnayMHayMnawirLWjLLWMnS2MnSwWJDAjLTWkLTUWJDClLbWWpDCXJDAWJLEWpLEXJLAXJLCXpTClrjWlrjYlrrYlrramLrYmLramLzamrrYcJ7ImrramrzYmrzamrzcnLzaosLecKLMeqbOpsTgfKbOqMTefKjQqMbggKrQrMjghq7SiLDUkrbWlLjYnL7apMLcts7ksMziuNDkhrDShrDUOHq2ZJjGcqLMRoa8aJzIdqTMhK7SVI7AMHy6Mni0MHa4VpDCkLbWcqDKsMrikLbYoMDcsszivtTovtTmMni4krbYwtjqOny4Mna6On64PH64Pn64QoC4RIC4QoK4Pn66PoC6QIC6Pn6+Soi+osLcUIq+TorAVo7CxNjq0ODuZJrIbp7IbJ7KbqDMeqTMcKDMdqTOMHi4utDkeKbOzt7s1OLuvNLk3ujyNHi2RoK4UozAOHy2Soi8VI7CNn62TIi+2OTw4OryNnq2OHq03OjyOny2PHy2YJbGZJjIUoy+YpjI7PL4XpTGXpTEdKLMSIa81uTwSIS6ytzq6PD24uz09vr8+Pr8bp7KSoa6aprGapzITIi8YpbEYJbETIa6ZprIRIK4Toi+UIq8YpjGQoK8ZpjEyNrqVoy8aJrIVIy+Mnq2NHy2NHq2Vo6+RoS6RoK6Soa8RIK6NHq0Nnq0RoS8RIS8Nni0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP4AlwkcSFASGgMIEyaURLChw4G/DGBQSNHABQNcHj4kYLGigQRVQlGhGEDjwAQJO2z6ISNhsD59eFC8gMakr4sIO5RRo8YRwgcwZ6REuMHYwwQ4c1bgmcRAhxMwgyAs4EPGyA01CQ7YYIDKpIS9eEZJ0AEJzFAGPMRYtMhHwpIDETJK8wQCSg9QeCrwoAtmhA6C2C6ioBDixS1PEjNx02UIzxRxYPLxoEDwD5QJsyZMUCHxkx+NSvE04wImEVmJ2BoaSXEZG4UFwnhG0qmJGSWWgtRYYYitqQhOC0iAZYDDgYMKO7yAkphIgUsKMZxYRCkPiV04MH06VUzhmklrOv4Y6CLLyJMsHhO0cqGhz6f373MohGDEiI8KVl68UoG5Ygcd8L1HSQqsZWCADfUlaIQQb3iU0APvoeIELP1tYKAETAihoBFuOIgQAxrkgIB4ClmYUwGNqLCKFqJ4OBURZ+wwwS4NLCDeBkklREUJvPTnUSOqBBlkKpRo0AFXm1lACA099ICCi6ykIqSQlHSAExWAjNHklq64GEEeWdSgSCVBQqHQF1s2WQEsd1jgoB5+bNJhBx1o8sIaCElygRs39AAGILR4IEwIJlRBkSXAbOLHosApxIEAyyA0SS2YuaGFCSYcMsosKFjSAhCb0OHJon7c0doyXEyUkCVFYKrEG6+BQADBFUBYYcUaa4BCaiQIZeBLXAoBgakIoxhQhKyPgGLrFgZYwgKpcyBEEEcIbYKpCcy6IWsQHVxhKxYkWuDHF4wYYEdDaHAFCKZViHeHrIAYwEggtjZqQBsGbJDAQ8ZsYMksEmCGgqybIISCrU8mtIEXJqGRowGzyOqTAbh8q9C+Ji0TgEQJRQyBvaB4gowBBp6b8UAHcdDsFcVSpPKvJzt0AEIXbGAzjghBalJAADs=)!important;background-color:#337ab7;border-color:#2e6da4}#toasty .toast.toasty-theme-bootstrap.toasty-type-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkQyQUI3Q0EzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkQyQUI3Q0IzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0QTNBMDVFQjMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0QTNBMDVFQzMyMkExMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po9jTrYAAAKTSURBVHja7Jq/SyNBFMfNuSYB0cbCUzmtTvwbbPwb7KPV/Rmnu5tYWR1XX6WFpYL2giBW/igUFCxEuMJeZMXg3Bt4kcmwiftm3kuG5R58mc0G3ptPZnfmzZtUlFIjZbBKWUC+CPqOQA3QLSjDtoH3+U2PiIBqoE2Vb5v4PWtMCYh6HwgTph4yiO5coopZwgnDCVElQJgw1ZBAIgcIEyYKBSRVfpaGAJIoHkuGCZIqXkuHAdIEvTODvKPfgYG0QG9Kxt7QvziIDvKqZO2VCuMCkRE7dQPawZZiGQWGOjtRIf6AZkCT2KZEH1nR2YwCQX2crkDfcpLJY4fHLPEFifBXbDs854c9fG45TBRt7EfkAqJzoNjjhT0CVXL87nn4jHvlZv2y2Nhz5jnH98L0Owo68fQb52XNvql4P3sArVi+F0HXTOlMvR9IjWEkOvYM+mH5XwU9MfmPzZ2mPexcEB3btkB+Mqc1Mfa7C6QhsELvg8aMGL8FYuh+d1VRNgRqG1OgSbyugeYFYmzY5aAFgSAa4iteVw0oTluwQR6FQKrGiEwIxHi0K41roB3mIC+gM9Bf0AxoGTTOHGMdtMtVQBiWfRQuJNcRaeu5jnCv7GbCd++YeDqv7NwwB6DvoGlsDyQgimS/PjA6p1qyfC555loJNfvl2I+c5vxydbzv8ng670fs+hV1h3gJmrX8zOF96g7x03oXtRhH2W+/4Myi349xbLeJo5sVLdoNoopyAfqFbRBVlFLVtcwCQlsIoo3+B1b7bQnVflvqfzU+DBivwx6uE6umJ0RTBXSGmHqMRDBniJ3cLHWACOpU18ylUgJEkOfspfrnQ5GdZtfOLnSQESzM6eLZHaYcd/h5TCJeaf6v9U+AAQAvyHBRYhRQ4wAAAABJRU5ErkJggg==)!important;background-color:#d9534f;border-color:#d43f3a}#toasty .toast.toasty-theme-bootstrap.toasty-type-success{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkQyQUI3Q0UzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkQyQUI3Q0YzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRDJBQjdDQzMyMkIxMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoyRDJBQjdDRDMyMkIxMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvQVuMwAAAORSURBVHja7JpNaBNBFMebNsZacih+FFFsrB4qVIw9lByEWNtCC/VSRS14UjSx1V4UvbUKFaFUD178OniPB28KgsYeFBVqRFDQgx9paE1bNVKKta3N+h94hTWZ3ezOTiYh9MEPwmZ39v2TmTdv3oxL07SyUjDXipBsW0NsA37gAx7gpe9nwQKIg7fgM5gjCi6EOboZNIEDoFPneC5jwh6A++Al+AYWVQtxg3pwBPSBaoc/6Di4Q6I+gL8qhGwBx0EvqJHc1afADXAXJGw9yYTYoBVEtfxblN5l2Tc7InrApKbO2LtCMoV4wGUwr6m3OTAAVjsV4iIRS1rhLA36nQo5Rb9KoW0WnDTz1SxqtYB7YF2RTN4/wSEQtRO1asGIVnw2Qr5l+VzO0VYBjoFgEaZUQZqEXVYmxAbwGGxU5Nw8eEqT6y7KGswsCdrAe7Ou5QaDirvLVYqO5fR5ysIzl8hXw6i1FUwrFDEK6jJ86AAzOZ6LA5+REPardCsU8QO0cwZuBfhq4flu8jlrsLO1RJfCgcsSw0ec6+doLZPLusjnrDHiBSlF/8YbgzDqB78stpEin7O6VpMiEWwwt3BEsMH7zGZbAV7X8ivoTmype9Ngdr4A9thsr275g16IT4GQGLjGuc4EnBZor54nxKMgVzoLZjjr/kGwSaDNKp4Qr6CDabCU4x5WVLgOXnC+uwKaBd/t5QkRsRQ4Q10jZnLfKBjmXN8PjvJyJ9umixpDAhNaT0bojHHuY+G0kROlaiRk2EO88Gsnx1oEfRzndoPXGfeGDULtsIRQfpEn5ISNBtj6/aDBWqaRcihmD/VphI52i8mhlTTF8YSYAEETMUxEg0GXei5pcg3whIikKOOg2UBMZR67lGmKUgUiAg2OgX0W608dVEiQYRHyWWoaH7cgZj34KDFn+y+N5y2svgs2nDBIBpfXGLckijBdWMlY6hqNGdalFiQKybnUZewESQcvmQB7de1Vgy8SRSTJx5yVRjcpTjt4GetmvaBTcn2M+XSeNzeVTIHOrGTaSiXTtUVUMj0Mnohs9IQkxn2nReyQ0/2RfofjpSi2Fcpok2WgQNsL0jZ69IQlZax2qi3hfOwhMtoURbMRepdl30S2p2t129MbJEemaVoSR8CYqgMDO+i0Q1iwAqK3CXCbDgy8K8QRjlUkIuDwCMcrEqP8CIdRjakSbLd4qOYT+AN+rxxzKkUh/wQYAIxbfwhIUivlAAAAAElFTkSuQmCC)!important;background-color:#5cb85c;border-color:#4cae4c}#toasty .toast.toasty-theme-bootstrap.toasty-type-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NTc3MiwgMjAxNC8wMS8xMy0xOTo0NDowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkQyQUI3RDIzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkQyQUI3RDMzMjJCMTFFNUI4QjZEQkFEN0Q5RUExNzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRDJBQjdEMDMyMkIxMUU1QjhCNkRCQUQ3RDlFQTE3MCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoyRDJBQjdEMTMyMkIxMUU1QjhCNkRCQUQ3RDlFQTE3MCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PhxHKhwAAAN7SURBVHja7JrfS1RBFMf37q7mj6SySMWMMqnQLEsKMg2yH4SC2g+wrKcIg7SX3ouiP6BfEFRPEdRLFFlBIEVQvfcgFrJBLxFBEWG9mHb7Hjgrl+vMzr13Zuyu+IUP7M7Pc+7MnJm5u47ruom5oGRijmjOOJK22PYScBrs5u8vwA3ww0ZnjqU1sgg8Ba2+9NegE4znw9QqBg8FTpDawF0uE3tHBkFLjvz9XCbWU2sZT5/1inIfeHS+xXVELoK6AOXquGwsp9ZGcDhgJExz2U1xc6QEXADLQ9ShsudMbQGmHDkE9kSoR3tMd1wcoSd7CpRFqLsYnA05ktYcOQGac+T/ZmTawm381/BL0ecR2CDI+wyug4/8fQ04A6oFZUfAAZCJbAk5osFVMOmK1SMo3yMpS21c07FFx4m94LvEsFcgLahDaS8ldb6AnVHtibpGaGGfBOWS/PuyqQyeSPIqNYJGZEeO8ClWJnIwJdkIq3LU6+a2Z8WRGtAHSnOUWQcKBOkphSOl3HbNbDjSpzjdkupBoSCd0tYq6rZwH1aj1jaQcdWaAJWC+hWcp1KG+7Ky2OlpHgW1AcrStFohuTkWBKhfy30V2phaHWCAI08QrfK1T58bg27UoB+0m3akhsNtQQjH23xPlCJWU8gT9WDQhZ8M+HT2KcKtSKt97ac4LYw6ue+kCUfqeUqFVa3vrpHmy1dYDXA413KEptIxsDmCAQ2+TTElCQAqUd8HlRcwRVhrA+NudFV72irXaOcX2xIp/JbxsC7UOOZnFzyN7EqNdkrZlrKwr0xpGuwCvZr3nQ7PvtOo2RbZcg88A1NBL1YV4HnIcDkbescv+L4GGRGHb2smnHgDPnk2yFbN9prYttszRkWwcBr4kqOry6DK0y59vmmgXbKtTnVDdAx1NgKKBQ9pAefp6ooqam0Hxw1MqTvgjyB9ivN01e+/SngdoVf9l/iMo6u05HDpGHqzmLW12O+Iw9fMdkPRpVdy1U0ZCOlZtbPNjnexl4BR16xu8ZrI9rGU00xqlG2f3ke6wGMLcf8teM9PjQ6MWy30QaMylJ2vzZY2sB2MTZHtQ9k1UpTIXxV5F/tYHjsy5nXkARjOQyeG2fZpR35yWDyfsPAbuAWNs629bPuM02+a7w+F/DMAnYL/xsT4JJ966WeKCWZSdYzPO83/O2jeEUv6J8AAuUNANq3q2uMAAAAASUVORK5CYII=)!important;background-color:#f0ad4e;border-color:#eea236}@-webkit-keyframes toasty-shake{0%{-webkit-transform:translate(2px,1px) rotate(0);transform:translate(2px,1px) rotate(0)}10%{-webkit-transform:translate(-1px,-2px) rotate(-1deg);transform:translate(-1px,-2px) rotate(-1deg)}20%{-webkit-transform:translate(-3px,0) rotate(1deg);transform:translate(-3px,0) rotate(1deg)}30%{-webkit-transform:translate(0,2px) rotate(0);transform:translate(0,2px) rotate(0)}40%{-webkit-transform:translate(1px,-1px) rotate(1deg);transform:translate(1px,-1px) rotate(1deg)}50%{-webkit-transform:translate(-1px,2px) rotate(-1deg);transform:translate(-1px,2px) rotate(-1deg)}60%{-webkit-transform:translate(-3px,1px) rotate(0);transform:translate(-3px,1px) rotate(0)}70%{-webkit-transform:translate(2px,1px) rotate(-1deg);transform:translate(2px,1px) rotate(-1deg)}80%{-webkit-transform:translate(-1px,-1px) rotate(1deg);transform:translate(-1px,-1px) rotate(1deg)}90%{-webkit-transform:translate(2px,2px) rotate(0);transform:translate(2px,2px) rotate(0)}100%{-webkit-transform:translate(1px,-2px) rotate(-1deg);transform:translate(1px,-2px) rotate(-1deg)}}@keyframes toasty-shake{0%{-webkit-transform:translate(2px,1px) rotate(0);transform:translate(2px,1px) rotate(0)}10%{-webkit-transform:translate(-1px,-2px) rotate(-1deg);transform:translate(-1px,-2px) rotate(-1deg)}20%{-webkit-transform:translate(-3px,0) rotate(1deg);transform:translate(-3px,0) rotate(1deg)}30%{-webkit-transform:translate(0,2px) rotate(0);transform:translate(0,2px) rotate(0)}40%{-webkit-transform:translate(1px,-1px) rotate(1deg);transform:translate(1px,-1px) rotate(1deg)}50%{-webkit-transform:translate(-1px,2px) rotate(-1deg);transform:translate(-1px,2px) rotate(-1deg)}60%{-webkit-transform:translate(-3px,1px) rotate(0);transform:translate(-3px,1px) rotate(0)}70%{-webkit-transform:translate(2px,1px) rotate(-1deg);transform:translate(2px,1px) rotate(-1deg)}80%{-webkit-transform:translate(-1px,-1px) rotate(1deg);transform:translate(-1px,-1px) rotate(1deg)}90%{-webkit-transform:translate(2px,2px) rotate(0);transform:translate(2px,2px) rotate(0)}100%{-webkit-transform:translate(1px,-2px) rotate(-1deg);transform:translate(1px,-2px) rotate(-1deg)}}#toasty{position:fixed;z-index:999999}#toasty .close-button:focus{outline:0}#toasty.toasty-position-top-left{top:12px;left:12px}#toasty.toasty-position-top-right{top:12px;right:12px}#toasty.toasty-position-bottom-right{bottom:12px;right:12px}#toasty.toasty-position-bottom-left{bottom:12px;left:12px}#toasty.toasty-position-top-center{top:12px;left:50%;-webkit-transform:translate(-50%,0);transform:translate(-50%,0)}#toasty.toasty-position-bottom-center{bottom:12px;left:50%;-webkit-transform:translate(-50%,0);transform:translate(-50%,0)}#toasty .toast{cursor:pointer;margin:0 0 6px;padding:0;width:285px;height:65px;display:table;background-size:24px 24px;background-position:15px center;background-repeat:no-repeat;box-shadow:0 0 5px 0 rgba(0,0,0,.25);opacity:.9;position:relative}#toasty .toast.toasty-shake{-webkit-animation-name:toasty-shake;animation-name:toasty-shake;-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}#toasty .toast.toasty-shake:hover{-webkit-animation-play-state:paused;animation-play-state:paused}#toasty .toast .close-button{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;position:absolute;right:10px;top:3px;opacity:.5}#toasty .toast .close-button:focus,#toasty .toast .close-button:hover{text-decoration:none;cursor:pointer;opacity:1}#toasty .toast .toast-text{padding:5px 20px 5px 60px;display:table-cell;vertical-align:middle}#toasty .toast .toast-text .toast-title{font-weight:700}#toasty .toast .toast-text a:hover,#toasty .toast .toast-text label:hover{text-decoration:none}.mdp-animate-next{opacity:0;transform:translate3d(50%,0,1px)}.mdp-animate-next-remove{transition:all .5s cubic-bezier(.35,0,.25,1);opacity:0;transform:translate3d(50%,0,1px)}.mdp-animate-next-remove-active{opacity:1;transform:translate3d(0,0,1px)}.mdp-animate-prev{opacity:0;transform:translate3d(-50%,0,1px)}.mdp-animate-prev-remove{transition:all .3s cubic-bezier(.35,0,.25,1);opacity:0;transform:translate3d(-50%,0,1px)}.mdp-animate-prev-remove-active{opacity:1;transform:translate3d(0,0,1px)}@keyframes mdp-animation-bounce{from{opacity:0;transform:scale(.95)}70%{opacity:1;transform:scale(1.05)}to{transform:scale(1)}}.mdp-animation-zoom.ng-enter{transition:all .3s cubic-bezier(.35,0,.25,1);animation-duration:.3s;animation-name:mdp-animation-bounce}.mdp-datepicker{max-height:initial;min-width:234px}.mdp-datepicker *{outline:0}.mdp-datepicker .md-actions{width:100%;padding:0 5px}.mdp-calendar-week-days{font-size:.75rem;opacity:.6}.mdp-calendar-week-days>*{width:32px;height:32px;line-height:32px;margin:0 5px;padding:0;min-width:0;min-height:0;box-shadow:none!important;background-color:transparent}.mdp-calendar-days{font-size:1rem;max-width:100%}.mdp-calendar-days .md-button,.mdp-calendar-days .mdp-day-placeholder{width:32px;height:32px;margin:0 5px}.mdp-calendar-days .md-button{cursor:pointer;border-radius:50%;font-size:12px;width:32px;height:32px;line-height:32px;padding:0;min-width:0;min-height:0;box-shadow:none!important;background-color:transparent}.mdp-calendar-days .md-button[disabled]:not(.md-accent){background-color:transparent!important}.mdp-calendar-monthyear{font-size:.8125rem;font-weight:700;line-height:32px;min-height:32px}.mdp-datepicker-date,.mdp-datepicker-day,.mdp-datepicker-dow,.mdp-datepicker-month{font-size:1.8rem;opacity:.6}.mdp-datepicker-date:not(.active),.mdp-datepicker-day:not(.active),.mdp-datepicker-dow:not(.active),.mdp-datepicker-month:not(.active){cursor:pointer}.mdp-datepicker-date.active,.mdp-datepicker-date:hover,.mdp-datepicker-day.active,.mdp-datepicker-day:hover,.mdp-datepicker-dow.active,.mdp-datepicker-dow:hover,.mdp-datepicker-month.active,.mdp-datepicker-month:hover{opacity:1}.mdp-datepicker-year{font-size:.9rem;opacity:.6;padding:0;margin:0}.mdp-datepicker-year:not(.active){cursor:pointer}.mdp-datepicker-year.active,.mdp-datepicker-year:hover{opacity:1}.mdp-datepicker-select-year{height:232px}.mdp-datepicker-select-year .repeated-year{text-align:center}.mdp-datepicker-select-year .repeated-year .md-button{width:100%;margin:0;border-radius:0;padding:0;font-size:1rem;line-height:42px}.mdp-datepicker-select-year .repeated-year .md-button.current{font-size:1.8rem;line-height:42px}.mdp-datepicker-select-year .md-virtual-repeat-container,.mdp-datepicker-select-year .md-virtual-repeat-offsetter,.mdp-datepicker-select-year .md-virtual-repeat-scroller{height:100%;width:100%}mdp-date-picker>md-input-container.md-has-icon{padding-left:40px}mdp-date-picker .md-button.md-icon-button{margin:18px 0 0 0}.mdp-datepicker:not(.portrait) .mdp-datepicker-select-year{width:309px}.mdp-datepicker:not(.portrait) .mdp-calendar{margin-right:5px;width:294px;margin-left:10px}.mdp-datepicker:not(.portrait) .mdp-datepicker-date-wrapper{width:150px}.mdp-datepicker:not(.portrait) .mdp-datepicker-dow{width:100%;display:block}.mdp-datepicker:not(.portrait) .mdp-calendar-days>*,.mdp-datepicker:not(.portrait) .mdp-calendar-week-days>*{width:42px}.mdp-datepicker .mdp-datepicker-date-wrapper{padding:16px 35px 16px 16px}.mdp-datepicker md-dialog-content{overflow:hidden;padding:0}.mdp-datepicker md-dialog-content .mdp-calendar{width:294px;overflow-x:hidden}.mdp-datepicker.portrait{max-width:234px}.mdp-datepicker.portrait .mdp-calendar{text-align:center;width:100%}.mdp-datepicker.portrait .mdp-datepicker-select-year{height:252px}.mdp-datepicker.portrait md-dialog-content>*{width:100%}.mdp-datepicker.portrait .md-actions,.mdp-datepicker.portrait .mdp-calendar-days,.mdp-datepicker.portrait .mdp-calendar-week-days{padding:0 5px}.mdp-datepicker.portrait .md-actions{margin-top:20px}.mdp-datepicker.portrait .mdp-calendar-days>*,.mdp-datepicker.portrait .mdp-calendar-week-days>*{width:32px}mdp-calendar{display:block}.mdp-calendar-week-days{width:100%}.mdp-calendar-week-days>*{margin:0}.mdp-calendar-days .md-button,.mdp-calendar-days .mdp-day-placeholder{margin:0}.mdp-clock{width:200px;height:200px;border-radius:50%!important;cursor:pointer;padding:24px;background:#ededed;box-shadow:none!important}.mdp-clock .md-button{box-shadow:none!important;background-color:transparent;display:block;position:absolute;min-height:32px;width:32px;height:32px;font-size:12px;line-height:32px;margin:0;padding:0;transform:translate(-50%,-50%)}.mdp-clock .mdp-clock-container{width:100%;height:100%;position:relative;display:block}.mdp-clock .mdp-pointer{min-height:0;width:1px;height:50%;position:absolute;left:0;right:0;bottom:0;margin:0 auto;transform-origin:top center;z-index:0;pointer-events:none}.mdp-clock .mdp-clock-center{min-height:0;height:6px;width:6px;position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;border-radius:50%}.mdp-clock .md-button.mdp-clock-selected{position:absolute;border-radius:50%;width:8px;height:8px;bottom:-8px;left:0;min-width:0;min-height:0;pointer-events:none}.mdp-timepicker .mdp-clock-switch-container{padding:20px;width:309px}.mdp-timepicker .mdp-timepicker-time{padding:15px}.mdp-timepicker .mdp-timepicker-selected-time{font-size:3rem}.mdp-timepicker:not(.portrait) .mdp-timepicker-time{width:138px}.mdp-timepicker.portrait .mdp-timepicker-selected-time{font-size:4rem;margin-right:1.5rem}mdp-time-picker md-input-container.md-has-icon{padding-left:40px}mdp-time-picker .md-button.md-icon-button{margin:18px 0 0 0}.mdp-timepicker-selected-ampm>span,.mdp-timepicker-selected-time>span{outline:0;opacity:.6}.mdp-timepicker-selected-ampm>span:not(.active),.mdp-timepicker-selected-time>span:not(.active){cursor:pointer}.mdp-timepicker-selected-ampm>span.active,.mdp-timepicker-selected-time>span.active{opacity:1}.mdp-clock-deg0{top:0;left:50%}.mdp-clock-deg30{top:6.69872981%;left:75%}.mdp-clock-deg60{top:25%;left:93.30127019%}.mdp-clock-deg90{top:50%;left:100%}.mdp-clock-deg120{top:75%;left:93.30127019%}.mdp-clock-deg150{top:93.30127019%;left:75%}.mdp-clock-deg180{top:100%;left:50%}.mdp-clock-deg210{top:93.30127019%;left:25%}.mdp-clock-deg240{top:75%;left:6.69872981%}.mdp-clock-deg270{top:50%;left:0}.mdp-clock-deg300{top:25%;left:6.69872981%}.mdp-clock-deg330{top:6.69872981%;left:25%}.mdp-clock-deg360{top:0;left:50%}.jstree-children,.jstree-container-ul,.jstree-node{display:block;margin:0;padding:0;list-style-type:none;list-style-image:none}.jstree-node{white-space:nowrap}.jstree-anchor{display:inline-block;color:#000;white-space:nowrap;padding:0 4px 0 1px;margin:0;vertical-align:top}.jstree-anchor:focus{outline:0}.jstree-anchor,.jstree-anchor:active,.jstree-anchor:hover,.jstree-anchor:link,.jstree-anchor:visited{text-decoration:none;color:inherit}.jstree-icon{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-icon:empty{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-ocl{cursor:pointer}.jstree-leaf>.jstree-ocl{cursor:default}.jstree .jstree-open>.jstree-children{display:block}.jstree .jstree-closed>.jstree-children,.jstree .jstree-leaf>.jstree-children{display:none}.jstree-anchor>.jstree-themeicon{margin-right:2px}.jstree-anchor>.jstree-themeicon-hidden,.jstree-no-icons .jstree-themeicon{display:none}.jstree-hidden,.jstree-node.jstree-hidden{display:none}.jstree-rtl .jstree-anchor{padding:0 1px 0 4px}.jstree-rtl .jstree-anchor>.jstree-themeicon{margin-left:2px;margin-right:0}.jstree-rtl .jstree-node{margin-left:0}.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-wholerow-ul{position:relative;display:inline-block;min-width:100%}.jstree-wholerow-ul .jstree-leaf>.jstree-ocl{cursor:pointer}.jstree-wholerow-ul .jstree-anchor,.jstree-wholerow-ul .jstree-icon{position:relative}.jstree-wholerow-ul .jstree-wholerow{width:100%;cursor:pointer;position:absolute;left:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.jstree-contextmenu .jstree-anchor{-webkit-user-select:none;-webkit-touch-callout:none}.vakata-context{display:none}.vakata-context,.vakata-context ul{margin:0;padding:2px;position:absolute;background:#f5f5f5;border:1px solid #979797;box-shadow:2px 2px 2px #999}.vakata-context ul{list-style:none;left:100%;margin-top:-2.7em;margin-left:-4px}.vakata-context .vakata-context-right ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context li{list-style:none}.vakata-context li>a{display:block;padding:0 2em 0 2em;text-decoration:none;width:auto;color:#000;white-space:nowrap;line-height:2.4em;text-shadow:1px 1px 0 #fff;border-radius:1px}.vakata-context li>a:hover{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==);background-position:right center;background-repeat:no-repeat}.vakata-context li>a:focus{outline:0}.vakata-context .vakata-context-hover>a{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context .vakata-context-separator>a,.vakata-context .vakata-context-separator>a:hover{background:#fff;border:0;border-top:1px solid #e2e3e3;height:1px;min-height:1px;max-height:1px;padding:0;margin:0 0 0 2.4em;border-left:1px solid #e0e0e0;text-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;border-radius:0}.vakata-context .vakata-contextmenu-disabled a,.vakata-context .vakata-contextmenu-disabled a:hover{color:silver;background-color:transparent;border:0;box-shadow:0 0 0}.vakata-context .vakata-contextmenu-disabled>a>i{filter:grayscale(100%)}.vakata-context li>a>i{text-decoration:none;display:inline-block;width:2.4em;height:2.4em;background:0 0;margin:0 0 0 -2em;vertical-align:top;text-align:center;line-height:2.4em}.vakata-context li>a>i:empty{width:2.4em;line-height:2.4em}.vakata-context li>a .vakata-contextmenu-sep{display:inline-block;width:1px;height:2.4em;background:#fff;margin:0 .5em 0 0;border-left:1px solid #e2e3e3}.vakata-context .vakata-contextmenu-shortcut{font-size:.8em;color:silver;opacity:.5;display:none}.vakata-context-rtl ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context-rtl li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7);background-position:left center;background-repeat:no-repeat}.vakata-context-rtl .vakata-context-separator>a{margin:0 2.4em 0 0;border-left:0;border-right:1px solid #e2e3e3}.vakata-context-rtl .vakata-context-left ul{right:auto;left:100%;margin-left:-4px;margin-right:auto}.vakata-context-rtl li>a>i{margin:0 -2em 0 0}.vakata-context-rtl li>a .vakata-contextmenu-sep{margin:0 0 0 .5em;border-left-color:#fff;background:#e2e3e3}#jstree-marker{position:absolute;top:0;left:0;margin:-5px 0 0 0;padding:0;border-right:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid;width:0;height:0;font-size:0;line-height:0}#jstree-dnd{line-height:16px;margin:0;padding:4px}#jstree-dnd .jstree-copy,#jstree-dnd .jstree-icon{display:inline-block;text-decoration:none;margin:0 2px 0 0;padding:0;width:16px;height:16px}#jstree-dnd .jstree-ok{background:green}#jstree-dnd .jstree-er{background:red}#jstree-dnd .jstree-copy{margin:0 2px 0 2px}.jstree-default .jstree-icon,.jstree-default .jstree-node{background-repeat:no-repeat;background-color:transparent}.jstree-default .jstree-anchor,.jstree-default .jstree-animated,.jstree-default .jstree-wholerow{transition:background-color .15s,box-shadow .15s}.jstree-default .jstree-hovered{background:#e7f4f9;border-radius:2px;box-shadow:inset 0 0 1px #ccc}.jstree-default .jstree-context{background:#e7f4f9;border-radius:2px;box-shadow:inset 0 0 1px #ccc}.jstree-default .jstree-clicked{background:#beebff;border-radius:2px;box-shadow:inset 0 0 1px #999}.jstree-default .jstree-no-icons .jstree-anchor>.jstree-themeicon{display:none}.jstree-default .jstree-disabled{background:0 0;color:#666}.jstree-default .jstree-disabled.jstree-hovered{background:0 0;box-shadow:none}.jstree-default .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default .jstree-disabled>.jstree-icon{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default .jstree-search{font-style:italic;color:#8b0000;font-weight:700}.jstree-default .jstree-no-checkboxes .jstree-checkbox{display:none!important}.jstree-default.jstree-checkbox-no-clicked .jstree-clicked{background:0 0;box-shadow:none}.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered{background:#e7f4f9}.jstree-default.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked{background:0 0}.jstree-default.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered{background:#e7f4f9}.jstree-default>.jstree-striped{min-width:100%;display:inline-block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==) left top repeat}.jstree-default>.jstree-wholerow-ul .jstree-clicked,.jstree-default>.jstree-wholerow-ul .jstree-hovered{background:0 0;box-shadow:none;border-radius:0}.jstree-default .jstree-wholerow{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.jstree-default .jstree-wholerow-hovered{background:#e7f4f9}.jstree-default .jstree-wholerow-clicked{background:#beebff;background:-webkit-linear-gradient(top,#beebff 0,#a8e4ff 100%);background:linear-gradient(to bottom,#beebff 0,#a8e4ff 100%)}.jstree-default .jstree-node{min-height:24px;line-height:24px;margin-left:24px;min-width:24px}.jstree-default .jstree-anchor{line-height:24px;height:24px}.jstree-default .jstree-icon{width:24px;height:24px;line-height:24px}.jstree-default .jstree-icon:empty{width:24px;height:24px;line-height:24px}.jstree-default.jstree-rtl .jstree-node{margin-right:24px}.jstree-default .jstree-wholerow{height:24px}.jstree-default .jstree-icon,.jstree-default .jstree-node{background-image:url(32px.png)}.jstree-default .jstree-node{background-position:-292px -4px;background-repeat:repeat-y}.jstree-default .jstree-last{background:0 0}.jstree-default .jstree-open>.jstree-ocl{background-position:-132px -4px}.jstree-default .jstree-closed>.jstree-ocl{background-position:-100px -4px}.jstree-default .jstree-leaf>.jstree-ocl{background-position:-68px -4px}.jstree-default .jstree-themeicon{background-position:-260px -4px}.jstree-default>.jstree-no-dots .jstree-leaf>.jstree-ocl,.jstree-default>.jstree-no-dots .jstree-node{background:0 0}.jstree-default>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -4px}.jstree-default>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -4px}.jstree-default .jstree-disabled{background:0 0}.jstree-default .jstree-disabled.jstree-hovered{background:0 0}.jstree-default .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default .jstree-checkbox{background-position:-164px -4px}.jstree-default .jstree-checkbox:hover{background-position:-164px -36px}.jstree-default .jstree-checked>.jstree-checkbox,.jstree-default.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox{background-position:-228px -4px}.jstree-default .jstree-checked>.jstree-checkbox:hover,.jstree-default.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover{background-position:-228px -36px}.jstree-default .jstree-anchor>.jstree-undetermined{background-position:-196px -4px}.jstree-default .jstree-anchor>.jstree-undetermined:hover{background-position:-196px -36px}.jstree-default .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default>.jstree-striped{background-size:auto 48px}.jstree-default.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default.jstree-rtl .jstree-last{background:0 0}.jstree-default.jstree-rtl .jstree-open>.jstree-ocl{background-position:-132px -36px}.jstree-default.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-100px -36px}.jstree-default.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-68px -36px}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl,.jstree-default.jstree-rtl>.jstree-no-dots .jstree-node{background:0 0}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -36px}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -36px}.jstree-default .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default .jstree-file{background:url(32px.png) -100px -68px no-repeat}.jstree-default .jstree-folder{background:url(32px.png) -260px -4px no-repeat}.jstree-default>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default{line-height:24px;padding:0 4px}#jstree-dnd.jstree-default .jstree-er,#jstree-dnd.jstree-default .jstree-ok{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default i{background:0 0;width:24px;height:24px;line-height:24px}#jstree-dnd.jstree-default .jstree-ok{background-position:-4px -68px}#jstree-dnd.jstree-default .jstree-er{background-position:-36px -68px}.jstree-default .jstree-ellipsis{overflow:hidden}.jstree-default .jstree-ellipsis .jstree-anchor{width:calc(100% - 29px);text-overflow:ellipsis;overflow:hidden}.jstree-default.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==)}.jstree-default.jstree-rtl .jstree-last{background:0 0}.jstree-default-small .jstree-node{min-height:18px;line-height:18px;margin-left:18px;min-width:18px}.jstree-default-small .jstree-anchor{line-height:18px;height:18px}.jstree-default-small .jstree-icon{width:18px;height:18px;line-height:18px}.jstree-default-small .jstree-icon:empty{width:18px;height:18px;line-height:18px}.jstree-default-small.jstree-rtl .jstree-node{margin-right:18px}.jstree-default-small .jstree-wholerow{height:18px}.jstree-default-small .jstree-icon,.jstree-default-small .jstree-node{background-image:url(32px.png)}.jstree-default-small .jstree-node{background-position:-295px -7px;background-repeat:repeat-y}.jstree-default-small .jstree-last{background:0 0}.jstree-default-small .jstree-open>.jstree-ocl{background-position:-135px -7px}.jstree-default-small .jstree-closed>.jstree-ocl{background-position:-103px -7px}.jstree-default-small .jstree-leaf>.jstree-ocl{background-position:-71px -7px}.jstree-default-small .jstree-themeicon{background-position:-263px -7px}.jstree-default-small>.jstree-no-dots .jstree-leaf>.jstree-ocl,.jstree-default-small>.jstree-no-dots .jstree-node{background:0 0}.jstree-default-small>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -7px}.jstree-default-small>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -7px}.jstree-default-small .jstree-disabled{background:0 0}.jstree-default-small .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-small .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-small .jstree-checkbox{background-position:-167px -7px}.jstree-default-small .jstree-checkbox:hover{background-position:-167px -39px}.jstree-default-small .jstree-checked>.jstree-checkbox,.jstree-default-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox{background-position:-231px -7px}.jstree-default-small .jstree-checked>.jstree-checkbox:hover,.jstree-default-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover{background-position:-231px -39px}.jstree-default-small .jstree-anchor>.jstree-undetermined{background-position:-199px -7px}.jstree-default-small .jstree-anchor>.jstree-undetermined:hover{background-position:-199px -39px}.jstree-default-small .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default-small>.jstree-striped{background-size:auto 36px}.jstree-default-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-small.jstree-rtl .jstree-open>.jstree-ocl{background-position:-135px -39px}.jstree-default-small.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-103px -39px}.jstree-default-small.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-71px -39px}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl,.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-node{background:0 0}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -39px}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -39px}.jstree-default-small .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-small>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-small .jstree-file{background:url(32px.png) -103px -71px no-repeat}.jstree-default-small .jstree-folder{background:url(32px.png) -263px -7px no-repeat}.jstree-default-small>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-small{line-height:18px;padding:0 4px}#jstree-dnd.jstree-default-small .jstree-er,#jstree-dnd.jstree-default-small .jstree-ok{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-small i{background:0 0;width:18px;height:18px;line-height:18px}#jstree-dnd.jstree-default-small .jstree-ok{background-position:-7px -71px}#jstree-dnd.jstree-default-small .jstree-er{background-position:-39px -71px}.jstree-default-small .jstree-ellipsis{overflow:hidden}.jstree-default-small .jstree-ellipsis .jstree-anchor{width:calc(100% - 23px);text-overflow:ellipsis;overflow:hidden}.jstree-default-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==)}.jstree-default-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-large .jstree-node{min-height:32px;line-height:32px;margin-left:32px;min-width:32px}.jstree-default-large .jstree-anchor{line-height:32px;height:32px}.jstree-default-large .jstree-icon{width:32px;height:32px;line-height:32px}.jstree-default-large .jstree-icon:empty{width:32px;height:32px;line-height:32px}.jstree-default-large.jstree-rtl .jstree-node{margin-right:32px}.jstree-default-large .jstree-wholerow{height:32px}.jstree-default-large .jstree-icon,.jstree-default-large .jstree-node{background-image:url(32px.png)}.jstree-default-large .jstree-node{background-position:-288px 0;background-repeat:repeat-y}.jstree-default-large .jstree-last{background:0 0}.jstree-default-large .jstree-open>.jstree-ocl{background-position:-128px 0}.jstree-default-large .jstree-closed>.jstree-ocl{background-position:-96px 0}.jstree-default-large .jstree-leaf>.jstree-ocl{background-position:-64px 0}.jstree-default-large .jstree-themeicon{background-position:-256px 0}.jstree-default-large>.jstree-no-dots .jstree-leaf>.jstree-ocl,.jstree-default-large>.jstree-no-dots .jstree-node{background:0 0}.jstree-default-large>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px 0}.jstree-default-large>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 0}.jstree-default-large .jstree-disabled{background:0 0}.jstree-default-large .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-large .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-large .jstree-checkbox{background-position:-160px 0}.jstree-default-large .jstree-checkbox:hover{background-position:-160px -32px}.jstree-default-large .jstree-checked>.jstree-checkbox,.jstree-default-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox{background-position:-224px 0}.jstree-default-large .jstree-checked>.jstree-checkbox:hover,.jstree-default-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover{background-position:-224px -32px}.jstree-default-large .jstree-anchor>.jstree-undetermined{background-position:-192px 0}.jstree-default-large .jstree-anchor>.jstree-undetermined:hover{background-position:-192px -32px}.jstree-default-large .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default-large>.jstree-striped{background-size:auto 64px}.jstree-default-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-large.jstree-rtl .jstree-last{background:0 0}.jstree-default-large.jstree-rtl .jstree-open>.jstree-ocl{background-position:-128px -32px}.jstree-default-large.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-96px -32px}.jstree-default-large.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-64px -32px}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl,.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-node{background:0 0}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px -32px}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 -32px}.jstree-default-large .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-large>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-large .jstree-file{background:url(32px.png) -96px -64px no-repeat}.jstree-default-large .jstree-folder{background:url(32px.png) -256px 0 no-repeat}.jstree-default-large>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-large{line-height:32px;padding:0 4px}#jstree-dnd.jstree-default-large .jstree-er,#jstree-dnd.jstree-default-large .jstree-ok{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-large i{background:0 0;width:32px;height:32px;line-height:32px}#jstree-dnd.jstree-default-large .jstree-ok{background-position:0 -64px}#jstree-dnd.jstree-default-large .jstree-er{background-position:-32px -64px}.jstree-default-large .jstree-ellipsis{overflow:hidden}.jstree-default-large .jstree-ellipsis .jstree-anchor{width:calc(100% - 37px);text-overflow:ellipsis;overflow:hidden}.jstree-default-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==)}.jstree-default-large.jstree-rtl .jstree-last{background:0 0}@media (max-width:768px){#jstree-dnd.jstree-dnd-responsive{line-height:40px;font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}#jstree-dnd.jstree-dnd-responsive>i{background:0 0;width:40px;height:40px}#jstree-dnd.jstree-dnd-responsive>.jstree-ok{background-image:url(40px.png);background-position:0 -200px;background-size:120px 240px}#jstree-dnd.jstree-dnd-responsive>.jstree-er{background-image:url(40px.png);background-position:-40px -200px;background-size:120px 240px}#jstree-marker.jstree-dnd-responsive{border-left-width:10px;border-top-width:10px;border-bottom-width:10px;margin-top:-10px}}@media (max-width:768px){.jstree-default-responsive .jstree-icon{background-image:url(40px.png)}.jstree-default-responsive .jstree-leaf>.jstree-ocl,.jstree-default-responsive .jstree-node{background:0 0}.jstree-default-responsive .jstree-node{min-height:40px;line-height:40px;margin-left:40px;min-width:40px;white-space:nowrap}.jstree-default-responsive .jstree-anchor{line-height:40px;height:40px}.jstree-default-responsive .jstree-icon,.jstree-default-responsive .jstree-icon:empty{width:40px;height:40px;line-height:40px}.jstree-default-responsive>.jstree-container-ul>.jstree-node{margin-left:0}.jstree-default-responsive.jstree-rtl .jstree-node{margin-left:0;margin-right:40px;background:0 0}.jstree-default-responsive.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-default-responsive .jstree-checkbox,.jstree-default-responsive .jstree-ocl,.jstree-default-responsive .jstree-themeicon{background-size:120px 240px}.jstree-default-responsive .jstree-leaf>.jstree-ocl,.jstree-default-responsive.jstree-rtl .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-responsive .jstree-open>.jstree-ocl{background-position:0 0!important}.jstree-default-responsive .jstree-closed>.jstree-ocl{background-position:0 -40px!important}.jstree-default-responsive.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-40px 0!important}.jstree-default-responsive .jstree-themeicon{background-position:-40px -40px}.jstree-default-responsive .jstree-checkbox,.jstree-default-responsive .jstree-checkbox:hover{background-position:-40px -80px}.jstree-default-responsive .jstree-checked>.jstree-checkbox,.jstree-default-responsive .jstree-checked>.jstree-checkbox:hover,.jstree-default-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover{background-position:0 -80px}.jstree-default-responsive .jstree-anchor>.jstree-undetermined,.jstree-default-responsive .jstree-anchor>.jstree-undetermined:hover{background-position:0 -120px}.jstree-default-responsive .jstree-anchor{font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}.jstree-default-responsive>.jstree-striped{background:0 0}.jstree-default-responsive .jstree-wholerow{border-top:1px solid rgba(255,255,255,.7);border-bottom:1px solid rgba(64,64,64,.2);background:#ebebeb;height:40px}.jstree-default-responsive .jstree-wholerow-hovered{background:#e7f4f9}.jstree-default-responsive .jstree-wholerow-clicked{background:#beebff}.jstree-default-responsive .jstree-children .jstree-last>.jstree-wholerow{box-shadow:inset 0 -6px 3px -5px #666}.jstree-default-responsive .jstree-children .jstree-open>.jstree-wholerow{box-shadow:inset 0 6px 3px -5px #666;border-top:0}.jstree-default-responsive .jstree-children .jstree-open+.jstree-open{box-shadow:none}.jstree-default-responsive .jstree-checkbox,.jstree-default-responsive .jstree-icon,.jstree-default-responsive .jstree-node,.jstree-default-responsive .jstree-node>.jstree-ocl,.jstree-default-responsive .jstree-themeicon{background-image:url(40px.png);background-size:120px 240px}.jstree-default-responsive .jstree-node{background-position:-80px 0;background-repeat:repeat-y}.jstree-default-responsive .jstree-last{background:0 0}.jstree-default-responsive .jstree-leaf>.jstree-ocl{background-position:-40px -120px}.jstree-default-responsive .jstree-last>.jstree-ocl{background-position:-40px -160px}.jstree-default-responsive .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-responsive .jstree-file{background:url(40px.png) 0 -160px no-repeat;background-size:120px 240px}.jstree-default-responsive .jstree-folder{background:url(40px.png) -40px -40px no-repeat;background-size:120px 240px}.jstree-default-responsive>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}}.gridster{position:relative;margin:auto;height:0}.gridster>ul{margin:0;list-style:none;padding:0}.gridster-item{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;list-style:none;z-index:2;position:absolute;display:none}.gridster-loaded{-webkit-transition:height .3s;-moz-transition:height .3s;-o-transition:height .3s;transition:height .3s}.gridster-loaded .gridster-item{display:block;position:absolute;-webkit-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-moz-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-o-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-webkit-transition-delay:50ms;-moz-transition-delay:50ms;-o-transition-delay:50ms;transition-delay:50ms}.gridster-loaded .gridster-preview-holder{display:none;z-index:1;position:absolute;background-color:#ddd;border-color:#fff;opacity:.2}.gridster-loaded .gridster-item.gridster-item-moving,.gridster-loaded .gridster-preview-holder{-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.gridster-mobile{height:auto!important}.gridster-mobile .gridster-item{height:auto;position:static;float:none}.gridster-item.ng-leave.ng-leave-active{opacity:0}.gridster-item.ng-enter{opacity:1}.gridster-item-moving{z-index:3}.gridster-item-resizable-handler{position:absolute;font-size:1px;display:block;z-index:5}.handle-se{cursor:se-resize;width:0;height:0;right:1px;bottom:1px;border-style:solid;border-width:0 0 12px 12px;border-color:transparent}.handle-ne{cursor:ne-resize;width:12px;height:12px;right:1px;top:1px}.handle-nw{cursor:nw-resize;width:12px;height:12px;left:1px;top:1px}.handle-sw{cursor:sw-resize;width:12px;height:12px;left:1px;bottom:1px}.handle-e{cursor:e-resize;width:12px;bottom:0;right:1px;top:0}.handle-s{cursor:s-resize;height:12px;right:0;bottom:1px;left:0}.handle-n{cursor:n-resize;height:12px;right:0;top:1px;left:0}.handle-w{cursor:w-resize;width:12px;left:1px;top:0;bottom:0}.gridster .gridster-item:hover .gridster-box{border:1.5px solid #b3b2b3}.gridster .gridster-item:hover .handle-se{border-color:transparent transparent #ccc}.widget-clock .digital{text-align:center}.widget-clock .time{font-family:Syncopate,sans-serif;font-size:2.5em;margin:0}.widget-clock .square{position:relative;width:100%;height:0;padding-bottom:100%}.widget-clock svg{position:absolute;width:100%;height:100%;left:0}.widget-clock .clock-face{stroke:#333;fill:#fff}.widget-clock .minor{stroke:#999;stroke-width:.5}.widget-clock .major{stroke:#333;stroke-width:1}.widget-clock .hour{stroke:#333}.widget-clock .minute{stroke:#666}.widget-clock .second{stroke:#1076ed}.widget-clock .second-counterweight{stroke:#1076ed;stroke-width:3}.widget-clock.dark .clock-face{fill:#111}.widget-clock.dark .hour{stroke:#666}.widget-clock.dark .minute{stroke:#999}*{box-sizing:border-box}@font-face{font-family:emoticons;src:url(../fonts/emoticons.eot?5zh0vu);src:url(../fonts/emoticons.eot?#iefix5zh0vu) format('embedded-opentype'),url(../fonts/emoticons.woff?5zh0vu) format('woff'),url(../fonts/emoticons.ttf?5zh0vu) format('truetype'),url(../fonts/emoticons.svg?5zh0vu#icomoon) format('svg');font-weight:400;font-style:normal}.ne-code{display:none}.ne-code{font-size:14px;padding:20px;font-family:Consolas,Menlo,Monaco,monospace;padding:1.5em}pre{position:relative;margin-bottom:24px;border-radius:2px;overflow:hidden}code.has-numbering{display:block;padding:12px 30px;overflow-y:auto;font-weight:300;font-family:Consolas,Menlo,Monaco,monospace;font-size:14px;line-height:20px}code.has-numbering{margin-left:36px}.pre-numbering{position:absolute;top:0;left:0;width:35px;padding:1.1em 5px 12px 0;border-right:1px solid #e8e8e8;border-radius:3px 0 0 3px;background-color:#eee;text-align:right;font-family:Consolas,Menlo,Monaco,monospace;font-size:14px;color:#aaa;line-height:20px;margin-top:-4px}.pre-numbering li{list-style-type:none}.ne-pdf iframe{width:420px;height:530px;display:block}.ne-pdf-icon{width:200px;height:150px;float:left;border-right:1px solid #eee}.ne-pdf-icon i{margin:29px 62px;color:#999;font-size:84px}.ne-pdf-view button{font-family:inherit;font-size:14px;background-color:transparent;border:1px solid #ccc;padding:6px 15px;border-radius:2px;color:#333;cursor:pointer;box-shadow:0 1px 1px 0 rgba(0,0,0,.26);outline:0;border-bottom:0;float:right;margin:80px 10px 0 10px;-webkit-transition:all .5s linear;-o-transition:all .5s linear;-moz-transition:all .5s linear;-ms-transition:all .5s linear;-kthtml-transition:all .5s linear;transition:all .5s linear}.ne-pdf-view button:hover{box-shadow:0 2px 2px 0 rgba(0,0,0,.26)}.ne-pdf-view button i{margin-right:6px}.ne-pdf-view button a{color:#333}.ne-pdf-viewer iframe{margin:0 auto}.ne-pdf-viewer{background-color:#3498db;position:relative}.ne-pdf-viewer i{position:absolute;right:10px;top:8px;color:#fff;font-size:25px;cursor:pointer}.ne-audio{background-color:#1d1d1d;border-radius:2px;padding-top:6px}.ne-audio audio{width:100%}.ne-pdf,.ne-video{padding:5px;border:1px solid #e4e4e4;border-radius:2px;margin:20px 0;box-shadow:0 1px 1px 0 rgba(0,0,0,.26);border-bottom:0;overflow:auto;-webkit-transition:all .5s linear;-o-transition:all .5s linear;-moz-transition:all .5s linear;-ms-transition:all .5s linear;-kthtml-transition:all .5s linear;transition:all .5s linear}.ne-embed{width:100%;padding:5px;border:1px solid #e4e4e4;border-radius:2px;margin:20px 0;box-shadow:0 1px 1px 0 rgba(0,0,0,.26);border-bottom:0;padding-bottom:1px}.ne-embed iframe{border:0;background-color:#3498db;background-image:url(../images/loader.svg);background-repeat:no-repeat;background-position:center;width:100%}.ne-plunker{background-color:#fff!important}.ne-video video{width:100%}.ne-video iframe{width:100%;border:0}.ne-video object{width:100%;border:0}.ne-audio iframe{width:100%;border:0}.ne-image:hover,.ne-video:hover{box-shadow:0 2px 2px 0 rgba(0,0,0,.26)}.ne-pdf-preview,.ne-video-preview{overflow:auto}.ne-video-preview img{display:block;width:200px;height:150px;border-radius:2px;background-color:#3498db}.ne-video-thumb{width:200px;float:left;cursor:pointer;color:rgba(255,255,255,.6)}.ne-video-thumb:hover{color:#fff}.ne-video-thumb i{position:absolute;font-size:42px;margin-top:-95px;margin-left:80px;cursor:pointer}.ne-pdf-detail,.ne-video-detail{width:calc(100% - 200px);float:left;padding-left:15px}.ne-pdf-title,.ne-video-title{font-weight:bolder;padding:5px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ne-video-desc{font-size:16px;color:#666;height:90px}.ne-stats{padding-top:7px;overflow:auto}.ne-video-stats span{padding:0 15px;float:right}.ne-video-stats span i{margin-right:10px}.ne-video-player{background-color:#3498db;background-image:url(../images/loader.svg);background-repeat:no-repeat;background-position:center}.ne-video-player iframe{width:100%}.ne-image{width:100%;border-radius:2px;border:1px solid #e4e4e4;min-height:250px;max-height:250px;overflow:hidden;cursor:pointer;padding-bottom:5px;-webkit-transition:all .5s linear;-o-transition:all .5s linear;-moz-transition:all .5s linear;-ms-transition:all .5s linear;-kthtml-transition:all .5s linear;transition:all .5s linear;box-shadow:0 1px 1px 0 rgba(0,0,0,.26);border-bottom:5px solid #fff;margin:10px 0}.ne-image-long{max-height:800px}.ne-image img,.ne-image-long img{width:100%;display:block;min-height:250px}.ne-image-wrapper{margin:5px;margin-bottom:0;background-color:#3498db;background-image:url(../images/loader.svg);background-repeat:no-repeat;background-position:center;height:100%;overflow:hidden}.ne-gist body{margin:0!important}.emoticons-image,.emoticons-image-wrapper{width:100%}.emoticons-image{padding:5px;border-radius:2px;border:1px solid #f2f2f2;display:block;margin:20px 0}.ne-emoticon{font-family:emoticons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;display:inline-block;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.emoticon{text-indent:-9999px;display:inline-block;height:22px;width:22px;vertical-align:middle}@media all and (-webkit-min-device-pixel-ratio :1),all and (min--moz-device-pixel-ratio :1),all and (-o-min-device-pixel-ratio :1),all and (min-device-pixel-ratio :1),all and (min-resolution :96dpi){.emoticon{background:transparent url(../images/emojis.png) 0 0 no-repeat}}@media all and (-webkit-min-device-pixel-ratio :1.5),all and (-o-min-device-pixel-ratio :3/2),all and (min-device-pixel-ratio :1.5),all and (min-resolution :144dpi){.emoticon{background:transparent url(../images/emojis@2x.png) 0 0 no-repeat;background-size:27776px 22px}}@-moz-document url-prefix(){.emoticon{background:transparent url(../images/emojis.png) 0 0 no-repeat}}.emoticon-bowtie{background-position:-5px 0}.emoticon-smile{background-position:-37px 0}.emoticon-laughing{background-position:-69px 0}.emoticon-blush{background-position:-101px 0}.emoticon-smiley{background-position:-133px 0}.emoticon-relaxed{background-position:-165px 0}.emoticon-smirk{background-position:-197px 0}.emoticon-heart_eyes{background-position:-229px 0}.emoticon-kissing_heart{background-position:-261px 0}.emoticon-kissing_closed_eyes{background-position:-293px 0}.emoticon-flushed{background-position:-325px 0}.emoticon-relieved{background-position:-357px 0}.emoticon-satisfied{background-position:-389px 0}.emoticon-grin{background-position:-421px 0}.emoticon-wink{background-position:-453px 0}.emoticon-stuck_out_tongue_winking_eye{background-position:-485px 0}.emoticon-winky_face{background-position:-485px 0}.emoticon-stuck_out_tongue_closed_eyes{background-position:-517px 0}.emoticon-grinning{background-position:-549px 0}.emoticon-kissing{background-position:-581px 0}.emoticon-kissing_smiling_eyes{background-position:-613px 0}.emoticon-stuck_out_tongue{background-position:-645px 0}.emoticon-sleeping{background-position:-677px 0}.emoticon-worried{background-position:-709px 0}.emoticon-frowning{background-position:-741px 0}.emoticon-anguished{background-position:-773px 0}.emoticon-open_mouth{background-position:-805px 0}.emoticon-wow{background-position:-805px 0}.emoticon-grimacing{background-position:-837px 0}.emoticon-confused{background-position:-869px 0}.emoticon-hushed{background-position:-901px 0}.emoticon-expressionless{background-position:-933px 0}.emoticon-unamused{background-position:-965px 0}.emoticon-sweat_smile{background-position:-997px 0}.emoticon-sweat{background-position:-1029px 0}.emoticon-disappointed_relieved{background-position:-1061px 0}.emoticon-weary{background-position:-1093px 0}.emoticon-pensive{background-position:-1125px 0}.emoticon-disappointed{background-position:-1157px 0}.emoticon-confounded{background-position:-1189px 0}.emoticon-fearful{background-position:-1221px 0}.emoticon-cold_sweat{background-position:-1253px 0}.emoticon-persevere{background-position:-1285px 0}.emoticon-cry{background-position:-1317px 0}.emoticon-sob{background-position:-1349px 0}.emoticon-joy{background-position:-1381px 0}.emoticon-astonished{background-position:-1413px 0}.emoticon-scream{background-position:-1445px 0}.emoticon-neckbeard{background-position:-1477px 0}.emoticon-tired_face{background-position:-1509px 0}.emoticon-angry{background-position:-1541px 0}.emoticon-rage{background-position:-1573px 0}.emoticon-triumph{background-position:-1605px 0}.emoticon-sleepy{background-position:-1637px 0}.emoticon-yum{background-position:-1669px 0}.emoticon-mask{background-position:-1701px 0}.emoticon-sunglasses{background-position:-1733px 0}.emoticon-dizzy_face{background-position:-1765px 0}.emoticon-imp{background-position:-1797px 0}.emoticon-smiling_imp{background-position:-1829px 0}.emoticon-neutral_face{background-position:-1861px 0}.emoticon-no_mouth{background-position:-1893px 0}.emoticon-innocent{background-position:-1925px 0}.emoticon-alien{background-position:-1957px 0}.emoticon-yellow_heart{background-position:-1989px 0}.emoticon-blue_heart{background-position:-2021px 0}.emoticon-purple_heart{background-position:-2053px 0}.emoticon-heart{background-position:-2085px 0}.emoticon-green_heart{background-position:-2117px 0}.emoticon-broken_heart{background-position:-2149px 0}.emoticon-heartbeat{background-position:-2181px 0}.emoticon-heartpulse{background-position:-2213px 0}.emoticon-two_hearts{background-position:-2245px 0}.emoticon-revolving_hearts{background-position:-2277px 0}.emoticon-cupid{background-position:-2309px 0}.emoticon-sparkling_heart{background-position:-2341px 0}.emoticon-sparkles{background-position:-2373px 0}.emoticon-star{background-position:-2405px 0}.emoticon-star2{background-position:-2437px 0}.emoticon-dizzy{background-position:-2469px 0}.emoticon-boom{background-position:-2501px 0}.emoticon-collision{background-position:-2533px 0}.emoticon-anger{background-position:-2565px 0}.emoticon-exclamation{background-position:-2597px 0}.emoticon-question{background-position:-2629px 0}.emoticon-grey_exclamation{background-position:-2661px 0}.emoticon-grey_question{background-position:-2693px 0}.emoticon-zzz{background-position:-2725px 0}.emoticon-dash{background-position:-2757px 0}.emoticon-sweat_drops{background-position:-2789px 0}.emoticon-notes{background-position:-2821px 0}.emoticon-musical_note{background-position:-2853px 0}.emoticon-fire{background-position:-2885px 0}.emoticon-hankey{background-position:-2917px 0}.emoticon-poop{background-position:-2949px 0}.emoticon-shit{background-position:-2981px 0}.emoticon-\+1{background-position:-3013px 0}.emoticon-thumbsup{background-position:-3045px 0}.emoticon-\-1{background-position:-3077px 0}.emoticon-thumbsdown{background-position:-3109px 0}.emoticon-ok_hand{background-position:-3141px 0}.emoticon-punch{background-position:-3173px 0}.emoticon-facepunch{background-position:-3205px 0}.emoticon-fist{background-position:-3237px 0}.emoticon-v{background-position:-3269px 0}.emoticon-wave{background-position:-3301px 0}.emoticon-hand{background-position:-3333px 0}.emoticon-raised_hand{background-position:-3365px 0}.emoticon-open_hands{background-position:-3397px 0}.emoticon-point_up{background-position:-3429px 0}.emoticon-point_down{background-position:-3461px 0}.emoticon-point_left{background-position:-3493px 0}.emoticon-point_right{background-position:-3525px 0}.emoticon-raised_hands{background-position:-3557px 0}.emoticon-pray{background-position:-3589px 0}.emoticon-point_up_2{background-position:-3621px 0}.emoticon-clap{background-position:-3653px 0}.emoticon-muscle{background-position:-3685px 0}.emoticon-metal{background-position:-3717px 0}.emoticon-fu{background-position:-3749px 0}.emoticon-walking{background-position:-3781px 0}.emoticon-runner{background-position:-3813px 0}.emoticon-running{background-position:-3845px 0}.emoticon-couple{background-position:-3877px 0}.emoticon-family{background-position:-3909px 0}.emoticon-two_men_holding_hands{background-position:-3941px 0}.emoticon-two_women_holding_hands{background-position:-3973px 0}.emoticon-dancer{background-position:-4005px 0}.emoticon-dancers{background-position:-4037px 0}.emoticon-ok_woman{background-position:-4069px 0}.emoticon-no_good{background-position:-4101px 0}.emoticon-information_desk_person{background-position:-4133px 0}.emoticon-raising_hand{background-position:-4165px 0}.emoticon-bride_with_veil{background-position:-4197px 0}.emoticon-person_with_pouting_face{background-position:-4229px 0}.emoticon-person_frowning{background-position:-4261px 0}.emoticon-bow{background-position:-4293px 0}.emoticon-couplekiss{background-position:-4325px 0}.emoticon-couple_with_heart{background-position:-4357px 0}.emoticon-massage{background-position:-4389px 0}.emoticon-haircut{background-position:-4421px 0}.emoticon-nail_care{background-position:-4453px 0}.emoticon-boy{background-position:-4485px 0}.emoticon-girl{background-position:-4517px 0}.emoticon-woman{background-position:-4549px 0}.emoticon-man{background-position:-4581px 0}.emoticon-baby{background-position:-4613px 0}.emoticon-older_woman{background-position:-4645px 0}.emoticon-older_man{background-position:-4677px 0}.emoticon-person_with_blond_hair{background-position:-4709px 0}.emoticon-man_with_gua_pi_mao{background-position:-4741px 0}.emoticon-man_with_turban{background-position:-4773px 0}.emoticon-construction_worker{background-position:-4805px 0}.emoticon-cop{background-position:-4837px 0}.emoticon-angel{background-position:-4869px 0}.emoticon-princess{background-position:-4901px 0}.emoticon-emoticon_cat{background-position:-4933px 0}.emoticon-smile_cat{background-position:-4965px 0}.emoticon-heart_eyes_cat{background-position:-4997px 0}.emoticon-kissing_cat{background-position:-5029px 0}.emoticon-smirk_cat{background-position:-5061px 0}.emoticon-scream_cat{background-position:-5093px 0}.emoticon-crying_cat_face{background-position:-5125px 0}.emoticon-joy_cat{background-position:-5157px 0}.emoticon-pouting_cat{background-position:-5189px 0}.emoticon-japanese_ogre{background-position:-5221px 0}.emoticon-japanese_goblin{background-position:-5253px 0}.emoticon-see_no_evil{background-position:-5285px 0}.emoticon-hear_no_evil{background-position:-5317px 0}.emoticon-speak_no_evil{background-position:-5349px 0}.emoticon-guardsman{background-position:-5381px 0}.emoticon-skull{background-position:-5413px 0}.emoticon-feet{background-position:-5445px 0}.emoticon-lips{background-position:-5477px 0}.emoticon-kiss{background-position:-5509px 0}.emoticon-droplet{background-position:-5541px 0}.emoticon-ear{background-position:-5573px 0}.emoticon-eyes{background-position:-5605px 0}.emoticon-nose{background-position:-5637px 0}.emoticon-tongue{background-position:-5669px 0}.emoticon-love_letter{background-position:-5701px 0}.emoticon-bust_in_silhouette{background-position:-5733px 0}.emoticon-busts_in_silhouette{background-position:-5765px 0}.emoticon-speech_balloon{background-position:-5797px 0}.emoticon-thought_balloon{background-position:-5829px 0}.emoticon-feelsgood{background-position:-5861px 0}.emoticon-finnadie{background-position:-5893px 0}.emoticon-goberserk{background-position:-5925px 0}.emoticon-godmode{background-position:-5957px 0}.emoticon-hurtrealbad{background-position:-5989px 0}.emoticon-rage1{background-position:-6021px 0}.emoticon-rage2{background-position:-6053px 0}.emoticon-rage3{background-position:-6085px 0}.emoticon-rage4{background-position:-6117px 0}.emoticon-suspect{background-position:-6149px 0}.emoticon-trollface{background-position:-6181px 0}.emoticon-sunny{background-position:-6213px 0}.emoticon-umbrella{background-position:-6245px 0}.emoticon-cloud{background-position:-6277px 0}.emoticon-snowflake{background-position:-6309px 0}.emoticon-snowman{background-position:-6341px 0}.emoticon-zap{background-position:-6373px 0}.emoticon-cyclone{background-position:-6405px 0}.emoticon-foggy{background-position:-6437px 0}.emoticon-ocean{background-position:-6469px 0}.emoticon-cat{background-position:-6501px 0}.emoticon-dog{background-position:-6533px 0}.emoticon-mouse{background-position:-6565px 0}.emoticon-hamster{background-position:-6597px 0}.emoticon-rabbit{background-position:-6629px 0}.emoticon-wolf{background-position:-6661px 0}.emoticon-frog{background-position:-6693px 0}.emoticon-tiger{background-position:-6725px 0}.emoticon-koala{background-position:-6757px 0}.emoticon-bear{background-position:-6789px 0}.emoticon-pig{background-position:-6821px 0}.emoticon-pig_nose{background-position:-6853px 0}.emoticon-cow{background-position:-6885px 0}.emoticon-boar{background-position:-6917px 0}.emoticon-monkey_face{background-position:-6949px 0}.emoticon-monkey{background-position:-6981px 0}.emoticon-horse{background-position:-7013px 0}.emoticon-racehorse{background-position:-7045px 0}.emoticon-camel{background-position:-7077px 0}.emoticon-sheep{background-position:-7109px 0}.emoticon-elephant{background-position:-7141px 0}.emoticon-panda_face{background-position:-7173px 0}.emoticon-snake{background-position:-7205px 0}.emoticon-bird{background-position:-7237px 0}.emoticon-baby_chick{background-position:-7269px 0}.emoticon-hatched_chick{background-position:-7301px 0}.emoticon-hatching_chick{background-position:-7333px 0}.emoticon-chicken{background-position:-7365px 0}.emoticon-penguin{background-position:-7397px 0}.emoticon-turtle{background-position:-7429px 0}.emoticon-bug{background-position:-7461px 0}.emoticon-honeybee{background-position:-7493px 0}.emoticon-ant{background-position:-7525px 0}.emoticon-beetle{background-position:-7557px 0}.emoticon-snail{background-position:-7589px 0}.emoticon-octopus{background-position:-7621px 0}.emoticon-tropical_fish{background-position:-7653px 0}.emoticon-fish{background-position:-7685px 0}.emoticon-whale{background-position:-7717px 0}.emoticon-whale2{background-position:-7749px 0}.emoticon-dolphin{background-position:-7781px 0}.emoticon-cow2{background-position:-7813px 0}.emoticon-ram{background-position:-7845px 0}.emoticon-rat{background-position:-7877px 0}.emoticon-water_buffalo{background-position:-7909px 0}.emoticon-tiger2{background-position:-7941px 0}.emoticon-rabbit2{background-position:-7973px 0}.emoticon-dragon{background-position:-8005px 0}.emoticon-goat{background-position:-8037px 0}.emoticon-rooster{background-position:-8069px 0}.emoticon-dog2{background-position:-8101px 0}.emoticon-pig2{background-position:-8133px 0}.emoticon-mouse2{background-position:-8165px 0}.emoticon-ox{background-position:-8197px 0}.emoticon-dragon_face{background-position:-8229px 0}.emoticon-blowfish{background-position:-8261px 0}.emoticon-crocodile{background-position:-8293px 0}.emoticon-dromedary_camel{background-position:-8325px 0}.emoticon-leopard{background-position:-8357px 0}.emoticon-cat2{background-position:-8389px 0}.emoticon-poodle{background-position:-8421px 0}.emoticon-paw_prints{background-position:-8453px 0}.emoticon-bouquet{background-position:-8485px 0}.emoticon-cherry_blossom{background-position:-8517px 0}.emoticon-tulip{background-position:-8549px 0}.emoticon-four_leaf_clover{background-position:-8581px 0}.emoticon-rose{background-position:-8613px 0}.emoticon-sunflower{background-position:-8645px 0}.emoticon-hibiscus{background-position:-8677px 0}.emoticon-maple_leaf{background-position:-8709px 0}.emoticon-leaves{background-position:-8741px 0}.emoticon-fallen_leaf{background-position:-8773px 0}.emoticon-herb{background-position:-8805px 0}.emoticon-mushroom{background-position:-8837px 0}.emoticon-cactus{background-position:-8869px 0}.emoticon-palm_tree{background-position:-8901px 0}.emoticon-evergreen_tree{background-position:-8933px 0}.emoticon-deciduous_tree{background-position:-8965px 0}.emoticon-chestnut{background-position:-8997px 0}.emoticon-seedling{background-position:-9029px 0}.emoticon-blossom{background-position:-9061px 0}.emoticon-ear_of_rice{background-position:-9093px 0}.emoticon-shell{background-position:-9125px 0}.emoticon-globe_with_meridians{background-position:-9157px 0}.emoticon-sun_with_face{background-position:-9189px 0}.emoticon-full_moon_with_face{background-position:-9221px 0}.emoticon-new_moon_with_face{background-position:-9253px 0}.emoticon-new_moon{background-position:-9285px 0}.emoticon-waxing_crescent_moon{background-position:-9317px 0}.emoticon-first_quarter_moon{background-position:-9349px 0}.emoticon-waxing_gibbous_moon{background-position:-9381px 0}.emoticon-full_moon{background-position:-9413px 0}.emoticon-waning_gibbous_moon{background-position:-9445px 0}.emoticon-last_quarter_moon{background-position:-9477px 0}.emoticon-waning_crescent_moon{background-position:-9509px 0}.emoticon-last_quarter_moon_with_face{background-position:-9541px 0}.emoticon-first_quarter_moon_with_face{background-position:-9573px 0}.emoticon-moon{background-position:-9605px 0}.emoticon-earth_africa{background-position:-9637px 0}.emoticon-earth_americas{background-position:-9669px 0}.emoticon-earth_asia{background-position:-9701px 0}.emoticon-volcano{background-position:-9733px 0}.emoticon-milky_way{background-position:-9765px 0}.emoticon-partly_sunny{background-position:-9797px 0}.emoticon-octocat{background-position:-9829px 0}.emoticon-squirrel{background-position:-9861px 0}.emoticon-bamboo{background-position:-9893px 0}.emoticon-gift_heart{background-position:-9925px 0}.emoticon-dolls{background-position:-9957px 0}.emoticon-school_satchel{background-position:-9989px 0}.emoticon-mortar_board{background-position:-10021px 0}.emoticon-flags{background-position:-10053px 0}.emoticon-fireworks{background-position:-10085px 0}.emoticon-sparkler{background-position:-10117px 0}.emoticon-wind_chime{background-position:-10149px 0}.emoticon-rice_scene{background-position:-10181px 0}.emoticon-jack_o_lantern{background-position:-10213px 0}.emoticon-ghost{background-position:-10245px 0}.emoticon-santa{background-position:-10277px 0}.emoticon-christmas_tree{background-position:-10309px 0}.emoticon-gift{background-position:-10341px 0}.emoticon-bell{background-position:-10373px 0}.emoticon-no_bell{background-position:-10405px 0}.emoticon-tanabata_tree{background-position:-10437px 0}.emoticon-tada{background-position:-10469px 0}.emoticon-confetti_ball{background-position:-10501px 0}.emoticon-balloon{background-position:-10533px 0}.emoticon-crystal_ball{background-position:-10565px 0}.emoticon-cd{background-position:-10597px 0}.emoticon-dvd{background-position:-10629px 0}.emoticon-floppy_disk{background-position:-10661px 0}.emoticon-camera{background-position:-10693px 0}.emoticon-video_camera{background-position:-10725px 0}.emoticon-movie_camera{background-position:-10757px 0}.emoticon-computer{background-position:-10789px 0}.emoticon-tv{background-position:-10821px 0}.emoticon-iphone{background-position:-10853px 0}.emoticon-phone{background-position:-10885px 0}.emoticon-telephone{background-position:-10917px 0}.emoticon-telephone_receiver{background-position:-10949px 0}.emoticon-pager{background-position:-10981px 0}.emoticon-fax{background-position:-11013px 0}.emoticon-minidisc{background-position:-11045px 0}.emoticon-vhs{background-position:-11077px 0}.emoticon-sound{background-position:-11109px 0}.emoticon-speaker{background-position:-11141px 0}.emoticon-mute{background-position:-11173px 0}.emoticon-loudspeaker{background-position:-11205px 0}.emoticon-mega{background-position:-11237px 0}.emoticon-hourglass{background-position:-11269px 0}.emoticon-hourglass_flowing_sand{background-position:-11301px 0}.emoticon-alarm_clock{background-position:-11333px 0}.emoticon-watch{background-position:-11365px 0}.emoticon-radio{background-position:-11397px 0}.emoticon-satellite{background-position:-11429px 0}.emoticon-loop{background-position:-11461px 0}.emoticon-mag{background-position:-11493px 0}.emoticon-mag_right{background-position:-11525px 0}.emoticon-unlock{background-position:-11557px 0}.emoticon-lock{background-position:-11589px 0}.emoticon-lock_with_ink_pen{background-position:-11621px 0}.emoticon-closed_lock_with_key{background-position:-11653px 0}.emoticon-key{background-position:-11685px 0}.emoticon-bulb{background-position:-11717px 0}.emoticon-flashlight{background-position:-11749px 0}.emoticon-high_brightness{background-position:-11781px 0}.emoticon-low_brightness{background-position:-11813px 0}.emoticon-electric_plug{background-position:-11845px 0}.emoticon-battery{background-position:-11877px 0}.emoticon-calling{background-position:-11909px 0}.emoticon-email{background-position:-11941px 0}.emoticon-mailbox{background-position:-11973px 0}.emoticon-postbox{background-position:-12005px 0}.emoticon-bath{background-position:-12037px 0}.emoticon-bathtub{background-position:-12069px 0}.emoticon-shower{background-position:-12101px 0}.emoticon-toilet{background-position:-12133px 0}.emoticon-wrench{background-position:-12165px 0}.emoticon-nut_and_bolt{background-position:-12197px 0}.emoticon-hammer{background-position:-12229px 0}.emoticon-seat{background-position:-12261px 0}.emoticon-moneybag{background-position:-12293px 0}.emoticon-yen{background-position:-12325px 0}.emoticon-dollar{background-position:-12357px 0}.emoticon-pound{background-position:-12389px 0}.emoticon-euro{background-position:-12421px 0}.emoticon-credit_card{background-position:-12453px 0}.emoticon-money_with_wings{background-position:-12485px 0}.emoticon-e\-mail{background-position:-12517px 0}.emoticon-inbox_tray{background-position:-12549px 0}.emoticon-outbox_tray{background-position:-12581px 0}.emoticon-envelope{background-position:-12613px 0}.emoticon-incoming_envelope{background-position:-12645px 0}.emoticon-postal_horn{background-position:-12677px 0}.emoticon-mailbox_closed{background-position:-12709px 0}.emoticon-mailbox_with_mail{background-position:-12741px 0}.emoticon-mailbox_with_no_mail{background-position:-12773px 0}.emoticon-door{background-position:-12805px 0}.emoticon-smoking{background-position:-12837px 0}.emoticon-bomb{background-position:-12869px 0}.emoticon-gun{background-position:-12901px 0}.emoticon-hocho{background-position:-12933px 0}.emoticon-pill{background-position:-12965px 0}.emoticon-syringe{background-position:-12997px 0}.emoticon-page_facing_up{background-position:-13029px 0}.emoticon-page_with_curl{background-position:-13061px 0}.emoticon-bookmark_tabs{background-position:-13093px 0}.emoticon-bar_chart{background-position:-13125px 0}.emoticon-chart_with_upwards_trend{background-position:-13157px 0}.emoticon-chart_with_downwards_trend{background-position:-13189px 0}.emoticon-scroll{background-position:-13221px 0}.emoticon-clipboard{background-position:-13253px 0}.emoticon-calendar{background-position:-13285px 0}.emoticon-date{background-position:-13317px 0}.emoticon-card_index{background-position:-13349px 0}.emoticon-file_folder{background-position:-13381px 0}.emoticon-open_file_folder{background-position:-13413px 0}.emoticon-scissors{background-position:-13445px 0}.emoticon-pushpin{background-position:-13477px 0}.emoticon-paperclip{background-position:-13509px 0}.emoticon-black_nib{background-position:-13541px 0}.emoticon-pencil2{background-position:-13573px 0}.emoticon-straight_ruler{background-position:-13605px 0}.emoticon-triangular_ruler{background-position:-13637px 0}.emoticon-closed_book{background-position:-13669px 0}.emoticon-green_book{background-position:-13701px 0}.emoticon-blue_book{background-position:-13733px 0}.emoticon-orange_book{background-position:-13765px 0}.emoticon-notebook{background-position:-13797px 0}.emoticon-notebook_with_decorative_cover{background-position:-13829px 0}.emoticon-ledger{background-position:-13861px 0}.emoticon-books{background-position:-13893px 0}.emoticon-bookmark{background-position:-13925px 0}.emoticon-name_badge{background-position:-13957px 0}.emoticon-microscope{background-position:-13989px 0}.emoticon-telescope{background-position:-14021px 0}.emoticon-newspaper{background-position:-14053px 0}.emoticon-football{background-position:-14085px 0}.emoticon-basketball{background-position:-14117px 0}.emoticon-soccer{background-position:-14149px 0}.emoticon-baseball{background-position:-14181px 0}.emoticon-tennis{background-position:-14213px 0}.emoticon-8ball{background-position:-14245px 0}.emoticon-rugby_football{background-position:-14277px 0}.emoticon-bowling{background-position:-14309px 0}.emoticon-golf{background-position:-14341px 0}.emoticon-mountain_bicyclist{background-position:-14373px 0}.emoticon-bicyclist{background-position:-14405px 0}.emoticon-horse_racing{background-position:-14437px 0}.emoticon-snowboarder{background-position:-14469px 0}.emoticon-swimmer{background-position:-14501px 0}.emoticon-surfer{background-position:-14533px 0}.emoticon-ski{background-position:-14565px 0}.emoticon-spades{background-position:-14597px 0}.emoticon-hearts{background-position:-14629px 0}.emoticon-clubs{background-position:-14661px 0}.emoticon-diamonds{background-position:-14693px 0}.emoticon-gem{background-position:-14725px 0}.emoticon-ring{background-position:-14757px 0}.emoticon-trophy{background-position:-14789px 0}.emoticon-musical_score{background-position:-14821px 0}.emoticon-musical_keyboard{background-position:-14853px 0}.emoticon-violin{background-position:-14885px 0}.emoticon-space_invader{background-position:-14917px 0}.emoticon-video_game{background-position:-14949px 0}.emoticon-black_joker{background-position:-14981px 0}.emoticon-flower_playing_cards{background-position:-15013px 0}.emoticon-game_die{background-position:-15045px 0}.emoticon-dart{background-position:-15077px 0}.emoticon-mahjong{background-position:-15109px 0}.emoticon-clapper{background-position:-15141px 0}.emoticon-memo{background-position:-15173px 0}.emoticon-pencil{background-position:-15205px 0}.emoticon-book{background-position:-15237px 0}.emoticon-art{background-position:-15269px 0}.emoticon-microphone{background-position:-15301px 0}.emoticon-headphones{background-position:-15333px 0}.emoticon-trumpet{background-position:-15365px 0}.emoticon-saxophone{background-position:-15397px 0}.emoticon-guitar{background-position:-15429px 0}.emoticon-shoe{background-position:-15461px 0}.emoticon-sandal{background-position:-15493px 0}.emoticon-high_heel{background-position:-15525px 0}.emoticon-lipstick{background-position:-15557px 0}.emoticon-boot{background-position:-15589px 0}.emoticon-shirt{background-position:-15621px 0}.emoticon-tshirt{background-position:-15653px 0}.emoticon-necktie{background-position:-15685px 0}.emoticon-womans_clothes{background-position:-15717px 0}.emoticon-dress{background-position:-15749px 0}.emoticon-running_shirt_with_sash{background-position:-15781px 0}.emoticon-jeans{background-position:-15813px 0}.emoticon-kimono{background-position:-15845px 0}.emoticon-bikini{background-position:-15877px 0}.emoticon-ribbon{background-position:-15909px 0}.emoticon-tophat{background-position:-15941px 0}.emoticon-crown{background-position:-15973px 0}.emoticon-womans_hat{background-position:-16005px 0}.emoticon-mans_shoe{background-position:-16037px 0}.emoticon-closed_umbrella{background-position:-16069px 0}.emoticon-briefcase{background-position:-16101px 0}.emoticon-handbag{background-position:-16133px 0}.emoticon-pouch{background-position:-16165px 0}.emoticon-purse{background-position:-16197px 0}.emoticon-eyeglasses{background-position:-16229px 0}.emoticon-fishing_pole_and_fish{background-position:-16261px 0}.emoticon-coffee{background-position:-16293px 0}.emoticon-tea{background-position:-16325px 0}.emoticon-sake{background-position:-16357px 0}.emoticon-baby_bottle{background-position:-16389px 0}.emoticon-beer{background-position:-16421px 0}.emoticon-beers{background-position:-16453px 0}.emoticon-cocktail{background-position:-16485px 0}.emoticon-tropical_drink{background-position:-16517px 0}.emoticon-wine_glass{background-position:-16549px 0}.emoticon-fork_and_knife{background-position:-16581px 0}.emoticon-pizza{background-position:-16613px 0}.emoticon-hamburger{background-position:-16645px 0}.emoticon-fries{background-position:-16677px 0}.emoticon-poultry_leg{background-position:-16709px 0}.emoticon-meat_on_bone{background-position:-16741px 0}.emoticon-spaghetti{background-position:-16773px 0}.emoticon-curry{background-position:-16805px 0}.emoticon-fried_shrimp{background-position:-16837px 0}.emoticon-bento{background-position:-16869px 0}.emoticon-sushi{background-position:-16901px 0}.emoticon-fish_cake{background-position:-16933px 0}.emoticon-rice_ball{background-position:-16965px 0}.emoticon-rice_cracker{background-position:-16997px 0}.emoticon-rice{background-position:-17029px 0}.emoticon-ramen{background-position:-17061px 0}.emoticon-stew{background-position:-17093px 0}.emoticon-oden{background-position:-17125px 0}.emoticon-dango{background-position:-17157px 0}.emoticon-egg{background-position:-17189px 0}.emoticon-bread{background-position:-17221px 0}.emoticon-doughnut{background-position:-17253px 0}.emoticon-custard{background-position:-17285px 0}.emoticon-icecream{background-position:-17317px 0}.emoticon-ice_cream{background-position:-17349px 0}.emoticon-shaved_ice{background-position:-17381px 0}.emoticon-birthday{background-position:-17413px 0}.emoticon-cake{background-position:-17445px 0}.emoticon-cookie{background-position:-17477px 0}.emoticon-chocolate_bar{background-position:-17509px 0}.emoticon-candy{background-position:-17541px 0}.emoticon-lollipop{background-position:-17573px 0}.emoticon-honey_pot{background-position:-17605px 0}.emoticon-apple{background-position:-17637px 0}.emoticon-green_apple{background-position:-17669px 0}.emoticon-tangerine{background-position:-17701px 0}.emoticon-lemon{background-position:-17733px 0}.emoticon-cherries{background-position:-17765px 0}.emoticon-grapes{background-position:-17797px 0}.emoticon-watermelon{background-position:-17829px 0}.emoticon-strawberry{background-position:-17861px 0}.emoticon-peach{background-position:-17893px 0}.emoticon-melon{background-position:-17925px 0}.emoticon-banana{background-position:-17957px 0}.emoticon-pear{background-position:-17989px 0}.emoticon-pineapple{background-position:-18021px 0}.emoticon-sweet_potato{background-position:-18053px 0}.emoticon-eggplant{background-position:-18085px 0}.emoticon-tomato{background-position:-18117px 0}.emoticon-corn{background-position:-18149px 0}.emoticon-house{background-position:-18181px 0}.emoticon-house_with_garden{background-position:-18213px 0}.emoticon-school{background-position:-18245px 0}.emoticon-office{background-position:-18277px 0}.emoticon-post_office{background-position:-18309px 0}.emoticon-hospital{background-position:-18341px 0}.emoticon-bank{background-position:-18373px 0}.emoticon-convenience_store{background-position:-18405px 0}.emoticon-love_hotel{background-position:-18437px 0}.emoticon-hotel{background-position:-18469px 0}.emoticon-wedding{background-position:-18501px 0}.emoticon-church{background-position:-18533px 0}.emoticon-department_store{background-position:-18565px 0}.emoticon-european_post_office{background-position:-18597px 0}.emoticon-city_sunrise{background-position:-18629px 0}.emoticon-city_sunset{background-position:-18661px 0}.emoticon-japanese_castle{background-position:-18693px 0}.emoticon-european_castle{background-position:-18725px 0}.emoticon-tent{background-position:-18757px 0}.emoticon-factory{background-position:-18789px 0}.emoticon-tokyo_tower{background-position:-18821px 0}.emoticon-japan{background-position:-18853px 0}.emoticon-mount_fuji{background-position:-18885px 0}.emoticon-sunrise_over_mountains{background-position:-18917px 0}.emoticon-sunrise{background-position:-18949px 0}.emoticon-stars{background-position:-18981px 0}.emoticon-themoreyouknow{background-position:-18981px 0}.emoticon-tmyk{background-position:-18981px 0}.emoticon-statue_of_liberty{background-position:-19013px 0}.emoticon-bridge_at_night{background-position:-19045px 0}.emoticon-carousel_horse{background-position:-19077px 0}.emoticon-rainbow{background-position:-19109px 0}.emoticon-ferris_wheel{background-position:-19141px 0}.emoticon-fountain{background-position:-19173px 0}.emoticon-roller_coaster{background-position:-19205px 0}.emoticon-ship{background-position:-19237px 0}.emoticon-speedboat{background-position:-19269px 0}.emoticon-boat{background-position:-19301px 0}.emoticon-sailboat{background-position:-19333px 0}.emoticon-rowboat{background-position:-19365px 0}.emoticon-anchor{background-position:-19397px 0}.emoticon-rocket{background-position:-19429px 0}.emoticon-airplane{background-position:-19461px 0}.emoticon-helicopter{background-position:-19493px 0}.emoticon-steam_locomotive{background-position:-19525px 0}.emoticon-tram{background-position:-19557px 0}.emoticon-mountain_railway{background-position:-19589px 0}.emoticon-bike{background-position:-19621px 0}.emoticon-aerial_tramway{background-position:-19653px 0}.emoticon-suspension_railway{background-position:-19685px 0}.emoticon-mountain_cableway{background-position:-19717px 0}.emoticon-tractor{background-position:-19749px 0}.emoticon-blue_car{background-position:-19781px 0}.emoticon-oncoming_automobile{background-position:-19813px 0}.emoticon-car{background-position:-19845px 0}.emoticon-red_car{background-position:-19877px 0}.emoticon-taxi{background-position:-19909px 0}.emoticon-oncoming_taxi{background-position:-19941px 0}.emoticon-articulated_lorry{background-position:-19973px 0}.emoticon-bus{background-position:-20005px 0}.emoticon-oncoming_bus{background-position:-20037px 0}.emoticon-rotating_light{background-position:-20069px 0}.emoticon-police_car{background-position:-20101px 0}.emoticon-oncoming_police_car{background-position:-20133px 0}.emoticon-fire_engine{background-position:-20165px 0}.emoticon-ambulance{background-position:-20197px 0}.emoticon-minibus{background-position:-20229px 0}.emoticon-truck{background-position:-20261px 0}.emoticon-train{background-position:-20293px 0}.emoticon-station{background-position:-20325px 0}.emoticon-train2{background-position:-20357px 0}.emoticon-bullettrain_front{background-position:-20389px 0}.emoticon-bullettrain_side{background-position:-20421px 0}.emoticon-light_rail{background-position:-20453px 0}.emoticon-monorail{background-position:-20485px 0}.emoticon-railway_car{background-position:-20517px 0}.emoticon-trolleybus{background-position:-20549px 0}.emoticon-ticket{background-position:-20581px 0}.emoticon-fuelpump{background-position:-20613px 0}.emoticon-vertical_traffic_light{background-position:-20645px 0}.emoticon-traffic_light{background-position:-20677px 0}.emoticon-warning{background-position:-20709px 0}.emoticon-construction{background-position:-20741px 0}.emoticon-beginner{background-position:-20773px 0}.emoticon-atm{background-position:-20805px 0}.emoticon-slot_machine{background-position:-20837px 0}.emoticon-busstop{background-position:-20869px 0}.emoticon-barber{background-position:-20901px 0}.emoticon-hotsprings{background-position:-20933px 0}.emoticon-checkered_flag{background-position:-20965px 0}.emoticon-crossed_flags{background-position:-20997px 0}.emoticon-izakaya_lantern{background-position:-21029px 0}.emoticon-moyai{background-position:-21061px 0}.emoticon-circus_tent{background-position:-21093px 0}.emoticon-performing_arts{background-position:-21125px 0}.emoticon-round_pushpin{background-position:-21157px 0}.emoticon-triangular_flag_on_post{background-position:-21189px 0}.emoticon-jp{background-position:-21221px 0}.emoticon-kr{background-position:-21253px 0}.emoticon-cn{background-position:-21285px 0}.emoticon-us{background-position:-21317px 0}.emoticon-fr{background-position:-21349px 0}.emoticon-es{background-position:-21381px 0}.emoticon-it{background-position:-21413px 0}.emoticon-ru{background-position:-21445px 0}.emoticon-gb{background-position:-21477px 0}.emoticon-uk{background-position:-21509px 0}.emoticon-de{background-position:-21541px 0}.emoticon-one{background-position:-21573px 0}.emoticon-two{background-position:-21605px 0}.emoticon-three{background-position:-21637px 0}.emoticon-four{background-position:-21669px 0}.emoticon-five{background-position:-21701px 0}.emoticon-six{background-position:-21733px 0}.emoticon-seven{background-position:-21765px 0}.emoticon-eight{background-position:-21797px 0}.emoticon-nine{background-position:-21829px 0}.emoticon-keycap_ten{background-position:-21861px 0}.emoticon-1234{background-position:-21893px 0}.emoticon-zero{background-position:-21925px 0}.emoticon-hash{background-position:-21957px 0}.emoticon-symbols{background-position:-21989px 0}.emoticon-arrow_backward{background-position:-22021px 0}.emoticon-arrow_down{background-position:-22053px 0}.emoticon-arrow_forward{background-position:-22085px 0}.emoticon-arrow_left{background-position:-22117px 0}.emoticon-capital_abcd{background-position:-22149px 0}.emoticon-abcd{background-position:-22181px 0}.emoticon-abc{background-position:-22213px 0}.emoticon-arrow_lower_left{background-position:-22245px 0}.emoticon-arrow_lower_right{background-position:-22277px 0}.emoticon-arrow_right{background-position:-22309px 0}.emoticon-arrow_up{background-position:-22341px 0}.emoticon-arrow_upper_left{background-position:-22373px 0}.emoticon-arrow_upper_right{background-position:-22405px 0}.emoticon-arrow_double_down{background-position:-22437px 0}.emoticon-arrow_double_up{background-position:-22469px 0}.emoticon-arrow_down_small{background-position:-22501px 0}.emoticon-arrow_heading_down{background-position:-22533px 0}.emoticon-arrow_heading_up{background-position:-22565px 0}.emoticon-leftwards_arrow_with_hook{background-position:-22597px 0}.emoticon-arrow_right_hook{background-position:-22629px 0}.emoticon-left_right_arrow{background-position:-22661px 0}.emoticon-arrow_up_down{background-position:-22693px 0}.emoticon-arrow_up_small{background-position:-22725px 0}.emoticon-arrows_clockwise{background-position:-22757px 0}.emoticon-arrows_counterclockwise{background-position:-22789px 0}.emoticon-rewind{background-position:-22821px 0}.emoticon-fast_forward{background-position:-22853px 0}.emoticon-information_source{background-position:-22885px 0}.emoticon-ok{background-position:-22917px 0}.emoticon-twisted_rightwards_arrows{background-position:-22949px 0}.emoticon-repeat{background-position:-22981px 0}.emoticon-repeat_one{background-position:-23013px 0}.emoticon-new{background-position:-23045px 0}.emoticon-top{background-position:-23077px 0}.emoticon-up{background-position:-23109px 0}.emoticon-cool{background-position:-23141px 0}.emoticon-free{background-position:-23173px 0}.emoticon-ng{background-position:-23205px 0}.emoticon-cinema{background-position:-23237px 0}.emoticon-koko{background-position:-23269px 0}.emoticon-signal_strength{background-position:-23301px 0}.emoticon-u5272{background-position:-23333px 0}.emoticon-u5408{background-position:-23365px 0}.emoticon-u55b6{background-position:-23397px 0}.emoticon-u6307{background-position:-23429px 0}.emoticon-u6708{background-position:-23461px 0}.emoticon-u6709{background-position:-23493px 0}.emoticon-u6e80{background-position:-23525px 0}.emoticon-u7121{background-position:-23557px 0}.emoticon-u7533{background-position:-23589px 0}.emoticon-u7a7a{background-position:-23621px 0}.emoticon-u7981{background-position:-23653px 0}.emoticon-sa{background-position:-23685px 0}.emoticon-restroom{background-position:-23717px 0}.emoticon-mens{background-position:-23749px 0}.emoticon-womens{background-position:-23781px 0}.emoticon-baby_symbol{background-position:-23813px 0}.emoticon-no_smoking{background-position:-23845px 0}.emoticon-parking{background-position:-23877px 0}.emoticon-wheelchair{background-position:-23909px 0}.emoticon-metro{background-position:-23941px 0}.emoticon-baggage_claim{background-position:-23973px 0}.emoticon-accept{background-position:-24005px 0}.emoticon-wc{background-position:-24037px 0}.emoticon-potable_water{background-position:-24069px 0}.emoticon-put_litter_in_its_place{background-position:-24101px 0}.emoticon-secret{background-position:-24133px 0}.emoticon-congratulations{background-position:-24165px 0}.emoticon-m{background-position:-24197px 0}.emoticon-passport_control{background-position:-24229px 0}.emoticon-left_luggage{background-position:-24261px 0}.emoticon-customs{background-position:-24293px 0}.emoticon-ideograph_advantage{background-position:-24325px 0}.emoticon-cl{background-position:-24357px 0}.emoticon-sos{background-position:-24389px 0}.emoticon-id{background-position:-24421px 0}.emoticon-no_entry_sign{background-position:-24453px 0}.emoticon-underage{background-position:-24485px 0}.emoticon-no_mobile_phones{background-position:-24517px 0}.emoticon-do_not_litter{background-position:-24549px 0}.emoticon-non\-potable_water{background-position:-24581px 0}.emoticon-no_bicycles{background-position:-24613px 0}.emoticon-no_pedestrians{background-position:-24645px 0}.emoticon-children_crossing{background-position:-24677px 0}.emoticon-no_entry{background-position:-24709px 0}.emoticon-eight_spoked_asterisk{background-position:-24741px 0}.emoticon-eight_pointed_black_star{background-position:-24773px 0}.emoticon-heart_decoration{background-position:-24805px 0}.emoticon-vs{background-position:-24837px 0}.emoticon-vibration_mode{background-position:-24869px 0}.emoticon-mobile_phone_off{background-position:-24901px 0}.emoticon-chart{background-position:-24933px 0}.emoticon-currency_exchange{background-position:-24965px 0}.emoticon-aries{background-position:-24997px 0}.emoticon-taurus{background-position:-25029px 0}.emoticon-gemini{background-position:-25061px 0}.emoticon-cancer{background-position:-25093px 0}.emoticon-leo{background-position:-25125px 0}.emoticon-virgo{background-position:-25157px 0}.emoticon-libra{background-position:-25189px 0}.emoticon-scorpius{background-position:-25221px 0}.emoticon-sagittarius{background-position:-25253px 0}.emoticon-capricorn{background-position:-25285px 0}.emoticon-aquarius{background-position:-25317px 0}.emoticon-pisces{background-position:-25349px 0}.emoticon-ophiuchus{background-position:-25381px 0}.emoticon-six_pointed_star{background-position:-25413px 0}.emoticon-negative_squared_cross_mark{background-position:-25445px 0}.emoticon-a{background-position:-25477px 0}.emoticon-b{background-position:-25509px 0}.emoticon-ab{background-position:-25541px 0}.emoticon-o2{background-position:-25573px 0}.emoticon-diamond_shape_with_a_dot_inside{background-position:-25605px 0}.emoticon-recycle{background-position:-25637px 0}.emoticon-end{background-position:-25669px 0}.emoticon-on{background-position:-25701px 0}.emoticon-soon{background-position:-25733px 0}.emoticon-clock1{background-position:-25765px 0}.emoticon-clock130{background-position:-25797px 0}.emoticon-clock10{background-position:-25829px 0}.emoticon-clock1030{background-position:-25861px 0}.emoticon-clock11{background-position:-25893px 0}.emoticon-clock1130{background-position:-25925px 0}.emoticon-clock12{background-position:-25957px 0}.emoticon-clock1230{background-position:-25989px 0}.emoticon-clock2{background-position:-26021px 0}.emoticon-clock230{background-position:-26053px 0}.emoticon-clock3{background-position:-26085px 0}.emoticon-clock330{background-position:-26117px 0}.emoticon-clock4{background-position:-26149px 0}.emoticon-clock430{background-position:-26181px 0}.emoticon-clock5{background-position:-26213px 0}.emoticon-clock530{background-position:-26245px 0}.emoticon-clock6{background-position:-26277px 0}.emoticon-clock630{background-position:-26309px 0}.emoticon-clock7{background-position:-26341px 0}.emoticon-clock730{background-position:-26373px 0}.emoticon-clock8{background-position:-26405px 0}.emoticon-clock830{background-position:-26437px 0}.emoticon-clock9{background-position:-26469px 0}.emoticon-clock930{background-position:-26501px 0}.emoticon-heavy_dollar_sign{background-position:-26533px 0}.emoticon-copyright{background-position:-26565px 0}.emoticon-registered{background-position:-26597px 0}.emoticon-tm{background-position:-26629px 0}.emoticon-x{background-position:-26661px 0}.emoticon-heavy_exclamation_mark{background-position:-26693px 0}.emoticon-bangbang{background-position:-26725px 0}.emoticon-interrobang{background-position:-26757px 0}.emoticon-o{background-position:-26789px 0}.emoticon-heavy_multiplication_x{background-position:-26821px 0}.emoticon-heavy_plus_sign{background-position:-26853px 0}.emoticon-heavy_minus_sign{background-position:-26885px 0}.emoticon-heavy_division_sign{background-position:-26917px 0}.emoticon-white_flower{background-position:-26949px 0}.emoticon-100{background-position:-26981px 0}.emoticon-heavy_check_mark{background-position:-27013px 0}.emoticon-ballot_box_with_check{background-position:-27045px 0}.emoticon-radio_button{background-position:-27077px 0}.emoticon-link{background-position:-27109px 0}.emoticon-curly_loop{background-position:-27141px 0}.emoticon-wavy_dash{background-position:-27173px 0}.emoticon-part_alternation_mark{background-position:-27205px 0}.emoticon-trident{background-position:-27237px 0}.emoticon-black_large_square{background-position:-27269px 0}.emoticon-white_large_square{background-position:-27301px 0}.emoticon-white_check_mark{background-position:-27333px 0}.emoticon-black_square{background-position:-27268px 0}.emoticon-white_square{background-position:-27301px 0}.emoticon-black_square_button{background-position:-27365px 0}.emoticon-white_square_button{background-position:-27397px 0}.emoticon-black_circle{background-position:-27429px 0}.emoticon-white_circle{background-position:-27461px 0}.emoticon-red_circle{background-position:-27493px 0}.emoticon-large_blue_circle{background-position:-27525px 0}.emoticon-large_blue_diamond{background-position:-27557px 0}.emoticon-large_orange_diamond{background-position:-27589px 0}.emoticon-small_blue_diamond{background-position:-27621px 0}.emoticon-small_orange_diamond{background-position:-27653px 0}.emoticon-small_red_triangle{background-position:-27685px 0}.emoticon-small_red_triangle_down{background-position:-27717px 0}.emoticon-shipit{background-position:-27749px 0}md-expansion-panel{background:#fff}md-expansion-panel .md-expansion-panel-footer-container,md-expansion-panel .md-expansion-panel-header-container,md-expansion-panel md-expansion-panel-collapsed{background:#fff}md-expansion-panel .md-expansion-panel-footer-container .md-summary,md-expansion-panel .md-expansion-panel-footer-container .md-title,md-expansion-panel .md-expansion-panel-header-container .md-summary,md-expansion-panel .md-expansion-panel-header-container .md-title,md-expansion-panel md-expansion-panel-collapsed .md-summary,md-expansion-panel md-expansion-panel-collapsed .md-title{color:#333}md-expansion-panel md-expansion-panel-footer .md-expansion-panel-footer-container,md-expansion-panel md-expansion-panel-header .md-expansion-panel-header-container{border-color:#ddd}md-expansion-panel .md-expansion-panel-icon svg{fill:#999}md-expansion-panel[disabled] md-expansion-panel-collapsed .md-summary,md-expansion-panel[disabled] md-expansion-panel-collapsed .md-title{color:#ddd}md-expansion-panel[disabled] .md-expansion-panel-icon svg{fill:#ddd}md-expansion-panel:not(.md-open):not([disabled]):focus,md-expansion-panel:not(.md-open):not([disabled]):focus md-expansion-panel-collapsed{background:#eee}.layout-padding>md-expansion-panel-group{padding:0}md-expansion-panel{display:block;position:relative;outline:0;margin-top:0;margin-bottom:0;padding:0;box-shadow:0 -1px 0 #e5e5e5,0 0 2px rgba(0,0,0,.12),0 2px 4px rgba(0,0,0,.24)}md-expansion-panel.md-open{margin-top:16px;margin-bottom:16px}md-expansion-panel.md-open:first-of-type{margin-top:0}md-expansion-panel.md-close{overflow:hidden}md-expansion-panel:not(.md-no-animation).md-open{-webkit-transition:margin-top .12s cubic-bezier(.25,.8,.25,1),margin-bottom .12s cubic-bezier(.25,.8,.25,1);transition:margin-top .12s cubic-bezier(.25,.8,.25,1),margin-bottom .12s cubic-bezier(.25,.8,.25,1)}md-expansion-panel:not(.md-no-animation).md-close{-webkit-transition:margin-top 80ms cubic-bezier(.25,.8,.25,1),margin-bottom 80ms cubic-bezier(.25,.8,.25,1);transition:margin-top 80ms cubic-bezier(.25,.8,.25,1),margin-bottom 80ms cubic-bezier(.25,.8,.25,1)}md-expansion-panel-collapsed .md-title,md-expansion-panel-header .md-title{-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:16px;font-weight:600;min-width:80px;max-width:184px;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:nowrap}md-expansion-panel-collapsed .md-summary,md-expansion-panel-header .md-summary{-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:13px;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:nowrap}md-expansion-panel md-expansion-panel-collapsed{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:48px;line-height:48px;padding:0 24px;opacity:1;z-index:2;box-sizing:border-box}md-expansion-panel md-expansion-panel-collapsed.md-absolute{position:absolute}md-expansion-panel md-expansion-panel-collapsed.md-hide{opacity:0}md-expansion-panel:not(.md-no-animation) md-expansion-panel-collapsed.md-show{-webkit-transition:opacity 30ms linear;transition:opacity 30ms linear}md-expansion-panel:not(.md-no-animation) md-expansion-panel-collapsed.md-hide{-webkit-transition:opacity .1s cubic-bezier(.25,.8,.25,1);transition:opacity .1s cubic-bezier(.25,.8,.25,1)}md-expansion-panel md-expansion-panel-expanded{display:none;min-height:48px}md-expansion-panel md-expansion-panel-expanded.md-hide,md-expansion-panel md-expansion-panel-expanded.md-show{display:block}md-expansion-panel md-expansion-panel-expanded.md-scroll-y{overflow-y:auto}md-expansion-panel md-expansion-panel-expanded.md-overflow{overflow:hidden}md-expansion-panel md-expansion-panel-expanded md-expansion-panel-content{display:block;padding:16px 24px}md-expansion-panel:not(.md-no-animation) md-expansion-panel-expanded.md-show{-webkit-transition:max-height .12s cubic-bezier(.25,.8,.25,1),opacity .12s cubic-bezier(.25,.8,.25,1);transition:max-height .12s cubic-bezier(.25,.8,.25,1),opacity .12s cubic-bezier(.25,.8,.25,1)}md-expansion-panel:not(.md-no-animation) md-expansion-panel-expanded.md-hide{-webkit-transition:max-height 60ms cubic-bezier(.25,.8,.25,1),opacity 60ms cubic-bezier(.25,.8,.25,1);transition:max-height 60ms cubic-bezier(.25,.8,.25,1),opacity 60ms cubic-bezier(.25,.8,.25,1)}md-expansion-panel-header{display:block;position:relative;outline:0}md-expansion-panel-header .md-expansion-panel-header-container{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:48px;line-height:48px;padding:0 24px;box-sizing:border-box;border-bottom:1px solid;-webkit-box-align:center;-ms-flex-align:center;align-items:center}md-expansion-panel-header.md-stick .md-expansion-panel-header-container{position:fixed;z-index:2;-webkit-animation:panelBodyHeaderStickyHoverIn .3s ease-out both;animation:panelBodyHeaderStickyHoverIn .3s ease-out both}md-expansion-panel-header.md-no-stick .md-expansion-panel-header-container{-webkit-animation:panelBodyHeaderStickyHoverOut .3s ease-out both;animation:panelBodyHeaderStickyHoverOut .3s ease-out both}md-expansion-panel-footer{display:block;position:relative}md-expansion-panel-footer.md-hide,md-expansion-panel-footer.md-show{display:block}md-expansion-panel-footer .md-expansion-panel-footer-container{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:48px;line-height:48px;padding:0 24px;border-top:1px solid;box-sizing:border-box}md-expansion-panel-footer.md-stick .md-expansion-panel-footer-container{position:fixed;z-index:2}md-expansion-panel:not(.md-no-animation) .md-expansion-panel-icon{-webkit-transition:-webkit-transform .6s cubic-bezier(.25,.8,.25,1);transition:-webkit-transform .6s cubic-bezier(.25,.8,.25,1);transition:transform .6s cubic-bezier(.25,.8,.25,1);transition:transform .6s cubic-bezier(.25,.8,.25,1),-webkit-transform .6s cubic-bezier(.25,.8,.25,1)}md-expansion-panel .md-expansion-panel-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg)}md-expansion-panel .md-expansion-panel-icon:first-child{margin-right:18px}md-expansion-panel.md-open>md-expansion-panel-expanded>md-expansion-panel-header .md-expansion-panel-header-container .md-expansion-panel-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}md-expansion-panel.md-open>md-expansion-panel.md-open>md-expansion-panel-collapsed .md-expansion-panel-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@-webkit-keyframes panelBodyHeaderStickyHoverIn{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}}@keyframes panelBodyHeaderStickyHoverIn{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}}@-webkit-keyframes panelBodyHeaderStickyHoverOut{0%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}100%{box-shadow:0 0 0 0 transparent}}@keyframes panelBodyHeaderStickyHoverOut{0%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}100%{box-shadow:0 0 0 0 transparent}}.main-view .content .builder,.main-view .content .json,.main-view .content .view{border-right:1px solid #ccc;height:800px;overflow:auto}.builder-icon{line-height:0}.builder-icon,form-item .form-item-container .md-button,form-item .option-item .md-button{min-height:36px;min-width:36px;height:36px;width:36px}form-item .form-item-container .md-button{line-height:0}form-item .option-item{min-height:75px}form-item .option-item .md-button{line-height:0;margin-top:20px}form-item .option-item .md-button.handle:active,form-item .option-item .md-button.handle:hover{cursor:move}form-item .form-item-container{position:relative;padding-top:30px}form-item .form-item-container .form-item-actions{position:absolute;right:20px;top:0}form-view .formItem-content,form-view .formItem-title{font-size:18px}form-view .formItem-help-text{font-size:14px;color:#6c6c6c}form-view .matrix-container{overflow:auto}form-view .matrix-container .matrix .matrix-row{border-bottom:1px solid #4caf50}form-view .matrix-container .matrix .matrix-cell{text-align:center;overflow:hidden}form-view .matrix-container .matrix md-radio-button .md-label{margin-left:0;margin-right:0}form-view .matrix-container .matrix .md-switch-thumb,form-view .matrix-container .matrix md-radio-button{margin:15px 0}i.material-icons{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}i.material-icons.medium{font-size:36px}[md-color-picker] .md-color-picker-input-container,md-color-picker .md-color-picker-input-container{position:relative}[md-color-picker] .md-color-picker-input-container .md-color-picker-input::-ms-clear,md-color-picker .md-color-picker-input-container .md-color-picker-input::-ms-clear{display:none}[md-color-picker] .md-color-picker-input-container .md-color-picker-preview,md-color-picker .md-color-picker-input-container .md-color-picker-preview{content:'';width:24px;height:24px;border:2px solid #fff;border-radius:50%;box-shadow:0 3px 1px -2px rgba(0,0,0,.14),0 2px 2px 0 rgba(0,0,0,.098),0 1px 5px 0 rgba(0,0,0,.084);position:relative;top:22px;overflow:hidden;background-color:#fff;background-image:-webkit-linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd),-webkit-linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd);background-image:linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd),linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd);background-size:8px 8px;background-position:0 0,4px 4px}[md-color-picker] .md-color-picker-input-container .md-color-picker-preview .md-color-picker-result,md-color-picker .md-color-picker-input-container .md-color-picker-preview .md-color-picker-result{width:100%;height:100%}[md-color-picker] .md-color-picker-input-container .md-color-picker-clear,md-color-picker .md-color-picker-input-container .md-color-picker-clear{position:absolute;bottom:42px;right:-16px;color:rgba(0,0,0,.26)}.md-color-picker-container{padding:8px;background:#fff;outline:0;height:397px;width:347px;opacity:1;overflow:hidden;z-index:1000}.md-color-picker-container .md-color-picker-arrow{border:0 solid transparent;border-right-width:30px;border-bottom-width:0;position:absolute;left:0;top:0;-webkit-transition:border-bottom-width cubic-bezier(.25,.8,.25,1) .25s,top cubic-bezier(.25,.8,.25,1) .25s;transition:border-bottom-width cubic-bezier(.25,.8,.25,1) .25s,top cubic-bezier(.25,.8,.25,1) .25s}.md-color-picker-container canvas{width:100%;height:100%}.md-color-picker-container .md-color-picker-preview{-webkit-box-flex:1;-ms-flex:1;flex:1;font-weight:700;font-size:18px;color:#fff;margin:-8px -8px 0;position:relative}.md-color-picker-container .md-color-picker-preview .md-color-picker-result{position:absolute;height:100%;opacity:1;background:red}.md-color-picker-container .md-color-picker-preview .md-color-picker-result>input{position:relative;top:-15px;opacity:0}.md-color-picker-container .md-color-picker-preview .md-color-picker-result>div{position:relative;width:100%}.md-color-picker-container .md-color-picker-preview .md-color-picker-result>div>input{border-width:0;background:0 0;text-align:center;position:absolute;top:-15px;bottom:0;left:0;right:0;color:#eee;outline:0;opacity:0}.md-color-picker-container .md-color-picker-preview .md-color-picker-result>div>input.switch{-webkit-transition:top cubic-bezier(.25,.8,.25,1) .25s,.25s opacity ease-out;transition:top cubic-bezier(.25,.8,.25,1) .25s,.25s opacity ease-out;top:0;opacity:1}.md-color-picker-container .md-color-picker-preview .md-color-picker-tabs .md-tab,.md-color-picker-container .md-color-picker-preview .md-color-picker-tabs md-pagination-wrapper,.md-color-picker-container .md-color-picker-preview .md-color-picker-tabs md-tabs-canvas,.md-color-picker-container .md-color-picker-preview .md-color-picker-tabs md-tabs-wrapper{max-height:28px;height:28px}.md-color-picker-container .md-color-picker-preview .md-color-picker-tabs md-ink-bar{background:rgba(255,255,255,.5)}.md-color-picker-container .md-color-picker-preview .md-color-picker-tabs .md-tab{padding-top:2px;background:rgba(255,255,255,.25);color:#eee;max-width:none!important}.md-color-picker-container .md-color-picker-preview .md-color-picker-tabs .md-tab.md-active{background:0 0}.md-color-picker-container .md-color-picker-preview.dark{color:#333}.md-color-picker-container .md-color-picker-preview.dark .md-color-picker-preview-input{color:#333}.md-color-picker-container .md-color-picker-preview.dark .md-tab{background:rgba(0,0,0,.25);color:#333}.md-color-picker-container .md-color-picker-preview.dark .md-tab.md-active{background:0 0}.md-color-picker-container .md-color-picker-preview.dark md-ink-bar{background:rgba(0,0,0,.5)}.md-color-picker-container .md-color-picker-tabs{margin:0 -8px 0}.md-color-picker-container .md-color-picker-tabs md-tabs[md-align-tabs=bottom]{padding-bottom:0}.md-color-picker-container .md-color-picker-tabs .md-tab,.md-color-picker-container .md-color-picker-tabs md-pagination-wrapper,.md-color-picker-container .md-color-picker-tabs md-tabs-canvas,.md-color-picker-container .md-color-picker-tabs md-tabs-wrapper{max-height:36px;height:36px}.md-color-picker-container .md-color-picker-tabs .md-tab{padding:7px 24px;background:0 0}.md-color-picker-container .md-color-picker-tabs .md-tab:last-of-type{margin-right:-2px}.md-color-picker-container .md-color-picker-tabs md-tabs:not(.md-no-tab-content):not(.md-dynamic-height){min-height:298px}.md-color-picker-container .md-color-picker-tabs md-tabs:not(.md-no-tab-content):not(.md-dynamic-height) md-tabs-content-wrapper{height:255px;margin-bottom:8px}.md-color-picker-container .md-color-picker-tabs md-tabs:not(.md-no-tab-content):not(.md-dynamic-height) md-tabs-content-wrapper md-tab-content{height:255px;padding:0 8px 0}.md-color-picker-container .md-color-picker-tabs md-tabs:not(.md-no-tab-content):not(.md-dynamic-height) md-tabs-content-wrapper md-tab-content [md-tabs-template]{height:100%}.md-color-picker-container .md-color-picker-tabs.md-color-picker-colors{margin:8px -8px -8px}.md-color-picker-container .md-color-picker-tabs.md-color-picker-colors md-ink-bar{top:auto}.md-color-picker-container .md-color-picker-tabs.md-color-picker-colors .md-tab{background:rgba(0,0,0,.075)}.md-color-picker-container .md-color-picker-tabs.md-color-picker-colors .md-tab.md-active{background:#fff}.md-color-picker-container .md-color-picker-colors{overflow:hidden;margin-top:8px}.md-color-picker-container .md-color-picker-colors .md-color-picker-marker{position:absolute;border:2px solid #fff;box-shadow:0 0 2px 0 rgba(0,0,0,.5)}.md-color-picker-container .md-color-picker-colors [md-color-picker-spectrum]{position:relative;cursor:crosshair;overflow:hidden;height:255px;width:255px}.md-color-picker-container .md-color-picker-colors [md-color-picker-spectrum] .md-color-picker-marker{width:12px;height:12px;border-radius:50%;box-shadow:0 0 2px 0 rgba(0,0,0,.5),inset 0 0 2px 0 rgba(0,0,0,.5);top:-5px;left:calc(100% - 5px)}.md-color-picker-container .md-color-picker-colors [md-color-picker-alpha],.md-color-picker-container .md-color-picker-colors [md-color-picker-hue]{position:relative;cursor:crosshair;overflow:hidden;width:30px}.md-color-picker-container .md-color-picker-colors [md-color-picker-alpha].md-color-picker-wide,.md-color-picker-container .md-color-picker-colors [md-color-picker-hue].md-color-picker-wide{width:67px}.md-color-picker-container .md-color-picker-colors [md-color-picker-alpha] .md-color-picker-marker,.md-color-picker-container .md-color-picker-colors [md-color-picker-hue] .md-color-picker-marker{height:5px;width:100%;border-left:0;border-right:0;top:-2px;left:0}.md-color-picker-container .md-color-picker-sliders md-slider.red-slider .md-track-fill{background:#d01515}.md-color-picker-container .md-color-picker-sliders md-slider.red-slider .md-thumb:after{background-color:#d01515;border-color:#d01515}.md-color-picker-container .md-color-picker-sliders md-slider.green-slider .md-track-fill{background:#19d015}.md-color-picker-container .md-color-picker-sliders md-slider.green-slider .md-thumb:after{background-color:#19d015;border-color:#19d015}.md-color-picker-container .md-color-picker-sliders md-slider.blue-slider .md-track-fill{background:#1560d0}.md-color-picker-container .md-color-picker-sliders md-slider.blue-slider .md-thumb:after{background-color:#1560d0;border-color:#1560d0}.md-color-picker-container .md-color-picker-material-palette .md-color-picker-material-title{font-size:22px;line-height:75px;padding:0 15px;color:rgba(0,0,0,.85);text-transform:capitalize}.md-color-picker-container .md-color-picker-material-palette .md-color-picker-material-title.dark{color:rgba(255,255,255,.85)}.md-color-picker-container .md-color-picker-material-palette .md-color-picker-material-title:not(:first-child){margin-top:16px}.md-color-picker-container .md-color-picker-material-palette .md-color-picker-with-label{font-size:12px;line-height:33px;padding:0 5px;color:rgba(0,0,0,.7)}.md-color-picker-container .md-color-picker-material-palette .md-color-picker-with-label.dark{color:rgba(255,255,255,.7)}.md-color-picker-container .md-color-picker-material-palette .md-color-picker-material-colors{position:absolute;-webkit-transition:left cubic-bezier(.25,.8,.25,1) .25s,right cubic-bezier(.25,.8,.25,1) .25s,top cubic-bezier(.25,.8,.25,1) .25s,bottom cubic-bezier(.25,.8,.25,1) .25s;transition:left cubic-bezier(.25,.8,.25,1) .25s,right cubic-bezier(.25,.8,.25,1) .25s,top cubic-bezier(.25,.8,.25,1) .25s,bottom cubic-bezier(.25,.8,.25,1) .25s}.md-color-picker-container .md-color-picker-history>div>div{height:20px;margin:4px;background-color:#fff;background-image:-webkit-linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd),-webkit-linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd);background-image:linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd),linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd);background-size:8px 8px;background-position:0 0,4px 4px}.md-color-picker-container .md-color-picker-history>div>div>div{width:100%;height:100%}.md-color-picker-container .md-color-picker-history button{margin-top:auto;margin-left:auto}.md-color-picker-checkered-bg{background-color:#fff;background-image:-webkit-linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd),-webkit-linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd);background-image:linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd),linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%,#ddd);background-size:8px 8px;background-position:0 0,4px 4px}.emojione{font-size:inherit;height:3ex;width:3.1ex;min-height:20px;min-width:20px;display:inline-block;margin:-.2ex .15em .2ex;line-height:normal;vertical-align:middle}img.emojione{width:auto}.dropdown-menu.textcomplete-dropdown[data-strategy=emojionearea]{position:absolute;z-index:1000;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;-moz-box-shadow:0 6px 12px rgba(0,0,0,.175);-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.textcomplete-dropdown[data-strategy=emojionearea] li.textcomplete-item{font-size:14px;padding:1px 3px;border:0}.dropdown-menu.textcomplete-dropdown[data-strategy=emojionearea] li.textcomplete-item a{text-decoration:none;display:block;height:100%;line-height:1.8em;padding:0 1.54em 0 .615em;color:#4f4f4f}.dropdown-menu.textcomplete-dropdown[data-strategy=emojionearea] li.textcomplete-item.active,.dropdown-menu.textcomplete-dropdown[data-strategy=emojionearea] li.textcomplete-item:hover{background-color:#e4e4e4}.dropdown-menu.textcomplete-dropdown[data-strategy=emojionearea] li.textcomplete-item.active a,.dropdown-menu.textcomplete-dropdown[data-strategy=emojionearea] li.textcomplete-item:hover a{color:#333}.dropdown-menu.textcomplete-dropdown[data-strategy=emojionearea] li.textcomplete-item .emojioneemoji{font-size:inherit;height:2ex;width:2.1ex;min-height:20px;min-width:20px;display:inline-block;margin:0 5px .2ex 0;line-height:normal;vertical-align:middle;max-width:100%;top:0}.emojionearea-text .emojioneemoji,.emojionearea-text [class*=emojione-]{font-size:inherit;height:2ex;width:2.1ex;min-height:20px;min-width:20px;display:inline-block;margin:-.2ex .15em .2ex;line-height:normal;vertical-align:middle;max-width:100%;top:0}.emojionearea,.emojionearea *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.emojionearea.emojionearea-disable{position:relative;background-color:#eee;-moz-user-select:-moz-none;-ms-user-select:none;-webkit-user-select:none;user-select:none}.emojionearea.emojionearea-disable:before{content:"";display:block;top:0;left:0;right:0;bottom:0;z-index:1;opacity:.3;position:absolute;background-color:#eee}.emojionearea,.emojionearea.form-control{display:block;position:relative!important;width:100%;height:auto;padding:0;font-size:14px;background-color:#fff;border:1px solid #ccc;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-transition:border-color .15s ease-in-out,-moz-box-shadow .15s ease-in-out;-o-transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.emojionearea.focused{border-color:#66afe9;outline:0;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.emojionearea .emojionearea-editor{display:block;height:auto;min-height:8em;max-height:15em;overflow:auto;padding:6px 24px 6px 12px;line-height:1.42857143;font-size:inherit;color:#555;background-color:transparent;border:0;cursor:text;margin-right:1px;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.emojionearea .emojionearea-editor:empty:before{content:attr(placeholder);display:block;color:#bbb}.emojionearea .emojionearea-editor:focus{border:0;outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.emojionearea .emojionearea-editor .emojioneemoji,.emojionearea .emojionearea-editor [class*=emojione-]{font-size:inherit;height:2ex;width:2.1ex;min-height:20px;min-width:20px;display:inline-block;margin:-.2ex .15em .2ex;line-height:normal;vertical-align:middle;max-width:100%;top:0}.emojionearea.emojionearea-inline{height:34px}.emojionearea.emojionearea-inline>.emojionearea-editor{height:32px;min-height:20px;overflow:hidden;white-space:nowrap;position:absolute;top:0;left:12px;right:24px;padding:6px 0}.emojionearea.emojionearea-inline>.emojionearea-button{top:4px}.emojionearea .emojionearea-button{z-index:5;position:absolute;right:3px;top:3px;width:24px;height:24px;opacity:.6;cursor:pointer;-moz-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;-webkit-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.emojionearea .emojionearea-button:hover{opacity:1}.emojionearea .emojionearea-button>div{display:block;width:24px;height:24px;position:absolute;-moz-transition:all .4s ease-in-out;-o-transition:all .4s ease-in-out;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.emojionearea .emojionearea-button>div.emojionearea-button-open{background-position:0 -24px;opacity:1}.emojionearea .emojionearea-button>div.emojionearea-button-close{background-position:0 0;-webkit-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg);opacity:0}.emojionearea .emojionearea-button.active>div.emojionearea-button-open{-webkit-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg);opacity:0}.emojionearea .emojionearea-button.active>div.emojionearea-button-close{-webkit-transform:rotate(0);-o-transform:rotate(0);transform:rotate(0);opacity:1}.emojionearea .emojionearea-picker{background:#fff;position:absolute;-moz-box-shadow:0 1px 5px rgba(0,0,0,.32);-webkit-box-shadow:0 1px 5px rgba(0,0,0,.32);box-shadow:0 1px 5px rgba(0,0,0,.32);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;height:276px;width:316px;top:-15px;right:-15px;z-index:90;-moz-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;-webkit-transition:all .25s ease-in-out;transition:all .25s ease-in-out;opacity:0;-moz-user-select:-moz-none;-ms-user-select:none;-webkit-user-select:none;user-select:none}.emojionearea .emojionearea-picker.hidden{display:none}.emojionearea .emojionearea-picker .emojionearea-wrapper{position:relative;height:276px;width:316px}.emojionearea .emojionearea-picker .emojionearea-wrapper:after{content:"";display:block;position:absolute;background-repeat:no-repeat;z-index:91}.emojionearea .emojionearea-picker .emojionearea-filters{width:100%;position:absolute;z-index:95;background:#f5f7f9;padding:0 0 0 7px;height:40px}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter{display:block;float:left;height:40px;width:32px;padding:7px 1px 0;cursor:pointer;-webkit-filter:grayscale(1);filter:grayscale(1)}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter.active{background:#fff}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter.active,.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter:hover{-webkit-filter:grayscale(0);filter:grayscale(0)}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter>i{width:24px;height:24px;top:0}.emojionearea .emojionearea-picker .emojionearea-filters .emojionearea-filter>img{width:24px;height:24px;margin:0 3px}.emojionearea .emojionearea-picker .emojionearea-search-panel{height:30px;position:absolute;z-index:95;top:40px;left:0;right:0;padding:5px 0 5px 8px}.emojionearea .emojionearea-picker .emojionearea-search-panel .emojionearea-tones{float:right;margin-right:10px;margin-top:-1px}.emojionearea .emojionearea-picker .emojionearea-tones-panel .emojionearea-tones{position:absolute;top:4px;left:171px}.emojionearea .emojionearea-picker .emojionearea-search{float:left;padding:0;height:20px;width:160px}.emojionearea .emojionearea-picker .emojionearea-search>input{outline:0;width:160px;min-width:160px;height:20px}.emojionearea .emojionearea-picker .emojionearea-tones{padding:0;width:120px;height:20px}.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone{display:inline-block;padding:0;border:0;vertical-align:middle;outline:0;background:0 0;cursor:pointer;position:relative}.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-0,.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-0:after{background-color:#ffcf3e}.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-1,.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-1:after{background-color:#fae3c5}.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-2,.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-2:after{background-color:#e2cfa5}.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-3,.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-3:after{background-color:#daa478}.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-4,.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-4:after{background-color:#a78058}.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-5,.emojionearea .emojionearea-picker .emojionearea-tones>.btn-tone.btn-tone-5:after{background-color:#5e4d43}.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-bullet>.btn-tone,.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-square>.btn-tone{width:20px;height:20px;margin:0;background-color:transparent}.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-bullet>.btn-tone:after,.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-square>.btn-tone:after{content:"";position:absolute;display:block;top:4px;left:4px;width:12px;height:12px}.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-bullet>.btn-tone.active:after,.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-square>.btn-tone.active:after{top:0;left:0;width:20px;height:20px}.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-checkbox>.btn-tone,.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-radio>.btn-tone{width:16px;height:16px;margin:0 2px}.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-checkbox>.btn-tone.active:after,.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-radio>.btn-tone.active:after{content:"";position:absolute;display:block;background-color:transparent;border:2px solid #fff;width:8px;height:8px;top:2px;left:2px;box-sizing:initial}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block:after,.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block:before,.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block>.emojionearea-category:after,.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block>.emojionearea-category:before,.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-title:after,.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-title:before{content:" ";clear:both;display:block}.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-bullet>.btn-tone,.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-bullet>.btn-tone:after,.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-radio>.btn-tone,.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-radio>.btn-tone:after{-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%}.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-checkbox>.btn-tone,.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-checkbox>.btn-tone:after,.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-square>.btn-tone,.emojionearea .emojionearea-picker .emojionearea-tones.emojionearea-tones-square>.btn-tone:after{-moz-border-radius:1px;-webkit-border-radius:1px;border-radius:1px}.emojionearea .emojionearea-picker .emojionearea-scroll-area{height:236px;overflow:auto;overflow-x:hidden;width:100%;position:absolute;padding:0 0 5px}.emojionearea .emojionearea-picker .emojionearea-search-panel+.emojionearea-scroll-area{height:206px}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-emojis-list{z-index:1}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-title{display:block;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;font-size:13px;font-weight:400;color:#b2b2b2;background:#fff;line-height:20px;margin:0;padding:7px 0 5px 6px}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block{padding:0 0 0 7px}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojionearea-category-block>.emojionearea-category{padding:0!important}.emojionearea .emojionearea-picker .emojionearea-scroll-area [class*=emojione-]{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;margin:0;width:24px;height:24px;top:0}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojibtn{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;width:24px;height:24px;float:left;display:block;margin:1px;padding:3px}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojibtn:hover{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;background-color:#e4e4e4;cursor:pointer}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojibtn i,.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojibtn img{float:left;display:block;width:24px;height:24px}.emojionearea .emojionearea-picker .emojionearea-scroll-area .emojibtn img.lazy-emoji{opacity:0}.emojionearea .emojionearea-picker.emojionearea-filters-position-top .emojionearea-filters{top:0;-moz-border-radius-topleft:5px;-webkit-border-top-left-radius:5px;border-top-left-radius:5px;-moz-border-radius-topright:5px;-webkit-border-top-right-radius:5px;border-top-right-radius:5px}.emojionearea .emojionearea-picker.emojionearea-filters-position-top.emojionearea-search-position-top .emojionearea-scroll-area{bottom:0}.emojionearea .emojionearea-picker.emojionearea-filters-position-top.emojionearea-search-position-bottom .emojionearea-scroll-area{top:40px}.emojionearea .emojionearea-picker.emojionearea-filters-position-top.emojionearea-search-position-bottom .emojionearea-search-panel{top:initial;bottom:0}.emojionearea .emojionearea-picker.emojionearea-filters-position-bottom .emojionearea-filters{bottom:0;-moz-border-radius-bottomleft:5px;-webkit-border-bottom-left-radius:5px;border-bottom-left-radius:5px;-moz-border-radius-bottomright:5px;-webkit-border-bottom-right-radius:5px;border-bottom-right-radius:5px}.emojionearea .emojionearea-picker.emojionearea-filters-position-bottom.emojionearea-search-position-bottom .emojionearea-scroll-area{top:0}.emojionearea .emojionearea-picker.emojionearea-filters-position-bottom.emojionearea-search-position-bottom .emojionearea-search-panel,.emojionearea .emojionearea-picker.emojionearea-filters-position-bottom.emojionearea-search-position-top .emojionearea-scroll-area{top:initial;bottom:40px}.emojionearea .emojionearea-picker.emojionearea-filters-position-bottom.emojionearea-search-position-top .emojionearea-search-panel{top:0}.emojionearea .emojionearea-picker.emojionearea-picker-position-top{margin-top:-286px;right:-14px}.emojionearea .emojionearea-picker.emojionearea-picker-position-top .emojionearea-wrapper:after{width:19px;height:10px;background-position:-2px -49px;bottom:-10px;right:20px}.emojionearea .emojionearea-picker.emojionearea-picker-position-top.emojionearea-filters-position-bottom .emojionearea-wrapper:after{background-position:-2px -80px}.emojionearea .emojionearea-picker.emojionearea-picker-position-left,.emojionearea .emojionearea-picker.emojionearea-picker-position-right{margin-right:-326px;top:-8px}.emojionearea .emojionearea-picker.emojionearea-picker-position-left .emojionearea-wrapper:after,.emojionearea .emojionearea-picker.emojionearea-picker-position-right .emojionearea-wrapper:after{width:10px;height:19px;background-position:0 -60px;top:13px;left:-10px}.emojionearea .emojionearea-picker.emojionearea-picker-position-left.emojionearea-filters-position-bottom .emojionearea-wrapper:after,.emojionearea .emojionearea-picker.emojionearea-picker-position-right.emojionearea-filters-position-bottom .emojionearea-wrapper:after{background-position:right -60px}.emojionearea .emojionearea-picker.emojionearea-picker-position-bottom{margin-top:10px;right:-14px;top:47px}.emojionearea .emojionearea-picker.emojionearea-picker-position-bottom .emojionearea-wrapper:after{width:19px;height:10px;background-position:-2px -100px;top:-10px;right:20px}.emojionearea .emojionearea-picker.emojionearea-picker-position-bottom.emojionearea-filters-position-bottom .emojionearea-wrapper:after{background-position:-2px -90px}.emojionearea .emojionearea-button.active+.emojionearea-picker{opacity:1}.emojionearea .emojionearea-button.active+.emojionearea-picker-position-top{margin-top:-269px}.emojionearea .emojionearea-button.active+.emojionearea-picker-position-left,.emojionearea .emojionearea-button.active+.emojionearea-picker-position-right{margin-right:-309px}.emojionearea .emojionearea-button.active+.emojionearea-picker-position-bottom{margin-top:-7px}.emojionearea.emojionearea-standalone{display:inline-block;width:auto;box-shadow:none}.emojionearea.emojionearea-standalone .emojionearea-editor{min-height:33px;position:relative;padding:6px 42px 6px 6px}.emojionearea.emojionearea-standalone .emojionearea-editor::before{content:"";position:absolute;top:4px;left:50%;bottom:4px;border-left:1px solid #e6e6e6}.emojionearea.emojionearea-standalone .emojionearea-editor.has-placeholder .emojioneemoji{opacity:.4}.emojionearea.emojionearea-standalone .emojionearea-button{top:0;right:0;bottom:0;left:0;width:auto;height:auto}.emojionearea.emojionearea-standalone .emojionearea-button>div{right:6px;top:5px}.emojionearea.emojionearea-standalone .emojionearea-picker.emojionearea-picker-position-bottom .emojionearea-wrapper:after,.emojionearea.emojionearea-standalone .emojionearea-picker.emojionearea-picker-position-top .emojionearea-wrapper:after{right:23px}.emojionearea.emojionearea-standalone .emojionearea-picker.emojionearea-picker-position-left .emojionearea-wrapper:after,.emojionearea.emojionearea-standalone .emojionearea-picker.emojionearea-picker-position-right .emojionearea-wrapper:after{top:15px}.emojionearea .emojionearea-button>div,.emojionearea .emojionearea-picker .emojionearea-wrapper:after{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAABuCAYAAADMB4ipAAAHfElEQVRo3u1XS1NT2Rb+9uOcQF4YlAJzLymFUHaLrdxKULvEUNpdTnRqD532f+AHMLMc94gqR1Zbt8rBnUh3YXipPGKwRDoWgXvrYiFUlEdIkPPYZ/dAkwox5yQCVt/bzRrBPnt9e+211/etFeDQDu3ArL+/X37OeqmRWoH7+vpItfWawStF1tfXR+zW9xW5ne0p8loOcAKuCdwpRft60C8a+X5zTvebCqcAvmidf1GGHtqhHdpf1qqKzsrKipyensbi4iKWl5cBAMFgEG1tbYhGo2hpadlbmxseHpaDg4MAgI6ODng8HgBAPp/H/Pw8AODatWvo7e2tvUHrui7v3r2L+fl5XL58GVeuXIHH49m1N5/Py0ePHmF0dBQdHR24desWVFXdtYdXAn/48CHm5+dx8+ZNRKPRigEUDpuenpb3799H4YaOnWh5eVmOj48jFoshGo0STdPkwMCAXF5elqV7BgYGpKZpMhqNklgshrGxMbx580Y6gicSCTDGEIvFAADpdBqpVArJZLK4J5lMIpVKIZ1OAwBisRgYY0gkEs6Rp1IphMNh+Hw+AgCGYQAANE0r7in8Xfjm8/lIOBzGq1evnMHX19fR1NRU/D8UCoFzjnA4XFwLh8PgnCMUChXXmpqakM1mUfVBS62xsZHk83lZWi1nz579ZA0AhBDO4A0NDchkMsWSJIRAURRiVy26rktVVUkmk0EgEHAGP3XqFKamppDP56Vpmrhz5w5u374t/X4/OP+w3TRNZLNZ6LoO0zSRz+dlf38/Ll686Jzz8+fPQwiBeDwOt9tNrl+/jkwmU6yaQpVkMhncuHEDbrebxONxCCEQiUScIw8Gg+TBgwdyZGQEyWRSdnV1kVQqJYeGhrC6ugrGGEKhEHp7e3Hy5EmSTCblvXv30NPTg2AwSA6M/vF4HCMjI7b0/yzh8vv9AIBsNrt34aokuQsLC7skt729varkHtqftUFf++FHsrq0QN3eBvp68Tfvf9Mv12oFCYU7G//e9nVuO7dpNbe2W4M//yQr0p8yRvyBo1Zr++lwLcCt7afD/sBRizJGavrB1dDYYh47Htrq+Kb7jBNwxzfdZ44dD201NLaYVUkU7ozQpuAJBkARwnRZpunN5zaa5hJjiXLH05GeiMd7JEM5zzHGNQBGZvk/Iv0yYVWMvK0zKk1Dl6ahW5RQobjqdjy+wEZn9PKF0n2d0csXPL7AhuKq26GECtPQLdPQZVtn1LlB69p7yRVVSEiDEGJwRd12e4+8PR3piRQidnuPvOWKuk0IMSSkwRVV6Np7WVVbSqvGsgSnlKkAFNPQXdrOtuKqcxtcUTUAhmUJnVJmlleJo3CVHmAaOlPUOmYJkxFKibQsSRkXhr4juKIKO2BHVSwcoLrqCVdUYho6K3YYRRWmoUtdey/tgKtK7rUffiQAsLq08MnbNLe2WwBgB/zHzueFyD8nwlIfbvdx8eU0WV1aKD1cVAMs9+F2j9gUPEEKemEJIe3AnXy4XfkBoNKSZHNthWfX31EA69VKttyHVyIOY1wRwmS6tqNsrr31vXo5k/bUu4gT2cp9lhbm0rzCJpeUUrE0vS63+c7/6uXMbDUWl/ssLczNFrVFddUT09AZpUy1LKvO0DVfPrfR9HxqfNbuEe185l9MFX3o6tIC5YpKFLWOfdQQ93Zu49j0+FDCDtjOp1yaOQCYhs4Y40wI05XfWj8yPT40Ua2ey33mEmMTtp2IUEq0nW3FKeJPGPjRp1Iz2QUuLUu66txG9NLVSK3gBZ+C1lcE54oqKOOCK6rm8QU2unu+u1ANuNynvFsBAG1ubbdMQ5eGviMAFDuP0w3sfMpvQEtb24fOQncU1bXl8R7JnOu+ZNv97XxKJwY6+PNPsrm13drObVqUMlMIU5OWpVHOc96Go5lTnV2fzC/VfAozD7HTCa6olBBa1Imlhbmq2lLuQ5xaW6nCPfnln0Yt7bDUhzhps8cfKH5//uTXmvS81OeLdqI/ZoROzSZrHqG/OvOPzxuhK5VgJTvV2bW3EdqJRABwrvvS/kfoSkoZvXT1YEbociHr7vnuYEfogpBFL109HKH/h0fomnXg3Lff79r7/MmvVbWG7gX4QObzc99+Tz7mHKah05KcW6ahQ9feS6cbMCdgt7eBWJagjCuUAC5tZzuouuo0Spm0hElc9R4cbf4bVl8v1p6WUmCuqEwIs34ruxaeeTy4uJVd67As08UVlVmWoG5vA7FLG3WMmHEupVTyW+vh2cn4DADMTsaTuc21LiGEhzHOnQ6gNtMrJSBMCKHkNt999WLi0S7hejEZH81n174WpukiIMw0dKq66p3Bw50RwhUVXFGJKUy28Xal48VkfKrSlWenhsc23q2cEB9SR7iiItwZIbbgHn8AlDFCCMW7laXjqZnHjkNpaubJzNuVpWZCKChjxOMPVH/QlaW0f/G3ZLqWWl6ce/bvlddp7yFD/w8Z+njoX1+GoZMjgzMAMDkyeLAMnRh+uKveJ0YGD4ahEyODFRk6OfrL/hj67GnckaHPng7vjaGzyYmaGDr77KktQ38H8tqx8Wja+WIAAAAASUVORK5CYII=)!important}.emojionearea.emojionearea-standalone .emojionearea-editor.has-placeholder{background-repeat:no-repeat;background-position:20px 4px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAABlBMVEUAAAC/v79T5hyIAAAAAXRSTlMAQObYZgAAABNJREFUCNdjYGNgQEb/P4AQqiAASiUEG6Vit44AAAAASUVORK5CYII=)!important}md-date-range{cursor:pointer}md-date-range-picker{display:block;max-width:664px}md-date-range-picker .md-date-range-picker__one-panel{display:block;max-width:340px}.md-date-range-picker [event-key] *{pointer-events:none}.md-date-range-picker{position:relative;background:#fff}.md-date-range-picker__title{text-align:center;font-size:1rem;background:#106cc8;color:#fff;margin:0;padding:16px 0}.md-date-range-picker__month-year{text-align:center;font-size:1rem;background:#eee;margin:0;padding:0 0}.md-date-range-picker__month-year .md-select-icon{display:none}.md-date-range-picker__month-year md-select{margin:10px 0}.md-date-range-picker__templates{background:#eee}.md-date-range-picker__calendar-wrapper{padding:0 0;width:308px;min-width:308px}.md-date-range-picker__week{background:#e0e0e0}.md-date-range-picker__calendar__grid{font-size:13px;color:#222;padding:0;display:inline-block;width:44px;height:44px;line-height:44px;text-align:center;position:relative;outline:0;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:50%;background:rgba(2550,255,255,0)}.md-date-range-picker__calendar .md-date-range-picker__calendar__grid{cursor:pointer}.md-date-range-picker__calendar__not-in-active-month{color:rgba(0,0,0,.5)}.md-date-range-picker__calendar .md-date-range-picker__calendar__grid:hover:not(.md-date-range-picker__calendar__selected):not(.md-date-range-picker__calendar__disabled){transition:background .3s ease-out;background:rgba(0,0,0,.1)}.md-date-range-picker__calendar__selected{background:#106cc8;color:#fff;border-radius:0}.md-date-range-picker__calendar__selected.md-date-range-picker__calendar__disabled{background:rgba(0,0,0,.2)}.md-date-range-picker__calendar__not-in-active-month.md-date-range-picker__calendar__selected{color:rgba(255,255,255,.2)}.md-date-range-picker__calendar__today{font-weight:700}.md-date-range-picker__calendar .md-date-range-picker__calendar__grid.md-date-range-picker__calendar__disabled{opacity:.3;cursor:not-allowed}.md-date-range-picker__calendar__start{border-top-left-radius:50%;border-bottom-left-radius:50%}.md-date-range-picker__calendar__end{border-top-right-radius:50%;border-bottom-right-radius:50%}.md-date-range-picker__select{z-index:100}.md-date-range-picker__calendar__selection{pointer-events:none}.angucomplete-holder{position:relative}.angucomplete-dropdown{border-color:#ececec;border-width:1px;border-style:solid;border-radius:2px;width:250px;padding:6px;cursor:pointer;z-index:9999;position:absolute;margin-top:-6px;background-color:#fff}.angucomplete-searching{color:#acacac;font-size:14px}.angucomplete-description{font-size:14px}.angucomplete-row{padding:5px;color:#000;margin-bottom:4px;clear:both}.angucomplete-selected-row{background-color:#add8e6;color:#fff}.angucomplete-image-holder{padding-top:2px;float:left;margin-right:10px;margin-left:5px}.angucomplete-image{height:34px;width:34px;border-radius:50%;border-color:#ececec;border-style:solid;border-width:1px}.angucomplete-image-default{background-position:center;background-size:contain;height:34px;width:34px}/*! - * Font Awesome Free 5.11.1 by @fontawesome - https://fontawesome.com + * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) */.fa,.fab,.fad,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atlassian:before{content:"\f77b"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before{content:"\f77d"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-bacon:before{content:"\f7e5"}.fa-balance-scale:before{content:"\f24e"}.fa-balance-scale-left:before{content:"\f515"}.fa-balance-scale-right:before{content:"\f516"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-battle-net:before{content:"\f835"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bible:before{content:"\f647"}.fa-bicycle:before{content:"\f206"}.fa-biking:before{content:"\f84a"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blind:before{content:"\f29d"}.fa-blog:before{content:"\f781"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bootstrap:before{content:"\f836"}.fa-border-all:before{content:"\f84c"}.fa-border-none:before{content:"\f850"}.fa-border-style:before{content:"\f853"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-bread-slice:before{content:"\f7ec"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-buffer:before{content:"\f837"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-business-time:before{content:"\f64a"}.fa-buy-n-large:before{content:"\f8a6"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-calendar-week:before{content:"\f784"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-campground:before{content:"\f6bb"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-chromecast:before{content:"\f838"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-city:before{content:"\f64f"}.fa-clinic-medical:before{content:"\f7f2"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-compress-arrows-alt:before{content:"\f78c"}.fa-concierge-bell:before{content:"\f562"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-cotton-bureau:before{content:"\f89e"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-credit-card:before{content:"\f09d"}.fa-critical-role:before{content:"\f6c9"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-democrat:before{content:"\f747"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dharmachakra:before{content:"\f655"}.fa-dhl:before{content:"\f790"}.fa-diagnoses:before{content:"\f470"}.fa-diaspora:before{content:"\f791"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-ethernet:before{content:"\f796"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-evernote:before{content:"\f839"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fan:before{content:"\f863"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-figma:before{content:"\f799"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-alt:before{content:"\f7e4"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-fist-raised:before{content:"\f6de"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-funnel-dollar:before{content:"\f662"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-git:before{content:"\f1d3"}.fa-git-alt:before{content:"\f841"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-cheers:before{content:"\f79f"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glass-whiskey:before{content:"\f7a0"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-globe-europe:before{content:"\f7a2"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guitar:before{content:"\f7a6"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hamburger:before{content:"\f805"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-handshake:before{content:"\f2b5"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-hat:before{content:"\f807"}.fa-hashtag:before{content:"\f292"}.fa-hat-cowboy:before{content:"\f8c0"}.fa-hat-cowboy-side:before{content:"\f8c1"}.fa-hat-wizard:before{content:"\f6e8"}.fa-haykal:before{content:"\f666"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-broken:before{content:"\f7a9"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hiking:before{content:"\f6ec"}.fa-hippo:before{content:"\f6ed"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-house-damage:before{content:"\f6f1"}.fa-houzz:before{content:"\f27c"}.fa-hryvnia:before{content:"\f6f2"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-icons:before{content:"\f86d"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itch-io:before{content:"\f83a"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi:before{content:"\f669"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-journal-whills:before{content:"\f66a"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaaba:before{content:"\f66b"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-khanda:before{content:"\f66d"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-landmark:before{content:"\f66f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-medical:before{content:"\f812"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mail-bulk:before{content:"\f674"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mask:before{content:"\f6fa"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-mdb:before{content:"\f8ca"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mendeley:before{content:"\f7b3"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-meteor:before{content:"\f753"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mitten:before{content:"\f7b5"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-motorcycle:before{content:"\f21c"}.fa-mountain:before{content:"\f6fc"}.fa-mouse:before{content:"\f8cc"}.fa-mouse-pointer:before{content:"\f245"}.fa-mug-hot:before{content:"\f7b6"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-om:before{content:"\f679"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-orcid:before{content:"\f8d2"}.fa-osi:before{content:"\f41a"}.fa-otter:before{content:"\f700"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-pager:before{content:"\f815"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-pastafarianism:before{content:"\f67b"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-penny-arcade:before{content:"\f704"}.fa-people-carry:before{content:"\f4ce"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-person-booth:before{content:"\f756"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-alt:before{content:"\f879"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-square-alt:before{content:"\f87b"}.fa-phone-volume:before{content:"\f2a0"}.fa-photo-video:before{content:"\f87c"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poll:before{content:"\f681"}.fa-poll-h:before{content:"\f682"}.fa-poo:before{content:"\f2fe"}.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-pray:before{content:"\f683"}.fa-praying-hands:before{content:"\f684"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-quran:before{content:"\f687"}.fa-r-project:before{content:"\f4f7"}.fa-radiation:before{content:"\f7b9"}.fa-radiation-alt:before{content:"\f7ba"}.fa-rainbow:before{content:"\f75b"}.fa-random:before{content:"\f074"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-record-vinyl:before{content:"\f8d9"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redhat:before{content:"\f7bc"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-remove-format:before{content:"\f87d"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-republican:before{content:"\f75e"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-running:before{content:"\f70c"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-salesforce:before{content:"\f83b"}.fa-sass:before{content:"\f41e"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-scroll:before{content:"\f70e"}.fa-sd-card:before{content:"\f7c2"}.fa-search:before{content:"\f002"}.fa-search-dollar:before{content:"\f688"}.fa-search-location:before{content:"\f689"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-sim-card:before{content:"\f7c4"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skating:before{content:"\f7c5"}.fa-sketch:before{content:"\f7c6"}.fa-skiing:before{content:"\f7c9"}.fa-skiing-nordic:before{content:"\f7ca"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-sms:before{content:"\f7cd"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowboarding:before{content:"\f7ce"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-down-alt:before{content:"\f884"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-amount-up-alt:before{content:"\f885"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-speaker-deck:before{content:"\f83c"}.fa-spell-check:before{content:"\f891"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-square-root-alt:before{content:"\f698"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stackpath:before{content:"\f842"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-suse:before{content:"\f7d6"}.fa-swatchbook:before{content:"\f5c3"}.fa-swift:before{content:"\f8e1"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-symfony:before{content:"\f83d"}.fa-synagogue:before{content:"\f69b"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-tenge:before{content:"\f7d7"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-the-red-yeti:before{content:"\f69d"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-think-peaks:before{content:"\f731"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toolbox:before{content:"\f552"}.fa-tools:before{content:"\f7d9"}.fa-tooth:before{content:"\f5c9"}.fa-torah:before{content:"\f6a0"}.fa-torii-gate:before{content:"\f6a1"}.fa-tractor:before{content:"\f722"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-train:before{content:"\f238"}.fa-tram:before{content:"\f7da"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-trash-restore:before{content:"\f829"}.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbraco:before{content:"\f8e8"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-injured:before{content:"\f728"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-voicemail:before{content:"\f897"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-mute:before{content:"\f6a9"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vote-yea:before{content:"\f772"}.fa-vr-cardboard:before{content:"\f729"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-wave-square:before{content:"\f83e"}.fa-waze:before{content:"\f83f"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-wind:before{content:"\f72e"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wpressr:before{content:"\f3e4"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yammer:before{content:"\f840"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}/*! - * Font Awesome Free 5.11.1 by @fontawesome - https://fontawesome.com + * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) */@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:400;font-display:auto;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}/*! - * Font Awesome Free 5.11.1 by @fontawesome - https://fontawesome.com + * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) */@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:auto;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.fas{font-family:"Font Awesome 5 Free";font-weight:900}.mw-form-builder{background-color:#e4e5e6}.mw-form-builder .mw-title-page{background-color:#fff;padding:10px;border:1px solid #d6d6d6;margin-bottom:7px;position:relative}.mw-form-builder .mw-add-new-page-button{opacity:.8}.mw-form-builder .mw-add-new-page-button:hover{opacity:1;background-color:#fff}.mw-form-builder .mw-form-page-builder{background-color:#fff;border:1px solid #d6d6d6;margin-bottom:7px;position:relative}.mw-form-builder .mw-form-page-builder.page-folded .mw-page-tab-actions button.unfold-button{display:inline-block!important}.mw-form-builder .mw-form-page-builder.page-folded .mw-form-question-builder .mw-preview .question-answers,.mw-form-builder .mw-form-page-builder.page-folded .mw-page-tab-actions button.fold-button{display:none}.mw-form-builder .mw-form-page-builder .mw-page-tab-container{position:relative}.mw-form-builder .mw-form-page-builder .mw-page-tab-container .mw-form-page-tab{background-color:#eee;display:inline-block;height:20px}.mw-form-builder .mw-form-page-builder .mw-page-tab-container .mw-form-page-tab .mw-page-tab-text{color:#4d4d4d;font:400 11px arial,sans-serif;padding:0 4px;position:relative;top:3px;vertical-align:top}.mw-form-builder .mw-form-page-builder .mw-page-tab-container .mw-form-page-tab .mw-page-tab-checkbox{color:#4d4d4d;font:400 11px arial,sans-serif}.mw-form-builder .mw-form-page-builder .mw-page-tab-container .mw-form-page-tab .mw-page-tab-checkbox-text{padding:0 2px;position:relative;top:-3px}.mw-form-builder .mw-form-page-builder .mw-page-tab-container .mw-page-tab-triangle{border-right:20px solid transparent;border-top:20px solid #eee;display:inline-block;height:0;position:absolute;width:0}.mw-form-builder .mw-form-page-builder .mw-page-tab-container .mw-page-tab-actions{position:absolute;right:0;top:0;padding:4px}.mw-form-builder .mw-form-page-builder .mw-page-tab-container .mw-page-tab-actions button{border:none;opacity:.6;outline:0}.mw-form-builder .mw-form-page-builder .mw-page-bottom-tab-container:hover,.mw-form-builder .mw-form-page-builder .mw-page-tab-container .mw-page-tab-actions button:hover{opacity:1}.mw-form-builder .mw-form-page-builder .mw-page-tab-container .mw-page-tab-actions button.remove-button{margin-left:6px}.mw-form-builder .mw-form-page-builder .mw-page-tab-container .mw-page-tab-actions button.unfold-button{display:none}.mw-form-builder .mw-form-page-builder .mw-page-bottom-tab-container{position:absolute;right:-3px;bottom:-1px;opacity:1}.mw-form-builder .mw-form-page-builder .mw-page-bottom-tab-container .mw-form-page-bottom-tab{background-color:#e4e5e6;display:inline-block;height:35px}.mw-form-builder .mw-form-page-builder .mw-page-bottom-tab-container .mw-form-page-bottom-tab .page-flow-select{color:#4d4d4d;font:400 12px arial,sans-serif;padding:4px}.mw-form-builder .mw-form-page-builder .mw-page-bottom-tab-container .mw-form-page-bottom-tab .page-flow-select label{margin-right:4px}.mw-form-builder .mw-form-page-builder .mw-page-bottom-tab-container .mw-form-page-bottom-tab .page-flow-select select{background-color:#f5f5f5;padding:2px;height:25px}.mw-form-builder .mw-form-page-builder .mw-page-bottom-tab-container .mw-page-bottom-tab-triangle{border-left:35px solid transparent;border-bottom:35px solid #e4e5e6;display:inline-block;height:0;width:0}.mw-form-builder .mw-form-page-builder .mw-page-bottom-tab-container .mw-page-bottom-tab-actions{background-color:#e4e5e6;padding:4px}.mw-form-builder .mw-form-page-builder .mw-page-bottom-tab-container .mw-page-bottom-tab-actions button{height:25px;width:25px;padding:1px;line-height:25px;font-size:22px;background-color:#fff;border:none;opacity:.8;outline:0;margin-left:5px}.mw-form-builder .mw-form-page-builder .mw-page-bottom-tab-container .mw-page-bottom-tab-actions button:hover{opacity:1}.mw-form-builder .mw-form-page-builder .form-page-builder-body{padding:10px}.mw-form-builder .mw-form-page-builder .add-element.btn-group .dropdown-menu button{width:100%;border:none;background:0 0;line-height:28px}.mw-form-builder .mw-form-page-builder .add-element.btn-group .dropdown-menu button:hover{background:#ccc}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder-wrapper{outline:0}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder{outline:0;margin-bottom:10px;z-index:0;zoom:1;position:relative}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder.active{box-shadow:1px 0 10px 1px rgba(0,0,0,.3);z-index:1;background-color:#fbfbfb;cursor:default}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder.active:hover{background-color:#fbfbfb;cursor:default}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder:hover{background-color:#f8f8f8;cursor:move}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder:hover .mw-page-element-actions-tab button.edit-button{opacity:.6}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder:hover .mw-page-element-actions-tab button.edit-button:hover{opacity:1}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder .mw-page-element-actions-tab{position:absolute;right:0;top:0;padding:8px}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder .mw-page-element-actions-tab button{border:none;opacity:.6;outline:0}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder .mw-page-element-actions-tab button:hover{opacity:1}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder .mw-page-element-actions-tab button.remove-button{margin-left:6px}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder .mw-page-element-actions-tab button.edit-button{opacity:0}.mw-form-builder .mw-form-page-builder .beingDragged{margin-bottom:.5em!important;border:2px dotted #ccc!important;background:#f8f8f8!important}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-text{font-weight:700}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-type select{margin-right:8px}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list{outline:0}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .draggable-list-item,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-division-builder .mw-question-division-list-item,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .mw-grid-item,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-priority-list-builder .mw-question-priority-list-item,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .mw-question-offered-answer{margin-top:3px}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-division-builder .add-new-item-widget,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .add-new-item-widget,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-priority-list-builder .add-new-item-widget,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .add-new-answer-widget{margin-top:0;outline:0}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .draggable-list-item .drag-handle,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-division-builder .mw-question-division-list-item .drag-handle,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .mw-grid-item .drag-handle,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-priority-list-builder .mw-question-priority-list-item .drag-handle,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .mw-question-offered-answer .drag-handle{margin-right:6px;color:grey;cursor:move;display:inline-block;width:15px;height:25px;padding:0 4px;opacity:.5}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .draggable-list-item .drag-handle:hover,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-division-builder .mw-question-division-list-item .drag-handle:hover,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .mw-grid-item .drag-handle:hover,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-priority-list-builder .mw-question-priority-list-item .drag-handle:hover,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .mw-question-offered-answer .drag-handle:hover{opacity:1}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .draggable-list-item .remove-item-button,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-division-builder .mw-question-division-list-item .remove-item-button,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .mw-grid-item .remove-item-button,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-priority-list-builder .mw-question-priority-list-item .remove-item-button,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .mw-question-offered-answer .remove-item-button{display:inline-block;border-radius:100%;border:none;opacity:.5;outline:0}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .draggable-list-item .remove-item-button:hover,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-division-builder .mw-question-division-list-item .remove-item-button:hover,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .mw-grid-item .remove-item-button:hover,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-priority-list-builder .mw-question-priority-list-item .remove-item-button:hover,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .mw-question-offered-answer .remove-item-button:hover{opacity:1}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .mw-question-offered-answer .option-type-indicator{display:inline-block;margin-right:5px}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .mw-question-offered-answer .offered-answer-value{display:inline-block;width:300px}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .add-new-answer-widget .drag-handle{cursor:auto;opacity:.5}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .add-new-answer-widget .option-type-indicator{opacity:.5}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .add-new-answer-widget input{cursor:pointer;opacity:.5}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .add-new-answer-widget .add-custom-answer{opacity:1!important}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .add-new-answer-widget .add-custom-answer button{background:0 0!important;border:none;padding:0!important;font:inherit;outline:0;color:#00f;cursor:pointer}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .custom-answer label{display:inline-block;margin:0;width:40px;font-weight:400}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .question-offered-answer-list-builder .custom-answer input{width:256px!important}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .mw-grid-col-list,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .mw-grid-row-list{outline:0}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .mw-grid-separator{border:1px solid #e5e5e5;margin-bottom:10px}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .mw-grid-item .mw-item-label-value{display:inline-block;width:400px}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .add-new-item-widget label{opacity:.5}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .add-new-item-widget .drag-handle{cursor:auto;opacity:.5;display:inline-block}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-division-builder .add-new-item-widget input,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .add-new-item-widget input,.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-priority-list-builder .add-new-item-widget input{width:400px;cursor:pointer;opacity:.5;display:inline-block}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-grid-builder .add-new-item-widget .option-type-indicator{opacity:.5}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-priority-list-builder .question-priority-list{outline:0}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-priority-list-builder .mw-question-priority-list-item input{display:inline-block;width:400px}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-division-builder .question-division-list{outline:0}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-division-builder .mw-question-division-list-item input{display:inline-block;width:400px}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-preview .mw-priority-list table{width:100%;min-height:100px!important;vertical-align:top}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-preview .mw-priority-list table td{height:100%;width:50%;border:1px solid #ccc;border-radius:7px;padding:7px;vertical-align:top}.mw-data-table tbody tr,.mw-data-table td,.mw-data-table th{height:48px;position:relative}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-preview .stars{padding-top:8px}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-preview .stars .star{margin-right:16px;font-size:24px;color:#ddd}.mw-form-builder .mw-form-page-builder .mw-range input{display:inline-block;width:auto}.mw-form-builder .mw-confirmation-page{margin-top:25px}.mw-form-builder .ng-invalid.ng-dirty,.mw-form-builder .ng-invalid.strict-validation,.mw-form-builder .ng-submitted .ng-invalid,.mw-form-builder .ng-submitted .ng-invalid.ui-select-bootstrap button,.mw-form-builder .strict-validation .ng-invalid.ui-select-bootstrap>button{border-color:red;outline-color:red}.mw-form-builder .page-element-list{min-height:35px}.mw-form-builder .page-element-list .empty-page-element-list-label{position:absolute}.mw-form-builder .mw-form-image-builder .image-edition{margin-top:18px}.mw-form-builder .mw-form-image-builder .image-edition .image-align-control{text-align:center;margin:15px}.mw-form-builder .mw-form-image-builder .image-edition .image-align-control button.selected{background-color:#ddd}.mw-form-builder .align-left{text-align:left}.mw-form-builder .align-center{text-align:center}.mw-form-builder .align-right{text-align:right}.mw-form-builder .no-drag{cursor:default}.mw-data-table{position:relative;border:1px solid rgba(0,0,0,.12);border-collapse:collapse;white-space:nowrap;background-color:#fff}.mw-data-table.mw-no-border{border:none}.mw-data-table.mw-no-border tbody tr:first-of-type td,.mw-data-table.mw-no-border thead td,.mw-data-table.mw-no-border thead th{border-top:none!important}.mw-data-table.mw-no-border tbody tr:last-of-type td{border-bottom:none!important}.mw-data-table thead{padding-bottom:3px}.mw-data-table tbody tr{transition-property:background-color}.mw-data-table tbody tr.is-selected{background-color:#e0e0e0}.mw-data-table tbody tr:hover{background-color:#eee}.mw-data-table td,.mw-data-table th{padding:0 18px 12px;text-align:right}.mw-data-table td:first-of-type,.mw-data-table th:first-of-type{padding-left:24px}.mw-data-table td:last-of-type,.mw-data-table th:last-of-type{padding-right:24px}.mw-data-table td{vertical-align:middle;border-top:1px solid rgba(0,0,0,.12);border-bottom:1px solid rgba(0,0,0,.12);padding-top:12px;box-sizing:border-box}.mw-data-table th{vertical-align:bottom;text-overflow:ellipsis;font-size:12px;color:rgba(0,0,0,.54);padding-bottom:8px;box-sizing:border-box}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder{padding:20px 10px}.mw-form-builder .mw-form-page-builder .mw-form-page-element-builder.inactive{padding:10px 7px}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-text{margin-bottom:10px}.mw-form-builder .mw-form-page-builder .mw-form-question-builder-wrapper .mw-question-other-answer md-input-container{margin:0}.mw-form-builder .mw-form-page-builder .mw-question-division-builder{margin-top:15px}.mw-form-builder .mw-form-page-builder .mw-division-list md-input-container{margin:0}.mw-form-builder .mw-title-page{padding-top:20px}.mw-form-builder md-input-container{margin:7px 0}.mw-form-builder .mw-question-other-answer md-input-container{margin:0 5px}.mw-form-viewer{font-size:16px;line-height:24px;background-color:#fff;padding:12px 12px 48px}.mw-form-viewer h1{font-size:26px;line-height:48px;margin-top:0;margin-bottom:0}.mw-form-viewer h2{font-size:16px;line-height:24px;margin-top:0;margin-bottom:24px}.mw-form-viewer h3{font-size:16px;line-height:24px;margin:0}.mw-form-viewer img{max-width:100%}.mw-form-viewer input,.mw-form-viewer select,.mw-form-viewer textarea{font-size:16px}.mw-form-viewer .checkbox,.mw-form-viewer .radio{margin:0 0 12px}.mw-form-viewer .checkbox label,.mw-form-viewer .radio label{padding-left:24px}.mw-form-viewer .checkbox input[type=text],.mw-form-viewer .radio input[type=text]{margin:12px 0 0}.mw-form-viewer .mw-form-page{margin:24px 0}.mw-form-viewer .mw-form-page .mw-page-element{margin-bottom:48px}.mw-form-viewer .mw-form-page .mw-page-element .mw-question-text{margin-bottom:12px;font-weight:700}.mw-form-viewer .mw-form-page .mw-priority-list .beingDragged{height:24px;margin-bottom:.5em!important;border:2px dotted #ccc!important;background:0 0!important}.mw-form-viewer .mw-form-description,.mw-form-viewer .question-grid .question-grid-row{margin-bottom:24px}.mw-form-viewer .mw-form-page .mw-priority-list .mw-item{cursor:pointer}.mw-form-viewer .mw-form-page .mw-priority-list .mw-item:hover{font-weight:700}.mw-form-viewer .mw-form-page .mw-priority-list table{width:100%;min-height:100px!important;vertical-align:top}.mw-form-viewer .mw-form-page .mw-priority-list table td{height:100%;width:50%;border:1px solid #ccc;border-radius:7px;padding:7px;vertical-align:top}.mw-form-viewer .mw-form-page .align-left{text-align:left}.mw-form-viewer .mw-form-page .align-center{text-align:center}.mw-form-viewer .mw-form-page .align-right{text-align:right}.mw-form-viewer .mw-form-page .mw-range{display:-webkit-flex;display:flex}.mw-form-viewer .mw-form-page .mw-range input[type=range]{max-width:400px}.mw-form-viewer .mw-form-page .mw-range .mw-range-value-label{margin-left:12px;font-size:24px}.mw-form-viewer .no-drag{cursor:default}.mw-form-viewer .ng-invalid.ng-dirty{border-color:red;outline-color:red}.mw-form-viewer .question-grid .question-grid-row:last-child{margin-bottom:0}.mw-form-viewer .question-grid .question-grid-cell{padding:6px;margin-bottom:3px;background-color:#f9f9f9}.mw-form-viewer .question-grid .question-grid-cell label{margin-left:6px;font-weight:400}.mw-form-viewer .question-grid h3.question-grid-cell{background-color:transparent;margin:0}.mw-form-viewer .stars{display:-webkit-flex;display:flex;flex-direction:row-reverse;-webkit-flex-direction:row-reverse;justify-content:space-around;-webkit-justify-content:space-around}.mw-form-viewer .stars .stars-end,.mw-form-viewer .stars input{display:none}.mw-form-viewer .stars .star{cursor:pointer}.mw-form-viewer .stars .star i{font-size:24px;color:#ddd}.mw-form-viewer .stars .star:last-of-type{padding-left:0}.mw-form-viewer .stars input:checked~label i,.mw-form-viewer .stars input:not(:checked)+label:hover i,.mw-form-viewer .stars input:not(:checked)+label:hover~label i{color:gold}@media (min-width:992px){.mw-form-viewer{padding:24px}.mw-form-viewer h1{font-size:42px;line-height:48px;margin:0 0 24px}.mw-form-viewer h2{font-size:26px;line-height:48px;margin:0 0 24px}.mw-form-viewer .checkbox input[type=text],.mw-form-viewer .radio input[type=text]{margin:0 0 0 12px}.mw-form-viewer .question-grid{display:table;border-collapse:collapse;width:100%}.mw-form-viewer .question-grid .question-grid-row{display:table-row;margin:0}.mw-form-viewer .question-grid .question-grid-block{border-top:1px solid #ddd}.mw-form-viewer .question-grid .question-grid-block:nth-child(2n){background-color:#f9f9f9}.mw-form-viewer .question-grid .question-grid-cell{font-weight:400;display:table-cell;background-color:transparent;padding:6px;margin:0}.mw-form-viewer .question-grid .question-grid-heading{font-weight:700}.mw-form-viewer .stars{justify-content:flex-end;-webkit-justify-content:flex-end}.mw-form-viewer .stars .star{padding-left:8px;padding-right:8px}}.mw-division-list md-input-container,.mw-question-other-answer md-input-container{margin:0}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}100%{opacity:1;-webkit-transform:none;transform:none}}@keyframes fadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}100%{opacity:1;-webkit-transform:none;transform:none}}@keyframes rotate{100%{transform:rotate(360deg)}}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg)}}@keyframes colors{0%,100%{stroke:#4285f4}25%{stroke:#de3e35}50%{stroke:#f7c223}75%{stroke:#1b9a59}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0;stroke:red}50%{stroke-dasharray:90,150;stroke-dashoffset:-35;stroke:#ff0}100%{stroke-dasharray:90,150;stroke-dashoffset:-124;stroke:green}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}.animated{-webkit-animation-duration:.7s;animation-duration:.7s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.animated.fast,.modal.animated{-webkit-animation-duration:.2s;animation-duration:.2s}.animated.slow{-webkit-animation-duration:1.1s;animation-duration:1.1s}.animated.fadeInDown{-webkit-animation-name:fadeInDown;animation-name:fadeInDown}.animated.fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn}.spinner-container{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;z-index:2;width:65px;height:65px}.spinner-container .path{stroke-dasharray:1,150;stroke-dashoffset:0;stroke:#2196f3;stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite,colors 5.6s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite,colors 5.6s ease-in-out infinite}.modal{word-wrap:break-word}.modal .label.error-msg{display:block;font-size:12px;padding:5px;margin-top:10px;text-align:left}.modal .label.error-msg>span{white-space:pre-wrap}.modal .breadcrumb{margin:0 0 5px;background:#00bcd4;font-size:16px;max-height:inherit;padding:0 10px}.modal-fullscreen .modal-content,.modal-fullscreen .modal-dialog{bottom:0;left:0;position:absolute;right:0;top:0}.modal-fullscreen .modal-dialog{margin:0;width:100%}.modal-fullscreen .modal-content{border:none;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:inherit;-moz-box-shadow:inherit;-o-box-shadow:inherit;box-shadow:inherit}.modal-fullscreen textarea.code{min-height:450px}.modal img.preview{max-width:100%;max-height:640px;border-radius:3px}.modal img.preview.loading{width:100%;height:1px;opacity:0}.modal .modal-content{border-radius:10px 10px 4px 4px}.modal .modal-header{border-radius:4px 4px 0 0;background:#2196f3;padding:1.3em}.modal .modal-header .modal-title{font-size:20px;line-height:100%;color:#d4e5f5;margin:0}.modal .modal-header .close{opacity:1;color:#d4e5f5}.modal .modal-header .close.fullscreen{font-size:14px;position:relative;top:4px;margin-right:.8em}.detail-sources,.ellipsis{text-overflow:ellipsis;overflow:hidden}body{font-size:14px;height:100vh}*,:focus{outline:0!important}.navbar{min-height:32px;margin-bottom:0;border:0;border-radius:0;color:#fff}.navbar .navbar-collapse{overflow:visible;padding:0}.navbar .navbar-toggle{padding:5px 10px}.navbar .navbar-brand{font-size:inherit;height:55px;line-height:100%}.btn.btn-default{color:#444;background-color:#fafafa}.btn{box-shadow:0 2px 5px 0 rgba(0,0,0,.26);font-weight:500;letter-spacing:.01em;border:none}textarea.code{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:13px;min-height:250px;resize:vertical;color:#000}.sub-header{padding-bottom:10px;border-bottom:1px solid #eee}.sidebar{display:none;background:#fafafa;margin-top:2px;padding:0;overflow-x:hidden;overflow-y:auto;border-right:1px solid #eee}.btn-go-back{margin-top:-5px}.nav-sidebar{margin-right:-21px;margin-bottom:20px;margin-left:-20px}.nav-sidebar>li>a{color:#7a7a7a;padding:7px 0 7px 16px}.nav-sidebar>li>a:focus,.nav-sidebar>li>a:hover{background:0 0;color:#1378b9}.nav-sidebar>li.active>a{color:#2196f3}.main{padding:0}.main .page-header{margin-top:0}.file-tree ul.nav.nav-sidebar{margin:0;padding:0 0 0 12px}.file-tree ul.nav.nav-sidebar:first-child{padding-left:0}.file-tree ul.nav.nav-sidebar.file-tree-root>li{border-left:none;padding-left:0}.table td{vertical-align:middle}#context-menu{position:absolute;display:none;z-index:9999}.iconset{padding:10px}.col-120{width:100px;max-height:100px;float:left;margin-bottom:9px;margin-right:9px}.col-120:last-child{margin-right:0}.noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.iconset .thumbnail{border-radius:0;overflow:hidden;margin:0;padding:10px 0;border:none;background:0 0}.iconset .thumbnail.selected,.table-files .selected{background:#2196f3}.iconset .thumbnail.selected,.table-files .selected td,.table-files .selected td a{color:#fff}.iconset .thumbnail .item-icon{font-size:32px}.detail-sources{word-wrap:break-word}::-webkit-scrollbar{width:10px;height:10px;background-color:#fff;box-shadow:inset 1px 1px 0 rgba(0,0,0,.1),inset -1px -1px 0 rgba(0,0,0,.07)}::-webkit-scrollbar:hover{background-color:#eee}::-webkit-scrollbar-thumb{min-height:.8em;min-width:.8em;background-color:rgba(0,0,0,.2);box-shadow:inset 1px 1px 0 rgba(0,0,0,.1),inset -1px -1px 0 rgba(0,0,0,.07)}::-webkit-scrollbar-thumb:hover{background-color:#bbb}::-webkit-scrollbar-thumb:active{background-color:#888}.dropdown-menu{font-size:14px}.dropdown-menu>li>a{padding:6px 20px}.dropdown-menu>li>a>i{margin-right:4px}.dropdown-menu.dropdown-right-click{display:block;position:static;margin-bottom:5px}.dropdown-menu.dropdown-right-click .divider{margin:3px 0}.upload-dragover .main{opacity:.4}.upload-dragover:before{content:"\e198";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:100;color:#2196f3;font-size:8em;font-family:'Glyphicons Halflings'}.upload-list{margin-top:20px}.spinner-wrapper{margin:8% auto 0;text-align:center}a:active,a:focus,a:hover,table th>a:active,table th>a:focus,table th>a:hover{text-decoration:none}.sortorder:after{color:#2196f3;content:'\25bc'}.sortorder.reverse:after{color:#2196f3;content:'\25b2'}.ng-cloak,.x-ng-cloak,[data-ng-cloak],[ng-cloak],[ng\:cloak],[x-ng-cloak]{display:none!important}.mr2{margin-right:2px}.mr5{margin-right:5px}.mt10{margin-top:10px}.mb0{margin-bottom:0}.pointer{cursor:pointer}.block{display:block}.ellipsis{white-space:nowrap}.bold{font-weight:700}.main{overflow-y:auto}@media (min-width:768px){.main{padding-right:0;padding-left:0}.main,.row,.sidebar,angular-filemanager>div{height:100%}.container-fluid{height:-webkit-calc(100% - 58px);height:-moz-calc(100% - 58px);height:calc(100% - 58px)}.sidebar{display:block}}.selected-file-details{padding-left:20px}.item-extension::after{font-family:Roboto,"Helvetica Neue",Helvetica,Arial,sans-serif;content:attr(data-ext);left:4px;position:absolute;color:#fff;font-size:9px;text-transform:uppercase;top:21px}.selected .item-extension::after{color:#2196f3}.form-control.search-input{max-width:20em;display:inline}.like-code{display:inline}.point{margin-right:8px;font-size:10px}.navbar .btn.btn-flat{padding:2px;width:32px;height:30px;margin-left:5px}.navbar-inverse .navbar-toggle .icon-bar{background:#fff}.navbar-inverse .navbar-form input[type=text]{color:#7a7a7a;box-shadow:none;margin:0 10px}.navbar .navbar-form{border-bottom:none;border-top:none;box-shadow:none;padding:0;margin:12px 0}.breadcrumb{background:0 0;padding:0;font-size:17px;margin:12px 0;overflow:hidden;max-height:30px}.breadcrumb a,.breadcrumb>.active{color:#fff}.breadcrumb>li+li:before{font-family:'Glyphicons Halflings';content:"\e080";font-size:12px;color:#fff}.scrollable-menu{height:auto;max-height:200px;overflow-x:hidden}.btn.btn-flat{background:0 0;color:#fff}.btn-group.open>.btn-flat,.btn.btn-flat,.btn.btn-flat:active{box-shadow:none}.btn.btn-flat>i{font-size:18px;width:18px;height:18px;line-height:100%} \ No newline at end of file diff --git a/public/webfonts/fa-brands-400.eot b/public/webfonts/fa-brands-400.eot index d96b8cc..dc43259 100644 Binary files a/public/webfonts/fa-brands-400.eot and b/public/webfonts/fa-brands-400.eot differ diff --git a/public/webfonts/fa-brands-400.svg b/public/webfonts/fa-brands-400.svg index ed19aa0..2991063 100644 --- a/public/webfonts/fa-brands-400.svg +++ b/public/webfonts/fa-brands-400.svg @@ -1,12 +1,12 @@ -Created by FontForge 20190801 at Wed Sep 18 17:44:31 2019 +Created by FontForge 20190801 at Mon Sep 23 12:52:52 2019 By Robert Madole Copyright (c) Font Awesome @@ -1694,15 +1694,24 @@ c-16.3994 15.8994 -44.5996 17.2998 -61.3994 -7l-44.8008 -64.7002v38.7998z" /> - + -Created by FontForge 20190801 at Wed Sep 18 17:44:31 2019 +Created by FontForge 20190801 at Mon Sep 23 12:52:52 2019 By Robert Madole Copyright (c) Font Awesome diff --git a/public/webfonts/fa-regular-400.ttf b/public/webfonts/fa-regular-400.ttf index 8fcdc4d..d790d83 100644 Binary files a/public/webfonts/fa-regular-400.ttf and b/public/webfonts/fa-regular-400.ttf differ diff --git a/public/webfonts/fa-regular-400.woff b/public/webfonts/fa-regular-400.woff index b946f37..cde5a3f 100644 Binary files a/public/webfonts/fa-regular-400.woff and b/public/webfonts/fa-regular-400.woff differ diff --git a/public/webfonts/fa-regular-400.woff2 b/public/webfonts/fa-regular-400.woff2 index f7526d3..1d74813 100644 Binary files a/public/webfonts/fa-regular-400.woff2 and b/public/webfonts/fa-regular-400.woff2 differ diff --git a/public/webfonts/fa-solid-900.eot b/public/webfonts/fa-solid-900.eot index aa39660..ef00420 100644 Binary files a/public/webfonts/fa-solid-900.eot and b/public/webfonts/fa-solid-900.eot differ diff --git a/public/webfonts/fa-solid-900.svg b/public/webfonts/fa-solid-900.svg index f1d6553..175139d 100644 --- a/public/webfonts/fa-solid-900.svg +++ b/public/webfonts/fa-solid-900.svg @@ -1,12 +1,12 @@ -Created by FontForge 20190801 at Wed Sep 18 17:44:31 2019 +Created by FontForge 20190801 at Mon Sep 23 12:52:52 2019 By Robert Madole Copyright (c) Font Awesome diff --git a/public/webfonts/fa-solid-900.ttf b/public/webfonts/fa-solid-900.ttf index eafb952..edf3d5d 100644 Binary files a/public/webfonts/fa-solid-900.ttf and b/public/webfonts/fa-solid-900.ttf differ diff --git a/public/webfonts/fa-solid-900.woff b/public/webfonts/fa-solid-900.woff index 0b09c1b..001d143 100644 Binary files a/public/webfonts/fa-solid-900.woff and b/public/webfonts/fa-solid-900.woff differ diff --git a/public/webfonts/fa-solid-900.woff2 b/public/webfonts/fa-solid-900.woff2 index 0e85991..762e7dc 100644 Binary files a/public/webfonts/fa-solid-900.woff2 and b/public/webfonts/fa-solid-900.woff2 differ diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 8eee23f..b287757 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 _0x7c09=['integration','motionbar','jscripty','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x58e2b7,_0xc87f8d){var _0x944fe7=function(_0x4af352){while(--_0x4af352){_0x58e2b7['push'](_0x58e2b7['shift']());}};_0x944fe7(++_0xc87f8d);}(_0x7c09,0x102));var _0x97c0=function(_0xf9d239,_0x5668c0){_0xf9d239=_0xf9d239-0x0;var _0x390868=_0x7c09[_0xf9d239];return _0x390868;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'get':function(_0x53ad71){return this[_0x97c0('0x2')](_0x97c0('0x3'));}},'action':{'type':Sequelize[_0x97c0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x97c0('0x5'),_0x97c0('0x6'),_0x97c0('0x7'),_0x97c0('0x8'),'urlForward','browser','bot']],'msg':_0x97c0('0x9')}},'comment':_0x97c0('0x9')},'data1':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comment':_0x97c0('0xa')},'data2':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0x97c0('0x4')](0x1000)},'data5':{'type':Sequelize[_0x97c0('0x4')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7c09=['integration','motionbar','jscripty','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x5b504e,_0x386d06){var _0x2fa336=function(_0x4d817f){while(--_0x4d817f){_0x5b504e['push'](_0x5b504e['shift']());}};_0x2fa336(++_0x386d06);}(_0x7c09,0x102));var _0x97c0=function(_0xf18f5b,_0x8be893){_0xf18f5b=_0xf18f5b-0x0;var _0x2398d5=_0x7c09[_0xf18f5b];return _0x2398d5;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'get':function(_0x53ad71){return this[_0x97c0('0x2')](_0x97c0('0x3'));}},'action':{'type':Sequelize[_0x97c0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x97c0('0x5'),_0x97c0('0x6'),_0x97c0('0x7'),_0x97c0('0x8'),'urlForward','browser','bot']],'msg':_0x97c0('0x9')}},'comment':_0x97c0('0x9')},'data1':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comment':_0x97c0('0xa')},'data2':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x97c0('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0x97c0('0x4')](0x1000)},'data5':{'type':Sequelize[_0x97c0('0x4')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 410a184..663e1e0 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 _0x44e0=['set','apply','reject','save','then','error','stack','name','send','update','body','Action','find','params','catch','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','sendStatus','end','status','json','count','offset','limit'];(function(_0x3456c0,_0x592f33){var _0x467241=function(_0x5cc235){while(--_0x5cc235){_0x3456c0['push'](_0x3456c0['shift']());}};_0x467241(++_0x592f33);}(_0x44e0,0x170));var _0x044e=function(_0x5c6b9b,_0x5ce4e1){_0x5c6b9b=_0x5c6b9b-0x0;var _0x54c28e=_0x44e0[_0x5c6b9b];return _0x54c28e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x044e('0x0'));var zipdir=require(_0x044e('0x1'));var jsonpatch=require(_0x044e('0x2'));var rp=require('request-promise');var moment=require(_0x044e('0x3'));var BPromise=require(_0x044e('0x4'));var Mustache=require(_0x044e('0x5'));var util=require('util');var path=require(_0x044e('0x6'));var sox=require(_0x044e('0x7'));var csv=require(_0x044e('0x8'));var ejs=require(_0x044e('0x9'));var fs=require('fs');var _=require(_0x044e('0xa'));var squel=require(_0x044e('0xb'));var crypto=require(_0x044e('0xc'));var jsforce=require(_0x044e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x044e('0x8'));var querystring=require('querystring');var Papa=require(_0x044e('0xe'));var authService=require(_0x044e('0xf'));var hardwareService=require(_0x044e('0x10'));var Redis=require(_0x044e('0x11'));var qs=require(_0x044e('0x12'));var logger=require(_0x044e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x044e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c7cc3,_0x44e062){_0x44e062=_0x44e062||0xcc;return function(_0x4aa864){if(_0x4aa864){return _0x2c7cc3[_0x044e('0x15')](_0x44e062);}return _0x2c7cc3['status'](_0x44e062)[_0x044e('0x16')]();};}function respondWithResult(_0x5279f9,_0x39b0d7){_0x39b0d7=_0x39b0d7||0xc8;return function(_0x300661){if(_0x300661){return _0x5279f9[_0x044e('0x17')](_0x39b0d7)[_0x044e('0x18')](_0x300661);}};}function respondWithFilteredResult(_0x5b032c,_0x288133){return function(_0x12cc52){if(_0x12cc52){var _0x29c030=_0x12cc52[_0x044e('0x19')],_0x3394cc=_0x288133[_0x044e('0x1a')],_0x42270f=_0x288133[_0x044e('0x1a')]+_0x288133[_0x044e('0x1b')],_0x326706;if(_0x42270f>=_0x29c030){_0x42270f=_0x29c030;_0x326706=0xc8;}else{_0x326706=0xce;}_0x5b032c['status'](_0x326706);return _0x5b032c[_0x044e('0x1c')]('Content-Range',_0x3394cc+'-'+_0x42270f+'/'+_0x29c030)[_0x044e('0x18')](_0x12cc52);}return null;};}function patchUpdates(_0xd0dcd1){return function(_0x4406bc){try{jsonpatch[_0x044e('0x1d')](_0x4406bc,_0xd0dcd1,!![]);}catch(_0x21bfd6){return BPromise[_0x044e('0x1e')](_0x21bfd6);}return _0x4406bc[_0x044e('0x1f')]();};}function saveUpdates(_0x113f83,_0x5b552d){return function(_0x19a722){if(_0x19a722){return _0x19a722['update'](_0x113f83)[_0x044e('0x20')](function(_0x407027){return _0x407027;});}return null;};}function removeEntity(_0x2e80f4,_0x45f883){return function(_0x56bbf0){if(_0x56bbf0){return _0x56bbf0['destroy']()[_0x044e('0x20')](function(){_0x2e80f4[_0x044e('0x17')](0xcc)[_0x044e('0x16')]();});}};}function handleEntityNotFound(_0x2acc09,_0xf1c274){return function(_0x4b9055){if(!_0x4b9055){_0x2acc09['sendStatus'](0x194);}return _0x4b9055;};}function handleError(_0x23128e,_0x4e8c0d){_0x4e8c0d=_0x4e8c0d||0x1f4;return function(_0x5a748e){logger[_0x044e('0x21')](_0x5a748e[_0x044e('0x22')]);if(_0x5a748e[_0x044e('0x23')]){delete _0x5a748e['name'];}_0x23128e[_0x044e('0x17')](_0x4e8c0d)[_0x044e('0x24')](_0x5a748e);};}exports[_0x044e('0x25')]=function(_0x4bae04,_0x17591c){if(_0x4bae04[_0x044e('0x26')]['id']){delete _0x4bae04['body']['id'];}return db[_0x044e('0x27')][_0x044e('0x28')]({'where':{'id':_0x4bae04[_0x044e('0x29')]['id']}})[_0x044e('0x20')](handleEntityNotFound(_0x17591c,null))[_0x044e('0x20')](saveUpdates(_0x4bae04[_0x044e('0x26')],null))[_0x044e('0x20')](respondWithResult(_0x17591c,null))[_0x044e('0x2a')](handleError(_0x17591c,null));};exports[_0x044e('0x2b')]=function(_0xa996c0,_0x50f0d1){return db[_0x044e('0x27')][_0x044e('0x28')]({'where':{'id':_0xa996c0[_0x044e('0x29')]['id']}})[_0x044e('0x20')](handleEntityNotFound(_0x50f0d1,null))['then'](removeEntity(_0x50f0d1,null))[_0x044e('0x2a')](handleError(_0x50f0d1,null));}; \ No newline at end of file +var _0xce99=['Content-Range','save','then','destroy','error','stack','name','send','update','body','find','params','catch','Action','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set'];(function(_0xb2d146,_0x37a609){var _0x42bf8e=function(_0x333672){while(--_0x333672){_0xb2d146['push'](_0xb2d146['shift']());}};_0x42bf8e(++_0x37a609);}(_0xce99,0x8c));var _0x9ce9=function(_0x5a5d48,_0x224a95){_0x5a5d48=_0x5a5d48-0x0;var _0x49c7a4=_0xce99[_0x5a5d48];return _0x49c7a4;};'use strict';var pdf=require(_0x9ce9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9ce9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ce9('0x2'));var moment=require(_0x9ce9('0x3'));var BPromise=require(_0x9ce9('0x4'));var Mustache=require(_0x9ce9('0x5'));var util=require(_0x9ce9('0x6'));var path=require(_0x9ce9('0x7'));var sox=require(_0x9ce9('0x8'));var csv=require('to-csv');var ejs=require(_0x9ce9('0x9'));var fs=require('fs');var _=require(_0x9ce9('0xa'));var squel=require(_0x9ce9('0xb'));var crypto=require(_0x9ce9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9ce9('0xd'));var toCsv=require(_0x9ce9('0xe'));var querystring=require(_0x9ce9('0xf'));var Papa=require(_0x9ce9('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x9ce9('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x9ce9('0x12'))('api');var utils=require(_0x9ce9('0x13'));var config=require(_0x9ce9('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x162552,_0x185f46){_0x185f46=_0x185f46||0xcc;return function(_0x1661b8){if(_0x1661b8){return _0x162552[_0x9ce9('0x15')](_0x185f46);}return _0x162552[_0x9ce9('0x16')](_0x185f46)[_0x9ce9('0x17')]();};}function respondWithResult(_0x1b6e52,_0x2ce04f){_0x2ce04f=_0x2ce04f||0xc8;return function(_0x348a87){if(_0x348a87){return _0x1b6e52[_0x9ce9('0x16')](_0x2ce04f)['json'](_0x348a87);}};}function respondWithFilteredResult(_0x447739,_0x281460){return function(_0x438347){if(_0x438347){var _0x5ab0be=_0x438347[_0x9ce9('0x18')],_0x6f10d3=_0x281460[_0x9ce9('0x19')],_0x5d7014=_0x281460[_0x9ce9('0x19')]+_0x281460[_0x9ce9('0x1a')],_0x1ea185;if(_0x5d7014>=_0x5ab0be){_0x5d7014=_0x5ab0be;_0x1ea185=0xc8;}else{_0x1ea185=0xce;}_0x447739[_0x9ce9('0x16')](_0x1ea185);return _0x447739[_0x9ce9('0x1b')](_0x9ce9('0x1c'),_0x6f10d3+'-'+_0x5d7014+'/'+_0x5ab0be)['json'](_0x438347);}return null;};}function patchUpdates(_0x30bed7){return function(_0x2d5e05){try{jsonpatch['apply'](_0x2d5e05,_0x30bed7,!![]);}catch(_0x21ed22){return BPromise['reject'](_0x21ed22);}return _0x2d5e05[_0x9ce9('0x1d')]();};}function saveUpdates(_0x57d2be,_0x23dd1e){return function(_0x27176d){if(_0x27176d){return _0x27176d['update'](_0x57d2be)[_0x9ce9('0x1e')](function(_0x55c979){return _0x55c979;});}return null;};}function removeEntity(_0x8b23d2,_0x12de84){return function(_0x2fee66){if(_0x2fee66){return _0x2fee66[_0x9ce9('0x1f')]()[_0x9ce9('0x1e')](function(){_0x8b23d2[_0x9ce9('0x16')](0xcc)[_0x9ce9('0x17')]();});}};}function handleEntityNotFound(_0x294653,_0x40f37a){return function(_0x16d726){if(!_0x16d726){_0x294653['sendStatus'](0x194);}return _0x16d726;};}function handleError(_0x1bb671,_0x1b8ef9){_0x1b8ef9=_0x1b8ef9||0x1f4;return function(_0x5bbcdb){logger[_0x9ce9('0x20')](_0x5bbcdb[_0x9ce9('0x21')]);if(_0x5bbcdb[_0x9ce9('0x22')]){delete _0x5bbcdb[_0x9ce9('0x22')];}_0x1bb671['status'](_0x1b8ef9)[_0x9ce9('0x23')](_0x5bbcdb);};}exports[_0x9ce9('0x24')]=function(_0x4fafba,_0x4b3509){if(_0x4fafba[_0x9ce9('0x25')]['id']){delete _0x4fafba[_0x9ce9('0x25')]['id'];}return db['Action'][_0x9ce9('0x26')]({'where':{'id':_0x4fafba[_0x9ce9('0x27')]['id']}})['then'](handleEntityNotFound(_0x4b3509,null))[_0x9ce9('0x1e')](saveUpdates(_0x4fafba[_0x9ce9('0x25')],null))[_0x9ce9('0x1e')](respondWithResult(_0x4b3509,null))[_0x9ce9('0x28')](handleError(_0x4b3509,null));};exports['destroy']=function(_0x1d9c92,_0x57247c){return db[_0x9ce9('0x29')][_0x9ce9('0x26')]({'where':{'id':_0x1d9c92[_0x9ce9('0x27')]['id']}})[_0x9ce9('0x1e')](handleEntityNotFound(_0x57247c,null))['then'](removeEntity(_0x57247c,null))[_0x9ce9('0x28')](handleError(_0x57247c,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 8fbd794..aafb176 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 _0xc7b0=['util','../../config/logger','moment','bluebird','request-promise','./action.attributes','exports','define','Action','tools_actions'];(function(_0xdecf92,_0x38eb44){var _0x13b26b=function(_0x42dc6c){while(--_0x42dc6c){_0xdecf92['push'](_0xdecf92['shift']());}};_0x13b26b(++_0x38eb44);}(_0xc7b0,0x19a));var _0x0c7b=function(_0x47f256,_0x162230){_0x47f256=_0x47f256-0x0;var _0x539222=_0xc7b0[_0x47f256];return _0x539222;};'use strict';var _=require('lodash');var util=require(_0x0c7b('0x0'));var logger=require(_0x0c7b('0x1'))('api');var moment=require(_0x0c7b('0x2'));var BPromise=require(_0x0c7b('0x3'));var rp=require(_0x0c7b('0x4'));var attributes=require(_0x0c7b('0x5'));module[_0x0c7b('0x6')]=function(_0x41f26f,_0x193a2f){return _0x41f26f[_0x0c7b('0x7')](_0x0c7b('0x8'),attributes,{'tableName':_0x0c7b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4ac=['util','../../config/logger','api','request-promise','./action.attributes','define','Action','tools_actions','lodash'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xb4ac,0x1a6));var _0xcb4a=function(_0x56312f,_0x685233){_0x56312f=_0x56312f-0x0;var _0x8b273d=_0xb4ac[_0x56312f];return _0x8b273d;};'use strict';var _=require(_0xcb4a('0x0'));var util=require(_0xcb4a('0x1'));var logger=require(_0xcb4a('0x2'))(_0xcb4a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb4a('0x4'));var attributes=require(_0xcb4a('0x5'));module['exports']=function(_0x213eb9,_0x889ff3){return _0x213eb9[_0xcb4a('0x6')](_0xcb4a('0x7'),attributes,{'tableName':_0xcb4a('0x8'),'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 279addf..af9013c 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 _0x0506=['debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','../../config/utils','rpc','client','http','request','Action,\x20%s,\x20%s','request\x20sent'];(function(_0x5a687a,_0x48b800){var _0x1c0b39=function(_0x521cbb){while(--_0x521cbb){_0x5a687a['push'](_0x5a687a['shift']());}};_0x1c0b39(++_0x48b800);}(_0x0506,0x1d1));var _0x6050=function(_0x97ea8c,_0x18b4d5){_0x97ea8c=_0x97ea8c-0x0;var _0x1d851b=_0x0506[_0x97ea8c];return _0x1d851b;};'use strict';var _=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var moment=require(_0x6050('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6050('0x3'));var logger=require('../../config/logger')(_0x6050('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6050('0x5')][_0x6050('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2a3644,_0x1a89fb,_0x3512ba){return new BPromise(function(_0xf64de5,_0x4068d3){return client[_0x6050('0x7')](_0x2a3644,_0x3512ba)['then'](function(_0x312217){logger['info'](_0x6050('0x8'),_0x1a89fb,_0x6050('0x9'));logger[_0x6050('0xa')](_0x6050('0xb'),_0x1a89fb,_0x6050('0x9'),JSON[_0x6050('0xc')](_0x312217));if(_0x312217[_0x6050('0xd')]){if(_0x312217[_0x6050('0xd')][_0x6050('0xe')]===0x1f4){logger[_0x6050('0xd')]('Action,\x20%s,\x20%s',_0x1a89fb,_0x312217[_0x6050('0xd')]['message']);return _0x4068d3(_0x312217[_0x6050('0xd')][_0x6050('0xf')]);}logger[_0x6050('0xd')](_0x6050('0x8'),_0x1a89fb,_0x312217['error'][_0x6050('0xf')]);return _0xf64de5(_0x312217['error'][_0x6050('0xf')]);}else{logger[_0x6050('0x10')](_0x6050('0x8'),_0x1a89fb,_0x6050('0x9'));_0xf64de5(_0x312217[_0x6050('0x11')][_0x6050('0xf')]);}})[_0x6050('0x12')](function(_0x388de4){logger[_0x6050('0xd')](_0x6050('0x8'),_0x1a89fb,_0x388de4);_0x4068d3(_0x388de4);});});} \ No newline at end of file +var _0xde6c=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3c8679,_0x2faea3){var _0x2791f8=function(_0x45b22f){while(--_0x45b22f){_0x3c8679['push'](_0x3c8679['shift']());}};_0x2791f8(++_0x2faea3);}(_0xde6c,0x119));var _0xcde6=function(_0x187193,_0x24e49d){_0x187193=_0x187193-0x0;var _0x5002aa=_0xde6c[_0x187193];return _0x5002aa;};'use strict';var _=require(_0xcde6('0x0'));var util=require(_0xcde6('0x1'));var moment=require('moment');var BPromise=require(_0xcde6('0x2'));var rs=require(_0xcde6('0x3'));var fs=require('fs');var Redis=require(_0xcde6('0x4'));var db=require(_0xcde6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcde6('0x6'))(_0xcde6('0x7'));var config=require(_0xcde6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcde6('0x9')][_0xcde6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5543d9,_0x4c37b1,_0x2f7de6){return new BPromise(function(_0x4f07e8,_0x19d6b2){return client[_0xcde6('0xb')](_0x5543d9,_0x2f7de6)[_0xcde6('0xc')](function(_0x353b84){logger['info'](_0xcde6('0xd'),_0x4c37b1,_0xcde6('0xe'));logger['debug'](_0xcde6('0xf'),_0x4c37b1,_0xcde6('0xe'),JSON[_0xcde6('0x10')](_0x353b84));if(_0x353b84[_0xcde6('0x11')]){if(_0x353b84[_0xcde6('0x11')][_0xcde6('0x12')]===0x1f4){logger[_0xcde6('0x11')](_0xcde6('0xd'),_0x4c37b1,_0x353b84[_0xcde6('0x11')][_0xcde6('0x13')]);return _0x19d6b2(_0x353b84['error'][_0xcde6('0x13')]);}logger[_0xcde6('0x11')](_0xcde6('0xd'),_0x4c37b1,_0x353b84[_0xcde6('0x11')][_0xcde6('0x13')]);return _0x4f07e8(_0x353b84[_0xcde6('0x11')][_0xcde6('0x13')]);}else{logger[_0xcde6('0x14')](_0xcde6('0xd'),_0x4c37b1,_0xcde6('0xe'));_0x4f07e8(_0x353b84['result'][_0xcde6('0x13')]);}})[_0xcde6('0x15')](function(_0x38f82a){logger['error']('Action,\x20%s,\x20%s',_0x4c37b1,_0x38f82a);_0x19d6b2(_0x38f82a);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 1a9f772..df70e2a 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 _0x5eb8=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x57e22b,_0x4e3356){var _0x5bee54=function(_0x45e90b){while(--_0x45e90b){_0x57e22b['push'](_0x57e22b['shift']());}};_0x5bee54(++_0x4e3356);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3d3b05,_0x334c57){_0x3d3b05=_0x3d3b05-0x0;var _0x2c6ca3=_0x5eb8[_0x3d3b05];return _0x2c6ca3;};'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 auth=require(_0x85eb('0x4'));var interaction=require(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));var controller=require(_0x85eb('0x7'));router[_0x85eb('0x8')](_0x85eb('0x9'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['delete'](_0x85eb('0x9'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xc')]);module['exports']=router; \ No newline at end of file +var _0x74f0=['exports','util','express','Router','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','delete'];(function(_0x3caccf,_0x44fc73){var _0x312fc5=function(_0x5b9aa3){while(--_0x5b9aa3){_0x3caccf['push'](_0x3caccf['shift']());}};_0x312fc5(++_0x44fc73);}(_0x74f0,0xf3));var _0x074f=function(_0x2fdee1,_0x466858){_0x2fdee1=_0x2fdee1-0x0;var _0x2c5533=_0x74f0[_0x2fdee1];return _0x2c5533;};'use strict';var multer=require('multer');var util=require(_0x074f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x074f('0x1'));var router=express[_0x074f('0x2')]();var auth=require(_0x074f('0x3'));var interaction=require(_0x074f('0x4'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x074f('0x5')](_0x074f('0x6'),auth[_0x074f('0x7')](),controller[_0x074f('0x8')]);router[_0x074f('0x9')](_0x074f('0x6'),auth[_0x074f('0x7')](),controller['destroy']);module[_0x074f('0xa')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index b673e3d..84e1b41 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 _0xaaff=['sequelize','exports','STRING','TEXT'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xaaff,0x164));var _0xfaaf=function(_0x116573,_0x234dde){_0x116573=_0x116573-0x0;var _0x4274e0=_0xaaff[_0x116573];return _0x4274e0;};'use strict';var Sequelize=require(_0xfaaf('0x0'));module[_0xfaaf('0x1')]={'name':{'type':Sequelize[_0xfaaf('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfaaf('0x2')]},'parent':{'type':Sequelize[_0xfaaf('0x2')]},'table':{'type':Sequelize[_0xfaaf('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xfaaf('0x3')]}}; \ No newline at end of file +var _0x30fb=['exports','STRING','TEXT','sequelize'];(function(_0x59981f,_0x555884){var _0x7a2501=function(_0x3ac388){while(--_0x3ac388){_0x59981f['push'](_0x59981f['shift']());}};_0x7a2501(++_0x555884);}(_0x30fb,0x1f3));var _0xb30f=function(_0xeeebaa,_0x23ecb3){_0xeeebaa=_0xeeebaa-0x0;var _0x3a9fc4=_0x30fb[_0xeeebaa];return _0x3a9fc4;};'use strict';var Sequelize=require(_0xb30f('0x0'));module[_0xb30f('0x1')]={'name':{'type':Sequelize[_0xb30f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb30f('0x2')]},'parent':{'type':Sequelize[_0xb30f('0x2')]},'table':{'type':Sequelize[_0xb30f('0x2')]},'conditions':{'type':Sequelize[_0xb30f('0x3')]},'joins':{'type':Sequelize[_0xb30f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 7dec28b..379c7ea 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 _0x590a=['QueryTypes','join','cross_join','includes','IS\x20NOT\x20NULL','operator','select','format','SELECT','web','fullPath','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','run','runReport','AVG(%s)','keyBy','clone','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','CustomReports','destroy','stack','name','AnalyticCustomReport','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','right_join','SUM(%s)','COUNT(%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)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','toString','sequelize'];(function(_0x372488,_0x54c871){var _0x1fda80=function(_0x439eba){while(--_0x439eba){_0x372488['push'](_0x372488['shift']());}};_0x1fda80(++_0x54c871);}(_0x590a,0x159));var _0xa590=function(_0xcd80f2,_0x1cfe36){_0xcd80f2=_0xcd80f2-0x0;var _0x2f3a0f=_0x590a[_0xcd80f2];return _0x2f3a0f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa590('0x0'));var rimraf=require(_0xa590('0x1'));var zipdir=require(_0xa590('0x2'));var jsonpatch=require(_0xa590('0x3'));var rp=require(_0xa590('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa590('0x5'));var util=require(_0xa590('0x6'));var path=require(_0xa590('0x7'));var sox=require('sox');var csv=require(_0xa590('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa590('0x9'));var squel=require(_0xa590('0xa'));var crypto=require(_0xa590('0xb'));var jsforce=require(_0xa590('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa590('0xd'));var Papa=require('papaparse');var authService=require(_0xa590('0xe'));var hardwareService=require(_0xa590('0xf'));var Redis=require(_0xa590('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xa590('0x11'))(_0xa590('0x12'));var utils=require(_0xa590('0x13'));var config=require(_0xa590('0x14'));var db=require(_0xa590('0x15'))['db'];function respondWithStatusCode(_0x224ab8,_0x201863){_0x201863=_0x201863||0xcc;return function(_0x570b51){if(_0x570b51){return _0x224ab8['sendStatus'](_0x201863);}return _0x224ab8[_0xa590('0x16')](_0x201863)[_0xa590('0x17')]();};}function respondWithResult(_0x5b23a4,_0x1733ab){_0x1733ab=_0x1733ab||0xc8;return function(_0x52656c){if(_0x52656c){return _0x5b23a4[_0xa590('0x16')](_0x1733ab)[_0xa590('0x18')](_0x52656c);}};}function respondWithFilteredResult(_0x5d914f,_0x569f99){return function(_0x2954af){if(_0x2954af){var _0x5ec6e2=_0x2954af[_0xa590('0x19')],_0x165b81=_0x569f99[_0xa590('0x1a')],_0x6ca5c8=_0x569f99[_0xa590('0x1a')]+_0x569f99[_0xa590('0x1b')],_0x1d218c;if(_0x6ca5c8>=_0x5ec6e2){_0x6ca5c8=_0x5ec6e2;_0x1d218c=0xc8;}else{_0x1d218c=0xce;}_0x5d914f[_0xa590('0x16')](_0x1d218c);return _0x5d914f[_0xa590('0x1c')](_0xa590('0x1d'),_0x165b81+'-'+_0x6ca5c8+'/'+_0x5ec6e2)[_0xa590('0x18')](_0x2954af);}return null;};}function patchUpdates(_0x360a1e){return function(_0x2161ce){try{jsonpatch[_0xa590('0x1e')](_0x2161ce,_0x360a1e,!![]);}catch(_0x352bf6){return BPromise[_0xa590('0x1f')](_0x352bf6);}return _0x2161ce[_0xa590('0x20')]();};}function saveUpdates(_0x37e07e,_0x41687a){return function(_0x12eaec){if(_0x12eaec){return _0x12eaec[_0xa590('0x21')](_0x37e07e)[_0xa590('0x22')](function(_0x544a16){return _0x544a16;});}return null;};}function removeEntity(_0x1fb3fd,_0x1cf866){return function(_0x47d5f4){if(_0x47d5f4){return _0x47d5f4['destroy']()[_0xa590('0x22')](function(){var _0x16113c=_0x47d5f4[_0xa590('0x23')]({'plain':!![]});var _0x20dfa3=_0xa590('0x24');return db['UserProfileResource'][_0xa590('0x25')]({'where':{'type':_0x20dfa3,'resourceId':_0x16113c['id']}})[_0xa590('0x22')](function(){return _0x47d5f4;});})[_0xa590('0x22')](function(){_0x1fb3fd[_0xa590('0x16')](0xcc)[_0xa590('0x17')]();});}};}function handleEntityNotFound(_0x457a32,_0x5a1396){return function(_0x3a9c51){if(!_0x3a9c51){_0x457a32['sendStatus'](0x194);}return _0x3a9c51;};}function handleError(_0x30fd90,_0x41bd71){_0x41bd71=_0x41bd71||0x1f4;return function(_0x46f7dd){logger['error'](_0x46f7dd[_0xa590('0x26')]);if(_0x46f7dd[_0xa590('0x27')]){delete _0x46f7dd[_0xa590('0x27')];}_0x30fd90[_0xa590('0x16')](_0x41bd71)['send'](_0x46f7dd);};}exports['index']=function(_0x2b2f38,_0x391f8c){var _0x6928e4={},_0x115e45={},_0x3b47f1={'count':0x0,'rows':[]};var _0x35a179=db[_0xa590('0x28')]['rawAttributes'];_0x115e45[_0xa590('0x29')]=_[_0xa590('0x2a')](_0x35a179);_0x115e45[_0xa590('0x2b')]=_[_0xa590('0x2a')](_0x2b2f38[_0xa590('0x2b')]);_0x115e45[_0xa590('0x2c')]=_['intersection'](_0x115e45['model'],_0x115e45['query']);_0x6928e4[_0xa590('0x2d')]=_['intersection'](_0x115e45['model'],qs[_0xa590('0x2e')](_0x2b2f38[_0xa590('0x2b')][_0xa590('0x2e')]));_0x6928e4[_0xa590('0x2d')]=_0x6928e4['attributes'][_0xa590('0x2f')]?_0x6928e4[_0xa590('0x2d')]:_0x115e45['model'];if(!_0x2b2f38[_0xa590('0x2b')][_0xa590('0x30')](_0xa590('0x31'))){_0x6928e4[_0xa590('0x1b')]=qs[_0xa590('0x1b')](_0x2b2f38['query'][_0xa590('0x1b')]);_0x6928e4['offset']=qs[_0xa590('0x1a')](_0x2b2f38[_0xa590('0x2b')][_0xa590('0x1a')]);}_0x6928e4[_0xa590('0x32')]=qs['sort'](_0x2b2f38[_0xa590('0x2b')][_0xa590('0x33')]);_0x6928e4[_0xa590('0x34')]=qs[_0xa590('0x2c')](_[_0xa590('0x35')](_0x2b2f38[_0xa590('0x2b')],_0x115e45['filters']));if(_0x2b2f38[_0xa590('0x2b')][_0xa590('0x36')]){_0x6928e4[_0xa590('0x34')]=_[_0xa590('0x37')](_0x6928e4[_0xa590('0x34')],{'$or':_[_0xa590('0x38')](_0x35a179,function(_0x1cbf57){if(_0x1cbf57[_0xa590('0x39')][_0xa590('0x3a')]!==_0xa590('0x3b')){var _0x262405={};_0x262405[_0x1cbf57['field']]={'$like':'%'+_0x2b2f38['query']['filter']+'%'};return _0x262405;}})});}_0x6928e4=_[_0xa590('0x37')]({},_0x6928e4,_0x2b2f38[_0xa590('0x3c')]);var _0x283e03={'where':_0x6928e4[_0xa590('0x34')]};return db[_0xa590('0x28')][_0xa590('0x19')](_0x283e03)['then'](function(_0x2e1217){_0x3b47f1[_0xa590('0x19')]=_0x2e1217;if(_0x2b2f38[_0xa590('0x2b')][_0xa590('0x3d')]){_0x6928e4[_0xa590('0x3e')]=[{'all':!![]}];}return db[_0xa590('0x28')][_0xa590('0x3f')](_0x6928e4);})['then'](function(_0x147766){_0x3b47f1['rows']=_0x147766;return _0x3b47f1;})[_0xa590('0x22')](respondWithFilteredResult(_0x391f8c,_0x6928e4))[_0xa590('0x40')](handleError(_0x391f8c,null));};exports[_0xa590('0x41')]=function(_0x919b4a,_0x2895d4){var _0x2f89c6={'raw':![],'where':{'id':_0x919b4a[_0xa590('0x42')]['id']}},_0x4382df={};_0x4382df[_0xa590('0x29')]=_[_0xa590('0x2a')](db[_0xa590('0x28')]['rawAttributes']);_0x4382df[_0xa590('0x2b')]=_[_0xa590('0x2a')](_0x919b4a[_0xa590('0x2b')]);_0x4382df[_0xa590('0x2c')]=_[_0xa590('0x43')](_0x4382df['model'],_0x4382df['query']);_0x2f89c6[_0xa590('0x2d')]=_[_0xa590('0x43')](_0x4382df[_0xa590('0x29')],qs[_0xa590('0x2e')](_0x919b4a['query'][_0xa590('0x2e')]));_0x2f89c6['attributes']=_0x2f89c6[_0xa590('0x2d')]['length']?_0x2f89c6[_0xa590('0x2d')]:_0x4382df['model'];if(_0x919b4a[_0xa590('0x2b')]['includeAll']){_0x2f89c6['include']=[{'all':!![]}];}_0x2f89c6=_[_0xa590('0x37')]({},_0x2f89c6,_0x919b4a[_0xa590('0x3c')]);return db[_0xa590('0x28')][_0xa590('0x44')](_0x2f89c6)[_0xa590('0x22')](handleEntityNotFound(_0x2895d4,null))[_0xa590('0x22')](respondWithResult(_0x2895d4,null))['catch'](handleError(_0x2895d4,null));};exports['create']=function(_0x41b7f1,_0x5e1814){return db[_0xa590('0x28')][_0xa590('0x45')](_0x41b7f1[_0xa590('0x46')],{})[_0xa590('0x22')](function(_0x3bc106){var _0x48f82f=_0x41b7f1['user'][_0xa590('0x23')]({'plain':!![]});if(!_0x48f82f)throw new Error(_0xa590('0x47'));if(_0x48f82f[_0xa590('0x48')]==='user'){var _0x4745fe=_0x3bc106['get']({'plain':!![]});var _0x196b84=_0xa590('0x49');return db[_0xa590('0x4a')][_0xa590('0x44')]({'where':{'name':_0x196b84,'userProfileId':_0x48f82f['userProfileId']},'raw':!![]})[_0xa590('0x22')](function(_0x3b046a){if(_0x3b046a&&_0x3b046a['autoAssociation']===0x0){return db['UserProfileResource'][_0xa590('0x45')]({'name':_0x4745fe[_0xa590('0x27')],'resourceId':_0x4745fe['id'],'type':_0xa590('0x24'),'sectionId':_0x3b046a['id']},{})[_0xa590('0x22')](function(){return _0x3bc106;});}else{return _0x3bc106;}})['catch'](function(_0x2d3368){logger['error'](_0xa590('0x4b'),_0x2d3368);throw _0x2d3368;});}return _0x3bc106;})[_0xa590('0x22')](respondWithResult(_0x5e1814,0xc9))[_0xa590('0x40')](handleError(_0x5e1814,null));};exports['update']=function(_0xa83ae5,_0x2f5ace){if(_0xa83ae5[_0xa590('0x46')]['id']){delete _0xa83ae5[_0xa590('0x46')]['id'];}return db[_0xa590('0x28')][_0xa590('0x44')]({'where':{'id':_0xa83ae5[_0xa590('0x42')]['id']}})[_0xa590('0x22')](handleEntityNotFound(_0x2f5ace,null))[_0xa590('0x22')](saveUpdates(_0xa83ae5['body'],null))[_0xa590('0x22')](respondWithResult(_0x2f5ace,null))[_0xa590('0x40')](handleError(_0x2f5ace,null));};exports[_0xa590('0x25')]=function(_0x4c9d59,_0x539569){return db['AnalyticCustomReport'][_0xa590('0x44')]({'where':{'id':_0x4c9d59[_0xa590('0x42')]['id']}})[_0xa590('0x22')](handleEntityNotFound(_0x539569,null))[_0xa590('0x22')](removeEntity(_0x539569,null))[_0xa590('0x40')](handleError(_0x539569,null));};exports['preview']=function(_0x49e13d,_0x279ea6){var _0x33e944=0xa;var _0x1d2a61=['join',_0xa590('0x4c'),_0xa590('0x4d'),'cross_join'];var _0x52d45d={'SUM':_0xa590('0x4e'),'COUNT':_0xa590('0x4f'),'COUNT DISTINCT':_0xa590('0x50'),'MAX':_0xa590('0x51'),'MIN':_0xa590('0x52'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa590('0x53'),'GROUP_CONCAT ASC':_0xa590('0x54'),'GROUP_CONCAT DESC':_0xa590('0x55')};var _0x35c25b={'SEC_TO_TIME':_0xa590('0x56'),'DATE':_0xa590('0x57'),'HOUR':_0xa590('0x58'),'ROUND':_0xa590('0x59'),'UNIX_TIMESTAMP':_0xa590('0x5a')};var _0x5acb6c=function(_0x3e98fb){return!_['includes']([_0xa590('0x5b'),'IS\x20NOT\x20NULL',_0xa590('0x5c'),_0xa590('0x5d')],_0x3e98fb);};var _0x3e3ec8=function(_0x57ebd2){if(!_0x57ebd2||!_0x57ebd2['rules'][_0xa590('0x2f')]){return'';}for(var _0x53250e='(',_0x277dff=0x0;_0x277dff<_0x57ebd2['rules'][_0xa590('0x2f')];_0x277dff+=0x1){_0x277dff>0x0&&(_0x53250e+='\x20'+_0x57ebd2['operator']+'\x20');_0x53250e+=_0x57ebd2[_0xa590('0x5e')][_0x277dff]['group']?_0x3e3ec8(_0x57ebd2['rules'][_0x277dff][_0xa590('0x5f')]):_0x57ebd2[_0xa590('0x5e')][_0x277dff][_0xa590('0x60')]+'\x20'+_0x57ebd2[_0xa590('0x5e')][_0x277dff]['condition']+(_0x5acb6c(_0x57ebd2[_0xa590('0x5e')][_0x277dff][_0xa590('0x61')])?'\x20'+_0x57ebd2[_0xa590('0x5e')][_0x277dff][_0xa590('0x62')]:'');}return _0x53250e+')';};var _0x3660ff={'where':{'id':_0x49e13d[_0xa590('0x42')]['id']}},_0xcb7399,_0x48b2ea,_0x457c7f,_0x16d232,_0x552bcd;_0x3660ff=_['merge']({},_0x3660ff,_0x49e13d[_0xa590('0x3c')]);return db[_0xa590('0x28')][_0xa590('0x44')](_0x3660ff)[_0xa590('0x22')](function(_0x30ca42){if(_0x30ca42){_0xcb7399=_0x30ca42;return _0x30ca42['getFields']();}return null;})[_0xa590('0x22')](function(_0x524a3f){if(_0x524a3f){if(!_0x524a3f[_0xa590('0x2f')]){throw new db[(_0xa590('0x63'))][(_0xa590('0x64'))](_0xa590('0x65'),0x193);}_0x48b2ea=_0x524a3f;return db[_0xa590('0x66')][_0xa590('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x417f42){if(_0x417f42){_0x457c7f=_['keyBy'](_0x417f42,'id');var _0x35850b;var _0x39789d=squel['select']();_0x39789d[_0xa590('0x67')](_0xcb7399[_0xa590('0x68')]);for(var _0x9082ac=0x0;_0x9082ac<_0x48b2ea[_0xa590('0x2f')];_0x9082ac+=0x1){_0x35850b=_0x48b2ea[_0x9082ac][_0xa590('0x69')]?_0x457c7f[_0x48b2ea[_0x9082ac]['MetricId']][_0xa590('0x6a')]:_0x48b2ea[_0x9082ac][_0xa590('0x60')];_0x35850b=_0x48b2ea[_0x9082ac][_0xa590('0x6b')]?_[_0xa590('0x6c')](_0x52d45d[_0x48b2ea[_0x9082ac][_0xa590('0x6b')]],'%s',_0x35850b):_0x35850b;_0x35850b=_0x48b2ea[_0x9082ac]['format']?_[_0xa590('0x6c')](_0x35c25b[_0x48b2ea[_0x9082ac]['format']],'%s',_0x35850b):_0x35850b;if(_0x48b2ea[_0x9082ac][_0xa590('0x6d')]){_0x39789d[_0xa590('0x5f')](_0x35850b);}_0x48b2ea[_0x9082ac][_0xa590('0x6e')]&&_0x39789d[_0xa590('0x32')](_0x35850b,_0x48b2ea[_0x9082ac][_0xa590('0x6e')]===_0xa590('0x6f')?![]:!![]);_0x39789d[_0xa590('0x60')](_0x35850b,_0x48b2ea[_0x9082ac][_0xa590('0x70')]||_0x35850b);}if(_0xcb7399[_0xa590('0x71')]){_0xcb7399[_0xa590('0x71')]=JSON[_0xa590('0x72')](_0xcb7399[_0xa590('0x71')]);for(var _0x326033=0x0;_0x326033<_0xcb7399['joins']['length'];_0x326033+=0x1){if(_0xcb7399[_0xa590('0x71')][_0x326033][_0xa590('0x39')]&&_['includes'](_0x1d2a61,_0xcb7399[_0xa590('0x71')][_0x326033][_0xa590('0x39')])&&_0xcb7399[_0xa590('0x71')][_0x326033][_0xa590('0x73')]&&_0xcb7399[_0xa590('0x71')][_0x326033]['foreignTable']&&_0xcb7399[_0xa590('0x71')][_0x326033][_0xa590('0x74')]){_0x39789d[_0xcb7399['joins'][_0x326033]['type']](_0xcb7399[_0xa590('0x71')][_0x326033][_0xa590('0x75')],null,util['format'](_0xa590('0x76'),_0xcb7399['table'],_0xcb7399[_0xa590('0x71')][_0x326033][_0xa590('0x73')],_0xcb7399['joins'][_0x326033][_0xa590('0x75')],_0xcb7399[_0xa590('0x71')][_0x326033][_0xa590('0x74')]));}}}if(_0xcb7399[_0xa590('0x77')]){_0xcb7399['conditions']=JSON['parse'](_0xcb7399[_0xa590('0x77')]);_0x39789d[_0xa590('0x34')](_0x3e3ec8(_0xcb7399[_0xa590('0x77')]['group']));}_0x552bcd=_0x39789d['clone']();_0x39789d['limit'](_0x33e944);_0x39789d['offset'](0x0);logger['debug'](_0xa590('0x78'),_0x39789d[_0xa590('0x79')]());return db[_0xa590('0x7a')][_0xa590('0x2b')](_0x39789d[_0xa590('0x79')](),{'type':db['sequelize'][_0xa590('0x7b')]['SELECT']});}})[_0xa590('0x22')](respondWithResult(_0x279ea6,null))['catch'](handleError(_0x279ea6,null));};function runReport(_0x408e0c,_0x31f89d,_0x3f8b5c){var _0x5e99a4=_0x31f89d[_0xa590('0x27')];var _0x53e4e0=0xa;var _0x2993bb=[_0xa590('0x7c'),_0xa590('0x4c'),'right_join',_0xa590('0x7d')];var _0x44de6a={'SUM':_0xa590('0x4e'),'COUNT':_0xa590('0x4f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa590('0x51'),'MIN':_0xa590('0x52'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa590('0x53'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa590('0x55')};var _0x12d4e4={'SEC_TO_TIME':_0xa590('0x56'),'DATE':_0xa590('0x57'),'HOUR':'HOUR(%s)','ROUND':_0xa590('0x59'),'UNIX_TIMESTAMP':_0xa590('0x5a')};var _0x48026a=function(_0x467b2a){return!_[_0xa590('0x7e')]([_0xa590('0x5b'),_0xa590('0x7f'),'IS\x20EMPTY',_0xa590('0x5d')],_0x467b2a);};var _0x22e581=function(_0x738996){if(!_0x738996||!_0x738996['rules']['length']){return'';}for(var _0x1f526f='(',_0x111d13=0x0;_0x111d13<_0x738996[_0xa590('0x5e')][_0xa590('0x2f')];_0x111d13+=0x1){_0x111d13>0x0&&(_0x1f526f+='\x20'+_0x738996[_0xa590('0x80')]+'\x20');_0x1f526f+=_0x738996[_0xa590('0x5e')][_0x111d13][_0xa590('0x5f')]?_0x22e581(_0x738996[_0xa590('0x5e')][_0x111d13][_0xa590('0x5f')]):_0x738996[_0xa590('0x5e')][_0x111d13][_0xa590('0x60')]+'\x20'+_0x738996[_0xa590('0x5e')][_0x111d13]['condition']+(_0x48026a(_0x738996['rules'][_0x111d13][_0xa590('0x61')])?'\x20'+_0x738996['rules'][_0x111d13]['value']:'');}return _0x1f526f+')';};var _0x5a1cb9={'where':{'id':_0x408e0c['id']}},_0x4deb50,_0x15ba87,_0x3e179d,_0x535113,_0x3b4c4b;_0x5a1cb9=_[_0xa590('0x37')]({},_0x5a1cb9,_0x3f8b5c);return db[_0xa590('0x28')][_0xa590('0x44')](_0x5a1cb9)[_0xa590('0x22')](function(_0x969e6a){if(_0x969e6a){_0x4deb50=_0x969e6a;return _0x969e6a['getFields']();}return null;})[_0xa590('0x22')](function(_0x40fb3a){if(_0x40fb3a){if(!_0x40fb3a[_0xa590('0x2f')]){throw new db['Sequelize'][(_0xa590('0x64'))](_0xa590('0x65'),0x193);}_0x15ba87=_0x40fb3a;return db[_0xa590('0x66')][_0xa590('0x3f')]({'raw':!![]});}return null;})[_0xa590('0x22')](function(_0x5856cc){if(_0x5856cc){_0x3e179d=_['keyBy'](_0x5856cc,'id');var _0x72414b;var _0x5fa2c2=squel[_0xa590('0x81')]();_0x5fa2c2[_0xa590('0x67')](_0x4deb50['table']);for(var _0x2693e1=0x0;_0x2693e1<_0x15ba87['length'];_0x2693e1+=0x1){_0x72414b=_0x15ba87[_0x2693e1][_0xa590('0x69')]?_0x3e179d[_0x15ba87[_0x2693e1][_0xa590('0x69')]][_0xa590('0x6a')]:_0x15ba87[_0x2693e1][_0xa590('0x60')];_0x72414b=_0x15ba87[_0x2693e1][_0xa590('0x6b')]?_[_0xa590('0x6c')](_0x44de6a[_0x15ba87[_0x2693e1][_0xa590('0x6b')]],'%s',_0x72414b):_0x72414b;_0x72414b=_0x15ba87[_0x2693e1][_0xa590('0x82')]?_['replace'](_0x12d4e4[_0x15ba87[_0x2693e1][_0xa590('0x82')]],'%s',_0x72414b):_0x72414b;if(_0x15ba87[_0x2693e1][_0xa590('0x6d')]){_0x5fa2c2[_0xa590('0x5f')](_0x72414b);}_0x15ba87[_0x2693e1]['orderBy']&&_0x5fa2c2[_0xa590('0x32')](_0x72414b,_0x15ba87[_0x2693e1]['orderBy']===_0xa590('0x6f')?![]:!![]);_0x5fa2c2[_0xa590('0x60')](_0x72414b,_0x15ba87[_0x2693e1][_0xa590('0x70')]||_0x72414b);}if(_0x4deb50['joins']){_0x4deb50[_0xa590('0x71')]=JSON[_0xa590('0x72')](_0x4deb50[_0xa590('0x71')]);for(var _0x1b3398=0x0;_0x1b3398<_0x4deb50[_0xa590('0x71')]['length'];_0x1b3398+=0x1){if(_0x4deb50[_0xa590('0x71')][_0x1b3398][_0xa590('0x39')]&&_[_0xa590('0x7e')](_0x2993bb,_0x4deb50[_0xa590('0x71')][_0x1b3398]['type'])&&_0x4deb50[_0xa590('0x71')][_0x1b3398][_0xa590('0x73')]&&_0x4deb50['joins'][_0x1b3398][_0xa590('0x75')]&&_0x4deb50['joins'][_0x1b3398][_0xa590('0x74')]){_0x5fa2c2[_0x4deb50['joins'][_0x1b3398][_0xa590('0x39')]](_0x4deb50[_0xa590('0x71')][_0x1b3398][_0xa590('0x75')],null,util[_0xa590('0x82')](_0xa590('0x76'),_0x4deb50[_0xa590('0x68')],_0x4deb50[_0xa590('0x71')][_0x1b3398]['parentKey'],_0x4deb50[_0xa590('0x71')][_0x1b3398][_0xa590('0x75')],_0x4deb50['joins'][_0x1b3398][_0xa590('0x74')]));}}}if(_0x4deb50[_0xa590('0x77')]){_0x4deb50[_0xa590('0x77')]=JSON[_0xa590('0x72')](_0x4deb50[_0xa590('0x77')]);_0x5fa2c2[_0xa590('0x34')](_0x22e581(_0x4deb50[_0xa590('0x77')][_0xa590('0x5f')]));}_0x3b4c4b=_0x5fa2c2['clone']();_0x5fa2c2[_0xa590('0x1b')](_0x53e4e0);_0x5fa2c2[_0xa590('0x1a')](0x0);logger['debug']('Limited\x20Query:',_0x5fa2c2['toString']());return db[_0xa590('0x7a')][_0xa590('0x2b')](_0x5fa2c2[_0xa590('0x79')](),{'type':db[_0xa590('0x7a')][_0xa590('0x7b')][_0xa590('0x83')]});}})[_0xa590('0x22')](function(_0x9cd4c7){if(!_0x9cd4c7['length']){throw new db[(_0xa590('0x63'))]['ValidationErrorItem']('No\x20available\x20data',0xcc);}if(_0x31f89d['output']===_0xa590('0x84')){return null;}var _0x4bed37=_[_0xa590('0x37')](_0x31f89d,{'name':_0x31f89d[_0xa590('0x85')]||_0x31f89d[_0xa590('0x27')]||_0x4deb50[_0xa590('0x27')],'basename':_0x5e99a4,'savename':util[_0xa590('0x82')]('%s-%s.%s',_0x31f89d[_0xa590('0x27')]||_0x4deb50[_0xa590('0x27')],require('randomstring')[_0xa590('0x86')](0x4),_0x31f89d[_0xa590('0x87')]||_0xa590('0x88')),'reportId':_0x4deb50['id'],'reportType':_0xa590('0x89')});return db[_0xa590('0x8a')][_0xa590('0x45')](_0x4bed37,{'raw':!![]});})[_0xa590('0x22')](function(_0x281c51){if(_0x4deb50[_0xa590('0x68')]===_0xa590('0x8b')){_0x3b4c4b[_0xa590('0x34')](_0x4deb50[_0xa590('0x68')]+_0xa590('0x8c'),_0x31f89d[_0xa590('0x8d')],_0x31f89d['endDate']);}else{_0x3b4c4b['where'](_0x4deb50[_0xa590('0x68')]+_0xa590('0x8e'),_0x31f89d[_0xa590('0x8d')],_0x31f89d[_0xa590('0x8f')]);}if(_0x281c51){logger['info'](_0xa590('0x90'),_0x3b4c4b['toString']());require(_0xa590('0x91'))['fork'](path['join'](__dirname,_0xa590('0x92'),_0x281c51[_0xa590('0x87')]),[_0x281c51['id'],_0x3b4c4b[_0xa590('0x79')](),path[_0xa590('0x7c')](__dirname,_0xa590('0x93'),_0x281c51[_0xa590('0x94')]),_0x5e99a4]);return _0x281c51;}else{var _0x335023=squel[_0xa590('0x81')]();_0x335023[_0xa590('0x67')]('('+_0x3b4c4b[_0xa590('0x79')]()+')',_0xa590('0x95'));_0x335023[_0xa590('0x60')]('COUNT(*)','count');_0x3b4c4b[_0xa590('0x1b')](_0x31f89d[_0xa590('0x1b')]||_0x53e4e0);_0x3b4c4b['offset'](_0x31f89d['offset']||0x0);return db['sequelize'][_0xa590('0x2b')](_0x335023['toString'](),{'type':db[_0xa590('0x7a')]['QueryTypes'][_0xa590('0x83')]})[_0xa590('0x22')](function(_0x34d581){if(!_0x34d581['length']){_0x535113=0x0;}else{_0x535113=_0x34d581[0x0][_0xa590('0x19')]||0x0;}return db['sequelize'][_0xa590('0x2b')](_0x3b4c4b[_0xa590('0x79')](),{'type':db[_0xa590('0x7a')][_0xa590('0x7b')]['SELECT']});})[_0xa590('0x22')](function(_0x3e71cc){return{'rows':_0x3e71cc||[],'count':_0x535113};});}});}exports[_0xa590('0x96')]=function(_0x614238,_0x39a742){return runReport(_0x614238['params'],_0x614238['query'],_0x614238[_0xa590('0x3c')])[_0xa590('0x22')](respondWithResult(_0x39a742,null))[_0xa590('0x40')](handleError(_0x39a742,null));};exports[_0xa590('0x97')]=runReport;exports[_0xa590('0x2b')]=function(_0x42cfee,_0x32e792){var _0x70ab8f=0xa;var _0x4e591d=['join',_0xa590('0x4c'),_0xa590('0x4d'),_0xa590('0x7d')];var _0x26194e={'SUM':_0xa590('0x4e'),'COUNT':_0xa590('0x4f'),'COUNT DISTINCT':_0xa590('0x50'),'MAX':_0xa590('0x51'),'MIN':_0xa590('0x52'),'AVG':_0xa590('0x98'),'GROUP_CONCAT':_0xa590('0x53'),'GROUP_CONCAT ASC':_0xa590('0x54'),'GROUP_CONCAT DESC':_0xa590('0x55')};var _0x3a97d2={'SEC_TO_TIME':_0xa590('0x56'),'DATE':_0xa590('0x57'),'HOUR':'HOUR(%s)','ROUND':_0xa590('0x59'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x33e7e6=function(_0x5e382c){return!_[_0xa590('0x7e')](['IS\x20NULL',_0xa590('0x7f'),_0xa590('0x5c'),_0xa590('0x5d')],_0x5e382c);};var _0x2d5ce5=function(_0x4e4af7){if(!_0x4e4af7||!_0x4e4af7[_0xa590('0x5e')][_0xa590('0x2f')]){return'';}for(var _0x300f07='(',_0x3bf150=0x0;_0x3bf150<_0x4e4af7[_0xa590('0x5e')]['length'];_0x3bf150+=0x1){_0x3bf150>0x0&&(_0x300f07+='\x20'+_0x4e4af7[_0xa590('0x80')]+'\x20');_0x300f07+=_0x4e4af7[_0xa590('0x5e')][_0x3bf150]['group']?_0x2d5ce5(_0x4e4af7[_0xa590('0x5e')][_0x3bf150][_0xa590('0x5f')]):_0x4e4af7[_0xa590('0x5e')][_0x3bf150][_0xa590('0x60')]+'\x20'+_0x4e4af7[_0xa590('0x5e')][_0x3bf150][_0xa590('0x61')]+(_0x33e7e6(_0x4e4af7['rules'][_0x3bf150][_0xa590('0x61')])?'\x20'+_0x4e4af7['rules'][_0x3bf150][_0xa590('0x62')]:'');}return _0x300f07+')';};var _0x20a6ee={'where':{'id':_0x42cfee[_0xa590('0x42')]['id']}},_0x158085,_0x3adef5,_0x1165a4,_0xb7ab4d,_0x466e78;_0x20a6ee=_[_0xa590('0x37')]({},_0x20a6ee,_0x42cfee[_0xa590('0x3c')]);return db[_0xa590('0x28')][_0xa590('0x44')](_0x20a6ee)[_0xa590('0x22')](function(_0x3970e2){if(_0x3970e2){_0x158085=_0x3970e2;return _0x3970e2['getFields']();}return null;})['then'](function(_0x9f85f6){if(_0x9f85f6){if(!_0x9f85f6['length']){throw new db[(_0xa590('0x63'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3adef5=_0x9f85f6;return db[_0xa590('0x66')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x5b9e30){if(_0x5b9e30){_0x1165a4=_[_0xa590('0x99')](_0x5b9e30,'id');var _0x502f55;var _0x450f9b=squel[_0xa590('0x81')]();_0x450f9b[_0xa590('0x67')](_0x158085[_0xa590('0x68')]);for(var _0x22af69=0x0;_0x22af69<_0x3adef5[_0xa590('0x2f')];_0x22af69+=0x1){_0x502f55=_0x3adef5[_0x22af69][_0xa590('0x69')]?_0x1165a4[_0x3adef5[_0x22af69][_0xa590('0x69')]][_0xa590('0x6a')]:_0x3adef5[_0x22af69][_0xa590('0x60')];_0x502f55=_0x3adef5[_0x22af69][_0xa590('0x6b')]?_[_0xa590('0x6c')](_0x26194e[_0x3adef5[_0x22af69][_0xa590('0x6b')]],'%s',_0x502f55):_0x502f55;_0x502f55=_0x3adef5[_0x22af69][_0xa590('0x82')]?_[_0xa590('0x6c')](_0x3a97d2[_0x3adef5[_0x22af69]['format']],'%s',_0x502f55):_0x502f55;if(_0x3adef5[_0x22af69][_0xa590('0x6d')]){_0x450f9b[_0xa590('0x5f')](_0x502f55);}_0x3adef5[_0x22af69][_0xa590('0x6e')]&&_0x450f9b[_0xa590('0x32')](_0x502f55,_0x3adef5[_0x22af69]['orderBy']===_0xa590('0x6f')?![]:!![]);_0x450f9b[_0xa590('0x60')](_0x502f55,_0x3adef5[_0x22af69][_0xa590('0x70')]||_0x502f55);}if(_0x158085['joins']){_0x158085['joins']=JSON[_0xa590('0x72')](_0x158085['joins']);for(var _0x1e6a94=0x0;_0x1e6a94<_0x158085[_0xa590('0x71')]['length'];_0x1e6a94+=0x1){if(_0x158085[_0xa590('0x71')][_0x1e6a94][_0xa590('0x39')]&&_['includes'](_0x4e591d,_0x158085[_0xa590('0x71')][_0x1e6a94]['type'])&&_0x158085[_0xa590('0x71')][_0x1e6a94][_0xa590('0x73')]&&_0x158085[_0xa590('0x71')][_0x1e6a94][_0xa590('0x75')]&&_0x158085[_0xa590('0x71')][_0x1e6a94][_0xa590('0x74')]){_0x450f9b[_0x158085[_0xa590('0x71')][_0x1e6a94][_0xa590('0x39')]](_0x158085[_0xa590('0x71')][_0x1e6a94][_0xa590('0x75')],null,util['format'](_0xa590('0x76'),_0x158085[_0xa590('0x68')],_0x158085['joins'][_0x1e6a94]['parentKey'],_0x158085[_0xa590('0x71')][_0x1e6a94]['foreignTable'],_0x158085['joins'][_0x1e6a94][_0xa590('0x74')]));}}}if(_0x158085['conditions']){_0x158085['conditions']=JSON['parse'](_0x158085['conditions']);_0x450f9b[_0xa590('0x34')](_0x2d5ce5(_0x158085['conditions'][_0xa590('0x5f')]));}_0x466e78=_0x450f9b[_0xa590('0x9a')]();_0x450f9b[_0xa590('0x1b')](_0x70ab8f);_0x450f9b[_0xa590('0x1a')](0x0);logger[_0xa590('0x9b')](_0xa590('0x78'),_0x450f9b[_0xa590('0x79')]());return db['sequelize'][_0xa590('0x2b')](_0x450f9b['toString'](),{'type':db[_0xa590('0x7a')]['QueryTypes'][_0xa590('0x83')]});}})[_0xa590('0x22')](function(){return{'sql':_0x466e78[_0xa590('0x79')]()};})[_0xa590('0x22')](respondWithResult(_0x32e792,null))[_0xa590('0x40')](handleError(_0x32e792,null));}; \ No newline at end of file +var _0x6f54=['includes','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','operator','getFields','Please\x20insert\x20at\x20least\x20one\x20field','MetricId','alias','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','debug','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','then','get','destroy','error','name','send','AnalyticCustomReport','rawAttributes','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','metric','function','replace','format','groupBy','orderBy','joins','parse'];(function(_0x532d5b,_0x1b002a){var _0x22168c=function(_0xa3272c){while(--_0xa3272c){_0x532d5b['push'](_0x532d5b['shift']());}};_0x22168c(++_0x1b002a);}(_0x6f54,0xcf));var _0x46f5=function(_0x4ea9b2,_0x2a89e9){_0x4ea9b2=_0x4ea9b2-0x0;var _0x548091=_0x6f54[_0x4ea9b2];return _0x548091;};'use strict';var pdf=require(_0x46f5('0x0'));var emlformat=require(_0x46f5('0x1'));var rimraf=require(_0x46f5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x46f5('0x3'));var moment=require(_0x46f5('0x4'));var BPromise=require(_0x46f5('0x5'));var Mustache=require(_0x46f5('0x6'));var util=require('util');var path=require(_0x46f5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x46f5('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x46f5('0x9'));var crypto=require(_0x46f5('0xa'));var jsforce=require(_0x46f5('0xb'));var deskjs=require(_0x46f5('0xc'));var toCsv=require(_0x46f5('0xd'));var querystring=require(_0x46f5('0xe'));var Papa=require(_0x46f5('0xf'));var authService=require(_0x46f5('0x10'));var hardwareService=require(_0x46f5('0x11'));var Redis=require(_0x46f5('0x12'));var qs=require(_0x46f5('0x13'));var logger=require(_0x46f5('0x14'))(_0x46f5('0x15'));var utils=require(_0x46f5('0x16'));var config=require('../../config/environment');var db=require(_0x46f5('0x17'))['db'];function respondWithStatusCode(_0xf47c08,_0x135792){_0x135792=_0x135792||0xcc;return function(_0x5c6df5){if(_0x5c6df5){return _0xf47c08[_0x46f5('0x18')](_0x135792);}return _0xf47c08[_0x46f5('0x19')](_0x135792)['end']();};}function respondWithResult(_0x19d77d,_0x3d5dd3){_0x3d5dd3=_0x3d5dd3||0xc8;return function(_0x1b1d34){if(_0x1b1d34){return _0x19d77d[_0x46f5('0x19')](_0x3d5dd3)['json'](_0x1b1d34);}};}function respondWithFilteredResult(_0x4ca477,_0x3b70e9){return function(_0x40a47e){if(_0x40a47e){var _0x52674d=_0x40a47e[_0x46f5('0x1a')],_0xd57cc6=_0x3b70e9[_0x46f5('0x1b')],_0x3960e6=_0x3b70e9[_0x46f5('0x1b')]+_0x3b70e9[_0x46f5('0x1c')],_0x2c4e13;if(_0x3960e6>=_0x52674d){_0x3960e6=_0x52674d;_0x2c4e13=0xc8;}else{_0x2c4e13=0xce;}_0x4ca477[_0x46f5('0x19')](_0x2c4e13);return _0x4ca477['set'](_0x46f5('0x1d'),_0xd57cc6+'-'+_0x3960e6+'/'+_0x52674d)[_0x46f5('0x1e')](_0x40a47e);}return null;};}function patchUpdates(_0x3c3e48){return function(_0x9f9165){try{jsonpatch['apply'](_0x9f9165,_0x3c3e48,!![]);}catch(_0x389831){return BPromise[_0x46f5('0x1f')](_0x389831);}return _0x9f9165[_0x46f5('0x20')]();};}function saveUpdates(_0x2094b0,_0xf3a7e9){return function(_0x425a2e){if(_0x425a2e){return _0x425a2e['update'](_0x2094b0)[_0x46f5('0x21')](function(_0x3ed408){return _0x3ed408;});}return null;};}function removeEntity(_0xb329aa,_0x3bf405){return function(_0x49556c){if(_0x49556c){return _0x49556c['destroy']()[_0x46f5('0x21')](function(){var _0x36e2e4=_0x49556c[_0x46f5('0x22')]({'plain':!![]});var _0x2a004d='CustomReports';return db['UserProfileResource'][_0x46f5('0x23')]({'where':{'type':_0x2a004d,'resourceId':_0x36e2e4['id']}})['then'](function(){return _0x49556c;});})[_0x46f5('0x21')](function(){_0xb329aa[_0x46f5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aa949,_0x1aa8ff){return function(_0x21374d){if(!_0x21374d){_0x3aa949[_0x46f5('0x18')](0x194);}return _0x21374d;};}function handleError(_0x4f9520,_0x5ec5d7){_0x5ec5d7=_0x5ec5d7||0x1f4;return function(_0x257918){logger[_0x46f5('0x24')](_0x257918['stack']);if(_0x257918['name']){delete _0x257918[_0x46f5('0x25')];}_0x4f9520[_0x46f5('0x19')](_0x5ec5d7)[_0x46f5('0x26')](_0x257918);};}exports['index']=function(_0x48b761,_0x524c98){var _0x9a9a9e={},_0x133a78={},_0x42837f={'count':0x0,'rows':[]};var _0x54524b=db[_0x46f5('0x27')][_0x46f5('0x28')];_0x133a78['model']=_['keys'](_0x54524b);_0x133a78[_0x46f5('0x29')]=_[_0x46f5('0x2a')](_0x48b761[_0x46f5('0x29')]);_0x133a78[_0x46f5('0x2b')]=_[_0x46f5('0x2c')](_0x133a78['model'],_0x133a78[_0x46f5('0x29')]);_0x9a9a9e[_0x46f5('0x2d')]=_[_0x46f5('0x2c')](_0x133a78['model'],qs['fields'](_0x48b761['query'][_0x46f5('0x2e')]));_0x9a9a9e[_0x46f5('0x2d')]=_0x9a9a9e[_0x46f5('0x2d')]['length']?_0x9a9a9e[_0x46f5('0x2d')]:_0x133a78[_0x46f5('0x2f')];if(!_0x48b761['query'][_0x46f5('0x30')](_0x46f5('0x31'))){_0x9a9a9e[_0x46f5('0x1c')]=qs[_0x46f5('0x1c')](_0x48b761['query'][_0x46f5('0x1c')]);_0x9a9a9e['offset']=qs[_0x46f5('0x1b')](_0x48b761['query'][_0x46f5('0x1b')]);}_0x9a9a9e[_0x46f5('0x32')]=qs[_0x46f5('0x33')](_0x48b761['query'][_0x46f5('0x33')]);_0x9a9a9e[_0x46f5('0x34')]=qs[_0x46f5('0x2b')](_[_0x46f5('0x35')](_0x48b761[_0x46f5('0x29')],_0x133a78['filters']));if(_0x48b761[_0x46f5('0x29')][_0x46f5('0x36')]){_0x9a9a9e[_0x46f5('0x34')]=_[_0x46f5('0x37')](_0x9a9a9e['where'],{'$or':_[_0x46f5('0x38')](_0x54524b,function(_0x244758){if(_0x244758[_0x46f5('0x39')]['key']!==_0x46f5('0x3a')){var _0xcdea38={};_0xcdea38[_0x244758[_0x46f5('0x3b')]]={'$like':'%'+_0x48b761[_0x46f5('0x29')][_0x46f5('0x36')]+'%'};return _0xcdea38;}})});}_0x9a9a9e=_['merge']({},_0x9a9a9e,_0x48b761[_0x46f5('0x3c')]);var _0x2d94b6={'where':_0x9a9a9e[_0x46f5('0x34')]};return db[_0x46f5('0x27')][_0x46f5('0x1a')](_0x2d94b6)[_0x46f5('0x21')](function(_0x14696b){_0x42837f[_0x46f5('0x1a')]=_0x14696b;if(_0x48b761['query'][_0x46f5('0x3d')]){_0x9a9a9e[_0x46f5('0x3e')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x46f5('0x3f')](_0x9a9a9e);})[_0x46f5('0x21')](function(_0xe79100){_0x42837f[_0x46f5('0x40')]=_0xe79100;return _0x42837f;})[_0x46f5('0x21')](respondWithFilteredResult(_0x524c98,_0x9a9a9e))[_0x46f5('0x41')](handleError(_0x524c98,null));};exports['show']=function(_0x29c47d,_0x4b3420){var _0x516f35={'raw':![],'where':{'id':_0x29c47d[_0x46f5('0x42')]['id']}},_0x55842a={};_0x55842a[_0x46f5('0x2f')]=_[_0x46f5('0x2a')](db[_0x46f5('0x27')]['rawAttributes']);_0x55842a[_0x46f5('0x29')]=_[_0x46f5('0x2a')](_0x29c47d[_0x46f5('0x29')]);_0x55842a[_0x46f5('0x2b')]=_[_0x46f5('0x2c')](_0x55842a['model'],_0x55842a[_0x46f5('0x29')]);_0x516f35[_0x46f5('0x2d')]=_[_0x46f5('0x2c')](_0x55842a['model'],qs['fields'](_0x29c47d['query'][_0x46f5('0x2e')]));_0x516f35[_0x46f5('0x2d')]=_0x516f35[_0x46f5('0x2d')][_0x46f5('0x43')]?_0x516f35[_0x46f5('0x2d')]:_0x55842a[_0x46f5('0x2f')];if(_0x29c47d[_0x46f5('0x29')][_0x46f5('0x3d')]){_0x516f35[_0x46f5('0x3e')]=[{'all':!![]}];}_0x516f35=_[_0x46f5('0x37')]({},_0x516f35,_0x29c47d['options']);return db[_0x46f5('0x27')]['find'](_0x516f35)[_0x46f5('0x21')](handleEntityNotFound(_0x4b3420,null))['then'](respondWithResult(_0x4b3420,null))['catch'](handleError(_0x4b3420,null));};exports[_0x46f5('0x44')]=function(_0x17ae7f,_0x1739d5){return db['AnalyticCustomReport'][_0x46f5('0x44')](_0x17ae7f[_0x46f5('0x45')],{})[_0x46f5('0x21')](function(_0x45e72d){var _0x5832ee=_0x17ae7f[_0x46f5('0x46')][_0x46f5('0x22')]({'plain':!![]});if(!_0x5832ee)throw new Error(_0x46f5('0x47'));if(_0x5832ee['role']===_0x46f5('0x46')){var _0x236409=_0x45e72d[_0x46f5('0x22')]({'plain':!![]});var _0x27a5c9=_0x46f5('0x48');return db[_0x46f5('0x49')][_0x46f5('0x4a')]({'where':{'name':_0x27a5c9,'userProfileId':_0x5832ee[_0x46f5('0x4b')]},'raw':!![]})[_0x46f5('0x21')](function(_0x2dad96){if(_0x2dad96&&_0x2dad96['autoAssociation']===0x0){return db['UserProfileResource'][_0x46f5('0x44')]({'name':_0x236409['name'],'resourceId':_0x236409['id'],'type':_0x46f5('0x4c'),'sectionId':_0x2dad96['id']},{})[_0x46f5('0x21')](function(){return _0x45e72d;});}else{return _0x45e72d;}})['catch'](function(_0x312496){logger[_0x46f5('0x24')](_0x46f5('0x4d'),_0x312496);throw _0x312496;});}return _0x45e72d;})[_0x46f5('0x21')](respondWithResult(_0x1739d5,0xc9))[_0x46f5('0x41')](handleError(_0x1739d5,null));};exports[_0x46f5('0x4e')]=function(_0x588970,_0x19a8b8){if(_0x588970[_0x46f5('0x45')]['id']){delete _0x588970[_0x46f5('0x45')]['id'];}return db[_0x46f5('0x27')][_0x46f5('0x4a')]({'where':{'id':_0x588970[_0x46f5('0x42')]['id']}})['then'](handleEntityNotFound(_0x19a8b8,null))['then'](saveUpdates(_0x588970[_0x46f5('0x45')],null))[_0x46f5('0x21')](respondWithResult(_0x19a8b8,null))[_0x46f5('0x41')](handleError(_0x19a8b8,null));};exports['destroy']=function(_0x4e3932,_0xf21b38){return db['AnalyticCustomReport'][_0x46f5('0x4a')]({'where':{'id':_0x4e3932[_0x46f5('0x42')]['id']}})[_0x46f5('0x21')](handleEntityNotFound(_0xf21b38,null))[_0x46f5('0x21')](removeEntity(_0xf21b38,null))[_0x46f5('0x41')](handleError(_0xf21b38,null));};exports['preview']=function(_0x13c126,_0x2ca496){var _0x4eb058=0xa;var _0x3047ea=[_0x46f5('0x4f'),_0x46f5('0x50'),_0x46f5('0x51'),'cross_join'];var _0x11f24f={'SUM':_0x46f5('0x52'),'COUNT':_0x46f5('0x53'),'COUNT DISTINCT':_0x46f5('0x54'),'MAX':_0x46f5('0x55'),'MIN':_0x46f5('0x56'),'AVG':_0x46f5('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x46f5('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4b1565={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x46f5('0x59'),'HOUR':_0x46f5('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x46f5('0x5b')};var _0x5e1807=function(_0x460a5e){return!_['includes']([_0x46f5('0x5c'),_0x46f5('0x5d'),_0x46f5('0x5e'),_0x46f5('0x5f')],_0x460a5e);};var _0xef1705=function(_0x5a07b6){if(!_0x5a07b6||!_0x5a07b6[_0x46f5('0x60')]['length']){return'';}for(var _0x3e4b17='(',_0x47bab4=0x0;_0x47bab4<_0x5a07b6['rules'][_0x46f5('0x43')];_0x47bab4+=0x1){_0x47bab4>0x0&&(_0x3e4b17+='\x20'+_0x5a07b6['operator']+'\x20');_0x3e4b17+=_0x5a07b6['rules'][_0x47bab4][_0x46f5('0x61')]?_0xef1705(_0x5a07b6[_0x46f5('0x60')][_0x47bab4]['group']):_0x5a07b6['rules'][_0x47bab4]['field']+'\x20'+_0x5a07b6[_0x46f5('0x60')][_0x47bab4][_0x46f5('0x62')]+(_0x5e1807(_0x5a07b6[_0x46f5('0x60')][_0x47bab4][_0x46f5('0x62')])?'\x20'+_0x5a07b6[_0x46f5('0x60')][_0x47bab4][_0x46f5('0x63')]:'');}return _0x3e4b17+')';};var _0x4f166e={'where':{'id':_0x13c126[_0x46f5('0x42')]['id']}},_0x12964b,_0x11ba42,_0x439ffb,_0x2721b7,_0x4aea72;_0x4f166e=_['merge']({},_0x4f166e,_0x13c126[_0x46f5('0x3c')]);return db[_0x46f5('0x27')][_0x46f5('0x4a')](_0x4f166e)['then'](function(_0x1efaae){if(_0x1efaae){_0x12964b=_0x1efaae;return _0x1efaae['getFields']();}return null;})['then'](function(_0x1e0bbb){if(_0x1e0bbb){if(!_0x1e0bbb['length']){throw new db[(_0x46f5('0x64'))][(_0x46f5('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x11ba42=_0x1e0bbb;return db[_0x46f5('0x66')][_0x46f5('0x3f')]({'raw':!![]});}return null;})[_0x46f5('0x21')](function(_0x2beef1){if(_0x2beef1){_0x439ffb=_[_0x46f5('0x67')](_0x2beef1,'id');var _0x23eb49;var _0xb84525=squel[_0x46f5('0x68')]();_0xb84525[_0x46f5('0x69')](_0x12964b[_0x46f5('0x6a')]);for(var _0x213c5c=0x0;_0x213c5c<_0x11ba42[_0x46f5('0x43')];_0x213c5c+=0x1){_0x23eb49=_0x11ba42[_0x213c5c]['MetricId']?_0x439ffb[_0x11ba42[_0x213c5c]['MetricId']][_0x46f5('0x6b')]:_0x11ba42[_0x213c5c]['field'];_0x23eb49=_0x11ba42[_0x213c5c][_0x46f5('0x6c')]?_[_0x46f5('0x6d')](_0x11f24f[_0x11ba42[_0x213c5c][_0x46f5('0x6c')]],'%s',_0x23eb49):_0x23eb49;_0x23eb49=_0x11ba42[_0x213c5c][_0x46f5('0x6e')]?_['replace'](_0x4b1565[_0x11ba42[_0x213c5c][_0x46f5('0x6e')]],'%s',_0x23eb49):_0x23eb49;if(_0x11ba42[_0x213c5c][_0x46f5('0x6f')]){_0xb84525[_0x46f5('0x61')](_0x23eb49);}_0x11ba42[_0x213c5c][_0x46f5('0x70')]&&_0xb84525[_0x46f5('0x32')](_0x23eb49,_0x11ba42[_0x213c5c][_0x46f5('0x70')]==='DESC'?![]:!![]);_0xb84525['field'](_0x23eb49,_0x11ba42[_0x213c5c]['alias']||_0x23eb49);}if(_0x12964b[_0x46f5('0x71')]){_0x12964b[_0x46f5('0x71')]=JSON[_0x46f5('0x72')](_0x12964b[_0x46f5('0x71')]);for(var _0x300e72=0x0;_0x300e72<_0x12964b[_0x46f5('0x71')]['length'];_0x300e72+=0x1){if(_0x12964b['joins'][_0x300e72]['type']&&_[_0x46f5('0x73')](_0x3047ea,_0x12964b[_0x46f5('0x71')][_0x300e72]['type'])&&_0x12964b['joins'][_0x300e72]['parentKey']&&_0x12964b['joins'][_0x300e72][_0x46f5('0x74')]&&_0x12964b[_0x46f5('0x71')][_0x300e72][_0x46f5('0x75')]){_0xb84525[_0x12964b[_0x46f5('0x71')][_0x300e72][_0x46f5('0x39')]](_0x12964b[_0x46f5('0x71')][_0x300e72][_0x46f5('0x74')],null,util[_0x46f5('0x6e')](_0x46f5('0x76'),_0x12964b[_0x46f5('0x6a')],_0x12964b['joins'][_0x300e72][_0x46f5('0x77')],_0x12964b['joins'][_0x300e72][_0x46f5('0x74')],_0x12964b[_0x46f5('0x71')][_0x300e72][_0x46f5('0x75')]));}}}if(_0x12964b['conditions']){_0x12964b['conditions']=JSON[_0x46f5('0x72')](_0x12964b[_0x46f5('0x78')]);_0xb84525['where'](_0xef1705(_0x12964b['conditions'][_0x46f5('0x61')]));}_0x4aea72=_0xb84525[_0x46f5('0x79')]();_0xb84525[_0x46f5('0x1c')](_0x4eb058);_0xb84525[_0x46f5('0x1b')](0x0);logger['debug'](_0x46f5('0x7a'),_0xb84525[_0x46f5('0x7b')]());return db[_0x46f5('0x7c')][_0x46f5('0x29')](_0xb84525[_0x46f5('0x7b')](),{'type':db[_0x46f5('0x7c')][_0x46f5('0x7d')][_0x46f5('0x7e')]});}})[_0x46f5('0x21')](respondWithResult(_0x2ca496,null))[_0x46f5('0x41')](handleError(_0x2ca496,null));};function runReport(_0xc9ca14,_0x6889c,_0x1341c5){var _0x3e2068=_0x6889c[_0x46f5('0x25')];var _0x310a4c=0xa;var _0x8189b5=[_0x46f5('0x4f'),_0x46f5('0x50'),_0x46f5('0x51'),_0x46f5('0x7f')];var _0x26d8a0={'SUM':_0x46f5('0x52'),'COUNT':_0x46f5('0x53'),'COUNT DISTINCT':_0x46f5('0x54'),'MAX':_0x46f5('0x55'),'MIN':'MIN(%s)','AVG':_0x46f5('0x57'),'GROUP_CONCAT':_0x46f5('0x80'),'GROUP_CONCAT ASC':_0x46f5('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2b4f7f={'SEC_TO_TIME':_0x46f5('0x81'),'DATE':_0x46f5('0x59'),'HOUR':_0x46f5('0x5a'),'ROUND':_0x46f5('0x82'),'UNIX_TIMESTAMP':_0x46f5('0x5b')};var _0x1c87b1=function(_0x402152){return!_[_0x46f5('0x73')]([_0x46f5('0x5c'),'IS\x20NOT\x20NULL',_0x46f5('0x5e'),'IS\x20NOT\x20EMPTY'],_0x402152);};var _0x5b84f8=function(_0xb627c7){if(!_0xb627c7||!_0xb627c7[_0x46f5('0x60')][_0x46f5('0x43')]){return'';}for(var _0x4fa6d9='(',_0x303b7d=0x0;_0x303b7d<_0xb627c7['rules'][_0x46f5('0x43')];_0x303b7d+=0x1){_0x303b7d>0x0&&(_0x4fa6d9+='\x20'+_0xb627c7[_0x46f5('0x83')]+'\x20');_0x4fa6d9+=_0xb627c7[_0x46f5('0x60')][_0x303b7d][_0x46f5('0x61')]?_0x5b84f8(_0xb627c7[_0x46f5('0x60')][_0x303b7d]['group']):_0xb627c7[_0x46f5('0x60')][_0x303b7d][_0x46f5('0x3b')]+'\x20'+_0xb627c7[_0x46f5('0x60')][_0x303b7d][_0x46f5('0x62')]+(_0x1c87b1(_0xb627c7[_0x46f5('0x60')][_0x303b7d][_0x46f5('0x62')])?'\x20'+_0xb627c7['rules'][_0x303b7d][_0x46f5('0x63')]:'');}return _0x4fa6d9+')';};var _0x10e6f7={'where':{'id':_0xc9ca14['id']}},_0xf34c65,_0x328bf6,_0x2583b2,_0x259ba1,_0x5c33ff;_0x10e6f7=_[_0x46f5('0x37')]({},_0x10e6f7,_0x1341c5);return db['AnalyticCustomReport'][_0x46f5('0x4a')](_0x10e6f7)[_0x46f5('0x21')](function(_0x245dbf){if(_0x245dbf){_0xf34c65=_0x245dbf;return _0x245dbf[_0x46f5('0x84')]();}return null;})[_0x46f5('0x21')](function(_0x5d2513){if(_0x5d2513){if(!_0x5d2513[_0x46f5('0x43')]){throw new db['Sequelize']['ValidationErrorItem'](_0x46f5('0x85'),0x193);}_0x328bf6=_0x5d2513;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x46f5('0x21')](function(_0x1e8a06){if(_0x1e8a06){_0x2583b2=_[_0x46f5('0x67')](_0x1e8a06,'id');var _0x2e223f;var _0x3682b1=squel[_0x46f5('0x68')]();_0x3682b1[_0x46f5('0x69')](_0xf34c65['table']);for(var _0x2ead92=0x0;_0x2ead92<_0x328bf6[_0x46f5('0x43')];_0x2ead92+=0x1){_0x2e223f=_0x328bf6[_0x2ead92][_0x46f5('0x86')]?_0x2583b2[_0x328bf6[_0x2ead92][_0x46f5('0x86')]][_0x46f5('0x6b')]:_0x328bf6[_0x2ead92]['field'];_0x2e223f=_0x328bf6[_0x2ead92]['function']?_['replace'](_0x26d8a0[_0x328bf6[_0x2ead92][_0x46f5('0x6c')]],'%s',_0x2e223f):_0x2e223f;_0x2e223f=_0x328bf6[_0x2ead92][_0x46f5('0x6e')]?_['replace'](_0x2b4f7f[_0x328bf6[_0x2ead92][_0x46f5('0x6e')]],'%s',_0x2e223f):_0x2e223f;if(_0x328bf6[_0x2ead92]['groupBy']){_0x3682b1['group'](_0x2e223f);}_0x328bf6[_0x2ead92][_0x46f5('0x70')]&&_0x3682b1['order'](_0x2e223f,_0x328bf6[_0x2ead92][_0x46f5('0x70')]==='DESC'?![]:!![]);_0x3682b1['field'](_0x2e223f,_0x328bf6[_0x2ead92][_0x46f5('0x87')]||_0x2e223f);}if(_0xf34c65[_0x46f5('0x71')]){_0xf34c65[_0x46f5('0x71')]=JSON['parse'](_0xf34c65[_0x46f5('0x71')]);for(var _0x210b96=0x0;_0x210b96<_0xf34c65['joins']['length'];_0x210b96+=0x1){if(_0xf34c65[_0x46f5('0x71')][_0x210b96]['type']&&_['includes'](_0x8189b5,_0xf34c65[_0x46f5('0x71')][_0x210b96][_0x46f5('0x39')])&&_0xf34c65[_0x46f5('0x71')][_0x210b96][_0x46f5('0x77')]&&_0xf34c65[_0x46f5('0x71')][_0x210b96][_0x46f5('0x74')]&&_0xf34c65[_0x46f5('0x71')][_0x210b96][_0x46f5('0x75')]){_0x3682b1[_0xf34c65[_0x46f5('0x71')][_0x210b96]['type']](_0xf34c65[_0x46f5('0x71')][_0x210b96][_0x46f5('0x74')],null,util['format'](_0x46f5('0x76'),_0xf34c65['table'],_0xf34c65[_0x46f5('0x71')][_0x210b96]['parentKey'],_0xf34c65[_0x46f5('0x71')][_0x210b96][_0x46f5('0x74')],_0xf34c65[_0x46f5('0x71')][_0x210b96][_0x46f5('0x75')]));}}}if(_0xf34c65['conditions']){_0xf34c65['conditions']=JSON[_0x46f5('0x72')](_0xf34c65[_0x46f5('0x78')]);_0x3682b1[_0x46f5('0x34')](_0x5b84f8(_0xf34c65['conditions'][_0x46f5('0x61')]));}_0x5c33ff=_0x3682b1['clone']();_0x3682b1[_0x46f5('0x1c')](_0x310a4c);_0x3682b1['offset'](0x0);logger['debug']('Limited\x20Query:',_0x3682b1['toString']());return db[_0x46f5('0x7c')][_0x46f5('0x29')](_0x3682b1[_0x46f5('0x7b')](),{'type':db['sequelize']['QueryTypes'][_0x46f5('0x7e')]});}})[_0x46f5('0x21')](function(_0x3c821f){if(!_0x3c821f[_0x46f5('0x43')]){throw new db[(_0x46f5('0x64'))][(_0x46f5('0x65'))](_0x46f5('0x88'),0xcc);}if(_0x6889c[_0x46f5('0x89')]===_0x46f5('0x8a')){return null;}var _0x4d85bb=_['merge'](_0x6889c,{'name':_0x6889c[_0x46f5('0x8b')]||_0x6889c[_0x46f5('0x25')]||_0xf34c65[_0x46f5('0x25')],'basename':_0x3e2068,'savename':util[_0x46f5('0x6e')](_0x46f5('0x8c'),_0x6889c[_0x46f5('0x25')]||_0xf34c65[_0x46f5('0x25')],require(_0x46f5('0x8d'))[_0x46f5('0x8e')](0x4),_0x6889c['output']||_0x46f5('0x8f')),'reportId':_0xf34c65['id'],'reportType':_0x46f5('0x90')});return db[_0x46f5('0x91')][_0x46f5('0x44')](_0x4d85bb,{'raw':!![]});})[_0x46f5('0x21')](function(_0x70e6ba){if(_0xf34c65[_0x46f5('0x6a')]===_0x46f5('0x92')){_0x5c33ff['where'](_0xf34c65[_0x46f5('0x6a')]+_0x46f5('0x93'),_0x6889c[_0x46f5('0x94')],_0x6889c[_0x46f5('0x95')]);}else{_0x5c33ff[_0x46f5('0x34')](_0xf34c65[_0x46f5('0x6a')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x6889c[_0x46f5('0x94')],_0x6889c['endDate']);}if(_0x70e6ba){logger['info'](_0x46f5('0x96'),_0x5c33ff[_0x46f5('0x7b')]());require('child_process')[_0x46f5('0x97')](path[_0x46f5('0x4f')](__dirname,_0x46f5('0x98'),_0x70e6ba[_0x46f5('0x89')]),[_0x70e6ba['id'],_0x5c33ff[_0x46f5('0x7b')](),path['join'](__dirname,_0x46f5('0x99'),_0x70e6ba[_0x46f5('0x9a')]),_0x3e2068]);return _0x70e6ba;}else{var _0x1337f9=squel[_0x46f5('0x68')]();_0x1337f9[_0x46f5('0x69')]('('+_0x5c33ff[_0x46f5('0x7b')]()+')',_0x46f5('0x9b'));_0x1337f9[_0x46f5('0x3b')](_0x46f5('0x9c'),'count');_0x5c33ff[_0x46f5('0x1c')](_0x6889c['limit']||_0x310a4c);_0x5c33ff['offset'](_0x6889c['offset']||0x0);return db['sequelize'][_0x46f5('0x29')](_0x1337f9[_0x46f5('0x7b')](),{'type':db[_0x46f5('0x7c')]['QueryTypes']['SELECT']})[_0x46f5('0x21')](function(_0x660164){if(!_0x660164['length']){_0x259ba1=0x0;}else{_0x259ba1=_0x660164[0x0]['count']||0x0;}return db['sequelize']['query'](_0x5c33ff[_0x46f5('0x7b')](),{'type':db[_0x46f5('0x7c')]['QueryTypes'][_0x46f5('0x7e')]});})[_0x46f5('0x21')](function(_0x4ac107){return{'rows':_0x4ac107||[],'count':_0x259ba1};});}});}exports[_0x46f5('0x9d')]=function(_0x5c22c8,_0x4a3c8a){return runReport(_0x5c22c8[_0x46f5('0x42')],_0x5c22c8[_0x46f5('0x29')],_0x5c22c8[_0x46f5('0x3c')])['then'](respondWithResult(_0x4a3c8a,null))[_0x46f5('0x41')](handleError(_0x4a3c8a,null));};exports[_0x46f5('0x9e')]=runReport;exports[_0x46f5('0x29')]=function(_0x5dd825,_0x4fb7dd){var _0x5016bc=0xa;var _0x5995da=['join',_0x46f5('0x50'),_0x46f5('0x51'),_0x46f5('0x7f')];var _0x38195f={'SUM':_0x46f5('0x52'),'COUNT':_0x46f5('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x46f5('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x46f5('0x9f')};var _0x238ab2={'SEC_TO_TIME':_0x46f5('0x81'),'DATE':_0x46f5('0x59'),'HOUR':_0x46f5('0x5a'),'ROUND':_0x46f5('0x82'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x427c7f=function(_0x4a41e8){return!_[_0x46f5('0x73')]([_0x46f5('0x5c'),_0x46f5('0x5d'),_0x46f5('0x5e'),_0x46f5('0x5f')],_0x4a41e8);};var _0x3ea26e=function(_0x33cd74){if(!_0x33cd74||!_0x33cd74['rules'][_0x46f5('0x43')]){return'';}for(var _0x36074a='(',_0x3349f9=0x0;_0x3349f9<_0x33cd74[_0x46f5('0x60')][_0x46f5('0x43')];_0x3349f9+=0x1){_0x3349f9>0x0&&(_0x36074a+='\x20'+_0x33cd74[_0x46f5('0x83')]+'\x20');_0x36074a+=_0x33cd74[_0x46f5('0x60')][_0x3349f9][_0x46f5('0x61')]?_0x3ea26e(_0x33cd74[_0x46f5('0x60')][_0x3349f9][_0x46f5('0x61')]):_0x33cd74[_0x46f5('0x60')][_0x3349f9][_0x46f5('0x3b')]+'\x20'+_0x33cd74[_0x46f5('0x60')][_0x3349f9][_0x46f5('0x62')]+(_0x427c7f(_0x33cd74[_0x46f5('0x60')][_0x3349f9][_0x46f5('0x62')])?'\x20'+_0x33cd74[_0x46f5('0x60')][_0x3349f9]['value']:'');}return _0x36074a+')';};var _0x43e206={'where':{'id':_0x5dd825['params']['id']}},_0x5d74e7,_0x2b25c6,_0x2726a2,_0x1b5187,_0x480088;_0x43e206=_[_0x46f5('0x37')]({},_0x43e206,_0x5dd825['options']);return db[_0x46f5('0x27')][_0x46f5('0x4a')](_0x43e206)[_0x46f5('0x21')](function(_0x9e76b0){if(_0x9e76b0){_0x5d74e7=_0x9e76b0;return _0x9e76b0['getFields']();}return null;})['then'](function(_0x300f52){if(_0x300f52){if(!_0x300f52['length']){throw new db[(_0x46f5('0x64'))][(_0x46f5('0x65'))](_0x46f5('0x85'),0x193);}_0x2b25c6=_0x300f52;return db[_0x46f5('0x66')][_0x46f5('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x2782d0){if(_0x2782d0){_0x2726a2=_[_0x46f5('0x67')](_0x2782d0,'id');var _0x270589;var _0x6bcda9=squel[_0x46f5('0x68')]();_0x6bcda9['from'](_0x5d74e7[_0x46f5('0x6a')]);for(var _0x5ca128=0x0;_0x5ca128<_0x2b25c6['length'];_0x5ca128+=0x1){_0x270589=_0x2b25c6[_0x5ca128]['MetricId']?_0x2726a2[_0x2b25c6[_0x5ca128][_0x46f5('0x86')]]['metric']:_0x2b25c6[_0x5ca128][_0x46f5('0x3b')];_0x270589=_0x2b25c6[_0x5ca128][_0x46f5('0x6c')]?_['replace'](_0x38195f[_0x2b25c6[_0x5ca128][_0x46f5('0x6c')]],'%s',_0x270589):_0x270589;_0x270589=_0x2b25c6[_0x5ca128][_0x46f5('0x6e')]?_['replace'](_0x238ab2[_0x2b25c6[_0x5ca128]['format']],'%s',_0x270589):_0x270589;if(_0x2b25c6[_0x5ca128]['groupBy']){_0x6bcda9[_0x46f5('0x61')](_0x270589);}_0x2b25c6[_0x5ca128][_0x46f5('0x70')]&&_0x6bcda9['order'](_0x270589,_0x2b25c6[_0x5ca128][_0x46f5('0x70')]==='DESC'?![]:!![]);_0x6bcda9[_0x46f5('0x3b')](_0x270589,_0x2b25c6[_0x5ca128]['alias']||_0x270589);}if(_0x5d74e7[_0x46f5('0x71')]){_0x5d74e7[_0x46f5('0x71')]=JSON['parse'](_0x5d74e7[_0x46f5('0x71')]);for(var _0x3bce0e=0x0;_0x3bce0e<_0x5d74e7[_0x46f5('0x71')][_0x46f5('0x43')];_0x3bce0e+=0x1){if(_0x5d74e7[_0x46f5('0x71')][_0x3bce0e][_0x46f5('0x39')]&&_['includes'](_0x5995da,_0x5d74e7[_0x46f5('0x71')][_0x3bce0e][_0x46f5('0x39')])&&_0x5d74e7['joins'][_0x3bce0e]['parentKey']&&_0x5d74e7['joins'][_0x3bce0e][_0x46f5('0x74')]&&_0x5d74e7[_0x46f5('0x71')][_0x3bce0e][_0x46f5('0x75')]){_0x6bcda9[_0x5d74e7[_0x46f5('0x71')][_0x3bce0e][_0x46f5('0x39')]](_0x5d74e7[_0x46f5('0x71')][_0x3bce0e]['foreignTable'],null,util[_0x46f5('0x6e')](_0x46f5('0x76'),_0x5d74e7[_0x46f5('0x6a')],_0x5d74e7[_0x46f5('0x71')][_0x3bce0e][_0x46f5('0x77')],_0x5d74e7['joins'][_0x3bce0e][_0x46f5('0x74')],_0x5d74e7[_0x46f5('0x71')][_0x3bce0e][_0x46f5('0x75')]));}}}if(_0x5d74e7['conditions']){_0x5d74e7[_0x46f5('0x78')]=JSON[_0x46f5('0x72')](_0x5d74e7[_0x46f5('0x78')]);_0x6bcda9[_0x46f5('0x34')](_0x3ea26e(_0x5d74e7['conditions'][_0x46f5('0x61')]));}_0x480088=_0x6bcda9[_0x46f5('0x79')]();_0x6bcda9[_0x46f5('0x1c')](_0x5016bc);_0x6bcda9['offset'](0x0);logger[_0x46f5('0xa0')]('Limited\x20Query:',_0x6bcda9[_0x46f5('0x7b')]());return db[_0x46f5('0x7c')]['query'](_0x6bcda9[_0x46f5('0x7b')](),{'type':db['sequelize'][_0x46f5('0x7d')][_0x46f5('0x7e')]});}})['then'](function(){return{'sql':_0x480088[_0x46f5('0x7b')]()};})['then'](respondWithResult(_0x4fb7dd,null))['catch'](handleError(_0x4fb7dd,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 42de339..bd6dc23 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 _0xd441=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./analyticCustomReport.attributes'];(function(_0x1f39cc,_0x55b238){var _0x3e8211=function(_0x5b1be0){while(--_0x5b1be0){_0x1f39cc['push'](_0x1f39cc['shift']());}};_0x3e8211(++_0x55b238);}(_0xd441,0xca));var _0x1d44=function(_0x4d5759,_0x531894){_0x4d5759=_0x4d5759-0x0;var _0x438e1d=_0xd441[_0x4d5759];return _0x438e1d;};'use strict';var _=require(_0x1d44('0x0'));var util=require(_0x1d44('0x1'));var logger=require(_0x1d44('0x2'))(_0x1d44('0x3'));var moment=require(_0x1d44('0x4'));var BPromise=require(_0x1d44('0x5'));var rp=require(_0x1d44('0x6'));var attributes=require(_0x1d44('0x7'));module[_0x1d44('0x8')]=function(_0x3e705c,_0x2ce6a5){return _0x3e705c[_0x1d44('0x9')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1db3=['bluebird','request-promise','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api'];(function(_0x40f813,_0x25786e){var _0x2fd43c=function(_0x4bb77d){while(--_0x4bb77d){_0x40f813['push'](_0x40f813['shift']());}};_0x2fd43c(++_0x25786e);}(_0x1db3,0xa6));var _0x31db=function(_0x11a7eb,_0x264f32){_0x11a7eb=_0x11a7eb-0x0;var _0x16ab09=_0x1db3[_0x11a7eb];return _0x16ab09;};'use strict';var _=require(_0x31db('0x0'));var util=require(_0x31db('0x1'));var logger=require(_0x31db('0x2'))(_0x31db('0x3'));var moment=require('moment');var BPromise=require(_0x31db('0x4'));var rp=require(_0x31db('0x5'));var attributes=require(_0x31db('0x6'));module['exports']=function(_0x3f5704,_0x23d3ef){return _0x3f5704[_0x31db('0x7')](_0x31db('0x8'),attributes,{'tableName':_0x31db('0x9'),'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 1e073c9..7f1208d 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4bfd71,_0x4f66f8){var _0x4293c4=function(_0x48c91d){while(--_0x48c91d){_0x4bfd71['push'](_0x4bfd71['shift']());}};_0x4293c4(++_0x4f66f8);}(_0xb10b,0x12a));var _0xbb10=function(_0x96b6a,_0x12471d){_0x96b6a=_0x96b6a-0x0;var _0x3e16f3=_0xb10b[_0x96b6a];return _0x3e16f3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index f980c85..f19d39c 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 _0x430c=['delete','multer','connect-timeout','express','Router','get','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','put','/:id','update'];(function(_0x1a1a49,_0x16bffa){var _0xfd9528=function(_0x333c7a){while(--_0x333c7a){_0x1a1a49['push'](_0x1a1a49['shift']());}};_0xfd9528(++_0x16bffa);}(_0x430c,0x1a1));var _0xc430=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x430c[_0x2abc3d];return _0x252745;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xc430('0x4')]('/',auth[_0xc430('0x5')](),controller['index']);router[_0xc430('0x4')]('/:id',auth[_0xc430('0x5')](),controller[_0xc430('0x6')]);router[_0xc430('0x4')](_0xc430('0x7'),auth[_0xc430('0x5')](),controller[_0xc430('0x8')]);router[_0xc430('0x4')](_0xc430('0x9'),auth[_0xc430('0x5')](),controller['run']);router[_0xc430('0x4')](_0xc430('0xa'),auth['isAuthenticated'](),controller[_0xc430('0xb')]);router['post']('/',auth[_0xc430('0x5')](),controller['create']);router[_0xc430('0xc')](_0xc430('0xd'),auth[_0xc430('0x5')](),controller[_0xc430('0xe')]);router[_0xc430('0xf')](_0xc430('0xd'),auth[_0xc430('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5f66=['express','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','index','show','get','/:id/preview','preview','run','/:id/query','query','create','/:id','update','delete','destroy','exports','util','connect-timeout'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'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 auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/:id',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['get']('/:id/run',auth[_0x65f6('0x7')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xa')](_0x65f6('0xe'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);router['put'](_0x65f6('0x11'),auth['isAuthenticated'](),controller[_0x65f6('0x12')]);router[_0x65f6('0x13')](_0x65f6('0x11'),auth[_0x65f6('0x7')](),controller[_0x65f6('0x14')]);module[_0x65f6('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 43204e3..7df4007 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 _0x88df=['TEXT','sequelize','exports','STRING'];(function(_0x4a2f8d,_0x5b3406){var _0x1d390a=function(_0x3928dd){while(--_0x3928dd){_0x4a2f8d['push'](_0x4a2f8d['shift']());}};_0x1d390a(++_0x5b3406);}(_0x88df,0x7d));var _0xf88d=function(_0x1a3c02,_0x53f796){_0x1a3c02=_0x1a3c02-0x0;var _0x4cf6c0=_0x88df[_0x1a3c02];return _0x4cf6c0;};'use strict';var Sequelize=require(_0xf88d('0x0'));module[_0xf88d('0x1')]={'name':{'type':Sequelize[_0xf88d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf88d('0x2')]},'parent':{'type':Sequelize[_0xf88d('0x2')]},'table':{'type':Sequelize[_0xf88d('0x2')]},'conditions':{'type':Sequelize[_0xf88d('0x3')]},'joins':{'type':Sequelize[_0xf88d('0x3')]}}; \ No newline at end of file +var _0x4a9b=['TEXT','STRING'];(function(_0x5f35fe,_0x3da6e7){var _0x2aa667=function(_0x3d82cd){while(--_0x3d82cd){_0x5f35fe['push'](_0x5f35fe['shift']());}};_0x2aa667(++_0x3da6e7);}(_0x4a9b,0x8d));var _0xb4a9=function(_0x592a06,_0x258291){_0x592a06=_0x592a06-0x0;var _0x1f0746=_0x4a9b[_0x592a06];return _0x1f0746;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb4a9('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xb4a9('0x0')]},'table':{'type':Sequelize[_0xb4a9('0x0')]},'conditions':{'type':Sequelize[_0xb4a9('0x1')]},'joins':{'type':Sequelize[_0xb4a9('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 04becc1..82c29c3 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 _0x28f5=['endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','from','countTable','COUNT(*)','run','runReport','COUNT(DISTINCT\x20%s)','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','AnalyticDefaultReport','include','findAll','rows','catch','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','condition','params','ValidationErrorItem','AnalyticMetric','keyBy','select','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','MAX(%s)','AVG(%s)','DATE(%s)','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','function','Sequelize','No\x20available\x20data','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','startDate'];(function(_0x5b8646,_0x3e1589){var _0x363e4c=function(_0x37484a){while(--_0x37484a){_0x5b8646['push'](_0x5b8646['shift']());}};_0x363e4c(++_0x3e1589);}(_0x28f5,0xae));var _0x528f=function(_0x1b05a6,_0x1ca67f){_0x1b05a6=_0x1b05a6-0x0;var _0x45608a=_0x28f5[_0x1b05a6];return _0x45608a;};'use strict';var pdf=require(_0x528f('0x0'));var emlformat=require(_0x528f('0x1'));var rimraf=require(_0x528f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x528f('0x3'));var rp=require(_0x528f('0x4'));var moment=require('moment');var BPromise=require(_0x528f('0x5'));var Mustache=require('mustache');var util=require(_0x528f('0x6'));var path=require(_0x528f('0x7'));var sox=require(_0x528f('0x8'));var csv=require(_0x528f('0x9'));var ejs=require(_0x528f('0xa'));var fs=require('fs');var _=require(_0x528f('0xb'));var squel=require(_0x528f('0xc'));var crypto=require(_0x528f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x528f('0x9'));var querystring=require('querystring');var Papa=require(_0x528f('0xe'));var authService=require(_0x528f('0xf'));var hardwareService=require(_0x528f('0x10'));var Redis=require(_0x528f('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x528f('0x12'))(_0x528f('0x13'));var utils=require('../../config/utils');var config=require(_0x528f('0x14'));var db=require(_0x528f('0x15'))['db'];function respondWithStatusCode(_0x39ce71,_0x4aa23d){_0x4aa23d=_0x4aa23d||0xcc;return function(_0x2cb934){if(_0x2cb934){return _0x39ce71[_0x528f('0x16')](_0x4aa23d);}return _0x39ce71['status'](_0x4aa23d)[_0x528f('0x17')]();};}function respondWithResult(_0x5e0dc8,_0x12559a){_0x12559a=_0x12559a||0xc8;return function(_0x2356d7){if(_0x2356d7){return _0x5e0dc8[_0x528f('0x18')](_0x12559a)[_0x528f('0x19')](_0x2356d7);}};}function respondWithFilteredResult(_0x22a12e,_0x36de02){return function(_0x332bfc){if(_0x332bfc){var _0x102b86=_0x332bfc[_0x528f('0x1a')],_0x390a40=_0x36de02[_0x528f('0x1b')],_0x5487e1=_0x36de02['offset']+_0x36de02[_0x528f('0x1c')],_0x284708;if(_0x5487e1>=_0x102b86){_0x5487e1=_0x102b86;_0x284708=0xc8;}else{_0x284708=0xce;}_0x22a12e[_0x528f('0x18')](_0x284708);return _0x22a12e['set'](_0x528f('0x1d'),_0x390a40+'-'+_0x5487e1+'/'+_0x102b86)[_0x528f('0x19')](_0x332bfc);}return null;};}function patchUpdates(_0x2c9a0f){return function(_0x75dd38){try{jsonpatch[_0x528f('0x1e')](_0x75dd38,_0x2c9a0f,!![]);}catch(_0x577201){return BPromise[_0x528f('0x1f')](_0x577201);}return _0x75dd38['save']();};}function saveUpdates(_0x5a2d09,_0x36df3a){return function(_0x2fab10){if(_0x2fab10){return _0x2fab10['update'](_0x5a2d09)[_0x528f('0x20')](function(_0x2d2984){return _0x2d2984;});}return null;};}function removeEntity(_0xc7fcee,_0x46098e){return function(_0xe2e240){if(_0xe2e240){return _0xe2e240[_0x528f('0x21')]()[_0x528f('0x20')](function(){var _0x203a01=_0xe2e240[_0x528f('0x22')]({'plain':!![]});var _0x5c389a=_0x528f('0x23');return db[_0x528f('0x24')]['destroy']({'where':{'type':_0x5c389a,'resourceId':_0x203a01['id']}})[_0x528f('0x20')](function(){return _0xe2e240;});})[_0x528f('0x20')](function(){_0xc7fcee[_0x528f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bc43d,_0xa21adf){return function(_0x5e5049){if(!_0x5e5049){_0x1bc43d[_0x528f('0x16')](0x194);}return _0x5e5049;};}function handleError(_0x1e7c47,_0x1c28e1){_0x1c28e1=_0x1c28e1||0x1f4;return function(_0x34c774){logger[_0x528f('0x25')](_0x34c774['stack']);if(_0x34c774[_0x528f('0x26')]){delete _0x34c774[_0x528f('0x26')];}_0x1e7c47[_0x528f('0x18')](_0x1c28e1)['send'](_0x34c774);};}exports[_0x528f('0x27')]=function(_0x7b1fbb,_0x306c06){var _0x44af5d={},_0x4be7a7={},_0x1dc522={'count':0x0,'rows':[]};var _0x463c7c=db['AnalyticDefaultReport'][_0x528f('0x28')];_0x4be7a7['model']=_[_0x528f('0x29')](_0x463c7c);_0x4be7a7[_0x528f('0x2a')]=_[_0x528f('0x29')](_0x7b1fbb['query']);_0x4be7a7[_0x528f('0x2b')]=_[_0x528f('0x2c')](_0x4be7a7['model'],_0x4be7a7[_0x528f('0x2a')]);_0x44af5d[_0x528f('0x2d')]=_[_0x528f('0x2c')](_0x4be7a7[_0x528f('0x2e')],qs['fields'](_0x7b1fbb['query'][_0x528f('0x2f')]));_0x44af5d['attributes']=_0x44af5d[_0x528f('0x2d')][_0x528f('0x30')]?_0x44af5d[_0x528f('0x2d')]:_0x4be7a7[_0x528f('0x2e')];if(!_0x7b1fbb['query'][_0x528f('0x31')]('nolimit')){_0x44af5d[_0x528f('0x1c')]=qs[_0x528f('0x1c')](_0x7b1fbb[_0x528f('0x2a')][_0x528f('0x1c')]);_0x44af5d[_0x528f('0x1b')]=qs['offset'](_0x7b1fbb[_0x528f('0x2a')][_0x528f('0x1b')]);}_0x44af5d[_0x528f('0x32')]=qs[_0x528f('0x33')](_0x7b1fbb['query']['sort']);_0x44af5d[_0x528f('0x34')]=qs[_0x528f('0x2b')](_[_0x528f('0x35')](_0x7b1fbb[_0x528f('0x2a')],_0x4be7a7['filters']));if(_0x7b1fbb[_0x528f('0x2a')][_0x528f('0x36')]){_0x44af5d['where']=_[_0x528f('0x37')](_0x44af5d['where'],{'$or':_['map'](_0x463c7c,function(_0x33f382){if(_0x33f382[_0x528f('0x38')][_0x528f('0x39')]!==_0x528f('0x3a')){var _0x352349={};_0x352349[_0x33f382[_0x528f('0x3b')]]={'$like':'%'+_0x7b1fbb[_0x528f('0x2a')][_0x528f('0x36')]+'%'};return _0x352349;}})});}_0x44af5d=_[_0x528f('0x37')]({},_0x44af5d,_0x7b1fbb[_0x528f('0x3c')]);var _0x3a980c={'where':_0x44af5d[_0x528f('0x34')]};return db[_0x528f('0x3d')][_0x528f('0x1a')](_0x3a980c)[_0x528f('0x20')](function(_0x23dfa8){_0x1dc522[_0x528f('0x1a')]=_0x23dfa8;if(_0x7b1fbb[_0x528f('0x2a')]['includeAll']){_0x44af5d[_0x528f('0x3e')]=[{'all':!![]}];}return db[_0x528f('0x3d')][_0x528f('0x3f')](_0x44af5d);})[_0x528f('0x20')](function(_0x54654d){_0x1dc522[_0x528f('0x40')]=_0x54654d;return _0x1dc522;})[_0x528f('0x20')](respondWithFilteredResult(_0x306c06,_0x44af5d))[_0x528f('0x41')](handleError(_0x306c06,null));};exports[_0x528f('0x42')]=function(_0x2b097c,_0x4e04bc){var _0x4218af={'raw':!![],'where':{'id':_0x2b097c['params']['id']}},_0x230c86={};_0x230c86[_0x528f('0x2e')]=_['keys'](db[_0x528f('0x3d')][_0x528f('0x28')]);_0x230c86[_0x528f('0x2a')]=_[_0x528f('0x29')](_0x2b097c[_0x528f('0x2a')]);_0x230c86[_0x528f('0x2b')]=_[_0x528f('0x2c')](_0x230c86[_0x528f('0x2e')],_0x230c86['query']);_0x4218af[_0x528f('0x2d')]=_[_0x528f('0x2c')](_0x230c86[_0x528f('0x2e')],qs[_0x528f('0x2f')](_0x2b097c[_0x528f('0x2a')][_0x528f('0x2f')]));_0x4218af[_0x528f('0x2d')]=_0x4218af['attributes']['length']?_0x4218af['attributes']:_0x230c86[_0x528f('0x2e')];if(_0x2b097c[_0x528f('0x2a')]['includeAll']){_0x4218af[_0x528f('0x3e')]=[{'all':!![]}];}_0x4218af=_[_0x528f('0x37')]({},_0x4218af,_0x2b097c[_0x528f('0x3c')]);return db[_0x528f('0x3d')][_0x528f('0x43')](_0x4218af)[_0x528f('0x20')](handleEntityNotFound(_0x4e04bc,null))['then'](respondWithResult(_0x4e04bc,null))[_0x528f('0x41')](handleError(_0x4e04bc,null));};exports[_0x528f('0x44')]=function(_0x53eb4f,_0x15a767){return db['AnalyticDefaultReport'][_0x528f('0x44')](_0x53eb4f['body'],{})[_0x528f('0x20')](function(_0x5135b2){var _0xc0024a=_0x53eb4f['user']['get']({'plain':!![]});if(!_0xc0024a)throw new Error(_0x528f('0x45'));if(_0xc0024a[_0x528f('0x46')]==='user'){var _0x57ce2f=_0x5135b2[_0x528f('0x22')]({'plain':!![]});var _0x3304b6=_0x528f('0x47');return db[_0x528f('0x48')][_0x528f('0x43')]({'where':{'name':_0x3304b6,'userProfileId':_0xc0024a[_0x528f('0x49')]},'raw':!![]})[_0x528f('0x20')](function(_0x400407){if(_0x400407&&_0x400407[_0x528f('0x4a')]===0x0){return db[_0x528f('0x24')][_0x528f('0x44')]({'name':_0x57ce2f['name'],'resourceId':_0x57ce2f['id'],'type':_0x528f('0x23'),'sectionId':_0x400407['id']},{})['then'](function(){return _0x5135b2;});}else{return _0x5135b2;}})['catch'](function(_0x21217e){logger[_0x528f('0x25')](_0x528f('0x4b'),_0x21217e);throw _0x21217e;});}return _0x5135b2;})[_0x528f('0x20')](respondWithResult(_0x15a767,0xc9))[_0x528f('0x41')](handleError(_0x15a767,null));};exports['update']=function(_0x2ceef7,_0x4bd37d){if(_0x2ceef7[_0x528f('0x4c')]['id']){delete _0x2ceef7[_0x528f('0x4c')]['id'];}return db[_0x528f('0x3d')][_0x528f('0x43')]({'where':{'id':_0x2ceef7['params']['id']}})[_0x528f('0x20')](handleEntityNotFound(_0x4bd37d,null))['then'](saveUpdates(_0x2ceef7[_0x528f('0x4c')],null))[_0x528f('0x20')](respondWithResult(_0x4bd37d,null))[_0x528f('0x41')](handleError(_0x4bd37d,null));};exports[_0x528f('0x21')]=function(_0x3b35e2,_0x5e9a50){return db[_0x528f('0x3d')][_0x528f('0x43')]({'where':{'id':_0x3b35e2['params']['id']}})['then'](handleEntityNotFound(_0x5e9a50,null))[_0x528f('0x20')](removeEntity(_0x5e9a50,null))[_0x528f('0x41')](handleError(_0x5e9a50,null));};exports[_0x528f('0x4d')]=function(_0x45b425,_0x1acf06){var _0x345ccc=0xa;var _0x3caf7f=['join',_0x528f('0x4e'),_0x528f('0x4f'),_0x528f('0x50')];var _0x3ab167={'SUM':_0x528f('0x51'),'COUNT':_0x528f('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x528f('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x528f('0x54'),'GROUP_CONCAT ASC':_0x528f('0x55'),'GROUP_CONCAT DESC':_0x528f('0x56')};var _0x10b357={'SEC_TO_TIME':_0x528f('0x57'),'DATE':'DATE(%s)','HOUR':_0x528f('0x58'),'ROUND':_0x528f('0x59'),'UNIX_TIMESTAMP':_0x528f('0x5a')};var _0x141a72=function(_0x537aed){return!_['includes']([_0x528f('0x5b'),_0x528f('0x5c'),_0x528f('0x5d'),_0x528f('0x5e')],_0x537aed);};var _0x2401a6=function(_0x3ed7ca){if(!_0x3ed7ca||!_0x3ed7ca['rules'][_0x528f('0x30')]){return'';}for(var _0x536c39='(',_0x2d84ec=0x0;_0x2d84ec<_0x3ed7ca['rules'][_0x528f('0x30')];_0x2d84ec+=0x1){_0x2d84ec>0x0&&(_0x536c39+='\x20'+_0x3ed7ca[_0x528f('0x5f')]+'\x20');_0x536c39+=_0x3ed7ca[_0x528f('0x60')][_0x2d84ec][_0x528f('0x61')]?_0x2401a6(_0x3ed7ca['rules'][_0x2d84ec][_0x528f('0x61')]):_0x3ed7ca['rules'][_0x2d84ec][_0x528f('0x3b')]+'\x20'+_0x3ed7ca[_0x528f('0x60')][_0x2d84ec][_0x528f('0x62')]+(_0x141a72(_0x3ed7ca[_0x528f('0x60')][_0x2d84ec][_0x528f('0x62')])?'\x20'+_0x3ed7ca[_0x528f('0x60')][_0x2d84ec]['value']:'');}return _0x536c39+')';};var _0x61a434={'where':{'id':_0x45b425[_0x528f('0x63')]['id']}},_0x25c8a6,_0x4e9545,_0x254112,_0x57df88,_0x49b049;_0x61a434=_['merge']({},_0x61a434,_0x45b425['options']);return db[_0x528f('0x3d')][_0x528f('0x43')](_0x61a434)[_0x528f('0x20')](function(_0x36a1a7){if(_0x36a1a7){_0x25c8a6=_0x36a1a7;return _0x36a1a7['getFields']();}return null;})[_0x528f('0x20')](function(_0x5c1a0c){if(_0x5c1a0c){if(!_0x5c1a0c['length']){throw new db['Sequelize'][(_0x528f('0x64'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4e9545=_0x5c1a0c;return db[_0x528f('0x65')]['findAll']({'raw':!![]});}return null;})[_0x528f('0x20')](function(_0x358dda){if(_0x358dda){_0x254112=_[_0x528f('0x66')](_0x358dda,'id');var _0x1d4148;var _0x26e1b8=squel[_0x528f('0x67')]();_0x26e1b8['from'](_0x25c8a6['table']);for(var _0x4f1968=0x0;_0x4f1968<_0x4e9545['length'];_0x4f1968+=0x1){_0x1d4148=_0x4e9545[_0x4f1968]['MetricId']?_0x254112[_0x4e9545[_0x4f1968][_0x528f('0x68')]][_0x528f('0x69')]:_0x4e9545[_0x4f1968]['field'];_0x1d4148=_0x4e9545[_0x4f1968]['function']?_[_0x528f('0x6a')](_0x3ab167[_0x4e9545[_0x4f1968]['function']],'%s',_0x1d4148):_0x1d4148;_0x1d4148=_0x4e9545[_0x4f1968][_0x528f('0x6b')]?_[_0x528f('0x6a')](_0x10b357[_0x4e9545[_0x4f1968][_0x528f('0x6b')]],'%s',_0x1d4148):_0x1d4148;if(_0x4e9545[_0x4f1968][_0x528f('0x6c')]){_0x26e1b8[_0x528f('0x61')](_0x1d4148);}_0x4e9545[_0x4f1968][_0x528f('0x6d')]&&_0x26e1b8[_0x528f('0x32')](_0x1d4148,_0x4e9545[_0x4f1968][_0x528f('0x6d')]===_0x528f('0x6e')?![]:!![]);_0x26e1b8[_0x528f('0x3b')](_0x1d4148,_0x4e9545[_0x4f1968][_0x528f('0x6f')]||_0x1d4148);}if(_0x25c8a6['joins']){_0x25c8a6[_0x528f('0x70')]=JSON[_0x528f('0x71')](_0x25c8a6[_0x528f('0x70')]);for(var _0x4de786=0x0;_0x4de786<_0x25c8a6[_0x528f('0x70')][_0x528f('0x30')];_0x4de786+=0x1){if(_0x25c8a6[_0x528f('0x70')][_0x4de786][_0x528f('0x38')]&&_[_0x528f('0x72')](_0x3caf7f,_0x25c8a6[_0x528f('0x70')][_0x4de786][_0x528f('0x38')])&&_0x25c8a6[_0x528f('0x70')][_0x4de786][_0x528f('0x73')]&&_0x25c8a6[_0x528f('0x70')][_0x4de786][_0x528f('0x74')]&&_0x25c8a6[_0x528f('0x70')][_0x4de786][_0x528f('0x75')]){_0x26e1b8[_0x25c8a6['joins'][_0x4de786][_0x528f('0x38')]](_0x25c8a6[_0x528f('0x70')][_0x4de786][_0x528f('0x74')],null,util[_0x528f('0x6b')](_0x528f('0x76'),_0x25c8a6['table'],_0x25c8a6['joins'][_0x4de786][_0x528f('0x73')],_0x25c8a6[_0x528f('0x70')][_0x4de786][_0x528f('0x74')],_0x25c8a6['joins'][_0x4de786][_0x528f('0x75')]));}}}if(_0x25c8a6[_0x528f('0x77')]){_0x25c8a6['conditions']=JSON[_0x528f('0x71')](_0x25c8a6[_0x528f('0x77')]);_0x26e1b8['where'](_0x2401a6(_0x25c8a6['conditions'][_0x528f('0x61')]));}_0x49b049=_0x26e1b8[_0x528f('0x78')]();_0x26e1b8[_0x528f('0x1c')](_0x345ccc);_0x26e1b8[_0x528f('0x1b')](0x0);logger[_0x528f('0x79')](_0x528f('0x7a'),_0x26e1b8[_0x528f('0x7b')]());return db[_0x528f('0x7c')][_0x528f('0x2a')](_0x26e1b8[_0x528f('0x7b')](),{'type':db[_0x528f('0x7c')][_0x528f('0x7d')][_0x528f('0x7e')]});}})[_0x528f('0x20')](respondWithResult(_0x1acf06,null))[_0x528f('0x41')](handleError(_0x1acf06,null));};function runReport(_0x4cb977,_0x3d3dcb,_0x1d4908){var _0x583d44=_0x3d3dcb[_0x528f('0x26')];var _0x254590=0xa;var _0x9876cd=[_0x528f('0x7f'),_0x528f('0x4e'),'right_join','cross_join'];var _0x1a5328={'SUM':'SUM(%s)','COUNT':_0x528f('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x528f('0x80'),'MIN':_0x528f('0x53'),'AVG':_0x528f('0x81'),'GROUP_CONCAT':_0x528f('0x54'),'GROUP_CONCAT ASC':_0x528f('0x55'),'GROUP_CONCAT DESC':_0x528f('0x56')};var _0x47aa88={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x528f('0x82'),'HOUR':_0x528f('0x58'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x528f('0x5a')};var _0x12aea1=function(_0x57287b){return!_[_0x528f('0x72')]([_0x528f('0x5b'),_0x528f('0x5c'),_0x528f('0x5d'),_0x528f('0x5e')],_0x57287b);};var _0x1479de=function(_0x2f0df0){if(!_0x2f0df0||!_0x2f0df0['rules'][_0x528f('0x30')]){return'';}for(var _0x5855e2='(',_0xfae39d=0x0;_0xfae39d<_0x2f0df0[_0x528f('0x60')]['length'];_0xfae39d+=0x1){_0xfae39d>0x0&&(_0x5855e2+='\x20'+_0x2f0df0[_0x528f('0x5f')]+'\x20');_0x5855e2+=_0x2f0df0[_0x528f('0x60')][_0xfae39d][_0x528f('0x61')]?_0x1479de(_0x2f0df0[_0x528f('0x60')][_0xfae39d][_0x528f('0x61')]):_0x2f0df0[_0x528f('0x60')][_0xfae39d][_0x528f('0x3b')]+'\x20'+_0x2f0df0[_0x528f('0x60')][_0xfae39d][_0x528f('0x62')]+(_0x12aea1(_0x2f0df0[_0x528f('0x60')][_0xfae39d]['condition'])?'\x20'+_0x2f0df0[_0x528f('0x60')][_0xfae39d][_0x528f('0x83')]:'');}return _0x5855e2+')';};var _0x50086f={'where':{'id':_0x4cb977['id']}},_0x3041f1,_0x26af2b,_0x45e65c,_0x1bc368,_0x3eb6f4;_0x50086f=_[_0x528f('0x37')]({},_0x50086f,_0x1d4908);return db[_0x528f('0x3d')][_0x528f('0x43')](_0x50086f)[_0x528f('0x20')](function(_0x4a6731){if(_0x4a6731){_0x3041f1=_0x4a6731;return _0x4a6731[_0x528f('0x84')]();}return null;})[_0x528f('0x20')](function(_0x58f8ee){if(_0x58f8ee){if(!_0x58f8ee[_0x528f('0x30')]){throw new db['Sequelize'][(_0x528f('0x64'))](_0x528f('0x85'),0x193);}_0x26af2b=_0x58f8ee;return db[_0x528f('0x65')][_0x528f('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x423171){if(_0x423171){_0x45e65c=_[_0x528f('0x66')](_0x423171,'id');var _0x5b2e4e;var _0xd4e48e=squel['select']();_0xd4e48e['from'](_0x3041f1[_0x528f('0x86')]);for(var _0x12fd6d=0x0;_0x12fd6d<_0x26af2b[_0x528f('0x30')];_0x12fd6d+=0x1){_0x5b2e4e=_0x26af2b[_0x12fd6d][_0x528f('0x68')]?_0x45e65c[_0x26af2b[_0x12fd6d][_0x528f('0x68')]][_0x528f('0x69')]:_0x26af2b[_0x12fd6d][_0x528f('0x3b')];_0x5b2e4e=_0x26af2b[_0x12fd6d][_0x528f('0x87')]?_['replace'](_0x1a5328[_0x26af2b[_0x12fd6d][_0x528f('0x87')]],'%s',_0x5b2e4e):_0x5b2e4e;_0x5b2e4e=_0x26af2b[_0x12fd6d]['format']?_[_0x528f('0x6a')](_0x47aa88[_0x26af2b[_0x12fd6d][_0x528f('0x6b')]],'%s',_0x5b2e4e):_0x5b2e4e;if(_0x26af2b[_0x12fd6d][_0x528f('0x6c')]){_0xd4e48e[_0x528f('0x61')](_0x5b2e4e);}_0x26af2b[_0x12fd6d][_0x528f('0x6d')]&&_0xd4e48e['order'](_0x5b2e4e,_0x26af2b[_0x12fd6d][_0x528f('0x6d')]===_0x528f('0x6e')?![]:!![]);_0xd4e48e['field'](_0x5b2e4e,_0x26af2b[_0x12fd6d][_0x528f('0x6f')]||_0x5b2e4e);}if(_0x3041f1[_0x528f('0x70')]){_0x3041f1[_0x528f('0x70')]=JSON[_0x528f('0x71')](_0x3041f1[_0x528f('0x70')]);for(var _0x55457e=0x0;_0x55457e<_0x3041f1[_0x528f('0x70')][_0x528f('0x30')];_0x55457e+=0x1){if(_0x3041f1[_0x528f('0x70')][_0x55457e][_0x528f('0x38')]&&_[_0x528f('0x72')](_0x9876cd,_0x3041f1[_0x528f('0x70')][_0x55457e]['type'])&&_0x3041f1[_0x528f('0x70')][_0x55457e][_0x528f('0x73')]&&_0x3041f1[_0x528f('0x70')][_0x55457e][_0x528f('0x74')]&&_0x3041f1[_0x528f('0x70')][_0x55457e]['foreignKey']){_0xd4e48e[_0x3041f1[_0x528f('0x70')][_0x55457e][_0x528f('0x38')]](_0x3041f1[_0x528f('0x70')][_0x55457e][_0x528f('0x74')],null,util[_0x528f('0x6b')]('%s.%s\x20=\x20%s.%s',_0x3041f1['table'],_0x3041f1[_0x528f('0x70')][_0x55457e][_0x528f('0x73')],_0x3041f1[_0x528f('0x70')][_0x55457e][_0x528f('0x74')],_0x3041f1[_0x528f('0x70')][_0x55457e][_0x528f('0x75')]));}}}if(_0x3041f1[_0x528f('0x77')]){_0x3041f1['conditions']=JSON['parse'](_0x3041f1['conditions']);_0xd4e48e[_0x528f('0x34')](_0x1479de(_0x3041f1[_0x528f('0x77')][_0x528f('0x61')]));}_0x3eb6f4=_0xd4e48e[_0x528f('0x78')]();_0xd4e48e[_0x528f('0x1c')](_0x254590);_0xd4e48e[_0x528f('0x1b')](0x0);logger[_0x528f('0x79')](_0x528f('0x7a'),_0xd4e48e[_0x528f('0x7b')]());return db[_0x528f('0x7c')][_0x528f('0x2a')](_0xd4e48e['toString'](),{'type':db['sequelize']['QueryTypes'][_0x528f('0x7e')]});}})[_0x528f('0x20')](function(_0x4da924){if(!_0x4da924[_0x528f('0x30')]){throw new db[(_0x528f('0x88'))][(_0x528f('0x64'))](_0x528f('0x89'),0xcc);}if(_0x3d3dcb['output']==='web'){return null;}var _0x5d4a20=_[_0x528f('0x37')](_0x3d3dcb,{'name':_0x3d3dcb['fullPath']||_0x3d3dcb[_0x528f('0x26')]||_0x3041f1['name'],'basename':_0x583d44,'savename':util[_0x528f('0x6b')]('%s-%s.%s',_0x3d3dcb[_0x528f('0x26')]||_0x3041f1['name'],require(_0x528f('0x8a'))[_0x528f('0x8b')](0x4),_0x3d3dcb[_0x528f('0x8c')]||_0x528f('0x8d')),'reportId':_0x3041f1['id'],'reportType':_0x528f('0x8e')});return db[_0x528f('0x8f')][_0x528f('0x44')](_0x5d4a20,{'raw':!![]});})[_0x528f('0x20')](function(_0x4b68b2){if(_0x3041f1[_0x528f('0x86')]===_0x528f('0x90')){_0x3eb6f4['where'](_0x3041f1[_0x528f('0x86')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3d3dcb[_0x528f('0x91')],_0x3d3dcb[_0x528f('0x92')]);}else{_0x3eb6f4['where'](_0x3041f1[_0x528f('0x86')]+_0x528f('0x93'),_0x3d3dcb[_0x528f('0x91')],_0x3d3dcb[_0x528f('0x92')]);}if(_0x4b68b2){logger[_0x528f('0x94')](_0x528f('0x95'),_0x3eb6f4[_0x528f('0x7b')]());require(_0x528f('0x96'))[_0x528f('0x97')](path[_0x528f('0x7f')](__dirname,_0x528f('0x98'),_0x4b68b2[_0x528f('0x8c')]),[_0x4b68b2['id'],_0x3eb6f4[_0x528f('0x7b')](),path['join'](__dirname,_0x528f('0x99'),_0x4b68b2['savename']),_0x583d44]);return _0x4b68b2;}else{var _0x4cb5fd=squel[_0x528f('0x67')]();_0x4cb5fd[_0x528f('0x9a')]('('+_0x3eb6f4[_0x528f('0x7b')]()+')',_0x528f('0x9b'));_0x4cb5fd[_0x528f('0x3b')](_0x528f('0x9c'),'count');_0x3eb6f4['limit'](_0x3d3dcb[_0x528f('0x1c')]||_0x254590);_0x3eb6f4['offset'](_0x3d3dcb[_0x528f('0x1b')]||0x0);return db['sequelize'][_0x528f('0x2a')](_0x4cb5fd[_0x528f('0x7b')](),{'type':db[_0x528f('0x7c')]['QueryTypes'][_0x528f('0x7e')]})[_0x528f('0x20')](function(_0x1cddb1){if(!_0x1cddb1[_0x528f('0x30')]){_0x1bc368=0x0;}else{_0x1bc368=_0x1cddb1[0x0][_0x528f('0x1a')]||0x0;}return db[_0x528f('0x7c')]['query'](_0x3eb6f4['toString'](),{'type':db[_0x528f('0x7c')][_0x528f('0x7d')][_0x528f('0x7e')]});})[_0x528f('0x20')](function(_0x5a2c99){return{'rows':_0x5a2c99||[],'count':_0x1bc368};});}});}exports[_0x528f('0x9d')]=function(_0x2d75be,_0xcfc76){return runReport(_0x2d75be[_0x528f('0x63')],_0x2d75be[_0x528f('0x2a')],_0x2d75be['options'])[_0x528f('0x20')](respondWithResult(_0xcfc76,null))[_0x528f('0x41')](handleError(_0xcfc76,null));};exports[_0x528f('0x9e')]=runReport;exports[_0x528f('0x2a')]=function(_0x2f19d8,_0x5e2c53){var _0x95d919=0xa;var _0x3c9660=[_0x528f('0x7f'),_0x528f('0x4e'),'right_join','cross_join'];var _0x4c37a7={'SUM':_0x528f('0x51'),'COUNT':_0x528f('0x52'),'COUNT DISTINCT':_0x528f('0x9f'),'MAX':_0x528f('0x80'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x528f('0x55'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x19756b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x528f('0x82'),'HOUR':_0x528f('0x58'),'ROUND':_0x528f('0x59'),'UNIX_TIMESTAMP':_0x528f('0x5a')};var _0x1b207a=function(_0x293e8b){return!_[_0x528f('0x72')](['IS\x20NULL',_0x528f('0x5c'),_0x528f('0x5d'),'IS\x20NOT\x20EMPTY'],_0x293e8b);};var _0x159f42=function(_0xb5dea6){if(!_0xb5dea6||!_0xb5dea6['rules'][_0x528f('0x30')]){return'';}for(var _0x4a70d2='(',_0x3f8d41=0x0;_0x3f8d41<_0xb5dea6[_0x528f('0x60')]['length'];_0x3f8d41+=0x1){_0x3f8d41>0x0&&(_0x4a70d2+='\x20'+_0xb5dea6[_0x528f('0x5f')]+'\x20');_0x4a70d2+=_0xb5dea6[_0x528f('0x60')][_0x3f8d41][_0x528f('0x61')]?_0x159f42(_0xb5dea6[_0x528f('0x60')][_0x3f8d41][_0x528f('0x61')]):_0xb5dea6[_0x528f('0x60')][_0x3f8d41]['field']+'\x20'+_0xb5dea6[_0x528f('0x60')][_0x3f8d41][_0x528f('0x62')]+(_0x1b207a(_0xb5dea6[_0x528f('0x60')][_0x3f8d41][_0x528f('0x62')])?'\x20'+_0xb5dea6[_0x528f('0x60')][_0x3f8d41]['value']:'');}return _0x4a70d2+')';};var _0x4acaa6={'where':{'id':_0x2f19d8[_0x528f('0x63')]['id']}},_0x245370,_0x1e6295,_0x1e9f36,_0x455fd4,_0x38984c;_0x4acaa6=_[_0x528f('0x37')]({},_0x4acaa6,_0x2f19d8[_0x528f('0x3c')]);return db[_0x528f('0x3d')][_0x528f('0x43')](_0x4acaa6)[_0x528f('0x20')](function(_0x13b027){if(_0x13b027){_0x245370=_0x13b027;return _0x13b027[_0x528f('0x84')]();}return null;})['then'](function(_0x46fb30){if(_0x46fb30){if(!_0x46fb30[_0x528f('0x30')]){throw new db[(_0x528f('0x88'))][(_0x528f('0x64'))](_0x528f('0x85'),0x193);}_0x1e6295=_0x46fb30;return db['AnalyticMetric'][_0x528f('0x3f')]({'raw':!![]});}return null;})[_0x528f('0x20')](function(_0x29f9af){if(_0x29f9af){_0x1e9f36=_[_0x528f('0x66')](_0x29f9af,'id');var _0x9e263c;var _0x42786b=squel[_0x528f('0x67')]();_0x42786b[_0x528f('0x9a')](_0x245370['table']);for(var _0x37ca9d=0x0;_0x37ca9d<_0x1e6295[_0x528f('0x30')];_0x37ca9d+=0x1){_0x9e263c=_0x1e6295[_0x37ca9d][_0x528f('0x68')]?_0x1e9f36[_0x1e6295[_0x37ca9d][_0x528f('0x68')]][_0x528f('0x69')]:_0x1e6295[_0x37ca9d][_0x528f('0x3b')];_0x9e263c=_0x1e6295[_0x37ca9d][_0x528f('0x87')]?_[_0x528f('0x6a')](_0x4c37a7[_0x1e6295[_0x37ca9d][_0x528f('0x87')]],'%s',_0x9e263c):_0x9e263c;_0x9e263c=_0x1e6295[_0x37ca9d][_0x528f('0x6b')]?_[_0x528f('0x6a')](_0x19756b[_0x1e6295[_0x37ca9d]['format']],'%s',_0x9e263c):_0x9e263c;if(_0x1e6295[_0x37ca9d][_0x528f('0x6c')]){_0x42786b[_0x528f('0x61')](_0x9e263c);}_0x1e6295[_0x37ca9d][_0x528f('0x6d')]&&_0x42786b[_0x528f('0x32')](_0x9e263c,_0x1e6295[_0x37ca9d][_0x528f('0x6d')]===_0x528f('0x6e')?![]:!![]);_0x42786b['field'](_0x9e263c,_0x1e6295[_0x37ca9d][_0x528f('0x6f')]||_0x9e263c);}if(_0x245370[_0x528f('0x70')]){_0x245370[_0x528f('0x70')]=JSON[_0x528f('0x71')](_0x245370[_0x528f('0x70')]);for(var _0x232d4f=0x0;_0x232d4f<_0x245370['joins'][_0x528f('0x30')];_0x232d4f+=0x1){if(_0x245370[_0x528f('0x70')][_0x232d4f][_0x528f('0x38')]&&_['includes'](_0x3c9660,_0x245370[_0x528f('0x70')][_0x232d4f][_0x528f('0x38')])&&_0x245370[_0x528f('0x70')][_0x232d4f][_0x528f('0x73')]&&_0x245370[_0x528f('0x70')][_0x232d4f][_0x528f('0x74')]&&_0x245370['joins'][_0x232d4f][_0x528f('0x75')]){_0x42786b[_0x245370[_0x528f('0x70')][_0x232d4f][_0x528f('0x38')]](_0x245370[_0x528f('0x70')][_0x232d4f][_0x528f('0x74')],null,util[_0x528f('0x6b')](_0x528f('0x76'),_0x245370[_0x528f('0x86')],_0x245370['joins'][_0x232d4f][_0x528f('0x73')],_0x245370[_0x528f('0x70')][_0x232d4f][_0x528f('0x74')],_0x245370[_0x528f('0x70')][_0x232d4f][_0x528f('0x75')]));}}}if(_0x245370[_0x528f('0x77')]){_0x245370[_0x528f('0x77')]=JSON[_0x528f('0x71')](_0x245370[_0x528f('0x77')]);_0x42786b[_0x528f('0x34')](_0x159f42(_0x245370[_0x528f('0x77')][_0x528f('0x61')]));}_0x38984c=_0x42786b[_0x528f('0x78')]();_0x42786b[_0x528f('0x1c')](_0x95d919);_0x42786b[_0x528f('0x1b')](0x0);logger[_0x528f('0x79')]('Limited\x20Query:',_0x42786b['toString']());return db[_0x528f('0x7c')][_0x528f('0x2a')](_0x42786b[_0x528f('0x7b')](),{'type':db[_0x528f('0x7c')][_0x528f('0x7d')][_0x528f('0x7e')]});}})['then'](function(){return{'sql':_0x38984c[_0x528f('0x7b')]()};})['then'](respondWithResult(_0x5e2c53,null))[_0x528f('0x41')](handleError(_0x5e2c53,null));}; \ No newline at end of file +var _0x3c30=['value','metric','Limited\x20Query:','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','save','then','destroy','DefaultReports','UserProfileResource','stack','name','send','index','AnalyticDefaultReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','IS\x20NULL','IS\x20EMPTY','rules','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','replace','format','groupBy','orderBy','order','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','sequelize','SUM(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','operator','from','function','DESC','table','clone','toString','QueryTypes','SELECT','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport'];(function(_0x1562eb,_0x4226c3){var _0xe0e85b=function(_0x53a646){while(--_0x53a646){_0x1562eb['push'](_0x1562eb['shift']());}};_0xe0e85b(++_0x4226c3);}(_0x3c30,0x1ef));var _0x03c3=function(_0x5522e7,_0x5119b1){_0x5522e7=_0x5522e7-0x0;var _0x11b7e7=_0x3c30[_0x5522e7];return _0x11b7e7;};'use strict';var pdf=require(_0x03c3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x03c3('0x1'));var zipdir=require(_0x03c3('0x2'));var jsonpatch=require(_0x03c3('0x3'));var rp=require(_0x03c3('0x4'));var moment=require(_0x03c3('0x5'));var BPromise=require(_0x03c3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x03c3('0x7'));var csv=require(_0x03c3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x03c3('0x9'));var squel=require(_0x03c3('0xa'));var crypto=require('crypto');var jsforce=require(_0x03c3('0xb'));var deskjs=require(_0x03c3('0xc'));var toCsv=require(_0x03c3('0x8'));var querystring=require(_0x03c3('0xd'));var Papa=require(_0x03c3('0xe'));var authService=require(_0x03c3('0xf'));var hardwareService=require(_0x03c3('0x10'));var Redis=require(_0x03c3('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x03c3('0x12'))('api');var utils=require(_0x03c3('0x13'));var config=require(_0x03c3('0x14'));var db=require(_0x03c3('0x15'))['db'];function respondWithStatusCode(_0x4d3fe5,_0x368661){_0x368661=_0x368661||0xcc;return function(_0x2e65dd){if(_0x2e65dd){return _0x4d3fe5[_0x03c3('0x16')](_0x368661);}return _0x4d3fe5['status'](_0x368661)[_0x03c3('0x17')]();};}function respondWithResult(_0x3a0ffe,_0x230380){_0x230380=_0x230380||0xc8;return function(_0x1fe9bd){if(_0x1fe9bd){return _0x3a0ffe[_0x03c3('0x18')](_0x230380)[_0x03c3('0x19')](_0x1fe9bd);}};}function respondWithFilteredResult(_0x117c5a,_0x37a3ea){return function(_0x375018){if(_0x375018){var _0x1677a7=_0x375018[_0x03c3('0x1a')],_0x464ab8=_0x37a3ea['offset'],_0x54c332=_0x37a3ea[_0x03c3('0x1b')]+_0x37a3ea[_0x03c3('0x1c')],_0x57bd3c;if(_0x54c332>=_0x1677a7){_0x54c332=_0x1677a7;_0x57bd3c=0xc8;}else{_0x57bd3c=0xce;}_0x117c5a[_0x03c3('0x18')](_0x57bd3c);return _0x117c5a['set'](_0x03c3('0x1d'),_0x464ab8+'-'+_0x54c332+'/'+_0x1677a7)[_0x03c3('0x19')](_0x375018);}return null;};}function patchUpdates(_0x292917){return function(_0x5bc26f){try{jsonpatch[_0x03c3('0x1e')](_0x5bc26f,_0x292917,!![]);}catch(_0x22dc9f){return BPromise['reject'](_0x22dc9f);}return _0x5bc26f[_0x03c3('0x1f')]();};}function saveUpdates(_0xcb2906,_0x307f81){return function(_0xf17701){if(_0xf17701){return _0xf17701['update'](_0xcb2906)[_0x03c3('0x20')](function(_0x233085){return _0x233085;});}return null;};}function removeEntity(_0x5ac121,_0x11b0a3){return function(_0xd484d){if(_0xd484d){return _0xd484d[_0x03c3('0x21')]()[_0x03c3('0x20')](function(){var _0x5147cb=_0xd484d['get']({'plain':!![]});var _0x14b3dd=_0x03c3('0x22');return db[_0x03c3('0x23')][_0x03c3('0x21')]({'where':{'type':_0x14b3dd,'resourceId':_0x5147cb['id']}})['then'](function(){return _0xd484d;});})[_0x03c3('0x20')](function(){_0x5ac121[_0x03c3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44e252,_0x5e9d14){return function(_0x130842){if(!_0x130842){_0x44e252[_0x03c3('0x16')](0x194);}return _0x130842;};}function handleError(_0xad6afe,_0x411100){_0x411100=_0x411100||0x1f4;return function(_0x536dd3){logger['error'](_0x536dd3[_0x03c3('0x24')]);if(_0x536dd3[_0x03c3('0x25')]){delete _0x536dd3[_0x03c3('0x25')];}_0xad6afe[_0x03c3('0x18')](_0x411100)[_0x03c3('0x26')](_0x536dd3);};}exports[_0x03c3('0x27')]=function(_0x40fc3b,_0x2acdc8){var _0x2659d3={},_0x1951fe={},_0x4db006={'count':0x0,'rows':[]};var _0x4376a4=db[_0x03c3('0x28')][_0x03c3('0x29')];_0x1951fe[_0x03c3('0x2a')]=_[_0x03c3('0x2b')](_0x4376a4);_0x1951fe[_0x03c3('0x2c')]=_[_0x03c3('0x2b')](_0x40fc3b[_0x03c3('0x2c')]);_0x1951fe[_0x03c3('0x2d')]=_[_0x03c3('0x2e')](_0x1951fe[_0x03c3('0x2a')],_0x1951fe[_0x03c3('0x2c')]);_0x2659d3[_0x03c3('0x2f')]=_[_0x03c3('0x2e')](_0x1951fe[_0x03c3('0x2a')],qs['fields'](_0x40fc3b[_0x03c3('0x2c')][_0x03c3('0x30')]));_0x2659d3['attributes']=_0x2659d3[_0x03c3('0x2f')]['length']?_0x2659d3[_0x03c3('0x2f')]:_0x1951fe[_0x03c3('0x2a')];if(!_0x40fc3b['query']['hasOwnProperty'](_0x03c3('0x31'))){_0x2659d3['limit']=qs[_0x03c3('0x1c')](_0x40fc3b[_0x03c3('0x2c')]['limit']);_0x2659d3[_0x03c3('0x1b')]=qs[_0x03c3('0x1b')](_0x40fc3b[_0x03c3('0x2c')][_0x03c3('0x1b')]);}_0x2659d3['order']=qs[_0x03c3('0x32')](_0x40fc3b[_0x03c3('0x2c')][_0x03c3('0x32')]);_0x2659d3[_0x03c3('0x33')]=qs[_0x03c3('0x2d')](_[_0x03c3('0x34')](_0x40fc3b[_0x03c3('0x2c')],_0x1951fe[_0x03c3('0x2d')]));if(_0x40fc3b[_0x03c3('0x2c')][_0x03c3('0x35')]){_0x2659d3[_0x03c3('0x33')]=_[_0x03c3('0x36')](_0x2659d3['where'],{'$or':_['map'](_0x4376a4,function(_0x1a1cc1){if(_0x1a1cc1[_0x03c3('0x37')][_0x03c3('0x38')]!==_0x03c3('0x39')){var _0x5809ff={};_0x5809ff[_0x1a1cc1['field']]={'$like':'%'+_0x40fc3b[_0x03c3('0x2c')]['filter']+'%'};return _0x5809ff;}})});}_0x2659d3=_['merge']({},_0x2659d3,_0x40fc3b[_0x03c3('0x3a')]);var _0x6ff7ab={'where':_0x2659d3[_0x03c3('0x33')]};return db[_0x03c3('0x28')][_0x03c3('0x1a')](_0x6ff7ab)[_0x03c3('0x20')](function(_0x1dd38b){_0x4db006[_0x03c3('0x1a')]=_0x1dd38b;if(_0x40fc3b['query'][_0x03c3('0x3b')]){_0x2659d3[_0x03c3('0x3c')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x03c3('0x3d')](_0x2659d3);})[_0x03c3('0x20')](function(_0x55e4eb){_0x4db006[_0x03c3('0x3e')]=_0x55e4eb;return _0x4db006;})[_0x03c3('0x20')](respondWithFilteredResult(_0x2acdc8,_0x2659d3))[_0x03c3('0x3f')](handleError(_0x2acdc8,null));};exports[_0x03c3('0x40')]=function(_0xe82b2e,_0x458abe){var _0x30ec26={'raw':!![],'where':{'id':_0xe82b2e[_0x03c3('0x41')]['id']}},_0x36b650={};_0x36b650[_0x03c3('0x2a')]=_[_0x03c3('0x2b')](db[_0x03c3('0x28')][_0x03c3('0x29')]);_0x36b650[_0x03c3('0x2c')]=_[_0x03c3('0x2b')](_0xe82b2e[_0x03c3('0x2c')]);_0x36b650['filters']=_[_0x03c3('0x2e')](_0x36b650[_0x03c3('0x2a')],_0x36b650[_0x03c3('0x2c')]);_0x30ec26['attributes']=_[_0x03c3('0x2e')](_0x36b650[_0x03c3('0x2a')],qs[_0x03c3('0x30')](_0xe82b2e[_0x03c3('0x2c')][_0x03c3('0x30')]));_0x30ec26[_0x03c3('0x2f')]=_0x30ec26[_0x03c3('0x2f')][_0x03c3('0x42')]?_0x30ec26[_0x03c3('0x2f')]:_0x36b650[_0x03c3('0x2a')];if(_0xe82b2e[_0x03c3('0x2c')][_0x03c3('0x3b')]){_0x30ec26[_0x03c3('0x3c')]=[{'all':!![]}];}_0x30ec26=_[_0x03c3('0x36')]({},_0x30ec26,_0xe82b2e[_0x03c3('0x3a')]);return db[_0x03c3('0x28')][_0x03c3('0x43')](_0x30ec26)[_0x03c3('0x20')](handleEntityNotFound(_0x458abe,null))['then'](respondWithResult(_0x458abe,null))[_0x03c3('0x3f')](handleError(_0x458abe,null));};exports[_0x03c3('0x44')]=function(_0x5cca5b,_0x877fc2){return db[_0x03c3('0x28')][_0x03c3('0x44')](_0x5cca5b[_0x03c3('0x45')],{})[_0x03c3('0x20')](function(_0xc913e4){var _0x4fd9af=_0x5cca5b['user']['get']({'plain':!![]});if(!_0x4fd9af)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fd9af[_0x03c3('0x46')]===_0x03c3('0x47')){var _0x3f713d=_0xc913e4['get']({'plain':!![]});var _0x31abfe=_0x03c3('0x48');return db[_0x03c3('0x49')]['find']({'where':{'name':_0x31abfe,'userProfileId':_0x4fd9af[_0x03c3('0x4a')]},'raw':!![]})[_0x03c3('0x20')](function(_0x5d99dc){if(_0x5d99dc&&_0x5d99dc[_0x03c3('0x4b')]===0x0){return db[_0x03c3('0x23')]['create']({'name':_0x3f713d[_0x03c3('0x25')],'resourceId':_0x3f713d['id'],'type':_0x03c3('0x22'),'sectionId':_0x5d99dc['id']},{})[_0x03c3('0x20')](function(){return _0xc913e4;});}else{return _0xc913e4;}})[_0x03c3('0x3f')](function(_0x270ac6){logger[_0x03c3('0x4c')](_0x03c3('0x4d'),_0x270ac6);throw _0x270ac6;});}return _0xc913e4;})[_0x03c3('0x20')](respondWithResult(_0x877fc2,0xc9))[_0x03c3('0x3f')](handleError(_0x877fc2,null));};exports[_0x03c3('0x4e')]=function(_0x4f0c7c,_0x15f431){if(_0x4f0c7c[_0x03c3('0x45')]['id']){delete _0x4f0c7c[_0x03c3('0x45')]['id'];}return db[_0x03c3('0x28')][_0x03c3('0x43')]({'where':{'id':_0x4f0c7c[_0x03c3('0x41')]['id']}})[_0x03c3('0x20')](handleEntityNotFound(_0x15f431,null))[_0x03c3('0x20')](saveUpdates(_0x4f0c7c[_0x03c3('0x45')],null))['then'](respondWithResult(_0x15f431,null))[_0x03c3('0x3f')](handleError(_0x15f431,null));};exports['destroy']=function(_0x16414b,_0x580bc1){return db[_0x03c3('0x28')]['find']({'where':{'id':_0x16414b['params']['id']}})[_0x03c3('0x20')](handleEntityNotFound(_0x580bc1,null))['then'](removeEntity(_0x580bc1,null))[_0x03c3('0x3f')](handleError(_0x580bc1,null));};exports[_0x03c3('0x4f')]=function(_0x580438,_0xd25c9f){var _0x17e0ba=0xa;var _0x1e4e58=[_0x03c3('0x50'),_0x03c3('0x51'),_0x03c3('0x52'),_0x03c3('0x53')];var _0x462c28={'SUM':'SUM(%s)','COUNT':_0x03c3('0x54'),'COUNT DISTINCT':_0x03c3('0x55'),'MAX':_0x03c3('0x56'),'MIN':_0x03c3('0x57'),'AVG':_0x03c3('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x03c3('0x59'),'GROUP_CONCAT DESC':_0x03c3('0x5a')};var _0xb1c921={'SEC_TO_TIME':_0x03c3('0x5b'),'DATE':_0x03c3('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x03c3('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2f5679=function(_0x2ab1b9){return!_['includes']([_0x03c3('0x5e'),'IS\x20NOT\x20NULL',_0x03c3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x2ab1b9);};var _0x29d11d=function(_0x2faaab){if(!_0x2faaab||!_0x2faaab[_0x03c3('0x60')]['length']){return'';}for(var _0x51dc75='(',_0x514767=0x0;_0x514767<_0x2faaab[_0x03c3('0x60')][_0x03c3('0x42')];_0x514767+=0x1){_0x514767>0x0&&(_0x51dc75+='\x20'+_0x2faaab['operator']+'\x20');_0x51dc75+=_0x2faaab['rules'][_0x514767][_0x03c3('0x61')]?_0x29d11d(_0x2faaab[_0x03c3('0x60')][_0x514767][_0x03c3('0x61')]):_0x2faaab[_0x03c3('0x60')][_0x514767]['field']+'\x20'+_0x2faaab[_0x03c3('0x60')][_0x514767][_0x03c3('0x62')]+(_0x2f5679(_0x2faaab[_0x03c3('0x60')][_0x514767][_0x03c3('0x62')])?'\x20'+_0x2faaab[_0x03c3('0x60')][_0x514767]['value']:'');}return _0x51dc75+')';};var _0x4d21bc={'where':{'id':_0x580438[_0x03c3('0x41')]['id']}},_0x56cd4e,_0x36ca61,_0x54ab92,_0xcf72ac,_0x3678c0;_0x4d21bc=_['merge']({},_0x4d21bc,_0x580438[_0x03c3('0x3a')]);return db[_0x03c3('0x28')]['find'](_0x4d21bc)[_0x03c3('0x20')](function(_0x4ee2e5){if(_0x4ee2e5){_0x56cd4e=_0x4ee2e5;return _0x4ee2e5[_0x03c3('0x63')]();}return null;})[_0x03c3('0x20')](function(_0x491703){if(_0x491703){if(!_0x491703['length']){throw new db[(_0x03c3('0x64'))][(_0x03c3('0x65'))](_0x03c3('0x66'),0x193);}_0x36ca61=_0x491703;return db[_0x03c3('0x67')][_0x03c3('0x3d')]({'raw':!![]});}return null;})[_0x03c3('0x20')](function(_0x35e547){if(_0x35e547){_0x54ab92=_[_0x03c3('0x68')](_0x35e547,'id');var _0x5e4011;var _0x15f929=squel[_0x03c3('0x69')]();_0x15f929['from'](_0x56cd4e['table']);for(var _0x2c337d=0x0;_0x2c337d<_0x36ca61[_0x03c3('0x42')];_0x2c337d+=0x1){_0x5e4011=_0x36ca61[_0x2c337d]['MetricId']?_0x54ab92[_0x36ca61[_0x2c337d][_0x03c3('0x6a')]]['metric']:_0x36ca61[_0x2c337d][_0x03c3('0x6b')];_0x5e4011=_0x36ca61[_0x2c337d]['function']?_[_0x03c3('0x6c')](_0x462c28[_0x36ca61[_0x2c337d]['function']],'%s',_0x5e4011):_0x5e4011;_0x5e4011=_0x36ca61[_0x2c337d][_0x03c3('0x6d')]?_[_0x03c3('0x6c')](_0xb1c921[_0x36ca61[_0x2c337d][_0x03c3('0x6d')]],'%s',_0x5e4011):_0x5e4011;if(_0x36ca61[_0x2c337d][_0x03c3('0x6e')]){_0x15f929[_0x03c3('0x61')](_0x5e4011);}_0x36ca61[_0x2c337d][_0x03c3('0x6f')]&&_0x15f929[_0x03c3('0x70')](_0x5e4011,_0x36ca61[_0x2c337d][_0x03c3('0x6f')]==='DESC'?![]:!![]);_0x15f929['field'](_0x5e4011,_0x36ca61[_0x2c337d][_0x03c3('0x71')]||_0x5e4011);}if(_0x56cd4e[_0x03c3('0x72')]){_0x56cd4e['joins']=JSON[_0x03c3('0x73')](_0x56cd4e[_0x03c3('0x72')]);for(var _0x5e87ac=0x0;_0x5e87ac<_0x56cd4e[_0x03c3('0x72')]['length'];_0x5e87ac+=0x1){if(_0x56cd4e[_0x03c3('0x72')][_0x5e87ac][_0x03c3('0x37')]&&_[_0x03c3('0x74')](_0x1e4e58,_0x56cd4e[_0x03c3('0x72')][_0x5e87ac][_0x03c3('0x37')])&&_0x56cd4e[_0x03c3('0x72')][_0x5e87ac][_0x03c3('0x75')]&&_0x56cd4e[_0x03c3('0x72')][_0x5e87ac][_0x03c3('0x76')]&&_0x56cd4e[_0x03c3('0x72')][_0x5e87ac]['foreignKey']){_0x15f929[_0x56cd4e[_0x03c3('0x72')][_0x5e87ac][_0x03c3('0x37')]](_0x56cd4e['joins'][_0x5e87ac][_0x03c3('0x76')],null,util[_0x03c3('0x6d')](_0x03c3('0x77'),_0x56cd4e['table'],_0x56cd4e[_0x03c3('0x72')][_0x5e87ac]['parentKey'],_0x56cd4e[_0x03c3('0x72')][_0x5e87ac][_0x03c3('0x76')],_0x56cd4e[_0x03c3('0x72')][_0x5e87ac][_0x03c3('0x78')]));}}}if(_0x56cd4e[_0x03c3('0x79')]){_0x56cd4e[_0x03c3('0x79')]=JSON[_0x03c3('0x73')](_0x56cd4e[_0x03c3('0x79')]);_0x15f929[_0x03c3('0x33')](_0x29d11d(_0x56cd4e[_0x03c3('0x79')][_0x03c3('0x61')]));}_0x3678c0=_0x15f929['clone']();_0x15f929[_0x03c3('0x1c')](_0x17e0ba);_0x15f929[_0x03c3('0x1b')](0x0);logger[_0x03c3('0x7a')]('Limited\x20Query:',_0x15f929['toString']());return db['sequelize']['query'](_0x15f929['toString'](),{'type':db[_0x03c3('0x7b')]['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0xd25c9f,null))['catch'](handleError(_0xd25c9f,null));};function runReport(_0x41e2d9,_0x175e03,_0x4e25d8){var _0x542c56=_0x175e03[_0x03c3('0x25')];var _0x4f6fab=0xa;var _0x4d1af1=[_0x03c3('0x50'),_0x03c3('0x51'),_0x03c3('0x52'),_0x03c3('0x53')];var _0x15f478={'SUM':_0x03c3('0x7c'),'COUNT':_0x03c3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x03c3('0x57'),'AVG':_0x03c3('0x58'),'GROUP_CONCAT':_0x03c3('0x7d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x03c3('0x5a')};var _0x154ce5={'SEC_TO_TIME':_0x03c3('0x5b'),'DATE':_0x03c3('0x5c'),'HOUR':_0x03c3('0x7e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x03c3('0x7f')};var _0xa5b05c=function(_0x4f9d37){return!_[_0x03c3('0x74')](['IS\x20NULL',_0x03c3('0x80'),_0x03c3('0x5f'),_0x03c3('0x81')],_0x4f9d37);};var _0xf29b2f=function(_0x6dd49d){if(!_0x6dd49d||!_0x6dd49d[_0x03c3('0x60')][_0x03c3('0x42')]){return'';}for(var _0x2f0b1e='(',_0x12cf63=0x0;_0x12cf63<_0x6dd49d[_0x03c3('0x60')][_0x03c3('0x42')];_0x12cf63+=0x1){_0x12cf63>0x0&&(_0x2f0b1e+='\x20'+_0x6dd49d[_0x03c3('0x82')]+'\x20');_0x2f0b1e+=_0x6dd49d[_0x03c3('0x60')][_0x12cf63][_0x03c3('0x61')]?_0xf29b2f(_0x6dd49d['rules'][_0x12cf63][_0x03c3('0x61')]):_0x6dd49d[_0x03c3('0x60')][_0x12cf63][_0x03c3('0x6b')]+'\x20'+_0x6dd49d[_0x03c3('0x60')][_0x12cf63][_0x03c3('0x62')]+(_0xa5b05c(_0x6dd49d['rules'][_0x12cf63][_0x03c3('0x62')])?'\x20'+_0x6dd49d[_0x03c3('0x60')][_0x12cf63]['value']:'');}return _0x2f0b1e+')';};var _0x2401d8={'where':{'id':_0x41e2d9['id']}},_0x421a63,_0x2f71b8,_0x6a9733,_0x134a6c,_0x8c04ee;_0x2401d8=_[_0x03c3('0x36')]({},_0x2401d8,_0x4e25d8);return db[_0x03c3('0x28')][_0x03c3('0x43')](_0x2401d8)['then'](function(_0x61b526){if(_0x61b526){_0x421a63=_0x61b526;return _0x61b526[_0x03c3('0x63')]();}return null;})[_0x03c3('0x20')](function(_0x4aabf5){if(_0x4aabf5){if(!_0x4aabf5[_0x03c3('0x42')]){throw new db[(_0x03c3('0x64'))]['ValidationErrorItem'](_0x03c3('0x66'),0x193);}_0x2f71b8=_0x4aabf5;return db['AnalyticMetric'][_0x03c3('0x3d')]({'raw':!![]});}return null;})['then'](function(_0xc67db8){if(_0xc67db8){_0x6a9733=_[_0x03c3('0x68')](_0xc67db8,'id');var _0x2f1ec2;var _0x2d0ab8=squel['select']();_0x2d0ab8[_0x03c3('0x83')](_0x421a63['table']);for(var _0x583bb6=0x0;_0x583bb6<_0x2f71b8[_0x03c3('0x42')];_0x583bb6+=0x1){_0x2f1ec2=_0x2f71b8[_0x583bb6][_0x03c3('0x6a')]?_0x6a9733[_0x2f71b8[_0x583bb6][_0x03c3('0x6a')]]['metric']:_0x2f71b8[_0x583bb6][_0x03c3('0x6b')];_0x2f1ec2=_0x2f71b8[_0x583bb6][_0x03c3('0x84')]?_['replace'](_0x15f478[_0x2f71b8[_0x583bb6][_0x03c3('0x84')]],'%s',_0x2f1ec2):_0x2f1ec2;_0x2f1ec2=_0x2f71b8[_0x583bb6][_0x03c3('0x6d')]?_[_0x03c3('0x6c')](_0x154ce5[_0x2f71b8[_0x583bb6]['format']],'%s',_0x2f1ec2):_0x2f1ec2;if(_0x2f71b8[_0x583bb6][_0x03c3('0x6e')]){_0x2d0ab8[_0x03c3('0x61')](_0x2f1ec2);}_0x2f71b8[_0x583bb6][_0x03c3('0x6f')]&&_0x2d0ab8[_0x03c3('0x70')](_0x2f1ec2,_0x2f71b8[_0x583bb6][_0x03c3('0x6f')]===_0x03c3('0x85')?![]:!![]);_0x2d0ab8['field'](_0x2f1ec2,_0x2f71b8[_0x583bb6]['alias']||_0x2f1ec2);}if(_0x421a63[_0x03c3('0x72')]){_0x421a63[_0x03c3('0x72')]=JSON['parse'](_0x421a63[_0x03c3('0x72')]);for(var _0x15a6d9=0x0;_0x15a6d9<_0x421a63[_0x03c3('0x72')][_0x03c3('0x42')];_0x15a6d9+=0x1){if(_0x421a63[_0x03c3('0x72')][_0x15a6d9][_0x03c3('0x37')]&&_['includes'](_0x4d1af1,_0x421a63[_0x03c3('0x72')][_0x15a6d9]['type'])&&_0x421a63[_0x03c3('0x72')][_0x15a6d9][_0x03c3('0x75')]&&_0x421a63[_0x03c3('0x72')][_0x15a6d9][_0x03c3('0x76')]&&_0x421a63['joins'][_0x15a6d9][_0x03c3('0x78')]){_0x2d0ab8[_0x421a63[_0x03c3('0x72')][_0x15a6d9]['type']](_0x421a63[_0x03c3('0x72')][_0x15a6d9][_0x03c3('0x76')],null,util['format'](_0x03c3('0x77'),_0x421a63[_0x03c3('0x86')],_0x421a63[_0x03c3('0x72')][_0x15a6d9][_0x03c3('0x75')],_0x421a63[_0x03c3('0x72')][_0x15a6d9]['foreignTable'],_0x421a63['joins'][_0x15a6d9][_0x03c3('0x78')]));}}}if(_0x421a63['conditions']){_0x421a63[_0x03c3('0x79')]=JSON[_0x03c3('0x73')](_0x421a63[_0x03c3('0x79')]);_0x2d0ab8['where'](_0xf29b2f(_0x421a63['conditions']['group']));}_0x8c04ee=_0x2d0ab8[_0x03c3('0x87')]();_0x2d0ab8['limit'](_0x4f6fab);_0x2d0ab8[_0x03c3('0x1b')](0x0);logger[_0x03c3('0x7a')]('Limited\x20Query:',_0x2d0ab8[_0x03c3('0x88')]());return db[_0x03c3('0x7b')]['query'](_0x2d0ab8[_0x03c3('0x88')](),{'type':db[_0x03c3('0x7b')][_0x03c3('0x89')][_0x03c3('0x8a')]});}})[_0x03c3('0x20')](function(_0x232214){if(!_0x232214[_0x03c3('0x42')]){throw new db['Sequelize']['ValidationErrorItem'](_0x03c3('0x8b'),0xcc);}if(_0x175e03[_0x03c3('0x8c')]===_0x03c3('0x8d')){return null;}var _0x4c5d83=_[_0x03c3('0x36')](_0x175e03,{'name':_0x175e03[_0x03c3('0x8e')]||_0x175e03[_0x03c3('0x25')]||_0x421a63[_0x03c3('0x25')],'basename':_0x542c56,'savename':util['format'](_0x03c3('0x8f'),_0x175e03[_0x03c3('0x25')]||_0x421a63['name'],require(_0x03c3('0x90'))[_0x03c3('0x91')](0x4),_0x175e03['output']||_0x03c3('0x92')),'reportId':_0x421a63['id'],'reportType':_0x03c3('0x93')});return db[_0x03c3('0x94')]['create'](_0x4c5d83,{'raw':!![]});})[_0x03c3('0x20')](function(_0x3cea4c){if(_0x421a63['table']===_0x03c3('0x95')){_0x8c04ee[_0x03c3('0x33')](_0x421a63[_0x03c3('0x86')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x175e03['startDate'],_0x175e03['endDate']);}else{_0x8c04ee[_0x03c3('0x33')](_0x421a63['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x175e03[_0x03c3('0x96')],_0x175e03['endDate']);}if(_0x3cea4c){logger[_0x03c3('0x97')](_0x03c3('0x98'),_0x8c04ee[_0x03c3('0x88')]());require(_0x03c3('0x99'))[_0x03c3('0x9a')](path['join'](__dirname,_0x03c3('0x9b'),_0x3cea4c[_0x03c3('0x8c')]),[_0x3cea4c['id'],_0x8c04ee[_0x03c3('0x88')](),path[_0x03c3('0x50')](__dirname,_0x03c3('0x9c'),_0x3cea4c[_0x03c3('0x9d')]),_0x542c56]);return _0x3cea4c;}else{var _0x598291=squel[_0x03c3('0x69')]();_0x598291[_0x03c3('0x83')]('('+_0x8c04ee[_0x03c3('0x88')]()+')','countTable');_0x598291[_0x03c3('0x6b')](_0x03c3('0x9e'),_0x03c3('0x1a'));_0x8c04ee[_0x03c3('0x1c')](_0x175e03[_0x03c3('0x1c')]||_0x4f6fab);_0x8c04ee[_0x03c3('0x1b')](_0x175e03[_0x03c3('0x1b')]||0x0);return db['sequelize'][_0x03c3('0x2c')](_0x598291['toString'](),{'type':db['sequelize'][_0x03c3('0x89')][_0x03c3('0x8a')]})[_0x03c3('0x20')](function(_0x3d8e86){if(!_0x3d8e86[_0x03c3('0x42')]){_0x134a6c=0x0;}else{_0x134a6c=_0x3d8e86[0x0][_0x03c3('0x1a')]||0x0;}return db['sequelize'][_0x03c3('0x2c')](_0x8c04ee[_0x03c3('0x88')](),{'type':db[_0x03c3('0x7b')][_0x03c3('0x89')][_0x03c3('0x8a')]});})[_0x03c3('0x20')](function(_0x3d16fe){return{'rows':_0x3d16fe||[],'count':_0x134a6c};});}});}exports[_0x03c3('0x9f')]=function(_0x29da94,_0x29024a){return runReport(_0x29da94[_0x03c3('0x41')],_0x29da94[_0x03c3('0x2c')],_0x29da94[_0x03c3('0x3a')])[_0x03c3('0x20')](respondWithResult(_0x29024a,null))[_0x03c3('0x3f')](handleError(_0x29024a,null));};exports[_0x03c3('0xa0')]=runReport;exports[_0x03c3('0x2c')]=function(_0x4d15e1,_0x74656){var _0x5e81b9=0xa;var _0x555f9a=[_0x03c3('0x50'),_0x03c3('0x51'),_0x03c3('0x52'),_0x03c3('0x53')];var _0x47ee70={'SUM':_0x03c3('0x7c'),'COUNT':_0x03c3('0x54'),'COUNT DISTINCT':_0x03c3('0x55'),'MAX':_0x03c3('0x56'),'MIN':_0x03c3('0x57'),'AVG':_0x03c3('0x58'),'GROUP_CONCAT':_0x03c3('0x7d'),'GROUP_CONCAT ASC':_0x03c3('0x59'),'GROUP_CONCAT DESC':_0x03c3('0x5a')};var _0x15ed2c={'SEC_TO_TIME':_0x03c3('0x5b'),'DATE':_0x03c3('0x5c'),'HOUR':_0x03c3('0x7e'),'ROUND':_0x03c3('0x5d'),'UNIX_TIMESTAMP':_0x03c3('0x7f')};var _0x22fb99=function(_0x2f7195){return!_[_0x03c3('0x74')]([_0x03c3('0x5e'),'IS\x20NOT\x20NULL',_0x03c3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x2f7195);};var _0x371403=function(_0x41cdb4){if(!_0x41cdb4||!_0x41cdb4[_0x03c3('0x60')][_0x03c3('0x42')]){return'';}for(var _0x4652df='(',_0x300d33=0x0;_0x300d33<_0x41cdb4['rules'][_0x03c3('0x42')];_0x300d33+=0x1){_0x300d33>0x0&&(_0x4652df+='\x20'+_0x41cdb4[_0x03c3('0x82')]+'\x20');_0x4652df+=_0x41cdb4['rules'][_0x300d33][_0x03c3('0x61')]?_0x371403(_0x41cdb4[_0x03c3('0x60')][_0x300d33][_0x03c3('0x61')]):_0x41cdb4[_0x03c3('0x60')][_0x300d33][_0x03c3('0x6b')]+'\x20'+_0x41cdb4[_0x03c3('0x60')][_0x300d33][_0x03c3('0x62')]+(_0x22fb99(_0x41cdb4[_0x03c3('0x60')][_0x300d33][_0x03c3('0x62')])?'\x20'+_0x41cdb4[_0x03c3('0x60')][_0x300d33][_0x03c3('0xa1')]:'');}return _0x4652df+')';};var _0x5aca69={'where':{'id':_0x4d15e1[_0x03c3('0x41')]['id']}},_0x1b39a7,_0xc1f046,_0x5d0d46,_0xf20d90,_0x14575d;_0x5aca69=_[_0x03c3('0x36')]({},_0x5aca69,_0x4d15e1[_0x03c3('0x3a')]);return db[_0x03c3('0x28')][_0x03c3('0x43')](_0x5aca69)[_0x03c3('0x20')](function(_0x40287d){if(_0x40287d){_0x1b39a7=_0x40287d;return _0x40287d[_0x03c3('0x63')]();}return null;})[_0x03c3('0x20')](function(_0x38f5c2){if(_0x38f5c2){if(!_0x38f5c2[_0x03c3('0x42')]){throw new db['Sequelize'][(_0x03c3('0x65'))](_0x03c3('0x66'),0x193);}_0xc1f046=_0x38f5c2;return db[_0x03c3('0x67')][_0x03c3('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x3c29e3){if(_0x3c29e3){_0x5d0d46=_[_0x03c3('0x68')](_0x3c29e3,'id');var _0x4f86d2;var _0x11dc32=squel[_0x03c3('0x69')]();_0x11dc32[_0x03c3('0x83')](_0x1b39a7['table']);for(var _0x313e50=0x0;_0x313e50<_0xc1f046[_0x03c3('0x42')];_0x313e50+=0x1){_0x4f86d2=_0xc1f046[_0x313e50][_0x03c3('0x6a')]?_0x5d0d46[_0xc1f046[_0x313e50][_0x03c3('0x6a')]][_0x03c3('0xa2')]:_0xc1f046[_0x313e50][_0x03c3('0x6b')];_0x4f86d2=_0xc1f046[_0x313e50][_0x03c3('0x84')]?_[_0x03c3('0x6c')](_0x47ee70[_0xc1f046[_0x313e50]['function']],'%s',_0x4f86d2):_0x4f86d2;_0x4f86d2=_0xc1f046[_0x313e50]['format']?_[_0x03c3('0x6c')](_0x15ed2c[_0xc1f046[_0x313e50][_0x03c3('0x6d')]],'%s',_0x4f86d2):_0x4f86d2;if(_0xc1f046[_0x313e50][_0x03c3('0x6e')]){_0x11dc32[_0x03c3('0x61')](_0x4f86d2);}_0xc1f046[_0x313e50][_0x03c3('0x6f')]&&_0x11dc32[_0x03c3('0x70')](_0x4f86d2,_0xc1f046[_0x313e50][_0x03c3('0x6f')]===_0x03c3('0x85')?![]:!![]);_0x11dc32[_0x03c3('0x6b')](_0x4f86d2,_0xc1f046[_0x313e50]['alias']||_0x4f86d2);}if(_0x1b39a7[_0x03c3('0x72')]){_0x1b39a7[_0x03c3('0x72')]=JSON[_0x03c3('0x73')](_0x1b39a7[_0x03c3('0x72')]);for(var _0x2594e3=0x0;_0x2594e3<_0x1b39a7[_0x03c3('0x72')][_0x03c3('0x42')];_0x2594e3+=0x1){if(_0x1b39a7[_0x03c3('0x72')][_0x2594e3]['type']&&_[_0x03c3('0x74')](_0x555f9a,_0x1b39a7['joins'][_0x2594e3]['type'])&&_0x1b39a7[_0x03c3('0x72')][_0x2594e3][_0x03c3('0x75')]&&_0x1b39a7[_0x03c3('0x72')][_0x2594e3][_0x03c3('0x76')]&&_0x1b39a7[_0x03c3('0x72')][_0x2594e3][_0x03c3('0x78')]){_0x11dc32[_0x1b39a7[_0x03c3('0x72')][_0x2594e3][_0x03c3('0x37')]](_0x1b39a7['joins'][_0x2594e3][_0x03c3('0x76')],null,util['format'](_0x03c3('0x77'),_0x1b39a7[_0x03c3('0x86')],_0x1b39a7[_0x03c3('0x72')][_0x2594e3][_0x03c3('0x75')],_0x1b39a7[_0x03c3('0x72')][_0x2594e3][_0x03c3('0x76')],_0x1b39a7['joins'][_0x2594e3][_0x03c3('0x78')]));}}}if(_0x1b39a7[_0x03c3('0x79')]){_0x1b39a7[_0x03c3('0x79')]=JSON['parse'](_0x1b39a7['conditions']);_0x11dc32[_0x03c3('0x33')](_0x371403(_0x1b39a7['conditions'][_0x03c3('0x61')]));}_0x14575d=_0x11dc32[_0x03c3('0x87')]();_0x11dc32[_0x03c3('0x1c')](_0x5e81b9);_0x11dc32['offset'](0x0);logger[_0x03c3('0x7a')](_0x03c3('0xa3'),_0x11dc32[_0x03c3('0x88')]());return db['sequelize'][_0x03c3('0x2c')](_0x11dc32[_0x03c3('0x88')](),{'type':db[_0x03c3('0x7b')]['QueryTypes'][_0x03c3('0x8a')]});}})[_0x03c3('0x20')](function(){return{'sql':_0x14575d[_0x03c3('0x88')]()};})['then'](respondWithResult(_0x74656,null))['catch'](handleError(_0x74656,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 5896a91..0365404 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 _0xe24d=['api','moment','bluebird','request-promise','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','util'];(function(_0x5b4daa,_0xc385e4){var _0x9b569c=function(_0x76fdb6){while(--_0x76fdb6){_0x5b4daa['push'](_0x5b4daa['shift']());}};_0x9b569c(++_0xc385e4);}(_0xe24d,0x1ca));var _0xde24=function(_0xaa8a1b,_0x444ae6){_0xaa8a1b=_0xaa8a1b-0x0;var _0x412372=_0xe24d[_0xaa8a1b];return _0x412372;};'use strict';var _=require('lodash');var util=require(_0xde24('0x0'));var logger=require('../../config/logger')(_0xde24('0x1'));var moment=require(_0xde24('0x2'));var BPromise=require(_0xde24('0x3'));var rp=require(_0xde24('0x4'));var attributes=require(_0xde24('0x5'));module['exports']=function(_0x1644c1,_0x122ec8){return _0x1644c1[_0xde24('0x6')](_0xde24('0x7'),attributes,{'tableName':_0xde24('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88d4=['exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./analyticDefaultReport.attributes'];(function(_0x5e8331,_0xb09b84){var _0x1a8486=function(_0x549ed2){while(--_0x549ed2){_0x5e8331['push'](_0x5e8331['shift']());}};_0x1a8486(++_0xb09b84);}(_0x88d4,0x137));var _0x488d=function(_0x1d6a38,_0x3c96a4){_0x1d6a38=_0x1d6a38-0x0;var _0x16534b=_0x88d4[_0x1d6a38];return _0x16534b;};'use strict';var _=require(_0x488d('0x0'));var util=require(_0x488d('0x1'));var logger=require(_0x488d('0x2'))(_0x488d('0x3'));var moment=require(_0x488d('0x4'));var BPromise=require(_0x488d('0x5'));var rp=require(_0x488d('0x6'));var attributes=require(_0x488d('0x7'));module[_0x488d('0x8')]=function(_0x1c4c63,_0x2756c9){return _0x1c4c63[_0x488d('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0x488d('0xa'),'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 8d00ca2..8152a49 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 _0x70e0=['code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x194521,_0x5220c7){var _0x3eb306=function(_0x33c162){while(--_0x33c162){_0x194521['push'](_0x194521['shift']());}};_0x3eb306(++_0x5220c7);}(_0x70e0,0x17b));var _0x070e=function(_0x8b5d8d,_0x499d15){_0x8b5d8d=_0x8b5d8d-0x0;var _0x36a699=_0x70e0[_0x8b5d8d];return _0x36a699;};'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')]('AnalyticDefaultReport,\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')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('AnalyticDefaultReport,\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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1efb29,_0x1e3a0a){var _0x3f8dbd=function(_0x8a78ee){while(--_0x8a78ee){_0x1efb29['push'](_0x1efb29['shift']());}};_0x3f8dbd(++_0x1e3a0a);}(_0x34e8,0x12c));var _0x834e=function(_0x59d5f9,_0xc163d3){_0x59d5f9=_0x59d5f9-0x0;var _0x5d0f01=_0x34e8[_0x59d5f9];return _0x5d0f01;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 9c1229b..02fdf1a 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 _0x33f1=['/:id/run','run','/:id/query','query','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/preview','preview'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x33f1,0x1d2));var _0x133f=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0x33f1[_0x297eea];return _0x1c42d2;};'use strict';var multer=require(_0x133f('0x0'));var util=require(_0x133f('0x1'));var path=require('path');var timeout=require(_0x133f('0x2'));var express=require(_0x133f('0x3'));var router=express[_0x133f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x133f('0x5'));var config=require(_0x133f('0x6'));var controller=require(_0x133f('0x7'));router[_0x133f('0x8')]('/',auth['isAuthenticated'](),controller[_0x133f('0x9')]);router['get'](_0x133f('0xa'),auth[_0x133f('0xb')](),controller['show']);router['get'](_0x133f('0xc'),auth[_0x133f('0xb')](),controller[_0x133f('0xd')]);router[_0x133f('0x8')](_0x133f('0xe'),auth['isAuthenticated'](),controller[_0x133f('0xf')]);router[_0x133f('0x8')](_0x133f('0x10'),auth['isAuthenticated'](),controller[_0x133f('0x11')]);router[_0x133f('0x12')]('/',auth[_0x133f('0xb')](),controller['create']);router[_0x133f('0x13')]('/:id',auth[_0x133f('0xb')](),controller[_0x133f('0x14')]);router[_0x133f('0x15')]('/:id',auth[_0x133f('0xb')](),controller[_0x133f('0x16')]);module[_0x133f('0x17')]=router; \ No newline at end of file +var _0x0b0b=['/:id','show','/:id/preview','preview','/:id/run','/:id/query','post','create','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get'];(function(_0x1142ce,_0x3bf009){var _0x3dab45=function(_0x14d22b){while(--_0x14d22b){_0x1142ce['push'](_0x1142ce['shift']());}};_0x3dab45(++_0x3bf009);}(_0x0b0b,0x7f));var _0xb0b0=function(_0x13bea7,_0xbcfb69){_0x13bea7=_0x13bea7-0x0;var _0x2cfcfc=_0x0b0b[_0x13bea7];return _0x2cfcfc;};'use strict';var multer=require('multer');var util=require(_0xb0b0('0x0'));var path=require(_0xb0b0('0x1'));var timeout=require(_0xb0b0('0x2'));var express=require('express');var router=express[_0xb0b0('0x3')]();var auth=require(_0xb0b0('0x4'));var interaction=require(_0xb0b0('0x5'));var config=require(_0xb0b0('0x6'));var controller=require(_0xb0b0('0x7'));router['get']('/',auth[_0xb0b0('0x8')](),controller[_0xb0b0('0x9')]);router[_0xb0b0('0xa')](_0xb0b0('0xb'),auth['isAuthenticated'](),controller[_0xb0b0('0xc')]);router['get'](_0xb0b0('0xd'),auth[_0xb0b0('0x8')](),controller[_0xb0b0('0xe')]);router[_0xb0b0('0xa')](_0xb0b0('0xf'),auth[_0xb0b0('0x8')](),controller['run']);router[_0xb0b0('0xa')](_0xb0b0('0x10'),auth[_0xb0b0('0x8')](),controller['query']);router[_0xb0b0('0x11')]('/',auth[_0xb0b0('0x8')](),controller[_0xb0b0('0x12')]);router[_0xb0b0('0x13')](_0xb0b0('0xb'),auth[_0xb0b0('0x8')](),controller[_0xb0b0('0x14')]);router[_0xb0b0('0x15')](_0xb0b0('0xb'),auth[_0xb0b0('0x8')](),controller[_0xb0b0('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 20a5b4b..e53b083 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 _0x3522=['manual','scheduled','INTEGER','UNSIGNED','exports','STRING','pdf','DATE','ENUM'];(function(_0x2f7f8f,_0x6608af){var _0x20d85e=function(_0x514d1d){while(--_0x514d1d){_0x2f7f8f['push'](_0x2f7f8f['shift']());}};_0x20d85e(++_0x6608af);}(_0x3522,0x1a2));var _0x2352=function(_0x506d2b,_0x51eba7){_0x506d2b=_0x506d2b-0x0;var _0x1198da=_0x3522[_0x506d2b];return _0x1198da;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x2352('0x0')]={'name':{'type':Sequelize[_0x2352('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x2352('0x2'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x2352('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2352('0x3')]},'endDate':{'type':Sequelize[_0x2352('0x3')]},'status':{'type':Sequelize[_0x2352('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x2352('0x4')](_0x2352('0x5'),_0x2352('0x6')),'allowNull':![],'defaultValue':_0x2352('0x5')},'reportId':{'type':Sequelize[_0x2352('0x7')](0xb)[_0x2352('0x8')]},'reportType':{'type':Sequelize[_0x2352('0x1')]}}; \ No newline at end of file +var _0x509d=['DATE','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf'];(function(_0x157a12,_0x3053b1){var _0x32765e=function(_0xd2af62){while(--_0xd2af62){_0x157a12['push'](_0x157a12['shift']());}};_0x32765e(++_0x3053b1);}(_0x509d,0x180));var _0xd509=function(_0x1937c8,_0x5a1f28){_0x1937c8=_0x1937c8-0x0;var _0x48bedf=_0x509d[_0x1937c8];return _0x48bedf;};'use strict';var Sequelize=require(_0xd509('0x0'));var moment=require(_0xd509('0x1'));module[_0xd509('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xd509('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xd509('0x4')]('csv',_0xd509('0x5'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd509('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd509('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xd509('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xd509('0x4')]('manual','scheduled'),'allowNull':![],'defaultValue':_0xd509('0x7')},'reportId':{'type':Sequelize[_0xd509('0x8')](0xb)[_0xd509('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 288d767..a29d731 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 _0xdf08=['nolimit','order','sort','filter','where','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','basename','toLowerCase','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x40d6a6,_0xff9e26){var _0x575ec8=function(_0x303285){while(--_0x303285){_0x40d6a6['push'](_0x40d6a6['shift']());}};_0x575ec8(++_0xff9e26);}(_0xdf08,0x1a9));var _0x8df0=function(_0x23fb3d,_0x3791a9){_0x23fb3d=_0x23fb3d-0x0;var _0x43d2fe=_0xdf08[_0x23fb3d];return _0x43d2fe;};'use strict';var pdf=require(_0x8df0('0x0'));var emlformat=require(_0x8df0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8df0('0x2'));var rp=require('request-promise');var moment=require(_0x8df0('0x3'));var BPromise=require(_0x8df0('0x4'));var Mustache=require(_0x8df0('0x5'));var util=require('util');var path=require(_0x8df0('0x6'));var sox=require(_0x8df0('0x7'));var csv=require(_0x8df0('0x8'));var ejs=require(_0x8df0('0x9'));var fs=require('fs');var _=require(_0x8df0('0xa'));var squel=require(_0x8df0('0xb'));var crypto=require('crypto');var jsforce=require(_0x8df0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8df0('0xd'));var Papa=require(_0x8df0('0xe'));var authService=require(_0x8df0('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x8df0('0x10'));var logger=require(_0x8df0('0x11'))(_0x8df0('0x12'));var utils=require(_0x8df0('0x13'));var config=require(_0x8df0('0x14'));var db=require(_0x8df0('0x15'))['db'];function respondWithStatusCode(_0x38c4cd,_0xb1c5a1){_0xb1c5a1=_0xb1c5a1||0xcc;return function(_0x21ae1b){if(_0x21ae1b){return _0x38c4cd[_0x8df0('0x16')](_0xb1c5a1);}return _0x38c4cd['status'](_0xb1c5a1)[_0x8df0('0x17')]();};}function respondWithResult(_0xe7bf7f,_0x337d0c){_0x337d0c=_0x337d0c||0xc8;return function(_0x545f9e){if(_0x545f9e){return _0xe7bf7f[_0x8df0('0x18')](_0x337d0c)[_0x8df0('0x19')](_0x545f9e);}};}function respondWithFilteredResult(_0x30d2f0,_0x45e09b){return function(_0x3f177f){if(_0x3f177f){var _0x4ad380=_0x3f177f[_0x8df0('0x1a')],_0x534809=_0x45e09b[_0x8df0('0x1b')],_0x126d67=_0x45e09b[_0x8df0('0x1b')]+_0x45e09b[_0x8df0('0x1c')],_0x4bd07d;if(_0x126d67>=_0x4ad380){_0x126d67=_0x4ad380;_0x4bd07d=0xc8;}else{_0x4bd07d=0xce;}_0x30d2f0[_0x8df0('0x18')](_0x4bd07d);return _0x30d2f0[_0x8df0('0x1d')](_0x8df0('0x1e'),_0x534809+'-'+_0x126d67+'/'+_0x4ad380)[_0x8df0('0x19')](_0x3f177f);}return null;};}function patchUpdates(_0x325a01){return function(_0x167370){try{jsonpatch[_0x8df0('0x1f')](_0x167370,_0x325a01,!![]);}catch(_0x37c709){return BPromise[_0x8df0('0x20')](_0x37c709);}return _0x167370[_0x8df0('0x21')]();};}function saveUpdates(_0x1af431,_0x143daa){return function(_0x16cb25){if(_0x16cb25){return _0x16cb25[_0x8df0('0x22')](_0x1af431)[_0x8df0('0x23')](function(_0x4e085d){return _0x4e085d;});}return null;};}function removeEntity(_0x2a0722,_0x53a31e){return function(_0x53d772){if(_0x53d772){return _0x53d772[_0x8df0('0x24')]()[_0x8df0('0x23')](function(){var _0x620ee2=_0x53d772['get']({'plain':!![]});var _0x5b319e=_0x8df0('0x25');return db[_0x8df0('0x26')][_0x8df0('0x24')]({'where':{'type':_0x5b319e,'resourceId':_0x620ee2['id']}})[_0x8df0('0x23')](function(){return _0x53d772;});})[_0x8df0('0x23')](function(){_0x2a0722[_0x8df0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xff7b5d,_0x346749){return function(_0x251741){if(!_0x251741){_0xff7b5d[_0x8df0('0x16')](0x194);}return _0x251741;};}function handleError(_0x224adb,_0x140ce3){_0x140ce3=_0x140ce3||0x1f4;return function(_0x45298d){logger[_0x8df0('0x27')](_0x45298d[_0x8df0('0x28')]);if(_0x45298d[_0x8df0('0x29')]){delete _0x45298d[_0x8df0('0x29')];}_0x224adb[_0x8df0('0x18')](_0x140ce3)[_0x8df0('0x2a')](_0x45298d);};}exports[_0x8df0('0x2b')]=function(_0x35dd2f,_0x314984){var _0x39f832={},_0x49942e={},_0x4b5106={'count':0x0,'rows':[]};var _0x103a3f=db[_0x8df0('0x2c')][_0x8df0('0x2d')];_0x49942e[_0x8df0('0x2e')]=_[_0x8df0('0x2f')](_0x103a3f);_0x49942e[_0x8df0('0x30')]=_[_0x8df0('0x2f')](_0x35dd2f[_0x8df0('0x30')]);_0x49942e[_0x8df0('0x31')]=_['intersection'](_0x49942e[_0x8df0('0x2e')],_0x49942e[_0x8df0('0x30')]);_0x39f832[_0x8df0('0x32')]=_[_0x8df0('0x33')](_0x49942e['model'],qs[_0x8df0('0x34')](_0x35dd2f[_0x8df0('0x30')]['fields']));_0x39f832[_0x8df0('0x32')]=_0x39f832[_0x8df0('0x32')][_0x8df0('0x35')]?_0x39f832[_0x8df0('0x32')]:_0x49942e[_0x8df0('0x2e')];if(!_0x35dd2f[_0x8df0('0x30')][_0x8df0('0x36')](_0x8df0('0x37'))){_0x39f832[_0x8df0('0x1c')]=qs[_0x8df0('0x1c')](_0x35dd2f[_0x8df0('0x30')][_0x8df0('0x1c')]);_0x39f832[_0x8df0('0x1b')]=qs[_0x8df0('0x1b')](_0x35dd2f[_0x8df0('0x30')][_0x8df0('0x1b')]);}_0x39f832[_0x8df0('0x38')]=qs[_0x8df0('0x39')](_0x35dd2f['query'][_0x8df0('0x39')]);_0x39f832['where']=qs[_0x8df0('0x31')](_['pick'](_0x35dd2f['query'],_0x49942e[_0x8df0('0x31')]));if(_0x35dd2f['query'][_0x8df0('0x3a')]){_0x39f832[_0x8df0('0x3b')]=_[_0x8df0('0x3c')](_0x39f832[_0x8df0('0x3b')],{'$or':_[_0x8df0('0x3d')](_0x103a3f,function(_0x509e5d){if(_0x509e5d['type'][_0x8df0('0x3e')]!==_0x8df0('0x3f')){var _0x31a529={};_0x31a529[_0x509e5d[_0x8df0('0x40')]]={'$like':'%'+_0x35dd2f['query']['filter']+'%'};return _0x31a529;}})});}_0x39f832=_['merge']({},_0x39f832,_0x35dd2f[_0x8df0('0x41')]);var _0x2a8e05={'where':_0x39f832[_0x8df0('0x3b')]};return db[_0x8df0('0x2c')][_0x8df0('0x1a')](_0x2a8e05)[_0x8df0('0x23')](function(_0x29b0c1){_0x4b5106[_0x8df0('0x1a')]=_0x29b0c1;if(_0x35dd2f[_0x8df0('0x30')][_0x8df0('0x42')]){_0x39f832[_0x8df0('0x43')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x8df0('0x44')](_0x39f832);})[_0x8df0('0x23')](function(_0x588c1e){_0x4b5106[_0x8df0('0x45')]=_0x588c1e;return _0x4b5106;})[_0x8df0('0x23')](respondWithFilteredResult(_0x314984,_0x39f832))['catch'](handleError(_0x314984,null));};exports['show']=function(_0x3aa608,_0x208bb4){var _0x3342d3={'raw':!![],'where':{'id':_0x3aa608[_0x8df0('0x46')]['id']}},_0x3ec629={};_0x3ec629[_0x8df0('0x2e')]=_[_0x8df0('0x2f')](db[_0x8df0('0x2c')][_0x8df0('0x2d')]);_0x3ec629['query']=_[_0x8df0('0x2f')](_0x3aa608['query']);_0x3ec629[_0x8df0('0x31')]=_['intersection'](_0x3ec629[_0x8df0('0x2e')],_0x3ec629[_0x8df0('0x30')]);_0x3342d3[_0x8df0('0x32')]=_[_0x8df0('0x33')](_0x3ec629['model'],qs[_0x8df0('0x34')](_0x3aa608[_0x8df0('0x30')]['fields']));_0x3342d3[_0x8df0('0x32')]=_0x3342d3[_0x8df0('0x32')]['length']?_0x3342d3[_0x8df0('0x32')]:_0x3ec629[_0x8df0('0x2e')];if(_0x3aa608['query'][_0x8df0('0x42')]){_0x3342d3[_0x8df0('0x43')]=[{'all':!![]}];}_0x3342d3=_['merge']({},_0x3342d3,_0x3aa608[_0x8df0('0x41')]);return db[_0x8df0('0x2c')][_0x8df0('0x47')](_0x3342d3)[_0x8df0('0x23')](handleEntityNotFound(_0x208bb4,null))[_0x8df0('0x23')](respondWithResult(_0x208bb4,null))[_0x8df0('0x48')](handleError(_0x208bb4,null));};exports['create']=function(_0x44733f,_0x40cbfc){return db[_0x8df0('0x2c')][_0x8df0('0x49')](_0x44733f[_0x8df0('0x4a')],{})[_0x8df0('0x23')](function(_0x3caf80){var _0x486d35=_0x44733f[_0x8df0('0x4b')][_0x8df0('0x4c')]({'plain':!![]});if(!_0x486d35)throw new Error(_0x8df0('0x4d'));if(_0x486d35[_0x8df0('0x4e')]===_0x8df0('0x4b')){var _0x449dea=_0x3caf80['get']({'plain':!![]});var _0x32275d=_0x8df0('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x32275d,'userProfileId':_0x486d35[_0x8df0('0x4f')]},'raw':!![]})[_0x8df0('0x23')](function(_0x148c52){if(_0x148c52&&_0x148c52[_0x8df0('0x50')]===0x0){return db[_0x8df0('0x26')][_0x8df0('0x49')]({'name':_0x449dea[_0x8df0('0x29')],'resourceId':_0x449dea['id'],'type':_0x148c52[_0x8df0('0x29')],'sectionId':_0x148c52['id']},{})[_0x8df0('0x23')](function(){return _0x3caf80;});}else{return _0x3caf80;}})['catch'](function(_0x21da8c){logger[_0x8df0('0x27')](_0x8df0('0x51'),_0x21da8c);throw _0x21da8c;});}return _0x3caf80;})[_0x8df0('0x23')](respondWithResult(_0x40cbfc,0xc9))['catch'](handleError(_0x40cbfc,null));};exports[_0x8df0('0x22')]=function(_0x25ddfb,_0x42a5f4){if(_0x25ddfb[_0x8df0('0x4a')]['id']){delete _0x25ddfb[_0x8df0('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0x8df0('0x47')]({'where':{'id':_0x25ddfb[_0x8df0('0x46')]['id']}})[_0x8df0('0x23')](handleEntityNotFound(_0x42a5f4,null))[_0x8df0('0x23')](saveUpdates(_0x25ddfb[_0x8df0('0x4a')],null))['then'](respondWithResult(_0x42a5f4,null))[_0x8df0('0x48')](handleError(_0x42a5f4,null));};exports[_0x8df0('0x24')]=function(_0x2b2459,_0x5ab871){return db[_0x8df0('0x2c')][_0x8df0('0x47')]({'where':{'id':_0x2b2459[_0x8df0('0x46')]['id']}})[_0x8df0('0x23')](handleEntityNotFound(_0x5ab871,null))[_0x8df0('0x23')](removeEntity(_0x5ab871,null))[_0x8df0('0x48')](handleError(_0x5ab871,null));};exports[_0x8df0('0x52')]=function(_0x23a0c6,_0x48769a,_0x14e014){return db['AnalyticExtractedReport'][_0x8df0('0x47')]({'where':{'id':_0x23a0c6[_0x8df0('0x46')]['id']},'attributes':[_0x8df0('0x29'),'basename',_0x8df0('0x53'),_0x8df0('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x48769a,null))['then'](function(_0x4ef496){if(_0x4ef496){if(!fs[_0x8df0('0x55')](path['join'](config[_0x8df0('0x56')],'server/files/reports',_0x4ef496['savename']))){throw new db[(_0x8df0('0x57'))][(_0x8df0('0x58'))](_0x8df0('0x59'));}if(_0x23a0c6[_0x8df0('0x30')][_0x8df0('0x5a')]){return _0x48769a['sendStatus'](0xc8);}return _0x48769a[_0x8df0('0x52')](path['join'](config[_0x8df0('0x56')],_0x8df0('0x5b'),_0x4ef496['savename']),util[_0x8df0('0x5c')](_0x8df0('0x5d'),_0x4ef496[_0x8df0('0x5e')]||_0x4ef496[_0x8df0('0x29')],_0x4ef496['output'][_0x8df0('0x5f')]()));}})['catch'](handleError(_0x48769a,null));}; \ No newline at end of file +var _0x8596=['then','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','AnalyticExtractedReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','update','body','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','format','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save'];(function(_0x2f015a,_0x86d765){var _0x5a6669=function(_0x105ab1){while(--_0x105ab1){_0x2f015a['push'](_0x2f015a['shift']());}};_0x5a6669(++_0x86d765);}(_0x8596,0x95));var _0x6859=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8596[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0x6859('0x0'));var emlformat=require(_0x6859('0x1'));var rimraf=require(_0x6859('0x2'));var zipdir=require(_0x6859('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6859('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6859('0x5'));var util=require(_0x6859('0x6'));var path=require(_0x6859('0x7'));var sox=require(_0x6859('0x8'));var csv=require(_0x6859('0x9'));var ejs=require(_0x6859('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6859('0xb'));var crypto=require(_0x6859('0xc'));var jsforce=require(_0x6859('0xd'));var deskjs=require(_0x6859('0xe'));var toCsv=require(_0x6859('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x6859('0xf'));var hardwareService=require(_0x6859('0x10'));var Redis=require(_0x6859('0x11'));var qs=require(_0x6859('0x12'));var logger=require(_0x6859('0x13'))('api');var utils=require(_0x6859('0x14'));var config=require(_0x6859('0x15'));var db=require(_0x6859('0x16'))['db'];function respondWithStatusCode(_0x36ff27,_0x2f51cd){_0x2f51cd=_0x2f51cd||0xcc;return function(_0xcd1ba9){if(_0xcd1ba9){return _0x36ff27[_0x6859('0x17')](_0x2f51cd);}return _0x36ff27['status'](_0x2f51cd)[_0x6859('0x18')]();};}function respondWithResult(_0x416528,_0x292964){_0x292964=_0x292964||0xc8;return function(_0x747124){if(_0x747124){return _0x416528[_0x6859('0x19')](_0x292964)[_0x6859('0x1a')](_0x747124);}};}function respondWithFilteredResult(_0x22fb4b,_0x53ff3d){return function(_0x20ebe0){if(_0x20ebe0){var _0x3bbe12=_0x20ebe0[_0x6859('0x1b')],_0x136d05=_0x53ff3d[_0x6859('0x1c')],_0x48006e=_0x53ff3d[_0x6859('0x1c')]+_0x53ff3d['limit'],_0x27b51c;if(_0x48006e>=_0x3bbe12){_0x48006e=_0x3bbe12;_0x27b51c=0xc8;}else{_0x27b51c=0xce;}_0x22fb4b[_0x6859('0x19')](_0x27b51c);return _0x22fb4b['set'](_0x6859('0x1d'),_0x136d05+'-'+_0x48006e+'/'+_0x3bbe12)['json'](_0x20ebe0);}return null;};}function patchUpdates(_0x2ea66e){return function(_0x376b7e){try{jsonpatch[_0x6859('0x1e')](_0x376b7e,_0x2ea66e,!![]);}catch(_0x147a56){return BPromise[_0x6859('0x1f')](_0x147a56);}return _0x376b7e[_0x6859('0x20')]();};}function saveUpdates(_0xb76fd4,_0x4a0d35){return function(_0x49eab9){if(_0x49eab9){return _0x49eab9['update'](_0xb76fd4)[_0x6859('0x21')](function(_0x3a4b43){return _0x3a4b43;});}return null;};}function removeEntity(_0x20e54b,_0x43e1f8){return function(_0x42ed82){if(_0x42ed82){return _0x42ed82['destroy']()[_0x6859('0x21')](function(){var _0x4f20c0=_0x42ed82['get']({'plain':!![]});var _0x1140f9=_0x6859('0x22');return db[_0x6859('0x23')][_0x6859('0x24')]({'where':{'type':_0x1140f9,'resourceId':_0x4f20c0['id']}})[_0x6859('0x21')](function(){return _0x42ed82;});})['then'](function(){_0x20e54b[_0x6859('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x330e1a,_0x13df4f){return function(_0x38728c){if(!_0x38728c){_0x330e1a[_0x6859('0x17')](0x194);}return _0x38728c;};}function handleError(_0x57f246,_0x18fb7b){_0x18fb7b=_0x18fb7b||0x1f4;return function(_0x3ce7c1){logger['error'](_0x3ce7c1[_0x6859('0x25')]);if(_0x3ce7c1[_0x6859('0x26')]){delete _0x3ce7c1[_0x6859('0x26')];}_0x57f246[_0x6859('0x19')](_0x18fb7b)[_0x6859('0x27')](_0x3ce7c1);};}exports[_0x6859('0x28')]=function(_0x15f3ff,_0x2142d5){var _0x1070f7={},_0x116919={},_0x278fe2={'count':0x0,'rows':[]};var _0x3a0cde=db[_0x6859('0x29')][_0x6859('0x2a')];_0x116919[_0x6859('0x2b')]=_[_0x6859('0x2c')](_0x3a0cde);_0x116919[_0x6859('0x2d')]=_[_0x6859('0x2c')](_0x15f3ff['query']);_0x116919[_0x6859('0x2e')]=_[_0x6859('0x2f')](_0x116919[_0x6859('0x2b')],_0x116919[_0x6859('0x2d')]);_0x1070f7[_0x6859('0x30')]=_[_0x6859('0x2f')](_0x116919[_0x6859('0x2b')],qs[_0x6859('0x31')](_0x15f3ff['query'][_0x6859('0x31')]));_0x1070f7[_0x6859('0x30')]=_0x1070f7[_0x6859('0x30')]['length']?_0x1070f7[_0x6859('0x30')]:_0x116919['model'];if(!_0x15f3ff[_0x6859('0x2d')]['hasOwnProperty'](_0x6859('0x32'))){_0x1070f7[_0x6859('0x33')]=qs[_0x6859('0x33')](_0x15f3ff[_0x6859('0x2d')][_0x6859('0x33')]);_0x1070f7['offset']=qs[_0x6859('0x1c')](_0x15f3ff['query'][_0x6859('0x1c')]);}_0x1070f7[_0x6859('0x34')]=qs['sort'](_0x15f3ff[_0x6859('0x2d')][_0x6859('0x35')]);_0x1070f7['where']=qs[_0x6859('0x2e')](_[_0x6859('0x36')](_0x15f3ff[_0x6859('0x2d')],_0x116919['filters']));if(_0x15f3ff[_0x6859('0x2d')][_0x6859('0x37')]){_0x1070f7[_0x6859('0x38')]=_[_0x6859('0x39')](_0x1070f7['where'],{'$or':_[_0x6859('0x3a')](_0x3a0cde,function(_0xc6c727){if(_0xc6c727['type'][_0x6859('0x3b')]!==_0x6859('0x3c')){var _0x596ab5={};_0x596ab5[_0xc6c727[_0x6859('0x3d')]]={'$like':'%'+_0x15f3ff['query'][_0x6859('0x37')]+'%'};return _0x596ab5;}})});}_0x1070f7=_['merge']({},_0x1070f7,_0x15f3ff[_0x6859('0x3e')]);var _0x34ff38={'where':_0x1070f7[_0x6859('0x38')]};return db[_0x6859('0x29')][_0x6859('0x1b')](_0x34ff38)[_0x6859('0x21')](function(_0x297f0d){_0x278fe2[_0x6859('0x1b')]=_0x297f0d;if(_0x15f3ff[_0x6859('0x2d')][_0x6859('0x3f')]){_0x1070f7[_0x6859('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x6859('0x41')](_0x1070f7);})['then'](function(_0x1363dd){_0x278fe2['rows']=_0x1363dd;return _0x278fe2;})[_0x6859('0x21')](respondWithFilteredResult(_0x2142d5,_0x1070f7))['catch'](handleError(_0x2142d5,null));};exports[_0x6859('0x42')]=function(_0x1a1ad9,_0x1cdfda){var _0x35e852={'raw':!![],'where':{'id':_0x1a1ad9[_0x6859('0x43')]['id']}},_0x1c44ae={};_0x1c44ae[_0x6859('0x2b')]=_[_0x6859('0x2c')](db[_0x6859('0x29')][_0x6859('0x2a')]);_0x1c44ae[_0x6859('0x2d')]=_[_0x6859('0x2c')](_0x1a1ad9['query']);_0x1c44ae[_0x6859('0x2e')]=_[_0x6859('0x2f')](_0x1c44ae[_0x6859('0x2b')],_0x1c44ae['query']);_0x35e852['attributes']=_[_0x6859('0x2f')](_0x1c44ae['model'],qs[_0x6859('0x31')](_0x1a1ad9['query'][_0x6859('0x31')]));_0x35e852['attributes']=_0x35e852[_0x6859('0x30')]['length']?_0x35e852[_0x6859('0x30')]:_0x1c44ae[_0x6859('0x2b')];if(_0x1a1ad9[_0x6859('0x2d')]['includeAll']){_0x35e852[_0x6859('0x40')]=[{'all':!![]}];}_0x35e852=_['merge']({},_0x35e852,_0x1a1ad9[_0x6859('0x3e')]);return db[_0x6859('0x29')][_0x6859('0x44')](_0x35e852)[_0x6859('0x21')](handleEntityNotFound(_0x1cdfda,null))[_0x6859('0x21')](respondWithResult(_0x1cdfda,null))[_0x6859('0x45')](handleError(_0x1cdfda,null));};exports[_0x6859('0x46')]=function(_0x38032e,_0x142cd5){return db[_0x6859('0x29')][_0x6859('0x46')](_0x38032e['body'],{})['then'](function(_0x45f8bc){var _0xb9aa83=_0x38032e[_0x6859('0x47')][_0x6859('0x48')]({'plain':!![]});if(!_0xb9aa83)throw new Error(_0x6859('0x49'));if(_0xb9aa83['role']===_0x6859('0x47')){var _0x36b39d=_0x45f8bc[_0x6859('0x48')]({'plain':!![]});var _0x40fe51=_0x6859('0x22');return db[_0x6859('0x4a')][_0x6859('0x44')]({'where':{'name':_0x40fe51,'userProfileId':_0xb9aa83[_0x6859('0x4b')]},'raw':!![]})[_0x6859('0x21')](function(_0x13bc87){if(_0x13bc87&&_0x13bc87[_0x6859('0x4c')]===0x0){return db[_0x6859('0x23')]['create']({'name':_0x36b39d[_0x6859('0x26')],'resourceId':_0x36b39d['id'],'type':_0x13bc87[_0x6859('0x26')],'sectionId':_0x13bc87['id']},{})['then'](function(){return _0x45f8bc;});}else{return _0x45f8bc;}})[_0x6859('0x45')](function(_0x4a776b){logger[_0x6859('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a776b);throw _0x4a776b;});}return _0x45f8bc;})[_0x6859('0x21')](respondWithResult(_0x142cd5,0xc9))[_0x6859('0x45')](handleError(_0x142cd5,null));};exports[_0x6859('0x4e')]=function(_0x16ec32,_0x5b4b58){if(_0x16ec32['body']['id']){delete _0x16ec32[_0x6859('0x4f')]['id'];}return db[_0x6859('0x29')]['find']({'where':{'id':_0x16ec32['params']['id']}})['then'](handleEntityNotFound(_0x5b4b58,null))[_0x6859('0x21')](saveUpdates(_0x16ec32[_0x6859('0x4f')],null))[_0x6859('0x21')](respondWithResult(_0x5b4b58,null))['catch'](handleError(_0x5b4b58,null));};exports[_0x6859('0x24')]=function(_0x46ebb7,_0x582cad){return db[_0x6859('0x29')][_0x6859('0x44')]({'where':{'id':_0x46ebb7['params']['id']}})[_0x6859('0x21')](handleEntityNotFound(_0x582cad,null))[_0x6859('0x21')](removeEntity(_0x582cad,null))['catch'](handleError(_0x582cad,null));};exports[_0x6859('0x50')]=function(_0xc0ab24,_0x2a5a07,_0xffada5){return db[_0x6859('0x29')][_0x6859('0x44')]({'where':{'id':_0xc0ab24[_0x6859('0x43')]['id']},'attributes':[_0x6859('0x26'),_0x6859('0x51'),'savename',_0x6859('0x52')],'raw':!![]})[_0x6859('0x21')](handleEntityNotFound(_0x2a5a07,null))[_0x6859('0x21')](function(_0x2b704f){if(_0x2b704f){if(!fs[_0x6859('0x53')](path[_0x6859('0x54')](config[_0x6859('0x55')],_0x6859('0x56'),_0x2b704f[_0x6859('0x57')]))){throw new db[(_0x6859('0x58'))]['ValidationError'](_0x6859('0x59'));}if(_0xc0ab24[_0x6859('0x2d')]['exists']){return _0x2a5a07[_0x6859('0x17')](0xc8);}return _0x2a5a07[_0x6859('0x50')](path[_0x6859('0x54')](config[_0x6859('0x55')],_0x6859('0x56'),_0x2b704f[_0x6859('0x57')]),util[_0x6859('0x5a')]('%s.%s',_0x2b704f[_0x6859('0x51')]||_0x2b704f[_0x6859('0x26')],_0x2b704f[_0x6859('0x52')]['toLowerCase']()));}})[_0x6859('0x45')](handleError(_0x2a5a07,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index a507a6d..7406c52 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 _0x7d8e=['exports','AnalyticExtractedReport','util','api','bluebird','request-promise','./analyticExtractedReport.attributes'];(function(_0x2fb0ab,_0x1c0893){var _0x2fcff7=function(_0x4372bd){while(--_0x4372bd){_0x2fb0ab['push'](_0x2fb0ab['shift']());}};_0x2fcff7(++_0x1c0893);}(_0x7d8e,0x79));var _0xe7d8=function(_0x558e45,_0x4f5e4f){_0x558e45=_0x558e45-0x0;var _0x3e9075=_0x7d8e[_0x558e45];return _0x3e9075;};'use strict';var _=require('lodash');var util=require(_0xe7d8('0x0'));var logger=require('../../config/logger')(_0xe7d8('0x1'));var moment=require('moment');var BPromise=require(_0xe7d8('0x2'));var rp=require(_0xe7d8('0x3'));var attributes=require(_0xe7d8('0x4'));module[_0xe7d8('0x5')]=function(_0x178df7,_0x4cc395){return _0x178df7['define'](_0xe7d8('0x6'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09b0=['define','AnalyticExtractedReport','lodash','../../config/logger','moment','./analyticExtractedReport.attributes','exports'];(function(_0x3c4154,_0x425d67){var _0x2c113b=function(_0x4f6b5a){while(--_0x4f6b5a){_0x3c4154['push'](_0x3c4154['shift']());}};_0x2c113b(++_0x425d67);}(_0x09b0,0x1f3));var _0x009b=function(_0xa8a8e8,_0x34e85d){_0xa8a8e8=_0xa8a8e8-0x0;var _0x21076e=_0x09b0[_0xa8a8e8];return _0x21076e;};'use strict';var _=require(_0x009b('0x0'));var util=require('util');var logger=require(_0x009b('0x1'))('api');var moment=require(_0x009b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x009b('0x3'));module[_0x009b('0x4')]=function(_0x2d3222,_0x5be463){return _0x2d3222[_0x009b('0x5')](_0x009b('0x6'),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 2b0d0f9..9d1f564 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 _0x01cc=['message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x475833,_0x453226){var _0x5287aa=function(_0x1a2ebf){while(--_0x1a2ebf){_0x475833['push'](_0x475833['shift']());}};_0x5287aa(++_0x453226);}(_0x01cc,0x17d));var _0xc01c=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x01cc[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0xc01c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc01c('0x1'));var rs=require(_0xc01c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc01c('0x3'))['db'];var utils=require(_0xc01c('0x4'));var logger=require(_0xc01c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc01c('0x6'));var client=jayson[_0xc01c('0x7')][_0xc01c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x565928,_0x14ce29,_0x4f4ded){return new BPromise(function(_0x7f0cff,_0x1145cd){return client[_0xc01c('0x9')](_0x565928,_0x4f4ded)[_0xc01c('0xa')](function(_0x361267){logger['info'](_0xc01c('0xb'),_0x14ce29,_0xc01c('0xc'));logger[_0xc01c('0xd')](_0xc01c('0xe'),_0x14ce29,_0xc01c('0xc'),JSON[_0xc01c('0xf')](_0x361267));if(_0x361267[_0xc01c('0x10')]){if(_0x361267[_0xc01c('0x10')][_0xc01c('0x11')]===0x1f4){logger[_0xc01c('0x10')](_0xc01c('0xb'),_0x14ce29,_0x361267[_0xc01c('0x10')]['message']);return _0x1145cd(_0x361267[_0xc01c('0x10')][_0xc01c('0x12')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x14ce29,_0x361267['error'][_0xc01c('0x12')]);return _0x7f0cff(_0x361267[_0xc01c('0x10')][_0xc01c('0x12')]);}else{logger['info'](_0xc01c('0xb'),_0x14ce29,'request\x20sent');_0x7f0cff(_0x361267[_0xc01c('0x13')]['message']);}})[_0xc01c('0x14')](function(_0x594db4){logger['error'](_0xc01c('0xb'),_0x14ce29,_0x594db4);_0x1145cd(_0x594db4);});});} \ No newline at end of file +var _0xf603=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','code','error','message','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf603,0x124));var _0x3f60=function(_0x259c61,_0x3225b7){_0x259c61=_0x259c61-0x0;var _0x335391=_0xf603[_0x259c61];return _0x335391;};'use strict';var _=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var moment=require('moment');var BPromise=require(_0x3f60('0x2'));var rs=require(_0x3f60('0x3'));var fs=require('fs');var Redis=require(_0x3f60('0x4'));var db=require(_0x3f60('0x5'))['db'];var utils=require(_0x3f60('0x6'));var logger=require(_0x3f60('0x7'))(_0x3f60('0x8'));var config=require(_0x3f60('0x9'));var jayson=require(_0x3f60('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49a08c,_0x413b11,_0x43ec55){return new BPromise(function(_0x75bb34,_0x297c05){return client[_0x3f60('0xb')](_0x49a08c,_0x43ec55)[_0x3f60('0xc')](function(_0xb49f89){logger[_0x3f60('0xd')](_0x3f60('0xe'),_0x413b11,_0x3f60('0xf'));logger[_0x3f60('0x10')](_0x3f60('0x11'),_0x413b11,_0x3f60('0xf'),JSON['stringify'](_0xb49f89));if(_0xb49f89['error']){if(_0xb49f89['error'][_0x3f60('0x12')]===0x1f4){logger[_0x3f60('0x13')](_0x3f60('0xe'),_0x413b11,_0xb49f89['error'][_0x3f60('0x14')]);return _0x297c05(_0xb49f89[_0x3f60('0x13')]['message']);}logger[_0x3f60('0x13')](_0x3f60('0xe'),_0x413b11,_0xb49f89['error'][_0x3f60('0x14')]);return _0x75bb34(_0xb49f89['error'][_0x3f60('0x14')]);}else{logger[_0x3f60('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x413b11,_0x3f60('0xf'));_0x75bb34(_0xb49f89['result'][_0x3f60('0x14')]);}})['catch'](function(_0x219f16){logger[_0x3f60('0x13')](_0x3f60('0xe'),_0x413b11,_0x219f16);_0x297c05(_0x219f16);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b9cdca8..3366e4b 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 _0x5811=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5d44d9,_0x355fa0){var _0x2c9f7c=function(_0x154607){while(--_0x154607){_0x5d44d9['push'](_0x5d44d9['shift']());}};_0x2c9f7c(++_0x355fa0);}(_0x5811,0x7a));var _0x1581=function(_0x5b3b19,_0xcf3021){_0x5b3b19=_0x5b3b19-0x0;var _0x3d713b=_0x5811[_0x5b3b19];return _0x3d713b;};'use strict';var multer=require(_0x1581('0x0'));var util=require(_0x1581('0x1'));var path=require(_0x1581('0x2'));var timeout=require(_0x1581('0x3'));var express=require('express');var router=express[_0x1581('0x4')]();var auth=require(_0x1581('0x5'));var interaction=require(_0x1581('0x6'));var config=require(_0x1581('0x7'));var controller=require(_0x1581('0x8'));router[_0x1581('0x9')]('/',auth[_0x1581('0xa')](),controller[_0x1581('0xb')]);router[_0x1581('0x9')](_0x1581('0xc'),auth[_0x1581('0xa')](),controller[_0x1581('0xd')]);router['get'](_0x1581('0xe'),auth[_0x1581('0xa')](),controller[_0x1581('0xf')]);router['post']('/',auth[_0x1581('0xa')](),controller[_0x1581('0x10')]);router[_0x1581('0x11')](_0x1581('0xc'),auth[_0x1581('0xa')](),controller[_0x1581('0x12')]);router[_0x1581('0x13')](_0x1581('0xc'),auth[_0x1581('0xa')](),controller[_0x1581('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb742=['exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','create','put','update','delete','destroy'];(function(_0x24f93b,_0x17dae6){var _0x3deac8=function(_0x179605){while(--_0x179605){_0x24f93b['push'](_0x24f93b['shift']());}};_0x3deac8(++_0x17dae6);}(_0xb742,0x17d));var _0x2b74=function(_0x560d66,_0xf86af7){_0x560d66=_0x560d66-0x0;var _0x1a7191=_0xb742[_0x560d66];return _0x1a7191;};'use strict';var multer=require(_0x2b74('0x0'));var util=require('util');var path=require(_0x2b74('0x1'));var timeout=require(_0x2b74('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x2b74('0x3'));var interaction=require(_0x2b74('0x4'));var config=require(_0x2b74('0x5'));var controller=require(_0x2b74('0x6'));router[_0x2b74('0x7')]('/',auth[_0x2b74('0x8')](),controller[_0x2b74('0x9')]);router[_0x2b74('0x7')](_0x2b74('0xa'),auth['isAuthenticated'](),controller[_0x2b74('0xb')]);router[_0x2b74('0x7')]('/:id/download',auth[_0x2b74('0x8')](),controller[_0x2b74('0xc')]);router[_0x2b74('0xd')]('/',auth[_0x2b74('0x8')](),controller[_0x2b74('0xe')]);router[_0x2b74('0xf')](_0x2b74('0xa'),auth['isAuthenticated'](),controller[_0x2b74('0x10')]);router[_0x2b74('0x11')](_0x2b74('0xa'),auth[_0x2b74('0x8')](),controller[_0x2b74('0x12')]);module[_0x2b74('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index ed09808..cd5e230 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 _0x2a7d=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x2a7d,0x118));var _0xd2a7=function(_0x543dcc,_0x52465){_0x543dcc=_0x543dcc-0x0;var _0x40ec43=_0x2a7d[_0x543dcc];return _0x40ec43;};'use strict';var Sequelize=require(_0xd2a7('0x0'));module[_0xd2a7('0x1')]={'field':{'type':Sequelize[_0xd2a7('0x2')]},'alias':{'type':Sequelize[_0xd2a7('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xd2a7('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd2a7('0x3')]},'custom':{'type':Sequelize[_0xd2a7('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x81d4=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x81d4,0x8f));var _0x481d=function(_0x4edf5b,_0x456f7c){_0x4edf5b=_0x4edf5b-0x0;var _0x4e805b=_0x81d4[_0x4edf5b];return _0x4e805b;};'use strict';var Sequelize=require(_0x481d('0x0'));module[_0x481d('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x481d('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x481d('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x481d('0x2')]},'custom':{'type':Sequelize[_0x481d('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index c3adeff..4178fb6 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 _0xa4e8=['mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','api','../../config/environment','../../mysqldb','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','AnalyticFieldReport','rawAttributes','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','merge','type','field','options','findAll','rows','catch','show','params','fields','length','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','CustomReportId','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x21d650,_0x34649d){var _0x5e50a3=function(_0x590642){while(--_0x590642){_0x21d650['push'](_0x21d650['shift']());}};_0x5e50a3(++_0x34649d);}(_0xa4e8,0x1aa));var _0x8a4e=function(_0x19b456,_0x18eb18){_0x19b456=_0x19b456-0x0;var _0x4872bc=_0xa4e8[_0x19b456];return _0x4872bc;};'use strict';var pdf=require(_0x8a4e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8a4e('0x1'));var jsonpatch=require(_0x8a4e('0x2'));var rp=require(_0x8a4e('0x3'));var moment=require(_0x8a4e('0x4'));var BPromise=require(_0x8a4e('0x5'));var Mustache=require(_0x8a4e('0x6'));var util=require('util');var path=require(_0x8a4e('0x7'));var sox=require('sox');var csv=require(_0x8a4e('0x8'));var ejs=require(_0x8a4e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8a4e('0xa'));var crypto=require(_0x8a4e('0xb'));var jsforce=require(_0x8a4e('0xc'));var deskjs=require(_0x8a4e('0xd'));var toCsv=require(_0x8a4e('0x8'));var querystring=require(_0x8a4e('0xe'));var Papa=require(_0x8a4e('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x8a4e('0x10'));var Redis=require(_0x8a4e('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8a4e('0x12'));var utils=require('../../config/utils');var config=require(_0x8a4e('0x13'));var db=require(_0x8a4e('0x14'))['db'];function respondWithStatusCode(_0x1b5ee9,_0x5c3a81){_0x5c3a81=_0x5c3a81||0xcc;return function(_0x2f279c){if(_0x2f279c){return _0x1b5ee9['sendStatus'](_0x5c3a81);}return _0x1b5ee9['status'](_0x5c3a81)[_0x8a4e('0x15')]();};}function respondWithResult(_0x3ea82e,_0x50d43a){_0x50d43a=_0x50d43a||0xc8;return function(_0x1b9d21){if(_0x1b9d21){return _0x3ea82e[_0x8a4e('0x16')](_0x50d43a)['json'](_0x1b9d21);}};}function respondWithFilteredResult(_0x1ec016,_0x7f5e28){return function(_0x37d2b9){if(_0x37d2b9){var _0x52921d=_0x37d2b9[_0x8a4e('0x17')],_0x14eb98=_0x7f5e28[_0x8a4e('0x18')],_0x30dd0c=_0x7f5e28[_0x8a4e('0x18')]+_0x7f5e28[_0x8a4e('0x19')],_0x4390cf;if(_0x30dd0c>=_0x52921d){_0x30dd0c=_0x52921d;_0x4390cf=0xc8;}else{_0x4390cf=0xce;}_0x1ec016[_0x8a4e('0x16')](_0x4390cf);return _0x1ec016[_0x8a4e('0x1a')](_0x8a4e('0x1b'),_0x14eb98+'-'+_0x30dd0c+'/'+_0x52921d)['json'](_0x37d2b9);}return null;};}function patchUpdates(_0x1cb8d2){return function(_0x55dfec){try{jsonpatch[_0x8a4e('0x1c')](_0x55dfec,_0x1cb8d2,!![]);}catch(_0x1ed6eb){return BPromise[_0x8a4e('0x1d')](_0x1ed6eb);}return _0x55dfec[_0x8a4e('0x1e')]();};}function saveUpdates(_0x48e9d8,_0x1ba1c3){return function(_0x1d6149){if(_0x1d6149){return _0x1d6149[_0x8a4e('0x1f')](_0x48e9d8)['then'](function(_0x2fc935){return _0x2fc935;});}return null;};}function removeEntity(_0x2551e5,_0x163432){return function(_0x4e23b2){if(_0x4e23b2){return _0x4e23b2[_0x8a4e('0x20')]()[_0x8a4e('0x21')](function(){_0x2551e5[_0x8a4e('0x16')](0xcc)[_0x8a4e('0x15')]();});}};}function handleEntityNotFound(_0x1956dc,_0x352148){return function(_0x987954){if(!_0x987954){_0x1956dc['sendStatus'](0x194);}return _0x987954;};}function handleError(_0x1fc944,_0x5a70c7){_0x5a70c7=_0x5a70c7||0x1f4;return function(_0x14f7e0){logger[_0x8a4e('0x22')](_0x14f7e0['stack']);if(_0x14f7e0[_0x8a4e('0x23')]){delete _0x14f7e0['name'];}_0x1fc944[_0x8a4e('0x16')](_0x5a70c7)['send'](_0x14f7e0);};}exports[_0x8a4e('0x24')]=function(_0x1d9552,_0x1f9733){var _0xaa8e9f={},_0x1b92b4={},_0x3c0842={'count':0x0,'rows':[]};var _0x2d9c4b=db[_0x8a4e('0x25')][_0x8a4e('0x26')];_0x1b92b4[_0x8a4e('0x27')]=_[_0x8a4e('0x28')](_0x2d9c4b);_0x1b92b4[_0x8a4e('0x29')]=_['keys'](_0x1d9552[_0x8a4e('0x29')]);_0x1b92b4[_0x8a4e('0x2a')]=_[_0x8a4e('0x2b')](_0x1b92b4['model'],_0x1b92b4['query']);_0xaa8e9f['attributes']=_[_0x8a4e('0x2b')](_0x1b92b4[_0x8a4e('0x27')],qs['fields'](_0x1d9552[_0x8a4e('0x29')]['fields']));_0xaa8e9f['attributes']=_0xaa8e9f[_0x8a4e('0x2c')]['length']?_0xaa8e9f[_0x8a4e('0x2c')]:_0x1b92b4[_0x8a4e('0x27')];if(!_0x1d9552[_0x8a4e('0x29')][_0x8a4e('0x2d')](_0x8a4e('0x2e'))){_0xaa8e9f['limit']=qs['limit'](_0x1d9552[_0x8a4e('0x29')][_0x8a4e('0x19')]);_0xaa8e9f[_0x8a4e('0x18')]=qs['offset'](_0x1d9552[_0x8a4e('0x29')][_0x8a4e('0x18')]);}_0xaa8e9f[_0x8a4e('0x2f')]=qs[_0x8a4e('0x30')](_0x1d9552[_0x8a4e('0x29')]['sort']);_0xaa8e9f[_0x8a4e('0x31')]=qs[_0x8a4e('0x2a')](_['pick'](_0x1d9552['query'],_0x1b92b4['filters']));if(_0x1d9552[_0x8a4e('0x29')]['filter']){_0xaa8e9f[_0x8a4e('0x31')]=_[_0x8a4e('0x32')](_0xaa8e9f[_0x8a4e('0x31')],{'$or':_['map'](_0x2d9c4b,function(_0x55c75c){if(_0x55c75c[_0x8a4e('0x33')]['key']!=='VIRTUAL'){var _0x534685={};_0x534685[_0x55c75c[_0x8a4e('0x34')]]={'$like':'%'+_0x1d9552['query']['filter']+'%'};return _0x534685;}})});}_0xaa8e9f=_[_0x8a4e('0x32')]({},_0xaa8e9f,_0x1d9552[_0x8a4e('0x35')]);var _0xd09b18={'where':_0xaa8e9f[_0x8a4e('0x31')]};return db['AnalyticFieldReport'][_0x8a4e('0x17')](_0xd09b18)[_0x8a4e('0x21')](function(_0x340f8c){_0x3c0842['count']=_0x340f8c;if(_0x1d9552[_0x8a4e('0x29')]['includeAll']){_0xaa8e9f['include']=[{'all':!![]}];}return db[_0x8a4e('0x25')][_0x8a4e('0x36')](_0xaa8e9f);})[_0x8a4e('0x21')](function(_0x2dc1c8){_0x3c0842[_0x8a4e('0x37')]=_0x2dc1c8;return _0x3c0842;})['then'](respondWithFilteredResult(_0x1f9733,_0xaa8e9f))[_0x8a4e('0x38')](handleError(_0x1f9733,null));};exports[_0x8a4e('0x39')]=function(_0x5a61be,_0x48a08f){var _0xf845d5={'raw':![],'where':{'id':_0x5a61be[_0x8a4e('0x3a')]['id']}},_0x1f6094={};_0x1f6094[_0x8a4e('0x27')]=_[_0x8a4e('0x28')](db[_0x8a4e('0x25')][_0x8a4e('0x26')]);_0x1f6094[_0x8a4e('0x29')]=_['keys'](_0x5a61be[_0x8a4e('0x29')]);_0x1f6094[_0x8a4e('0x2a')]=_[_0x8a4e('0x2b')](_0x1f6094[_0x8a4e('0x27')],_0x1f6094[_0x8a4e('0x29')]);_0xf845d5['attributes']=_[_0x8a4e('0x2b')](_0x1f6094[_0x8a4e('0x27')],qs[_0x8a4e('0x3b')](_0x5a61be[_0x8a4e('0x29')][_0x8a4e('0x3b')]));_0xf845d5['attributes']=_0xf845d5[_0x8a4e('0x2c')][_0x8a4e('0x3c')]?_0xf845d5['attributes']:_0x1f6094[_0x8a4e('0x27')];if(_0x5a61be['query']['includeAll']){_0xf845d5[_0x8a4e('0x3d')]=[{'all':!![]}];}_0xf845d5=_['merge']({},_0xf845d5,_0x5a61be[_0x8a4e('0x35')]);return db['AnalyticFieldReport'][_0x8a4e('0x3e')](_0xf845d5)[_0x8a4e('0x21')](handleEntityNotFound(_0x48a08f,null))[_0x8a4e('0x21')](respondWithResult(_0x48a08f,null))[_0x8a4e('0x38')](handleError(_0x48a08f,null));};exports[_0x8a4e('0x3f')]=function(_0x5ec51e,_0x44c72c){return db[_0x8a4e('0x25')][_0x8a4e('0x3f')](_0x5ec51e[_0x8a4e('0x40')],{})['then'](respondWithResult(_0x44c72c,0xc9))[_0x8a4e('0x38')](handleError(_0x44c72c,null));};exports['bulkCreate']=function(_0x1e5f40,_0x4507ef){return db[_0x8a4e('0x25')][_0x8a4e('0x41')](_0x1e5f40[_0x8a4e('0x40')],{'raw':![],'individualHooks':!![]})[_0x8a4e('0x21')](respondWithResult(_0x4507ef,0xc9))[_0x8a4e('0x38')](handleError(_0x4507ef,null));};exports['update']=function(_0x111872,_0x3bbbad){if(_0x111872[_0x8a4e('0x40')]['id']){delete _0x111872[_0x8a4e('0x40')]['id'];}return db[_0x8a4e('0x25')][_0x8a4e('0x3e')]({'where':{'id':_0x111872[_0x8a4e('0x3a')]['id']}})[_0x8a4e('0x21')](handleEntityNotFound(_0x3bbbad,null))['then'](saveUpdates(_0x111872['body'],null))[_0x8a4e('0x21')](respondWithResult(_0x3bbbad,null))[_0x8a4e('0x38')](handleError(_0x3bbbad,null));};exports['destroy']=function(_0x429fb4,_0x1083cb){return db[_0x8a4e('0x25')][_0x8a4e('0x3e')]({'where':{'id':_0x429fb4[_0x8a4e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1083cb,null))[_0x8a4e('0x21')](removeEntity(_0x1083cb,null))['catch'](handleError(_0x1083cb,null));};exports[_0x8a4e('0x42')]=function(_0x35e63e,_0x389b6c){return db[_0x8a4e('0x25')][_0x8a4e('0x20')]({'where':{'id':_0x35e63e[_0x8a4e('0x29')][_0x8a4e('0x43')]||[]},'raw':![],'individualHooks':!![]})[_0x8a4e('0x21')](respondWithResult(_0x389b6c,0xcc))['catch'](handleError(_0x389b6c,null));};exports[_0x8a4e('0x44')]=function(_0xd08094,_0x52ea90,_0x394f54){return db['AnalyticCustomReport'][_0x8a4e('0x45')]({'where':{'id':_0xd08094[_0x8a4e('0x3a')]['id']}})[_0x8a4e('0x21')](handleEntityNotFound(_0x52ea90,null))['then'](function(_0x2b3922){if(_0x2b3922){return db[_0x8a4e('0x46')]['transaction'](function(_0x54d6df){return db['AnalyticFieldReport'][_0x8a4e('0x20')]({'where':{'CustomReportId':_0xd08094[_0x8a4e('0x3a')]['id']},'transaction':_0x54d6df})['then'](function(_0x27db21){var _0x3c5842=_['map'](_0xd08094['body'],function(_0x179f64){delete _0x179f64['id'];_0x179f64[_0x8a4e('0x47')]=_0xd08094['params']['id'];return _0x179f64;});return db[_0x8a4e('0x25')][_0x8a4e('0x41')](_0x3c5842,{'transaction':_0x54d6df});});})[_0x8a4e('0x21')](function(){return db[_0x8a4e('0x25')][_0x8a4e('0x36')]({'where':{'CustomReportId':_0xd08094[_0x8a4e('0x3a')]['id']}});});}})[_0x8a4e('0x21')](respondWithResult(_0x52ea90,null))[_0x8a4e('0x38')](handleError(_0x52ea90,null));}; \ No newline at end of file +var _0xc9cf=['api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','map','type','key','VIRTUAL','filter','options','count','includeAll','AnalyticFieldReport','findAll','rows','include','find','catch','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs'];(function(_0x12e073,_0x4d43db){var _0x267748=function(_0x381284){while(--_0x381284){_0x12e073['push'](_0x12e073['shift']());}};_0x267748(++_0x4d43db);}(_0xc9cf,0x1d0));var _0xfc9c=function(_0x14bd60,_0x73b2f9){_0x14bd60=_0x14bd60-0x0;var _0x4b0a31=_0xc9cf[_0x14bd60];return _0x4b0a31;};'use strict';var pdf=require(_0xfc9c('0x0'));var emlformat=require(_0xfc9c('0x1'));var rimraf=require(_0xfc9c('0x2'));var zipdir=require(_0xfc9c('0x3'));var jsonpatch=require(_0xfc9c('0x4'));var rp=require(_0xfc9c('0x5'));var moment=require(_0xfc9c('0x6'));var BPromise=require(_0xfc9c('0x7'));var Mustache=require(_0xfc9c('0x8'));var util=require('util');var path=require(_0xfc9c('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfc9c('0xa'));var fs=require('fs');var _=require(_0xfc9c('0xb'));var squel=require('squel');var crypto=require(_0xfc9c('0xc'));var jsforce=require(_0xfc9c('0xd'));var deskjs=require(_0xfc9c('0xe'));var toCsv=require(_0xfc9c('0xf'));var querystring=require(_0xfc9c('0x10'));var Papa=require(_0xfc9c('0x11'));var authService=require(_0xfc9c('0x12'));var hardwareService=require(_0xfc9c('0x13'));var Redis=require(_0xfc9c('0x14'));var qs=require(_0xfc9c('0x15'));var logger=require('../../config/logger')(_0xfc9c('0x16'));var utils=require(_0xfc9c('0x17'));var config=require('../../config/environment');var db=require(_0xfc9c('0x18'))['db'];function respondWithStatusCode(_0x5871e1,_0x222598){_0x222598=_0x222598||0xcc;return function(_0x59b61){if(_0x59b61){return _0x5871e1[_0xfc9c('0x19')](_0x222598);}return _0x5871e1[_0xfc9c('0x1a')](_0x222598)['end']();};}function respondWithResult(_0x28433a,_0x2eaa39){_0x2eaa39=_0x2eaa39||0xc8;return function(_0x777ef5){if(_0x777ef5){return _0x28433a[_0xfc9c('0x1a')](_0x2eaa39)[_0xfc9c('0x1b')](_0x777ef5);}};}function respondWithFilteredResult(_0x59ec43,_0x4d9057){return function(_0x322e30){if(_0x322e30){var _0x50254b=_0x322e30['count'],_0x572903=_0x4d9057[_0xfc9c('0x1c')],_0x1139f6=_0x4d9057['offset']+_0x4d9057['limit'],_0x1c83b1;if(_0x1139f6>=_0x50254b){_0x1139f6=_0x50254b;_0x1c83b1=0xc8;}else{_0x1c83b1=0xce;}_0x59ec43['status'](_0x1c83b1);return _0x59ec43[_0xfc9c('0x1d')](_0xfc9c('0x1e'),_0x572903+'-'+_0x1139f6+'/'+_0x50254b)[_0xfc9c('0x1b')](_0x322e30);}return null;};}function patchUpdates(_0x49901c){return function(_0xe50b8f){try{jsonpatch[_0xfc9c('0x1f')](_0xe50b8f,_0x49901c,!![]);}catch(_0x3fbcad){return BPromise['reject'](_0x3fbcad);}return _0xe50b8f[_0xfc9c('0x20')]();};}function saveUpdates(_0x3b8cff,_0xc857a){return function(_0x277cd7){if(_0x277cd7){return _0x277cd7[_0xfc9c('0x21')](_0x3b8cff)[_0xfc9c('0x22')](function(_0x414a32){return _0x414a32;});}return null;};}function removeEntity(_0x5099e9,_0x571113){return function(_0x569349){if(_0x569349){return _0x569349[_0xfc9c('0x23')]()[_0xfc9c('0x22')](function(){_0x5099e9[_0xfc9c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x414f01,_0x3b30fe){return function(_0x5df41f){if(!_0x5df41f){_0x414f01[_0xfc9c('0x19')](0x194);}return _0x5df41f;};}function handleError(_0x8c4c39,_0x2eed76){_0x2eed76=_0x2eed76||0x1f4;return function(_0x189f0f){logger[_0xfc9c('0x24')](_0x189f0f[_0xfc9c('0x25')]);if(_0x189f0f['name']){delete _0x189f0f[_0xfc9c('0x26')];}_0x8c4c39['status'](_0x2eed76)[_0xfc9c('0x27')](_0x189f0f);};}exports['index']=function(_0x40afcb,_0xa085f2){var _0x1fdf52={},_0x50fa85={},_0xc52ce0={'count':0x0,'rows':[]};var _0x5b2292=db['AnalyticFieldReport'][_0xfc9c('0x28')];_0x50fa85[_0xfc9c('0x29')]=_['keys'](_0x5b2292);_0x50fa85[_0xfc9c('0x2a')]=_[_0xfc9c('0x2b')](_0x40afcb[_0xfc9c('0x2a')]);_0x50fa85[_0xfc9c('0x2c')]=_[_0xfc9c('0x2d')](_0x50fa85[_0xfc9c('0x29')],_0x50fa85[_0xfc9c('0x2a')]);_0x1fdf52['attributes']=_['intersection'](_0x50fa85['model'],qs[_0xfc9c('0x2e')](_0x40afcb[_0xfc9c('0x2a')][_0xfc9c('0x2e')]));_0x1fdf52['attributes']=_0x1fdf52[_0xfc9c('0x2f')][_0xfc9c('0x30')]?_0x1fdf52[_0xfc9c('0x2f')]:_0x50fa85[_0xfc9c('0x29')];if(!_0x40afcb[_0xfc9c('0x2a')][_0xfc9c('0x31')](_0xfc9c('0x32'))){_0x1fdf52['limit']=qs['limit'](_0x40afcb['query'][_0xfc9c('0x33')]);_0x1fdf52[_0xfc9c('0x1c')]=qs[_0xfc9c('0x1c')](_0x40afcb[_0xfc9c('0x2a')]['offset']);}_0x1fdf52[_0xfc9c('0x34')]=qs[_0xfc9c('0x35')](_0x40afcb[_0xfc9c('0x2a')]['sort']);_0x1fdf52['where']=qs[_0xfc9c('0x2c')](_[_0xfc9c('0x36')](_0x40afcb[_0xfc9c('0x2a')],_0x50fa85[_0xfc9c('0x2c')]));if(_0x40afcb[_0xfc9c('0x2a')]['filter']){_0x1fdf52[_0xfc9c('0x37')]=_[_0xfc9c('0x38')](_0x1fdf52[_0xfc9c('0x37')],{'$or':_[_0xfc9c('0x39')](_0x5b2292,function(_0x1cec25){if(_0x1cec25[_0xfc9c('0x3a')][_0xfc9c('0x3b')]!==_0xfc9c('0x3c')){var _0x168e2c={};_0x168e2c[_0x1cec25['field']]={'$like':'%'+_0x40afcb[_0xfc9c('0x2a')][_0xfc9c('0x3d')]+'%'};return _0x168e2c;}})});}_0x1fdf52=_[_0xfc9c('0x38')]({},_0x1fdf52,_0x40afcb[_0xfc9c('0x3e')]);var _0x5e6950={'where':_0x1fdf52[_0xfc9c('0x37')]};return db['AnalyticFieldReport'][_0xfc9c('0x3f')](_0x5e6950)['then'](function(_0x40f66d){_0xc52ce0['count']=_0x40f66d;if(_0x40afcb['query'][_0xfc9c('0x40')]){_0x1fdf52['include']=[{'all':!![]}];}return db[_0xfc9c('0x41')][_0xfc9c('0x42')](_0x1fdf52);})['then'](function(_0x18a6d2){_0xc52ce0[_0xfc9c('0x43')]=_0x18a6d2;return _0xc52ce0;})['then'](respondWithFilteredResult(_0xa085f2,_0x1fdf52))['catch'](handleError(_0xa085f2,null));};exports['show']=function(_0x590673,_0x292253){var _0x1697bb={'raw':![],'where':{'id':_0x590673['params']['id']}},_0xa064b={};_0xa064b[_0xfc9c('0x29')]=_[_0xfc9c('0x2b')](db['AnalyticFieldReport']['rawAttributes']);_0xa064b[_0xfc9c('0x2a')]=_[_0xfc9c('0x2b')](_0x590673[_0xfc9c('0x2a')]);_0xa064b[_0xfc9c('0x2c')]=_[_0xfc9c('0x2d')](_0xa064b[_0xfc9c('0x29')],_0xa064b[_0xfc9c('0x2a')]);_0x1697bb['attributes']=_['intersection'](_0xa064b[_0xfc9c('0x29')],qs[_0xfc9c('0x2e')](_0x590673[_0xfc9c('0x2a')][_0xfc9c('0x2e')]));_0x1697bb[_0xfc9c('0x2f')]=_0x1697bb['attributes']['length']?_0x1697bb[_0xfc9c('0x2f')]:_0xa064b[_0xfc9c('0x29')];if(_0x590673[_0xfc9c('0x2a')][_0xfc9c('0x40')]){_0x1697bb[_0xfc9c('0x44')]=[{'all':!![]}];}_0x1697bb=_[_0xfc9c('0x38')]({},_0x1697bb,_0x590673[_0xfc9c('0x3e')]);return db['AnalyticFieldReport'][_0xfc9c('0x45')](_0x1697bb)['then'](handleEntityNotFound(_0x292253,null))[_0xfc9c('0x22')](respondWithResult(_0x292253,null))[_0xfc9c('0x46')](handleError(_0x292253,null));};exports[_0xfc9c('0x47')]=function(_0x550574,_0x2b6761){return db[_0xfc9c('0x41')][_0xfc9c('0x47')](_0x550574[_0xfc9c('0x48')],{})['then'](respondWithResult(_0x2b6761,0xc9))['catch'](handleError(_0x2b6761,null));};exports[_0xfc9c('0x49')]=function(_0x214cd9,_0x19f592){return db[_0xfc9c('0x41')][_0xfc9c('0x49')](_0x214cd9[_0xfc9c('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x19f592,0xc9))[_0xfc9c('0x46')](handleError(_0x19f592,null));};exports[_0xfc9c('0x21')]=function(_0x465a2c,_0x5b1c6d){if(_0x465a2c[_0xfc9c('0x48')]['id']){delete _0x465a2c[_0xfc9c('0x48')]['id'];}return db[_0xfc9c('0x41')][_0xfc9c('0x45')]({'where':{'id':_0x465a2c[_0xfc9c('0x4a')]['id']}})[_0xfc9c('0x22')](handleEntityNotFound(_0x5b1c6d,null))[_0xfc9c('0x22')](saveUpdates(_0x465a2c[_0xfc9c('0x48')],null))[_0xfc9c('0x22')](respondWithResult(_0x5b1c6d,null))['catch'](handleError(_0x5b1c6d,null));};exports['destroy']=function(_0x4c62b4,_0x27c0da){return db[_0xfc9c('0x41')][_0xfc9c('0x45')]({'where':{'id':_0x4c62b4[_0xfc9c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x27c0da,null))[_0xfc9c('0x22')](removeEntity(_0x27c0da,null))[_0xfc9c('0x46')](handleError(_0x27c0da,null));};exports[_0xfc9c('0x4b')]=function(_0x2ec322,_0xc416e5){return db[_0xfc9c('0x41')][_0xfc9c('0x23')]({'where':{'id':_0x2ec322[_0xfc9c('0x2a')][_0xfc9c('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xfc9c('0x22')](respondWithResult(_0xc416e5,0xcc))[_0xfc9c('0x46')](handleError(_0xc416e5,null));};exports[_0xfc9c('0x4d')]=function(_0x596e70,_0x1fdea6,_0x2f0f2d){return db[_0xfc9c('0x4e')]['findOne']({'where':{'id':_0x596e70[_0xfc9c('0x4a')]['id']}})[_0xfc9c('0x22')](handleEntityNotFound(_0x1fdea6,null))['then'](function(_0x59aca9){if(_0x59aca9){return db[_0xfc9c('0x4f')][_0xfc9c('0x50')](function(_0x4f8711){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x596e70[_0xfc9c('0x4a')]['id']},'transaction':_0x4f8711})[_0xfc9c('0x22')](function(_0x1dd1de){var _0x1fd513=_[_0xfc9c('0x39')](_0x596e70[_0xfc9c('0x48')],function(_0x39346f){delete _0x39346f['id'];_0x39346f['CustomReportId']=_0x596e70[_0xfc9c('0x4a')]['id'];return _0x39346f;});return db[_0xfc9c('0x41')][_0xfc9c('0x49')](_0x1fd513,{'transaction':_0x4f8711});});})[_0xfc9c('0x22')](function(){return db[_0xfc9c('0x41')][_0xfc9c('0x42')]({'where':{'CustomReportId':_0x596e70[_0xfc9c('0x4a')]['id']}});});}})[_0xfc9c('0x22')](respondWithResult(_0x1fdea6,null))[_0xfc9c('0x46')](handleError(_0x1fdea6,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 2a1069d..64ff96c 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 _0x9463=['define','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','request-promise','./analyticFieldReport.attributes','exports'];(function(_0x40b3b9,_0x224db8){var _0x55d813=function(_0x1bdeb1){while(--_0x1bdeb1){_0x40b3b9['push'](_0x40b3b9['shift']());}};_0x55d813(++_0x224db8);}(_0x9463,0x106));var _0x3946=function(_0x21e5d1,_0x30dd91){_0x21e5d1=_0x21e5d1-0x0;var _0x451b8d=_0x9463[_0x21e5d1];return _0x451b8d;};'use strict';var _=require(_0x3946('0x0'));var util=require(_0x3946('0x1'));var logger=require(_0x3946('0x2'))(_0x3946('0x3'));var moment=require(_0x3946('0x4'));var BPromise=require('bluebird');var rp=require(_0x3946('0x5'));var attributes=require(_0x3946('0x6'));module[_0x3946('0x7')]=function(_0x12d580,_0x2e9dd1){return _0x12d580[_0x3946('0x8')](_0x3946('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd99=['request-promise','./analyticFieldReport.attributes','exports','analytics_report_fields','util','../../config/logger','api','moment','bluebird'];(function(_0x4e4061,_0x26503b){var _0x371dbd=function(_0x31a31f){while(--_0x31a31f){_0x4e4061['push'](_0x4e4061['shift']());}};_0x371dbd(++_0x26503b);}(_0xcd99,0x9d));var _0x9cd9=function(_0x586877,_0x143a63){_0x586877=_0x586877-0x0;var _0x100337=_0xcd99[_0x586877];return _0x100337;};'use strict';var _=require('lodash');var util=require(_0x9cd9('0x0'));var logger=require(_0x9cd9('0x1'))(_0x9cd9('0x2'));var moment=require(_0x9cd9('0x3'));var BPromise=require(_0x9cd9('0x4'));var rp=require(_0x9cd9('0x5'));var attributes=require(_0x9cd9('0x6'));module[_0x9cd9('0x7')]=function(_0x299e1b,_0x4de285){return _0x299e1b['define']('AnalyticFieldReport',attributes,{'tableName':_0x9cd9('0x8'),'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 abe4896..b97588a 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 _0xf3fe=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','util'];(function(_0xd0aee1,_0x3550b0){var _0x2325de=function(_0x194c74){while(--_0x194c74){_0xd0aee1['push'](_0xd0aee1['shift']());}};_0x2325de(++_0x3550b0);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x9ff3e3,_0x1f4adf){_0x9ff3e3=_0x9ff3e3-0x0;var _0x35d48f=_0xf3fe[_0x9ff3e3];return _0x35d48f;};'use strict';var _=require('lodash');var util=require(_0xef3f('0x0'));var moment=require(_0xef3f('0x1'));var BPromise=require(_0xef3f('0x2'));var rs=require(_0xef3f('0x3'));var fs=require('fs');var Redis=require(_0xef3f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xef3f('0x5'));var logger=require(_0xef3f('0x6'))(_0xef3f('0x7'));var config=require(_0xef3f('0x8'));var jayson=require(_0xef3f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9e20c7,_0x2f5a64,_0x211a6c){return new BPromise(function(_0x262ea3,_0x2e9ce4){return client[_0xef3f('0xa')](_0x9e20c7,_0x211a6c)[_0xef3f('0xb')](function(_0x3f2363){logger[_0xef3f('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2f5a64,_0xef3f('0xd'));logger['debug'](_0xef3f('0xe'),_0x2f5a64,_0xef3f('0xd'),JSON[_0xef3f('0xf')](_0x3f2363));if(_0x3f2363[_0xef3f('0x10')]){if(_0x3f2363['error'][_0xef3f('0x11')]===0x1f4){logger[_0xef3f('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2f5a64,_0x3f2363[_0xef3f('0x10')]['message']);return _0x2e9ce4(_0x3f2363[_0xef3f('0x10')]['message']);}logger[_0xef3f('0x10')](_0xef3f('0x12'),_0x2f5a64,_0x3f2363[_0xef3f('0x10')][_0xef3f('0x13')]);return _0x262ea3(_0x3f2363[_0xef3f('0x10')][_0xef3f('0x13')]);}else{logger[_0xef3f('0xc')](_0xef3f('0x12'),_0x2f5a64,_0xef3f('0xd'));_0x262ea3(_0x3f2363[_0xef3f('0x14')][_0xef3f('0x13')]);}})['catch'](function(_0x39d905){logger[_0xef3f('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2f5a64,_0x39d905);_0x2e9ce4(_0x39d905);});});} \ No newline at end of file +var _0x1a28=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2c768d,_0x5b3efb){var _0x2e0941=function(_0x3caae9){while(--_0x3caae9){_0x2c768d['push'](_0x2c768d['shift']());}};_0x2e0941(++_0x5b3efb);}(_0x1a28,0x10e));var _0x81a2=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x1a28[_0x263f9d];return _0x4c4efa;};'use strict';var _=require(_0x81a2('0x0'));var util=require(_0x81a2('0x1'));var moment=require(_0x81a2('0x2'));var BPromise=require(_0x81a2('0x3'));var rs=require(_0x81a2('0x4'));var fs=require('fs');var Redis=require(_0x81a2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x81a2('0x6'))(_0x81a2('0x7'));var config=require(_0x81a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x81a2('0x9')][_0x81a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x597932,_0x1aa420,_0x2aa66f){return new BPromise(function(_0x453392,_0x4672ce){return client[_0x81a2('0xb')](_0x597932,_0x2aa66f)[_0x81a2('0xc')](function(_0x3f36f5){logger[_0x81a2('0xd')](_0x81a2('0xe'),_0x1aa420,'request\x20sent');logger[_0x81a2('0xf')](_0x81a2('0x10'),_0x1aa420,_0x81a2('0x11'),JSON[_0x81a2('0x12')](_0x3f36f5));if(_0x3f36f5[_0x81a2('0x13')]){if(_0x3f36f5['error'][_0x81a2('0x14')]===0x1f4){logger[_0x81a2('0x13')](_0x81a2('0xe'),_0x1aa420,_0x3f36f5[_0x81a2('0x13')][_0x81a2('0x15')]);return _0x4672ce(_0x3f36f5[_0x81a2('0x13')][_0x81a2('0x15')]);}logger[_0x81a2('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1aa420,_0x3f36f5[_0x81a2('0x13')]['message']);return _0x453392(_0x3f36f5[_0x81a2('0x13')][_0x81a2('0x15')]);}else{logger['info'](_0x81a2('0xe'),_0x1aa420,'request\x20sent');_0x453392(_0x3f36f5[_0x81a2('0x16')][_0x81a2('0x15')]);}})[_0x81a2('0x17')](function(_0x7da352){logger[_0x81a2('0x13')](_0x81a2('0xe'),_0x1aa420,_0x7da352);_0x4672ce(_0x7da352);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 220aa42..b9c4dcb 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 _0xaa88=['get','isAuthenticated','show','post','/create_many','/:id/create_many','addFields','/:id','delete','/destroy_many','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller'];(function(_0x54f0e0,_0x4df509){var _0x203031=function(_0x328c38){while(--_0x328c38){_0x54f0e0['push'](_0x54f0e0['shift']());}};_0x203031(++_0x4df509);}(_0xaa88,0x137));var _0x8aa8=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0xaa88[_0x15fc3c];return _0x94c5c8;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var auth=require(_0x8aa8('0x5'));var interaction=require(_0x8aa8('0x6'));var config=require(_0x8aa8('0x7'));var controller=require(_0x8aa8('0x8'));router[_0x8aa8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8aa8('0x9')]('/:id',auth[_0x8aa8('0xa')](),controller[_0x8aa8('0xb')]);router[_0x8aa8('0xc')]('/',auth[_0x8aa8('0xa')](),controller['create']);router[_0x8aa8('0xc')](_0x8aa8('0xd'),auth[_0x8aa8('0xa')](),controller['bulkCreate']);router[_0x8aa8('0xc')](_0x8aa8('0xe'),auth[_0x8aa8('0xa')](),controller[_0x8aa8('0xf')]);router['put'](_0x8aa8('0x10'),auth[_0x8aa8('0xa')](),controller['update']);router[_0x8aa8('0x11')](_0x8aa8('0x12'),auth[_0x8aa8('0xa')](),controller['bulkDestroy']);router[_0x8aa8('0x11')](_0x8aa8('0x10'),auth[_0x8aa8('0xa')](),controller['destroy']);module[_0x8aa8('0x13')]=router; \ No newline at end of file +var _0x4e81=['/destroy_many','bulkDestroy','delete','destroy','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','/:id','show','post','create','/create_many','/:id/create_many','addFields','put','update'];(function(_0x7148b6,_0xa61534){var _0x111019=function(_0x452d96){while(--_0x452d96){_0x7148b6['push'](_0x7148b6['shift']());}};_0x111019(++_0xa61534);}(_0x4e81,0x1bc));var _0x14e8=function(_0x50f0a9,_0x2b0c57){_0x50f0a9=_0x50f0a9-0x0;var _0x5a33d9=_0x4e81[_0x50f0a9];return _0x5a33d9;};'use strict';var multer=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var path=require(_0x14e8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x14e8('0x3'));var interaction=require(_0x14e8('0x4'));var config=require(_0x14e8('0x5'));var controller=require(_0x14e8('0x6'));router[_0x14e8('0x7')]('/',auth[_0x14e8('0x8')](),controller['index']);router['get'](_0x14e8('0x9'),auth[_0x14e8('0x8')](),controller[_0x14e8('0xa')]);router[_0x14e8('0xb')]('/',auth[_0x14e8('0x8')](),controller[_0x14e8('0xc')]);router[_0x14e8('0xb')](_0x14e8('0xd'),auth[_0x14e8('0x8')](),controller['bulkCreate']);router[_0x14e8('0xb')](_0x14e8('0xe'),auth[_0x14e8('0x8')](),controller[_0x14e8('0xf')]);router[_0x14e8('0x10')](_0x14e8('0x9'),auth[_0x14e8('0x8')](),controller[_0x14e8('0x11')]);router['delete'](_0x14e8('0x12'),auth['isAuthenticated'](),controller[_0x14e8('0x13')]);router[_0x14e8('0x14')](_0x14e8('0x9'),auth['isAuthenticated'](),controller[_0x14e8('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 4b70229..4c65f2a 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 _0xe9ce=['name','exports','STRING'];(function(_0x24a5ba,_0x1877c9){var _0x564717=function(_0x4d7cc3){while(--_0x4d7cc3){_0x24a5ba['push'](_0x24a5ba['shift']());}};_0x564717(++_0x1877c9);}(_0xe9ce,0x13c));var _0xee9c=function(_0x4db3fb,_0x5089ec){_0x4db3fb=_0x4db3fb-0x0;var _0x1cba5c=_0xe9ce[_0x4db3fb];return _0x1cba5c;};'use strict';var Sequelize=require('sequelize');module[_0xee9c('0x0')]={'name':{'type':Sequelize[_0xee9c('0x1')],'allowNull':![],'unique':_0xee9c('0x2')},'table':{'type':Sequelize[_0xee9c('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x362c=['STRING','name','TEXT','exports'];(function(_0x3ae6bd,_0x41e8ca){var _0x10f176=function(_0x59ea01){while(--_0x59ea01){_0x3ae6bd['push'](_0x3ae6bd['shift']());}};_0x10f176(++_0x41e8ca);}(_0x362c,0x12f));var _0xc362=function(_0x473c67,_0x53989f){_0x473c67=_0x473c67-0x0;var _0xb5f3aa=_0x362c[_0x473c67];return _0xb5f3aa;};'use strict';var Sequelize=require('sequelize');module[_0xc362('0x0')]={'name':{'type':Sequelize[_0xc362('0x1')],'allowNull':![],'unique':_0xc362('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xc362('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index e94032b..ea2949d 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 _0xa16e=['include','findAll','rows','catch','length','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','index','AnalyticMetric','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','map','key','VIRTUAL','field','count','includeAll'];(function(_0x4ed5fd,_0x4d9f5b){var _0x5263cd=function(_0x5a77cc){while(--_0x5a77cc){_0x4ed5fd['push'](_0x4ed5fd['shift']());}};_0x5263cd(++_0x4d9f5b);}(_0xa16e,0x1dd));var _0xea16=function(_0x2f3cb4,_0x206261){_0x2f3cb4=_0x2f3cb4-0x0;var _0x2e37fd=_0xa16e[_0x2f3cb4];return _0x2e37fd;};'use strict';var pdf=require(_0xea16('0x0'));var emlformat=require(_0xea16('0x1'));var rimraf=require(_0xea16('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea16('0x3'));var rp=require(_0xea16('0x4'));var moment=require('moment');var BPromise=require(_0xea16('0x5'));var Mustache=require(_0xea16('0x6'));var util=require(_0xea16('0x7'));var path=require(_0xea16('0x8'));var sox=require(_0xea16('0x9'));var csv=require('to-csv');var ejs=require(_0xea16('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xea16('0xb'));var crypto=require(_0xea16('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xea16('0xd'));var toCsv=require('to-csv');var querystring=require(_0xea16('0xe'));var Papa=require(_0xea16('0xf'));var authService=require(_0xea16('0x10'));var hardwareService=require(_0xea16('0x11'));var Redis=require(_0xea16('0x12'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0xea16('0x13'));var config=require(_0xea16('0x14'));var db=require(_0xea16('0x15'))['db'];function respondWithStatusCode(_0x318a15,_0x5f2334){_0x5f2334=_0x5f2334||0xcc;return function(_0x29d2fc){if(_0x29d2fc){return _0x318a15[_0xea16('0x16')](_0x5f2334);}return _0x318a15['status'](_0x5f2334)[_0xea16('0x17')]();};}function respondWithResult(_0x288195,_0x46683c){_0x46683c=_0x46683c||0xc8;return function(_0x548b24){if(_0x548b24){return _0x288195[_0xea16('0x18')](_0x46683c)['json'](_0x548b24);}};}function respondWithFilteredResult(_0x23e670,_0x46036d){return function(_0x3bccdc){if(_0x3bccdc){var _0x2474b3=_0x3bccdc['count'],_0x282cdd=_0x46036d['offset'],_0x33f000=_0x46036d[_0xea16('0x19')]+_0x46036d[_0xea16('0x1a')],_0x56f7bd;if(_0x33f000>=_0x2474b3){_0x33f000=_0x2474b3;_0x56f7bd=0xc8;}else{_0x56f7bd=0xce;}_0x23e670[_0xea16('0x18')](_0x56f7bd);return _0x23e670[_0xea16('0x1b')](_0xea16('0x1c'),_0x282cdd+'-'+_0x33f000+'/'+_0x2474b3)[_0xea16('0x1d')](_0x3bccdc);}return null;};}function patchUpdates(_0xee4b7){return function(_0x4e5ced){try{jsonpatch[_0xea16('0x1e')](_0x4e5ced,_0xee4b7,!![]);}catch(_0x1822e1){return BPromise[_0xea16('0x1f')](_0x1822e1);}return _0x4e5ced[_0xea16('0x20')]();};}function saveUpdates(_0x146f20,_0x4e7baf){return function(_0x45a28c){if(_0x45a28c){return _0x45a28c[_0xea16('0x21')](_0x146f20)[_0xea16('0x22')](function(_0x1360f3){return _0x1360f3;});}return null;};}function removeEntity(_0x39ee1b,_0x48f8c4){return function(_0x2e31ea){if(_0x2e31ea){return _0x2e31ea[_0xea16('0x23')]()['then'](function(){var _0x338d32=_0x2e31ea[_0xea16('0x24')]({'plain':!![]});var _0x5be9ae=_0xea16('0x25');return db['UserProfileResource'][_0xea16('0x23')]({'where':{'type':_0x5be9ae,'resourceId':_0x338d32['id']}})[_0xea16('0x22')](function(){return _0x2e31ea;});})['then'](function(){_0x39ee1b[_0xea16('0x18')](0xcc)[_0xea16('0x17')]();});}};}function handleEntityNotFound(_0x186c80,_0x56d530){return function(_0x14710d){if(!_0x14710d){_0x186c80[_0xea16('0x16')](0x194);}return _0x14710d;};}function handleError(_0x1c0734,_0x5db194){_0x5db194=_0x5db194||0x1f4;return function(_0x576ebc){logger['error'](_0x576ebc[_0xea16('0x26')]);if(_0x576ebc[_0xea16('0x27')]){delete _0x576ebc[_0xea16('0x27')];}_0x1c0734['status'](_0x5db194)['send'](_0x576ebc);};}exports[_0xea16('0x28')]=function(_0x15e29c,_0x51a1f7){var _0x4aa658={},_0x148b41={},_0x3e9acb={'count':0x0,'rows':[]};var _0x32b246=db[_0xea16('0x29')][_0xea16('0x2a')];_0x148b41[_0xea16('0x2b')]=_[_0xea16('0x2c')](_0x32b246);_0x148b41[_0xea16('0x2d')]=_[_0xea16('0x2c')](_0x15e29c['query']);_0x148b41[_0xea16('0x2e')]=_[_0xea16('0x2f')](_0x148b41[_0xea16('0x2b')],_0x148b41[_0xea16('0x2d')]);_0x4aa658['attributes']=_[_0xea16('0x2f')](_0x148b41['model'],qs[_0xea16('0x30')](_0x15e29c[_0xea16('0x2d')]['fields']));_0x4aa658[_0xea16('0x31')]=_0x4aa658['attributes']['length']?_0x4aa658[_0xea16('0x31')]:_0x148b41[_0xea16('0x2b')];if(!_0x15e29c[_0xea16('0x2d')]['hasOwnProperty'](_0xea16('0x32'))){_0x4aa658[_0xea16('0x1a')]=qs['limit'](_0x15e29c[_0xea16('0x2d')][_0xea16('0x1a')]);_0x4aa658[_0xea16('0x19')]=qs[_0xea16('0x19')](_0x15e29c[_0xea16('0x2d')][_0xea16('0x19')]);}_0x4aa658['order']=qs[_0xea16('0x33')](_0x15e29c['query'][_0xea16('0x33')]);_0x4aa658[_0xea16('0x34')]=qs[_0xea16('0x2e')](_[_0xea16('0x35')](_0x15e29c['query'],_0x148b41[_0xea16('0x2e')]));if(_0x15e29c['query'][_0xea16('0x36')]){_0x4aa658[_0xea16('0x34')]=_[_0xea16('0x37')](_0x4aa658[_0xea16('0x34')],{'$or':_[_0xea16('0x38')](_0x32b246,function(_0x4c1bbd){if(_0x4c1bbd['type'][_0xea16('0x39')]!==_0xea16('0x3a')){var _0x6bd80d={};_0x6bd80d[_0x4c1bbd[_0xea16('0x3b')]]={'$like':'%'+_0x15e29c[_0xea16('0x2d')][_0xea16('0x36')]+'%'};return _0x6bd80d;}})});}_0x4aa658=_[_0xea16('0x37')]({},_0x4aa658,_0x15e29c['options']);var _0x49b9d3={'where':_0x4aa658[_0xea16('0x34')]};return db['AnalyticMetric'][_0xea16('0x3c')](_0x49b9d3)[_0xea16('0x22')](function(_0x552ce0){_0x3e9acb[_0xea16('0x3c')]=_0x552ce0;if(_0x15e29c[_0xea16('0x2d')][_0xea16('0x3d')]){_0x4aa658[_0xea16('0x3e')]=[{'all':!![]}];}return db[_0xea16('0x29')][_0xea16('0x3f')](_0x4aa658);})[_0xea16('0x22')](function(_0x18386a){_0x3e9acb[_0xea16('0x40')]=_0x18386a;return _0x3e9acb;})['then'](respondWithFilteredResult(_0x51a1f7,_0x4aa658))[_0xea16('0x41')](handleError(_0x51a1f7,null));};exports['show']=function(_0x547271,_0x525ef5){var _0x2c6029={'raw':!![],'where':{'id':_0x547271['params']['id']}},_0x40285f={};_0x40285f[_0xea16('0x2b')]=_['keys'](db[_0xea16('0x29')][_0xea16('0x2a')]);_0x40285f[_0xea16('0x2d')]=_[_0xea16('0x2c')](_0x547271[_0xea16('0x2d')]);_0x40285f[_0xea16('0x2e')]=_[_0xea16('0x2f')](_0x40285f[_0xea16('0x2b')],_0x40285f[_0xea16('0x2d')]);_0x2c6029[_0xea16('0x31')]=_[_0xea16('0x2f')](_0x40285f['model'],qs[_0xea16('0x30')](_0x547271[_0xea16('0x2d')][_0xea16('0x30')]));_0x2c6029['attributes']=_0x2c6029[_0xea16('0x31')][_0xea16('0x42')]?_0x2c6029[_0xea16('0x31')]:_0x40285f[_0xea16('0x2b')];if(_0x547271['query']['includeAll']){_0x2c6029['include']=[{'all':!![]}];}_0x2c6029=_[_0xea16('0x37')]({},_0x2c6029,_0x547271['options']);return db[_0xea16('0x29')]['find'](_0x2c6029)['then'](handleEntityNotFound(_0x525ef5,null))[_0xea16('0x22')](respondWithResult(_0x525ef5,null))[_0xea16('0x41')](handleError(_0x525ef5,null));};exports[_0xea16('0x43')]=function(_0x376fe0,_0x4649fa){return db['AnalyticMetric'][_0xea16('0x43')](_0x376fe0[_0xea16('0x44')],{})['then'](function(_0x417f5c){var _0x5978ea=_0x376fe0['user'][_0xea16('0x24')]({'plain':!![]});if(!_0x5978ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5978ea['role']===_0xea16('0x45')){var _0x348a78=_0x417f5c['get']({'plain':!![]});var _0x4f5d9d=_0xea16('0x25');return db[_0xea16('0x46')]['find']({'where':{'name':_0x4f5d9d,'userProfileId':_0x5978ea[_0xea16('0x47')]},'raw':!![]})[_0xea16('0x22')](function(_0x137b56){if(_0x137b56&&_0x137b56[_0xea16('0x48')]===0x0){return db[_0xea16('0x49')]['create']({'name':_0x348a78[_0xea16('0x27')],'resourceId':_0x348a78['id'],'type':_0x137b56[_0xea16('0x27')],'sectionId':_0x137b56['id']},{})[_0xea16('0x22')](function(){return _0x417f5c;});}else{return _0x417f5c;}})['catch'](function(_0x3cf499){logger[_0xea16('0x4a')](_0xea16('0x4b'),_0x3cf499);throw _0x3cf499;});}return _0x417f5c;})['then'](respondWithResult(_0x4649fa,0xc9))[_0xea16('0x41')](handleError(_0x4649fa,null));};exports[_0xea16('0x21')]=function(_0x477d18,_0xd1a4dd){if(_0x477d18[_0xea16('0x44')]['id']){delete _0x477d18[_0xea16('0x44')]['id'];}return db[_0xea16('0x29')]['find']({'where':{'id':_0x477d18[_0xea16('0x4c')]['id']}})['then'](handleEntityNotFound(_0xd1a4dd,null))[_0xea16('0x22')](saveUpdates(_0x477d18[_0xea16('0x44')],null))[_0xea16('0x22')](respondWithResult(_0xd1a4dd,null))[_0xea16('0x41')](handleError(_0xd1a4dd,null));};exports[_0xea16('0x23')]=function(_0x25b9b9,_0x4a57f2){return db['AnalyticMetric']['find']({'where':{'id':_0x25b9b9[_0xea16('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4a57f2,null))[_0xea16('0x22')](removeEntity(_0x4a57f2,null))['catch'](handleError(_0x4a57f2,null));}; \ No newline at end of file +var _0x8b72=['AnalyticMetric','model','query','intersection','attributes','fields','length','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','set','json','apply','reject','save','update','then','destroy','Metrics','UserProfileResource','error','stack','name'];(function(_0x3129cb,_0x4f9577){var _0x3172a0=function(_0x7322f4){while(--_0x7322f4){_0x3129cb['push'](_0x3129cb['shift']());}};_0x3172a0(++_0x4f9577);}(_0x8b72,0x11a));var _0x28b7=function(_0x204cc0,_0x392658){_0x204cc0=_0x204cc0-0x0;var _0x1afd96=_0x8b72[_0x204cc0];return _0x1afd96;};'use strict';var pdf=require(_0x28b7('0x0'));var emlformat=require(_0x28b7('0x1'));var rimraf=require(_0x28b7('0x2'));var zipdir=require(_0x28b7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28b7('0x4'));var moment=require('moment');var BPromise=require(_0x28b7('0x5'));var Mustache=require(_0x28b7('0x6'));var util=require(_0x28b7('0x7'));var path=require(_0x28b7('0x8'));var sox=require(_0x28b7('0x9'));var csv=require(_0x28b7('0xa'));var ejs=require(_0x28b7('0xb'));var fs=require('fs');var _=require(_0x28b7('0xc'));var squel=require('squel');var crypto=require(_0x28b7('0xd'));var jsforce=require(_0x28b7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x28b7('0xa'));var querystring=require(_0x28b7('0xf'));var Papa=require(_0x28b7('0x10'));var authService=require(_0x28b7('0x11'));var hardwareService=require(_0x28b7('0x12'));var Redis=require(_0x28b7('0x13'));var qs=require(_0x28b7('0x14'));var logger=require('../../config/logger')(_0x28b7('0x15'));var utils=require(_0x28b7('0x16'));var config=require(_0x28b7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b85a5,_0x29770c){_0x29770c=_0x29770c||0xcc;return function(_0x58bf8b){if(_0x58bf8b){return _0x3b85a5[_0x28b7('0x18')](_0x29770c);}return _0x3b85a5[_0x28b7('0x19')](_0x29770c)[_0x28b7('0x1a')]();};}function respondWithResult(_0x27c267,_0x48efac){_0x48efac=_0x48efac||0xc8;return function(_0x3f689a){if(_0x3f689a){return _0x27c267[_0x28b7('0x19')](_0x48efac)['json'](_0x3f689a);}};}function respondWithFilteredResult(_0x13c791,_0xb500da){return function(_0x4d1adb){if(_0x4d1adb){var _0x2d3780=_0x4d1adb[_0x28b7('0x1b')],_0x461ad0=_0xb500da[_0x28b7('0x1c')],_0xd49c71=_0xb500da[_0x28b7('0x1c')]+_0xb500da['limit'],_0x5b1a17;if(_0xd49c71>=_0x2d3780){_0xd49c71=_0x2d3780;_0x5b1a17=0xc8;}else{_0x5b1a17=0xce;}_0x13c791['status'](_0x5b1a17);return _0x13c791[_0x28b7('0x1d')]('Content-Range',_0x461ad0+'-'+_0xd49c71+'/'+_0x2d3780)[_0x28b7('0x1e')](_0x4d1adb);}return null;};}function patchUpdates(_0x3f31cd){return function(_0x2a24a5){try{jsonpatch[_0x28b7('0x1f')](_0x2a24a5,_0x3f31cd,!![]);}catch(_0xace881){return BPromise[_0x28b7('0x20')](_0xace881);}return _0x2a24a5[_0x28b7('0x21')]();};}function saveUpdates(_0x19ae51,_0x4e7f9b){return function(_0x10201b){if(_0x10201b){return _0x10201b[_0x28b7('0x22')](_0x19ae51)[_0x28b7('0x23')](function(_0x5d9262){return _0x5d9262;});}return null;};}function removeEntity(_0x282076,_0x596d45){return function(_0x125c8a){if(_0x125c8a){return _0x125c8a[_0x28b7('0x24')]()[_0x28b7('0x23')](function(){var _0x5e8db6=_0x125c8a['get']({'plain':!![]});var _0x54000e=_0x28b7('0x25');return db[_0x28b7('0x26')][_0x28b7('0x24')]({'where':{'type':_0x54000e,'resourceId':_0x5e8db6['id']}})[_0x28b7('0x23')](function(){return _0x125c8a;});})['then'](function(){_0x282076[_0x28b7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x514b9e,_0x1153ea){return function(_0x48ceb6){if(!_0x48ceb6){_0x514b9e[_0x28b7('0x18')](0x194);}return _0x48ceb6;};}function handleError(_0x3843ac,_0x2da9d8){_0x2da9d8=_0x2da9d8||0x1f4;return function(_0x4b62d3){logger[_0x28b7('0x27')](_0x4b62d3[_0x28b7('0x28')]);if(_0x4b62d3[_0x28b7('0x29')]){delete _0x4b62d3[_0x28b7('0x29')];}_0x3843ac['status'](_0x2da9d8)['send'](_0x4b62d3);};}exports['index']=function(_0x15121d,_0xb296ee){var _0xc15e3c={},_0x57b348={},_0x878d5b={'count':0x0,'rows':[]};var _0x52577f=db[_0x28b7('0x2a')]['rawAttributes'];_0x57b348[_0x28b7('0x2b')]=_['keys'](_0x52577f);_0x57b348[_0x28b7('0x2c')]=_['keys'](_0x15121d[_0x28b7('0x2c')]);_0x57b348['filters']=_[_0x28b7('0x2d')](_0x57b348[_0x28b7('0x2b')],_0x57b348[_0x28b7('0x2c')]);_0xc15e3c[_0x28b7('0x2e')]=_[_0x28b7('0x2d')](_0x57b348['model'],qs[_0x28b7('0x2f')](_0x15121d['query'][_0x28b7('0x2f')]));_0xc15e3c[_0x28b7('0x2e')]=_0xc15e3c[_0x28b7('0x2e')][_0x28b7('0x30')]?_0xc15e3c[_0x28b7('0x2e')]:_0x57b348[_0x28b7('0x2b')];if(!_0x15121d[_0x28b7('0x2c')]['hasOwnProperty']('nolimit')){_0xc15e3c['limit']=qs[_0x28b7('0x31')](_0x15121d['query']['limit']);_0xc15e3c['offset']=qs['offset'](_0x15121d[_0x28b7('0x2c')][_0x28b7('0x1c')]);}_0xc15e3c[_0x28b7('0x32')]=qs[_0x28b7('0x33')](_0x15121d[_0x28b7('0x2c')]['sort']);_0xc15e3c[_0x28b7('0x34')]=qs[_0x28b7('0x35')](_[_0x28b7('0x36')](_0x15121d[_0x28b7('0x2c')],_0x57b348[_0x28b7('0x35')]));if(_0x15121d[_0x28b7('0x2c')][_0x28b7('0x37')]){_0xc15e3c[_0x28b7('0x34')]=_[_0x28b7('0x38')](_0xc15e3c[_0x28b7('0x34')],{'$or':_[_0x28b7('0x39')](_0x52577f,function(_0x208a90){if(_0x208a90[_0x28b7('0x3a')][_0x28b7('0x3b')]!==_0x28b7('0x3c')){var _0x16d51c={};_0x16d51c[_0x208a90[_0x28b7('0x3d')]]={'$like':'%'+_0x15121d[_0x28b7('0x2c')]['filter']+'%'};return _0x16d51c;}})});}_0xc15e3c=_[_0x28b7('0x38')]({},_0xc15e3c,_0x15121d['options']);var _0x4b8683={'where':_0xc15e3c[_0x28b7('0x34')]};return db[_0x28b7('0x2a')][_0x28b7('0x1b')](_0x4b8683)['then'](function(_0x4d1ac3){_0x878d5b[_0x28b7('0x1b')]=_0x4d1ac3;if(_0x15121d[_0x28b7('0x2c')][_0x28b7('0x3e')]){_0xc15e3c[_0x28b7('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x28b7('0x40')](_0xc15e3c);})[_0x28b7('0x23')](function(_0x3a4c02){_0x878d5b[_0x28b7('0x41')]=_0x3a4c02;return _0x878d5b;})['then'](respondWithFilteredResult(_0xb296ee,_0xc15e3c))[_0x28b7('0x42')](handleError(_0xb296ee,null));};exports['show']=function(_0x119056,_0x5cd996){var _0x27f4ce={'raw':!![],'where':{'id':_0x119056[_0x28b7('0x43')]['id']}},_0x4998fb={};_0x4998fb[_0x28b7('0x2b')]=_[_0x28b7('0x44')](db['AnalyticMetric'][_0x28b7('0x45')]);_0x4998fb[_0x28b7('0x2c')]=_['keys'](_0x119056[_0x28b7('0x2c')]);_0x4998fb[_0x28b7('0x35')]=_[_0x28b7('0x2d')](_0x4998fb[_0x28b7('0x2b')],_0x4998fb[_0x28b7('0x2c')]);_0x27f4ce[_0x28b7('0x2e')]=_[_0x28b7('0x2d')](_0x4998fb[_0x28b7('0x2b')],qs['fields'](_0x119056[_0x28b7('0x2c')][_0x28b7('0x2f')]));_0x27f4ce['attributes']=_0x27f4ce[_0x28b7('0x2e')][_0x28b7('0x30')]?_0x27f4ce[_0x28b7('0x2e')]:_0x4998fb[_0x28b7('0x2b')];if(_0x119056[_0x28b7('0x2c')]['includeAll']){_0x27f4ce[_0x28b7('0x3f')]=[{'all':!![]}];}_0x27f4ce=_[_0x28b7('0x38')]({},_0x27f4ce,_0x119056[_0x28b7('0x46')]);return db[_0x28b7('0x2a')][_0x28b7('0x47')](_0x27f4ce)[_0x28b7('0x23')](handleEntityNotFound(_0x5cd996,null))[_0x28b7('0x23')](respondWithResult(_0x5cd996,null))[_0x28b7('0x42')](handleError(_0x5cd996,null));};exports[_0x28b7('0x48')]=function(_0x538678,_0x3f8083){return db[_0x28b7('0x2a')][_0x28b7('0x48')](_0x538678['body'],{})[_0x28b7('0x23')](function(_0x4cf8a9){var _0x28bbd4=_0x538678[_0x28b7('0x49')]['get']({'plain':!![]});if(!_0x28bbd4)throw new Error(_0x28b7('0x4a'));if(_0x28bbd4[_0x28b7('0x4b')]==='user'){var _0x3a4222=_0x4cf8a9['get']({'plain':!![]});var _0x45978a=_0x28b7('0x25');return db[_0x28b7('0x4c')][_0x28b7('0x47')]({'where':{'name':_0x45978a,'userProfileId':_0x28bbd4[_0x28b7('0x4d')]},'raw':!![]})[_0x28b7('0x23')](function(_0x277954){if(_0x277954&&_0x277954[_0x28b7('0x4e')]===0x0){return db[_0x28b7('0x26')][_0x28b7('0x48')]({'name':_0x3a4222[_0x28b7('0x29')],'resourceId':_0x3a4222['id'],'type':_0x277954[_0x28b7('0x29')],'sectionId':_0x277954['id']},{})[_0x28b7('0x23')](function(){return _0x4cf8a9;});}else{return _0x4cf8a9;}})['catch'](function(_0x4913be){logger[_0x28b7('0x27')](_0x28b7('0x4f'),_0x4913be);throw _0x4913be;});}return _0x4cf8a9;})[_0x28b7('0x23')](respondWithResult(_0x3f8083,0xc9))[_0x28b7('0x42')](handleError(_0x3f8083,null));};exports[_0x28b7('0x22')]=function(_0x3bdd11,_0x4d7506){if(_0x3bdd11[_0x28b7('0x50')]['id']){delete _0x3bdd11[_0x28b7('0x50')]['id'];}return db[_0x28b7('0x2a')]['find']({'where':{'id':_0x3bdd11[_0x28b7('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d7506,null))['then'](saveUpdates(_0x3bdd11[_0x28b7('0x50')],null))[_0x28b7('0x23')](respondWithResult(_0x4d7506,null))[_0x28b7('0x42')](handleError(_0x4d7506,null));};exports['destroy']=function(_0x218abb,_0x6b5749){return db[_0x28b7('0x2a')][_0x28b7('0x47')]({'where':{'id':_0x218abb[_0x28b7('0x43')]['id']}})['then'](handleEntityNotFound(_0x6b5749,null))['then'](removeEntity(_0x6b5749,null))[_0x28b7('0x42')](handleError(_0x6b5749,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index c8a8703..ffac573 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 _0x400b=['analytics_metrics','lodash','moment','bluebird','exports','define','AnalyticMetric'];(function(_0x50d289,_0x1a39ad){var _0x1d760c=function(_0x446810){while(--_0x446810){_0x50d289['push'](_0x50d289['shift']());}};_0x1d760c(++_0x1a39ad);}(_0x400b,0x13c));var _0xb400=function(_0x4fae0b,_0x5d8ddc){_0x4fae0b=_0x4fae0b-0x0;var _0x5edea8=_0x400b[_0x4fae0b];return _0x5edea8;};'use strict';var _=require(_0xb400('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb400('0x1'));var BPromise=require(_0xb400('0x2'));var rp=require('request-promise');var attributes=require('./analyticMetric.attributes');module[_0xb400('0x3')]=function(_0x1d8be6,_0x2b8545){return _0x1d8be6[_0xb400('0x4')](_0xb400('0x5'),attributes,{'tableName':_0xb400('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc98=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api','request-promise'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0xfc98,0x83));var _0x8fc9=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xfc98[_0x9c2427];return _0x51984f;};'use strict';var _=require('lodash');var util=require(_0x8fc9('0x0'));var logger=require(_0x8fc9('0x1'))(_0x8fc9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8fc9('0x3'));var attributes=require(_0x8fc9('0x4'));module[_0x8fc9('0x5')]=function(_0x420ff0,_0x592b1c){return _0x420ff0[_0x8fc9('0x6')](_0x8fc9('0x7'),attributes,{'tableName':_0x8fc9('0x8'),'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 50df0ae..25bf4e0 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 _0xb079=['stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0xb079,0x1c9));var _0x9b07=function(_0x4a7898,_0x57b2b7){_0x4a7898=_0x4a7898-0x0;var _0x5706db=_0xb079[_0x4a7898];return _0x5706db;};'use strict';var _=require('lodash');var util=require(_0x9b07('0x0'));var moment=require(_0x9b07('0x1'));var BPromise=require(_0x9b07('0x2'));var rs=require(_0x9b07('0x3'));var fs=require('fs');var Redis=require(_0x9b07('0x4'));var db=require(_0x9b07('0x5'))['db'];var utils=require(_0x9b07('0x6'));var logger=require(_0x9b07('0x7'))(_0x9b07('0x8'));var config=require(_0x9b07('0x9'));var jayson=require(_0x9b07('0xa'));var client=jayson['client'][_0x9b07('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2be1ef,_0x54d030,_0x17a4bc){return new BPromise(function(_0x5a0395,_0x525492){return client[_0x9b07('0xc')](_0x2be1ef,_0x17a4bc)[_0x9b07('0xd')](function(_0x26ef60){logger[_0x9b07('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x54d030,_0x9b07('0xf'));logger[_0x9b07('0x10')](_0x9b07('0x11'),_0x54d030,_0x9b07('0xf'),JSON[_0x9b07('0x12')](_0x26ef60));if(_0x26ef60[_0x9b07('0x13')]){if(_0x26ef60[_0x9b07('0x13')][_0x9b07('0x14')]===0x1f4){logger[_0x9b07('0x13')](_0x9b07('0x15'),_0x54d030,_0x26ef60[_0x9b07('0x13')][_0x9b07('0x16')]);return _0x525492(_0x26ef60[_0x9b07('0x13')]['message']);}logger['error'](_0x9b07('0x15'),_0x54d030,_0x26ef60[_0x9b07('0x13')][_0x9b07('0x16')]);return _0x5a0395(_0x26ef60[_0x9b07('0x13')][_0x9b07('0x16')]);}else{logger['info'](_0x9b07('0x15'),_0x54d030,_0x9b07('0xf'));_0x5a0395(_0x26ef60[_0x9b07('0x17')]['message']);}})[_0x9b07('0x18')](function(_0x1cddd5){logger[_0x9b07('0x13')](_0x9b07('0x15'),_0x54d030,_0x1cddd5);_0x525492(_0x1cddd5);});});} \ No newline at end of file +var _0x8e63=['message','request\x20sent','result','catch','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x282a1f,_0x49a6ef){var _0x296ea7=function(_0x4bac68){while(--_0x4bac68){_0x282a1f['push'](_0x282a1f['shift']());}};_0x296ea7(++_0x49a6ef);}(_0x8e63,0x7c));var _0x38e6=function(_0x2586ea,_0x3a1405){_0x2586ea=_0x2586ea-0x0;var _0x45d451=_0x8e63[_0x2586ea];return _0x45d451;};'use strict';var _=require('lodash');var util=require(_0x38e6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x38e6('0x1'));var fs=require('fs');var Redis=require(_0x38e6('0x2'));var db=require(_0x38e6('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x38e6('0x4'));var config=require(_0x38e6('0x5'));var jayson=require(_0x38e6('0x6'));var client=jayson['client'][_0x38e6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19e7be,_0x9dd996,_0x315953){return new BPromise(function(_0x51b586,_0x55abdf){return client[_0x38e6('0x8')](_0x19e7be,_0x315953)[_0x38e6('0x9')](function(_0x1a4c20){logger[_0x38e6('0xa')](_0x38e6('0xb'),_0x9dd996,'request\x20sent');logger['debug'](_0x38e6('0xc'),_0x9dd996,'request\x20sent',JSON[_0x38e6('0xd')](_0x1a4c20));if(_0x1a4c20['error']){if(_0x1a4c20[_0x38e6('0xe')][_0x38e6('0xf')]===0x1f4){logger[_0x38e6('0xe')](_0x38e6('0xb'),_0x9dd996,_0x1a4c20[_0x38e6('0xe')]['message']);return _0x55abdf(_0x1a4c20[_0x38e6('0xe')][_0x38e6('0x10')]);}logger['error'](_0x38e6('0xb'),_0x9dd996,_0x1a4c20[_0x38e6('0xe')][_0x38e6('0x10')]);return _0x51b586(_0x1a4c20[_0x38e6('0xe')][_0x38e6('0x10')]);}else{logger[_0x38e6('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x9dd996,_0x38e6('0x11'));_0x51b586(_0x1a4c20[_0x38e6('0x12')][_0x38e6('0x10')]);}})[_0x38e6('0x13')](function(_0x5f9d7e){logger['error'](_0x38e6('0xb'),_0x9dd996,_0x5f9d7e);_0x55abdf(_0x5f9d7e);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index fffc353..d4f29e2 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 _0x5f66=['show','post','create','put','update','delete','/:id','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','index'];(function(_0x2c11f9,_0x47c243){var _0x472972=function(_0x413427){while(--_0x413427){_0x2c11f9['push'](_0x2c11f9['shift']());}};_0x472972(++_0x47c243);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'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 auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/:id',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')]('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0xb')]);router[_0x65f6('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xf'),auth[_0x65f6('0x7')](),controller['destroy']);module[_0x65f6('0x10')]=router; \ No newline at end of file +var _0x1c7c=['Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0x3730f5,_0x372a43){var _0x23321a=function(_0xe9c761){while(--_0xe9c761){_0x3730f5['push'](_0x3730f5['shift']());}};_0x23321a(++_0x372a43);}(_0x1c7c,0x164));var _0xc1c7=function(_0x2495a1,_0x5d0f52){_0x2495a1=_0x2495a1-0x0;var _0x219460=_0x1c7c[_0x2495a1];return _0x219460;};'use strict';var multer=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var path=require(_0xc1c7('0x2'));var timeout=require(_0xc1c7('0x3'));var express=require('express');var router=express[_0xc1c7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc1c7('0x5'));var config=require(_0xc1c7('0x6'));var controller=require(_0xc1c7('0x7'));router[_0xc1c7('0x8')]('/',auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xa')]);router[_0xc1c7('0x8')](_0xc1c7('0xb'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xc')]);router[_0xc1c7('0xd')]('/',auth[_0xc1c7('0x9')](),controller[_0xc1c7('0xe')]);router[_0xc1c7('0xf')](_0xc1c7('0xb'),auth[_0xc1c7('0x9')](),controller[_0xc1c7('0x10')]);router['delete'](_0xc1c7('0xb'),auth[_0xc1c7('0x9')](),controller['destroy']);module[_0xc1c7('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 0efd4c1..fcb2f93 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 _0xf4dd=['TEXT','sequelize','exports'];(function(_0x4bb2a7,_0x4bae2c){var _0x484fa4=function(_0x3c09a7){while(--_0x3c09a7){_0x4bb2a7['push'](_0x4bb2a7['shift']());}};_0x484fa4(++_0x4bae2c);}(_0xf4dd,0x169));var _0xdf4d=function(_0x276c6d,_0x3cf3be){_0x276c6d=_0x276c6d-0x0;var _0x3d7715=_0xf4dd[_0x276c6d];return _0x3d7715;};'use strict';var Sequelize=require(_0xdf4d('0x0'));module[_0xdf4d('0x1')]={'tree':{'type':Sequelize[_0xdf4d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xee6f=['TEXT','exports'];(function(_0x434543,_0x2fd498){var _0x3e6749=function(_0x5956f7){while(--_0x5956f7){_0x434543['push'](_0x434543['shift']());}};_0x3e6749(++_0x2fd498);}(_0xee6f,0xf9));var _0xfee6=function(_0x8f617,_0x791259){_0x8f617=_0x8f617-0x0;var _0x295342=_0xee6f[_0x8f617];return _0x295342;};'use strict';var Sequelize=require('sequelize');module[_0xfee6('0x0')]={'tree':{'type':Sequelize[_0xfee6('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 5c1f8c9..479f3fd 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 _0x57e8=['../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','error','stack','name','index','AnalyticTreeReport','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','then','includeAll','include','findAll','rows','params','intersection','find','create','body','catch','update','destroy','eml-format','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x282ff9,_0x268bfe){var _0x542612=function(_0x4ad95c){while(--_0x4ad95c){_0x282ff9['push'](_0x282ff9['shift']());}};_0x542612(++_0x268bfe);}(_0x57e8,0x10a));var _0x857e=function(_0x4ead39,_0x51816f){_0x4ead39=_0x4ead39-0x0;var _0x1fd1e6=_0x57e8[_0x4ead39];return _0x1fd1e6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x857e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x857e('0x1'));var moment=require('moment');var BPromise=require(_0x857e('0x2'));var Mustache=require(_0x857e('0x3'));var util=require(_0x857e('0x4'));var path=require('path');var sox=require(_0x857e('0x5'));var csv=require(_0x857e('0x6'));var ejs=require(_0x857e('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x857e('0x8'));var crypto=require(_0x857e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x857e('0xa'));var toCsv=require(_0x857e('0x6'));var querystring=require(_0x857e('0xb'));var Papa=require(_0x857e('0xc'));var authService=require(_0x857e('0xd'));var hardwareService=require(_0x857e('0xe'));var Redis=require(_0x857e('0xf'));var qs=require(_0x857e('0x10'));var logger=require('../../config/logger')(_0x857e('0x11'));var utils=require(_0x857e('0x12'));var config=require(_0x857e('0x13'));var db=require(_0x857e('0x14'))['db'];function respondWithStatusCode(_0x555d72,_0x74801f){_0x74801f=_0x74801f||0xcc;return function(_0x1cc44b){if(_0x1cc44b){return _0x555d72[_0x857e('0x15')](_0x74801f);}return _0x555d72[_0x857e('0x16')](_0x74801f)[_0x857e('0x17')]();};}function respondWithResult(_0x151822,_0x25e3ce){_0x25e3ce=_0x25e3ce||0xc8;return function(_0x294736){if(_0x294736){return _0x151822[_0x857e('0x16')](_0x25e3ce)[_0x857e('0x18')](_0x294736);}};}function respondWithFilteredResult(_0xd28c38,_0x3e6b48){return function(_0x4710cb){if(_0x4710cb){var _0x2c5965=_0x4710cb[_0x857e('0x19')],_0x25e981=_0x3e6b48['offset'],_0x3b4cf3=_0x3e6b48[_0x857e('0x1a')]+_0x3e6b48[_0x857e('0x1b')],_0x3bafc2;if(_0x3b4cf3>=_0x2c5965){_0x3b4cf3=_0x2c5965;_0x3bafc2=0xc8;}else{_0x3bafc2=0xce;}_0xd28c38[_0x857e('0x16')](_0x3bafc2);return _0xd28c38['set'](_0x857e('0x1c'),_0x25e981+'-'+_0x3b4cf3+'/'+_0x2c5965)[_0x857e('0x18')](_0x4710cb);}return null;};}function patchUpdates(_0x12e73e){return function(_0x52af35){try{jsonpatch['apply'](_0x52af35,_0x12e73e,!![]);}catch(_0x35d35b){return BPromise[_0x857e('0x1d')](_0x35d35b);}return _0x52af35[_0x857e('0x1e')]();};}function saveUpdates(_0x252601,_0x346630){return function(_0x23d094){if(_0x23d094){return _0x23d094['update'](_0x252601)['then'](function(_0x2dc582){return _0x2dc582;});}return null;};}function removeEntity(_0x1b49ec,_0x3a54e9){return function(_0x1ec2c3){if(_0x1ec2c3){return _0x1ec2c3['destroy']()['then'](function(){_0x1b49ec[_0x857e('0x16')](0xcc)[_0x857e('0x17')]();});}};}function handleEntityNotFound(_0x2ac302,_0x4b7f5d){return function(_0x54b728){if(!_0x54b728){_0x2ac302[_0x857e('0x15')](0x194);}return _0x54b728;};}function handleError(_0x66b55,_0x414d0d){_0x414d0d=_0x414d0d||0x1f4;return function(_0x5eb374){logger[_0x857e('0x1f')](_0x5eb374[_0x857e('0x20')]);if(_0x5eb374[_0x857e('0x21')]){delete _0x5eb374[_0x857e('0x21')];}_0x66b55[_0x857e('0x16')](_0x414d0d)['send'](_0x5eb374);};}exports[_0x857e('0x22')]=function(_0x53f497,_0x94b7c4){var _0x33b823={},_0x58febc={},_0x3d3552={'count':0x0,'rows':[]};var _0x4bf908=db[_0x857e('0x23')]['rawAttributes'];_0x58febc[_0x857e('0x24')]=_[_0x857e('0x25')](_0x4bf908);_0x58febc['query']=_[_0x857e('0x25')](_0x53f497[_0x857e('0x26')]);_0x58febc[_0x857e('0x27')]=_['intersection'](_0x58febc['model'],_0x58febc[_0x857e('0x26')]);_0x33b823[_0x857e('0x28')]=_['intersection'](_0x58febc[_0x857e('0x24')],qs[_0x857e('0x29')](_0x53f497[_0x857e('0x26')]['fields']));_0x33b823[_0x857e('0x28')]=_0x33b823[_0x857e('0x28')][_0x857e('0x2a')]?_0x33b823['attributes']:_0x58febc[_0x857e('0x24')];if(!_0x53f497[_0x857e('0x26')][_0x857e('0x2b')](_0x857e('0x2c'))){_0x33b823[_0x857e('0x1b')]=qs[_0x857e('0x1b')](_0x53f497[_0x857e('0x26')][_0x857e('0x1b')]);_0x33b823[_0x857e('0x1a')]=qs[_0x857e('0x1a')](_0x53f497[_0x857e('0x26')][_0x857e('0x1a')]);}_0x33b823[_0x857e('0x2d')]=qs[_0x857e('0x2e')](_0x53f497[_0x857e('0x26')]['sort']);_0x33b823[_0x857e('0x2f')]=qs[_0x857e('0x27')](_[_0x857e('0x30')](_0x53f497[_0x857e('0x26')],_0x58febc['filters']));if(_0x53f497['query'][_0x857e('0x31')]){_0x33b823['where']=_[_0x857e('0x32')](_0x33b823['where'],{'$or':_[_0x857e('0x33')](_0x4bf908,function(_0x2aa723){if(_0x2aa723[_0x857e('0x34')][_0x857e('0x35')]!==_0x857e('0x36')){var _0x331dd4={};_0x331dd4[_0x2aa723[_0x857e('0x37')]]={'$like':'%'+_0x53f497['query'][_0x857e('0x31')]+'%'};return _0x331dd4;}})});}_0x33b823=_[_0x857e('0x32')]({},_0x33b823,_0x53f497[_0x857e('0x38')]);var _0x15b372={'where':_0x33b823['where']};return db[_0x857e('0x23')][_0x857e('0x19')](_0x15b372)[_0x857e('0x39')](function(_0x37045e){_0x3d3552['count']=_0x37045e;if(_0x53f497[_0x857e('0x26')][_0x857e('0x3a')]){_0x33b823[_0x857e('0x3b')]=[{'all':!![]}];}return db[_0x857e('0x23')][_0x857e('0x3c')](_0x33b823);})['then'](function(_0x497145){_0x3d3552[_0x857e('0x3d')]=_0x497145;return _0x3d3552;})[_0x857e('0x39')](respondWithFilteredResult(_0x94b7c4,_0x33b823))['catch'](handleError(_0x94b7c4,null));};exports['show']=function(_0x3f5076,_0x170cc2){var _0x50a96e={'raw':!![],'where':{'id':_0x3f5076[_0x857e('0x3e')]['id']}},_0x5a0071={};_0x5a0071[_0x857e('0x24')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x5a0071[_0x857e('0x26')]=_[_0x857e('0x25')](_0x3f5076[_0x857e('0x26')]);_0x5a0071[_0x857e('0x27')]=_[_0x857e('0x3f')](_0x5a0071[_0x857e('0x24')],_0x5a0071[_0x857e('0x26')]);_0x50a96e['attributes']=_[_0x857e('0x3f')](_0x5a0071['model'],qs[_0x857e('0x29')](_0x3f5076[_0x857e('0x26')][_0x857e('0x29')]));_0x50a96e[_0x857e('0x28')]=_0x50a96e['attributes']['length']?_0x50a96e[_0x857e('0x28')]:_0x5a0071['model'];if(_0x3f5076[_0x857e('0x26')][_0x857e('0x3a')]){_0x50a96e['include']=[{'all':!![]}];}_0x50a96e=_[_0x857e('0x32')]({},_0x50a96e,_0x3f5076[_0x857e('0x38')]);return db['AnalyticTreeReport'][_0x857e('0x40')](_0x50a96e)['then'](handleEntityNotFound(_0x170cc2,null))[_0x857e('0x39')](respondWithResult(_0x170cc2,null))['catch'](handleError(_0x170cc2,null));};exports[_0x857e('0x41')]=function(_0x86092f,_0x180607){return db[_0x857e('0x23')]['create'](_0x86092f[_0x857e('0x42')],{})[_0x857e('0x39')](respondWithResult(_0x180607,0xc9))[_0x857e('0x43')](handleError(_0x180607,null));};exports[_0x857e('0x44')]=function(_0x1206fa,_0x2523d8){if(_0x1206fa[_0x857e('0x42')]['id']){delete _0x1206fa[_0x857e('0x42')]['id'];}return db[_0x857e('0x23')]['find']({'where':{'id':_0x1206fa[_0x857e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2523d8,null))[_0x857e('0x39')](saveUpdates(_0x1206fa['body'],null))[_0x857e('0x39')](respondWithResult(_0x2523d8,null))[_0x857e('0x43')](handleError(_0x2523d8,null));};exports[_0x857e('0x45')]=function(_0x48bcd7,_0x241a41){return db[_0x857e('0x23')][_0x857e('0x40')]({'where':{'id':_0x48bcd7[_0x857e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x241a41,null))['then'](removeEntity(_0x241a41,null))[_0x857e('0x43')](handleError(_0x241a41,null));}; \ No newline at end of file +var _0x777d=['error','stack','name','send','index','AnalyticTreeReport','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','map','type','VIRTUAL','field','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0x777d,0x1e0));var _0xd777=function(_0x55a802,_0x10ab3a){_0x55a802=_0x55a802-0x0;var _0x1a0461=_0x777d[_0x55a802];return _0x1a0461;};'use strict';var pdf=require(_0xd777('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd777('0x1'));var zipdir=require(_0xd777('0x2'));var jsonpatch=require(_0xd777('0x3'));var rp=require(_0xd777('0x4'));var moment=require(_0xd777('0x5'));var BPromise=require(_0xd777('0x6'));var Mustache=require(_0xd777('0x7'));var util=require(_0xd777('0x8'));var path=require(_0xd777('0x9'));var sox=require(_0xd777('0xa'));var csv=require(_0xd777('0xb'));var ejs=require(_0xd777('0xc'));var fs=require('fs');var _=require(_0xd777('0xd'));var squel=require(_0xd777('0xe'));var crypto=require(_0xd777('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd777('0x10'));var toCsv=require(_0xd777('0xb'));var querystring=require(_0xd777('0x11'));var Papa=require('papaparse');var authService=require(_0xd777('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xd777('0x13'));var logger=require(_0xd777('0x14'))('api');var utils=require(_0xd777('0x15'));var config=require(_0xd777('0x16'));var db=require(_0xd777('0x17'))['db'];function respondWithStatusCode(_0x3961d8,_0x17254d){_0x17254d=_0x17254d||0xcc;return function(_0x41fa4c){if(_0x41fa4c){return _0x3961d8[_0xd777('0x18')](_0x17254d);}return _0x3961d8[_0xd777('0x19')](_0x17254d)[_0xd777('0x1a')]();};}function respondWithResult(_0x37e51c,_0x24b1dd){_0x24b1dd=_0x24b1dd||0xc8;return function(_0x5db3ac){if(_0x5db3ac){return _0x37e51c[_0xd777('0x19')](_0x24b1dd)[_0xd777('0x1b')](_0x5db3ac);}};}function respondWithFilteredResult(_0x11c5b1,_0x3e128f){return function(_0x305a43){if(_0x305a43){var _0xee593=_0x305a43[_0xd777('0x1c')],_0x44f8b7=_0x3e128f[_0xd777('0x1d')],_0xa71a3e=_0x3e128f['offset']+_0x3e128f[_0xd777('0x1e')],_0x3c0839;if(_0xa71a3e>=_0xee593){_0xa71a3e=_0xee593;_0x3c0839=0xc8;}else{_0x3c0839=0xce;}_0x11c5b1['status'](_0x3c0839);return _0x11c5b1['set'](_0xd777('0x1f'),_0x44f8b7+'-'+_0xa71a3e+'/'+_0xee593)[_0xd777('0x1b')](_0x305a43);}return null;};}function patchUpdates(_0x350a98){return function(_0x1fd3ea){try{jsonpatch[_0xd777('0x20')](_0x1fd3ea,_0x350a98,!![]);}catch(_0x11679b){return BPromise[_0xd777('0x21')](_0x11679b);}return _0x1fd3ea[_0xd777('0x22')]();};}function saveUpdates(_0x2bfb61,_0x5d0372){return function(_0x27a4fe){if(_0x27a4fe){return _0x27a4fe[_0xd777('0x23')](_0x2bfb61)[_0xd777('0x24')](function(_0x2c5c5c){return _0x2c5c5c;});}return null;};}function removeEntity(_0x20c2cc,_0x318afe){return function(_0x5196cd){if(_0x5196cd){return _0x5196cd[_0xd777('0x25')]()[_0xd777('0x24')](function(){_0x20c2cc['status'](0xcc)[_0xd777('0x1a')]();});}};}function handleEntityNotFound(_0x4a9dca,_0x11a156){return function(_0x180069){if(!_0x180069){_0x4a9dca[_0xd777('0x18')](0x194);}return _0x180069;};}function handleError(_0x425c53,_0x692128){_0x692128=_0x692128||0x1f4;return function(_0x145be0){logger[_0xd777('0x26')](_0x145be0[_0xd777('0x27')]);if(_0x145be0[_0xd777('0x28')]){delete _0x145be0['name'];}_0x425c53[_0xd777('0x19')](_0x692128)[_0xd777('0x29')](_0x145be0);};}exports[_0xd777('0x2a')]=function(_0x2da21c,_0x2fdb0a){var _0x539a07={},_0xc64b91={},_0x3b7853={'count':0x0,'rows':[]};var _0x3f3d7c=db[_0xd777('0x2b')]['rawAttributes'];_0xc64b91[_0xd777('0x2c')]=_['keys'](_0x3f3d7c);_0xc64b91[_0xd777('0x2d')]=_['keys'](_0x2da21c[_0xd777('0x2d')]);_0xc64b91[_0xd777('0x2e')]=_[_0xd777('0x2f')](_0xc64b91[_0xd777('0x2c')],_0xc64b91[_0xd777('0x2d')]);_0x539a07[_0xd777('0x30')]=_['intersection'](_0xc64b91['model'],qs[_0xd777('0x31')](_0x2da21c[_0xd777('0x2d')]['fields']));_0x539a07[_0xd777('0x30')]=_0x539a07[_0xd777('0x30')][_0xd777('0x32')]?_0x539a07[_0xd777('0x30')]:_0xc64b91['model'];if(!_0x2da21c[_0xd777('0x2d')]['hasOwnProperty'](_0xd777('0x33'))){_0x539a07['limit']=qs[_0xd777('0x1e')](_0x2da21c[_0xd777('0x2d')][_0xd777('0x1e')]);_0x539a07[_0xd777('0x1d')]=qs[_0xd777('0x1d')](_0x2da21c[_0xd777('0x2d')][_0xd777('0x1d')]);}_0x539a07[_0xd777('0x34')]=qs[_0xd777('0x35')](_0x2da21c[_0xd777('0x2d')][_0xd777('0x35')]);_0x539a07['where']=qs[_0xd777('0x2e')](_['pick'](_0x2da21c['query'],_0xc64b91[_0xd777('0x2e')]));if(_0x2da21c['query'][_0xd777('0x36')]){_0x539a07[_0xd777('0x37')]=_['merge'](_0x539a07[_0xd777('0x37')],{'$or':_[_0xd777('0x38')](_0x3f3d7c,function(_0x3ecfbf){if(_0x3ecfbf[_0xd777('0x39')]['key']!==_0xd777('0x3a')){var _0x5708c2={};_0x5708c2[_0x3ecfbf[_0xd777('0x3b')]]={'$like':'%'+_0x2da21c[_0xd777('0x2d')][_0xd777('0x36')]+'%'};return _0x5708c2;}})});}_0x539a07=_[_0xd777('0x3c')]({},_0x539a07,_0x2da21c[_0xd777('0x3d')]);var _0x5df60a={'where':_0x539a07[_0xd777('0x37')]};return db['AnalyticTreeReport'][_0xd777('0x1c')](_0x5df60a)[_0xd777('0x24')](function(_0x15559e){_0x3b7853['count']=_0x15559e;if(_0x2da21c['query'][_0xd777('0x3e')]){_0x539a07['include']=[{'all':!![]}];}return db[_0xd777('0x2b')][_0xd777('0x3f')](_0x539a07);})[_0xd777('0x24')](function(_0x4d456c){_0x3b7853[_0xd777('0x40')]=_0x4d456c;return _0x3b7853;})['then'](respondWithFilteredResult(_0x2fdb0a,_0x539a07))[_0xd777('0x41')](handleError(_0x2fdb0a,null));};exports[_0xd777('0x42')]=function(_0x5c2398,_0x2b67b9){var _0x3284a4={'raw':!![],'where':{'id':_0x5c2398[_0xd777('0x43')]['id']}},_0x213791={};_0x213791[_0xd777('0x2c')]=_[_0xd777('0x44')](db['AnalyticTreeReport'][_0xd777('0x45')]);_0x213791[_0xd777('0x2d')]=_[_0xd777('0x44')](_0x5c2398[_0xd777('0x2d')]);_0x213791[_0xd777('0x2e')]=_[_0xd777('0x2f')](_0x213791['model'],_0x213791['query']);_0x3284a4[_0xd777('0x30')]=_[_0xd777('0x2f')](_0x213791[_0xd777('0x2c')],qs[_0xd777('0x31')](_0x5c2398[_0xd777('0x2d')]['fields']));_0x3284a4[_0xd777('0x30')]=_0x3284a4[_0xd777('0x30')][_0xd777('0x32')]?_0x3284a4[_0xd777('0x30')]:_0x213791[_0xd777('0x2c')];if(_0x5c2398[_0xd777('0x2d')][_0xd777('0x3e')]){_0x3284a4[_0xd777('0x46')]=[{'all':!![]}];}_0x3284a4=_[_0xd777('0x3c')]({},_0x3284a4,_0x5c2398[_0xd777('0x3d')]);return db['AnalyticTreeReport'][_0xd777('0x47')](_0x3284a4)[_0xd777('0x24')](handleEntityNotFound(_0x2b67b9,null))[_0xd777('0x24')](respondWithResult(_0x2b67b9,null))[_0xd777('0x41')](handleError(_0x2b67b9,null));};exports[_0xd777('0x48')]=function(_0x22214e,_0x224c0e){return db['AnalyticTreeReport'][_0xd777('0x48')](_0x22214e[_0xd777('0x49')],{})['then'](respondWithResult(_0x224c0e,0xc9))[_0xd777('0x41')](handleError(_0x224c0e,null));};exports[_0xd777('0x23')]=function(_0x571223,_0x326469){if(_0x571223[_0xd777('0x49')]['id']){delete _0x571223[_0xd777('0x49')]['id'];}return db['AnalyticTreeReport'][_0xd777('0x47')]({'where':{'id':_0x571223[_0xd777('0x43')]['id']}})[_0xd777('0x24')](handleEntityNotFound(_0x326469,null))['then'](saveUpdates(_0x571223[_0xd777('0x49')],null))[_0xd777('0x24')](respondWithResult(_0x326469,null))[_0xd777('0x41')](handleError(_0x326469,null));};exports[_0xd777('0x25')]=function(_0x1747c5,_0x4914c5){return db[_0xd777('0x2b')][_0xd777('0x47')]({'where':{'id':_0x1747c5[_0xd777('0x43')]['id']}})[_0xd777('0x24')](handleEntityNotFound(_0x4914c5,null))['then'](removeEntity(_0x4914c5,null))[_0xd777('0x41')](handleError(_0x4914c5,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index f985c39..7960d39 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 _0x7248=['request-promise','exports','define','AnalyticTreeReport','lodash','../../config/logger','api','bluebird'];(function(_0x2d79f4,_0xdd2c29){var _0x8fa7b3=function(_0x5ac1b8){while(--_0x5ac1b8){_0x2d79f4['push'](_0x2d79f4['shift']());}};_0x8fa7b3(++_0xdd2c29);}(_0x7248,0xcc));var _0x8724=function(_0x4bd8e1,_0x5e9388){_0x4bd8e1=_0x4bd8e1-0x0;var _0x286282=_0x7248[_0x4bd8e1];return _0x286282;};'use strict';var _=require(_0x8724('0x0'));var util=require('util');var logger=require(_0x8724('0x1'))(_0x8724('0x2'));var moment=require('moment');var BPromise=require(_0x8724('0x3'));var rp=require(_0x8724('0x4'));var attributes=require('./analyticTreeReport.attributes');module[_0x8724('0x5')]=function(_0x4f4480,_0x2642ae){return _0x4f4480[_0x8724('0x6')](_0x8724('0x7'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe705=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe705,0x89));var _0x5e70=function(_0x295fe9,_0x345828){_0x295fe9=_0x295fe9-0x0;var _0x3b80df=_0xe705[_0x295fe9];return _0x3b80df;};'use strict';var _=require(_0x5e70('0x0'));var util=require('util');var logger=require(_0x5e70('0x1'))(_0x5e70('0x2'));var moment=require(_0x5e70('0x3'));var BPromise=require(_0x5e70('0x4'));var rp=require(_0x5e70('0x5'));var attributes=require(_0x5e70('0x6'));module[_0x5e70('0x7')]=function(_0x24f79b,_0x124e37){return _0x24f79b[_0x5e70('0x8')](_0x5e70('0x9'),attributes,{'tableName':_0x5e70('0xa'),'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 e76f633..5916d2a 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 _0xad20=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','AnalyticTreeReport,\x20%s,\x20%s','result'];(function(_0x116518,_0x31ef07){var _0x3e62b5=function(_0x2c81aa){while(--_0x2c81aa){_0x116518['push'](_0x116518['shift']());}};_0x3e62b5(++_0x31ef07);}(_0xad20,0x8b));var _0x0ad2=function(_0x23ec3d,_0x5dad91){_0x23ec3d=_0x23ec3d-0x0;var _0x5767f4=_0xad20[_0x23ec3d];return _0x5767f4;};'use strict';var _=require(_0x0ad2('0x0'));var util=require('util');var moment=require(_0x0ad2('0x1'));var BPromise=require(_0x0ad2('0x2'));var rs=require(_0x0ad2('0x3'));var fs=require('fs');var Redis=require(_0x0ad2('0x4'));var db=require(_0x0ad2('0x5'))['db'];var utils=require(_0x0ad2('0x6'));var logger=require('../../config/logger')(_0x0ad2('0x7'));var config=require(_0x0ad2('0x8'));var jayson=require(_0x0ad2('0x9'));var client=jayson[_0x0ad2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b310f,_0x5dd6ac,_0x2201ce){return new BPromise(function(_0x326954,_0x4e2290){return client[_0x0ad2('0xb')](_0x2b310f,_0x2201ce)[_0x0ad2('0xc')](function(_0x1dd622){logger[_0x0ad2('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x5dd6ac,'request\x20sent');logger[_0x0ad2('0xe')](_0x0ad2('0xf'),_0x5dd6ac,_0x0ad2('0x10'),JSON['stringify'](_0x1dd622));if(_0x1dd622[_0x0ad2('0x11')]){if(_0x1dd622['error'][_0x0ad2('0x12')]===0x1f4){logger[_0x0ad2('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0x5dd6ac,_0x1dd622[_0x0ad2('0x11')][_0x0ad2('0x13')]);return _0x4e2290(_0x1dd622['error'][_0x0ad2('0x13')]);}logger[_0x0ad2('0x11')](_0x0ad2('0x14'),_0x5dd6ac,_0x1dd622[_0x0ad2('0x11')][_0x0ad2('0x13')]);return _0x326954(_0x1dd622[_0x0ad2('0x11')]['message']);}else{logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0x5dd6ac,'request\x20sent');_0x326954(_0x1dd622[_0x0ad2('0x15')]['message']);}})[_0x0ad2('0x16')](function(_0x49d4fa){logger[_0x0ad2('0x11')](_0x0ad2('0x14'),_0x5dd6ac,_0x49d4fa);_0x4e2290(_0x49d4fa);});});} \ No newline at end of file +var _0xcf2f=['message','result','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3753cb,_0x514352){var _0x12297c=function(_0x5e371c){while(--_0x5e371c){_0x3753cb['push'](_0x3753cb['shift']());}};_0x12297c(++_0x514352);}(_0xcf2f,0x106));var _0xfcf2=function(_0x3d2e52,_0x254b81){_0x3d2e52=_0x3d2e52-0x0;var _0x4a349b=_0xcf2f[_0x3d2e52];return _0x4a349b;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfcf2('0x3'));var logger=require(_0xfcf2('0x4'))(_0xfcf2('0x5'));var config=require(_0xfcf2('0x6'));var jayson=require(_0xfcf2('0x7'));var client=jayson[_0xfcf2('0x8')][_0xfcf2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27c194,_0x516ad1,_0x5c3583){return new BPromise(function(_0x18ec33,_0x292ce6){return client['request'](_0x27c194,_0x5c3583)[_0xfcf2('0xa')](function(_0x356c9d){logger[_0xfcf2('0xb')](_0xfcf2('0xc'),_0x516ad1,'request\x20sent');logger[_0xfcf2('0xd')](_0xfcf2('0xe'),_0x516ad1,_0xfcf2('0xf'),JSON['stringify'](_0x356c9d));if(_0x356c9d['error']){if(_0x356c9d[_0xfcf2('0x10')][_0xfcf2('0x11')]===0x1f4){logger[_0xfcf2('0x10')](_0xfcf2('0xc'),_0x516ad1,_0x356c9d['error'][_0xfcf2('0x12')]);return _0x292ce6(_0x356c9d[_0xfcf2('0x10')]['message']);}logger[_0xfcf2('0x10')](_0xfcf2('0xc'),_0x516ad1,_0x356c9d['error'][_0xfcf2('0x12')]);return _0x18ec33(_0x356c9d['error'][_0xfcf2('0x12')]);}else{logger[_0xfcf2('0xb')](_0xfcf2('0xc'),_0x516ad1,'request\x20sent');_0x18ec33(_0x356c9d[_0xfcf2('0x13')]['message']);}})['catch'](function(_0x51f75d){logger[_0xfcf2('0x10')](_0xfcf2('0xc'),_0x516ad1,_0x51f75d);_0x292ce6(_0x51f75d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 683b734..5f84bdf 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 _0x8e1c=['../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0x8e1c,0x11d));var _0xc8e1=function(_0x2dc154,_0x1a3464){_0x2dc154=_0x2dc154-0x0;var _0x329085=_0x8e1c[_0x2dc154];return _0x329085;};'use strict';var multer=require(_0xc8e1('0x0'));var util=require('util');var path=require(_0xc8e1('0x1'));var timeout=require('connect-timeout');var express=require(_0xc8e1('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc8e1('0x3'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0xc8e1('0x4')](),controller[_0xc8e1('0x5')]);router[_0xc8e1('0x6')](_0xc8e1('0x7'),auth[_0xc8e1('0x4')](),controller[_0xc8e1('0x8')]);router[_0xc8e1('0x9')]('/',auth[_0xc8e1('0x4')](),controller[_0xc8e1('0xa')]);router[_0xc8e1('0xb')](_0xc8e1('0x7'),auth[_0xc8e1('0x4')](),controller[_0xc8e1('0xc')]);router[_0xc8e1('0xd')]('/:id',auth[_0xc8e1('0x4')](),controller[_0xc8e1('0xe')]);module[_0xc8e1('0xf')]=router; \ No newline at end of file +var _0xb068=['multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb068,0xea));var _0x8b06=function(_0x41420f,_0x16e12f){_0x41420f=_0x41420f-0x0;var _0x3ed05d=_0xb068[_0x41420f];return _0x3ed05d;};'use strict';var multer=require(_0x8b06('0x0'));var util=require(_0x8b06('0x1'));var path=require(_0x8b06('0x2'));var timeout=require(_0x8b06('0x3'));var express=require(_0x8b06('0x4'));var router=express['Router']();var auth=require(_0x8b06('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b06('0x6'));var controller=require(_0x8b06('0x7'));router[_0x8b06('0x8')]('/',auth[_0x8b06('0x9')](),controller[_0x8b06('0xa')]);router[_0x8b06('0x8')]('/:id',auth[_0x8b06('0x9')](),controller[_0x8b06('0xb')]);router[_0x8b06('0xc')]('/',auth[_0x8b06('0x9')](),controller[_0x8b06('0xd')]);router[_0x8b06('0xe')](_0x8b06('0xf'),auth[_0x8b06('0x9')](),controller[_0x8b06('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8b06('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 4f2005e..e20926d 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 _0x5ba7=['exports','STRING','sequelize'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x5ba7,0x1a9));var _0x75ba=function(_0x27914b,_0x5df4be){_0x27914b=_0x27914b-0x0;var _0x1bb6a6=_0x5ba7[_0x27914b];return _0x1bb6a6;};'use strict';var Sequelize=require(_0x75ba('0x0'));module[_0x75ba('0x1')]={'name':{'type':Sequelize[_0x75ba('0x2')]},'basename':{'type':Sequelize[_0x75ba('0x2')]},'type':{'type':Sequelize[_0x75ba('0x2')]}}; \ No newline at end of file +var _0x83c2=['exports','STRING','sequelize'];(function(_0x4115cb,_0xd99479){var _0x59726e=function(_0x4102e7){while(--_0x4102e7){_0x4115cb['push'](_0x4115cb['shift']());}};_0x59726e(++_0xd99479);}(_0x83c2,0x155));var _0x283c=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x83c2[_0xf51c06];return _0x1d5420;};'use strict';var Sequelize=require(_0x283c('0x0'));module[_0x283c('0x1')]={'name':{'type':Sequelize[_0x283c('0x2')]},'basename':{'type':Sequelize[_0x283c('0x2')]},'type':{'type':Sequelize[_0x283c('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index a8edabb..0f71bf4 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 _0x8e60=['rawAttributes','keys','query','filters','attributes','intersection','fields','model','nolimit','sort','where','merge','map','key','VIRTUAL','filter','options','Attachment','includeAll','include','findAll','show','params','length','find','catch','body','create','file','originalname','filename','type','mimetype','download','findOne','join','root','server/files/attachments/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','Content-Range','save','update','destroy','then','error','stack','name','send','index'];(function(_0x4f6b91,_0x3be773){var _0x2ff9c6=function(_0x2353f6){while(--_0x2353f6){_0x4f6b91['push'](_0x4f6b91['shift']());}};_0x2ff9c6(++_0x3be773);}(_0x8e60,0x15b));var _0x08e6=function(_0xe5088b,_0x21f295){_0xe5088b=_0xe5088b-0x0;var _0x7ff7f5=_0x8e60[_0xe5088b];return _0x7ff7f5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x08e6('0x0'));var rimraf=require(_0x08e6('0x1'));var zipdir=require(_0x08e6('0x2'));var jsonpatch=require(_0x08e6('0x3'));var rp=require(_0x08e6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x08e6('0x5'));var util=require('util');var path=require(_0x08e6('0x6'));var sox=require(_0x08e6('0x7'));var csv=require(_0x08e6('0x8'));var ejs=require(_0x08e6('0x9'));var fs=require('fs');var _=require(_0x08e6('0xa'));var squel=require(_0x08e6('0xb'));var crypto=require(_0x08e6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x08e6('0xd'));var toCsv=require(_0x08e6('0x8'));var querystring=require(_0x08e6('0xe'));var Papa=require(_0x08e6('0xf'));var authService=require(_0x08e6('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x08e6('0x11'));var qs=require(_0x08e6('0x12'));var logger=require(_0x08e6('0x13'))(_0x08e6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x119efb,_0x55fbcb){_0x55fbcb=_0x55fbcb||0xcc;return function(_0x17d44a){if(_0x17d44a){return _0x119efb[_0x08e6('0x15')](_0x55fbcb);}return _0x119efb[_0x08e6('0x16')](_0x55fbcb)[_0x08e6('0x17')]();};}function respondWithResult(_0x120145,_0x3f2794){_0x3f2794=_0x3f2794||0xc8;return function(_0x50543b){if(_0x50543b){return _0x120145[_0x08e6('0x16')](_0x3f2794)[_0x08e6('0x18')](_0x50543b);}};}function respondWithFilteredResult(_0x450956,_0xa0ca10){return function(_0x46cd23){if(_0x46cd23){var _0x5d3e03=_0x46cd23[_0x08e6('0x19')],_0x280464=_0xa0ca10[_0x08e6('0x1a')],_0x2fba03=_0xa0ca10['offset']+_0xa0ca10[_0x08e6('0x1b')],_0x162669;if(_0x2fba03>=_0x5d3e03){_0x2fba03=_0x5d3e03;_0x162669=0xc8;}else{_0x162669=0xce;}_0x450956[_0x08e6('0x16')](_0x162669);return _0x450956['set'](_0x08e6('0x1c'),_0x280464+'-'+_0x2fba03+'/'+_0x5d3e03)['json'](_0x46cd23);}return null;};}function patchUpdates(_0x47ecf5){return function(_0x49b83a){try{jsonpatch['apply'](_0x49b83a,_0x47ecf5,!![]);}catch(_0x1422af){return BPromise['reject'](_0x1422af);}return _0x49b83a[_0x08e6('0x1d')]();};}function saveUpdates(_0x48c2ed,_0x1b8ffe){return function(_0x170362){if(_0x170362){return _0x170362[_0x08e6('0x1e')](_0x48c2ed)['then'](function(_0x3af767){return _0x3af767;});}return null;};}function removeEntity(_0x2400be,_0x4214e4){return function(_0x57187e){if(_0x57187e){return _0x57187e[_0x08e6('0x1f')]()[_0x08e6('0x20')](function(){_0x2400be[_0x08e6('0x16')](0xcc)[_0x08e6('0x17')]();});}};}function handleEntityNotFound(_0x4465ae,_0x3652eb){return function(_0x215b7b){if(!_0x215b7b){_0x4465ae[_0x08e6('0x15')](0x194);}return _0x215b7b;};}function handleError(_0x11d311,_0x3f49c8){_0x3f49c8=_0x3f49c8||0x1f4;return function(_0x841cf3){logger[_0x08e6('0x21')](_0x841cf3[_0x08e6('0x22')]);if(_0x841cf3[_0x08e6('0x23')]){delete _0x841cf3['name'];}_0x11d311[_0x08e6('0x16')](_0x3f49c8)[_0x08e6('0x24')](_0x841cf3);};}exports[_0x08e6('0x25')]=function(_0x237e73,_0x3656f1){var _0xedc9c8={},_0x20bb32={},_0x201b80={'count':0x0,'rows':[]};var _0x179178=db['Attachment'][_0x08e6('0x26')];_0x20bb32['model']=_[_0x08e6('0x27')](_0x179178);_0x20bb32['query']=_[_0x08e6('0x27')](_0x237e73[_0x08e6('0x28')]);_0x20bb32[_0x08e6('0x29')]=_['intersection'](_0x20bb32['model'],_0x20bb32['query']);_0xedc9c8[_0x08e6('0x2a')]=_[_0x08e6('0x2b')](_0x20bb32['model'],qs[_0x08e6('0x2c')](_0x237e73[_0x08e6('0x28')][_0x08e6('0x2c')]));_0xedc9c8['attributes']=_0xedc9c8[_0x08e6('0x2a')]['length']?_0xedc9c8[_0x08e6('0x2a')]:_0x20bb32[_0x08e6('0x2d')];if(!_0x237e73[_0x08e6('0x28')]['hasOwnProperty'](_0x08e6('0x2e'))){_0xedc9c8[_0x08e6('0x1b')]=qs[_0x08e6('0x1b')](_0x237e73[_0x08e6('0x28')][_0x08e6('0x1b')]);_0xedc9c8['offset']=qs[_0x08e6('0x1a')](_0x237e73[_0x08e6('0x28')]['offset']);}_0xedc9c8['order']=qs[_0x08e6('0x2f')](_0x237e73[_0x08e6('0x28')][_0x08e6('0x2f')]);_0xedc9c8[_0x08e6('0x30')]=qs[_0x08e6('0x29')](_['pick'](_0x237e73[_0x08e6('0x28')],_0x20bb32['filters']));if(_0x237e73['query']['filter']){_0xedc9c8[_0x08e6('0x30')]=_[_0x08e6('0x31')](_0xedc9c8[_0x08e6('0x30')],{'$or':_[_0x08e6('0x32')](_0x179178,function(_0x2b4ed0){if(_0x2b4ed0['type'][_0x08e6('0x33')]!==_0x08e6('0x34')){var _0x44d1c2={};_0x44d1c2[_0x2b4ed0['field']]={'$like':'%'+_0x237e73[_0x08e6('0x28')][_0x08e6('0x35')]+'%'};return _0x44d1c2;}})});}_0xedc9c8=_[_0x08e6('0x31')]({},_0xedc9c8,_0x237e73[_0x08e6('0x36')]);var _0x5e6952={'where':_0xedc9c8[_0x08e6('0x30')]};return db[_0x08e6('0x37')][_0x08e6('0x19')](_0x5e6952)[_0x08e6('0x20')](function(_0x2d34da){_0x201b80['count']=_0x2d34da;if(_0x237e73['query'][_0x08e6('0x38')]){_0xedc9c8[_0x08e6('0x39')]=[{'all':!![]}];}return db[_0x08e6('0x37')][_0x08e6('0x3a')](_0xedc9c8);})[_0x08e6('0x20')](function(_0x5077bd){_0x201b80['rows']=_0x5077bd;return _0x201b80;})[_0x08e6('0x20')](respondWithFilteredResult(_0x3656f1,_0xedc9c8))['catch'](handleError(_0x3656f1,null));};exports[_0x08e6('0x3b')]=function(_0x12d016,_0x301c4c){var _0x57e069={'raw':!![],'where':{'id':_0x12d016[_0x08e6('0x3c')]['id']}},_0x89ce4e={};_0x89ce4e[_0x08e6('0x2d')]=_[_0x08e6('0x27')](db[_0x08e6('0x37')][_0x08e6('0x26')]);_0x89ce4e['query']=_[_0x08e6('0x27')](_0x12d016[_0x08e6('0x28')]);_0x89ce4e[_0x08e6('0x29')]=_[_0x08e6('0x2b')](_0x89ce4e[_0x08e6('0x2d')],_0x89ce4e[_0x08e6('0x28')]);_0x57e069[_0x08e6('0x2a')]=_['intersection'](_0x89ce4e['model'],qs['fields'](_0x12d016['query'][_0x08e6('0x2c')]));_0x57e069[_0x08e6('0x2a')]=_0x57e069['attributes'][_0x08e6('0x3d')]?_0x57e069[_0x08e6('0x2a')]:_0x89ce4e[_0x08e6('0x2d')];if(_0x12d016[_0x08e6('0x28')][_0x08e6('0x38')]){_0x57e069[_0x08e6('0x39')]=[{'all':!![]}];}_0x57e069=_[_0x08e6('0x31')]({},_0x57e069,_0x12d016[_0x08e6('0x36')]);return db[_0x08e6('0x37')][_0x08e6('0x3e')](_0x57e069)[_0x08e6('0x20')](handleEntityNotFound(_0x301c4c,null))[_0x08e6('0x20')](respondWithResult(_0x301c4c,null))[_0x08e6('0x3f')](handleError(_0x301c4c,null));};exports['update']=function(_0x56257a,_0x1d55b6){if(_0x56257a[_0x08e6('0x40')]['id']){delete _0x56257a[_0x08e6('0x40')]['id'];}return db[_0x08e6('0x37')][_0x08e6('0x3e')]({'where':{'id':_0x56257a[_0x08e6('0x3c')]['id']}})[_0x08e6('0x20')](handleEntityNotFound(_0x1d55b6,null))[_0x08e6('0x20')](saveUpdates(_0x56257a[_0x08e6('0x40')],null))[_0x08e6('0x20')](respondWithResult(_0x1d55b6,null))[_0x08e6('0x3f')](handleError(_0x1d55b6,null));};exports[_0x08e6('0x1f')]=function(_0x3b1e3c,_0x21215d){return db[_0x08e6('0x37')]['find']({'where':{'id':_0x3b1e3c['params']['id']}})[_0x08e6('0x20')](handleEntityNotFound(_0x21215d,null))['then'](removeEntity(_0x21215d,null))['catch'](handleError(_0x21215d,null));};exports[_0x08e6('0x41')]=function(_0x32d07c,_0x28fdac,_0x35478c){_0x32d07c['body'][_0x08e6('0x23')]=_0x32d07c[_0x08e6('0x42')][_0x08e6('0x43')];_0x32d07c[_0x08e6('0x40')]['basename']=_0x32d07c[_0x08e6('0x42')][_0x08e6('0x44')];_0x32d07c[_0x08e6('0x40')][_0x08e6('0x45')]=_0x32d07c['file'][_0x08e6('0x46')];return db[_0x08e6('0x37')][_0x08e6('0x41')](_0x32d07c[_0x08e6('0x40')])[_0x08e6('0x20')](respondWithResult(_0x28fdac,0xc9))[_0x08e6('0x3f')](handleError(_0x28fdac,null));};exports[_0x08e6('0x47')]=function(_0x93b3e7,_0x17fa89,_0x47133b){return db[_0x08e6('0x37')][_0x08e6('0x48')]({'where':{'id':_0x93b3e7[_0x08e6('0x3c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x17fa89,null))[_0x08e6('0x20')](function(_0x56b81b){if(_0x56b81b){return _0x17fa89[_0x08e6('0x47')](path[_0x08e6('0x49')](config[_0x08e6('0x4a')],_0x08e6('0x4b'),_0x56b81b[_0x08e6('0x4c')]));}})['catch'](handleError(_0x17fa89,null));}; \ No newline at end of file +var _0x648c=['limit','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','Attachment','includeAll','include','findAll','rows','catch','show','rawAttributes','body','params','find','file','originalname','filename','mimetype','create','findOne','join','root','server/files/attachments/','basename','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset'];(function(_0x13c557,_0x4e8256){var _0x206c6b=function(_0x4999b0){while(--_0x4999b0){_0x13c557['push'](_0x13c557['shift']());}};_0x206c6b(++_0x4e8256);}(_0x648c,0x86));var _0xc648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x648c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc648('0x0'));var emlformat=require(_0xc648('0x1'));var rimraf=require(_0xc648('0x2'));var zipdir=require(_0xc648('0x3'));var jsonpatch=require(_0xc648('0x4'));var rp=require(_0xc648('0x5'));var moment=require(_0xc648('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc648('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc648('0x8'));var ejs=require(_0xc648('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc648('0xa'));var crypto=require('crypto');var jsforce=require(_0xc648('0xb'));var deskjs=require(_0xc648('0xc'));var toCsv=require(_0xc648('0x8'));var querystring=require(_0xc648('0xd'));var Papa=require(_0xc648('0xe'));var authService=require(_0xc648('0xf'));var hardwareService=require(_0xc648('0x10'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xc648('0x11'))(_0xc648('0x12'));var utils=require(_0xc648('0x13'));var config=require(_0xc648('0x14'));var db=require(_0xc648('0x15'))['db'];function respondWithStatusCode(_0x5a8dd6,_0xfdf403){_0xfdf403=_0xfdf403||0xcc;return function(_0x2a945a){if(_0x2a945a){return _0x5a8dd6[_0xc648('0x16')](_0xfdf403);}return _0x5a8dd6[_0xc648('0x17')](_0xfdf403)['end']();};}function respondWithResult(_0x298c9f,_0x9f3c22){_0x9f3c22=_0x9f3c22||0xc8;return function(_0x1aafc8){if(_0x1aafc8){return _0x298c9f[_0xc648('0x17')](_0x9f3c22)['json'](_0x1aafc8);}};}function respondWithFilteredResult(_0x2373f5,_0x39a571){return function(_0x43fff5){if(_0x43fff5){var _0x4f377a=_0x43fff5[_0xc648('0x18')],_0x57175e=_0x39a571[_0xc648('0x19')],_0xb7e829=_0x39a571[_0xc648('0x19')]+_0x39a571[_0xc648('0x1a')],_0x3bcb97;if(_0xb7e829>=_0x4f377a){_0xb7e829=_0x4f377a;_0x3bcb97=0xc8;}else{_0x3bcb97=0xce;}_0x2373f5[_0xc648('0x17')](_0x3bcb97);return _0x2373f5[_0xc648('0x1b')](_0xc648('0x1c'),_0x57175e+'-'+_0xb7e829+'/'+_0x4f377a)['json'](_0x43fff5);}return null;};}function patchUpdates(_0x1e3fb5){return function(_0x27e0be){try{jsonpatch['apply'](_0x27e0be,_0x1e3fb5,!![]);}catch(_0x2c86e6){return BPromise[_0xc648('0x1d')](_0x2c86e6);}return _0x27e0be[_0xc648('0x1e')]();};}function saveUpdates(_0x502852,_0x470f00){return function(_0x2fad53){if(_0x2fad53){return _0x2fad53[_0xc648('0x1f')](_0x502852)[_0xc648('0x20')](function(_0x2ac49c){return _0x2ac49c;});}return null;};}function removeEntity(_0x1db57d,_0x24c829){return function(_0x814179){if(_0x814179){return _0x814179[_0xc648('0x21')]()[_0xc648('0x20')](function(){_0x1db57d[_0xc648('0x17')](0xcc)[_0xc648('0x22')]();});}};}function handleEntityNotFound(_0x946d99,_0x2bbab9){return function(_0xc8617e){if(!_0xc8617e){_0x946d99[_0xc648('0x16')](0x194);}return _0xc8617e;};}function handleError(_0x55dc01,_0x21faf4){_0x21faf4=_0x21faf4||0x1f4;return function(_0x486a85){logger[_0xc648('0x23')](_0x486a85['stack']);if(_0x486a85[_0xc648('0x24')]){delete _0x486a85[_0xc648('0x24')];}_0x55dc01[_0xc648('0x17')](_0x21faf4)[_0xc648('0x25')](_0x486a85);};}exports[_0xc648('0x26')]=function(_0xb4fca5,_0x5caa04){var _0x58bcb2={},_0x47df9d={},_0x279c45={'count':0x0,'rows':[]};var _0x22710e=db['Attachment']['rawAttributes'];_0x47df9d[_0xc648('0x27')]=_[_0xc648('0x28')](_0x22710e);_0x47df9d[_0xc648('0x29')]=_[_0xc648('0x28')](_0xb4fca5['query']);_0x47df9d[_0xc648('0x2a')]=_[_0xc648('0x2b')](_0x47df9d[_0xc648('0x27')],_0x47df9d[_0xc648('0x29')]);_0x58bcb2[_0xc648('0x2c')]=_['intersection'](_0x47df9d[_0xc648('0x27')],qs['fields'](_0xb4fca5[_0xc648('0x29')][_0xc648('0x2d')]));_0x58bcb2[_0xc648('0x2c')]=_0x58bcb2[_0xc648('0x2c')][_0xc648('0x2e')]?_0x58bcb2['attributes']:_0x47df9d[_0xc648('0x27')];if(!_0xb4fca5['query']['hasOwnProperty'](_0xc648('0x2f'))){_0x58bcb2['limit']=qs['limit'](_0xb4fca5['query'][_0xc648('0x1a')]);_0x58bcb2[_0xc648('0x19')]=qs[_0xc648('0x19')](_0xb4fca5[_0xc648('0x29')][_0xc648('0x19')]);}_0x58bcb2[_0xc648('0x30')]=qs[_0xc648('0x31')](_0xb4fca5[_0xc648('0x29')]['sort']);_0x58bcb2[_0xc648('0x32')]=qs[_0xc648('0x2a')](_[_0xc648('0x33')](_0xb4fca5[_0xc648('0x29')],_0x47df9d[_0xc648('0x2a')]));if(_0xb4fca5['query'][_0xc648('0x34')]){_0x58bcb2[_0xc648('0x32')]=_[_0xc648('0x35')](_0x58bcb2['where'],{'$or':_[_0xc648('0x36')](_0x22710e,function(_0x4be5ec){if(_0x4be5ec[_0xc648('0x37')]['key']!==_0xc648('0x38')){var _0x4c1ce6={};_0x4c1ce6[_0x4be5ec[_0xc648('0x39')]]={'$like':'%'+_0xb4fca5[_0xc648('0x29')][_0xc648('0x34')]+'%'};return _0x4c1ce6;}})});}_0x58bcb2=_[_0xc648('0x35')]({},_0x58bcb2,_0xb4fca5[_0xc648('0x3a')]);var _0x5e55bb={'where':_0x58bcb2[_0xc648('0x32')]};return db[_0xc648('0x3b')]['count'](_0x5e55bb)[_0xc648('0x20')](function(_0x401734){_0x279c45['count']=_0x401734;if(_0xb4fca5['query'][_0xc648('0x3c')]){_0x58bcb2[_0xc648('0x3d')]=[{'all':!![]}];}return db[_0xc648('0x3b')][_0xc648('0x3e')](_0x58bcb2);})[_0xc648('0x20')](function(_0x2faff0){_0x279c45[_0xc648('0x3f')]=_0x2faff0;return _0x279c45;})[_0xc648('0x20')](respondWithFilteredResult(_0x5caa04,_0x58bcb2))[_0xc648('0x40')](handleError(_0x5caa04,null));};exports[_0xc648('0x41')]=function(_0x349cb4,_0x22f0f5){var _0x3316ea={'raw':!![],'where':{'id':_0x349cb4['params']['id']}},_0x5297c7={};_0x5297c7[_0xc648('0x27')]=_['keys'](db[_0xc648('0x3b')][_0xc648('0x42')]);_0x5297c7[_0xc648('0x29')]=_[_0xc648('0x28')](_0x349cb4[_0xc648('0x29')]);_0x5297c7['filters']=_[_0xc648('0x2b')](_0x5297c7[_0xc648('0x27')],_0x5297c7['query']);_0x3316ea[_0xc648('0x2c')]=_[_0xc648('0x2b')](_0x5297c7[_0xc648('0x27')],qs[_0xc648('0x2d')](_0x349cb4[_0xc648('0x29')][_0xc648('0x2d')]));_0x3316ea[_0xc648('0x2c')]=_0x3316ea[_0xc648('0x2c')][_0xc648('0x2e')]?_0x3316ea[_0xc648('0x2c')]:_0x5297c7[_0xc648('0x27')];if(_0x349cb4['query'][_0xc648('0x3c')]){_0x3316ea['include']=[{'all':!![]}];}_0x3316ea=_[_0xc648('0x35')]({},_0x3316ea,_0x349cb4[_0xc648('0x3a')]);return db[_0xc648('0x3b')]['find'](_0x3316ea)[_0xc648('0x20')](handleEntityNotFound(_0x22f0f5,null))[_0xc648('0x20')](respondWithResult(_0x22f0f5,null))[_0xc648('0x40')](handleError(_0x22f0f5,null));};exports[_0xc648('0x1f')]=function(_0x2f7a3f,_0x3c308d){if(_0x2f7a3f[_0xc648('0x43')]['id']){delete _0x2f7a3f[_0xc648('0x43')]['id'];}return db[_0xc648('0x3b')]['find']({'where':{'id':_0x2f7a3f[_0xc648('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c308d,null))[_0xc648('0x20')](saveUpdates(_0x2f7a3f[_0xc648('0x43')],null))[_0xc648('0x20')](respondWithResult(_0x3c308d,null))[_0xc648('0x40')](handleError(_0x3c308d,null));};exports['destroy']=function(_0x2bf946,_0x4fb92f){return db['Attachment'][_0xc648('0x45')]({'where':{'id':_0x2bf946[_0xc648('0x44')]['id']}})[_0xc648('0x20')](handleEntityNotFound(_0x4fb92f,null))[_0xc648('0x20')](removeEntity(_0x4fb92f,null))['catch'](handleError(_0x4fb92f,null));};exports['create']=function(_0x303913,_0x571145,_0x3edce2){_0x303913[_0xc648('0x43')]['name']=_0x303913[_0xc648('0x46')][_0xc648('0x47')];_0x303913[_0xc648('0x43')]['basename']=_0x303913[_0xc648('0x46')][_0xc648('0x48')];_0x303913[_0xc648('0x43')][_0xc648('0x37')]=_0x303913[_0xc648('0x46')][_0xc648('0x49')];return db[_0xc648('0x3b')][_0xc648('0x4a')](_0x303913['body'])[_0xc648('0x20')](respondWithResult(_0x571145,0xc9))[_0xc648('0x40')](handleError(_0x571145,null));};exports['download']=function(_0x592c7b,_0x21fe64,_0x2402f3){return db[_0xc648('0x3b')][_0xc648('0x4b')]({'where':{'id':_0x592c7b[_0xc648('0x44')]['id']},'raw':!![]})[_0xc648('0x20')](handleEntityNotFound(_0x21fe64,null))['then'](function(_0x2e4bb4){if(_0x2e4bb4){return _0x21fe64['download'](path[_0xc648('0x4c')](config[_0xc648('0x4d')],_0xc648('0x4e'),_0x2e4bb4[_0xc648('0x4f')]));}})[_0xc648('0x40')](handleError(_0x21fe64,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 3e14a46..58eeaf5 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 _0xe14b=['define','Attachment','attachments','lodash','util','moment','bluebird','./attachment.attributes'];(function(_0x5d1c9d,_0x8bb82d){var _0x8edfe4=function(_0x30fdc4){while(--_0x30fdc4){_0x5d1c9d['push'](_0x5d1c9d['shift']());}};_0x8edfe4(++_0x8bb82d);}(_0xe14b,0x93));var _0xbe14=function(_0x48fbda,_0x15dcc3){_0x48fbda=_0x48fbda-0x0;var _0x4b6de2=_0xe14b[_0x48fbda];return _0x4b6de2;};'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 attributes=require(_0xbe14('0x4'));module['exports']=function(_0x496c04,_0x1833e3){return _0x496c04[_0xbe14('0x5')](_0xbe14('0x6'),attributes,{'tableName':_0xbe14('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['define','Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','./attachment.attributes','exports'];(function(_0x5d27c2,_0x58f250){var _0x1239e3=function(_0x228935){while(--_0x228935){_0x5d27c2['push'](_0x5d27c2['shift']());}};_0x1239e3(++_0x58f250);}(_0xf494,0x1c6));var _0x4f49=function(_0x3196ec,_0x265a30){_0x3196ec=_0x3196ec-0x0;var _0x4bc274=_0xf494[_0x3196ec];return _0x4bc274;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var attributes=require(_0x4f49('0x6'));module[_0x4f49('0x7')]=function(_0x2a15fb,_0x3267c1){return _0x2a15fb[_0x4f49('0x8')](_0x4f49('0x9'),attributes,{'tableName':_0x4f49('0xa'),'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 3e68226..5e6dc29 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 _0x8156=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x8156,0xad));var _0x6815=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8156[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x6815('0x0'));var moment=require(_0x6815('0x1'));var BPromise=require(_0x6815('0x2'));var rs=require(_0x6815('0x3'));var fs=require('fs');var Redis=require(_0x6815('0x4'));var db=require(_0x6815('0x5'))['db'];var utils=require(_0x6815('0x6'));var logger=require(_0x6815('0x7'))(_0x6815('0x8'));var config=require(_0x6815('0x9'));var jayson=require(_0x6815('0xa'));var client=jayson[_0x6815('0xb')][_0x6815('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22e6f2,_0x5d2f21,_0x356203){return new BPromise(function(_0x306724,_0x1a8eb9){return client['request'](_0x22e6f2,_0x356203)[_0x6815('0xd')](function(_0x30790f){logger[_0x6815('0xe')](_0x6815('0xf'),_0x5d2f21,_0x6815('0x10'));logger[_0x6815('0x11')](_0x6815('0x12'),_0x5d2f21,_0x6815('0x10'),JSON[_0x6815('0x13')](_0x30790f));if(_0x30790f[_0x6815('0x14')]){if(_0x30790f['error'][_0x6815('0x15')]===0x1f4){logger[_0x6815('0x14')](_0x6815('0xf'),_0x5d2f21,_0x30790f[_0x6815('0x14')][_0x6815('0x16')]);return _0x1a8eb9(_0x30790f[_0x6815('0x14')][_0x6815('0x16')]);}logger[_0x6815('0x14')](_0x6815('0xf'),_0x5d2f21,_0x30790f[_0x6815('0x14')]['message']);return _0x306724(_0x30790f[_0x6815('0x14')][_0x6815('0x16')]);}else{logger[_0x6815('0xe')](_0x6815('0xf'),_0x5d2f21,_0x6815('0x10'));_0x306724(_0x30790f[_0x6815('0x17')][_0x6815('0x16')]);}})[_0x6815('0x18')](function(_0xc326ef){logger[_0x6815('0x14')](_0x6815('0xf'),_0x5d2f21,_0xc326ef);_0x1a8eb9(_0xc326ef);});});}exports[_0x6815('0x19')]=function(_0x3b1715){var _0x159237=this;return new Promise(function(_0x1ee5e7,_0x3be07b){return db[_0x6815('0x1a')][_0x6815('0x1b')](_0x3b1715[_0x6815('0x1c')],{'raw':_0x3b1715['options']?_0x3b1715[_0x6815('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x6815('0xd')](function(_0x387e5f){logger[_0x6815('0xe')]('CreateAttachment',_0x3b1715);logger[_0x6815('0x11')](_0x6815('0x19'),_0x3b1715,JSON[_0x6815('0x13')](_0x387e5f));_0x1ee5e7(_0x387e5f);})[_0x6815('0x18')](function(_0x3f13f2){logger[_0x6815('0x14')]('CreateAttachment',_0x3f13f2[_0x6815('0x16')],_0x3b1715);_0x3be07b(_0x159237['error'](0x1f4,_0x3f13f2[_0x6815('0x16')]));});});}; \ No newline at end of file +var _0x78e2=['http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','result','Attachment','create','options','raw','CreateAttachment','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3ac3df,_0x2718a0){var _0x2e2ed8=function(_0x1eeb77){while(--_0x1eeb77){_0x3ac3df['push'](_0x3ac3df['shift']());}};_0x2e2ed8(++_0x2718a0);}(_0x78e2,0x1a8));var _0x278e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78e2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x278e('0x0'));var util=require(_0x278e('0x1'));var moment=require(_0x278e('0x2'));var BPromise=require(_0x278e('0x3'));var rs=require(_0x278e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x278e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x278e('0x6'))(_0x278e('0x7'));var config=require(_0x278e('0x8'));var jayson=require(_0x278e('0x9'));var client=jayson[_0x278e('0xa')][_0x278e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x474b97,_0x1181ec,_0x224449){return new BPromise(function(_0x7b6bd8,_0x73f5b5){return client[_0x278e('0xc')](_0x474b97,_0x224449)[_0x278e('0xd')](function(_0xc6d28b){logger[_0x278e('0xe')]('Attachment,\x20%s,\x20%s',_0x1181ec,_0x278e('0xf'));logger[_0x278e('0x10')](_0x278e('0x11'),_0x1181ec,_0x278e('0xf'),JSON[_0x278e('0x12')](_0xc6d28b));if(_0xc6d28b[_0x278e('0x13')]){if(_0xc6d28b[_0x278e('0x13')]['code']===0x1f4){logger[_0x278e('0x13')](_0x278e('0x14'),_0x1181ec,_0xc6d28b['error'][_0x278e('0x15')]);return _0x73f5b5(_0xc6d28b['error'][_0x278e('0x15')]);}logger['error'](_0x278e('0x14'),_0x1181ec,_0xc6d28b[_0x278e('0x13')][_0x278e('0x15')]);return _0x7b6bd8(_0xc6d28b['error']['message']);}else{logger[_0x278e('0xe')](_0x278e('0x14'),_0x1181ec,'request\x20sent');_0x7b6bd8(_0xc6d28b[_0x278e('0x16')][_0x278e('0x15')]);}})['catch'](function(_0x10af6d){logger[_0x278e('0x13')](_0x278e('0x14'),_0x1181ec,_0x10af6d);_0x73f5b5(_0x10af6d);});});}exports['CreateAttachment']=function(_0x381cc9){var _0x432285=this;return new Promise(function(_0x58a511,_0x372a3e){return db[_0x278e('0x17')][_0x278e('0x18')](_0x381cc9['body'],{'raw':_0x381cc9[_0x278e('0x19')]?_0x381cc9[_0x278e('0x19')][_0x278e('0x1a')]===undefined?!![]:![]:!![]})[_0x278e('0xd')](function(_0x576470){logger[_0x278e('0xe')](_0x278e('0x1b'),_0x381cc9);logger['debug'](_0x278e('0x1b'),_0x381cc9,JSON[_0x278e('0x12')](_0x576470));_0x58a511(_0x576470);})[_0x278e('0x1c')](function(_0x9562e3){logger[_0x278e('0x13')](_0x278e('0x1b'),_0x9562e3[_0x278e('0x15')],_0x381cc9);_0x372a3e(_0x432285[_0x278e('0x13')](0x1f4,_0x9562e3[_0x278e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 91bda32..e0bda78 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 _0x43fd=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','server/files/attachments/','now','originalname','post','create','put','update','destroy','exports','multer','util'];(function(_0x274e23,_0x13d210){var _0xb36116=function(_0x54a292){while(--_0x54a292){_0x274e23['push'](_0x274e23['shift']());}};_0xb36116(++_0x13d210);}(_0x43fd,0x150));var _0xd43f=function(_0x5db52d,_0x1650ae){_0x5db52d=_0x5db52d-0x0;var _0x457607=_0x43fd[_0x5db52d];return _0x457607;};'use strict';var multer=require(_0xd43f('0x0'));var util=require(_0xd43f('0x1'));var path=require('path');var timeout=require(_0xd43f('0x2'));var express=require('express');var router=express[_0xd43f('0x3')]();var auth=require(_0xd43f('0x4'));var interaction=require(_0xd43f('0x5'));var config=require(_0xd43f('0x6'));var controller=require(_0xd43f('0x7'));router[_0xd43f('0x8')]('/',auth[_0xd43f('0x9')](),controller[_0xd43f('0xa')]);router[_0xd43f('0x8')](_0xd43f('0xb'),auth[_0xd43f('0x9')](),controller[_0xd43f('0xc')]);router[_0xd43f('0x8')](_0xd43f('0xd'),auth['isAuthenticated'](),controller[_0xd43f('0xe')]);var upload=multer({'storage':multer[_0xd43f('0xf')]({'destination':function(_0xcc229e,_0x535d98,_0x27b3cc){_0x27b3cc(null,path[_0xd43f('0x10')](config['root'],_0xd43f('0x11')));},'filename':function(_0x40b4e9,_0xf043e5,_0x2550fa){_0x2550fa(null,util['format']('%s-%s',Date[_0xd43f('0x12')](),_0xf043e5[_0xd43f('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd43f('0x14')]('/',upload['single']('file'),controller[_0xd43f('0x15')]);router[_0xd43f('0x16')]('/:id',auth[_0xd43f('0x9')](),controller[_0xd43f('0x17')]);router['delete'](_0xd43f('0xb'),auth[_0xd43f('0x9')](),controller[_0xd43f('0x18')]);module[_0xd43f('0x19')]=router; \ No newline at end of file +var _0x4a3d=['file','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','/:id','/:id/download','download','diskStorage','join','server/files/attachments/','format','%s-%s','now','replace','post','single'];(function(_0x2b7f56,_0x41bc7d){var _0x36896d=function(_0x551d56){while(--_0x551d56){_0x2b7f56['push'](_0x2b7f56['shift']());}};_0x36896d(++_0x41bc7d);}(_0x4a3d,0x79));var _0xd4a3=function(_0x851368,_0x3fecf5){_0x851368=_0x851368-0x0;var _0xbfd93c=_0x4a3d[_0x851368];return _0xbfd93c;};'use strict';var multer=require(_0xd4a3('0x0'));var util=require(_0xd4a3('0x1'));var path=require(_0xd4a3('0x2'));var timeout=require(_0xd4a3('0x3'));var express=require(_0xd4a3('0x4'));var router=express[_0xd4a3('0x5')]();var auth=require(_0xd4a3('0x6'));var interaction=require(_0xd4a3('0x7'));var config=require(_0xd4a3('0x8'));var controller=require(_0xd4a3('0x9'));router[_0xd4a3('0xa')]('/',auth[_0xd4a3('0xb')](),controller['index']);router['get'](_0xd4a3('0xc'),auth[_0xd4a3('0xb')](),controller['show']);router['get'](_0xd4a3('0xd'),auth[_0xd4a3('0xb')](),controller[_0xd4a3('0xe')]);var upload=multer({'storage':multer[_0xd4a3('0xf')]({'destination':function(_0x1fa408,_0x1970cb,_0x206540){_0x206540(null,path[_0xd4a3('0x10')](config['root'],_0xd4a3('0x11')));},'filename':function(_0x1cb2f7,_0x8f391d,_0x213577){_0x213577(null,util[_0xd4a3('0x12')](_0xd4a3('0x13'),Date[_0xd4a3('0x14')](),_0x8f391d['originalname'][_0xd4a3('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd4a3('0x16')]('/',upload[_0xd4a3('0x17')](_0xd4a3('0x18')),controller[_0xd4a3('0x19')]);router[_0xd4a3('0x1a')](_0xd4a3('0xc'),auth[_0xd4a3('0xb')](),controller['update']);router['delete'](_0xd4a3('0xc'),auth[_0xd4a3('0xb')](),controller[_0xd4a3('0x1b')]);module[_0xd4a3('0x1c')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 14364b0..b97c25d 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 _0x8b0f=['then','User\x20email\x20not\x20found!','lodash','passport-google-oauth20','Strategy','../../mysqldb','../../components/auth/service','signToken','authenticate','google','/login','profile','email','callback','clientID','callbackURL','User','map','emails','value','agent'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x8b0f,0x191));var _0xf8b0=function(_0x15dd34,_0x16a882){_0x15dd34=_0x15dd34-0x0;var _0x291e86=_0x8b0f[_0x15dd34];return _0x291e86;};'use strict';var _=require(_0xf8b0('0x0'));var passport=require('passport');var GoogleStrategy=require(_0xf8b0('0x1'))[_0xf8b0('0x2')];var db=require(_0xf8b0('0x3'))['db'];var config=require('../../config/environment');var signToken=require(_0xf8b0('0x4'))[_0xf8b0('0x5')];exports['login']=passport[_0xf8b0('0x6')](_0xf8b0('0x7'),{'failureRedirect':_0xf8b0('0x8'),'scope':[_0xf8b0('0x9'),_0xf8b0('0xa')],'session':![]});exports[_0xf8b0('0xb')]=passport['authenticate'](_0xf8b0('0x7'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xf8b0('0x7')]?config['google'][_0xf8b0('0xc')]:'id','clientSecret':config[_0xf8b0('0x7')]?config['google']['clientSecret']:'secret','callbackURL':config['google']?config[_0xf8b0('0x7')][_0xf8b0('0xd')]:''},function(_0x3459a0,_0x2a971c,_0x5d3b61,_0x1c4994){db[_0xf8b0('0xe')]['find']({'where':{'email':_[_0xf8b0('0xf')](_0x5d3b61[_0xf8b0('0x10')],_0xf8b0('0x11')),'role':{'$or':['admin','user',_0xf8b0('0x12')]}}})[_0xf8b0('0x13')](function(_0x318c03){if(_0x318c03){return _0x1c4994(null,_0x318c03);}_0x1c4994(_0xf8b0('0x14'));})['catch'](function(_0x50add5){_0x1c4994(_0x50add5);});})); \ No newline at end of file +var _0x9d56=['login','authenticate','/login','profile','email','callback','google','use','clientID','clientSecret','secret','callbackURL','User','find','map','value','admin','user','agent','catch','lodash','passport','passport-google-oauth20','Strategy','../../config/environment','../../components/auth/service','signToken'];(function(_0x382c97,_0x11a46b){var _0x3c7174=function(_0xa4eea4){while(--_0xa4eea4){_0x382c97['push'](_0x382c97['shift']());}};_0x3c7174(++_0x11a46b);}(_0x9d56,0x122));var _0x69d5=function(_0x531650,_0x48f4eb){_0x531650=_0x531650-0x0;var _0x21df21=_0x9d56[_0x531650];return _0x21df21;};'use strict';var _=require(_0x69d5('0x0'));var passport=require(_0x69d5('0x1'));var GoogleStrategy=require(_0x69d5('0x2'))[_0x69d5('0x3')];var db=require('../../mysqldb')['db'];var config=require(_0x69d5('0x4'));var signToken=require(_0x69d5('0x5'))[_0x69d5('0x6')];exports[_0x69d5('0x7')]=passport[_0x69d5('0x8')]('google',{'failureRedirect':_0x69d5('0x9'),'scope':[_0x69d5('0xa'),_0x69d5('0xb')],'session':![]});exports[_0x69d5('0xc')]=passport[_0x69d5('0x8')](_0x69d5('0xd'),{'failureRedirect':_0x69d5('0x9'),'session':![]});passport[_0x69d5('0xe')](new GoogleStrategy({'clientID':config[_0x69d5('0xd')]?config[_0x69d5('0xd')][_0x69d5('0xf')]:'id','clientSecret':config[_0x69d5('0xd')]?config[_0x69d5('0xd')][_0x69d5('0x10')]:_0x69d5('0x11'),'callbackURL':config[_0x69d5('0xd')]?config[_0x69d5('0xd')][_0x69d5('0x12')]:''},function(_0x301c5e,_0x4c9580,_0x2c3579,_0x2a09c0){db[_0x69d5('0x13')][_0x69d5('0x14')]({'where':{'email':_[_0x69d5('0x15')](_0x2c3579['emails'],_0x69d5('0x16')),'role':{'$or':[_0x69d5('0x17'),_0x69d5('0x18'),_0x69d5('0x19')]}}})['then'](function(_0x5b192f){if(_0x5b192f){return _0x2a09c0(null,_0x5b192f);}_0x2a09c0('User\x20email\x20not\x20found!');})[_0x69d5('0x1a')](function(_0x33cf2e){_0x2a09c0(_0x33cf2e);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index ad30c57..96216fc 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 _0x01e1=['callback','exports','express','passport','./authGoogle.controller','../../components/auth/service','setTokenCookie','get','login','/callback'];(function(_0x2e508b,_0x27f5cd){var _0x102577=function(_0xdde330){while(--_0xdde330){_0x2e508b['push'](_0x2e508b['shift']());}};_0x102577(++_0x27f5cd);}(_0x01e1,0xca));var _0x101e=function(_0x3d1657,_0x2440ee){_0x3d1657=_0x3d1657-0x0;var _0x108b86=_0x01e1[_0x3d1657];return _0x108b86;};'use strict';var express=require(_0x101e('0x0'));var passport=require(_0x101e('0x1'));var router=express['Router']();var controller=require(_0x101e('0x2'));var setTokenCookie=require(_0x101e('0x3'))[_0x101e('0x4')];router[_0x101e('0x5')]('/',controller[_0x101e('0x6')]);router['get'](_0x101e('0x7'),controller[_0x101e('0x8')],setTokenCookie);module[_0x101e('0x9')]=router; \ No newline at end of file +var _0xf0be=['passport','Router','./authGoogle.controller','../../components/auth/service','setTokenCookie','get','exports','express'];(function(_0x2b5ee5,_0x3741bf){var _0x1c480b=function(_0x437a18){while(--_0x437a18){_0x2b5ee5['push'](_0x2b5ee5['shift']());}};_0x1c480b(++_0x3741bf);}(_0xf0be,0xd7));var _0xef0b=function(_0x51648c,_0x2318ed){_0x51648c=_0x51648c-0x0;var _0x378326=_0xf0be[_0x51648c];return _0x378326;};'use strict';var express=require(_0xef0b('0x0'));var passport=require(_0xef0b('0x1'));var router=express[_0xef0b('0x2')]();var controller=require(_0xef0b('0x3'));var setTokenCookie=require(_0xef0b('0x4'))[_0xef0b('0x5')];router['get']('/',controller['login']);router[_0xef0b('0x6')]('/callback',controller['callback'],setTokenCookie);module[_0xef0b('0x7')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 0f23d12..0dd5c38 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 _0x5d66=['stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','use','passport','passport-local','Strategy','bluebird','jayson/promise','lodash','randomstring','../../mysqldb','signToken','http','role','User','count','agent','then','getLicense','agents','find','admin','user','name','This\x20password\x20is\x20not\x20correct','catch','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d66,0xea));var _0x65d6=function(_0x3e8ff6,_0x35c443){_0x3e8ff6=_0x3e8ff6-0x0;var _0x3c9bf3=_0x5d66[_0x3e8ff6];return _0x3c9bf3;};'use strict';var util=require('util');var passport=require(_0x65d6('0x0'));var LocalStrategy=require(_0x65d6('0x1'))[_0x65d6('0x2')];var BPromise=require(_0x65d6('0x3'));var jayson=require(_0x65d6('0x4'));var _=require(_0x65d6('0x5'));var logger=require('../../config/logger')('api');var rs=require(_0x65d6('0x6'));var db=require(_0x65d6('0x7'))['db'];var signToken=require('../../components/auth/service')[_0x65d6('0x8')];var client=jayson['client'][_0x65d6('0x9')]({'port':0x232b});var getLicense=function(_0x4e51f8){return new BPromise(function(_0x1d807c,_0x24f46a){var _0x1e67a5=0x0;_0x4e51f8[_0x65d6('0xa')]!=='agent'&&_0x1d807c(_0x4e51f8);return db[_0x65d6('0xb')][_0x65d6('0xc')]({'where':{'role':_0x65d6('0xd'),'online':!![],'id':{'$ne':_0x4e51f8['id']}}})[_0x65d6('0xe')](function(_0x1df7bb){_0x1e67a5=_0x1df7bb;return require('../../config/license/util')[_0x65d6('0xf')]();})['then'](function(_0x19f67a){if(_0x19f67a&&_0x19f67a[_0x65d6('0x10')]&&_0x1e67a5>=_0x19f67a['agents']){return _0x24f46a({'message':'Maximum\x20login\x20has\x20been\x20reached'});}return _0x1d807c(_0x4e51f8);})['catch'](function(_0x55fc39){return _0x24f46a(_0x55fc39);});});};function localAuthenticate(_0x3535f9,_0x810b1b,_0x36e03a,_0x424347){_0x3535f9[_0x65d6('0x11')]({'where':{'name':_0x810b1b,'role':{'$or':[_0x65d6('0x12'),_0x65d6('0x13'),_0x65d6('0xd')]}}})[_0x65d6('0xe')](function(_0x85c3cc){if(!_0x85c3cc||_0x85c3cc&&_0x85c3cc[_0x65d6('0x14')]!==_0x810b1b){return _0x424347(null,![],{'message':'This\x20name\x20is\x20not\x20registered'});}return getLicense(_0x85c3cc);})[_0x65d6('0xe')](function(_0x1e6768){_0x1e6768['authenticate'](_0x36e03a,function(_0x3a80ae,_0x53072c){if(_0x3a80ae){return _0x424347(_0x3a80ae);}if(!_0x53072c){return _0x424347(null,![],{'message':_0x65d6('0x15')});}else{return _0x424347(null,_0x1e6768);}});})[_0x65d6('0x16')](function(_0x5f3c84){_0x424347(_0x5f3c84);});}function sendServiceMail(_0x1bbd81){return db[_0x65d6('0x17')][_0x65d6('0x11')]({'where':{'service':!![]},'attributes':['id',_0x65d6('0x14'),_0x65d6('0x18')],'include':[{'model':db[_0x65d6('0x19')],'as':'Smtp'}]})['then'](function(_0x476f34){if(!_0x476f34){throw new Error(_0x65d6('0x1a'));}var _0x5b98bf={'tls':{'rejectUnauthorized':![]}};if(_0x476f34['Smtp']['service']){_0x5b98bf[_0x65d6('0x1b')]=_0x476f34[_0x65d6('0x1c')][_0x65d6('0x1b')];}else{_0x5b98bf['host']=_0x476f34[_0x65d6('0x1c')][_0x65d6('0x1d')];_0x5b98bf[_0x65d6('0x1e')]=_0x476f34[_0x65d6('0x1c')][_0x65d6('0x1e')];_0x5b98bf[_0x65d6('0x1f')]=_0x476f34[_0x65d6('0x1c')]['secure'];}if(_0x476f34[_0x65d6('0x1c')][_0x65d6('0x20')]){_0x5b98bf[_0x65d6('0x21')]={'user':_0x476f34[_0x65d6('0x1c')][_0x65d6('0x13')],'pass':_0x476f34['Smtp'][_0x65d6('0x22')]};}var _0x4cd93f={'account':_0x5b98bf,'message':_[_0x65d6('0x23')]({'from':util[_0x65d6('0x24')](_0x65d6('0x25'),_0x476f34[_0x65d6('0x14')],_0x476f34[_0x65d6('0x18')]||_0x476f34['Smtp'][_0x65d6('0x13')])},_0x1bbd81)};return client['request'](_0x65d6('0x26'),_0x4cd93f);})['then'](function(_0x4fd95d){if(_0x4fd95d[_0x65d6('0x27')]){throw new Error(util['format'](_0x65d6('0x28'),_0x4fd95d['error'][_0x65d6('0x29')]||JSON[_0x65d6('0x2a')](_0x4fd95d[_0x65d6('0x27')])));}return!![];});}function handleError(_0x46693a,_0x34db44,_0x15ba57){return _0x46693a[_0x65d6('0x2b')](_0x34db44||0x1f4)[_0x65d6('0x2c')]({'message':_0x15ba57?_0x15ba57[_0x65d6('0x29')]||_0x15ba57:''});}exports[_0x65d6('0x2d')]=function(_0x2cc571,_0x194827,_0x3837ec){passport['authenticate']('local',function(_0x42eafc,_0x3ec3ae,_0x4900f9){var _0x49a78e=_0x42eafc||_0x4900f9;if(_0x49a78e){return handleError(_0x194827,0x191,_0x49a78e);}if(!_0x3ec3ae){return handleError(_0x194827,0x194,{'message':_0x65d6('0x2e')});}var _0x5802e5=signToken(_0x3ec3ae['id'],_0x3ec3ae['role']);_0x194827[_0x65d6('0x2f')]({'id':_0x3ec3ae['id'],'token':_0x5802e5,'statusCall':'','isAlreadyLogged':_0x3ec3ae['online']});})(_0x2cc571,_0x194827,_0x3837ec);};exports[_0x65d6('0x30')]=function(_0x20678d,_0x3335e6,_0x5daab7){if(!_0x20678d[_0x65d6('0x31')][_0x65d6('0x18')]){return handleError(_0x3335e6,0x1f4,{'message':_0x65d6('0x32')});}var _0x4ae951=rs[_0x65d6('0x33')]();_0x20678d[_0x65d6('0x31')][_0x65d6('0x18')]=_0x20678d['body'][_0x65d6('0x18')][_0x65d6('0x34')]()['toLowerCase']();return db[_0x65d6('0xb')]['find']({'where':{'email':_0x20678d[_0x65d6('0x31')][_0x65d6('0x18')]}})[_0x65d6('0xe')](function(_0x503f29){if(!_0x503f29){throw new Error('This\x20email\x20is\x20not\x20registered.');}_0x503f29[_0x65d6('0x35')]=_0x4ae951;_0x503f29[_0x65d6('0x36')]=Date[_0x65d6('0x37')]()+0x36ee80;return _0x503f29[_0x65d6('0x38')]();})[_0x65d6('0xe')](function(){return sendServiceMail({'to':_0x20678d[_0x65d6('0x31')][_0x65d6('0x18')],'subject':_0x65d6('0x39'),'text':_0x65d6('0x3a')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x65d6('0x3b')+_0x20678d[_0x65d6('0x3c')][_0x65d6('0x1d')]+_0x65d6('0x3d')+_0x4ae951+'\x0a\x0a'+_0x65d6('0x3e')});})[_0x65d6('0xe')](function(){_0x3335e6[_0x65d6('0x2b')](0xc8)['send']({'message':_0x65d6('0x3f')});})[_0x65d6('0x16')](function(_0x541fc0){return handleError(_0x3335e6,0x1f4,_0x541fc0);});};exports[_0x65d6('0x40')]=function(_0x3c4647,_0xf27b8d,_0x2c5e78){return db[_0x65d6('0xb')][_0x65d6('0x11')]({'where':{'resetPasswordToken':_0x3c4647['params'][_0x65d6('0x41')],'resetPasswordExpires':{'$gt':Date[_0x65d6('0x37')]()}}})[_0x65d6('0xe')](function(_0x4b4332){if(!_0x4b4332){throw new Error(_0x65d6('0x42'));}_0x4b4332[_0x65d6('0x43')]=_0x3c4647[_0x65d6('0x31')][_0x65d6('0x43')];_0x4b4332['resetPasswordToken']=null;_0x4b4332[_0x65d6('0x36')]=null;return _0x4b4332[_0x65d6('0x38')]();})[_0x65d6('0xe')](function(){_0xf27b8d[_0x65d6('0x2b')](0xc8)[_0x65d6('0x2c')]({'message':'Password\x20reset!'});})[_0x65d6('0x16')](function(_0x1122a6){return handleError(_0xf27b8d,0x1f4,_0x1122a6);});};passport[_0x65d6('0x44')](new LocalStrategy({'usernameField':_0x65d6('0x14'),'passwordField':_0x65d6('0x43')},function(_0x21692e,_0x2be57e,_0x2191ca){return localAuthenticate(db[_0x65d6('0xb')],_0x21692e,_0x2be57e,_0x2191ca);})); \ No newline at end of file +var _0x821d=['User','agent','then','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','admin','user','name','This\x20name\x20is\x20not\x20registered','authenticate','This\x20password\x20is\x20not\x20correct','email','MailServerOut','Smtp','service','host','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','save','Password\x20reset!','use','passport','passport-local','bluebird','jayson/promise','lodash','../../config/logger','api','../../components/auth/service','signToken','client','http','role'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x821d,0x80));var _0xd821=function(_0x5e88c3,_0xc58e7f){_0x5e88c3=_0x5e88c3-0x0;var _0x40cb29=_0x821d[_0x5e88c3];return _0x40cb29;};'use strict';var util=require('util');var passport=require(_0xd821('0x0'));var LocalStrategy=require(_0xd821('0x1'))['Strategy'];var BPromise=require(_0xd821('0x2'));var jayson=require(_0xd821('0x3'));var _=require(_0xd821('0x4'));var logger=require(_0xd821('0x5'))(_0xd821('0x6'));var rs=require('randomstring');var db=require('../../mysqldb')['db'];var signToken=require(_0xd821('0x7'))[_0xd821('0x8')];var client=jayson[_0xd821('0x9')][_0xd821('0xa')]({'port':0x232b});var getLicense=function(_0x6407de){return new BPromise(function(_0x544147,_0x152a50){var _0x412a77=0x0;_0x6407de[_0xd821('0xb')]!=='agent'&&_0x544147(_0x6407de);return db[_0xd821('0xc')]['count']({'where':{'role':_0xd821('0xd'),'online':!![],'id':{'$ne':_0x6407de['id']}}})[_0xd821('0xe')](function(_0x13a0dd){_0x412a77=_0x13a0dd;return require(_0xd821('0xf'))[_0xd821('0x10')]();})[_0xd821('0xe')](function(_0x375e19){if(_0x375e19&&_0x375e19[_0xd821('0x11')]&&_0x412a77>=_0x375e19['agents']){return _0x152a50({'message':_0xd821('0x12')});}return _0x544147(_0x6407de);})[_0xd821('0x13')](function(_0x1300f1){return _0x152a50(_0x1300f1);});});};function localAuthenticate(_0x130bc8,_0x22ea97,_0x4bfccd,_0x314e0e){_0x130bc8[_0xd821('0x14')]({'where':{'name':_0x22ea97,'role':{'$or':[_0xd821('0x15'),_0xd821('0x16'),_0xd821('0xd')]}}})[_0xd821('0xe')](function(_0x47d7f2){if(!_0x47d7f2||_0x47d7f2&&_0x47d7f2[_0xd821('0x17')]!==_0x22ea97){return _0x314e0e(null,![],{'message':_0xd821('0x18')});}return getLicense(_0x47d7f2);})[_0xd821('0xe')](function(_0xe2c677){_0xe2c677[_0xd821('0x19')](_0x4bfccd,function(_0x8da18e,_0x269cb5){if(_0x8da18e){return _0x314e0e(_0x8da18e);}if(!_0x269cb5){return _0x314e0e(null,![],{'message':_0xd821('0x1a')});}else{return _0x314e0e(null,_0xe2c677);}});})['catch'](function(_0x51eb66){_0x314e0e(_0x51eb66);});}function sendServiceMail(_0x337d81){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xd821('0x17'),_0xd821('0x1b')],'include':[{'model':db[_0xd821('0x1c')],'as':_0xd821('0x1d')}]})['then'](function(_0x3ad367){if(!_0x3ad367){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x912b21={'tls':{'rejectUnauthorized':![]}};if(_0x3ad367[_0xd821('0x1d')][_0xd821('0x1e')]){_0x912b21[_0xd821('0x1e')]=_0x3ad367[_0xd821('0x1d')][_0xd821('0x1e')];}else{_0x912b21[_0xd821('0x1f')]=_0x3ad367['Smtp'][_0xd821('0x1f')];_0x912b21['port']=_0x3ad367[_0xd821('0x1d')]['port'];_0x912b21[_0xd821('0x20')]=_0x3ad367[_0xd821('0x1d')]['secure'];}if(_0x3ad367[_0xd821('0x1d')][_0xd821('0x21')]){_0x912b21[_0xd821('0x22')]={'user':_0x3ad367[_0xd821('0x1d')][_0xd821('0x16')],'pass':_0x3ad367[_0xd821('0x1d')][_0xd821('0x23')]};}var _0x3dc627={'account':_0x912b21,'message':_[_0xd821('0x24')]({'from':util['format'](_0xd821('0x25'),_0x3ad367[_0xd821('0x17')],_0x3ad367['email']||_0x3ad367[_0xd821('0x1d')][_0xd821('0x16')])},_0x337d81)};return client['request'](_0xd821('0x26'),_0x3dc627);})[_0xd821('0xe')](function(_0x2c2881){if(_0x2c2881[_0xd821('0x27')]){throw new Error(util[_0xd821('0x28')](_0xd821('0x29'),_0x2c2881[_0xd821('0x27')][_0xd821('0x2a')]||JSON['stringify'](_0x2c2881[_0xd821('0x27')])));}return!![];});}function handleError(_0x424047,_0x4b7ac1,_0x151072){return _0x424047[_0xd821('0x2b')](_0x4b7ac1||0x1f4)[_0xd821('0x2c')]({'message':_0x151072?_0x151072[_0xd821('0x2a')]||_0x151072:''});}exports[_0xd821('0x2d')]=function(_0x3aaaf1,_0x189170,_0x23b3d4){passport['authenticate'](_0xd821('0x2e'),function(_0x3691bf,_0x6c4cb7,_0x221472){var _0x18a103=_0x3691bf||_0x221472;if(_0x18a103){return handleError(_0x189170,0x191,_0x18a103);}if(!_0x6c4cb7){return handleError(_0x189170,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}var _0x29b26f=signToken(_0x6c4cb7['id'],_0x6c4cb7['role']);_0x189170[_0xd821('0x2f')]({'id':_0x6c4cb7['id'],'token':_0x29b26f,'statusCall':'','isAlreadyLogged':_0x6c4cb7[_0xd821('0x30')]});})(_0x3aaaf1,_0x189170,_0x23b3d4);};exports[_0xd821('0x31')]=function(_0x406fa0,_0x29ec1f,_0x5dae6c){if(!_0x406fa0[_0xd821('0x32')]['email']){return handleError(_0x29ec1f,0x1f4,{'message':_0xd821('0x33')});}var _0x5e41dd=rs[_0xd821('0x34')]();_0x406fa0['body'][_0xd821('0x1b')]=_0x406fa0[_0xd821('0x32')][_0xd821('0x1b')][_0xd821('0x35')]()[_0xd821('0x36')]();return db[_0xd821('0xc')]['find']({'where':{'email':_0x406fa0[_0xd821('0x32')][_0xd821('0x1b')]}})[_0xd821('0xe')](function(_0x12ad9a){if(!_0x12ad9a){throw new Error(_0xd821('0x37'));}_0x12ad9a[_0xd821('0x38')]=_0x5e41dd;_0x12ad9a[_0xd821('0x39')]=Date[_0xd821('0x3a')]()+0x36ee80;return _0x12ad9a['save']();})[_0xd821('0xe')](function(){return sendServiceMail({'to':_0x406fa0['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xd821('0x3b')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xd821('0x3c')+_0x406fa0[_0xd821('0x3d')]['host']+_0xd821('0x3e')+_0x5e41dd+'\x0a\x0a'+_0xd821('0x3f')});})[_0xd821('0xe')](function(){_0x29ec1f[_0xd821('0x2b')](0xc8)[_0xd821('0x2c')]({'message':'Reset\x20Email\x20sent!'});})[_0xd821('0x13')](function(_0x5f4dc4){return handleError(_0x29ec1f,0x1f4,_0x5f4dc4);});};exports[_0xd821('0x40')]=function(_0x5eafb1,_0x19ce97,_0x258e34){return db[_0xd821('0xc')][_0xd821('0x14')]({'where':{'resetPasswordToken':_0x5eafb1['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xd821('0x3a')]()}}})[_0xd821('0xe')](function(_0x433108){if(!_0x433108){throw new Error(_0xd821('0x41'));}_0x433108[_0xd821('0x42')]=_0x5eafb1['body']['password'];_0x433108[_0xd821('0x38')]=null;_0x433108[_0xd821('0x39')]=null;return _0x433108[_0xd821('0x43')]();})[_0xd821('0xe')](function(){_0x19ce97[_0xd821('0x2b')](0xc8)['send']({'message':_0xd821('0x44')});})['catch'](function(_0x480ecd){return handleError(_0x19ce97,0x1f4,_0x480ecd);});};passport[_0xd821('0x45')](new LocalStrategy({'usernameField':_0xd821('0x17'),'passwordField':'password'},function(_0x205909,_0xdfef35,_0x6669d8){return localAuthenticate(db[_0xd821('0xc')],_0x205909,_0xdfef35,_0x6669d8);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 5c08374..1d43bbe 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 _0xaae5=['login','post','/forgot','forgot','/reset/:token','exports','Router'];(function(_0x2e3667,_0x5f369c){var _0x240ed3=function(_0x167f85){while(--_0x167f85){_0x2e3667['push'](_0x2e3667['shift']());}};_0x240ed3(++_0x5f369c);}(_0xaae5,0x1b8));var _0x5aae=function(_0x5c2883,_0x1f7cdb){_0x5c2883=_0x5c2883-0x0;var _0x3d416c=_0xaae5[_0x5c2883];return _0x3d416c;};'use strict';var express=require('express');var router=express[_0x5aae('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x5aae('0x1')]);router[_0x5aae('0x2')](_0x5aae('0x3'),controller[_0x5aae('0x4')]);router[_0x5aae('0x2')](_0x5aae('0x5'),controller['reset']);module[_0x5aae('0x6')]=router; \ No newline at end of file +var _0x61cc=['reset','exports','express','post','login','/forgot','/reset/:token'];(function(_0xbe5ace,_0x2f66a8){var _0x17998f=function(_0x1b1945){while(--_0x1b1945){_0xbe5ace['push'](_0xbe5ace['shift']());}};_0x17998f(++_0x2f66a8);}(_0x61cc,0x159));var _0xc61c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x61cc[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0xc61c('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0xc61c('0x1')]('/',controller[_0xc61c('0x2')]);router['post'](_0xc61c('0x3'),controller['forgot']);router[_0xc61c('0x1')](_0xc61c('0x4'),controller[_0xc61c('0x5')]);module[_0xc61c('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 99f0ad4..f6137f7 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 _0x1867=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x1c5893,_0xfbb650){var _0x3d3e5c=function(_0xab31d4){while(--_0xab31d4){_0x1c5893['push'](_0x1c5893['shift']());}};_0x3d3e5c(++_0xfbb650);}(_0x1867,0xb5));var _0x7186=function(_0x4abda8,_0x1845c6){_0x4abda8=_0x4abda8-0x0;var _0x4f8d11=_0x1867[_0x4abda8];return _0x4f8d11;};'use strict';var Sequelize=require(_0x7186('0x0'));module[_0x7186('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x7186('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x7186('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7186('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x8f4c=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1df9f4,_0x27c693){_0x1df9f4=_0x1df9f4-0x0;var _0x29f9c5=_0x8f4c[_0x1df9f4];return _0x29f9c5;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xc8f4('0x2')]},'description':{'type':Sequelize[_0xc8f4('0x2')]},'status':{'type':Sequelize[_0xc8f4('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 7a63ecf..60622fe 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 _0xa3bf=['create','body','Condition','addConditions','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','Automation','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','find'];(function(_0xc7a51c,_0x5bed1e){var _0x8ebd4b=function(_0x10cc1e){while(--_0x10cc1e){_0xc7a51c['push'](_0xc7a51c['shift']());}};_0x8ebd4b(++_0x5bed1e);}(_0xa3bf,0x158));var _0xfa3b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa3bf[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0xfa3b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfa3b('0x1'));var zipdir=require(_0xfa3b('0x2'));var jsonpatch=require(_0xfa3b('0x3'));var rp=require('request-promise');var moment=require(_0xfa3b('0x4'));var BPromise=require(_0xfa3b('0x5'));var Mustache=require('mustache');var util=require(_0xfa3b('0x6'));var path=require('path');var sox=require(_0xfa3b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xfa3b('0x8'));var squel=require(_0xfa3b('0x9'));var crypto=require(_0xfa3b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfa3b('0xb'));var toCsv=require(_0xfa3b('0xc'));var querystring=require(_0xfa3b('0xd'));var Papa=require('papaparse');var authService=require(_0xfa3b('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xfa3b('0xf'));var qs=require(_0xfa3b('0x10'));var logger=require(_0xfa3b('0x11'))(_0xfa3b('0x12'));var utils=require(_0xfa3b('0x13'));var config=require(_0xfa3b('0x14'));var db=require(_0xfa3b('0x15'))['db'];function respondWithStatusCode(_0x480c68,_0x1a2310){_0x1a2310=_0x1a2310||0xcc;return function(_0x57a783){if(_0x57a783){return _0x480c68[_0xfa3b('0x16')](_0x1a2310);}return _0x480c68[_0xfa3b('0x17')](_0x1a2310)[_0xfa3b('0x18')]();};}function respondWithResult(_0x58f281,_0x26eaa5){_0x26eaa5=_0x26eaa5||0xc8;return function(_0x454a3b){if(_0x454a3b){return _0x58f281['status'](_0x26eaa5)['json'](_0x454a3b);}};}function respondWithFilteredResult(_0x475762,_0x9d8359){return function(_0x2b9b3d){if(_0x2b9b3d){var _0x5cab44=_0x2b9b3d[_0xfa3b('0x19')],_0x6f4ae=_0x9d8359[_0xfa3b('0x1a')],_0x59de2f=_0x9d8359['offset']+_0x9d8359[_0xfa3b('0x1b')],_0x3cf19b;if(_0x59de2f>=_0x5cab44){_0x59de2f=_0x5cab44;_0x3cf19b=0xc8;}else{_0x3cf19b=0xce;}_0x475762['status'](_0x3cf19b);return _0x475762[_0xfa3b('0x1c')](_0xfa3b('0x1d'),_0x6f4ae+'-'+_0x59de2f+'/'+_0x5cab44)[_0xfa3b('0x1e')](_0x2b9b3d);}return null;};}function patchUpdates(_0x113c25){return function(_0x270273){try{jsonpatch[_0xfa3b('0x1f')](_0x270273,_0x113c25,!![]);}catch(_0x51dc2b){return BPromise['reject'](_0x51dc2b);}return _0x270273[_0xfa3b('0x20')]();};}function saveUpdates(_0x70d413,_0x34c290){return function(_0x93ee53){if(_0x93ee53){return _0x93ee53[_0xfa3b('0x21')](_0x70d413)[_0xfa3b('0x22')](function(_0x28dc16){return _0x28dc16;});}return null;};}function removeEntity(_0x219874,_0x1b88a2){return function(_0x3aa19a){if(_0x3aa19a){return _0x3aa19a[_0xfa3b('0x23')]()['then'](function(){_0x219874[_0xfa3b('0x17')](0xcc)[_0xfa3b('0x18')]();});}};}function handleEntityNotFound(_0x4831ea,_0x151995){return function(_0x56d9a6){if(!_0x56d9a6){_0x4831ea[_0xfa3b('0x16')](0x194);}return _0x56d9a6;};}function handleError(_0x10dd6e,_0x3b1dea){_0x3b1dea=_0x3b1dea||0x1f4;return function(_0x358b14){logger[_0xfa3b('0x24')](_0x358b14[_0xfa3b('0x25')]);if(_0x358b14[_0xfa3b('0x26')]){delete _0x358b14[_0xfa3b('0x26')];}_0x10dd6e['status'](_0x3b1dea)[_0xfa3b('0x27')](_0x358b14);};}exports[_0xfa3b('0x28')]=function(_0x50b721,_0x510d25){var _0x3b5d3a={},_0x3d76a7={},_0xe8788b={'count':0x0,'rows':[]};var _0x47b3a9=db[_0xfa3b('0x29')][_0xfa3b('0x2a')];_0x3d76a7['model']=_[_0xfa3b('0x2b')](_0x47b3a9);_0x3d76a7[_0xfa3b('0x2c')]=_['keys'](_0x50b721[_0xfa3b('0x2c')]);_0x3d76a7[_0xfa3b('0x2d')]=_['intersection'](_0x3d76a7['model'],_0x3d76a7['query']);_0x3b5d3a['attributes']=_[_0xfa3b('0x2e')](_0x3d76a7[_0xfa3b('0x2f')],qs[_0xfa3b('0x30')](_0x50b721[_0xfa3b('0x2c')]['fields']));_0x3b5d3a[_0xfa3b('0x31')]=_0x3b5d3a[_0xfa3b('0x31')][_0xfa3b('0x32')]?_0x3b5d3a[_0xfa3b('0x31')]:_0x3d76a7[_0xfa3b('0x2f')];if(!_0x50b721['query']['hasOwnProperty'](_0xfa3b('0x33'))){_0x3b5d3a['limit']=qs['limit'](_0x50b721[_0xfa3b('0x2c')][_0xfa3b('0x1b')]);_0x3b5d3a[_0xfa3b('0x1a')]=qs[_0xfa3b('0x1a')](_0x50b721[_0xfa3b('0x2c')][_0xfa3b('0x1a')]);}_0x3b5d3a[_0xfa3b('0x34')]=qs[_0xfa3b('0x35')](_0x50b721[_0xfa3b('0x2c')][_0xfa3b('0x35')]);_0x3b5d3a['where']=qs['filters'](_[_0xfa3b('0x36')](_0x50b721[_0xfa3b('0x2c')],_0x3d76a7[_0xfa3b('0x2d')]));if(_0x50b721[_0xfa3b('0x2c')][_0xfa3b('0x37')]){_0x3b5d3a[_0xfa3b('0x38')]=_[_0xfa3b('0x39')](_0x3b5d3a[_0xfa3b('0x38')],{'$or':_[_0xfa3b('0x3a')](_0x47b3a9,function(_0x480338){if(_0x480338[_0xfa3b('0x3b')][_0xfa3b('0x3c')]!==_0xfa3b('0x3d')){var _0x575e5d={};_0x575e5d[_0x480338[_0xfa3b('0x3e')]]={'$like':'%'+_0x50b721['query'][_0xfa3b('0x37')]+'%'};return _0x575e5d;}})});}_0x3b5d3a=_[_0xfa3b('0x39')]({},_0x3b5d3a,_0x50b721[_0xfa3b('0x3f')]);var _0x589dc5={'where':_0x3b5d3a[_0xfa3b('0x38')]};return db['Automation'][_0xfa3b('0x19')](_0x589dc5)['then'](function(_0x2f88e7){_0xe8788b[_0xfa3b('0x19')]=_0x2f88e7;if(_0x50b721['query'][_0xfa3b('0x40')]){_0x3b5d3a[_0xfa3b('0x41')]=[{'all':!![]}];}return db[_0xfa3b('0x29')][_0xfa3b('0x42')](_0x3b5d3a);})['then'](function(_0x36753e){_0xe8788b[_0xfa3b('0x43')]=_0x36753e;return _0xe8788b;})[_0xfa3b('0x22')](respondWithFilteredResult(_0x510d25,_0x3b5d3a))[_0xfa3b('0x44')](handleError(_0x510d25,null));};exports['show']=function(_0x14562d,_0x2a1e5a){var _0x1b01f6={'raw':![],'where':{'id':_0x14562d[_0xfa3b('0x45')]['id']}},_0x5b4a5f={};_0x5b4a5f[_0xfa3b('0x2f')]=_[_0xfa3b('0x2b')](db[_0xfa3b('0x29')][_0xfa3b('0x2a')]);_0x5b4a5f[_0xfa3b('0x2c')]=_[_0xfa3b('0x2b')](_0x14562d[_0xfa3b('0x2c')]);_0x5b4a5f['filters']=_['intersection'](_0x5b4a5f[_0xfa3b('0x2f')],_0x5b4a5f[_0xfa3b('0x2c')]);_0x1b01f6['attributes']=_[_0xfa3b('0x2e')](_0x5b4a5f[_0xfa3b('0x2f')],qs[_0xfa3b('0x30')](_0x14562d['query'][_0xfa3b('0x30')]));_0x1b01f6[_0xfa3b('0x31')]=_0x1b01f6[_0xfa3b('0x31')]['length']?_0x1b01f6['attributes']:_0x5b4a5f[_0xfa3b('0x2f')];if(_0x14562d[_0xfa3b('0x2c')]['includeAll']){_0x1b01f6[_0xfa3b('0x41')]=[{'all':!![]}];}_0x1b01f6=_[_0xfa3b('0x39')]({},_0x1b01f6,_0x14562d['options']);return db[_0xfa3b('0x29')][_0xfa3b('0x46')](_0x1b01f6)['then'](handleEntityNotFound(_0x2a1e5a,null))[_0xfa3b('0x22')](respondWithResult(_0x2a1e5a,null))['catch'](handleError(_0x2a1e5a,null));};exports[_0xfa3b('0x47')]=function(_0x14a6e4,_0x59dc3b){return db['Automation'][_0xfa3b('0x47')](_0x14a6e4['body'],{})['then'](respondWithResult(_0x59dc3b,0xc9))[_0xfa3b('0x44')](handleError(_0x59dc3b,null));};exports[_0xfa3b('0x21')]=function(_0x56f1f7,_0x24524d){if(_0x56f1f7[_0xfa3b('0x48')]['id']){delete _0x56f1f7['body']['id'];}return db[_0xfa3b('0x29')][_0xfa3b('0x46')]({'where':{'id':_0x56f1f7[_0xfa3b('0x45')]['id']}})['then'](handleEntityNotFound(_0x24524d,null))[_0xfa3b('0x22')](saveUpdates(_0x56f1f7[_0xfa3b('0x48')],null))[_0xfa3b('0x22')](respondWithResult(_0x24524d,null))[_0xfa3b('0x44')](handleError(_0x24524d,null));};exports[_0xfa3b('0x23')]=function(_0x1d0cc5,_0x4d9f4e){return db[_0xfa3b('0x29')][_0xfa3b('0x46')]({'where':{'id':_0x1d0cc5[_0xfa3b('0x45')]['id']}})[_0xfa3b('0x22')](handleEntityNotFound(_0x4d9f4e,null))[_0xfa3b('0x22')](removeEntity(_0x4d9f4e,null))[_0xfa3b('0x44')](handleError(_0x4d9f4e,null));};exports['addConditions']=function(_0x4af498,_0x32e9c7,_0x3d0f03){return db[_0xfa3b('0x49')][_0xfa3b('0x46')]({'where':{'id':_0x4af498[_0xfa3b('0x45')]['id']}})[_0xfa3b('0x22')](handleEntityNotFound(_0x32e9c7,null))[_0xfa3b('0x22')](function(_0x215742){if(_0x215742){return _0x215742[_0xfa3b('0x4a')](_0x4af498[_0xfa3b('0x48')][_0xfa3b('0x4b')],_[_0xfa3b('0x4c')](_0x4af498[_0xfa3b('0x48')],[_0xfa3b('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x32e9c7,null))[_0xfa3b('0x44')](handleError(_0x32e9c7,null));};exports[_0xfa3b('0x4d')]=function(_0x18be0c,_0x329b56,_0xd87c1e){var _0x4473a1={};var _0xc46889={};var _0x350bb5;var _0x1f08e4;return db['Automation'][_0xfa3b('0x4e')]({'where':{'id':_0x18be0c[_0xfa3b('0x45')]['id']}})['then'](handleEntityNotFound(_0x329b56,null))[_0xfa3b('0x22')](function(_0x53e2ab){if(_0x53e2ab){_0x350bb5=_0x53e2ab;_0xc46889[_0xfa3b('0x2f')]=_[_0xfa3b('0x2b')](db[_0xfa3b('0x49')][_0xfa3b('0x2a')]);_0xc46889['query']=_[_0xfa3b('0x2b')](_0x18be0c[_0xfa3b('0x2c')]);_0xc46889[_0xfa3b('0x2d')]=_['intersection'](_0xc46889[_0xfa3b('0x2f')],_0xc46889['query']);_0x4473a1[_0xfa3b('0x31')]=_['intersection'](_0xc46889[_0xfa3b('0x2f')],qs[_0xfa3b('0x30')](_0x18be0c['query'][_0xfa3b('0x30')]));_0x4473a1[_0xfa3b('0x31')]=_0x4473a1['attributes']['length']?_0x4473a1['attributes']:_0xc46889['model'];_0x4473a1[_0xfa3b('0x34')]=qs[_0xfa3b('0x35')](_0x18be0c['query']['sort']);_0x4473a1[_0xfa3b('0x38')]=qs[_0xfa3b('0x2d')](_['pick'](_0x18be0c[_0xfa3b('0x2c')],_0xc46889[_0xfa3b('0x2d')]));if(_0x18be0c[_0xfa3b('0x2c')]['filter']){_0x4473a1[_0xfa3b('0x38')]=_[_0xfa3b('0x39')](_0x4473a1[_0xfa3b('0x38')],{'$or':_[_0xfa3b('0x3a')](_0x4473a1[_0xfa3b('0x31')],function(_0x24e58a){var _0x4eab7b={};_0x4eab7b[_0x24e58a]={'$like':'%'+_0x18be0c[_0xfa3b('0x2c')][_0xfa3b('0x37')]+'%'};return _0x4eab7b;})});}_0x4473a1=_[_0xfa3b('0x39')]({},_0x4473a1,_0x18be0c[_0xfa3b('0x3f')]);return _0x350bb5['getConditions'](_0x4473a1);}})[_0xfa3b('0x22')](function(_0x40d5d8){if(_0x40d5d8){_0x1f08e4=_0x40d5d8[_0xfa3b('0x32')];if(!_0x18be0c[_0xfa3b('0x2c')][_0xfa3b('0x4f')]('nolimit')){_0x4473a1[_0xfa3b('0x1b')]=qs[_0xfa3b('0x1b')](_0x18be0c['query'][_0xfa3b('0x1b')]);_0x4473a1[_0xfa3b('0x1a')]=qs[_0xfa3b('0x1a')](_0x18be0c[_0xfa3b('0x2c')][_0xfa3b('0x1a')]);}return _0x350bb5[_0xfa3b('0x4d')](_0x4473a1);}})[_0xfa3b('0x22')](function(_0x3db175){if(_0x3db175){return _0x3db175?{'count':_0x1f08e4,'rows':_0x3db175}:null;}})[_0xfa3b('0x22')](respondWithResult(_0x329b56,null))[_0xfa3b('0x44')](handleError(_0x329b56,null));};exports[_0xfa3b('0x50')]=function(_0x133e0f,_0x15b51d,_0x24e8d5){return db[_0xfa3b('0x51')][_0xfa3b('0x46')]({'where':{'id':_0x133e0f[_0xfa3b('0x45')]['id']}})[_0xfa3b('0x22')](handleEntityNotFound(_0x15b51d,null))[_0xfa3b('0x22')](function(_0x1a8fbd){if(_0x1a8fbd){return _0x1a8fbd[_0xfa3b('0x50')](_0x133e0f[_0xfa3b('0x48')][_0xfa3b('0x4b')],_[_0xfa3b('0x4c')](_0x133e0f['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x15b51d,null))[_0xfa3b('0x44')](handleError(_0x15b51d,null));};exports[_0xfa3b('0x52')]=function(_0x2a227d,_0x2a8db1,_0x5bbba0){var _0x3eeaca={};var _0x18ca97={};var _0xafa267;var _0x2562f4;return db['Automation'][_0xfa3b('0x4e')]({'where':{'id':_0x2a227d[_0xfa3b('0x45')]['id']}})[_0xfa3b('0x22')](handleEntityNotFound(_0x2a8db1,null))['then'](function(_0x5163b0){if(_0x5163b0){_0xafa267=_0x5163b0;_0x18ca97[_0xfa3b('0x2f')]=_['keys'](db[_0xfa3b('0x51')]['rawAttributes']);_0x18ca97[_0xfa3b('0x2c')]=_[_0xfa3b('0x2b')](_0x2a227d[_0xfa3b('0x2c')]);_0x18ca97[_0xfa3b('0x2d')]=_[_0xfa3b('0x2e')](_0x18ca97['model'],_0x18ca97[_0xfa3b('0x2c')]);_0x3eeaca[_0xfa3b('0x31')]=_[_0xfa3b('0x2e')](_0x18ca97[_0xfa3b('0x2f')],qs[_0xfa3b('0x30')](_0x2a227d['query'][_0xfa3b('0x30')]));_0x3eeaca[_0xfa3b('0x31')]=_0x3eeaca[_0xfa3b('0x31')]['length']?_0x3eeaca[_0xfa3b('0x31')]:_0x18ca97[_0xfa3b('0x2f')];_0x3eeaca[_0xfa3b('0x34')]=qs[_0xfa3b('0x35')](_0x2a227d['query']['sort']);_0x3eeaca[_0xfa3b('0x38')]=qs['filters'](_[_0xfa3b('0x36')](_0x2a227d['query'],_0x18ca97[_0xfa3b('0x2d')]));if(_0x2a227d[_0xfa3b('0x2c')]['filter']){_0x3eeaca['where']=_[_0xfa3b('0x39')](_0x3eeaca['where'],{'$or':_[_0xfa3b('0x3a')](_0x3eeaca['attributes'],function(_0x2db020){var _0x53404d={};_0x53404d[_0x2db020]={'$like':'%'+_0x2a227d[_0xfa3b('0x2c')]['filter']+'%'};return _0x53404d;})});}_0x3eeaca=_['merge']({},_0x3eeaca,_0x2a227d[_0xfa3b('0x3f')]);return _0xafa267[_0xfa3b('0x52')](_0x3eeaca);}})[_0xfa3b('0x22')](function(_0x30de2b){if(_0x30de2b){_0x2562f4=_0x30de2b['length'];if(!_0x2a227d[_0xfa3b('0x2c')][_0xfa3b('0x4f')](_0xfa3b('0x33'))){_0x3eeaca[_0xfa3b('0x1b')]=qs['limit'](_0x2a227d[_0xfa3b('0x2c')][_0xfa3b('0x1b')]);_0x3eeaca[_0xfa3b('0x1a')]=qs[_0xfa3b('0x1a')](_0x2a227d[_0xfa3b('0x2c')]['offset']);}return _0xafa267['getActions'](_0x3eeaca);}})['then'](function(_0x5aaad3){if(_0x5aaad3){return _0x5aaad3?{'count':_0x2562f4,'rows':_0x5aaad3}:null;}})['then'](respondWithResult(_0x2a8db1,null))[_0xfa3b('0x44')](handleError(_0x2a8db1,null));}; \ No newline at end of file +var _0x93df=['order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','keys','length','find','create','body','destroy','addConditions','ids','getConditions','Condition','Action','addActions','omit','getActions','html-pdf','rimraf','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','error','name','send','index','Automation','rawAttributes','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit'];(function(_0x100918,_0x224f2f){var _0x11baa4=function(_0xfcc4a7){while(--_0xfcc4a7){_0x100918['push'](_0x100918['shift']());}};_0x11baa4(++_0x224f2f);}(_0x93df,0x6e));var _0xf93d=function(_0x33cab0,_0x4dc044){_0x33cab0=_0x33cab0-0x0;var _0x4fbfb7=_0x93df[_0x33cab0];return _0x4fbfb7;};'use strict';var pdf=require(_0xf93d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf93d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf93d('0x2'));var BPromise=require(_0xf93d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf93d('0x4'));var sox=require(_0xf93d('0x5'));var csv=require(_0xf93d('0x6'));var ejs=require(_0xf93d('0x7'));var fs=require('fs');var _=require(_0xf93d('0x8'));var squel=require(_0xf93d('0x9'));var crypto=require('crypto');var jsforce=require(_0xf93d('0xa'));var deskjs=require(_0xf93d('0xb'));var toCsv=require(_0xf93d('0x6'));var querystring=require(_0xf93d('0xc'));var Papa=require(_0xf93d('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0xf93d('0xe'));var Redis=require(_0xf93d('0xf'));var qs=require(_0xf93d('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf93d('0x11'));var db=require(_0xf93d('0x12'))['db'];function respondWithStatusCode(_0x11fecb,_0x1e6545){_0x1e6545=_0x1e6545||0xcc;return function(_0x3c11dc){if(_0x3c11dc){return _0x11fecb[_0xf93d('0x13')](_0x1e6545);}return _0x11fecb[_0xf93d('0x14')](_0x1e6545)[_0xf93d('0x15')]();};}function respondWithResult(_0x3929a3,_0x47268e){_0x47268e=_0x47268e||0xc8;return function(_0x36a93b){if(_0x36a93b){return _0x3929a3['status'](_0x47268e)[_0xf93d('0x16')](_0x36a93b);}};}function respondWithFilteredResult(_0x100b9a,_0x4cceda){return function(_0x4aeb26){if(_0x4aeb26){var _0x5b5e90=_0x4aeb26[_0xf93d('0x17')],_0x2afd30=_0x4cceda[_0xf93d('0x18')],_0x353db1=_0x4cceda['offset']+_0x4cceda['limit'],_0x54d7c5;if(_0x353db1>=_0x5b5e90){_0x353db1=_0x5b5e90;_0x54d7c5=0xc8;}else{_0x54d7c5=0xce;}_0x100b9a['status'](_0x54d7c5);return _0x100b9a[_0xf93d('0x19')]('Content-Range',_0x2afd30+'-'+_0x353db1+'/'+_0x5b5e90)[_0xf93d('0x16')](_0x4aeb26);}return null;};}function patchUpdates(_0x4f9575){return function(_0x34a875){try{jsonpatch[_0xf93d('0x1a')](_0x34a875,_0x4f9575,!![]);}catch(_0x1eb3a8){return BPromise[_0xf93d('0x1b')](_0x1eb3a8);}return _0x34a875[_0xf93d('0x1c')]();};}function saveUpdates(_0x105dd0,_0x8bd7d0){return function(_0x64e776){if(_0x64e776){return _0x64e776[_0xf93d('0x1d')](_0x105dd0)[_0xf93d('0x1e')](function(_0x58501f){return _0x58501f;});}return null;};}function removeEntity(_0xd361eb,_0x20230a){return function(_0x3b779b){if(_0x3b779b){return _0x3b779b['destroy']()[_0xf93d('0x1e')](function(){_0xd361eb[_0xf93d('0x14')](0xcc)[_0xf93d('0x15')]();});}};}function handleEntityNotFound(_0x148e07,_0x210903){return function(_0x415021){if(!_0x415021){_0x148e07[_0xf93d('0x13')](0x194);}return _0x415021;};}function handleError(_0x2e36d8,_0x4a9106){_0x4a9106=_0x4a9106||0x1f4;return function(_0x17752d){logger[_0xf93d('0x1f')](_0x17752d['stack']);if(_0x17752d[_0xf93d('0x20')]){delete _0x17752d['name'];}_0x2e36d8[_0xf93d('0x14')](_0x4a9106)[_0xf93d('0x21')](_0x17752d);};}exports[_0xf93d('0x22')]=function(_0x24759c,_0x15e51a){var _0x4129c9={},_0x61c069={},_0xfae150={'count':0x0,'rows':[]};var _0x29d488=db[_0xf93d('0x23')][_0xf93d('0x24')];_0x61c069[_0xf93d('0x25')]=_['keys'](_0x29d488);_0x61c069[_0xf93d('0x26')]=_['keys'](_0x24759c[_0xf93d('0x26')]);_0x61c069[_0xf93d('0x27')]=_['intersection'](_0x61c069['model'],_0x61c069[_0xf93d('0x26')]);_0x4129c9[_0xf93d('0x28')]=_[_0xf93d('0x29')](_0x61c069['model'],qs[_0xf93d('0x2a')](_0x24759c[_0xf93d('0x26')][_0xf93d('0x2a')]));_0x4129c9['attributes']=_0x4129c9[_0xf93d('0x28')]['length']?_0x4129c9[_0xf93d('0x28')]:_0x61c069[_0xf93d('0x25')];if(!_0x24759c[_0xf93d('0x26')][_0xf93d('0x2b')](_0xf93d('0x2c'))){_0x4129c9[_0xf93d('0x2d')]=qs[_0xf93d('0x2d')](_0x24759c[_0xf93d('0x26')]['limit']);_0x4129c9[_0xf93d('0x18')]=qs['offset'](_0x24759c['query'][_0xf93d('0x18')]);}_0x4129c9[_0xf93d('0x2e')]=qs[_0xf93d('0x2f')](_0x24759c['query'][_0xf93d('0x2f')]);_0x4129c9['where']=qs['filters'](_[_0xf93d('0x30')](_0x24759c[_0xf93d('0x26')],_0x61c069[_0xf93d('0x27')]));if(_0x24759c['query'][_0xf93d('0x31')]){_0x4129c9[_0xf93d('0x32')]=_[_0xf93d('0x33')](_0x4129c9[_0xf93d('0x32')],{'$or':_[_0xf93d('0x34')](_0x29d488,function(_0x34c08e){if(_0x34c08e[_0xf93d('0x35')][_0xf93d('0x36')]!==_0xf93d('0x37')){var _0xe4f760={};_0xe4f760[_0x34c08e[_0xf93d('0x38')]]={'$like':'%'+_0x24759c[_0xf93d('0x26')][_0xf93d('0x31')]+'%'};return _0xe4f760;}})});}_0x4129c9=_[_0xf93d('0x33')]({},_0x4129c9,_0x24759c[_0xf93d('0x39')]);var _0x10e6a3={'where':_0x4129c9[_0xf93d('0x32')]};return db[_0xf93d('0x23')][_0xf93d('0x17')](_0x10e6a3)[_0xf93d('0x1e')](function(_0x2bcc0f){_0xfae150[_0xf93d('0x17')]=_0x2bcc0f;if(_0x24759c[_0xf93d('0x26')][_0xf93d('0x3a')]){_0x4129c9[_0xf93d('0x3b')]=[{'all':!![]}];}return db[_0xf93d('0x23')]['findAll'](_0x4129c9);})['then'](function(_0x458ba8){_0xfae150[_0xf93d('0x3c')]=_0x458ba8;return _0xfae150;})[_0xf93d('0x1e')](respondWithFilteredResult(_0x15e51a,_0x4129c9))[_0xf93d('0x3d')](handleError(_0x15e51a,null));};exports[_0xf93d('0x3e')]=function(_0x10cfd4,_0x29db4e){var _0x39a9b6={'raw':![],'where':{'id':_0x10cfd4[_0xf93d('0x3f')]['id']}},_0x3a8c43={};_0x3a8c43[_0xf93d('0x25')]=_[_0xf93d('0x40')](db[_0xf93d('0x23')][_0xf93d('0x24')]);_0x3a8c43[_0xf93d('0x26')]=_[_0xf93d('0x40')](_0x10cfd4[_0xf93d('0x26')]);_0x3a8c43[_0xf93d('0x27')]=_[_0xf93d('0x29')](_0x3a8c43[_0xf93d('0x25')],_0x3a8c43[_0xf93d('0x26')]);_0x39a9b6[_0xf93d('0x28')]=_[_0xf93d('0x29')](_0x3a8c43['model'],qs[_0xf93d('0x2a')](_0x10cfd4[_0xf93d('0x26')][_0xf93d('0x2a')]));_0x39a9b6['attributes']=_0x39a9b6[_0xf93d('0x28')][_0xf93d('0x41')]?_0x39a9b6[_0xf93d('0x28')]:_0x3a8c43['model'];if(_0x10cfd4['query'][_0xf93d('0x3a')]){_0x39a9b6[_0xf93d('0x3b')]=[{'all':!![]}];}_0x39a9b6=_[_0xf93d('0x33')]({},_0x39a9b6,_0x10cfd4['options']);return db['Automation'][_0xf93d('0x42')](_0x39a9b6)[_0xf93d('0x1e')](handleEntityNotFound(_0x29db4e,null))['then'](respondWithResult(_0x29db4e,null))[_0xf93d('0x3d')](handleError(_0x29db4e,null));};exports[_0xf93d('0x43')]=function(_0x129113,_0x1951d8){return db['Automation'][_0xf93d('0x43')](_0x129113[_0xf93d('0x44')],{})[_0xf93d('0x1e')](respondWithResult(_0x1951d8,0xc9))[_0xf93d('0x3d')](handleError(_0x1951d8,null));};exports[_0xf93d('0x1d')]=function(_0x552c26,_0x4554ae){if(_0x552c26[_0xf93d('0x44')]['id']){delete _0x552c26[_0xf93d('0x44')]['id'];}return db['Automation'][_0xf93d('0x42')]({'where':{'id':_0x552c26[_0xf93d('0x3f')]['id']}})[_0xf93d('0x1e')](handleEntityNotFound(_0x4554ae,null))[_0xf93d('0x1e')](saveUpdates(_0x552c26[_0xf93d('0x44')],null))[_0xf93d('0x1e')](respondWithResult(_0x4554ae,null))[_0xf93d('0x3d')](handleError(_0x4554ae,null));};exports[_0xf93d('0x45')]=function(_0x419319,_0x5ab116){return db['Automation']['find']({'where':{'id':_0x419319[_0xf93d('0x3f')]['id']}})[_0xf93d('0x1e')](handleEntityNotFound(_0x5ab116,null))[_0xf93d('0x1e')](removeEntity(_0x5ab116,null))[_0xf93d('0x3d')](handleError(_0x5ab116,null));};exports['addConditions']=function(_0x162b3a,_0x5ded61,_0x6786d4){return db['Condition']['find']({'where':{'id':_0x162b3a[_0xf93d('0x3f')]['id']}})[_0xf93d('0x1e')](handleEntityNotFound(_0x5ded61,null))[_0xf93d('0x1e')](function(_0x4eb87a){if(_0x4eb87a){return _0x4eb87a[_0xf93d('0x46')](_0x162b3a[_0xf93d('0x44')][_0xf93d('0x47')],_['omit'](_0x162b3a['body'],[_0xf93d('0x47'),'id'])||{});}})[_0xf93d('0x1e')](respondWithResult(_0x5ded61,null))[_0xf93d('0x3d')](handleError(_0x5ded61,null));};exports[_0xf93d('0x48')]=function(_0x210f8d,_0x10d28c,_0x15d1f4){var _0x44cfd1={};var _0x4ece76={};var _0x2eb15b;var _0x5e9ab5;return db[_0xf93d('0x23')]['findOne']({'where':{'id':_0x210f8d[_0xf93d('0x3f')]['id']}})[_0xf93d('0x1e')](handleEntityNotFound(_0x10d28c,null))[_0xf93d('0x1e')](function(_0x5c35e4){if(_0x5c35e4){_0x2eb15b=_0x5c35e4;_0x4ece76[_0xf93d('0x25')]=_[_0xf93d('0x40')](db[_0xf93d('0x49')]['rawAttributes']);_0x4ece76[_0xf93d('0x26')]=_[_0xf93d('0x40')](_0x210f8d[_0xf93d('0x26')]);_0x4ece76[_0xf93d('0x27')]=_['intersection'](_0x4ece76[_0xf93d('0x25')],_0x4ece76[_0xf93d('0x26')]);_0x44cfd1[_0xf93d('0x28')]=_[_0xf93d('0x29')](_0x4ece76['model'],qs['fields'](_0x210f8d[_0xf93d('0x26')][_0xf93d('0x2a')]));_0x44cfd1[_0xf93d('0x28')]=_0x44cfd1[_0xf93d('0x28')][_0xf93d('0x41')]?_0x44cfd1[_0xf93d('0x28')]:_0x4ece76[_0xf93d('0x25')];_0x44cfd1[_0xf93d('0x2e')]=qs['sort'](_0x210f8d[_0xf93d('0x26')][_0xf93d('0x2f')]);_0x44cfd1[_0xf93d('0x32')]=qs['filters'](_['pick'](_0x210f8d[_0xf93d('0x26')],_0x4ece76[_0xf93d('0x27')]));if(_0x210f8d[_0xf93d('0x26')][_0xf93d('0x31')]){_0x44cfd1[_0xf93d('0x32')]=_[_0xf93d('0x33')](_0x44cfd1[_0xf93d('0x32')],{'$or':_[_0xf93d('0x34')](_0x44cfd1[_0xf93d('0x28')],function(_0x3699f6){var _0x4946b6={};_0x4946b6[_0x3699f6]={'$like':'%'+_0x210f8d[_0xf93d('0x26')][_0xf93d('0x31')]+'%'};return _0x4946b6;})});}_0x44cfd1=_['merge']({},_0x44cfd1,_0x210f8d[_0xf93d('0x39')]);return _0x2eb15b['getConditions'](_0x44cfd1);}})['then'](function(_0x18d68e){if(_0x18d68e){_0x5e9ab5=_0x18d68e['length'];if(!_0x210f8d[_0xf93d('0x26')][_0xf93d('0x2b')](_0xf93d('0x2c'))){_0x44cfd1['limit']=qs[_0xf93d('0x2d')](_0x210f8d[_0xf93d('0x26')]['limit']);_0x44cfd1[_0xf93d('0x18')]=qs[_0xf93d('0x18')](_0x210f8d[_0xf93d('0x26')][_0xf93d('0x18')]);}return _0x2eb15b['getConditions'](_0x44cfd1);}})[_0xf93d('0x1e')](function(_0x2ace0b){if(_0x2ace0b){return _0x2ace0b?{'count':_0x5e9ab5,'rows':_0x2ace0b}:null;}})[_0xf93d('0x1e')](respondWithResult(_0x10d28c,null))[_0xf93d('0x3d')](handleError(_0x10d28c,null));};exports['addActions']=function(_0x225f95,_0x3e0516,_0x150699){return db[_0xf93d('0x4a')][_0xf93d('0x42')]({'where':{'id':_0x225f95[_0xf93d('0x3f')]['id']}})[_0xf93d('0x1e')](handleEntityNotFound(_0x3e0516,null))['then'](function(_0x928624){if(_0x928624){return _0x928624[_0xf93d('0x4b')](_0x225f95[_0xf93d('0x44')]['ids'],_[_0xf93d('0x4c')](_0x225f95[_0xf93d('0x44')],[_0xf93d('0x47'),'id'])||{});}})[_0xf93d('0x1e')](respondWithResult(_0x3e0516,null))[_0xf93d('0x3d')](handleError(_0x3e0516,null));};exports['getActions']=function(_0x2e29e8,_0x411dc4,_0x4af312){var _0x2cedda={};var _0x3fe14e={};var _0x26abda;var _0x2e8cee;return db[_0xf93d('0x23')]['findOne']({'where':{'id':_0x2e29e8[_0xf93d('0x3f')]['id']}})[_0xf93d('0x1e')](handleEntityNotFound(_0x411dc4,null))[_0xf93d('0x1e')](function(_0x5af7df){if(_0x5af7df){_0x26abda=_0x5af7df;_0x3fe14e[_0xf93d('0x25')]=_[_0xf93d('0x40')](db['Action'][_0xf93d('0x24')]);_0x3fe14e[_0xf93d('0x26')]=_[_0xf93d('0x40')](_0x2e29e8['query']);_0x3fe14e[_0xf93d('0x27')]=_[_0xf93d('0x29')](_0x3fe14e['model'],_0x3fe14e[_0xf93d('0x26')]);_0x2cedda[_0xf93d('0x28')]=_[_0xf93d('0x29')](_0x3fe14e[_0xf93d('0x25')],qs['fields'](_0x2e29e8[_0xf93d('0x26')][_0xf93d('0x2a')]));_0x2cedda[_0xf93d('0x28')]=_0x2cedda[_0xf93d('0x28')]['length']?_0x2cedda[_0xf93d('0x28')]:_0x3fe14e[_0xf93d('0x25')];_0x2cedda[_0xf93d('0x2e')]=qs[_0xf93d('0x2f')](_0x2e29e8[_0xf93d('0x26')][_0xf93d('0x2f')]);_0x2cedda[_0xf93d('0x32')]=qs[_0xf93d('0x27')](_[_0xf93d('0x30')](_0x2e29e8['query'],_0x3fe14e[_0xf93d('0x27')]));if(_0x2e29e8['query']['filter']){_0x2cedda[_0xf93d('0x32')]=_[_0xf93d('0x33')](_0x2cedda[_0xf93d('0x32')],{'$or':_[_0xf93d('0x34')](_0x2cedda['attributes'],function(_0x133f38){var _0x4b1d1a={};_0x4b1d1a[_0x133f38]={'$like':'%'+_0x2e29e8[_0xf93d('0x26')]['filter']+'%'};return _0x4b1d1a;})});}_0x2cedda=_[_0xf93d('0x33')]({},_0x2cedda,_0x2e29e8[_0xf93d('0x39')]);return _0x26abda[_0xf93d('0x4d')](_0x2cedda);}})['then'](function(_0x37bb04){if(_0x37bb04){_0x2e8cee=_0x37bb04[_0xf93d('0x41')];if(!_0x2e29e8[_0xf93d('0x26')][_0xf93d('0x2b')]('nolimit')){_0x2cedda[_0xf93d('0x2d')]=qs['limit'](_0x2e29e8['query'][_0xf93d('0x2d')]);_0x2cedda['offset']=qs[_0xf93d('0x18')](_0x2e29e8[_0xf93d('0x26')][_0xf93d('0x18')]);}return _0x26abda['getActions'](_0x2cedda);}})[_0xf93d('0x1e')](function(_0x40c7b0){if(_0x40c7b0){return _0x40c7b0?{'count':_0x2e8cee,'rows':_0x40c7b0}:null;}})[_0xf93d('0x1e')](respondWithResult(_0x411dc4,null))[_0xf93d('0x3d')](handleError(_0x411dc4,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 7692738..38bfc0d 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 _0x4732=['exports','Automation','tools_automations','lodash','../../config/logger','moment','bluebird','request-promise','./automation.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4732,0x17d));var _0x2473=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4732[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x2473('0x0'));var util=require('util');var logger=require(_0x2473('0x1'))('api');var moment=require(_0x2473('0x2'));var BPromise=require(_0x2473('0x3'));var rp=require(_0x2473('0x4'));var attributes=require(_0x2473('0x5'));module[_0x2473('0x6')]=function(_0x2a6bfe,_0x19a2cd){return _0x2a6bfe['define'](_0x2473('0x7'),attributes,{'tableName':_0x2473('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ea1=['../../config/logger','api','moment','bluebird','request-promise','./automation.attributes','exports','define','Automation','tools_automations','util'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4ea1,0x1ac));var _0x14ea=function(_0x3266a0,_0x2cf10c){_0x3266a0=_0x3266a0-0x0;var _0x2cdf22=_0x4ea1[_0x3266a0];return _0x2cdf22;};'use strict';var _=require('lodash');var util=require(_0x14ea('0x0'));var logger=require(_0x14ea('0x1'))(_0x14ea('0x2'));var moment=require(_0x14ea('0x3'));var BPromise=require(_0x14ea('0x4'));var rp=require(_0x14ea('0x5'));var attributes=require(_0x14ea('0x6'));module[_0x14ea('0x7')]=function(_0x220b1e,_0x115dd7){return _0x220b1e[_0x14ea('0x8')](_0x14ea('0x9'),attributes,{'tableName':_0x14ea('0xa'),'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 805c6d5..7fdb07f 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 _0x869e=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x369a3a,_0x5c99bb){var _0x1d7a47=function(_0x3b0501){while(--_0x3b0501){_0x369a3a['push'](_0x369a3a['shift']());}};_0x1d7a47(++_0x5c99bb);}(_0x869e,0x15c));var _0xe869=function(_0xe11d16,_0xe8f799){_0xe11d16=_0xe11d16-0x0;var _0x550a22=_0x869e[_0xe11d16];return _0x550a22;};'use strict';var _=require(_0xe869('0x0'));var util=require(_0xe869('0x1'));var moment=require(_0xe869('0x2'));var BPromise=require('bluebird');var rs=require(_0xe869('0x3'));var fs=require('fs');var Redis=require(_0xe869('0x4'));var db=require(_0xe869('0x5'))['db'];var utils=require(_0xe869('0x6'));var logger=require(_0xe869('0x7'))('rpc');var config=require(_0xe869('0x8'));var jayson=require(_0xe869('0x9'));var client=jayson[_0xe869('0xa')][_0xe869('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x587ead,_0x4e201a,_0xb3936){return new BPromise(function(_0x296feb,_0x2fcf82){return client[_0xe869('0xc')](_0x587ead,_0xb3936)[_0xe869('0xd')](function(_0x3a0162){logger[_0xe869('0xe')](_0xe869('0xf'),_0x4e201a,'request\x20sent');logger['debug'](_0xe869('0x10'),_0x4e201a,_0xe869('0x11'),JSON[_0xe869('0x12')](_0x3a0162));if(_0x3a0162[_0xe869('0x13')]){if(_0x3a0162['error']['code']===0x1f4){logger[_0xe869('0x13')]('Automation,\x20%s,\x20%s',_0x4e201a,_0x3a0162[_0xe869('0x13')][_0xe869('0x14')]);return _0x2fcf82(_0x3a0162['error'][_0xe869('0x14')]);}logger[_0xe869('0x13')](_0xe869('0xf'),_0x4e201a,_0x3a0162[_0xe869('0x13')][_0xe869('0x14')]);return _0x296feb(_0x3a0162['error']['message']);}else{logger['info'](_0xe869('0xf'),_0x4e201a,'request\x20sent');_0x296feb(_0x3a0162[_0xe869('0x15')][_0xe869('0x14')]);}})[_0xe869('0x16')](function(_0x51c4c1){logger[_0xe869('0x13')](_0xe869('0xf'),_0x4e201a,_0x51c4c1);_0x2fcf82(_0x51c4c1);});});} \ No newline at end of file +var _0x34a5=['stringify','error','message','info','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x34a5,0xc2));var _0x534a=function(_0x5c5299,_0x2c419c){_0x5c5299=_0x5c5299-0x0;var _0x270cd6=_0x34a5[_0x5c5299];return _0x270cd6;};'use strict';var _=require(_0x534a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x534a('0x1'));var fs=require('fs');var Redis=require(_0x534a('0x2'));var db=require(_0x534a('0x3'))['db'];var utils=require(_0x534a('0x4'));var logger=require(_0x534a('0x5'))(_0x534a('0x6'));var config=require(_0x534a('0x7'));var jayson=require(_0x534a('0x8'));var client=jayson[_0x534a('0x9')][_0x534a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27b2cd,_0x31a4e7,_0x167ea5){return new BPromise(function(_0x3c85e8,_0x10ebcc){return client['request'](_0x27b2cd,_0x167ea5)[_0x534a('0xb')](function(_0x3d86ff){logger['info'](_0x534a('0xc'),_0x31a4e7,_0x534a('0xd'));logger[_0x534a('0xe')](_0x534a('0xf'),_0x31a4e7,_0x534a('0xd'),JSON[_0x534a('0x10')](_0x3d86ff));if(_0x3d86ff[_0x534a('0x11')]){if(_0x3d86ff[_0x534a('0x11')]['code']===0x1f4){logger[_0x534a('0x11')](_0x534a('0xc'),_0x31a4e7,_0x3d86ff['error'][_0x534a('0x12')]);return _0x10ebcc(_0x3d86ff[_0x534a('0x11')][_0x534a('0x12')]);}logger[_0x534a('0x11')](_0x534a('0xc'),_0x31a4e7,_0x3d86ff['error'][_0x534a('0x12')]);return _0x3c85e8(_0x3d86ff[_0x534a('0x11')][_0x534a('0x12')]);}else{logger[_0x534a('0x13')](_0x534a('0xc'),_0x31a4e7,_0x534a('0xd'));_0x3c85e8(_0x3d86ff[_0x534a('0x14')][_0x534a('0x12')]);}})['catch'](function(_0x4f2a7d){logger['error']('Automation,\x20%s,\x20%s',_0x31a4e7,_0x4f2a7d);_0x10ebcc(_0x4f2a7d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 32eb718..f41e369 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 _0xe813=['create','post','addConditions','addActions','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','/:id/actions','getActions'];(function(_0x587439,_0x153c32){var _0x138c81=function(_0x36bb26){while(--_0x36bb26){_0x587439['push'](_0x587439['shift']());}};_0x138c81(++_0x153c32);}(_0xe813,0x1b2));var _0x3e81=function(_0x43af80,_0x1a300e){_0x43af80=_0x43af80-0x0;var _0x26c0ea=_0xe813[_0x43af80];return _0x26c0ea;};'use strict';var multer=require('multer');var util=require(_0x3e81('0x0'));var path=require(_0x3e81('0x1'));var timeout=require(_0x3e81('0x2'));var express=require('express');var router=express[_0x3e81('0x3')]();var auth=require(_0x3e81('0x4'));var interaction=require(_0x3e81('0x5'));var config=require(_0x3e81('0x6'));var controller=require(_0x3e81('0x7'));router['get']('/',auth[_0x3e81('0x8')](),controller[_0x3e81('0x9')]);router[_0x3e81('0xa')](_0x3e81('0xb'),auth['isAuthenticated'](),controller[_0x3e81('0xc')]);router[_0x3e81('0xa')](_0x3e81('0xd'),auth[_0x3e81('0x8')](),controller['getConditions']);router['get'](_0x3e81('0xe'),auth[_0x3e81('0x8')](),controller[_0x3e81('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3e81('0x10')]);router[_0x3e81('0x11')](_0x3e81('0xd'),auth['isAuthenticated'](),controller[_0x3e81('0x12')]);router['post'](_0x3e81('0xe'),auth['isAuthenticated'](),controller[_0x3e81('0x13')]);router[_0x3e81('0x14')](_0x3e81('0xb'),auth[_0x3e81('0x8')](),controller[_0x3e81('0x15')]);router[_0x3e81('0x16')](_0x3e81('0xb'),auth['isAuthenticated'](),controller[_0x3e81('0x17')]);module[_0x3e81('0x18')]=router; \ No newline at end of file +var _0xf417=['path','connect-timeout','Router','../../config/environment','get','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','addConditions','post','addActions','/:id','destroy','util'];(function(_0x239e42,_0x39bc11){var _0x47af3d=function(_0x576992){while(--_0x576992){_0x239e42['push'](_0x239e42['shift']());}};_0x47af3d(++_0x39bc11);}(_0xf417,0x8f));var _0x7f41=function(_0x29f1b5,_0x19ac42){_0x29f1b5=_0x29f1b5-0x0;var _0x5bcfbd=_0xf417[_0x29f1b5];return _0x5bcfbd;};'use strict';var multer=require('multer');var util=require(_0x7f41('0x0'));var path=require(_0x7f41('0x1'));var timeout=require(_0x7f41('0x2'));var express=require('express');var router=express[_0x7f41('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f41('0x4'));var controller=require('./automation.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7f41('0x5')]('/:id',auth[_0x7f41('0x6')](),controller[_0x7f41('0x7')]);router['get'](_0x7f41('0x8'),auth['isAuthenticated'](),controller[_0x7f41('0x9')]);router['get'](_0x7f41('0xa'),auth[_0x7f41('0x6')](),controller['getActions']);router['post']('/',auth[_0x7f41('0x6')](),controller['create']);router['post'](_0x7f41('0x8'),auth[_0x7f41('0x6')](),controller[_0x7f41('0xb')]);router[_0x7f41('0xc')](_0x7f41('0xa'),auth[_0x7f41('0x6')](),controller[_0x7f41('0xd')]);router['put']('/:id',auth[_0x7f41('0x6')](),controller['update']);router['delete'](_0x7f41('0xe'),auth[_0x7f41('0x6')](),controller[_0x7f41('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 699f773..6a5df8d 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 _0xd6b7=['INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','STRING','name','ENUM','Active/Disactive\x20Campaign'];(function(_0x928b87,_0x53480a){var _0x1e7638=function(_0x1e2184){while(--_0x1e2184){_0x928b87['push'](_0x928b87['shift']());}};_0x1e7638(++_0x53480a);}(_0xd6b7,0xb5));var _0x7d6b=function(_0x4dffbb,_0x19b127){_0x4dffbb=_0x4dffbb-0x0;var _0x43a5d1=_0xd6b7[_0x4dffbb];return _0x43a5d1;};'use strict';var Sequelize=require(_0x7d6b('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d6b('0x1')],'unique':_0x7d6b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7d6b('0x3')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7d6b('0x4')},'limitCalls':{'type':Sequelize[_0x7d6b('0x5')](0x4)[_0x7d6b('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7d6b('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7d6b('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7d6b('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x7d6b('0x5')](0x3)[_0x7d6b('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d6b('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7d6b('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d6b('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7d6b('0x5')](0x5)[_0x7d6b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7d6b('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x7d6b('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7d6b('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7d6b('0x5')](0x5)[_0x7d6b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7d6b('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7d6b('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x7d6b('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7d6b('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7d6b('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7d6b('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7d6b('0x1')],'defaultValue':_0x7d6b('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x7d6b('0x3')]('always',_0x7d6b('0x10'),_0x7d6b('0x11')),'defaultValue':_0x7d6b('0x12')},'dialAMDActive':{'type':Sequelize[_0x7d6b('0x13')],'defaultValue':0x0,'comment':_0x7d6b('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x7d6b('0x5')](0x9)[_0x7d6b('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7d6b('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7d6b('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7d6b('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7d6b('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7d6b('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7d6b('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x7d6b('0x5')](0x9)[_0x7d6b('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7d6b('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7d6b('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7d6b('0x5')](0x5)[_0x7d6b('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7d6b('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7d6b('0x5')](0x9)[_0x7d6b('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7d6b('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7d6b('0x3')]('DESC',_0x7d6b('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7d6b('0x1d')},'dialCutDigit':{'type':Sequelize[_0x7d6b('0x5')](0x3)[_0x7d6b('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7d6b('0x1e')}}; \ No newline at end of file +var _0xa7f0=['sequelize','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','never','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x50f2a6,_0x4b98b8){var _0x313ada=function(_0xb8c669){while(--_0xb8c669){_0x50f2a6['push'](_0x50f2a6['shift']());}};_0x313ada(++_0x4b98b8);}(_0xa7f0,0xfd));var _0x0a7f=function(_0x41669e,_0x5bff34){_0x41669e=_0x41669e-0x0;var _0x2fcb72=_0xa7f0[_0x41669e];return _0x2fcb72;};'use strict';var Sequelize=require(_0x0a7f('0x0'));module['exports']={'name':{'type':Sequelize[_0x0a7f('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0a7f('0x2')](_0x0a7f('0x3')),'allowNull':![],'defaultValue':_0x0a7f('0x3')},'description':{'type':Sequelize[_0x0a7f('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0a7f('0x4')},'limitCalls':{'type':Sequelize[_0x0a7f('0x5')](0x4)[_0x0a7f('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0a7f('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a7f('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a7f('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a7f('0x5')](0x3)[_0x0a7f('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a7f('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7f('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0a7f('0x5')](0x5)[_0x0a7f('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7f('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a7f('0x5')](0x3)[_0x0a7f('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a7f('0x5')](0x5)[_0x0a7f('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a7f('0x6')],'defaultValue':0x3,'comment':_0x0a7f('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7f('0xb')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a7f('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0a7f('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a7f('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x0a7f('0xc'),'onlyIfOpen'),'defaultValue':_0x0a7f('0xd')},'dialAMDActive':{'type':Sequelize[_0x0a7f('0xe')],'defaultValue':0x0,'comment':_0x0a7f('0xf')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0a7f('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a7f('0x10')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a7f('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a7f('0x5')](0x9)[_0x0a7f('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a7f('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a7f('0x5')](0x9)[_0x0a7f('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a7f('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0a7f('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0a7f('0x5')](0x5)[_0x0a7f('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a7f('0x13')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0a7f('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x0a7f('0x2')](_0x0a7f('0x14'),_0x0a7f('0x15')),'defaultValue':_0x0a7f('0x14')},'dialPrefix':{'type':Sequelize[_0x0a7f('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0a7f('0x5')](0x3)[_0x0a7f('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a7f('0x16')},'dialCutDigit':{'type':Sequelize[_0x0a7f('0x5')](0x3)[_0x0a7f('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index ec3859f..930b89a 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 _0x6a12=['CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','push','sequelize','all','removeLists','addBlackLists','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','Campaign','rawAttributes','model','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','merge','map','key','VIRTUAL','field','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','CmHopper','nolimit','order','pick','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals'];(function(_0x5d2203,_0x439e1c){var _0x5d2e97=function(_0x56e4cd){while(--_0x56e4cd){_0x5d2203['push'](_0x5d2203['shift']());}};_0x5d2e97(++_0x439e1c);}(_0x6a12,0xad));var _0x26a1=function(_0x463ad8,_0x495c09){_0x463ad8=_0x463ad8-0x0;var _0x73e793=_0x6a12[_0x463ad8];return _0x73e793;};'use strict';var pdf=require(_0x26a1('0x0'));var emlformat=require(_0x26a1('0x1'));var rimraf=require(_0x26a1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26a1('0x3'));var rp=require(_0x26a1('0x4'));var moment=require(_0x26a1('0x5'));var BPromise=require(_0x26a1('0x6'));var Mustache=require(_0x26a1('0x7'));var util=require('util');var path=require(_0x26a1('0x8'));var sox=require(_0x26a1('0x9'));var csv=require(_0x26a1('0xa'));var ejs=require(_0x26a1('0xb'));var fs=require('fs');var _=require(_0x26a1('0xc'));var squel=require(_0x26a1('0xd'));var crypto=require(_0x26a1('0xe'));var jsforce=require(_0x26a1('0xf'));var deskjs=require(_0x26a1('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x26a1('0x11'));var Redis=require(_0x26a1('0x12'));var qs=require(_0x26a1('0x13'));var logger=require(_0x26a1('0x14'))(_0x26a1('0x15'));var utils=require(_0x26a1('0x16'));var config=require(_0x26a1('0x17'));var db=require(_0x26a1('0x18'))['db'];function respondWithStatusCode(_0x35d18c,_0x5c81ba){_0x5c81ba=_0x5c81ba||0xcc;return function(_0x46fba4){if(_0x46fba4){return _0x35d18c[_0x26a1('0x19')](_0x5c81ba);}return _0x35d18c[_0x26a1('0x1a')](_0x5c81ba)[_0x26a1('0x1b')]();};}function respondWithResult(_0x44d61c,_0x28800b){_0x28800b=_0x28800b||0xc8;return function(_0x444f12){if(_0x444f12){return _0x44d61c[_0x26a1('0x1a')](_0x28800b)[_0x26a1('0x1c')](_0x444f12);}};}function respondWithFilteredResult(_0x5570d5,_0x50891a){return function(_0x157c0f){if(_0x157c0f){var _0x19935a=_0x157c0f[_0x26a1('0x1d')],_0x1938f0=_0x50891a[_0x26a1('0x1e')],_0x1a229b=_0x50891a[_0x26a1('0x1e')]+_0x50891a[_0x26a1('0x1f')],_0x3f4678;if(_0x1a229b>=_0x19935a){_0x1a229b=_0x19935a;_0x3f4678=0xc8;}else{_0x3f4678=0xce;}_0x5570d5['status'](_0x3f4678);return _0x5570d5[_0x26a1('0x20')](_0x26a1('0x21'),_0x1938f0+'-'+_0x1a229b+'/'+_0x19935a)[_0x26a1('0x1c')](_0x157c0f);}return null;};}function patchUpdates(_0x1de9aa){return function(_0x283b09){try{jsonpatch[_0x26a1('0x22')](_0x283b09,_0x1de9aa,!![]);}catch(_0x46ec17){return BPromise[_0x26a1('0x23')](_0x46ec17);}return _0x283b09[_0x26a1('0x24')]();};}function saveUpdates(_0xa5c0f4,_0x291e88){return function(_0x58eb10){if(_0x58eb10){return _0x58eb10[_0x26a1('0x25')](_0xa5c0f4)[_0x26a1('0x26')](function(_0x149588){return _0x149588;});}return null;};}function removeEntity(_0x476bc0,_0x3790db){return function(_0x377bcb){if(_0x377bcb){return _0x377bcb[_0x26a1('0x27')]()['then'](function(){var _0x1f567c=_0x377bcb[_0x26a1('0x28')]({'plain':!![]});var _0x28896d=_0x26a1('0x29');return db[_0x26a1('0x2a')]['destroy']({'where':{'type':_0x28896d,'resourceId':_0x1f567c['id']}})[_0x26a1('0x26')](function(){return _0x377bcb;});})['then'](function(){_0x476bc0['status'](0xcc)[_0x26a1('0x1b')]();});}};}function handleEntityNotFound(_0x1d39c1,_0x4298c5){return function(_0x14c4c9){if(!_0x14c4c9){_0x1d39c1['sendStatus'](0x194);}return _0x14c4c9;};}function handleError(_0x380eeb,_0x2b7c3e){_0x2b7c3e=_0x2b7c3e||0x1f4;return function(_0x54c2c2){logger[_0x26a1('0x2b')](_0x54c2c2[_0x26a1('0x2c')]);if(_0x54c2c2[_0x26a1('0x2d')]){delete _0x54c2c2[_0x26a1('0x2d')];}_0x380eeb[_0x26a1('0x1a')](_0x2b7c3e)[_0x26a1('0x2e')](_0x54c2c2);};}exports[_0x26a1('0x2f')]=function(_0x431ff2,_0x567010){var _0x4f9832={},_0x3ad790={},_0x1ca154={'count':0x0,'rows':[]};var _0x126dcb=db[_0x26a1('0x30')][_0x26a1('0x31')];_0x3ad790[_0x26a1('0x32')]=_['keys'](_0x126dcb);_0x3ad790[_0x26a1('0x33')]=_['keys'](_0x431ff2[_0x26a1('0x33')]);_0x3ad790['filters']=_['intersection'](_0x3ad790[_0x26a1('0x32')],_0x3ad790[_0x26a1('0x33')]);_0x4f9832[_0x26a1('0x34')]=_[_0x26a1('0x35')](_0x3ad790[_0x26a1('0x32')],qs[_0x26a1('0x36')](_0x431ff2[_0x26a1('0x33')]['fields']));_0x4f9832['attributes']=_0x4f9832['attributes'][_0x26a1('0x37')]?_0x4f9832['attributes']:_0x3ad790[_0x26a1('0x32')];if(!_0x431ff2['query'][_0x26a1('0x38')]('nolimit')){_0x4f9832[_0x26a1('0x1f')]=qs['limit'](_0x431ff2['query'][_0x26a1('0x1f')]);_0x4f9832[_0x26a1('0x1e')]=qs[_0x26a1('0x1e')](_0x431ff2[_0x26a1('0x33')][_0x26a1('0x1e')]);}_0x4f9832['order']=qs[_0x26a1('0x39')](_0x431ff2[_0x26a1('0x33')][_0x26a1('0x39')]);_0x4f9832[_0x26a1('0x3a')]=qs[_0x26a1('0x3b')](_['pick'](_0x431ff2[_0x26a1('0x33')],_0x3ad790[_0x26a1('0x3b')]));if(_0x431ff2[_0x26a1('0x33')]['filter']){_0x4f9832[_0x26a1('0x3a')]=_[_0x26a1('0x3c')](_0x4f9832[_0x26a1('0x3a')],{'$or':_[_0x26a1('0x3d')](_0x126dcb,function(_0x1ad246){if(_0x1ad246['type'][_0x26a1('0x3e')]!==_0x26a1('0x3f')){var _0x257051={};_0x257051[_0x1ad246[_0x26a1('0x40')]]={'$like':'%'+_0x431ff2[_0x26a1('0x33')][_0x26a1('0x41')]+'%'};return _0x257051;}})});}_0x4f9832=_['merge']({},_0x4f9832,_0x431ff2['options']);var _0xe6c121={'where':_0x4f9832[_0x26a1('0x3a')]};return db[_0x26a1('0x30')][_0x26a1('0x1d')](_0xe6c121)[_0x26a1('0x26')](function(_0x55e543){_0x1ca154[_0x26a1('0x1d')]=_0x55e543;if(_0x431ff2[_0x26a1('0x33')][_0x26a1('0x42')]){_0x4f9832[_0x26a1('0x43')]=[{'all':!![]}];}return db['Campaign'][_0x26a1('0x44')](_0x4f9832);})['then'](function(_0x236ddc){_0x1ca154[_0x26a1('0x45')]=_0x236ddc;return _0x1ca154;})[_0x26a1('0x26')](respondWithFilteredResult(_0x567010,_0x4f9832))[_0x26a1('0x46')](handleError(_0x567010,null));};exports[_0x26a1('0x47')]=function(_0x5d3aa7,_0x23b033){var _0x191256={'raw':![],'where':{'id':_0x5d3aa7[_0x26a1('0x48')]['id']}},_0x390491={};_0x390491[_0x26a1('0x32')]=_['keys'](db[_0x26a1('0x30')][_0x26a1('0x31')]);_0x390491[_0x26a1('0x33')]=_[_0x26a1('0x49')](_0x5d3aa7[_0x26a1('0x33')]);_0x390491[_0x26a1('0x3b')]=_[_0x26a1('0x35')](_0x390491[_0x26a1('0x32')],_0x390491['query']);_0x191256[_0x26a1('0x34')]=_['intersection'](_0x390491['model'],qs[_0x26a1('0x36')](_0x5d3aa7[_0x26a1('0x33')][_0x26a1('0x36')]));_0x191256[_0x26a1('0x34')]=_0x191256[_0x26a1('0x34')]['length']?_0x191256[_0x26a1('0x34')]:_0x390491['model'];if(_0x5d3aa7[_0x26a1('0x33')][_0x26a1('0x42')]){_0x191256[_0x26a1('0x43')]=[{'all':!![]}];}_0x191256=_[_0x26a1('0x3c')]({},_0x191256,_0x5d3aa7[_0x26a1('0x4a')]);return db[_0x26a1('0x30')][_0x26a1('0x4b')](_0x191256)['then'](handleEntityNotFound(_0x23b033,null))[_0x26a1('0x26')](respondWithResult(_0x23b033,null))[_0x26a1('0x46')](handleError(_0x23b033,null));};exports[_0x26a1('0x4c')]=function(_0x41b28c,_0x1b0023){return db[_0x26a1('0x30')][_0x26a1('0x4c')](_0x41b28c[_0x26a1('0x4d')],{})[_0x26a1('0x26')](function(_0xf0cf38){var _0x4d24ec=_0x41b28c[_0x26a1('0x4e')][_0x26a1('0x28')]({'plain':!![]});if(!_0x4d24ec)throw new Error(_0x26a1('0x4f'));if(_0x4d24ec[_0x26a1('0x50')]===_0x26a1('0x4e')){var _0x413d1d=_0xf0cf38[_0x26a1('0x28')]({'plain':!![]});var _0x3eba25=_0x26a1('0x29');return db[_0x26a1('0x51')][_0x26a1('0x4b')]({'where':{'name':_0x3eba25,'userProfileId':_0x4d24ec[_0x26a1('0x52')]},'raw':!![]})[_0x26a1('0x26')](function(_0x36de2b){if(_0x36de2b&&_0x36de2b[_0x26a1('0x53')]===0x0){return db[_0x26a1('0x2a')][_0x26a1('0x4c')]({'name':_0x413d1d[_0x26a1('0x2d')],'resourceId':_0x413d1d['id'],'type':_0x36de2b['name'],'sectionId':_0x36de2b['id']},{})[_0x26a1('0x26')](function(){return _0xf0cf38;});}else{return _0xf0cf38;}})[_0x26a1('0x46')](function(_0x36c49e){logger[_0x26a1('0x2b')](_0x26a1('0x54'),_0x36c49e);throw _0x36c49e;});}return _0xf0cf38;})['then'](respondWithResult(_0x1b0023,0xc9))['catch'](handleError(_0x1b0023,null));};exports[_0x26a1('0x55')]=function(_0x1ad570,_0x316778){var _0x1871f4={'raw':![],'where':{'id':_0x1ad570[_0x26a1('0x48')]['id']}},_0x45624a={};_0x45624a[_0x26a1('0x32')]=_[_0x26a1('0x49')](db[_0x26a1('0x30')][_0x26a1('0x31')]);_0x1871f4[_0x26a1('0x34')]=_[_0x26a1('0x35')](_0x45624a[_0x26a1('0x32')],qs[_0x26a1('0x36')](_0x1ad570[_0x26a1('0x33')][_0x26a1('0x36')]));_0x1871f4['attributes']=_0x1871f4[_0x26a1('0x34')]['length']?_0x1871f4[_0x26a1('0x34')]:_0x45624a[_0x26a1('0x32')];if(_0x1ad570[_0x26a1('0x33')][_0x26a1('0x42')]){_0x1871f4[_0x26a1('0x43')]=[{'all':!![]}];}_0x1871f4=_[_0x26a1('0x3c')]({},_0x1871f4,_0x1ad570[_0x26a1('0x4a')]);return db[_0x26a1('0x30')]['find'](_0x1871f4)[_0x26a1('0x26')](handleEntityNotFound(_0x316778,null))['then'](function(_0x225cc3){if(_0x225cc3){var _0xb4f768=_0x225cc3[_0x26a1('0x28')]({'plain':!![]});_0xb4f768=qs[_0x26a1('0x56')](_0xb4f768,['id',_0x26a1('0x57'),_0x26a1('0x58')]);_0x1ad570[_0x26a1('0x4d')]=_[_0x26a1('0x56')](_0x1ad570[_0x26a1('0x4d')],['id','createdAt',_0x26a1('0x58')]);return db[_0x26a1('0x30')][_0x26a1('0x4c')](_['merge'](_0xb4f768,_0x1ad570[_0x26a1('0x4d')]),{'include':_0x1ad570['query'][_0x26a1('0x42')]?[{'all':!![]}]:undefined})[_0x26a1('0x26')](function(_0x40a818){var _0x1bd624=_0x1ad570['user']['get']({'plain':!![]});if(!_0x1bd624)throw new Error(_0x26a1('0x4f'));if(_0x1bd624['role']===_0x26a1('0x4e')){var _0x3f6a58=_0x40a818[_0x26a1('0x28')]({'plain':!![]});var _0x574a8e=_0x26a1('0x29');return db['UserProfileSection'][_0x26a1('0x4b')]({'where':{'name':_0x574a8e,'userProfileId':_0x1bd624[_0x26a1('0x52')]},'raw':!![]})['then'](function(_0x31d295){if(_0x31d295&&_0x31d295[_0x26a1('0x53')]===0x0){return db['UserProfileResource'][_0x26a1('0x4c')]({'name':_0x3f6a58[_0x26a1('0x2d')],'resourceId':_0x3f6a58['id'],'type':_0x31d295[_0x26a1('0x2d')],'sectionId':_0x31d295['id']},{})[_0x26a1('0x26')](function(){return _0x40a818;});}else{return _0x40a818;}})[_0x26a1('0x46')](function(_0xc69dee){logger[_0x26a1('0x2b')](_0x26a1('0x54'),_0xc69dee);throw _0xc69dee;});}return _0x40a818;});}})['then'](respondWithResult(_0x316778,0xc9))['catch'](handleError(_0x316778,null));};exports['update']=function(_0x38f49e,_0x24e762){if(_0x38f49e[_0x26a1('0x4d')]['id']){delete _0x38f49e[_0x26a1('0x4d')]['id'];}return db['Campaign'][_0x26a1('0x4b')]({'where':{'id':_0x38f49e[_0x26a1('0x48')]['id']}})['then'](handleEntityNotFound(_0x24e762,null))['then'](saveUpdates(_0x38f49e[_0x26a1('0x4d')],null))[_0x26a1('0x26')](respondWithResult(_0x24e762,null))[_0x26a1('0x46')](handleError(_0x24e762,null));};exports[_0x26a1('0x27')]=function(_0x3584d6,_0x2fbd69){return db[_0x26a1('0x30')][_0x26a1('0x4b')]({'where':{'id':_0x3584d6['params']['id']}})[_0x26a1('0x26')](handleEntityNotFound(_0x2fbd69,null))['then'](removeEntity(_0x2fbd69,null))[_0x26a1('0x46')](handleError(_0x2fbd69,null));};exports[_0x26a1('0x59')]=function(_0x42020b,_0x25eaa9,_0x139cea){var _0x35ae4f={'raw':!![],'where':{}};var _0x44c072={};var _0x51d9d0={'count':0x0,'rows':[]};return db[_0x26a1('0x30')]['findOne']({'where':{'id':_0x42020b[_0x26a1('0x48')]['id']}})['then'](handleEntityNotFound(_0x25eaa9,null))[_0x26a1('0x26')](function(_0x59ec22){if(_0x59ec22){_0x44c072['model']=_[_0x26a1('0x49')](db[_0x26a1('0x5a')][_0x26a1('0x31')]);_0x44c072[_0x26a1('0x33')]=_['keys'](_0x42020b[_0x26a1('0x33')]);_0x44c072[_0x26a1('0x3b')]=_[_0x26a1('0x35')](_0x44c072[_0x26a1('0x32')],_0x44c072[_0x26a1('0x33')]);_0x35ae4f[_0x26a1('0x34')]=_['intersection'](_0x44c072[_0x26a1('0x32')],qs[_0x26a1('0x36')](_0x42020b[_0x26a1('0x33')][_0x26a1('0x36')]));_0x35ae4f[_0x26a1('0x34')]=_0x35ae4f[_0x26a1('0x34')][_0x26a1('0x37')]?_0x35ae4f[_0x26a1('0x34')]:_0x44c072[_0x26a1('0x32')];if(!_0x42020b[_0x26a1('0x33')][_0x26a1('0x38')](_0x26a1('0x5b'))){_0x35ae4f[_0x26a1('0x1f')]=qs['limit'](_0x42020b[_0x26a1('0x33')][_0x26a1('0x1f')]);_0x35ae4f['offset']=qs['offset'](_0x42020b[_0x26a1('0x33')][_0x26a1('0x1e')]);}_0x35ae4f[_0x26a1('0x5c')]=qs[_0x26a1('0x39')](_0x42020b['query']['sort']);_0x35ae4f[_0x26a1('0x3a')]=qs[_0x26a1('0x3b')](_[_0x26a1('0x5d')](_0x42020b['query'],_0x44c072['filters']));_0x35ae4f['where'][_0x26a1('0x5e')]=_0x59ec22['id'];if(_0x42020b[_0x26a1('0x33')][_0x26a1('0x41')]){_0x35ae4f[_0x26a1('0x3a')]=_['merge'](_0x35ae4f['where'],{'$or':_['map'](_0x35ae4f['attributes'],function(_0x26f133){var _0xd413f1={};_0xd413f1[_0x26f133]={'$like':'%'+_0x42020b[_0x26a1('0x33')][_0x26a1('0x41')]+'%'};return _0xd413f1;})});}_0x35ae4f=_[_0x26a1('0x3c')]({},_0x35ae4f,_0x42020b[_0x26a1('0x4a')]);return db[_0x26a1('0x5a')][_0x26a1('0x1d')]({'where':_0x35ae4f[_0x26a1('0x3a')]})['then'](function(_0x3e8048){_0x51d9d0[_0x26a1('0x1d')]=_0x3e8048;if(_0x42020b['query']['includeAll']){_0x35ae4f[_0x26a1('0x43')]=[{'all':!![]}];}return db[_0x26a1('0x5a')]['findAll'](_0x35ae4f);})['then'](function(_0x10fc5f){_0x51d9d0[_0x26a1('0x45')]=_0x10fc5f;return _0x51d9d0;});}})[_0x26a1('0x26')](respondWithFilteredResult(_0x25eaa9,_0x35ae4f))['catch'](handleError(_0x25eaa9,null));};exports[_0x26a1('0x5f')]=function(_0x4e9a00,_0x250b30,_0x4d882e){var _0x4a2266={'raw':!![],'where':{}};var _0x54c8fa={};var _0x54e0d7={'count':0x0,'rows':[]};return db[_0x26a1('0x30')][_0x26a1('0x60')]({'where':{'id':_0x4e9a00[_0x26a1('0x48')]['id']}})[_0x26a1('0x26')](handleEntityNotFound(_0x250b30,null))['then'](function(_0x54ac9e){if(_0x54ac9e){_0x54c8fa['model']=_['keys'](db[_0x26a1('0x61')]['rawAttributes']);_0x54c8fa[_0x26a1('0x33')]=_[_0x26a1('0x49')](_0x4e9a00[_0x26a1('0x33')]);_0x54c8fa['filters']=_[_0x26a1('0x35')](_0x54c8fa[_0x26a1('0x32')],_0x54c8fa[_0x26a1('0x33')]);_0x4a2266[_0x26a1('0x34')]=_[_0x26a1('0x35')](_0x54c8fa['model'],qs[_0x26a1('0x36')](_0x4e9a00[_0x26a1('0x33')]['fields']));_0x4a2266[_0x26a1('0x34')]=_0x4a2266[_0x26a1('0x34')]['length']?_0x4a2266[_0x26a1('0x34')]:_0x54c8fa[_0x26a1('0x32')];if(!_0x4e9a00['query'][_0x26a1('0x38')](_0x26a1('0x5b'))){_0x4a2266[_0x26a1('0x1f')]=qs[_0x26a1('0x1f')](_0x4e9a00[_0x26a1('0x33')][_0x26a1('0x1f')]);_0x4a2266[_0x26a1('0x1e')]=qs[_0x26a1('0x1e')](_0x4e9a00[_0x26a1('0x33')][_0x26a1('0x1e')]);}_0x4a2266['order']=qs[_0x26a1('0x39')](_0x4e9a00[_0x26a1('0x33')][_0x26a1('0x39')]);_0x4a2266[_0x26a1('0x3a')]=qs['filters'](_['pick'](_0x4e9a00[_0x26a1('0x33')],_0x54c8fa[_0x26a1('0x3b')]));_0x4a2266[_0x26a1('0x3a')][_0x26a1('0x5e')]=_0x54ac9e['id'];if(_0x4e9a00[_0x26a1('0x33')][_0x26a1('0x41')]){_0x4a2266[_0x26a1('0x3a')]=_[_0x26a1('0x3c')](_0x4a2266['where'],{'$or':_[_0x26a1('0x3d')](_0x4a2266[_0x26a1('0x34')],function(_0x12f1d6){var _0x57621b={};_0x57621b[_0x12f1d6]={'$like':'%'+_0x4e9a00[_0x26a1('0x33')][_0x26a1('0x41')]+'%'};return _0x57621b;})});}_0x4a2266=_['merge']({},_0x4a2266,_0x4e9a00['options']);return db[_0x26a1('0x61')]['count']({'where':_0x4a2266[_0x26a1('0x3a')]})[_0x26a1('0x26')](function(_0x1f528){_0x54e0d7[_0x26a1('0x1d')]=_0x1f528;if(_0x4e9a00[_0x26a1('0x33')]['includeAll']){_0x4a2266['include']=[{'all':!![]}];}return db[_0x26a1('0x61')][_0x26a1('0x44')](_0x4a2266);})[_0x26a1('0x26')](function(_0xb6bcdd){_0x54e0d7[_0x26a1('0x45')]=_0xb6bcdd;return _0x54e0d7;});}})[_0x26a1('0x26')](respondWithFilteredResult(_0x250b30,_0x4a2266))[_0x26a1('0x46')](handleError(_0x250b30,null));};exports[_0x26a1('0x62')]=function(_0x40a993,_0x1a4ff2,_0x544770){var _0x3d9ec9={'raw':!![],'where':{}};var _0xc36e8={};var _0x4f729e={'count':0x0,'rows':[]};return db[_0x26a1('0x30')][_0x26a1('0x60')]({'where':{'id':_0x40a993['params']['id']}})[_0x26a1('0x26')](handleEntityNotFound(_0x1a4ff2,null))[_0x26a1('0x26')](function(_0x3b3046){if(_0x3b3046){_0xc36e8[_0x26a1('0x32')]=_['keys'](db[_0x26a1('0x63')][_0x26a1('0x31')]);_0xc36e8[_0x26a1('0x33')]=_[_0x26a1('0x49')](_0x40a993[_0x26a1('0x33')]);_0xc36e8[_0x26a1('0x3b')]=_['intersection'](_0xc36e8['model'],_0xc36e8[_0x26a1('0x33')]);_0x3d9ec9[_0x26a1('0x34')]=_[_0x26a1('0x35')](_0xc36e8[_0x26a1('0x32')],qs[_0x26a1('0x36')](_0x40a993[_0x26a1('0x33')]['fields']));_0x3d9ec9[_0x26a1('0x34')]=_0x3d9ec9[_0x26a1('0x34')]['length']?_0x3d9ec9['attributes']:_0xc36e8[_0x26a1('0x32')];if(!_0x40a993[_0x26a1('0x33')][_0x26a1('0x38')](_0x26a1('0x5b'))){_0x3d9ec9['limit']=qs['limit'](_0x40a993[_0x26a1('0x33')][_0x26a1('0x1f')]);_0x3d9ec9[_0x26a1('0x1e')]=qs[_0x26a1('0x1e')](_0x40a993['query'][_0x26a1('0x1e')]);}_0x3d9ec9['order']=qs[_0x26a1('0x39')](_0x40a993[_0x26a1('0x33')]['sort']);_0x3d9ec9[_0x26a1('0x3a')]=qs[_0x26a1('0x3b')](_[_0x26a1('0x5d')](_0x40a993[_0x26a1('0x33')],_0xc36e8['filters']));_0x3d9ec9['where'][_0x26a1('0x5e')]=_0x3b3046['id'];if(_0x40a993['query'][_0x26a1('0x41')]){_0x3d9ec9[_0x26a1('0x3a')]=_['merge'](_0x3d9ec9[_0x26a1('0x3a')],{'$or':_['map'](_0x3d9ec9[_0x26a1('0x34')],function(_0x54f8a3){var _0x45a56d={};_0x45a56d[_0x54f8a3]={'$like':'%'+_0x40a993[_0x26a1('0x33')]['filter']+'%'};return _0x45a56d;})});}_0x3d9ec9=_[_0x26a1('0x3c')]({},_0x3d9ec9,_0x40a993['options']);return db[_0x26a1('0x63')]['count']({'where':_0x3d9ec9['where']})[_0x26a1('0x26')](function(_0x186c7e){_0x4f729e['count']=_0x186c7e;if(_0x40a993['query'][_0x26a1('0x42')]){_0x3d9ec9[_0x26a1('0x43')]=[{'all':!![]}];}return db[_0x26a1('0x63')]['findAll'](_0x3d9ec9);})['then'](function(_0x47d089){_0x4f729e[_0x26a1('0x45')]=_0x47d089;return _0x4f729e;});}})[_0x26a1('0x26')](respondWithFilteredResult(_0x1a4ff2,_0x3d9ec9))['catch'](handleError(_0x1a4ff2,null));};exports[_0x26a1('0x64')]=function(_0x47853b,_0x52d41,_0x460c99){var _0x2756bd={'raw':!![],'where':{}};var _0x2191f6={};var _0x40276f={'count':0x0,'rows':[]};return db[_0x26a1('0x30')][_0x26a1('0x60')]({'where':{'id':_0x47853b[_0x26a1('0x48')]['id']}})[_0x26a1('0x26')](handleEntityNotFound(_0x52d41,null))[_0x26a1('0x26')](function(_0x4f1e04){if(_0x4f1e04){_0x2191f6[_0x26a1('0x32')]=_[_0x26a1('0x49')](db[_0x26a1('0x65')]['rawAttributes']);_0x2191f6[_0x26a1('0x33')]=_[_0x26a1('0x49')](_0x47853b[_0x26a1('0x33')]);_0x2191f6[_0x26a1('0x3b')]=_[_0x26a1('0x35')](_0x2191f6[_0x26a1('0x32')],_0x2191f6[_0x26a1('0x33')]);_0x2756bd['attributes']=_['intersection'](_0x2191f6[_0x26a1('0x32')],qs[_0x26a1('0x36')](_0x47853b[_0x26a1('0x33')][_0x26a1('0x36')]));_0x2756bd[_0x26a1('0x34')]=_0x2756bd['attributes'][_0x26a1('0x37')]?_0x2756bd[_0x26a1('0x34')]:_0x2191f6['model'];if(!_0x47853b[_0x26a1('0x33')][_0x26a1('0x38')]('nolimit')){_0x2756bd[_0x26a1('0x1f')]=qs[_0x26a1('0x1f')](_0x47853b[_0x26a1('0x33')][_0x26a1('0x1f')]);_0x2756bd[_0x26a1('0x1e')]=qs[_0x26a1('0x1e')](_0x47853b[_0x26a1('0x33')][_0x26a1('0x1e')]);}_0x2756bd[_0x26a1('0x5c')]=qs['sort'](_0x47853b[_0x26a1('0x33')]['sort']);_0x2756bd['where']=qs[_0x26a1('0x3b')](_[_0x26a1('0x5d')](_0x47853b[_0x26a1('0x33')],_0x2191f6[_0x26a1('0x3b')]));_0x2756bd[_0x26a1('0x3a')][_0x26a1('0x5e')]=_0x4f1e04['id'];if(_0x47853b[_0x26a1('0x33')][_0x26a1('0x41')]){_0x2756bd[_0x26a1('0x3a')]=_[_0x26a1('0x3c')](_0x2756bd[_0x26a1('0x3a')],{'$or':_[_0x26a1('0x3d')](_0x2756bd['attributes'],function(_0x35ea9e){var _0x12dd5e={};_0x12dd5e[_0x35ea9e]={'$like':'%'+_0x47853b[_0x26a1('0x33')][_0x26a1('0x41')]+'%'};return _0x12dd5e;})});}_0x2756bd=_[_0x26a1('0x3c')]({},_0x2756bd,_0x47853b[_0x26a1('0x4a')]);return db[_0x26a1('0x65')][_0x26a1('0x1d')]({'where':_0x2756bd[_0x26a1('0x3a')]})[_0x26a1('0x26')](function(_0x207c29){_0x40276f['count']=_0x207c29;if(_0x47853b[_0x26a1('0x33')][_0x26a1('0x42')]){_0x2756bd[_0x26a1('0x43')]=[{'all':!![]}];}return db[_0x26a1('0x65')][_0x26a1('0x44')](_0x2756bd);})['then'](function(_0x8dcce5){_0x40276f[_0x26a1('0x45')]=_0x8dcce5;return _0x40276f;});}})[_0x26a1('0x26')](respondWithFilteredResult(_0x52d41,_0x2756bd))['catch'](handleError(_0x52d41,null));};exports[_0x26a1('0x66')]=function(_0x569f89,_0x470503,_0x27cfd1){var _0x449aab={};var _0x1edcdd={};var _0x3b257e;var _0x17e3c4;return db[_0x26a1('0x30')][_0x26a1('0x60')]({'where':{'id':_0x569f89[_0x26a1('0x48')]['id']}})[_0x26a1('0x26')](handleEntityNotFound(_0x470503,null))[_0x26a1('0x26')](function(_0x3f9515){if(_0x3f9515){_0x3b257e=_0x3f9515;_0x1edcdd[_0x26a1('0x32')]=_[_0x26a1('0x49')](db[_0x26a1('0x67')][_0x26a1('0x31')]);_0x1edcdd[_0x26a1('0x33')]=_['keys'](_0x569f89[_0x26a1('0x33')]);_0x1edcdd[_0x26a1('0x3b')]=_[_0x26a1('0x35')](_0x1edcdd[_0x26a1('0x32')],_0x1edcdd['query']);_0x449aab['attributes']=_[_0x26a1('0x35')](_0x1edcdd['model'],qs[_0x26a1('0x36')](_0x569f89[_0x26a1('0x33')][_0x26a1('0x36')]));_0x449aab[_0x26a1('0x34')]=_0x449aab[_0x26a1('0x34')][_0x26a1('0x37')]?_0x449aab[_0x26a1('0x34')]:_0x1edcdd[_0x26a1('0x32')];_0x449aab[_0x26a1('0x5c')]=qs[_0x26a1('0x39')](_0x569f89['query'][_0x26a1('0x39')]);_0x449aab[_0x26a1('0x3a')]=qs[_0x26a1('0x3b')](_[_0x26a1('0x5d')](_0x569f89[_0x26a1('0x33')],_0x1edcdd[_0x26a1('0x3b')]));if(_0x569f89[_0x26a1('0x33')]['filter']){_0x449aab[_0x26a1('0x3a')]=_[_0x26a1('0x3c')](_0x449aab[_0x26a1('0x3a')],{'$or':_['map'](_0x449aab[_0x26a1('0x34')],function(_0x11f5cb){var _0x997486={};_0x997486[_0x11f5cb]={'$like':'%'+_0x569f89['query'][_0x26a1('0x41')]+'%'};return _0x997486;})});}_0x449aab=_[_0x26a1('0x3c')]({},_0x449aab,_0x569f89[_0x26a1('0x4a')]);return _0x3b257e[_0x26a1('0x66')](_0x449aab);}})[_0x26a1('0x26')](function(_0x2d9f03){if(_0x2d9f03){_0x17e3c4=_0x2d9f03['length'];if(!_0x569f89[_0x26a1('0x33')][_0x26a1('0x38')](_0x26a1('0x5b'))){_0x449aab[_0x26a1('0x1f')]=qs[_0x26a1('0x1f')](_0x569f89[_0x26a1('0x33')]['limit']);_0x449aab[_0x26a1('0x1e')]=qs[_0x26a1('0x1e')](_0x569f89[_0x26a1('0x33')]['offset']);}return _0x3b257e['getLists'](_0x449aab);}})[_0x26a1('0x26')](function(_0x47480d){if(_0x47480d){return _0x47480d?{'count':_0x17e3c4,'rows':_0x47480d}:null;}})['then'](respondWithResult(_0x470503,null))['catch'](handleError(_0x470503,null));};exports[_0x26a1('0x68')]=function(_0x34504b,_0x2a7108,_0x27b13b){var _0x483095,_0x3b719e;return db[_0x26a1('0x30')][_0x26a1('0x4b')]({'where':{'id':_0x34504b[_0x26a1('0x48')]['id']}})[_0x26a1('0x26')](handleEntityNotFound(_0x2a7108,null))[_0x26a1('0x26')](function(_0x31380a){if(_0x31380a){_0x3b719e=_0x31380a;return _0x31380a['addLists'](_0x34504b['body'][_0x26a1('0x69')],_[_0x26a1('0x56')](_0x34504b['body'],[_0x26a1('0x69'),'id'])||{});}return null;})[_0x26a1('0x6a')](function(_0x41b037){var _0x3600cf;_0x483095=_0x41b037||[];var _0x93c2ce=[];if(_0x41b037){for(var _0x24e844=0x0;_0x24e844<_0x41b037[_0x26a1('0x37')];_0x24e844+=0x1){var _0x3a489e=_0x41b037[_0x24e844]['get']({'plain':!![]});_0x3b719e[_0x26a1('0x6b')]=_0x34504b[_0x26a1('0x4d')]['dialCheckDuplicateType']?_0x34504b[_0x26a1('0x4d')][_0x26a1('0x6b')]:_0x3b719e[_0x26a1('0x6b')];switch(_0x3b719e[_0x26a1('0x6b')]){case _0x26a1('0x6c'):_0x3600cf=squel[_0x26a1('0x6d')]()[_0x26a1('0x6e')]('cm_hopper')[_0x26a1('0x6f')]([_0x26a1('0x70'),_0x26a1('0x71'),_0x26a1('0x72'),_0x26a1('0x73'),_0x26a1('0x5e'),_0x26a1('0x57'),_0x26a1('0x58')],squel['select']()[_0x26a1('0x40')](_0x26a1('0x70'),_0x26a1('0x70'))[_0x26a1('0x40')](_0x26a1('0x74'),_0x26a1('0x71'))['field']('id',_0x26a1('0x72'))[_0x26a1('0x40')](_0x3a489e[_0x26a1('0x75')][_0x26a1('0x76')](),'ListId')[_0x26a1('0x40')](_0x34504b['params']['id'][_0x26a1('0x76')](),_0x26a1('0x5e'))[_0x26a1('0x40')]('NOW()',_0x26a1('0x57'))[_0x26a1('0x40')](_0x26a1('0x74'),_0x26a1('0x58'))['from'](_0x26a1('0x77'))[_0x26a1('0x3a')](_0x26a1('0x78'))[_0x26a1('0x3a')](_0x26a1('0x79'),_0x3a489e[_0x26a1('0x75')][_0x26a1('0x76')]())[_0x26a1('0x3a')](_0x26a1('0x7a'))[_0x26a1('0x3a')](_0x26a1('0x7b'),squel[_0x26a1('0x7c')]()[_0x26a1('0x40')]('calleridnum')[_0x26a1('0x7d')](_0x26a1('0x7e'))[_0x26a1('0x3a')](_0x26a1('0x7f'),_0x34504b[_0x26a1('0x48')]['id'][_0x26a1('0x76')]()))[_0x26a1('0x3a')](_0x26a1('0x7b'),squel['select']()['field'](_0x26a1('0x70'))['from'](_0x26a1('0x80'))[_0x26a1('0x3a')](_0x26a1('0x7f'),_0x34504b[_0x26a1('0x48')]['id']['toString']())))[_0x26a1('0x76')]();break;case _0x26a1('0x81'):_0x3600cf=squel[_0x26a1('0x6d')]()['into'](_0x26a1('0x80'))[_0x26a1('0x6f')](['phone',_0x26a1('0x71'),_0x26a1('0x72'),_0x26a1('0x73'),_0x26a1('0x5e'),_0x26a1('0x57'),'updatedAt'],squel['select']()['field'](_0x26a1('0x70'),'phone')[_0x26a1('0x40')](_0x26a1('0x74'),'scheduledAt')['field']('id','ContactId')['field'](_0x3a489e[_0x26a1('0x75')][_0x26a1('0x76')](),'ListId')[_0x26a1('0x40')](_0x34504b['params']['id'][_0x26a1('0x76')](),_0x26a1('0x5e'))[_0x26a1('0x40')](_0x26a1('0x74'),_0x26a1('0x57'))['field'](_0x26a1('0x74'),_0x26a1('0x58'))[_0x26a1('0x7d')](_0x26a1('0x77'))[_0x26a1('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x26a1('0x79'),_0x3a489e['CmListId']['toString']())[_0x26a1('0x3a')](_0x26a1('0x7a'))[_0x26a1('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x26a1('0x7c')]()[_0x26a1('0x40')]('phone')['from'](_0x26a1('0x80'))[_0x26a1('0x3a')](_0x26a1('0x7f'),_0x34504b[_0x26a1('0x48')]['id'][_0x26a1('0x76')]())))[_0x26a1('0x76')]();break;default:_0x3600cf=squel[_0x26a1('0x6d')]()[_0x26a1('0x6e')](_0x26a1('0x80'))['fromQuery']([_0x26a1('0x70'),_0x26a1('0x71'),'ContactId',_0x26a1('0x73'),_0x26a1('0x5e'),_0x26a1('0x57'),_0x26a1('0x58')],squel[_0x26a1('0x7c')]()['field'](_0x26a1('0x70'),_0x26a1('0x70'))[_0x26a1('0x40')]('NOW()','scheduledAt')[_0x26a1('0x40')]('id',_0x26a1('0x72'))['field'](_0x3a489e[_0x26a1('0x75')][_0x26a1('0x76')](),'ListId')['field'](_0x34504b['params']['id'][_0x26a1('0x76')](),_0x26a1('0x5e'))['field'](_0x26a1('0x74'),_0x26a1('0x57'))[_0x26a1('0x40')](_0x26a1('0x74'),_0x26a1('0x58'))[_0x26a1('0x7d')]('cm_contacts')['where'](_0x26a1('0x78'))['where'](_0x26a1('0x79'),_0x3a489e[_0x26a1('0x75')][_0x26a1('0x76')]())[_0x26a1('0x3a')](_0x26a1('0x7a')))[_0x26a1('0x76')]();}_0x93c2ce[_0x26a1('0x82')](db[_0x26a1('0x83')]['query'](_0x3600cf));}return BPromise[_0x26a1('0x84')](_0x93c2ce);}})['then'](function(){return _0x483095;})[_0x26a1('0x26')](respondWithResult(_0x2a7108,null))[_0x26a1('0x46')](handleError(_0x2a7108,null));};exports[_0x26a1('0x85')]=function(_0x69d08f,_0x230c96,_0x3bf008){var _0x1cb311;return db[_0x26a1('0x30')][_0x26a1('0x4b')]({'where':{'id':_0x69d08f[_0x26a1('0x48')]['id']}})[_0x26a1('0x26')](handleEntityNotFound(_0x230c96,null))[_0x26a1('0x26')](function(_0x436fcd){if(_0x436fcd){return _0x436fcd[_0x26a1('0x85')](_0x69d08f[_0x26a1('0x33')]['ids']);}})[_0x26a1('0x26')](function(_0x1f05f9){if(_0x1f05f9){_0x1cb311=_0x1f05f9;return db[_0x26a1('0x5a')][_0x26a1('0x27')]({'where':{'ListId':_0x69d08f[_0x26a1('0x33')][_0x26a1('0x69')],'CampaignId':_0x69d08f[_0x26a1('0x48')]['id']}})[_0x26a1('0x26')](function(){return _0x1cb311;});}})['then'](respondWithStatusCode(_0x230c96,null))['catch'](handleError(_0x230c96,null));};exports['getBlackLists']=function(_0x2ca9c9,_0x565ad2,_0x246edd){var _0x4f3949={'raw':!![],'where':{}};var _0x2a1578={};var _0x13ced3={'count':0x0,'rows':[]};return db[_0x26a1('0x30')]['findOne']({'where':{'id':_0x2ca9c9[_0x26a1('0x48')]['id']}})['then'](handleEntityNotFound(_0x565ad2,null))['then'](function(_0x4d58fc){if(_0x4d58fc){_0x2a1578[_0x26a1('0x32')]=_['keys'](db[_0x26a1('0x67')][_0x26a1('0x31')]);_0x2a1578[_0x26a1('0x33')]=_[_0x26a1('0x49')](_0x2ca9c9[_0x26a1('0x33')]);_0x2a1578[_0x26a1('0x3b')]=_[_0x26a1('0x35')](_0x2a1578[_0x26a1('0x32')],_0x2a1578[_0x26a1('0x33')]);_0x4f3949[_0x26a1('0x34')]=_['intersection'](_0x2a1578[_0x26a1('0x32')],qs[_0x26a1('0x36')](_0x2ca9c9['query'][_0x26a1('0x36')]));_0x4f3949[_0x26a1('0x34')]=_0x4f3949[_0x26a1('0x34')][_0x26a1('0x37')]?_0x4f3949[_0x26a1('0x34')]:_0x2a1578[_0x26a1('0x32')];if(!_0x2ca9c9[_0x26a1('0x33')][_0x26a1('0x38')]('nolimit')){_0x4f3949[_0x26a1('0x1f')]=qs[_0x26a1('0x1f')](_0x2ca9c9[_0x26a1('0x33')]['limit']);_0x4f3949[_0x26a1('0x1e')]=qs[_0x26a1('0x1e')](_0x2ca9c9[_0x26a1('0x33')][_0x26a1('0x1e')]);}_0x4f3949[_0x26a1('0x5c')]=qs['sort'](_0x2ca9c9[_0x26a1('0x33')]['sort']);_0x4f3949['where']=qs[_0x26a1('0x3b')](_[_0x26a1('0x5d')](_0x2ca9c9[_0x26a1('0x33')],_0x2a1578[_0x26a1('0x3b')]));_0x4f3949['where'][_0x26a1('0x5e')]=_0x4d58fc['id'];if(_0x2ca9c9[_0x26a1('0x33')][_0x26a1('0x41')]){_0x4f3949[_0x26a1('0x3a')]=_[_0x26a1('0x3c')](_0x4f3949[_0x26a1('0x3a')],{'$or':_[_0x26a1('0x3d')](_0x4f3949[_0x26a1('0x34')],function(_0x220843){var _0x4113ca={};_0x4113ca[_0x220843]={'$like':'%'+_0x2ca9c9['query'][_0x26a1('0x41')]+'%'};return _0x4113ca;})});}_0x4f3949=_[_0x26a1('0x3c')]({},_0x4f3949,_0x2ca9c9['options']);return db[_0x26a1('0x67')][_0x26a1('0x1d')]({'where':_0x4f3949[_0x26a1('0x3a')]})[_0x26a1('0x26')](function(_0x3373a9){_0x13ced3[_0x26a1('0x1d')]=_0x3373a9;if(_0x2ca9c9['query'][_0x26a1('0x42')]){_0x4f3949['include']=[{'all':!![]}];}return db[_0x26a1('0x67')][_0x26a1('0x44')](_0x4f3949);})[_0x26a1('0x26')](function(_0x291487){_0x13ced3[_0x26a1('0x45')]=_0x291487;return _0x13ced3;});}})['then'](respondWithFilteredResult(_0x565ad2,_0x4f3949))[_0x26a1('0x46')](handleError(_0x565ad2,null));};exports['addBlackLists']=function(_0x160e07,_0x3b62c8,_0x493085){var _0x4c5756,_0x3a8f2b;return db[_0x26a1('0x30')][_0x26a1('0x4b')]({'where':{'id':_0x160e07[_0x26a1('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b62c8,null))['then'](function(_0x18612c){if(_0x18612c){_0x3a8f2b=_0x18612c;return _0x18612c[_0x26a1('0x86')](_0x160e07[_0x26a1('0x4d')][_0x26a1('0x69')],_[_0x26a1('0x56')](_0x160e07[_0x26a1('0x4d')],[_0x26a1('0x69'),'id'])||{});}return null;})[_0x26a1('0x6a')](function(_0x16a41c){var _0x4a1560;_0x4c5756=_0x16a41c||[];var _0xf0bd00=[];if(_0x16a41c){for(var _0x9339ff=0x0;_0x9339ff<_0x16a41c[_0x26a1('0x37')];_0x9339ff+=0x1){var _0x402b5b=_0x16a41c[_0x9339ff][_0x26a1('0x28')]({'plain':!![]});_0x4a1560=squel[_0x26a1('0x6d')]()[_0x26a1('0x6e')]('cm_hopper_black')['fromQuery'](['phone','ContactId',_0x26a1('0x73'),'CampaignId',_0x26a1('0x57'),_0x26a1('0x58')],squel[_0x26a1('0x7c')]()['field'](_0x26a1('0x70'),_0x26a1('0x70'))[_0x26a1('0x40')]('id',_0x26a1('0x72'))[_0x26a1('0x40')](_0x402b5b['CmListId'][_0x26a1('0x76')](),_0x26a1('0x73'))[_0x26a1('0x40')](_0x160e07[_0x26a1('0x48')]['id'][_0x26a1('0x76')](),_0x26a1('0x5e'))[_0x26a1('0x40')](_0x26a1('0x74'),_0x26a1('0x57'))[_0x26a1('0x40')](_0x26a1('0x74'),_0x26a1('0x58'))[_0x26a1('0x7d')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x26a1('0x3a')](_0x26a1('0x79'),_0x402b5b['CmListId']['toString']())['where'](_0x26a1('0x7a')))[_0x26a1('0x76')]();_0xf0bd00[_0x26a1('0x82')](db[_0x26a1('0x83')]['query'](_0x4a1560));}return BPromise[_0x26a1('0x84')](_0xf0bd00);}})[_0x26a1('0x26')](function(){return _0x4c5756;})[_0x26a1('0x26')](respondWithResult(_0x3b62c8,null))[_0x26a1('0x46')](handleError(_0x3b62c8,null));};exports[_0x26a1('0x87')]=function(_0x3b2967,_0x661416,_0x60f32f){var _0x50081c;return db[_0x26a1('0x30')]['find']({'where':{'id':_0x3b2967[_0x26a1('0x48')]['id']}})['then'](handleEntityNotFound(_0x661416,null))[_0x26a1('0x26')](function(_0x580f14){if(_0x580f14){return _0x580f14['removeBlackLists'](_0x3b2967[_0x26a1('0x33')][_0x26a1('0x69')]);}})[_0x26a1('0x26')](function(_0x14f30c){if(_0x14f30c){_0x50081c=_0x14f30c;return db[_0x26a1('0x65')][_0x26a1('0x27')]({'where':{'ListId':_0x3b2967['query'][_0x26a1('0x69')],'CampaignId':_0x3b2967[_0x26a1('0x48')]['id']}})['then'](function(){return _0x50081c;});}})[_0x26a1('0x26')](respondWithStatusCode(_0x661416,null))[_0x26a1('0x46')](handleError(_0x661416,null));}; \ No newline at end of file +var _0x041a=['util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','apply','update','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','Campaign','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filters','where','merge','map','type','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','createdAt','omit','body','updatedAt','autoAssociation','getHoppers','findOne','nolimit','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','select','calleridnum','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','into','cm_contacts','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x041a,0xf5));var _0xa041=function(_0x25516d,_0x9fcf7f){_0x25516d=_0x25516d-0x0;var _0x59441a=_0x041a[_0x25516d];return _0x59441a;};'use strict';var pdf=require(_0xa041('0x0'));var emlformat=require(_0xa041('0x1'));var rimraf=require(_0xa041('0x2'));var zipdir=require(_0xa041('0x3'));var jsonpatch=require(_0xa041('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa041('0x5'));var Mustache=require(_0xa041('0x6'));var util=require(_0xa041('0x7'));var path=require(_0xa041('0x8'));var sox=require(_0xa041('0x9'));var csv=require('to-csv');var ejs=require(_0xa041('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa041('0xb'));var crypto=require(_0xa041('0xc'));var jsforce=require(_0xa041('0xd'));var deskjs=require(_0xa041('0xe'));var toCsv=require(_0xa041('0xf'));var querystring=require('querystring');var Papa=require(_0xa041('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0xa041('0x11'));var Redis=require(_0xa041('0x12'));var qs=require(_0xa041('0x13'));var logger=require('../../config/logger')(_0xa041('0x14'));var utils=require(_0xa041('0x15'));var config=require(_0xa041('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa13e4e,_0xe37eee){_0xe37eee=_0xe37eee||0xcc;return function(_0x1fcaba){if(_0x1fcaba){return _0xa13e4e[_0xa041('0x17')](_0xe37eee);}return _0xa13e4e[_0xa041('0x18')](_0xe37eee)['end']();};}function respondWithResult(_0x3cab60,_0x2396c7){_0x2396c7=_0x2396c7||0xc8;return function(_0x21bcc9){if(_0x21bcc9){return _0x3cab60['status'](_0x2396c7)[_0xa041('0x19')](_0x21bcc9);}};}function respondWithFilteredResult(_0x59e2b3,_0x39a826){return function(_0x3ba096){if(_0x3ba096){var _0x44357b=_0x3ba096[_0xa041('0x1a')],_0x38041d=_0x39a826[_0xa041('0x1b')],_0x278207=_0x39a826['offset']+_0x39a826['limit'],_0x446fae;if(_0x278207>=_0x44357b){_0x278207=_0x44357b;_0x446fae=0xc8;}else{_0x446fae=0xce;}_0x59e2b3[_0xa041('0x18')](_0x446fae);return _0x59e2b3[_0xa041('0x1c')]('Content-Range',_0x38041d+'-'+_0x278207+'/'+_0x44357b)['json'](_0x3ba096);}return null;};}function patchUpdates(_0x17dbfd){return function(_0x2f84a3){try{jsonpatch[_0xa041('0x1d')](_0x2f84a3,_0x17dbfd,!![]);}catch(_0x24218f){return BPromise['reject'](_0x24218f);}return _0x2f84a3['save']();};}function saveUpdates(_0xccf9ad,_0x538199){return function(_0x18d22c){if(_0x18d22c){return _0x18d22c[_0xa041('0x1e')](_0xccf9ad)[_0xa041('0x1f')](function(_0x41c5ee){return _0x41c5ee;});}return null;};}function removeEntity(_0x155586,_0x184ea8){return function(_0x5a57af){if(_0x5a57af){return _0x5a57af[_0xa041('0x20')]()[_0xa041('0x1f')](function(){var _0x3cea64=_0x5a57af[_0xa041('0x21')]({'plain':!![]});var _0xf79565=_0xa041('0x22');return db[_0xa041('0x23')][_0xa041('0x20')]({'where':{'type':_0xf79565,'resourceId':_0x3cea64['id']}})['then'](function(){return _0x5a57af;});})[_0xa041('0x1f')](function(){_0x155586['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cdf76,_0x3232f0){return function(_0x521b31){if(!_0x521b31){_0x2cdf76[_0xa041('0x17')](0x194);}return _0x521b31;};}function handleError(_0x1ddf77,_0x2b8518){_0x2b8518=_0x2b8518||0x1f4;return function(_0x58933b){logger['error'](_0x58933b[_0xa041('0x24')]);if(_0x58933b['name']){delete _0x58933b[_0xa041('0x25')];}_0x1ddf77[_0xa041('0x18')](_0x2b8518)[_0xa041('0x26')](_0x58933b);};}exports['index']=function(_0x63f8ab,_0x3f435d){var _0x3d3ae0={},_0x556e53={},_0x287b22={'count':0x0,'rows':[]};var _0x44b819=db[_0xa041('0x27')][_0xa041('0x28')];_0x556e53[_0xa041('0x29')]=_[_0xa041('0x2a')](_0x44b819);_0x556e53[_0xa041('0x2b')]=_[_0xa041('0x2a')](_0x63f8ab['query']);_0x556e53['filters']=_[_0xa041('0x2c')](_0x556e53['model'],_0x556e53[_0xa041('0x2b')]);_0x3d3ae0['attributes']=_[_0xa041('0x2c')](_0x556e53[_0xa041('0x29')],qs[_0xa041('0x2d')](_0x63f8ab['query'][_0xa041('0x2d')]));_0x3d3ae0['attributes']=_0x3d3ae0[_0xa041('0x2e')][_0xa041('0x2f')]?_0x3d3ae0[_0xa041('0x2e')]:_0x556e53[_0xa041('0x29')];if(!_0x63f8ab[_0xa041('0x2b')][_0xa041('0x30')]('nolimit')){_0x3d3ae0[_0xa041('0x31')]=qs[_0xa041('0x31')](_0x63f8ab[_0xa041('0x2b')][_0xa041('0x31')]);_0x3d3ae0['offset']=qs['offset'](_0x63f8ab[_0xa041('0x2b')]['offset']);}_0x3d3ae0[_0xa041('0x32')]=qs[_0xa041('0x33')](_0x63f8ab[_0xa041('0x2b')][_0xa041('0x33')]);_0x3d3ae0['where']=qs['filters'](_[_0xa041('0x34')](_0x63f8ab[_0xa041('0x2b')],_0x556e53[_0xa041('0x35')]));if(_0x63f8ab['query']['filter']){_0x3d3ae0[_0xa041('0x36')]=_[_0xa041('0x37')](_0x3d3ae0[_0xa041('0x36')],{'$or':_[_0xa041('0x38')](_0x44b819,function(_0x424c53){if(_0x424c53[_0xa041('0x39')]['key']!==_0xa041('0x3a')){var _0x2f80a9={};_0x2f80a9[_0x424c53[_0xa041('0x3b')]]={'$like':'%'+_0x63f8ab[_0xa041('0x2b')][_0xa041('0x3c')]+'%'};return _0x2f80a9;}})});}_0x3d3ae0=_[_0xa041('0x37')]({},_0x3d3ae0,_0x63f8ab[_0xa041('0x3d')]);var _0x3289c8={'where':_0x3d3ae0[_0xa041('0x36')]};return db['Campaign'][_0xa041('0x1a')](_0x3289c8)[_0xa041('0x1f')](function(_0x437c0a){_0x287b22[_0xa041('0x1a')]=_0x437c0a;if(_0x63f8ab[_0xa041('0x2b')][_0xa041('0x3e')]){_0x3d3ae0[_0xa041('0x3f')]=[{'all':!![]}];}return db[_0xa041('0x27')][_0xa041('0x40')](_0x3d3ae0);})[_0xa041('0x1f')](function(_0x4d6e78){_0x287b22[_0xa041('0x41')]=_0x4d6e78;return _0x287b22;})[_0xa041('0x1f')](respondWithFilteredResult(_0x3f435d,_0x3d3ae0))['catch'](handleError(_0x3f435d,null));};exports['show']=function(_0x4bf48e,_0x5e0021){var _0x338c0c={'raw':![],'where':{'id':_0x4bf48e['params']['id']}},_0x1cba02={};_0x1cba02['model']=_['keys'](db['Campaign']['rawAttributes']);_0x1cba02['query']=_[_0xa041('0x2a')](_0x4bf48e[_0xa041('0x2b')]);_0x1cba02['filters']=_['intersection'](_0x1cba02[_0xa041('0x29')],_0x1cba02[_0xa041('0x2b')]);_0x338c0c[_0xa041('0x2e')]=_['intersection'](_0x1cba02[_0xa041('0x29')],qs[_0xa041('0x2d')](_0x4bf48e[_0xa041('0x2b')][_0xa041('0x2d')]));_0x338c0c[_0xa041('0x2e')]=_0x338c0c['attributes'][_0xa041('0x2f')]?_0x338c0c[_0xa041('0x2e')]:_0x1cba02['model'];if(_0x4bf48e[_0xa041('0x2b')]['includeAll']){_0x338c0c[_0xa041('0x3f')]=[{'all':!![]}];}_0x338c0c=_['merge']({},_0x338c0c,_0x4bf48e['options']);return db['Campaign'][_0xa041('0x42')](_0x338c0c)[_0xa041('0x1f')](handleEntityNotFound(_0x5e0021,null))['then'](respondWithResult(_0x5e0021,null))['catch'](handleError(_0x5e0021,null));};exports['create']=function(_0x110178,_0x25a1b6){return db[_0xa041('0x27')][_0xa041('0x43')](_0x110178['body'],{})[_0xa041('0x1f')](function(_0x305b86){var _0x221bf3=_0x110178[_0xa041('0x44')][_0xa041('0x21')]({'plain':!![]});if(!_0x221bf3)throw new Error(_0xa041('0x45'));if(_0x221bf3[_0xa041('0x46')]===_0xa041('0x44')){var _0x2b4272=_0x305b86[_0xa041('0x21')]({'plain':!![]});var _0x13915a=_0xa041('0x22');return db['UserProfileSection'][_0xa041('0x42')]({'where':{'name':_0x13915a,'userProfileId':_0x221bf3[_0xa041('0x47')]},'raw':!![]})[_0xa041('0x1f')](function(_0x94015b){if(_0x94015b&&_0x94015b['autoAssociation']===0x0){return db[_0xa041('0x23')][_0xa041('0x43')]({'name':_0x2b4272[_0xa041('0x25')],'resourceId':_0x2b4272['id'],'type':_0x94015b[_0xa041('0x25')],'sectionId':_0x94015b['id']},{})[_0xa041('0x1f')](function(){return _0x305b86;});}else{return _0x305b86;}})['catch'](function(_0x157ec6){logger[_0xa041('0x48')](_0xa041('0x49'),_0x157ec6);throw _0x157ec6;});}return _0x305b86;})[_0xa041('0x1f')](respondWithResult(_0x25a1b6,0xc9))[_0xa041('0x4a')](handleError(_0x25a1b6,null));};exports['clone']=function(_0x3f48e6,_0x234e7d){var _0x3de829={'raw':![],'where':{'id':_0x3f48e6[_0xa041('0x4b')]['id']}},_0x4d2414={};_0x4d2414[_0xa041('0x29')]=_[_0xa041('0x2a')](db['Campaign']['rawAttributes']);_0x3de829[_0xa041('0x2e')]=_['intersection'](_0x4d2414[_0xa041('0x29')],qs[_0xa041('0x2d')](_0x3f48e6[_0xa041('0x2b')][_0xa041('0x2d')]));_0x3de829[_0xa041('0x2e')]=_0x3de829[_0xa041('0x2e')]['length']?_0x3de829[_0xa041('0x2e')]:_0x4d2414[_0xa041('0x29')];if(_0x3f48e6[_0xa041('0x2b')]['includeAll']){_0x3de829['include']=[{'all':!![]}];}_0x3de829=_[_0xa041('0x37')]({},_0x3de829,_0x3f48e6['options']);return db[_0xa041('0x27')][_0xa041('0x42')](_0x3de829)[_0xa041('0x1f')](handleEntityNotFound(_0x234e7d,null))[_0xa041('0x1f')](function(_0xef2d99){if(_0xef2d99){var _0x573a3b=_0xef2d99[_0xa041('0x21')]({'plain':!![]});_0x573a3b=qs['omit'](_0x573a3b,['id',_0xa041('0x4c'),'updatedAt']);_0x3f48e6['body']=_[_0xa041('0x4d')](_0x3f48e6[_0xa041('0x4e')],['id',_0xa041('0x4c'),_0xa041('0x4f')]);return db[_0xa041('0x27')]['create'](_[_0xa041('0x37')](_0x573a3b,_0x3f48e6[_0xa041('0x4e')]),{'include':_0x3f48e6[_0xa041('0x2b')][_0xa041('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x29d795){var _0x1ae9c5=_0x3f48e6[_0xa041('0x44')]['get']({'plain':!![]});if(!_0x1ae9c5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ae9c5['role']===_0xa041('0x44')){var _0x3c088b=_0x29d795[_0xa041('0x21')]({'plain':!![]});var _0x30ed51='IvrCampaigns';return db['UserProfileSection'][_0xa041('0x42')]({'where':{'name':_0x30ed51,'userProfileId':_0x1ae9c5[_0xa041('0x47')]},'raw':!![]})['then'](function(_0x3d8225){if(_0x3d8225&&_0x3d8225[_0xa041('0x50')]===0x0){return db['UserProfileResource'][_0xa041('0x43')]({'name':_0x3c088b[_0xa041('0x25')],'resourceId':_0x3c088b['id'],'type':_0x3d8225[_0xa041('0x25')],'sectionId':_0x3d8225['id']},{})[_0xa041('0x1f')](function(){return _0x29d795;});}else{return _0x29d795;}})[_0xa041('0x4a')](function(_0x22b364){logger['error'](_0xa041('0x49'),_0x22b364);throw _0x22b364;});}return _0x29d795;});}})['then'](respondWithResult(_0x234e7d,0xc9))[_0xa041('0x4a')](handleError(_0x234e7d,null));};exports['update']=function(_0x25312f,_0x4f3997){if(_0x25312f[_0xa041('0x4e')]['id']){delete _0x25312f[_0xa041('0x4e')]['id'];}return db[_0xa041('0x27')][_0xa041('0x42')]({'where':{'id':_0x25312f[_0xa041('0x4b')]['id']}})[_0xa041('0x1f')](handleEntityNotFound(_0x4f3997,null))[_0xa041('0x1f')](saveUpdates(_0x25312f[_0xa041('0x4e')],null))[_0xa041('0x1f')](respondWithResult(_0x4f3997,null))['catch'](handleError(_0x4f3997,null));};exports[_0xa041('0x20')]=function(_0x28cf12,_0x4584ea){return db['Campaign']['find']({'where':{'id':_0x28cf12[_0xa041('0x4b')]['id']}})[_0xa041('0x1f')](handleEntityNotFound(_0x4584ea,null))[_0xa041('0x1f')](removeEntity(_0x4584ea,null))['catch'](handleError(_0x4584ea,null));};exports[_0xa041('0x51')]=function(_0x104354,_0x7d1efc,_0x3df64){var _0x42d4a3={'raw':!![],'where':{}};var _0xa5bff0={};var _0x1df61e={'count':0x0,'rows':[]};return db[_0xa041('0x27')][_0xa041('0x52')]({'where':{'id':_0x104354['params']['id']}})[_0xa041('0x1f')](handleEntityNotFound(_0x7d1efc,null))['then'](function(_0x2d60d5){if(_0x2d60d5){_0xa5bff0[_0xa041('0x29')]=_[_0xa041('0x2a')](db['CmHopper'][_0xa041('0x28')]);_0xa5bff0[_0xa041('0x2b')]=_[_0xa041('0x2a')](_0x104354[_0xa041('0x2b')]);_0xa5bff0['filters']=_['intersection'](_0xa5bff0[_0xa041('0x29')],_0xa5bff0[_0xa041('0x2b')]);_0x42d4a3[_0xa041('0x2e')]=_['intersection'](_0xa5bff0[_0xa041('0x29')],qs[_0xa041('0x2d')](_0x104354[_0xa041('0x2b')][_0xa041('0x2d')]));_0x42d4a3[_0xa041('0x2e')]=_0x42d4a3['attributes'][_0xa041('0x2f')]?_0x42d4a3[_0xa041('0x2e')]:_0xa5bff0['model'];if(!_0x104354['query']['hasOwnProperty'](_0xa041('0x53'))){_0x42d4a3[_0xa041('0x31')]=qs[_0xa041('0x31')](_0x104354[_0xa041('0x2b')][_0xa041('0x31')]);_0x42d4a3[_0xa041('0x1b')]=qs['offset'](_0x104354[_0xa041('0x2b')][_0xa041('0x1b')]);}_0x42d4a3[_0xa041('0x32')]=qs[_0xa041('0x33')](_0x104354[_0xa041('0x2b')][_0xa041('0x33')]);_0x42d4a3['where']=qs[_0xa041('0x35')](_[_0xa041('0x34')](_0x104354[_0xa041('0x2b')],_0xa5bff0['filters']));_0x42d4a3['where'][_0xa041('0x54')]=_0x2d60d5['id'];if(_0x104354[_0xa041('0x2b')][_0xa041('0x3c')]){_0x42d4a3[_0xa041('0x36')]=_[_0xa041('0x37')](_0x42d4a3[_0xa041('0x36')],{'$or':_[_0xa041('0x38')](_0x42d4a3[_0xa041('0x2e')],function(_0x2e6569){var _0x5da984={};_0x5da984[_0x2e6569]={'$like':'%'+_0x104354[_0xa041('0x2b')][_0xa041('0x3c')]+'%'};return _0x5da984;})});}_0x42d4a3=_[_0xa041('0x37')]({},_0x42d4a3,_0x104354['options']);return db[_0xa041('0x55')][_0xa041('0x1a')]({'where':_0x42d4a3[_0xa041('0x36')]})[_0xa041('0x1f')](function(_0x1c9c25){_0x1df61e[_0xa041('0x1a')]=_0x1c9c25;if(_0x104354[_0xa041('0x2b')][_0xa041('0x3e')]){_0x42d4a3[_0xa041('0x3f')]=[{'all':!![]}];}return db[_0xa041('0x55')][_0xa041('0x40')](_0x42d4a3);})[_0xa041('0x1f')](function(_0x10db87){_0x1df61e[_0xa041('0x41')]=_0x10db87;return _0x1df61e;});}})[_0xa041('0x1f')](respondWithFilteredResult(_0x7d1efc,_0x42d4a3))['catch'](handleError(_0x7d1efc,null));};exports[_0xa041('0x56')]=function(_0x51c4bf,_0x48e31a,_0x2d376f){var _0x494064={'raw':!![],'where':{}};var _0x559bec={};var _0x5dab21={'count':0x0,'rows':[]};return db[_0xa041('0x27')][_0xa041('0x52')]({'where':{'id':_0x51c4bf[_0xa041('0x4b')]['id']}})[_0xa041('0x1f')](handleEntityNotFound(_0x48e31a,null))['then'](function(_0x2b0e96){if(_0x2b0e96){_0x559bec[_0xa041('0x29')]=_['keys'](db[_0xa041('0x57')]['rawAttributes']);_0x559bec[_0xa041('0x2b')]=_[_0xa041('0x2a')](_0x51c4bf[_0xa041('0x2b')]);_0x559bec[_0xa041('0x35')]=_[_0xa041('0x2c')](_0x559bec[_0xa041('0x29')],_0x559bec[_0xa041('0x2b')]);_0x494064[_0xa041('0x2e')]=_['intersection'](_0x559bec['model'],qs[_0xa041('0x2d')](_0x51c4bf['query'][_0xa041('0x2d')]));_0x494064[_0xa041('0x2e')]=_0x494064['attributes'][_0xa041('0x2f')]?_0x494064['attributes']:_0x559bec[_0xa041('0x29')];if(!_0x51c4bf['query'][_0xa041('0x30')](_0xa041('0x53'))){_0x494064[_0xa041('0x31')]=qs['limit'](_0x51c4bf[_0xa041('0x2b')][_0xa041('0x31')]);_0x494064['offset']=qs[_0xa041('0x1b')](_0x51c4bf[_0xa041('0x2b')]['offset']);}_0x494064[_0xa041('0x32')]=qs[_0xa041('0x33')](_0x51c4bf[_0xa041('0x2b')]['sort']);_0x494064[_0xa041('0x36')]=qs[_0xa041('0x35')](_[_0xa041('0x34')](_0x51c4bf[_0xa041('0x2b')],_0x559bec[_0xa041('0x35')]));_0x494064[_0xa041('0x36')][_0xa041('0x54')]=_0x2b0e96['id'];if(_0x51c4bf['query'][_0xa041('0x3c')]){_0x494064['where']=_[_0xa041('0x37')](_0x494064['where'],{'$or':_[_0xa041('0x38')](_0x494064[_0xa041('0x2e')],function(_0x52b557){var _0x4e3010={};_0x4e3010[_0x52b557]={'$like':'%'+_0x51c4bf[_0xa041('0x2b')][_0xa041('0x3c')]+'%'};return _0x4e3010;})});}_0x494064=_[_0xa041('0x37')]({},_0x494064,_0x51c4bf[_0xa041('0x3d')]);return db[_0xa041('0x57')][_0xa041('0x1a')]({'where':_0x494064[_0xa041('0x36')]})[_0xa041('0x1f')](function(_0x1e8531){_0x5dab21['count']=_0x1e8531;if(_0x51c4bf[_0xa041('0x2b')][_0xa041('0x3e')]){_0x494064[_0xa041('0x3f')]=[{'all':!![]}];}return db[_0xa041('0x57')][_0xa041('0x40')](_0x494064);})['then'](function(_0x1ca9b3){_0x5dab21[_0xa041('0x41')]=_0x1ca9b3;return _0x5dab21;});}})[_0xa041('0x1f')](respondWithFilteredResult(_0x48e31a,_0x494064))[_0xa041('0x4a')](handleError(_0x48e31a,null));};exports['getHopperFinals']=function(_0x3db531,_0x2788bb,_0x468d55){var _0x2bbc56={'raw':!![],'where':{}};var _0x19dda4={};var _0x248d00={'count':0x0,'rows':[]};return db['Campaign'][_0xa041('0x52')]({'where':{'id':_0x3db531['params']['id']}})['then'](handleEntityNotFound(_0x2788bb,null))['then'](function(_0x5cd337){if(_0x5cd337){_0x19dda4['model']=_[_0xa041('0x2a')](db[_0xa041('0x58')][_0xa041('0x28')]);_0x19dda4[_0xa041('0x2b')]=_[_0xa041('0x2a')](_0x3db531['query']);_0x19dda4[_0xa041('0x35')]=_[_0xa041('0x2c')](_0x19dda4[_0xa041('0x29')],_0x19dda4[_0xa041('0x2b')]);_0x2bbc56[_0xa041('0x2e')]=_[_0xa041('0x2c')](_0x19dda4[_0xa041('0x29')],qs[_0xa041('0x2d')](_0x3db531[_0xa041('0x2b')][_0xa041('0x2d')]));_0x2bbc56['attributes']=_0x2bbc56[_0xa041('0x2e')]['length']?_0x2bbc56[_0xa041('0x2e')]:_0x19dda4[_0xa041('0x29')];if(!_0x3db531['query']['hasOwnProperty'](_0xa041('0x53'))){_0x2bbc56['limit']=qs['limit'](_0x3db531[_0xa041('0x2b')][_0xa041('0x31')]);_0x2bbc56[_0xa041('0x1b')]=qs[_0xa041('0x1b')](_0x3db531[_0xa041('0x2b')][_0xa041('0x1b')]);}_0x2bbc56[_0xa041('0x32')]=qs[_0xa041('0x33')](_0x3db531[_0xa041('0x2b')]['sort']);_0x2bbc56['where']=qs[_0xa041('0x35')](_[_0xa041('0x34')](_0x3db531[_0xa041('0x2b')],_0x19dda4[_0xa041('0x35')]));_0x2bbc56[_0xa041('0x36')][_0xa041('0x54')]=_0x5cd337['id'];if(_0x3db531[_0xa041('0x2b')][_0xa041('0x3c')]){_0x2bbc56[_0xa041('0x36')]=_[_0xa041('0x37')](_0x2bbc56[_0xa041('0x36')],{'$or':_['map'](_0x2bbc56[_0xa041('0x2e')],function(_0x29c05b){var _0x17ce4b={};_0x17ce4b[_0x29c05b]={'$like':'%'+_0x3db531[_0xa041('0x2b')]['filter']+'%'};return _0x17ce4b;})});}_0x2bbc56=_['merge']({},_0x2bbc56,_0x3db531['options']);return db[_0xa041('0x58')][_0xa041('0x1a')]({'where':_0x2bbc56['where']})['then'](function(_0x2a546a){_0x248d00[_0xa041('0x1a')]=_0x2a546a;if(_0x3db531['query'][_0xa041('0x3e')]){_0x2bbc56[_0xa041('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xa041('0x40')](_0x2bbc56);})[_0xa041('0x1f')](function(_0x274543){_0x248d00[_0xa041('0x41')]=_0x274543;return _0x248d00;});}})['then'](respondWithFilteredResult(_0x2788bb,_0x2bbc56))[_0xa041('0x4a')](handleError(_0x2788bb,null));};exports[_0xa041('0x59')]=function(_0x1d1f01,_0x2a6284,_0x240b8f){var _0x2448eb={'raw':!![],'where':{}};var _0xacb447={};var _0x42a40a={'count':0x0,'rows':[]};return db[_0xa041('0x27')][_0xa041('0x52')]({'where':{'id':_0x1d1f01[_0xa041('0x4b')]['id']}})[_0xa041('0x1f')](handleEntityNotFound(_0x2a6284,null))[_0xa041('0x1f')](function(_0x4b8365){if(_0x4b8365){_0xacb447[_0xa041('0x29')]=_['keys'](db[_0xa041('0x5a')][_0xa041('0x28')]);_0xacb447[_0xa041('0x2b')]=_[_0xa041('0x2a')](_0x1d1f01[_0xa041('0x2b')]);_0xacb447[_0xa041('0x35')]=_[_0xa041('0x2c')](_0xacb447[_0xa041('0x29')],_0xacb447[_0xa041('0x2b')]);_0x2448eb[_0xa041('0x2e')]=_[_0xa041('0x2c')](_0xacb447[_0xa041('0x29')],qs[_0xa041('0x2d')](_0x1d1f01[_0xa041('0x2b')][_0xa041('0x2d')]));_0x2448eb[_0xa041('0x2e')]=_0x2448eb['attributes'][_0xa041('0x2f')]?_0x2448eb[_0xa041('0x2e')]:_0xacb447[_0xa041('0x29')];if(!_0x1d1f01[_0xa041('0x2b')]['hasOwnProperty'](_0xa041('0x53'))){_0x2448eb[_0xa041('0x31')]=qs['limit'](_0x1d1f01[_0xa041('0x2b')]['limit']);_0x2448eb[_0xa041('0x1b')]=qs['offset'](_0x1d1f01[_0xa041('0x2b')][_0xa041('0x1b')]);}_0x2448eb[_0xa041('0x32')]=qs[_0xa041('0x33')](_0x1d1f01[_0xa041('0x2b')][_0xa041('0x33')]);_0x2448eb['where']=qs[_0xa041('0x35')](_[_0xa041('0x34')](_0x1d1f01['query'],_0xacb447[_0xa041('0x35')]));_0x2448eb[_0xa041('0x36')][_0xa041('0x54')]=_0x4b8365['id'];if(_0x1d1f01[_0xa041('0x2b')][_0xa041('0x3c')]){_0x2448eb[_0xa041('0x36')]=_[_0xa041('0x37')](_0x2448eb['where'],{'$or':_[_0xa041('0x38')](_0x2448eb[_0xa041('0x2e')],function(_0xc9a655){var _0x10433e={};_0x10433e[_0xc9a655]={'$like':'%'+_0x1d1f01['query'][_0xa041('0x3c')]+'%'};return _0x10433e;})});}_0x2448eb=_[_0xa041('0x37')]({},_0x2448eb,_0x1d1f01[_0xa041('0x3d')]);return db[_0xa041('0x5a')]['count']({'where':_0x2448eb[_0xa041('0x36')]})['then'](function(_0x420b82){_0x42a40a[_0xa041('0x1a')]=_0x420b82;if(_0x1d1f01[_0xa041('0x2b')][_0xa041('0x3e')]){_0x2448eb['include']=[{'all':!![]}];}return db[_0xa041('0x5a')][_0xa041('0x40')](_0x2448eb);})[_0xa041('0x1f')](function(_0x33394c){_0x42a40a['rows']=_0x33394c;return _0x42a40a;});}})['then'](respondWithFilteredResult(_0x2a6284,_0x2448eb))[_0xa041('0x4a')](handleError(_0x2a6284,null));};exports[_0xa041('0x5b')]=function(_0x18a06f,_0x18045e,_0x2cae98){var _0x4efe0d={};var _0xe57151={};var _0x12feb2;var _0x3dc76d;return db[_0xa041('0x27')]['findOne']({'where':{'id':_0x18a06f[_0xa041('0x4b')]['id']}})['then'](handleEntityNotFound(_0x18045e,null))[_0xa041('0x1f')](function(_0x1caf25){if(_0x1caf25){_0x12feb2=_0x1caf25;_0xe57151[_0xa041('0x29')]=_[_0xa041('0x2a')](db[_0xa041('0x5c')]['rawAttributes']);_0xe57151[_0xa041('0x2b')]=_[_0xa041('0x2a')](_0x18a06f['query']);_0xe57151[_0xa041('0x35')]=_[_0xa041('0x2c')](_0xe57151[_0xa041('0x29')],_0xe57151[_0xa041('0x2b')]);_0x4efe0d['attributes']=_['intersection'](_0xe57151[_0xa041('0x29')],qs[_0xa041('0x2d')](_0x18a06f[_0xa041('0x2b')][_0xa041('0x2d')]));_0x4efe0d[_0xa041('0x2e')]=_0x4efe0d[_0xa041('0x2e')][_0xa041('0x2f')]?_0x4efe0d[_0xa041('0x2e')]:_0xe57151[_0xa041('0x29')];_0x4efe0d[_0xa041('0x32')]=qs['sort'](_0x18a06f[_0xa041('0x2b')][_0xa041('0x33')]);_0x4efe0d[_0xa041('0x36')]=qs[_0xa041('0x35')](_['pick'](_0x18a06f['query'],_0xe57151['filters']));if(_0x18a06f[_0xa041('0x2b')][_0xa041('0x3c')]){_0x4efe0d[_0xa041('0x36')]=_[_0xa041('0x37')](_0x4efe0d[_0xa041('0x36')],{'$or':_[_0xa041('0x38')](_0x4efe0d[_0xa041('0x2e')],function(_0x495b35){var _0xb2800a={};_0xb2800a[_0x495b35]={'$like':'%'+_0x18a06f[_0xa041('0x2b')][_0xa041('0x3c')]+'%'};return _0xb2800a;})});}_0x4efe0d=_['merge']({},_0x4efe0d,_0x18a06f[_0xa041('0x3d')]);return _0x12feb2[_0xa041('0x5b')](_0x4efe0d);}})[_0xa041('0x1f')](function(_0x2b3dcd){if(_0x2b3dcd){_0x3dc76d=_0x2b3dcd[_0xa041('0x2f')];if(!_0x18a06f[_0xa041('0x2b')][_0xa041('0x30')](_0xa041('0x53'))){_0x4efe0d[_0xa041('0x31')]=qs[_0xa041('0x31')](_0x18a06f[_0xa041('0x2b')][_0xa041('0x31')]);_0x4efe0d[_0xa041('0x1b')]=qs['offset'](_0x18a06f[_0xa041('0x2b')][_0xa041('0x1b')]);}return _0x12feb2[_0xa041('0x5b')](_0x4efe0d);}})['then'](function(_0x6a42f6){if(_0x6a42f6){return _0x6a42f6?{'count':_0x3dc76d,'rows':_0x6a42f6}:null;}})['then'](respondWithResult(_0x18045e,null))[_0xa041('0x4a')](handleError(_0x18045e,null));};exports[_0xa041('0x5d')]=function(_0x31d18f,_0x209e1b,_0x263b71){var _0x5af20f,_0x349719;return db[_0xa041('0x27')][_0xa041('0x42')]({'where':{'id':_0x31d18f[_0xa041('0x4b')]['id']}})[_0xa041('0x1f')](handleEntityNotFound(_0x209e1b,null))[_0xa041('0x1f')](function(_0x5ac988){if(_0x5ac988){_0x349719=_0x5ac988;return _0x5ac988['addLists'](_0x31d18f[_0xa041('0x4e')][_0xa041('0x5e')],_[_0xa041('0x4d')](_0x31d18f[_0xa041('0x4e')],[_0xa041('0x5e'),'id'])||{});}return null;})[_0xa041('0x5f')](function(_0x36853e){var _0x3473d4;_0x5af20f=_0x36853e||[];var _0x58419b=[];if(_0x36853e){for(var _0x3327b3=0x0;_0x3327b3<_0x36853e[_0xa041('0x2f')];_0x3327b3+=0x1){var _0x2ef78d=_0x36853e[_0x3327b3][_0xa041('0x21')]({'plain':!![]});_0x349719[_0xa041('0x60')]=_0x31d18f[_0xa041('0x4e')][_0xa041('0x60')]?_0x31d18f['body'][_0xa041('0x60')]:_0x349719[_0xa041('0x60')];switch(_0x349719[_0xa041('0x60')]){case'always':_0x3473d4=squel[_0xa041('0x61')]()['into']('cm_hopper')[_0xa041('0x62')](['phone',_0xa041('0x63'),_0xa041('0x64'),_0xa041('0x65'),_0xa041('0x54'),_0xa041('0x4c'),_0xa041('0x4f')],squel['select']()[_0xa041('0x3b')](_0xa041('0x66'),'phone')['field'](_0xa041('0x67'),_0xa041('0x63'))[_0xa041('0x3b')]('id',_0xa041('0x64'))[_0xa041('0x3b')](_0x2ef78d['CmListId'][_0xa041('0x68')](),_0xa041('0x65'))['field'](_0x31d18f[_0xa041('0x4b')]['id'][_0xa041('0x68')](),_0xa041('0x54'))[_0xa041('0x3b')](_0xa041('0x67'),_0xa041('0x4c'))['field'](_0xa041('0x67'),_0xa041('0x4f'))[_0xa041('0x69')]('cm_contacts')['where'](_0xa041('0x6a'))[_0xa041('0x36')](_0xa041('0x6b'),_0x2ef78d[_0xa041('0x6c')]['toString']())[_0xa041('0x36')](_0xa041('0x6d'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa041('0x6e')]()[_0xa041('0x3b')](_0xa041('0x6f'))['from'](_0xa041('0x70'))[_0xa041('0x36')](_0xa041('0x71'),_0x31d18f[_0xa041('0x4b')]['id'][_0xa041('0x68')]()))[_0xa041('0x36')](_0xa041('0x72'),squel[_0xa041('0x6e')]()[_0xa041('0x3b')](_0xa041('0x66'))[_0xa041('0x69')](_0xa041('0x73'))['where'](_0xa041('0x71'),_0x31d18f[_0xa041('0x4b')]['id']['toString']())))[_0xa041('0x68')]();break;case _0xa041('0x74'):_0x3473d4=squel[_0xa041('0x61')]()['into'](_0xa041('0x73'))[_0xa041('0x62')]([_0xa041('0x66'),_0xa041('0x63'),_0xa041('0x64'),_0xa041('0x65'),_0xa041('0x54'),_0xa041('0x4c'),'updatedAt'],squel[_0xa041('0x6e')]()[_0xa041('0x3b')]('phone',_0xa041('0x66'))['field'](_0xa041('0x67'),'scheduledAt')['field']('id',_0xa041('0x64'))[_0xa041('0x3b')](_0x2ef78d['CmListId'][_0xa041('0x68')](),_0xa041('0x65'))[_0xa041('0x3b')](_0x31d18f[_0xa041('0x4b')]['id'][_0xa041('0x68')](),_0xa041('0x54'))[_0xa041('0x3b')](_0xa041('0x67'),_0xa041('0x4c'))['field']('NOW()',_0xa041('0x4f'))[_0xa041('0x69')]('cm_contacts')[_0xa041('0x36')]('deletedAt\x20IS\x20NULL')[_0xa041('0x36')]('ListId\x20=\x20?',_0x2ef78d['CmListId'][_0xa041('0x68')]())['where'](_0xa041('0x6d'))[_0xa041('0x36')](_0xa041('0x72'),squel[_0xa041('0x6e')]()['field']('phone')[_0xa041('0x69')](_0xa041('0x73'))[_0xa041('0x36')](_0xa041('0x71'),_0x31d18f[_0xa041('0x4b')]['id']['toString']())))[_0xa041('0x68')]();break;default:_0x3473d4=squel[_0xa041('0x61')]()[_0xa041('0x75')](_0xa041('0x73'))[_0xa041('0x62')]([_0xa041('0x66'),'scheduledAt','ContactId',_0xa041('0x65'),_0xa041('0x54'),_0xa041('0x4c'),_0xa041('0x4f')],squel[_0xa041('0x6e')]()[_0xa041('0x3b')](_0xa041('0x66'),'phone')[_0xa041('0x3b')](_0xa041('0x67'),'scheduledAt')['field']('id',_0xa041('0x64'))['field'](_0x2ef78d['CmListId'][_0xa041('0x68')](),_0xa041('0x65'))[_0xa041('0x3b')](_0x31d18f[_0xa041('0x4b')]['id'][_0xa041('0x68')](),_0xa041('0x54'))[_0xa041('0x3b')](_0xa041('0x67'),_0xa041('0x4c'))[_0xa041('0x3b')](_0xa041('0x67'),_0xa041('0x4f'))[_0xa041('0x69')](_0xa041('0x76'))[_0xa041('0x36')](_0xa041('0x6a'))['where'](_0xa041('0x6b'),_0x2ef78d['CmListId'][_0xa041('0x68')]())['where'](_0xa041('0x6d')))[_0xa041('0x68')]();}_0x58419b[_0xa041('0x77')](db['sequelize'][_0xa041('0x2b')](_0x3473d4));}return BPromise[_0xa041('0x78')](_0x58419b);}})[_0xa041('0x1f')](function(){return _0x5af20f;})[_0xa041('0x1f')](respondWithResult(_0x209e1b,null))[_0xa041('0x4a')](handleError(_0x209e1b,null));};exports[_0xa041('0x79')]=function(_0x9fe9f4,_0x456496,_0xb70c87){var _0x8576b7;return db[_0xa041('0x27')][_0xa041('0x42')]({'where':{'id':_0x9fe9f4[_0xa041('0x4b')]['id']}})[_0xa041('0x1f')](handleEntityNotFound(_0x456496,null))[_0xa041('0x1f')](function(_0xf5a5b6){if(_0xf5a5b6){return _0xf5a5b6[_0xa041('0x79')](_0x9fe9f4['query'][_0xa041('0x5e')]);}})['then'](function(_0x1b9537){if(_0x1b9537){_0x8576b7=_0x1b9537;return db[_0xa041('0x55')][_0xa041('0x20')]({'where':{'ListId':_0x9fe9f4[_0xa041('0x2b')][_0xa041('0x5e')],'CampaignId':_0x9fe9f4[_0xa041('0x4b')]['id']}})[_0xa041('0x1f')](function(){return _0x8576b7;});}})['then'](respondWithStatusCode(_0x456496,null))[_0xa041('0x4a')](handleError(_0x456496,null));};exports[_0xa041('0x7a')]=function(_0x4347a3,_0x3faac9,_0x275893){var _0x2a9d80={'raw':!![],'where':{}};var _0x15e09e={};var _0x5db3e3={'count':0x0,'rows':[]};return db[_0xa041('0x27')][_0xa041('0x52')]({'where':{'id':_0x4347a3[_0xa041('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3faac9,null))[_0xa041('0x1f')](function(_0x358f5a){if(_0x358f5a){_0x15e09e[_0xa041('0x29')]=_[_0xa041('0x2a')](db[_0xa041('0x5c')][_0xa041('0x28')]);_0x15e09e[_0xa041('0x2b')]=_[_0xa041('0x2a')](_0x4347a3[_0xa041('0x2b')]);_0x15e09e['filters']=_[_0xa041('0x2c')](_0x15e09e[_0xa041('0x29')],_0x15e09e[_0xa041('0x2b')]);_0x2a9d80['attributes']=_['intersection'](_0x15e09e[_0xa041('0x29')],qs[_0xa041('0x2d')](_0x4347a3['query'][_0xa041('0x2d')]));_0x2a9d80[_0xa041('0x2e')]=_0x2a9d80['attributes'][_0xa041('0x2f')]?_0x2a9d80[_0xa041('0x2e')]:_0x15e09e[_0xa041('0x29')];if(!_0x4347a3[_0xa041('0x2b')][_0xa041('0x30')](_0xa041('0x53'))){_0x2a9d80[_0xa041('0x31')]=qs[_0xa041('0x31')](_0x4347a3[_0xa041('0x2b')][_0xa041('0x31')]);_0x2a9d80['offset']=qs[_0xa041('0x1b')](_0x4347a3[_0xa041('0x2b')][_0xa041('0x1b')]);}_0x2a9d80[_0xa041('0x32')]=qs[_0xa041('0x33')](_0x4347a3[_0xa041('0x2b')]['sort']);_0x2a9d80[_0xa041('0x36')]=qs[_0xa041('0x35')](_[_0xa041('0x34')](_0x4347a3['query'],_0x15e09e[_0xa041('0x35')]));_0x2a9d80[_0xa041('0x36')][_0xa041('0x54')]=_0x358f5a['id'];if(_0x4347a3[_0xa041('0x2b')][_0xa041('0x3c')]){_0x2a9d80[_0xa041('0x36')]=_[_0xa041('0x37')](_0x2a9d80[_0xa041('0x36')],{'$or':_[_0xa041('0x38')](_0x2a9d80[_0xa041('0x2e')],function(_0x508560){var _0x2c8595={};_0x2c8595[_0x508560]={'$like':'%'+_0x4347a3[_0xa041('0x2b')]['filter']+'%'};return _0x2c8595;})});}_0x2a9d80=_[_0xa041('0x37')]({},_0x2a9d80,_0x4347a3[_0xa041('0x3d')]);return db[_0xa041('0x5c')]['count']({'where':_0x2a9d80[_0xa041('0x36')]})['then'](function(_0xa94d0f){_0x5db3e3[_0xa041('0x1a')]=_0xa94d0f;if(_0x4347a3[_0xa041('0x2b')][_0xa041('0x3e')]){_0x2a9d80[_0xa041('0x3f')]=[{'all':!![]}];}return db[_0xa041('0x5c')][_0xa041('0x40')](_0x2a9d80);})[_0xa041('0x1f')](function(_0x301386){_0x5db3e3['rows']=_0x301386;return _0x5db3e3;});}})[_0xa041('0x1f')](respondWithFilteredResult(_0x3faac9,_0x2a9d80))[_0xa041('0x4a')](handleError(_0x3faac9,null));};exports[_0xa041('0x7b')]=function(_0xb4f132,_0x4e20f4,_0x3425a8){var _0x4d78de,_0x388b72;return db[_0xa041('0x27')]['find']({'where':{'id':_0xb4f132[_0xa041('0x4b')]['id']}})[_0xa041('0x1f')](handleEntityNotFound(_0x4e20f4,null))[_0xa041('0x1f')](function(_0x34d3ae){if(_0x34d3ae){_0x388b72=_0x34d3ae;return _0x34d3ae[_0xa041('0x7b')](_0xb4f132[_0xa041('0x4e')]['ids'],_[_0xa041('0x4d')](_0xb4f132[_0xa041('0x4e')],[_0xa041('0x5e'),'id'])||{});}return null;})[_0xa041('0x5f')](function(_0x35080b){var _0xf75539;_0x4d78de=_0x35080b||[];var _0x407118=[];if(_0x35080b){for(var _0x4389d8=0x0;_0x4389d8<_0x35080b[_0xa041('0x2f')];_0x4389d8+=0x1){var _0x43af8f=_0x35080b[_0x4389d8][_0xa041('0x21')]({'plain':!![]});_0xf75539=squel[_0xa041('0x61')]()[_0xa041('0x75')](_0xa041('0x7c'))[_0xa041('0x62')]([_0xa041('0x66'),_0xa041('0x64'),_0xa041('0x65'),_0xa041('0x54'),_0xa041('0x4c'),'updatedAt'],squel[_0xa041('0x6e')]()[_0xa041('0x3b')](_0xa041('0x66'),'phone')[_0xa041('0x3b')]('id',_0xa041('0x64'))[_0xa041('0x3b')](_0x43af8f['CmListId'][_0xa041('0x68')](),_0xa041('0x65'))[_0xa041('0x3b')](_0xb4f132[_0xa041('0x4b')]['id'][_0xa041('0x68')](),_0xa041('0x54'))['field'](_0xa041('0x67'),_0xa041('0x4c'))[_0xa041('0x3b')]('NOW()',_0xa041('0x4f'))[_0xa041('0x69')](_0xa041('0x76'))[_0xa041('0x36')](_0xa041('0x6a'))[_0xa041('0x36')](_0xa041('0x6b'),_0x43af8f['CmListId'][_0xa041('0x68')]())[_0xa041('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0xa041('0x68')]();_0x407118['push'](db['sequelize']['query'](_0xf75539));}return BPromise[_0xa041('0x78')](_0x407118);}})[_0xa041('0x1f')](function(){return _0x4d78de;})[_0xa041('0x1f')](respondWithResult(_0x4e20f4,null))[_0xa041('0x4a')](handleError(_0x4e20f4,null));};exports[_0xa041('0x7d')]=function(_0x35630e,_0x4e60e8,_0x2894b4){var _0x566fa5;return db[_0xa041('0x27')][_0xa041('0x42')]({'where':{'id':_0x35630e[_0xa041('0x4b')]['id']}})[_0xa041('0x1f')](handleEntityNotFound(_0x4e60e8,null))[_0xa041('0x1f')](function(_0x2184f2){if(_0x2184f2){return _0x2184f2[_0xa041('0x7d')](_0x35630e[_0xa041('0x2b')][_0xa041('0x5e')]);}})[_0xa041('0x1f')](function(_0x438fdb){if(_0x438fdb){_0x566fa5=_0x438fdb;return db[_0xa041('0x5a')][_0xa041('0x20')]({'where':{'ListId':_0x35630e['query']['ids'],'CampaignId':_0x35630e[_0xa041('0x4b')]['id']}})[_0xa041('0x1f')](function(){return _0x566fa5;});}})[_0xa041('0x1f')](respondWithStatusCode(_0x4e60e8,null))[_0xa041('0x4a')](handleError(_0x4e60e8,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 3bc9252..f6d7412 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 _0x7a20=['Campaign','campaigns','lodash','api','bluebird','./campaign.attributes','define'];(function(_0x404313,_0x3a7fac){var _0x3c908a=function(_0x1e2160){while(--_0x1e2160){_0x404313['push'](_0x404313['shift']());}};_0x3c908a(++_0x3a7fac);}(_0x7a20,0x1f3));var _0x07a2=function(_0x32ec6c,_0x274d8d){_0x32ec6c=_0x32ec6c-0x0;var _0x563a5e=_0x7a20[_0x32ec6c];return _0x563a5e;};'use strict';var _=require(_0x07a2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x07a2('0x1'));var moment=require('moment');var BPromise=require(_0x07a2('0x2'));var rp=require('request-promise');var attributes=require(_0x07a2('0x3'));module['exports']=function(_0x764a96,_0x322538){return _0x764a96[_0x07a2('0x4')](_0x07a2('0x5'),attributes,{'tableName':_0x07a2('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ab2=['api','bluebird','request-promise','exports','define','Campaign','campaigns','lodash'];(function(_0x4c3c88,_0x42f102){var _0x1587d4=function(_0x521d65){while(--_0x521d65){_0x4c3c88['push'](_0x4c3c88['shift']());}};_0x1587d4(++_0x42f102);}(_0x7ab2,0x1b7));var _0x27ab=function(_0x961a37,_0x33bdca){_0x961a37=_0x961a37-0x0;var _0x1ebd1b=_0x7ab2[_0x961a37];return _0x1ebd1b;};'use strict';var _=require(_0x27ab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x27ab('0x1'));var moment=require('moment');var BPromise=require(_0x27ab('0x2'));var rp=require(_0x27ab('0x3'));var attributes=require('./campaign.attributes');module[_0x27ab('0x4')]=function(_0x5ca0aa,_0x2ece5b){return _0x5ca0aa[_0x27ab('0x5')](_0x27ab('0x6'),attributes,{'tableName':_0x27ab('0x7'),'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 6a007df..042b890 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 _0x478a=['limit','include','model','map','stringify','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x478a,0x186));var _0xa478=function(_0x4f4348,_0x564a97){_0x4f4348=_0x4f4348-0x0;var _0x1e9196=_0x478a[_0x4f4348];return _0x1e9196;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa478('0x0'));var rs=require(_0xa478('0x1'));var fs=require('fs');var Redis=require(_0xa478('0x2'));var db=require(_0xa478('0x3'))['db'];var utils=require(_0xa478('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa478('0x5'));var jayson=require(_0xa478('0x6'));var client=jayson['client'][_0xa478('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14c51b,_0x376feb,_0x4d50f4){return new BPromise(function(_0x21d1cf,_0x52e8dc){return client[_0xa478('0x8')](_0x14c51b,_0x4d50f4)[_0xa478('0x9')](function(_0x1e5037){logger[_0xa478('0xa')](_0xa478('0xb'),_0x376feb,_0xa478('0xc'));logger[_0xa478('0xd')](_0xa478('0xe'),_0x376feb,'request\x20sent',JSON['stringify'](_0x1e5037));if(_0x1e5037['error']){if(_0x1e5037[_0xa478('0xf')][_0xa478('0x10')]===0x1f4){logger['error'](_0xa478('0xb'),_0x376feb,_0x1e5037[_0xa478('0xf')][_0xa478('0x11')]);return _0x52e8dc(_0x1e5037[_0xa478('0xf')][_0xa478('0x11')]);}logger[_0xa478('0xf')](_0xa478('0xb'),_0x376feb,_0x1e5037['error'][_0xa478('0x11')]);return _0x21d1cf(_0x1e5037['error'][_0xa478('0x11')]);}else{logger[_0xa478('0xa')](_0xa478('0xb'),_0x376feb,_0xa478('0xc'));_0x21d1cf(_0x1e5037[_0xa478('0x12')][_0xa478('0x11')]);}})['catch'](function(_0x24a057){logger[_0xa478('0xf')](_0xa478('0xb'),_0x376feb,_0x24a057);_0x52e8dc(_0x24a057);});});}exports[_0xa478('0x13')]=function(_0x15e5bb){var _0x30bc81=this;return new Promise(function(_0x3e0629,_0x25ff20){return db[_0xa478('0x14')][_0xa478('0x15')]({'raw':_0x15e5bb[_0xa478('0x16')]?_0x15e5bb[_0xa478('0x16')][_0xa478('0x17')]===undefined?!![]:![]:!![],'where':_0x15e5bb[_0xa478('0x16')]?_0x15e5bb[_0xa478('0x16')][_0xa478('0x18')]||null:null,'attributes':_0x15e5bb['options']?_0x15e5bb[_0xa478('0x16')][_0xa478('0x19')]||null:null,'limit':_0x15e5bb[_0xa478('0x16')]?_0x15e5bb[_0xa478('0x16')][_0xa478('0x1a')]||null:null,'include':_0x15e5bb[_0xa478('0x16')]?_0x15e5bb[_0xa478('0x16')][_0xa478('0x1b')]?_['map'](_0x15e5bb['options'][_0xa478('0x1b')],function(_0x21e0b3){return{'model':db[_0x21e0b3[_0xa478('0x1c')]],'as':_0x21e0b3['as'],'attributes':_0x21e0b3[_0xa478('0x19')],'include':_0x21e0b3[_0xa478('0x1b')]?_['map'](_0x21e0b3[_0xa478('0x1b')],function(_0x323414){return{'model':db[_0x323414[_0xa478('0x1c')]],'as':_0x323414['as'],'attributes':_0x323414[_0xa478('0x19')],'include':_0x323414[_0xa478('0x1b')]?_[_0xa478('0x1d')](_0x323414['include'],function(_0x480750){return{'model':db[_0x480750[_0xa478('0x1c')]],'as':_0x480750['as'],'attributes':_0x480750['attributes']};}):[]};}):[]};}):[]:[]})[_0xa478('0x9')](function(_0x1d0acd){logger[_0xa478('0xa')]('GetCampaign',_0x15e5bb);logger['debug']('GetCampaign',_0x15e5bb,JSON[_0xa478('0x1e')](_0x1d0acd));_0x3e0629(_0x1d0acd);})[_0xa478('0x1f')](function(_0x234ef6){logger[_0xa478('0xf')](_0xa478('0x13'),_0x234ef6[_0xa478('0x11')],_0x15e5bb);_0x25ff20(_0x30bc81['error'](0x1f4,_0x234ef6['message']));});});}; \ No newline at end of file +var _0xe138=['jayson/promise','client','http','request','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','model','map','then','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xe138,0x12a));var _0x8e13=function(_0x44a1bb,_0x4a6bfa){_0x44a1bb=_0x44a1bb-0x0;var _0x2067b8=_0xe138[_0x44a1bb];return _0x2067b8;};'use strict';var _=require(_0x8e13('0x0'));var util=require(_0x8e13('0x1'));var moment=require('moment');var BPromise=require(_0x8e13('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e13('0x3'));var db=require(_0x8e13('0x4'))['db'];var utils=require(_0x8e13('0x5'));var logger=require('../../config/logger')(_0x8e13('0x6'));var config=require(_0x8e13('0x7'));var jayson=require(_0x8e13('0x8'));var client=jayson[_0x8e13('0x9')][_0x8e13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b476d,_0x3cc78e,_0x2dbdc2){return new BPromise(function(_0x2c66b6,_0x1ea39d){return client[_0x8e13('0xb')](_0x5b476d,_0x2dbdc2)['then'](function(_0xc4df72){logger[_0x8e13('0xc')]('Campaign,\x20%s,\x20%s',_0x3cc78e,'request\x20sent');logger[_0x8e13('0xd')](_0x8e13('0xe'),_0x3cc78e,_0x8e13('0xf'),JSON[_0x8e13('0x10')](_0xc4df72));if(_0xc4df72[_0x8e13('0x11')]){if(_0xc4df72[_0x8e13('0x11')][_0x8e13('0x12')]===0x1f4){logger[_0x8e13('0x11')](_0x8e13('0x13'),_0x3cc78e,_0xc4df72['error'][_0x8e13('0x14')]);return _0x1ea39d(_0xc4df72[_0x8e13('0x11')][_0x8e13('0x14')]);}logger[_0x8e13('0x11')]('Campaign,\x20%s,\x20%s',_0x3cc78e,_0xc4df72[_0x8e13('0x11')][_0x8e13('0x14')]);return _0x2c66b6(_0xc4df72[_0x8e13('0x11')][_0x8e13('0x14')]);}else{logger[_0x8e13('0xc')](_0x8e13('0x13'),_0x3cc78e,_0x8e13('0xf'));_0x2c66b6(_0xc4df72[_0x8e13('0x15')][_0x8e13('0x14')]);}})[_0x8e13('0x16')](function(_0x237def){logger['error'](_0x8e13('0x13'),_0x3cc78e,_0x237def);_0x1ea39d(_0x237def);});});}exports[_0x8e13('0x17')]=function(_0xa289fa){var _0x4591c4=this;return new Promise(function(_0x1e2691,_0x4199b3){return db['Campaign'][_0x8e13('0x18')]({'raw':_0xa289fa[_0x8e13('0x19')]?_0xa289fa[_0x8e13('0x19')][_0x8e13('0x1a')]===undefined?!![]:![]:!![],'where':_0xa289fa['options']?_0xa289fa[_0x8e13('0x19')][_0x8e13('0x1b')]||null:null,'attributes':_0xa289fa[_0x8e13('0x19')]?_0xa289fa[_0x8e13('0x19')][_0x8e13('0x1c')]||null:null,'limit':_0xa289fa[_0x8e13('0x19')]?_0xa289fa['options'][_0x8e13('0x1d')]||null:null,'include':_0xa289fa[_0x8e13('0x19')]?_0xa289fa['options'][_0x8e13('0x1e')]?_['map'](_0xa289fa[_0x8e13('0x19')][_0x8e13('0x1e')],function(_0x3818fd){return{'model':db[_0x3818fd[_0x8e13('0x1f')]],'as':_0x3818fd['as'],'attributes':_0x3818fd[_0x8e13('0x1c')],'include':_0x3818fd[_0x8e13('0x1e')]?_['map'](_0x3818fd[_0x8e13('0x1e')],function(_0xeb0f4a){return{'model':db[_0xeb0f4a['model']],'as':_0xeb0f4a['as'],'attributes':_0xeb0f4a[_0x8e13('0x1c')],'include':_0xeb0f4a[_0x8e13('0x1e')]?_[_0x8e13('0x20')](_0xeb0f4a[_0x8e13('0x1e')],function(_0x46fabf){return{'model':db[_0x46fabf[_0x8e13('0x1f')]],'as':_0x46fabf['as'],'attributes':_0x46fabf['attributes']};}):[]};}):[]};}):[]:[]})[_0x8e13('0x21')](function(_0x32629d){logger[_0x8e13('0xc')](_0x8e13('0x17'),_0xa289fa);logger['debug'](_0x8e13('0x17'),_0xa289fa,JSON[_0x8e13('0x10')](_0x32629d));_0x1e2691(_0x32629d);})[_0x8e13('0x16')](function(_0x172cf2){logger[_0x8e13('0x11')]('GetCampaign',_0x172cf2[_0x8e13('0x14')],_0xa289fa);_0x4199b3(_0x4591c4[_0x8e13('0x11')](0x1f4,_0x172cf2['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 942c689..054245a 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 _0xbec8=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','create','post','/:id/clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id/hoppers'];(function(_0x3e0ac2,_0x3875b0){var _0x585d6f=function(_0xd3adf1){while(--_0xd3adf1){_0x3e0ac2['push'](_0x3e0ac2['shift']());}};_0x585d6f(++_0x3875b0);}(_0xbec8,0x13e));var _0x8bec=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0xbec8[_0x3d78d7];return _0x4b6784;};'use strict';var multer=require(_0x8bec('0x0'));var util=require(_0x8bec('0x1'));var path=require(_0x8bec('0x2'));var timeout=require(_0x8bec('0x3'));var express=require('express');var router=express[_0x8bec('0x4')]();var auth=require(_0x8bec('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8bec('0x6'));var controller=require(_0x8bec('0x7'));router['get']('/',auth[_0x8bec('0x8')](),controller[_0x8bec('0x9')]);router[_0x8bec('0xa')]('/:id',auth[_0x8bec('0x8')](),controller['show']);router['get'](_0x8bec('0xb'),auth[_0x8bec('0x8')](),controller[_0x8bec('0xc')]);router[_0x8bec('0xa')](_0x8bec('0xd'),auth[_0x8bec('0x8')](),controller[_0x8bec('0xe')]);router[_0x8bec('0xa')](_0x8bec('0xf'),auth[_0x8bec('0x8')](),controller[_0x8bec('0x10')]);router['get'](_0x8bec('0x11'),auth[_0x8bec('0x8')](),controller[_0x8bec('0x12')]);router[_0x8bec('0xa')](_0x8bec('0x13'),auth['isAuthenticated'](),controller[_0x8bec('0x14')]);router[_0x8bec('0xa')]('/:id/blacklists',auth[_0x8bec('0x8')](),controller['getBlackLists']);router['post']('/',auth[_0x8bec('0x8')](),controller[_0x8bec('0x15')]);router[_0x8bec('0x16')](_0x8bec('0x17'),auth['isAuthenticated'](),controller['clone']);router[_0x8bec('0x16')](_0x8bec('0x13'),auth[_0x8bec('0x8')](),controller[_0x8bec('0x18')]);router[_0x8bec('0x16')](_0x8bec('0x19'),auth[_0x8bec('0x8')](),controller[_0x8bec('0x1a')]);router[_0x8bec('0x1b')]('/:id',auth[_0x8bec('0x8')](),controller[_0x8bec('0x1c')]);router[_0x8bec('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x8bec('0x1e')]);router[_0x8bec('0x1d')](_0x8bec('0x13'),auth[_0x8bec('0x8')](),controller[_0x8bec('0x1f')]);router[_0x8bec('0x1d')](_0x8bec('0x19'),auth[_0x8bec('0x8')](),controller[_0x8bec('0x20')]);module['exports']=router; \ No newline at end of file +var _0x3522=['/:id/blacklists','getBlackLists','post','create','addLists','addBlackLists','put','update','delete','destroy','removeBlackLists','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists'];(function(_0x2f607a,_0x59541e){var _0x286a07=function(_0x4116a3){while(--_0x4116a3){_0x2f607a['push'](_0x2f607a['shift']());}};_0x286a07(++_0x59541e);}(_0x3522,0x18c));var _0x2352=function(_0x175ff0,_0x7ae252){_0x175ff0=_0x175ff0-0x0;var _0x12fd7e=_0x3522[_0x175ff0];return _0x12fd7e;};'use strict';var multer=require(_0x2352('0x0'));var util=require(_0x2352('0x1'));var path=require(_0x2352('0x2'));var timeout=require('connect-timeout');var express=require(_0x2352('0x3'));var router=express[_0x2352('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2352('0x5'));var config=require(_0x2352('0x6'));var controller=require('./campaign.controller');router[_0x2352('0x7')]('/',auth[_0x2352('0x8')](),controller[_0x2352('0x9')]);router[_0x2352('0x7')](_0x2352('0xa'),auth[_0x2352('0x8')](),controller[_0x2352('0xb')]);router[_0x2352('0x7')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0x2352('0x7')](_0x2352('0xc'),auth[_0x2352('0x8')](),controller[_0x2352('0xd')]);router['get'](_0x2352('0xe'),auth['isAuthenticated'](),controller[_0x2352('0xf')]);router[_0x2352('0x7')](_0x2352('0x10'),auth[_0x2352('0x8')](),controller[_0x2352('0x11')]);router[_0x2352('0x7')](_0x2352('0x12'),auth['isAuthenticated'](),controller[_0x2352('0x13')]);router[_0x2352('0x7')](_0x2352('0x14'),auth['isAuthenticated'](),controller[_0x2352('0x15')]);router[_0x2352('0x16')]('/',auth['isAuthenticated'](),controller[_0x2352('0x17')]);router[_0x2352('0x16')]('/:id/clone',auth[_0x2352('0x8')](),controller['clone']);router[_0x2352('0x16')]('/:id/lists',auth[_0x2352('0x8')](),controller[_0x2352('0x18')]);router[_0x2352('0x16')](_0x2352('0x14'),auth[_0x2352('0x8')](),controller[_0x2352('0x19')]);router[_0x2352('0x1a')]('/:id',auth[_0x2352('0x8')](),controller[_0x2352('0x1b')]);router[_0x2352('0x1c')](_0x2352('0xa'),auth[_0x2352('0x8')](),controller[_0x2352('0x1d')]);router['delete']('/:id/lists',auth[_0x2352('0x8')](),controller['removeLists']);router[_0x2352('0x1c')]('/:id/blacklists',auth[_0x2352('0x8')](),controller[_0x2352('0x1e')]);module[_0x2352('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index c32d35d..51e9d9e 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 _0xa98d=['TEXT','VIRTUAL','sequelize','exports','STRING'];(function(_0x58f184,_0x20c094){var _0x328ade=function(_0x463253){while(--_0x463253){_0x58f184['push'](_0x58f184['shift']());}};_0x328ade(++_0x20c094);}(_0xa98d,0xac));var _0xda98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xda98('0x0'));module[_0xda98('0x1')]={'key':{'type':Sequelize[_0xda98('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xda98('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xda98('0x2')]},'name':{'type':Sequelize[_0xda98('0x4')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file +var _0xb990=['STRING','TEXT','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb990,0x9f));var _0x0b99=function(_0x2577f7,_0x4e4781){_0x2577f7=_0x2577f7-0x0;var _0x55d372=_0xb990[_0x2577f7];return _0x55d372;};'use strict';var Sequelize=require(_0x0b99('0x0'));module[_0x0b99('0x1')]={'key':{'type':Sequelize[_0x0b99('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0b99('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x0b99('0x2')]},'name':{'type':Sequelize[_0x0b99('0x4')],'get':function(){return this[_0x0b99('0x5')](_0x0b99('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index be25ccf..4a4a08d 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 _0x1448=['filter','options','CannedAnswer','count','includeAll','show','params','rawAttributes','include','find','catch','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','crypto','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','update','destroy','then','get','CannedAnswers','end','error','stack','name','keys','query','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type'];(function(_0x163e08,_0x5dd197){var _0xec831f=function(_0x3b6739){while(--_0x3b6739){_0x163e08['push'](_0x163e08['shift']());}};_0xec831f(++_0x5dd197);}(_0x1448,0xff));var _0x8144=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1448[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x8144('0x0'));var emlformat=require(_0x8144('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8144('0x2'));var rp=require('request-promise');var moment=require(_0x8144('0x3'));var BPromise=require(_0x8144('0x4'));var Mustache=require('mustache');var util=require(_0x8144('0x5'));var path=require(_0x8144('0x6'));var sox=require(_0x8144('0x7'));var csv=require(_0x8144('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8144('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8144('0x8'));var querystring=require(_0x8144('0xa'));var Papa=require('papaparse');var authService=require(_0x8144('0xb'));var hardwareService=require(_0x8144('0xc'));var Redis=require('ioredis');var qs=require(_0x8144('0xd'));var logger=require(_0x8144('0xe'))(_0x8144('0xf'));var utils=require('../../config/utils');var config=require(_0x8144('0x10'));var db=require(_0x8144('0x11'))['db'];function respondWithStatusCode(_0x57c1ce,_0x51a8ed){_0x51a8ed=_0x51a8ed||0xcc;return function(_0x2b3cae){if(_0x2b3cae){return _0x57c1ce[_0x8144('0x12')](_0x51a8ed);}return _0x57c1ce[_0x8144('0x13')](_0x51a8ed)['end']();};}function respondWithResult(_0x48b6c4,_0x2a94b0){_0x2a94b0=_0x2a94b0||0xc8;return function(_0xb0a6d5){if(_0xb0a6d5){return _0x48b6c4[_0x8144('0x13')](_0x2a94b0)[_0x8144('0x14')](_0xb0a6d5);}};}function respondWithFilteredResult(_0x354f9b,_0x2735ba){return function(_0x1a0d54){if(_0x1a0d54){var _0x4446bb=_0x1a0d54['count'],_0x405d8f=_0x2735ba[_0x8144('0x15')],_0x1a5055=_0x2735ba[_0x8144('0x15')]+_0x2735ba[_0x8144('0x16')],_0x10de57;if(_0x1a5055>=_0x4446bb){_0x1a5055=_0x4446bb;_0x10de57=0xc8;}else{_0x10de57=0xce;}_0x354f9b[_0x8144('0x13')](_0x10de57);return _0x354f9b[_0x8144('0x17')](_0x8144('0x18'),_0x405d8f+'-'+_0x1a5055+'/'+_0x4446bb)[_0x8144('0x14')](_0x1a0d54);}return null;};}function patchUpdates(_0x45158a){return function(_0x545214){try{jsonpatch['apply'](_0x545214,_0x45158a,!![]);}catch(_0x14088a){return BPromise['reject'](_0x14088a);}return _0x545214['save']();};}function saveUpdates(_0x5cadd0,_0x2b20bf){return function(_0x5b19e6){if(_0x5b19e6){return _0x5b19e6[_0x8144('0x19')](_0x5cadd0)['then'](function(_0x34fe4f){return _0x34fe4f;});}return null;};}function removeEntity(_0x130b13,_0x32c3bb){return function(_0x48a222){if(_0x48a222){return _0x48a222[_0x8144('0x1a')]()[_0x8144('0x1b')](function(){var _0x58a32a=_0x48a222[_0x8144('0x1c')]({'plain':!![]});var _0xea2dd5=_0x8144('0x1d');return db['UserProfileResource']['destroy']({'where':{'type':_0xea2dd5,'resourceId':_0x58a32a['id']}})['then'](function(){return _0x48a222;});})[_0x8144('0x1b')](function(){_0x130b13[_0x8144('0x13')](0xcc)[_0x8144('0x1e')]();});}};}function handleEntityNotFound(_0x35f073,_0x8c6dd5){return function(_0x19a5e6){if(!_0x19a5e6){_0x35f073[_0x8144('0x12')](0x194);}return _0x19a5e6;};}function handleError(_0x20a47c,_0x35dc25){_0x35dc25=_0x35dc25||0x1f4;return function(_0x68571f){logger[_0x8144('0x1f')](_0x68571f[_0x8144('0x20')]);if(_0x68571f[_0x8144('0x21')]){delete _0x68571f[_0x8144('0x21')];}_0x20a47c[_0x8144('0x13')](_0x35dc25)['send'](_0x68571f);};}exports['index']=function(_0x9bde9e,_0x56614e){var _0x1b8466={},_0x5845f8={},_0x2acbea={'count':0x0,'rows':[]};var _0x244f37=db['CannedAnswer']['rawAttributes'];_0x5845f8['model']=_[_0x8144('0x22')](_0x244f37);_0x5845f8[_0x8144('0x23')]=_[_0x8144('0x22')](_0x9bde9e[_0x8144('0x23')]);_0x5845f8['filters']=_[_0x8144('0x24')](_0x5845f8['model'],_0x5845f8[_0x8144('0x23')]);_0x1b8466[_0x8144('0x25')]=_[_0x8144('0x24')](_0x5845f8['model'],qs[_0x8144('0x26')](_0x9bde9e[_0x8144('0x23')]['fields']));_0x1b8466[_0x8144('0x25')]=_0x1b8466[_0x8144('0x25')][_0x8144('0x27')]?_0x1b8466[_0x8144('0x25')]:_0x5845f8[_0x8144('0x28')];if(!_0x9bde9e[_0x8144('0x23')][_0x8144('0x29')](_0x8144('0x2a'))){_0x1b8466['limit']=qs[_0x8144('0x16')](_0x9bde9e[_0x8144('0x23')][_0x8144('0x16')]);_0x1b8466[_0x8144('0x15')]=qs['offset'](_0x9bde9e[_0x8144('0x23')][_0x8144('0x15')]);}_0x1b8466['order']=qs[_0x8144('0x2b')](_0x9bde9e[_0x8144('0x23')][_0x8144('0x2b')]);_0x1b8466[_0x8144('0x2c')]=qs[_0x8144('0x2d')](_[_0x8144('0x2e')](_0x9bde9e[_0x8144('0x23')],_0x5845f8[_0x8144('0x2d')]));if(_0x9bde9e[_0x8144('0x23')]['filter']){_0x1b8466[_0x8144('0x2c')]=_[_0x8144('0x2f')](_0x1b8466[_0x8144('0x2c')],{'$or':_['map'](_0x244f37,function(_0x451b92){if(_0x451b92[_0x8144('0x30')]['key']!=='VIRTUAL'){var _0x491cfa={};_0x491cfa[_0x451b92['field']]={'$like':'%'+_0x9bde9e[_0x8144('0x23')][_0x8144('0x31')]+'%'};return _0x491cfa;}})});}_0x1b8466=_['merge']({},_0x1b8466,_0x9bde9e[_0x8144('0x32')]);var _0x12940e={'where':_0x1b8466[_0x8144('0x2c')]};return db[_0x8144('0x33')]['count'](_0x12940e)[_0x8144('0x1b')](function(_0x4e43fe){_0x2acbea[_0x8144('0x34')]=_0x4e43fe;if(_0x9bde9e[_0x8144('0x23')][_0x8144('0x35')]){_0x1b8466['include']=[{'all':!![]}];}return db[_0x8144('0x33')]['findAll'](_0x1b8466);})['then'](function(_0x192c1d){_0x2acbea['rows']=_0x192c1d;return _0x2acbea;})[_0x8144('0x1b')](respondWithFilteredResult(_0x56614e,_0x1b8466))['catch'](handleError(_0x56614e,null));};exports[_0x8144('0x36')]=function(_0x1903a3,_0x5f5250){var _0xf169b4={'raw':!![],'where':{'id':_0x1903a3[_0x8144('0x37')]['id']}},_0x4dad0d={};_0x4dad0d[_0x8144('0x28')]=_[_0x8144('0x22')](db['CannedAnswer'][_0x8144('0x38')]);_0x4dad0d['query']=_[_0x8144('0x22')](_0x1903a3['query']);_0x4dad0d[_0x8144('0x2d')]=_[_0x8144('0x24')](_0x4dad0d[_0x8144('0x28')],_0x4dad0d[_0x8144('0x23')]);_0xf169b4[_0x8144('0x25')]=_[_0x8144('0x24')](_0x4dad0d[_0x8144('0x28')],qs[_0x8144('0x26')](_0x1903a3[_0x8144('0x23')][_0x8144('0x26')]));_0xf169b4[_0x8144('0x25')]=_0xf169b4[_0x8144('0x25')][_0x8144('0x27')]?_0xf169b4[_0x8144('0x25')]:_0x4dad0d[_0x8144('0x28')];if(_0x1903a3['query']['includeAll']){_0xf169b4[_0x8144('0x39')]=[{'all':!![]}];}_0xf169b4=_[_0x8144('0x2f')]({},_0xf169b4,_0x1903a3[_0x8144('0x32')]);return db['CannedAnswer'][_0x8144('0x3a')](_0xf169b4)[_0x8144('0x1b')](handleEntityNotFound(_0x5f5250,null))['then'](respondWithResult(_0x5f5250,null))[_0x8144('0x3b')](handleError(_0x5f5250,null));};exports[_0x8144('0x19')]=function(_0x3766b6,_0x3ca64b){if(_0x3766b6[_0x8144('0x3c')]['id']){delete _0x3766b6['body']['id'];}return db[_0x8144('0x33')][_0x8144('0x3a')]({'where':{'id':_0x3766b6[_0x8144('0x37')]['id']}})[_0x8144('0x1b')](handleEntityNotFound(_0x3ca64b,null))[_0x8144('0x1b')](saveUpdates(_0x3766b6[_0x8144('0x3c')],null))['then'](respondWithResult(_0x3ca64b,null))[_0x8144('0x3b')](handleError(_0x3ca64b,null));};exports['destroy']=function(_0x27fcdd,_0x2a955e){return db[_0x8144('0x33')][_0x8144('0x3a')]({'where':{'id':_0x27fcdd['params']['id']}})[_0x8144('0x1b')](handleEntityNotFound(_0x2a955e,null))[_0x8144('0x1b')](removeEntity(_0x2a955e,null))[_0x8144('0x3b')](handleError(_0x2a955e,null));};exports[_0x8144('0x3d')]=function(_0x3c9368,_0xbac60a){var _0x55d46c={'key':_0x3c9368[_0x8144('0x3c')][_0x8144('0x3e')]};if(_0x3c9368[_0x8144('0x3c')][_0x8144('0x3f')]){_0x55d46c['MailAccountId']=_0x3c9368[_0x8144('0x3c')][_0x8144('0x3f')];}else if(_0x3c9368['body'][_0x8144('0x40')]){_0x55d46c[_0x8144('0x40')]=_0x3c9368[_0x8144('0x3c')][_0x8144('0x40')];}else if(_0x3c9368[_0x8144('0x3c')]['OpenchannelAccountId']){_0x55d46c[_0x8144('0x41')]=_0x3c9368[_0x8144('0x3c')]['OpenchannelAccountId'];}else if(_0x3c9368[_0x8144('0x3c')][_0x8144('0x42')]){_0x55d46c['ChatWebsiteId']=_0x3c9368[_0x8144('0x3c')][_0x8144('0x42')];}return db[_0x8144('0x33')]['find']({'where':_0x55d46c})[_0x8144('0x1b')](function(_0x478cb9){if(_0x478cb9){throw new db['Sequelize'][(_0x8144('0x43'))](_0x8144('0x44'));}return db[_0x8144('0x33')][_0x8144('0x3d')](_0x3c9368['body']);})[_0x8144('0x1b')](function(_0x31eca7){var _0x521599=_0x3c9368['user'][_0x8144('0x1c')]({'plain':!![]});if(!_0x521599)throw new Error(_0x8144('0x45'));if(_0x521599[_0x8144('0x46')]==='user'){var _0x526056=_0x31eca7[_0x8144('0x1c')]({'plain':!![]});return db[_0x8144('0x47')][_0x8144('0x3a')]({'where':{'name':_0x8144('0x1d'),'userProfileId':_0x521599[_0x8144('0x48')]},'raw':!![]})[_0x8144('0x1b')](function(_0x501e1c){if(_0x501e1c&&_0x501e1c[_0x8144('0x49')]===0x0){return db[_0x8144('0x4a')][_0x8144('0x3d')]({'name':_0x526056['name'],'resourceId':_0x526056['id'],'type':_0x501e1c[_0x8144('0x21')],'sectionId':_0x501e1c['id']},{})[_0x8144('0x1b')](function(){return _0x31eca7;});}else{return _0x31eca7;}})['catch'](function(_0x4082ec){logger['error'](_0x8144('0x4b'),_0x4082ec);throw _0x4082ec;});}return _0x31eca7;})[_0x8144('0x1b')](respondWithResult(_0xbac60a,0xc9))[_0x8144('0x3b')](handleError(_0xbac60a,null));}; \ No newline at end of file +var _0x0927=['field','options','include','rows','params','rawAttributes','includeAll','find','catch','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','reject','save','destroy','then','get','CannedAnswers','UserProfileResource','end','error','name','send','index','CannedAnswer','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL'];(function(_0x12a51d,_0x4a47cb){var _0x217182=function(_0xf1a7c8){while(--_0xf1a7c8){_0x12a51d['push'](_0x12a51d['shift']());}};_0x217182(++_0x4a47cb);}(_0x0927,0xc8));var _0x7092=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0927[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x7092('0x0'));var emlformat=require(_0x7092('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7092('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7092('0x3'));var moment=require(_0x7092('0x4'));var BPromise=require(_0x7092('0x5'));var Mustache=require(_0x7092('0x6'));var util=require(_0x7092('0x7'));var path=require(_0x7092('0x8'));var sox=require(_0x7092('0x9'));var csv=require(_0x7092('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7092('0xb'));var squel=require('squel');var crypto=require(_0x7092('0xc'));var jsforce=require(_0x7092('0xd'));var deskjs=require(_0x7092('0xe'));var toCsv=require(_0x7092('0xa'));var querystring=require(_0x7092('0xf'));var Papa=require('papaparse');var authService=require(_0x7092('0x10'));var hardwareService=require(_0x7092('0x11'));var Redis=require(_0x7092('0x12'));var qs=require(_0x7092('0x13'));var logger=require(_0x7092('0x14'))(_0x7092('0x15'));var utils=require(_0x7092('0x16'));var config=require(_0x7092('0x17'));var db=require(_0x7092('0x18'))['db'];function respondWithStatusCode(_0x3e57ad,_0x4538b5){_0x4538b5=_0x4538b5||0xcc;return function(_0x312471){if(_0x312471){return _0x3e57ad[_0x7092('0x19')](_0x4538b5);}return _0x3e57ad['status'](_0x4538b5)['end']();};}function respondWithResult(_0x3e0a70,_0x2107f0){_0x2107f0=_0x2107f0||0xc8;return function(_0x1d83a6){if(_0x1d83a6){return _0x3e0a70[_0x7092('0x1a')](_0x2107f0)[_0x7092('0x1b')](_0x1d83a6);}};}function respondWithFilteredResult(_0x3d8442,_0x2cfd10){return function(_0x401427){if(_0x401427){var _0x4152cd=_0x401427[_0x7092('0x1c')],_0xfaa850=_0x2cfd10[_0x7092('0x1d')],_0x18c961=_0x2cfd10[_0x7092('0x1d')]+_0x2cfd10['limit'],_0x2fa8ef;if(_0x18c961>=_0x4152cd){_0x18c961=_0x4152cd;_0x2fa8ef=0xc8;}else{_0x2fa8ef=0xce;}_0x3d8442[_0x7092('0x1a')](_0x2fa8ef);return _0x3d8442[_0x7092('0x1e')](_0x7092('0x1f'),_0xfaa850+'-'+_0x18c961+'/'+_0x4152cd)[_0x7092('0x1b')](_0x401427);}return null;};}function patchUpdates(_0x40be66){return function(_0x555468){try{jsonpatch['apply'](_0x555468,_0x40be66,!![]);}catch(_0x1e2b1d){return BPromise[_0x7092('0x20')](_0x1e2b1d);}return _0x555468[_0x7092('0x21')]();};}function saveUpdates(_0x4ead69,_0x333f68){return function(_0x4b2d40){if(_0x4b2d40){return _0x4b2d40['update'](_0x4ead69)['then'](function(_0x34dc4b){return _0x34dc4b;});}return null;};}function removeEntity(_0x4a405d,_0x393bba){return function(_0x5bab93){if(_0x5bab93){return _0x5bab93[_0x7092('0x22')]()[_0x7092('0x23')](function(){var _0x4a3e76=_0x5bab93[_0x7092('0x24')]({'plain':!![]});var _0x4df271=_0x7092('0x25');return db[_0x7092('0x26')][_0x7092('0x22')]({'where':{'type':_0x4df271,'resourceId':_0x4a3e76['id']}})[_0x7092('0x23')](function(){return _0x5bab93;});})[_0x7092('0x23')](function(){_0x4a405d[_0x7092('0x1a')](0xcc)[_0x7092('0x27')]();});}};}function handleEntityNotFound(_0x35b8f5,_0x5a6376){return function(_0x1e9be3){if(!_0x1e9be3){_0x35b8f5[_0x7092('0x19')](0x194);}return _0x1e9be3;};}function handleError(_0x1528a2,_0x5f21d2){_0x5f21d2=_0x5f21d2||0x1f4;return function(_0x531bd1){logger[_0x7092('0x28')](_0x531bd1['stack']);if(_0x531bd1[_0x7092('0x29')]){delete _0x531bd1[_0x7092('0x29')];}_0x1528a2[_0x7092('0x1a')](_0x5f21d2)[_0x7092('0x2a')](_0x531bd1);};}exports[_0x7092('0x2b')]=function(_0x240c4,_0x49f9ce){var _0x58db81={},_0x2404b3={},_0x2ec25c={'count':0x0,'rows':[]};var _0x475c6d=db[_0x7092('0x2c')]['rawAttributes'];_0x2404b3[_0x7092('0x2d')]=_[_0x7092('0x2e')](_0x475c6d);_0x2404b3[_0x7092('0x2f')]=_[_0x7092('0x2e')](_0x240c4[_0x7092('0x2f')]);_0x2404b3[_0x7092('0x30')]=_[_0x7092('0x31')](_0x2404b3[_0x7092('0x2d')],_0x2404b3[_0x7092('0x2f')]);_0x58db81['attributes']=_[_0x7092('0x31')](_0x2404b3[_0x7092('0x2d')],qs['fields'](_0x240c4['query'][_0x7092('0x32')]));_0x58db81[_0x7092('0x33')]=_0x58db81[_0x7092('0x33')][_0x7092('0x34')]?_0x58db81['attributes']:_0x2404b3['model'];if(!_0x240c4[_0x7092('0x2f')]['hasOwnProperty'](_0x7092('0x35'))){_0x58db81[_0x7092('0x36')]=qs[_0x7092('0x36')](_0x240c4[_0x7092('0x2f')][_0x7092('0x36')]);_0x58db81[_0x7092('0x1d')]=qs[_0x7092('0x1d')](_0x240c4['query'][_0x7092('0x1d')]);}_0x58db81[_0x7092('0x37')]=qs[_0x7092('0x38')](_0x240c4[_0x7092('0x2f')][_0x7092('0x38')]);_0x58db81[_0x7092('0x39')]=qs[_0x7092('0x30')](_[_0x7092('0x3a')](_0x240c4[_0x7092('0x2f')],_0x2404b3[_0x7092('0x30')]));if(_0x240c4[_0x7092('0x2f')][_0x7092('0x3b')]){_0x58db81[_0x7092('0x39')]=_[_0x7092('0x3c')](_0x58db81['where'],{'$or':_['map'](_0x475c6d,function(_0x375f14){if(_0x375f14[_0x7092('0x3d')][_0x7092('0x3e')]!==_0x7092('0x3f')){var _0x5b158b={};_0x5b158b[_0x375f14[_0x7092('0x40')]]={'$like':'%'+_0x240c4[_0x7092('0x2f')]['filter']+'%'};return _0x5b158b;}})});}_0x58db81=_['merge']({},_0x58db81,_0x240c4[_0x7092('0x41')]);var _0x43b509={'where':_0x58db81[_0x7092('0x39')]};return db[_0x7092('0x2c')][_0x7092('0x1c')](_0x43b509)['then'](function(_0x495bc6){_0x2ec25c['count']=_0x495bc6;if(_0x240c4['query']['includeAll']){_0x58db81[_0x7092('0x42')]=[{'all':!![]}];}return db[_0x7092('0x2c')]['findAll'](_0x58db81);})[_0x7092('0x23')](function(_0x52f3d9){_0x2ec25c[_0x7092('0x43')]=_0x52f3d9;return _0x2ec25c;})[_0x7092('0x23')](respondWithFilteredResult(_0x49f9ce,_0x58db81))['catch'](handleError(_0x49f9ce,null));};exports['show']=function(_0x465b96,_0x11b307){var _0x5e8c17={'raw':!![],'where':{'id':_0x465b96[_0x7092('0x44')]['id']}},_0xbb60d5={};_0xbb60d5[_0x7092('0x2d')]=_[_0x7092('0x2e')](db[_0x7092('0x2c')][_0x7092('0x45')]);_0xbb60d5[_0x7092('0x2f')]=_[_0x7092('0x2e')](_0x465b96[_0x7092('0x2f')]);_0xbb60d5[_0x7092('0x30')]=_[_0x7092('0x31')](_0xbb60d5[_0x7092('0x2d')],_0xbb60d5[_0x7092('0x2f')]);_0x5e8c17[_0x7092('0x33')]=_[_0x7092('0x31')](_0xbb60d5[_0x7092('0x2d')],qs[_0x7092('0x32')](_0x465b96[_0x7092('0x2f')][_0x7092('0x32')]));_0x5e8c17[_0x7092('0x33')]=_0x5e8c17['attributes'][_0x7092('0x34')]?_0x5e8c17[_0x7092('0x33')]:_0xbb60d5['model'];if(_0x465b96[_0x7092('0x2f')][_0x7092('0x46')]){_0x5e8c17[_0x7092('0x42')]=[{'all':!![]}];}_0x5e8c17=_[_0x7092('0x3c')]({},_0x5e8c17,_0x465b96['options']);return db['CannedAnswer'][_0x7092('0x47')](_0x5e8c17)[_0x7092('0x23')](handleEntityNotFound(_0x11b307,null))[_0x7092('0x23')](respondWithResult(_0x11b307,null))[_0x7092('0x48')](handleError(_0x11b307,null));};exports[_0x7092('0x49')]=function(_0x12e6e1,_0x4acf00){if(_0x12e6e1['body']['id']){delete _0x12e6e1[_0x7092('0x4a')]['id'];}return db[_0x7092('0x2c')][_0x7092('0x47')]({'where':{'id':_0x12e6e1['params']['id']}})['then'](handleEntityNotFound(_0x4acf00,null))[_0x7092('0x23')](saveUpdates(_0x12e6e1['body'],null))['then'](respondWithResult(_0x4acf00,null))[_0x7092('0x48')](handleError(_0x4acf00,null));};exports['destroy']=function(_0x59c4d8,_0x54b535){return db['CannedAnswer']['find']({'where':{'id':_0x59c4d8['params']['id']}})[_0x7092('0x23')](handleEntityNotFound(_0x54b535,null))['then'](removeEntity(_0x54b535,null))[_0x7092('0x48')](handleError(_0x54b535,null));};exports[_0x7092('0x4b')]=function(_0x45d167,_0x1b7d88){var _0xb51e4={'key':_0x45d167['body']['key']};if(_0x45d167['body'][_0x7092('0x4c')]){_0xb51e4[_0x7092('0x4c')]=_0x45d167['body'][_0x7092('0x4c')];}else if(_0x45d167[_0x7092('0x4a')][_0x7092('0x4d')]){_0xb51e4[_0x7092('0x4d')]=_0x45d167['body'][_0x7092('0x4d')];}else if(_0x45d167['body'][_0x7092('0x4e')]){_0xb51e4['OpenchannelAccountId']=_0x45d167[_0x7092('0x4a')][_0x7092('0x4e')];}else if(_0x45d167['body'][_0x7092('0x4f')]){_0xb51e4[_0x7092('0x4f')]=_0x45d167['body']['ChatWebsiteId'];}return db[_0x7092('0x2c')][_0x7092('0x47')]({'where':_0xb51e4})[_0x7092('0x23')](function(_0x259997){if(_0x259997){throw new db['Sequelize'][(_0x7092('0x50'))](_0x7092('0x51'));}return db[_0x7092('0x2c')]['create'](_0x45d167[_0x7092('0x4a')]);})[_0x7092('0x23')](function(_0x3bbcb8){var _0x13a5ce=_0x45d167[_0x7092('0x52')][_0x7092('0x24')]({'plain':!![]});if(!_0x13a5ce)throw new Error(_0x7092('0x53'));if(_0x13a5ce[_0x7092('0x54')]==='user'){var _0x54216a=_0x3bbcb8['get']({'plain':!![]});return db[_0x7092('0x55')]['find']({'where':{'name':_0x7092('0x25'),'userProfileId':_0x13a5ce[_0x7092('0x56')]},'raw':!![]})[_0x7092('0x23')](function(_0x562348){if(_0x562348&&_0x562348[_0x7092('0x57')]===0x0){return db[_0x7092('0x26')][_0x7092('0x4b')]({'name':_0x54216a[_0x7092('0x29')],'resourceId':_0x54216a['id'],'type':_0x562348[_0x7092('0x29')],'sectionId':_0x562348['id']},{})[_0x7092('0x23')](function(){return _0x3bbcb8;});}else{return _0x3bbcb8;}})[_0x7092('0x48')](function(_0x45dfac){logger[_0x7092('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45dfac);throw _0x45dfac;});}return _0x3bbcb8;})[_0x7092('0x23')](respondWithResult(_0x1b7d88,0xc9))['catch'](handleError(_0x1b7d88,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index f8348d7..ba08793 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 _0x6bb7=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','./cannedAnswer.attributes'];(function(_0x5dc860,_0x3754bb){var _0x7e0e4e=function(_0x1c7553){while(--_0x1c7553){_0x5dc860['push'](_0x5dc860['shift']());}};_0x7e0e4e(++_0x3754bb);}(_0x6bb7,0xc9));var _0x76bb=function(_0x1e862b,_0x56a38d){_0x1e862b=_0x1e862b-0x0;var _0x147c1e=_0x6bb7[_0x1e862b];return _0x147c1e;};'use strict';var _=require(_0x76bb('0x0'));var util=require(_0x76bb('0x1'));var logger=require(_0x76bb('0x2'))(_0x76bb('0x3'));var moment=require('moment');var BPromise=require(_0x76bb('0x4'));var rp=require(_0x76bb('0x5'));var attributes=require(_0x76bb('0x6'));module[_0x76bb('0x7')]=function(_0x4e622d,_0x534f17){return _0x4e622d[_0x76bb('0x8')](_0x76bb('0x9'),attributes,{'tableName':_0x76bb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x76bb('0xb'),'collate':_0x76bb('0xc')});}; \ No newline at end of file +var _0x1857=['tools_canned_answers','utf8mb4_unicode_ci','lodash','util','api','moment','exports','define','CannedAnswer'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x1857,0x1a0));var _0x7185=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1857[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7185('0x0'));var util=require(_0x7185('0x1'));var logger=require('../../config/logger')(_0x7185('0x2'));var moment=require(_0x7185('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./cannedAnswer.attributes');module[_0x7185('0x4')]=function(_0xf7f5fc,_0x118961){return _0xf7f5fc[_0x7185('0x5')](_0x7185('0x6'),attributes,{'tableName':_0x7185('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7185('0x8')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 1a7246c..9c8637b 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 _0x793c=['rpc','../../config/environment','client','request','info','CannedAnswer,\x20%s,\x20%s','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xa1e8bd,_0x46fd71){var _0x1c7062=function(_0x2d5926){while(--_0x2d5926){_0xa1e8bd['push'](_0xa1e8bd['shift']());}};_0x1c7062(++_0x46fd71);}(_0x793c,0x175));var _0xc793=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x793c[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xc793('0x0'));var util=require(_0xc793('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc793('0x2'));var fs=require('fs');var Redis=require(_0xc793('0x3'));var db=require(_0xc793('0x4'))['db'];var utils=require(_0xc793('0x5'));var logger=require(_0xc793('0x6'))(_0xc793('0x7'));var config=require(_0xc793('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc793('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15a530,_0x507e08,_0x2a15eb){return new BPromise(function(_0x2c9ad6,_0x21ac1b){return client[_0xc793('0xa')](_0x15a530,_0x2a15eb)['then'](function(_0xad3c51){logger[_0xc793('0xb')](_0xc793('0xc'),_0x507e08,'request\x20sent');logger['debug'](_0xc793('0xd'),_0x507e08,_0xc793('0xe'),JSON[_0xc793('0xf')](_0xad3c51));if(_0xad3c51[_0xc793('0x10')]){if(_0xad3c51[_0xc793('0x10')]['code']===0x1f4){logger[_0xc793('0x10')](_0xc793('0xc'),_0x507e08,_0xad3c51['error'][_0xc793('0x11')]);return _0x21ac1b(_0xad3c51[_0xc793('0x10')][_0xc793('0x11')]);}logger[_0xc793('0x10')](_0xc793('0xc'),_0x507e08,_0xad3c51[_0xc793('0x10')][_0xc793('0x11')]);return _0x2c9ad6(_0xad3c51['error'][_0xc793('0x11')]);}else{logger[_0xc793('0xb')](_0xc793('0xc'),_0x507e08,'request\x20sent');_0x2c9ad6(_0xad3c51[_0xc793('0x12')][_0xc793('0x11')]);}})[_0xc793('0x13')](function(_0xc9c3cf){logger[_0xc793('0x10')](_0xc793('0xc'),_0x507e08,_0xc9c3cf);_0x21ac1b(_0xc9c3cf);});});} \ No newline at end of file +var _0x4113=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash','bluebird','ioredis','../../mysqldb'];(function(_0x1c22b2,_0x283e3c){var _0x1c8864=function(_0x347fed){while(--_0x347fed){_0x1c22b2['push'](_0x1c22b2['shift']());}};_0x1c8864(++_0x283e3c);}(_0x4113,0xe6));var _0x3411=function(_0x473482,_0x25b343){_0x473482=_0x473482-0x0;var _0x306b48=_0x4113[_0x473482];return _0x306b48;};'use strict';var _=require(_0x3411('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3411('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3411('0x2'));var db=require(_0x3411('0x3'))['db'];var utils=require(_0x3411('0x4'));var logger=require('../../config/logger')(_0x3411('0x5'));var config=require('../../config/environment');var jayson=require(_0x3411('0x6'));var client=jayson[_0x3411('0x7')][_0x3411('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x572f8b,_0x515604,_0x42efbe){return new BPromise(function(_0x47394d,_0x51c0ce){return client[_0x3411('0x9')](_0x572f8b,_0x42efbe)[_0x3411('0xa')](function(_0x311db2){logger[_0x3411('0xb')](_0x3411('0xc'),_0x515604,_0x3411('0xd'));logger[_0x3411('0xe')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x515604,_0x3411('0xd'),JSON['stringify'](_0x311db2));if(_0x311db2[_0x3411('0xf')]){if(_0x311db2['error'][_0x3411('0x10')]===0x1f4){logger[_0x3411('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x515604,_0x311db2[_0x3411('0xf')]['message']);return _0x51c0ce(_0x311db2[_0x3411('0xf')][_0x3411('0x11')]);}logger['error'](_0x3411('0xc'),_0x515604,_0x311db2['error'][_0x3411('0x11')]);return _0x47394d(_0x311db2[_0x3411('0xf')][_0x3411('0x11')]);}else{logger[_0x3411('0xb')]('CannedAnswer,\x20%s,\x20%s',_0x515604,'request\x20sent');_0x47394d(_0x311db2['result'][_0x3411('0x11')]);}})['catch'](function(_0x37a7c1){logger[_0x3411('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x515604,_0x37a7c1);_0x51c0ce(_0x37a7c1);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 1518d8b..517054c 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 _0x793a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','show','post','create','put','/:id','delete','destroy','exports','express','Router'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0x793a,0x86));var _0xa793=function(_0x65d075,_0x1aa49e){_0x65d075=_0x65d075-0x0;var _0xbd7972=_0x793a[_0x65d075];return _0xbd7972;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa793('0x0'));var router=express[_0xa793('0x1')]();var auth=require(_0xa793('0x2'));var interaction=require(_0xa793('0x3'));var config=require(_0xa793('0x4'));var controller=require(_0xa793('0x5'));router['get']('/',auth[_0xa793('0x6')](),controller[_0xa793('0x7')]);router[_0xa793('0x8')]('/:id',auth[_0xa793('0x6')](),controller[_0xa793('0x9')]);router[_0xa793('0xa')]('/',auth['isAuthenticated'](),controller[_0xa793('0xb')]);router[_0xa793('0xc')](_0xa793('0xd'),auth[_0xa793('0x6')](),controller['update']);router[_0xa793('0xe')]('/:id',auth[_0xa793('0x6')](),controller[_0xa793('0xf')]);module[_0xa793('0x10')]=router; \ No newline at end of file +var _0x07eb=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','post','create','put','update','delete'];(function(_0x314c56,_0x341a86){var _0xb84442=function(_0x36fce2){while(--_0x36fce2){_0x314c56['push'](_0x314c56['shift']());}};_0xb84442(++_0x341a86);}(_0x07eb,0x74));var _0xb07e=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x07eb[_0x44b3bd];return _0x1efc4a;};'use strict';var multer=require('multer');var util=require(_0xb07e('0x0'));var path=require(_0xb07e('0x1'));var timeout=require(_0xb07e('0x2'));var express=require(_0xb07e('0x3'));var router=express[_0xb07e('0x4')]();var auth=require(_0xb07e('0x5'));var interaction=require(_0xb07e('0x6'));var config=require(_0xb07e('0x7'));var controller=require(_0xb07e('0x8'));router[_0xb07e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb07e('0x9')](_0xb07e('0xa'),auth[_0xb07e('0xb')](),controller['show']);router[_0xb07e('0xc')]('/',auth[_0xb07e('0xb')](),controller[_0xb07e('0xd')]);router[_0xb07e('0xe')]('/:id',auth[_0xb07e('0xb')](),controller[_0xb07e('0xf')]);router[_0xb07e('0x10')]('/:id',auth[_0xb07e('0xb')](),controller[_0xb07e('0x11')]);module[_0xb07e('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 6ec60a5..ae1434b 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 _0x6cd8=['STRING','INTEGER','exports'];(function(_0x18eeb7,_0x3af8d2){var _0x177221=function(_0x38ddfc){while(--_0x38ddfc){_0x18eeb7['push'](_0x18eeb7['shift']());}};_0x177221(++_0x3af8d2);}(_0x6cd8,0xce));var _0x86cd=function(_0x6dfdd2,_0x4248fc){_0x6dfdd2=_0x6dfdd2-0x0;var _0x50c3b3=_0x6cd8[_0x6dfdd2];return _0x50c3b3;};'use strict';var Sequelize=require('sequelize');module[_0x86cd('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x86cd('0x1')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x86cd('0x1')]},'channel':{'type':Sequelize[_0x86cd('0x1')]},'dstchannel':{'type':Sequelize[_0x86cd('0x1')]},'lastapp':{'type':Sequelize[_0x86cd('0x1')]},'lastdata':{'type':Sequelize[_0x86cd('0x1')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x86cd('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x86cd('0x1')]},'userfield':{'type':Sequelize[_0x86cd('0x1')]},'uniqueid':{'type':Sequelize[_0x86cd('0x1')]},'linkedid':{'type':Sequelize[_0x86cd('0x1')]},'sequence':{'type':Sequelize[_0x86cd('0x1')]},'peeraccount':{'type':Sequelize[_0x86cd('0x1')]},'type':{'type':Sequelize[_0x86cd('0x1')]},'tag':{'type':Sequelize[_0x86cd('0x1')]}}; \ No newline at end of file +var _0xa51e=['INTEGER','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0xa51e,0xd8));var _0xea51=function(_0x25a055,_0x173511){_0x25a055=_0x25a055-0x0;var _0x2295f9=_0xa51e[_0x25a055];return _0x2295f9;};'use strict';var Sequelize=require('sequelize');module[_0xea51('0x0')]={'calldate':{'type':Sequelize[_0xea51('0x1')],'allowNull':![],'defaultValue':_0xea51('0x2')},'clid':{'type':Sequelize[_0xea51('0x3')]},'src':{'type':Sequelize[_0xea51('0x3')]},'dst':{'type':Sequelize[_0xea51('0x3')]},'dcontext':{'type':Sequelize[_0xea51('0x3')]},'channel':{'type':Sequelize[_0xea51('0x3')]},'dstchannel':{'type':Sequelize[_0xea51('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xea51('0x3')]},'duration':{'type':Sequelize[_0xea51('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xea51('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xea51('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xea51('0x3')]},'userfield':{'type':Sequelize[_0xea51('0x3')]},'uniqueid':{'type':Sequelize[_0xea51('0x3')]},'linkedid':{'type':Sequelize[_0xea51('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xea51('0x3')]},'type':{'type':Sequelize[_0xea51('0x3')]},'tag':{'type':Sequelize[_0xea51('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 142c1ab..0a263fd 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 _0xdea1=['field','options','then','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','html-pdf','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','index','Cdr','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','key'];(function(_0x85bde9,_0x4ec655){var _0x116ff2=function(_0xea4d28){while(--_0xea4d28){_0x85bde9['push'](_0x85bde9['shift']());}};_0x116ff2(++_0x4ec655);}(_0xdea1,0xe0));var _0x1dea=function(_0xad091b,_0x592974){_0xad091b=_0xad091b-0x0;var _0x408344=_0xdea1[_0xad091b];return _0x408344;};'use strict';var pdf=require(_0x1dea('0x0'));var emlformat=require(_0x1dea('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1dea('0x2'));var rp=require(_0x1dea('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1dea('0x4'));var util=require(_0x1dea('0x5'));var path=require(_0x1dea('0x6'));var sox=require(_0x1dea('0x7'));var csv=require('to-csv');var ejs=require(_0x1dea('0x8'));var fs=require('fs');var _=require(_0x1dea('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1dea('0xa'));var deskjs=require(_0x1dea('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1dea('0xc'));var Papa=require(_0x1dea('0xd'));var authService=require(_0x1dea('0xe'));var hardwareService=require(_0x1dea('0xf'));var Redis=require(_0x1dea('0x10'));var qs=require(_0x1dea('0x11'));var logger=require(_0x1dea('0x12'))(_0x1dea('0x13'));var utils=require(_0x1dea('0x14'));var config=require(_0x1dea('0x15'));var db=require(_0x1dea('0x16'))['db'];function respondWithStatusCode(_0x1df1c2,_0x23ac78){_0x23ac78=_0x23ac78||0xcc;return function(_0x385393){if(_0x385393){return _0x1df1c2[_0x1dea('0x17')](_0x23ac78);}return _0x1df1c2[_0x1dea('0x18')](_0x23ac78)[_0x1dea('0x19')]();};}function respondWithResult(_0x2ca9fb,_0x54d171){_0x54d171=_0x54d171||0xc8;return function(_0x256ddb){if(_0x256ddb){return _0x2ca9fb[_0x1dea('0x18')](_0x54d171)[_0x1dea('0x1a')](_0x256ddb);}};}function respondWithFilteredResult(_0x3609aa,_0x494c52){return function(_0x923157){if(_0x923157){var _0x536c40=_0x923157[_0x1dea('0x1b')],_0x260f1e=_0x494c52[_0x1dea('0x1c')],_0x5010b3=_0x494c52[_0x1dea('0x1c')]+_0x494c52[_0x1dea('0x1d')],_0x338d90;if(_0x5010b3>=_0x536c40){_0x5010b3=_0x536c40;_0x338d90=0xc8;}else{_0x338d90=0xce;}_0x3609aa[_0x1dea('0x18')](_0x338d90);return _0x3609aa[_0x1dea('0x1e')](_0x1dea('0x1f'),_0x260f1e+'-'+_0x5010b3+'/'+_0x536c40)[_0x1dea('0x1a')](_0x923157);}return null;};}function patchUpdates(_0x33e66e){return function(_0x2b8920){try{jsonpatch[_0x1dea('0x20')](_0x2b8920,_0x33e66e,!![]);}catch(_0x57047d){return BPromise['reject'](_0x57047d);}return _0x2b8920[_0x1dea('0x21')]();};}function saveUpdates(_0x527625,_0x21e750){return function(_0x422a4e){if(_0x422a4e){return _0x422a4e[_0x1dea('0x22')](_0x527625)['then'](function(_0xf1fa64){return _0xf1fa64;});}return null;};}function removeEntity(_0x38b6ff,_0x124c3e){return function(_0x39e899){if(_0x39e899){return _0x39e899[_0x1dea('0x23')]()['then'](function(){_0x38b6ff['status'](0xcc)[_0x1dea('0x19')]();});}};}function handleEntityNotFound(_0x26a9c7,_0x512b3d){return function(_0x54132c){if(!_0x54132c){_0x26a9c7['sendStatus'](0x194);}return _0x54132c;};}function handleError(_0x2001e1,_0x38cd5d){_0x38cd5d=_0x38cd5d||0x1f4;return function(_0x579c32){logger['error'](_0x579c32[_0x1dea('0x24')]);if(_0x579c32['name']){delete _0x579c32['name'];}_0x2001e1[_0x1dea('0x18')](_0x38cd5d)['send'](_0x579c32);};}exports[_0x1dea('0x25')]=function(_0x47aeee,_0x4360e5){var _0x13a494={},_0x3d0651={},_0x1c789f={'count':0x0,'rows':[]};var _0x3fdd9d=db[_0x1dea('0x26')][_0x1dea('0x27')];_0x3d0651[_0x1dea('0x28')]=_['keys'](_0x3fdd9d);_0x3d0651[_0x1dea('0x29')]=_[_0x1dea('0x2a')](_0x47aeee[_0x1dea('0x29')]);_0x3d0651[_0x1dea('0x2b')]=_[_0x1dea('0x2c')](_0x3d0651['model'],_0x3d0651['query']);_0x13a494[_0x1dea('0x2d')]=_[_0x1dea('0x2c')](_0x3d0651[_0x1dea('0x28')],qs[_0x1dea('0x2e')](_0x47aeee[_0x1dea('0x29')][_0x1dea('0x2e')]));_0x13a494[_0x1dea('0x2d')]=_0x13a494['attributes'][_0x1dea('0x2f')]?_0x13a494[_0x1dea('0x2d')]:_0x3d0651[_0x1dea('0x28')];if(!_0x47aeee[_0x1dea('0x29')][_0x1dea('0x30')]('nolimit')){_0x13a494['limit']=qs[_0x1dea('0x1d')](_0x47aeee[_0x1dea('0x29')][_0x1dea('0x1d')]);_0x13a494[_0x1dea('0x1c')]=qs[_0x1dea('0x1c')](_0x47aeee[_0x1dea('0x29')][_0x1dea('0x1c')]);}_0x13a494[_0x1dea('0x31')]=qs[_0x1dea('0x32')](_0x47aeee['query'][_0x1dea('0x32')]);_0x13a494[_0x1dea('0x33')]=qs[_0x1dea('0x2b')](_['pick'](_0x47aeee[_0x1dea('0x29')],_0x3d0651[_0x1dea('0x2b')]));if(_0x47aeee['query'][_0x1dea('0x34')]){_0x13a494[_0x1dea('0x33')]=_[_0x1dea('0x35')](_0x13a494[_0x1dea('0x33')],{'$or':_[_0x1dea('0x36')](_0x3fdd9d,function(_0x3cb1fc){if(_0x3cb1fc['type'][_0x1dea('0x37')]!=='VIRTUAL'){var _0x2d5b5b={};_0x2d5b5b[_0x3cb1fc[_0x1dea('0x38')]]={'$like':'%'+_0x47aeee[_0x1dea('0x29')][_0x1dea('0x34')]+'%'};return _0x2d5b5b;}})});}_0x13a494=_[_0x1dea('0x35')]({},_0x13a494,_0x47aeee[_0x1dea('0x39')]);var _0x4eb43d={'where':_0x13a494[_0x1dea('0x33')]};return db[_0x1dea('0x26')][_0x1dea('0x1b')](_0x4eb43d)[_0x1dea('0x3a')](function(_0x4917a2){_0x1c789f['count']=_0x4917a2;if(_0x47aeee['query']['includeAll']){_0x13a494[_0x1dea('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0x1dea('0x3c')](_0x13a494);})['then'](function(_0x5c9e31){_0x1c789f[_0x1dea('0x3d')]=_0x5c9e31;return _0x1c789f;})[_0x1dea('0x3a')](respondWithFilteredResult(_0x4360e5,_0x13a494))[_0x1dea('0x3e')](handleError(_0x4360e5,null));};exports[_0x1dea('0x3f')]=function(_0x30983e,_0x320985){var _0x5b9e7f={'raw':!![],'where':{'id':_0x30983e[_0x1dea('0x40')]['id']}},_0x41a066={};_0x41a066[_0x1dea('0x28')]=_[_0x1dea('0x2a')](db[_0x1dea('0x26')]['rawAttributes']);_0x41a066[_0x1dea('0x29')]=_[_0x1dea('0x2a')](_0x30983e['query']);_0x41a066[_0x1dea('0x2b')]=_[_0x1dea('0x2c')](_0x41a066['model'],_0x41a066[_0x1dea('0x29')]);_0x5b9e7f[_0x1dea('0x2d')]=_[_0x1dea('0x2c')](_0x41a066['model'],qs['fields'](_0x30983e['query'][_0x1dea('0x2e')]));_0x5b9e7f['attributes']=_0x5b9e7f[_0x1dea('0x2d')][_0x1dea('0x2f')]?_0x5b9e7f[_0x1dea('0x2d')]:_0x41a066[_0x1dea('0x28')];if(_0x30983e[_0x1dea('0x29')][_0x1dea('0x41')]){_0x5b9e7f[_0x1dea('0x3b')]=[{'all':!![]}];}_0x5b9e7f=_[_0x1dea('0x35')]({},_0x5b9e7f,_0x30983e[_0x1dea('0x39')]);return db[_0x1dea('0x26')]['find'](_0x5b9e7f)[_0x1dea('0x3a')](handleEntityNotFound(_0x320985,null))[_0x1dea('0x3a')](respondWithResult(_0x320985,null))['catch'](handleError(_0x320985,null));};exports[_0x1dea('0x42')]=function(_0x24f98f,_0x5d5b87){return db[_0x1dea('0x26')]['create'](_0x24f98f['body'],{})[_0x1dea('0x3a')](respondWithResult(_0x5d5b87,0xc9))[_0x1dea('0x3e')](handleError(_0x5d5b87,null));};exports[_0x1dea('0x22')]=function(_0x2d2048,_0x5ba05f){if(_0x2d2048[_0x1dea('0x43')]['id']){delete _0x2d2048['body']['id'];}return db[_0x1dea('0x26')][_0x1dea('0x44')]({'where':{'id':_0x2d2048[_0x1dea('0x40')]['id']}})['then'](handleEntityNotFound(_0x5ba05f,null))[_0x1dea('0x3a')](saveUpdates(_0x2d2048[_0x1dea('0x43')],null))[_0x1dea('0x3a')](respondWithResult(_0x5ba05f,null))[_0x1dea('0x3e')](handleError(_0x5ba05f,null));};exports[_0x1dea('0x23')]=function(_0x2c19cd,_0x216b1c){return db['Cdr']['find']({'where':{'id':_0x2c19cd[_0x1dea('0x40')]['id']}})[_0x1dea('0x3a')](handleEntityNotFound(_0x216b1c,null))['then'](removeEntity(_0x216b1c,null))['catch'](handleError(_0x216b1c,null));};exports[_0x1dea('0x45')]=function(_0x2c12c3,_0x5e4d70){return db[_0x1dea('0x26')][_0x1dea('0x45')]()['then'](respondWithResult(_0x5e4d70,null))[_0x1dea('0x3e')](handleError(_0x5e4d70,null));}; \ No newline at end of file +var _0x82cf=['rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','map','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','Cdr'];(function(_0x492145,_0x29e885){var _0x2f8f7f=function(_0x351dc1){while(--_0x351dc1){_0x492145['push'](_0x492145['shift']());}};_0x2f8f7f(++_0x29e885);}(_0x82cf,0xfb));var _0xf82c=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0x82cf[_0x3c5e54];return _0x3ae1f3;};'use strict';var pdf=require(_0xf82c('0x0'));var emlformat=require(_0xf82c('0x1'));var rimraf=require(_0xf82c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf82c('0x3'));var rp=require(_0xf82c('0x4'));var moment=require(_0xf82c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf82c('0x6'));var util=require(_0xf82c('0x7'));var path=require(_0xf82c('0x8'));var sox=require(_0xf82c('0x9'));var csv=require(_0xf82c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf82c('0xb'));var squel=require(_0xf82c('0xc'));var crypto=require(_0xf82c('0xd'));var jsforce=require(_0xf82c('0xe'));var deskjs=require(_0xf82c('0xf'));var toCsv=require(_0xf82c('0xa'));var querystring=require(_0xf82c('0x10'));var Papa=require(_0xf82c('0x11'));var authService=require(_0xf82c('0x12'));var hardwareService=require(_0xf82c('0x13'));var Redis=require(_0xf82c('0x14'));var qs=require(_0xf82c('0x15'));var logger=require(_0xf82c('0x16'))(_0xf82c('0x17'));var utils=require(_0xf82c('0x18'));var config=require(_0xf82c('0x19'));var db=require(_0xf82c('0x1a'))['db'];function respondWithStatusCode(_0x3074ff,_0x52b9c3){_0x52b9c3=_0x52b9c3||0xcc;return function(_0x4903cc){if(_0x4903cc){return _0x3074ff[_0xf82c('0x1b')](_0x52b9c3);}return _0x3074ff[_0xf82c('0x1c')](_0x52b9c3)[_0xf82c('0x1d')]();};}function respondWithResult(_0x1dcdfb,_0xf87bde){_0xf87bde=_0xf87bde||0xc8;return function(_0x43100f){if(_0x43100f){return _0x1dcdfb['status'](_0xf87bde)[_0xf82c('0x1e')](_0x43100f);}};}function respondWithFilteredResult(_0x53ed90,_0x5b7bc7){return function(_0x450c9e){if(_0x450c9e){var _0x50e513=_0x450c9e[_0xf82c('0x1f')],_0x372572=_0x5b7bc7['offset'],_0x58c617=_0x5b7bc7[_0xf82c('0x20')]+_0x5b7bc7[_0xf82c('0x21')],_0x54d14c;if(_0x58c617>=_0x50e513){_0x58c617=_0x50e513;_0x54d14c=0xc8;}else{_0x54d14c=0xce;}_0x53ed90[_0xf82c('0x1c')](_0x54d14c);return _0x53ed90['set'](_0xf82c('0x22'),_0x372572+'-'+_0x58c617+'/'+_0x50e513)[_0xf82c('0x1e')](_0x450c9e);}return null;};}function patchUpdates(_0x57f4de){return function(_0x24c9d8){try{jsonpatch[_0xf82c('0x23')](_0x24c9d8,_0x57f4de,!![]);}catch(_0x1c757e){return BPromise[_0xf82c('0x24')](_0x1c757e);}return _0x24c9d8[_0xf82c('0x25')]();};}function saveUpdates(_0x246cf2,_0x4dd7ce){return function(_0x708da9){if(_0x708da9){return _0x708da9['update'](_0x246cf2)[_0xf82c('0x26')](function(_0x16f3fb){return _0x16f3fb;});}return null;};}function removeEntity(_0x2634fc,_0x2b352b){return function(_0x44b09c){if(_0x44b09c){return _0x44b09c[_0xf82c('0x27')]()[_0xf82c('0x26')](function(){_0x2634fc[_0xf82c('0x1c')](0xcc)[_0xf82c('0x1d')]();});}};}function handleEntityNotFound(_0x4d8de5,_0x2a2cd8){return function(_0x2f074e){if(!_0x2f074e){_0x4d8de5[_0xf82c('0x1b')](0x194);}return _0x2f074e;};}function handleError(_0x4c5661,_0x28ade4){_0x28ade4=_0x28ade4||0x1f4;return function(_0x17f024){logger[_0xf82c('0x28')](_0x17f024[_0xf82c('0x29')]);if(_0x17f024[_0xf82c('0x2a')]){delete _0x17f024[_0xf82c('0x2a')];}_0x4c5661[_0xf82c('0x1c')](_0x28ade4)[_0xf82c('0x2b')](_0x17f024);};}exports['index']=function(_0x2f1b4b,_0x18483e){var _0x56fa08={},_0x4049fe={},_0x2a9e61={'count':0x0,'rows':[]};var _0x3a1730=db[_0xf82c('0x2c')][_0xf82c('0x2d')];_0x4049fe[_0xf82c('0x2e')]=_[_0xf82c('0x2f')](_0x3a1730);_0x4049fe[_0xf82c('0x30')]=_[_0xf82c('0x2f')](_0x2f1b4b[_0xf82c('0x30')]);_0x4049fe[_0xf82c('0x31')]=_[_0xf82c('0x32')](_0x4049fe[_0xf82c('0x2e')],_0x4049fe[_0xf82c('0x30')]);_0x56fa08['attributes']=_[_0xf82c('0x32')](_0x4049fe[_0xf82c('0x2e')],qs[_0xf82c('0x33')](_0x2f1b4b['query']['fields']));_0x56fa08[_0xf82c('0x34')]=_0x56fa08[_0xf82c('0x34')][_0xf82c('0x35')]?_0x56fa08[_0xf82c('0x34')]:_0x4049fe['model'];if(!_0x2f1b4b[_0xf82c('0x30')][_0xf82c('0x36')](_0xf82c('0x37'))){_0x56fa08['limit']=qs[_0xf82c('0x21')](_0x2f1b4b[_0xf82c('0x30')][_0xf82c('0x21')]);_0x56fa08[_0xf82c('0x20')]=qs['offset'](_0x2f1b4b['query'][_0xf82c('0x20')]);}_0x56fa08['order']=qs[_0xf82c('0x38')](_0x2f1b4b[_0xf82c('0x30')][_0xf82c('0x38')]);_0x56fa08['where']=qs['filters'](_['pick'](_0x2f1b4b[_0xf82c('0x30')],_0x4049fe[_0xf82c('0x31')]));if(_0x2f1b4b[_0xf82c('0x30')][_0xf82c('0x39')]){_0x56fa08[_0xf82c('0x3a')]=_['merge'](_0x56fa08[_0xf82c('0x3a')],{'$or':_[_0xf82c('0x3b')](_0x3a1730,function(_0x57db09){if(_0x57db09['type'][_0xf82c('0x3c')]!==_0xf82c('0x3d')){var _0x13d651={};_0x13d651[_0x57db09[_0xf82c('0x3e')]]={'$like':'%'+_0x2f1b4b['query'][_0xf82c('0x39')]+'%'};return _0x13d651;}})});}_0x56fa08=_['merge']({},_0x56fa08,_0x2f1b4b[_0xf82c('0x3f')]);var _0x5ba61e={'where':_0x56fa08[_0xf82c('0x3a')]};return db[_0xf82c('0x2c')]['count'](_0x5ba61e)[_0xf82c('0x26')](function(_0x4eeab1){_0x2a9e61[_0xf82c('0x1f')]=_0x4eeab1;if(_0x2f1b4b[_0xf82c('0x30')][_0xf82c('0x40')]){_0x56fa08[_0xf82c('0x41')]=[{'all':!![]}];}return db[_0xf82c('0x2c')]['findAll'](_0x56fa08);})[_0xf82c('0x26')](function(_0x537c4a){_0x2a9e61[_0xf82c('0x42')]=_0x537c4a;return _0x2a9e61;})[_0xf82c('0x26')](respondWithFilteredResult(_0x18483e,_0x56fa08))[_0xf82c('0x43')](handleError(_0x18483e,null));};exports[_0xf82c('0x44')]=function(_0x5856a2,_0x3184a3){var _0x4b232b={'raw':!![],'where':{'id':_0x5856a2[_0xf82c('0x45')]['id']}},_0x12a864={};_0x12a864[_0xf82c('0x2e')]=_['keys'](db['Cdr'][_0xf82c('0x2d')]);_0x12a864[_0xf82c('0x30')]=_[_0xf82c('0x2f')](_0x5856a2[_0xf82c('0x30')]);_0x12a864[_0xf82c('0x31')]=_['intersection'](_0x12a864[_0xf82c('0x2e')],_0x12a864[_0xf82c('0x30')]);_0x4b232b[_0xf82c('0x34')]=_['intersection'](_0x12a864['model'],qs[_0xf82c('0x33')](_0x5856a2[_0xf82c('0x30')][_0xf82c('0x33')]));_0x4b232b[_0xf82c('0x34')]=_0x4b232b['attributes'][_0xf82c('0x35')]?_0x4b232b[_0xf82c('0x34')]:_0x12a864[_0xf82c('0x2e')];if(_0x5856a2[_0xf82c('0x30')][_0xf82c('0x40')]){_0x4b232b[_0xf82c('0x41')]=[{'all':!![]}];}_0x4b232b=_['merge']({},_0x4b232b,_0x5856a2['options']);return db[_0xf82c('0x2c')][_0xf82c('0x46')](_0x4b232b)[_0xf82c('0x26')](handleEntityNotFound(_0x3184a3,null))[_0xf82c('0x26')](respondWithResult(_0x3184a3,null))[_0xf82c('0x43')](handleError(_0x3184a3,null));};exports['create']=function(_0xa867c8,_0x272f36){return db[_0xf82c('0x2c')][_0xf82c('0x47')](_0xa867c8[_0xf82c('0x48')],{})[_0xf82c('0x26')](respondWithResult(_0x272f36,0xc9))[_0xf82c('0x43')](handleError(_0x272f36,null));};exports['update']=function(_0x233d1d,_0x101d4a){if(_0x233d1d[_0xf82c('0x48')]['id']){delete _0x233d1d[_0xf82c('0x48')]['id'];}return db['Cdr'][_0xf82c('0x46')]({'where':{'id':_0x233d1d['params']['id']}})['then'](handleEntityNotFound(_0x101d4a,null))[_0xf82c('0x26')](saveUpdates(_0x233d1d[_0xf82c('0x48')],null))[_0xf82c('0x26')](respondWithResult(_0x101d4a,null))['catch'](handleError(_0x101d4a,null));};exports[_0xf82c('0x27')]=function(_0x55162b,_0x427a5f){return db[_0xf82c('0x2c')][_0xf82c('0x46')]({'where':{'id':_0x55162b[_0xf82c('0x45')]['id']}})[_0xf82c('0x26')](handleEntityNotFound(_0x427a5f,null))['then'](removeEntity(_0x427a5f,null))[_0xf82c('0x43')](handleError(_0x427a5f,null));};exports['describe']=function(_0x4d2781,_0x1b315a){return db[_0xf82c('0x2c')][_0xf82c('0x49')]()[_0xf82c('0x26')](respondWithResult(_0x1b315a,null))['catch'](handleError(_0x1b315a,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index b064c78..657b0ed 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 _0x581d=['moment','bluebird','request-promise','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api'];(function(_0x443246,_0x199405){var _0xf91625=function(_0x6c01ff){while(--_0x6c01ff){_0x443246['push'](_0x443246['shift']());}};_0xf91625(++_0x199405);}(_0x581d,0x150));var _0xd581=function(_0x18dff6,_0x4f4358){_0x18dff6=_0x18dff6-0x0;var _0x1b150e=_0x581d[_0x18dff6];return _0x1b150e;};'use strict';var _=require(_0xd581('0x0'));var util=require(_0xd581('0x1'));var logger=require(_0xd581('0x2'))(_0xd581('0x3'));var moment=require(_0xd581('0x4'));var BPromise=require(_0xd581('0x5'));var rp=require(_0xd581('0x6'));var attributes=require('./cdr.attributes');module[_0xd581('0x7')]=function(_0x1cffeb,_0x2bc2b6){return _0x1cffeb[_0xd581('0x8')](_0xd581('0x9'),attributes,{'tableName':_0xd581('0xa'),'paranoid':![],'indexes':[{'name':_0xd581('0xb'),'fields':[_0xd581('0xb')]},{'name':_0xd581('0xc'),'fields':[_0xd581('0xc')]},{'name':_0xd581('0xd'),'fields':[_0xd581('0xd')]},{'name':_0xd581('0xe'),'fields':[_0xd581('0xe')]},{'name':_0xd581('0xf'),'fields':['src']},{'name':_0xd581('0x10'),'fields':[_0xd581('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x823e=['moment','bluebird','request-promise','./cdr.attributes','exports','cdr','accountcode','calldate','dst','src','uniqueid','../../config/logger','api'];(function(_0x4cfd59,_0x6152c8){var _0x2adb29=function(_0x514089){while(--_0x514089){_0x4cfd59['push'](_0x4cfd59['shift']());}};_0x2adb29(++_0x6152c8);}(_0x823e,0x1ec));var _0xe823=function(_0x3bc05c,_0x3310b6){_0x3bc05c=_0x3bc05c-0x0;var _0x1cf57b=_0x823e[_0x3bc05c];return _0x1cf57b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe823('0x0'))(_0xe823('0x1'));var moment=require(_0xe823('0x2'));var BPromise=require(_0xe823('0x3'));var rp=require(_0xe823('0x4'));var attributes=require(_0xe823('0x5'));module[_0xe823('0x6')]=function(_0x592fe1,_0xe070a7){return _0x592fe1['define']('Cdr',attributes,{'tableName':_0xe823('0x7'),'paranoid':![],'indexes':[{'name':_0xe823('0x8'),'fields':['accountcode']},{'name':'calldate','fields':[_0xe823('0x9')]},{'name':'disposition','fields':['disposition']},{'name':'dst','fields':[_0xe823('0xa')]},{'name':_0xe823('0xb'),'fields':[_0xe823('0xb')]},{'name':_0xe823('0xc'),'fields':[_0xe823('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 0527e7d..44a79fd 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 _0x0496=['error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0496,0x74));var _0x6049=function(_0x4a7497,_0x1831c5){_0x4a7497=_0x4a7497-0x0;var _0x41e3b7=_0x0496[_0x4a7497];return _0x41e3b7;};'use strict';var _=require(_0x6049('0x0'));var util=require(_0x6049('0x1'));var moment=require(_0x6049('0x2'));var BPromise=require('bluebird');var rs=require(_0x6049('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6049('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6049('0x5'));var jayson=require(_0x6049('0x6'));var client=jayson[_0x6049('0x7')][_0x6049('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8063cc,_0x34c2a1,_0x1733cf){return new BPromise(function(_0x265c6e,_0x563000){return client[_0x6049('0x9')](_0x8063cc,_0x1733cf)[_0x6049('0xa')](function(_0x30011b){logger['info'](_0x6049('0xb'),_0x34c2a1,'request\x20sent');logger[_0x6049('0xc')](_0x6049('0xd'),_0x34c2a1,_0x6049('0xe'),JSON[_0x6049('0xf')](_0x30011b));if(_0x30011b[_0x6049('0x10')]){if(_0x30011b[_0x6049('0x10')][_0x6049('0x11')]===0x1f4){logger[_0x6049('0x10')](_0x6049('0xb'),_0x34c2a1,_0x30011b[_0x6049('0x10')][_0x6049('0x12')]);return _0x563000(_0x30011b[_0x6049('0x10')]['message']);}logger['error']('Cdr,\x20%s,\x20%s',_0x34c2a1,_0x30011b['error'][_0x6049('0x12')]);return _0x265c6e(_0x30011b[_0x6049('0x10')][_0x6049('0x12')]);}else{logger[_0x6049('0x13')](_0x6049('0xb'),_0x34c2a1,_0x6049('0xe'));_0x265c6e(_0x30011b[_0x6049('0x14')][_0x6049('0x12')]);}})[_0x6049('0x15')](function(_0x480f72){logger[_0x6049('0x10')]('Cdr,\x20%s,\x20%s',_0x34c2a1,_0x480f72);_0x563000(_0x480f72);});});} \ No newline at end of file +var _0x5b15=['../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x2a2b81,_0x531aa8){var _0x3eb038=function(_0x4cea6a){while(--_0x4cea6a){_0x2a2b81['push'](_0x2a2b81['shift']());}};_0x3eb038(++_0x531aa8);}(_0x5b15,0x188));var _0x55b1=function(_0x10164f,_0x311742){_0x10164f=_0x10164f-0x0;var _0x4a2f3d=_0x5b15[_0x10164f];return _0x4a2f3d;};'use strict';var _=require(_0x55b1('0x0'));var util=require('util');var moment=require(_0x55b1('0x1'));var BPromise=require(_0x55b1('0x2'));var rs=require(_0x55b1('0x3'));var fs=require('fs');var Redis=require(_0x55b1('0x4'));var db=require(_0x55b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x55b1('0x6'));var config=require(_0x55b1('0x7'));var jayson=require(_0x55b1('0x8'));var client=jayson[_0x55b1('0x9')][_0x55b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x286782,_0x17d2f7,_0x10f654){return new BPromise(function(_0x110a40,_0x423a55){return client[_0x55b1('0xb')](_0x286782,_0x10f654)['then'](function(_0x2b27be){logger[_0x55b1('0xc')](_0x55b1('0xd'),_0x17d2f7,'request\x20sent');logger[_0x55b1('0xe')](_0x55b1('0xf'),_0x17d2f7,'request\x20sent',JSON[_0x55b1('0x10')](_0x2b27be));if(_0x2b27be[_0x55b1('0x11')]){if(_0x2b27be['error'][_0x55b1('0x12')]===0x1f4){logger['error'](_0x55b1('0xd'),_0x17d2f7,_0x2b27be[_0x55b1('0x11')][_0x55b1('0x13')]);return _0x423a55(_0x2b27be[_0x55b1('0x11')][_0x55b1('0x13')]);}logger[_0x55b1('0x11')](_0x55b1('0xd'),_0x17d2f7,_0x2b27be['error']['message']);return _0x110a40(_0x2b27be[_0x55b1('0x11')][_0x55b1('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x17d2f7,'request\x20sent');_0x110a40(_0x2b27be[_0x55b1('0x14')][_0x55b1('0x13')]);}})['catch'](function(_0x8ed36c){logger[_0x55b1('0x11')](_0x55b1('0xd'),_0x17d2f7,_0x8ed36c);_0x423a55(_0x8ed36c);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index fad7d17..2d6eb96 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 _0xb1bd=['index','describe','/:id','post','create','put','update','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated'];(function(_0x3a707a,_0x452135){var _0x5bd30c=function(_0x234e50){while(--_0x234e50){_0x3a707a['push'](_0x3a707a['shift']());}};_0x5bd30c(++_0x452135);}(_0xb1bd,0x105));var _0xdb1b=function(_0x269e52,_0x561faf){_0x269e52=_0x269e52-0x0;var _0x37094c=_0xb1bd[_0x269e52];return _0x37094c;};'use strict';var multer=require(_0xdb1b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdb1b('0x1'));var express=require('express');var router=express[_0xdb1b('0x2')]();var auth=require(_0xdb1b('0x3'));var interaction=require(_0xdb1b('0x4'));var config=require(_0xdb1b('0x5'));var controller=require(_0xdb1b('0x6'));router[_0xdb1b('0x7')]('/',auth[_0xdb1b('0x8')](),controller[_0xdb1b('0x9')]);router[_0xdb1b('0x7')]('/describe',auth[_0xdb1b('0x8')](),controller[_0xdb1b('0xa')]);router['get'](_0xdb1b('0xb'),auth[_0xdb1b('0x8')](),controller['show']);router[_0xdb1b('0xc')]('/',auth[_0xdb1b('0x8')](),controller[_0xdb1b('0xd')]);router[_0xdb1b('0xe')](_0xdb1b('0xb'),auth[_0xdb1b('0x8')](),controller[_0xdb1b('0xf')]);router[_0xdb1b('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdb1b('0x11')]=router; \ No newline at end of file +var _0x77ea=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x77ea,0x18c));var _0xa77e=function(_0x163e0f,_0x4136da){_0x163e0f=_0x163e0f-0x0;var _0x27411e=_0x77ea[_0x163e0f];return _0x27411e;};'use strict';var multer=require('multer');var util=require(_0xa77e('0x0'));var path=require(_0xa77e('0x1'));var timeout=require(_0xa77e('0x2'));var express=require(_0xa77e('0x3'));var router=express[_0xa77e('0x4')]();var auth=require(_0xa77e('0x5'));var interaction=require(_0xa77e('0x6'));var config=require(_0xa77e('0x7'));var controller=require(_0xa77e('0x8'));router[_0xa77e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa77e('0xa'),auth[_0xa77e('0xb')](),controller[_0xa77e('0xc')]);router[_0xa77e('0x9')](_0xa77e('0xd'),auth['isAuthenticated'](),controller[_0xa77e('0xe')]);router[_0xa77e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa77e('0x10')](_0xa77e('0xd'),auth[_0xa77e('0xb')](),controller[_0xa77e('0x11')]);router[_0xa77e('0x12')](_0xa77e('0xd'),auth[_0xa77e('0xb')](),controller[_0xa77e('0x13')]);module[_0xa77e('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 6600388..d161aee 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 _0x6c45=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x2cdea8,_0x43b365){var _0x5a1de2=function(_0x1f1b81){while(--_0x1f1b81){_0x2cdea8['push'](_0x2cdea8['shift']());}};_0x5a1de2(++_0x43b365);}(_0x6c45,0xb1));var _0x56c4=function(_0x754674,_0x1f4b15){_0x754674=_0x754674-0x0;var _0x1143a9=_0x6c45[_0x754674];return _0x1143a9;};'use strict';var Sequelize=require(_0x56c4('0x0'));module[_0x56c4('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x56c4('0x2')],'allowNull':![],'defaultValue':_0x56c4('0x3')},'appdata':{'type':Sequelize[_0x56c4('0x4')]()},'description':{'type':Sequelize[_0x56c4('0x2')]},'interval':{'type':Sequelize[_0x56c4('0x2')],'defaultValue':_0x56c4('0x5')}}; \ No newline at end of file +var _0x7fea=['noop','TEXT','STRING','*,*,*,*','exports'];(function(_0x5283a6,_0x5e9f81){var _0x3c0847=function(_0x31fff0){while(--_0x31fff0){_0x5283a6['push'](_0x5283a6['shift']());}};_0x3c0847(++_0x5e9f81);}(_0x7fea,0x149));var _0xa7fe=function(_0x217d8a,_0x18dca0){_0x217d8a=_0x217d8a-0x0;var _0xbfc7db=_0x7fea[_0x217d8a];return _0xbfc7db;};'use strict';var Sequelize=require('sequelize');module[_0xa7fe('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa7fe('0x1')},'appdata':{'type':Sequelize[_0xa7fe('0x2')]()},'description':{'type':Sequelize[_0xa7fe('0x3')]},'interval':{'type':Sequelize[_0xa7fe('0x3')],'defaultValue':_0xa7fe('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 94c873b..9db10ef 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 _0xc6fa=['rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','merge','options','ChatApplication','find','then','catch','body','html-pdf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','params','model','keys'];(function(_0x98e7d4,_0x4926a3){var _0x20ff14=function(_0x2e06f4){while(--_0x2e06f4){_0x98e7d4['push'](_0x98e7d4['shift']());}};_0x20ff14(++_0x4926a3);}(_0xc6fa,0x13b));var _0xac6f=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0xc6fa[_0x4fd109];return _0x30f0a6;};'use strict';var pdf=require(_0xac6f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xac6f('0x1'));var jsonpatch=require(_0xac6f('0x2'));var rp=require(_0xac6f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xac6f('0x4'));var util=require(_0xac6f('0x5'));var path=require(_0xac6f('0x6'));var sox=require(_0xac6f('0x7'));var csv=require(_0xac6f('0x8'));var ejs=require(_0xac6f('0x9'));var fs=require('fs');var _=require(_0xac6f('0xa'));var squel=require(_0xac6f('0xb'));var crypto=require(_0xac6f('0xc'));var jsforce=require(_0xac6f('0xd'));var deskjs=require(_0xac6f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xac6f('0xf'));var Papa=require(_0xac6f('0x10'));var authService=require(_0xac6f('0x11'));var hardwareService=require(_0xac6f('0x12'));var Redis=require(_0xac6f('0x13'));var qs=require(_0xac6f('0x14'));var logger=require(_0xac6f('0x15'))(_0xac6f('0x16'));var utils=require('../../config/utils');var config=require(_0xac6f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x545605,_0x25b8a4){_0x25b8a4=_0x25b8a4||0xcc;return function(_0x392ecd){if(_0x392ecd){return _0x545605[_0xac6f('0x18')](_0x25b8a4);}return _0x545605[_0xac6f('0x19')](_0x25b8a4)[_0xac6f('0x1a')]();};}function respondWithResult(_0xce68c0,_0x4c921b){_0x4c921b=_0x4c921b||0xc8;return function(_0x24515e){if(_0x24515e){return _0xce68c0[_0xac6f('0x19')](_0x4c921b)[_0xac6f('0x1b')](_0x24515e);}};}function respondWithFilteredResult(_0x5eec9c,_0x3150b4){return function(_0x1cae72){if(_0x1cae72){var _0x5b7e32=_0x1cae72[_0xac6f('0x1c')],_0x5d367f=_0x3150b4[_0xac6f('0x1d')],_0x5a8f3e=_0x3150b4['offset']+_0x3150b4[_0xac6f('0x1e')],_0x4f6067;if(_0x5a8f3e>=_0x5b7e32){_0x5a8f3e=_0x5b7e32;_0x4f6067=0xc8;}else{_0x4f6067=0xce;}_0x5eec9c['status'](_0x4f6067);return _0x5eec9c[_0xac6f('0x1f')](_0xac6f('0x20'),_0x5d367f+'-'+_0x5a8f3e+'/'+_0x5b7e32)[_0xac6f('0x1b')](_0x1cae72);}return null;};}function patchUpdates(_0x143760){return function(_0x17b89a){try{jsonpatch[_0xac6f('0x21')](_0x17b89a,_0x143760,!![]);}catch(_0x3fc3f3){return BPromise[_0xac6f('0x22')](_0x3fc3f3);}return _0x17b89a[_0xac6f('0x23')]();};}function saveUpdates(_0x20a2b6,_0x58ce35){return function(_0x14e74d){if(_0x14e74d){return _0x14e74d[_0xac6f('0x24')](_0x20a2b6)['then'](function(_0x534df4){return _0x534df4;});}return null;};}function removeEntity(_0x31085a,_0x428afa){return function(_0xe19b6c){if(_0xe19b6c){return _0xe19b6c[_0xac6f('0x25')]()['then'](function(){_0x31085a[_0xac6f('0x19')](0xcc)[_0xac6f('0x1a')]();});}};}function handleEntityNotFound(_0x43d548,_0x27f307){return function(_0x2cf8a0){if(!_0x2cf8a0){_0x43d548[_0xac6f('0x18')](0x194);}return _0x2cf8a0;};}function handleError(_0x244104,_0x8aa3dc){_0x8aa3dc=_0x8aa3dc||0x1f4;return function(_0x3f1c7f){logger[_0xac6f('0x26')](_0x3f1c7f[_0xac6f('0x27')]);if(_0x3f1c7f['name']){delete _0x3f1c7f[_0xac6f('0x28')];}_0x244104[_0xac6f('0x19')](_0x8aa3dc)[_0xac6f('0x29')](_0x3f1c7f);};}exports['show']=function(_0x4da63f,_0x6ed0ea){var _0x3a8ba0={'raw':!![],'where':{'id':_0x4da63f[_0xac6f('0x2a')]['id']}},_0x419070={};_0x419070[_0xac6f('0x2b')]=_[_0xac6f('0x2c')](db['ChatApplication'][_0xac6f('0x2d')]);_0x419070['query']=_['keys'](_0x4da63f[_0xac6f('0x2e')]);_0x419070[_0xac6f('0x2f')]=_['intersection'](_0x419070[_0xac6f('0x2b')],_0x419070[_0xac6f('0x2e')]);_0x3a8ba0[_0xac6f('0x30')]=_[_0xac6f('0x31')](_0x419070['model'],qs[_0xac6f('0x32')](_0x4da63f['query'][_0xac6f('0x32')]));_0x3a8ba0[_0xac6f('0x30')]=_0x3a8ba0[_0xac6f('0x30')]['length']?_0x3a8ba0['attributes']:_0x419070[_0xac6f('0x2b')];if(_0x4da63f[_0xac6f('0x2e')][_0xac6f('0x33')]){_0x3a8ba0[_0xac6f('0x34')]=[{'all':!![]}];}_0x3a8ba0=_[_0xac6f('0x35')]({},_0x3a8ba0,_0x4da63f[_0xac6f('0x36')]);return db[_0xac6f('0x37')][_0xac6f('0x38')](_0x3a8ba0)[_0xac6f('0x39')](handleEntityNotFound(_0x6ed0ea,null))[_0xac6f('0x39')](respondWithResult(_0x6ed0ea,null))[_0xac6f('0x3a')](handleError(_0x6ed0ea,null));};exports[_0xac6f('0x24')]=function(_0x8e3133,_0x23e93a){if(_0x8e3133[_0xac6f('0x3b')]['id']){delete _0x8e3133[_0xac6f('0x3b')]['id'];}return db[_0xac6f('0x37')][_0xac6f('0x38')]({'where':{'id':_0x8e3133[_0xac6f('0x2a')]['id']}})[_0xac6f('0x39')](handleEntityNotFound(_0x23e93a,null))['then'](saveUpdates(_0x8e3133[_0xac6f('0x3b')],null))[_0xac6f('0x39')](respondWithResult(_0x23e93a,null))['catch'](handleError(_0x23e93a,null));};exports[_0xac6f('0x25')]=function(_0xf9bdf2,_0x2297d2){return db['ChatApplication'][_0xac6f('0x38')]({'where':{'id':_0xf9bdf2['params']['id']}})[_0xac6f('0x39')](handleEntityNotFound(_0x2297d2,null))['then'](removeEntity(_0x2297d2,null))[_0xac6f('0x3a')](handleError(_0x2297d2,null));}; \ No newline at end of file +var _0x00a2=['attributes','fields','query','length','includeAll','include','merge','find','catch','update','body','params','html-pdf','eml-format','rimraf','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','save','then','destroy','sendStatus','error','stack','name','model','keys','ChatApplication','rawAttributes','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00a2,0xb1));var _0x200a=function(_0x1946de,_0x198468){_0x1946de=_0x1946de-0x0;var _0x144e21=_0x00a2[_0x1946de];return _0x144e21;};'use strict';var pdf=require(_0x200a('0x0'));var emlformat=require(_0x200a('0x1'));var rimraf=require(_0x200a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x200a('0x3'));var BPromise=require(_0x200a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x200a('0x5'));var sox=require(_0x200a('0x6'));var csv=require(_0x200a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x200a('0x8'));var squel=require(_0x200a('0x9'));var crypto=require(_0x200a('0xa'));var jsforce=require(_0x200a('0xb'));var deskjs=require(_0x200a('0xc'));var toCsv=require(_0x200a('0x7'));var querystring=require(_0x200a('0xd'));var Papa=require(_0x200a('0xe'));var authService=require(_0x200a('0xf'));var hardwareService=require(_0x200a('0x10'));var Redis=require(_0x200a('0x11'));var qs=require(_0x200a('0x12'));var logger=require(_0x200a('0x13'))(_0x200a('0x14'));var utils=require(_0x200a('0x15'));var config=require(_0x200a('0x16'));var db=require(_0x200a('0x17'))['db'];function respondWithStatusCode(_0x1775e2,_0x328a10){_0x328a10=_0x328a10||0xcc;return function(_0xc3f6f8){if(_0xc3f6f8){return _0x1775e2['sendStatus'](_0x328a10);}return _0x1775e2[_0x200a('0x18')](_0x328a10)[_0x200a('0x19')]();};}function respondWithResult(_0x5d40ef,_0x4ee277){_0x4ee277=_0x4ee277||0xc8;return function(_0x4eaede){if(_0x4eaede){return _0x5d40ef['status'](_0x4ee277)[_0x200a('0x1a')](_0x4eaede);}};}function respondWithFilteredResult(_0x5f242f,_0x5b0ad6){return function(_0x177188){if(_0x177188){var _0xed4671=_0x177188[_0x200a('0x1b')],_0x164a40=_0x5b0ad6[_0x200a('0x1c')],_0x491c5b=_0x5b0ad6[_0x200a('0x1c')]+_0x5b0ad6[_0x200a('0x1d')],_0x38de01;if(_0x491c5b>=_0xed4671){_0x491c5b=_0xed4671;_0x38de01=0xc8;}else{_0x38de01=0xce;}_0x5f242f['status'](_0x38de01);return _0x5f242f['set'](_0x200a('0x1e'),_0x164a40+'-'+_0x491c5b+'/'+_0xed4671)['json'](_0x177188);}return null;};}function patchUpdates(_0x3bf4f5){return function(_0x22d335){try{jsonpatch['apply'](_0x22d335,_0x3bf4f5,!![]);}catch(_0x3c6ed9){return BPromise['reject'](_0x3c6ed9);}return _0x22d335[_0x200a('0x1f')]();};}function saveUpdates(_0xc6b109,_0x5881bd){return function(_0x164eef){if(_0x164eef){return _0x164eef['update'](_0xc6b109)[_0x200a('0x20')](function(_0xf1e683){return _0xf1e683;});}return null;};}function removeEntity(_0x21dd59,_0x1421e3){return function(_0x196e03){if(_0x196e03){return _0x196e03[_0x200a('0x21')]()[_0x200a('0x20')](function(){_0x21dd59[_0x200a('0x18')](0xcc)[_0x200a('0x19')]();});}};}function handleEntityNotFound(_0x1e8d1,_0x3cc87f){return function(_0x7e91d7){if(!_0x7e91d7){_0x1e8d1[_0x200a('0x22')](0x194);}return _0x7e91d7;};}function handleError(_0x2974a9,_0x66f0ba){_0x66f0ba=_0x66f0ba||0x1f4;return function(_0x2b2fe0){logger[_0x200a('0x23')](_0x2b2fe0[_0x200a('0x24')]);if(_0x2b2fe0[_0x200a('0x25')]){delete _0x2b2fe0[_0x200a('0x25')];}_0x2974a9[_0x200a('0x18')](_0x66f0ba)['send'](_0x2b2fe0);};}exports['show']=function(_0x361b37,_0x152469){var _0x5d5de2={'raw':!![],'where':{'id':_0x361b37['params']['id']}},_0x419669={};_0x419669[_0x200a('0x26')]=_[_0x200a('0x27')](db[_0x200a('0x28')][_0x200a('0x29')]);_0x419669['query']=_['keys'](_0x361b37['query']);_0x419669[_0x200a('0x2a')]=_['intersection'](_0x419669[_0x200a('0x26')],_0x419669['query']);_0x5d5de2[_0x200a('0x2b')]=_['intersection'](_0x419669[_0x200a('0x26')],qs[_0x200a('0x2c')](_0x361b37[_0x200a('0x2d')][_0x200a('0x2c')]));_0x5d5de2[_0x200a('0x2b')]=_0x5d5de2[_0x200a('0x2b')][_0x200a('0x2e')]?_0x5d5de2[_0x200a('0x2b')]:_0x419669[_0x200a('0x26')];if(_0x361b37['query'][_0x200a('0x2f')]){_0x5d5de2[_0x200a('0x30')]=[{'all':!![]}];}_0x5d5de2=_[_0x200a('0x31')]({},_0x5d5de2,_0x361b37['options']);return db['ChatApplication'][_0x200a('0x32')](_0x5d5de2)['then'](handleEntityNotFound(_0x152469,null))['then'](respondWithResult(_0x152469,null))[_0x200a('0x33')](handleError(_0x152469,null));};exports[_0x200a('0x34')]=function(_0x24d774,_0x252b45){if(_0x24d774['body']['id']){delete _0x24d774[_0x200a('0x35')]['id'];}return db[_0x200a('0x28')][_0x200a('0x32')]({'where':{'id':_0x24d774[_0x200a('0x36')]['id']}})['then'](handleEntityNotFound(_0x252b45,null))[_0x200a('0x20')](saveUpdates(_0x24d774[_0x200a('0x35')],null))[_0x200a('0x20')](respondWithResult(_0x252b45,null))['catch'](handleError(_0x252b45,null));};exports['destroy']=function(_0x49316f,_0x154b8e){return db[_0x200a('0x28')]['find']({'where':{'id':_0x49316f[_0x200a('0x36')]['id']}})[_0x200a('0x20')](handleEntityNotFound(_0x154b8e,null))[_0x200a('0x20')](removeEntity(_0x154b8e,null))[_0x200a('0x33')](handleError(_0x154b8e,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 6a9cd60..eab35f4 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 _0x6462=['api','bluebird','request-promise','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','lodash','../../config/logger'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6462,0x134));var _0x2646=function(_0x34db76,_0x3a3e12){_0x34db76=_0x34db76-0x0;var _0x24dd85=_0x6462[_0x34db76];return _0x24dd85;};'use strict';var _=require(_0x2646('0x0'));var util=require('util');var logger=require(_0x2646('0x1'))(_0x2646('0x2'));var moment=require('moment');var BPromise=require(_0x2646('0x3'));var rp=require(_0x2646('0x4'));var attributes=require(_0x2646('0x5'));module[_0x2646('0x6')]=function(_0x11ac0a,_0x2c7d5e){return _0x11ac0a[_0x2646('0x7')](_0x2646('0x8'),attributes,{'tableName':_0x2646('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc6a=['exports','ChatApplication','chat_applications','lodash','util','../../config/logger','bluebird','./chatApplication.attributes'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xdc6a,0xbb));var _0xadc6=function(_0x5e4fda,_0x4f7a69){_0x5e4fda=_0x5e4fda-0x0;var _0x4de82d=_0xdc6a[_0x5e4fda];return _0x4de82d;};'use strict';var _=require(_0xadc6('0x0'));var util=require(_0xadc6('0x1'));var logger=require(_0xadc6('0x2'))('api');var moment=require('moment');var BPromise=require(_0xadc6('0x3'));var rp=require('request-promise');var attributes=require(_0xadc6('0x4'));module[_0xadc6('0x5')]=function(_0x16f8ba,_0x1d3de4){return _0x16f8ba['define'](_0xadc6('0x6'),attributes,{'tableName':_0xadc6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 72425f7..f8dd1ee 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 _0x0692=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ChatApplication,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0692,0x1ba));var _0x2069=function(_0x2cdf2b,_0x551650){_0x2cdf2b=_0x2cdf2b-0x0;var _0x1f94c4=_0x0692[_0x2cdf2b];return _0x1f94c4;};'use strict';var _=require(_0x2069('0x0'));var util=require(_0x2069('0x1'));var moment=require(_0x2069('0x2'));var BPromise=require('bluebird');var rs=require(_0x2069('0x3'));var fs=require('fs');var Redis=require(_0x2069('0x4'));var db=require(_0x2069('0x5'))['db'];var utils=require(_0x2069('0x6'));var logger=require(_0x2069('0x7'))(_0x2069('0x8'));var config=require(_0x2069('0x9'));var jayson=require(_0x2069('0xa'));var client=jayson['client'][_0x2069('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48da99,_0x802f4c,_0x74d46d){return new BPromise(function(_0x474891,_0x1b2466){return client['request'](_0x48da99,_0x74d46d)[_0x2069('0xc')](function(_0x40e88f){logger['info']('ChatApplication,\x20%s,\x20%s',_0x802f4c,_0x2069('0xd'));logger[_0x2069('0xe')](_0x2069('0xf'),_0x802f4c,_0x2069('0xd'),JSON[_0x2069('0x10')](_0x40e88f));if(_0x40e88f[_0x2069('0x11')]){if(_0x40e88f[_0x2069('0x11')][_0x2069('0x12')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x802f4c,_0x40e88f['error']['message']);return _0x1b2466(_0x40e88f[_0x2069('0x11')][_0x2069('0x13')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x802f4c,_0x40e88f[_0x2069('0x11')][_0x2069('0x13')]);return _0x474891(_0x40e88f[_0x2069('0x11')][_0x2069('0x13')]);}else{logger[_0x2069('0x14')](_0x2069('0x15'),_0x802f4c,_0x2069('0xd'));_0x474891(_0x40e88f[_0x2069('0x16')][_0x2069('0x13')]);}})[_0x2069('0x17')](function(_0x57f656){logger[_0x2069('0x11')](_0x2069('0x15'),_0x802f4c,_0x57f656);_0x1b2466(_0x57f656);});});} \ No newline at end of file +var _0x40d0=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch'];(function(_0x4a6e46,_0x452d7f){var _0x1ca975=function(_0x4d6b97){while(--_0x4d6b97){_0x4a6e46['push'](_0x4a6e46['shift']());}};_0x1ca975(++_0x452d7f);}(_0x40d0,0x190));var _0x040d=function(_0x56d87d,_0x341cf3){_0x56d87d=_0x56d87d-0x0;var _0x43caa5=_0x40d0[_0x56d87d];return _0x43caa5;};'use strict';var _=require(_0x040d('0x0'));var util=require('util');var moment=require(_0x040d('0x1'));var BPromise=require(_0x040d('0x2'));var rs=require(_0x040d('0x3'));var fs=require('fs');var Redis=require(_0x040d('0x4'));var db=require(_0x040d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x040d('0x6'))(_0x040d('0x7'));var config=require(_0x040d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x040d('0x9')][_0x040d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd85cd7,_0x1dc7cb,_0x36a806){return new BPromise(function(_0x4843f9,_0xe24524){return client['request'](_0xd85cd7,_0x36a806)[_0x040d('0xb')](function(_0xd492a1){logger['info'](_0x040d('0xc'),_0x1dc7cb,_0x040d('0xd'));logger[_0x040d('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x1dc7cb,_0x040d('0xd'),JSON['stringify'](_0xd492a1));if(_0xd492a1[_0x040d('0xf')]){if(_0xd492a1[_0x040d('0xf')]['code']===0x1f4){logger[_0x040d('0xf')]('ChatApplication,\x20%s,\x20%s',_0x1dc7cb,_0xd492a1['error'][_0x040d('0x10')]);return _0xe24524(_0xd492a1[_0x040d('0xf')][_0x040d('0x10')]);}logger['error'](_0x040d('0xc'),_0x1dc7cb,_0xd492a1[_0x040d('0xf')][_0x040d('0x10')]);return _0x4843f9(_0xd492a1[_0x040d('0xf')][_0x040d('0x10')]);}else{logger[_0x040d('0x11')]('ChatApplication,\x20%s,\x20%s',_0x1dc7cb,'request\x20sent');_0x4843f9(_0xd492a1[_0x040d('0x12')][_0x040d('0x10')]);}})[_0x040d('0x13')](function(_0x24c439){logger[_0x040d('0xf')](_0x040d('0xc'),_0x1dc7cb,_0x24c439);_0xe24524(_0x24c439);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index c2aabc8..367f037 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 _0x4e2f=['express','../../components/auth/service','./chatApplication.controller','get','/:id','isAuthenticated','put','update','destroy','util','path'];(function(_0x1d4ea0,_0x139055){var _0x35c4ba=function(_0x3b8f0c){while(--_0x3b8f0c){_0x1d4ea0['push'](_0x1d4ea0['shift']());}};_0x35c4ba(++_0x139055);}(_0x4e2f,0x148));var _0xf4e2=function(_0x3e9292,_0x15c6b0){_0x3e9292=_0x3e9292-0x0;var _0x36227b=_0x4e2f[_0x3e9292];return _0x36227b;};'use strict';var multer=require('multer');var util=require(_0xf4e2('0x0'));var path=require(_0xf4e2('0x1'));var timeout=require('connect-timeout');var express=require(_0xf4e2('0x2'));var router=express['Router']();var auth=require(_0xf4e2('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf4e2('0x4'));router[_0xf4e2('0x5')](_0xf4e2('0x6'),auth[_0xf4e2('0x7')](),controller['show']);router[_0xf4e2('0x8')]('/:id',auth[_0xf4e2('0x7')](),controller[_0xf4e2('0x9')]);router['delete'](_0xf4e2('0x6'),auth[_0xf4e2('0x7')](),controller[_0xf4e2('0xa')]);module['exports']=router; \ No newline at end of file +var _0x3fce=['update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0x3fce,0x170));var _0xe3fc=function(_0x39cbe4,_0x4a7958){_0x39cbe4=_0x39cbe4-0x0;var _0xe76ba7=_0x3fce[_0x39cbe4];return _0xe76ba7;};'use strict';var multer=require(_0xe3fc('0x0'));var util=require('util');var path=require(_0xe3fc('0x1'));var timeout=require(_0xe3fc('0x2'));var express=require('express');var router=express[_0xe3fc('0x3')]();var auth=require(_0xe3fc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe3fc('0x5'));var controller=require(_0xe3fc('0x6'));router[_0xe3fc('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['put']('/:id',auth[_0xe3fc('0x8')](),controller[_0xe3fc('0x9')]);router[_0xe3fc('0xa')]('/:id',auth[_0xe3fc('0x8')](),controller[_0xe3fc('0xb')]);module[_0xe3fc('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 6227a7c..c6b51f5 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 _0x193d=['BOOLEAN','sequelize','exports','STRING'];(function(_0x10386a,_0x39ef6f){var _0x485f8c=function(_0xf9a6c6){while(--_0xf9a6c6){_0x10386a['push'](_0x10386a['shift']());}};_0x485f8c(++_0x39ef6f);}(_0x193d,0x1c1));var _0xd193=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x193d[_0x2d364e];return _0x1b9312;};'use strict';var Sequelize=require(_0xd193('0x0'));module[_0xd193('0x1')]={'name':{'type':Sequelize[_0xd193('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd193('0x2')]},'write':{'type':Sequelize[_0xd193('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf82f=['BOOLEAN'];(function(_0x5d3cd4,_0x5d137f){var _0x337f23=function(_0x465ce5){while(--_0x465ce5){_0x5d3cd4['push'](_0x5d3cd4['shift']());}};_0x337f23(++_0x5d137f);}(_0xf82f,0xba));var _0xff82=function(_0x52493f,_0x54a5e6){_0x52493f=_0x52493f-0x0;var _0x4e96bd=_0xf82f[_0x52493f];return _0x4e96bd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xff82('0x0')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 1f2e864..1ae1752 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 _0x5bfd=['ChatGroup','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','show','params','length','find','create','body','describe','getUnread','user','toInteger','addMembers','omit','ids','findOne','User','order','where','pick','getMembers','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send'];(function(_0x5b9259,_0x198473){var _0x5bbf28=function(_0x392f8e){while(--_0x392f8e){_0x5b9259['push'](_0x5b9259['shift']());}};_0x5bbf28(++_0x198473);}(_0x5bfd,0x9c));var _0xd5bf=function(_0x397f8f,_0x28bbac){_0x397f8f=_0x397f8f-0x0;var _0x5c492b=_0x5bfd[_0x397f8f];return _0x5c492b;};'use strict';var pdf=require(_0xd5bf('0x0'));var emlformat=require(_0xd5bf('0x1'));var rimraf=require(_0xd5bf('0x2'));var zipdir=require(_0xd5bf('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd5bf('0x4'));var Mustache=require(_0xd5bf('0x5'));var util=require('util');var path=require(_0xd5bf('0x6'));var sox=require('sox');var csv=require(_0xd5bf('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd5bf('0x8'));var squel=require(_0xd5bf('0x9'));var crypto=require(_0xd5bf('0xa'));var jsforce=require(_0xd5bf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd5bf('0x7'));var querystring=require(_0xd5bf('0xc'));var Papa=require(_0xd5bf('0xd'));var authService=require(_0xd5bf('0xe'));var hardwareService=require(_0xd5bf('0xf'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xd5bf('0x10'))(_0xd5bf('0x11'));var utils=require(_0xd5bf('0x12'));var config=require(_0xd5bf('0x13'));var db=require('../../mysqldb')['db'];config[_0xd5bf('0x14')]=_['defaults'](config[_0xd5bf('0x14')],{'host':_0xd5bf('0x15'),'port':0x18eb});var socket=require(_0xd5bf('0x16'))(new Redis(config[_0xd5bf('0x14')]));require('./chatGroup.socket')[_0xd5bf('0x17')](socket);var jayson=require(_0xd5bf('0x18'));var client=jayson[_0xd5bf('0x19')][_0xd5bf('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x156f0b,_0x129793,_0x2c9fbc,_0x2b5ab6){return new BPromise(function(_0x144675,_0x295dfe){var _0x5589d9=_0x2b5ab6||client;return _0x5589d9[_0xd5bf('0x1b')](_0x156f0b,_0x2c9fbc)[_0xd5bf('0x1c')](function(_0x49eb2c){logger[_0xd5bf('0x1d')](_0xd5bf('0x1e'),_0x129793,_0xd5bf('0x1f'));logger[_0xd5bf('0x20')](_0xd5bf('0x21'),_0x129793,_0xd5bf('0x1f'),JSON[_0xd5bf('0x22')](_0x49eb2c));if(_0x49eb2c[_0xd5bf('0x23')]){if(_0x49eb2c['error'][_0xd5bf('0x24')]===0x1f4){logger[_0xd5bf('0x23')](_0xd5bf('0x1e'),_0x129793,_0x49eb2c[_0xd5bf('0x23')][_0xd5bf('0x25')]);return _0x295dfe(_0x49eb2c['error'][_0xd5bf('0x25')]);}logger[_0xd5bf('0x23')]('ChatGroup,\x20%s,\x20%s',_0x129793,_0x49eb2c['error']['message']);return _0x144675(_0x49eb2c[_0xd5bf('0x23')][_0xd5bf('0x25')]);}else{logger['info'](_0xd5bf('0x1e'),_0x129793,_0xd5bf('0x1f'));_0x144675(_0x49eb2c[_0xd5bf('0x26')][_0xd5bf('0x25')]);}})[_0xd5bf('0x27')](function(_0x3ebc44){logger['error']('ChatGroup,\x20%s,\x20%s',_0x129793,_0x3ebc44);_0x295dfe(_0x3ebc44);});});}function respondWithStatusCode(_0x2bedbb,_0x576f13){_0x576f13=_0x576f13||0xcc;return function(_0x4e5615){if(_0x4e5615){return _0x2bedbb[_0xd5bf('0x28')](_0x576f13);}return _0x2bedbb[_0xd5bf('0x29')](_0x576f13)[_0xd5bf('0x2a')]();};}function respondWithResult(_0x4432bc,_0x3a2c73){_0x3a2c73=_0x3a2c73||0xc8;return function(_0x4c5df0){if(_0x4c5df0){return _0x4432bc['status'](_0x3a2c73)[_0xd5bf('0x2b')](_0x4c5df0);}};}function respondWithFilteredResult(_0x164bd9,_0x4d8b36){return function(_0x2c7064){if(_0x2c7064){var _0x4c1270=_0x2c7064[_0xd5bf('0x2c')],_0x266647=_0x4d8b36[_0xd5bf('0x2d')],_0x4734bf=_0x4d8b36[_0xd5bf('0x2d')]+_0x4d8b36[_0xd5bf('0x2e')],_0x47f46a;if(_0x4734bf>=_0x4c1270){_0x4734bf=_0x4c1270;_0x47f46a=0xc8;}else{_0x47f46a=0xce;}_0x164bd9[_0xd5bf('0x29')](_0x47f46a);return _0x164bd9[_0xd5bf('0x2f')](_0xd5bf('0x30'),_0x266647+'-'+_0x4734bf+'/'+_0x4c1270)['json'](_0x2c7064);}return null;};}function patchUpdates(_0x34810b){return function(_0xccb06d){try{jsonpatch[_0xd5bf('0x31')](_0xccb06d,_0x34810b,!![]);}catch(_0x3d6bfa){return BPromise['reject'](_0x3d6bfa);}return _0xccb06d[_0xd5bf('0x32')]();};}function saveUpdates(_0x51586a,_0x1bfb90){return function(_0x3763ca){if(_0x3763ca){return _0x3763ca[_0xd5bf('0x33')](_0x51586a)[_0xd5bf('0x1c')](function(_0x576732){return _0x576732;});}return null;};}function removeEntity(_0x493f50,_0x259d89){return function(_0x3640f0){if(_0x3640f0){return _0x3640f0[_0xd5bf('0x34')]()['then'](function(){_0x493f50[_0xd5bf('0x29')](0xcc)[_0xd5bf('0x2a')]();});}};}function handleEntityNotFound(_0x52e115,_0x228bc5){return function(_0xfb8d31){if(!_0xfb8d31){_0x52e115[_0xd5bf('0x28')](0x194);}return _0xfb8d31;};}function handleError(_0x1cf41a,_0x2aafe3){_0x2aafe3=_0x2aafe3||0x1f4;return function(_0x3883e4){logger[_0xd5bf('0x23')](_0x3883e4[_0xd5bf('0x35')]);if(_0x3883e4[_0xd5bf('0x36')]){delete _0x3883e4['name'];}_0x1cf41a[_0xd5bf('0x29')](_0x2aafe3)[_0xd5bf('0x37')](_0x3883e4);};}exports['index']=function(_0x24aa67,_0x1f8e70){var _0x53b7a3={},_0x5548bc={},_0x136714={'count':0x0,'rows':[]};var _0x1ae43c=db[_0xd5bf('0x38')][_0xd5bf('0x39')];_0x5548bc['model']=_[_0xd5bf('0x3a')](_0x1ae43c);_0x5548bc[_0xd5bf('0x3b')]=_['keys'](_0x24aa67[_0xd5bf('0x3b')]);_0x5548bc[_0xd5bf('0x3c')]=_[_0xd5bf('0x3d')](_0x5548bc[_0xd5bf('0x3e')],_0x5548bc[_0xd5bf('0x3b')]);_0x53b7a3['attributes']=_['intersection'](_0x5548bc[_0xd5bf('0x3e')],qs[_0xd5bf('0x3f')](_0x24aa67['query'][_0xd5bf('0x3f')]));_0x53b7a3[_0xd5bf('0x40')]=_0x53b7a3['attributes']['length']?_0x53b7a3[_0xd5bf('0x40')]:_0x5548bc[_0xd5bf('0x3e')];if(!_0x24aa67['query'][_0xd5bf('0x41')](_0xd5bf('0x42'))){_0x53b7a3[_0xd5bf('0x2e')]=qs[_0xd5bf('0x2e')](_0x24aa67[_0xd5bf('0x3b')][_0xd5bf('0x2e')]);_0x53b7a3[_0xd5bf('0x2d')]=qs[_0xd5bf('0x2d')](_0x24aa67[_0xd5bf('0x3b')][_0xd5bf('0x2d')]);}_0x53b7a3['order']=qs[_0xd5bf('0x43')](_0x24aa67['query'][_0xd5bf('0x43')]);_0x53b7a3['where']=qs['filters'](_['pick'](_0x24aa67[_0xd5bf('0x3b')],_0x5548bc[_0xd5bf('0x3c')]));if(_0x24aa67[_0xd5bf('0x3b')]['filter']){_0x53b7a3['where']=_[_0xd5bf('0x44')](_0x53b7a3['where'],{'$or':_[_0xd5bf('0x45')](_0x1ae43c,function(_0x45552d){if(_0x45552d[_0xd5bf('0x46')][_0xd5bf('0x47')]!==_0xd5bf('0x48')){var _0xf4d5ae={};_0xf4d5ae[_0x45552d[_0xd5bf('0x49')]]={'$like':'%'+_0x24aa67[_0xd5bf('0x3b')][_0xd5bf('0x4a')]+'%'};return _0xf4d5ae;}})});}_0x53b7a3=_['merge']({},_0x53b7a3,_0x24aa67[_0xd5bf('0x4b')]);var _0x11ef36={'where':_0x53b7a3['where']};return db[_0xd5bf('0x38')][_0xd5bf('0x2c')](_0x11ef36)[_0xd5bf('0x1c')](function(_0x4b9738){_0x136714[_0xd5bf('0x2c')]=_0x4b9738;if(_0x24aa67['query'][_0xd5bf('0x4c')]){_0x53b7a3[_0xd5bf('0x4d')]=[{'all':!![]}];}return db['ChatGroup'][_0xd5bf('0x4e')](_0x53b7a3);})[_0xd5bf('0x1c')](function(_0x2e10fe){_0x136714['rows']=_0x2e10fe;return _0x136714;})[_0xd5bf('0x1c')](respondWithFilteredResult(_0x1f8e70,_0x53b7a3))[_0xd5bf('0x27')](handleError(_0x1f8e70,null));};exports[_0xd5bf('0x4f')]=function(_0x4846cf,_0x5f0f4b){var _0x545821={'raw':!![],'where':{'id':_0x4846cf[_0xd5bf('0x50')]['id']}},_0x48e9f1={};_0x48e9f1[_0xd5bf('0x3e')]=_[_0xd5bf('0x3a')](db['ChatGroup'][_0xd5bf('0x39')]);_0x48e9f1['query']=_['keys'](_0x4846cf[_0xd5bf('0x3b')]);_0x48e9f1[_0xd5bf('0x3c')]=_[_0xd5bf('0x3d')](_0x48e9f1['model'],_0x48e9f1[_0xd5bf('0x3b')]);_0x545821['attributes']=_[_0xd5bf('0x3d')](_0x48e9f1['model'],qs[_0xd5bf('0x3f')](_0x4846cf[_0xd5bf('0x3b')][_0xd5bf('0x3f')]));_0x545821[_0xd5bf('0x40')]=_0x545821['attributes'][_0xd5bf('0x51')]?_0x545821[_0xd5bf('0x40')]:_0x48e9f1[_0xd5bf('0x3e')];if(_0x4846cf['query'][_0xd5bf('0x4c')]){_0x545821[_0xd5bf('0x4d')]=[{'all':!![]}];}_0x545821=_[_0xd5bf('0x44')]({},_0x545821,_0x4846cf[_0xd5bf('0x4b')]);return db[_0xd5bf('0x38')][_0xd5bf('0x52')](_0x545821)[_0xd5bf('0x1c')](handleEntityNotFound(_0x5f0f4b,null))[_0xd5bf('0x1c')](respondWithResult(_0x5f0f4b,null))[_0xd5bf('0x27')](handleError(_0x5f0f4b,null));};exports[_0xd5bf('0x53')]=function(_0x1551f7,_0x836b79){return db[_0xd5bf('0x38')][_0xd5bf('0x53')](_0x1551f7[_0xd5bf('0x54')],{})[_0xd5bf('0x1c')](respondWithResult(_0x836b79,0xc9))['catch'](handleError(_0x836b79,null));};exports[_0xd5bf('0x33')]=function(_0x2f109c,_0x123462){if(_0x2f109c[_0xd5bf('0x54')]['id']){delete _0x2f109c['body']['id'];}return db[_0xd5bf('0x38')]['find']({'where':{'id':_0x2f109c[_0xd5bf('0x50')]['id']}})['then'](handleEntityNotFound(_0x123462,null))[_0xd5bf('0x1c')](saveUpdates(_0x2f109c['body'],null))[_0xd5bf('0x1c')](respondWithResult(_0x123462,null))[_0xd5bf('0x27')](handleError(_0x123462,null));};exports[_0xd5bf('0x34')]=function(_0x143da2,_0x455f7c){return db[_0xd5bf('0x38')][_0xd5bf('0x52')]({'where':{'id':_0x143da2[_0xd5bf('0x50')]['id']}})[_0xd5bf('0x1c')](handleEntityNotFound(_0x455f7c,null))['then'](removeEntity(_0x455f7c,null))[_0xd5bf('0x27')](handleError(_0x455f7c,null));};exports[_0xd5bf('0x55')]=function(_0x3addc6,_0x5b185a){return db[_0xd5bf('0x38')][_0xd5bf('0x55')]()['then'](respondWithResult(_0x5b185a,null))[_0xd5bf('0x27')](handleError(_0x5b185a,null));};exports[_0xd5bf('0x56')]=function(_0x149c6a,_0x2a9c93,_0x5a9865){return db['ChatInternalMessage'][_0xd5bf('0x2c')]({'where':{'ChatGroupId':_0x149c6a[_0xd5bf('0x50')]['id'],'ToId':_0x149c6a[_0xd5bf('0x57')]['id'],'read':![]}})['then'](function(_0x4d9465){return{'id':_[_0xd5bf('0x58')](_0x149c6a[_0xd5bf('0x50')]['id']),'count':_0x4d9465};})[_0xd5bf('0x1c')](respondWithResult(_0x2a9c93,null))[_0xd5bf('0x27')](handleError(_0x2a9c93,null));};exports[_0xd5bf('0x59')]=function(_0x503dea,_0x29125d,_0x2effdf){return db[_0xd5bf('0x38')][_0xd5bf('0x52')]({'where':{'id':_0x503dea['params']['id']}})[_0xd5bf('0x1c')](handleEntityNotFound(_0x29125d,null))[_0xd5bf('0x1c')](function(_0x5d2670){if(_0x5d2670){return _0x5d2670[_0xd5bf('0x59')](_0x503dea['body']['ids'],_[_0xd5bf('0x5a')](_0x503dea[_0xd5bf('0x54')],[_0xd5bf('0x5b'),'id'])||{});}})[_0xd5bf('0x1c')](respondWithResult(_0x29125d,null))['catch'](handleError(_0x29125d,null));};exports['getMembers']=function(_0x14c1cf,_0x4dbecf,_0x47a460){var _0x396612={};var _0xb32de5={};var _0x8b4a32;var _0x2521e0;return db['ChatGroup'][_0xd5bf('0x5c')]({'where':{'id':_0x14c1cf[_0xd5bf('0x50')]['id']}})['then'](handleEntityNotFound(_0x4dbecf,null))[_0xd5bf('0x1c')](function(_0x452154){if(_0x452154){_0x8b4a32=_0x452154;_0xb32de5[_0xd5bf('0x3e')]=_[_0xd5bf('0x3a')](db[_0xd5bf('0x5d')][_0xd5bf('0x39')]);_0xb32de5['query']=_[_0xd5bf('0x3a')](_0x14c1cf[_0xd5bf('0x3b')]);_0xb32de5[_0xd5bf('0x3c')]=_['intersection'](_0xb32de5[_0xd5bf('0x3e')],_0xb32de5[_0xd5bf('0x3b')]);_0x396612[_0xd5bf('0x40')]=_[_0xd5bf('0x3d')](_0xb32de5[_0xd5bf('0x3e')],qs[_0xd5bf('0x3f')](_0x14c1cf['query']['fields']));_0x396612['attributes']=_0x396612['attributes']['length']?_0x396612[_0xd5bf('0x40')]:_0xb32de5[_0xd5bf('0x3e')];_0x396612[_0xd5bf('0x5e')]=qs[_0xd5bf('0x43')](_0x14c1cf[_0xd5bf('0x3b')][_0xd5bf('0x43')]);_0x396612[_0xd5bf('0x5f')]=qs[_0xd5bf('0x3c')](_[_0xd5bf('0x60')](_0x14c1cf[_0xd5bf('0x3b')],_0xb32de5[_0xd5bf('0x3c')]));if(_0x14c1cf[_0xd5bf('0x3b')][_0xd5bf('0x4a')]){_0x396612[_0xd5bf('0x5f')]=_[_0xd5bf('0x44')](_0x396612[_0xd5bf('0x5f')],{'$or':_[_0xd5bf('0x45')](_0x396612[_0xd5bf('0x40')],function(_0x202438){var _0x8e4157={};_0x8e4157[_0x202438]={'$like':'%'+_0x14c1cf[_0xd5bf('0x3b')][_0xd5bf('0x4a')]+'%'};return _0x8e4157;})});}_0x396612=_[_0xd5bf('0x44')]({},_0x396612,_0x14c1cf['options']);return _0x8b4a32[_0xd5bf('0x61')](_0x396612);}})[_0xd5bf('0x1c')](function(_0x3eba81){if(_0x3eba81){_0x2521e0=_0x3eba81[_0xd5bf('0x51')];if(!_0x14c1cf['query'][_0xd5bf('0x41')](_0xd5bf('0x42'))){_0x396612['limit']=qs[_0xd5bf('0x2e')](_0x14c1cf['query'][_0xd5bf('0x2e')]);_0x396612[_0xd5bf('0x2d')]=qs['offset'](_0x14c1cf[_0xd5bf('0x3b')]['offset']);}return _0x8b4a32['getMembers'](_0x396612);}})[_0xd5bf('0x1c')](function(_0x5d4f99){if(_0x5d4f99){return _0x5d4f99?{'count':_0x2521e0,'rows':_0x5d4f99}:null;}})[_0xd5bf('0x1c')](respondWithResult(_0x4dbecf,null))['catch'](handleError(_0x4dbecf,null));};exports[_0xd5bf('0x62')]=function(_0x426429,_0xa5dba9,_0x3b84f3){var _0x3d7591;return db[_0xd5bf('0x38')][_0xd5bf('0x52')]({'where':{'id':_0x426429[_0xd5bf('0x50')]['id']}})[_0xd5bf('0x1c')](handleEntityNotFound(_0xa5dba9,null))[_0xd5bf('0x1c')](function(_0x11059e){if(_0x11059e){return _0x11059e[_0xd5bf('0x62')](_0x426429[_0xd5bf('0x3b')][_0xd5bf('0x5b')]);}})['then'](respondWithStatusCode(_0xa5dba9,null))[_0xd5bf('0x27')](handleError(_0xa5dba9,null));};exports[_0xd5bf('0x63')]=function(_0x1d5b87,_0x305d7c,_0x470e98){if(_0x1d5b87['body']['id']){delete _0x1d5b87[_0xd5bf('0x54')]['id'];}return db[_0xd5bf('0x38')][_0xd5bf('0x52')]({'where':{'id':_0x1d5b87[_0xd5bf('0x50')]['id']}})['then'](handleEntityNotFound(_0x305d7c,null))[_0xd5bf('0x1c')](function(_0x264d87){if(_0x264d87){_0x1d5b87['body'][_0xd5bf('0x64')]=_0x264d87['id'];return db[_0xd5bf('0x65')]['create'](_0x1d5b87[_0xd5bf('0x54')]);}})[_0xd5bf('0x1c')](respondWithResult(_0x305d7c,null))[_0xd5bf('0x27')](handleError(_0x305d7c,null));};exports['getMessages']=function(_0x3aae2a,_0x3fd1b4,_0x32a9b2){var _0x5d19cb={};var _0x529862={};var _0x36a39c;var _0x497577;return db[_0xd5bf('0x38')][_0xd5bf('0x5c')]({'where':{'id':_0x3aae2a[_0xd5bf('0x50')]['id']}})[_0xd5bf('0x1c')](handleEntityNotFound(_0x3fd1b4,null))[_0xd5bf('0x1c')](function(_0xdbd544){if(_0xdbd544){_0x36a39c=_0xdbd544;_0x529862['model']=_[_0xd5bf('0x3a')](db[_0xd5bf('0x65')]['rawAttributes']);_0x529862['query']=_[_0xd5bf('0x3a')](_0x3aae2a['query']);_0x529862[_0xd5bf('0x3c')]=_['intersection'](_0x529862['model'],_0x529862[_0xd5bf('0x3b')]);_0x5d19cb['attributes']=_[_0xd5bf('0x3d')](_0x529862[_0xd5bf('0x3e')],qs['fields'](_0x3aae2a['query'][_0xd5bf('0x3f')]));_0x5d19cb[_0xd5bf('0x40')]=_0x5d19cb[_0xd5bf('0x40')][_0xd5bf('0x51')]?_0x5d19cb[_0xd5bf('0x40')]:_0x529862['model'];_0x5d19cb[_0xd5bf('0x5e')]=qs[_0xd5bf('0x43')](_0x3aae2a[_0xd5bf('0x3b')][_0xd5bf('0x43')]);_0x5d19cb[_0xd5bf('0x5f')]=qs[_0xd5bf('0x3c')](_[_0xd5bf('0x60')](_0x3aae2a[_0xd5bf('0x3b')],_0x529862[_0xd5bf('0x3c')]));if(_0x3aae2a[_0xd5bf('0x3b')][_0xd5bf('0x4a')]){_0x5d19cb[_0xd5bf('0x5f')]=_[_0xd5bf('0x44')](_0x5d19cb[_0xd5bf('0x5f')],{'$or':_[_0xd5bf('0x45')](_0x5d19cb['attributes'],function(_0x5e3f03){var _0x5413e8={};_0x5413e8[_0x5e3f03]={'$like':'%'+_0x3aae2a[_0xd5bf('0x3b')][_0xd5bf('0x4a')]+'%'};return _0x5413e8;})});}if(_0x3aae2a[_0xd5bf('0x3b')][_0xd5bf('0x66')]){var _0x549846=_0x3aae2a['query'][_0xd5bf('0x66')][_0xd5bf('0x67')](',');var _0x20dd64={};_0x20dd64[_0x549846[0x0]]={'$gte':moment(_0x549846[0x1])['format'](_0xd5bf('0x68'))};_0x5d19cb[_0xd5bf('0x5f')]=_['merge'](_0x5d19cb[_0xd5bf('0x5f')],_0x20dd64);}_0x5d19cb=_[_0xd5bf('0x44')]({},_0x5d19cb,_0x3aae2a[_0xd5bf('0x4b')]);return _0x36a39c[_0xd5bf('0x69')](_0x5d19cb);}})[_0xd5bf('0x1c')](function(_0x41001b){if(_0x41001b){_0x497577=_0x41001b['length'];if(!_0x3aae2a[_0xd5bf('0x3b')][_0xd5bf('0x41')](_0xd5bf('0x42'))){_0x5d19cb[_0xd5bf('0x2e')]=qs[_0xd5bf('0x2e')](_0x3aae2a[_0xd5bf('0x3b')][_0xd5bf('0x2e')]);_0x5d19cb[_0xd5bf('0x2d')]=qs['offset'](_0x3aae2a[_0xd5bf('0x3b')]['offset']);}return _0x36a39c[_0xd5bf('0x69')](_0x5d19cb);}})[_0xd5bf('0x1c')](function(_0x7a12a4){if(_0x7a12a4){return _0x7a12a4?{'count':_0x497577,'rows':_0x7a12a4}:null;}})[_0xd5bf('0x1c')](respondWithResult(_0x3fd1b4,null))[_0xd5bf('0x27')](handleError(_0x3fd1b4,null));}; \ No newline at end of file +var _0x7932=['count','offset','Content-Range','apply','save','update','destroy','end','sendStatus','stack','name','index','ChatGroup','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','getMembers','nolimit','removeMembers','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','client','http','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','status','json'];(function(_0x41cf46,_0x28f112){var _0x5da203=function(_0x2207df){while(--_0x2207df){_0x41cf46['push'](_0x41cf46['shift']());}};_0x5da203(++_0x28f112);}(_0x7932,0x176));var _0x2793=function(_0x16301f,_0x127c0b){_0x16301f=_0x16301f-0x0;var _0x5c8689=_0x7932[_0x16301f];return _0x5c8689;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2793('0x0'));var rimraf=require(_0x2793('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2793('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2793('0x3'));var Mustache=require(_0x2793('0x4'));var util=require(_0x2793('0x5'));var path=require(_0x2793('0x6'));var sox=require(_0x2793('0x7'));var csv=require(_0x2793('0x8'));var ejs=require(_0x2793('0x9'));var fs=require('fs');var _=require(_0x2793('0xa'));var squel=require('squel');var crypto=require(_0x2793('0xb'));var jsforce=require(_0x2793('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2793('0x8'));var querystring=require('querystring');var Papa=require(_0x2793('0xd'));var authService=require(_0x2793('0xe'));var hardwareService=require(_0x2793('0xf'));var Redis=require(_0x2793('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x2793('0x11'))('api');var utils=require(_0x2793('0x12'));var config=require('../../config/environment');var db=require(_0x2793('0x13'))['db'];config[_0x2793('0x14')]=_[_0x2793('0x15')](config[_0x2793('0x14')],{'host':_0x2793('0x16'),'port':0x18eb});var socket=require(_0x2793('0x17'))(new Redis(config[_0x2793('0x14')]));require(_0x2793('0x18'))[_0x2793('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2793('0x1a')][_0x2793('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xc404ca,_0x51bafd,_0x3ba48a,_0x1c0ded){return new BPromise(function(_0x566745,_0x40f50b){var _0xfac308=_0x1c0ded||client;return _0xfac308['request'](_0xc404ca,_0x3ba48a)[_0x2793('0x1c')](function(_0xb2b3b1){logger[_0x2793('0x1d')]('ChatGroup,\x20%s,\x20%s',_0x51bafd,_0x2793('0x1e'));logger[_0x2793('0x1f')](_0x2793('0x20'),_0x51bafd,'request\x20sent',JSON[_0x2793('0x21')](_0xb2b3b1));if(_0xb2b3b1[_0x2793('0x22')]){if(_0xb2b3b1[_0x2793('0x22')][_0x2793('0x23')]===0x1f4){logger['error'](_0x2793('0x24'),_0x51bafd,_0xb2b3b1[_0x2793('0x22')][_0x2793('0x25')]);return _0x40f50b(_0xb2b3b1['error']['message']);}logger[_0x2793('0x22')](_0x2793('0x24'),_0x51bafd,_0xb2b3b1[_0x2793('0x22')][_0x2793('0x25')]);return _0x566745(_0xb2b3b1[_0x2793('0x22')][_0x2793('0x25')]);}else{logger[_0x2793('0x1d')]('ChatGroup,\x20%s,\x20%s',_0x51bafd,_0x2793('0x1e'));_0x566745(_0xb2b3b1[_0x2793('0x26')]['message']);}})[_0x2793('0x27')](function(_0x2a3756){logger[_0x2793('0x22')]('ChatGroup,\x20%s,\x20%s',_0x51bafd,_0x2a3756);_0x40f50b(_0x2a3756);});});}function respondWithStatusCode(_0x23052a,_0x504f86){_0x504f86=_0x504f86||0xcc;return function(_0x1388de){if(_0x1388de){return _0x23052a['sendStatus'](_0x504f86);}return _0x23052a[_0x2793('0x28')](_0x504f86)['end']();};}function respondWithResult(_0x4e6c6e,_0x5bd89a){_0x5bd89a=_0x5bd89a||0xc8;return function(_0x17d9df){if(_0x17d9df){return _0x4e6c6e['status'](_0x5bd89a)[_0x2793('0x29')](_0x17d9df);}};}function respondWithFilteredResult(_0x3f4acc,_0x135db1){return function(_0x313f9e){if(_0x313f9e){var _0x80bfe8=_0x313f9e[_0x2793('0x2a')],_0x2c651d=_0x135db1['offset'],_0x6f6d60=_0x135db1[_0x2793('0x2b')]+_0x135db1['limit'],_0x3ebfe1;if(_0x6f6d60>=_0x80bfe8){_0x6f6d60=_0x80bfe8;_0x3ebfe1=0xc8;}else{_0x3ebfe1=0xce;}_0x3f4acc[_0x2793('0x28')](_0x3ebfe1);return _0x3f4acc['set'](_0x2793('0x2c'),_0x2c651d+'-'+_0x6f6d60+'/'+_0x80bfe8)[_0x2793('0x29')](_0x313f9e);}return null;};}function patchUpdates(_0x5d3155){return function(_0x3469c2){try{jsonpatch[_0x2793('0x2d')](_0x3469c2,_0x5d3155,!![]);}catch(_0x47e2b6){return BPromise['reject'](_0x47e2b6);}return _0x3469c2[_0x2793('0x2e')]();};}function saveUpdates(_0x1a3f57,_0x4036c8){return function(_0x385095){if(_0x385095){return _0x385095[_0x2793('0x2f')](_0x1a3f57)['then'](function(_0x4fec95){return _0x4fec95;});}return null;};}function removeEntity(_0x5d597a,_0x2472eb){return function(_0xaef2da){if(_0xaef2da){return _0xaef2da[_0x2793('0x30')]()[_0x2793('0x1c')](function(){_0x5d597a[_0x2793('0x28')](0xcc)[_0x2793('0x31')]();});}};}function handleEntityNotFound(_0x22c64d,_0x5948aa){return function(_0x4fdd46){if(!_0x4fdd46){_0x22c64d[_0x2793('0x32')](0x194);}return _0x4fdd46;};}function handleError(_0x3b3923,_0x953040){_0x953040=_0x953040||0x1f4;return function(_0x161157){logger[_0x2793('0x22')](_0x161157[_0x2793('0x33')]);if(_0x161157[_0x2793('0x34')]){delete _0x161157['name'];}_0x3b3923[_0x2793('0x28')](_0x953040)['send'](_0x161157);};}exports[_0x2793('0x35')]=function(_0x2a5b46,_0x40b13d){var _0x14a34b={},_0x55d778={},_0x5804ba={'count':0x0,'rows':[]};var _0x4b3c9a=db[_0x2793('0x36')][_0x2793('0x37')];_0x55d778[_0x2793('0x38')]=_['keys'](_0x4b3c9a);_0x55d778[_0x2793('0x39')]=_[_0x2793('0x3a')](_0x2a5b46[_0x2793('0x39')]);_0x55d778[_0x2793('0x3b')]=_[_0x2793('0x3c')](_0x55d778[_0x2793('0x38')],_0x55d778[_0x2793('0x39')]);_0x14a34b['attributes']=_[_0x2793('0x3c')](_0x55d778['model'],qs['fields'](_0x2a5b46[_0x2793('0x39')][_0x2793('0x3d')]));_0x14a34b[_0x2793('0x3e')]=_0x14a34b[_0x2793('0x3e')][_0x2793('0x3f')]?_0x14a34b['attributes']:_0x55d778[_0x2793('0x38')];if(!_0x2a5b46[_0x2793('0x39')][_0x2793('0x40')]('nolimit')){_0x14a34b[_0x2793('0x41')]=qs['limit'](_0x2a5b46[_0x2793('0x39')]['limit']);_0x14a34b[_0x2793('0x2b')]=qs[_0x2793('0x2b')](_0x2a5b46[_0x2793('0x39')][_0x2793('0x2b')]);}_0x14a34b[_0x2793('0x42')]=qs['sort'](_0x2a5b46[_0x2793('0x39')][_0x2793('0x43')]);_0x14a34b[_0x2793('0x44')]=qs['filters'](_[_0x2793('0x45')](_0x2a5b46[_0x2793('0x39')],_0x55d778[_0x2793('0x3b')]));if(_0x2a5b46[_0x2793('0x39')][_0x2793('0x46')]){_0x14a34b[_0x2793('0x44')]=_[_0x2793('0x47')](_0x14a34b[_0x2793('0x44')],{'$or':_[_0x2793('0x48')](_0x4b3c9a,function(_0x543023){if(_0x543023[_0x2793('0x49')][_0x2793('0x4a')]!==_0x2793('0x4b')){var _0x57ee66={};_0x57ee66[_0x543023[_0x2793('0x4c')]]={'$like':'%'+_0x2a5b46[_0x2793('0x39')][_0x2793('0x46')]+'%'};return _0x57ee66;}})});}_0x14a34b=_[_0x2793('0x47')]({},_0x14a34b,_0x2a5b46[_0x2793('0x4d')]);var _0x588ded={'where':_0x14a34b[_0x2793('0x44')]};return db[_0x2793('0x36')][_0x2793('0x2a')](_0x588ded)[_0x2793('0x1c')](function(_0x4ec60b){_0x5804ba[_0x2793('0x2a')]=_0x4ec60b;if(_0x2a5b46['query'][_0x2793('0x4e')]){_0x14a34b[_0x2793('0x4f')]=[{'all':!![]}];}return db['ChatGroup'][_0x2793('0x50')](_0x14a34b);})[_0x2793('0x1c')](function(_0x18f9ae){_0x5804ba[_0x2793('0x51')]=_0x18f9ae;return _0x5804ba;})[_0x2793('0x1c')](respondWithFilteredResult(_0x40b13d,_0x14a34b))[_0x2793('0x27')](handleError(_0x40b13d,null));};exports[_0x2793('0x52')]=function(_0x27afcc,_0x2d4905){var _0x52d9dd={'raw':!![],'where':{'id':_0x27afcc[_0x2793('0x53')]['id']}},_0x57be8d={};_0x57be8d[_0x2793('0x38')]=_[_0x2793('0x3a')](db[_0x2793('0x36')][_0x2793('0x37')]);_0x57be8d[_0x2793('0x39')]=_[_0x2793('0x3a')](_0x27afcc[_0x2793('0x39')]);_0x57be8d[_0x2793('0x3b')]=_[_0x2793('0x3c')](_0x57be8d[_0x2793('0x38')],_0x57be8d[_0x2793('0x39')]);_0x52d9dd[_0x2793('0x3e')]=_[_0x2793('0x3c')](_0x57be8d[_0x2793('0x38')],qs[_0x2793('0x3d')](_0x27afcc[_0x2793('0x39')][_0x2793('0x3d')]));_0x52d9dd[_0x2793('0x3e')]=_0x52d9dd[_0x2793('0x3e')][_0x2793('0x3f')]?_0x52d9dd[_0x2793('0x3e')]:_0x57be8d[_0x2793('0x38')];if(_0x27afcc[_0x2793('0x39')][_0x2793('0x4e')]){_0x52d9dd[_0x2793('0x4f')]=[{'all':!![]}];}_0x52d9dd=_[_0x2793('0x47')]({},_0x52d9dd,_0x27afcc[_0x2793('0x4d')]);return db[_0x2793('0x36')][_0x2793('0x54')](_0x52d9dd)['then'](handleEntityNotFound(_0x2d4905,null))['then'](respondWithResult(_0x2d4905,null))[_0x2793('0x27')](handleError(_0x2d4905,null));};exports[_0x2793('0x55')]=function(_0xde13de,_0x211048){return db['ChatGroup'][_0x2793('0x55')](_0xde13de['body'],{})[_0x2793('0x1c')](respondWithResult(_0x211048,0xc9))[_0x2793('0x27')](handleError(_0x211048,null));};exports[_0x2793('0x2f')]=function(_0x403fbf,_0x75f1c8){if(_0x403fbf['body']['id']){delete _0x403fbf[_0x2793('0x56')]['id'];}return db['ChatGroup'][_0x2793('0x54')]({'where':{'id':_0x403fbf[_0x2793('0x53')]['id']}})['then'](handleEntityNotFound(_0x75f1c8,null))[_0x2793('0x1c')](saveUpdates(_0x403fbf[_0x2793('0x56')],null))[_0x2793('0x1c')](respondWithResult(_0x75f1c8,null))[_0x2793('0x27')](handleError(_0x75f1c8,null));};exports[_0x2793('0x30')]=function(_0x58f163,_0x35ff82){return db[_0x2793('0x36')]['find']({'where':{'id':_0x58f163[_0x2793('0x53')]['id']}})['then'](handleEntityNotFound(_0x35ff82,null))[_0x2793('0x1c')](removeEntity(_0x35ff82,null))[_0x2793('0x27')](handleError(_0x35ff82,null));};exports['describe']=function(_0x4efdc0,_0x441f1){return db['ChatGroup'][_0x2793('0x57')]()['then'](respondWithResult(_0x441f1,null))['catch'](handleError(_0x441f1,null));};exports[_0x2793('0x58')]=function(_0x1a3951,_0x411f0f,_0x22dee8){return db[_0x2793('0x59')][_0x2793('0x2a')]({'where':{'ChatGroupId':_0x1a3951['params']['id'],'ToId':_0x1a3951[_0x2793('0x5a')]['id'],'read':![]}})[_0x2793('0x1c')](function(_0x366cae){return{'id':_[_0x2793('0x5b')](_0x1a3951[_0x2793('0x53')]['id']),'count':_0x366cae};})[_0x2793('0x1c')](respondWithResult(_0x411f0f,null))[_0x2793('0x27')](handleError(_0x411f0f,null));};exports[_0x2793('0x5c')]=function(_0x57df15,_0x232aa8,_0x3bdbf3){return db[_0x2793('0x36')][_0x2793('0x54')]({'where':{'id':_0x57df15['params']['id']}})[_0x2793('0x1c')](handleEntityNotFound(_0x232aa8,null))[_0x2793('0x1c')](function(_0x4cb05a){if(_0x4cb05a){return _0x4cb05a[_0x2793('0x5c')](_0x57df15[_0x2793('0x56')][_0x2793('0x5d')],_[_0x2793('0x5e')](_0x57df15['body'],[_0x2793('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x232aa8,null))[_0x2793('0x27')](handleError(_0x232aa8,null));};exports['getMembers']=function(_0x10334e,_0x1b85bd,_0x3c3901){var _0x2430b1={};var _0x4d1762={};var _0x12abbf;var _0x1e4b17;return db[_0x2793('0x36')][_0x2793('0x5f')]({'where':{'id':_0x10334e[_0x2793('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b85bd,null))[_0x2793('0x1c')](function(_0x5c03f3){if(_0x5c03f3){_0x12abbf=_0x5c03f3;_0x4d1762[_0x2793('0x38')]=_[_0x2793('0x3a')](db['User'][_0x2793('0x37')]);_0x4d1762[_0x2793('0x39')]=_[_0x2793('0x3a')](_0x10334e[_0x2793('0x39')]);_0x4d1762[_0x2793('0x3b')]=_[_0x2793('0x3c')](_0x4d1762[_0x2793('0x38')],_0x4d1762[_0x2793('0x39')]);_0x2430b1[_0x2793('0x3e')]=_['intersection'](_0x4d1762['model'],qs[_0x2793('0x3d')](_0x10334e['query'][_0x2793('0x3d')]));_0x2430b1[_0x2793('0x3e')]=_0x2430b1[_0x2793('0x3e')]['length']?_0x2430b1['attributes']:_0x4d1762['model'];_0x2430b1[_0x2793('0x42')]=qs[_0x2793('0x43')](_0x10334e[_0x2793('0x39')]['sort']);_0x2430b1[_0x2793('0x44')]=qs[_0x2793('0x3b')](_[_0x2793('0x45')](_0x10334e[_0x2793('0x39')],_0x4d1762[_0x2793('0x3b')]));if(_0x10334e['query']['filter']){_0x2430b1[_0x2793('0x44')]=_[_0x2793('0x47')](_0x2430b1['where'],{'$or':_[_0x2793('0x48')](_0x2430b1['attributes'],function(_0x2dba5c){var _0x1b9df6={};_0x1b9df6[_0x2dba5c]={'$like':'%'+_0x10334e['query'][_0x2793('0x46')]+'%'};return _0x1b9df6;})});}_0x2430b1=_[_0x2793('0x47')]({},_0x2430b1,_0x10334e[_0x2793('0x4d')]);return _0x12abbf[_0x2793('0x60')](_0x2430b1);}})[_0x2793('0x1c')](function(_0xbfd82d){if(_0xbfd82d){_0x1e4b17=_0xbfd82d[_0x2793('0x3f')];if(!_0x10334e[_0x2793('0x39')][_0x2793('0x40')](_0x2793('0x61'))){_0x2430b1[_0x2793('0x41')]=qs[_0x2793('0x41')](_0x10334e[_0x2793('0x39')][_0x2793('0x41')]);_0x2430b1[_0x2793('0x2b')]=qs[_0x2793('0x2b')](_0x10334e['query'][_0x2793('0x2b')]);}return _0x12abbf[_0x2793('0x60')](_0x2430b1);}})[_0x2793('0x1c')](function(_0x32f54a){if(_0x32f54a){return _0x32f54a?{'count':_0x1e4b17,'rows':_0x32f54a}:null;}})[_0x2793('0x1c')](respondWithResult(_0x1b85bd,null))[_0x2793('0x27')](handleError(_0x1b85bd,null));};exports[_0x2793('0x62')]=function(_0x3722be,_0x4411aa,_0x26c530){var _0x26612f;return db[_0x2793('0x36')][_0x2793('0x54')]({'where':{'id':_0x3722be[_0x2793('0x53')]['id']}})['then'](handleEntityNotFound(_0x4411aa,null))[_0x2793('0x1c')](function(_0x4bca74){if(_0x4bca74){return _0x4bca74[_0x2793('0x62')](_0x3722be['query'][_0x2793('0x5d')]);}})[_0x2793('0x1c')](respondWithStatusCode(_0x4411aa,null))[_0x2793('0x27')](handleError(_0x4411aa,null));};exports['addMessage']=function(_0x1ea988,_0x1d363f,_0xc7cdcc){if(_0x1ea988['body']['id']){delete _0x1ea988[_0x2793('0x56')]['id'];}return db[_0x2793('0x36')][_0x2793('0x54')]({'where':{'id':_0x1ea988[_0x2793('0x53')]['id']}})[_0x2793('0x1c')](handleEntityNotFound(_0x1d363f,null))[_0x2793('0x1c')](function(_0x39df83){if(_0x39df83){_0x1ea988['body'][_0x2793('0x63')]=_0x39df83['id'];return db[_0x2793('0x59')]['create'](_0x1ea988[_0x2793('0x56')]);}})[_0x2793('0x1c')](respondWithResult(_0x1d363f,null))['catch'](handleError(_0x1d363f,null));};exports[_0x2793('0x64')]=function(_0x314e02,_0x46afc3,_0x4fc2cf){var _0xe8d6d5={};var _0x395bb5={};var _0x26d46d;var _0x38a0ea;return db[_0x2793('0x36')][_0x2793('0x5f')]({'where':{'id':_0x314e02[_0x2793('0x53')]['id']}})[_0x2793('0x1c')](handleEntityNotFound(_0x46afc3,null))['then'](function(_0x296bcd){if(_0x296bcd){_0x26d46d=_0x296bcd;_0x395bb5['model']=_[_0x2793('0x3a')](db['ChatInternalMessage'][_0x2793('0x37')]);_0x395bb5[_0x2793('0x39')]=_[_0x2793('0x3a')](_0x314e02[_0x2793('0x39')]);_0x395bb5[_0x2793('0x3b')]=_[_0x2793('0x3c')](_0x395bb5[_0x2793('0x38')],_0x395bb5[_0x2793('0x39')]);_0xe8d6d5[_0x2793('0x3e')]=_[_0x2793('0x3c')](_0x395bb5[_0x2793('0x38')],qs[_0x2793('0x3d')](_0x314e02[_0x2793('0x39')]['fields']));_0xe8d6d5[_0x2793('0x3e')]=_0xe8d6d5[_0x2793('0x3e')][_0x2793('0x3f')]?_0xe8d6d5[_0x2793('0x3e')]:_0x395bb5[_0x2793('0x38')];_0xe8d6d5[_0x2793('0x42')]=qs[_0x2793('0x43')](_0x314e02[_0x2793('0x39')][_0x2793('0x43')]);_0xe8d6d5['where']=qs[_0x2793('0x3b')](_[_0x2793('0x45')](_0x314e02[_0x2793('0x39')],_0x395bb5[_0x2793('0x3b')]));if(_0x314e02[_0x2793('0x39')][_0x2793('0x46')]){_0xe8d6d5[_0x2793('0x44')]=_[_0x2793('0x47')](_0xe8d6d5[_0x2793('0x44')],{'$or':_[_0x2793('0x48')](_0xe8d6d5[_0x2793('0x3e')],function(_0x889f2d){var _0x55c69e={};_0x55c69e[_0x889f2d]={'$like':'%'+_0x314e02[_0x2793('0x39')][_0x2793('0x46')]+'%'};return _0x55c69e;})});}if(_0x314e02['query'][_0x2793('0x65')]){var _0x112074=_0x314e02[_0x2793('0x39')][_0x2793('0x65')][_0x2793('0x66')](',');var _0xb93b36={};_0xb93b36[_0x112074[0x0]]={'$gte':moment(_0x112074[0x1])[_0x2793('0x67')]('YYYY-MM-DD\x20HH:mm:ss')};_0xe8d6d5[_0x2793('0x44')]=_[_0x2793('0x47')](_0xe8d6d5[_0x2793('0x44')],_0xb93b36);}_0xe8d6d5=_[_0x2793('0x47')]({},_0xe8d6d5,_0x314e02['options']);return _0x26d46d[_0x2793('0x64')](_0xe8d6d5);}})[_0x2793('0x1c')](function(_0x4ee2bb){if(_0x4ee2bb){_0x38a0ea=_0x4ee2bb[_0x2793('0x3f')];if(!_0x314e02['query'][_0x2793('0x40')](_0x2793('0x61'))){_0xe8d6d5[_0x2793('0x41')]=qs[_0x2793('0x41')](_0x314e02[_0x2793('0x39')][_0x2793('0x41')]);_0xe8d6d5[_0x2793('0x2b')]=qs[_0x2793('0x2b')](_0x314e02[_0x2793('0x39')]['offset']);}return _0x26d46d[_0x2793('0x64')](_0xe8d6d5);}})[_0x2793('0x1c')](function(_0x1afa46){if(_0x1afa46){return _0x1afa46?{'count':_0x38a0ea,'rows':_0x1afa46}:null;}})['then'](respondWithResult(_0x46afc3,null))[_0x2793('0x27')](handleError(_0x46afc3,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index a499e8e..272a01c 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 _0x0261=['remove','emit','hasOwnProperty','hook','../../mysqldb','ChatGroup','save','update'];(function(_0x4deb98,_0x29ebdd){var _0x2c5f93=function(_0x3bdb80){while(--_0x3bdb80){_0x4deb98['push'](_0x4deb98['shift']());}};_0x2c5f93(++_0x29ebdd);}(_0x0261,0x1d4));var _0x1026=function(_0x28d391,_0x1357b3){_0x28d391=_0x28d391-0x0;var _0x3c8bf0=_0x0261[_0x28d391];return _0x3c8bf0;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x1026('0x0'))['db'][_0x1026('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1026('0x2'),'afterUpdate':_0x1026('0x3'),'afterDestroy':_0x1026('0x4')};function emitEvent(_0x340cd4){return function(_0xf734b6,_0x205ec4,_0x1f3867){ChatGroupEvents['emit'](_0x340cd4+':'+_0xf734b6['id'],_0xf734b6);ChatGroupEvents[_0x1026('0x5')](_0x340cd4,_0xf734b6);_0x1f3867(null);};}for(var e in events){if(events[_0x1026('0x6')](e)){var event=events[e];ChatGroup[_0x1026('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x2c0a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x4949ff,_0x3fd488){var _0x5aaa30=function(_0x5dbdaa){while(--_0x5dbdaa){_0x4949ff['push'](_0x4949ff['shift']());}};_0x5aaa30(++_0x3fd488);}(_0x2c0a,0xf7));var _0xa2c0=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x2c0a[_0x46f1a6];return _0x38429a;};'use strict';var EventEmitter=require(_0xa2c0('0x0'));var ChatGroup=require(_0xa2c0('0x1'))['db'][_0xa2c0('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa2c0('0x3')](0x0);var events={'afterCreate':_0xa2c0('0x4'),'afterUpdate':_0xa2c0('0x5'),'afterDestroy':_0xa2c0('0x6')};function emitEvent(_0x48be82){return function(_0x509066,_0x40c05b,_0xc3fdd3){ChatGroupEvents[_0xa2c0('0x7')](_0x48be82+':'+_0x509066['id'],_0x509066);ChatGroupEvents[_0xa2c0('0x7')](_0x48be82,_0x509066);_0xc3fdd3(null);};}for(var e in events){if(events[_0xa2c0('0x8')](e)){var event=events[e];ChatGroup[_0xa2c0('0x9')](e,emitEvent(event));}}module[_0xa2c0('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index d9c25e5..e25abae 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 _0xb6a1=['define','ChatGroup','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4aa73f,_0x5ca115){var _0x3627f0=function(_0x310bdf){while(--_0x310bdf){_0x4aa73f['push'](_0x4aa73f['shift']());}};_0x3627f0(++_0x5ca115);}(_0xb6a1,0x14a));var _0x1b6a=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb6a1[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x1b6a('0x0'));var util=require(_0x1b6a('0x1'));var logger=require(_0x1b6a('0x2'))(_0x1b6a('0x3'));var moment=require('moment');var BPromise=require(_0x1b6a('0x4'));var rp=require(_0x1b6a('0x5'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x13e07c,_0x155315){return _0x13e07c[_0x1b6a('0x6')](_0x1b6a('0x7'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13f4=['exports','chat_groups','lodash','util','api','request-promise','./chatGroup.attributes'];(function(_0x1a859c,_0x2970d0){var _0x1cc69c=function(_0x72f1ac){while(--_0x72f1ac){_0x1a859c['push'](_0x1a859c['shift']());}};_0x1cc69c(++_0x2970d0);}(_0x13f4,0x16e));var _0x413f=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x13f4[_0x3cae69];return _0x3128eb;};'use strict';var _=require(_0x413f('0x0'));var util=require(_0x413f('0x1'));var logger=require('../../config/logger')(_0x413f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x413f('0x3'));var attributes=require(_0x413f('0x4'));module[_0x413f('0x5')]=function(_0x5e2101,_0x3e07bd){return _0x5e2101['define']('ChatGroup',attributes,{'tableName':_0x413f('0x6'),'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 3782eb6..c270170 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 _0x9c44=['http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x5a2557,_0x2ccf54){var _0x55fcdc=function(_0x4a4e7f){while(--_0x4a4e7f){_0x5a2557['push'](_0x5a2557['shift']());}};_0x55fcdc(++_0x2ccf54);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});config[_0x49c4('0x9')]=_[_0x49c4('0xa')](config[_0x49c4('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x49c4('0xb'))(new Redis(config[_0x49c4('0x9')]));require(_0x49c4('0xc'))[_0x49c4('0xd')](socket);function respondWithRpcPromise(_0x4c7d3a,_0x5ab4a3,_0x451ea6){return new BPromise(function(_0x313e73,_0x58cad7){return client[_0x49c4('0xe')](_0x4c7d3a,_0x451ea6)[_0x49c4('0xf')](function(_0x4adb3c){logger['info'](_0x49c4('0x10'),_0x5ab4a3,_0x49c4('0x11'));logger['debug'](_0x49c4('0x12'),_0x5ab4a3,_0x49c4('0x11'),JSON['stringify'](_0x4adb3c));if(_0x4adb3c[_0x49c4('0x13')]){if(_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x14')]===0x1f4){logger[_0x49c4('0x13')](_0x49c4('0x10'),_0x5ab4a3,_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x15')]);return _0x58cad7(_0x4adb3c[_0x49c4('0x13')]['message']);}logger[_0x49c4('0x13')](_0x49c4('0x10'),_0x5ab4a3,_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x15')]);return _0x313e73(_0x4adb3c[_0x49c4('0x13')]['message']);}else{logger[_0x49c4('0x16')](_0x49c4('0x10'),_0x5ab4a3,'request\x20sent');_0x313e73(_0x4adb3c['result'][_0x49c4('0x15')]);}})[_0x49c4('0x17')](function(_0x3addb2){logger['error'](_0x49c4('0x10'),_0x5ab4a3,_0x3addb2);_0x58cad7(_0x3addb2);});});} \ No newline at end of file +var _0x0c02=['socket.io-emitter','redis','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x20c0('0x0'));var moment=require(_0x20c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x20c0('0x2'));var fs=require('fs');var Redis=require(_0x20c0('0x3'));var db=require(_0x20c0('0x4'))['db'];var utils=require(_0x20c0('0x5'));var logger=require(_0x20c0('0x6'))(_0x20c0('0x7'));var config=require(_0x20c0('0x8'));var jayson=require(_0x20c0('0x9'));var client=jayson[_0x20c0('0xa')][_0x20c0('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x20c0('0xc'))(new Redis(config[_0x20c0('0xd')]));require(_0x20c0('0xe'))[_0x20c0('0xf')](socket);function respondWithRpcPromise(_0x348dab,_0xedd21d,_0x4d3caf){return new BPromise(function(_0x506a6c,_0x52eb0d){return client['request'](_0x348dab,_0x4d3caf)['then'](function(_0x2f82ed){logger[_0x20c0('0x10')](_0x20c0('0x11'),_0xedd21d,_0x20c0('0x12'));logger['debug'](_0x20c0('0x13'),_0xedd21d,'request\x20sent',JSON['stringify'](_0x2f82ed));if(_0x2f82ed[_0x20c0('0x14')]){if(_0x2f82ed[_0x20c0('0x14')][_0x20c0('0x15')]===0x1f4){logger[_0x20c0('0x14')](_0x20c0('0x11'),_0xedd21d,_0x2f82ed[_0x20c0('0x14')][_0x20c0('0x16')]);return _0x52eb0d(_0x2f82ed[_0x20c0('0x14')][_0x20c0('0x16')]);}logger['error'](_0x20c0('0x11'),_0xedd21d,_0x2f82ed[_0x20c0('0x14')][_0x20c0('0x16')]);return _0x506a6c(_0x2f82ed[_0x20c0('0x14')][_0x20c0('0x16')]);}else{logger[_0x20c0('0x10')]('ChatGroup,\x20%s,\x20%s',_0xedd21d,'request\x20sent');_0x506a6c(_0x2f82ed['result'][_0x20c0('0x16')]);}})[_0x20c0('0x17')](function(_0x2abd80){logger[_0x20c0('0x14')]('ChatGroup,\x20%s,\x20%s',_0xedd21d,_0x2abd80);_0x52eb0d(_0x2abd80);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index e5b1008..444b7b2 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 _0x01fe=['./chatGroup.events','remove','update','emit','register','length'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x01fe,0x102));var _0xe01f=function(_0x240e97,_0x10e5ad){_0x240e97=_0x240e97-0x0;var _0x2191f0=_0x01fe[_0x240e97];return _0x2191f0;};'use strict';var ChatGroupEvents=require(_0xe01f('0x0'));var events=['save',_0xe01f('0x1'),_0xe01f('0x2')];function createListener(_0x4a9e90,_0x577c82){return function(_0x15f6ba){_0x577c82[_0xe01f('0x3')](_0x4a9e90,_0x15f6ba);};}function removeListener(_0x9505fa,_0x92b885){return function(){ChatGroupEvents['removeListener'](_0x9505fa,_0x92b885);};}exports[_0xe01f('0x4')]=function(_0x574969){for(var _0x3effc4=0x0,_0x3b754f=events[_0xe01f('0x5')];_0x3effc4<_0x3b754f;_0x3effc4++){var _0x40376f=events[_0x3effc4];var _0x377881=createListener('chatGroup:'+_0x40376f,_0x574969);ChatGroupEvents['on'](_0x40376f,_0x377881);}}; \ No newline at end of file +var _0x4627=['remove','update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x39e78c,_0x94bbf1){var _0x46bf6f=function(_0x1478fa){while(--_0x1478fa){_0x39e78c['push'](_0x39e78c['shift']());}};_0x46bf6f(++_0x94bbf1);}(_0x4627,0x115));var _0x7462=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x4627[_0x46ae5a];return _0x434986;};'use strict';var ChatGroupEvents=require(_0x7462('0x0'));var events=[_0x7462('0x1'),_0x7462('0x2'),_0x7462('0x3')];function createListener(_0x25dae7,_0x2759ce){return function(_0xde73dc){_0x2759ce[_0x7462('0x4')](_0x25dae7,_0xde73dc);};}function removeListener(_0x3c7a10,_0x35004e){return function(){ChatGroupEvents[_0x7462('0x5')](_0x3c7a10,_0x35004e);};}exports[_0x7462('0x6')]=function(_0x363d98){for(var _0x54bd2e=0x0,_0x1a6616=events[_0x7462('0x7')];_0x54bd2e<_0x1a6616;_0x54bd2e++){var _0x2347af=events[_0x54bd2e];var _0x2159ed=createListener(_0x7462('0x8')+_0x2347af,_0x363d98);ChatGroupEvents['on'](_0x2347af,_0x2159ed);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 08127e1..2f2b040 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 _0xd1f2=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread','/:id/members','getMembers','post','create','addMembers','addMessage','put','update','delete','destroy','removeMembers','path'];(function(_0x4c38b9,_0x8ad5c9){var _0x436f16=function(_0x168ed7){while(--_0x168ed7){_0x4c38b9['push'](_0x4c38b9['shift']());}};_0x436f16(++_0x8ad5c9);}(_0xd1f2,0x10d));var _0x2d1f=function(_0x2da9d4,_0x171683){_0x2da9d4=_0x2da9d4-0x0;var _0xdd3e3a=_0xd1f2[_0x2da9d4];return _0xdd3e3a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2d1f('0x0'));var timeout=require(_0x2d1f('0x1'));var express=require(_0x2d1f('0x2'));var router=express[_0x2d1f('0x3')]();var auth=require(_0x2d1f('0x4'));var interaction=require(_0x2d1f('0x5'));var config=require(_0x2d1f('0x6'));var controller=require(_0x2d1f('0x7'));router['get']('/',auth[_0x2d1f('0x8')](),controller[_0x2d1f('0x9')]);router[_0x2d1f('0xa')](_0x2d1f('0xb'),auth['isAuthenticated'](),controller[_0x2d1f('0xc')]);router[_0x2d1f('0xa')](_0x2d1f('0xd'),auth[_0x2d1f('0x8')](),controller[_0x2d1f('0xe')]);router['get'](_0x2d1f('0xf'),auth['isAuthenticated'](),controller['getUnread']);router[_0x2d1f('0xa')](_0x2d1f('0x10'),auth[_0x2d1f('0x8')](),controller[_0x2d1f('0x11')]);router[_0x2d1f('0xa')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x2d1f('0x12')]('/',auth['isAuthenticated'](),controller[_0x2d1f('0x13')]);router['post'](_0x2d1f('0x10'),auth['isAuthenticated'](),controller[_0x2d1f('0x14')]);router[_0x2d1f('0x12')]('/:id/messages',auth[_0x2d1f('0x8')](),controller[_0x2d1f('0x15')]);router[_0x2d1f('0x16')](_0x2d1f('0xd'),auth['isAuthenticated'](),controller[_0x2d1f('0x17')]);router[_0x2d1f('0x18')](_0x2d1f('0xd'),auth[_0x2d1f('0x8')](),controller[_0x2d1f('0x19')]);router[_0x2d1f('0x18')](_0x2d1f('0x10'),auth[_0x2d1f('0x8')](),controller[_0x2d1f('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x09ad=['addMessage','update','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','post','/:id/members','addMembers'];(function(_0x24b92d,_0x213c1b){var _0x19312d=function(_0x310edd){while(--_0x310edd){_0x24b92d['push'](_0x24b92d['shift']());}};_0x19312d(++_0x213c1b);}(_0x09ad,0xa7));var _0xd09a=function(_0x52c532,_0x30891b){_0x52c532=_0x52c532-0x0;var _0xbc814f=_0x09ad[_0x52c532];return _0xbc814f;};'use strict';var multer=require(_0xd09a('0x0'));var util=require(_0xd09a('0x1'));var path=require(_0xd09a('0x2'));var timeout=require(_0xd09a('0x3'));var express=require(_0xd09a('0x4'));var router=express[_0xd09a('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd09a('0x6'));var config=require(_0xd09a('0x7'));var controller=require('./chatGroup.controller');router[_0xd09a('0x8')]('/',auth['isAuthenticated'](),controller[_0xd09a('0x9')]);router[_0xd09a('0x8')](_0xd09a('0xa'),auth[_0xd09a('0xb')](),controller[_0xd09a('0xc')]);router['get'](_0xd09a('0xd'),auth['isAuthenticated'](),controller[_0xd09a('0xe')]);router[_0xd09a('0x8')](_0xd09a('0xf'),auth['isAuthenticated'](),controller[_0xd09a('0x10')]);router[_0xd09a('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0xd09a('0x11')]);router[_0xd09a('0x8')](_0xd09a('0x12'),auth[_0xd09a('0xb')](),controller['getMessages']);router['post']('/',auth[_0xd09a('0xb')](),controller['create']);router[_0xd09a('0x13')](_0xd09a('0x14'),auth['isAuthenticated'](),controller[_0xd09a('0x15')]);router['post'](_0xd09a('0x12'),auth[_0xd09a('0xb')](),controller[_0xd09a('0x16')]);router['put']('/:id',auth[_0xd09a('0xb')](),controller[_0xd09a('0x17')]);router['delete'](_0xd09a('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xd09a('0x18')](_0xd09a('0x14'),auth[_0xd09a('0xb')](),controller[_0xd09a('0x19')]);module[_0xd09a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 09bb440..440d4af 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 _0xd8b0=['DATE','out','sequelize','exports','star','thumb','TEXT','STRING','long'];(function(_0x219dd8,_0x63dc62){var _0x2b19b5=function(_0x49dc63){while(--_0x49dc63){_0x219dd8['push'](_0x219dd8['shift']());}};_0x2b19b5(++_0x63dc62);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x0d8b('0x2'),_0x0d8b('0x3')),'defaultValue':_0x0d8b('0x2')},'ratingMessage':{'type':Sequelize[_0x0d8b('0x4')]},'pathTranscript':{'type':Sequelize[_0x0d8b('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d8b('0x5')]},'note':{'type':Sequelize[_0x0d8b('0x5')]},'browserName':{'type':Sequelize[_0x0d8b('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x0d8b('0x5')]},'osVersion':{'type':Sequelize[_0x0d8b('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x0d8b('0x5')]},'deviceType':{'type':Sequelize[_0x0d8b('0x5')]},'referer':{'type':Sequelize[_0x0d8b('0x5')]},'customerIp':{'type':Sequelize[_0x0d8b('0x5')]},'formData':{'type':Sequelize[_0x0d8b('0x4')](_0x0d8b('0x6'))},'read1stAt':{'type':Sequelize[_0x0d8b('0x7')]},'lastMsgAt':{'type':Sequelize[_0x0d8b('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0d8b('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf7b4=['TEXT','STRING','DATE','long','out','sequelize','INTEGER','ENUM','star'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0xf7b4,0x152));var _0x4f7b=function(_0x5445f5,_0x46fffb){_0x5445f5=_0x5445f5-0x0;var _0x20dcdf=_0xf7b4[_0x5445f5];return _0x20dcdf;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4f7b('0x1')]},'ratingType':{'type':Sequelize[_0x4f7b('0x2')]('star','thumb'),'defaultValue':_0x4f7b('0x3')},'ratingMessage':{'type':Sequelize[_0x4f7b('0x4')]},'pathTranscript':{'type':Sequelize[_0x4f7b('0x4')]},'mailTranscript':{'type':Sequelize[_0x4f7b('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4f7b('0x6')]},'disposition':{'type':Sequelize[_0x4f7b('0x5')]},'note':{'type':Sequelize[_0x4f7b('0x5')]},'browserName':{'type':Sequelize[_0x4f7b('0x5')]},'browserVersion':{'type':Sequelize[_0x4f7b('0x5')]},'osName':{'type':Sequelize[_0x4f7b('0x5')]},'osVersion':{'type':Sequelize[_0x4f7b('0x5')]},'deviceModel':{'type':Sequelize[_0x4f7b('0x5')]},'deviceVendor':{'type':Sequelize[_0x4f7b('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x4f7b('0x5')]},'customerIp':{'type':Sequelize[_0x4f7b('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x4f7b('0x7'))},'read1stAt':{'type':Sequelize[_0x4f7b('0x6')]},'lastMsgAt':{'type':Sequelize[_0x4f7b('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x4f7b('0x2')]('in',_0x4f7b('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f0caf81..0507387 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 _0xd6af=['ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','ChatInteraction','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','include','tag','push','Tag','Tags','distinct','read','ChatMessage','Messages','createdAt','includeAll','User','fullname','Owner','internal','ChatWebsite','direction','color','ThroughTags','findAll','rows','options','find','create','body','describe','customUpdate','params','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Sequelize','ValidationError','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','download','join','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','ChatWebsiteId','CmContact','ContactId','System','%s%d','Visitor','agentIdentifier','agent_alias','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','service','Smtp','host','port','secure','authentication','auth','user','pass','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','getMessages','rawAttributes','hasOwnProperty','ChatInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','addTags','omit','spread','emit','removeTags','unix','toString','server','interaction-%s.zip','firstName','Letter','1cm','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','
','','%s:\x20%s

','','existsSync','createWriteStream','toFile','interaction-','log','unlinkSync','html-pdf','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware'];(function(_0x55643e,_0x52ab1b){var _0xb4a620=function(_0x7bf452){while(--_0x7bf452){_0x55643e['push'](_0x55643e['shift']());}};_0xb4a620(++_0x52ab1b);}(_0xd6af,0xb3));var _0xfd6a=function(_0x3e2f3a,_0x327781){_0x3e2f3a=_0x3e2f3a-0x0;var _0x24fb46=_0xd6af[_0x3e2f3a];return _0x24fb46;};'use strict';var pdf=require(_0xfd6a('0x0'));var emlformat=require(_0xfd6a('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfd6a('0x2'));var rp=require('request-promise');var moment=require(_0xfd6a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfd6a('0x4'));var util=require('util');var path=require(_0xfd6a('0x5'));var sox=require(_0xfd6a('0x6'));var csv=require(_0xfd6a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfd6a('0x8'));var squel=require(_0xfd6a('0x9'));var crypto=require('crypto');var jsforce=require(_0xfd6a('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd6a('0xb'));var Papa=require(_0xfd6a('0xc'));var authService=require(_0xfd6a('0xd'));var hardwareService=require(_0xfd6a('0xe'));var Redis=require(_0xfd6a('0xf'));var qs=require(_0xfd6a('0x10'));var logger=require(_0xfd6a('0x11'))('api');var utils=require(_0xfd6a('0x12'));var config=require('../../config/environment');var db=require(_0xfd6a('0x13'))['db'];config[_0xfd6a('0x14')]=_['defaults'](config['redis'],{'host':_0xfd6a('0x15'),'port':0x18eb});var socket=require(_0xfd6a('0x16'))(new Redis(config[_0xfd6a('0x14')]));require(_0xfd6a('0x17'))['register'](socket);var jayson=require(_0xfd6a('0x18'));var client=jayson[_0xfd6a('0x19')][_0xfd6a('0x1a')]({'port':0x232b});var client9004=jayson[_0xfd6a('0x19')][_0xfd6a('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x3cf0bf,_0x921e90,_0x3a45f4,_0x34a21f){return new BPromise(function(_0x3f5a9f,_0x49b35e){var _0x35c38e=_0x34a21f||client;return _0x35c38e[_0xfd6a('0x1b')](_0x3cf0bf,_0x3a45f4)[_0xfd6a('0x1c')](function(_0x137978){logger[_0xfd6a('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x921e90,_0xfd6a('0x1e'));logger[_0xfd6a('0x1f')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x921e90,_0xfd6a('0x1e'),JSON[_0xfd6a('0x20')](_0x137978));if(_0x137978['error']){if(_0x137978['error']['code']===0x1f4){logger[_0xfd6a('0x21')](_0xfd6a('0x22'),_0x921e90,_0x137978[_0xfd6a('0x21')][_0xfd6a('0x23')]);return _0x49b35e(_0x137978[_0xfd6a('0x21')][_0xfd6a('0x23')]);}logger[_0xfd6a('0x21')](_0xfd6a('0x22'),_0x921e90,_0x137978[_0xfd6a('0x21')][_0xfd6a('0x23')]);return _0x3f5a9f(_0x137978[_0xfd6a('0x21')]['message']);}else{logger[_0xfd6a('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x921e90,'request\x20sent');_0x3f5a9f(_0x137978['result'][_0xfd6a('0x23')]);}})[_0xfd6a('0x24')](function(_0x20eb13){logger[_0xfd6a('0x21')](_0xfd6a('0x22'),_0x921e90,_0x20eb13);_0x49b35e(_0x20eb13);});});}function respondWithStatusCode(_0x1641fe,_0xa69532){_0xa69532=_0xa69532||0xcc;return function(_0x3d6f16){if(_0x3d6f16){return _0x1641fe[_0xfd6a('0x25')](_0xa69532);}return _0x1641fe[_0xfd6a('0x26')](_0xa69532)[_0xfd6a('0x27')]();};}function respondWithResult(_0x193f48,_0x5abf2c){_0x5abf2c=_0x5abf2c||0xc8;return function(_0x58156a){if(_0x58156a){return _0x193f48[_0xfd6a('0x26')](_0x5abf2c)['json'](_0x58156a);}};}function respondWithFilteredResult(_0x1fe125,_0x35677b){return function(_0x5df31f){if(_0x5df31f){var _0x511809=_0x5df31f[_0xfd6a('0x28')],_0x532c6b=_0x35677b[_0xfd6a('0x29')],_0x299bf5=_0x35677b[_0xfd6a('0x29')]+_0x35677b[_0xfd6a('0x2a')],_0x553855;if(_0x299bf5>=_0x511809){_0x299bf5=_0x511809;_0x553855=0xc8;}else{_0x553855=0xce;}_0x1fe125['status'](_0x553855);return _0x1fe125['set'](_0xfd6a('0x2b'),_0x532c6b+'-'+_0x299bf5+'/'+_0x511809)[_0xfd6a('0x2c')](_0x5df31f);}return null;};}function patchUpdates(_0x38c462){return function(_0x47f515){try{jsonpatch[_0xfd6a('0x2d')](_0x47f515,_0x38c462,!![]);}catch(_0x3b1f4a){return BPromise[_0xfd6a('0x2e')](_0x3b1f4a);}return _0x47f515[_0xfd6a('0x2f')]();};}function saveUpdates(_0x527ef5,_0x14d8f1){return function(_0xfdf64b){if(_0xfdf64b){return _0xfdf64b[_0xfd6a('0x30')](_0x527ef5)[_0xfd6a('0x1c')](function(_0x4d8273){return _0x4d8273;});}return null;};}function removeEntity(_0x1d0790,_0x47ae60){return function(_0x379d1e){if(_0x379d1e){return _0x379d1e[_0xfd6a('0x31')]()[_0xfd6a('0x1c')](function(){_0x1d0790['status'](0xcc)[_0xfd6a('0x27')]();});}};}function handleEntityNotFound(_0x31884e,_0x47734b){return function(_0x1170d9){if(!_0x1170d9){_0x31884e[_0xfd6a('0x25')](0x194);}return _0x1170d9;};}function handleError(_0x4e061e,_0x1b2644){_0x1b2644=_0x1b2644||0x1f4;return function(_0x5addd0){logger['error'](_0x5addd0[_0xfd6a('0x32')]);if(_0x5addd0[_0xfd6a('0x33')]){delete _0x5addd0[_0xfd6a('0x33')];}_0x4e061e['status'](_0x1b2644)[_0xfd6a('0x34')](_0x5addd0);};}exports[_0xfd6a('0x35')]=function(_0x108f1c,_0x2f8aeb){var _0x352560={},_0x4d2999={},_0x276309={'count':0x0,'rows':[]};var _0x278be3=db[_0xfd6a('0x36')]['rawAttributes'];_0x4d2999[_0xfd6a('0x37')]=_[_0xfd6a('0x38')](_0x278be3);_0x4d2999['query']=_[_0xfd6a('0x38')](_0x108f1c['query']);_0x4d2999[_0xfd6a('0x39')]=_[_0xfd6a('0x3a')](_0x4d2999[_0xfd6a('0x37')],_0x4d2999[_0xfd6a('0x3b')]);_0x352560['attributes']=_[_0xfd6a('0x3a')](_0x4d2999['model'],qs[_0xfd6a('0x3c')](_0x108f1c[_0xfd6a('0x3b')][_0xfd6a('0x3c')]));_0x352560['attributes']=_0x352560[_0xfd6a('0x3d')][_0xfd6a('0x3e')]?_0x352560[_0xfd6a('0x3d')]:_0x4d2999[_0xfd6a('0x37')];if(!_0x108f1c['query']['hasOwnProperty'](_0xfd6a('0x3f'))){_0x352560[_0xfd6a('0x2a')]=qs[_0xfd6a('0x2a')](_0x108f1c['query'][_0xfd6a('0x2a')]);_0x352560['offset']=qs[_0xfd6a('0x29')](_0x108f1c['query'][_0xfd6a('0x29')]);}_0x352560[_0xfd6a('0x40')]=qs[_0xfd6a('0x41')](_0x108f1c[_0xfd6a('0x3b')][_0xfd6a('0x41')]);_0x352560[_0xfd6a('0x42')]=qs['filters'](_[_0xfd6a('0x43')](_0x108f1c[_0xfd6a('0x3b')],_0x4d2999[_0xfd6a('0x39')]));if(_0x108f1c['query'][_0xfd6a('0x44')]){_0x352560['where']=_[_0xfd6a('0x45')](_0x352560[_0xfd6a('0x42')],{'$or':_[_0xfd6a('0x46')](_0x278be3,function(_0x5709c3){if(_0x5709c3['type'][_0xfd6a('0x47')]!==_0xfd6a('0x48')){var _0x499e5c={};_0x499e5c[_0x5709c3[_0xfd6a('0x49')]]={'$like':'%'+_0x108f1c[_0xfd6a('0x3b')]['filter']+'%'};return _0x499e5c;}})});}_0x352560=_[_0xfd6a('0x45')]({},_0x352560,_0x108f1c['options']);var _0x19a410={'where':_0x352560[_0xfd6a('0x42')]};_0x19a410[_0xfd6a('0x4a')]=[];if(_0x108f1c[_0xfd6a('0x3b')][_0xfd6a('0x4b')]){_0x19a410[_0xfd6a('0x4a')][_0xfd6a('0x4c')]({'model':db[_0xfd6a('0x4d')],'as':_0xfd6a('0x4e'),'attributes':['id'],'where':{'id':_0x108f1c[_0xfd6a('0x3b')][_0xfd6a('0x4b')]},'required':!![]});_0x19a410[_0xfd6a('0x4f')]=!![];}if(_0x108f1c['query'][_0xfd6a('0x50')]){_0x19a410[_0xfd6a('0x4a')][_0xfd6a('0x4c')]({'model':db[_0xfd6a('0x51')],'as':_0xfd6a('0x52'),'attributes':['id','direction',_0xfd6a('0x53'),_0xfd6a('0x50')],'where':{'direction':'in','read':_0x108f1c['query'][_0xfd6a('0x50')]||![]},'required':!![]});_0x19a410[_0xfd6a('0x4f')]=!![];}return db[_0xfd6a('0x36')][_0xfd6a('0x28')](_0x19a410)[_0xfd6a('0x1c')](function(_0xb954b8){_0x276309['count']=_0xb954b8;if(_0x108f1c[_0xfd6a('0x3b')][_0xfd6a('0x54')]){_0x352560[_0xfd6a('0x4a')]=[{'model':db[_0xfd6a('0x55')],'as':'Users','required':![],'attributes':['id',_0xfd6a('0x33'),_0xfd6a('0x56')]},{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xfd6a('0x57'),'attributes':['name',_0xfd6a('0x56'),_0xfd6a('0x58')],'required':![]},{'model':db[_0xfd6a('0x59')],'as':'Account','attributes':[_0xfd6a('0x33'),_0xfd6a('0x47')],'required':![]},{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0xfd6a('0x5a'),_0xfd6a('0x53'),_0xfd6a('0x50')],'where':{'direction':'in','read':_0x108f1c[_0xfd6a('0x3b')][_0xfd6a('0x50')]||![]},'required':_0x108f1c['query']['read']||![]},{'model':db[_0xfd6a('0x4d')],'as':_0xfd6a('0x4e'),'attributes':['id','name',_0xfd6a('0x5b')],'required':_0x108f1c['query'][_0xfd6a('0x4b')]?!![]:![]},{'model':db[_0xfd6a('0x4d')],'as':_0xfd6a('0x5c'),'attributes':['id',_0xfd6a('0x33'),'color'],'through':_0x108f1c[_0xfd6a('0x3b')][_0xfd6a('0x4b')]?{'attributes':[],'where':{'TagId':_0x108f1c[_0xfd6a('0x3b')]['tag']||undefined}}:{},'required':_0x108f1c[_0xfd6a('0x3b')]['tag']?!![]:![]}];}return db[_0xfd6a('0x36')][_0xfd6a('0x5d')](_0x352560);})['then'](function(_0xc17917){_0x276309[_0xfd6a('0x5e')]=_0xc17917;return _0x276309;})[_0xfd6a('0x1c')](respondWithFilteredResult(_0x2f8aeb,_0x352560))[_0xfd6a('0x24')](handleError(_0x2f8aeb,null));};exports['show']=function(_0x4ef41c,_0x15d19b){var _0x58a1ec={'raw':![],'where':{'id':_0x4ef41c['params']['id']}},_0x3c97a4={};_0x3c97a4[_0xfd6a('0x37')]=_[_0xfd6a('0x38')](db[_0xfd6a('0x36')]['rawAttributes']);_0x3c97a4['query']=_[_0xfd6a('0x38')](_0x4ef41c[_0xfd6a('0x3b')]);_0x3c97a4[_0xfd6a('0x39')]=_[_0xfd6a('0x3a')](_0x3c97a4[_0xfd6a('0x37')],_0x3c97a4[_0xfd6a('0x3b')]);_0x58a1ec[_0xfd6a('0x3d')]=_[_0xfd6a('0x3a')](_0x3c97a4[_0xfd6a('0x37')],qs[_0xfd6a('0x3c')](_0x4ef41c[_0xfd6a('0x3b')][_0xfd6a('0x3c')]));_0x58a1ec[_0xfd6a('0x3d')]=_0x58a1ec[_0xfd6a('0x3d')][_0xfd6a('0x3e')]?_0x58a1ec[_0xfd6a('0x3d')]:_0x3c97a4[_0xfd6a('0x37')];if(_0x4ef41c[_0xfd6a('0x3b')][_0xfd6a('0x54')]){_0x58a1ec[_0xfd6a('0x4a')]=[{'all':!![]}];}_0x58a1ec=_[_0xfd6a('0x45')]({},_0x58a1ec,_0x4ef41c[_0xfd6a('0x5f')]);return db[_0xfd6a('0x36')][_0xfd6a('0x60')](_0x58a1ec)[_0xfd6a('0x1c')](handleEntityNotFound(_0x15d19b,null))[_0xfd6a('0x1c')](respondWithResult(_0x15d19b,null))[_0xfd6a('0x24')](handleError(_0x15d19b,null));};exports[_0xfd6a('0x61')]=function(_0x2f384f,_0x5da291){return db[_0xfd6a('0x36')][_0xfd6a('0x61')](_0x2f384f[_0xfd6a('0x62')],{})['then'](respondWithResult(_0x5da291,0xc9))[_0xfd6a('0x24')](handleError(_0x5da291,null));};exports[_0xfd6a('0x30')]=function(_0x32e85d,_0x509ddc){if(_0x32e85d[_0xfd6a('0x62')]['id']){delete _0x32e85d[_0xfd6a('0x62')]['id'];}return db[_0xfd6a('0x36')][_0xfd6a('0x60')]({'where':{'id':_0x32e85d['params']['id']}})[_0xfd6a('0x1c')](handleEntityNotFound(_0x509ddc,null))[_0xfd6a('0x1c')](saveUpdates(_0x32e85d[_0xfd6a('0x62')],null))[_0xfd6a('0x1c')](respondWithResult(_0x509ddc,null))[_0xfd6a('0x24')](handleError(_0x509ddc,null));};exports['destroy']=function(_0x42d1c2,_0x55cdaa){return db[_0xfd6a('0x36')]['find']({'where':{'id':_0x42d1c2['params']['id']}})[_0xfd6a('0x1c')](handleEntityNotFound(_0x55cdaa,null))[_0xfd6a('0x1c')](removeEntity(_0x55cdaa,null))[_0xfd6a('0x24')](handleError(_0x55cdaa,null));};exports[_0xfd6a('0x63')]=function(_0x1614fc,_0x18d1fb){return db[_0xfd6a('0x36')][_0xfd6a('0x63')]()[_0xfd6a('0x1c')](respondWithResult(_0x18d1fb,null))[_0xfd6a('0x24')](handleError(_0x18d1fb,null));};exports[_0xfd6a('0x64')]=function(_0x55dbbb,_0x3e380e){if(_0x55dbbb[_0xfd6a('0x62')]['id']){delete _0x55dbbb[_0xfd6a('0x62')]['id'];}return db[_0xfd6a('0x36')][_0xfd6a('0x60')]({'where':{'id':_0x55dbbb[_0xfd6a('0x65')]['id']}})[_0xfd6a('0x1c')](handleEntityNotFound(_0x3e380e,null))[_0xfd6a('0x1c')](saveUpdates(_0x55dbbb[_0xfd6a('0x62')],null))[_0xfd6a('0x1c')](respondWithResult(_0x3e380e,null))[_0xfd6a('0x24')](handleError(_0x3e380e,null));};exports[_0xfd6a('0x66')]=function(_0x46475d,_0x3bab48,_0x2eb938){if(_0x46475d[_0xfd6a('0x62')]['id']){delete _0x46475d[_0xfd6a('0x62')]['id'];}return db[_0xfd6a('0x36')][_0xfd6a('0x60')]({'where':{'id':_0x46475d[_0xfd6a('0x65')]['id']}})['then'](function(_0x57b836){if(!_0x57b836){logger[_0xfd6a('0x21')](_0xfd6a('0x67'),_0xfd6a('0x66'),0x194,'entity\x20not\x20found');_0x3bab48[_0xfd6a('0x25')](0x194);}else{if(_0x57b836[_0xfd6a('0x68')]){throw new db[(_0xfd6a('0x69'))][(_0xfd6a('0x6a'))](_0xfd6a('0x6b'));}}return _0x57b836;})['then'](function(_0xc09db9){if(_0xc09db9){return _0xc09db9[_0xfd6a('0x30')]({'closed':_0x46475d[_0xfd6a('0x62')][_0xfd6a('0x6c')],'disposition':_0x46475d[_0xfd6a('0x62')]['disposition']})[_0xfd6a('0x1c')](function(_0x4bcd26){return _0x4bcd26;});}})[_0xfd6a('0x1c')](function(_0x13cd76){return respondWithRpcPromise(_0xfd6a('0x6d'),_0xfd6a('0x66'),_0x46475d[_0xfd6a('0x62')],client9004);})[_0xfd6a('0x1c')](respondWithResult(_0x3bab48,null))['catch'](handleError(_0x3bab48,null));};exports[_0xfd6a('0x6e')]=function(_0x3295e1,_0x2c5d9e,_0x20a7a0){_0x3295e1[_0xfd6a('0x62')][_0xfd6a('0x33')]=_0x3295e1[_0xfd6a('0x6f')][_0xfd6a('0x70')];_0x3295e1[_0xfd6a('0x62')][_0xfd6a('0x71')]=_0x3295e1[_0xfd6a('0x6f')][_0xfd6a('0x72')];_0x3295e1[_0xfd6a('0x62')]['type']=_0x3295e1['file'][_0xfd6a('0x73')];return db[_0xfd6a('0x74')][_0xfd6a('0x61')](_0x3295e1['body'])[_0xfd6a('0x1c')](respondWithResult(_0x2c5d9e,0xc9))[_0xfd6a('0x24')](handleError(_0x2c5d9e,null));};exports[_0xfd6a('0x75')]=function(_0x57921d,_0x5a604c,_0x50184b){return db['ChatInteraction'][_0xfd6a('0x76')]({'where':{'id':_0x57921d['params']['id']},'raw':!![]})[_0xfd6a('0x1c')](handleEntityNotFound(_0x5a604c,null))['then'](function(_0x115e37){if(_0x115e37){if(_0x115e37['closed']){return _0x5a604c['status'](0x193)[_0xfd6a('0x2c')]({'status':0x193,'message':_0xfd6a('0x77')});}return db[_0xfd6a('0x74')][_0xfd6a('0x76')]({'where':{'id':_0x57921d['query'][_0xfd6a('0x78')]},'raw':!![]})['then'](handleEntityNotFound(_0x5a604c,null));}})[_0xfd6a('0x1c')](function(_0x5ebaae){if(_0x5ebaae){return _0x5a604c[_0xfd6a('0x79')](path[_0xfd6a('0x7a')](config[_0xfd6a('0x7b')],_0xfd6a('0x7c'),_0x5ebaae[_0xfd6a('0x71')]));}})[_0xfd6a('0x24')](handleError(_0x5a604c,null));};exports[_0xfd6a('0x7d')]=function(_0x4c5269,_0x46d378){var _0x2614b2=null;var _0x5199f4=null;var _0x44d800=null;var _0x1fe23c=null;if(_0x4c5269[_0xfd6a('0x62')]['id']){delete _0x4c5269[_0xfd6a('0x62')]['id'];}if(_0x4c5269['body'][_0xfd6a('0x7e')]){_0x1fe23c=path[_0xfd6a('0x7a')](config[_0xfd6a('0x7b')],_0xfd6a('0x7f'),util[_0xfd6a('0x80')](_0xfd6a('0x81'),Date['now']()));_0x4c5269[_0xfd6a('0x62')]['pathTranscript']=_0x1fe23c;}return db['ChatInteraction'][_0xfd6a('0x60')]({'where':{'id':_0x4c5269['params']['id']},'include':[{'model':db[_0xfd6a('0x51')],'as':_0xfd6a('0x52'),'include':[{'model':db[_0xfd6a('0x55')],'as':_0xfd6a('0x55')}]}]})['then'](handleEntityNotFound(_0x46d378,null))['then'](saveUpdates(_0x4c5269[_0xfd6a('0x62')],null))['then'](function(_0x534f3c){if(_0x534f3c){_0x2614b2=_0x534f3c;return db['ChatWebsite'][_0xfd6a('0x60')]({'where':{'id':_0x2614b2[_0xfd6a('0x82')]}});}})[_0xfd6a('0x1c')](function(_0x292206){if(_0x292206){_0x44d800=_0x292206;return db[_0xfd6a('0x83')][_0xfd6a('0x60')]({'where':{'id':_0x2614b2[_0xfd6a('0x84')]}});}})[_0xfd6a('0x1c')](function(_0x446b0e){if(_0x446b0e){_0x5199f4=_0x446b0e;if(_0x1fe23c){var _0x237101=null;for(var _0x4ff6fb=0x1;_0x4ff6fb<_0x2614b2[_0xfd6a('0x52')]['length'];++_0x4ff6fb){_0x237101=_0x2614b2[_0xfd6a('0x52')][_0x4ff6fb];var _0x5c348d=_0x237101['UserId']?util[_0xfd6a('0x80')]('%s%d',_0x44d800['agentAlias'],_0x237101[_0xfd6a('0x68')]):_0xfd6a('0x85');var _0x3ae7cd=_0x4c5269['body']['customer']||util[_0xfd6a('0x80')](_0xfd6a('0x86'),_0xfd6a('0x87'),_0x237101[_0xfd6a('0x84')]);switch(_0x44d800[_0xfd6a('0x88')]){case'website_alias':_0x5c348d=_0x237101['UserId']?util[_0xfd6a('0x80')](_0xfd6a('0x86'),_0x44d800['agentAlias'],_0x237101[_0xfd6a('0x68')]):_0xfd6a('0x85');break;case _0xfd6a('0x89'):_0x5c348d=_0x237101[_0xfd6a('0x68')]?_0x237101[_0xfd6a('0x55')][_0xfd6a('0x8a')]||_0x237101[_0xfd6a('0x55')]['fullname']:'System';break;case _0xfd6a('0x8b'):_0x5c348d=_0x237101[_0xfd6a('0x68')]?_0x237101[_0xfd6a('0x55')]['fullname']:_0xfd6a('0x85');break;default:_0x5c348d=_0x237101[_0xfd6a('0x68')]?util[_0xfd6a('0x80')](_0xfd6a('0x86'),_0x44d800[_0xfd6a('0x8c')],_0x237101[_0xfd6a('0x68')]):_0xfd6a('0x85');}var _0x42099b=util[_0xfd6a('0x80')](_0xfd6a('0x8d'),moment(_0x237101['createdAt'])[_0xfd6a('0x80')](_0xfd6a('0x8e')),_0x237101['direction']==='in'?_0x3ae7cd:_0x5c348d,_0x237101[_0xfd6a('0x62')]);if(!_0x237101[_0xfd6a('0x8f')]){fs[_0xfd6a('0x90')](_0x1fe23c,_0x42099b);}}return db[_0xfd6a('0x91')][_0xfd6a('0x76')]({'where':{'service':!![]},'include':[{'model':db[_0xfd6a('0x92')],'as':'Smtp','raw':!![]}]});}}})[_0xfd6a('0x1c')](function(_0x23768b){if(_0x23768b&&_0x23768b['Smtp']&&_0x4c5269['body']){var _0x289307={'tls':{'rejectUnauthorized':![]}};if(_0x23768b['Smtp'][_0xfd6a('0x93')]){_0x289307[_0xfd6a('0x93')]=_0x23768b[_0xfd6a('0x94')]['service'];}else{_0x289307[_0xfd6a('0x95')]=_0x23768b['Smtp'][_0xfd6a('0x95')];_0x289307['port']=_0x23768b[_0xfd6a('0x94')][_0xfd6a('0x96')];_0x289307[_0xfd6a('0x97')]=_0x23768b[_0xfd6a('0x94')][_0xfd6a('0x97')];}if(_0x23768b['Smtp'][_0xfd6a('0x98')]){_0x289307[_0xfd6a('0x99')]={'user':_0x23768b[_0xfd6a('0x94')][_0xfd6a('0x9a')],'pass':_0x23768b[_0xfd6a('0x94')][_0xfd6a('0x9b')]};}return respondWithRpcPromise(_0xfd6a('0x9c'),_0xfd6a('0x9d'),{'account':_0x289307,'message':{'from':util[_0xfd6a('0x80')](_0xfd6a('0x9e'),_0x23768b['name'],_0x23768b['email']||_0x23768b[_0xfd6a('0x94')][_0xfd6a('0x9a')]),'to':_0x4c5269[_0xfd6a('0x62')][_0xfd6a('0x7e')],'subject':_0xfd6a('0x9f'),'text':util[_0xfd6a('0x80')](_0xfd6a('0xa0'),_0x4c5269[_0xfd6a('0x62')][_0xfd6a('0x7e')]),'attachments':[{'path':_0x1fe23c}]}})[_0xfd6a('0x1c')](function(){return _0x2614b2;})[_0xfd6a('0x24')](function(_0x37b7e0){console[_0xfd6a('0x21')](_0x37b7e0);});}else{return _0x2614b2;}})[_0xfd6a('0x1c')](respondWithStatusCode(_0x46d378,0xc8))[_0xfd6a('0x24')](handleError(_0x46d378,null));};exports[_0xfd6a('0xa1')]=function(_0x815db2,_0x3dcd9c,_0x1b801d){return db['ChatMessage']['find']({'where':{'id':_0x815db2['params']['id']}})['then'](handleEntityNotFound(_0x3dcd9c,null))[_0xfd6a('0x1c')](function(_0x9f7d87){if(_0x9f7d87){return _0x9f7d87[_0xfd6a('0xa1')](_0x815db2['body'][_0xfd6a('0xa2')],_['omit'](_0x815db2[_0xfd6a('0x62')],[_0xfd6a('0xa2'),'id'])||{});}})[_0xfd6a('0x1c')](respondWithResult(_0x3dcd9c,null))[_0xfd6a('0x24')](handleError(_0x3dcd9c,null));};exports[_0xfd6a('0xa3')]=function(_0x58388f,_0x36455d,_0x229cfe){var _0x4388d7={'raw':![],'where':{}};var _0x375c0d={};var _0x42a371={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfd6a('0x76')]({'where':{'id':_0x58388f[_0xfd6a('0x65')]['id']}})[_0xfd6a('0x1c')](handleEntityNotFound(_0x36455d,null))[_0xfd6a('0x1c')](function(_0x9bdd76){if(_0x9bdd76){_0x375c0d['model']=_['keys'](db[_0xfd6a('0x51')][_0xfd6a('0xa4')]);_0x375c0d[_0xfd6a('0x3b')]=_['keys'](_0x58388f['query']);_0x375c0d[_0xfd6a('0x39')]=_[_0xfd6a('0x3a')](_0x375c0d['model'],_0x375c0d[_0xfd6a('0x3b')]);_0x4388d7['attributes']=_[_0xfd6a('0x3a')](_0x375c0d[_0xfd6a('0x37')],qs[_0xfd6a('0x3c')](_0x58388f['query'][_0xfd6a('0x3c')]));_0x4388d7[_0xfd6a('0x3d')]=_0x4388d7['attributes']['length']?_0x4388d7['attributes']:_0x375c0d[_0xfd6a('0x37')];if(!_0x58388f[_0xfd6a('0x3b')][_0xfd6a('0xa5')](_0xfd6a('0x3f'))){_0x4388d7[_0xfd6a('0x2a')]=qs[_0xfd6a('0x2a')](_0x58388f[_0xfd6a('0x3b')][_0xfd6a('0x2a')]);_0x4388d7[_0xfd6a('0x29')]=qs['offset'](_0x58388f[_0xfd6a('0x3b')][_0xfd6a('0x29')]);}_0x4388d7['order']=qs[_0xfd6a('0x41')](_0x58388f[_0xfd6a('0x3b')][_0xfd6a('0x41')]);_0x4388d7[_0xfd6a('0x42')]=qs['filters'](_[_0xfd6a('0x43')](_0x58388f[_0xfd6a('0x3b')],_0x375c0d[_0xfd6a('0x39')]));_0x4388d7[_0xfd6a('0x42')][_0xfd6a('0xa6')]=_0x9bdd76['id'];if(_0x58388f[_0xfd6a('0x3b')][_0xfd6a('0x44')]){_0x4388d7[_0xfd6a('0x42')]=_[_0xfd6a('0x45')](_0x4388d7[_0xfd6a('0x42')],{'$or':_['map'](_0x4388d7[_0xfd6a('0x3d')],function(_0x35fd1f){var _0x36e40e={};_0x36e40e[_0x35fd1f]={'$like':'%'+_0x58388f[_0xfd6a('0x3b')][_0xfd6a('0x44')]+'%'};return _0x36e40e;})});}if(_0x58388f[_0xfd6a('0x3b')][_0xfd6a('0xa7')]){var _0x441cd0=_0x58388f['query'][_0xfd6a('0xa7')][_0xfd6a('0xa8')](',');var _0x398c77={};_0x398c77[_0x441cd0[0x0]]={'$gte':moment(_0x441cd0[0x1])[_0xfd6a('0x80')](_0xfd6a('0xa9'))};_0x4388d7[_0xfd6a('0x42')]=_[_0xfd6a('0x45')](_0x4388d7['where'],_0x398c77);}_0x4388d7=_[_0xfd6a('0x45')]({},_0x4388d7,_0x58388f['options']);return db[_0xfd6a('0x51')][_0xfd6a('0x28')]({'where':_0x4388d7[_0xfd6a('0x42')]})[_0xfd6a('0x1c')](function(_0x17e28e){_0x42a371['count']=_0x17e28e;if(_0x58388f[_0xfd6a('0x3b')][_0xfd6a('0x54')]){_0x4388d7[_0xfd6a('0x4a')]=[{'all':!![]}];}return db[_0xfd6a('0x51')]['findAll'](_0x4388d7);})['then'](function(_0x4cc8d7){_0x42a371['rows']=_0x4cc8d7;return _0x42a371;});}})['then'](respondWithFilteredResult(_0x36455d,_0x4388d7))[_0xfd6a('0x24')](handleError(_0x36455d,null));};exports['getMyMessages']=function(_0x121386,_0x56d10b,_0x2faf4d){var _0x31214f={'where':{}},_0xd9c9c5={},_0x54e884={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfd6a('0x76')]({'where':{'id':_0x121386[_0xfd6a('0x65')]['id']}})[_0xfd6a('0x1c')](handleEntityNotFound(_0x56d10b,null))['then'](function(_0x7b5376){if(_0x7b5376){_0xd9c9c5[_0xfd6a('0x37')]=_['keys'](db['ChatMessage'][_0xfd6a('0xa4')]);_0xd9c9c5[_0xfd6a('0x3b')]=_[_0xfd6a('0x38')](_0x121386['query']);_0xd9c9c5[_0xfd6a('0x39')]=_[_0xfd6a('0x3a')](_0xd9c9c5[_0xfd6a('0x37')],_0xd9c9c5['query']);_0x31214f[_0xfd6a('0x3d')]=_[_0xfd6a('0x3a')](_0xd9c9c5[_0xfd6a('0x37')],qs[_0xfd6a('0x3c')](_0x121386[_0xfd6a('0x3b')][_0xfd6a('0x3c')]));_0x31214f[_0xfd6a('0x3d')]=_0x31214f['attributes'][_0xfd6a('0x3e')]?_0x31214f[_0xfd6a('0x3d')]:_0xd9c9c5[_0xfd6a('0x37')];if(!_0x121386[_0xfd6a('0x3b')][_0xfd6a('0xa5')](_0xfd6a('0x3f'))){_0x31214f[_0xfd6a('0x2a')]=qs['limit'](_0x121386[_0xfd6a('0x3b')]['limit']);_0x31214f[_0xfd6a('0x29')]=qs[_0xfd6a('0x29')](_0x121386['query'][_0xfd6a('0x29')]);}_0x31214f[_0xfd6a('0x40')]=qs[_0xfd6a('0x41')](_0x121386[_0xfd6a('0x3b')]['sort']);_0x31214f[_0xfd6a('0x42')]=qs['filters'](_[_0xfd6a('0x43')](_0x121386['query'],_0xd9c9c5[_0xfd6a('0x39')]));_0x31214f[_0xfd6a('0x42')]['ChatInteractionId']=_0x7b5376['id'];if(_0x121386['query']['filter']){_0x31214f[_0xfd6a('0x42')]=_[_0xfd6a('0x45')](_0x31214f['where'],{'$or':_[_0xfd6a('0x46')](_0x31214f[_0xfd6a('0x3d')],function(_0x3d9fe9){var _0x490e50={};_0x490e50[_0x3d9fe9]={'$like':'%'+_0x121386[_0xfd6a('0x3b')][_0xfd6a('0x44')]+'%'};return _0x490e50;})});}_0x31214f[_0xfd6a('0x42')][_0xfd6a('0x8f')]=![];if(_0x121386[_0xfd6a('0x3b')]['id']){_0x31214f[_0xfd6a('0x42')]['id']={'$gt':_0x121386[_0xfd6a('0x3b')]['id']};}_0x31214f=_[_0xfd6a('0x45')]({},_0x31214f,_0x121386['options']);return db[_0xfd6a('0x51')][_0xfd6a('0x28')]({'where':_0x31214f[_0xfd6a('0x42')]})[_0xfd6a('0x1c')](function(_0x2459db){_0x54e884[_0xfd6a('0x28')]=_0x2459db;_0x31214f[_0xfd6a('0x4a')]=[];if(_0x121386[_0xfd6a('0x3b')]['includeAgent']){_0x31214f['include'][_0xfd6a('0x4c')]({'model':db[_0xfd6a('0x55')],'as':_0xfd6a('0x55'),'attributes':['id',_0xfd6a('0x56'),'alias']});}if(_0x121386['query'][_0xfd6a('0x54')]){_0x31214f[_0xfd6a('0x4a')]=[{'all':!![]}];}return db[_0xfd6a('0x51')]['findAll'](_0x31214f);})[_0xfd6a('0x1c')](function(_0x23e4fb){_0x54e884['rows']=_0x23e4fb;return _0x54e884;});}})[_0xfd6a('0x1c')](respondWithFilteredResult(_0x56d10b,_0x31214f))[_0xfd6a('0x24')](handleError(_0x56d10b,null));};exports[_0xfd6a('0xaa')]=function(_0x359ae2,_0x28fb6d,_0x5c3d25){return db[_0xfd6a('0x36')][_0xfd6a('0x60')]({'where':{'id':_0x359ae2[_0xfd6a('0x65')]['id']}})['then'](handleEntityNotFound(_0x28fb6d,null))[_0xfd6a('0x1c')](function(_0x180795){if(_0x180795){return _0x180795['setTags'](_0x359ae2[_0xfd6a('0x62')][_0xfd6a('0xa2')],_[_0xfd6a('0xab')](_0x359ae2['body'],[_0xfd6a('0xa2'),'id'])||{})[_0xfd6a('0xac')](function(){return db[_0xfd6a('0x4d')]['findAll']({'attributes':['id',_0xfd6a('0x33'),_0xfd6a('0x5b')],'where':{'id':_0x359ae2[_0xfd6a('0x62')][_0xfd6a('0xa2')]}});})[_0xfd6a('0x1c')](function(_0xb14ab4){socket[_0xfd6a('0xad')]('chatInteractionTags:save',{'id':Number(_0x359ae2[_0xfd6a('0x65')]['id']),'tags':_0xb14ab4||[]});return{'id':Number(_0x359ae2['params']['id']),'tags':_0xb14ab4||[]};});}})[_0xfd6a('0x1c')](respondWithResult(_0x28fb6d,null))[_0xfd6a('0x24')](handleError(_0x28fb6d,null));};exports[_0xfd6a('0xae')]=function(_0x2bb4ab,_0x521893,_0x298e0a){var _0x31497e;return db[_0xfd6a('0x36')][_0xfd6a('0x60')]({'where':{'id':_0x2bb4ab[_0xfd6a('0x65')]['id']}})[_0xfd6a('0x1c')](handleEntityNotFound(_0x521893,null))[_0xfd6a('0x1c')](function(_0x342de4){if(_0x342de4){return _0x342de4[_0xfd6a('0xae')](_0x2bb4ab[_0xfd6a('0x3b')][_0xfd6a('0xa2')]);}})[_0xfd6a('0x1c')](respondWithStatusCode(_0x521893,null))[_0xfd6a('0x24')](handleError(_0x521893,null));};exports[_0xfd6a('0x79')]=function(_0x2d32d7,_0x3cea2e){var _0x6b13cf=moment()[_0xfd6a('0xaf')]()[_0xfd6a('0xb0')]();var _0x417d7a=path['join'](config[_0xfd6a('0x7b')],_0xfd6a('0xb1'),'files','tmp');var _0x5f2503=path[_0xfd6a('0x7a')](config[_0xfd6a('0x7b')],_0xfd6a('0xb1'),'files','attachments');var _0x303c16=path[_0xfd6a('0x7a')](_0x417d7a,_0x6b13cf);var _0x40d42f=util[_0xfd6a('0x80')](_0xfd6a('0xb2'),_0x6b13cf);var _0x1479a0=path['join'](_0x417d7a,_0x40d42f);var _0x4be489=![];return db[_0xfd6a('0x36')]['find']({'where':{'id':_0x2d32d7['params']['id']},'include':[{'model':db[_0xfd6a('0x51')],'as':_0xfd6a('0x52'),'attributes':['id',_0xfd6a('0x62')],'include':[{'model':db[_0xfd6a('0x55')],'as':_0xfd6a('0x55'),'attributes':['id',_0xfd6a('0x56')],'raw':!![]},{'model':db[_0xfd6a('0x83')],'as':'Contact','attributes':['id',_0xfd6a('0xb3')],'raw':!![]},{'model':db[_0xfd6a('0x74')],'as':_0xfd6a('0x74'),'raw':!![]}]}]})[_0xfd6a('0x1c')](handleEntityNotFound(_0x3cea2e,null))[_0xfd6a('0x1c')](function(_0x17c260){if(_0x17c260){_0x4be489=!![];var _0x26842a='';var _0x2b9d71={'format':_0xfd6a('0xb4'),'border':_0xfd6a('0xb5')};fs['mkdirSync'](_0x303c16);_0x26842a+=util['format']('

Chat\x20Interaction:\x20#%d

',_0x17c260['id']);_0x26842a+=util[_0xfd6a('0x80')](_0xfd6a('0xb6'),moment()['format'](_0xfd6a('0xb7'))['toString']());_0x26842a+=_0xfd6a('0xb8');for(var _0xc77b99=0x1;_0xc77b99<_0x17c260[_0xfd6a('0x52')][_0xfd6a('0x3e')];_0xc77b99++){var _0x37d54e=_0x17c260['Messages'][_0xc77b99];_0x26842a+=_0xfd6a('0xb9');_0x26842a+=util[_0xfd6a('0x80')](_0xfd6a('0xba'),_0x37d54e[_0xfd6a('0x55')]?_0x37d54e[_0xfd6a('0x55')]['fullname']:_0x37d54e['Contact']['firstName'],_0x37d54e['body']);_0x26842a+=_0xfd6a('0xbb');if(_0x37d54e[_0xfd6a('0x74')]){var _0x5d7ea9=_0x37d54e[_0xfd6a('0x74')];var _0x19e259=path[_0xfd6a('0x7a')](_0x5f2503,_0x5d7ea9[_0xfd6a('0x71')]);if(fs[_0xfd6a('0xbc')](_0x19e259)){fs['createReadStream'](_0x19e259)['pipe'](fs[_0xfd6a('0xbd')](path[_0xfd6a('0x7a')](_0x303c16,_0x5d7ea9[_0xfd6a('0x71')])));}}}return new BPromise(function(_0xaceda4,_0x6824c0){pdf[_0xfd6a('0x61')](_0x26842a,_0x2b9d71)[_0xfd6a('0xbe')](path[_0xfd6a('0x7a')](_0x303c16,_0xfd6a('0xbf')+_0x6b13cf+'.pdf'),function(_0x2917f1,_0x45c95a){if(_0x2917f1)return _0x6824c0(_0x2917f1);_0xaceda4(_0x45c95a);});});}})[_0xfd6a('0x1c')](function(){if(_0x4be489){return new BPromise(function(_0x19bd60,_0x14a246){zipdir(_0x303c16,{'saveTo':_0x1479a0},function(_0x3845e1,_0x3a3d31){if(_0x3845e1)return _0x14a246(_0x3845e1);return _0x19bd60(_0x3a3d31);});});}})[_0xfd6a('0x1c')](function(){if(_0x4be489){return new BPromise(function(_0x2291fc,_0x5165e7){rimraf(_0x303c16,function(_0x1d76c0){if(_0x1d76c0)_0x5165e7(_0x1d76c0);return _0x2291fc();});});}})[_0xfd6a('0x1c')](function(){if(_0x4be489){return _0x3cea2e['download'](_0x1479a0,_0x40d42f,function(_0xbc2549){if(_0xbc2549){console[_0xfd6a('0xc0')]('err',_0xbc2549);}else{fs[_0xfd6a('0xc1')](_0x1479a0);}});}else{return _0x3cea2e[_0xfd6a('0x25')](0xc8);}})[_0xfd6a('0x24')](handleError(_0x3cea2e,null));}; \ No newline at end of file +var _0xb010=['attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','field','options','include','push','Tag','Tags','tag','distinct','read','ChatMessage','direction','then','includeAll','User','Users','CmContact','Owner','fullname','internal','ChatWebsite','Account','Messages','createdAt','color','catch','show','params','find','create','body','describe','customUpdate','abandon','entity\x20not\x20found','closed','disposition','AbandonInteraction','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','findOne','attachId','download','root','server/files/attachments/','close','mailTranscript','join','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatWebsiteId','UserId','%s%d','agentAlias','System','customer','Visitor','ContactId','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','rawAttributes','ChatInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','order','includeAgent','addTags','setTags','omit','ids','spread','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','Contact','firstName','Letter','1cm','mkdirSync','

Chat\x20Interaction:\x20#%d

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','
','','existsSync','createReadStream','pipe','.pdf','unlinkSync','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','name','send','index','ChatInteraction','keys','query','filters','model','intersection','fields'];(function(_0x436f06,_0x11c990){var _0x3f66a2=function(_0x4ae430){while(--_0x4ae430){_0x436f06['push'](_0x436f06['shift']());}};_0x3f66a2(++_0x11c990);}(_0xb010,0x8b));var _0x0b01=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb010[_0x178e48];return _0x440d7e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0b01('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b01('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b01('0x2'));var moment=require('moment');var BPromise=require(_0x0b01('0x3'));var Mustache=require(_0x0b01('0x4'));var util=require(_0x0b01('0x5'));var path=require(_0x0b01('0x6'));var sox=require(_0x0b01('0x7'));var csv=require(_0x0b01('0x8'));var ejs=require(_0x0b01('0x9'));var fs=require('fs');var _=require(_0x0b01('0xa'));var squel=require(_0x0b01('0xb'));var crypto=require(_0x0b01('0xc'));var jsforce=require(_0x0b01('0xd'));var deskjs=require(_0x0b01('0xe'));var toCsv=require(_0x0b01('0x8'));var querystring=require('querystring');var Papa=require(_0x0b01('0xf'));var authService=require(_0x0b01('0x10'));var hardwareService=require(_0x0b01('0x11'));var Redis=require(_0x0b01('0x12'));var qs=require(_0x0b01('0x13'));var logger=require(_0x0b01('0x14'))(_0x0b01('0x15'));var utils=require(_0x0b01('0x16'));var config=require(_0x0b01('0x17'));var db=require(_0x0b01('0x18'))['db'];config['redis']=_[_0x0b01('0x19')](config[_0x0b01('0x1a')],{'host':_0x0b01('0x1b'),'port':0x18eb});var socket=require(_0x0b01('0x1c'))(new Redis(config[_0x0b01('0x1a')]));require(_0x0b01('0x1d'))[_0x0b01('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0b01('0x1f')][_0x0b01('0x20')]({'port':0x232b});var client9004=jayson[_0x0b01('0x1f')][_0x0b01('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x4074c2,_0x2448a4,_0x24c0d4,_0x2348ef){return new BPromise(function(_0x9a813d,_0x15bfdf){var _0x458baf=_0x2348ef||client;return _0x458baf[_0x0b01('0x21')](_0x4074c2,_0x24c0d4)['then'](function(_0x2f399c){logger[_0x0b01('0x22')](_0x0b01('0x23'),_0x2448a4,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2448a4,_0x0b01('0x24'),JSON[_0x0b01('0x25')](_0x2f399c));if(_0x2f399c[_0x0b01('0x26')]){if(_0x2f399c[_0x0b01('0x26')][_0x0b01('0x27')]===0x1f4){logger[_0x0b01('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x2448a4,_0x2f399c[_0x0b01('0x26')][_0x0b01('0x28')]);return _0x15bfdf(_0x2f399c[_0x0b01('0x26')][_0x0b01('0x28')]);}logger[_0x0b01('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x2448a4,_0x2f399c['error'][_0x0b01('0x28')]);return _0x9a813d(_0x2f399c[_0x0b01('0x26')][_0x0b01('0x28')]);}else{logger[_0x0b01('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x2448a4,'request\x20sent');_0x9a813d(_0x2f399c['result'][_0x0b01('0x28')]);}})['catch'](function(_0x4af9f6){logger['error'](_0x0b01('0x23'),_0x2448a4,_0x4af9f6);_0x15bfdf(_0x4af9f6);});});}function respondWithStatusCode(_0x80c47,_0xed5e34){_0xed5e34=_0xed5e34||0xcc;return function(_0xf9fbfc){if(_0xf9fbfc){return _0x80c47[_0x0b01('0x29')](_0xed5e34);}return _0x80c47[_0x0b01('0x2a')](_0xed5e34)[_0x0b01('0x2b')]();};}function respondWithResult(_0xdaaf81,_0x5cff03){_0x5cff03=_0x5cff03||0xc8;return function(_0xe33073){if(_0xe33073){return _0xdaaf81[_0x0b01('0x2a')](_0x5cff03)[_0x0b01('0x2c')](_0xe33073);}};}function respondWithFilteredResult(_0x513f07,_0x53b17a){return function(_0x29799c){if(_0x29799c){var _0x4b1e21=_0x29799c[_0x0b01('0x2d')],_0x48f7a6=_0x53b17a['offset'],_0x40f202=_0x53b17a[_0x0b01('0x2e')]+_0x53b17a[_0x0b01('0x2f')],_0x3c9e5e;if(_0x40f202>=_0x4b1e21){_0x40f202=_0x4b1e21;_0x3c9e5e=0xc8;}else{_0x3c9e5e=0xce;}_0x513f07[_0x0b01('0x2a')](_0x3c9e5e);return _0x513f07[_0x0b01('0x30')](_0x0b01('0x31'),_0x48f7a6+'-'+_0x40f202+'/'+_0x4b1e21)[_0x0b01('0x2c')](_0x29799c);}return null;};}function patchUpdates(_0x41e532){return function(_0x13b534){try{jsonpatch['apply'](_0x13b534,_0x41e532,!![]);}catch(_0x3bb0b0){return BPromise[_0x0b01('0x32')](_0x3bb0b0);}return _0x13b534[_0x0b01('0x33')]();};}function saveUpdates(_0x494313,_0x2aa19d){return function(_0x526d91){if(_0x526d91){return _0x526d91[_0x0b01('0x34')](_0x494313)['then'](function(_0x1eaf31){return _0x1eaf31;});}return null;};}function removeEntity(_0x479a46,_0x418d78){return function(_0x1100fc){if(_0x1100fc){return _0x1100fc[_0x0b01('0x35')]()['then'](function(){_0x479a46[_0x0b01('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7704d3,_0x98fe04){return function(_0x584c59){if(!_0x584c59){_0x7704d3[_0x0b01('0x29')](0x194);}return _0x584c59;};}function handleError(_0x5236d7,_0x5dc1d4){_0x5dc1d4=_0x5dc1d4||0x1f4;return function(_0x5b7743){logger[_0x0b01('0x26')](_0x5b7743['stack']);if(_0x5b7743[_0x0b01('0x36')]){delete _0x5b7743['name'];}_0x5236d7[_0x0b01('0x2a')](_0x5dc1d4)[_0x0b01('0x37')](_0x5b7743);};}exports[_0x0b01('0x38')]=function(_0x120a10,_0x16c26e){var _0x596534={},_0x5cfba3={},_0x2304b6={'count':0x0,'rows':[]};var _0x3c0dc3=db[_0x0b01('0x39')]['rawAttributes'];_0x5cfba3['model']=_[_0x0b01('0x3a')](_0x3c0dc3);_0x5cfba3['query']=_[_0x0b01('0x3a')](_0x120a10[_0x0b01('0x3b')]);_0x5cfba3[_0x0b01('0x3c')]=_['intersection'](_0x5cfba3[_0x0b01('0x3d')],_0x5cfba3[_0x0b01('0x3b')]);_0x596534['attributes']=_[_0x0b01('0x3e')](_0x5cfba3[_0x0b01('0x3d')],qs[_0x0b01('0x3f')](_0x120a10[_0x0b01('0x3b')][_0x0b01('0x3f')]));_0x596534[_0x0b01('0x40')]=_0x596534[_0x0b01('0x40')][_0x0b01('0x41')]?_0x596534['attributes']:_0x5cfba3[_0x0b01('0x3d')];if(!_0x120a10[_0x0b01('0x3b')][_0x0b01('0x42')](_0x0b01('0x43'))){_0x596534['limit']=qs[_0x0b01('0x2f')](_0x120a10[_0x0b01('0x3b')][_0x0b01('0x2f')]);_0x596534[_0x0b01('0x2e')]=qs[_0x0b01('0x2e')](_0x120a10['query']['offset']);}_0x596534['order']=qs[_0x0b01('0x44')](_0x120a10[_0x0b01('0x3b')][_0x0b01('0x44')]);_0x596534[_0x0b01('0x45')]=qs[_0x0b01('0x3c')](_[_0x0b01('0x46')](_0x120a10[_0x0b01('0x3b')],_0x5cfba3[_0x0b01('0x3c')]));if(_0x120a10[_0x0b01('0x3b')][_0x0b01('0x47')]){_0x596534[_0x0b01('0x45')]=_[_0x0b01('0x48')](_0x596534[_0x0b01('0x45')],{'$or':_[_0x0b01('0x49')](_0x3c0dc3,function(_0x581160){if(_0x581160[_0x0b01('0x4a')][_0x0b01('0x4b')]!=='VIRTUAL'){var _0x194f29={};_0x194f29[_0x581160[_0x0b01('0x4c')]]={'$like':'%'+_0x120a10[_0x0b01('0x3b')]['filter']+'%'};return _0x194f29;}})});}_0x596534=_[_0x0b01('0x48')]({},_0x596534,_0x120a10[_0x0b01('0x4d')]);var _0x38f213={'where':_0x596534['where']};_0x38f213[_0x0b01('0x4e')]=[];if(_0x120a10[_0x0b01('0x3b')]['tag']){_0x38f213['include'][_0x0b01('0x4f')]({'model':db[_0x0b01('0x50')],'as':_0x0b01('0x51'),'attributes':['id'],'where':{'id':_0x120a10['query'][_0x0b01('0x52')]},'required':!![]});_0x38f213[_0x0b01('0x53')]=!![];}if(_0x120a10[_0x0b01('0x3b')][_0x0b01('0x54')]){_0x38f213[_0x0b01('0x4e')]['push']({'model':db[_0x0b01('0x55')],'as':'Messages','attributes':['id',_0x0b01('0x56'),'createdAt','read'],'where':{'direction':'in','read':_0x120a10['query'][_0x0b01('0x54')]||![]},'required':!![]});_0x38f213['distinct']=!![];}return db[_0x0b01('0x39')][_0x0b01('0x2d')](_0x38f213)[_0x0b01('0x57')](function(_0x1932d9){_0x2304b6[_0x0b01('0x2d')]=_0x1932d9;if(_0x120a10['query'][_0x0b01('0x58')]){_0x596534['include']=[{'model':db[_0x0b01('0x59')],'as':_0x0b01('0x5a'),'required':![],'attributes':['id','name','fullname']},{'model':db[_0x0b01('0x5b')],'as':'Contact','required':![]},{'model':db[_0x0b01('0x59')],'as':_0x0b01('0x5c'),'attributes':[_0x0b01('0x36'),_0x0b01('0x5d'),_0x0b01('0x5e')],'required':![]},{'model':db[_0x0b01('0x5f')],'as':_0x0b01('0x60'),'attributes':[_0x0b01('0x36'),_0x0b01('0x4b')],'required':![]},{'model':db[_0x0b01('0x55')],'as':_0x0b01('0x61'),'attributes':['id','direction',_0x0b01('0x62'),_0x0b01('0x54')],'where':{'direction':'in','read':_0x120a10[_0x0b01('0x3b')]['read']||![]},'required':_0x120a10[_0x0b01('0x3b')]['read']||![]},{'model':db[_0x0b01('0x50')],'as':_0x0b01('0x51'),'attributes':['id',_0x0b01('0x36'),'color'],'required':_0x120a10[_0x0b01('0x3b')][_0x0b01('0x52')]?!![]:![]},{'model':db[_0x0b01('0x50')],'as':'ThroughTags','attributes':['id',_0x0b01('0x36'),_0x0b01('0x63')],'through':_0x120a10['query'][_0x0b01('0x52')]?{'attributes':[],'where':{'TagId':_0x120a10[_0x0b01('0x3b')][_0x0b01('0x52')]||undefined}}:{},'required':_0x120a10['query'][_0x0b01('0x52')]?!![]:![]}];}return db[_0x0b01('0x39')]['findAll'](_0x596534);})[_0x0b01('0x57')](function(_0x1102d8){_0x2304b6['rows']=_0x1102d8;return _0x2304b6;})[_0x0b01('0x57')](respondWithFilteredResult(_0x16c26e,_0x596534))[_0x0b01('0x64')](handleError(_0x16c26e,null));};exports[_0x0b01('0x65')]=function(_0x54eb2c,_0x17d335){var _0x41cb00={'raw':![],'where':{'id':_0x54eb2c[_0x0b01('0x66')]['id']}},_0x15fa46={};_0x15fa46[_0x0b01('0x3d')]=_['keys'](db[_0x0b01('0x39')]['rawAttributes']);_0x15fa46[_0x0b01('0x3b')]=_[_0x0b01('0x3a')](_0x54eb2c[_0x0b01('0x3b')]);_0x15fa46[_0x0b01('0x3c')]=_[_0x0b01('0x3e')](_0x15fa46[_0x0b01('0x3d')],_0x15fa46[_0x0b01('0x3b')]);_0x41cb00[_0x0b01('0x40')]=_['intersection'](_0x15fa46[_0x0b01('0x3d')],qs[_0x0b01('0x3f')](_0x54eb2c[_0x0b01('0x3b')]['fields']));_0x41cb00['attributes']=_0x41cb00['attributes'][_0x0b01('0x41')]?_0x41cb00[_0x0b01('0x40')]:_0x15fa46['model'];if(_0x54eb2c[_0x0b01('0x3b')][_0x0b01('0x58')]){_0x41cb00[_0x0b01('0x4e')]=[{'all':!![]}];}_0x41cb00=_[_0x0b01('0x48')]({},_0x41cb00,_0x54eb2c['options']);return db['ChatInteraction'][_0x0b01('0x67')](_0x41cb00)[_0x0b01('0x57')](handleEntityNotFound(_0x17d335,null))[_0x0b01('0x57')](respondWithResult(_0x17d335,null))[_0x0b01('0x64')](handleError(_0x17d335,null));};exports[_0x0b01('0x68')]=function(_0x1ae7d2,_0x55d1e0){return db[_0x0b01('0x39')]['create'](_0x1ae7d2[_0x0b01('0x69')],{})[_0x0b01('0x57')](respondWithResult(_0x55d1e0,0xc9))[_0x0b01('0x64')](handleError(_0x55d1e0,null));};exports[_0x0b01('0x34')]=function(_0x1fd0ab,_0x473f51){if(_0x1fd0ab['body']['id']){delete _0x1fd0ab[_0x0b01('0x69')]['id'];}return db[_0x0b01('0x39')]['find']({'where':{'id':_0x1fd0ab[_0x0b01('0x66')]['id']}})[_0x0b01('0x57')](handleEntityNotFound(_0x473f51,null))[_0x0b01('0x57')](saveUpdates(_0x1fd0ab['body'],null))[_0x0b01('0x57')](respondWithResult(_0x473f51,null))[_0x0b01('0x64')](handleError(_0x473f51,null));};exports[_0x0b01('0x35')]=function(_0xb8fedd,_0x3a19dd){return db[_0x0b01('0x39')][_0x0b01('0x67')]({'where':{'id':_0xb8fedd[_0x0b01('0x66')]['id']}})[_0x0b01('0x57')](handleEntityNotFound(_0x3a19dd,null))['then'](removeEntity(_0x3a19dd,null))[_0x0b01('0x64')](handleError(_0x3a19dd,null));};exports['describe']=function(_0x2e835f,_0x3833cf){return db['ChatInteraction'][_0x0b01('0x6a')]()[_0x0b01('0x57')](respondWithResult(_0x3833cf,null))['catch'](handleError(_0x3833cf,null));};exports[_0x0b01('0x6b')]=function(_0x39446d,_0x143ac0){if(_0x39446d['body']['id']){delete _0x39446d[_0x0b01('0x69')]['id'];}return db[_0x0b01('0x39')]['find']({'where':{'id':_0x39446d['params']['id']}})[_0x0b01('0x57')](handleEntityNotFound(_0x143ac0,null))[_0x0b01('0x57')](saveUpdates(_0x39446d[_0x0b01('0x69')],null))[_0x0b01('0x57')](respondWithResult(_0x143ac0,null))['catch'](handleError(_0x143ac0,null));};exports[_0x0b01('0x6c')]=function(_0x589a0b,_0xa1073c,_0x1eb05b){if(_0x589a0b[_0x0b01('0x69')]['id']){delete _0x589a0b[_0x0b01('0x69')]['id'];}return db[_0x0b01('0x39')][_0x0b01('0x67')]({'where':{'id':_0x589a0b[_0x0b01('0x66')]['id']}})[_0x0b01('0x57')](function(_0x381dc3){if(!_0x381dc3){logger[_0x0b01('0x26')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0b01('0x6c'),0x194,_0x0b01('0x6d'));_0xa1073c[_0x0b01('0x29')](0x194);}else{if(_0x381dc3['UserId']){throw new db['Sequelize']['ValidationError']('Interaction\x20already\x20assigned');}}return _0x381dc3;})[_0x0b01('0x57')](function(_0x66465a){if(_0x66465a){return _0x66465a['update']({'closed':_0x589a0b['body'][_0x0b01('0x6e')],'disposition':_0x589a0b['body'][_0x0b01('0x6f')]})[_0x0b01('0x57')](function(_0x4e6d8d){return _0x4e6d8d;});}})[_0x0b01('0x57')](function(_0x4a2a03){return respondWithRpcPromise(_0x0b01('0x70'),_0x0b01('0x6c'),_0x589a0b[_0x0b01('0x69')],client9004);})[_0x0b01('0x57')](respondWithResult(_0xa1073c,null))['catch'](handleError(_0xa1073c,null));};exports['attachmentUpload']=function(_0x4520b1,_0x57b7c0,_0x33be18){_0x4520b1['body'][_0x0b01('0x36')]=_0x4520b1[_0x0b01('0x71')][_0x0b01('0x72')];_0x4520b1['body'][_0x0b01('0x73')]=_0x4520b1[_0x0b01('0x71')][_0x0b01('0x74')];_0x4520b1[_0x0b01('0x69')][_0x0b01('0x4a')]=_0x4520b1['file'][_0x0b01('0x75')];return db[_0x0b01('0x76')][_0x0b01('0x68')](_0x4520b1['body'])['then'](respondWithResult(_0x57b7c0,0xc9))['catch'](handleError(_0x57b7c0,null));};exports[_0x0b01('0x77')]=function(_0x1c2535,_0xdcccb9,_0x28a706){return db['ChatInteraction']['findOne']({'where':{'id':_0x1c2535[_0x0b01('0x66')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xdcccb9,null))['then'](function(_0x330404){if(_0x330404){if(_0x330404[_0x0b01('0x6e')]){return _0xdcccb9[_0x0b01('0x2a')](0x193)[_0x0b01('0x2c')]({'status':0x193,'message':_0x0b01('0x78')});}return db[_0x0b01('0x76')][_0x0b01('0x79')]({'where':{'id':_0x1c2535['query'][_0x0b01('0x7a')]},'raw':!![]})[_0x0b01('0x57')](handleEntityNotFound(_0xdcccb9,null));}})['then'](function(_0x57223d){if(_0x57223d){return _0xdcccb9[_0x0b01('0x7b')](path['join'](config[_0x0b01('0x7c')],_0x0b01('0x7d'),_0x57223d[_0x0b01('0x73')]));}})[_0x0b01('0x64')](handleError(_0xdcccb9,null));};exports[_0x0b01('0x7e')]=function(_0x2f45e0,_0x592a71){var _0x5bbe95=null;var _0x3949e4=null;var _0x2bc03d=null;var _0x45a4fc=null;if(_0x2f45e0[_0x0b01('0x69')]['id']){delete _0x2f45e0[_0x0b01('0x69')]['id'];}if(_0x2f45e0[_0x0b01('0x69')][_0x0b01('0x7f')]){_0x45a4fc=path[_0x0b01('0x80')](config[_0x0b01('0x7c')],_0x0b01('0x81'),util[_0x0b01('0x82')](_0x0b01('0x83'),Date[_0x0b01('0x84')]()));_0x2f45e0['body'][_0x0b01('0x85')]=_0x45a4fc;}return db[_0x0b01('0x39')][_0x0b01('0x67')]({'where':{'id':_0x2f45e0[_0x0b01('0x66')]['id']},'include':[{'model':db[_0x0b01('0x55')],'as':'Messages','include':[{'model':db['User'],'as':_0x0b01('0x59')}]}]})[_0x0b01('0x57')](handleEntityNotFound(_0x592a71,null))['then'](saveUpdates(_0x2f45e0[_0x0b01('0x69')],null))[_0x0b01('0x57')](function(_0x10eb8f){if(_0x10eb8f){_0x5bbe95=_0x10eb8f;return db[_0x0b01('0x5f')][_0x0b01('0x67')]({'where':{'id':_0x5bbe95[_0x0b01('0x86')]}});}})[_0x0b01('0x57')](function(_0xcd8b17){if(_0xcd8b17){_0x2bc03d=_0xcd8b17;return db[_0x0b01('0x5b')][_0x0b01('0x67')]({'where':{'id':_0x5bbe95['ContactId']}});}})[_0x0b01('0x57')](function(_0x108c3a){if(_0x108c3a){_0x3949e4=_0x108c3a;if(_0x45a4fc){var _0x4e69af=null;for(var _0x372d57=0x1;_0x372d57<_0x5bbe95[_0x0b01('0x61')][_0x0b01('0x41')];++_0x372d57){_0x4e69af=_0x5bbe95[_0x0b01('0x61')][_0x372d57];var _0x1e4aa4=_0x4e69af[_0x0b01('0x87')]?util['format'](_0x0b01('0x88'),_0x2bc03d[_0x0b01('0x89')],_0x4e69af[_0x0b01('0x87')]):_0x0b01('0x8a');var _0x53373b=_0x2f45e0[_0x0b01('0x69')][_0x0b01('0x8b')]||util[_0x0b01('0x82')](_0x0b01('0x88'),_0x0b01('0x8c'),_0x4e69af[_0x0b01('0x8d')]);switch(_0x2bc03d[_0x0b01('0x8e')]){case _0x0b01('0x8f'):_0x1e4aa4=_0x4e69af[_0x0b01('0x87')]?util[_0x0b01('0x82')]('%s%d',_0x2bc03d['agentAlias'],_0x4e69af[_0x0b01('0x87')]):_0x0b01('0x8a');break;case _0x0b01('0x90'):_0x1e4aa4=_0x4e69af[_0x0b01('0x87')]?_0x4e69af[_0x0b01('0x59')][_0x0b01('0x91')]||_0x4e69af[_0x0b01('0x59')][_0x0b01('0x5d')]:'System';break;case _0x0b01('0x92'):_0x1e4aa4=_0x4e69af[_0x0b01('0x87')]?_0x4e69af['User']['fullname']:_0x0b01('0x8a');break;default:_0x1e4aa4=_0x4e69af[_0x0b01('0x87')]?util['format'](_0x0b01('0x88'),_0x2bc03d['agentAlias'],_0x4e69af[_0x0b01('0x87')]):_0x0b01('0x8a');}var _0xf59c3a=util['format'](_0x0b01('0x93'),moment(_0x4e69af[_0x0b01('0x62')])[_0x0b01('0x82')](_0x0b01('0x94')),_0x4e69af['direction']==='in'?_0x53373b:_0x1e4aa4,_0x4e69af['body']);if(!_0x4e69af[_0x0b01('0x95')]){fs['appendFileSync'](_0x45a4fc,_0xf59c3a);}}return db[_0x0b01('0x96')][_0x0b01('0x79')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x0b01('0x97'),'raw':!![]}]});}}})[_0x0b01('0x57')](function(_0x330204){if(_0x330204&&_0x330204[_0x0b01('0x97')]&&_0x2f45e0['body']){var _0x37a2ca={'tls':{'rejectUnauthorized':![]}};if(_0x330204['Smtp']['service']){_0x37a2ca['service']=_0x330204[_0x0b01('0x97')][_0x0b01('0x98')];}else{_0x37a2ca[_0x0b01('0x99')]=_0x330204['Smtp'][_0x0b01('0x99')];_0x37a2ca[_0x0b01('0x9a')]=_0x330204['Smtp']['port'];_0x37a2ca[_0x0b01('0x9b')]=_0x330204[_0x0b01('0x97')]['secure'];}if(_0x330204[_0x0b01('0x97')][_0x0b01('0x9c')]){_0x37a2ca[_0x0b01('0x9d')]={'user':_0x330204[_0x0b01('0x97')][_0x0b01('0x9e')],'pass':_0x330204[_0x0b01('0x97')][_0x0b01('0x9f')]};}return respondWithRpcPromise(_0x0b01('0xa0'),_0x0b01('0xa1'),{'account':_0x37a2ca,'message':{'from':util['format'](_0x0b01('0xa2'),_0x330204[_0x0b01('0x36')],_0x330204[_0x0b01('0xa3')]||_0x330204[_0x0b01('0x97')]['user']),'to':_0x2f45e0['body'][_0x0b01('0x7f')],'subject':'Mail\x20Transcript','text':util['format'](_0x0b01('0xa4'),_0x2f45e0[_0x0b01('0x69')]['mailTranscript']),'attachments':[{'path':_0x45a4fc}]}})[_0x0b01('0x57')](function(){return _0x5bbe95;})[_0x0b01('0x64')](function(_0x583e33){console[_0x0b01('0x26')](_0x583e33);});}else{return _0x5bbe95;}})['then'](respondWithStatusCode(_0x592a71,0xc8))[_0x0b01('0x64')](handleError(_0x592a71,null));};exports[_0x0b01('0xa5')]=function(_0x1cd059,_0x6953fe,_0x5cbdb7){return db['ChatMessage'][_0x0b01('0x67')]({'where':{'id':_0x1cd059[_0x0b01('0x66')]['id']}})[_0x0b01('0x57')](handleEntityNotFound(_0x6953fe,null))[_0x0b01('0x57')](function(_0x411c2e){if(_0x411c2e){return _0x411c2e[_0x0b01('0xa5')](_0x1cd059[_0x0b01('0x69')]['ids'],_['omit'](_0x1cd059[_0x0b01('0x69')],['ids','id'])||{});}})[_0x0b01('0x57')](respondWithResult(_0x6953fe,null))[_0x0b01('0x64')](handleError(_0x6953fe,null));};exports['getMessages']=function(_0x179aab,_0x602b53,_0x2d71d3){var _0x29ac3f={'raw':![],'where':{}};var _0x345443={};var _0x2215fb={'count':0x0,'rows':[]};return db[_0x0b01('0x39')][_0x0b01('0x79')]({'where':{'id':_0x179aab[_0x0b01('0x66')]['id']}})[_0x0b01('0x57')](handleEntityNotFound(_0x602b53,null))['then'](function(_0x148e86){if(_0x148e86){_0x345443[_0x0b01('0x3d')]=_[_0x0b01('0x3a')](db[_0x0b01('0x55')][_0x0b01('0xa6')]);_0x345443[_0x0b01('0x3b')]=_[_0x0b01('0x3a')](_0x179aab[_0x0b01('0x3b')]);_0x345443[_0x0b01('0x3c')]=_[_0x0b01('0x3e')](_0x345443[_0x0b01('0x3d')],_0x345443[_0x0b01('0x3b')]);_0x29ac3f[_0x0b01('0x40')]=_[_0x0b01('0x3e')](_0x345443[_0x0b01('0x3d')],qs['fields'](_0x179aab[_0x0b01('0x3b')][_0x0b01('0x3f')]));_0x29ac3f[_0x0b01('0x40')]=_0x29ac3f['attributes'][_0x0b01('0x41')]?_0x29ac3f['attributes']:_0x345443['model'];if(!_0x179aab[_0x0b01('0x3b')]['hasOwnProperty']('nolimit')){_0x29ac3f['limit']=qs[_0x0b01('0x2f')](_0x179aab['query'][_0x0b01('0x2f')]);_0x29ac3f['offset']=qs[_0x0b01('0x2e')](_0x179aab['query']['offset']);}_0x29ac3f['order']=qs[_0x0b01('0x44')](_0x179aab[_0x0b01('0x3b')][_0x0b01('0x44')]);_0x29ac3f[_0x0b01('0x45')]=qs[_0x0b01('0x3c')](_[_0x0b01('0x46')](_0x179aab[_0x0b01('0x3b')],_0x345443[_0x0b01('0x3c')]));_0x29ac3f['where'][_0x0b01('0xa7')]=_0x148e86['id'];if(_0x179aab[_0x0b01('0x3b')][_0x0b01('0x47')]){_0x29ac3f[_0x0b01('0x45')]=_['merge'](_0x29ac3f[_0x0b01('0x45')],{'$or':_[_0x0b01('0x49')](_0x29ac3f[_0x0b01('0x40')],function(_0x45f4f2){var _0x567684={};_0x567684[_0x45f4f2]={'$like':'%'+_0x179aab['query'][_0x0b01('0x47')]+'%'};return _0x567684;})});}if(_0x179aab[_0x0b01('0x3b')][_0x0b01('0xa8')]){var _0x4409ed=_0x179aab['query'][_0x0b01('0xa8')][_0x0b01('0xa9')](',');var _0x37227f={};_0x37227f[_0x4409ed[0x0]]={'$gte':moment(_0x4409ed[0x1])[_0x0b01('0x82')](_0x0b01('0xaa'))};_0x29ac3f[_0x0b01('0x45')]=_['merge'](_0x29ac3f[_0x0b01('0x45')],_0x37227f);}_0x29ac3f=_[_0x0b01('0x48')]({},_0x29ac3f,_0x179aab[_0x0b01('0x4d')]);return db[_0x0b01('0x55')]['count']({'where':_0x29ac3f[_0x0b01('0x45')]})[_0x0b01('0x57')](function(_0x5706a3){_0x2215fb[_0x0b01('0x2d')]=_0x5706a3;if(_0x179aab['query']['includeAll']){_0x29ac3f[_0x0b01('0x4e')]=[{'all':!![]}];}return db[_0x0b01('0x55')][_0x0b01('0xab')](_0x29ac3f);})[_0x0b01('0x57')](function(_0x1388d3){_0x2215fb[_0x0b01('0xac')]=_0x1388d3;return _0x2215fb;});}})[_0x0b01('0x57')](respondWithFilteredResult(_0x602b53,_0x29ac3f))[_0x0b01('0x64')](handleError(_0x602b53,null));};exports['getMyMessages']=function(_0x35ecb7,_0x2fc363,_0x590399){var _0x8fe815={'where':{}},_0x400c04={},_0x415689={'count':0x0,'rows':[]};return db[_0x0b01('0x39')]['findOne']({'where':{'id':_0x35ecb7[_0x0b01('0x66')]['id']}})[_0x0b01('0x57')](handleEntityNotFound(_0x2fc363,null))[_0x0b01('0x57')](function(_0x14bc17){if(_0x14bc17){_0x400c04[_0x0b01('0x3d')]=_[_0x0b01('0x3a')](db[_0x0b01('0x55')][_0x0b01('0xa6')]);_0x400c04[_0x0b01('0x3b')]=_[_0x0b01('0x3a')](_0x35ecb7[_0x0b01('0x3b')]);_0x400c04[_0x0b01('0x3c')]=_[_0x0b01('0x3e')](_0x400c04[_0x0b01('0x3d')],_0x400c04[_0x0b01('0x3b')]);_0x8fe815[_0x0b01('0x40')]=_[_0x0b01('0x3e')](_0x400c04[_0x0b01('0x3d')],qs[_0x0b01('0x3f')](_0x35ecb7['query'][_0x0b01('0x3f')]));_0x8fe815[_0x0b01('0x40')]=_0x8fe815['attributes'][_0x0b01('0x41')]?_0x8fe815[_0x0b01('0x40')]:_0x400c04[_0x0b01('0x3d')];if(!_0x35ecb7['query'][_0x0b01('0x42')]('nolimit')){_0x8fe815[_0x0b01('0x2f')]=qs[_0x0b01('0x2f')](_0x35ecb7['query'][_0x0b01('0x2f')]);_0x8fe815[_0x0b01('0x2e')]=qs['offset'](_0x35ecb7[_0x0b01('0x3b')]['offset']);}_0x8fe815[_0x0b01('0xad')]=qs[_0x0b01('0x44')](_0x35ecb7[_0x0b01('0x3b')][_0x0b01('0x44')]);_0x8fe815[_0x0b01('0x45')]=qs[_0x0b01('0x3c')](_[_0x0b01('0x46')](_0x35ecb7['query'],_0x400c04[_0x0b01('0x3c')]));_0x8fe815[_0x0b01('0x45')][_0x0b01('0xa7')]=_0x14bc17['id'];if(_0x35ecb7['query'][_0x0b01('0x47')]){_0x8fe815[_0x0b01('0x45')]=_['merge'](_0x8fe815[_0x0b01('0x45')],{'$or':_[_0x0b01('0x49')](_0x8fe815[_0x0b01('0x40')],function(_0x448831){var _0x8f6cf1={};_0x8f6cf1[_0x448831]={'$like':'%'+_0x35ecb7[_0x0b01('0x3b')][_0x0b01('0x47')]+'%'};return _0x8f6cf1;})});}_0x8fe815[_0x0b01('0x45')][_0x0b01('0x95')]=![];if(_0x35ecb7[_0x0b01('0x3b')]['id']){_0x8fe815[_0x0b01('0x45')]['id']={'$gt':_0x35ecb7['query']['id']};}_0x8fe815=_['merge']({},_0x8fe815,_0x35ecb7['options']);return db[_0x0b01('0x55')][_0x0b01('0x2d')]({'where':_0x8fe815[_0x0b01('0x45')]})[_0x0b01('0x57')](function(_0x200857){_0x415689[_0x0b01('0x2d')]=_0x200857;_0x8fe815[_0x0b01('0x4e')]=[];if(_0x35ecb7[_0x0b01('0x3b')][_0x0b01('0xae')]){_0x8fe815[_0x0b01('0x4e')][_0x0b01('0x4f')]({'model':db[_0x0b01('0x59')],'as':'User','attributes':['id','fullname','alias']});}if(_0x35ecb7[_0x0b01('0x3b')][_0x0b01('0x58')]){_0x8fe815[_0x0b01('0x4e')]=[{'all':!![]}];}return db[_0x0b01('0x55')][_0x0b01('0xab')](_0x8fe815);})['then'](function(_0x732193){_0x415689[_0x0b01('0xac')]=_0x732193;return _0x415689;});}})[_0x0b01('0x57')](respondWithFilteredResult(_0x2fc363,_0x8fe815))['catch'](handleError(_0x2fc363,null));};exports[_0x0b01('0xaf')]=function(_0x1c4a2c,_0x1d5c90,_0x146b1f){return db['ChatInteraction']['find']({'where':{'id':_0x1c4a2c[_0x0b01('0x66')]['id']}})[_0x0b01('0x57')](handleEntityNotFound(_0x1d5c90,null))[_0x0b01('0x57')](function(_0x15933d){if(_0x15933d){return _0x15933d[_0x0b01('0xb0')](_0x1c4a2c['body']['ids'],_[_0x0b01('0xb1')](_0x1c4a2c[_0x0b01('0x69')],[_0x0b01('0xb2'),'id'])||{})[_0x0b01('0xb3')](function(){return db[_0x0b01('0x50')][_0x0b01('0xab')]({'attributes':['id',_0x0b01('0x36'),'color'],'where':{'id':_0x1c4a2c[_0x0b01('0x69')][_0x0b01('0xb2')]}});})[_0x0b01('0x57')](function(_0x30dd99){socket[_0x0b01('0xb4')](_0x0b01('0xb5'),{'id':Number(_0x1c4a2c[_0x0b01('0x66')]['id']),'tags':_0x30dd99||[]});return{'id':Number(_0x1c4a2c[_0x0b01('0x66')]['id']),'tags':_0x30dd99||[]};});}})[_0x0b01('0x57')](respondWithResult(_0x1d5c90,null))[_0x0b01('0x64')](handleError(_0x1d5c90,null));};exports[_0x0b01('0xb6')]=function(_0x2add76,_0x5a72b0,_0x193d34){var _0x34036e;return db[_0x0b01('0x39')]['find']({'where':{'id':_0x2add76['params']['id']}})[_0x0b01('0x57')](handleEntityNotFound(_0x5a72b0,null))[_0x0b01('0x57')](function(_0x23a95a){if(_0x23a95a){return _0x23a95a['removeTags'](_0x2add76[_0x0b01('0x3b')]['ids']);}})[_0x0b01('0x57')](respondWithStatusCode(_0x5a72b0,null))[_0x0b01('0x64')](handleError(_0x5a72b0,null));};exports[_0x0b01('0x7b')]=function(_0x1f873b,_0x515ad5){var _0x1b3e8d=moment()[_0x0b01('0xb7')]()[_0x0b01('0xb8')]();var _0x1401dd=path[_0x0b01('0x80')](config[_0x0b01('0x7c')],_0x0b01('0xb9'),_0x0b01('0xba'),_0x0b01('0xbb'));var _0x573280=path[_0x0b01('0x80')](config['root'],_0x0b01('0xb9'),_0x0b01('0xba'),_0x0b01('0xbc'));var _0x3bb3c5=path[_0x0b01('0x80')](_0x1401dd,_0x1b3e8d);var _0x447f72=util[_0x0b01('0x82')]('interaction-%s.zip',_0x1b3e8d);var _0x3c660a=path[_0x0b01('0x80')](_0x1401dd,_0x447f72);var _0x1e8a31=![];return db[_0x0b01('0x39')][_0x0b01('0x67')]({'where':{'id':_0x1f873b[_0x0b01('0x66')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x0b01('0x61'),'attributes':['id','body'],'include':[{'model':db[_0x0b01('0x59')],'as':'User','attributes':['id',_0x0b01('0x5d')],'raw':!![]},{'model':db[_0x0b01('0x5b')],'as':_0x0b01('0xbd'),'attributes':['id',_0x0b01('0xbe')],'raw':!![]},{'model':db['Attachment'],'as':_0x0b01('0x76'),'raw':!![]}]}]})[_0x0b01('0x57')](handleEntityNotFound(_0x515ad5,null))[_0x0b01('0x57')](function(_0x25f95d){if(_0x25f95d){_0x1e8a31=!![];var _0x5347c7='';var _0x225161={'format':_0x0b01('0xbf'),'border':_0x0b01('0xc0')};fs[_0x0b01('0xc1')](_0x3bb3c5);_0x5347c7+=util[_0x0b01('0x82')](_0x0b01('0xc2'),_0x25f95d['id']);_0x5347c7+=util[_0x0b01('0x82')]('

Date:\x20%s

',moment()[_0x0b01('0x82')](_0x0b01('0xc3'))[_0x0b01('0xb8')]());_0x5347c7+=_0x0b01('0xc4');for(var _0x298035=0x1;_0x298035<_0x25f95d[_0x0b01('0x61')][_0x0b01('0x41')];_0x298035++){var _0x30d04f=_0x25f95d[_0x0b01('0x61')][_0x298035];_0x5347c7+=_0x0b01('0xc5');_0x5347c7+=util[_0x0b01('0x82')]('%s:\x20%s

',_0x30d04f[_0x0b01('0x59')]?_0x30d04f[_0x0b01('0x59')]['fullname']:_0x30d04f['Contact']['firstName'],_0x30d04f[_0x0b01('0x69')]);_0x5347c7+='';if(_0x30d04f[_0x0b01('0x76')]){var _0x3fc26a=_0x30d04f[_0x0b01('0x76')];var _0x2174db=path[_0x0b01('0x80')](_0x573280,_0x3fc26a[_0x0b01('0x73')]);if(fs[_0x0b01('0xc6')](_0x2174db)){fs[_0x0b01('0xc7')](_0x2174db)[_0x0b01('0xc8')](fs['createWriteStream'](path[_0x0b01('0x80')](_0x3bb3c5,_0x3fc26a[_0x0b01('0x73')])));}}}return new BPromise(function(_0x4018dd,_0xda1572){pdf[_0x0b01('0x68')](_0x5347c7,_0x225161)['toFile'](path[_0x0b01('0x80')](_0x3bb3c5,'interaction-'+_0x1b3e8d+_0x0b01('0xc9')),function(_0x150de6,_0x153dcb){if(_0x150de6)return _0xda1572(_0x150de6);_0x4018dd(_0x153dcb);});});}})[_0x0b01('0x57')](function(){if(_0x1e8a31){return new BPromise(function(_0x13b151,_0x15fa60){zipdir(_0x3bb3c5,{'saveTo':_0x3c660a},function(_0xd83305,_0x3745f5){if(_0xd83305)return _0x15fa60(_0xd83305);return _0x13b151(_0x3745f5);});});}})[_0x0b01('0x57')](function(){if(_0x1e8a31){return new BPromise(function(_0x556976,_0x28ed50){rimraf(_0x3bb3c5,function(_0x2410c6){if(_0x2410c6)_0x28ed50(_0x2410c6);return _0x556976();});});}})[_0x0b01('0x57')](function(){if(_0x1e8a31){return _0x515ad5[_0x0b01('0x7b')](_0x3c660a,_0x447f72,function(_0x59c54d){if(_0x59c54d){console['log']('err',_0x59c54d);}else{fs[_0x0b01('0xca')](_0x3c660a);}});}else{return _0x515ad5[_0x0b01('0x29')](0xc8);}})[_0x0b01('0x64')](handleError(_0x515ad5,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 752611e..da54bd3 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 _0x3de9=['hasOwnProperty','hook','exports','../../mysqldb','save','update','remove','emit'];(function(_0x3fb754,_0x541abc){var _0x291a02=function(_0x299777){while(--_0x299777){_0x3fb754['push'](_0x3fb754['shift']());}};_0x291a02(++_0x541abc);}(_0x3de9,0xdb));var _0x93de=function(_0x110204,_0x55348d){_0x110204=_0x110204-0x0;var _0x46d16d=_0x3de9[_0x110204];return _0x46d16d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x93de('0x0'))['db']['ChatInteraction'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x93de('0x1'),'afterUpdate':_0x93de('0x2'),'afterDestroy':_0x93de('0x3')};function emitEvent(_0x237522){return function(_0x87a26c,_0xa5fa9a,_0x461e84){ChatInteractionEvents['emit'](_0x237522+':'+_0x87a26c['id'],_0x87a26c);ChatInteractionEvents[_0x93de('0x4')](_0x237522,_0x87a26c);_0x461e84(null);};}for(var e in events){if(events[_0x93de('0x5')](e)){var event=events[e];ChatInteraction[_0x93de('0x6')](e,emitEvent(event));}}module[_0x93de('0x7')]=ChatInteractionEvents; \ No newline at end of file +var _0x6e41=['setMaxListeners','save','update','emit','exports','ChatInteraction'];(function(_0x5aea96,_0xea1e08){var _0x2cb3f1=function(_0x25711f){while(--_0x25711f){_0x5aea96['push'](_0x5aea96['shift']());}};_0x2cb3f1(++_0xea1e08);}(_0x6e41,0xbf));var _0x16e4=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x6e41[_0x4e9d3c];return _0x2d0825;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x16e4('0x0')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x16e4('0x1')](0x0);var events={'afterCreate':_0x16e4('0x2'),'afterUpdate':_0x16e4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4f6472){return function(_0x29c21c,_0x42c439,_0x460c28){ChatInteractionEvents[_0x16e4('0x4')](_0x4f6472+':'+_0x29c21c['id'],_0x29c21c);ChatInteractionEvents[_0x16e4('0x4')](_0x4f6472,_0x29c21c);_0x460c28(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x16e4('0x5')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 0934f89..4b431a5 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 _0x3240=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dbfc1,_0x3a1a44){var _0x513ef5=function(_0x5150da){while(--_0x5150da){_0x3dbfc1['push'](_0x3dbfc1['shift']());}};_0x513ef5(++_0x3a1a44);}(_0x3240,0x1a2));var _0x0324=function(_0x4141e8,_0x5e6fb4){_0x4141e8=_0x4141e8-0x0;var _0x5395ed=_0x3240[_0x4141e8];return _0x5395ed;};'use strict';var _=require(_0x0324('0x0'));var util=require(_0x0324('0x1'));var logger=require(_0x0324('0x2'))(_0x0324('0x3'));var moment=require(_0x0324('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x0324('0x5'));module[_0x0324('0x6')]=function(_0x562a05,_0x18d188){return _0x562a05['define'](_0x0324('0x7'),attributes,{'tableName':_0x0324('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xbe13b0,_0x2a7586,_0x475cec){if(_0xbe13b0[_0x0324('0x9')](_0x0324('0xa'))){_0xbe13b0[_0x0324('0xb')]=moment()[_0x0324('0xc')](_0x0324('0xd'));}_0x475cec(null,_0xbe13b0);}},'charset':_0x0324('0xe'),'collate':_0x0324('0xf')});}; \ No newline at end of file +var _0x8de5=['bluebird','request-promise','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','../../config/logger','api','moment'];(function(_0x21eff8,_0x55092b){var _0x37fb63=function(_0x54640d){while(--_0x54640d){_0x21eff8['push'](_0x21eff8['shift']());}};_0x37fb63(++_0x55092b);}(_0x8de5,0xec));var _0x58de=function(_0x5338f8,_0x5ef8c8){_0x5338f8=_0x5338f8-0x0;var _0x1380db=_0x8de5[_0x5338f8];return _0x1380db;};'use strict';var _=require(_0x58de('0x0'));var util=require('util');var logger=require(_0x58de('0x1'))(_0x58de('0x2'));var moment=require(_0x58de('0x3'));var BPromise=require(_0x58de('0x4'));var rp=require(_0x58de('0x5'));var attributes=require(_0x58de('0x6'));module[_0x58de('0x7')]=function(_0x34b0c2,_0x2a1a79){return _0x34b0c2[_0x58de('0x8')](_0x58de('0x9'),attributes,{'tableName':_0x58de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32c1d6,_0x3f6b9c,_0x5ab112){if(_0x32c1d6['changed'](_0x58de('0xb'))){_0x32c1d6['closedAt']=moment()[_0x58de('0xc')](_0x58de('0xd'));}_0x5ab112(null,_0x32c1d6);}},'charset':_0x58de('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 25dde52..4a15747 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 _0xdfac=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','AddTagsToChatInteraction','find','where','addTags','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','info','request\x20sent'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xdfac,0x1e5));var _0xcdfa=function(_0x11722b,_0x247eb2){_0x11722b=_0x11722b-0x0;var _0x2065f0=_0xdfac[_0x11722b];return _0x2065f0;};'use strict';var _=require(_0xcdfa('0x0'));var util=require('util');var moment=require(_0xcdfa('0x1'));var BPromise=require(_0xcdfa('0x2'));var rs=require(_0xcdfa('0x3'));var fs=require('fs');var Redis=require(_0xcdfa('0x4'));var db=require(_0xcdfa('0x5'))['db'];var utils=require(_0xcdfa('0x6'));var logger=require(_0xcdfa('0x7'))('rpc');var config=require(_0xcdfa('0x8'));var jayson=require(_0xcdfa('0x9'));var client=jayson[_0xcdfa('0xa')][_0xcdfa('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xcdfa('0xc')],{'host':_0xcdfa('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')[_0xcdfa('0xe')](socket);function respondWithRpcPromise(_0x18de2a,_0x283051,_0xfc03a7){return new BPromise(function(_0x43a7b2,_0x362df0){return client[_0xcdfa('0xf')](_0x18de2a,_0xfc03a7)[_0xcdfa('0x10')](function(_0x3ea67d){logger[_0xcdfa('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x283051,_0xcdfa('0x12'));logger[_0xcdfa('0x13')](_0xcdfa('0x14'),_0x283051,'request\x20sent',JSON[_0xcdfa('0x15')](_0x3ea67d));if(_0x3ea67d[_0xcdfa('0x16')]){if(_0x3ea67d[_0xcdfa('0x16')]['code']===0x1f4){logger[_0xcdfa('0x16')](_0xcdfa('0x17'),_0x283051,_0x3ea67d[_0xcdfa('0x16')][_0xcdfa('0x18')]);return _0x362df0(_0x3ea67d[_0xcdfa('0x16')][_0xcdfa('0x18')]);}logger[_0xcdfa('0x16')](_0xcdfa('0x17'),_0x283051,_0x3ea67d[_0xcdfa('0x16')]['message']);return _0x43a7b2(_0x3ea67d[_0xcdfa('0x16')]['message']);}else{logger[_0xcdfa('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x283051,_0xcdfa('0x12'));_0x43a7b2(_0x3ea67d[_0xcdfa('0x19')]['message']);}})[_0xcdfa('0x1a')](function(_0x246268){logger['error'](_0xcdfa('0x17'),_0x283051,_0x246268);_0x362df0(_0x246268);});});}exports[_0xcdfa('0x1b')]=function(_0x5098b2){var _0xfc019d=this;return new Promise(function(_0x4a8d34,_0x5f0e0c){return db[_0xcdfa('0x1c')][_0xcdfa('0x1d')](_0x5098b2[_0xcdfa('0x1e')],{'raw':_0x5098b2[_0xcdfa('0x1f')]?_0x5098b2[_0xcdfa('0x1f')][_0xcdfa('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5098b2['options']?_0x5098b2[_0xcdfa('0x1f')]['where']||null:null,'attributes':_0x5098b2[_0xcdfa('0x1f')]?_0x5098b2[_0xcdfa('0x1f')][_0xcdfa('0x21')]||null:null,'limit':_0x5098b2[_0xcdfa('0x1f')]?_0x5098b2[_0xcdfa('0x1f')][_0xcdfa('0x22')]||null:null})[_0xcdfa('0x10')](function(_0x439342){logger[_0xcdfa('0x11')](_0xcdfa('0x1b'),_0x5098b2);logger[_0xcdfa('0x13')](_0xcdfa('0x1b'),_0x5098b2,JSON['stringify'](_0x439342));_0x4a8d34(_0x439342);})[_0xcdfa('0x1a')](function(_0x51e42d){logger[_0xcdfa('0x16')]('UpdateChatInteraction',_0x51e42d['message'],_0x5098b2);_0x5f0e0c(_0xfc019d[_0xcdfa('0x16')](0x1f4,_0x51e42d[_0xcdfa('0x18')]));});});};exports[_0xcdfa('0x23')]=function(_0x4d9ea7){return new Promise(function(_0xb2126b,_0x3ff302){return db[_0xcdfa('0x1c')][_0xcdfa('0x24')]({'where':_0x4d9ea7['options']?_0x4d9ea7[_0xcdfa('0x1f')][_0xcdfa('0x25')]||null:null})['then'](function(_0x4d1b78){if(_0x4d1b78){return _0x4d1b78[_0xcdfa('0x26')](_0x4d9ea7['body'][_0xcdfa('0x27')],_['omit'](_0x4d9ea7[_0xcdfa('0x1e')],[_0xcdfa('0x27'),'id'])||{});}})[_0xcdfa('0x28')](function(_0x325336){logger[_0xcdfa('0x11')](_0xcdfa('0x29'),_0x4d9ea7);logger[_0xcdfa('0x13')](_0xcdfa('0x29'),_0x4d9ea7,JSON[_0xcdfa('0x15')](_0x325336));_0xb2126b(_0x325336);})[_0xcdfa('0x1a')](function(_0x5050c6){logger[_0xcdfa('0x16')](_0xcdfa('0x29'),_0x5050c6[_0xcdfa('0x18')],_0x4d9ea7);_0x3ff302(_this[_0xcdfa('0x16')](0x1f4,_0x5050c6['message']));});});}; \ No newline at end of file +var _0x1f87=['catch','find','addTags','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateChatInteraction','ChatInteraction','body','options','raw','where'];(function(_0x3a73bc,_0x550aef){var _0x32891b=function(_0x20b4cb){while(--_0x20b4cb){_0x3a73bc['push'](_0x3a73bc['shift']());}};_0x32891b(++_0x550aef);}(_0x1f87,0x1cd));var _0x71f8=function(_0x58fcda,_0x1c3d13){_0x58fcda=_0x58fcda-0x0;var _0x8e4b88=_0x1f87[_0x58fcda];return _0x8e4b88;};'use strict';var _=require(_0x71f8('0x0'));var util=require(_0x71f8('0x1'));var moment=require(_0x71f8('0x2'));var BPromise=require(_0x71f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71f8('0x4'));var db=require(_0x71f8('0x5'))['db'];var utils=require(_0x71f8('0x6'));var logger=require(_0x71f8('0x7'))(_0x71f8('0x8'));var config=require(_0x71f8('0x9'));var jayson=require(_0x71f8('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x71f8('0xb')]=_[_0x71f8('0xc')](config[_0x71f8('0xb')],{'host':_0x71f8('0xd'),'port':0x18eb});var socket=require(_0x71f8('0xe'))(new Redis(config[_0x71f8('0xb')]));require(_0x71f8('0xf'))[_0x71f8('0x10')](socket);function respondWithRpcPromise(_0x53fe65,_0x515729,_0x2412ef){return new BPromise(function(_0x41329a,_0x5c6b12){return client[_0x71f8('0x11')](_0x53fe65,_0x2412ef)[_0x71f8('0x12')](function(_0x133567){logger[_0x71f8('0x13')](_0x71f8('0x14'),_0x515729,_0x71f8('0x15'));logger[_0x71f8('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x515729,'request\x20sent',JSON[_0x71f8('0x17')](_0x133567));if(_0x133567[_0x71f8('0x18')]){if(_0x133567[_0x71f8('0x18')][_0x71f8('0x19')]===0x1f4){logger['error'](_0x71f8('0x14'),_0x515729,_0x133567[_0x71f8('0x18')][_0x71f8('0x1a')]);return _0x5c6b12(_0x133567[_0x71f8('0x18')][_0x71f8('0x1a')]);}logger[_0x71f8('0x18')](_0x71f8('0x14'),_0x515729,_0x133567[_0x71f8('0x18')]['message']);return _0x41329a(_0x133567[_0x71f8('0x18')][_0x71f8('0x1a')]);}else{logger[_0x71f8('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x515729,_0x71f8('0x15'));_0x41329a(_0x133567['result'][_0x71f8('0x1a')]);}})['catch'](function(_0x47df98){logger[_0x71f8('0x18')](_0x71f8('0x14'),_0x515729,_0x47df98);_0x5c6b12(_0x47df98);});});}exports[_0x71f8('0x1b')]=function(_0x16ee57){var _0x5654b2=this;return new Promise(function(_0xdaf5bb,_0x47b574){return db[_0x71f8('0x1c')]['update'](_0x16ee57[_0x71f8('0x1d')],{'raw':_0x16ee57[_0x71f8('0x1e')]?_0x16ee57[_0x71f8('0x1e')][_0x71f8('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16ee57[_0x71f8('0x1e')]?_0x16ee57[_0x71f8('0x1e')][_0x71f8('0x20')]||null:null,'attributes':_0x16ee57['options']?_0x16ee57['options']['attributes']||null:null,'limit':_0x16ee57['options']?_0x16ee57[_0x71f8('0x1e')]['limit']||null:null})['then'](function(_0x3c55ed){logger[_0x71f8('0x13')](_0x71f8('0x1b'),_0x16ee57);logger[_0x71f8('0x16')](_0x71f8('0x1b'),_0x16ee57,JSON[_0x71f8('0x17')](_0x3c55ed));_0xdaf5bb(_0x3c55ed);})[_0x71f8('0x21')](function(_0x2c42cf){logger['error'](_0x71f8('0x1b'),_0x2c42cf[_0x71f8('0x1a')],_0x16ee57);_0x47b574(_0x5654b2[_0x71f8('0x18')](0x1f4,_0x2c42cf[_0x71f8('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x3c6558){return new Promise(function(_0x4d7e50,_0x5c0f54){return db[_0x71f8('0x1c')][_0x71f8('0x22')]({'where':_0x3c6558[_0x71f8('0x1e')]?_0x3c6558['options']['where']||null:null})['then'](function(_0x58a10e){if(_0x58a10e){return _0x58a10e[_0x71f8('0x23')](_0x3c6558[_0x71f8('0x1d')][_0x71f8('0x24')],_['omit'](_0x3c6558[_0x71f8('0x1d')],[_0x71f8('0x24'),'id'])||{});}})['spread'](function(_0xfa68e1){logger[_0x71f8('0x13')](_0x71f8('0x25'),_0x3c6558);logger[_0x71f8('0x16')](_0x71f8('0x25'),_0x3c6558,JSON['stringify'](_0xfa68e1));_0x4d7e50(_0xfa68e1);})['catch'](function(_0x44b644){logger[_0x71f8('0x18')](_0x71f8('0x25'),_0x44b644[_0x71f8('0x1a')],_0x3c6558);_0x5c0f54(_this[_0x71f8('0x18')](0x1f4,_0x44b644[_0x71f8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 33d02c6..387583a 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 _0xcc9e=['./chatInteraction.events','remove','update','length','chatInteraction:'];(function(_0x41d1bd,_0x3775c6){var _0x3ca840=function(_0x39b504){while(--_0x39b504){_0x41d1bd['push'](_0x41d1bd['shift']());}};_0x3ca840(++_0x3775c6);}(_0xcc9e,0x118));var _0xecc9=function(_0x2e2d43,_0x6ba2b2){_0x2e2d43=_0x2e2d43-0x0;var _0x4b621a=_0xcc9e[_0x2e2d43];return _0x4b621a;};'use strict';var ChatInteractionEvents=require(_0xecc9('0x0'));var events=['save',_0xecc9('0x1'),_0xecc9('0x2')];function createListener(_0x590184,_0x1eb985){return function(_0x5d3f6c){_0x1eb985['emit'](_0x590184,_0x5d3f6c);};}function removeListener(_0x156c38,_0xae9e02){return function(){ChatInteractionEvents['removeListener'](_0x156c38,_0xae9e02);};}exports['register']=function(_0x17059a){for(var _0x4a76ac=0x0,_0xfe899c=events[_0xecc9('0x3')];_0x4a76ac<_0xfe899c;_0x4a76ac++){var _0x169700=events[_0x4a76ac];var _0x1e8e6b=createListener(_0xecc9('0x4')+_0x169700,_0x17059a);ChatInteractionEvents['on'](_0x169700,_0x1e8e6b);}}; \ No newline at end of file +var _0x271d=['update','emit','register','./chatInteraction.events','save','remove'];(function(_0x43b08c,_0x15e99e){var _0x3c2958=function(_0x360304){while(--_0x360304){_0x43b08c['push'](_0x43b08c['shift']());}};_0x3c2958(++_0x15e99e);}(_0x271d,0x111));var _0xd271=function(_0x3b0df8,_0x42c399){_0x3b0df8=_0x3b0df8-0x0;var _0x1533c2=_0x271d[_0x3b0df8];return _0x1533c2;};'use strict';var ChatInteractionEvents=require(_0xd271('0x0'));var events=[_0xd271('0x1'),_0xd271('0x2'),_0xd271('0x3')];function createListener(_0x2f7814,_0x3bfaec){return function(_0x94e5b1){_0x3bfaec[_0xd271('0x4')](_0x2f7814,_0x94e5b1);};}function removeListener(_0x4755e8,_0x24cf7a){return function(){ChatInteractionEvents['removeListener'](_0x4755e8,_0x24cf7a);};}exports[_0xd271('0x5')]=function(_0x4322e5){for(var _0x203aaf=0x0,_0x3d8dd3=events['length'];_0x203aaf<_0x3d8dd3;_0x203aaf++){var _0x4cbc9a=events[_0x203aaf];var _0x488fd0=createListener('chatInteraction:'+_0x4cbc9a,_0x4322e5);ChatInteractionEvents['on'](_0x4cbc9a,_0x488fd0);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index aa9bdad..6ac2db3 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 _0x4213=['root','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','join'];(function(_0x521e8d,_0x23a290){var _0x518bbd=function(_0x4241eb){while(--_0x4241eb){_0x521e8d['push'](_0x521e8d['shift']());}};_0x518bbd(++_0x23a290);}(_0x4213,0x77));var _0x3421=function(_0x559432,_0x3961bb){_0x559432=_0x559432-0x0;var _0x4499e8=_0x4213[_0x559432];return _0x4499e8;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var auth=require(_0x3421('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3421('0x7'));var controller=require('./chatInteraction.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xa')]);router[_0x3421('0x8')]('/describe',auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0x8')](_0x3421('0xc'),auth[_0x3421('0xd')](),controller['show']);router[_0x3421('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x3421('0xe')]);router['get'](_0x3421('0xf'),auth[_0x3421('0x9')](),controller[_0x3421('0x10')]);router[_0x3421('0x8')](_0x3421('0x11'),auth[_0x3421('0xd')](),controller[_0x3421('0x12')]);router['get'](_0x3421('0x13'),auth[_0x3421('0x9')](),controller[_0x3421('0x14')]);router[_0x3421('0x15')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0x16')]);var upload=multer({'storage':multer[_0x3421('0x17')]({'destination':function(_0x59ea4a,_0xafd9e0,_0x4b5f43){_0x4b5f43(null,path[_0x3421('0x18')](config[_0x3421('0x19')],'server/files/attachments/'));},'filename':function(_0x1e33ab,_0x4c6f7b,_0x16bc8f){_0x16bc8f(null,util[_0x3421('0x1a')]('%s-%s',Date[_0x3421('0x1b')](),_0x4c6f7b[_0x3421('0x1c')][_0x3421('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3421('0x15')](_0x3421('0x1e'),upload[_0x3421('0x1f')](_0x3421('0x20')),controller[_0x3421('0x21')]);router[_0x3421('0x15')](_0x3421('0xf'),auth[_0x3421('0xd')](),controller['addMessage']);router[_0x3421('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0x3421('0x22'),_0x3421('0x23')),controller[_0x3421('0x24')]);router[_0x3421('0x25')](_0x3421('0xc'),auth[_0x3421('0x9')](),interaction[_0x3421('0x26')](_0x3421('0x22'),_0x3421('0x27')),controller[_0x3421('0x28')]);router['put']('/:id/custom_update',controller['customUpdate']);router[_0x3421('0x25')](_0x3421('0x29'),auth[_0x3421('0xd')](),controller['abandon']);router['put'](_0x3421('0x2a'),controller['close']);router[_0x3421('0x2b')]('/:id',auth[_0x3421('0x9')](),interaction[_0x3421('0x26')](_0x3421('0x22'),_0x3421('0x2c')),controller[_0x3421('0x2d')]);router['delete'](_0x3421('0x2e'),auth['isAuthenticated'](),controller['removeTags']);module[_0x3421('0x2f')]=router; \ No newline at end of file +var _0xb9a7=['/:id/attachment_upload','single','file','attachmentUpload','addMessage','chat','addTags','put','tracked','update','/:id/custom_update','customUpdate','abandon','/:id/close','delete','removeTags','util','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace'];(function(_0x157aaf,_0xae90c8){var _0x3efcdc=function(_0x2fec1b){while(--_0x2fec1b){_0x157aaf['push'](_0x157aaf['shift']());}};_0x3efcdc(++_0xae90c8);}(_0xb9a7,0x112));var _0x7b9a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xb9a7[_0x45d55e];return _0x29812a;};'use strict';var multer=require('multer');var util=require(_0x7b9a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b9a('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x7b9a('0x2'));var config=require(_0x7b9a('0x3'));var controller=require(_0x7b9a('0x4'));router[_0x7b9a('0x5')]('/',auth[_0x7b9a('0x6')](),controller[_0x7b9a('0x7')]);router[_0x7b9a('0x5')](_0x7b9a('0x8'),auth[_0x7b9a('0x6')](),controller[_0x7b9a('0x9')]);router['get'](_0x7b9a('0xa'),auth[_0x7b9a('0xb')](),controller['show']);router['get']('/:id/attachment_download',auth[_0x7b9a('0xb')](),controller[_0x7b9a('0xc')]);router['get'](_0x7b9a('0xd'),auth['isAuthenticated'](),controller[_0x7b9a('0xe')]);router['get'](_0x7b9a('0xf'),auth[_0x7b9a('0xb')](),controller[_0x7b9a('0x10')]);router['get'](_0x7b9a('0x11'),auth[_0x7b9a('0x6')](),controller['download']);router[_0x7b9a('0x12')]('/',auth[_0x7b9a('0x6')](),controller['create']);var upload=multer({'storage':multer[_0x7b9a('0x13')]({'destination':function(_0xde180d,_0x6fa16a,_0x2853f2){_0x2853f2(null,path[_0x7b9a('0x14')](config[_0x7b9a('0x15')],_0x7b9a('0x16')));},'filename':function(_0x35e602,_0x2f1899,_0x4996f1){_0x4996f1(null,util[_0x7b9a('0x17')]('%s-%s',Date[_0x7b9a('0x18')](),_0x2f1899[_0x7b9a('0x19')][_0x7b9a('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7b9a('0x12')](_0x7b9a('0x1b'),upload[_0x7b9a('0x1c')](_0x7b9a('0x1d')),controller[_0x7b9a('0x1e')]);router[_0x7b9a('0x12')](_0x7b9a('0xd'),auth[_0x7b9a('0xb')](),controller[_0x7b9a('0x1f')]);router[_0x7b9a('0x12')]('/:id/tags',auth[_0x7b9a('0x6')](),interaction['tracked'](_0x7b9a('0x20'),'chatinteraction:addtags'),controller[_0x7b9a('0x21')]);router[_0x7b9a('0x22')](_0x7b9a('0xa'),auth['isAuthenticated'](),interaction[_0x7b9a('0x23')](_0x7b9a('0x20'),'chatinteraction:update'),controller[_0x7b9a('0x24')]);router[_0x7b9a('0x22')](_0x7b9a('0x25'),controller[_0x7b9a('0x26')]);router[_0x7b9a('0x22')]('/:id/abandon',auth[_0x7b9a('0xb')](),controller[_0x7b9a('0x27')]);router['put'](_0x7b9a('0x28'),controller['close']);router[_0x7b9a('0x29')](_0x7b9a('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0x7b9a('0x20'),'chatinteraction:destroy'),controller['destroy']);router[_0x7b9a('0x29')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7b9a('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index f6491be..a7d702d 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 _0x3024=['sequelize','exports','medium','BOOLEAN'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3024,0x64));var _0x4302=function(_0x85a479,_0x11210b){_0x85a479=_0x85a479-0x0;var _0x48861c=_0x3024[_0x85a479];return _0x48861c;};'use strict';var Sequelize=require(_0x4302('0x0'));module[_0x4302('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4302('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4302('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8374=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x8374,0x174));var _0x4837=function(_0x3519dd,_0x510dae){_0x3519dd=_0x3519dd-0x0;var _0x1ff3ab=_0x8374[_0x3519dd];return _0x1ff3ab;};'use strict';var Sequelize=require(_0x4837('0x0'));module[_0x4837('0x1')]={'body':{'type':Sequelize[_0x4837('0x2')](_0x4837('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4837('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4837('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index ba9d735..1d02be2 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 _0xb1ed=['lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','admin','fullname','role','userpic','internal','lastLoginAt','showWebBar','-online','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','length','push','FromId','ToId','read','-createdAt','all','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','error','stack','name','ChatInternalMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','map','type','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','show','params','merge','find','create','body','destroy','describe','get','messages'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb1ed,0x8b));var _0xdb1e=function(_0x58803c,_0x4a34df){_0x58803c=_0x58803c-0x0;var _0xf95b9b=_0xb1ed[_0x58803c];return _0xf95b9b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xdb1e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdb1e('0x1'));var moment=require(_0xdb1e('0x2'));var BPromise=require(_0xdb1e('0x3'));var Mustache=require(_0xdb1e('0x4'));var util=require(_0xdb1e('0x5'));var path=require(_0xdb1e('0x6'));var sox=require(_0xdb1e('0x7'));var csv=require('to-csv');var ejs=require(_0xdb1e('0x8'));var fs=require('fs');var _=require(_0xdb1e('0x9'));var squel=require('squel');var crypto=require(_0xdb1e('0xa'));var jsforce=require(_0xdb1e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdb1e('0xc'));var querystring=require(_0xdb1e('0xd'));var Papa=require(_0xdb1e('0xe'));var authService=require(_0xdb1e('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xdb1e('0x10'));var qs=require(_0xdb1e('0x11'));var logger=require(_0xdb1e('0x12'))(_0xdb1e('0x13'));var utils=require('../../config/utils');var config=require(_0xdb1e('0x14'));var db=require('../../mysqldb')['db'];config[_0xdb1e('0x15')]=_[_0xdb1e('0x16')](config[_0xdb1e('0x15')],{'host':_0xdb1e('0x17'),'port':0x18eb});var socket=require(_0xdb1e('0x18'))(new Redis(config['redis']));require(_0xdb1e('0x19'))[_0xdb1e('0x1a')](socket);function respondWithStatusCode(_0x2959ad,_0x47ada8){_0x47ada8=_0x47ada8||0xcc;return function(_0x2ac090){if(_0x2ac090){return _0x2959ad[_0xdb1e('0x1b')](_0x47ada8);}return _0x2959ad[_0xdb1e('0x1c')](_0x47ada8)[_0xdb1e('0x1d')]();};}function respondWithResult(_0x4bc7b1,_0x594467){_0x594467=_0x594467||0xc8;return function(_0x5383f3){if(_0x5383f3){return _0x4bc7b1[_0xdb1e('0x1c')](_0x594467)[_0xdb1e('0x1e')](_0x5383f3);}};}function respondWithFilteredResult(_0x1e0d9b,_0x54d3ca){return function(_0x4915c7){if(_0x4915c7){var _0x26bfce=_0x4915c7[_0xdb1e('0x1f')],_0x20a382=_0x54d3ca[_0xdb1e('0x20')],_0x3a1aa8=_0x54d3ca[_0xdb1e('0x20')]+_0x54d3ca[_0xdb1e('0x21')],_0x4c1cd2;if(_0x3a1aa8>=_0x26bfce){_0x3a1aa8=_0x26bfce;_0x4c1cd2=0xc8;}else{_0x4c1cd2=0xce;}_0x1e0d9b[_0xdb1e('0x1c')](_0x4c1cd2);return _0x1e0d9b[_0xdb1e('0x22')]('Content-Range',_0x20a382+'-'+_0x3a1aa8+'/'+_0x26bfce)[_0xdb1e('0x1e')](_0x4915c7);}return null;};}function patchUpdates(_0x2b0b51){return function(_0x1d513b){try{jsonpatch['apply'](_0x1d513b,_0x2b0b51,!![]);}catch(_0x391874){return BPromise[_0xdb1e('0x23')](_0x391874);}return _0x1d513b[_0xdb1e('0x24')]();};}function saveUpdates(_0xbe3c52,_0xec0563){return function(_0x406dea){if(_0x406dea){return _0x406dea[_0xdb1e('0x25')](_0xbe3c52)['then'](function(_0x34edcc){return _0x34edcc;});}return null;};}function removeEntity(_0x52b811,_0x3379a4){return function(_0x547cdd){if(_0x547cdd){return _0x547cdd['destroy']()[_0xdb1e('0x26')](function(){_0x52b811[_0xdb1e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47943c,_0x4c9e22){return function(_0x82bb2e){if(!_0x82bb2e){_0x47943c[_0xdb1e('0x1b')](0x194);}return _0x82bb2e;};}function handleError(_0x7c375d,_0x4cb43b){_0x4cb43b=_0x4cb43b||0x1f4;return function(_0x11e03e){logger[_0xdb1e('0x27')](_0x11e03e[_0xdb1e('0x28')]);if(_0x11e03e['name']){delete _0x11e03e[_0xdb1e('0x29')];}_0x7c375d['status'](_0x4cb43b)['send'](_0x11e03e);};}exports['index']=function(_0xc1e269,_0x32b80f){var _0x40c94c={},_0x11415f={},_0xe79866={'count':0x0,'rows':[]};var _0x50d425=db[_0xdb1e('0x2a')][_0xdb1e('0x2b')];_0x11415f[_0xdb1e('0x2c')]=_['keys'](_0x50d425);_0x11415f[_0xdb1e('0x2d')]=_[_0xdb1e('0x2e')](_0xc1e269[_0xdb1e('0x2d')]);_0x11415f[_0xdb1e('0x2f')]=_[_0xdb1e('0x30')](_0x11415f[_0xdb1e('0x2c')],_0x11415f['query']);_0x40c94c[_0xdb1e('0x31')]=_[_0xdb1e('0x30')](_0x11415f['model'],qs[_0xdb1e('0x32')](_0xc1e269['query']['fields']));_0x40c94c[_0xdb1e('0x31')]=_0x40c94c[_0xdb1e('0x31')]['length']?_0x40c94c[_0xdb1e('0x31')]:_0x11415f['model'];if(!_0xc1e269[_0xdb1e('0x2d')][_0xdb1e('0x33')](_0xdb1e('0x34'))){_0x40c94c['limit']=qs['limit'](_0xc1e269[_0xdb1e('0x2d')][_0xdb1e('0x21')]);_0x40c94c['offset']=qs[_0xdb1e('0x20')](_0xc1e269[_0xdb1e('0x2d')][_0xdb1e('0x20')]);}_0x40c94c['order']=qs[_0xdb1e('0x35')](_0xc1e269[_0xdb1e('0x2d')]['sort']);_0x40c94c[_0xdb1e('0x36')]=qs['filters'](_[_0xdb1e('0x37')](_0xc1e269[_0xdb1e('0x2d')],_0x11415f[_0xdb1e('0x2f')]));if(_0xc1e269['query']['filter']){_0x40c94c[_0xdb1e('0x36')]=_['merge'](_0x40c94c[_0xdb1e('0x36')],{'$or':_[_0xdb1e('0x38')](_0x50d425,function(_0x400a99){if(_0x400a99[_0xdb1e('0x39')][_0xdb1e('0x3a')]!==_0xdb1e('0x3b')){var _0xd0447={};_0xd0447[_0x400a99[_0xdb1e('0x3c')]]={'$like':'%'+_0xc1e269[_0xdb1e('0x2d')][_0xdb1e('0x3d')]+'%'};return _0xd0447;}})});}_0x40c94c=_['merge']({},_0x40c94c,_0xc1e269[_0xdb1e('0x3e')]);var _0x35420f={'where':_0x40c94c[_0xdb1e('0x36')]};return db['ChatInternalMessage']['count'](_0x35420f)[_0xdb1e('0x26')](function(_0x163fde){_0xe79866[_0xdb1e('0x1f')]=_0x163fde;if(_0xc1e269[_0xdb1e('0x2d')][_0xdb1e('0x3f')]){_0x40c94c[_0xdb1e('0x40')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x40c94c);})[_0xdb1e('0x26')](function(_0x9626){_0xe79866[_0xdb1e('0x41')]=_0x9626;return _0xe79866;})[_0xdb1e('0x26')](respondWithFilteredResult(_0x32b80f,_0x40c94c))[_0xdb1e('0x42')](handleError(_0x32b80f,null));};exports[_0xdb1e('0x43')]=function(_0x4e0384,_0x51ab76){var _0x373dae={'raw':!![],'where':{'id':_0x4e0384[_0xdb1e('0x44')]['id']}},_0xfaf743={};_0xfaf743[_0xdb1e('0x2c')]=_[_0xdb1e('0x2e')](db[_0xdb1e('0x2a')]['rawAttributes']);_0xfaf743[_0xdb1e('0x2d')]=_[_0xdb1e('0x2e')](_0x4e0384[_0xdb1e('0x2d')]);_0xfaf743[_0xdb1e('0x2f')]=_[_0xdb1e('0x30')](_0xfaf743[_0xdb1e('0x2c')],_0xfaf743[_0xdb1e('0x2d')]);_0x373dae['attributes']=_[_0xdb1e('0x30')](_0xfaf743[_0xdb1e('0x2c')],qs['fields'](_0x4e0384[_0xdb1e('0x2d')][_0xdb1e('0x32')]));_0x373dae[_0xdb1e('0x31')]=_0x373dae[_0xdb1e('0x31')]['length']?_0x373dae[_0xdb1e('0x31')]:_0xfaf743[_0xdb1e('0x2c')];if(_0x4e0384[_0xdb1e('0x2d')][_0xdb1e('0x3f')]){_0x373dae[_0xdb1e('0x40')]=[{'all':!![]}];}_0x373dae=_[_0xdb1e('0x45')]({},_0x373dae,_0x4e0384['options']);return db['ChatInternalMessage'][_0xdb1e('0x46')](_0x373dae)[_0xdb1e('0x26')](handleEntityNotFound(_0x51ab76,null))[_0xdb1e('0x26')](respondWithResult(_0x51ab76,null))[_0xdb1e('0x42')](handleError(_0x51ab76,null));};exports[_0xdb1e('0x47')]=function(_0x461e40,_0x33dae2){return db[_0xdb1e('0x2a')][_0xdb1e('0x47')](_0x461e40[_0xdb1e('0x48')],{})[_0xdb1e('0x26')](respondWithResult(_0x33dae2,0xc9))['catch'](handleError(_0x33dae2,null));};exports[_0xdb1e('0x25')]=function(_0x4ac994,_0x1f3096){if(_0x4ac994['body']['id']){delete _0x4ac994['body']['id'];}return db[_0xdb1e('0x2a')]['find']({'where':{'id':_0x4ac994['params']['id']}})['then'](handleEntityNotFound(_0x1f3096,null))[_0xdb1e('0x26')](saveUpdates(_0x4ac994[_0xdb1e('0x48')],null))[_0xdb1e('0x26')](respondWithResult(_0x1f3096,null))['catch'](handleError(_0x1f3096,null));};exports[_0xdb1e('0x49')]=function(_0x42b018,_0x4cd2a8){return db[_0xdb1e('0x2a')][_0xdb1e('0x46')]({'where':{'id':_0x42b018['params']['id']}})[_0xdb1e('0x26')](handleEntityNotFound(_0x4cd2a8,null))['then'](removeEntity(_0x4cd2a8,null))[_0xdb1e('0x42')](handleError(_0x4cd2a8,null));};exports['describe']=function(_0x364272,_0x7288c8){return db[_0xdb1e('0x2a')][_0xdb1e('0x4a')]()[_0xdb1e('0x26')](respondWithResult(_0x7288c8,null))[_0xdb1e('0x42')](handleError(_0x7288c8,null));};function wrapUser(_0x5042c4){return function(_0x54dc52){var _0x2ec113=_0x5042c4[_0xdb1e('0x4b')]({'plain':!![]});_0x2ec113[_0xdb1e('0x4c')]=[];if(_0x54dc52){_0x2ec113[_0xdb1e('0x4d')]=_0x54dc52[_0xdb1e('0x4e')];_0x2ec113['lastMessage']=_0x54dc52;}else{_0x2ec113[_0xdb1e('0x4d')]=moment(0x0)[_0xdb1e('0x4f')](_0xdb1e('0x50'));_0x2ec113[_0xdb1e('0x51')]={};}return _0x2ec113;};}exports[_0xdb1e('0x52')]=function(_0x832032,_0x2a9586,_0xc811b0){var _0x4e4a89=[];return db[_0xdb1e('0x53')][_0xdb1e('0x54')]({'where':{'role':['agent',_0xdb1e('0x55'),'user']},'attributes':['id',_0xdb1e('0x56'),'name',_0xdb1e('0x57'),_0xdb1e('0x58'),_0xdb1e('0x59'),'online',_0xdb1e('0x5a'),'allowmessenger',_0xdb1e('0x5b')],'order':qs['sort'](_0xdb1e('0x5c')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0xdb1e('0x29'),_0xdb1e('0x39')],'through':{'attributes':[]}}]})[_0xdb1e('0x26')](function(_0x319f31){if(_0x319f31){var _0x1bfa86=_0x832032[_0xdb1e('0x5d')][_0xdb1e('0x4b')]({'plain':!![]});if(!_0x1bfa86)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bfa86[_0xdb1e('0x57')]===_0xdb1e('0x5d')){return db[_0xdb1e('0x5e')]['find']({'where':{'name':_0xdb1e('0x5f'),'userProfileId':_0x1bfa86[_0xdb1e('0x60')]},'raw':!![]})[_0xdb1e('0x26')](function(_0x46fbed){if(_0x46fbed){if(_0x46fbed[_0xdb1e('0x61')]===0x0){return db[_0xdb1e('0x62')][_0xdb1e('0x54')]({'where':{'sectionId':_0x46fbed['id']},'raw':!![]})[_0xdb1e('0x26')](function(_0x36f666){var _0x2f4ae8=[];if(_[_0xdb1e('0x63')](_0x36f666)){_0x2f4ae8=_[_0xdb1e('0x3d')](_0x319f31,function(_0x17db6b){if(_0x17db6b[_0xdb1e('0x57')]!==_0xdb1e('0x64')){return _0x17db6b;}});return _0x2f4ae8;}else{for(var _0x59cf94=0x0;_0x59cf94<_0x319f31[_0xdb1e('0x65')];_0x59cf94++){var _0x12fa58=_0x319f31[_0x59cf94];if(_0x12fa58[_0xdb1e('0x57')]===_0xdb1e('0x64')){var _0x364e2e=_[_0xdb1e('0x46')](_0x36f666,function(_0x29cbd1){return _0x29cbd1['resourceId']===_0x12fa58['id'];});if(_0x364e2e)_0x2f4ae8[_0xdb1e('0x66')](_0x12fa58);}else{_0x2f4ae8['push'](_0x12fa58);}}return _0x2f4ae8;}});}else{return _0x319f31;}}else{var _0x33b2c5=_[_0xdb1e('0x3d')](_0x319f31,function(_0x4da48a){if(_0x4da48a['role']!=='agent'){return _0x4da48a;}});return _0x33b2c5;}});}else{return _0x319f31;}}})[_0xdb1e('0x26')](function(_0x5f5107){var _0x50f307=[];if(_0x5f5107){_0x4e4a89=_0x5f5107;for(var _0x2096e3=0x0;_0x2096e3<_0x5f5107[_0xdb1e('0x65')];_0x2096e3+=0x1){_0x4e4a89[_0x2096e3][_0xdb1e('0x4c')]=[];_0x50f307[_0xdb1e('0x66')](db[_0xdb1e('0x2a')]['find']({'where':{'FromId':[_0x832032[_0xdb1e('0x5d')]['id'],_0x5f5107[_0x2096e3]['id']],'ToId':[_0x832032['user']['id'],_0x5f5107[_0x2096e3]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xdb1e('0x67'),_0xdb1e('0x68'),_0xdb1e('0x69'),_0xdb1e('0x48')],'order':qs[_0xdb1e('0x35')](_0xdb1e('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdb1e('0x26')](wrapUser(_0x5f5107[_0x2096e3])));}return BPromise[_0xdb1e('0x6b')](_0x50f307);}return[];})['then'](function(_0xc85200){return{'rows':_0xc85200,'count':_0xc85200[_0xdb1e('0x65')]};})[_0xdb1e('0x26')](respondWithResult(_0x2a9586,null))['catch'](handleError(_0x2a9586,null));}; \ No newline at end of file +var _0x9f82=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','key','field','options','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','role','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','defaults','sendStatus','end','status','json','count','offset','set','Content-Range','reject','save','update','then','stack','name','send','index','ChatInternalMessage','model','keys'];(function(_0x36c01d,_0x554405){var _0x85df9f=function(_0x520f84){while(--_0x520f84){_0x36c01d['push'](_0x36c01d['shift']());}};_0x85df9f(++_0x554405);}(_0x9f82,0x111));var _0x29f8=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x9f82[_0x2b10c6];return _0x3789d2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x29f8('0x0'));var rimraf=require(_0x29f8('0x1'));var zipdir=require(_0x29f8('0x2'));var jsonpatch=require(_0x29f8('0x3'));var rp=require(_0x29f8('0x4'));var moment=require(_0x29f8('0x5'));var BPromise=require(_0x29f8('0x6'));var Mustache=require(_0x29f8('0x7'));var util=require(_0x29f8('0x8'));var path=require(_0x29f8('0x9'));var sox=require(_0x29f8('0xa'));var csv=require(_0x29f8('0xb'));var ejs=require(_0x29f8('0xc'));var fs=require('fs');var _=require(_0x29f8('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x29f8('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x29f8('0xf'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x29f8('0x10'));var qs=require(_0x29f8('0x11'));var logger=require(_0x29f8('0x12'))(_0x29f8('0x13'));var utils=require(_0x29f8('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x29f8('0x15')]=_[_0x29f8('0x16')](config[_0x29f8('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x29f8('0x15')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x1a41bd,_0x6e3a2c){_0x6e3a2c=_0x6e3a2c||0xcc;return function(_0x14335f){if(_0x14335f){return _0x1a41bd[_0x29f8('0x17')](_0x6e3a2c);}return _0x1a41bd['status'](_0x6e3a2c)[_0x29f8('0x18')]();};}function respondWithResult(_0x1990b2,_0x1ebd14){_0x1ebd14=_0x1ebd14||0xc8;return function(_0x4e8a69){if(_0x4e8a69){return _0x1990b2[_0x29f8('0x19')](_0x1ebd14)[_0x29f8('0x1a')](_0x4e8a69);}};}function respondWithFilteredResult(_0x1a362f,_0x307eaa){return function(_0x4706cb){if(_0x4706cb){var _0x795634=_0x4706cb[_0x29f8('0x1b')],_0x57f2e7=_0x307eaa['offset'],_0x32bc33=_0x307eaa[_0x29f8('0x1c')]+_0x307eaa['limit'],_0x2547e3;if(_0x32bc33>=_0x795634){_0x32bc33=_0x795634;_0x2547e3=0xc8;}else{_0x2547e3=0xce;}_0x1a362f[_0x29f8('0x19')](_0x2547e3);return _0x1a362f[_0x29f8('0x1d')](_0x29f8('0x1e'),_0x57f2e7+'-'+_0x32bc33+'/'+_0x795634)[_0x29f8('0x1a')](_0x4706cb);}return null;};}function patchUpdates(_0x21141e){return function(_0xb186a3){try{jsonpatch['apply'](_0xb186a3,_0x21141e,!![]);}catch(_0x568a3b){return BPromise[_0x29f8('0x1f')](_0x568a3b);}return _0xb186a3[_0x29f8('0x20')]();};}function saveUpdates(_0x24a14c,_0x86748c){return function(_0xbbe078){if(_0xbbe078){return _0xbbe078[_0x29f8('0x21')](_0x24a14c)[_0x29f8('0x22')](function(_0x9b175d){return _0x9b175d;});}return null;};}function removeEntity(_0x2703f7,_0x569a29){return function(_0x5672ad){if(_0x5672ad){return _0x5672ad['destroy']()[_0x29f8('0x22')](function(){_0x2703f7[_0x29f8('0x19')](0xcc)[_0x29f8('0x18')]();});}};}function handleEntityNotFound(_0x2d3199,_0x3b9633){return function(_0x1ea772){if(!_0x1ea772){_0x2d3199[_0x29f8('0x17')](0x194);}return _0x1ea772;};}function handleError(_0x285b32,_0x5486fe){_0x5486fe=_0x5486fe||0x1f4;return function(_0x5090ee){logger['error'](_0x5090ee[_0x29f8('0x23')]);if(_0x5090ee['name']){delete _0x5090ee[_0x29f8('0x24')];}_0x285b32['status'](_0x5486fe)[_0x29f8('0x25')](_0x5090ee);};}exports[_0x29f8('0x26')]=function(_0x8c1ef9,_0x9d255b){var _0x527644={},_0x4f9a99={},_0x3cd0aa={'count':0x0,'rows':[]};var _0x15e577=db[_0x29f8('0x27')]['rawAttributes'];_0x4f9a99[_0x29f8('0x28')]=_[_0x29f8('0x29')](_0x15e577);_0x4f9a99['query']=_[_0x29f8('0x29')](_0x8c1ef9[_0x29f8('0x2a')]);_0x4f9a99[_0x29f8('0x2b')]=_[_0x29f8('0x2c')](_0x4f9a99[_0x29f8('0x28')],_0x4f9a99[_0x29f8('0x2a')]);_0x527644[_0x29f8('0x2d')]=_[_0x29f8('0x2c')](_0x4f9a99[_0x29f8('0x28')],qs['fields'](_0x8c1ef9['query'][_0x29f8('0x2e')]));_0x527644[_0x29f8('0x2d')]=_0x527644[_0x29f8('0x2d')][_0x29f8('0x2f')]?_0x527644[_0x29f8('0x2d')]:_0x4f9a99[_0x29f8('0x28')];if(!_0x8c1ef9[_0x29f8('0x2a')][_0x29f8('0x30')](_0x29f8('0x31'))){_0x527644[_0x29f8('0x32')]=qs['limit'](_0x8c1ef9[_0x29f8('0x2a')][_0x29f8('0x32')]);_0x527644[_0x29f8('0x1c')]=qs['offset'](_0x8c1ef9[_0x29f8('0x2a')]['offset']);}_0x527644[_0x29f8('0x33')]=qs[_0x29f8('0x34')](_0x8c1ef9[_0x29f8('0x2a')][_0x29f8('0x34')]);_0x527644['where']=qs[_0x29f8('0x2b')](_[_0x29f8('0x35')](_0x8c1ef9[_0x29f8('0x2a')],_0x4f9a99[_0x29f8('0x2b')]));if(_0x8c1ef9['query'][_0x29f8('0x36')]){_0x527644[_0x29f8('0x37')]=_[_0x29f8('0x38')](_0x527644[_0x29f8('0x37')],{'$or':_['map'](_0x15e577,function(_0x23993d){if(_0x23993d[_0x29f8('0x39')][_0x29f8('0x3a')]!=='VIRTUAL'){var _0x32fc10={};_0x32fc10[_0x23993d[_0x29f8('0x3b')]]={'$like':'%'+_0x8c1ef9['query'][_0x29f8('0x36')]+'%'};return _0x32fc10;}})});}_0x527644=_[_0x29f8('0x38')]({},_0x527644,_0x8c1ef9[_0x29f8('0x3c')]);var _0x2c1ceb={'where':_0x527644[_0x29f8('0x37')]};return db[_0x29f8('0x27')][_0x29f8('0x1b')](_0x2c1ceb)[_0x29f8('0x22')](function(_0x19e417){_0x3cd0aa[_0x29f8('0x1b')]=_0x19e417;if(_0x8c1ef9[_0x29f8('0x2a')][_0x29f8('0x3d')]){_0x527644['include']=[{'all':!![]}];}return db[_0x29f8('0x27')]['findAll'](_0x527644);})[_0x29f8('0x22')](function(_0x4b8030){_0x3cd0aa[_0x29f8('0x3e')]=_0x4b8030;return _0x3cd0aa;})[_0x29f8('0x22')](respondWithFilteredResult(_0x9d255b,_0x527644))['catch'](handleError(_0x9d255b,null));};exports[_0x29f8('0x3f')]=function(_0x296ba5,_0x27f38d){var _0x48f664={'raw':!![],'where':{'id':_0x296ba5[_0x29f8('0x40')]['id']}},_0x11cba8={};_0x11cba8[_0x29f8('0x28')]=_['keys'](db[_0x29f8('0x27')][_0x29f8('0x41')]);_0x11cba8[_0x29f8('0x2a')]=_[_0x29f8('0x29')](_0x296ba5['query']);_0x11cba8['filters']=_['intersection'](_0x11cba8['model'],_0x11cba8['query']);_0x48f664[_0x29f8('0x2d')]=_[_0x29f8('0x2c')](_0x11cba8[_0x29f8('0x28')],qs[_0x29f8('0x2e')](_0x296ba5[_0x29f8('0x2a')][_0x29f8('0x2e')]));_0x48f664[_0x29f8('0x2d')]=_0x48f664[_0x29f8('0x2d')][_0x29f8('0x2f')]?_0x48f664[_0x29f8('0x2d')]:_0x11cba8[_0x29f8('0x28')];if(_0x296ba5[_0x29f8('0x2a')][_0x29f8('0x3d')]){_0x48f664[_0x29f8('0x42')]=[{'all':!![]}];}_0x48f664=_['merge']({},_0x48f664,_0x296ba5[_0x29f8('0x3c')]);return db[_0x29f8('0x27')][_0x29f8('0x43')](_0x48f664)[_0x29f8('0x22')](handleEntityNotFound(_0x27f38d,null))[_0x29f8('0x22')](respondWithResult(_0x27f38d,null))[_0x29f8('0x44')](handleError(_0x27f38d,null));};exports[_0x29f8('0x45')]=function(_0x154fe5,_0x108e7f){return db[_0x29f8('0x27')][_0x29f8('0x45')](_0x154fe5[_0x29f8('0x46')],{})[_0x29f8('0x22')](respondWithResult(_0x108e7f,0xc9))[_0x29f8('0x44')](handleError(_0x108e7f,null));};exports[_0x29f8('0x21')]=function(_0x5c92fd,_0x134964){if(_0x5c92fd[_0x29f8('0x46')]['id']){delete _0x5c92fd[_0x29f8('0x46')]['id'];}return db['ChatInternalMessage'][_0x29f8('0x43')]({'where':{'id':_0x5c92fd[_0x29f8('0x40')]['id']}})[_0x29f8('0x22')](handleEntityNotFound(_0x134964,null))[_0x29f8('0x22')](saveUpdates(_0x5c92fd[_0x29f8('0x46')],null))[_0x29f8('0x22')](respondWithResult(_0x134964,null))[_0x29f8('0x44')](handleError(_0x134964,null));};exports['destroy']=function(_0x65c532,_0x48f08b){return db[_0x29f8('0x27')][_0x29f8('0x43')]({'where':{'id':_0x65c532[_0x29f8('0x40')]['id']}})[_0x29f8('0x22')](handleEntityNotFound(_0x48f08b,null))['then'](removeEntity(_0x48f08b,null))[_0x29f8('0x44')](handleError(_0x48f08b,null));};exports['describe']=function(_0x4cdac6,_0x2d69e1){return db[_0x29f8('0x27')]['describe']()['then'](respondWithResult(_0x2d69e1,null))[_0x29f8('0x44')](handleError(_0x2d69e1,null));};function wrapUser(_0x604663){return function(_0x1284ea){var _0x52b73b=_0x604663[_0x29f8('0x47')]({'plain':!![]});_0x52b73b[_0x29f8('0x48')]=[];if(_0x1284ea){_0x52b73b[_0x29f8('0x49')]=_0x1284ea[_0x29f8('0x4a')];_0x52b73b['lastMessage']=_0x1284ea;}else{_0x52b73b[_0x29f8('0x49')]=moment(0x0)[_0x29f8('0x4b')](_0x29f8('0x4c'));_0x52b73b[_0x29f8('0x4d')]={};}return _0x52b73b;};}exports[_0x29f8('0x4e')]=function(_0x3ee10c,_0x174047,_0xcf3adf){var _0x1e2972=[];return db[_0x29f8('0x4f')][_0x29f8('0x50')]({'where':{'role':[_0x29f8('0x51'),_0x29f8('0x52'),_0x29f8('0x53')]},'attributes':['id',_0x29f8('0x54'),'name','role',_0x29f8('0x55'),_0x29f8('0x56'),_0x29f8('0x57'),_0x29f8('0x58'),_0x29f8('0x59'),_0x29f8('0x5a')],'order':qs[_0x29f8('0x34')](_0x29f8('0x5b')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})['then'](function(_0xfc2c1e){if(_0xfc2c1e){var _0xcf01b1=_0x3ee10c[_0x29f8('0x53')]['get']({'plain':!![]});if(!_0xcf01b1)throw new Error(_0x29f8('0x5c'));if(_0xcf01b1['role']===_0x29f8('0x53')){return db[_0x29f8('0x5d')][_0x29f8('0x43')]({'where':{'name':_0x29f8('0x5e'),'userProfileId':_0xcf01b1[_0x29f8('0x5f')]},'raw':!![]})[_0x29f8('0x22')](function(_0x55b5ed){if(_0x55b5ed){if(_0x55b5ed['autoAssociation']===0x0){return db[_0x29f8('0x60')][_0x29f8('0x50')]({'where':{'sectionId':_0x55b5ed['id']},'raw':!![]})['then'](function(_0x146223){var _0x2724f9=[];if(_[_0x29f8('0x61')](_0x146223)){_0x2724f9=_[_0x29f8('0x36')](_0xfc2c1e,function(_0x30c20e){if(_0x30c20e['role']!==_0x29f8('0x51')){return _0x30c20e;}});return _0x2724f9;}else{for(var _0x2773ba=0x0;_0x2773ba<_0xfc2c1e[_0x29f8('0x2f')];_0x2773ba++){var _0x2287cf=_0xfc2c1e[_0x2773ba];if(_0x2287cf['role']===_0x29f8('0x51')){var _0x4c7d95=_[_0x29f8('0x43')](_0x146223,function(_0x14d99c){return _0x14d99c[_0x29f8('0x62')]===_0x2287cf['id'];});if(_0x4c7d95)_0x2724f9[_0x29f8('0x63')](_0x2287cf);}else{_0x2724f9['push'](_0x2287cf);}}return _0x2724f9;}});}else{return _0xfc2c1e;}}else{var _0x2a2b7b=_[_0x29f8('0x36')](_0xfc2c1e,function(_0x23ea06){if(_0x23ea06[_0x29f8('0x64')]!=='agent'){return _0x23ea06;}});return _0x2a2b7b;}});}else{return _0xfc2c1e;}}})['then'](function(_0x5a935a){var _0x42024c=[];if(_0x5a935a){_0x1e2972=_0x5a935a;for(var _0x4d595=0x0;_0x4d595<_0x5a935a[_0x29f8('0x2f')];_0x4d595+=0x1){_0x1e2972[_0x4d595][_0x29f8('0x48')]=[];_0x42024c[_0x29f8('0x63')](db[_0x29f8('0x27')][_0x29f8('0x43')]({'where':{'FromId':[_0x3ee10c[_0x29f8('0x53')]['id'],_0x5a935a[_0x4d595]['id']],'ToId':[_0x3ee10c['user']['id'],_0x5a935a[_0x4d595]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x29f8('0x65'),_0x29f8('0x66'),_0x29f8('0x67'),_0x29f8('0x46')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x29f8('0x22')](wrapUser(_0x5a935a[_0x4d595])));}return BPromise[_0x29f8('0x68')](_0x42024c);}return[];})[_0x29f8('0x22')](function(_0x4b654a){return{'rows':_0x4b654a,'count':_0x4b654a[_0x29f8('0x2f')]};})[_0x29f8('0x22')](respondWithResult(_0x174047,null))['catch'](handleError(_0x174047,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index d673a09..64c5bae 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 _0xffa1=['remove','emit','hasOwnProperty','hook','exports','ChatInternalMessage','save','update'];(function(_0x234555,_0x309e5b){var _0x4661b5=function(_0x176e42){while(--_0x176e42){_0x234555['push'](_0x234555['shift']());}};_0x4661b5(++_0x309e5b);}(_0xffa1,0x125));var _0x1ffa=function(_0x4a8dd5,_0x238383){_0x4a8dd5=_0x4a8dd5-0x0;var _0x35a90f=_0xffa1[_0x4a8dd5];return _0x35a90f;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x1ffa('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1ffa('0x1'),'afterUpdate':_0x1ffa('0x2'),'afterDestroy':_0x1ffa('0x3')};function emitEvent(_0x5a0764){return function(_0x45457d,_0x286d1e,_0x4b748f){ChatInternalMessageEvents[_0x1ffa('0x4')](_0x5a0764+':'+_0x45457d['id'],_0x45457d);ChatInternalMessageEvents['emit'](_0x5a0764,_0x45457d);_0x4b748f(null);};}for(var e in events){if(events[_0x1ffa('0x5')](e)){var event=events[e];ChatInternalMessage[_0x1ffa('0x6')](e,emitEvent(event));}}module[_0x1ffa('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x68f5=['events','../../mysqldb','save','update','remove','emit','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x68f5,0x93));var _0x568f=function(_0x55ad61,_0x1dc045){_0x55ad61=_0x55ad61-0x0;var _0x437a13=_0x68f5[_0x55ad61];return _0x437a13;};'use strict';var EventEmitter=require(_0x568f('0x0'));var ChatInternalMessage=require(_0x568f('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x568f('0x2'),'afterUpdate':_0x568f('0x3'),'afterDestroy':_0x568f('0x4')};function emitEvent(_0x4fcb97){return function(_0x5368ba,_0x30f706,_0x4d329d){ChatInternalMessageEvents['emit'](_0x4fcb97+':'+_0x5368ba['id'],_0x5368ba);ChatInternalMessageEvents[_0x568f('0x5')](_0x4fcb97,_0x5368ba);_0x4d329d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x568f('0x6')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index d3a87fb..8406612 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 _0xef18=['util','../../config/logger','bluebird','request-promise','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash'];(function(_0x25f590,_0x5cfd7b){var _0xa2c73f=function(_0x4820bc){while(--_0x4820bc){_0x25f590['push'](_0x25f590['shift']());}};_0xa2c73f(++_0x5cfd7b);}(_0xef18,0x77));var _0x8ef1=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xef18[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x8ef1('0x0'));var util=require(_0x8ef1('0x1'));var logger=require(_0x8ef1('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8ef1('0x3'));var rp=require(_0x8ef1('0x4'));var attributes=require(_0x8ef1('0x5'));module['exports']=function(_0x4991bc,_0x744239){return _0x4991bc[_0x8ef1('0x6')](_0x8ef1('0x7'),attributes,{'tableName':_0x8ef1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8ef1('0x9')});}; \ No newline at end of file +var _0xbc5a=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x3183b6,_0x2e0601){var _0x30ec46=function(_0x26f6cc){while(--_0x26f6cc){_0x3183b6['push'](_0x3183b6['shift']());}};_0x30ec46(++_0x2e0601);}(_0xbc5a,0x9d));var _0xabc5=function(_0x98e64,_0x216f4d){_0x98e64=_0x98e64-0x0;var _0x48d537=_0xbc5a[_0x98e64];return _0x48d537;};'use strict';var _=require(_0xabc5('0x0'));var util=require(_0xabc5('0x1'));var logger=require(_0xabc5('0x2'))(_0xabc5('0x3'));var moment=require(_0xabc5('0x4'));var BPromise=require(_0xabc5('0x5'));var rp=require(_0xabc5('0x6'));var attributes=require(_0xabc5('0x7'));module[_0xabc5('0x8')]=function(_0x2df303,_0x48d9e2){return _0x2df303[_0xabc5('0x9')](_0xabc5('0xa'),attributes,{'tableName':_0xabc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xabc5('0xc'),'collate':_0xabc5('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 6025a9f..c3d379b 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 _0x979e=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x979e,0x195));var _0xe979=function(_0x3b832a,_0x57c8c1){_0x3b832a=_0x3b832a-0x0;var _0x4e46ef=_0x979e[_0x3b832a];return _0x4e46ef;};'use strict';var _=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var moment=require(_0xe979('0x2'));var BPromise=require(_0xe979('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe979('0x4'));var db=require(_0xe979('0x5'))['db'];var utils=require(_0xe979('0x6'));var logger=require(_0xe979('0x7'))(_0xe979('0x8'));var config=require('../../config/environment');var jayson=require(_0xe979('0x9'));var client=jayson['client'][_0xe979('0xa')]({'port':0x232a});config[_0xe979('0xb')]=_[_0xe979('0xc')](config[_0xe979('0xb')],{'host':_0xe979('0xd'),'port':0x18eb});var socket=require(_0xe979('0xe'))(new Redis(config[_0xe979('0xb')]));require(_0xe979('0xf'))[_0xe979('0x10')](socket);function respondWithRpcPromise(_0x22cb19,_0x3aeb90,_0x4eddb9){return new BPromise(function(_0x19fcc8,_0x1647d2){return client[_0xe979('0x11')](_0x22cb19,_0x4eddb9)['then'](function(_0x18fe2b){logger[_0xe979('0x12')](_0xe979('0x13'),_0x3aeb90,_0xe979('0x14'));logger[_0xe979('0x15')](_0xe979('0x16'),_0x3aeb90,_0xe979('0x14'),JSON[_0xe979('0x17')](_0x18fe2b));if(_0x18fe2b['error']){if(_0x18fe2b[_0xe979('0x18')][_0xe979('0x19')]===0x1f4){logger[_0xe979('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x3aeb90,_0x18fe2b['error'][_0xe979('0x1a')]);return _0x1647d2(_0x18fe2b[_0xe979('0x18')][_0xe979('0x1a')]);}logger[_0xe979('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x3aeb90,_0x18fe2b[_0xe979('0x18')][_0xe979('0x1a')]);return _0x19fcc8(_0x18fe2b[_0xe979('0x18')][_0xe979('0x1a')]);}else{logger[_0xe979('0x12')](_0xe979('0x13'),_0x3aeb90,_0xe979('0x14'));_0x19fcc8(_0x18fe2b['result'][_0xe979('0x1a')]);}})['catch'](function(_0x58f4a9){logger[_0xe979('0x18')](_0xe979('0x13'),_0x3aeb90,_0x58f4a9);_0x1647d2(_0x58f4a9);});});} \ No newline at end of file +var _0xff3c=['./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','redis'];(function(_0x2b5791,_0x54b779){var _0x40b752=function(_0x5a0521){while(--_0x5a0521){_0x2b5791['push'](_0x2b5791['shift']());}};_0x40b752(++_0x54b779);}(_0xff3c,0x179));var _0xcff3=function(_0x4b119b,_0x3655e1){_0x4b119b=_0x4b119b-0x0;var _0x38761f=_0xff3c[_0x4b119b];return _0x38761f;};'use strict';var _=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var moment=require('moment');var BPromise=require(_0xcff3('0x2'));var rs=require(_0xcff3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcff3('0x4'));var logger=require(_0xcff3('0x5'))(_0xcff3('0x6'));var config=require(_0xcff3('0x7'));var jayson=require(_0xcff3('0x8'));var client=jayson[_0xcff3('0x9')]['http']({'port':0x232a});config['redis']=_[_0xcff3('0xa')](config['redis'],{'host':_0xcff3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcff3('0xc')]));require(_0xcff3('0xd'))[_0xcff3('0xe')](socket);function respondWithRpcPromise(_0x3de9db,_0x4473d7,_0x1e2fa3){return new BPromise(function(_0x42e9da,_0x51e98c){return client['request'](_0x3de9db,_0x1e2fa3)[_0xcff3('0xf')](function(_0x26ce90){logger[_0xcff3('0x10')](_0xcff3('0x11'),_0x4473d7,_0xcff3('0x12'));logger[_0xcff3('0x13')](_0xcff3('0x14'),_0x4473d7,_0xcff3('0x12'),JSON[_0xcff3('0x15')](_0x26ce90));if(_0x26ce90[_0xcff3('0x16')]){if(_0x26ce90[_0xcff3('0x16')][_0xcff3('0x17')]===0x1f4){logger[_0xcff3('0x16')](_0xcff3('0x11'),_0x4473d7,_0x26ce90[_0xcff3('0x16')][_0xcff3('0x18')]);return _0x51e98c(_0x26ce90['error'][_0xcff3('0x18')]);}logger['error'](_0xcff3('0x11'),_0x4473d7,_0x26ce90[_0xcff3('0x16')][_0xcff3('0x18')]);return _0x42e9da(_0x26ce90['error'][_0xcff3('0x18')]);}else{logger[_0xcff3('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x4473d7,_0xcff3('0x12'));_0x42e9da(_0x26ce90['result'][_0xcff3('0x18')]);}})[_0xcff3('0x19')](function(_0x3991c3){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x4473d7,_0x3991c3);_0x51e98c(_0x3991c3);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 7d2bc90..575ee56 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 _0x7577=['remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0xb86184,_0x1a4863){var _0x24f26e=function(_0x384cfe){while(--_0x384cfe){_0xb86184['push'](_0xb86184['shift']());}};_0x24f26e(++_0x1a4863);}(_0x7577,0x1e7));var _0x7757=function(_0x3091bd,_0x3ab52f){_0x3091bd=_0x3091bd-0x0;var _0x37a570=_0x7577[_0x3091bd];return _0x37a570;};'use strict';var ChatInternalMessageEvents=require(_0x7757('0x0'));var events=['save',_0x7757('0x1'),_0x7757('0x2')];function createListener(_0x5d2bba,_0x4883c7){return function(_0x404492){_0x4883c7[_0x7757('0x3')](_0x5d2bba,_0x404492);};}function removeListener(_0x3cfdfc,_0x260abe){return function(){ChatInternalMessageEvents[_0x7757('0x4')](_0x3cfdfc,_0x260abe);};}exports[_0x7757('0x5')]=function(_0xa84ae){for(var _0x3ca4dc=0x0,_0x43641f=events[_0x7757('0x6')];_0x3ca4dc<_0x43641f;_0x3ca4dc++){var _0x2390ad=events[_0x3ca4dc];var _0x54291e=createListener(_0x7757('0x7')+_0x2390ad,_0xa84ae);ChatInternalMessageEvents['on'](_0x2390ad,_0x54291e);}}; \ No newline at end of file +var _0x8e3f=['./chatInternalMessage.events','save','removeListener','register','length'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8e3f,0x13b));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';var ChatInternalMessageEvents=require(_0xf8e3('0x0'));var events=[_0xf8e3('0x1'),'remove','update'];function createListener(_0x4dcc1c,_0x3df320){return function(_0x3a3fbf){_0x3df320['emit'](_0x4dcc1c,_0x3a3fbf);};}function removeListener(_0x11c4f8,_0x3a2500){return function(){ChatInternalMessageEvents[_0xf8e3('0x2')](_0x11c4f8,_0x3a2500);};}exports[_0xf8e3('0x3')]=function(_0x5b7a93){for(var _0x52b3ee=0x0,_0x748164=events[_0xf8e3('0x4')];_0x52b3ee<_0x748164;_0x52b3ee++){var _0x32129b=events[_0x52b3ee];var _0x283b45=createListener('chatInternalMessage:'+_0x32129b,_0x5b7a93);ChatInternalMessageEvents['on'](_0x32129b,_0x283b45);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index ba3efd2..a31d6fc 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 _0x1537=['get','/describe','describe','/users','show','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','isAuthenticated'];(function(_0x38c59d,_0x193370){var _0x3d2eb3=function(_0x34d56f){while(--_0x34d56f){_0x38c59d['push'](_0x38c59d['shift']());}};_0x3d2eb3(++_0x193370);}(_0x1537,0x132));var _0x7153=function(_0x582eba,_0x22ee88){_0x582eba=_0x582eba-0x0;var _0x5d9608=_0x1537[_0x582eba];return _0x5d9608;};'use strict';var multer=require(_0x7153('0x0'));var util=require(_0x7153('0x1'));var path=require('path');var timeout=require(_0x7153('0x2'));var express=require(_0x7153('0x3'));var router=express[_0x7153('0x4')]();var auth=require(_0x7153('0x5'));var interaction=require(_0x7153('0x6'));var config=require('../../config/environment');var controller=require(_0x7153('0x7'));router['get']('/',auth[_0x7153('0x8')](),controller['index']);router[_0x7153('0x9')](_0x7153('0xa'),auth[_0x7153('0x8')](),controller[_0x7153('0xb')]);router[_0x7153('0x9')](_0x7153('0xc'),auth[_0x7153('0x8')](),controller['getUsers']);router[_0x7153('0x9')]('/:id',auth[_0x7153('0x8')](),controller[_0x7153('0xd')]);router[_0x7153('0xe')]('/',auth[_0x7153('0x8')](),controller[_0x7153('0xf')]);router[_0x7153('0x10')](_0x7153('0x11'),controller['update']);router[_0x7153('0x12')](_0x7153('0x11'),auth[_0x7153('0x8')](),controller[_0x7153('0x13')]);module[_0x7153('0x14')]=router; \ No newline at end of file +var _0x49df=['create','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/users','/:id','post'];(function(_0x59eb95,_0x19a61b){var _0x394f61=function(_0x23bcb5){while(--_0x23bcb5){_0x59eb95['push'](_0x59eb95['shift']());}};_0x394f61(++_0x19a61b);}(_0x49df,0xad));var _0xf49d=function(_0x133ee2,_0x1365ff){_0x133ee2=_0x133ee2-0x0;var _0x28e86f=_0x49df[_0x133ee2];return _0x28e86f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf49d('0x0'));var timeout=require(_0xf49d('0x1'));var express=require(_0xf49d('0x2'));var router=express[_0xf49d('0x3')]();var auth=require(_0xf49d('0x4'));var interaction=require(_0xf49d('0x5'));var config=require(_0xf49d('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xf49d('0x7')]('/',auth[_0xf49d('0x8')](),controller[_0xf49d('0x9')]);router[_0xf49d('0x7')](_0xf49d('0xa'),auth[_0xf49d('0x8')](),controller['describe']);router[_0xf49d('0x7')](_0xf49d('0xb'),auth[_0xf49d('0x8')](),controller['getUsers']);router['get'](_0xf49d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf49d('0xd')]('/',auth[_0xf49d('0x8')](),controller[_0xf49d('0xe')]);router['put'](_0xf49d('0xc'),controller[_0xf49d('0xf')]);router['delete'](_0xf49d('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xf49d('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 84abe14..56834c2 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 _0x06a8=['out','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x2a6cb4,_0x3a94fa){var _0x4231e2=function(_0x2aa27b){while(--_0x2aa27b){_0x2a6cb4['push'](_0x2a6cb4['shift']());}};_0x4231e2(++_0x3a94fa);}(_0x06a8,0x128));var _0x806a=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x06a8[_0x32b542];return _0x554d54;};'use strict';var Sequelize=require(_0x806a('0x0'));module[_0x806a('0x1')]={'body':{'type':Sequelize[_0x806a('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x806a('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x806a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x806a('0x4')]('in',_0x806a('0x5')),'defaultValue':_0x806a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x806a('0x6')]}}; \ No newline at end of file +var _0x9d83=['ENUM','out','DATE','exports','TEXT','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d83,0x105));var _0x39d8=function(_0x2f4e7a,_0x4c3f4e){_0x2f4e7a=_0x2f4e7a-0x0;var _0x3299a0=_0x9d83[_0x2f4e7a];return _0x3299a0;};'use strict';var Sequelize=require('sequelize');module[_0x39d8('0x0')]={'body':{'type':Sequelize[_0x39d8('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x39d8('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x39d8('0x3')]('in',_0x39d8('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x39d8('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 011b8c2..dde9e49 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 _0x3e0a=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','json','count','limit','status','apply','save','update','destroy','stack','name','send','index','ChatMessage','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','map','VIRTUAL','field','filter','include','params','rawAttributes','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','format','UserId','user','CmContact','get','ChatInteraction','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','html-pdf','eml-format'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x3e0a,0x154));var _0xa3e0=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0x3e0a[_0x299784];return _0x5ab008;};'use strict';var pdf=require(_0xa3e0('0x0'));var emlformat=require(_0xa3e0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa3e0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa3e0('0x3'));var moment=require(_0xa3e0('0x4'));var BPromise=require(_0xa3e0('0x5'));var Mustache=require(_0xa3e0('0x6'));var util=require(_0xa3e0('0x7'));var path=require(_0xa3e0('0x8'));var sox=require(_0xa3e0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa3e0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa3e0('0xb'));var deskjs=require(_0xa3e0('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa3e0('0xd'));var Papa=require('papaparse');var authService=require(_0xa3e0('0xe'));var hardwareService=require(_0xa3e0('0xf'));var Redis=require(_0xa3e0('0x10'));var qs=require(_0xa3e0('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa3e0('0x12'));var db=require(_0xa3e0('0x13'))['db'];config[_0xa3e0('0x14')]=_[_0xa3e0('0x15')](config[_0xa3e0('0x14')],{'host':_0xa3e0('0x16'),'port':0x18eb});var socket=require(_0xa3e0('0x17'))(new Redis(config['redis']));require(_0xa3e0('0x18'))[_0xa3e0('0x19')](socket);var jayson=require(_0xa3e0('0x1a'));var client=jayson[_0xa3e0('0x1b')][_0xa3e0('0x1c')]({'port':0x232c});var client9002=jayson[_0xa3e0('0x1b')][_0xa3e0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4c83dc,_0xe3da76,_0x1cff0a,_0x2a22a8){return new BPromise(function(_0x251d22,_0x2159f8){var _0xe8a3ea=_0x2a22a8||client;return _0xe8a3ea[_0xa3e0('0x1d')](_0x4c83dc,_0x1cff0a)[_0xa3e0('0x1e')](function(_0x21cae3){logger[_0xa3e0('0x1f')](_0xa3e0('0x20'),_0xe3da76,_0xa3e0('0x21'));logger[_0xa3e0('0x22')](_0xa3e0('0x23'),_0xe3da76,_0xa3e0('0x21'),JSON[_0xa3e0('0x24')](_0x21cae3));if(_0x21cae3['error']){if(_0x21cae3[_0xa3e0('0x25')]['code']===0x1f4){logger[_0xa3e0('0x25')](_0xa3e0('0x20'),_0xe3da76,_0x21cae3['error'][_0xa3e0('0x26')]);return _0x2159f8(_0x21cae3['error'][_0xa3e0('0x26')]);}logger[_0xa3e0('0x25')](_0xa3e0('0x20'),_0xe3da76,_0x21cae3[_0xa3e0('0x25')]['message']);return _0x251d22(_0x21cae3[_0xa3e0('0x25')]['message']);}else{logger[_0xa3e0('0x1f')](_0xa3e0('0x20'),_0xe3da76,_0xa3e0('0x21'));_0x251d22(_0x21cae3[_0xa3e0('0x27')][_0xa3e0('0x26')]);}})[_0xa3e0('0x28')](function(_0x3f4ca1){logger[_0xa3e0('0x25')](_0xa3e0('0x20'),_0xe3da76,_0x3f4ca1);_0x2159f8(_0x3f4ca1);});});}function respondWithStatusCode(_0x183b14,_0x2edf5c){_0x2edf5c=_0x2edf5c||0xcc;return function(_0x4552d4){if(_0x4552d4){return _0x183b14[_0xa3e0('0x29')](_0x2edf5c);}return _0x183b14['status'](_0x2edf5c)[_0xa3e0('0x2a')]();};}function respondWithResult(_0x2277b1,_0x9bb6bf){_0x9bb6bf=_0x9bb6bf||0xc8;return function(_0x2385a9){if(_0x2385a9){return _0x2277b1['status'](_0x9bb6bf)[_0xa3e0('0x2b')](_0x2385a9);}};}function respondWithFilteredResult(_0x4af20a,_0x2929de){return function(_0x1801a1){if(_0x1801a1){var _0x2368e6=_0x1801a1[_0xa3e0('0x2c')],_0x22a062=_0x2929de['offset'],_0x5ad416=_0x2929de['offset']+_0x2929de[_0xa3e0('0x2d')],_0x419aa2;if(_0x5ad416>=_0x2368e6){_0x5ad416=_0x2368e6;_0x419aa2=0xc8;}else{_0x419aa2=0xce;}_0x4af20a[_0xa3e0('0x2e')](_0x419aa2);return _0x4af20a['set']('Content-Range',_0x22a062+'-'+_0x5ad416+'/'+_0x2368e6)[_0xa3e0('0x2b')](_0x1801a1);}return null;};}function patchUpdates(_0x31eb8c){return function(_0x2bce94){try{jsonpatch[_0xa3e0('0x2f')](_0x2bce94,_0x31eb8c,!![]);}catch(_0x52564f){return BPromise['reject'](_0x52564f);}return _0x2bce94[_0xa3e0('0x30')]();};}function saveUpdates(_0x3dde87,_0xa3f211){return function(_0x399f29){if(_0x399f29){return _0x399f29[_0xa3e0('0x31')](_0x3dde87)[_0xa3e0('0x1e')](function(_0x33f176){return _0x33f176;});}return null;};}function removeEntity(_0x180fa3,_0x15a54d){return function(_0x780ff4){if(_0x780ff4){return _0x780ff4[_0xa3e0('0x32')]()['then'](function(){_0x180fa3['status'](0xcc)[_0xa3e0('0x2a')]();});}};}function handleEntityNotFound(_0x31ed6b,_0xf6c71f){return function(_0x1ecd4e){if(!_0x1ecd4e){_0x31ed6b[_0xa3e0('0x29')](0x194);}return _0x1ecd4e;};}function handleError(_0x19f3a0,_0xebe0c5){_0xebe0c5=_0xebe0c5||0x1f4;return function(_0x203f7e){logger['error'](_0x203f7e[_0xa3e0('0x33')]);if(_0x203f7e[_0xa3e0('0x34')]){delete _0x203f7e[_0xa3e0('0x34')];}_0x19f3a0[_0xa3e0('0x2e')](_0xebe0c5)[_0xa3e0('0x35')](_0x203f7e);};}exports[_0xa3e0('0x36')]=function(_0x4222c0,_0x354968){var _0x5ae069={},_0x4b08c9={},_0xa449b2={'count':0x0,'rows':[]};var _0x1fe29e=db[_0xa3e0('0x37')]['rawAttributes'];_0x4b08c9[_0xa3e0('0x38')]=_[_0xa3e0('0x39')](_0x1fe29e);_0x4b08c9[_0xa3e0('0x3a')]=_[_0xa3e0('0x39')](_0x4222c0[_0xa3e0('0x3a')]);_0x4b08c9[_0xa3e0('0x3b')]=_[_0xa3e0('0x3c')](_0x4b08c9[_0xa3e0('0x38')],_0x4b08c9['query']);_0x5ae069[_0xa3e0('0x3d')]=_[_0xa3e0('0x3c')](_0x4b08c9[_0xa3e0('0x38')],qs[_0xa3e0('0x3e')](_0x4222c0[_0xa3e0('0x3a')]['fields']));_0x5ae069['attributes']=_0x5ae069[_0xa3e0('0x3d')][_0xa3e0('0x3f')]?_0x5ae069['attributes']:_0x4b08c9[_0xa3e0('0x38')];if(!_0x4222c0[_0xa3e0('0x3a')][_0xa3e0('0x40')](_0xa3e0('0x41'))){_0x5ae069['limit']=qs[_0xa3e0('0x2d')](_0x4222c0['query'][_0xa3e0('0x2d')]);_0x5ae069['offset']=qs[_0xa3e0('0x42')](_0x4222c0[_0xa3e0('0x3a')][_0xa3e0('0x42')]);}_0x5ae069[_0xa3e0('0x43')]=qs[_0xa3e0('0x44')](_0x4222c0['query'][_0xa3e0('0x44')]);_0x5ae069[_0xa3e0('0x45')]=qs['filters'](_[_0xa3e0('0x46')](_0x4222c0[_0xa3e0('0x3a')],_0x4b08c9[_0xa3e0('0x3b')]));if(_0x4222c0[_0xa3e0('0x3a')]['filter']){_0x5ae069[_0xa3e0('0x45')]=_[_0xa3e0('0x47')](_0x5ae069['where'],{'$or':_[_0xa3e0('0x48')](_0x1fe29e,function(_0x4a1aed){if(_0x4a1aed['type']['key']!==_0xa3e0('0x49')){var _0x1319af={};_0x1319af[_0x4a1aed[_0xa3e0('0x4a')]]={'$like':'%'+_0x4222c0[_0xa3e0('0x3a')][_0xa3e0('0x4b')]+'%'};return _0x1319af;}})});}_0x5ae069=_[_0xa3e0('0x47')]({},_0x5ae069,_0x4222c0['options']);var _0x36b890={'where':_0x5ae069[_0xa3e0('0x45')]};return db['ChatMessage']['count'](_0x36b890)[_0xa3e0('0x1e')](function(_0x3489ac){_0xa449b2[_0xa3e0('0x2c')]=_0x3489ac;if(_0x4222c0[_0xa3e0('0x3a')]['includeAll']){_0x5ae069[_0xa3e0('0x4c')]=[{'all':!![]}];}return db[_0xa3e0('0x37')]['findAll'](_0x5ae069);})[_0xa3e0('0x1e')](function(_0xd557b6){_0xa449b2['rows']=_0xd557b6;return _0xa449b2;})[_0xa3e0('0x1e')](respondWithFilteredResult(_0x354968,_0x5ae069))['catch'](handleError(_0x354968,null));};exports['show']=function(_0x4c3041,_0x5adb0d){var _0x25a221={'raw':!![],'where':{'id':_0x4c3041[_0xa3e0('0x4d')]['id']}},_0x1351d4={};_0x1351d4[_0xa3e0('0x38')]=_['keys'](db[_0xa3e0('0x37')][_0xa3e0('0x4e')]);_0x1351d4[_0xa3e0('0x3a')]=_['keys'](_0x4c3041[_0xa3e0('0x3a')]);_0x1351d4[_0xa3e0('0x3b')]=_[_0xa3e0('0x3c')](_0x1351d4['model'],_0x1351d4['query']);_0x25a221[_0xa3e0('0x3d')]=_['intersection'](_0x1351d4[_0xa3e0('0x38')],qs[_0xa3e0('0x3e')](_0x4c3041['query'][_0xa3e0('0x3e')]));_0x25a221[_0xa3e0('0x3d')]=_0x25a221[_0xa3e0('0x3d')][_0xa3e0('0x3f')]?_0x25a221['attributes']:_0x1351d4['model'];if(_0x4c3041[_0xa3e0('0x3a')]['includeAll']){_0x25a221[_0xa3e0('0x4c')]=[{'all':!![]}];}_0x25a221=_[_0xa3e0('0x47')]({},_0x25a221,_0x4c3041['options']);return db[_0xa3e0('0x37')][_0xa3e0('0x4f')](_0x25a221)['then'](handleEntityNotFound(_0x5adb0d,null))[_0xa3e0('0x1e')](respondWithResult(_0x5adb0d,null))['catch'](handleError(_0x5adb0d,null));};exports[_0xa3e0('0x50')]=function(_0x446311,_0x11f35e){return db[_0xa3e0('0x37')][_0xa3e0('0x50')](_0x446311[_0xa3e0('0x51')],{})['then'](respondWithResult(_0x11f35e,0xc9))['catch'](handleError(_0x11f35e,null));};exports['update']=function(_0x3e331c,_0x359fb9){if(_0x3e331c[_0xa3e0('0x51')]['id']){delete _0x3e331c[_0xa3e0('0x51')]['id'];}return db[_0xa3e0('0x37')][_0xa3e0('0x4f')]({'where':{'id':_0x3e331c[_0xa3e0('0x4d')]['id']}})[_0xa3e0('0x1e')](handleEntityNotFound(_0x359fb9,null))[_0xa3e0('0x1e')](saveUpdates(_0x3e331c[_0xa3e0('0x51')],null))['then'](respondWithResult(_0x359fb9,null))[_0xa3e0('0x28')](handleError(_0x359fb9,null));};exports[_0xa3e0('0x32')]=function(_0x25c58b,_0x294ef6){return db[_0xa3e0('0x37')][_0xa3e0('0x4f')]({'where':{'id':_0x25c58b[_0xa3e0('0x4d')]['id']}})[_0xa3e0('0x1e')](handleEntityNotFound(_0x294ef6,null))['then'](removeEntity(_0x294ef6,null))[_0xa3e0('0x28')](handleError(_0x294ef6,null));};exports['describe']=function(_0x4f8a5c,_0x1abc75){return db[_0xa3e0('0x37')][_0xa3e0('0x52')]()[_0xa3e0('0x1e')](respondWithResult(_0x1abc75,null))[_0xa3e0('0x28')](handleError(_0x1abc75,null));};var interaction_log=require(_0xa3e0('0x53'))(_0xa3e0('0x54'));exports[_0xa3e0('0x55')]=function(_0x586681,_0x3a932c,_0x35d85f){var _0x37aff0={'channel':_0xa3e0('0x56')};if(_0x586681[_0xa3e0('0x51')]['id']){delete _0x586681[_0xa3e0('0x51')]['id'];}_0x586681['body'][_0xa3e0('0x57')]=!![];_0x586681[_0xa3e0('0x51')][_0xa3e0('0x58')]=moment()[_0xa3e0('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x586681[_0xa3e0('0x51')][_0xa3e0('0x5a')]=_0x586681['body']['UserId']||_0x586681[_0xa3e0('0x5b')]['id'];return db[_0xa3e0('0x37')][_0xa3e0('0x4f')]({'where':{'id':_0x586681[_0xa3e0('0x4d')]['id'],'UserId':null},'include':[{'model':db[_0xa3e0('0x5c')],'as':'Contact'}]})[_0xa3e0('0x1e')](handleEntityNotFound(_0x3a932c,null))[_0xa3e0('0x1e')](saveUpdates(_0x586681[_0xa3e0('0x51')],null))[_0xa3e0('0x1e')](function(_0x2520f4){if(_0x2520f4){_0x37aff0[_0xa3e0('0x26')]=_0x2520f4[_0xa3e0('0x5d')]({'plain':!![]});return db[_0xa3e0('0x5e')][_0xa3e0('0x4f')]({'where':{'id':_0x2520f4[_0xa3e0('0x5f')]}});}return null;})[_0xa3e0('0x1e')](handleEntityNotFound(_0x3a932c,null))[_0xa3e0('0x1e')](function(_0x1970bc){if(_0x1970bc){return _0x1970bc['update']({'UserId':_0x586681[_0xa3e0('0x51')]['UserId'],'read1stAt':_[_0xa3e0('0x60')](_0x1970bc['read1stAt'])?moment()[_0xa3e0('0x59')](_0xa3e0('0x61')):undefined});}return null;})[_0xa3e0('0x1e')](function(_0x2afe75){if(_0x2afe75){_0x37aff0[_0xa3e0('0x62')]=_0x2afe75['get']({'plain':!![]});interaction_log[_0xa3e0('0x1f')](_0xa3e0('0x63'),_0x586681[_0xa3e0('0x5b')]['id'],_0x586681[_0xa3e0('0x5b')]['name'],_0x586681[_0xa3e0('0x5b')][_0xa3e0('0x64')],_0x37aff0['interaction']['id'],_0x586681[_0xa3e0('0x51')]?JSON['stringify'](_0x586681[_0xa3e0('0x51')]):_0xa3e0('0x65'));return respondWithRpcPromise(_0xa3e0('0x66'),_0xa3e0('0x67'),_0x37aff0);}return null;})[_0xa3e0('0x1e')](function(_0x199bd6){if(_0x199bd6){if(_0x586681[_0xa3e0('0x51')]['manual']){_0x37aff0['message'][_0xa3e0('0x68')]=util[_0xa3e0('0x59')](_0xa3e0('0x69'),_0x586681[_0xa3e0('0x5b')][_0xa3e0('0x34')]);_0x37aff0[_0xa3e0('0x26')]['channel']=_0x37aff0[_0xa3e0('0x6a')];_0x37aff0['message'][_0xa3e0('0x6b')]=_0xa3e0('0x55');return respondWithRpcPromise('EventManager',_0xa3e0('0x6c'),{'event':'acceptmessage','message':_[_0xa3e0('0x47')](_0x37aff0[_0xa3e0('0x26')],JSON['parse'](_0x37aff0[_0xa3e0('0x62')][_0xa3e0('0x6d')]))},client9002)[_0xa3e0('0x1e')](function(){return _0x37aff0;});}return _0x37aff0;}return null;})['then'](respondWithResult(_0x3a932c,null))['catch'](handleError(_0x3a932c,null));};var interaction_log=require('../../config/logger')(_0xa3e0('0x54'));exports[_0xa3e0('0x6e')]=function(_0x1a8853,_0x4976ce,_0x164e61){var _0x554911={'agent':{},'channel':_0xa3e0('0x56')};if(_0x1a8853[_0xa3e0('0x51')]['id']){delete _0x1a8853[_0xa3e0('0x51')]['id'];}_0x1a8853[_0xa3e0('0x51')][_0xa3e0('0x5a')]=_0x1a8853[_0xa3e0('0x51')][_0xa3e0('0x5a')]||_0x1a8853[_0xa3e0('0x5b')]['id'];_0x554911['agent']['id']=_0x1a8853[_0xa3e0('0x51')][_0xa3e0('0x5a')];return db[_0xa3e0('0x37')][_0xa3e0('0x4f')]({'where':{'id':_0x1a8853['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4976ce,null))['then'](function(_0x36471f){if(_0x36471f){_0x554911[_0xa3e0('0x26')]=_0x36471f['get']({'plain':!![]});return db[_0xa3e0('0x5e')][_0xa3e0('0x4f')]({'where':{'id':_0x36471f[_0xa3e0('0x5f')]}});}return null;})[_0xa3e0('0x1e')](handleEntityNotFound(_0x4976ce,null))['then'](function(_0x350a6f){if(_0x350a6f){_0x554911['interaction']=_0x350a6f['get']({'plain':!![]});interaction_log[_0xa3e0('0x1f')](_0xa3e0('0x6f'),_0x1a8853[_0xa3e0('0x5b')]['id'],_0x1a8853[_0xa3e0('0x5b')][_0xa3e0('0x34')],_0x1a8853[_0xa3e0('0x5b')][_0xa3e0('0x64')],_0x554911[_0xa3e0('0x62')]['id'],_0x1a8853[_0xa3e0('0x51')]?JSON['stringify'](_0x1a8853[_0xa3e0('0x51')]):'null');return respondWithRpcPromise(_0xa3e0('0x70'),'rejectMessage',_0x554911);}return null;})['then'](function(_0x5a0d48){if(_0x5a0d48){_0x5a0d48['message'][_0xa3e0('0x68')]=util[_0xa3e0('0x59')](_0xa3e0('0x69'),_0x1a8853['user']['name']);_0x5a0d48[_0xa3e0('0x26')][_0xa3e0('0x6a')]=_0x554911[_0xa3e0('0x6a')];_0x5a0d48[_0xa3e0('0x26')][_0xa3e0('0x6b')]=_0xa3e0('0x6e');respondWithRpcPromise(_0xa3e0('0x6c'),_0xa3e0('0x6c'),{'event':_0xa3e0('0x71'),'message':_0x5a0d48[_0xa3e0('0x26')]},client9002);return _0x554911;}return null;})['then'](respondWithResult(_0x4976ce,null))['catch'](handleError(_0x4976ce,null));}; \ No newline at end of file +var _0x37c2=['name','send','index','ChatMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','map','type','key','field','filter','show','params','include','options','find','create','body','describe','../../config/logger','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy'];(function(_0x1f30f4,_0x2609de){var _0x14461f=function(_0x2a7003){while(--_0x2a7003){_0x1f30f4['push'](_0x1f30f4['shift']());}};_0x14461f(++_0x2609de);}(_0x37c2,0x129));var _0x237c=function(_0x195c00,_0x47e79a){_0x195c00=_0x195c00-0x0;var _0x50cc24=_0x37c2[_0x195c00];return _0x50cc24;};'use strict';var pdf=require(_0x237c('0x0'));var emlformat=require(_0x237c('0x1'));var rimraf=require(_0x237c('0x2'));var zipdir=require(_0x237c('0x3'));var jsonpatch=require(_0x237c('0x4'));var rp=require('request-promise');var moment=require(_0x237c('0x5'));var BPromise=require(_0x237c('0x6'));var Mustache=require(_0x237c('0x7'));var util=require(_0x237c('0x8'));var path=require('path');var sox=require(_0x237c('0x9'));var csv=require(_0x237c('0xa'));var ejs=require(_0x237c('0xb'));var fs=require('fs');var _=require(_0x237c('0xc'));var squel=require(_0x237c('0xd'));var crypto=require(_0x237c('0xe'));var jsforce=require(_0x237c('0xf'));var deskjs=require(_0x237c('0x10'));var toCsv=require(_0x237c('0xa'));var querystring=require(_0x237c('0x11'));var Papa=require(_0x237c('0x12'));var authService=require(_0x237c('0x13'));var hardwareService=require(_0x237c('0x14'));var Redis=require(_0x237c('0x15'));var qs=require(_0x237c('0x16'));var logger=require('../../config/logger')(_0x237c('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x237c('0x18')]=_['defaults'](config[_0x237c('0x18')],{'host':_0x237c('0x19'),'port':0x18eb});var socket=require(_0x237c('0x1a'))(new Redis(config['redis']));require(_0x237c('0x1b'))[_0x237c('0x1c')](socket);var jayson=require(_0x237c('0x1d'));var client=jayson[_0x237c('0x1e')][_0x237c('0x1f')]({'port':0x232c});var client9002=jayson[_0x237c('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x627c1f,_0x413408,_0x3b21be,_0x57013d){return new BPromise(function(_0x4f064d,_0x4d3976){var _0x46aa6c=_0x57013d||client;return _0x46aa6c[_0x237c('0x20')](_0x627c1f,_0x3b21be)[_0x237c('0x21')](function(_0x2b8364){logger['info'](_0x237c('0x22'),_0x413408,_0x237c('0x23'));logger[_0x237c('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x413408,_0x237c('0x23'),JSON[_0x237c('0x25')](_0x2b8364));if(_0x2b8364[_0x237c('0x26')]){if(_0x2b8364[_0x237c('0x26')][_0x237c('0x27')]===0x1f4){logger[_0x237c('0x26')]('ChatMessage,\x20%s,\x20%s',_0x413408,_0x2b8364[_0x237c('0x26')][_0x237c('0x28')]);return _0x4d3976(_0x2b8364[_0x237c('0x26')][_0x237c('0x28')]);}logger[_0x237c('0x26')](_0x237c('0x22'),_0x413408,_0x2b8364[_0x237c('0x26')][_0x237c('0x28')]);return _0x4f064d(_0x2b8364[_0x237c('0x26')][_0x237c('0x28')]);}else{logger[_0x237c('0x29')](_0x237c('0x22'),_0x413408,_0x237c('0x23'));_0x4f064d(_0x2b8364[_0x237c('0x2a')][_0x237c('0x28')]);}})[_0x237c('0x2b')](function(_0x3f06de){logger[_0x237c('0x26')](_0x237c('0x22'),_0x413408,_0x3f06de);_0x4d3976(_0x3f06de);});});}function respondWithStatusCode(_0x4899d0,_0x5bc7eb){_0x5bc7eb=_0x5bc7eb||0xcc;return function(_0x384683){if(_0x384683){return _0x4899d0[_0x237c('0x2c')](_0x5bc7eb);}return _0x4899d0['status'](_0x5bc7eb)[_0x237c('0x2d')]();};}function respondWithResult(_0x3d8ea3,_0x2fdf99){_0x2fdf99=_0x2fdf99||0xc8;return function(_0x2e4af0){if(_0x2e4af0){return _0x3d8ea3[_0x237c('0x2e')](_0x2fdf99)[_0x237c('0x2f')](_0x2e4af0);}};}function respondWithFilteredResult(_0x4df8dd,_0x40fded){return function(_0x11278b){if(_0x11278b){var _0x49edaf=_0x11278b[_0x237c('0x30')],_0x245b11=_0x40fded['offset'],_0x271a26=_0x40fded[_0x237c('0x31')]+_0x40fded[_0x237c('0x32')],_0x2fc422;if(_0x271a26>=_0x49edaf){_0x271a26=_0x49edaf;_0x2fc422=0xc8;}else{_0x2fc422=0xce;}_0x4df8dd[_0x237c('0x2e')](_0x2fc422);return _0x4df8dd['set'](_0x237c('0x33'),_0x245b11+'-'+_0x271a26+'/'+_0x49edaf)[_0x237c('0x2f')](_0x11278b);}return null;};}function patchUpdates(_0x683bc6){return function(_0x311115){try{jsonpatch[_0x237c('0x34')](_0x311115,_0x683bc6,!![]);}catch(_0xd90a78){return BPromise[_0x237c('0x35')](_0xd90a78);}return _0x311115[_0x237c('0x36')]();};}function saveUpdates(_0x427b56,_0x29517e){return function(_0x1bcc12){if(_0x1bcc12){return _0x1bcc12[_0x237c('0x37')](_0x427b56)[_0x237c('0x21')](function(_0xbe4c91){return _0xbe4c91;});}return null;};}function removeEntity(_0x1c7553,_0x401718){return function(_0x5df205){if(_0x5df205){return _0x5df205[_0x237c('0x38')]()[_0x237c('0x21')](function(){_0x1c7553[_0x237c('0x2e')](0xcc)[_0x237c('0x2d')]();});}};}function handleEntityNotFound(_0x1f7821,_0x48e7ea){return function(_0x2b6925){if(!_0x2b6925){_0x1f7821['sendStatus'](0x194);}return _0x2b6925;};}function handleError(_0x440ced,_0x2140d7){_0x2140d7=_0x2140d7||0x1f4;return function(_0x29bbe7){logger[_0x237c('0x26')](_0x29bbe7['stack']);if(_0x29bbe7[_0x237c('0x39')]){delete _0x29bbe7[_0x237c('0x39')];}_0x440ced['status'](_0x2140d7)[_0x237c('0x3a')](_0x29bbe7);};}exports[_0x237c('0x3b')]=function(_0x21a42c,_0x1fdec0){var _0x2edee5={},_0x47611c={},_0x4dceb3={'count':0x0,'rows':[]};var _0x36ed27=db[_0x237c('0x3c')][_0x237c('0x3d')];_0x47611c[_0x237c('0x3e')]=_['keys'](_0x36ed27);_0x47611c[_0x237c('0x3f')]=_[_0x237c('0x40')](_0x21a42c[_0x237c('0x3f')]);_0x47611c[_0x237c('0x41')]=_[_0x237c('0x42')](_0x47611c[_0x237c('0x3e')],_0x47611c[_0x237c('0x3f')]);_0x2edee5[_0x237c('0x43')]=_['intersection'](_0x47611c[_0x237c('0x3e')],qs[_0x237c('0x44')](_0x21a42c[_0x237c('0x3f')][_0x237c('0x44')]));_0x2edee5[_0x237c('0x43')]=_0x2edee5['attributes'][_0x237c('0x45')]?_0x2edee5['attributes']:_0x47611c[_0x237c('0x3e')];if(!_0x21a42c[_0x237c('0x3f')]['hasOwnProperty']('nolimit')){_0x2edee5[_0x237c('0x32')]=qs[_0x237c('0x32')](_0x21a42c['query'][_0x237c('0x32')]);_0x2edee5['offset']=qs[_0x237c('0x31')](_0x21a42c[_0x237c('0x3f')]['offset']);}_0x2edee5['order']=qs[_0x237c('0x46')](_0x21a42c[_0x237c('0x3f')][_0x237c('0x46')]);_0x2edee5[_0x237c('0x47')]=qs[_0x237c('0x41')](_[_0x237c('0x48')](_0x21a42c[_0x237c('0x3f')],_0x47611c['filters']));if(_0x21a42c[_0x237c('0x3f')]['filter']){_0x2edee5['where']=_[_0x237c('0x49')](_0x2edee5[_0x237c('0x47')],{'$or':_[_0x237c('0x4a')](_0x36ed27,function(_0x53df2b){if(_0x53df2b[_0x237c('0x4b')][_0x237c('0x4c')]!=='VIRTUAL'){var _0x51f8a5={};_0x51f8a5[_0x53df2b[_0x237c('0x4d')]]={'$like':'%'+_0x21a42c[_0x237c('0x3f')][_0x237c('0x4e')]+'%'};return _0x51f8a5;}})});}_0x2edee5=_[_0x237c('0x49')]({},_0x2edee5,_0x21a42c['options']);var _0x966fd7={'where':_0x2edee5['where']};return db[_0x237c('0x3c')][_0x237c('0x30')](_0x966fd7)['then'](function(_0x5d57e7){_0x4dceb3[_0x237c('0x30')]=_0x5d57e7;if(_0x21a42c[_0x237c('0x3f')]['includeAll']){_0x2edee5['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x2edee5);})[_0x237c('0x21')](function(_0x3a4cf1){_0x4dceb3['rows']=_0x3a4cf1;return _0x4dceb3;})['then'](respondWithFilteredResult(_0x1fdec0,_0x2edee5))[_0x237c('0x2b')](handleError(_0x1fdec0,null));};exports[_0x237c('0x4f')]=function(_0x41f744,_0x3489cd){var _0x554c58={'raw':!![],'where':{'id':_0x41f744[_0x237c('0x50')]['id']}},_0x1b9ea4={};_0x1b9ea4[_0x237c('0x3e')]=_['keys'](db[_0x237c('0x3c')][_0x237c('0x3d')]);_0x1b9ea4['query']=_['keys'](_0x41f744[_0x237c('0x3f')]);_0x1b9ea4[_0x237c('0x41')]=_['intersection'](_0x1b9ea4[_0x237c('0x3e')],_0x1b9ea4['query']);_0x554c58[_0x237c('0x43')]=_['intersection'](_0x1b9ea4[_0x237c('0x3e')],qs[_0x237c('0x44')](_0x41f744[_0x237c('0x3f')][_0x237c('0x44')]));_0x554c58[_0x237c('0x43')]=_0x554c58[_0x237c('0x43')][_0x237c('0x45')]?_0x554c58['attributes']:_0x1b9ea4[_0x237c('0x3e')];if(_0x41f744[_0x237c('0x3f')]['includeAll']){_0x554c58[_0x237c('0x51')]=[{'all':!![]}];}_0x554c58=_['merge']({},_0x554c58,_0x41f744[_0x237c('0x52')]);return db['ChatMessage'][_0x237c('0x53')](_0x554c58)[_0x237c('0x21')](handleEntityNotFound(_0x3489cd,null))['then'](respondWithResult(_0x3489cd,null))[_0x237c('0x2b')](handleError(_0x3489cd,null));};exports[_0x237c('0x54')]=function(_0x5e3db2,_0x42eef1){return db[_0x237c('0x3c')][_0x237c('0x54')](_0x5e3db2[_0x237c('0x55')],{})['then'](respondWithResult(_0x42eef1,0xc9))[_0x237c('0x2b')](handleError(_0x42eef1,null));};exports[_0x237c('0x37')]=function(_0x3480d9,_0x35f70a){if(_0x3480d9[_0x237c('0x55')]['id']){delete _0x3480d9[_0x237c('0x55')]['id'];}return db[_0x237c('0x3c')]['find']({'where':{'id':_0x3480d9['params']['id']}})[_0x237c('0x21')](handleEntityNotFound(_0x35f70a,null))[_0x237c('0x21')](saveUpdates(_0x3480d9[_0x237c('0x55')],null))[_0x237c('0x21')](respondWithResult(_0x35f70a,null))[_0x237c('0x2b')](handleError(_0x35f70a,null));};exports[_0x237c('0x38')]=function(_0x4ea76e,_0x590e33){return db['ChatMessage'][_0x237c('0x53')]({'where':{'id':_0x4ea76e['params']['id']}})['then'](handleEntityNotFound(_0x590e33,null))[_0x237c('0x21')](removeEntity(_0x590e33,null))[_0x237c('0x2b')](handleError(_0x590e33,null));};exports[_0x237c('0x56')]=function(_0x4c9a8c,_0x3cb69c){return db[_0x237c('0x3c')]['describe']()[_0x237c('0x21')](respondWithResult(_0x3cb69c,null))[_0x237c('0x2b')](handleError(_0x3cb69c,null));};var interaction_log=require(_0x237c('0x57'))('chat-interactions');exports['accept']=function(_0x7cedd6,_0x4c57d0,_0x3602c5){var _0x359ce8={'channel':'chat'};if(_0x7cedd6[_0x237c('0x55')]['id']){delete _0x7cedd6[_0x237c('0x55')]['id'];}_0x7cedd6[_0x237c('0x55')][_0x237c('0x58')]=!![];_0x7cedd6[_0x237c('0x55')]['readAt']=moment()[_0x237c('0x59')](_0x237c('0x5a'));_0x7cedd6[_0x237c('0x55')][_0x237c('0x5b')]=_0x7cedd6['body'][_0x237c('0x5b')]||_0x7cedd6[_0x237c('0x5c')]['id'];return db[_0x237c('0x3c')][_0x237c('0x53')]({'where':{'id':_0x7cedd6[_0x237c('0x50')]['id'],'UserId':null},'include':[{'model':db[_0x237c('0x5d')],'as':_0x237c('0x5e')}]})[_0x237c('0x21')](handleEntityNotFound(_0x4c57d0,null))[_0x237c('0x21')](saveUpdates(_0x7cedd6['body'],null))[_0x237c('0x21')](function(_0x36cadb){if(_0x36cadb){_0x359ce8['message']=_0x36cadb['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x36cadb[_0x237c('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x4c57d0,null))[_0x237c('0x21')](function(_0x29fd0d){if(_0x29fd0d){return _0x29fd0d[_0x237c('0x37')]({'UserId':_0x7cedd6['body'][_0x237c('0x5b')],'read1stAt':_[_0x237c('0x60')](_0x29fd0d[_0x237c('0x61')])?moment()[_0x237c('0x59')](_0x237c('0x5a')):undefined});}return null;})[_0x237c('0x21')](function(_0x3dec21){if(_0x3dec21){_0x359ce8[_0x237c('0x62')]=_0x3dec21[_0x237c('0x63')]({'plain':!![]});interaction_log[_0x237c('0x29')](_0x237c('0x64'),_0x7cedd6[_0x237c('0x5c')]['id'],_0x7cedd6[_0x237c('0x5c')][_0x237c('0x39')],_0x7cedd6[_0x237c('0x5c')][_0x237c('0x65')],_0x359ce8[_0x237c('0x62')]['id'],_0x7cedd6[_0x237c('0x55')]?JSON[_0x237c('0x25')](_0x7cedd6[_0x237c('0x55')]):_0x237c('0x66'));return respondWithRpcPromise(_0x237c('0x67'),_0x237c('0x68'),_0x359ce8);}return null;})[_0x237c('0x21')](function(_0x2a138f){if(_0x2a138f){if(_0x7cedd6['body'][_0x237c('0x69')]){_0x359ce8[_0x237c('0x28')][_0x237c('0x6a')]=util[_0x237c('0x59')](_0x237c('0x6b'),_0x7cedd6[_0x237c('0x5c')][_0x237c('0x39')]);_0x359ce8[_0x237c('0x28')][_0x237c('0x6c')]=_0x359ce8['channel'];_0x359ce8['message'][_0x237c('0x6d')]='accept';return respondWithRpcPromise('EventManager',_0x237c('0x6e'),{'event':_0x237c('0x6f'),'message':_[_0x237c('0x49')](_0x359ce8[_0x237c('0x28')],JSON[_0x237c('0x70')](_0x359ce8['interaction'][_0x237c('0x71')]))},client9002)[_0x237c('0x21')](function(){return _0x359ce8;});}return _0x359ce8;}return null;})['then'](respondWithResult(_0x4c57d0,null))[_0x237c('0x2b')](handleError(_0x4c57d0,null));};var interaction_log=require(_0x237c('0x57'))('chat-interactions');exports[_0x237c('0x35')]=function(_0x35fdfc,_0x5f57e0,_0x370159){var _0x1e610d={'agent':{},'channel':_0x237c('0x72')};if(_0x35fdfc[_0x237c('0x55')]['id']){delete _0x35fdfc['body']['id'];}_0x35fdfc[_0x237c('0x55')]['UserId']=_0x35fdfc[_0x237c('0x55')][_0x237c('0x5b')]||_0x35fdfc['user']['id'];_0x1e610d[_0x237c('0x73')]['id']=_0x35fdfc[_0x237c('0x55')][_0x237c('0x5b')];return db['ChatMessage'][_0x237c('0x53')]({'where':{'id':_0x35fdfc[_0x237c('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5f57e0,null))[_0x237c('0x21')](function(_0x23237b){if(_0x23237b){_0x1e610d['message']=_0x23237b[_0x237c('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x237c('0x53')]({'where':{'id':_0x23237b[_0x237c('0x5f')]}});}return null;})[_0x237c('0x21')](handleEntityNotFound(_0x5f57e0,null))[_0x237c('0x21')](function(_0xb2d35f){if(_0xb2d35f){_0x1e610d['interaction']=_0xb2d35f[_0x237c('0x63')]({'plain':!![]});interaction_log[_0x237c('0x29')](_0x237c('0x74'),_0x35fdfc['user']['id'],_0x35fdfc[_0x237c('0x5c')][_0x237c('0x39')],_0x35fdfc[_0x237c('0x5c')][_0x237c('0x65')],_0x1e610d[_0x237c('0x62')]['id'],_0x35fdfc['body']?JSON[_0x237c('0x25')](_0x35fdfc[_0x237c('0x55')]):_0x237c('0x66'));return respondWithRpcPromise(_0x237c('0x75'),'rejectMessage',_0x1e610d);}return null;})['then'](function(_0x4024e3){if(_0x4024e3){_0x4024e3[_0x237c('0x28')][_0x237c('0x6a')]=util[_0x237c('0x59')](_0x237c('0x6b'),_0x35fdfc['user'][_0x237c('0x39')]);_0x4024e3['message']['channel']=_0x1e610d['channel'];_0x4024e3['message'][_0x237c('0x6d')]=_0x237c('0x35');respondWithRpcPromise(_0x237c('0x6e'),_0x237c('0x6e'),{'event':'rejectmessage','message':_0x4024e3['message']},client9002);return _0x1e610d;}return null;})[_0x237c('0x21')](respondWithResult(_0x5f57e0,null))[_0x237c('0x2b')](handleError(_0x5f57e0,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 3e52504..ebf6e24 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 _0x1ba4=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit','hook'];(function(_0x3aa8bb,_0x32d6cb){var _0x529d67=function(_0x423343){while(--_0x423343){_0x3aa8bb['push'](_0x3aa8bb['shift']());}};_0x529d67(++_0x32d6cb);}(_0x1ba4,0x7f));var _0x41ba=function(_0x20d434,_0x3fb64f){_0x20d434=_0x20d434-0x0;var _0x1d90f1=_0x1ba4[_0x20d434];return _0x1d90f1;};'use strict';var EventEmitter=require(_0x41ba('0x0'));var ChatMessage=require(_0x41ba('0x1'))['db'][_0x41ba('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x41ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x41ba('0x4'),'afterDestroy':_0x41ba('0x5')};function emitEvent(_0xa6b1f6){return function(_0x352cd0,_0x5f5599,_0x4066a5){ChatMessageEvents['emit'](_0xa6b1f6+':'+_0x352cd0['id'],_0x352cd0);ChatMessageEvents[_0x41ba('0x6')](_0xa6b1f6,_0x352cd0);_0x4066a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x41ba('0x7')](e,emitEvent(event));}}module[_0x41ba('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x8756=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','save','update','remove'];(function(_0x347e0f,_0x1fdb6b){var _0x3baeb3=function(_0x514423){while(--_0x514423){_0x347e0f['push'](_0x347e0f['shift']());}};_0x3baeb3(++_0x1fdb6b);}(_0x8756,0xc2));var _0x6875=function(_0x1ac6f9,_0xb6c3ab){_0x1ac6f9=_0x1ac6f9-0x0;var _0xdb1f36=_0x8756[_0x1ac6f9];return _0xdb1f36;};'use strict';var EventEmitter=require(_0x6875('0x0'));var ChatMessage=require(_0x6875('0x1'))['db'][_0x6875('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6875('0x3'),'afterUpdate':_0x6875('0x4'),'afterDestroy':_0x6875('0x5')};function emitEvent(_0x5ecec0){return function(_0x258468,_0x3ea351,_0x40870c){ChatMessageEvents[_0x6875('0x6')](_0x5ecec0+':'+_0x258468['id'],_0x258468);ChatMessageEvents[_0x6875('0x6')](_0x5ecec0,_0x258468);_0x40870c(null);};}for(var e in events){if(events[_0x6875('0x7')](e)){var event=events[e];ChatMessage[_0x6875('0x8')](e,emitEvent(event));}}module[_0x6875('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index d0080a8..f2830e5 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 _0x973f=['define','ChatMessage','chat_messages','models','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','body','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x973f,0x18d));var _0xf973=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x973f[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xf973('0x0'));var util=require(_0xf973('0x1'));var logger=require(_0xf973('0x2'))(_0xf973('0x3'));var moment=require(_0xf973('0x4'));var BPromise=require(_0xf973('0x5'));var rp=require(_0xf973('0x6'));var attributes=require('./chatMessage.attributes');module[_0xf973('0x7')]=function(_0x5c9c07,_0x39fada){return _0x5c9c07[_0xf973('0x8')](_0xf973('0x9'),attributes,{'tableName':_0xf973('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x55ccfd,_0x2eac69,_0x2a9133){var _0x26101e=_0x5c9c07[_0xf973('0xb')];var _0x117223=_0x55ccfd['get']({'plain':!![]});if(_0x117223[_0xf973('0xc')][_0xf973('0xd')]()==='in'||_0x117223[_0xf973('0xc')][_0xf973('0xd')]()===_0xf973('0xe')&&!_0x117223[_0xf973('0xf')]&&!_['isNil'](_0x117223[_0xf973('0x10')])){_0x26101e[_0xf973('0x11')][_0xf973('0x12')]({'where':{'id':_0x117223[_0xf973('0x13')]}})[_0xf973('0x14')](function(_0x359703){if(_0x359703){_0x359703[_0xf973('0x15')]({'lastMsgAt':_0x117223[_0xf973('0x16')],'lastMsgDirection':_0x117223['direction'][_0xf973('0xd')](),'lastMsgBody':_0x117223[_0xf973('0x17')]});}})[_0xf973('0x18')](function(_0x1da223){console[_0xf973('0x19')](_0x1da223);});}_0x2a9133();}},'charset':'utf8mb4','collate':_0xf973('0x1a')});}; \ No newline at end of file +var _0x9f17=['toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','createdAt','body','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','./chatMessage.attributes','define','ChatMessage','models','direction'];(function(_0x59d472,_0x29b606){var _0x2e6e12=function(_0x564e10){while(--_0x564e10){_0x59d472['push'](_0x59d472['shift']());}};_0x2e6e12(++_0x29b606);}(_0x9f17,0x73));var _0x79f1=function(_0x1d6b97,_0x5a2b5b){_0x1d6b97=_0x1d6b97-0x0;var _0x5342b2=_0x9f17[_0x1d6b97];return _0x5342b2;};'use strict';var _=require(_0x79f1('0x0'));var util=require('util');var logger=require(_0x79f1('0x1'))(_0x79f1('0x2'));var moment=require(_0x79f1('0x3'));var BPromise=require(_0x79f1('0x4'));var rp=require(_0x79f1('0x5'));var attributes=require(_0x79f1('0x6'));module['exports']=function(_0xec7cca,_0xdce80f){return _0xec7cca[_0x79f1('0x7')](_0x79f1('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x18b0d5,_0x12ce9e,_0x33a7bc){var _0x1804af=_0xec7cca[_0x79f1('0x9')];var _0x11c45b=_0x18b0d5['get']({'plain':!![]});if(_0x11c45b[_0x79f1('0xa')][_0x79f1('0xb')]()==='in'||_0x11c45b[_0x79f1('0xa')]['toLowerCase']()===_0x79f1('0xc')&&!_0x11c45b['secret']&&!_[_0x79f1('0xd')](_0x11c45b[_0x79f1('0xe')])){_0x1804af[_0x79f1('0xf')][_0x79f1('0x10')]({'where':{'id':_0x11c45b['ChatInteractionId']}})[_0x79f1('0x11')](function(_0x1ed2a4){if(_0x1ed2a4){_0x1ed2a4['update']({'lastMsgAt':_0x11c45b[_0x79f1('0x12')],'lastMsgDirection':_0x11c45b[_0x79f1('0xa')][_0x79f1('0xb')](),'lastMsgBody':_0x11c45b[_0x79f1('0x13')]});}})['catch'](function(_0x349d81){console['error'](_0x349d81);});}_0x33a7bc();}},'charset':_0x79f1('0x14'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 62b34b9..15b4cc4 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 _0x8df6=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','util','bluebird'];(function(_0x5af1ce,_0x990b61){var _0x1d62ec=function(_0x980e27){while(--_0x980e27){_0x5af1ce['push'](_0x5af1ce['shift']());}};_0x1d62ec(++_0x990b61);}(_0x8df6,0x191));var _0x68df=function(_0x4f445b,_0x503a76){_0x4f445b=_0x4f445b-0x0;var _0x514166=_0x8df6[_0x4f445b];return _0x514166;};'use strict';var _=require('lodash');var util=require(_0x68df('0x0'));var moment=require('moment');var BPromise=require(_0x68df('0x1'));var rs=require(_0x68df('0x2'));var fs=require('fs');var Redis=require(_0x68df('0x3'));var db=require(_0x68df('0x4'))['db'];var utils=require(_0x68df('0x5'));var logger=require('../../config/logger')(_0x68df('0x6'));var config=require('../../config/environment');var jayson=require(_0x68df('0x7'));var client=jayson['client'][_0x68df('0x8')]({'port':0x232a});config[_0x68df('0x9')]=_[_0x68df('0xa')](config[_0x68df('0x9')],{'host':_0x68df('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68df('0x9')]));require(_0x68df('0xc'))['register'](socket);function respondWithRpcPromise(_0x375f85,_0x4c8fd1,_0x4492ba){return new BPromise(function(_0xb0c89a,_0x1ca7ef){return client[_0x68df('0xd')](_0x375f85,_0x4492ba)[_0x68df('0xe')](function(_0x24084b){logger[_0x68df('0xf')](_0x68df('0x10'),_0x4c8fd1,_0x68df('0x11'));logger[_0x68df('0x12')](_0x68df('0x13'),_0x4c8fd1,_0x68df('0x11'),JSON[_0x68df('0x14')](_0x24084b));if(_0x24084b[_0x68df('0x15')]){if(_0x24084b[_0x68df('0x15')]['code']===0x1f4){logger[_0x68df('0x15')](_0x68df('0x10'),_0x4c8fd1,_0x24084b[_0x68df('0x15')][_0x68df('0x16')]);return _0x1ca7ef(_0x24084b[_0x68df('0x15')][_0x68df('0x16')]);}logger[_0x68df('0x15')](_0x68df('0x10'),_0x4c8fd1,_0x24084b[_0x68df('0x15')]['message']);return _0xb0c89a(_0x24084b[_0x68df('0x15')][_0x68df('0x16')]);}else{logger[_0x68df('0xf')](_0x68df('0x10'),_0x4c8fd1,_0x68df('0x11'));_0xb0c89a(_0x24084b[_0x68df('0x17')][_0x68df('0x16')]);}})[_0x68df('0x18')](function(_0x11be75){logger[_0x68df('0x15')](_0x68df('0x10'),_0x4c8fd1,_0x11be75);_0x1ca7ef(_0x11be75);});});}exports[_0x68df('0x19')]=function(_0x239118){var _0x27c955=this;return new Promise(function(_0x40da50,_0x51475b){return db[_0x68df('0x1a')][_0x68df('0x1b')](_0x239118[_0x68df('0x1c')],{'raw':_0x239118['options']?_0x239118[_0x68df('0x1d')][_0x68df('0x1e')]===undefined?!![]:![]:!![]})[_0x68df('0xe')](function(_0x2eaeb7){logger[_0x68df('0xf')](_0x68df('0x19'),_0x239118);logger[_0x68df('0x12')](_0x68df('0x19'),_0x239118,JSON[_0x68df('0x14')](_0x2eaeb7));_0x40da50(_0x2eaeb7);})[_0x68df('0x18')](function(_0x278430){logger['error'](_0x68df('0x19'),_0x278430['message'],_0x239118);_0x51475b(_0x27c955[_0x68df('0x15')](0x1f4,_0x278430[_0x68df('0x16')]));});});}; \ No newline at end of file +var _0x4af5=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','result','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','moment'];(function(_0x2eded6,_0xb635a0){var _0x58ae37=function(_0x57a1da){while(--_0x57a1da){_0x2eded6['push'](_0x2eded6['shift']());}};_0x58ae37(++_0xb635a0);}(_0x4af5,0x12a));var _0x54af=function(_0x2ff29b,_0x41508b){_0x2ff29b=_0x2ff29b-0x0;var _0x1c7b20=_0x4af5[_0x2ff29b];return _0x1c7b20;};'use strict';var _=require(_0x54af('0x0'));var util=require('util');var moment=require(_0x54af('0x1'));var BPromise=require(_0x54af('0x2'));var rs=require(_0x54af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x54af('0x4'));var logger=require(_0x54af('0x5'))(_0x54af('0x6'));var config=require(_0x54af('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x54af('0x8')][_0x54af('0x9')]({'port':0x232a});config['redis']=_[_0x54af('0xa')](config[_0x54af('0xb')],{'host':_0x54af('0xc'),'port':0x18eb});var socket=require(_0x54af('0xd'))(new Redis(config[_0x54af('0xb')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2817df,_0x57fe25,_0x29c54e){return new BPromise(function(_0x245c29,_0x332e7d){return client['request'](_0x2817df,_0x29c54e)[_0x54af('0xe')](function(_0x2d2871){logger[_0x54af('0xf')]('ChatMessage,\x20%s,\x20%s',_0x57fe25,_0x54af('0x10'));logger[_0x54af('0x11')](_0x54af('0x12'),_0x57fe25,'request\x20sent',JSON[_0x54af('0x13')](_0x2d2871));if(_0x2d2871[_0x54af('0x14')]){if(_0x2d2871[_0x54af('0x14')]['code']===0x1f4){logger[_0x54af('0x14')]('ChatMessage,\x20%s,\x20%s',_0x57fe25,_0x2d2871[_0x54af('0x14')][_0x54af('0x15')]);return _0x332e7d(_0x2d2871[_0x54af('0x14')][_0x54af('0x15')]);}logger['error'](_0x54af('0x16'),_0x57fe25,_0x2d2871['error'][_0x54af('0x15')]);return _0x245c29(_0x2d2871[_0x54af('0x14')][_0x54af('0x15')]);}else{logger[_0x54af('0xf')](_0x54af('0x16'),_0x57fe25,_0x54af('0x10'));_0x245c29(_0x2d2871[_0x54af('0x17')]['message']);}})[_0x54af('0x18')](function(_0x36ed92){logger[_0x54af('0x14')]('ChatMessage,\x20%s,\x20%s',_0x57fe25,_0x36ed92);_0x332e7d(_0x36ed92);});});}exports[_0x54af('0x19')]=function(_0x13759c){var _0x1a56b8=this;return new Promise(function(_0x2d821f,_0x4c992b){return db[_0x54af('0x1a')][_0x54af('0x1b')](_0x13759c['body'],{'raw':_0x13759c[_0x54af('0x1c')]?_0x13759c['options'][_0x54af('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3a6f29){logger[_0x54af('0xf')](_0x54af('0x19'),_0x13759c);logger[_0x54af('0x11')]('CreateChatMessage',_0x13759c,JSON[_0x54af('0x13')](_0x3a6f29));_0x2d821f(_0x3a6f29);})[_0x54af('0x18')](function(_0x18c2af){logger[_0x54af('0x14')](_0x54af('0x19'),_0x18c2af['message'],_0x13759c);_0x4c992b(_0x1a56b8['error'](0x1f4,_0x18c2af[_0x54af('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 3d3eb84..b83441f 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 _0x70e0=['chatMessage:','./chatMessage.events','save','remove','emit','removeListener'];(function(_0x799548,_0x367160){var _0x49cccf=function(_0xb2aa94){while(--_0xb2aa94){_0x799548['push'](_0x799548['shift']());}};_0x49cccf(++_0x367160);}(_0x70e0,0x17b));var _0x070e=function(_0x2d1823,_0x4b21bc){_0x2d1823=_0x2d1823-0x0;var _0x256902=_0x70e0[_0x2d1823];return _0x256902;};'use strict';var ChatMessageEvents=require(_0x070e('0x0'));var events=[_0x070e('0x1'),_0x070e('0x2'),'update'];function createListener(_0x579b83,_0x16e651){return function(_0xee173){_0x16e651[_0x070e('0x3')](_0x579b83,_0xee173);};}function removeListener(_0x2593e5,_0x5c90fc){return function(){ChatMessageEvents[_0x070e('0x4')](_0x2593e5,_0x5c90fc);};}exports['register']=function(_0x46fe68){for(var _0x4b041d=0x0,_0x56e420=events['length'];_0x4b041d<_0x56e420;_0x4b041d++){var _0x35ab0c=events[_0x4b041d];var _0x1e11f0=createListener(_0x070e('0x5')+_0x35ab0c,_0x46fe68);ChatMessageEvents['on'](_0x35ab0c,_0x1e11f0);}}; \ No newline at end of file +var _0x55ca=['removeListener','register','./chatMessage.events','save'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x55ca,0x126));var _0xa55c=function(_0x36c87d,_0x2ab247){_0x36c87d=_0x36c87d-0x0;var _0x54dc55=_0x55ca[_0x36c87d];return _0x54dc55;};'use strict';var ChatMessageEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){ChatMessageEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('chatMessage:'+_0x2121fd,_0x3c97c8);ChatMessageEvents['on'](_0x2121fd,_0x2537f0);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 1a17e36..e4b1ce1 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 _0xcd2c=['put','/:id/accept','accept','/:id/reject','reject','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','show','tracked','chat','chatmessage:create','create','/:id','update'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0xcd2c,0x6a));var _0xccd2=function(_0x227189,_0x372c80){_0x227189=_0x227189-0x0;var _0x240f8d=_0xcd2c[_0x227189];return _0x240f8d;};'use strict';var multer=require(_0xccd2('0x0'));var util=require('util');var path=require(_0xccd2('0x1'));var timeout=require(_0xccd2('0x2'));var express=require(_0xccd2('0x3'));var router=express[_0xccd2('0x4')]();var auth=require(_0xccd2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xccd2('0x6'));var controller=require(_0xccd2('0x7'));router[_0xccd2('0x8')]('/',auth['isAuthenticated'](),controller[_0xccd2('0x9')]);router[_0xccd2('0x8')](_0xccd2('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xccd2('0x8')]('/:id',auth[_0xccd2('0xb')](),controller[_0xccd2('0xc')]);router['post']('/',auth[_0xccd2('0xb')](),interaction[_0xccd2('0xd')](_0xccd2('0xe'),_0xccd2('0xf')),controller[_0xccd2('0x10')]);router['put'](_0xccd2('0x11'),controller[_0xccd2('0x12')]);router[_0xccd2('0x13')](_0xccd2('0x14'),auth[_0xccd2('0xb')](),controller[_0xccd2('0x15')]);router[_0xccd2('0x13')](_0xccd2('0x16'),auth[_0xccd2('0xb')](),controller[_0xccd2('0x17')]);router[_0xccd2('0x18')](_0xccd2('0x11'),auth[_0xccd2('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xea88=['update','/:id/accept','/:id/reject','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','describe','/:id','post','tracked','chat','create','put'];(function(_0x2ccad2,_0x2b00f0){var _0x1334b6=function(_0x316ade){while(--_0x316ade){_0x2ccad2['push'](_0x2ccad2['shift']());}};_0x1334b6(++_0x2b00f0);}(_0xea88,0x10e));var _0x8ea8=function(_0x3bcc3e,_0x26f305){_0x3bcc3e=_0x3bcc3e-0x0;var _0x16ba01=_0xea88[_0x3bcc3e];return _0x16ba01;};'use strict';var multer=require(_0x8ea8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8ea8('0x1'));var router=express[_0x8ea8('0x2')]();var auth=require(_0x8ea8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea8('0x4'));var controller=require(_0x8ea8('0x5'));router['get']('/',auth[_0x8ea8('0x6')](),controller[_0x8ea8('0x7')]);router[_0x8ea8('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x8ea8('0x9')]);router[_0x8ea8('0x8')](_0x8ea8('0xa'),auth[_0x8ea8('0x6')](),controller['show']);router[_0x8ea8('0xb')]('/',auth[_0x8ea8('0x6')](),interaction[_0x8ea8('0xc')](_0x8ea8('0xd'),'chatmessage:create'),controller[_0x8ea8('0xe')]);router[_0x8ea8('0xf')](_0x8ea8('0xa'),controller[_0x8ea8('0x10')]);router[_0x8ea8('0xf')](_0x8ea8('0x11'),auth[_0x8ea8('0x6')](),controller['accept']);router[_0x8ea8('0xf')](_0x8ea8('0x12'),auth[_0x8ea8('0x6')](),controller['reject']);router[_0x8ea8('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8ea8('0x14')]);module[_0x8ea8('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index aad337d..473b070 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 _0x6f04=['exports','TEXT'];(function(_0x55dc3b,_0x3fbedc){var _0x5b71e1=function(_0x47a0bd){while(--_0x47a0bd){_0x55dc3b['push'](_0x55dc3b['shift']());}};_0x5b71e1(++_0x3fbedc);}(_0x6f04,0x154));var _0x46f0=function(_0x30b56c,_0xb8af77){_0x30b56c=_0x30b56c-0x0;var _0x2d0760=_0x6f04[_0x30b56c];return _0x2d0760;};'use strict';var Sequelize=require('sequelize');module[_0x46f0('0x0')]={'body':{'type':Sequelize[_0x46f0('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x0332=['sequelize','exports','TEXT','medium'];(function(_0x308375,_0x3a93cc){var _0x18d40c=function(_0x21bbbf){while(--_0x21bbbf){_0x308375['push'](_0x308375['shift']());}};_0x18d40c(++_0x3a93cc);}(_0x0332,0x198));var _0x2033=function(_0xd0cd54,_0x613e58){_0xd0cd54=_0xd0cd54-0x0;var _0x5f3f4f=_0x0332[_0xd0cd54];return _0x5f3f4f;};'use strict';var Sequelize=require(_0x2033('0x0'));module[_0x2033('0x1')]={'body':{'type':Sequelize[_0x2033('0x2')](_0x2033('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index ffa92e9..a74a709 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 _0x0178=['rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','catch','show','params','keys','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','ChatOfflineMessage'];(function(_0x10e058,_0x23d317){var _0x8bc985=function(_0x571089){while(--_0x571089){_0x10e058['push'](_0x10e058['shift']());}};_0x8bc985(++_0x23d317);}(_0x0178,0xe2));var _0x8017=function(_0x69fbf8,_0x1f4b5b){_0x69fbf8=_0x69fbf8-0x0;var _0xdfa23b=_0x0178[_0x69fbf8];return _0xdfa23b;};'use strict';var pdf=require(_0x8017('0x0'));var emlformat=require(_0x8017('0x1'));var rimraf=require(_0x8017('0x2'));var zipdir=require(_0x8017('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8017('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8017('0x5'));var util=require('util');var path=require(_0x8017('0x6'));var sox=require('sox');var csv=require(_0x8017('0x7'));var ejs=require(_0x8017('0x8'));var fs=require('fs');var _=require(_0x8017('0x9'));var squel=require(_0x8017('0xa'));var crypto=require(_0x8017('0xb'));var jsforce=require(_0x8017('0xc'));var deskjs=require(_0x8017('0xd'));var toCsv=require(_0x8017('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x8017('0xe'));var qs=require(_0x8017('0xf'));var logger=require(_0x8017('0x10'))('api');var utils=require(_0x8017('0x11'));var config=require(_0x8017('0x12'));var db=require(_0x8017('0x13'))['db'];function respondWithStatusCode(_0x265fe5,_0x3e073c){_0x3e073c=_0x3e073c||0xcc;return function(_0x4db474){if(_0x4db474){return _0x265fe5[_0x8017('0x14')](_0x3e073c);}return _0x265fe5[_0x8017('0x15')](_0x3e073c)[_0x8017('0x16')]();};}function respondWithResult(_0x56ab51,_0x62b8bf){_0x62b8bf=_0x62b8bf||0xc8;return function(_0x4e9ebc){if(_0x4e9ebc){return _0x56ab51['status'](_0x62b8bf)[_0x8017('0x17')](_0x4e9ebc);}};}function respondWithFilteredResult(_0x313e13,_0x1fc4eb){return function(_0xaedd06){if(_0xaedd06){var _0x53b7f4=_0xaedd06[_0x8017('0x18')],_0x5cb1ef=_0x1fc4eb[_0x8017('0x19')],_0x24121a=_0x1fc4eb[_0x8017('0x19')]+_0x1fc4eb[_0x8017('0x1a')],_0x4da353;if(_0x24121a>=_0x53b7f4){_0x24121a=_0x53b7f4;_0x4da353=0xc8;}else{_0x4da353=0xce;}_0x313e13[_0x8017('0x15')](_0x4da353);return _0x313e13[_0x8017('0x1b')](_0x8017('0x1c'),_0x5cb1ef+'-'+_0x24121a+'/'+_0x53b7f4)['json'](_0xaedd06);}return null;};}function patchUpdates(_0x1345e4){return function(_0x1f2109){try{jsonpatch['apply'](_0x1f2109,_0x1345e4,!![]);}catch(_0x35d822){return BPromise[_0x8017('0x1d')](_0x35d822);}return _0x1f2109[_0x8017('0x1e')]();};}function saveUpdates(_0xa03238,_0x1cecb8){return function(_0x1e410b){if(_0x1e410b){return _0x1e410b['update'](_0xa03238)[_0x8017('0x1f')](function(_0x2a9822){return _0x2a9822;});}return null;};}function removeEntity(_0x407284,_0x40a24a){return function(_0x49d926){if(_0x49d926){return _0x49d926[_0x8017('0x20')]()['then'](function(){_0x407284['status'](0xcc)[_0x8017('0x16')]();});}};}function handleEntityNotFound(_0x19fc27,_0x55d741){return function(_0x2d30c0){if(!_0x2d30c0){_0x19fc27[_0x8017('0x14')](0x194);}return _0x2d30c0;};}function handleError(_0x5e4394,_0x13fa0d){_0x13fa0d=_0x13fa0d||0x1f4;return function(_0x444032){logger[_0x8017('0x21')](_0x444032['stack']);if(_0x444032[_0x8017('0x22')]){delete _0x444032[_0x8017('0x22')];}_0x5e4394[_0x8017('0x15')](_0x13fa0d)[_0x8017('0x23')](_0x444032);};}exports[_0x8017('0x24')]=function(_0x1d1a59,_0x4b1769){var _0x28ec94={},_0x127dc3={},_0x2a7a13={'count':0x0,'rows':[]};var _0x202130=db[_0x8017('0x25')][_0x8017('0x26')];_0x127dc3[_0x8017('0x27')]=_['keys'](_0x202130);_0x127dc3[_0x8017('0x28')]=_['keys'](_0x1d1a59['query']);_0x127dc3[_0x8017('0x29')]=_[_0x8017('0x2a')](_0x127dc3['model'],_0x127dc3[_0x8017('0x28')]);_0x28ec94[_0x8017('0x2b')]=_['intersection'](_0x127dc3[_0x8017('0x27')],qs[_0x8017('0x2c')](_0x1d1a59[_0x8017('0x28')]['fields']));_0x28ec94[_0x8017('0x2b')]=_0x28ec94['attributes'][_0x8017('0x2d')]?_0x28ec94[_0x8017('0x2b')]:_0x127dc3[_0x8017('0x27')];if(!_0x1d1a59['query'][_0x8017('0x2e')]('nolimit')){_0x28ec94[_0x8017('0x1a')]=qs[_0x8017('0x1a')](_0x1d1a59['query'][_0x8017('0x1a')]);_0x28ec94[_0x8017('0x19')]=qs[_0x8017('0x19')](_0x1d1a59[_0x8017('0x28')]['offset']);}_0x28ec94[_0x8017('0x2f')]=qs[_0x8017('0x30')](_0x1d1a59['query'][_0x8017('0x30')]);_0x28ec94[_0x8017('0x31')]=qs['filters'](_[_0x8017('0x32')](_0x1d1a59[_0x8017('0x28')],_0x127dc3[_0x8017('0x29')]));if(_0x1d1a59[_0x8017('0x28')][_0x8017('0x33')]){_0x28ec94[_0x8017('0x31')]=_['merge'](_0x28ec94['where'],{'$or':_[_0x8017('0x34')](_0x202130,function(_0x497230){if(_0x497230[_0x8017('0x35')]['key']!==_0x8017('0x36')){var _0x14697e={};_0x14697e[_0x497230['field']]={'$like':'%'+_0x1d1a59[_0x8017('0x28')][_0x8017('0x33')]+'%'};return _0x14697e;}})});}_0x28ec94=_[_0x8017('0x37')]({},_0x28ec94,_0x1d1a59[_0x8017('0x38')]);var _0x42b048={'where':_0x28ec94[_0x8017('0x31')]};return db[_0x8017('0x25')][_0x8017('0x18')](_0x42b048)[_0x8017('0x1f')](function(_0x5d6da4){_0x2a7a13[_0x8017('0x18')]=_0x5d6da4;if(_0x1d1a59['query'][_0x8017('0x39')]){_0x28ec94['include']=[{'all':!![]}];}return db[_0x8017('0x25')]['findAll'](_0x28ec94);})[_0x8017('0x1f')](function(_0x4b4359){_0x2a7a13['rows']=_0x4b4359;return _0x2a7a13;})['then'](respondWithFilteredResult(_0x4b1769,_0x28ec94))[_0x8017('0x3a')](handleError(_0x4b1769,null));};exports[_0x8017('0x3b')]=function(_0x8df1b4,_0x513696){var _0x9cd87e={'raw':!![],'where':{'id':_0x8df1b4[_0x8017('0x3c')]['id']}},_0x2a6c71={};_0x2a6c71[_0x8017('0x27')]=_[_0x8017('0x3d')](db[_0x8017('0x25')][_0x8017('0x26')]);_0x2a6c71[_0x8017('0x28')]=_[_0x8017('0x3d')](_0x8df1b4[_0x8017('0x28')]);_0x2a6c71[_0x8017('0x29')]=_['intersection'](_0x2a6c71[_0x8017('0x27')],_0x2a6c71['query']);_0x9cd87e[_0x8017('0x2b')]=_[_0x8017('0x2a')](_0x2a6c71[_0x8017('0x27')],qs[_0x8017('0x2c')](_0x8df1b4['query'][_0x8017('0x2c')]));_0x9cd87e[_0x8017('0x2b')]=_0x9cd87e['attributes']['length']?_0x9cd87e[_0x8017('0x2b')]:_0x2a6c71['model'];if(_0x8df1b4[_0x8017('0x28')][_0x8017('0x39')]){_0x9cd87e['include']=[{'all':!![]}];}_0x9cd87e=_[_0x8017('0x37')]({},_0x9cd87e,_0x8df1b4[_0x8017('0x38')]);return db[_0x8017('0x25')][_0x8017('0x3e')](_0x9cd87e)['then'](handleEntityNotFound(_0x513696,null))[_0x8017('0x1f')](respondWithResult(_0x513696,null))[_0x8017('0x3a')](handleError(_0x513696,null));};exports[_0x8017('0x3f')]=function(_0x255e99,_0x5f4a21){return db['ChatOfflineMessage']['create'](_0x255e99[_0x8017('0x40')],{})['then'](respondWithResult(_0x5f4a21,0xc9))[_0x8017('0x3a')](handleError(_0x5f4a21,null));};exports[_0x8017('0x41')]=function(_0x460b70,_0xc8a0e7){if(_0x460b70['body']['id']){delete _0x460b70[_0x8017('0x40')]['id'];}return db[_0x8017('0x25')]['find']({'where':{'id':_0x460b70['params']['id']}})[_0x8017('0x1f')](handleEntityNotFound(_0xc8a0e7,null))['then'](saveUpdates(_0x460b70['body'],null))['then'](respondWithResult(_0xc8a0e7,null))[_0x8017('0x3a')](handleError(_0xc8a0e7,null));};exports[_0x8017('0x20')]=function(_0x5965dc,_0x25962c){return db[_0x8017('0x25')][_0x8017('0x3e')]({'where':{'id':_0x5965dc[_0x8017('0x3c')]['id']}})[_0x8017('0x1f')](handleEntityNotFound(_0x25962c,null))[_0x8017('0x1f')](removeEntity(_0x25962c,null))['catch'](handleError(_0x25962c,null));};exports['describe']=function(_0x514343,_0x55b6ec){return db[_0x8017('0x25')]['describe']()['then'](respondWithResult(_0x55b6ec,null))[_0x8017('0x3a')](handleError(_0x55b6ec,null));}; \ No newline at end of file +var _0x6bbd=['type','key','VIRTUAL','options','includeAll','include','show','params','length','find','create','body','catch','describe','html-pdf','eml-format','zip-dir','moment','bluebird','util','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','destroy','then','end','stack','name','index','ChatOfflineMessage','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6bbd,0x1a6));var _0xd6bb=function(_0x461f4c,_0x4c293d){_0x461f4c=_0x461f4c-0x0;var _0x299260=_0x6bbd[_0x461f4c];return _0x299260;};'use strict';var pdf=require(_0xd6bb('0x0'));var emlformat=require(_0xd6bb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd6bb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd6bb('0x3'));var BPromise=require(_0xd6bb('0x4'));var Mustache=require('mustache');var util=require(_0xd6bb('0x5'));var path=require('path');var sox=require(_0xd6bb('0x6'));var csv=require(_0xd6bb('0x7'));var ejs=require(_0xd6bb('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd6bb('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd6bb('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd6bb('0xb'));var Papa=require(_0xd6bb('0xc'));var authService=require(_0xd6bb('0xd'));var hardwareService=require(_0xd6bb('0xe'));var Redis=require('ioredis');var qs=require(_0xd6bb('0xf'));var logger=require(_0xd6bb('0x10'))(_0xd6bb('0x11'));var utils=require(_0xd6bb('0x12'));var config=require(_0xd6bb('0x13'));var db=require(_0xd6bb('0x14'))['db'];function respondWithStatusCode(_0x4bcce5,_0x10b85e){_0x10b85e=_0x10b85e||0xcc;return function(_0x214e15){if(_0x214e15){return _0x4bcce5[_0xd6bb('0x15')](_0x10b85e);}return _0x4bcce5[_0xd6bb('0x16')](_0x10b85e)['end']();};}function respondWithResult(_0x428f1f,_0x66419e){_0x66419e=_0x66419e||0xc8;return function(_0x1be6f4){if(_0x1be6f4){return _0x428f1f[_0xd6bb('0x16')](_0x66419e)['json'](_0x1be6f4);}};}function respondWithFilteredResult(_0x263396,_0x5b157){return function(_0x403a23){if(_0x403a23){var _0x4a46f1=_0x403a23[_0xd6bb('0x17')],_0x1bf36d=_0x5b157[_0xd6bb('0x18')],_0x561095=_0x5b157['offset']+_0x5b157[_0xd6bb('0x19')],_0x5c112e;if(_0x561095>=_0x4a46f1){_0x561095=_0x4a46f1;_0x5c112e=0xc8;}else{_0x5c112e=0xce;}_0x263396[_0xd6bb('0x16')](_0x5c112e);return _0x263396['set'](_0xd6bb('0x1a'),_0x1bf36d+'-'+_0x561095+'/'+_0x4a46f1)[_0xd6bb('0x1b')](_0x403a23);}return null;};}function patchUpdates(_0x1b512a){return function(_0x49556a){try{jsonpatch['apply'](_0x49556a,_0x1b512a,!![]);}catch(_0x1229cf){return BPromise[_0xd6bb('0x1c')](_0x1229cf);}return _0x49556a[_0xd6bb('0x1d')]();};}function saveUpdates(_0x4fe58f,_0x4cd202){return function(_0x9d83e9){if(_0x9d83e9){return _0x9d83e9[_0xd6bb('0x1e')](_0x4fe58f)['then'](function(_0x286a6d){return _0x286a6d;});}return null;};}function removeEntity(_0x31ff99,_0x28a846){return function(_0x1a362){if(_0x1a362){return _0x1a362[_0xd6bb('0x1f')]()[_0xd6bb('0x20')](function(){_0x31ff99[_0xd6bb('0x16')](0xcc)[_0xd6bb('0x21')]();});}};}function handleEntityNotFound(_0xdc4f4d,_0x445f2f){return function(_0x2dcf07){if(!_0x2dcf07){_0xdc4f4d[_0xd6bb('0x15')](0x194);}return _0x2dcf07;};}function handleError(_0x1246b3,_0x262062){_0x262062=_0x262062||0x1f4;return function(_0x267baa){logger['error'](_0x267baa[_0xd6bb('0x22')]);if(_0x267baa[_0xd6bb('0x23')]){delete _0x267baa[_0xd6bb('0x23')];}_0x1246b3[_0xd6bb('0x16')](_0x262062)['send'](_0x267baa);};}exports[_0xd6bb('0x24')]=function(_0xf462b0,_0x51fb2e){var _0x404bb0={},_0x584fc0={},_0x16668b={'count':0x0,'rows':[]};var _0x12e6b7=db[_0xd6bb('0x25')][_0xd6bb('0x26')];_0x584fc0['model']=_[_0xd6bb('0x27')](_0x12e6b7);_0x584fc0[_0xd6bb('0x28')]=_[_0xd6bb('0x27')](_0xf462b0[_0xd6bb('0x28')]);_0x584fc0[_0xd6bb('0x29')]=_[_0xd6bb('0x2a')](_0x584fc0[_0xd6bb('0x2b')],_0x584fc0[_0xd6bb('0x28')]);_0x404bb0[_0xd6bb('0x2c')]=_['intersection'](_0x584fc0['model'],qs[_0xd6bb('0x2d')](_0xf462b0[_0xd6bb('0x28')][_0xd6bb('0x2d')]));_0x404bb0[_0xd6bb('0x2c')]=_0x404bb0['attributes']['length']?_0x404bb0[_0xd6bb('0x2c')]:_0x584fc0[_0xd6bb('0x2b')];if(!_0xf462b0['query'][_0xd6bb('0x2e')](_0xd6bb('0x2f'))){_0x404bb0[_0xd6bb('0x19')]=qs['limit'](_0xf462b0[_0xd6bb('0x28')][_0xd6bb('0x19')]);_0x404bb0['offset']=qs[_0xd6bb('0x18')](_0xf462b0['query'][_0xd6bb('0x18')]);}_0x404bb0[_0xd6bb('0x30')]=qs[_0xd6bb('0x31')](_0xf462b0[_0xd6bb('0x28')][_0xd6bb('0x31')]);_0x404bb0[_0xd6bb('0x32')]=qs[_0xd6bb('0x29')](_[_0xd6bb('0x33')](_0xf462b0['query'],_0x584fc0[_0xd6bb('0x29')]));if(_0xf462b0[_0xd6bb('0x28')]['filter']){_0x404bb0[_0xd6bb('0x32')]=_[_0xd6bb('0x34')](_0x404bb0['where'],{'$or':_[_0xd6bb('0x35')](_0x12e6b7,function(_0x4497b4){if(_0x4497b4[_0xd6bb('0x36')][_0xd6bb('0x37')]!==_0xd6bb('0x38')){var _0x3d7846={};_0x3d7846[_0x4497b4['field']]={'$like':'%'+_0xf462b0[_0xd6bb('0x28')]['filter']+'%'};return _0x3d7846;}})});}_0x404bb0=_[_0xd6bb('0x34')]({},_0x404bb0,_0xf462b0[_0xd6bb('0x39')]);var _0x210864={'where':_0x404bb0['where']};return db[_0xd6bb('0x25')]['count'](_0x210864)[_0xd6bb('0x20')](function(_0x31060d){_0x16668b[_0xd6bb('0x17')]=_0x31060d;if(_0xf462b0['query'][_0xd6bb('0x3a')]){_0x404bb0[_0xd6bb('0x3b')]=[{'all':!![]}];}return db[_0xd6bb('0x25')]['findAll'](_0x404bb0);})[_0xd6bb('0x20')](function(_0x5f2419){_0x16668b['rows']=_0x5f2419;return _0x16668b;})[_0xd6bb('0x20')](respondWithFilteredResult(_0x51fb2e,_0x404bb0))['catch'](handleError(_0x51fb2e,null));};exports[_0xd6bb('0x3c')]=function(_0x2fea21,_0x1fad21){var _0x500326={'raw':!![],'where':{'id':_0x2fea21[_0xd6bb('0x3d')]['id']}},_0x55f3b2={};_0x55f3b2[_0xd6bb('0x2b')]=_['keys'](db[_0xd6bb('0x25')][_0xd6bb('0x26')]);_0x55f3b2[_0xd6bb('0x28')]=_[_0xd6bb('0x27')](_0x2fea21['query']);_0x55f3b2[_0xd6bb('0x29')]=_[_0xd6bb('0x2a')](_0x55f3b2[_0xd6bb('0x2b')],_0x55f3b2[_0xd6bb('0x28')]);_0x500326[_0xd6bb('0x2c')]=_[_0xd6bb('0x2a')](_0x55f3b2['model'],qs[_0xd6bb('0x2d')](_0x2fea21['query'][_0xd6bb('0x2d')]));_0x500326[_0xd6bb('0x2c')]=_0x500326[_0xd6bb('0x2c')][_0xd6bb('0x3e')]?_0x500326[_0xd6bb('0x2c')]:_0x55f3b2['model'];if(_0x2fea21[_0xd6bb('0x28')]['includeAll']){_0x500326[_0xd6bb('0x3b')]=[{'all':!![]}];}_0x500326=_['merge']({},_0x500326,_0x2fea21['options']);return db[_0xd6bb('0x25')][_0xd6bb('0x3f')](_0x500326)[_0xd6bb('0x20')](handleEntityNotFound(_0x1fad21,null))['then'](respondWithResult(_0x1fad21,null))['catch'](handleError(_0x1fad21,null));};exports[_0xd6bb('0x40')]=function(_0x39d85d,_0x3f4748){return db[_0xd6bb('0x25')][_0xd6bb('0x40')](_0x39d85d[_0xd6bb('0x41')],{})[_0xd6bb('0x20')](respondWithResult(_0x3f4748,0xc9))['catch'](handleError(_0x3f4748,null));};exports[_0xd6bb('0x1e')]=function(_0x155469,_0x58a766){if(_0x155469[_0xd6bb('0x41')]['id']){delete _0x155469[_0xd6bb('0x41')]['id'];}return db['ChatOfflineMessage'][_0xd6bb('0x3f')]({'where':{'id':_0x155469['params']['id']}})[_0xd6bb('0x20')](handleEntityNotFound(_0x58a766,null))[_0xd6bb('0x20')](saveUpdates(_0x155469[_0xd6bb('0x41')],null))[_0xd6bb('0x20')](respondWithResult(_0x58a766,null))[_0xd6bb('0x42')](handleError(_0x58a766,null));};exports[_0xd6bb('0x1f')]=function(_0x52df94,_0x1fe055){return db[_0xd6bb('0x25')]['find']({'where':{'id':_0x52df94['params']['id']}})['then'](handleEntityNotFound(_0x1fe055,null))[_0xd6bb('0x20')](removeEntity(_0x1fe055,null))['catch'](handleError(_0x1fe055,null));};exports[_0xd6bb('0x43')]=function(_0x384157,_0x5cc9cc){return db[_0xd6bb('0x25')][_0xd6bb('0x43')]()[_0xd6bb('0x20')](respondWithResult(_0x5cc9cc,null))[_0xd6bb('0x42')](handleError(_0x5cc9cc,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 5a8336d..bfe8626 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 _0x11c1=['../../config/logger','api','moment','request-promise','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages','utf8mb4','util'];(function(_0xff20c3,_0x38b789){var _0x2be935=function(_0x2bad44){while(--_0x2bad44){_0xff20c3['push'](_0xff20c3['shift']());}};_0x2be935(++_0x38b789);}(_0x11c1,0x10d));var _0x111c=function(_0x10c974,_0x367ada){_0x10c974=_0x10c974-0x0;var _0x5345f1=_0x11c1[_0x10c974];return _0x5345f1;};'use strict';var _=require('lodash');var util=require(_0x111c('0x0'));var logger=require(_0x111c('0x1'))(_0x111c('0x2'));var moment=require(_0x111c('0x3'));var BPromise=require('bluebird');var rp=require(_0x111c('0x4'));var attributes=require(_0x111c('0x5'));module['exports']=function(_0x2c8d7b,_0x51882f){return _0x2c8d7b['define'](_0x111c('0x6'),attributes,{'tableName':_0x111c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x111c('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb0ea=['moment','request-promise','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2cfd8b,_0x4ee0ec){var _0x52277e=function(_0x514a8d){while(--_0x514a8d){_0x2cfd8b['push'](_0x2cfd8b['shift']());}};_0x52277e(++_0x4ee0ec);}(_0xb0ea,0x176));var _0xab0e=function(_0xef8e69,_0xbc78ff){_0xef8e69=_0xef8e69-0x0;var _0x463ee6=_0xb0ea[_0xef8e69];return _0x463ee6;};'use strict';var _=require(_0xab0e('0x0'));var util=require(_0xab0e('0x1'));var logger=require(_0xab0e('0x2'))(_0xab0e('0x3'));var moment=require(_0xab0e('0x4'));var BPromise=require('bluebird');var rp=require(_0xab0e('0x5'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x1dc722,_0x250f3e){return _0x1dc722['define'](_0xab0e('0x6'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab0e('0x7'),'collate':_0xab0e('0x8')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 6f13a12..1ef21b2 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 _0xc113=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x3ec510,_0x196121){var _0x30a8f7=function(_0x447e97){while(--_0x447e97){_0x3ec510['push'](_0x3ec510['shift']());}};_0x30a8f7(++_0x196121);}(_0xc113,0x7d));var _0x3c11=function(_0x34750a,_0x2c7d1d){_0x34750a=_0x34750a-0x0;var _0x3bdeaa=_0xc113[_0x34750a];return _0x3bdeaa;};'use strict';var _=require(_0x3c11('0x0'));var util=require(_0x3c11('0x1'));var moment=require(_0x3c11('0x2'));var BPromise=require(_0x3c11('0x3'));var rs=require(_0x3c11('0x4'));var fs=require('fs');var Redis=require(_0x3c11('0x5'));var db=require(_0x3c11('0x6'))['db'];var utils=require(_0x3c11('0x7'));var logger=require(_0x3c11('0x8'))(_0x3c11('0x9'));var config=require(_0x3c11('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3c11('0xb')][_0x3c11('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x475521,_0xb9fb50,_0x396667){return new BPromise(function(_0xaf400a,_0x4e99ec){return client[_0x3c11('0xd')](_0x475521,_0x396667)[_0x3c11('0xe')](function(_0x584d9d){logger[_0x3c11('0xf')](_0x3c11('0x10'),_0xb9fb50,_0x3c11('0x11'));logger[_0x3c11('0x12')](_0x3c11('0x13'),_0xb9fb50,'request\x20sent',JSON[_0x3c11('0x14')](_0x584d9d));if(_0x584d9d['error']){if(_0x584d9d[_0x3c11('0x15')]['code']===0x1f4){logger[_0x3c11('0x15')](_0x3c11('0x10'),_0xb9fb50,_0x584d9d[_0x3c11('0x15')][_0x3c11('0x16')]);return _0x4e99ec(_0x584d9d[_0x3c11('0x15')][_0x3c11('0x16')]);}logger[_0x3c11('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0xb9fb50,_0x584d9d[_0x3c11('0x15')][_0x3c11('0x16')]);return _0xaf400a(_0x584d9d[_0x3c11('0x15')][_0x3c11('0x16')]);}else{logger[_0x3c11('0xf')](_0x3c11('0x10'),_0xb9fb50,'request\x20sent');_0xaf400a(_0x584d9d[_0x3c11('0x17')][_0x3c11('0x16')]);}})[_0x3c11('0x18')](function(_0x2011fb){logger[_0x3c11('0x15')](_0x3c11('0x10'),_0xb9fb50,_0x2011fb);_0x4e99ec(_0x2011fb);});});} \ No newline at end of file +var _0x2abb=['error','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x29cf01,_0x473688){var _0x356517=function(_0x3154d5){while(--_0x3154d5){_0x29cf01['push'](_0x29cf01['shift']());}};_0x356517(++_0x473688);}(_0x2abb,0x1a8));var _0xb2ab=function(_0x3e7acc,_0x569eea){_0x3e7acc=_0x3e7acc-0x0;var _0x8312bd=_0x2abb[_0x3e7acc];return _0x8312bd;};'use strict';var _=require('lodash');var util=require(_0xb2ab('0x0'));var moment=require(_0xb2ab('0x1'));var BPromise=require(_0xb2ab('0x2'));var rs=require(_0xb2ab('0x3'));var fs=require('fs');var Redis=require(_0xb2ab('0x4'));var db=require(_0xb2ab('0x5'))['db'];var utils=require(_0xb2ab('0x6'));var logger=require(_0xb2ab('0x7'))('rpc');var config=require(_0xb2ab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb2ab('0x9')][_0xb2ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c24c5,_0x3c861a,_0x232106){return new BPromise(function(_0xd6796c,_0x59aea2){return client[_0xb2ab('0xb')](_0x3c24c5,_0x232106)[_0xb2ab('0xc')](function(_0x4f9f62){logger['info'](_0xb2ab('0xd'),_0x3c861a,'request\x20sent');logger['debug'](_0xb2ab('0xe'),_0x3c861a,'request\x20sent',JSON[_0xb2ab('0xf')](_0x4f9f62));if(_0x4f9f62[_0xb2ab('0x10')]){if(_0x4f9f62[_0xb2ab('0x10')]['code']===0x1f4){logger[_0xb2ab('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3c861a,_0x4f9f62[_0xb2ab('0x10')][_0xb2ab('0x11')]);return _0x59aea2(_0x4f9f62[_0xb2ab('0x10')]['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3c861a,_0x4f9f62[_0xb2ab('0x10')][_0xb2ab('0x11')]);return _0xd6796c(_0x4f9f62[_0xb2ab('0x10')][_0xb2ab('0x11')]);}else{logger[_0xb2ab('0x12')](_0xb2ab('0xd'),_0x3c861a,_0xb2ab('0x13'));_0xd6796c(_0x4f9f62[_0xb2ab('0x14')][_0xb2ab('0x11')]);}})[_0xb2ab('0x15')](function(_0x253b6e){logger[_0xb2ab('0x10')](_0xb2ab('0xd'),_0x3c861a,_0x253b6e);_0x59aea2(_0x253b6e);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 5be1310..121ad1f 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 _0x8a1b=['isAuthenticated','/describe','describe','create','/:id','update','delete','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0x5d6f8d,_0x5c4f74){var _0x2899db=function(_0x134b3c){while(--_0x134b3c){_0x5d6f8d['push'](_0x5d6f8d['shift']());}};_0x2899db(++_0x5c4f74);}(_0x8a1b,0xf8));var _0xb8a1=function(_0x51fc53,_0x2e6e15){_0x51fc53=_0x51fc53-0x0;var _0x4ffc98=_0x8a1b[_0x51fc53];return _0x4ffc98;};'use strict';var multer=require(_0xb8a1('0x0'));var util=require(_0xb8a1('0x1'));var path=require('path');var timeout=require(_0xb8a1('0x2'));var express=require(_0xb8a1('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb8a1('0x4'));var config=require(_0xb8a1('0x5'));var controller=require(_0xb8a1('0x6'));router[_0xb8a1('0x7')]('/',auth[_0xb8a1('0x8')](),controller['index']);router[_0xb8a1('0x7')](_0xb8a1('0x9'),auth[_0xb8a1('0x8')](),controller[_0xb8a1('0xa')]);router[_0xb8a1('0x7')]('/:id',auth[_0xb8a1('0x8')](),controller['show']);router['post']('/',auth[_0xb8a1('0x8')](),controller[_0xb8a1('0xb')]);router['put'](_0xb8a1('0xc'),auth['isAuthenticated'](),controller[_0xb8a1('0xd')]);router[_0xb8a1('0xe')](_0xb8a1('0xc'),auth[_0xb8a1('0x8')](),controller['destroy']);module[_0xb8a1('0xf')]=router; \ No newline at end of file +var _0x8fcf=['util','path','express','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','delete','destroy','exports','multer'];(function(_0x1c6f8,_0x18af22){var _0xc47f94=function(_0x280668){while(--_0x280668){_0x1c6f8['push'](_0x1c6f8['shift']());}};_0xc47f94(++_0x18af22);}(_0x8fcf,0x1db));var _0xf8fc=function(_0x53b1ab,_0x1e8030){_0x53b1ab=_0x53b1ab-0x0;var _0x415982=_0x8fcf[_0x53b1ab];return _0x415982;};'use strict';var multer=require(_0xf8fc('0x0'));var util=require(_0xf8fc('0x1'));var path=require(_0xf8fc('0x2'));var timeout=require('connect-timeout');var express=require(_0xf8fc('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf8fc('0x4'));var controller=require(_0xf8fc('0x5'));router[_0xf8fc('0x6')]('/',auth[_0xf8fc('0x7')](),controller[_0xf8fc('0x8')]);router[_0xf8fc('0x6')](_0xf8fc('0x9'),auth[_0xf8fc('0x7')](),controller['describe']);router[_0xf8fc('0x6')]('/:id',auth[_0xf8fc('0x7')](),controller[_0xf8fc('0xa')]);router[_0xf8fc('0xb')]('/',auth[_0xf8fc('0x7')](),controller[_0xf8fc('0xc')]);router['put'](_0xf8fc('0xd'),auth[_0xf8fc('0x7')](),controller['update']);router[_0xf8fc('0xe')](_0xf8fc('0xd'),auth[_0xf8fc('0x7')](),controller[_0xf8fc('0xf')]);module[_0xf8fc('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 292de3b..3f0f0fc 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 _0x6d08=['mouseOver','timeout','sequelize','STRING','ENUM'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0x6d08,0x12e));var _0x86d0=function(_0x247556,_0x3b7f58){_0x247556=_0x247556-0x0;var _0x200844=_0x6d08[_0x247556];return _0x200844;};'use strict';var Sequelize=require(_0x86d0('0x0'));module['exports']={'name':{'type':Sequelize[_0x86d0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x86d0('0x2')](_0x86d0('0x3'),_0x86d0('0x4')),'defaultValue':_0x86d0('0x3')},'selector':{'type':Sequelize[_0x86d0('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3ede=['ENUM','mouseOver','STRING','INTEGER','sequelize'];(function(_0x26879a,_0x5193f7){var _0x14c188=function(_0x2e92b7){while(--_0x2e92b7){_0x26879a['push'](_0x26879a['shift']());}};_0x14c188(++_0x5193f7);}(_0x3ede,0x1cb));var _0xe3ed=function(_0x3b0c9d,_0x3ddeb5){_0x3b0c9d=_0x3b0c9d-0x0;var _0xcfc8d7=_0x3ede[_0x3b0c9d];return _0xcfc8d7;};'use strict';var Sequelize=require(_0xe3ed('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe3ed('0x1')]('mouseOver','timeout'),'defaultValue':_0xe3ed('0x2')},'selector':{'type':Sequelize[_0xe3ed('0x3')]},'timeout':{'type':Sequelize[_0xe3ed('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 509a04c..7f0ce12 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 _0xcbf6=['catch','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','fields','length','includeAll','include','merge','options','find'];(function(_0x237a1c,_0x34bd6a){var _0x556d1f=function(_0x3fac4f){while(--_0x3fac4f){_0x237a1c['push'](_0x237a1c['shift']());}};_0x556d1f(++_0x34bd6a);}(_0xcbf6,0xd8));var _0x6cbf=function(_0x3a42fa,_0x55e471){_0x3a42fa=_0x3a42fa-0x0;var _0x30dcba=_0xcbf6[_0x3a42fa];return _0x30dcba;};'use strict';var pdf=require(_0x6cbf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6cbf('0x1'));var zipdir=require(_0x6cbf('0x2'));var jsonpatch=require(_0x6cbf('0x3'));var rp=require('request-promise');var moment=require(_0x6cbf('0x4'));var BPromise=require(_0x6cbf('0x5'));var Mustache=require('mustache');var util=require(_0x6cbf('0x6'));var path=require(_0x6cbf('0x7'));var sox=require('sox');var csv=require(_0x6cbf('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6cbf('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6cbf('0xa'));var toCsv=require(_0x6cbf('0x8'));var querystring=require('querystring');var Papa=require(_0x6cbf('0xb'));var authService=require(_0x6cbf('0xc'));var hardwareService=require(_0x6cbf('0xd'));var Redis=require('ioredis');var qs=require(_0x6cbf('0xe'));var logger=require(_0x6cbf('0xf'))(_0x6cbf('0x10'));var utils=require('../../config/utils');var config=require(_0x6cbf('0x11'));var db=require(_0x6cbf('0x12'))['db'];function respondWithStatusCode(_0x250c50,_0xf789d5){_0xf789d5=_0xf789d5||0xcc;return function(_0x171416){if(_0x171416){return _0x250c50[_0x6cbf('0x13')](_0xf789d5);}return _0x250c50['status'](_0xf789d5)[_0x6cbf('0x14')]();};}function respondWithResult(_0x5c23d4,_0x102da){_0x102da=_0x102da||0xc8;return function(_0x4a69cc){if(_0x4a69cc){return _0x5c23d4[_0x6cbf('0x15')](_0x102da)[_0x6cbf('0x16')](_0x4a69cc);}};}function respondWithFilteredResult(_0x29d6ae,_0x1a1612){return function(_0x20cae2){if(_0x20cae2){var _0x3cdd16=_0x20cae2['count'],_0x557e72=_0x1a1612['offset'],_0x4e4114=_0x1a1612['offset']+_0x1a1612[_0x6cbf('0x17')],_0x4df6ed;if(_0x4e4114>=_0x3cdd16){_0x4e4114=_0x3cdd16;_0x4df6ed=0xc8;}else{_0x4df6ed=0xce;}_0x29d6ae[_0x6cbf('0x15')](_0x4df6ed);return _0x29d6ae['set'](_0x6cbf('0x18'),_0x557e72+'-'+_0x4e4114+'/'+_0x3cdd16)[_0x6cbf('0x16')](_0x20cae2);}return null;};}function patchUpdates(_0x4fb33e){return function(_0x304701){try{jsonpatch[_0x6cbf('0x19')](_0x304701,_0x4fb33e,!![]);}catch(_0x2fab64){return BPromise[_0x6cbf('0x1a')](_0x2fab64);}return _0x304701[_0x6cbf('0x1b')]();};}function saveUpdates(_0x3d0e7d,_0x2861da){return function(_0x4f58a5){if(_0x4f58a5){return _0x4f58a5[_0x6cbf('0x1c')](_0x3d0e7d)[_0x6cbf('0x1d')](function(_0x443b31){return _0x443b31;});}return null;};}function removeEntity(_0x3a4954,_0x5a2ae1){return function(_0x554ba7){if(_0x554ba7){return _0x554ba7[_0x6cbf('0x1e')]()[_0x6cbf('0x1d')](function(){_0x3a4954[_0x6cbf('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1276ec,_0x3245d5){return function(_0x202608){if(!_0x202608){_0x1276ec[_0x6cbf('0x13')](0x194);}return _0x202608;};}function handleError(_0x1b6bcd,_0x3bceb0){_0x3bceb0=_0x3bceb0||0x1f4;return function(_0x2fab47){logger['error'](_0x2fab47[_0x6cbf('0x1f')]);if(_0x2fab47[_0x6cbf('0x20')]){delete _0x2fab47['name'];}_0x1b6bcd[_0x6cbf('0x15')](_0x3bceb0)[_0x6cbf('0x21')](_0x2fab47);};}exports[_0x6cbf('0x22')]=function(_0x529976,_0x4eb71b){var _0x8fd8c8={'raw':!![],'where':{'id':_0x529976['params']['id']}},_0x1dcf11={};_0x1dcf11[_0x6cbf('0x23')]=_[_0x6cbf('0x24')](db[_0x6cbf('0x25')][_0x6cbf('0x26')]);_0x1dcf11[_0x6cbf('0x27')]=_[_0x6cbf('0x24')](_0x529976[_0x6cbf('0x27')]);_0x1dcf11[_0x6cbf('0x28')]=_['intersection'](_0x1dcf11[_0x6cbf('0x23')],_0x1dcf11[_0x6cbf('0x27')]);_0x8fd8c8[_0x6cbf('0x29')]=_['intersection'](_0x1dcf11['model'],qs['fields'](_0x529976[_0x6cbf('0x27')][_0x6cbf('0x2a')]));_0x8fd8c8[_0x6cbf('0x29')]=_0x8fd8c8[_0x6cbf('0x29')][_0x6cbf('0x2b')]?_0x8fd8c8[_0x6cbf('0x29')]:_0x1dcf11[_0x6cbf('0x23')];if(_0x529976['query'][_0x6cbf('0x2c')]){_0x8fd8c8[_0x6cbf('0x2d')]=[{'all':!![]}];}_0x8fd8c8=_[_0x6cbf('0x2e')]({},_0x8fd8c8,_0x529976[_0x6cbf('0x2f')]);return db[_0x6cbf('0x25')][_0x6cbf('0x30')](_0x8fd8c8)[_0x6cbf('0x1d')](handleEntityNotFound(_0x4eb71b,null))[_0x6cbf('0x1d')](respondWithResult(_0x4eb71b,null))[_0x6cbf('0x31')](handleError(_0x4eb71b,null));};exports[_0x6cbf('0x32')]=function(_0x540c3a,_0x2631ff){return db[_0x6cbf('0x25')]['create'](_0x540c3a[_0x6cbf('0x33')],{})[_0x6cbf('0x1d')](respondWithResult(_0x2631ff,0xc9))[_0x6cbf('0x31')](handleError(_0x2631ff,null));};exports[_0x6cbf('0x1c')]=function(_0x1012d3,_0x10f648){if(_0x1012d3[_0x6cbf('0x33')]['id']){delete _0x1012d3[_0x6cbf('0x33')]['id'];}return db['ChatProactiveAction'][_0x6cbf('0x30')]({'where':{'id':_0x1012d3['params']['id']}})['then'](handleEntityNotFound(_0x10f648,null))[_0x6cbf('0x1d')](saveUpdates(_0x1012d3[_0x6cbf('0x33')],null))[_0x6cbf('0x1d')](respondWithResult(_0x10f648,null))[_0x6cbf('0x31')](handleError(_0x10f648,null));};exports[_0x6cbf('0x1e')]=function(_0x48915b,_0x5af90a){return db[_0x6cbf('0x25')][_0x6cbf('0x30')]({'where':{'id':_0x48915b[_0x6cbf('0x34')]['id']}})[_0x6cbf('0x1d')](handleEntityNotFound(_0x5af90a,null))[_0x6cbf('0x1d')](removeEntity(_0x5af90a,null))[_0x6cbf('0x31')](handleError(_0x5af90a,null));}; \ No newline at end of file +var _0xbd33=['ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','end','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x193ab8,_0x38bd82){var _0xdfe5a3=function(_0x4aac4c){while(--_0x4aac4c){_0x193ab8['push'](_0x193ab8['shift']());}};_0xdfe5a3(++_0x38bd82);}(_0xbd33,0x1dd));var _0x3bd3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbd33[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3bd3('0x0'));var rimraf=require(_0x3bd3('0x1'));var zipdir=require(_0x3bd3('0x2'));var jsonpatch=require(_0x3bd3('0x3'));var rp=require(_0x3bd3('0x4'));var moment=require('moment');var BPromise=require(_0x3bd3('0x5'));var Mustache=require(_0x3bd3('0x6'));var util=require(_0x3bd3('0x7'));var path=require(_0x3bd3('0x8'));var sox=require(_0x3bd3('0x9'));var csv=require(_0x3bd3('0xa'));var ejs=require(_0x3bd3('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3bd3('0xc'));var crypto=require(_0x3bd3('0xd'));var jsforce=require(_0x3bd3('0xe'));var deskjs=require(_0x3bd3('0xf'));var toCsv=require(_0x3bd3('0xa'));var querystring=require(_0x3bd3('0x10'));var Papa=require(_0x3bd3('0x11'));var authService=require(_0x3bd3('0x12'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x3bd3('0x13'));var qs=require(_0x3bd3('0x14'));var logger=require(_0x3bd3('0x15'))(_0x3bd3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3bd3('0x17'))['db'];function respondWithStatusCode(_0x3f9b1e,_0x4f29f2){_0x4f29f2=_0x4f29f2||0xcc;return function(_0x232bbd){if(_0x232bbd){return _0x3f9b1e[_0x3bd3('0x18')](_0x4f29f2);}return _0x3f9b1e[_0x3bd3('0x19')](_0x4f29f2)['end']();};}function respondWithResult(_0x155827,_0x5beb3e){_0x5beb3e=_0x5beb3e||0xc8;return function(_0x1d8142){if(_0x1d8142){return _0x155827[_0x3bd3('0x19')](_0x5beb3e)[_0x3bd3('0x1a')](_0x1d8142);}};}function respondWithFilteredResult(_0x101db5,_0x57d52d){return function(_0x57b315){if(_0x57b315){var _0x3dfa18=_0x57b315[_0x3bd3('0x1b')],_0x506cd6=_0x57d52d[_0x3bd3('0x1c')],_0x277972=_0x57d52d[_0x3bd3('0x1c')]+_0x57d52d[_0x3bd3('0x1d')],_0xcbfb8c;if(_0x277972>=_0x3dfa18){_0x277972=_0x3dfa18;_0xcbfb8c=0xc8;}else{_0xcbfb8c=0xce;}_0x101db5['status'](_0xcbfb8c);return _0x101db5['set'](_0x3bd3('0x1e'),_0x506cd6+'-'+_0x277972+'/'+_0x3dfa18)[_0x3bd3('0x1a')](_0x57b315);}return null;};}function patchUpdates(_0x5872ec){return function(_0xb3050){try{jsonpatch[_0x3bd3('0x1f')](_0xb3050,_0x5872ec,!![]);}catch(_0x79d9dd){return BPromise[_0x3bd3('0x20')](_0x79d9dd);}return _0xb3050[_0x3bd3('0x21')]();};}function saveUpdates(_0x205e4b,_0x3e29ee){return function(_0x1b36ca){if(_0x1b36ca){return _0x1b36ca[_0x3bd3('0x22')](_0x205e4b)['then'](function(_0x1cc4cd){return _0x1cc4cd;});}return null;};}function removeEntity(_0x5e6a7c,_0x2ca24f){return function(_0x1a3a4c){if(_0x1a3a4c){return _0x1a3a4c['destroy']()[_0x3bd3('0x23')](function(){_0x5e6a7c['status'](0xcc)[_0x3bd3('0x24')]();});}};}function handleEntityNotFound(_0x4f6b5e,_0x130b9b){return function(_0x1dbeb5){if(!_0x1dbeb5){_0x4f6b5e['sendStatus'](0x194);}return _0x1dbeb5;};}function handleError(_0x2b442b,_0x34ff79){_0x34ff79=_0x34ff79||0x1f4;return function(_0x31aaa7){logger['error'](_0x31aaa7[_0x3bd3('0x25')]);if(_0x31aaa7[_0x3bd3('0x26')]){delete _0x31aaa7['name'];}_0x2b442b['status'](_0x34ff79)[_0x3bd3('0x27')](_0x31aaa7);};}exports[_0x3bd3('0x28')]=function(_0x1f82b0,_0x507a27){var _0x1cb457={'raw':!![],'where':{'id':_0x1f82b0['params']['id']}},_0x5afaf0={};_0x5afaf0[_0x3bd3('0x29')]=_[_0x3bd3('0x2a')](db[_0x3bd3('0x2b')][_0x3bd3('0x2c')]);_0x5afaf0[_0x3bd3('0x2d')]=_[_0x3bd3('0x2a')](_0x1f82b0[_0x3bd3('0x2d')]);_0x5afaf0[_0x3bd3('0x2e')]=_[_0x3bd3('0x2f')](_0x5afaf0['model'],_0x5afaf0[_0x3bd3('0x2d')]);_0x1cb457['attributes']=_[_0x3bd3('0x2f')](_0x5afaf0[_0x3bd3('0x29')],qs[_0x3bd3('0x30')](_0x1f82b0['query'][_0x3bd3('0x30')]));_0x1cb457[_0x3bd3('0x31')]=_0x1cb457[_0x3bd3('0x31')][_0x3bd3('0x32')]?_0x1cb457[_0x3bd3('0x31')]:_0x5afaf0[_0x3bd3('0x29')];if(_0x1f82b0['query'][_0x3bd3('0x33')]){_0x1cb457[_0x3bd3('0x34')]=[{'all':!![]}];}_0x1cb457=_[_0x3bd3('0x35')]({},_0x1cb457,_0x1f82b0[_0x3bd3('0x36')]);return db[_0x3bd3('0x2b')]['find'](_0x1cb457)['then'](handleEntityNotFound(_0x507a27,null))[_0x3bd3('0x23')](respondWithResult(_0x507a27,null))[_0x3bd3('0x37')](handleError(_0x507a27,null));};exports[_0x3bd3('0x38')]=function(_0x5a4031,_0x1628ee){return db['ChatProactiveAction'][_0x3bd3('0x38')](_0x5a4031[_0x3bd3('0x39')],{})['then'](respondWithResult(_0x1628ee,0xc9))[_0x3bd3('0x37')](handleError(_0x1628ee,null));};exports[_0x3bd3('0x22')]=function(_0x50a626,_0x25287d){if(_0x50a626[_0x3bd3('0x39')]['id']){delete _0x50a626['body']['id'];}return db[_0x3bd3('0x2b')][_0x3bd3('0x3a')]({'where':{'id':_0x50a626[_0x3bd3('0x3b')]['id']}})[_0x3bd3('0x23')](handleEntityNotFound(_0x25287d,null))[_0x3bd3('0x23')](saveUpdates(_0x50a626[_0x3bd3('0x39')],null))[_0x3bd3('0x23')](respondWithResult(_0x25287d,null))['catch'](handleError(_0x25287d,null));};exports[_0x3bd3('0x3c')]=function(_0x121eb9,_0x3f2191){return db[_0x3bd3('0x2b')][_0x3bd3('0x3a')]({'where':{'id':_0x121eb9[_0x3bd3('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3f2191,null))['then'](removeEntity(_0x3f2191,null))[_0x3bd3('0x37')](handleError(_0x3f2191,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index d35afbe..ad8eeb4 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 _0x0b0e=['chat_proactive_actions','lodash','../../config/logger','moment','bluebird','request-promise','./chatProactiveAction.attributes','exports','define','ChatProactiveAction'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x0b0e,0x187));var _0xe0b0=function(_0x25f805,_0x59caf3){_0x25f805=_0x25f805-0x0;var _0xf6628f=_0x0b0e[_0x25f805];return _0xf6628f;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var attributes=require(_0xe0b0('0x5'));module[_0xe0b0('0x6')]=function(_0x38a058,_0x399e67){return _0x38a058[_0xe0b0('0x7')](_0xe0b0('0x8'),attributes,{'tableName':_0xe0b0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66fa=['util','api','moment','bluebird','request-promise','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x24db2b,_0x3a5876){var _0x487ebb=function(_0x337108){while(--_0x337108){_0x24db2b['push'](_0x24db2b['shift']());}};_0x487ebb(++_0x3a5876);}(_0x66fa,0x117));var _0xa66f=function(_0x394b3a,_0x14bd7c){_0x394b3a=_0x394b3a-0x0;var _0x447220=_0x66fa[_0x394b3a];return _0x447220;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var attributes=require(_0xa66f('0x6'));module[_0xa66f('0x7')]=function(_0x3f4904,_0x5ebea5){return _0x3f4904['define'](_0xa66f('0x8'),attributes,{'tableName':_0xa66f('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 10e8dc8..96e8ff7 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 _0xa9e0=['http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\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(_0xa06498,_0x23a05c){var _0x1ab6f8=function(_0x5158a4){while(--_0x5158a4){_0xa06498['push'](_0xa06498['shift']());}};_0x1ab6f8(++_0x23a05c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x248e7e,_0x1a0881){var _0x24eab1=function(_0x3f1c01){while(--_0x3f1c01){_0x248e7e['push'](_0x248e7e['shift']());}};_0x24eab1(++_0x1a0881);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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']('ChatProactiveAction,\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/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index f4324d8..0dbf07e 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 _0x6947=['get','/:id','isAuthenticated','show','post','create','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','./chatProactiveAction.controller'];(function(_0x40133e,_0x53d67f){var _0xb1090e=function(_0x3555a1){while(--_0x3555a1){_0x40133e['push'](_0x40133e['shift']());}};_0xb1090e(++_0x53d67f);}(_0x6947,0x72));var _0x7694=function(_0x4ed279,_0x28f1d0){_0x4ed279=_0x4ed279-0x0;var _0x21d60a=_0x6947[_0x4ed279];return _0x21d60a;};'use strict';var multer=require('multer');var util=require(_0x7694('0x0'));var path=require('path');var timeout=require(_0x7694('0x1'));var express=require(_0x7694('0x2'));var router=express[_0x7694('0x3')]();var auth=require(_0x7694('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7694('0x5'));router[_0x7694('0x6')](_0x7694('0x7'),auth[_0x7694('0x8')](),controller[_0x7694('0x9')]);router[_0x7694('0xa')]('/',auth['isAuthenticated'](),controller[_0x7694('0xb')]);router['put'](_0x7694('0x7'),auth[_0x7694('0x8')](),controller['update']);router[_0x7694('0xc')](_0x7694('0x7'),auth[_0x7694('0x8')](),controller[_0x7694('0xd')]);module[_0x7694('0xe')]=router; \ No newline at end of file +var _0x3ee7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','update','delete','destroy','util','express'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3ee7,0x98));var _0x73ee=function(_0x5cee5d,_0x3ff6d2){_0x5cee5d=_0x5cee5d-0x0;var _0x4dd0f4=_0x3ee7[_0x5cee5d];return _0x4dd0f4;};'use strict';var multer=require('multer');var util=require(_0x73ee('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x73ee('0x1'));var router=express['Router']();var auth=require(_0x73ee('0x2'));var interaction=require(_0x73ee('0x3'));var config=require(_0x73ee('0x4'));var controller=require(_0x73ee('0x5'));router[_0x73ee('0x6')](_0x73ee('0x7'),auth[_0x73ee('0x8')](),controller[_0x73ee('0x9')]);router['post']('/',auth[_0x73ee('0x8')](),controller[_0x73ee('0xa')]);router['put'](_0x73ee('0x7'),auth['isAuthenticated'](),controller[_0x73ee('0xb')]);router[_0x73ee('0xc')](_0x73ee('0x7'),auth[_0x73ee('0x8')](),controller[_0x73ee('0xd')]);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 1a9e5e3..d505866 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 _0xb929=['STRING','INTEGER','ENUM','rrmemory','roundrobin','exports'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0xb929,0x9b));var _0x9b92=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb929[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x9b92('0x0')]={'name':{'type':Sequelize[_0x9b92('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9b92('0x1')]},'timeout':{'type':Sequelize[_0x9b92('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9b92('0x3')](_0x9b92('0x4'),'beepall',_0x9b92('0x5'))}}; \ No newline at end of file +var _0x78ec=['INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0x271987,_0x535d49){var _0x1123a9=function(_0xb5d351){while(--_0xb5d351){_0x271987['push'](_0x271987['shift']());}};_0x1123a9(++_0x535d49);}(_0x78ec,0xf5));var _0xc78e=function(_0x159fae,_0x56a613){_0x159fae=_0x159fae-0x0;var _0x2d1210=_0x78ec[_0x159fae];return _0x2d1210;};'use strict';var Sequelize=require('sequelize');module[_0xc78e('0x0')]={'name':{'type':Sequelize[_0xc78e('0x1')],'unique':_0xc78e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc78e('0x1')]},'timeout':{'type':Sequelize[_0xc78e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc78e('0x4')](_0xc78e('0x5'),_0xc78e('0x6'),_0xc78e('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 1736311..bb476be 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 _0x4d90=['localhost','socket.io-emitter','redis','./chatQueue.socket','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','limit','set','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','end','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','field','merge','options','ChatQueue','count','include','rows','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','findOne','UserChatQueue','order','ChatQueueId','findAll','findAndCountAll','UserId','agent','chatPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','User','Agents','union','addAgents','addTeams','ids','removeTeams','removeAgents','omit','emit','userChatQueue:save','isArray','userChatQueue:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','util','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults'];(function(_0x1a0e88,_0x29f6a3){var _0xbc3293=function(_0x2003d7){while(--_0x2003d7){_0x1a0e88['push'](_0x1a0e88['shift']());}};_0xbc3293(++_0x29f6a3);}(_0x4d90,0xdf));var _0x04d9=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x4d90[_0x42f009];return _0x22a1e0;};'use strict';var pdf=require(_0x04d9('0x0'));var emlformat=require(_0x04d9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x04d9('0x2'));var jsonpatch=require(_0x04d9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x04d9('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x04d9('0x5'));var fs=require('fs');var _=require('lodash');var squel=require(_0x04d9('0x6'));var crypto=require(_0x04d9('0x7'));var jsforce=require(_0x04d9('0x8'));var deskjs=require(_0x04d9('0x9'));var toCsv=require(_0x04d9('0xa'));var querystring=require('querystring');var Papa=require(_0x04d9('0xb'));var authService=require(_0x04d9('0xc'));var hardwareService=require(_0x04d9('0xd'));var Redis=require(_0x04d9('0xe'));var qs=require(_0x04d9('0xf'));var logger=require(_0x04d9('0x10'))('api');var utils=require(_0x04d9('0x11'));var config=require(_0x04d9('0x12'));var db=require(_0x04d9('0x13'))['db'];config['redis']=_[_0x04d9('0x14')](config['redis'],{'host':_0x04d9('0x15'),'port':0x18eb});var socket=require(_0x04d9('0x16'))(new Redis(config[_0x04d9('0x17')]));require(_0x04d9('0x18'))['register'](socket);var jayson=require(_0x04d9('0x19'));var client=jayson[_0x04d9('0x1a')][_0x04d9('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3a5d03,_0x1bc83b,_0x21c906,_0xa69867){return new BPromise(function(_0x1b20b8,_0x8a40c9){var _0x19bdb6=_0xa69867||client;return _0x19bdb6['request'](_0x3a5d03,_0x21c906)[_0x04d9('0x1c')](function(_0x5ddc67){logger[_0x04d9('0x1d')](_0x04d9('0x1e'),_0x1bc83b,_0x04d9('0x1f'));logger[_0x04d9('0x20')](_0x04d9('0x21'),_0x1bc83b,'request\x20sent',JSON[_0x04d9('0x22')](_0x5ddc67));if(_0x5ddc67[_0x04d9('0x23')]){if(_0x5ddc67[_0x04d9('0x23')][_0x04d9('0x24')]===0x1f4){logger[_0x04d9('0x23')](_0x04d9('0x1e'),_0x1bc83b,_0x5ddc67[_0x04d9('0x23')][_0x04d9('0x25')]);return _0x8a40c9(_0x5ddc67['error'][_0x04d9('0x25')]);}logger[_0x04d9('0x23')](_0x04d9('0x1e'),_0x1bc83b,_0x5ddc67[_0x04d9('0x23')][_0x04d9('0x25')]);return _0x1b20b8(_0x5ddc67[_0x04d9('0x23')][_0x04d9('0x25')]);}else{logger[_0x04d9('0x1d')](_0x04d9('0x1e'),_0x1bc83b,_0x04d9('0x1f'));_0x1b20b8(_0x5ddc67[_0x04d9('0x26')][_0x04d9('0x25')]);}})[_0x04d9('0x27')](function(_0x22276c){logger[_0x04d9('0x23')]('ChatQueue,\x20%s,\x20%s',_0x1bc83b,_0x22276c);_0x8a40c9(_0x22276c);});});}function respondWithStatusCode(_0x56df9b,_0x3d338d){_0x3d338d=_0x3d338d||0xcc;return function(_0x1661b0){if(_0x1661b0){return _0x56df9b['sendStatus'](_0x3d338d);}return _0x56df9b[_0x04d9('0x28')](_0x3d338d)['end']();};}function respondWithResult(_0x138b24,_0x265e45){_0x265e45=_0x265e45||0xc8;return function(_0x151708){if(_0x151708){return _0x138b24[_0x04d9('0x28')](_0x265e45)[_0x04d9('0x29')](_0x151708);}};}function respondWithFilteredResult(_0x52634b,_0x53a0fb){return function(_0x381f10){if(_0x381f10){var _0x5edc7b=_0x381f10['count'],_0x1d1e35=_0x53a0fb['offset'],_0x449804=_0x53a0fb[_0x04d9('0x2a')]+_0x53a0fb[_0x04d9('0x2b')],_0x53f53e;if(_0x449804>=_0x5edc7b){_0x449804=_0x5edc7b;_0x53f53e=0xc8;}else{_0x53f53e=0xce;}_0x52634b[_0x04d9('0x28')](_0x53f53e);return _0x52634b[_0x04d9('0x2c')]('Content-Range',_0x1d1e35+'-'+_0x449804+'/'+_0x5edc7b)['json'](_0x381f10);}return null;};}function patchUpdates(_0x4c894f){return function(_0x4a548f){try{jsonpatch[_0x04d9('0x2d')](_0x4a548f,_0x4c894f,!![]);}catch(_0x54e4b0){return BPromise[_0x04d9('0x2e')](_0x54e4b0);}return _0x4a548f['save']();};}function saveUpdates(_0x414836,_0x2ecbf9){return function(_0x2a21f4){if(_0x2a21f4){return _0x2a21f4[_0x04d9('0x2f')](_0x414836)[_0x04d9('0x1c')](function(_0x384c40){return _0x384c40;});}return null;};}function removeEntity(_0x16d01d,_0x564e0a){return function(_0x1e8ee0){if(_0x1e8ee0){return _0x1e8ee0[_0x04d9('0x30')]()[_0x04d9('0x1c')](function(){var _0xe409bd=_0x1e8ee0[_0x04d9('0x31')]({'plain':!![]});var _0x2c9d64=_0x04d9('0x32');return db[_0x04d9('0x33')][_0x04d9('0x30')]({'where':{'type':_0x2c9d64,'resourceId':_0xe409bd['id']}})[_0x04d9('0x1c')](function(){return _0x1e8ee0;});})[_0x04d9('0x1c')](function(){_0x16d01d[_0x04d9('0x28')](0xcc)[_0x04d9('0x34')]();});}};}function handleEntityNotFound(_0x1ad6c6,_0x9b3529){return function(_0x439a13){if(!_0x439a13){_0x1ad6c6['sendStatus'](0x194);}return _0x439a13;};}function handleError(_0x27cb00,_0x4e8223){_0x4e8223=_0x4e8223||0x1f4;return function(_0x4bd854){logger[_0x04d9('0x23')](_0x4bd854['stack']);if(_0x4bd854[_0x04d9('0x35')]){delete _0x4bd854['name'];}_0x27cb00[_0x04d9('0x28')](_0x4e8223)[_0x04d9('0x36')](_0x4bd854);};}exports[_0x04d9('0x37')]=function(_0x1f3cf5,_0x3b7f61){var _0x238af8={},_0x59c016={},_0x31b24d={'count':0x0,'rows':[]};var _0xbd6ea0=db['ChatQueue'][_0x04d9('0x38')];_0x59c016[_0x04d9('0x39')]=_[_0x04d9('0x3a')](_0xbd6ea0);_0x59c016[_0x04d9('0x3b')]=_[_0x04d9('0x3a')](_0x1f3cf5[_0x04d9('0x3b')]);_0x59c016[_0x04d9('0x3c')]=_[_0x04d9('0x3d')](_0x59c016[_0x04d9('0x39')],_0x59c016['query']);_0x238af8[_0x04d9('0x3e')]=_[_0x04d9('0x3d')](_0x59c016['model'],qs[_0x04d9('0x3f')](_0x1f3cf5['query'][_0x04d9('0x3f')]));_0x238af8[_0x04d9('0x3e')]=_0x238af8[_0x04d9('0x3e')][_0x04d9('0x40')]?_0x238af8[_0x04d9('0x3e')]:_0x59c016['model'];if(!_0x1f3cf5[_0x04d9('0x3b')][_0x04d9('0x41')](_0x04d9('0x42'))){_0x238af8['limit']=qs['limit'](_0x1f3cf5[_0x04d9('0x3b')]['limit']);_0x238af8[_0x04d9('0x2a')]=qs[_0x04d9('0x2a')](_0x1f3cf5['query'][_0x04d9('0x2a')]);}_0x238af8['order']=qs[_0x04d9('0x43')](_0x1f3cf5[_0x04d9('0x3b')]['sort']);_0x238af8[_0x04d9('0x44')]=qs[_0x04d9('0x3c')](_[_0x04d9('0x45')](_0x1f3cf5['query'],_0x59c016[_0x04d9('0x3c')]));if(_0x1f3cf5[_0x04d9('0x3b')][_0x04d9('0x46')]){_0x238af8['where']=_['merge'](_0x238af8[_0x04d9('0x44')],{'$or':_[_0x04d9('0x47')](_0xbd6ea0,function(_0x5935ca){if(_0x5935ca[_0x04d9('0x48')][_0x04d9('0x49')]!=='VIRTUAL'){var _0x3d7de7={};_0x3d7de7[_0x5935ca[_0x04d9('0x4a')]]={'$like':'%'+_0x1f3cf5[_0x04d9('0x3b')]['filter']+'%'};return _0x3d7de7;}})});}_0x238af8=_[_0x04d9('0x4b')]({},_0x238af8,_0x1f3cf5[_0x04d9('0x4c')]);var _0x464e16={'where':_0x238af8[_0x04d9('0x44')]};return db[_0x04d9('0x4d')]['count'](_0x464e16)['then'](function(_0xfdc6f7){_0x31b24d[_0x04d9('0x4e')]=_0xfdc6f7;if(_0x1f3cf5[_0x04d9('0x3b')]['includeAll']){_0x238af8[_0x04d9('0x4f')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x238af8);})[_0x04d9('0x1c')](function(_0x4b0390){_0x31b24d[_0x04d9('0x50')]=_0x4b0390;return _0x31b24d;})[_0x04d9('0x1c')](respondWithFilteredResult(_0x3b7f61,_0x238af8))[_0x04d9('0x27')](handleError(_0x3b7f61,null));};exports[_0x04d9('0x51')]=function(_0x31ad27,_0x3964a3){var _0x165ee1={'raw':!![],'where':{'id':_0x31ad27[_0x04d9('0x52')]['id']}},_0x19f05b={};_0x19f05b[_0x04d9('0x39')]=_['keys'](db[_0x04d9('0x4d')][_0x04d9('0x38')]);_0x19f05b[_0x04d9('0x3b')]=_[_0x04d9('0x3a')](_0x31ad27[_0x04d9('0x3b')]);_0x19f05b['filters']=_[_0x04d9('0x3d')](_0x19f05b[_0x04d9('0x39')],_0x19f05b[_0x04d9('0x3b')]);_0x165ee1[_0x04d9('0x3e')]=_['intersection'](_0x19f05b[_0x04d9('0x39')],qs[_0x04d9('0x3f')](_0x31ad27[_0x04d9('0x3b')][_0x04d9('0x3f')]));_0x165ee1['attributes']=_0x165ee1[_0x04d9('0x3e')][_0x04d9('0x40')]?_0x165ee1[_0x04d9('0x3e')]:_0x19f05b[_0x04d9('0x39')];if(_0x31ad27['query'][_0x04d9('0x53')]){_0x165ee1[_0x04d9('0x4f')]=[{'all':!![]}];}_0x165ee1=_['merge']({},_0x165ee1,_0x31ad27[_0x04d9('0x4c')]);return db['ChatQueue'][_0x04d9('0x54')](_0x165ee1)[_0x04d9('0x1c')](handleEntityNotFound(_0x3964a3,null))['then'](respondWithResult(_0x3964a3,null))[_0x04d9('0x27')](handleError(_0x3964a3,null));};exports[_0x04d9('0x55')]=function(_0x153192,_0x2aa88b){return db[_0x04d9('0x4d')][_0x04d9('0x55')](_0x153192[_0x04d9('0x56')],{})[_0x04d9('0x1c')](function(_0x2276d8){var _0x5673cf=_0x153192[_0x04d9('0x57')]['get']({'plain':!![]});if(!_0x5673cf)throw new Error(_0x04d9('0x58'));if(_0x5673cf[_0x04d9('0x59')]===_0x04d9('0x57')){var _0x40657d=_0x2276d8[_0x04d9('0x31')]({'plain':!![]});var _0x3c00bb='ChatQueues';return db[_0x04d9('0x5a')][_0x04d9('0x54')]({'where':{'name':_0x3c00bb,'userProfileId':_0x5673cf['userProfileId']},'raw':!![]})[_0x04d9('0x1c')](function(_0x222d47){if(_0x222d47&&_0x222d47[_0x04d9('0x5b')]===0x0){return db[_0x04d9('0x33')][_0x04d9('0x55')]({'name':_0x40657d[_0x04d9('0x35')],'resourceId':_0x40657d['id'],'type':_0x222d47[_0x04d9('0x35')],'sectionId':_0x222d47['id']},{})[_0x04d9('0x1c')](function(){return _0x2276d8;});}else{return _0x2276d8;}})['catch'](function(_0x3bf033){logger[_0x04d9('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bf033);throw _0x3bf033;});}return _0x2276d8;})[_0x04d9('0x1c')](respondWithResult(_0x2aa88b,0xc9))[_0x04d9('0x27')](handleError(_0x2aa88b,null));};exports[_0x04d9('0x2f')]=function(_0x425ef0,_0x1397af){if(_0x425ef0[_0x04d9('0x56')]['id']){delete _0x425ef0[_0x04d9('0x56')]['id'];}return db[_0x04d9('0x4d')][_0x04d9('0x54')]({'where':{'id':_0x425ef0[_0x04d9('0x52')]['id']}})[_0x04d9('0x1c')](handleEntityNotFound(_0x1397af,null))[_0x04d9('0x1c')](saveUpdates(_0x425ef0[_0x04d9('0x56')],null))[_0x04d9('0x1c')](respondWithResult(_0x1397af,null))[_0x04d9('0x27')](handleError(_0x1397af,null));};exports[_0x04d9('0x30')]=function(_0x3b324b,_0xfdebd1){return db[_0x04d9('0x4d')][_0x04d9('0x54')]({'where':{'id':_0x3b324b['params']['id']}})['then'](handleEntityNotFound(_0xfdebd1,null))[_0x04d9('0x1c')](removeEntity(_0xfdebd1,null))['catch'](handleError(_0xfdebd1,null));};exports[_0x04d9('0x5c')]=function(_0x3cf1c8,_0x3422ae){return db[_0x04d9('0x4d')]['describe']()[_0x04d9('0x1c')](respondWithResult(_0x3422ae,null))[_0x04d9('0x27')](handleError(_0x3422ae,null));};exports['getMembers']=function(_0x5b3529,_0x5568c8,_0x5db66e){var _0x2c7a73={'raw':!![],'where':{}},_0x48cbe9={},_0x196ce3;return db['ChatQueue'][_0x04d9('0x5d')]({'where':{'id':_0x5b3529[_0x04d9('0x52')]['id']}})[_0x04d9('0x1c')](handleEntityNotFound(_0x5568c8,null))['then'](function(_0x4220e9){if(_0x4220e9){_0x196ce3=_0x4220e9[_0x04d9('0x31')]({'plain':!![]});_0x48cbe9[_0x04d9('0x39')]=_['keys'](db[_0x04d9('0x5e')][_0x04d9('0x38')]);_0x48cbe9['query']=_[_0x04d9('0x3a')](_0x5b3529[_0x04d9('0x3b')]);_0x48cbe9[_0x04d9('0x3c')]=_[_0x04d9('0x3d')](_0x48cbe9['model'],_0x48cbe9[_0x04d9('0x3b')]);_0x2c7a73[_0x04d9('0x3e')]=_['intersection'](_0x48cbe9['model'],qs[_0x04d9('0x3f')](_0x5b3529[_0x04d9('0x3b')][_0x04d9('0x3f')]));_0x2c7a73[_0x04d9('0x3e')]=_0x2c7a73[_0x04d9('0x3e')]['length']?_0x2c7a73[_0x04d9('0x3e')]:_0x48cbe9[_0x04d9('0x39')];if(!_0x5b3529[_0x04d9('0x3b')][_0x04d9('0x41')](_0x04d9('0x42'))){_0x2c7a73['limit']=qs[_0x04d9('0x2b')](_0x5b3529['query'][_0x04d9('0x2b')]);_0x2c7a73['offset']=qs[_0x04d9('0x2a')](_0x5b3529[_0x04d9('0x3b')][_0x04d9('0x2a')]);}_0x2c7a73[_0x04d9('0x5f')]=qs[_0x04d9('0x43')](_0x5b3529[_0x04d9('0x3b')][_0x04d9('0x43')]);_0x2c7a73[_0x04d9('0x44')]=qs[_0x04d9('0x3c')](_['pick'](_0x5b3529[_0x04d9('0x3b')],_0x48cbe9[_0x04d9('0x3c')]));_0x2c7a73['where'][_0x04d9('0x60')]=_0x4220e9['id'];if(_0x5b3529[_0x04d9('0x3b')][_0x04d9('0x46')]){_0x2c7a73[_0x04d9('0x44')]=_['merge'](_0x2c7a73[_0x04d9('0x44')],{'$or':_[_0x04d9('0x47')](_0x2c7a73[_0x04d9('0x3e')],function(_0x34e4c0){var _0x459e62={};_0x459e62[_0x34e4c0]={'$like':'%'+_0x5b3529[_0x04d9('0x3b')]['filter']+'%'};return _0x459e62;})});}_0x2c7a73=_[_0x04d9('0x4b')]({},_0x2c7a73,_0x5b3529['options']);return db[_0x04d9('0x5e')][_0x04d9('0x61')](_0x2c7a73);}})[_0x04d9('0x1c')](function(_0x3ac711){if(_0x3ac711){return db['User'][_0x04d9('0x62')]({'where':{'id':_[_0x04d9('0x47')](_0x3ac711,_0x04d9('0x63')),'role':_0x04d9('0x64')},'attributes':['id',_0x04d9('0x35'),_0x04d9('0x65'),_0x04d9('0x66'),'createdAt']});}})[_0x04d9('0x1c')](function(_0x1a839c){if(_0x1a839c){return{'count':_0x1a839c[_0x04d9('0x4e')],'rows':_[_0x04d9('0x47')](_0x1a839c[_0x04d9('0x50')],function(_0x12cbc8){return{'membername':_0x12cbc8[_0x04d9('0x35')],'UserId':_0x12cbc8['id'],'queue_name':_0x196ce3[_0x04d9('0x35')],'ChatQueueId':_0x196ce3['id'],'interface':util['format'](_0x04d9('0x67'),_0x04d9('0x68'),_0x12cbc8['name']),'penalty':0x0,'paused':_0x12cbc8['chatPause'],'createdAt':_0x12cbc8[_0x04d9('0x69')],'updatedAt':_0x12cbc8[_0x04d9('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x04d9('0x1c')](respondWithFilteredResult(_0x5568c8,_0x2c7a73))[_0x04d9('0x27')](handleError(_0x5568c8,null));};exports[_0x04d9('0x6a')]=function(_0x5cec25,_0x2dfa03,_0x58fa31){var _0x2968ac={};var _0x15e2cc={};var _0x14c2bf;var _0x29ee21;return db['ChatQueue'][_0x04d9('0x5d')]({'where':{'id':_0x5cec25[_0x04d9('0x52')]['id']}})[_0x04d9('0x1c')](handleEntityNotFound(_0x2dfa03,null))[_0x04d9('0x1c')](function(_0x592a97){if(_0x592a97){_0x14c2bf=_0x592a97;_0x15e2cc['model']=_[_0x04d9('0x3a')](db[_0x04d9('0x6b')][_0x04d9('0x38')]);_0x15e2cc[_0x04d9('0x3b')]=_[_0x04d9('0x3a')](_0x5cec25[_0x04d9('0x3b')]);_0x15e2cc[_0x04d9('0x3c')]=_[_0x04d9('0x3d')](_0x15e2cc[_0x04d9('0x39')],_0x15e2cc[_0x04d9('0x3b')]);_0x2968ac[_0x04d9('0x3e')]=_[_0x04d9('0x3d')](_0x15e2cc[_0x04d9('0x39')],qs['fields'](_0x5cec25[_0x04d9('0x3b')]['fields']));_0x2968ac['attributes']=_0x2968ac[_0x04d9('0x3e')]['length']?_0x2968ac['attributes']:_0x15e2cc[_0x04d9('0x39')];_0x2968ac[_0x04d9('0x5f')]=qs[_0x04d9('0x43')](_0x5cec25[_0x04d9('0x3b')]['sort']);_0x2968ac['where']=qs[_0x04d9('0x3c')](_[_0x04d9('0x45')](_0x5cec25[_0x04d9('0x3b')],_0x15e2cc['filters']));if(_0x5cec25[_0x04d9('0x3b')][_0x04d9('0x46')]){_0x2968ac[_0x04d9('0x44')]=_['merge'](_0x2968ac[_0x04d9('0x44')],{'$or':_[_0x04d9('0x47')](_0x2968ac[_0x04d9('0x3e')],function(_0x4049a8){var _0x50d617={};_0x50d617[_0x4049a8]={'$like':'%'+_0x5cec25['query']['filter']+'%'};return _0x50d617;})});}_0x2968ac=_[_0x04d9('0x4b')]({},_0x2968ac,_0x5cec25['options']);return _0x14c2bf[_0x04d9('0x6a')](_0x2968ac);}})[_0x04d9('0x1c')](function(_0x55d960){if(_0x55d960){_0x29ee21=_0x55d960[_0x04d9('0x40')];if(!_0x5cec25['query']['hasOwnProperty'](_0x04d9('0x42'))){_0x2968ac['limit']=qs[_0x04d9('0x2b')](_0x5cec25[_0x04d9('0x3b')][_0x04d9('0x2b')]);_0x2968ac[_0x04d9('0x2a')]=qs[_0x04d9('0x2a')](_0x5cec25[_0x04d9('0x3b')][_0x04d9('0x2a')]);}return _0x14c2bf['getTeams'](_0x2968ac);}})[_0x04d9('0x1c')](function(_0x41a8cf){if(_0x41a8cf){return _0x41a8cf?{'count':_0x29ee21,'rows':_0x41a8cf}:null;}})[_0x04d9('0x1c')](respondWithResult(_0x2dfa03,null))[_0x04d9('0x27')](handleError(_0x2dfa03,null));};exports['addTeams']=function(_0x4f4fc0,_0x5775fd,_0x1020b3){var _0x13e0a6=[];var _0x3f103b;return db[_0x04d9('0x6b')][_0x04d9('0x61')]({'where':{'id':_0x4f4fc0[_0x04d9('0x56')]['ids']},'attributes':['id'],'include':[{'model':db[_0x04d9('0x6c')],'as':_0x04d9('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x04d9('0x1c')](function(_0x3e296d){if(_0x3e296d){for(var _0x2d9af1=0x0;_0x2d9af1<_0x3e296d['length'];_0x2d9af1+=0x1){for(var _0x5ee32c=0x0;_0x5ee32c<_0x3e296d[_0x2d9af1][_0x04d9('0x6d')]['length'];_0x5ee32c+=0x1){_0x13e0a6=_[_0x04d9('0x6e')](_0x13e0a6,[_0x3e296d[_0x2d9af1]['Agents'][_0x5ee32c]['id']]);}}return _0x13e0a6;}})[_0x04d9('0x1c')](function(_0x514ca7){if(_0x514ca7){return db[_0x04d9('0x4d')][_0x04d9('0x54')]({'where':{'id':_0x4f4fc0['params']['id']}});}})[_0x04d9('0x1c')](function(_0x11a781){if(_0x11a781){_0x3f103b=_0x11a781;return _0x3f103b[_0x04d9('0x6f')](_0x13e0a6,{'penalty':_0x4f4fc0[_0x04d9('0x56')]['penalty']});}})[_0x04d9('0x1c')](function(_0x47910c){if(_0x47910c){return _0x3f103b[_0x04d9('0x70')](_0x4f4fc0[_0x04d9('0x56')][_0x04d9('0x71')]);}})[_0x04d9('0x1c')](handleEntityNotFound(_0x5775fd,null))['then'](respondWithStatusCode(_0x5775fd,null))[_0x04d9('0x27')](handleError(_0x5775fd,null));};exports[_0x04d9('0x72')]=function(_0x102ede,_0x300519,_0x90079f){var _0x36f29a=[];var _0x2fdf37;return db[_0x04d9('0x6b')]['findAll']({'where':{'id':_0x102ede['query'][_0x04d9('0x71')]},'attributes':['id'],'include':[{'model':db[_0x04d9('0x6c')],'as':_0x04d9('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x04d9('0x1c')](function(_0x1be28e){if(_0x1be28e){for(var _0x16db58=0x0;_0x16db58<_0x1be28e['length'];_0x16db58+=0x1){for(var _0x31bd98=0x0;_0x31bd98<_0x1be28e[_0x16db58][_0x04d9('0x6d')][_0x04d9('0x40')];_0x31bd98+=0x1){_0x36f29a=_[_0x04d9('0x6e')](_0x36f29a,[_0x1be28e[_0x16db58][_0x04d9('0x6d')][_0x31bd98]['id']]);}}return _0x36f29a;}})[_0x04d9('0x1c')](function(_0x23713e){if(_0x23713e){return db[_0x04d9('0x4d')][_0x04d9('0x54')]({'where':{'id':_0x102ede[_0x04d9('0x52')]['id']}});}})[_0x04d9('0x1c')](function(_0x8c2498){if(_0x8c2498){_0x2fdf37=_0x8c2498;return _0x2fdf37[_0x04d9('0x73')](_0x36f29a);}})[_0x04d9('0x1c')](function(_0x22f035){if(_0x2fdf37){return _0x2fdf37[_0x04d9('0x72')](_0x102ede[_0x04d9('0x3b')][_0x04d9('0x71')]);}})[_0x04d9('0x1c')](handleEntityNotFound(_0x300519,null))[_0x04d9('0x1c')](respondWithStatusCode(_0x300519,null))[_0x04d9('0x27')](handleError(_0x300519,null));};exports['addAgents']=function(_0x54e3f7,_0x2ad062,_0x26757d){return db[_0x04d9('0x4d')][_0x04d9('0x54')]({'where':{'id':_0x54e3f7[_0x04d9('0x52')]['id']}})[_0x04d9('0x1c')](handleEntityNotFound(_0x2ad062,null))[_0x04d9('0x1c')](function(_0x377353){if(_0x377353){return _0x377353[_0x04d9('0x6f')](_0x54e3f7[_0x04d9('0x56')][_0x04d9('0x71')],_[_0x04d9('0x74')](_0x54e3f7[_0x04d9('0x56')],['ids','id'])||{})['spread'](function(_0x1e972c){for(var _0x4c36fb=0x0;_0x4c36fb<_0x54e3f7[_0x04d9('0x56')][_0x04d9('0x71')]['length'];_0x4c36fb+=0x1){socket[_0x04d9('0x75')](_0x04d9('0x76'),{'UserId':_0x54e3f7['body'][_0x04d9('0x71')][_0x4c36fb],'ChatQueueId':_0x54e3f7[_0x04d9('0x52')]['id']});}return _0x1e972c;});}})[_0x04d9('0x1c')](respondWithResult(_0x2ad062,null))[_0x04d9('0x27')](handleError(_0x2ad062,null));};exports[_0x04d9('0x73')]=function(_0x9c4e72,_0x2b7844,_0x3a8428){var _0x59ca27;return db[_0x04d9('0x4d')][_0x04d9('0x54')]({'where':{'id':_0x9c4e72['params']['id']}})[_0x04d9('0x1c')](handleEntityNotFound(_0x2b7844,null))[_0x04d9('0x1c')](function(_0x44bcda){if(_0x44bcda){return _0x44bcda['removeAgents'](_0x9c4e72['query'][_0x04d9('0x71')])[_0x04d9('0x1c')](function(_0x2eb448){if(_[_0x04d9('0x77')](_0x9c4e72[_0x04d9('0x3b')][_0x04d9('0x71')])){for(var _0x3d7a1b=0x0;_0x3d7a1b<_0x9c4e72[_0x04d9('0x3b')]['ids'][_0x04d9('0x40')];_0x3d7a1b+=0x1){socket[_0x04d9('0x75')](_0x04d9('0x78'),{'UserId':_0x9c4e72['query'][_0x04d9('0x71')][_0x3d7a1b],'ChatQueueId':_0x9c4e72[_0x04d9('0x52')]['id']});}}else{socket['emit'](_0x04d9('0x78'),{'UserId':_0x9c4e72[_0x04d9('0x3b')][_0x04d9('0x71')],'ChatQueueId':_0x9c4e72[_0x04d9('0x52')]['id']});}});}})['then'](respondWithStatusCode(_0x2b7844,null))['catch'](handleError(_0x2b7844,null));};exports[_0x04d9('0x79')]=function(_0x2acf49,_0x32f1e4,_0x89a691){var _0x252eb1={};var _0x5644f1={};var _0x283571;var _0x2425c7;return db[_0x04d9('0x4d')][_0x04d9('0x5d')]({'where':{'id':_0x2acf49[_0x04d9('0x52')]['id']}})['then'](handleEntityNotFound(_0x32f1e4,null))['then'](function(_0x1ab93){if(_0x1ab93){_0x283571=_0x1ab93;_0x5644f1['model']=_['keys'](db[_0x04d9('0x6c')]['rawAttributes']);_0x5644f1[_0x04d9('0x3b')]=_['keys'](_0x2acf49[_0x04d9('0x3b')]);_0x5644f1[_0x04d9('0x3c')]=_[_0x04d9('0x3d')](_0x5644f1[_0x04d9('0x39')],_0x5644f1[_0x04d9('0x3b')]);_0x252eb1[_0x04d9('0x3e')]=_[_0x04d9('0x3d')](_0x5644f1[_0x04d9('0x39')],qs[_0x04d9('0x3f')](_0x2acf49[_0x04d9('0x3b')][_0x04d9('0x3f')]));_0x252eb1[_0x04d9('0x3e')]=_0x252eb1[_0x04d9('0x3e')][_0x04d9('0x40')]?_0x252eb1['attributes']:_0x5644f1[_0x04d9('0x39')];_0x252eb1[_0x04d9('0x5f')]=qs[_0x04d9('0x43')](_0x2acf49[_0x04d9('0x3b')][_0x04d9('0x43')]);_0x252eb1[_0x04d9('0x44')]=qs[_0x04d9('0x3c')](_[_0x04d9('0x45')](_0x2acf49['query'],_0x5644f1[_0x04d9('0x3c')]));if(_0x2acf49[_0x04d9('0x3b')]['filter']){_0x252eb1[_0x04d9('0x44')]=_[_0x04d9('0x4b')](_0x252eb1[_0x04d9('0x44')],{'$or':_['map'](_0x252eb1[_0x04d9('0x3e')],function(_0x6b56e9){var _0xb99d5a={};_0xb99d5a[_0x6b56e9]={'$like':'%'+_0x2acf49[_0x04d9('0x3b')]['filter']+'%'};return _0xb99d5a;})});}_0x252eb1=_[_0x04d9('0x4b')]({},_0x252eb1,_0x2acf49[_0x04d9('0x4c')]);return _0x283571[_0x04d9('0x79')](_0x252eb1);}})['then'](function(_0x147a81){if(_0x147a81){_0x2425c7=_0x147a81[_0x04d9('0x40')];if(!_0x2acf49[_0x04d9('0x3b')]['hasOwnProperty'](_0x04d9('0x42'))){_0x252eb1[_0x04d9('0x2b')]=qs[_0x04d9('0x2b')](_0x2acf49[_0x04d9('0x3b')][_0x04d9('0x2b')]);_0x252eb1[_0x04d9('0x2a')]=qs['offset'](_0x2acf49[_0x04d9('0x3b')][_0x04d9('0x2a')]);}return _0x283571[_0x04d9('0x79')](_0x252eb1);}})[_0x04d9('0x1c')](function(_0x51b7e9){if(_0x51b7e9){return _0x51b7e9?{'count':_0x2425c7,'rows':_0x51b7e9}:null;}})['then'](respondWithResult(_0x32f1e4,null))[_0x04d9('0x27')](handleError(_0x32f1e4,null));}; \ No newline at end of file +var _0xa8f6=['emit','userChatQueue:save','isArray','userChatQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','ChatQueue','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','params','find','create','body','user','ChatQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','getTeams','addTeams','Team','ids','User','Agents','addAgents','penalty','removeTeams','removeAgents','omit','spread'];(function(_0x37b3a7,_0x56bdb8){var _0x1d8e4e=function(_0x32479c){while(--_0x32479c){_0x37b3a7['push'](_0x37b3a7['shift']());}};_0x1d8e4e(++_0x56bdb8);}(_0xa8f6,0x88));var _0x6a8f=function(_0x4eaaa9,_0x5ce36c){_0x4eaaa9=_0x4eaaa9-0x0;var _0x187ea5=_0xa8f6[_0x4eaaa9];return _0x187ea5;};'use strict';var pdf=require(_0x6a8f('0x0'));var emlformat=require(_0x6a8f('0x1'));var rimraf=require(_0x6a8f('0x2'));var zipdir=require(_0x6a8f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a8f('0x4'));var moment=require(_0x6a8f('0x5'));var BPromise=require(_0x6a8f('0x6'));var Mustache=require(_0x6a8f('0x7'));var util=require(_0x6a8f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x6a8f('0x9'));var ejs=require(_0x6a8f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6a8f('0xb'));var crypto=require(_0x6a8f('0xc'));var jsforce=require(_0x6a8f('0xd'));var deskjs=require(_0x6a8f('0xe'));var toCsv=require(_0x6a8f('0x9'));var querystring=require(_0x6a8f('0xf'));var Papa=require(_0x6a8f('0x10'));var authService=require(_0x6a8f('0x11'));var hardwareService=require(_0x6a8f('0x12'));var Redis=require(_0x6a8f('0x13'));var qs=require(_0x6a8f('0x14'));var logger=require(_0x6a8f('0x15'))(_0x6a8f('0x16'));var utils=require('../../config/utils');var config=require(_0x6a8f('0x17'));var db=require(_0x6a8f('0x18'))['db'];config[_0x6a8f('0x19')]=_[_0x6a8f('0x1a')](config[_0x6a8f('0x19')],{'host':_0x6a8f('0x1b'),'port':0x18eb});var socket=require(_0x6a8f('0x1c'))(new Redis(config[_0x6a8f('0x19')]));require(_0x6a8f('0x1d'))[_0x6a8f('0x1e')](socket);var jayson=require(_0x6a8f('0x1f'));var client=jayson[_0x6a8f('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302c8c,_0x5284ef,_0x1dc12c,_0x13f0df){return new BPromise(function(_0x2f6487,_0x3f24f3){var _0x3de205=_0x13f0df||client;return _0x3de205[_0x6a8f('0x21')](_0x302c8c,_0x1dc12c)['then'](function(_0x44889e){logger[_0x6a8f('0x22')](_0x6a8f('0x23'),_0x5284ef,_0x6a8f('0x24'));logger[_0x6a8f('0x25')](_0x6a8f('0x26'),_0x5284ef,'request\x20sent',JSON[_0x6a8f('0x27')](_0x44889e));if(_0x44889e['error']){if(_0x44889e[_0x6a8f('0x28')][_0x6a8f('0x29')]===0x1f4){logger[_0x6a8f('0x28')]('ChatQueue,\x20%s,\x20%s',_0x5284ef,_0x44889e['error'][_0x6a8f('0x2a')]);return _0x3f24f3(_0x44889e[_0x6a8f('0x28')][_0x6a8f('0x2a')]);}logger[_0x6a8f('0x28')](_0x6a8f('0x23'),_0x5284ef,_0x44889e[_0x6a8f('0x28')][_0x6a8f('0x2a')]);return _0x2f6487(_0x44889e[_0x6a8f('0x28')][_0x6a8f('0x2a')]);}else{logger['info'](_0x6a8f('0x23'),_0x5284ef,'request\x20sent');_0x2f6487(_0x44889e['result'][_0x6a8f('0x2a')]);}})[_0x6a8f('0x2b')](function(_0x401b39){logger[_0x6a8f('0x28')](_0x6a8f('0x23'),_0x5284ef,_0x401b39);_0x3f24f3(_0x401b39);});});}function respondWithStatusCode(_0x51e0db,_0x3deaa1){_0x3deaa1=_0x3deaa1||0xcc;return function(_0x1ecd05){if(_0x1ecd05){return _0x51e0db[_0x6a8f('0x2c')](_0x3deaa1);}return _0x51e0db[_0x6a8f('0x2d')](_0x3deaa1)[_0x6a8f('0x2e')]();};}function respondWithResult(_0x262a00,_0x5c21e2){_0x5c21e2=_0x5c21e2||0xc8;return function(_0x315929){if(_0x315929){return _0x262a00[_0x6a8f('0x2d')](_0x5c21e2)[_0x6a8f('0x2f')](_0x315929);}};}function respondWithFilteredResult(_0x1c061a,_0x5d35c4){return function(_0xdd89a8){if(_0xdd89a8){var _0x483fb3=_0xdd89a8[_0x6a8f('0x30')],_0x101761=_0x5d35c4['offset'],_0x5e4b26=_0x5d35c4[_0x6a8f('0x31')]+_0x5d35c4[_0x6a8f('0x32')],_0x510c7f;if(_0x5e4b26>=_0x483fb3){_0x5e4b26=_0x483fb3;_0x510c7f=0xc8;}else{_0x510c7f=0xce;}_0x1c061a['status'](_0x510c7f);return _0x1c061a[_0x6a8f('0x33')](_0x6a8f('0x34'),_0x101761+'-'+_0x5e4b26+'/'+_0x483fb3)['json'](_0xdd89a8);}return null;};}function patchUpdates(_0x65c3de){return function(_0xf89d00){try{jsonpatch[_0x6a8f('0x35')](_0xf89d00,_0x65c3de,!![]);}catch(_0xd26da8){return BPromise[_0x6a8f('0x36')](_0xd26da8);}return _0xf89d00[_0x6a8f('0x37')]();};}function saveUpdates(_0x44a76c,_0x36e345){return function(_0x586a01){if(_0x586a01){return _0x586a01[_0x6a8f('0x38')](_0x44a76c)[_0x6a8f('0x39')](function(_0x128092){return _0x128092;});}return null;};}function removeEntity(_0x22eb58,_0x180a62){return function(_0x5b0b33){if(_0x5b0b33){return _0x5b0b33['destroy']()[_0x6a8f('0x39')](function(){var _0x7ec2ed=_0x5b0b33[_0x6a8f('0x3a')]({'plain':!![]});var _0x54a153='ChatQueues';return db[_0x6a8f('0x3b')][_0x6a8f('0x3c')]({'where':{'type':_0x54a153,'resourceId':_0x7ec2ed['id']}})[_0x6a8f('0x39')](function(){return _0x5b0b33;});})[_0x6a8f('0x39')](function(){_0x22eb58['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16f2f2,_0x50ab36){return function(_0x42cf69){if(!_0x42cf69){_0x16f2f2['sendStatus'](0x194);}return _0x42cf69;};}function handleError(_0xc037b8,_0x18d28f){_0x18d28f=_0x18d28f||0x1f4;return function(_0x639cc7){logger[_0x6a8f('0x28')](_0x639cc7[_0x6a8f('0x3d')]);if(_0x639cc7[_0x6a8f('0x3e')]){delete _0x639cc7[_0x6a8f('0x3e')];}_0xc037b8[_0x6a8f('0x2d')](_0x18d28f)[_0x6a8f('0x3f')](_0x639cc7);};}exports[_0x6a8f('0x40')]=function(_0x220304,_0x55594f){var _0xc72ef2={},_0x186708={},_0x49820b={'count':0x0,'rows':[]};var _0x5c1260=db[_0x6a8f('0x41')][_0x6a8f('0x42')];_0x186708[_0x6a8f('0x43')]=_['keys'](_0x5c1260);_0x186708['query']=_[_0x6a8f('0x44')](_0x220304[_0x6a8f('0x45')]);_0x186708['filters']=_['intersection'](_0x186708[_0x6a8f('0x43')],_0x186708[_0x6a8f('0x45')]);_0xc72ef2[_0x6a8f('0x46')]=_[_0x6a8f('0x47')](_0x186708[_0x6a8f('0x43')],qs[_0x6a8f('0x48')](_0x220304['query'][_0x6a8f('0x48')]));_0xc72ef2[_0x6a8f('0x46')]=_0xc72ef2[_0x6a8f('0x46')][_0x6a8f('0x49')]?_0xc72ef2[_0x6a8f('0x46')]:_0x186708[_0x6a8f('0x43')];if(!_0x220304[_0x6a8f('0x45')][_0x6a8f('0x4a')](_0x6a8f('0x4b'))){_0xc72ef2[_0x6a8f('0x32')]=qs['limit'](_0x220304[_0x6a8f('0x45')][_0x6a8f('0x32')]);_0xc72ef2[_0x6a8f('0x31')]=qs['offset'](_0x220304[_0x6a8f('0x45')][_0x6a8f('0x31')]);}_0xc72ef2[_0x6a8f('0x4c')]=qs[_0x6a8f('0x4d')](_0x220304[_0x6a8f('0x45')][_0x6a8f('0x4d')]);_0xc72ef2[_0x6a8f('0x4e')]=qs[_0x6a8f('0x4f')](_[_0x6a8f('0x50')](_0x220304[_0x6a8f('0x45')],_0x186708['filters']));if(_0x220304[_0x6a8f('0x45')][_0x6a8f('0x51')]){_0xc72ef2[_0x6a8f('0x4e')]=_[_0x6a8f('0x52')](_0xc72ef2[_0x6a8f('0x4e')],{'$or':_[_0x6a8f('0x53')](_0x5c1260,function(_0x3caff8){if(_0x3caff8[_0x6a8f('0x54')][_0x6a8f('0x55')]!==_0x6a8f('0x56')){var _0x1b0df7={};_0x1b0df7[_0x3caff8[_0x6a8f('0x57')]]={'$like':'%'+_0x220304[_0x6a8f('0x45')][_0x6a8f('0x51')]+'%'};return _0x1b0df7;}})});}_0xc72ef2=_[_0x6a8f('0x52')]({},_0xc72ef2,_0x220304[_0x6a8f('0x58')]);var _0x65649e={'where':_0xc72ef2[_0x6a8f('0x4e')]};return db[_0x6a8f('0x41')][_0x6a8f('0x30')](_0x65649e)[_0x6a8f('0x39')](function(_0x415c02){_0x49820b['count']=_0x415c02;if(_0x220304[_0x6a8f('0x45')][_0x6a8f('0x59')]){_0xc72ef2[_0x6a8f('0x5a')]=[{'all':!![]}];}return db[_0x6a8f('0x41')][_0x6a8f('0x5b')](_0xc72ef2);})[_0x6a8f('0x39')](function(_0x3823f7){_0x49820b[_0x6a8f('0x5c')]=_0x3823f7;return _0x49820b;})[_0x6a8f('0x39')](respondWithFilteredResult(_0x55594f,_0xc72ef2))['catch'](handleError(_0x55594f,null));};exports['show']=function(_0x66ce7a,_0x498105){var _0x12ee22={'raw':!![],'where':{'id':_0x66ce7a[_0x6a8f('0x5d')]['id']}},_0x5435ec={};_0x5435ec[_0x6a8f('0x43')]=_['keys'](db['ChatQueue'][_0x6a8f('0x42')]);_0x5435ec[_0x6a8f('0x45')]=_['keys'](_0x66ce7a[_0x6a8f('0x45')]);_0x5435ec[_0x6a8f('0x4f')]=_[_0x6a8f('0x47')](_0x5435ec[_0x6a8f('0x43')],_0x5435ec['query']);_0x12ee22[_0x6a8f('0x46')]=_['intersection'](_0x5435ec[_0x6a8f('0x43')],qs['fields'](_0x66ce7a['query'][_0x6a8f('0x48')]));_0x12ee22[_0x6a8f('0x46')]=_0x12ee22[_0x6a8f('0x46')][_0x6a8f('0x49')]?_0x12ee22[_0x6a8f('0x46')]:_0x5435ec[_0x6a8f('0x43')];if(_0x66ce7a[_0x6a8f('0x45')][_0x6a8f('0x59')]){_0x12ee22[_0x6a8f('0x5a')]=[{'all':!![]}];}_0x12ee22=_[_0x6a8f('0x52')]({},_0x12ee22,_0x66ce7a[_0x6a8f('0x58')]);return db[_0x6a8f('0x41')][_0x6a8f('0x5e')](_0x12ee22)[_0x6a8f('0x39')](handleEntityNotFound(_0x498105,null))['then'](respondWithResult(_0x498105,null))[_0x6a8f('0x2b')](handleError(_0x498105,null));};exports[_0x6a8f('0x5f')]=function(_0x435a37,_0x4d62a9){return db[_0x6a8f('0x41')]['create'](_0x435a37[_0x6a8f('0x60')],{})['then'](function(_0x49b77b){var _0x13cd76=_0x435a37[_0x6a8f('0x61')][_0x6a8f('0x3a')]({'plain':!![]});if(!_0x13cd76)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13cd76['role']===_0x6a8f('0x61')){var _0x317801=_0x49b77b[_0x6a8f('0x3a')]({'plain':!![]});var _0xf3e823=_0x6a8f('0x62');return db[_0x6a8f('0x63')][_0x6a8f('0x5e')]({'where':{'name':_0xf3e823,'userProfileId':_0x13cd76['userProfileId']},'raw':!![]})[_0x6a8f('0x39')](function(_0x204f61){if(_0x204f61&&_0x204f61[_0x6a8f('0x64')]===0x0){return db[_0x6a8f('0x3b')][_0x6a8f('0x5f')]({'name':_0x317801[_0x6a8f('0x3e')],'resourceId':_0x317801['id'],'type':_0x204f61[_0x6a8f('0x3e')],'sectionId':_0x204f61['id']},{})[_0x6a8f('0x39')](function(){return _0x49b77b;});}else{return _0x49b77b;}})[_0x6a8f('0x2b')](function(_0x4a03fd){logger['error'](_0x6a8f('0x65'),_0x4a03fd);throw _0x4a03fd;});}return _0x49b77b;})['then'](respondWithResult(_0x4d62a9,0xc9))[_0x6a8f('0x2b')](handleError(_0x4d62a9,null));};exports['update']=function(_0x2494db,_0x5e4fb7){if(_0x2494db['body']['id']){delete _0x2494db[_0x6a8f('0x60')]['id'];}return db['ChatQueue'][_0x6a8f('0x5e')]({'where':{'id':_0x2494db[_0x6a8f('0x5d')]['id']}})[_0x6a8f('0x39')](handleEntityNotFound(_0x5e4fb7,null))['then'](saveUpdates(_0x2494db[_0x6a8f('0x60')],null))[_0x6a8f('0x39')](respondWithResult(_0x5e4fb7,null))[_0x6a8f('0x2b')](handleError(_0x5e4fb7,null));};exports[_0x6a8f('0x3c')]=function(_0x2c7037,_0x1cfd78){return db['ChatQueue'][_0x6a8f('0x5e')]({'where':{'id':_0x2c7037['params']['id']}})[_0x6a8f('0x39')](handleEntityNotFound(_0x1cfd78,null))[_0x6a8f('0x39')](removeEntity(_0x1cfd78,null))[_0x6a8f('0x2b')](handleError(_0x1cfd78,null));};exports[_0x6a8f('0x66')]=function(_0x13518f,_0x49f8c4){return db[_0x6a8f('0x41')][_0x6a8f('0x66')]()[_0x6a8f('0x39')](respondWithResult(_0x49f8c4,null))[_0x6a8f('0x2b')](handleError(_0x49f8c4,null));};exports[_0x6a8f('0x67')]=function(_0x311a71,_0x40e469,_0x5e8125){var _0x13daa5={'raw':!![],'where':{}},_0x335785={},_0x3ed3cc;return db[_0x6a8f('0x41')][_0x6a8f('0x68')]({'where':{'id':_0x311a71[_0x6a8f('0x5d')]['id']}})[_0x6a8f('0x39')](handleEntityNotFound(_0x40e469,null))[_0x6a8f('0x39')](function(_0x1f9df5){if(_0x1f9df5){_0x3ed3cc=_0x1f9df5[_0x6a8f('0x3a')]({'plain':!![]});_0x335785[_0x6a8f('0x43')]=_[_0x6a8f('0x44')](db['UserChatQueue'][_0x6a8f('0x42')]);_0x335785[_0x6a8f('0x45')]=_[_0x6a8f('0x44')](_0x311a71[_0x6a8f('0x45')]);_0x335785['filters']=_[_0x6a8f('0x47')](_0x335785['model'],_0x335785[_0x6a8f('0x45')]);_0x13daa5['attributes']=_[_0x6a8f('0x47')](_0x335785['model'],qs['fields'](_0x311a71[_0x6a8f('0x45')]['fields']));_0x13daa5[_0x6a8f('0x46')]=_0x13daa5[_0x6a8f('0x46')][_0x6a8f('0x49')]?_0x13daa5['attributes']:_0x335785[_0x6a8f('0x43')];if(!_0x311a71[_0x6a8f('0x45')][_0x6a8f('0x4a')](_0x6a8f('0x4b'))){_0x13daa5[_0x6a8f('0x32')]=qs[_0x6a8f('0x32')](_0x311a71[_0x6a8f('0x45')][_0x6a8f('0x32')]);_0x13daa5[_0x6a8f('0x31')]=qs[_0x6a8f('0x31')](_0x311a71[_0x6a8f('0x45')][_0x6a8f('0x31')]);}_0x13daa5['order']=qs[_0x6a8f('0x4d')](_0x311a71[_0x6a8f('0x45')]['sort']);_0x13daa5['where']=qs[_0x6a8f('0x4f')](_['pick'](_0x311a71[_0x6a8f('0x45')],_0x335785[_0x6a8f('0x4f')]));_0x13daa5['where']['ChatQueueId']=_0x1f9df5['id'];if(_0x311a71['query'][_0x6a8f('0x51')]){_0x13daa5[_0x6a8f('0x4e')]=_[_0x6a8f('0x52')](_0x13daa5[_0x6a8f('0x4e')],{'$or':_[_0x6a8f('0x53')](_0x13daa5[_0x6a8f('0x46')],function(_0x36921f){var _0x1de33f={};_0x1de33f[_0x36921f]={'$like':'%'+_0x311a71['query'][_0x6a8f('0x51')]+'%'};return _0x1de33f;})});}_0x13daa5=_['merge']({},_0x13daa5,_0x311a71[_0x6a8f('0x58')]);return db[_0x6a8f('0x69')][_0x6a8f('0x5b')](_0x13daa5);}})[_0x6a8f('0x39')](function(_0x3bda0c){if(_0x3bda0c){return db['User'][_0x6a8f('0x6a')]({'where':{'id':_[_0x6a8f('0x53')](_0x3bda0c,_0x6a8f('0x6b')),'role':_0x6a8f('0x6c')},'attributes':['id',_0x6a8f('0x3e'),_0x6a8f('0x6d'),_0x6a8f('0x6e'),'createdAt']});}})[_0x6a8f('0x39')](function(_0x250a78){if(_0x250a78){return{'count':_0x250a78[_0x6a8f('0x30')],'rows':_[_0x6a8f('0x53')](_0x250a78[_0x6a8f('0x5c')],function(_0xab654){return{'membername':_0xab654[_0x6a8f('0x3e')],'UserId':_0xab654['id'],'queue_name':_0x3ed3cc['name'],'ChatQueueId':_0x3ed3cc['id'],'interface':util[_0x6a8f('0x6f')](_0x6a8f('0x70'),_0x6a8f('0x71'),_0xab654[_0x6a8f('0x3e')]),'penalty':0x0,'paused':_0xab654[_0x6a8f('0x6d')],'createdAt':_0xab654['createdAt'],'updatedAt':_0xab654[_0x6a8f('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6a8f('0x39')](respondWithFilteredResult(_0x40e469,_0x13daa5))[_0x6a8f('0x2b')](handleError(_0x40e469,null));};exports['getTeams']=function(_0x1cd1cc,_0x114dad,_0x184e62){var _0x42d2ee={};var _0x229d32={};var _0x31f42b;var _0x2508f0;return db[_0x6a8f('0x41')][_0x6a8f('0x68')]({'where':{'id':_0x1cd1cc[_0x6a8f('0x5d')]['id']}})[_0x6a8f('0x39')](handleEntityNotFound(_0x114dad,null))['then'](function(_0x2b7dcd){if(_0x2b7dcd){_0x31f42b=_0x2b7dcd;_0x229d32[_0x6a8f('0x43')]=_[_0x6a8f('0x44')](db['Team'][_0x6a8f('0x42')]);_0x229d32[_0x6a8f('0x45')]=_['keys'](_0x1cd1cc['query']);_0x229d32[_0x6a8f('0x4f')]=_[_0x6a8f('0x47')](_0x229d32[_0x6a8f('0x43')],_0x229d32[_0x6a8f('0x45')]);_0x42d2ee[_0x6a8f('0x46')]=_[_0x6a8f('0x47')](_0x229d32['model'],qs[_0x6a8f('0x48')](_0x1cd1cc['query'][_0x6a8f('0x48')]));_0x42d2ee[_0x6a8f('0x46')]=_0x42d2ee[_0x6a8f('0x46')][_0x6a8f('0x49')]?_0x42d2ee[_0x6a8f('0x46')]:_0x229d32[_0x6a8f('0x43')];_0x42d2ee[_0x6a8f('0x4c')]=qs['sort'](_0x1cd1cc['query'][_0x6a8f('0x4d')]);_0x42d2ee['where']=qs[_0x6a8f('0x4f')](_[_0x6a8f('0x50')](_0x1cd1cc[_0x6a8f('0x45')],_0x229d32['filters']));if(_0x1cd1cc['query'][_0x6a8f('0x51')]){_0x42d2ee[_0x6a8f('0x4e')]=_['merge'](_0x42d2ee[_0x6a8f('0x4e')],{'$or':_[_0x6a8f('0x53')](_0x42d2ee[_0x6a8f('0x46')],function(_0x26f953){var _0x401bef={};_0x401bef[_0x26f953]={'$like':'%'+_0x1cd1cc[_0x6a8f('0x45')][_0x6a8f('0x51')]+'%'};return _0x401bef;})});}_0x42d2ee=_['merge']({},_0x42d2ee,_0x1cd1cc[_0x6a8f('0x58')]);return _0x31f42b[_0x6a8f('0x72')](_0x42d2ee);}})[_0x6a8f('0x39')](function(_0x2aa85){if(_0x2aa85){_0x2508f0=_0x2aa85[_0x6a8f('0x49')];if(!_0x1cd1cc[_0x6a8f('0x45')][_0x6a8f('0x4a')](_0x6a8f('0x4b'))){_0x42d2ee[_0x6a8f('0x32')]=qs['limit'](_0x1cd1cc[_0x6a8f('0x45')][_0x6a8f('0x32')]);_0x42d2ee[_0x6a8f('0x31')]=qs[_0x6a8f('0x31')](_0x1cd1cc[_0x6a8f('0x45')][_0x6a8f('0x31')]);}return _0x31f42b['getTeams'](_0x42d2ee);}})[_0x6a8f('0x39')](function(_0x5740fe){if(_0x5740fe){return _0x5740fe?{'count':_0x2508f0,'rows':_0x5740fe}:null;}})[_0x6a8f('0x39')](respondWithResult(_0x114dad,null))[_0x6a8f('0x2b')](handleError(_0x114dad,null));};exports[_0x6a8f('0x73')]=function(_0x47fa26,_0x264f76,_0x590054){var _0x4b484a=[];var _0x39c1ea;return db[_0x6a8f('0x74')][_0x6a8f('0x5b')]({'where':{'id':_0x47fa26['body'][_0x6a8f('0x75')]},'attributes':['id'],'include':[{'model':db[_0x6a8f('0x76')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6a8f('0x39')](function(_0x430283){if(_0x430283){for(var _0x585065=0x0;_0x585065<_0x430283[_0x6a8f('0x49')];_0x585065+=0x1){for(var _0x1ef5c5=0x0;_0x1ef5c5<_0x430283[_0x585065][_0x6a8f('0x77')]['length'];_0x1ef5c5+=0x1){_0x4b484a=_['union'](_0x4b484a,[_0x430283[_0x585065]['Agents'][_0x1ef5c5]['id']]);}}return _0x4b484a;}})[_0x6a8f('0x39')](function(_0xeb642d){if(_0xeb642d){return db[_0x6a8f('0x41')][_0x6a8f('0x5e')]({'where':{'id':_0x47fa26[_0x6a8f('0x5d')]['id']}});}})[_0x6a8f('0x39')](function(_0x106887){if(_0x106887){_0x39c1ea=_0x106887;return _0x39c1ea[_0x6a8f('0x78')](_0x4b484a,{'penalty':_0x47fa26[_0x6a8f('0x60')][_0x6a8f('0x79')]});}})[_0x6a8f('0x39')](function(_0x39f664){if(_0x39f664){return _0x39c1ea[_0x6a8f('0x73')](_0x47fa26[_0x6a8f('0x60')][_0x6a8f('0x75')]);}})[_0x6a8f('0x39')](handleEntityNotFound(_0x264f76,null))[_0x6a8f('0x39')](respondWithStatusCode(_0x264f76,null))[_0x6a8f('0x2b')](handleError(_0x264f76,null));};exports[_0x6a8f('0x7a')]=function(_0x9e9f73,_0x2fc869,_0x14545e){var _0xf6f1c9=[];var _0x2a1578;return db[_0x6a8f('0x74')][_0x6a8f('0x5b')]({'where':{'id':_0x9e9f73[_0x6a8f('0x45')][_0x6a8f('0x75')]},'attributes':['id'],'include':[{'model':db[_0x6a8f('0x76')],'as':_0x6a8f('0x77'),'attributes':['id'],'raw':!![]}]})[_0x6a8f('0x39')](function(_0x22b03f){if(_0x22b03f){for(var _0x517724=0x0;_0x517724<_0x22b03f['length'];_0x517724+=0x1){for(var _0x37998d=0x0;_0x37998d<_0x22b03f[_0x517724][_0x6a8f('0x77')][_0x6a8f('0x49')];_0x37998d+=0x1){_0xf6f1c9=_['union'](_0xf6f1c9,[_0x22b03f[_0x517724][_0x6a8f('0x77')][_0x37998d]['id']]);}}return _0xf6f1c9;}})[_0x6a8f('0x39')](function(_0x13a761){if(_0x13a761){return db[_0x6a8f('0x41')][_0x6a8f('0x5e')]({'where':{'id':_0x9e9f73['params']['id']}});}})[_0x6a8f('0x39')](function(_0x41339c){if(_0x41339c){_0x2a1578=_0x41339c;return _0x2a1578[_0x6a8f('0x7b')](_0xf6f1c9);}})[_0x6a8f('0x39')](function(_0x16c2a1){if(_0x2a1578){return _0x2a1578[_0x6a8f('0x7a')](_0x9e9f73[_0x6a8f('0x45')]['ids']);}})[_0x6a8f('0x39')](handleEntityNotFound(_0x2fc869,null))[_0x6a8f('0x39')](respondWithStatusCode(_0x2fc869,null))[_0x6a8f('0x2b')](handleError(_0x2fc869,null));};exports[_0x6a8f('0x78')]=function(_0x4cc66f,_0xa597ba,_0xe3ef11){return db[_0x6a8f('0x41')]['find']({'where':{'id':_0x4cc66f[_0x6a8f('0x5d')]['id']}})[_0x6a8f('0x39')](handleEntityNotFound(_0xa597ba,null))[_0x6a8f('0x39')](function(_0x35adab){if(_0x35adab){return _0x35adab['addAgents'](_0x4cc66f[_0x6a8f('0x60')][_0x6a8f('0x75')],_[_0x6a8f('0x7c')](_0x4cc66f[_0x6a8f('0x60')],['ids','id'])||{})[_0x6a8f('0x7d')](function(_0x1968e8){for(var _0xed8656=0x0;_0xed8656<_0x4cc66f[_0x6a8f('0x60')]['ids']['length'];_0xed8656+=0x1){socket[_0x6a8f('0x7e')](_0x6a8f('0x7f'),{'UserId':_0x4cc66f['body']['ids'][_0xed8656],'ChatQueueId':_0x4cc66f[_0x6a8f('0x5d')]['id']});}return _0x1968e8;});}})[_0x6a8f('0x39')](respondWithResult(_0xa597ba,null))[_0x6a8f('0x2b')](handleError(_0xa597ba,null));};exports[_0x6a8f('0x7b')]=function(_0x5584bf,_0x10f205,_0x1d9332){var _0x203044;return db[_0x6a8f('0x41')][_0x6a8f('0x5e')]({'where':{'id':_0x5584bf['params']['id']}})['then'](handleEntityNotFound(_0x10f205,null))[_0x6a8f('0x39')](function(_0x5bf688){if(_0x5bf688){return _0x5bf688[_0x6a8f('0x7b')](_0x5584bf[_0x6a8f('0x45')]['ids'])[_0x6a8f('0x39')](function(_0x5383c0){if(_[_0x6a8f('0x80')](_0x5584bf[_0x6a8f('0x45')][_0x6a8f('0x75')])){for(var _0x2672fe=0x0;_0x2672fe<_0x5584bf['query'][_0x6a8f('0x75')]['length'];_0x2672fe+=0x1){socket[_0x6a8f('0x7e')](_0x6a8f('0x81'),{'UserId':_0x5584bf['query']['ids'][_0x2672fe],'ChatQueueId':_0x5584bf['params']['id']});}}else{socket[_0x6a8f('0x7e')](_0x6a8f('0x81'),{'UserId':_0x5584bf['query'][_0x6a8f('0x75')],'ChatQueueId':_0x5584bf['params']['id']});}});}})[_0x6a8f('0x39')](respondWithStatusCode(_0x10f205,null))[_0x6a8f('0x2b')](handleError(_0x10f205,null));};exports[_0x6a8f('0x82')]=function(_0x7cfe31,_0xb02a69,_0x1f3c3a){var _0x4b6531={};var _0x12734f={};var _0x17d396;var _0x24f2c4;return db[_0x6a8f('0x41')][_0x6a8f('0x68')]({'where':{'id':_0x7cfe31[_0x6a8f('0x5d')]['id']}})[_0x6a8f('0x39')](handleEntityNotFound(_0xb02a69,null))[_0x6a8f('0x39')](function(_0x47b773){if(_0x47b773){_0x17d396=_0x47b773;_0x12734f[_0x6a8f('0x43')]=_[_0x6a8f('0x44')](db[_0x6a8f('0x76')][_0x6a8f('0x42')]);_0x12734f[_0x6a8f('0x45')]=_['keys'](_0x7cfe31['query']);_0x12734f['filters']=_[_0x6a8f('0x47')](_0x12734f[_0x6a8f('0x43')],_0x12734f['query']);_0x4b6531[_0x6a8f('0x46')]=_[_0x6a8f('0x47')](_0x12734f[_0x6a8f('0x43')],qs[_0x6a8f('0x48')](_0x7cfe31['query']['fields']));_0x4b6531[_0x6a8f('0x46')]=_0x4b6531[_0x6a8f('0x46')][_0x6a8f('0x49')]?_0x4b6531[_0x6a8f('0x46')]:_0x12734f['model'];_0x4b6531[_0x6a8f('0x4c')]=qs[_0x6a8f('0x4d')](_0x7cfe31[_0x6a8f('0x45')][_0x6a8f('0x4d')]);_0x4b6531['where']=qs['filters'](_[_0x6a8f('0x50')](_0x7cfe31[_0x6a8f('0x45')],_0x12734f[_0x6a8f('0x4f')]));if(_0x7cfe31[_0x6a8f('0x45')]['filter']){_0x4b6531[_0x6a8f('0x4e')]=_['merge'](_0x4b6531[_0x6a8f('0x4e')],{'$or':_[_0x6a8f('0x53')](_0x4b6531['attributes'],function(_0x2ce63c){var _0x15d2a9={};_0x15d2a9[_0x2ce63c]={'$like':'%'+_0x7cfe31[_0x6a8f('0x45')]['filter']+'%'};return _0x15d2a9;})});}_0x4b6531=_['merge']({},_0x4b6531,_0x7cfe31[_0x6a8f('0x58')]);return _0x17d396[_0x6a8f('0x82')](_0x4b6531);}})[_0x6a8f('0x39')](function(_0x1b5e91){if(_0x1b5e91){_0x24f2c4=_0x1b5e91[_0x6a8f('0x49')];if(!_0x7cfe31[_0x6a8f('0x45')]['hasOwnProperty'](_0x6a8f('0x4b'))){_0x4b6531[_0x6a8f('0x32')]=qs[_0x6a8f('0x32')](_0x7cfe31['query'][_0x6a8f('0x32')]);_0x4b6531[_0x6a8f('0x31')]=qs[_0x6a8f('0x31')](_0x7cfe31[_0x6a8f('0x45')][_0x6a8f('0x31')]);}return _0x17d396[_0x6a8f('0x82')](_0x4b6531);}})[_0x6a8f('0x39')](function(_0x40f8ce){if(_0x40f8ce){return _0x40f8ce?{'count':_0x24f2c4,'rows':_0x40f8ce}:null;}})[_0x6a8f('0x39')](respondWithResult(_0xb02a69,null))[_0x6a8f('0x2b')](handleError(_0xb02a69,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index dc86db5..89ab276 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 _0xe1aa=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x1e71f6,_0x1490b8){var _0x15971a=function(_0x319d49){while(--_0x319d49){_0x1e71f6['push'](_0x1e71f6['shift']());}};_0x15971a(++_0x1490b8);}(_0xe1aa,0xfc));var _0xae1a=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe1aa[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0xae1a('0x0'));var ChatQueue=require(_0xae1a('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xae1a('0x2'),'afterUpdate':_0xae1a('0x3'),'afterDestroy':_0xae1a('0x4')};function emitEvent(_0x29b837){return function(_0xc4d129,_0x5d1bdd,_0x11ab3b){ChatQueueEvents['emit'](_0x29b837+':'+_0xc4d129['id'],_0xc4d129);ChatQueueEvents[_0xae1a('0x5')](_0x29b837,_0xc4d129);_0x11ab3b(null);};}for(var e in events){if(events[_0xae1a('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x803f=['remove','emit','hasOwnProperty','exports','events','ChatQueue','setMaxListeners','update'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x803f,0x64));var _0xf803=function(_0x480cd0,_0x1b19c0){_0x480cd0=_0x480cd0-0x0;var _0x9fef14=_0x803f[_0x480cd0];return _0x9fef14;};'use strict';var EventEmitter=require(_0xf803('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xf803('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf803('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf803('0x3'),'afterDestroy':_0xf803('0x4')};function emitEvent(_0x19ff73){return function(_0x6baafe,_0x5c2cd6,_0x57c4f0){ChatQueueEvents[_0xf803('0x5')](_0x19ff73+':'+_0x6baafe['id'],_0x6baafe);ChatQueueEvents[_0xf803('0x5')](_0x19ff73,_0x6baafe);_0x57c4f0(null);};}for(var e in events){if(events[_0xf803('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xf803('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index ec7392d..edf0cb4 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 _0x6aa7=['lodash','../../config/logger','api','moment','bluebird','./chatQueue.attributes','exports','ChatQueue'];(function(_0x20d91c,_0x3d3e25){var _0x54f2a0=function(_0x4f0a19){while(--_0x4f0a19){_0x20d91c['push'](_0x20d91c['shift']());}};_0x54f2a0(++_0x3d3e25);}(_0x6aa7,0x178));var _0x76aa=function(_0x496b44,_0x5880da){_0x496b44=_0x496b44-0x0;var _0x189d97=_0x6aa7[_0x496b44];return _0x189d97;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var attributes=require(_0x76aa('0x5'));module[_0x76aa('0x6')]=function(_0x1d6e04,_0x511588){return _0x1d6e04['define'](_0x76aa('0x7'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c7=['lodash','util','../../config/logger','api','moment','request-promise','./chatQueue.attributes','exports','ChatQueue','chat_queues'];(function(_0x27fa65,_0x4e02ee){var _0x456594=function(_0x43b6da){while(--_0x43b6da){_0x27fa65['push'](_0x27fa65['shift']());}};_0x456594(++_0x4e02ee);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x456a9c,_0x217fd3){_0x456a9c=_0x456a9c-0x0;var _0x2f6340=_0xb4c7[_0x456a9c];return _0x2f6340;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var attributes=require(_0x7b4c('0x6'));module[_0x7b4c('0x7')]=function(_0x17cea2,_0x2d9945){return _0x17cea2['define'](_0x7b4c('0x8'),attributes,{'tableName':_0x7b4c('0x9'),'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 c6ca587..c4c3887 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 _0x85d5=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatQueue','options','raw','where','map','include','model','attributes','GetChatQueue','stringify','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring'];(function(_0x4cffbd,_0xa37adc){var _0x36a7fc=function(_0x2f600a){while(--_0x2f600a){_0x4cffbd['push'](_0x4cffbd['shift']());}};_0x36a7fc(++_0xa37adc);}(_0x85d5,0xbe));var _0x585d=function(_0x2f5e89,_0x11807c){_0x2f5e89=_0x2f5e89-0x0;var _0xcf95ce=_0x85d5[_0x2f5e89];return _0xcf95ce;};'use strict';var _=require(_0x585d('0x0'));var util=require(_0x585d('0x1'));var moment=require(_0x585d('0x2'));var BPromise=require(_0x585d('0x3'));var rs=require(_0x585d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x585d('0x5'))['db'];var utils=require(_0x585d('0x6'));var logger=require(_0x585d('0x7'))('rpc');var config=require(_0x585d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x585d('0x9')]({'port':0x232a});config[_0x585d('0xa')]=_[_0x585d('0xb')](config[_0x585d('0xa')],{'host':_0x585d('0xc'),'port':0x18eb});var socket=require(_0x585d('0xd'))(new Redis(config[_0x585d('0xa')]));require('./chatQueue.socket')[_0x585d('0xe')](socket);function respondWithRpcPromise(_0x24fadc,_0x1e4d82,_0x1e0cef){return new BPromise(function(_0x49592c,_0x4454b1){return client[_0x585d('0xf')](_0x24fadc,_0x1e0cef)[_0x585d('0x10')](function(_0x4c0dc0){logger[_0x585d('0x11')](_0x585d('0x12'),_0x1e4d82,_0x585d('0x13'));logger[_0x585d('0x14')](_0x585d('0x15'),_0x1e4d82,_0x585d('0x13'),JSON['stringify'](_0x4c0dc0));if(_0x4c0dc0[_0x585d('0x16')]){if(_0x4c0dc0[_0x585d('0x16')][_0x585d('0x17')]===0x1f4){logger[_0x585d('0x16')]('ChatQueue,\x20%s,\x20%s',_0x1e4d82,_0x4c0dc0[_0x585d('0x16')]['message']);return _0x4454b1(_0x4c0dc0[_0x585d('0x16')][_0x585d('0x18')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x1e4d82,_0x4c0dc0['error'][_0x585d('0x18')]);return _0x49592c(_0x4c0dc0[_0x585d('0x16')][_0x585d('0x18')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x1e4d82,'request\x20sent');_0x49592c(_0x4c0dc0[_0x585d('0x19')][_0x585d('0x18')]);}})[_0x585d('0x1a')](function(_0x501384){logger[_0x585d('0x16')](_0x585d('0x12'),_0x1e4d82,_0x501384);_0x4454b1(_0x501384);});});}exports['GetChatQueue']=function(_0xd37e54){var _0x1b22b6=this;return new Promise(function(_0x22a712,_0x59dc82){return db[_0x585d('0x1b')]['findAll']({'raw':_0xd37e54[_0x585d('0x1c')]?_0xd37e54[_0x585d('0x1c')][_0x585d('0x1d')]===undefined?!![]:![]:!![],'where':_0xd37e54[_0x585d('0x1c')]?_0xd37e54[_0x585d('0x1c')][_0x585d('0x1e')]||null:null,'attributes':_0xd37e54[_0x585d('0x1c')]?_0xd37e54[_0x585d('0x1c')]['attributes']||null:null,'limit':_0xd37e54[_0x585d('0x1c')]?_0xd37e54[_0x585d('0x1c')]['limit']||null:null,'include':_0xd37e54[_0x585d('0x1c')]?_0xd37e54['options']['include']?_[_0x585d('0x1f')](_0xd37e54['options'][_0x585d('0x20')],function(_0x5581d9){return{'model':db[_0x5581d9[_0x585d('0x21')]],'as':_0x5581d9['as'],'attributes':_0x5581d9[_0x585d('0x22')],'include':_0x5581d9[_0x585d('0x20')]?_[_0x585d('0x1f')](_0x5581d9[_0x585d('0x20')],function(_0x278378){return{'model':db[_0x278378[_0x585d('0x21')]],'as':_0x278378['as'],'attributes':_0x278378['attributes'],'include':_0x278378['include']?_[_0x585d('0x1f')](_0x278378[_0x585d('0x20')],function(_0x8d5470){return{'model':db[_0x8d5470['model']],'as':_0x8d5470['as'],'attributes':_0x8d5470[_0x585d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x585d('0x10')](function(_0x1f474f){logger['info'](_0x585d('0x23'),_0xd37e54);logger[_0x585d('0x14')](_0x585d('0x23'),_0xd37e54,JSON[_0x585d('0x24')](_0x1f474f));_0x22a712(_0x1f474f);})[_0x585d('0x1a')](function(_0xf00727){logger[_0x585d('0x16')]('GetChatQueue',_0xf00727['message'],_0xd37e54);_0x59dc82(_0x1b22b6['error'](0x1f4,_0xf00727[_0x585d('0x18')]));});});};exports[_0x585d('0x25')]=function(_0x2bdb1b){var _0x67e553=this;return new Promise(function(_0x474c3f,_0x53c66d){return db[_0x585d('0x1b')][_0x585d('0x26')]({'raw':_0x2bdb1b[_0x585d('0x1c')]?_0x2bdb1b[_0x585d('0x1c')][_0x585d('0x1d')]===undefined?!![]:![]:!![],'where':_0x2bdb1b[_0x585d('0x1c')]?_0x2bdb1b['options'][_0x585d('0x1e')]||null:null,'attributes':_0x2bdb1b[_0x585d('0x1c')]?_0x2bdb1b[_0x585d('0x1c')][_0x585d('0x22')]||null:null,'include':_0x2bdb1b[_0x585d('0x1c')]?_0x2bdb1b[_0x585d('0x1c')][_0x585d('0x20')]?_[_0x585d('0x1f')](_0x2bdb1b[_0x585d('0x1c')][_0x585d('0x20')],function(_0x2a59ad){return{'model':db[_0x2a59ad[_0x585d('0x21')]],'as':_0x2a59ad['as'],'attributes':_0x2a59ad['attributes'],'include':_0x2a59ad[_0x585d('0x20')]?_[_0x585d('0x1f')](_0x2a59ad['include'],function(_0x4b394a){return{'model':db[_0x4b394a[_0x585d('0x21')]],'as':_0x4b394a['as'],'attributes':_0x4b394a[_0x585d('0x22')],'include':_0x4b394a[_0x585d('0x20')]?_[_0x585d('0x1f')](_0x4b394a[_0x585d('0x20')],function(_0x5e5bf7){return{'model':db[_0x5e5bf7[_0x585d('0x21')]],'as':_0x5e5bf7['as'],'attributes':_0x5e5bf7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bbcaa){logger[_0x585d('0x11')]('ShowChatQueue',_0x2bdb1b);logger[_0x585d('0x14')](_0x585d('0x25'),_0x2bdb1b,JSON['stringify'](_0x3bbcaa));_0x474c3f(_0x3bbcaa);})[_0x585d('0x1a')](function(_0x7f5df8){logger[_0x585d('0x16')](_0x585d('0x25'),_0x7f5df8[_0x585d('0x18')],_0x2bdb1b);_0x53c66d(_0x67e553[_0x585d('0x16')](0x1f4,_0x7f5df8[_0x585d('0x18')]));});});}; \ No newline at end of file +var _0x3878=['request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','findAll','options','attributes','limit','include','model','debug','ShowChatQueue','ChatQueue','find','raw','where','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','register','request','then','info','ChatQueue,\x20%s,\x20%s'];(function(_0xa28b1a,_0x384f4b){var _0x4c9b78=function(_0x3cf640){while(--_0x3cf640){_0xa28b1a['push'](_0xa28b1a['shift']());}};_0x4c9b78(++_0x384f4b);}(_0x3878,0xb5));var _0x8387=function(_0x40889c,_0x73e154){_0x40889c=_0x40889c-0x0;var _0x1e69a3=_0x3878[_0x40889c];return _0x1e69a3;};'use strict';var _=require(_0x8387('0x0'));var util=require(_0x8387('0x1'));var moment=require(_0x8387('0x2'));var BPromise=require(_0x8387('0x3'));var rs=require(_0x8387('0x4'));var fs=require('fs');var Redis=require(_0x8387('0x5'));var db=require(_0x8387('0x6'))['db'];var utils=require(_0x8387('0x7'));var logger=require(_0x8387('0x8'))('rpc');var config=require(_0x8387('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8387('0xa')][_0x8387('0xb')]({'port':0x232a});config[_0x8387('0xc')]=_['defaults'](config[_0x8387('0xc')],{'host':_0x8387('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8387('0xc')]));require('./chatQueue.socket')[_0x8387('0xe')](socket);function respondWithRpcPromise(_0x31aab8,_0x1cfe7e,_0x2e1e7d){return new BPromise(function(_0x28e410,_0x3a0738){return client[_0x8387('0xf')](_0x31aab8,_0x2e1e7d)[_0x8387('0x10')](function(_0x3e7fd0){logger[_0x8387('0x11')](_0x8387('0x12'),_0x1cfe7e,_0x8387('0x13'));logger['debug'](_0x8387('0x14'),_0x1cfe7e,'request\x20sent',JSON[_0x8387('0x15')](_0x3e7fd0));if(_0x3e7fd0[_0x8387('0x16')]){if(_0x3e7fd0[_0x8387('0x16')]['code']===0x1f4){logger[_0x8387('0x16')](_0x8387('0x12'),_0x1cfe7e,_0x3e7fd0[_0x8387('0x16')][_0x8387('0x17')]);return _0x3a0738(_0x3e7fd0[_0x8387('0x16')][_0x8387('0x17')]);}logger['error'](_0x8387('0x12'),_0x1cfe7e,_0x3e7fd0[_0x8387('0x16')]['message']);return _0x28e410(_0x3e7fd0[_0x8387('0x16')][_0x8387('0x17')]);}else{logger['info'](_0x8387('0x12'),_0x1cfe7e,_0x8387('0x13'));_0x28e410(_0x3e7fd0[_0x8387('0x18')][_0x8387('0x17')]);}})[_0x8387('0x19')](function(_0x3cf86c){logger[_0x8387('0x16')](_0x8387('0x12'),_0x1cfe7e,_0x3cf86c);_0x3a0738(_0x3cf86c);});});}exports[_0x8387('0x1a')]=function(_0x121e39){var _0x4a8c99=this;return new Promise(function(_0x3686e9,_0x3600d1){return db['ChatQueue'][_0x8387('0x1b')]({'raw':_0x121e39['options']?_0x121e39[_0x8387('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x121e39[_0x8387('0x1c')]?_0x121e39['options']['where']||null:null,'attributes':_0x121e39[_0x8387('0x1c')]?_0x121e39['options'][_0x8387('0x1d')]||null:null,'limit':_0x121e39['options']?_0x121e39[_0x8387('0x1c')][_0x8387('0x1e')]||null:null,'include':_0x121e39['options']?_0x121e39['options']['include']?_['map'](_0x121e39[_0x8387('0x1c')][_0x8387('0x1f')],function(_0x342cce){return{'model':db[_0x342cce[_0x8387('0x20')]],'as':_0x342cce['as'],'attributes':_0x342cce[_0x8387('0x1d')],'include':_0x342cce[_0x8387('0x1f')]?_['map'](_0x342cce[_0x8387('0x1f')],function(_0x1e6054){return{'model':db[_0x1e6054[_0x8387('0x20')]],'as':_0x1e6054['as'],'attributes':_0x1e6054[_0x8387('0x1d')],'include':_0x1e6054[_0x8387('0x1f')]?_['map'](_0x1e6054['include'],function(_0x41c0e7){return{'model':db[_0x41c0e7[_0x8387('0x20')]],'as':_0x41c0e7['as'],'attributes':_0x41c0e7[_0x8387('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8387('0x10')](function(_0x2f3d0c){logger[_0x8387('0x11')]('GetChatQueue',_0x121e39);logger[_0x8387('0x21')](_0x8387('0x1a'),_0x121e39,JSON[_0x8387('0x15')](_0x2f3d0c));_0x3686e9(_0x2f3d0c);})[_0x8387('0x19')](function(_0x2d598a){logger[_0x8387('0x16')](_0x8387('0x1a'),_0x2d598a[_0x8387('0x17')],_0x121e39);_0x3600d1(_0x4a8c99[_0x8387('0x16')](0x1f4,_0x2d598a[_0x8387('0x17')]));});});};exports[_0x8387('0x22')]=function(_0x4e8d5c){var _0x22a92c=this;return new Promise(function(_0x2b7f42,_0x404c61){return db[_0x8387('0x23')][_0x8387('0x24')]({'raw':_0x4e8d5c[_0x8387('0x1c')]?_0x4e8d5c['options'][_0x8387('0x25')]===undefined?!![]:![]:!![],'where':_0x4e8d5c[_0x8387('0x1c')]?_0x4e8d5c['options'][_0x8387('0x26')]||null:null,'attributes':_0x4e8d5c[_0x8387('0x1c')]?_0x4e8d5c['options']['attributes']||null:null,'include':_0x4e8d5c[_0x8387('0x1c')]?_0x4e8d5c[_0x8387('0x1c')]['include']?_[_0x8387('0x27')](_0x4e8d5c[_0x8387('0x1c')]['include'],function(_0x15acf8){return{'model':db[_0x15acf8[_0x8387('0x20')]],'as':_0x15acf8['as'],'attributes':_0x15acf8[_0x8387('0x1d')],'include':_0x15acf8[_0x8387('0x1f')]?_['map'](_0x15acf8[_0x8387('0x1f')],function(_0x3e8d97){return{'model':db[_0x3e8d97[_0x8387('0x20')]],'as':_0x3e8d97['as'],'attributes':_0x3e8d97[_0x8387('0x1d')],'include':_0x3e8d97['include']?_[_0x8387('0x27')](_0x3e8d97[_0x8387('0x1f')],function(_0x204983){return{'model':db[_0x204983[_0x8387('0x20')]],'as':_0x204983['as'],'attributes':_0x204983[_0x8387('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8387('0x10')](function(_0x10c410){logger[_0x8387('0x11')](_0x8387('0x22'),_0x4e8d5c);logger['debug'](_0x8387('0x22'),_0x4e8d5c,JSON['stringify'](_0x10c410));_0x2b7f42(_0x10c410);})['catch'](function(_0xdc70d3){logger['error'](_0x8387('0x22'),_0xdc70d3[_0x8387('0x17')],_0x4e8d5c);_0x404c61(_0x22a92c['error'](0x1f4,_0xdc70d3['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index eb998fb..e02530b 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 _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 235b631..4093355 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 _0x3ccb=['destroy','removeTeams','removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','index','/describe','isAuthenticated','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','delete'];(function(_0x57901e,_0x4e7b69){var _0x52db6f=function(_0x5ea149){while(--_0x5ea149){_0x57901e['push'](_0x57901e['shift']());}};_0x52db6f(++_0x4e7b69);}(_0x3ccb,0x1ea));var _0xb3cc=function(_0x381b03,_0x3604d3){_0x381b03=_0x381b03-0x0;var _0x19d10d=_0x3ccb[_0x381b03];return _0x19d10d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb3cc('0x0'));var timeout=require(_0xb3cc('0x1'));var express=require(_0xb3cc('0x2'));var router=express['Router']();var auth=require(_0xb3cc('0x3'));var interaction=require(_0xb3cc('0x4'));var config=require(_0xb3cc('0x5'));var controller=require(_0xb3cc('0x6'));router[_0xb3cc('0x7')]('/',auth['isAuthenticated'](),controller[_0xb3cc('0x8')]);router[_0xb3cc('0x7')](_0xb3cc('0x9'),auth[_0xb3cc('0xa')](),controller['describe']);router[_0xb3cc('0x7')](_0xb3cc('0xb'),auth['isAuthenticated'](),controller[_0xb3cc('0xc')]);router[_0xb3cc('0x7')]('/:id/members',auth[_0xb3cc('0xa')](),controller[_0xb3cc('0xd')]);router[_0xb3cc('0x7')](_0xb3cc('0xe'),auth['isAuthenticated'](),controller[_0xb3cc('0xf')]);router[_0xb3cc('0x7')](_0xb3cc('0x10'),auth[_0xb3cc('0xa')](),controller[_0xb3cc('0x11')]);router[_0xb3cc('0x12')]('/',auth[_0xb3cc('0xa')](),controller['create']);router[_0xb3cc('0x12')](_0xb3cc('0xe'),auth[_0xb3cc('0xa')](),controller[_0xb3cc('0x13')]);router[_0xb3cc('0x12')]('/:id/users',auth[_0xb3cc('0xa')](),controller[_0xb3cc('0x14')]);router[_0xb3cc('0x15')](_0xb3cc('0xb'),auth[_0xb3cc('0xa')](),controller['update']);router[_0xb3cc('0x16')](_0xb3cc('0xb'),auth[_0xb3cc('0xa')](),controller[_0xb3cc('0x17')]);router[_0xb3cc('0x16')]('/:id/teams',auth[_0xb3cc('0xa')](),controller[_0xb3cc('0x18')]);router[_0xb3cc('0x16')]('/:id/users',auth[_0xb3cc('0xa')](),controller[_0xb3cc('0x19')]);module[_0xb3cc('0x1a')]=router; \ No newline at end of file +var _0xd44e=['post','create','/:id/teams','addTeams','addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents'];(function(_0x35aefa,_0x51c448){var _0x567caf=function(_0x3580a5){while(--_0x3580a5){_0x35aefa['push'](_0x35aefa['shift']());}};_0x567caf(++_0x51c448);}(_0xd44e,0x1da));var _0xed44=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd44e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xed44('0x0'));var util=require(_0xed44('0x1'));var path=require(_0xed44('0x2'));var timeout=require(_0xed44('0x3'));var express=require(_0xed44('0x4'));var router=express[_0xed44('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xed44('0x6'));var config=require('../../config/environment');var controller=require('./chatQueue.controller');router['get']('/',auth[_0xed44('0x7')](),controller[_0xed44('0x8')]);router[_0xed44('0x9')](_0xed44('0xa'),auth[_0xed44('0x7')](),controller[_0xed44('0xb')]);router[_0xed44('0x9')](_0xed44('0xc'),auth[_0xed44('0x7')](),controller[_0xed44('0xd')]);router[_0xed44('0x9')](_0xed44('0xe'),auth[_0xed44('0x7')](),controller[_0xed44('0xf')]);router[_0xed44('0x9')]('/:id/teams',auth[_0xed44('0x7')](),controller[_0xed44('0x10')]);router[_0xed44('0x9')](_0xed44('0x11'),auth['isAuthenticated'](),controller[_0xed44('0x12')]);router[_0xed44('0x13')]('/',auth[_0xed44('0x7')](),controller[_0xed44('0x14')]);router[_0xed44('0x13')](_0xed44('0x15'),auth[_0xed44('0x7')](),controller[_0xed44('0x16')]);router[_0xed44('0x13')](_0xed44('0x11'),auth['isAuthenticated'](),controller[_0xed44('0x17')]);router['put'](_0xed44('0xc'),auth[_0xed44('0x7')](),controller[_0xed44('0x18')]);router[_0xed44('0x19')](_0xed44('0xc'),auth[_0xed44('0x7')](),controller[_0xed44('0x1a')]);router[_0xed44('0x19')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xed44('0x19')](_0xed44('0x11'),auth['isAuthenticated'](),controller[_0xed44('0x1b')]);module[_0xed44('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 8eeed00..f1fe90d 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 _0xca78=['STRING','DATE','moment'];(function(_0x124ba8,_0x4decbc){var _0x7789d3=function(_0xb85ee6){while(--_0xb85ee6){_0x124ba8['push'](_0x124ba8['shift']());}};_0x7789d3(++_0x4decbc);}(_0xca78,0xe0));var _0x8ca7=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xca78[_0x556927];return _0x5f1235;};'use strict';var moment=require(_0x8ca7('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x8ca7('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x8ca7('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8ca7('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8ca7('0x2')]},'reason':{'type':Sequelize[_0x8ca7('0x1')]}}; \ No newline at end of file +var _0x75a9=['DATE','moment','exports','STRING'];(function(_0x4583d0,_0x24551f){var _0x7b3c5a=function(_0x14946a){while(--_0x14946a){_0x4583d0['push'](_0x4583d0['shift']());}};_0x7b3c5a(++_0x24551f);}(_0x75a9,0x65));var _0x975a=function(_0x478bd0,_0x519f69){_0x478bd0=_0x478bd0-0x0;var _0x35607e=_0x75a9[_0x478bd0];return _0x35607e;};'use strict';var moment=require(_0x975a('0x0'));var Sequelize=require('sequelize');module[_0x975a('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x975a('0x2')]},'joinAt':{'type':Sequelize[_0x975a('0x3')]},'leaveAt':{'type':Sequelize[_0x975a('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x975a('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 4d1ae45..7a22242 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 _0x3709=['html-pdf','eml-format','zip-dir','fast-json-patch','mustache','path','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','update','then','destroy','error','name','send','index','ChatQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','map','type','key','options','findAll','rows','catch','params','includeAll','include','find','create','body','describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3709,0x82));var _0x9370=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x3709[_0x311c35];return _0x5cc50c;};'use strict';var pdf=require(_0x9370('0x0'));var emlformat=require(_0x9370('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9370('0x2'));var jsonpatch=require(_0x9370('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9370('0x4'));var util=require('util');var path=require(_0x9370('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9370('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9370('0x7'));var deskjs=require(_0x9370('0x8'));var toCsv=require('to-csv');var querystring=require(_0x9370('0x9'));var Papa=require(_0x9370('0xa'));var authService=require(_0x9370('0xb'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x9370('0xc'));var qs=require('../../components/parsers/qs');var logger=require(_0x9370('0xd'))(_0x9370('0xe'));var utils=require(_0x9370('0xf'));var config=require(_0x9370('0x10'));var db=require(_0x9370('0x11'))['db'];function respondWithStatusCode(_0x226b78,_0x441bc3){_0x441bc3=_0x441bc3||0xcc;return function(_0x453b11){if(_0x453b11){return _0x226b78[_0x9370('0x12')](_0x441bc3);}return _0x226b78['status'](_0x441bc3)[_0x9370('0x13')]();};}function respondWithResult(_0xf10f26,_0x4ff19e){_0x4ff19e=_0x4ff19e||0xc8;return function(_0x5b7456){if(_0x5b7456){return _0xf10f26[_0x9370('0x14')](_0x4ff19e)[_0x9370('0x15')](_0x5b7456);}};}function respondWithFilteredResult(_0x241ee5,_0x753895){return function(_0x58d1dc){if(_0x58d1dc){var _0x393a16=_0x58d1dc[_0x9370('0x16')],_0x40f865=_0x753895['offset'],_0x592072=_0x753895[_0x9370('0x17')]+_0x753895['limit'],_0x54e8cb;if(_0x592072>=_0x393a16){_0x592072=_0x393a16;_0x54e8cb=0xc8;}else{_0x54e8cb=0xce;}_0x241ee5['status'](_0x54e8cb);return _0x241ee5['set'](_0x9370('0x18'),_0x40f865+'-'+_0x592072+'/'+_0x393a16)[_0x9370('0x15')](_0x58d1dc);}return null;};}function patchUpdates(_0x3077d9){return function(_0x2cd397){try{jsonpatch[_0x9370('0x19')](_0x2cd397,_0x3077d9,!![]);}catch(_0x138f0c){return BPromise[_0x9370('0x1a')](_0x138f0c);}return _0x2cd397['save']();};}function saveUpdates(_0x25deab,_0x1f5596){return function(_0x652c7a){if(_0x652c7a){return _0x652c7a[_0x9370('0x1b')](_0x25deab)[_0x9370('0x1c')](function(_0x121204){return _0x121204;});}return null;};}function removeEntity(_0x4f836b,_0x565795){return function(_0x146e86){if(_0x146e86){return _0x146e86[_0x9370('0x1d')]()[_0x9370('0x1c')](function(){_0x4f836b['status'](0xcc)[_0x9370('0x13')]();});}};}function handleEntityNotFound(_0x22a876,_0x4d39c2){return function(_0x34355e){if(!_0x34355e){_0x22a876[_0x9370('0x12')](0x194);}return _0x34355e;};}function handleError(_0x421f89,_0x402c2c){_0x402c2c=_0x402c2c||0x1f4;return function(_0x4fb8c3){logger[_0x9370('0x1e')](_0x4fb8c3['stack']);if(_0x4fb8c3[_0x9370('0x1f')]){delete _0x4fb8c3[_0x9370('0x1f')];}_0x421f89['status'](_0x402c2c)[_0x9370('0x20')](_0x4fb8c3);};}exports[_0x9370('0x21')]=function(_0x29237b,_0xccfd80){var _0x35c589={},_0x289064={},_0x4beef4={'count':0x0,'rows':[]};var _0x233472=db[_0x9370('0x22')][_0x9370('0x23')];_0x289064[_0x9370('0x24')]=_[_0x9370('0x25')](_0x233472);_0x289064[_0x9370('0x26')]=_[_0x9370('0x25')](_0x29237b['query']);_0x289064[_0x9370('0x27')]=_[_0x9370('0x28')](_0x289064[_0x9370('0x24')],_0x289064[_0x9370('0x26')]);_0x35c589[_0x9370('0x29')]=_[_0x9370('0x28')](_0x289064[_0x9370('0x24')],qs['fields'](_0x29237b[_0x9370('0x26')][_0x9370('0x2a')]));_0x35c589[_0x9370('0x29')]=_0x35c589[_0x9370('0x29')][_0x9370('0x2b')]?_0x35c589['attributes']:_0x289064[_0x9370('0x24')];if(!_0x29237b[_0x9370('0x26')][_0x9370('0x2c')]('nolimit')){_0x35c589['limit']=qs[_0x9370('0x2d')](_0x29237b[_0x9370('0x26')][_0x9370('0x2d')]);_0x35c589[_0x9370('0x17')]=qs[_0x9370('0x17')](_0x29237b[_0x9370('0x26')][_0x9370('0x17')]);}_0x35c589[_0x9370('0x2e')]=qs[_0x9370('0x2f')](_0x29237b[_0x9370('0x26')]['sort']);_0x35c589[_0x9370('0x30')]=qs[_0x9370('0x27')](_['pick'](_0x29237b[_0x9370('0x26')],_0x289064['filters']));if(_0x29237b[_0x9370('0x26')][_0x9370('0x31')]){_0x35c589[_0x9370('0x30')]=_[_0x9370('0x32')](_0x35c589['where'],{'$or':_[_0x9370('0x33')](_0x233472,function(_0x17cc63){if(_0x17cc63[_0x9370('0x34')][_0x9370('0x35')]!=='VIRTUAL'){var _0x361e8a={};_0x361e8a[_0x17cc63['field']]={'$like':'%'+_0x29237b[_0x9370('0x26')][_0x9370('0x31')]+'%'};return _0x361e8a;}})});}_0x35c589=_[_0x9370('0x32')]({},_0x35c589,_0x29237b[_0x9370('0x36')]);var _0x4d49ae={'where':_0x35c589[_0x9370('0x30')]};return db[_0x9370('0x22')][_0x9370('0x16')](_0x4d49ae)['then'](function(_0x394c4e){_0x4beef4[_0x9370('0x16')]=_0x394c4e;if(_0x29237b[_0x9370('0x26')]['includeAll']){_0x35c589['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x9370('0x37')](_0x35c589);})['then'](function(_0x3d9a19){_0x4beef4[_0x9370('0x38')]=_0x3d9a19;return _0x4beef4;})[_0x9370('0x1c')](respondWithFilteredResult(_0xccfd80,_0x35c589))[_0x9370('0x39')](handleError(_0xccfd80,null));};exports['show']=function(_0x420e49,_0x4c6b19){var _0x1e920c={'raw':!![],'where':{'id':_0x420e49[_0x9370('0x3a')]['id']}},_0x588ff4={};_0x588ff4[_0x9370('0x24')]=_[_0x9370('0x25')](db[_0x9370('0x22')][_0x9370('0x23')]);_0x588ff4[_0x9370('0x26')]=_['keys'](_0x420e49['query']);_0x588ff4[_0x9370('0x27')]=_[_0x9370('0x28')](_0x588ff4[_0x9370('0x24')],_0x588ff4[_0x9370('0x26')]);_0x1e920c[_0x9370('0x29')]=_[_0x9370('0x28')](_0x588ff4['model'],qs['fields'](_0x420e49[_0x9370('0x26')][_0x9370('0x2a')]));_0x1e920c[_0x9370('0x29')]=_0x1e920c[_0x9370('0x29')]['length']?_0x1e920c[_0x9370('0x29')]:_0x588ff4[_0x9370('0x24')];if(_0x420e49[_0x9370('0x26')][_0x9370('0x3b')]){_0x1e920c[_0x9370('0x3c')]=[{'all':!![]}];}_0x1e920c=_[_0x9370('0x32')]({},_0x1e920c,_0x420e49[_0x9370('0x36')]);return db[_0x9370('0x22')][_0x9370('0x3d')](_0x1e920c)['then'](handleEntityNotFound(_0x4c6b19,null))[_0x9370('0x1c')](respondWithResult(_0x4c6b19,null))[_0x9370('0x39')](handleError(_0x4c6b19,null));};exports[_0x9370('0x3e')]=function(_0x52bfab,_0x411242){return db['ChatQueueReport'][_0x9370('0x3e')](_0x52bfab[_0x9370('0x3f')],{})[_0x9370('0x1c')](respondWithResult(_0x411242,0xc9))[_0x9370('0x39')](handleError(_0x411242,null));};exports[_0x9370('0x1b')]=function(_0x2c854f,_0x56630b){if(_0x2c854f[_0x9370('0x3f')]['id']){delete _0x2c854f['body']['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x2c854f[_0x9370('0x3a')]['id']}})[_0x9370('0x1c')](handleEntityNotFound(_0x56630b,null))['then'](saveUpdates(_0x2c854f['body'],null))[_0x9370('0x1c')](respondWithResult(_0x56630b,null))[_0x9370('0x39')](handleError(_0x56630b,null));};exports['destroy']=function(_0x47a95c,_0x4ded66){return db['ChatQueueReport'][_0x9370('0x3d')]({'where':{'id':_0x47a95c[_0x9370('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4ded66,null))[_0x9370('0x1c')](removeEntity(_0x4ded66,null))[_0x9370('0x39')](handleError(_0x4ded66,null));};exports[_0x9370('0x40')]=function(_0x1ac62a,_0x40bf97){return db[_0x9370('0x22')]['describe']()[_0x9370('0x1c')](respondWithResult(_0x40bf97,null))[_0x9370('0x39')](handleError(_0x40bf97,null));}; \ No newline at end of file +var _0x2e3f=['save','update','then','error','stack','name','send','index','ChatQueueReport','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','type','field','include','catch','show','params','intersection','options','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0x2e3f,0xbb));var _0xf2e3=function(_0x550e3c,_0x1ffe38){_0x550e3c=_0x550e3c-0x0;var _0xaeb1c4=_0x2e3f[_0x550e3c];return _0xaeb1c4;};'use strict';var pdf=require(_0xf2e3('0x0'));var emlformat=require(_0xf2e3('0x1'));var rimraf=require(_0xf2e3('0x2'));var zipdir=require(_0xf2e3('0x3'));var jsonpatch=require(_0xf2e3('0x4'));var rp=require(_0xf2e3('0x5'));var moment=require(_0xf2e3('0x6'));var BPromise=require(_0xf2e3('0x7'));var Mustache=require(_0xf2e3('0x8'));var util=require('util');var path=require(_0xf2e3('0x9'));var sox=require(_0xf2e3('0xa'));var csv=require('to-csv');var ejs=require(_0xf2e3('0xb'));var fs=require('fs');var _=require(_0xf2e3('0xc'));var squel=require(_0xf2e3('0xd'));var crypto=require(_0xf2e3('0xe'));var jsforce=require(_0xf2e3('0xf'));var deskjs=require(_0xf2e3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf2e3('0x11'));var Papa=require(_0xf2e3('0x12'));var authService=require(_0xf2e3('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xf2e3('0x14'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf2e3('0x15'));var utils=require(_0xf2e3('0x16'));var config=require('../../config/environment');var db=require(_0xf2e3('0x17'))['db'];function respondWithStatusCode(_0x3e4b06,_0x4408b7){_0x4408b7=_0x4408b7||0xcc;return function(_0x57cb50){if(_0x57cb50){return _0x3e4b06[_0xf2e3('0x18')](_0x4408b7);}return _0x3e4b06[_0xf2e3('0x19')](_0x4408b7)[_0xf2e3('0x1a')]();};}function respondWithResult(_0x49a248,_0x25f93b){_0x25f93b=_0x25f93b||0xc8;return function(_0x4a2467){if(_0x4a2467){return _0x49a248[_0xf2e3('0x19')](_0x25f93b)[_0xf2e3('0x1b')](_0x4a2467);}};}function respondWithFilteredResult(_0xbf4df5,_0x40879a){return function(_0x217521){if(_0x217521){var _0x17642f=_0x217521[_0xf2e3('0x1c')],_0x34f10d=_0x40879a[_0xf2e3('0x1d')],_0x3028de=_0x40879a[_0xf2e3('0x1d')]+_0x40879a[_0xf2e3('0x1e')],_0x39b15f;if(_0x3028de>=_0x17642f){_0x3028de=_0x17642f;_0x39b15f=0xc8;}else{_0x39b15f=0xce;}_0xbf4df5['status'](_0x39b15f);return _0xbf4df5[_0xf2e3('0x1f')](_0xf2e3('0x20'),_0x34f10d+'-'+_0x3028de+'/'+_0x17642f)[_0xf2e3('0x1b')](_0x217521);}return null;};}function patchUpdates(_0x3a6398){return function(_0x2c80d4){try{jsonpatch[_0xf2e3('0x21')](_0x2c80d4,_0x3a6398,!![]);}catch(_0x11abfe){return BPromise[_0xf2e3('0x22')](_0x11abfe);}return _0x2c80d4[_0xf2e3('0x23')]();};}function saveUpdates(_0x10f902,_0x39bfa5){return function(_0x2148d3){if(_0x2148d3){return _0x2148d3[_0xf2e3('0x24')](_0x10f902)[_0xf2e3('0x25')](function(_0x296e0d){return _0x296e0d;});}return null;};}function removeEntity(_0x2f641f,_0x100559){return function(_0x801897){if(_0x801897){return _0x801897['destroy']()[_0xf2e3('0x25')](function(){_0x2f641f['status'](0xcc)[_0xf2e3('0x1a')]();});}};}function handleEntityNotFound(_0x25330a,_0xaf42d7){return function(_0x398768){if(!_0x398768){_0x25330a[_0xf2e3('0x18')](0x194);}return _0x398768;};}function handleError(_0x25dc8c,_0x5963e8){_0x5963e8=_0x5963e8||0x1f4;return function(_0x23fd3c){logger[_0xf2e3('0x26')](_0x23fd3c[_0xf2e3('0x27')]);if(_0x23fd3c['name']){delete _0x23fd3c[_0xf2e3('0x28')];}_0x25dc8c[_0xf2e3('0x19')](_0x5963e8)[_0xf2e3('0x29')](_0x23fd3c);};}exports[_0xf2e3('0x2a')]=function(_0x16c312,_0x4ea1b8){var _0xc6e72b={},_0x3535eb={},_0x5d7138={'count':0x0,'rows':[]};var _0x97ab04=db[_0xf2e3('0x2b')][_0xf2e3('0x2c')];_0x3535eb[_0xf2e3('0x2d')]=_[_0xf2e3('0x2e')](_0x97ab04);_0x3535eb[_0xf2e3('0x2f')]=_[_0xf2e3('0x2e')](_0x16c312[_0xf2e3('0x2f')]);_0x3535eb[_0xf2e3('0x30')]=_['intersection'](_0x3535eb['model'],_0x3535eb[_0xf2e3('0x2f')]);_0xc6e72b[_0xf2e3('0x31')]=_['intersection'](_0x3535eb['model'],qs[_0xf2e3('0x32')](_0x16c312[_0xf2e3('0x2f')][_0xf2e3('0x32')]));_0xc6e72b[_0xf2e3('0x31')]=_0xc6e72b[_0xf2e3('0x31')][_0xf2e3('0x33')]?_0xc6e72b['attributes']:_0x3535eb[_0xf2e3('0x2d')];if(!_0x16c312[_0xf2e3('0x2f')][_0xf2e3('0x34')](_0xf2e3('0x35'))){_0xc6e72b[_0xf2e3('0x1e')]=qs[_0xf2e3('0x1e')](_0x16c312['query'][_0xf2e3('0x1e')]);_0xc6e72b['offset']=qs[_0xf2e3('0x1d')](_0x16c312[_0xf2e3('0x2f')][_0xf2e3('0x1d')]);}_0xc6e72b[_0xf2e3('0x36')]=qs[_0xf2e3('0x37')](_0x16c312[_0xf2e3('0x2f')]['sort']);_0xc6e72b['where']=qs[_0xf2e3('0x30')](_[_0xf2e3('0x38')](_0x16c312['query'],_0x3535eb[_0xf2e3('0x30')]));if(_0x16c312[_0xf2e3('0x2f')][_0xf2e3('0x39')]){_0xc6e72b['where']=_[_0xf2e3('0x3a')](_0xc6e72b[_0xf2e3('0x3b')],{'$or':_[_0xf2e3('0x3c')](_0x97ab04,function(_0x3ad003){if(_0x3ad003[_0xf2e3('0x3d')]['key']!=='VIRTUAL'){var _0x382d3a={};_0x382d3a[_0x3ad003[_0xf2e3('0x3e')]]={'$like':'%'+_0x16c312[_0xf2e3('0x2f')][_0xf2e3('0x39')]+'%'};return _0x382d3a;}})});}_0xc6e72b=_['merge']({},_0xc6e72b,_0x16c312['options']);var _0x16ac4d={'where':_0xc6e72b[_0xf2e3('0x3b')]};return db[_0xf2e3('0x2b')]['count'](_0x16ac4d)[_0xf2e3('0x25')](function(_0x3cece2){_0x5d7138['count']=_0x3cece2;if(_0x16c312[_0xf2e3('0x2f')]['includeAll']){_0xc6e72b[_0xf2e3('0x3f')]=[{'all':!![]}];}return db[_0xf2e3('0x2b')]['findAll'](_0xc6e72b);})['then'](function(_0xc7ef2){_0x5d7138['rows']=_0xc7ef2;return _0x5d7138;})[_0xf2e3('0x25')](respondWithFilteredResult(_0x4ea1b8,_0xc6e72b))[_0xf2e3('0x40')](handleError(_0x4ea1b8,null));};exports[_0xf2e3('0x41')]=function(_0x12c765,_0x40f076){var _0x206123={'raw':!![],'where':{'id':_0x12c765[_0xf2e3('0x42')]['id']}},_0xb323b7={};_0xb323b7[_0xf2e3('0x2d')]=_['keys'](db[_0xf2e3('0x2b')][_0xf2e3('0x2c')]);_0xb323b7['query']=_[_0xf2e3('0x2e')](_0x12c765[_0xf2e3('0x2f')]);_0xb323b7['filters']=_[_0xf2e3('0x43')](_0xb323b7[_0xf2e3('0x2d')],_0xb323b7[_0xf2e3('0x2f')]);_0x206123[_0xf2e3('0x31')]=_['intersection'](_0xb323b7[_0xf2e3('0x2d')],qs[_0xf2e3('0x32')](_0x12c765['query']['fields']));_0x206123[_0xf2e3('0x31')]=_0x206123[_0xf2e3('0x31')]['length']?_0x206123[_0xf2e3('0x31')]:_0xb323b7['model'];if(_0x12c765[_0xf2e3('0x2f')]['includeAll']){_0x206123['include']=[{'all':!![]}];}_0x206123=_[_0xf2e3('0x3a')]({},_0x206123,_0x12c765[_0xf2e3('0x44')]);return db[_0xf2e3('0x2b')]['find'](_0x206123)[_0xf2e3('0x25')](handleEntityNotFound(_0x40f076,null))[_0xf2e3('0x25')](respondWithResult(_0x40f076,null))['catch'](handleError(_0x40f076,null));};exports[_0xf2e3('0x45')]=function(_0x4d21d1,_0x3a77da){return db['ChatQueueReport'][_0xf2e3('0x45')](_0x4d21d1[_0xf2e3('0x46')],{})[_0xf2e3('0x25')](respondWithResult(_0x3a77da,0xc9))[_0xf2e3('0x40')](handleError(_0x3a77da,null));};exports['update']=function(_0x330a45,_0x448408){if(_0x330a45[_0xf2e3('0x46')]['id']){delete _0x330a45['body']['id'];}return db[_0xf2e3('0x2b')][_0xf2e3('0x47')]({'where':{'id':_0x330a45[_0xf2e3('0x42')]['id']}})['then'](handleEntityNotFound(_0x448408,null))[_0xf2e3('0x25')](saveUpdates(_0x330a45[_0xf2e3('0x46')],null))[_0xf2e3('0x25')](respondWithResult(_0x448408,null))[_0xf2e3('0x40')](handleError(_0x448408,null));};exports[_0xf2e3('0x48')]=function(_0x81786f,_0x1a5260){return db[_0xf2e3('0x2b')][_0xf2e3('0x47')]({'where':{'id':_0x81786f[_0xf2e3('0x42')]['id']}})[_0xf2e3('0x25')](handleEntityNotFound(_0x1a5260,null))[_0xf2e3('0x25')](removeEntity(_0x1a5260,null))['catch'](handleError(_0x1a5260,null));};exports[_0xf2e3('0x49')]=function(_0x18b981,_0x550c93){return db['ChatQueueReport'][_0xf2e3('0x49')]()[_0xf2e3('0x25')](respondWithResult(_0x550c93,null))['catch'](handleError(_0x550c93,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 913d948..7fbce7a 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 _0xe14b=['ChatQueueReport','report_chat_queue','uniqueid','lodash','util','moment','bluebird','./chatQueueReport.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe14b,0x93));var _0xbe14=function(_0x15d75a,_0x28ed2d){_0x15d75a=_0x15d75a-0x0;var _0x1a5734=_0xe14b[_0x15d75a];return _0x1a5734;};'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 attributes=require(_0xbe14('0x4'));module['exports']=function(_0x496c04,_0x1833e3){return _0x496c04[_0xbe14('0x5')](_0xbe14('0x6'),attributes,{'tableName':_0xbe14('0x7'),'paranoid':![],'indexes':[{'name':_0xbe14('0x8'),'fields':[_0xbe14('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['define','ChatQueueReport','report_chat_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x249dfe,_0x21f85c){var _0xc7c7be=function(_0x3d0837){while(--_0x3d0837){_0x249dfe['push'](_0x249dfe['shift']());}};_0xc7c7be(++_0x21f85c);}(_0x7217,0x19e));var _0x7721=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x7217[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x472a96,_0xce17f9){return _0x472a96[_0x7721('0x6')](_0x7721('0x7'),attributes,{'tableName':_0x7721('0x8'),'paranoid':![],'indexes':[{'name':_0x7721('0x9'),'fields':[_0x7721('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index ffd765b..109450e 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 _0xfa60=['request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','where','attributes','UpdateChatQueueReport','lodash','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','http'];(function(_0x543088,_0x9ea697){var _0x44a917=function(_0x32aab7){while(--_0x32aab7){_0x543088['push'](_0x543088['shift']());}};_0x44a917(++_0x9ea697);}(_0xfa60,0x173));var _0x0fa6=function(_0x15312f,_0x50df6e){_0x15312f=_0x15312f-0x0;var _0x1a7f54=_0xfa60[_0x15312f];return _0x1a7f54;};'use strict';var _=require(_0x0fa6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0fa6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fa6('0x2'));var db=require(_0x0fa6('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0fa6('0x4'));var config=require('../../config/environment');var jayson=require(_0x0fa6('0x5'));var client=jayson['client'][_0x0fa6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2166b3,_0x109f83,_0x3544da){return new BPromise(function(_0x203c91,_0x51fcc6){return client[_0x0fa6('0x7')](_0x2166b3,_0x3544da)[_0x0fa6('0x8')](function(_0x53cf04){logger[_0x0fa6('0x9')](_0x0fa6('0xa'),_0x109f83,_0x0fa6('0xb'));logger[_0x0fa6('0xc')](_0x0fa6('0xd'),_0x109f83,_0x0fa6('0xb'),JSON[_0x0fa6('0xe')](_0x53cf04));if(_0x53cf04[_0x0fa6('0xf')]){if(_0x53cf04[_0x0fa6('0xf')]['code']===0x1f4){logger['error'](_0x0fa6('0xa'),_0x109f83,_0x53cf04[_0x0fa6('0xf')][_0x0fa6('0x10')]);return _0x51fcc6(_0x53cf04['error'][_0x0fa6('0x10')]);}logger[_0x0fa6('0xf')](_0x0fa6('0xa'),_0x109f83,_0x53cf04[_0x0fa6('0xf')][_0x0fa6('0x10')]);return _0x203c91(_0x53cf04[_0x0fa6('0xf')][_0x0fa6('0x10')]);}else{logger[_0x0fa6('0x9')](_0x0fa6('0xa'),_0x109f83,'request\x20sent');_0x203c91(_0x53cf04['result'][_0x0fa6('0x10')]);}})['catch'](function(_0x54cb8c){logger[_0x0fa6('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x109f83,_0x54cb8c);_0x51fcc6(_0x54cb8c);});});}exports[_0x0fa6('0x11')]=function(_0x2278d5){var _0x2e6007=this;return new Promise(function(_0x5e7ee8,_0x3ef102){return db[_0x0fa6('0x12')][_0x0fa6('0x13')](_0x2278d5[_0x0fa6('0x14')],{'raw':_0x2278d5[_0x0fa6('0x15')]?_0x2278d5[_0x0fa6('0x15')][_0x0fa6('0x16')]===undefined?!![]:![]:!![]})[_0x0fa6('0x8')](function(_0x50672a){logger[_0x0fa6('0x9')](_0x0fa6('0x11'),_0x2278d5);logger['debug'](_0x0fa6('0x11'),_0x2278d5,JSON[_0x0fa6('0xe')](_0x50672a));_0x5e7ee8(_0x50672a);})['catch'](function(_0x494082){logger[_0x0fa6('0xf')](_0x0fa6('0x11'),_0x494082[_0x0fa6('0x10')],_0x2278d5);_0x3ef102(_0x2e6007[_0x0fa6('0xf')](0x1f4,_0x494082[_0x0fa6('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x2bcb89){var _0x3991ce=this;return new Promise(function(_0x52db47,_0x1b30b5){return db[_0x0fa6('0x12')][_0x0fa6('0x17')](_0x2bcb89[_0x0fa6('0x14')],{'raw':_0x2bcb89[_0x0fa6('0x15')]?_0x2bcb89[_0x0fa6('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bcb89[_0x0fa6('0x15')]?_0x2bcb89[_0x0fa6('0x15')][_0x0fa6('0x18')]||null:null,'attributes':_0x2bcb89['options']?_0x2bcb89[_0x0fa6('0x15')][_0x0fa6('0x19')]||null:null,'limit':_0x2bcb89[_0x0fa6('0x15')]?_0x2bcb89[_0x0fa6('0x15')]['limit']||null:null})[_0x0fa6('0x8')](function(_0x39fb6b){logger[_0x0fa6('0x9')]('UpdateChatQueueReport',_0x2bcb89);logger[_0x0fa6('0xc')](_0x0fa6('0x1a'),_0x2bcb89,JSON[_0x0fa6('0xe')](_0x39fb6b));_0x52db47(_0x39fb6b);})['catch'](function(_0x4ae173){logger[_0x0fa6('0xf')]('UpdateChatQueueReport',_0x4ae173[_0x0fa6('0x10')],_0x2bcb89);_0x1b30b5(_0x3991ce[_0x0fa6('0xf')](0x1f4,_0x4ae173[_0x0fa6('0x10')]));});});}; \ No newline at end of file +var _0x164a=['rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2c73ed,_0x37991c){var _0x317369=function(_0x14489a){while(--_0x14489a){_0x2c73ed['push'](_0x2c73ed['shift']());}};_0x317369(++_0x37991c);}(_0x164a,0x190));var _0xa164=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0x164a[_0x11e03f];return _0x5666fe;};'use strict';var _=require(_0xa164('0x0'));var util=require(_0xa164('0x1'));var moment=require(_0xa164('0x2'));var BPromise=require(_0xa164('0x3'));var rs=require(_0xa164('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa164('0x5'))['db'];var utils=require(_0xa164('0x6'));var logger=require(_0xa164('0x7'))(_0xa164('0x8'));var config=require(_0xa164('0x9'));var jayson=require(_0xa164('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e8805,_0x48d04c,_0x5b7dfb){return new BPromise(function(_0x27a43f,_0xa7fda9){return client[_0xa164('0xb')](_0x5e8805,_0x5b7dfb)['then'](function(_0x3bb361){logger[_0xa164('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x48d04c,_0xa164('0xd'));logger[_0xa164('0xe')](_0xa164('0xf'),_0x48d04c,_0xa164('0xd'),JSON[_0xa164('0x10')](_0x3bb361));if(_0x3bb361[_0xa164('0x11')]){if(_0x3bb361[_0xa164('0x11')]['code']===0x1f4){logger[_0xa164('0x11')](_0xa164('0x12'),_0x48d04c,_0x3bb361['error'][_0xa164('0x13')]);return _0xa7fda9(_0x3bb361[_0xa164('0x11')][_0xa164('0x13')]);}logger[_0xa164('0x11')](_0xa164('0x12'),_0x48d04c,_0x3bb361[_0xa164('0x11')]['message']);return _0x27a43f(_0x3bb361[_0xa164('0x11')][_0xa164('0x13')]);}else{logger[_0xa164('0xc')](_0xa164('0x12'),_0x48d04c,_0xa164('0xd'));_0x27a43f(_0x3bb361[_0xa164('0x14')][_0xa164('0x13')]);}})[_0xa164('0x15')](function(_0x1fce08){logger['error'](_0xa164('0x12'),_0x48d04c,_0x1fce08);_0xa7fda9(_0x1fce08);});});}exports[_0xa164('0x16')]=function(_0x3bd62a){var _0x50f7b5=this;return new Promise(function(_0x14ff06,_0x458265){return db[_0xa164('0x17')][_0xa164('0x18')](_0x3bd62a[_0xa164('0x19')],{'raw':_0x3bd62a[_0xa164('0x1a')]?_0x3bd62a[_0xa164('0x1a')][_0xa164('0x1b')]===undefined?!![]:![]:!![]})[_0xa164('0x1c')](function(_0x192850){logger[_0xa164('0xc')](_0xa164('0x16'),_0x3bd62a);logger[_0xa164('0xe')]('CreateChatQueueReport',_0x3bd62a,JSON[_0xa164('0x10')](_0x192850));_0x14ff06(_0x192850);})[_0xa164('0x15')](function(_0x5154d4){logger[_0xa164('0x11')](_0xa164('0x16'),_0x5154d4[_0xa164('0x13')],_0x3bd62a);_0x458265(_0x50f7b5[_0xa164('0x11')](0x1f4,_0x5154d4[_0xa164('0x13')]));});});};exports[_0xa164('0x1d')]=function(_0x2635eb){var _0xa42a91=this;return new Promise(function(_0x20e8da,_0x38353c){return db[_0xa164('0x17')][_0xa164('0x1e')](_0x2635eb[_0xa164('0x19')],{'raw':_0x2635eb[_0xa164('0x1a')]?_0x2635eb[_0xa164('0x1a')][_0xa164('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2635eb['options']?_0x2635eb['options'][_0xa164('0x1f')]||null:null,'attributes':_0x2635eb['options']?_0x2635eb[_0xa164('0x1a')][_0xa164('0x20')]||null:null,'limit':_0x2635eb[_0xa164('0x1a')]?_0x2635eb[_0xa164('0x1a')][_0xa164('0x21')]||null:null})[_0xa164('0x1c')](function(_0x101f73){logger['info']('UpdateChatQueueReport',_0x2635eb);logger[_0xa164('0xe')]('UpdateChatQueueReport',_0x2635eb,JSON[_0xa164('0x10')](_0x101f73));_0x20e8da(_0x101f73);})[_0xa164('0x15')](function(_0x1b8b30){logger['error'](_0xa164('0x1d'),_0x1b8b30[_0xa164('0x13')],_0x2635eb);_0x38353c(_0xa42a91[_0xa164('0x11')](0x1f4,_0x1b8b30[_0xa164('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 421d293..69ad0db 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 _0xd5d3=['/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index'];(function(_0x19bf39,_0x2ef1c9){var _0x2d6200=function(_0x17406e){while(--_0x17406e){_0x19bf39['push'](_0x19bf39['shift']());}};_0x2d6200(++_0x2ef1c9);}(_0xd5d3,0x196));var _0x3d5d=function(_0x4fcc36,_0x467acd){_0x4fcc36=_0x4fcc36-0x0;var _0x23afbe=_0xd5d3[_0x4fcc36];return _0x23afbe;};'use strict';var multer=require(_0x3d5d('0x0'));var util=require('util');var path=require(_0x3d5d('0x1'));var timeout=require(_0x3d5d('0x2'));var express=require(_0x3d5d('0x3'));var router=express[_0x3d5d('0x4')]();var auth=require(_0x3d5d('0x5'));var interaction=require(_0x3d5d('0x6'));var config=require(_0x3d5d('0x7'));var controller=require(_0x3d5d('0x8'));router[_0x3d5d('0x9')]('/',auth[_0x3d5d('0xa')](),controller[_0x3d5d('0xb')]);router[_0x3d5d('0x9')](_0x3d5d('0xc'),auth[_0x3d5d('0xa')](),controller['describe']);router[_0x3d5d('0x9')](_0x3d5d('0xd'),auth['isAuthenticated'](),controller[_0x3d5d('0xe')]);router[_0x3d5d('0xf')]('/',auth[_0x3d5d('0xa')](),controller[_0x3d5d('0x10')]);router[_0x3d5d('0x11')](_0x3d5d('0xd'),auth[_0x3d5d('0xa')](),controller[_0x3d5d('0x12')]);router[_0x3d5d('0x13')](_0x3d5d('0xd'),auth[_0x3d5d('0xa')](),controller[_0x3d5d('0x14')]);module[_0x3d5d('0x15')]=router; \ No newline at end of file +var _0xbb74=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id','put','update','delete','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0xbb74,0x181));var _0x4bb7=function(_0xd3a512,_0x5ef934){_0xd3a512=_0xd3a512-0x0;var _0x4b449d=_0xbb74[_0xd3a512];return _0x4b449d;};'use strict';var multer=require(_0x4bb7('0x0'));var util=require('util');var path=require(_0x4bb7('0x1'));var timeout=require('connect-timeout');var express=require(_0x4bb7('0x2'));var router=express[_0x4bb7('0x3')]();var auth=require(_0x4bb7('0x4'));var interaction=require(_0x4bb7('0x5'));var config=require(_0x4bb7('0x6'));var controller=require('./chatQueueReport.controller');router[_0x4bb7('0x7')]('/',auth['isAuthenticated'](),controller[_0x4bb7('0x8')]);router[_0x4bb7('0x7')]('/describe',auth[_0x4bb7('0x9')](),controller['describe']);router['get'](_0x4bb7('0xa'),auth[_0x4bb7('0x9')](),controller['show']);router['post']('/',auth[_0x4bb7('0x9')](),controller['create']);router[_0x4bb7('0xb')](_0x4bb7('0xa'),auth['isAuthenticated'](),controller[_0x4bb7('0xc')]);router[_0x4bb7('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4bb7('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 45196e5..4384ff9 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 _0xe90c=['ENUM','account','agent','queue','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe90c,0x8f));var _0xce90=function(_0x45d7dc,_0xc3c48f){_0x45d7dc=_0x45d7dc-0x0;var _0x54fbec=_0xe90c[_0x45d7dc];return _0x54fbec;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xce90('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xce90('0x1')](_0xce90('0x2'),_0xce90('0x3'),_0xce90('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xce90('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xe546=['account','queue','NOW','sequelize','exports','STRING'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0xe546,0x93));var _0x6e54=function(_0x14ea1a,_0x160460){_0x14ea1a=_0x14ea1a-0x0;var _0x462f4a=_0xe546[_0x14ea1a];return _0x462f4a;};'use strict';var moment=require('moment');var Sequelize=require(_0x6e54('0x0'));module[_0x6e54('0x1')]={'uniqueid':{'type':Sequelize[_0x6e54('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6e54('0x3'),'agent',_0x6e54('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x6e54('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index bd8c0ae..3cfa633 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 _0x75ea=['util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','then','destroy','error','stack','name','ChatTransferReport','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x75ea,0x7d));var _0xa75e=function(_0x49464b,_0x1e65df){_0x49464b=_0x49464b-0x0;var _0x3ddb6e=_0x75ea[_0x49464b];return _0x3ddb6e;};'use strict';var pdf=require(_0xa75e('0x0'));var emlformat=require(_0xa75e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa75e('0x2'));var jsonpatch=require(_0xa75e('0x3'));var rp=require('request-promise');var moment=require(_0xa75e('0x4'));var BPromise=require(_0xa75e('0x5'));var Mustache=require(_0xa75e('0x6'));var util=require(_0xa75e('0x7'));var path=require(_0xa75e('0x8'));var sox=require('sox');var csv=require(_0xa75e('0x9'));var ejs=require(_0xa75e('0xa'));var fs=require('fs');var _=require(_0xa75e('0xb'));var squel=require(_0xa75e('0xc'));var crypto=require(_0xa75e('0xd'));var jsforce=require(_0xa75e('0xe'));var deskjs=require(_0xa75e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xa75e('0x10'));var Redis=require('ioredis');var qs=require(_0xa75e('0x11'));var logger=require('../../config/logger')(_0xa75e('0x12'));var utils=require(_0xa75e('0x13'));var config=require('../../config/environment');var db=require(_0xa75e('0x14'))['db'];function respondWithStatusCode(_0x259e8c,_0x38dce8){_0x38dce8=_0x38dce8||0xcc;return function(_0x35c81b){if(_0x35c81b){return _0x259e8c[_0xa75e('0x15')](_0x38dce8);}return _0x259e8c[_0xa75e('0x16')](_0x38dce8)[_0xa75e('0x17')]();};}function respondWithResult(_0x242ade,_0x3f6719){_0x3f6719=_0x3f6719||0xc8;return function(_0x5319e2){if(_0x5319e2){return _0x242ade[_0xa75e('0x16')](_0x3f6719)['json'](_0x5319e2);}};}function respondWithFilteredResult(_0x30d9b1,_0x10a205){return function(_0x530c38){if(_0x530c38){var _0x235860=_0x530c38[_0xa75e('0x18')],_0x3179e2=_0x10a205[_0xa75e('0x19')],_0x1d78ce=_0x10a205[_0xa75e('0x19')]+_0x10a205[_0xa75e('0x1a')],_0x49cbf7;if(_0x1d78ce>=_0x235860){_0x1d78ce=_0x235860;_0x49cbf7=0xc8;}else{_0x49cbf7=0xce;}_0x30d9b1[_0xa75e('0x16')](_0x49cbf7);return _0x30d9b1[_0xa75e('0x1b')](_0xa75e('0x1c'),_0x3179e2+'-'+_0x1d78ce+'/'+_0x235860)[_0xa75e('0x1d')](_0x530c38);}return null;};}function patchUpdates(_0x5812ba){return function(_0x280491){try{jsonpatch[_0xa75e('0x1e')](_0x280491,_0x5812ba,!![]);}catch(_0x149647){return BPromise['reject'](_0x149647);}return _0x280491['save']();};}function saveUpdates(_0x42f1d6,_0x5c14c0){return function(_0x47b19c){if(_0x47b19c){return _0x47b19c['update'](_0x42f1d6)[_0xa75e('0x1f')](function(_0x51279b){return _0x51279b;});}return null;};}function removeEntity(_0x2e4f8c,_0x5da171){return function(_0x32766b){if(_0x32766b){return _0x32766b[_0xa75e('0x20')]()[_0xa75e('0x1f')](function(){_0x2e4f8c['status'](0xcc)[_0xa75e('0x17')]();});}};}function handleEntityNotFound(_0x411d82,_0x158caa){return function(_0x4e64aa){if(!_0x4e64aa){_0x411d82[_0xa75e('0x15')](0x194);}return _0x4e64aa;};}function handleError(_0x71e02f,_0x1faeab){_0x1faeab=_0x1faeab||0x1f4;return function(_0x9add90){logger[_0xa75e('0x21')](_0x9add90[_0xa75e('0x22')]);if(_0x9add90[_0xa75e('0x23')]){delete _0x9add90[_0xa75e('0x23')];}_0x71e02f[_0xa75e('0x16')](_0x1faeab)['send'](_0x9add90);};}exports['index']=function(_0x278e4a,_0x3273d6){var _0x58bfef={},_0x909d5b={},_0x316197={'count':0x0,'rows':[]};var _0xdb92a2=db[_0xa75e('0x24')][_0xa75e('0x25')];_0x909d5b[_0xa75e('0x26')]=_['keys'](_0xdb92a2);_0x909d5b[_0xa75e('0x27')]=_[_0xa75e('0x28')](_0x278e4a[_0xa75e('0x27')]);_0x909d5b[_0xa75e('0x29')]=_[_0xa75e('0x2a')](_0x909d5b['model'],_0x909d5b[_0xa75e('0x27')]);_0x58bfef['attributes']=_['intersection'](_0x909d5b[_0xa75e('0x26')],qs[_0xa75e('0x2b')](_0x278e4a[_0xa75e('0x27')][_0xa75e('0x2b')]));_0x58bfef[_0xa75e('0x2c')]=_0x58bfef[_0xa75e('0x2c')][_0xa75e('0x2d')]?_0x58bfef[_0xa75e('0x2c')]:_0x909d5b[_0xa75e('0x26')];if(!_0x278e4a[_0xa75e('0x27')][_0xa75e('0x2e')](_0xa75e('0x2f'))){_0x58bfef[_0xa75e('0x1a')]=qs['limit'](_0x278e4a[_0xa75e('0x27')][_0xa75e('0x1a')]);_0x58bfef[_0xa75e('0x19')]=qs[_0xa75e('0x19')](_0x278e4a[_0xa75e('0x27')][_0xa75e('0x19')]);}_0x58bfef['order']=qs['sort'](_0x278e4a['query'][_0xa75e('0x30')]);_0x58bfef['where']=qs['filters'](_[_0xa75e('0x31')](_0x278e4a['query'],_0x909d5b[_0xa75e('0x29')]));if(_0x278e4a[_0xa75e('0x27')][_0xa75e('0x32')]){_0x58bfef[_0xa75e('0x33')]=_['merge'](_0x58bfef[_0xa75e('0x33')],{'$or':_[_0xa75e('0x34')](_0xdb92a2,function(_0x1679d1){if(_0x1679d1['type']['key']!==_0xa75e('0x35')){var _0x30dfdf={};_0x30dfdf[_0x1679d1['field']]={'$like':'%'+_0x278e4a[_0xa75e('0x27')][_0xa75e('0x32')]+'%'};return _0x30dfdf;}})});}_0x58bfef=_['merge']({},_0x58bfef,_0x278e4a[_0xa75e('0x36')]);var _0x140464={'where':_0x58bfef['where']};return db[_0xa75e('0x24')][_0xa75e('0x18')](_0x140464)[_0xa75e('0x1f')](function(_0x4a39e6){_0x316197[_0xa75e('0x18')]=_0x4a39e6;if(_0x278e4a[_0xa75e('0x27')][_0xa75e('0x37')]){_0x58bfef[_0xa75e('0x38')]=[{'all':!![]}];}return db[_0xa75e('0x24')]['findAll'](_0x58bfef);})[_0xa75e('0x1f')](function(_0x4b7fd7){_0x316197[_0xa75e('0x39')]=_0x4b7fd7;return _0x316197;})[_0xa75e('0x1f')](respondWithFilteredResult(_0x3273d6,_0x58bfef))[_0xa75e('0x3a')](handleError(_0x3273d6,null));};exports[_0xa75e('0x3b')]=function(_0x11d219,_0x49f697){var _0x1400c1={'raw':!![],'where':{'id':_0x11d219[_0xa75e('0x3c')]['id']}},_0x38650a={};_0x38650a['model']=_[_0xa75e('0x28')](db[_0xa75e('0x24')]['rawAttributes']);_0x38650a[_0xa75e('0x27')]=_[_0xa75e('0x28')](_0x11d219['query']);_0x38650a[_0xa75e('0x29')]=_[_0xa75e('0x2a')](_0x38650a[_0xa75e('0x26')],_0x38650a[_0xa75e('0x27')]);_0x1400c1[_0xa75e('0x2c')]=_[_0xa75e('0x2a')](_0x38650a['model'],qs[_0xa75e('0x2b')](_0x11d219[_0xa75e('0x27')][_0xa75e('0x2b')]));_0x1400c1[_0xa75e('0x2c')]=_0x1400c1['attributes']['length']?_0x1400c1['attributes']:_0x38650a[_0xa75e('0x26')];if(_0x11d219[_0xa75e('0x27')][_0xa75e('0x37')]){_0x1400c1[_0xa75e('0x38')]=[{'all':!![]}];}_0x1400c1=_['merge']({},_0x1400c1,_0x11d219[_0xa75e('0x36')]);return db['ChatTransferReport'][_0xa75e('0x3d')](_0x1400c1)[_0xa75e('0x1f')](handleEntityNotFound(_0x49f697,null))[_0xa75e('0x1f')](respondWithResult(_0x49f697,null))['catch'](handleError(_0x49f697,null));};exports[_0xa75e('0x3e')]=function(_0x415dbd,_0x4cc4f1){return db[_0xa75e('0x24')][_0xa75e('0x3e')](_0x415dbd[_0xa75e('0x3f')],{})[_0xa75e('0x1f')](respondWithResult(_0x4cc4f1,0xc9))['catch'](handleError(_0x4cc4f1,null));};exports[_0xa75e('0x40')]=function(_0x446d32,_0x1c7070){if(_0x446d32[_0xa75e('0x3f')]['id']){delete _0x446d32['body']['id'];}return db[_0xa75e('0x24')]['find']({'where':{'id':_0x446d32[_0xa75e('0x3c')]['id']}})[_0xa75e('0x1f')](handleEntityNotFound(_0x1c7070,null))[_0xa75e('0x1f')](saveUpdates(_0x446d32['body'],null))[_0xa75e('0x1f')](respondWithResult(_0x1c7070,null))[_0xa75e('0x3a')](handleError(_0x1c7070,null));};exports[_0xa75e('0x20')]=function(_0x4cf713,_0x13213b){return db[_0xa75e('0x24')][_0xa75e('0x3d')]({'where':{'id':_0x4cf713['params']['id']}})[_0xa75e('0x1f')](handleEntityNotFound(_0x13213b,null))['then'](removeEntity(_0x13213b,null))[_0xa75e('0x3a')](handleError(_0x13213b,null));};exports[_0xa75e('0x41')]=function(_0x281b05,_0x5e1cd3){return db[_0xa75e('0x24')][_0xa75e('0x41')]()['then'](respondWithResult(_0x5e1cd3,null))[_0xa75e('0x3a')](handleError(_0x5e1cd3,null));}; \ No newline at end of file +var _0x7f31=['offset','limit','set','Content-Range','reject','destroy','then','status','error','stack','name','send','index','ChatTransferReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','key','VIRTUAL','merge','includeAll','findAll','rows','catch','show','include','options','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/utils','end','json','count'];(function(_0x48ebc1,_0x4f21c7){var _0x4d7a63=function(_0x2412eb){while(--_0x2412eb){_0x48ebc1['push'](_0x48ebc1['shift']());}};_0x4d7a63(++_0x4f21c7);}(_0x7f31,0x13d));var _0x17f3=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x7f31[_0x3fc97b];return _0x3a0c82;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x17f3('0x0'));var rimraf=require(_0x17f3('0x1'));var zipdir=require(_0x17f3('0x2'));var jsonpatch=require(_0x17f3('0x3'));var rp=require(_0x17f3('0x4'));var moment=require(_0x17f3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x17f3('0x6'));var util=require(_0x17f3('0x7'));var path=require(_0x17f3('0x8'));var sox=require(_0x17f3('0x9'));var csv=require(_0x17f3('0xa'));var ejs=require(_0x17f3('0xb'));var fs=require('fs');var _=require(_0x17f3('0xc'));var squel=require('squel');var crypto=require(_0x17f3('0xd'));var jsforce=require(_0x17f3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x17f3('0xa'));var querystring=require(_0x17f3('0xf'));var Papa=require(_0x17f3('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x17f3('0x11'));var Redis=require('ioredis');var qs=require(_0x17f3('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x17f3('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x99f20b,_0x4b08b1){_0x4b08b1=_0x4b08b1||0xcc;return function(_0x499b03){if(_0x499b03){return _0x99f20b['sendStatus'](_0x4b08b1);}return _0x99f20b['status'](_0x4b08b1)[_0x17f3('0x14')]();};}function respondWithResult(_0x300483,_0x4dc8a8){_0x4dc8a8=_0x4dc8a8||0xc8;return function(_0x334d58){if(_0x334d58){return _0x300483['status'](_0x4dc8a8)[_0x17f3('0x15')](_0x334d58);}};}function respondWithFilteredResult(_0x3ca960,_0x2edda2){return function(_0x16283b){if(_0x16283b){var _0x1dc6f0=_0x16283b[_0x17f3('0x16')],_0x2e5242=_0x2edda2[_0x17f3('0x17')],_0x1bdf40=_0x2edda2['offset']+_0x2edda2[_0x17f3('0x18')],_0x2e5256;if(_0x1bdf40>=_0x1dc6f0){_0x1bdf40=_0x1dc6f0;_0x2e5256=0xc8;}else{_0x2e5256=0xce;}_0x3ca960['status'](_0x2e5256);return _0x3ca960[_0x17f3('0x19')](_0x17f3('0x1a'),_0x2e5242+'-'+_0x1bdf40+'/'+_0x1dc6f0)[_0x17f3('0x15')](_0x16283b);}return null;};}function patchUpdates(_0x1627b4){return function(_0x446016){try{jsonpatch['apply'](_0x446016,_0x1627b4,!![]);}catch(_0x19bd7b){return BPromise[_0x17f3('0x1b')](_0x19bd7b);}return _0x446016['save']();};}function saveUpdates(_0x4d8ee7,_0x48dc5d){return function(_0x477e36){if(_0x477e36){return _0x477e36['update'](_0x4d8ee7)['then'](function(_0x49a12d){return _0x49a12d;});}return null;};}function removeEntity(_0x35d116,_0x90ca19){return function(_0x5d1a77){if(_0x5d1a77){return _0x5d1a77[_0x17f3('0x1c')]()[_0x17f3('0x1d')](function(){_0x35d116[_0x17f3('0x1e')](0xcc)[_0x17f3('0x14')]();});}};}function handleEntityNotFound(_0x582878,_0x8e0cd5){return function(_0x25f364){if(!_0x25f364){_0x582878['sendStatus'](0x194);}return _0x25f364;};}function handleError(_0x155def,_0x59039d){_0x59039d=_0x59039d||0x1f4;return function(_0x30b832){logger[_0x17f3('0x1f')](_0x30b832[_0x17f3('0x20')]);if(_0x30b832[_0x17f3('0x21')]){delete _0x30b832[_0x17f3('0x21')];}_0x155def['status'](_0x59039d)[_0x17f3('0x22')](_0x30b832);};}exports[_0x17f3('0x23')]=function(_0x413fb8,_0x35aa50){var _0xdb1233={},_0x4d4682={},_0xf89cc6={'count':0x0,'rows':[]};var _0x312ea4=db[_0x17f3('0x24')][_0x17f3('0x25')];_0x4d4682[_0x17f3('0x26')]=_[_0x17f3('0x27')](_0x312ea4);_0x4d4682[_0x17f3('0x28')]=_[_0x17f3('0x27')](_0x413fb8[_0x17f3('0x28')]);_0x4d4682[_0x17f3('0x29')]=_[_0x17f3('0x2a')](_0x4d4682[_0x17f3('0x26')],_0x4d4682[_0x17f3('0x28')]);_0xdb1233['attributes']=_[_0x17f3('0x2a')](_0x4d4682[_0x17f3('0x26')],qs['fields'](_0x413fb8[_0x17f3('0x28')][_0x17f3('0x2b')]));_0xdb1233[_0x17f3('0x2c')]=_0xdb1233['attributes'][_0x17f3('0x2d')]?_0xdb1233['attributes']:_0x4d4682[_0x17f3('0x26')];if(!_0x413fb8[_0x17f3('0x28')][_0x17f3('0x2e')](_0x17f3('0x2f'))){_0xdb1233[_0x17f3('0x18')]=qs['limit'](_0x413fb8['query']['limit']);_0xdb1233[_0x17f3('0x17')]=qs[_0x17f3('0x17')](_0x413fb8['query'][_0x17f3('0x17')]);}_0xdb1233['order']=qs[_0x17f3('0x30')](_0x413fb8['query'][_0x17f3('0x30')]);_0xdb1233[_0x17f3('0x31')]=qs[_0x17f3('0x29')](_[_0x17f3('0x32')](_0x413fb8[_0x17f3('0x28')],_0x4d4682[_0x17f3('0x29')]));if(_0x413fb8['query'][_0x17f3('0x33')]){_0xdb1233['where']=_['merge'](_0xdb1233[_0x17f3('0x31')],{'$or':_[_0x17f3('0x34')](_0x312ea4,function(_0x103a77){if(_0x103a77['type'][_0x17f3('0x35')]!==_0x17f3('0x36')){var _0x7afd61={};_0x7afd61[_0x103a77['field']]={'$like':'%'+_0x413fb8[_0x17f3('0x28')]['filter']+'%'};return _0x7afd61;}})});}_0xdb1233=_[_0x17f3('0x37')]({},_0xdb1233,_0x413fb8['options']);var _0x274392={'where':_0xdb1233[_0x17f3('0x31')]};return db[_0x17f3('0x24')][_0x17f3('0x16')](_0x274392)[_0x17f3('0x1d')](function(_0x1a8c4e){_0xf89cc6[_0x17f3('0x16')]=_0x1a8c4e;if(_0x413fb8[_0x17f3('0x28')][_0x17f3('0x38')]){_0xdb1233['include']=[{'all':!![]}];}return db[_0x17f3('0x24')][_0x17f3('0x39')](_0xdb1233);})[_0x17f3('0x1d')](function(_0x2d1ef5){_0xf89cc6[_0x17f3('0x3a')]=_0x2d1ef5;return _0xf89cc6;})['then'](respondWithFilteredResult(_0x35aa50,_0xdb1233))[_0x17f3('0x3b')](handleError(_0x35aa50,null));};exports[_0x17f3('0x3c')]=function(_0x1a38b6,_0x3f9d77){var _0x3e86f2={'raw':!![],'where':{'id':_0x1a38b6['params']['id']}},_0x17ade2={};_0x17ade2['model']=_['keys'](db[_0x17f3('0x24')][_0x17f3('0x25')]);_0x17ade2[_0x17f3('0x28')]=_[_0x17f3('0x27')](_0x1a38b6[_0x17f3('0x28')]);_0x17ade2['filters']=_[_0x17f3('0x2a')](_0x17ade2[_0x17f3('0x26')],_0x17ade2[_0x17f3('0x28')]);_0x3e86f2[_0x17f3('0x2c')]=_[_0x17f3('0x2a')](_0x17ade2[_0x17f3('0x26')],qs[_0x17f3('0x2b')](_0x1a38b6[_0x17f3('0x28')]['fields']));_0x3e86f2[_0x17f3('0x2c')]=_0x3e86f2[_0x17f3('0x2c')][_0x17f3('0x2d')]?_0x3e86f2[_0x17f3('0x2c')]:_0x17ade2[_0x17f3('0x26')];if(_0x1a38b6[_0x17f3('0x28')][_0x17f3('0x38')]){_0x3e86f2[_0x17f3('0x3d')]=[{'all':!![]}];}_0x3e86f2=_[_0x17f3('0x37')]({},_0x3e86f2,_0x1a38b6[_0x17f3('0x3e')]);return db[_0x17f3('0x24')][_0x17f3('0x3f')](_0x3e86f2)[_0x17f3('0x1d')](handleEntityNotFound(_0x3f9d77,null))[_0x17f3('0x1d')](respondWithResult(_0x3f9d77,null))[_0x17f3('0x3b')](handleError(_0x3f9d77,null));};exports[_0x17f3('0x40')]=function(_0x233653,_0x3428ea){return db[_0x17f3('0x24')]['create'](_0x233653[_0x17f3('0x41')],{})[_0x17f3('0x1d')](respondWithResult(_0x3428ea,0xc9))[_0x17f3('0x3b')](handleError(_0x3428ea,null));};exports[_0x17f3('0x42')]=function(_0x36e305,_0x5de898){if(_0x36e305['body']['id']){delete _0x36e305[_0x17f3('0x41')]['id'];}return db['ChatTransferReport'][_0x17f3('0x3f')]({'where':{'id':_0x36e305[_0x17f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x5de898,null))[_0x17f3('0x1d')](saveUpdates(_0x36e305['body'],null))['then'](respondWithResult(_0x5de898,null))[_0x17f3('0x3b')](handleError(_0x5de898,null));};exports[_0x17f3('0x1c')]=function(_0x69850,_0x2ee0d2){return db[_0x17f3('0x24')][_0x17f3('0x3f')]({'where':{'id':_0x69850[_0x17f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ee0d2,null))[_0x17f3('0x1d')](removeEntity(_0x2ee0d2,null))[_0x17f3('0x3b')](handleError(_0x2ee0d2,null));};exports['describe']=function(_0x46183b,_0x3b7c50){return db['ChatTransferReport']['describe']()[_0x17f3('0x1d')](respondWithResult(_0x3b7c50,null))[_0x17f3('0x3b')](handleError(_0x3b7c50,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 19dc5f8..526416d 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 _0x98b1=['api','bluebird','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x98b1,0xe9));var _0x198b=function(_0xd949d4,_0x1c2b46){_0xd949d4=_0xd949d4-0x0;var _0x4caa45=_0x98b1[_0xd949d4];return _0x4caa45;};'use strict';var _=require('lodash');var util=require(_0x198b('0x0'));var logger=require('../../config/logger')(_0x198b('0x1'));var moment=require('moment');var BPromise=require(_0x198b('0x2'));var rp=require('request-promise');var attributes=require(_0x198b('0x3'));module[_0x198b('0x4')]=function(_0x5c0ad5,_0x2acbf2){return _0x5c0ad5[_0x198b('0x5')](_0x198b('0x6'),attributes,{'tableName':_0x198b('0x7'),'paranoid':![],'indexes':[{'name':_0x198b('0x8'),'fields':[_0x198b('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3e9=['ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','./chatTransferReport.attributes','exports','define'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0xf3e9,0x183));var _0x9f3e=function(_0x3b1914,_0x1d89e3){_0x3b1914=_0x3b1914-0x0;var _0x22606a=_0xf3e9[_0x3b1914];return _0x22606a;};'use strict';var _=require(_0x9f3e('0x0'));var util=require(_0x9f3e('0x1'));var logger=require(_0x9f3e('0x2'))(_0x9f3e('0x3'));var moment=require(_0x9f3e('0x4'));var BPromise=require(_0x9f3e('0x5'));var rp=require('request-promise');var attributes=require(_0x9f3e('0x6'));module[_0x9f3e('0x7')]=function(_0x3ac374,_0x5f2697){return _0x3ac374[_0x9f3e('0x8')](_0x9f3e('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x9f3e('0xa'),'fields':[_0x9f3e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 61839e8..fdf8811 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 _0xe773=['jayson/promise','client','http','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5a2d7e,_0xba8c3c){var _0x25fa5c=function(_0x331ecb){while(--_0x331ecb){_0x5a2d7e['push'](_0x5a2d7e['shift']());}};_0x25fa5c(++_0xba8c3c);}(_0xe773,0x19a));var _0x3e77=function(_0x287e3b,_0x5a8bfd){_0x287e3b=_0x287e3b-0x0;var _0x59c005=_0xe773[_0x287e3b];return _0x59c005;};'use strict';var _=require('lodash');var util=require(_0x3e77('0x0'));var moment=require(_0x3e77('0x1'));var BPromise=require(_0x3e77('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e77('0x3'));var db=require(_0x3e77('0x4'))['db'];var utils=require(_0x3e77('0x5'));var logger=require(_0x3e77('0x6'))(_0x3e77('0x7'));var config=require('../../config/environment');var jayson=require(_0x3e77('0x8'));var client=jayson[_0x3e77('0x9')][_0x3e77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x441fda,_0x7b7dfe,_0x22dd9a){return new BPromise(function(_0x4244af,_0x22bf10){return client[_0x3e77('0xb')](_0x441fda,_0x22dd9a)[_0x3e77('0xc')](function(_0x272f48){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x7b7dfe,_0x3e77('0xd'));logger[_0x3e77('0xe')](_0x3e77('0xf'),_0x7b7dfe,_0x3e77('0xd'),JSON[_0x3e77('0x10')](_0x272f48));if(_0x272f48['error']){if(_0x272f48[_0x3e77('0x11')]['code']===0x1f4){logger['error'](_0x3e77('0x12'),_0x7b7dfe,_0x272f48['error']['message']);return _0x22bf10(_0x272f48[_0x3e77('0x11')][_0x3e77('0x13')]);}logger[_0x3e77('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x7b7dfe,_0x272f48[_0x3e77('0x11')]['message']);return _0x4244af(_0x272f48[_0x3e77('0x11')][_0x3e77('0x13')]);}else{logger['info'](_0x3e77('0x12'),_0x7b7dfe,_0x3e77('0xd'));_0x4244af(_0x272f48[_0x3e77('0x14')][_0x3e77('0x13')]);}})[_0x3e77('0x15')](function(_0x2c42e7){logger['error'](_0x3e77('0x12'),_0x7b7dfe,_0x2c42e7);_0x22bf10(_0x2c42e7);});});} \ No newline at end of file +var _0x155d=['code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x155d,0x89));var _0xd155=function(_0x33554b,_0x48162b){_0x33554b=_0x33554b-0x0;var _0x256954=_0x155d[_0x33554b];return _0x256954;};'use strict';var _=require(_0xd155('0x0'));var util=require(_0xd155('0x1'));var moment=require(_0xd155('0x2'));var BPromise=require(_0xd155('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd155('0x4'));var db=require(_0xd155('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd155('0x6'));var client=jayson[_0xd155('0x7')][_0xd155('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16c6d0,_0x1f0b0a,_0x102bb6){return new BPromise(function(_0x463e8e,_0xca5358){return client[_0xd155('0x9')](_0x16c6d0,_0x102bb6)[_0xd155('0xa')](function(_0x5355b0){logger[_0xd155('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x1f0b0a,_0xd155('0xc'));logger[_0xd155('0xd')](_0xd155('0xe'),_0x1f0b0a,_0xd155('0xc'),JSON[_0xd155('0xf')](_0x5355b0));if(_0x5355b0[_0xd155('0x10')]){if(_0x5355b0[_0xd155('0x10')][_0xd155('0x11')]===0x1f4){logger[_0xd155('0x10')](_0xd155('0x12'),_0x1f0b0a,_0x5355b0[_0xd155('0x10')][_0xd155('0x13')]);return _0xca5358(_0x5355b0['error'][_0xd155('0x13')]);}logger[_0xd155('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x1f0b0a,_0x5355b0['error'][_0xd155('0x13')]);return _0x463e8e(_0x5355b0['error']['message']);}else{logger[_0xd155('0xb')](_0xd155('0x12'),_0x1f0b0a,_0xd155('0xc'));_0x463e8e(_0x5355b0[_0xd155('0x14')][_0xd155('0x13')]);}})[_0xd155('0x15')](function(_0x111445){logger[_0xd155('0x10')](_0xd155('0x12'),_0x1f0b0a,_0x111445);_0xca5358(_0x111445);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index fdb655e..4964ac0 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 _0x39c5=['/describe','describe','/:id','show','post','create','put','update','delete','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0x39c5,0x69));var _0x539c=function(_0x5bdd96,_0x178a4f){_0x5bdd96=_0x5bdd96-0x0;var _0x31625b=_0x39c5[_0x5bdd96];return _0x31625b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x539c('0x0'));var timeout=require(_0x539c('0x1'));var express=require(_0x539c('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x539c('0x3'));var config=require(_0x539c('0x4'));var controller=require(_0x539c('0x5'));router[_0x539c('0x6')]('/',auth[_0x539c('0x7')](),controller[_0x539c('0x8')]);router[_0x539c('0x6')](_0x539c('0x9'),auth[_0x539c('0x7')](),controller[_0x539c('0xa')]);router[_0x539c('0x6')](_0x539c('0xb'),auth[_0x539c('0x7')](),controller[_0x539c('0xc')]);router[_0x539c('0xd')]('/',auth[_0x539c('0x7')](),controller[_0x539c('0xe')]);router[_0x539c('0xf')](_0x539c('0xb'),auth[_0x539c('0x7')](),controller[_0x539c('0x10')]);router[_0x539c('0x11')](_0x539c('0xb'),auth[_0x539c('0x7')](),controller['destroy']);module[_0x539c('0x12')]=router; \ No newline at end of file +var _0xcadf=['index','/describe','describe','isAuthenticated','show','post','/:id','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get'];(function(_0x543f5a,_0x1933fb){var _0x3beea6=function(_0x19ae2c){while(--_0x19ae2c){_0x543f5a['push'](_0x543f5a['shift']());}};_0x3beea6(++_0x1933fb);}(_0xcadf,0x12b));var _0xfcad=function(_0x12b977,_0x36571d){_0x12b977=_0x12b977-0x0;var _0x653c0=_0xcadf[_0x12b977];return _0x653c0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfcad('0x0'));var timeout=require('connect-timeout');var express=require(_0xfcad('0x1'));var router=express[_0xfcad('0x2')]();var auth=require(_0xfcad('0x3'));var interaction=require(_0xfcad('0x4'));var config=require('../../config/environment');var controller=require(_0xfcad('0x5'));router[_0xfcad('0x6')]('/',auth['isAuthenticated'](),controller[_0xfcad('0x7')]);router[_0xfcad('0x6')](_0xfcad('0x8'),auth['isAuthenticated'](),controller[_0xfcad('0x9')]);router['get']('/:id',auth[_0xfcad('0xa')](),controller[_0xfcad('0xb')]);router[_0xfcad('0xc')]('/',auth[_0xfcad('0xa')](),controller['create']);router['put'](_0xfcad('0xd'),auth[_0xfcad('0xa')](),controller['update']);router[_0xfcad('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xfcad('0xf')]);module[_0xfcad('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 9330c0b..ac3b46f 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 _0x73fb=['Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','thumb','input','text','name','getDataValue','parse','onlineForm','stringify','email','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','address','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error'];(function(_0x1d7973,_0x357676){var _0x43190c=function(_0x4dd797){while(--_0x4dd797){_0x1d7973['push'](_0x1d7973['shift']());}};_0x43190c(++_0x357676);}(_0x73fb,0xe6));var _0xb73f=function(_0x32bdd4,_0x143a69){_0x32bdd4=_0x32bdd4-0x0;var _0x4b54d3=_0x73fb[_0x32bdd4];return _0x4b54d3;};'use strict';var Sequelize=require(_0xb73f('0x0'));var rs=require(_0xb73f('0x1'));module[_0xb73f('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xb73f('0x3')],'allowNull':![],'unique':_0xb73f('0x4')},'description':{'type':Sequelize[_0xb73f('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xb73f('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0x5')},'customerAlias':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb73f('0x3')],'allowNull':![],'defaultValue':_0xb73f('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb73f('0x3')],'allowNull':![],'defaultValue':_0xb73f('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb73f('0x3')],'allowNull':![],'defaultValue':_0xb73f('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb73f('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb73f('0x3')]},'animation':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb73f('0xa'),_0xb73f('0xb')),'defaultValue':_0xb73f('0xa')},'header_online':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb73f('0xd')},'offline_chat_button':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0xe')},'header_offline':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb73f('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xb73f('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb73f('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xb73f('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0x14')},'closingMessageButton':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0xe')},'skipMessageButton':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0x15')},'conditionAgreement':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0xb73f('0x16')](_0xb73f('0x17'),_0xb73f('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb73f('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb73f('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xb73f('0x19'),'variable':null,'config':{'placeholder':'name','type':_0xb73f('0x1a'),'required':!![]},'props':{'title':_0xb73f('0x1b'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb73f('0x1c')]('onlineForm')?JSON[_0xb73f('0x1d')](this[_0xb73f('0x1c')](_0xb73f('0x1e'))):{};},'set':function(_0x33c6a0){return this['setDataValue'](_0xb73f('0x1e'),JSON[_0xb73f('0x1f')](_0x33c6a0));}},'offlineForm':{'type':Sequelize[_0xb73f('0x11')],'defaultValue':function(){return JSON[_0xb73f('0x1f')]({'items':[{'type':_0xb73f('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb73f('0x20'),'type':'email'},'variable':null},{'type':_0xb73f('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0xb73f('0x22'),'helpText':_0xb73f('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xb73f('0x1c')](_0xb73f('0x24'))?JSON[_0xb73f('0x1d')](this[_0xb73f('0x1c')](_0xb73f('0x24'))):{};},'set':function(_0x324ffd){return this[_0xb73f('0x25')](_0xb73f('0x24'),JSON[_0xb73f('0x1f')](_0x324ffd));}},'token':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':function(){return rs[_0xb73f('0x26')]();}},'autoclose':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb73f('0x3')]},'forwardOffline':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0x27')},'waitingMessage':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xb73f('0x29')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0x15')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xb73f('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb73f('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb73f('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb73f('0x11')],'defaultValue':function(){return _0xb73f('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb73f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':_0xb73f('0x2d')},'verticalAlignment':{'type':Sequelize[_0xb73f('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xb73f('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xb73f('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb73f('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb73f('0x3')],'allowNull':![],'defaultValue':_0xb73f('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb73f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb73f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb73f('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xb73f('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb73f('0x8')],'comment':_0xb73f('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xb73f('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x488541){if(!_0x488541)this[_0xb73f('0x25')](_0xb73f('0x31'),null);this[_0xb73f('0x25')]('mandatoryDisposition',_0x488541);}}}; \ No newline at end of file +var _0x5b3d=['Agent','#9f946a','INTEGER','BOOLEAN','squared','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','ENUM','thumb','star','TEXT','stringify','name','text','input','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','email'];(function(_0x32d4c7,_0x289462){var _0xa901cb=function(_0x4af183){while(--_0x4af183){_0x32d4c7['push'](_0x32d4c7['shift']());}};_0xa901cb(++_0x289462);}(_0x5b3d,0xf1));var _0xd5b3=function(_0x2b91ac,_0x310741){_0x2b91ac=_0x2b91ac-0x0;var _0xe88814=_0x5b3d[_0x2b91ac];return _0xe88814;};'use strict';var Sequelize=require(_0xd5b3('0x0'));var rs=require('randomstring');module[_0xd5b3('0x1')]={'name':{'type':Sequelize[_0xd5b3('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xd5b3('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0x3')},'mapKeyOffline':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0x3')},'key':{'type':Sequelize[_0xd5b3('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0x4')},'customerAlias':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd5b3('0x2')],'allowNull':![],'defaultValue':_0xd5b3('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd5b3('0x2')],'allowNull':![],'defaultValue':_0xd5b3('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd5b3('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd5b3('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd5b3('0x2')]},'animation':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xd5b3('0x8')),'defaultValue':_0xd5b3('0x9')},'header_online':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0xa')},'start_chat_button':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd5b3('0xc')},'header_offline':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0xe')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0xf')},'noteTitle':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0x10')},'placeholderMessage':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd5b3('0x12')},'closingMessageButton':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0xd5b3('0x13')]('star',_0xd5b3('0x14')),'defaultValue':_0xd5b3('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xd5b3('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd5b3('0x16')],'defaultValue':function(){return JSON[_0xd5b3('0x17')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xd5b3('0x18'),'type':_0xd5b3('0x19'),'required':!![]},'props':{'title':_0xd5b3('0x18'),'helpText':''}},{'type':_0xd5b3('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd5b3('0x3'),'type':_0xd5b3('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xd5b3('0x1b'))?JSON[_0xd5b3('0x1c')](this[_0xd5b3('0x1d')](_0xd5b3('0x1b'))):{};},'set':function(_0x1c7004){return this[_0xd5b3('0x1e')](_0xd5b3('0x1b'),JSON['stringify'](_0x1c7004));}},'offlineForm':{'type':Sequelize[_0xd5b3('0x16')],'defaultValue':function(){return JSON[_0xd5b3('0x17')]({'items':[{'type':_0xd5b3('0x1a'),'props':{'title':_0xd5b3('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xd5b3('0x3'),'type':_0xd5b3('0x3')},'variable':null},{'type':_0xd5b3('0x1f'),'config':{'placeholder':_0xd5b3('0x20')},'props':{'title':_0xd5b3('0x20'),'helpText':_0xd5b3('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xd5b3('0x1d')](_0xd5b3('0x22'))?JSON[_0xd5b3('0x1c')](this['getDataValue'](_0xd5b3('0x22'))):{};},'set':function(_0x749709){return this['setDataValue'](_0xd5b3('0x22'),JSON['stringify'](_0x749709));}},'token':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd5b3('0x2')]},'forwardOffline':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd5b3('0x2')]},'waitingTitle':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd5b3('0x24')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0x26')},'skipUnmanaged':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0x27')},'sendUnmanaged':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd5b3('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd5b3('0x16')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd5b3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd5b3('0x2')],'defaultValue':_0xd5b3('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd5b3('0x2a')},'defaultTitle':{'type':Sequelize[_0xd5b3('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd5b3('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd5b3('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd5b3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd5b3('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd5b3('0x6')],'comment':_0xd5b3('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xd5b3('0x7')],'defaultValue':![],'comment':_0xd5b3('0x2e'),'set':function(_0x109a97){if(!_0x109a97)this['setDataValue'](_0xd5b3('0x2f'),null);this[_0xd5b3('0x1e')](_0xd5b3('0x30'),_0x109a97);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index c00cd8f..a4129e1 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 _0xb947=['info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','set','save','update','then','destroy','get','ChatWebsites','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','show','params','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','systemAvatar','getLogo','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','join','root','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','headers','user-agent','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','Applications','applications','priority','asc','account','Contacts','ListId','lastName','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','contact','firstName','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','notify','offline','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Owner','fullname','Tag','Tags','tag','getSnippet','timezone','iftime\x20%s,%s','interval','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','License','all','server/files/chat/iframe.js','remote','x-forwarded-for','connection','remoteAddress','addApplications','sequelize','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xb947,0x1f4));var _0x7b94=function(_0x1606dd,_0x5dd929){_0x1606dd=_0x1606dd-0x0;var _0x251921=_0xb947[_0x1606dd];return _0x251921;};'use strict';var pdf=require(_0x7b94('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b94('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7b94('0x2'));var moment=require(_0x7b94('0x3'));var BPromise=require(_0x7b94('0x4'));var Mustache=require(_0x7b94('0x5'));var util=require(_0x7b94('0x6'));var path=require(_0x7b94('0x7'));var sox=require(_0x7b94('0x8'));var csv=require(_0x7b94('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7b94('0xa'));var squel=require(_0x7b94('0xb'));var crypto=require(_0x7b94('0xc'));var jsforce=require(_0x7b94('0xd'));var deskjs=require(_0x7b94('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7b94('0xf'));var Papa=require(_0x7b94('0x10'));var authService=require(_0x7b94('0x11'));var hardwareService=require(_0x7b94('0x12'));var Redis=require(_0x7b94('0x13'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x7b94('0x14'));var utils=require('../../config/utils');var config=require(_0x7b94('0x15'));var db=require('../../mysqldb')['db'];config[_0x7b94('0x16')]=_[_0x7b94('0x17')](config[_0x7b94('0x16')],{'host':_0x7b94('0x18'),'port':0x18eb});var socket=require(_0x7b94('0x19'))(new Redis(config['redis']));require(_0x7b94('0x1a'))[_0x7b94('0x1b')](socket);var jayson=require(_0x7b94('0x1c'));var client=jayson[_0x7b94('0x1d')][_0x7b94('0x1e')]({'port':0x232c});var client9002=jayson[_0x7b94('0x1d')][_0x7b94('0x1e')]({'port':0x232a});var client9003=jayson['client'][_0x7b94('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x44af6a,_0x37c8e3,_0x4ee92d,_0x9a06e2){return new BPromise(function(_0xbae703,_0x1e0f15){var _0x4b8bb7=_0x9a06e2||client;return _0x4b8bb7[_0x7b94('0x1f')](_0x44af6a,_0x4ee92d)['then'](function(_0x6892a2){logger[_0x7b94('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x37c8e3,_0x7b94('0x21'));logger[_0x7b94('0x22')](_0x7b94('0x23'),_0x37c8e3,_0x7b94('0x21'),JSON[_0x7b94('0x24')](_0x6892a2));if(_0x6892a2[_0x7b94('0x25')]){if(_0x6892a2[_0x7b94('0x25')][_0x7b94('0x26')]===0x1f4){logger[_0x7b94('0x25')]('ChatWebsite,\x20%s,\x20%s',_0x37c8e3,_0x6892a2[_0x7b94('0x25')]['message']);return _0x1e0f15(_0x6892a2['error'][_0x7b94('0x27')]);}logger[_0x7b94('0x25')](_0x7b94('0x28'),_0x37c8e3,_0x6892a2[_0x7b94('0x25')][_0x7b94('0x27')]);return _0xbae703(_0x6892a2[_0x7b94('0x25')]['message']);}else{logger[_0x7b94('0x20')](_0x7b94('0x28'),_0x37c8e3,_0x7b94('0x21'));_0xbae703(_0x6892a2[_0x7b94('0x29')]['message']);}})[_0x7b94('0x2a')](function(_0x26bafe){logger[_0x7b94('0x25')](_0x7b94('0x28'),_0x37c8e3,_0x26bafe);_0x1e0f15(_0x26bafe);});});}function respondWithStatusCode(_0x3a7369,_0x32d622){_0x32d622=_0x32d622||0xcc;return function(_0x4e2cec){if(_0x4e2cec){return _0x3a7369[_0x7b94('0x2b')](_0x32d622);}return _0x3a7369[_0x7b94('0x2c')](_0x32d622)[_0x7b94('0x2d')]();};}function respondWithResult(_0x1cd2d7,_0x5e4c53){_0x5e4c53=_0x5e4c53||0xc8;return function(_0x14e4ce){if(_0x14e4ce){return _0x1cd2d7[_0x7b94('0x2c')](_0x5e4c53)[_0x7b94('0x2e')](_0x14e4ce);}};}function respondWithFilteredResult(_0xbaa698,_0x16f1b9){return function(_0xe05ffa){if(_0xe05ffa){var _0x21d971=_0xe05ffa[_0x7b94('0x2f')],_0x4db593=_0x16f1b9['offset'],_0x3d0bbd=_0x16f1b9['offset']+_0x16f1b9['limit'],_0x2c5615;if(_0x3d0bbd>=_0x21d971){_0x3d0bbd=_0x21d971;_0x2c5615=0xc8;}else{_0x2c5615=0xce;}_0xbaa698[_0x7b94('0x2c')](_0x2c5615);return _0xbaa698[_0x7b94('0x30')]('Content-Range',_0x4db593+'-'+_0x3d0bbd+'/'+_0x21d971)['json'](_0xe05ffa);}return null;};}function patchUpdates(_0x32c190){return function(_0xe7ed48){try{jsonpatch['apply'](_0xe7ed48,_0x32c190,!![]);}catch(_0x18dd08){return BPromise['reject'](_0x18dd08);}return _0xe7ed48[_0x7b94('0x31')]();};}function saveUpdates(_0xd48a50,_0x4e4f5e){return function(_0x5ea12b){if(_0x5ea12b){return _0x5ea12b[_0x7b94('0x32')](_0xd48a50)[_0x7b94('0x33')](function(_0x7c9a75){return _0x7c9a75;});}return null;};}function removeEntity(_0x35d864,_0x3a2ab6){return function(_0x328f4d){if(_0x328f4d){return _0x328f4d[_0x7b94('0x34')]()[_0x7b94('0x33')](function(){var _0x1fdd2c=_0x328f4d[_0x7b94('0x35')]({'plain':!![]});var _0x34cf62=_0x7b94('0x36');return db[_0x7b94('0x37')][_0x7b94('0x34')]({'where':{'type':_0x34cf62,'resourceId':_0x1fdd2c['id']}})[_0x7b94('0x33')](function(){return _0x328f4d;});})[_0x7b94('0x33')](function(){_0x35d864['status'](0xcc)[_0x7b94('0x2d')]();});}};}function handleEntityNotFound(_0x5514ef,_0x5e9dbd){return function(_0x50bf73){if(!_0x50bf73){_0x5514ef[_0x7b94('0x2b')](0x194);}return _0x50bf73;};}function handleError(_0x197b52,_0x50a5de){_0x50a5de=_0x50a5de||0x1f4;return function(_0x11752b){logger[_0x7b94('0x25')](_0x11752b['stack']);if(_0x11752b['name']){delete _0x11752b[_0x7b94('0x38')];}_0x197b52['status'](_0x50a5de)[_0x7b94('0x39')](_0x11752b);};}exports[_0x7b94('0x3a')]=function(_0x28b9b0,_0x5a0b4f){var _0x234c8b={'include':[{'model':db[_0x7b94('0x3b')],'as':_0x7b94('0x3c')}]},_0x1a1f65={},_0x407920={'count':0x0,'rows':[]};var _0x49dd83=db[_0x7b94('0x3d')][_0x7b94('0x3e')];_0x1a1f65['model']=_[_0x7b94('0x3f')](_0x49dd83);_0x1a1f65[_0x7b94('0x40')]=_['keys'](_0x28b9b0[_0x7b94('0x40')]);_0x1a1f65['filters']=_[_0x7b94('0x41')](_0x1a1f65[_0x7b94('0x42')],_0x1a1f65['query']);_0x234c8b[_0x7b94('0x43')]=_['intersection'](_0x1a1f65[_0x7b94('0x42')],qs[_0x7b94('0x44')](_0x28b9b0[_0x7b94('0x40')][_0x7b94('0x44')]));_0x234c8b[_0x7b94('0x43')]=_0x234c8b[_0x7b94('0x43')]['length']?_0x234c8b['attributes']:_0x1a1f65[_0x7b94('0x42')];if(!_0x28b9b0[_0x7b94('0x40')][_0x7b94('0x45')](_0x7b94('0x46'))){_0x234c8b[_0x7b94('0x47')]=qs['limit'](_0x28b9b0[_0x7b94('0x40')]['limit']);_0x234c8b[_0x7b94('0x48')]=qs[_0x7b94('0x48')](_0x28b9b0[_0x7b94('0x40')][_0x7b94('0x48')]);}_0x234c8b[_0x7b94('0x49')]=qs[_0x7b94('0x4a')](_0x28b9b0['query'][_0x7b94('0x4a')]);_0x234c8b[_0x7b94('0x4b')]=qs[_0x7b94('0x4c')](_[_0x7b94('0x4d')](_0x28b9b0[_0x7b94('0x40')],_0x1a1f65[_0x7b94('0x4c')]));if(_0x28b9b0[_0x7b94('0x40')][_0x7b94('0x4e')]){_0x234c8b[_0x7b94('0x4b')]=_[_0x7b94('0x4f')](_0x234c8b[_0x7b94('0x4b')],{'$or':_[_0x7b94('0x50')](_0x49dd83,function(_0x1bccb7){if(_0x1bccb7[_0x7b94('0x51')][_0x7b94('0x52')]!==_0x7b94('0x53')){var _0x324d18={};_0x324d18[_0x1bccb7[_0x7b94('0x54')]]={'$like':'%'+_0x28b9b0[_0x7b94('0x40')][_0x7b94('0x4e')]+'%'};return _0x324d18;}})});}_0x234c8b=_[_0x7b94('0x4f')]({},_0x234c8b,_0x28b9b0[_0x7b94('0x55')]);var _0x5f0a05={'where':_0x234c8b[_0x7b94('0x4b')]};return db[_0x7b94('0x3d')][_0x7b94('0x2f')](_0x5f0a05)[_0x7b94('0x33')](function(_0x1f1835){_0x407920['count']=_0x1f1835;if(_0x28b9b0[_0x7b94('0x40')]['includeAll']){_0x234c8b[_0x7b94('0x56')]=[{'all':!![]}];}return db[_0x7b94('0x3d')][_0x7b94('0x57')](_0x234c8b);})[_0x7b94('0x33')](function(_0x517160){_0x407920[_0x7b94('0x58')]=_0x517160;return _0x407920;})[_0x7b94('0x33')](respondWithFilteredResult(_0x5a0b4f,_0x234c8b))[_0x7b94('0x2a')](handleError(_0x5a0b4f,null));};exports[_0x7b94('0x59')]=function(_0x41e32c,_0x2124b3){var _0x1de7bc={'raw':![],'where':{'id':_0x41e32c[_0x7b94('0x5a')]['id']},'include':[{'model':db[_0x7b94('0x3b')],'as':_0x7b94('0x3c')}]},_0xcc3905={};_0xcc3905['model']=_[_0x7b94('0x3f')](db[_0x7b94('0x3d')][_0x7b94('0x3e')]);_0xcc3905[_0x7b94('0x40')]=_[_0x7b94('0x3f')](_0x41e32c[_0x7b94('0x40')]);_0xcc3905[_0x7b94('0x4c')]=_['intersection'](_0xcc3905[_0x7b94('0x42')],_0xcc3905[_0x7b94('0x40')]);_0x1de7bc[_0x7b94('0x43')]=_['intersection'](_0xcc3905[_0x7b94('0x42')],qs[_0x7b94('0x44')](_0x41e32c[_0x7b94('0x40')][_0x7b94('0x44')]));_0x1de7bc[_0x7b94('0x43')]=_0x1de7bc[_0x7b94('0x43')][_0x7b94('0x5b')]?_0x1de7bc[_0x7b94('0x43')]:_0xcc3905[_0x7b94('0x42')];if(_0x41e32c['query'][_0x7b94('0x5c')]){_0x1de7bc['include']=[{'all':!![]}];}_0x1de7bc=_['merge']({},_0x1de7bc,_0x41e32c[_0x7b94('0x55')]);return db[_0x7b94('0x3d')][_0x7b94('0x5d')](_0x1de7bc)[_0x7b94('0x33')](handleEntityNotFound(_0x2124b3,null))['then'](respondWithResult(_0x2124b3,null))[_0x7b94('0x2a')](handleError(_0x2124b3,null));};exports[_0x7b94('0x5e')]=function(_0x2c1267,_0x4afbc3){return db['ChatWebsite']['create'](_0x2c1267['body'],{})[_0x7b94('0x33')](function(_0x59fe65){var _0x1f6f8e=_0x2c1267[_0x7b94('0x5f')][_0x7b94('0x35')]({'plain':!![]});if(!_0x1f6f8e)throw new Error(_0x7b94('0x60'));if(_0x1f6f8e['role']===_0x7b94('0x5f')){var _0x292222=_0x59fe65['get']({'plain':!![]});var _0x154ee4='ChatWebsites';return db['UserProfileSection'][_0x7b94('0x5d')]({'where':{'name':_0x154ee4,'userProfileId':_0x1f6f8e['userProfileId']},'raw':!![]})[_0x7b94('0x33')](function(_0x1d3dad){if(_0x1d3dad&&_0x1d3dad[_0x7b94('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x292222[_0x7b94('0x38')],'resourceId':_0x292222['id'],'type':_0x1d3dad['name'],'sectionId':_0x1d3dad['id']},{})[_0x7b94('0x33')](function(){return _0x59fe65;});}else{return _0x59fe65;}})['catch'](function(_0x1bf318){logger[_0x7b94('0x25')](_0x7b94('0x62'),_0x1bf318);throw _0x1bf318;});}return _0x59fe65;})['then'](respondWithResult(_0x4afbc3,0xc9))[_0x7b94('0x2a')](handleError(_0x4afbc3,null));};exports[_0x7b94('0x32')]=function(_0x2cf390,_0x31cda1){if(_0x2cf390[_0x7b94('0x63')]['id']){delete _0x2cf390[_0x7b94('0x63')]['id'];}return db[_0x7b94('0x3d')][_0x7b94('0x5d')]({'where':{'id':_0x2cf390[_0x7b94('0x5a')]['id']},'include':[{'model':db[_0x7b94('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x7b94('0x33')](handleEntityNotFound(_0x31cda1,null))[_0x7b94('0x33')](saveUpdates(_0x2cf390[_0x7b94('0x63')],null))[_0x7b94('0x33')](function(_0x5cef4d){if(_0x5cef4d&&_0x2cf390[_0x7b94('0x63')]['mandatoryDispositionPause']){return db[_0x7b94('0x3b')][_0x7b94('0x32')](_0x2cf390[_0x7b94('0x63')][_0x7b94('0x3c')],{'where':{'ChatWebsiteId':_0x5cef4d['id']}})[_0x7b94('0x33')](function(){return _0x5cef4d;});}return _0x5cef4d;})['then'](respondWithResult(_0x31cda1,null))[_0x7b94('0x2a')](handleError(_0x31cda1,null));};exports['destroy']=function(_0x334ac6,_0x45fadc){return db[_0x7b94('0x3d')]['find']({'where':{'id':_0x334ac6[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x45fadc,null))[_0x7b94('0x33')](removeEntity(_0x45fadc,null))[_0x7b94('0x2a')](handleError(_0x45fadc,null));};exports['describe']=function(_0xbd1610,_0x420e78){return db[_0x7b94('0x3d')][_0x7b94('0x64')]()[_0x7b94('0x33')](respondWithResult(_0x420e78,null))['catch'](handleError(_0x420e78,null));};exports[_0x7b94('0x65')]=function(_0x22722d,_0x52b567,_0x4ebc18){if(_0x22722d['body']['id']){delete _0x22722d[_0x7b94('0x63')]['id'];}return db[_0x7b94('0x3d')][_0x7b94('0x5d')]({'where':{'id':_0x22722d[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x52b567,null))[_0x7b94('0x33')](function(_0x46bcde){if(_0x46bcde){_0x22722d[_0x7b94('0x63')][_0x7b94('0x66')]=_0x46bcde['id'];return db[_0x7b94('0x67')][_0x7b94('0x5e')](_0x22722d[_0x7b94('0x63')]);}})[_0x7b94('0x33')](respondWithResult(_0x52b567,null))['catch'](handleError(_0x52b567,null));};exports['getDispositions']=function(_0x28d124,_0x43e4bf,_0x46be40){var _0x28a27c={'raw':![],'where':{}};var _0x26ad20={};var _0x491c40={'count':0x0,'rows':[]};return db[_0x7b94('0x3d')][_0x7b94('0x68')]({'where':{'id':_0x28d124[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x43e4bf,null))[_0x7b94('0x33')](function(_0x223b15){if(_0x223b15){_0x26ad20[_0x7b94('0x42')]=_[_0x7b94('0x3f')](db['Disposition'][_0x7b94('0x3e')]);_0x26ad20['query']=_[_0x7b94('0x3f')](_0x28d124[_0x7b94('0x40')]);_0x26ad20[_0x7b94('0x4c')]=_[_0x7b94('0x41')](_0x26ad20[_0x7b94('0x42')],_0x26ad20[_0x7b94('0x40')]);_0x28a27c['attributes']=_[_0x7b94('0x41')](_0x26ad20[_0x7b94('0x42')],qs[_0x7b94('0x44')](_0x28d124[_0x7b94('0x40')][_0x7b94('0x44')]));_0x28a27c[_0x7b94('0x43')]=_0x28a27c[_0x7b94('0x43')][_0x7b94('0x5b')]?_0x28a27c[_0x7b94('0x43')]:_0x26ad20[_0x7b94('0x42')];if(!_0x28d124[_0x7b94('0x40')][_0x7b94('0x45')](_0x7b94('0x46'))){_0x28a27c['limit']=qs[_0x7b94('0x47')](_0x28d124[_0x7b94('0x40')][_0x7b94('0x47')]);_0x28a27c[_0x7b94('0x48')]=qs['offset'](_0x28d124['query'][_0x7b94('0x48')]);}_0x28a27c[_0x7b94('0x49')]=qs[_0x7b94('0x4a')](_0x28d124[_0x7b94('0x40')][_0x7b94('0x4a')]);_0x28a27c[_0x7b94('0x4b')]=qs[_0x7b94('0x4c')](_[_0x7b94('0x4d')](_0x28d124[_0x7b94('0x40')],_0x26ad20[_0x7b94('0x4c')]));_0x28a27c[_0x7b94('0x4b')][_0x7b94('0x66')]=_0x223b15['id'];if(_0x28d124[_0x7b94('0x40')]['filter']){_0x28a27c[_0x7b94('0x4b')]=_['merge'](_0x28a27c[_0x7b94('0x4b')],{'$or':_[_0x7b94('0x50')](_0x28a27c[_0x7b94('0x43')],function(_0x546beb){var _0x170f7c={};_0x170f7c[_0x546beb]={'$like':'%'+_0x28d124[_0x7b94('0x40')][_0x7b94('0x4e')]+'%'};return _0x170f7c;})});}_0x28a27c=_['merge']({},_0x28a27c,_0x28d124[_0x7b94('0x55')]);return db[_0x7b94('0x67')][_0x7b94('0x2f')]({'where':_0x28a27c[_0x7b94('0x4b')]})[_0x7b94('0x33')](function(_0x530a83){_0x491c40[_0x7b94('0x2f')]=_0x530a83;if(_0x28d124[_0x7b94('0x40')][_0x7b94('0x5c')]){_0x28a27c[_0x7b94('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x7b94('0x57')](_0x28a27c);})[_0x7b94('0x33')](function(_0x1c82c5){_0x491c40['rows']=_0x1c82c5;return _0x491c40;});}})[_0x7b94('0x33')](respondWithFilteredResult(_0x43e4bf,_0x28a27c))[_0x7b94('0x2a')](handleError(_0x43e4bf,null));};exports[_0x7b94('0x69')]=function(_0x106385,_0x233245,_0x25c991){var _0x543bbd;return db[_0x7b94('0x3d')][_0x7b94('0x5d')]({'where':{'id':_0x106385[_0x7b94('0x5a')]['id']}})['then'](handleEntityNotFound(_0x233245,null))[_0x7b94('0x33')](function(_0xbf20db){if(_0xbf20db){return _0xbf20db[_0x7b94('0x69')](_0x106385[_0x7b94('0x40')][_0x7b94('0x6a')]);}})[_0x7b94('0x33')](respondWithStatusCode(_0x233245,null))['catch'](handleError(_0x233245,null));};exports[_0x7b94('0x6b')]=function(_0x3389ed,_0x3c08be,_0x1942fe){if(_0x3389ed['body']['id']){delete _0x3389ed[_0x7b94('0x63')]['id'];}return db[_0x7b94('0x3d')][_0x7b94('0x5d')]({'where':{'id':_0x3389ed[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x3c08be,null))[_0x7b94('0x33')](function(_0xe69459){if(_0xe69459){_0x3389ed['body'][_0x7b94('0x66')]=_0xe69459['id'];return db['CannedAnswer'][_0x7b94('0x5e')](_0x3389ed['body']);}})[_0x7b94('0x33')](respondWithResult(_0x3c08be,null))[_0x7b94('0x2a')](handleError(_0x3c08be,null));};exports[_0x7b94('0x6c')]=function(_0x4313a2,_0x109579,_0x18e396){var _0x4020ee={'raw':![],'where':{}};var _0x476091={};var _0x1eb32e={'count':0x0,'rows':[]};return db[_0x7b94('0x3d')][_0x7b94('0x68')]({'where':{'id':_0x4313a2[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x109579,null))[_0x7b94('0x33')](function(_0x546323){if(_0x546323){_0x476091['model']=_[_0x7b94('0x3f')](db[_0x7b94('0x6d')][_0x7b94('0x3e')]);_0x476091[_0x7b94('0x40')]=_[_0x7b94('0x3f')](_0x4313a2[_0x7b94('0x40')]);_0x476091[_0x7b94('0x4c')]=_['intersection'](_0x476091[_0x7b94('0x42')],_0x476091['query']);_0x4020ee[_0x7b94('0x43')]=_['intersection'](_0x476091[_0x7b94('0x42')],qs[_0x7b94('0x44')](_0x4313a2[_0x7b94('0x40')][_0x7b94('0x44')]));_0x4020ee[_0x7b94('0x43')]=_0x4020ee[_0x7b94('0x43')][_0x7b94('0x5b')]?_0x4020ee[_0x7b94('0x43')]:_0x476091[_0x7b94('0x42')];if(!_0x4313a2[_0x7b94('0x40')][_0x7b94('0x45')](_0x7b94('0x46'))){_0x4020ee[_0x7b94('0x47')]=qs[_0x7b94('0x47')](_0x4313a2[_0x7b94('0x40')][_0x7b94('0x47')]);_0x4020ee['offset']=qs[_0x7b94('0x48')](_0x4313a2['query'][_0x7b94('0x48')]);}_0x4020ee['order']=qs[_0x7b94('0x4a')](_0x4313a2[_0x7b94('0x40')][_0x7b94('0x4a')]);_0x4020ee[_0x7b94('0x4b')]=qs['filters'](_[_0x7b94('0x4d')](_0x4313a2[_0x7b94('0x40')],_0x476091[_0x7b94('0x4c')]));_0x4020ee[_0x7b94('0x4b')][_0x7b94('0x66')]=_0x546323['id'];if(_0x4313a2[_0x7b94('0x40')][_0x7b94('0x4e')]){_0x4020ee[_0x7b94('0x4b')]=_[_0x7b94('0x4f')](_0x4020ee[_0x7b94('0x4b')],{'$or':_[_0x7b94('0x50')](_0x4020ee[_0x7b94('0x43')],function(_0xfab197){var _0x4a8525={};_0x4a8525[_0xfab197]={'$like':'%'+_0x4313a2['query'][_0x7b94('0x4e')]+'%'};return _0x4a8525;})});}_0x4020ee=_['merge']({},_0x4020ee,_0x4313a2[_0x7b94('0x55')]);return db['CannedAnswer'][_0x7b94('0x2f')]({'where':_0x4020ee['where']})[_0x7b94('0x33')](function(_0x15a076){_0x1eb32e[_0x7b94('0x2f')]=_0x15a076;if(_0x4313a2[_0x7b94('0x40')][_0x7b94('0x5c')]){_0x4020ee[_0x7b94('0x56')]=[{'all':!![]}];}return db[_0x7b94('0x6d')][_0x7b94('0x57')](_0x4020ee);})[_0x7b94('0x33')](function(_0x4036d2){_0x1eb32e[_0x7b94('0x58')]=_0x4036d2;return _0x1eb32e;});}})['then'](respondWithFilteredResult(_0x109579,_0x4020ee))['catch'](handleError(_0x109579,null));};exports[_0x7b94('0x6e')]=function(_0x3592f3,_0x216046,_0x52e36a){var _0xffee96;return db[_0x7b94('0x3d')][_0x7b94('0x5d')]({'where':{'id':_0x3592f3['params']['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x216046,null))['then'](function(_0x52caa2){if(_0x52caa2){return _0x52caa2[_0x7b94('0x6e')](_0x3592f3[_0x7b94('0x40')]['ids']);}})[_0x7b94('0x33')](respondWithStatusCode(_0x216046,null))[_0x7b94('0x2a')](handleError(_0x216046,null));};exports[_0x7b94('0x6f')]=function(_0x186028,_0xe5d85f,_0x513055){_0x186028[_0x7b94('0x63')][_0x7b94('0x70')]=_0x186028[_0x7b94('0x71')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x186028['params']['id']}})['then'](handleEntityNotFound(_0xe5d85f,null))[_0x7b94('0x33')](saveUpdates(_0x186028[_0x7b94('0x63')],null))[_0x7b94('0x33')](respondWithResult(_0xe5d85f,null))[_0x7b94('0x2a')](handleError(_0xe5d85f,null));};exports[_0x7b94('0x72')]=function(_0x17feab,_0x3b4fc0,_0x1e64e9){_0x17feab[_0x7b94('0x63')][_0x7b94('0x73')]=_0x17feab[_0x7b94('0x71')][_0x7b94('0x74')];return db['ChatWebsite'][_0x7b94('0x5d')]({'where':{'id':_0x17feab['params']['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x3b4fc0,null))[_0x7b94('0x33')](saveUpdates(_0x17feab[_0x7b94('0x63')],null))['then'](respondWithResult(_0x3b4fc0,null))['catch'](handleError(_0x3b4fc0,null));};exports['addCustomerAvatar']=function(_0x1caf1e,_0x5d38ef,_0x1d2135){_0x1caf1e[_0x7b94('0x63')][_0x7b94('0x75')]=_0x1caf1e[_0x7b94('0x71')]['filename'];return db['ChatWebsite'][_0x7b94('0x5d')]({'where':{'id':_0x1caf1e[_0x7b94('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5d38ef,null))[_0x7b94('0x33')](saveUpdates(_0x1caf1e['body'],null))['then'](respondWithResult(_0x5d38ef,null))[_0x7b94('0x2a')](handleError(_0x5d38ef,null));};exports[_0x7b94('0x76')]=function(_0x41d550,_0xa1cd46,_0x307d84){_0x41d550['body'][_0x7b94('0x77')]=_0x41d550[_0x7b94('0x71')][_0x7b94('0x74')];return db[_0x7b94('0x3d')]['find']({'where':{'id':_0x41d550[_0x7b94('0x5a')]['id']}})['then'](handleEntityNotFound(_0xa1cd46,null))[_0x7b94('0x33')](saveUpdates(_0x41d550[_0x7b94('0x63')],null))[_0x7b94('0x33')](respondWithResult(_0xa1cd46,null))['catch'](handleError(_0xa1cd46,null));};exports[_0x7b94('0x78')]=function(_0x26b461,_0x1ef106,_0x5c9099){var _0x1498a5=path['join'](config['root'],_0x7b94('0x79'));var _0x49f92d={'where':{'id':_0x26b461['params']['id']},'attributes':['id',_0x7b94('0x70')],'raw':!![]};var _0xfd6833=![];return require(_0x7b94('0x7a'))[_0x7b94('0x7b')]()[_0x7b94('0x33')](function(_0x1d9123){if(_0x1d9123){_0xfd6833=_0x1d9123[_0x7b94('0x7c')];}})[_0x7b94('0x33')](function(){return db[_0x7b94('0x3d')][_0x7b94('0x5d')](_0x49f92d);})[_0x7b94('0x33')](handleEntityNotFound(_0x1ef106,null))[_0x7b94('0x33')](function(_0x43b963){if(_0x43b963){if(!_['isNil'](_0x43b963['sitepic'])){if(fs['existsSync'](path[_0x7b94('0x7d')](config[_0x7b94('0x7e')],'server/files/images/logos/',_0x43b963[_0x7b94('0x70')]))&&_0xfd6833){_0x1498a5=path[_0x7b94('0x7d')](config[_0x7b94('0x7e')],'server/files/images/logos/',_0x43b963[_0x7b94('0x70')]);}}return _0x1ef106[_0x7b94('0x7f')](_0x1498a5);}})[_0x7b94('0x2a')](handleError(_0x1ef106,null));};exports[_0x7b94('0x80')]=function(_0x4b7436,_0x3b9014,_0x40fc4f){var _0xdf1002=path[_0x7b94('0x7d')](config[_0x7b94('0x7e')],_0x7b94('0x81'));var _0x1de2ed={'where':{'id':_0x4b7436['params']['id']},'attributes':['id',_0x7b94('0x73')],'raw':!![]};return db['ChatWebsite'][_0x7b94('0x5d')](_0x1de2ed)['then'](handleEntityNotFound(_0x3b9014,null))[_0x7b94('0x33')](function(_0x23474b){if(_0x23474b){if(!_[_0x7b94('0x82')](_0x23474b[_0x7b94('0x73')])){if(fs[_0x7b94('0x83')](path[_0x7b94('0x7d')](config[_0x7b94('0x7e')],_0x7b94('0x84'),_0x23474b[_0x7b94('0x73')]))){_0xdf1002=path[_0x7b94('0x7d')](config[_0x7b94('0x7e')],_0x7b94('0x84'),_0x23474b['agentAvatar']);}}return _0x3b9014['download'](_0xdf1002);}})[_0x7b94('0x2a')](handleError(_0x3b9014,null));};exports['getCustomerAvatar']=function(_0x1a987f,_0x2e571a,_0x1aef76){var _0x5ba8bd=path[_0x7b94('0x7d')](config[_0x7b94('0x7e')],_0x7b94('0x85'));var _0x13c075={'where':{'id':_0x1a987f[_0x7b94('0x5a')]['id']},'attributes':['id','customerAvatar',_0x7b94('0x86')],'raw':!![]};return db[_0x7b94('0x3d')][_0x7b94('0x5d')](_0x13c075)[_0x7b94('0x33')](handleEntityNotFound(_0x2e571a,null))[_0x7b94('0x33')](function(_0x4e3875){if(_0x4e3875){if(!_[_0x7b94('0x82')](_0x4e3875['customerAvatar'])){if(fs[_0x7b94('0x83')](path['join'](config[_0x7b94('0x7e')],_0x7b94('0x84'),_0x4e3875[_0x7b94('0x75')]))&&_0x4e3875['showCustomerAvatar']){_0x5ba8bd=path[_0x7b94('0x7d')](config[_0x7b94('0x7e')],_0x7b94('0x84'),_0x4e3875['customerAvatar']);}}return _0x2e571a[_0x7b94('0x7f')](_0x5ba8bd);}})[_0x7b94('0x2a')](handleError(_0x2e571a,null));};exports[_0x7b94('0x87')]=function(_0x22d9b1,_0x545cd,_0x2579c7){var _0x23a2f1=path[_0x7b94('0x7d')](config[_0x7b94('0x7e')],_0x7b94('0x88'));var _0x22ff05={'where':{'id':_0x22d9b1['params']['id']},'attributes':['id',_0x7b94('0x77')],'raw':!![]};return db[_0x7b94('0x3d')]['find'](_0x22ff05)[_0x7b94('0x33')](handleEntityNotFound(_0x545cd,null))[_0x7b94('0x33')](function(_0x155121){if(_0x155121){if(!_[_0x7b94('0x82')](_0x155121[_0x7b94('0x77')])){if(fs[_0x7b94('0x83')](path[_0x7b94('0x7d')](config[_0x7b94('0x7e')],_0x7b94('0x84'),_0x155121[_0x7b94('0x77')]))){_0x23a2f1=path[_0x7b94('0x7d')](config['root'],_0x7b94('0x84'),_0x155121[_0x7b94('0x77')]);}}return _0x545cd[_0x7b94('0x7f')](_0x23a2f1);}})['catch'](handleError(_0x545cd,null));};exports['notify']=function(_0x398bc8,_0x12d113,_0x53d967){var _0x5b47ae=require('user-agent-parser');var _0x1a8ac0=new _0x5b47ae();var _0x1bc1d6=_0x1a8ac0['setUA'](_0x398bc8[_0x7b94('0x89')][_0x7b94('0x8a')])['getResult']();var _0x47b0e4={'body':_0x398bc8['body'],'channel':'chat'};var _0x51c46f=[];var _0x27b777=[];var _0x25b9cb={};var _0x3763a1=![];return db[_0x7b94('0x8b')][_0x7b94('0x64')]()[_0x7b94('0x33')](function(_0x410c61){if(!_0x410c61){throw new db['Sequelize'][(_0x7b94('0x8c'))](_0x7b94('0x8d'));}_0x51c46f=_[_0x7b94('0x8e')](_[_0x7b94('0x3f')](_0x410c61),[_0x7b94('0x8f'),_0x7b94('0x90')]);_0x27b777=_[_0x7b94('0x8e')](_['keys'](_0x410c61),[_0x7b94('0x8f'),'updatedAt',_0x7b94('0x91'),'ListId']);if(_0x398bc8[_0x7b94('0x63')]['id']){delete _0x398bc8['body']['id'];}if(_[_0x7b94('0x82')](_0x398bc8[_0x7b94('0x63')][_0x7b94('0x92')])){throw new db[(_0x7b94('0x93'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x398bc8[_0x7b94('0x63')][_0x7b94('0x63')])||_0x398bc8[_0x7b94('0x63')][_0x7b94('0x63')]===''){throw new db[(_0x7b94('0x93'))][(_0x7b94('0x8c'))](_0x7b94('0x94'));}if(_[_0x7b94('0x82')](_0x398bc8[_0x7b94('0x63')][_0x7b94('0x95')])){throw new db[(_0x7b94('0x93'))]['ValidationError'](_0x7b94('0x96')+_0x27b777);}if(!_[_0x7b94('0x97')](_0x27b777,_0x398bc8[_0x7b94('0x63')][_0x7b94('0x95')])){throw new db[(_0x7b94('0x93'))]['ValidationError'](_0x7b94('0x98')+_0x27b777);}_0x25b9cb[_0x398bc8[_0x7b94('0x63')][_0x7b94('0x95')]]=_0x398bc8[_0x7b94('0x63')][_0x7b94('0x92')];})[_0x7b94('0x33')](function(){return db[_0x7b94('0x3d')][_0x7b94('0x5d')]({'where':{'id':_0x398bc8[_0x7b94('0x5a')]['id']},'include':[{'model':db[_0x7b94('0x99')],'as':_0x7b94('0x9a'),'include':[{'model':db[_0x7b94('0x8b')],'as':'Contacts','where':_0x25b9cb,'limit':0x1,'order':[['updatedAt',_0x7b94('0x9b')]]}]},{'model':db['ChatApplication'],'as':_0x7b94('0x9c')}]});})[_0x7b94('0x33')](handleEntityNotFound(_0x12d113,null))['then'](function(_0x22d5ff){if(_0x22d5ff&&_0x22d5ff[_0x7b94('0x9a')]){_0x47b0e4['account']=_0x22d5ff;_0x47b0e4['applications']=_0x22d5ff[_0x7b94('0x9c')];_0x47b0e4['list']=_0x22d5ff['List'];_0x47b0e4[_0x7b94('0x9d')]=_['orderBy'](_0x47b0e4[_0x7b94('0x9d')],[_0x7b94('0x9e')],[_0x7b94('0x9f')]);if(_0x47b0e4[_0x7b94('0xa0')][_0x7b94('0x9c')]){delete _0x47b0e4['account'][_0x7b94('0x9c')];}if(_0x47b0e4[_0x7b94('0xa0')][_0x7b94('0x9a')]&&_0x47b0e4[_0x7b94('0xa0')][_0x7b94('0x9a')][_0x7b94('0xa1')][_0x7b94('0x5b')]){return _0x47b0e4[_0x7b94('0xa0')][_0x7b94('0x9a')][_0x7b94('0xa1')][0x0];}var _0x51e7ca=_[_0x7b94('0x17')](_0x398bc8[_0x7b94('0x63')],{'firstName':_0x398bc8['body'][_0x7b94('0x92')],'ListId':_0x22d5ff[_0x7b94('0xa2')]});_0x51e7ca[_0x398bc8[_0x7b94('0x63')][_0x7b94('0x95')]]=_0x398bc8['body'][_0x7b94('0x92')];return db[_0x7b94('0x8b')][_0x7b94('0x5e')](_0x51e7ca,{'fields':_0x51c46f,'raw':!![]});}})[_0x7b94('0x33')](handleEntityNotFound(_0x12d113,null))[_0x7b94('0x33')](function(_0x4d3ead){_0x47b0e4['contact']=_0x4d3ead;if(_0x4d3ead){var _0x72cb5e={'ContactId':_0x4d3ead['id'],'ChatWebsiteId':_0x398bc8['params']['id'],'from':(_0x4d3ead['firstName']||'')+'\x20'+(_0x4d3ead[_0x7b94('0xa3')]||''),'customerIp':_0x398bc8[_0x7b94('0x63')]['customerIp'],'referer':_0x398bc8['body'][_0x7b94('0xa4')],'browserName':_0x1bc1d6[_0x7b94('0xa5')][_0x7b94('0x38')]&&_0x1bc1d6[_0x7b94('0xa5')][_0x7b94('0xa6')]?util[_0x7b94('0xa7')](_0x7b94('0xa8'),_0x1bc1d6['browser'][_0x7b94('0x38')],_0x1bc1d6['browser']['version']):_0x7b94('0xa9'),'browserVersion':_0x1bc1d6[_0x7b94('0xa5')][_0x7b94('0xa6')]||'unknown','osName':util[_0x7b94('0xa7')](_0x7b94('0xa8'),_0x1bc1d6['os'][_0x7b94('0x38')],_0x1bc1d6['os']['version']),'osVersion':_0x1bc1d6['os'][_0x7b94('0xa6')],'deviceModel':_0x1bc1d6['device'][_0x7b94('0x42')]&&_0x1bc1d6[_0x7b94('0xaa')]['vendor']?util['format'](_0x7b94('0xab'),_0x1bc1d6['device']['model'],_0x1bc1d6[_0x7b94('0xaa')]['vendor'],_0x1bc1d6['device'][_0x7b94('0x51')]):null,'deviceVendor':_0x1bc1d6['device']['vendor'],'deviceType':_0x1bc1d6[_0x7b94('0xaa')][_0x7b94('0x51')],'formData':JSON[_0x7b94('0x24')](_0x398bc8[_0x7b94('0x63')])};var _0x136f3a={'ChatWebsiteId':_0x398bc8[_0x7b94('0x5a')]['id'],'closed':![]};if(_0x398bc8[_0x7b94('0x63')]['threadId']){_0x136f3a[_0x7b94('0xac')]=_0x398bc8[_0x7b94('0x63')][_0x7b94('0xac')];return db[_0x7b94('0xad')][_0x7b94('0x5d')]({'where':_0x136f3a})[_0x7b94('0x33')](function(_0x209b3d){if(_0x209b3d){return[_0x209b3d,![]];}_0x72cb5e[_0x7b94('0xac')]=_0x398bc8[_0x7b94('0x63')][_0x7b94('0xac')];_0x72cb5e[_0x7b94('0xae')]=_0x398bc8[_0x7b94('0x63')]['externalUrl'];return db[_0x7b94('0xad')][_0x7b94('0x5e')](_0x72cb5e)['then'](function(_0x1ceba2){return[_0x1ceba2,!![]];});});}_0x136f3a['ContactId']=_0x4d3ead['id'];if(_0x398bc8[_0x7b94('0x63')][_0x7b94('0xaf')]&&_0x398bc8[_0x7b94('0x63')][_0x7b94('0xaf')]['id']){_0x136f3a['id']=_0x398bc8['body']['interaction']['id'];return db['ChatInteraction'][_0x7b94('0x5d')]({'where':_0x136f3a})[_0x7b94('0x33')](function(_0x545877){if(_0x545877){return[_0x545877,![]];}return db[_0x7b94('0xad')]['create'](_0x72cb5e)[_0x7b94('0x33')](function(_0x5a57be){return[_0x5a57be,!![]];});});}return db[_0x7b94('0xad')][_0x7b94('0x5e')](_0x72cb5e)[_0x7b94('0x33')](function(_0xc10eba){return[_0xc10eba,!![]];});}})['spread'](function(_0x304e76,_0x4fddf7){if(_0x304e76){_0x3763a1=_0x4fddf7;if(!_0x4fddf7){var _0x52b995={'from':(_0x47b0e4[_0x7b94('0xb0')][_0x7b94('0xb1')]||'')+'\x20'+(_0x47b0e4[_0x7b94('0xb0')][_0x7b94('0xa3')]||'')};if(_0x398bc8[_0x7b94('0x63')][_0x7b94('0xac')]&&_0x398bc8[_0x7b94('0x63')][_0x7b94('0xb2')]&&_0x398bc8[_0x7b94('0x63')][_0x7b94('0xac')]!=_0x398bc8[_0x7b94('0x63')][_0x7b94('0xb2')]){_0x52b995[_0x7b94('0xac')]=_0x398bc8[_0x7b94('0x63')][_0x7b94('0xb2')];}return _0x304e76[_0x7b94('0x32')](_0x52b995);}else{return _0x304e76;}}})['then'](function(_0x4d00d9){_0x47b0e4[_0x7b94('0xaf')]=_0x4d00d9[_0x7b94('0x35')]({'plain':!![]});_0x47b0e4[_0x7b94('0xaf')]['created']=_0x3763a1;if(_0x47b0e4['interaction'][_0x7b94('0xb3')]){if(_0x47b0e4[_0x7b94('0xa0')][_0x7b94('0xb4')]){_0x47b0e4[_0x7b94('0x9d')][_0x7b94('0xb5')]({'id':0x0,'priority':_0x47b0e4[_0x7b94('0x9d')]['length']+0x1,'app':_0x7b94('0xb6'),'appdata':_0x7b94('0xb7'),'interval':'*,*,*,*'});}}return db[_0x7b94('0xb8')][_0x7b94('0x5e')]({'body':_0x398bc8[_0x7b94('0x63')][_0x7b94('0x63')],'ChatWebsiteId':_0x398bc8[_0x7b94('0x5a')]['id'],'ChatInteractionId':_0x4d00d9['id'],'direction':'in','ContactId':_0x47b0e4[_0x7b94('0xb0')]['id'],'AttachmentId':_0x398bc8[_0x7b94('0x63')][_0x7b94('0xb9')]});})['then'](function(_0x25379e){_0x47b0e4[_0x7b94('0x27')]=_0x25379e;if(_0x47b0e4[_0x7b94('0xaf')]['UserId']){return db[_0x7b94('0xba')]['find']({'attributes':['id',_0x7b94('0x38')],'where':{'id':_0x47b0e4[_0x7b94('0xaf')][_0x7b94('0xbb')]}})[_0x7b94('0x33')](function(_0x502fb8){if(_0x502fb8){_0x47b0e4[_0x7b94('0x9d')][_0x7b94('0xbc')]({'id':0x0,'priority':0x0,'app':_0x7b94('0xbd'),'appdata':_0x502fb8[_0x7b94('0x38')]+','+(_0x47b0e4[_0x7b94('0xa0')][_0x7b94('0xbe')]||0xa),'interval':_0x7b94('0xbf')});_0x47b0e4[_0x7b94('0xc0')]=!![];}return respondWithRpcPromise(_0x7b94('0xc1'),'startRouting',_0x47b0e4);});}return respondWithRpcPromise(_0x7b94('0xc1'),_0x7b94('0xc2'),_0x47b0e4);})[_0x7b94('0x33')](function(_0x343869){respondWithRpcPromise(_0x7b94('0xc3'),_0x7b94('0xc3'),{'event':_0x7b94('0xc4'),'message':_0x343869},client9002);return _0x343869;})[_0x7b94('0x33')](respondWithResult(_0x12d113,null))[_0x7b94('0x2a')](handleError(_0x12d113,null));};exports[_0x7b94('0xc5')]=function(_0x356f90,_0x46294f,_0x483ec7){var _0x2184ea,_0x324e66,_0x8959d9;var _0x1c5c3f=[];var _0x3c31da=[];var _0x26aad1={};return db[_0x7b94('0x8b')][_0x7b94('0x64')]()[_0x7b94('0x33')](function(_0x3ea19d){if(!_0x3ea19d){throw new db[(_0x7b94('0x93'))][(_0x7b94('0x8c'))](_0x7b94('0x8d'));}_0x3c31da=_[_0x7b94('0x8e')](_[_0x7b94('0x3f')](_0x3ea19d),[_0x7b94('0x8f'),_0x7b94('0x90')]);_0x1c5c3f=_[_0x7b94('0x8e')](_[_0x7b94('0x3f')](_0x3ea19d),[_0x7b94('0x8f'),_0x7b94('0x90'),_0x7b94('0x91'),_0x7b94('0xa2')]);if(_0x356f90[_0x7b94('0x63')]['id']){delete _0x356f90[_0x7b94('0x63')]['id'];}if(_[_0x7b94('0x82')](_0x356f90[_0x7b94('0x63')][_0x7b94('0x92')])){throw _0x46294f[_0x7b94('0x2c')](0x1f4)[_0x7b94('0x39')](new db[(_0x7b94('0x93'))][(_0x7b94('0x8c'))]('from\x20is\x20mandatory'));}if(_[_0x7b94('0x82')](_0x356f90[_0x7b94('0x63')][_0x7b94('0x63')])||_0x356f90['body'][_0x7b94('0x63')]===''){throw _0x46294f[_0x7b94('0x2c')](0x1f4)[_0x7b94('0x39')](new db[(_0x7b94('0x93'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x7b94('0x82')](_0x356f90['body'][_0x7b94('0xc6')])){throw _0x46294f['status'](0x1f4)[_0x7b94('0x39')](new db[(_0x7b94('0x93'))][(_0x7b94('0x8c'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c5c3f));}if(!_[_0x7b94('0x97')](_0x1c5c3f,_0x356f90[_0x7b94('0x63')][_0x7b94('0xc6')])){throw _0x46294f[_0x7b94('0x2c')](0x1f4)[_0x7b94('0x39')](new db['Sequelize'][(_0x7b94('0x8c'))](_0x7b94('0xc7')+_0x1c5c3f));}_0x26aad1[_0x356f90[_0x7b94('0x63')]['mapKeyOffline']]=_0x356f90[_0x7b94('0x63')][_0x7b94('0x92')];})[_0x7b94('0x33')](function(){return db[_0x7b94('0x3d')][_0x7b94('0x5d')]({'where':{'id':_0x356f90[_0x7b94('0x5a')]['id']},'include':[{'model':db[_0x7b94('0x99')],'as':_0x7b94('0x9a')}]});})['then'](handleEntityNotFound(_0x46294f,null))[_0x7b94('0x33')](function(_0x574159){if(_0x574159&&_0x574159[_0x7b94('0x9a')]){_0x324e66=_0x574159;var _0x4f8ab0=_[_0x7b94('0x17')](_0x356f90[_0x7b94('0x63')],{'firstName':_0x356f90[_0x7b94('0x63')][_0x7b94('0x92')],'phone':_0x356f90['body'][_0x7b94('0x92')],'ListId':_0x574159[_0x7b94('0xa2')]});_0x4f8ab0[_0x356f90[_0x7b94('0x63')]['mapKeyOffline']]=_0x356f90[_0x7b94('0x63')][_0x7b94('0x92')];return db[_0x7b94('0x8b')]['findOrCreate']({'where':_0x26aad1,'defaults':_0x4f8ab0});}})[_0x7b94('0xc8')](function(_0x3398a9){if(_0x3398a9){_0x8959d9=_0x3398a9;var _0x3a8b45=fs[_0x7b94('0xc9')](path['join'](config[_0x7b94('0x7e')],_0x7b94('0xca')),_0x7b94('0xcb'));var _0x3f4a49=ejs[_0x7b94('0xcc')](_0x3a8b45,{'body':_[_0x7b94('0xcd')](_0x356f90[_0x7b94('0x63')]['body']),'bodyTitle':_0x324e66[_0x7b94('0xce')]});return db[_0x7b94('0xcf')][_0x7b94('0x5e')]({'body':_0x3f4a49,'ContactId':_0x3398a9['id'],'ChatWebsiteId':_0x324e66['id']});}})['then'](function(_0x3b5c7e){if(_0x3b5c7e){_0x2184ea=_0x3b5c7e;return db['MailAccount'][_0x7b94('0x68')]({'where':{'service':!![]},'include':[{'model':db[_0x7b94('0xd0')],'as':_0x7b94('0xd1'),'raw':!![]}]});}})['then'](function(_0x123996){if(_0x123996&&_0x123996[_0x7b94('0xd1')]&&_0x324e66[_0x7b94('0xd2')]){var _0x468f81={'tls':{'rejectUnauthorized':![]}};if(_0x123996['Smtp']['service']){_0x468f81[_0x7b94('0xd3')]=_0x123996[_0x7b94('0xd1')][_0x7b94('0xd3')];}else{_0x468f81[_0x7b94('0xd4')]=_0x123996[_0x7b94('0xd1')]['host'];_0x468f81[_0x7b94('0xd5')]=_0x123996[_0x7b94('0xd1')]['port'];_0x468f81['secure']=_0x123996[_0x7b94('0xd1')]['secure'];}if(_0x123996[_0x7b94('0xd1')][_0x7b94('0xd6')]){_0x468f81[_0x7b94('0xd7')]={'user':_0x123996[_0x7b94('0xd1')]['user'],'pass':_0x123996[_0x7b94('0xd1')][_0x7b94('0xd8')]};}return respondWithRpcPromise(_0x7b94('0xd9'),'sendMail',{'account':_0x468f81,'message':{'from':util['format'](_0x7b94('0xda'),_0x123996['name'],_0x123996[_0x7b94('0xdb')]||_0x123996[_0x7b94('0xd1')]['user']),'to':_0x324e66[_0x7b94('0xd2')],'subject':_0x324e66[_0x7b94('0xdc')],'text':_0x2184ea[_0x7b94('0x63')]}},client9003)['then'](function(){return _0x2184ea;})['catch'](function(_0x283d5c){console[_0x7b94('0x25')](_0x283d5c);});}})[_0x7b94('0x33')](function(){if(_0x2184ea){return _0x2184ea;}})[_0x7b94('0x33')](respondWithResult(_0x46294f,null))['catch'](handleError(_0x46294f,null));};exports[_0x7b94('0xdd')]=function(_0x17a722,_0x53e854,_0x3010e6){return db['ChatInteraction'][_0x7b94('0x5d')]({'where':{'id':_0x17a722[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x53e854,null))[_0x7b94('0x33')](function(_0x16a60f){if(_0x16a60f){return _0x16a60f[_0x7b94('0xdd')](_0x17a722[_0x7b94('0x63')]['ids'],_[_0x7b94('0xde')](_0x17a722['body'],['ids','id'])||{});}})[_0x7b94('0x33')](respondWithResult(_0x53e854,null))[_0x7b94('0x2a')](handleError(_0x53e854,null));};exports[_0x7b94('0xdf')]=function(_0x299b6a,_0xfcd70e,_0x572ab8){var _0x33e8a4={'raw':![],'where':{}};var _0x5de368={};var _0x437fe0={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x299b6a[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0xfcd70e,null))['then'](function(_0x2a80df){if(_0x2a80df){_0x5de368['model']=_[_0x7b94('0x3f')](db[_0x7b94('0xad')][_0x7b94('0x3e')]);_0x5de368['query']=_[_0x7b94('0x3f')](_0x299b6a[_0x7b94('0x40')]);_0x5de368[_0x7b94('0x4c')]=_[_0x7b94('0x41')](_0x5de368[_0x7b94('0x42')],_0x5de368[_0x7b94('0x40')]);_0x33e8a4[_0x7b94('0x43')]=_[_0x7b94('0x41')](_0x5de368['model'],qs[_0x7b94('0x44')](_0x299b6a[_0x7b94('0x40')][_0x7b94('0x44')]));_0x33e8a4[_0x7b94('0x43')]=_0x33e8a4[_0x7b94('0x43')][_0x7b94('0x5b')]?_0x33e8a4['attributes']:_0x5de368[_0x7b94('0x42')];if(!_0x299b6a['query'][_0x7b94('0x45')](_0x7b94('0x46'))){_0x33e8a4[_0x7b94('0x47')]=qs['limit'](_0x299b6a[_0x7b94('0x40')][_0x7b94('0x47')]);_0x33e8a4[_0x7b94('0x48')]=qs[_0x7b94('0x48')](_0x299b6a[_0x7b94('0x40')][_0x7b94('0x48')]);}_0x33e8a4['order']=qs['sort'](_0x299b6a[_0x7b94('0x40')][_0x7b94('0x4a')]);_0x33e8a4[_0x7b94('0x4b')]=qs[_0x7b94('0x4c')](_['pick'](_0x299b6a[_0x7b94('0x40')],_0x5de368[_0x7b94('0x4c')]));_0x33e8a4[_0x7b94('0x4b')][_0x7b94('0x66')]=_0x2a80df['id'];if(_0x299b6a[_0x7b94('0x40')][_0x7b94('0x4e')]){_0x33e8a4[_0x7b94('0x4b')]=_['merge'](_0x33e8a4['where'],{'$or':_[_0x7b94('0x50')](_0x33e8a4['attributes'],function(_0x4c6504){var _0x4a4315={};_0x4a4315[_0x4c6504]={'$like':'%'+_0x299b6a[_0x7b94('0x40')]['filter']+'%'};return _0x4a4315;})});}_0x33e8a4=_[_0x7b94('0x4f')]({},_0x33e8a4,_0x299b6a[_0x7b94('0x55')]);return db[_0x7b94('0xad')]['count']({'where':_0x33e8a4[_0x7b94('0x4b')]})[_0x7b94('0x33')](function(_0xd4ee9){_0x437fe0[_0x7b94('0x2f')]=_0xd4ee9;if(_0x299b6a[_0x7b94('0x40')][_0x7b94('0x5c')]){_0x33e8a4[_0x7b94('0x56')]=[{'model':db[_0x7b94('0x8b')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x7b94('0xe0'),'attributes':[_0x7b94('0x38'),_0x7b94('0xe1'),'internal'],'required':![]},{'model':db[_0x7b94('0xe2')],'as':_0x7b94('0xe3'),'attributes':['id',_0x7b94('0x38'),'color'],'where':_0x299b6a[_0x7b94('0x40')][_0x7b94('0xe4')]?{'id':_0x299b6a[_0x7b94('0x40')][_0x7b94('0xe4')]}:undefined,'required':_0x299b6a[_0x7b94('0x40')][_0x7b94('0xe4')]?!![]:![]}];}return db[_0x7b94('0xad')][_0x7b94('0x57')](_0x33e8a4);})[_0x7b94('0x33')](function(_0x59ccce){_0x437fe0[_0x7b94('0x58')]=_0x59ccce;return _0x437fe0;});}})[_0x7b94('0x33')](respondWithFilteredResult(_0xfcd70e,_0x33e8a4))[_0x7b94('0x2a')](handleError(_0xfcd70e,null));};function iftimePromise(_0x454cf9,_0x247bbe){return respondWithRpcPromise('Command',_0x7b94('0xe5'),{'command':_0x247bbe[_0x7b94('0xe6')]?util[_0x7b94('0xa7')](_0x7b94('0xe7'),_0x454cf9[_0x7b94('0xe8')],_0x247bbe[_0x7b94('0xe6')]):util[_0x7b94('0xa7')]('iftime\x20%s',_0x454cf9[_0x7b94('0xe8')])},client9002)[_0x7b94('0x33')](function(_0x2cd415){var _0x1a0365=_0x2cd415&&_0x2cd415['indexOf']('true')>=0x0?!![]:![];logger[_0x7b94('0x20')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x247bbe['id'],_0x454cf9['id'],_0x454cf9[_0x7b94('0xe8')],_0x1a0365?'ONLINE':_0x7b94('0xe9'),_0x247bbe[_0x7b94('0xe6')]?_0x247bbe[_0x7b94('0xe6')]:_0x7b94('0xea'));return _0x1a0365;})[_0x7b94('0x2a')](function(_0x442da1){logger['error'](_0x7b94('0xeb'),_0x247bbe['id'],_0x454cf9['id'],_0x454cf9[_0x7b94('0xe8')],util[_0x7b94('0xec')](_0x442da1,{'showHidden':![],'depth':null}),_0x247bbe['timezone']?_0x247bbe[_0x7b94('0xe6')]:_0x7b94('0xea'));return![];});}exports[_0x7b94('0xe5')]=function(_0x2221b6,_0xf459e1,_0xce8cef){var _0x4fea73=0x0;var _0x1bac57=0x0;var _0x4c1d32=![];var _0x201367;var _0x154518;return db['ChatWebsite'][_0x7b94('0x5d')]({'where':{'id':_0x2221b6['params']['id']},'include':[{'model':db[_0x7b94('0xed')],'as':'Interval','include':[{'model':db[_0x7b94('0xed')],'as':_0x7b94('0xee'),'attributes':['id',_0x7b94('0xe8')],'raw':!![]}]}]})[_0x7b94('0x33')](handleEntityNotFound(_0xf459e1,null))[_0x7b94('0x33')](function(_0xe51fe2){if(_0xe51fe2){_0x201367=_0xe51fe2;return _0xe51fe2[_0x7b94('0xef')]({'raw':!![]});}})[_0x7b94('0x33')](function(_0x460070){if(_0x201367){if(_0x460070){_0x154518=_0x460070;}}return require('../../config/license/util')['getLicense']();})[_0x7b94('0x33')](function(_0x2cde13){if(_0x2cde13){_0x1bac57=_0x2cde13['virtual'];_0x4c1d32=_0x2cde13['custom'];}})[_0x7b94('0x33')](function(){return db['ChatInteraction'][_0x7b94('0x2f')]({'where':{'closed':![]}});})[_0x7b94('0x33')](function(_0x30aa54){_0x4fea73=_0x30aa54;if(_0x1bac57&&_0x30aa54>_0x1bac57){return db[_0x7b94('0xf0')][_0x7b94('0x68')]({'where':{'id':0x1}})[_0x7b94('0x33')](function(_0x3efcbd){if(_0x3efcbd){_0x3efcbd['increment']('chatLicenseExceeded');}});}})['then'](function(){if(_0x201367[_0x7b94('0xed')]&&_0x201367['Interval'][_0x7b94('0xee')]){var _0x36c300=[];for(var _0x538606=0x0;_0x538606<_0x201367[_0x7b94('0xed')]['Intervals'][_0x7b94('0x5b')];_0x538606++){var _0x1172ea=_0x201367[_0x7b94('0xed')][_0x7b94('0xee')][_0x538606][_0x7b94('0x35')]({'plain':!![]});_0x36c300['push'](iftimePromise(_0x1172ea,_0x201367));}return BPromise[_0x7b94('0xf1')](_0x36c300)['then'](function(_0x5dfad1){return _['some'](_0x5dfad1);});}else{return!![];}})[_0x7b94('0x33')](function(_0x2d9ab2){var _0x13eca8=fs[_0x7b94('0xc9')](path[_0x7b94('0x7d')](config[_0x7b94('0x7e')],_0x7b94('0xf2')),'utf8');var _0x42ecb5={'remote':_0x201367[_0x7b94('0xf3')],'query':querystring['stringify'](_['merge'](_0x201367[_0x7b94('0x35')]({'plain':!![]}),{'customerIp':_0x2221b6[_0x7b94('0x89')][_0x7b94('0xf4')]||_0x2221b6[_0x7b94('0x89')]['x-real-ip']||_0x2221b6[_0x7b94('0xf5')][_0x7b94('0xf6')]||_0x2221b6['ip'],'referer':_0x2221b6[_0x7b94('0x89')]['referer'],'openedInteractions':_0x4fea73,'maxInteractions':_0x1bac57,'virtual':_0x4c1d32['virtual'],'online':_0x2d9ab2,'custom':_0x4c1d32}))['replace'](/'/g,'\x5c\x27')};_0xf459e1[_0x7b94('0x39')](ejs[_0x7b94('0xcc')](Mustache[_0x7b94('0xcc')](_0x13eca8,_0x42ecb5),{'proactiveActions':_0x154518,'alignment':_0x201367['alignment'],'verticalAlignment':_0x201367['verticalAlignment']}));})[_0x7b94('0x2a')](handleError(_0xf459e1,null));};exports[_0x7b94('0xf7')]=function(_0x9be3a0,_0x225bbb,_0x279c9c){return db[_0x7b94('0x3d')][_0x7b94('0x68')]({'where':{'id':_0x9be3a0[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x225bbb,null))[_0x7b94('0x33')](function(_0x3351a5){if(_0x3351a5){return db[_0x7b94('0xf8')]['transaction'](function(_0xbda64d){return db['ChatApplication'][_0x7b94('0x34')]({'where':{'ChatWebsiteId':_0x9be3a0[_0x7b94('0x5a')]['id']},'transaction':_0xbda64d})[_0x7b94('0x33')](function(_0x43c0e2){var _0x4190bb=_[_0x7b94('0x50')](_0x9be3a0[_0x7b94('0x63')],function(_0x3bf217){_0x3bf217[_0x7b94('0x66')]=_0x9be3a0['params']['id'];return _0x3bf217;});return db[_0x7b94('0xf9')][_0x7b94('0xfa')](_0x4190bb,{'transaction':_0xbda64d});});})['then'](function(){return db[_0x7b94('0xf9')][_0x7b94('0xfb')]({'where':{'ChatWebsiteId':_0x9be3a0[_0x7b94('0x5a')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x225bbb,null))[_0x7b94('0x2a')](handleError(_0x225bbb,null));};exports[_0x7b94('0xfc')]=function(_0x44a7fd,_0x9d425c,_0x55a211){var _0x3a5131={};var _0x20a1a1={};var _0xabe354;var _0x56659e;return db[_0x7b94('0x3d')]['findOne']({'where':{'id':_0x44a7fd[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x9d425c,null))[_0x7b94('0x33')](function(_0x596c0e){if(_0x596c0e){_0xabe354=_0x596c0e;_0x20a1a1['model']=_[_0x7b94('0x3f')](db[_0x7b94('0xf9')][_0x7b94('0x3e')]);_0x20a1a1['query']=_[_0x7b94('0x3f')](_0x44a7fd['query']);_0x20a1a1[_0x7b94('0x4c')]=_[_0x7b94('0x41')](_0x20a1a1[_0x7b94('0x42')],_0x20a1a1['query']);_0x3a5131['attributes']=_[_0x7b94('0x41')](_0x20a1a1[_0x7b94('0x42')],qs['fields'](_0x44a7fd[_0x7b94('0x40')][_0x7b94('0x44')]));_0x3a5131[_0x7b94('0x43')]=_0x3a5131['attributes'][_0x7b94('0x5b')]?_0x3a5131[_0x7b94('0x43')]:_0x20a1a1[_0x7b94('0x42')];_0x3a5131[_0x7b94('0x49')]=qs[_0x7b94('0x4a')](_0x44a7fd[_0x7b94('0x40')][_0x7b94('0x4a')]);_0x3a5131[_0x7b94('0x4b')]=qs['filters'](_[_0x7b94('0x4d')](_0x44a7fd['query'],_0x20a1a1[_0x7b94('0x4c')]));if(_0x44a7fd[_0x7b94('0x40')][_0x7b94('0x4e')]){_0x3a5131[_0x7b94('0x4b')]=_[_0x7b94('0x4f')](_0x3a5131[_0x7b94('0x4b')],{'$or':_[_0x7b94('0x50')](_0x3a5131[_0x7b94('0x43')],function(_0x52c06e){var _0x127d77={};_0x127d77[_0x52c06e]={'$like':'%'+_0x44a7fd['query'][_0x7b94('0x4e')]+'%'};return _0x127d77;})});}_0x3a5131=_[_0x7b94('0x4f')]({},_0x3a5131,_0x44a7fd[_0x7b94('0x55')]);return _0xabe354[_0x7b94('0xfc')](_0x3a5131);}})['then'](function(_0x4f4bda){if(_0x4f4bda){_0x56659e=_0x4f4bda[_0x7b94('0x5b')];if(!_0x44a7fd[_0x7b94('0x40')][_0x7b94('0x45')]('nolimit')){_0x3a5131['limit']=qs[_0x7b94('0x47')](_0x44a7fd[_0x7b94('0x40')][_0x7b94('0x47')]);_0x3a5131[_0x7b94('0x48')]=qs[_0x7b94('0x48')](_0x44a7fd[_0x7b94('0x40')][_0x7b94('0x48')]);}return _0xabe354[_0x7b94('0xfc')](_0x3a5131);}})['then'](function(_0x226158){if(_0x226158){return _0x226158?{'count':_0x56659e,'rows':_0x226158}:null;}})[_0x7b94('0x33')](respondWithResult(_0x9d425c,null))['catch'](handleError(_0x9d425c,null));};exports[_0x7b94('0xfd')]=function(_0x31adbb,_0x24e1bc,_0x1b3381){return db['chatProactiveAction'][_0x7b94('0x5d')]({'where':{'id':_0x31adbb[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x24e1bc,null))['then'](function(_0x22db54){if(_0x22db54){return _0x22db54['addProactiveActions'](_0x31adbb[_0x7b94('0x63')][_0x7b94('0x6a')],_['omit'](_0x31adbb[_0x7b94('0x63')],[_0x7b94('0x6a'),'id'])||{});}})[_0x7b94('0x33')](respondWithResult(_0x24e1bc,null))['catch'](handleError(_0x24e1bc,null));};exports[_0x7b94('0xef')]=function(_0x3cb4b9,_0x314743,_0x29ba25){var _0x22be12={};var _0x2d3933={};var _0x22be51;var _0x1005fe;return db[_0x7b94('0x3d')][_0x7b94('0x68')]({'where':{'id':_0x3cb4b9[_0x7b94('0x5a')]['id']}})['then'](handleEntityNotFound(_0x314743,null))[_0x7b94('0x33')](function(_0x297998){if(_0x297998){_0x22be51=_0x297998;_0x2d3933[_0x7b94('0x42')]=_[_0x7b94('0x3f')](db[_0x7b94('0xfe')]['rawAttributes']);_0x2d3933[_0x7b94('0x40')]=_[_0x7b94('0x3f')](_0x3cb4b9[_0x7b94('0x40')]);_0x2d3933[_0x7b94('0x4c')]=_[_0x7b94('0x41')](_0x2d3933[_0x7b94('0x42')],_0x2d3933[_0x7b94('0x40')]);_0x22be12[_0x7b94('0x43')]=_[_0x7b94('0x41')](_0x2d3933[_0x7b94('0x42')],qs['fields'](_0x3cb4b9['query']['fields']));_0x22be12[_0x7b94('0x43')]=_0x22be12[_0x7b94('0x43')]['length']?_0x22be12['attributes']:_0x2d3933['model'];_0x22be12['order']=qs[_0x7b94('0x4a')](_0x3cb4b9['query'][_0x7b94('0x4a')]);_0x22be12[_0x7b94('0x4b')]=qs['filters'](_[_0x7b94('0x4d')](_0x3cb4b9[_0x7b94('0x40')],_0x2d3933[_0x7b94('0x4c')]));if(_0x3cb4b9['query'][_0x7b94('0x4e')]){_0x22be12[_0x7b94('0x4b')]=_[_0x7b94('0x4f')](_0x22be12[_0x7b94('0x4b')],{'$or':_['map'](_0x22be12[_0x7b94('0x43')],function(_0x520338){var _0x3bfb06={};_0x3bfb06[_0x520338]={'$like':'%'+_0x3cb4b9[_0x7b94('0x40')][_0x7b94('0x4e')]+'%'};return _0x3bfb06;})});}_0x22be12=_[_0x7b94('0x4f')]({},_0x22be12,_0x3cb4b9[_0x7b94('0x55')]);return _0x22be51['getProactiveActions'](_0x22be12);}})[_0x7b94('0x33')](function(_0x420f32){if(_0x420f32){_0x1005fe=_0x420f32[_0x7b94('0x5b')];if(!_0x3cb4b9[_0x7b94('0x40')][_0x7b94('0x45')](_0x7b94('0x46'))){_0x22be12[_0x7b94('0x47')]=qs[_0x7b94('0x47')](_0x3cb4b9[_0x7b94('0x40')][_0x7b94('0x47')]);_0x22be12['offset']=qs[_0x7b94('0x48')](_0x3cb4b9[_0x7b94('0x40')][_0x7b94('0x48')]);}return _0x22be51['getProactiveActions'](_0x22be12);}})[_0x7b94('0x33')](function(_0x6f2c9e){if(_0x6f2c9e){return _0x6f2c9e?{'count':_0x1005fe,'rows':_0x6f2c9e}:null;}})[_0x7b94('0x33')](respondWithResult(_0x314743,null))['catch'](handleError(_0x314743,null));};exports[_0x7b94('0xff')]=function(_0x548a50,_0x3288cd,_0x163897){var _0x3d180f=_0x548a50[_0x7b94('0x40')][_0x7b94('0x100')]===_0x7b94('0x101')?'offlineForm':_0x7b94('0x102');return db[_0x7b94('0x3d')][_0x7b94('0x5d')]({'attributes':['id',_0x3d180f],'where':{'id':_0x548a50['params']['id']}})['then'](handleEntityNotFound(_0x3288cd,null))['then'](function(_0x4605b4){if(_0x4605b4){var _0x1e9a7d=_0x4605b4[_0x3d180f];var _0x1f23d6=_0x1e9a7d&&_0x1e9a7d[_0x7b94('0x103')]?_0x1e9a7d[_0x7b94('0x103')]:[];_0x3288cd[_0x7b94('0x39')]({'fromKey':_[_0x7b94('0x82')](_0x1e9a7d['fromKey'])?undefined:_0x1e9a7d[_0x7b94('0x104')],'count':_0x1f23d6[_0x7b94('0x5b')],'rows':_0x1f23d6});}})['catch'](handleError(_0x3288cd,null));};exports['getOfflineMessages']=function(_0x485253,_0x17b859,_0x461eca){var _0x5115ac={'raw':!![],'where':{}};var _0x587540={};var _0x40948c={'count':0x0,'rows':[]};return db[_0x7b94('0x3d')][_0x7b94('0x68')]({'where':{'id':_0x485253[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x17b859,null))[_0x7b94('0x33')](function(_0x1aa6f7){if(_0x1aa6f7){_0x587540[_0x7b94('0x42')]=_[_0x7b94('0x3f')](db[_0x7b94('0xcf')][_0x7b94('0x3e')]);_0x587540[_0x7b94('0x40')]=_[_0x7b94('0x3f')](_0x485253[_0x7b94('0x40')]);_0x587540[_0x7b94('0x4c')]=_[_0x7b94('0x41')](_0x587540['model'],_0x587540['query']);_0x5115ac[_0x7b94('0x43')]=_[_0x7b94('0x41')](_0x587540[_0x7b94('0x42')],qs[_0x7b94('0x44')](_0x485253[_0x7b94('0x40')][_0x7b94('0x44')]));_0x5115ac[_0x7b94('0x43')]=_0x5115ac[_0x7b94('0x43')][_0x7b94('0x5b')]?_0x5115ac[_0x7b94('0x43')]:_0x587540[_0x7b94('0x42')];if(!_0x485253[_0x7b94('0x40')][_0x7b94('0x45')](_0x7b94('0x46'))){_0x5115ac[_0x7b94('0x47')]=qs[_0x7b94('0x47')](_0x485253['query']['limit']);_0x5115ac['offset']=qs['offset'](_0x485253[_0x7b94('0x40')][_0x7b94('0x48')]);}_0x5115ac[_0x7b94('0x49')]=qs[_0x7b94('0x4a')](_0x485253['query'][_0x7b94('0x4a')]);_0x5115ac[_0x7b94('0x4b')]=qs['filters'](_['pick'](_0x485253[_0x7b94('0x40')],_0x587540[_0x7b94('0x4c')]));_0x5115ac[_0x7b94('0x4b')][_0x7b94('0x66')]=_0x1aa6f7['id'];if(_0x485253[_0x7b94('0x40')]['filter']){_0x5115ac[_0x7b94('0x4b')]=_[_0x7b94('0x4f')](_0x5115ac[_0x7b94('0x4b')],{'$or':_[_0x7b94('0x50')](_0x5115ac[_0x7b94('0x43')],function(_0x335910){var _0x358362={};_0x358362[_0x335910]={'$like':'%'+_0x485253['query'][_0x7b94('0x4e')]+'%'};return _0x358362;})});}_0x5115ac=_[_0x7b94('0x4f')]({},_0x5115ac,_0x485253[_0x7b94('0x55')]);return db['ChatOfflineMessage'][_0x7b94('0x2f')]({'where':_0x5115ac['where']})['then'](function(_0x5461e7){_0x40948c[_0x7b94('0x2f')]=_0x5461e7;if(_0x485253[_0x7b94('0x40')]['includeAll']){_0x5115ac[_0x7b94('0x56')]=[{'all':!![]}];}return db[_0x7b94('0xcf')][_0x7b94('0x57')](_0x5115ac);})[_0x7b94('0x33')](function(_0x2b75f8){_0x40948c['rows']=_0x2b75f8;return _0x40948c;});}})[_0x7b94('0x33')](respondWithFilteredResult(_0x17b859,_0x5115ac))[_0x7b94('0x2a')](handleError(_0x17b859,null));};exports[_0x7b94('0x105')]=function(_0x12c7ac,_0x803b5a,_0xe62d4e){return db[_0x7b94('0x3d')]['find']({'where':{'id':_0x12c7ac[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x803b5a,null))[_0x7b94('0x33')](function(_0x16405e){if(_0x16405e){return _0x16405e[_0x7b94('0x105')](_0x12c7ac[_0x7b94('0x63')][_0x7b94('0x6a')],_['omit'](_0x12c7ac[_0x7b94('0x63')],['ids','id'])||{})[_0x7b94('0xc8')](function(_0x3bef91){for(var _0x51a33b=0x0;_0x51a33b<_0x12c7ac[_0x7b94('0x63')][_0x7b94('0x6a')][_0x7b94('0x5b')];_0x51a33b+=0x1){socket['emit'](_0x7b94('0x106'),{'UserId':_0x12c7ac[_0x7b94('0x63')][_0x7b94('0x6a')][_0x51a33b],'ChatWebsiteId':_0x12c7ac['params']['id']});}return _0x3bef91;});}})[_0x7b94('0x33')](respondWithResult(_0x803b5a,null))[_0x7b94('0x2a')](handleError(_0x803b5a,null));};exports[_0x7b94('0x107')]=function(_0x2719b5,_0x42a451,_0x2acdec){var _0x5d15fb;return db[_0x7b94('0x3d')][_0x7b94('0x5d')]({'where':{'id':_0x2719b5[_0x7b94('0x5a')]['id']}})['then'](handleEntityNotFound(_0x42a451,null))['then'](function(_0x2d97c4){if(_0x2d97c4){return _0x2d97c4[_0x7b94('0x107')](_0x2719b5[_0x7b94('0x40')]['ids'])[_0x7b94('0x33')](function(_0x599147){if(_['isArray'](_0x2719b5['query'][_0x7b94('0x6a')])){for(var _0x428663=0x0;_0x428663<_0x2719b5[_0x7b94('0x40')][_0x7b94('0x6a')][_0x7b94('0x5b')];_0x428663+=0x1){socket[_0x7b94('0x108')]('userChatWebsite:remove',{'UserId':_0x2719b5[_0x7b94('0x40')][_0x7b94('0x6a')][_0x428663],'ChatWebsiteId':_0x2719b5[_0x7b94('0x5a')]['id']});}}else{socket['emit'](_0x7b94('0x109'),{'UserId':_0x2719b5['query'][_0x7b94('0x6a')],'ChatWebsiteId':_0x2719b5['params']['id']});}});}})[_0x7b94('0x33')](respondWithStatusCode(_0x42a451,null))[_0x7b94('0x2a')](handleError(_0x42a451,null));};exports['getAgents']=function(_0x42e80d,_0x162971,_0x483459){var _0x54c163={};var _0x5e8aae={};var _0x403358;var _0x428407;return db[_0x7b94('0x3d')][_0x7b94('0x68')]({'where':{'id':_0x42e80d[_0x7b94('0x5a')]['id']}})[_0x7b94('0x33')](handleEntityNotFound(_0x162971,null))['then'](function(_0x2429e5){if(_0x2429e5){_0x403358=_0x2429e5;_0x5e8aae[_0x7b94('0x42')]=_['keys'](db['User'][_0x7b94('0x3e')]);_0x5e8aae[_0x7b94('0x40')]=_['keys'](_0x42e80d[_0x7b94('0x40')]);_0x5e8aae['filters']=_[_0x7b94('0x41')](_0x5e8aae['model'],_0x5e8aae[_0x7b94('0x40')]);_0x54c163[_0x7b94('0x43')]=_[_0x7b94('0x41')](_0x5e8aae[_0x7b94('0x42')],qs[_0x7b94('0x44')](_0x42e80d['query']['fields']));_0x54c163[_0x7b94('0x43')]=_0x54c163[_0x7b94('0x43')][_0x7b94('0x5b')]?_0x54c163[_0x7b94('0x43')]:_0x5e8aae['model'];_0x54c163['order']=qs[_0x7b94('0x4a')](_0x42e80d[_0x7b94('0x40')][_0x7b94('0x4a')]);_0x54c163[_0x7b94('0x4b')]=qs[_0x7b94('0x4c')](_[_0x7b94('0x4d')](_0x42e80d[_0x7b94('0x40')],_0x5e8aae['filters']));if(_0x42e80d[_0x7b94('0x40')][_0x7b94('0x4e')]){_0x54c163[_0x7b94('0x4b')]=_[_0x7b94('0x4f')](_0x54c163[_0x7b94('0x4b')],{'$or':_[_0x7b94('0x50')](_0x54c163[_0x7b94('0x43')],function(_0x585982){var _0x1d4894={};_0x1d4894[_0x585982]={'$like':'%'+_0x42e80d[_0x7b94('0x40')][_0x7b94('0x4e')]+'%'};return _0x1d4894;})});}_0x54c163=_[_0x7b94('0x4f')]({},_0x54c163,_0x42e80d[_0x7b94('0x55')]);return _0x403358['getAgents'](_0x54c163);}})['then'](function(_0x32f229){if(_0x32f229){_0x428407=_0x32f229[_0x7b94('0x5b')];if(!_0x42e80d[_0x7b94('0x40')]['hasOwnProperty'](_0x7b94('0x46'))){_0x54c163[_0x7b94('0x47')]=qs[_0x7b94('0x47')](_0x42e80d['query'][_0x7b94('0x47')]);_0x54c163[_0x7b94('0x48')]=qs[_0x7b94('0x48')](_0x42e80d[_0x7b94('0x40')]['offset']);}return _0x403358['getAgents'](_0x54c163);}})[_0x7b94('0x33')](function(_0x2aa111){if(_0x2aa111){return _0x2aa111?{'count':_0x428407,'rows':_0x2aa111}:null;}})[_0x7b94('0x33')](respondWithResult(_0x162971,null))[_0x7b94('0x2a')](handleError(_0x162971,null));}; \ No newline at end of file +var _0xf55c=['format','device','vendor','threadId','ChatInteraction','ContactId','interaction','spread','firstName','contact','messageId','created','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','Smtp','forwardOfflineAddress','service','host','secure','authentication','auth','pass','sendMail','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','headers','replace','alignment','verticalAlignment','sequelize','transaction','ChatApplication','bulkCreate','findAndCountAll','getApplications','map','chatProactiveAction','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','key','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','include','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','CmList','List','CmContact','Contacts','DESC','account','applications','Applications','list','orderBy','priority','asc','lastName','customerIp','referer','browser','version','%s\x20%s','unknown'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xf55c,0x70));var _0xcf55=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xf55c[_0x5b78e8];return _0xf2c321;};'use strict';var pdf=require(_0xcf55('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcf55('0x1'));var zipdir=require(_0xcf55('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf55('0x3'));var moment=require('moment');var BPromise=require(_0xcf55('0x4'));var Mustache=require(_0xcf55('0x5'));var util=require(_0xcf55('0x6'));var path=require('path');var sox=require(_0xcf55('0x7'));var csv=require(_0xcf55('0x8'));var ejs=require(_0xcf55('0x9'));var fs=require('fs');var _=require(_0xcf55('0xa'));var squel=require(_0xcf55('0xb'));var crypto=require('crypto');var jsforce=require(_0xcf55('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcf55('0x8'));var querystring=require('querystring');var Papa=require(_0xcf55('0xd'));var authService=require(_0xcf55('0xe'));var hardwareService=require(_0xcf55('0xf'));var Redis=require(_0xcf55('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xcf55('0x11'))(_0xcf55('0x12'));var utils=require('../../config/utils');var config=require(_0xcf55('0x13'));var db=require(_0xcf55('0x14'))['db'];config[_0xcf55('0x15')]=_[_0xcf55('0x16')](config[_0xcf55('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf55('0x17'))(new Redis(config['redis']));require(_0xcf55('0x18'))[_0xcf55('0x19')](socket);var jayson=require(_0xcf55('0x1a'));var client=jayson['client'][_0xcf55('0x1b')]({'port':0x232c});var client9002=jayson[_0xcf55('0x1c')]['http']({'port':0x232a});var client9003=jayson[_0xcf55('0x1c')]['http']({'port':0x232b});function respondWithRpcPromise(_0x33affd,_0x1514b6,_0x38547c,_0x5a0f8a){return new BPromise(function(_0x2d5c1a,_0x37571a){var _0x533256=_0x5a0f8a||client;return _0x533256[_0xcf55('0x1d')](_0x33affd,_0x38547c)[_0xcf55('0x1e')](function(_0x22ca0b){logger[_0xcf55('0x1f')](_0xcf55('0x20'),_0x1514b6,_0xcf55('0x21'));logger['debug'](_0xcf55('0x22'),_0x1514b6,'request\x20sent',JSON[_0xcf55('0x23')](_0x22ca0b));if(_0x22ca0b['error']){if(_0x22ca0b[_0xcf55('0x24')][_0xcf55('0x25')]===0x1f4){logger[_0xcf55('0x24')](_0xcf55('0x20'),_0x1514b6,_0x22ca0b[_0xcf55('0x24')]['message']);return _0x37571a(_0x22ca0b['error']['message']);}logger[_0xcf55('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x1514b6,_0x22ca0b[_0xcf55('0x24')][_0xcf55('0x26')]);return _0x2d5c1a(_0x22ca0b[_0xcf55('0x24')][_0xcf55('0x26')]);}else{logger[_0xcf55('0x1f')](_0xcf55('0x20'),_0x1514b6,'request\x20sent');_0x2d5c1a(_0x22ca0b[_0xcf55('0x27')]['message']);}})['catch'](function(_0x304818){logger[_0xcf55('0x24')](_0xcf55('0x20'),_0x1514b6,_0x304818);_0x37571a(_0x304818);});});}function respondWithStatusCode(_0x2d4163,_0xd28066){_0xd28066=_0xd28066||0xcc;return function(_0x260184){if(_0x260184){return _0x2d4163[_0xcf55('0x28')](_0xd28066);}return _0x2d4163[_0xcf55('0x29')](_0xd28066)['end']();};}function respondWithResult(_0x4016f8,_0x2b6053){_0x2b6053=_0x2b6053||0xc8;return function(_0x87ef5e){if(_0x87ef5e){return _0x4016f8[_0xcf55('0x29')](_0x2b6053)[_0xcf55('0x2a')](_0x87ef5e);}};}function respondWithFilteredResult(_0x4aaac9,_0x337457){return function(_0x3a593e){if(_0x3a593e){var _0x415e47=_0x3a593e[_0xcf55('0x2b')],_0x3fde9c=_0x337457['offset'],_0x4d7e5a=_0x337457[_0xcf55('0x2c')]+_0x337457[_0xcf55('0x2d')],_0x5b1723;if(_0x4d7e5a>=_0x415e47){_0x4d7e5a=_0x415e47;_0x5b1723=0xc8;}else{_0x5b1723=0xce;}_0x4aaac9[_0xcf55('0x29')](_0x5b1723);return _0x4aaac9[_0xcf55('0x2e')](_0xcf55('0x2f'),_0x3fde9c+'-'+_0x4d7e5a+'/'+_0x415e47)[_0xcf55('0x2a')](_0x3a593e);}return null;};}function patchUpdates(_0x237619){return function(_0x268058){try{jsonpatch[_0xcf55('0x30')](_0x268058,_0x237619,!![]);}catch(_0x1db884){return BPromise['reject'](_0x1db884);}return _0x268058[_0xcf55('0x31')]();};}function saveUpdates(_0x3360ee,_0x571964){return function(_0x5485ac){if(_0x5485ac){return _0x5485ac[_0xcf55('0x32')](_0x3360ee)[_0xcf55('0x1e')](function(_0xe34dc2){return _0xe34dc2;});}return null;};}function removeEntity(_0x4a9684,_0x3ec16f){return function(_0x13c4b1){if(_0x13c4b1){return _0x13c4b1[_0xcf55('0x33')]()[_0xcf55('0x1e')](function(){var _0x510b3d=_0x13c4b1[_0xcf55('0x34')]({'plain':!![]});var _0x20e6db=_0xcf55('0x35');return db[_0xcf55('0x36')][_0xcf55('0x33')]({'where':{'type':_0x20e6db,'resourceId':_0x510b3d['id']}})['then'](function(){return _0x13c4b1;});})[_0xcf55('0x1e')](function(){_0x4a9684[_0xcf55('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32f977,_0x488a7f){return function(_0x53f9ab){if(!_0x53f9ab){_0x32f977['sendStatus'](0x194);}return _0x53f9ab;};}function handleError(_0x3987e4,_0x4d7f67){_0x4d7f67=_0x4d7f67||0x1f4;return function(_0x2394d2){logger['error'](_0x2394d2[_0xcf55('0x37')]);if(_0x2394d2['name']){delete _0x2394d2[_0xcf55('0x38')];}_0x3987e4[_0xcf55('0x29')](_0x4d7f67)[_0xcf55('0x39')](_0x2394d2);};}exports[_0xcf55('0x3a')]=function(_0x59b836,_0x565bd8){var _0x58020d={'include':[{'model':db[_0xcf55('0x3b')],'as':_0xcf55('0x3c')}]},_0x1e7678={},_0x291b81={'count':0x0,'rows':[]};var _0x2eeefc=db[_0xcf55('0x3d')][_0xcf55('0x3e')];_0x1e7678[_0xcf55('0x3f')]=_[_0xcf55('0x40')](_0x2eeefc);_0x1e7678[_0xcf55('0x41')]=_[_0xcf55('0x40')](_0x59b836[_0xcf55('0x41')]);_0x1e7678['filters']=_[_0xcf55('0x42')](_0x1e7678[_0xcf55('0x3f')],_0x1e7678[_0xcf55('0x41')]);_0x58020d[_0xcf55('0x43')]=_[_0xcf55('0x42')](_0x1e7678['model'],qs[_0xcf55('0x44')](_0x59b836['query'][_0xcf55('0x44')]));_0x58020d[_0xcf55('0x43')]=_0x58020d[_0xcf55('0x43')][_0xcf55('0x45')]?_0x58020d[_0xcf55('0x43')]:_0x1e7678['model'];if(!_0x59b836[_0xcf55('0x41')][_0xcf55('0x46')](_0xcf55('0x47'))){_0x58020d[_0xcf55('0x2d')]=qs[_0xcf55('0x2d')](_0x59b836[_0xcf55('0x41')][_0xcf55('0x2d')]);_0x58020d[_0xcf55('0x2c')]=qs['offset'](_0x59b836[_0xcf55('0x41')][_0xcf55('0x2c')]);}_0x58020d['order']=qs[_0xcf55('0x48')](_0x59b836[_0xcf55('0x41')][_0xcf55('0x48')]);_0x58020d[_0xcf55('0x49')]=qs[_0xcf55('0x4a')](_['pick'](_0x59b836[_0xcf55('0x41')],_0x1e7678['filters']));if(_0x59b836[_0xcf55('0x41')][_0xcf55('0x4b')]){_0x58020d[_0xcf55('0x49')]=_[_0xcf55('0x4c')](_0x58020d[_0xcf55('0x49')],{'$or':_['map'](_0x2eeefc,function(_0x5aa30a){if(_0x5aa30a[_0xcf55('0x4d')][_0xcf55('0x4e')]!==_0xcf55('0x4f')){var _0x5d6d00={};_0x5d6d00[_0x5aa30a['field']]={'$like':'%'+_0x59b836[_0xcf55('0x41')]['filter']+'%'};return _0x5d6d00;}})});}_0x58020d=_[_0xcf55('0x4c')]({},_0x58020d,_0x59b836['options']);var _0x5ec55c={'where':_0x58020d[_0xcf55('0x49')]};return db[_0xcf55('0x3d')][_0xcf55('0x2b')](_0x5ec55c)[_0xcf55('0x1e')](function(_0x358117){_0x291b81[_0xcf55('0x2b')]=_0x358117;if(_0x59b836[_0xcf55('0x41')][_0xcf55('0x50')]){_0x58020d['include']=[{'all':!![]}];}return db[_0xcf55('0x3d')][_0xcf55('0x51')](_0x58020d);})[_0xcf55('0x1e')](function(_0x595a3a){_0x291b81[_0xcf55('0x52')]=_0x595a3a;return _0x291b81;})[_0xcf55('0x1e')](respondWithFilteredResult(_0x565bd8,_0x58020d))[_0xcf55('0x53')](handleError(_0x565bd8,null));};exports[_0xcf55('0x54')]=function(_0x298372,_0x152c53){var _0x82315b={'raw':![],'where':{'id':_0x298372[_0xcf55('0x55')]['id']},'include':[{'model':db[_0xcf55('0x3b')],'as':_0xcf55('0x3c')}]},_0x362be2={};_0x362be2[_0xcf55('0x3f')]=_[_0xcf55('0x40')](db[_0xcf55('0x3d')][_0xcf55('0x3e')]);_0x362be2[_0xcf55('0x41')]=_[_0xcf55('0x40')](_0x298372[_0xcf55('0x41')]);_0x362be2[_0xcf55('0x4a')]=_['intersection'](_0x362be2['model'],_0x362be2[_0xcf55('0x41')]);_0x82315b[_0xcf55('0x43')]=_[_0xcf55('0x42')](_0x362be2['model'],qs[_0xcf55('0x44')](_0x298372[_0xcf55('0x41')][_0xcf55('0x44')]));_0x82315b[_0xcf55('0x43')]=_0x82315b[_0xcf55('0x43')]['length']?_0x82315b[_0xcf55('0x43')]:_0x362be2[_0xcf55('0x3f')];if(_0x298372['query'][_0xcf55('0x50')]){_0x82315b['include']=[{'all':!![]}];}_0x82315b=_['merge']({},_0x82315b,_0x298372[_0xcf55('0x56')]);return db[_0xcf55('0x3d')][_0xcf55('0x57')](_0x82315b)[_0xcf55('0x1e')](handleEntityNotFound(_0x152c53,null))[_0xcf55('0x1e')](respondWithResult(_0x152c53,null))['catch'](handleError(_0x152c53,null));};exports[_0xcf55('0x58')]=function(_0x245de4,_0x4c73f9){return db[_0xcf55('0x3d')][_0xcf55('0x58')](_0x245de4[_0xcf55('0x59')],{})['then'](function(_0x46768d){var _0x5423fb=_0x245de4[_0xcf55('0x5a')][_0xcf55('0x34')]({'plain':!![]});if(!_0x5423fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5423fb[_0xcf55('0x5b')]===_0xcf55('0x5a')){var _0xc77210=_0x46768d['get']({'plain':!![]});var _0x1556d2=_0xcf55('0x35');return db['UserProfileSection'][_0xcf55('0x57')]({'where':{'name':_0x1556d2,'userProfileId':_0x5423fb[_0xcf55('0x5c')]},'raw':!![]})[_0xcf55('0x1e')](function(_0x13ac86){if(_0x13ac86&&_0x13ac86[_0xcf55('0x5d')]===0x0){return db['UserProfileResource'][_0xcf55('0x58')]({'name':_0xc77210[_0xcf55('0x38')],'resourceId':_0xc77210['id'],'type':_0x13ac86[_0xcf55('0x38')],'sectionId':_0x13ac86['id']},{})['then'](function(){return _0x46768d;});}else{return _0x46768d;}})['catch'](function(_0x456471){logger['error'](_0xcf55('0x5e'),_0x456471);throw _0x456471;});}return _0x46768d;})['then'](respondWithResult(_0x4c73f9,0xc9))['catch'](handleError(_0x4c73f9,null));};exports[_0xcf55('0x32')]=function(_0x397a7b,_0x252890){if(_0x397a7b[_0xcf55('0x59')]['id']){delete _0x397a7b['body']['id'];}return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'where':{'id':_0x397a7b[_0xcf55('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xcf55('0x3c')}]})[_0xcf55('0x1e')](handleEntityNotFound(_0x252890,null))[_0xcf55('0x1e')](saveUpdates(_0x397a7b[_0xcf55('0x59')],null))[_0xcf55('0x1e')](function(_0x4a3a95){if(_0x4a3a95&&_0x397a7b['body']['mandatoryDispositionPause']){return db['Pause'][_0xcf55('0x32')](_0x397a7b[_0xcf55('0x59')][_0xcf55('0x3c')],{'where':{'ChatWebsiteId':_0x4a3a95['id']}})[_0xcf55('0x1e')](function(){return _0x4a3a95;});}return _0x4a3a95;})[_0xcf55('0x1e')](respondWithResult(_0x252890,null))[_0xcf55('0x53')](handleError(_0x252890,null));};exports[_0xcf55('0x33')]=function(_0x573b33,_0x1feb10){return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'where':{'id':_0x573b33[_0xcf55('0x55')]['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x1feb10,null))[_0xcf55('0x1e')](removeEntity(_0x1feb10,null))[_0xcf55('0x53')](handleError(_0x1feb10,null));};exports[_0xcf55('0x5f')]=function(_0x5da1e1,_0x592d28){return db[_0xcf55('0x3d')]['describe']()[_0xcf55('0x1e')](respondWithResult(_0x592d28,null))[_0xcf55('0x53')](handleError(_0x592d28,null));};exports[_0xcf55('0x60')]=function(_0x50b76a,_0x4ce56e,_0x1d47af){if(_0x50b76a[_0xcf55('0x59')]['id']){delete _0x50b76a['body']['id'];}return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'where':{'id':_0x50b76a['params']['id']}})['then'](handleEntityNotFound(_0x4ce56e,null))[_0xcf55('0x1e')](function(_0x47ed0e){if(_0x47ed0e){_0x50b76a[_0xcf55('0x59')][_0xcf55('0x61')]=_0x47ed0e['id'];return db[_0xcf55('0x62')][_0xcf55('0x58')](_0x50b76a['body']);}})['then'](respondWithResult(_0x4ce56e,null))[_0xcf55('0x53')](handleError(_0x4ce56e,null));};exports[_0xcf55('0x63')]=function(_0x306fbe,_0x223650,_0x19ff28){var _0x496baa={'raw':![],'where':{}};var _0x4fd2df={};var _0x35849d={'count':0x0,'rows':[]};return db[_0xcf55('0x3d')][_0xcf55('0x64')]({'where':{'id':_0x306fbe['params']['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x223650,null))[_0xcf55('0x1e')](function(_0x48e67a){if(_0x48e67a){_0x4fd2df[_0xcf55('0x3f')]=_['keys'](db[_0xcf55('0x62')][_0xcf55('0x3e')]);_0x4fd2df[_0xcf55('0x41')]=_[_0xcf55('0x40')](_0x306fbe['query']);_0x4fd2df[_0xcf55('0x4a')]=_[_0xcf55('0x42')](_0x4fd2df[_0xcf55('0x3f')],_0x4fd2df[_0xcf55('0x41')]);_0x496baa[_0xcf55('0x43')]=_['intersection'](_0x4fd2df[_0xcf55('0x3f')],qs[_0xcf55('0x44')](_0x306fbe[_0xcf55('0x41')][_0xcf55('0x44')]));_0x496baa[_0xcf55('0x43')]=_0x496baa[_0xcf55('0x43')][_0xcf55('0x45')]?_0x496baa[_0xcf55('0x43')]:_0x4fd2df[_0xcf55('0x3f')];if(!_0x306fbe[_0xcf55('0x41')][_0xcf55('0x46')](_0xcf55('0x47'))){_0x496baa[_0xcf55('0x2d')]=qs[_0xcf55('0x2d')](_0x306fbe['query'][_0xcf55('0x2d')]);_0x496baa[_0xcf55('0x2c')]=qs['offset'](_0x306fbe[_0xcf55('0x41')][_0xcf55('0x2c')]);}_0x496baa[_0xcf55('0x65')]=qs[_0xcf55('0x48')](_0x306fbe[_0xcf55('0x41')][_0xcf55('0x48')]);_0x496baa['where']=qs[_0xcf55('0x4a')](_['pick'](_0x306fbe[_0xcf55('0x41')],_0x4fd2df[_0xcf55('0x4a')]));_0x496baa[_0xcf55('0x49')][_0xcf55('0x61')]=_0x48e67a['id'];if(_0x306fbe[_0xcf55('0x41')]['filter']){_0x496baa[_0xcf55('0x49')]=_['merge'](_0x496baa[_0xcf55('0x49')],{'$or':_['map'](_0x496baa[_0xcf55('0x43')],function(_0x333838){var _0x57962c={};_0x57962c[_0x333838]={'$like':'%'+_0x306fbe[_0xcf55('0x41')]['filter']+'%'};return _0x57962c;})});}_0x496baa=_[_0xcf55('0x4c')]({},_0x496baa,_0x306fbe['options']);return db[_0xcf55('0x62')][_0xcf55('0x2b')]({'where':_0x496baa[_0xcf55('0x49')]})['then'](function(_0x12b8c8){_0x35849d[_0xcf55('0x2b')]=_0x12b8c8;if(_0x306fbe['query'][_0xcf55('0x50')]){_0x496baa['include']=[{'all':!![]}];}return db[_0xcf55('0x62')][_0xcf55('0x51')](_0x496baa);})[_0xcf55('0x1e')](function(_0x3696af){_0x35849d['rows']=_0x3696af;return _0x35849d;});}})[_0xcf55('0x1e')](respondWithFilteredResult(_0x223650,_0x496baa))[_0xcf55('0x53')](handleError(_0x223650,null));};exports[_0xcf55('0x66')]=function(_0x54afc1,_0x139ad1,_0x27256b){var _0x33f044;return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'where':{'id':_0x54afc1[_0xcf55('0x55')]['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x139ad1,null))[_0xcf55('0x1e')](function(_0x278500){if(_0x278500){return _0x278500[_0xcf55('0x66')](_0x54afc1[_0xcf55('0x41')][_0xcf55('0x67')]);}})[_0xcf55('0x1e')](respondWithStatusCode(_0x139ad1,null))[_0xcf55('0x53')](handleError(_0x139ad1,null));};exports[_0xcf55('0x68')]=function(_0xb8e28a,_0x3c7cfb,_0x3b801b){if(_0xb8e28a[_0xcf55('0x59')]['id']){delete _0xb8e28a[_0xcf55('0x59')]['id'];}return db[_0xcf55('0x3d')]['find']({'where':{'id':_0xb8e28a[_0xcf55('0x55')]['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x3c7cfb,null))['then'](function(_0x3fa115){if(_0x3fa115){_0xb8e28a[_0xcf55('0x59')][_0xcf55('0x61')]=_0x3fa115['id'];return db[_0xcf55('0x69')][_0xcf55('0x58')](_0xb8e28a[_0xcf55('0x59')]);}})[_0xcf55('0x1e')](respondWithResult(_0x3c7cfb,null))[_0xcf55('0x53')](handleError(_0x3c7cfb,null));};exports[_0xcf55('0x6a')]=function(_0x270a9f,_0x3e79a8,_0x4f2a94){var _0x59fa8f={'raw':![],'where':{}};var _0x2b4eca={};var _0x3d8cf5={'count':0x0,'rows':[]};return db[_0xcf55('0x3d')][_0xcf55('0x64')]({'where':{'id':_0x270a9f[_0xcf55('0x55')]['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x3e79a8,null))['then'](function(_0x7cee66){if(_0x7cee66){_0x2b4eca[_0xcf55('0x3f')]=_[_0xcf55('0x40')](db[_0xcf55('0x69')][_0xcf55('0x3e')]);_0x2b4eca[_0xcf55('0x41')]=_[_0xcf55('0x40')](_0x270a9f[_0xcf55('0x41')]);_0x2b4eca[_0xcf55('0x4a')]=_['intersection'](_0x2b4eca[_0xcf55('0x3f')],_0x2b4eca['query']);_0x59fa8f[_0xcf55('0x43')]=_[_0xcf55('0x42')](_0x2b4eca[_0xcf55('0x3f')],qs[_0xcf55('0x44')](_0x270a9f['query'][_0xcf55('0x44')]));_0x59fa8f[_0xcf55('0x43')]=_0x59fa8f[_0xcf55('0x43')][_0xcf55('0x45')]?_0x59fa8f[_0xcf55('0x43')]:_0x2b4eca[_0xcf55('0x3f')];if(!_0x270a9f[_0xcf55('0x41')][_0xcf55('0x46')]('nolimit')){_0x59fa8f['limit']=qs[_0xcf55('0x2d')](_0x270a9f[_0xcf55('0x41')]['limit']);_0x59fa8f[_0xcf55('0x2c')]=qs['offset'](_0x270a9f[_0xcf55('0x41')]['offset']);}_0x59fa8f[_0xcf55('0x65')]=qs[_0xcf55('0x48')](_0x270a9f[_0xcf55('0x41')][_0xcf55('0x48')]);_0x59fa8f['where']=qs[_0xcf55('0x4a')](_[_0xcf55('0x6b')](_0x270a9f[_0xcf55('0x41')],_0x2b4eca[_0xcf55('0x4a')]));_0x59fa8f['where']['ChatWebsiteId']=_0x7cee66['id'];if(_0x270a9f[_0xcf55('0x41')][_0xcf55('0x4b')]){_0x59fa8f[_0xcf55('0x49')]=_[_0xcf55('0x4c')](_0x59fa8f[_0xcf55('0x49')],{'$or':_['map'](_0x59fa8f['attributes'],function(_0x1c5195){var _0xaf1faa={};_0xaf1faa[_0x1c5195]={'$like':'%'+_0x270a9f[_0xcf55('0x41')][_0xcf55('0x4b')]+'%'};return _0xaf1faa;})});}_0x59fa8f=_[_0xcf55('0x4c')]({},_0x59fa8f,_0x270a9f[_0xcf55('0x56')]);return db['CannedAnswer'][_0xcf55('0x2b')]({'where':_0x59fa8f[_0xcf55('0x49')]})['then'](function(_0x14dcf0){_0x3d8cf5['count']=_0x14dcf0;if(_0x270a9f[_0xcf55('0x41')][_0xcf55('0x50')]){_0x59fa8f[_0xcf55('0x6c')]=[{'all':!![]}];}return db[_0xcf55('0x69')][_0xcf55('0x51')](_0x59fa8f);})['then'](function(_0x4dd1d4){_0x3d8cf5['rows']=_0x4dd1d4;return _0x3d8cf5;});}})[_0xcf55('0x1e')](respondWithFilteredResult(_0x3e79a8,_0x59fa8f))[_0xcf55('0x53')](handleError(_0x3e79a8,null));};exports[_0xcf55('0x6d')]=function(_0x6129ce,_0x2bfd9d,_0x482d62){var _0x4075ba;return db[_0xcf55('0x3d')]['find']({'where':{'id':_0x6129ce[_0xcf55('0x55')]['id']}})['then'](handleEntityNotFound(_0x2bfd9d,null))['then'](function(_0x18016a){if(_0x18016a){return _0x18016a[_0xcf55('0x6d')](_0x6129ce[_0xcf55('0x41')]['ids']);}})[_0xcf55('0x1e')](respondWithStatusCode(_0x2bfd9d,null))[_0xcf55('0x53')](handleError(_0x2bfd9d,null));};exports[_0xcf55('0x6e')]=function(_0x40afb9,_0x384fa4,_0x5201af){_0x40afb9['body'][_0xcf55('0x6f')]=_0x40afb9['file'][_0xcf55('0x70')];return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'where':{'id':_0x40afb9[_0xcf55('0x55')]['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x384fa4,null))[_0xcf55('0x1e')](saveUpdates(_0x40afb9[_0xcf55('0x59')],null))[_0xcf55('0x1e')](respondWithResult(_0x384fa4,null))[_0xcf55('0x53')](handleError(_0x384fa4,null));};exports[_0xcf55('0x71')]=function(_0x50eccf,_0x53512f,_0x1073d7){_0x50eccf[_0xcf55('0x59')][_0xcf55('0x72')]=_0x50eccf[_0xcf55('0x73')]['filename'];return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'where':{'id':_0x50eccf[_0xcf55('0x55')]['id']}})['then'](handleEntityNotFound(_0x53512f,null))[_0xcf55('0x1e')](saveUpdates(_0x50eccf[_0xcf55('0x59')],null))[_0xcf55('0x1e')](respondWithResult(_0x53512f,null))[_0xcf55('0x53')](handleError(_0x53512f,null));};exports['addCustomerAvatar']=function(_0x1f48d7,_0x441db2,_0x38026a){_0x1f48d7['body'][_0xcf55('0x74')]=_0x1f48d7[_0xcf55('0x73')][_0xcf55('0x70')];return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'where':{'id':_0x1f48d7[_0xcf55('0x55')]['id']}})['then'](handleEntityNotFound(_0x441db2,null))[_0xcf55('0x1e')](saveUpdates(_0x1f48d7[_0xcf55('0x59')],null))[_0xcf55('0x1e')](respondWithResult(_0x441db2,null))[_0xcf55('0x53')](handleError(_0x441db2,null));};exports['addSystemAvatar']=function(_0x3ced5d,_0x1d1b51,_0x598df9){_0x3ced5d[_0xcf55('0x59')][_0xcf55('0x75')]=_0x3ced5d['file'][_0xcf55('0x70')];return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'where':{'id':_0x3ced5d['params']['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x1d1b51,null))[_0xcf55('0x1e')](saveUpdates(_0x3ced5d[_0xcf55('0x59')],null))[_0xcf55('0x1e')](respondWithResult(_0x1d1b51,null))[_0xcf55('0x53')](handleError(_0x1d1b51,null));};exports[_0xcf55('0x76')]=function(_0x361958,_0x4c63e7,_0x1e6584){var _0x238edb=path[_0xcf55('0x77')](config[_0xcf55('0x78')],_0xcf55('0x79'));var _0x178e20={'where':{'id':_0x361958['params']['id']},'attributes':['id',_0xcf55('0x6f')],'raw':!![]};var _0x19f8d0=![];return require(_0xcf55('0x7a'))[_0xcf55('0x7b')]()[_0xcf55('0x1e')](function(_0xcb6f74){if(_0xcb6f74){_0x19f8d0=_0xcb6f74[_0xcf55('0x7c')];}})['then'](function(){return db[_0xcf55('0x3d')][_0xcf55('0x57')](_0x178e20);})[_0xcf55('0x1e')](handleEntityNotFound(_0x4c63e7,null))[_0xcf55('0x1e')](function(_0xb8f203){if(_0xb8f203){if(!_[_0xcf55('0x7d')](_0xb8f203[_0xcf55('0x6f')])){if(fs[_0xcf55('0x7e')](path['join'](config[_0xcf55('0x78')],_0xcf55('0x7f'),_0xb8f203[_0xcf55('0x6f')]))&&_0x19f8d0){_0x238edb=path[_0xcf55('0x77')](config[_0xcf55('0x78')],_0xcf55('0x7f'),_0xb8f203[_0xcf55('0x6f')]);}}return _0x4c63e7['download'](_0x238edb);}})[_0xcf55('0x53')](handleError(_0x4c63e7,null));};exports[_0xcf55('0x80')]=function(_0x2f0f24,_0x4f2999,_0x128368){var _0x42626d=path[_0xcf55('0x77')](config[_0xcf55('0x78')],_0xcf55('0x81'));var _0x2e33d7={'where':{'id':_0x2f0f24['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xcf55('0x3d')][_0xcf55('0x57')](_0x2e33d7)[_0xcf55('0x1e')](handleEntityNotFound(_0x4f2999,null))[_0xcf55('0x1e')](function(_0x47d60c){if(_0x47d60c){if(!_[_0xcf55('0x7d')](_0x47d60c[_0xcf55('0x72')])){if(fs[_0xcf55('0x7e')](path[_0xcf55('0x77')](config[_0xcf55('0x78')],_0xcf55('0x82'),_0x47d60c[_0xcf55('0x72')]))){_0x42626d=path[_0xcf55('0x77')](config['root'],_0xcf55('0x82'),_0x47d60c[_0xcf55('0x72')]);}}return _0x4f2999[_0xcf55('0x83')](_0x42626d);}})[_0xcf55('0x53')](handleError(_0x4f2999,null));};exports[_0xcf55('0x84')]=function(_0x61a59c,_0x20b923,_0x99b01d){var _0x541b8d=path[_0xcf55('0x77')](config['root'],_0xcf55('0x85'));var _0x1ac3d7={'where':{'id':_0x61a59c[_0xcf55('0x55')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xcf55('0x3d')][_0xcf55('0x57')](_0x1ac3d7)[_0xcf55('0x1e')](handleEntityNotFound(_0x20b923,null))[_0xcf55('0x1e')](function(_0xba5009){if(_0xba5009){if(!_['isNil'](_0xba5009['customerAvatar'])){if(fs[_0xcf55('0x7e')](path[_0xcf55('0x77')](config[_0xcf55('0x78')],_0xcf55('0x82'),_0xba5009[_0xcf55('0x74')]))&&_0xba5009[_0xcf55('0x86')]){_0x541b8d=path[_0xcf55('0x77')](config[_0xcf55('0x78')],'server/files/images/avatars/',_0xba5009[_0xcf55('0x74')]);}}return _0x20b923[_0xcf55('0x83')](_0x541b8d);}})[_0xcf55('0x53')](handleError(_0x20b923,null));};exports['getSystemAvatar']=function(_0x2550f4,_0x4f8cc7,_0x540e62){var _0x355259=path[_0xcf55('0x77')](config[_0xcf55('0x78')],_0xcf55('0x87'));var _0x4c0165={'where':{'id':_0x2550f4[_0xcf55('0x55')]['id']},'attributes':['id',_0xcf55('0x75')],'raw':!![]};return db[_0xcf55('0x3d')][_0xcf55('0x57')](_0x4c0165)['then'](handleEntityNotFound(_0x4f8cc7,null))['then'](function(_0x4ae709){if(_0x4ae709){if(!_[_0xcf55('0x7d')](_0x4ae709['systemAvatar'])){if(fs['existsSync'](path[_0xcf55('0x77')](config[_0xcf55('0x78')],_0xcf55('0x82'),_0x4ae709[_0xcf55('0x75')]))){_0x355259=path['join'](config['root'],_0xcf55('0x82'),_0x4ae709[_0xcf55('0x75')]);}}return _0x4f8cc7[_0xcf55('0x83')](_0x355259);}})[_0xcf55('0x53')](handleError(_0x4f8cc7,null));};exports[_0xcf55('0x88')]=function(_0x2f486a,_0x547fce,_0x27e14a){var _0x201d26=require(_0xcf55('0x89'));var _0x4c2bea=new _0x201d26();var _0x57b026=_0x4c2bea[_0xcf55('0x8a')](_0x2f486a['headers']['user-agent'])[_0xcf55('0x8b')]();var _0x5547f3={'body':_0x2f486a[_0xcf55('0x59')],'channel':_0xcf55('0x8c')};var _0x12fac8=[];var _0x1d7ef3=[];var _0x21ab18={};var _0x1f97b1=![];return db['CmContact'][_0xcf55('0x5f')]()['then'](function(_0x568a70){if(!_0x568a70){throw new db[(_0xcf55('0x8d'))][(_0xcf55('0x8e'))](_0xcf55('0x8f'));}_0x12fac8=_[_0xcf55('0x90')](_[_0xcf55('0x40')](_0x568a70),[_0xcf55('0x91'),_0xcf55('0x92')]);_0x1d7ef3=_[_0xcf55('0x90')](_[_0xcf55('0x40')](_0x568a70),[_0xcf55('0x91'),_0xcf55('0x92'),'CompanyId',_0xcf55('0x93')]);if(_0x2f486a[_0xcf55('0x59')]['id']){delete _0x2f486a[_0xcf55('0x59')]['id'];}if(_[_0xcf55('0x7d')](_0x2f486a[_0xcf55('0x59')][_0xcf55('0x94')])){throw new db[(_0xcf55('0x8d'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xcf55('0x7d')](_0x2f486a[_0xcf55('0x59')]['body'])||_0x2f486a['body'][_0xcf55('0x59')]===''){throw new db['Sequelize'][(_0xcf55('0x8e'))](_0xcf55('0x95'));}if(_[_0xcf55('0x7d')](_0x2f486a[_0xcf55('0x59')][_0xcf55('0x96')])){throw new db['Sequelize'][(_0xcf55('0x8e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1d7ef3);}if(!_['includes'](_0x1d7ef3,_0x2f486a[_0xcf55('0x59')][_0xcf55('0x96')])){throw new db[(_0xcf55('0x8d'))][(_0xcf55('0x8e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1d7ef3);}_0x21ab18[_0x2f486a[_0xcf55('0x59')][_0xcf55('0x96')]]=_0x2f486a[_0xcf55('0x59')][_0xcf55('0x94')];})[_0xcf55('0x1e')](function(){return db[_0xcf55('0x3d')]['find']({'where':{'id':_0x2f486a[_0xcf55('0x55')]['id']},'include':[{'model':db[_0xcf55('0x97')],'as':_0xcf55('0x98'),'include':[{'model':db[_0xcf55('0x99')],'as':_0xcf55('0x9a'),'where':_0x21ab18,'limit':0x1,'order':[[_0xcf55('0x92'),_0xcf55('0x9b')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x547fce,null))[_0xcf55('0x1e')](function(_0x3b38c8){if(_0x3b38c8&&_0x3b38c8[_0xcf55('0x98')]){_0x5547f3[_0xcf55('0x9c')]=_0x3b38c8;_0x5547f3[_0xcf55('0x9d')]=_0x3b38c8[_0xcf55('0x9e')];_0x5547f3[_0xcf55('0x9f')]=_0x3b38c8[_0xcf55('0x98')];_0x5547f3[_0xcf55('0x9d')]=_[_0xcf55('0xa0')](_0x5547f3[_0xcf55('0x9d')],[_0xcf55('0xa1')],[_0xcf55('0xa2')]);if(_0x5547f3['account']['Applications']){delete _0x5547f3[_0xcf55('0x9c')][_0xcf55('0x9e')];}if(_0x5547f3[_0xcf55('0x9c')][_0xcf55('0x98')]&&_0x5547f3[_0xcf55('0x9c')][_0xcf55('0x98')]['Contacts']['length']){return _0x5547f3[_0xcf55('0x9c')][_0xcf55('0x98')][_0xcf55('0x9a')][0x0];}var _0x352ee4=_['defaults'](_0x2f486a[_0xcf55('0x59')],{'firstName':_0x2f486a['body'][_0xcf55('0x94')],'ListId':_0x3b38c8[_0xcf55('0x93')]});_0x352ee4[_0x2f486a[_0xcf55('0x59')][_0xcf55('0x96')]]=_0x2f486a[_0xcf55('0x59')]['from'];return db[_0xcf55('0x99')]['create'](_0x352ee4,{'fields':_0x12fac8,'raw':!![]});}})[_0xcf55('0x1e')](handleEntityNotFound(_0x547fce,null))['then'](function(_0x558d67){_0x5547f3['contact']=_0x558d67;if(_0x558d67){var _0x3939d5={'ContactId':_0x558d67['id'],'ChatWebsiteId':_0x2f486a[_0xcf55('0x55')]['id'],'from':(_0x558d67['firstName']||'')+'\x20'+(_0x558d67[_0xcf55('0xa3')]||''),'customerIp':_0x2f486a[_0xcf55('0x59')][_0xcf55('0xa4')],'referer':_0x2f486a[_0xcf55('0x59')][_0xcf55('0xa5')],'browserName':_0x57b026[_0xcf55('0xa6')][_0xcf55('0x38')]&&_0x57b026[_0xcf55('0xa6')][_0xcf55('0xa7')]?util['format'](_0xcf55('0xa8'),_0x57b026[_0xcf55('0xa6')][_0xcf55('0x38')],_0x57b026[_0xcf55('0xa6')][_0xcf55('0xa7')]):_0xcf55('0xa9'),'browserVersion':_0x57b026[_0xcf55('0xa6')][_0xcf55('0xa7')]||_0xcf55('0xa9'),'osName':util[_0xcf55('0xaa')](_0xcf55('0xa8'),_0x57b026['os'][_0xcf55('0x38')],_0x57b026['os'][_0xcf55('0xa7')]),'osVersion':_0x57b026['os'][_0xcf55('0xa7')],'deviceModel':_0x57b026[_0xcf55('0xab')][_0xcf55('0x3f')]&&_0x57b026['device']['vendor']?util[_0xcf55('0xaa')]('%s\x20%s\x20%s',_0x57b026[_0xcf55('0xab')][_0xcf55('0x3f')],_0x57b026[_0xcf55('0xab')][_0xcf55('0xac')],_0x57b026['device'][_0xcf55('0x4d')]):null,'deviceVendor':_0x57b026[_0xcf55('0xab')][_0xcf55('0xac')],'deviceType':_0x57b026[_0xcf55('0xab')]['type'],'formData':JSON['stringify'](_0x2f486a[_0xcf55('0x59')])};var _0xe7b04b={'ChatWebsiteId':_0x2f486a[_0xcf55('0x55')]['id'],'closed':![]};if(_0x2f486a[_0xcf55('0x59')]['threadId']){_0xe7b04b[_0xcf55('0xad')]=_0x2f486a['body']['threadId'];return db[_0xcf55('0xae')][_0xcf55('0x57')]({'where':_0xe7b04b})[_0xcf55('0x1e')](function(_0x1f521d){if(_0x1f521d){return[_0x1f521d,![]];}_0x3939d5[_0xcf55('0xad')]=_0x2f486a[_0xcf55('0x59')][_0xcf55('0xad')];_0x3939d5['externalUrl']=_0x2f486a[_0xcf55('0x59')]['externalUrl'];return db[_0xcf55('0xae')]['create'](_0x3939d5)[_0xcf55('0x1e')](function(_0xbbf83b){return[_0xbbf83b,!![]];});});}_0xe7b04b[_0xcf55('0xaf')]=_0x558d67['id'];if(_0x2f486a[_0xcf55('0x59')][_0xcf55('0xb0')]&&_0x2f486a[_0xcf55('0x59')][_0xcf55('0xb0')]['id']){_0xe7b04b['id']=_0x2f486a[_0xcf55('0x59')][_0xcf55('0xb0')]['id'];return db[_0xcf55('0xae')][_0xcf55('0x57')]({'where':_0xe7b04b})[_0xcf55('0x1e')](function(_0x42d87b){if(_0x42d87b){return[_0x42d87b,![]];}return db[_0xcf55('0xae')][_0xcf55('0x58')](_0x3939d5)['then'](function(_0x98a890){return[_0x98a890,!![]];});});}return db[_0xcf55('0xae')][_0xcf55('0x58')](_0x3939d5)['then'](function(_0x7759f6){return[_0x7759f6,!![]];});}})[_0xcf55('0xb1')](function(_0x4fb32c,_0x25e175){if(_0x4fb32c){_0x1f97b1=_0x25e175;if(!_0x25e175){var _0x4f4660={'from':(_0x5547f3['contact'][_0xcf55('0xb2')]||'')+'\x20'+(_0x5547f3[_0xcf55('0xb3')][_0xcf55('0xa3')]||'')};if(_0x2f486a[_0xcf55('0x59')][_0xcf55('0xad')]&&_0x2f486a[_0xcf55('0x59')][_0xcf55('0xb4')]&&_0x2f486a[_0xcf55('0x59')]['threadId']!=_0x2f486a[_0xcf55('0x59')][_0xcf55('0xb4')]){_0x4f4660[_0xcf55('0xad')]=_0x2f486a[_0xcf55('0x59')][_0xcf55('0xb4')];}return _0x4fb32c[_0xcf55('0x32')](_0x4f4660);}else{return _0x4fb32c;}}})[_0xcf55('0x1e')](function(_0x1e5942){_0x5547f3[_0xcf55('0xb0')]=_0x1e5942[_0xcf55('0x34')]({'plain':!![]});_0x5547f3['interaction'][_0xcf55('0xb5')]=_0x1f97b1;if(_0x5547f3['interaction']['created']){if(_0x5547f3[_0xcf55('0x9c')]['autoclose']){_0x5547f3[_0xcf55('0x9d')][_0xcf55('0xb6')]({'id':0x0,'priority':_0x5547f3[_0xcf55('0x9d')][_0xcf55('0x45')]+0x1,'app':_0xcf55('0xb7'),'appdata':_0xcf55('0xb8'),'interval':'*,*,*,*'});}}return db[_0xcf55('0xb9')][_0xcf55('0x58')]({'body':_0x2f486a['body'][_0xcf55('0x59')],'ChatWebsiteId':_0x2f486a[_0xcf55('0x55')]['id'],'ChatInteractionId':_0x1e5942['id'],'direction':'in','ContactId':_0x5547f3['contact']['id'],'AttachmentId':_0x2f486a[_0xcf55('0x59')][_0xcf55('0xba')]});})[_0xcf55('0x1e')](function(_0x1cfdec){_0x5547f3[_0xcf55('0x26')]=_0x1cfdec;if(_0x5547f3[_0xcf55('0xb0')][_0xcf55('0xbb')]){return db[_0xcf55('0xbc')][_0xcf55('0x57')]({'attributes':['id',_0xcf55('0x38')],'where':{'id':_0x5547f3['interaction'][_0xcf55('0xbb')]}})[_0xcf55('0x1e')](function(_0x491f41){if(_0x491f41){_0x5547f3[_0xcf55('0x9d')][_0xcf55('0xbd')]({'id':0x0,'priority':0x0,'app':_0xcf55('0xbe'),'appdata':_0x491f41[_0xcf55('0x38')]+','+(_0x5547f3[_0xcf55('0x9c')]['waitForTheAssignedAgent']||0xa),'interval':_0xcf55('0xbf')});_0x5547f3[_0xcf55('0xc0')]=!![];}return respondWithRpcPromise(_0xcf55('0xc1'),_0xcf55('0xc2'),_0x5547f3);});}return respondWithRpcPromise(_0xcf55('0xc1'),'startRouting',_0x5547f3);})[_0xcf55('0x1e')](function(_0x12b03a){respondWithRpcPromise('EventManager',_0xcf55('0xc3'),{'event':'notify','message':_0x12b03a},client9002);return _0x12b03a;})[_0xcf55('0x1e')](respondWithResult(_0x547fce,null))[_0xcf55('0x53')](handleError(_0x547fce,null));};exports[_0xcf55('0xc4')]=function(_0x2c7881,_0x2abe21,_0x1dc198){var _0x50edd7,_0x1e17bc,_0x4f0658;var _0xb4f258=[];var _0x410522=[];var _0x1a9953={};return db[_0xcf55('0x99')][_0xcf55('0x5f')]()[_0xcf55('0x1e')](function(_0x58bf0b){if(!_0x58bf0b){throw new db[(_0xcf55('0x8d'))]['ValidationError'](_0xcf55('0x8f'));}_0x410522=_[_0xcf55('0x90')](_[_0xcf55('0x40')](_0x58bf0b),[_0xcf55('0x91'),'updatedAt']);_0xb4f258=_[_0xcf55('0x90')](_[_0xcf55('0x40')](_0x58bf0b),['createdAt','updatedAt','CompanyId',_0xcf55('0x93')]);if(_0x2c7881[_0xcf55('0x59')]['id']){delete _0x2c7881['body']['id'];}if(_[_0xcf55('0x7d')](_0x2c7881[_0xcf55('0x59')][_0xcf55('0x94')])){throw _0x2abe21[_0xcf55('0x29')](0x1f4)[_0xcf55('0x39')](new db[(_0xcf55('0x8d'))][(_0xcf55('0x8e'))](_0xcf55('0xc5')));}if(_[_0xcf55('0x7d')](_0x2c7881[_0xcf55('0x59')]['body'])||_0x2c7881[_0xcf55('0x59')][_0xcf55('0x59')]===''){throw _0x2abe21[_0xcf55('0x29')](0x1f4)[_0xcf55('0x39')](new db[(_0xcf55('0x8d'))][(_0xcf55('0x8e'))](_0xcf55('0x95')));}if(_[_0xcf55('0x7d')](_0x2c7881[_0xcf55('0x59')][_0xcf55('0xc6')])){throw _0x2abe21[_0xcf55('0x29')](0x1f4)[_0xcf55('0x39')](new db[(_0xcf55('0x8d'))][(_0xcf55('0x8e'))](_0xcf55('0xc7')+_0xb4f258));}if(!_[_0xcf55('0xc8')](_0xb4f258,_0x2c7881[_0xcf55('0x59')][_0xcf55('0xc6')])){throw _0x2abe21['status'](0x1f4)[_0xcf55('0x39')](new db['Sequelize'][(_0xcf55('0x8e'))](_0xcf55('0xc9')+_0xb4f258));}_0x1a9953[_0x2c7881[_0xcf55('0x59')]['mapKeyOffline']]=_0x2c7881[_0xcf55('0x59')][_0xcf55('0x94')];})[_0xcf55('0x1e')](function(){return db['ChatWebsite'][_0xcf55('0x57')]({'where':{'id':_0x2c7881[_0xcf55('0x55')]['id']},'include':[{'model':db[_0xcf55('0x97')],'as':_0xcf55('0x98')}]});})['then'](handleEntityNotFound(_0x2abe21,null))[_0xcf55('0x1e')](function(_0x13613a){if(_0x13613a&&_0x13613a[_0xcf55('0x98')]){_0x1e17bc=_0x13613a;var _0x2dcccc=_[_0xcf55('0x16')](_0x2c7881[_0xcf55('0x59')],{'firstName':_0x2c7881[_0xcf55('0x59')][_0xcf55('0x94')],'phone':_0x2c7881[_0xcf55('0x59')]['from'],'ListId':_0x13613a[_0xcf55('0x93')]});_0x2dcccc[_0x2c7881[_0xcf55('0x59')][_0xcf55('0xc6')]]=_0x2c7881[_0xcf55('0x59')][_0xcf55('0x94')];return db[_0xcf55('0x99')]['findOrCreate']({'where':_0x1a9953,'defaults':_0x2dcccc});}})[_0xcf55('0xb1')](function(_0x2062f3){if(_0x2062f3){_0x4f0658=_0x2062f3;var _0x3738c7=fs[_0xcf55('0xca')](path['join'](config[_0xcf55('0x78')],_0xcf55('0xcb')),_0xcf55('0xcc'));var _0x7da9ac=ejs[_0xcf55('0xcd')](_0x3738c7,{'body':_[_0xcf55('0xce')](_0x2c7881['body']['body']),'bodyTitle':_0x1e17bc[_0xcf55('0xcf')]});return db[_0xcf55('0xd0')][_0xcf55('0x58')]({'body':_0x7da9ac,'ContactId':_0x2062f3['id'],'ChatWebsiteId':_0x1e17bc['id']});}})['then'](function(_0x419296){if(_0x419296){_0x50edd7=_0x419296;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xcf55('0xd1'),'raw':!![]}]});}})['then'](function(_0x1463c6){if(_0x1463c6&&_0x1463c6['Smtp']&&_0x1e17bc[_0xcf55('0xd2')]){var _0x3bc4dd={'tls':{'rejectUnauthorized':![]}};if(_0x1463c6[_0xcf55('0xd1')]['service']){_0x3bc4dd[_0xcf55('0xd3')]=_0x1463c6['Smtp']['service'];}else{_0x3bc4dd[_0xcf55('0xd4')]=_0x1463c6[_0xcf55('0xd1')][_0xcf55('0xd4')];_0x3bc4dd['port']=_0x1463c6[_0xcf55('0xd1')]['port'];_0x3bc4dd[_0xcf55('0xd5')]=_0x1463c6[_0xcf55('0xd1')]['secure'];}if(_0x1463c6[_0xcf55('0xd1')][_0xcf55('0xd6')]){_0x3bc4dd[_0xcf55('0xd7')]={'user':_0x1463c6[_0xcf55('0xd1')]['user'],'pass':_0x1463c6[_0xcf55('0xd1')][_0xcf55('0xd8')]};}return respondWithRpcPromise('SendMail',_0xcf55('0xd9'),{'account':_0x3bc4dd,'message':{'from':util[_0xcf55('0xaa')]('\x22%s\x22\x20<%s>',_0x1463c6['name'],_0x1463c6[_0xcf55('0xda')]||_0x1463c6[_0xcf55('0xd1')][_0xcf55('0x5a')]),'to':_0x1e17bc['forwardOfflineAddress'],'subject':_0x1e17bc[_0xcf55('0xdb')],'text':_0x50edd7[_0xcf55('0x59')]}},client9003)[_0xcf55('0x1e')](function(){return _0x50edd7;})[_0xcf55('0x53')](function(_0x589287){console['error'](_0x589287);});}})[_0xcf55('0x1e')](function(){if(_0x50edd7){return _0x50edd7;}})['then'](respondWithResult(_0x2abe21,null))[_0xcf55('0x53')](handleError(_0x2abe21,null));};exports[_0xcf55('0xdc')]=function(_0x56e20f,_0x3d8222,_0x39f73c){return db[_0xcf55('0xae')][_0xcf55('0x57')]({'where':{'id':_0x56e20f[_0xcf55('0x55')]['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x3d8222,null))['then'](function(_0x14bd70){if(_0x14bd70){return _0x14bd70[_0xcf55('0xdc')](_0x56e20f[_0xcf55('0x59')][_0xcf55('0x67')],_[_0xcf55('0xdd')](_0x56e20f[_0xcf55('0x59')],['ids','id'])||{});}})['then'](respondWithResult(_0x3d8222,null))[_0xcf55('0x53')](handleError(_0x3d8222,null));};exports[_0xcf55('0xde')]=function(_0x3de711,_0x368077,_0x1856bc){var _0x2e1dc6={'raw':![],'where':{}};var _0x2c3c8b={};var _0x5b5454={'count':0x0,'rows':[]};return db[_0xcf55('0x3d')][_0xcf55('0x64')]({'where':{'id':_0x3de711[_0xcf55('0x55')]['id']}})['then'](handleEntityNotFound(_0x368077,null))['then'](function(_0x1f6226){if(_0x1f6226){_0x2c3c8b[_0xcf55('0x3f')]=_['keys'](db[_0xcf55('0xae')][_0xcf55('0x3e')]);_0x2c3c8b[_0xcf55('0x41')]=_[_0xcf55('0x40')](_0x3de711[_0xcf55('0x41')]);_0x2c3c8b[_0xcf55('0x4a')]=_[_0xcf55('0x42')](_0x2c3c8b[_0xcf55('0x3f')],_0x2c3c8b[_0xcf55('0x41')]);_0x2e1dc6[_0xcf55('0x43')]=_[_0xcf55('0x42')](_0x2c3c8b[_0xcf55('0x3f')],qs[_0xcf55('0x44')](_0x3de711[_0xcf55('0x41')]['fields']));_0x2e1dc6[_0xcf55('0x43')]=_0x2e1dc6['attributes'][_0xcf55('0x45')]?_0x2e1dc6[_0xcf55('0x43')]:_0x2c3c8b[_0xcf55('0x3f')];if(!_0x3de711[_0xcf55('0x41')][_0xcf55('0x46')](_0xcf55('0x47'))){_0x2e1dc6[_0xcf55('0x2d')]=qs[_0xcf55('0x2d')](_0x3de711[_0xcf55('0x41')][_0xcf55('0x2d')]);_0x2e1dc6[_0xcf55('0x2c')]=qs['offset'](_0x3de711[_0xcf55('0x41')][_0xcf55('0x2c')]);}_0x2e1dc6[_0xcf55('0x65')]=qs['sort'](_0x3de711[_0xcf55('0x41')][_0xcf55('0x48')]);_0x2e1dc6[_0xcf55('0x49')]=qs['filters'](_[_0xcf55('0x6b')](_0x3de711[_0xcf55('0x41')],_0x2c3c8b[_0xcf55('0x4a')]));_0x2e1dc6[_0xcf55('0x49')][_0xcf55('0x61')]=_0x1f6226['id'];if(_0x3de711['query'][_0xcf55('0x4b')]){_0x2e1dc6[_0xcf55('0x49')]=_[_0xcf55('0x4c')](_0x2e1dc6['where'],{'$or':_['map'](_0x2e1dc6[_0xcf55('0x43')],function(_0x34504a){var _0x5c89a2={};_0x5c89a2[_0x34504a]={'$like':'%'+_0x3de711[_0xcf55('0x41')][_0xcf55('0x4b')]+'%'};return _0x5c89a2;})});}_0x2e1dc6=_[_0xcf55('0x4c')]({},_0x2e1dc6,_0x3de711[_0xcf55('0x56')]);return db[_0xcf55('0xae')]['count']({'where':_0x2e1dc6[_0xcf55('0x49')]})[_0xcf55('0x1e')](function(_0x208461){_0x5b5454['count']=_0x208461;if(_0x3de711[_0xcf55('0x41')]['includeAll']){_0x2e1dc6['include']=[{'model':db['CmContact'],'as':_0xcf55('0xdf'),'required':![]},{'model':db[_0xcf55('0xbc')],'as':_0xcf55('0xe0'),'attributes':[_0xcf55('0x38'),_0xcf55('0xe1'),_0xcf55('0xe2')],'required':![]},{'model':db['Tag'],'as':_0xcf55('0xe3'),'attributes':['id',_0xcf55('0x38'),_0xcf55('0xe4')],'where':_0x3de711[_0xcf55('0x41')][_0xcf55('0xe5')]?{'id':_0x3de711[_0xcf55('0x41')]['tag']}:undefined,'required':_0x3de711[_0xcf55('0x41')][_0xcf55('0xe5')]?!![]:![]}];}return db['ChatInteraction'][_0xcf55('0x51')](_0x2e1dc6);})['then'](function(_0x10ccd9){_0x5b5454[_0xcf55('0x52')]=_0x10ccd9;return _0x5b5454;});}})['then'](respondWithFilteredResult(_0x368077,_0x2e1dc6))['catch'](handleError(_0x368077,null));};function iftimePromise(_0x596c9d,_0x5c4bc0){return respondWithRpcPromise(_0xcf55('0xe6'),_0xcf55('0xe7'),{'command':_0x5c4bc0[_0xcf55('0xe8')]?util['format']('iftime\x20%s,%s',_0x596c9d['interval'],_0x5c4bc0[_0xcf55('0xe8')]):util[_0xcf55('0xaa')](_0xcf55('0xe9'),_0x596c9d[_0xcf55('0xea')])},client9002)[_0xcf55('0x1e')](function(_0x1f2c4a){var _0x1b5c07=_0x1f2c4a&&_0x1f2c4a[_0xcf55('0xeb')](_0xcf55('0xec'))>=0x0?!![]:![];logger[_0xcf55('0x1f')](_0xcf55('0xed'),_0x5c4bc0['id'],_0x596c9d['id'],_0x596c9d['interval'],_0x1b5c07?_0xcf55('0xee'):_0xcf55('0xef'),_0x5c4bc0[_0xcf55('0xe8')]?_0x5c4bc0[_0xcf55('0xe8')]:_0xcf55('0xf0'));return _0x1b5c07;})[_0xcf55('0x53')](function(_0x5cfb36){logger[_0xcf55('0x24')](_0xcf55('0xed'),_0x5c4bc0['id'],_0x596c9d['id'],_0x596c9d[_0xcf55('0xea')],util[_0xcf55('0xf1')](_0x5cfb36,{'showHidden':![],'depth':null}),_0x5c4bc0[_0xcf55('0xe8')]?_0x5c4bc0[_0xcf55('0xe8')]:'No\x20timezone');return![];});}exports[_0xcf55('0xe7')]=function(_0x4cb508,_0x2ed2a8,_0x177dd0){var _0x6900a0=0x0;var _0xf7fd61=0x0;var _0x25b1b1=![];var _0x3cbf92;var _0x3117e8;return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'where':{'id':_0x4cb508[_0xcf55('0x55')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xcf55('0xf2')],'as':_0xcf55('0xf3'),'attributes':['id',_0xcf55('0xea')],'raw':!![]}]}]})[_0xcf55('0x1e')](handleEntityNotFound(_0x2ed2a8,null))['then'](function(_0x2d2ad2){if(_0x2d2ad2){_0x3cbf92=_0x2d2ad2;return _0x2d2ad2['getProactiveActions']({'raw':!![]});}})['then'](function(_0x35afd6){if(_0x3cbf92){if(_0x35afd6){_0x3117e8=_0x35afd6;}}return require('../../config/license/util')[_0xcf55('0x7b')]();})[_0xcf55('0x1e')](function(_0x29c014){if(_0x29c014){_0xf7fd61=_0x29c014[_0xcf55('0xf4')];_0x25b1b1=_0x29c014[_0xcf55('0x7c')];}})[_0xcf55('0x1e')](function(){return db[_0xcf55('0xae')]['count']({'where':{'closed':![]}});})[_0xcf55('0x1e')](function(_0xa8fe23){_0x6900a0=_0xa8fe23;if(_0xf7fd61&&_0xa8fe23>_0xf7fd61){return db[_0xcf55('0xf5')][_0xcf55('0x64')]({'where':{'id':0x1}})['then'](function(_0x368ce7){if(_0x368ce7){_0x368ce7['increment'](_0xcf55('0xf6'));}});}})[_0xcf55('0x1e')](function(){if(_0x3cbf92[_0xcf55('0xf2')]&&_0x3cbf92[_0xcf55('0xf2')]['Intervals']){var _0x1c0d99=[];for(var _0xecf3e8=0x0;_0xecf3e8<_0x3cbf92[_0xcf55('0xf2')][_0xcf55('0xf3')][_0xcf55('0x45')];_0xecf3e8++){var _0x35b116=_0x3cbf92[_0xcf55('0xf2')][_0xcf55('0xf3')][_0xecf3e8][_0xcf55('0x34')]({'plain':!![]});_0x1c0d99[_0xcf55('0xb6')](iftimePromise(_0x35b116,_0x3cbf92));}return BPromise[_0xcf55('0xf7')](_0x1c0d99)['then'](function(_0x4d866e){return _[_0xcf55('0xf8')](_0x4d866e);});}else{return!![];}})[_0xcf55('0x1e')](function(_0x3d3488){var _0x479dce=fs['readFileSync'](path['join'](config['root'],_0xcf55('0xf9')),_0xcf55('0xcc'));var _0x19c4eb={'remote':_0x3cbf92[_0xcf55('0xfa')],'query':querystring[_0xcf55('0x23')](_[_0xcf55('0x4c')](_0x3cbf92[_0xcf55('0x34')]({'plain':!![]}),{'customerIp':_0x4cb508['headers']['x-forwarded-for']||_0x4cb508['headers'][_0xcf55('0xfb')]||_0x4cb508[_0xcf55('0xfc')][_0xcf55('0xfd')]||_0x4cb508['ip'],'referer':_0x4cb508[_0xcf55('0xfe')][_0xcf55('0xa5')],'openedInteractions':_0x6900a0,'maxInteractions':_0xf7fd61,'virtual':_0x25b1b1[_0xcf55('0xf4')],'online':_0x3d3488,'custom':_0x25b1b1}))[_0xcf55('0xff')](/'/g,'\x5c\x27')};_0x2ed2a8[_0xcf55('0x39')](ejs['render'](Mustache[_0xcf55('0xcd')](_0x479dce,_0x19c4eb),{'proactiveActions':_0x3117e8,'alignment':_0x3cbf92[_0xcf55('0x100')],'verticalAlignment':_0x3cbf92[_0xcf55('0x101')]}));})[_0xcf55('0x53')](handleError(_0x2ed2a8,null));};exports['addApplications']=function(_0x4bc090,_0x5dd366,_0x1249d1){return db[_0xcf55('0x3d')][_0xcf55('0x64')]({'where':{'id':_0x4bc090[_0xcf55('0x55')]['id']}})['then'](handleEntityNotFound(_0x5dd366,null))['then'](function(_0x360ef3){if(_0x360ef3){return db[_0xcf55('0x102')][_0xcf55('0x103')](function(_0x599140){return db[_0xcf55('0x104')][_0xcf55('0x33')]({'where':{'ChatWebsiteId':_0x4bc090['params']['id']},'transaction':_0x599140})[_0xcf55('0x1e')](function(_0x1d5991){var _0x913477=_['map'](_0x4bc090[_0xcf55('0x59')],function(_0x23a57e){_0x23a57e[_0xcf55('0x61')]=_0x4bc090[_0xcf55('0x55')]['id'];return _0x23a57e;});return db[_0xcf55('0x104')][_0xcf55('0x105')](_0x913477,{'transaction':_0x599140});});})['then'](function(){return db['ChatApplication'][_0xcf55('0x106')]({'where':{'ChatWebsiteId':_0x4bc090[_0xcf55('0x55')]['id']},'order':_0xcf55('0xa1')});});}})[_0xcf55('0x1e')](respondWithResult(_0x5dd366,null))[_0xcf55('0x53')](handleError(_0x5dd366,null));};exports[_0xcf55('0x107')]=function(_0x57c87d,_0x3b827e,_0xba9afd){var _0x29e73b={};var _0x56c024={};var _0x424502;var _0x3ec475;return db['ChatWebsite']['findOne']({'where':{'id':_0x57c87d[_0xcf55('0x55')]['id']}})['then'](handleEntityNotFound(_0x3b827e,null))[_0xcf55('0x1e')](function(_0x2244f9){if(_0x2244f9){_0x424502=_0x2244f9;_0x56c024[_0xcf55('0x3f')]=_[_0xcf55('0x40')](db[_0xcf55('0x104')][_0xcf55('0x3e')]);_0x56c024[_0xcf55('0x41')]=_[_0xcf55('0x40')](_0x57c87d[_0xcf55('0x41')]);_0x56c024[_0xcf55('0x4a')]=_[_0xcf55('0x42')](_0x56c024[_0xcf55('0x3f')],_0x56c024['query']);_0x29e73b[_0xcf55('0x43')]=_[_0xcf55('0x42')](_0x56c024[_0xcf55('0x3f')],qs['fields'](_0x57c87d[_0xcf55('0x41')]['fields']));_0x29e73b[_0xcf55('0x43')]=_0x29e73b[_0xcf55('0x43')][_0xcf55('0x45')]?_0x29e73b[_0xcf55('0x43')]:_0x56c024['model'];_0x29e73b['order']=qs[_0xcf55('0x48')](_0x57c87d[_0xcf55('0x41')][_0xcf55('0x48')]);_0x29e73b[_0xcf55('0x49')]=qs[_0xcf55('0x4a')](_[_0xcf55('0x6b')](_0x57c87d[_0xcf55('0x41')],_0x56c024[_0xcf55('0x4a')]));if(_0x57c87d[_0xcf55('0x41')][_0xcf55('0x4b')]){_0x29e73b[_0xcf55('0x49')]=_['merge'](_0x29e73b[_0xcf55('0x49')],{'$or':_[_0xcf55('0x108')](_0x29e73b[_0xcf55('0x43')],function(_0x42292c){var _0x56ffe8={};_0x56ffe8[_0x42292c]={'$like':'%'+_0x57c87d['query'][_0xcf55('0x4b')]+'%'};return _0x56ffe8;})});}_0x29e73b=_['merge']({},_0x29e73b,_0x57c87d[_0xcf55('0x56')]);return _0x424502[_0xcf55('0x107')](_0x29e73b);}})[_0xcf55('0x1e')](function(_0x288d18){if(_0x288d18){_0x3ec475=_0x288d18['length'];if(!_0x57c87d['query'][_0xcf55('0x46')](_0xcf55('0x47'))){_0x29e73b[_0xcf55('0x2d')]=qs[_0xcf55('0x2d')](_0x57c87d[_0xcf55('0x41')][_0xcf55('0x2d')]);_0x29e73b[_0xcf55('0x2c')]=qs[_0xcf55('0x2c')](_0x57c87d[_0xcf55('0x41')]['offset']);}return _0x424502[_0xcf55('0x107')](_0x29e73b);}})['then'](function(_0x1d7878){if(_0x1d7878){return _0x1d7878?{'count':_0x3ec475,'rows':_0x1d7878}:null;}})['then'](respondWithResult(_0x3b827e,null))[_0xcf55('0x53')](handleError(_0x3b827e,null));};exports['addProactiveActions']=function(_0x3ac634,_0x8eea93,_0x25b700){return db[_0xcf55('0x109')]['find']({'where':{'id':_0x3ac634[_0xcf55('0x55')]['id']}})['then'](handleEntityNotFound(_0x8eea93,null))['then'](function(_0x21f8b2){if(_0x21f8b2){return _0x21f8b2[_0xcf55('0x10a')](_0x3ac634[_0xcf55('0x59')][_0xcf55('0x67')],_[_0xcf55('0xdd')](_0x3ac634[_0xcf55('0x59')],[_0xcf55('0x67'),'id'])||{});}})[_0xcf55('0x1e')](respondWithResult(_0x8eea93,null))[_0xcf55('0x53')](handleError(_0x8eea93,null));};exports[_0xcf55('0x10b')]=function(_0x500803,_0x483d77,_0x58b0ab){var _0x3a2ba1={};var _0x442f53={};var _0x3cb6d6;var _0x34fca9;return db[_0xcf55('0x3d')]['findOne']({'where':{'id':_0x500803[_0xcf55('0x55')]['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x483d77,null))['then'](function(_0x4de937){if(_0x4de937){_0x3cb6d6=_0x4de937;_0x442f53[_0xcf55('0x3f')]=_[_0xcf55('0x40')](db[_0xcf55('0x10c')][_0xcf55('0x3e')]);_0x442f53['query']=_['keys'](_0x500803[_0xcf55('0x41')]);_0x442f53['filters']=_[_0xcf55('0x42')](_0x442f53['model'],_0x442f53[_0xcf55('0x41')]);_0x3a2ba1['attributes']=_['intersection'](_0x442f53['model'],qs[_0xcf55('0x44')](_0x500803['query'][_0xcf55('0x44')]));_0x3a2ba1[_0xcf55('0x43')]=_0x3a2ba1[_0xcf55('0x43')][_0xcf55('0x45')]?_0x3a2ba1[_0xcf55('0x43')]:_0x442f53[_0xcf55('0x3f')];_0x3a2ba1['order']=qs[_0xcf55('0x48')](_0x500803[_0xcf55('0x41')][_0xcf55('0x48')]);_0x3a2ba1[_0xcf55('0x49')]=qs[_0xcf55('0x4a')](_['pick'](_0x500803[_0xcf55('0x41')],_0x442f53[_0xcf55('0x4a')]));if(_0x500803[_0xcf55('0x41')][_0xcf55('0x4b')]){_0x3a2ba1[_0xcf55('0x49')]=_['merge'](_0x3a2ba1[_0xcf55('0x49')],{'$or':_[_0xcf55('0x108')](_0x3a2ba1[_0xcf55('0x43')],function(_0x4d5240){var _0x40db70={};_0x40db70[_0x4d5240]={'$like':'%'+_0x500803[_0xcf55('0x41')][_0xcf55('0x4b')]+'%'};return _0x40db70;})});}_0x3a2ba1=_[_0xcf55('0x4c')]({},_0x3a2ba1,_0x500803[_0xcf55('0x56')]);return _0x3cb6d6['getProactiveActions'](_0x3a2ba1);}})[_0xcf55('0x1e')](function(_0x2127b0){if(_0x2127b0){_0x34fca9=_0x2127b0[_0xcf55('0x45')];if(!_0x500803['query'][_0xcf55('0x46')](_0xcf55('0x47'))){_0x3a2ba1[_0xcf55('0x2d')]=qs['limit'](_0x500803[_0xcf55('0x41')][_0xcf55('0x2d')]);_0x3a2ba1[_0xcf55('0x2c')]=qs['offset'](_0x500803[_0xcf55('0x41')]['offset']);}return _0x3cb6d6[_0xcf55('0x10b')](_0x3a2ba1);}})[_0xcf55('0x1e')](function(_0x3640df){if(_0x3640df){return _0x3640df?{'count':_0x34fca9,'rows':_0x3640df}:null;}})[_0xcf55('0x1e')](respondWithResult(_0x483d77,null))[_0xcf55('0x53')](handleError(_0x483d77,null));};exports[_0xcf55('0x10d')]=function(_0x461757,_0x347e79,_0x11c66f){var _0xf69cee=_0x461757[_0xcf55('0x41')][_0xcf55('0x10e')]===_0xcf55('0x10f')?'offlineForm':_0xcf55('0x110');return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'attributes':['id',_0xf69cee],'where':{'id':_0x461757[_0xcf55('0x55')]['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x347e79,null))[_0xcf55('0x1e')](function(_0x248f3d){if(_0x248f3d){var _0x32b5fa=_0x248f3d[_0xf69cee];var _0x28d93f=_0x32b5fa&&_0x32b5fa[_0xcf55('0x111')]?_0x32b5fa[_0xcf55('0x111')]:[];_0x347e79[_0xcf55('0x39')]({'fromKey':_[_0xcf55('0x7d')](_0x32b5fa[_0xcf55('0x112')])?undefined:_0x32b5fa[_0xcf55('0x112')],'count':_0x28d93f['length'],'rows':_0x28d93f});}})[_0xcf55('0x53')](handleError(_0x347e79,null));};exports[_0xcf55('0x113')]=function(_0x3e4289,_0x1274b3,_0x474a48){var _0x15346d={'raw':!![],'where':{}};var _0x315c50={};var _0x1c5f8b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcf55('0x64')]({'where':{'id':_0x3e4289[_0xcf55('0x55')]['id']}})['then'](handleEntityNotFound(_0x1274b3,null))[_0xcf55('0x1e')](function(_0x5a832a){if(_0x5a832a){_0x315c50[_0xcf55('0x3f')]=_[_0xcf55('0x40')](db[_0xcf55('0xd0')]['rawAttributes']);_0x315c50[_0xcf55('0x41')]=_[_0xcf55('0x40')](_0x3e4289[_0xcf55('0x41')]);_0x315c50['filters']=_[_0xcf55('0x42')](_0x315c50[_0xcf55('0x3f')],_0x315c50[_0xcf55('0x41')]);_0x15346d['attributes']=_[_0xcf55('0x42')](_0x315c50[_0xcf55('0x3f')],qs[_0xcf55('0x44')](_0x3e4289[_0xcf55('0x41')][_0xcf55('0x44')]));_0x15346d['attributes']=_0x15346d[_0xcf55('0x43')][_0xcf55('0x45')]?_0x15346d[_0xcf55('0x43')]:_0x315c50[_0xcf55('0x3f')];if(!_0x3e4289[_0xcf55('0x41')][_0xcf55('0x46')](_0xcf55('0x47'))){_0x15346d['limit']=qs['limit'](_0x3e4289['query'][_0xcf55('0x2d')]);_0x15346d['offset']=qs['offset'](_0x3e4289[_0xcf55('0x41')][_0xcf55('0x2c')]);}_0x15346d[_0xcf55('0x65')]=qs[_0xcf55('0x48')](_0x3e4289[_0xcf55('0x41')]['sort']);_0x15346d['where']=qs[_0xcf55('0x4a')](_[_0xcf55('0x6b')](_0x3e4289[_0xcf55('0x41')],_0x315c50['filters']));_0x15346d[_0xcf55('0x49')][_0xcf55('0x61')]=_0x5a832a['id'];if(_0x3e4289[_0xcf55('0x41')][_0xcf55('0x4b')]){_0x15346d[_0xcf55('0x49')]=_[_0xcf55('0x4c')](_0x15346d[_0xcf55('0x49')],{'$or':_[_0xcf55('0x108')](_0x15346d['attributes'],function(_0x42f88b){var _0xd1d485={};_0xd1d485[_0x42f88b]={'$like':'%'+_0x3e4289['query']['filter']+'%'};return _0xd1d485;})});}_0x15346d=_[_0xcf55('0x4c')]({},_0x15346d,_0x3e4289['options']);return db[_0xcf55('0xd0')]['count']({'where':_0x15346d[_0xcf55('0x49')]})['then'](function(_0x3f276b){_0x1c5f8b['count']=_0x3f276b;if(_0x3e4289[_0xcf55('0x41')]['includeAll']){_0x15346d[_0xcf55('0x6c')]=[{'all':!![]}];}return db[_0xcf55('0xd0')][_0xcf55('0x51')](_0x15346d);})[_0xcf55('0x1e')](function(_0x374752){_0x1c5f8b[_0xcf55('0x52')]=_0x374752;return _0x1c5f8b;});}})[_0xcf55('0x1e')](respondWithFilteredResult(_0x1274b3,_0x15346d))['catch'](handleError(_0x1274b3,null));};exports[_0xcf55('0x114')]=function(_0x3d7bf0,_0x57483c,_0x297817){return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'where':{'id':_0x3d7bf0[_0xcf55('0x55')]['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x57483c,null))[_0xcf55('0x1e')](function(_0x1eddd2){if(_0x1eddd2){return _0x1eddd2['addAgents'](_0x3d7bf0[_0xcf55('0x59')][_0xcf55('0x67')],_[_0xcf55('0xdd')](_0x3d7bf0[_0xcf55('0x59')],['ids','id'])||{})['spread'](function(_0xe2612e){for(var _0x206fed=0x0;_0x206fed<_0x3d7bf0[_0xcf55('0x59')][_0xcf55('0x67')][_0xcf55('0x45')];_0x206fed+=0x1){socket[_0xcf55('0x115')]('userChatWebsite:save',{'UserId':_0x3d7bf0[_0xcf55('0x59')][_0xcf55('0x67')][_0x206fed],'ChatWebsiteId':_0x3d7bf0[_0xcf55('0x55')]['id']});}return _0xe2612e;});}})[_0xcf55('0x1e')](respondWithResult(_0x57483c,null))[_0xcf55('0x53')](handleError(_0x57483c,null));};exports['removeAgents']=function(_0x4f74ac,_0x22d707,_0x39e327){var _0x4c067a;return db[_0xcf55('0x3d')][_0xcf55('0x57')]({'where':{'id':_0x4f74ac['params']['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x22d707,null))[_0xcf55('0x1e')](function(_0x447c6c){if(_0x447c6c){return _0x447c6c[_0xcf55('0x116')](_0x4f74ac[_0xcf55('0x41')][_0xcf55('0x67')])[_0xcf55('0x1e')](function(_0x2268ed){if(_[_0xcf55('0x117')](_0x4f74ac[_0xcf55('0x41')][_0xcf55('0x67')])){for(var _0x4d6393=0x0;_0x4d6393<_0x4f74ac[_0xcf55('0x41')]['ids'][_0xcf55('0x45')];_0x4d6393+=0x1){socket[_0xcf55('0x115')]('userChatWebsite:remove',{'UserId':_0x4f74ac['query'][_0xcf55('0x67')][_0x4d6393],'ChatWebsiteId':_0x4f74ac[_0xcf55('0x55')]['id']});}}else{socket['emit'](_0xcf55('0x118'),{'UserId':_0x4f74ac[_0xcf55('0x41')][_0xcf55('0x67')],'ChatWebsiteId':_0x4f74ac[_0xcf55('0x55')]['id']});}});}})[_0xcf55('0x1e')](respondWithStatusCode(_0x22d707,null))[_0xcf55('0x53')](handleError(_0x22d707,null));};exports[_0xcf55('0x119')]=function(_0x55b23,_0x457e06,_0x2aa64e){var _0x330c24={};var _0x1163af={};var _0xcd62;var _0x1a166a;return db[_0xcf55('0x3d')][_0xcf55('0x64')]({'where':{'id':_0x55b23[_0xcf55('0x55')]['id']}})[_0xcf55('0x1e')](handleEntityNotFound(_0x457e06,null))[_0xcf55('0x1e')](function(_0x316cf2){if(_0x316cf2){_0xcd62=_0x316cf2;_0x1163af[_0xcf55('0x3f')]=_['keys'](db[_0xcf55('0xbc')][_0xcf55('0x3e')]);_0x1163af[_0xcf55('0x41')]=_[_0xcf55('0x40')](_0x55b23[_0xcf55('0x41')]);_0x1163af[_0xcf55('0x4a')]=_[_0xcf55('0x42')](_0x1163af[_0xcf55('0x3f')],_0x1163af[_0xcf55('0x41')]);_0x330c24[_0xcf55('0x43')]=_['intersection'](_0x1163af['model'],qs[_0xcf55('0x44')](_0x55b23[_0xcf55('0x41')]['fields']));_0x330c24[_0xcf55('0x43')]=_0x330c24[_0xcf55('0x43')][_0xcf55('0x45')]?_0x330c24[_0xcf55('0x43')]:_0x1163af[_0xcf55('0x3f')];_0x330c24[_0xcf55('0x65')]=qs[_0xcf55('0x48')](_0x55b23[_0xcf55('0x41')][_0xcf55('0x48')]);_0x330c24['where']=qs[_0xcf55('0x4a')](_[_0xcf55('0x6b')](_0x55b23[_0xcf55('0x41')],_0x1163af['filters']));if(_0x55b23['query'][_0xcf55('0x4b')]){_0x330c24['where']=_['merge'](_0x330c24[_0xcf55('0x49')],{'$or':_['map'](_0x330c24[_0xcf55('0x43')],function(_0x360239){var _0x2ae929={};_0x2ae929[_0x360239]={'$like':'%'+_0x55b23[_0xcf55('0x41')][_0xcf55('0x4b')]+'%'};return _0x2ae929;})});}_0x330c24=_['merge']({},_0x330c24,_0x55b23['options']);return _0xcd62[_0xcf55('0x119')](_0x330c24);}})[_0xcf55('0x1e')](function(_0x18c3fd){if(_0x18c3fd){_0x1a166a=_0x18c3fd[_0xcf55('0x45')];if(!_0x55b23[_0xcf55('0x41')][_0xcf55('0x46')](_0xcf55('0x47'))){_0x330c24['limit']=qs[_0xcf55('0x2d')](_0x55b23[_0xcf55('0x41')][_0xcf55('0x2d')]);_0x330c24[_0xcf55('0x2c')]=qs[_0xcf55('0x2c')](_0x55b23[_0xcf55('0x41')]['offset']);}return _0xcd62[_0xcf55('0x119')](_0x330c24);}})[_0xcf55('0x1e')](function(_0x17407e){if(_0x17407e){return _0x17407e?{'count':_0x1a166a,'rows':_0x17407e}:null;}})[_0xcf55('0x1e')](respondWithResult(_0x457e06,null))[_0xcf55('0x53')](handleError(_0x457e06,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index fae833c..de8701b 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 _0xc8ba=['ChatWebsite','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xc8ba,0x186));var _0xac8b=function(_0x53b594,_0x559767){_0x53b594=_0x53b594-0x0;var _0x1e616f=_0xc8ba[_0x53b594];return _0x1e616f;};'use strict';var EventEmitter=require(_0xac8b('0x0'));var ChatWebsite=require(_0xac8b('0x1'))['db'][_0xac8b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xac8b('0x3'),'afterDestroy':_0xac8b('0x4')};function emitEvent(_0x3f76da){return function(_0x1bc800,_0x53e966,_0x2b1486){ChatWebsiteEvents[_0xac8b('0x5')](_0x3f76da+':'+_0x1bc800['id'],_0x1bc800);ChatWebsiteEvents['emit'](_0x3f76da,_0x1bc800);_0x2b1486(null);};}for(var e in events){if(events[_0xac8b('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xac8b('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x236d=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xd236('0x0'));var ChatWebsite=require(_0xd236('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd236('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd236('0x3'),'afterDestroy':_0xd236('0x4')};function emitEvent(_0x22533a){return function(_0x17ebae,_0x52cdc5,_0x56bc88){ChatWebsiteEvents[_0xd236('0x5')](_0x22533a+':'+_0x17ebae['id'],_0x17ebae);ChatWebsiteEvents[_0xd236('0x5')](_0x22533a,_0x17ebae);_0x56bc88(null);};}for(var e in events){if(events[_0xd236('0x6')](e)){var event=events[e];ChatWebsite[_0xd236('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 4d6df94..a69eb48 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 _0x90db=['api','define','ChatWebsite','chat_websites','util','../../config/logger'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x90db,0x1c0));var _0xb90d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x90db[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xb90d('0x0'));var logger=require(_0xb90d('0x1'))(_0xb90d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x17e9b9,_0x29a2e7){return _0x17e9b9[_0xb90d('0x3')](_0xb90d('0x4'),attributes,{'tableName':_0xb90d('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb821=['../../config/logger','bluebird','exports','define','chat_websites','util'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0xb821,0xa7));var _0x1b82=function(_0x1c6898,_0x5ba9ac){_0x1c6898=_0x1c6898-0x0;var _0x397d1a=_0xb821[_0x1c6898];return _0x397d1a;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var attributes=require('./chatWebsite.attributes');module[_0x1b82('0x3')]=function(_0x1403ab,_0x3fadf0){return _0x1403ab[_0x1b82('0x4')]('ChatWebsite',attributes,{'tableName':_0x1b82('0x5'),'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 a6e0838..92fa5dc 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 _0xe802=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then'];(function(_0x29ba40,_0x4d6aa1){var _0xf3140a=function(_0x2ef279){while(--_0x2ef279){_0x29ba40['push'](_0x29ba40['shift']());}};_0xf3140a(++_0x4d6aa1);}(_0xe802,0x97));var _0x2e80=function(_0xbfd164,_0x26b248){_0xbfd164=_0xbfd164-0x0;var _0x34b32=_0xe802[_0xbfd164];return _0x34b32;};'use strict';var _=require('lodash');var util=require(_0x2e80('0x0'));var moment=require('moment');var BPromise=require(_0x2e80('0x1'));var rs=require(_0x2e80('0x2'));var fs=require('fs');var Redis=require(_0x2e80('0x3'));var db=require(_0x2e80('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e80('0x5'))(_0x2e80('0x6'));var config=require(_0x2e80('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2e80('0x8')][_0x2e80('0x9')]({'port':0x232a});config[_0x2e80('0xa')]=_[_0x2e80('0xb')](config[_0x2e80('0xa')],{'host':_0x2e80('0xc'),'port':0x18eb});var socket=require(_0x2e80('0xd'))(new Redis(config[_0x2e80('0xa')]));require(_0x2e80('0xe'))['register'](socket);function respondWithRpcPromise(_0x40ff78,_0x2423bf,_0x58d97b){return new BPromise(function(_0x3d3181,_0x4345ff){return client[_0x2e80('0xf')](_0x40ff78,_0x58d97b)[_0x2e80('0x10')](function(_0x9d3613){logger[_0x2e80('0x11')](_0x2e80('0x12'),_0x2423bf,_0x2e80('0x13'));logger[_0x2e80('0x14')](_0x2e80('0x15'),_0x2423bf,_0x2e80('0x13'),JSON[_0x2e80('0x16')](_0x9d3613));if(_0x9d3613['error']){if(_0x9d3613[_0x2e80('0x17')][_0x2e80('0x18')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2423bf,_0x9d3613[_0x2e80('0x17')][_0x2e80('0x19')]);return _0x4345ff(_0x9d3613[_0x2e80('0x17')][_0x2e80('0x19')]);}logger[_0x2e80('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x2423bf,_0x9d3613[_0x2e80('0x17')][_0x2e80('0x19')]);return _0x3d3181(_0x9d3613[_0x2e80('0x17')][_0x2e80('0x19')]);}else{logger['info'](_0x2e80('0x12'),_0x2423bf,_0x2e80('0x13'));_0x3d3181(_0x9d3613[_0x2e80('0x1a')]['message']);}})[_0x2e80('0x1b')](function(_0x53c6e6){logger[_0x2e80('0x17')](_0x2e80('0x12'),_0x2423bf,_0x53c6e6);_0x4345ff(_0x53c6e6);});});} \ No newline at end of file +var _0x660e=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/logger'];(function(_0x47c894,_0xc09b1f){var _0x1338d0=function(_0x3d4e23){while(--_0x3d4e23){_0x47c894['push'](_0x47c894['shift']());}};_0x1338d0(++_0xc09b1f);}(_0x660e,0xf7));var _0xe660=function(_0x2b9204,_0x14e282){_0x2b9204=_0x2b9204-0x0;var _0x42e312=_0x660e[_0x2b9204];return _0x42e312;};'use strict';var _=require(_0xe660('0x0'));var util=require('util');var moment=require(_0xe660('0x1'));var BPromise=require('bluebird');var rs=require(_0xe660('0x2'));var fs=require('fs');var Redis=require(_0xe660('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe660('0x4'))('rpc');var config=require(_0xe660('0x5'));var jayson=require(_0xe660('0x6'));var client=jayson[_0xe660('0x7')][_0xe660('0x8')]({'port':0x232a});config[_0xe660('0x9')]=_[_0xe660('0xa')](config['redis'],{'host':_0xe660('0xb'),'port':0x18eb});var socket=require(_0xe660('0xc'))(new Redis(config['redis']));require(_0xe660('0xd'))[_0xe660('0xe')](socket);function respondWithRpcPromise(_0x83e741,_0x33001e,_0x590cc9){return new BPromise(function(_0x3e47d4,_0x2e450a){return client[_0xe660('0xf')](_0x83e741,_0x590cc9)[_0xe660('0x10')](function(_0x2c640){logger[_0xe660('0x11')](_0xe660('0x12'),_0x33001e,_0xe660('0x13'));logger[_0xe660('0x14')](_0xe660('0x15'),_0x33001e,_0xe660('0x13'),JSON[_0xe660('0x16')](_0x2c640));if(_0x2c640[_0xe660('0x17')]){if(_0x2c640[_0xe660('0x17')][_0xe660('0x18')]===0x1f4){logger[_0xe660('0x17')](_0xe660('0x12'),_0x33001e,_0x2c640[_0xe660('0x17')][_0xe660('0x19')]);return _0x2e450a(_0x2c640['error'][_0xe660('0x19')]);}logger[_0xe660('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x33001e,_0x2c640[_0xe660('0x17')][_0xe660('0x19')]);return _0x3e47d4(_0x2c640[_0xe660('0x17')][_0xe660('0x19')]);}else{logger[_0xe660('0x11')](_0xe660('0x12'),_0x33001e,_0xe660('0x13'));_0x3e47d4(_0x2c640[_0xe660('0x1a')][_0xe660('0x19')]);}})[_0xe660('0x1b')](function(_0x130124){logger[_0xe660('0x17')](_0xe660('0x12'),_0x33001e,_0x130124);_0x2e450a(_0x130124);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 7d0b37e..7ddf2b0 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 _0x366c=['emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x248c66,_0x3d7b1f){var _0x210ad1=function(_0x5a7ffd){while(--_0x5a7ffd){_0x248c66['push'](_0x248c66['shift']());}};_0x210ad1(++_0x3d7b1f);}(_0x366c,0x9d));var _0xc366=function(_0x37c87a,_0x3fb2a2){_0x37c87a=_0x37c87a-0x0;var _0x288005=_0x366c[_0x37c87a];return _0x288005;};'use strict';var ChatWebsiteEvents=require(_0xc366('0x0'));var events=[_0xc366('0x1'),_0xc366('0x2'),'update'];function createListener(_0x362f6f,_0x2a48bc){return function(_0x1350be){_0x2a48bc[_0xc366('0x3')](_0x362f6f,_0x1350be);};}function removeListener(_0x3756a5,_0x42a36a){return function(){ChatWebsiteEvents[_0xc366('0x4')](_0x3756a5,_0x42a36a);};}exports[_0xc366('0x5')]=function(_0x8d7838){for(var _0x4a305f=0x0,_0x5e0305=events[_0xc366('0x6')];_0x4a305f<_0x5e0305;_0x4a305f++){var _0x15e875=events[_0x4a305f];var _0x300144=createListener(_0xc366('0x7')+_0x15e875,_0x8d7838);ChatWebsiteEvents['on'](_0x15e875,_0x300144);}}; \ No newline at end of file +var _0x855f=['./chatWebsite.events','remove','update','length','chatWebsite:'];(function(_0x24bb1c,_0x1238cf){var _0x45b7bd=function(_0x47356d){while(--_0x47356d){_0x24bb1c['push'](_0x24bb1c['shift']());}};_0x45b7bd(++_0x1238cf);}(_0x855f,0x145));var _0xf855=function(_0x2a8e3d,_0x2ef28a){_0x2a8e3d=_0x2a8e3d-0x0;var _0x6b34e=_0x855f[_0x2a8e3d];return _0x6b34e;};'use strict';var ChatWebsiteEvents=require(_0xf855('0x0'));var events=['save',_0xf855('0x1'),_0xf855('0x2')];function createListener(_0xda62d6,_0xfe09fb){return function(_0x39f5dc){_0xfe09fb['emit'](_0xda62d6,_0x39f5dc);};}function removeListener(_0x4620ba,_0x33ad4f){return function(){ChatWebsiteEvents['removeListener'](_0x4620ba,_0x33ad4f);};}exports['register']=function(_0x8d6830){for(var _0x63fab1=0x0,_0x41e1ac=events[_0xf855('0x3')];_0x63fab1<_0x41e1ac;_0x63fab1++){var _0xe6470d=events[_0x63fab1];var _0x3a9bda=createListener(_0xf855('0x4')+_0xe6470d,_0x8d6830);ChatWebsiteEvents['on'](_0xe6470d,_0x3a9bda);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 16df428..6559dd9 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 _0x02ef=['/:id/dispositions','getDispositions','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','post','/:id/canned_answers','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','addLogo','join','server/files/images/avatars/','addCustomerAvatar','diskStorage','/:id/notify','notify','addInteraction','addApplications','addProactiveActions','addAgents','delete','destroy','removeAnswers','removeAgents','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x02ef,0x11a));var _0xf02e=function(_0x227b67,_0x5c4075){_0x227b67=_0x227b67-0x0;var _0x16f616=_0x02ef[_0x227b67];return _0x16f616;};'use strict';var multer=require(_0xf02e('0x0'));var util=require('util');var path=require(_0xf02e('0x1'));var timeout=require('connect-timeout');var express=require(_0xf02e('0x2'));var router=express[_0xf02e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf02e('0x4'));var config=require(_0xf02e('0x5'));var controller=require(_0xf02e('0x6'));router[_0xf02e('0x7')]('/',auth[_0xf02e('0x8')](),controller['index']);router[_0xf02e('0x7')](_0xf02e('0x9'),auth[_0xf02e('0x8')](),controller[_0xf02e('0xa')]);router[_0xf02e('0x7')](_0xf02e('0xb'),auth[_0xf02e('0x8')](),controller[_0xf02e('0xc')]);router[_0xf02e('0x7')](_0xf02e('0xd'),auth[_0xf02e('0x8')](),controller[_0xf02e('0xe')]);router['get']('/:id/canned_answers',auth[_0xf02e('0x8')](),controller[_0xf02e('0xf')]);router['get']('/:id/logo',controller['getLogo']);router[_0xf02e('0x7')](_0xf02e('0x10'),controller[_0xf02e('0x11')]);router[_0xf02e('0x7')](_0xf02e('0x12'),controller[_0xf02e('0x13')]);router['get'](_0xf02e('0x14'),controller['getSystemAvatar']);router[_0xf02e('0x7')](_0xf02e('0x15'),auth['isAuthenticated'](),controller[_0xf02e('0x16')]);router[_0xf02e('0x7')]('/:id/snippet',controller[_0xf02e('0x17')]);router['get'](_0xf02e('0x18'),auth[_0xf02e('0x8')](),controller[_0xf02e('0x19')]);router[_0xf02e('0x7')](_0xf02e('0x1a'),auth['isAuthenticated'](),controller[_0xf02e('0x1b')]);router[_0xf02e('0x7')](_0xf02e('0x1c'),controller['getFields']);router[_0xf02e('0x7')](_0xf02e('0x1d'),auth['isAuthenticated'](),controller[_0xf02e('0x1e')]);router[_0xf02e('0x7')](_0xf02e('0x1f'),auth[_0xf02e('0x8')](),controller['getAgents']);router[_0xf02e('0x20')]('/',auth[_0xf02e('0x8')](),controller['create']);router[_0xf02e('0x20')](_0xf02e('0xd'),auth[_0xf02e('0x8')](),controller['addDisposition']);router[_0xf02e('0x20')](_0xf02e('0x21'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x40e168,_0x8d3b44,_0x2890ab){_0x2890ab(null,path['join'](config[_0xf02e('0x22')],_0xf02e('0x23')));},'filename':function(_0x4b56ac,_0x167fe2,_0x2db860){_0x2db860(null,util[_0xf02e('0x24')](_0xf02e('0x25'),Date[_0xf02e('0x26')](),_0x167fe2[_0xf02e('0x27')]));}})});router[_0xf02e('0x20')](_0xf02e('0x28'),upload[_0xf02e('0x29')](_0xf02e('0x2a')),controller[_0xf02e('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x354d8d,_0x4507a0,_0x3c1348){_0x3c1348(null,path['join'](config[_0xf02e('0x22')],'server/files/images/avatars/'));},'filename':function(_0x34bfc3,_0x2f63d9,_0x4d2ea8){_0x4d2ea8(null,util[_0xf02e('0x24')]('%s-%s',Date[_0xf02e('0x26')](),_0x2f63d9['originalname']));}})});router[_0xf02e('0x20')](_0xf02e('0x10'),upload[_0xf02e('0x29')](_0xf02e('0x2a')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x238ad3,_0x123b1d,_0x5cf303){_0x5cf303(null,path[_0xf02e('0x2c')](config['root'],_0xf02e('0x2d')));},'filename':function(_0x473a24,_0x3f8c66,_0x5baf22){_0x5baf22(null,util[_0xf02e('0x24')](_0xf02e('0x25'),Date['now'](),_0x3f8c66['originalname']));}})});router['post'](_0xf02e('0x12'),upload['single'](_0xf02e('0x2a')),controller[_0xf02e('0x2e')]);var upload=multer({'storage':multer[_0xf02e('0x2f')]({'destination':function(_0x4c64a2,_0x40df7c,_0x1fdb83){_0x1fdb83(null,path[_0xf02e('0x2c')](config['root'],_0xf02e('0x2d')));},'filename':function(_0x53ed62,_0x316a72,_0x55cc9e){_0x55cc9e(null,util[_0xf02e('0x24')](_0xf02e('0x25'),Date['now'](),_0x316a72[_0xf02e('0x27')]));}})});router['post'](_0xf02e('0x14'),upload[_0xf02e('0x29')](_0xf02e('0x2a')),controller['addSystemAvatar']);router['post'](_0xf02e('0x30'),controller[_0xf02e('0x31')]);router[_0xf02e('0x20')]('/:id/offline',controller['offline']);router[_0xf02e('0x20')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xf02e('0x32')]);router[_0xf02e('0x20')](_0xf02e('0x18'),auth['isAuthenticated'](),controller[_0xf02e('0x33')]);router[_0xf02e('0x20')]('/:id/proactive_actions',auth[_0xf02e('0x8')](),controller[_0xf02e('0x34')]);router[_0xf02e('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0xf02e('0x35')]);router['put'](_0xf02e('0xb'),auth[_0xf02e('0x8')](),controller['update']);router[_0xf02e('0x36')]('/:id',auth[_0xf02e('0x8')](),controller[_0xf02e('0x37')]);router['delete'](_0xf02e('0xd'),auth[_0xf02e('0x8')](),controller['removeDispositions']);router[_0xf02e('0x36')](_0xf02e('0x21'),auth['isAuthenticated'](),controller[_0xf02e('0x38')]);router[_0xf02e('0x36')](_0xf02e('0x1f'),auth[_0xf02e('0x8')](),controller[_0xf02e('0x39')]);module[_0xf02e('0x3a')]=router; \ No newline at end of file +var _0xd66c=['/:id/avatar','getAvatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','/:id/dispositions','addDisposition','addAnswer','join','root','server/files/images/logos/','format','now','originalname','/:id/logo','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','addAvatar','/:id/customer_avatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','/:id/offline','/:id/interactions','addInteraction','/:id/applications','addApplications','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getLogo'];(function(_0x7bff4f,_0x45ce80){var _0x3c6a26=function(_0x562f84){while(--_0x562f84){_0x7bff4f['push'](_0x7bff4f['shift']());}};_0x3c6a26(++_0x45ce80);}(_0xd66c,0x106));var _0xcd66=function(_0x13e483,_0x539cbf){_0x13e483=_0x13e483-0x0;var _0x25d8c5=_0xd66c[_0x13e483];return _0x25d8c5;};'use strict';var multer=require(_0xcd66('0x0'));var util=require('util');var path=require(_0xcd66('0x1'));var timeout=require(_0xcd66('0x2'));var express=require(_0xcd66('0x3'));var router=express[_0xcd66('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xcd66('0x5'));var config=require(_0xcd66('0x6'));var controller=require(_0xcd66('0x7'));router[_0xcd66('0x8')]('/',auth[_0xcd66('0x9')](),controller[_0xcd66('0xa')]);router[_0xcd66('0x8')](_0xcd66('0xb'),auth['isAuthenticated'](),controller[_0xcd66('0xc')]);router[_0xcd66('0x8')](_0xcd66('0xd'),auth[_0xcd66('0x9')](),controller[_0xcd66('0xe')]);router[_0xcd66('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xcd66('0xf')]);router['get'](_0xcd66('0x10'),auth[_0xcd66('0x9')](),controller['getAnswers']);router[_0xcd66('0x8')]('/:id/logo',controller[_0xcd66('0x11')]);router[_0xcd66('0x8')](_0xcd66('0x12'),controller[_0xcd66('0x13')]);router[_0xcd66('0x8')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xcd66('0x8')]('/:id/system_avatar',controller[_0xcd66('0x14')]);router['get']('/:id/interactions',auth[_0xcd66('0x9')](),controller[_0xcd66('0x15')]);router[_0xcd66('0x8')](_0xcd66('0x16'),controller[_0xcd66('0x17')]);router[_0xcd66('0x8')]('/:id/applications',auth[_0xcd66('0x9')](),controller['getApplications']);router[_0xcd66('0x8')](_0xcd66('0x18'),auth[_0xcd66('0x9')](),controller[_0xcd66('0x19')]);router[_0xcd66('0x8')](_0xcd66('0x1a'),controller[_0xcd66('0x1b')]);router[_0xcd66('0x8')](_0xcd66('0x1c'),auth[_0xcd66('0x9')](),controller[_0xcd66('0x1d')]);router[_0xcd66('0x8')](_0xcd66('0x1e'),auth[_0xcd66('0x9')](),controller[_0xcd66('0x1f')]);router['post']('/',auth[_0xcd66('0x9')](),controller[_0xcd66('0x20')]);router[_0xcd66('0x21')](_0xcd66('0x22'),auth[_0xcd66('0x9')](),controller[_0xcd66('0x23')]);router[_0xcd66('0x21')](_0xcd66('0x10'),auth[_0xcd66('0x9')](),controller[_0xcd66('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2ab69e,_0x6073f5,_0x523d7c){_0x523d7c(null,path[_0xcd66('0x25')](config[_0xcd66('0x26')],_0xcd66('0x27')));},'filename':function(_0x526e13,_0x141a64,_0x41dcb7){_0x41dcb7(null,util[_0xcd66('0x28')]('%s-%s',Date[_0xcd66('0x29')](),_0x141a64[_0xcd66('0x2a')]));}})});router[_0xcd66('0x21')](_0xcd66('0x2b'),upload[_0xcd66('0x2c')](_0xcd66('0x2d')),controller[_0xcd66('0x2e')]);var upload=multer({'storage':multer[_0xcd66('0x2f')]({'destination':function(_0x51201f,_0xb6d828,_0x51a7f6){_0x51a7f6(null,path[_0xcd66('0x25')](config[_0xcd66('0x26')],_0xcd66('0x30')));},'filename':function(_0x337536,_0xba1113,_0x2cb301){_0x2cb301(null,util['format'](_0xcd66('0x31'),Date[_0xcd66('0x29')](),_0xba1113[_0xcd66('0x2a')]));}})});router[_0xcd66('0x21')]('/:id/avatar',upload[_0xcd66('0x2c')](_0xcd66('0x2d')),controller[_0xcd66('0x32')]);var upload=multer({'storage':multer[_0xcd66('0x2f')]({'destination':function(_0x1484a2,_0x58b93f,_0x926286){_0x926286(null,path[_0xcd66('0x25')](config[_0xcd66('0x26')],_0xcd66('0x30')));},'filename':function(_0x4ac149,_0x51f359,_0x2bffd3){_0x2bffd3(null,util['format'](_0xcd66('0x31'),Date[_0xcd66('0x29')](),_0x51f359[_0xcd66('0x2a')]));}})});router[_0xcd66('0x21')](_0xcd66('0x33'),upload[_0xcd66('0x2c')](_0xcd66('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xcd66('0x2f')]({'destination':function(_0x366fb2,_0x37f17a,_0x3dd8ed){_0x3dd8ed(null,path['join'](config[_0xcd66('0x26')],_0xcd66('0x30')));},'filename':function(_0x346a7d,_0x20a98c,_0x3a1410){_0x3a1410(null,util[_0xcd66('0x28')](_0xcd66('0x31'),Date[_0xcd66('0x29')](),_0x20a98c[_0xcd66('0x2a')]));}})});router[_0xcd66('0x21')](_0xcd66('0x34'),upload[_0xcd66('0x2c')](_0xcd66('0x2d')),controller[_0xcd66('0x35')]);router[_0xcd66('0x21')](_0xcd66('0x36'),controller[_0xcd66('0x37')]);router[_0xcd66('0x21')](_0xcd66('0x38'),controller['offline']);router['post'](_0xcd66('0x39'),auth['isAuthenticated'](),controller[_0xcd66('0x3a')]);router[_0xcd66('0x21')](_0xcd66('0x3b'),auth[_0xcd66('0x9')](),controller[_0xcd66('0x3c')]);router['post'](_0xcd66('0x18'),auth[_0xcd66('0x9')](),controller['addProactiveActions']);router[_0xcd66('0x21')](_0xcd66('0x1e'),auth['isAuthenticated'](),controller[_0xcd66('0x3d')]);router[_0xcd66('0x3e')](_0xcd66('0xd'),auth[_0xcd66('0x9')](),controller[_0xcd66('0x3f')]);router[_0xcd66('0x40')](_0xcd66('0xd'),auth['isAuthenticated'](),controller[_0xcd66('0x41')]);router[_0xcd66('0x40')](_0xcd66('0x22'),auth[_0xcd66('0x9')](),controller[_0xcd66('0x42')]);router[_0xcd66('0x40')]('/:id/canned_answers',auth[_0xcd66('0x9')](),controller[_0xcd66('0x43')]);router[_0xcd66('0x40')](_0xcd66('0x1e'),auth['isAuthenticated'](),controller[_0xcd66('0x44')]);module[_0xcd66('0x45')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 06457d8..de92861 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 _0x9834=['STRING','name','sequelize','exports'];(function(_0x1e980e,_0x251d61){var _0x28d224=function(_0x185438){while(--_0x185438){_0x1e980e['push'](_0x1e980e['shift']());}};_0x28d224(++_0x251d61);}(_0x9834,0x122));var _0x4983=function(_0x1b8cb9,_0x11805b){_0x1b8cb9=_0x1b8cb9-0x0;var _0xac29be=_0x9834[_0x1b8cb9];return _0xac29be;};'use strict';var Sequelize=require(_0x4983('0x0'));module[_0x4983('0x1')]={'name':{'type':Sequelize[_0x4983('0x2')],'unique':_0x4983('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4983('0x2')]},'companyId':{'type':Sequelize[_0x4983('0x2')]},'website':{'type':Sequelize[_0x4983('0x2')]},'phone':{'type':Sequelize[_0x4983('0x2')]},'fax':{'type':Sequelize[_0x4983('0x2')]},'type':{'type':Sequelize[_0x4983('0x2')]},'street':{'type':Sequelize[_0x4983('0x2')]},'postalCode':{'type':Sequelize[_0x4983('0x2')]},'city':{'type':Sequelize[_0x4983('0x2')]},'country':{'type':Sequelize[_0x4983('0x2')]},'email':{'type':Sequelize[_0x4983('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4983('0x2')]},'sStreet':{'type':Sequelize[_0x4983('0x2')]},'sPostalCode':{'type':Sequelize[_0x4983('0x2')]},'sCity':{'type':Sequelize[_0x4983('0x2')]},'sCountry':{'type':Sequelize[_0x4983('0x2')]},'description':{'type':Sequelize[_0x4983('0x2')]}}; \ No newline at end of file +var _0x8956=['STRING','name','sequelize','exports'];(function(_0x281305,_0x2998d6){var _0x56ffbe=function(_0x270b4c){while(--_0x270b4c){_0x281305['push'](_0x281305['shift']());}};_0x56ffbe(++_0x2998d6);}(_0x8956,0xf2));var _0x6895=function(_0x46cc4a,_0x386fe6){_0x46cc4a=_0x46cc4a-0x0;var _0x140831=_0x8956[_0x46cc4a];return _0x140831;};'use strict';var Sequelize=require(_0x6895('0x0'));module[_0x6895('0x1')]={'name':{'type':Sequelize[_0x6895('0x2')],'unique':_0x6895('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x6895('0x2')]},'companyId':{'type':Sequelize[_0x6895('0x2')]},'website':{'type':Sequelize[_0x6895('0x2')]},'phone':{'type':Sequelize[_0x6895('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6895('0x2')]},'street':{'type':Sequelize[_0x6895('0x2')]},'postalCode':{'type':Sequelize[_0x6895('0x2')]},'city':{'type':Sequelize[_0x6895('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x6895('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x6895('0x2')]},'sStreet':{'type':Sequelize[_0x6895('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x6895('0x2')]},'sCountry':{'type':Sequelize[_0x6895('0x2')]},'description':{'type':Sequelize[_0x6895('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 2406f87..7b5e221 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 _0x3713=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','CmCompany','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','omit','ids','getContacts','findOne','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','Content-Range','apply','update','then','destroy','Companies','UserProfileResource','sendStatus','error','stack','send','index','model','keys'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x3713,0x1d2));var _0x3371=function(_0x2272d7,_0x694f20){_0x2272d7=_0x2272d7-0x0;var _0x42697c=_0x3713[_0x2272d7];return _0x42697c;};'use strict';var pdf=require(_0x3371('0x0'));var emlformat=require(_0x3371('0x1'));var rimraf=require(_0x3371('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3371('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3371('0x4'));var Mustache=require(_0x3371('0x5'));var util=require(_0x3371('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3371('0x7'));var squel=require(_0x3371('0x8'));var crypto=require(_0x3371('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3371('0xa'));var Papa=require('papaparse');var authService=require(_0x3371('0xb'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x3371('0xc'));var logger=require(_0x3371('0xd'))(_0x3371('0xe'));var utils=require(_0x3371('0xf'));var config=require(_0x3371('0x10'));var db=require(_0x3371('0x11'))['db'];function respondWithStatusCode(_0x6ab126,_0x22afc7){_0x22afc7=_0x22afc7||0xcc;return function(_0x590310){if(_0x590310){return _0x6ab126['sendStatus'](_0x22afc7);}return _0x6ab126['status'](_0x22afc7)[_0x3371('0x12')]();};}function respondWithResult(_0x1e2ca5,_0x31f220){_0x31f220=_0x31f220||0xc8;return function(_0x578374){if(_0x578374){return _0x1e2ca5['status'](_0x31f220)[_0x3371('0x13')](_0x578374);}};}function respondWithFilteredResult(_0x10d7b1,_0x1668a7){return function(_0x100338){if(_0x100338){var _0x362d82=_0x100338[_0x3371('0x14')],_0x1d3764=_0x1668a7[_0x3371('0x15')],_0x107aa3=_0x1668a7[_0x3371('0x15')]+_0x1668a7[_0x3371('0x16')],_0x4092a4;if(_0x107aa3>=_0x362d82){_0x107aa3=_0x362d82;_0x4092a4=0xc8;}else{_0x4092a4=0xce;}_0x10d7b1[_0x3371('0x17')](_0x4092a4);return _0x10d7b1['set'](_0x3371('0x18'),_0x1d3764+'-'+_0x107aa3+'/'+_0x362d82)['json'](_0x100338);}return null;};}function patchUpdates(_0x347797){return function(_0x21be6e){try{jsonpatch[_0x3371('0x19')](_0x21be6e,_0x347797,!![]);}catch(_0x380526){return BPromise['reject'](_0x380526);}return _0x21be6e['save']();};}function saveUpdates(_0xc5b5bb,_0x3feac5){return function(_0x305cc2){if(_0x305cc2){return _0x305cc2[_0x3371('0x1a')](_0xc5b5bb)[_0x3371('0x1b')](function(_0x3ef7ba){return _0x3ef7ba;});}return null;};}function removeEntity(_0x11e4a9,_0x49a011){return function(_0x28cc78){if(_0x28cc78){return _0x28cc78[_0x3371('0x1c')]()[_0x3371('0x1b')](function(){var _0x3d0a50=_0x28cc78['get']({'plain':!![]});var _0x13ce39=_0x3371('0x1d');return db[_0x3371('0x1e')][_0x3371('0x1c')]({'where':{'type':_0x13ce39,'resourceId':_0x3d0a50['id']}})['then'](function(){return _0x28cc78;});})[_0x3371('0x1b')](function(){_0x11e4a9[_0x3371('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7af5,_0x4d58af){return function(_0x4f0e89){if(!_0x4f0e89){_0x1c7af5[_0x3371('0x1f')](0x194);}return _0x4f0e89;};}function handleError(_0xafd303,_0x466bf8){_0x466bf8=_0x466bf8||0x1f4;return function(_0x36d008){logger[_0x3371('0x20')](_0x36d008[_0x3371('0x21')]);if(_0x36d008['name']){delete _0x36d008['name'];}_0xafd303['status'](_0x466bf8)[_0x3371('0x22')](_0x36d008);};}exports[_0x3371('0x23')]=function(_0x3f3a0e,_0x2a4f3c){var _0x3a5ab6={},_0x10e14c={},_0x545346={'count':0x0,'rows':[]};var _0x29eaba=db['CmCompany']['rawAttributes'];_0x10e14c[_0x3371('0x24')]=_[_0x3371('0x25')](_0x29eaba);_0x10e14c['query']=_[_0x3371('0x25')](_0x3f3a0e[_0x3371('0x26')]);_0x10e14c[_0x3371('0x27')]=_[_0x3371('0x28')](_0x10e14c[_0x3371('0x24')],_0x10e14c['query']);_0x3a5ab6[_0x3371('0x29')]=_[_0x3371('0x28')](_0x10e14c['model'],qs[_0x3371('0x2a')](_0x3f3a0e[_0x3371('0x26')][_0x3371('0x2a')]));_0x3a5ab6[_0x3371('0x29')]=_0x3a5ab6['attributes'][_0x3371('0x2b')]?_0x3a5ab6[_0x3371('0x29')]:_0x10e14c[_0x3371('0x24')];if(!_0x3f3a0e[_0x3371('0x26')][_0x3371('0x2c')](_0x3371('0x2d'))){_0x3a5ab6[_0x3371('0x16')]=qs[_0x3371('0x16')](_0x3f3a0e[_0x3371('0x26')][_0x3371('0x16')]);_0x3a5ab6[_0x3371('0x15')]=qs['offset'](_0x3f3a0e[_0x3371('0x26')]['offset']);}_0x3a5ab6[_0x3371('0x2e')]=qs[_0x3371('0x2f')](_0x3f3a0e[_0x3371('0x26')][_0x3371('0x2f')]);_0x3a5ab6[_0x3371('0x30')]=qs['filters'](_[_0x3371('0x31')](_0x3f3a0e[_0x3371('0x26')],_0x10e14c[_0x3371('0x27')]));if(_0x3f3a0e['query'][_0x3371('0x32')]){_0x3a5ab6[_0x3371('0x30')]=_[_0x3371('0x33')](_0x3a5ab6[_0x3371('0x30')],{'$or':_[_0x3371('0x34')](_0x29eaba,function(_0x420f76){if(_0x420f76['type'][_0x3371('0x35')]!==_0x3371('0x36')){var _0x3c41d2={};_0x3c41d2[_0x420f76[_0x3371('0x37')]]={'$like':'%'+_0x3f3a0e[_0x3371('0x26')]['filter']+'%'};return _0x3c41d2;}})});}_0x3a5ab6=_['merge']({},_0x3a5ab6,_0x3f3a0e[_0x3371('0x38')]);var _0x3db55e={'where':_0x3a5ab6['where']};return db[_0x3371('0x39')]['count'](_0x3db55e)[_0x3371('0x1b')](function(_0x466140){_0x545346[_0x3371('0x14')]=_0x466140;if(_0x3f3a0e[_0x3371('0x26')][_0x3371('0x3a')]){_0x3a5ab6[_0x3371('0x3b')]=[{'all':!![]}];}return db[_0x3371('0x39')][_0x3371('0x3c')](_0x3a5ab6);})[_0x3371('0x1b')](function(_0x4321e9){_0x545346[_0x3371('0x3d')]=_0x4321e9;return _0x545346;})[_0x3371('0x1b')](respondWithFilteredResult(_0x2a4f3c,_0x3a5ab6))['catch'](handleError(_0x2a4f3c,null));};exports[_0x3371('0x3e')]=function(_0x1ad95b,_0x422e60){var _0x1fcfdc={'raw':![],'where':{'id':_0x1ad95b['params']['id']}},_0x59e44e={};_0x59e44e[_0x3371('0x24')]=_[_0x3371('0x25')](db['CmCompany'][_0x3371('0x3f')]);_0x59e44e['query']=_['keys'](_0x1ad95b[_0x3371('0x26')]);_0x59e44e['filters']=_['intersection'](_0x59e44e[_0x3371('0x24')],_0x59e44e[_0x3371('0x26')]);_0x1fcfdc[_0x3371('0x29')]=_['intersection'](_0x59e44e['model'],qs[_0x3371('0x2a')](_0x1ad95b[_0x3371('0x26')][_0x3371('0x2a')]));_0x1fcfdc['attributes']=_0x1fcfdc[_0x3371('0x29')]['length']?_0x1fcfdc['attributes']:_0x59e44e['model'];if(_0x1ad95b[_0x3371('0x26')][_0x3371('0x3a')]){_0x1fcfdc[_0x3371('0x3b')]=[{'all':!![]}];}_0x1fcfdc=_[_0x3371('0x33')]({},_0x1fcfdc,_0x1ad95b[_0x3371('0x38')]);return db[_0x3371('0x39')][_0x3371('0x40')](_0x1fcfdc)['then'](handleEntityNotFound(_0x422e60,null))['then'](respondWithResult(_0x422e60,null))[_0x3371('0x41')](handleError(_0x422e60,null));};exports[_0x3371('0x42')]=function(_0x5df029,_0x1a0495){return db[_0x3371('0x39')][_0x3371('0x42')](_0x5df029[_0x3371('0x43')],{})['then'](function(_0x4d367b){var _0xdc6ad4=_0x5df029[_0x3371('0x44')][_0x3371('0x45')]({'plain':!![]});if(!_0xdc6ad4)throw new Error(_0x3371('0x46'));if(_0xdc6ad4[_0x3371('0x47')]===_0x3371('0x44')){var _0x525b55=_0x4d367b[_0x3371('0x45')]({'plain':!![]});var _0x55c569=_0x3371('0x1d');return db[_0x3371('0x48')][_0x3371('0x40')]({'where':{'name':_0x55c569,'userProfileId':_0xdc6ad4[_0x3371('0x49')]},'raw':!![]})['then'](function(_0x1959a9){if(_0x1959a9&&_0x1959a9[_0x3371('0x4a')]===0x0){return db[_0x3371('0x1e')]['create']({'name':_0x525b55[_0x3371('0x4b')],'resourceId':_0x525b55['id'],'type':_0x1959a9[_0x3371('0x4b')],'sectionId':_0x1959a9['id']},{})['then'](function(){return _0x4d367b;});}else{return _0x4d367b;}})['catch'](function(_0xf17aba){logger['error'](_0x3371('0x4c'),_0xf17aba);throw _0xf17aba;});}return _0x4d367b;})[_0x3371('0x1b')](respondWithResult(_0x1a0495,0xc9))['catch'](handleError(_0x1a0495,null));};exports[_0x3371('0x1a')]=function(_0x4a6be9,_0x29a13f){if(_0x4a6be9[_0x3371('0x43')]['id']){delete _0x4a6be9[_0x3371('0x43')]['id'];}return db[_0x3371('0x39')][_0x3371('0x40')]({'where':{'id':_0x4a6be9[_0x3371('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29a13f,null))[_0x3371('0x1b')](saveUpdates(_0x4a6be9[_0x3371('0x43')],null))[_0x3371('0x1b')](respondWithResult(_0x29a13f,null))[_0x3371('0x41')](handleError(_0x29a13f,null));};exports['destroy']=function(_0x14077c,_0x39a89a){return db['CmCompany']['find']({'where':{'id':_0x14077c[_0x3371('0x4d')]['id']}})['then'](handleEntityNotFound(_0x39a89a,null))['then'](removeEntity(_0x39a89a,null))[_0x3371('0x41')](handleError(_0x39a89a,null));};exports[_0x3371('0x4e')]=function(_0x335ad1,_0x497774,_0x3ff630){return db[_0x3371('0x4f')][_0x3371('0x40')]({'where':{'id':_0x335ad1[_0x3371('0x4d')]['id']}})[_0x3371('0x1b')](handleEntityNotFound(_0x497774,null))[_0x3371('0x1b')](function(_0x4485d3){if(_0x4485d3){return _0x4485d3[_0x3371('0x4e')](_0x335ad1[_0x3371('0x43')]['ids'],_[_0x3371('0x50')](_0x335ad1['body'],[_0x3371('0x51'),'id'])||{});}})['then'](respondWithResult(_0x497774,null))[_0x3371('0x41')](handleError(_0x497774,null));};exports[_0x3371('0x52')]=function(_0x372412,_0x1f7805,_0x49df38){var _0x333224={};var _0x59901e={};var _0x39aa74;var _0x2ea77e;return db[_0x3371('0x39')][_0x3371('0x53')]({'where':{'id':_0x372412[_0x3371('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1f7805,null))['then'](function(_0x5dbb87){if(_0x5dbb87){_0x39aa74=_0x5dbb87;_0x59901e[_0x3371('0x24')]=_[_0x3371('0x25')](db[_0x3371('0x4f')][_0x3371('0x3f')]);_0x59901e[_0x3371('0x26')]=_['keys'](_0x372412['query']);_0x59901e[_0x3371('0x27')]=_['intersection'](_0x59901e[_0x3371('0x24')],_0x59901e[_0x3371('0x26')]);_0x333224[_0x3371('0x29')]=_[_0x3371('0x28')](_0x59901e[_0x3371('0x24')],qs[_0x3371('0x2a')](_0x372412[_0x3371('0x26')]['fields']));_0x333224[_0x3371('0x29')]=_0x333224[_0x3371('0x29')][_0x3371('0x2b')]?_0x333224[_0x3371('0x29')]:_0x59901e[_0x3371('0x24')];_0x333224[_0x3371('0x2e')]=qs['sort'](_0x372412[_0x3371('0x26')][_0x3371('0x2f')]);_0x333224[_0x3371('0x30')]=qs[_0x3371('0x27')](_['pick'](_0x372412[_0x3371('0x26')],_0x59901e['filters']));if(_0x372412['query']['filter']){_0x333224[_0x3371('0x30')]=_[_0x3371('0x33')](_0x333224[_0x3371('0x30')],{'$or':_['map'](_0x333224[_0x3371('0x29')],function(_0x4bfd60){var _0x46f9a9={};_0x46f9a9[_0x4bfd60]={'$like':'%'+_0x372412[_0x3371('0x26')][_0x3371('0x32')]+'%'};return _0x46f9a9;})});}_0x333224=_[_0x3371('0x33')]({},_0x333224,_0x372412[_0x3371('0x38')]);return _0x39aa74[_0x3371('0x52')](_0x333224);}})[_0x3371('0x1b')](function(_0x12c1e0){if(_0x12c1e0){_0x2ea77e=_0x12c1e0['length'];if(!_0x372412[_0x3371('0x26')][_0x3371('0x2c')](_0x3371('0x2d'))){_0x333224[_0x3371('0x16')]=qs[_0x3371('0x16')](_0x372412[_0x3371('0x26')][_0x3371('0x16')]);_0x333224[_0x3371('0x15')]=qs[_0x3371('0x15')](_0x372412[_0x3371('0x26')][_0x3371('0x15')]);}return _0x39aa74[_0x3371('0x52')](_0x333224);}})['then'](function(_0x35f069){if(_0x35f069){return _0x35f069?{'count':_0x2ea77e,'rows':_0x35f069}:null;}})['then'](respondWithResult(_0x1f7805,null))[_0x3371('0x41')](handleError(_0x1f7805,null));}; \ No newline at end of file +var _0xa97b=['filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','type','field','options','count','includeAll','include','findAll','catch','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','update','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','pick','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','set','apply','destroy','then','get','UserProfileResource','error','name','send','index','CmCompany','model','keys','query'];(function(_0x4046a5,_0x1a2afd){var _0xc9d953=function(_0x42d801){while(--_0x42d801){_0x4046a5['push'](_0x4046a5['shift']());}};_0xc9d953(++_0x1a2afd);}(_0xa97b,0x16b));var _0xba97=function(_0x5a1a1a,_0x506b49){_0x5a1a1a=_0x5a1a1a-0x0;var _0x302a35=_0xa97b[_0x5a1a1a];return _0x302a35;};'use strict';var pdf=require(_0xba97('0x0'));var emlformat=require(_0xba97('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xba97('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba97('0x3'));var moment=require(_0xba97('0x4'));var BPromise=require(_0xba97('0x5'));var Mustache=require(_0xba97('0x6'));var util=require(_0xba97('0x7'));var path=require(_0xba97('0x8'));var sox=require('sox');var csv=require(_0xba97('0x9'));var ejs=require(_0xba97('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xba97('0xb'));var crypto=require('crypto');var jsforce=require(_0xba97('0xc'));var deskjs=require(_0xba97('0xd'));var toCsv=require(_0xba97('0x9'));var querystring=require('querystring');var Papa=require(_0xba97('0xe'));var authService=require(_0xba97('0xf'));var hardwareService=require(_0xba97('0x10'));var Redis=require('ioredis');var qs=require(_0xba97('0x11'));var logger=require(_0xba97('0x12'))(_0xba97('0x13'));var utils=require(_0xba97('0x14'));var config=require('../../config/environment');var db=require(_0xba97('0x15'))['db'];function respondWithStatusCode(_0x48a447,_0xfe053){_0xfe053=_0xfe053||0xcc;return function(_0x500c72){if(_0x500c72){return _0x48a447[_0xba97('0x16')](_0xfe053);}return _0x48a447['status'](_0xfe053)[_0xba97('0x17')]();};}function respondWithResult(_0xaa1815,_0x35cc2f){_0x35cc2f=_0x35cc2f||0xc8;return function(_0x5e747e){if(_0x5e747e){return _0xaa1815[_0xba97('0x18')](_0x35cc2f)[_0xba97('0x19')](_0x5e747e);}};}function respondWithFilteredResult(_0x2440ee,_0x520e13){return function(_0x1513fc){if(_0x1513fc){var _0x3a877a=_0x1513fc['count'],_0x5ced49=_0x520e13[_0xba97('0x1a')],_0x346793=_0x520e13['offset']+_0x520e13[_0xba97('0x1b')],_0x1b25ad;if(_0x346793>=_0x3a877a){_0x346793=_0x3a877a;_0x1b25ad=0xc8;}else{_0x1b25ad=0xce;}_0x2440ee['status'](_0x1b25ad);return _0x2440ee[_0xba97('0x1c')]('Content-Range',_0x5ced49+'-'+_0x346793+'/'+_0x3a877a)[_0xba97('0x19')](_0x1513fc);}return null;};}function patchUpdates(_0x8c7c7){return function(_0x27ad81){try{jsonpatch[_0xba97('0x1d')](_0x27ad81,_0x8c7c7,!![]);}catch(_0x191f95){return BPromise['reject'](_0x191f95);}return _0x27ad81['save']();};}function saveUpdates(_0x3a42f3,_0x47c290){return function(_0x255fbd){if(_0x255fbd){return _0x255fbd['update'](_0x3a42f3)['then'](function(_0x4ee112){return _0x4ee112;});}return null;};}function removeEntity(_0x55d960,_0x18e5fd){return function(_0x32685d){if(_0x32685d){return _0x32685d[_0xba97('0x1e')]()[_0xba97('0x1f')](function(){var _0x83099d=_0x32685d[_0xba97('0x20')]({'plain':!![]});var _0x4ecf3c='Companies';return db[_0xba97('0x21')][_0xba97('0x1e')]({'where':{'type':_0x4ecf3c,'resourceId':_0x83099d['id']}})[_0xba97('0x1f')](function(){return _0x32685d;});})[_0xba97('0x1f')](function(){_0x55d960[_0xba97('0x18')](0xcc)[_0xba97('0x17')]();});}};}function handleEntityNotFound(_0x3f7108,_0x484bfb){return function(_0x2c2866){if(!_0x2c2866){_0x3f7108[_0xba97('0x16')](0x194);}return _0x2c2866;};}function handleError(_0x2f22ca,_0x22c73a){_0x22c73a=_0x22c73a||0x1f4;return function(_0x3ec003){logger[_0xba97('0x22')](_0x3ec003['stack']);if(_0x3ec003[_0xba97('0x23')]){delete _0x3ec003[_0xba97('0x23')];}_0x2f22ca[_0xba97('0x18')](_0x22c73a)[_0xba97('0x24')](_0x3ec003);};}exports[_0xba97('0x25')]=function(_0x1005e0,_0xc2272f){var _0x177208={},_0x461e6b={},_0x5088f4={'count':0x0,'rows':[]};var _0x163ee8=db[_0xba97('0x26')]['rawAttributes'];_0x461e6b[_0xba97('0x27')]=_[_0xba97('0x28')](_0x163ee8);_0x461e6b[_0xba97('0x29')]=_[_0xba97('0x28')](_0x1005e0[_0xba97('0x29')]);_0x461e6b[_0xba97('0x2a')]=_[_0xba97('0x2b')](_0x461e6b[_0xba97('0x27')],_0x461e6b[_0xba97('0x29')]);_0x177208[_0xba97('0x2c')]=_[_0xba97('0x2b')](_0x461e6b[_0xba97('0x27')],qs[_0xba97('0x2d')](_0x1005e0[_0xba97('0x29')][_0xba97('0x2d')]));_0x177208[_0xba97('0x2c')]=_0x177208[_0xba97('0x2c')][_0xba97('0x2e')]?_0x177208[_0xba97('0x2c')]:_0x461e6b['model'];if(!_0x1005e0[_0xba97('0x29')]['hasOwnProperty'](_0xba97('0x2f'))){_0x177208['limit']=qs['limit'](_0x1005e0[_0xba97('0x29')]['limit']);_0x177208['offset']=qs[_0xba97('0x1a')](_0x1005e0['query']['offset']);}_0x177208[_0xba97('0x30')]=qs[_0xba97('0x31')](_0x1005e0[_0xba97('0x29')][_0xba97('0x31')]);_0x177208[_0xba97('0x32')]=qs[_0xba97('0x2a')](_['pick'](_0x1005e0[_0xba97('0x29')],_0x461e6b[_0xba97('0x2a')]));if(_0x1005e0[_0xba97('0x29')][_0xba97('0x33')]){_0x177208[_0xba97('0x32')]=_[_0xba97('0x34')](_0x177208['where'],{'$or':_[_0xba97('0x35')](_0x163ee8,function(_0x2b3d98){if(_0x2b3d98[_0xba97('0x36')]['key']!=='VIRTUAL'){var _0x492b6a={};_0x492b6a[_0x2b3d98[_0xba97('0x37')]]={'$like':'%'+_0x1005e0[_0xba97('0x29')][_0xba97('0x33')]+'%'};return _0x492b6a;}})});}_0x177208=_[_0xba97('0x34')]({},_0x177208,_0x1005e0[_0xba97('0x38')]);var _0xd063a0={'where':_0x177208['where']};return db[_0xba97('0x26')][_0xba97('0x39')](_0xd063a0)['then'](function(_0x1866e1){_0x5088f4[_0xba97('0x39')]=_0x1866e1;if(_0x1005e0[_0xba97('0x29')][_0xba97('0x3a')]){_0x177208[_0xba97('0x3b')]=[{'all':!![]}];}return db['CmCompany'][_0xba97('0x3c')](_0x177208);})[_0xba97('0x1f')](function(_0x20cc51){_0x5088f4['rows']=_0x20cc51;return _0x5088f4;})[_0xba97('0x1f')](respondWithFilteredResult(_0xc2272f,_0x177208))[_0xba97('0x3d')](handleError(_0xc2272f,null));};exports['show']=function(_0x104b15,_0x5730e0){var _0x719db0={'raw':![],'where':{'id':_0x104b15[_0xba97('0x3e')]['id']}},_0x1524ac={};_0x1524ac[_0xba97('0x27')]=_[_0xba97('0x28')](db[_0xba97('0x26')]['rawAttributes']);_0x1524ac[_0xba97('0x29')]=_[_0xba97('0x28')](_0x104b15[_0xba97('0x29')]);_0x1524ac['filters']=_[_0xba97('0x2b')](_0x1524ac[_0xba97('0x27')],_0x1524ac['query']);_0x719db0['attributes']=_['intersection'](_0x1524ac['model'],qs[_0xba97('0x2d')](_0x104b15[_0xba97('0x29')][_0xba97('0x2d')]));_0x719db0[_0xba97('0x2c')]=_0x719db0['attributes'][_0xba97('0x2e')]?_0x719db0[_0xba97('0x2c')]:_0x1524ac[_0xba97('0x27')];if(_0x104b15['query'][_0xba97('0x3a')]){_0x719db0[_0xba97('0x3b')]=[{'all':!![]}];}_0x719db0=_[_0xba97('0x34')]({},_0x719db0,_0x104b15[_0xba97('0x38')]);return db['CmCompany'][_0xba97('0x3f')](_0x719db0)[_0xba97('0x1f')](handleEntityNotFound(_0x5730e0,null))[_0xba97('0x1f')](respondWithResult(_0x5730e0,null))[_0xba97('0x3d')](handleError(_0x5730e0,null));};exports[_0xba97('0x40')]=function(_0x374e00,_0x11e7dd){return db[_0xba97('0x26')]['create'](_0x374e00[_0xba97('0x41')],{})[_0xba97('0x1f')](function(_0x184f71){var _0x5d2279=_0x374e00[_0xba97('0x42')][_0xba97('0x20')]({'plain':!![]});if(!_0x5d2279)throw new Error(_0xba97('0x43'));if(_0x5d2279[_0xba97('0x44')]===_0xba97('0x42')){var _0x301769=_0x184f71[_0xba97('0x20')]({'plain':!![]});var _0x4ea71d='Companies';return db[_0xba97('0x45')][_0xba97('0x3f')]({'where':{'name':_0x4ea71d,'userProfileId':_0x5d2279[_0xba97('0x46')]},'raw':!![]})[_0xba97('0x1f')](function(_0x30f436){if(_0x30f436&&_0x30f436[_0xba97('0x47')]===0x0){return db['UserProfileResource'][_0xba97('0x40')]({'name':_0x301769[_0xba97('0x23')],'resourceId':_0x301769['id'],'type':_0x30f436['name'],'sectionId':_0x30f436['id']},{})[_0xba97('0x1f')](function(){return _0x184f71;});}else{return _0x184f71;}})[_0xba97('0x3d')](function(_0x441edf){logger[_0xba97('0x22')](_0xba97('0x48'),_0x441edf);throw _0x441edf;});}return _0x184f71;})[_0xba97('0x1f')](respondWithResult(_0x11e7dd,0xc9))[_0xba97('0x3d')](handleError(_0x11e7dd,null));};exports[_0xba97('0x49')]=function(_0x50eda5,_0x309d86){if(_0x50eda5['body']['id']){delete _0x50eda5[_0xba97('0x41')]['id'];}return db[_0xba97('0x26')][_0xba97('0x3f')]({'where':{'id':_0x50eda5['params']['id']}})[_0xba97('0x1f')](handleEntityNotFound(_0x309d86,null))['then'](saveUpdates(_0x50eda5['body'],null))[_0xba97('0x1f')](respondWithResult(_0x309d86,null))[_0xba97('0x3d')](handleError(_0x309d86,null));};exports[_0xba97('0x1e')]=function(_0x4ea3a0,_0xe43aa){return db[_0xba97('0x26')]['find']({'where':{'id':_0x4ea3a0[_0xba97('0x3e')]['id']}})['then'](handleEntityNotFound(_0xe43aa,null))[_0xba97('0x1f')](removeEntity(_0xe43aa,null))[_0xba97('0x3d')](handleError(_0xe43aa,null));};exports[_0xba97('0x4a')]=function(_0x44f58d,_0xd06c4d,_0x48f849){return db[_0xba97('0x4b')][_0xba97('0x3f')]({'where':{'id':_0x44f58d[_0xba97('0x3e')]['id']}})[_0xba97('0x1f')](handleEntityNotFound(_0xd06c4d,null))[_0xba97('0x1f')](function(_0x50e4f5){if(_0x50e4f5){return _0x50e4f5[_0xba97('0x4a')](_0x44f58d['body'][_0xba97('0x4c')],_['omit'](_0x44f58d[_0xba97('0x41')],['ids','id'])||{});}})[_0xba97('0x1f')](respondWithResult(_0xd06c4d,null))[_0xba97('0x3d')](handleError(_0xd06c4d,null));};exports[_0xba97('0x4d')]=function(_0x17d4f2,_0x7578cd,_0x201300){var _0x271e0b={};var _0x50673f={};var _0x43f59a;var _0x2fe9ff;return db[_0xba97('0x26')][_0xba97('0x4e')]({'where':{'id':_0x17d4f2[_0xba97('0x3e')]['id']}})[_0xba97('0x1f')](handleEntityNotFound(_0x7578cd,null))[_0xba97('0x1f')](function(_0x2bc80c){if(_0x2bc80c){_0x43f59a=_0x2bc80c;_0x50673f[_0xba97('0x27')]=_[_0xba97('0x28')](db[_0xba97('0x4b')][_0xba97('0x4f')]);_0x50673f[_0xba97('0x29')]=_[_0xba97('0x28')](_0x17d4f2['query']);_0x50673f[_0xba97('0x2a')]=_['intersection'](_0x50673f[_0xba97('0x27')],_0x50673f[_0xba97('0x29')]);_0x271e0b[_0xba97('0x2c')]=_['intersection'](_0x50673f[_0xba97('0x27')],qs['fields'](_0x17d4f2[_0xba97('0x29')]['fields']));_0x271e0b[_0xba97('0x2c')]=_0x271e0b[_0xba97('0x2c')]['length']?_0x271e0b[_0xba97('0x2c')]:_0x50673f['model'];_0x271e0b[_0xba97('0x30')]=qs[_0xba97('0x31')](_0x17d4f2[_0xba97('0x29')][_0xba97('0x31')]);_0x271e0b[_0xba97('0x32')]=qs[_0xba97('0x2a')](_[_0xba97('0x50')](_0x17d4f2['query'],_0x50673f[_0xba97('0x2a')]));if(_0x17d4f2[_0xba97('0x29')][_0xba97('0x33')]){_0x271e0b[_0xba97('0x32')]=_[_0xba97('0x34')](_0x271e0b['where'],{'$or':_[_0xba97('0x35')](_0x271e0b[_0xba97('0x2c')],function(_0x42cf79){var _0x3ee31f={};_0x3ee31f[_0x42cf79]={'$like':'%'+_0x17d4f2[_0xba97('0x29')][_0xba97('0x33')]+'%'};return _0x3ee31f;})});}_0x271e0b=_['merge']({},_0x271e0b,_0x17d4f2[_0xba97('0x38')]);return _0x43f59a[_0xba97('0x4d')](_0x271e0b);}})[_0xba97('0x1f')](function(_0xf9e705){if(_0xf9e705){_0x2fe9ff=_0xf9e705[_0xba97('0x2e')];if(!_0x17d4f2['query']['hasOwnProperty'](_0xba97('0x2f'))){_0x271e0b[_0xba97('0x1b')]=qs[_0xba97('0x1b')](_0x17d4f2[_0xba97('0x29')][_0xba97('0x1b')]);_0x271e0b[_0xba97('0x1a')]=qs[_0xba97('0x1a')](_0x17d4f2[_0xba97('0x29')][_0xba97('0x1a')]);}return _0x43f59a[_0xba97('0x4d')](_0x271e0b);}})[_0xba97('0x1f')](function(_0xb4ca34){if(_0xb4ca34){return _0xb4ca34?{'count':_0x2fe9ff,'rows':_0xb4ca34}:null;}})[_0xba97('0x1f')](respondWithResult(_0x7578cd,null))[_0xba97('0x3d')](handleError(_0x7578cd,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 63769db..1ff063c 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 _0x9c2c=['lodash','util','bluebird','./cmCompany.attributes','exports','define','cm_companies'];(function(_0x163742,_0x467e36){var _0x1152ac=function(_0x40a83d){while(--_0x40a83d){_0x163742['push'](_0x163742['shift']());}};_0x1152ac(++_0x467e36);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc9c2('0x0'));var util=require(_0xc9c2('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc9c2('0x2'));var rp=require('request-promise');var attributes=require(_0xc9c2('0x3'));module[_0xc9c2('0x4')]=function(_0x5bf334,_0x4db342){return _0x5bf334[_0xc9c2('0x5')]('CmCompany',attributes,{'tableName':_0xc9c2('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa74f=['request-promise','./cmCompany.attributes','exports','cm_companies','../../config/logger','bluebird'];(function(_0x3f4d7c,_0x2f1184){var _0x47bf26=function(_0x381cdf){while(--_0x381cdf){_0x3f4d7c['push'](_0x3f4d7c['shift']());}};_0x47bf26(++_0x2f1184);}(_0xa74f,0x9a));var _0xfa74=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0xa74f[_0x5e2152];return _0x5ddcf6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa74('0x0'))('api');var moment=require('moment');var BPromise=require(_0xfa74('0x1'));var rp=require(_0xfa74('0x2'));var attributes=require(_0xfa74('0x3'));module[_0xfa74('0x4')]=function(_0x5b367b,_0x141625){return _0x5b367b['define']('CmCompany',attributes,{'tableName':_0xfa74('0x5'),'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 3186199..44d876f 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 _0xc2a8=['../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x535161,_0x4fd045){var _0x2691bf=function(_0x352493){while(--_0x352493){_0x535161['push'](_0x535161['shift']());}};_0x2691bf(++_0x4fd045);}(_0xc2a8,0x1f3));var _0x8c2a=function(_0x3874c6,_0x4569a4){_0x3874c6=_0x3874c6-0x0;var _0x342833=_0xc2a8[_0x3874c6];return _0x342833;};'use strict';var _=require('lodash');var util=require(_0x8c2a('0x0'));var moment=require(_0x8c2a('0x1'));var BPromise=require(_0x8c2a('0x2'));var rs=require(_0x8c2a('0x3'));var fs=require('fs');var Redis=require(_0x8c2a('0x4'));var db=require(_0x8c2a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c2a('0x6'));var config=require(_0x8c2a('0x7'));var jayson=require(_0x8c2a('0x8'));var client=jayson[_0x8c2a('0x9')][_0x8c2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1667ce,_0x5d20fe,_0x45f361){return new BPromise(function(_0x421d80,_0x3e4b46){return client[_0x8c2a('0xb')](_0x1667ce,_0x45f361)[_0x8c2a('0xc')](function(_0x24f77b){logger[_0x8c2a('0xd')](_0x8c2a('0xe'),_0x5d20fe,_0x8c2a('0xf'));logger[_0x8c2a('0x10')](_0x8c2a('0x11'),_0x5d20fe,_0x8c2a('0xf'),JSON[_0x8c2a('0x12')](_0x24f77b));if(_0x24f77b[_0x8c2a('0x13')]){if(_0x24f77b['error']['code']===0x1f4){logger[_0x8c2a('0x13')]('CmCompany,\x20%s,\x20%s',_0x5d20fe,_0x24f77b[_0x8c2a('0x13')][_0x8c2a('0x14')]);return _0x3e4b46(_0x24f77b[_0x8c2a('0x13')][_0x8c2a('0x14')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x5d20fe,_0x24f77b[_0x8c2a('0x13')][_0x8c2a('0x14')]);return _0x421d80(_0x24f77b[_0x8c2a('0x13')][_0x8c2a('0x14')]);}else{logger[_0x8c2a('0xd')]('CmCompany,\x20%s,\x20%s',_0x5d20fe,'request\x20sent');_0x421d80(_0x24f77b['result'][_0x8c2a('0x14')]);}})[_0x8c2a('0x15')](function(_0x2df0d2){logger[_0x8c2a('0x13')]('CmCompany,\x20%s,\x20%s',_0x5d20fe,_0x2df0d2);_0x3e4b46(_0x2df0d2);});});} \ No newline at end of file +var _0x1c2e=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x1c2e,0x16a));var _0xe1c2=function(_0x34cbc1,_0x1124f5){_0x34cbc1=_0x34cbc1-0x0;var _0x226d3b=_0x1c2e[_0x34cbc1];return _0x226d3b;};'use strict';var _=require(_0xe1c2('0x0'));var util=require(_0xe1c2('0x1'));var moment=require(_0xe1c2('0x2'));var BPromise=require('bluebird');var rs=require(_0xe1c2('0x3'));var fs=require('fs');var Redis=require(_0xe1c2('0x4'));var db=require(_0xe1c2('0x5'))['db'];var utils=require(_0xe1c2('0x6'));var logger=require('../../config/logger')(_0xe1c2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe1c2('0x8')][_0xe1c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x418e81,_0x102655,_0x373571){return new BPromise(function(_0x12dfde,_0x50a148){return client['request'](_0x418e81,_0x373571)[_0xe1c2('0xa')](function(_0x5404b1){logger[_0xe1c2('0xb')](_0xe1c2('0xc'),_0x102655,_0xe1c2('0xd'));logger[_0xe1c2('0xe')](_0xe1c2('0xf'),_0x102655,_0xe1c2('0xd'),JSON[_0xe1c2('0x10')](_0x5404b1));if(_0x5404b1['error']){if(_0x5404b1['error']['code']===0x1f4){logger[_0xe1c2('0x11')]('CmCompany,\x20%s,\x20%s',_0x102655,_0x5404b1[_0xe1c2('0x11')]['message']);return _0x50a148(_0x5404b1[_0xe1c2('0x11')][_0xe1c2('0x12')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x102655,_0x5404b1[_0xe1c2('0x11')][_0xe1c2('0x12')]);return _0x12dfde(_0x5404b1['error']['message']);}else{logger['info'](_0xe1c2('0xc'),_0x102655,'request\x20sent');_0x12dfde(_0x5404b1[_0xe1c2('0x13')][_0xe1c2('0x12')]);}})[_0xe1c2('0x14')](function(_0x2f1286){logger[_0xe1c2('0x11')](_0xe1c2('0xc'),_0x102655,_0x2f1286);_0x50a148(_0x2f1286);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 8097929..bb8d70a 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 _0x6324=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./cmCompany.controller','isAuthenticated','index','get','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0x6324,0x142));var _0x4632=function(_0x316371,_0x3c225f){_0x316371=_0x316371-0x0;var _0x576f72=_0x6324[_0x316371];return _0x576f72;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4632('0x5'));var config=require('../../config/environment');var controller=require(_0x4632('0x6'));router['get']('/',auth[_0x4632('0x7')](),controller[_0x4632('0x8')]);router[_0x4632('0x9')](_0x4632('0xa'),auth['isAuthenticated'](),controller[_0x4632('0xb')]);router[_0x4632('0x9')](_0x4632('0xc'),auth['isAuthenticated'](),controller[_0x4632('0xd')]);router[_0x4632('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4632('0xe')](_0x4632('0xc'),auth[_0x4632('0x7')](),controller[_0x4632('0xf')]);router[_0x4632('0x10')](_0x4632('0xa'),auth[_0x4632('0x7')](),controller[_0x4632('0x11')]);router['delete'](_0x4632('0xa'),auth['isAuthenticated'](),controller[_0x4632('0x12')]);module[_0x4632('0x13')]=router; \ No newline at end of file +var _0xdc46=['getContacts','create','post','addContacts','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','get','isAuthenticated','/:id/contacts'];(function(_0x4204e2,_0x36cc9e){var _0x1ec77f=function(_0x1ad385){while(--_0x1ad385){_0x4204e2['push'](_0x4204e2['shift']());}};_0x1ec77f(++_0x36cc9e);}(_0xdc46,0x17a));var _0x6dc4=function(_0x59fb3c,_0x5ebc86){_0x59fb3c=_0x59fb3c-0x0;var _0x57747e=_0xdc46[_0x59fb3c];return _0x57747e;};'use strict';var multer=require(_0x6dc4('0x0'));var util=require(_0x6dc4('0x1'));var path=require('path');var timeout=require(_0x6dc4('0x2'));var express=require(_0x6dc4('0x3'));var router=express[_0x6dc4('0x4')]();var auth=require(_0x6dc4('0x5'));var interaction=require(_0x6dc4('0x6'));var config=require(_0x6dc4('0x7'));var controller=require(_0x6dc4('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6dc4('0x9')]);router[_0x6dc4('0xa')]('/:id',auth[_0x6dc4('0xb')](),controller['show']);router[_0x6dc4('0xa')](_0x6dc4('0xc'),auth[_0x6dc4('0xb')](),controller[_0x6dc4('0xd')]);router['post']('/',auth[_0x6dc4('0xb')](),controller[_0x6dc4('0xe')]);router[_0x6dc4('0xf')](_0x6dc4('0xc'),auth['isAuthenticated'](),controller[_0x6dc4('0x10')]);router[_0x6dc4('0x11')](_0x6dc4('0x12'),auth[_0x6dc4('0xb')](),controller[_0x6dc4('0x13')]);router[_0x6dc4('0x14')](_0x6dc4('0x12'),auth[_0x6dc4('0xb')](),controller[_0x6dc4('0x15')]);module[_0x6dc4('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 0f3d6e5..a6e1fa0 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 _0x9a6f=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x45e335,_0x1add07){var _0x31497d=function(_0x3578e9){while(--_0x3578e9){_0x45e335['push'](_0x45e335['shift']());}};_0x31497d(++_0x1add07);}(_0x9a6f,0x1dc));var _0xf9a6=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0x9a6f[_0x5d8631];return _0x34c15e;};'use strict';var _=require('lodash');var Sequelize=require(_0xf9a6('0x0'));module[_0xf9a6('0x1')]={'firstName':{'type':Sequelize[_0xf9a6('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf9a6('0x2')]},'street':{'type':Sequelize[_0xf9a6('0x2')]},'postalCode':{'type':Sequelize[_0xf9a6('0x2')]},'city':{'type':Sequelize[_0xf9a6('0x2')]},'country':{'type':Sequelize[_0xf9a6('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf9a6('0x3')]},'phone':{'type':Sequelize[_0xf9a6('0x2')]},'mobile':{'type':Sequelize[_0xf9a6('0x2')]},'fax':{'type':Sequelize[_0xf9a6('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xf9a6('0x2')]},'facebook':{'type':Sequelize[_0xf9a6('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xf9a6('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xf9a6('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xf9a6('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xf9a6('0x4')](0x2)[_0xf9a6('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xf9a6('0x6')]}}; \ No newline at end of file +var _0xa222=['STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x28c874,_0x1fd9b9){var _0x161ca1=function(_0x1c754b){while(--_0x1c754b){_0x28c874['push'](_0x28c874['shift']());}};_0x161ca1(++_0x1fd9b9);}(_0xa222,0xa6));var _0x2a22=function(_0x34933a,_0x327378){_0x34933a=_0x34933a-0x0;var _0x36abb4=_0xa222[_0x34933a];return _0x36abb4;};'use strict';var _=require(_0x2a22('0x0'));var Sequelize=require(_0x2a22('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x2a22('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x2a22('0x2')]},'street':{'type':Sequelize[_0x2a22('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2a22('0x2')]},'dateOfBirth':{'type':Sequelize[_0x2a22('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x2a22('0x2')]},'mobile':{'type':Sequelize[_0x2a22('0x2')]},'fax':{'type':Sequelize[_0x2a22('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x2a22('0x2')]},'facebook':{'type':Sequelize[_0x2a22('0x2')]},'fb_data':{'type':Sequelize[_0x2a22('0x2')]},'twitter':{'type':Sequelize[_0x2a22('0x2')]},'skype':{'type':Sequelize[_0x2a22('0x2')]},'teams':{'type':Sequelize[_0x2a22('0x2')]},'viber':{'type':Sequelize[_0x2a22('0x2')]},'line':{'type':Sequelize[_0x2a22('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x2a22('0x2')]},'UserId':{'type':Sequelize[_0x2a22('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2a22('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x2a22('0x5')],'defaultValue':Sequelize[_0x2a22('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 66fb6cc..c7a6ea1 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 _0xe634=['fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','parse','import','User','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','start\x20child\x20process\x20correctly!','exit','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','error','stack','name','index','CmContact','describe','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','map','merge','options','include','push','Tag','tag','distinct','includeAll','Tags','color','ThroughTags','findAll','rows','catch','keys','startsWith','cf_','displayName','CmCustomField','alias','columnName','body','from','get','mergeWith','tags','isArray','join','info','CmHopper','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','create','bulkCreate','each','duplicates','$or','ListId','findOrCreate','find','$and','cf_%d','omit','pickBy','format','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','params','toParam','sequelize','text','values','phone','getTags','pick','setTags','findOne','rawAttributes','nolimit','CmHopperHistory','ContactId','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','child_process'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0xe634,0x178));var _0x4e63=function(_0x1d6ccb,_0x3d9e5e){_0x1d6ccb=_0x1d6ccb-0x0;var _0x3b2b1=_0xe634[_0x1d6ccb];return _0x3b2b1;};'use strict';var pdf=require(_0x4e63('0x0'));var emlformat=require(_0x4e63('0x1'));var rimraf=require(_0x4e63('0x2'));var zipdir=require(_0x4e63('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4e63('0x4'));var moment=require(_0x4e63('0x5'));var BPromise=require(_0x4e63('0x6'));var Mustache=require(_0x4e63('0x7'));var util=require(_0x4e63('0x8'));var path=require(_0x4e63('0x9'));var sox=require(_0x4e63('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4e63('0xb'));var squel=require(_0x4e63('0xc'));var crypto=require(_0x4e63('0xd'));var jsforce=require(_0x4e63('0xe'));var deskjs=require(_0x4e63('0xf'));var toCsv=require(_0x4e63('0x10'));var querystring=require('querystring');var Papa=require(_0x4e63('0x11'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x4e63('0x12'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4e63('0x13'));var utils=require(_0x4e63('0x14'));var config=require(_0x4e63('0x15'));var db=require('../../mysqldb')['db'];config[_0x4e63('0x16')]=_[_0x4e63('0x17')](config[_0x4e63('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x4e63('0x18'))(new Redis(config[_0x4e63('0x16')]));require(_0x4e63('0x19'))[_0x4e63('0x1a')](socket);function respondWithStatusCode(_0x5e2c3a,_0x4c699c){_0x4c699c=_0x4c699c||0xcc;return function(_0x2e8f2f){if(_0x2e8f2f){return _0x5e2c3a[_0x4e63('0x1b')](_0x4c699c);}return _0x5e2c3a[_0x4e63('0x1c')](_0x4c699c)[_0x4e63('0x1d')]();};}function respondWithResult(_0x1d18d9,_0x5d1df4){_0x5d1df4=_0x5d1df4||0xc8;return function(_0x2969e1){if(_0x2969e1){return _0x1d18d9[_0x4e63('0x1c')](_0x5d1df4)[_0x4e63('0x1e')](_0x2969e1);}};}function respondWithFilteredResult(_0x226bb7,_0x3e9a3a){return function(_0x25c9ed){if(_0x25c9ed){var _0x5d1ca3=_0x25c9ed[_0x4e63('0x1f')],_0x3bb062=_0x3e9a3a[_0x4e63('0x20')],_0x50dd9a=_0x3e9a3a[_0x4e63('0x20')]+_0x3e9a3a[_0x4e63('0x21')],_0x2b605d;if(_0x50dd9a>=_0x5d1ca3){_0x50dd9a=_0x5d1ca3;_0x2b605d=0xc8;}else{_0x2b605d=0xce;}_0x226bb7[_0x4e63('0x1c')](_0x2b605d);return _0x226bb7[_0x4e63('0x22')](_0x4e63('0x23'),_0x3bb062+'-'+_0x50dd9a+'/'+_0x5d1ca3)['json'](_0x25c9ed);}return null;};}function patchUpdates(_0x3bfee3){return function(_0x2fb51d){try{jsonpatch['apply'](_0x2fb51d,_0x3bfee3,!![]);}catch(_0x4fc3c0){return BPromise[_0x4e63('0x24')](_0x4fc3c0);}return _0x2fb51d['save']();};}function saveUpdates(_0x52deea,_0x388e9e){return function(_0x5b4204){if(_0x5b4204){return _0x5b4204[_0x4e63('0x25')](_0x52deea)[_0x4e63('0x26')](function(_0x1cd9f3){return _0x1cd9f3;});}return null;};}function removeEntity(_0x70abcc,_0x25d562){return function(_0x24e5d8){if(_0x24e5d8){return _0x24e5d8['destroy']()[_0x4e63('0x26')](function(){_0x70abcc[_0x4e63('0x1c')](0xcc)[_0x4e63('0x1d')]();});}};}function handleEntityNotFound(_0x49ebf2,_0x115ce3){return function(_0x1df272){if(!_0x1df272){_0x49ebf2[_0x4e63('0x1b')](0x194);}return _0x1df272;};}function handleError(_0x4a025c,_0x6af107){_0x6af107=_0x6af107||0x1f4;return function(_0x5977f9){logger[_0x4e63('0x27')](_0x5977f9[_0x4e63('0x28')]);if(_0x5977f9['name']){delete _0x5977f9[_0x4e63('0x29')];}_0x4a025c[_0x4e63('0x1c')](_0x6af107)['send'](_0x5977f9);};}exports[_0x4e63('0x2a')]=function(_0x9cc316,_0x92f141){var _0x34affe={},_0x4deca9={},_0x2c2eba={'count':0x0,'rows':[]};return db[_0x4e63('0x2b')][_0x4e63('0x2c')]()[_0x4e63('0x26')](function(_0x48f6a5){_0x4deca9[_0x4e63('0x2d')]=_['keys'](_0x48f6a5);_0x4deca9['query']=_['keys'](_0x9cc316[_0x4e63('0x2e')]);_0x4deca9[_0x4e63('0x2f')]=_[_0x4e63('0x30')](_0x4deca9[_0x4e63('0x2d')],_0x4deca9['query']);_0x34affe['attributes']=_[_0x4e63('0x30')](_0x4deca9[_0x4e63('0x2d')],qs[_0x4e63('0x31')](_0x9cc316[_0x4e63('0x2e')]['fields']));_0x34affe[_0x4e63('0x32')]=_0x34affe[_0x4e63('0x32')][_0x4e63('0x33')]?_0x34affe[_0x4e63('0x32')]:_0x4deca9[_0x4e63('0x2d')];if(!_0x9cc316['query'][_0x4e63('0x34')]('nolimit')){_0x34affe[_0x4e63('0x21')]=qs[_0x4e63('0x21')](_0x9cc316[_0x4e63('0x2e')][_0x4e63('0x21')]);_0x34affe[_0x4e63('0x20')]=qs[_0x4e63('0x20')](_0x9cc316[_0x4e63('0x2e')]['offset']);}_0x34affe[_0x4e63('0x35')]=qs[_0x4e63('0x36')](_0x9cc316[_0x4e63('0x2e')]['sort']);_0x34affe[_0x4e63('0x37')]=qs[_0x4e63('0x2f')](_['pick'](_0x9cc316[_0x4e63('0x2e')],_0x4deca9[_0x4e63('0x2f')]));if(_0x9cc316[_0x4e63('0x2e')][_0x4e63('0x38')]){_0x34affe[_0x4e63('0x37')]=_['merge'](_0x34affe[_0x4e63('0x37')],{'$or':_[_0x4e63('0x39')](_0x34affe[_0x4e63('0x32')],function(_0x325d82){var _0x110e54={};_0x110e54[_0x325d82]={'$like':'%'+_0x9cc316[_0x4e63('0x2e')][_0x4e63('0x38')]+'%'};return _0x110e54;})});}_0x34affe=_[_0x4e63('0x3a')]({},_0x34affe,_0x9cc316[_0x4e63('0x3b')]);var _0x2132a4={'where':_0x34affe[_0x4e63('0x37')]};_0x2132a4[_0x4e63('0x3c')]=[];if(_0x9cc316[_0x4e63('0x2e')]['tag']){_0x2132a4['include'][_0x4e63('0x3d')]({'model':db[_0x4e63('0x3e')],'as':'Tags','attributes':['id'],'where':{'id':_0x9cc316[_0x4e63('0x2e')][_0x4e63('0x3f')]},'required':!![]});_0x2132a4[_0x4e63('0x40')]=!![];}return db[_0x4e63('0x2b')][_0x4e63('0x1f')](_0x2132a4)[_0x4e63('0x26')](function(_0x4603ae){_0x2c2eba[_0x4e63('0x1f')]=_0x4603ae;if(_0x9cc316['query'][_0x4e63('0x41')]){_0x34affe[_0x4e63('0x3c')]=[{'model':db['Tag'],'as':_0x4e63('0x42'),'attributes':['id',_0x4e63('0x29'),_0x4e63('0x43')],'required':_0x9cc316[_0x4e63('0x2e')][_0x4e63('0x3f')]?!![]:![]},{'model':db[_0x4e63('0x3e')],'as':_0x4e63('0x44'),'attributes':['id','name',_0x4e63('0x43')],'through':_0x9cc316[_0x4e63('0x2e')][_0x4e63('0x3f')]?{'attributes':[],'where':{'TagId':_0x9cc316[_0x4e63('0x2e')][_0x4e63('0x3f')]||undefined}}:{},'required':_0x9cc316[_0x4e63('0x2e')]['tag']?!![]:![]}];}return db['CmContact'][_0x4e63('0x45')](_0x34affe);})[_0x4e63('0x26')](function(_0x46c684){_0x2c2eba[_0x4e63('0x46')]=_0x46c684;return _0x2c2eba;})[_0x4e63('0x26')](respondWithFilteredResult(_0x92f141,_0x34affe))[_0x4e63('0x47')](handleError(_0x92f141,null));});};exports['destroy']=function(_0x2bd080,_0x14e9fe){return db[_0x4e63('0x2b')]['find']({'where':{'id':_0x2bd080['params']['id']}})[_0x4e63('0x26')](handleEntityNotFound(_0x14e9fe,null))[_0x4e63('0x26')](removeEntity(_0x14e9fe,null))[_0x4e63('0x47')](handleError(_0x14e9fe,null));};exports[_0x4e63('0x2c')]=function(_0x3f41ca,_0x38500e){return db[_0x4e63('0x2b')][_0x4e63('0x2c')]()['then'](function(_0x491ad5){for(var _0x143dc7=0x0;_0x143dc7=_0x308fc1){_0x377dc6=_0x308fc1;_0x2247a0=0xc8;}else{_0x2247a0=0xce;}_0x22b233[_0xa9b3('0x1d')](_0x2247a0);return _0x22b233[_0xa9b3('0x20')]('Content-Range',_0x5d84bb+'-'+_0x377dc6+'/'+_0x308fc1)[_0xa9b3('0x1e')](_0x4dfec9);}return null;};}function patchUpdates(_0x40daf2){return function(_0x18883e){try{jsonpatch['apply'](_0x18883e,_0x40daf2,!![]);}catch(_0x484e85){return BPromise[_0xa9b3('0x21')](_0x484e85);}return _0x18883e[_0xa9b3('0x22')]();};}function saveUpdates(_0x15b3b5,_0x29f4a5){return function(_0x36ff76){if(_0x36ff76){return _0x36ff76[_0xa9b3('0x23')](_0x15b3b5)['then'](function(_0x594106){return _0x594106;});}return null;};}function removeEntity(_0x556585,_0x1d840e){return function(_0x2ed3eb){if(_0x2ed3eb){return _0x2ed3eb[_0xa9b3('0x24')]()[_0xa9b3('0x25')](function(){_0x556585[_0xa9b3('0x1d')](0xcc)[_0xa9b3('0x1c')]();});}};}function handleEntityNotFound(_0x239430,_0x2a9fe4){return function(_0x338160){if(!_0x338160){_0x239430[_0xa9b3('0x1b')](0x194);}return _0x338160;};}function handleError(_0x556e7a,_0x35db5d){_0x35db5d=_0x35db5d||0x1f4;return function(_0x5009e7){logger[_0xa9b3('0x26')](_0x5009e7[_0xa9b3('0x27')]);if(_0x5009e7[_0xa9b3('0x28')]){delete _0x5009e7['name'];}_0x556e7a[_0xa9b3('0x1d')](_0x35db5d)[_0xa9b3('0x29')](_0x5009e7);};}exports[_0xa9b3('0x2a')]=function(_0x21864f,_0x1c55ed){var _0x22e30d={},_0x415ffd={},_0x56f505={'count':0x0,'rows':[]};return db[_0xa9b3('0x2b')][_0xa9b3('0x2c')]()[_0xa9b3('0x25')](function(_0x37463e){_0x415ffd['model']=_[_0xa9b3('0x2d')](_0x37463e);_0x415ffd[_0xa9b3('0x2e')]=_[_0xa9b3('0x2d')](_0x21864f['query']);_0x415ffd[_0xa9b3('0x2f')]=_['intersection'](_0x415ffd[_0xa9b3('0x30')],_0x415ffd[_0xa9b3('0x2e')]);_0x22e30d[_0xa9b3('0x31')]=_[_0xa9b3('0x32')](_0x415ffd['model'],qs['fields'](_0x21864f['query']['fields']));_0x22e30d['attributes']=_0x22e30d[_0xa9b3('0x31')][_0xa9b3('0x33')]?_0x22e30d[_0xa9b3('0x31')]:_0x415ffd[_0xa9b3('0x30')];if(!_0x21864f[_0xa9b3('0x2e')]['hasOwnProperty'](_0xa9b3('0x34'))){_0x22e30d[_0xa9b3('0x35')]=qs[_0xa9b3('0x35')](_0x21864f['query'][_0xa9b3('0x35')]);_0x22e30d['offset']=qs[_0xa9b3('0x1f')](_0x21864f['query']['offset']);}_0x22e30d[_0xa9b3('0x36')]=qs['sort'](_0x21864f[_0xa9b3('0x2e')]['sort']);_0x22e30d['where']=qs[_0xa9b3('0x2f')](_[_0xa9b3('0x37')](_0x21864f[_0xa9b3('0x2e')],_0x415ffd[_0xa9b3('0x2f')]));if(_0x21864f[_0xa9b3('0x2e')][_0xa9b3('0x38')]){_0x22e30d[_0xa9b3('0x39')]=_[_0xa9b3('0x3a')](_0x22e30d[_0xa9b3('0x39')],{'$or':_[_0xa9b3('0x3b')](_0x22e30d['attributes'],function(_0x26e11e){var _0x22c609={};_0x22c609[_0x26e11e]={'$like':'%'+_0x21864f[_0xa9b3('0x2e')]['filter']+'%'};return _0x22c609;})});}_0x22e30d=_[_0xa9b3('0x3a')]({},_0x22e30d,_0x21864f[_0xa9b3('0x3c')]);var _0xb92eb1={'where':_0x22e30d['where']};_0xb92eb1[_0xa9b3('0x3d')]=[];if(_0x21864f[_0xa9b3('0x2e')][_0xa9b3('0x3e')]){_0xb92eb1[_0xa9b3('0x3d')][_0xa9b3('0x3f')]({'model':db['Tag'],'as':'Tags','attributes':['id'],'where':{'id':_0x21864f[_0xa9b3('0x2e')]['tag']},'required':!![]});_0xb92eb1[_0xa9b3('0x40')]=!![];}return db[_0xa9b3('0x2b')][_0xa9b3('0x41')](_0xb92eb1)[_0xa9b3('0x25')](function(_0x4f149c){_0x56f505[_0xa9b3('0x41')]=_0x4f149c;if(_0x21864f['query'][_0xa9b3('0x42')]){_0x22e30d[_0xa9b3('0x3d')]=[{'model':db[_0xa9b3('0x43')],'as':'Tags','attributes':['id',_0xa9b3('0x28'),_0xa9b3('0x44')],'required':_0x21864f['query'][_0xa9b3('0x3e')]?!![]:![]},{'model':db[_0xa9b3('0x43')],'as':_0xa9b3('0x45'),'attributes':['id',_0xa9b3('0x28'),_0xa9b3('0x44')],'through':_0x21864f[_0xa9b3('0x2e')][_0xa9b3('0x3e')]?{'attributes':[],'where':{'TagId':_0x21864f['query'][_0xa9b3('0x3e')]||undefined}}:{},'required':_0x21864f['query'][_0xa9b3('0x3e')]?!![]:![]}];}return db['CmContact'][_0xa9b3('0x46')](_0x22e30d);})[_0xa9b3('0x25')](function(_0x1f5372){_0x56f505[_0xa9b3('0x47')]=_0x1f5372;return _0x56f505;})[_0xa9b3('0x25')](respondWithFilteredResult(_0x1c55ed,_0x22e30d))[_0xa9b3('0x48')](handleError(_0x1c55ed,null));});};exports[_0xa9b3('0x24')]=function(_0x1d153a,_0x5e48be){return db['CmContact'][_0xa9b3('0x49')]({'where':{'id':_0x1d153a[_0xa9b3('0x4a')]['id']}})[_0xa9b3('0x25')](handleEntityNotFound(_0x5e48be,null))['then'](removeEntity(_0x5e48be,null))[_0xa9b3('0x48')](handleError(_0x5e48be,null));};exports[_0xa9b3('0x2c')]=function(_0x318b14,_0x564658){return db[_0xa9b3('0x2b')]['describe']()[_0xa9b3('0x25')](function(_0x48367c){for(var _0x16efb8=0x0;_0x16efb8{}\s\\|]/g,'-');_0x2fd647(null,util[_0x2162('0x1e')](_0x2162('0x1f'),path[_0x2162('0x20')](_0x500a41[_0x2162('0x1c')],path[_0x2162('0x21')](_0x500a41[_0x2162('0x1c')])),Date['now'](),path[_0x2162('0x21')](_0x500a41[_0x2162('0x1c')])));}})});router[_0x2162('0x12')](_0x2162('0x22'),upload[_0x2162('0x23')](_0x2162('0x24')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x2162('0x18')]({'destination':function(_0x4745b7,_0x3beeab,_0x42160e){_0x42160e(null,path[_0x2162('0x19')](config['root'],_0x2162('0x1b')));},'filename':function(_0x39613b,_0x14591f,_0xc421f2){_0x14591f[_0x2162('0x1c')]=_0x14591f[_0x2162('0x1c')][_0x2162('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc421f2(null,util['format'](_0x2162('0x1f'),path['basename'](_0x14591f[_0x2162('0x1c')],path[_0x2162('0x21')](_0x14591f[_0x2162('0x1c')])),Date['now'](),path[_0x2162('0x21')](_0x14591f[_0x2162('0x1c')])));}})});router[_0x2162('0x12')](_0x2162('0x25'),upload[_0x2162('0x23')]('file'),controller[_0x2162('0x26')]);router[_0x2162('0x12')](_0x2162('0x27'),auth[_0x2162('0xa')](),controller[_0x2162('0x28')]);router[_0x2162('0x29')]('/:id',auth[_0x2162('0xa')](),controller[_0x2162('0x2a')]);router[_0x2162('0x2b')](_0x2162('0x9'),auth[_0x2162('0xa')](),controller['destroy']);module[_0x2162('0x2c')]=router; \ No newline at end of file +var _0x136f=['put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','./cmContact.controller','index','get','/describe','isAuthenticated','describe','/:id','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','create','/create_many','bulkCreate','/:id/tags','root','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','now','single','file','uploadCsv','join','format','/upload','upload','/upload/:id'];(function(_0x383f90,_0x42edf5){var _0x101752=function(_0x2669c9){while(--_0x2669c9){_0x383f90['push'](_0x383f90['shift']());}};_0x101752(++_0x42edf5);}(_0x136f,0x174));var _0xf136=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x136f[_0x819464];return _0x49dcc0;};'use strict';var multer=require('multer');var util=require(_0xf136('0x0'));var path=require(_0xf136('0x1'));var timeout=require(_0xf136('0x2'));var express=require('express');var router=express[_0xf136('0x3')]();var auth=require(_0xf136('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf136('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xf136('0x6')]);router[_0xf136('0x7')](_0xf136('0x8'),auth[_0xf136('0x9')](),controller[_0xf136('0xa')]);router[_0xf136('0x7')](_0xf136('0xb'),auth[_0xf136('0x9')](),controller[_0xf136('0xc')]);router[_0xf136('0x7')]('/:id/tags',auth[_0xf136('0x9')](),controller[_0xf136('0xd')]);router[_0xf136('0x7')](_0xf136('0xe'),auth[_0xf136('0x9')](),controller[_0xf136('0xf')]);router[_0xf136('0x7')](_0xf136('0x10'),auth[_0xf136('0x9')](),controller['getHopperHistories']);router[_0xf136('0x7')](_0xf136('0x11'),auth[_0xf136('0x9')](),controller[_0xf136('0x12')]);router[_0xf136('0x7')](_0xf136('0x13'),auth[_0xf136('0x9')](),controller[_0xf136('0x14')]);router[_0xf136('0x15')]('/merge',auth[_0xf136('0x9')](),controller['merge']);router[_0xf136('0x15')]('/',auth[_0xf136('0x9')](),controller[_0xf136('0x16')]);router['post'](_0xf136('0x17'),auth[_0xf136('0x9')](),controller[_0xf136('0x18')]);router[_0xf136('0x15')](_0xf136('0x19'),auth[_0xf136('0x9')](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a1e53,_0x9c8bf0,_0x40ce92){_0x40ce92(null,path['join'](config[_0xf136('0x1a')],_0xf136('0x1b')));},'filename':function(_0x2e9403,_0x3d753c,_0x46d498){_0x3d753c[_0xf136('0x1c')]=_0x3d753c['originalname'][_0xf136('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x46d498(null,util['format'](_0xf136('0x1e'),path[_0xf136('0x1f')](_0x3d753c['originalname'],path[_0xf136('0x20')](_0x3d753c[_0xf136('0x1c')])),Date[_0xf136('0x21')](),path[_0xf136('0x20')](_0x3d753c[_0xf136('0x1c')])));}})});router[_0xf136('0x15')]('/csv',upload[_0xf136('0x22')](_0xf136('0x23')),controller[_0xf136('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e4dec,_0x41ced7,_0x216dde){_0x216dde(null,path[_0xf136('0x25')](config[_0xf136('0x1a')],_0xf136('0x1b')));},'filename':function(_0x1cc041,_0x21fe41,_0x7e4e3f){_0x21fe41['originalname']=_0x21fe41[_0xf136('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x7e4e3f(null,util[_0xf136('0x26')](_0xf136('0x1e'),path['basename'](_0x21fe41['originalname'],path[_0xf136('0x20')](_0x21fe41[_0xf136('0x1c')])),Date[_0xf136('0x21')](),path[_0xf136('0x20')](_0x21fe41[_0xf136('0x1c')])));}})});router[_0xf136('0x15')](_0xf136('0x27'),upload[_0xf136('0x22')](_0xf136('0x23')),controller[_0xf136('0x28')]);router[_0xf136('0x15')](_0xf136('0x29'),auth['isAuthenticated'](),controller['import']);router[_0xf136('0x2a')](_0xf136('0xb'),auth[_0xf136('0x9')](),controller[_0xf136('0x2b')]);router['delete'](_0xf136('0xb'),auth[_0xf136('0x9')](),controller[_0xf136('0x2c')]);module[_0xf136('0x2d')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index a3b5331..9650753 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 _0xb4ce=['isArray','BOOLEAN','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue','TEXT','long','type','select','parse','values'];(function(_0x12bb41,_0x1de50c){var _0x531594=function(_0x3248fd){while(--_0x3248fd){_0x12bb41['push'](_0x12bb41['shift']());}};_0x531594(++_0x1de50c);}(_0xb4ce,0xa7));var _0xeb4c=function(_0x4a1aad,_0x573933){_0x4a1aad=_0x4a1aad-0x0;var _0x23b98b=_0xb4ce[_0x4a1aad];return _0x23b98b;};'use strict';var Sequelize=require(_0xeb4c('0x0'));var _=require(_0xeb4c('0x1'));module[_0xeb4c('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2b4bc0){return this[_0xeb4c('0x3')](_0xeb4c('0x4'));}},'alias':{'type':Sequelize[_0xeb4c('0x5')],'allowNull':![],'set':function(_0x37f222){this[_0xeb4c('0x6')](_0xeb4c('0x4'),_0x37f222?_0x37f222:this[_0xeb4c('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xeb4c('0x7')](_0xeb4c('0x8')),'get':function(){if(this[_0xeb4c('0x3')](_0xeb4c('0x9'))===_0xeb4c('0xa')){return JSON[_0xeb4c('0xb')](this[_0xeb4c('0x3')](_0xeb4c('0xc')));}else{return this[_0xeb4c('0x3')](_0xeb4c('0xc'));}},'set':function(_0x15d7ea){if(Array[_0xeb4c('0xd')](_0x15d7ea)){this[_0xeb4c('0x6')]('values',JSON['stringify'](_0x15d7ea));}else{this['setDataValue']('values',_0x15d7ea);}}},'required':{'type':Sequelize[_0xeb4c('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x1e8d=['alias','STRING','setDataValue','TEXT','long','type','select','values','isArray','stringify','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0x1e8d,0x184));var _0xd1e8=function(_0x53ce39,_0xd61754){_0x53ce39=_0x53ce39-0x0;var _0x3c1032=_0x1e8d[_0x53ce39];return _0x3c1032;};'use strict';var Sequelize=require(_0xd1e8('0x0'));var _=require('lodash');module[_0xd1e8('0x1')]={'name':{'type':Sequelize[_0xd1e8('0x2')],'get':function(_0xb92b84){return this[_0xd1e8('0x3')](_0xd1e8('0x4'));}},'alias':{'type':Sequelize[_0xd1e8('0x5')],'allowNull':![],'set':function(_0x48e3a3){this[_0xd1e8('0x6')](_0xd1e8('0x4'),_0x48e3a3?_0x48e3a3:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0xd1e8('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xd1e8('0x7')](_0xd1e8('0x8')),'get':function(){if(this[_0xd1e8('0x3')](_0xd1e8('0x9'))===_0xd1e8('0xa')){return JSON['parse'](this[_0xd1e8('0x3')](_0xd1e8('0xb')));}else{return this[_0xd1e8('0x3')]('values');}},'set':function(_0x27b89e){if(Array[_0xd1e8('0xc')](_0x27b89e)){this[_0xd1e8('0x6')](_0xd1e8('0xb'),JSON[_0xd1e8('0xd')](_0x27b89e));}else{this[_0xd1e8('0x6')](_0xd1e8('0xb'),_0x27b89e);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 500b307..3ec4586 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 _0x760d=['type','text','number','INTEGER','defaultValue','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','ejs','squel','crypto','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','CmCustomField','rawAttributes','differenceBy','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','map','key','VIRTUAL','field','merge','count','rows','show','params','keys','includeAll','include','options','find','body','catch','transaction','Sequelize','TEXT'];(function(_0x1e8756,_0x431463){var _0x41a0f4=function(_0x1a82a3){while(--_0x1a82a3){_0x1e8756['push'](_0x1e8756['shift']());}};_0x41a0f4(++_0x431463);}(_0x760d,0x1e2));var _0xd760=function(_0x3e73d6,_0x1a561d){_0x3e73d6=_0x3e73d6-0x0;var _0x20e5bc=_0x760d[_0x3e73d6];return _0x20e5bc;};'use strict';var pdf=require(_0xd760('0x0'));var emlformat=require(_0xd760('0x1'));var rimraf=require(_0xd760('0x2'));var zipdir=require(_0xd760('0x3'));var jsonpatch=require(_0xd760('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd760('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd760('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd760('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd760('0x8'));var crypto=require(_0xd760('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd760('0xa'));var querystring=require(_0xd760('0xb'));var Papa=require('papaparse');var authService=require(_0xd760('0xc'));var hardwareService=require(_0xd760('0xd'));var Redis=require(_0xd760('0xe'));var qs=require(_0xd760('0xf'));var logger=require(_0xd760('0x10'))('api');var utils=require(_0xd760('0x11'));var config=require(_0xd760('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x351049,_0x5c66d9){_0x5c66d9=_0x5c66d9||0xcc;return function(_0x118629){if(_0x118629){return _0x351049[_0xd760('0x13')](_0x5c66d9);}return _0x351049[_0xd760('0x14')](_0x5c66d9)['end']();};}function respondWithResult(_0x29cbbe,_0x16351f){_0x16351f=_0x16351f||0xc8;return function(_0x1ac5de){if(_0x1ac5de){return _0x29cbbe[_0xd760('0x14')](_0x16351f)[_0xd760('0x15')](_0x1ac5de);}};}function respondWithFilteredResult(_0x15edb1,_0x58877f){return function(_0xbf5eaf){if(_0xbf5eaf){var _0x5b02e4=_0xbf5eaf['count'],_0x23362c=_0x58877f[_0xd760('0x16')],_0x1516ac=_0x58877f[_0xd760('0x16')]+_0x58877f[_0xd760('0x17')],_0x104465;if(_0x1516ac>=_0x5b02e4){_0x1516ac=_0x5b02e4;_0x104465=0xc8;}else{_0x104465=0xce;}_0x15edb1[_0xd760('0x14')](_0x104465);return _0x15edb1[_0xd760('0x18')](_0xd760('0x19'),_0x23362c+'-'+_0x1516ac+'/'+_0x5b02e4)['json'](_0xbf5eaf);}return null;};}function patchUpdates(_0x45521a){return function(_0x5bc91e){try{jsonpatch[_0xd760('0x1a')](_0x5bc91e,_0x45521a,!![]);}catch(_0xefe0af){return BPromise[_0xd760('0x1b')](_0xefe0af);}return _0x5bc91e['save']();};}function saveUpdates(_0x4e6930,_0x2c6dc9){return function(_0x4beb3b){if(_0x4beb3b){return _0x4beb3b[_0xd760('0x1c')](_0x4e6930)[_0xd760('0x1d')](function(_0x45c287){return _0x45c287;});}return null;};}function removeEntity(_0x1fd249,_0x247760){return function(_0x31212b){if(_0x31212b){return _0x31212b[_0xd760('0x1e')]()['then'](function(){_0x1fd249['status'](0xcc)[_0xd760('0x1f')]();});}};}function handleEntityNotFound(_0x3f48ac,_0x5dc1d8){return function(_0x1681d6){if(!_0x1681d6){_0x3f48ac[_0xd760('0x13')](0x194);}return _0x1681d6;};}function handleError(_0x213e23,_0x3c3115){_0x3c3115=_0x3c3115||0x1f4;return function(_0x47b585){logger[_0xd760('0x20')](_0x47b585[_0xd760('0x21')]);if(_0x47b585[_0xd760('0x22')]){delete _0x47b585[_0xd760('0x22')];}_0x213e23[_0xd760('0x14')](_0x3c3115)[_0xd760('0x23')](_0x47b585);};}exports['index']=function(_0x3a1c15,_0x5f552e){var _0x421c63={},_0x4d3048={},_0x519ed9={'count':0x0,'rows':[]};var _0x52da2f=db[_0xd760('0x24')][_0xd760('0x25')];_0x4d3048['model']=_[_0xd760('0x26')](_['keys'](_0x52da2f),[_0xd760('0x22')]);_0x4d3048[_0xd760('0x27')]=_['keys'](_0x3a1c15[_0xd760('0x27')]);_0x4d3048[_0xd760('0x28')]=_[_0xd760('0x29')](_0x4d3048['model'],_0x4d3048[_0xd760('0x27')]);_0x421c63['attributes']=_[_0xd760('0x29')](_0x4d3048[_0xd760('0x2a')],qs[_0xd760('0x2b')](_0x3a1c15[_0xd760('0x27')]['fields']));_0x421c63[_0xd760('0x2c')]=_0x421c63[_0xd760('0x2c')][_0xd760('0x2d')]?_0x421c63[_0xd760('0x2c')]:_0x4d3048[_0xd760('0x2a')];if(!_0x3a1c15[_0xd760('0x27')][_0xd760('0x2e')](_0xd760('0x2f'))){_0x421c63[_0xd760('0x17')]=qs[_0xd760('0x17')](_0x3a1c15[_0xd760('0x27')][_0xd760('0x17')]);_0x421c63[_0xd760('0x16')]=qs[_0xd760('0x16')](_0x3a1c15[_0xd760('0x27')][_0xd760('0x16')]);}_0x421c63[_0xd760('0x30')]=qs['sort'](_0x3a1c15[_0xd760('0x27')]['sort']);_0x421c63[_0xd760('0x31')]=qs['filters'](_[_0xd760('0x32')](_0x3a1c15[_0xd760('0x27')],_0x4d3048['filters']));if(_0x3a1c15['query'][_0xd760('0x33')]){_0x421c63[_0xd760('0x31')]=_['merge'](_0x421c63[_0xd760('0x31')],{'$or':_[_0xd760('0x34')](_0x52da2f,function(_0x1fe9a7){if(_0x1fe9a7['type'][_0xd760('0x35')]!==_0xd760('0x36')){var _0x29f99a={};_0x29f99a[_0x1fe9a7[_0xd760('0x37')]]={'$like':'%'+_0x3a1c15['query']['filter']+'%'};return _0x29f99a;}})});}_0x421c63=_[_0xd760('0x38')]({},_0x421c63,_0x3a1c15['options']);var _0x514d6f={'where':_0x421c63[_0xd760('0x31')]};return db[_0xd760('0x24')][_0xd760('0x39')](_0x514d6f)['then'](function(_0x2ec4be){_0x519ed9[_0xd760('0x39')]=_0x2ec4be;if(_0x3a1c15[_0xd760('0x27')]['includeAll']){_0x421c63['include']=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x421c63);})['then'](function(_0x9cb89f){_0x519ed9[_0xd760('0x3a')]=_0x9cb89f;return _0x519ed9;})[_0xd760('0x1d')](respondWithFilteredResult(_0x5f552e,_0x421c63))['catch'](handleError(_0x5f552e,null));};exports[_0xd760('0x3b')]=function(_0x4b1a22,_0xd6d20e){var _0x66e5de={'raw':!![],'where':{'id':_0x4b1a22[_0xd760('0x3c')]['id']}},_0x1cfd90={};_0x1cfd90[_0xd760('0x2a')]=_[_0xd760('0x3d')](db[_0xd760('0x24')][_0xd760('0x25')]);_0x1cfd90[_0xd760('0x27')]=_[_0xd760('0x3d')](_0x4b1a22[_0xd760('0x27')]);_0x1cfd90['filters']=_[_0xd760('0x29')](_0x1cfd90['model'],_0x1cfd90[_0xd760('0x27')]);_0x66e5de[_0xd760('0x2c')]=_['intersection'](_0x1cfd90['model'],qs[_0xd760('0x2b')](_0x4b1a22[_0xd760('0x27')]['fields']));_0x66e5de[_0xd760('0x2c')]=_0x66e5de[_0xd760('0x2c')][_0xd760('0x2d')]?_0x66e5de[_0xd760('0x2c')]:_0x1cfd90[_0xd760('0x2a')];if(_0x4b1a22[_0xd760('0x27')][_0xd760('0x3e')]){_0x66e5de[_0xd760('0x3f')]=[{'all':!![]}];}_0x66e5de=_[_0xd760('0x38')]({},_0x66e5de,_0x4b1a22[_0xd760('0x40')]);return db[_0xd760('0x24')][_0xd760('0x41')](_0x66e5de)[_0xd760('0x1d')](handleEntityNotFound(_0xd6d20e,null))[_0xd760('0x1d')](respondWithResult(_0xd6d20e,null))['catch'](handleError(_0xd6d20e,null));};exports[_0xd760('0x1c')]=function(_0x9d0616,_0x2547d5){if(_0x9d0616['body']['id']){delete _0x9d0616[_0xd760('0x42')]['id'];}return db[_0xd760('0x24')]['find']({'where':{'id':_0x9d0616[_0xd760('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2547d5,null))[_0xd760('0x1d')](saveUpdates(_0x9d0616[_0xd760('0x42')],null))[_0xd760('0x1d')](respondWithResult(_0x2547d5,null))[_0xd760('0x43')](handleError(_0x2547d5,null));};exports[_0xd760('0x1e')]=function(_0x487ff5,_0x1018c8){return db['CmCustomField'][_0xd760('0x41')]({'where':{'id':_0x487ff5[_0xd760('0x3c')]['id']}})[_0xd760('0x1d')](handleEntityNotFound(_0x1018c8,null))['then'](removeEntity(_0x1018c8,null))[_0xd760('0x43')](handleError(_0x1018c8,null));};exports['create']=function(_0x1ea5c5,_0x4b291c){var _0x1e8578;return db['sequelize'][_0xd760('0x44')](function(_0xdd9a1){return db[_0xd760('0x24')]['create'](_0x1ea5c5[_0xd760('0x42')],{'transaction':_0xdd9a1})[_0xd760('0x1d')](function(_0x58ef43){_0x1e8578=_0x58ef43;var _0x52422e={'type':db[_0xd760('0x45')][_0xd760('0x46')],'transaction':_0xdd9a1};switch(_0x1ea5c5[_0xd760('0x42')][_0xd760('0x47')]){case _0xd760('0x48'):_0x52422e[_0xd760('0x47')]=db[_0xd760('0x45')][_0xd760('0x46')];break;case _0xd760('0x49'):_0x52422e['type']=db[_0xd760('0x45')][_0xd760('0x4a')];break;case'switch':_0x52422e[_0xd760('0x47')]=db['Sequelize']['BOOLEAN'];_0x52422e[_0xd760('0x4b')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0xd760('0x4c'),util[_0xd760('0x4d')](_0xd760('0x4e'),_0x1e8578['id']),_0x52422e);})['then'](function(){return _0x1e8578;});})['then'](respondWithResult(_0x4b291c,0xc9))['catch'](handleError(_0x4b291c,null));}; \ No newline at end of file +var _0xbfed=['nolimit','limit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','options','CmCustomField','count','findAll','rows','catch','fields','include','find','update','body','params','create','transaction','Sequelize','TEXT','type','text','number','switch','defaultValue','sequelize','queryInterface','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','apply','save','then','destroy','error','send','index','model','differenceBy','keys','name','query','attributes','intersection'];(function(_0x31337d,_0x33d329){var _0x5b2582=function(_0x5d66e8){while(--_0x5d66e8){_0x31337d['push'](_0x31337d['shift']());}};_0x5b2582(++_0x33d329);}(_0xbfed,0x176));var _0xdbfe=function(_0x1c6856,_0x8786ba){_0x1c6856=_0x1c6856-0x0;var _0x310ca5=_0xbfed[_0x1c6856];return _0x310ca5;};'use strict';var pdf=require(_0xdbfe('0x0'));var emlformat=require(_0xdbfe('0x1'));var rimraf=require(_0xdbfe('0x2'));var zipdir=require(_0xdbfe('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdbfe('0x4'));var BPromise=require(_0xdbfe('0x5'));var Mustache=require(_0xdbfe('0x6'));var util=require(_0xdbfe('0x7'));var path=require(_0xdbfe('0x8'));var sox=require(_0xdbfe('0x9'));var csv=require(_0xdbfe('0xa'));var ejs=require(_0xdbfe('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdbfe('0xc'));var crypto=require(_0xdbfe('0xd'));var jsforce=require(_0xdbfe('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdbfe('0xa'));var querystring=require(_0xdbfe('0xf'));var Papa=require(_0xdbfe('0x10'));var authService=require(_0xdbfe('0x11'));var hardwareService=require(_0xdbfe('0x12'));var Redis=require(_0xdbfe('0x13'));var qs=require(_0xdbfe('0x14'));var logger=require(_0xdbfe('0x15'))(_0xdbfe('0x16'));var utils=require(_0xdbfe('0x17'));var config=require(_0xdbfe('0x18'));var db=require(_0xdbfe('0x19'))['db'];function respondWithStatusCode(_0x16f2d0,_0x1207a3){_0x1207a3=_0x1207a3||0xcc;return function(_0x294298){if(_0x294298){return _0x16f2d0[_0xdbfe('0x1a')](_0x1207a3);}return _0x16f2d0[_0xdbfe('0x1b')](_0x1207a3)[_0xdbfe('0x1c')]();};}function respondWithResult(_0x2d4fe3,_0x140a19){_0x140a19=_0x140a19||0xc8;return function(_0x4757f8){if(_0x4757f8){return _0x2d4fe3[_0xdbfe('0x1b')](_0x140a19)[_0xdbfe('0x1d')](_0x4757f8);}};}function respondWithFilteredResult(_0x71200b,_0x45e5c3){return function(_0x1afebd){if(_0x1afebd){var _0x2f4cf9=_0x1afebd['count'],_0x2f9ae7=_0x45e5c3[_0xdbfe('0x1e')],_0x6300a3=_0x45e5c3[_0xdbfe('0x1e')]+_0x45e5c3['limit'],_0x59902a;if(_0x6300a3>=_0x2f4cf9){_0x6300a3=_0x2f4cf9;_0x59902a=0xc8;}else{_0x59902a=0xce;}_0x71200b[_0xdbfe('0x1b')](_0x59902a);return _0x71200b['set'](_0xdbfe('0x1f'),_0x2f9ae7+'-'+_0x6300a3+'/'+_0x2f4cf9)[_0xdbfe('0x1d')](_0x1afebd);}return null;};}function patchUpdates(_0x1b20d8){return function(_0x35c6a9){try{jsonpatch[_0xdbfe('0x20')](_0x35c6a9,_0x1b20d8,!![]);}catch(_0x563601){return BPromise['reject'](_0x563601);}return _0x35c6a9[_0xdbfe('0x21')]();};}function saveUpdates(_0x113297,_0x4e1a24){return function(_0x3acb57){if(_0x3acb57){return _0x3acb57['update'](_0x113297)[_0xdbfe('0x22')](function(_0x3bc2dd){return _0x3bc2dd;});}return null;};}function removeEntity(_0x5cdc43,_0x53a28e){return function(_0x31a3f4){if(_0x31a3f4){return _0x31a3f4[_0xdbfe('0x23')]()[_0xdbfe('0x22')](function(){_0x5cdc43[_0xdbfe('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x561433,_0x584bdc){return function(_0x391e4b){if(!_0x391e4b){_0x561433[_0xdbfe('0x1a')](0x194);}return _0x391e4b;};}function handleError(_0x225997,_0x2facd6){_0x2facd6=_0x2facd6||0x1f4;return function(_0x4e3b6d){logger[_0xdbfe('0x24')](_0x4e3b6d['stack']);if(_0x4e3b6d['name']){delete _0x4e3b6d['name'];}_0x225997['status'](_0x2facd6)[_0xdbfe('0x25')](_0x4e3b6d);};}exports[_0xdbfe('0x26')]=function(_0x578bf6,_0x4972f4){var _0x1141da={},_0x477fea={},_0x2b013d={'count':0x0,'rows':[]};var _0x2f383f=db['CmCustomField']['rawAttributes'];_0x477fea[_0xdbfe('0x27')]=_[_0xdbfe('0x28')](_[_0xdbfe('0x29')](_0x2f383f),[_0xdbfe('0x2a')]);_0x477fea[_0xdbfe('0x2b')]=_[_0xdbfe('0x29')](_0x578bf6[_0xdbfe('0x2b')]);_0x477fea['filters']=_['intersection'](_0x477fea[_0xdbfe('0x27')],_0x477fea[_0xdbfe('0x2b')]);_0x1141da[_0xdbfe('0x2c')]=_[_0xdbfe('0x2d')](_0x477fea[_0xdbfe('0x27')],qs['fields'](_0x578bf6[_0xdbfe('0x2b')]['fields']));_0x1141da[_0xdbfe('0x2c')]=_0x1141da[_0xdbfe('0x2c')]['length']?_0x1141da[_0xdbfe('0x2c')]:_0x477fea[_0xdbfe('0x27')];if(!_0x578bf6['query']['hasOwnProperty'](_0xdbfe('0x2e'))){_0x1141da[_0xdbfe('0x2f')]=qs[_0xdbfe('0x2f')](_0x578bf6[_0xdbfe('0x2b')][_0xdbfe('0x2f')]);_0x1141da[_0xdbfe('0x1e')]=qs['offset'](_0x578bf6['query']['offset']);}_0x1141da[_0xdbfe('0x30')]=qs['sort'](_0x578bf6[_0xdbfe('0x2b')][_0xdbfe('0x31')]);_0x1141da[_0xdbfe('0x32')]=qs[_0xdbfe('0x33')](_[_0xdbfe('0x34')](_0x578bf6[_0xdbfe('0x2b')],_0x477fea[_0xdbfe('0x33')]));if(_0x578bf6[_0xdbfe('0x2b')][_0xdbfe('0x35')]){_0x1141da[_0xdbfe('0x32')]=_[_0xdbfe('0x36')](_0x1141da[_0xdbfe('0x32')],{'$or':_[_0xdbfe('0x37')](_0x2f383f,function(_0x358dda){if(_0x358dda['type'][_0xdbfe('0x38')]!==_0xdbfe('0x39')){var _0x820c4c={};_0x820c4c[_0x358dda['field']]={'$like':'%'+_0x578bf6[_0xdbfe('0x2b')][_0xdbfe('0x35')]+'%'};return _0x820c4c;}})});}_0x1141da=_[_0xdbfe('0x36')]({},_0x1141da,_0x578bf6[_0xdbfe('0x3a')]);var _0x10879d={'where':_0x1141da[_0xdbfe('0x32')]};return db[_0xdbfe('0x3b')][_0xdbfe('0x3c')](_0x10879d)['then'](function(_0x4a73ba){_0x2b013d['count']=_0x4a73ba;if(_0x578bf6[_0xdbfe('0x2b')]['includeAll']){_0x1141da['include']=[{'all':!![]}];}return db[_0xdbfe('0x3b')][_0xdbfe('0x3d')](_0x1141da);})['then'](function(_0x5adfb1){_0x2b013d[_0xdbfe('0x3e')]=_0x5adfb1;return _0x2b013d;})[_0xdbfe('0x22')](respondWithFilteredResult(_0x4972f4,_0x1141da))[_0xdbfe('0x3f')](handleError(_0x4972f4,null));};exports['show']=function(_0x31ae86,_0x5d8bc0){var _0x133e62={'raw':!![],'where':{'id':_0x31ae86['params']['id']}},_0x5e3f04={};_0x5e3f04[_0xdbfe('0x27')]=_[_0xdbfe('0x29')](db[_0xdbfe('0x3b')]['rawAttributes']);_0x5e3f04[_0xdbfe('0x2b')]=_[_0xdbfe('0x29')](_0x31ae86[_0xdbfe('0x2b')]);_0x5e3f04[_0xdbfe('0x33')]=_[_0xdbfe('0x2d')](_0x5e3f04['model'],_0x5e3f04[_0xdbfe('0x2b')]);_0x133e62[_0xdbfe('0x2c')]=_[_0xdbfe('0x2d')](_0x5e3f04['model'],qs[_0xdbfe('0x40')](_0x31ae86[_0xdbfe('0x2b')][_0xdbfe('0x40')]));_0x133e62[_0xdbfe('0x2c')]=_0x133e62['attributes']['length']?_0x133e62['attributes']:_0x5e3f04[_0xdbfe('0x27')];if(_0x31ae86[_0xdbfe('0x2b')]['includeAll']){_0x133e62[_0xdbfe('0x41')]=[{'all':!![]}];}_0x133e62=_[_0xdbfe('0x36')]({},_0x133e62,_0x31ae86[_0xdbfe('0x3a')]);return db['CmCustomField'][_0xdbfe('0x42')](_0x133e62)[_0xdbfe('0x22')](handleEntityNotFound(_0x5d8bc0,null))[_0xdbfe('0x22')](respondWithResult(_0x5d8bc0,null))[_0xdbfe('0x3f')](handleError(_0x5d8bc0,null));};exports[_0xdbfe('0x43')]=function(_0xe53ec1,_0x4c5a19){if(_0xe53ec1[_0xdbfe('0x44')]['id']){delete _0xe53ec1[_0xdbfe('0x44')]['id'];}return db[_0xdbfe('0x3b')][_0xdbfe('0x42')]({'where':{'id':_0xe53ec1['params']['id']}})[_0xdbfe('0x22')](handleEntityNotFound(_0x4c5a19,null))[_0xdbfe('0x22')](saveUpdates(_0xe53ec1[_0xdbfe('0x44')],null))[_0xdbfe('0x22')](respondWithResult(_0x4c5a19,null))[_0xdbfe('0x3f')](handleError(_0x4c5a19,null));};exports[_0xdbfe('0x23')]=function(_0x55b923,_0x1ef7fe){return db[_0xdbfe('0x3b')][_0xdbfe('0x42')]({'where':{'id':_0x55b923[_0xdbfe('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ef7fe,null))[_0xdbfe('0x22')](removeEntity(_0x1ef7fe,null))['catch'](handleError(_0x1ef7fe,null));};exports[_0xdbfe('0x46')]=function(_0x523a9e,_0x4ba083){var _0x4dd212;return db['sequelize'][_0xdbfe('0x47')](function(_0x6ffe09){return db['CmCustomField'][_0xdbfe('0x46')](_0x523a9e[_0xdbfe('0x44')],{'transaction':_0x6ffe09})[_0xdbfe('0x22')](function(_0x275f7c){_0x4dd212=_0x275f7c;var _0x410287={'type':db[_0xdbfe('0x48')][_0xdbfe('0x49')],'transaction':_0x6ffe09};switch(_0x523a9e['body'][_0xdbfe('0x4a')]){case _0xdbfe('0x4b'):_0x410287['type']=db[_0xdbfe('0x48')][_0xdbfe('0x49')];break;case _0xdbfe('0x4c'):_0x410287[_0xdbfe('0x4a')]=db['Sequelize']['INTEGER'];break;case _0xdbfe('0x4d'):_0x410287[_0xdbfe('0x4a')]=db['Sequelize']['BOOLEAN'];_0x410287[_0xdbfe('0x4e')]=![];break;default:}return db[_0xdbfe('0x4f')][_0xdbfe('0x50')]['addColumn'](_0xdbfe('0x51'),util[_0xdbfe('0x52')](_0xdbfe('0x53'),_0x4dd212['id']),_0x410287);})['then'](function(){return _0x4dd212;});})['then'](respondWithResult(_0x4ba083,0xc9))[_0xdbfe('0x3f')](handleError(_0x4ba083,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 86796fd..9b83293 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 _0x9e4f=['cm_custom_fields','../../config/logger','api','moment','bluebird','request-promise','exports','define','CmCustomField'];(function(_0x49bc4e,_0x24ea0d){var _0x5dbd2f=function(_0x4eb194){while(--_0x4eb194){_0x49bc4e['push'](_0x49bc4e['shift']());}};_0x5dbd2f(++_0x24ea0d);}(_0x9e4f,0x121));var _0xf9e4=function(_0x295bde,_0x2cb6df){_0x295bde=_0x295bde-0x0;var _0x4ef552=_0x9e4f[_0x295bde];return _0x4ef552;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf9e4('0x0'))(_0xf9e4('0x1'));var moment=require(_0xf9e4('0x2'));var BPromise=require(_0xf9e4('0x3'));var rp=require(_0xf9e4('0x4'));var attributes=require('./cmCustomField.attributes');module[_0xf9e4('0x5')]=function(_0x4e6621,_0x5605ee){return _0x4e6621[_0xf9e4('0x6')](_0xf9e4('0x7'),attributes,{'tableName':_0xf9e4('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bdd=['api','bluebird','request-promise','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x6bdd,0x6b));var _0xd6bd=function(_0x2fbf05,_0x2b3d3d){_0x2fbf05=_0x2fbf05-0x0;var _0xd1d62f=_0x6bdd[_0x2fbf05];return _0xd1d62f;};'use strict';var _=require(_0xd6bd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd6bd('0x1'));var moment=require('moment');var BPromise=require(_0xd6bd('0x2'));var rp=require(_0xd6bd('0x3'));var attributes=require(_0xd6bd('0x4'));module[_0xd6bd('0x5')]=function(_0x550ee1,_0xe8361d){return _0x550ee1[_0xd6bd('0x6')](_0xd6bd('0x7'),attributes,{'tableName':_0xd6bd('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 164d440..48fc248 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 _0x3baf=['code','message','result','catch','lodash','util','randomstring','ioredis','../../config/environment','jayson/promise','client','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2afadf,_0x57fb00){var _0x3f0571=function(_0x16f0c7){while(--_0x16f0c7){_0x2afadf['push'](_0x2afadf['shift']());}};_0x3f0571(++_0x57fb00);}(_0x3baf,0x70));var _0xf3ba=function(_0x334564,_0x4a14ca){_0x334564=_0x334564-0x0;var _0x35f756=_0x3baf[_0x334564];return _0x35f756;};'use strict';var _=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf3ba('0x2'));var fs=require('fs');var Redis=require(_0xf3ba('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf3ba('0x4'));var jayson=require(_0xf3ba('0x5'));var client=jayson[_0xf3ba('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc8c486,_0x55a465,_0x109249){return new BPromise(function(_0x23a420,_0xff9fa6){return client['request'](_0xc8c486,_0x109249)[_0xf3ba('0x7')](function(_0x398fd4){logger[_0xf3ba('0x8')](_0xf3ba('0x9'),_0x55a465,_0xf3ba('0xa'));logger['debug'](_0xf3ba('0xb'),_0x55a465,_0xf3ba('0xa'),JSON[_0xf3ba('0xc')](_0x398fd4));if(_0x398fd4[_0xf3ba('0xd')]){if(_0x398fd4[_0xf3ba('0xd')][_0xf3ba('0xe')]===0x1f4){logger[_0xf3ba('0xd')](_0xf3ba('0x9'),_0x55a465,_0x398fd4[_0xf3ba('0xd')][_0xf3ba('0xf')]);return _0xff9fa6(_0x398fd4[_0xf3ba('0xd')][_0xf3ba('0xf')]);}logger['error'](_0xf3ba('0x9'),_0x55a465,_0x398fd4[_0xf3ba('0xd')][_0xf3ba('0xf')]);return _0x23a420(_0x398fd4[_0xf3ba('0xd')][_0xf3ba('0xf')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x55a465,_0xf3ba('0xa'));_0x23a420(_0x398fd4[_0xf3ba('0x10')][_0xf3ba('0xf')]);}})[_0xf3ba('0x11')](function(_0x5dc804){logger['error'](_0xf3ba('0x9'),_0x55a465,_0x5dc804);_0xff9fa6(_0x5dc804);});});} \ No newline at end of file +var _0xe2ab=['CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0xe2ab,0xd2));var _0xbe2a=function(_0x4c742f,_0x2bd40a){_0x4c742f=_0x4c742f-0x0;var _0x2913ae=_0xe2ab[_0x4c742f];return _0x2913ae;};'use strict';var _=require('lodash');var util=require(_0xbe2a('0x0'));var moment=require('moment');var BPromise=require(_0xbe2a('0x1'));var rs=require(_0xbe2a('0x2'));var fs=require('fs');var Redis=require(_0xbe2a('0x3'));var db=require(_0xbe2a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbe2a('0x5'));var jayson=require(_0xbe2a('0x6'));var client=jayson[_0xbe2a('0x7')][_0xbe2a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ccc1f,_0xae5b01,_0x351414){return new BPromise(function(_0x47f9ae,_0x249b4c){return client[_0xbe2a('0x9')](_0x4ccc1f,_0x351414)['then'](function(_0x172e59){logger['info'](_0xbe2a('0xa'),_0xae5b01,_0xbe2a('0xb'));logger[_0xbe2a('0xc')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0xae5b01,_0xbe2a('0xb'),JSON[_0xbe2a('0xd')](_0x172e59));if(_0x172e59[_0xbe2a('0xe')]){if(_0x172e59[_0xbe2a('0xe')][_0xbe2a('0xf')]===0x1f4){logger[_0xbe2a('0xe')](_0xbe2a('0xa'),_0xae5b01,_0x172e59['error'][_0xbe2a('0x10')]);return _0x249b4c(_0x172e59['error'][_0xbe2a('0x10')]);}logger['error'](_0xbe2a('0xa'),_0xae5b01,_0x172e59[_0xbe2a('0xe')][_0xbe2a('0x10')]);return _0x47f9ae(_0x172e59[_0xbe2a('0xe')][_0xbe2a('0x10')]);}else{logger[_0xbe2a('0x11')](_0xbe2a('0xa'),_0xae5b01,_0xbe2a('0xb'));_0x47f9ae(_0x172e59[_0xbe2a('0x12')][_0xbe2a('0x10')]);}})[_0xbe2a('0x13')](function(_0x1b460e){logger['error']('CmCustomField,\x20%s,\x20%s',_0xae5b01,_0x1b460e);_0x249b4c(_0x1b460e);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 00b0502..c2fb1ba 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 _0xa611=['./cmCustomField.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x439d06,_0x59cfd0){var _0x51cc72=function(_0x11126f){while(--_0x11126f){_0x439d06['push'](_0x439d06['shift']());}};_0x51cc72(++_0x59cfd0);}(_0xa611,0x1c4));var _0x1a61=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa611[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x1a61('0x0'));var util=require(_0x1a61('0x1'));var path=require(_0x1a61('0x2'));var timeout=require(_0x1a61('0x3'));var express=require(_0x1a61('0x4'));var router=express['Router']();var auth=require(_0x1a61('0x5'));var interaction=require(_0x1a61('0x6'));var config=require(_0x1a61('0x7'));var controller=require(_0x1a61('0x8'));router['get']('/',auth[_0x1a61('0x9')](),controller[_0x1a61('0xa')]);router[_0x1a61('0xb')]('/:id',auth[_0x1a61('0x9')](),controller[_0x1a61('0xc')]);router[_0x1a61('0xd')]('/',auth['isAuthenticated'](),controller[_0x1a61('0xe')]);router[_0x1a61('0xf')](_0x1a61('0x10'),auth[_0x1a61('0x9')](),controller[_0x1a61('0x11')]);router[_0x1a61('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x1a61('0x13')]);module['exports']=router; \ No newline at end of file +var _0xcd0a=['/:id','isAuthenticated','show','post','create','put','update','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xcd0a,0x168));var _0xacd0=function(_0x4a2268,_0x2c6a30){_0x4a2268=_0x4a2268-0x0;var _0x57f41a=_0xcd0a[_0x4a2268];return _0x57f41a;};'use strict';var multer=require(_0xacd0('0x0'));var util=require(_0xacd0('0x1'));var path=require(_0xacd0('0x2'));var timeout=require(_0xacd0('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xacd0('0x4'));var interaction=require(_0xacd0('0x5'));var config=require(_0xacd0('0x6'));var controller=require('./cmCustomField.controller');router[_0xacd0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xacd0('0x8'),auth[_0xacd0('0x9')](),controller[_0xacd0('0xa')]);router[_0xacd0('0xb')]('/',auth[_0xacd0('0x9')](),controller[_0xacd0('0xc')]);router[_0xacd0('0xd')](_0xacd0('0x8'),auth[_0xacd0('0x9')](),controller[_0xacd0('0xe')]);router['delete']('/:id',auth[_0xacd0('0x9')](),controller[_0xacd0('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 9941340..395b36f 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 _0x5b0d=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize','exports','BOOLEAN','DATE'];(function(_0x4d4e76,_0xdee688){var _0x10cab3=function(_0x3f01aa){while(--_0x3f01aa){_0x4d4e76['push'](_0x4d4e76['shift']());}};_0x10cab3(++_0xdee688);}(_0x5b0d,0x95));var _0xd5b0=function(_0x5c6783,_0x5ee78a){_0x5c6783=_0x5c6783-0x0;var _0x34a61f=_0x5b0d[_0x5c6783];return _0x34a61f;};'use strict';var moment=require(_0xd5b0('0x0'));var Sequelize=require(_0xd5b0('0x1'));module[_0xd5b0('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xd5b0('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xd5b0('0x4')],'defaultValue':moment()[_0xd5b0('0x5')](_0xd5b0('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd5b0('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd5b0('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xd5b0('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd5b0('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd5b0('0x4')]},'priority':{'type':Sequelize[_0xd5b0('0x7')](0x2)[_0xd5b0('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xd5b0('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xd5b0('0x7')],'unique':_0xd5b0('0xa')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xd5b0('0xa')},'UserId':{'type':Sequelize[_0xd5b0('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xd5b0('0x7')],'unique':_0xd5b0('0xa')},'CampaignId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x97bb=['contactListQueue','moment','sequelize','BOOLEAN','DATE','format','INTEGER','UNSIGNED'];(function(_0x1ee392,_0x434efa){var _0x3eec85=function(_0x1e68e9){while(--_0x1e68e9){_0x1ee392['push'](_0x1ee392['shift']());}};_0x3eec85(++_0x434efa);}(_0x97bb,0x131));var _0xb97b=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x97bb[_0x40220a];return _0x3903cc;};'use strict';var moment=require(_0xb97b('0x0'));var Sequelize=require(_0xb97b('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xb97b('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb97b('0x3')],'defaultValue':moment()[_0xb97b('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xb97b('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb97b('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb97b('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xb97b('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb97b('0x5')],'unique':_0xb97b('0x7')},'ListId':{'type':Sequelize[_0xb97b('0x5')],'unique':_0xb97b('0x7')},'UserId':{'type':Sequelize[_0xb97b('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xb97b('0x5')],'unique':_0xb97b('0x7')},'CampaignId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 36a3c72..b3dd768 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 _0x42c4=['offset','limit','json','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','keys','query','model','filters','$or','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$contains','$contained','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','key','VIRTUAL','field','options','CmHopper','includeAll','include','findAll','rows','catch','params','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','createdAt','updatedAt','state','statedesc','campaign','membername','user','UserId','deletedat','calleridnum','phone','campaigntype','CmContact','find','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','preview','sequelize','transaction','format','map','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x42c4,0x6e));var _0x442c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x42c4[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x442c('0x0'));var emlformat=require(_0x442c('0x1'));var rimraf=require(_0x442c('0x2'));var zipdir=require(_0x442c('0x3'));var jsonpatch=require(_0x442c('0x4'));var rp=require(_0x442c('0x5'));var moment=require('moment');var BPromise=require(_0x442c('0x6'));var Mustache=require(_0x442c('0x7'));var util=require(_0x442c('0x8'));var path=require(_0x442c('0x9'));var sox=require(_0x442c('0xa'));var csv=require(_0x442c('0xb'));var ejs=require(_0x442c('0xc'));var fs=require('fs');var _=require(_0x442c('0xd'));var squel=require('squel');var crypto=require(_0x442c('0xe'));var jsforce=require(_0x442c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x442c('0xb'));var querystring=require(_0x442c('0x10'));var Papa=require(_0x442c('0x11'));var authService=require(_0x442c('0x12'));var hardwareService=require(_0x442c('0x13'));var Redis=require('ioredis');var qs=require(_0x442c('0x14'));var logger=require(_0x442c('0x15'))(_0x442c('0x16'));var utils=require(_0x442c('0x17'));var config=require(_0x442c('0x18'));var db=require(_0x442c('0x19'))['db'];function respondWithStatusCode(_0x4cdcf0,_0x449a4c){_0x449a4c=_0x449a4c||0xcc;return function(_0x3ead3b){if(_0x3ead3b){return _0x4cdcf0[_0x442c('0x1a')](_0x449a4c);}return _0x4cdcf0[_0x442c('0x1b')](_0x449a4c)[_0x442c('0x1c')]();};}function respondWithResult(_0x284b44,_0x565ed9){_0x565ed9=_0x565ed9||0xc8;return function(_0x2fc9f1){if(_0x2fc9f1){return _0x284b44['status'](_0x565ed9)['json'](_0x2fc9f1);}};}function respondWithFilteredResult(_0x2b0b34,_0x3a5014){return function(_0x2e04a2){if(_0x2e04a2){var _0x1d1b61=_0x2e04a2[_0x442c('0x1d')],_0x1af56d=_0x3a5014['offset'],_0x5c80a3=_0x3a5014[_0x442c('0x1e')]+_0x3a5014[_0x442c('0x1f')],_0x3bc789;if(_0x5c80a3>=_0x1d1b61){_0x5c80a3=_0x1d1b61;_0x3bc789=0xc8;}else{_0x3bc789=0xce;}_0x2b0b34['status'](_0x3bc789);return _0x2b0b34['set']('Content-Range',_0x1af56d+'-'+_0x5c80a3+'/'+_0x1d1b61)[_0x442c('0x20')](_0x2e04a2);}return null;};}function patchUpdates(_0x582249){return function(_0x55162b){try{jsonpatch['apply'](_0x55162b,_0x582249,!![]);}catch(_0x4f3589){return BPromise[_0x442c('0x21')](_0x4f3589);}return _0x55162b[_0x442c('0x22')]();};}function saveUpdates(_0x1989f4,_0x2ca037){return function(_0x5d62a8){if(_0x5d62a8){return _0x5d62a8[_0x442c('0x23')](_0x1989f4)[_0x442c('0x24')](function(_0x57b003){return _0x57b003;});}return null;};}function removeEntity(_0x3f15c0,_0x337747){return function(_0x1dabf1){if(_0x1dabf1){return _0x1dabf1[_0x442c('0x25')]()[_0x442c('0x24')](function(){_0x3f15c0[_0x442c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcd2e2,_0x2677d3){return function(_0xeba86c){if(!_0xeba86c){_0xcd2e2[_0x442c('0x1a')](0x194);}return _0xeba86c;};}function handleError(_0x165de8,_0x31a1a7){_0x31a1a7=_0x31a1a7||0x1f4;return function(_0x306f5e){logger[_0x442c('0x26')](_0x306f5e[_0x442c('0x27')]);if(_0x306f5e[_0x442c('0x28')]){delete _0x306f5e[_0x442c('0x28')];}_0x165de8[_0x442c('0x1b')](_0x31a1a7)[_0x442c('0x29')](_0x306f5e);};}exports[_0x442c('0x2a')]=function(_0x341778,_0x361b6b){var _0x484343={},_0x25bbf9={},_0xf76235={'count':0x0,'rows':[]};var _0x407231=db['CmHopper'][_0x442c('0x2b')];_0x25bbf9['model']=_[_0x442c('0x2c')](_0x407231);_0x25bbf9[_0x442c('0x2d')]=_['keys'](_0x341778[_0x442c('0x2d')]);_0x25bbf9['filters']=_['intersection'](_0x25bbf9[_0x442c('0x2e')],_0x25bbf9[_0x442c('0x2d')]);_0x25bbf9['filters']=_['concat'](_0x25bbf9[_0x442c('0x2f')],['$and',_0x442c('0x30'),_0x442c('0x31'),_0x442c('0x32'),_0x442c('0x33'),'$lte',_0x442c('0x34'),_0x442c('0x35'),_0x442c('0x36'),_0x442c('0x37'),_0x442c('0x38'),_0x442c('0x39'),_0x442c('0x3a'),_0x442c('0x3b'),_0x442c('0x3c'),_0x442c('0x3d'),'$notILike',_0x442c('0x3b'),'$overlap',_0x442c('0x3e'),_0x442c('0x3f'),'$any']);_0x484343[_0x442c('0x40')]=_[_0x442c('0x41')](_0x25bbf9[_0x442c('0x2e')],qs[_0x442c('0x42')](_0x341778[_0x442c('0x2d')][_0x442c('0x42')]));_0x484343['attributes']=_0x484343[_0x442c('0x40')][_0x442c('0x43')]?_0x484343[_0x442c('0x40')]:_0x25bbf9[_0x442c('0x2e')];if(!_0x341778[_0x442c('0x2d')][_0x442c('0x44')](_0x442c('0x45'))){_0x484343[_0x442c('0x1f')]=qs[_0x442c('0x1f')](_0x341778[_0x442c('0x2d')][_0x442c('0x1f')]);_0x484343[_0x442c('0x1e')]=qs[_0x442c('0x1e')](_0x341778[_0x442c('0x2d')][_0x442c('0x1e')]);}_0x484343[_0x442c('0x46')]=qs[_0x442c('0x47')](_0x341778[_0x442c('0x2d')][_0x442c('0x47')]);_0x484343['where']=qs[_0x442c('0x2f')](_['pick'](_0x341778[_0x442c('0x2d')],_0x25bbf9[_0x442c('0x2f')]));if(_0x341778[_0x442c('0x2d')][_0x442c('0x48')]){_0x484343[_0x442c('0x49')]=_[_0x442c('0x4a')](_0x484343[_0x442c('0x49')],{'$or':_['map'](_0x407231,function(_0x25e73a){if(_0x25e73a['type'][_0x442c('0x4b')]!==_0x442c('0x4c')){var _0x594c8b={};_0x594c8b[_0x25e73a[_0x442c('0x4d')]]={'$like':'%'+_0x341778[_0x442c('0x2d')]['filter']+'%'};return _0x594c8b;}})});}_0x484343=_[_0x442c('0x4a')]({},_0x484343,_0x341778[_0x442c('0x4e')]);var _0x5f0e0b={'where':_0x484343[_0x442c('0x49')]};return db[_0x442c('0x4f')][_0x442c('0x1d')](_0x5f0e0b)[_0x442c('0x24')](function(_0x194857){_0xf76235[_0x442c('0x1d')]=_0x194857;if(_0x341778[_0x442c('0x2d')][_0x442c('0x50')]){_0x484343[_0x442c('0x51')]=[{'all':!![]}];}return db[_0x442c('0x4f')][_0x442c('0x52')](_0x484343);})[_0x442c('0x24')](function(_0x5d545f){_0xf76235[_0x442c('0x53')]=_0x5d545f;return _0xf76235;})[_0x442c('0x24')](respondWithFilteredResult(_0x361b6b,_0x484343))[_0x442c('0x54')](handleError(_0x361b6b,null));};exports['show']=function(_0x55b559,_0x5da936){var _0x51b548={'raw':!![],'where':{'id':_0x55b559[_0x442c('0x55')]['id']}},_0x231967={};_0x231967['model']=_[_0x442c('0x2c')](db[_0x442c('0x4f')][_0x442c('0x2b')]);_0x231967[_0x442c('0x2d')]=_[_0x442c('0x2c')](_0x55b559[_0x442c('0x2d')]);_0x231967[_0x442c('0x2f')]=_[_0x442c('0x41')](_0x231967[_0x442c('0x2e')],_0x231967[_0x442c('0x2d')]);_0x51b548[_0x442c('0x40')]=_[_0x442c('0x41')](_0x231967[_0x442c('0x2e')],qs[_0x442c('0x42')](_0x55b559[_0x442c('0x2d')][_0x442c('0x42')]));_0x51b548[_0x442c('0x40')]=_0x51b548[_0x442c('0x40')][_0x442c('0x43')]?_0x51b548['attributes']:_0x231967[_0x442c('0x2e')];if(_0x55b559[_0x442c('0x2d')][_0x442c('0x50')]){_0x51b548[_0x442c('0x51')]=[{'all':!![]}];}_0x51b548=_[_0x442c('0x4a')]({},_0x51b548,_0x55b559[_0x442c('0x4e')]);return db[_0x442c('0x4f')]['find'](_0x51b548)[_0x442c('0x24')](handleEntityNotFound(_0x5da936,null))[_0x442c('0x24')](respondWithResult(_0x5da936,null))[_0x442c('0x54')](handleError(_0x5da936,null));};exports[_0x442c('0x56')]=function(_0x3c8c83,_0x26a9ed){return db[_0x442c('0x4f')]['create'](_0x3c8c83[_0x442c('0x57')],{})['then'](respondWithResult(_0x26a9ed,0xc9))[_0x442c('0x54')](handleError(_0x26a9ed,null));};exports[_0x442c('0x23')]=function(_0x3a9b15,_0x3e5c30){if(_0x3a9b15[_0x442c('0x57')]['id']){delete _0x3a9b15['body']['id'];}return db[_0x442c('0x4f')]['find']({'where':{'id':_0x3a9b15[_0x442c('0x55')]['id']}})[_0x442c('0x24')](handleEntityNotFound(_0x3e5c30,null))[_0x442c('0x24')](saveUpdates(_0x3a9b15[_0x442c('0x57')],null))['then'](respondWithResult(_0x3e5c30,null))[_0x442c('0x54')](handleError(_0x3e5c30,null));};exports[_0x442c('0x58')]=function(_0x47e4ae,_0x4fadbe){return db[_0x442c('0x4f')][_0x442c('0x58')]()[_0x442c('0x24')](respondWithResult(_0x4fadbe,null))[_0x442c('0x54')](handleError(_0x4fadbe,null));};exports[_0x442c('0x25')]=function(_0x24967a,_0x4f3a81){var _0xcefe62;return db[_0x442c('0x4f')]['find']({'where':{'id':_0x24967a[_0x442c('0x55')]['id']}})[_0x442c('0x24')](handleEntityNotFound(_0x4f3a81,null))[_0x442c('0x24')](function(_0x584e1b){if(_0x584e1b){return _0x584e1b['destroy']()['then'](function(_0x581f27){return _0x581f27;});}})[_0x442c('0x24')](function(_0x565e0f){_0xcefe62=_0x565e0f;if(_0x565e0f){if(_0x565e0f[_0x442c('0x59')]||_0x565e0f[_0x442c('0x5a')]){return db[_0x565e0f[_0x442c('0x59')]?_0x442c('0x5b'):'Campaign']['find']({'where':{'id':_0x565e0f[_0x442c('0x59')]?_0x565e0f['VoiceQueueId']:_0x565e0f[_0x442c('0x5a')]},'attributes':['id',_0x442c('0x28')],'raw':!![]});}}})[_0x442c('0x24')](function(_0x5e398f){var _0x3e3048={};if(_0x5e398f){_[_0x442c('0x4a')](_0x3e3048,_['omit'](_0xcefe62['dataValues'],[_0x442c('0x5c'),_0x442c('0x5d'),'id']));_0x3e3048[_0x442c('0x5e')]=0x15;_0x3e3048[_0x442c('0x5f')]='deleted';_0x3e3048[_0x442c('0x60')]=_0x5e398f[_0x442c('0x28')];_0x3e3048[_0x442c('0x61')]=_0x24967a[_0x442c('0x62')][_0x442c('0x28')];_0x3e3048[_0x442c('0x63')]=_0x24967a[_0x442c('0x62')]['id'];_0x3e3048['deleted']=!![];_0x3e3048[_0x442c('0x64')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3e3048[_0x442c('0x65')]=_0xcefe62[_0x442c('0x66')];_0x3e3048[_0x442c('0x67')]=_0xcefe62['VoiceQueueId']?'queue':'ivr';return db[_0x442c('0x68')][_0x442c('0x69')]({'where':{'id':_0x3e3048['ContactId']},'attributes':[_0x442c('0x6a'),_0x442c('0x6b')]})[_0x442c('0x24')](function(_0x221bf3){if(!_[_0x442c('0x6c')](_0x4f3a81)&&!_['isNil'](_0x221bf3[_0x442c('0x6a')])){_0x3e3048[_0x442c('0x6d')]=_0x221bf3[_0x442c('0x6a')];if(!_['isNil'](_0x221bf3[_0x442c('0x6b')])){_0x3e3048[_0x442c('0x6d')]+='\x20'+_0x221bf3[_0x442c('0x6b')];}}})[_0x442c('0x6e')](function(){return db['CmHopperFinal'][_0x442c('0x56')](_0x3e3048);});}})['then'](function(){return _0x4f3a81['status'](0xcc)[_0x442c('0x1c')]();})[_0x442c('0x54')](handleError(_0x4f3a81,null));};exports[_0x442c('0x6f')]=function(_0x234a5e,_0x6c211,_0x4cb45f){var _0x3a553a=[];return db[_0x442c('0x68')][_0x442c('0x58')]()[_0x442c('0x24')](function(_0x1c0266){_0x3a553a=_[_0x442c('0x2c')](_0x1c0266);return _0x234a5e[_0x442c('0x62')][_0x442c('0x70')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x442c('0x71')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x21da09){if(_0x21da09&&_0x21da09[_0x442c('0x43')]){return db[_0x442c('0x72')][_0x442c('0x73')](function(_0x1e1771){var _0x37420f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x442c('0x74')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x442c('0x75')](_0x21da09,'id')},'$or':[{'UserId':null},{'UserId':_0x234a5e['user']['id']}]};var _0x181d5a=[];if(_0x234a5e['body'][_0x442c('0x76')]&&_0x234a5e[_0x442c('0x57')][_0x442c('0x76')]===_0x442c('0x77')){if(!_[_0x442c('0x78')](_0x234a5e[_0x442c('0x57')][_0x442c('0x79')])){_0x37420f['id']={'$in':_0x234a5e['body'][_0x442c('0x79')]};}_0x181d5a=[[_0x442c('0x7a'),_0x442c('0x7b')],[_0x442c('0x7c'),_0x21da09[0x0]['dialOrderByScheduledAt']===_0x442c('0x7b')?'DESC':'ASC'],db[_0x442c('0x72')]['literal'](_0x442c('0x7d')),['id',_0x442c('0x7e')]];}else{if(!_[_0x442c('0x78')](_0x234a5e['body'][_0x442c('0x79')])){_0x37420f['id']={'$notIn':_0x234a5e['body'][_0x442c('0x79')]};}_0x181d5a=[[_0x442c('0x7a'),_0x442c('0x7e')],[_0x442c('0x7c'),_0x21da09[0x0]['dialOrderByScheduledAt']],db[_0x442c('0x72')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x442c('0x7b')]];}return db['CmHopper']['findOne']({'attributes':['id',_0x442c('0x7f')],'where':_0x37420f,'order':_0x181d5a,'transaction':_0x1e1771,'lock':_0x1e1771[_0x442c('0x80')][_0x442c('0x81')],'include':[{'model':db[_0x442c('0x68')],'as':_0x442c('0x82'),'attributes':_0x3a553a,'include':[{'model':db[_0x442c('0x83')],'as':_0x442c('0x84'),'attributes':['id','name']}]},{'model':db[_0x442c('0x85')],'as':_0x442c('0x86'),'attributes':['id','name']},{'model':db[_0x442c('0x5b')],'as':_0x442c('0x87'),'attributes':['id',_0x442c('0x28'),_0x442c('0x88')]}]})['then'](function(_0x1ad341){if(_0x1ad341){return _0x1ad341[_0x442c('0x23')]({'UserId':_0x234a5e['user']['id']},{'transaction':_0x1e1771});}});});}})[_0x442c('0x24')](handleEntityNotFound(_0x6c211,null))[_0x442c('0x24')](respondWithResult(_0x6c211,null))[_0x442c('0x54')](handleError(_0x6c211,null));};exports['getOpenContacts']=function(_0x54fe82,_0x36cb00,_0x5bed22){return _0x54fe82[_0x442c('0x62')][_0x442c('0x70')]({'where':{'type':_0x442c('0x89'),'dialActive':!![],'dialMethod':_0x442c('0x71')},'attributes':['id'],'raw':!![]})[_0x442c('0x24')](function(_0x592332){if(_0x592332&&_0x592332[_0x442c('0x43')]){return db[_0x442c('0x4f')][_0x442c('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x442c('0x74')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x442c('0x75')](_0x592332,'id')},'$or':[{'UserId':null},{'UserId':_0x54fe82[_0x442c('0x62')]['id']}]}});}return 0x0;})[_0x442c('0x24')](function(_0x143bf1){if(!_['isNil'](_0x143bf1)&&_[_0x442c('0x8a')](_0x143bf1)){return _0x36cb00[_0x442c('0x1b')](0xc8)[_0x442c('0x20')]({'contacts':_0x143bf1});}else{logger[_0x442c('0x26')](_0x442c('0x8b'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x36cb00['sendStatus'](0x194);}})[_0x442c('0x54')](handleError(_0x36cb00,null));}; \ No newline at end of file +var _0x3815=['limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','CmHopper','rawAttributes','model','query','filters','concat','$and','$or','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','field','include','findAll','rows','catch','show','params','keys','intersection','options','find','create','body','describe','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','state','statedesc','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','map','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset'];(function(_0x5df3f5,_0x4cf65e){var _0x1c5b7c=function(_0xc8c045){while(--_0xc8c045){_0x5df3f5['push'](_0x5df3f5['shift']());}};_0x1c5b7c(++_0x4cf65e);}(_0x3815,0x79));var _0x5381=function(_0x446aa1,_0x142a8c){_0x446aa1=_0x446aa1-0x0;var _0x5bebb5=_0x3815[_0x446aa1];return _0x5bebb5;};'use strict';var pdf=require(_0x5381('0x0'));var emlformat=require(_0x5381('0x1'));var rimraf=require(_0x5381('0x2'));var zipdir=require(_0x5381('0x3'));var jsonpatch=require(_0x5381('0x4'));var rp=require(_0x5381('0x5'));var moment=require(_0x5381('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5381('0x7'));var util=require('util');var path=require(_0x5381('0x8'));var sox=require(_0x5381('0x9'));var csv=require(_0x5381('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5381('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5381('0xc'));var deskjs=require(_0x5381('0xd'));var toCsv=require(_0x5381('0xa'));var querystring=require('querystring');var Papa=require(_0x5381('0xe'));var authService=require(_0x5381('0xf'));var hardwareService=require(_0x5381('0x10'));var Redis=require('ioredis');var qs=require(_0x5381('0x11'));var logger=require(_0x5381('0x12'))(_0x5381('0x13'));var utils=require(_0x5381('0x14'));var config=require('../../config/environment');var db=require(_0x5381('0x15'))['db'];function respondWithStatusCode(_0x2aa513,_0x4eb361){_0x4eb361=_0x4eb361||0xcc;return function(_0xbc6b9d){if(_0xbc6b9d){return _0x2aa513[_0x5381('0x16')](_0x4eb361);}return _0x2aa513[_0x5381('0x17')](_0x4eb361)[_0x5381('0x18')]();};}function respondWithResult(_0x535c63,_0x523237){_0x523237=_0x523237||0xc8;return function(_0x304720){if(_0x304720){return _0x535c63[_0x5381('0x17')](_0x523237)['json'](_0x304720);}};}function respondWithFilteredResult(_0x794d23,_0x533edb){return function(_0x10e609){if(_0x10e609){var _0x57091f=_0x10e609[_0x5381('0x19')],_0x54fb7b=_0x533edb[_0x5381('0x1a')],_0x56a683=_0x533edb[_0x5381('0x1a')]+_0x533edb[_0x5381('0x1b')],_0x204fec;if(_0x56a683>=_0x57091f){_0x56a683=_0x57091f;_0x204fec=0xc8;}else{_0x204fec=0xce;}_0x794d23[_0x5381('0x17')](_0x204fec);return _0x794d23[_0x5381('0x1c')](_0x5381('0x1d'),_0x54fb7b+'-'+_0x56a683+'/'+_0x57091f)[_0x5381('0x1e')](_0x10e609);}return null;};}function patchUpdates(_0x598bc4){return function(_0x1d94fb){try{jsonpatch[_0x5381('0x1f')](_0x1d94fb,_0x598bc4,!![]);}catch(_0x31cdec){return BPromise[_0x5381('0x20')](_0x31cdec);}return _0x1d94fb[_0x5381('0x21')]();};}function saveUpdates(_0x2795d9,_0x9c498c){return function(_0x1746d0){if(_0x1746d0){return _0x1746d0['update'](_0x2795d9)[_0x5381('0x22')](function(_0x4d0885){return _0x4d0885;});}return null;};}function removeEntity(_0x1e2ab2,_0x416a1c){return function(_0x502c2f){if(_0x502c2f){return _0x502c2f[_0x5381('0x23')]()['then'](function(){_0x1e2ab2[_0x5381('0x17')](0xcc)[_0x5381('0x18')]();});}};}function handleEntityNotFound(_0x3dee60,_0x32caf4){return function(_0x24a3d6){if(!_0x24a3d6){_0x3dee60[_0x5381('0x16')](0x194);}return _0x24a3d6;};}function handleError(_0x5d0a11,_0x4ba0b0){_0x4ba0b0=_0x4ba0b0||0x1f4;return function(_0x349027){logger[_0x5381('0x24')](_0x349027[_0x5381('0x25')]);if(_0x349027[_0x5381('0x26')]){delete _0x349027[_0x5381('0x26')];}_0x5d0a11[_0x5381('0x17')](_0x4ba0b0)[_0x5381('0x27')](_0x349027);};}exports[_0x5381('0x28')]=function(_0x220537,_0x12d8f3){var _0x10adf6={},_0x5cbc3e={},_0x51d278={'count':0x0,'rows':[]};var _0xd3a09=db[_0x5381('0x29')][_0x5381('0x2a')];_0x5cbc3e[_0x5381('0x2b')]=_['keys'](_0xd3a09);_0x5cbc3e[_0x5381('0x2c')]=_['keys'](_0x220537[_0x5381('0x2c')]);_0x5cbc3e[_0x5381('0x2d')]=_['intersection'](_0x5cbc3e['model'],_0x5cbc3e[_0x5381('0x2c')]);_0x5cbc3e['filters']=_[_0x5381('0x2e')](_0x5cbc3e[_0x5381('0x2d')],[_0x5381('0x2f'),_0x5381('0x30'),'$gt',_0x5381('0x31'),_0x5381('0x32'),_0x5381('0x33'),_0x5381('0x34'),'$eq',_0x5381('0x35'),_0x5381('0x36'),_0x5381('0x37'),_0x5381('0x38'),_0x5381('0x39'),_0x5381('0x3a'),_0x5381('0x3b'),_0x5381('0x3c'),_0x5381('0x3d'),_0x5381('0x3a'),_0x5381('0x3e'),_0x5381('0x3f'),_0x5381('0x40'),'$any']);_0x10adf6[_0x5381('0x41')]=_['intersection'](_0x5cbc3e[_0x5381('0x2b')],qs['fields'](_0x220537[_0x5381('0x2c')][_0x5381('0x42')]));_0x10adf6['attributes']=_0x10adf6[_0x5381('0x41')][_0x5381('0x43')]?_0x10adf6[_0x5381('0x41')]:_0x5cbc3e[_0x5381('0x2b')];if(!_0x220537[_0x5381('0x2c')][_0x5381('0x44')](_0x5381('0x45'))){_0x10adf6[_0x5381('0x1b')]=qs['limit'](_0x220537[_0x5381('0x2c')][_0x5381('0x1b')]);_0x10adf6[_0x5381('0x1a')]=qs[_0x5381('0x1a')](_0x220537['query'][_0x5381('0x1a')]);}_0x10adf6[_0x5381('0x46')]=qs['sort'](_0x220537['query'][_0x5381('0x47')]);_0x10adf6['where']=qs[_0x5381('0x2d')](_[_0x5381('0x48')](_0x220537[_0x5381('0x2c')],_0x5cbc3e[_0x5381('0x2d')]));if(_0x220537[_0x5381('0x2c')]['filter']){_0x10adf6[_0x5381('0x49')]=_[_0x5381('0x4a')](_0x10adf6[_0x5381('0x49')],{'$or':_['map'](_0xd3a09,function(_0x564b49){if(_0x564b49['type']['key']!==_0x5381('0x4b')){var _0x1689ac={};_0x1689ac[_0x564b49[_0x5381('0x4c')]]={'$like':'%'+_0x220537['query']['filter']+'%'};return _0x1689ac;}})});}_0x10adf6=_[_0x5381('0x4a')]({},_0x10adf6,_0x220537['options']);var _0x3f8eed={'where':_0x10adf6[_0x5381('0x49')]};return db[_0x5381('0x29')][_0x5381('0x19')](_0x3f8eed)['then'](function(_0x573d9b){_0x51d278[_0x5381('0x19')]=_0x573d9b;if(_0x220537[_0x5381('0x2c')]['includeAll']){_0x10adf6[_0x5381('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0x5381('0x4e')](_0x10adf6);})[_0x5381('0x22')](function(_0x13af2d){_0x51d278[_0x5381('0x4f')]=_0x13af2d;return _0x51d278;})[_0x5381('0x22')](respondWithFilteredResult(_0x12d8f3,_0x10adf6))[_0x5381('0x50')](handleError(_0x12d8f3,null));};exports[_0x5381('0x51')]=function(_0x28bd4b,_0x38f076){var _0x555cd5={'raw':!![],'where':{'id':_0x28bd4b[_0x5381('0x52')]['id']}},_0x2302d5={};_0x2302d5[_0x5381('0x2b')]=_['keys'](db[_0x5381('0x29')]['rawAttributes']);_0x2302d5[_0x5381('0x2c')]=_[_0x5381('0x53')](_0x28bd4b[_0x5381('0x2c')]);_0x2302d5[_0x5381('0x2d')]=_[_0x5381('0x54')](_0x2302d5[_0x5381('0x2b')],_0x2302d5[_0x5381('0x2c')]);_0x555cd5[_0x5381('0x41')]=_[_0x5381('0x54')](_0x2302d5[_0x5381('0x2b')],qs[_0x5381('0x42')](_0x28bd4b['query'][_0x5381('0x42')]));_0x555cd5[_0x5381('0x41')]=_0x555cd5['attributes']['length']?_0x555cd5['attributes']:_0x2302d5[_0x5381('0x2b')];if(_0x28bd4b[_0x5381('0x2c')]['includeAll']){_0x555cd5[_0x5381('0x4d')]=[{'all':!![]}];}_0x555cd5=_[_0x5381('0x4a')]({},_0x555cd5,_0x28bd4b[_0x5381('0x55')]);return db['CmHopper'][_0x5381('0x56')](_0x555cd5)[_0x5381('0x22')](handleEntityNotFound(_0x38f076,null))[_0x5381('0x22')](respondWithResult(_0x38f076,null))[_0x5381('0x50')](handleError(_0x38f076,null));};exports[_0x5381('0x57')]=function(_0x55edb2,_0x9b8867){return db[_0x5381('0x29')][_0x5381('0x57')](_0x55edb2['body'],{})[_0x5381('0x22')](respondWithResult(_0x9b8867,0xc9))[_0x5381('0x50')](handleError(_0x9b8867,null));};exports['update']=function(_0xbfad59,_0x133589){if(_0xbfad59['body']['id']){delete _0xbfad59[_0x5381('0x58')]['id'];}return db[_0x5381('0x29')]['find']({'where':{'id':_0xbfad59[_0x5381('0x52')]['id']}})[_0x5381('0x22')](handleEntityNotFound(_0x133589,null))[_0x5381('0x22')](saveUpdates(_0xbfad59[_0x5381('0x58')],null))[_0x5381('0x22')](respondWithResult(_0x133589,null))[_0x5381('0x50')](handleError(_0x133589,null));};exports[_0x5381('0x59')]=function(_0x1e9c54,_0x1cc55e){return db['CmHopper'][_0x5381('0x59')]()[_0x5381('0x22')](respondWithResult(_0x1cc55e,null))[_0x5381('0x50')](handleError(_0x1cc55e,null));};exports[_0x5381('0x23')]=function(_0x55627e,_0x425cd6){var _0x36cb68;return db[_0x5381('0x29')][_0x5381('0x56')]({'where':{'id':_0x55627e[_0x5381('0x52')]['id']}})[_0x5381('0x22')](handleEntityNotFound(_0x425cd6,null))[_0x5381('0x22')](function(_0x53b0e0){if(_0x53b0e0){return _0x53b0e0[_0x5381('0x23')]()[_0x5381('0x22')](function(_0x5273f9){return _0x5273f9;});}})['then'](function(_0x3f310d){_0x36cb68=_0x3f310d;if(_0x3f310d){if(_0x3f310d[_0x5381('0x5a')]||_0x3f310d[_0x5381('0x5b')]){return db[_0x3f310d['VoiceQueueId']?'VoiceQueue':_0x5381('0x5c')][_0x5381('0x56')]({'where':{'id':_0x3f310d[_0x5381('0x5a')]?_0x3f310d['VoiceQueueId']:_0x3f310d[_0x5381('0x5b')]},'attributes':['id',_0x5381('0x26')],'raw':!![]});}}})[_0x5381('0x22')](function(_0x57ee6c){var _0x52cc80={};if(_0x57ee6c){_[_0x5381('0x4a')](_0x52cc80,_[_0x5381('0x5d')](_0x36cb68[_0x5381('0x5e')],[_0x5381('0x5f'),'updatedAt','id']));_0x52cc80[_0x5381('0x60')]=0x15;_0x52cc80[_0x5381('0x61')]=_0x5381('0x62');_0x52cc80[_0x5381('0x63')]=_0x57ee6c[_0x5381('0x26')];_0x52cc80[_0x5381('0x64')]=_0x55627e[_0x5381('0x65')][_0x5381('0x26')];_0x52cc80[_0x5381('0x66')]=_0x55627e['user']['id'];_0x52cc80[_0x5381('0x62')]=!![];_0x52cc80['deletedat']=moment()[_0x5381('0x67')](_0x5381('0x68'));_0x52cc80['calleridnum']=_0x36cb68[_0x5381('0x69')];_0x52cc80[_0x5381('0x6a')]=_0x36cb68['VoiceQueueId']?_0x5381('0x6b'):_0x5381('0x6c');return db['CmContact'][_0x5381('0x56')]({'where':{'id':_0x52cc80[_0x5381('0x6d')]},'attributes':[_0x5381('0x6e'),_0x5381('0x6f')]})[_0x5381('0x22')](function(_0x411859){if(!_['isNil'](_0x425cd6)&&!_[_0x5381('0x70')](_0x411859[_0x5381('0x6e')])){_0x52cc80[_0x5381('0x71')]=_0x411859['firstName'];if(!_[_0x5381('0x70')](_0x411859[_0x5381('0x6f')])){_0x52cc80[_0x5381('0x71')]+='\x20'+_0x411859['lastName'];}}})[_0x5381('0x72')](function(){return db['CmHopperFinal'][_0x5381('0x57')](_0x52cc80);});}})[_0x5381('0x22')](function(){return _0x425cd6[_0x5381('0x17')](0xcc)[_0x5381('0x18')]();})[_0x5381('0x50')](handleError(_0x425cd6,null));};exports[_0x5381('0x73')]=function(_0x1440a2,_0x4b47e9,_0x1cb1a6){var _0x14071a=[];return db[_0x5381('0x74')][_0x5381('0x59')]()[_0x5381('0x22')](function(_0x60e073){_0x14071a=_[_0x5381('0x53')](_0x60e073);return _0x1440a2['user'][_0x5381('0x75')]({'where':{'type':_0x5381('0x76'),'dialActive':!![],'dialMethod':_0x5381('0x77')},'attributes':['id',_0x5381('0x78')],'raw':!![]});})['then'](function(_0x2c3f35){if(_0x2c3f35&&_0x2c3f35[_0x5381('0x43')]){return db[_0x5381('0x79')]['transaction'](function(_0x2a2bd1){var _0x8a192a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5381('0x67')](_0x5381('0x68'))},'VoiceQueueId':{'$in':_[_0x5381('0x7a')](_0x2c3f35,'id')},'$or':[{'UserId':null},{'UserId':_0x1440a2[_0x5381('0x65')]['id']}]};var _0x422818=[];if(_0x1440a2['body'][_0x5381('0x7b')]&&_0x1440a2['body'][_0x5381('0x7b')]===_0x5381('0x7c')){if(!_[_0x5381('0x7d')](_0x1440a2[_0x5381('0x58')][_0x5381('0x7e')])){_0x8a192a['id']={'$in':_0x1440a2['body'][_0x5381('0x7e')]};}_0x422818=[[_0x5381('0x7f'),_0x5381('0x80')],[_0x5381('0x81'),_0x2c3f35[0x0]['dialOrderByScheduledAt']===_0x5381('0x80')?_0x5381('0x82'):_0x5381('0x80')],db[_0x5381('0x79')][_0x5381('0x83')](_0x5381('0x84')),['id',_0x5381('0x82')]];}else{if(!_['isEmpty'](_0x1440a2['body'][_0x5381('0x7e')])){_0x8a192a['id']={'$notIn':_0x1440a2[_0x5381('0x58')]['hopperIds']};}_0x422818=[[_0x5381('0x7f'),_0x5381('0x82')],[_0x5381('0x81'),_0x2c3f35[0x0][_0x5381('0x78')]],db[_0x5381('0x79')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x5381('0x80')]];}return db[_0x5381('0x29')][_0x5381('0x85')]({'attributes':['id',_0x5381('0x86')],'where':_0x8a192a,'order':_0x422818,'transaction':_0x2a2bd1,'lock':_0x2a2bd1[_0x5381('0x87')]['UPDATE'],'include':[{'model':db[_0x5381('0x74')],'as':_0x5381('0x88'),'attributes':_0x14071a,'include':[{'model':db[_0x5381('0x89')],'as':_0x5381('0x8a'),'attributes':['id',_0x5381('0x26')]}]},{'model':db[_0x5381('0x8b')],'as':_0x5381('0x8c'),'attributes':['id',_0x5381('0x26')]},{'model':db[_0x5381('0x8d')],'as':_0x5381('0x8e'),'attributes':['id',_0x5381('0x26'),_0x5381('0x8f')]}]})['then'](function(_0x149fb3){if(_0x149fb3){return _0x149fb3['update']({'UserId':_0x1440a2[_0x5381('0x65')]['id']},{'transaction':_0x2a2bd1});}});});}})['then'](handleEntityNotFound(_0x4b47e9,null))[_0x5381('0x22')](respondWithResult(_0x4b47e9,null))[_0x5381('0x50')](handleError(_0x4b47e9,null));};exports[_0x5381('0x90')]=function(_0x1d1293,_0x21a00c,_0x46a0b7){return _0x1d1293[_0x5381('0x65')]['getVoiceQueues']({'where':{'type':_0x5381('0x76'),'dialActive':!![],'dialMethod':_0x5381('0x77')},'attributes':['id'],'raw':!![]})[_0x5381('0x22')](function(_0x533d89){if(_0x533d89&&_0x533d89[_0x5381('0x43')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5381('0x67')](_0x5381('0x68'))},'VoiceQueueId':{'$in':_[_0x5381('0x7a')](_0x533d89,'id')},'$or':[{'UserId':null},{'UserId':_0x1d1293[_0x5381('0x65')]['id']}]}});}return 0x0;})[_0x5381('0x22')](function(_0x13fb8c){if(!_[_0x5381('0x70')](_0x13fb8c)&&_[_0x5381('0x91')](_0x13fb8c)){return _0x21a00c['status'](0xc8)[_0x5381('0x1e')]({'contacts':_0x13fb8c});}else{logger[_0x5381('0x24')](_0x5381('0x92'),_0x5381('0x90'),0x194,_0x5381('0x93'));_0x21a00c[_0x5381('0x16')](0x194);}})[_0x5381('0x50')](handleError(_0x21a00c,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 872f09e..45b892d 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 _0x4dc7=['lodash','util','../../config/logger','api','moment','request-promise','exports','CmHopper','scheduledat','phone','priority'];(function(_0x37b3e5,_0x33b516){var _0x207f20=function(_0x5237fa){while(--_0x5237fa){_0x37b3e5['push'](_0x37b3e5['shift']());}};_0x207f20(++_0x33b516);}(_0x4dc7,0xb0));var _0x74dc=function(_0x538c81,_0x271fc2){_0x538c81=_0x538c81-0x0;var _0xbfc3a0=_0x4dc7[_0x538c81];return _0xbfc3a0;};'use strict';var _=require(_0x74dc('0x0'));var util=require(_0x74dc('0x1'));var logger=require(_0x74dc('0x2'))(_0x74dc('0x3'));var moment=require(_0x74dc('0x4'));var BPromise=require('bluebird');var rp=require(_0x74dc('0x5'));var attributes=require('./cmHopper.attributes');module[_0x74dc('0x6')]=function(_0x32527e,_0x2d86f9){return _0x32527e['define'](_0x74dc('0x7'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x74dc('0x8'),'fields':[_0x74dc('0x8')]},{'name':_0x74dc('0x9'),'fields':[_0x74dc('0x9')]},{'name':_0x74dc('0xa'),'fields':[_0x74dc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe8d=['CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','request-promise','exports','define'];(function(_0x215e5f,_0x321e4f){var _0x4ba505=function(_0x3a36d6){while(--_0x3a36d6){_0x215e5f['push'](_0x215e5f['shift']());}};_0x4ba505(++_0x321e4f);}(_0xbe8d,0xdd));var _0xdbe8=function(_0x104b47,_0x491eff){_0x104b47=_0x104b47-0x0;var _0x34a3f1=_0xbe8d[_0x104b47];return _0x34a3f1;};'use strict';var _=require('lodash');var util=require(_0xdbe8('0x0'));var logger=require(_0xdbe8('0x1'))(_0xdbe8('0x2'));var moment=require(_0xdbe8('0x3'));var BPromise=require('bluebird');var rp=require(_0xdbe8('0x4'));var attributes=require('./cmHopper.attributes');module[_0xdbe8('0x5')]=function(_0x403f0c,_0x5f0b46){return _0x403f0c[_0xdbe8('0x6')](_0xdbe8('0x7'),attributes,{'tableName':_0xdbe8('0x8'),'paranoid':![],'indexes':[{'name':_0xdbe8('0x9'),'fields':[_0xdbe8('0x9')]},{'name':_0xdbe8('0xa'),'fields':['phone']},{'name':_0xdbe8('0xb'),'fields':[_0xdbe8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 6db94df..9bf944a 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 _0x560f=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','info','result','catch','CmHopper','options','where','attributes','limit','include','map','model','GetCmHopper','ShowCmHopper','find','raw','debug','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','Contact','keys','length','push','all','MoveContactManagedDialer','CmHopperFinal','findAll','literal','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','UPDATE'];(function(_0x115278,_0x1db9ed){var _0x24a687=function(_0x4ffa0d){while(--_0x4ffa0d){_0x115278['push'](_0x115278['shift']());}};_0x24a687(++_0x1db9ed);}(_0x560f,0xc6));var _0xf560=function(_0x4da360,_0x311a79){_0x4da360=_0x4da360-0x0;var _0xcc485=_0x560f[_0x4da360];return _0xcc485;};'use strict';var _=require(_0xf560('0x0'));var util=require('util');var moment=require(_0xf560('0x1'));var BPromise=require(_0xf560('0x2'));var rs=require(_0xf560('0x3'));var fs=require('fs');var Redis=require(_0xf560('0x4'));var db=require(_0xf560('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf560('0x6'))(_0xf560('0x7'));var config=require(_0xf560('0x8'));var jayson=require(_0xf560('0x9'));var client=jayson['client'][_0xf560('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6429b7,_0x1ec9bf,_0x29c462){return new BPromise(function(_0x4b785c,_0x58ca96){return client['request'](_0x6429b7,_0x29c462)[_0xf560('0xb')](function(_0x2a09fc){logger['info']('CmHopper,\x20%s,\x20%s',_0x1ec9bf,_0xf560('0xc'));logger['debug'](_0xf560('0xd'),_0x1ec9bf,_0xf560('0xc'),JSON[_0xf560('0xe')](_0x2a09fc));if(_0x2a09fc['error']){if(_0x2a09fc[_0xf560('0xf')][_0xf560('0x10')]===0x1f4){logger[_0xf560('0xf')](_0xf560('0x11'),_0x1ec9bf,_0x2a09fc[_0xf560('0xf')]['message']);return _0x58ca96(_0x2a09fc[_0xf560('0xf')][_0xf560('0x12')]);}logger[_0xf560('0xf')](_0xf560('0x11'),_0x1ec9bf,_0x2a09fc[_0xf560('0xf')][_0xf560('0x12')]);return _0x4b785c(_0x2a09fc['error'][_0xf560('0x12')]);}else{logger[_0xf560('0x13')](_0xf560('0x11'),_0x1ec9bf,_0xf560('0xc'));_0x4b785c(_0x2a09fc[_0xf560('0x14')][_0xf560('0x12')]);}})[_0xf560('0x15')](function(_0x3c3bcc){logger['error']('CmHopper,\x20%s,\x20%s',_0x1ec9bf,_0x3c3bcc);_0x58ca96(_0x3c3bcc);});});}exports['GetCmHopper']=function(_0x3e66b1){var _0x5a17c7=this;return new Promise(function(_0x203a41,_0x511817){return db[_0xf560('0x16')]['findAll']({'raw':_0x3e66b1[_0xf560('0x17')]?_0x3e66b1['options']['raw']===undefined?!![]:![]:!![],'where':_0x3e66b1[_0xf560('0x17')]?_0x3e66b1[_0xf560('0x17')][_0xf560('0x18')]||null:null,'attributes':_0x3e66b1[_0xf560('0x17')]?_0x3e66b1[_0xf560('0x17')][_0xf560('0x19')]||null:null,'limit':_0x3e66b1[_0xf560('0x17')]?_0x3e66b1[_0xf560('0x17')][_0xf560('0x1a')]||null:null,'include':_0x3e66b1[_0xf560('0x17')]?_0x3e66b1[_0xf560('0x17')][_0xf560('0x1b')]?_[_0xf560('0x1c')](_0x3e66b1[_0xf560('0x17')]['include'],function(_0x9c4b85){return{'model':db[_0x9c4b85[_0xf560('0x1d')]],'as':_0x9c4b85['as'],'attributes':_0x9c4b85[_0xf560('0x19')],'include':_0x9c4b85['include']?_[_0xf560('0x1c')](_0x9c4b85['include'],function(_0xcfeec4){return{'model':db[_0xcfeec4[_0xf560('0x1d')]],'as':_0xcfeec4['as'],'attributes':_0xcfeec4[_0xf560('0x19')],'include':_0xcfeec4['include']?_[_0xf560('0x1c')](_0xcfeec4[_0xf560('0x1b')],function(_0x2de843){return{'model':db[_0x2de843['model']],'as':_0x2de843['as'],'attributes':_0x2de843['attributes']};}):[]};}):[]};}):[]:[]})[_0xf560('0xb')](function(_0x29412b){logger[_0xf560('0x13')](_0xf560('0x1e'),_0x3e66b1);logger['debug'](_0xf560('0x1e'),_0x3e66b1,JSON[_0xf560('0xe')](_0x29412b));_0x203a41(_0x29412b);})['catch'](function(_0x36d188){logger[_0xf560('0xf')](_0xf560('0x1e'),_0x36d188['message'],_0x3e66b1);_0x511817(_0x5a17c7['error'](0x1f4,_0x36d188[_0xf560('0x12')]));});});};exports[_0xf560('0x1f')]=function(_0xc67655){var _0x50283b=this;return new Promise(function(_0x3cf9b9,_0x22a182){return db['CmHopper'][_0xf560('0x20')]({'raw':_0xc67655[_0xf560('0x17')]?_0xc67655['options'][_0xf560('0x21')]===undefined?!![]:![]:!![],'where':_0xc67655['options']?_0xc67655[_0xf560('0x17')][_0xf560('0x18')]||null:null,'attributes':_0xc67655[_0xf560('0x17')]?_0xc67655[_0xf560('0x17')][_0xf560('0x19')]||null:null,'include':_0xc67655[_0xf560('0x17')]?_0xc67655[_0xf560('0x17')][_0xf560('0x1b')]?_['map'](_0xc67655['options'][_0xf560('0x1b')],function(_0x7a4979){return{'model':db[_0x7a4979[_0xf560('0x1d')]],'as':_0x7a4979['as'],'attributes':_0x7a4979[_0xf560('0x19')],'include':_0x7a4979[_0xf560('0x1b')]?_[_0xf560('0x1c')](_0x7a4979['include'],function(_0x3689c7){return{'model':db[_0x3689c7[_0xf560('0x1d')]],'as':_0x3689c7['as'],'attributes':_0x3689c7[_0xf560('0x19')],'include':_0x3689c7['include']?_['map'](_0x3689c7[_0xf560('0x1b')],function(_0x4383bd){return{'model':db[_0x4383bd[_0xf560('0x1d')]],'as':_0x4383bd['as'],'attributes':_0x4383bd[_0xf560('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf560('0xb')](function(_0x10475a){logger[_0xf560('0x13')](_0xf560('0x1f'),_0xc67655);logger[_0xf560('0x22')](_0xf560('0x1f'),_0xc67655,JSON[_0xf560('0xe')](_0x10475a));_0x3cf9b9(_0x10475a);})['catch'](function(_0x3e2050){logger[_0xf560('0xf')](_0xf560('0x1f'),_0x3e2050[_0xf560('0x12')],_0xc67655);_0x22a182(_0x50283b[_0xf560('0xf')](0x1f4,_0x3e2050['message']));});});};exports['CreateCmHopper']=function(_0x4200c7){var _0x1f7359=this;return new Promise(function(_0x33ef6d,_0x5e6096){return db[_0xf560('0x16')][_0xf560('0x23')](_0x4200c7[_0xf560('0x24')],{'raw':_0x4200c7['options']?_0x4200c7['options'][_0xf560('0x21')]===undefined?!![]:![]:!![]})[_0xf560('0xb')](function(_0x6536e8){logger[_0xf560('0x13')](_0xf560('0x25'),_0x4200c7);logger[_0xf560('0x22')](_0xf560('0x25'),_0x4200c7,JSON[_0xf560('0xe')](_0x6536e8));_0x33ef6d(_0x6536e8);})[_0xf560('0x15')](function(_0x49b4eb){logger[_0xf560('0xf')](_0xf560('0x25'),_0x49b4eb[_0xf560('0x12')],_0x4200c7);_0x5e6096(_0x1f7359[_0xf560('0xf')](0x1f4,_0x49b4eb[_0xf560('0x12')]));});});};exports[_0xf560('0x26')]=function(_0x56ef3a){var _0x115d0f=this;return new Promise(function(_0x59a5b2,_0x5884e6){return db[_0xf560('0x16')][_0xf560('0x27')](_0x56ef3a[_0xf560('0x24')],{'raw':_0x56ef3a[_0xf560('0x17')]?_0x56ef3a[_0xf560('0x17')][_0xf560('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56ef3a[_0xf560('0x17')]?_0x56ef3a[_0xf560('0x17')][_0xf560('0x18')]||null:null,'attributes':_0x56ef3a[_0xf560('0x17')]?_0x56ef3a[_0xf560('0x17')]['attributes']||null:null,'limit':_0x56ef3a[_0xf560('0x17')]?_0x56ef3a[_0xf560('0x17')][_0xf560('0x1a')]||null:null})['then'](function(_0x4c07e0){logger[_0xf560('0x13')](_0xf560('0x26'),_0x56ef3a);logger[_0xf560('0x22')]('UpdateCmHopper',_0x56ef3a,JSON[_0xf560('0xe')](_0x4c07e0));_0x59a5b2(_0x4c07e0);})[_0xf560('0x15')](function(_0x3005c1){logger[_0xf560('0xf')](_0xf560('0x26'),_0x3005c1[_0xf560('0x12')],_0x56ef3a);_0x5884e6(_0x115d0f[_0xf560('0xf')](0x1f4,_0x3005c1[_0xf560('0x12')]));});});};exports[_0xf560('0x28')]=function(_0x55a773){var _0x4d40d0=this;return new Promise(function(_0x2615a7,_0x5edce5){return db['CmHopper'][_0xf560('0x29')]({'where':_0x55a773['options']?_0x55a773[_0xf560('0x17')][_0xf560('0x18')]||null:null})[_0xf560('0xb')](function(_0x5c61b6){logger[_0xf560('0x13')](_0xf560('0x28'),_0x55a773);logger['debug'](_0xf560('0x28'),_0x55a773,JSON[_0xf560('0xe')](_0x5c61b6));_0x2615a7(_0x5c61b6);})[_0xf560('0x15')](function(_0x4bea1e){logger[_0xf560('0xf')]('DestroyCmHopper',_0x4bea1e[_0xf560('0x12')],_0x55a773);_0x5edce5(_0x4d40d0[_0xf560('0xf')](0x1f4,_0x4bea1e[_0xf560('0x12')]));});});};exports[_0xf560('0x2a')]=function(_0x136ea4){var _0x2d1b8c=this;return new Promise(function(_0x1ae278,_0x1710a5){return db[_0xf560('0x2b')][_0xf560('0x2c')]()[_0xf560('0xb')](function(_0x1eb1cf){return db[_0xf560('0x2d')][_0xf560('0x2e')](function(_0x3cf666){return db[_0xf560('0x16')]['findAll']({'where':_0x136ea4[_0xf560('0x17')]?_0x136ea4[_0xf560('0x17')][_0xf560('0x18')]||null:null,'attributes':_0x136ea4[_0xf560('0x17')]?_0x136ea4[_0xf560('0x17')]['attributes']||null:null,'limit':_0x136ea4['options']?_0x136ea4[_0xf560('0x17')][_0xf560('0x1a')]||null:null,'order':_0x136ea4['options']?_0x136ea4['options'][_0xf560('0x2f')]||null:null,'transaction':_0x3cf666,'lock':_0x3cf666[_0xf560('0x30')]['UPDATE'],'include':[{'model':db[_0xf560('0x2b')],'as':_0xf560('0x31'),'attributes':_[_0xf560('0x32')](_0x1eb1cf)}]})['then'](function(_0x528c87){var _0x1daeef=[];for(var _0xbb256d=0x0;_0xbb256d<_0x528c87[_0xf560('0x33')];_0xbb256d+=0x1){_0x1daeef[_0xf560('0x34')](_0x528c87[_0xbb256d][_0xf560('0x27')](_0x136ea4[_0xf560('0x24')],{'transaction':_0x3cf666}));}return BPromise[_0xf560('0x35')](_0x1daeef);});})[_0xf560('0xb')](function(_0x17a994){logger['info'](_0xf560('0x2a'),_0x136ea4);logger[_0xf560('0x22')](_0xf560('0x2a'),_0x136ea4,JSON[_0xf560('0xe')](_0x17a994));_0x1ae278(_0x17a994);})[_0xf560('0x15')](function(_0x30300c){logger[_0xf560('0xf')](_0xf560('0x2a'),_0x30300c['message'],_0x136ea4);_0x1710a5(_0x2d1b8c[_0xf560('0xf')](0x1f4,_0x30300c[_0xf560('0x12')]));});});});};exports[_0xf560('0x36')]=function(_0x42b0c6){var _0x121d78=this;return new Promise(function(_0x38f8d4,_0x473833){return db['sequelize']['transaction'](function(_0x1cdca1){return db[_0xf560('0x37')][_0xf560('0x23')](_0x42b0c6[_0xf560('0x24')],{'raw':_0x42b0c6[_0xf560('0x17')]?_0x42b0c6[_0xf560('0x17')]['raw']===undefined?!![]:![]:!![],'transaction':_0x1cdca1})[_0xf560('0xb')](function(){return db['CmHopper']['destroy']({'where':_0x42b0c6[_0xf560('0x17')]?_0x42b0c6[_0xf560('0x17')]['where']||null:null,'transaction':_0x1cdca1});});})[_0xf560('0xb')](function(_0x2d6951){logger[_0xf560('0x13')](_0xf560('0x36'),_0x42b0c6);logger['debug']('MoveContactManagedDialer',_0x42b0c6,JSON['stringify'](_0x2d6951));_0x38f8d4(_0x2d6951);})['catch'](function(_0x2dc825){logger[_0xf560('0xf')](_0xf560('0x36'),_0x2dc825[_0xf560('0x12')],_0x42b0c6);_0x473833(_0x121d78[_0xf560('0xf')](0x1f4,_0x2dc825['message']));});});};exports['CountReScheduled']=function(_0x1cba8c){var _0x3b6f20=this;return new Promise(function(_0x15d03c,_0x48c49c){return db[_0xf560('0x16')][_0xf560('0x38')]({'raw':_0x1cba8c[_0xf560('0x17')]?_0x1cba8c[_0xf560('0x17')][_0xf560('0x21')]===undefined?!![]:![]:!![],'where':_0x1cba8c[_0xf560('0x17')]?_0x1cba8c[_0xf560('0x17')][_0xf560('0x18')]||null:null,'attributes':[[db[_0xf560('0x2d')]['fn']('COUNT',db[_0xf560('0x2d')]['fn']('IF',db[_0xf560('0x2d')][_0xf560('0x39')]('`scheduledat`\x20>=\x20'+util[_0xf560('0x3a')](_0xf560('0x3b'),moment()[_0xf560('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xf560('0x3c')))),_0xf560('0x3d')]]})[_0xf560('0xb')](function(_0x100e0b){logger[_0xf560('0x13')](_0xf560('0x3e'),_0x1cba8c);logger[_0xf560('0x22')]('CountReScheduled',_0x1cba8c,JSON[_0xf560('0xe')](_0x100e0b));_0x15d03c(_0x100e0b);})[_0xf560('0x15')](function(_0x260719){logger[_0xf560('0xf')]('CountReScheduled',_0x260719[_0xf560('0x12')],_0x1cba8c);_0x48c49c(_0x3b6f20[_0xf560('0xf')](0x1f4,_0x260719[_0xf560('0x12')]));});});};exports[_0xf560('0x3f')]=function(_0x27242b){var _0xd55f8d=this;return new Promise(function(_0x1ddbe6,_0x366921){return db[_0xf560('0x2b')][_0xf560('0x2c')]()['then'](function(_0x2c022b){return db[_0xf560('0x2d')][_0xf560('0x2e')](function(_0x517201){return db['CmHopper'][_0xf560('0x38')]({'where':_0x27242b[_0xf560('0x17')]?_0x27242b['options']['where']||null:null,'attributes':_0x27242b[_0xf560('0x17')]?_0x27242b[_0xf560('0x17')]['attributes']||null:null,'limit':0x1,'order':_0x27242b['options']?_0x27242b[_0xf560('0x17')][_0xf560('0x2f')]||null:null,'group':db['CmHopper'][_0xf560('0x40')],'transaction':_0x517201,'lock':_0x517201[_0xf560('0x30')][_0xf560('0x41')],'include':_0x27242b[_0xf560('0x17')]?_0x27242b[_0xf560('0x17')][_0xf560('0x1b')]?_[_0xf560('0x1c')](_0x27242b[_0xf560('0x17')][_0xf560('0x1b')],function(_0x3052f2){return{'model':db[_0x3052f2[_0xf560('0x1d')]],'as':_0x3052f2['as'],'attributes':_0x3052f2[_0xf560('0x19')],'include':_0x3052f2[_0xf560('0x1b')]?_['map'](_0x3052f2['include'],function(_0x4de1fb){return{'model':db[_0x4de1fb[_0xf560('0x1d')]],'as':_0x4de1fb['as'],'attributes':_0x4de1fb[_0xf560('0x19')],'include':_0x4de1fb['include']?_['map'](_0x4de1fb[_0xf560('0x1b')],function(_0x5f03ca){return{'model':db[_0x5f03ca[_0xf560('0x1d')]],'as':_0x5f03ca['as'],'attributes':_0x5f03ca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf560('0xb')](function(_0x5465e1){var _0x1f6bf7=[];for(var _0x403cbe=0x0;_0x403cbe<_0x5465e1['length'];_0x403cbe+=0x1){_0x1f6bf7[_0xf560('0x34')](_0x5465e1[_0x403cbe][_0xf560('0x27')](_0x27242b[_0xf560('0x24')],{'transaction':_0x517201}));}return BPromise[_0xf560('0x35')](_0x1f6bf7);});})['then'](function(_0x3d0ab1){logger[_0xf560('0x13')](_0xf560('0x3f'),_0x27242b);logger[_0xf560('0x22')](_0xf560('0x3f'),_0x27242b,JSON[_0xf560('0xe')](_0x3d0ab1));_0x1ddbe6(_0x3d0ab1);})['catch'](function(_0x26dee3){logger[_0xf560('0xf')](_0xf560('0x3f'),_0x26dee3[_0xf560('0x12')],_0x27242b);_0x366921(_0xd55f8d[_0xf560('0xf')](0x1f4,_0x26dee3[_0xf560('0x12')]));});});});}; \ No newline at end of file +var _0x6d82=['transaction','order','UPDATE','length','all','MoveContactManagedDialer','sequelize','CmHopperFinal','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','push','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','findAll','options','raw','where','attributes','limit','map','model','include','CmHopper','find','ShowCmHopper','create','body','then','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','CmContact','describe'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x6d82,0xd3));var _0x26d8=function(_0x2fd08d,_0x31a51f){_0x2fd08d=_0x2fd08d-0x0;var _0x2897a7=_0x6d82[_0x2fd08d];return _0x2897a7;};'use strict';var _=require(_0x26d8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x26d8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26d8('0x2'));var db=require(_0x26d8('0x3'))['db'];var utils=require(_0x26d8('0x4'));var logger=require(_0x26d8('0x5'))(_0x26d8('0x6'));var config=require(_0x26d8('0x7'));var jayson=require(_0x26d8('0x8'));var client=jayson[_0x26d8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ddd93,_0x4a1691,_0x6e60bb){return new BPromise(function(_0x3df7dc,_0x5a6452){return client[_0x26d8('0xa')](_0x2ddd93,_0x6e60bb)['then'](function(_0x3ff765){logger[_0x26d8('0xb')](_0x26d8('0xc'),_0x4a1691,_0x26d8('0xd'));logger[_0x26d8('0xe')](_0x26d8('0xf'),_0x4a1691,_0x26d8('0xd'),JSON[_0x26d8('0x10')](_0x3ff765));if(_0x3ff765[_0x26d8('0x11')]){if(_0x3ff765[_0x26d8('0x11')][_0x26d8('0x12')]===0x1f4){logger['error'](_0x26d8('0xc'),_0x4a1691,_0x3ff765['error'][_0x26d8('0x13')]);return _0x5a6452(_0x3ff765[_0x26d8('0x11')]['message']);}logger[_0x26d8('0x11')](_0x26d8('0xc'),_0x4a1691,_0x3ff765[_0x26d8('0x11')][_0x26d8('0x13')]);return _0x3df7dc(_0x3ff765['error'][_0x26d8('0x13')]);}else{logger['info'](_0x26d8('0xc'),_0x4a1691,_0x26d8('0xd'));_0x3df7dc(_0x3ff765[_0x26d8('0x14')][_0x26d8('0x13')]);}})[_0x26d8('0x15')](function(_0x4f5f77){logger['error']('CmHopper,\x20%s,\x20%s',_0x4a1691,_0x4f5f77);_0x5a6452(_0x4f5f77);});});}exports[_0x26d8('0x16')]=function(_0x5e0b23){var _0x47e06e=this;return new Promise(function(_0x113270,_0x5f0ff2){return db['CmHopper'][_0x26d8('0x17')]({'raw':_0x5e0b23[_0x26d8('0x18')]?_0x5e0b23[_0x26d8('0x18')][_0x26d8('0x19')]===undefined?!![]:![]:!![],'where':_0x5e0b23[_0x26d8('0x18')]?_0x5e0b23['options'][_0x26d8('0x1a')]||null:null,'attributes':_0x5e0b23[_0x26d8('0x18')]?_0x5e0b23[_0x26d8('0x18')][_0x26d8('0x1b')]||null:null,'limit':_0x5e0b23[_0x26d8('0x18')]?_0x5e0b23[_0x26d8('0x18')][_0x26d8('0x1c')]||null:null,'include':_0x5e0b23[_0x26d8('0x18')]?_0x5e0b23[_0x26d8('0x18')]['include']?_[_0x26d8('0x1d')](_0x5e0b23[_0x26d8('0x18')]['include'],function(_0x489422){return{'model':db[_0x489422[_0x26d8('0x1e')]],'as':_0x489422['as'],'attributes':_0x489422[_0x26d8('0x1b')],'include':_0x489422['include']?_[_0x26d8('0x1d')](_0x489422['include'],function(_0xbb8ba){return{'model':db[_0xbb8ba['model']],'as':_0xbb8ba['as'],'attributes':_0xbb8ba[_0x26d8('0x1b')],'include':_0xbb8ba[_0x26d8('0x1f')]?_[_0x26d8('0x1d')](_0xbb8ba['include'],function(_0x116f21){return{'model':db[_0x116f21[_0x26d8('0x1e')]],'as':_0x116f21['as'],'attributes':_0x116f21[_0x26d8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1397ee){logger['info'](_0x26d8('0x16'),_0x5e0b23);logger['debug'](_0x26d8('0x16'),_0x5e0b23,JSON[_0x26d8('0x10')](_0x1397ee));_0x113270(_0x1397ee);})['catch'](function(_0x17d678){logger['error']('GetCmHopper',_0x17d678[_0x26d8('0x13')],_0x5e0b23);_0x5f0ff2(_0x47e06e[_0x26d8('0x11')](0x1f4,_0x17d678['message']));});});};exports['ShowCmHopper']=function(_0x512156){var _0x133172=this;return new Promise(function(_0x197d5f,_0x42b4af){return db[_0x26d8('0x20')][_0x26d8('0x21')]({'raw':_0x512156[_0x26d8('0x18')]?_0x512156[_0x26d8('0x18')][_0x26d8('0x19')]===undefined?!![]:![]:!![],'where':_0x512156[_0x26d8('0x18')]?_0x512156[_0x26d8('0x18')][_0x26d8('0x1a')]||null:null,'attributes':_0x512156[_0x26d8('0x18')]?_0x512156[_0x26d8('0x18')][_0x26d8('0x1b')]||null:null,'include':_0x512156[_0x26d8('0x18')]?_0x512156[_0x26d8('0x18')][_0x26d8('0x1f')]?_['map'](_0x512156['options'][_0x26d8('0x1f')],function(_0x54469b){return{'model':db[_0x54469b[_0x26d8('0x1e')]],'as':_0x54469b['as'],'attributes':_0x54469b[_0x26d8('0x1b')],'include':_0x54469b[_0x26d8('0x1f')]?_[_0x26d8('0x1d')](_0x54469b[_0x26d8('0x1f')],function(_0x1232a8){return{'model':db[_0x1232a8['model']],'as':_0x1232a8['as'],'attributes':_0x1232a8[_0x26d8('0x1b')],'include':_0x1232a8['include']?_['map'](_0x1232a8['include'],function(_0x2867c6){return{'model':db[_0x2867c6[_0x26d8('0x1e')]],'as':_0x2867c6['as'],'attributes':_0x2867c6[_0x26d8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e076b){logger['info'](_0x26d8('0x22'),_0x512156);logger[_0x26d8('0xe')](_0x26d8('0x22'),_0x512156,JSON[_0x26d8('0x10')](_0x5e076b));_0x197d5f(_0x5e076b);})[_0x26d8('0x15')](function(_0x4e301f){logger[_0x26d8('0x11')]('ShowCmHopper',_0x4e301f[_0x26d8('0x13')],_0x512156);_0x42b4af(_0x133172['error'](0x1f4,_0x4e301f[_0x26d8('0x13')]));});});};exports['CreateCmHopper']=function(_0x245a6b){var _0x13feb6=this;return new Promise(function(_0x5109f7,_0x25da1a){return db[_0x26d8('0x20')][_0x26d8('0x23')](_0x245a6b[_0x26d8('0x24')],{'raw':_0x245a6b['options']?_0x245a6b['options']['raw']===undefined?!![]:![]:!![]})[_0x26d8('0x25')](function(_0x4a9de5){logger[_0x26d8('0xb')](_0x26d8('0x26'),_0x245a6b);logger[_0x26d8('0xe')](_0x26d8('0x26'),_0x245a6b,JSON['stringify'](_0x4a9de5));_0x5109f7(_0x4a9de5);})[_0x26d8('0x15')](function(_0x488fb0){logger[_0x26d8('0x11')](_0x26d8('0x26'),_0x488fb0[_0x26d8('0x13')],_0x245a6b);_0x25da1a(_0x13feb6['error'](0x1f4,_0x488fb0['message']));});});};exports[_0x26d8('0x27')]=function(_0x525884){var _0x5e6788=this;return new Promise(function(_0x5739bd,_0x290da3){return db[_0x26d8('0x20')][_0x26d8('0x28')](_0x525884[_0x26d8('0x24')],{'raw':_0x525884[_0x26d8('0x18')]?_0x525884['options'][_0x26d8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x525884['options']?_0x525884[_0x26d8('0x18')][_0x26d8('0x1a')]||null:null,'attributes':_0x525884[_0x26d8('0x18')]?_0x525884[_0x26d8('0x18')][_0x26d8('0x1b')]||null:null,'limit':_0x525884[_0x26d8('0x18')]?_0x525884['options'][_0x26d8('0x1c')]||null:null})[_0x26d8('0x25')](function(_0x1a112e){logger[_0x26d8('0xb')](_0x26d8('0x27'),_0x525884);logger[_0x26d8('0xe')](_0x26d8('0x27'),_0x525884,JSON[_0x26d8('0x10')](_0x1a112e));_0x5739bd(_0x1a112e);})[_0x26d8('0x15')](function(_0x2f4ef6){logger[_0x26d8('0x11')](_0x26d8('0x27'),_0x2f4ef6[_0x26d8('0x13')],_0x525884);_0x290da3(_0x5e6788[_0x26d8('0x11')](0x1f4,_0x2f4ef6[_0x26d8('0x13')]));});});};exports[_0x26d8('0x29')]=function(_0x320ed8){var _0x4fe6ba=this;return new Promise(function(_0x571859,_0x28714a){return db[_0x26d8('0x20')]['destroy']({'where':_0x320ed8[_0x26d8('0x18')]?_0x320ed8[_0x26d8('0x18')][_0x26d8('0x1a')]||null:null})[_0x26d8('0x25')](function(_0x455944){logger['info'](_0x26d8('0x29'),_0x320ed8);logger[_0x26d8('0xe')](_0x26d8('0x29'),_0x320ed8,JSON[_0x26d8('0x10')](_0x455944));_0x571859(_0x455944);})[_0x26d8('0x15')](function(_0x974267){logger[_0x26d8('0x11')](_0x26d8('0x29'),_0x974267[_0x26d8('0x13')],_0x320ed8);_0x28714a(_0x4fe6ba['error'](0x1f4,_0x974267[_0x26d8('0x13')]));});});};exports[_0x26d8('0x2a')]=function(_0x2e2218){var _0x461338=this;return new Promise(function(_0x2197d1,_0x1a9664){return db[_0x26d8('0x2b')][_0x26d8('0x2c')]()[_0x26d8('0x25')](function(_0x38f59c){return db['sequelize'][_0x26d8('0x2d')](function(_0x4eef6b){return db[_0x26d8('0x20')][_0x26d8('0x17')]({'where':_0x2e2218['options']?_0x2e2218[_0x26d8('0x18')][_0x26d8('0x1a')]||null:null,'attributes':_0x2e2218[_0x26d8('0x18')]?_0x2e2218['options'][_0x26d8('0x1b')]||null:null,'limit':_0x2e2218[_0x26d8('0x18')]?_0x2e2218[_0x26d8('0x18')][_0x26d8('0x1c')]||null:null,'order':_0x2e2218[_0x26d8('0x18')]?_0x2e2218[_0x26d8('0x18')][_0x26d8('0x2e')]||null:null,'transaction':_0x4eef6b,'lock':_0x4eef6b['LOCK'][_0x26d8('0x2f')],'include':[{'model':db[_0x26d8('0x2b')],'as':'Contact','attributes':_['keys'](_0x38f59c)}]})[_0x26d8('0x25')](function(_0x40eac9){var _0x59685f=[];for(var _0x1f14b0=0x0;_0x1f14b0<_0x40eac9[_0x26d8('0x30')];_0x1f14b0+=0x1){_0x59685f['push'](_0x40eac9[_0x1f14b0][_0x26d8('0x28')](_0x2e2218[_0x26d8('0x24')],{'transaction':_0x4eef6b}));}return BPromise[_0x26d8('0x31')](_0x59685f);});})['then'](function(_0xb4230a){logger[_0x26d8('0xb')](_0x26d8('0x2a'),_0x2e2218);logger[_0x26d8('0xe')]('GetContactDialer',_0x2e2218,JSON[_0x26d8('0x10')](_0xb4230a));_0x2197d1(_0xb4230a);})[_0x26d8('0x15')](function(_0x442edf){logger[_0x26d8('0x11')](_0x26d8('0x2a'),_0x442edf[_0x26d8('0x13')],_0x2e2218);_0x1a9664(_0x461338['error'](0x1f4,_0x442edf[_0x26d8('0x13')]));});});});};exports[_0x26d8('0x32')]=function(_0xc22769){var _0x45aa9a=this;return new Promise(function(_0x406c95,_0x531207){return db[_0x26d8('0x33')][_0x26d8('0x2d')](function(_0x27a478){return db[_0x26d8('0x34')][_0x26d8('0x23')](_0xc22769[_0x26d8('0x24')],{'raw':_0xc22769['options']?_0xc22769[_0x26d8('0x18')][_0x26d8('0x19')]===undefined?!![]:![]:!![],'transaction':_0x27a478})[_0x26d8('0x25')](function(){return db['CmHopper']['destroy']({'where':_0xc22769[_0x26d8('0x18')]?_0xc22769['options'][_0x26d8('0x1a')]||null:null,'transaction':_0x27a478});});})[_0x26d8('0x25')](function(_0xf1b315){logger['info'](_0x26d8('0x32'),_0xc22769);logger[_0x26d8('0xe')]('MoveContactManagedDialer',_0xc22769,JSON[_0x26d8('0x10')](_0xf1b315));_0x406c95(_0xf1b315);})[_0x26d8('0x15')](function(_0x2e9961){logger[_0x26d8('0x11')](_0x26d8('0x32'),_0x2e9961[_0x26d8('0x13')],_0xc22769);_0x531207(_0x45aa9a[_0x26d8('0x11')](0x1f4,_0x2e9961[_0x26d8('0x13')]));});});};exports[_0x26d8('0x35')]=function(_0x3e0460){var _0x1b0663=this;return new Promise(function(_0x13414d,_0x409081){return db['CmHopper'][_0x26d8('0x17')]({'raw':_0x3e0460[_0x26d8('0x18')]?_0x3e0460[_0x26d8('0x18')][_0x26d8('0x19')]===undefined?!![]:![]:!![],'where':_0x3e0460[_0x26d8('0x18')]?_0x3e0460[_0x26d8('0x18')][_0x26d8('0x1a')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x26d8('0x33')]['fn']('IF',db['sequelize'][_0x26d8('0x36')](_0x26d8('0x37')+util[_0x26d8('0x38')](_0x26d8('0x39'),moment()[_0x26d8('0x38')](_0x26d8('0x3a')))+_0x26d8('0x3b')))),_0x26d8('0x3c')]]})[_0x26d8('0x25')](function(_0x57eb18){logger[_0x26d8('0xb')](_0x26d8('0x35'),_0x3e0460);logger[_0x26d8('0xe')](_0x26d8('0x35'),_0x3e0460,JSON['stringify'](_0x57eb18));_0x13414d(_0x57eb18);})[_0x26d8('0x15')](function(_0x24d2d5){logger[_0x26d8('0x11')](_0x26d8('0x35'),_0x24d2d5['message'],_0x3e0460);_0x409081(_0x1b0663[_0x26d8('0x11')](0x1f4,_0x24d2d5['message']));});});};exports[_0x26d8('0x3d')]=function(_0x467421){var _0x6aaad3=this;return new Promise(function(_0x16c576,_0x3ced6e){return db['CmContact'][_0x26d8('0x2c')]()[_0x26d8('0x25')](function(_0x5b4ff1){return db[_0x26d8('0x33')]['transaction'](function(_0x1638c2){return db[_0x26d8('0x20')][_0x26d8('0x17')]({'where':_0x467421['options']?_0x467421[_0x26d8('0x18')][_0x26d8('0x1a')]||null:null,'attributes':_0x467421[_0x26d8('0x18')]?_0x467421['options'][_0x26d8('0x1b')]||null:null,'limit':0x1,'order':_0x467421[_0x26d8('0x18')]?_0x467421[_0x26d8('0x18')][_0x26d8('0x2e')]||null:null,'group':db[_0x26d8('0x20')][_0x26d8('0x3e')],'transaction':_0x1638c2,'lock':_0x1638c2['LOCK'][_0x26d8('0x2f')],'include':_0x467421[_0x26d8('0x18')]?_0x467421[_0x26d8('0x18')][_0x26d8('0x1f')]?_['map'](_0x467421[_0x26d8('0x18')][_0x26d8('0x1f')],function(_0x4d76a2){return{'model':db[_0x4d76a2[_0x26d8('0x1e')]],'as':_0x4d76a2['as'],'attributes':_0x4d76a2[_0x26d8('0x1b')],'include':_0x4d76a2[_0x26d8('0x1f')]?_[_0x26d8('0x1d')](_0x4d76a2[_0x26d8('0x1f')],function(_0x5b127b){return{'model':db[_0x5b127b[_0x26d8('0x1e')]],'as':_0x5b127b['as'],'attributes':_0x5b127b['attributes'],'include':_0x5b127b[_0x26d8('0x1f')]?_['map'](_0x5b127b[_0x26d8('0x1f')],function(_0x440d03){return{'model':db[_0x440d03[_0x26d8('0x1e')]],'as':_0x440d03['as'],'attributes':_0x440d03[_0x26d8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x26d8('0x25')](function(_0x1b94cd){var _0x4bc5a5=[];for(var _0x342eb5=0x0;_0x342eb5<_0x1b94cd[_0x26d8('0x30')];_0x342eb5+=0x1){_0x4bc5a5[_0x26d8('0x3f')](_0x1b94cd[_0x342eb5][_0x26d8('0x28')](_0x467421[_0x26d8('0x24')],{'transaction':_0x1638c2}));}return BPromise[_0x26d8('0x31')](_0x4bc5a5);});})['then'](function(_0xb8a073){logger[_0x26d8('0xb')](_0x26d8('0x3d'),_0x467421);logger[_0x26d8('0xe')](_0x26d8('0x3d'),_0x467421,JSON[_0x26d8('0x10')](_0xb8a073));_0x16c576(_0xb8a073);})['catch'](function(_0x471db6){logger[_0x26d8('0x11')](_0x26d8('0x3d'),_0x471db6['message'],_0x467421);_0x3ced6e(_0x6aaad3['error'](0x1f4,_0x471db6[_0x26d8('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 91dc9a2..6f084f0 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 _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x14c5c6,_0x43f2ce){var _0x2b5951=function(_0x3027bc){while(--_0x3027bc){_0x14c5c6['push'](_0x14c5c6['shift']());}};_0x2b5951(++_0x43f2ce);}(_0x7a54,0x106));var _0x47a5=function(_0x732f4d,_0x3d6e1c){_0x732f4d=_0x732f4d-0x0;var _0x495511=_0x7a54[_0x732f4d];return _0x495511;};'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 auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file +var _0x9957=['/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopper.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0x11'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x15')](_0x7995('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 3b848c3..92d6553 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 _0xbfcf=['INTEGER','contactListQueue','sequelize','STRING'];(function(_0x582442,_0x26364d){var _0x11c3dc=function(_0x22df5d){while(--_0x22df5d){_0x582442['push'](_0x582442['shift']());}};_0x11c3dc(++_0x26364d);}(_0xbfcf,0x16e));var _0xfbfc=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0xbfcf[_0x2e0443];return _0x52d450;};'use strict';var moment=require('moment');var Sequelize=require(_0xfbfc('0x0'));module['exports']={'phone':{'type':Sequelize[_0xfbfc('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xfbfc('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xfbfc('0x2')],'unique':_0xfbfc('0x3')},'VoiceQueueId':{'type':Sequelize[_0xfbfc('0x2')],'unique':_0xfbfc('0x3')}}; \ No newline at end of file +var _0xc89b=['sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x319f3d,_0x10792b){var _0x1963c7=function(_0x504679){while(--_0x504679){_0x319f3d['push'](_0x319f3d['shift']());}};_0x1963c7(++_0x10792b);}(_0xc89b,0xc3));var _0xbc89=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xc89b[_0x487b0c];return _0x1adbdc;};'use strict';var moment=require('moment');var Sequelize=require(_0xbc89('0x0'));module[_0xbc89('0x1')]={'phone':{'type':Sequelize[_0xbc89('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xbc89('0x3')],'unique':_0xbc89('0x4')},'ListId':{'type':Sequelize[_0xbc89('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xbc89('0x3')],'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 d2cd829..dbb32bd 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 _0x837e=['name','send','index','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','type','key','merge','CmHopperBlack','includeAll','include','findAll','catch','show','params','rawAttributes','options','body','find','html-pdf','eml-format','request-promise','bluebird','util','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','end','stack'];(function(_0x5315fc,_0x49dfc7){var _0x2c81dc=function(_0x5bd221){while(--_0x5bd221){_0x5315fc['push'](_0x5315fc['shift']());}};_0x2c81dc(++_0x49dfc7);}(_0x837e,0xa6));var _0xe837=function(_0x59cc70,_0x15ad30){_0x59cc70=_0x59cc70-0x0;var _0x4324ff=_0x837e[_0x59cc70];return _0x4324ff;};'use strict';var pdf=require(_0xe837('0x0'));var emlformat=require(_0xe837('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe837('0x2'));var moment=require('moment');var BPromise=require(_0xe837('0x3'));var Mustache=require('mustache');var util=require(_0xe837('0x4'));var path=require('path');var sox=require(_0xe837('0x5'));var csv=require(_0xe837('0x6'));var ejs=require(_0xe837('0x7'));var fs=require('fs');var _=require(_0xe837('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe837('0x9'));var toCsv=require('to-csv');var querystring=require(_0xe837('0xa'));var Papa=require(_0xe837('0xb'));var authService=require(_0xe837('0xc'));var hardwareService=require(_0xe837('0xd'));var Redis=require(_0xe837('0xe'));var qs=require(_0xe837('0xf'));var logger=require('../../config/logger')(_0xe837('0x10'));var utils=require(_0xe837('0x11'));var config=require(_0xe837('0x12'));var db=require(_0xe837('0x13'))['db'];function respondWithStatusCode(_0x40bd92,_0x574edd){_0x574edd=_0x574edd||0xcc;return function(_0x4b2331){if(_0x4b2331){return _0x40bd92[_0xe837('0x14')](_0x574edd);}return _0x40bd92['status'](_0x574edd)['end']();};}function respondWithResult(_0x1c1711,_0x5f4138){_0x5f4138=_0x5f4138||0xc8;return function(_0x171bb2){if(_0x171bb2){return _0x1c1711[_0xe837('0x15')](_0x5f4138)['json'](_0x171bb2);}};}function respondWithFilteredResult(_0x16352a,_0x48e9aa){return function(_0x5b092f){if(_0x5b092f){var _0x39f103=_0x5b092f[_0xe837('0x16')],_0x5b30b2=_0x48e9aa[_0xe837('0x17')],_0x372236=_0x48e9aa[_0xe837('0x17')]+_0x48e9aa[_0xe837('0x18')],_0x200a10;if(_0x372236>=_0x39f103){_0x372236=_0x39f103;_0x200a10=0xc8;}else{_0x200a10=0xce;}_0x16352a[_0xe837('0x15')](_0x200a10);return _0x16352a[_0xe837('0x19')](_0xe837('0x1a'),_0x5b30b2+'-'+_0x372236+'/'+_0x39f103)[_0xe837('0x1b')](_0x5b092f);}return null;};}function patchUpdates(_0x18e802){return function(_0x363262){try{jsonpatch[_0xe837('0x1c')](_0x363262,_0x18e802,!![]);}catch(_0x3a8e05){return BPromise[_0xe837('0x1d')](_0x3a8e05);}return _0x363262['save']();};}function saveUpdates(_0x3ac4c8,_0x346b2b){return function(_0x50879b){if(_0x50879b){return _0x50879b[_0xe837('0x1e')](_0x3ac4c8)['then'](function(_0x3d84b4){return _0x3d84b4;});}return null;};}function removeEntity(_0x2f82c3,_0x865c6a){return function(_0x5d174b){if(_0x5d174b){return _0x5d174b[_0xe837('0x1f')]()[_0xe837('0x20')](function(){_0x2f82c3[_0xe837('0x15')](0xcc)[_0xe837('0x21')]();});}};}function handleEntityNotFound(_0x4a7160,_0x393cb1){return function(_0x58abd6){if(!_0x58abd6){_0x4a7160[_0xe837('0x14')](0x194);}return _0x58abd6;};}function handleError(_0x274634,_0x416c1f){_0x416c1f=_0x416c1f||0x1f4;return function(_0x5b1bda){logger['error'](_0x5b1bda[_0xe837('0x22')]);if(_0x5b1bda[_0xe837('0x23')]){delete _0x5b1bda[_0xe837('0x23')];}_0x274634['status'](_0x416c1f)[_0xe837('0x24')](_0x5b1bda);};}exports[_0xe837('0x25')]=function(_0x254781,_0x362b6a){var _0x5c56a2={},_0xf95db6={},_0x1a1674={'count':0x0,'rows':[]};var _0x334902=db['CmHopperBlack']['rawAttributes'];_0xf95db6['model']=_['keys'](_0x334902);_0xf95db6['query']=_[_0xe837('0x26')](_0x254781['query']);_0xf95db6[_0xe837('0x27')]=_[_0xe837('0x28')](_0xf95db6[_0xe837('0x29')],_0xf95db6[_0xe837('0x2a')]);_0x5c56a2[_0xe837('0x2b')]=_[_0xe837('0x28')](_0xf95db6['model'],qs[_0xe837('0x2c')](_0x254781[_0xe837('0x2a')]['fields']));_0x5c56a2[_0xe837('0x2b')]=_0x5c56a2[_0xe837('0x2b')][_0xe837('0x2d')]?_0x5c56a2[_0xe837('0x2b')]:_0xf95db6[_0xe837('0x29')];if(!_0x254781['query']['hasOwnProperty'](_0xe837('0x2e'))){_0x5c56a2[_0xe837('0x18')]=qs['limit'](_0x254781[_0xe837('0x2a')][_0xe837('0x18')]);_0x5c56a2[_0xe837('0x17')]=qs[_0xe837('0x17')](_0x254781['query'][_0xe837('0x17')]);}_0x5c56a2[_0xe837('0x2f')]=qs[_0xe837('0x30')](_0x254781[_0xe837('0x2a')][_0xe837('0x30')]);_0x5c56a2[_0xe837('0x31')]=qs[_0xe837('0x27')](_[_0xe837('0x32')](_0x254781['query'],_0xf95db6['filters']));if(_0x254781[_0xe837('0x2a')][_0xe837('0x33')]){_0x5c56a2[_0xe837('0x31')]=_['merge'](_0x5c56a2[_0xe837('0x31')],{'$or':_[_0xe837('0x34')](_0x334902,function(_0x53d82e){if(_0x53d82e[_0xe837('0x35')][_0xe837('0x36')]!=='VIRTUAL'){var _0x36245c={};_0x36245c[_0x53d82e['field']]={'$like':'%'+_0x254781[_0xe837('0x2a')]['filter']+'%'};return _0x36245c;}})});}_0x5c56a2=_[_0xe837('0x37')]({},_0x5c56a2,_0x254781['options']);var _0x5cc16b={'where':_0x5c56a2[_0xe837('0x31')]};return db[_0xe837('0x38')][_0xe837('0x16')](_0x5cc16b)[_0xe837('0x20')](function(_0x397eb5){_0x1a1674['count']=_0x397eb5;if(_0x254781[_0xe837('0x2a')][_0xe837('0x39')]){_0x5c56a2[_0xe837('0x3a')]=[{'all':!![]}];}return db[_0xe837('0x38')][_0xe837('0x3b')](_0x5c56a2);})[_0xe837('0x20')](function(_0x1e41c6){_0x1a1674['rows']=_0x1e41c6;return _0x1a1674;})[_0xe837('0x20')](respondWithFilteredResult(_0x362b6a,_0x5c56a2))[_0xe837('0x3c')](handleError(_0x362b6a,null));};exports[_0xe837('0x3d')]=function(_0x19383f,_0xd83106){var _0x5736d4={'raw':!![],'where':{'id':_0x19383f[_0xe837('0x3e')]['id']}},_0x3ee592={};_0x3ee592[_0xe837('0x29')]=_[_0xe837('0x26')](db[_0xe837('0x38')][_0xe837('0x3f')]);_0x3ee592['query']=_[_0xe837('0x26')](_0x19383f[_0xe837('0x2a')]);_0x3ee592[_0xe837('0x27')]=_[_0xe837('0x28')](_0x3ee592[_0xe837('0x29')],_0x3ee592[_0xe837('0x2a')]);_0x5736d4['attributes']=_['intersection'](_0x3ee592[_0xe837('0x29')],qs[_0xe837('0x2c')](_0x19383f[_0xe837('0x2a')]['fields']));_0x5736d4[_0xe837('0x2b')]=_0x5736d4[_0xe837('0x2b')][_0xe837('0x2d')]?_0x5736d4[_0xe837('0x2b')]:_0x3ee592[_0xe837('0x29')];if(_0x19383f['query']['includeAll']){_0x5736d4[_0xe837('0x3a')]=[{'all':!![]}];}_0x5736d4=_[_0xe837('0x37')]({},_0x5736d4,_0x19383f[_0xe837('0x40')]);return db[_0xe837('0x38')]['find'](_0x5736d4)[_0xe837('0x20')](handleEntityNotFound(_0xd83106,null))[_0xe837('0x20')](respondWithResult(_0xd83106,null))[_0xe837('0x3c')](handleError(_0xd83106,null));};exports[_0xe837('0x1e')]=function(_0x3696bd,_0x603390){if(_0x3696bd[_0xe837('0x41')]['id']){delete _0x3696bd[_0xe837('0x41')]['id'];}return db[_0xe837('0x38')]['find']({'where':{'id':_0x3696bd[_0xe837('0x3e')]['id']}})[_0xe837('0x20')](handleEntityNotFound(_0x603390,null))[_0xe837('0x20')](saveUpdates(_0x3696bd[_0xe837('0x41')],null))['then'](respondWithResult(_0x603390,null))[_0xe837('0x3c')](handleError(_0x603390,null));};exports[_0xe837('0x1f')]=function(_0x54e8a9,_0x9501c7){return db[_0xe837('0x38')][_0xe837('0x42')]({'where':{'id':_0x54e8a9[_0xe837('0x3e')]['id']}})['then'](handleEntityNotFound(_0x9501c7,null))[_0xe837('0x20')](removeEntity(_0x9501c7,null))[_0xe837('0x3c')](handleError(_0x9501c7,null));};exports['describe']=function(_0x5ec3bc,_0xcf6180){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0xcf6180,null))[_0xe837('0x3c')](handleError(_0xcf6180,null));}; \ No newline at end of file +var _0xcd41=['type','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','find','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map'];(function(_0x58df80,_0x7e4905){var _0x2cfe28=function(_0x2ea466){while(--_0x2ea466){_0x58df80['push'](_0x58df80['shift']());}};_0x2cfe28(++_0x7e4905);}(_0xcd41,0x12d));var _0x1cd4=function(_0x3fde67,_0x4ba3fa){_0x3fde67=_0x3fde67-0x0;var _0x2c51a0=_0xcd41[_0x3fde67];return _0x2c51a0;};'use strict';var pdf=require(_0x1cd4('0x0'));var emlformat=require(_0x1cd4('0x1'));var rimraf=require(_0x1cd4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1cd4('0x3'));var moment=require('moment');var BPromise=require(_0x1cd4('0x4'));var Mustache=require(_0x1cd4('0x5'));var util=require(_0x1cd4('0x6'));var path=require(_0x1cd4('0x7'));var sox=require(_0x1cd4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1cd4('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1cd4('0xa'));var deskjs=require(_0x1cd4('0xb'));var toCsv=require(_0x1cd4('0xc'));var querystring=require(_0x1cd4('0xd'));var Papa=require(_0x1cd4('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0x1cd4('0xf'));var Redis=require('ioredis');var qs=require(_0x1cd4('0x10'));var logger=require('../../config/logger')(_0x1cd4('0x11'));var utils=require(_0x1cd4('0x12'));var config=require(_0x1cd4('0x13'));var db=require(_0x1cd4('0x14'))['db'];function respondWithStatusCode(_0x31591c,_0x2788ae){_0x2788ae=_0x2788ae||0xcc;return function(_0x327e5f){if(_0x327e5f){return _0x31591c['sendStatus'](_0x2788ae);}return _0x31591c[_0x1cd4('0x15')](_0x2788ae)[_0x1cd4('0x16')]();};}function respondWithResult(_0xe1d9e,_0x41e592){_0x41e592=_0x41e592||0xc8;return function(_0x52fbb2){if(_0x52fbb2){return _0xe1d9e[_0x1cd4('0x15')](_0x41e592)[_0x1cd4('0x17')](_0x52fbb2);}};}function respondWithFilteredResult(_0x106373,_0x4f9425){return function(_0x19e6b8){if(_0x19e6b8){var _0x5d8aeb=_0x19e6b8[_0x1cd4('0x18')],_0x30baca=_0x4f9425[_0x1cd4('0x19')],_0x5498b3=_0x4f9425[_0x1cd4('0x19')]+_0x4f9425[_0x1cd4('0x1a')],_0x25fc2c;if(_0x5498b3>=_0x5d8aeb){_0x5498b3=_0x5d8aeb;_0x25fc2c=0xc8;}else{_0x25fc2c=0xce;}_0x106373['status'](_0x25fc2c);return _0x106373[_0x1cd4('0x1b')](_0x1cd4('0x1c'),_0x30baca+'-'+_0x5498b3+'/'+_0x5d8aeb)['json'](_0x19e6b8);}return null;};}function patchUpdates(_0x54d3b5){return function(_0x3aaa16){try{jsonpatch[_0x1cd4('0x1d')](_0x3aaa16,_0x54d3b5,!![]);}catch(_0x4250c6){return BPromise[_0x1cd4('0x1e')](_0x4250c6);}return _0x3aaa16[_0x1cd4('0x1f')]();};}function saveUpdates(_0x565f6c,_0x4db661){return function(_0x24f62e){if(_0x24f62e){return _0x24f62e[_0x1cd4('0x20')](_0x565f6c)[_0x1cd4('0x21')](function(_0xf53a83){return _0xf53a83;});}return null;};}function removeEntity(_0x5f2b2e,_0x1d7bff){return function(_0x4643cf){if(_0x4643cf){return _0x4643cf['destroy']()['then'](function(){_0x5f2b2e[_0x1cd4('0x15')](0xcc)[_0x1cd4('0x16')]();});}};}function handleEntityNotFound(_0x504c71,_0x342718){return function(_0x454512){if(!_0x454512){_0x504c71[_0x1cd4('0x22')](0x194);}return _0x454512;};}function handleError(_0x52c287,_0x377aad){_0x377aad=_0x377aad||0x1f4;return function(_0x231fe6){logger[_0x1cd4('0x23')](_0x231fe6[_0x1cd4('0x24')]);if(_0x231fe6[_0x1cd4('0x25')]){delete _0x231fe6[_0x1cd4('0x25')];}_0x52c287['status'](_0x377aad)[_0x1cd4('0x26')](_0x231fe6);};}exports[_0x1cd4('0x27')]=function(_0x1422e7,_0x4bab58){var _0x22e647={},_0x53538a={},_0x57098a={'count':0x0,'rows':[]};var _0x5eb8cb=db[_0x1cd4('0x28')][_0x1cd4('0x29')];_0x53538a[_0x1cd4('0x2a')]=_[_0x1cd4('0x2b')](_0x5eb8cb);_0x53538a['query']=_[_0x1cd4('0x2b')](_0x1422e7[_0x1cd4('0x2c')]);_0x53538a['filters']=_[_0x1cd4('0x2d')](_0x53538a['model'],_0x53538a[_0x1cd4('0x2c')]);_0x22e647['attributes']=_[_0x1cd4('0x2d')](_0x53538a['model'],qs[_0x1cd4('0x2e')](_0x1422e7[_0x1cd4('0x2c')]['fields']));_0x22e647[_0x1cd4('0x2f')]=_0x22e647[_0x1cd4('0x2f')][_0x1cd4('0x30')]?_0x22e647[_0x1cd4('0x2f')]:_0x53538a[_0x1cd4('0x2a')];if(!_0x1422e7['query'][_0x1cd4('0x31')](_0x1cd4('0x32'))){_0x22e647[_0x1cd4('0x1a')]=qs[_0x1cd4('0x1a')](_0x1422e7[_0x1cd4('0x2c')]['limit']);_0x22e647[_0x1cd4('0x19')]=qs['offset'](_0x1422e7[_0x1cd4('0x2c')]['offset']);}_0x22e647[_0x1cd4('0x33')]=qs[_0x1cd4('0x34')](_0x1422e7['query'][_0x1cd4('0x34')]);_0x22e647[_0x1cd4('0x35')]=qs[_0x1cd4('0x36')](_[_0x1cd4('0x37')](_0x1422e7[_0x1cd4('0x2c')],_0x53538a[_0x1cd4('0x36')]));if(_0x1422e7[_0x1cd4('0x2c')][_0x1cd4('0x38')]){_0x22e647['where']=_[_0x1cd4('0x39')](_0x22e647[_0x1cd4('0x35')],{'$or':_[_0x1cd4('0x3a')](_0x5eb8cb,function(_0x16c253){if(_0x16c253[_0x1cd4('0x3b')]['key']!==_0x1cd4('0x3c')){var _0x58e4a1={};_0x58e4a1[_0x16c253[_0x1cd4('0x3d')]]={'$like':'%'+_0x1422e7['query'][_0x1cd4('0x38')]+'%'};return _0x58e4a1;}})});}_0x22e647=_[_0x1cd4('0x39')]({},_0x22e647,_0x1422e7[_0x1cd4('0x3e')]);var _0x1c3e66={'where':_0x22e647[_0x1cd4('0x35')]};return db[_0x1cd4('0x28')][_0x1cd4('0x18')](_0x1c3e66)['then'](function(_0x472f70){_0x57098a[_0x1cd4('0x18')]=_0x472f70;if(_0x1422e7[_0x1cd4('0x2c')][_0x1cd4('0x3f')]){_0x22e647[_0x1cd4('0x40')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x22e647);})[_0x1cd4('0x21')](function(_0x1cddf6){_0x57098a[_0x1cd4('0x41')]=_0x1cddf6;return _0x57098a;})[_0x1cd4('0x21')](respondWithFilteredResult(_0x4bab58,_0x22e647))[_0x1cd4('0x42')](handleError(_0x4bab58,null));};exports[_0x1cd4('0x43')]=function(_0x322cf5,_0x48417c){var _0x5a79cf={'raw':!![],'where':{'id':_0x322cf5[_0x1cd4('0x44')]['id']}},_0x449701={};_0x449701[_0x1cd4('0x2a')]=_[_0x1cd4('0x2b')](db[_0x1cd4('0x28')][_0x1cd4('0x29')]);_0x449701[_0x1cd4('0x2c')]=_[_0x1cd4('0x2b')](_0x322cf5[_0x1cd4('0x2c')]);_0x449701['filters']=_[_0x1cd4('0x2d')](_0x449701['model'],_0x449701['query']);_0x5a79cf[_0x1cd4('0x2f')]=_[_0x1cd4('0x2d')](_0x449701[_0x1cd4('0x2a')],qs[_0x1cd4('0x2e')](_0x322cf5['query'][_0x1cd4('0x2e')]));_0x5a79cf[_0x1cd4('0x2f')]=_0x5a79cf['attributes'][_0x1cd4('0x30')]?_0x5a79cf['attributes']:_0x449701['model'];if(_0x322cf5[_0x1cd4('0x2c')]['includeAll']){_0x5a79cf[_0x1cd4('0x40')]=[{'all':!![]}];}_0x5a79cf=_['merge']({},_0x5a79cf,_0x322cf5[_0x1cd4('0x3e')]);return db[_0x1cd4('0x28')][_0x1cd4('0x45')](_0x5a79cf)[_0x1cd4('0x21')](handleEntityNotFound(_0x48417c,null))[_0x1cd4('0x21')](respondWithResult(_0x48417c,null))[_0x1cd4('0x42')](handleError(_0x48417c,null));};exports['update']=function(_0x25ef8a,_0x216df7){if(_0x25ef8a['body']['id']){delete _0x25ef8a['body']['id'];}return db[_0x1cd4('0x28')]['find']({'where':{'id':_0x25ef8a[_0x1cd4('0x44')]['id']}})[_0x1cd4('0x21')](handleEntityNotFound(_0x216df7,null))[_0x1cd4('0x21')](saveUpdates(_0x25ef8a['body'],null))['then'](respondWithResult(_0x216df7,null))[_0x1cd4('0x42')](handleError(_0x216df7,null));};exports[_0x1cd4('0x46')]=function(_0x57e1f2,_0x40c61f){return db[_0x1cd4('0x28')][_0x1cd4('0x45')]({'where':{'id':_0x57e1f2[_0x1cd4('0x44')]['id']}})[_0x1cd4('0x21')](handleEntityNotFound(_0x40c61f,null))[_0x1cd4('0x21')](removeEntity(_0x40c61f,null))[_0x1cd4('0x42')](handleError(_0x40c61f,null));};exports[_0x1cd4('0x47')]=function(_0x5ed66c,_0x55743b){return db[_0x1cd4('0x28')]['describe']()[_0x1cd4('0x21')](respondWithResult(_0x55743b,null))[_0x1cd4('0x42')](handleError(_0x55743b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 687410e..2d81329 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 _0xc646=['request-promise','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','bluebird'];(function(_0x594e88,_0x442655){var _0x518fa8=function(_0x49a3db){while(--_0x49a3db){_0x594e88['push'](_0x594e88['shift']());}};_0x518fa8(++_0x442655);}(_0xc646,0x68));var _0x6c64=function(_0x3c3e72,_0x3e1858){_0x3c3e72=_0x3c3e72-0x0;var _0x48a7e5=_0xc646[_0x3c3e72];return _0x48a7e5;};'use strict';var _=require(_0x6c64('0x0'));var util=require(_0x6c64('0x1'));var logger=require(_0x6c64('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c64('0x3'));var rp=require(_0x6c64('0x4'));var attributes=require(_0x6c64('0x5'));module['exports']=function(_0x3dcfbf,_0x3039e2){return _0x3dcfbf[_0x6c64('0x6')](_0x6c64('0x7'),attributes,{'tableName':_0x6c64('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ad3=['lodash','util','../../config/logger','api','bluebird','./cmHopperBlack.attributes','exports','define','CmHopperBlack'];(function(_0x586115,_0x283bd2){var _0x221bac=function(_0x2f1aed){while(--_0x2f1aed){_0x586115['push'](_0x586115['shift']());}};_0x221bac(++_0x283bd2);}(_0x8ad3,0xe1));var _0x38ad=function(_0x57be2f,_0x221c1a){_0x57be2f=_0x57be2f-0x0;var _0x1a4eaa=_0x8ad3[_0x57be2f];return _0x1a4eaa;};'use strict';var _=require(_0x38ad('0x0'));var util=require(_0x38ad('0x1'));var logger=require(_0x38ad('0x2'))(_0x38ad('0x3'));var moment=require('moment');var BPromise=require(_0x38ad('0x4'));var rp=require('request-promise');var attributes=require(_0x38ad('0x5'));module[_0x38ad('0x6')]=function(_0x5dfc84,_0x5996db){return _0x5dfc84[_0x38ad('0x7')](_0x38ad('0x8'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index a48aacb..b3af251 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 _0x4b1f=['DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','include','model','GetCmHopperBlack','debug','UpdateCmHopperBlack','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b1f,0xe0));var _0xf4b1=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x4b1f[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var moment=require(_0xf4b1('0x2'));var BPromise=require('bluebird');var rs=require(_0xf4b1('0x3'));var fs=require('fs');var Redis=require(_0xf4b1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4b1('0x5'));var logger=require(_0xf4b1('0x6'))(_0xf4b1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf4b1('0x8')][_0xf4b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x225700,_0x3f7ea5,_0xee8c4a){return new BPromise(function(_0x3e8beb,_0x44e37d){return client[_0xf4b1('0xa')](_0x225700,_0xee8c4a)[_0xf4b1('0xb')](function(_0x7ebdc9){logger[_0xf4b1('0xc')](_0xf4b1('0xd'),_0x3f7ea5,_0xf4b1('0xe'));logger['debug'](_0xf4b1('0xf'),_0x3f7ea5,_0xf4b1('0xe'),JSON[_0xf4b1('0x10')](_0x7ebdc9));if(_0x7ebdc9[_0xf4b1('0x11')]){if(_0x7ebdc9[_0xf4b1('0x11')]['code']===0x1f4){logger['error'](_0xf4b1('0xd'),_0x3f7ea5,_0x7ebdc9['error'][_0xf4b1('0x12')]);return _0x44e37d(_0x7ebdc9[_0xf4b1('0x11')][_0xf4b1('0x12')]);}logger[_0xf4b1('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x3f7ea5,_0x7ebdc9['error'][_0xf4b1('0x12')]);return _0x3e8beb(_0x7ebdc9[_0xf4b1('0x11')]['message']);}else{logger['info'](_0xf4b1('0xd'),_0x3f7ea5,_0xf4b1('0xe'));_0x3e8beb(_0x7ebdc9[_0xf4b1('0x13')][_0xf4b1('0x12')]);}})[_0xf4b1('0x14')](function(_0x3da344){logger[_0xf4b1('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x3f7ea5,_0x3da344);_0x44e37d(_0x3da344);});});}exports['GetCmHopperBlack']=function(_0x36a910){var _0x2d50f3=this;return new Promise(function(_0x39b004,_0x344cde){return db[_0xf4b1('0x15')][_0xf4b1('0x16')]({'raw':_0x36a910[_0xf4b1('0x17')]?_0x36a910[_0xf4b1('0x17')][_0xf4b1('0x18')]===undefined?!![]:![]:!![],'where':_0x36a910[_0xf4b1('0x17')]?_0x36a910[_0xf4b1('0x17')][_0xf4b1('0x19')]||null:null,'attributes':_0x36a910[_0xf4b1('0x17')]?_0x36a910[_0xf4b1('0x17')][_0xf4b1('0x1a')]||null:null,'limit':_0x36a910[_0xf4b1('0x17')]?_0x36a910[_0xf4b1('0x17')][_0xf4b1('0x1b')]||null:null,'include':_0x36a910[_0xf4b1('0x17')]?_0x36a910['options']['include']?_[_0xf4b1('0x1c')](_0x36a910[_0xf4b1('0x17')][_0xf4b1('0x1d')],function(_0x10b576){return{'model':db[_0x10b576[_0xf4b1('0x1e')]],'as':_0x10b576['as'],'attributes':_0x10b576[_0xf4b1('0x1a')],'include':_0x10b576['include']?_[_0xf4b1('0x1c')](_0x10b576[_0xf4b1('0x1d')],function(_0x1cec7e){return{'model':db[_0x1cec7e[_0xf4b1('0x1e')]],'as':_0x1cec7e['as'],'attributes':_0x1cec7e[_0xf4b1('0x1a')],'include':_0x1cec7e[_0xf4b1('0x1d')]?_[_0xf4b1('0x1c')](_0x1cec7e['include'],function(_0x578e89){return{'model':db[_0x578e89['model']],'as':_0x578e89['as'],'attributes':_0x578e89[_0xf4b1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf4b1('0xb')](function(_0x58cece){logger[_0xf4b1('0xc')](_0xf4b1('0x1f'),_0x36a910);logger[_0xf4b1('0x20')](_0xf4b1('0x1f'),_0x36a910,JSON[_0xf4b1('0x10')](_0x58cece));_0x39b004(_0x58cece);})[_0xf4b1('0x14')](function(_0x344e99){logger[_0xf4b1('0x11')]('GetCmHopperBlack',_0x344e99['message'],_0x36a910);_0x344cde(_0x2d50f3[_0xf4b1('0x11')](0x1f4,_0x344e99[_0xf4b1('0x12')]));});});};exports[_0xf4b1('0x21')]=function(_0xfddea1){var _0xaf0f2a=this;return new Promise(function(_0x30dab3,_0x1a2097){return db[_0xf4b1('0x15')]['update'](_0xfddea1[_0xf4b1('0x22')],{'raw':_0xfddea1[_0xf4b1('0x17')]?_0xfddea1[_0xf4b1('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfddea1['options']?_0xfddea1[_0xf4b1('0x17')][_0xf4b1('0x19')]||null:null,'attributes':_0xfddea1[_0xf4b1('0x17')]?_0xfddea1[_0xf4b1('0x17')]['attributes']||null:null,'limit':_0xfddea1['options']?_0xfddea1[_0xf4b1('0x17')][_0xf4b1('0x1b')]||null:null})[_0xf4b1('0xb')](function(_0x1321f6){logger[_0xf4b1('0xc')]('UpdateCmHopperBlack',_0xfddea1);logger[_0xf4b1('0x20')]('UpdateCmHopperBlack',_0xfddea1,JSON[_0xf4b1('0x10')](_0x1321f6));_0x30dab3(_0x1321f6);})[_0xf4b1('0x14')](function(_0x1eb2f0){logger[_0xf4b1('0x11')](_0xf4b1('0x21'),_0x1eb2f0[_0xf4b1('0x12')],_0xfddea1);_0x1a2097(_0xaf0f2a[_0xf4b1('0x11')](0x1f4,_0x1eb2f0[_0xf4b1('0x12')]));});});};exports[_0xf4b1('0x23')]=function(_0x584b53){var _0x347782=this;return new Promise(function(_0x557d1a,_0x4bfa17){return db[_0xf4b1('0x15')][_0xf4b1('0x24')]({'where':_0x584b53[_0xf4b1('0x17')]?_0x584b53['options'][_0xf4b1('0x19')]||null:null})[_0xf4b1('0xb')](function(_0x302547){logger['info'](_0xf4b1('0x23'),_0x584b53);logger[_0xf4b1('0x20')](_0xf4b1('0x23'),_0x584b53,JSON[_0xf4b1('0x10')](_0x302547));_0x557d1a(_0x302547);})[_0xf4b1('0x14')](function(_0x35f4aa){logger[_0xf4b1('0x11')](_0xf4b1('0x23'),_0x35f4aa[_0xf4b1('0x12')],_0x584b53);_0x4bfa17(_0x347782[_0xf4b1('0x11')](0x1f4,_0x35f4aa[_0xf4b1('0x12')]));});});}; \ No newline at end of file +var _0x37a1=['request\x20sent','stringify','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','attributes','limit','include','map','model','then','UpdateCmHopperBlack','CmHopperBlack','update','body','where','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x5e8c38,_0x455b27){var _0x456a71=function(_0x174d86){while(--_0x174d86){_0x5e8c38['push'](_0x5e8c38['shift']());}};_0x456a71(++_0x455b27);}(_0x37a1,0xdb));var _0x137a=function(_0x99398f,_0x3d299e){_0x99398f=_0x99398f-0x0;var _0x4fbe2f=_0x37a1[_0x99398f];return _0x4fbe2f;};'use strict';var _=require('lodash');var util=require(_0x137a('0x0'));var moment=require(_0x137a('0x1'));var BPromise=require(_0x137a('0x2'));var rs=require(_0x137a('0x3'));var fs=require('fs');var Redis=require(_0x137a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x137a('0x5'))('rpc');var config=require(_0x137a('0x6'));var jayson=require(_0x137a('0x7'));var client=jayson[_0x137a('0x8')][_0x137a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x509db4,_0x3d4c96,_0x21031d){return new BPromise(function(_0x542335,_0x4ded11){return client[_0x137a('0xa')](_0x509db4,_0x21031d)['then'](function(_0xa96c64){logger[_0x137a('0xb')](_0x137a('0xc'),_0x3d4c96,'request\x20sent');logger[_0x137a('0xd')](_0x137a('0xe'),_0x3d4c96,_0x137a('0xf'),JSON[_0x137a('0x10')](_0xa96c64));if(_0xa96c64[_0x137a('0x11')]){if(_0xa96c64['error'][_0x137a('0x12')]===0x1f4){logger['error'](_0x137a('0xc'),_0x3d4c96,_0xa96c64[_0x137a('0x11')][_0x137a('0x13')]);return _0x4ded11(_0xa96c64[_0x137a('0x11')][_0x137a('0x13')]);}logger[_0x137a('0x11')](_0x137a('0xc'),_0x3d4c96,_0xa96c64[_0x137a('0x11')]['message']);return _0x542335(_0xa96c64[_0x137a('0x11')]['message']);}else{logger['info'](_0x137a('0xc'),_0x3d4c96,'request\x20sent');_0x542335(_0xa96c64[_0x137a('0x14')][_0x137a('0x13')]);}})[_0x137a('0x15')](function(_0x493b1b){logger[_0x137a('0x11')](_0x137a('0xc'),_0x3d4c96,_0x493b1b);_0x4ded11(_0x493b1b);});});}exports[_0x137a('0x16')]=function(_0x5cba21){var _0x57bb0d=this;return new Promise(function(_0x1174fb,_0x39c74c){return db['CmHopperBlack'][_0x137a('0x17')]({'raw':_0x5cba21['options']?_0x5cba21[_0x137a('0x18')][_0x137a('0x19')]===undefined?!![]:![]:!![],'where':_0x5cba21[_0x137a('0x18')]?_0x5cba21[_0x137a('0x18')]['where']||null:null,'attributes':_0x5cba21[_0x137a('0x18')]?_0x5cba21[_0x137a('0x18')][_0x137a('0x1a')]||null:null,'limit':_0x5cba21[_0x137a('0x18')]?_0x5cba21[_0x137a('0x18')][_0x137a('0x1b')]||null:null,'include':_0x5cba21['options']?_0x5cba21[_0x137a('0x18')][_0x137a('0x1c')]?_[_0x137a('0x1d')](_0x5cba21['options'][_0x137a('0x1c')],function(_0x41cb42){return{'model':db[_0x41cb42[_0x137a('0x1e')]],'as':_0x41cb42['as'],'attributes':_0x41cb42['attributes'],'include':_0x41cb42[_0x137a('0x1c')]?_['map'](_0x41cb42[_0x137a('0x1c')],function(_0x51d287){return{'model':db[_0x51d287[_0x137a('0x1e')]],'as':_0x51d287['as'],'attributes':_0x51d287[_0x137a('0x1a')],'include':_0x51d287[_0x137a('0x1c')]?_[_0x137a('0x1d')](_0x51d287[_0x137a('0x1c')],function(_0x559938){return{'model':db[_0x559938[_0x137a('0x1e')]],'as':_0x559938['as'],'attributes':_0x559938[_0x137a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x137a('0x1f')](function(_0x47c869){logger[_0x137a('0xb')](_0x137a('0x16'),_0x5cba21);logger['debug'](_0x137a('0x16'),_0x5cba21,JSON[_0x137a('0x10')](_0x47c869));_0x1174fb(_0x47c869);})['catch'](function(_0xb90c3a){logger[_0x137a('0x11')](_0x137a('0x16'),_0xb90c3a['message'],_0x5cba21);_0x39c74c(_0x57bb0d['error'](0x1f4,_0xb90c3a[_0x137a('0x13')]));});});};exports[_0x137a('0x20')]=function(_0x3bae14){var _0x3bcfae=this;return new Promise(function(_0x189bc0,_0x590b97){return db[_0x137a('0x21')][_0x137a('0x22')](_0x3bae14[_0x137a('0x23')],{'raw':_0x3bae14[_0x137a('0x18')]?_0x3bae14[_0x137a('0x18')][_0x137a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bae14[_0x137a('0x18')]?_0x3bae14[_0x137a('0x18')][_0x137a('0x24')]||null:null,'attributes':_0x3bae14[_0x137a('0x18')]?_0x3bae14[_0x137a('0x18')][_0x137a('0x1a')]||null:null,'limit':_0x3bae14[_0x137a('0x18')]?_0x3bae14[_0x137a('0x18')][_0x137a('0x1b')]||null:null})[_0x137a('0x1f')](function(_0x5d2338){logger['info']('UpdateCmHopperBlack',_0x3bae14);logger[_0x137a('0xd')](_0x137a('0x20'),_0x3bae14,JSON['stringify'](_0x5d2338));_0x189bc0(_0x5d2338);})[_0x137a('0x15')](function(_0x3634f9){logger[_0x137a('0x11')]('UpdateCmHopperBlack',_0x3634f9[_0x137a('0x13')],_0x3bae14);_0x590b97(_0x3bcfae['error'](0x1f4,_0x3634f9['message']));});});};exports[_0x137a('0x25')]=function(_0x43f70d){var _0x54931f=this;return new Promise(function(_0x213d29,_0x1fb0c1){return db[_0x137a('0x21')][_0x137a('0x26')]({'where':_0x43f70d[_0x137a('0x18')]?_0x43f70d[_0x137a('0x18')]['where']||null:null})[_0x137a('0x1f')](function(_0x2bc4e6){logger['info'](_0x137a('0x25'),_0x43f70d);logger[_0x137a('0xd')](_0x137a('0x25'),_0x43f70d,JSON['stringify'](_0x2bc4e6));_0x213d29(_0x2bc4e6);})[_0x137a('0x15')](function(_0x35da0a){logger[_0x137a('0x11')](_0x137a('0x25'),_0x35da0a['message'],_0x43f70d);_0x1fb0c1(_0x54931f[_0x137a('0x11')](0x1f4,_0x35da0a[_0x137a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index b1f9689..9c8de82 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 _0xcb70=['put','update','destroy','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x422877,_0x18594d){var _0x417cb7=function(_0x18cb03){while(--_0x18cb03){_0x422877['push'](_0x422877['shift']());}};_0x417cb7(++_0x18594d);}(_0xcb70,0xf3));var _0x0cb7=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xcb70[_0x44946b];return _0x249bc4;};'use strict';var multer=require(_0x0cb7('0x0'));var util=require(_0x0cb7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x0cb7('0x2'));var interaction=require(_0x0cb7('0x3'));var config=require(_0x0cb7('0x4'));var controller=require(_0x0cb7('0x5'));router[_0x0cb7('0x6')]('/',auth[_0x0cb7('0x7')](),controller[_0x0cb7('0x8')]);router['get'](_0x0cb7('0x9'),auth[_0x0cb7('0x7')](),controller[_0x0cb7('0xa')]);router[_0x0cb7('0x6')](_0x0cb7('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0cb7('0xc')](_0x0cb7('0xb'),auth[_0x0cb7('0x7')](),controller[_0x0cb7('0xd')]);router['delete'](_0x0cb7('0xb'),auth[_0x0cb7('0x7')](),controller[_0x0cb7('0xe')]);module['exports']=router; \ No newline at end of file +var _0xe157=['../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0xe157,0x13c));var _0x7e15=function(_0xd38d01,_0x38f2a1){_0xd38d01=_0xd38d01-0x0;var _0x34bec3=_0xe157[_0xd38d01];return _0x34bec3;};'use strict';var multer=require(_0x7e15('0x0'));var util=require(_0x7e15('0x1'));var path=require(_0x7e15('0x2'));var timeout=require(_0x7e15('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7e15('0x4'));var config=require(_0x7e15('0x5'));var controller=require(_0x7e15('0x6'));router[_0x7e15('0x7')]('/',auth[_0x7e15('0x8')](),controller[_0x7e15('0x9')]);router[_0x7e15('0x7')](_0x7e15('0xa'),auth['isAuthenticated'](),controller[_0x7e15('0xb')]);router[_0x7e15('0x7')](_0x7e15('0xc'),auth[_0x7e15('0x8')](),controller['show']);router['put'](_0x7e15('0xc'),auth[_0x7e15('0x8')](),controller[_0x7e15('0xd')]);router[_0x7e15('0xe')](_0x7e15('0xc'),auth[_0x7e15('0x8')](),controller[_0x7e15('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index dd482e4..962ae72 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 _0x5b87=['dispositionat','BOOLEAN','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','seconds'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5b87,0xe3));var _0x75b8=function(_0x28683a,_0x1b70fa){_0x28683a=_0x28683a-0x0;var _0x33697c=_0x5b87[_0x28683a];return _0x33697c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x75b8('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x75b8('0x1')]},'scheduledat':{'type':Sequelize[_0x75b8('0x2')]},'countbusyretry':{'type':Sequelize[_0x75b8('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x75b8('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x75b8('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x75b8('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x75b8('0x1')]},'originatecalleridname':{'type':Sequelize[_0x75b8('0x1')]},'calleridnum':{'type':Sequelize[_0x75b8('0x1')]},'calleridname':{'type':Sequelize[_0x75b8('0x1')]},'starttime':{'type':Sequelize[_0x75b8('0x2')]},'responsetime':{'type':Sequelize[_0x75b8('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x75b8('0x2')]},'ringtime':{'type':Sequelize[_0x75b8('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x75b8('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x75b8('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x75b8('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x75b8('0x1')]},'disposition':{'type':Sequelize[_0x75b8('0x1')]},'dispositionat':{'type':Sequelize[_0x75b8('0x2')],'set':function(_0x3e406e){var _0x317cf1=this['getDataValue'](_0x75b8('0x3'));if(_0x317cf1&&_0x3e406e){this[_0x75b8('0x4')](_0x75b8('0x5'),moment(_0x3e406e)['diff'](moment(_0x317cf1),_0x75b8('0x6')));}return this[_0x75b8('0x4')](_0x75b8('0x7'),_0x3e406e);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x75b8('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x75b8('0x2')]},'callback':{'type':Sequelize[_0x75b8('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x75b8('0x1')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x75b8('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x75b8('0x2')]}}; \ No newline at end of file +var _0x364b=['seconds','dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue','setDataValue','followuptime','diff'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x364b,0x162));var _0xb364=function(_0x4658e8,_0xccb2f3){_0x4658e8=_0x4658e8-0x0;var _0x5a06fe=_0x364b[_0x4658e8];return _0x5a06fe;};'use strict';var Sequelize=require(_0xb364('0x0'));var moment=require(_0xb364('0x1'));module[_0xb364('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb364('0x3')]},'scheduledat':{'type':Sequelize[_0xb364('0x4')]},'countbusyretry':{'type':Sequelize[_0xb364('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb364('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb364('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb364('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xb364('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb364('0x3')]},'starttime':{'type':Sequelize[_0xb364('0x4')]},'responsetime':{'type':Sequelize[_0xb364('0x4')]},'answertime':{'type':Sequelize[_0xb364('0x4')]},'droptime':{'type':Sequelize[_0xb364('0x4')]},'endtime':{'type':Sequelize[_0xb364('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb364('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb364('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb364('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb364('0x3')]},'campaign':{'type':Sequelize[_0xb364('0x3')]},'campaigntype':{'type':Sequelize[_0xb364('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xb364('0x3')]},'disposition':{'type':Sequelize[_0xb364('0x3')]},'dispositionat':{'type':Sequelize[_0xb364('0x4')],'set':function(_0x5ed3f6){var _0x7fed69=this[_0xb364('0x6')]('endtime');if(_0x7fed69&&_0x5ed3f6){this[_0xb364('0x7')](_0xb364('0x8'),moment(_0x5ed3f6)[_0xb364('0x9')](moment(_0x7fed69),_0xb364('0xa')));}return this[_0xb364('0x7')](_0xb364('0xb'),_0x5ed3f6);}},'amd':{'type':Sequelize[_0xb364('0xc')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb364('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb364('0x4')]},'callback':{'type':Sequelize[_0xb364('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb364('0x4')]},'deleted':{'type':Sequelize[_0xb364('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb364('0x4')]},'recallme':{'type':Sequelize[_0xb364('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index b860e8d..f81ae17 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 _0x8603=['countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','select','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','createdAt','updatedAt','cm_hopper_final','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','VoiceQueueId\x20=\x20?','moveContactsIvrCampaignHopperFinal','Campaign','into','ContactId','CampaignId','CampaignId\x20=\x20?','state','state\x20=\x204','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','CmHopperFinal','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','merge','map','VIRTUAL','field','filter','options','include','findAll','rows','show','params','rawAttributes','length','includeAll','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine'];(function(_0x25c29e,_0x37f32a){var _0x24d853=function(_0x21984e){while(--_0x21984e){_0x25c29e['push'](_0x25c29e['shift']());}};_0x24d853(++_0x37f32a);}(_0x8603,0x190));var _0x3860=function(_0x5bcd0a,_0x2a552d){_0x5bcd0a=_0x5bcd0a-0x0;var _0x5293a6=_0x8603[_0x5bcd0a];return _0x5293a6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3860('0x0'));var rimraf=require(_0x3860('0x1'));var zipdir=require(_0x3860('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3860('0x3'));var BPromise=require(_0x3860('0x4'));var Mustache=require(_0x3860('0x5'));var util=require('util');var path=require(_0x3860('0x6'));var sox=require('sox');var csv=require(_0x3860('0x7'));var ejs=require(_0x3860('0x8'));var fs=require('fs');var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x3860('0xe'));var Redis=require(_0x3860('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x3860('0x10'))(_0x3860('0x11'));var utils=require('../../config/utils');var config=require(_0x3860('0x12'));var db=require(_0x3860('0x13'))['db'];function respondWithStatusCode(_0x4c6a45,_0x405510){_0x405510=_0x405510||0xcc;return function(_0x8ad61d){if(_0x8ad61d){return _0x4c6a45[_0x3860('0x14')](_0x405510);}return _0x4c6a45[_0x3860('0x15')](_0x405510)[_0x3860('0x16')]();};}function respondWithResult(_0x21ae4e,_0x3d4ae1){_0x3d4ae1=_0x3d4ae1||0xc8;return function(_0x12b23b){if(_0x12b23b){return _0x21ae4e[_0x3860('0x15')](_0x3d4ae1)[_0x3860('0x17')](_0x12b23b);}};}function respondWithFilteredResult(_0x54dbc3,_0x3d861d){return function(_0x21eaf1){if(_0x21eaf1){var _0x122e40=_0x21eaf1[_0x3860('0x18')],_0x37d9ab=_0x3d861d[_0x3860('0x19')],_0x1055b3=_0x3d861d[_0x3860('0x19')]+_0x3d861d[_0x3860('0x1a')],_0xfa0c9a;if(_0x1055b3>=_0x122e40){_0x1055b3=_0x122e40;_0xfa0c9a=0xc8;}else{_0xfa0c9a=0xce;}_0x54dbc3[_0x3860('0x15')](_0xfa0c9a);return _0x54dbc3[_0x3860('0x1b')]('Content-Range',_0x37d9ab+'-'+_0x1055b3+'/'+_0x122e40)['json'](_0x21eaf1);}return null;};}function patchUpdates(_0x373b06){return function(_0x41ce59){try{jsonpatch[_0x3860('0x1c')](_0x41ce59,_0x373b06,!![]);}catch(_0x53fc63){return BPromise[_0x3860('0x1d')](_0x53fc63);}return _0x41ce59[_0x3860('0x1e')]();};}function saveUpdates(_0x22e873,_0x3af33a){return function(_0x20a5b0){if(_0x20a5b0){return _0x20a5b0[_0x3860('0x1f')](_0x22e873)[_0x3860('0x20')](function(_0x1f8891){return _0x1f8891;});}return null;};}function removeEntity(_0x21d179,_0x3f6b04){return function(_0xacd57f){if(_0xacd57f){return _0xacd57f[_0x3860('0x21')]()[_0x3860('0x20')](function(){_0x21d179[_0x3860('0x15')](0xcc)[_0x3860('0x16')]();});}};}function handleEntityNotFound(_0x564efd,_0xfc10a5){return function(_0x133093){if(!_0x133093){_0x564efd[_0x3860('0x14')](0x194);}return _0x133093;};}function handleError(_0x301e03,_0x20bb1e){_0x20bb1e=_0x20bb1e||0x1f4;return function(_0x56a6d1){logger[_0x3860('0x22')](_0x56a6d1['stack']);if(_0x56a6d1['name']){delete _0x56a6d1[_0x3860('0x23')];}_0x301e03[_0x3860('0x15')](_0x20bb1e)['send'](_0x56a6d1);};}exports['index']=function(_0x5f42d5,_0x1b2e4d){var _0x3ebc5b={},_0xb25cc2={},_0x371f3a={'count':0x0,'rows':[]};var _0x9332a5=db[_0x3860('0x24')]['rawAttributes'];_0xb25cc2['model']=_[_0x3860('0x25')](_0x9332a5);_0xb25cc2[_0x3860('0x26')]=_['keys'](_0x5f42d5[_0x3860('0x26')]);_0xb25cc2[_0x3860('0x27')]=_[_0x3860('0x28')](_0xb25cc2[_0x3860('0x29')],_0xb25cc2[_0x3860('0x26')]);_0x3ebc5b['attributes']=_[_0x3860('0x28')](_0xb25cc2[_0x3860('0x29')],qs[_0x3860('0x2a')](_0x5f42d5['query'][_0x3860('0x2a')]));_0x3ebc5b['attributes']=_0x3ebc5b[_0x3860('0x2b')]['length']?_0x3ebc5b[_0x3860('0x2b')]:_0xb25cc2[_0x3860('0x29')];if(!_0x5f42d5[_0x3860('0x26')]['hasOwnProperty'](_0x3860('0x2c'))){_0x3ebc5b[_0x3860('0x1a')]=qs['limit'](_0x5f42d5[_0x3860('0x26')]['limit']);_0x3ebc5b[_0x3860('0x19')]=qs[_0x3860('0x19')](_0x5f42d5[_0x3860('0x26')][_0x3860('0x19')]);}_0x3ebc5b[_0x3860('0x2d')]=qs[_0x3860('0x2e')](_0x5f42d5[_0x3860('0x26')]['sort']);_0x3ebc5b[_0x3860('0x2f')]=qs[_0x3860('0x27')](_['pick'](_0x5f42d5[_0x3860('0x26')],_0xb25cc2[_0x3860('0x27')]));if(_0x5f42d5[_0x3860('0x26')]['filter']){_0x3ebc5b['where']=_[_0x3860('0x30')](_0x3ebc5b[_0x3860('0x2f')],{'$or':_[_0x3860('0x31')](_0x9332a5,function(_0xa921ed){if(_0xa921ed['type']['key']!==_0x3860('0x32')){var _0x40dae8={};_0x40dae8[_0xa921ed[_0x3860('0x33')]]={'$like':'%'+_0x5f42d5[_0x3860('0x26')][_0x3860('0x34')]+'%'};return _0x40dae8;}})});}_0x3ebc5b=_['merge']({},_0x3ebc5b,_0x5f42d5[_0x3860('0x35')]);var _0xbfa744={'where':_0x3ebc5b['where']};return db['CmHopperFinal'][_0x3860('0x18')](_0xbfa744)[_0x3860('0x20')](function(_0x295752){_0x371f3a[_0x3860('0x18')]=_0x295752;if(_0x5f42d5[_0x3860('0x26')]['includeAll']){_0x3ebc5b[_0x3860('0x36')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3860('0x37')](_0x3ebc5b);})[_0x3860('0x20')](function(_0x53d443){_0x371f3a[_0x3860('0x38')]=_0x53d443;return _0x371f3a;})[_0x3860('0x20')](respondWithFilteredResult(_0x1b2e4d,_0x3ebc5b))['catch'](handleError(_0x1b2e4d,null));};exports[_0x3860('0x39')]=function(_0xc7d34d,_0x15bd2c){var _0xf346e={'raw':!![],'where':{'id':_0xc7d34d[_0x3860('0x3a')]['id']}},_0x4f486e={};_0x4f486e[_0x3860('0x29')]=_[_0x3860('0x25')](db['CmHopperFinal'][_0x3860('0x3b')]);_0x4f486e['query']=_[_0x3860('0x25')](_0xc7d34d[_0x3860('0x26')]);_0x4f486e[_0x3860('0x27')]=_[_0x3860('0x28')](_0x4f486e[_0x3860('0x29')],_0x4f486e[_0x3860('0x26')]);_0xf346e['attributes']=_[_0x3860('0x28')](_0x4f486e[_0x3860('0x29')],qs['fields'](_0xc7d34d['query'][_0x3860('0x2a')]));_0xf346e[_0x3860('0x2b')]=_0xf346e['attributes'][_0x3860('0x3c')]?_0xf346e[_0x3860('0x2b')]:_0x4f486e['model'];if(_0xc7d34d[_0x3860('0x26')][_0x3860('0x3d')]){_0xf346e[_0x3860('0x36')]=[{'all':!![]}];}_0xf346e=_[_0x3860('0x30')]({},_0xf346e,_0xc7d34d[_0x3860('0x35')]);return db[_0x3860('0x24')][_0x3860('0x3e')](_0xf346e)[_0x3860('0x20')](handleEntityNotFound(_0x15bd2c,null))[_0x3860('0x20')](respondWithResult(_0x15bd2c,null))[_0x3860('0x3f')](handleError(_0x15bd2c,null));};exports[_0x3860('0x40')]=function(_0x3d20af,_0x270532){return db['CmHopperFinal'][_0x3860('0x40')]()['then'](respondWithResult(_0x270532,null))[_0x3860('0x3f')](handleError(_0x270532,null));};exports[_0x3860('0x1f')]=function(_0x202c92,_0xbad34b){if(_0x202c92[_0x3860('0x41')][_0x3860('0x42')]){delete _0x202c92[_0x3860('0x41')][_0x3860('0x42')];}return db['CmHopperFinal'][_0x3860('0x3e')]({'where':{'uniqueid':_0x202c92[_0x3860('0x3a')]['id']}})[_0x3860('0x20')](handleEntityNotFound(_0xbad34b,null))['then'](saveUpdates(_0x202c92[_0x3860('0x41')],null))[_0x3860('0x20')](respondWithResult(_0xbad34b,null))[_0x3860('0x3f')](handleError(_0xbad34b,null));};exports[_0x3860('0x43')]=function(_0x5ed2db,_0x5bb2d1,_0x228538){return db['CmHopperFinal'][_0x3860('0x37')]({'raw':![],'where':{'VoiceQueueId':_0x5ed2db[_0x3860('0x3a')]['id']},'attributes':[[db[_0x3860('0x44')]['fn']('COUNT',db[_0x3860('0x44')]['fn']('IF',db['sequelize'][_0x3860('0x45')]('`state`\x20=\x200,\x201,\x20null'))),_0x3860('0x46')],[db[_0x3860('0x44')]['fn'](_0x3860('0x47'),db['sequelize']['fn']('IF',db['sequelize'][_0x3860('0x45')](_0x3860('0x48')))),'noAnswerContacts'],[db[_0x3860('0x44')]['fn']('COUNT',db[_0x3860('0x44')]['fn']('IF',db[_0x3860('0x44')][_0x3860('0x45')](_0x3860('0x49')))),_0x3860('0x4a')],[db[_0x3860('0x44')]['fn'](_0x3860('0x47'),db['sequelize']['fn']('IF',db[_0x3860('0x44')][_0x3860('0x45')](_0x3860('0x4b')))),_0x3860('0x4c')],[db[_0x3860('0x44')]['fn'](_0x3860('0x47'),db['sequelize']['fn']('IF',db[_0x3860('0x44')][_0x3860('0x45')](_0x3860('0x4d')))),_0x3860('0x4e')],[db[_0x3860('0x44')]['fn'](_0x3860('0x47'),db[_0x3860('0x44')]['fn']('IF',db[_0x3860('0x44')]['literal'](_0x3860('0x4f')))),_0x3860('0x50')],[db['sequelize']['fn'](_0x3860('0x47'),db[_0x3860('0x44')]['fn']('IF',db[_0x3860('0x44')]['literal'](_0x3860('0x51')))),'reCallContacts'],[db[_0x3860('0x44')]['fn'](_0x3860('0x47'),db[_0x3860('0x44')]['fn']('IF',db[_0x3860('0x44')][_0x3860('0x45')](_0x3860('0x52')))),_0x3860('0x53')]]})[_0x3860('0x20')](handleEntityNotFound(_0x5bb2d1,null))[_0x3860('0x20')](respondWithResult(_0x5bb2d1,null))[_0x3860('0x3f')](handleError(_0x5bb2d1,null));};exports[_0x3860('0x54')]=function(_0x2bac24,_0x58147d,_0x5ce9a4){return db['CmHopperFinal'][_0x3860('0x37')]({'raw':![],'where':{'CampaignId':_0x2bac24['params']['id']},'attributes':[[db['sequelize']['fn'](_0x3860('0x47'),db[_0x3860('0x44')]['fn']('IF',db[_0x3860('0x44')][_0x3860('0x45')](_0x3860('0x55')))),_0x3860('0x46')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3860('0x44')][_0x3860('0x45')](_0x3860('0x48')))),'noAnswerContacts'],[db[_0x3860('0x44')]['fn']('COUNT',db[_0x3860('0x44')]['fn']('IF',db[_0x3860('0x44')]['literal'](_0x3860('0x49')))),_0x3860('0x4a')],[db[_0x3860('0x44')]['fn'](_0x3860('0x47'),db['sequelize']['fn']('IF',db[_0x3860('0x44')][_0x3860('0x45')](_0x3860('0x4b')))),'congestionContacts'],[db['sequelize']['fn'](_0x3860('0x47'),db[_0x3860('0x44')]['fn']('IF',db[_0x3860('0x44')][_0x3860('0x45')](_0x3860('0x4d')))),_0x3860('0x4e')],[db['sequelize']['fn'](_0x3860('0x47'),db[_0x3860('0x44')]['fn']('IF',db['sequelize'][_0x3860('0x45')](_0x3860('0x4f')))),_0x3860('0x50')],[db[_0x3860('0x44')]['fn'](_0x3860('0x47'),db[_0x3860('0x44')]['fn']('IF',db['sequelize'][_0x3860('0x45')](_0x3860('0x51')))),_0x3860('0x56')],[db[_0x3860('0x44')]['fn'](_0x3860('0x47'),db[_0x3860('0x44')]['fn']('IF',db['sequelize'][_0x3860('0x45')](_0x3860('0x52')))),_0x3860('0x53')]]})['then'](handleEntityNotFound(_0x58147d,null))['then'](respondWithResult(_0x58147d,null))[_0x3860('0x3f')](handleError(_0x58147d,null));};exports[_0x3860('0x57')]=function(_0x11c2c8,_0x3b7a76,_0x3fe275){return db['VoiceQueue']['find']({'where':{'id':_0x11c2c8[_0x3860('0x3a')]['id']}})[_0x3860('0x20')](handleEntityNotFound(_0x3b7a76,null))['then'](function(_0x5d9416){var _0x2fd2ec;if(_0x5d9416){_0x2fd2ec=squel[_0x3860('0x58')]()['into'](_0x3860('0x59'))[_0x3860('0x5a')]([_0x3860('0x5b'),_0x3860('0x5c'),'ContactId',_0x3860('0x5d'),_0x3860('0x5e'),'createdAt','updatedAt'],squel[_0x3860('0x5f')]()[_0x3860('0x33')]('ANY_VALUE(calleridnum)',_0x3860('0x5b'))['field'](_0x3860('0x60'),'scheduledAt')['field'](_0x3860('0x61'),'ContactId')[_0x3860('0x33')](_0x3860('0x62'),_0x3860('0x5d'))[_0x3860('0x33')](_0x3860('0x63'),_0x3860('0x5e'))['field'](_0x3860('0x60'),_0x3860('0x64'))[_0x3860('0x33')]('NOW()',_0x3860('0x65'))['from'](_0x3860('0x66'))[_0x3860('0x2f')]('VoiceQueueId\x20=\x20?',_0x11c2c8[_0x3860('0x3a')]['id'][_0x3860('0x67')]())[_0x3860('0x2f')]('state\x20=\x20?',_0x11c2c8['body']['state']['toString']())[_0x3860('0x2f')](_0x3860('0x68'))[_0x3860('0x2f')](_0x3860('0x69'),squel['select']()['field'](_0x3860('0x5b'))[_0x3860('0x6a')](_0x3860('0x59'))[_0x3860('0x2f')]('VoiceQueueId\x20=\x20?',_0x11c2c8[_0x3860('0x3a')]['id'][_0x3860('0x67')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3860('0x5f')]()[_0x3860('0x33')](_0x3860('0x6b'))[_0x3860('0x6a')]('cm_hopper_final')['where'](_0x3860('0x6c'),_0x11c2c8['params']['id'][_0x3860('0x67')]())[_0x3860('0x2f')]('state\x20=\x204'))['group']('ContactId'))[_0x3860('0x67')]();return db[_0x3860('0x44')]['query'](_0x2fd2ec);}return[];})[_0x3860('0x20')](respondWithResult(_0x3b7a76,null))[_0x3860('0x3f')](handleError(_0x3b7a76,null));};exports[_0x3860('0x6d')]=function(_0x3c5ad8,_0x5b8867,_0x481e20){return db[_0x3860('0x6e')][_0x3860('0x3e')]({'where':{'id':_0x3c5ad8[_0x3860('0x3a')]['id']}})[_0x3860('0x20')](handleEntityNotFound(_0x5b8867,null))[_0x3860('0x20')](function(_0x4a98a0){var _0x313366;if(_0x4a98a0){_0x313366=squel[_0x3860('0x58')]()[_0x3860('0x6f')](_0x3860('0x59'))[_0x3860('0x5a')](['phone','scheduledAt',_0x3860('0x70'),_0x3860('0x5d'),_0x3860('0x71'),_0x3860('0x64'),_0x3860('0x65')],squel[_0x3860('0x5f')]()[_0x3860('0x33')]('ANY_VALUE(calleridnum)',_0x3860('0x5b'))[_0x3860('0x33')]('NOW()',_0x3860('0x5c'))[_0x3860('0x33')](_0x3860('0x61'),'ContactId')[_0x3860('0x33')](_0x3860('0x62'),'ListId')[_0x3860('0x33')]('ANY_VALUE(CampaignId)',_0x3860('0x71'))[_0x3860('0x33')]('NOW()',_0x3860('0x64'))[_0x3860('0x33')](_0x3860('0x60'),_0x3860('0x65'))[_0x3860('0x6a')]('cm_hopper_final')[_0x3860('0x2f')](_0x3860('0x72'),_0x3c5ad8[_0x3860('0x3a')]['id'][_0x3860('0x67')]())[_0x3860('0x2f')]('state\x20=\x20?',_0x3c5ad8['body'][_0x3860('0x73')][_0x3860('0x67')]())['where'](_0x3860('0x68'))[_0x3860('0x2f')](_0x3860('0x69'),squel[_0x3860('0x5f')]()['field'](_0x3860('0x5b'))['from'](_0x3860('0x59'))[_0x3860('0x2f')](_0x3860('0x72'),_0x3c5ad8[_0x3860('0x3a')]['id'][_0x3860('0x67')]()))[_0x3860('0x2f')](_0x3860('0x69'),squel['select']()[_0x3860('0x33')](_0x3860('0x6b'))['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x3c5ad8[_0x3860('0x3a')]['id'][_0x3860('0x67')]())[_0x3860('0x2f')](_0x3860('0x74')))[_0x3860('0x75')](_0x3860('0x70')))['toString']();return db[_0x3860('0x44')]['query'](_0x313366);}return[];})[_0x3860('0x20')](respondWithResult(_0x5b8867,null))[_0x3860('0x3f')](handleError(_0x5b8867,null));};exports[_0x3860('0x76')]=function(_0x221229,_0x459b6c,_0x1108d2){return db[_0x3860('0x77')][_0x3860('0x78')]({'where':{'VoiceQueueId':_0x221229[_0x3860('0x41')][_0x3860('0x5e')],'CampaignId':_0x221229[_0x3860('0x41')]['CampaignId'],'ContactId':_0x221229[_0x3860('0x41')][_0x3860('0x70')]}})[_0x3860('0x20')](handleEntityNotFound(_0x459b6c,null))['then'](function(_0xf370f9){if(_0xf370f9){return _0xf370f9;}return null;})[_0x3860('0x20')](respondWithResult(_0x459b6c,null))[_0x3860('0x3f')](handleError(_0x459b6c,null));}; \ No newline at end of file +var _0xac4a=['filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','length','find','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','literal','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x2010\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper','calleridnum','cm_hopper_final','state\x20=\x204','group','Campaign','into','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','then','destroy','stack','index','CmHopperFinal','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xac4a,0x13f));var _0xaac4=function(_0x1e3a98,_0x3aba27){_0x1e3a98=_0x1e3a98-0x0;var _0x32f342=_0xac4a[_0x1e3a98];return _0x32f342;};'use strict';var pdf=require(_0xaac4('0x0'));var emlformat=require(_0xaac4('0x1'));var rimraf=require(_0xaac4('0x2'));var zipdir=require(_0xaac4('0x3'));var jsonpatch=require(_0xaac4('0x4'));var rp=require(_0xaac4('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaac4('0x6'));var util=require(_0xaac4('0x7'));var path=require(_0xaac4('0x8'));var sox=require('sox');var csv=require(_0xaac4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var authService=require(_0xaac4('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xaac4('0xf'));var logger=require(_0xaac4('0x10'))(_0xaac4('0x11'));var utils=require(_0xaac4('0x12'));var config=require(_0xaac4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x508e14,_0x2348c2){_0x2348c2=_0x2348c2||0xcc;return function(_0x2e2d02){if(_0x2e2d02){return _0x508e14[_0xaac4('0x14')](_0x2348c2);}return _0x508e14['status'](_0x2348c2)[_0xaac4('0x15')]();};}function respondWithResult(_0x45c129,_0x5bcacd){_0x5bcacd=_0x5bcacd||0xc8;return function(_0xf06b1d){if(_0xf06b1d){return _0x45c129[_0xaac4('0x16')](_0x5bcacd)[_0xaac4('0x17')](_0xf06b1d);}};}function respondWithFilteredResult(_0x150fdd,_0x187624){return function(_0x2fbeb7){if(_0x2fbeb7){var _0x31b7e5=_0x2fbeb7[_0xaac4('0x18')],_0x1df9ae=_0x187624[_0xaac4('0x19')],_0x233278=_0x187624[_0xaac4('0x19')]+_0x187624['limit'],_0xb8466e;if(_0x233278>=_0x31b7e5){_0x233278=_0x31b7e5;_0xb8466e=0xc8;}else{_0xb8466e=0xce;}_0x150fdd[_0xaac4('0x16')](_0xb8466e);return _0x150fdd['set'](_0xaac4('0x1a'),_0x1df9ae+'-'+_0x233278+'/'+_0x31b7e5)['json'](_0x2fbeb7);}return null;};}function patchUpdates(_0x3ce35a){return function(_0x27fe7b){try{jsonpatch[_0xaac4('0x1b')](_0x27fe7b,_0x3ce35a,!![]);}catch(_0x271bcb){return BPromise[_0xaac4('0x1c')](_0x271bcb);}return _0x27fe7b[_0xaac4('0x1d')]();};}function saveUpdates(_0x44f0e8,_0x25b946){return function(_0x4166ee){if(_0x4166ee){return _0x4166ee['update'](_0x44f0e8)[_0xaac4('0x1e')](function(_0x4e1e89){return _0x4e1e89;});}return null;};}function removeEntity(_0x3303f1,_0x2013b7){return function(_0x43625c){if(_0x43625c){return _0x43625c[_0xaac4('0x1f')]()[_0xaac4('0x1e')](function(){_0x3303f1[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ccdc,_0x27a84d){return function(_0x174860){if(!_0x174860){_0x43ccdc[_0xaac4('0x14')](0x194);}return _0x174860;};}function handleError(_0x3dd059,_0x2dcc59){_0x2dcc59=_0x2dcc59||0x1f4;return function(_0xb2577b){logger['error'](_0xb2577b[_0xaac4('0x20')]);if(_0xb2577b['name']){delete _0xb2577b['name'];}_0x3dd059['status'](_0x2dcc59)['send'](_0xb2577b);};}exports[_0xaac4('0x21')]=function(_0x17d25f,_0x22cda2){var _0xe93120={},_0x3c1445={},_0x249a5d={'count':0x0,'rows':[]};var _0x43b122=db[_0xaac4('0x22')][_0xaac4('0x23')];_0x3c1445[_0xaac4('0x24')]=_['keys'](_0x43b122);_0x3c1445[_0xaac4('0x25')]=_[_0xaac4('0x26')](_0x17d25f[_0xaac4('0x25')]);_0x3c1445[_0xaac4('0x27')]=_[_0xaac4('0x28')](_0x3c1445[_0xaac4('0x24')],_0x3c1445['query']);_0xe93120[_0xaac4('0x29')]=_['intersection'](_0x3c1445[_0xaac4('0x24')],qs[_0xaac4('0x2a')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2a')]));_0xe93120['attributes']=_0xe93120['attributes']['length']?_0xe93120[_0xaac4('0x29')]:_0x3c1445[_0xaac4('0x24')];if(!_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2b')](_0xaac4('0x2c'))){_0xe93120[_0xaac4('0x2d')]=qs[_0xaac4('0x2d')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2d')]);_0xe93120[_0xaac4('0x19')]=qs[_0xaac4('0x19')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x19')]);}_0xe93120[_0xaac4('0x2e')]=qs[_0xaac4('0x2f')](_0x17d25f['query']['sort']);_0xe93120[_0xaac4('0x30')]=qs[_0xaac4('0x27')](_[_0xaac4('0x31')](_0x17d25f['query'],_0x3c1445[_0xaac4('0x27')]));if(_0x17d25f[_0xaac4('0x25')][_0xaac4('0x32')]){_0xe93120[_0xaac4('0x30')]=_[_0xaac4('0x33')](_0xe93120[_0xaac4('0x30')],{'$or':_[_0xaac4('0x34')](_0x43b122,function(_0x53b7cb){if(_0x53b7cb[_0xaac4('0x35')][_0xaac4('0x36')]!==_0xaac4('0x37')){var _0x5d64a2={};_0x5d64a2[_0x53b7cb[_0xaac4('0x38')]]={'$like':'%'+_0x17d25f['query']['filter']+'%'};return _0x5d64a2;}})});}_0xe93120=_[_0xaac4('0x33')]({},_0xe93120,_0x17d25f[_0xaac4('0x39')]);var _0x2da28a={'where':_0xe93120['where']};return db['CmHopperFinal'][_0xaac4('0x18')](_0x2da28a)[_0xaac4('0x1e')](function(_0x2f7300){_0x249a5d[_0xaac4('0x18')]=_0x2f7300;if(_0x17d25f[_0xaac4('0x25')][_0xaac4('0x3a')]){_0xe93120['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xaac4('0x3b')](_0xe93120);})[_0xaac4('0x1e')](function(_0x5371b4){_0x249a5d[_0xaac4('0x3c')]=_0x5371b4;return _0x249a5d;})[_0xaac4('0x1e')](respondWithFilteredResult(_0x22cda2,_0xe93120))[_0xaac4('0x3d')](handleError(_0x22cda2,null));};exports['show']=function(_0x74a1c,_0x4a4773){var _0x2259fc={'raw':!![],'where':{'id':_0x74a1c[_0xaac4('0x3e')]['id']}},_0x5bc387={};_0x5bc387[_0xaac4('0x24')]=_[_0xaac4('0x26')](db[_0xaac4('0x22')]['rawAttributes']);_0x5bc387[_0xaac4('0x25')]=_['keys'](_0x74a1c['query']);_0x5bc387[_0xaac4('0x27')]=_[_0xaac4('0x28')](_0x5bc387[_0xaac4('0x24')],_0x5bc387[_0xaac4('0x25')]);_0x2259fc[_0xaac4('0x29')]=_[_0xaac4('0x28')](_0x5bc387[_0xaac4('0x24')],qs[_0xaac4('0x2a')](_0x74a1c['query'][_0xaac4('0x2a')]));_0x2259fc[_0xaac4('0x29')]=_0x2259fc[_0xaac4('0x29')][_0xaac4('0x3f')]?_0x2259fc['attributes']:_0x5bc387[_0xaac4('0x24')];if(_0x74a1c[_0xaac4('0x25')][_0xaac4('0x3a')]){_0x2259fc['include']=[{'all':!![]}];}_0x2259fc=_[_0xaac4('0x33')]({},_0x2259fc,_0x74a1c[_0xaac4('0x39')]);return db[_0xaac4('0x22')][_0xaac4('0x40')](_0x2259fc)['then'](handleEntityNotFound(_0x4a4773,null))[_0xaac4('0x1e')](respondWithResult(_0x4a4773,null))[_0xaac4('0x3d')](handleError(_0x4a4773,null));};exports[_0xaac4('0x41')]=function(_0x57a7ab,_0xf404b9){return db[_0xaac4('0x22')][_0xaac4('0x41')]()[_0xaac4('0x1e')](respondWithResult(_0xf404b9,null))[_0xaac4('0x3d')](handleError(_0xf404b9,null));};exports[_0xaac4('0x42')]=function(_0x25e1b1,_0xa8d1c9){if(_0x25e1b1[_0xaac4('0x43')]['uniqueid']){delete _0x25e1b1[_0xaac4('0x43')][_0xaac4('0x44')];}return db[_0xaac4('0x22')][_0xaac4('0x40')]({'where':{'uniqueid':_0x25e1b1[_0xaac4('0x3e')]['id']}})['then'](handleEntityNotFound(_0xa8d1c9,null))['then'](saveUpdates(_0x25e1b1[_0xaac4('0x43')],null))[_0xaac4('0x1e')](respondWithResult(_0xa8d1c9,null))[_0xaac4('0x3d')](handleError(_0xa8d1c9,null));};exports[_0xaac4('0x45')]=function(_0x5f33ea,_0x283d51,_0x528f3f){return db[_0xaac4('0x22')][_0xaac4('0x3b')]({'raw':![],'where':{'VoiceQueueId':_0x5f33ea['params']['id']},'attributes':[[db[_0xaac4('0x46')]['fn'](_0xaac4('0x47'),db[_0xaac4('0x46')]['fn']('IF',db['sequelize']['literal'](_0xaac4('0x48')))),_0xaac4('0x49')],[db[_0xaac4('0x46')]['fn'](_0xaac4('0x47'),db[_0xaac4('0x46')]['fn']('IF',db[_0xaac4('0x46')]['literal'](_0xaac4('0x4a')))),_0xaac4('0x4b')],[db[_0xaac4('0x46')]['fn'](_0xaac4('0x47'),db['sequelize']['fn']('IF',db[_0xaac4('0x46')]['literal'](_0xaac4('0x4c')))),_0xaac4('0x4d')],[db[_0xaac4('0x46')]['fn'](_0xaac4('0x47'),db[_0xaac4('0x46')]['fn']('IF',db[_0xaac4('0x46')][_0xaac4('0x4e')](_0xaac4('0x4f')))),_0xaac4('0x50')],[db[_0xaac4('0x46')]['fn'](_0xaac4('0x47'),db[_0xaac4('0x46')]['fn']('IF',db[_0xaac4('0x46')][_0xaac4('0x4e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xaac4('0x51')],[db[_0xaac4('0x46')]['fn'](_0xaac4('0x47'),db[_0xaac4('0x46')]['fn']('IF',db[_0xaac4('0x46')][_0xaac4('0x4e')](_0xaac4('0x52')))),_0xaac4('0x53')],[db['sequelize']['fn'](_0xaac4('0x47'),db['sequelize']['fn']('IF',db[_0xaac4('0x46')]['literal'](_0xaac4('0x54')))),'reCallContacts'],[db['sequelize']['fn'](_0xaac4('0x47'),db[_0xaac4('0x46')]['fn']('IF',db['sequelize'][_0xaac4('0x4e')](_0xaac4('0x55')))),_0xaac4('0x56')]]})[_0xaac4('0x1e')](handleEntityNotFound(_0x283d51,null))[_0xaac4('0x1e')](respondWithResult(_0x283d51,null))[_0xaac4('0x3d')](handleError(_0x283d51,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x346f4c,_0x586a10,_0x2656ed){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x346f4c['params']['id']},'attributes':[[db[_0xaac4('0x46')]['fn'](_0xaac4('0x47'),db[_0xaac4('0x46')]['fn']('IF',db[_0xaac4('0x46')]['literal'](_0xaac4('0x48')))),_0xaac4('0x49')],[db[_0xaac4('0x46')]['fn']('COUNT',db[_0xaac4('0x46')]['fn']('IF',db[_0xaac4('0x46')][_0xaac4('0x4e')](_0xaac4('0x4a')))),_0xaac4('0x4b')],[db[_0xaac4('0x46')]['fn'](_0xaac4('0x47'),db['sequelize']['fn']('IF',db['sequelize'][_0xaac4('0x4e')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xaac4('0x46')]['fn']('COUNT',db[_0xaac4('0x46')]['fn']('IF',db['sequelize'][_0xaac4('0x4e')](_0xaac4('0x4f')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xaac4('0x46')][_0xaac4('0x4e')](_0xaac4('0x57')))),_0xaac4('0x51')],[db['sequelize']['fn'](_0xaac4('0x47'),db[_0xaac4('0x46')]['fn']('IF',db[_0xaac4('0x46')][_0xaac4('0x4e')](_0xaac4('0x52')))),_0xaac4('0x53')],[db[_0xaac4('0x46')]['fn'](_0xaac4('0x47'),db[_0xaac4('0x46')]['fn']('IF',db[_0xaac4('0x46')][_0xaac4('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0xaac4('0x46')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xaac4('0x46')]['literal'](_0xaac4('0x55')))),_0xaac4('0x56')]]})[_0xaac4('0x1e')](handleEntityNotFound(_0x586a10,null))[_0xaac4('0x1e')](respondWithResult(_0x586a10,null))['catch'](handleError(_0x586a10,null));};exports[_0xaac4('0x58')]=function(_0x2de8d4,_0x987b2e,_0xd5e0e2){return db[_0xaac4('0x59')][_0xaac4('0x40')]({'where':{'id':_0x2de8d4['params']['id']}})[_0xaac4('0x1e')](handleEntityNotFound(_0x987b2e,null))[_0xaac4('0x1e')](function(_0x5b5e57){var _0x2e3fd9;if(_0x5b5e57){_0x2e3fd9=squel[_0xaac4('0x5a')]()['into']('cm_hopper')[_0xaac4('0x5b')]([_0xaac4('0x5c'),_0xaac4('0x5d'),_0xaac4('0x5e'),_0xaac4('0x5f'),_0xaac4('0x60'),_0xaac4('0x61'),_0xaac4('0x62')],squel['select']()[_0xaac4('0x38')](_0xaac4('0x63'),_0xaac4('0x5c'))[_0xaac4('0x38')](_0xaac4('0x64'),_0xaac4('0x5d'))['field'](_0xaac4('0x65'),_0xaac4('0x5e'))['field']('ANY_VALUE(ListId)','ListId')[_0xaac4('0x38')]('ANY_VALUE(VoiceQueueId)','VoiceQueueId')['field']('NOW()','createdAt')[_0xaac4('0x38')](_0xaac4('0x64'),_0xaac4('0x62'))[_0xaac4('0x66')]('cm_hopper_final')[_0xaac4('0x30')](_0xaac4('0x67'),_0x2de8d4[_0xaac4('0x3e')]['id'][_0xaac4('0x68')]())[_0xaac4('0x30')](_0xaac4('0x69'),_0x2de8d4[_0xaac4('0x43')]['state'][_0xaac4('0x68')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0xaac4('0x30')](_0xaac4('0x6a'),squel[_0xaac4('0x6b')]()[_0xaac4('0x38')](_0xaac4('0x5c'))[_0xaac4('0x66')](_0xaac4('0x6c'))[_0xaac4('0x30')](_0xaac4('0x67'),_0x2de8d4[_0xaac4('0x3e')]['id'][_0xaac4('0x68')]()))[_0xaac4('0x30')](_0xaac4('0x6a'),squel[_0xaac4('0x6b')]()[_0xaac4('0x38')](_0xaac4('0x6d'))[_0xaac4('0x66')](_0xaac4('0x6e'))[_0xaac4('0x30')](_0xaac4('0x67'),_0x2de8d4[_0xaac4('0x3e')]['id'][_0xaac4('0x68')]())[_0xaac4('0x30')](_0xaac4('0x6f')))[_0xaac4('0x70')]('ContactId'))[_0xaac4('0x68')]();return db[_0xaac4('0x46')][_0xaac4('0x25')](_0x2e3fd9);}return[];})[_0xaac4('0x1e')](respondWithResult(_0x987b2e,null))[_0xaac4('0x3d')](handleError(_0x987b2e,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1bbb55,_0x334462,_0x13d2aa){return db[_0xaac4('0x71')][_0xaac4('0x40')]({'where':{'id':_0x1bbb55['params']['id']}})[_0xaac4('0x1e')](handleEntityNotFound(_0x334462,null))['then'](function(_0xbf2dc8){var _0x36d642;if(_0xbf2dc8){_0x36d642=squel['insert']()[_0xaac4('0x72')]('cm_hopper')[_0xaac4('0x5b')]([_0xaac4('0x5c'),'scheduledAt',_0xaac4('0x5e'),_0xaac4('0x5f'),'CampaignId',_0xaac4('0x61'),_0xaac4('0x62')],squel[_0xaac4('0x6b')]()[_0xaac4('0x38')](_0xaac4('0x63'),_0xaac4('0x5c'))[_0xaac4('0x38')](_0xaac4('0x64'),_0xaac4('0x5d'))['field'](_0xaac4('0x65'),_0xaac4('0x5e'))[_0xaac4('0x38')]('ANY_VALUE(ListId)',_0xaac4('0x5f'))[_0xaac4('0x38')](_0xaac4('0x73'),_0xaac4('0x74'))[_0xaac4('0x38')](_0xaac4('0x64'),_0xaac4('0x61'))[_0xaac4('0x38')](_0xaac4('0x64'),_0xaac4('0x62'))[_0xaac4('0x66')](_0xaac4('0x6e'))[_0xaac4('0x30')](_0xaac4('0x75'),_0x1bbb55[_0xaac4('0x3e')]['id'][_0xaac4('0x68')]())['where'](_0xaac4('0x69'),_0x1bbb55[_0xaac4('0x43')][_0xaac4('0x76')]['toString']())[_0xaac4('0x30')](_0xaac4('0x77'))['where'](_0xaac4('0x6a'),squel['select']()[_0xaac4('0x38')](_0xaac4('0x5c'))[_0xaac4('0x66')](_0xaac4('0x6c'))[_0xaac4('0x30')](_0xaac4('0x75'),_0x1bbb55['params']['id'][_0xaac4('0x68')]()))[_0xaac4('0x30')](_0xaac4('0x6a'),squel[_0xaac4('0x6b')]()['field'](_0xaac4('0x6d'))[_0xaac4('0x66')](_0xaac4('0x6e'))['where'](_0xaac4('0x75'),_0x1bbb55[_0xaac4('0x3e')]['id'][_0xaac4('0x68')]())[_0xaac4('0x30')](_0xaac4('0x6f')))['group']('ContactId'))[_0xaac4('0x68')]();return db[_0xaac4('0x46')][_0xaac4('0x25')](_0x36d642);}return[];})[_0xaac4('0x1e')](respondWithResult(_0x334462,null))['catch'](handleError(_0x334462,null));};exports[_0xaac4('0x78')]=function(_0x233cb4,_0x43a593,_0x35d3a9){return db[_0xaac4('0x79')][_0xaac4('0x7a')]({'where':{'VoiceQueueId':_0x233cb4[_0xaac4('0x43')][_0xaac4('0x60')],'CampaignId':_0x233cb4[_0xaac4('0x43')][_0xaac4('0x74')],'ContactId':_0x233cb4[_0xaac4('0x43')][_0xaac4('0x5e')]}})[_0xaac4('0x1e')](handleEntityNotFound(_0x43a593,null))['then'](function(_0x2ac631){if(_0x2ac631){return _0x2ac631;}return null;})[_0xaac4('0x1e')](respondWithResult(_0x43a593,null))[_0xaac4('0x3d')](handleError(_0x43a593,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 7ab7bee..7458443 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 _0x1261=['./cmHopperFinal.attributes','exports','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4d2792,_0x5874cf){var _0x22a6ee=function(_0x106b96){while(--_0x106b96){_0x4d2792['push'](_0x4d2792['shift']());}};_0x22a6ee(++_0x5874cf);}(_0x1261,0x144));var _0x1126=function(_0x59ae8f,_0x148344){_0x59ae8f=_0x59ae8f-0x0;var _0x3900b5=_0x1261[_0x59ae8f];return _0x3900b5;};'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 attributes=require(_0x1126('0x6'));module[_0x1126('0x7')]=function(_0x21a480,_0x75a851){return _0x21a480['define']('CmHopperFinal',attributes,{'tableName':_0x1126('0x8'),'paranoid':![],'indexes':[{'name':_0x1126('0x9'),'fields':['calleridnum']},{'name':_0x1126('0xa'),'fields':[_0x1126('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x7a54,0x106));var _0x47a5=function(_0x475f59,_0x264f44){_0x475f59=_0x475f59-0x0;var _0x53bb9b=_0x7a54[_0x475f59];return _0x53bb9b;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('CmHopperFinal',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x47a5('0x9')]},{'name':_0x47a5('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 6eee472..2aa8f96 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 _0x4483=['CreateCmHopperFinal','body','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x133f8b,_0x1b3d91){var _0x436df5=function(_0x12289a){while(--_0x12289a){_0x133f8b['push'](_0x133f8b['shift']());}};_0x436df5(++_0x1b3d91);}(_0x4483,0x1a3));var _0x3448=function(_0x560842,_0x3914e2){_0x560842=_0x560842-0x0;var _0x5e1ae7=_0x4483[_0x560842];return _0x5e1ae7;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bb7e5,_0x2caa81,_0x3cc81d){return new BPromise(function(_0x34b926,_0x5923ee){return client['request'](_0x1bb7e5,_0x3cc81d)[_0x3448('0xc')](function(_0x25c152){logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,_0x3448('0xf'));logger[_0x3448('0x10')](_0x3448('0x11'),_0x2caa81,_0x3448('0xf'),JSON[_0x3448('0x12')](_0x25c152));if(_0x25c152[_0x3448('0x13')]){if(_0x25c152[_0x3448('0x13')]['code']===0x1f4){logger['error'](_0x3448('0xe'),_0x2caa81,_0x25c152[_0x3448('0x13')]['message']);return _0x5923ee(_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);}logger[_0x3448('0x13')]('CmHopperFinal,\x20%s,\x20%s',_0x2caa81,_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);return _0x34b926(_0x25c152['error'][_0x3448('0x14')]);}else{logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,'request\x20sent');_0x34b926(_0x25c152[_0x3448('0x15')][_0x3448('0x14')]);}})[_0x3448('0x16')](function(_0x30f8dd){logger[_0x3448('0x13')](_0x3448('0xe'),_0x2caa81,_0x30f8dd);_0x5923ee(_0x30f8dd);});});}exports[_0x3448('0x17')]=function(_0x425514){var _0x4a348c=this;return new Promise(function(_0x1658cd,_0x5b410d){return db['CmHopperFinal']['create'](_0x425514[_0x3448('0x18')],{'raw':_0x425514[_0x3448('0x19')]?_0x425514[_0x3448('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x3448('0xc')](function(_0x392c8d){logger[_0x3448('0xd')](_0x3448('0x17'),_0x425514);logger[_0x3448('0x10')](_0x3448('0x17'),_0x425514,JSON['stringify'](_0x392c8d));_0x1658cd(_0x392c8d);})['catch'](function(_0x4e6716){logger[_0x3448('0x13')](_0x3448('0x17'),_0x4e6716['message'],_0x425514);_0x5b410d(_0x4a348c['error'](0x1f4,_0x4e6716[_0x3448('0x14')]));});});}; \ No newline at end of file +var _0xe5b5=['jayson/promise','client','http','request','then','info','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperFinal,\x20%s,\x20%s','message','result','catch','CreateCmHopperFinal','CmHopperFinal','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x560154,_0x1946f2){var _0xfb2c95=function(_0x27db61){while(--_0x27db61){_0x560154['push'](_0x560154['shift']());}};_0xfb2c95(++_0x1946f2);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xe5b5[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var moment=require(_0x5e5b('0x2'));var BPromise=require(_0x5e5b('0x3'));var rs=require(_0x5e5b('0x4'));var fs=require('fs');var Redis=require(_0x5e5b('0x5'));var db=require(_0x5e5b('0x6'))['db'];var utils=require(_0x5e5b('0x7'));var logger=require(_0x5e5b('0x8'))(_0x5e5b('0x9'));var config=require(_0x5e5b('0xa'));var jayson=require(_0x5e5b('0xb'));var client=jayson[_0x5e5b('0xc')][_0x5e5b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x545eb3,_0x29db2c,_0xe089b1){return new BPromise(function(_0xcbd478,_0x258414){return client[_0x5e5b('0xe')](_0x545eb3,_0xe089b1)[_0x5e5b('0xf')](function(_0x3a37db){logger[_0x5e5b('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x29db2c,_0x5e5b('0x11'));logger['debug'](_0x5e5b('0x12'),_0x29db2c,_0x5e5b('0x11'),JSON[_0x5e5b('0x13')](_0x3a37db));if(_0x3a37db[_0x5e5b('0x14')]){if(_0x3a37db['error']['code']===0x1f4){logger['error'](_0x5e5b('0x15'),_0x29db2c,_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);return _0x258414(_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);}logger[_0x5e5b('0x14')](_0x5e5b('0x15'),_0x29db2c,_0x3a37db['error'][_0x5e5b('0x16')]);return _0xcbd478(_0x3a37db[_0x5e5b('0x14')]['message']);}else{logger[_0x5e5b('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x29db2c,'request\x20sent');_0xcbd478(_0x3a37db[_0x5e5b('0x17')][_0x5e5b('0x16')]);}})[_0x5e5b('0x18')](function(_0x5c7148){logger[_0x5e5b('0x14')]('CmHopperFinal,\x20%s,\x20%s',_0x29db2c,_0x5c7148);_0x258414(_0x5c7148);});});}exports[_0x5e5b('0x19')]=function(_0x45a091){var _0x4c5f9a=this;return new Promise(function(_0xe5aa6b,_0x1560e1){return db[_0x5e5b('0x1a')]['create'](_0x45a091[_0x5e5b('0x1b')],{'raw':_0x45a091[_0x5e5b('0x1c')]?_0x45a091['options'][_0x5e5b('0x1d')]===undefined?!![]:![]:!![]})[_0x5e5b('0xf')](function(_0x3c488e){logger[_0x5e5b('0x10')](_0x5e5b('0x19'),_0x45a091);logger[_0x5e5b('0x1e')](_0x5e5b('0x19'),_0x45a091,JSON[_0x5e5b('0x13')](_0x3c488e));_0xe5aa6b(_0x3c488e);})['catch'](function(_0x512e46){logger[_0x5e5b('0x14')](_0x5e5b('0x19'),_0x512e46[_0x5e5b('0x16')],_0x45a091);_0x1560e1(_0x4c5f9a[_0x5e5b('0x14')](0x1f4,_0x512e46[_0x5e5b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index ded035f..081b818 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 _0x9c44=['put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper'];(function(_0x14119e,_0x4f6fc3){var _0x601fb6=function(_0xa4406d){while(--_0xa4406d){_0x14119e['push'](_0x14119e['shift']());}};_0x601fb6(++_0x4f6fc3);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/campaign/countAttributes/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x14')](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x15')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update'];(function(_0x2ed020,_0x4f8bf4){var _0x54ef12=function(_0x42cdcd){while(--_0x42cdcd){_0x2ed020['push'](_0x2ed020['shift']());}};_0x54ef12(++_0x4f8bf4);}(_0x34e8,0x12c));var _0x834e=function(_0x181887,_0x34267c){_0x181887=_0x181887-0x0;var _0x5a912d=_0x34e8[_0x181887];return _0x5a912d;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x9')](_0x834e('0x10'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x834e('0x12')](_0x834e('0x14'),auth['isAuthenticated'](),controller[_0x834e('0x15')]);router[_0x834e('0x12')](_0x834e('0x16'),auth[_0x834e('0xa')](),controller['checkContactHopper']);router[_0x834e('0x17')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index ac822c5..accb157 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 _0x448a=['exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x4d77bc,_0x5eb675){var _0xb2b6d5=function(_0x5b1dfe){while(--_0x5b1dfe){_0x4d77bc['push'](_0x4d77bc['shift']());}};_0xb2b6d5(++_0x5eb675);}(_0x448a,0x1ef));var _0xa448=function(_0x22dd1f,_0x24f856){_0x22dd1f=_0x22dd1f-0x0;var _0x3df220=_0x448a[_0x22dd1f];return _0x3df220;};'use strict';var Sequelize=require('sequelize');module[_0xa448('0x0')]={'state':{'type':Sequelize[_0xa448('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xa448('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa448('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa448('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xa448('0x3')]},'originatecalleridname':{'type':Sequelize[_0xa448('0x3')]},'calleridnum':{'type':Sequelize[_0xa448('0x3')]},'calleridname':{'type':Sequelize[_0xa448('0x3')]},'starttime':{'type':Sequelize[_0xa448('0x2')]},'responsetime':{'type':Sequelize[_0xa448('0x2')]},'answertime':{'type':Sequelize[_0xa448('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xa448('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa448('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa448('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa448('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa448('0x3')]},'campaign':{'type':Sequelize[_0xa448('0x3')]},'campaigntype':{'type':Sequelize[_0xa448('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xa448('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa448('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa448('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa448('0x2')]},'recallme':{'type':Sequelize[_0xa448('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa448('0x2')]},'edited':{'type':Sequelize[_0xa448('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x9829=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x1f2104,_0x3d1a56){var _0x590031=function(_0x16e37d){while(--_0x16e37d){_0x1f2104['push'](_0x1f2104['shift']());}};_0x590031(++_0x3d1a56);}(_0x9829,0xc4));var _0x9982=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0x9829[_0x5dfc2a];return _0x3f1a71;};'use strict';var Sequelize=require(_0x9982('0x0'));module[_0x9982('0x1')]={'state':{'type':Sequelize[_0x9982('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9982('0x3')]},'scheduledat':{'type':Sequelize[_0x9982('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9982('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9982('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9982('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x9982('0x3')]},'originatecalleridname':{'type':Sequelize[_0x9982('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9982('0x4')]},'responsetime':{'type':Sequelize[_0x9982('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x9982('0x4')]},'endtime':{'type':Sequelize[_0x9982('0x4')]},'ringtime':{'type':Sequelize[_0x9982('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9982('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9982('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9982('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9982('0x3')]},'campaign':{'type':Sequelize[_0x9982('0x3')]},'campaigntype':{'type':Sequelize[_0x9982('0x3')]},'membername':{'type':Sequelize[_0x9982('0x3')]},'reason':{'type':Sequelize[_0x9982('0x3')]},'amd':{'type':Sequelize[_0x9982('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9982('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x9982('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9982('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9982('0x4')]},'recallme':{'type':Sequelize[_0x9982('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x9982('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 16337b0..09b4666 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 _0x5c58=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','describe','update','uniqueid','eml-format','rimraf','request-promise','moment','bluebird','util','to-csv','lodash','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','then','destroy','error','stack','name','CmHopperHistory','rawAttributes','model','keys','intersection','query'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x5c58,0x154));var _0x85c5=function(_0x365637,_0x49d954){_0x365637=_0x365637-0x0;var _0x5376a6=_0x5c58[_0x365637];return _0x5376a6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x85c5('0x0'));var rimraf=require(_0x85c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x85c5('0x2'));var moment=require(_0x85c5('0x3'));var BPromise=require(_0x85c5('0x4'));var Mustache=require('mustache');var util=require(_0x85c5('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x85c5('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x85c5('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x85c5('0x8'));var toCsv=require(_0x85c5('0x6'));var querystring=require('querystring');var Papa=require(_0x85c5('0x9'));var authService=require('../../components/auth/service');var hardwareService=require(_0x85c5('0xa'));var Redis=require(_0x85c5('0xb'));var qs=require(_0x85c5('0xc'));var logger=require(_0x85c5('0xd'))('api');var utils=require(_0x85c5('0xe'));var config=require(_0x85c5('0xf'));var db=require(_0x85c5('0x10'))['db'];function respondWithStatusCode(_0x157a96,_0x3e5400){_0x3e5400=_0x3e5400||0xcc;return function(_0x5e167b){if(_0x5e167b){return _0x157a96[_0x85c5('0x11')](_0x3e5400);}return _0x157a96[_0x85c5('0x12')](_0x3e5400)[_0x85c5('0x13')]();};}function respondWithResult(_0xdef972,_0x1c1603){_0x1c1603=_0x1c1603||0xc8;return function(_0x4f5266){if(_0x4f5266){return _0xdef972[_0x85c5('0x12')](_0x1c1603)['json'](_0x4f5266);}};}function respondWithFilteredResult(_0x30cb4b,_0x9c8412){return function(_0x54bd86){if(_0x54bd86){var _0x34fee5=_0x54bd86[_0x85c5('0x14')],_0x168862=_0x9c8412['offset'],_0x4d4b4e=_0x9c8412[_0x85c5('0x15')]+_0x9c8412[_0x85c5('0x16')],_0x542622;if(_0x4d4b4e>=_0x34fee5){_0x4d4b4e=_0x34fee5;_0x542622=0xc8;}else{_0x542622=0xce;}_0x30cb4b[_0x85c5('0x12')](_0x542622);return _0x30cb4b[_0x85c5('0x17')]('Content-Range',_0x168862+'-'+_0x4d4b4e+'/'+_0x34fee5)[_0x85c5('0x18')](_0x54bd86);}return null;};}function patchUpdates(_0x190401){return function(_0xe84bc1){try{jsonpatch[_0x85c5('0x19')](_0xe84bc1,_0x190401,!![]);}catch(_0x468753){return BPromise[_0x85c5('0x1a')](_0x468753);}return _0xe84bc1['save']();};}function saveUpdates(_0x23bb8e,_0x22c17a){return function(_0x1c75db){if(_0x1c75db){return _0x1c75db['update'](_0x23bb8e)[_0x85c5('0x1b')](function(_0x50d4e8){return _0x50d4e8;});}return null;};}function removeEntity(_0x1f67fb,_0x2dd6bf){return function(_0x2c43a8){if(_0x2c43a8){return _0x2c43a8[_0x85c5('0x1c')]()[_0x85c5('0x1b')](function(){_0x1f67fb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a7583,_0x131052){return function(_0x41b9db){if(!_0x41b9db){_0x2a7583[_0x85c5('0x11')](0x194);}return _0x41b9db;};}function handleError(_0x558276,_0x296613){_0x296613=_0x296613||0x1f4;return function(_0xc62b2){logger[_0x85c5('0x1d')](_0xc62b2[_0x85c5('0x1e')]);if(_0xc62b2[_0x85c5('0x1f')]){delete _0xc62b2[_0x85c5('0x1f')];}_0x558276[_0x85c5('0x12')](_0x296613)['send'](_0xc62b2);};}exports['index']=function(_0x3fa2db,_0x428855){var _0xe42bd4={},_0x13465a={},_0x4eaac8={'count':0x0,'rows':[]};var _0x3b714a=db[_0x85c5('0x20')][_0x85c5('0x21')];_0x13465a[_0x85c5('0x22')]=_[_0x85c5('0x23')](_0x3b714a);_0x13465a['query']=_[_0x85c5('0x23')](_0x3fa2db['query']);_0x13465a['filters']=_[_0x85c5('0x24')](_0x13465a[_0x85c5('0x22')],_0x13465a[_0x85c5('0x25')]);_0xe42bd4[_0x85c5('0x26')]=_[_0x85c5('0x24')](_0x13465a['model'],qs[_0x85c5('0x27')](_0x3fa2db[_0x85c5('0x25')][_0x85c5('0x27')]));_0xe42bd4[_0x85c5('0x26')]=_0xe42bd4[_0x85c5('0x26')][_0x85c5('0x28')]?_0xe42bd4[_0x85c5('0x26')]:_0x13465a['model'];if(!_0x3fa2db['query'][_0x85c5('0x29')](_0x85c5('0x2a'))){_0xe42bd4[_0x85c5('0x16')]=qs[_0x85c5('0x16')](_0x3fa2db[_0x85c5('0x25')][_0x85c5('0x16')]);_0xe42bd4[_0x85c5('0x15')]=qs['offset'](_0x3fa2db[_0x85c5('0x25')][_0x85c5('0x15')]);}_0xe42bd4[_0x85c5('0x2b')]=qs['sort'](_0x3fa2db[_0x85c5('0x25')][_0x85c5('0x2c')]);_0xe42bd4[_0x85c5('0x2d')]=qs['filters'](_[_0x85c5('0x2e')](_0x3fa2db['query'],_0x13465a['filters']));if(_0x3fa2db[_0x85c5('0x25')][_0x85c5('0x2f')]){_0xe42bd4[_0x85c5('0x2d')]=_[_0x85c5('0x30')](_0xe42bd4[_0x85c5('0x2d')],{'$or':_[_0x85c5('0x31')](_0x3b714a,function(_0x29621e){if(_0x29621e['type']['key']!==_0x85c5('0x32')){var _0x5d8f95={};_0x5d8f95[_0x29621e['field']]={'$like':'%'+_0x3fa2db[_0x85c5('0x25')][_0x85c5('0x2f')]+'%'};return _0x5d8f95;}})});}_0xe42bd4=_[_0x85c5('0x30')]({},_0xe42bd4,_0x3fa2db[_0x85c5('0x33')]);var _0x2eff3b={'where':_0xe42bd4[_0x85c5('0x2d')]};return db[_0x85c5('0x20')][_0x85c5('0x14')](_0x2eff3b)[_0x85c5('0x1b')](function(_0x471777){_0x4eaac8['count']=_0x471777;if(_0x3fa2db[_0x85c5('0x25')][_0x85c5('0x34')]){_0xe42bd4[_0x85c5('0x35')]=[{'all':!![]}];}return db[_0x85c5('0x20')][_0x85c5('0x36')](_0xe42bd4);})[_0x85c5('0x1b')](function(_0x4dd095){_0x4eaac8[_0x85c5('0x37')]=_0x4dd095;return _0x4eaac8;})[_0x85c5('0x1b')](respondWithFilteredResult(_0x428855,_0xe42bd4))[_0x85c5('0x38')](handleError(_0x428855,null));};exports['show']=function(_0x3ba757,_0x4fe440){var _0x3c77fd={'raw':!![],'where':{'id':_0x3ba757[_0x85c5('0x39')]['id']}},_0x5f0bca={};_0x5f0bca['model']=_[_0x85c5('0x23')](db[_0x85c5('0x20')][_0x85c5('0x21')]);_0x5f0bca['query']=_[_0x85c5('0x23')](_0x3ba757[_0x85c5('0x25')]);_0x5f0bca['filters']=_[_0x85c5('0x24')](_0x5f0bca[_0x85c5('0x22')],_0x5f0bca[_0x85c5('0x25')]);_0x3c77fd[_0x85c5('0x26')]=_[_0x85c5('0x24')](_0x5f0bca[_0x85c5('0x22')],qs['fields'](_0x3ba757[_0x85c5('0x25')][_0x85c5('0x27')]));_0x3c77fd['attributes']=_0x3c77fd[_0x85c5('0x26')][_0x85c5('0x28')]?_0x3c77fd[_0x85c5('0x26')]:_0x5f0bca[_0x85c5('0x22')];if(_0x3ba757[_0x85c5('0x25')][_0x85c5('0x34')]){_0x3c77fd['include']=[{'all':!![]}];}_0x3c77fd=_[_0x85c5('0x30')]({},_0x3c77fd,_0x3ba757[_0x85c5('0x33')]);return db[_0x85c5('0x20')]['find'](_0x3c77fd)[_0x85c5('0x1b')](handleEntityNotFound(_0x4fe440,null))[_0x85c5('0x1b')](respondWithResult(_0x4fe440,null))[_0x85c5('0x38')](handleError(_0x4fe440,null));};exports[_0x85c5('0x3a')]=function(_0x3395ac,_0x12c114){return db['CmHopperHistory']['create'](_0x3395ac[_0x85c5('0x3b')],{})[_0x85c5('0x1b')](respondWithResult(_0x12c114,0xc9))[_0x85c5('0x38')](handleError(_0x12c114,null));};exports[_0x85c5('0x3c')]=function(_0x352c3e,_0x23f8d0){return db[_0x85c5('0x20')]['describe']()['then'](respondWithResult(_0x23f8d0,null))[_0x85c5('0x38')](handleError(_0x23f8d0,null));};exports[_0x85c5('0x3d')]=function(_0x38293f,_0x2bdb3f){if(_0x38293f[_0x85c5('0x3b')][_0x85c5('0x3e')]){delete _0x38293f[_0x85c5('0x3b')][_0x85c5('0x3e')];}return db[_0x85c5('0x20')]['find']({'where':{'uniqueid':_0x38293f[_0x85c5('0x39')]['id']}})[_0x85c5('0x1b')](handleEntityNotFound(_0x2bdb3f,null))[_0x85c5('0x1b')](saveUpdates(_0x38293f['body'],null))['then'](respondWithResult(_0x2bdb3f,null))['catch'](handleError(_0x2bdb3f,null));}; \ No newline at end of file +var _0x0c6d=['status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','index','CmHopperHistory','rawAttributes','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','field','filter','options','includeAll','findAll','catch','show','params','fields','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus'];(function(_0x5c5c82,_0x1b3f57){var _0xdc57d0=function(_0x5cdc70){while(--_0x5cdc70){_0x5c5c82['push'](_0x5c5c82['shift']());}};_0xdc57d0(++_0x1b3f57);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x1fd58e,_0x2d7a70){_0x1fd58e=_0x1fd58e-0x0;var _0x53765b=_0x0c6d[_0x1fd58e];return _0x53765b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd0c6('0x0'));var rimraf=require(_0xd0c6('0x1'));var zipdir=require(_0xd0c6('0x2'));var jsonpatch=require(_0xd0c6('0x3'));var rp=require(_0xd0c6('0x4'));var moment=require(_0xd0c6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd0c6('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd0c6('0x7'));var ejs=require(_0xd0c6('0x8'));var fs=require('fs');var _=require(_0xd0c6('0x9'));var squel=require('squel');var crypto=require(_0xd0c6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd0c6('0xb'));var toCsv=require(_0xd0c6('0x7'));var querystring=require(_0xd0c6('0xc'));var Papa=require(_0xd0c6('0xd'));var authService=require(_0xd0c6('0xe'));var hardwareService=require(_0xd0c6('0xf'));var Redis=require(_0xd0c6('0x10'));var qs=require(_0xd0c6('0x11'));var logger=require(_0xd0c6('0x12'))('api');var utils=require(_0xd0c6('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27ba14,_0x2f2a15){_0x2f2a15=_0x2f2a15||0xcc;return function(_0x19b435){if(_0x19b435){return _0x27ba14[_0xd0c6('0x14')](_0x2f2a15);}return _0x27ba14[_0xd0c6('0x15')](_0x2f2a15)[_0xd0c6('0x16')]();};}function respondWithResult(_0x410d58,_0x38b397){_0x38b397=_0x38b397||0xc8;return function(_0xab9cfc){if(_0xab9cfc){return _0x410d58[_0xd0c6('0x15')](_0x38b397)[_0xd0c6('0x17')](_0xab9cfc);}};}function respondWithFilteredResult(_0x6363c,_0x20de1b){return function(_0x1afb2f){if(_0x1afb2f){var _0x2697b2=_0x1afb2f[_0xd0c6('0x18')],_0x1d79a6=_0x20de1b[_0xd0c6('0x19')],_0x1e45b3=_0x20de1b[_0xd0c6('0x19')]+_0x20de1b[_0xd0c6('0x1a')],_0x429727;if(_0x1e45b3>=_0x2697b2){_0x1e45b3=_0x2697b2;_0x429727=0xc8;}else{_0x429727=0xce;}_0x6363c[_0xd0c6('0x15')](_0x429727);return _0x6363c[_0xd0c6('0x1b')](_0xd0c6('0x1c'),_0x1d79a6+'-'+_0x1e45b3+'/'+_0x2697b2)['json'](_0x1afb2f);}return null;};}function patchUpdates(_0x479d38){return function(_0x17df3f){try{jsonpatch[_0xd0c6('0x1d')](_0x17df3f,_0x479d38,!![]);}catch(_0x4a761a){return BPromise['reject'](_0x4a761a);}return _0x17df3f['save']();};}function saveUpdates(_0x1f5875,_0x45d064){return function(_0x1ebce8){if(_0x1ebce8){return _0x1ebce8[_0xd0c6('0x1e')](_0x1f5875)[_0xd0c6('0x1f')](function(_0x1f664d){return _0x1f664d;});}return null;};}function removeEntity(_0x2a8b29,_0x296347){return function(_0x5f191a){if(_0x5f191a){return _0x5f191a[_0xd0c6('0x20')]()[_0xd0c6('0x1f')](function(){_0x2a8b29['status'](0xcc)[_0xd0c6('0x16')]();});}};}function handleEntityNotFound(_0x2251e0,_0x3b437d){return function(_0x5d9baa){if(!_0x5d9baa){_0x2251e0['sendStatus'](0x194);}return _0x5d9baa;};}function handleError(_0x3235b3,_0x25a075){_0x25a075=_0x25a075||0x1f4;return function(_0x50cb93){logger[_0xd0c6('0x21')](_0x50cb93[_0xd0c6('0x22')]);if(_0x50cb93['name']){delete _0x50cb93[_0xd0c6('0x23')];}_0x3235b3['status'](_0x25a075)['send'](_0x50cb93);};}exports[_0xd0c6('0x24')]=function(_0x15150d,_0x48055f){var _0x414124={},_0x4368fa={},_0x3802af={'count':0x0,'rows':[]};var _0x38d411=db[_0xd0c6('0x25')][_0xd0c6('0x26')];_0x4368fa[_0xd0c6('0x27')]=_['keys'](_0x38d411);_0x4368fa[_0xd0c6('0x28')]=_[_0xd0c6('0x29')](_0x15150d[_0xd0c6('0x28')]);_0x4368fa[_0xd0c6('0x2a')]=_[_0xd0c6('0x2b')](_0x4368fa[_0xd0c6('0x27')],_0x4368fa[_0xd0c6('0x28')]);_0x414124[_0xd0c6('0x2c')]=_[_0xd0c6('0x2b')](_0x4368fa[_0xd0c6('0x27')],qs['fields'](_0x15150d[_0xd0c6('0x28')]['fields']));_0x414124[_0xd0c6('0x2c')]=_0x414124[_0xd0c6('0x2c')][_0xd0c6('0x2d')]?_0x414124[_0xd0c6('0x2c')]:_0x4368fa['model'];if(!_0x15150d['query'][_0xd0c6('0x2e')]('nolimit')){_0x414124[_0xd0c6('0x1a')]=qs[_0xd0c6('0x1a')](_0x15150d[_0xd0c6('0x28')][_0xd0c6('0x1a')]);_0x414124['offset']=qs[_0xd0c6('0x19')](_0x15150d[_0xd0c6('0x28')][_0xd0c6('0x19')]);}_0x414124[_0xd0c6('0x2f')]=qs[_0xd0c6('0x30')](_0x15150d[_0xd0c6('0x28')][_0xd0c6('0x30')]);_0x414124[_0xd0c6('0x31')]=qs['filters'](_[_0xd0c6('0x32')](_0x15150d[_0xd0c6('0x28')],_0x4368fa[_0xd0c6('0x2a')]));if(_0x15150d[_0xd0c6('0x28')]['filter']){_0x414124[_0xd0c6('0x31')]=_[_0xd0c6('0x33')](_0x414124['where'],{'$or':_['map'](_0x38d411,function(_0x5a2243){if(_0x5a2243[_0xd0c6('0x34')]['key']!==_0xd0c6('0x35')){var _0x423b4d={};_0x423b4d[_0x5a2243[_0xd0c6('0x36')]]={'$like':'%'+_0x15150d[_0xd0c6('0x28')][_0xd0c6('0x37')]+'%'};return _0x423b4d;}})});}_0x414124=_[_0xd0c6('0x33')]({},_0x414124,_0x15150d[_0xd0c6('0x38')]);var _0x204eef={'where':_0x414124[_0xd0c6('0x31')]};return db['CmHopperHistory'][_0xd0c6('0x18')](_0x204eef)[_0xd0c6('0x1f')](function(_0x297540){_0x3802af[_0xd0c6('0x18')]=_0x297540;if(_0x15150d['query'][_0xd0c6('0x39')]){_0x414124['include']=[{'all':!![]}];}return db[_0xd0c6('0x25')][_0xd0c6('0x3a')](_0x414124);})['then'](function(_0x569c86){_0x3802af['rows']=_0x569c86;return _0x3802af;})[_0xd0c6('0x1f')](respondWithFilteredResult(_0x48055f,_0x414124))[_0xd0c6('0x3b')](handleError(_0x48055f,null));};exports[_0xd0c6('0x3c')]=function(_0x230dc3,_0x56bcb6){var _0x52259f={'raw':!![],'where':{'id':_0x230dc3[_0xd0c6('0x3d')]['id']}},_0x1835db={};_0x1835db[_0xd0c6('0x27')]=_['keys'](db[_0xd0c6('0x25')]['rawAttributes']);_0x1835db[_0xd0c6('0x28')]=_[_0xd0c6('0x29')](_0x230dc3[_0xd0c6('0x28')]);_0x1835db[_0xd0c6('0x2a')]=_[_0xd0c6('0x2b')](_0x1835db[_0xd0c6('0x27')],_0x1835db['query']);_0x52259f['attributes']=_[_0xd0c6('0x2b')](_0x1835db[_0xd0c6('0x27')],qs[_0xd0c6('0x3e')](_0x230dc3['query'][_0xd0c6('0x3e')]));_0x52259f[_0xd0c6('0x2c')]=_0x52259f[_0xd0c6('0x2c')]['length']?_0x52259f[_0xd0c6('0x2c')]:_0x1835db[_0xd0c6('0x27')];if(_0x230dc3[_0xd0c6('0x28')][_0xd0c6('0x39')]){_0x52259f['include']=[{'all':!![]}];}_0x52259f=_[_0xd0c6('0x33')]({},_0x52259f,_0x230dc3['options']);return db[_0xd0c6('0x25')]['find'](_0x52259f)[_0xd0c6('0x1f')](handleEntityNotFound(_0x56bcb6,null))[_0xd0c6('0x1f')](respondWithResult(_0x56bcb6,null))['catch'](handleError(_0x56bcb6,null));};exports[_0xd0c6('0x3f')]=function(_0x207c7a,_0x4eda8a){return db[_0xd0c6('0x25')][_0xd0c6('0x3f')](_0x207c7a[_0xd0c6('0x40')],{})[_0xd0c6('0x1f')](respondWithResult(_0x4eda8a,0xc9))['catch'](handleError(_0x4eda8a,null));};exports[_0xd0c6('0x41')]=function(_0x373fcb,_0x5d0ffd){return db['CmHopperHistory'][_0xd0c6('0x41')]()['then'](respondWithResult(_0x5d0ffd,null))[_0xd0c6('0x3b')](handleError(_0x5d0ffd,null));};exports[_0xd0c6('0x1e')]=function(_0x4113f2,_0x16170c){if(_0x4113f2[_0xd0c6('0x40')][_0xd0c6('0x42')]){delete _0x4113f2[_0xd0c6('0x40')][_0xd0c6('0x42')];}return db[_0xd0c6('0x25')]['find']({'where':{'uniqueid':_0x4113f2[_0xd0c6('0x3d')]['id']}})['then'](handleEntityNotFound(_0x16170c,null))[_0xd0c6('0x1f')](saveUpdates(_0x4113f2[_0xd0c6('0x40')],null))[_0xd0c6('0x1f')](respondWithResult(_0x16170c,null))[_0xd0c6('0x3b')](handleError(_0x16170c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 27e9556..ff903e9 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 _0xbaf4=['lodash','util','../../config/logger','moment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0xbaf4,0x108));var _0x4baf=function(_0xc608c,_0x2b22b5){_0xc608c=_0xc608c-0x0;var _0x23ec68=_0xbaf4[_0xc608c];return _0x23ec68;};'use strict';var _=require(_0x4baf('0x0'));var util=require(_0x4baf('0x1'));var logger=require(_0x4baf('0x2'))('api');var moment=require(_0x4baf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x4baf('0x4'));module[_0x4baf('0x5')]=function(_0x3097c6,_0x33c142){return _0x3097c6[_0x4baf('0x6')](_0x4baf('0x7'),attributes,{'tableName':_0x4baf('0x8'),'paranoid':![],'indexes':[{'name':_0x4baf('0x9'),'fields':[_0x4baf('0x9')]},{'name':_0x4baf('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4ee=['exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','./cmHopperHistory.attributes'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc4ee,0xf0));var _0xec4e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4ee[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xec4e('0x0'));var logger=require(_0xec4e('0x1'))(_0xec4e('0x2'));var moment=require(_0xec4e('0x3'));var BPromise=require(_0xec4e('0x4'));var rp=require(_0xec4e('0x5'));var attributes=require(_0xec4e('0x6'));module[_0xec4e('0x7')]=function(_0x3ba8a3,_0x323cc0){return _0x3ba8a3[_0xec4e('0x8')](_0xec4e('0x9'),attributes,{'tableName':_0xec4e('0xa'),'paranoid':![],'indexes':[{'name':_0xec4e('0xb'),'fields':[_0xec4e('0xb')]},{'name':_0xec4e('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 1545e14..fecba41 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 _0xd243=['predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','stringify','AvgHandleTime','findAll','where','COUNT','col','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd243,0xaa));var _0x3d24=function(_0x1a8fad,_0x5f01ee){_0x1a8fad=_0x1a8fad-0x0;var _0x3fac4c=_0xd243[_0x1a8fad];return _0x3fac4c;};'use strict';var _=require(_0x3d24('0x0'));var util=require('util');var moment=require(_0x3d24('0x1'));var BPromise=require(_0x3d24('0x2'));var rs=require(_0x3d24('0x3'));var fs=require('fs');var Redis=require(_0x3d24('0x4'));var db=require(_0x3d24('0x5'))['db'];var utils=require(_0x3d24('0x6'));var logger=require(_0x3d24('0x7'))(_0x3d24('0x8'));var config=require(_0x3d24('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3d24('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x578d73,_0x14310e,_0x160724){return new BPromise(function(_0x1d12a2,_0x242763){return client[_0x3d24('0xb')](_0x578d73,_0x160724)['then'](function(_0x3e3bf0){logger[_0x3d24('0xc')](_0x3d24('0xd'),_0x14310e,'request\x20sent');logger[_0x3d24('0xe')](_0x3d24('0xf'),_0x14310e,_0x3d24('0x10'),JSON['stringify'](_0x3e3bf0));if(_0x3e3bf0[_0x3d24('0x11')]){if(_0x3e3bf0[_0x3d24('0x11')][_0x3d24('0x12')]===0x1f4){logger[_0x3d24('0x11')](_0x3d24('0xd'),_0x14310e,_0x3e3bf0[_0x3d24('0x11')][_0x3d24('0x13')]);return _0x242763(_0x3e3bf0[_0x3d24('0x11')][_0x3d24('0x13')]);}logger['error'](_0x3d24('0xd'),_0x14310e,_0x3e3bf0[_0x3d24('0x11')][_0x3d24('0x13')]);return _0x1d12a2(_0x3e3bf0['error'][_0x3d24('0x13')]);}else{logger[_0x3d24('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x14310e,_0x3d24('0x10'));_0x1d12a2(_0x3e3bf0[_0x3d24('0x14')][_0x3d24('0x13')]);}})[_0x3d24('0x15')](function(_0x3773bc){logger['error'](_0x3d24('0xd'),_0x14310e,_0x3773bc);_0x242763(_0x3773bc);});});}exports[_0x3d24('0x16')]=function(_0x164e90){var _0x4d014a=this;return new Promise(function(_0xec4088,_0x46860c){return db[_0x3d24('0x17')][_0x3d24('0x18')](_0x164e90[_0x3d24('0x19')],{'raw':_0x164e90[_0x3d24('0x1a')]?_0x164e90[_0x3d24('0x1a')][_0x3d24('0x1b')]===undefined?!![]:![]:!![]})[_0x3d24('0x1c')](function(_0x4db59b){logger[_0x3d24('0xc')](_0x3d24('0x16'),_0x164e90);logger[_0x3d24('0xe')](_0x3d24('0x16'),_0x164e90,JSON[_0x3d24('0x1d')](_0x4db59b));_0xec4088(_0x4db59b);})[_0x3d24('0x15')](function(_0x53c0dc){logger[_0x3d24('0x11')]('CreateCmHopperHistory',_0x53c0dc[_0x3d24('0x13')],_0x164e90);_0x46860c(_0x4d014a[_0x3d24('0x11')](0x1f4,_0x53c0dc['message']));});});};exports[_0x3d24('0x1e')]=function(_0x1f0b19){var _0x259fc1=this;return new Promise(function(_0x55b28d,_0x33d91d){return db[_0x3d24('0x17')][_0x3d24('0x1f')]({'raw':_0x1f0b19['options']?_0x1f0b19['options'][_0x3d24('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f0b19[_0x3d24('0x1a')]?_0x1f0b19['options'][_0x3d24('0x20')]||null:null,'attributes':[[db['sequelize']['fn'](_0x3d24('0x21'),db['sequelize'][_0x3d24('0x22')]('id')),'predictiveIntervalTotalCalls'],[db[_0x3d24('0x23')]['fn']('COUNT',db[_0x3d24('0x23')]['fn']('IF',db['sequelize'][_0x3d24('0x24')](_0x3d24('0x25')))),_0x3d24('0x26')],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db[_0x3d24('0x23')]['fn']('IF',db[_0x3d24('0x23')]['literal'](_0x3d24('0x27')))),_0x3d24('0x28')],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db['sequelize']['fn']('IF',db[_0x3d24('0x23')][_0x3d24('0x24')](_0x3d24('0x29')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x3d24('0x23')]['fn']('AVG',db[_0x3d24('0x23')]['fn']('IF',db[_0x3d24('0x23')][_0x3d24('0x24')](_0x3d24('0x2a')))),_0x3d24('0x2b')],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x2c'),db['sequelize']['fn']('IF',db[_0x3d24('0x23')]['literal'](_0x3d24('0x2d')))),_0x3d24('0x2e')]]})[_0x3d24('0x1c')](function(_0x58d574){logger[_0x3d24('0xc')](_0x3d24('0x1e'),_0x1f0b19);logger[_0x3d24('0xe')](_0x3d24('0x1e'),_0x1f0b19,JSON[_0x3d24('0x1d')](_0x58d574));_0x55b28d(_0x58d574);})[_0x3d24('0x15')](function(_0x52ba0a){logger[_0x3d24('0x11')](_0x3d24('0x1e'),_0x52ba0a[_0x3d24('0x13')],_0x1f0b19);_0x33d91d(_0x259fc1[_0x3d24('0x11')](0x1f4,_0x52ba0a[_0x3d24('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x23312a){var _0x371fd3=this;return new Promise(function(_0x54f73a,_0x5e6fa2){return db[_0x3d24('0x17')][_0x3d24('0x1f')]({'raw':_0x23312a[_0x3d24('0x1a')]?_0x23312a[_0x3d24('0x1a')][_0x3d24('0x1b')]===undefined?!![]:![]:!![],'where':_0x23312a[_0x3d24('0x1a')]?_0x23312a[_0x3d24('0x1a')][_0x3d24('0x20')]||null:null,'attributes':[['campaign',_0x3d24('0x2f')],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db[_0x3d24('0x23')]['fn']('IF',db[_0x3d24('0x23')]['literal'](_0x3d24('0x30')))),_0x3d24('0x31')],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x3d24('0x32')],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db['sequelize']['fn']('IF',db[_0x3d24('0x23')][_0x3d24('0x24')](_0x3d24('0x25')))),_0x3d24('0x33')],[db['sequelize']['fn'](_0x3d24('0x21'),db[_0x3d24('0x23')]['fn']('IF',db[_0x3d24('0x23')][_0x3d24('0x24')](_0x3d24('0x34')))),_0x3d24('0x35')],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db[_0x3d24('0x23')]['fn']('IF',db[_0x3d24('0x23')][_0x3d24('0x24')]('`state`\x20=\x208,\x201,\x20null'))),_0x3d24('0x36')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3d24('0x23')][_0x3d24('0x24')](_0x3d24('0x37')))),_0x3d24('0x38')],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db['sequelize']['fn']('IF',db[_0x3d24('0x23')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x3d24('0x39')],[db[_0x3d24('0x23')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x3d24('0x24')](_0x3d24('0x3a')))),'outboundUnknownCallsDay'],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db[_0x3d24('0x23')]['fn']('IF',db[_0x3d24('0x23')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x3d24('0x3b')],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db['sequelize']['fn']('IF',db[_0x3d24('0x23')][_0x3d24('0x24')]('`state`\x20=\x2014,\x201,\x20null'))),_0x3d24('0x3c')],[db['sequelize']['fn'](_0x3d24('0x21'),db[_0x3d24('0x23')]['fn']('IF',db[_0x3d24('0x23')]['literal'](_0x3d24('0x3d')))),'outboundRejectCallsDay'],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db[_0x3d24('0x23')]['fn']('IF',db['sequelize'][_0x3d24('0x24')](_0x3d24('0x3e')))),'outboundAnswerAgiCallsDay'],[db[_0x3d24('0x23')]['fn']('COUNT',db[_0x3d24('0x23')]['fn']('IF',db[_0x3d24('0x23')]['literal'](_0x3d24('0x3f')))),_0x3d24('0x40')],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db[_0x3d24('0x23')]['fn']('IF',db[_0x3d24('0x23')][_0x3d24('0x24')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x3d24('0x41')]],'group':[_0x3d24('0x42')]})['then'](function(_0x3f5888){logger[_0x3d24('0xc')](_0x3d24('0x43'),_0x23312a);logger[_0x3d24('0xe')]('GetVoiceQueueHopperHistory',_0x23312a,JSON['stringify'](_0x3f5888));_0x54f73a(_0x3f5888);})[_0x3d24('0x15')](function(_0x192dde){logger[_0x3d24('0x11')](_0x3d24('0x43'),_0x192dde['message'],_0x23312a);_0x5e6fa2(_0x371fd3[_0x3d24('0x11')](0x1f4,_0x192dde[_0x3d24('0x13')]));});});};exports[_0x3d24('0x44')]=function(_0x2a94ad){var _0x2b0870=this;return new Promise(function(_0x1f5635,_0x57caea){return db[_0x3d24('0x17')][_0x3d24('0x1f')]({'raw':_0x2a94ad[_0x3d24('0x1a')]?_0x2a94ad[_0x3d24('0x1a')][_0x3d24('0x1b')]===undefined?!![]:![]:!![],'where':_0x2a94ad[_0x3d24('0x1a')]?_0x2a94ad['options'][_0x3d24('0x20')]||null:null,'attributes':[[_0x3d24('0x42'),'name'],[db[_0x3d24('0x23')]['fn'](_0x3d24('0x21'),db[_0x3d24('0x23')][_0x3d24('0x22')]('id')),_0x3d24('0x45')],[db[_0x3d24('0x23')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3d24('0x23')][_0x3d24('0x24')](_0x3d24('0x25')))),_0x3d24('0x46')]],'group':[_0x3d24('0x42')]})[_0x3d24('0x1c')](function(_0x4405f6){logger[_0x3d24('0xc')]('GetCampaignHopperHistory',_0x2a94ad);logger[_0x3d24('0xe')](_0x3d24('0x44'),_0x2a94ad,JSON[_0x3d24('0x1d')](_0x4405f6));_0x1f5635(_0x4405f6);})[_0x3d24('0x15')](function(_0x5f5bfb){logger[_0x3d24('0x11')](_0x3d24('0x44'),_0x5f5bfb[_0x3d24('0x13')],_0x2a94ad);_0x57caea(_0x2b0870[_0x3d24('0x11')](0x1f4,_0x5f5bfb[_0x3d24('0x13')]));});});}; \ No newline at end of file +var _0x5566=['predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','where','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateCmHopperHistory','CmHopperHistory','create','options','AvgHandleTime','findAll','raw','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x5566,0x179));var _0x6556=function(_0x58c007,_0x4147a4){_0x58c007=_0x58c007-0x0;var _0x362e05=_0x5566[_0x58c007];return _0x362e05;};'use strict';var _=require(_0x6556('0x0'));var util=require('util');var moment=require(_0x6556('0x1'));var BPromise=require(_0x6556('0x2'));var rs=require(_0x6556('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6556('0x4'))['db'];var utils=require(_0x6556('0x5'));var logger=require('../../config/logger')(_0x6556('0x6'));var config=require(_0x6556('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6556('0x8')][_0x6556('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfd376a,_0x55c99d,_0x2d5063){return new BPromise(function(_0x35d991,_0x51659b){return client[_0x6556('0xa')](_0xfd376a,_0x2d5063)[_0x6556('0xb')](function(_0x4ad16f){logger['info'](_0x6556('0xc'),_0x55c99d,_0x6556('0xd'));logger[_0x6556('0xe')](_0x6556('0xf'),_0x55c99d,_0x6556('0xd'),JSON[_0x6556('0x10')](_0x4ad16f));if(_0x4ad16f[_0x6556('0x11')]){if(_0x4ad16f[_0x6556('0x11')][_0x6556('0x12')]===0x1f4){logger[_0x6556('0x11')](_0x6556('0xc'),_0x55c99d,_0x4ad16f['error'][_0x6556('0x13')]);return _0x51659b(_0x4ad16f['error'][_0x6556('0x13')]);}logger[_0x6556('0x11')](_0x6556('0xc'),_0x55c99d,_0x4ad16f[_0x6556('0x11')][_0x6556('0x13')]);return _0x35d991(_0x4ad16f['error'][_0x6556('0x13')]);}else{logger[_0x6556('0x14')](_0x6556('0xc'),_0x55c99d,'request\x20sent');_0x35d991(_0x4ad16f['result'][_0x6556('0x13')]);}})[_0x6556('0x15')](function(_0x12962b){logger[_0x6556('0x11')](_0x6556('0xc'),_0x55c99d,_0x12962b);_0x51659b(_0x12962b);});});}exports[_0x6556('0x16')]=function(_0x2cbd0e){var _0x4cbe0c=this;return new Promise(function(_0x21d6e6,_0x565d52){return db[_0x6556('0x17')][_0x6556('0x18')](_0x2cbd0e['body'],{'raw':_0x2cbd0e[_0x6556('0x19')]?_0x2cbd0e[_0x6556('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x6556('0xb')](function(_0x3438aa){logger[_0x6556('0x14')](_0x6556('0x16'),_0x2cbd0e);logger[_0x6556('0xe')](_0x6556('0x16'),_0x2cbd0e,JSON['stringify'](_0x3438aa));_0x21d6e6(_0x3438aa);})['catch'](function(_0x34bff7){logger[_0x6556('0x11')](_0x6556('0x16'),_0x34bff7['message'],_0x2cbd0e);_0x565d52(_0x4cbe0c[_0x6556('0x11')](0x1f4,_0x34bff7['message']));});});};exports[_0x6556('0x1a')]=function(_0x1a7ced){var _0x5dcee0=this;return new Promise(function(_0xc45e5c,_0x2c0aac){return db[_0x6556('0x17')][_0x6556('0x1b')]({'raw':_0x1a7ced[_0x6556('0x19')]?_0x1a7ced[_0x6556('0x19')][_0x6556('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a7ced[_0x6556('0x19')]?_0x1a7ced[_0x6556('0x19')]['where']||null:null,'attributes':[[db[_0x6556('0x1d')]['fn'](_0x6556('0x1e'),db[_0x6556('0x1d')][_0x6556('0x1f')]('id')),_0x6556('0x20')],[db['sequelize']['fn'](_0x6556('0x1e'),db[_0x6556('0x1d')]['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')](_0x6556('0x22')))),_0x6556('0x23')],[db[_0x6556('0x1d')]['fn'](_0x6556('0x1e'),db[_0x6556('0x1d')]['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')](_0x6556('0x24')))),_0x6556('0x25')],[db['sequelize']['fn']('COUNT',db[_0x6556('0x1d')]['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')](_0x6556('0x26')))),_0x6556('0x27')],[db[_0x6556('0x1d')]['fn'](_0x6556('0x28'),db[_0x6556('0x1d')]['fn']('IF',db[_0x6556('0x1d')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x6556('0x29')],[db[_0x6556('0x1d')]['fn'](_0x6556('0x28'),db['sequelize']['fn']('IF',db[_0x6556('0x1d')]['literal'](_0x6556('0x2a')))),_0x6556('0x2b')]]})[_0x6556('0xb')](function(_0x375357){logger[_0x6556('0x14')](_0x6556('0x1a'),_0x1a7ced);logger[_0x6556('0xe')](_0x6556('0x1a'),_0x1a7ced,JSON[_0x6556('0x10')](_0x375357));_0xc45e5c(_0x375357);})[_0x6556('0x15')](function(_0x19904a){logger['error']('AvgHandleTime',_0x19904a[_0x6556('0x13')],_0x1a7ced);_0x2c0aac(_0x5dcee0['error'](0x1f4,_0x19904a['message']));});});};exports[_0x6556('0x2c')]=function(_0x586e0a){var _0x21fd30=this;return new Promise(function(_0x59a48a,_0x3ecdbd){return db[_0x6556('0x17')][_0x6556('0x1b')]({'raw':_0x586e0a[_0x6556('0x19')]?_0x586e0a[_0x6556('0x19')][_0x6556('0x1c')]===undefined?!![]:![]:!![],'where':_0x586e0a['options']?_0x586e0a['options']['where']||null:null,'attributes':[[_0x6556('0x2d'),_0x6556('0x2e')],[db['sequelize']['fn'](_0x6556('0x1e'),db[_0x6556('0x1d')]['fn']('IF',db['sequelize'][_0x6556('0x21')](_0x6556('0x2f')))),_0x6556('0x30')],[db['sequelize']['fn'](_0x6556('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x6556('0x21')](_0x6556('0x31')))),_0x6556('0x32')],[db[_0x6556('0x1d')]['fn'](_0x6556('0x1e'),db[_0x6556('0x1d')]['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')](_0x6556('0x22')))),_0x6556('0x33')],[db[_0x6556('0x1d')]['fn'](_0x6556('0x1e'),db[_0x6556('0x1d')]['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0x6556('0x34')],[db['sequelize']['fn'](_0x6556('0x1e'),db[_0x6556('0x1d')]['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')](_0x6556('0x35')))),_0x6556('0x36')],[db['sequelize']['fn'](_0x6556('0x1e'),db[_0x6556('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x6556('0x37')))),_0x6556('0x38')],[db[_0x6556('0x1d')]['fn'](_0x6556('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x6556('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x6556('0x1d')]['fn'](_0x6556('0x1e'),db['sequelize']['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),_0x6556('0x39')],[db[_0x6556('0x1d')]['fn'](_0x6556('0x1e'),db['sequelize']['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),_0x6556('0x3a')],[db['sequelize']['fn'](_0x6556('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x6556('0x21')](_0x6556('0x3b')))),_0x6556('0x3c')],[db[_0x6556('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')](_0x6556('0x3d')))),'outboundRejectCallsDay'],[db[_0x6556('0x1d')]['fn'](_0x6556('0x1e'),db['sequelize']['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')](_0x6556('0x3e')))),_0x6556('0x3f')],[db[_0x6556('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')](_0x6556('0x40')))),'outboundRejectCallsDay'],[db[_0x6556('0x1d')]['fn'](_0x6556('0x1e'),db[_0x6556('0x1d')]['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x6556('0x41')]],'group':[_0x6556('0x2d')]})[_0x6556('0xb')](function(_0x289bdf){logger[_0x6556('0x14')](_0x6556('0x2c'),_0x586e0a);logger[_0x6556('0xe')](_0x6556('0x2c'),_0x586e0a,JSON[_0x6556('0x10')](_0x289bdf));_0x59a48a(_0x289bdf);})[_0x6556('0x15')](function(_0x2b47f3){logger[_0x6556('0x11')](_0x6556('0x2c'),_0x2b47f3[_0x6556('0x13')],_0x586e0a);_0x3ecdbd(_0x21fd30[_0x6556('0x11')](0x1f4,_0x2b47f3['message']));});});};exports['GetCampaignHopperHistory']=function(_0x4d466a){var _0x340bab=this;return new Promise(function(_0x33396e,_0xcbd509){return db['CmHopperHistory'][_0x6556('0x1b')]({'raw':_0x4d466a[_0x6556('0x19')]?_0x4d466a[_0x6556('0x19')][_0x6556('0x1c')]===undefined?!![]:![]:!![],'where':_0x4d466a[_0x6556('0x19')]?_0x4d466a[_0x6556('0x19')][_0x6556('0x42')]||null:null,'attributes':[[_0x6556('0x2d'),_0x6556('0x2e')],[db['sequelize']['fn']('COUNT',db['sequelize']['col']('id')),'ivrTotalCallsDays'],[db[_0x6556('0x1d')]['fn'](_0x6556('0x1e'),db[_0x6556('0x1d')]['fn']('IF',db[_0x6556('0x1d')][_0x6556('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x6556('0x43')]],'group':[_0x6556('0x2d')]})[_0x6556('0xb')](function(_0x3df647){logger[_0x6556('0x14')](_0x6556('0x44'),_0x4d466a);logger[_0x6556('0xe')](_0x6556('0x44'),_0x4d466a,JSON[_0x6556('0x10')](_0x3df647));_0x33396e(_0x3df647);})[_0x6556('0x15')](function(_0x3ad52c){logger[_0x6556('0x11')](_0x6556('0x44'),_0x3ad52c[_0x6556('0x13')],_0x4d466a);_0xcbd509(_0x340bab[_0x6556('0x11')](0x1f4,_0x3ad52c[_0x6556('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 0541acc..814e735 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 _0x3981=['post','create','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x3e7b06,_0x1b30b2){var _0x32fd58=function(_0xeb4a77){while(--_0xeb4a77){_0x3e7b06['push'](_0x3e7b06['shift']());}};_0x32fd58(++_0x1b30b2);}(_0x3981,0x144));var _0x1398=function(_0x5f0d1e,_0x5224f1){_0x5f0d1e=_0x5f0d1e-0x0;var _0x2f15e5=_0x3981[_0x5f0d1e];return _0x2f15e5;};'use strict';var multer=require(_0x1398('0x0'));var util=require('util');var path=require(_0x1398('0x1'));var timeout=require(_0x1398('0x2'));var express=require(_0x1398('0x3'));var router=express[_0x1398('0x4')]();var auth=require(_0x1398('0x5'));var interaction=require(_0x1398('0x6'));var config=require(_0x1398('0x7'));var controller=require(_0x1398('0x8'));router[_0x1398('0x9')]('/',auth[_0x1398('0xa')](),controller[_0x1398('0xb')]);router['get'](_0x1398('0xc'),auth[_0x1398('0xa')](),controller[_0x1398('0xd')]);router['get'](_0x1398('0xe'),auth[_0x1398('0xa')](),controller[_0x1398('0xf')]);router[_0x1398('0x10')]('/',auth[_0x1398('0xa')](),controller[_0x1398('0x11')]);router['put'](_0x1398('0xe'),auth[_0x1398('0xa')](),controller[_0x1398('0x12')]);module[_0x1398('0x13')]=router; \ No newline at end of file +var _0x52ad=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','exports','multer','util','path'];(function(_0x562220,_0x1587c2){var _0x119ec2=function(_0x26c5f4){while(--_0x26c5f4){_0x562220['push'](_0x562220['shift']());}};_0x119ec2(++_0x1587c2);}(_0x52ad,0x1d8));var _0xd52a=function(_0x401669,_0x6eccc4){_0x401669=_0x401669-0x0;var _0x1c2720=_0x52ad[_0x401669];return _0x1c2720;};'use strict';var multer=require(_0xd52a('0x0'));var util=require(_0xd52a('0x1'));var path=require(_0xd52a('0x2'));var timeout=require(_0xd52a('0x3'));var express=require('express');var router=express[_0xd52a('0x4')]();var auth=require(_0xd52a('0x5'));var interaction=require(_0xd52a('0x6'));var config=require(_0xd52a('0x7'));var controller=require(_0xd52a('0x8'));router[_0xd52a('0x9')]('/',auth[_0xd52a('0xa')](),controller[_0xd52a('0xb')]);router[_0xd52a('0x9')]('/describe',auth[_0xd52a('0xa')](),controller[_0xd52a('0xc')]);router[_0xd52a('0x9')](_0xd52a('0xd'),auth['isAuthenticated'](),controller[_0xd52a('0xe')]);router[_0xd52a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd52a('0x10')](_0xd52a('0xd'),auth[_0xd52a('0xa')](),controller[_0xd52a('0x11')]);module[_0xd52a('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 1c35a2c..6641f20 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 _0x8ef6=['STRING','name','sequelize','exports'];(function(_0x5524a1,_0x37c171){var _0x4ea5e3=function(_0x493ee1){while(--_0x493ee1){_0x5524a1['push'](_0x5524a1['shift']());}};_0x4ea5e3(++_0x37c171);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3cc072,_0x53b06b){_0x3cc072=_0x3cc072-0x0;var _0x512403=_0x8ef6[_0x3cc072];return _0x512403;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'unique':_0x68ef('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x68ef('0x2')]},'dialPrefix':{'type':Sequelize[_0x68ef('0x2')]}}; \ No newline at end of file +var _0x31f0=['STRING','sequelize'];(function(_0x22d72b,_0x112e6d){var _0x35f65f=function(_0x23d67f){while(--_0x23d67f){_0x22d72b['push'](_0x22d72b['shift']());}};_0x35f65f(++_0x112e6d);}(_0x31f0,0xb7));var _0x031f=function(_0x4a8eb7,_0x596c77){_0x4a8eb7=_0x4a8eb7-0x0;var _0x535517=_0x31f0[_0x4a8eb7];return _0x535517;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x031f('0x1')]},'dialPrefix':{'type':Sequelize[_0x031f('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 47e1c98..62c2dee 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 _0xdfba=['index','CmList','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','ListId','rows','removeDispositions','addContacts','CmContact','tags','isArray','omit','ids','success','push','errors','Malformed\x20request\x20syntax','CustomFields','format','cf_%d','raw','getContacts','getContactsCsv','CmCustomField','concat','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','Lists','UserProfileResource','end','stack','name','send'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdfba,0xf7));var _0xadfb=function(_0x3c9c2e,_0x1e7d40){_0x3c9c2e=_0x3c9c2e-0x0;var _0x269196=_0xdfba[_0x3c9c2e];return _0x269196;};'use strict';var pdf=require(_0xadfb('0x0'));var emlformat=require(_0xadfb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xadfb('0x2'));var jsonpatch=require(_0xadfb('0x3'));var rp=require(_0xadfb('0x4'));var moment=require(_0xadfb('0x5'));var BPromise=require(_0xadfb('0x6'));var Mustache=require('mustache');var util=require(_0xadfb('0x7'));var path=require(_0xadfb('0x8'));var sox=require(_0xadfb('0x9'));var csv=require(_0xadfb('0xa'));var ejs=require(_0xadfb('0xb'));var fs=require('fs');var _=require(_0xadfb('0xc'));var squel=require(_0xadfb('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xadfb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xadfb('0xf'));var Papa=require('papaparse');var authService=require(_0xadfb('0x10'));var hardwareService=require(_0xadfb('0x11'));var Redis=require(_0xadfb('0x12'));var qs=require(_0xadfb('0x13'));var logger=require(_0xadfb('0x14'))('api');var utils=require(_0xadfb('0x15'));var config=require('../../config/environment');var db=require(_0xadfb('0x16'))['db'];config[_0xadfb('0x17')]=_[_0xadfb('0x18')](config['redis'],{'host':_0xadfb('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xadfb('0x1a'))[_0xadfb('0x1b')](socket);function respondWithStatusCode(_0xd52b88,_0x40130e){_0x40130e=_0x40130e||0xcc;return function(_0xde80ad){if(_0xde80ad){return _0xd52b88[_0xadfb('0x1c')](_0x40130e);}return _0xd52b88[_0xadfb('0x1d')](_0x40130e)['end']();};}function respondWithResult(_0x4edd6b,_0x2f575a){_0x2f575a=_0x2f575a||0xc8;return function(_0x65a3da){if(_0x65a3da){return _0x4edd6b['status'](_0x2f575a)[_0xadfb('0x1e')](_0x65a3da);}};}function respondWithFilteredResult(_0xd0128,_0x508e84){return function(_0x4d5191){if(_0x4d5191){var _0x2942ac=_0x4d5191[_0xadfb('0x1f')],_0x3cf252=_0x508e84[_0xadfb('0x20')],_0x51081f=_0x508e84[_0xadfb('0x20')]+_0x508e84[_0xadfb('0x21')],_0x1161ae;if(_0x51081f>=_0x2942ac){_0x51081f=_0x2942ac;_0x1161ae=0xc8;}else{_0x1161ae=0xce;}_0xd0128['status'](_0x1161ae);return _0xd0128[_0xadfb('0x22')](_0xadfb('0x23'),_0x3cf252+'-'+_0x51081f+'/'+_0x2942ac)['json'](_0x4d5191);}return null;};}function patchUpdates(_0x3d08a9){return function(_0x4c8784){try{jsonpatch[_0xadfb('0x24')](_0x4c8784,_0x3d08a9,!![]);}catch(_0x4fff12){return BPromise[_0xadfb('0x25')](_0x4fff12);}return _0x4c8784['save']();};}function saveUpdates(_0x4b8f2d,_0x2a42c8){return function(_0x2803a0){if(_0x2803a0){return _0x2803a0[_0xadfb('0x26')](_0x4b8f2d)[_0xadfb('0x27')](function(_0x387896){return _0x387896;});}return null;};}function removeEntity(_0xc70535,_0x1d8026){return function(_0x434120){if(_0x434120){return _0x434120['destroy']()[_0xadfb('0x27')](function(){var _0x5368ce=_0x434120[_0xadfb('0x28')]({'plain':!![]});var _0x2f19dd=_0xadfb('0x29');return db[_0xadfb('0x2a')]['destroy']({'where':{'type':_0x2f19dd,'resourceId':_0x5368ce['id']}})[_0xadfb('0x27')](function(){return _0x434120;});})[_0xadfb('0x27')](function(){_0xc70535[_0xadfb('0x1d')](0xcc)[_0xadfb('0x2b')]();});}};}function handleEntityNotFound(_0x3feafa,_0x4ea570){return function(_0xee8783){if(!_0xee8783){_0x3feafa[_0xadfb('0x1c')](0x194);}return _0xee8783;};}function handleError(_0x2f57a7,_0xe9dbf){_0xe9dbf=_0xe9dbf||0x1f4;return function(_0x344786){logger['error'](_0x344786[_0xadfb('0x2c')]);if(_0x344786[_0xadfb('0x2d')]){delete _0x344786[_0xadfb('0x2d')];}_0x2f57a7['status'](_0xe9dbf)[_0xadfb('0x2e')](_0x344786);};}exports[_0xadfb('0x2f')]=function(_0x5594b5,_0x52cc67){var _0x1f5069={},_0x3ed22f={},_0x26fee3={'count':0x0,'rows':[]};var _0x27fe3a=db[_0xadfb('0x30')][_0xadfb('0x31')];_0x3ed22f[_0xadfb('0x32')]=_[_0xadfb('0x33')](_0x27fe3a);_0x3ed22f['query']=_[_0xadfb('0x33')](_0x5594b5[_0xadfb('0x34')]);_0x3ed22f[_0xadfb('0x35')]=_[_0xadfb('0x36')](_0x3ed22f['model'],_0x3ed22f['query']);_0x1f5069[_0xadfb('0x37')]=_[_0xadfb('0x36')](_0x3ed22f[_0xadfb('0x32')],qs[_0xadfb('0x38')](_0x5594b5[_0xadfb('0x34')][_0xadfb('0x38')]));_0x1f5069[_0xadfb('0x37')]=_0x1f5069['attributes'][_0xadfb('0x39')]?_0x1f5069[_0xadfb('0x37')]:_0x3ed22f[_0xadfb('0x32')];if(!_0x5594b5[_0xadfb('0x34')][_0xadfb('0x3a')]('nolimit')){_0x1f5069['limit']=qs[_0xadfb('0x21')](_0x5594b5[_0xadfb('0x34')][_0xadfb('0x21')]);_0x1f5069['offset']=qs[_0xadfb('0x20')](_0x5594b5[_0xadfb('0x34')][_0xadfb('0x20')]);}_0x1f5069[_0xadfb('0x3b')]=qs[_0xadfb('0x3c')](_0x5594b5['query'][_0xadfb('0x3c')]);_0x1f5069[_0xadfb('0x3d')]=qs[_0xadfb('0x35')](_[_0xadfb('0x3e')](_0x5594b5[_0xadfb('0x34')],_0x3ed22f[_0xadfb('0x35')]));if(_0x5594b5[_0xadfb('0x34')][_0xadfb('0x3f')]){_0x1f5069[_0xadfb('0x3d')]=_[_0xadfb('0x40')](_0x1f5069['where'],{'$or':_[_0xadfb('0x41')](_0x27fe3a,function(_0x571ce8){if(_0x571ce8[_0xadfb('0x42')][_0xadfb('0x43')]!==_0xadfb('0x44')){var _0x144b7={};_0x144b7[_0x571ce8[_0xadfb('0x45')]]={'$like':'%'+_0x5594b5[_0xadfb('0x34')][_0xadfb('0x3f')]+'%'};return _0x144b7;}})});}_0x1f5069=_[_0xadfb('0x40')]({},_0x1f5069,_0x5594b5[_0xadfb('0x46')]);var _0xdec237={'where':_0x1f5069['where']};return db[_0xadfb('0x30')][_0xadfb('0x1f')](_0xdec237)[_0xadfb('0x27')](function(_0x58e2e0){_0x26fee3['count']=_0x58e2e0;if(_0x5594b5[_0xadfb('0x34')]['includeAll']){_0x1f5069[_0xadfb('0x47')]=[{'all':!![]}];}return db[_0xadfb('0x30')][_0xadfb('0x48')](_0x1f5069);})[_0xadfb('0x27')](function(_0x292f5e){_0x26fee3['rows']=_0x292f5e;return _0x26fee3;})[_0xadfb('0x27')](respondWithFilteredResult(_0x52cc67,_0x1f5069))[_0xadfb('0x49')](handleError(_0x52cc67,null));};exports[_0xadfb('0x4a')]=function(_0x58f6e6,_0x565730){var _0x36fb7b={'raw':![],'where':{'id':_0x58f6e6[_0xadfb('0x4b')]['id']}},_0x552aaf={};_0x552aaf[_0xadfb('0x32')]=_[_0xadfb('0x33')](db[_0xadfb('0x30')][_0xadfb('0x31')]);_0x552aaf[_0xadfb('0x34')]=_[_0xadfb('0x33')](_0x58f6e6[_0xadfb('0x34')]);_0x552aaf[_0xadfb('0x35')]=_[_0xadfb('0x36')](_0x552aaf[_0xadfb('0x32')],_0x552aaf['query']);_0x36fb7b[_0xadfb('0x37')]=_[_0xadfb('0x36')](_0x552aaf[_0xadfb('0x32')],qs[_0xadfb('0x38')](_0x58f6e6[_0xadfb('0x34')]['fields']));_0x36fb7b[_0xadfb('0x37')]=_0x36fb7b[_0xadfb('0x37')][_0xadfb('0x39')]?_0x36fb7b[_0xadfb('0x37')]:_0x552aaf[_0xadfb('0x32')];if(_0x58f6e6[_0xadfb('0x34')][_0xadfb('0x4c')]){_0x36fb7b[_0xadfb('0x47')]=[{'all':!![]}];}_0x36fb7b=_[_0xadfb('0x40')]({},_0x36fb7b,_0x58f6e6[_0xadfb('0x46')]);return db[_0xadfb('0x30')][_0xadfb('0x4d')](_0x36fb7b)['then'](handleEntityNotFound(_0x565730,null))['then'](respondWithResult(_0x565730,null))[_0xadfb('0x49')](handleError(_0x565730,null));};exports[_0xadfb('0x4e')]=function(_0x410370,_0x5b30ff){return db[_0xadfb('0x30')][_0xadfb('0x4e')](_0x410370[_0xadfb('0x4f')],{})[_0xadfb('0x27')](function(_0x512420){var _0x3bb823=_0x410370[_0xadfb('0x50')][_0xadfb('0x28')]({'plain':!![]});if(!_0x3bb823)throw new Error(_0xadfb('0x51'));if(_0x3bb823[_0xadfb('0x52')]===_0xadfb('0x50')){var _0x37db12=_0x512420['get']({'plain':!![]});var _0x2877d7=_0xadfb('0x29');return db['UserProfileSection'][_0xadfb('0x4d')]({'where':{'name':_0x2877d7,'userProfileId':_0x3bb823[_0xadfb('0x53')]},'raw':!![]})[_0xadfb('0x27')](function(_0x2ce883){if(_0x2ce883&&_0x2ce883[_0xadfb('0x54')]===0x0){return db[_0xadfb('0x2a')][_0xadfb('0x4e')]({'name':_0x37db12[_0xadfb('0x2d')],'resourceId':_0x37db12['id'],'type':_0x2ce883['name'],'sectionId':_0x2ce883['id']},{})[_0xadfb('0x27')](function(){return _0x512420;});}else{return _0x512420;}})['catch'](function(_0x313eb2){logger[_0xadfb('0x55')](_0xadfb('0x56'),_0x313eb2);throw _0x313eb2;});}return _0x512420;})[_0xadfb('0x27')](respondWithResult(_0x5b30ff,0xc9))[_0xadfb('0x49')](handleError(_0x5b30ff,null));};exports[_0xadfb('0x26')]=function(_0x1b4c04,_0x4256fb){if(_0x1b4c04[_0xadfb('0x4f')]['id']){delete _0x1b4c04[_0xadfb('0x4f')]['id'];}return db[_0xadfb('0x30')][_0xadfb('0x4d')]({'where':{'id':_0x1b4c04[_0xadfb('0x4b')]['id']}})[_0xadfb('0x27')](handleEntityNotFound(_0x4256fb,null))[_0xadfb('0x27')](saveUpdates(_0x1b4c04[_0xadfb('0x4f')],null))[_0xadfb('0x27')](respondWithResult(_0x4256fb,null))[_0xadfb('0x49')](handleError(_0x4256fb,null));};exports['destroy']=function(_0x250b76,_0x400519){return db[_0xadfb('0x30')]['find']({'where':{'id':_0x250b76[_0xadfb('0x4b')]['id']}})[_0xadfb('0x27')](handleEntityNotFound(_0x400519,null))[_0xadfb('0x27')](removeEntity(_0x400519,null))[_0xadfb('0x49')](handleError(_0x400519,null));};exports[_0xadfb('0x57')]=function(_0x64dfe1,_0x5aa835){return db['CmList'][_0xadfb('0x57')]()[_0xadfb('0x27')](respondWithResult(_0x5aa835,null))[_0xadfb('0x49')](handleError(_0x5aa835,null));};exports[_0xadfb('0x58')]=function(_0x1d6dcf,_0x2cb14e,_0x30cb3c){if(_0x1d6dcf['body']['id']){delete _0x1d6dcf['body']['id'];}return db['CmList'][_0xadfb('0x4d')]({'where':{'id':_0x1d6dcf['params']['id']}})['then'](handleEntityNotFound(_0x2cb14e,null))['then'](function(_0x2e3fbe){if(_0x2e3fbe){_0x1d6dcf[_0xadfb('0x4f')]['ListId']=_0x2e3fbe['id'];return db[_0xadfb('0x59')][_0xadfb('0x4e')](_0x1d6dcf['body']);}})[_0xadfb('0x27')](respondWithResult(_0x2cb14e,null))[_0xadfb('0x49')](handleError(_0x2cb14e,null));};exports[_0xadfb('0x5a')]=function(_0x3282d6,_0xd2aca8,_0x3ae610){var _0xd6b514={'raw':![],'where':{}};var _0x35c53a={};var _0x572c24={'count':0x0,'rows':[]};return db[_0xadfb('0x30')][_0xadfb('0x5b')]({'where':{'id':_0x3282d6['params']['id']}})[_0xadfb('0x27')](handleEntityNotFound(_0xd2aca8,null))[_0xadfb('0x27')](function(_0x556158){if(_0x556158){_0x35c53a[_0xadfb('0x32')]=_[_0xadfb('0x33')](db['Disposition'][_0xadfb('0x31')]);_0x35c53a[_0xadfb('0x34')]=_[_0xadfb('0x33')](_0x3282d6[_0xadfb('0x34')]);_0x35c53a['filters']=_[_0xadfb('0x36')](_0x35c53a[_0xadfb('0x32')],_0x35c53a[_0xadfb('0x34')]);_0xd6b514['attributes']=_[_0xadfb('0x36')](_0x35c53a[_0xadfb('0x32')],qs[_0xadfb('0x38')](_0x3282d6[_0xadfb('0x34')][_0xadfb('0x38')]));_0xd6b514[_0xadfb('0x37')]=_0xd6b514[_0xadfb('0x37')][_0xadfb('0x39')]?_0xd6b514[_0xadfb('0x37')]:_0x35c53a['model'];if(!_0x3282d6[_0xadfb('0x34')][_0xadfb('0x3a')](_0xadfb('0x5c'))){_0xd6b514[_0xadfb('0x21')]=qs[_0xadfb('0x21')](_0x3282d6[_0xadfb('0x34')][_0xadfb('0x21')]);_0xd6b514[_0xadfb('0x20')]=qs['offset'](_0x3282d6[_0xadfb('0x34')][_0xadfb('0x20')]);}_0xd6b514['order']=qs[_0xadfb('0x3c')](_0x3282d6[_0xadfb('0x34')][_0xadfb('0x3c')]);_0xd6b514[_0xadfb('0x3d')]=qs['filters'](_[_0xadfb('0x3e')](_0x3282d6[_0xadfb('0x34')],_0x35c53a['filters']));_0xd6b514[_0xadfb('0x3d')][_0xadfb('0x5d')]=_0x556158['id'];if(_0x3282d6[_0xadfb('0x34')][_0xadfb('0x3f')]){_0xd6b514[_0xadfb('0x3d')]=_['merge'](_0xd6b514['where'],{'$or':_[_0xadfb('0x41')](_0xd6b514[_0xadfb('0x37')],function(_0x467a3c){var _0x360f88={};_0x360f88[_0x467a3c]={'$like':'%'+_0x3282d6[_0xadfb('0x34')][_0xadfb('0x3f')]+'%'};return _0x360f88;})});}_0xd6b514=_[_0xadfb('0x40')]({},_0xd6b514,_0x3282d6[_0xadfb('0x46')]);return db[_0xadfb('0x59')]['count']({'where':_0xd6b514[_0xadfb('0x3d')]})['then'](function(_0x17c1a1){_0x572c24[_0xadfb('0x1f')]=_0x17c1a1;if(_0x3282d6[_0xadfb('0x34')][_0xadfb('0x4c')]){_0xd6b514[_0xadfb('0x47')]=[{'all':!![]}];}return db[_0xadfb('0x59')][_0xadfb('0x48')](_0xd6b514);})[_0xadfb('0x27')](function(_0x80a222){_0x572c24[_0xadfb('0x5e')]=_0x80a222;return _0x572c24;});}})[_0xadfb('0x27')](respondWithFilteredResult(_0xd2aca8,_0xd6b514))[_0xadfb('0x49')](handleError(_0xd2aca8,null));};exports['removeDispositions']=function(_0x2d80d8,_0x3536a7,_0x1ca471){var _0x862a3f;return db[_0xadfb('0x30')][_0xadfb('0x4d')]({'where':{'id':_0x2d80d8['params']['id']}})[_0xadfb('0x27')](handleEntityNotFound(_0x3536a7,null))[_0xadfb('0x27')](function(_0x6488e2){if(_0x6488e2){return _0x6488e2[_0xadfb('0x5f')](_0x2d80d8[_0xadfb('0x34')]['ids']);}})[_0xadfb('0x27')](respondWithStatusCode(_0x3536a7,null))[_0xadfb('0x49')](handleError(_0x3536a7,null));};exports[_0xadfb('0x60')]=function(_0x4da286,_0xf50f74,_0x2b3c99){return db[_0xadfb('0x30')][_0xadfb('0x4d')]({'where':{'id':_0x4da286[_0xadfb('0x4b')]['id']}})['then'](handleEntityNotFound(_0xf50f74,null))[_0xadfb('0x27')](function(_0x3d9513){if(_0x3d9513){var _0x22e076=[];var _0x2acccf={'success':[],'errors':[]};return db[_0xadfb('0x61')]['describe']()[_0xadfb('0x27')](function(_0x528a36){if(_0x4da286[_0xadfb('0x4f')][_0xadfb('0x62')]&&_[_0xadfb('0x63')](_0x4da286['body']['tags'])){if(_0x4da286['body'][_0xadfb('0x62')][_0xadfb('0x39')]){_0x4da286[_0xadfb('0x4f')][_0xadfb('0x62')]=_0x4da286['body'][_0xadfb('0x62')]['join'](';')+';';}else{_0x4da286[_0xadfb('0x4f')]['tags']=null;}}else{_0x4da286['body']['tags']=null;}if(_0x4da286['body']&&_[_0xadfb('0x63')](_0x4da286[_0xadfb('0x4f')])){for(var _0x495d6a=0x0;_0x495d6a<_0x4da286[_0xadfb('0x4f')][_0xadfb('0x39')];_0x495d6a+=0x1){_0x4da286['body'][_0x495d6a][_0xadfb('0x5d')]=_0x4da286['params']['id'];_0x22e076['push'](_0x4da286[_0xadfb('0x4f')][_0x495d6a]);}return BPromise['each'](_0x22e076,function(_0x593164){return db[_0xadfb('0x61')][_0xadfb('0x4e')](_[_0xadfb('0x64')](_0x593164,[_0xadfb('0x65'),'id'])||{},{'fields':_[_0xadfb('0x33')](_0x528a36),'raw':!![]})[_0xadfb('0x27')](function(_0xe6c576){_0x2acccf[_0xadfb('0x66')][_0xadfb('0x67')](_0xe6c576['dataValues']);})[_0xadfb('0x49')](function(_0x560154){_0x2acccf[_0xadfb('0x68')][_0xadfb('0x67')]({'data':_0x593164,'error':_0x560154['message']});});})[_0xadfb('0x27')](function(_0x1cd908){return _0x2acccf;})[_0xadfb('0x49')](function(_0x37bc8e){return _0x37bc8e;});}else{_0xf50f74[_0xadfb('0x1d')](0x190)[_0xadfb('0x1e')]({'message':_0xadfb('0x69')});}});}})[_0xadfb('0x27')](respondWithResult(_0xf50f74,null))[_0xadfb('0x49')](handleError(_0xf50f74,null));};exports['getContacts']=function(_0x2add16,_0x2a3042,_0x219618){var _0x4cf219;return db['CmList']['find']({'where':{'id':_0x2add16[_0xadfb('0x4b')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xadfb('0x6a')}]})[_0xadfb('0x27')](handleEntityNotFound(_0x2a3042,null))['then'](function(_0x45d041){if(_0x45d041){_0x4cf219=_0x45d041;return db[_0xadfb('0x61')][_0xadfb('0x31')];}})[_0xadfb('0x27')](function(_0x31b0ca){if(_0x31b0ca){var _0x2a70b8={};var _0x53a82e={};_0x53a82e['model']=_['concat'](_['keys'](_0x31b0ca),_[_0xadfb('0x41')](_0x4cf219[_0xadfb('0x6a')],function(_0x174474){return util[_0xadfb('0x6b')](_0xadfb('0x6c'),_0x174474['id']);}));_0x53a82e['query']=_['keys'](_0x2add16[_0xadfb('0x34')]);_0x53a82e[_0xadfb('0x35')]=_[_0xadfb('0x36')](_0x53a82e[_0xadfb('0x32')],_0x53a82e['query']);_0x2a70b8[_0xadfb('0x37')]=_['intersection'](_0x53a82e[_0xadfb('0x32')],qs[_0xadfb('0x38')](_0x2add16['query']['fields']));_0x2a70b8[_0xadfb('0x37')]=_0x2a70b8[_0xadfb('0x37')][_0xadfb('0x39')]?_0x2a70b8[_0xadfb('0x37')]:_0x53a82e['model'];if(!_0x2add16['query'][_0xadfb('0x3a')](_0xadfb('0x5c'))){_0x2a70b8['limit']=qs['limit'](_0x2add16[_0xadfb('0x34')][_0xadfb('0x21')]);_0x2a70b8['offset']=qs[_0xadfb('0x20')](_0x2add16[_0xadfb('0x34')][_0xadfb('0x20')]);}_0x2a70b8['order']=qs[_0xadfb('0x3c')](_0x2add16[_0xadfb('0x34')]['sort']);_0x2a70b8[_0xadfb('0x3d')]=qs[_0xadfb('0x35')](_['pick'](_0x2add16[_0xadfb('0x34')],_0x53a82e[_0xadfb('0x35')]));_0x2a70b8[_0xadfb('0x6d')]=!![];if(_0x2add16['query'][_0xadfb('0x3f')]){_0x2a70b8['where']=_[_0xadfb('0x40')](_0x2a70b8[_0xadfb('0x3d')],{'$or':_[_0xadfb('0x41')](_0x2a70b8[_0xadfb('0x37')],function(_0x594aae){var _0x324020={};_0x324020[_0x594aae]={'$like':'%'+_0x2add16[_0xadfb('0x34')][_0xadfb('0x3f')]+'%'};return _0x324020;})});}_0x2a70b8=_['merge']({},_0x2a70b8,_0x2add16[_0xadfb('0x46')]);return _0x4cf219[_0xadfb('0x6e')](_0x2a70b8);}})['then'](respondWithResult(_0x2a3042,null))['catch'](handleError(_0x2a3042,null));};exports[_0xadfb('0x6f')]=function(_0x50fe34,_0x159425,_0x266c98){var _0x990106;return db['CmList'][_0xadfb('0x4d')]({'where':{'id':_0x50fe34[_0xadfb('0x4b')]['id']},'include':[{'model':db[_0xadfb('0x70')],'as':_0xadfb('0x6a')}]})[_0xadfb('0x27')](handleEntityNotFound(_0x159425,null))[_0xadfb('0x27')](function(_0x3363fc){if(_0x3363fc){_0x990106=_0x3363fc;return db[_0xadfb('0x61')][_0xadfb('0x31')];}})[_0xadfb('0x27')](function(_0x3ac332){if(_0x3ac332){var _0x43b19f={};var _0x1e1a6d={};_0x1e1a6d[_0xadfb('0x32')]=_[_0xadfb('0x71')](_[_0xadfb('0x33')](_0x3ac332),_['map'](_0x990106[_0xadfb('0x6a')],function(_0x4ee4c0){return util[_0xadfb('0x6b')](_0xadfb('0x6c'),_0x4ee4c0['id']);}));_0x1e1a6d[_0xadfb('0x34')]=_[_0xadfb('0x33')](_0x50fe34['query']);_0x1e1a6d['filters']=_[_0xadfb('0x36')](_0x1e1a6d[_0xadfb('0x32')],_0x1e1a6d[_0xadfb('0x34')]);_0x43b19f[_0xadfb('0x37')]=_[_0xadfb('0x36')](_0x1e1a6d[_0xadfb('0x32')],qs[_0xadfb('0x38')](_0x50fe34[_0xadfb('0x34')][_0xadfb('0x38')]));_0x43b19f[_0xadfb('0x37')]=_0x43b19f[_0xadfb('0x37')]['length']?_0x43b19f['attributes']:_0x1e1a6d[_0xadfb('0x32')];if(!_0x50fe34['query'][_0xadfb('0x3a')]('nolimit')){_0x43b19f[_0xadfb('0x21')]=qs[_0xadfb('0x21')](_0x50fe34[_0xadfb('0x34')][_0xadfb('0x21')]);_0x43b19f[_0xadfb('0x20')]=qs['offset'](_0x50fe34[_0xadfb('0x34')]['offset']);}_0x43b19f[_0xadfb('0x3b')]=qs[_0xadfb('0x3c')](_0x50fe34[_0xadfb('0x34')][_0xadfb('0x3c')]);_0x43b19f[_0xadfb('0x3d')]=qs['filters'](_[_0xadfb('0x3e')](_0x50fe34['query'],_0x1e1a6d[_0xadfb('0x35')]));_0x43b19f['raw']=!![];if(_0x50fe34[_0xadfb('0x34')]['filter']){_0x43b19f[_0xadfb('0x3d')]=_[_0xadfb('0x40')](_0x43b19f[_0xadfb('0x3d')],{'$or':_[_0xadfb('0x41')](_0x43b19f[_0xadfb('0x37')],function(_0x35f18f){var _0x58831c={};_0x58831c[_0x35f18f]={'$like':'%'+_0x50fe34[_0xadfb('0x34')][_0xadfb('0x3f')]+'%'};return _0x58831c;})});}_0x43b19f=_[_0xadfb('0x40')]({},_0x43b19f,_0x50fe34[_0xadfb('0x46')]);return _0x990106[_0xadfb('0x6e')](_0x43b19f);}})[_0xadfb('0x27')](function(_0x4445d0){if(!_[_0xadfb('0x72')](_0x4445d0)){var _0x5ceb0d=toCsv(_0x4445d0);var _0x3e3389=Date['now']();fs[_0xadfb('0x73')](util[_0xadfb('0x6b')](_0xadfb('0x74'),_0x990106['id'],_0x3e3389),_0x5ceb0d);_0x159425[_0xadfb('0x75')](_0xadfb('0x76'),_0xadfb('0x77')+util[_0xadfb('0x6b')](_0xadfb('0x78'),_0x990106['id'],_0x3e3389));_0x159425[_0xadfb('0x75')](_0xadfb('0x79'),_0xadfb('0x7a'));return _0x159425[_0xadfb('0x7b')](util[_0xadfb('0x6b')](_0xadfb('0x74'),_0x990106['id'],_0x3e3389));}else{return _0x159425[_0xadfb('0x1c')](0xcc);}})['catch'](handleError(_0x159425,null));};exports[_0xadfb('0x7c')]=function(_0x118003,_0x10317c,_0x15af75){var _0x4b9270;delete _0x118003[_0xadfb('0x4f')]['id'];return db[_0xadfb('0x30')][_0xadfb('0x5b')]({'where':{'id':_0x118003[_0xadfb('0x4b')]['id']}})[_0xadfb('0x27')](handleEntityNotFound(_0x10317c,null))['then'](function(_0x2f9d32){if(_0x2f9d32){return db[_0xadfb('0x7d')]['transaction'](function(_0xf4991d){return db[_0xadfb('0x70')][_0xadfb('0x4e')](_0x118003[_0xadfb('0x4f')],{'transaction':_0xf4991d})[_0xadfb('0x27')](function(_0x43c49d){_0x4b9270=_0x43c49d;return _0x2f9d32[_0xadfb('0x7e')](_0x43c49d,{'transaction':_0xf4991d});})[_0xadfb('0x27')](function(){var _0x44fdb6={'type':db[_0xadfb('0x7f')]['TEXT'],'transaction':_0xf4991d};switch(_0x118003['body']['type']){case _0xadfb('0x80'):_0x44fdb6[_0xadfb('0x42')]=db[_0xadfb('0x7f')][_0xadfb('0x81')];break;case _0xadfb('0x82'):_0x44fdb6[_0xadfb('0x42')]=db[_0xadfb('0x7f')][_0xadfb('0x83')];break;case _0xadfb('0x84'):_0x44fdb6[_0xadfb('0x42')]=db['Sequelize'][_0xadfb('0x85')];_0x44fdb6[_0xadfb('0x86')]=![];break;default:}return db['sequelize']['queryInterface'][_0xadfb('0x87')](_0xadfb('0x88'),util[_0xadfb('0x6b')](_0xadfb('0x89'),_0x4b9270['id']),_0x44fdb6);})[_0xadfb('0x27')](function(){return _0x4b9270;});});}})['then'](respondWithResult(_0x10317c,null))[_0xadfb('0x49')](handleError(_0x10317c,null));};exports[_0xadfb('0x8a')]=function(_0x1ce4ba,_0x2dc05a,_0x11c425){var _0x313ea3={};var _0x50e579={};var _0x58df6d;var _0x1400ab;return db[_0xadfb('0x30')][_0xadfb('0x5b')]({'where':{'id':_0x1ce4ba['params']['id']}})[_0xadfb('0x27')](handleEntityNotFound(_0x2dc05a,null))[_0xadfb('0x27')](function(_0x46c51c){if(_0x46c51c){_0x58df6d=_0x46c51c;_0x50e579[_0xadfb('0x32')]=_[_0xadfb('0x33')](db[_0xadfb('0x70')][_0xadfb('0x31')]);_0x50e579[_0xadfb('0x34')]=_[_0xadfb('0x33')](_0x1ce4ba[_0xadfb('0x34')]);_0x50e579['filters']=_[_0xadfb('0x36')](_0x50e579[_0xadfb('0x32')],_0x50e579[_0xadfb('0x34')]);_0x313ea3[_0xadfb('0x37')]=_[_0xadfb('0x36')](_0x50e579['model'],qs['fields'](_0x1ce4ba['query'][_0xadfb('0x38')]));_0x313ea3[_0xadfb('0x37')]=_0x313ea3[_0xadfb('0x37')][_0xadfb('0x39')]?_0x313ea3['attributes']:_0x50e579['model'];_0x313ea3[_0xadfb('0x3b')]=qs[_0xadfb('0x3c')](_0x1ce4ba[_0xadfb('0x34')][_0xadfb('0x3c')]);_0x313ea3['where']=qs[_0xadfb('0x35')](_[_0xadfb('0x3e')](_0x1ce4ba['query'],_0x50e579[_0xadfb('0x35')]));_0x313ea3['where']=_[_0xadfb('0x40')](_0x313ea3['where'],{'$or':[{'ListId':_0x46c51c['id']},{'ListId':null}]});if(_0x1ce4ba[_0xadfb('0x34')][_0xadfb('0x3f')]){_0x313ea3[_0xadfb('0x3d')]=_[_0xadfb('0x40')](_0x313ea3[_0xadfb('0x3d')],{'$or':_[_0xadfb('0x41')](_0x313ea3['attributes'],function(_0x5ae417){var _0x5c8a5e={};_0x5c8a5e[_0x5ae417]={'$like':'%'+_0x1ce4ba[_0xadfb('0x34')][_0xadfb('0x3f')]+'%'};return _0x5c8a5e;})});}_0x313ea3=_['merge']({},_0x313ea3,_0x1ce4ba[_0xadfb('0x46')]);return db[_0xadfb('0x70')][_0xadfb('0x8b')](_0x313ea3);}})[_0xadfb('0x27')](respondWithResult(_0x2dc05a,null))[_0xadfb('0x49')](handleError(_0x2dc05a,null));};exports[_0xadfb('0x8c')]=function(_0x112f0f,_0x50e9db,_0x523f93){return db[_0xadfb('0x30')]['find']({'where':{'id':_0x112f0f[_0xadfb('0x4b')]['id']}})[_0xadfb('0x27')](handleEntityNotFound(_0x50e9db,null))['then'](function(_0x159e06){if(_0x159e06){return _0x159e06['addAgents'](_0x112f0f[_0xadfb('0x4f')][_0xadfb('0x65')],_[_0xadfb('0x64')](_0x112f0f['body'],[_0xadfb('0x65'),'id'])||{})[_0xadfb('0x8d')](function(_0x25c807){for(var _0x7579ef=0x0;_0x7579ef<_0x112f0f['body'][_0xadfb('0x65')]['length'];_0x7579ef+=0x1){socket['emit'](_0xadfb('0x8e'),{'UserId':_0x112f0f[_0xadfb('0x4f')][_0xadfb('0x65')][_0x7579ef],'CmListId':_0x112f0f[_0xadfb('0x4b')]['id']});}return _0x25c807;});}})[_0xadfb('0x27')](respondWithResult(_0x50e9db,null))[_0xadfb('0x49')](handleError(_0x50e9db,null));};exports[_0xadfb('0x8f')]=function(_0xa80cfa,_0x10709d,_0x1a4f72){var _0x10f76e;return db[_0xadfb('0x30')][_0xadfb('0x4d')]({'where':{'id':_0xa80cfa[_0xadfb('0x4b')]['id']}})[_0xadfb('0x27')](handleEntityNotFound(_0x10709d,null))[_0xadfb('0x27')](function(_0x4372fa){if(_0x4372fa){return _0x4372fa['removeAgents'](_0xa80cfa['query'][_0xadfb('0x65')])['then'](function(_0x32c48b){if(_['isArray'](_0xa80cfa[_0xadfb('0x34')][_0xadfb('0x65')])){for(var _0x338871=0x0;_0x338871<_0xa80cfa[_0xadfb('0x34')][_0xadfb('0x65')][_0xadfb('0x39')];_0x338871+=0x1){socket['emit'](_0xadfb('0x90'),{'UserId':_0xa80cfa[_0xadfb('0x34')][_0xadfb('0x65')][_0x338871],'CmListId':_0xa80cfa[_0xadfb('0x4b')]['id']});}}else{socket['emit'](_0xadfb('0x90'),{'UserId':_0xa80cfa[_0xadfb('0x34')][_0xadfb('0x65')],'CmListId':_0xa80cfa[_0xadfb('0x4b')]['id']});}});}})['then'](respondWithStatusCode(_0x10709d,null))[_0xadfb('0x49')](handleError(_0x10709d,null));};exports[_0xadfb('0x91')]=function(_0x50a881,_0x53f2d5,_0xa604b3){var _0x4cb24a={};var _0x45cbe5={};var _0x4eb507;var _0x4e6fb6;return db[_0xadfb('0x30')]['findOne']({'where':{'id':_0x50a881[_0xadfb('0x4b')]['id']}})[_0xadfb('0x27')](handleEntityNotFound(_0x53f2d5,null))['then'](function(_0x2b9d66){if(_0x2b9d66){_0x4eb507=_0x2b9d66;_0x45cbe5['model']=_[_0xadfb('0x33')](db[_0xadfb('0x92')][_0xadfb('0x31')]);_0x45cbe5[_0xadfb('0x34')]=_['keys'](_0x50a881[_0xadfb('0x34')]);_0x45cbe5[_0xadfb('0x35')]=_[_0xadfb('0x36')](_0x45cbe5[_0xadfb('0x32')],_0x45cbe5[_0xadfb('0x34')]);_0x4cb24a['attributes']=_[_0xadfb('0x36')](_0x45cbe5['model'],qs['fields'](_0x50a881['query'][_0xadfb('0x38')]));_0x4cb24a[_0xadfb('0x37')]=_0x4cb24a[_0xadfb('0x37')][_0xadfb('0x39')]?_0x4cb24a[_0xadfb('0x37')]:_0x45cbe5['model'];_0x4cb24a['order']=qs[_0xadfb('0x3c')](_0x50a881['query'][_0xadfb('0x3c')]);_0x4cb24a['where']=qs[_0xadfb('0x35')](_[_0xadfb('0x3e')](_0x50a881[_0xadfb('0x34')],_0x45cbe5[_0xadfb('0x35')]));if(_0x50a881[_0xadfb('0x34')][_0xadfb('0x3f')]){_0x4cb24a[_0xadfb('0x3d')]=_[_0xadfb('0x40')](_0x4cb24a[_0xadfb('0x3d')],{'$or':_[_0xadfb('0x41')](_0x4cb24a[_0xadfb('0x37')],function(_0x10e7a1){var _0x562924={};_0x562924[_0x10e7a1]={'$like':'%'+_0x50a881[_0xadfb('0x34')][_0xadfb('0x3f')]+'%'};return _0x562924;})});}_0x4cb24a=_[_0xadfb('0x40')]({},_0x4cb24a,_0x50a881['options']);return _0x4eb507['getAgents'](_0x4cb24a);}})[_0xadfb('0x27')](function(_0x8c4a6f){if(_0x8c4a6f){_0x4e6fb6=_0x8c4a6f['length'];if(!_0x50a881[_0xadfb('0x34')]['hasOwnProperty'](_0xadfb('0x5c'))){_0x4cb24a[_0xadfb('0x21')]=qs[_0xadfb('0x21')](_0x50a881[_0xadfb('0x34')][_0xadfb('0x21')]);_0x4cb24a[_0xadfb('0x20')]=qs['offset'](_0x50a881['query']['offset']);}return _0x4eb507[_0xadfb('0x91')](_0x4cb24a);}})[_0xadfb('0x27')](function(_0x31ef2b){if(_0x31ef2b){return _0x31ef2b?{'count':_0x4e6fb6,'rows':_0x31ef2b}:null;}})[_0xadfb('0x27')](respondWithResult(_0x53f2d5,null))[_0xadfb('0x49')](handleError(_0x53f2d5,null));}; \ No newline at end of file +var _0xca37=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','Disposition','map','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','success','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContacts','getContactsCsv','now','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','addAgents','omit','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','end','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','index','rawAttributes','query','keys','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','CmList','count','includeAll','include','rows','catch','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Lists','UserProfileSection'];(function(_0x53969c,_0x194b51){var _0xedb4bb=function(_0x608d8e){while(--_0x608d8e){_0x53969c['push'](_0x53969c['shift']());}};_0xedb4bb(++_0x194b51);}(_0xca37,0x160));var _0x7ca3=function(_0x31834b,_0x35fdf2){_0x31834b=_0x31834b-0x0;var _0x5e647b=_0xca37[_0x31834b];return _0x5e647b;};'use strict';var pdf=require(_0x7ca3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7ca3('0x1'));var zipdir=require(_0x7ca3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ca3('0x3'));var moment=require(_0x7ca3('0x4'));var BPromise=require(_0x7ca3('0x5'));var Mustache=require(_0x7ca3('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7ca3('0x7'));var csv=require(_0x7ca3('0x8'));var ejs=require(_0x7ca3('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7ca3('0xa'));var crypto=require(_0x7ca3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7ca3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7ca3('0xd'));var Papa=require('papaparse');var authService=require(_0x7ca3('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x7ca3('0xf'));var qs=require(_0x7ca3('0x10'));var logger=require(_0x7ca3('0x11'))(_0x7ca3('0x12'));var utils=require('../../config/utils');var config=require(_0x7ca3('0x13'));var db=require(_0x7ca3('0x14'))['db'];config[_0x7ca3('0x15')]=_[_0x7ca3('0x16')](config[_0x7ca3('0x15')],{'host':_0x7ca3('0x17'),'port':0x18eb});var socket=require(_0x7ca3('0x18'))(new Redis(config[_0x7ca3('0x15')]));require(_0x7ca3('0x19'))[_0x7ca3('0x1a')](socket);function respondWithStatusCode(_0x251015,_0xa82441){_0xa82441=_0xa82441||0xcc;return function(_0x1aaf3c){if(_0x1aaf3c){return _0x251015['sendStatus'](_0xa82441);}return _0x251015[_0x7ca3('0x1b')](_0xa82441)[_0x7ca3('0x1c')]();};}function respondWithResult(_0x269164,_0x844f87){_0x844f87=_0x844f87||0xc8;return function(_0x5726b2){if(_0x5726b2){return _0x269164[_0x7ca3('0x1b')](_0x844f87)['json'](_0x5726b2);}};}function respondWithFilteredResult(_0x1ba5ef,_0x1183b2){return function(_0x121f00){if(_0x121f00){var _0x542ceb=_0x121f00['count'],_0x1d6a57=_0x1183b2[_0x7ca3('0x1d')],_0x5554f8=_0x1183b2[_0x7ca3('0x1d')]+_0x1183b2[_0x7ca3('0x1e')],_0x3777c1;if(_0x5554f8>=_0x542ceb){_0x5554f8=_0x542ceb;_0x3777c1=0xc8;}else{_0x3777c1=0xce;}_0x1ba5ef[_0x7ca3('0x1b')](_0x3777c1);return _0x1ba5ef[_0x7ca3('0x1f')](_0x7ca3('0x20'),_0x1d6a57+'-'+_0x5554f8+'/'+_0x542ceb)[_0x7ca3('0x21')](_0x121f00);}return null;};}function patchUpdates(_0xb5154a){return function(_0x3e0a32){try{jsonpatch[_0x7ca3('0x22')](_0x3e0a32,_0xb5154a,!![]);}catch(_0x32d37c){return BPromise['reject'](_0x32d37c);}return _0x3e0a32[_0x7ca3('0x23')]();};}function saveUpdates(_0x475e1d,_0x4ea60a){return function(_0x3ac22b){if(_0x3ac22b){return _0x3ac22b[_0x7ca3('0x24')](_0x475e1d)[_0x7ca3('0x25')](function(_0x5e97bd){return _0x5e97bd;});}return null;};}function removeEntity(_0x1f15d9,_0x130d2f){return function(_0x15177f){if(_0x15177f){return _0x15177f[_0x7ca3('0x26')]()[_0x7ca3('0x25')](function(){var _0x502844=_0x15177f['get']({'plain':!![]});var _0x364213='Lists';return db[_0x7ca3('0x27')][_0x7ca3('0x26')]({'where':{'type':_0x364213,'resourceId':_0x502844['id']}})[_0x7ca3('0x25')](function(){return _0x15177f;});})['then'](function(){_0x1f15d9[_0x7ca3('0x1b')](0xcc)[_0x7ca3('0x1c')]();});}};}function handleEntityNotFound(_0xa6601,_0x37e28a){return function(_0x530ed0){if(!_0x530ed0){_0xa6601[_0x7ca3('0x28')](0x194);}return _0x530ed0;};}function handleError(_0x3e608c,_0x5b5ddd){_0x5b5ddd=_0x5b5ddd||0x1f4;return function(_0x4f8545){logger[_0x7ca3('0x29')](_0x4f8545[_0x7ca3('0x2a')]);if(_0x4f8545[_0x7ca3('0x2b')]){delete _0x4f8545[_0x7ca3('0x2b')];}_0x3e608c[_0x7ca3('0x1b')](_0x5b5ddd)['send'](_0x4f8545);};}exports[_0x7ca3('0x2c')]=function(_0x3d5f1c,_0xc0a109){var _0x59f7f5={},_0x252e9f={},_0x2a8724={'count':0x0,'rows':[]};var _0x11fa59=db['CmList'][_0x7ca3('0x2d')];_0x252e9f['model']=_['keys'](_0x11fa59);_0x252e9f[_0x7ca3('0x2e')]=_[_0x7ca3('0x2f')](_0x3d5f1c[_0x7ca3('0x2e')]);_0x252e9f['filters']=_[_0x7ca3('0x30')](_0x252e9f[_0x7ca3('0x31')],_0x252e9f['query']);_0x59f7f5['attributes']=_[_0x7ca3('0x30')](_0x252e9f['model'],qs['fields'](_0x3d5f1c[_0x7ca3('0x2e')][_0x7ca3('0x32')]));_0x59f7f5['attributes']=_0x59f7f5['attributes'][_0x7ca3('0x33')]?_0x59f7f5[_0x7ca3('0x34')]:_0x252e9f[_0x7ca3('0x31')];if(!_0x3d5f1c['query'][_0x7ca3('0x35')](_0x7ca3('0x36'))){_0x59f7f5[_0x7ca3('0x1e')]=qs[_0x7ca3('0x1e')](_0x3d5f1c['query']['limit']);_0x59f7f5['offset']=qs[_0x7ca3('0x1d')](_0x3d5f1c[_0x7ca3('0x2e')][_0x7ca3('0x1d')]);}_0x59f7f5[_0x7ca3('0x37')]=qs[_0x7ca3('0x38')](_0x3d5f1c[_0x7ca3('0x2e')][_0x7ca3('0x38')]);_0x59f7f5[_0x7ca3('0x39')]=qs[_0x7ca3('0x3a')](_[_0x7ca3('0x3b')](_0x3d5f1c['query'],_0x252e9f['filters']));if(_0x3d5f1c['query'][_0x7ca3('0x3c')]){_0x59f7f5[_0x7ca3('0x39')]=_[_0x7ca3('0x3d')](_0x59f7f5[_0x7ca3('0x39')],{'$or':_['map'](_0x11fa59,function(_0x5dae8c){if(_0x5dae8c[_0x7ca3('0x3e')][_0x7ca3('0x3f')]!==_0x7ca3('0x40')){var _0x21d60c={};_0x21d60c[_0x5dae8c[_0x7ca3('0x41')]]={'$like':'%'+_0x3d5f1c['query'][_0x7ca3('0x3c')]+'%'};return _0x21d60c;}})});}_0x59f7f5=_[_0x7ca3('0x3d')]({},_0x59f7f5,_0x3d5f1c[_0x7ca3('0x42')]);var _0x52cfbb={'where':_0x59f7f5[_0x7ca3('0x39')]};return db[_0x7ca3('0x43')][_0x7ca3('0x44')](_0x52cfbb)[_0x7ca3('0x25')](function(_0x4e430b){_0x2a8724[_0x7ca3('0x44')]=_0x4e430b;if(_0x3d5f1c[_0x7ca3('0x2e')][_0x7ca3('0x45')]){_0x59f7f5[_0x7ca3('0x46')]=[{'all':!![]}];}return db[_0x7ca3('0x43')]['findAll'](_0x59f7f5);})[_0x7ca3('0x25')](function(_0x1794e5){_0x2a8724[_0x7ca3('0x47')]=_0x1794e5;return _0x2a8724;})[_0x7ca3('0x25')](respondWithFilteredResult(_0xc0a109,_0x59f7f5))[_0x7ca3('0x48')](handleError(_0xc0a109,null));};exports['show']=function(_0x2dd215,_0x139996){var _0x123fe3={'raw':![],'where':{'id':_0x2dd215[_0x7ca3('0x49')]['id']}},_0x2e7ec6={};_0x2e7ec6[_0x7ca3('0x31')]=_[_0x7ca3('0x2f')](db['CmList'][_0x7ca3('0x2d')]);_0x2e7ec6[_0x7ca3('0x2e')]=_[_0x7ca3('0x2f')](_0x2dd215[_0x7ca3('0x2e')]);_0x2e7ec6['filters']=_[_0x7ca3('0x30')](_0x2e7ec6[_0x7ca3('0x31')],_0x2e7ec6[_0x7ca3('0x2e')]);_0x123fe3[_0x7ca3('0x34')]=_['intersection'](_0x2e7ec6[_0x7ca3('0x31')],qs['fields'](_0x2dd215['query'][_0x7ca3('0x32')]));_0x123fe3[_0x7ca3('0x34')]=_0x123fe3[_0x7ca3('0x34')]['length']?_0x123fe3[_0x7ca3('0x34')]:_0x2e7ec6['model'];if(_0x2dd215[_0x7ca3('0x2e')][_0x7ca3('0x45')]){_0x123fe3['include']=[{'all':!![]}];}_0x123fe3=_[_0x7ca3('0x3d')]({},_0x123fe3,_0x2dd215[_0x7ca3('0x42')]);return db[_0x7ca3('0x43')][_0x7ca3('0x4a')](_0x123fe3)['then'](handleEntityNotFound(_0x139996,null))[_0x7ca3('0x25')](respondWithResult(_0x139996,null))[_0x7ca3('0x48')](handleError(_0x139996,null));};exports[_0x7ca3('0x4b')]=function(_0x1757b5,_0xa792c){return db[_0x7ca3('0x43')][_0x7ca3('0x4b')](_0x1757b5[_0x7ca3('0x4c')],{})['then'](function(_0x88d6fe){var _0x577413=_0x1757b5['user'][_0x7ca3('0x4d')]({'plain':!![]});if(!_0x577413)throw new Error(_0x7ca3('0x4e'));if(_0x577413[_0x7ca3('0x4f')]===_0x7ca3('0x50')){var _0x4ac3db=_0x88d6fe['get']({'plain':!![]});var _0x59a48f=_0x7ca3('0x51');return db[_0x7ca3('0x52')]['find']({'where':{'name':_0x59a48f,'userProfileId':_0x577413[_0x7ca3('0x53')]},'raw':!![]})[_0x7ca3('0x25')](function(_0x55f64a){if(_0x55f64a&&_0x55f64a['autoAssociation']===0x0){return db[_0x7ca3('0x27')][_0x7ca3('0x4b')]({'name':_0x4ac3db[_0x7ca3('0x2b')],'resourceId':_0x4ac3db['id'],'type':_0x55f64a[_0x7ca3('0x2b')],'sectionId':_0x55f64a['id']},{})[_0x7ca3('0x25')](function(){return _0x88d6fe;});}else{return _0x88d6fe;}})[_0x7ca3('0x48')](function(_0x1d80d1){logger[_0x7ca3('0x29')](_0x7ca3('0x54'),_0x1d80d1);throw _0x1d80d1;});}return _0x88d6fe;})[_0x7ca3('0x25')](respondWithResult(_0xa792c,0xc9))['catch'](handleError(_0xa792c,null));};exports['update']=function(_0x38eb01,_0x1bfd12){if(_0x38eb01[_0x7ca3('0x4c')]['id']){delete _0x38eb01[_0x7ca3('0x4c')]['id'];}return db[_0x7ca3('0x43')][_0x7ca3('0x4a')]({'where':{'id':_0x38eb01[_0x7ca3('0x49')]['id']}})[_0x7ca3('0x25')](handleEntityNotFound(_0x1bfd12,null))[_0x7ca3('0x25')](saveUpdates(_0x38eb01[_0x7ca3('0x4c')],null))[_0x7ca3('0x25')](respondWithResult(_0x1bfd12,null))[_0x7ca3('0x48')](handleError(_0x1bfd12,null));};exports[_0x7ca3('0x26')]=function(_0x5b0b2c,_0x20fe9c){return db['CmList'][_0x7ca3('0x4a')]({'where':{'id':_0x5b0b2c[_0x7ca3('0x49')]['id']}})[_0x7ca3('0x25')](handleEntityNotFound(_0x20fe9c,null))[_0x7ca3('0x25')](removeEntity(_0x20fe9c,null))[_0x7ca3('0x48')](handleError(_0x20fe9c,null));};exports[_0x7ca3('0x55')]=function(_0x14a009,_0x309c3e){return db[_0x7ca3('0x43')]['describe']()[_0x7ca3('0x25')](respondWithResult(_0x309c3e,null))[_0x7ca3('0x48')](handleError(_0x309c3e,null));};exports[_0x7ca3('0x56')]=function(_0xf94d45,_0x45fc95,_0x56b228){if(_0xf94d45[_0x7ca3('0x4c')]['id']){delete _0xf94d45[_0x7ca3('0x4c')]['id'];}return db[_0x7ca3('0x43')][_0x7ca3('0x4a')]({'where':{'id':_0xf94d45[_0x7ca3('0x49')]['id']}})[_0x7ca3('0x25')](handleEntityNotFound(_0x45fc95,null))[_0x7ca3('0x25')](function(_0x5a2dd5){if(_0x5a2dd5){_0xf94d45[_0x7ca3('0x4c')][_0x7ca3('0x57')]=_0x5a2dd5['id'];return db['Disposition'][_0x7ca3('0x4b')](_0xf94d45[_0x7ca3('0x4c')]);}})[_0x7ca3('0x25')](respondWithResult(_0x45fc95,null))[_0x7ca3('0x48')](handleError(_0x45fc95,null));};exports[_0x7ca3('0x58')]=function(_0x2322a6,_0x768398,_0x9229b0){var _0xf96813={'raw':![],'where':{}};var _0x1c3752={};var _0x16b7b0={'count':0x0,'rows':[]};return db[_0x7ca3('0x43')][_0x7ca3('0x59')]({'where':{'id':_0x2322a6[_0x7ca3('0x49')]['id']}})['then'](handleEntityNotFound(_0x768398,null))['then'](function(_0x59bada){if(_0x59bada){_0x1c3752[_0x7ca3('0x31')]=_[_0x7ca3('0x2f')](db[_0x7ca3('0x5a')][_0x7ca3('0x2d')]);_0x1c3752['query']=_[_0x7ca3('0x2f')](_0x2322a6[_0x7ca3('0x2e')]);_0x1c3752[_0x7ca3('0x3a')]=_['intersection'](_0x1c3752[_0x7ca3('0x31')],_0x1c3752['query']);_0xf96813[_0x7ca3('0x34')]=_[_0x7ca3('0x30')](_0x1c3752[_0x7ca3('0x31')],qs[_0x7ca3('0x32')](_0x2322a6[_0x7ca3('0x2e')][_0x7ca3('0x32')]));_0xf96813[_0x7ca3('0x34')]=_0xf96813[_0x7ca3('0x34')][_0x7ca3('0x33')]?_0xf96813[_0x7ca3('0x34')]:_0x1c3752[_0x7ca3('0x31')];if(!_0x2322a6[_0x7ca3('0x2e')][_0x7ca3('0x35')](_0x7ca3('0x36'))){_0xf96813[_0x7ca3('0x1e')]=qs[_0x7ca3('0x1e')](_0x2322a6[_0x7ca3('0x2e')][_0x7ca3('0x1e')]);_0xf96813[_0x7ca3('0x1d')]=qs[_0x7ca3('0x1d')](_0x2322a6['query'][_0x7ca3('0x1d')]);}_0xf96813[_0x7ca3('0x37')]=qs[_0x7ca3('0x38')](_0x2322a6[_0x7ca3('0x2e')][_0x7ca3('0x38')]);_0xf96813[_0x7ca3('0x39')]=qs[_0x7ca3('0x3a')](_['pick'](_0x2322a6['query'],_0x1c3752[_0x7ca3('0x3a')]));_0xf96813[_0x7ca3('0x39')][_0x7ca3('0x57')]=_0x59bada['id'];if(_0x2322a6[_0x7ca3('0x2e')][_0x7ca3('0x3c')]){_0xf96813[_0x7ca3('0x39')]=_[_0x7ca3('0x3d')](_0xf96813[_0x7ca3('0x39')],{'$or':_[_0x7ca3('0x5b')](_0xf96813[_0x7ca3('0x34')],function(_0x219dfb){var _0x164e02={};_0x164e02[_0x219dfb]={'$like':'%'+_0x2322a6[_0x7ca3('0x2e')][_0x7ca3('0x3c')]+'%'};return _0x164e02;})});}_0xf96813=_[_0x7ca3('0x3d')]({},_0xf96813,_0x2322a6[_0x7ca3('0x42')]);return db['Disposition'][_0x7ca3('0x44')]({'where':_0xf96813[_0x7ca3('0x39')]})[_0x7ca3('0x25')](function(_0x4fd709){_0x16b7b0[_0x7ca3('0x44')]=_0x4fd709;if(_0x2322a6[_0x7ca3('0x2e')]['includeAll']){_0xf96813['include']=[{'all':!![]}];}return db[_0x7ca3('0x5a')][_0x7ca3('0x5c')](_0xf96813);})[_0x7ca3('0x25')](function(_0x161bc0){_0x16b7b0[_0x7ca3('0x47')]=_0x161bc0;return _0x16b7b0;});}})[_0x7ca3('0x25')](respondWithFilteredResult(_0x768398,_0xf96813))[_0x7ca3('0x48')](handleError(_0x768398,null));};exports[_0x7ca3('0x5d')]=function(_0x40c91c,_0x40d476,_0x43482b){var _0x24775a;return db[_0x7ca3('0x43')][_0x7ca3('0x4a')]({'where':{'id':_0x40c91c['params']['id']}})[_0x7ca3('0x25')](handleEntityNotFound(_0x40d476,null))[_0x7ca3('0x25')](function(_0x403d6b){if(_0x403d6b){return _0x403d6b[_0x7ca3('0x5d')](_0x40c91c[_0x7ca3('0x2e')][_0x7ca3('0x5e')]);}})[_0x7ca3('0x25')](respondWithStatusCode(_0x40d476,null))[_0x7ca3('0x48')](handleError(_0x40d476,null));};exports[_0x7ca3('0x5f')]=function(_0x217cf1,_0x8086b5,_0x47c356){return db[_0x7ca3('0x43')]['find']({'where':{'id':_0x217cf1[_0x7ca3('0x49')]['id']}})[_0x7ca3('0x25')](handleEntityNotFound(_0x8086b5,null))[_0x7ca3('0x25')](function(_0x5510be){if(_0x5510be){var _0x128846=[];var _0x10c5f8={'success':[],'errors':[]};return db[_0x7ca3('0x60')][_0x7ca3('0x55')]()[_0x7ca3('0x25')](function(_0x1ecd53){if(_0x217cf1[_0x7ca3('0x4c')][_0x7ca3('0x61')]&&_[_0x7ca3('0x62')](_0x217cf1[_0x7ca3('0x4c')]['tags'])){if(_0x217cf1[_0x7ca3('0x4c')][_0x7ca3('0x61')]['length']){_0x217cf1[_0x7ca3('0x4c')]['tags']=_0x217cf1['body']['tags'][_0x7ca3('0x63')](';')+';';}else{_0x217cf1[_0x7ca3('0x4c')][_0x7ca3('0x61')]=null;}}else{_0x217cf1[_0x7ca3('0x4c')][_0x7ca3('0x61')]=null;}if(_0x217cf1[_0x7ca3('0x4c')]&&_['isArray'](_0x217cf1[_0x7ca3('0x4c')])){for(var _0x53830a=0x0;_0x53830a<_0x217cf1[_0x7ca3('0x4c')]['length'];_0x53830a+=0x1){_0x217cf1[_0x7ca3('0x4c')][_0x53830a][_0x7ca3('0x57')]=_0x217cf1[_0x7ca3('0x49')]['id'];_0x128846[_0x7ca3('0x64')](_0x217cf1[_0x7ca3('0x4c')][_0x53830a]);}return BPromise['each'](_0x128846,function(_0x3a53a1){return db[_0x7ca3('0x60')][_0x7ca3('0x4b')](_['omit'](_0x3a53a1,[_0x7ca3('0x5e'),'id'])||{},{'fields':_[_0x7ca3('0x2f')](_0x1ecd53),'raw':!![]})[_0x7ca3('0x25')](function(_0x2c1419){_0x10c5f8[_0x7ca3('0x65')][_0x7ca3('0x64')](_0x2c1419[_0x7ca3('0x66')]);})[_0x7ca3('0x48')](function(_0xbc5d05){_0x10c5f8[_0x7ca3('0x67')]['push']({'data':_0x3a53a1,'error':_0xbc5d05[_0x7ca3('0x68')]});});})[_0x7ca3('0x25')](function(_0x1154a7){return _0x10c5f8;})[_0x7ca3('0x48')](function(_0x4bb8cd){return _0x4bb8cd;});}else{_0x8086b5[_0x7ca3('0x1b')](0x190)[_0x7ca3('0x21')]({'message':_0x7ca3('0x69')});}});}})[_0x7ca3('0x25')](respondWithResult(_0x8086b5,null))[_0x7ca3('0x48')](handleError(_0x8086b5,null));};exports['getContacts']=function(_0x213d0b,_0x425c1e,_0x1618d0){var _0x504a67;return db[_0x7ca3('0x43')]['find']({'where':{'id':_0x213d0b['params']['id']},'include':[{'model':db[_0x7ca3('0x6a')],'as':_0x7ca3('0x6b')}]})[_0x7ca3('0x25')](handleEntityNotFound(_0x425c1e,null))[_0x7ca3('0x25')](function(_0x37b676){if(_0x37b676){_0x504a67=_0x37b676;return db[_0x7ca3('0x60')][_0x7ca3('0x2d')];}})[_0x7ca3('0x25')](function(_0x1feaff){if(_0x1feaff){var _0x4aa84f={};var _0x24f697={};_0x24f697[_0x7ca3('0x31')]=_[_0x7ca3('0x6c')](_[_0x7ca3('0x2f')](_0x1feaff),_[_0x7ca3('0x5b')](_0x504a67[_0x7ca3('0x6b')],function(_0xb1db68){return util[_0x7ca3('0x6d')](_0x7ca3('0x6e'),_0xb1db68['id']);}));_0x24f697[_0x7ca3('0x2e')]=_[_0x7ca3('0x2f')](_0x213d0b['query']);_0x24f697['filters']=_[_0x7ca3('0x30')](_0x24f697[_0x7ca3('0x31')],_0x24f697[_0x7ca3('0x2e')]);_0x4aa84f[_0x7ca3('0x34')]=_[_0x7ca3('0x30')](_0x24f697['model'],qs[_0x7ca3('0x32')](_0x213d0b['query'][_0x7ca3('0x32')]));_0x4aa84f['attributes']=_0x4aa84f[_0x7ca3('0x34')][_0x7ca3('0x33')]?_0x4aa84f[_0x7ca3('0x34')]:_0x24f697[_0x7ca3('0x31')];if(!_0x213d0b['query']['hasOwnProperty'](_0x7ca3('0x36'))){_0x4aa84f[_0x7ca3('0x1e')]=qs['limit'](_0x213d0b[_0x7ca3('0x2e')][_0x7ca3('0x1e')]);_0x4aa84f['offset']=qs[_0x7ca3('0x1d')](_0x213d0b[_0x7ca3('0x2e')][_0x7ca3('0x1d')]);}_0x4aa84f[_0x7ca3('0x37')]=qs[_0x7ca3('0x38')](_0x213d0b[_0x7ca3('0x2e')][_0x7ca3('0x38')]);_0x4aa84f[_0x7ca3('0x39')]=qs[_0x7ca3('0x3a')](_['pick'](_0x213d0b['query'],_0x24f697[_0x7ca3('0x3a')]));_0x4aa84f[_0x7ca3('0x6f')]=!![];if(_0x213d0b[_0x7ca3('0x2e')]['filter']){_0x4aa84f[_0x7ca3('0x39')]=_[_0x7ca3('0x3d')](_0x4aa84f[_0x7ca3('0x39')],{'$or':_[_0x7ca3('0x5b')](_0x4aa84f[_0x7ca3('0x34')],function(_0x107fde){var _0x374955={};_0x374955[_0x107fde]={'$like':'%'+_0x213d0b[_0x7ca3('0x2e')][_0x7ca3('0x3c')]+'%'};return _0x374955;})});}_0x4aa84f=_[_0x7ca3('0x3d')]({},_0x4aa84f,_0x213d0b[_0x7ca3('0x42')]);return _0x504a67[_0x7ca3('0x70')](_0x4aa84f);}})['then'](respondWithResult(_0x425c1e,null))[_0x7ca3('0x48')](handleError(_0x425c1e,null));};exports[_0x7ca3('0x71')]=function(_0x44dd83,_0x199908,_0x32874d){var _0x25a822;return db[_0x7ca3('0x43')]['find']({'where':{'id':_0x44dd83[_0x7ca3('0x49')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x7ca3('0x6b')}]})['then'](handleEntityNotFound(_0x199908,null))[_0x7ca3('0x25')](function(_0x2ab103){if(_0x2ab103){_0x25a822=_0x2ab103;return db[_0x7ca3('0x60')]['rawAttributes'];}})[_0x7ca3('0x25')](function(_0x32de61){if(_0x32de61){var _0x4308ac={};var _0xf1f541={};_0xf1f541['model']=_[_0x7ca3('0x6c')](_[_0x7ca3('0x2f')](_0x32de61),_[_0x7ca3('0x5b')](_0x25a822[_0x7ca3('0x6b')],function(_0x5701cc){return util['format'](_0x7ca3('0x6e'),_0x5701cc['id']);}));_0xf1f541[_0x7ca3('0x2e')]=_['keys'](_0x44dd83['query']);_0xf1f541['filters']=_[_0x7ca3('0x30')](_0xf1f541[_0x7ca3('0x31')],_0xf1f541['query']);_0x4308ac[_0x7ca3('0x34')]=_[_0x7ca3('0x30')](_0xf1f541[_0x7ca3('0x31')],qs[_0x7ca3('0x32')](_0x44dd83[_0x7ca3('0x2e')][_0x7ca3('0x32')]));_0x4308ac[_0x7ca3('0x34')]=_0x4308ac[_0x7ca3('0x34')][_0x7ca3('0x33')]?_0x4308ac[_0x7ca3('0x34')]:_0xf1f541[_0x7ca3('0x31')];if(!_0x44dd83[_0x7ca3('0x2e')]['hasOwnProperty'](_0x7ca3('0x36'))){_0x4308ac['limit']=qs[_0x7ca3('0x1e')](_0x44dd83[_0x7ca3('0x2e')][_0x7ca3('0x1e')]);_0x4308ac[_0x7ca3('0x1d')]=qs[_0x7ca3('0x1d')](_0x44dd83[_0x7ca3('0x2e')][_0x7ca3('0x1d')]);}_0x4308ac[_0x7ca3('0x37')]=qs['sort'](_0x44dd83[_0x7ca3('0x2e')][_0x7ca3('0x38')]);_0x4308ac[_0x7ca3('0x39')]=qs[_0x7ca3('0x3a')](_[_0x7ca3('0x3b')](_0x44dd83['query'],_0xf1f541['filters']));_0x4308ac[_0x7ca3('0x6f')]=!![];if(_0x44dd83[_0x7ca3('0x2e')][_0x7ca3('0x3c')]){_0x4308ac['where']=_[_0x7ca3('0x3d')](_0x4308ac[_0x7ca3('0x39')],{'$or':_[_0x7ca3('0x5b')](_0x4308ac[_0x7ca3('0x34')],function(_0x4382a9){var _0x25034a={};_0x25034a[_0x4382a9]={'$like':'%'+_0x44dd83[_0x7ca3('0x2e')][_0x7ca3('0x3c')]+'%'};return _0x25034a;})});}_0x4308ac=_[_0x7ca3('0x3d')]({},_0x4308ac,_0x44dd83[_0x7ca3('0x42')]);return _0x25a822[_0x7ca3('0x70')](_0x4308ac);}})[_0x7ca3('0x25')](function(_0x205c9b){if(!_['isEmpty'](_0x205c9b)){var _0x3b87c1=toCsv(_0x205c9b);var _0x59f76b=Date[_0x7ca3('0x72')]();fs[_0x7ca3('0x73')](util[_0x7ca3('0x6d')]('/tmp/list_%d_%s.csv',_0x25a822['id'],_0x59f76b),_0x3b87c1);_0x199908[_0x7ca3('0x74')]('Content-disposition',_0x7ca3('0x75')+util['format'](_0x7ca3('0x76'),_0x25a822['id'],_0x59f76b));_0x199908[_0x7ca3('0x74')](_0x7ca3('0x77'),_0x7ca3('0x78'));return _0x199908[_0x7ca3('0x79')](util[_0x7ca3('0x6d')](_0x7ca3('0x7a'),_0x25a822['id'],_0x59f76b));}else{return _0x199908['sendStatus'](0xcc);}})['catch'](handleError(_0x199908,null));};exports[_0x7ca3('0x7b')]=function(_0x21e286,_0x465895,_0x23a3a6){var _0x5807a9;delete _0x21e286[_0x7ca3('0x4c')]['id'];return db[_0x7ca3('0x43')][_0x7ca3('0x59')]({'where':{'id':_0x21e286[_0x7ca3('0x49')]['id']}})[_0x7ca3('0x25')](handleEntityNotFound(_0x465895,null))['then'](function(_0x3e829f){if(_0x3e829f){return db[_0x7ca3('0x7c')][_0x7ca3('0x7d')](function(_0x2d42e4){return db['CmCustomField']['create'](_0x21e286[_0x7ca3('0x4c')],{'transaction':_0x2d42e4})['then'](function(_0x4285ec){_0x5807a9=_0x4285ec;return _0x3e829f[_0x7ca3('0x7e')](_0x4285ec,{'transaction':_0x2d42e4});})[_0x7ca3('0x25')](function(){var _0x5131e1={'type':db[_0x7ca3('0x7f')][_0x7ca3('0x80')],'transaction':_0x2d42e4};switch(_0x21e286[_0x7ca3('0x4c')][_0x7ca3('0x3e')]){case _0x7ca3('0x81'):_0x5131e1[_0x7ca3('0x3e')]=db[_0x7ca3('0x7f')][_0x7ca3('0x80')];break;case _0x7ca3('0x82'):_0x5131e1[_0x7ca3('0x3e')]=db[_0x7ca3('0x7f')][_0x7ca3('0x83')];break;case _0x7ca3('0x84'):_0x5131e1[_0x7ca3('0x3e')]=db[_0x7ca3('0x7f')][_0x7ca3('0x85')];_0x5131e1[_0x7ca3('0x86')]=![];break;default:}return db[_0x7ca3('0x7c')]['queryInterface'][_0x7ca3('0x87')](_0x7ca3('0x88'),util[_0x7ca3('0x6d')](_0x7ca3('0x89'),_0x5807a9['id']),_0x5131e1);})[_0x7ca3('0x25')](function(){return _0x5807a9;});});}})[_0x7ca3('0x25')](respondWithResult(_0x465895,null))[_0x7ca3('0x48')](handleError(_0x465895,null));};exports['getCustomFields']=function(_0x148e89,_0x2a7c5c,_0x2d112a){var _0xc7cff4={};var _0x175b2b={};var _0x169f51;var _0x3dbe6d;return db[_0x7ca3('0x43')][_0x7ca3('0x59')]({'where':{'id':_0x148e89[_0x7ca3('0x49')]['id']}})[_0x7ca3('0x25')](handleEntityNotFound(_0x2a7c5c,null))[_0x7ca3('0x25')](function(_0x16b750){if(_0x16b750){_0x169f51=_0x16b750;_0x175b2b[_0x7ca3('0x31')]=_[_0x7ca3('0x2f')](db[_0x7ca3('0x6a')]['rawAttributes']);_0x175b2b[_0x7ca3('0x2e')]=_['keys'](_0x148e89['query']);_0x175b2b[_0x7ca3('0x3a')]=_['intersection'](_0x175b2b[_0x7ca3('0x31')],_0x175b2b[_0x7ca3('0x2e')]);_0xc7cff4[_0x7ca3('0x34')]=_[_0x7ca3('0x30')](_0x175b2b['model'],qs['fields'](_0x148e89[_0x7ca3('0x2e')][_0x7ca3('0x32')]));_0xc7cff4['attributes']=_0xc7cff4[_0x7ca3('0x34')][_0x7ca3('0x33')]?_0xc7cff4[_0x7ca3('0x34')]:_0x175b2b[_0x7ca3('0x31')];_0xc7cff4[_0x7ca3('0x37')]=qs[_0x7ca3('0x38')](_0x148e89[_0x7ca3('0x2e')]['sort']);_0xc7cff4[_0x7ca3('0x39')]=qs[_0x7ca3('0x3a')](_[_0x7ca3('0x3b')](_0x148e89[_0x7ca3('0x2e')],_0x175b2b[_0x7ca3('0x3a')]));_0xc7cff4[_0x7ca3('0x39')]=_[_0x7ca3('0x3d')](_0xc7cff4[_0x7ca3('0x39')],{'$or':[{'ListId':_0x16b750['id']},{'ListId':null}]});if(_0x148e89[_0x7ca3('0x2e')]['filter']){_0xc7cff4[_0x7ca3('0x39')]=_['merge'](_0xc7cff4['where'],{'$or':_[_0x7ca3('0x5b')](_0xc7cff4['attributes'],function(_0x2eaef3){var _0x3e9791={};_0x3e9791[_0x2eaef3]={'$like':'%'+_0x148e89[_0x7ca3('0x2e')][_0x7ca3('0x3c')]+'%'};return _0x3e9791;})});}_0xc7cff4=_[_0x7ca3('0x3d')]({},_0xc7cff4,_0x148e89[_0x7ca3('0x42')]);return db[_0x7ca3('0x6a')]['findAndCountAll'](_0xc7cff4);}})['then'](respondWithResult(_0x2a7c5c,null))['catch'](handleError(_0x2a7c5c,null));};exports[_0x7ca3('0x8a')]=function(_0x55d79b,_0x204c2a,_0x12165d){return db[_0x7ca3('0x43')][_0x7ca3('0x4a')]({'where':{'id':_0x55d79b['params']['id']}})[_0x7ca3('0x25')](handleEntityNotFound(_0x204c2a,null))['then'](function(_0x25d098){if(_0x25d098){return _0x25d098['addAgents'](_0x55d79b[_0x7ca3('0x4c')][_0x7ca3('0x5e')],_[_0x7ca3('0x8b')](_0x55d79b['body'],['ids','id'])||{})['spread'](function(_0x19a0a8){for(var _0x256eef=0x0;_0x256eef<_0x55d79b[_0x7ca3('0x4c')]['ids']['length'];_0x256eef+=0x1){socket[_0x7ca3('0x8c')](_0x7ca3('0x8d'),{'UserId':_0x55d79b[_0x7ca3('0x4c')]['ids'][_0x256eef],'CmListId':_0x55d79b[_0x7ca3('0x49')]['id']});}return _0x19a0a8;});}})[_0x7ca3('0x25')](respondWithResult(_0x204c2a,null))['catch'](handleError(_0x204c2a,null));};exports[_0x7ca3('0x8e')]=function(_0x19997a,_0x1fee35,_0xf65ee3){var _0x3a0cd2;return db[_0x7ca3('0x43')][_0x7ca3('0x4a')]({'where':{'id':_0x19997a[_0x7ca3('0x49')]['id']}})[_0x7ca3('0x25')](handleEntityNotFound(_0x1fee35,null))[_0x7ca3('0x25')](function(_0x3f971e){if(_0x3f971e){return _0x3f971e[_0x7ca3('0x8e')](_0x19997a[_0x7ca3('0x2e')][_0x7ca3('0x5e')])['then'](function(_0x42557c){if(_[_0x7ca3('0x62')](_0x19997a[_0x7ca3('0x2e')][_0x7ca3('0x5e')])){for(var _0x4dcd2f=0x0;_0x4dcd2f<_0x19997a[_0x7ca3('0x2e')][_0x7ca3('0x5e')]['length'];_0x4dcd2f+=0x1){socket[_0x7ca3('0x8c')](_0x7ca3('0x8f'),{'UserId':_0x19997a[_0x7ca3('0x2e')][_0x7ca3('0x5e')][_0x4dcd2f],'CmListId':_0x19997a[_0x7ca3('0x49')]['id']});}}else{socket[_0x7ca3('0x8c')]('userCmList:remove',{'UserId':_0x19997a[_0x7ca3('0x2e')][_0x7ca3('0x5e')],'CmListId':_0x19997a[_0x7ca3('0x49')]['id']});}});}})['then'](respondWithStatusCode(_0x1fee35,null))[_0x7ca3('0x48')](handleError(_0x1fee35,null));};exports[_0x7ca3('0x90')]=function(_0x2a5f3f,_0x3ebc5c,_0x9a4578){var _0x58791e={};var _0x52407c={};var _0x2bfde5;var _0x5d6d29;return db[_0x7ca3('0x43')][_0x7ca3('0x59')]({'where':{'id':_0x2a5f3f[_0x7ca3('0x49')]['id']}})['then'](handleEntityNotFound(_0x3ebc5c,null))[_0x7ca3('0x25')](function(_0x4e41e4){if(_0x4e41e4){_0x2bfde5=_0x4e41e4;_0x52407c[_0x7ca3('0x31')]=_['keys'](db['User'][_0x7ca3('0x2d')]);_0x52407c[_0x7ca3('0x2e')]=_['keys'](_0x2a5f3f['query']);_0x52407c['filters']=_[_0x7ca3('0x30')](_0x52407c['model'],_0x52407c['query']);_0x58791e[_0x7ca3('0x34')]=_[_0x7ca3('0x30')](_0x52407c[_0x7ca3('0x31')],qs[_0x7ca3('0x32')](_0x2a5f3f['query'][_0x7ca3('0x32')]));_0x58791e['attributes']=_0x58791e[_0x7ca3('0x34')][_0x7ca3('0x33')]?_0x58791e['attributes']:_0x52407c[_0x7ca3('0x31')];_0x58791e['order']=qs[_0x7ca3('0x38')](_0x2a5f3f['query']['sort']);_0x58791e[_0x7ca3('0x39')]=qs[_0x7ca3('0x3a')](_['pick'](_0x2a5f3f['query'],_0x52407c['filters']));if(_0x2a5f3f[_0x7ca3('0x2e')][_0x7ca3('0x3c')]){_0x58791e[_0x7ca3('0x39')]=_[_0x7ca3('0x3d')](_0x58791e[_0x7ca3('0x39')],{'$or':_[_0x7ca3('0x5b')](_0x58791e[_0x7ca3('0x34')],function(_0x2ff7e9){var _0x2125a6={};_0x2125a6[_0x2ff7e9]={'$like':'%'+_0x2a5f3f[_0x7ca3('0x2e')][_0x7ca3('0x3c')]+'%'};return _0x2125a6;})});}_0x58791e=_[_0x7ca3('0x3d')]({},_0x58791e,_0x2a5f3f[_0x7ca3('0x42')]);return _0x2bfde5['getAgents'](_0x58791e);}})[_0x7ca3('0x25')](function(_0x5522b4){if(_0x5522b4){_0x5d6d29=_0x5522b4[_0x7ca3('0x33')];if(!_0x2a5f3f[_0x7ca3('0x2e')][_0x7ca3('0x35')]('nolimit')){_0x58791e[_0x7ca3('0x1e')]=qs[_0x7ca3('0x1e')](_0x2a5f3f[_0x7ca3('0x2e')][_0x7ca3('0x1e')]);_0x58791e[_0x7ca3('0x1d')]=qs[_0x7ca3('0x1d')](_0x2a5f3f[_0x7ca3('0x2e')][_0x7ca3('0x1d')]);}return _0x2bfde5[_0x7ca3('0x90')](_0x58791e);}})[_0x7ca3('0x25')](function(_0x40a6d0){if(_0x40a6d0){return _0x40a6d0?{'count':_0x5d6d29,'rows':_0x40a6d0}:null;}})['then'](respondWithResult(_0x3ebc5c,null))['catch'](handleError(_0x3ebc5c,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 8e52d08..55077df 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 _0x37eb=['events','../../mysqldb','CmList','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x15f21b,_0x3bfab2){var _0x5df796=function(_0xf02d4b){while(--_0xf02d4b){_0x15f21b['push'](_0x15f21b['shift']());}};_0x5df796(++_0x3bfab2);}(_0x37eb,0xaa));var _0xb37e=function(_0x881b32,_0x57c2f9){_0x881b32=_0x881b32-0x0;var _0x5ed3ed=_0x37eb[_0x881b32];return _0x5ed3ed;};'use strict';var EventEmitter=require(_0xb37e('0x0'));var CmList=require(_0xb37e('0x1'))['db'][_0xb37e('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb37e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb37e('0x4'),'afterDestroy':_0xb37e('0x5')};function emitEvent(_0x3bae7d){return function(_0xaab33f,_0x456c72,_0xa50308){CmListEvents[_0xb37e('0x6')](_0x3bae7d+':'+_0xaab33f['id'],_0xaab33f);CmListEvents[_0xb37e('0x6')](_0x3bae7d,_0xaab33f);_0xa50308(null);};}for(var e in events){if(events[_0xb37e('0x7')](e)){var event=events[e];CmList[_0xb37e('0x8')](e,emitEvent(event));}}module[_0xb37e('0x9')]=CmListEvents; \ No newline at end of file +var _0x5c0b=['update','remove','emit','hook','exports','../../mysqldb','CmList','setMaxListeners','save'];(function(_0xc39a3f,_0x1f8349){var _0x578f18=function(_0x5c6210){while(--_0x5c6210){_0xc39a3f['push'](_0xc39a3f['shift']());}};_0x578f18(++_0x1f8349);}(_0x5c0b,0x71));var _0xb5c0=function(_0x41f474,_0x5f23a3){_0x41f474=_0x41f474-0x0;var _0x2e81df=_0x5c0b[_0x41f474];return _0x2e81df;};'use strict';var EventEmitter=require('events');var CmList=require(_0xb5c0('0x0'))['db'][_0xb5c0('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0xb5c0('0x2')](0x0);var events={'afterCreate':_0xb5c0('0x3'),'afterUpdate':_0xb5c0('0x4'),'afterDestroy':_0xb5c0('0x5')};function emitEvent(_0x58b734){return function(_0x32b3b6,_0x4d5bd3,_0xbe1786){CmListEvents[_0xb5c0('0x6')](_0x58b734+':'+_0x32b3b6['id'],_0x32b3b6);CmListEvents['emit'](_0x58b734,_0x32b3b6);_0xbe1786(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb5c0('0x7')](e,emitEvent(event));}}module[_0xb5c0('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index a28cf4b..86f0eeb 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 _0x9161=['cm_lists','lodash','../../config/logger','api','moment','bluebird','request-promise','CmList'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x9161,0x1a9));var _0x1916=function(_0x5182fb,_0x215179){_0x5182fb=_0x5182fb-0x0;var _0x543d04=_0x9161[_0x5182fb];return _0x543d04;};'use strict';var _=require(_0x1916('0x0'));var util=require('util');var logger=require(_0x1916('0x1'))(_0x1916('0x2'));var moment=require(_0x1916('0x3'));var BPromise=require(_0x1916('0x4'));var rp=require(_0x1916('0x5'));var attributes=require('./cmList.attributes');module['exports']=function(_0x2050da,_0x23b68d){return _0x2050da['define'](_0x1916('0x6'),attributes,{'tableName':_0x1916('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa59d=['define','util','../../config/logger','api','moment','bluebird','request-promise','./cmList.attributes','exports'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xa59d,0x1de));var _0xda59=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa59d[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xda59('0x0'));var logger=require(_0xda59('0x1'))(_0xda59('0x2'));var moment=require(_0xda59('0x3'));var BPromise=require(_0xda59('0x4'));var rp=require(_0xda59('0x5'));var attributes=require(_0xda59('0x6'));module[_0xda59('0x7')]=function(_0x4a940d,_0x8ba70a){return _0x4a940d[_0xda59('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 98588c9..b45dd8e 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 _0x54b6=['code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5f4add,_0x4280ae){var _0x3f1414=function(_0x47f9a1){while(--_0x47f9a1){_0x5f4add['push'](_0x5f4add['shift']());}};_0x3f1414(++_0x4280ae);}(_0x54b6,0x1d6));var _0x654b=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x54b6[_0x34bc6c];return _0x168820;};'use strict';var _=require(_0x654b('0x0'));var util=require(_0x654b('0x1'));var moment=require('moment');var BPromise=require(_0x654b('0x2'));var rs=require(_0x654b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x654b('0x4'))['db'];var utils=require(_0x654b('0x5'));var logger=require('../../config/logger')(_0x654b('0x6'));var config=require(_0x654b('0x7'));var jayson=require(_0x654b('0x8'));var client=jayson[_0x654b('0x9')]['http']({'port':0x232a});config[_0x654b('0xa')]=_[_0x654b('0xb')](config[_0x654b('0xa')],{'host':_0x654b('0xc'),'port':0x18eb});var socket=require(_0x654b('0xd'))(new Redis(config[_0x654b('0xa')]));require(_0x654b('0xe'))[_0x654b('0xf')](socket);function respondWithRpcPromise(_0x4b828a,_0x4bfca3,_0x53479b){return new BPromise(function(_0x1975c7,_0x330f89){return client[_0x654b('0x10')](_0x4b828a,_0x53479b)[_0x654b('0x11')](function(_0x39af53){logger[_0x654b('0x12')](_0x654b('0x13'),_0x4bfca3,_0x654b('0x14'));logger['debug'](_0x654b('0x15'),_0x4bfca3,_0x654b('0x14'),JSON[_0x654b('0x16')](_0x39af53));if(_0x39af53[_0x654b('0x17')]){if(_0x39af53[_0x654b('0x17')][_0x654b('0x18')]===0x1f4){logger[_0x654b('0x17')](_0x654b('0x13'),_0x4bfca3,_0x39af53[_0x654b('0x17')][_0x654b('0x19')]);return _0x330f89(_0x39af53[_0x654b('0x17')][_0x654b('0x19')]);}logger['error'](_0x654b('0x13'),_0x4bfca3,_0x39af53[_0x654b('0x17')]['message']);return _0x1975c7(_0x39af53[_0x654b('0x17')][_0x654b('0x19')]);}else{logger['info'](_0x654b('0x13'),_0x4bfca3,_0x654b('0x14'));_0x1975c7(_0x39af53['result'][_0x654b('0x19')]);}})['catch'](function(_0x2ddaa4){logger['error'](_0x654b('0x13'),_0x4bfca3,_0x2ddaa4);_0x330f89(_0x2ddaa4);});});} \ No newline at end of file +var _0xcd5f=['register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket'];(function(_0x1716ac,_0x245897){var _0xa54aaa=function(_0x4f919b){while(--_0x4f919b){_0x1716ac['push'](_0x1716ac['shift']());}};_0xa54aaa(++_0x245897);}(_0xcd5f,0x124));var _0xfcd5=function(_0x11e6f8,_0x895e21){_0x11e6f8=_0x11e6f8-0x0;var _0x5f4908=_0xcd5f[_0x11e6f8];return _0x5f4908;};'use strict';var _=require(_0xfcd5('0x0'));var util=require(_0xfcd5('0x1'));var moment=require(_0xfcd5('0x2'));var BPromise=require(_0xfcd5('0x3'));var rs=require(_0xfcd5('0x4'));var fs=require('fs');var Redis=require(_0xfcd5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfcd5('0x6'));var logger=require('../../config/logger')(_0xfcd5('0x7'));var config=require(_0xfcd5('0x8'));var jayson=require(_0xfcd5('0x9'));var client=jayson[_0xfcd5('0xa')]['http']({'port':0x232a});config[_0xfcd5('0xb')]=_[_0xfcd5('0xc')](config[_0xfcd5('0xb')],{'host':_0xfcd5('0xd'),'port':0x18eb});var socket=require(_0xfcd5('0xe'))(new Redis(config[_0xfcd5('0xb')]));require(_0xfcd5('0xf'))[_0xfcd5('0x10')](socket);function respondWithRpcPromise(_0x4fe601,_0x3ee689,_0x2d2ee7){return new BPromise(function(_0x18fe9b,_0x566380){return client[_0xfcd5('0x11')](_0x4fe601,_0x2d2ee7)[_0xfcd5('0x12')](function(_0x4d2866){logger[_0xfcd5('0x13')](_0xfcd5('0x14'),_0x3ee689,_0xfcd5('0x15'));logger['debug'](_0xfcd5('0x16'),_0x3ee689,_0xfcd5('0x15'),JSON[_0xfcd5('0x17')](_0x4d2866));if(_0x4d2866[_0xfcd5('0x18')]){if(_0x4d2866['error'][_0xfcd5('0x19')]===0x1f4){logger[_0xfcd5('0x18')](_0xfcd5('0x14'),_0x3ee689,_0x4d2866[_0xfcd5('0x18')][_0xfcd5('0x1a')]);return _0x566380(_0x4d2866[_0xfcd5('0x18')][_0xfcd5('0x1a')]);}logger['error'](_0xfcd5('0x14'),_0x3ee689,_0x4d2866[_0xfcd5('0x18')][_0xfcd5('0x1a')]);return _0x18fe9b(_0x4d2866[_0xfcd5('0x18')][_0xfcd5('0x1a')]);}else{logger[_0xfcd5('0x13')](_0xfcd5('0x14'),_0x3ee689,'request\x20sent');_0x18fe9b(_0x4d2866['result']['message']);}})[_0xfcd5('0x1b')](function(_0x3e1f59){logger[_0xfcd5('0x18')](_0xfcd5('0x14'),_0x3ee689,_0x3e1f59);_0x566380(_0x3e1f59);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 9e011d5..8efb3f5 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 _0x6ce4=['emit','removeListener','length','cmList:','./cmList.events','save','remove','update'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6ce4,0x11c));var _0x46ce=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6ce4[_0x321bb2];return _0x9c12ed;};'use strict';var CmListEvents=require(_0x46ce('0x0'));var events=[_0x46ce('0x1'),_0x46ce('0x2'),_0x46ce('0x3')];function createListener(_0x2c7d71,_0x5eb649){return function(_0x109a99){_0x5eb649[_0x46ce('0x4')](_0x2c7d71,_0x109a99);};}function removeListener(_0x3e8719,_0x5a6ffd){return function(){CmListEvents[_0x46ce('0x5')](_0x3e8719,_0x5a6ffd);};}exports['register']=function(_0x3a778e){for(var _0x9b1ddf=0x0,_0x328320=events[_0x46ce('0x6')];_0x9b1ddf<_0x328320;_0x9b1ddf++){var _0x545e71=events[_0x9b1ddf];var _0x5bddfa=createListener(_0x46ce('0x7')+_0x545e71,_0x3a778e);CmListEvents['on'](_0x545e71,_0x5bddfa);}}; \ No newline at end of file +var _0x767b=['cmList:','./cmList.events','save','remove','update','emit','register'];(function(_0x47a8c0,_0x4d5931){var _0x551fa1=function(_0x45ac5a){while(--_0x45ac5a){_0x47a8c0['push'](_0x47a8c0['shift']());}};_0x551fa1(++_0x4d5931);}(_0x767b,0x1e4));var _0xb767=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0x767b[_0x4cd690];return _0x4a74a9;};'use strict';var CmListEvents=require(_0xb767('0x0'));var events=[_0xb767('0x1'),_0xb767('0x2'),_0xb767('0x3')];function createListener(_0x1cbd74,_0xfccf61){return function(_0x8540b7){_0xfccf61[_0xb767('0x4')](_0x1cbd74,_0x8540b7);};}function removeListener(_0x3ac10f,_0x4d23ea){return function(){CmListEvents['removeListener'](_0x3ac10f,_0x4d23ea);};}exports[_0xb767('0x5')]=function(_0x5b6219){for(var _0x1ed021=0x0,_0x49783f=events['length'];_0x1ed021<_0x49783f;_0x1ed021++){var _0x1427a5=events[_0x1ed021];var _0x44ca5b=createListener(_0xb767('0x6')+_0x1427a5,_0x5b6219);CmListEvents['on'](_0x1427a5,_0x44ca5b);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 8767406..caa1607 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 _0xd41b=['addCustomField','addAgents','put','update','destroy','delete','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','post','/:id/contacts','addContacts'];(function(_0x51ffac,_0x38f997){var _0x4ca869=function(_0x26ea74){while(--_0x26ea74){_0x51ffac['push'](_0x51ffac['shift']());}};_0x4ca869(++_0x38f997);}(_0xd41b,0x89));var _0xbd41=function(_0x5a3970,_0x3b9c38){_0x5a3970=_0x5a3970-0x0;var _0x12e2ed=_0xd41b[_0x5a3970];return _0x12e2ed;};'use strict';var multer=require(_0xbd41('0x0'));var util=require('util');var path=require(_0xbd41('0x1'));var timeout=require(_0xbd41('0x2'));var express=require(_0xbd41('0x3'));var router=express[_0xbd41('0x4')]();var auth=require(_0xbd41('0x5'));var interaction=require(_0xbd41('0x6'));var config=require('../../config/environment');var controller=require(_0xbd41('0x7'));router[_0xbd41('0x8')]('/',auth[_0xbd41('0x9')](),controller[_0xbd41('0xa')]);router[_0xbd41('0x8')](_0xbd41('0xb'),auth[_0xbd41('0x9')](),controller[_0xbd41('0xc')]);router[_0xbd41('0x8')](_0xbd41('0xd'),auth[_0xbd41('0x9')](),controller[_0xbd41('0xe')]);router[_0xbd41('0x8')](_0xbd41('0xf'),auth[_0xbd41('0x9')](),controller['getDispositions']);router[_0xbd41('0x8')]('/:id/contacts',auth[_0xbd41('0x9')](),controller[_0xbd41('0x10')]);router[_0xbd41('0x8')](_0xbd41('0x11'),auth[_0xbd41('0x9')](),controller['getContactsCsv']);router[_0xbd41('0x8')](_0xbd41('0x12'),auth['isAuthenticated'](),controller[_0xbd41('0x13')]);router['get']('/:id/users',auth[_0xbd41('0x9')](),controller['getAgents']);router[_0xbd41('0x14')]('/',auth[_0xbd41('0x9')](),controller['create']);router['post'](_0xbd41('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xbd41('0x14')](_0xbd41('0x15'),auth[_0xbd41('0x9')](),controller[_0xbd41('0x16')]);router[_0xbd41('0x14')](_0xbd41('0x12'),auth[_0xbd41('0x9')](),controller[_0xbd41('0x17')]);router[_0xbd41('0x14')]('/:id/users',auth[_0xbd41('0x9')](),controller[_0xbd41('0x18')]);router[_0xbd41('0x19')](_0xbd41('0xd'),auth[_0xbd41('0x9')](),controller[_0xbd41('0x1a')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xbd41('0x1b')]);router[_0xbd41('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xbd41('0x1d'),auth[_0xbd41('0x9')](),controller[_0xbd41('0x1e')]);module[_0xbd41('0x1f')]=router; \ No newline at end of file +var _0x71dc=['getCustomFields','/:id/users','getAgents','create','post','addDisposition','addCustomField','addAgents','/:id','update','delete','destroy','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields'];(function(_0x1eb98f,_0x2c14b9){var _0x4cd4fb=function(_0x97b37c){while(--_0x97b37c){_0x1eb98f['push'](_0x1eb98f['shift']());}};_0x4cd4fb(++_0x2c14b9);}(_0x71dc,0x70));var _0xc71d=function(_0x1e76bc,_0x4eea9a){_0x1e76bc=_0x1e76bc-0x0;var _0x2fab4e=_0x71dc[_0x1e76bc];return _0x2fab4e;};'use strict';var multer=require(_0xc71d('0x0'));var util=require(_0xc71d('0x1'));var path=require('path');var timeout=require(_0xc71d('0x2'));var express=require(_0xc71d('0x3'));var router=express[_0xc71d('0x4')]();var auth=require(_0xc71d('0x5'));var interaction=require(_0xc71d('0x6'));var config=require(_0xc71d('0x7'));var controller=require('./cmList.controller');router['get']('/',auth[_0xc71d('0x8')](),controller[_0xc71d('0x9')]);router[_0xc71d('0xa')](_0xc71d('0xb'),auth[_0xc71d('0x8')](),controller[_0xc71d('0xc')]);router['get']('/:id',auth[_0xc71d('0x8')](),controller[_0xc71d('0xd')]);router[_0xc71d('0xa')](_0xc71d('0xe'),auth[_0xc71d('0x8')](),controller[_0xc71d('0xf')]);router['get'](_0xc71d('0x10'),auth[_0xc71d('0x8')](),controller[_0xc71d('0x11')]);router[_0xc71d('0xa')]('/:id/contacts/csv',auth[_0xc71d('0x8')](),controller[_0xc71d('0x12')]);router[_0xc71d('0xa')](_0xc71d('0x13'),auth[_0xc71d('0x8')](),controller[_0xc71d('0x14')]);router[_0xc71d('0xa')](_0xc71d('0x15'),auth[_0xc71d('0x8')](),controller[_0xc71d('0x16')]);router['post']('/',auth[_0xc71d('0x8')](),controller[_0xc71d('0x17')]);router[_0xc71d('0x18')](_0xc71d('0xe'),auth[_0xc71d('0x8')](),controller[_0xc71d('0x19')]);router[_0xc71d('0x18')](_0xc71d('0x10'),auth[_0xc71d('0x8')](),controller['addContacts']);router[_0xc71d('0x18')](_0xc71d('0x13'),auth[_0xc71d('0x8')](),controller[_0xc71d('0x1a')]);router[_0xc71d('0x18')]('/:id/users',auth[_0xc71d('0x8')](),controller[_0xc71d('0x1b')]);router['put'](_0xc71d('0x1c'),auth[_0xc71d('0x8')](),controller[_0xc71d('0x1d')]);router[_0xc71d('0x1e')](_0xc71d('0x1c'),auth[_0xc71d('0x8')](),controller[_0xc71d('0x1f')]);router[_0xc71d('0x1e')](_0xc71d('0xe'),auth[_0xc71d('0x8')](),controller['removeDispositions']);router[_0xc71d('0x1e')](_0xc71d('0x15'),auth[_0xc71d('0x8')](),controller[_0xc71d('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 57457ca..aec93ef 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 _0x0ef5=['exports','VIRTUAL','getDataValue','STRING','sequelize'];(function(_0x46d277,_0x803e09){var _0x2e1947=function(_0x5471d8){while(--_0x5471d8){_0x46d277['push'](_0x46d277['shift']());}};_0x2e1947(++_0x803e09);}(_0x0ef5,0xc2));var _0x50ef=function(_0x355aed,_0x4e4005){_0x355aed=_0x355aed-0x0;var _0x58edd7=_0x0ef5[_0x355aed];return _0x58edd7;};'use strict';var Sequelize=require(_0x50ef('0x0'));module[_0x50ef('0x1')]={'name':{'type':Sequelize[_0x50ef('0x2')],'get':function(_0x184d4a){return this[_0x50ef('0x3')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x50ef('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x50ef('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xb51b=['STRING','exports','VIRTUAL','getDataValue'];(function(_0x26986a,_0x168f62){var _0x361f12=function(_0x1df5dc){while(--_0x1df5dc){_0x26986a['push'](_0x26986a['shift']());}};_0x361f12(++_0x168f62);}(_0xb51b,0xd9));var _0xbb51=function(_0x5a880f,_0x40b3d9){_0x5a880f=_0x5a880f-0x0;var _0x7001d7=_0xb51b[_0x5a880f];return _0x7001d7;};'use strict';var Sequelize=require('sequelize');module[_0xbb51('0x0')]={'name':{'type':Sequelize[_0xbb51('0x1')],'get':function(_0x3b5623){return this[_0xbb51('0x2')]('field');}},'field':{'type':Sequelize[_0xbb51('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xbb51('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xbb51('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index b761d6f..06edf62 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 _0x6c76=['then','destroy','error','stack','name','body','Condition','find','params','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update'];(function(_0x426076,_0xfdf5d2){var _0x1e9565=function(_0x38832a){while(--_0x38832a){_0x426076['push'](_0x426076['shift']());}};_0x1e9565(++_0xfdf5d2);}(_0x6c76,0x184));var _0x66c7=function(_0x3f5809,_0xdc526a){_0x3f5809=_0x3f5809-0x0;var _0x18ba9b=_0x6c76[_0x3f5809];return _0x18ba9b;};'use strict';var pdf=require(_0x66c7('0x0'));var emlformat=require(_0x66c7('0x1'));var rimraf=require(_0x66c7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66c7('0x3'));var rp=require(_0x66c7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x66c7('0x5'));var util=require(_0x66c7('0x6'));var path=require('path');var sox=require(_0x66c7('0x7'));var csv=require(_0x66c7('0x8'));var ejs=require('ejs');var fs=require('fs');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('0x8'));var querystring=require('querystring');var Papa=require(_0x66c7('0xc'));var authService=require(_0x66c7('0xd'));var hardwareService=require(_0x66c7('0xe'));var Redis=require(_0x66c7('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x66c7('0x10'))(_0x66c7('0x11'));var utils=require(_0x66c7('0x12'));var config=require(_0x66c7('0x13'));var db=require(_0x66c7('0x14'))['db'];function respondWithStatusCode(_0x406e41,_0x174717){_0x174717=_0x174717||0xcc;return function(_0x5176a3){if(_0x5176a3){return _0x406e41[_0x66c7('0x15')](_0x174717);}return _0x406e41[_0x66c7('0x16')](_0x174717)[_0x66c7('0x17')]();};}function respondWithResult(_0xea3f56,_0x4f6c91){_0x4f6c91=_0x4f6c91||0xc8;return function(_0x1e91d1){if(_0x1e91d1){return _0xea3f56[_0x66c7('0x16')](_0x4f6c91)[_0x66c7('0x18')](_0x1e91d1);}};}function respondWithFilteredResult(_0x6400fe,_0x5d44e1){return function(_0x110f6d){if(_0x110f6d){var _0x4dd902=_0x110f6d[_0x66c7('0x19')],_0x208010=_0x5d44e1[_0x66c7('0x1a')],_0x39f951=_0x5d44e1['offset']+_0x5d44e1['limit'],_0x3c81c0;if(_0x39f951>=_0x4dd902){_0x39f951=_0x4dd902;_0x3c81c0=0xc8;}else{_0x3c81c0=0xce;}_0x6400fe['status'](_0x3c81c0);return _0x6400fe['set'](_0x66c7('0x1b'),_0x208010+'-'+_0x39f951+'/'+_0x4dd902)[_0x66c7('0x18')](_0x110f6d);}return null;};}function patchUpdates(_0x47a299){return function(_0x524e87){try{jsonpatch[_0x66c7('0x1c')](_0x524e87,_0x47a299,!![]);}catch(_0x9b65cf){return BPromise[_0x66c7('0x1d')](_0x9b65cf);}return _0x524e87[_0x66c7('0x1e')]();};}function saveUpdates(_0x52437d,_0x49a3c7){return function(_0x1853b2){if(_0x1853b2){return _0x1853b2[_0x66c7('0x1f')](_0x52437d)[_0x66c7('0x20')](function(_0x1c43c4){return _0x1c43c4;});}return null;};}function removeEntity(_0x465457,_0x75f118){return function(_0x4804cf){if(_0x4804cf){return _0x4804cf[_0x66c7('0x21')]()[_0x66c7('0x20')](function(){_0x465457['status'](0xcc)[_0x66c7('0x17')]();});}};}function handleEntityNotFound(_0x8b96b1,_0x44bdef){return function(_0x1fc9d3){if(!_0x1fc9d3){_0x8b96b1['sendStatus'](0x194);}return _0x1fc9d3;};}function handleError(_0x2736df,_0x42ca37){_0x42ca37=_0x42ca37||0x1f4;return function(_0x5b28e6){logger[_0x66c7('0x22')](_0x5b28e6[_0x66c7('0x23')]);if(_0x5b28e6[_0x66c7('0x24')]){delete _0x5b28e6[_0x66c7('0x24')];}_0x2736df[_0x66c7('0x16')](_0x42ca37)['send'](_0x5b28e6);};}exports['update']=function(_0x4e514a,_0x2dd131){if(_0x4e514a[_0x66c7('0x25')]['id']){delete _0x4e514a['body']['id'];}return db[_0x66c7('0x26')][_0x66c7('0x27')]({'where':{'id':_0x4e514a[_0x66c7('0x28')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x2dd131,null))[_0x66c7('0x20')](saveUpdates(_0x4e514a[_0x66c7('0x25')],null))['then'](respondWithResult(_0x2dd131,null))[_0x66c7('0x29')](handleError(_0x2dd131,null));};exports[_0x66c7('0x21')]=function(_0xc4b2bf,_0x33be23){return db[_0x66c7('0x26')]['find']({'where':{'id':_0xc4b2bf[_0x66c7('0x28')]['id']}})['then'](handleEntityNotFound(_0x33be23,null))[_0x66c7('0x20')](removeEntity(_0x33be23,null))['catch'](handleError(_0x33be23,null));}; \ No newline at end of file +var _0xb58b=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','params','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis'];(function(_0x527ee5,_0x4b355b){var _0x2fce73=function(_0x33caf7){while(--_0x33caf7){_0x527ee5['push'](_0x527ee5['shift']());}};_0x2fce73(++_0x4b355b);}(_0xb58b,0x1f1));var _0xbb58=function(_0x512626,_0x227793){_0x512626=_0x512626-0x0;var _0x2cf3f6=_0xb58b[_0x512626];return _0x2cf3f6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbb58('0x0'));var rimraf=require(_0xbb58('0x1'));var zipdir=require(_0xbb58('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb58('0x3'));var moment=require(_0xbb58('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb58('0x5'));var util=require('util');var path=require(_0xbb58('0x6'));var sox=require(_0xbb58('0x7'));var csv=require(_0xbb58('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x8'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var authService=require(_0xbb58('0x10'));var hardwareService=require(_0xbb58('0x11'));var Redis=require(_0xbb58('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0xbb58('0x13'))('api');var utils=require(_0xbb58('0x14'));var config=require(_0xbb58('0x15'));var db=require(_0xbb58('0x16'))['db'];function respondWithStatusCode(_0x19d185,_0x485929){_0x485929=_0x485929||0xcc;return function(_0xe88799){if(_0xe88799){return _0x19d185[_0xbb58('0x17')](_0x485929);}return _0x19d185['status'](_0x485929)[_0xbb58('0x18')]();};}function respondWithResult(_0xdc68b9,_0x14106f){_0x14106f=_0x14106f||0xc8;return function(_0x3b9406){if(_0x3b9406){return _0xdc68b9[_0xbb58('0x19')](_0x14106f)['json'](_0x3b9406);}};}function respondWithFilteredResult(_0x110944,_0x23fd15){return function(_0x5f4751){if(_0x5f4751){var _0x4ba30e=_0x5f4751['count'],_0x33c20f=_0x23fd15['offset'],_0x445b1f=_0x23fd15['offset']+_0x23fd15['limit'],_0x38d69a;if(_0x445b1f>=_0x4ba30e){_0x445b1f=_0x4ba30e;_0x38d69a=0xc8;}else{_0x38d69a=0xce;}_0x110944[_0xbb58('0x19')](_0x38d69a);return _0x110944[_0xbb58('0x1a')]('Content-Range',_0x33c20f+'-'+_0x445b1f+'/'+_0x4ba30e)[_0xbb58('0x1b')](_0x5f4751);}return null;};}function patchUpdates(_0x497653){return function(_0x2cf892){try{jsonpatch[_0xbb58('0x1c')](_0x2cf892,_0x497653,!![]);}catch(_0x3c33d9){return BPromise[_0xbb58('0x1d')](_0x3c33d9);}return _0x2cf892[_0xbb58('0x1e')]();};}function saveUpdates(_0x37a655,_0x32d694){return function(_0x497fd0){if(_0x497fd0){return _0x497fd0[_0xbb58('0x1f')](_0x37a655)[_0xbb58('0x20')](function(_0x3e64fe){return _0x3e64fe;});}return null;};}function removeEntity(_0x3b4dc6,_0x32153a){return function(_0x5d4a91){if(_0x5d4a91){return _0x5d4a91[_0xbb58('0x21')]()[_0xbb58('0x20')](function(){_0x3b4dc6[_0xbb58('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27806d,_0x53b693){return function(_0x21964d){if(!_0x21964d){_0x27806d[_0xbb58('0x17')](0x194);}return _0x21964d;};}function handleError(_0x152f22,_0x3e215c){_0x3e215c=_0x3e215c||0x1f4;return function(_0x2d111c){logger[_0xbb58('0x22')](_0x2d111c[_0xbb58('0x23')]);if(_0x2d111c[_0xbb58('0x24')]){delete _0x2d111c['name'];}_0x152f22[_0xbb58('0x19')](_0x3e215c)[_0xbb58('0x25')](_0x2d111c);};}exports[_0xbb58('0x1f')]=function(_0x129094,_0x8e9ed9){if(_0x129094[_0xbb58('0x26')]['id']){delete _0x129094[_0xbb58('0x26')]['id'];}return db[_0xbb58('0x27')][_0xbb58('0x28')]({'where':{'id':_0x129094[_0xbb58('0x29')]['id']}})[_0xbb58('0x20')](handleEntityNotFound(_0x8e9ed9,null))[_0xbb58('0x20')](saveUpdates(_0x129094[_0xbb58('0x26')],null))[_0xbb58('0x20')](respondWithResult(_0x8e9ed9,null))[_0xbb58('0x2a')](handleError(_0x8e9ed9,null));};exports['destroy']=function(_0x2b0f73,_0xe46bc1){return db[_0xbb58('0x27')][_0xbb58('0x28')]({'where':{'id':_0x2b0f73[_0xbb58('0x29')]['id']}})[_0xbb58('0x20')](handleEntityNotFound(_0xe46bc1,null))[_0xbb58('0x20')](removeEntity(_0xe46bc1,null))[_0xbb58('0x2a')](handleError(_0xe46bc1,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 0f96efe..25f3541 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 _0xddf8=['util','../../config/logger','api','moment','bluebird','request-promise','./condition.attributes','exports','tools_conditions','lodash'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xddf8,0xa9));var _0x8ddf=function(_0xe25556,_0x5d2e45){_0xe25556=_0xe25556-0x0;var _0x184848=_0xddf8[_0xe25556];return _0x184848;};'use strict';var _=require(_0x8ddf('0x0'));var util=require(_0x8ddf('0x1'));var logger=require(_0x8ddf('0x2'))(_0x8ddf('0x3'));var moment=require(_0x8ddf('0x4'));var BPromise=require(_0x8ddf('0x5'));var rp=require(_0x8ddf('0x6'));var attributes=require(_0x8ddf('0x7'));module[_0x8ddf('0x8')]=function(_0x182151,_0x4aabeb){return _0x182151['define']('Condition',attributes,{'tableName':_0x8ddf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b63=['util','api','bluebird','request-promise','./condition.attributes','exports','define','lodash'];(function(_0x2007c3,_0x4edb29){var _0x1ee130=function(_0x2a5763){while(--_0x2a5763){_0x2007c3['push'](_0x2007c3['shift']());}};_0x1ee130(++_0x4edb29);}(_0x2b63,0xef));var _0x32b6=function(_0x350f57,_0x1cb1d5){_0x350f57=_0x350f57-0x0;var _0x2758c=_0x2b63[_0x350f57];return _0x2758c;};'use strict';var _=require(_0x32b6('0x0'));var util=require(_0x32b6('0x1'));var logger=require('../../config/logger')(_0x32b6('0x2'));var moment=require('moment');var BPromise=require(_0x32b6('0x3'));var rp=require(_0x32b6('0x4'));var attributes=require(_0x32b6('0x5'));module[_0x32b6('0x6')]=function(_0x4aa68c,_0x15f8c3){return _0x4aa68c[_0x32b6('0x7')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index aa12c34..617edc4 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 _0xe242=['../../config/logger','rpc','jayson/promise','client','http','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0xe242,0x1b2));var _0x2e24=function(_0x5af052,_0xaf173a){_0x5af052=_0x5af052-0x0;var _0x4f4789=_0xe242[_0x5af052];return _0x4f4789;};'use strict';var _=require(_0x2e24('0x0'));var util=require(_0x2e24('0x1'));var moment=require('moment');var BPromise=require(_0x2e24('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e24('0x3'));var db=require(_0x2e24('0x4'))['db'];var utils=require(_0x2e24('0x5'));var logger=require(_0x2e24('0x6'))(_0x2e24('0x7'));var config=require('../../config/environment');var jayson=require(_0x2e24('0x8'));var client=jayson[_0x2e24('0x9')][_0x2e24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d756c,_0x85368a,_0x576da8){return new BPromise(function(_0x5ae9af,_0x48a794){return client['request'](_0x3d756c,_0x576da8)['then'](function(_0x429e2e){logger['info'](_0x2e24('0xb'),_0x85368a,_0x2e24('0xc'));logger[_0x2e24('0xd')](_0x2e24('0xe'),_0x85368a,'request\x20sent',JSON[_0x2e24('0xf')](_0x429e2e));if(_0x429e2e['error']){if(_0x429e2e['error'][_0x2e24('0x10')]===0x1f4){logger[_0x2e24('0x11')](_0x2e24('0xb'),_0x85368a,_0x429e2e[_0x2e24('0x11')][_0x2e24('0x12')]);return _0x48a794(_0x429e2e[_0x2e24('0x11')][_0x2e24('0x12')]);}logger[_0x2e24('0x11')](_0x2e24('0xb'),_0x85368a,_0x429e2e[_0x2e24('0x11')][_0x2e24('0x12')]);return _0x5ae9af(_0x429e2e[_0x2e24('0x11')][_0x2e24('0x12')]);}else{logger['info'](_0x2e24('0xb'),_0x85368a,_0x2e24('0xc'));_0x5ae9af(_0x429e2e[_0x2e24('0x13')]['message']);}})['catch'](function(_0x5245aa){logger['error'](_0x2e24('0xb'),_0x85368a,_0x5245aa);_0x48a794(_0x5245aa);});});} \ No newline at end of file +var _0x6412=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring'];(function(_0x3b6fd9,_0x1e4363){var _0x25c92e=function(_0x596db9){while(--_0x596db9){_0x3b6fd9['push'](_0x3b6fd9['shift']());}};_0x25c92e(++_0x1e4363);}(_0x6412,0x7a));var _0x2641=function(_0x464bea,_0x4b9258){_0x464bea=_0x464bea-0x0;var _0x1d7d37=_0x6412[_0x464bea];return _0x1d7d37;};'use strict';var _=require(_0x2641('0x0'));var util=require(_0x2641('0x1'));var moment=require(_0x2641('0x2'));var BPromise=require('bluebird');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('../../config/logger')(_0x2641('0x7'));var config=require(_0x2641('0x8'));var jayson=require(_0x2641('0x9'));var client=jayson['client'][_0x2641('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32ecac,_0x18c3d0,_0x45cf33){return new BPromise(function(_0xa72bb8,_0x5dfc0c){return client['request'](_0x32ecac,_0x45cf33)[_0x2641('0xb')](function(_0x325381){logger[_0x2641('0xc')](_0x2641('0xd'),_0x18c3d0,_0x2641('0xe'));logger[_0x2641('0xf')](_0x2641('0x10'),_0x18c3d0,_0x2641('0xe'),JSON[_0x2641('0x11')](_0x325381));if(_0x325381[_0x2641('0x12')]){if(_0x325381[_0x2641('0x12')][_0x2641('0x13')]===0x1f4){logger[_0x2641('0x12')]('Condition,\x20%s,\x20%s',_0x18c3d0,_0x325381['error']['message']);return _0x5dfc0c(_0x325381[_0x2641('0x12')][_0x2641('0x14')]);}logger[_0x2641('0x12')](_0x2641('0xd'),_0x18c3d0,_0x325381[_0x2641('0x12')][_0x2641('0x14')]);return _0xa72bb8(_0x325381[_0x2641('0x12')][_0x2641('0x14')]);}else{logger['info'](_0x2641('0xd'),_0x18c3d0,_0x2641('0xe'));_0xa72bb8(_0x325381['result'][_0x2641('0x14')]);}})['catch'](function(_0x2c54e4){logger['error'](_0x2641('0xd'),_0x18c3d0,_0x2c54e4);_0x5dfc0c(_0x2c54e4);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 63a1365..4b6b6ab 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 _0x9981=['../../components/interaction/service','../../config/environment','put','/:id','delete','isAuthenticated','multer','util','path','connect-timeout','Router'];(function(_0x5a6881,_0x36d293){var _0x102b57=function(_0x1e323b){while(--_0x1e323b){_0x5a6881['push'](_0x5a6881['shift']());}};_0x102b57(++_0x36d293);}(_0x9981,0x103));var _0x1998=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9981[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0x1998('0x0'));var util=require(_0x1998('0x1'));var path=require(_0x1998('0x2'));var timeout=require(_0x1998('0x3'));var express=require('express');var router=express[_0x1998('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1998('0x5'));var config=require(_0x1998('0x6'));var controller=require('./condition.controller');router[_0x1998('0x7')](_0x1998('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x1998('0x9')]('/:id',auth[_0x1998('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4b31=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','put','isAuthenticated','delete','/:id','destroy','exports','util'];(function(_0x435283,_0x56cfd9){var _0x100daa=function(_0x15acad){while(--_0x15acad){_0x435283['push'](_0x435283['shift']());}};_0x100daa(++_0x56cfd9);}(_0x4b31,0xcf));var _0x14b3=function(_0xd553ab,_0x788918){_0xd553ab=_0xd553ab-0x0;var _0x215442=_0x4b31[_0xd553ab];return _0x215442;};'use strict';var multer=require('multer');var util=require(_0x14b3('0x0'));var path=require(_0x14b3('0x1'));var timeout=require(_0x14b3('0x2'));var express=require(_0x14b3('0x3'));var router=express['Router']();var auth=require(_0x14b3('0x4'));var interaction=require(_0x14b3('0x5'));var config=require(_0x14b3('0x6'));var controller=require('./condition.controller');router[_0x14b3('0x7')]('/:id',auth[_0x14b3('0x8')](),controller['update']);router[_0x14b3('0x9')](_0x14b3('0xa'),auth[_0x14b3('0x8')](),controller[_0x14b3('0xb')]);module[_0x14b3('0xc')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 11b03c0..528066c 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 _0x5829=['STRING','name'];(function(_0x28b163,_0x329551){var _0x8736ed=function(_0x26ff61){while(--_0x26ff61){_0x28b163['push'](_0x28b163['shift']());}};_0x8736ed(++_0x329551);}(_0x5829,0xee));var _0x9582=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x5829[_0x1694f5];return _0x5b4321;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9582('0x0')],'allowNull':![],'unique':_0x9582('0x1')},'description':{'type':Sequelize[_0x9582('0x0')]}}; \ No newline at end of file +var _0xde52=['name','sequelize','exports','STRING'];(function(_0x24aa4a,_0x1c646b){var _0x535e05=function(_0x58f365){while(--_0x58f365){_0x24aa4a['push'](_0x24aa4a['shift']());}};_0x535e05(++_0x1c646b);}(_0xde52,0x10d));var _0x2de5=function(_0x4d0dd5,_0x5a4b37){_0x4d0dd5=_0x4d0dd5-0x0;var _0x53de50=_0xde52[_0x4d0dd5];return _0x53de50;};'use strict';var Sequelize=require(_0x2de5('0x0'));module[_0x2de5('0x1')]={'name':{'type':Sequelize[_0x2de5('0x2')],'allowNull':![],'unique':_0x2de5('0x3')},'description':{'type':Sequelize[_0x2de5('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index dd17c4e..23d047b 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 _0x6598=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','error','stack','name','send','Dashboard','rawAttributes','keys','query','filters','intersection','model','attributes','fields','order','sort','where','pick','merge','type','key','filter','options','includeAll','include','rows','catch','show','params','length','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','userProfileId','UserProfileResource','iframe','attrUrl','attrs','value','https://','custom','attrPath','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','map','getItems','hasOwnProperty','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x51a3ee,_0x38f16d){var _0x25048a=function(_0x3d1d07){while(--_0x3d1d07){_0x51a3ee['push'](_0x51a3ee['shift']());}};_0x25048a(++_0x38f16d);}(_0x6598,0xe2));var _0x8659=function(_0x3167de,_0x4ab6cf){_0x3167de=_0x3167de-0x0;var _0x13736b=_0x6598[_0x3167de];return _0x13736b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8659('0x0'));var rimraf=require(_0x8659('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8659('0x2'));var rp=require(_0x8659('0x3'));var moment=require(_0x8659('0x4'));var BPromise=require(_0x8659('0x5'));var Mustache=require(_0x8659('0x6'));var util=require(_0x8659('0x7'));var path=require(_0x8659('0x8'));var sox=require(_0x8659('0x9'));var csv=require(_0x8659('0xa'));var ejs=require(_0x8659('0xb'));var fs=require('fs');var _=require(_0x8659('0xc'));var squel=require(_0x8659('0xd'));var crypto=require(_0x8659('0xe'));var jsforce=require(_0x8659('0xf'));var deskjs=require(_0x8659('0x10'));var toCsv=require(_0x8659('0xa'));var querystring=require('querystring');var Papa=require(_0x8659('0x11'));var authService=require(_0x8659('0x12'));var hardwareService=require(_0x8659('0x13'));var Redis=require(_0x8659('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0x8659('0x15'))(_0x8659('0x16'));var utils=require(_0x8659('0x17'));var config=require(_0x8659('0x18'));var db=require(_0x8659('0x19'))['db'];config[_0x8659('0x1a')]=_[_0x8659('0x1b')](config[_0x8659('0x1a')],{'host':_0x8659('0x1c'),'port':0x18eb});var socket=require(_0x8659('0x1d'))(new Redis(config[_0x8659('0x1a')]));require(_0x8659('0x1e'))['register'](socket);function respondWithStatusCode(_0x328f41,_0x449145){_0x449145=_0x449145||0xcc;return function(_0xc29343){if(_0xc29343){return _0x328f41[_0x8659('0x1f')](_0x449145);}return _0x328f41[_0x8659('0x20')](_0x449145)[_0x8659('0x21')]();};}function respondWithResult(_0x2fea2e,_0x265a10){_0x265a10=_0x265a10||0xc8;return function(_0x3b1b0b){if(_0x3b1b0b){return _0x2fea2e[_0x8659('0x20')](_0x265a10)[_0x8659('0x22')](_0x3b1b0b);}};}function respondWithFilteredResult(_0x46c113,_0xcea733){return function(_0xd272b6){if(_0xd272b6){var _0x3c0028=_0xd272b6[_0x8659('0x23')],_0xaac04b=_0xcea733[_0x8659('0x24')],_0x278333=_0xcea733[_0x8659('0x24')]+_0xcea733[_0x8659('0x25')],_0x57e1a2;if(_0x278333>=_0x3c0028){_0x278333=_0x3c0028;_0x57e1a2=0xc8;}else{_0x57e1a2=0xce;}_0x46c113[_0x8659('0x20')](_0x57e1a2);return _0x46c113[_0x8659('0x26')](_0x8659('0x27'),_0xaac04b+'-'+_0x278333+'/'+_0x3c0028)['json'](_0xd272b6);}return null;};}function patchUpdates(_0x161939){return function(_0x549e3f){try{jsonpatch['apply'](_0x549e3f,_0x161939,!![]);}catch(_0x4d8498){return BPromise[_0x8659('0x28')](_0x4d8498);}return _0x549e3f[_0x8659('0x29')]();};}function saveUpdates(_0x204b66,_0x1b9ff3){return function(_0x5e07bc){if(_0x5e07bc){return _0x5e07bc[_0x8659('0x2a')](_0x204b66)[_0x8659('0x2b')](function(_0x2288e8){return _0x2288e8;});}return null;};}function removeEntity(_0x1fc709,_0x401ac7){return function(_0x205d2e){if(_0x205d2e){return _0x205d2e['destroy']()[_0x8659('0x2b')](function(){var _0x3b6071=_0x205d2e[_0x8659('0x2c')]({'plain':!![]});var _0x5d0b39='CustomDashboards';return db['UserProfileResource']['destroy']({'where':{'type':_0x5d0b39,'resourceId':_0x3b6071['id']}})[_0x8659('0x2b')](function(){return _0x205d2e;});})[_0x8659('0x2b')](function(){_0x1fc709[_0x8659('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b5a51,_0x1990eb){return function(_0x5dd2f0){if(!_0x5dd2f0){_0x1b5a51[_0x8659('0x1f')](0x194);}return _0x5dd2f0;};}function handleError(_0x78ee42,_0x878cb7){_0x878cb7=_0x878cb7||0x1f4;return function(_0xe8dd18){logger[_0x8659('0x2d')](_0xe8dd18[_0x8659('0x2e')]);if(_0xe8dd18[_0x8659('0x2f')]){delete _0xe8dd18['name'];}_0x78ee42[_0x8659('0x20')](_0x878cb7)[_0x8659('0x30')](_0xe8dd18);};}exports['index']=function(_0x184db1,_0x586731){var _0x574884={},_0x2b4494={},_0x3f42d1={'count':0x0,'rows':[]};var _0x161cc8=db[_0x8659('0x31')][_0x8659('0x32')];_0x2b4494['model']=_[_0x8659('0x33')](_0x161cc8);_0x2b4494[_0x8659('0x34')]=_['keys'](_0x184db1[_0x8659('0x34')]);_0x2b4494[_0x8659('0x35')]=_[_0x8659('0x36')](_0x2b4494[_0x8659('0x37')],_0x2b4494['query']);_0x574884[_0x8659('0x38')]=_['intersection'](_0x2b4494['model'],qs[_0x8659('0x39')](_0x184db1[_0x8659('0x34')][_0x8659('0x39')]));_0x574884[_0x8659('0x38')]=_0x574884[_0x8659('0x38')]['length']?_0x574884[_0x8659('0x38')]:_0x2b4494[_0x8659('0x37')];if(!_0x184db1[_0x8659('0x34')]['hasOwnProperty']('nolimit')){_0x574884[_0x8659('0x25')]=qs['limit'](_0x184db1[_0x8659('0x34')][_0x8659('0x25')]);_0x574884[_0x8659('0x24')]=qs[_0x8659('0x24')](_0x184db1[_0x8659('0x34')][_0x8659('0x24')]);}_0x574884[_0x8659('0x3a')]=qs[_0x8659('0x3b')](_0x184db1['query'][_0x8659('0x3b')]);_0x574884[_0x8659('0x3c')]=qs[_0x8659('0x35')](_[_0x8659('0x3d')](_0x184db1['query'],_0x2b4494['filters']));if(_0x184db1['query']['filter']){_0x574884[_0x8659('0x3c')]=_[_0x8659('0x3e')](_0x574884[_0x8659('0x3c')],{'$or':_['map'](_0x161cc8,function(_0x2fece5){if(_0x2fece5[_0x8659('0x3f')][_0x8659('0x40')]!=='VIRTUAL'){var _0x117989={};_0x117989[_0x2fece5['field']]={'$like':'%'+_0x184db1[_0x8659('0x34')][_0x8659('0x41')]+'%'};return _0x117989;}})});}_0x574884=_[_0x8659('0x3e')]({},_0x574884,_0x184db1[_0x8659('0x42')]);var _0x5c10d0={'where':_0x574884[_0x8659('0x3c')]};return db[_0x8659('0x31')][_0x8659('0x23')](_0x5c10d0)[_0x8659('0x2b')](function(_0x207083){_0x3f42d1[_0x8659('0x23')]=_0x207083;if(_0x184db1[_0x8659('0x34')][_0x8659('0x43')]){_0x574884[_0x8659('0x44')]=[{'all':!![]}];}return db[_0x8659('0x31')]['findAll'](_0x574884);})[_0x8659('0x2b')](function(_0x54756c){_0x3f42d1[_0x8659('0x45')]=_0x54756c;return _0x3f42d1;})[_0x8659('0x2b')](respondWithFilteredResult(_0x586731,_0x574884))[_0x8659('0x46')](handleError(_0x586731,null));};exports[_0x8659('0x47')]=function(_0xac1936,_0x15a927){var _0x231cb0={'raw':![],'where':{'id':_0xac1936[_0x8659('0x48')]['id']}},_0xe53f67={};_0xe53f67['model']=_[_0x8659('0x33')](db['Dashboard'][_0x8659('0x32')]);_0xe53f67[_0x8659('0x34')]=_['keys'](_0xac1936[_0x8659('0x34')]);_0xe53f67[_0x8659('0x35')]=_[_0x8659('0x36')](_0xe53f67[_0x8659('0x37')],_0xe53f67[_0x8659('0x34')]);_0x231cb0['attributes']=_[_0x8659('0x36')](_0xe53f67[_0x8659('0x37')],qs[_0x8659('0x39')](_0xac1936[_0x8659('0x34')][_0x8659('0x39')]));_0x231cb0[_0x8659('0x38')]=_0x231cb0[_0x8659('0x38')][_0x8659('0x49')]?_0x231cb0[_0x8659('0x38')]:_0xe53f67[_0x8659('0x37')];if(_0xac1936[_0x8659('0x34')][_0x8659('0x43')]){_0x231cb0[_0x8659('0x44')]=[{'all':!![]}];}_0x231cb0=_[_0x8659('0x3e')]({},_0x231cb0,_0xac1936['options']);return db[_0x8659('0x31')][_0x8659('0x4a')](_0x231cb0)[_0x8659('0x2b')](handleEntityNotFound(_0x15a927,null))['then'](respondWithResult(_0x15a927,null))[_0x8659('0x46')](handleError(_0x15a927,null));};exports[_0x8659('0x4b')]=function(_0x14aa3a,_0x28f244){return db[_0x8659('0x31')][_0x8659('0x4b')](_0x14aa3a[_0x8659('0x4c')],{})[_0x8659('0x2b')](function(_0x3696d0){var _0x151481=_0x14aa3a[_0x8659('0x4d')][_0x8659('0x2c')]({'plain':!![]});if(!_0x151481)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x151481[_0x8659('0x4e')]===_0x8659('0x4d')){var _0x1cf2d2=_0x3696d0[_0x8659('0x2c')]({'plain':!![]});var _0x4354a3='CustomDashboards';return db[_0x8659('0x4f')]['find']({'where':{'name':_0x4354a3,'userProfileId':_0x151481['userProfileId']},'raw':!![]})[_0x8659('0x2b')](function(_0x53f82f){if(_0x53f82f&&_0x53f82f[_0x8659('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1cf2d2[_0x8659('0x2f')],'resourceId':_0x1cf2d2['id'],'type':_0x53f82f[_0x8659('0x2f')],'sectionId':_0x53f82f['id']},{})[_0x8659('0x2b')](function(){return _0x3696d0;});}else{return _0x3696d0;}})[_0x8659('0x46')](function(_0x4ee120){logger[_0x8659('0x2d')](_0x8659('0x51'),_0x4ee120);throw _0x4ee120;});}return _0x3696d0;})[_0x8659('0x2b')](respondWithResult(_0x28f244,0xc9))[_0x8659('0x46')](handleError(_0x28f244,null));};exports[_0x8659('0x52')]=function(_0x1a471a,_0x166b4d){var _0x5338f2={'raw':![],'where':{'id':_0x1a471a[_0x8659('0x48')]['id']}},_0x50b74={};_0x50b74[_0x8659('0x37')]=_['keys'](db[_0x8659('0x31')]['rawAttributes']);_0x5338f2[_0x8659('0x38')]=_['intersection'](_0x50b74[_0x8659('0x37')],qs['fields'](_0x1a471a[_0x8659('0x34')]['fields']));_0x5338f2[_0x8659('0x38')]=_0x5338f2['attributes'][_0x8659('0x49')]?_0x5338f2['attributes']:_0x50b74['model'];if(_0x1a471a[_0x8659('0x34')][_0x8659('0x43')]){_0x5338f2['include']=[{'all':!![]}];}_0x5338f2=_[_0x8659('0x3e')]({},_0x5338f2,_0x1a471a[_0x8659('0x42')]);return db[_0x8659('0x31')][_0x8659('0x4a')](_0x5338f2)[_0x8659('0x2b')](handleEntityNotFound(_0x166b4d,null))[_0x8659('0x2b')](function(_0x4164cd){if(_0x4164cd){var _0x3e791a=_0x4164cd[_0x8659('0x2c')]({'plain':!![]});_0x3e791a=qs['omit'](_0x3e791a,['id',_0x8659('0x53'),_0x8659('0x54')]);_0x1a471a[_0x8659('0x4c')]=_[_0x8659('0x55')](_0x1a471a[_0x8659('0x4c')],['id','createdAt','updatedAt']);return db[_0x8659('0x31')][_0x8659('0x4b')](_[_0x8659('0x3e')](_0x3e791a,_0x1a471a[_0x8659('0x4c')]),{'include':_0x1a471a['query'][_0x8659('0x43')]?[{'all':!![]}]:undefined})[_0x8659('0x2b')](function(_0x6bff3c){var _0x5bb200=_0x1a471a[_0x8659('0x4d')][_0x8659('0x2c')]({'plain':!![]});if(!_0x5bb200)throw new Error(_0x8659('0x56'));if(_0x5bb200[_0x8659('0x4e')]===_0x8659('0x4d')){var _0x226527=_0x6bff3c['get']({'plain':!![]});var _0x52f81b=_0x8659('0x57');return db['UserProfileSection'][_0x8659('0x4a')]({'where':{'name':_0x52f81b,'userProfileId':_0x5bb200[_0x8659('0x58')]},'raw':!![]})[_0x8659('0x2b')](function(_0x4966fc){if(_0x4966fc&&_0x4966fc[_0x8659('0x50')]===0x0){return db[_0x8659('0x59')]['create']({'name':_0x226527[_0x8659('0x2f')],'resourceId':_0x226527['id'],'type':_0x4966fc[_0x8659('0x2f')],'sectionId':_0x4966fc['id']},{})['then'](function(){return _0x6bff3c;});}else{return _0x6bff3c;}})['catch'](function(_0x2b19a2){logger[_0x8659('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b19a2);throw _0x2b19a2;});}return _0x6bff3c;});}})[_0x8659('0x2b')](respondWithResult(_0x166b4d,0xc9))[_0x8659('0x46')](handleError(_0x166b4d,null));};exports['update']=function(_0x3e26cc,_0x4867a6){if(_0x3e26cc[_0x8659('0x4c')]['id']){delete _0x3e26cc[_0x8659('0x4c')]['id'];}return db['Dashboard'][_0x8659('0x4a')]({'where':{'id':_0x3e26cc['params']['id']}})[_0x8659('0x2b')](handleEntityNotFound(_0x4867a6,null))['then'](saveUpdates(_0x3e26cc['body'],null))[_0x8659('0x2b')](respondWithResult(_0x4867a6,null))[_0x8659('0x46')](handleError(_0x4867a6,null));};exports['destroy']=function(_0x5b0f41,_0xb74208){return db[_0x8659('0x31')]['find']({'where':{'id':_0x5b0f41[_0x8659('0x48')]['id']}})[_0x8659('0x2b')](handleEntityNotFound(_0xb74208,null))[_0x8659('0x2b')](removeEntity(_0xb74208,null))['catch'](handleError(_0xb74208,null));};function widgetAttributes(_0x282975){try{switch(_0x282975[_0x8659('0x3f')]){case _0x8659('0x5a'):return[{'name':'attrUrl','value':_0x282975[_0x8659('0x5b')]||(_0x282975[_0x8659('0x5c')]&&_0x282975[_0x8659('0x5c')][0x0]?_0x282975[_0x8659('0x5c')][0x0][_0x8659('0x5d')]:undefined)||_0x8659('0x5e')}];case _0x8659('0x5f'):return[{'name':'attrPath','value':_0x282975[_0x8659('0x60')]||(_0x282975[_0x8659('0x5c')]&&_0x282975[_0x8659('0x5c')][0x0]?_0x282975['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x282975['attrHourFormat']||(_0x282975[_0x8659('0x5c')]&&_0x282975[_0x8659('0x5c')][0x0]?_0x282975['attrs'][0x0][_0x8659('0x5d')]:undefined)||_0x8659('0x61')},{'name':_0x8659('0x62'),'value':_0x282975[_0x8659('0x62')]||(_0x282975[_0x8659('0x5c')]&&_0x282975[_0x8659('0x5c')][0x1]?_0x282975[_0x8659('0x5c')][0x1][_0x8659('0x5d')]:undefined)||_0x8659('0x63')},{'name':'attrFontSize','value':_0x282975[_0x8659('0x64')]||(_0x282975[_0x8659('0x5c')]&&_0x282975[_0x8659('0x5c')][0x2]?_0x282975[_0x8659('0x5c')][0x2][_0x8659('0x5d')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x282975[_0x8659('0x65')]||(_0x282975['attrs']&&_0x282975[_0x8659('0x5c')][0x0]?_0x282975['attrs'][0x0][_0x8659('0x5d')]:undefined)||_0x8659('0x66')},{'name':'attrVoiceQueues','value':_0x282975[_0x8659('0x67')]||(_0x282975[_0x8659('0x5c')]&&_0x282975['attrs'][0x1]?_0x282975[_0x8659('0x5c')][0x1][_0x8659('0x5d')]:undefined)||[]},{'name':_0x8659('0x64'),'value':_0x282975[_0x8659('0x64')]||(_0x282975[_0x8659('0x5c')]&&_0x282975[_0x8659('0x5c')][0x2]?_0x282975[_0x8659('0x5c')][0x2][_0x8659('0x5d')]:undefined)||0x14}];case _0x8659('0x68'):case'pie-chart':return[{'name':'attrSerie1','value':_0x282975[_0x8659('0x69')]||(_0x282975[_0x8659('0x5c')]&&_0x282975['attrs'][0x0]?_0x282975[_0x8659('0x5c')][0x0][_0x8659('0x5d')]:undefined)||_0x8659('0x66')},{'name':'attrSerie2','value':_0x282975[_0x8659('0x6a')]||(_0x282975[_0x8659('0x5c')]&&_0x282975[_0x8659('0x5c')][0x1]?_0x282975[_0x8659('0x5c')][0x1]['value']:undefined)||null},{'name':_0x8659('0x6b'),'value':_0x282975[_0x8659('0x6b')]||(_0x282975[_0x8659('0x5c')]&&_0x282975['attrs'][0x2]?_0x282975['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x282975['attrVoiceQueues']||(_0x282975['attrs']&&_0x282975[_0x8659('0x5c')][0x3]?_0x282975[_0x8659('0x5c')][0x3][_0x8659('0x5d')]:undefined)||[]}];case _0x8659('0x6c'):return[{'name':'attrReport','type':_0x282975[_0x8659('0x6d')]||(_0x282975['attrs']&&_0x282975['attrs'][0x0]?_0x282975[_0x8659('0x5c')][0x0]['type']:undefined)||null,'value':_0x282975[_0x8659('0x6e')]||(_0x282975[_0x8659('0x5c')]&&_0x282975[_0x8659('0x5c')][0x0]?_0x282975['attrs'][0x0]['value']:undefined)||null},{'name':_0x8659('0x6f'),'value':_0x282975[_0x8659('0x6f')]||(_0x282975[_0x8659('0x5c')]&&_0x282975[_0x8659('0x5c')][0x1]?_0x282975['attrs'][0x1][_0x8659('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0xddb246){logger[_0x8659('0x2d')](_0x8659('0x70'),JSON['stringify'](_0xddb246));return[];}}exports[_0x8659('0x71')]=function(_0x36faa3,_0x47eedd,_0x17c6da){if(_0x36faa3[_0x8659('0x4c')]['id']){delete _0x36faa3[_0x8659('0x4c')]['id'];}return db['Dashboard'][_0x8659('0x4a')]({'where':{'id':_0x36faa3[_0x8659('0x48')]['id']}})[_0x8659('0x2b')](handleEntityNotFound(_0x47eedd,null))['then'](function(_0x572e21){if(_0x572e21){_0x36faa3['body'][_0x8659('0x72')]=_0x572e21['id'];_0x36faa3[_0x8659('0x4c')][_0x8659('0x5c')]=widgetAttributes(_0x36faa3['body']);return db[_0x8659('0x73')][_0x8659('0x4b')](_0x36faa3[_0x8659('0x4c')]);}})[_0x8659('0x2b')](respondWithResult(_0x47eedd,null))['catch'](handleError(_0x47eedd,null));};exports['getItems']=function(_0x18516f,_0x427e3f,_0x5596f6){var _0x59f7ce={};var _0x729efc={};var _0x569386;var _0x17ea6e;return db['Dashboard']['findOne']({'where':{'id':_0x18516f[_0x8659('0x48')]['id']}})[_0x8659('0x2b')](handleEntityNotFound(_0x427e3f,null))[_0x8659('0x2b')](function(_0x3b6fa6){if(_0x3b6fa6){_0x569386=_0x3b6fa6;_0x729efc['model']=_[_0x8659('0x33')](db[_0x8659('0x73')][_0x8659('0x32')]);_0x729efc[_0x8659('0x34')]=_['keys'](_0x18516f[_0x8659('0x34')]);_0x729efc[_0x8659('0x35')]=_[_0x8659('0x36')](_0x729efc['model'],_0x729efc[_0x8659('0x34')]);_0x59f7ce[_0x8659('0x38')]=_[_0x8659('0x36')](_0x729efc[_0x8659('0x37')],qs['fields'](_0x18516f[_0x8659('0x34')][_0x8659('0x39')]));_0x59f7ce['attributes']=_0x59f7ce[_0x8659('0x38')][_0x8659('0x49')]?_0x59f7ce['attributes']:_0x729efc[_0x8659('0x37')];_0x59f7ce[_0x8659('0x3a')]=qs[_0x8659('0x3b')](_0x18516f[_0x8659('0x34')][_0x8659('0x3b')]);_0x59f7ce[_0x8659('0x3c')]=qs[_0x8659('0x35')](_[_0x8659('0x3d')](_0x18516f[_0x8659('0x34')],_0x729efc[_0x8659('0x35')]));if(_0x18516f[_0x8659('0x34')][_0x8659('0x41')]){_0x59f7ce['where']=_['merge'](_0x59f7ce[_0x8659('0x3c')],{'$or':_[_0x8659('0x74')](_0x59f7ce[_0x8659('0x38')],function(_0xdd7f34){var _0x2ee045={};_0x2ee045[_0xdd7f34]={'$like':'%'+_0x18516f[_0x8659('0x34')][_0x8659('0x41')]+'%'};return _0x2ee045;})});}_0x59f7ce=_[_0x8659('0x3e')]({},_0x59f7ce,_0x18516f[_0x8659('0x42')]);return _0x569386[_0x8659('0x75')](_0x59f7ce);}})[_0x8659('0x2b')](function(_0x8e884c){if(_0x8e884c){_0x17ea6e=_0x8e884c['length'];if(!_0x18516f[_0x8659('0x34')][_0x8659('0x76')](_0x8659('0x77'))){_0x59f7ce[_0x8659('0x25')]=qs['limit'](_0x18516f[_0x8659('0x34')]['limit']);_0x59f7ce[_0x8659('0x24')]=qs[_0x8659('0x24')](_0x18516f[_0x8659('0x34')][_0x8659('0x24')]);}return _0x569386[_0x8659('0x75')](_0x59f7ce);}})[_0x8659('0x2b')](function(_0x13e9fb){if(_0x13e9fb){return _0x13e9fb?{'count':_0x17ea6e,'rows':_0x13e9fb}:null;}})[_0x8659('0x2b')](respondWithResult(_0x427e3f,null))[_0x8659('0x46')](handleError(_0x427e3f,null));}; \ No newline at end of file +var _0x109b=['where','merge','map','type','field','includeAll','findAll','params','Dashboard','rawAttributes','include','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','omit','updatedAt','body','createdAt','iframe','attrUrl','attrs','https://','attrPath','value','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','getItems','DashboardItem','pick','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','name','send','keys','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','filter'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x109b,0x175));var _0xb109=function(_0x2a691f,_0xc2c47e){_0x2a691f=_0x2a691f-0x0;var _0x4a408c=_0x109b[_0x2a691f];return _0x4a408c;};'use strict';var pdf=require(_0xb109('0x0'));var emlformat=require(_0xb109('0x1'));var rimraf=require(_0xb109('0x2'));var zipdir=require(_0xb109('0x3'));var jsonpatch=require(_0xb109('0x4'));var rp=require(_0xb109('0x5'));var moment=require(_0xb109('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb109('0x7'));var util=require(_0xb109('0x8'));var path=require(_0xb109('0x9'));var sox=require(_0xb109('0xa'));var csv=require(_0xb109('0xb'));var ejs=require(_0xb109('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb109('0xd'));var crypto=require(_0xb109('0xe'));var jsforce=require(_0xb109('0xf'));var deskjs=require(_0xb109('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xb109('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xb109('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb109('0x13'))['db'];config[_0xb109('0x14')]=_['defaults'](config[_0xb109('0x14')],{'host':_0xb109('0x15'),'port':0x18eb});var socket=require(_0xb109('0x16'))(new Redis(config[_0xb109('0x14')]));require(_0xb109('0x17'))[_0xb109('0x18')](socket);function respondWithStatusCode(_0x89db16,_0x15fa10){_0x15fa10=_0x15fa10||0xcc;return function(_0x3511db){if(_0x3511db){return _0x89db16[_0xb109('0x19')](_0x15fa10);}return _0x89db16[_0xb109('0x1a')](_0x15fa10)[_0xb109('0x1b')]();};}function respondWithResult(_0x1feefa,_0x27f0af){_0x27f0af=_0x27f0af||0xc8;return function(_0x85080f){if(_0x85080f){return _0x1feefa[_0xb109('0x1a')](_0x27f0af)[_0xb109('0x1c')](_0x85080f);}};}function respondWithFilteredResult(_0x2ea5ed,_0x1ac2f6){return function(_0x340b67){if(_0x340b67){var _0xd90820=_0x340b67[_0xb109('0x1d')],_0x514d10=_0x1ac2f6[_0xb109('0x1e')],_0x48e80b=_0x1ac2f6['offset']+_0x1ac2f6[_0xb109('0x1f')],_0x12b632;if(_0x48e80b>=_0xd90820){_0x48e80b=_0xd90820;_0x12b632=0xc8;}else{_0x12b632=0xce;}_0x2ea5ed[_0xb109('0x1a')](_0x12b632);return _0x2ea5ed['set'](_0xb109('0x20'),_0x514d10+'-'+_0x48e80b+'/'+_0xd90820)[_0xb109('0x1c')](_0x340b67);}return null;};}function patchUpdates(_0x51b798){return function(_0x32adaa){try{jsonpatch[_0xb109('0x21')](_0x32adaa,_0x51b798,!![]);}catch(_0x105b48){return BPromise[_0xb109('0x22')](_0x105b48);}return _0x32adaa[_0xb109('0x23')]();};}function saveUpdates(_0x3314ee,_0x1e3e98){return function(_0x7ff880){if(_0x7ff880){return _0x7ff880['update'](_0x3314ee)[_0xb109('0x24')](function(_0x7bca5d){return _0x7bca5d;});}return null;};}function removeEntity(_0x356611,_0x1447c9){return function(_0x1b25d2){if(_0x1b25d2){return _0x1b25d2[_0xb109('0x25')]()[_0xb109('0x24')](function(){var _0x4b5ee9=_0x1b25d2[_0xb109('0x26')]({'plain':!![]});var _0x2b3567='CustomDashboards';return db[_0xb109('0x27')][_0xb109('0x25')]({'where':{'type':_0x2b3567,'resourceId':_0x4b5ee9['id']}})[_0xb109('0x24')](function(){return _0x1b25d2;});})['then'](function(){_0x356611[_0xb109('0x1a')](0xcc)[_0xb109('0x1b')]();});}};}function handleEntityNotFound(_0x15d1dc,_0x3af43c){return function(_0x40459a){if(!_0x40459a){_0x15d1dc['sendStatus'](0x194);}return _0x40459a;};}function handleError(_0x562b18,_0x2e7fa7){_0x2e7fa7=_0x2e7fa7||0x1f4;return function(_0x5d9ce2){logger[_0xb109('0x28')](_0x5d9ce2['stack']);if(_0x5d9ce2[_0xb109('0x29')]){delete _0x5d9ce2[_0xb109('0x29')];}_0x562b18[_0xb109('0x1a')](_0x2e7fa7)[_0xb109('0x2a')](_0x5d9ce2);};}exports['index']=function(_0x4e4081,_0x47444e){var _0xe5bc9c={},_0x2f1128={},_0x3475d1={'count':0x0,'rows':[]};var _0x554097=db['Dashboard']['rawAttributes'];_0x2f1128['model']=_[_0xb109('0x2b')](_0x554097);_0x2f1128[_0xb109('0x2c')]=_[_0xb109('0x2b')](_0x4e4081[_0xb109('0x2c')]);_0x2f1128[_0xb109('0x2d')]=_['intersection'](_0x2f1128[_0xb109('0x2e')],_0x2f1128[_0xb109('0x2c')]);_0xe5bc9c['attributes']=_[_0xb109('0x2f')](_0x2f1128[_0xb109('0x2e')],qs[_0xb109('0x30')](_0x4e4081[_0xb109('0x2c')][_0xb109('0x30')]));_0xe5bc9c[_0xb109('0x31')]=_0xe5bc9c['attributes'][_0xb109('0x32')]?_0xe5bc9c[_0xb109('0x31')]:_0x2f1128[_0xb109('0x2e')];if(!_0x4e4081['query']['hasOwnProperty'](_0xb109('0x33'))){_0xe5bc9c[_0xb109('0x1f')]=qs[_0xb109('0x1f')](_0x4e4081[_0xb109('0x2c')][_0xb109('0x1f')]);_0xe5bc9c[_0xb109('0x1e')]=qs[_0xb109('0x1e')](_0x4e4081[_0xb109('0x2c')][_0xb109('0x1e')]);}_0xe5bc9c[_0xb109('0x34')]=qs[_0xb109('0x35')](_0x4e4081[_0xb109('0x2c')]['sort']);_0xe5bc9c['where']=qs[_0xb109('0x2d')](_['pick'](_0x4e4081[_0xb109('0x2c')],_0x2f1128[_0xb109('0x2d')]));if(_0x4e4081[_0xb109('0x2c')][_0xb109('0x36')]){_0xe5bc9c[_0xb109('0x37')]=_[_0xb109('0x38')](_0xe5bc9c[_0xb109('0x37')],{'$or':_[_0xb109('0x39')](_0x554097,function(_0x20ed0d){if(_0x20ed0d[_0xb109('0x3a')]['key']!=='VIRTUAL'){var _0xae827b={};_0xae827b[_0x20ed0d[_0xb109('0x3b')]]={'$like':'%'+_0x4e4081['query'][_0xb109('0x36')]+'%'};return _0xae827b;}})});}_0xe5bc9c=_['merge']({},_0xe5bc9c,_0x4e4081['options']);var _0x3aba15={'where':_0xe5bc9c[_0xb109('0x37')]};return db['Dashboard'][_0xb109('0x1d')](_0x3aba15)[_0xb109('0x24')](function(_0x36fc3f){_0x3475d1[_0xb109('0x1d')]=_0x36fc3f;if(_0x4e4081[_0xb109('0x2c')][_0xb109('0x3c')]){_0xe5bc9c['include']=[{'all':!![]}];}return db['Dashboard'][_0xb109('0x3d')](_0xe5bc9c);})[_0xb109('0x24')](function(_0x460ecd){_0x3475d1['rows']=_0x460ecd;return _0x3475d1;})['then'](respondWithFilteredResult(_0x47444e,_0xe5bc9c))['catch'](handleError(_0x47444e,null));};exports['show']=function(_0xb18022,_0x3e6aac){var _0x5a98cc={'raw':![],'where':{'id':_0xb18022[_0xb109('0x3e')]['id']}},_0x1db147={};_0x1db147[_0xb109('0x2e')]=_['keys'](db[_0xb109('0x3f')][_0xb109('0x40')]);_0x1db147[_0xb109('0x2c')]=_[_0xb109('0x2b')](_0xb18022[_0xb109('0x2c')]);_0x1db147[_0xb109('0x2d')]=_['intersection'](_0x1db147[_0xb109('0x2e')],_0x1db147['query']);_0x5a98cc[_0xb109('0x31')]=_[_0xb109('0x2f')](_0x1db147[_0xb109('0x2e')],qs[_0xb109('0x30')](_0xb18022[_0xb109('0x2c')][_0xb109('0x30')]));_0x5a98cc['attributes']=_0x5a98cc[_0xb109('0x31')]['length']?_0x5a98cc[_0xb109('0x31')]:_0x1db147['model'];if(_0xb18022[_0xb109('0x2c')][_0xb109('0x3c')]){_0x5a98cc[_0xb109('0x41')]=[{'all':!![]}];}_0x5a98cc=_[_0xb109('0x38')]({},_0x5a98cc,_0xb18022[_0xb109('0x42')]);return db[_0xb109('0x3f')][_0xb109('0x43')](_0x5a98cc)[_0xb109('0x24')](handleEntityNotFound(_0x3e6aac,null))[_0xb109('0x24')](respondWithResult(_0x3e6aac,null))[_0xb109('0x44')](handleError(_0x3e6aac,null));};exports[_0xb109('0x45')]=function(_0x4de9df,_0x3be9e2){return db['Dashboard'][_0xb109('0x45')](_0x4de9df['body'],{})[_0xb109('0x24')](function(_0x3963dd){var _0x30f033=_0x4de9df['user']['get']({'plain':!![]});if(!_0x30f033)throw new Error(_0xb109('0x46'));if(_0x30f033[_0xb109('0x47')]===_0xb109('0x48')){var _0x5ac13d=_0x3963dd[_0xb109('0x26')]({'plain':!![]});var _0xb0a3c5=_0xb109('0x49');return db[_0xb109('0x4a')][_0xb109('0x43')]({'where':{'name':_0xb0a3c5,'userProfileId':_0x30f033[_0xb109('0x4b')]},'raw':!![]})['then'](function(_0x1ef719){if(_0x1ef719&&_0x1ef719[_0xb109('0x4c')]===0x0){return db[_0xb109('0x27')][_0xb109('0x45')]({'name':_0x5ac13d['name'],'resourceId':_0x5ac13d['id'],'type':_0x1ef719[_0xb109('0x29')],'sectionId':_0x1ef719['id']},{})['then'](function(){return _0x3963dd;});}else{return _0x3963dd;}})[_0xb109('0x44')](function(_0x1e459a){logger[_0xb109('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e459a);throw _0x1e459a;});}return _0x3963dd;})['then'](respondWithResult(_0x3be9e2,0xc9))[_0xb109('0x44')](handleError(_0x3be9e2,null));};exports['clone']=function(_0x319122,_0x3c117c){var _0x20286a={'raw':![],'where':{'id':_0x319122[_0xb109('0x3e')]['id']}},_0x569b6b={};_0x569b6b['model']=_['keys'](db[_0xb109('0x3f')][_0xb109('0x40')]);_0x20286a['attributes']=_[_0xb109('0x2f')](_0x569b6b[_0xb109('0x2e')],qs[_0xb109('0x30')](_0x319122[_0xb109('0x2c')]['fields']));_0x20286a[_0xb109('0x31')]=_0x20286a['attributes'][_0xb109('0x32')]?_0x20286a[_0xb109('0x31')]:_0x569b6b[_0xb109('0x2e')];if(_0x319122[_0xb109('0x2c')]['includeAll']){_0x20286a['include']=[{'all':!![]}];}_0x20286a=_['merge']({},_0x20286a,_0x319122[_0xb109('0x42')]);return db[_0xb109('0x3f')][_0xb109('0x43')](_0x20286a)['then'](handleEntityNotFound(_0x3c117c,null))['then'](function(_0x4f72ed){if(_0x4f72ed){var _0x342f97=_0x4f72ed[_0xb109('0x26')]({'plain':!![]});_0x342f97=qs[_0xb109('0x4d')](_0x342f97,['id','createdAt',_0xb109('0x4e')]);_0x319122['body']=_[_0xb109('0x4d')](_0x319122[_0xb109('0x4f')],['id',_0xb109('0x50'),'updatedAt']);return db[_0xb109('0x3f')][_0xb109('0x45')](_[_0xb109('0x38')](_0x342f97,_0x319122[_0xb109('0x4f')]),{'include':_0x319122[_0xb109('0x2c')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x364a61){var _0x2389a4=_0x319122['user'][_0xb109('0x26')]({'plain':!![]});if(!_0x2389a4)throw new Error(_0xb109('0x46'));if(_0x2389a4[_0xb109('0x47')]==='user'){var _0x858769=_0x364a61[_0xb109('0x26')]({'plain':!![]});var _0x2b755d=_0xb109('0x49');return db[_0xb109('0x4a')][_0xb109('0x43')]({'where':{'name':_0x2b755d,'userProfileId':_0x2389a4[_0xb109('0x4b')]},'raw':!![]})[_0xb109('0x24')](function(_0x5b7796){if(_0x5b7796&&_0x5b7796[_0xb109('0x4c')]===0x0){return db[_0xb109('0x27')]['create']({'name':_0x858769[_0xb109('0x29')],'resourceId':_0x858769['id'],'type':_0x5b7796[_0xb109('0x29')],'sectionId':_0x5b7796['id']},{})[_0xb109('0x24')](function(){return _0x364a61;});}else{return _0x364a61;}})[_0xb109('0x44')](function(_0x4cfc24){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cfc24);throw _0x4cfc24;});}return _0x364a61;});}})[_0xb109('0x24')](respondWithResult(_0x3c117c,0xc9))['catch'](handleError(_0x3c117c,null));};exports['update']=function(_0x515532,_0x2c2a6d){if(_0x515532[_0xb109('0x4f')]['id']){delete _0x515532[_0xb109('0x4f')]['id'];}return db[_0xb109('0x3f')][_0xb109('0x43')]({'where':{'id':_0x515532[_0xb109('0x3e')]['id']}})[_0xb109('0x24')](handleEntityNotFound(_0x2c2a6d,null))['then'](saveUpdates(_0x515532[_0xb109('0x4f')],null))['then'](respondWithResult(_0x2c2a6d,null))[_0xb109('0x44')](handleError(_0x2c2a6d,null));};exports['destroy']=function(_0x3ce811,_0x3be5c1){return db[_0xb109('0x3f')]['find']({'where':{'id':_0x3ce811[_0xb109('0x3e')]['id']}})[_0xb109('0x24')](handleEntityNotFound(_0x3be5c1,null))['then'](removeEntity(_0x3be5c1,null))[_0xb109('0x44')](handleError(_0x3be5c1,null));};function widgetAttributes(_0x536abd){try{switch(_0x536abd[_0xb109('0x3a')]){case _0xb109('0x51'):return[{'name':_0xb109('0x52'),'value':_0x536abd[_0xb109('0x52')]||(_0x536abd[_0xb109('0x53')]&&_0x536abd[_0xb109('0x53')][0x0]?_0x536abd[_0xb109('0x53')][0x0]['value']:undefined)||_0xb109('0x54')}];case'custom':return[{'name':_0xb109('0x55'),'value':_0x536abd[_0xb109('0x55')]||(_0x536abd[_0xb109('0x53')]&&_0x536abd[_0xb109('0x53')][0x0]?_0x536abd[_0xb109('0x53')][0x0][_0xb109('0x56')]:undefined)||''}];case _0xb109('0x57'):return[{'name':'attrHourFormat','value':_0x536abd['attrHourFormat']||(_0x536abd[_0xb109('0x53')]&&_0x536abd[_0xb109('0x53')][0x0]?_0x536abd[_0xb109('0x53')][0x0]['value']:undefined)||_0xb109('0x58')},{'name':'attrTimezone','value':_0x536abd[_0xb109('0x59')]||(_0x536abd['attrs']&&_0x536abd[_0xb109('0x53')][0x1]?_0x536abd['attrs'][0x1][_0xb109('0x56')]:undefined)||_0xb109('0x5a')},{'name':_0xb109('0x5b'),'value':_0x536abd[_0xb109('0x5b')]||(_0x536abd['attrs']&&_0x536abd[_0xb109('0x53')][0x2]?_0x536abd[_0xb109('0x53')][0x2][_0xb109('0x56')]:undefined)||0xc}];case'counter':return[{'name':_0xb109('0x5c'),'value':_0x536abd[_0xb109('0x5c')]||(_0x536abd[_0xb109('0x53')]&&_0x536abd[_0xb109('0x53')][0x0]?_0x536abd[_0xb109('0x53')][0x0][_0xb109('0x56')]:undefined)||_0xb109('0x5d')},{'name':_0xb109('0x5e'),'value':_0x536abd['attrVoiceQueues']||(_0x536abd[_0xb109('0x53')]&&_0x536abd['attrs'][0x1]?_0x536abd[_0xb109('0x53')][0x1][_0xb109('0x56')]:undefined)||[]},{'name':'attrFontSize','value':_0x536abd[_0xb109('0x5b')]||(_0x536abd['attrs']&&_0x536abd[_0xb109('0x53')][0x2]?_0x536abd[_0xb109('0x53')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x536abd[_0xb109('0x5f')]||(_0x536abd['attrs']&&_0x536abd['attrs'][0x0]?_0x536abd['attrs'][0x0][_0xb109('0x56')]:undefined)||_0xb109('0x5d')},{'name':_0xb109('0x60'),'value':_0x536abd[_0xb109('0x60')]||(_0x536abd[_0xb109('0x53')]&&_0x536abd['attrs'][0x1]?_0x536abd[_0xb109('0x53')][0x1][_0xb109('0x56')]:undefined)||null},{'name':_0xb109('0x61'),'value':_0x536abd[_0xb109('0x61')]||(_0x536abd['attrs']&&_0x536abd[_0xb109('0x53')][0x2]?_0x536abd[_0xb109('0x53')][0x2][_0xb109('0x56')]:undefined)||null},{'name':_0xb109('0x5e'),'value':_0x536abd[_0xb109('0x5e')]||(_0x536abd[_0xb109('0x53')]&&_0x536abd[_0xb109('0x53')][0x3]?_0x536abd[_0xb109('0x53')][0x3][_0xb109('0x56')]:undefined)||[]}];case'web-report':return[{'name':_0xb109('0x62'),'type':_0x536abd[_0xb109('0x63')]||(_0x536abd[_0xb109('0x53')]&&_0x536abd['attrs'][0x0]?_0x536abd[_0xb109('0x53')][0x0]['type']:undefined)||null,'value':_0x536abd[_0xb109('0x62')]||(_0x536abd[_0xb109('0x53')]&&_0x536abd[_0xb109('0x53')][0x0]?_0x536abd[_0xb109('0x53')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x536abd[_0xb109('0x64')]||(_0x536abd[_0xb109('0x53')]&&_0x536abd[_0xb109('0x53')][0x1]?_0x536abd[_0xb109('0x53')][0x1][_0xb109('0x56')]:undefined)||0x0}];default:return[];}}catch(_0x4228a7){logger[_0xb109('0x28')](_0xb109('0x65'),JSON[_0xb109('0x66')](_0x4228a7));return[];}}exports['addItem']=function(_0x4a6c84,_0x2a481d,_0x3e6883){if(_0x4a6c84['body']['id']){delete _0x4a6c84[_0xb109('0x4f')]['id'];}return db['Dashboard'][_0xb109('0x43')]({'where':{'id':_0x4a6c84[_0xb109('0x3e')]['id']}})[_0xb109('0x24')](handleEntityNotFound(_0x2a481d,null))[_0xb109('0x24')](function(_0x2f789e){if(_0x2f789e){_0x4a6c84[_0xb109('0x4f')]['DashboardId']=_0x2f789e['id'];_0x4a6c84[_0xb109('0x4f')][_0xb109('0x53')]=widgetAttributes(_0x4a6c84[_0xb109('0x4f')]);return db['DashboardItem'][_0xb109('0x45')](_0x4a6c84[_0xb109('0x4f')]);}})['then'](respondWithResult(_0x2a481d,null))[_0xb109('0x44')](handleError(_0x2a481d,null));};exports[_0xb109('0x67')]=function(_0xf7b54f,_0x13d3f8,_0xd1f233){var _0x41babd={};var _0xb1ab8={};var _0x28009b;var _0x297f10;return db[_0xb109('0x3f')]['findOne']({'where':{'id':_0xf7b54f[_0xb109('0x3e')]['id']}})[_0xb109('0x24')](handleEntityNotFound(_0x13d3f8,null))[_0xb109('0x24')](function(_0x4ac555){if(_0x4ac555){_0x28009b=_0x4ac555;_0xb1ab8[_0xb109('0x2e')]=_['keys'](db[_0xb109('0x68')]['rawAttributes']);_0xb1ab8[_0xb109('0x2c')]=_[_0xb109('0x2b')](_0xf7b54f[_0xb109('0x2c')]);_0xb1ab8[_0xb109('0x2d')]=_[_0xb109('0x2f')](_0xb1ab8[_0xb109('0x2e')],_0xb1ab8[_0xb109('0x2c')]);_0x41babd['attributes']=_[_0xb109('0x2f')](_0xb1ab8[_0xb109('0x2e')],qs[_0xb109('0x30')](_0xf7b54f['query'][_0xb109('0x30')]));_0x41babd['attributes']=_0x41babd[_0xb109('0x31')][_0xb109('0x32')]?_0x41babd[_0xb109('0x31')]:_0xb1ab8[_0xb109('0x2e')];_0x41babd[_0xb109('0x34')]=qs[_0xb109('0x35')](_0xf7b54f[_0xb109('0x2c')][_0xb109('0x35')]);_0x41babd[_0xb109('0x37')]=qs[_0xb109('0x2d')](_[_0xb109('0x69')](_0xf7b54f[_0xb109('0x2c')],_0xb1ab8['filters']));if(_0xf7b54f[_0xb109('0x2c')][_0xb109('0x36')]){_0x41babd['where']=_[_0xb109('0x38')](_0x41babd['where'],{'$or':_['map'](_0x41babd[_0xb109('0x31')],function(_0x4a0a90){var _0x8a5e10={};_0x8a5e10[_0x4a0a90]={'$like':'%'+_0xf7b54f[_0xb109('0x2c')][_0xb109('0x36')]+'%'};return _0x8a5e10;})});}_0x41babd=_['merge']({},_0x41babd,_0xf7b54f[_0xb109('0x42')]);return _0x28009b['getItems'](_0x41babd);}})[_0xb109('0x24')](function(_0x4be359){if(_0x4be359){_0x297f10=_0x4be359[_0xb109('0x32')];if(!_0xf7b54f['query'][_0xb109('0x6a')](_0xb109('0x33'))){_0x41babd[_0xb109('0x1f')]=qs[_0xb109('0x1f')](_0xf7b54f[_0xb109('0x2c')]['limit']);_0x41babd[_0xb109('0x1e')]=qs[_0xb109('0x1e')](_0xf7b54f[_0xb109('0x2c')]['offset']);}return _0x28009b[_0xb109('0x67')](_0x41babd);}})[_0xb109('0x24')](function(_0xacf7b){if(_0xacf7b){return _0xacf7b?{'count':_0x297f10,'rows':_0xacf7b}:null;}})[_0xb109('0x24')](respondWithResult(_0x13d3f8,null))['catch'](handleError(_0x13d3f8,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index acdecdb..2adb0f1 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 _0x14b6=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x241ef5,_0x17f16a){var _0x2e72e7=function(_0x3cf233){while(--_0x3cf233){_0x241ef5['push'](_0x241ef5['shift']());}};_0x2e72e7(++_0x17f16a);}(_0x14b6,0x146));var _0x614b=function(_0x2bdddd,_0x4347c4){_0x2bdddd=_0x2bdddd-0x0;var _0x1f8b53=_0x14b6[_0x2bdddd];return _0x1f8b53;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x614b('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x614b('0x1')](0x0);var events={'afterCreate':_0x614b('0x2'),'afterUpdate':_0x614b('0x3'),'afterDestroy':_0x614b('0x4')};function emitEvent(_0x5ae288){return function(_0x19c0a1,_0x27d07f,_0x4897a6){DashboardEvents[_0x614b('0x5')](_0x5ae288+':'+_0x19c0a1['id'],_0x19c0a1);DashboardEvents[_0x614b('0x5')](_0x5ae288,_0x19c0a1);_0x4897a6(null);};}for(var e in events){if(events[_0x614b('0x6')](e)){var event=events[e];Dashboard[_0x614b('0x7')](e,emitEvent(event));}}module[_0x614b('0x8')]=DashboardEvents; \ No newline at end of file +var _0x2323=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4285ff,_0x408a33){var _0x4baa47=function(_0x2af218){while(--_0x2af218){_0x4285ff['push'](_0x4285ff['shift']());}};_0x4baa47(++_0x408a33);}(_0x2323,0x146));var _0x3232=function(_0x5c0d82,_0x19f536){_0x5c0d82=_0x5c0d82-0x0;var _0x2d3f53=_0x2323[_0x5c0d82];return _0x2d3f53;};'use strict';var EventEmitter=require(_0x3232('0x0'));var Dashboard=require(_0x3232('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3232('0x2'),'afterDestroy':_0x3232('0x3')};function emitEvent(_0x25a212){return function(_0x5e7b8e,_0xb69166,_0x285224){DashboardEvents[_0x3232('0x4')](_0x25a212+':'+_0x5e7b8e['id'],_0x5e7b8e);DashboardEvents[_0x3232('0x4')](_0x25a212,_0x5e7b8e);_0x285224(null);};}for(var e in events){if(events[_0x3232('0x5')](e)){var event=events[e];Dashboard[_0x3232('0x6')](e,emitEvent(event));}}module[_0x3232('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 9fd06e4..63ff09c 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 _0xf7f7=['Dashboard','dashboards','lodash','util','../../config/logger','api','request-promise','./dashboard.attributes','exports','define'];(function(_0x499d82,_0x47d09e){var _0x300291=function(_0x5a2c3b){while(--_0x5a2c3b){_0x499d82['push'](_0x499d82['shift']());}};_0x300291(++_0x47d09e);}(_0xf7f7,0x192));var _0x7f7f=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xf7f7[_0x246148];return _0x453d94;};'use strict';var _=require(_0x7f7f('0x0'));var util=require(_0x7f7f('0x1'));var logger=require(_0x7f7f('0x2'))(_0x7f7f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7f7f('0x4'));var attributes=require(_0x7f7f('0x5'));module[_0x7f7f('0x6')]=function(_0x452c5f,_0x5d01b9){return _0x452c5f[_0x7f7f('0x7')](_0x7f7f('0x8'),attributes,{'tableName':_0x7f7f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a38=['./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','request-promise'];(function(_0x3f253d,_0x393c39){var _0x5f1213=function(_0x1af26e){while(--_0x1af26e){_0x3f253d['push'](_0x3f253d['shift']());}};_0x5f1213(++_0x393c39);}(_0x1a38,0xb0));var _0x81a3=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x1a38[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x81a3('0x0'));var util=require(_0x81a3('0x1'));var logger=require(_0x81a3('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x81a3('0x3'));var attributes=require(_0x81a3('0x4'));module[_0x81a3('0x5')]=function(_0x28fd86,_0x33a486){return _0x28fd86[_0x81a3('0x6')](_0x81a3('0x7'),attributes,{'tableName':_0x81a3('0x8'),'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 9fba00c..3cc146c 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 _0xb19d=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x17a22b,_0x45308b){var _0x46d4e5=function(_0x1d3215){while(--_0x1d3215){_0x17a22b['push'](_0x17a22b['shift']());}};_0x46d4e5(++_0x45308b);}(_0xb19d,0xdb));var _0xdb19=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0xb19d[_0x3cbe1c];return _0x5ee08b;};'use strict';var _=require(_0xdb19('0x0'));var util=require(_0xdb19('0x1'));var moment=require(_0xdb19('0x2'));var BPromise=require(_0xdb19('0x3'));var rs=require(_0xdb19('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb19('0x5'))['db'];var utils=require(_0xdb19('0x6'));var logger=require(_0xdb19('0x7'))(_0xdb19('0x8'));var config=require('../../config/environment');var jayson=require(_0xdb19('0x9'));var client=jayson[_0xdb19('0xa')][_0xdb19('0xb')]({'port':0x232a});config[_0xdb19('0xc')]=_[_0xdb19('0xd')](config[_0xdb19('0xc')],{'host':_0xdb19('0xe'),'port':0x18eb});var socket=require(_0xdb19('0xf'))(new Redis(config['redis']));require(_0xdb19('0x10'))[_0xdb19('0x11')](socket);function respondWithRpcPromise(_0x22a45c,_0x4c4f36,_0x6ea605){return new BPromise(function(_0x2da654,_0x49163e){return client[_0xdb19('0x12')](_0x22a45c,_0x6ea605)['then'](function(_0x3ca12e){logger[_0xdb19('0x13')](_0xdb19('0x14'),_0x4c4f36,_0xdb19('0x15'));logger[_0xdb19('0x16')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x4c4f36,_0xdb19('0x15'),JSON['stringify'](_0x3ca12e));if(_0x3ca12e['error']){if(_0x3ca12e[_0xdb19('0x17')][_0xdb19('0x18')]===0x1f4){logger[_0xdb19('0x17')]('Dashboard,\x20%s,\x20%s',_0x4c4f36,_0x3ca12e['error'][_0xdb19('0x19')]);return _0x49163e(_0x3ca12e['error'][_0xdb19('0x19')]);}logger[_0xdb19('0x17')](_0xdb19('0x14'),_0x4c4f36,_0x3ca12e[_0xdb19('0x17')]['message']);return _0x2da654(_0x3ca12e['error'][_0xdb19('0x19')]);}else{logger[_0xdb19('0x13')](_0xdb19('0x14'),_0x4c4f36,_0xdb19('0x15'));_0x2da654(_0x3ca12e[_0xdb19('0x1a')][_0xdb19('0x19')]);}})[_0xdb19('0x1b')](function(_0x153f52){logger[_0xdb19('0x17')]('Dashboard,\x20%s,\x20%s',_0x4c4f36,_0x153f52);_0x49163e(_0x153f52);});});} \ No newline at end of file +var _0xf015=['defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x1021b2,_0x40fb44){var _0x3ca16c=function(_0xa16fad){while(--_0xa16fad){_0x1021b2['push'](_0x1021b2['shift']());}};_0x3ca16c(++_0x40fb44);}(_0xf015,0x1bf));var _0x5f01=function(_0x311869,_0x378ceb){_0x311869=_0x311869-0x0;var _0x4a2a67=_0xf015[_0x311869];return _0x4a2a67;};'use strict';var _=require(_0x5f01('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5f01('0x1'));var rs=require(_0x5f01('0x2'));var fs=require('fs');var Redis=require(_0x5f01('0x3'));var db=require(_0x5f01('0x4'))['db'];var utils=require(_0x5f01('0x5'));var logger=require(_0x5f01('0x6'))(_0x5f01('0x7'));var config=require('../../config/environment');var jayson=require(_0x5f01('0x8'));var client=jayson[_0x5f01('0x9')][_0x5f01('0xa')]({'port':0x232a});config[_0x5f01('0xb')]=_[_0x5f01('0xc')](config[_0x5f01('0xb')],{'host':_0x5f01('0xd'),'port':0x18eb});var socket=require(_0x5f01('0xe'))(new Redis(config['redis']));require(_0x5f01('0xf'))['register'](socket);function respondWithRpcPromise(_0x1d6fcf,_0x249ada,_0x70478f){return new BPromise(function(_0x109945,_0x2b47d2){return client[_0x5f01('0x10')](_0x1d6fcf,_0x70478f)[_0x5f01('0x11')](function(_0x5f0688){logger[_0x5f01('0x12')]('Dashboard,\x20%s,\x20%s',_0x249ada,_0x5f01('0x13'));logger['debug'](_0x5f01('0x14'),_0x249ada,'request\x20sent',JSON[_0x5f01('0x15')](_0x5f0688));if(_0x5f0688[_0x5f01('0x16')]){if(_0x5f0688[_0x5f01('0x16')][_0x5f01('0x17')]===0x1f4){logger['error'](_0x5f01('0x18'),_0x249ada,_0x5f0688['error'][_0x5f01('0x19')]);return _0x2b47d2(_0x5f0688[_0x5f01('0x16')][_0x5f01('0x19')]);}logger[_0x5f01('0x16')](_0x5f01('0x18'),_0x249ada,_0x5f0688[_0x5f01('0x16')]['message']);return _0x109945(_0x5f0688[_0x5f01('0x16')][_0x5f01('0x19')]);}else{logger[_0x5f01('0x12')](_0x5f01('0x18'),_0x249ada,_0x5f01('0x13'));_0x109945(_0x5f0688[_0x5f01('0x1a')][_0x5f01('0x19')]);}})['catch'](function(_0x1b2266){logger[_0x5f01('0x16')]('Dashboard,\x20%s,\x20%s',_0x249ada,_0x1b2266);_0x2b47d2(_0x1b2266);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 5d49d41..df27cfe 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 _0xd047=['register','save','remove','update','emit'];(function(_0x3631c1,_0x5a37a0){var _0x43ab78=function(_0x31c212){while(--_0x31c212){_0x3631c1['push'](_0x3631c1['shift']());}};_0x43ab78(++_0x5a37a0);}(_0xd047,0x1dc));var _0x7d04=function(_0x107460,_0xde396d){_0x107460=_0x107460-0x0;var _0x1815dc=_0xd047[_0x107460];return _0x1815dc;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x7d04('0x0'),_0x7d04('0x1'),_0x7d04('0x2')];function createListener(_0x56c80e,_0x3f0a9d){return function(_0x19b7f8){_0x3f0a9d[_0x7d04('0x3')](_0x56c80e,_0x19b7f8);};}function removeListener(_0x2ac842,_0x3bdf15){return function(){DashboardEvents['removeListener'](_0x2ac842,_0x3bdf15);};}exports[_0x7d04('0x4')]=function(_0x39b089){for(var _0x2db955=0x0,_0x52b460=events['length'];_0x2db955<_0x52b460;_0x2db955++){var _0x359de2=events[_0x2db955];var _0x4e74cf=createListener('dashboard:'+_0x359de2,_0x39b089);DashboardEvents['on'](_0x359de2,_0x4e74cf);}}; \ No newline at end of file +var _0xd8a2=['remove','update','register','dashboard:','./dashboard.events','save'];(function(_0x4f49af,_0x47e992){var _0x28ef1a=function(_0x3b3081){while(--_0x3b3081){_0x4f49af['push'](_0x4f49af['shift']());}};_0x28ef1a(++_0x47e992);}(_0xd8a2,0x1ae));var _0x2d8a=function(_0x3da2e0,_0xc20c7f){_0x3da2e0=_0x3da2e0-0x0;var _0x3b728c=_0xd8a2[_0x3da2e0];return _0x3b728c;};'use strict';var DashboardEvents=require(_0x2d8a('0x0'));var events=[_0x2d8a('0x1'),_0x2d8a('0x2'),_0x2d8a('0x3')];function createListener(_0x1cb19f,_0xc9ab9d){return function(_0x179e7c){_0xc9ab9d['emit'](_0x1cb19f,_0x179e7c);};}function removeListener(_0x47c2ad,_0x41e632){return function(){DashboardEvents['removeListener'](_0x47c2ad,_0x41e632);};}exports[_0x2d8a('0x4')]=function(_0x6ac9c9){for(var _0x76709e=0x0,_0x152bad=events['length'];_0x76709e<_0x152bad;_0x76709e++){var _0x33228a=events[_0x76709e];var _0x59c886=createListener(_0x2d8a('0x5')+_0x33228a,_0x6ac9c9);DashboardEvents['on'](_0x33228a,_0x59c886);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 23f4ec6..f84e917 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 _0xfb04=['getItems','post','create','/:id/clone','addItem','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items'];(function(_0x1dc2b4,_0x573a04){var _0x18af92=function(_0x46820a){while(--_0x46820a){_0x1dc2b4['push'](_0x1dc2b4['shift']());}};_0x18af92(++_0x573a04);}(_0xfb04,0x99));var _0x4fb0=function(_0x348652,_0x56c9eb){_0x348652=_0x348652-0x0;var _0x26e217=_0xfb04[_0x348652];return _0x26e217;};'use strict';var multer=require(_0x4fb0('0x0'));var util=require(_0x4fb0('0x1'));var path=require(_0x4fb0('0x2'));var timeout=require(_0x4fb0('0x3'));var express=require(_0x4fb0('0x4'));var router=express[_0x4fb0('0x5')]();var auth=require(_0x4fb0('0x6'));var interaction=require(_0x4fb0('0x7'));var config=require(_0x4fb0('0x8'));var controller=require('./dashboard.controller');router[_0x4fb0('0x9')]('/',auth[_0x4fb0('0xa')](),controller[_0x4fb0('0xb')]);router['get'](_0x4fb0('0xc'),auth[_0x4fb0('0xa')](),controller[_0x4fb0('0xd')]);router['get'](_0x4fb0('0xe'),auth[_0x4fb0('0xa')](),controller[_0x4fb0('0xf')]);router[_0x4fb0('0x10')]('/',auth[_0x4fb0('0xa')](),controller[_0x4fb0('0x11')]);router[_0x4fb0('0x10')](_0x4fb0('0x12'),auth['isAuthenticated'](),controller['clone']);router[_0x4fb0('0x10')](_0x4fb0('0xe'),auth['isAuthenticated'](),controller[_0x4fb0('0x13')]);router[_0x4fb0('0x14')](_0x4fb0('0xc'),auth[_0x4fb0('0xa')](),controller[_0x4fb0('0x15')]);router[_0x4fb0('0x16')](_0x4fb0('0xc'),auth[_0x4fb0('0xa')](),controller['destroy']);module[_0x4fb0('0x17')]=router; \ No newline at end of file +var _0x5e65=['/:id','show','getItems','post','create','/:id/clone','clone','/:id/items','addItem','delete','destroy','exports','connect-timeout','express','../../config/environment','./dashboard.controller','get','isAuthenticated','index'];(function(_0x452fc5,_0x3a7ef2){var _0x5b03da=function(_0x3e0192){while(--_0x3e0192){_0x452fc5['push'](_0x452fc5['shift']());}};_0x5b03da(++_0x3a7ef2);}(_0x5e65,0xf0));var _0x55e6=function(_0x4dcafc,_0x267b51){_0x4dcafc=_0x4dcafc-0x0;var _0x14debe=_0x5e65[_0x4dcafc];return _0x14debe;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x55e6('0x0'));var express=require(_0x55e6('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x55e6('0x2'));var controller=require(_0x55e6('0x3'));router[_0x55e6('0x4')]('/',auth[_0x55e6('0x5')](),controller[_0x55e6('0x6')]);router[_0x55e6('0x4')](_0x55e6('0x7'),auth[_0x55e6('0x5')](),controller[_0x55e6('0x8')]);router[_0x55e6('0x4')]('/:id/items',auth[_0x55e6('0x5')](),controller[_0x55e6('0x9')]);router[_0x55e6('0xa')]('/',auth['isAuthenticated'](),controller[_0x55e6('0xb')]);router[_0x55e6('0xa')](_0x55e6('0xc'),auth[_0x55e6('0x5')](),controller[_0x55e6('0xd')]);router[_0x55e6('0xa')](_0x55e6('0xe'),auth[_0x55e6('0x5')](),controller[_0x55e6('0xf')]);router['put'](_0x55e6('0x7'),auth[_0x55e6('0x5')](),controller['update']);router[_0x55e6('0x10')](_0x55e6('0x7'),auth[_0x55e6('0x5')](),controller[_0x55e6('0x11')]);module[_0x55e6('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 32c4f83..1560b91 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 _0x27d3=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x566ff0,_0x1b7382){var _0x4f99d4=function(_0x1f635d){while(--_0x1f635d){_0x566ff0['push'](_0x566ff0['shift']());}};_0x4f99d4(++_0x1b7382);}(_0x27d3,0x181));var _0x327d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x27d3[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x327d('0x0'));var squel=require(_0x327d('0x1'));var _=require(_0x327d('0x2'));module[_0x327d('0x3')]={'title':{'type':Sequelize[_0x327d('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x327d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x327d('0x5')](_0x327d('0x6')),'get':function(){try{return JSON[_0x327d('0x7')](this[_0x327d('0x8')](_0x327d('0x9')));}catch(_0x35cbba){return[];}},'set':function(_0x39fceb){try{this[_0x327d('0xa')](_0x327d('0x9'),JSON[_0x327d('0xb')](_0x39fceb));}catch(_0x575dd7){this[_0x327d('0xa')](_0x327d('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x327d('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x327d('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x327d('0xc')]},'col':{'type':Sequelize[_0x327d('0xc')]},'background':{'type':Sequelize[_0x327d('0x4')],'allowNull':![],'defaultValue':_0x327d('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x327d('0x4')],'allowNull':![],'defaultValue':_0x327d('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x327d('0x4')]}}; \ No newline at end of file +var _0x4b74=['stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','STRING','long','parse','getDataValue','attrs','setDataValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b74,0x18a));var _0x44b7=function(_0x7a0f02,_0x1703b0){_0x7a0f02=_0x7a0f02-0x0;var _0x2958d8=_0x4b74[_0x7a0f02];return _0x2958d8;};'use strict';var Sequelize=require(_0x44b7('0x0'));var squel=require(_0x44b7('0x1'));var _=require(_0x44b7('0x2'));module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b7('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x44b7('0x4')),'get':function(){try{return JSON[_0x44b7('0x5')](this[_0x44b7('0x6')](_0x44b7('0x7')));}catch(_0x5cbf81){return[];}},'set':function(_0x2378ae){try{this[_0x44b7('0x8')](_0x44b7('0x7'),JSON[_0x44b7('0x9')](_0x2378ae));}catch(_0x17c17b){this[_0x44b7('0x8')](_0x44b7('0x7'),JSON[_0x44b7('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x44b7('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x44b7('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x44b7('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x44b7('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x44b7('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index c261776..3d07025 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 _0xd325=['body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','error','stack','name','send','model','keys','DashboardItem','rawAttributes','query','attributes','intersection','fields','includeAll','options','catch','destroy','find','params','type','attrUrl','attrs','https://','custom','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create'];(function(_0x1e72ee,_0x12ca22){var _0x2d8700=function(_0x289ade){while(--_0x289ade){_0x1e72ee['push'](_0x1e72ee['shift']());}};_0x2d8700(++_0x12ca22);}(_0xd325,0x1f3));var _0x5d32=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0xd325[_0x45b29d];return _0x32d74;};'use strict';var pdf=require(_0x5d32('0x0'));var emlformat=require(_0x5d32('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5d32('0x2'));var jsonpatch=require(_0x5d32('0x3'));var rp=require(_0x5d32('0x4'));var moment=require(_0x5d32('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5d32('0x6'));var util=require(_0x5d32('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5d32('0x8'));var ejs=require(_0x5d32('0x9'));var fs=require('fs');var _=require(_0x5d32('0xa'));var squel=require(_0x5d32('0xb'));var crypto=require(_0x5d32('0xc'));var jsforce=require(_0x5d32('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5d32('0x8'));var querystring=require(_0x5d32('0xe'));var Papa=require(_0x5d32('0xf'));var authService=require(_0x5d32('0x10'));var hardwareService=require(_0x5d32('0x11'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0x5d32('0x12'));var config=require('../../config/environment');var db=require(_0x5d32('0x13'))['db'];config[_0x5d32('0x14')]=_['defaults'](config[_0x5d32('0x14')],{'host':_0x5d32('0x15'),'port':0x18eb});var socket=require(_0x5d32('0x16'))(new Redis(config[_0x5d32('0x14')]));require(_0x5d32('0x17'))[_0x5d32('0x18')](socket);function respondWithStatusCode(_0x511647,_0x92072){_0x92072=_0x92072||0xcc;return function(_0xaca668){if(_0xaca668){return _0x511647[_0x5d32('0x19')](_0x92072);}return _0x511647[_0x5d32('0x1a')](_0x92072)[_0x5d32('0x1b')]();};}function respondWithResult(_0x19323a,_0x141654){_0x141654=_0x141654||0xc8;return function(_0x1fc6bc){if(_0x1fc6bc){return _0x19323a['status'](_0x141654)[_0x5d32('0x1c')](_0x1fc6bc);}};}function respondWithFilteredResult(_0x6e8a1e,_0x213f7b){return function(_0x4fe82b){if(_0x4fe82b){var _0x5464e3=_0x4fe82b[_0x5d32('0x1d')],_0x50559a=_0x213f7b[_0x5d32('0x1e')],_0x516f8d=_0x213f7b[_0x5d32('0x1e')]+_0x213f7b[_0x5d32('0x1f')],_0x40cdf7;if(_0x516f8d>=_0x5464e3){_0x516f8d=_0x5464e3;_0x40cdf7=0xc8;}else{_0x40cdf7=0xce;}_0x6e8a1e[_0x5d32('0x1a')](_0x40cdf7);return _0x6e8a1e[_0x5d32('0x20')](_0x5d32('0x21'),_0x50559a+'-'+_0x516f8d+'/'+_0x5464e3)[_0x5d32('0x1c')](_0x4fe82b);}return null;};}function patchUpdates(_0xbd8f3c){return function(_0xbe205f){try{jsonpatch['apply'](_0xbe205f,_0xbd8f3c,!![]);}catch(_0x300331){return BPromise[_0x5d32('0x22')](_0x300331);}return _0xbe205f['save']();};}function saveUpdates(_0x4cdb73,_0x217693){return function(_0x420b15){if(_0x420b15){return _0x420b15[_0x5d32('0x23')](_0x4cdb73)[_0x5d32('0x24')](function(_0x545d74){return _0x545d74;});}return null;};}function removeEntity(_0x5ab876,_0x2ca3f1){return function(_0x30b9de){if(_0x30b9de){return _0x30b9de['destroy']()['then'](function(){_0x5ab876[_0x5d32('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c063,_0xc4532e){return function(_0x42e805){if(!_0x42e805){_0x5c063['sendStatus'](0x194);}return _0x42e805;};}function handleError(_0x3056c4,_0x2cc354){_0x2cc354=_0x2cc354||0x1f4;return function(_0x4e4b28){logger[_0x5d32('0x25')](_0x4e4b28[_0x5d32('0x26')]);if(_0x4e4b28[_0x5d32('0x27')]){delete _0x4e4b28[_0x5d32('0x27')];}_0x3056c4[_0x5d32('0x1a')](_0x2cc354)[_0x5d32('0x28')](_0x4e4b28);};}exports['show']=function(_0x4b9d87,_0x6bf815){var _0x575a10={'raw':![],'where':{'id':_0x4b9d87['params']['id']}},_0xe94c24={};_0xe94c24[_0x5d32('0x29')]=_[_0x5d32('0x2a')](db[_0x5d32('0x2b')][_0x5d32('0x2c')]);_0xe94c24[_0x5d32('0x2d')]=_[_0x5d32('0x2a')](_0x4b9d87['query']);_0xe94c24['filters']=_['intersection'](_0xe94c24['model'],_0xe94c24[_0x5d32('0x2d')]);_0x575a10[_0x5d32('0x2e')]=_[_0x5d32('0x2f')](_0xe94c24['model'],qs['fields'](_0x4b9d87[_0x5d32('0x2d')][_0x5d32('0x30')]));_0x575a10['attributes']=_0x575a10[_0x5d32('0x2e')]['length']?_0x575a10['attributes']:_0xe94c24[_0x5d32('0x29')];if(_0x4b9d87[_0x5d32('0x2d')][_0x5d32('0x31')]){_0x575a10['include']=[{'all':!![]}];}_0x575a10=_['merge']({},_0x575a10,_0x4b9d87[_0x5d32('0x32')]);return db[_0x5d32('0x2b')]['find'](_0x575a10)['then'](handleEntityNotFound(_0x6bf815,null))[_0x5d32('0x24')](respondWithResult(_0x6bf815,null))[_0x5d32('0x33')](handleError(_0x6bf815,null));};exports[_0x5d32('0x34')]=function(_0x238233,_0xd32efc){return db[_0x5d32('0x2b')][_0x5d32('0x35')]({'where':{'id':_0x238233[_0x5d32('0x36')]['id']}})[_0x5d32('0x24')](handleEntityNotFound(_0xd32efc,null))['then'](removeEntity(_0xd32efc,null))['catch'](handleError(_0xd32efc,null));};function widgetAttributes(_0x5c308c){try{switch(_0x5c308c[_0x5d32('0x37')]){case'iframe':return[{'name':_0x5d32('0x38'),'value':_0x5c308c[_0x5d32('0x38')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x0]?_0x5c308c[_0x5d32('0x39')][0x0]['value']:undefined)||_0x5d32('0x3a')}];case _0x5d32('0x3b'):return[{'name':'attrPath','value':_0x5c308c['attrPath']||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x0]?_0x5c308c[_0x5d32('0x39')][0x0][_0x5d32('0x3c')]:undefined)||''}];case'clock':return[{'name':_0x5d32('0x3d'),'value':_0x5c308c[_0x5d32('0x3d')]||(_0x5c308c['attrs']&&_0x5c308c[_0x5d32('0x39')][0x0]?_0x5c308c[_0x5d32('0x39')][0x0][_0x5d32('0x3c')]:undefined)||_0x5d32('0x3e')},{'name':_0x5d32('0x3f'),'value':_0x5c308c[_0x5d32('0x3f')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x1]?_0x5c308c[_0x5d32('0x39')][0x1][_0x5d32('0x3c')]:undefined)||_0x5d32('0x40')},{'name':_0x5d32('0x41'),'value':_0x5c308c[_0x5d32('0x41')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c['attrs'][0x2]?_0x5c308c[_0x5d32('0x39')][0x2][_0x5d32('0x3c')]:undefined)||0xc}];case _0x5d32('0x42'):return[{'name':_0x5d32('0x43'),'value':_0x5c308c[_0x5d32('0x43')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x0]?_0x5c308c[_0x5d32('0x39')][0x0][_0x5d32('0x3c')]:undefined)||_0x5d32('0x44')},{'name':_0x5d32('0x45'),'value':_0x5c308c[_0x5d32('0x45')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x1]?_0x5c308c[_0x5d32('0x39')][0x1][_0x5d32('0x3c')]:undefined)||[]},{'name':_0x5d32('0x41'),'value':_0x5c308c[_0x5d32('0x41')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x2]?_0x5c308c[_0x5d32('0x39')][0x2]['value']:undefined)||0x14}];case _0x5d32('0x46'):case _0x5d32('0x47'):return[{'name':'attrSerie1','value':_0x5c308c[_0x5d32('0x48')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x0]?_0x5c308c['attrs'][0x0][_0x5d32('0x3c')]:undefined)||'total'},{'name':_0x5d32('0x49'),'value':_0x5c308c[_0x5d32('0x49')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c['attrs'][0x1]?_0x5c308c['attrs'][0x1]['value']:undefined)||null},{'name':_0x5d32('0x4a'),'value':_0x5c308c[_0x5d32('0x4a')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x2]?_0x5c308c[_0x5d32('0x39')][0x2][_0x5d32('0x3c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x5c308c['attrVoiceQueues']||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x3]?_0x5c308c[_0x5d32('0x39')][0x3][_0x5d32('0x3c')]:undefined)||[]}];case _0x5d32('0x4b'):return[{'name':'attrReport','type':_0x5c308c[_0x5d32('0x4c')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x0]?_0x5c308c[_0x5d32('0x39')][0x0][_0x5d32('0x37')]:undefined)||null,'value':_0x5c308c[_0x5d32('0x4d')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x0]?_0x5c308c[_0x5d32('0x39')][0x0][_0x5d32('0x3c')]:undefined)||null},{'name':_0x5d32('0x4e'),'value':_0x5c308c[_0x5d32('0x4e')]||(_0x5c308c[_0x5d32('0x39')]&&_0x5c308c[_0x5d32('0x39')][0x1]?_0x5c308c[_0x5d32('0x39')][0x1][_0x5d32('0x3c')]:undefined)||0x0}];default:return[];}}catch(_0x281e67){logger[_0x5d32('0x25')](_0x5d32('0x4f'),JSON[_0x5d32('0x50')](_0x281e67));return[];}}exports[_0x5d32('0x51')]=function(_0x12f4f8,_0x3300d2){if(_0x12f4f8[_0x5d32('0x52')]){_0x12f4f8[_0x5d32('0x52')][_0x5d32('0x39')]=widgetAttributes(_0x12f4f8[_0x5d32('0x52')]);}return db['DashboardItem'][_0x5d32('0x51')](_0x12f4f8[_0x5d32('0x52')],{})[_0x5d32('0x24')](respondWithResult(_0x3300d2,0xc9))['catch'](handleError(_0x3300d2,null));};exports[_0x5d32('0x23')]=function(_0x73f3ac,_0x33ba85){if(_0x73f3ac[_0x5d32('0x52')]['id']){delete _0x73f3ac[_0x5d32('0x52')]['id'];}_0x73f3ac[_0x5d32('0x52')][_0x5d32('0x39')]=widgetAttributes(_0x73f3ac[_0x5d32('0x52')]);return db[_0x5d32('0x2b')][_0x5d32('0x35')]({'where':{'id':_0x73f3ac[_0x5d32('0x36')]['id']}})[_0x5d32('0x24')](handleEntityNotFound(_0x33ba85,null))[_0x5d32('0x24')](saveUpdates(_0x73f3ac[_0x5d32('0x52')],null))['then'](respondWithResult(_0x33ba85,null))['catch'](handleError(_0x33ba85,null));}; \ No newline at end of file +var _0xed5c=['crypto','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','name','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','DashboardItem','find','catch','destroy','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','lodash','squel'];(function(_0x4f6f46,_0x4e96b5){var _0x424797=function(_0x51e810){while(--_0x51e810){_0x4f6f46['push'](_0x4f6f46['shift']());}};_0x424797(++_0x4e96b5);}(_0xed5c,0x13f));var _0xced5=function(_0x5222cf,_0x469dc3){_0x5222cf=_0x5222cf-0x0;var _0x4ffa2e=_0xed5c[_0x5222cf];return _0x4ffa2e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xced5('0x0'));var rimraf=require(_0xced5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xced5('0x2'));var rp=require(_0xced5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xced5('0x4'));var util=require(_0xced5('0x5'));var path=require('path');var sox=require(_0xced5('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xced5('0x7'));var squel=require(_0xced5('0x8'));var crypto=require(_0xced5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xced5('0xa'));var toCsv=require(_0xced5('0xb'));var querystring=require(_0xced5('0xc'));var Papa=require('papaparse');var authService=require(_0xced5('0xd'));var hardwareService=require(_0xced5('0xe'));var Redis=require(_0xced5('0xf'));var qs=require(_0xced5('0x10'));var logger=require(_0xced5('0x11'))(_0xced5('0x12'));var utils=require(_0xced5('0x13'));var config=require(_0xced5('0x14'));var db=require('../../mysqldb')['db'];config[_0xced5('0x15')]=_['defaults'](config[_0xced5('0x15')],{'host':_0xced5('0x16'),'port':0x18eb});var socket=require(_0xced5('0x17'))(new Redis(config[_0xced5('0x15')]));require(_0xced5('0x18'))[_0xced5('0x19')](socket);function respondWithStatusCode(_0x4da592,_0x4c1cf4){_0x4c1cf4=_0x4c1cf4||0xcc;return function(_0x4bb3a4){if(_0x4bb3a4){return _0x4da592[_0xced5('0x1a')](_0x4c1cf4);}return _0x4da592[_0xced5('0x1b')](_0x4c1cf4)[_0xced5('0x1c')]();};}function respondWithResult(_0x3e1c13,_0x3fd66e){_0x3fd66e=_0x3fd66e||0xc8;return function(_0x5f0827){if(_0x5f0827){return _0x3e1c13[_0xced5('0x1b')](_0x3fd66e)[_0xced5('0x1d')](_0x5f0827);}};}function respondWithFilteredResult(_0x417b4e,_0x4f59eb){return function(_0x1406a3){if(_0x1406a3){var _0x553cf1=_0x1406a3[_0xced5('0x1e')],_0x4a8f6c=_0x4f59eb[_0xced5('0x1f')],_0x30f530=_0x4f59eb[_0xced5('0x1f')]+_0x4f59eb['limit'],_0xed0529;if(_0x30f530>=_0x553cf1){_0x30f530=_0x553cf1;_0xed0529=0xc8;}else{_0xed0529=0xce;}_0x417b4e['status'](_0xed0529);return _0x417b4e[_0xced5('0x20')](_0xced5('0x21'),_0x4a8f6c+'-'+_0x30f530+'/'+_0x553cf1)[_0xced5('0x1d')](_0x1406a3);}return null;};}function patchUpdates(_0x299f5a){return function(_0x5a280b){try{jsonpatch[_0xced5('0x22')](_0x5a280b,_0x299f5a,!![]);}catch(_0x186e44){return BPromise['reject'](_0x186e44);}return _0x5a280b[_0xced5('0x23')]();};}function saveUpdates(_0x21dd61,_0x5559d7){return function(_0x54e535){if(_0x54e535){return _0x54e535[_0xced5('0x24')](_0x21dd61)[_0xced5('0x25')](function(_0x27ae9e){return _0x27ae9e;});}return null;};}function removeEntity(_0x5dd171,_0x33ae3d){return function(_0x3edc98){if(_0x3edc98){return _0x3edc98['destroy']()['then'](function(){_0x5dd171[_0xced5('0x1b')](0xcc)[_0xced5('0x1c')]();});}};}function handleEntityNotFound(_0xcc13c1,_0x1317d7){return function(_0x147dd8){if(!_0x147dd8){_0xcc13c1['sendStatus'](0x194);}return _0x147dd8;};}function handleError(_0x49b387,_0xf30e7a){_0xf30e7a=_0xf30e7a||0x1f4;return function(_0x311b18){logger['error'](_0x311b18['stack']);if(_0x311b18[_0xced5('0x26')]){delete _0x311b18['name'];}_0x49b387[_0xced5('0x1b')](_0xf30e7a)[_0xced5('0x27')](_0x311b18);};}exports[_0xced5('0x28')]=function(_0x754056,_0x551c91){var _0x47e961={'raw':![],'where':{'id':_0x754056[_0xced5('0x29')]['id']}},_0x349d1a={};_0x349d1a[_0xced5('0x2a')]=_[_0xced5('0x2b')](db['DashboardItem'][_0xced5('0x2c')]);_0x349d1a[_0xced5('0x2d')]=_['keys'](_0x754056['query']);_0x349d1a['filters']=_[_0xced5('0x2e')](_0x349d1a[_0xced5('0x2a')],_0x349d1a[_0xced5('0x2d')]);_0x47e961[_0xced5('0x2f')]=_['intersection'](_0x349d1a['model'],qs[_0xced5('0x30')](_0x754056[_0xced5('0x2d')][_0xced5('0x30')]));_0x47e961[_0xced5('0x2f')]=_0x47e961[_0xced5('0x2f')][_0xced5('0x31')]?_0x47e961['attributes']:_0x349d1a['model'];if(_0x754056[_0xced5('0x2d')][_0xced5('0x32')]){_0x47e961[_0xced5('0x33')]=[{'all':!![]}];}_0x47e961=_[_0xced5('0x34')]({},_0x47e961,_0x754056[_0xced5('0x35')]);return db[_0xced5('0x36')][_0xced5('0x37')](_0x47e961)[_0xced5('0x25')](handleEntityNotFound(_0x551c91,null))[_0xced5('0x25')](respondWithResult(_0x551c91,null))[_0xced5('0x38')](handleError(_0x551c91,null));};exports[_0xced5('0x39')]=function(_0x4556aa,_0x411451){return db['DashboardItem']['find']({'where':{'id':_0x4556aa['params']['id']}})[_0xced5('0x25')](handleEntityNotFound(_0x411451,null))['then'](removeEntity(_0x411451,null))[_0xced5('0x38')](handleError(_0x411451,null));};function widgetAttributes(_0x5e4b80){try{switch(_0x5e4b80[_0xced5('0x3a')]){case _0xced5('0x3b'):return[{'name':_0xced5('0x3c'),'value':_0x5e4b80[_0xced5('0x3c')]||(_0x5e4b80[_0xced5('0x3d')]&&_0x5e4b80[_0xced5('0x3d')][0x0]?_0x5e4b80['attrs'][0x0][_0xced5('0x3e')]:undefined)||_0xced5('0x3f')}];case'custom':return[{'name':_0xced5('0x40'),'value':_0x5e4b80['attrPath']||(_0x5e4b80['attrs']&&_0x5e4b80[_0xced5('0x3d')][0x0]?_0x5e4b80[_0xced5('0x3d')][0x0][_0xced5('0x3e')]:undefined)||''}];case _0xced5('0x41'):return[{'name':_0xced5('0x42'),'value':_0x5e4b80[_0xced5('0x42')]||(_0x5e4b80['attrs']&&_0x5e4b80[_0xced5('0x3d')][0x0]?_0x5e4b80[_0xced5('0x3d')][0x0][_0xced5('0x3e')]:undefined)||'HH:mm:ss'},{'name':_0xced5('0x43'),'value':_0x5e4b80['attrTimezone']||(_0x5e4b80[_0xced5('0x3d')]&&_0x5e4b80[_0xced5('0x3d')][0x1]?_0x5e4b80[_0xced5('0x3d')][0x1][_0xced5('0x3e')]:undefined)||'0.00'},{'name':_0xced5('0x44'),'value':_0x5e4b80['attrFontSize']||(_0x5e4b80[_0xced5('0x3d')]&&_0x5e4b80[_0xced5('0x3d')][0x2]?_0x5e4b80[_0xced5('0x3d')][0x2][_0xced5('0x3e')]:undefined)||0xc}];case _0xced5('0x45'):return[{'name':_0xced5('0x46'),'value':_0x5e4b80[_0xced5('0x46')]||(_0x5e4b80['attrs']&&_0x5e4b80[_0xced5('0x3d')][0x0]?_0x5e4b80['attrs'][0x0][_0xced5('0x3e')]:undefined)||_0xced5('0x47')},{'name':_0xced5('0x48'),'value':_0x5e4b80[_0xced5('0x48')]||(_0x5e4b80[_0xced5('0x3d')]&&_0x5e4b80[_0xced5('0x3d')][0x1]?_0x5e4b80[_0xced5('0x3d')][0x1][_0xced5('0x3e')]:undefined)||[]},{'name':_0xced5('0x44'),'value':_0x5e4b80[_0xced5('0x44')]||(_0x5e4b80[_0xced5('0x3d')]&&_0x5e4b80[_0xced5('0x3d')][0x2]?_0x5e4b80[_0xced5('0x3d')][0x2][_0xced5('0x3e')]:undefined)||0x14}];case _0xced5('0x49'):case _0xced5('0x4a'):return[{'name':_0xced5('0x4b'),'value':_0x5e4b80[_0xced5('0x4b')]||(_0x5e4b80[_0xced5('0x3d')]&&_0x5e4b80[_0xced5('0x3d')][0x0]?_0x5e4b80['attrs'][0x0][_0xced5('0x3e')]:undefined)||_0xced5('0x47')},{'name':_0xced5('0x4c'),'value':_0x5e4b80[_0xced5('0x4c')]||(_0x5e4b80[_0xced5('0x3d')]&&_0x5e4b80['attrs'][0x1]?_0x5e4b80['attrs'][0x1][_0xced5('0x3e')]:undefined)||null},{'name':_0xced5('0x4d'),'value':_0x5e4b80['attrSerie3']||(_0x5e4b80['attrs']&&_0x5e4b80[_0xced5('0x3d')][0x2]?_0x5e4b80[_0xced5('0x3d')][0x2][_0xced5('0x3e')]:undefined)||null},{'name':_0xced5('0x48'),'value':_0x5e4b80['attrVoiceQueues']||(_0x5e4b80[_0xced5('0x3d')]&&_0x5e4b80[_0xced5('0x3d')][0x3]?_0x5e4b80[_0xced5('0x3d')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0xced5('0x4e'),'type':_0x5e4b80[_0xced5('0x4f')]||(_0x5e4b80[_0xced5('0x3d')]&&_0x5e4b80[_0xced5('0x3d')][0x0]?_0x5e4b80['attrs'][0x0][_0xced5('0x3a')]:undefined)||null,'value':_0x5e4b80[_0xced5('0x4e')]||(_0x5e4b80[_0xced5('0x3d')]&&_0x5e4b80[_0xced5('0x3d')][0x0]?_0x5e4b80['attrs'][0x0][_0xced5('0x3e')]:undefined)||null},{'name':'attrRefresh','value':_0x5e4b80['attrRefresh']||(_0x5e4b80['attrs']&&_0x5e4b80['attrs'][0x1]?_0x5e4b80[_0xced5('0x3d')][0x1][_0xced5('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x1e4545){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x1e4545));return[];}}exports[_0xced5('0x50')]=function(_0x338d5d,_0x3c41c4){if(_0x338d5d[_0xced5('0x51')]){_0x338d5d['body'][_0xced5('0x3d')]=widgetAttributes(_0x338d5d[_0xced5('0x51')]);}return db[_0xced5('0x36')][_0xced5('0x50')](_0x338d5d['body'],{})[_0xced5('0x25')](respondWithResult(_0x3c41c4,0xc9))[_0xced5('0x38')](handleError(_0x3c41c4,null));};exports[_0xced5('0x24')]=function(_0x35db0e,_0xa40290){if(_0x35db0e[_0xced5('0x51')]['id']){delete _0x35db0e[_0xced5('0x51')]['id'];}_0x35db0e[_0xced5('0x51')][_0xced5('0x3d')]=widgetAttributes(_0x35db0e['body']);return db[_0xced5('0x36')][_0xced5('0x37')]({'where':{'id':_0x35db0e[_0xced5('0x29')]['id']}})[_0xced5('0x25')](handleEntityNotFound(_0xa40290,null))[_0xced5('0x25')](saveUpdates(_0x35db0e[_0xced5('0x51')],null))[_0xced5('0x25')](respondWithResult(_0xa40290,null))[_0xced5('0x38')](handleError(_0xa40290,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 97ec4b9..49ef39b 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 _0x16d2=['save','update','remove','emit','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x5cbb3a,_0x4f49af){var _0x51f529=function(_0x42c89a){while(--_0x42c89a){_0x5cbb3a['push'](_0x5cbb3a['shift']());}};_0x51f529(++_0x4f49af);}(_0x16d2,0x15a));var _0x216d=function(_0x3f6d5a,_0x2a83c8){_0x3f6d5a=_0x3f6d5a-0x0;var _0x33b363=_0x16d2[_0x3f6d5a];return _0x33b363;};'use strict';var EventEmitter=require(_0x216d('0x0'));var DashboardItem=require(_0x216d('0x1'))['db'][_0x216d('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x216d('0x3')](0x0);var events={'afterCreate':_0x216d('0x4'),'afterUpdate':_0x216d('0x5'),'afterDestroy':_0x216d('0x6')};function emitEvent(_0x44a12c){return function(_0x2f4762,_0x59e284,_0x1e344a){DashboardItemEvents['emit'](_0x44a12c+':'+_0x2f4762['id'],_0x2f4762);DashboardItemEvents[_0x216d('0x7')](_0x44a12c,_0x2f4762);_0x1e344a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x216d('0x8')](e,emitEvent(event));}}module[_0x216d('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x55b7=['setMaxListeners','save','update','emit','exports','events','../../mysqldb'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x55b7,0x1d3));var _0x755b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x55b7[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x755b('0x0'));var DashboardItem=require(_0x755b('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x755b('0x2')](0x0);var events={'afterCreate':_0x755b('0x3'),'afterUpdate':_0x755b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x538276){return function(_0x168dbf,_0x231975,_0x87d3f2){DashboardItemEvents['emit'](_0x538276+':'+_0x168dbf['id'],_0x168dbf);DashboardItemEvents[_0x755b('0x5')](_0x538276,_0x168dbf);_0x87d3f2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x755b('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 1d0b56f..61a793f 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 _0x7a54=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','./dashboardItem.attributes','exports','define'];(function(_0x4cd690,_0x4797cc){var _0x4a74a9=function(_0x4cbbc5){while(--_0x4cbbc5){_0x4cd690['push'](_0x4cd690['shift']());}};_0x4a74a9(++_0x4797cc);}(_0x7a54,0x106));var _0x47a5=function(_0x5c5600,_0x57454c){_0x5c5600=_0x5c5600-0x0;var _0x3c9869=_0x7a54[_0x5c5600];return _0x3c9869;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('DashboardItem',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','./dashboardItem.attributes','exports','define'];(function(_0x1b87fb,_0x3e6870){var _0xc7de31=function(_0x4eaded){while(--_0x4eaded){_0x1b87fb['push'](_0x1b87fb['shift']());}};_0xc7de31(++_0x3e6870);}(_0x7a54,0x106));var _0x47a5=function(_0x49eb7e,_0x56bf92){_0x49eb7e=_0x49eb7e-0x0;var _0x24ebcc=_0x7a54[_0x49eb7e];return _0x24ebcc;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('DashboardItem',attributes,{'tableName':_0x47a5('0x8'),'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 42559c8..2972df0 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 _0x71fb=['http','redis','localhost','then','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x34620e,_0x582015){var _0x3d33cd=function(_0x19dc7f){while(--_0x19dc7f){_0x34620e['push'](_0x34620e['shift']());}};_0x3d33cd(++_0x582015);}(_0x71fb,0x80));var _0xb71f=function(_0x1e1e73,_0x23e341){_0x1e1e73=_0x1e1e73-0x0;var _0x6998d3=_0x71fb[_0x1e1e73];return _0x6998d3;};'use strict';var _=require('lodash');var util=require(_0xb71f('0x0'));var moment=require(_0xb71f('0x1'));var BPromise=require(_0xb71f('0x2'));var rs=require(_0xb71f('0x3'));var fs=require('fs');var Redis=require(_0xb71f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb71f('0x5'));var logger=require(_0xb71f('0x6'))(_0xb71f('0x7'));var config=require(_0xb71f('0x8'));var jayson=require(_0xb71f('0x9'));var client=jayson['client'][_0xb71f('0xa')]({'port':0x232a});config[_0xb71f('0xb')]=_['defaults'](config[_0xb71f('0xb')],{'host':_0xb71f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb71f('0xb')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x483681,_0x537959,_0x11f878){return new BPromise(function(_0x978133,_0x20bb59){return client['request'](_0x483681,_0x11f878)[_0xb71f('0xd')](function(_0x34f143){logger['info'](_0xb71f('0xe'),_0x537959,'request\x20sent');logger[_0xb71f('0xf')](_0xb71f('0x10'),_0x537959,_0xb71f('0x11'),JSON['stringify'](_0x34f143));if(_0x34f143[_0xb71f('0x12')]){if(_0x34f143[_0xb71f('0x12')][_0xb71f('0x13')]===0x1f4){logger[_0xb71f('0x12')](_0xb71f('0xe'),_0x537959,_0x34f143[_0xb71f('0x12')][_0xb71f('0x14')]);return _0x20bb59(_0x34f143[_0xb71f('0x12')][_0xb71f('0x14')]);}logger['error'](_0xb71f('0xe'),_0x537959,_0x34f143[_0xb71f('0x12')][_0xb71f('0x14')]);return _0x978133(_0x34f143[_0xb71f('0x12')][_0xb71f('0x14')]);}else{logger[_0xb71f('0x15')](_0xb71f('0xe'),_0x537959,_0xb71f('0x11'));_0x978133(_0x34f143[_0xb71f('0x16')][_0xb71f('0x14')]);}})['catch'](function(_0x325070){logger['error'](_0xb71f('0xe'),_0x537959,_0x325070);_0x20bb59(_0x325070);});});} \ No newline at end of file +var _0x99c9=['message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','defaults','localhost','./dashboardItem.socket','register','request','DashboardItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0xc0638b,_0x2fccf4){var _0xd57dfa=function(_0x322fba){while(--_0x322fba){_0xc0638b['push'](_0xc0638b['shift']());}};_0xd57dfa(++_0x2fccf4);}(_0x99c9,0x93));var _0x999c=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x99c9[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0x999c('0x0'));var moment=require(_0x999c('0x1'));var BPromise=require(_0x999c('0x2'));var rs=require(_0x999c('0x3'));var fs=require('fs');var Redis=require(_0x999c('0x4'));var db=require(_0x999c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x999c('0x6'));var config=require(_0x999c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999c('0x8')]['http']({'port':0x232a});config[_0x999c('0x9')]=_[_0x999c('0xa')](config[_0x999c('0x9')],{'host':_0x999c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x999c('0x9')]));require(_0x999c('0xc'))[_0x999c('0xd')](socket);function respondWithRpcPromise(_0x3fac40,_0x4b67e4,_0x10afcf){return new BPromise(function(_0xb57758,_0x2a60f6){return client[_0x999c('0xe')](_0x3fac40,_0x10afcf)['then'](function(_0x1dc72a){logger['info'](_0x999c('0xf'),_0x4b67e4,'request\x20sent');logger[_0x999c('0x10')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x4b67e4,_0x999c('0x11'),JSON[_0x999c('0x12')](_0x1dc72a));if(_0x1dc72a[_0x999c('0x13')]){if(_0x1dc72a[_0x999c('0x13')][_0x999c('0x14')]===0x1f4){logger['error'](_0x999c('0xf'),_0x4b67e4,_0x1dc72a[_0x999c('0x13')][_0x999c('0x15')]);return _0x2a60f6(_0x1dc72a['error']['message']);}logger[_0x999c('0x13')](_0x999c('0xf'),_0x4b67e4,_0x1dc72a['error'][_0x999c('0x15')]);return _0xb57758(_0x1dc72a[_0x999c('0x13')][_0x999c('0x15')]);}else{logger[_0x999c('0x16')](_0x999c('0xf'),_0x4b67e4,_0x999c('0x11'));_0xb57758(_0x1dc72a['result']['message']);}})[_0x999c('0x17')](function(_0x34e33c){logger[_0x999c('0x13')](_0x999c('0xf'),_0x4b67e4,_0x34e33c);_0x2a60f6(_0x34e33c);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index b36665a..e82990f 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 _0x9c44=['emit','removeListener','length','dashboardItem:','remove','update'];(function(_0x324f00,_0x29d3b4){var _0x46deca=function(_0x358395){while(--_0x358395){_0x324f00['push'](_0x324f00['shift']());}};_0x46deca(++_0x29d3b4);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){DashboardItemEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);DashboardItemEvents['on'](_0x436234,_0x511d53);}}; \ No newline at end of file +var _0x9957=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var DashboardItemEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){DashboardItemEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);DashboardItemEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 5f13aa7..c3cc6e9 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 _0x7272=['multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','exports'];(function(_0x30804d,_0x38b1a4){var _0x3bdf9f=function(_0x3f86cf){while(--_0x3f86cf){_0x30804d['push'](_0x30804d['shift']());}};_0x3bdf9f(++_0x38b1a4);}(_0x7272,0x1cb));var _0x2727=function(_0x433d91,_0x478933){_0x433d91=_0x433d91-0x0;var _0x39d32a=_0x7272[_0x433d91];return _0x39d32a;};'use strict';var multer=require(_0x2727('0x0'));var util=require('util');var path=require(_0x2727('0x1'));var timeout=require(_0x2727('0x2'));var express=require('express');var router=express[_0x2727('0x3')]();var auth=require(_0x2727('0x4'));var interaction=require(_0x2727('0x5'));var config=require(_0x2727('0x6'));var controller=require('./dashboardItem.controller');router[_0x2727('0x7')](_0x2727('0x8'),auth[_0x2727('0x9')](),controller[_0x2727('0xa')]);router[_0x2727('0xb')]('/',auth['isAuthenticated'](),controller[_0x2727('0xc')]);router[_0x2727('0xd')](_0x2727('0x8'),auth[_0x2727('0x9')](),controller[_0x2727('0xe')]);router[_0x2727('0xf')](_0x2727('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x2727('0x10')]=router; \ No newline at end of file +var _0xa12c=['isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x34be85,_0x1b36ef){var _0x1e55fe=function(_0x4bd45f){while(--_0x4bd45f){_0x34be85['push'](_0x34be85['shift']());}};_0x1e55fe(++_0x1b36ef);}(_0xa12c,0x199));var _0xca12=function(_0x451cb9,_0xe9c73a){_0x451cb9=_0x451cb9-0x0;var _0x3f7912=_0xa12c[_0x451cb9];return _0x3f7912;};'use strict';var multer=require(_0xca12('0x0'));var util=require('util');var path=require(_0xca12('0x1'));var timeout=require('connect-timeout');var express=require(_0xca12('0x2'));var router=express[_0xca12('0x3')]();var auth=require(_0xca12('0x4'));var interaction=require(_0xca12('0x5'));var config=require(_0xca12('0x6'));var controller=require('./dashboardItem.controller');router['get']('/:id',auth[_0xca12('0x7')](),controller[_0xca12('0x8')]);router[_0xca12('0x9')]('/',auth['isAuthenticated'](),controller[_0xca12('0xa')]);router['put'](_0xca12('0xb'),auth[_0xca12('0x7')](),controller[_0xca12('0xc')]);router[_0xca12('0xd')](_0xca12('0xb'),auth[_0xca12('0x7')](),controller[_0xca12('0xe')]);module[_0xca12('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 6ae0ad1..52840c8 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 _0x585e=['STRING','exports'];(function(_0x5a7f5c,_0x4c89d3){var _0x7b45fb=function(_0x100152){while(--_0x100152){_0x5a7f5c['push'](_0x5a7f5c['shift']());}};_0x7b45fb(++_0x4c89d3);}(_0x585e,0x16b));var _0xe585=function(_0x536cf4,_0x9e101){_0x536cf4=_0x536cf4-0x0;var _0x2a101d=_0x585e[_0x536cf4];return _0x2a101d;};'use strict';var Sequelize=require('sequelize');module[_0xe585('0x0')]={'name':{'type':Sequelize[_0xe585('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x70e8=['sequelize','exports'];(function(_0x41eb2b,_0x3010f0){var _0xbf527b=function(_0x352fc5){while(--_0x352fc5){_0x41eb2b['push'](_0x41eb2b['shift']());}};_0xbf527b(++_0x3010f0);}(_0x70e8,0x164));var _0x870e=function(_0x11905a,_0x5e1278){_0x11905a=_0x11905a-0x0;var _0x1d64d8=_0x70e8[_0x11905a];return _0x1d64d8;};'use strict';var Sequelize=require(_0x870e('0x0'));module[_0x870e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index dcc193d..df79da6 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 _0x501f=['destroy','get','Dispositions','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','where','map','key','VIRTUAL','options','Disposition','include','findAll','rows','catch','show','params','includeAll','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','update','then'];(function(_0x4ba693,_0x386f60){var _0x2edc00=function(_0x49ef44){while(--_0x49ef44){_0x4ba693['push'](_0x4ba693['shift']());}};_0x2edc00(++_0x386f60);}(_0x501f,0x1db));var _0xf501=function(_0x1b4306,_0x3e9df3){_0x1b4306=_0x1b4306-0x0;var _0x19f386=_0x501f[_0x1b4306];return _0x19f386;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf501('0x0'));var rimraf=require(_0xf501('0x1'));var zipdir=require(_0xf501('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf501('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf501('0x4'));var util=require(_0xf501('0x5'));var path=require(_0xf501('0x6'));var sox=require(_0xf501('0x7'));var csv=require('to-csv');var ejs=require(_0xf501('0x8'));var fs=require('fs');var _=require(_0xf501('0x9'));var squel=require(_0xf501('0xa'));var crypto=require(_0xf501('0xb'));var jsforce=require(_0xf501('0xc'));var deskjs=require(_0xf501('0xd'));var toCsv=require(_0xf501('0xe'));var querystring=require(_0xf501('0xf'));var Papa=require(_0xf501('0x10'));var authService=require(_0xf501('0x11'));var hardwareService=require(_0xf501('0x12'));var Redis=require(_0xf501('0x13'));var qs=require(_0xf501('0x14'));var logger=require('../../config/logger')(_0xf501('0x15'));var utils=require(_0xf501('0x16'));var config=require(_0xf501('0x17'));var db=require(_0xf501('0x18'))['db'];function respondWithStatusCode(_0x13634f,_0x57bdc5){_0x57bdc5=_0x57bdc5||0xcc;return function(_0x479def){if(_0x479def){return _0x13634f['sendStatus'](_0x57bdc5);}return _0x13634f[_0xf501('0x19')](_0x57bdc5)[_0xf501('0x1a')]();};}function respondWithResult(_0x32ab66,_0x45636c){_0x45636c=_0x45636c||0xc8;return function(_0x3b936f){if(_0x3b936f){return _0x32ab66['status'](_0x45636c)[_0xf501('0x1b')](_0x3b936f);}};}function respondWithFilteredResult(_0x2d5e7b,_0x18e448){return function(_0x3434c5){if(_0x3434c5){var _0x33eb61=_0x3434c5[_0xf501('0x1c')],_0x545c97=_0x18e448[_0xf501('0x1d')],_0x47c494=_0x18e448['offset']+_0x18e448['limit'],_0x452242;if(_0x47c494>=_0x33eb61){_0x47c494=_0x33eb61;_0x452242=0xc8;}else{_0x452242=0xce;}_0x2d5e7b[_0xf501('0x19')](_0x452242);return _0x2d5e7b[_0xf501('0x1e')](_0xf501('0x1f'),_0x545c97+'-'+_0x47c494+'/'+_0x33eb61)[_0xf501('0x1b')](_0x3434c5);}return null;};}function patchUpdates(_0x186d9f){return function(_0x58a0da){try{jsonpatch['apply'](_0x58a0da,_0x186d9f,!![]);}catch(_0x8e67d4){return BPromise[_0xf501('0x20')](_0x8e67d4);}return _0x58a0da['save']();};}function saveUpdates(_0xa6230,_0x3eb017){return function(_0x402cff){if(_0x402cff){return _0x402cff[_0xf501('0x21')](_0xa6230)[_0xf501('0x22')](function(_0xa4bbd1){return _0xa4bbd1;});}return null;};}function removeEntity(_0x3875ea,_0xac45ad){return function(_0x356f67){if(_0x356f67){return _0x356f67[_0xf501('0x23')]()[_0xf501('0x22')](function(){var _0x5388d7=_0x356f67[_0xf501('0x24')]({'plain':!![]});var _0x6c5239=_0xf501('0x25');return db[_0xf501('0x26')][_0xf501('0x23')]({'where':{'type':_0x6c5239,'resourceId':_0x5388d7['id']}})[_0xf501('0x22')](function(){return _0x356f67;});})[_0xf501('0x22')](function(){_0x3875ea[_0xf501('0x19')](0xcc)[_0xf501('0x1a')]();});}};}function handleEntityNotFound(_0x49bc1f,_0x12ff37){return function(_0xe008fc){if(!_0xe008fc){_0x49bc1f[_0xf501('0x27')](0x194);}return _0xe008fc;};}function handleError(_0x494b3a,_0x2a6918){_0x2a6918=_0x2a6918||0x1f4;return function(_0x527b63){logger[_0xf501('0x28')](_0x527b63[_0xf501('0x29')]);if(_0x527b63[_0xf501('0x2a')]){delete _0x527b63[_0xf501('0x2a')];}_0x494b3a['status'](_0x2a6918)[_0xf501('0x2b')](_0x527b63);};}exports[_0xf501('0x2c')]=function(_0x355d6c,_0x52e19e){var _0x5a51a4={},_0x42bc04={},_0x3d2916={'count':0x0,'rows':[]};var _0x4a2b86=db['Disposition'][_0xf501('0x2d')];_0x42bc04[_0xf501('0x2e')]=_[_0xf501('0x2f')](_0x4a2b86);_0x42bc04[_0xf501('0x30')]=_[_0xf501('0x2f')](_0x355d6c[_0xf501('0x30')]);_0x42bc04['filters']=_[_0xf501('0x31')](_0x42bc04[_0xf501('0x2e')],_0x42bc04[_0xf501('0x30')]);_0x5a51a4[_0xf501('0x32')]=_[_0xf501('0x31')](_0x42bc04['model'],qs[_0xf501('0x33')](_0x355d6c[_0xf501('0x30')][_0xf501('0x33')]));_0x5a51a4[_0xf501('0x32')]=_0x5a51a4[_0xf501('0x32')][_0xf501('0x34')]?_0x5a51a4[_0xf501('0x32')]:_0x42bc04[_0xf501('0x2e')];if(!_0x355d6c[_0xf501('0x30')][_0xf501('0x35')](_0xf501('0x36'))){_0x5a51a4[_0xf501('0x37')]=qs[_0xf501('0x37')](_0x355d6c[_0xf501('0x30')]['limit']);_0x5a51a4[_0xf501('0x1d')]=qs['offset'](_0x355d6c['query'][_0xf501('0x1d')]);}_0x5a51a4[_0xf501('0x38')]=qs[_0xf501('0x39')](_0x355d6c['query'][_0xf501('0x39')]);_0x5a51a4['where']=qs['filters'](_[_0xf501('0x3a')](_0x355d6c[_0xf501('0x30')],_0x42bc04[_0xf501('0x3b')]));if(_0x355d6c[_0xf501('0x30')][_0xf501('0x3c')]){_0x5a51a4[_0xf501('0x3d')]=_['merge'](_0x5a51a4[_0xf501('0x3d')],{'$or':_[_0xf501('0x3e')](_0x4a2b86,function(_0x5edf48){if(_0x5edf48['type'][_0xf501('0x3f')]!==_0xf501('0x40')){var _0x20c730={};_0x20c730[_0x5edf48['field']]={'$like':'%'+_0x355d6c[_0xf501('0x30')]['filter']+'%'};return _0x20c730;}})});}_0x5a51a4=_['merge']({},_0x5a51a4,_0x355d6c[_0xf501('0x41')]);var _0x4de456={'where':_0x5a51a4['where']};return db[_0xf501('0x42')][_0xf501('0x1c')](_0x4de456)[_0xf501('0x22')](function(_0x3995c4){_0x3d2916[_0xf501('0x1c')]=_0x3995c4;if(_0x355d6c['query']['includeAll']){_0x5a51a4[_0xf501('0x43')]=[{'all':!![]}];}return db['Disposition'][_0xf501('0x44')](_0x5a51a4);})[_0xf501('0x22')](function(_0x360b07){_0x3d2916[_0xf501('0x45')]=_0x360b07;return _0x3d2916;})[_0xf501('0x22')](respondWithFilteredResult(_0x52e19e,_0x5a51a4))[_0xf501('0x46')](handleError(_0x52e19e,null));};exports[_0xf501('0x47')]=function(_0x751317,_0x4d6702){var _0x488f04={'raw':!![],'where':{'id':_0x751317[_0xf501('0x48')]['id']}},_0x49025c={};_0x49025c[_0xf501('0x2e')]=_[_0xf501('0x2f')](db[_0xf501('0x42')][_0xf501('0x2d')]);_0x49025c[_0xf501('0x30')]=_['keys'](_0x751317['query']);_0x49025c[_0xf501('0x3b')]=_[_0xf501('0x31')](_0x49025c[_0xf501('0x2e')],_0x49025c['query']);_0x488f04['attributes']=_['intersection'](_0x49025c[_0xf501('0x2e')],qs['fields'](_0x751317[_0xf501('0x30')][_0xf501('0x33')]));_0x488f04[_0xf501('0x32')]=_0x488f04[_0xf501('0x32')]['length']?_0x488f04[_0xf501('0x32')]:_0x49025c['model'];if(_0x751317[_0xf501('0x30')][_0xf501('0x49')]){_0x488f04['include']=[{'all':!![]}];}_0x488f04=_[_0xf501('0x4a')]({},_0x488f04,_0x751317[_0xf501('0x41')]);return db['Disposition']['find'](_0x488f04)[_0xf501('0x22')](handleEntityNotFound(_0x4d6702,null))[_0xf501('0x22')](respondWithResult(_0x4d6702,null))['catch'](handleError(_0x4d6702,null));};exports['create']=function(_0x5b255f,_0x4e1c9c){return db[_0xf501('0x42')][_0xf501('0x4b')](_0x5b255f[_0xf501('0x4c')],{})[_0xf501('0x22')](function(_0x20240d){var _0x9b9204=_0x5b255f[_0xf501('0x4d')][_0xf501('0x24')]({'plain':!![]});if(!_0x9b9204)throw new Error(_0xf501('0x4e'));if(_0x9b9204[_0xf501('0x4f')]===_0xf501('0x4d')){var _0x560883=_0x20240d[_0xf501('0x24')]({'plain':!![]});var _0x4943de=_0xf501('0x25');return db[_0xf501('0x50')][_0xf501('0x51')]({'where':{'name':_0x4943de,'userProfileId':_0x9b9204[_0xf501('0x52')]},'raw':!![]})['then'](function(_0x44bbdd){if(_0x44bbdd&&_0x44bbdd[_0xf501('0x53')]===0x0){return db[_0xf501('0x26')]['create']({'name':_0x560883[_0xf501('0x2a')],'resourceId':_0x560883['id'],'type':_0x44bbdd[_0xf501('0x2a')],'sectionId':_0x44bbdd['id']},{})[_0xf501('0x22')](function(){return _0x20240d;});}else{return _0x20240d;}})[_0xf501('0x46')](function(_0x1f0ce5){logger[_0xf501('0x28')](_0xf501('0x54'),_0x1f0ce5);throw _0x1f0ce5;});}return _0x20240d;})[_0xf501('0x22')](respondWithResult(_0x4e1c9c,0xc9))['catch'](handleError(_0x4e1c9c,null));};exports[_0xf501('0x21')]=function(_0x419c87,_0x3facb0){if(_0x419c87[_0xf501('0x4c')]['id']){delete _0x419c87['body']['id'];}return db[_0xf501('0x42')][_0xf501('0x51')]({'where':{'id':_0x419c87['params']['id']}})['then'](handleEntityNotFound(_0x3facb0,null))['then'](saveUpdates(_0x419c87[_0xf501('0x4c')],null))[_0xf501('0x22')](respondWithResult(_0x3facb0,null))['catch'](handleError(_0x3facb0,null));};exports[_0xf501('0x23')]=function(_0x3bd8cc,_0x5447bc){return db[_0xf501('0x42')][_0xf501('0x51')]({'where':{'id':_0x3bd8cc[_0xf501('0x48')]['id']}})[_0xf501('0x22')](handleEntityNotFound(_0x5447bc,null))[_0xf501('0x22')](removeEntity(_0x5447bc,null))[_0xf501('0x46')](handleError(_0x5447bc,null));}; \ No newline at end of file +var _0xf50b=['reject','save','then','destroy','get','Dispositions','UserProfileResource','sendStatus','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','field','filter','options','Disposition','include','findAll','catch','show','params','includeAll','find','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','Content-Range','json','apply'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0xf50b,0xc8));var _0xbf50=function(_0x4c117e,_0x5b75af){_0x4c117e=_0x4c117e-0x0;var _0x41be66=_0xf50b[_0x4c117e];return _0x41be66;};'use strict';var pdf=require(_0xbf50('0x0'));var emlformat=require(_0xbf50('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbf50('0x2'));var jsonpatch=require(_0xbf50('0x3'));var rp=require(_0xbf50('0x4'));var moment=require(_0xbf50('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbf50('0x6'));var util=require('util');var path=require(_0xbf50('0x7'));var sox=require(_0xbf50('0x8'));var csv=require(_0xbf50('0x9'));var ejs=require(_0xbf50('0xa'));var fs=require('fs');var _=require(_0xbf50('0xb'));var squel=require(_0xbf50('0xc'));var crypto=require(_0xbf50('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbf50('0xe'));var toCsv=require(_0xbf50('0x9'));var querystring=require(_0xbf50('0xf'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xbf50('0x10'));var Redis=require(_0xbf50('0x11'));var qs=require(_0xbf50('0x12'));var logger=require('../../config/logger')(_0xbf50('0x13'));var utils=require(_0xbf50('0x14'));var config=require(_0xbf50('0x15'));var db=require(_0xbf50('0x16'))['db'];function respondWithStatusCode(_0x120ece,_0x3ec71a){_0x3ec71a=_0x3ec71a||0xcc;return function(_0xca370a){if(_0xca370a){return _0x120ece['sendStatus'](_0x3ec71a);}return _0x120ece[_0xbf50('0x17')](_0x3ec71a)[_0xbf50('0x18')]();};}function respondWithResult(_0x38ae23,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xc8;return function(_0x151dd6){if(_0x151dd6){return _0x38ae23['status'](_0x1be8aa)['json'](_0x151dd6);}};}function respondWithFilteredResult(_0x4b05bb,_0x101e5d){return function(_0x5df099){if(_0x5df099){var _0x1d09b2=_0x5df099[_0xbf50('0x19')],_0x242a58=_0x101e5d['offset'],_0x47719b=_0x101e5d[_0xbf50('0x1a')]+_0x101e5d[_0xbf50('0x1b')],_0x531729;if(_0x47719b>=_0x1d09b2){_0x47719b=_0x1d09b2;_0x531729=0xc8;}else{_0x531729=0xce;}_0x4b05bb[_0xbf50('0x17')](_0x531729);return _0x4b05bb['set'](_0xbf50('0x1c'),_0x242a58+'-'+_0x47719b+'/'+_0x1d09b2)[_0xbf50('0x1d')](_0x5df099);}return null;};}function patchUpdates(_0x3698e7){return function(_0x336b88){try{jsonpatch[_0xbf50('0x1e')](_0x336b88,_0x3698e7,!![]);}catch(_0x4ec323){return BPromise[_0xbf50('0x1f')](_0x4ec323);}return _0x336b88[_0xbf50('0x20')]();};}function saveUpdates(_0x54c011,_0x30df3b){return function(_0x21763f){if(_0x21763f){return _0x21763f['update'](_0x54c011)[_0xbf50('0x21')](function(_0x1c590a){return _0x1c590a;});}return null;};}function removeEntity(_0x19cb84,_0x3424de){return function(_0x3c3839){if(_0x3c3839){return _0x3c3839[_0xbf50('0x22')]()[_0xbf50('0x21')](function(){var _0x5e0eda=_0x3c3839[_0xbf50('0x23')]({'plain':!![]});var _0x133843=_0xbf50('0x24');return db[_0xbf50('0x25')]['destroy']({'where':{'type':_0x133843,'resourceId':_0x5e0eda['id']}})[_0xbf50('0x21')](function(){return _0x3c3839;});})[_0xbf50('0x21')](function(){_0x19cb84[_0xbf50('0x17')](0xcc)[_0xbf50('0x18')]();});}};}function handleEntityNotFound(_0x1f1579,_0x16e1e3){return function(_0x4ff0be){if(!_0x4ff0be){_0x1f1579[_0xbf50('0x26')](0x194);}return _0x4ff0be;};}function handleError(_0x30bfff,_0x8ae567){_0x8ae567=_0x8ae567||0x1f4;return function(_0x5cb202){logger['error'](_0x5cb202[_0xbf50('0x27')]);if(_0x5cb202['name']){delete _0x5cb202[_0xbf50('0x28')];}_0x30bfff['status'](_0x8ae567)[_0xbf50('0x29')](_0x5cb202);};}exports['index']=function(_0x3e45f9,_0x105c9f){var _0x2bedd2={},_0x46e3fd={},_0x35984a={'count':0x0,'rows':[]};var _0x31ed84=db['Disposition'][_0xbf50('0x2a')];_0x46e3fd[_0xbf50('0x2b')]=_[_0xbf50('0x2c')](_0x31ed84);_0x46e3fd[_0xbf50('0x2d')]=_[_0xbf50('0x2c')](_0x3e45f9[_0xbf50('0x2d')]);_0x46e3fd[_0xbf50('0x2e')]=_[_0xbf50('0x2f')](_0x46e3fd['model'],_0x46e3fd[_0xbf50('0x2d')]);_0x2bedd2[_0xbf50('0x30')]=_[_0xbf50('0x2f')](_0x46e3fd[_0xbf50('0x2b')],qs['fields'](_0x3e45f9[_0xbf50('0x2d')][_0xbf50('0x31')]));_0x2bedd2[_0xbf50('0x30')]=_0x2bedd2[_0xbf50('0x30')][_0xbf50('0x32')]?_0x2bedd2[_0xbf50('0x30')]:_0x46e3fd[_0xbf50('0x2b')];if(!_0x3e45f9[_0xbf50('0x2d')][_0xbf50('0x33')](_0xbf50('0x34'))){_0x2bedd2[_0xbf50('0x1b')]=qs['limit'](_0x3e45f9[_0xbf50('0x2d')][_0xbf50('0x1b')]);_0x2bedd2['offset']=qs[_0xbf50('0x1a')](_0x3e45f9[_0xbf50('0x2d')][_0xbf50('0x1a')]);}_0x2bedd2[_0xbf50('0x35')]=qs['sort'](_0x3e45f9[_0xbf50('0x2d')][_0xbf50('0x36')]);_0x2bedd2[_0xbf50('0x37')]=qs[_0xbf50('0x2e')](_[_0xbf50('0x38')](_0x3e45f9['query'],_0x46e3fd[_0xbf50('0x2e')]));if(_0x3e45f9[_0xbf50('0x2d')]['filter']){_0x2bedd2['where']=_[_0xbf50('0x39')](_0x2bedd2[_0xbf50('0x37')],{'$or':_[_0xbf50('0x3a')](_0x31ed84,function(_0x104bd2){if(_0x104bd2['type'][_0xbf50('0x3b')]!=='VIRTUAL'){var _0x3b28b4={};_0x3b28b4[_0x104bd2[_0xbf50('0x3c')]]={'$like':'%'+_0x3e45f9[_0xbf50('0x2d')][_0xbf50('0x3d')]+'%'};return _0x3b28b4;}})});}_0x2bedd2=_[_0xbf50('0x39')]({},_0x2bedd2,_0x3e45f9[_0xbf50('0x3e')]);var _0x356736={'where':_0x2bedd2[_0xbf50('0x37')]};return db[_0xbf50('0x3f')][_0xbf50('0x19')](_0x356736)['then'](function(_0x4a1aa6){_0x35984a['count']=_0x4a1aa6;if(_0x3e45f9[_0xbf50('0x2d')]['includeAll']){_0x2bedd2[_0xbf50('0x40')]=[{'all':!![]}];}return db['Disposition'][_0xbf50('0x41')](_0x2bedd2);})[_0xbf50('0x21')](function(_0x3e7a47){_0x35984a['rows']=_0x3e7a47;return _0x35984a;})[_0xbf50('0x21')](respondWithFilteredResult(_0x105c9f,_0x2bedd2))[_0xbf50('0x42')](handleError(_0x105c9f,null));};exports[_0xbf50('0x43')]=function(_0x297e8e,_0x540c1f){var _0x325f63={'raw':!![],'where':{'id':_0x297e8e[_0xbf50('0x44')]['id']}},_0x89858a={};_0x89858a[_0xbf50('0x2b')]=_[_0xbf50('0x2c')](db[_0xbf50('0x3f')][_0xbf50('0x2a')]);_0x89858a[_0xbf50('0x2d')]=_[_0xbf50('0x2c')](_0x297e8e[_0xbf50('0x2d')]);_0x89858a[_0xbf50('0x2e')]=_[_0xbf50('0x2f')](_0x89858a[_0xbf50('0x2b')],_0x89858a[_0xbf50('0x2d')]);_0x325f63[_0xbf50('0x30')]=_['intersection'](_0x89858a[_0xbf50('0x2b')],qs[_0xbf50('0x31')](_0x297e8e['query']['fields']));_0x325f63[_0xbf50('0x30')]=_0x325f63[_0xbf50('0x30')]['length']?_0x325f63[_0xbf50('0x30')]:_0x89858a[_0xbf50('0x2b')];if(_0x297e8e[_0xbf50('0x2d')][_0xbf50('0x45')]){_0x325f63[_0xbf50('0x40')]=[{'all':!![]}];}_0x325f63=_['merge']({},_0x325f63,_0x297e8e[_0xbf50('0x3e')]);return db['Disposition'][_0xbf50('0x46')](_0x325f63)['then'](handleEntityNotFound(_0x540c1f,null))['then'](respondWithResult(_0x540c1f,null))['catch'](handleError(_0x540c1f,null));};exports[_0xbf50('0x47')]=function(_0x5c38f1,_0x197528){return db['Disposition'][_0xbf50('0x47')](_0x5c38f1[_0xbf50('0x48')],{})[_0xbf50('0x21')](function(_0x1600a8){var _0x502d3e=_0x5c38f1[_0xbf50('0x49')][_0xbf50('0x23')]({'plain':!![]});if(!_0x502d3e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x502d3e[_0xbf50('0x4a')]===_0xbf50('0x49')){var _0x3ca764=_0x1600a8[_0xbf50('0x23')]({'plain':!![]});var _0x666f82=_0xbf50('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x666f82,'userProfileId':_0x502d3e[_0xbf50('0x4b')]},'raw':!![]})[_0xbf50('0x21')](function(_0x59ba45){if(_0x59ba45&&_0x59ba45['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3ca764[_0xbf50('0x28')],'resourceId':_0x3ca764['id'],'type':_0x59ba45[_0xbf50('0x28')],'sectionId':_0x59ba45['id']},{})['then'](function(){return _0x1600a8;});}else{return _0x1600a8;}})[_0xbf50('0x42')](function(_0x5e8800){logger['error'](_0xbf50('0x4c'),_0x5e8800);throw _0x5e8800;});}return _0x1600a8;})[_0xbf50('0x21')](respondWithResult(_0x197528,0xc9))[_0xbf50('0x42')](handleError(_0x197528,null));};exports['update']=function(_0x149015,_0x48f6f7){if(_0x149015[_0xbf50('0x48')]['id']){delete _0x149015[_0xbf50('0x48')]['id'];}return db[_0xbf50('0x3f')][_0xbf50('0x46')]({'where':{'id':_0x149015[_0xbf50('0x44')]['id']}})[_0xbf50('0x21')](handleEntityNotFound(_0x48f6f7,null))[_0xbf50('0x21')](saveUpdates(_0x149015['body'],null))[_0xbf50('0x21')](respondWithResult(_0x48f6f7,null))[_0xbf50('0x42')](handleError(_0x48f6f7,null));};exports['destroy']=function(_0x3b1d8a,_0x2c98bd){return db[_0xbf50('0x3f')][_0xbf50('0x46')]({'where':{'id':_0x3b1d8a[_0xbf50('0x44')]['id']}})['then'](handleEntityNotFound(_0x2c98bd,null))[_0xbf50('0x21')](removeEntity(_0x2c98bd,null))[_0xbf50('0x42')](handleError(_0x2c98bd,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index e5b4ffd..de7ee8a 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 _0xda2d=['name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','util','../../config/logger','api','moment','bluebird','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat'];(function(_0x2b0d3a,_0x3f6ee8){var _0x564067=function(_0x5588ec){while(--_0x5588ec){_0x2b0d3a['push'](_0x2b0d3a['shift']());}};_0x564067(++_0x3f6ee8);}(_0xda2d,0x102));var _0xdda2=function(_0x4b43df,_0x5a46ba){_0x4b43df=_0x4b43df-0x0;var _0x59e3bc=_0xda2d[_0x4b43df];return _0x59e3bc;};'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 attributes=require('./disposition.attributes');module['exports']=function(_0x357e97,_0x319129){return _0x357e97[_0xdda2('0x5')](_0xdda2('0x6'),attributes,{'tableName':_0xdda2('0x7'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xdda2('0x8'),'fields':[_0xdda2('0x9'),_0xdda2('0xa')]},{'unique':!![],'name':_0xdda2('0xb'),'fields':[_0xdda2('0x9'),'ChatWebsiteId']},{'unique':!![],'name':_0xdda2('0xc'),'fields':[_0xdda2('0x9'),'MailAccountId']},{'unique':!![],'name':_0xdda2('0xd'),'fields':[_0xdda2('0x9'),_0xdda2('0xe')]},{'unique':!![],'name':_0xdda2('0xf'),'fields':[_0xdda2('0x9'),_0xdda2('0x10')]},{'unique':!![],'name':_0xdda2('0x11'),'fields':[_0xdda2('0x9'),'OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2f=['name_voice','name','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./disposition.attributes','define','Disposition','tools_dispositions'];(function(_0x5228fb,_0x365cad){var _0x49d30d=function(_0x27e3b9){while(--_0x27e3b9){_0x5228fb['push'](_0x5228fb['shift']());}};_0x49d30d(++_0x365cad);}(_0x5f2f,0x73));var _0xf5f2=function(_0xaf1939,_0xeaa586){_0xaf1939=_0xaf1939-0x0;var _0x5cafdc=_0x5f2f[_0xaf1939];return _0x5cafdc;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var attributes=require(_0xf5f2('0x7'));module['exports']=function(_0x4854b6,_0x1665c7){return _0x4854b6[_0xf5f2('0x8')](_0xf5f2('0x9'),attributes,{'tableName':_0xf5f2('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf5f2('0xb'),'fields':[_0xf5f2('0xc'),'ListId']},{'unique':!![],'name':_0xf5f2('0xd'),'fields':[_0xf5f2('0xc'),_0xf5f2('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0xf5f2('0xc'),_0xf5f2('0xf')]},{'unique':!![],'name':_0xf5f2('0x10'),'fields':['name',_0xf5f2('0x11')]},{'unique':!![],'name':'name_fax','fields':['name',_0xf5f2('0x12')]},{'unique':!![],'name':_0xf5f2('0x13'),'fields':['name',_0xf5f2('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 8ef5605..9bcc189 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 _0x0309=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x24b97a,_0x585d64){var _0x43afcf=function(_0x253ad5){while(--_0x253ad5){_0x24b97a['push'](_0x24b97a['shift']());}};_0x43afcf(++_0x585d64);}(_0x0309,0x165));var _0x9030=function(_0x1627c9,_0x35482a){_0x1627c9=_0x1627c9-0x0;var _0x3635c4=_0x0309[_0x1627c9];return _0x3635c4;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var moment=require(_0x9030('0x1'));var BPromise=require('bluebird');var rs=require(_0x9030('0x2'));var fs=require('fs');var Redis=require(_0x9030('0x3'));var db=require(_0x9030('0x4'))['db'];var utils=require(_0x9030('0x5'));var logger=require(_0x9030('0x6'))(_0x9030('0x7'));var config=require(_0x9030('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9030('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105c15,_0x4f2d84,_0xb53eb4){return new BPromise(function(_0x4e6c7b,_0x1e2360){return client[_0x9030('0xa')](_0x105c15,_0xb53eb4)[_0x9030('0xb')](function(_0x5711b4){logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));logger['debug'](_0x9030('0xf'),_0x4f2d84,_0x9030('0xe'),JSON[_0x9030('0x10')](_0x5711b4));if(_0x5711b4[_0x9030('0x11')]){if(_0x5711b4[_0x9030('0x11')][_0x9030('0x12')]===0x1f4){logger[_0x9030('0x11')]('Disposition,\x20%s,\x20%s',_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x1e2360(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}logger['error'](_0x9030('0xd'),_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x4e6c7b(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}else{logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));_0x4e6c7b(_0x5711b4[_0x9030('0x14')]['message']);}})[_0x9030('0x15')](function(_0x17e80d){logger[_0x9030('0x11')](_0x9030('0xd'),_0x4f2d84,_0x17e80d);_0x1e2360(_0x17e80d);});});} \ No newline at end of file +var _0xb4c7=['client','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1f9613,_0x3be92f){var _0xe0ef2=function(_0x498287){while(--_0x498287){_0x1f9613['push'](_0x1f9613['shift']());}};_0xe0ef2(++_0x3be92f);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x2eb62e,_0x3deeec){_0x2eb62e=_0x2eb62e-0x0;var _0xe24137=_0xb4c7[_0x2eb62e];return _0xe24137;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd5c7,_0x4bf85d,_0x2d7b7e){return new BPromise(function(_0x21687f,_0x570daa){return client[_0x7b4c('0xc')](_0x2dd5c7,_0x2d7b7e)[_0x7b4c('0xd')](function(_0x28e902){logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));logger[_0x7b4c('0x11')](_0x7b4c('0x12'),_0x4bf85d,_0x7b4c('0x10'),JSON[_0x7b4c('0x13')](_0x28e902));if(_0x28e902['error']){if(_0x28e902['error'][_0x7b4c('0x14')]===0x1f4){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);return _0x570daa(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')]['message']);return _0x21687f(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}else{logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));_0x21687f(_0x28e902[_0x7b4c('0x17')][_0x7b4c('0x16')]);}})[_0x7b4c('0x18')](function(_0x4d3f5e){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x4d3f5e);_0x570daa(_0x4d3f5e);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 81fa1d8..42bcccb 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 _0x4e5a=['show','post','create','put','update','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','/:id'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x4e5a,0xa6));var _0xa4e5=function(_0x1d2ef2,_0x1a7599){_0x1d2ef2=_0x1d2ef2-0x0;var _0x345183=_0x4e5a[_0x1d2ef2];return _0x345183;};'use strict';var multer=require(_0xa4e5('0x0'));var util=require(_0xa4e5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa4e5('0x2')]();var auth=require(_0xa4e5('0x3'));var interaction=require(_0xa4e5('0x4'));var config=require(_0xa4e5('0x5'));var controller=require(_0xa4e5('0x6'));router['get']('/',auth[_0xa4e5('0x7')](),controller[_0xa4e5('0x8')]);router['get'](_0xa4e5('0x9'),auth[_0xa4e5('0x7')](),controller[_0xa4e5('0xa')]);router[_0xa4e5('0xb')]('/',auth[_0xa4e5('0x7')](),controller[_0xa4e5('0xc')]);router[_0xa4e5('0xd')](_0xa4e5('0x9'),auth[_0xa4e5('0x7')](),controller[_0xa4e5('0xe')]);router['delete']('/:id',auth[_0xa4e5('0x7')](),controller['destroy']);module[_0xa4e5('0xf')]=router; \ No newline at end of file +var _0x4150=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4150,0x153));var _0x0415=function(_0x5cb141,_0xb136aa){_0x5cb141=_0x5cb141-0x0;var _0x15f4fd=_0x4150[_0x5cb141];return _0x15f4fd;};'use strict';var multer=require('multer');var util=require(_0x0415('0x0'));var path=require(_0x0415('0x1'));var timeout=require('connect-timeout');var express=require(_0x0415('0x2'));var router=express[_0x0415('0x3')]();var auth=require(_0x0415('0x4'));var interaction=require(_0x0415('0x5'));var config=require(_0x0415('0x6'));var controller=require(_0x0415('0x7'));router[_0x0415('0x8')]('/',auth[_0x0415('0x9')](),controller[_0x0415('0xa')]);router[_0x0415('0x8')](_0x0415('0xb'),auth[_0x0415('0x9')](),controller['show']);router[_0x0415('0xc')]('/',auth[_0x0415('0x9')](),controller[_0x0415('0xd')]);router[_0x0415('0xe')](_0x0415('0xb'),auth[_0x0415('0x9')](),controller[_0x0415('0xf')]);router[_0x0415('0x10')](_0x0415('0xb'),auth[_0x0415('0x9')](),controller[_0x0415('0x11')]);module[_0x0415('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 76e92d1..e11d87f 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 _0xe085=['yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','14400','4800','INTEGER','DADHI','KHOMP','SIP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM'];(function(_0x2c4b06,_0x2e9683){var _0x341c4d=function(_0x379cef){while(--_0x379cef){_0x2c4b06['push'](_0x2c4b06['shift']());}};_0x341c4d(++_0x2e9683);}(_0xe085,0x188));var _0x5e08=function(_0xae694c,_0x590993){_0xae694c=_0xae694c-0x0;var _0x303dd7=_0xe085[_0xae694c];return _0x303dd7;};'use strict';var Sequelize=require(_0x5e08('0x0'));module[_0x5e08('0x1')]={'name':{'type':Sequelize[_0x5e08('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x5e08('0x3')](_0x5e08('0x4'),'no'),'defaultValue':_0x5e08('0x4')},'headerinfo':{'type':Sequelize[_0x5e08('0x2')],'defaultValue':_0x5e08('0x5')},'localstationid':{'type':Sequelize[_0x5e08('0x2')],'unique':_0x5e08('0x6')},'minrate':{'type':Sequelize[_0x5e08('0x3')](_0x5e08('0x7'),'4800',_0x5e08('0x8'),_0x5e08('0x9'),'12000',_0x5e08('0xa')),'defaultValue':_0x5e08('0xb')},'maxrate':{'type':Sequelize[_0x5e08('0x3')](_0x5e08('0x7'),_0x5e08('0xb'),_0x5e08('0x8'),_0x5e08('0x9'),'12000','14400'),'defaultValue':_0x5e08('0xa')},'modem':{'type':Sequelize[_0x5e08('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5e08('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5e08('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP','IAX',_0x5e08('0xd'),_0x5e08('0xe')),'defaultValue':_0x5e08('0xf')},'key':{'type':Sequelize[_0x5e08('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5e08('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5e08('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5e08('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5e08('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5e08('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5e08('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x5e08('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x5e08('0x10')],'defaultValue':![],'comment':_0x5e08('0x12'),'set':function(_0x47faa1){if(!_0x47faa1)this[_0x5e08('0x13')](_0x5e08('0x14'),null);this['setDataValue'](_0x5e08('0x15'),_0x47faa1);}}}; \ No newline at end of file +var _0x839f=['yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','14400','4800','v17,v27,v29','SIP','IAX','KHOMP','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','sequelize','STRING','ENUM'];(function(_0x1e16e7,_0x11d381){var _0x1fcd7a=function(_0x544554){while(--_0x544554){_0x1e16e7['push'](_0x1e16e7['shift']());}};_0x1fcd7a(++_0x11d381);}(_0x839f,0x189));var _0xf839=function(_0x5f27a1,_0x122e60){_0x5f27a1=_0x5f27a1-0x0;var _0x43c440=_0x839f[_0x5f27a1];return _0x43c440;};'use strict';var Sequelize=require(_0xf839('0x0'));module['exports']={'name':{'type':Sequelize[_0xf839('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf839('0x1')]},'ecm':{'type':Sequelize[_0xf839('0x2')](_0xf839('0x3'),'no'),'defaultValue':_0xf839('0x3')},'headerinfo':{'type':Sequelize[_0xf839('0x1')],'defaultValue':_0xf839('0x4')},'localstationid':{'type':Sequelize[_0xf839('0x1')],'unique':_0xf839('0x5')},'minrate':{'type':Sequelize[_0xf839('0x2')](_0xf839('0x6'),'4800',_0xf839('0x7'),_0xf839('0x8'),_0xf839('0x9'),_0xf839('0xa')),'defaultValue':_0xf839('0xb')},'maxrate':{'type':Sequelize[_0xf839('0x2')](_0xf839('0x6'),_0xf839('0xb'),'7200',_0xf839('0x8'),_0xf839('0x9'),_0xf839('0xa')),'defaultValue':_0xf839('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xf839('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xf839('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xf839('0xd'),_0xf839('0xe'),'DADHI',_0xf839('0xf')),'defaultValue':_0xf839('0xd')},'key':{'type':Sequelize[_0xf839('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf839('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf839('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf839('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf839('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf839('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf839('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf839('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf839('0x12')],'allowNull':!![],'defaultValue':null,'comment':_0xf839('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xf839('0x11')],'defaultValue':![],'comment':_0xf839('0x14'),'set':function(_0x3af628){if(!_0x3af628)this[_0xf839('0x15')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x3af628);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 9ff4a1f..18af93f 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 _0x41ca=['sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','app','system','description','priority','appdata','push','Set','ecm','localstationid','gateway','headerinfo','maxrate','minrate','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','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','DESC','attachments','join','root','CheckAfterSend','isNil','from','fax','List\x20not\x20found','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','userFaxAccount:remove','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','json','apply','update','destroy','get','FaxAccounts','name','mandatoryDispositionPause','FaxAccount','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','map','type','key','VIRTUAL','filter','merge','options','count','includeAll','rows','show','params','Pause','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','describe','FaxAccountId','Disposition','getDispositions','order','removeDispositions','addAnswer','CannedAnswer','include','findAll','removeAnswers','ids','addInteraction','FaxInteraction','getInteractions','CmContact','User','Owner','fullname','internal','Tags','color','tag','addApplications','findOne'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x41ca,0x1b5));var _0xa41c=function(_0x1d3456,_0x1c2654){_0x1d3456=_0x1d3456-0x0;var _0x363060=_0x41ca[_0x1d3456];return _0x363060;};'use strict';var pdf=require(_0xa41c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa41c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa41c('0x2'));var rp=require(_0xa41c('0x3'));var moment=require(_0xa41c('0x4'));var BPromise=require(_0xa41c('0x5'));var Mustache=require(_0xa41c('0x6'));var util=require(_0xa41c('0x7'));var path=require(_0xa41c('0x8'));var sox=require(_0xa41c('0x9'));var csv=require('to-csv');var ejs=require(_0xa41c('0xa'));var fs=require('fs');var _=require(_0xa41c('0xb'));var squel=require(_0xa41c('0xc'));var crypto=require('crypto');var jsforce=require(_0xa41c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa41c('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xa41c('0xf'));var hardwareService=require(_0xa41c('0x10'));var Redis=require('ioredis');var qs=require(_0xa41c('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xa41c('0x12'));var config=require(_0xa41c('0x13'));var db=require(_0xa41c('0x14'))['db'];config[_0xa41c('0x15')]=_[_0xa41c('0x16')](config[_0xa41c('0x15')],{'host':_0xa41c('0x17'),'port':0x18eb});var socket=require(_0xa41c('0x18'))(new Redis(config[_0xa41c('0x15')]));require(_0xa41c('0x19'))[_0xa41c('0x1a')](socket);var jayson=require(_0xa41c('0x1b'));var client=jayson['client'][_0xa41c('0x1c')]({'port':0x232c});var client9002=jayson[_0xa41c('0x1d')][_0xa41c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xf40e20,_0x5a23db,_0x11c179,_0x5c9dab){return new BPromise(function(_0x5af835,_0x1db8e6){var _0x2d3696=_0x5c9dab||client;return _0x2d3696['request'](_0xf40e20,_0x11c179)[_0xa41c('0x1e')](function(_0x2f9576){logger[_0xa41c('0x1f')](_0xa41c('0x20'),_0x5a23db,_0xa41c('0x21'));logger[_0xa41c('0x22')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5a23db,_0xa41c('0x21'),JSON[_0xa41c('0x23')](_0x2f9576));if(_0x2f9576[_0xa41c('0x24')]){if(_0x2f9576[_0xa41c('0x24')][_0xa41c('0x25')]===0x1f4){logger['error'](_0xa41c('0x20'),_0x5a23db,_0x2f9576['error']['message']);return _0x1db8e6(_0x2f9576['error'][_0xa41c('0x26')]);}logger[_0xa41c('0x24')](_0xa41c('0x20'),_0x5a23db,_0x2f9576[_0xa41c('0x24')]['message']);return _0x5af835(_0x2f9576['error']['message']);}else{logger[_0xa41c('0x1f')](_0xa41c('0x20'),_0x5a23db,_0xa41c('0x21'));_0x5af835(_0x2f9576[_0xa41c('0x27')][_0xa41c('0x26')]);}})[_0xa41c('0x28')](function(_0x5ec4d2){logger[_0xa41c('0x24')](_0xa41c('0x20'),_0x5a23db,_0x5ec4d2);_0x1db8e6(_0x5ec4d2);});});}function respondWithStatusCode(_0x40fdbf,_0x294cbd){_0x294cbd=_0x294cbd||0xcc;return function(_0x6362ed){if(_0x6362ed){return _0x40fdbf[_0xa41c('0x29')](_0x294cbd);}return _0x40fdbf[_0xa41c('0x2a')](_0x294cbd)[_0xa41c('0x2b')]();};}function respondWithResult(_0x5ed854,_0x179d06){_0x179d06=_0x179d06||0xc8;return function(_0x2552bd){if(_0x2552bd){return _0x5ed854[_0xa41c('0x2a')](_0x179d06)['json'](_0x2552bd);}};}function respondWithFilteredResult(_0x589d97,_0x128903){return function(_0x1abac9){if(_0x1abac9){var _0x111990=_0x1abac9['count'],_0x2558b3=_0x128903[_0xa41c('0x2c')],_0x3b73db=_0x128903['offset']+_0x128903[_0xa41c('0x2d')],_0x1dae9b;if(_0x3b73db>=_0x111990){_0x3b73db=_0x111990;_0x1dae9b=0xc8;}else{_0x1dae9b=0xce;}_0x589d97[_0xa41c('0x2a')](_0x1dae9b);return _0x589d97[_0xa41c('0x2e')]('Content-Range',_0x2558b3+'-'+_0x3b73db+'/'+_0x111990)[_0xa41c('0x2f')](_0x1abac9);}return null;};}function patchUpdates(_0x399fd5){return function(_0x38900a){try{jsonpatch[_0xa41c('0x30')](_0x38900a,_0x399fd5,!![]);}catch(_0xd34afa){return BPromise['reject'](_0xd34afa);}return _0x38900a['save']();};}function saveUpdates(_0xca914b,_0x527812){return function(_0x1341cc){if(_0x1341cc){return _0x1341cc[_0xa41c('0x31')](_0xca914b)[_0xa41c('0x1e')](function(_0x3e7b3b){return _0x3e7b3b;});}return null;};}function removeEntity(_0x19cfb4,_0x10f5b4){return function(_0x1db91e){if(_0x1db91e){return _0x1db91e[_0xa41c('0x32')]()[_0xa41c('0x1e')](function(){var _0x2663b0=_0x1db91e[_0xa41c('0x33')]({'plain':!![]});var _0x14eacf=_0xa41c('0x34');return db['UserProfileResource'][_0xa41c('0x32')]({'where':{'type':_0x14eacf,'resourceId':_0x2663b0['id']}})[_0xa41c('0x1e')](function(){return _0x1db91e;});})[_0xa41c('0x1e')](function(){_0x19cfb4[_0xa41c('0x2a')](0xcc)[_0xa41c('0x2b')]();});}};}function handleEntityNotFound(_0x5cd17d,_0x50d8be){return function(_0x171d97){if(!_0x171d97){_0x5cd17d['sendStatus'](0x194);}return _0x171d97;};}function handleError(_0x5bf5a7,_0x1fea00){_0x1fea00=_0x1fea00||0x1f4;return function(_0x18b699){logger[_0xa41c('0x24')](_0x18b699['stack']);if(_0x18b699[_0xa41c('0x35')]){delete _0x18b699[_0xa41c('0x35')];}_0x5bf5a7[_0xa41c('0x2a')](_0x1fea00)['send'](_0x18b699);};}exports['index']=function(_0x47b3e7,_0x272236){var _0x5dd154={'include':[{'model':db['Pause'],'as':_0xa41c('0x36')}]},_0x17ea71={},_0x63329b={'count':0x0,'rows':[]};var _0x621d5d=db[_0xa41c('0x37')]['rawAttributes'];_0x17ea71[_0xa41c('0x38')]=_['keys'](_0x621d5d);_0x17ea71[_0xa41c('0x39')]=_[_0xa41c('0x3a')](_0x47b3e7['query']);_0x17ea71[_0xa41c('0x3b')]=_[_0xa41c('0x3c')](_0x17ea71['model'],_0x17ea71[_0xa41c('0x39')]);_0x5dd154[_0xa41c('0x3d')]=_[_0xa41c('0x3c')](_0x17ea71[_0xa41c('0x38')],qs[_0xa41c('0x3e')](_0x47b3e7[_0xa41c('0x39')][_0xa41c('0x3e')]));_0x5dd154[_0xa41c('0x3d')]=_0x5dd154[_0xa41c('0x3d')]['length']?_0x5dd154[_0xa41c('0x3d')]:_0x17ea71[_0xa41c('0x38')];if(!_0x47b3e7[_0xa41c('0x39')][_0xa41c('0x3f')](_0xa41c('0x40'))){_0x5dd154[_0xa41c('0x2d')]=qs[_0xa41c('0x2d')](_0x47b3e7[_0xa41c('0x39')][_0xa41c('0x2d')]);_0x5dd154[_0xa41c('0x2c')]=qs[_0xa41c('0x2c')](_0x47b3e7['query']['offset']);}_0x5dd154['order']=qs[_0xa41c('0x41')](_0x47b3e7[_0xa41c('0x39')][_0xa41c('0x41')]);_0x5dd154[_0xa41c('0x42')]=qs[_0xa41c('0x3b')](_[_0xa41c('0x43')](_0x47b3e7[_0xa41c('0x39')],_0x17ea71[_0xa41c('0x3b')]));if(_0x47b3e7['query']['filter']){_0x5dd154[_0xa41c('0x42')]=_['merge'](_0x5dd154[_0xa41c('0x42')],{'$or':_[_0xa41c('0x44')](_0x621d5d,function(_0x585d18){if(_0x585d18[_0xa41c('0x45')][_0xa41c('0x46')]!==_0xa41c('0x47')){var _0x1995e8={};_0x1995e8[_0x585d18['field']]={'$like':'%'+_0x47b3e7[_0xa41c('0x39')][_0xa41c('0x48')]+'%'};return _0x1995e8;}})});}_0x5dd154=_[_0xa41c('0x49')]({},_0x5dd154,_0x47b3e7[_0xa41c('0x4a')]);var _0x34b222={'where':_0x5dd154['where']};return db[_0xa41c('0x37')][_0xa41c('0x4b')](_0x34b222)[_0xa41c('0x1e')](function(_0x77c7d){_0x63329b[_0xa41c('0x4b')]=_0x77c7d;if(_0x47b3e7[_0xa41c('0x39')][_0xa41c('0x4c')]){_0x5dd154['include']=[{'all':!![]}];}return db[_0xa41c('0x37')]['findAll'](_0x5dd154);})[_0xa41c('0x1e')](function(_0x503927){_0x63329b[_0xa41c('0x4d')]=_0x503927;return _0x63329b;})[_0xa41c('0x1e')](respondWithFilteredResult(_0x272236,_0x5dd154))[_0xa41c('0x28')](handleError(_0x272236,null));};exports[_0xa41c('0x4e')]=function(_0x16b73f,_0x5032c1){var _0x495fe3={'raw':![],'where':{'id':_0x16b73f[_0xa41c('0x4f')]['id']},'include':[{'model':db[_0xa41c('0x50')],'as':_0xa41c('0x36')}]},_0x1e7b09={};_0x1e7b09[_0xa41c('0x38')]=_[_0xa41c('0x3a')](db[_0xa41c('0x37')][_0xa41c('0x51')]);_0x1e7b09[_0xa41c('0x39')]=_[_0xa41c('0x3a')](_0x16b73f[_0xa41c('0x39')]);_0x1e7b09['filters']=_[_0xa41c('0x3c')](_0x1e7b09[_0xa41c('0x38')],_0x1e7b09[_0xa41c('0x39')]);_0x495fe3[_0xa41c('0x3d')]=_[_0xa41c('0x3c')](_0x1e7b09[_0xa41c('0x38')],qs[_0xa41c('0x3e')](_0x16b73f[_0xa41c('0x39')][_0xa41c('0x3e')]));_0x495fe3['attributes']=_0x495fe3['attributes'][_0xa41c('0x52')]?_0x495fe3[_0xa41c('0x3d')]:_0x1e7b09['model'];if(_0x16b73f[_0xa41c('0x39')]['includeAll']){_0x495fe3['include']=[{'all':!![]}];}_0x495fe3=_[_0xa41c('0x49')]({},_0x495fe3,_0x16b73f['options']);return db[_0xa41c('0x37')]['find'](_0x495fe3)[_0xa41c('0x1e')](handleEntityNotFound(_0x5032c1,null))[_0xa41c('0x1e')](respondWithResult(_0x5032c1,null))['catch'](handleError(_0x5032c1,null));};exports[_0xa41c('0x53')]=function(_0x173fdc,_0x1188d3){return db['FaxAccount'][_0xa41c('0x53')](_0x173fdc[_0xa41c('0x54')],{})['then'](function(_0xefc9a2){var _0x1427a0=_0x173fdc[_0xa41c('0x55')][_0xa41c('0x33')]({'plain':!![]});if(!_0x1427a0)throw new Error(_0xa41c('0x56'));if(_0x1427a0[_0xa41c('0x57')]==='user'){var _0x3148fe=_0xefc9a2[_0xa41c('0x33')]({'plain':!![]});var _0x550411=_0xa41c('0x34');return db[_0xa41c('0x58')][_0xa41c('0x59')]({'where':{'name':_0x550411,'userProfileId':_0x1427a0[_0xa41c('0x5a')]},'raw':!![]})['then'](function(_0x442d4f){if(_0x442d4f&&_0x442d4f[_0xa41c('0x5b')]===0x0){return db[_0xa41c('0x5c')]['create']({'name':_0x3148fe[_0xa41c('0x35')],'resourceId':_0x3148fe['id'],'type':_0x442d4f[_0xa41c('0x35')],'sectionId':_0x442d4f['id']},{})[_0xa41c('0x1e')](function(){return _0xefc9a2;});}else{return _0xefc9a2;}})['catch'](function(_0x455499){logger[_0xa41c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x455499);throw _0x455499;});}return _0xefc9a2;})['then'](respondWithResult(_0x1188d3,0xc9))[_0xa41c('0x28')](handleError(_0x1188d3,null));};exports[_0xa41c('0x31')]=function(_0x461a68,_0x240d9c){if(_0x461a68[_0xa41c('0x54')]['id']){delete _0x461a68[_0xa41c('0x54')]['id'];}return db[_0xa41c('0x37')][_0xa41c('0x59')]({'where':{'id':_0x461a68[_0xa41c('0x4f')]['id']},'include':[{'model':db[_0xa41c('0x50')],'as':_0xa41c('0x36')}]})[_0xa41c('0x1e')](handleEntityNotFound(_0x240d9c,null))[_0xa41c('0x1e')](saveUpdates(_0x461a68[_0xa41c('0x54')],null))['then'](function(_0x426dc6){if(_0x426dc6&&_0x461a68['body'][_0xa41c('0x36')]){return db[_0xa41c('0x50')][_0xa41c('0x31')](_0x461a68[_0xa41c('0x54')][_0xa41c('0x36')],{'where':{'FaxAccountId':_0x426dc6['id']}})[_0xa41c('0x1e')](function(){return _0x426dc6;});}return _0x426dc6;})[_0xa41c('0x1e')](respondWithResult(_0x240d9c,null))[_0xa41c('0x28')](handleError(_0x240d9c,null));};exports[_0xa41c('0x32')]=function(_0x20c7b7,_0x2fe0c2){return db[_0xa41c('0x37')][_0xa41c('0x59')]({'where':{'id':_0x20c7b7[_0xa41c('0x4f')]['id']}})[_0xa41c('0x1e')](handleEntityNotFound(_0x2fe0c2,null))[_0xa41c('0x1e')](removeEntity(_0x2fe0c2,null))[_0xa41c('0x28')](handleError(_0x2fe0c2,null));};exports[_0xa41c('0x5d')]=function(_0x300556,_0x4c1d8b){return db[_0xa41c('0x37')]['describe']()['then'](respondWithResult(_0x4c1d8b,null))[_0xa41c('0x28')](handleError(_0x4c1d8b,null));};exports['addDisposition']=function(_0x31cd75,_0x4aad9c,_0x121bfe){if(_0x31cd75['body']['id']){delete _0x31cd75[_0xa41c('0x54')]['id'];}return db[_0xa41c('0x37')]['find']({'where':{'id':_0x31cd75[_0xa41c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4aad9c,null))[_0xa41c('0x1e')](function(_0x28f332){if(_0x28f332){_0x31cd75[_0xa41c('0x54')][_0xa41c('0x5e')]=_0x28f332['id'];return db[_0xa41c('0x5f')][_0xa41c('0x53')](_0x31cd75['body']);}})[_0xa41c('0x1e')](respondWithResult(_0x4aad9c,null))[_0xa41c('0x28')](handleError(_0x4aad9c,null));};exports[_0xa41c('0x60')]=function(_0x4b1446,_0x2dd9ce,_0x280992){var _0x1dc9bf={'raw':![],'where':{}};var _0x19c518={};var _0x411699={'count':0x0,'rows':[]};return db[_0xa41c('0x37')]['findOne']({'where':{'id':_0x4b1446['params']['id']}})['then'](handleEntityNotFound(_0x2dd9ce,null))[_0xa41c('0x1e')](function(_0x3c343b){if(_0x3c343b){_0x19c518[_0xa41c('0x38')]=_[_0xa41c('0x3a')](db['Disposition']['rawAttributes']);_0x19c518[_0xa41c('0x39')]=_[_0xa41c('0x3a')](_0x4b1446['query']);_0x19c518[_0xa41c('0x3b')]=_['intersection'](_0x19c518[_0xa41c('0x38')],_0x19c518[_0xa41c('0x39')]);_0x1dc9bf['attributes']=_[_0xa41c('0x3c')](_0x19c518[_0xa41c('0x38')],qs[_0xa41c('0x3e')](_0x4b1446['query'][_0xa41c('0x3e')]));_0x1dc9bf[_0xa41c('0x3d')]=_0x1dc9bf[_0xa41c('0x3d')][_0xa41c('0x52')]?_0x1dc9bf[_0xa41c('0x3d')]:_0x19c518[_0xa41c('0x38')];if(!_0x4b1446['query'][_0xa41c('0x3f')](_0xa41c('0x40'))){_0x1dc9bf[_0xa41c('0x2d')]=qs[_0xa41c('0x2d')](_0x4b1446[_0xa41c('0x39')][_0xa41c('0x2d')]);_0x1dc9bf['offset']=qs[_0xa41c('0x2c')](_0x4b1446['query'][_0xa41c('0x2c')]);}_0x1dc9bf[_0xa41c('0x61')]=qs[_0xa41c('0x41')](_0x4b1446[_0xa41c('0x39')][_0xa41c('0x41')]);_0x1dc9bf[_0xa41c('0x42')]=qs[_0xa41c('0x3b')](_[_0xa41c('0x43')](_0x4b1446['query'],_0x19c518[_0xa41c('0x3b')]));_0x1dc9bf['where'][_0xa41c('0x5e')]=_0x3c343b['id'];if(_0x4b1446['query']['filter']){_0x1dc9bf['where']=_['merge'](_0x1dc9bf[_0xa41c('0x42')],{'$or':_[_0xa41c('0x44')](_0x1dc9bf[_0xa41c('0x3d')],function(_0x1ad697){var _0x31f749={};_0x31f749[_0x1ad697]={'$like':'%'+_0x4b1446[_0xa41c('0x39')][_0xa41c('0x48')]+'%'};return _0x31f749;})});}_0x1dc9bf=_['merge']({},_0x1dc9bf,_0x4b1446[_0xa41c('0x4a')]);return db[_0xa41c('0x5f')][_0xa41c('0x4b')]({'where':_0x1dc9bf['where']})[_0xa41c('0x1e')](function(_0x123a77){_0x411699['count']=_0x123a77;if(_0x4b1446[_0xa41c('0x39')][_0xa41c('0x4c')]){_0x1dc9bf['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1dc9bf);})[_0xa41c('0x1e')](function(_0x4847be){_0x411699[_0xa41c('0x4d')]=_0x4847be;return _0x411699;});}})[_0xa41c('0x1e')](respondWithFilteredResult(_0x2dd9ce,_0x1dc9bf))['catch'](handleError(_0x2dd9ce,null));};exports[_0xa41c('0x62')]=function(_0x511710,_0x4ff68f,_0x3e9472){var _0x5c9bbc;return db['FaxAccount']['find']({'where':{'id':_0x511710['params']['id']}})[_0xa41c('0x1e')](handleEntityNotFound(_0x4ff68f,null))[_0xa41c('0x1e')](function(_0x531e7c){if(_0x531e7c){return _0x531e7c[_0xa41c('0x62')](_0x511710[_0xa41c('0x39')]['ids']);}})[_0xa41c('0x1e')](respondWithStatusCode(_0x4ff68f,null))[_0xa41c('0x28')](handleError(_0x4ff68f,null));};exports[_0xa41c('0x63')]=function(_0x2d9757,_0x4a6b2b,_0x170012){if(_0x2d9757['body']['id']){delete _0x2d9757['body']['id'];}return db[_0xa41c('0x37')][_0xa41c('0x59')]({'where':{'id':_0x2d9757[_0xa41c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4a6b2b,null))[_0xa41c('0x1e')](function(_0x5f3038){if(_0x5f3038){_0x2d9757[_0xa41c('0x54')][_0xa41c('0x5e')]=_0x5f3038['id'];return db['CannedAnswer']['create'](_0x2d9757['body']);}})[_0xa41c('0x1e')](respondWithResult(_0x4a6b2b,null))[_0xa41c('0x28')](handleError(_0x4a6b2b,null));};exports['getAnswers']=function(_0xf54477,_0x41c1be,_0x3e0487){var _0x245126={'raw':![],'where':{}};var _0x5c8cc1={};var _0x192eb5={'count':0x0,'rows':[]};return db[_0xa41c('0x37')]['findOne']({'where':{'id':_0xf54477[_0xa41c('0x4f')]['id']}})[_0xa41c('0x1e')](handleEntityNotFound(_0x41c1be,null))[_0xa41c('0x1e')](function(_0x597b21){if(_0x597b21){_0x5c8cc1[_0xa41c('0x38')]=_['keys'](db[_0xa41c('0x64')][_0xa41c('0x51')]);_0x5c8cc1[_0xa41c('0x39')]=_[_0xa41c('0x3a')](_0xf54477[_0xa41c('0x39')]);_0x5c8cc1[_0xa41c('0x3b')]=_[_0xa41c('0x3c')](_0x5c8cc1[_0xa41c('0x38')],_0x5c8cc1[_0xa41c('0x39')]);_0x245126[_0xa41c('0x3d')]=_[_0xa41c('0x3c')](_0x5c8cc1[_0xa41c('0x38')],qs['fields'](_0xf54477['query'][_0xa41c('0x3e')]));_0x245126[_0xa41c('0x3d')]=_0x245126[_0xa41c('0x3d')][_0xa41c('0x52')]?_0x245126['attributes']:_0x5c8cc1[_0xa41c('0x38')];if(!_0xf54477[_0xa41c('0x39')][_0xa41c('0x3f')](_0xa41c('0x40'))){_0x245126[_0xa41c('0x2d')]=qs[_0xa41c('0x2d')](_0xf54477[_0xa41c('0x39')]['limit']);_0x245126[_0xa41c('0x2c')]=qs['offset'](_0xf54477['query'][_0xa41c('0x2c')]);}_0x245126['order']=qs[_0xa41c('0x41')](_0xf54477[_0xa41c('0x39')][_0xa41c('0x41')]);_0x245126[_0xa41c('0x42')]=qs[_0xa41c('0x3b')](_[_0xa41c('0x43')](_0xf54477[_0xa41c('0x39')],_0x5c8cc1[_0xa41c('0x3b')]));_0x245126[_0xa41c('0x42')][_0xa41c('0x5e')]=_0x597b21['id'];if(_0xf54477[_0xa41c('0x39')][_0xa41c('0x48')]){_0x245126['where']=_['merge'](_0x245126[_0xa41c('0x42')],{'$or':_['map'](_0x245126[_0xa41c('0x3d')],function(_0xa7419d){var _0x5334de={};_0x5334de[_0xa7419d]={'$like':'%'+_0xf54477[_0xa41c('0x39')][_0xa41c('0x48')]+'%'};return _0x5334de;})});}_0x245126=_[_0xa41c('0x49')]({},_0x245126,_0xf54477[_0xa41c('0x4a')]);return db[_0xa41c('0x64')][_0xa41c('0x4b')]({'where':_0x245126[_0xa41c('0x42')]})[_0xa41c('0x1e')](function(_0x51e012){_0x192eb5['count']=_0x51e012;if(_0xf54477[_0xa41c('0x39')][_0xa41c('0x4c')]){_0x245126[_0xa41c('0x65')]=[{'all':!![]}];}return db[_0xa41c('0x64')][_0xa41c('0x66')](_0x245126);})[_0xa41c('0x1e')](function(_0x1ce527){_0x192eb5[_0xa41c('0x4d')]=_0x1ce527;return _0x192eb5;});}})[_0xa41c('0x1e')](respondWithFilteredResult(_0x41c1be,_0x245126))[_0xa41c('0x28')](handleError(_0x41c1be,null));};exports[_0xa41c('0x67')]=function(_0x964860,_0x5a46d0,_0x5d4923){var _0x2697cd;return db['FaxAccount'][_0xa41c('0x59')]({'where':{'id':_0x964860[_0xa41c('0x4f')]['id']}})[_0xa41c('0x1e')](handleEntityNotFound(_0x5a46d0,null))[_0xa41c('0x1e')](function(_0x1bcc92){if(_0x1bcc92){return _0x1bcc92[_0xa41c('0x67')](_0x964860[_0xa41c('0x39')][_0xa41c('0x68')]);}})[_0xa41c('0x1e')](respondWithStatusCode(_0x5a46d0,null))[_0xa41c('0x28')](handleError(_0x5a46d0,null));};exports[_0xa41c('0x69')]=function(_0x433e2b,_0x583ccf,_0x4c7629){return db[_0xa41c('0x6a')][_0xa41c('0x59')]({'where':{'id':_0x433e2b[_0xa41c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x583ccf,null))[_0xa41c('0x1e')](function(_0x2fab0c){if(_0x2fab0c){return _0x2fab0c[_0xa41c('0x69')](_0x433e2b[_0xa41c('0x54')]['ids'],_['omit'](_0x433e2b[_0xa41c('0x54')],[_0xa41c('0x68'),'id'])||{});}})[_0xa41c('0x1e')](respondWithResult(_0x583ccf,null))[_0xa41c('0x28')](handleError(_0x583ccf,null));};exports[_0xa41c('0x6b')]=function(_0x5cb5a8,_0x4f5e8b,_0x4f9fcd){var _0x533d37={'raw':![],'where':{}};var _0x33c528={};var _0x56f012={'count':0x0,'rows':[]};return db[_0xa41c('0x37')]['findOne']({'where':{'id':_0x5cb5a8[_0xa41c('0x4f')]['id']}})[_0xa41c('0x1e')](handleEntityNotFound(_0x4f5e8b,null))[_0xa41c('0x1e')](function(_0x47d22b){if(_0x47d22b){_0x33c528[_0xa41c('0x38')]=_[_0xa41c('0x3a')](db[_0xa41c('0x6a')][_0xa41c('0x51')]);_0x33c528[_0xa41c('0x39')]=_[_0xa41c('0x3a')](_0x5cb5a8[_0xa41c('0x39')]);_0x33c528[_0xa41c('0x3b')]=_[_0xa41c('0x3c')](_0x33c528['model'],_0x33c528[_0xa41c('0x39')]);_0x533d37['attributes']=_[_0xa41c('0x3c')](_0x33c528[_0xa41c('0x38')],qs[_0xa41c('0x3e')](_0x5cb5a8[_0xa41c('0x39')][_0xa41c('0x3e')]));_0x533d37['attributes']=_0x533d37[_0xa41c('0x3d')][_0xa41c('0x52')]?_0x533d37[_0xa41c('0x3d')]:_0x33c528[_0xa41c('0x38')];if(!_0x5cb5a8[_0xa41c('0x39')][_0xa41c('0x3f')](_0xa41c('0x40'))){_0x533d37[_0xa41c('0x2d')]=qs[_0xa41c('0x2d')](_0x5cb5a8[_0xa41c('0x39')][_0xa41c('0x2d')]);_0x533d37['offset']=qs[_0xa41c('0x2c')](_0x5cb5a8[_0xa41c('0x39')][_0xa41c('0x2c')]);}_0x533d37[_0xa41c('0x61')]=qs[_0xa41c('0x41')](_0x5cb5a8[_0xa41c('0x39')][_0xa41c('0x41')]);_0x533d37['where']=qs['filters'](_['pick'](_0x5cb5a8['query'],_0x33c528[_0xa41c('0x3b')]));_0x533d37[_0xa41c('0x42')][_0xa41c('0x5e')]=_0x47d22b['id'];if(_0x5cb5a8[_0xa41c('0x39')]['filter']){_0x533d37[_0xa41c('0x42')]=_[_0xa41c('0x49')](_0x533d37[_0xa41c('0x42')],{'$or':_[_0xa41c('0x44')](_0x533d37[_0xa41c('0x3d')],function(_0x28cc3c){var _0x3bf574={};_0x3bf574[_0x28cc3c]={'$like':'%'+_0x5cb5a8[_0xa41c('0x39')][_0xa41c('0x48')]+'%'};return _0x3bf574;})});}_0x533d37=_['merge']({},_0x533d37,_0x5cb5a8[_0xa41c('0x4a')]);return db[_0xa41c('0x6a')][_0xa41c('0x4b')]({'where':_0x533d37['where']})[_0xa41c('0x1e')](function(_0x502f5e){_0x56f012[_0xa41c('0x4b')]=_0x502f5e;if(_0x5cb5a8[_0xa41c('0x39')][_0xa41c('0x4c')]){_0x533d37[_0xa41c('0x65')]=[{'model':db[_0xa41c('0x6c')],'as':'Contact','required':![]},{'model':db[_0xa41c('0x6d')],'as':_0xa41c('0x6e'),'attributes':[_0xa41c('0x35'),_0xa41c('0x6f'),_0xa41c('0x70')],'required':![]},{'model':db['Tag'],'as':_0xa41c('0x71'),'attributes':['id','name',_0xa41c('0x72')],'where':_0x5cb5a8['query']['tag']?{'id':_0x5cb5a8[_0xa41c('0x39')]['tag']}:undefined,'required':_0x5cb5a8[_0xa41c('0x39')][_0xa41c('0x73')]?!![]:![]}];}return db[_0xa41c('0x6a')][_0xa41c('0x66')](_0x533d37);})['then'](function(_0x1a209d){_0x56f012[_0xa41c('0x4d')]=_0x1a209d;return _0x56f012;});}})[_0xa41c('0x1e')](respondWithFilteredResult(_0x4f5e8b,_0x533d37))[_0xa41c('0x28')](handleError(_0x4f5e8b,null));};exports[_0xa41c('0x74')]=function(_0x2a4a7f,_0x205f18,_0x8cf131){return db[_0xa41c('0x37')][_0xa41c('0x75')]({'where':{'id':_0x2a4a7f[_0xa41c('0x4f')]['id']}})[_0xa41c('0x1e')](handleEntityNotFound(_0x205f18,null))['then'](function(_0x339245){if(_0x339245){return db[_0xa41c('0x76')][_0xa41c('0x77')](function(_0xf5b176){return db[_0xa41c('0x78')][_0xa41c('0x32')]({'where':{'FaxAccountId':_0x2a4a7f[_0xa41c('0x4f')]['id']},'transaction':_0xf5b176})[_0xa41c('0x1e')](function(_0x328a55){var _0x4c0719=_['map'](_0x2a4a7f['body'],function(_0x153bde){_0x153bde['FaxAccountId']=_0x2a4a7f[_0xa41c('0x4f')]['id'];return _0x153bde;});return db[_0xa41c('0x78')][_0xa41c('0x79')](_0x4c0719,{'transaction':_0xf5b176});});})['then'](function(){return db['FaxApplication'][_0xa41c('0x7a')]({'where':{'FaxAccountId':_0x2a4a7f[_0xa41c('0x4f')]['id']},'order':'priority'});});}})[_0xa41c('0x1e')](respondWithResult(_0x205f18,null))[_0xa41c('0x28')](handleError(_0x205f18,null));};exports[_0xa41c('0x7b')]=function(_0x7669b9,_0x108f9e,_0x144178){var _0x15a810={};var _0x5bcb40={};var _0x4d0a27;var _0x23a0fa;return db['FaxAccount'][_0xa41c('0x75')]({'where':{'id':_0x7669b9[_0xa41c('0x4f')]['id']}})[_0xa41c('0x1e')](handleEntityNotFound(_0x108f9e,null))[_0xa41c('0x1e')](function(_0x258c50){if(_0x258c50){_0x4d0a27=_0x258c50;_0x5bcb40[_0xa41c('0x38')]=_[_0xa41c('0x3a')](db[_0xa41c('0x78')][_0xa41c('0x51')]);_0x5bcb40[_0xa41c('0x39')]=_[_0xa41c('0x3a')](_0x7669b9[_0xa41c('0x39')]);_0x5bcb40[_0xa41c('0x3b')]=_['intersection'](_0x5bcb40['model'],_0x5bcb40['query']);_0x15a810[_0xa41c('0x3d')]=_[_0xa41c('0x3c')](_0x5bcb40[_0xa41c('0x38')],qs[_0xa41c('0x3e')](_0x7669b9[_0xa41c('0x39')][_0xa41c('0x3e')]));_0x15a810[_0xa41c('0x3d')]=_0x15a810[_0xa41c('0x3d')]['length']?_0x15a810[_0xa41c('0x3d')]:_0x5bcb40[_0xa41c('0x38')];_0x15a810[_0xa41c('0x61')]=qs[_0xa41c('0x41')](_0x7669b9[_0xa41c('0x39')][_0xa41c('0x41')]);_0x15a810[_0xa41c('0x42')]=qs[_0xa41c('0x3b')](_[_0xa41c('0x43')](_0x7669b9[_0xa41c('0x39')],_0x5bcb40[_0xa41c('0x3b')]));if(_0x7669b9['query'][_0xa41c('0x48')]){_0x15a810[_0xa41c('0x42')]=_[_0xa41c('0x49')](_0x15a810['where'],{'$or':_[_0xa41c('0x44')](_0x15a810[_0xa41c('0x3d')],function(_0x10c67c){var _0x302149={};_0x302149[_0x10c67c]={'$like':'%'+_0x7669b9['query'][_0xa41c('0x48')]+'%'};return _0x302149;})});}_0x15a810=_[_0xa41c('0x49')]({},_0x15a810,_0x7669b9[_0xa41c('0x4a')]);return _0x4d0a27[_0xa41c('0x7b')](_0x15a810);}})['then'](function(_0x5d6ac8){if(_0x5d6ac8){_0x23a0fa=_0x5d6ac8[_0xa41c('0x52')];if(!_0x7669b9[_0xa41c('0x39')][_0xa41c('0x3f')](_0xa41c('0x40'))){_0x15a810[_0xa41c('0x2d')]=qs['limit'](_0x7669b9[_0xa41c('0x39')][_0xa41c('0x2d')]);_0x15a810['offset']=qs[_0xa41c('0x2c')](_0x7669b9['query'][_0xa41c('0x2c')]);}return _0x4d0a27[_0xa41c('0x7b')](_0x15a810);}})[_0xa41c('0x1e')](function(_0x30f72a){if(_0x30f72a){return _0x30f72a?{'count':_0x23a0fa,'rows':_0x30f72a}:null;}})[_0xa41c('0x1e')](respondWithResult(_0x108f9e,null))[_0xa41c('0x28')](handleError(_0x108f9e,null));};function Extension(_0x2f1150,_0x6c5a75,_0x3fe32c,_0x10fda8){this[_0xa41c('0x7c')]=_0xa41c('0x7d');this[_0xa41c('0x7e')]=_0x2f1150['localstationid'];this[_0xa41c('0x7f')]=_0x10fda8;this[_0xa41c('0x45')]=_0xa41c('0x80');this[_0xa41c('0x81')]='Fax\x20Extension';this[_0xa41c('0x5e')]=_0x2f1150['id'];this[_0xa41c('0x82')]=_0x6c5a75;this[_0xa41c('0x83')]=_0x3fe32c;}function createExtensionsReciveFax(_0x4c67ca){var _0x183ee2=0x1;var _0x5d7ae6=[];_0x5d7ae6[_0xa41c('0x84')](new Extension(_0x4c67ca,_0x183ee2,'','Answer'));_0x183ee2+=0x1;_0x5d7ae6[_0xa41c('0x84')](new Extension(_0x4c67ca,_0x183ee2,'CDR(type)=inbound-fax',_0xa41c('0x85')));_0x183ee2+=0x1;for(var _0x824129 in _0x4c67ca){if(_0x4c67ca['hasOwnProperty'](_0x824129)&&(_0x824129===_0xa41c('0x86')||_0x824129===_0xa41c('0x87')||_0x824129===_0xa41c('0x88')||_0x824129==='faxdetect'||_0x824129===_0xa41c('0x89')||_0x824129===_0xa41c('0x8a')||_0x824129===_0xa41c('0x8b')||_0x824129==='modem'||_0x824129===_0xa41c('0x8c'))){_0x5d7ae6[_0xa41c('0x84')](new Extension(_0x4c67ca,_0x183ee2,_0xa41c('0x8d')+_0x824129+')='+_0x4c67ca[_0x824129],_0xa41c('0x85')));_0x183ee2+=0x1;}}_0x5d7ae6[_0xa41c('0x84')](new Extension(_0x4c67ca,_0x183ee2,'6','Wait'));_0x183ee2+=0x1;_0x5d7ae6['push'](new Extension(_0x4c67ca,_0x183ee2,_0xa41c('0x8e'),_0xa41c('0x8f')));_0x183ee2=0x0;return _0x5d7ae6;}exports[_0xa41c('0x90')]=function(_0x21591e,_0x195299,_0x2446de){var _0x2252c8;return db[_0xa41c('0x76')]['transaction'](function(_0x11abd7){return db['FaxAccount'][_0xa41c('0x53')](_0x21591e[_0xa41c('0x54')],{'transaction':_0x11abd7})[_0xa41c('0x1e')](function(_0x2dba4e){_0x2252c8=_0x2dba4e['get']({'plain':!![]});return db[_0xa41c('0x91')][_0xa41c('0x79')](createExtensionsReciveFax(_0x2252c8),{'transaction':_0x11abd7});});})['then'](function(){return _0x2252c8;})[_0xa41c('0x1e')](respondWithResult(_0x195299,null))['catch'](handleError(_0x195299,null));};exports[_0xa41c('0x92')]=function(_0x513023,_0x44b7ed,_0x260147){var _0x379282;return db[_0xa41c('0x76')]['transaction'](function(_0x3baea3){return db['FaxAccount'][_0xa41c('0x31')](_0x513023['body'],{'where':{'id':_0x513023[_0xa41c('0x54')]['id']},'transaction':_0x3baea3})[_0xa41c('0x1e')](function(_0x461b8f){return db[_0xa41c('0x91')][_0xa41c('0x32')]({'where':{'FaxAccountId':_0x513023[_0xa41c('0x54')]['id']},'transaction':_0x3baea3})['then'](function(_0xe78071){return db['VoiceExtension'][_0xa41c('0x79')](createExtensionsReciveFax(_['omit'](_0x513023[_0xa41c('0x54')],['tech',_0xa41c('0x46'),_0xa41c('0x93'),_0xa41c('0x94'),_0xa41c('0x95'),_0xa41c('0x96')])),{'transaction':_0x3baea3});});});})[_0xa41c('0x1e')](function(){return db[_0xa41c('0x37')][_0xa41c('0x97')](_0x513023[_0xa41c('0x54')]['id']);})[_0xa41c('0x1e')](respondWithResult(_0x44b7ed,null))['catch'](handleError(_0x44b7ed,null));};exports[_0xa41c('0x98')]=function(_0x39343c,_0x5e280e,_0x5a675b){var _0x2cd620={'raw':!![],'where':{}};var _0x5d33a3={};var _0x558420={'count':0x0,'rows':[]};return db[_0xa41c('0x37')][_0xa41c('0x75')]({'where':{'id':_0x39343c['params']['id']}})[_0xa41c('0x1e')](handleEntityNotFound(_0x5e280e,null))[_0xa41c('0x1e')](function(_0x45e07b){if(_0x45e07b){_0x5d33a3[_0xa41c('0x38')]=_[_0xa41c('0x3a')](db[_0xa41c('0x99')][_0xa41c('0x51')]);_0x5d33a3[_0xa41c('0x39')]=_[_0xa41c('0x3a')](_0x39343c[_0xa41c('0x39')]);_0x5d33a3[_0xa41c('0x3b')]=_[_0xa41c('0x3c')](_0x5d33a3[_0xa41c('0x38')],_0x5d33a3[_0xa41c('0x39')]);_0x2cd620[_0xa41c('0x3d')]=_[_0xa41c('0x3c')](_0x5d33a3[_0xa41c('0x38')],qs['fields'](_0x39343c[_0xa41c('0x39')][_0xa41c('0x3e')]));_0x2cd620[_0xa41c('0x3d')]=_0x2cd620['attributes'][_0xa41c('0x52')]?_0x2cd620[_0xa41c('0x3d')]:_0x5d33a3['model'];if(!_0x39343c[_0xa41c('0x39')][_0xa41c('0x3f')](_0xa41c('0x40'))){_0x2cd620[_0xa41c('0x2d')]=qs['limit'](_0x39343c[_0xa41c('0x39')]['limit']);_0x2cd620['offset']=qs['offset'](_0x39343c[_0xa41c('0x39')][_0xa41c('0x2c')]);}_0x2cd620[_0xa41c('0x61')]=qs[_0xa41c('0x41')](_0x39343c['query'][_0xa41c('0x41')]);_0x2cd620[_0xa41c('0x42')]=qs[_0xa41c('0x3b')](_[_0xa41c('0x43')](_0x39343c['query'],_0x5d33a3[_0xa41c('0x3b')]));_0x2cd620['where'][_0xa41c('0x5e')]=_0x45e07b['id'];if(_0x39343c[_0xa41c('0x39')][_0xa41c('0x48')]){_0x2cd620[_0xa41c('0x42')]=_[_0xa41c('0x49')](_0x2cd620[_0xa41c('0x42')],{'$or':_[_0xa41c('0x44')](_0x2cd620['attributes'],function(_0x1762f8){var _0x515518={};_0x515518[_0x1762f8]={'$like':'%'+_0x39343c[_0xa41c('0x39')]['filter']+'%'};return _0x515518;})});}if(_0x39343c[_0xa41c('0x39')][_0xa41c('0x9a')]){var _0x2cf0ff=_0x39343c[_0xa41c('0x39')][_0xa41c('0x9a')][_0xa41c('0x9b')](',');var _0x47f981={};_0x47f981[_0x2cf0ff[0x0]]={'$gte':moment(_0x2cf0ff[0x1])[_0xa41c('0x9c')](_0xa41c('0x9d'))};_0x2cd620['where']=_['merge'](_0x2cd620[_0xa41c('0x42')],_0x47f981);}_0x2cd620=_[_0xa41c('0x49')]({},_0x2cd620,_0x39343c['options']);return db[_0xa41c('0x99')][_0xa41c('0x4b')]({'where':_0x2cd620[_0xa41c('0x42')]})[_0xa41c('0x1e')](function(_0x215344){_0x558420[_0xa41c('0x4b')]=_0x215344;if(_0x39343c[_0xa41c('0x39')][_0xa41c('0x4c')]){_0x2cd620[_0xa41c('0x65')]=[{'all':!![]}];}return db[_0xa41c('0x99')][_0xa41c('0x66')](_0x2cd620);})['then'](function(_0x4d1cb0){_0x558420[_0xa41c('0x4d')]=_0x4d1cb0;return _0x558420;});}})[_0xa41c('0x1e')](respondWithFilteredResult(_0x5e280e,_0x2cd620))[_0xa41c('0x28')](handleError(_0x5e280e,null));};exports[_0xa41c('0x9e')]=function(_0x4cb6ec,_0x389804,_0x1918db){var _0x55e8e4,_0x11be5e={},_0x1252f6;if(_0x4cb6ec[_0xa41c('0x54')]['to']){_0x1252f6=_0x4cb6ec[_0xa41c('0x54')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x4cb6ec[_0xa41c('0x4f')]['id']},'include':[{'model':db[_0xa41c('0x9f')],'as':_0xa41c('0xa0'),'include':[{'model':db[_0xa41c('0x6c')],'as':_0xa41c('0xa1'),'where':{'fax':_0x1252f6},'limit':0x1,'order':[[_0xa41c('0x94'),_0xa41c('0xa2')]]}]}]})[_0xa41c('0x1e')](handleEntityNotFound(_0x389804,null))[_0xa41c('0x1e')](function(_0x5edf05){_0x55e8e4=_0x5edf05;if(_0x4cb6ec[_0xa41c('0x54')]['attachments']&&_0x4cb6ec['body'][_0xa41c('0xa3')][_0xa41c('0x52')]){for(var _0x441a50=0x0;_0x441a50<_0x4cb6ec[_0xa41c('0x54')]['attachments']['length'];_0x441a50+=0x1){_0x4cb6ec[_0xa41c('0x54')][_0xa41c('0xa3')][_0x441a50]={'filename':_0x4cb6ec[_0xa41c('0x54')][_0xa41c('0xa3')][_0x441a50][_0xa41c('0x35')],'id':_0x4cb6ec[_0xa41c('0x54')]['attachments'][_0x441a50]['id'],'path':path[_0xa41c('0xa4')](config[_0xa41c('0xa5')],'server/files/attachments',_0x4cb6ec[_0xa41c('0x54')][_0xa41c('0xa3')][_0x441a50]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0xa41c('0xa6'),{'FaxAccountId':_[_0xa41c('0xa7')](_0x4cb6ec[_0xa41c('0x4f')]['id'])?undefined:_0x4cb6ec[_0xa41c('0x4f')]['id'],'path':_[_0xa41c('0xa7')](_0x4cb6ec[_0xa41c('0x54')][_0xa41c('0xa3')][0x0][_0xa41c('0x8')])?undefined:_0x4cb6ec[_0xa41c('0x54')]['attachments'][0x0]['path'],'fax':_[_0xa41c('0xa7')](_0x4cb6ec[_0xa41c('0x54')]['to'][0x0])?undefined:_0x4cb6ec['body']['to'][0x0]},client9002);})[_0xa41c('0x1e')](function(){if(_0x55e8e4){if(_[_0xa41c('0xa7')](_0x4cb6ec['body'][_0xa41c('0xa8')])){_0x4cb6ec['body'][_0xa41c('0xa8')]=util['format']('\x22%s\x22\x20<%s>',_0x55e8e4[_0xa41c('0x35')],_0x55e8e4[_0xa41c('0xa9')]);}if(_0x55e8e4[_0xa41c('0xa0')]){if(_0x55e8e4[_0xa41c('0xa0')][_0xa41c('0xa1')]['length']){return _0x55e8e4[_0xa41c('0xa0')]['Contacts'][0x0];}else{return db[_0xa41c('0x6c')][_0xa41c('0x53')](_[_0xa41c('0x16')](_0x4cb6ec[_0xa41c('0x54')],{'firstName':_0x4cb6ec[_0xa41c('0x54')]['to'][0x0],'phone':_0x4cb6ec[_0xa41c('0x54')]['to'][0x0],'fax':_0x4cb6ec[_0xa41c('0x54')]['to'][0x0],'ListId':_0x55e8e4[_0xa41c('0x96')]}));}}else{throw new Error(_0xa41c('0xaa'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xa41c('0x1e')](function(_0x1a579d){if(_0x1a579d){return db['FaxInteraction'][_0xa41c('0x59')]({'where':{'ContactId':_0x1a579d['id'],'closed':![],'FaxAccountId':_0x55e8e4['id']}})[_0xa41c('0x1e')](function(_0xce39f9){if(_0xce39f9){return[_0xce39f9,![]];}return db['FaxInteraction'][_0xa41c('0x53')]({'UserId':_0x4cb6ec[_0xa41c('0x55')]['id'],'ContactId':_0x1a579d['id'],'FaxAccountId':_0x55e8e4['id'],'fax':_0x4cb6ec[_0xa41c('0x54')]['to'][0x0],'firstMsgDirection':_0xa41c('0xab'),'Messages':[_[_0xa41c('0x49')](_0x4cb6ec['body'],{'read':![],'body':_0x4cb6ec['body'][_0xa41c('0xa3')][0x0]['filename'],'FaxAccountId':_0x55e8e4['id'],'UserId':_0x4cb6ec[_0xa41c('0x55')]['id'],'ContactId':_0x1a579d['id'],'AttachmentId':_0x4cb6ec[_0xa41c('0x54')][_0xa41c('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0xa41c('0x99')],'as':_0xa41c('0xac')}]})['then'](function(_0x48a2dd){return[_0x48a2dd,!![]];});});}else{throw new Error(_0xa41c('0xad'));}})[_0xa41c('0xae')](function(_0x3d8457,_0x4a98ed){if(_0x4a98ed){return _0x3d8457;}return db[_0xa41c('0x99')]['create']({'direction':'out','read':![],'body':_0x4cb6ec[_0xa41c('0x54')]['attachments'][0x0][_0xa41c('0xaf')],'FaxAccountId':_0x55e8e4['id'],'FaxInteractionId':_0x3d8457['id'],'UserId':_0x4cb6ec[_0xa41c('0x55')]['id'],'ContactId':_0x3d8457[_0xa41c('0xb0')],'AttachmentId':_0x4cb6ec['body'][_0xa41c('0xa3')][0x0]['id']})[_0xa41c('0x1e')](function(_0x5e2b44){_0x3d8457[_0xa41c('0xb1')]['Messages']=[];_0x3d8457[_0xa41c('0xb1')][_0xa41c('0xac')][_0xa41c('0x84')](_0x5e2b44[_0xa41c('0xb1')]);return _0x3d8457;});})['then'](function(_0x281d5e){respondWithRpcPromise(_0xa41c('0xb2'),_0xa41c('0xb2'),{'FaxAccountId':_['isNil'](_0x4cb6ec[_0xa41c('0x4f')]['id'])?undefined:_0x4cb6ec[_0xa41c('0x4f')]['id'],'path':_[_0xa41c('0xa7')](_0x4cb6ec[_0xa41c('0x54')][_0xa41c('0xa3')][0x0]['path'])?undefined:_0x4cb6ec[_0xa41c('0x54')][_0xa41c('0xa3')][0x0][_0xa41c('0x8')],'fax':_[_0xa41c('0xa7')](_0x4cb6ec[_0xa41c('0x54')]['to'][0x0])?undefined:_0x4cb6ec[_0xa41c('0x54')]['to'][0x0],'AttachmentId':_0x4cb6ec[_0xa41c('0x54')][_0xa41c('0xa3')][0x0]['id']},client9002)[_0xa41c('0x1e')](function(_0x5d0673){logger[_0xa41c('0x1f')](_0xa41c('0xb3'),_0x5d0673);})[_0xa41c('0x28')](function(_0x83dd43){logger['info'](_0xa41c('0xb3'),_0x83dd43);});return _0x281d5e;})[_0xa41c('0x1e')](respondWithResult(_0x389804,null))[_0xa41c('0x28')](handleError(_0x389804,null));};exports[_0xa41c('0xb4')]=function(_0x160e9c,_0x5252e1,_0x1ed01d){return db[_0xa41c('0x37')][_0xa41c('0x59')]({'where':{'id':_0x160e9c[_0xa41c('0x4f')]['id']}})[_0xa41c('0x1e')](handleEntityNotFound(_0x5252e1,null))[_0xa41c('0x1e')](function(_0x2f69e1){if(_0x2f69e1){return _0x2f69e1[_0xa41c('0xb4')](_0x160e9c[_0xa41c('0x54')][_0xa41c('0x68')],_['omit'](_0x160e9c[_0xa41c('0x54')],['ids','id'])||{})[_0xa41c('0xae')](function(_0x42b9d4){for(var _0x5131ec=0x0;_0x5131ec<_0x160e9c[_0xa41c('0x54')]['ids']['length'];_0x5131ec+=0x1){socket[_0xa41c('0xb5')](_0xa41c('0xb6'),{'UserId':_0x160e9c['body'][_0xa41c('0x68')][_0x5131ec],'FaxAccountId':_0x160e9c[_0xa41c('0x4f')]['id']});}return _0x42b9d4;});}})['then'](respondWithResult(_0x5252e1,null))['catch'](handleError(_0x5252e1,null));};exports['removeAgents']=function(_0x330a45,_0xed0523,_0x578796){var _0x430ee2;return db[_0xa41c('0x37')][_0xa41c('0x59')]({'where':{'id':_0x330a45[_0xa41c('0x4f')]['id']}})['then'](handleEntityNotFound(_0xed0523,null))[_0xa41c('0x1e')](function(_0x32e56f){if(_0x32e56f){return _0x32e56f['removeAgents'](_0x330a45[_0xa41c('0x39')][_0xa41c('0x68')])[_0xa41c('0x1e')](function(_0x2eee66){if(_['isArray'](_0x330a45[_0xa41c('0x39')]['ids'])){for(var _0x531284=0x0;_0x531284<_0x330a45[_0xa41c('0x39')][_0xa41c('0x68')][_0xa41c('0x52')];_0x531284+=0x1){socket['emit'](_0xa41c('0xb7'),{'UserId':_0x330a45['query'][_0xa41c('0x68')][_0x531284],'FaxAccountId':_0x330a45['params']['id']});}}else{socket[_0xa41c('0xb5')](_0xa41c('0xb7'),{'UserId':_0x330a45[_0xa41c('0x39')][_0xa41c('0x68')],'FaxAccountId':_0x330a45[_0xa41c('0x4f')]['id']});}});}})[_0xa41c('0x1e')](respondWithStatusCode(_0xed0523,null))[_0xa41c('0x28')](handleError(_0xed0523,null));};exports['getAgents']=function(_0x3fded4,_0x3a4a42,_0x171f67){var _0x2504ad={};var _0x3b91bd={};var _0x464da4;var _0x371ab0;return db['FaxAccount'][_0xa41c('0x75')]({'where':{'id':_0x3fded4['params']['id']}})[_0xa41c('0x1e')](handleEntityNotFound(_0x3a4a42,null))[_0xa41c('0x1e')](function(_0x1922b7){if(_0x1922b7){_0x464da4=_0x1922b7;_0x3b91bd[_0xa41c('0x38')]=_[_0xa41c('0x3a')](db[_0xa41c('0x6d')][_0xa41c('0x51')]);_0x3b91bd[_0xa41c('0x39')]=_[_0xa41c('0x3a')](_0x3fded4['query']);_0x3b91bd['filters']=_['intersection'](_0x3b91bd[_0xa41c('0x38')],_0x3b91bd[_0xa41c('0x39')]);_0x2504ad[_0xa41c('0x3d')]=_[_0xa41c('0x3c')](_0x3b91bd[_0xa41c('0x38')],qs['fields'](_0x3fded4[_0xa41c('0x39')]['fields']));_0x2504ad[_0xa41c('0x3d')]=_0x2504ad[_0xa41c('0x3d')][_0xa41c('0x52')]?_0x2504ad[_0xa41c('0x3d')]:_0x3b91bd[_0xa41c('0x38')];_0x2504ad[_0xa41c('0x61')]=qs['sort'](_0x3fded4['query'][_0xa41c('0x41')]);_0x2504ad['where']=qs['filters'](_[_0xa41c('0x43')](_0x3fded4[_0xa41c('0x39')],_0x3b91bd['filters']));if(_0x3fded4[_0xa41c('0x39')]['filter']){_0x2504ad[_0xa41c('0x42')]=_['merge'](_0x2504ad[_0xa41c('0x42')],{'$or':_[_0xa41c('0x44')](_0x2504ad[_0xa41c('0x3d')],function(_0x470572){var _0x5ce1c1={};_0x5ce1c1[_0x470572]={'$like':'%'+_0x3fded4[_0xa41c('0x39')][_0xa41c('0x48')]+'%'};return _0x5ce1c1;})});}_0x2504ad=_['merge']({},_0x2504ad,_0x3fded4['options']);return _0x464da4[_0xa41c('0xb8')](_0x2504ad);}})[_0xa41c('0x1e')](function(_0x1175a8){if(_0x1175a8){_0x371ab0=_0x1175a8[_0xa41c('0x52')];if(!_0x3fded4[_0xa41c('0x39')][_0xa41c('0x3f')](_0xa41c('0x40'))){_0x2504ad['limit']=qs[_0xa41c('0x2d')](_0x3fded4['query']['limit']);_0x2504ad['offset']=qs['offset'](_0x3fded4['query'][_0xa41c('0x2c')]);}return _0x464da4[_0xa41c('0xb8')](_0x2504ad);}})[_0xa41c('0x1e')](function(_0x191394){if(_0x191394){return _0x191394?{'count':_0x371ab0,'rows':_0x191394}:null;}})['then'](respondWithResult(_0x3a4a42,null))[_0xa41c('0x28')](handleError(_0x3a4a42,null));}; \ No newline at end of file +var _0x8081=['result','catch','status','end','json','count','offset','limit','set','apply','reject','save','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','model','filters','intersection','query','attributes','fields','length','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','include','findAll','rows','show','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxAccounts','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','FaxAccountId','findOne','Disposition','hasOwnProperty','order','removeDispositions','ids','CannedAnswer','getAnswers','nolimit','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','localstationid','app','type','system','description','appdata','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','Messages','Contact\x20not\x20found','spread','out','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','register','http','client','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0x8081,0x9e));var _0x1808=function(_0x248fca,_0x59f525){_0x248fca=_0x248fca-0x0;var _0x5cb139=_0x8081[_0x248fca];return _0x5cb139;};'use strict';var pdf=require(_0x1808('0x0'));var emlformat=require(_0x1808('0x1'));var rimraf=require(_0x1808('0x2'));var zipdir=require(_0x1808('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1808('0x4'));var BPromise=require(_0x1808('0x5'));var Mustache=require(_0x1808('0x6'));var util=require(_0x1808('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1808('0x8'));var ejs=require(_0x1808('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1808('0xa'));var crypto=require(_0x1808('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1808('0xc'));var toCsv=require(_0x1808('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x1808('0xd'));var hardwareService=require(_0x1808('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0x1808('0xf'));var config=require(_0x1808('0x10'));var db=require(_0x1808('0x11'))['db'];config['redis']=_[_0x1808('0x12')](config[_0x1808('0x13')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1808('0x13')]));require('./faxAccount.socket')[_0x1808('0x14')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x1808('0x15')]({'port':0x232c});var client9002=jayson[_0x1808('0x16')][_0x1808('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x4653e2,_0x25316d,_0x18be30,_0x30ba71){return new BPromise(function(_0x1e201b,_0x407f4d){var _0x27618c=_0x30ba71||client;return _0x27618c['request'](_0x4653e2,_0x18be30)[_0x1808('0x17')](function(_0x41ba8e){logger[_0x1808('0x18')](_0x1808('0x19'),_0x25316d,'request\x20sent');logger[_0x1808('0x1a')](_0x1808('0x1b'),_0x25316d,_0x1808('0x1c'),JSON['stringify'](_0x41ba8e));if(_0x41ba8e[_0x1808('0x1d')]){if(_0x41ba8e[_0x1808('0x1d')]['code']===0x1f4){logger['error'](_0x1808('0x19'),_0x25316d,_0x41ba8e['error']['message']);return _0x407f4d(_0x41ba8e['error'][_0x1808('0x1e')]);}logger[_0x1808('0x1d')](_0x1808('0x19'),_0x25316d,_0x41ba8e[_0x1808('0x1d')][_0x1808('0x1e')]);return _0x1e201b(_0x41ba8e[_0x1808('0x1d')][_0x1808('0x1e')]);}else{logger[_0x1808('0x18')](_0x1808('0x19'),_0x25316d,_0x1808('0x1c'));_0x1e201b(_0x41ba8e[_0x1808('0x1f')][_0x1808('0x1e')]);}})[_0x1808('0x20')](function(_0x51ec08){logger[_0x1808('0x1d')]('FaxAccount,\x20%s,\x20%s',_0x25316d,_0x51ec08);_0x407f4d(_0x51ec08);});});}function respondWithStatusCode(_0x50a694,_0x496898){_0x496898=_0x496898||0xcc;return function(_0x1a5685){if(_0x1a5685){return _0x50a694['sendStatus'](_0x496898);}return _0x50a694[_0x1808('0x21')](_0x496898)[_0x1808('0x22')]();};}function respondWithResult(_0x53a3fa,_0x512bbb){_0x512bbb=_0x512bbb||0xc8;return function(_0x495252){if(_0x495252){return _0x53a3fa[_0x1808('0x21')](_0x512bbb)[_0x1808('0x23')](_0x495252);}};}function respondWithFilteredResult(_0x48e5fb,_0x3f4a5f){return function(_0x43299e){if(_0x43299e){var _0x2adda7=_0x43299e[_0x1808('0x24')],_0x28e595=_0x3f4a5f[_0x1808('0x25')],_0x5e5e81=_0x3f4a5f[_0x1808('0x25')]+_0x3f4a5f[_0x1808('0x26')],_0x5495fe;if(_0x5e5e81>=_0x2adda7){_0x5e5e81=_0x2adda7;_0x5495fe=0xc8;}else{_0x5495fe=0xce;}_0x48e5fb['status'](_0x5495fe);return _0x48e5fb[_0x1808('0x27')]('Content-Range',_0x28e595+'-'+_0x5e5e81+'/'+_0x2adda7)[_0x1808('0x23')](_0x43299e);}return null;};}function patchUpdates(_0x3a5105){return function(_0x5202f4){try{jsonpatch[_0x1808('0x28')](_0x5202f4,_0x3a5105,!![]);}catch(_0x50f679){return BPromise[_0x1808('0x29')](_0x50f679);}return _0x5202f4[_0x1808('0x2a')]();};}function saveUpdates(_0x27e052,_0x4db0c7){return function(_0x3f01a3){if(_0x3f01a3){return _0x3f01a3['update'](_0x27e052)['then'](function(_0x47a58e){return _0x47a58e;});}return null;};}function removeEntity(_0x5a00aa,_0x3ec9da){return function(_0x51a685){if(_0x51a685){return _0x51a685[_0x1808('0x2b')]()[_0x1808('0x17')](function(){var _0x303813=_0x51a685[_0x1808('0x2c')]({'plain':!![]});var _0x27aa20='FaxAccounts';return db[_0x1808('0x2d')][_0x1808('0x2b')]({'where':{'type':_0x27aa20,'resourceId':_0x303813['id']}})['then'](function(){return _0x51a685;});})['then'](function(){_0x5a00aa[_0x1808('0x21')](0xcc)[_0x1808('0x22')]();});}};}function handleEntityNotFound(_0x18a3d0,_0x58c776){return function(_0x3e29ec){if(!_0x3e29ec){_0x18a3d0['sendStatus'](0x194);}return _0x3e29ec;};}function handleError(_0x48ea71,_0x19bcf8){_0x19bcf8=_0x19bcf8||0x1f4;return function(_0xb430f7){logger[_0x1808('0x1d')](_0xb430f7[_0x1808('0x2e')]);if(_0xb430f7[_0x1808('0x2f')]){delete _0xb430f7[_0x1808('0x2f')];}_0x48ea71['status'](_0x19bcf8)[_0x1808('0x30')](_0xb430f7);};}exports[_0x1808('0x31')]=function(_0x31adc3,_0x576a0e){var _0x574a93={'include':[{'model':db[_0x1808('0x32')],'as':_0x1808('0x33')}]},_0x35bf3f={},_0x907faa={'count':0x0,'rows':[]};var _0x5af799=db[_0x1808('0x34')][_0x1808('0x35')];_0x35bf3f[_0x1808('0x36')]=_['keys'](_0x5af799);_0x35bf3f['query']=_['keys'](_0x31adc3['query']);_0x35bf3f[_0x1808('0x37')]=_[_0x1808('0x38')](_0x35bf3f[_0x1808('0x36')],_0x35bf3f[_0x1808('0x39')]);_0x574a93[_0x1808('0x3a')]=_[_0x1808('0x38')](_0x35bf3f[_0x1808('0x36')],qs[_0x1808('0x3b')](_0x31adc3['query'][_0x1808('0x3b')]));_0x574a93[_0x1808('0x3a')]=_0x574a93['attributes'][_0x1808('0x3c')]?_0x574a93['attributes']:_0x35bf3f[_0x1808('0x36')];if(!_0x31adc3['query']['hasOwnProperty']('nolimit')){_0x574a93[_0x1808('0x26')]=qs['limit'](_0x31adc3[_0x1808('0x39')][_0x1808('0x26')]);_0x574a93['offset']=qs['offset'](_0x31adc3[_0x1808('0x39')][_0x1808('0x25')]);}_0x574a93['order']=qs[_0x1808('0x3d')](_0x31adc3[_0x1808('0x39')][_0x1808('0x3d')]);_0x574a93['where']=qs[_0x1808('0x37')](_[_0x1808('0x3e')](_0x31adc3[_0x1808('0x39')],_0x35bf3f[_0x1808('0x37')]));if(_0x31adc3[_0x1808('0x39')][_0x1808('0x3f')]){_0x574a93[_0x1808('0x40')]=_[_0x1808('0x41')](_0x574a93['where'],{'$or':_[_0x1808('0x42')](_0x5af799,function(_0x59f6bf){if(_0x59f6bf['type'][_0x1808('0x43')]!==_0x1808('0x44')){var _0x508fba={};_0x508fba[_0x59f6bf[_0x1808('0x45')]]={'$like':'%'+_0x31adc3['query'][_0x1808('0x3f')]+'%'};return _0x508fba;}})});}_0x574a93=_[_0x1808('0x41')]({},_0x574a93,_0x31adc3[_0x1808('0x46')]);var _0x38da54={'where':_0x574a93[_0x1808('0x40')]};return db['FaxAccount'][_0x1808('0x24')](_0x38da54)[_0x1808('0x17')](function(_0xe7550a){_0x907faa[_0x1808('0x24')]=_0xe7550a;if(_0x31adc3['query']['includeAll']){_0x574a93[_0x1808('0x47')]=[{'all':!![]}];}return db[_0x1808('0x34')][_0x1808('0x48')](_0x574a93);})[_0x1808('0x17')](function(_0x546e46){_0x907faa[_0x1808('0x49')]=_0x546e46;return _0x907faa;})[_0x1808('0x17')](respondWithFilteredResult(_0x576a0e,_0x574a93))[_0x1808('0x20')](handleError(_0x576a0e,null));};exports[_0x1808('0x4a')]=function(_0x565612,_0x405a8f){var _0x5c87fb={'raw':![],'where':{'id':_0x565612['params']['id']},'include':[{'model':db[_0x1808('0x32')],'as':_0x1808('0x33')}]},_0x35a34b={};_0x35a34b[_0x1808('0x36')]=_[_0x1808('0x4b')](db[_0x1808('0x34')][_0x1808('0x35')]);_0x35a34b[_0x1808('0x39')]=_['keys'](_0x565612[_0x1808('0x39')]);_0x35a34b['filters']=_['intersection'](_0x35a34b[_0x1808('0x36')],_0x35a34b[_0x1808('0x39')]);_0x5c87fb[_0x1808('0x3a')]=_['intersection'](_0x35a34b[_0x1808('0x36')],qs['fields'](_0x565612[_0x1808('0x39')][_0x1808('0x3b')]));_0x5c87fb[_0x1808('0x3a')]=_0x5c87fb[_0x1808('0x3a')][_0x1808('0x3c')]?_0x5c87fb[_0x1808('0x3a')]:_0x35a34b[_0x1808('0x36')];if(_0x565612['query'][_0x1808('0x4c')]){_0x5c87fb['include']=[{'all':!![]}];}_0x5c87fb=_[_0x1808('0x41')]({},_0x5c87fb,_0x565612[_0x1808('0x46')]);return db[_0x1808('0x34')]['find'](_0x5c87fb)[_0x1808('0x17')](handleEntityNotFound(_0x405a8f,null))[_0x1808('0x17')](respondWithResult(_0x405a8f,null))[_0x1808('0x20')](handleError(_0x405a8f,null));};exports[_0x1808('0x4d')]=function(_0x470a5d,_0x1351a4){return db['FaxAccount'][_0x1808('0x4d')](_0x470a5d[_0x1808('0x4e')],{})[_0x1808('0x17')](function(_0x2a93d9){var _0x542b9b=_0x470a5d[_0x1808('0x4f')]['get']({'plain':!![]});if(!_0x542b9b)throw new Error(_0x1808('0x50'));if(_0x542b9b['role']===_0x1808('0x4f')){var _0x9fd399=_0x2a93d9['get']({'plain':!![]});var _0x49687e=_0x1808('0x51');return db[_0x1808('0x52')][_0x1808('0x53')]({'where':{'name':_0x49687e,'userProfileId':_0x542b9b[_0x1808('0x54')]},'raw':!![]})['then'](function(_0x2cc18a){if(_0x2cc18a&&_0x2cc18a[_0x1808('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x9fd399[_0x1808('0x2f')],'resourceId':_0x9fd399['id'],'type':_0x2cc18a[_0x1808('0x2f')],'sectionId':_0x2cc18a['id']},{})['then'](function(){return _0x2a93d9;});}else{return _0x2a93d9;}})[_0x1808('0x20')](function(_0x194bba){logger[_0x1808('0x1d')](_0x1808('0x56'),_0x194bba);throw _0x194bba;});}return _0x2a93d9;})['then'](respondWithResult(_0x1351a4,0xc9))[_0x1808('0x20')](handleError(_0x1351a4,null));};exports[_0x1808('0x57')]=function(_0x2c0580,_0x496462){if(_0x2c0580[_0x1808('0x4e')]['id']){delete _0x2c0580['body']['id'];}return db['FaxAccount'][_0x1808('0x53')]({'where':{'id':_0x2c0580[_0x1808('0x58')]['id']},'include':[{'model':db[_0x1808('0x32')],'as':_0x1808('0x33')}]})[_0x1808('0x17')](handleEntityNotFound(_0x496462,null))[_0x1808('0x17')](saveUpdates(_0x2c0580[_0x1808('0x4e')],null))[_0x1808('0x17')](function(_0x3c0bd7){if(_0x3c0bd7&&_0x2c0580[_0x1808('0x4e')][_0x1808('0x33')]){return db[_0x1808('0x32')][_0x1808('0x57')](_0x2c0580['body'][_0x1808('0x33')],{'where':{'FaxAccountId':_0x3c0bd7['id']}})['then'](function(){return _0x3c0bd7;});}return _0x3c0bd7;})['then'](respondWithResult(_0x496462,null))[_0x1808('0x20')](handleError(_0x496462,null));};exports[_0x1808('0x2b')]=function(_0xe64f9a,_0x512325){return db[_0x1808('0x34')][_0x1808('0x53')]({'where':{'id':_0xe64f9a[_0x1808('0x58')]['id']}})[_0x1808('0x17')](handleEntityNotFound(_0x512325,null))[_0x1808('0x17')](removeEntity(_0x512325,null))['catch'](handleError(_0x512325,null));};exports[_0x1808('0x59')]=function(_0x540155,_0x3a1366){return db['FaxAccount'][_0x1808('0x59')]()[_0x1808('0x17')](respondWithResult(_0x3a1366,null))[_0x1808('0x20')](handleError(_0x3a1366,null));};exports[_0x1808('0x5a')]=function(_0x39cbee,_0x40d946,_0x585869){if(_0x39cbee[_0x1808('0x4e')]['id']){delete _0x39cbee[_0x1808('0x4e')]['id'];}return db[_0x1808('0x34')][_0x1808('0x53')]({'where':{'id':_0x39cbee[_0x1808('0x58')]['id']}})['then'](handleEntityNotFound(_0x40d946,null))[_0x1808('0x17')](function(_0x461a9c){if(_0x461a9c){_0x39cbee[_0x1808('0x4e')][_0x1808('0x5b')]=_0x461a9c['id'];return db['Disposition'][_0x1808('0x4d')](_0x39cbee[_0x1808('0x4e')]);}})['then'](respondWithResult(_0x40d946,null))[_0x1808('0x20')](handleError(_0x40d946,null));};exports['getDispositions']=function(_0x901287,_0x2879b4,_0x2a3723){var _0xe5f2f3={'raw':![],'where':{}};var _0x12bc8d={};var _0x127bc8={'count':0x0,'rows':[]};return db[_0x1808('0x34')][_0x1808('0x5c')]({'where':{'id':_0x901287['params']['id']}})['then'](handleEntityNotFound(_0x2879b4,null))[_0x1808('0x17')](function(_0x165aed){if(_0x165aed){_0x12bc8d[_0x1808('0x36')]=_[_0x1808('0x4b')](db[_0x1808('0x5d')]['rawAttributes']);_0x12bc8d['query']=_[_0x1808('0x4b')](_0x901287[_0x1808('0x39')]);_0x12bc8d[_0x1808('0x37')]=_[_0x1808('0x38')](_0x12bc8d[_0x1808('0x36')],_0x12bc8d[_0x1808('0x39')]);_0xe5f2f3[_0x1808('0x3a')]=_['intersection'](_0x12bc8d[_0x1808('0x36')],qs[_0x1808('0x3b')](_0x901287['query'][_0x1808('0x3b')]));_0xe5f2f3[_0x1808('0x3a')]=_0xe5f2f3[_0x1808('0x3a')][_0x1808('0x3c')]?_0xe5f2f3['attributes']:_0x12bc8d[_0x1808('0x36')];if(!_0x901287[_0x1808('0x39')][_0x1808('0x5e')]('nolimit')){_0xe5f2f3['limit']=qs[_0x1808('0x26')](_0x901287['query'][_0x1808('0x26')]);_0xe5f2f3[_0x1808('0x25')]=qs[_0x1808('0x25')](_0x901287[_0x1808('0x39')][_0x1808('0x25')]);}_0xe5f2f3[_0x1808('0x5f')]=qs[_0x1808('0x3d')](_0x901287[_0x1808('0x39')][_0x1808('0x3d')]);_0xe5f2f3[_0x1808('0x40')]=qs['filters'](_[_0x1808('0x3e')](_0x901287[_0x1808('0x39')],_0x12bc8d[_0x1808('0x37')]));_0xe5f2f3['where'][_0x1808('0x5b')]=_0x165aed['id'];if(_0x901287['query'][_0x1808('0x3f')]){_0xe5f2f3[_0x1808('0x40')]=_[_0x1808('0x41')](_0xe5f2f3[_0x1808('0x40')],{'$or':_[_0x1808('0x42')](_0xe5f2f3[_0x1808('0x3a')],function(_0x2a8902){var _0xb04963={};_0xb04963[_0x2a8902]={'$like':'%'+_0x901287[_0x1808('0x39')][_0x1808('0x3f')]+'%'};return _0xb04963;})});}_0xe5f2f3=_[_0x1808('0x41')]({},_0xe5f2f3,_0x901287[_0x1808('0x46')]);return db[_0x1808('0x5d')][_0x1808('0x24')]({'where':_0xe5f2f3[_0x1808('0x40')]})[_0x1808('0x17')](function(_0x17c3aa){_0x127bc8[_0x1808('0x24')]=_0x17c3aa;if(_0x901287['query'][_0x1808('0x4c')]){_0xe5f2f3[_0x1808('0x47')]=[{'all':!![]}];}return db[_0x1808('0x5d')]['findAll'](_0xe5f2f3);})[_0x1808('0x17')](function(_0x18779f){_0x127bc8[_0x1808('0x49')]=_0x18779f;return _0x127bc8;});}})[_0x1808('0x17')](respondWithFilteredResult(_0x2879b4,_0xe5f2f3))[_0x1808('0x20')](handleError(_0x2879b4,null));};exports[_0x1808('0x60')]=function(_0xbc4145,_0x2ebcab,_0x5e70f7){var _0x5b29b4;return db[_0x1808('0x34')][_0x1808('0x53')]({'where':{'id':_0xbc4145[_0x1808('0x58')]['id']}})[_0x1808('0x17')](handleEntityNotFound(_0x2ebcab,null))[_0x1808('0x17')](function(_0x2b59cd){if(_0x2b59cd){return _0x2b59cd[_0x1808('0x60')](_0xbc4145['query'][_0x1808('0x61')]);}})[_0x1808('0x17')](respondWithStatusCode(_0x2ebcab,null))['catch'](handleError(_0x2ebcab,null));};exports['addAnswer']=function(_0x4ef2dc,_0x3c2e77,_0x2f16c2){if(_0x4ef2dc['body']['id']){delete _0x4ef2dc[_0x1808('0x4e')]['id'];}return db[_0x1808('0x34')][_0x1808('0x53')]({'where':{'id':_0x4ef2dc[_0x1808('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c2e77,null))[_0x1808('0x17')](function(_0x33588a){if(_0x33588a){_0x4ef2dc['body'][_0x1808('0x5b')]=_0x33588a['id'];return db[_0x1808('0x62')][_0x1808('0x4d')](_0x4ef2dc[_0x1808('0x4e')]);}})[_0x1808('0x17')](respondWithResult(_0x3c2e77,null))['catch'](handleError(_0x3c2e77,null));};exports[_0x1808('0x63')]=function(_0x50ca6b,_0x52cfec,_0x3a4ade){var _0x474d49={'raw':![],'where':{}};var _0x5f2e6e={};var _0x3d7dba={'count':0x0,'rows':[]};return db[_0x1808('0x34')][_0x1808('0x5c')]({'where':{'id':_0x50ca6b[_0x1808('0x58')]['id']}})[_0x1808('0x17')](handleEntityNotFound(_0x52cfec,null))['then'](function(_0x423928){if(_0x423928){_0x5f2e6e[_0x1808('0x36')]=_[_0x1808('0x4b')](db[_0x1808('0x62')][_0x1808('0x35')]);_0x5f2e6e[_0x1808('0x39')]=_[_0x1808('0x4b')](_0x50ca6b[_0x1808('0x39')]);_0x5f2e6e[_0x1808('0x37')]=_[_0x1808('0x38')](_0x5f2e6e['model'],_0x5f2e6e[_0x1808('0x39')]);_0x474d49['attributes']=_[_0x1808('0x38')](_0x5f2e6e[_0x1808('0x36')],qs[_0x1808('0x3b')](_0x50ca6b[_0x1808('0x39')][_0x1808('0x3b')]));_0x474d49[_0x1808('0x3a')]=_0x474d49[_0x1808('0x3a')][_0x1808('0x3c')]?_0x474d49['attributes']:_0x5f2e6e['model'];if(!_0x50ca6b[_0x1808('0x39')]['hasOwnProperty'](_0x1808('0x64'))){_0x474d49[_0x1808('0x26')]=qs[_0x1808('0x26')](_0x50ca6b['query'][_0x1808('0x26')]);_0x474d49[_0x1808('0x25')]=qs['offset'](_0x50ca6b['query'][_0x1808('0x25')]);}_0x474d49[_0x1808('0x5f')]=qs[_0x1808('0x3d')](_0x50ca6b[_0x1808('0x39')][_0x1808('0x3d')]);_0x474d49['where']=qs[_0x1808('0x37')](_['pick'](_0x50ca6b[_0x1808('0x39')],_0x5f2e6e['filters']));_0x474d49[_0x1808('0x40')][_0x1808('0x5b')]=_0x423928['id'];if(_0x50ca6b[_0x1808('0x39')][_0x1808('0x3f')]){_0x474d49['where']=_['merge'](_0x474d49[_0x1808('0x40')],{'$or':_[_0x1808('0x42')](_0x474d49[_0x1808('0x3a')],function(_0x96ee52){var _0x460f0b={};_0x460f0b[_0x96ee52]={'$like':'%'+_0x50ca6b[_0x1808('0x39')][_0x1808('0x3f')]+'%'};return _0x460f0b;})});}_0x474d49=_[_0x1808('0x41')]({},_0x474d49,_0x50ca6b['options']);return db[_0x1808('0x62')][_0x1808('0x24')]({'where':_0x474d49[_0x1808('0x40')]})['then'](function(_0x3adda7){_0x3d7dba[_0x1808('0x24')]=_0x3adda7;if(_0x50ca6b[_0x1808('0x39')][_0x1808('0x4c')]){_0x474d49[_0x1808('0x47')]=[{'all':!![]}];}return db[_0x1808('0x62')][_0x1808('0x48')](_0x474d49);})['then'](function(_0x40c8fb){_0x3d7dba[_0x1808('0x49')]=_0x40c8fb;return _0x3d7dba;});}})[_0x1808('0x17')](respondWithFilteredResult(_0x52cfec,_0x474d49))[_0x1808('0x20')](handleError(_0x52cfec,null));};exports[_0x1808('0x65')]=function(_0x2cf92b,_0x2c2dab,_0x5e641f){var _0x2d53a4;return db[_0x1808('0x34')][_0x1808('0x53')]({'where':{'id':_0x2cf92b[_0x1808('0x58')]['id']}})[_0x1808('0x17')](handleEntityNotFound(_0x2c2dab,null))[_0x1808('0x17')](function(_0xb3ada7){if(_0xb3ada7){return _0xb3ada7[_0x1808('0x65')](_0x2cf92b[_0x1808('0x39')][_0x1808('0x61')]);}})[_0x1808('0x17')](respondWithStatusCode(_0x2c2dab,null))[_0x1808('0x20')](handleError(_0x2c2dab,null));};exports[_0x1808('0x66')]=function(_0x5ba92a,_0x1f7d4e,_0x581ee8){return db[_0x1808('0x67')][_0x1808('0x53')]({'where':{'id':_0x5ba92a[_0x1808('0x58')]['id']}})[_0x1808('0x17')](handleEntityNotFound(_0x1f7d4e,null))[_0x1808('0x17')](function(_0x38210a){if(_0x38210a){return _0x38210a['addInteraction'](_0x5ba92a[_0x1808('0x4e')][_0x1808('0x61')],_[_0x1808('0x68')](_0x5ba92a[_0x1808('0x4e')],[_0x1808('0x61'),'id'])||{});}})[_0x1808('0x17')](respondWithResult(_0x1f7d4e,null))[_0x1808('0x20')](handleError(_0x1f7d4e,null));};exports[_0x1808('0x69')]=function(_0x170276,_0x72340b,_0x2c87d8){var _0x5d76ad={'raw':![],'where':{}};var _0x3ee6fd={};var _0x5d13d4={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x170276[_0x1808('0x58')]['id']}})['then'](handleEntityNotFound(_0x72340b,null))[_0x1808('0x17')](function(_0x3315f4){if(_0x3315f4){_0x3ee6fd[_0x1808('0x36')]=_[_0x1808('0x4b')](db[_0x1808('0x67')][_0x1808('0x35')]);_0x3ee6fd['query']=_[_0x1808('0x4b')](_0x170276[_0x1808('0x39')]);_0x3ee6fd[_0x1808('0x37')]=_['intersection'](_0x3ee6fd[_0x1808('0x36')],_0x3ee6fd[_0x1808('0x39')]);_0x5d76ad[_0x1808('0x3a')]=_[_0x1808('0x38')](_0x3ee6fd['model'],qs[_0x1808('0x3b')](_0x170276['query'][_0x1808('0x3b')]));_0x5d76ad[_0x1808('0x3a')]=_0x5d76ad[_0x1808('0x3a')][_0x1808('0x3c')]?_0x5d76ad[_0x1808('0x3a')]:_0x3ee6fd[_0x1808('0x36')];if(!_0x170276[_0x1808('0x39')][_0x1808('0x5e')](_0x1808('0x64'))){_0x5d76ad[_0x1808('0x26')]=qs[_0x1808('0x26')](_0x170276[_0x1808('0x39')]['limit']);_0x5d76ad[_0x1808('0x25')]=qs['offset'](_0x170276[_0x1808('0x39')][_0x1808('0x25')]);}_0x5d76ad[_0x1808('0x5f')]=qs[_0x1808('0x3d')](_0x170276[_0x1808('0x39')]['sort']);_0x5d76ad['where']=qs['filters'](_[_0x1808('0x3e')](_0x170276[_0x1808('0x39')],_0x3ee6fd[_0x1808('0x37')]));_0x5d76ad[_0x1808('0x40')]['FaxAccountId']=_0x3315f4['id'];if(_0x170276['query'][_0x1808('0x3f')]){_0x5d76ad['where']=_[_0x1808('0x41')](_0x5d76ad[_0x1808('0x40')],{'$or':_[_0x1808('0x42')](_0x5d76ad[_0x1808('0x3a')],function(_0x3bcf0b){var _0x4708d0={};_0x4708d0[_0x3bcf0b]={'$like':'%'+_0x170276[_0x1808('0x39')]['filter']+'%'};return _0x4708d0;})});}_0x5d76ad=_[_0x1808('0x41')]({},_0x5d76ad,_0x170276[_0x1808('0x46')]);return db['FaxInteraction'][_0x1808('0x24')]({'where':_0x5d76ad[_0x1808('0x40')]})[_0x1808('0x17')](function(_0x8292e9){_0x5d13d4[_0x1808('0x24')]=_0x8292e9;if(_0x170276['query']['includeAll']){_0x5d76ad[_0x1808('0x47')]=[{'model':db[_0x1808('0x6a')],'as':_0x1808('0x6b'),'required':![]},{'model':db[_0x1808('0x6c')],'as':_0x1808('0x6d'),'attributes':[_0x1808('0x2f'),_0x1808('0x6e'),'internal'],'required':![]},{'model':db[_0x1808('0x6f')],'as':_0x1808('0x70'),'attributes':['id',_0x1808('0x2f'),_0x1808('0x71')],'where':_0x170276[_0x1808('0x39')][_0x1808('0x72')]?{'id':_0x170276['query'][_0x1808('0x72')]}:undefined,'required':_0x170276[_0x1808('0x39')]['tag']?!![]:![]}];}return db[_0x1808('0x67')]['findAll'](_0x5d76ad);})['then'](function(_0x3eac03){_0x5d13d4[_0x1808('0x49')]=_0x3eac03;return _0x5d13d4;});}})['then'](respondWithFilteredResult(_0x72340b,_0x5d76ad))[_0x1808('0x20')](handleError(_0x72340b,null));};exports[_0x1808('0x73')]=function(_0x2d2f37,_0x232f3a,_0x1c7696){return db[_0x1808('0x34')]['findOne']({'where':{'id':_0x2d2f37[_0x1808('0x58')]['id']}})[_0x1808('0x17')](handleEntityNotFound(_0x232f3a,null))['then'](function(_0x87a1ab){if(_0x87a1ab){return db[_0x1808('0x74')][_0x1808('0x75')](function(_0x2d8780){return db[_0x1808('0x76')]['destroy']({'where':{'FaxAccountId':_0x2d2f37[_0x1808('0x58')]['id']},'transaction':_0x2d8780})[_0x1808('0x17')](function(_0x2d8b1d){var _0x4bf891=_[_0x1808('0x42')](_0x2d2f37[_0x1808('0x4e')],function(_0x25ef9a){_0x25ef9a['FaxAccountId']=_0x2d2f37[_0x1808('0x58')]['id'];return _0x25ef9a;});return db[_0x1808('0x76')][_0x1808('0x77')](_0x4bf891,{'transaction':_0x2d8780});});})[_0x1808('0x17')](function(){return db[_0x1808('0x76')][_0x1808('0x78')]({'where':{'FaxAccountId':_0x2d2f37[_0x1808('0x58')]['id']},'order':_0x1808('0x79')});});}})[_0x1808('0x17')](respondWithResult(_0x232f3a,null))[_0x1808('0x20')](handleError(_0x232f3a,null));};exports[_0x1808('0x7a')]=function(_0x4664e5,_0x4a542a,_0x4a5c58){var _0x1ef45b={};var _0x31b51c={};var _0x28bd69;var _0x3da822;return db[_0x1808('0x34')][_0x1808('0x5c')]({'where':{'id':_0x4664e5[_0x1808('0x58')]['id']}})[_0x1808('0x17')](handleEntityNotFound(_0x4a542a,null))[_0x1808('0x17')](function(_0x44ad2e){if(_0x44ad2e){_0x28bd69=_0x44ad2e;_0x31b51c['model']=_[_0x1808('0x4b')](db['FaxApplication'][_0x1808('0x35')]);_0x31b51c[_0x1808('0x39')]=_[_0x1808('0x4b')](_0x4664e5[_0x1808('0x39')]);_0x31b51c[_0x1808('0x37')]=_[_0x1808('0x38')](_0x31b51c[_0x1808('0x36')],_0x31b51c[_0x1808('0x39')]);_0x1ef45b[_0x1808('0x3a')]=_[_0x1808('0x38')](_0x31b51c[_0x1808('0x36')],qs[_0x1808('0x3b')](_0x4664e5['query'][_0x1808('0x3b')]));_0x1ef45b[_0x1808('0x3a')]=_0x1ef45b[_0x1808('0x3a')][_0x1808('0x3c')]?_0x1ef45b[_0x1808('0x3a')]:_0x31b51c[_0x1808('0x36')];_0x1ef45b[_0x1808('0x5f')]=qs[_0x1808('0x3d')](_0x4664e5[_0x1808('0x39')][_0x1808('0x3d')]);_0x1ef45b[_0x1808('0x40')]=qs[_0x1808('0x37')](_[_0x1808('0x3e')](_0x4664e5[_0x1808('0x39')],_0x31b51c[_0x1808('0x37')]));if(_0x4664e5[_0x1808('0x39')][_0x1808('0x3f')]){_0x1ef45b[_0x1808('0x40')]=_[_0x1808('0x41')](_0x1ef45b[_0x1808('0x40')],{'$or':_['map'](_0x1ef45b[_0x1808('0x3a')],function(_0x27eab4){var _0x20d01a={};_0x20d01a[_0x27eab4]={'$like':'%'+_0x4664e5[_0x1808('0x39')][_0x1808('0x3f')]+'%'};return _0x20d01a;})});}_0x1ef45b=_[_0x1808('0x41')]({},_0x1ef45b,_0x4664e5[_0x1808('0x46')]);return _0x28bd69[_0x1808('0x7a')](_0x1ef45b);}})['then'](function(_0x21111e){if(_0x21111e){_0x3da822=_0x21111e[_0x1808('0x3c')];if(!_0x4664e5[_0x1808('0x39')][_0x1808('0x5e')](_0x1808('0x64'))){_0x1ef45b[_0x1808('0x26')]=qs[_0x1808('0x26')](_0x4664e5['query'][_0x1808('0x26')]);_0x1ef45b['offset']=qs[_0x1808('0x25')](_0x4664e5[_0x1808('0x39')]['offset']);}return _0x28bd69['getApplications'](_0x1ef45b);}})[_0x1808('0x17')](function(_0x37b5e1){if(_0x37b5e1){return _0x37b5e1?{'count':_0x3da822,'rows':_0x37b5e1}:null;}})[_0x1808('0x17')](respondWithResult(_0x4a542a,null))[_0x1808('0x20')](handleError(_0x4a542a,null));};function Extension(_0x2bcaa3,_0x386821,_0x304772,_0x350047){this[_0x1808('0x7b')]='from-voip-provider';this[_0x1808('0x7c')]=_0x2bcaa3[_0x1808('0x7d')];this[_0x1808('0x7e')]=_0x350047;this[_0x1808('0x7f')]=_0x1808('0x80');this[_0x1808('0x81')]='Fax\x20Extension';this[_0x1808('0x5b')]=_0x2bcaa3['id'];this[_0x1808('0x79')]=_0x386821;this[_0x1808('0x82')]=_0x304772;}function createExtensionsReciveFax(_0x33d6ff){var _0x148789=0x1;var _0x4b64c6=[];_0x4b64c6[_0x1808('0x83')](new Extension(_0x33d6ff,_0x148789,'','Answer'));_0x148789+=0x1;_0x4b64c6[_0x1808('0x83')](new Extension(_0x33d6ff,_0x148789,_0x1808('0x84'),_0x1808('0x85')));_0x148789+=0x1;for(var _0xba1a31 in _0x33d6ff){if(_0x33d6ff[_0x1808('0x5e')](_0xba1a31)&&(_0xba1a31==='ecm'||_0xba1a31===_0x1808('0x7d')||_0xba1a31===_0x1808('0x86')||_0xba1a31===_0x1808('0x87')||_0xba1a31===_0x1808('0x88')||_0xba1a31===_0x1808('0x89')||_0xba1a31===_0x1808('0x8a')||_0xba1a31===_0x1808('0x8b')||_0xba1a31===_0x1808('0x8c'))){_0x4b64c6[_0x1808('0x83')](new Extension(_0x33d6ff,_0x148789,_0x1808('0x8d')+_0xba1a31+')='+_0x33d6ff[_0xba1a31],_0x1808('0x85')));_0x148789+=0x1;}}_0x4b64c6[_0x1808('0x83')](new Extension(_0x33d6ff,_0x148789,'6',_0x1808('0x8e')));_0x148789+=0x1;_0x4b64c6[_0x1808('0x83')](new Extension(_0x33d6ff,_0x148789,_0x1808('0x8f'),'ReceiveFax'));_0x148789=0x0;return _0x4b64c6;}exports[_0x1808('0x90')]=function(_0x4d4df6,_0x35aaa6,_0x45642a){var _0xfed3bd;return db[_0x1808('0x74')]['transaction'](function(_0xb31a1b){return db[_0x1808('0x34')][_0x1808('0x4d')](_0x4d4df6[_0x1808('0x4e')],{'transaction':_0xb31a1b})[_0x1808('0x17')](function(_0xabb4bc){_0xfed3bd=_0xabb4bc[_0x1808('0x2c')]({'plain':!![]});return db['VoiceExtension'][_0x1808('0x77')](createExtensionsReciveFax(_0xfed3bd),{'transaction':_0xb31a1b});});})[_0x1808('0x17')](function(){return _0xfed3bd;})['then'](respondWithResult(_0x35aaa6,null))[_0x1808('0x20')](handleError(_0x35aaa6,null));};exports[_0x1808('0x91')]=function(_0x3102c6,_0x1772ed,_0x5f83c9){var _0x4fbe1c;return db['sequelize'][_0x1808('0x75')](function(_0x3f55c4){return db[_0x1808('0x34')][_0x1808('0x57')](_0x3102c6[_0x1808('0x4e')],{'where':{'id':_0x3102c6['body']['id']},'transaction':_0x3f55c4})[_0x1808('0x17')](function(_0x25e8c4){return db['VoiceExtension'][_0x1808('0x2b')]({'where':{'FaxAccountId':_0x3102c6[_0x1808('0x4e')]['id']},'transaction':_0x3f55c4})[_0x1808('0x17')](function(_0x1fc304){return db[_0x1808('0x92')][_0x1808('0x77')](createExtensionsReciveFax(_['omit'](_0x3102c6['body'],[_0x1808('0x93'),_0x1808('0x43'),_0x1808('0x94'),_0x1808('0x95'),_0x1808('0x96'),_0x1808('0x97')])),{'transaction':_0x3f55c4});});});})['then'](function(){return db['FaxAccount'][_0x1808('0x98')](_0x3102c6[_0x1808('0x4e')]['id']);})[_0x1808('0x17')](respondWithResult(_0x1772ed,null))[_0x1808('0x20')](handleError(_0x1772ed,null));};exports[_0x1808('0x99')]=function(_0x3996fc,_0x4d9724,_0x42f28d){var _0xc28aff={'raw':!![],'where':{}};var _0x2e345d={};var _0x4cb4ea={'count':0x0,'rows':[]};return db[_0x1808('0x34')]['findOne']({'where':{'id':_0x3996fc[_0x1808('0x58')]['id']}})[_0x1808('0x17')](handleEntityNotFound(_0x4d9724,null))[_0x1808('0x17')](function(_0x5ad939){if(_0x5ad939){_0x2e345d['model']=_[_0x1808('0x4b')](db[_0x1808('0x9a')]['rawAttributes']);_0x2e345d[_0x1808('0x39')]=_[_0x1808('0x4b')](_0x3996fc[_0x1808('0x39')]);_0x2e345d[_0x1808('0x37')]=_[_0x1808('0x38')](_0x2e345d[_0x1808('0x36')],_0x2e345d[_0x1808('0x39')]);_0xc28aff[_0x1808('0x3a')]=_[_0x1808('0x38')](_0x2e345d[_0x1808('0x36')],qs[_0x1808('0x3b')](_0x3996fc[_0x1808('0x39')][_0x1808('0x3b')]));_0xc28aff[_0x1808('0x3a')]=_0xc28aff['attributes']['length']?_0xc28aff['attributes']:_0x2e345d[_0x1808('0x36')];if(!_0x3996fc[_0x1808('0x39')]['hasOwnProperty']('nolimit')){_0xc28aff[_0x1808('0x26')]=qs[_0x1808('0x26')](_0x3996fc[_0x1808('0x39')][_0x1808('0x26')]);_0xc28aff['offset']=qs['offset'](_0x3996fc['query'][_0x1808('0x25')]);}_0xc28aff[_0x1808('0x5f')]=qs[_0x1808('0x3d')](_0x3996fc[_0x1808('0x39')][_0x1808('0x3d')]);_0xc28aff[_0x1808('0x40')]=qs['filters'](_['pick'](_0x3996fc[_0x1808('0x39')],_0x2e345d[_0x1808('0x37')]));_0xc28aff[_0x1808('0x40')]['FaxAccountId']=_0x5ad939['id'];if(_0x3996fc[_0x1808('0x39')][_0x1808('0x3f')]){_0xc28aff['where']=_[_0x1808('0x41')](_0xc28aff[_0x1808('0x40')],{'$or':_[_0x1808('0x42')](_0xc28aff[_0x1808('0x3a')],function(_0x5da86d){var _0x454d67={};_0x454d67[_0x5da86d]={'$like':'%'+_0x3996fc['query'][_0x1808('0x3f')]+'%'};return _0x454d67;})});}if(_0x3996fc[_0x1808('0x39')][_0x1808('0x9b')]){var _0x12595b=_0x3996fc[_0x1808('0x39')][_0x1808('0x9b')][_0x1808('0x9c')](',');var _0x20541c={};_0x20541c[_0x12595b[0x0]]={'$gte':moment(_0x12595b[0x1])[_0x1808('0x9d')](_0x1808('0x9e'))};_0xc28aff[_0x1808('0x40')]=_[_0x1808('0x41')](_0xc28aff[_0x1808('0x40')],_0x20541c);}_0xc28aff=_[_0x1808('0x41')]({},_0xc28aff,_0x3996fc['options']);return db[_0x1808('0x9a')]['count']({'where':_0xc28aff[_0x1808('0x40')]})[_0x1808('0x17')](function(_0x534417){_0x4cb4ea[_0x1808('0x24')]=_0x534417;if(_0x3996fc[_0x1808('0x39')][_0x1808('0x4c')]){_0xc28aff[_0x1808('0x47')]=[{'all':!![]}];}return db[_0x1808('0x9a')][_0x1808('0x48')](_0xc28aff);})['then'](function(_0x4d753a){_0x4cb4ea['rows']=_0x4d753a;return _0x4cb4ea;});}})[_0x1808('0x17')](respondWithFilteredResult(_0x4d9724,_0xc28aff))['catch'](handleError(_0x4d9724,null));};exports[_0x1808('0x30')]=function(_0x501ec4,_0x387d2e,_0x25d141){var _0x21812f,_0x97cd30={},_0x4fa6b0;if(_0x501ec4[_0x1808('0x4e')]['to']){_0x4fa6b0=_0x501ec4[_0x1808('0x4e')]['to'][0x0];}return db['FaxAccount'][_0x1808('0x53')]({'where':{'id':_0x501ec4[_0x1808('0x58')]['id']},'include':[{'model':db[_0x1808('0x9f')],'as':_0x1808('0xa0'),'include':[{'model':db[_0x1808('0x6a')],'as':_0x1808('0xa1'),'where':{'fax':_0x4fa6b0},'limit':0x1,'order':[[_0x1808('0x95'),'DESC']]}]}]})[_0x1808('0x17')](handleEntityNotFound(_0x387d2e,null))[_0x1808('0x17')](function(_0x3d4dc0){_0x21812f=_0x3d4dc0;if(_0x501ec4[_0x1808('0x4e')]['attachments']&&_0x501ec4[_0x1808('0x4e')][_0x1808('0xa2')]['length']){for(var _0x323a96=0x0;_0x323a96<_0x501ec4[_0x1808('0x4e')][_0x1808('0xa2')][_0x1808('0x3c')];_0x323a96+=0x1){_0x501ec4[_0x1808('0x4e')][_0x1808('0xa2')][_0x323a96]={'filename':_0x501ec4[_0x1808('0x4e')][_0x1808('0xa2')][_0x323a96][_0x1808('0x2f')],'id':_0x501ec4[_0x1808('0x4e')][_0x1808('0xa2')][_0x323a96]['id'],'path':path[_0x1808('0xa3')](config[_0x1808('0xa4')],_0x1808('0xa5'),_0x501ec4['body'][_0x1808('0xa2')][_0x323a96][_0x1808('0xa6')])};}}return respondWithRpcPromise('CheckAfterSend',_0x1808('0xa7'),{'FaxAccountId':_[_0x1808('0xa8')](_0x501ec4[_0x1808('0x58')]['id'])?undefined:_0x501ec4['params']['id'],'path':_[_0x1808('0xa8')](_0x501ec4[_0x1808('0x4e')][_0x1808('0xa2')][0x0][_0x1808('0xa9')])?undefined:_0x501ec4[_0x1808('0x4e')]['attachments'][0x0][_0x1808('0xa9')],'fax':_[_0x1808('0xa8')](_0x501ec4['body']['to'][0x0])?undefined:_0x501ec4[_0x1808('0x4e')]['to'][0x0]},client9002);})[_0x1808('0x17')](function(){if(_0x21812f){if(_[_0x1808('0xa8')](_0x501ec4[_0x1808('0x4e')]['from'])){_0x501ec4['body'][_0x1808('0xaa')]=util[_0x1808('0x9d')](_0x1808('0xab'),_0x21812f[_0x1808('0x2f')],_0x21812f[_0x1808('0xac')]);}if(_0x21812f[_0x1808('0xa0')]){if(_0x21812f[_0x1808('0xa0')][_0x1808('0xa1')][_0x1808('0x3c')]){return _0x21812f[_0x1808('0xa0')][_0x1808('0xa1')][0x0];}else{return db['CmContact'][_0x1808('0x4d')](_[_0x1808('0x12')](_0x501ec4[_0x1808('0x4e')],{'firstName':_0x501ec4[_0x1808('0x4e')]['to'][0x0],'phone':_0x501ec4[_0x1808('0x4e')]['to'][0x0],'fax':_0x501ec4[_0x1808('0x4e')]['to'][0x0],'ListId':_0x21812f[_0x1808('0x97')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x1808('0x17')](function(_0x13ae09){if(_0x13ae09){return db[_0x1808('0x67')]['find']({'where':{'ContactId':_0x13ae09['id'],'closed':![],'FaxAccountId':_0x21812f['id']}})[_0x1808('0x17')](function(_0x39e3a9){if(_0x39e3a9){return[_0x39e3a9,![]];}return db[_0x1808('0x67')][_0x1808('0x4d')]({'UserId':_0x501ec4[_0x1808('0x4f')]['id'],'ContactId':_0x13ae09['id'],'FaxAccountId':_0x21812f['id'],'fax':_0x501ec4[_0x1808('0x4e')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x1808('0x41')](_0x501ec4[_0x1808('0x4e')],{'read':![],'body':_0x501ec4[_0x1808('0x4e')]['attachments'][0x0]['filename'],'FaxAccountId':_0x21812f['id'],'UserId':_0x501ec4['user']['id'],'ContactId':_0x13ae09['id'],'AttachmentId':_0x501ec4['body'][_0x1808('0xa2')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x1808('0xad')}]})[_0x1808('0x17')](function(_0x206d1f){return[_0x206d1f,!![]];});});}else{throw new Error(_0x1808('0xae'));}})[_0x1808('0xaf')](function(_0x1289ee,_0x2eeee5){if(_0x2eeee5){return _0x1289ee;}return db['FaxMessage']['create']({'direction':_0x1808('0xb0'),'read':![],'body':_0x501ec4[_0x1808('0x4e')][_0x1808('0xa2')][0x0][_0x1808('0xb1')],'FaxAccountId':_0x21812f['id'],'FaxInteractionId':_0x1289ee['id'],'UserId':_0x501ec4[_0x1808('0x4f')]['id'],'ContactId':_0x1289ee[_0x1808('0xb2')],'AttachmentId':_0x501ec4[_0x1808('0x4e')][_0x1808('0xa2')][0x0]['id']})[_0x1808('0x17')](function(_0xaa9239){_0x1289ee[_0x1808('0xb3')]['Messages']=[];_0x1289ee['dataValues'][_0x1808('0xad')][_0x1808('0x83')](_0xaa9239[_0x1808('0xb3')]);return _0x1289ee;});})[_0x1808('0x17')](function(_0x528f71){respondWithRpcPromise(_0x1808('0xb4'),_0x1808('0xb4'),{'FaxAccountId':_[_0x1808('0xa8')](_0x501ec4[_0x1808('0x58')]['id'])?undefined:_0x501ec4[_0x1808('0x58')]['id'],'path':_[_0x1808('0xa8')](_0x501ec4[_0x1808('0x4e')][_0x1808('0xa2')][0x0][_0x1808('0xa9')])?undefined:_0x501ec4[_0x1808('0x4e')]['attachments'][0x0]['path'],'fax':_[_0x1808('0xa8')](_0x501ec4[_0x1808('0x4e')]['to'][0x0])?undefined:_0x501ec4[_0x1808('0x4e')]['to'][0x0],'AttachmentId':_0x501ec4['body']['attachments'][0x0]['id']},client9002)[_0x1808('0x17')](function(_0x2b557d){logger[_0x1808('0x18')](_0x1808('0xb5'),_0x2b557d);})[_0x1808('0x20')](function(_0xb577db){logger[_0x1808('0x18')](_0x1808('0xb5'),_0xb577db);});return _0x528f71;})[_0x1808('0x17')](respondWithResult(_0x387d2e,null))[_0x1808('0x20')](handleError(_0x387d2e,null));};exports[_0x1808('0xb6')]=function(_0x2c8361,_0x97032e,_0x1ca2ae){return db[_0x1808('0x34')]['find']({'where':{'id':_0x2c8361[_0x1808('0x58')]['id']}})[_0x1808('0x17')](handleEntityNotFound(_0x97032e,null))[_0x1808('0x17')](function(_0x4cccdb){if(_0x4cccdb){return _0x4cccdb[_0x1808('0xb6')](_0x2c8361[_0x1808('0x4e')][_0x1808('0x61')],_[_0x1808('0x68')](_0x2c8361[_0x1808('0x4e')],['ids','id'])||{})[_0x1808('0xaf')](function(_0x34d517){for(var _0x282ff6=0x0;_0x282ff6<_0x2c8361[_0x1808('0x4e')][_0x1808('0x61')][_0x1808('0x3c')];_0x282ff6+=0x1){socket[_0x1808('0xb7')](_0x1808('0xb8'),{'UserId':_0x2c8361[_0x1808('0x4e')][_0x1808('0x61')][_0x282ff6],'FaxAccountId':_0x2c8361[_0x1808('0x58')]['id']});}return _0x34d517;});}})[_0x1808('0x17')](respondWithResult(_0x97032e,null))[_0x1808('0x20')](handleError(_0x97032e,null));};exports[_0x1808('0xb9')]=function(_0x3272cb,_0x349262,_0x5c3000){var _0x237b0c;return db[_0x1808('0x34')][_0x1808('0x53')]({'where':{'id':_0x3272cb['params']['id']}})[_0x1808('0x17')](handleEntityNotFound(_0x349262,null))[_0x1808('0x17')](function(_0x596280){if(_0x596280){return _0x596280['removeAgents'](_0x3272cb['query'][_0x1808('0x61')])[_0x1808('0x17')](function(_0x10eee1){if(_[_0x1808('0xba')](_0x3272cb[_0x1808('0x39')][_0x1808('0x61')])){for(var _0x2ac501=0x0;_0x2ac501<_0x3272cb[_0x1808('0x39')][_0x1808('0x61')][_0x1808('0x3c')];_0x2ac501+=0x1){socket['emit'](_0x1808('0xbb'),{'UserId':_0x3272cb['query'][_0x1808('0x61')][_0x2ac501],'FaxAccountId':_0x3272cb[_0x1808('0x58')]['id']});}}else{socket[_0x1808('0xb7')](_0x1808('0xbb'),{'UserId':_0x3272cb[_0x1808('0x39')]['ids'],'FaxAccountId':_0x3272cb[_0x1808('0x58')]['id']});}});}})[_0x1808('0x17')](respondWithStatusCode(_0x349262,null))[_0x1808('0x20')](handleError(_0x349262,null));};exports[_0x1808('0xbc')]=function(_0x17725a,_0x2bc4b9,_0x3e4e13){var _0x171efd={};var _0x286ce9={};var _0x27c285;var _0x3911f0;return db[_0x1808('0x34')][_0x1808('0x5c')]({'where':{'id':_0x17725a[_0x1808('0x58')]['id']}})[_0x1808('0x17')](handleEntityNotFound(_0x2bc4b9,null))[_0x1808('0x17')](function(_0x33a402){if(_0x33a402){_0x27c285=_0x33a402;_0x286ce9[_0x1808('0x36')]=_[_0x1808('0x4b')](db[_0x1808('0x6c')]['rawAttributes']);_0x286ce9[_0x1808('0x39')]=_[_0x1808('0x4b')](_0x17725a[_0x1808('0x39')]);_0x286ce9[_0x1808('0x37')]=_[_0x1808('0x38')](_0x286ce9[_0x1808('0x36')],_0x286ce9['query']);_0x171efd[_0x1808('0x3a')]=_[_0x1808('0x38')](_0x286ce9[_0x1808('0x36')],qs[_0x1808('0x3b')](_0x17725a[_0x1808('0x39')]['fields']));_0x171efd['attributes']=_0x171efd[_0x1808('0x3a')]['length']?_0x171efd['attributes']:_0x286ce9[_0x1808('0x36')];_0x171efd['order']=qs[_0x1808('0x3d')](_0x17725a[_0x1808('0x39')]['sort']);_0x171efd[_0x1808('0x40')]=qs[_0x1808('0x37')](_[_0x1808('0x3e')](_0x17725a['query'],_0x286ce9['filters']));if(_0x17725a[_0x1808('0x39')][_0x1808('0x3f')]){_0x171efd['where']=_[_0x1808('0x41')](_0x171efd[_0x1808('0x40')],{'$or':_[_0x1808('0x42')](_0x171efd['attributes'],function(_0x489eea){var _0x17efbd={};_0x17efbd[_0x489eea]={'$like':'%'+_0x17725a[_0x1808('0x39')][_0x1808('0x3f')]+'%'};return _0x17efbd;})});}_0x171efd=_[_0x1808('0x41')]({},_0x171efd,_0x17725a[_0x1808('0x46')]);return _0x27c285[_0x1808('0xbc')](_0x171efd);}})['then'](function(_0x44d058){if(_0x44d058){_0x3911f0=_0x44d058[_0x1808('0x3c')];if(!_0x17725a[_0x1808('0x39')][_0x1808('0x5e')](_0x1808('0x64'))){_0x171efd['limit']=qs[_0x1808('0x26')](_0x17725a['query'][_0x1808('0x26')]);_0x171efd[_0x1808('0x25')]=qs['offset'](_0x17725a[_0x1808('0x39')][_0x1808('0x25')]);}return _0x27c285['getAgents'](_0x171efd);}})['then'](function(_0x880efa){if(_0x880efa){return _0x880efa?{'count':_0x3911f0,'rows':_0x880efa}:null;}})[_0x1808('0x17')](respondWithResult(_0x2bc4b9,null))[_0x1808('0x20')](handleError(_0x2bc4b9,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 5cab214..8a11b4a 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 _0x0c64=['FaxAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1b128b,_0x5791cc){var _0xac08a6=function(_0x13168e){while(--_0x13168e){_0x1b128b['push'](_0x1b128b['shift']());}};_0xac08a6(++_0x5791cc);}(_0x0c64,0xd0));var _0x40c6=function(_0x1812fd,_0x1b13ce){_0x1812fd=_0x1812fd-0x0;var _0x3a6c02=_0x0c64[_0x1812fd];return _0x3a6c02;};'use strict';var EventEmitter=require(_0x40c6('0x0'));var FaxAccount=require(_0x40c6('0x1'))['db'][_0x40c6('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x40c6('0x3')](0x0);var events={'afterCreate':_0x40c6('0x4'),'afterUpdate':'update','afterDestroy':_0x40c6('0x5')};function emitEvent(_0x31d35b){return function(_0x3d633c,_0x9a5e69,_0x310ab6){FaxAccountEvents[_0x40c6('0x6')](_0x31d35b+':'+_0x3d633c['id'],_0x3d633c);FaxAccountEvents['emit'](_0x31d35b,_0x3d633c);_0x310ab6(null);};}for(var e in events){if(events[_0x40c6('0x7')](e)){var event=events[e];FaxAccount[_0x40c6('0x8')](e,emitEvent(event));}}module[_0x40c6('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0xea03=['hook','exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x58c851,_0x1f3d96){var _0x534d8a=function(_0x10c1a0){while(--_0x10c1a0){_0x58c851['push'](_0x58c851['shift']());}};_0x534d8a(++_0x1f3d96);}(_0xea03,0x172));var _0x3ea0=function(_0x2749b8,_0x570e1c){_0x2749b8=_0x2749b8-0x0;var _0x589657=_0xea03[_0x2749b8];return _0x589657;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x3ea0('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3ea0('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3ea0('0x2'),'afterDestroy':_0x3ea0('0x3')};function emitEvent(_0x56032a){return function(_0x330743,_0x101393,_0x326d26){FaxAccountEvents[_0x3ea0('0x4')](_0x56032a+':'+_0x330743['id'],_0x330743);FaxAccountEvents[_0x3ea0('0x4')](_0x56032a,_0x330743);_0x326d26(null);};}for(var e in events){if(events[_0x3ea0('0x5')](e)){var event=events[e];FaxAccount[_0x3ea0('0x6')](e,emitEvent(event));}}module[_0x3ea0('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 5f44f0d..d45426c 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 _0xecd8=['api','moment','bluebird','request-promise','./faxAccount.attributes','FaxAccount','lodash','../../config/logger'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0xecd8,0x6e));var _0x8ecd=function(_0x249ec3,_0x20e3f9){_0x249ec3=_0x249ec3-0x0;var _0x35b5df=_0xecd8[_0x249ec3];return _0x35b5df;};'use strict';var _=require(_0x8ecd('0x0'));var util=require('util');var logger=require(_0x8ecd('0x1'))(_0x8ecd('0x2'));var moment=require(_0x8ecd('0x3'));var BPromise=require(_0x8ecd('0x4'));var rp=require(_0x8ecd('0x5'));var attributes=require(_0x8ecd('0x6'));module['exports']=function(_0x4ee7e4,_0x4ce654){return _0x4ee7e4['define'](_0x8ecd('0x7'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5879=['util','../../config/logger','api','moment','bluebird','request-promise','exports','define','FaxAccount','fax_accounts','lodash'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x5879,0xdb));var _0x9587=function(_0x2c1bba,_0x5a8fb5){_0x2c1bba=_0x2c1bba-0x0;var _0xdb2f28=_0x5879[_0x2c1bba];return _0xdb2f28;};'use strict';var _=require(_0x9587('0x0'));var util=require(_0x9587('0x1'));var logger=require(_0x9587('0x2'))(_0x9587('0x3'));var moment=require(_0x9587('0x4'));var BPromise=require(_0x9587('0x5'));var rp=require(_0x9587('0x6'));var attributes=require('./faxAccount.attributes');module[_0x9587('0x7')]=function(_0x5b5c55,_0x2bde62){return _0x5b5c55[_0x9587('0x8')](_0x9587('0x9'),attributes,{'tableName':_0x9587('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 f7d6b45..d172a15 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 _0x8671=['no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','CmList','List','Contacts','DESC','FaxApplication','get','account','applications','orderBy','priority','asc','Applications','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','created','interaction','ContactId','AttachmentId','UserId','User','name','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','body','fax','CmContact','Sequelize'];(function(_0x22141d,_0x1af6d5){var _0x3991a4=function(_0x258c28){while(--_0x258c28){_0x22141d['push'](_0x22141d['shift']());}};_0x3991a4(++_0x1af6d5);}(_0x8671,0x1ed));var _0x1867=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x8671[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x1867('0x0'));var util=require('util');var moment=require(_0x1867('0x1'));var BPromise=require(_0x1867('0x2'));var rs=require(_0x1867('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1867('0x4'))['db'];var utils=require(_0x1867('0x5'));var logger=require(_0x1867('0x6'))(_0x1867('0x7'));var config=require('../../config/environment');var jayson=require(_0x1867('0x8'));var client=jayson['client'][_0x1867('0x9')]({'port':0x232c});config[_0x1867('0xa')]=_['defaults'](config['redis'],{'host':_0x1867('0xb'),'port':0x18eb});var socket=require(_0x1867('0xc'))(new Redis(config[_0x1867('0xa')]));require('./faxAccount.socket')[_0x1867('0xd')](socket);function respondWithRpcPromise(_0xae2eb3,_0x15d371,_0xb21031){return new BPromise(function(_0x496de5,_0x325389){return client[_0x1867('0xe')](_0xae2eb3,_0xb21031)[_0x1867('0xf')](function(_0x3183c8){logger['info'](_0x1867('0x10'),_0x15d371,_0x1867('0x11'));logger[_0x1867('0x12')](_0x1867('0x13'),_0x15d371,_0x1867('0x11'),JSON[_0x1867('0x14')](_0x3183c8));if(_0x3183c8[_0x1867('0x15')]){if(_0x3183c8[_0x1867('0x15')]['code']===0x1f4){logger[_0x1867('0x15')](_0x1867('0x10'),_0x15d371,_0x3183c8[_0x1867('0x15')]['message']);return _0x325389(_0x3183c8[_0x1867('0x15')]['message']);}logger[_0x1867('0x15')](_0x1867('0x10'),_0x15d371,_0x3183c8[_0x1867('0x15')][_0x1867('0x16')]);return _0x496de5(_0x3183c8['error']['message']);}else{logger[_0x1867('0x17')](_0x1867('0x10'),_0x15d371,_0x1867('0x11'));_0x496de5(_0x3183c8[_0x1867('0x18')][_0x1867('0x16')]);}})[_0x1867('0x19')](function(_0x28d580){logger[_0x1867('0x15')]('FaxAccount,\x20%s,\x20%s',_0x15d371,_0x28d580);_0x325389(_0x28d580);});});}exports['GetFaxAccount']=function(_0x4cfc93){var _0x426c08=this;return new Promise(function(_0x110237,_0x98541b){return db[_0x1867('0x1a')][_0x1867('0x1b')]({'raw':_0x4cfc93['options']?_0x4cfc93[_0x1867('0x1c')][_0x1867('0x1d')]===undefined?!![]:![]:!![],'where':_0x4cfc93[_0x1867('0x1c')]?_0x4cfc93['options']['where']||null:null,'attributes':_0x4cfc93[_0x1867('0x1c')]?_0x4cfc93[_0x1867('0x1c')][_0x1867('0x1e')]||null:null,'limit':_0x4cfc93[_0x1867('0x1c')]?_0x4cfc93[_0x1867('0x1c')][_0x1867('0x1f')]||null:null,'include':_0x4cfc93[_0x1867('0x1c')]?_0x4cfc93['options'][_0x1867('0x20')]?_[_0x1867('0x21')](_0x4cfc93[_0x1867('0x1c')][_0x1867('0x20')],function(_0x487bee){return{'model':db[_0x487bee[_0x1867('0x22')]],'as':_0x487bee['as'],'attributes':_0x487bee[_0x1867('0x1e')],'include':_0x487bee[_0x1867('0x20')]?_[_0x1867('0x21')](_0x487bee[_0x1867('0x20')],function(_0x403273){return{'model':db[_0x403273[_0x1867('0x22')]],'as':_0x403273['as'],'attributes':_0x403273[_0x1867('0x1e')],'include':_0x403273['include']?_[_0x1867('0x21')](_0x403273[_0x1867('0x20')],function(_0x58d058){return{'model':db[_0x58d058[_0x1867('0x22')]],'as':_0x58d058['as'],'attributes':_0x58d058[_0x1867('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1867('0xf')](function(_0x12d368){logger[_0x1867('0x17')](_0x1867('0x23'),_0x4cfc93);logger[_0x1867('0x12')](_0x1867('0x23'),_0x4cfc93,JSON[_0x1867('0x14')](_0x12d368));_0x110237(_0x12d368);})[_0x1867('0x19')](function(_0x4ff044){logger[_0x1867('0x15')](_0x1867('0x23'),_0x4ff044[_0x1867('0x16')],_0x4cfc93);_0x98541b(_0x426c08[_0x1867('0x15')](0x1f4,_0x4ff044[_0x1867('0x16')]));});});};exports[_0x1867('0x24')]=function(_0xaaf378,_0x5af0ed,_0x342f8e){var _0x342055=this;return new Promise(function(_0x5a4b9a,_0x596bc9){var _0x124c03={'body':_0xaaf378[_0x1867('0x25')],'channel':_0x1867('0x26')};var _0x4e1a4e=[];var _0xa64418=[];var _0x254da9={};return db[_0x1867('0x27')]['describe']()[_0x1867('0xf')](function(_0x475769){if(!_0x475769){throw new db[(_0x1867('0x28'))]['ValidationError'](_0x1867('0x29'));}_0x4e1a4e=_[_0x1867('0x2a')](_[_0x1867('0x2b')](_0x475769),['createdAt',_0x1867('0x2c')]);_0xa64418=_[_0x1867('0x2a')](_[_0x1867('0x2b')](_0x475769),[_0x1867('0x2d'),_0x1867('0x2c'),_0x1867('0x2e'),_0x1867('0x2f')]);if(_0xaaf378['body']['id']){delete _0xaaf378['body']['id'];}if(_[_0x1867('0x30')](_0xaaf378[_0x1867('0x25')][_0x1867('0x31')])){throw new db[(_0x1867('0x28'))]['ValidationError'](_0x1867('0x32'));}if(_[_0x1867('0x30')](_0xaaf378['body'][_0x1867('0x25')])||_0xaaf378[_0x1867('0x25')][_0x1867('0x25')]===''){throw new db[(_0x1867('0x28'))][(_0x1867('0x33'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1867('0x30')](_0xaaf378[_0x1867('0x25')][_0x1867('0x34')])){throw new db['Sequelize'][(_0x1867('0x33'))](_0x1867('0x35')+_0xa64418);}if(!_[_0x1867('0x36')](_0xa64418,_0xaaf378[_0x1867('0x25')][_0x1867('0x34')])){throw new db[(_0x1867('0x28'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xa64418);}_0x254da9[_0xaaf378[_0x1867('0x25')][_0x1867('0x34')]]=_0xaaf378[_0x1867('0x25')][_0x1867('0x31')];})[_0x1867('0xf')](function(){return db[_0x1867('0x1a')][_0x1867('0x37')]({'where':{'id':_0xaaf378['account']['id']},'include':[{'model':db[_0x1867('0x38')],'as':_0x1867('0x39'),'include':[{'model':db[_0x1867('0x27')],'as':_0x1867('0x3a'),'where':_0x254da9,'limit':0x1,'order':[[_0x1867('0x2c'),_0x1867('0x3b')]]}]},{'model':db[_0x1867('0x3c')],'as':'Applications'}]});})['then'](function(_0x512a9a){if(_0x512a9a&&_0x512a9a[_0x1867('0x39')]){var _0x21dce0=_0x512a9a[_0x1867('0x3d')]({'plain':!![]});_0x124c03[_0x1867('0x3e')]=_0x21dce0;_0x124c03[_0x1867('0x3f')]=_0x21dce0['Applications'];_0x124c03['list']=_0x21dce0[_0x1867('0x39')];_0x124c03[_0x1867('0x3f')]=_[_0x1867('0x40')](_0x124c03['applications'],[_0x1867('0x41')],[_0x1867('0x42')]);if(_0x124c03[_0x1867('0x3e')][_0x1867('0x43')]){delete _0x124c03[_0x1867('0x3e')][_0x1867('0x43')];}if(_0x124c03['account'][_0x1867('0x39')]&&_0x124c03[_0x1867('0x3e')][_0x1867('0x39')][_0x1867('0x3a')][_0x1867('0x44')]){return _0x124c03[_0x1867('0x3e')]['List']['Contacts'][0x0];}var _0x1bfe5f=_['defaults'](_0xaaf378['body'],{'firstName':_0xaaf378[_0x1867('0x25')][_0x1867('0x31')],'ListId':_0x21dce0[_0x1867('0x2f')]});_0x1bfe5f[_0xaaf378[_0x1867('0x25')][_0x1867('0x34')]]=_0xaaf378[_0x1867('0x25')][_0x1867('0x31')];return db[_0x1867('0x27')][_0x1867('0x45')](_0x1bfe5f,{'fields':_0x4e1a4e,'raw':!![]});}})['then'](function(_0x4b1ab2){_0x124c03[_0x1867('0x46')]=_0x4b1ab2;if(_0x4b1ab2){var _0x1d9c4e={'ContactId':_0x4b1ab2['id'],'FaxAccountId':_0xaaf378[_0x1867('0x3e')]['id'],'fax':_0x4b1ab2[_0x1867('0x26')]};return db[_0x1867('0x47')][_0x1867('0x37')]({'where':{'ContactId':_0x4b1ab2['id'],'closed':![],'FaxAccountId':_0xaaf378[_0x1867('0x3e')]['id']}})['then'](function(_0x31233e){if(_0x31233e){return[_0x31233e,![]];}return db[_0x1867('0x47')][_0x1867('0x45')](_0x1d9c4e)[_0x1867('0xf')](function(_0x345d45){return[_0x345d45,!![]];});});}else{throw new Error(_0x1867('0x48'));}})[_0x1867('0x49')](function(_0x39f7bc,_0x38f0bf){var _0x5b4018=_0x39f7bc[_0x1867('0x3d')]({'plain':!![]});if(_0x38f0bf){if(_0x124c03[_0x1867('0x3e')][_0x1867('0x4a')]){_0x124c03[_0x1867('0x3f')][_0x1867('0x4b')]({'id':0x0,'priority':_0x124c03[_0x1867('0x3f')]['length']+0x1,'app':_0x1867('0x4c'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x5b4018[_0x1867('0x4d')]=!![];}else{_0x5b4018[_0x1867('0x4d')]=![];}_0x124c03[_0x1867('0x4e')]=_0x5b4018;return db['FaxMessage'][_0x1867('0x45')]({'body':_0xaaf378[_0x1867('0x25')][_0x1867('0x25')],'FaxAccountId':_0xaaf378['account']['id'],'FaxInteractionId':_0x39f7bc['id'],'direction':'in','ContactId':_0x39f7bc[_0x1867('0x4f')],'AttachmentId':_0xaaf378[_0x1867('0x25')][_0x1867('0x50')]});})[_0x1867('0xf')](function(_0x46c420){_0x124c03['message']=_0x46c420;if(_0x124c03[_0x1867('0x4e')][_0x1867('0x51')]){return db[_0x1867('0x52')][_0x1867('0x37')]({'attributes':['id',_0x1867('0x53')],'where':{'id':_0x124c03[_0x1867('0x4e')][_0x1867('0x51')]}})[_0x1867('0xf')](function(_0x205cb3){if(_0x205cb3){_0x124c03[_0x1867('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1867('0x54'),'appdata':_0x205cb3['name']+','+(_0x124c03[_0x1867('0x3e')][_0x1867('0x55')]||0xa),'interval':_0x1867('0x56')});}return respondWithRpcPromise('Start',_0x1867('0x57'),_0x124c03);});}return respondWithRpcPromise(_0x1867('0x58'),_0x1867('0x57'),_0x124c03);})[_0x1867('0xf')](function(_0x33dcdd){_0x5a4b9a(_0x33dcdd);})['catch'](function(_0x13b6d1){_0x596bc9(_0x342055[_0x1867('0x15')](0x1f4,_0x13b6d1[_0x1867('0x16')]));});});}; \ No newline at end of file +var _0x7d47=['body','fax','CmContact','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','create','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','socket.io-emitter','redis','./faxAccount.socket','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','where','include','model','attributes','map','NotifyFaxAccount'];(function(_0x16cce2,_0xf470d4){var _0x213186=function(_0x5dd339){while(--_0x5dd339){_0x16cce2['push'](_0x16cce2['shift']());}};_0x213186(++_0xf470d4);}(_0x7d47,0x149));var _0x77d4=function(_0x5f0d5c,_0x5761ca){_0x5f0d5c=_0x5f0d5c-0x0;var _0x3f992d=_0x7d47[_0x5f0d5c];return _0x3f992d;};'use strict';var _=require('lodash');var util=require(_0x77d4('0x0'));var moment=require(_0x77d4('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77d4('0x2'));var db=require(_0x77d4('0x3'))['db'];var utils=require(_0x77d4('0x4'));var logger=require(_0x77d4('0x5'))(_0x77d4('0x6'));var config=require('../../config/environment');var jayson=require(_0x77d4('0x7'));var client=jayson['client'][_0x77d4('0x8')]({'port':0x232c});config['redis']=_[_0x77d4('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x77d4('0xa'))(new Redis(config[_0x77d4('0xb')]));require(_0x77d4('0xc'))['register'](socket);function respondWithRpcPromise(_0x58e2f9,_0x24525a,_0x12d181){return new BPromise(function(_0x2aca0b,_0x69516c){return client['request'](_0x58e2f9,_0x12d181)[_0x77d4('0xd')](function(_0x381a16){logger[_0x77d4('0xe')](_0x77d4('0xf'),_0x24525a,'request\x20sent');logger[_0x77d4('0x10')](_0x77d4('0x11'),_0x24525a,_0x77d4('0x12'),JSON[_0x77d4('0x13')](_0x381a16));if(_0x381a16[_0x77d4('0x14')]){if(_0x381a16['error'][_0x77d4('0x15')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x24525a,_0x381a16['error']['message']);return _0x69516c(_0x381a16[_0x77d4('0x14')]['message']);}logger['error'](_0x77d4('0xf'),_0x24525a,_0x381a16['error']['message']);return _0x2aca0b(_0x381a16['error'][_0x77d4('0x16')]);}else{logger[_0x77d4('0xe')](_0x77d4('0xf'),_0x24525a,'request\x20sent');_0x2aca0b(_0x381a16[_0x77d4('0x17')][_0x77d4('0x16')]);}})[_0x77d4('0x18')](function(_0x3df6b4){logger['error'](_0x77d4('0xf'),_0x24525a,_0x3df6b4);_0x69516c(_0x3df6b4);});});}exports[_0x77d4('0x19')]=function(_0x1775de){var _0x553faa=this;return new Promise(function(_0x4d1dd5,_0x3da014){return db['FaxAccount'][_0x77d4('0x1a')]({'raw':_0x1775de[_0x77d4('0x1b')]?_0x1775de[_0x77d4('0x1b')][_0x77d4('0x1c')]===undefined?!![]:![]:!![],'where':_0x1775de[_0x77d4('0x1b')]?_0x1775de[_0x77d4('0x1b')][_0x77d4('0x1d')]||null:null,'attributes':_0x1775de['options']?_0x1775de['options']['attributes']||null:null,'limit':_0x1775de[_0x77d4('0x1b')]?_0x1775de['options']['limit']||null:null,'include':_0x1775de[_0x77d4('0x1b')]?_0x1775de[_0x77d4('0x1b')][_0x77d4('0x1e')]?_['map'](_0x1775de[_0x77d4('0x1b')][_0x77d4('0x1e')],function(_0x1f91b0){return{'model':db[_0x1f91b0[_0x77d4('0x1f')]],'as':_0x1f91b0['as'],'attributes':_0x1f91b0[_0x77d4('0x20')],'include':_0x1f91b0[_0x77d4('0x1e')]?_[_0x77d4('0x21')](_0x1f91b0[_0x77d4('0x1e')],function(_0x3ee515){return{'model':db[_0x3ee515[_0x77d4('0x1f')]],'as':_0x3ee515['as'],'attributes':_0x3ee515['attributes'],'include':_0x3ee515['include']?_[_0x77d4('0x21')](_0x3ee515[_0x77d4('0x1e')],function(_0x509895){return{'model':db[_0x509895[_0x77d4('0x1f')]],'as':_0x509895['as'],'attributes':_0x509895['attributes']};}):[]};}):[]};}):[]:[]})[_0x77d4('0xd')](function(_0x3f0f20){logger[_0x77d4('0xe')]('GetFaxAccount',_0x1775de);logger['debug'](_0x77d4('0x19'),_0x1775de,JSON[_0x77d4('0x13')](_0x3f0f20));_0x4d1dd5(_0x3f0f20);})['catch'](function(_0x1b18f4){logger['error'](_0x77d4('0x19'),_0x1b18f4['message'],_0x1775de);_0x3da014(_0x553faa[_0x77d4('0x14')](0x1f4,_0x1b18f4[_0x77d4('0x16')]));});});};exports[_0x77d4('0x22')]=function(_0xb6c02f,_0x347790,_0x6bffe7){var _0x2dc6b2=this;return new Promise(function(_0x176248,_0x3e66f2){var _0x26affe={'body':_0xb6c02f[_0x77d4('0x23')],'channel':_0x77d4('0x24')};var _0x1c2beb=[];var _0x2383d9=[];var _0x3163cb={};return db[_0x77d4('0x25')]['describe']()['then'](function(_0x152f0a){if(!_0x152f0a){throw new db[(_0x77d4('0x26'))]['ValidationError'](_0x77d4('0x27'));}_0x1c2beb=_[_0x77d4('0x28')](_[_0x77d4('0x29')](_0x152f0a),[_0x77d4('0x2a'),_0x77d4('0x2b')]);_0x2383d9=_['difference'](_['keys'](_0x152f0a),[_0x77d4('0x2a'),_0x77d4('0x2b'),_0x77d4('0x2c'),_0x77d4('0x2d')]);if(_0xb6c02f[_0x77d4('0x23')]['id']){delete _0xb6c02f['body']['id'];}if(_[_0x77d4('0x2e')](_0xb6c02f['body'][_0x77d4('0x2f')])){throw new db[(_0x77d4('0x26'))][(_0x77d4('0x30'))](_0x77d4('0x31'));}if(_[_0x77d4('0x2e')](_0xb6c02f[_0x77d4('0x23')][_0x77d4('0x23')])||_0xb6c02f[_0x77d4('0x23')]['body']===''){throw new db[(_0x77d4('0x26'))][(_0x77d4('0x30'))](_0x77d4('0x32'));}if(_[_0x77d4('0x2e')](_0xb6c02f[_0x77d4('0x23')][_0x77d4('0x33')])){throw new db[(_0x77d4('0x26'))][(_0x77d4('0x30'))](_0x77d4('0x34')+_0x2383d9);}if(!_['includes'](_0x2383d9,_0xb6c02f[_0x77d4('0x23')][_0x77d4('0x33')])){throw new db[(_0x77d4('0x26'))][(_0x77d4('0x30'))](_0x77d4('0x35')+_0x2383d9);}_0x3163cb[_0xb6c02f[_0x77d4('0x23')][_0x77d4('0x33')]]=_0xb6c02f['body'][_0x77d4('0x2f')];})[_0x77d4('0xd')](function(){return db[_0x77d4('0x36')]['find']({'where':{'id':_0xb6c02f[_0x77d4('0x37')]['id']},'include':[{'model':db[_0x77d4('0x38')],'as':_0x77d4('0x39'),'include':[{'model':db[_0x77d4('0x25')],'as':_0x77d4('0x3a'),'where':_0x3163cb,'limit':0x1,'order':[[_0x77d4('0x2b'),_0x77d4('0x3b')]]}]},{'model':db[_0x77d4('0x3c')],'as':_0x77d4('0x3d')}]});})[_0x77d4('0xd')](function(_0x19ccfa){if(_0x19ccfa&&_0x19ccfa[_0x77d4('0x39')]){var _0x27f6d3=_0x19ccfa[_0x77d4('0x3e')]({'plain':!![]});_0x26affe['account']=_0x27f6d3;_0x26affe[_0x77d4('0x3f')]=_0x27f6d3[_0x77d4('0x3d')];_0x26affe[_0x77d4('0x40')]=_0x27f6d3[_0x77d4('0x39')];_0x26affe[_0x77d4('0x3f')]=_[_0x77d4('0x41')](_0x26affe['applications'],[_0x77d4('0x42')],[_0x77d4('0x43')]);if(_0x26affe[_0x77d4('0x37')]['Applications']){delete _0x26affe['account'][_0x77d4('0x3d')];}if(_0x26affe['account']['List']&&_0x26affe['account']['List'][_0x77d4('0x3a')][_0x77d4('0x44')]){return _0x26affe[_0x77d4('0x37')][_0x77d4('0x39')][_0x77d4('0x3a')][0x0];}var _0xc22bc7=_[_0x77d4('0x9')](_0xb6c02f['body'],{'firstName':_0xb6c02f['body'][_0x77d4('0x2f')],'ListId':_0x27f6d3[_0x77d4('0x2d')]});_0xc22bc7[_0xb6c02f['body']['mapKey']]=_0xb6c02f[_0x77d4('0x23')][_0x77d4('0x2f')];return db[_0x77d4('0x25')][_0x77d4('0x45')](_0xc22bc7,{'fields':_0x1c2beb,'raw':!![]});}})[_0x77d4('0xd')](function(_0x2cfac9){_0x26affe['contact']=_0x2cfac9;if(_0x2cfac9){var _0xbf0d0a={'ContactId':_0x2cfac9['id'],'FaxAccountId':_0xb6c02f[_0x77d4('0x37')]['id'],'fax':_0x2cfac9[_0x77d4('0x24')]};return db[_0x77d4('0x46')][_0x77d4('0x47')]({'where':{'ContactId':_0x2cfac9['id'],'closed':![],'FaxAccountId':_0xb6c02f[_0x77d4('0x37')]['id']}})[_0x77d4('0xd')](function(_0x459ce8){if(_0x459ce8){return[_0x459ce8,![]];}return db[_0x77d4('0x46')][_0x77d4('0x45')](_0xbf0d0a)[_0x77d4('0xd')](function(_0x436361){return[_0x436361,!![]];});});}else{throw new Error(_0x77d4('0x48'));}})[_0x77d4('0x49')](function(_0x19399d,_0x6cdb6f){var _0x11d39e=_0x19399d[_0x77d4('0x3e')]({'plain':!![]});if(_0x6cdb6f){if(_0x26affe[_0x77d4('0x37')][_0x77d4('0x4a')]){_0x26affe[_0x77d4('0x3f')][_0x77d4('0x4b')]({'id':0x0,'priority':_0x26affe[_0x77d4('0x3f')][_0x77d4('0x44')]+0x1,'app':_0x77d4('0x4c'),'appdata':_0x77d4('0x4d'),'interval':_0x77d4('0x4e')});}_0x11d39e[_0x77d4('0x4f')]=!![];}else{_0x11d39e[_0x77d4('0x4f')]=![];}_0x26affe[_0x77d4('0x50')]=_0x11d39e;return db[_0x77d4('0x51')][_0x77d4('0x45')]({'body':_0xb6c02f['body'][_0x77d4('0x23')],'FaxAccountId':_0xb6c02f['account']['id'],'FaxInteractionId':_0x19399d['id'],'direction':'in','ContactId':_0x19399d[_0x77d4('0x52')],'AttachmentId':_0xb6c02f['body'][_0x77d4('0x53')]});})[_0x77d4('0xd')](function(_0x34048f){_0x26affe['message']=_0x34048f;if(_0x26affe['interaction'][_0x77d4('0x54')]){return db[_0x77d4('0x55')][_0x77d4('0x47')]({'attributes':['id',_0x77d4('0x56')],'where':{'id':_0x26affe[_0x77d4('0x50')][_0x77d4('0x54')]}})[_0x77d4('0xd')](function(_0x2aeb23){if(_0x2aeb23){_0x26affe[_0x77d4('0x3f')][_0x77d4('0x57')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2aeb23[_0x77d4('0x56')]+','+(_0x26affe[_0x77d4('0x37')][_0x77d4('0x58')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x77d4('0x59'),_0x77d4('0x5a'),_0x26affe);});}return respondWithRpcPromise(_0x77d4('0x59'),_0x77d4('0x5a'),_0x26affe);})[_0x77d4('0xd')](function(_0x6f95f0){_0x176248(_0x6f95f0);})['catch'](function(_0xd0bc64){_0x3e66f2(_0x2dc6b2[_0x77d4('0x14')](0x1f4,_0xd0bc64[_0x77d4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index c4fc6d4..1744645 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 _0xacec=['update','emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove'];(function(_0x51b651,_0x66b2){var _0x5c2efb=function(_0x31cac1){while(--_0x31cac1){_0x51b651['push'](_0x51b651['shift']());}};_0x5c2efb(++_0x66b2);}(_0xacec,0xde));var _0xcace=function(_0x215e5f,_0x321e4f){_0x215e5f=_0x215e5f-0x0;var _0x4ba505=_0xacec[_0x215e5f];return _0x4ba505;};'use strict';var FaxAccountEvents=require(_0xcace('0x0'));var events=[_0xcace('0x1'),_0xcace('0x2'),_0xcace('0x3')];function createListener(_0x3f33c4,_0xa7e71e){return function(_0x8e0ea1){_0xa7e71e[_0xcace('0x4')](_0x3f33c4,_0x8e0ea1);};}function removeListener(_0x217d3b,_0x37e54c){return function(){FaxAccountEvents[_0xcace('0x5')](_0x217d3b,_0x37e54c);};}exports[_0xcace('0x6')]=function(_0x587bed){for(var _0x458eea=0x0,_0x4e6545=events[_0xcace('0x7')];_0x458eea<_0x4e6545;_0x458eea++){var _0x3d475f=events[_0x458eea];var _0x25d5e3=createListener(_0xcace('0x8')+_0x3d475f,_0x587bed);FaxAccountEvents['on'](_0x3d475f,_0x25d5e3);}}; \ No newline at end of file +var _0xc2c1=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x3f68ef,_0x438edb){var _0x18786a=function(_0x75ca){while(--_0x75ca){_0x3f68ef['push'](_0x3f68ef['shift']());}};_0x18786a(++_0x438edb);}(_0xc2c1,0x125));var _0x1c2c=function(_0x2cd243,_0x495418){_0x2cd243=_0x2cd243-0x0;var _0x2a95d2=_0xc2c1[_0x2cd243];return _0x2a95d2;};'use strict';var FaxAccountEvents=require(_0x1c2c('0x0'));var events=[_0x1c2c('0x1'),_0x1c2c('0x2'),_0x1c2c('0x3')];function createListener(_0x552813,_0x4730d5){return function(_0x164fe3){_0x4730d5[_0x1c2c('0x4')](_0x552813,_0x164fe3);};}function removeListener(_0x16bf49,_0x52774a){return function(){FaxAccountEvents[_0x1c2c('0x5')](_0x16bf49,_0x52774a);};}exports[_0x1c2c('0x6')]=function(_0x3249a0){for(var _0x4ec744=0x0,_0x5b1b63=events[_0x1c2c('0x7')];_0x4ec744<_0x5b1b63;_0x4ec744++){var _0x243ba5=events[_0x4ec744];var _0x42ad78=createListener(_0x1c2c('0x8')+_0x243ba5,_0x3249a0);FaxAccountEvents['on'](_0x243ba5,_0x42ad78);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 177675f..e102c7d 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 _0x9460=['post','create','addDisposition','addInteraction','/:id/applications','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getApplications','getMessages','/:id/users'];(function(_0x5b1059,_0x46fd2f){var _0x5c70bd=function(_0x297ec7){while(--_0x297ec7){_0x5b1059['push'](_0x5b1059['shift']());}};_0x5c70bd(++_0x46fd2f);}(_0x9460,0x131));var _0x0946=function(_0x3ae644,_0x3cfaed){_0x3ae644=_0x3ae644-0x0;var _0x2061fc=_0x9460[_0x3ae644];return _0x2061fc;};'use strict';var multer=require(_0x0946('0x0'));var util=require(_0x0946('0x1'));var path=require(_0x0946('0x2'));var timeout=require('connect-timeout');var express=require(_0x0946('0x3'));var router=express[_0x0946('0x4')]();var auth=require(_0x0946('0x5'));var interaction=require(_0x0946('0x6'));var config=require('../../config/environment');var controller=require(_0x0946('0x7'));router[_0x0946('0x8')]('/',auth[_0x0946('0x9')](),controller[_0x0946('0xa')]);router[_0x0946('0x8')](_0x0946('0xb'),auth[_0x0946('0x9')](),controller[_0x0946('0xc')]);router['get'](_0x0946('0xd'),auth[_0x0946('0x9')](),controller[_0x0946('0xe')]);router['get'](_0x0946('0xf'),auth['isAuthenticated'](),controller[_0x0946('0x10')]);router[_0x0946('0x8')](_0x0946('0x11'),auth['isAuthenticated'](),controller[_0x0946('0x12')]);router[_0x0946('0x8')](_0x0946('0x13'),auth[_0x0946('0x9')](),controller['getInteractions']);router[_0x0946('0x8')]('/:id/applications',auth[_0x0946('0x9')](),controller[_0x0946('0x14')]);router[_0x0946('0x8')]('/:id/messages',auth[_0x0946('0x9')](),controller[_0x0946('0x15')]);router[_0x0946('0x8')](_0x0946('0x16'),auth[_0x0946('0x9')](),controller['getAgents']);router[_0x0946('0x17')]('/',auth[_0x0946('0x9')](),controller[_0x0946('0x18')]);router[_0x0946('0x17')]('/:id/dispositions',auth[_0x0946('0x9')](),controller[_0x0946('0x19')]);router[_0x0946('0x17')](_0x0946('0x11'),auth[_0x0946('0x9')](),controller['addAnswer']);router[_0x0946('0x17')](_0x0946('0x13'),auth['isAuthenticated'](),controller[_0x0946('0x1a')]);router[_0x0946('0x17')](_0x0946('0x1b'),auth[_0x0946('0x9')](),controller[_0x0946('0x1c')]);router[_0x0946('0x17')]('/addaccountapplications',auth[_0x0946('0x9')](),controller[_0x0946('0x1d')]);router[_0x0946('0x17')](_0x0946('0x1e'),auth[_0x0946('0x9')](),controller['updateAccountApplications']);router[_0x0946('0x17')](_0x0946('0x1f'),auth['isAuthenticated'](),controller['send']);router[_0x0946('0x17')]('/:id/users',auth[_0x0946('0x9')](),controller[_0x0946('0x20')]);router[_0x0946('0x21')](_0x0946('0xd'),auth[_0x0946('0x9')](),controller[_0x0946('0x22')]);router[_0x0946('0x23')](_0x0946('0xd'),auth[_0x0946('0x9')](),controller[_0x0946('0x24')]);router[_0x0946('0x23')]('/:id/dispositions',auth[_0x0946('0x9')](),controller[_0x0946('0x25')]);router[_0x0946('0x23')](_0x0946('0x11'),auth[_0x0946('0x9')](),controller[_0x0946('0x26')]);router[_0x0946('0x23')](_0x0946('0x16'),auth[_0x0946('0x9')](),controller[_0x0946('0x27')]);module[_0x0946('0x28')]=router; \ No newline at end of file +var _0x89ef=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','create','post','addDisposition','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express'];(function(_0x122bb9,_0x334139){var _0x1303f3=function(_0xcbbb21){while(--_0xcbbb21){_0x122bb9['push'](_0x122bb9['shift']());}};_0x1303f3(++_0x334139);}(_0x89ef,0x187));var _0xf89e=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0x89ef[_0x2a6d45];return _0x295253;};'use strict';var multer=require(_0xf89e('0x0'));var util=require(_0xf89e('0x1'));var path=require(_0xf89e('0x2'));var timeout=require(_0xf89e('0x3'));var express=require(_0xf89e('0x4'));var router=express[_0xf89e('0x5')]();var auth=require(_0xf89e('0x6'));var interaction=require(_0xf89e('0x7'));var config=require(_0xf89e('0x8'));var controller=require(_0xf89e('0x9'));router['get']('/',auth[_0xf89e('0xa')](),controller['index']);router[_0xf89e('0xb')]('/describe',auth[_0xf89e('0xa')](),controller[_0xf89e('0xc')]);router['get'](_0xf89e('0xd'),auth[_0xf89e('0xa')](),controller[_0xf89e('0xe')]);router[_0xf89e('0xb')](_0xf89e('0xf'),auth[_0xf89e('0xa')](),controller[_0xf89e('0x10')]);router[_0xf89e('0xb')](_0xf89e('0x11'),auth[_0xf89e('0xa')](),controller[_0xf89e('0x12')]);router[_0xf89e('0xb')](_0xf89e('0x13'),auth[_0xf89e('0xa')](),controller['getInteractions']);router[_0xf89e('0xb')](_0xf89e('0x14'),auth[_0xf89e('0xa')](),controller[_0xf89e('0x15')]);router[_0xf89e('0xb')](_0xf89e('0x16'),auth[_0xf89e('0xa')](),controller['getMessages']);router[_0xf89e('0xb')](_0xf89e('0x17'),auth[_0xf89e('0xa')](),controller[_0xf89e('0x18')]);router['post']('/',auth[_0xf89e('0xa')](),controller[_0xf89e('0x19')]);router[_0xf89e('0x1a')](_0xf89e('0xf'),auth[_0xf89e('0xa')](),controller[_0xf89e('0x1b')]);router[_0xf89e('0x1a')](_0xf89e('0x11'),auth[_0xf89e('0xa')](),controller[_0xf89e('0x1c')]);router[_0xf89e('0x1a')](_0xf89e('0x13'),auth['isAuthenticated'](),controller[_0xf89e('0x1d')]);router[_0xf89e('0x1a')](_0xf89e('0x14'),auth[_0xf89e('0xa')](),controller[_0xf89e('0x1e')]);router['post']('/addaccountapplications',auth[_0xf89e('0xa')](),controller[_0xf89e('0x1f')]);router[_0xf89e('0x1a')](_0xf89e('0x20'),auth['isAuthenticated'](),controller[_0xf89e('0x21')]);router[_0xf89e('0x1a')](_0xf89e('0x22'),auth[_0xf89e('0xa')](),controller[_0xf89e('0x23')]);router[_0xf89e('0x1a')](_0xf89e('0x17'),auth[_0xf89e('0xa')](),controller[_0xf89e('0x24')]);router[_0xf89e('0x25')](_0xf89e('0xd'),auth[_0xf89e('0xa')](),controller[_0xf89e('0x26')]);router[_0xf89e('0x27')]('/:id',auth[_0xf89e('0xa')](),controller[_0xf89e('0x28')]);router[_0xf89e('0x27')](_0xf89e('0xf'),auth[_0xf89e('0xa')](),controller[_0xf89e('0x29')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0xf89e('0x17'),auth['isAuthenticated'](),controller[_0xf89e('0x2a')]);module[_0xf89e('0x2b')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index c8b0afe..62d7224 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 _0x9a4d=['INTEGER','STRING','*,*,*,*','sequelize','exports'];(function(_0x528bb5,_0x119c5b){var _0x58e8ca=function(_0x5a8077){while(--_0x5a8077){_0x528bb5['push'](_0x528bb5['shift']());}};_0x58e8ca(++_0x119c5b);}(_0x9a4d,0xa8));var _0xd9a4=function(_0x332924,_0x240c1c){_0x332924=_0x332924-0x0;var _0x4440e9=_0x9a4d[_0x332924];return _0x4440e9;};'use strict';var Sequelize=require(_0xd9a4('0x0'));module[_0xd9a4('0x1')]={'priority':{'type':Sequelize[_0xd9a4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd9a4('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd9a4('0x3')],'defaultValue':_0xd9a4('0x4')}}; \ No newline at end of file +var _0x4f98=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x10c51f,_0x11270f){var _0x56a0cd=function(_0x563ac6){while(--_0x563ac6){_0x10c51f['push'](_0x10c51f['shift']());}};_0x56a0cd(++_0x11270f);}(_0x4f98,0x196));var _0x84f9=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x4f98[_0x40a825];return _0x273a54;};'use strict';var Sequelize=require(_0x84f9('0x0'));module[_0x84f9('0x1')]={'priority':{'type':Sequelize[_0x84f9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x84f9('0x3')],'allowNull':![],'defaultValue':_0x84f9('0x4')},'appdata':{'type':Sequelize[_0x84f9('0x5')]()},'description':{'type':Sequelize[_0x84f9('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x84f9('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 973e9ca..db8f04c 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 _0x4c7e=['fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','then','error','stack','name','send','index','FaxApplication','rawAttributes','keys','query','intersection','model','attributes','fields','length','sort','where','filters','filter','merge','map','key','includeAll','include','findAll','params','options','catch','create','body','update','find','html-pdf','eml-format','rimraf'];(function(_0x7b38e1,_0x725323){var _0xa178b2=function(_0x2eeeea){while(--_0x2eeeea){_0x7b38e1['push'](_0x7b38e1['shift']());}};_0xa178b2(++_0x725323);}(_0x4c7e,0x142));var _0xe4c7=function(_0x1b0659,_0x586a89){_0x1b0659=_0x1b0659-0x0;var _0x1e3bf6=_0x4c7e[_0x1b0659];return _0x1e3bf6;};'use strict';var pdf=require(_0xe4c7('0x0'));var emlformat=require(_0xe4c7('0x1'));var rimraf=require(_0xe4c7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4c7('0x3'));var rp=require(_0xe4c7('0x4'));var moment=require(_0xe4c7('0x5'));var BPromise=require(_0xe4c7('0x6'));var Mustache=require(_0xe4c7('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe4c7('0x8'));var csv=require(_0xe4c7('0x9'));var ejs=require(_0xe4c7('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe4c7('0xb'));var crypto=require(_0xe4c7('0xc'));var jsforce=require(_0xe4c7('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe4c7('0xe'));var Papa=require(_0xe4c7('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0xe4c7('0x10'));var Redis=require(_0xe4c7('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xe4c7('0x12'))(_0xe4c7('0x13'));var utils=require('../../config/utils');var config=require(_0xe4c7('0x14'));var db=require(_0xe4c7('0x15'))['db'];function respondWithStatusCode(_0x557ae5,_0x41c009){_0x41c009=_0x41c009||0xcc;return function(_0x32313f){if(_0x32313f){return _0x557ae5[_0xe4c7('0x16')](_0x41c009);}return _0x557ae5['status'](_0x41c009)[_0xe4c7('0x17')]();};}function respondWithResult(_0x7f7590,_0x8b5e55){_0x8b5e55=_0x8b5e55||0xc8;return function(_0x35252b){if(_0x35252b){return _0x7f7590[_0xe4c7('0x18')](_0x8b5e55)[_0xe4c7('0x19')](_0x35252b);}};}function respondWithFilteredResult(_0x3819c7,_0x5aa06a){return function(_0x40c706){if(_0x40c706){var _0x174ea9=_0x40c706[_0xe4c7('0x1a')],_0x4b045f=_0x5aa06a[_0xe4c7('0x1b')],_0x34ff69=_0x5aa06a[_0xe4c7('0x1b')]+_0x5aa06a[_0xe4c7('0x1c')],_0x44fa66;if(_0x34ff69>=_0x174ea9){_0x34ff69=_0x174ea9;_0x44fa66=0xc8;}else{_0x44fa66=0xce;}_0x3819c7['status'](_0x44fa66);return _0x3819c7[_0xe4c7('0x1d')]('Content-Range',_0x4b045f+'-'+_0x34ff69+'/'+_0x174ea9)[_0xe4c7('0x19')](_0x40c706);}return null;};}function patchUpdates(_0x3678fb){return function(_0x4da445){try{jsonpatch[_0xe4c7('0x1e')](_0x4da445,_0x3678fb,!![]);}catch(_0x3325b0){return BPromise[_0xe4c7('0x1f')](_0x3325b0);}return _0x4da445[_0xe4c7('0x20')]();};}function saveUpdates(_0x1871e8,_0x483c67){return function(_0x1c8527){if(_0x1c8527){return _0x1c8527['update'](_0x1871e8)[_0xe4c7('0x21')](function(_0x48c1f8){return _0x48c1f8;});}return null;};}function removeEntity(_0x170b79,_0x6927b9){return function(_0x11d9f5){if(_0x11d9f5){return _0x11d9f5['destroy']()[_0xe4c7('0x21')](function(){_0x170b79[_0xe4c7('0x18')](0xcc)[_0xe4c7('0x17')]();});}};}function handleEntityNotFound(_0x324246,_0x4db5a1){return function(_0x1f945c){if(!_0x1f945c){_0x324246['sendStatus'](0x194);}return _0x1f945c;};}function handleError(_0x108eff,_0x324b03){_0x324b03=_0x324b03||0x1f4;return function(_0x2851ee){logger[_0xe4c7('0x22')](_0x2851ee[_0xe4c7('0x23')]);if(_0x2851ee[_0xe4c7('0x24')]){delete _0x2851ee[_0xe4c7('0x24')];}_0x108eff['status'](_0x324b03)[_0xe4c7('0x25')](_0x2851ee);};}exports[_0xe4c7('0x26')]=function(_0x17a69a,_0x58ef7b){var _0x5631ce={},_0x26a330={},_0x794953={'count':0x0,'rows':[]};var _0x96705e=db[_0xe4c7('0x27')][_0xe4c7('0x28')];_0x26a330['model']=_[_0xe4c7('0x29')](_0x96705e);_0x26a330[_0xe4c7('0x2a')]=_[_0xe4c7('0x29')](_0x17a69a[_0xe4c7('0x2a')]);_0x26a330['filters']=_[_0xe4c7('0x2b')](_0x26a330[_0xe4c7('0x2c')],_0x26a330[_0xe4c7('0x2a')]);_0x5631ce[_0xe4c7('0x2d')]=_[_0xe4c7('0x2b')](_0x26a330['model'],qs['fields'](_0x17a69a['query'][_0xe4c7('0x2e')]));_0x5631ce[_0xe4c7('0x2d')]=_0x5631ce[_0xe4c7('0x2d')][_0xe4c7('0x2f')]?_0x5631ce['attributes']:_0x26a330['model'];if(!_0x17a69a[_0xe4c7('0x2a')]['hasOwnProperty']('nolimit')){_0x5631ce[_0xe4c7('0x1c')]=qs[_0xe4c7('0x1c')](_0x17a69a[_0xe4c7('0x2a')][_0xe4c7('0x1c')]);_0x5631ce[_0xe4c7('0x1b')]=qs[_0xe4c7('0x1b')](_0x17a69a[_0xe4c7('0x2a')][_0xe4c7('0x1b')]);}_0x5631ce['order']=qs[_0xe4c7('0x30')](_0x17a69a['query'][_0xe4c7('0x30')]);_0x5631ce[_0xe4c7('0x31')]=qs[_0xe4c7('0x32')](_['pick'](_0x17a69a[_0xe4c7('0x2a')],_0x26a330[_0xe4c7('0x32')]));if(_0x17a69a[_0xe4c7('0x2a')][_0xe4c7('0x33')]){_0x5631ce[_0xe4c7('0x31')]=_[_0xe4c7('0x34')](_0x5631ce[_0xe4c7('0x31')],{'$or':_[_0xe4c7('0x35')](_0x96705e,function(_0x24ecbc){if(_0x24ecbc['type'][_0xe4c7('0x36')]!=='VIRTUAL'){var _0x481282={};_0x481282[_0x24ecbc['field']]={'$like':'%'+_0x17a69a[_0xe4c7('0x2a')][_0xe4c7('0x33')]+'%'};return _0x481282;}})});}_0x5631ce=_['merge']({},_0x5631ce,_0x17a69a['options']);var _0xa0d579={'where':_0x5631ce[_0xe4c7('0x31')]};return db['FaxApplication']['count'](_0xa0d579)[_0xe4c7('0x21')](function(_0x54b8c9){_0x794953[_0xe4c7('0x1a')]=_0x54b8c9;if(_0x17a69a[_0xe4c7('0x2a')][_0xe4c7('0x37')]){_0x5631ce[_0xe4c7('0x38')]=[{'all':!![]}];}return db[_0xe4c7('0x27')][_0xe4c7('0x39')](_0x5631ce);})[_0xe4c7('0x21')](function(_0x823ddd){_0x794953['rows']=_0x823ddd;return _0x794953;})[_0xe4c7('0x21')](respondWithFilteredResult(_0x58ef7b,_0x5631ce))['catch'](handleError(_0x58ef7b,null));};exports['show']=function(_0x3f19d6,_0x4e91f5){var _0x2192bd={'raw':!![],'where':{'id':_0x3f19d6[_0xe4c7('0x3a')]['id']}},_0x1f8644={};_0x1f8644[_0xe4c7('0x2c')]=_[_0xe4c7('0x29')](db[_0xe4c7('0x27')][_0xe4c7('0x28')]);_0x1f8644[_0xe4c7('0x2a')]=_[_0xe4c7('0x29')](_0x3f19d6[_0xe4c7('0x2a')]);_0x1f8644[_0xe4c7('0x32')]=_[_0xe4c7('0x2b')](_0x1f8644[_0xe4c7('0x2c')],_0x1f8644[_0xe4c7('0x2a')]);_0x2192bd[_0xe4c7('0x2d')]=_[_0xe4c7('0x2b')](_0x1f8644[_0xe4c7('0x2c')],qs['fields'](_0x3f19d6[_0xe4c7('0x2a')][_0xe4c7('0x2e')]));_0x2192bd[_0xe4c7('0x2d')]=_0x2192bd['attributes']['length']?_0x2192bd[_0xe4c7('0x2d')]:_0x1f8644[_0xe4c7('0x2c')];if(_0x3f19d6['query'][_0xe4c7('0x37')]){_0x2192bd[_0xe4c7('0x38')]=[{'all':!![]}];}_0x2192bd=_['merge']({},_0x2192bd,_0x3f19d6[_0xe4c7('0x3b')]);return db[_0xe4c7('0x27')]['find'](_0x2192bd)[_0xe4c7('0x21')](handleEntityNotFound(_0x4e91f5,null))['then'](respondWithResult(_0x4e91f5,null))[_0xe4c7('0x3c')](handleError(_0x4e91f5,null));};exports['create']=function(_0x575651,_0x3f813b){return db[_0xe4c7('0x27')][_0xe4c7('0x3d')](_0x575651[_0xe4c7('0x3e')],{})[_0xe4c7('0x21')](respondWithResult(_0x3f813b,0xc9))['catch'](handleError(_0x3f813b,null));};exports[_0xe4c7('0x3f')]=function(_0x407f08,_0x5ade9d){if(_0x407f08[_0xe4c7('0x3e')]['id']){delete _0x407f08[_0xe4c7('0x3e')]['id'];}return db[_0xe4c7('0x27')][_0xe4c7('0x40')]({'where':{'id':_0x407f08[_0xe4c7('0x3a')]['id']}})[_0xe4c7('0x21')](handleEntityNotFound(_0x5ade9d,null))[_0xe4c7('0x21')](saveUpdates(_0x407f08[_0xe4c7('0x3e')],null))[_0xe4c7('0x21')](respondWithResult(_0x5ade9d,null))[_0xe4c7('0x3c')](handleError(_0x5ade9d,null));};exports['destroy']=function(_0x30f340,_0x59af1b){return db[_0xe4c7('0x27')][_0xe4c7('0x40')]({'where':{'id':_0x30f340[_0xe4c7('0x3a')]['id']}})[_0xe4c7('0x21')](handleEntityNotFound(_0x59af1b,null))['then'](removeEntity(_0x59af1b,null))[_0xe4c7('0x3c')](handleError(_0x59af1b,null));}; \ No newline at end of file +var _0x1c9e=['end','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','FaxApplication','count','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','params','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c9e,0xbe));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0xe1c9('0x0'));var emlformat=require(_0xe1c9('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe1c9('0x2'));var rp=require(_0xe1c9('0x3'));var moment=require(_0xe1c9('0x4'));var BPromise=require(_0xe1c9('0x5'));var Mustache=require(_0xe1c9('0x6'));var util=require(_0xe1c9('0x7'));var path=require(_0xe1c9('0x8'));var sox=require('sox');var csv=require(_0xe1c9('0x9'));var ejs=require(_0xe1c9('0xa'));var fs=require('fs');var _=require(_0xe1c9('0xb'));var squel=require(_0xe1c9('0xc'));var crypto=require(_0xe1c9('0xd'));var jsforce=require(_0xe1c9('0xe'));var deskjs=require(_0xe1c9('0xf'));var toCsv=require(_0xe1c9('0x9'));var querystring=require(_0xe1c9('0x10'));var Papa=require('papaparse');var authService=require(_0xe1c9('0x11'));var hardwareService=require(_0xe1c9('0x12'));var Redis=require(_0xe1c9('0x13'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xe1c9('0x14'));var utils=require('../../config/utils');var config=require(_0xe1c9('0x15'));var db=require(_0xe1c9('0x16'))['db'];function respondWithStatusCode(_0x54bf0a,_0x106c30){_0x106c30=_0x106c30||0xcc;return function(_0x4a60f7){if(_0x4a60f7){return _0x54bf0a[_0xe1c9('0x17')](_0x106c30);}return _0x54bf0a[_0xe1c9('0x18')](_0x106c30)['end']();};}function respondWithResult(_0x1c1a1b,_0x2a5d81){_0x2a5d81=_0x2a5d81||0xc8;return function(_0x596a44){if(_0x596a44){return _0x1c1a1b[_0xe1c9('0x18')](_0x2a5d81)[_0xe1c9('0x19')](_0x596a44);}};}function respondWithFilteredResult(_0x489b7c,_0x49810d){return function(_0x1471fb){if(_0x1471fb){var _0x304a2e=_0x1471fb['count'],_0x5846da=_0x49810d[_0xe1c9('0x1a')],_0x121d36=_0x49810d['offset']+_0x49810d[_0xe1c9('0x1b')],_0x4819d9;if(_0x121d36>=_0x304a2e){_0x121d36=_0x304a2e;_0x4819d9=0xc8;}else{_0x4819d9=0xce;}_0x489b7c[_0xe1c9('0x18')](_0x4819d9);return _0x489b7c[_0xe1c9('0x1c')](_0xe1c9('0x1d'),_0x5846da+'-'+_0x121d36+'/'+_0x304a2e)[_0xe1c9('0x19')](_0x1471fb);}return null;};}function patchUpdates(_0x42ef99){return function(_0x8eb2af){try{jsonpatch[_0xe1c9('0x1e')](_0x8eb2af,_0x42ef99,!![]);}catch(_0x1f2c52){return BPromise[_0xe1c9('0x1f')](_0x1f2c52);}return _0x8eb2af['save']();};}function saveUpdates(_0x249b72,_0x59c51c){return function(_0x2e9e26){if(_0x2e9e26){return _0x2e9e26[_0xe1c9('0x20')](_0x249b72)[_0xe1c9('0x21')](function(_0x35094e){return _0x35094e;});}return null;};}function removeEntity(_0x290c97,_0x143a99){return function(_0x167a77){if(_0x167a77){return _0x167a77[_0xe1c9('0x22')]()[_0xe1c9('0x21')](function(){_0x290c97[_0xe1c9('0x18')](0xcc)[_0xe1c9('0x23')]();});}};}function handleEntityNotFound(_0xf3b6c4,_0x2cc707){return function(_0x35e051){if(!_0x35e051){_0xf3b6c4[_0xe1c9('0x17')](0x194);}return _0x35e051;};}function handleError(_0x5e13d0,_0x2e3e14){_0x2e3e14=_0x2e3e14||0x1f4;return function(_0x44e808){logger[_0xe1c9('0x24')](_0x44e808[_0xe1c9('0x25')]);if(_0x44e808[_0xe1c9('0x26')]){delete _0x44e808['name'];}_0x5e13d0[_0xe1c9('0x18')](_0x2e3e14)[_0xe1c9('0x27')](_0x44e808);};}exports[_0xe1c9('0x28')]=function(_0x5e4062,_0x460491){var _0xa8a8ba={},_0x9fa761={},_0x4a78a2={'count':0x0,'rows':[]};var _0x1c42c5=db['FaxApplication']['rawAttributes'];_0x9fa761[_0xe1c9('0x29')]=_[_0xe1c9('0x2a')](_0x1c42c5);_0x9fa761[_0xe1c9('0x2b')]=_[_0xe1c9('0x2a')](_0x5e4062[_0xe1c9('0x2b')]);_0x9fa761[_0xe1c9('0x2c')]=_[_0xe1c9('0x2d')](_0x9fa761[_0xe1c9('0x29')],_0x9fa761['query']);_0xa8a8ba[_0xe1c9('0x2e')]=_[_0xe1c9('0x2d')](_0x9fa761[_0xe1c9('0x29')],qs[_0xe1c9('0x2f')](_0x5e4062[_0xe1c9('0x2b')][_0xe1c9('0x2f')]));_0xa8a8ba['attributes']=_0xa8a8ba['attributes'][_0xe1c9('0x30')]?_0xa8a8ba[_0xe1c9('0x2e')]:_0x9fa761[_0xe1c9('0x29')];if(!_0x5e4062['query'][_0xe1c9('0x31')]('nolimit')){_0xa8a8ba['limit']=qs[_0xe1c9('0x1b')](_0x5e4062[_0xe1c9('0x2b')][_0xe1c9('0x1b')]);_0xa8a8ba['offset']=qs[_0xe1c9('0x1a')](_0x5e4062[_0xe1c9('0x2b')][_0xe1c9('0x1a')]);}_0xa8a8ba[_0xe1c9('0x32')]=qs[_0xe1c9('0x33')](_0x5e4062[_0xe1c9('0x2b')][_0xe1c9('0x33')]);_0xa8a8ba[_0xe1c9('0x34')]=qs[_0xe1c9('0x2c')](_[_0xe1c9('0x35')](_0x5e4062[_0xe1c9('0x2b')],_0x9fa761[_0xe1c9('0x2c')]));if(_0x5e4062[_0xe1c9('0x2b')][_0xe1c9('0x36')]){_0xa8a8ba[_0xe1c9('0x34')]=_['merge'](_0xa8a8ba[_0xe1c9('0x34')],{'$or':_[_0xe1c9('0x37')](_0x1c42c5,function(_0x4ebad6){if(_0x4ebad6[_0xe1c9('0x38')][_0xe1c9('0x39')]!==_0xe1c9('0x3a')){var _0x201bc3={};_0x201bc3[_0x4ebad6[_0xe1c9('0x3b')]]={'$like':'%'+_0x5e4062[_0xe1c9('0x2b')][_0xe1c9('0x36')]+'%'};return _0x201bc3;}})});}_0xa8a8ba=_[_0xe1c9('0x3c')]({},_0xa8a8ba,_0x5e4062[_0xe1c9('0x3d')]);var _0x337990={'where':_0xa8a8ba[_0xe1c9('0x34')]};return db[_0xe1c9('0x3e')]['count'](_0x337990)[_0xe1c9('0x21')](function(_0x5e4d00){_0x4a78a2[_0xe1c9('0x3f')]=_0x5e4d00;if(_0x5e4062['query']['includeAll']){_0xa8a8ba['include']=[{'all':!![]}];}return db[_0xe1c9('0x3e')][_0xe1c9('0x40')](_0xa8a8ba);})[_0xe1c9('0x21')](function(_0x69b2e7){_0x4a78a2[_0xe1c9('0x41')]=_0x69b2e7;return _0x4a78a2;})['then'](respondWithFilteredResult(_0x460491,_0xa8a8ba))[_0xe1c9('0x42')](handleError(_0x460491,null));};exports[_0xe1c9('0x43')]=function(_0x5a2c92,_0x563ef6){var _0x4bdf0c={'raw':!![],'where':{'id':_0x5a2c92['params']['id']}},_0x9ae3dd={};_0x9ae3dd['model']=_['keys'](db[_0xe1c9('0x3e')][_0xe1c9('0x44')]);_0x9ae3dd[_0xe1c9('0x2b')]=_[_0xe1c9('0x2a')](_0x5a2c92[_0xe1c9('0x2b')]);_0x9ae3dd['filters']=_[_0xe1c9('0x2d')](_0x9ae3dd[_0xe1c9('0x29')],_0x9ae3dd[_0xe1c9('0x2b')]);_0x4bdf0c[_0xe1c9('0x2e')]=_[_0xe1c9('0x2d')](_0x9ae3dd[_0xe1c9('0x29')],qs[_0xe1c9('0x2f')](_0x5a2c92[_0xe1c9('0x2b')][_0xe1c9('0x2f')]));_0x4bdf0c['attributes']=_0x4bdf0c[_0xe1c9('0x2e')][_0xe1c9('0x30')]?_0x4bdf0c[_0xe1c9('0x2e')]:_0x9ae3dd[_0xe1c9('0x29')];if(_0x5a2c92[_0xe1c9('0x2b')][_0xe1c9('0x45')]){_0x4bdf0c[_0xe1c9('0x46')]=[{'all':!![]}];}_0x4bdf0c=_['merge']({},_0x4bdf0c,_0x5a2c92['options']);return db[_0xe1c9('0x3e')][_0xe1c9('0x47')](_0x4bdf0c)[_0xe1c9('0x21')](handleEntityNotFound(_0x563ef6,null))[_0xe1c9('0x21')](respondWithResult(_0x563ef6,null))['catch'](handleError(_0x563ef6,null));};exports[_0xe1c9('0x48')]=function(_0x1f2fa4,_0x3a018d){return db['FaxApplication'][_0xe1c9('0x48')](_0x1f2fa4[_0xe1c9('0x49')],{})[_0xe1c9('0x21')](respondWithResult(_0x3a018d,0xc9))[_0xe1c9('0x42')](handleError(_0x3a018d,null));};exports['update']=function(_0x37b064,_0x5a148f){if(_0x37b064[_0xe1c9('0x49')]['id']){delete _0x37b064['body']['id'];}return db[_0xe1c9('0x3e')][_0xe1c9('0x47')]({'where':{'id':_0x37b064[_0xe1c9('0x4a')]['id']}})[_0xe1c9('0x21')](handleEntityNotFound(_0x5a148f,null))[_0xe1c9('0x21')](saveUpdates(_0x37b064[_0xe1c9('0x49')],null))['then'](respondWithResult(_0x5a148f,null))[_0xe1c9('0x42')](handleError(_0x5a148f,null));};exports[_0xe1c9('0x22')]=function(_0x5337b6,_0x435bc1){return db[_0xe1c9('0x3e')][_0xe1c9('0x47')]({'where':{'id':_0x5337b6[_0xe1c9('0x4a')]['id']}})[_0xe1c9('0x21')](handleEntityNotFound(_0x435bc1,null))[_0xe1c9('0x21')](removeEntity(_0x435bc1,null))[_0xe1c9('0x42')](handleError(_0x435bc1,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 4e94932..b02dd8c 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 _0xba86=['fax_applications','lodash','util','../../config/logger','api','moment','bluebird','./faxApplication.attributes','exports','define','FaxApplication'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xba86,0x14b));var _0x6ba8=function(_0x399a9a,_0x21749b){_0x399a9a=_0x399a9a-0x0;var _0x1c8673=_0xba86[_0x399a9a];return _0x1c8673;};'use strict';var _=require(_0x6ba8('0x0'));var util=require(_0x6ba8('0x1'));var logger=require(_0x6ba8('0x2'))(_0x6ba8('0x3'));var moment=require(_0x6ba8('0x4'));var BPromise=require(_0x6ba8('0x5'));var rp=require('request-promise');var attributes=require(_0x6ba8('0x6'));module[_0x6ba8('0x7')]=function(_0xcf4cdb,_0x4ef805){return _0xcf4cdb[_0x6ba8('0x8')](_0x6ba8('0x9'),attributes,{'tableName':_0x6ba8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a68=['define','fax_applications','lodash','moment','bluebird','exports'];(function(_0x3002ec,_0x57d046){var _0x2a3ef4=function(_0x5f5149){while(--_0x5f5149){_0x3002ec['push'](_0x3002ec['shift']());}};_0x2a3ef4(++_0x57d046);}(_0x8a68,0x86));var _0x88a6=function(_0x238825,_0x5e1931){_0x238825=_0x238825-0x0;var _0x3724a4=_0x8a68[_0x238825];return _0x3724a4;};'use strict';var _=require(_0x88a6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x88a6('0x1'));var BPromise=require(_0x88a6('0x2'));var rp=require('request-promise');var attributes=require('./faxApplication.attributes');module[_0x88a6('0x3')]=function(_0x29efd6,_0x4f1827){return _0x29efd6[_0x88a6('0x4')]('FaxApplication',attributes,{'tableName':_0x88a6('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index b6566d0..810a93c 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 _0x1d72=['options','raw','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateFaxApplication','FaxApplication','update','body'];(function(_0x37afb4,_0x4dcabe){var _0x576ccd=function(_0x29b394){while(--_0x29b394){_0x37afb4['push'](_0x37afb4['shift']());}};_0x576ccd(++_0x4dcabe);}(_0x1d72,0x1aa));var _0x21d7=function(_0x1593de,_0xc866b0){_0x1593de=_0x1593de-0x0;var _0x2ad87b=_0x1d72[_0x1593de];return _0x2ad87b;};'use strict';var _=require(_0x21d7('0x0'));var util=require(_0x21d7('0x1'));var moment=require(_0x21d7('0x2'));var BPromise=require(_0x21d7('0x3'));var rs=require(_0x21d7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x21d7('0x5'))['db'];var utils=require(_0x21d7('0x6'));var logger=require('../../config/logger')(_0x21d7('0x7'));var config=require(_0x21d7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x21d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8243e6,_0x3f25fb,_0x23d57b){return new BPromise(function(_0x567000,_0x6796e1){return client[_0x21d7('0xa')](_0x8243e6,_0x23d57b)[_0x21d7('0xb')](function(_0x4bd8d3){logger[_0x21d7('0xc')](_0x21d7('0xd'),_0x3f25fb,_0x21d7('0xe'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3f25fb,_0x21d7('0xe'),JSON[_0x21d7('0xf')](_0x4bd8d3));if(_0x4bd8d3[_0x21d7('0x10')]){if(_0x4bd8d3[_0x21d7('0x10')][_0x21d7('0x11')]===0x1f4){logger[_0x21d7('0x10')](_0x21d7('0xd'),_0x3f25fb,_0x4bd8d3['error']['message']);return _0x6796e1(_0x4bd8d3[_0x21d7('0x10')]['message']);}logger[_0x21d7('0x10')]('FaxApplication,\x20%s,\x20%s',_0x3f25fb,_0x4bd8d3[_0x21d7('0x10')]['message']);return _0x567000(_0x4bd8d3[_0x21d7('0x10')][_0x21d7('0x12')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x3f25fb,_0x21d7('0xe'));_0x567000(_0x4bd8d3['result'][_0x21d7('0x12')]);}})[_0x21d7('0x13')](function(_0x184e40){logger[_0x21d7('0x10')](_0x21d7('0xd'),_0x3f25fb,_0x184e40);_0x6796e1(_0x184e40);});});}exports[_0x21d7('0x14')]=function(_0x113be8){var _0x4c2cd7=this;return new Promise(function(_0x2f8c40,_0x59dfd0){return db[_0x21d7('0x15')][_0x21d7('0x16')](_0x113be8[_0x21d7('0x17')],{'raw':_0x113be8[_0x21d7('0x18')]?_0x113be8[_0x21d7('0x18')][_0x21d7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x113be8[_0x21d7('0x18')]?_0x113be8[_0x21d7('0x18')][_0x21d7('0x1a')]||null:null,'attributes':_0x113be8[_0x21d7('0x18')]?_0x113be8['options'][_0x21d7('0x1b')]||null:null,'limit':_0x113be8[_0x21d7('0x18')]?_0x113be8['options'][_0x21d7('0x1c')]||null:null})['then'](function(_0xf9a53b){logger['info'](_0x21d7('0x14'),_0x113be8);logger[_0x21d7('0x1d')](_0x21d7('0x14'),_0x113be8,JSON[_0x21d7('0xf')](_0xf9a53b));_0x2f8c40(_0xf9a53b);})[_0x21d7('0x13')](function(_0x5be537){logger[_0x21d7('0x10')](_0x21d7('0x14'),_0x5be537[_0x21d7('0x12')],_0x113be8);_0x59dfd0(_0x4c2cd7[_0x21d7('0x10')](0x1f4,_0x5be537[_0x21d7('0x12')]));});});}; \ No newline at end of file +var _0xc29f=['UpdateFaxApplication','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FaxApplication','update','body','options','raw','where','attributes','limit'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xc29f,0x1b4));var _0xfc29=function(_0x4a79c5,_0xc5943c){_0x4a79c5=_0x4a79c5-0x0;var _0x53255e=_0xc29f[_0x4a79c5];return _0x53255e;};'use strict';var _=require('lodash');var util=require(_0xfc29('0x0'));var moment=require('moment');var BPromise=require(_0xfc29('0x1'));var rs=require(_0xfc29('0x2'));var fs=require('fs');var Redis=require(_0xfc29('0x3'));var db=require(_0xfc29('0x4'))['db'];var utils=require(_0xfc29('0x5'));var logger=require('../../config/logger')(_0xfc29('0x6'));var config=require('../../config/environment');var jayson=require(_0xfc29('0x7'));var client=jayson[_0xfc29('0x8')][_0xfc29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a767a,_0x4c0790,_0x1150b9){return new BPromise(function(_0x52f961,_0x200d6e){return client[_0xfc29('0xa')](_0x2a767a,_0x1150b9)[_0xfc29('0xb')](function(_0x17362c){logger[_0xfc29('0xc')](_0xfc29('0xd'),_0x4c0790,_0xfc29('0xe'));logger['debug'](_0xfc29('0xf'),_0x4c0790,_0xfc29('0xe'),JSON[_0xfc29('0x10')](_0x17362c));if(_0x17362c[_0xfc29('0x11')]){if(_0x17362c[_0xfc29('0x11')]['code']===0x1f4){logger['error'](_0xfc29('0xd'),_0x4c0790,_0x17362c['error'][_0xfc29('0x12')]);return _0x200d6e(_0x17362c[_0xfc29('0x11')][_0xfc29('0x12')]);}logger[_0xfc29('0x11')](_0xfc29('0xd'),_0x4c0790,_0x17362c['error'][_0xfc29('0x12')]);return _0x52f961(_0x17362c['error'][_0xfc29('0x12')]);}else{logger[_0xfc29('0xc')]('FaxApplication,\x20%s,\x20%s',_0x4c0790,_0xfc29('0xe'));_0x52f961(_0x17362c[_0xfc29('0x13')][_0xfc29('0x12')]);}})[_0xfc29('0x14')](function(_0x13cbe4){logger['error'](_0xfc29('0xd'),_0x4c0790,_0x13cbe4);_0x200d6e(_0x13cbe4);});});}exports['UpdateFaxApplication']=function(_0x33a36f){var _0x371f76=this;return new Promise(function(_0x28c10c,_0x14ab37){return db[_0xfc29('0x15')][_0xfc29('0x16')](_0x33a36f[_0xfc29('0x17')],{'raw':_0x33a36f[_0xfc29('0x18')]?_0x33a36f['options'][_0xfc29('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33a36f[_0xfc29('0x18')]?_0x33a36f[_0xfc29('0x18')][_0xfc29('0x1a')]||null:null,'attributes':_0x33a36f[_0xfc29('0x18')]?_0x33a36f[_0xfc29('0x18')][_0xfc29('0x1b')]||null:null,'limit':_0x33a36f[_0xfc29('0x18')]?_0x33a36f[_0xfc29('0x18')][_0xfc29('0x1c')]||null:null})['then'](function(_0x20c31d){logger[_0xfc29('0xc')](_0xfc29('0x1d'),_0x33a36f);logger[_0xfc29('0x1e')]('UpdateFaxApplication',_0x33a36f,JSON['stringify'](_0x20c31d));_0x28c10c(_0x20c31d);})[_0xfc29('0x14')](function(_0x439dc2){logger[_0xfc29('0x11')](_0xfc29('0x1d'),_0x439dc2[_0xfc29('0x12')],_0x33a36f);_0x14ab37(_0x371f76[_0xfc29('0x11')](0x1f4,_0x439dc2['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 094c571..65eaa17 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 _0x4b17=['exports','multer','path','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','put','delete','destroy'];(function(_0x3df302,_0x1c280f){var _0x8efbde=function(_0x1292cb){while(--_0x1292cb){_0x3df302['push'](_0x3df302['shift']());}};_0x8efbde(++_0x1c280f);}(_0x4b17,0x10f));var _0x74b1=function(_0x35387d,_0x1ba72f){_0x35387d=_0x35387d-0x0;var _0x3aba56=_0x4b17[_0x35387d];return _0x3aba56;};'use strict';var multer=require(_0x74b1('0x0'));var util=require('util');var path=require(_0x74b1('0x1'));var timeout=require('connect-timeout');var express=require(_0x74b1('0x2'));var router=express[_0x74b1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x74b1('0x4'));var config=require('../../config/environment');var controller=require('./faxApplication.controller');router[_0x74b1('0x5')]('/',auth[_0x74b1('0x6')](),controller[_0x74b1('0x7')]);router[_0x74b1('0x5')](_0x74b1('0x8'),auth[_0x74b1('0x6')](),controller[_0x74b1('0x9')]);router['post']('/',auth[_0x74b1('0x6')](),controller[_0x74b1('0xa')]);router[_0x74b1('0xb')](_0x74b1('0x8'),auth[_0x74b1('0x6')](),controller['update']);router[_0x74b1('0xc')](_0x74b1('0x8'),auth['isAuthenticated'](),controller[_0x74b1('0xd')]);module[_0x74b1('0xe')]=router; \ No newline at end of file +var _0xe820=['create','put','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated','index','get','/:id','post'];(function(_0x3350c9,_0x2263cd){var _0x2d7288=function(_0xfb5681){while(--_0xfb5681){_0x3350c9['push'](_0x3350c9['shift']());}};_0x2d7288(++_0x2263cd);}(_0xe820,0xd2));var _0x0e82=function(_0x1e9588,_0x12d8a4){_0x1e9588=_0x1e9588-0x0;var _0x1fe50e=_0xe820[_0x1e9588];return _0x1fe50e;};'use strict';var multer=require(_0x0e82('0x0'));var util=require('util');var path=require(_0x0e82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0e82('0x2')]();var auth=require(_0x0e82('0x3'));var interaction=require(_0x0e82('0x4'));var config=require('../../config/environment');var controller=require(_0x0e82('0x5'));router['get']('/',auth[_0x0e82('0x6')](),controller[_0x0e82('0x7')]);router[_0x0e82('0x8')](_0x0e82('0x9'),auth[_0x0e82('0x6')](),controller['show']);router[_0x0e82('0xa')]('/',auth[_0x0e82('0x6')](),controller[_0x0e82('0xb')]);router[_0x0e82('0xc')](_0x0e82('0x9'),auth['isAuthenticated'](),controller[_0x0e82('0xd')]);router[_0x0e82('0xe')](_0x0e82('0x9'),auth[_0x0e82('0x6')](),controller[_0x0e82('0xf')]);module[_0x0e82('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 28623fc..5fad365 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 _0xb488=['BOOLEAN','DATE','STRING','sequelize'];(function(_0x289d88,_0x51c456){var _0x47834e=function(_0x2a7790){while(--_0x2a7790){_0x289d88['push'](_0x289d88['shift']());}};_0x47834e(++_0x51c456);}(_0xb488,0xe7));var _0x8b48=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb488[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8b48('0x0'));module['exports']={'closed':{'type':Sequelize[_0x8b48('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8b48('0x2')]},'disposition':{'type':Sequelize[_0x8b48('0x3')]},'note':{'type':Sequelize[_0x8b48('0x3')]},'read1stAt':{'type':Sequelize[_0x8b48('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x2484=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3c3b6c,_0x6f39c){var _0x411fb5=function(_0x1b7946){while(--_0x1b7946){_0x3c3b6c['push'](_0x3c3b6c['shift']());}};_0x411fb5(++_0x6f39c);}(_0x2484,0x1af));var _0x4248=function(_0x131a70,_0x5f53b2){_0x131a70=_0x131a70-0x0;var _0x212967=_0x2484[_0x131a70];return _0x212967;};'use strict';var Sequelize=require(_0x4248('0x0'));module[_0x4248('0x1')]={'closed':{'type':Sequelize[_0x4248('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4248('0x3')]},'disposition':{'type':Sequelize[_0x4248('0x4')]},'note':{'type':Sequelize[_0x4248('0x4')]},'read1stAt':{'type':Sequelize[_0x4248('0x3')]},'fax':{'type':Sequelize[_0x4248('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x4248('0x5')]('in',_0x4248('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4248('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4248('0x6')),'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 a2c9884..e51d3af 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 _0xe6d7=['distinct','read','FaxMessage','createdAt','count','Users','fullname','Contact','User','Owner','FaxAccount','key','Messages','ThroughTags','color','findAll','rows','catch','params','intersection','includeAll','find','body','describe','addMessage','ids','getMessages','findOne','nolimit','map','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','files','attachments','server','tmp','format','interaction-%s.zip','Attachment','mkdirSync','basename','existsSync','createReadStream','createWriteStream','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','offset','limit','Content-Range','json','apply','reject','save','update','destroy','then','end','error','name','index','FaxInteraction','rawAttributes','model','keys','query','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','field','options','tag','include','push','Tag','Tags'];(function(_0x1ffea3,_0x49fa25){var _0x1d1b17=function(_0x2bac4f){while(--_0x2bac4f){_0x1ffea3['push'](_0x1ffea3['shift']());}};_0x1d1b17(++_0x49fa25);}(_0xe6d7,0x1ae));var _0x7e6d=function(_0x3ea4ce,_0x6bf6f1){_0x3ea4ce=_0x3ea4ce-0x0;var _0x36cf6e=_0xe6d7[_0x3ea4ce];return _0x36cf6e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7e6d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e6d('0x1'));var jsonpatch=require(_0x7e6d('0x2'));var rp=require(_0x7e6d('0x3'));var moment=require(_0x7e6d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7e6d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7e6d('0x6'));var csv=require(_0x7e6d('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e6d('0x8'));var squel=require(_0x7e6d('0x9'));var crypto=require(_0x7e6d('0xa'));var jsforce=require(_0x7e6d('0xb'));var deskjs=require(_0x7e6d('0xc'));var toCsv=require(_0x7e6d('0x7'));var querystring=require(_0x7e6d('0xd'));var Papa=require(_0x7e6d('0xe'));var authService=require(_0x7e6d('0xf'));var hardwareService=require(_0x7e6d('0x10'));var Redis=require('ioredis');var qs=require(_0x7e6d('0x11'));var logger=require(_0x7e6d('0x12'))(_0x7e6d('0x13'));var utils=require(_0x7e6d('0x14'));var config=require('../../config/environment');var db=require(_0x7e6d('0x15'))['db'];config[_0x7e6d('0x16')]=_['defaults'](config[_0x7e6d('0x16')],{'host':_0x7e6d('0x17'),'port':0x18eb});var socket=require(_0x7e6d('0x18'))(new Redis(config[_0x7e6d('0x16')]));require(_0x7e6d('0x19'))[_0x7e6d('0x1a')](socket);function respondWithStatusCode(_0x38c3e4,_0x28b9b8){_0x28b9b8=_0x28b9b8||0xcc;return function(_0x3b93ad){if(_0x3b93ad){return _0x38c3e4[_0x7e6d('0x1b')](_0x28b9b8);}return _0x38c3e4['status'](_0x28b9b8)['end']();};}function respondWithResult(_0x28c2d8,_0x265a56){_0x265a56=_0x265a56||0xc8;return function(_0x5ef607){if(_0x5ef607){return _0x28c2d8[_0x7e6d('0x1c')](_0x265a56)['json'](_0x5ef607);}};}function respondWithFilteredResult(_0x169144,_0x3f93db){return function(_0x27a5f4){if(_0x27a5f4){var _0x1fcd09=_0x27a5f4['count'],_0x5b154b=_0x3f93db[_0x7e6d('0x1d')],_0x46c4b7=_0x3f93db[_0x7e6d('0x1d')]+_0x3f93db[_0x7e6d('0x1e')],_0x15f86e;if(_0x46c4b7>=_0x1fcd09){_0x46c4b7=_0x1fcd09;_0x15f86e=0xc8;}else{_0x15f86e=0xce;}_0x169144[_0x7e6d('0x1c')](_0x15f86e);return _0x169144['set'](_0x7e6d('0x1f'),_0x5b154b+'-'+_0x46c4b7+'/'+_0x1fcd09)[_0x7e6d('0x20')](_0x27a5f4);}return null;};}function patchUpdates(_0x21dd03){return function(_0x54b24a){try{jsonpatch[_0x7e6d('0x21')](_0x54b24a,_0x21dd03,!![]);}catch(_0x42a000){return BPromise[_0x7e6d('0x22')](_0x42a000);}return _0x54b24a[_0x7e6d('0x23')]();};}function saveUpdates(_0x554768,_0x18168e){return function(_0x2ebd41){if(_0x2ebd41){return _0x2ebd41[_0x7e6d('0x24')](_0x554768)['then'](function(_0x1ce7bb){return _0x1ce7bb;});}return null;};}function removeEntity(_0xba313c,_0x29aa87){return function(_0x188739){if(_0x188739){return _0x188739[_0x7e6d('0x25')]()[_0x7e6d('0x26')](function(){_0xba313c[_0x7e6d('0x1c')](0xcc)[_0x7e6d('0x27')]();});}};}function handleEntityNotFound(_0x37c4f3,_0x23dafe){return function(_0x3c7b36){if(!_0x3c7b36){_0x37c4f3[_0x7e6d('0x1b')](0x194);}return _0x3c7b36;};}function handleError(_0xc5502,_0x249e7f){_0x249e7f=_0x249e7f||0x1f4;return function(_0x1004f4){logger[_0x7e6d('0x28')](_0x1004f4['stack']);if(_0x1004f4['name']){delete _0x1004f4[_0x7e6d('0x29')];}_0xc5502[_0x7e6d('0x1c')](_0x249e7f)['send'](_0x1004f4);};}exports[_0x7e6d('0x2a')]=function(_0x40eeeb,_0x19933d){var _0x29cabb={},_0x58b4ff={},_0xc9c26f={'count':0x0,'rows':[]};var _0x8602fb=db[_0x7e6d('0x2b')][_0x7e6d('0x2c')];_0x58b4ff[_0x7e6d('0x2d')]=_[_0x7e6d('0x2e')](_0x8602fb);_0x58b4ff[_0x7e6d('0x2f')]=_[_0x7e6d('0x2e')](_0x40eeeb[_0x7e6d('0x2f')]);_0x58b4ff['filters']=_['intersection'](_0x58b4ff[_0x7e6d('0x2d')],_0x58b4ff[_0x7e6d('0x2f')]);_0x29cabb['attributes']=_['intersection'](_0x58b4ff[_0x7e6d('0x2d')],qs[_0x7e6d('0x30')](_0x40eeeb['query']['fields']));_0x29cabb['attributes']=_0x29cabb[_0x7e6d('0x31')][_0x7e6d('0x32')]?_0x29cabb[_0x7e6d('0x31')]:_0x58b4ff[_0x7e6d('0x2d')];if(!_0x40eeeb[_0x7e6d('0x2f')][_0x7e6d('0x33')]('nolimit')){_0x29cabb['limit']=qs[_0x7e6d('0x1e')](_0x40eeeb[_0x7e6d('0x2f')][_0x7e6d('0x1e')]);_0x29cabb['offset']=qs[_0x7e6d('0x1d')](_0x40eeeb['query'][_0x7e6d('0x1d')]);}_0x29cabb[_0x7e6d('0x34')]=qs[_0x7e6d('0x35')](_0x40eeeb[_0x7e6d('0x2f')][_0x7e6d('0x35')]);_0x29cabb[_0x7e6d('0x36')]=qs[_0x7e6d('0x37')](_[_0x7e6d('0x38')](_0x40eeeb['query'],_0x58b4ff[_0x7e6d('0x37')]));if(_0x40eeeb[_0x7e6d('0x2f')][_0x7e6d('0x39')]){_0x29cabb[_0x7e6d('0x36')]=_[_0x7e6d('0x3a')](_0x29cabb[_0x7e6d('0x36')],{'$or':_['map'](_0x8602fb,function(_0xdb378c){if(_0xdb378c['type']['key']!=='VIRTUAL'){var _0x539143={};_0x539143[_0xdb378c[_0x7e6d('0x3b')]]={'$like':'%'+_0x40eeeb[_0x7e6d('0x2f')][_0x7e6d('0x39')]+'%'};return _0x539143;}})});}_0x29cabb=_['merge']({},_0x29cabb,_0x40eeeb[_0x7e6d('0x3c')]);var _0x2afd0c={'where':_0x29cabb['where']};_0x2afd0c['include']=[];if(_0x40eeeb[_0x7e6d('0x2f')][_0x7e6d('0x3d')]){_0x2afd0c[_0x7e6d('0x3e')][_0x7e6d('0x3f')]({'model':db[_0x7e6d('0x40')],'as':_0x7e6d('0x41'),'attributes':['id'],'where':{'id':_0x40eeeb['query']['tag']},'required':!![]});_0x2afd0c[_0x7e6d('0x42')]=!![];}if(_0x40eeeb[_0x7e6d('0x2f')][_0x7e6d('0x43')]){_0x2afd0c[_0x7e6d('0x3e')][_0x7e6d('0x3f')]({'model':db[_0x7e6d('0x44')],'as':'Messages','attributes':['id','direction',_0x7e6d('0x45'),_0x7e6d('0x43')],'where':{'direction':'in','read':_0x40eeeb['query']['read']||![]},'required':!![]});_0x2afd0c[_0x7e6d('0x42')]=!![];}return db[_0x7e6d('0x2b')][_0x7e6d('0x46')](_0x2afd0c)[_0x7e6d('0x26')](function(_0x202d00){_0xc9c26f[_0x7e6d('0x46')]=_0x202d00;if(_0x40eeeb[_0x7e6d('0x2f')]['includeAll']){_0x29cabb[_0x7e6d('0x3e')]=[{'model':db['User'],'as':_0x7e6d('0x47'),'required':![],'attributes':['id',_0x7e6d('0x29'),_0x7e6d('0x48')]},{'model':db['CmContact'],'as':_0x7e6d('0x49'),'required':![]},{'model':db[_0x7e6d('0x4a')],'as':_0x7e6d('0x4b'),'attributes':[_0x7e6d('0x29'),_0x7e6d('0x48'),'internal'],'required':![]},{'model':db[_0x7e6d('0x4c')],'as':'Account','attributes':['name',_0x7e6d('0x4d')],'required':![]},{'model':db['FaxMessage'],'as':_0x7e6d('0x4e'),'attributes':['id','direction',_0x7e6d('0x45'),_0x7e6d('0x43')],'where':{'direction':'in','read':_0x40eeeb['query']['read']||![]},'required':_0x40eeeb[_0x7e6d('0x2f')]['read']||![]},{'model':db[_0x7e6d('0x40')],'as':_0x7e6d('0x41'),'attributes':['id',_0x7e6d('0x29'),'color'],'required':_0x40eeeb[_0x7e6d('0x2f')][_0x7e6d('0x3d')]?!![]:![]},{'model':db['Tag'],'as':_0x7e6d('0x4f'),'attributes':['id',_0x7e6d('0x29'),_0x7e6d('0x50')],'through':_0x40eeeb[_0x7e6d('0x2f')][_0x7e6d('0x3d')]?{'attributes':[],'where':{'TagId':_0x40eeeb[_0x7e6d('0x2f')]['tag']||undefined}}:{},'required':_0x40eeeb[_0x7e6d('0x2f')][_0x7e6d('0x3d')]?!![]:![]}];}return db[_0x7e6d('0x2b')][_0x7e6d('0x51')](_0x29cabb);})['then'](function(_0x5aef2b){_0xc9c26f[_0x7e6d('0x52')]=_0x5aef2b;return _0xc9c26f;})[_0x7e6d('0x26')](respondWithFilteredResult(_0x19933d,_0x29cabb))[_0x7e6d('0x53')](handleError(_0x19933d,null));};exports['show']=function(_0x375f78,_0x4358fa){var _0xf8361a={'raw':![],'where':{'id':_0x375f78[_0x7e6d('0x54')]['id']}},_0x494ed1={};_0x494ed1['model']=_['keys'](db[_0x7e6d('0x2b')][_0x7e6d('0x2c')]);_0x494ed1[_0x7e6d('0x2f')]=_[_0x7e6d('0x2e')](_0x375f78[_0x7e6d('0x2f')]);_0x494ed1[_0x7e6d('0x37')]=_['intersection'](_0x494ed1[_0x7e6d('0x2d')],_0x494ed1[_0x7e6d('0x2f')]);_0xf8361a[_0x7e6d('0x31')]=_[_0x7e6d('0x55')](_0x494ed1['model'],qs[_0x7e6d('0x30')](_0x375f78[_0x7e6d('0x2f')][_0x7e6d('0x30')]));_0xf8361a[_0x7e6d('0x31')]=_0xf8361a[_0x7e6d('0x31')][_0x7e6d('0x32')]?_0xf8361a['attributes']:_0x494ed1[_0x7e6d('0x2d')];if(_0x375f78[_0x7e6d('0x2f')][_0x7e6d('0x56')]){_0xf8361a['include']=[{'all':!![]}];}_0xf8361a=_[_0x7e6d('0x3a')]({},_0xf8361a,_0x375f78[_0x7e6d('0x3c')]);return db[_0x7e6d('0x2b')][_0x7e6d('0x57')](_0xf8361a)['then'](handleEntityNotFound(_0x4358fa,null))[_0x7e6d('0x26')](respondWithResult(_0x4358fa,null))[_0x7e6d('0x53')](handleError(_0x4358fa,null));};exports['create']=function(_0x249a61,_0x294a1d){return db[_0x7e6d('0x2b')]['create'](_0x249a61[_0x7e6d('0x58')],{})[_0x7e6d('0x26')](respondWithResult(_0x294a1d,0xc9))[_0x7e6d('0x53')](handleError(_0x294a1d,null));};exports['update']=function(_0x13ef87,_0x17cb4f){if(_0x13ef87['body']['id']){delete _0x13ef87[_0x7e6d('0x58')]['id'];}return db[_0x7e6d('0x2b')][_0x7e6d('0x57')]({'where':{'id':_0x13ef87[_0x7e6d('0x54')]['id']}})[_0x7e6d('0x26')](handleEntityNotFound(_0x17cb4f,null))[_0x7e6d('0x26')](saveUpdates(_0x13ef87[_0x7e6d('0x58')],null))[_0x7e6d('0x26')](respondWithResult(_0x17cb4f,null))[_0x7e6d('0x53')](handleError(_0x17cb4f,null));};exports[_0x7e6d('0x25')]=function(_0x507507,_0x2fc666){return db[_0x7e6d('0x2b')][_0x7e6d('0x57')]({'where':{'id':_0x507507['params']['id']}})[_0x7e6d('0x26')](handleEntityNotFound(_0x2fc666,null))[_0x7e6d('0x26')](removeEntity(_0x2fc666,null))['catch'](handleError(_0x2fc666,null));};exports[_0x7e6d('0x59')]=function(_0x2dbbff,_0x3c0f3a){return db[_0x7e6d('0x2b')][_0x7e6d('0x59')]()[_0x7e6d('0x26')](respondWithResult(_0x3c0f3a,null))['catch'](handleError(_0x3c0f3a,null));};exports[_0x7e6d('0x5a')]=function(_0x4b4b8c,_0x16dab6,_0x3d1220){return db[_0x7e6d('0x44')][_0x7e6d('0x57')]({'where':{'id':_0x4b4b8c['params']['id']}})[_0x7e6d('0x26')](handleEntityNotFound(_0x16dab6,null))[_0x7e6d('0x26')](function(_0x4385b3){if(_0x4385b3){return _0x4385b3['addMessage'](_0x4b4b8c[_0x7e6d('0x58')]['ids'],_['omit'](_0x4b4b8c[_0x7e6d('0x58')],[_0x7e6d('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x16dab6,null))[_0x7e6d('0x53')](handleError(_0x16dab6,null));};exports[_0x7e6d('0x5c')]=function(_0x4fa8f8,_0x11e00d,_0x27c507){var _0x1a3054={'raw':![],'where':{}};var _0x2a9f40={};var _0x3843c9={'count':0x0,'rows':[]};return db[_0x7e6d('0x2b')][_0x7e6d('0x5d')]({'where':{'id':_0x4fa8f8[_0x7e6d('0x54')]['id']}})[_0x7e6d('0x26')](handleEntityNotFound(_0x11e00d,null))[_0x7e6d('0x26')](function(_0x536533){if(_0x536533){_0x2a9f40[_0x7e6d('0x2d')]=_[_0x7e6d('0x2e')](db[_0x7e6d('0x44')][_0x7e6d('0x2c')]);_0x2a9f40[_0x7e6d('0x2f')]=_['keys'](_0x4fa8f8[_0x7e6d('0x2f')]);_0x2a9f40[_0x7e6d('0x37')]=_['intersection'](_0x2a9f40[_0x7e6d('0x2d')],_0x2a9f40[_0x7e6d('0x2f')]);_0x1a3054['attributes']=_['intersection'](_0x2a9f40[_0x7e6d('0x2d')],qs[_0x7e6d('0x30')](_0x4fa8f8[_0x7e6d('0x2f')]['fields']));_0x1a3054['attributes']=_0x1a3054[_0x7e6d('0x31')][_0x7e6d('0x32')]?_0x1a3054[_0x7e6d('0x31')]:_0x2a9f40[_0x7e6d('0x2d')];if(!_0x4fa8f8[_0x7e6d('0x2f')]['hasOwnProperty'](_0x7e6d('0x5e'))){_0x1a3054[_0x7e6d('0x1e')]=qs[_0x7e6d('0x1e')](_0x4fa8f8[_0x7e6d('0x2f')][_0x7e6d('0x1e')]);_0x1a3054[_0x7e6d('0x1d')]=qs[_0x7e6d('0x1d')](_0x4fa8f8[_0x7e6d('0x2f')]['offset']);}_0x1a3054[_0x7e6d('0x34')]=qs[_0x7e6d('0x35')](_0x4fa8f8[_0x7e6d('0x2f')]['sort']);_0x1a3054['where']=qs[_0x7e6d('0x37')](_[_0x7e6d('0x38')](_0x4fa8f8[_0x7e6d('0x2f')],_0x2a9f40[_0x7e6d('0x37')]));_0x1a3054[_0x7e6d('0x36')]['FaxInteractionId']=_0x536533['id'];if(_0x4fa8f8[_0x7e6d('0x2f')][_0x7e6d('0x39')]){_0x1a3054['where']=_[_0x7e6d('0x3a')](_0x1a3054[_0x7e6d('0x36')],{'$or':_[_0x7e6d('0x5f')](_0x1a3054[_0x7e6d('0x31')],function(_0x2b1135){var _0x360203={};_0x360203[_0x2b1135]={'$like':'%'+_0x4fa8f8[_0x7e6d('0x2f')]['filter']+'%'};return _0x360203;})});}if(_0x4fa8f8[_0x7e6d('0x2f')]['$gte']){var _0x1d1a29=_0x4fa8f8[_0x7e6d('0x2f')]['$gte']['split'](',');var _0x418b67={};_0x418b67[_0x1d1a29[0x0]]={'$gte':moment(_0x1d1a29[0x1])['format'](_0x7e6d('0x60'))};_0x1a3054['where']=_[_0x7e6d('0x3a')](_0x1a3054[_0x7e6d('0x36')],_0x418b67);}_0x1a3054=_[_0x7e6d('0x3a')]({},_0x1a3054,_0x4fa8f8['options']);return db['FaxMessage'][_0x7e6d('0x46')]({'where':_0x1a3054[_0x7e6d('0x36')]})['then'](function(_0x3acff9){_0x3843c9[_0x7e6d('0x46')]=_0x3acff9;if(_0x4fa8f8[_0x7e6d('0x2f')]['includeAll']){_0x1a3054[_0x7e6d('0x3e')]=[{'all':!![]}];}return db[_0x7e6d('0x44')]['findAll'](_0x1a3054);})[_0x7e6d('0x26')](function(_0x57b698){_0x3843c9[_0x7e6d('0x52')]=_0x57b698;return _0x3843c9;});}})[_0x7e6d('0x26')](respondWithFilteredResult(_0x11e00d,_0x1a3054))[_0x7e6d('0x53')](handleError(_0x11e00d,null));};exports[_0x7e6d('0x61')]=function(_0x4974f0,_0x27af71,_0x3b0597){return db[_0x7e6d('0x2b')][_0x7e6d('0x57')]({'where':{'id':_0x4974f0['params']['id']}})[_0x7e6d('0x26')](handleEntityNotFound(_0x27af71,null))[_0x7e6d('0x26')](function(_0x4dfb40){if(_0x4dfb40){return _0x4dfb40[_0x7e6d('0x62')](_0x4974f0['body'][_0x7e6d('0x5b')],_[_0x7e6d('0x63')](_0x4974f0[_0x7e6d('0x58')],[_0x7e6d('0x5b'),'id'])||{})[_0x7e6d('0x64')](function(){return db['Tag'][_0x7e6d('0x51')]({'attributes':['id',_0x7e6d('0x29'),'color'],'where':{'id':_0x4974f0[_0x7e6d('0x58')]['ids']}});})[_0x7e6d('0x26')](function(_0x597f5c){socket[_0x7e6d('0x65')](_0x7e6d('0x66'),{'id':Number(_0x4974f0[_0x7e6d('0x54')]['id']),'tags':_0x597f5c||[]});return{'id':Number(_0x4974f0[_0x7e6d('0x54')]['id']),'tags':_0x597f5c||[]};});}})[_0x7e6d('0x26')](respondWithResult(_0x27af71,null))['catch'](handleError(_0x27af71,null));};exports[_0x7e6d('0x67')]=function(_0x2b4539,_0x31e632,_0x27fd62){var _0x3facb9;return db[_0x7e6d('0x2b')][_0x7e6d('0x57')]({'where':{'id':_0x2b4539[_0x7e6d('0x54')]['id']}})['then'](handleEntityNotFound(_0x31e632,null))[_0x7e6d('0x26')](function(_0x1e9b2d){if(_0x1e9b2d){return _0x1e9b2d[_0x7e6d('0x67')](_0x2b4539['query']['ids']);}})[_0x7e6d('0x26')](respondWithStatusCode(_0x31e632,null))[_0x7e6d('0x53')](handleError(_0x31e632,null));};exports[_0x7e6d('0x68')]=function(_0x691a59,_0x181edd){var _0x4c84f7=moment()[_0x7e6d('0x69')]()[_0x7e6d('0x6a')]();var _0x5c044f=path[_0x7e6d('0x6b')](config[_0x7e6d('0x6c')],'server',_0x7e6d('0x6d'),_0x7e6d('0x6e'));var _0xa988a0=path[_0x7e6d('0x6b')](config[_0x7e6d('0x6c')],_0x7e6d('0x6f'),_0x7e6d('0x6d'),_0x7e6d('0x70'));var _0x2c254d=path['join'](_0xa988a0,_0x4c84f7);var _0x514323=util[_0x7e6d('0x71')](_0x7e6d('0x72'),_0x4c84f7);var _0x1915f9=path['join'](_0xa988a0,_0x514323);var _0x6cd645=![];return db[_0x7e6d('0x2b')][_0x7e6d('0x57')]({'where':{'id':_0x691a59['params']['id']}})['then'](handleEntityNotFound(_0x181edd,null))[_0x7e6d('0x26')](function(_0x42d17d){if(_0x42d17d){return _0x42d17d['getMessages']({'attributes':['id','body',_0x7e6d('0x45')],'include':[{'model':db[_0x7e6d('0x73')],'as':_0x7e6d('0x73')}]});}return[];})[_0x7e6d('0x26')](function(_0x46c76c){_0x6cd645=_0x46c76c[_0x7e6d('0x32')];if(_0x46c76c[_0x7e6d('0x32')]){fs[_0x7e6d('0x74')](_0x2c254d);for(var _0x36c627=0x0;_0x36c627<_0x46c76c[_0x7e6d('0x32')];_0x36c627++){var _0x3029af=_0x46c76c[_0x36c627];var _0xdd630d=_0x3029af[_0x7e6d('0x73')];if(_0xdd630d){var _0x2e903d=path[_0x7e6d('0x6b')](_0x5c044f,_0xdd630d[_0x7e6d('0x75')]);if(fs[_0x7e6d('0x76')](_0x2e903d)){fs[_0x7e6d('0x77')](_0x2e903d)['pipe'](fs[_0x7e6d('0x78')](path[_0x7e6d('0x6b')](_0x2c254d,_0xdd630d[_0x7e6d('0x75')])));}}}}})[_0x7e6d('0x26')](function(){if(_0x6cd645){return new BPromise(function(_0x31f0ee,_0x2a035e){zipdir(_0x2c254d,{'saveTo':_0x1915f9},function(_0x1e6a4f,_0x5af991){if(_0x1e6a4f)return _0x2a035e(_0x1e6a4f);return _0x31f0ee(_0x5af991);});});}})[_0x7e6d('0x26')](function(){if(_0x6cd645){return new BPromise(function(_0x5138c2,_0x3a0ab1){rimraf(_0x2c254d,function(_0x4e4776){if(_0x4e4776)_0x3a0ab1(_0x4e4776);return _0x5138c2();});});}})['then'](function(){if(_0x6cd645){return _0x181edd[_0x7e6d('0x68')](_0x1915f9,_0x514323,function(_0x55831e){if(_0x55831e){console[_0x7e6d('0x79')](_0x7e6d('0x7a'),_0x55831e);}else{fs[_0x7e6d('0x7b')](_0x1915f9);}});}else{return _0x181edd[_0x7e6d('0x1b')](0xc8);}})['catch'](handleError(_0x181edd,null));}; \ No newline at end of file +var _0xf90d=['limit','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','FaxInteraction','rawAttributes','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','where','map','type','key','VIRTUAL','field','filter','merge','options','include','tag','push','Tag','Tags','read','FaxMessage','Messages','direction','createdAt','distinct','includeAll','User','Users','fullname','Contact','Owner','internal','Account','color','ThroughTags','findAll','rows','catch','show','find','create','body','params','destroy','describe','addMessage','ids','omit','getMessages','findOne','pick','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','emit','faxInteractionTags:save','removeTags','unix','toString','root','server','join','interaction-%s.zip','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','download','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','count','offset'];(function(_0x1e16df,_0x20f11a){var _0x27ee69=function(_0x41d5da){while(--_0x41d5da){_0x1e16df['push'](_0x1e16df['shift']());}};_0x27ee69(++_0x20f11a);}(_0xf90d,0x1d7));var _0xdf90=function(_0x329c13,_0x7d9324){_0x329c13=_0x329c13-0x0;var _0x21a816=_0xf90d[_0x329c13];return _0x21a816;};'use strict';var pdf=require(_0xdf90('0x0'));var emlformat=require(_0xdf90('0x1'));var rimraf=require(_0xdf90('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf90('0x3'));var rp=require(_0xdf90('0x4'));var moment=require(_0xdf90('0x5'));var BPromise=require(_0xdf90('0x6'));var Mustache=require(_0xdf90('0x7'));var util=require(_0xdf90('0x8'));var path=require(_0xdf90('0x9'));var sox=require(_0xdf90('0xa'));var csv=require(_0xdf90('0xb'));var ejs=require(_0xdf90('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdf90('0xd'));var crypto=require(_0xdf90('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf90('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf90('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xdf90('0x11'));var utils=require(_0xdf90('0x12'));var config=require(_0xdf90('0x13'));var db=require(_0xdf90('0x14'))['db'];config[_0xdf90('0x15')]=_['defaults'](config['redis'],{'host':_0xdf90('0x16'),'port':0x18eb});var socket=require(_0xdf90('0x17'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xdf90('0x18')](socket);function respondWithStatusCode(_0x2a6da8,_0x978dc1){_0x978dc1=_0x978dc1||0xcc;return function(_0x506035){if(_0x506035){return _0x2a6da8[_0xdf90('0x19')](_0x978dc1);}return _0x2a6da8[_0xdf90('0x1a')](_0x978dc1)['end']();};}function respondWithResult(_0x4193e7,_0x2c4970){_0x2c4970=_0x2c4970||0xc8;return function(_0x2f916b){if(_0x2f916b){return _0x4193e7[_0xdf90('0x1a')](_0x2c4970)['json'](_0x2f916b);}};}function respondWithFilteredResult(_0x51a4f0,_0x5a2c75){return function(_0x48af5d){if(_0x48af5d){var _0xba31f3=_0x48af5d[_0xdf90('0x1b')],_0x2e05b8=_0x5a2c75[_0xdf90('0x1c')],_0x15ecd5=_0x5a2c75[_0xdf90('0x1c')]+_0x5a2c75[_0xdf90('0x1d')],_0x20c918;if(_0x15ecd5>=_0xba31f3){_0x15ecd5=_0xba31f3;_0x20c918=0xc8;}else{_0x20c918=0xce;}_0x51a4f0['status'](_0x20c918);return _0x51a4f0[_0xdf90('0x1e')](_0xdf90('0x1f'),_0x2e05b8+'-'+_0x15ecd5+'/'+_0xba31f3)['json'](_0x48af5d);}return null;};}function patchUpdates(_0x366f26){return function(_0xb1f1c4){try{jsonpatch[_0xdf90('0x20')](_0xb1f1c4,_0x366f26,!![]);}catch(_0x5425e5){return BPromise[_0xdf90('0x21')](_0x5425e5);}return _0xb1f1c4[_0xdf90('0x22')]();};}function saveUpdates(_0x4bd5e0,_0x33ab05){return function(_0xdecad3){if(_0xdecad3){return _0xdecad3[_0xdf90('0x23')](_0x4bd5e0)[_0xdf90('0x24')](function(_0x94891a){return _0x94891a;});}return null;};}function removeEntity(_0x54b905,_0x4988e3){return function(_0x2f5356){if(_0x2f5356){return _0x2f5356['destroy']()[_0xdf90('0x24')](function(){_0x54b905[_0xdf90('0x1a')](0xcc)[_0xdf90('0x25')]();});}};}function handleEntityNotFound(_0x5b064f,_0x3fbbaa){return function(_0x4722f0){if(!_0x4722f0){_0x5b064f['sendStatus'](0x194);}return _0x4722f0;};}function handleError(_0xbe4d72,_0x5b16a3){_0x5b16a3=_0x5b16a3||0x1f4;return function(_0x199e67){logger['error'](_0x199e67[_0xdf90('0x26')]);if(_0x199e67[_0xdf90('0x27')]){delete _0x199e67[_0xdf90('0x27')];}_0xbe4d72[_0xdf90('0x1a')](_0x5b16a3)[_0xdf90('0x28')](_0x199e67);};}exports[_0xdf90('0x29')]=function(_0x2f6cb1,_0x130ec7){var _0x54643b={},_0x13de77={},_0x4ea530={'count':0x0,'rows':[]};var _0x810a04=db[_0xdf90('0x2a')][_0xdf90('0x2b')];_0x13de77['model']=_['keys'](_0x810a04);_0x13de77[_0xdf90('0x2c')]=_[_0xdf90('0x2d')](_0x2f6cb1[_0xdf90('0x2c')]);_0x13de77['filters']=_[_0xdf90('0x2e')](_0x13de77['model'],_0x13de77[_0xdf90('0x2c')]);_0x54643b['attributes']=_[_0xdf90('0x2e')](_0x13de77[_0xdf90('0x2f')],qs[_0xdf90('0x30')](_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x30')]));_0x54643b[_0xdf90('0x31')]=_0x54643b[_0xdf90('0x31')][_0xdf90('0x32')]?_0x54643b[_0xdf90('0x31')]:_0x13de77['model'];if(!_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x33')](_0xdf90('0x34'))){_0x54643b[_0xdf90('0x1d')]=qs[_0xdf90('0x1d')](_0x2f6cb1['query']['limit']);_0x54643b[_0xdf90('0x1c')]=qs['offset'](_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x1c')]);}_0x54643b[_0xdf90('0x35')]=qs['sort'](_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x36')]);_0x54643b['where']=qs['filters'](_['pick'](_0x2f6cb1[_0xdf90('0x2c')],_0x13de77[_0xdf90('0x37')]));if(_0x2f6cb1[_0xdf90('0x2c')]['filter']){_0x54643b[_0xdf90('0x38')]=_['merge'](_0x54643b[_0xdf90('0x38')],{'$or':_[_0xdf90('0x39')](_0x810a04,function(_0x305b9a){if(_0x305b9a[_0xdf90('0x3a')][_0xdf90('0x3b')]!==_0xdf90('0x3c')){var _0x3257c5={};_0x3257c5[_0x305b9a[_0xdf90('0x3d')]]={'$like':'%'+_0x2f6cb1['query'][_0xdf90('0x3e')]+'%'};return _0x3257c5;}})});}_0x54643b=_[_0xdf90('0x3f')]({},_0x54643b,_0x2f6cb1[_0xdf90('0x40')]);var _0x418343={'where':_0x54643b[_0xdf90('0x38')]};_0x418343[_0xdf90('0x41')]=[];if(_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x42')]){_0x418343[_0xdf90('0x41')][_0xdf90('0x43')]({'model':db[_0xdf90('0x44')],'as':_0xdf90('0x45'),'attributes':['id'],'where':{'id':_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x42')]},'required':!![]});_0x418343['distinct']=!![];}if(_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x46')]){_0x418343[_0xdf90('0x41')]['push']({'model':db[_0xdf90('0x47')],'as':_0xdf90('0x48'),'attributes':['id',_0xdf90('0x49'),_0xdf90('0x4a'),_0xdf90('0x46')],'where':{'direction':'in','read':_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x46')]||![]},'required':!![]});_0x418343[_0xdf90('0x4b')]=!![];}return db['FaxInteraction'][_0xdf90('0x1b')](_0x418343)[_0xdf90('0x24')](function(_0xad185f){_0x4ea530[_0xdf90('0x1b')]=_0xad185f;if(_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x4c')]){_0x54643b[_0xdf90('0x41')]=[{'model':db[_0xdf90('0x4d')],'as':_0xdf90('0x4e'),'required':![],'attributes':['id','name',_0xdf90('0x4f')]},{'model':db['CmContact'],'as':_0xdf90('0x50'),'required':![]},{'model':db['User'],'as':_0xdf90('0x51'),'attributes':[_0xdf90('0x27'),_0xdf90('0x4f'),_0xdf90('0x52')],'required':![]},{'model':db['FaxAccount'],'as':_0xdf90('0x53'),'attributes':[_0xdf90('0x27'),_0xdf90('0x3b')],'required':![]},{'model':db[_0xdf90('0x47')],'as':_0xdf90('0x48'),'attributes':['id',_0xdf90('0x49'),_0xdf90('0x4a'),_0xdf90('0x46')],'where':{'direction':'in','read':_0x2f6cb1[_0xdf90('0x2c')]['read']||![]},'required':_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x46')]||![]},{'model':db[_0xdf90('0x44')],'as':_0xdf90('0x45'),'attributes':['id',_0xdf90('0x27'),_0xdf90('0x54')],'required':_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x42')]?!![]:![]},{'model':db[_0xdf90('0x44')],'as':_0xdf90('0x55'),'attributes':['id',_0xdf90('0x27'),'color'],'through':_0x2f6cb1[_0xdf90('0x2c')]['tag']?{'attributes':[],'where':{'TagId':_0x2f6cb1[_0xdf90('0x2c')]['tag']||undefined}}:{},'required':_0x2f6cb1[_0xdf90('0x2c')][_0xdf90('0x42')]?!![]:![]}];}return db[_0xdf90('0x2a')][_0xdf90('0x56')](_0x54643b);})[_0xdf90('0x24')](function(_0x1d92e5){_0x4ea530[_0xdf90('0x57')]=_0x1d92e5;return _0x4ea530;})[_0xdf90('0x24')](respondWithFilteredResult(_0x130ec7,_0x54643b))[_0xdf90('0x58')](handleError(_0x130ec7,null));};exports[_0xdf90('0x59')]=function(_0x15fce6,_0x39ae72){var _0x516bef={'raw':![],'where':{'id':_0x15fce6['params']['id']}},_0x5c26a7={};_0x5c26a7[_0xdf90('0x2f')]=_[_0xdf90('0x2d')](db[_0xdf90('0x2a')][_0xdf90('0x2b')]);_0x5c26a7[_0xdf90('0x2c')]=_[_0xdf90('0x2d')](_0x15fce6[_0xdf90('0x2c')]);_0x5c26a7[_0xdf90('0x37')]=_[_0xdf90('0x2e')](_0x5c26a7[_0xdf90('0x2f')],_0x5c26a7[_0xdf90('0x2c')]);_0x516bef[_0xdf90('0x31')]=_[_0xdf90('0x2e')](_0x5c26a7[_0xdf90('0x2f')],qs[_0xdf90('0x30')](_0x15fce6['query'][_0xdf90('0x30')]));_0x516bef[_0xdf90('0x31')]=_0x516bef[_0xdf90('0x31')]['length']?_0x516bef['attributes']:_0x5c26a7['model'];if(_0x15fce6[_0xdf90('0x2c')][_0xdf90('0x4c')]){_0x516bef[_0xdf90('0x41')]=[{'all':!![]}];}_0x516bef=_[_0xdf90('0x3f')]({},_0x516bef,_0x15fce6[_0xdf90('0x40')]);return db[_0xdf90('0x2a')][_0xdf90('0x5a')](_0x516bef)[_0xdf90('0x24')](handleEntityNotFound(_0x39ae72,null))[_0xdf90('0x24')](respondWithResult(_0x39ae72,null))[_0xdf90('0x58')](handleError(_0x39ae72,null));};exports[_0xdf90('0x5b')]=function(_0x44ab1a,_0x5a671d){return db[_0xdf90('0x2a')][_0xdf90('0x5b')](_0x44ab1a[_0xdf90('0x5c')],{})['then'](respondWithResult(_0x5a671d,0xc9))['catch'](handleError(_0x5a671d,null));};exports[_0xdf90('0x23')]=function(_0x27c814,_0x27d099){if(_0x27c814[_0xdf90('0x5c')]['id']){delete _0x27c814[_0xdf90('0x5c')]['id'];}return db[_0xdf90('0x2a')]['find']({'where':{'id':_0x27c814[_0xdf90('0x5d')]['id']}})[_0xdf90('0x24')](handleEntityNotFound(_0x27d099,null))[_0xdf90('0x24')](saveUpdates(_0x27c814[_0xdf90('0x5c')],null))['then'](respondWithResult(_0x27d099,null))[_0xdf90('0x58')](handleError(_0x27d099,null));};exports[_0xdf90('0x5e')]=function(_0x170886,_0x3ec335){return db['FaxInteraction'][_0xdf90('0x5a')]({'where':{'id':_0x170886[_0xdf90('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3ec335,null))[_0xdf90('0x24')](removeEntity(_0x3ec335,null))[_0xdf90('0x58')](handleError(_0x3ec335,null));};exports[_0xdf90('0x5f')]=function(_0x4d1b43,_0x4197be){return db[_0xdf90('0x2a')][_0xdf90('0x5f')]()[_0xdf90('0x24')](respondWithResult(_0x4197be,null))[_0xdf90('0x58')](handleError(_0x4197be,null));};exports[_0xdf90('0x60')]=function(_0x2855c5,_0x2294c6,_0x498093){return db[_0xdf90('0x47')][_0xdf90('0x5a')]({'where':{'id':_0x2855c5['params']['id']}})['then'](handleEntityNotFound(_0x2294c6,null))[_0xdf90('0x24')](function(_0x3c10ee){if(_0x3c10ee){return _0x3c10ee[_0xdf90('0x60')](_0x2855c5[_0xdf90('0x5c')][_0xdf90('0x61')],_[_0xdf90('0x62')](_0x2855c5[_0xdf90('0x5c')],[_0xdf90('0x61'),'id'])||{});}})[_0xdf90('0x24')](respondWithResult(_0x2294c6,null))[_0xdf90('0x58')](handleError(_0x2294c6,null));};exports[_0xdf90('0x63')]=function(_0x527e7f,_0x2812bc,_0x1b4e8d){var _0x4d55f8={'raw':![],'where':{}};var _0x518324={};var _0x420153={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xdf90('0x64')]({'where':{'id':_0x527e7f[_0xdf90('0x5d')]['id']}})[_0xdf90('0x24')](handleEntityNotFound(_0x2812bc,null))[_0xdf90('0x24')](function(_0x155aa5){if(_0x155aa5){_0x518324[_0xdf90('0x2f')]=_[_0xdf90('0x2d')](db[_0xdf90('0x47')][_0xdf90('0x2b')]);_0x518324[_0xdf90('0x2c')]=_[_0xdf90('0x2d')](_0x527e7f[_0xdf90('0x2c')]);_0x518324['filters']=_[_0xdf90('0x2e')](_0x518324['model'],_0x518324[_0xdf90('0x2c')]);_0x4d55f8['attributes']=_['intersection'](_0x518324[_0xdf90('0x2f')],qs[_0xdf90('0x30')](_0x527e7f['query']['fields']));_0x4d55f8[_0xdf90('0x31')]=_0x4d55f8[_0xdf90('0x31')][_0xdf90('0x32')]?_0x4d55f8['attributes']:_0x518324[_0xdf90('0x2f')];if(!_0x527e7f[_0xdf90('0x2c')]['hasOwnProperty'](_0xdf90('0x34'))){_0x4d55f8['limit']=qs[_0xdf90('0x1d')](_0x527e7f[_0xdf90('0x2c')]['limit']);_0x4d55f8[_0xdf90('0x1c')]=qs[_0xdf90('0x1c')](_0x527e7f[_0xdf90('0x2c')][_0xdf90('0x1c')]);}_0x4d55f8[_0xdf90('0x35')]=qs[_0xdf90('0x36')](_0x527e7f[_0xdf90('0x2c')][_0xdf90('0x36')]);_0x4d55f8[_0xdf90('0x38')]=qs['filters'](_[_0xdf90('0x65')](_0x527e7f[_0xdf90('0x2c')],_0x518324[_0xdf90('0x37')]));_0x4d55f8[_0xdf90('0x38')]['FaxInteractionId']=_0x155aa5['id'];if(_0x527e7f[_0xdf90('0x2c')][_0xdf90('0x3e')]){_0x4d55f8['where']=_[_0xdf90('0x3f')](_0x4d55f8['where'],{'$or':_[_0xdf90('0x39')](_0x4d55f8[_0xdf90('0x31')],function(_0x2f5406){var _0x3062a3={};_0x3062a3[_0x2f5406]={'$like':'%'+_0x527e7f[_0xdf90('0x2c')][_0xdf90('0x3e')]+'%'};return _0x3062a3;})});}if(_0x527e7f['query']['$gte']){var _0x2685fb=_0x527e7f[_0xdf90('0x2c')][_0xdf90('0x66')][_0xdf90('0x67')](',');var _0x498e65={};_0x498e65[_0x2685fb[0x0]]={'$gte':moment(_0x2685fb[0x1])[_0xdf90('0x68')](_0xdf90('0x69'))};_0x4d55f8['where']=_[_0xdf90('0x3f')](_0x4d55f8[_0xdf90('0x38')],_0x498e65);}_0x4d55f8=_[_0xdf90('0x3f')]({},_0x4d55f8,_0x527e7f[_0xdf90('0x40')]);return db[_0xdf90('0x47')][_0xdf90('0x1b')]({'where':_0x4d55f8[_0xdf90('0x38')]})[_0xdf90('0x24')](function(_0x402c71){_0x420153[_0xdf90('0x1b')]=_0x402c71;if(_0x527e7f[_0xdf90('0x2c')]['includeAll']){_0x4d55f8['include']=[{'all':!![]}];}return db[_0xdf90('0x47')][_0xdf90('0x56')](_0x4d55f8);})[_0xdf90('0x24')](function(_0x284189){_0x420153[_0xdf90('0x57')]=_0x284189;return _0x420153;});}})[_0xdf90('0x24')](respondWithFilteredResult(_0x2812bc,_0x4d55f8))['catch'](handleError(_0x2812bc,null));};exports[_0xdf90('0x6a')]=function(_0x180eba,_0x32a140,_0x2e055a){return db[_0xdf90('0x2a')]['find']({'where':{'id':_0x180eba[_0xdf90('0x5d')]['id']}})[_0xdf90('0x24')](handleEntityNotFound(_0x32a140,null))[_0xdf90('0x24')](function(_0x4f4fe4){if(_0x4f4fe4){return _0x4f4fe4['setTags'](_0x180eba[_0xdf90('0x5c')][_0xdf90('0x61')],_[_0xdf90('0x62')](_0x180eba['body'],[_0xdf90('0x61'),'id'])||{})[_0xdf90('0x6b')](function(){return db[_0xdf90('0x44')][_0xdf90('0x56')]({'attributes':['id',_0xdf90('0x27'),_0xdf90('0x54')],'where':{'id':_0x180eba[_0xdf90('0x5c')][_0xdf90('0x61')]}});})[_0xdf90('0x24')](function(_0x4009d5){socket[_0xdf90('0x6c')](_0xdf90('0x6d'),{'id':Number(_0x180eba[_0xdf90('0x5d')]['id']),'tags':_0x4009d5||[]});return{'id':Number(_0x180eba[_0xdf90('0x5d')]['id']),'tags':_0x4009d5||[]};});}})[_0xdf90('0x24')](respondWithResult(_0x32a140,null))['catch'](handleError(_0x32a140,null));};exports[_0xdf90('0x6e')]=function(_0x40c05c,_0x264a4c,_0x4f106f){var _0x40f64d;return db[_0xdf90('0x2a')][_0xdf90('0x5a')]({'where':{'id':_0x40c05c[_0xdf90('0x5d')]['id']}})[_0xdf90('0x24')](handleEntityNotFound(_0x264a4c,null))[_0xdf90('0x24')](function(_0x7fb4bb){if(_0x7fb4bb){return _0x7fb4bb['removeTags'](_0x40c05c['query']['ids']);}})[_0xdf90('0x24')](respondWithStatusCode(_0x264a4c,null))['catch'](handleError(_0x264a4c,null));};exports['download']=function(_0x3bc4ce,_0x238be0){var _0xd39d59=moment()[_0xdf90('0x6f')]()[_0xdf90('0x70')]();var _0x156b0f=path['join'](config[_0xdf90('0x71')],_0xdf90('0x72'),'files','attachments');var _0x2fa7fd=path[_0xdf90('0x73')](config['root'],_0xdf90('0x72'),'files','tmp');var _0x5aa3ec=path[_0xdf90('0x73')](_0x2fa7fd,_0xd39d59);var _0x2adc3c=util[_0xdf90('0x68')](_0xdf90('0x74'),_0xd39d59);var _0x476582=path[_0xdf90('0x73')](_0x2fa7fd,_0x2adc3c);var _0x20707c=![];return db[_0xdf90('0x2a')][_0xdf90('0x5a')]({'where':{'id':_0x3bc4ce[_0xdf90('0x5d')]['id']}})[_0xdf90('0x24')](handleEntityNotFound(_0x238be0,null))[_0xdf90('0x24')](function(_0xe5fc17){if(_0xe5fc17){return _0xe5fc17[_0xdf90('0x63')]({'attributes':['id',_0xdf90('0x5c'),_0xdf90('0x4a')],'include':[{'model':db[_0xdf90('0x75')],'as':_0xdf90('0x75')}]});}return[];})[_0xdf90('0x24')](function(_0x3c99fb){_0x20707c=_0x3c99fb[_0xdf90('0x32')];if(_0x3c99fb[_0xdf90('0x32')]){fs['mkdirSync'](_0x5aa3ec);for(var _0x340a83=0x0;_0x340a83<_0x3c99fb[_0xdf90('0x32')];_0x340a83++){var _0x278e36=_0x3c99fb[_0x340a83];var _0x5c8fc2=_0x278e36[_0xdf90('0x75')];if(_0x5c8fc2){var _0x41d6c1=path[_0xdf90('0x73')](_0x156b0f,_0x5c8fc2[_0xdf90('0x76')]);if(fs[_0xdf90('0x77')](_0x41d6c1)){fs[_0xdf90('0x78')](_0x41d6c1)[_0xdf90('0x79')](fs[_0xdf90('0x7a')](path[_0xdf90('0x73')](_0x5aa3ec,_0x5c8fc2[_0xdf90('0x76')])));}}}}})['then'](function(){if(_0x20707c){return new BPromise(function(_0x2e5c28,_0x4e9cae){zipdir(_0x5aa3ec,{'saveTo':_0x476582},function(_0x22e106,_0x3df987){if(_0x22e106)return _0x4e9cae(_0x22e106);return _0x2e5c28(_0x3df987);});});}})[_0xdf90('0x24')](function(){if(_0x20707c){return new BPromise(function(_0x46eb1f,_0x7d1dcd){rimraf(_0x5aa3ec,function(_0x5714a2){if(_0x5714a2)_0x7d1dcd(_0x5714a2);return _0x46eb1f();});});}})[_0xdf90('0x24')](function(){if(_0x20707c){return _0x238be0[_0xdf90('0x7b')](_0x476582,_0x2adc3c,function(_0x56a206){if(_0x56a206){console['log']('err',_0x56a206);}else{fs[_0xdf90('0x7c')](_0x476582);}});}else{return _0x238be0[_0xdf90('0x19')](0xc8);}})['catch'](handleError(_0x238be0,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index a770a8e..f2a9755 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 _0xea28=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0xea28,0x13a));var _0x8ea2=function(_0x96060c,_0x4e0b75){_0x96060c=_0x96060c-0x0;var _0x24e070=_0xea28[_0x96060c];return _0x24e070;};'use strict';var EventEmitter=require(_0x8ea2('0x0'));var FaxInteraction=require(_0x8ea2('0x1'))['db'][_0x8ea2('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x8ea2('0x3')](0x0);var events={'afterCreate':_0x8ea2('0x4'),'afterUpdate':_0x8ea2('0x5'),'afterDestroy':_0x8ea2('0x6')};function emitEvent(_0x10f7bb){return function(_0x4b7cda,_0x9b45ab,_0x23aaf1){FaxInteractionEvents[_0x8ea2('0x7')](_0x10f7bb+':'+_0x4b7cda['id'],_0x4b7cda);FaxInteractionEvents['emit'](_0x10f7bb,_0x4b7cda);_0x23aaf1(null);};}for(var e in events){if(events[_0x8ea2('0x8')](e)){var event=events[e];FaxInteraction[_0x8ea2('0x9')](e,emitEvent(event));}}module[_0x8ea2('0xa')]=FaxInteractionEvents; \ No newline at end of file +var _0xda3f=['exports','../../mysqldb','FaxInteraction','remove','emit'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xda3f,0xec));var _0xfda3=function(_0x328e0d,_0x4317e6){_0x328e0d=_0x328e0d-0x0;var _0xe14786=_0xda3f[_0x328e0d];return _0xe14786;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xfda3('0x0'))['db'][_0xfda3('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfda3('0x2')};function emitEvent(_0x581693){return function(_0x36dc71,_0x22187d,_0x516500){FaxInteractionEvents[_0xfda3('0x3')](_0x581693+':'+_0x36dc71['id'],_0x36dc71);FaxInteractionEvents[_0xfda3('0x3')](_0x581693,_0x36dc71);_0x516500(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xfda3('0x4')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 76ce204..d2373c0 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 _0xa9e0=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','./faxInteraction.attributes','exports','define','fax_interactions','closed'];(function(_0xafbeba,_0x36b5d8){var _0x4fee77=function(_0x48b290){while(--_0x48b290){_0xafbeba['push'](_0xafbeba['shift']());}};_0x4fee77(++_0x36b5d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var attributes=require(_0x0a9e('0x4'));module[_0x0a9e('0x5')]=function(_0x2ab90b,_0x991246){return _0x2ab90b[_0x0a9e('0x6')]('FaxInteraction',attributes,{'tableName':_0x0a9e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x441e3a,_0x2cc193,_0x5f41ea){if(_0x441e3a['changed'](_0x0a9e('0x8'))){_0x441e3a['closedAt']=moment()['format'](_0x0a9e('0x9'));}_0x5f41ea(null,_0x441e3a);}}});}; \ No newline at end of file +var _0xa9e0=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','./faxInteraction.attributes','exports','define','fax_interactions','closed'];(function(_0xbf93f1,_0xe9eb3){var _0x4cc22a=function(_0x76a39a){while(--_0x76a39a){_0xbf93f1['push'](_0xbf93f1['shift']());}};_0x4cc22a(++_0xe9eb3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 attributes=require(_0x0a9e('0x4'));module[_0x0a9e('0x5')]=function(_0x2ab90b,_0x991246){return _0x2ab90b[_0x0a9e('0x6')]('FaxInteraction',attributes,{'tableName':_0x0a9e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x441e3a,_0x2cc193,_0x5f41ea){if(_0x441e3a['changed'](_0x0a9e('0x8'))){_0x441e3a['closedAt']=moment()['format'](_0x0a9e('0x9'));}_0x5f41ea(null,_0x441e3a);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 4163330..918f193 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 _0x477d=['where','addTags','body','ids','omit','AddTags','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','limit','AddTagsToFaxInteraction'];(function(_0x1c8d31,_0xc62476){var _0x19ef1a=function(_0x1226ab){while(--_0x1226ab){_0x1c8d31['push'](_0x1c8d31['shift']());}};_0x19ef1a(++_0xc62476);}(_0x477d,0x78));var _0xd477=function(_0x5c3298,_0x2429e9){_0x5c3298=_0x5c3298-0x0;var _0x4a0cfd=_0x477d[_0x5c3298];return _0x4a0cfd;};'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('ioredis');var db=require(_0xd477('0x0'))['db'];var utils=require('../../config/utils');var logger=require(_0xd477('0x1'))(_0xd477('0x2'));var config=require(_0xd477('0x3'));var jayson=require(_0xd477('0x4'));var client=jayson[_0xd477('0x5')][_0xd477('0x6')]({'port':0x232a});config[_0xd477('0x7')]=_[_0xd477('0x8')](config[_0xd477('0x7')],{'host':_0xd477('0x9'),'port':0x18eb});var socket=require(_0xd477('0xa'))(new Redis(config[_0xd477('0x7')]));require('./faxInteraction.socket')[_0xd477('0xb')](socket);function respondWithRpcPromise(_0x152445,_0x54e9bf,_0x3a6260){return new BPromise(function(_0x36f9c7,_0x3fefe0){return client[_0xd477('0xc')](_0x152445,_0x3a6260)[_0xd477('0xd')](function(_0x58449a){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x54e9bf,'request\x20sent');logger[_0xd477('0xe')](_0xd477('0xf'),_0x54e9bf,_0xd477('0x10'),JSON[_0xd477('0x11')](_0x58449a));if(_0x58449a[_0xd477('0x12')]){if(_0x58449a[_0xd477('0x12')][_0xd477('0x13')]===0x1f4){logger[_0xd477('0x12')](_0xd477('0x14'),_0x54e9bf,_0x58449a[_0xd477('0x12')][_0xd477('0x15')]);return _0x3fefe0(_0x58449a[_0xd477('0x12')][_0xd477('0x15')]);}logger[_0xd477('0x12')](_0xd477('0x14'),_0x54e9bf,_0x58449a[_0xd477('0x12')][_0xd477('0x15')]);return _0x36f9c7(_0x58449a[_0xd477('0x12')][_0xd477('0x15')]);}else{logger[_0xd477('0x16')](_0xd477('0x14'),_0x54e9bf,_0xd477('0x10'));_0x36f9c7(_0x58449a[_0xd477('0x17')][_0xd477('0x15')]);}})[_0xd477('0x18')](function(_0x1c9811){logger[_0xd477('0x12')](_0xd477('0x14'),_0x54e9bf,_0x1c9811);_0x3fefe0(_0x1c9811);});});}exports[_0xd477('0x19')]=function(_0x3b5354){var _0x272319=this;return new Promise(function(_0x13fcd6,_0x4b8fa0){return db[_0xd477('0x1a')][_0xd477('0x1b')](_0x3b5354['body'],{'raw':_0x3b5354[_0xd477('0x1c')]?_0x3b5354['options'][_0xd477('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b5354[_0xd477('0x1c')]?_0x3b5354[_0xd477('0x1c')]['where']||null:null,'attributes':_0x3b5354[_0xd477('0x1c')]?_0x3b5354['options']['attributes']||null:null,'limit':_0x3b5354[_0xd477('0x1c')]?_0x3b5354['options'][_0xd477('0x1e')]||null:null})[_0xd477('0xd')](function(_0x2c6ab2){logger[_0xd477('0x16')](_0xd477('0x19'),_0x3b5354);logger[_0xd477('0xe')](_0xd477('0x19'),_0x3b5354,JSON[_0xd477('0x11')](_0x2c6ab2));_0x13fcd6(_0x2c6ab2);})[_0xd477('0x18')](function(_0xa098ae){logger[_0xd477('0x12')]('UpdateFaxInteraction',_0xa098ae[_0xd477('0x15')],_0x3b5354);_0x4b8fa0(_0x272319[_0xd477('0x12')](0x1f4,_0xa098ae[_0xd477('0x15')]));});});};exports[_0xd477('0x1f')]=function(_0x359b75){return new Promise(function(_0x342eb3,_0x20591f){return db[_0xd477('0x1a')]['find']({'where':_0x359b75[_0xd477('0x1c')]?_0x359b75[_0xd477('0x1c')][_0xd477('0x20')]||null:null})[_0xd477('0xd')](function(_0x38bbd1){if(_0x38bbd1){return _0x38bbd1[_0xd477('0x21')](_0x359b75[_0xd477('0x22')][_0xd477('0x23')],_[_0xd477('0x24')](_0x359b75['body'],[_0xd477('0x23'),'id'])||{});}})['spread'](function(_0x11b77f){logger[_0xd477('0x16')]('AddTags',_0x359b75);logger[_0xd477('0xe')]('AddTags',_0x359b75,JSON[_0xd477('0x11')](_0x11b77f));_0x342eb3(_0x11b77f);})[_0xd477('0x18')](function(_0x376a24){logger[_0xd477('0x12')](_0xd477('0x25'),_0x376a24[_0xd477('0x15')],_0x359b75);_0x20591f(_this['error'](0x1f4,_0x376a24[_0xd477('0x15')]));});});}; \ No newline at end of file +var _0xd7ff=['client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','body','options','raw','where','then','info','stringify','AddTagsToFaxInteraction','FaxInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2d98a4,_0x27e3e2){var _0x404911=function(_0x3f4c2c){while(--_0x3f4c2c){_0x2d98a4['push'](_0x2d98a4['shift']());}};_0x404911(++_0x27e3e2);}(_0xd7ff,0xa3));var _0xfd7f=function(_0x4d31e2,_0x222200){_0x4d31e2=_0x4d31e2-0x0;var _0x5a73f4=_0xd7ff[_0x4d31e2];return _0x5a73f4;};'use strict';var _=require(_0xfd7f('0x0'));var util=require(_0xfd7f('0x1'));var moment=require(_0xfd7f('0x2'));var BPromise=require(_0xfd7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd7f('0x4'))['db'];var utils=require(_0xfd7f('0x5'));var logger=require('../../config/logger')(_0xfd7f('0x6'));var config=require(_0xfd7f('0x7'));var jayson=require(_0xfd7f('0x8'));var client=jayson[_0xfd7f('0x9')][_0xfd7f('0xa')]({'port':0x232a});config[_0xfd7f('0xb')]=_[_0xfd7f('0xc')](config[_0xfd7f('0xb')],{'host':_0xfd7f('0xd'),'port':0x18eb});var socket=require(_0xfd7f('0xe'))(new Redis(config['redis']));require(_0xfd7f('0xf'))[_0xfd7f('0x10')](socket);function respondWithRpcPromise(_0x107048,_0x28e772,_0x4ea953){return new BPromise(function(_0x40edd3,_0x37beab){return client[_0xfd7f('0x11')](_0x107048,_0x4ea953)['then'](function(_0x58d722){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x28e772,'request\x20sent');logger[_0xfd7f('0x12')](_0xfd7f('0x13'),_0x28e772,_0xfd7f('0x14'),JSON['stringify'](_0x58d722));if(_0x58d722[_0xfd7f('0x15')]){if(_0x58d722[_0xfd7f('0x15')][_0xfd7f('0x16')]===0x1f4){logger['error'](_0xfd7f('0x17'),_0x28e772,_0x58d722[_0xfd7f('0x15')]['message']);return _0x37beab(_0x58d722[_0xfd7f('0x15')][_0xfd7f('0x18')]);}logger[_0xfd7f('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x28e772,_0x58d722[_0xfd7f('0x15')][_0xfd7f('0x18')]);return _0x40edd3(_0x58d722[_0xfd7f('0x15')][_0xfd7f('0x18')]);}else{logger['info'](_0xfd7f('0x17'),_0x28e772,'request\x20sent');_0x40edd3(_0x58d722[_0xfd7f('0x19')]['message']);}})[_0xfd7f('0x1a')](function(_0x189415){logger[_0xfd7f('0x15')](_0xfd7f('0x17'),_0x28e772,_0x189415);_0x37beab(_0x189415);});});}exports[_0xfd7f('0x1b')]=function(_0x16ee14){var _0x3b42b3=this;return new Promise(function(_0x17d692,_0x18ac9f){return db['FaxInteraction']['update'](_0x16ee14[_0xfd7f('0x1c')],{'raw':_0x16ee14[_0xfd7f('0x1d')]?_0x16ee14[_0xfd7f('0x1d')][_0xfd7f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16ee14[_0xfd7f('0x1d')]?_0x16ee14[_0xfd7f('0x1d')][_0xfd7f('0x1f')]||null:null,'attributes':_0x16ee14[_0xfd7f('0x1d')]?_0x16ee14[_0xfd7f('0x1d')]['attributes']||null:null,'limit':_0x16ee14['options']?_0x16ee14[_0xfd7f('0x1d')]['limit']||null:null})[_0xfd7f('0x20')](function(_0x318ec4){logger[_0xfd7f('0x21')]('UpdateFaxInteraction',_0x16ee14);logger['debug']('UpdateFaxInteraction',_0x16ee14,JSON[_0xfd7f('0x22')](_0x318ec4));_0x17d692(_0x318ec4);})[_0xfd7f('0x1a')](function(_0xd50365){logger[_0xfd7f('0x15')]('UpdateFaxInteraction',_0xd50365[_0xfd7f('0x18')],_0x16ee14);_0x18ac9f(_0x3b42b3[_0xfd7f('0x15')](0x1f4,_0xd50365[_0xfd7f('0x18')]));});});};exports[_0xfd7f('0x23')]=function(_0x39f1a2){return new Promise(function(_0x1cbbe2,_0x5d09e6){return db[_0xfd7f('0x24')][_0xfd7f('0x25')]({'where':_0x39f1a2[_0xfd7f('0x1d')]?_0x39f1a2['options'][_0xfd7f('0x1f')]||null:null})[_0xfd7f('0x20')](function(_0x2a230d){if(_0x2a230d){return _0x2a230d[_0xfd7f('0x26')](_0x39f1a2['body']['ids'],_[_0xfd7f('0x27')](_0x39f1a2['body'],[_0xfd7f('0x28'),'id'])||{});}})[_0xfd7f('0x29')](function(_0x1306b){logger[_0xfd7f('0x21')](_0xfd7f('0x2a'),_0x39f1a2);logger[_0xfd7f('0x12')](_0xfd7f('0x2a'),_0x39f1a2,JSON[_0xfd7f('0x22')](_0x1306b));_0x1cbbe2(_0x1306b);})[_0xfd7f('0x1a')](function(_0x379806){logger[_0xfd7f('0x15')]('AddTags',_0x379806[_0xfd7f('0x18')],_0x39f1a2);_0x5d09e6(_this[_0xfd7f('0x15')](0x1f4,_0x379806['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 72bcef6..6e6d9ea 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 _0xc779=['length','save','remove','update','emit','register'];(function(_0x4caaf9,_0xcea5cf){var _0x189ce4=function(_0x4db363){while(--_0x4db363){_0x4caaf9['push'](_0x4caaf9['shift']());}};_0x189ce4(++_0xcea5cf);}(_0xc779,0x73));var _0x9c77=function(_0xa2a437,_0x225fed){_0xa2a437=_0xa2a437-0x0;var _0x2b2f52=_0xc779[_0xa2a437];return _0x2b2f52;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x9c77('0x0'),_0x9c77('0x1'),_0x9c77('0x2')];function createListener(_0x34d895,_0x51efac){return function(_0x2a95e1){_0x51efac[_0x9c77('0x3')](_0x34d895,_0x2a95e1);};}function removeListener(_0x413520,_0x56c97f){return function(){FaxInteractionEvents['removeListener'](_0x413520,_0x56c97f);};}exports[_0x9c77('0x4')]=function(_0x41d9cd){for(var _0x4c25d2=0x0,_0x4b4c70=events[_0x9c77('0x5')];_0x4c25d2<_0x4b4c70;_0x4c25d2++){var _0x5b9682=events[_0x4c25d2];var _0x3653ba=createListener('faxInteraction:'+_0x5b9682,_0x41d9cd);FaxInteractionEvents['on'](_0x5b9682,_0x3653ba);}}; \ No newline at end of file +var _0xce66=['save','remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x2db452,_0x1e2ff5){var _0x250db4=function(_0x3caf53){while(--_0x3caf53){_0x2db452['push'](_0x2db452['shift']());}};_0x250db4(++_0x1e2ff5);}(_0xce66,0x116));var _0x6ce6=function(_0x3c81b5,_0x3f5ed7){_0x3c81b5=_0x3c81b5-0x0;var _0x5888c4=_0xce66[_0x3c81b5];return _0x5888c4;};'use strict';var FaxInteractionEvents=require(_0x6ce6('0x0'));var events=[_0x6ce6('0x1'),_0x6ce6('0x2'),_0x6ce6('0x3')];function createListener(_0x2e7a1d,_0x3a8a9b){return function(_0x3abdde){_0x3a8a9b[_0x6ce6('0x4')](_0x2e7a1d,_0x3abdde);};}function removeListener(_0x4354c3,_0x2907a1){return function(){FaxInteractionEvents[_0x6ce6('0x5')](_0x4354c3,_0x2907a1);};}exports[_0x6ce6('0x6')]=function(_0x28c4c0){for(var _0xdd6c5a=0x0,_0x43b951=events[_0x6ce6('0x7')];_0xdd6c5a<_0x43b951;_0xdd6c5a++){var _0x419c2e=events[_0xdd6c5a];var _0x1d9cdb=createListener(_0x6ce6('0x8')+_0x419c2e,_0x28c4c0);FaxInteractionEvents['on'](_0x419c2e,_0x1d9cdb);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 593873a..0e86d0e 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 _0x20d9=['faxinteraction:addtags','addTags','put','faxinteraction:update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','post','create','addMessage','/:id/tags','tracked','fax'];(function(_0x3f3264,_0xddbf9e){var _0x546445=function(_0x4b843d){while(--_0x4b843d){_0x3f3264['push'](_0x3f3264['shift']());}};_0x546445(++_0xddbf9e);}(_0x20d9,0x89));var _0x920d=function(_0x155f53,_0x4f67af){_0x155f53=_0x155f53-0x0;var _0x136cd9=_0x20d9[_0x155f53];return _0x136cd9;};'use strict';var multer=require(_0x920d('0x0'));var util=require(_0x920d('0x1'));var path=require(_0x920d('0x2'));var timeout=require(_0x920d('0x3'));var express=require(_0x920d('0x4'));var router=express[_0x920d('0x5')]();var auth=require(_0x920d('0x6'));var interaction=require(_0x920d('0x7'));var config=require(_0x920d('0x8'));var controller=require('./faxInteraction.controller');router[_0x920d('0x9')]('/',auth[_0x920d('0xa')](),controller[_0x920d('0xb')]);router['get'](_0x920d('0xc'),auth['isAuthenticated'](),controller[_0x920d('0xd')]);router[_0x920d('0x9')](_0x920d('0xe'),auth[_0x920d('0xa')](),controller[_0x920d('0xf')]);router[_0x920d('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x920d('0x10')]);router[_0x920d('0x9')]('/:id/download',auth[_0x920d('0xa')](),controller['download']);router[_0x920d('0x11')]('/',auth['isAuthenticated'](),controller[_0x920d('0x12')]);router['post']('/:id/messages',auth[_0x920d('0xa')](),controller[_0x920d('0x13')]);router[_0x920d('0x11')](_0x920d('0x14'),auth[_0x920d('0xa')](),interaction[_0x920d('0x15')](_0x920d('0x16'),_0x920d('0x17')),controller[_0x920d('0x18')]);router[_0x920d('0x19')](_0x920d('0xe'),auth[_0x920d('0xa')](),interaction['tracked'](_0x920d('0x16'),_0x920d('0x1a')),controller['update']);router[_0x920d('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0x920d('0x15')](_0x920d('0x16'),_0x920d('0x1c')),controller[_0x920d('0x1d')]);router[_0x920d('0x1b')](_0x920d('0x14'),auth[_0x920d('0xa')](),controller[_0x920d('0x1e')]);module[_0x920d('0x1f')]=router; \ No newline at end of file +var _0x3557=['update','delete','faxinteraction:destroy','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','describe','show','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','/:id','faxinteraction:update'];(function(_0x4d44cd,_0xff0a10){var _0x563eb1=function(_0x15a57b){while(--_0x15a57b){_0x4d44cd['push'](_0x4d44cd['shift']());}};_0x563eb1(++_0xff0a10);}(_0x3557,0xb9));var _0x7355=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x3557[_0x1e500e];return _0x10dc5e;};'use strict';var multer=require('multer');var util=require(_0x7355('0x0'));var path=require(_0x7355('0x1'));var timeout=require('connect-timeout');var express=require(_0x7355('0x2'));var router=express[_0x7355('0x3')]();var auth=require(_0x7355('0x4'));var interaction=require(_0x7355('0x5'));var config=require(_0x7355('0x6'));var controller=require(_0x7355('0x7'));router['get']('/',auth[_0x7355('0x8')](),controller['index']);router[_0x7355('0x9')](_0x7355('0xa'),auth['isAuthenticated'](),controller[_0x7355('0xb')]);router[_0x7355('0x9')]('/:id',auth[_0x7355('0x8')](),controller[_0x7355('0xc')]);router[_0x7355('0x9')]('/:id/messages',auth[_0x7355('0x8')](),controller[_0x7355('0xd')]);router[_0x7355('0x9')](_0x7355('0xe'),auth[_0x7355('0x8')](),controller[_0x7355('0xf')]);router[_0x7355('0x10')]('/',auth[_0x7355('0x8')](),controller[_0x7355('0x11')]);router[_0x7355('0x10')]('/:id/messages',auth[_0x7355('0x8')](),controller[_0x7355('0x12')]);router['post'](_0x7355('0x13'),auth[_0x7355('0x8')](),interaction[_0x7355('0x14')](_0x7355('0x15'),_0x7355('0x16')),controller['addTags']);router['put'](_0x7355('0x17'),auth[_0x7355('0x8')](),interaction[_0x7355('0x14')](_0x7355('0x15'),_0x7355('0x18')),controller[_0x7355('0x19')]);router[_0x7355('0x1a')](_0x7355('0x17'),auth[_0x7355('0x8')](),interaction['tracked'](_0x7355('0x15'),_0x7355('0x1b')),controller[_0x7355('0x1c')]);router[_0x7355('0x1a')]('/:id/tags',auth[_0x7355('0x8')](),controller['removeTags']);module[_0x7355('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 48c7822..621c273 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 _0x4a5e=['DATE','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0xfdbeff,_0x38de63){var _0x371730=function(_0x4e0ab9){while(--_0x4e0ab9){_0xfdbeff['push'](_0xfdbeff['shift']());}};_0x371730(++_0x38de63);}(_0x4a5e,0x158));var _0xe4a5=function(_0x33155c,_0x3fdde1){_0x33155c=_0x33155c-0x0;var _0x5becf7=_0x4a5e[_0x33155c];return _0x5becf7;};'use strict';var Sequelize=require(_0xe4a5('0x0'));module[_0xe4a5('0x1')]={'body':{'type':Sequelize[_0xe4a5('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe4a5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe4a5('0x4')]('in',_0xe4a5('0x5')),'defaultValue':_0xe4a5('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xe4a5('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xe4a5('0x6')]}}; \ No newline at end of file +var _0x6cdb=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out'];(function(_0x442a1b,_0x32c1b5){var _0x4d2c57=function(_0x444f6e){while(--_0x444f6e){_0x442a1b['push'](_0x442a1b['shift']());}};_0x4d2c57(++_0x32c1b5);}(_0x6cdb,0x175));var _0xb6cd=function(_0x5bf042,_0x3a8eb7){_0x5bf042=_0x5bf042-0x0;var _0x4864cf=_0x6cdb[_0x5bf042];return _0x4864cf;};'use strict';var Sequelize=require(_0xb6cd('0x0'));module['exports']={'body':{'type':Sequelize[_0xb6cd('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb6cd('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb6cd('0x3')]('in',_0xb6cd('0x4')),'defaultValue':_0xb6cd('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xb6cd('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xb6cd('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index e64847c..0d5c4dc 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 _0x762d=['key','field','merge','options','FaxMessage','includeAll','include','findAll','catch','show','params','find','body','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','manual','interface','name','channel','EventManager','acceptmessage','agent','RejectMessage','rejectMessage','SIP/%s','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','join','root','server','files','download','basename','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','send','index','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type'];(function(_0x50f112,_0xd38e53){var _0x4ecf28=function(_0x62b75){while(--_0x62b75){_0x50f112['push'](_0x50f112['shift']());}};_0x4ecf28(++_0xd38e53);}(_0x762d,0x1b9));var _0xd762=function(_0x6adc18,_0x2b463e){_0x6adc18=_0x6adc18-0x0;var _0x32478a=_0x762d[_0x6adc18];return _0x32478a;};'use strict';var pdf=require(_0xd762('0x0'));var emlformat=require(_0xd762('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd762('0x2'));var jsonpatch=require(_0xd762('0x3'));var rp=require(_0xd762('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xd762('0x5'));var csv=require(_0xd762('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd762('0x7'));var squel=require('squel');var crypto=require(_0xd762('0x8'));var jsforce=require(_0xd762('0x9'));var deskjs=require(_0xd762('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd762('0xb'));var Papa=require(_0xd762('0xc'));var authService=require(_0xd762('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xd762('0xe'));var qs=require(_0xd762('0xf'));var logger=require(_0xd762('0x10'))(_0xd762('0x11'));var utils=require(_0xd762('0x12'));var config=require(_0xd762('0x13'));var db=require(_0xd762('0x14'))['db'];config[_0xd762('0x15')]=_[_0xd762('0x16')](config[_0xd762('0x15')],{'host':_0xd762('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')[_0xd762('0x18')](socket);var jayson=require(_0xd762('0x19'));var client=jayson[_0xd762('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0xd762('0x1a')][_0xd762('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x44df86,_0x4ce0ed,_0x32dd5a,_0x303765){return new BPromise(function(_0x201a06,_0xb2d77e){var _0x34349c=_0x303765||client;return _0x34349c[_0xd762('0x1c')](_0x44df86,_0x32dd5a)['then'](function(_0x272ccc){logger['info'](_0xd762('0x1d'),_0x4ce0ed,'request\x20sent');logger[_0xd762('0x1e')](_0xd762('0x1f'),_0x4ce0ed,_0xd762('0x20'),JSON['stringify'](_0x272ccc));if(_0x272ccc[_0xd762('0x21')]){if(_0x272ccc[_0xd762('0x21')]['code']===0x1f4){logger['error'](_0xd762('0x1d'),_0x4ce0ed,_0x272ccc['error'][_0xd762('0x22')]);return _0xb2d77e(_0x272ccc[_0xd762('0x21')][_0xd762('0x22')]);}logger[_0xd762('0x21')](_0xd762('0x1d'),_0x4ce0ed,_0x272ccc[_0xd762('0x21')][_0xd762('0x22')]);return _0x201a06(_0x272ccc[_0xd762('0x21')][_0xd762('0x22')]);}else{logger[_0xd762('0x23')](_0xd762('0x1d'),_0x4ce0ed,_0xd762('0x20'));_0x201a06(_0x272ccc[_0xd762('0x24')][_0xd762('0x22')]);}})['catch'](function(_0x4152ce){logger[_0xd762('0x21')]('FaxMessage,\x20%s,\x20%s',_0x4ce0ed,_0x4152ce);_0xb2d77e(_0x4152ce);});});}function respondWithStatusCode(_0x41b963,_0x210fac){_0x210fac=_0x210fac||0xcc;return function(_0x43c8ea){if(_0x43c8ea){return _0x41b963[_0xd762('0x25')](_0x210fac);}return _0x41b963[_0xd762('0x26')](_0x210fac)[_0xd762('0x27')]();};}function respondWithResult(_0x47dd38,_0x4e7161){_0x4e7161=_0x4e7161||0xc8;return function(_0x3a9c12){if(_0x3a9c12){return _0x47dd38[_0xd762('0x26')](_0x4e7161)[_0xd762('0x28')](_0x3a9c12);}};}function respondWithFilteredResult(_0x557804,_0x1729be){return function(_0x155bf6){if(_0x155bf6){var _0xd87953=_0x155bf6[_0xd762('0x29')],_0x5d7ed3=_0x1729be[_0xd762('0x2a')],_0x1617c9=_0x1729be[_0xd762('0x2a')]+_0x1729be[_0xd762('0x2b')],_0x462cd9;if(_0x1617c9>=_0xd87953){_0x1617c9=_0xd87953;_0x462cd9=0xc8;}else{_0x462cd9=0xce;}_0x557804[_0xd762('0x26')](_0x462cd9);return _0x557804[_0xd762('0x2c')]('Content-Range',_0x5d7ed3+'-'+_0x1617c9+'/'+_0xd87953)[_0xd762('0x28')](_0x155bf6);}return null;};}function patchUpdates(_0x410aac){return function(_0x18ef82){try{jsonpatch[_0xd762('0x2d')](_0x18ef82,_0x410aac,!![]);}catch(_0x20b7e6){return BPromise[_0xd762('0x2e')](_0x20b7e6);}return _0x18ef82[_0xd762('0x2f')]();};}function saveUpdates(_0x12a9a8,_0x27f550){return function(_0x55d5e7){if(_0x55d5e7){return _0x55d5e7[_0xd762('0x30')](_0x12a9a8)['then'](function(_0xdb57e9){return _0xdb57e9;});}return null;};}function removeEntity(_0x1985d3,_0x4fd3fe){return function(_0x2f5ed2){if(_0x2f5ed2){return _0x2f5ed2[_0xd762('0x31')]()[_0xd762('0x32')](function(){_0x1985d3[_0xd762('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x550eb8,_0x5b34cb){return function(_0x3a3c41){if(!_0x3a3c41){_0x550eb8[_0xd762('0x25')](0x194);}return _0x3a3c41;};}function handleError(_0x284659,_0x1d8386){_0x1d8386=_0x1d8386||0x1f4;return function(_0x53a531){logger[_0xd762('0x21')](_0x53a531['stack']);if(_0x53a531['name']){delete _0x53a531['name'];}_0x284659[_0xd762('0x26')](_0x1d8386)[_0xd762('0x33')](_0x53a531);};}exports[_0xd762('0x34')]=function(_0x4eaeef,_0x3db17f){var _0x3ea47c={},_0x4a707a={},_0x11601b={'count':0x0,'rows':[]};var _0x341532=db['FaxMessage'][_0xd762('0x35')];_0x4a707a[_0xd762('0x36')]=_[_0xd762('0x37')](_0x341532);_0x4a707a['query']=_[_0xd762('0x37')](_0x4eaeef[_0xd762('0x38')]);_0x4a707a['filters']=_['intersection'](_0x4a707a[_0xd762('0x36')],_0x4a707a[_0xd762('0x38')]);_0x3ea47c[_0xd762('0x39')]=_[_0xd762('0x3a')](_0x4a707a[_0xd762('0x36')],qs[_0xd762('0x3b')](_0x4eaeef[_0xd762('0x38')]['fields']));_0x3ea47c[_0xd762('0x39')]=_0x3ea47c['attributes'][_0xd762('0x3c')]?_0x3ea47c[_0xd762('0x39')]:_0x4a707a[_0xd762('0x36')];if(!_0x4eaeef[_0xd762('0x38')][_0xd762('0x3d')](_0xd762('0x3e'))){_0x3ea47c['limit']=qs['limit'](_0x4eaeef['query'][_0xd762('0x2b')]);_0x3ea47c[_0xd762('0x2a')]=qs['offset'](_0x4eaeef[_0xd762('0x38')][_0xd762('0x2a')]);}_0x3ea47c[_0xd762('0x3f')]=qs[_0xd762('0x40')](_0x4eaeef[_0xd762('0x38')][_0xd762('0x40')]);_0x3ea47c[_0xd762('0x41')]=qs[_0xd762('0x42')](_[_0xd762('0x43')](_0x4eaeef[_0xd762('0x38')],_0x4a707a[_0xd762('0x42')]));if(_0x4eaeef[_0xd762('0x38')][_0xd762('0x44')]){_0x3ea47c['where']=_['merge'](_0x3ea47c[_0xd762('0x41')],{'$or':_[_0xd762('0x45')](_0x341532,function(_0x1d5d57){if(_0x1d5d57[_0xd762('0x46')][_0xd762('0x47')]!=='VIRTUAL'){var _0x251382={};_0x251382[_0x1d5d57[_0xd762('0x48')]]={'$like':'%'+_0x4eaeef[_0xd762('0x38')][_0xd762('0x44')]+'%'};return _0x251382;}})});}_0x3ea47c=_[_0xd762('0x49')]({},_0x3ea47c,_0x4eaeef[_0xd762('0x4a')]);var _0x5168c7={'where':_0x3ea47c[_0xd762('0x41')]};return db[_0xd762('0x4b')][_0xd762('0x29')](_0x5168c7)['then'](function(_0x2c27b4){_0x11601b['count']=_0x2c27b4;if(_0x4eaeef[_0xd762('0x38')][_0xd762('0x4c')]){_0x3ea47c[_0xd762('0x4d')]=[{'all':!![]}];}return db[_0xd762('0x4b')][_0xd762('0x4e')](_0x3ea47c);})[_0xd762('0x32')](function(_0x2cd90f){_0x11601b['rows']=_0x2cd90f;return _0x11601b;})['then'](respondWithFilteredResult(_0x3db17f,_0x3ea47c))[_0xd762('0x4f')](handleError(_0x3db17f,null));};exports[_0xd762('0x50')]=function(_0x36d42a,_0xc141f6){var _0x71e923={'raw':!![],'where':{'id':_0x36d42a[_0xd762('0x51')]['id']}},_0x58b5d0={};_0x58b5d0[_0xd762('0x36')]=_[_0xd762('0x37')](db['FaxMessage'][_0xd762('0x35')]);_0x58b5d0[_0xd762('0x38')]=_[_0xd762('0x37')](_0x36d42a[_0xd762('0x38')]);_0x58b5d0['filters']=_[_0xd762('0x3a')](_0x58b5d0[_0xd762('0x36')],_0x58b5d0[_0xd762('0x38')]);_0x71e923[_0xd762('0x39')]=_[_0xd762('0x3a')](_0x58b5d0[_0xd762('0x36')],qs['fields'](_0x36d42a[_0xd762('0x38')][_0xd762('0x3b')]));_0x71e923['attributes']=_0x71e923[_0xd762('0x39')][_0xd762('0x3c')]?_0x71e923[_0xd762('0x39')]:_0x58b5d0[_0xd762('0x36')];if(_0x36d42a['query'][_0xd762('0x4c')]){_0x71e923[_0xd762('0x4d')]=[{'all':!![]}];}_0x71e923=_[_0xd762('0x49')]({},_0x71e923,_0x36d42a[_0xd762('0x4a')]);return db[_0xd762('0x4b')]['find'](_0x71e923)[_0xd762('0x32')](handleEntityNotFound(_0xc141f6,null))[_0xd762('0x32')](respondWithResult(_0xc141f6,null))['catch'](handleError(_0xc141f6,null));};exports[_0xd762('0x30')]=function(_0x8ab703,_0x30aa9f){if(_0x8ab703['body']['id']){delete _0x8ab703['body']['id'];}return db[_0xd762('0x4b')][_0xd762('0x52')]({'where':{'id':_0x8ab703[_0xd762('0x51')]['id']}})['then'](handleEntityNotFound(_0x30aa9f,null))[_0xd762('0x32')](saveUpdates(_0x8ab703[_0xd762('0x53')],null))[_0xd762('0x32')](respondWithResult(_0x30aa9f,null))[_0xd762('0x4f')](handleError(_0x30aa9f,null));};exports['destroy']=function(_0x34ebd0,_0x3d9823){return db[_0xd762('0x4b')][_0xd762('0x52')]({'where':{'id':_0x34ebd0[_0xd762('0x51')]['id']}})[_0xd762('0x32')](handleEntityNotFound(_0x3d9823,null))[_0xd762('0x32')](removeEntity(_0x3d9823,null))[_0xd762('0x4f')](handleError(_0x3d9823,null));};exports[_0xd762('0x54')]=function(_0x5c5bf4,_0x4f9e8c){return db['FaxMessage']['describe']()[_0xd762('0x32')](respondWithResult(_0x4f9e8c,null))[_0xd762('0x4f')](handleError(_0x4f9e8c,null));};var interaction_log=require(_0xd762('0x10'))(_0xd762('0x55'));exports[_0xd762('0x56')]=function(_0xa4aadf,_0x42d613,_0x37366d){var _0x3b73bf={'channel':_0xd762('0x57')};if(_0xa4aadf[_0xd762('0x53')]['id']){delete _0xa4aadf[_0xd762('0x53')]['id'];}_0xa4aadf['body'][_0xd762('0x58')]=!![];_0xa4aadf[_0xd762('0x53')]['readAt']=moment()[_0xd762('0x59')](_0xd762('0x5a'));_0xa4aadf[_0xd762('0x53')][_0xd762('0x5b')]=_0xa4aadf[_0xd762('0x53')][_0xd762('0x5b')]||_0xa4aadf['user']['id'];return db[_0xd762('0x4b')][_0xd762('0x52')]({'where':{'id':_0xa4aadf['params']['id'],'UserId':null},'include':[{'model':db[_0xd762('0x5c')],'as':_0xd762('0x5d')}]})[_0xd762('0x32')](handleEntityNotFound(_0x42d613,null))['then'](saveUpdates(_0xa4aadf['body'],null))[_0xd762('0x32')](function(_0x4cf859){if(_0x4cf859){_0x3b73bf[_0xd762('0x22')]=_0x4cf859[_0xd762('0x5e')]({'plain':!![]});return db[_0xd762('0x5f')][_0xd762('0x52')]({'where':{'id':_0x4cf859[_0xd762('0x60')]}});}return null;})[_0xd762('0x32')](handleEntityNotFound(_0x42d613,null))[_0xd762('0x32')](function(_0x5d2cb3){if(_0x5d2cb3){return _0x5d2cb3[_0xd762('0x30')]({'UserId':_0xa4aadf[_0xd762('0x53')][_0xd762('0x5b')],'read1stAt':_[_0xd762('0x61')](_0x5d2cb3['read1stAt'])?moment()[_0xd762('0x59')](_0xd762('0x5a')):undefined});}return null;})['then'](function(_0x3228f6){if(_0x3228f6){_0x3b73bf[_0xd762('0x62')]=_0x3228f6['get']({'plain':!![]});interaction_log[_0xd762('0x23')](_0xd762('0x63'),_0xa4aadf[_0xd762('0x64')]['id'],_0xa4aadf['user']['name'],_0xa4aadf[_0xd762('0x64')][_0xd762('0x65')],_0x3b73bf[_0xd762('0x62')]['id'],_0xa4aadf[_0xd762('0x53')]?JSON['stringify'](_0xa4aadf[_0xd762('0x53')]):_0xd762('0x66'));return respondWithRpcPromise(_0xd762('0x67'),_0xd762('0x68'),_0x3b73bf);}return null;})[_0xd762('0x32')](function(_0x31feab){if(_0x31feab){if(_0xa4aadf[_0xd762('0x53')][_0xd762('0x69')]){_0x3b73bf[_0xd762('0x22')][_0xd762('0x6a')]=util['format']('SIP/%s',_0xa4aadf[_0xd762('0x64')][_0xd762('0x6b')]);_0x3b73bf[_0xd762('0x22')][_0xd762('0x6c')]=_0x3b73bf[_0xd762('0x6c')];_0x3b73bf[_0xd762('0x22')]['event']='accept';return respondWithRpcPromise(_0xd762('0x6d'),_0xd762('0x6d'),{'event':_0xd762('0x6e'),'message':_0x3b73bf['message']},client9002)[_0xd762('0x32')](function(){return _0x3b73bf;});}return _0x3b73bf;}return null;})[_0xd762('0x32')](respondWithResult(_0x42d613,null))['catch'](handleError(_0x42d613,null));};var interaction_log=require(_0xd762('0x10'))(_0xd762('0x55'));exports[_0xd762('0x2e')]=function(_0xff99e9,_0x1d847a,_0x612828){var _0x104b0e={'agent':{},'channel':'fax'};if(_0xff99e9[_0xd762('0x53')]['id']){delete _0xff99e9[_0xd762('0x53')]['id'];}_0xff99e9[_0xd762('0x53')][_0xd762('0x5b')]=_0xff99e9['body'][_0xd762('0x5b')]||_0xff99e9['user']['id'];_0x104b0e[_0xd762('0x6f')]['id']=_0xff99e9[_0xd762('0x53')][_0xd762('0x5b')];return db[_0xd762('0x4b')][_0xd762('0x52')]({'where':{'id':_0xff99e9[_0xd762('0x51')]['id'],'UserId':null}})[_0xd762('0x32')](handleEntityNotFound(_0x1d847a,null))[_0xd762('0x32')](function(_0x3afaa8){if(_0x3afaa8){_0x104b0e[_0xd762('0x22')]=_0x3afaa8[_0xd762('0x5e')]({'plain':!![]});return db[_0xd762('0x5f')]['find']({'where':{'id':_0x3afaa8[_0xd762('0x60')]}});}return null;})[_0xd762('0x32')](handleEntityNotFound(_0x1d847a,null))[_0xd762('0x32')](function(_0x5c17db){if(_0x5c17db){_0x104b0e[_0xd762('0x62')]=_0x5c17db[_0xd762('0x5e')]({'plain':!![]});interaction_log[_0xd762('0x23')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xff99e9[_0xd762('0x64')]['id'],_0xff99e9[_0xd762('0x64')][_0xd762('0x6b')],_0xff99e9[_0xd762('0x64')][_0xd762('0x65')],_0x104b0e[_0xd762('0x62')]['id'],_0xff99e9[_0xd762('0x53')]?JSON['stringify'](_0xff99e9['body']):_0xd762('0x66'));return respondWithRpcPromise(_0xd762('0x70'),_0xd762('0x71'),_0x104b0e);}return null;})['then'](function(_0x48c17c){if(_0x48c17c){_0x48c17c[_0xd762('0x22')][_0xd762('0x6a')]=util[_0xd762('0x59')](_0xd762('0x72'),_0xff99e9[_0xd762('0x64')][_0xd762('0x6b')]);_0x48c17c[_0xd762('0x22')][_0xd762('0x6c')]=_0x104b0e['channel'];_0x48c17c[_0xd762('0x22')]['event']='reject';respondWithRpcPromise(_0xd762('0x6d'),_0xd762('0x6d'),{'event':'rejectmessage','message':_0x48c17c[_0xd762('0x22')]},client9002);return _0x104b0e;}return null;})[_0xd762('0x32')](respondWithResult(_0x1d847a,null))[_0xd762('0x4f')](handleError(_0x1d847a,null));};exports[_0xd762('0x73')]=function(_0x358c37,_0x1538b8){var _0x497502;return db[_0xd762('0x4b')][_0xd762('0x73')](_0x358c37[_0xd762('0x53')],{})['then'](function(_0x5ac2f5){_0x497502=_0x5ac2f5;return db[_0xd762('0x5c')][_0xd762('0x74')]({'where':{'id':_0x497502[_0xd762('0x75')]}});})[_0xd762('0x32')](function(_0x419672){if(_[_0xd762('0x61')](_0x419672)){return;}else{_0x497502['fax']=_0x419672[_0xd762('0x57')];return db[_0xd762('0x76')][_0xd762('0x74')]({'where':{'id':_0x497502[_0xd762('0x77')]}});}})[_0xd762('0x32')](function(_0x573f0b){return respondWithRpcPromise('SendFax',_0xd762('0x78'),{'FaxAccountId':_[_0xd762('0x61')](_0x358c37[_0xd762('0x53')])?undefined:_0x358c37[_0xd762('0x53')][_0xd762('0x79')],'path':_['isNil'](_0x573f0b)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x573f0b['basename']),'fax':_[_0xd762('0x61')](_0x497502[_0xd762('0x57')])?undefined:_0x497502[_0xd762('0x57')],'AttachmentId':_0x497502[_0xd762('0x77')]},client9002);})['then'](respondWithResult(_0x1538b8,0xc9))['catch'](handleError(_0x1538b8,null));};exports['download']=function(_0x92821a,_0xb9f1c9){var _0x209a02=path[_0xd762('0x7a')](config[_0xd762('0x7b')],_0xd762('0x7c'),_0xd762('0x7d'),'attachments');return db[_0xd762('0x4b')][_0xd762('0x52')]({'where':{'id':_0x92821a['params']['id']},'include':[{'model':db['Attachment'],'as':_0xd762('0x76')}]})[_0xd762('0x32')](handleEntityNotFound(_0xb9f1c9,null))[_0xd762('0x32')](function(_0x3bbfb0){if(_0x3bbfb0){return _0xb9f1c9[_0xd762('0x7e')](path[_0xd762('0x7a')](_0x209a02,_0x3bbfb0[_0xd762('0x76')][_0xd762('0x7f')]));}})[_0xd762('0x4f')](handleError(_0xb9f1c9,null));}; \ No newline at end of file +var _0x6e1a=['event','EventManager','acceptmessage','fax','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','rejectmessage','create','CmContact','ContactId','Attachment','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','end','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','type','key','VIRTUAL','options','count','includeAll','include','FaxMessage','rows','params','intersection','find','body','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','AcceptMessage','acceptMessage','interface','SIP/%s','channel'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0x6e1a,0x1a7));var _0xa6e1=function(_0x42808b,_0x459f8c){_0x42808b=_0x42808b-0x0;var _0x4535b9=_0x6e1a[_0x42808b];return _0x4535b9;};'use strict';var pdf=require(_0xa6e1('0x0'));var emlformat=require(_0xa6e1('0x1'));var rimraf=require(_0xa6e1('0x2'));var zipdir=require(_0xa6e1('0x3'));var jsonpatch=require(_0xa6e1('0x4'));var rp=require(_0xa6e1('0x5'));var moment=require(_0xa6e1('0x6'));var BPromise=require(_0xa6e1('0x7'));var Mustache=require('mustache');var util=require(_0xa6e1('0x8'));var path=require(_0xa6e1('0x9'));var sox=require(_0xa6e1('0xa'));var csv=require(_0xa6e1('0xb'));var ejs=require(_0xa6e1('0xc'));var fs=require('fs');var _=require(_0xa6e1('0xd'));var squel=require('squel');var crypto=require(_0xa6e1('0xe'));var jsforce=require(_0xa6e1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa6e1('0xb'));var querystring=require(_0xa6e1('0x10'));var Papa=require(_0xa6e1('0x11'));var authService=require(_0xa6e1('0x12'));var hardwareService=require(_0xa6e1('0x13'));var Redis=require('ioredis');var qs=require(_0xa6e1('0x14'));var logger=require(_0xa6e1('0x15'))('api');var utils=require(_0xa6e1('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xa6e1('0x17')],{'host':_0xa6e1('0x18'),'port':0x18eb});var socket=require(_0xa6e1('0x19'))(new Redis(config[_0xa6e1('0x17')]));require(_0xa6e1('0x1a'))[_0xa6e1('0x1b')](socket);var jayson=require(_0xa6e1('0x1c'));var client=jayson[_0xa6e1('0x1d')][_0xa6e1('0x1e')]({'port':0x232c});var client9002=jayson[_0xa6e1('0x1d')][_0xa6e1('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2348ff,_0x5b7e33,_0x422769,_0x52d756){return new BPromise(function(_0x55ebad,_0x711234){var _0x418eb1=_0x52d756||client;return _0x418eb1['request'](_0x2348ff,_0x422769)['then'](function(_0x547386){logger[_0xa6e1('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x5b7e33,_0xa6e1('0x20'));logger['debug'](_0xa6e1('0x21'),_0x5b7e33,_0xa6e1('0x20'),JSON[_0xa6e1('0x22')](_0x547386));if(_0x547386[_0xa6e1('0x23')]){if(_0x547386[_0xa6e1('0x23')][_0xa6e1('0x24')]===0x1f4){logger['error'](_0xa6e1('0x25'),_0x5b7e33,_0x547386[_0xa6e1('0x23')][_0xa6e1('0x26')]);return _0x711234(_0x547386[_0xa6e1('0x23')][_0xa6e1('0x26')]);}logger[_0xa6e1('0x23')]('FaxMessage,\x20%s,\x20%s',_0x5b7e33,_0x547386[_0xa6e1('0x23')]['message']);return _0x55ebad(_0x547386['error'][_0xa6e1('0x26')]);}else{logger[_0xa6e1('0x1f')](_0xa6e1('0x25'),_0x5b7e33,'request\x20sent');_0x55ebad(_0x547386[_0xa6e1('0x27')][_0xa6e1('0x26')]);}})[_0xa6e1('0x28')](function(_0x59ca74){logger[_0xa6e1('0x23')](_0xa6e1('0x25'),_0x5b7e33,_0x59ca74);_0x711234(_0x59ca74);});});}function respondWithStatusCode(_0x44b58b,_0x1b7bcb){_0x1b7bcb=_0x1b7bcb||0xcc;return function(_0x55f256){if(_0x55f256){return _0x44b58b['sendStatus'](_0x1b7bcb);}return _0x44b58b['status'](_0x1b7bcb)[_0xa6e1('0x29')]();};}function respondWithResult(_0x21d24a,_0x2a7231){_0x2a7231=_0x2a7231||0xc8;return function(_0xd11348){if(_0xd11348){return _0x21d24a[_0xa6e1('0x2a')](_0x2a7231)[_0xa6e1('0x2b')](_0xd11348);}};}function respondWithFilteredResult(_0x2f9059,_0x46fe2c){return function(_0x3875fc){if(_0x3875fc){var _0x58c1c3=_0x3875fc['count'],_0x38c82e=_0x46fe2c[_0xa6e1('0x2c')],_0x27b1c7=_0x46fe2c[_0xa6e1('0x2c')]+_0x46fe2c['limit'],_0x58cfe0;if(_0x27b1c7>=_0x58c1c3){_0x27b1c7=_0x58c1c3;_0x58cfe0=0xc8;}else{_0x58cfe0=0xce;}_0x2f9059[_0xa6e1('0x2a')](_0x58cfe0);return _0x2f9059[_0xa6e1('0x2d')](_0xa6e1('0x2e'),_0x38c82e+'-'+_0x27b1c7+'/'+_0x58c1c3)[_0xa6e1('0x2b')](_0x3875fc);}return null;};}function patchUpdates(_0x6fa906){return function(_0x1acb83){try{jsonpatch[_0xa6e1('0x2f')](_0x1acb83,_0x6fa906,!![]);}catch(_0x3bb2ff){return BPromise[_0xa6e1('0x30')](_0x3bb2ff);}return _0x1acb83[_0xa6e1('0x31')]();};}function saveUpdates(_0x126cd4,_0x56f86a){return function(_0x43adda){if(_0x43adda){return _0x43adda[_0xa6e1('0x32')](_0x126cd4)[_0xa6e1('0x33')](function(_0x4ab10a){return _0x4ab10a;});}return null;};}function removeEntity(_0x140ffb,_0x102234){return function(_0x1577c0){if(_0x1577c0){return _0x1577c0[_0xa6e1('0x34')]()['then'](function(){_0x140ffb[_0xa6e1('0x2a')](0xcc)[_0xa6e1('0x29')]();});}};}function handleEntityNotFound(_0x22e5d9,_0x2bcaed){return function(_0x3fadbb){if(!_0x3fadbb){_0x22e5d9[_0xa6e1('0x35')](0x194);}return _0x3fadbb;};}function handleError(_0x111307,_0x4214c5){_0x4214c5=_0x4214c5||0x1f4;return function(_0x311dcc){logger[_0xa6e1('0x23')](_0x311dcc[_0xa6e1('0x36')]);if(_0x311dcc['name']){delete _0x311dcc['name'];}_0x111307[_0xa6e1('0x2a')](_0x4214c5)[_0xa6e1('0x37')](_0x311dcc);};}exports[_0xa6e1('0x38')]=function(_0x9c2703,_0x30e308){var _0x2015fb={},_0x265b31={},_0xd7a60c={'count':0x0,'rows':[]};var _0x75ce27=db['FaxMessage'][_0xa6e1('0x39')];_0x265b31[_0xa6e1('0x3a')]=_[_0xa6e1('0x3b')](_0x75ce27);_0x265b31[_0xa6e1('0x3c')]=_['keys'](_0x9c2703[_0xa6e1('0x3c')]);_0x265b31[_0xa6e1('0x3d')]=_['intersection'](_0x265b31['model'],_0x265b31[_0xa6e1('0x3c')]);_0x2015fb[_0xa6e1('0x3e')]=_['intersection'](_0x265b31[_0xa6e1('0x3a')],qs[_0xa6e1('0x3f')](_0x9c2703['query'][_0xa6e1('0x3f')]));_0x2015fb[_0xa6e1('0x3e')]=_0x2015fb[_0xa6e1('0x3e')][_0xa6e1('0x40')]?_0x2015fb[_0xa6e1('0x3e')]:_0x265b31['model'];if(!_0x9c2703[_0xa6e1('0x3c')][_0xa6e1('0x41')](_0xa6e1('0x42'))){_0x2015fb[_0xa6e1('0x43')]=qs[_0xa6e1('0x43')](_0x9c2703[_0xa6e1('0x3c')]['limit']);_0x2015fb['offset']=qs[_0xa6e1('0x2c')](_0x9c2703[_0xa6e1('0x3c')]['offset']);}_0x2015fb[_0xa6e1('0x44')]=qs['sort'](_0x9c2703[_0xa6e1('0x3c')]['sort']);_0x2015fb[_0xa6e1('0x45')]=qs[_0xa6e1('0x3d')](_[_0xa6e1('0x46')](_0x9c2703['query'],_0x265b31[_0xa6e1('0x3d')]));if(_0x9c2703['query'][_0xa6e1('0x47')]){_0x2015fb[_0xa6e1('0x45')]=_[_0xa6e1('0x48')](_0x2015fb['where'],{'$or':_['map'](_0x75ce27,function(_0x252ef2){if(_0x252ef2[_0xa6e1('0x49')][_0xa6e1('0x4a')]!==_0xa6e1('0x4b')){var _0x4c53e0={};_0x4c53e0[_0x252ef2['field']]={'$like':'%'+_0x9c2703['query'][_0xa6e1('0x47')]+'%'};return _0x4c53e0;}})});}_0x2015fb=_[_0xa6e1('0x48')]({},_0x2015fb,_0x9c2703[_0xa6e1('0x4c')]);var _0x2e2781={'where':_0x2015fb['where']};return db['FaxMessage'][_0xa6e1('0x4d')](_0x2e2781)[_0xa6e1('0x33')](function(_0x2c285b){_0xd7a60c[_0xa6e1('0x4d')]=_0x2c285b;if(_0x9c2703[_0xa6e1('0x3c')][_0xa6e1('0x4e')]){_0x2015fb[_0xa6e1('0x4f')]=[{'all':!![]}];}return db[_0xa6e1('0x50')]['findAll'](_0x2015fb);})[_0xa6e1('0x33')](function(_0x514d8a){_0xd7a60c[_0xa6e1('0x51')]=_0x514d8a;return _0xd7a60c;})[_0xa6e1('0x33')](respondWithFilteredResult(_0x30e308,_0x2015fb))[_0xa6e1('0x28')](handleError(_0x30e308,null));};exports['show']=function(_0x4896bf,_0x5dfcdc){var _0x3a250b={'raw':!![],'where':{'id':_0x4896bf[_0xa6e1('0x52')]['id']}},_0x44864b={};_0x44864b[_0xa6e1('0x3a')]=_[_0xa6e1('0x3b')](db['FaxMessage'][_0xa6e1('0x39')]);_0x44864b['query']=_[_0xa6e1('0x3b')](_0x4896bf[_0xa6e1('0x3c')]);_0x44864b[_0xa6e1('0x3d')]=_[_0xa6e1('0x53')](_0x44864b[_0xa6e1('0x3a')],_0x44864b['query']);_0x3a250b[_0xa6e1('0x3e')]=_['intersection'](_0x44864b[_0xa6e1('0x3a')],qs[_0xa6e1('0x3f')](_0x4896bf[_0xa6e1('0x3c')][_0xa6e1('0x3f')]));_0x3a250b[_0xa6e1('0x3e')]=_0x3a250b[_0xa6e1('0x3e')][_0xa6e1('0x40')]?_0x3a250b[_0xa6e1('0x3e')]:_0x44864b['model'];if(_0x4896bf[_0xa6e1('0x3c')][_0xa6e1('0x4e')]){_0x3a250b['include']=[{'all':!![]}];}_0x3a250b=_[_0xa6e1('0x48')]({},_0x3a250b,_0x4896bf[_0xa6e1('0x4c')]);return db[_0xa6e1('0x50')][_0xa6e1('0x54')](_0x3a250b)[_0xa6e1('0x33')](handleEntityNotFound(_0x5dfcdc,null))[_0xa6e1('0x33')](respondWithResult(_0x5dfcdc,null))[_0xa6e1('0x28')](handleError(_0x5dfcdc,null));};exports['update']=function(_0x461443,_0x1dba5b){if(_0x461443[_0xa6e1('0x55')]['id']){delete _0x461443[_0xa6e1('0x55')]['id'];}return db[_0xa6e1('0x50')][_0xa6e1('0x54')]({'where':{'id':_0x461443['params']['id']}})[_0xa6e1('0x33')](handleEntityNotFound(_0x1dba5b,null))['then'](saveUpdates(_0x461443[_0xa6e1('0x55')],null))[_0xa6e1('0x33')](respondWithResult(_0x1dba5b,null))[_0xa6e1('0x28')](handleError(_0x1dba5b,null));};exports[_0xa6e1('0x34')]=function(_0x126813,_0x480fb4){return db[_0xa6e1('0x50')]['find']({'where':{'id':_0x126813[_0xa6e1('0x52')]['id']}})[_0xa6e1('0x33')](handleEntityNotFound(_0x480fb4,null))[_0xa6e1('0x33')](removeEntity(_0x480fb4,null))['catch'](handleError(_0x480fb4,null));};exports['describe']=function(_0x3d3f91,_0x216913){return db[_0xa6e1('0x50')]['describe']()[_0xa6e1('0x33')](respondWithResult(_0x216913,null))[_0xa6e1('0x28')](handleError(_0x216913,null));};var interaction_log=require(_0xa6e1('0x15'))(_0xa6e1('0x56'));exports[_0xa6e1('0x57')]=function(_0x4d9361,_0x550722,_0x16d45d){var _0x5b57d7={'channel':'fax'};if(_0x4d9361[_0xa6e1('0x55')]['id']){delete _0x4d9361[_0xa6e1('0x55')]['id'];}_0x4d9361[_0xa6e1('0x55')][_0xa6e1('0x58')]=!![];_0x4d9361[_0xa6e1('0x55')][_0xa6e1('0x59')]=moment()[_0xa6e1('0x5a')](_0xa6e1('0x5b'));_0x4d9361['body'][_0xa6e1('0x5c')]=_0x4d9361[_0xa6e1('0x55')]['UserId']||_0x4d9361[_0xa6e1('0x5d')]['id'];return db[_0xa6e1('0x50')][_0xa6e1('0x54')]({'where':{'id':_0x4d9361['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xa6e1('0x5e')}]})[_0xa6e1('0x33')](handleEntityNotFound(_0x550722,null))[_0xa6e1('0x33')](saveUpdates(_0x4d9361[_0xa6e1('0x55')],null))['then'](function(_0x15ac30){if(_0x15ac30){_0x5b57d7[_0xa6e1('0x26')]=_0x15ac30[_0xa6e1('0x5f')]({'plain':!![]});return db[_0xa6e1('0x60')][_0xa6e1('0x54')]({'where':{'id':_0x15ac30[_0xa6e1('0x61')]}});}return null;})[_0xa6e1('0x33')](handleEntityNotFound(_0x550722,null))['then'](function(_0x5802ca){if(_0x5802ca){return _0x5802ca[_0xa6e1('0x32')]({'UserId':_0x4d9361[_0xa6e1('0x55')][_0xa6e1('0x5c')],'read1stAt':_[_0xa6e1('0x62')](_0x5802ca[_0xa6e1('0x63')])?moment()[_0xa6e1('0x5a')](_0xa6e1('0x5b')):undefined});}return null;})[_0xa6e1('0x33')](function(_0x452294){if(_0x452294){_0x5b57d7[_0xa6e1('0x64')]=_0x452294['get']({'plain':!![]});interaction_log[_0xa6e1('0x1f')](_0xa6e1('0x65'),_0x4d9361[_0xa6e1('0x5d')]['id'],_0x4d9361[_0xa6e1('0x5d')][_0xa6e1('0x66')],_0x4d9361[_0xa6e1('0x5d')][_0xa6e1('0x67')],_0x5b57d7[_0xa6e1('0x64')]['id'],_0x4d9361[_0xa6e1('0x55')]?JSON[_0xa6e1('0x22')](_0x4d9361[_0xa6e1('0x55')]):'null');return respondWithRpcPromise(_0xa6e1('0x68'),_0xa6e1('0x69'),_0x5b57d7);}return null;})[_0xa6e1('0x33')](function(_0x483d7f){if(_0x483d7f){if(_0x4d9361[_0xa6e1('0x55')]['manual']){_0x5b57d7[_0xa6e1('0x26')][_0xa6e1('0x6a')]=util['format'](_0xa6e1('0x6b'),_0x4d9361['user'][_0xa6e1('0x66')]);_0x5b57d7['message']['channel']=_0x5b57d7[_0xa6e1('0x6c')];_0x5b57d7['message'][_0xa6e1('0x6d')]=_0xa6e1('0x57');return respondWithRpcPromise(_0xa6e1('0x6e'),_0xa6e1('0x6e'),{'event':_0xa6e1('0x6f'),'message':_0x5b57d7['message']},client9002)[_0xa6e1('0x33')](function(){return _0x5b57d7;});}return _0x5b57d7;}return null;})[_0xa6e1('0x33')](respondWithResult(_0x550722,null))[_0xa6e1('0x28')](handleError(_0x550722,null));};var interaction_log=require('../../config/logger')(_0xa6e1('0x56'));exports[_0xa6e1('0x30')]=function(_0x30809a,_0x552504,_0x4fc7ae){var _0x15dcc1={'agent':{},'channel':_0xa6e1('0x70')};if(_0x30809a['body']['id']){delete _0x30809a[_0xa6e1('0x55')]['id'];}_0x30809a[_0xa6e1('0x55')][_0xa6e1('0x5c')]=_0x30809a[_0xa6e1('0x55')][_0xa6e1('0x5c')]||_0x30809a['user']['id'];_0x15dcc1[_0xa6e1('0x71')]['id']=_0x30809a[_0xa6e1('0x55')][_0xa6e1('0x5c')];return db[_0xa6e1('0x50')][_0xa6e1('0x54')]({'where':{'id':_0x30809a[_0xa6e1('0x52')]['id'],'UserId':null}})[_0xa6e1('0x33')](handleEntityNotFound(_0x552504,null))['then'](function(_0x5b4172){if(_0x5b4172){_0x15dcc1[_0xa6e1('0x26')]=_0x5b4172[_0xa6e1('0x5f')]({'plain':!![]});return db[_0xa6e1('0x60')]['find']({'where':{'id':_0x5b4172['FaxInteractionId']}});}return null;})[_0xa6e1('0x33')](handleEntityNotFound(_0x552504,null))[_0xa6e1('0x33')](function(_0x2870bd){if(_0x2870bd){_0x15dcc1[_0xa6e1('0x64')]=_0x2870bd[_0xa6e1('0x5f')]({'plain':!![]});interaction_log[_0xa6e1('0x1f')](_0xa6e1('0x72'),_0x30809a[_0xa6e1('0x5d')]['id'],_0x30809a[_0xa6e1('0x5d')][_0xa6e1('0x66')],_0x30809a[_0xa6e1('0x5d')]['role'],_0x15dcc1['interaction']['id'],_0x30809a[_0xa6e1('0x55')]?JSON[_0xa6e1('0x22')](_0x30809a[_0xa6e1('0x55')]):_0xa6e1('0x73'));return respondWithRpcPromise('RejectMessage',_0xa6e1('0x74'),_0x15dcc1);}return null;})[_0xa6e1('0x33')](function(_0x32c8b3){if(_0x32c8b3){_0x32c8b3[_0xa6e1('0x26')]['interface']=util[_0xa6e1('0x5a')](_0xa6e1('0x6b'),_0x30809a[_0xa6e1('0x5d')][_0xa6e1('0x66')]);_0x32c8b3['message'][_0xa6e1('0x6c')]=_0x15dcc1[_0xa6e1('0x6c')];_0x32c8b3[_0xa6e1('0x26')]['event']=_0xa6e1('0x30');respondWithRpcPromise(_0xa6e1('0x6e'),_0xa6e1('0x6e'),{'event':_0xa6e1('0x75'),'message':_0x32c8b3[_0xa6e1('0x26')]},client9002);return _0x15dcc1;}return null;})[_0xa6e1('0x33')](respondWithResult(_0x552504,null))[_0xa6e1('0x28')](handleError(_0x552504,null));};exports[_0xa6e1('0x76')]=function(_0x5557a3,_0x5d4aee){var _0x3e8df9;return db[_0xa6e1('0x50')][_0xa6e1('0x76')](_0x5557a3[_0xa6e1('0x55')],{})[_0xa6e1('0x33')](function(_0x2924b5){_0x3e8df9=_0x2924b5;return db[_0xa6e1('0x77')]['findOne']({'where':{'id':_0x3e8df9[_0xa6e1('0x78')]}});})[_0xa6e1('0x33')](function(_0x38bca9){if(_['isNil'](_0x38bca9)){return;}else{_0x3e8df9[_0xa6e1('0x70')]=_0x38bca9[_0xa6e1('0x70')];return db[_0xa6e1('0x79')][_0xa6e1('0x7a')]({'where':{'id':_0x3e8df9[_0xa6e1('0x7b')]}});}})[_0xa6e1('0x33')](function(_0x46750f){return respondWithRpcPromise(_0xa6e1('0x7c'),'SendFax',{'FaxAccountId':_[_0xa6e1('0x62')](_0x5557a3[_0xa6e1('0x55')])?undefined:_0x5557a3[_0xa6e1('0x55')]['FaxAccountId'],'path':_[_0xa6e1('0x62')](_0x46750f)?undefined:util[_0xa6e1('0x5a')](_0xa6e1('0x7d'),_0x46750f[_0xa6e1('0x7e')]),'fax':_[_0xa6e1('0x62')](_0x3e8df9[_0xa6e1('0x70')])?undefined:_0x3e8df9[_0xa6e1('0x70')],'AttachmentId':_0x3e8df9[_0xa6e1('0x7b')]},client9002);})[_0xa6e1('0x33')](respondWithResult(_0x5d4aee,0xc9))[_0xa6e1('0x28')](handleError(_0x5d4aee,null));};exports[_0xa6e1('0x7f')]=function(_0x5edeb1,_0xa88fbd){var _0x109651=path[_0xa6e1('0x80')](config[_0xa6e1('0x81')],_0xa6e1('0x82'),_0xa6e1('0x83'),_0xa6e1('0x84'));return db['FaxMessage'][_0xa6e1('0x54')]({'where':{'id':_0x5edeb1[_0xa6e1('0x52')]['id']},'include':[{'model':db[_0xa6e1('0x79')],'as':_0xa6e1('0x79')}]})[_0xa6e1('0x33')](handleEntityNotFound(_0xa88fbd,null))[_0xa6e1('0x33')](function(_0x1981ce){if(_0x1981ce){return _0xa88fbd[_0xa6e1('0x7f')](path[_0xa6e1('0x80')](_0x109651,_0x1981ce[_0xa6e1('0x79')][_0xa6e1('0x7e')]));}})[_0xa6e1('0x28')](handleError(_0xa88fbd,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index dbe2340..322bb3f 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 _0x7bd0=['FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x38fd39,_0x43e8c3){var _0x1f694d=function(_0x45d45c){while(--_0x45d45c){_0x38fd39['push'](_0x38fd39['shift']());}};_0x1f694d(++_0x43e8c3);}(_0x7bd0,0x111));var _0x07bd=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0x7bd0[_0x21cb7f];return _0x5a079a;};'use strict';var EventEmitter=require(_0x07bd('0x0'));var FaxMessage=require(_0x07bd('0x1'))['db'][_0x07bd('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x07bd('0x3')](0x0);var events={'afterCreate':_0x07bd('0x4'),'afterUpdate':_0x07bd('0x5'),'afterDestroy':_0x07bd('0x6')};function emitEvent(_0x3633e7){return function(_0x5beba7,_0x2d7245,_0x3b4f4f){FaxMessageEvents[_0x07bd('0x7')](_0x3633e7+':'+_0x5beba7['id'],_0x5beba7);FaxMessageEvents[_0x07bd('0x7')](_0x3633e7,_0x5beba7);_0x3b4f4f(null);};}for(var e in events){if(events[_0x07bd('0x8')](e)){var event=events[e];FaxMessage[_0x07bd('0x9')](e,emitEvent(event));}}module[_0x07bd('0xa')]=FaxMessageEvents; \ No newline at end of file +var _0x048d=['save','remove','emit','hook','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x5109f4,_0x12a42e){var _0x539e18=function(_0x46598a){while(--_0x46598a){_0x5109f4['push'](_0x5109f4['shift']());}};_0x539e18(++_0x12a42e);}(_0x048d,0xc5));var _0xd048=function(_0x15c3af,_0xd971aa){_0x15c3af=_0x15c3af-0x0;var _0x1a3b5f=_0x048d[_0x15c3af];return _0x1a3b5f;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xd048('0x0'))['db'][_0xd048('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xd048('0x2')](0x0);var events={'afterCreate':_0xd048('0x3'),'afterUpdate':'update','afterDestroy':_0xd048('0x4')};function emitEvent(_0x3374a0){return function(_0x394e24,_0x35b9b8,_0x4f0b57){FaxMessageEvents[_0xd048('0x5')](_0x3374a0+':'+_0x394e24['id'],_0x394e24);FaxMessageEvents[_0xd048('0x5')](_0x3374a0,_0x394e24);_0x4f0b57(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xd048('0x6')](e,emitEvent(event));}}module[_0xd048('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index f6751d6..331fa52 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 _0x845b=['FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','toLowerCase','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','get','direction','out','UserId'];(function(_0x3ac4bb,_0x4f75f5){var _0x4ede3f=function(_0x10fa7a){while(--_0x10fa7a){_0x3ac4bb['push'](_0x3ac4bb['shift']());}};_0x4ede3f(++_0x4f75f5);}(_0x845b,0x93));var _0xb845=function(_0x58eca9,_0x219608){_0x58eca9=_0x58eca9-0x0;var _0x25a12e=_0x845b[_0x58eca9];return _0x25a12e;};'use strict';var _=require(_0xb845('0x0'));var util=require('util');var logger=require(_0xb845('0x1'))(_0xb845('0x2'));var moment=require(_0xb845('0x3'));var BPromise=require('bluebird');var rp=require(_0xb845('0x4'));var attributes=require(_0xb845('0x5'));module[_0xb845('0x6')]=function(_0x102867,_0x54593c){return _0x102867[_0xb845('0x7')](_0xb845('0x8'),attributes,{'tableName':_0xb845('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x480c06,_0x1372df,_0x5e39b8){var _0x394851=_0x102867['models'];var _0x594cb8=_0x480c06[_0xb845('0xa')]({'plain':!![]});if(_0x594cb8[_0xb845('0xb')]['toLowerCase']()==='in'||_0x594cb8[_0xb845('0xb')]['toLowerCase']()===_0xb845('0xc')&&!_0x594cb8['secret']&&!_['isNil'](_0x594cb8[_0xb845('0xd')])){_0x394851[_0xb845('0xe')][_0xb845('0xf')]({'where':{'id':_0x594cb8[_0xb845('0x10')]}})[_0xb845('0x11')](function(_0x81458a){if(_0x81458a){_0x81458a[_0xb845('0x12')]({'lastMsgAt':_0x594cb8[_0xb845('0x13')],'lastMsgDirection':_0x594cb8[_0xb845('0xb')][_0xb845('0x14')](),'lastMsgBody':_0x594cb8['body']});}})[_0xb845('0x15')](function(_0x1f9367){console['error'](_0x1f9367);});}_0x5e39b8();}},'charset':'utf8mb4','collate':_0xb845('0x16')});}; \ No newline at end of file +var _0xb062=['FaxMessage','fax_messages','models','get','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','then','update','createdAt','direction','body','error','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','./faxMessage.attributes'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xb062,0x181));var _0x2b06=function(_0x51920c,_0x243696){_0x51920c=_0x51920c-0x0;var _0x55845c=_0xb062[_0x51920c];return _0x55845c;};'use strict';var _=require('lodash');var util=require(_0x2b06('0x0'));var logger=require(_0x2b06('0x1'))(_0x2b06('0x2'));var moment=require(_0x2b06('0x3'));var BPromise=require(_0x2b06('0x4'));var rp=require('request-promise');var attributes=require(_0x2b06('0x5'));module['exports']=function(_0x18355c,_0x14184e){return _0x18355c['define'](_0x2b06('0x6'),attributes,{'tableName':_0x2b06('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x430be2,_0x36f44a,_0x4e37db){var _0x4ae570=_0x18355c[_0x2b06('0x8')];var _0x2cfecc=_0x430be2[_0x2b06('0x9')]({'plain':!![]});if(_0x2cfecc['direction'][_0x2b06('0xa')]()==='in'||_0x2cfecc['direction'][_0x2b06('0xa')]()==='out'&&!_0x2cfecc[_0x2b06('0xb')]&&!_[_0x2b06('0xc')](_0x2cfecc[_0x2b06('0xd')])){_0x4ae570[_0x2b06('0xe')][_0x2b06('0xf')]({'where':{'id':_0x2cfecc['FaxInteractionId']}})[_0x2b06('0x10')](function(_0x38fcad){if(_0x38fcad){_0x38fcad[_0x2b06('0x11')]({'lastMsgAt':_0x2cfecc[_0x2b06('0x12')],'lastMsgDirection':_0x2cfecc[_0x2b06('0x13')][_0x2b06('0xa')](),'lastMsgBody':_0x2cfecc[_0x2b06('0x14')]});}})['catch'](function(_0x4aaafd){console[_0x2b06('0x15')](_0x4aaafd);});}_0x4e37db();}},'charset':'utf8mb4','collate':_0x2b06('0x16')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index f5007b0..964a98a 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 _0xd5b2=['localhost','redis','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','where','limit','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5b2,0x10e));var _0x2d5b=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xd5b2[_0x4baae2];return _0x1a2285;};'use strict';var _=require('lodash');var util=require(_0x2d5b('0x0'));var moment=require(_0x2d5b('0x1'));var BPromise=require('bluebird');var rs=require(_0x2d5b('0x2'));var fs=require('fs');var Redis=require(_0x2d5b('0x3'));var db=require(_0x2d5b('0x4'))['db'];var utils=require(_0x2d5b('0x5'));var logger=require(_0x2d5b('0x6'))(_0x2d5b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2d5b('0x8')]({'port':0x232a});config['redis']=_[_0x2d5b('0x9')](config['redis'],{'host':_0x2d5b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2d5b('0xb')]));require(_0x2d5b('0xc'))[_0x2d5b('0xd')](socket);function respondWithRpcPromise(_0x253455,_0x15fdce,_0x4c65b7){return new BPromise(function(_0x2c0edd,_0xa902be){return client[_0x2d5b('0xe')](_0x253455,_0x4c65b7)[_0x2d5b('0xf')](function(_0x141e69){logger[_0x2d5b('0x10')](_0x2d5b('0x11'),_0x15fdce,_0x2d5b('0x12'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x15fdce,_0x2d5b('0x12'),JSON[_0x2d5b('0x13')](_0x141e69));if(_0x141e69[_0x2d5b('0x14')]){if(_0x141e69[_0x2d5b('0x14')][_0x2d5b('0x15')]===0x1f4){logger[_0x2d5b('0x14')]('FaxMessage,\x20%s,\x20%s',_0x15fdce,_0x141e69[_0x2d5b('0x14')]['message']);return _0xa902be(_0x141e69[_0x2d5b('0x14')][_0x2d5b('0x16')]);}logger['error'](_0x2d5b('0x11'),_0x15fdce,_0x141e69[_0x2d5b('0x14')]['message']);return _0x2c0edd(_0x141e69[_0x2d5b('0x14')][_0x2d5b('0x16')]);}else{logger['info'](_0x2d5b('0x11'),_0x15fdce,_0x2d5b('0x12'));_0x2c0edd(_0x141e69[_0x2d5b('0x17')][_0x2d5b('0x16')]);}})[_0x2d5b('0x18')](function(_0xbf491b){logger[_0x2d5b('0x14')]('FaxMessage,\x20%s,\x20%s',_0x15fdce,_0xbf491b);_0xa902be(_0xbf491b);});});}exports[_0x2d5b('0x19')]=function(_0x9a40b2){var _0x3e2dc5=this;return new Promise(function(_0x90198b,_0x4a5201){return db[_0x2d5b('0x1a')]['create'](_0x9a40b2[_0x2d5b('0x1b')],{'raw':_0x9a40b2[_0x2d5b('0x1c')]?_0x9a40b2[_0x2d5b('0x1c')][_0x2d5b('0x1d')]===undefined?!![]:![]:!![]})[_0x2d5b('0xf')](function(_0x52cd78){logger[_0x2d5b('0x10')](_0x2d5b('0x19'),_0x9a40b2);logger['debug']('CreateFaxMessage',_0x9a40b2,JSON[_0x2d5b('0x13')](_0x52cd78));_0x90198b(_0x52cd78);})[_0x2d5b('0x18')](function(_0x4bf500){logger['error'](_0x2d5b('0x19'),_0x4bf500[_0x2d5b('0x16')],_0x9a40b2);_0x4a5201(_0x3e2dc5[_0x2d5b('0x14')](0x1f4,_0x4bf500[_0x2d5b('0x16')]));});});};exports[_0x2d5b('0x1e')]=function(_0x409dd1){var _0x110207=this;return new Promise(function(_0x365d82,_0x51e47c){return db['FaxMessage'][_0x2d5b('0x1f')](_0x409dd1[_0x2d5b('0x1b')],{'raw':_0x409dd1[_0x2d5b('0x1c')]?_0x409dd1[_0x2d5b('0x1c')][_0x2d5b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x409dd1['options']?_0x409dd1[_0x2d5b('0x1c')][_0x2d5b('0x20')]||null:null,'attributes':_0x409dd1[_0x2d5b('0x1c')]?_0x409dd1[_0x2d5b('0x1c')]['attributes']||null:null,'limit':_0x409dd1['options']?_0x409dd1[_0x2d5b('0x1c')][_0x2d5b('0x21')]||null:null})[_0x2d5b('0xf')](function(_0x19058e){logger[_0x2d5b('0x10')](_0x2d5b('0x1e'),_0x409dd1);logger[_0x2d5b('0x22')](_0x2d5b('0x1e'),_0x409dd1,JSON['stringify'](_0x19058e));_0x365d82(_0x19058e);})[_0x2d5b('0x18')](function(_0x511a87){logger[_0x2d5b('0x14')](_0x2d5b('0x1e'),_0x511a87['message'],_0x409dd1);_0x51e47c(_0x110207[_0x2d5b('0x14')](0x1f4,_0x511a87[_0x2d5b('0x16')]));});});}; \ No newline at end of file +var _0x1224=['request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','UpdateFaxMessage','update','raw','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register'];(function(_0x5a4f5a,_0x2d9397){var _0x1c1d63=function(_0x217492){while(--_0x217492){_0x5a4f5a['push'](_0x5a4f5a['shift']());}};_0x1c1d63(++_0x2d9397);}(_0x1224,0x10d));var _0x4122=function(_0x44c935,_0x3653f0){_0x44c935=_0x44c935-0x0;var _0x465bee=_0x1224[_0x44c935];return _0x465bee;};'use strict';var _=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var moment=require(_0x4122('0x2'));var BPromise=require(_0x4122('0x3'));var rs=require(_0x4122('0x4'));var fs=require('fs');var Redis=require(_0x4122('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4122('0x6'));var logger=require(_0x4122('0x7'))(_0x4122('0x8'));var config=require('../../config/environment');var jayson=require(_0x4122('0x9'));var client=jayson[_0x4122('0xa')][_0x4122('0xb')]({'port':0x232a});config[_0x4122('0xc')]=_[_0x4122('0xd')](config[_0x4122('0xc')],{'host':_0x4122('0xe'),'port':0x18eb});var socket=require(_0x4122('0xf'))(new Redis(config[_0x4122('0xc')]));require(_0x4122('0x10'))[_0x4122('0x11')](socket);function respondWithRpcPromise(_0x4779e2,_0x251ade,_0x35160c){return new BPromise(function(_0x1d229f,_0x201538){return client[_0x4122('0x12')](_0x4779e2,_0x35160c)[_0x4122('0x13')](function(_0x476ed2){logger[_0x4122('0x14')](_0x4122('0x15'),_0x251ade,_0x4122('0x16'));logger[_0x4122('0x17')](_0x4122('0x18'),_0x251ade,_0x4122('0x16'),JSON[_0x4122('0x19')](_0x476ed2));if(_0x476ed2[_0x4122('0x1a')]){if(_0x476ed2[_0x4122('0x1a')][_0x4122('0x1b')]===0x1f4){logger[_0x4122('0x1a')](_0x4122('0x15'),_0x251ade,_0x476ed2['error'][_0x4122('0x1c')]);return _0x201538(_0x476ed2[_0x4122('0x1a')][_0x4122('0x1c')]);}logger[_0x4122('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x251ade,_0x476ed2[_0x4122('0x1a')][_0x4122('0x1c')]);return _0x1d229f(_0x476ed2['error'][_0x4122('0x1c')]);}else{logger[_0x4122('0x14')](_0x4122('0x15'),_0x251ade,_0x4122('0x16'));_0x1d229f(_0x476ed2[_0x4122('0x1d')][_0x4122('0x1c')]);}})[_0x4122('0x1e')](function(_0x5a4fe6){logger['error']('FaxMessage,\x20%s,\x20%s',_0x251ade,_0x5a4fe6);_0x201538(_0x5a4fe6);});});}exports[_0x4122('0x1f')]=function(_0x2d95e8){var _0x23033a=this;return new Promise(function(_0x1dde85,_0xef6995){return db[_0x4122('0x20')][_0x4122('0x21')](_0x2d95e8[_0x4122('0x22')],{'raw':_0x2d95e8['options']?_0x2d95e8[_0x4122('0x23')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x508cd7){logger[_0x4122('0x14')](_0x4122('0x1f'),_0x2d95e8);logger[_0x4122('0x17')]('CreateFaxMessage',_0x2d95e8,JSON[_0x4122('0x19')](_0x508cd7));_0x1dde85(_0x508cd7);})[_0x4122('0x1e')](function(_0x5b259d){logger['error'](_0x4122('0x1f'),_0x5b259d['message'],_0x2d95e8);_0xef6995(_0x23033a['error'](0x1f4,_0x5b259d['message']));});});};exports[_0x4122('0x24')]=function(_0x2e71f4){var _0xbb76e1=this;return new Promise(function(_0x1bb51b,_0x31568f){return db[_0x4122('0x20')][_0x4122('0x25')](_0x2e71f4[_0x4122('0x22')],{'raw':_0x2e71f4[_0x4122('0x23')]?_0x2e71f4[_0x4122('0x23')][_0x4122('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e71f4[_0x4122('0x23')]?_0x2e71f4[_0x4122('0x23')]['where']||null:null,'attributes':_0x2e71f4[_0x4122('0x23')]?_0x2e71f4[_0x4122('0x23')][_0x4122('0x27')]||null:null,'limit':_0x2e71f4[_0x4122('0x23')]?_0x2e71f4['options'][_0x4122('0x28')]||null:null})['then'](function(_0x3e4eee){logger[_0x4122('0x14')](_0x4122('0x24'),_0x2e71f4);logger[_0x4122('0x17')](_0x4122('0x24'),_0x2e71f4,JSON[_0x4122('0x19')](_0x3e4eee));_0x1bb51b(_0x3e4eee);})[_0x4122('0x1e')](function(_0x427e8a){logger['error'](_0x4122('0x24'),_0x427e8a[_0x4122('0x1c')],_0x2e71f4);_0x31568f(_0xbb76e1['error'](0x1f4,_0x427e8a[_0x4122('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index e63faeb..582bc7a 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 _0xf7f3=['remove','update','register','./faxMessage.events','save'];(function(_0x48322d,_0xd90759){var _0x3bdd6b=function(_0x49d000){while(--_0x49d000){_0x48322d['push'](_0x48322d['shift']());}};_0x3bdd6b(++_0xd90759);}(_0xf7f3,0x12a));var _0x3f7f=function(_0x51d66,_0x15a4d1){_0x51d66=_0x51d66-0x0;var _0x6f7845=_0xf7f3[_0x51d66];return _0x6f7845;};'use strict';var FaxMessageEvents=require(_0x3f7f('0x0'));var events=[_0x3f7f('0x1'),_0x3f7f('0x2'),_0x3f7f('0x3')];function createListener(_0x211587,_0x26a826){return function(_0x4b3ff7){_0x26a826['emit'](_0x211587,_0x4b3ff7);};}function removeListener(_0x5e4ff,_0x378c5f){return function(){FaxMessageEvents['removeListener'](_0x5e4ff,_0x378c5f);};}exports[_0x3f7f('0x4')]=function(_0x4876e8){for(var _0x2198f7=0x0,_0x57b834=events['length'];_0x2198f7<_0x57b834;_0x2198f7++){var _0x5cac86=events[_0x2198f7];var _0x4cabff=createListener('faxMessage:'+_0x5cac86,_0x4876e8);FaxMessageEvents['on'](_0x5cac86,_0x4cabff);}}; \ No newline at end of file +var _0xc7b4=['register','length','./faxMessage.events','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7b4,0x15e));var _0x4c7b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7b4[_0x321bb2];return _0x9c12ed;};'use strict';var FaxMessageEvents=require(_0x4c7b('0x0'));var events=['save',_0x4c7b('0x1'),_0x4c7b('0x2')];function createListener(_0x5c11d0,_0x1f769d){return function(_0x9305d5){_0x1f769d[_0x4c7b('0x3')](_0x5c11d0,_0x9305d5);};}function removeListener(_0x2a8b1d,_0x109687){return function(){FaxMessageEvents['removeListener'](_0x2a8b1d,_0x109687);};}exports[_0x4c7b('0x4')]=function(_0x2272e8){for(var _0x46532e=0x0,_0xc18bc6=events[_0x4c7b('0x5')];_0x46532e<_0xc18bc6;_0x46532e++){var _0x2c005a=events[_0x46532e];var _0x12467d=createListener('faxMessage:'+_0x2c005a,_0x2272e8);FaxMessageEvents['on'](_0x2c005a,_0x12467d);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index bba20c9..15355cb 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 _0x53ec=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./faxMessage.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/download','download','post','fax','put','update','accept','/:id/reject','reject'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x53ec,0x192));var _0xc53e=function(_0x16eadc,_0x3fc953){_0x16eadc=_0x16eadc-0x0;var _0x5b05c8=_0x53ec[_0x16eadc];return _0x5b05c8;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc53e('0x6'));var config=require('../../config/environment');var controller=require(_0xc53e('0x7'));router[_0xc53e('0x8')]('/',auth['isAuthenticated'](),controller[_0xc53e('0x9')]);router['get'](_0xc53e('0xa'),auth[_0xc53e('0xb')](),controller['describe']);router[_0xc53e('0x8')](_0xc53e('0xc'),auth[_0xc53e('0xb')](),controller[_0xc53e('0xd')]);router[_0xc53e('0x8')](_0xc53e('0xe'),auth[_0xc53e('0xb')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xc53e('0x11'),'faxmessage:create'),controller['create']);router[_0xc53e('0x12')](_0xc53e('0xc'),auth[_0xc53e('0xb')](),controller[_0xc53e('0x13')]);router['put']('/:id/accept',auth[_0xc53e('0xb')](),controller[_0xc53e('0x14')]);router[_0xc53e('0x12')](_0xc53e('0x15'),auth[_0xc53e('0xb')](),controller[_0xc53e('0x16')]);router[_0xc53e('0x17')](_0xc53e('0xc'),auth[_0xc53e('0xb')](),controller[_0xc53e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9f0e=['create','update','put','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','fax','faxmessage:create'];(function(_0x3ade2d,_0x438541){var _0x1ffeee=function(_0x2b7c9b){while(--_0x2b7c9b){_0x3ade2d['push'](_0x3ade2d['shift']());}};_0x1ffeee(++_0x438541);}(_0x9f0e,0x116));var _0xe9f0=function(_0x25d6c5,_0x50736c){_0x25d6c5=_0x25d6c5-0x0;var _0x1dea94=_0x9f0e[_0x25d6c5];return _0x1dea94;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe9f0('0x5'));var config=require(_0xe9f0('0x6'));var controller=require(_0xe9f0('0x7'));router[_0xe9f0('0x8')]('/',auth[_0xe9f0('0x9')](),controller['index']);router['get'](_0xe9f0('0xa'),auth[_0xe9f0('0x9')](),controller[_0xe9f0('0xb')]);router['get'](_0xe9f0('0xc'),auth[_0xe9f0('0x9')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0x8')](_0xe9f0('0xe'),auth[_0xe9f0('0x9')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')]('/',auth[_0xe9f0('0x9')](),interaction['tracked'](_0xe9f0('0x11'),_0xe9f0('0x12')),controller[_0xe9f0('0x13')]);router['put'](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x14')]);router[_0xe9f0('0x15')](_0xe9f0('0x16'),auth[_0xe9f0('0x9')](),controller['accept']);router[_0xe9f0('0x15')]('/:id/reject',auth[_0xe9f0('0x9')](),controller[_0xe9f0('0x17')]);router[_0xe9f0('0x18')]('/:id',auth[_0xe9f0('0x9')](),controller[_0xe9f0('0x19')]);module[_0xe9f0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 32e9cf1..84e887a 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 _0xb5ba=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x4aad4b,_0x3ce6b3){var _0x1f179f=function(_0x53aac5){while(--_0x53aac5){_0x4aad4b['push'](_0x4aad4b['shift']());}};_0x1f179f(++_0x3ce6b3);}(_0xb5ba,0x12a));var _0xab5b=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0xb5ba[_0x592e40];return _0x5d4288;};'use strict';var Sequelize=require('sequelize');module[_0xab5b('0x0')]={'name':{'type':Sequelize[_0xab5b('0x1')],'unique':_0xab5b('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xab5b('0x1')]},'timeout':{'type':Sequelize[_0xab5b('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xab5b('0x4')](_0xab5b('0x5'),_0xab5b('0x6'),_0xab5b('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xab5b('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe250=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x3c0713,_0x118272){var _0xda81d3=function(_0x30d543){while(--_0x30d543){_0x3c0713['push'](_0x3c0713['shift']());}};_0xda81d3(++_0x118272);}(_0xe250,0x138));var _0x0e25=function(_0x11825f,_0x447223){_0x11825f=_0x11825f-0x0;var _0x246aa7=_0xe250[_0x11825f];return _0x246aa7;};'use strict';var Sequelize=require(_0x0e25('0x0'));module[_0x0e25('0x1')]={'name':{'type':Sequelize[_0x0e25('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0e25('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0e25('0x3')](_0x0e25('0x4'),_0x0e25('0x5'),_0x0e25('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index abe3902..d2f34d6 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 _0x6f36=['ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','redis','defaults','localhost','./faxQueue.socket','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','stack','name','send','index','FaxQueue','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','type','key','filter','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserFaxQueue','hasOwnProperty','order','FaxQueueId','findAndCountAll','map','agent','faxPause','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','union','penalty','removeTeams','User','removeAgents','addAgents','omit','spread','userFaxQueue:save','isArray','emit','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv'];(function(_0x8065be,_0x2987b9){var _0x1c6bb4=function(_0xebeb37){while(--_0xebeb37){_0x8065be['push'](_0x8065be['shift']());}};_0x1c6bb4(++_0x2987b9);}(_0x6f36,0x149));var _0x66f3=function(_0xf388b4,_0x1f3524){_0xf388b4=_0xf388b4-0x0;var _0x1a95e3=_0x6f36[_0xf388b4];return _0x1a95e3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x66f3('0x0'));var rimraf=require(_0x66f3('0x1'));var zipdir=require(_0x66f3('0x2'));var jsonpatch=require(_0x66f3('0x3'));var rp=require(_0x66f3('0x4'));var moment=require(_0x66f3('0x5'));var BPromise=require(_0x66f3('0x6'));var Mustache=require('mustache');var util=require(_0x66f3('0x7'));var path=require(_0x66f3('0x8'));var sox=require('sox');var csv=require(_0x66f3('0x9'));var ejs=require(_0x66f3('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x66f3('0xb'));var crypto=require(_0x66f3('0xc'));var jsforce=require(_0x66f3('0xd'));var deskjs=require(_0x66f3('0xe'));var toCsv=require(_0x66f3('0x9'));var querystring=require(_0x66f3('0xf'));var Papa=require(_0x66f3('0x10'));var authService=require(_0x66f3('0x11'));var hardwareService=require(_0x66f3('0x12'));var Redis=require('ioredis');var qs=require(_0x66f3('0x13'));var logger=require('../../config/logger')(_0x66f3('0x14'));var utils=require(_0x66f3('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x66f3('0x16')]=_[_0x66f3('0x17')](config[_0x66f3('0x16')],{'host':_0x66f3('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66f3('0x16')]));require(_0x66f3('0x19'))['register'](socket);function respondWithStatusCode(_0x2675b9,_0x39849f){_0x39849f=_0x39849f||0xcc;return function(_0x366bdf){if(_0x366bdf){return _0x2675b9[_0x66f3('0x1a')](_0x39849f);}return _0x2675b9['status'](_0x39849f)[_0x66f3('0x1b')]();};}function respondWithResult(_0x4ff9f0,_0x45831d){_0x45831d=_0x45831d||0xc8;return function(_0x29d2af){if(_0x29d2af){return _0x4ff9f0[_0x66f3('0x1c')](_0x45831d)[_0x66f3('0x1d')](_0x29d2af);}};}function respondWithFilteredResult(_0x349fb0,_0x449441){return function(_0x179291){if(_0x179291){var _0x45c646=_0x179291[_0x66f3('0x1e')],_0x19745=_0x449441[_0x66f3('0x1f')],_0x3b4184=_0x449441[_0x66f3('0x1f')]+_0x449441[_0x66f3('0x20')],_0x189d92;if(_0x3b4184>=_0x45c646){_0x3b4184=_0x45c646;_0x189d92=0xc8;}else{_0x189d92=0xce;}_0x349fb0[_0x66f3('0x1c')](_0x189d92);return _0x349fb0[_0x66f3('0x21')](_0x66f3('0x22'),_0x19745+'-'+_0x3b4184+'/'+_0x45c646)[_0x66f3('0x1d')](_0x179291);}return null;};}function patchUpdates(_0x529a54){return function(_0x1c1864){try{jsonpatch[_0x66f3('0x23')](_0x1c1864,_0x529a54,!![]);}catch(_0x40f398){return BPromise[_0x66f3('0x24')](_0x40f398);}return _0x1c1864[_0x66f3('0x25')]();};}function saveUpdates(_0x2cc4d6,_0x40dec8){return function(_0x2a0959){if(_0x2a0959){return _0x2a0959[_0x66f3('0x26')](_0x2cc4d6)[_0x66f3('0x27')](function(_0x5975b1){return _0x5975b1;});}return null;};}function removeEntity(_0x6e7b05,_0x4b7072){return function(_0x9f7cee){if(_0x9f7cee){return _0x9f7cee[_0x66f3('0x28')]()[_0x66f3('0x27')](function(){var _0x571c8d=_0x9f7cee['get']({'plain':!![]});var _0x49f4a2=_0x66f3('0x29');return db[_0x66f3('0x2a')][_0x66f3('0x28')]({'where':{'type':_0x49f4a2,'resourceId':_0x571c8d['id']}})[_0x66f3('0x27')](function(){return _0x9f7cee;});})[_0x66f3('0x27')](function(){_0x6e7b05[_0x66f3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fd51a,_0x381e73){return function(_0x40d461){if(!_0x40d461){_0x2fd51a[_0x66f3('0x1a')](0x194);}return _0x40d461;};}function handleError(_0x397d14,_0xd4174d){_0xd4174d=_0xd4174d||0x1f4;return function(_0x241ba2){logger['error'](_0x241ba2[_0x66f3('0x2b')]);if(_0x241ba2[_0x66f3('0x2c')]){delete _0x241ba2['name'];}_0x397d14['status'](_0xd4174d)[_0x66f3('0x2d')](_0x241ba2);};}exports[_0x66f3('0x2e')]=function(_0x48e450,_0x5e9878){var _0x4e5415={},_0x540178={},_0xf0f304={'count':0x0,'rows':[]};var _0x414a05=db[_0x66f3('0x2f')]['rawAttributes'];_0x540178[_0x66f3('0x30')]=_[_0x66f3('0x31')](_0x414a05);_0x540178[_0x66f3('0x32')]=_[_0x66f3('0x31')](_0x48e450[_0x66f3('0x32')]);_0x540178[_0x66f3('0x33')]=_[_0x66f3('0x34')](_0x540178['model'],_0x540178[_0x66f3('0x32')]);_0x4e5415[_0x66f3('0x35')]=_[_0x66f3('0x34')](_0x540178[_0x66f3('0x30')],qs['fields'](_0x48e450[_0x66f3('0x32')][_0x66f3('0x36')]));_0x4e5415['attributes']=_0x4e5415[_0x66f3('0x35')][_0x66f3('0x37')]?_0x4e5415[_0x66f3('0x35')]:_0x540178[_0x66f3('0x30')];if(!_0x48e450[_0x66f3('0x32')]['hasOwnProperty'](_0x66f3('0x38'))){_0x4e5415[_0x66f3('0x20')]=qs[_0x66f3('0x20')](_0x48e450[_0x66f3('0x32')][_0x66f3('0x20')]);_0x4e5415[_0x66f3('0x1f')]=qs[_0x66f3('0x1f')](_0x48e450[_0x66f3('0x32')]['offset']);}_0x4e5415['order']=qs[_0x66f3('0x39')](_0x48e450[_0x66f3('0x32')][_0x66f3('0x39')]);_0x4e5415[_0x66f3('0x3a')]=qs[_0x66f3('0x33')](_[_0x66f3('0x3b')](_0x48e450[_0x66f3('0x32')],_0x540178['filters']));if(_0x48e450[_0x66f3('0x32')]['filter']){_0x4e5415['where']=_[_0x66f3('0x3c')](_0x4e5415[_0x66f3('0x3a')],{'$or':_['map'](_0x414a05,function(_0x4b6a48){if(_0x4b6a48[_0x66f3('0x3d')][_0x66f3('0x3e')]!=='VIRTUAL'){var _0x4c17aa={};_0x4c17aa[_0x4b6a48['field']]={'$like':'%'+_0x48e450[_0x66f3('0x32')][_0x66f3('0x3f')]+'%'};return _0x4c17aa;}})});}_0x4e5415=_[_0x66f3('0x3c')]({},_0x4e5415,_0x48e450['options']);var _0xaa17be={'where':_0x4e5415[_0x66f3('0x3a')]};return db[_0x66f3('0x2f')][_0x66f3('0x1e')](_0xaa17be)[_0x66f3('0x27')](function(_0x38a756){_0xf0f304[_0x66f3('0x1e')]=_0x38a756;if(_0x48e450[_0x66f3('0x32')][_0x66f3('0x40')]){_0x4e5415[_0x66f3('0x41')]=[{'all':!![]}];}return db['FaxQueue'][_0x66f3('0x42')](_0x4e5415);})[_0x66f3('0x27')](function(_0x4d0c7d){_0xf0f304[_0x66f3('0x43')]=_0x4d0c7d;return _0xf0f304;})[_0x66f3('0x27')](respondWithFilteredResult(_0x5e9878,_0x4e5415))['catch'](handleError(_0x5e9878,null));};exports[_0x66f3('0x44')]=function(_0x34ba8c,_0x1e7134){var _0x4abc5c={'raw':!![],'where':{'id':_0x34ba8c[_0x66f3('0x45')]['id']}},_0xf50142={};_0xf50142[_0x66f3('0x30')]=_['keys'](db[_0x66f3('0x2f')][_0x66f3('0x46')]);_0xf50142[_0x66f3('0x32')]=_[_0x66f3('0x31')](_0x34ba8c[_0x66f3('0x32')]);_0xf50142[_0x66f3('0x33')]=_[_0x66f3('0x34')](_0xf50142[_0x66f3('0x30')],_0xf50142[_0x66f3('0x32')]);_0x4abc5c[_0x66f3('0x35')]=_[_0x66f3('0x34')](_0xf50142[_0x66f3('0x30')],qs[_0x66f3('0x36')](_0x34ba8c[_0x66f3('0x32')][_0x66f3('0x36')]));_0x4abc5c[_0x66f3('0x35')]=_0x4abc5c[_0x66f3('0x35')][_0x66f3('0x37')]?_0x4abc5c[_0x66f3('0x35')]:_0xf50142[_0x66f3('0x30')];if(_0x34ba8c[_0x66f3('0x32')]['includeAll']){_0x4abc5c[_0x66f3('0x41')]=[{'all':!![]}];}_0x4abc5c=_[_0x66f3('0x3c')]({},_0x4abc5c,_0x34ba8c[_0x66f3('0x47')]);return db[_0x66f3('0x2f')][_0x66f3('0x48')](_0x4abc5c)[_0x66f3('0x27')](handleEntityNotFound(_0x1e7134,null))[_0x66f3('0x27')](respondWithResult(_0x1e7134,null))[_0x66f3('0x49')](handleError(_0x1e7134,null));};exports[_0x66f3('0x4a')]=function(_0x178b22,_0xaf8a3c){return db[_0x66f3('0x2f')][_0x66f3('0x4a')](_0x178b22[_0x66f3('0x4b')],{})[_0x66f3('0x27')](function(_0x456ecf){var _0x5cbc5c=_0x178b22[_0x66f3('0x4c')]['get']({'plain':!![]});if(!_0x5cbc5c)throw new Error(_0x66f3('0x4d'));if(_0x5cbc5c['role']===_0x66f3('0x4c')){var _0xbe7bf7=_0x456ecf[_0x66f3('0x4e')]({'plain':!![]});var _0x2c7654=_0x66f3('0x29');return db[_0x66f3('0x4f')][_0x66f3('0x48')]({'where':{'name':_0x2c7654,'userProfileId':_0x5cbc5c[_0x66f3('0x50')]},'raw':!![]})[_0x66f3('0x27')](function(_0xe67cc){if(_0xe67cc&&_0xe67cc[_0x66f3('0x51')]===0x0){return db['UserProfileResource'][_0x66f3('0x4a')]({'name':_0xbe7bf7[_0x66f3('0x2c')],'resourceId':_0xbe7bf7['id'],'type':_0xe67cc[_0x66f3('0x2c')],'sectionId':_0xe67cc['id']},{})[_0x66f3('0x27')](function(){return _0x456ecf;});}else{return _0x456ecf;}})[_0x66f3('0x49')](function(_0x2a7170){logger[_0x66f3('0x52')](_0x66f3('0x53'),_0x2a7170);throw _0x2a7170;});}return _0x456ecf;})[_0x66f3('0x27')](respondWithResult(_0xaf8a3c,0xc9))['catch'](handleError(_0xaf8a3c,null));};exports[_0x66f3('0x26')]=function(_0x266275,_0x536a3f){if(_0x266275['body']['id']){delete _0x266275[_0x66f3('0x4b')]['id'];}return db['FaxQueue'][_0x66f3('0x48')]({'where':{'id':_0x266275[_0x66f3('0x45')]['id']}})[_0x66f3('0x27')](handleEntityNotFound(_0x536a3f,null))[_0x66f3('0x27')](saveUpdates(_0x266275[_0x66f3('0x4b')],null))[_0x66f3('0x27')](respondWithResult(_0x536a3f,null))[_0x66f3('0x49')](handleError(_0x536a3f,null));};exports['destroy']=function(_0x570a00,_0xf2eaad){return db[_0x66f3('0x2f')][_0x66f3('0x48')]({'where':{'id':_0x570a00[_0x66f3('0x45')]['id']}})[_0x66f3('0x27')](handleEntityNotFound(_0xf2eaad,null))[_0x66f3('0x27')](removeEntity(_0xf2eaad,null))[_0x66f3('0x49')](handleError(_0xf2eaad,null));};exports['describe']=function(_0x58b927,_0x453f00){return db['FaxQueue'][_0x66f3('0x54')]()[_0x66f3('0x27')](respondWithResult(_0x453f00,null))[_0x66f3('0x49')](handleError(_0x453f00,null));};exports['getMembers']=function(_0x380c24,_0x1599b0,_0x443987){var _0x19fe8f={'raw':!![],'where':{}},_0x15221d={},_0x53476d;return db[_0x66f3('0x2f')]['findOne']({'where':{'id':_0x380c24[_0x66f3('0x45')]['id']}})[_0x66f3('0x27')](handleEntityNotFound(_0x1599b0,null))[_0x66f3('0x27')](function(_0x58e96a){if(_0x58e96a){_0x53476d=_0x58e96a[_0x66f3('0x4e')]({'plain':!![]});_0x15221d['model']=_[_0x66f3('0x31')](db[_0x66f3('0x55')][_0x66f3('0x46')]);_0x15221d[_0x66f3('0x32')]=_['keys'](_0x380c24[_0x66f3('0x32')]);_0x15221d[_0x66f3('0x33')]=_['intersection'](_0x15221d[_0x66f3('0x30')],_0x15221d['query']);_0x19fe8f['attributes']=_[_0x66f3('0x34')](_0x15221d[_0x66f3('0x30')],qs['fields'](_0x380c24['query'][_0x66f3('0x36')]));_0x19fe8f['attributes']=_0x19fe8f['attributes'][_0x66f3('0x37')]?_0x19fe8f[_0x66f3('0x35')]:_0x15221d[_0x66f3('0x30')];if(!_0x380c24[_0x66f3('0x32')][_0x66f3('0x56')]('nolimit')){_0x19fe8f[_0x66f3('0x20')]=qs[_0x66f3('0x20')](_0x380c24['query'][_0x66f3('0x20')]);_0x19fe8f[_0x66f3('0x1f')]=qs[_0x66f3('0x1f')](_0x380c24[_0x66f3('0x32')][_0x66f3('0x1f')]);}_0x19fe8f[_0x66f3('0x57')]=qs[_0x66f3('0x39')](_0x380c24['query'][_0x66f3('0x39')]);_0x19fe8f[_0x66f3('0x3a')]=qs[_0x66f3('0x33')](_['pick'](_0x380c24[_0x66f3('0x32')],_0x15221d[_0x66f3('0x33')]));_0x19fe8f[_0x66f3('0x3a')][_0x66f3('0x58')]=_0x58e96a['id'];if(_0x380c24[_0x66f3('0x32')][_0x66f3('0x3f')]){_0x19fe8f[_0x66f3('0x3a')]=_[_0x66f3('0x3c')](_0x19fe8f[_0x66f3('0x3a')],{'$or':_['map'](_0x19fe8f[_0x66f3('0x35')],function(_0x4e3468){var _0x28ae4f={};_0x28ae4f[_0x4e3468]={'$like':'%'+_0x380c24['query'][_0x66f3('0x3f')]+'%'};return _0x28ae4f;})});}_0x19fe8f=_[_0x66f3('0x3c')]({},_0x19fe8f,_0x380c24[_0x66f3('0x47')]);return db[_0x66f3('0x55')][_0x66f3('0x42')](_0x19fe8f);}})['then'](function(_0x3e22a2){if(_0x3e22a2){return db['User'][_0x66f3('0x59')]({'where':{'id':_[_0x66f3('0x5a')](_0x3e22a2,'UserId'),'role':_0x66f3('0x5b')},'attributes':['id',_0x66f3('0x2c'),_0x66f3('0x5c'),'updatedAt',_0x66f3('0x5d')]});}})['then'](function(_0x3b516b){if(_0x3b516b){return{'count':_0x3b516b[_0x66f3('0x1e')],'rows':_[_0x66f3('0x5a')](_0x3b516b[_0x66f3('0x43')],function(_0x51486){return{'membername':_0x51486[_0x66f3('0x2c')],'UserId':_0x51486['id'],'queue_name':_0x53476d[_0x66f3('0x2c')],'FaxQueueId':_0x53476d['id'],'interface':util['format']('%s/%s','SIP',_0x51486[_0x66f3('0x2c')]),'penalty':0x0,'paused':_0x51486[_0x66f3('0x5c')],'createdAt':_0x51486[_0x66f3('0x5d')],'updatedAt':_0x51486[_0x66f3('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x66f3('0x27')](respondWithFilteredResult(_0x1599b0,_0x19fe8f))[_0x66f3('0x49')](handleError(_0x1599b0,null));};exports[_0x66f3('0x5f')]=function(_0x56e2ab,_0x320cc4,_0x3a8e28){var _0x504a1b={};var _0x556ad4={};var _0x3923cd;var _0x466e88;return db[_0x66f3('0x2f')]['findOne']({'where':{'id':_0x56e2ab[_0x66f3('0x45')]['id']}})[_0x66f3('0x27')](handleEntityNotFound(_0x320cc4,null))[_0x66f3('0x27')](function(_0x7222cf){if(_0x7222cf){_0x3923cd=_0x7222cf;_0x556ad4[_0x66f3('0x30')]=_['keys'](db[_0x66f3('0x60')][_0x66f3('0x46')]);_0x556ad4[_0x66f3('0x32')]=_['keys'](_0x56e2ab[_0x66f3('0x32')]);_0x556ad4[_0x66f3('0x33')]=_[_0x66f3('0x34')](_0x556ad4[_0x66f3('0x30')],_0x556ad4[_0x66f3('0x32')]);_0x504a1b[_0x66f3('0x35')]=_[_0x66f3('0x34')](_0x556ad4[_0x66f3('0x30')],qs[_0x66f3('0x36')](_0x56e2ab[_0x66f3('0x32')][_0x66f3('0x36')]));_0x504a1b[_0x66f3('0x35')]=_0x504a1b[_0x66f3('0x35')][_0x66f3('0x37')]?_0x504a1b[_0x66f3('0x35')]:_0x556ad4[_0x66f3('0x30')];_0x504a1b[_0x66f3('0x57')]=qs[_0x66f3('0x39')](_0x56e2ab[_0x66f3('0x32')][_0x66f3('0x39')]);_0x504a1b[_0x66f3('0x3a')]=qs['filters'](_['pick'](_0x56e2ab['query'],_0x556ad4['filters']));if(_0x56e2ab[_0x66f3('0x32')]['filter']){_0x504a1b[_0x66f3('0x3a')]=_[_0x66f3('0x3c')](_0x504a1b[_0x66f3('0x3a')],{'$or':_[_0x66f3('0x5a')](_0x504a1b[_0x66f3('0x35')],function(_0x50870f){var _0x15ac7f={};_0x15ac7f[_0x50870f]={'$like':'%'+_0x56e2ab[_0x66f3('0x32')][_0x66f3('0x3f')]+'%'};return _0x15ac7f;})});}_0x504a1b=_[_0x66f3('0x3c')]({},_0x504a1b,_0x56e2ab[_0x66f3('0x47')]);return _0x3923cd[_0x66f3('0x5f')](_0x504a1b);}})['then'](function(_0x5d669a){if(_0x5d669a){_0x466e88=_0x5d669a[_0x66f3('0x37')];if(!_0x56e2ab['query'][_0x66f3('0x56')](_0x66f3('0x38'))){_0x504a1b[_0x66f3('0x20')]=qs['limit'](_0x56e2ab[_0x66f3('0x32')][_0x66f3('0x20')]);_0x504a1b[_0x66f3('0x1f')]=qs['offset'](_0x56e2ab[_0x66f3('0x32')][_0x66f3('0x1f')]);}return _0x3923cd['getTeams'](_0x504a1b);}})[_0x66f3('0x27')](function(_0x2bc6d){if(_0x2bc6d){return _0x2bc6d?{'count':_0x466e88,'rows':_0x2bc6d}:null;}})[_0x66f3('0x27')](respondWithResult(_0x320cc4,null))[_0x66f3('0x49')](handleError(_0x320cc4,null));};exports[_0x66f3('0x61')]=function(_0x35eb55,_0x288ce1,_0x289150){var _0x5eae1e=[];var _0x52edd9;return db['Team'][_0x66f3('0x42')]({'where':{'id':_0x35eb55[_0x66f3('0x4b')][_0x66f3('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x66f3('0x27')](function(_0x1ce648){if(_0x1ce648){for(var _0x4248b7=0x0;_0x4248b7<_0x1ce648[_0x66f3('0x37')];_0x4248b7+=0x1){for(var _0x1dacd5=0x0;_0x1dacd5<_0x1ce648[_0x4248b7][_0x66f3('0x63')][_0x66f3('0x37')];_0x1dacd5+=0x1){_0x5eae1e=_[_0x66f3('0x64')](_0x5eae1e,[_0x1ce648[_0x4248b7][_0x66f3('0x63')][_0x1dacd5]['id']]);}}return _0x5eae1e;}})['then'](function(_0x41884f){if(_0x41884f){return db[_0x66f3('0x2f')]['find']({'where':{'id':_0x35eb55[_0x66f3('0x45')]['id']}});}})['then'](function(_0x5b6291){if(_0x5b6291){_0x52edd9=_0x5b6291;return _0x52edd9['addAgents'](_0x5eae1e,{'penalty':_0x35eb55['body'][_0x66f3('0x65')]});}})[_0x66f3('0x27')](function(_0x48aed2){if(_0x48aed2){return _0x52edd9['addTeams'](_0x35eb55[_0x66f3('0x4b')][_0x66f3('0x62')]);}})[_0x66f3('0x27')](handleEntityNotFound(_0x288ce1,null))[_0x66f3('0x27')](respondWithStatusCode(_0x288ce1,null))[_0x66f3('0x49')](handleError(_0x288ce1,null));};exports[_0x66f3('0x66')]=function(_0x231712,_0xbae028,_0x517c18){var _0x2db983=[];var _0x3e2fc9;return db[_0x66f3('0x60')][_0x66f3('0x42')]({'where':{'id':_0x231712['query'][_0x66f3('0x62')]},'attributes':['id'],'include':[{'model':db[_0x66f3('0x67')],'as':_0x66f3('0x63'),'attributes':['id'],'raw':!![]}]})[_0x66f3('0x27')](function(_0x553038){if(_0x553038){for(var _0x455335=0x0;_0x455335<_0x553038[_0x66f3('0x37')];_0x455335+=0x1){for(var _0x773501=0x0;_0x773501<_0x553038[_0x455335][_0x66f3('0x63')][_0x66f3('0x37')];_0x773501+=0x1){_0x2db983=_[_0x66f3('0x64')](_0x2db983,[_0x553038[_0x455335]['Agents'][_0x773501]['id']]);}}return _0x2db983;}})[_0x66f3('0x27')](function(_0x4cf924){if(_0x4cf924){return db[_0x66f3('0x2f')]['find']({'where':{'id':_0x231712[_0x66f3('0x45')]['id']}});}})[_0x66f3('0x27')](function(_0x17daf4){if(_0x17daf4){_0x3e2fc9=_0x17daf4;return _0x3e2fc9[_0x66f3('0x68')](_0x2db983);}})[_0x66f3('0x27')](function(_0x289d6f){if(_0x3e2fc9){return _0x3e2fc9[_0x66f3('0x66')](_0x231712[_0x66f3('0x32')]['ids']);}})[_0x66f3('0x27')](handleEntityNotFound(_0xbae028,null))[_0x66f3('0x27')](respondWithStatusCode(_0xbae028,null))[_0x66f3('0x49')](handleError(_0xbae028,null));};exports[_0x66f3('0x69')]=function(_0x45caff,_0x41bbe5,_0x4912b0){return db[_0x66f3('0x2f')][_0x66f3('0x48')]({'where':{'id':_0x45caff[_0x66f3('0x45')]['id']}})[_0x66f3('0x27')](handleEntityNotFound(_0x41bbe5,null))[_0x66f3('0x27')](function(_0x3b74aa){if(_0x3b74aa){return _0x3b74aa['addAgents'](_0x45caff['body'][_0x66f3('0x62')],_[_0x66f3('0x6a')](_0x45caff[_0x66f3('0x4b')],['ids','id'])||{})[_0x66f3('0x6b')](function(_0x32f4c6){for(var _0x1b55da=0x0;_0x1b55da<_0x45caff[_0x66f3('0x4b')]['ids'][_0x66f3('0x37')];_0x1b55da+=0x1){socket['emit'](_0x66f3('0x6c'),{'UserId':_0x45caff[_0x66f3('0x4b')][_0x66f3('0x62')][_0x1b55da],'FaxQueueId':_0x45caff['params']['id']});}return _0x32f4c6;});}})[_0x66f3('0x27')](respondWithResult(_0x41bbe5,null))['catch'](handleError(_0x41bbe5,null));};exports[_0x66f3('0x68')]=function(_0x5ac245,_0x1173ed,_0x4f5182){var _0x1392d0;return db[_0x66f3('0x2f')][_0x66f3('0x48')]({'where':{'id':_0x5ac245[_0x66f3('0x45')]['id']}})[_0x66f3('0x27')](handleEntityNotFound(_0x1173ed,null))[_0x66f3('0x27')](function(_0xb9422f){if(_0xb9422f){return _0xb9422f['removeAgents'](_0x5ac245[_0x66f3('0x32')][_0x66f3('0x62')])[_0x66f3('0x27')](function(_0x3104c7){if(_[_0x66f3('0x6d')](_0x5ac245[_0x66f3('0x32')]['ids'])){for(var _0x4b0d9e=0x0;_0x4b0d9e<_0x5ac245['query'][_0x66f3('0x62')][_0x66f3('0x37')];_0x4b0d9e+=0x1){socket[_0x66f3('0x6e')](_0x66f3('0x6f'),{'UserId':_0x5ac245[_0x66f3('0x32')]['ids'][_0x4b0d9e],'FaxQueueId':_0x5ac245[_0x66f3('0x45')]['id']});}}else{socket['emit']('userFaxQueue:remove',{'UserId':_0x5ac245[_0x66f3('0x32')]['ids'],'FaxQueueId':_0x5ac245[_0x66f3('0x45')]['id']});}});}})[_0x66f3('0x27')](respondWithStatusCode(_0x1173ed,null))['catch'](handleError(_0x1173ed,null));};exports[_0x66f3('0x70')]=function(_0x1ae5f8,_0x5cdfc1,_0xe562fe){var _0x4bc301={};var _0x800e0d={};var _0x288fbc;var _0x87ab5b;return db['FaxQueue']['findOne']({'where':{'id':_0x1ae5f8[_0x66f3('0x45')]['id']}})[_0x66f3('0x27')](handleEntityNotFound(_0x5cdfc1,null))['then'](function(_0x13bd11){if(_0x13bd11){_0x288fbc=_0x13bd11;_0x800e0d[_0x66f3('0x30')]=_[_0x66f3('0x31')](db['User'][_0x66f3('0x46')]);_0x800e0d[_0x66f3('0x32')]=_[_0x66f3('0x31')](_0x1ae5f8[_0x66f3('0x32')]);_0x800e0d[_0x66f3('0x33')]=_[_0x66f3('0x34')](_0x800e0d[_0x66f3('0x30')],_0x800e0d['query']);_0x4bc301[_0x66f3('0x35')]=_['intersection'](_0x800e0d['model'],qs[_0x66f3('0x36')](_0x1ae5f8[_0x66f3('0x32')][_0x66f3('0x36')]));_0x4bc301['attributes']=_0x4bc301[_0x66f3('0x35')]['length']?_0x4bc301[_0x66f3('0x35')]:_0x800e0d['model'];_0x4bc301['order']=qs[_0x66f3('0x39')](_0x1ae5f8[_0x66f3('0x32')][_0x66f3('0x39')]);_0x4bc301[_0x66f3('0x3a')]=qs[_0x66f3('0x33')](_[_0x66f3('0x3b')](_0x1ae5f8[_0x66f3('0x32')],_0x800e0d[_0x66f3('0x33')]));if(_0x1ae5f8[_0x66f3('0x32')][_0x66f3('0x3f')]){_0x4bc301[_0x66f3('0x3a')]=_[_0x66f3('0x3c')](_0x4bc301[_0x66f3('0x3a')],{'$or':_[_0x66f3('0x5a')](_0x4bc301[_0x66f3('0x35')],function(_0x4eb617){var _0x2e5b48={};_0x2e5b48[_0x4eb617]={'$like':'%'+_0x1ae5f8[_0x66f3('0x32')][_0x66f3('0x3f')]+'%'};return _0x2e5b48;})});}_0x4bc301=_[_0x66f3('0x3c')]({},_0x4bc301,_0x1ae5f8[_0x66f3('0x47')]);return _0x288fbc[_0x66f3('0x70')](_0x4bc301);}})[_0x66f3('0x27')](function(_0x4ecdef){if(_0x4ecdef){_0x87ab5b=_0x4ecdef[_0x66f3('0x37')];if(!_0x1ae5f8['query'][_0x66f3('0x56')]('nolimit')){_0x4bc301['limit']=qs[_0x66f3('0x20')](_0x1ae5f8[_0x66f3('0x32')][_0x66f3('0x20')]);_0x4bc301[_0x66f3('0x1f')]=qs['offset'](_0x1ae5f8[_0x66f3('0x32')][_0x66f3('0x1f')]);}return _0x288fbc[_0x66f3('0x70')](_0x4bc301);}})[_0x66f3('0x27')](function(_0x484819){if(_0x484819){return _0x484819?{'count':_0x87ab5b,'rows':_0x484819}:null;}})['then'](respondWithResult(_0x5cdfc1,null))[_0x66f3('0x49')](handleError(_0x5cdfc1,null));}; \ No newline at end of file +var _0x4e2b=['sort','pick','filter','where','merge','type','VIRTUAL','field','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','describe','UserFaxQueue','hasOwnProperty','order','FaxQueueId','map','options','findAndCountAll','agent','faxPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','findOne','Team','rawAttributes','addTeams','ids','User','addAgents','removeTeams','Agents','removeAgents','omit','spread','emit','userFaxQueue:save','isArray','userFaxQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','FaxQueue','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit'];(function(_0x4ad364,_0x3ff8d7){var _0x4ac3c3=function(_0x213721){while(--_0x213721){_0x4ad364['push'](_0x4ad364['shift']());}};_0x4ac3c3(++_0x3ff8d7);}(_0x4e2b,0xa9));var _0xb4e2=function(_0x658c21,_0xf70ef5){_0x658c21=_0x658c21-0x0;var _0x50e4f1=_0x4e2b[_0x658c21];return _0x50e4f1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb4e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4e2('0x1'));var jsonpatch=require(_0xb4e2('0x2'));var rp=require(_0xb4e2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb4e2('0x4'));var util=require(_0xb4e2('0x5'));var path=require('path');var sox=require(_0xb4e2('0x6'));var csv=require(_0xb4e2('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb4e2('0x8'));var squel=require(_0xb4e2('0x9'));var crypto=require(_0xb4e2('0xa'));var jsforce=require(_0xb4e2('0xb'));var deskjs=require(_0xb4e2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb4e2('0xd'));var Papa=require(_0xb4e2('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xb4e2('0xf'));var Redis=require(_0xb4e2('0x10'));var qs=require(_0xb4e2('0x11'));var logger=require(_0xb4e2('0x12'))(_0xb4e2('0x13'));var utils=require(_0xb4e2('0x14'));var config=require(_0xb4e2('0x15'));var db=require(_0xb4e2('0x16'))['db'];config[_0xb4e2('0x17')]=_['defaults'](config['redis'],{'host':_0xb4e2('0x18'),'port':0x18eb});var socket=require(_0xb4e2('0x19'))(new Redis(config[_0xb4e2('0x17')]));require(_0xb4e2('0x1a'))[_0xb4e2('0x1b')](socket);function respondWithStatusCode(_0x2d2418,_0x5f04d8){_0x5f04d8=_0x5f04d8||0xcc;return function(_0x171097){if(_0x171097){return _0x2d2418[_0xb4e2('0x1c')](_0x5f04d8);}return _0x2d2418[_0xb4e2('0x1d')](_0x5f04d8)[_0xb4e2('0x1e')]();};}function respondWithResult(_0x17c95c,_0x332105){_0x332105=_0x332105||0xc8;return function(_0xbb472a){if(_0xbb472a){return _0x17c95c['status'](_0x332105)[_0xb4e2('0x1f')](_0xbb472a);}};}function respondWithFilteredResult(_0x119b9a,_0x2cc6e0){return function(_0x2e63c3){if(_0x2e63c3){var _0x3eb604=_0x2e63c3[_0xb4e2('0x20')],_0x569e0f=_0x2cc6e0['offset'],_0x22f25=_0x2cc6e0[_0xb4e2('0x21')]+_0x2cc6e0['limit'],_0x2b75d9;if(_0x22f25>=_0x3eb604){_0x22f25=_0x3eb604;_0x2b75d9=0xc8;}else{_0x2b75d9=0xce;}_0x119b9a[_0xb4e2('0x1d')](_0x2b75d9);return _0x119b9a[_0xb4e2('0x22')](_0xb4e2('0x23'),_0x569e0f+'-'+_0x22f25+'/'+_0x3eb604)[_0xb4e2('0x1f')](_0x2e63c3);}return null;};}function patchUpdates(_0x22a205){return function(_0x45edfc){try{jsonpatch[_0xb4e2('0x24')](_0x45edfc,_0x22a205,!![]);}catch(_0x322971){return BPromise[_0xb4e2('0x25')](_0x322971);}return _0x45edfc[_0xb4e2('0x26')]();};}function saveUpdates(_0x875a6f,_0x136746){return function(_0x11b3d7){if(_0x11b3d7){return _0x11b3d7[_0xb4e2('0x27')](_0x875a6f)['then'](function(_0x343b60){return _0x343b60;});}return null;};}function removeEntity(_0x419e1e,_0x51fe2d){return function(_0x3a5b2a){if(_0x3a5b2a){return _0x3a5b2a[_0xb4e2('0x28')]()[_0xb4e2('0x29')](function(){var _0x541d02=_0x3a5b2a[_0xb4e2('0x2a')]({'plain':!![]});var _0x49c0a2='FaxQueues';return db[_0xb4e2('0x2b')][_0xb4e2('0x28')]({'where':{'type':_0x49c0a2,'resourceId':_0x541d02['id']}})[_0xb4e2('0x29')](function(){return _0x3a5b2a;});})[_0xb4e2('0x29')](function(){_0x419e1e[_0xb4e2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x978bc,_0x9869a7){return function(_0x20e524){if(!_0x20e524){_0x978bc[_0xb4e2('0x1c')](0x194);}return _0x20e524;};}function handleError(_0xd1e3f5,_0x25802a){_0x25802a=_0x25802a||0x1f4;return function(_0x56f4a8){logger[_0xb4e2('0x2c')](_0x56f4a8[_0xb4e2('0x2d')]);if(_0x56f4a8[_0xb4e2('0x2e')]){delete _0x56f4a8[_0xb4e2('0x2e')];}_0xd1e3f5['status'](_0x25802a)[_0xb4e2('0x2f')](_0x56f4a8);};}exports['index']=function(_0x3cce28,_0x3af918){var _0x392b20={},_0x357eb3={},_0x49b320={'count':0x0,'rows':[]};var _0x2ba839=db[_0xb4e2('0x30')]['rawAttributes'];_0x357eb3[_0xb4e2('0x31')]=_[_0xb4e2('0x32')](_0x2ba839);_0x357eb3['query']=_[_0xb4e2('0x32')](_0x3cce28[_0xb4e2('0x33')]);_0x357eb3[_0xb4e2('0x34')]=_[_0xb4e2('0x35')](_0x357eb3[_0xb4e2('0x31')],_0x357eb3[_0xb4e2('0x33')]);_0x392b20[_0xb4e2('0x36')]=_['intersection'](_0x357eb3[_0xb4e2('0x31')],qs[_0xb4e2('0x37')](_0x3cce28[_0xb4e2('0x33')]['fields']));_0x392b20[_0xb4e2('0x36')]=_0x392b20[_0xb4e2('0x36')][_0xb4e2('0x38')]?_0x392b20[_0xb4e2('0x36')]:_0x357eb3[_0xb4e2('0x31')];if(!_0x3cce28[_0xb4e2('0x33')]['hasOwnProperty'](_0xb4e2('0x39'))){_0x392b20[_0xb4e2('0x3a')]=qs[_0xb4e2('0x3a')](_0x3cce28[_0xb4e2('0x33')][_0xb4e2('0x3a')]);_0x392b20[_0xb4e2('0x21')]=qs['offset'](_0x3cce28[_0xb4e2('0x33')][_0xb4e2('0x21')]);}_0x392b20['order']=qs[_0xb4e2('0x3b')](_0x3cce28[_0xb4e2('0x33')][_0xb4e2('0x3b')]);_0x392b20['where']=qs['filters'](_[_0xb4e2('0x3c')](_0x3cce28[_0xb4e2('0x33')],_0x357eb3[_0xb4e2('0x34')]));if(_0x3cce28[_0xb4e2('0x33')][_0xb4e2('0x3d')]){_0x392b20[_0xb4e2('0x3e')]=_[_0xb4e2('0x3f')](_0x392b20['where'],{'$or':_['map'](_0x2ba839,function(_0xf651f3){if(_0xf651f3[_0xb4e2('0x40')]['key']!==_0xb4e2('0x41')){var _0x303dc7={};_0x303dc7[_0xf651f3[_0xb4e2('0x42')]]={'$like':'%'+_0x3cce28[_0xb4e2('0x33')][_0xb4e2('0x3d')]+'%'};return _0x303dc7;}})});}_0x392b20=_['merge']({},_0x392b20,_0x3cce28['options']);var _0x5624e5={'where':_0x392b20[_0xb4e2('0x3e')]};return db[_0xb4e2('0x30')][_0xb4e2('0x20')](_0x5624e5)['then'](function(_0x557f65){_0x49b320[_0xb4e2('0x20')]=_0x557f65;if(_0x3cce28[_0xb4e2('0x33')]['includeAll']){_0x392b20[_0xb4e2('0x43')]=[{'all':!![]}];}return db['FaxQueue'][_0xb4e2('0x44')](_0x392b20);})[_0xb4e2('0x29')](function(_0x94f020){_0x49b320['rows']=_0x94f020;return _0x49b320;})[_0xb4e2('0x29')](respondWithFilteredResult(_0x3af918,_0x392b20))[_0xb4e2('0x45')](handleError(_0x3af918,null));};exports[_0xb4e2('0x46')]=function(_0x263b52,_0x3f85c7){var _0x2a064e={'raw':!![],'where':{'id':_0x263b52[_0xb4e2('0x47')]['id']}},_0x32c843={};_0x32c843[_0xb4e2('0x31')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x32c843[_0xb4e2('0x33')]=_['keys'](_0x263b52[_0xb4e2('0x33')]);_0x32c843[_0xb4e2('0x34')]=_['intersection'](_0x32c843[_0xb4e2('0x31')],_0x32c843['query']);_0x2a064e[_0xb4e2('0x36')]=_['intersection'](_0x32c843[_0xb4e2('0x31')],qs['fields'](_0x263b52['query'][_0xb4e2('0x37')]));_0x2a064e[_0xb4e2('0x36')]=_0x2a064e[_0xb4e2('0x36')][_0xb4e2('0x38')]?_0x2a064e[_0xb4e2('0x36')]:_0x32c843[_0xb4e2('0x31')];if(_0x263b52[_0xb4e2('0x33')][_0xb4e2('0x48')]){_0x2a064e[_0xb4e2('0x43')]=[{'all':!![]}];}_0x2a064e=_[_0xb4e2('0x3f')]({},_0x2a064e,_0x263b52['options']);return db['FaxQueue'][_0xb4e2('0x49')](_0x2a064e)['then'](handleEntityNotFound(_0x3f85c7,null))[_0xb4e2('0x29')](respondWithResult(_0x3f85c7,null))[_0xb4e2('0x45')](handleError(_0x3f85c7,null));};exports[_0xb4e2('0x4a')]=function(_0x4d438c,_0x4a9a25){return db[_0xb4e2('0x30')]['create'](_0x4d438c[_0xb4e2('0x4b')],{})[_0xb4e2('0x29')](function(_0x4ec874){var _0x9c26aa=_0x4d438c[_0xb4e2('0x4c')][_0xb4e2('0x2a')]({'plain':!![]});if(!_0x9c26aa)throw new Error(_0xb4e2('0x4d'));if(_0x9c26aa[_0xb4e2('0x4e')]===_0xb4e2('0x4c')){var _0x19a92b=_0x4ec874['get']({'plain':!![]});var _0x2ffedf=_0xb4e2('0x4f');return db['UserProfileSection'][_0xb4e2('0x49')]({'where':{'name':_0x2ffedf,'userProfileId':_0x9c26aa['userProfileId']},'raw':!![]})[_0xb4e2('0x29')](function(_0x2f64a5){if(_0x2f64a5&&_0x2f64a5['autoAssociation']===0x0){return db[_0xb4e2('0x2b')][_0xb4e2('0x4a')]({'name':_0x19a92b[_0xb4e2('0x2e')],'resourceId':_0x19a92b['id'],'type':_0x2f64a5[_0xb4e2('0x2e')],'sectionId':_0x2f64a5['id']},{})[_0xb4e2('0x29')](function(){return _0x4ec874;});}else{return _0x4ec874;}})[_0xb4e2('0x45')](function(_0x5f9eef){logger[_0xb4e2('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f9eef);throw _0x5f9eef;});}return _0x4ec874;})[_0xb4e2('0x29')](respondWithResult(_0x4a9a25,0xc9))[_0xb4e2('0x45')](handleError(_0x4a9a25,null));};exports['update']=function(_0x1c6428,_0x145d52){if(_0x1c6428[_0xb4e2('0x4b')]['id']){delete _0x1c6428[_0xb4e2('0x4b')]['id'];}return db[_0xb4e2('0x30')]['find']({'where':{'id':_0x1c6428[_0xb4e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x145d52,null))[_0xb4e2('0x29')](saveUpdates(_0x1c6428[_0xb4e2('0x4b')],null))[_0xb4e2('0x29')](respondWithResult(_0x145d52,null))[_0xb4e2('0x45')](handleError(_0x145d52,null));};exports[_0xb4e2('0x28')]=function(_0x1e7f45,_0x24b6bb){return db[_0xb4e2('0x30')][_0xb4e2('0x49')]({'where':{'id':_0x1e7f45[_0xb4e2('0x47')]['id']}})[_0xb4e2('0x29')](handleEntityNotFound(_0x24b6bb,null))[_0xb4e2('0x29')](removeEntity(_0x24b6bb,null))['catch'](handleError(_0x24b6bb,null));};exports[_0xb4e2('0x50')]=function(_0x6e2d4d,_0x45f50f){return db['FaxQueue'][_0xb4e2('0x50')]()[_0xb4e2('0x29')](respondWithResult(_0x45f50f,null))['catch'](handleError(_0x45f50f,null));};exports['getMembers']=function(_0x3399b2,_0x4e16ad,_0x5b9a1c){var _0x1c6530={'raw':!![],'where':{}},_0x5ae3e8={},_0x46c022;return db['FaxQueue']['findOne']({'where':{'id':_0x3399b2[_0xb4e2('0x47')]['id']}})[_0xb4e2('0x29')](handleEntityNotFound(_0x4e16ad,null))[_0xb4e2('0x29')](function(_0x2208bb){if(_0x2208bb){_0x46c022=_0x2208bb[_0xb4e2('0x2a')]({'plain':!![]});_0x5ae3e8[_0xb4e2('0x31')]=_[_0xb4e2('0x32')](db[_0xb4e2('0x51')]['rawAttributes']);_0x5ae3e8[_0xb4e2('0x33')]=_[_0xb4e2('0x32')](_0x3399b2[_0xb4e2('0x33')]);_0x5ae3e8['filters']=_[_0xb4e2('0x35')](_0x5ae3e8[_0xb4e2('0x31')],_0x5ae3e8[_0xb4e2('0x33')]);_0x1c6530['attributes']=_[_0xb4e2('0x35')](_0x5ae3e8['model'],qs[_0xb4e2('0x37')](_0x3399b2['query'][_0xb4e2('0x37')]));_0x1c6530[_0xb4e2('0x36')]=_0x1c6530['attributes'][_0xb4e2('0x38')]?_0x1c6530[_0xb4e2('0x36')]:_0x5ae3e8[_0xb4e2('0x31')];if(!_0x3399b2[_0xb4e2('0x33')][_0xb4e2('0x52')](_0xb4e2('0x39'))){_0x1c6530[_0xb4e2('0x3a')]=qs[_0xb4e2('0x3a')](_0x3399b2['query'][_0xb4e2('0x3a')]);_0x1c6530[_0xb4e2('0x21')]=qs[_0xb4e2('0x21')](_0x3399b2[_0xb4e2('0x33')]['offset']);}_0x1c6530[_0xb4e2('0x53')]=qs['sort'](_0x3399b2[_0xb4e2('0x33')][_0xb4e2('0x3b')]);_0x1c6530[_0xb4e2('0x3e')]=qs[_0xb4e2('0x34')](_[_0xb4e2('0x3c')](_0x3399b2[_0xb4e2('0x33')],_0x5ae3e8[_0xb4e2('0x34')]));_0x1c6530['where'][_0xb4e2('0x54')]=_0x2208bb['id'];if(_0x3399b2[_0xb4e2('0x33')][_0xb4e2('0x3d')]){_0x1c6530['where']=_[_0xb4e2('0x3f')](_0x1c6530[_0xb4e2('0x3e')],{'$or':_[_0xb4e2('0x55')](_0x1c6530[_0xb4e2('0x36')],function(_0x23fdfb){var _0xec49f0={};_0xec49f0[_0x23fdfb]={'$like':'%'+_0x3399b2[_0xb4e2('0x33')][_0xb4e2('0x3d')]+'%'};return _0xec49f0;})});}_0x1c6530=_[_0xb4e2('0x3f')]({},_0x1c6530,_0x3399b2[_0xb4e2('0x56')]);return db[_0xb4e2('0x51')][_0xb4e2('0x44')](_0x1c6530);}})[_0xb4e2('0x29')](function(_0x127163){if(_0x127163){return db['User'][_0xb4e2('0x57')]({'where':{'id':_[_0xb4e2('0x55')](_0x127163,'UserId'),'role':_0xb4e2('0x58')},'attributes':['id',_0xb4e2('0x2e'),_0xb4e2('0x59'),_0xb4e2('0x5a'),_0xb4e2('0x5b')]});}})['then'](function(_0x396e14){if(_0x396e14){return{'count':_0x396e14['count'],'rows':_['map'](_0x396e14[_0xb4e2('0x5c')],function(_0x4c6f5c){return{'membername':_0x4c6f5c[_0xb4e2('0x2e')],'UserId':_0x4c6f5c['id'],'queue_name':_0x46c022[_0xb4e2('0x2e')],'FaxQueueId':_0x46c022['id'],'interface':util[_0xb4e2('0x5d')](_0xb4e2('0x5e'),_0xb4e2('0x5f'),_0x4c6f5c[_0xb4e2('0x2e')]),'penalty':0x0,'paused':_0x4c6f5c[_0xb4e2('0x59')],'createdAt':_0x4c6f5c[_0xb4e2('0x5b')],'updatedAt':_0x4c6f5c[_0xb4e2('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb4e2('0x29')](respondWithFilteredResult(_0x4e16ad,_0x1c6530))[_0xb4e2('0x45')](handleError(_0x4e16ad,null));};exports[_0xb4e2('0x60')]=function(_0x5cda54,_0x21b5c5,_0x417349){var _0x268894={};var _0x743cd3={};var _0x48ab0d;var _0x314601;return db['FaxQueue'][_0xb4e2('0x61')]({'where':{'id':_0x5cda54['params']['id']}})['then'](handleEntityNotFound(_0x21b5c5,null))[_0xb4e2('0x29')](function(_0x4d53b2){if(_0x4d53b2){_0x48ab0d=_0x4d53b2;_0x743cd3['model']=_['keys'](db[_0xb4e2('0x62')][_0xb4e2('0x63')]);_0x743cd3['query']=_[_0xb4e2('0x32')](_0x5cda54[_0xb4e2('0x33')]);_0x743cd3[_0xb4e2('0x34')]=_['intersection'](_0x743cd3[_0xb4e2('0x31')],_0x743cd3[_0xb4e2('0x33')]);_0x268894['attributes']=_['intersection'](_0x743cd3[_0xb4e2('0x31')],qs['fields'](_0x5cda54[_0xb4e2('0x33')][_0xb4e2('0x37')]));_0x268894[_0xb4e2('0x36')]=_0x268894[_0xb4e2('0x36')]['length']?_0x268894[_0xb4e2('0x36')]:_0x743cd3[_0xb4e2('0x31')];_0x268894[_0xb4e2('0x53')]=qs['sort'](_0x5cda54[_0xb4e2('0x33')]['sort']);_0x268894[_0xb4e2('0x3e')]=qs[_0xb4e2('0x34')](_[_0xb4e2('0x3c')](_0x5cda54[_0xb4e2('0x33')],_0x743cd3[_0xb4e2('0x34')]));if(_0x5cda54[_0xb4e2('0x33')][_0xb4e2('0x3d')]){_0x268894[_0xb4e2('0x3e')]=_[_0xb4e2('0x3f')](_0x268894[_0xb4e2('0x3e')],{'$or':_[_0xb4e2('0x55')](_0x268894[_0xb4e2('0x36')],function(_0x52a1a4){var _0x44d4cc={};_0x44d4cc[_0x52a1a4]={'$like':'%'+_0x5cda54[_0xb4e2('0x33')]['filter']+'%'};return _0x44d4cc;})});}_0x268894=_['merge']({},_0x268894,_0x5cda54[_0xb4e2('0x56')]);return _0x48ab0d[_0xb4e2('0x60')](_0x268894);}})['then'](function(_0x48cae7){if(_0x48cae7){_0x314601=_0x48cae7[_0xb4e2('0x38')];if(!_0x5cda54[_0xb4e2('0x33')][_0xb4e2('0x52')](_0xb4e2('0x39'))){_0x268894[_0xb4e2('0x3a')]=qs[_0xb4e2('0x3a')](_0x5cda54[_0xb4e2('0x33')]['limit']);_0x268894[_0xb4e2('0x21')]=qs[_0xb4e2('0x21')](_0x5cda54[_0xb4e2('0x33')][_0xb4e2('0x21')]);}return _0x48ab0d['getTeams'](_0x268894);}})[_0xb4e2('0x29')](function(_0x303fd8){if(_0x303fd8){return _0x303fd8?{'count':_0x314601,'rows':_0x303fd8}:null;}})[_0xb4e2('0x29')](respondWithResult(_0x21b5c5,null))[_0xb4e2('0x45')](handleError(_0x21b5c5,null));};exports[_0xb4e2('0x64')]=function(_0x36a42b,_0x15202c,_0x3b5a76){var _0x2f028c=[];var _0x229b22;return db[_0xb4e2('0x62')]['findAll']({'where':{'id':_0x36a42b[_0xb4e2('0x4b')][_0xb4e2('0x65')]},'attributes':['id'],'include':[{'model':db[_0xb4e2('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb4e2('0x29')](function(_0x33963a){if(_0x33963a){for(var _0x1040be=0x0;_0x1040be<_0x33963a[_0xb4e2('0x38')];_0x1040be+=0x1){for(var _0x2a7a79=0x0;_0x2a7a79<_0x33963a[_0x1040be]['Agents']['length'];_0x2a7a79+=0x1){_0x2f028c=_['union'](_0x2f028c,[_0x33963a[_0x1040be]['Agents'][_0x2a7a79]['id']]);}}return _0x2f028c;}})[_0xb4e2('0x29')](function(_0x11a23a){if(_0x11a23a){return db[_0xb4e2('0x30')][_0xb4e2('0x49')]({'where':{'id':_0x36a42b[_0xb4e2('0x47')]['id']}});}})[_0xb4e2('0x29')](function(_0x5bcbc2){if(_0x5bcbc2){_0x229b22=_0x5bcbc2;return _0x229b22[_0xb4e2('0x67')](_0x2f028c,{'penalty':_0x36a42b[_0xb4e2('0x4b')]['penalty']});}})[_0xb4e2('0x29')](function(_0x5cd368){if(_0x5cd368){return _0x229b22['addTeams'](_0x36a42b['body']['ids']);}})['then'](handleEntityNotFound(_0x15202c,null))[_0xb4e2('0x29')](respondWithStatusCode(_0x15202c,null))[_0xb4e2('0x45')](handleError(_0x15202c,null));};exports[_0xb4e2('0x68')]=function(_0x2d2502,_0x6d90e,_0x43dfdd){var _0x3986e7=[];var _0x19dc00;return db[_0xb4e2('0x62')]['findAll']({'where':{'id':_0x2d2502[_0xb4e2('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb4e2('0x66')],'as':_0xb4e2('0x69'),'attributes':['id'],'raw':!![]}]})[_0xb4e2('0x29')](function(_0x5039b0){if(_0x5039b0){for(var _0x1d202e=0x0;_0x1d202e<_0x5039b0[_0xb4e2('0x38')];_0x1d202e+=0x1){for(var _0x35b8f8=0x0;_0x35b8f8<_0x5039b0[_0x1d202e]['Agents'][_0xb4e2('0x38')];_0x35b8f8+=0x1){_0x3986e7=_['union'](_0x3986e7,[_0x5039b0[_0x1d202e]['Agents'][_0x35b8f8]['id']]);}}return _0x3986e7;}})[_0xb4e2('0x29')](function(_0x48373d){if(_0x48373d){return db[_0xb4e2('0x30')][_0xb4e2('0x49')]({'where':{'id':_0x2d2502[_0xb4e2('0x47')]['id']}});}})[_0xb4e2('0x29')](function(_0x4da1b2){if(_0x4da1b2){_0x19dc00=_0x4da1b2;return _0x19dc00[_0xb4e2('0x6a')](_0x3986e7);}})['then'](function(_0x5a2b50){if(_0x19dc00){return _0x19dc00['removeTeams'](_0x2d2502[_0xb4e2('0x33')][_0xb4e2('0x65')]);}})[_0xb4e2('0x29')](handleEntityNotFound(_0x6d90e,null))[_0xb4e2('0x29')](respondWithStatusCode(_0x6d90e,null))[_0xb4e2('0x45')](handleError(_0x6d90e,null));};exports['addAgents']=function(_0x59148b,_0x1e5465,_0x9ffe7){return db['FaxQueue'][_0xb4e2('0x49')]({'where':{'id':_0x59148b[_0xb4e2('0x47')]['id']}})[_0xb4e2('0x29')](handleEntityNotFound(_0x1e5465,null))[_0xb4e2('0x29')](function(_0x5b5cfb){if(_0x5b5cfb){return _0x5b5cfb['addAgents'](_0x59148b[_0xb4e2('0x4b')]['ids'],_[_0xb4e2('0x6b')](_0x59148b[_0xb4e2('0x4b')],[_0xb4e2('0x65'),'id'])||{})[_0xb4e2('0x6c')](function(_0x5168b1){for(var _0x175350=0x0;_0x175350<_0x59148b[_0xb4e2('0x4b')][_0xb4e2('0x65')][_0xb4e2('0x38')];_0x175350+=0x1){socket[_0xb4e2('0x6d')](_0xb4e2('0x6e'),{'UserId':_0x59148b['body'][_0xb4e2('0x65')][_0x175350],'FaxQueueId':_0x59148b[_0xb4e2('0x47')]['id']});}return _0x5168b1;});}})['then'](respondWithResult(_0x1e5465,null))[_0xb4e2('0x45')](handleError(_0x1e5465,null));};exports[_0xb4e2('0x6a')]=function(_0x1a86fd,_0x248a02,_0x4d88a8){var _0x4657e1;return db['FaxQueue'][_0xb4e2('0x49')]({'where':{'id':_0x1a86fd[_0xb4e2('0x47')]['id']}})[_0xb4e2('0x29')](handleEntityNotFound(_0x248a02,null))[_0xb4e2('0x29')](function(_0x310335){if(_0x310335){return _0x310335['removeAgents'](_0x1a86fd[_0xb4e2('0x33')]['ids'])[_0xb4e2('0x29')](function(_0x3f650f){if(_[_0xb4e2('0x6f')](_0x1a86fd[_0xb4e2('0x33')][_0xb4e2('0x65')])){for(var _0x3ee16b=0x0;_0x3ee16b<_0x1a86fd[_0xb4e2('0x33')][_0xb4e2('0x65')][_0xb4e2('0x38')];_0x3ee16b+=0x1){socket[_0xb4e2('0x6d')](_0xb4e2('0x70'),{'UserId':_0x1a86fd[_0xb4e2('0x33')][_0xb4e2('0x65')][_0x3ee16b],'FaxQueueId':_0x1a86fd[_0xb4e2('0x47')]['id']});}}else{socket['emit'](_0xb4e2('0x70'),{'UserId':_0x1a86fd['query']['ids'],'FaxQueueId':_0x1a86fd[_0xb4e2('0x47')]['id']});}});}})[_0xb4e2('0x29')](respondWithStatusCode(_0x248a02,null))['catch'](handleError(_0x248a02,null));};exports[_0xb4e2('0x71')]=function(_0x3d0807,_0x1d601d,_0x4934f0){var _0x573e8f={};var _0x410528={};var _0x2b2235;var _0xa30f38;return db['FaxQueue'][_0xb4e2('0x61')]({'where':{'id':_0x3d0807['params']['id']}})[_0xb4e2('0x29')](handleEntityNotFound(_0x1d601d,null))[_0xb4e2('0x29')](function(_0x4539c3){if(_0x4539c3){_0x2b2235=_0x4539c3;_0x410528[_0xb4e2('0x31')]=_[_0xb4e2('0x32')](db[_0xb4e2('0x66')][_0xb4e2('0x63')]);_0x410528['query']=_['keys'](_0x3d0807[_0xb4e2('0x33')]);_0x410528[_0xb4e2('0x34')]=_[_0xb4e2('0x35')](_0x410528[_0xb4e2('0x31')],_0x410528[_0xb4e2('0x33')]);_0x573e8f['attributes']=_[_0xb4e2('0x35')](_0x410528[_0xb4e2('0x31')],qs[_0xb4e2('0x37')](_0x3d0807[_0xb4e2('0x33')]['fields']));_0x573e8f[_0xb4e2('0x36')]=_0x573e8f[_0xb4e2('0x36')][_0xb4e2('0x38')]?_0x573e8f[_0xb4e2('0x36')]:_0x410528[_0xb4e2('0x31')];_0x573e8f[_0xb4e2('0x53')]=qs['sort'](_0x3d0807['query'][_0xb4e2('0x3b')]);_0x573e8f[_0xb4e2('0x3e')]=qs[_0xb4e2('0x34')](_[_0xb4e2('0x3c')](_0x3d0807[_0xb4e2('0x33')],_0x410528['filters']));if(_0x3d0807[_0xb4e2('0x33')][_0xb4e2('0x3d')]){_0x573e8f[_0xb4e2('0x3e')]=_[_0xb4e2('0x3f')](_0x573e8f[_0xb4e2('0x3e')],{'$or':_[_0xb4e2('0x55')](_0x573e8f['attributes'],function(_0x36e3af){var _0x10c23f={};_0x10c23f[_0x36e3af]={'$like':'%'+_0x3d0807[_0xb4e2('0x33')][_0xb4e2('0x3d')]+'%'};return _0x10c23f;})});}_0x573e8f=_[_0xb4e2('0x3f')]({},_0x573e8f,_0x3d0807[_0xb4e2('0x56')]);return _0x2b2235[_0xb4e2('0x71')](_0x573e8f);}})[_0xb4e2('0x29')](function(_0xc326c8){if(_0xc326c8){_0xa30f38=_0xc326c8[_0xb4e2('0x38')];if(!_0x3d0807['query'][_0xb4e2('0x52')](_0xb4e2('0x39'))){_0x573e8f[_0xb4e2('0x3a')]=qs[_0xb4e2('0x3a')](_0x3d0807[_0xb4e2('0x33')][_0xb4e2('0x3a')]);_0x573e8f[_0xb4e2('0x21')]=qs[_0xb4e2('0x21')](_0x3d0807[_0xb4e2('0x33')][_0xb4e2('0x21')]);}return _0x2b2235[_0xb4e2('0x71')](_0x573e8f);}})['then'](function(_0x40b217){if(_0x40b217){return _0x40b217?{'count':_0xa30f38,'rows':_0x40b217}:null;}})[_0xb4e2('0x29')](respondWithResult(_0x1d601d,null))[_0xb4e2('0x45')](handleError(_0x1d601d,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 4841503..52eaf30 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 _0x8d0e=['exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x250f36,_0xeba7f6){var _0x65b6de=function(_0x5c7f8f){while(--_0x5c7f8f){_0x250f36['push'](_0x250f36['shift']());}};_0x65b6de(++_0xeba7f6);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x91cddb,_0x1b4458){_0x91cddb=_0x91cddb-0x0;var _0x3dd213=_0x8d0e[_0x91cddb];return _0x3dd213;};'use strict';var EventEmitter=require(_0xe8d0('0x0'));var FaxQueue=require(_0xe8d0('0x1'))['db'][_0xe8d0('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe8d0('0x3')](0x0);var events={'afterCreate':_0xe8d0('0x4'),'afterUpdate':_0xe8d0('0x5'),'afterDestroy':_0xe8d0('0x6')};function emitEvent(_0x940176){return function(_0x32cee9,_0x579cb9,_0x39caa6){FaxQueueEvents['emit'](_0x940176+':'+_0x32cee9['id'],_0x32cee9);FaxQueueEvents['emit'](_0x940176,_0x32cee9);_0x39caa6(null);};}for(var e in events){if(events[_0xe8d0('0x7')](e)){var event=events[e];FaxQueue[_0xe8d0('0x8')](e,emitEvent(event));}}module[_0xe8d0('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x5c12=['../../mysqldb','FaxQueue','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x47ad8d,_0x5d8a17){var _0x1364b2=function(_0x44f113){while(--_0x44f113){_0x47ad8d['push'](_0x47ad8d['shift']());}};_0x1364b2(++_0x5d8a17);}(_0x5c12,0x188));var _0x25c1=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x5c12[_0x2642cb];return _0xe6e41;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x25c1('0x0'))['db'][_0x25c1('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x25c1('0x2'),'afterUpdate':_0x25c1('0x3'),'afterDestroy':_0x25c1('0x4')};function emitEvent(_0x10f10c){return function(_0x2c5df0,_0x21ec20,_0x3f0f35){FaxQueueEvents['emit'](_0x10f10c+':'+_0x2c5df0['id'],_0x2c5df0);FaxQueueEvents[_0x25c1('0x5')](_0x10f10c,_0x2c5df0);_0x3f0f35(null);};}for(var e in events){if(events[_0x25c1('0x6')](e)){var event=events[e];FaxQueue[_0x25c1('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 116a345..7a2cfbc 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 _0xabd4=['define','FaxQueue','fax_queues','util','../../config/logger','api','moment','request-promise','./faxQueue.attributes','exports'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xabd4,0x71));var _0x4abd=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xabd4[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require(_0x4abd('0x0'));var logger=require(_0x4abd('0x1'))(_0x4abd('0x2'));var moment=require(_0x4abd('0x3'));var BPromise=require('bluebird');var rp=require(_0x4abd('0x4'));var attributes=require(_0x4abd('0x5'));module[_0x4abd('0x6')]=function(_0xff4255,_0x458d63){return _0xff4255[_0x4abd('0x7')](_0x4abd('0x8'),attributes,{'tableName':_0x4abd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf237=['bluebird','request-promise','./faxQueue.attributes','exports','FaxQueue','fax_queues','util','../../config/logger','api','moment'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0xf237,0x150));var _0x7f23=function(_0x271d7c,_0x214c70){_0x271d7c=_0x271d7c-0x0;var _0x3baa23=_0xf237[_0x271d7c];return _0x3baa23;};'use strict';var _=require('lodash');var util=require(_0x7f23('0x0'));var logger=require(_0x7f23('0x1'))(_0x7f23('0x2'));var moment=require(_0x7f23('0x3'));var BPromise=require(_0x7f23('0x4'));var rp=require(_0x7f23('0x5'));var attributes=require(_0x7f23('0x6'));module[_0x7f23('0x7')]=function(_0x1b5ae2,_0xefc368){return _0x1b5ae2['define'](_0x7f23('0x8'),attributes,{'tableName':_0x7f23('0x9'),'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 3cbe693..af9e049 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 _0x1709=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','request','then','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','map','model','include','find','ShowFaxQueue'];(function(_0x5ef6bd,_0x4d5bbe){var _0x382242=function(_0x10aba4){while(--_0x10aba4){_0x5ef6bd['push'](_0x5ef6bd['shift']());}};_0x382242(++_0x4d5bbe);}(_0x1709,0xa0));var _0x9170=function(_0x591e93,_0x2cdfb6){_0x591e93=_0x591e93-0x0;var _0x369ab0=_0x1709[_0x591e93];return _0x369ab0;};'use strict';var _=require(_0x9170('0x0'));var util=require(_0x9170('0x1'));var moment=require('moment');var BPromise=require(_0x9170('0x2'));var rs=require(_0x9170('0x3'));var fs=require('fs');var Redis=require(_0x9170('0x4'));var db=require(_0x9170('0x5'))['db'];var utils=require(_0x9170('0x6'));var logger=require('../../config/logger')(_0x9170('0x7'));var config=require('../../config/environment');var jayson=require(_0x9170('0x8'));var client=jayson[_0x9170('0x9')][_0x9170('0xa')]({'port':0x232a});config[_0x9170('0xb')]=_[_0x9170('0xc')](config[_0x9170('0xb')],{'host':_0x9170('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9170('0xb')]));require(_0x9170('0xe'))['register'](socket);function respondWithRpcPromise(_0x3fddf7,_0x48c024,_0x18f005){return new BPromise(function(_0x293e8c,_0x316016){return client[_0x9170('0xf')](_0x3fddf7,_0x18f005)[_0x9170('0x10')](function(_0x2c7946){logger['info'](_0x9170('0x11'),_0x48c024,'request\x20sent');logger[_0x9170('0x12')](_0x9170('0x13'),_0x48c024,_0x9170('0x14'),JSON[_0x9170('0x15')](_0x2c7946));if(_0x2c7946[_0x9170('0x16')]){if(_0x2c7946['error'][_0x9170('0x17')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x48c024,_0x2c7946[_0x9170('0x16')][_0x9170('0x18')]);return _0x316016(_0x2c7946[_0x9170('0x16')][_0x9170('0x18')]);}logger['error'](_0x9170('0x11'),_0x48c024,_0x2c7946[_0x9170('0x16')][_0x9170('0x18')]);return _0x293e8c(_0x2c7946[_0x9170('0x16')][_0x9170('0x18')]);}else{logger[_0x9170('0x19')](_0x9170('0x11'),_0x48c024,_0x9170('0x14'));_0x293e8c(_0x2c7946[_0x9170('0x1a')]['message']);}})[_0x9170('0x1b')](function(_0x43ab48){logger[_0x9170('0x16')](_0x9170('0x11'),_0x48c024,_0x43ab48);_0x316016(_0x43ab48);});});}exports[_0x9170('0x1c')]=function(_0x18b63a){var _0x3ac3db=this;return new Promise(function(_0x21bb61,_0x4de161){return db[_0x9170('0x1d')][_0x9170('0x1e')]({'raw':_0x18b63a[_0x9170('0x1f')]?_0x18b63a[_0x9170('0x1f')][_0x9170('0x20')]===undefined?!![]:![]:!![],'where':_0x18b63a[_0x9170('0x1f')]?_0x18b63a[_0x9170('0x1f')][_0x9170('0x21')]||null:null,'attributes':_0x18b63a[_0x9170('0x1f')]?_0x18b63a['options'][_0x9170('0x22')]||null:null,'limit':_0x18b63a[_0x9170('0x1f')]?_0x18b63a[_0x9170('0x1f')]['limit']||null:null,'include':_0x18b63a[_0x9170('0x1f')]?_0x18b63a[_0x9170('0x1f')]['include']?_[_0x9170('0x23')](_0x18b63a[_0x9170('0x1f')]['include'],function(_0x28e65c){return{'model':db[_0x28e65c[_0x9170('0x24')]],'as':_0x28e65c['as'],'attributes':_0x28e65c['attributes'],'include':_0x28e65c[_0x9170('0x25')]?_[_0x9170('0x23')](_0x28e65c[_0x9170('0x25')],function(_0x1d79a9){return{'model':db[_0x1d79a9[_0x9170('0x24')]],'as':_0x1d79a9['as'],'attributes':_0x1d79a9['attributes'],'include':_0x1d79a9[_0x9170('0x25')]?_[_0x9170('0x23')](_0x1d79a9[_0x9170('0x25')],function(_0x527eba){return{'model':db[_0x527eba[_0x9170('0x24')]],'as':_0x527eba['as'],'attributes':_0x527eba[_0x9170('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9170('0x10')](function(_0x1ae4ca){logger[_0x9170('0x19')](_0x9170('0x1c'),_0x18b63a);logger[_0x9170('0x12')]('GetFaxQueue',_0x18b63a,JSON[_0x9170('0x15')](_0x1ae4ca));_0x21bb61(_0x1ae4ca);})['catch'](function(_0x18afea){logger[_0x9170('0x16')](_0x9170('0x1c'),_0x18afea[_0x9170('0x18')],_0x18b63a);_0x4de161(_0x3ac3db['error'](0x1f4,_0x18afea[_0x9170('0x18')]));});});};exports['ShowFaxQueue']=function(_0x418925){var _0x3cc31c=this;return new Promise(function(_0x70d8b6,_0x458520){return db[_0x9170('0x1d')][_0x9170('0x26')]({'raw':_0x418925[_0x9170('0x1f')]?_0x418925[_0x9170('0x1f')][_0x9170('0x20')]===undefined?!![]:![]:!![],'where':_0x418925[_0x9170('0x1f')]?_0x418925[_0x9170('0x1f')][_0x9170('0x21')]||null:null,'attributes':_0x418925['options']?_0x418925[_0x9170('0x1f')][_0x9170('0x22')]||null:null,'include':_0x418925[_0x9170('0x1f')]?_0x418925['options'][_0x9170('0x25')]?_[_0x9170('0x23')](_0x418925[_0x9170('0x1f')][_0x9170('0x25')],function(_0x5c7fd6){return{'model':db[_0x5c7fd6[_0x9170('0x24')]],'as':_0x5c7fd6['as'],'attributes':_0x5c7fd6[_0x9170('0x22')],'include':_0x5c7fd6[_0x9170('0x25')]?_[_0x9170('0x23')](_0x5c7fd6[_0x9170('0x25')],function(_0x1cafe9){return{'model':db[_0x1cafe9[_0x9170('0x24')]],'as':_0x1cafe9['as'],'attributes':_0x1cafe9[_0x9170('0x22')],'include':_0x1cafe9[_0x9170('0x25')]?_[_0x9170('0x23')](_0x1cafe9[_0x9170('0x25')],function(_0x4d4395){return{'model':db[_0x4d4395['model']],'as':_0x4d4395['as'],'attributes':_0x4d4395[_0x9170('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9170('0x10')](function(_0x9be89d){logger[_0x9170('0x19')](_0x9170('0x27'),_0x418925);logger[_0x9170('0x12')](_0x9170('0x27'),_0x418925,JSON['stringify'](_0x9be89d));_0x70d8b6(_0x9be89d);})[_0x9170('0x1b')](function(_0x552647){logger[_0x9170('0x16')](_0x9170('0x27'),_0x552647['message'],_0x418925);_0x458520(_0x3cc31c['error'](0x1f4,_0x552647[_0x9170('0x18')]));});});}; \ No newline at end of file +var _0xfb7d=['FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowFaxQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','then','info'];(function(_0x2ea681,_0x56075b){var _0x32c20d=function(_0x55748d){while(--_0x55748d){_0x2ea681['push'](_0x2ea681['shift']());}};_0x32c20d(++_0x56075b);}(_0xfb7d,0x69));var _0xdfb7=function(_0x201720,_0x1c5b25){_0x201720=_0x201720-0x0;var _0x351080=_0xfb7d[_0x201720];return _0x351080;};'use strict';var _=require('lodash');var util=require(_0xdfb7('0x0'));var moment=require(_0xdfb7('0x1'));var BPromise=require(_0xdfb7('0x2'));var rs=require(_0xdfb7('0x3'));var fs=require('fs');var Redis=require(_0xdfb7('0x4'));var db=require(_0xdfb7('0x5'))['db'];var utils=require(_0xdfb7('0x6'));var logger=require(_0xdfb7('0x7'))(_0xdfb7('0x8'));var config=require(_0xdfb7('0x9'));var jayson=require(_0xdfb7('0xa'));var client=jayson['client'][_0xdfb7('0xb')]({'port':0x232a});config[_0xdfb7('0xc')]=_[_0xdfb7('0xd')](config[_0xdfb7('0xc')],{'host':_0xdfb7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdfb7('0xc')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x42fa21,_0x132d84,_0x325a76){return new BPromise(function(_0x508705,_0x3b6865){return client[_0xdfb7('0xf')](_0x42fa21,_0x325a76)[_0xdfb7('0x10')](function(_0x419581){logger[_0xdfb7('0x11')](_0xdfb7('0x12'),_0x132d84,_0xdfb7('0x13'));logger[_0xdfb7('0x14')](_0xdfb7('0x15'),_0x132d84,_0xdfb7('0x13'),JSON['stringify'](_0x419581));if(_0x419581[_0xdfb7('0x16')]){if(_0x419581[_0xdfb7('0x16')][_0xdfb7('0x17')]===0x1f4){logger[_0xdfb7('0x16')](_0xdfb7('0x12'),_0x132d84,_0x419581[_0xdfb7('0x16')][_0xdfb7('0x18')]);return _0x3b6865(_0x419581[_0xdfb7('0x16')][_0xdfb7('0x18')]);}logger[_0xdfb7('0x16')](_0xdfb7('0x12'),_0x132d84,_0x419581[_0xdfb7('0x16')][_0xdfb7('0x18')]);return _0x508705(_0x419581['error'][_0xdfb7('0x18')]);}else{logger[_0xdfb7('0x11')]('FaxQueue,\x20%s,\x20%s',_0x132d84,_0xdfb7('0x13'));_0x508705(_0x419581[_0xdfb7('0x19')][_0xdfb7('0x18')]);}})['catch'](function(_0x347e48){logger[_0xdfb7('0x16')]('FaxQueue,\x20%s,\x20%s',_0x132d84,_0x347e48);_0x3b6865(_0x347e48);});});}exports[_0xdfb7('0x1a')]=function(_0x4fb920){var _0x3ece9e=this;return new Promise(function(_0x13ca6b,_0x5cda25){return db[_0xdfb7('0x1b')][_0xdfb7('0x1c')]({'raw':_0x4fb920[_0xdfb7('0x1d')]?_0x4fb920[_0xdfb7('0x1d')][_0xdfb7('0x1e')]===undefined?!![]:![]:!![],'where':_0x4fb920['options']?_0x4fb920[_0xdfb7('0x1d')][_0xdfb7('0x1f')]||null:null,'attributes':_0x4fb920['options']?_0x4fb920[_0xdfb7('0x1d')][_0xdfb7('0x20')]||null:null,'limit':_0x4fb920['options']?_0x4fb920[_0xdfb7('0x1d')][_0xdfb7('0x21')]||null:null,'include':_0x4fb920[_0xdfb7('0x1d')]?_0x4fb920[_0xdfb7('0x1d')][_0xdfb7('0x22')]?_[_0xdfb7('0x23')](_0x4fb920['options'][_0xdfb7('0x22')],function(_0x471797){return{'model':db[_0x471797[_0xdfb7('0x24')]],'as':_0x471797['as'],'attributes':_0x471797[_0xdfb7('0x20')],'include':_0x471797['include']?_[_0xdfb7('0x23')](_0x471797[_0xdfb7('0x22')],function(_0x32d72d){return{'model':db[_0x32d72d[_0xdfb7('0x24')]],'as':_0x32d72d['as'],'attributes':_0x32d72d[_0xdfb7('0x20')],'include':_0x32d72d[_0xdfb7('0x22')]?_[_0xdfb7('0x23')](_0x32d72d[_0xdfb7('0x22')],function(_0x125896){return{'model':db[_0x125896[_0xdfb7('0x24')]],'as':_0x125896['as'],'attributes':_0x125896[_0xdfb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdfb7('0x10')](function(_0x358185){logger[_0xdfb7('0x11')]('GetFaxQueue',_0x4fb920);logger[_0xdfb7('0x14')](_0xdfb7('0x1a'),_0x4fb920,JSON[_0xdfb7('0x25')](_0x358185));_0x13ca6b(_0x358185);})[_0xdfb7('0x26')](function(_0x1fd5c3){logger[_0xdfb7('0x16')](_0xdfb7('0x1a'),_0x1fd5c3[_0xdfb7('0x18')],_0x4fb920);_0x5cda25(_0x3ece9e[_0xdfb7('0x16')](0x1f4,_0x1fd5c3['message']));});});};exports[_0xdfb7('0x27')]=function(_0x1803b9){var _0x4466a7=this;return new Promise(function(_0x3ead9e,_0x1edd74){return db[_0xdfb7('0x1b')][_0xdfb7('0x28')]({'raw':_0x1803b9[_0xdfb7('0x1d')]?_0x1803b9[_0xdfb7('0x1d')][_0xdfb7('0x1e')]===undefined?!![]:![]:!![],'where':_0x1803b9[_0xdfb7('0x1d')]?_0x1803b9[_0xdfb7('0x1d')][_0xdfb7('0x1f')]||null:null,'attributes':_0x1803b9[_0xdfb7('0x1d')]?_0x1803b9[_0xdfb7('0x1d')][_0xdfb7('0x20')]||null:null,'include':_0x1803b9[_0xdfb7('0x1d')]?_0x1803b9[_0xdfb7('0x1d')]['include']?_[_0xdfb7('0x23')](_0x1803b9['options'][_0xdfb7('0x22')],function(_0x3a5f8e){return{'model':db[_0x3a5f8e[_0xdfb7('0x24')]],'as':_0x3a5f8e['as'],'attributes':_0x3a5f8e['attributes'],'include':_0x3a5f8e['include']?_['map'](_0x3a5f8e[_0xdfb7('0x22')],function(_0x135159){return{'model':db[_0x135159[_0xdfb7('0x24')]],'as':_0x135159['as'],'attributes':_0x135159[_0xdfb7('0x20')],'include':_0x135159[_0xdfb7('0x22')]?_[_0xdfb7('0x23')](_0x135159['include'],function(_0xc28d4d){return{'model':db[_0xc28d4d[_0xdfb7('0x24')]],'as':_0xc28d4d['as'],'attributes':_0xc28d4d[_0xdfb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdfb7('0x10')](function(_0x39106d){logger[_0xdfb7('0x11')](_0xdfb7('0x27'),_0x1803b9);logger[_0xdfb7('0x14')](_0xdfb7('0x27'),_0x1803b9,JSON[_0xdfb7('0x25')](_0x39106d));_0x3ead9e(_0x39106d);})[_0xdfb7('0x26')](function(_0x11bbc5){logger[_0xdfb7('0x16')]('ShowFaxQueue',_0x11bbc5[_0xdfb7('0x18')],_0x1803b9);_0x1edd74(_0x4466a7[_0xdfb7('0x16')](0x1f4,_0x11bbc5['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 08246d1..032e6a5 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 _0x8d67=['save','remove','register','faxQueue:'];(function(_0x5d4818,_0x3ccae2){var _0x578a9c=function(_0x530284){while(--_0x530284){_0x5d4818['push'](_0x5d4818['shift']());}};_0x578a9c(++_0x3ccae2);}(_0x8d67,0x94));var _0x78d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8d67[_0x321bb2];return _0x9c12ed;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x78d6('0x0'),_0x78d6('0x1'),'update'];function createListener(_0x26f686,_0xe5736b){return function(_0x3e56ae){_0xe5736b['emit'](_0x26f686,_0x3e56ae);};}function removeListener(_0x415d2e,_0xebd316){return function(){FaxQueueEvents['removeListener'](_0x415d2e,_0xebd316);};}exports[_0x78d6('0x2')]=function(_0x20afb9){for(var _0x2de4e6=0x0,_0x4b06cc=events['length'];_0x2de4e6<_0x4b06cc;_0x2de4e6++){var _0x27cfac=events[_0x2de4e6];var _0x3b7d1f=createListener(_0x78d6('0x3')+_0x27cfac,_0x20afb9);FaxQueueEvents['on'](_0x27cfac,_0x3b7d1f);}}; \ No newline at end of file +var _0xfb97=['removeListener','register','length','faxQueue:','save','update','emit'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xfb97,0xba));var _0x7fb9=function(_0x9a7d5b,_0x50327f){_0x9a7d5b=_0x9a7d5b-0x0;var _0xe2a5b3=_0xfb97[_0x9a7d5b];return _0xe2a5b3;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x7fb9('0x0'),'remove',_0x7fb9('0x1')];function createListener(_0x4c5b8c,_0x2a0ac4){return function(_0x5998e5){_0x2a0ac4[_0x7fb9('0x2')](_0x4c5b8c,_0x5998e5);};}function removeListener(_0x4d0a44,_0x15f494){return function(){FaxQueueEvents[_0x7fb9('0x3')](_0x4d0a44,_0x15f494);};}exports[_0x7fb9('0x4')]=function(_0x3249ad){for(var _0x22c390=0x0,_0x13bfb0=events[_0x7fb9('0x5')];_0x22c390<_0x13bfb0;_0x22c390++){var _0x8f43b5=events[_0x22c390];var _0x2da9ef=createListener(_0x7fb9('0x6')+_0x8f43b5,_0x3249ad);FaxQueueEvents['on'](_0x8f43b5,_0x2da9ef);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index fc1f62f..0aedafc 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 _0xb0f9=['removeAgents','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','update','delete','destroy','removeTeams'];(function(_0x2ad5c2,_0x5564ba){var _0x5c6a9b=function(_0x403ba3){while(--_0x403ba3){_0x2ad5c2['push'](_0x2ad5c2['shift']());}};_0x5c6a9b(++_0x5564ba);}(_0xb0f9,0x147));var _0x9b0f=function(_0x435ea9,_0x25738b){_0x435ea9=_0x435ea9-0x0;var _0x1056be=_0xb0f9[_0x435ea9];return _0x1056be;};'use strict';var multer=require(_0x9b0f('0x0'));var util=require('util');var path=require(_0x9b0f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x9b0f('0x2'));var interaction=require(_0x9b0f('0x3'));var config=require(_0x9b0f('0x4'));var controller=require(_0x9b0f('0x5'));router[_0x9b0f('0x6')]('/',auth[_0x9b0f('0x7')](),controller[_0x9b0f('0x8')]);router['get']('/describe',auth[_0x9b0f('0x7')](),controller[_0x9b0f('0x9')]);router[_0x9b0f('0x6')](_0x9b0f('0xa'),auth[_0x9b0f('0x7')](),controller['show']);router[_0x9b0f('0x6')]('/:id/members',auth[_0x9b0f('0x7')](),controller[_0x9b0f('0xb')]);router[_0x9b0f('0x6')](_0x9b0f('0xc'),auth['isAuthenticated'](),controller[_0x9b0f('0xd')]);router[_0x9b0f('0x6')](_0x9b0f('0xe'),auth[_0x9b0f('0x7')](),controller[_0x9b0f('0xf')]);router[_0x9b0f('0x10')]('/',auth[_0x9b0f('0x7')](),controller[_0x9b0f('0x11')]);router[_0x9b0f('0x10')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x9b0f('0x10')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x9b0f('0x12')]('/:id',auth[_0x9b0f('0x7')](),controller[_0x9b0f('0x13')]);router[_0x9b0f('0x14')]('/:id',auth[_0x9b0f('0x7')](),controller[_0x9b0f('0x15')]);router[_0x9b0f('0x14')](_0x9b0f('0xc'),auth[_0x9b0f('0x7')](),controller[_0x9b0f('0x16')]);router[_0x9b0f('0x14')](_0x9b0f('0xe'),auth[_0x9b0f('0x7')](),controller[_0x9b0f('0x17')]);module[_0x9b0f('0x18')]=router; \ No newline at end of file +var _0x00e6=['./faxQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getTeams','getAgents','post','create','/:id/teams','addTeams','/:id/users','addAgents','delete','destroy','removeTeams','removeAgents','exports','util','path','Router','../../components/auth/service','../../config/environment'];(function(_0x1dcc28,_0x114e9e){var _0x13acdc=function(_0x3fd8a2){while(--_0x3fd8a2){_0x1dcc28['push'](_0x1dcc28['shift']());}};_0x13acdc(++_0x114e9e);}(_0x00e6,0x1ab));var _0x600e=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x00e6[_0x5311e8];return _0x582ad8;};'use strict';var multer=require('multer');var util=require(_0x600e('0x0'));var path=require(_0x600e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x600e('0x2')]();var auth=require(_0x600e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x600e('0x4'));var controller=require(_0x600e('0x5'));router['get']('/',auth[_0x600e('0x6')](),controller[_0x600e('0x7')]);router[_0x600e('0x8')](_0x600e('0x9'),auth[_0x600e('0x6')](),controller[_0x600e('0xa')]);router[_0x600e('0x8')](_0x600e('0xb'),auth['isAuthenticated'](),controller[_0x600e('0xc')]);router[_0x600e('0x8')](_0x600e('0xd'),auth[_0x600e('0x6')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x600e('0x6')](),controller[_0x600e('0xe')]);router[_0x600e('0x8')]('/:id/users',auth[_0x600e('0x6')](),controller[_0x600e('0xf')]);router[_0x600e('0x10')]('/',auth[_0x600e('0x6')](),controller[_0x600e('0x11')]);router['post'](_0x600e('0x12'),auth[_0x600e('0x6')](),controller[_0x600e('0x13')]);router[_0x600e('0x10')](_0x600e('0x14'),auth['isAuthenticated'](),controller[_0x600e('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x600e('0x16')]('/:id',auth[_0x600e('0x6')](),controller[_0x600e('0x17')]);router['delete'](_0x600e('0x12'),auth[_0x600e('0x6')](),controller[_0x600e('0x18')]);router[_0x600e('0x16')](_0x600e('0x14'),auth[_0x600e('0x6')](),controller[_0x600e('0x19')]);module[_0x600e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 062ec12..c64695a 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 _0x68e8=['exports','STRING','DATE','moment','sequelize'];(function(_0x36bfe3,_0x358938){var _0x9b0436=function(_0x86e47d){while(--_0x86e47d){_0x36bfe3['push'](_0x36bfe3['shift']());}};_0x9b0436(++_0x358938);}(_0x68e8,0x17a));var _0x868e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x68e8[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x868e('0x0'));var Sequelize=require(_0x868e('0x1'));module[_0x868e('0x2')]={'uniqueid':{'type':Sequelize[_0x868e('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x868e('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x868e('0x4')]},'exitAt':{'type':Sequelize[_0x868e('0x4')]},'reason':{'type':Sequelize[_0x868e('0x3')]}}; \ No newline at end of file +var _0x31e3=['sequelize','STRING','DATE','moment'];(function(_0x19fbaa,_0x1cd68f){var _0x5729af=function(_0x567f73){while(--_0x567f73){_0x19fbaa['push'](_0x19fbaa['shift']());}};_0x5729af(++_0x1cd68f);}(_0x31e3,0x1e7));var _0x331e=function(_0x4c9dd6,_0x197161){_0x4c9dd6=_0x4c9dd6-0x0;var _0x464a99=_0x31e3[_0x4c9dd6];return _0x464a99;};'use strict';var moment=require(_0x331e('0x0'));var Sequelize=require(_0x331e('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x331e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x331e('0x2')]},'joinAt':{'type':Sequelize[_0x331e('0x3')]},'leaveAt':{'type':Sequelize[_0x331e('0x3')]},'acceptAt':{'type':Sequelize[_0x331e('0x3')]},'exitAt':{'type':Sequelize[_0x331e('0x3')]},'reason':{'type':Sequelize[_0x331e('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 1ed44eb..6e7c33b 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 _0xaeaa=['jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','index','FaxQueueReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','update','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto'];(function(_0x4e93de,_0x571c93){var _0x121cf4=function(_0x1723c5){while(--_0x1723c5){_0x4e93de['push'](_0x4e93de['shift']());}};_0x121cf4(++_0x571c93);}(_0xaeaa,0x81));var _0xaaea=function(_0x51bf6d,_0x4429b1){_0x51bf6d=_0x51bf6d-0x0;var _0x5f526a=_0xaeaa[_0x51bf6d];return _0x5f526a;};'use strict';var pdf=require(_0xaaea('0x0'));var emlformat=require(_0xaaea('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaaea('0x2'));var jsonpatch=require(_0xaaea('0x3'));var rp=require(_0xaaea('0x4'));var moment=require(_0xaaea('0x5'));var BPromise=require(_0xaaea('0x6'));var Mustache=require(_0xaaea('0x7'));var util=require(_0xaaea('0x8'));var path=require(_0xaaea('0x9'));var sox=require('sox');var csv=require(_0xaaea('0xa'));var ejs=require(_0xaaea('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaaea('0xc'));var jsforce=require(_0xaaea('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaaea('0xa'));var querystring=require(_0xaaea('0xe'));var Papa=require(_0xaaea('0xf'));var authService=require(_0xaaea('0x10'));var hardwareService=require(_0xaaea('0x11'));var Redis=require(_0xaaea('0x12'));var qs=require(_0xaaea('0x13'));var logger=require(_0xaaea('0x14'))(_0xaaea('0x15'));var utils=require(_0xaaea('0x16'));var config=require(_0xaaea('0x17'));var db=require(_0xaaea('0x18'))['db'];function respondWithStatusCode(_0x258d41,_0x59dfe7){_0x59dfe7=_0x59dfe7||0xcc;return function(_0x2bdd04){if(_0x2bdd04){return _0x258d41[_0xaaea('0x19')](_0x59dfe7);}return _0x258d41[_0xaaea('0x1a')](_0x59dfe7)[_0xaaea('0x1b')]();};}function respondWithResult(_0x236bc7,_0x30c5d4){_0x30c5d4=_0x30c5d4||0xc8;return function(_0xdbd1b6){if(_0xdbd1b6){return _0x236bc7[_0xaaea('0x1a')](_0x30c5d4)[_0xaaea('0x1c')](_0xdbd1b6);}};}function respondWithFilteredResult(_0x5c5d49,_0x29d777){return function(_0x2a52c5){if(_0x2a52c5){var _0x56edc8=_0x2a52c5[_0xaaea('0x1d')],_0x3afe47=_0x29d777['offset'],_0x343d2c=_0x29d777[_0xaaea('0x1e')]+_0x29d777[_0xaaea('0x1f')],_0x5a2303;if(_0x343d2c>=_0x56edc8){_0x343d2c=_0x56edc8;_0x5a2303=0xc8;}else{_0x5a2303=0xce;}_0x5c5d49[_0xaaea('0x1a')](_0x5a2303);return _0x5c5d49[_0xaaea('0x20')](_0xaaea('0x21'),_0x3afe47+'-'+_0x343d2c+'/'+_0x56edc8)[_0xaaea('0x1c')](_0x2a52c5);}return null;};}function patchUpdates(_0x4b7c66){return function(_0x2c404a){try{jsonpatch[_0xaaea('0x22')](_0x2c404a,_0x4b7c66,!![]);}catch(_0x27552e){return BPromise[_0xaaea('0x23')](_0x27552e);}return _0x2c404a[_0xaaea('0x24')]();};}function saveUpdates(_0x4a981d,_0x3cd93e){return function(_0x3b138c){if(_0x3b138c){return _0x3b138c['update'](_0x4a981d)[_0xaaea('0x25')](function(_0x1def3c){return _0x1def3c;});}return null;};}function removeEntity(_0x21d0f6,_0x5825f2){return function(_0x4e63d1){if(_0x4e63d1){return _0x4e63d1[_0xaaea('0x26')]()[_0xaaea('0x25')](function(){_0x21d0f6[_0xaaea('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x210e6b,_0x53b151){return function(_0x2f0b6f){if(!_0x2f0b6f){_0x210e6b[_0xaaea('0x19')](0x194);}return _0x2f0b6f;};}function handleError(_0x335ead,_0x4258d2){_0x4258d2=_0x4258d2||0x1f4;return function(_0x536c88){logger[_0xaaea('0x27')](_0x536c88['stack']);if(_0x536c88[_0xaaea('0x28')]){delete _0x536c88[_0xaaea('0x28')];}_0x335ead['status'](_0x4258d2)['send'](_0x536c88);};}exports[_0xaaea('0x29')]=function(_0x2d683e,_0x55f465){var _0x5e35ed={},_0x3e4a35={},_0x25bd19={'count':0x0,'rows':[]};var _0xb3d286=db[_0xaaea('0x2a')][_0xaaea('0x2b')];_0x3e4a35['model']=_[_0xaaea('0x2c')](_0xb3d286);_0x3e4a35[_0xaaea('0x2d')]=_[_0xaaea('0x2c')](_0x2d683e['query']);_0x3e4a35[_0xaaea('0x2e')]=_[_0xaaea('0x2f')](_0x3e4a35[_0xaaea('0x30')],_0x3e4a35[_0xaaea('0x2d')]);_0x5e35ed[_0xaaea('0x31')]=_[_0xaaea('0x2f')](_0x3e4a35[_0xaaea('0x30')],qs[_0xaaea('0x32')](_0x2d683e[_0xaaea('0x2d')][_0xaaea('0x32')]));_0x5e35ed['attributes']=_0x5e35ed[_0xaaea('0x31')][_0xaaea('0x33')]?_0x5e35ed[_0xaaea('0x31')]:_0x3e4a35['model'];if(!_0x2d683e[_0xaaea('0x2d')][_0xaaea('0x34')](_0xaaea('0x35'))){_0x5e35ed['limit']=qs[_0xaaea('0x1f')](_0x2d683e[_0xaaea('0x2d')][_0xaaea('0x1f')]);_0x5e35ed[_0xaaea('0x1e')]=qs['offset'](_0x2d683e[_0xaaea('0x2d')]['offset']);}_0x5e35ed['order']=qs['sort'](_0x2d683e[_0xaaea('0x2d')]['sort']);_0x5e35ed[_0xaaea('0x36')]=qs['filters'](_['pick'](_0x2d683e[_0xaaea('0x2d')],_0x3e4a35['filters']));if(_0x2d683e[_0xaaea('0x2d')][_0xaaea('0x37')]){_0x5e35ed[_0xaaea('0x36')]=_[_0xaaea('0x38')](_0x5e35ed['where'],{'$or':_['map'](_0xb3d286,function(_0x531cf4){if(_0x531cf4[_0xaaea('0x39')]['key']!==_0xaaea('0x3a')){var _0x121ddc={};_0x121ddc[_0x531cf4['field']]={'$like':'%'+_0x2d683e[_0xaaea('0x2d')][_0xaaea('0x37')]+'%'};return _0x121ddc;}})});}_0x5e35ed=_[_0xaaea('0x38')]({},_0x5e35ed,_0x2d683e[_0xaaea('0x3b')]);var _0x3813f2={'where':_0x5e35ed[_0xaaea('0x36')]};return db[_0xaaea('0x2a')][_0xaaea('0x1d')](_0x3813f2)[_0xaaea('0x25')](function(_0x3ebeda){_0x25bd19['count']=_0x3ebeda;if(_0x2d683e['query'][_0xaaea('0x3c')]){_0x5e35ed[_0xaaea('0x3d')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xaaea('0x3e')](_0x5e35ed);})[_0xaaea('0x25')](function(_0x4faf66){_0x25bd19[_0xaaea('0x3f')]=_0x4faf66;return _0x25bd19;})[_0xaaea('0x25')](respondWithFilteredResult(_0x55f465,_0x5e35ed))['catch'](handleError(_0x55f465,null));};exports[_0xaaea('0x40')]=function(_0x37e664,_0x4312d1){var _0x3a979f={'raw':!![],'where':{'id':_0x37e664['params']['id']}},_0x1d9af7={};_0x1d9af7[_0xaaea('0x30')]=_[_0xaaea('0x2c')](db[_0xaaea('0x2a')][_0xaaea('0x2b')]);_0x1d9af7[_0xaaea('0x2d')]=_['keys'](_0x37e664['query']);_0x1d9af7[_0xaaea('0x2e')]=_[_0xaaea('0x2f')](_0x1d9af7[_0xaaea('0x30')],_0x1d9af7['query']);_0x3a979f[_0xaaea('0x31')]=_['intersection'](_0x1d9af7[_0xaaea('0x30')],qs['fields'](_0x37e664['query'][_0xaaea('0x32')]));_0x3a979f['attributes']=_0x3a979f[_0xaaea('0x31')][_0xaaea('0x33')]?_0x3a979f[_0xaaea('0x31')]:_0x1d9af7[_0xaaea('0x30')];if(_0x37e664[_0xaaea('0x2d')]['includeAll']){_0x3a979f[_0xaaea('0x3d')]=[{'all':!![]}];}_0x3a979f=_[_0xaaea('0x38')]({},_0x3a979f,_0x37e664[_0xaaea('0x3b')]);return db['FaxQueueReport'][_0xaaea('0x41')](_0x3a979f)[_0xaaea('0x25')](handleEntityNotFound(_0x4312d1,null))['then'](respondWithResult(_0x4312d1,null))[_0xaaea('0x42')](handleError(_0x4312d1,null));};exports['create']=function(_0x2c0f13,_0x5265e8){return db[_0xaaea('0x2a')]['create'](_0x2c0f13['body'],{})['then'](respondWithResult(_0x5265e8,0xc9))[_0xaaea('0x42')](handleError(_0x5265e8,null));};exports[_0xaaea('0x43')]=function(_0x226e91,_0x4cc376){if(_0x226e91[_0xaaea('0x44')]['id']){delete _0x226e91[_0xaaea('0x44')]['id'];}return db['FaxQueueReport'][_0xaaea('0x41')]({'where':{'id':_0x226e91[_0xaaea('0x45')]['id']}})[_0xaaea('0x25')](handleEntityNotFound(_0x4cc376,null))[_0xaaea('0x25')](saveUpdates(_0x226e91[_0xaaea('0x44')],null))[_0xaaea('0x25')](respondWithResult(_0x4cc376,null))['catch'](handleError(_0x4cc376,null));};exports['destroy']=function(_0x3478a8,_0x7f58e5){return db[_0xaaea('0x2a')][_0xaaea('0x41')]({'where':{'id':_0x3478a8[_0xaaea('0x45')]['id']}})[_0xaaea('0x25')](handleEntityNotFound(_0x7f58e5,null))[_0xaaea('0x25')](removeEntity(_0x7f58e5,null))['catch'](handleError(_0x7f58e5,null));};exports[_0xaaea('0x46')]=function(_0x17b9f8,_0x1462da){return db[_0xaaea('0x2a')]['describe']()['then'](respondWithResult(_0x1462da,null))[_0xaaea('0x42')](handleError(_0x1462da,null));}; \ No newline at end of file +var _0x45c4=['send','index','FaxQueueReport','rawAttributes','keys','query','intersection','model','attributes','fields','limit','where','filters','pick','filter','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','length','create','body','update','find','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','then','destroy','error','name'];(function(_0x1c8d26,_0x417917){var _0xe3d3c9=function(_0x473a87){while(--_0x473a87){_0x1c8d26['push'](_0x1c8d26['shift']());}};_0xe3d3c9(++_0x417917);}(_0x45c4,0x13e));var _0x445c=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x45c4[_0x2dadb9];return _0x2f0097;};'use strict';var pdf=require(_0x445c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x445c('0x1'));var zipdir=require(_0x445c('0x2'));var jsonpatch=require(_0x445c('0x3'));var rp=require(_0x445c('0x4'));var moment=require(_0x445c('0x5'));var BPromise=require(_0x445c('0x6'));var Mustache=require('mustache');var util=require(_0x445c('0x7'));var path=require(_0x445c('0x8'));var sox=require(_0x445c('0x9'));var csv=require('to-csv');var ejs=require(_0x445c('0xa'));var fs=require('fs');var _=require(_0x445c('0xb'));var squel=require('squel');var crypto=require(_0x445c('0xc'));var jsforce=require(_0x445c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x445c('0xe'));var querystring=require(_0x445c('0xf'));var Papa=require(_0x445c('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0x445c('0x11'));var Redis=require('ioredis');var qs=require(_0x445c('0x12'));var logger=require(_0x445c('0x13'))(_0x445c('0x14'));var utils=require(_0x445c('0x15'));var config=require('../../config/environment');var db=require(_0x445c('0x16'))['db'];function respondWithStatusCode(_0x51f7e5,_0x3fc7bc){_0x3fc7bc=_0x3fc7bc||0xcc;return function(_0x3818dd){if(_0x3818dd){return _0x51f7e5[_0x445c('0x17')](_0x3fc7bc);}return _0x51f7e5[_0x445c('0x18')](_0x3fc7bc)[_0x445c('0x19')]();};}function respondWithResult(_0x334eb2,_0x135bdb){_0x135bdb=_0x135bdb||0xc8;return function(_0x4c6098){if(_0x4c6098){return _0x334eb2[_0x445c('0x18')](_0x135bdb)[_0x445c('0x1a')](_0x4c6098);}};}function respondWithFilteredResult(_0x5bfc7c,_0x163e85){return function(_0x272ade){if(_0x272ade){var _0x25435a=_0x272ade[_0x445c('0x1b')],_0x3a5d03=_0x163e85[_0x445c('0x1c')],_0x432b4e=_0x163e85[_0x445c('0x1c')]+_0x163e85['limit'],_0xd8fa75;if(_0x432b4e>=_0x25435a){_0x432b4e=_0x25435a;_0xd8fa75=0xc8;}else{_0xd8fa75=0xce;}_0x5bfc7c[_0x445c('0x18')](_0xd8fa75);return _0x5bfc7c[_0x445c('0x1d')](_0x445c('0x1e'),_0x3a5d03+'-'+_0x432b4e+'/'+_0x25435a)['json'](_0x272ade);}return null;};}function patchUpdates(_0x16715f){return function(_0x271678){try{jsonpatch[_0x445c('0x1f')](_0x271678,_0x16715f,!![]);}catch(_0xc2db76){return BPromise[_0x445c('0x20')](_0xc2db76);}return _0x271678['save']();};}function saveUpdates(_0x49bf21,_0x512ded){return function(_0x1b1102){if(_0x1b1102){return _0x1b1102['update'](_0x49bf21)[_0x445c('0x21')](function(_0x3567de){return _0x3567de;});}return null;};}function removeEntity(_0x3c2aa8,_0xc36e31){return function(_0x3836fe){if(_0x3836fe){return _0x3836fe[_0x445c('0x22')]()['then'](function(){_0x3c2aa8[_0x445c('0x18')](0xcc)[_0x445c('0x19')]();});}};}function handleEntityNotFound(_0x38337f,_0x5ab418){return function(_0x2f85a6){if(!_0x2f85a6){_0x38337f['sendStatus'](0x194);}return _0x2f85a6;};}function handleError(_0xb8fcf7,_0x2fc59d){_0x2fc59d=_0x2fc59d||0x1f4;return function(_0x2622f0){logger[_0x445c('0x23')](_0x2622f0['stack']);if(_0x2622f0[_0x445c('0x24')]){delete _0x2622f0['name'];}_0xb8fcf7[_0x445c('0x18')](_0x2fc59d)[_0x445c('0x25')](_0x2622f0);};}exports[_0x445c('0x26')]=function(_0x1caac1,_0x2f30c0){var _0x9351b7={},_0x6db10a={},_0x10b963={'count':0x0,'rows':[]};var _0x11215c=db[_0x445c('0x27')][_0x445c('0x28')];_0x6db10a['model']=_[_0x445c('0x29')](_0x11215c);_0x6db10a[_0x445c('0x2a')]=_[_0x445c('0x29')](_0x1caac1[_0x445c('0x2a')]);_0x6db10a['filters']=_[_0x445c('0x2b')](_0x6db10a[_0x445c('0x2c')],_0x6db10a['query']);_0x9351b7[_0x445c('0x2d')]=_[_0x445c('0x2b')](_0x6db10a[_0x445c('0x2c')],qs[_0x445c('0x2e')](_0x1caac1[_0x445c('0x2a')]['fields']));_0x9351b7[_0x445c('0x2d')]=_0x9351b7['attributes']['length']?_0x9351b7['attributes']:_0x6db10a['model'];if(!_0x1caac1['query']['hasOwnProperty']('nolimit')){_0x9351b7[_0x445c('0x2f')]=qs[_0x445c('0x2f')](_0x1caac1[_0x445c('0x2a')][_0x445c('0x2f')]);_0x9351b7['offset']=qs['offset'](_0x1caac1[_0x445c('0x2a')][_0x445c('0x1c')]);}_0x9351b7['order']=qs['sort'](_0x1caac1[_0x445c('0x2a')]['sort']);_0x9351b7[_0x445c('0x30')]=qs[_0x445c('0x31')](_[_0x445c('0x32')](_0x1caac1[_0x445c('0x2a')],_0x6db10a[_0x445c('0x31')]));if(_0x1caac1['query'][_0x445c('0x33')]){_0x9351b7['where']=_['merge'](_0x9351b7['where'],{'$or':_[_0x445c('0x34')](_0x11215c,function(_0xad64bf){if(_0xad64bf[_0x445c('0x35')][_0x445c('0x36')]!==_0x445c('0x37')){var _0xed17ec={};_0xed17ec[_0xad64bf[_0x445c('0x38')]]={'$like':'%'+_0x1caac1[_0x445c('0x2a')][_0x445c('0x33')]+'%'};return _0xed17ec;}})});}_0x9351b7=_['merge']({},_0x9351b7,_0x1caac1[_0x445c('0x39')]);var _0x2b4861={'where':_0x9351b7[_0x445c('0x30')]};return db[_0x445c('0x27')][_0x445c('0x1b')](_0x2b4861)[_0x445c('0x21')](function(_0x48f64b){_0x10b963['count']=_0x48f64b;if(_0x1caac1['query'][_0x445c('0x3a')]){_0x9351b7[_0x445c('0x3b')]=[{'all':!![]}];}return db[_0x445c('0x27')][_0x445c('0x3c')](_0x9351b7);})[_0x445c('0x21')](function(_0x37378b){_0x10b963[_0x445c('0x3d')]=_0x37378b;return _0x10b963;})[_0x445c('0x21')](respondWithFilteredResult(_0x2f30c0,_0x9351b7))[_0x445c('0x3e')](handleError(_0x2f30c0,null));};exports[_0x445c('0x3f')]=function(_0x4f0a11,_0x5c4d03){var _0x19f9f4={'raw':!![],'where':{'id':_0x4f0a11['params']['id']}},_0x47e222={};_0x47e222[_0x445c('0x2c')]=_[_0x445c('0x29')](db[_0x445c('0x27')][_0x445c('0x28')]);_0x47e222[_0x445c('0x2a')]=_[_0x445c('0x29')](_0x4f0a11[_0x445c('0x2a')]);_0x47e222[_0x445c('0x31')]=_[_0x445c('0x2b')](_0x47e222[_0x445c('0x2c')],_0x47e222[_0x445c('0x2a')]);_0x19f9f4['attributes']=_[_0x445c('0x2b')](_0x47e222[_0x445c('0x2c')],qs['fields'](_0x4f0a11[_0x445c('0x2a')]['fields']));_0x19f9f4[_0x445c('0x2d')]=_0x19f9f4['attributes'][_0x445c('0x40')]?_0x19f9f4[_0x445c('0x2d')]:_0x47e222[_0x445c('0x2c')];if(_0x4f0a11[_0x445c('0x2a')]['includeAll']){_0x19f9f4[_0x445c('0x3b')]=[{'all':!![]}];}_0x19f9f4=_['merge']({},_0x19f9f4,_0x4f0a11[_0x445c('0x39')]);return db[_0x445c('0x27')]['find'](_0x19f9f4)[_0x445c('0x21')](handleEntityNotFound(_0x5c4d03,null))['then'](respondWithResult(_0x5c4d03,null))[_0x445c('0x3e')](handleError(_0x5c4d03,null));};exports[_0x445c('0x41')]=function(_0xb370cc,_0x1bb2af){return db[_0x445c('0x27')][_0x445c('0x41')](_0xb370cc[_0x445c('0x42')],{})[_0x445c('0x21')](respondWithResult(_0x1bb2af,0xc9))[_0x445c('0x3e')](handleError(_0x1bb2af,null));};exports[_0x445c('0x43')]=function(_0xeb0fd9,_0x39afd5){if(_0xeb0fd9[_0x445c('0x42')]['id']){delete _0xeb0fd9[_0x445c('0x42')]['id'];}return db[_0x445c('0x27')][_0x445c('0x44')]({'where':{'id':_0xeb0fd9[_0x445c('0x45')]['id']}})[_0x445c('0x21')](handleEntityNotFound(_0x39afd5,null))[_0x445c('0x21')](saveUpdates(_0xeb0fd9[_0x445c('0x42')],null))[_0x445c('0x21')](respondWithResult(_0x39afd5,null))['catch'](handleError(_0x39afd5,null));};exports[_0x445c('0x22')]=function(_0x3cfcb2,_0x1e7eed){return db[_0x445c('0x27')][_0x445c('0x44')]({'where':{'id':_0x3cfcb2['params']['id']}})[_0x445c('0x21')](handleEntityNotFound(_0x1e7eed,null))['then'](removeEntity(_0x1e7eed,null))[_0x445c('0x3e')](handleError(_0x1e7eed,null));};exports[_0x445c('0x46')]=function(_0x1ec147,_0x4a7095){return db['FaxQueueReport'][_0x445c('0x46')]()[_0x445c('0x21')](respondWithResult(_0x4a7095,null))[_0x445c('0x3e')](handleError(_0x4a7095,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 07734b2..8451210 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 _0x942b=['define','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','./faxQueueReport.attributes','exports'];(function(_0x4334de,_0x3d4212){var _0xcb3504=function(_0x2f8712){while(--_0x2f8712){_0x4334de['push'](_0x4334de['shift']());}};_0xcb3504(++_0x3d4212);}(_0x942b,0x1a6));var _0xb942=function(_0x4f0c3e,_0x53706b){_0x4f0c3e=_0x4f0c3e-0x0;var _0x39220d=_0x942b[_0x4f0c3e];return _0x39220d;};'use strict';var _=require(_0xb942('0x0'));var util=require(_0xb942('0x1'));var logger=require(_0xb942('0x2'))(_0xb942('0x3'));var moment=require(_0xb942('0x4'));var BPromise=require('bluebird');var rp=require(_0xb942('0x5'));var attributes=require(_0xb942('0x6'));module[_0xb942('0x7')]=function(_0x349827,_0x2b9feb){return _0x349827[_0xb942('0x8')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb942('0x9'),'fields':[_0xb942('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd307=['exports','define','FaxQueueReport','uniqueid','lodash','util','api','moment','bluebird','request-promise','./faxQueueReport.attributes'];(function(_0x30e0cd,_0x118109){var _0x392985=function(_0x2c0435){while(--_0x2c0435){_0x30e0cd['push'](_0x30e0cd['shift']());}};_0x392985(++_0x118109);}(_0xd307,0x16f));var _0x7d30=function(_0x15e6fb,_0x55400b){_0x15e6fb=_0x15e6fb-0x0;var _0x1f11c0=_0xd307[_0x15e6fb];return _0x1f11c0;};'use strict';var _=require(_0x7d30('0x0'));var util=require(_0x7d30('0x1'));var logger=require('../../config/logger')(_0x7d30('0x2'));var moment=require(_0x7d30('0x3'));var BPromise=require(_0x7d30('0x4'));var rp=require(_0x7d30('0x5'));var attributes=require(_0x7d30('0x6'));module[_0x7d30('0x7')]=function(_0x255bc5,_0x42f63b){return _0x255bc5[_0x7d30('0x8')](_0x7d30('0x9'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x7d30('0xa'),'fields':[_0x7d30('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 3dc7b87..5a76ea2 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 _0xb7e7=['moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','where','attributes','UpdateFaxQueueReport','lodash'];(function(_0x2a43fc,_0x3f309f){var _0x3c5022=function(_0x257102){while(--_0x257102){_0x2a43fc['push'](_0x2a43fc['shift']());}};_0x3c5022(++_0x3f309f);}(_0xb7e7,0x121));var _0x7b7e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xb7e7[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}exports[_0x7b7e('0x14')]=function(_0x242368){var _0x200ef7=this;return new Promise(function(_0x2acb8c,_0x429a0e){return db[_0x7b7e('0x15')][_0x7b7e('0x16')](_0x242368[_0x7b7e('0x17')],{'raw':_0x242368[_0x7b7e('0x18')]?_0x242368[_0x7b7e('0x18')][_0x7b7e('0x19')]===undefined?!![]:![]:!![]})[_0x7b7e('0x9')](function(_0x49eddb){logger[_0x7b7e('0xa')](_0x7b7e('0x14'),_0x242368);logger[_0x7b7e('0xc')]('CreateFaxQueueReport',_0x242368,JSON[_0x7b7e('0xf')](_0x49eddb));_0x2acb8c(_0x49eddb);})[_0x7b7e('0x13')](function(_0x14243b){logger[_0x7b7e('0x10')](_0x7b7e('0x14'),_0x14243b[_0x7b7e('0x12')],_0x242368);_0x429a0e(_0x200ef7[_0x7b7e('0x10')](0x1f4,_0x14243b[_0x7b7e('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x5d6215){var _0x4a836a=this;return new Promise(function(_0x26ee14,_0x22598e){return db[_0x7b7e('0x15')]['update'](_0x5d6215['body'],{'raw':_0x5d6215['options']?_0x5d6215[_0x7b7e('0x18')][_0x7b7e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d6215[_0x7b7e('0x18')]?_0x5d6215[_0x7b7e('0x18')][_0x7b7e('0x1a')]||null:null,'attributes':_0x5d6215['options']?_0x5d6215[_0x7b7e('0x18')][_0x7b7e('0x1b')]||null:null,'limit':_0x5d6215['options']?_0x5d6215['options']['limit']||null:null})[_0x7b7e('0x9')](function(_0x423832){logger['info'](_0x7b7e('0x1c'),_0x5d6215);logger['debug'](_0x7b7e('0x1c'),_0x5d6215,JSON[_0x7b7e('0xf')](_0x423832));_0x26ee14(_0x423832);})[_0x7b7e('0x13')](function(_0x5515ca){logger[_0x7b7e('0x10')](_0x7b7e('0x1c'),_0x5515ca[_0x7b7e('0x12')],_0x5d6215);_0x22598e(_0x4a836a[_0x7b7e('0x10')](0x1f4,_0x5515ca[_0x7b7e('0x12')]));});});}; \ No newline at end of file +var _0x85cf=['request','info','debug','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','then','update','body','where','attributes','UpdateFaxQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x22e86a,_0x282717){var _0xf37984=function(_0x275de9){while(--_0x275de9){_0x22e86a['push'](_0x22e86a['shift']());}};_0xf37984(++_0x282717);}(_0x85cf,0x76));var _0xf85c=function(_0x465e84,_0x2ad6f8){_0x465e84=_0x465e84-0x0;var _0x29c6df=_0x85cf[_0x465e84];return _0x29c6df;};'use strict';var _=require('lodash');var util=require(_0xf85c('0x0'));var moment=require(_0xf85c('0x1'));var BPromise=require(_0xf85c('0x2'));var rs=require(_0xf85c('0x3'));var fs=require('fs');var Redis=require(_0xf85c('0x4'));var db=require(_0xf85c('0x5'))['db'];var utils=require(_0xf85c('0x6'));var logger=require(_0xf85c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf85c('0x8'));var client=jayson[_0xf85c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x386a60,_0x41d08d,_0xe1be83){return new BPromise(function(_0x1bebcf,_0x1857d9){return client[_0xf85c('0xa')](_0x386a60,_0xe1be83)['then'](function(_0x25aa6e){logger[_0xf85c('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x41d08d,'request\x20sent');logger[_0xf85c('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x41d08d,_0xf85c('0xd'),JSON[_0xf85c('0xe')](_0x25aa6e));if(_0x25aa6e[_0xf85c('0xf')]){if(_0x25aa6e['error'][_0xf85c('0x10')]===0x1f4){logger[_0xf85c('0xf')](_0xf85c('0x11'),_0x41d08d,_0x25aa6e[_0xf85c('0xf')]['message']);return _0x1857d9(_0x25aa6e[_0xf85c('0xf')][_0xf85c('0x12')]);}logger[_0xf85c('0xf')](_0xf85c('0x11'),_0x41d08d,_0x25aa6e['error'][_0xf85c('0x12')]);return _0x1bebcf(_0x25aa6e['error'][_0xf85c('0x12')]);}else{logger['info'](_0xf85c('0x11'),_0x41d08d,'request\x20sent');_0x1bebcf(_0x25aa6e[_0xf85c('0x13')]['message']);}})[_0xf85c('0x14')](function(_0x30b768){logger[_0xf85c('0xf')](_0xf85c('0x11'),_0x41d08d,_0x30b768);_0x1857d9(_0x30b768);});});}exports[_0xf85c('0x15')]=function(_0x5260c5){var _0x495854=this;return new Promise(function(_0x389693,_0x5a4a80){return db[_0xf85c('0x16')][_0xf85c('0x17')](_0x5260c5['body'],{'raw':_0x5260c5[_0xf85c('0x18')]?_0x5260c5[_0xf85c('0x18')][_0xf85c('0x19')]===undefined?!![]:![]:!![]})[_0xf85c('0x1a')](function(_0x41ff9e){logger['info'](_0xf85c('0x15'),_0x5260c5);logger['debug'](_0xf85c('0x15'),_0x5260c5,JSON[_0xf85c('0xe')](_0x41ff9e));_0x389693(_0x41ff9e);})['catch'](function(_0x5e7c08){logger[_0xf85c('0xf')](_0xf85c('0x15'),_0x5e7c08[_0xf85c('0x12')],_0x5260c5);_0x5a4a80(_0x495854[_0xf85c('0xf')](0x1f4,_0x5e7c08[_0xf85c('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x903fe6){var _0xae5462=this;return new Promise(function(_0x550cf3,_0x5c819f){return db[_0xf85c('0x16')][_0xf85c('0x1b')](_0x903fe6[_0xf85c('0x1c')],{'raw':_0x903fe6['options']?_0x903fe6[_0xf85c('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x903fe6['options']?_0x903fe6[_0xf85c('0x18')][_0xf85c('0x1d')]||null:null,'attributes':_0x903fe6['options']?_0x903fe6[_0xf85c('0x18')][_0xf85c('0x1e')]||null:null,'limit':_0x903fe6['options']?_0x903fe6[_0xf85c('0x18')]['limit']||null:null})[_0xf85c('0x1a')](function(_0x5d36e8){logger[_0xf85c('0xb')](_0xf85c('0x1f'),_0x903fe6);logger[_0xf85c('0xc')]('UpdateFaxQueueReport',_0x903fe6,JSON[_0xf85c('0xe')](_0x5d36e8));_0x550cf3(_0x5d36e8);})[_0xf85c('0x14')](function(_0x4cd913){logger[_0xf85c('0xf')](_0xf85c('0x1f'),_0x4cd913[_0xf85c('0x12')],_0x903fe6);_0x5c819f(_0xae5462[_0xf85c('0xf')](0x1f4,_0x4cd913[_0xf85c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 88b7022..9ad9d10 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 _0xb866=['index','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb866,0x1c3));var _0x6b86=function(_0x1b6caf,_0x19bc60){_0x1b6caf=_0x1b6caf-0x0;var _0x2995cc=_0xb866[_0x1b6caf];return _0x2995cc;};'use strict';var multer=require(_0x6b86('0x0'));var util=require(_0x6b86('0x1'));var path=require(_0x6b86('0x2'));var timeout=require(_0x6b86('0x3'));var express=require('express');var router=express[_0x6b86('0x4')]();var auth=require(_0x6b86('0x5'));var interaction=require(_0x6b86('0x6'));var config=require(_0x6b86('0x7'));var controller=require(_0x6b86('0x8'));router[_0x6b86('0x9')]('/',auth[_0x6b86('0xa')](),controller[_0x6b86('0xb')]);router['get'](_0x6b86('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x6b86('0x9')]('/:id',auth[_0x6b86('0xa')](),controller[_0x6b86('0xd')]);router[_0x6b86('0xe')]('/',auth[_0x6b86('0xa')](),controller[_0x6b86('0xf')]);router[_0x6b86('0x10')](_0x6b86('0x11'),auth[_0x6b86('0xa')](),controller[_0x6b86('0x12')]);router[_0x6b86('0x13')]('/:id',auth[_0x6b86('0xa')](),controller[_0x6b86('0x14')]);module[_0x6b86('0x15')]=router; \ No newline at end of file +var _0xd970=['create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','isAuthenticated'];(function(_0x489d27,_0x4cadaa){var _0x26d046=function(_0x19bbb5){while(--_0x19bbb5){_0x489d27['push'](_0x489d27['shift']());}};_0x26d046(++_0x4cadaa);}(_0xd970,0x1ec));var _0x0d97=function(_0x3ebc66,_0x5e1d9e){_0x3ebc66=_0x3ebc66-0x0;var _0x4ae4a4=_0xd970[_0x3ebc66];return _0x4ae4a4;};'use strict';var multer=require(_0x0d97('0x0'));var util=require(_0x0d97('0x1'));var path=require(_0x0d97('0x2'));var timeout=require('connect-timeout');var express=require(_0x0d97('0x3'));var router=express['Router']();var auth=require(_0x0d97('0x4'));var interaction=require(_0x0d97('0x5'));var config=require(_0x0d97('0x6'));var controller=require('./faxQueueReport.controller');router[_0x0d97('0x7')]('/',auth['isAuthenticated'](),controller[_0x0d97('0x8')]);router['get'](_0x0d97('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x0d97('0x7')](_0x0d97('0xa'),auth[_0x0d97('0xb')](),controller['show']);router['post']('/',auth[_0x0d97('0xb')](),controller[_0x0d97('0xc')]);router[_0x0d97('0xd')](_0x0d97('0xa'),auth[_0x0d97('0xb')](),controller[_0x0d97('0xe')]);router[_0x0d97('0xf')](_0x0d97('0xa'),auth[_0x0d97('0xb')](),controller[_0x0d97('0x10')]);module[_0x0d97('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 1b302a7..ad244dc 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 _0xc87c=['DATE','NOW','moment','sequelize','exports','ENUM','account','queue'];(function(_0x2656ee,_0x526aa8){var _0x34640e=function(_0x8e0e16){while(--_0x8e0e16){_0x2656ee['push'](_0x2656ee['shift']());}};_0x34640e(++_0x526aa8);}(_0xc87c,0x142));var _0xcc87=function(_0x2f6151,_0x25ba01){_0x2f6151=_0x2f6151-0x0;var _0x333ef9=_0xc87c[_0x2f6151];return _0x333ef9;};'use strict';var moment=require(_0xcc87('0x0'));var Sequelize=require(_0xcc87('0x1'));module[_0xcc87('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xcc87('0x3')](_0xcc87('0x4'),'agent',_0xcc87('0x5')),'allowNull':![],'defaultValue':_0xcc87('0x5')},'transferredAt':{'type':Sequelize[_0xcc87('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xcc87('0x7')]}}; \ No newline at end of file +var _0xb634=['moment','sequelize','exports','STRING','ENUM','account','agent','queue','DATE','NOW'];(function(_0x3edeb0,_0x429b40){var _0x4b77e4=function(_0x3b0414){while(--_0x3b0414){_0x3edeb0['push'](_0x3edeb0['shift']());}};_0x4b77e4(++_0x429b40);}(_0xb634,0x1b8));var _0x4b63=function(_0x48b5d4,_0x1f3a7d){_0x48b5d4=_0x48b5d4-0x0;var _0x4a92c6=_0xb634[_0x48b5d4];return _0x4a92c6;};'use strict';var moment=require(_0x4b63('0x0'));var Sequelize=require(_0x4b63('0x1'));module[_0x4b63('0x2')]={'uniqueid':{'type':Sequelize[_0x4b63('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4b63('0x4')](_0x4b63('0x5'),_0x4b63('0x6'),_0x4b63('0x7')),'allowNull':![],'defaultValue':_0x4b63('0x7')},'transferredAt':{'type':Sequelize[_0x4b63('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x4b63('0x9')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index b47c491..9185ede 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 _0x8098=['sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','FaxTransferReport','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x8098,0x1ba));var _0x8809=function(_0x7738d9,_0x36f3f5){_0x7738d9=_0x7738d9-0x0;var _0x4293c0=_0x8098[_0x7738d9];return _0x4293c0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8809('0x0'));var zipdir=require(_0x8809('0x1'));var jsonpatch=require(_0x8809('0x2'));var rp=require(_0x8809('0x3'));var moment=require(_0x8809('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8809('0x5'));var util=require(_0x8809('0x6'));var path=require(_0x8809('0x7'));var sox=require(_0x8809('0x8'));var csv=require('to-csv');var ejs=require(_0x8809('0x9'));var fs=require('fs');var _=require(_0x8809('0xa'));var squel=require('squel');var crypto=require(_0x8809('0xb'));var jsforce=require(_0x8809('0xc'));var deskjs=require(_0x8809('0xd'));var toCsv=require(_0x8809('0xe'));var querystring=require(_0x8809('0xf'));var Papa=require(_0x8809('0x10'));var authService=require(_0x8809('0x11'));var hardwareService=require(_0x8809('0x12'));var Redis=require(_0x8809('0x13'));var qs=require(_0x8809('0x14'));var logger=require(_0x8809('0x15'))(_0x8809('0x16'));var utils=require(_0x8809('0x17'));var config=require(_0x8809('0x18'));var db=require(_0x8809('0x19'))['db'];function respondWithStatusCode(_0x3c6539,_0x4daf31){_0x4daf31=_0x4daf31||0xcc;return function(_0x388b99){if(_0x388b99){return _0x3c6539[_0x8809('0x1a')](_0x4daf31);}return _0x3c6539['status'](_0x4daf31)[_0x8809('0x1b')]();};}function respondWithResult(_0x388b82,_0x5d2f30){_0x5d2f30=_0x5d2f30||0xc8;return function(_0x5d87df){if(_0x5d87df){return _0x388b82[_0x8809('0x1c')](_0x5d2f30)[_0x8809('0x1d')](_0x5d87df);}};}function respondWithFilteredResult(_0x1c438f,_0x13b958){return function(_0x131716){if(_0x131716){var _0x3d4d7e=_0x131716[_0x8809('0x1e')],_0x105bec=_0x13b958['offset'],_0x5624b5=_0x13b958[_0x8809('0x1f')]+_0x13b958[_0x8809('0x20')],_0x1bcea9;if(_0x5624b5>=_0x3d4d7e){_0x5624b5=_0x3d4d7e;_0x1bcea9=0xc8;}else{_0x1bcea9=0xce;}_0x1c438f['status'](_0x1bcea9);return _0x1c438f[_0x8809('0x21')](_0x8809('0x22'),_0x105bec+'-'+_0x5624b5+'/'+_0x3d4d7e)[_0x8809('0x1d')](_0x131716);}return null;};}function patchUpdates(_0x17289e){return function(_0x9f2f9d){try{jsonpatch['apply'](_0x9f2f9d,_0x17289e,!![]);}catch(_0x4826e2){return BPromise[_0x8809('0x23')](_0x4826e2);}return _0x9f2f9d[_0x8809('0x24')]();};}function saveUpdates(_0x1afa53,_0x3f0f90){return function(_0x2ff4a1){if(_0x2ff4a1){return _0x2ff4a1[_0x8809('0x25')](_0x1afa53)[_0x8809('0x26')](function(_0x404be9){return _0x404be9;});}return null;};}function removeEntity(_0x3d497f,_0x299a93){return function(_0x16893a){if(_0x16893a){return _0x16893a[_0x8809('0x27')]()[_0x8809('0x26')](function(){_0x3d497f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34d2df,_0x5984c6){return function(_0x521840){if(!_0x521840){_0x34d2df['sendStatus'](0x194);}return _0x521840;};}function handleError(_0x4b6c72,_0x2b000e){_0x2b000e=_0x2b000e||0x1f4;return function(_0x3d19c1){logger[_0x8809('0x28')](_0x3d19c1[_0x8809('0x29')]);if(_0x3d19c1[_0x8809('0x2a')]){delete _0x3d19c1[_0x8809('0x2a')];}_0x4b6c72[_0x8809('0x1c')](_0x2b000e)[_0x8809('0x2b')](_0x3d19c1);};}exports[_0x8809('0x2c')]=function(_0x6e5dc8,_0x84d182){var _0xf45590={},_0x566aac={},_0x5c7cbf={'count':0x0,'rows':[]};var _0x38554b=db[_0x8809('0x2d')]['rawAttributes'];_0x566aac[_0x8809('0x2e')]=_[_0x8809('0x2f')](_0x38554b);_0x566aac[_0x8809('0x30')]=_[_0x8809('0x2f')](_0x6e5dc8[_0x8809('0x30')]);_0x566aac['filters']=_[_0x8809('0x31')](_0x566aac['model'],_0x566aac[_0x8809('0x30')]);_0xf45590[_0x8809('0x32')]=_['intersection'](_0x566aac[_0x8809('0x2e')],qs['fields'](_0x6e5dc8[_0x8809('0x30')][_0x8809('0x33')]));_0xf45590[_0x8809('0x32')]=_0xf45590[_0x8809('0x32')][_0x8809('0x34')]?_0xf45590[_0x8809('0x32')]:_0x566aac['model'];if(!_0x6e5dc8['query'][_0x8809('0x35')](_0x8809('0x36'))){_0xf45590[_0x8809('0x20')]=qs[_0x8809('0x20')](_0x6e5dc8[_0x8809('0x30')]['limit']);_0xf45590[_0x8809('0x1f')]=qs['offset'](_0x6e5dc8['query'][_0x8809('0x1f')]);}_0xf45590['order']=qs[_0x8809('0x37')](_0x6e5dc8['query'][_0x8809('0x37')]);_0xf45590[_0x8809('0x38')]=qs[_0x8809('0x39')](_[_0x8809('0x3a')](_0x6e5dc8[_0x8809('0x30')],_0x566aac[_0x8809('0x39')]));if(_0x6e5dc8['query'][_0x8809('0x3b')]){_0xf45590[_0x8809('0x38')]=_['merge'](_0xf45590[_0x8809('0x38')],{'$or':_[_0x8809('0x3c')](_0x38554b,function(_0x4a09a){if(_0x4a09a[_0x8809('0x3d')][_0x8809('0x3e')]!==_0x8809('0x3f')){var _0x4c5c92={};_0x4c5c92[_0x4a09a[_0x8809('0x40')]]={'$like':'%'+_0x6e5dc8[_0x8809('0x30')][_0x8809('0x3b')]+'%'};return _0x4c5c92;}})});}_0xf45590=_[_0x8809('0x41')]({},_0xf45590,_0x6e5dc8[_0x8809('0x42')]);var _0x18e767={'where':_0xf45590[_0x8809('0x38')]};return db[_0x8809('0x2d')]['count'](_0x18e767)[_0x8809('0x26')](function(_0x18ec41){_0x5c7cbf[_0x8809('0x1e')]=_0x18ec41;if(_0x6e5dc8[_0x8809('0x30')]['includeAll']){_0xf45590[_0x8809('0x43')]=[{'all':!![]}];}return db[_0x8809('0x2d')][_0x8809('0x44')](_0xf45590);})[_0x8809('0x26')](function(_0x8e60e2){_0x5c7cbf[_0x8809('0x45')]=_0x8e60e2;return _0x5c7cbf;})[_0x8809('0x26')](respondWithFilteredResult(_0x84d182,_0xf45590))[_0x8809('0x46')](handleError(_0x84d182,null));};exports[_0x8809('0x47')]=function(_0x2319bb,_0x1d7710){var _0x20268f={'raw':!![],'where':{'id':_0x2319bb[_0x8809('0x48')]['id']}},_0x218462={};_0x218462[_0x8809('0x2e')]=_[_0x8809('0x2f')](db[_0x8809('0x2d')][_0x8809('0x49')]);_0x218462[_0x8809('0x30')]=_[_0x8809('0x2f')](_0x2319bb[_0x8809('0x30')]);_0x218462[_0x8809('0x39')]=_[_0x8809('0x31')](_0x218462['model'],_0x218462[_0x8809('0x30')]);_0x20268f[_0x8809('0x32')]=_['intersection'](_0x218462[_0x8809('0x2e')],qs[_0x8809('0x33')](_0x2319bb[_0x8809('0x30')][_0x8809('0x33')]));_0x20268f[_0x8809('0x32')]=_0x20268f['attributes']['length']?_0x20268f[_0x8809('0x32')]:_0x218462[_0x8809('0x2e')];if(_0x2319bb[_0x8809('0x30')][_0x8809('0x4a')]){_0x20268f['include']=[{'all':!![]}];}_0x20268f=_['merge']({},_0x20268f,_0x2319bb[_0x8809('0x42')]);return db[_0x8809('0x2d')]['find'](_0x20268f)[_0x8809('0x26')](handleEntityNotFound(_0x1d7710,null))[_0x8809('0x26')](respondWithResult(_0x1d7710,null))['catch'](handleError(_0x1d7710,null));};exports[_0x8809('0x4b')]=function(_0x1a8f7b,_0x4655b0){return db[_0x8809('0x2d')]['create'](_0x1a8f7b[_0x8809('0x4c')],{})['then'](respondWithResult(_0x4655b0,0xc9))['catch'](handleError(_0x4655b0,null));};exports[_0x8809('0x25')]=function(_0x31c454,_0x3ca6ab){if(_0x31c454[_0x8809('0x4c')]['id']){delete _0x31c454[_0x8809('0x4c')]['id'];}return db[_0x8809('0x2d')]['find']({'where':{'id':_0x31c454[_0x8809('0x48')]['id']}})[_0x8809('0x26')](handleEntityNotFound(_0x3ca6ab,null))[_0x8809('0x26')](saveUpdates(_0x31c454[_0x8809('0x4c')],null))[_0x8809('0x26')](respondWithResult(_0x3ca6ab,null))[_0x8809('0x46')](handleError(_0x3ca6ab,null));};exports[_0x8809('0x27')]=function(_0x373bf4,_0x23f6f6){return db[_0x8809('0x2d')]['find']({'where':{'id':_0x373bf4[_0x8809('0x48')]['id']}})[_0x8809('0x26')](handleEntityNotFound(_0x23f6f6,null))[_0x8809('0x26')](removeEntity(_0x23f6f6,null))[_0x8809('0x46')](handleError(_0x23f6f6,null));};exports[_0x8809('0x4d')]=function(_0x4109e2,_0x12506c){return db['FaxTransferReport'][_0x8809('0x4d')]()['then'](respondWithResult(_0x12506c,null))[_0x8809('0x46')](handleError(_0x12506c,null));}; \ No newline at end of file +var _0x0bde=['reject','save','update','then','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','limit','order','sort','where','filter','map','type','VIRTUAL','FaxTransferReport','catch','show','include','merge','find','create','body','destroy','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/utils','sendStatus','end','status','json','count','offset','set','apply'];(function(_0x28b6ab,_0xe0bd21){var _0x4bb47a=function(_0x43c564){while(--_0x43c564){_0x28b6ab['push'](_0x28b6ab['shift']());}};_0x4bb47a(++_0xe0bd21);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe0bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0bd('0x1'));var jsonpatch=require(_0xe0bd('0x2'));var rp=require(_0xe0bd('0x3'));var moment=require(_0xe0bd('0x4'));var BPromise=require(_0xe0bd('0x5'));var Mustache=require('mustache');var util=require(_0xe0bd('0x6'));var path=require(_0xe0bd('0x7'));var sox=require(_0xe0bd('0x8'));var csv=require(_0xe0bd('0x9'));var ejs=require(_0xe0bd('0xa'));var fs=require('fs');var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0bd('0xd'));var deskjs=require(_0xe0bd('0xe'));var toCsv=require(_0xe0bd('0x9'));var querystring=require(_0xe0bd('0xf'));var Papa=require(_0xe0bd('0x10'));var authService=require(_0xe0bd('0x11'));var hardwareService=require(_0xe0bd('0x12'));var Redis=require(_0xe0bd('0x13'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0xe0bd('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe889e8,_0x415093){_0x415093=_0x415093||0xcc;return function(_0x54d40e){if(_0x54d40e){return _0xe889e8[_0xe0bd('0x15')](_0x415093);}return _0xe889e8['status'](_0x415093)[_0xe0bd('0x16')]();};}function respondWithResult(_0x436535,_0x3b2fb1){_0x3b2fb1=_0x3b2fb1||0xc8;return function(_0x20ab47){if(_0x20ab47){return _0x436535[_0xe0bd('0x17')](_0x3b2fb1)[_0xe0bd('0x18')](_0x20ab47);}};}function respondWithFilteredResult(_0x342a68,_0x210f20){return function(_0x4f63fa){if(_0x4f63fa){var _0x50891d=_0x4f63fa[_0xe0bd('0x19')],_0x4fb006=_0x210f20[_0xe0bd('0x1a')],_0x2ff887=_0x210f20[_0xe0bd('0x1a')]+_0x210f20['limit'],_0x8179fb;if(_0x2ff887>=_0x50891d){_0x2ff887=_0x50891d;_0x8179fb=0xc8;}else{_0x8179fb=0xce;}_0x342a68['status'](_0x8179fb);return _0x342a68[_0xe0bd('0x1b')]('Content-Range',_0x4fb006+'-'+_0x2ff887+'/'+_0x50891d)[_0xe0bd('0x18')](_0x4f63fa);}return null;};}function patchUpdates(_0x418d64){return function(_0xec158d){try{jsonpatch[_0xe0bd('0x1c')](_0xec158d,_0x418d64,!![]);}catch(_0x5f22e2){return BPromise[_0xe0bd('0x1d')](_0x5f22e2);}return _0xec158d[_0xe0bd('0x1e')]();};}function saveUpdates(_0x2b9f93,_0x47ceb8){return function(_0x1bf742){if(_0x1bf742){return _0x1bf742[_0xe0bd('0x1f')](_0x2b9f93)[_0xe0bd('0x20')](function(_0x532584){return _0x532584;});}return null;};}function removeEntity(_0x2d40d0,_0xdd7d30){return function(_0x2b4f7d){if(_0x2b4f7d){return _0x2b4f7d['destroy']()[_0xe0bd('0x20')](function(){_0x2d40d0['status'](0xcc)[_0xe0bd('0x16')]();});}};}function handleEntityNotFound(_0x2bcfcc,_0x4bcd48){return function(_0xa4a4e9){if(!_0xa4a4e9){_0x2bcfcc[_0xe0bd('0x15')](0x194);}return _0xa4a4e9;};}function handleError(_0x449f32,_0x157856){_0x157856=_0x157856||0x1f4;return function(_0x2a1f92){logger[_0xe0bd('0x21')](_0x2a1f92[_0xe0bd('0x22')]);if(_0x2a1f92[_0xe0bd('0x23')]){delete _0x2a1f92['name'];}_0x449f32['status'](_0x157856)[_0xe0bd('0x24')](_0x2a1f92);};}exports[_0xe0bd('0x25')]=function(_0x47d171,_0x4e8f11){var _0x3bac51={},_0x303f9d={},_0x403f37={'count':0x0,'rows':[]};var _0x1b5861=db['FaxTransferReport'][_0xe0bd('0x26')];_0x303f9d['model']=_[_0xe0bd('0x27')](_0x1b5861);_0x303f9d[_0xe0bd('0x28')]=_[_0xe0bd('0x27')](_0x47d171[_0xe0bd('0x28')]);_0x303f9d[_0xe0bd('0x29')]=_[_0xe0bd('0x2a')](_0x303f9d[_0xe0bd('0x2b')],_0x303f9d[_0xe0bd('0x28')]);_0x3bac51[_0xe0bd('0x2c')]=_[_0xe0bd('0x2a')](_0x303f9d[_0xe0bd('0x2b')],qs[_0xe0bd('0x2d')](_0x47d171[_0xe0bd('0x28')]['fields']));_0x3bac51[_0xe0bd('0x2c')]=_0x3bac51[_0xe0bd('0x2c')][_0xe0bd('0x2e')]?_0x3bac51[_0xe0bd('0x2c')]:_0x303f9d[_0xe0bd('0x2b')];if(!_0x47d171[_0xe0bd('0x28')]['hasOwnProperty']('nolimit')){_0x3bac51[_0xe0bd('0x2f')]=qs[_0xe0bd('0x2f')](_0x47d171[_0xe0bd('0x28')][_0xe0bd('0x2f')]);_0x3bac51[_0xe0bd('0x1a')]=qs[_0xe0bd('0x1a')](_0x47d171[_0xe0bd('0x28')]['offset']);}_0x3bac51[_0xe0bd('0x30')]=qs[_0xe0bd('0x31')](_0x47d171[_0xe0bd('0x28')][_0xe0bd('0x31')]);_0x3bac51[_0xe0bd('0x32')]=qs[_0xe0bd('0x29')](_['pick'](_0x47d171[_0xe0bd('0x28')],_0x303f9d[_0xe0bd('0x29')]));if(_0x47d171[_0xe0bd('0x28')][_0xe0bd('0x33')]){_0x3bac51[_0xe0bd('0x32')]=_['merge'](_0x3bac51['where'],{'$or':_[_0xe0bd('0x34')](_0x1b5861,function(_0x28c632){if(_0x28c632[_0xe0bd('0x35')]['key']!==_0xe0bd('0x36')){var _0x4eefae={};_0x4eefae[_0x28c632['field']]={'$like':'%'+_0x47d171[_0xe0bd('0x28')][_0xe0bd('0x33')]+'%'};return _0x4eefae;}})});}_0x3bac51=_['merge']({},_0x3bac51,_0x47d171['options']);var _0x50338e={'where':_0x3bac51[_0xe0bd('0x32')]};return db[_0xe0bd('0x37')][_0xe0bd('0x19')](_0x50338e)['then'](function(_0x20827d){_0x403f37[_0xe0bd('0x19')]=_0x20827d;if(_0x47d171[_0xe0bd('0x28')]['includeAll']){_0x3bac51['include']=[{'all':!![]}];}return db[_0xe0bd('0x37')]['findAll'](_0x3bac51);})[_0xe0bd('0x20')](function(_0x195f0f){_0x403f37['rows']=_0x195f0f;return _0x403f37;})[_0xe0bd('0x20')](respondWithFilteredResult(_0x4e8f11,_0x3bac51))[_0xe0bd('0x38')](handleError(_0x4e8f11,null));};exports[_0xe0bd('0x39')]=function(_0xb65059,_0x2a7782){var _0x188394={'raw':!![],'where':{'id':_0xb65059['params']['id']}},_0x39501e={};_0x39501e[_0xe0bd('0x2b')]=_[_0xe0bd('0x27')](db[_0xe0bd('0x37')][_0xe0bd('0x26')]);_0x39501e[_0xe0bd('0x28')]=_['keys'](_0xb65059['query']);_0x39501e['filters']=_[_0xe0bd('0x2a')](_0x39501e[_0xe0bd('0x2b')],_0x39501e[_0xe0bd('0x28')]);_0x188394[_0xe0bd('0x2c')]=_['intersection'](_0x39501e['model'],qs[_0xe0bd('0x2d')](_0xb65059[_0xe0bd('0x28')][_0xe0bd('0x2d')]));_0x188394[_0xe0bd('0x2c')]=_0x188394[_0xe0bd('0x2c')][_0xe0bd('0x2e')]?_0x188394[_0xe0bd('0x2c')]:_0x39501e['model'];if(_0xb65059[_0xe0bd('0x28')]['includeAll']){_0x188394[_0xe0bd('0x3a')]=[{'all':!![]}];}_0x188394=_[_0xe0bd('0x3b')]({},_0x188394,_0xb65059['options']);return db['FaxTransferReport'][_0xe0bd('0x3c')](_0x188394)[_0xe0bd('0x20')](handleEntityNotFound(_0x2a7782,null))[_0xe0bd('0x20')](respondWithResult(_0x2a7782,null))[_0xe0bd('0x38')](handleError(_0x2a7782,null));};exports[_0xe0bd('0x3d')]=function(_0x1bd42a,_0x368549){return db[_0xe0bd('0x37')][_0xe0bd('0x3d')](_0x1bd42a['body'],{})[_0xe0bd('0x20')](respondWithResult(_0x368549,0xc9))[_0xe0bd('0x38')](handleError(_0x368549,null));};exports[_0xe0bd('0x1f')]=function(_0x4e9de0,_0x1fef07){if(_0x4e9de0[_0xe0bd('0x3e')]['id']){delete _0x4e9de0['body']['id'];}return db[_0xe0bd('0x37')][_0xe0bd('0x3c')]({'where':{'id':_0x4e9de0['params']['id']}})[_0xe0bd('0x20')](handleEntityNotFound(_0x1fef07,null))[_0xe0bd('0x20')](saveUpdates(_0x4e9de0[_0xe0bd('0x3e')],null))['then'](respondWithResult(_0x1fef07,null))[_0xe0bd('0x38')](handleError(_0x1fef07,null));};exports[_0xe0bd('0x3f')]=function(_0x147438,_0x21ae20){return db[_0xe0bd('0x37')][_0xe0bd('0x3c')]({'where':{'id':_0x147438[_0xe0bd('0x40')]['id']}})[_0xe0bd('0x20')](handleEntityNotFound(_0x21ae20,null))[_0xe0bd('0x20')](removeEntity(_0x21ae20,null))['catch'](handleError(_0x21ae20,null));};exports['describe']=function(_0x49c5fb,_0x43b646){return db[_0xe0bd('0x37')]['describe']()[_0xe0bd('0x20')](respondWithResult(_0x43b646,null))[_0xe0bd('0x38')](handleError(_0x43b646,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 1534273..51591d7 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 _0x458d=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./faxTransferReport.attributes','exports','define'];(function(_0x13924d,_0x526e1b){var _0x4a1cef=function(_0x5a2e16){while(--_0x5a2e16){_0x13924d['push'](_0x13924d['shift']());}};_0x4a1cef(++_0x526e1b);}(_0x458d,0x1d7));var _0xd458=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x458d[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xd458('0x0'));var util=require(_0xd458('0x1'));var logger=require(_0xd458('0x2'))(_0xd458('0x3'));var moment=require(_0xd458('0x4'));var BPromise=require(_0xd458('0x5'));var rp=require(_0xd458('0x6'));var attributes=require(_0xd458('0x7'));module[_0xd458('0x8')]=function(_0x1992a7,_0x2d06d3){return _0x1992a7[_0xd458('0x9')](_0xd458('0xa'),attributes,{'tableName':_0xd458('0xb'),'paranoid':![],'indexes':[{'name':_0xd458('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdf7=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer'];(function(_0x24fb3b,_0x6c016b){var _0x3de801=function(_0x1e9b8d){while(--_0x1e9b8d){_0x24fb3b['push'](_0x24fb3b['shift']());}};_0x3de801(++_0x6c016b);}(_0xfdf7,0xa9));var _0x7fdf=function(_0x2c4d31,_0x21f3a8){_0x2c4d31=_0x2c4d31-0x0;var _0x3a9785=_0xfdf7[_0x2c4d31];return _0x3a9785;};'use strict';var _=require(_0x7fdf('0x0'));var util=require(_0x7fdf('0x1'));var logger=require(_0x7fdf('0x2'))('api');var moment=require(_0x7fdf('0x3'));var BPromise=require(_0x7fdf('0x4'));var rp=require(_0x7fdf('0x5'));var attributes=require(_0x7fdf('0x6'));module[_0x7fdf('0x7')]=function(_0x5c2420,_0x514c24){return _0x5c2420[_0x7fdf('0x8')](_0x7fdf('0x9'),attributes,{'tableName':_0x7fdf('0xa'),'paranoid':![],'indexes':[{'name':_0x7fdf('0xb'),'fields':[_0x7fdf('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 0a7b949..3cb8e45 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 _0x867a=['request\x20sent','debug','stringify','error','code','message','result','catch','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0x867a,0xb3));var _0xa867=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x867a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa867('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa867('0x1'))['db'];var utils=require(_0xa867('0x2'));var logger=require('../../config/logger')(_0xa867('0x3'));var config=require(_0xa867('0x4'));var jayson=require(_0xa867('0x5'));var client=jayson['client'][_0xa867('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x28ecfd,_0x378692,_0x1d10ee){return new BPromise(function(_0x3bd193,_0x5af173){return client[_0xa867('0x7')](_0x28ecfd,_0x1d10ee)[_0xa867('0x8')](function(_0x2ce590){logger[_0xa867('0x9')](_0xa867('0xa'),_0x378692,_0xa867('0xb'));logger[_0xa867('0xc')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x378692,_0xa867('0xb'),JSON[_0xa867('0xd')](_0x2ce590));if(_0x2ce590[_0xa867('0xe')]){if(_0x2ce590['error'][_0xa867('0xf')]===0x1f4){logger[_0xa867('0xe')](_0xa867('0xa'),_0x378692,_0x2ce590[_0xa867('0xe')]['message']);return _0x5af173(_0x2ce590['error'][_0xa867('0x10')]);}logger[_0xa867('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x378692,_0x2ce590[_0xa867('0xe')][_0xa867('0x10')]);return _0x3bd193(_0x2ce590[_0xa867('0xe')][_0xa867('0x10')]);}else{logger[_0xa867('0x9')]('FaxTransferReport,\x20%s,\x20%s',_0x378692,_0xa867('0xb'));_0x3bd193(_0x2ce590[_0xa867('0x11')][_0xa867('0x10')]);}})[_0xa867('0x12')](function(_0x3cac09){logger[_0xa867('0xe')](_0xa867('0xa'),_0x378692,_0x3cac09);_0x5af173(_0x3cac09);});});} \ No newline at end of file +var _0x9afc=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x9afc,0x8b));var _0xc9af=function(_0x1aa13e,_0x12a40b){_0x1aa13e=_0x1aa13e-0x0;var _0x1144bd=_0x9afc[_0x1aa13e];return _0x1144bd;};'use strict';var _=require(_0xc9af('0x0'));var util=require(_0xc9af('0x1'));var moment=require(_0xc9af('0x2'));var BPromise=require(_0xc9af('0x3'));var rs=require(_0xc9af('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc9af('0x5'));var logger=require(_0xc9af('0x6'))(_0xc9af('0x7'));var config=require(_0xc9af('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc9af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15d6e4,_0x84189d,_0x16c87c){return new BPromise(function(_0x5658ef,_0x429318){return client[_0xc9af('0xa')](_0x15d6e4,_0x16c87c)[_0xc9af('0xb')](function(_0x5c69ec){logger[_0xc9af('0xc')](_0xc9af('0xd'),_0x84189d,_0xc9af('0xe'));logger[_0xc9af('0xf')](_0xc9af('0x10'),_0x84189d,_0xc9af('0xe'),JSON[_0xc9af('0x11')](_0x5c69ec));if(_0x5c69ec[_0xc9af('0x12')]){if(_0x5c69ec[_0xc9af('0x12')][_0xc9af('0x13')]===0x1f4){logger[_0xc9af('0x12')](_0xc9af('0xd'),_0x84189d,_0x5c69ec[_0xc9af('0x12')][_0xc9af('0x14')]);return _0x429318(_0x5c69ec[_0xc9af('0x12')][_0xc9af('0x14')]);}logger[_0xc9af('0x12')](_0xc9af('0xd'),_0x84189d,_0x5c69ec['error'][_0xc9af('0x14')]);return _0x5658ef(_0x5c69ec['error'][_0xc9af('0x14')]);}else{logger[_0xc9af('0xc')](_0xc9af('0xd'),_0x84189d,'request\x20sent');_0x5658ef(_0x5c69ec[_0xc9af('0x15')][_0xc9af('0x14')]);}})[_0xc9af('0x16')](function(_0x37cdfd){logger[_0xc9af('0x12')](_0xc9af('0xd'),_0x84189d,_0x37cdfd);_0x429318(_0x37cdfd);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index ffd652d..3e32976 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 _0xd2ea=['../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x480f4a,_0x2ea3f8){var _0xdccb7d=function(_0x151258){while(--_0x151258){_0x480f4a['push'](_0x480f4a['shift']());}};_0xdccb7d(++_0x2ea3f8);}(_0xd2ea,0x15f));var _0xad2e=function(_0x255a99,_0x13476a){_0x255a99=_0x255a99-0x0;var _0x1a2ac7=_0xd2ea[_0x255a99];return _0x1a2ac7;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var auth=require(_0xad2e('0x5'));var interaction=require(_0xad2e('0x6'));var config=require(_0xad2e('0x7'));var controller=require(_0xad2e('0x8'));router[_0xad2e('0x9')]('/',auth[_0xad2e('0xa')](),controller[_0xad2e('0xb')]);router['get'](_0xad2e('0xc'),auth[_0xad2e('0xa')](),controller[_0xad2e('0xd')]);router['get'](_0xad2e('0xe'),auth[_0xad2e('0xa')](),controller['show']);router[_0xad2e('0xf')]('/',auth['isAuthenticated'](),controller[_0xad2e('0x10')]);router[_0xad2e('0x11')](_0xad2e('0xe'),auth[_0xad2e('0xa')](),controller['update']);router[_0xad2e('0x12')]('/:id',auth[_0xad2e('0xa')](),controller[_0xad2e('0x13')]);module[_0xad2e('0x14')]=router; \ No newline at end of file +var _0x8d0e=['describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated'];(function(_0x48aa35,_0x4c4c83){var _0x29b36b=function(_0x442e58){while(--_0x442e58){_0x48aa35['push'](_0x48aa35['shift']());}};_0x29b36b(++_0x4c4c83);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x3d7b89,_0xbb08e3){_0x3d7b89=_0x3d7b89-0x0;var _0x11775a=_0x8d0e[_0x3d7b89];return _0x11775a;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var auth=require(_0xe8d0('0x6'));var interaction=require(_0xe8d0('0x7'));var config=require(_0xe8d0('0x8'));var controller=require('./faxTransferReport.controller');router[_0xe8d0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe8d0('0x9')](_0xe8d0('0xa'),auth[_0xe8d0('0xb')](),controller[_0xe8d0('0xc')]);router[_0xe8d0('0x9')](_0xe8d0('0xd'),auth[_0xe8d0('0xb')](),controller[_0xe8d0('0xe')]);router['post']('/',auth[_0xe8d0('0xb')](),controller[_0xe8d0('0xf')]);router[_0xe8d0('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe8d0('0x11')]);router[_0xe8d0('0x12')](_0xe8d0('0xd'),auth[_0xe8d0('0xb')](),controller[_0xe8d0('0x13')]);module[_0xe8d0('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 68f0037..24bff83 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 _0x9f41=['delete','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update'];(function(_0xe9dc46,_0x4f6bd6){var _0x65638c=function(_0x14578e){while(--_0x14578e){_0xe9dc46['push'](_0xe9dc46['shift']());}};_0x65638c(++_0x4f6bd6);}(_0x9f41,0x94));var _0x19f4=function(_0x98a233,_0x316f2e){_0x98a233=_0x98a233-0x0;var _0xa9ab2f=_0x9f41[_0x98a233];return _0xa9ab2f;};'use strict';var multer=require('multer');var util=require(_0x19f4('0x0'));var path=require(_0x19f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x19f4('0x2'));var router=express[_0x19f4('0x3')]();var auth=require(_0x19f4('0x4'));var interaction=require(_0x19f4('0x5'));var config=require('../../config/environment');var controller=require(_0x19f4('0x6'));router[_0x19f4('0x7')]('/',auth[_0x19f4('0x8')](),controller[_0x19f4('0x9')]);router[_0x19f4('0x7')](_0x19f4('0xa'),auth[_0x19f4('0x8')](),controller[_0x19f4('0xb')]);router['get'](_0x19f4('0xc'),auth[_0x19f4('0x8')](),controller[_0x19f4('0xd')]);router[_0x19f4('0x7')](_0x19f4('0xe'),auth[_0x19f4('0x8')](),controller[_0x19f4('0xf')]);router[_0x19f4('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x19f4('0x10')](_0x19f4('0xc'),auth[_0x19f4('0x8')](),controller[_0x19f4('0x11')]);router[_0x19f4('0x12')](_0x19f4('0xa'),auth[_0x19f4('0x8')](),controller[_0x19f4('0x13')]);router[_0x19f4('0x14')](_0x19f4('0xa'),auth[_0x19f4('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x46de=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getFields','create','post','addConfiguration','put','/:id','update','delete','destroy','util','connect-timeout'];(function(_0x4c6840,_0x97fe36){var _0x23e354=function(_0x5de5d7){while(--_0x5de5d7){_0x4c6840['push'](_0x4c6840['shift']());}};_0x23e354(++_0x97fe36);}(_0x46de,0x1a0));var _0xe46d=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0x46de[_0x545a3a];return _0x5a5493;};'use strict';var multer=require('multer');var util=require(_0xe46d('0x0'));var path=require('path');var timeout=require(_0xe46d('0x1'));var express=require(_0xe46d('0x2'));var router=express[_0xe46d('0x3')]();var auth=require(_0xe46d('0x4'));var interaction=require(_0xe46d('0x5'));var config=require(_0xe46d('0x6'));var controller=require(_0xe46d('0x7'));router[_0xe46d('0x8')]('/',auth['isAuthenticated'](),controller[_0xe46d('0x9')]);router['get']('/:id',auth[_0xe46d('0xa')](),controller[_0xe46d('0xb')]);router[_0xe46d('0x8')](_0xe46d('0xc'),auth[_0xe46d('0xa')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xe46d('0xa')](),controller[_0xe46d('0xd')]);router['post']('/',auth[_0xe46d('0xa')](),controller[_0xe46d('0xe')]);router[_0xe46d('0xf')](_0xe46d('0xc'),auth[_0xe46d('0xa')](),controller[_0xe46d('0x10')]);router[_0xe46d('0x11')](_0xe46d('0x12'),auth[_0xe46d('0xa')](),controller[_0xe46d('0x13')]);router[_0xe46d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe46d('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 30bb75e..7dbee7b 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 _0x8ed2=['newTab','sequelize','STRING','ENUM','basic','integrationTab'];(function(_0x458487,_0x6e9253){var _0x4dfbda=function(_0x2e5575){while(--_0x2e5575){_0x458487['push'](_0x458487['shift']());}};_0x4dfbda(++_0x6e9253);}(_0x8ed2,0x1c3));var _0x28ed=function(_0x4c96ae,_0x53f489){_0x4c96ae=_0x4c96ae-0x0;var _0x512153=_0x8ed2[_0x4c96ae];return _0x512153;};'use strict';var Sequelize=require(_0x28ed('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x28ed('0x1')]},'remoteUri':{'type':Sequelize[_0x28ed('0x1')]},'authType':{'type':Sequelize[_0x28ed('0x2')](_0x28ed('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x28ed('0x1')]},'consumerKey':{'type':Sequelize[_0x28ed('0x1')]},'consumerSecret':{'type':Sequelize[_0x28ed('0x1')]},'token':{'type':Sequelize[_0x28ed('0x1')]},'tokenSecret':{'type':Sequelize[_0x28ed('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x28ed('0x2')](_0x28ed('0x4'),_0x28ed('0x5')),'defaultValue':_0x28ed('0x4')}}; \ No newline at end of file +var _0xd7d5=['integrationTab','newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xd7d5,0xa3));var _0x5d7d=function(_0x2eed1f,_0x3a2f67){_0x2eed1f=_0x2eed1f-0x0;var _0x418a4c=_0xd7d5[_0x2eed1f];return _0x418a4c;};'use strict';var Sequelize=require(_0x5d7d('0x0'));module[_0x5d7d('0x1')]={'name':{'type':Sequelize[_0x5d7d('0x2')]},'description':{'type':Sequelize[_0x5d7d('0x2')]},'username':{'type':Sequelize[_0x5d7d('0x2')]},'remoteUri':{'type':Sequelize[_0x5d7d('0x2')]},'authType':{'type':Sequelize[_0x5d7d('0x3')](_0x5d7d('0x4')),'defaultValue':_0x5d7d('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x5d7d('0x2')]},'consumerSecret':{'type':Sequelize[_0x5d7d('0x2')]},'token':{'type':Sequelize[_0x5d7d('0x2')]},'tokenSecret':{'type':Sequelize[_0x5d7d('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5d7d('0x3')](_0x5d7d('0x5'),_0x5d7d('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 19b16c9..7950692 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 _0x89c4=['lastIndexOf','GET','application/json','basic','headers','Authorization','format','%s:%s','concat','_embedded','entries','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','client','then','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','name','send','index','DeskAccount','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','key','options','includeAll','include','findAll','show','params','rawAttributes','find','create','body','findOne','getConfigurations','nolimit','addConfiguration','AccountId','getSubjects','channel','type','DeskConfiguration','DeskField','Subjects','Descriptions','getFields','priority','remoteUri','authType','password','consumerKey','token','tokenSecret','slice','substring'];(function(_0x3338bc,_0x561f1b){var _0x4e3ec9=function(_0x28629a){while(--_0x28629a){_0x3338bc['push'](_0x3338bc['shift']());}};_0x4e3ec9(++_0x561f1b);}(_0x89c4,0x82));var _0x489c=function(_0x321f61,_0x5d4f49){_0x321f61=_0x321f61-0x0;var _0x2e05e4=_0x89c4[_0x321f61];return _0x2e05e4;};'use strict';var pdf=require(_0x489c('0x0'));var emlformat=require(_0x489c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x489c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x489c('0x3'));var BPromise=require(_0x489c('0x4'));var Mustache=require(_0x489c('0x5'));var util=require(_0x489c('0x6'));var path=require(_0x489c('0x7'));var sox=require(_0x489c('0x8'));var csv=require(_0x489c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x489c('0xa'));var squel=require(_0x489c('0xb'));var crypto=require(_0x489c('0xc'));var jsforce=require(_0x489c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x489c('0xe'));var Papa=require('papaparse');var authService=require(_0x489c('0xf'));var hardwareService=require(_0x489c('0x10'));var Redis=require(_0x489c('0x11'));var qs=require(_0x489c('0x12'));var logger=require(_0x489c('0x13'))(_0x489c('0x14'));var utils=require(_0x489c('0x15'));var config=require(_0x489c('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x489c('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x489c('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5340ce,_0x131622,_0x4908e0,_0x3be307){return new BPromise(function(_0x5d1b10,_0x305e40){var _0x45983e=_0x3be307||client;return _0x45983e['request'](_0x5340ce,_0x4908e0)[_0x489c('0x19')](function(_0x39725a){logger['info']('DeskAccount,\x20%s,\x20%s',_0x131622,_0x489c('0x1a'));logger['debug'](_0x489c('0x1b'),_0x131622,_0x489c('0x1a'),JSON[_0x489c('0x1c')](_0x39725a));if(_0x39725a[_0x489c('0x1d')]){if(_0x39725a[_0x489c('0x1d')][_0x489c('0x1e')]===0x1f4){logger[_0x489c('0x1d')](_0x489c('0x1f'),_0x131622,_0x39725a[_0x489c('0x1d')][_0x489c('0x20')]);return _0x305e40(_0x39725a[_0x489c('0x1d')][_0x489c('0x20')]);}logger[_0x489c('0x1d')](_0x489c('0x1f'),_0x131622,_0x39725a[_0x489c('0x1d')][_0x489c('0x20')]);return _0x5d1b10(_0x39725a[_0x489c('0x1d')][_0x489c('0x20')]);}else{logger['info'](_0x489c('0x1f'),_0x131622,_0x489c('0x1a'));_0x5d1b10(_0x39725a[_0x489c('0x21')][_0x489c('0x20')]);}})[_0x489c('0x22')](function(_0x5b6ea3){logger[_0x489c('0x1d')](_0x489c('0x1f'),_0x131622,_0x5b6ea3);_0x305e40(_0x5b6ea3);});});}function respondWithStatusCode(_0x37a59b,_0x552384){_0x552384=_0x552384||0xcc;return function(_0x2a6d5c){if(_0x2a6d5c){return _0x37a59b[_0x489c('0x23')](_0x552384);}return _0x37a59b['status'](_0x552384)[_0x489c('0x24')]();};}function respondWithResult(_0x7914ad,_0x49032e){_0x49032e=_0x49032e||0xc8;return function(_0x35db69){if(_0x35db69){return _0x7914ad['status'](_0x49032e)[_0x489c('0x25')](_0x35db69);}};}function respondWithFilteredResult(_0x1c1ad5,_0x57e82f){return function(_0x20cf09){if(_0x20cf09){var _0x1119bd=_0x20cf09[_0x489c('0x26')],_0x2c6863=_0x57e82f['offset'],_0x228c06=_0x57e82f[_0x489c('0x27')]+_0x57e82f[_0x489c('0x28')],_0x5285e4;if(_0x228c06>=_0x1119bd){_0x228c06=_0x1119bd;_0x5285e4=0xc8;}else{_0x5285e4=0xce;}_0x1c1ad5[_0x489c('0x29')](_0x5285e4);return _0x1c1ad5[_0x489c('0x2a')](_0x489c('0x2b'),_0x2c6863+'-'+_0x228c06+'/'+_0x1119bd)[_0x489c('0x25')](_0x20cf09);}return null;};}function patchUpdates(_0x521e31){return function(_0x79b260){try{jsonpatch[_0x489c('0x2c')](_0x79b260,_0x521e31,!![]);}catch(_0x4f72a8){return BPromise[_0x489c('0x2d')](_0x4f72a8);}return _0x79b260[_0x489c('0x2e')]();};}function saveUpdates(_0x58b523,_0x1fe531){return function(_0x21d1ec){if(_0x21d1ec){return _0x21d1ec[_0x489c('0x2f')](_0x58b523)[_0x489c('0x19')](function(_0x4abb20){return _0x4abb20;});}return null;};}function removeEntity(_0x375758,_0x335436){return function(_0x4a7128){if(_0x4a7128){return _0x4a7128[_0x489c('0x30')]()[_0x489c('0x19')](function(){_0x375758[_0x489c('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a097,_0xd33942){return function(_0x25a77e){if(!_0x25a77e){_0x44a097[_0x489c('0x23')](0x194);}return _0x25a77e;};}function handleError(_0x1a6dd9,_0x3833d4){_0x3833d4=_0x3833d4||0x1f4;return function(_0x49b3b9){logger[_0x489c('0x1d')](_0x49b3b9['stack']);if(_0x49b3b9[_0x489c('0x31')]){delete _0x49b3b9[_0x489c('0x31')];}_0x1a6dd9[_0x489c('0x29')](_0x3833d4)[_0x489c('0x32')](_0x49b3b9);};}exports[_0x489c('0x33')]=function(_0x2b8b80,_0x2d5182){var _0x306e5d={},_0x3980a5={},_0xd4abe4={'count':0x0,'rows':[]};var _0x4a02a2=db[_0x489c('0x34')]['rawAttributes'];_0x3980a5[_0x489c('0x35')]=_[_0x489c('0x36')](_0x4a02a2);_0x3980a5[_0x489c('0x37')]=_[_0x489c('0x36')](_0x2b8b80['query']);_0x3980a5[_0x489c('0x38')]=_[_0x489c('0x39')](_0x3980a5[_0x489c('0x35')],_0x3980a5[_0x489c('0x37')]);_0x306e5d[_0x489c('0x3a')]=_[_0x489c('0x39')](_0x3980a5[_0x489c('0x35')],qs['fields'](_0x2b8b80[_0x489c('0x37')][_0x489c('0x3b')]));_0x306e5d[_0x489c('0x3a')]=_0x306e5d[_0x489c('0x3a')][_0x489c('0x3c')]?_0x306e5d['attributes']:_0x3980a5[_0x489c('0x35')];if(!_0x2b8b80['query'][_0x489c('0x3d')]('nolimit')){_0x306e5d[_0x489c('0x28')]=qs[_0x489c('0x28')](_0x2b8b80[_0x489c('0x37')][_0x489c('0x28')]);_0x306e5d[_0x489c('0x27')]=qs[_0x489c('0x27')](_0x2b8b80[_0x489c('0x37')][_0x489c('0x27')]);}_0x306e5d[_0x489c('0x3e')]=qs[_0x489c('0x3f')](_0x2b8b80[_0x489c('0x37')][_0x489c('0x3f')]);_0x306e5d[_0x489c('0x40')]=qs[_0x489c('0x38')](_[_0x489c('0x41')](_0x2b8b80['query'],_0x3980a5['filters']));if(_0x2b8b80[_0x489c('0x37')][_0x489c('0x42')]){_0x306e5d[_0x489c('0x40')]=_[_0x489c('0x43')](_0x306e5d['where'],{'$or':_[_0x489c('0x44')](_0x4a02a2,function(_0x736d7c){if(_0x736d7c['type'][_0x489c('0x45')]!=='VIRTUAL'){var _0xc8ded3={};_0xc8ded3[_0x736d7c['field']]={'$like':'%'+_0x2b8b80[_0x489c('0x37')][_0x489c('0x42')]+'%'};return _0xc8ded3;}})});}_0x306e5d=_[_0x489c('0x43')]({},_0x306e5d,_0x2b8b80[_0x489c('0x46')]);var _0x259eb7={'where':_0x306e5d[_0x489c('0x40')]};return db[_0x489c('0x34')][_0x489c('0x26')](_0x259eb7)[_0x489c('0x19')](function(_0x2c08dd){_0xd4abe4[_0x489c('0x26')]=_0x2c08dd;if(_0x2b8b80[_0x489c('0x37')][_0x489c('0x47')]){_0x306e5d[_0x489c('0x48')]=[{'all':!![]}];}return db[_0x489c('0x34')][_0x489c('0x49')](_0x306e5d);})[_0x489c('0x19')](function(_0x7804a4){_0xd4abe4['rows']=_0x7804a4;return _0xd4abe4;})[_0x489c('0x19')](respondWithFilteredResult(_0x2d5182,_0x306e5d))['catch'](handleError(_0x2d5182,null));};exports[_0x489c('0x4a')]=function(_0x174d73,_0x54abbc){var _0x1ca196={'raw':![],'where':{'id':_0x174d73[_0x489c('0x4b')]['id']}},_0x319ff7={};_0x319ff7['model']=_['keys'](db[_0x489c('0x34')][_0x489c('0x4c')]);_0x319ff7['query']=_[_0x489c('0x36')](_0x174d73[_0x489c('0x37')]);_0x319ff7[_0x489c('0x38')]=_[_0x489c('0x39')](_0x319ff7[_0x489c('0x35')],_0x319ff7[_0x489c('0x37')]);_0x1ca196[_0x489c('0x3a')]=_[_0x489c('0x39')](_0x319ff7[_0x489c('0x35')],qs[_0x489c('0x3b')](_0x174d73[_0x489c('0x37')][_0x489c('0x3b')]));_0x1ca196[_0x489c('0x3a')]=_0x1ca196[_0x489c('0x3a')][_0x489c('0x3c')]?_0x1ca196[_0x489c('0x3a')]:_0x319ff7[_0x489c('0x35')];if(_0x174d73[_0x489c('0x37')][_0x489c('0x47')]){_0x1ca196[_0x489c('0x48')]=[{'all':!![]}];}_0x1ca196=_[_0x489c('0x43')]({},_0x1ca196,_0x174d73['options']);return db[_0x489c('0x34')][_0x489c('0x4d')](_0x1ca196)[_0x489c('0x19')](handleEntityNotFound(_0x54abbc,null))['then'](respondWithResult(_0x54abbc,null))['catch'](handleError(_0x54abbc,null));};exports[_0x489c('0x4e')]=function(_0x2c1606,_0x4357cb){return db[_0x489c('0x34')]['create'](_0x2c1606[_0x489c('0x4f')],{})[_0x489c('0x19')](respondWithResult(_0x4357cb,0xc9))['catch'](handleError(_0x4357cb,null));};exports[_0x489c('0x2f')]=function(_0x497f4a,_0x48a8ca){if(_0x497f4a[_0x489c('0x4f')]['id']){delete _0x497f4a[_0x489c('0x4f')]['id'];}return db[_0x489c('0x34')][_0x489c('0x4d')]({'where':{'id':_0x497f4a[_0x489c('0x4b')]['id']}})[_0x489c('0x19')](handleEntityNotFound(_0x48a8ca,null))[_0x489c('0x19')](saveUpdates(_0x497f4a[_0x489c('0x4f')],null))[_0x489c('0x19')](respondWithResult(_0x48a8ca,null))[_0x489c('0x22')](handleError(_0x48a8ca,null));};exports[_0x489c('0x30')]=function(_0x22c226,_0x5bfd66){return db[_0x489c('0x34')][_0x489c('0x4d')]({'where':{'id':_0x22c226[_0x489c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5bfd66,null))[_0x489c('0x19')](removeEntity(_0x5bfd66,null))['catch'](handleError(_0x5bfd66,null));};exports['getConfigurations']=function(_0x5bbede,_0x3c9dbb,_0xc2a8f){var _0xf56eec={};var _0x3db7c1={};var _0x4091f1;var _0x135077;return db[_0x489c('0x34')][_0x489c('0x50')]({'where':{'id':_0x5bbede[_0x489c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c9dbb,null))[_0x489c('0x19')](function(_0x4734b0){if(_0x4734b0){_0x4091f1=_0x4734b0;_0x3db7c1[_0x489c('0x35')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x3db7c1[_0x489c('0x37')]=_[_0x489c('0x36')](_0x5bbede[_0x489c('0x37')]);_0x3db7c1[_0x489c('0x38')]=_[_0x489c('0x39')](_0x3db7c1[_0x489c('0x35')],_0x3db7c1[_0x489c('0x37')]);_0xf56eec['attributes']=_[_0x489c('0x39')](_0x3db7c1[_0x489c('0x35')],qs['fields'](_0x5bbede['query'][_0x489c('0x3b')]));_0xf56eec[_0x489c('0x3a')]=_0xf56eec[_0x489c('0x3a')][_0x489c('0x3c')]?_0xf56eec['attributes']:_0x3db7c1['model'];_0xf56eec[_0x489c('0x3e')]=qs['sort'](_0x5bbede[_0x489c('0x37')][_0x489c('0x3f')]);_0xf56eec[_0x489c('0x40')]=qs[_0x489c('0x38')](_['pick'](_0x5bbede['query'],_0x3db7c1[_0x489c('0x38')]));if(_0x5bbede['query'][_0x489c('0x42')]){_0xf56eec[_0x489c('0x40')]=_[_0x489c('0x43')](_0xf56eec[_0x489c('0x40')],{'$or':_[_0x489c('0x44')](_0xf56eec[_0x489c('0x3a')],function(_0x267bc0){var _0x3f0f46={};_0x3f0f46[_0x267bc0]={'$like':'%'+_0x5bbede[_0x489c('0x37')][_0x489c('0x42')]+'%'};return _0x3f0f46;})});}_0xf56eec=_[_0x489c('0x43')]({},_0xf56eec,_0x5bbede['options']);return _0x4091f1[_0x489c('0x51')](_0xf56eec);}})['then'](function(_0x3d09bc){if(_0x3d09bc){_0x135077=_0x3d09bc[_0x489c('0x3c')];if(!_0x5bbede['query'][_0x489c('0x3d')](_0x489c('0x52'))){_0xf56eec[_0x489c('0x28')]=qs['limit'](_0x5bbede[_0x489c('0x37')]['limit']);_0xf56eec[_0x489c('0x27')]=qs['offset'](_0x5bbede['query'][_0x489c('0x27')]);}return _0x4091f1[_0x489c('0x51')](_0xf56eec);}})[_0x489c('0x19')](function(_0x419a3a){if(_0x419a3a){return _0x419a3a?{'count':_0x135077,'rows':_0x419a3a}:null;}})[_0x489c('0x19')](respondWithResult(_0x3c9dbb,null))['catch'](handleError(_0x3c9dbb,null));};exports[_0x489c('0x53')]=function(_0x5d04aa,_0x5f14e4,_0x561876){if(_0x5d04aa[_0x489c('0x4f')]['id']){delete _0x5d04aa[_0x489c('0x4f')]['id'];}return db['DeskAccount'][_0x489c('0x50')]({'where':{'id':_0x5d04aa[_0x489c('0x4b')]['id']}})[_0x489c('0x19')](handleEntityNotFound(_0x5f14e4,null))[_0x489c('0x19')](function(_0x38ee40){if(_0x38ee40){_0x5d04aa[_0x489c('0x4f')][_0x489c('0x54')]=_0x38ee40['id'];_0x5d04aa[_0x489c('0x4f')]['Subjects']=integrations[_0x489c('0x55')](_0x5d04aa['body'][_0x489c('0x56')],_0x5d04aa['body'][_0x489c('0x57')]);_0x5d04aa[_0x489c('0x4f')]['Descriptions']=integrations['getDescriptions'](_0x5d04aa[_0x489c('0x4f')][_0x489c('0x56')],_0x5d04aa['body'][_0x489c('0x57')]);return db[_0x489c('0x58')][_0x489c('0x4e')](_0x5d04aa[_0x489c('0x4f')],{'include':[{'model':db[_0x489c('0x59')],'as':_0x489c('0x5a')},{'model':db['DeskField'],'as':_0x489c('0x5b')}]});}return null;})[_0x489c('0x19')](respondWithResult(_0x5f14e4,null))['catch'](handleError(_0x5f14e4,null));};exports[_0x489c('0x5c')]=function(_0xad1d70,_0x2ac30f,_0x47ed77){var _0x132999=[{'name':_0x489c('0x5d'),'label':_0x489c('0x5d'),'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 _0x38f98b='';return db['DeskAccount'][_0x489c('0x50')]({'where':{'id':_0xad1d70['params']['id']},'attributes':['id',_0x489c('0x5e'),_0x489c('0x5f'),'username',_0x489c('0x60'),_0x489c('0x61'),'consumerSecret',_0x489c('0x62'),_0x489c('0x63')]})[_0x489c('0x19')](handleEntityNotFound(_0x2ac30f,null))['then'](function(_0x39a687){if(_0x39a687){_0x38f98b=_0x39a687[_0x489c('0x5e')];var _0x485bf3=_0x38f98b[_0x489c('0x64')](-0x1);if(_0x485bf3==='/'){_0x38f98b=_0x38f98b[_0x489c('0x65')](0x0,_0x38f98b[_0x489c('0x66')](_0x485bf3));}var _0x1648f4={'method':_0x489c('0x67'),'uri':util['format']('%s/custom_fields',_0x38f98b),'headers':{'Content-Type':'application/json','Accept':_0x489c('0x68')},'json':!![]};if(_0x39a687['authType']===_0x489c('0x69')){_0x1648f4[_0x489c('0x6a')][_0x489c('0x6b')]=util['format']('Basic\x20%s',new Buffer(util[_0x489c('0x6c')](_0x489c('0x6d'),_0x39a687['username'],_0x39a687[_0x489c('0x60')]))['toString']('base64'));}return rp(_0x1648f4)[_0x489c('0x19')](function(_0x2a673c){return _0x132999[_0x489c('0x6e')](_[_0x489c('0x44')](_0x2a673c[_0x489c('0x6f')][_0x489c('0x70')],function(_0x3a0740){return{'id':_0x3a0740[_0x489c('0x31')],'name':_0x3a0740[_0x489c('0x31')],'type':_0x3a0740[_0x489c('0x57')],'active':_0x3a0740['active'],'label':_0x3a0740['label'],'custom':!![]};}));});}})['then'](function(_0x3929a7){return{'count':_0x3929a7[_0x489c('0x3c')],'rows':_0x3929a7};})[_0x489c('0x19')](respondWithResult(_0x2ac30f,null))['catch'](function(_0x3e9629){var _0x121928=_0xad1d70[_0x489c('0x37')]['test']?0x1f4:_0x3e9629[_0x489c('0x71')]||0x1f4;logger['error'](_0x489c('0x72'),_0x489c('0x5c'),_0x121928,JSON[_0x489c('0x1c')](_0x3e9629));delete _0x3e9629[_0x489c('0x31')];if(_0x121928===0x191){_0x121928=0x190;}_0x2ac30f[_0x489c('0x29')](_0x121928)[_0x489c('0x32')](_0xad1d70['query']['test']?{'message':_0x489c('0x73'),'statusCode':_0x3e9629[_0x489c('0x71')]}:_0x3e9629);});}; \ No newline at end of file +var _0xea28=['length','nolimit','limit','order','sort','where','pick','type','key','VIRTUAL','field','filter','options','include','findAll','rows','show','params','keys','includeAll','merge','create','body','find','destroy','getConfigurations','findOne','addConfiguration','Subjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','basic','headers','format','%s:%s','toString','map','_embedded','entries','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','count','offset','Content-Range','json','apply','reject','save','stack','name','send','index','DeskAccount','rawAttributes','model','query','filters','intersection','attributes','fields'];(function(_0x36313f,_0x50450e){var _0x3bbff6=function(_0x44aad6){while(--_0x44aad6){_0x36313f['push'](_0x36313f['shift']());}};_0x3bbff6(++_0x50450e);}(_0xea28,0x13a));var _0x8ea2=function(_0x2a126d,_0x5327ad){_0x2a126d=_0x2a126d-0x0;var _0x370b59=_0xea28[_0x2a126d];return _0x370b59;};'use strict';var pdf=require(_0x8ea2('0x0'));var emlformat=require(_0x8ea2('0x1'));var rimraf=require(_0x8ea2('0x2'));var zipdir=require(_0x8ea2('0x3'));var jsonpatch=require(_0x8ea2('0x4'));var rp=require(_0x8ea2('0x5'));var moment=require(_0x8ea2('0x6'));var BPromise=require(_0x8ea2('0x7'));var Mustache=require('mustache');var util=require(_0x8ea2('0x8'));var path=require(_0x8ea2('0x9'));var sox=require(_0x8ea2('0xa'));var csv=require('to-csv');var ejs=require(_0x8ea2('0xb'));var fs=require('fs');var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0x11'));var querystring=require(_0x8ea2('0x12'));var Papa=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var hardwareService=require(_0x8ea2('0x15'));var Redis=require(_0x8ea2('0x16'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8ea2('0x17'));var utils=require(_0x8ea2('0x18'));var config=require(_0x8ea2('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8ea2('0x1a'));var jayson=require(_0x8ea2('0x1b'));var client=jayson[_0x8ea2('0x1c')][_0x8ea2('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xe47c0e,_0x5e662e,_0x2879d6,_0x553154){return new BPromise(function(_0x4b2192,_0x772bad){var _0x4726a7=_0x553154||client;return _0x4726a7[_0x8ea2('0x1e')](_0xe47c0e,_0x2879d6)[_0x8ea2('0x1f')](function(_0x393faf){logger[_0x8ea2('0x20')](_0x8ea2('0x21'),_0x5e662e,_0x8ea2('0x22'));logger[_0x8ea2('0x23')](_0x8ea2('0x24'),_0x5e662e,_0x8ea2('0x22'),JSON[_0x8ea2('0x25')](_0x393faf));if(_0x393faf[_0x8ea2('0x26')]){if(_0x393faf[_0x8ea2('0x26')][_0x8ea2('0x27')]===0x1f4){logger[_0x8ea2('0x26')](_0x8ea2('0x21'),_0x5e662e,_0x393faf[_0x8ea2('0x26')][_0x8ea2('0x28')]);return _0x772bad(_0x393faf[_0x8ea2('0x26')][_0x8ea2('0x28')]);}logger[_0x8ea2('0x26')]('DeskAccount,\x20%s,\x20%s',_0x5e662e,_0x393faf['error'][_0x8ea2('0x28')]);return _0x4b2192(_0x393faf[_0x8ea2('0x26')][_0x8ea2('0x28')]);}else{logger['info'](_0x8ea2('0x21'),_0x5e662e,_0x8ea2('0x22'));_0x4b2192(_0x393faf['result'][_0x8ea2('0x28')]);}})[_0x8ea2('0x29')](function(_0x37229a){logger[_0x8ea2('0x26')](_0x8ea2('0x21'),_0x5e662e,_0x37229a);_0x772bad(_0x37229a);});});}function respondWithStatusCode(_0xe5c943,_0x199417){_0x199417=_0x199417||0xcc;return function(_0x1e4cc9){if(_0x1e4cc9){return _0xe5c943[_0x8ea2('0x2a')](_0x199417);}return _0xe5c943['status'](_0x199417)[_0x8ea2('0x2b')]();};}function respondWithResult(_0x4f48bd,_0x2660cc){_0x2660cc=_0x2660cc||0xc8;return function(_0x42bec8){if(_0x42bec8){return _0x4f48bd[_0x8ea2('0x2c')](_0x2660cc)['json'](_0x42bec8);}};}function respondWithFilteredResult(_0x53ed43,_0x2e4da3){return function(_0x4dc7bf){if(_0x4dc7bf){var _0x200a49=_0x4dc7bf[_0x8ea2('0x2d')],_0x4e786d=_0x2e4da3[_0x8ea2('0x2e')],_0x3be291=_0x2e4da3['offset']+_0x2e4da3['limit'],_0x12fa37;if(_0x3be291>=_0x200a49){_0x3be291=_0x200a49;_0x12fa37=0xc8;}else{_0x12fa37=0xce;}_0x53ed43[_0x8ea2('0x2c')](_0x12fa37);return _0x53ed43['set'](_0x8ea2('0x2f'),_0x4e786d+'-'+_0x3be291+'/'+_0x200a49)[_0x8ea2('0x30')](_0x4dc7bf);}return null;};}function patchUpdates(_0x24f187){return function(_0x41f482){try{jsonpatch[_0x8ea2('0x31')](_0x41f482,_0x24f187,!![]);}catch(_0x3eb7ac){return BPromise[_0x8ea2('0x32')](_0x3eb7ac);}return _0x41f482[_0x8ea2('0x33')]();};}function saveUpdates(_0x19e868,_0x9c5fac){return function(_0x56d914){if(_0x56d914){return _0x56d914['update'](_0x19e868)[_0x8ea2('0x1f')](function(_0x188553){return _0x188553;});}return null;};}function removeEntity(_0x53d71c,_0x4a110f){return function(_0x1ee7b2){if(_0x1ee7b2){return _0x1ee7b2['destroy']()[_0x8ea2('0x1f')](function(){_0x53d71c[_0x8ea2('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17b21c,_0x38f3d5){return function(_0x33abc8){if(!_0x33abc8){_0x17b21c['sendStatus'](0x194);}return _0x33abc8;};}function handleError(_0x4ef8ea,_0x49a252){_0x49a252=_0x49a252||0x1f4;return function(_0x3880c3){logger[_0x8ea2('0x26')](_0x3880c3[_0x8ea2('0x34')]);if(_0x3880c3['name']){delete _0x3880c3[_0x8ea2('0x35')];}_0x4ef8ea[_0x8ea2('0x2c')](_0x49a252)[_0x8ea2('0x36')](_0x3880c3);};}exports[_0x8ea2('0x37')]=function(_0x253031,_0x3a081b){var _0x35e17a={},_0x1fc76a={},_0x5e9b1f={'count':0x0,'rows':[]};var _0x955ef3=db[_0x8ea2('0x38')][_0x8ea2('0x39')];_0x1fc76a[_0x8ea2('0x3a')]=_['keys'](_0x955ef3);_0x1fc76a[_0x8ea2('0x3b')]=_['keys'](_0x253031[_0x8ea2('0x3b')]);_0x1fc76a[_0x8ea2('0x3c')]=_[_0x8ea2('0x3d')](_0x1fc76a[_0x8ea2('0x3a')],_0x1fc76a['query']);_0x35e17a[_0x8ea2('0x3e')]=_['intersection'](_0x1fc76a['model'],qs[_0x8ea2('0x3f')](_0x253031['query'][_0x8ea2('0x3f')]));_0x35e17a[_0x8ea2('0x3e')]=_0x35e17a[_0x8ea2('0x3e')][_0x8ea2('0x40')]?_0x35e17a[_0x8ea2('0x3e')]:_0x1fc76a['model'];if(!_0x253031[_0x8ea2('0x3b')]['hasOwnProperty'](_0x8ea2('0x41'))){_0x35e17a[_0x8ea2('0x42')]=qs[_0x8ea2('0x42')](_0x253031[_0x8ea2('0x3b')]['limit']);_0x35e17a[_0x8ea2('0x2e')]=qs['offset'](_0x253031[_0x8ea2('0x3b')]['offset']);}_0x35e17a[_0x8ea2('0x43')]=qs[_0x8ea2('0x44')](_0x253031[_0x8ea2('0x3b')][_0x8ea2('0x44')]);_0x35e17a[_0x8ea2('0x45')]=qs[_0x8ea2('0x3c')](_[_0x8ea2('0x46')](_0x253031['query'],_0x1fc76a['filters']));if(_0x253031[_0x8ea2('0x3b')]['filter']){_0x35e17a['where']=_['merge'](_0x35e17a[_0x8ea2('0x45')],{'$or':_['map'](_0x955ef3,function(_0x40a532){if(_0x40a532[_0x8ea2('0x47')][_0x8ea2('0x48')]!==_0x8ea2('0x49')){var _0x989d9b={};_0x989d9b[_0x40a532[_0x8ea2('0x4a')]]={'$like':'%'+_0x253031[_0x8ea2('0x3b')][_0x8ea2('0x4b')]+'%'};return _0x989d9b;}})});}_0x35e17a=_['merge']({},_0x35e17a,_0x253031[_0x8ea2('0x4c')]);var _0x1ef615={'where':_0x35e17a[_0x8ea2('0x45')]};return db['DeskAccount'][_0x8ea2('0x2d')](_0x1ef615)[_0x8ea2('0x1f')](function(_0x8005f9){_0x5e9b1f[_0x8ea2('0x2d')]=_0x8005f9;if(_0x253031[_0x8ea2('0x3b')]['includeAll']){_0x35e17a[_0x8ea2('0x4d')]=[{'all':!![]}];}return db[_0x8ea2('0x38')][_0x8ea2('0x4e')](_0x35e17a);})['then'](function(_0x99fe91){_0x5e9b1f[_0x8ea2('0x4f')]=_0x99fe91;return _0x5e9b1f;})[_0x8ea2('0x1f')](respondWithFilteredResult(_0x3a081b,_0x35e17a))[_0x8ea2('0x29')](handleError(_0x3a081b,null));};exports[_0x8ea2('0x50')]=function(_0x3ca1c8,_0x3f51ae){var _0x26e2d5={'raw':![],'where':{'id':_0x3ca1c8[_0x8ea2('0x51')]['id']}},_0x45f15e={};_0x45f15e[_0x8ea2('0x3a')]=_[_0x8ea2('0x52')](db[_0x8ea2('0x38')][_0x8ea2('0x39')]);_0x45f15e['query']=_[_0x8ea2('0x52')](_0x3ca1c8[_0x8ea2('0x3b')]);_0x45f15e[_0x8ea2('0x3c')]=_[_0x8ea2('0x3d')](_0x45f15e[_0x8ea2('0x3a')],_0x45f15e[_0x8ea2('0x3b')]);_0x26e2d5[_0x8ea2('0x3e')]=_[_0x8ea2('0x3d')](_0x45f15e['model'],qs[_0x8ea2('0x3f')](_0x3ca1c8[_0x8ea2('0x3b')][_0x8ea2('0x3f')]));_0x26e2d5['attributes']=_0x26e2d5['attributes'][_0x8ea2('0x40')]?_0x26e2d5[_0x8ea2('0x3e')]:_0x45f15e[_0x8ea2('0x3a')];if(_0x3ca1c8['query'][_0x8ea2('0x53')]){_0x26e2d5[_0x8ea2('0x4d')]=[{'all':!![]}];}_0x26e2d5=_[_0x8ea2('0x54')]({},_0x26e2d5,_0x3ca1c8[_0x8ea2('0x4c')]);return db[_0x8ea2('0x38')]['find'](_0x26e2d5)['then'](handleEntityNotFound(_0x3f51ae,null))[_0x8ea2('0x1f')](respondWithResult(_0x3f51ae,null))[_0x8ea2('0x29')](handleError(_0x3f51ae,null));};exports[_0x8ea2('0x55')]=function(_0x5e4268,_0x18cbe9){return db[_0x8ea2('0x38')][_0x8ea2('0x55')](_0x5e4268['body'],{})['then'](respondWithResult(_0x18cbe9,0xc9))['catch'](handleError(_0x18cbe9,null));};exports['update']=function(_0x50d0b1,_0x424f29){if(_0x50d0b1[_0x8ea2('0x56')]['id']){delete _0x50d0b1['body']['id'];}return db['DeskAccount'][_0x8ea2('0x57')]({'where':{'id':_0x50d0b1[_0x8ea2('0x51')]['id']}})[_0x8ea2('0x1f')](handleEntityNotFound(_0x424f29,null))['then'](saveUpdates(_0x50d0b1[_0x8ea2('0x56')],null))[_0x8ea2('0x1f')](respondWithResult(_0x424f29,null))['catch'](handleError(_0x424f29,null));};exports[_0x8ea2('0x58')]=function(_0x28e56a,_0x293dd8){return db[_0x8ea2('0x38')][_0x8ea2('0x57')]({'where':{'id':_0x28e56a['params']['id']}})['then'](handleEntityNotFound(_0x293dd8,null))['then'](removeEntity(_0x293dd8,null))[_0x8ea2('0x29')](handleError(_0x293dd8,null));};exports[_0x8ea2('0x59')]=function(_0x2b95b0,_0x74520e,_0x1d6a60){var _0x3836c3={};var _0x36fda3={};var _0x5265e7;var _0x480ed2;return db['DeskAccount'][_0x8ea2('0x5a')]({'where':{'id':_0x2b95b0[_0x8ea2('0x51')]['id']}})[_0x8ea2('0x1f')](handleEntityNotFound(_0x74520e,null))[_0x8ea2('0x1f')](function(_0x57720d){if(_0x57720d){_0x5265e7=_0x57720d;_0x36fda3[_0x8ea2('0x3a')]=_[_0x8ea2('0x52')](db['DeskConfiguration'][_0x8ea2('0x39')]);_0x36fda3[_0x8ea2('0x3b')]=_[_0x8ea2('0x52')](_0x2b95b0[_0x8ea2('0x3b')]);_0x36fda3[_0x8ea2('0x3c')]=_['intersection'](_0x36fda3['model'],_0x36fda3['query']);_0x3836c3[_0x8ea2('0x3e')]=_[_0x8ea2('0x3d')](_0x36fda3[_0x8ea2('0x3a')],qs[_0x8ea2('0x3f')](_0x2b95b0[_0x8ea2('0x3b')]['fields']));_0x3836c3[_0x8ea2('0x3e')]=_0x3836c3[_0x8ea2('0x3e')][_0x8ea2('0x40')]?_0x3836c3[_0x8ea2('0x3e')]:_0x36fda3['model'];_0x3836c3[_0x8ea2('0x43')]=qs['sort'](_0x2b95b0[_0x8ea2('0x3b')]['sort']);_0x3836c3[_0x8ea2('0x45')]=qs[_0x8ea2('0x3c')](_['pick'](_0x2b95b0['query'],_0x36fda3[_0x8ea2('0x3c')]));if(_0x2b95b0['query'][_0x8ea2('0x4b')]){_0x3836c3[_0x8ea2('0x45')]=_[_0x8ea2('0x54')](_0x3836c3[_0x8ea2('0x45')],{'$or':_['map'](_0x3836c3[_0x8ea2('0x3e')],function(_0x2eae97){var _0x39776d={};_0x39776d[_0x2eae97]={'$like':'%'+_0x2b95b0[_0x8ea2('0x3b')][_0x8ea2('0x4b')]+'%'};return _0x39776d;})});}_0x3836c3=_[_0x8ea2('0x54')]({},_0x3836c3,_0x2b95b0[_0x8ea2('0x4c')]);return _0x5265e7[_0x8ea2('0x59')](_0x3836c3);}})[_0x8ea2('0x1f')](function(_0x461aa4){if(_0x461aa4){_0x480ed2=_0x461aa4[_0x8ea2('0x40')];if(!_0x2b95b0[_0x8ea2('0x3b')]['hasOwnProperty'](_0x8ea2('0x41'))){_0x3836c3[_0x8ea2('0x42')]=qs[_0x8ea2('0x42')](_0x2b95b0[_0x8ea2('0x3b')][_0x8ea2('0x42')]);_0x3836c3[_0x8ea2('0x2e')]=qs[_0x8ea2('0x2e')](_0x2b95b0[_0x8ea2('0x3b')][_0x8ea2('0x2e')]);}return _0x5265e7[_0x8ea2('0x59')](_0x3836c3);}})[_0x8ea2('0x1f')](function(_0x35cfc5){if(_0x35cfc5){return _0x35cfc5?{'count':_0x480ed2,'rows':_0x35cfc5}:null;}})['then'](respondWithResult(_0x74520e,null))[_0x8ea2('0x29')](handleError(_0x74520e,null));};exports[_0x8ea2('0x5b')]=function(_0xb55bc6,_0x396f5b,_0x1cb87d){if(_0xb55bc6['body']['id']){delete _0xb55bc6['body']['id'];}return db['DeskAccount'][_0x8ea2('0x5a')]({'where':{'id':_0xb55bc6[_0x8ea2('0x51')]['id']}})[_0x8ea2('0x1f')](handleEntityNotFound(_0x396f5b,null))[_0x8ea2('0x1f')](function(_0x1d608f){if(_0x1d608f){_0xb55bc6[_0x8ea2('0x56')]['AccountId']=_0x1d608f['id'];_0xb55bc6[_0x8ea2('0x56')][_0x8ea2('0x5c')]=integrations['getSubjects'](_0xb55bc6['body'][_0x8ea2('0x5d')],_0xb55bc6[_0x8ea2('0x56')][_0x8ea2('0x47')]);_0xb55bc6[_0x8ea2('0x56')][_0x8ea2('0x5e')]=integrations[_0x8ea2('0x5f')](_0xb55bc6[_0x8ea2('0x56')]['channel'],_0xb55bc6[_0x8ea2('0x56')][_0x8ea2('0x47')]);return db[_0x8ea2('0x60')][_0x8ea2('0x55')](_0xb55bc6['body'],{'include':[{'model':db[_0x8ea2('0x61')],'as':_0x8ea2('0x5c')},{'model':db[_0x8ea2('0x61')],'as':'Descriptions'}]});}return null;})[_0x8ea2('0x1f')](respondWithResult(_0x396f5b,null))['catch'](handleError(_0x396f5b,null));};exports['getFields']=function(_0x188809,_0x452c82,_0x54db43){var _0x5a6543=[{'name':'priority','label':_0x8ea2('0x62'),'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 _0x4d1750='';return db['DeskAccount'][_0x8ea2('0x5a')]({'where':{'id':_0x188809[_0x8ea2('0x51')]['id']},'attributes':['id',_0x8ea2('0x63'),_0x8ea2('0x64'),_0x8ea2('0x65'),_0x8ea2('0x66'),_0x8ea2('0x67'),_0x8ea2('0x68'),_0x8ea2('0x69'),_0x8ea2('0x6a')]})[_0x8ea2('0x1f')](handleEntityNotFound(_0x452c82,null))[_0x8ea2('0x1f')](function(_0x1961a9){if(_0x1961a9){_0x4d1750=_0x1961a9[_0x8ea2('0x63')];var _0x5d28ae=_0x4d1750[_0x8ea2('0x6b')](-0x1);if(_0x5d28ae==='/'){_0x4d1750=_0x4d1750[_0x8ea2('0x6c')](0x0,_0x4d1750[_0x8ea2('0x6d')](_0x5d28ae));}var _0x47a6b7={'method':_0x8ea2('0x6e'),'uri':util['format'](_0x8ea2('0x6f'),_0x4d1750),'headers':{'Content-Type':'application/json','Accept':_0x8ea2('0x70')},'json':!![]};if(_0x1961a9['authType']===_0x8ea2('0x71')){_0x47a6b7[_0x8ea2('0x72')]['Authorization']=util[_0x8ea2('0x73')]('Basic\x20%s',new Buffer(util[_0x8ea2('0x73')](_0x8ea2('0x74'),_0x1961a9[_0x8ea2('0x65')],_0x1961a9[_0x8ea2('0x66')]))[_0x8ea2('0x75')]('base64'));}return rp(_0x47a6b7)['then'](function(_0x39d0d7){return _0x5a6543['concat'](_[_0x8ea2('0x76')](_0x39d0d7[_0x8ea2('0x77')][_0x8ea2('0x78')],function(_0x1c365e){return{'id':_0x1c365e[_0x8ea2('0x35')],'name':_0x1c365e[_0x8ea2('0x35')],'type':_0x1c365e['type'],'active':_0x1c365e['active'],'label':_0x1c365e['label'],'custom':!![]};}));});}})[_0x8ea2('0x1f')](function(_0x576075){return{'count':_0x576075[_0x8ea2('0x40')],'rows':_0x576075};})[_0x8ea2('0x1f')](respondWithResult(_0x452c82,null))[_0x8ea2('0x29')](function(_0x30a59a){var _0x244c30=_0x188809[_0x8ea2('0x3b')]['test']?0x1f4:_0x30a59a[_0x8ea2('0x79')]||0x1f4;logger[_0x8ea2('0x26')](_0x8ea2('0x7a'),_0x8ea2('0x7b'),_0x244c30,JSON[_0x8ea2('0x25')](_0x30a59a));delete _0x30a59a['name'];if(_0x244c30===0x191){_0x244c30=0x190;}_0x452c82['status'](_0x244c30)[_0x8ea2('0x36')](_0x188809[_0x8ea2('0x3b')][_0x8ea2('0x7c')]?{'message':_0x8ea2('0x7d'),'statusCode':_0x30a59a[_0x8ea2('0x79')]}:_0x30a59a);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 62c4fdd..2bd7c0e 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 _0x2542=['int_desk_accounts','lodash','util','../../config/logger','api','bluebird','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount'];(function(_0x475677,_0x59344c){var _0x224c87=function(_0x14721f){while(--_0x14721f){_0x475677['push'](_0x475677['shift']());}};_0x224c87(++_0x59344c);}(_0x2542,0x169));var _0x2254=function(_0x535635,_0x433900){_0x535635=_0x535635-0x0;var _0x4f034b=_0x2542[_0x535635];return _0x4f034b;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var attributes=require(_0x2254('0x5'));var integrations=require(_0x2254('0x6'));module[_0x2254('0x7')]=function(_0x456612,_0x76c902){return _0x456612['define'](_0x2254('0x8'),attributes,{'tableName':_0x2254('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5360=['int_desk_accounts','lodash','util','../../config/logger','api','request-promise','../../components/integrations/configuration','exports','DeskAccount'];(function(_0x27f7b6,_0x2dde24){var _0x22fd91=function(_0x2db13f){while(--_0x2db13f){_0x27f7b6['push'](_0x27f7b6['shift']());}};_0x22fd91(++_0x2dde24);}(_0x5360,0x157));var _0x0536=function(_0x322db4,_0x12f80c){_0x322db4=_0x322db4-0x0;var _0x4db433=_0x5360[_0x322db4];return _0x4db433;};'use strict';var _=require(_0x0536('0x0'));var util=require(_0x0536('0x1'));var logger=require(_0x0536('0x2'))(_0x0536('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0536('0x4'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x0536('0x5'));module[_0x0536('0x6')]=function(_0x5cdbb2,_0x521419){return _0x5cdbb2['define'](_0x0536('0x7'),attributes,{'tableName':_0x0536('0x8'),'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 d367ccf..661cce7 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 _0x2525=['../../config/logger','jayson/promise','client','http','then','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','info','result','GetDeskAccount','DeskAccount','options','raw','attributes','limit','include','model','map','debug','ShowDeskAccount','find','where','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x26046f,_0x40029c){var _0x1f80a3=function(_0x5efdc4){while(--_0x5efdc4){_0x26046f['push'](_0x26046f['shift']());}};_0x1f80a3(++_0x40029c);}(_0x2525,0x1f0));var _0x5252=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x2525[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x5252('0x0'));var util=require(_0x5252('0x1'));var moment=require(_0x5252('0x2'));var BPromise=require(_0x5252('0x3'));var rs=require(_0x5252('0x4'));var fs=require('fs');var Redis=require(_0x5252('0x5'));var db=require(_0x5252('0x6'))['db'];var utils=require(_0x5252('0x7'));var logger=require(_0x5252('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5252('0x9'));var client=jayson[_0x5252('0xa')][_0x5252('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ff1f2,_0x335660,_0x39279b){return new BPromise(function(_0x5e8442,_0x233f82){return client['request'](_0x3ff1f2,_0x39279b)[_0x5252('0xc')](function(_0x3c8d35){logger['info']('DeskAccount,\x20%s,\x20%s',_0x335660,_0x5252('0xd'));logger['debug'](_0x5252('0xe'),_0x335660,_0x5252('0xd'),JSON[_0x5252('0xf')](_0x3c8d35));if(_0x3c8d35[_0x5252('0x10')]){if(_0x3c8d35[_0x5252('0x10')][_0x5252('0x11')]===0x1f4){logger[_0x5252('0x10')](_0x5252('0x12'),_0x335660,_0x3c8d35[_0x5252('0x10')][_0x5252('0x13')]);return _0x233f82(_0x3c8d35[_0x5252('0x10')][_0x5252('0x13')]);}logger[_0x5252('0x10')](_0x5252('0x12'),_0x335660,_0x3c8d35['error']['message']);return _0x5e8442(_0x3c8d35[_0x5252('0x10')][_0x5252('0x13')]);}else{logger[_0x5252('0x14')](_0x5252('0x12'),_0x335660,_0x5252('0xd'));_0x5e8442(_0x3c8d35[_0x5252('0x15')][_0x5252('0x13')]);}})['catch'](function(_0x4b244a){logger['error'](_0x5252('0x12'),_0x335660,_0x4b244a);_0x233f82(_0x4b244a);});});}exports[_0x5252('0x16')]=function(_0x2ef8ec){var _0x10eb1e=this;return new Promise(function(_0x4034d2,_0x194767){return db[_0x5252('0x17')]['findAll']({'raw':_0x2ef8ec[_0x5252('0x18')]?_0x2ef8ec[_0x5252('0x18')][_0x5252('0x19')]===undefined?!![]:![]:!![],'where':_0x2ef8ec[_0x5252('0x18')]?_0x2ef8ec[_0x5252('0x18')]['where']||null:null,'attributes':_0x2ef8ec[_0x5252('0x18')]?_0x2ef8ec[_0x5252('0x18')][_0x5252('0x1a')]||null:null,'limit':_0x2ef8ec[_0x5252('0x18')]?_0x2ef8ec[_0x5252('0x18')][_0x5252('0x1b')]||null:null,'include':_0x2ef8ec['options']?_0x2ef8ec[_0x5252('0x18')][_0x5252('0x1c')]?_['map'](_0x2ef8ec['options']['include'],function(_0x509055){return{'model':db[_0x509055[_0x5252('0x1d')]],'as':_0x509055['as'],'attributes':_0x509055[_0x5252('0x1a')],'include':_0x509055['include']?_[_0x5252('0x1e')](_0x509055[_0x5252('0x1c')],function(_0x5976e5){return{'model':db[_0x5976e5['model']],'as':_0x5976e5['as'],'attributes':_0x5976e5[_0x5252('0x1a')],'include':_0x5976e5['include']?_[_0x5252('0x1e')](_0x5976e5[_0x5252('0x1c')],function(_0x117a01){return{'model':db[_0x117a01[_0x5252('0x1d')]],'as':_0x117a01['as'],'attributes':_0x117a01[_0x5252('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x537f52){logger[_0x5252('0x14')]('GetDeskAccount',_0x2ef8ec);logger[_0x5252('0x1f')]('GetDeskAccount',_0x2ef8ec,JSON['stringify'](_0x537f52));_0x4034d2(_0x537f52);})['catch'](function(_0x4ac8b8){logger[_0x5252('0x10')](_0x5252('0x16'),_0x4ac8b8[_0x5252('0x13')],_0x2ef8ec);_0x194767(_0x10eb1e['error'](0x1f4,_0x4ac8b8[_0x5252('0x13')]));});});};exports[_0x5252('0x20')]=function(_0x8fd7df){var _0x4b6d00=this;return new Promise(function(_0x346f0a,_0x33b146){return db[_0x5252('0x17')][_0x5252('0x21')]({'raw':_0x8fd7df['options']?_0x8fd7df[_0x5252('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x8fd7df[_0x5252('0x18')]?_0x8fd7df[_0x5252('0x18')][_0x5252('0x22')]||null:null,'attributes':_0x8fd7df['options']?_0x8fd7df[_0x5252('0x18')]['attributes']||null:null,'include':_0x8fd7df[_0x5252('0x18')]?_0x8fd7df[_0x5252('0x18')][_0x5252('0x1c')]?_[_0x5252('0x1e')](_0x8fd7df['options'][_0x5252('0x1c')],function(_0x580883){return{'model':db[_0x580883['model']],'as':_0x580883['as'],'attributes':_0x580883['attributes'],'include':_0x580883[_0x5252('0x1c')]?_['map'](_0x580883[_0x5252('0x1c')],function(_0x177f35){return{'model':db[_0x177f35[_0x5252('0x1d')]],'as':_0x177f35['as'],'attributes':_0x177f35[_0x5252('0x1a')],'include':_0x177f35['include']?_['map'](_0x177f35['include'],function(_0x4b1428){return{'model':db[_0x4b1428[_0x5252('0x1d')]],'as':_0x4b1428['as'],'attributes':_0x4b1428[_0x5252('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5252('0xc')](function(_0xe60837){logger['info'](_0x5252('0x20'),_0x8fd7df);logger[_0x5252('0x1f')]('ShowDeskAccount',_0x8fd7df,JSON[_0x5252('0xf')](_0xe60837));_0x346f0a(_0xe60837);})[_0x5252('0x23')](function(_0x43c1ce){logger['error']('ShowDeskAccount',_0x43c1ce[_0x5252('0x13')],_0x8fd7df);_0x33b146(_0x4b6d00[_0x5252('0x10')](0x1f4,_0x43c1ce[_0x5252('0x13')]));});});}; \ No newline at end of file +var _0xc2f4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','find','ShowDeskAccount','lodash','util','moment'];(function(_0xae5bbc,_0x2b8fd1){var _0x53fc11=function(_0x3dc39a){while(--_0x3dc39a){_0xae5bbc['push'](_0xae5bbc['shift']());}};_0x53fc11(++_0x2b8fd1);}(_0xc2f4,0x107));var _0x4c2f=function(_0x3460e3,_0x23d874){_0x3460e3=_0x3460e3-0x0;var _0x22a450=_0xc2f4[_0x3460e3];return _0x22a450;};'use strict';var _=require(_0x4c2f('0x0'));var util=require(_0x4c2f('0x1'));var moment=require(_0x4c2f('0x2'));var BPromise=require(_0x4c2f('0x3'));var rs=require(_0x4c2f('0x4'));var fs=require('fs');var Redis=require(_0x4c2f('0x5'));var db=require(_0x4c2f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c2f('0x7'))(_0x4c2f('0x8'));var config=require(_0x4c2f('0x9'));var jayson=require(_0x4c2f('0xa'));var client=jayson[_0x4c2f('0xb')][_0x4c2f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ea773,_0x23de10,_0x4a6e8d){return new BPromise(function(_0x59212b,_0x175fc1){return client[_0x4c2f('0xd')](_0x4ea773,_0x4a6e8d)['then'](function(_0x349b7b){logger['info'](_0x4c2f('0xe'),_0x23de10,'request\x20sent');logger[_0x4c2f('0xf')](_0x4c2f('0x10'),_0x23de10,_0x4c2f('0x11'),JSON[_0x4c2f('0x12')](_0x349b7b));if(_0x349b7b[_0x4c2f('0x13')]){if(_0x349b7b[_0x4c2f('0x13')]['code']===0x1f4){logger[_0x4c2f('0x13')](_0x4c2f('0xe'),_0x23de10,_0x349b7b['error'][_0x4c2f('0x14')]);return _0x175fc1(_0x349b7b[_0x4c2f('0x13')][_0x4c2f('0x14')]);}logger[_0x4c2f('0x13')]('DeskAccount,\x20%s,\x20%s',_0x23de10,_0x349b7b[_0x4c2f('0x13')]['message']);return _0x59212b(_0x349b7b['error'][_0x4c2f('0x14')]);}else{logger[_0x4c2f('0x15')](_0x4c2f('0xe'),_0x23de10,'request\x20sent');_0x59212b(_0x349b7b[_0x4c2f('0x16')][_0x4c2f('0x14')]);}})[_0x4c2f('0x17')](function(_0x5598ac){logger[_0x4c2f('0x13')]('DeskAccount,\x20%s,\x20%s',_0x23de10,_0x5598ac);_0x175fc1(_0x5598ac);});});}exports[_0x4c2f('0x18')]=function(_0x413ae0){var _0x50898b=this;return new Promise(function(_0x199d86,_0x4a4282){return db[_0x4c2f('0x19')][_0x4c2f('0x1a')]({'raw':_0x413ae0[_0x4c2f('0x1b')]?_0x413ae0['options'][_0x4c2f('0x1c')]===undefined?!![]:![]:!![],'where':_0x413ae0[_0x4c2f('0x1b')]?_0x413ae0[_0x4c2f('0x1b')][_0x4c2f('0x1d')]||null:null,'attributes':_0x413ae0['options']?_0x413ae0[_0x4c2f('0x1b')]['attributes']||null:null,'limit':_0x413ae0[_0x4c2f('0x1b')]?_0x413ae0[_0x4c2f('0x1b')][_0x4c2f('0x1e')]||null:null,'include':_0x413ae0['options']?_0x413ae0['options'][_0x4c2f('0x1f')]?_[_0x4c2f('0x20')](_0x413ae0[_0x4c2f('0x1b')][_0x4c2f('0x1f')],function(_0x79d056){return{'model':db[_0x79d056[_0x4c2f('0x21')]],'as':_0x79d056['as'],'attributes':_0x79d056[_0x4c2f('0x22')],'include':_0x79d056[_0x4c2f('0x1f')]?_[_0x4c2f('0x20')](_0x79d056[_0x4c2f('0x1f')],function(_0x303bab){return{'model':db[_0x303bab['model']],'as':_0x303bab['as'],'attributes':_0x303bab[_0x4c2f('0x22')],'include':_0x303bab[_0x4c2f('0x1f')]?_['map'](_0x303bab['include'],function(_0x11a3dc){return{'model':db[_0x11a3dc[_0x4c2f('0x21')]],'as':_0x11a3dc['as'],'attributes':_0x11a3dc['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c2f('0x23')](function(_0x462b30){logger[_0x4c2f('0x15')](_0x4c2f('0x18'),_0x413ae0);logger[_0x4c2f('0xf')]('GetDeskAccount',_0x413ae0,JSON[_0x4c2f('0x12')](_0x462b30));_0x199d86(_0x462b30);})[_0x4c2f('0x17')](function(_0x3ed5ff){logger[_0x4c2f('0x13')](_0x4c2f('0x18'),_0x3ed5ff['message'],_0x413ae0);_0x4a4282(_0x50898b[_0x4c2f('0x13')](0x1f4,_0x3ed5ff[_0x4c2f('0x14')]));});});};exports['ShowDeskAccount']=function(_0xedf0a9){var _0x41e882=this;return new Promise(function(_0xb2dcb5,_0x113195){return db[_0x4c2f('0x19')][_0x4c2f('0x24')]({'raw':_0xedf0a9['options']?_0xedf0a9[_0x4c2f('0x1b')][_0x4c2f('0x1c')]===undefined?!![]:![]:!![],'where':_0xedf0a9[_0x4c2f('0x1b')]?_0xedf0a9[_0x4c2f('0x1b')][_0x4c2f('0x1d')]||null:null,'attributes':_0xedf0a9[_0x4c2f('0x1b')]?_0xedf0a9[_0x4c2f('0x1b')][_0x4c2f('0x22')]||null:null,'include':_0xedf0a9[_0x4c2f('0x1b')]?_0xedf0a9[_0x4c2f('0x1b')][_0x4c2f('0x1f')]?_[_0x4c2f('0x20')](_0xedf0a9['options']['include'],function(_0x24c8cd){return{'model':db[_0x24c8cd[_0x4c2f('0x21')]],'as':_0x24c8cd['as'],'attributes':_0x24c8cd['attributes'],'include':_0x24c8cd[_0x4c2f('0x1f')]?_['map'](_0x24c8cd[_0x4c2f('0x1f')],function(_0x1a1422){return{'model':db[_0x1a1422[_0x4c2f('0x21')]],'as':_0x1a1422['as'],'attributes':_0x1a1422['attributes'],'include':_0x1a1422[_0x4c2f('0x1f')]?_[_0x4c2f('0x20')](_0x1a1422[_0x4c2f('0x1f')],function(_0x570ff9){return{'model':db[_0x570ff9[_0x4c2f('0x21')]],'as':_0x570ff9['as'],'attributes':_0x570ff9[_0x4c2f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4c2f('0x23')](function(_0x380fee){logger[_0x4c2f('0x15')](_0x4c2f('0x25'),_0xedf0a9);logger['debug'](_0x4c2f('0x25'),_0xedf0a9,JSON[_0x4c2f('0x12')](_0x380fee));_0xb2dcb5(_0x380fee);})[_0x4c2f('0x17')](function(_0x1c0c6e){logger['error'](_0x4c2f('0x25'),_0x1c0c6e[_0x4c2f('0x14')],_0xedf0a9);_0x113195(_0x41e882[_0x4c2f('0x13')](0x1f4,_0x1c0c6e['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 3460d4e..8959b9d 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 _0x9537=['index','/:id','getFields','/:id/subjects','isAuthenticated','getSubjects','getDescriptions','getTags','post','setTags','put','update','delete','exports','multer','util','express','Router','../../components/interaction/service','./intDeskConfiguration.controller','get'];(function(_0x4304d8,_0x3bde02){var _0x29ea9f=function(_0xdb7039){while(--_0xdb7039){_0x4304d8['push'](_0x4304d8['shift']());}};_0x29ea9f(++_0x3bde02);}(_0x9537,0xa1));var _0x7953=function(_0x2a56ce,_0x448f12){_0x2a56ce=_0x2a56ce-0x0;var _0x1f9977=_0x9537[_0x2a56ce];return _0x1f9977;};'use strict';var multer=require(_0x7953('0x0'));var util=require(_0x7953('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7953('0x2'));var router=express[_0x7953('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7953('0x4'));var config=require('../../config/environment');var controller=require(_0x7953('0x5'));router[_0x7953('0x6')]('/',auth['isAuthenticated'](),controller[_0x7953('0x7')]);router['get'](_0x7953('0x8'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x7953('0x9')]);router[_0x7953('0x6')](_0x7953('0xa'),auth[_0x7953('0xb')](),controller[_0x7953('0xc')]);router['get']('/:id/descriptions',auth[_0x7953('0xb')](),controller[_0x7953('0xd')]);router[_0x7953('0x6')]('/:id/tags',auth[_0x7953('0xb')](),controller[_0x7953('0xe')]);router[_0x7953('0xf')]('/',auth[_0x7953('0xb')](),controller['create']);router[_0x7953('0xf')]('/:id/tags',auth[_0x7953('0xb')](),controller[_0x7953('0x10')]);router[_0x7953('0x11')](_0x7953('0x8'),auth[_0x7953('0xb')](),controller[_0x7953('0x12')]);router[_0x7953('0x13')]('/:id',auth[_0x7953('0xb')](),controller['destroy']);module[_0x7953('0x14')]=router; \ No newline at end of file +var _0x41fb=['getTags','post','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags'];(function(_0x53a7c2,_0xb093ae){var _0x5e055f=function(_0x46f93c){while(--_0x46f93c){_0x53a7c2['push'](_0x53a7c2['shift']());}};_0x5e055f(++_0xb093ae);}(_0x41fb,0x132));var _0xb41f=function(_0x211695,_0x17baef){_0x211695=_0x211695-0x0;var _0x98d651=_0x41fb[_0x211695];return _0x98d651;};'use strict';var multer=require(_0xb41f('0x0'));var util=require(_0xb41f('0x1'));var path=require(_0xb41f('0x2'));var timeout=require(_0xb41f('0x3'));var express=require(_0xb41f('0x4'));var router=express[_0xb41f('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb41f('0x6'));var controller=require(_0xb41f('0x7'));router[_0xb41f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb41f('0x8')]('/:id',auth[_0xb41f('0x9')](),controller[_0xb41f('0xa')]);router[_0xb41f('0x8')](_0xb41f('0xb'),auth['isAuthenticated'](),controller[_0xb41f('0xc')]);router[_0xb41f('0x8')](_0xb41f('0xd'),auth[_0xb41f('0x9')](),controller[_0xb41f('0xe')]);router['get'](_0xb41f('0xf'),auth[_0xb41f('0x9')](),controller[_0xb41f('0x10')]);router[_0xb41f('0x8')](_0xb41f('0x11'),auth[_0xb41f('0x9')](),controller[_0xb41f('0x12')]);router[_0xb41f('0x13')]('/',auth[_0xb41f('0x9')](),controller['create']);router[_0xb41f('0x13')](_0xb41f('0x11'),auth[_0xb41f('0x9')](),controller[_0xb41f('0x14')]);router[_0xb41f('0x15')](_0xb41f('0x16'),auth[_0xb41f('0x9')](),controller[_0xb41f('0x17')]);router[_0xb41f('0x18')]('/:id',auth[_0xb41f('0x9')](),controller[_0xb41f('0x19')]);module[_0xb41f('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 91c92f8..b568e49 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 _0x673f=['STRING'];(function(_0x3acd57,_0x2d17fe){var _0x1c7407=function(_0x14a39b){while(--_0x14a39b){_0x3acd57['push'](_0x3acd57['shift']());}};_0x1c7407(++_0x2d17fe);}(_0x673f,0x15b));var _0xf673=function(_0x8b4de1,_0x49ad8d){_0x8b4de1=_0x8b4de1-0x0;var _0x2b57be=_0x673f[_0x8b4de1];return _0x2b57be;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf673('0x0')]},'description':{'type':Sequelize[_0xf673('0x0')]}}; \ No newline at end of file +var _0x962e=['STRING'];(function(_0x3d8163,_0x5470c4){var _0x49db86=function(_0x2542cb){while(--_0x2542cb){_0x3d8163['push'](_0x3d8163['shift']());}};_0x49db86(++_0x5470c4);}(_0x962e,0x1de));var _0xe962=function(_0x56b034,_0xb96f9b){_0x56b034=_0x56b034-0x0;var _0x25f338=_0x962e[_0x56b034];return _0x25f338;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe962('0x0')]},'description':{'type':Sequelize[_0xe962('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index c4effdb..0596a65 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 _0x1339=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','update','body','DeskField','getFields','getSubjects','findOne','pick','map','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','message','DeskConfiguration,\x20%s,\x20%s','sendStatus','end','status','json','offset','limit','apply','reject','destroy','stack','name','index','DeskConfiguration','rawAttributes','model','keys','query'];(function(_0x4be57c,_0x151881){var _0x5901da=function(_0x455972){while(--_0x455972){_0x4be57c['push'](_0x4be57c['shift']());}};_0x5901da(++_0x151881);}(_0x1339,0x1ed));var _0x9133=function(_0x475ff8,_0x3c7e6c){_0x475ff8=_0x475ff8-0x0;var _0x795d4a=_0x1339[_0x475ff8];return _0x795d4a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9133('0x0'));var zipdir=require(_0x9133('0x1'));var jsonpatch=require(_0x9133('0x2'));var rp=require(_0x9133('0x3'));var moment=require(_0x9133('0x4'));var BPromise=require(_0x9133('0x5'));var Mustache=require(_0x9133('0x6'));var util=require(_0x9133('0x7'));var path=require('path');var sox=require(_0x9133('0x8'));var csv=require(_0x9133('0x9'));var ejs=require(_0x9133('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x9'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var authService=require(_0x9133('0x11'));var hardwareService=require(_0x9133('0x12'));var Redis=require(_0x9133('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x9133('0x14'))(_0x9133('0x15'));var utils=require(_0x9133('0x16'));var config=require(_0x9133('0x17'));var db=require(_0x9133('0x18'))['db'];var jayson=require(_0x9133('0x19'));var client=jayson['client'][_0x9133('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x7cc59e,_0x4bbfdc,_0x5283a3,_0x10475c){return new BPromise(function(_0x4bf947,_0x22132a){var _0x439e1a=_0x10475c||client;return _0x439e1a[_0x9133('0x1b')](_0x7cc59e,_0x5283a3)[_0x9133('0x1c')](function(_0x31847a){logger[_0x9133('0x1d')]('DeskConfiguration,\x20%s,\x20%s',_0x4bbfdc,_0x9133('0x1e'));logger[_0x9133('0x1f')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4bbfdc,_0x9133('0x1e'),JSON[_0x9133('0x20')](_0x31847a));if(_0x31847a[_0x9133('0x21')]){if(_0x31847a[_0x9133('0x21')]['code']===0x1f4){logger[_0x9133('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x4bbfdc,_0x31847a[_0x9133('0x21')]['message']);return _0x22132a(_0x31847a[_0x9133('0x21')][_0x9133('0x22')]);}logger['error'](_0x9133('0x23'),_0x4bbfdc,_0x31847a['error'][_0x9133('0x22')]);return _0x4bf947(_0x31847a['error']['message']);}else{logger[_0x9133('0x1d')]('DeskConfiguration,\x20%s,\x20%s',_0x4bbfdc,_0x9133('0x1e'));_0x4bf947(_0x31847a['result']['message']);}})['catch'](function(_0x2e99a1){logger[_0x9133('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x4bbfdc,_0x2e99a1);_0x22132a(_0x2e99a1);});});}function respondWithStatusCode(_0x448f8b,_0x3f5d0e){_0x3f5d0e=_0x3f5d0e||0xcc;return function(_0xff08d5){if(_0xff08d5){return _0x448f8b[_0x9133('0x24')](_0x3f5d0e);}return _0x448f8b['status'](_0x3f5d0e)[_0x9133('0x25')]();};}function respondWithResult(_0x5c4614,_0x187e32){_0x187e32=_0x187e32||0xc8;return function(_0x2f790d){if(_0x2f790d){return _0x5c4614[_0x9133('0x26')](_0x187e32)[_0x9133('0x27')](_0x2f790d);}};}function respondWithFilteredResult(_0x4483ef,_0xe829b){return function(_0x294332){if(_0x294332){var _0x313d43=_0x294332['count'],_0x1b6b3e=_0xe829b[_0x9133('0x28')],_0x46050b=_0xe829b[_0x9133('0x28')]+_0xe829b[_0x9133('0x29')],_0x51de62;if(_0x46050b>=_0x313d43){_0x46050b=_0x313d43;_0x51de62=0xc8;}else{_0x51de62=0xce;}_0x4483ef[_0x9133('0x26')](_0x51de62);return _0x4483ef['set']('Content-Range',_0x1b6b3e+'-'+_0x46050b+'/'+_0x313d43)[_0x9133('0x27')](_0x294332);}return null;};}function patchUpdates(_0x45966d){return function(_0x188c49){try{jsonpatch[_0x9133('0x2a')](_0x188c49,_0x45966d,!![]);}catch(_0x390f50){return BPromise[_0x9133('0x2b')](_0x390f50);}return _0x188c49['save']();};}function saveUpdates(_0x58afe0,_0x5a27c1){return function(_0x1ad222){if(_0x1ad222){return _0x1ad222['update'](_0x58afe0)[_0x9133('0x1c')](function(_0x1bcb19){return _0x1bcb19;});}return null;};}function removeEntity(_0x540c79,_0xc9c724){return function(_0x5dd90b){if(_0x5dd90b){return _0x5dd90b[_0x9133('0x2c')]()[_0x9133('0x1c')](function(){_0x540c79[_0x9133('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32e95a,_0x41cfbe){return function(_0x3f189c){if(!_0x3f189c){_0x32e95a['sendStatus'](0x194);}return _0x3f189c;};}function handleError(_0x10cea6,_0x3393a1){_0x3393a1=_0x3393a1||0x1f4;return function(_0x18ba97){logger['error'](_0x18ba97[_0x9133('0x2d')]);if(_0x18ba97[_0x9133('0x2e')]){delete _0x18ba97[_0x9133('0x2e')];}_0x10cea6[_0x9133('0x26')](_0x3393a1)['send'](_0x18ba97);};}exports[_0x9133('0x2f')]=function(_0xea26a3,_0x56719e){var _0x49944={},_0x2d256a={},_0x593fbe={'count':0x0,'rows':[]};var _0x2763f3=db[_0x9133('0x30')][_0x9133('0x31')];_0x2d256a[_0x9133('0x32')]=_[_0x9133('0x33')](_0x2763f3);_0x2d256a[_0x9133('0x34')]=_[_0x9133('0x33')](_0xea26a3[_0x9133('0x34')]);_0x2d256a['filters']=_[_0x9133('0x35')](_0x2d256a[_0x9133('0x32')],_0x2d256a['query']);_0x49944[_0x9133('0x36')]=_[_0x9133('0x35')](_0x2d256a[_0x9133('0x32')],qs[_0x9133('0x37')](_0xea26a3[_0x9133('0x34')][_0x9133('0x37')]));_0x49944['attributes']=_0x49944['attributes'][_0x9133('0x38')]?_0x49944[_0x9133('0x36')]:_0x2d256a[_0x9133('0x32')];if(!_0xea26a3[_0x9133('0x34')][_0x9133('0x39')](_0x9133('0x3a'))){_0x49944[_0x9133('0x29')]=qs[_0x9133('0x29')](_0xea26a3[_0x9133('0x34')]['limit']);_0x49944[_0x9133('0x28')]=qs[_0x9133('0x28')](_0xea26a3[_0x9133('0x34')][_0x9133('0x28')]);}_0x49944[_0x9133('0x3b')]=qs['sort'](_0xea26a3[_0x9133('0x34')][_0x9133('0x3c')]);_0x49944[_0x9133('0x3d')]=qs[_0x9133('0x3e')](_['pick'](_0xea26a3[_0x9133('0x34')],_0x2d256a[_0x9133('0x3e')]));if(_0xea26a3[_0x9133('0x34')][_0x9133('0x3f')]){_0x49944[_0x9133('0x3d')]=_[_0x9133('0x40')](_0x49944[_0x9133('0x3d')],{'$or':_['map'](_0x2763f3,function(_0x7f6cd9){if(_0x7f6cd9['type']['key']!==_0x9133('0x41')){var _0x1d564f={};_0x1d564f[_0x7f6cd9[_0x9133('0x42')]]={'$like':'%'+_0xea26a3[_0x9133('0x34')][_0x9133('0x3f')]+'%'};return _0x1d564f;}})});}_0x49944=_[_0x9133('0x40')]({},_0x49944,_0xea26a3[_0x9133('0x43')]);var _0x3e054e={'where':_0x49944[_0x9133('0x3d')]};return db['DeskConfiguration'][_0x9133('0x44')](_0x3e054e)[_0x9133('0x1c')](function(_0x2928bd){_0x593fbe['count']=_0x2928bd;if(_0xea26a3['query'][_0x9133('0x45')]){_0x49944[_0x9133('0x46')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x9133('0x47')](_0x49944);})[_0x9133('0x1c')](function(_0x2bbaba){_0x593fbe[_0x9133('0x48')]=_0x2bbaba;return _0x593fbe;})[_0x9133('0x1c')](respondWithFilteredResult(_0x56719e,_0x49944))['catch'](handleError(_0x56719e,null));};exports[_0x9133('0x49')]=function(_0x4423b4,_0x1acf51){var _0x573be5={'raw':![],'where':{'id':_0x4423b4[_0x9133('0x4a')]['id']}},_0x3d884d={};_0x3d884d['model']=_['keys'](db[_0x9133('0x30')][_0x9133('0x31')]);_0x3d884d[_0x9133('0x34')]=_[_0x9133('0x33')](_0x4423b4[_0x9133('0x34')]);_0x3d884d[_0x9133('0x3e')]=_[_0x9133('0x35')](_0x3d884d[_0x9133('0x32')],_0x3d884d[_0x9133('0x34')]);_0x573be5[_0x9133('0x36')]=_[_0x9133('0x35')](_0x3d884d[_0x9133('0x32')],qs['fields'](_0x4423b4['query'][_0x9133('0x37')]));_0x573be5['attributes']=_0x573be5[_0x9133('0x36')][_0x9133('0x38')]?_0x573be5[_0x9133('0x36')]:_0x3d884d[_0x9133('0x32')];if(_0x4423b4['query'][_0x9133('0x45')]){_0x573be5[_0x9133('0x46')]=[{'all':!![]}];}_0x573be5=_[_0x9133('0x40')]({},_0x573be5,_0x4423b4['options']);return db[_0x9133('0x30')][_0x9133('0x4b')](_0x573be5)[_0x9133('0x1c')](handleEntityNotFound(_0x1acf51,null))['then'](respondWithResult(_0x1acf51,null))[_0x9133('0x4c')](handleError(_0x1acf51,null));};exports['create']=function(_0x2342f4,_0x3c4b67){return db[_0x9133('0x30')][_0x9133('0x4d')](_0x2342f4['body'],{})['then'](respondWithResult(_0x3c4b67,0xc9))[_0x9133('0x4c')](handleError(_0x3c4b67,null));};exports[_0x9133('0x4e')]=function(_0x20b1fe,_0xcb544b){if(_0x20b1fe[_0x9133('0x4f')]['id']){delete _0x20b1fe['body']['id'];}return db['DeskConfiguration'][_0x9133('0x4b')]({'where':{'id':_0x20b1fe[_0x9133('0x4a')]['id']}})['then'](handleEntityNotFound(_0xcb544b,null))[_0x9133('0x1c')](saveUpdates(_0x20b1fe[_0x9133('0x4f')],null))['then'](respondWithResult(_0xcb544b,null))['catch'](handleError(_0xcb544b,null));};exports['destroy']=function(_0x6d8c71,_0x537046){return db[_0x9133('0x30')][_0x9133('0x4b')]({'where':{'id':_0x6d8c71[_0x9133('0x4a')]['id']}})[_0x9133('0x1c')](handleEntityNotFound(_0x537046,null))['then'](removeEntity(_0x537046,null))[_0x9133('0x4c')](handleError(_0x537046,null));};exports['getFields']=function(_0xc063f8,_0x3d7cf0,_0x46d348){var _0x3f1584={};var _0x3b9927={};var _0x3534bf;var _0x56861c;return db['DeskConfiguration']['findOne']({'where':{'id':_0xc063f8[_0x9133('0x4a')]['id']}})[_0x9133('0x1c')](handleEntityNotFound(_0x3d7cf0,null))[_0x9133('0x1c')](function(_0x54a330){if(_0x54a330){_0x3534bf=_0x54a330;_0x3b9927[_0x9133('0x32')]=_[_0x9133('0x33')](db[_0x9133('0x50')][_0x9133('0x31')]);_0x3b9927[_0x9133('0x34')]=_[_0x9133('0x33')](_0xc063f8[_0x9133('0x34')]);_0x3b9927[_0x9133('0x3e')]=_['intersection'](_0x3b9927[_0x9133('0x32')],_0x3b9927['query']);_0x3f1584[_0x9133('0x36')]=_['intersection'](_0x3b9927[_0x9133('0x32')],qs[_0x9133('0x37')](_0xc063f8['query']['fields']));_0x3f1584[_0x9133('0x36')]=_0x3f1584[_0x9133('0x36')][_0x9133('0x38')]?_0x3f1584[_0x9133('0x36')]:_0x3b9927[_0x9133('0x32')];_0x3f1584[_0x9133('0x3b')]=qs[_0x9133('0x3c')](_0xc063f8[_0x9133('0x34')][_0x9133('0x3c')]);_0x3f1584[_0x9133('0x3d')]=qs[_0x9133('0x3e')](_['pick'](_0xc063f8[_0x9133('0x34')],_0x3b9927['filters']));if(_0xc063f8[_0x9133('0x34')][_0x9133('0x3f')]){_0x3f1584[_0x9133('0x3d')]=_[_0x9133('0x40')](_0x3f1584[_0x9133('0x3d')],{'$or':_['map'](_0x3f1584[_0x9133('0x36')],function(_0x1f0ca7){var _0x19339e={};_0x19339e[_0x1f0ca7]={'$like':'%'+_0xc063f8[_0x9133('0x34')]['filter']+'%'};return _0x19339e;})});}_0x3f1584=_[_0x9133('0x40')]({},_0x3f1584,_0xc063f8[_0x9133('0x43')]);return _0x3534bf[_0x9133('0x51')](_0x3f1584);}})[_0x9133('0x1c')](function(_0x49be9d){if(_0x49be9d){_0x56861c=_0x49be9d['length'];if(!_0xc063f8[_0x9133('0x34')][_0x9133('0x39')](_0x9133('0x3a'))){_0x3f1584[_0x9133('0x29')]=qs[_0x9133('0x29')](_0xc063f8[_0x9133('0x34')]['limit']);_0x3f1584[_0x9133('0x28')]=qs[_0x9133('0x28')](_0xc063f8[_0x9133('0x34')][_0x9133('0x28')]);}return _0x3534bf['getFields'](_0x3f1584);}})[_0x9133('0x1c')](function(_0x54ddcd){if(_0x54ddcd){return _0x54ddcd?{'count':_0x56861c,'rows':_0x54ddcd}:null;}})[_0x9133('0x1c')](respondWithResult(_0x3d7cf0,null))[_0x9133('0x4c')](handleError(_0x3d7cf0,null));};exports[_0x9133('0x52')]=function(_0x39b46d,_0x3e3b82,_0x5a2c0d){var _0x3c87d4={};var _0x1741c2={};var _0x55e0ca;var _0x23bd83;return db[_0x9133('0x30')][_0x9133('0x53')]({'where':{'id':_0x39b46d[_0x9133('0x4a')]['id']}})[_0x9133('0x1c')](handleEntityNotFound(_0x3e3b82,null))['then'](function(_0x5bdb85){if(_0x5bdb85){_0x55e0ca=_0x5bdb85;_0x1741c2['model']=_[_0x9133('0x33')](db[_0x9133('0x50')][_0x9133('0x31')]);_0x1741c2['query']=_[_0x9133('0x33')](_0x39b46d[_0x9133('0x34')]);_0x1741c2[_0x9133('0x3e')]=_[_0x9133('0x35')](_0x1741c2[_0x9133('0x32')],_0x1741c2[_0x9133('0x34')]);_0x3c87d4[_0x9133('0x36')]=_[_0x9133('0x35')](_0x1741c2['model'],qs[_0x9133('0x37')](_0x39b46d[_0x9133('0x34')]['fields']));_0x3c87d4[_0x9133('0x36')]=_0x3c87d4['attributes'][_0x9133('0x38')]?_0x3c87d4[_0x9133('0x36')]:_0x1741c2[_0x9133('0x32')];_0x3c87d4[_0x9133('0x3b')]=qs[_0x9133('0x3c')](_0x39b46d['query'][_0x9133('0x3c')]);_0x3c87d4[_0x9133('0x3d')]=qs[_0x9133('0x3e')](_[_0x9133('0x54')](_0x39b46d['query'],_0x1741c2[_0x9133('0x3e')]));if(_0x39b46d[_0x9133('0x34')][_0x9133('0x3f')]){_0x3c87d4[_0x9133('0x3d')]=_[_0x9133('0x40')](_0x3c87d4[_0x9133('0x3d')],{'$or':_[_0x9133('0x55')](_0x3c87d4[_0x9133('0x36')],function(_0x650c7d){var _0x31bda5={};_0x31bda5[_0x650c7d]={'$like':'%'+_0x39b46d[_0x9133('0x34')]['filter']+'%'};return _0x31bda5;})});}_0x3c87d4=_[_0x9133('0x40')]({},_0x3c87d4,_0x39b46d[_0x9133('0x43')]);return _0x55e0ca[_0x9133('0x52')](_0x3c87d4);}})[_0x9133('0x1c')](function(_0x5dac5c){if(_0x5dac5c){_0x23bd83=_0x5dac5c[_0x9133('0x38')];if(!_0x39b46d['query'][_0x9133('0x39')](_0x9133('0x3a'))){_0x3c87d4[_0x9133('0x29')]=qs['limit'](_0x39b46d[_0x9133('0x34')][_0x9133('0x29')]);_0x3c87d4[_0x9133('0x28')]=qs['offset'](_0x39b46d[_0x9133('0x34')][_0x9133('0x28')]);}return _0x55e0ca['getSubjects'](_0x3c87d4);}})[_0x9133('0x1c')](function(_0x12094c){if(_0x12094c){return _0x12094c?{'count':_0x23bd83,'rows':_0x12094c}:null;}})[_0x9133('0x1c')](respondWithResult(_0x3e3b82,null))['catch'](handleError(_0x3e3b82,null));};exports[_0x9133('0x56')]=function(_0x5d1608,_0x401d6c,_0x83454c){var _0x64e16={};var _0x4ac03e={};var _0x2bd590;var _0x54f9ad;return db[_0x9133('0x30')][_0x9133('0x53')]({'where':{'id':_0x5d1608[_0x9133('0x4a')]['id']}})[_0x9133('0x1c')](handleEntityNotFound(_0x401d6c,null))[_0x9133('0x1c')](function(_0x42bc2c){if(_0x42bc2c){_0x2bd590=_0x42bc2c;_0x4ac03e[_0x9133('0x32')]=_[_0x9133('0x33')](db['DeskField'][_0x9133('0x31')]);_0x4ac03e[_0x9133('0x34')]=_[_0x9133('0x33')](_0x5d1608[_0x9133('0x34')]);_0x4ac03e[_0x9133('0x3e')]=_['intersection'](_0x4ac03e[_0x9133('0x32')],_0x4ac03e[_0x9133('0x34')]);_0x64e16[_0x9133('0x36')]=_[_0x9133('0x35')](_0x4ac03e['model'],qs[_0x9133('0x37')](_0x5d1608['query'][_0x9133('0x37')]));_0x64e16[_0x9133('0x36')]=_0x64e16[_0x9133('0x36')][_0x9133('0x38')]?_0x64e16['attributes']:_0x4ac03e[_0x9133('0x32')];_0x64e16[_0x9133('0x3b')]=qs[_0x9133('0x3c')](_0x5d1608[_0x9133('0x34')][_0x9133('0x3c')]);_0x64e16['where']=qs['filters'](_['pick'](_0x5d1608['query'],_0x4ac03e[_0x9133('0x3e')]));if(_0x5d1608[_0x9133('0x34')][_0x9133('0x3f')]){_0x64e16['where']=_[_0x9133('0x40')](_0x64e16[_0x9133('0x3d')],{'$or':_[_0x9133('0x55')](_0x64e16[_0x9133('0x36')],function(_0x89f308){var _0x572b77={};_0x572b77[_0x89f308]={'$like':'%'+_0x5d1608[_0x9133('0x34')]['filter']+'%'};return _0x572b77;})});}_0x64e16=_[_0x9133('0x40')]({},_0x64e16,_0x5d1608[_0x9133('0x43')]);return _0x2bd590[_0x9133('0x56')](_0x64e16);}})[_0x9133('0x1c')](function(_0x1077ec){if(_0x1077ec){_0x54f9ad=_0x1077ec['length'];if(!_0x5d1608[_0x9133('0x34')][_0x9133('0x39')](_0x9133('0x3a'))){_0x64e16['limit']=qs[_0x9133('0x29')](_0x5d1608['query'][_0x9133('0x29')]);_0x64e16[_0x9133('0x28')]=qs[_0x9133('0x28')](_0x5d1608[_0x9133('0x34')][_0x9133('0x28')]);}return _0x2bd590[_0x9133('0x56')](_0x64e16);}})['then'](function(_0x10895b){if(_0x10895b){return _0x10895b?{'count':_0x54f9ad,'rows':_0x10895b}:null;}})[_0x9133('0x1c')](respondWithResult(_0x401d6c,null))[_0x9133('0x4c')](handleError(_0x401d6c,null));};exports[_0x9133('0x57')]=function(_0x835b91,_0x18e990,_0x59d639){var _0x4adcbc={};var _0x3ca534={};var _0x1d805d;var _0x52e741;return db[_0x9133('0x30')]['findOne']({'where':{'id':_0x835b91[_0x9133('0x4a')]['id']}})[_0x9133('0x1c')](handleEntityNotFound(_0x18e990,null))['then'](function(_0x38dfab){if(_0x38dfab){_0x1d805d=_0x38dfab;_0x3ca534[_0x9133('0x32')]=_[_0x9133('0x33')](db[_0x9133('0x58')][_0x9133('0x31')]);_0x3ca534['query']=_[_0x9133('0x33')](_0x835b91[_0x9133('0x34')]);_0x3ca534['filters']=_[_0x9133('0x35')](_0x3ca534[_0x9133('0x32')],_0x3ca534[_0x9133('0x34')]);_0x4adcbc[_0x9133('0x36')]=_[_0x9133('0x35')](_0x3ca534['model'],qs['fields'](_0x835b91[_0x9133('0x34')][_0x9133('0x37')]));_0x4adcbc['attributes']=_0x4adcbc[_0x9133('0x36')][_0x9133('0x38')]?_0x4adcbc['attributes']:_0x3ca534[_0x9133('0x32')];_0x4adcbc[_0x9133('0x3b')]=qs[_0x9133('0x3c')](_0x835b91[_0x9133('0x34')][_0x9133('0x3c')]);_0x4adcbc[_0x9133('0x3d')]=qs[_0x9133('0x3e')](_[_0x9133('0x54')](_0x835b91['query'],_0x3ca534[_0x9133('0x3e')]));if(_0x835b91['query']['filter']){_0x4adcbc[_0x9133('0x3d')]=_[_0x9133('0x40')](_0x4adcbc[_0x9133('0x3d')],{'$or':_[_0x9133('0x55')](_0x4adcbc[_0x9133('0x36')],function(_0x62a8df){var _0xda3828={};_0xda3828[_0x62a8df]={'$like':'%'+_0x835b91['query'][_0x9133('0x3f')]+'%'};return _0xda3828;})});}_0x4adcbc=_[_0x9133('0x40')]({},_0x4adcbc,_0x835b91[_0x9133('0x43')]);return _0x1d805d['getTags'](_0x4adcbc);}})[_0x9133('0x1c')](function(_0x4b8182){if(_0x4b8182){_0x52e741=_0x4b8182[_0x9133('0x38')];if(!_0x835b91[_0x9133('0x34')][_0x9133('0x39')](_0x9133('0x3a'))){_0x4adcbc[_0x9133('0x29')]=qs[_0x9133('0x29')](_0x835b91[_0x9133('0x34')][_0x9133('0x29')]);_0x4adcbc[_0x9133('0x28')]=qs['offset'](_0x835b91[_0x9133('0x34')][_0x9133('0x28')]);}return _0x1d805d[_0x9133('0x57')](_0x4adcbc);}})[_0x9133('0x1c')](function(_0x496c00){if(_0x496c00){return _0x496c00?{'count':_0x52e741,'rows':_0x496c00}:null;}})[_0x9133('0x1c')](respondWithResult(_0x18e990,null))['catch'](handleError(_0x18e990,null));};exports[_0x9133('0x59')]=function(_0x486dce,_0x57837f,_0x400ae9){if(_0x486dce['body']['id']){delete _0x486dce[_0x9133('0x4f')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x486dce['params']['id']}})[_0x9133('0x1c')](handleEntityNotFound(_0x57837f,null))['then'](function(_0x194822){if(_0x194822){return _0x194822['setTags'](_0x486dce[_0x9133('0x4f')][_0x9133('0x5a')]||[]);}return null;})[_0x9133('0x1c')](respondWithResult(_0x57837f,null))[_0x9133('0x4c')](handleError(_0x57837f,null));}; \ No newline at end of file +var _0x7072=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','show','params','create','body','find','getFields','findOne','rawAttributes','options','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','destroy','name','send','index','DeskConfiguration','keys','query','filters','intersection','model','attributes'];(function(_0x13eac9,_0x1ac1f3){var _0x3c3d55=function(_0xce2206){while(--_0xce2206){_0x13eac9['push'](_0x13eac9['shift']());}};_0x3c3d55(++_0x1ac1f3);}(_0x7072,0x138));var _0x2707=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x7072[_0xbf8ebe];return _0x1e25e8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2707('0x0'));var rimraf=require(_0x2707('0x1'));var zipdir=require(_0x2707('0x2'));var jsonpatch=require(_0x2707('0x3'));var rp=require(_0x2707('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2707('0x5'));var util=require('util');var path=require(_0x2707('0x6'));var sox=require(_0x2707('0x7'));var csv=require(_0x2707('0x8'));var ejs=require(_0x2707('0x9'));var fs=require('fs');var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x2707('0xf'));var hardwareService=require(_0x2707('0x10'));var Redis=require(_0x2707('0x11'));var qs=require(_0x2707('0x12'));var logger=require(_0x2707('0x13'))(_0x2707('0x14'));var utils=require(_0x2707('0x15'));var config=require(_0x2707('0x16'));var db=require(_0x2707('0x17'))['db'];var jayson=require(_0x2707('0x18'));var client=jayson[_0x2707('0x19')][_0x2707('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x40d370,_0x5bf16e,_0x44c1d7,_0x590152){return new BPromise(function(_0x2a1bff,_0x307367){var _0xfe975c=_0x590152||client;return _0xfe975c[_0x2707('0x1b')](_0x40d370,_0x44c1d7)[_0x2707('0x1c')](function(_0x4e52a3){logger[_0x2707('0x1d')](_0x2707('0x1e'),_0x5bf16e,_0x2707('0x1f'));logger['debug'](_0x2707('0x20'),_0x5bf16e,_0x2707('0x1f'),JSON[_0x2707('0x21')](_0x4e52a3));if(_0x4e52a3[_0x2707('0x22')]){if(_0x4e52a3[_0x2707('0x22')][_0x2707('0x23')]===0x1f4){logger['error'](_0x2707('0x1e'),_0x5bf16e,_0x4e52a3[_0x2707('0x22')][_0x2707('0x24')]);return _0x307367(_0x4e52a3['error']['message']);}logger['error'](_0x2707('0x1e'),_0x5bf16e,_0x4e52a3[_0x2707('0x22')][_0x2707('0x24')]);return _0x2a1bff(_0x4e52a3[_0x2707('0x22')][_0x2707('0x24')]);}else{logger[_0x2707('0x1d')](_0x2707('0x1e'),_0x5bf16e,_0x2707('0x1f'));_0x2a1bff(_0x4e52a3[_0x2707('0x25')][_0x2707('0x24')]);}})[_0x2707('0x26')](function(_0x119df4){logger[_0x2707('0x22')](_0x2707('0x1e'),_0x5bf16e,_0x119df4);_0x307367(_0x119df4);});});}function respondWithStatusCode(_0x5f50a8,_0x1acf22){_0x1acf22=_0x1acf22||0xcc;return function(_0x3b030a){if(_0x3b030a){return _0x5f50a8[_0x2707('0x27')](_0x1acf22);}return _0x5f50a8[_0x2707('0x28')](_0x1acf22)[_0x2707('0x29')]();};}function respondWithResult(_0x3f6e8b,_0x4831ed){_0x4831ed=_0x4831ed||0xc8;return function(_0x2424d3){if(_0x2424d3){return _0x3f6e8b[_0x2707('0x28')](_0x4831ed)[_0x2707('0x2a')](_0x2424d3);}};}function respondWithFilteredResult(_0x2ad386,_0x5b763f){return function(_0x528b20){if(_0x528b20){var _0x2dce16=_0x528b20[_0x2707('0x2b')],_0x4ca05d=_0x5b763f['offset'],_0x29dad2=_0x5b763f[_0x2707('0x2c')]+_0x5b763f[_0x2707('0x2d')],_0x34dc4e;if(_0x29dad2>=_0x2dce16){_0x29dad2=_0x2dce16;_0x34dc4e=0xc8;}else{_0x34dc4e=0xce;}_0x2ad386[_0x2707('0x28')](_0x34dc4e);return _0x2ad386['set'](_0x2707('0x2e'),_0x4ca05d+'-'+_0x29dad2+'/'+_0x2dce16)[_0x2707('0x2a')](_0x528b20);}return null;};}function patchUpdates(_0x4a99ce){return function(_0xd63d3f){try{jsonpatch['apply'](_0xd63d3f,_0x4a99ce,!![]);}catch(_0x5aaffb){return BPromise[_0x2707('0x2f')](_0x5aaffb);}return _0xd63d3f['save']();};}function saveUpdates(_0x2a0d24,_0x3f153d){return function(_0x417a97){if(_0x417a97){return _0x417a97[_0x2707('0x30')](_0x2a0d24)['then'](function(_0xd83ce3){return _0xd83ce3;});}return null;};}function removeEntity(_0x3305f8,_0x2c7ecb){return function(_0x154799){if(_0x154799){return _0x154799[_0x2707('0x31')]()[_0x2707('0x1c')](function(){_0x3305f8[_0x2707('0x28')](0xcc)[_0x2707('0x29')]();});}};}function handleEntityNotFound(_0x2d2520,_0x4a179b){return function(_0x2aef00){if(!_0x2aef00){_0x2d2520[_0x2707('0x27')](0x194);}return _0x2aef00;};}function handleError(_0x5bcdef,_0x47ce1c){_0x47ce1c=_0x47ce1c||0x1f4;return function(_0x5a0575){logger['error'](_0x5a0575['stack']);if(_0x5a0575[_0x2707('0x32')]){delete _0x5a0575['name'];}_0x5bcdef['status'](_0x47ce1c)[_0x2707('0x33')](_0x5a0575);};}exports[_0x2707('0x34')]=function(_0x54a974,_0x473954){var _0x36993a={},_0x5df463={},_0x5e6b51={'count':0x0,'rows':[]};var _0x30b645=db[_0x2707('0x35')]['rawAttributes'];_0x5df463['model']=_[_0x2707('0x36')](_0x30b645);_0x5df463[_0x2707('0x37')]=_['keys'](_0x54a974[_0x2707('0x37')]);_0x5df463[_0x2707('0x38')]=_[_0x2707('0x39')](_0x5df463[_0x2707('0x3a')],_0x5df463[_0x2707('0x37')]);_0x36993a[_0x2707('0x3b')]=_['intersection'](_0x5df463[_0x2707('0x3a')],qs[_0x2707('0x3c')](_0x54a974[_0x2707('0x37')][_0x2707('0x3c')]));_0x36993a[_0x2707('0x3b')]=_0x36993a[_0x2707('0x3b')][_0x2707('0x3d')]?_0x36993a['attributes']:_0x5df463[_0x2707('0x3a')];if(!_0x54a974[_0x2707('0x37')][_0x2707('0x3e')](_0x2707('0x3f'))){_0x36993a[_0x2707('0x2d')]=qs[_0x2707('0x2d')](_0x54a974[_0x2707('0x37')][_0x2707('0x2d')]);_0x36993a[_0x2707('0x2c')]=qs[_0x2707('0x2c')](_0x54a974[_0x2707('0x37')][_0x2707('0x2c')]);}_0x36993a[_0x2707('0x40')]=qs[_0x2707('0x41')](_0x54a974[_0x2707('0x37')][_0x2707('0x41')]);_0x36993a['where']=qs[_0x2707('0x38')](_[_0x2707('0x42')](_0x54a974['query'],_0x5df463[_0x2707('0x38')]));if(_0x54a974['query'][_0x2707('0x43')]){_0x36993a[_0x2707('0x44')]=_[_0x2707('0x45')](_0x36993a[_0x2707('0x44')],{'$or':_[_0x2707('0x46')](_0x30b645,function(_0xdeec24){if(_0xdeec24[_0x2707('0x47')]['key']!==_0x2707('0x48')){var _0x4398bf={};_0x4398bf[_0xdeec24['field']]={'$like':'%'+_0x54a974[_0x2707('0x37')][_0x2707('0x43')]+'%'};return _0x4398bf;}})});}_0x36993a=_[_0x2707('0x45')]({},_0x36993a,_0x54a974['options']);var _0x4a4727={'where':_0x36993a[_0x2707('0x44')]};return db[_0x2707('0x35')]['count'](_0x4a4727)[_0x2707('0x1c')](function(_0x56dbfc){_0x5e6b51[_0x2707('0x2b')]=_0x56dbfc;if(_0x54a974[_0x2707('0x37')][_0x2707('0x49')]){_0x36993a[_0x2707('0x4a')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x2707('0x4b')](_0x36993a);})[_0x2707('0x1c')](function(_0x3310e6){_0x5e6b51[_0x2707('0x4c')]=_0x3310e6;return _0x5e6b51;})[_0x2707('0x1c')](respondWithFilteredResult(_0x473954,_0x36993a))[_0x2707('0x26')](handleError(_0x473954,null));};exports[_0x2707('0x4d')]=function(_0x59a86f,_0x36cecc){var _0x273c34={'raw':![],'where':{'id':_0x59a86f[_0x2707('0x4e')]['id']}},_0x36df38={};_0x36df38[_0x2707('0x3a')]=_['keys'](db[_0x2707('0x35')]['rawAttributes']);_0x36df38[_0x2707('0x37')]=_[_0x2707('0x36')](_0x59a86f['query']);_0x36df38[_0x2707('0x38')]=_[_0x2707('0x39')](_0x36df38[_0x2707('0x3a')],_0x36df38['query']);_0x273c34[_0x2707('0x3b')]=_['intersection'](_0x36df38[_0x2707('0x3a')],qs[_0x2707('0x3c')](_0x59a86f['query'][_0x2707('0x3c')]));_0x273c34[_0x2707('0x3b')]=_0x273c34[_0x2707('0x3b')]['length']?_0x273c34['attributes']:_0x36df38[_0x2707('0x3a')];if(_0x59a86f[_0x2707('0x37')][_0x2707('0x49')]){_0x273c34[_0x2707('0x4a')]=[{'all':!![]}];}_0x273c34=_[_0x2707('0x45')]({},_0x273c34,_0x59a86f['options']);return db['DeskConfiguration']['find'](_0x273c34)[_0x2707('0x1c')](handleEntityNotFound(_0x36cecc,null))[_0x2707('0x1c')](respondWithResult(_0x36cecc,null))[_0x2707('0x26')](handleError(_0x36cecc,null));};exports[_0x2707('0x4f')]=function(_0x1ffcce,_0x5b622c){return db[_0x2707('0x35')][_0x2707('0x4f')](_0x1ffcce['body'],{})['then'](respondWithResult(_0x5b622c,0xc9))[_0x2707('0x26')](handleError(_0x5b622c,null));};exports[_0x2707('0x30')]=function(_0x3a8cf9,_0x57c1c5){if(_0x3a8cf9[_0x2707('0x50')]['id']){delete _0x3a8cf9[_0x2707('0x50')]['id'];}return db[_0x2707('0x35')][_0x2707('0x51')]({'where':{'id':_0x3a8cf9['params']['id']}})[_0x2707('0x1c')](handleEntityNotFound(_0x57c1c5,null))[_0x2707('0x1c')](saveUpdates(_0x3a8cf9[_0x2707('0x50')],null))[_0x2707('0x1c')](respondWithResult(_0x57c1c5,null))[_0x2707('0x26')](handleError(_0x57c1c5,null));};exports[_0x2707('0x31')]=function(_0xd2bd1a,_0x32befc){return db[_0x2707('0x35')][_0x2707('0x51')]({'where':{'id':_0xd2bd1a['params']['id']}})[_0x2707('0x1c')](handleEntityNotFound(_0x32befc,null))['then'](removeEntity(_0x32befc,null))['catch'](handleError(_0x32befc,null));};exports[_0x2707('0x52')]=function(_0x4b9451,_0x556648,_0x15bf2e){var _0x7c280e={};var _0x185bd3={};var _0x154e26;var _0x3f82de;return db[_0x2707('0x35')][_0x2707('0x53')]({'where':{'id':_0x4b9451[_0x2707('0x4e')]['id']}})[_0x2707('0x1c')](handleEntityNotFound(_0x556648,null))[_0x2707('0x1c')](function(_0x40c333){if(_0x40c333){_0x154e26=_0x40c333;_0x185bd3['model']=_['keys'](db['DeskField'][_0x2707('0x54')]);_0x185bd3[_0x2707('0x37')]=_[_0x2707('0x36')](_0x4b9451['query']);_0x185bd3['filters']=_[_0x2707('0x39')](_0x185bd3[_0x2707('0x3a')],_0x185bd3[_0x2707('0x37')]);_0x7c280e[_0x2707('0x3b')]=_[_0x2707('0x39')](_0x185bd3['model'],qs['fields'](_0x4b9451[_0x2707('0x37')][_0x2707('0x3c')]));_0x7c280e[_0x2707('0x3b')]=_0x7c280e[_0x2707('0x3b')][_0x2707('0x3d')]?_0x7c280e[_0x2707('0x3b')]:_0x185bd3[_0x2707('0x3a')];_0x7c280e[_0x2707('0x40')]=qs[_0x2707('0x41')](_0x4b9451['query'][_0x2707('0x41')]);_0x7c280e[_0x2707('0x44')]=qs[_0x2707('0x38')](_[_0x2707('0x42')](_0x4b9451[_0x2707('0x37')],_0x185bd3[_0x2707('0x38')]));if(_0x4b9451['query']['filter']){_0x7c280e[_0x2707('0x44')]=_[_0x2707('0x45')](_0x7c280e['where'],{'$or':_['map'](_0x7c280e['attributes'],function(_0x491d15){var _0x1aafc3={};_0x1aafc3[_0x491d15]={'$like':'%'+_0x4b9451[_0x2707('0x37')]['filter']+'%'};return _0x1aafc3;})});}_0x7c280e=_[_0x2707('0x45')]({},_0x7c280e,_0x4b9451[_0x2707('0x55')]);return _0x154e26[_0x2707('0x52')](_0x7c280e);}})['then'](function(_0x508265){if(_0x508265){_0x3f82de=_0x508265[_0x2707('0x3d')];if(!_0x4b9451[_0x2707('0x37')][_0x2707('0x3e')](_0x2707('0x3f'))){_0x7c280e[_0x2707('0x2d')]=qs[_0x2707('0x2d')](_0x4b9451[_0x2707('0x37')]['limit']);_0x7c280e[_0x2707('0x2c')]=qs[_0x2707('0x2c')](_0x4b9451[_0x2707('0x37')][_0x2707('0x2c')]);}return _0x154e26[_0x2707('0x52')](_0x7c280e);}})[_0x2707('0x1c')](function(_0x5a1175){if(_0x5a1175){return _0x5a1175?{'count':_0x3f82de,'rows':_0x5a1175}:null;}})[_0x2707('0x1c')](respondWithResult(_0x556648,null))[_0x2707('0x26')](handleError(_0x556648,null));};exports[_0x2707('0x56')]=function(_0x142606,_0x2d9ef2,_0x39f1a9){var _0x5140ad={};var _0x47eb92={};var _0x129473;var _0x2b0df0;return db[_0x2707('0x35')][_0x2707('0x53')]({'where':{'id':_0x142606[_0x2707('0x4e')]['id']}})[_0x2707('0x1c')](handleEntityNotFound(_0x2d9ef2,null))['then'](function(_0x4e86f5){if(_0x4e86f5){_0x129473=_0x4e86f5;_0x47eb92[_0x2707('0x3a')]=_['keys'](db[_0x2707('0x57')][_0x2707('0x54')]);_0x47eb92[_0x2707('0x37')]=_[_0x2707('0x36')](_0x142606[_0x2707('0x37')]);_0x47eb92[_0x2707('0x38')]=_['intersection'](_0x47eb92[_0x2707('0x3a')],_0x47eb92['query']);_0x5140ad[_0x2707('0x3b')]=_[_0x2707('0x39')](_0x47eb92['model'],qs[_0x2707('0x3c')](_0x142606[_0x2707('0x37')][_0x2707('0x3c')]));_0x5140ad[_0x2707('0x3b')]=_0x5140ad[_0x2707('0x3b')]['length']?_0x5140ad[_0x2707('0x3b')]:_0x47eb92[_0x2707('0x3a')];_0x5140ad[_0x2707('0x40')]=qs[_0x2707('0x41')](_0x142606[_0x2707('0x37')][_0x2707('0x41')]);_0x5140ad[_0x2707('0x44')]=qs[_0x2707('0x38')](_[_0x2707('0x42')](_0x142606[_0x2707('0x37')],_0x47eb92[_0x2707('0x38')]));if(_0x142606[_0x2707('0x37')][_0x2707('0x43')]){_0x5140ad[_0x2707('0x44')]=_[_0x2707('0x45')](_0x5140ad[_0x2707('0x44')],{'$or':_[_0x2707('0x46')](_0x5140ad[_0x2707('0x3b')],function(_0x5d2abb){var _0x44906f={};_0x44906f[_0x5d2abb]={'$like':'%'+_0x142606['query']['filter']+'%'};return _0x44906f;})});}_0x5140ad=_[_0x2707('0x45')]({},_0x5140ad,_0x142606[_0x2707('0x55')]);return _0x129473[_0x2707('0x56')](_0x5140ad);}})[_0x2707('0x1c')](function(_0x41aa5a){if(_0x41aa5a){_0x2b0df0=_0x41aa5a[_0x2707('0x3d')];if(!_0x142606['query'][_0x2707('0x3e')](_0x2707('0x3f'))){_0x5140ad[_0x2707('0x2d')]=qs['limit'](_0x142606[_0x2707('0x37')][_0x2707('0x2d')]);_0x5140ad[_0x2707('0x2c')]=qs[_0x2707('0x2c')](_0x142606['query'][_0x2707('0x2c')]);}return _0x129473['getSubjects'](_0x5140ad);}})[_0x2707('0x1c')](function(_0x19a980){if(_0x19a980){return _0x19a980?{'count':_0x2b0df0,'rows':_0x19a980}:null;}})[_0x2707('0x1c')](respondWithResult(_0x2d9ef2,null))[_0x2707('0x26')](handleError(_0x2d9ef2,null));};exports[_0x2707('0x58')]=function(_0x417a74,_0xad3b6d,_0x333f85){var _0x190e40={};var _0x5b42e9={};var _0x4530bc;var _0x5a1a24;return db[_0x2707('0x35')][_0x2707('0x53')]({'where':{'id':_0x417a74[_0x2707('0x4e')]['id']}})[_0x2707('0x1c')](handleEntityNotFound(_0xad3b6d,null))[_0x2707('0x1c')](function(_0x427843){if(_0x427843){_0x4530bc=_0x427843;_0x5b42e9['model']=_['keys'](db[_0x2707('0x57')]['rawAttributes']);_0x5b42e9[_0x2707('0x37')]=_[_0x2707('0x36')](_0x417a74[_0x2707('0x37')]);_0x5b42e9[_0x2707('0x38')]=_['intersection'](_0x5b42e9[_0x2707('0x3a')],_0x5b42e9[_0x2707('0x37')]);_0x190e40[_0x2707('0x3b')]=_['intersection'](_0x5b42e9[_0x2707('0x3a')],qs[_0x2707('0x3c')](_0x417a74[_0x2707('0x37')]['fields']));_0x190e40[_0x2707('0x3b')]=_0x190e40['attributes'][_0x2707('0x3d')]?_0x190e40[_0x2707('0x3b')]:_0x5b42e9[_0x2707('0x3a')];_0x190e40[_0x2707('0x40')]=qs['sort'](_0x417a74['query'][_0x2707('0x41')]);_0x190e40[_0x2707('0x44')]=qs['filters'](_[_0x2707('0x42')](_0x417a74[_0x2707('0x37')],_0x5b42e9[_0x2707('0x38')]));if(_0x417a74[_0x2707('0x37')][_0x2707('0x43')]){_0x190e40[_0x2707('0x44')]=_['merge'](_0x190e40[_0x2707('0x44')],{'$or':_[_0x2707('0x46')](_0x190e40[_0x2707('0x3b')],function(_0x3b4211){var _0xeeee09={};_0xeeee09[_0x3b4211]={'$like':'%'+_0x417a74['query']['filter']+'%'};return _0xeeee09;})});}_0x190e40=_[_0x2707('0x45')]({},_0x190e40,_0x417a74['options']);return _0x4530bc['getDescriptions'](_0x190e40);}})[_0x2707('0x1c')](function(_0xce603b){if(_0xce603b){_0x5a1a24=_0xce603b[_0x2707('0x3d')];if(!_0x417a74[_0x2707('0x37')][_0x2707('0x3e')]('nolimit')){_0x190e40[_0x2707('0x2d')]=qs[_0x2707('0x2d')](_0x417a74['query'][_0x2707('0x2d')]);_0x190e40[_0x2707('0x2c')]=qs[_0x2707('0x2c')](_0x417a74['query'][_0x2707('0x2c')]);}return _0x4530bc[_0x2707('0x58')](_0x190e40);}})[_0x2707('0x1c')](function(_0x17eb21){if(_0x17eb21){return _0x17eb21?{'count':_0x5a1a24,'rows':_0x17eb21}:null;}})['then'](respondWithResult(_0xad3b6d,null))[_0x2707('0x26')](handleError(_0xad3b6d,null));};exports[_0x2707('0x59')]=function(_0x2ccd5d,_0x4f2da2,_0x491e03){var _0x3ae6cb={};var _0x196974={};var _0x1a96b1;var _0x8442e3;return db[_0x2707('0x35')][_0x2707('0x53')]({'where':{'id':_0x2ccd5d[_0x2707('0x4e')]['id']}})[_0x2707('0x1c')](handleEntityNotFound(_0x4f2da2,null))[_0x2707('0x1c')](function(_0x25ad7a){if(_0x25ad7a){_0x1a96b1=_0x25ad7a;_0x196974[_0x2707('0x3a')]=_[_0x2707('0x36')](db[_0x2707('0x5a')][_0x2707('0x54')]);_0x196974[_0x2707('0x37')]=_['keys'](_0x2ccd5d['query']);_0x196974['filters']=_[_0x2707('0x39')](_0x196974['model'],_0x196974[_0x2707('0x37')]);_0x3ae6cb['attributes']=_[_0x2707('0x39')](_0x196974[_0x2707('0x3a')],qs[_0x2707('0x3c')](_0x2ccd5d[_0x2707('0x37')][_0x2707('0x3c')]));_0x3ae6cb[_0x2707('0x3b')]=_0x3ae6cb[_0x2707('0x3b')]['length']?_0x3ae6cb[_0x2707('0x3b')]:_0x196974[_0x2707('0x3a')];_0x3ae6cb['order']=qs[_0x2707('0x41')](_0x2ccd5d[_0x2707('0x37')][_0x2707('0x41')]);_0x3ae6cb[_0x2707('0x44')]=qs[_0x2707('0x38')](_['pick'](_0x2ccd5d[_0x2707('0x37')],_0x196974[_0x2707('0x38')]));if(_0x2ccd5d[_0x2707('0x37')]['filter']){_0x3ae6cb[_0x2707('0x44')]=_[_0x2707('0x45')](_0x3ae6cb[_0x2707('0x44')],{'$or':_['map'](_0x3ae6cb[_0x2707('0x3b')],function(_0x4c4c7e){var _0x2ae5ac={};_0x2ae5ac[_0x4c4c7e]={'$like':'%'+_0x2ccd5d[_0x2707('0x37')]['filter']+'%'};return _0x2ae5ac;})});}_0x3ae6cb=_[_0x2707('0x45')]({},_0x3ae6cb,_0x2ccd5d[_0x2707('0x55')]);return _0x1a96b1['getTags'](_0x3ae6cb);}})[_0x2707('0x1c')](function(_0x52e7f5){if(_0x52e7f5){_0x8442e3=_0x52e7f5['length'];if(!_0x2ccd5d[_0x2707('0x37')]['hasOwnProperty']('nolimit')){_0x3ae6cb['limit']=qs['limit'](_0x2ccd5d['query'][_0x2707('0x2d')]);_0x3ae6cb[_0x2707('0x2c')]=qs[_0x2707('0x2c')](_0x2ccd5d[_0x2707('0x37')][_0x2707('0x2c')]);}return _0x1a96b1[_0x2707('0x59')](_0x3ae6cb);}})['then'](function(_0x2f9f5a){if(_0x2f9f5a){return _0x2f9f5a?{'count':_0x8442e3,'rows':_0x2f9f5a}:null;}})['then'](respondWithResult(_0x4f2da2,null))[_0x2707('0x26')](handleError(_0x4f2da2,null));};exports[_0x2707('0x5b')]=function(_0x551400,_0x373c83,_0x4a3161){if(_0x551400['body']['id']){delete _0x551400[_0x2707('0x50')]['id'];}return db['DeskConfiguration'][_0x2707('0x53')]({'where':{'id':_0x551400['params']['id']}})[_0x2707('0x1c')](handleEntityNotFound(_0x373c83,null))[_0x2707('0x1c')](function(_0x4436e7){if(_0x4436e7){return _0x4436e7[_0x2707('0x5b')](_0x551400[_0x2707('0x50')][_0x2707('0x5c')]||[]);}return null;})[_0x2707('0x1c')](respondWithResult(_0x373c83,null))['catch'](handleError(_0x373c83,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 4172711..c1708e2 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 _0x4213=['../../config/logger','api','moment','bluebird','request-promise','exports','define','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x507ac5,_0x33aaee){var _0x12c1bc=function(_0x5c953c){while(--_0x5c953c){_0x507ac5['push'](_0x507ac5['shift']());}};_0x12c1bc(++_0x33aaee);}(_0x4213,0x77));var _0x3421=function(_0x5a0dc1,_0x517c34){_0x5a0dc1=_0x5a0dc1-0x0;var _0xc590de=_0x4213[_0x5a0dc1];return _0xc590de;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var logger=require(_0x3421('0x2'))(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var BPromise=require(_0x3421('0x5'));var rp=require(_0x3421('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0x3421('0x7')]=function(_0x5c3719,_0x459c5e){return _0x5c3719[_0x3421('0x8')](_0x3421('0x9'),attributes,{'tableName':_0x3421('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe511=['util','api','bluebird','request-promise','exports','define','int_desk_configurations','lodash'];(function(_0x57b25f,_0x6408a6){var _0x54f8b1=function(_0x2083d6){while(--_0x2083d6){_0x57b25f['push'](_0x57b25f['shift']());}};_0x54f8b1(++_0x6408a6);}(_0xe511,0x16f));var _0x1e51=function(_0x1d484c,_0x27c954){_0x1d484c=_0x1d484c-0x0;var _0xb2ec18=_0xe511[_0x1d484c];return _0xb2ec18;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require('../../config/logger')(_0x1e51('0x2'));var moment=require('moment');var BPromise=require(_0x1e51('0x3'));var rp=require(_0x1e51('0x4'));var attributes=require('./intDeskConfiguration.attributes');module[_0x1e51('0x5')]=function(_0x2be2b7,_0x204da7){return _0x2be2b7[_0x1e51('0x6')]('DeskConfiguration',attributes,{'tableName':_0x1e51('0x7'),'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 7e5acd1..172fda1 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 _0xdc97=['DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x58becb,_0x281434){var _0x52a571=function(_0x42dc8d){while(--_0x42dc8d){_0x58becb['push'](_0x58becb['shift']());}};_0x52a571(++_0x281434);}(_0xdc97,0x13b));var _0x7dc9=function(_0x1471bf,_0x2076f4){_0x1471bf=_0x1471bf-0x0;var _0x5efb75=_0xdc97[_0x1471bf];return _0x5efb75;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){return client[_0x7dc9('0xa')](_0x2636ef,_0x4b3229)[_0x7dc9('0xb')](function(_0x3dd07e){logger['info'](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x4f91c7,_0x7dc9('0xd'),JSON[_0x7dc9('0x10')](_0x3dd07e));if(_0x3dd07e[_0x7dc9('0x11')]){if(_0x3dd07e['error']['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x23737d(_0x3dd07e['error'][_0x7dc9('0x12')]);}logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x2ff923(_0x3dd07e[_0x7dc9('0x11')]['message']);}else{logger[_0x7dc9('0x13')](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));_0x2ff923(_0x3dd07e[_0x7dc9('0x14')][_0x7dc9('0x12')]);}})[_0x7dc9('0x15')](function(_0x45698c){logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x45698c);_0x23737d(_0x45698c);});});} \ No newline at end of file +var _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x3b0d19,_0x4eb2d4){var _0x22895d=function(_0x493ce7){while(--_0x493ce7){_0x3b0d19['push'](_0x3b0d19['shift']());}};_0x22895d(++_0x4eb2d4);}(_0x187d,0x93));var _0xd187=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x187d[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 6f77db0..8f73f16 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 _0x802e=['show','post','create','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x5a16df,_0x59a4f2){var _0x5b5ca1=function(_0x2cc6d7){while(--_0x2cc6d7){_0x5a16df['push'](_0x5a16df['shift']());}};_0x5b5ca1(++_0x59a4f2);}(_0x802e,0xba));var _0xe802=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x802e[_0x166742];return _0xb7814a;};'use strict';var multer=require('multer');var util=require(_0xe802('0x0'));var path=require('path');var timeout=require(_0xe802('0x1'));var express=require(_0xe802('0x2'));var router=express[_0xe802('0x3')]();var auth=require(_0xe802('0x4'));var interaction=require(_0xe802('0x5'));var config=require(_0xe802('0x6'));var controller=require(_0xe802('0x7'));router[_0xe802('0x8')]('/',auth[_0xe802('0x9')](),controller[_0xe802('0xa')]);router[_0xe802('0x8')](_0xe802('0xb'),auth[_0xe802('0x9')](),controller[_0xe802('0xc')]);router[_0xe802('0xd')]('/',auth[_0xe802('0x9')](),controller[_0xe802('0xe')]);router['put'](_0xe802('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xe802('0xf')](_0xe802('0xb'),auth[_0xe802('0x9')](),controller[_0xe802('0x10')]);module[_0xe802('0x11')]=router; \ No newline at end of file +var _0xd096=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','show','put','/:id','exports','multer','util','connect-timeout'];(function(_0x1cf445,_0x16e198){var _0x2195af=function(_0x1ad390){while(--_0x1ad390){_0x1cf445['push'](_0x1cf445['shift']());}};_0x2195af(++_0x16e198);}(_0xd096,0x142));var _0x6d09=function(_0x30e1e3,_0x10848d){_0x30e1e3=_0x30e1e3-0x0;var _0x44c9fa=_0xd096[_0x30e1e3];return _0x44c9fa;};'use strict';var multer=require(_0x6d09('0x0'));var util=require(_0x6d09('0x1'));var path=require('path');var timeout=require(_0x6d09('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6d09('0x3'));var config=require(_0x6d09('0x4'));var controller=require(_0x6d09('0x5'));router[_0x6d09('0x6')]('/',auth[_0x6d09('0x7')](),controller[_0x6d09('0x8')]);router[_0x6d09('0x6')]('/:id',auth[_0x6d09('0x7')](),controller[_0x6d09('0x9')]);router['post']('/',auth[_0x6d09('0x7')](),controller['create']);router[_0x6d09('0xa')](_0x6d09('0xb'),auth[_0x6d09('0x7')](),controller['update']);router['delete'](_0x6d09('0xb'),auth[_0x6d09('0x7')](),controller['destroy']);module[_0x6d09('0xc')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 845b185..9361bed 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 _0x2750=['sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x219bdc,_0x2db0d9){var _0x2abdb6=function(_0x409467){while(--_0x409467){_0x219bdc['push'](_0x219bdc['shift']());}};_0x2abdb6(++_0x2db0d9);}(_0x2750,0x13b));var _0x0275=function(_0x548533,_0x5f05fe){_0x548533=_0x548533-0x0;var _0x4f5ac0=_0x2750[_0x548533];return _0x4f5ac0;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'type':{'type':Sequelize[_0x0275('0x1')](_0x0275('0x2'),_0x0275('0x3'),_0x0275('0x4'),_0x0275('0x5')),'defaultValue':_0x0275('0x2')},'content':{'type':Sequelize[_0x0275('0x6')]},'key':{'type':Sequelize[_0x0275('0x6')]},'keyType':{'type':Sequelize[_0x0275('0x1')](_0x0275('0x2'),'variable',_0x0275('0x4'))},'keyContent':{'type':Sequelize[_0x0275('0x6')]},'idField':{'type':Sequelize[_0x0275('0x6')]},'nameField':{'type':Sequelize[_0x0275('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0275('0x6')]}}; \ No newline at end of file +var _0x6e6c=['variable','STRING','BOOLEAN','sequelize','exports','string'];(function(_0x48ce50,_0x1b24e9){var _0x380f20=function(_0x4be272){while(--_0x4be272){_0x48ce50['push'](_0x48ce50['shift']());}};_0x380f20(++_0x1b24e9);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc6e6('0x2'),_0xc6e6('0x3'),'customVariable','keyValue'),'defaultValue':_0xc6e6('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc6e6('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xc6e6('0x2'),_0xc6e6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xc6e6('0x4')]},'idField':{'type':Sequelize[_0xc6e6('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc6e6('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc6e6('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 1802ea3..a5c5d4d 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 _0x9c44=['ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','sendStatus','status','json','count','offset','limit','save','update','then','error','stack','name','send','index','DeskField','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','key','field','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv'];(function(_0x139ceb,_0x1e0d3b){var _0x162d1b=function(_0x5824b1){while(--_0x5824b1){_0x139ceb['push'](_0x139ceb['shift']());}};_0x162d1b(++_0x1e0d3b);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x49c4('0xf'));var qs=require(_0x49c4('0x10'));var logger=require('../../config/logger')(_0x49c4('0x11'));var utils=require(_0x49c4('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d19bf,_0x6d1b08){_0x6d1b08=_0x6d1b08||0xcc;return function(_0x5487cd){if(_0x5487cd){return _0x1d19bf[_0x49c4('0x13')](_0x6d1b08);}return _0x1d19bf[_0x49c4('0x14')](_0x6d1b08)['end']();};}function respondWithResult(_0x1909fe,_0x280996){_0x280996=_0x280996||0xc8;return function(_0x21f15a){if(_0x21f15a){return _0x1909fe[_0x49c4('0x14')](_0x280996)[_0x49c4('0x15')](_0x21f15a);}};}function respondWithFilteredResult(_0x18211c,_0x75ea8){return function(_0x3de397){if(_0x3de397){var _0x58d177=_0x3de397[_0x49c4('0x16')],_0x3acd06=_0x75ea8[_0x49c4('0x17')],_0x141003=_0x75ea8['offset']+_0x75ea8[_0x49c4('0x18')],_0x13a2db;if(_0x141003>=_0x58d177){_0x141003=_0x58d177;_0x13a2db=0xc8;}else{_0x13a2db=0xce;}_0x18211c[_0x49c4('0x14')](_0x13a2db);return _0x18211c['set']('Content-Range',_0x3acd06+'-'+_0x141003+'/'+_0x58d177)[_0x49c4('0x15')](_0x3de397);}return null;};}function patchUpdates(_0x2f82d5){return function(_0x3addb2){try{jsonpatch['apply'](_0x3addb2,_0x2f82d5,!![]);}catch(_0x24856d){return BPromise['reject'](_0x24856d);}return _0x3addb2[_0x49c4('0x19')]();};}function saveUpdates(_0x1806c2,_0xe31fcc){return function(_0x291526){if(_0x291526){return _0x291526[_0x49c4('0x1a')](_0x1806c2)[_0x49c4('0x1b')](function(_0x280893){return _0x280893;});}return null;};}function removeEntity(_0x46e475,_0x2197d2){return function(_0x578447){if(_0x578447){return _0x578447['destroy']()['then'](function(){_0x46e475[_0x49c4('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x592bb8,_0x2263ae){return function(_0x15581b){if(!_0x15581b){_0x592bb8[_0x49c4('0x13')](0x194);}return _0x15581b;};}function handleError(_0xd335e4,_0x4811c4){_0x4811c4=_0x4811c4||0x1f4;return function(_0x5850f2){logger[_0x49c4('0x1c')](_0x5850f2[_0x49c4('0x1d')]);if(_0x5850f2['name']){delete _0x5850f2[_0x49c4('0x1e')];}_0xd335e4[_0x49c4('0x14')](_0x4811c4)[_0x49c4('0x1f')](_0x5850f2);};}exports[_0x49c4('0x20')]=function(_0x531d92,_0x543ea2){var _0x449960={},_0x53c199={},_0x3800b7={'count':0x0,'rows':[]};var _0x3852b2=db[_0x49c4('0x21')][_0x49c4('0x22')];_0x53c199['model']=_[_0x49c4('0x23')](_0x3852b2);_0x53c199[_0x49c4('0x24')]=_[_0x49c4('0x23')](_0x531d92[_0x49c4('0x24')]);_0x53c199[_0x49c4('0x25')]=_[_0x49c4('0x26')](_0x53c199[_0x49c4('0x27')],_0x53c199[_0x49c4('0x24')]);_0x449960[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0x53c199[_0x49c4('0x27')],qs['fields'](_0x531d92['query']['fields']));_0x449960[_0x49c4('0x28')]=_0x449960[_0x49c4('0x28')][_0x49c4('0x29')]?_0x449960[_0x49c4('0x28')]:_0x53c199[_0x49c4('0x27')];if(!_0x531d92['query'][_0x49c4('0x2a')](_0x49c4('0x2b'))){_0x449960[_0x49c4('0x18')]=qs[_0x49c4('0x18')](_0x531d92['query']['limit']);_0x449960[_0x49c4('0x17')]=qs[_0x49c4('0x17')](_0x531d92[_0x49c4('0x24')][_0x49c4('0x17')]);}_0x449960[_0x49c4('0x2c')]=qs['sort'](_0x531d92[_0x49c4('0x24')][_0x49c4('0x2d')]);_0x449960[_0x49c4('0x2e')]=qs['filters'](_['pick'](_0x531d92[_0x49c4('0x24')],_0x53c199[_0x49c4('0x25')]));if(_0x531d92[_0x49c4('0x24')][_0x49c4('0x2f')]){_0x449960[_0x49c4('0x2e')]=_[_0x49c4('0x30')](_0x449960[_0x49c4('0x2e')],{'$or':_[_0x49c4('0x31')](_0x3852b2,function(_0x3209cd){if(_0x3209cd['type'][_0x49c4('0x32')]!=='VIRTUAL'){var _0xdda586={};_0xdda586[_0x3209cd[_0x49c4('0x33')]]={'$like':'%'+_0x531d92[_0x49c4('0x24')][_0x49c4('0x2f')]+'%'};return _0xdda586;}})});}_0x449960=_['merge']({},_0x449960,_0x531d92[_0x49c4('0x34')]);var _0x31f3ff={'where':_0x449960[_0x49c4('0x2e')]};return db['DeskField'][_0x49c4('0x16')](_0x31f3ff)[_0x49c4('0x1b')](function(_0x178987){_0x3800b7[_0x49c4('0x16')]=_0x178987;if(_0x531d92[_0x49c4('0x24')][_0x49c4('0x35')]){_0x449960[_0x49c4('0x36')]=[{'all':!![]}];}return db[_0x49c4('0x21')][_0x49c4('0x37')](_0x449960);})[_0x49c4('0x1b')](function(_0x1e506a){_0x3800b7['rows']=_0x1e506a;return _0x3800b7;})[_0x49c4('0x1b')](respondWithFilteredResult(_0x543ea2,_0x449960))[_0x49c4('0x38')](handleError(_0x543ea2,null));};exports[_0x49c4('0x39')]=function(_0x23aa32,_0x41ad28){var _0x29dd5d={'raw':!![],'where':{'id':_0x23aa32[_0x49c4('0x3a')]['id']}},_0x1be62d={};_0x1be62d[_0x49c4('0x27')]=_[_0x49c4('0x23')](db[_0x49c4('0x21')][_0x49c4('0x22')]);_0x1be62d[_0x49c4('0x24')]=_['keys'](_0x23aa32[_0x49c4('0x24')]);_0x1be62d['filters']=_[_0x49c4('0x26')](_0x1be62d[_0x49c4('0x27')],_0x1be62d[_0x49c4('0x24')]);_0x29dd5d[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0x1be62d[_0x49c4('0x27')],qs['fields'](_0x23aa32['query'][_0x49c4('0x3b')]));_0x29dd5d[_0x49c4('0x28')]=_0x29dd5d[_0x49c4('0x28')][_0x49c4('0x29')]?_0x29dd5d['attributes']:_0x1be62d[_0x49c4('0x27')];if(_0x23aa32[_0x49c4('0x24')][_0x49c4('0x35')]){_0x29dd5d[_0x49c4('0x36')]=[{'all':!![]}];}_0x29dd5d=_[_0x49c4('0x30')]({},_0x29dd5d,_0x23aa32[_0x49c4('0x34')]);return db[_0x49c4('0x21')][_0x49c4('0x3c')](_0x29dd5d)[_0x49c4('0x1b')](handleEntityNotFound(_0x41ad28,null))['then'](respondWithResult(_0x41ad28,null))[_0x49c4('0x38')](handleError(_0x41ad28,null));};exports['create']=function(_0x33696e,_0x628423){return db[_0x49c4('0x21')][_0x49c4('0x3d')](_0x33696e[_0x49c4('0x3e')],{})['then'](respondWithResult(_0x628423,0xc9))[_0x49c4('0x38')](handleError(_0x628423,null));};exports[_0x49c4('0x1a')]=function(_0x384862,_0x254d07){if(_0x384862[_0x49c4('0x3e')]['id']){delete _0x384862[_0x49c4('0x3e')]['id'];}return db[_0x49c4('0x21')]['find']({'where':{'id':_0x384862[_0x49c4('0x3a')]['id']}})['then'](handleEntityNotFound(_0x254d07,null))[_0x49c4('0x1b')](saveUpdates(_0x384862[_0x49c4('0x3e')],null))[_0x49c4('0x1b')](respondWithResult(_0x254d07,null))[_0x49c4('0x38')](handleError(_0x254d07,null));};exports[_0x49c4('0x3f')]=function(_0x30bea5,_0x2c6be1){return db['DeskField'][_0x49c4('0x3c')]({'where':{'id':_0x30bea5[_0x49c4('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x1b')](removeEntity(_0x2c6be1,null))[_0x49c4('0x38')](handleError(_0x2c6be1,null));}; \ No newline at end of file +var _0xcb91=['options','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','DeskField','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','filter','includeAll','include','rows','catch','show','fields'];(function(_0x395aaf,_0x48a467){var _0x1b39d3=function(_0x228248){while(--_0x228248){_0x395aaf['push'](_0x395aaf['shift']());}};_0x1b39d3(++_0x48a467);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0xcb91[_0x487496];return _0x539dc8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x1cb9('0xd'));var hardwareService=require(_0x1cb9('0xe'));var Redis=require(_0x1cb9('0xf'));var qs=require(_0x1cb9('0x10'));var logger=require(_0x1cb9('0x11'))('api');var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var db=require(_0x1cb9('0x14'))['db'];function respondWithStatusCode(_0x3fdd83,_0x46af58){_0x46af58=_0x46af58||0xcc;return function(_0x5445e1){if(_0x5445e1){return _0x3fdd83['sendStatus'](_0x46af58);}return _0x3fdd83['status'](_0x46af58)[_0x1cb9('0x15')]();};}function respondWithResult(_0x282bc6,_0x384496){_0x384496=_0x384496||0xc8;return function(_0x1c714f){if(_0x1c714f){return _0x282bc6['status'](_0x384496)[_0x1cb9('0x16')](_0x1c714f);}};}function respondWithFilteredResult(_0x6ef389,_0x1b3cd7){return function(_0x8dfa55){if(_0x8dfa55){var _0x3e2d11=_0x8dfa55[_0x1cb9('0x17')],_0x5806d8=_0x1b3cd7[_0x1cb9('0x18')],_0x5572cb=_0x1b3cd7[_0x1cb9('0x18')]+_0x1b3cd7[_0x1cb9('0x19')],_0xd446a3;if(_0x5572cb>=_0x3e2d11){_0x5572cb=_0x3e2d11;_0xd446a3=0xc8;}else{_0xd446a3=0xce;}_0x6ef389[_0x1cb9('0x1a')](_0xd446a3);return _0x6ef389[_0x1cb9('0x1b')]('Content-Range',_0x5806d8+'-'+_0x5572cb+'/'+_0x3e2d11)['json'](_0x8dfa55);}return null;};}function patchUpdates(_0x1b2fa6){return function(_0x41ac41){try{jsonpatch[_0x1cb9('0x1c')](_0x41ac41,_0x1b2fa6,!![]);}catch(_0x31481a){return BPromise[_0x1cb9('0x1d')](_0x31481a);}return _0x41ac41[_0x1cb9('0x1e')]();};}function saveUpdates(_0x24fa1f,_0x4ac422){return function(_0x559bcc){if(_0x559bcc){return _0x559bcc[_0x1cb9('0x1f')](_0x24fa1f)['then'](function(_0x4750b1){return _0x4750b1;});}return null;};}function removeEntity(_0x2265ea,_0x523b26){return function(_0x599275){if(_0x599275){return _0x599275[_0x1cb9('0x20')]()[_0x1cb9('0x21')](function(){_0x2265ea[_0x1cb9('0x1a')](0xcc)[_0x1cb9('0x15')]();});}};}function handleEntityNotFound(_0x45b8d3,_0x27db16){return function(_0x59ebea){if(!_0x59ebea){_0x45b8d3['sendStatus'](0x194);}return _0x59ebea;};}function handleError(_0x6c6f61,_0x557199){_0x557199=_0x557199||0x1f4;return function(_0x10a419){logger[_0x1cb9('0x22')](_0x10a419[_0x1cb9('0x23')]);if(_0x10a419[_0x1cb9('0x24')]){delete _0x10a419[_0x1cb9('0x24')];}_0x6c6f61['status'](_0x557199)[_0x1cb9('0x25')](_0x10a419);};}exports[_0x1cb9('0x26')]=function(_0x4c8d76,_0xd6891c){var _0x21effa={},_0x41a9a0={},_0x1804fd={'count':0x0,'rows':[]};var _0x406821=db[_0x1cb9('0x27')][_0x1cb9('0x28')];_0x41a9a0[_0x1cb9('0x29')]=_[_0x1cb9('0x2a')](_0x406821);_0x41a9a0[_0x1cb9('0x2b')]=_['keys'](_0x4c8d76[_0x1cb9('0x2b')]);_0x41a9a0['filters']=_[_0x1cb9('0x2c')](_0x41a9a0['model'],_0x41a9a0[_0x1cb9('0x2b')]);_0x21effa[_0x1cb9('0x2d')]=_[_0x1cb9('0x2c')](_0x41a9a0[_0x1cb9('0x29')],qs['fields'](_0x4c8d76[_0x1cb9('0x2b')]['fields']));_0x21effa[_0x1cb9('0x2d')]=_0x21effa[_0x1cb9('0x2d')][_0x1cb9('0x2e')]?_0x21effa['attributes']:_0x41a9a0[_0x1cb9('0x29')];if(!_0x4c8d76['query'][_0x1cb9('0x2f')]('nolimit')){_0x21effa[_0x1cb9('0x19')]=qs[_0x1cb9('0x19')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x19')]);_0x21effa['offset']=qs[_0x1cb9('0x18')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x18')]);}_0x21effa[_0x1cb9('0x30')]=qs[_0x1cb9('0x31')](_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x31')]);_0x21effa[_0x1cb9('0x32')]=qs[_0x1cb9('0x33')](_[_0x1cb9('0x34')](_0x4c8d76[_0x1cb9('0x2b')],_0x41a9a0[_0x1cb9('0x33')]));if(_0x4c8d76[_0x1cb9('0x2b')]['filter']){_0x21effa['where']=_[_0x1cb9('0x35')](_0x21effa[_0x1cb9('0x32')],{'$or':_[_0x1cb9('0x36')](_0x406821,function(_0x29f451){if(_0x29f451[_0x1cb9('0x37')][_0x1cb9('0x38')]!==_0x1cb9('0x39')){var _0x3f5637={};_0x3f5637[_0x29f451['field']]={'$like':'%'+_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x3a')]+'%'};return _0x3f5637;}})});}_0x21effa=_[_0x1cb9('0x35')]({},_0x21effa,_0x4c8d76['options']);var _0x2a5aac={'where':_0x21effa['where']};return db[_0x1cb9('0x27')]['count'](_0x2a5aac)[_0x1cb9('0x21')](function(_0x13d4fd){_0x1804fd[_0x1cb9('0x17')]=_0x13d4fd;if(_0x4c8d76[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x21effa[_0x1cb9('0x3c')]=[{'all':!![]}];}return db[_0x1cb9('0x27')]['findAll'](_0x21effa);})['then'](function(_0x4111b8){_0x1804fd[_0x1cb9('0x3d')]=_0x4111b8;return _0x1804fd;})[_0x1cb9('0x21')](respondWithFilteredResult(_0xd6891c,_0x21effa))[_0x1cb9('0x3e')](handleError(_0xd6891c,null));};exports[_0x1cb9('0x3f')]=function(_0x1d7304,_0x32130b){var _0x4a670c={'raw':!![],'where':{'id':_0x1d7304['params']['id']}},_0xbcaa32={};_0xbcaa32['model']=_['keys'](db[_0x1cb9('0x27')][_0x1cb9('0x28')]);_0xbcaa32[_0x1cb9('0x2b')]=_[_0x1cb9('0x2a')](_0x1d7304[_0x1cb9('0x2b')]);_0xbcaa32['filters']=_[_0x1cb9('0x2c')](_0xbcaa32['model'],_0xbcaa32[_0x1cb9('0x2b')]);_0x4a670c[_0x1cb9('0x2d')]=_[_0x1cb9('0x2c')](_0xbcaa32['model'],qs[_0x1cb9('0x40')](_0x1d7304['query'][_0x1cb9('0x40')]));_0x4a670c[_0x1cb9('0x2d')]=_0x4a670c['attributes']['length']?_0x4a670c[_0x1cb9('0x2d')]:_0xbcaa32[_0x1cb9('0x29')];if(_0x1d7304[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x4a670c[_0x1cb9('0x3c')]=[{'all':!![]}];}_0x4a670c=_['merge']({},_0x4a670c,_0x1d7304[_0x1cb9('0x41')]);return db['DeskField']['find'](_0x4a670c)['then'](handleEntityNotFound(_0x32130b,null))[_0x1cb9('0x21')](respondWithResult(_0x32130b,null))[_0x1cb9('0x3e')](handleError(_0x32130b,null));};exports[_0x1cb9('0x42')]=function(_0x11cea5,_0x116c05){return db[_0x1cb9('0x27')][_0x1cb9('0x42')](_0x11cea5[_0x1cb9('0x43')],{})[_0x1cb9('0x21')](respondWithResult(_0x116c05,0xc9))[_0x1cb9('0x3e')](handleError(_0x116c05,null));};exports[_0x1cb9('0x1f')]=function(_0x4ce899,_0x9d08cb){if(_0x4ce899[_0x1cb9('0x43')]['id']){delete _0x4ce899[_0x1cb9('0x43')]['id'];}return db['DeskField'][_0x1cb9('0x44')]({'where':{'id':_0x4ce899[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x9d08cb,null))[_0x1cb9('0x21')](saveUpdates(_0x4ce899[_0x1cb9('0x43')],null))['then'](respondWithResult(_0x9d08cb,null))[_0x1cb9('0x3e')](handleError(_0x9d08cb,null));};exports['destroy']=function(_0x2eaa11,_0x4ac483){return db[_0x1cb9('0x27')][_0x1cb9('0x44')]({'where':{'id':_0x2eaa11[_0x1cb9('0x45')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x4ac483,null))['then'](removeEntity(_0x4ac483,null))[_0x1cb9('0x3e')](handleError(_0x4ac483,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index a87f5cb..04a72c5 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 _0x4eaa=['moment','bluebird','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','api'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x4eaa,0x1a0));var _0xa4ea=function(_0x38e158,_0x240654){_0x38e158=_0x38e158-0x0;var _0x3e06d0=_0x4eaa[_0x38e158];return _0x3e06d0;};'use strict';var _=require('lodash');var util=require(_0xa4ea('0x0'));var logger=require('../../config/logger')(_0xa4ea('0x1'));var moment=require(_0xa4ea('0x2'));var BPromise=require(_0xa4ea('0x3'));var rp=require('request-promise');var attributes=require(_0xa4ea('0x4'));module['exports']=function(_0x3a8bcc,_0x27ea6d){return _0x3a8bcc[_0xa4ea('0x5')](_0xa4ea('0x6'),attributes,{'tableName':_0xa4ea('0x7'),'paranoid':![],'indexes':[{'name':_0xa4ea('0x8'),'fields':[_0xa4ea('0x9'),_0xa4ea('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5cab=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intDeskField.attributes','DeskField','int_desk_fields','desk_unique_index','idField'];(function(_0x5e0ec0,_0x18c99b){var _0x44460e=function(_0x43224f){while(--_0x43224f){_0x5e0ec0['push'](_0x5e0ec0['shift']());}};_0x44460e(++_0x18c99b);}(_0x5cab,0x1ef));var _0xb5ca=function(_0x48c542,_0xbbbc40){_0x48c542=_0x48c542-0x0;var _0x24273b=_0x5cab[_0x48c542];return _0x24273b;};'use strict';var _=require(_0xb5ca('0x0'));var util=require(_0xb5ca('0x1'));var logger=require(_0xb5ca('0x2'))(_0xb5ca('0x3'));var moment=require(_0xb5ca('0x4'));var BPromise=require(_0xb5ca('0x5'));var rp=require(_0xb5ca('0x6'));var attributes=require(_0xb5ca('0x7'));module['exports']=function(_0x2e852e,_0x1850fa){return _0x2e852e['define'](_0xb5ca('0x8'),attributes,{'tableName':_0xb5ca('0x9'),'paranoid':![],'indexes':[{'name':_0xb5ca('0xa'),'fields':[_0xb5ca('0xb'),_0xb5ca('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index bee8835..e6dbeba 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 _0x17ba=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x23b63e,_0x32ad05){var _0x37d277=function(_0x3e5a25){while(--_0x3e5a25){_0x23b63e['push'](_0x23b63e['shift']());}};_0x37d277(++_0x32ad05);}(_0x17ba,0xab));var _0xa17b=function(_0x62d958,_0x45a5a1){_0x62d958=_0x62d958-0x0;var _0x468978=_0x17ba[_0x62d958];return _0x468978;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var moment=require('moment');var BPromise=require(_0xa17b('0x2'));var rs=require(_0xa17b('0x3'));var fs=require('fs');var Redis=require(_0xa17b('0x4'));var db=require(_0xa17b('0x5'))['db'];var utils=require(_0xa17b('0x6'));var logger=require(_0xa17b('0x7'))(_0xa17b('0x8'));var config=require(_0xa17b('0x9'));var jayson=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e3d43,_0x1957be,_0x57f9cd){return new BPromise(function(_0x2ca4d3,_0x17d1d2){return client[_0xa17b('0xd')](_0x2e3d43,_0x57f9cd)[_0xa17b('0xe')](function(_0x15bdfc){logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));logger[_0xa17b('0x11')](_0xa17b('0x12'),_0x1957be,_0xa17b('0x10'),JSON[_0xa17b('0x13')](_0x15bdfc));if(_0x15bdfc[_0xa17b('0x14')]){if(_0x15bdfc['error'][_0xa17b('0x15')]===0x1f4){logger[_0xa17b('0x14')](_0xa17b('0xf'),_0x1957be,_0x15bdfc['error'][_0xa17b('0x16')]);return _0x17d1d2(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}logger[_0xa17b('0x14')]('DeskField,\x20%s,\x20%s',_0x1957be,_0x15bdfc[_0xa17b('0x14')]['message']);return _0x2ca4d3(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}else{logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));_0x2ca4d3(_0x15bdfc[_0xa17b('0x17')][_0xa17b('0x16')]);}})['catch'](function(_0x98a295){logger['error']('DeskField,\x20%s,\x20%s',_0x1957be,_0x98a295);_0x17d1d2(_0x98a295);});});} \ No newline at end of file +var _0xdace=['request\x20sent','debug','stringify','error','code','DeskField,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0xdace,0xc5));var _0xedac=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xdace[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('DeskField,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 0eecd99..f8097ba 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 _0x5a48=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x3476bb,_0x39ec58){var _0x12151b=function(_0x585dcf){while(--_0x585dcf){_0x3476bb['push'](_0x3476bb['shift']());}};_0x12151b(++_0x39ec58);}(_0x5a48,0x13b));var _0x85a4=function(_0x3a21c0,_0x348451){_0x3a21c0=_0x3a21c0-0x0;var _0x411e84=_0x5a48[_0x3a21c0];return _0x411e84;};'use strict';var multer=require(_0x85a4('0x0'));var util=require(_0x85a4('0x1'));var path=require(_0x85a4('0x2'));var timeout=require(_0x85a4('0x3'));var express=require('express');var router=express[_0x85a4('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x85a4('0x5'));var config=require(_0x85a4('0x6'));var controller=require(_0x85a4('0x7'));router['get']('/',auth[_0x85a4('0x8')](),controller[_0x85a4('0x9')]);router[_0x85a4('0xa')](_0x85a4('0xb'),auth[_0x85a4('0x8')](),controller[_0x85a4('0xc')]);router[_0x85a4('0xa')](_0x85a4('0xd'),auth[_0x85a4('0x8')](),controller['getConfigurations']);router[_0x85a4('0xa')](_0x85a4('0xe'),auth['isAuthenticated'](),controller[_0x85a4('0xf')]);router[_0x85a4('0x10')]('/',auth[_0x85a4('0x8')](),controller[_0x85a4('0x11')]);router[_0x85a4('0x10')](_0x85a4('0xd'),auth[_0x85a4('0x8')](),controller[_0x85a4('0x12')]);router[_0x85a4('0x13')](_0x85a4('0xb'),auth[_0x85a4('0x8')](),controller[_0x85a4('0x14')]);router[_0x85a4('0x15')](_0x85a4('0xb'),auth[_0x85a4('0x8')](),controller[_0x85a4('0x16')]);module[_0x85a4('0x17')]=router; \ No newline at end of file +var _0x3324=['show','/:id/configurations','/:id/fields','post','addConfiguration','put','/:id','delete','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index'];(function(_0x2cdd4c,_0x580c06){var _0xbc21c0=function(_0x4a659d){while(--_0x4a659d){_0x2cdd4c['push'](_0x2cdd4c['shift']());}};_0xbc21c0(++_0x580c06);}(_0x3324,0x172));var _0x4332=function(_0x20b35a,_0x12329c){_0x20b35a=_0x20b35a-0x0;var _0x17fd40=_0x3324[_0x20b35a];return _0x17fd40;};'use strict';var multer=require('multer');var util=require(_0x4332('0x0'));var path=require('path');var timeout=require(_0x4332('0x1'));var express=require('express');var router=express[_0x4332('0x2')]();var auth=require(_0x4332('0x3'));var interaction=require(_0x4332('0x4'));var config=require(_0x4332('0x5'));var controller=require(_0x4332('0x6'));router[_0x4332('0x7')]('/',auth[_0x4332('0x8')](),controller[_0x4332('0x9')]);router[_0x4332('0x7')]('/:id',auth[_0x4332('0x8')](),controller[_0x4332('0xa')]);router[_0x4332('0x7')](_0x4332('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x4332('0x7')](_0x4332('0xc'),auth[_0x4332('0x8')](),controller['getFields']);router[_0x4332('0xd')]('/',auth[_0x4332('0x8')](),controller['create']);router[_0x4332('0xd')]('/:id/configurations',auth[_0x4332('0x8')](),controller[_0x4332('0xe')]);router[_0x4332('0xf')](_0x4332('0x10'),auth[_0x4332('0x8')](),controller['update']);router[_0x4332('0x11')](_0x4332('0x10'),auth[_0x4332('0x8')](),controller[_0x4332('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 50b54d7..62f7497 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 _0x132c=['exports','STRING','sequelize'];(function(_0x2c0b77,_0x26916c){var _0xc0af54=function(_0x551127){while(--_0x551127){_0x2c0b77['push'](_0x2c0b77['shift']());}};_0xc0af54(++_0x26916c);}(_0x132c,0x1ac));var _0xc132=function(_0x4e43df,_0x3e1ea9){_0x4e43df=_0x4e43df-0x0;var _0x2042dd=_0x132c[_0x4e43df];return _0x2042dd;};'use strict';var Sequelize=require(_0xc132('0x0'));module[_0xc132('0x1')]={'name':{'type':Sequelize[_0xc132('0x2')]},'username':{'type':Sequelize[_0xc132('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc132('0x2')]},'tenantId':{'type':Sequelize[_0xc132('0x2')]},'clientId':{'type':Sequelize[_0xc132('0x2')]},'clientSecret':{'type':Sequelize[_0xc132('0x2')]},'serverUrl':{'type':Sequelize[_0xc132('0x2')]},'description':{'type':Sequelize[_0xc132('0x2')]}}; \ No newline at end of file +var _0x7f09=['STRING','exports'];(function(_0x15dee7,_0x222902){var _0x1d0dd5=function(_0x221d5d){while(--_0x221d5d){_0x15dee7['push'](_0x15dee7['shift']());}};_0x1d0dd5(++_0x222902);}(_0x7f09,0x1b3));var _0x97f0=function(_0x2d8f3d,_0x21083c){_0x2d8f3d=_0x2d8f3d-0x0;var _0x494535=_0x7f09[_0x2d8f3d];return _0x494535;};'use strict';var Sequelize=require('sequelize');module[_0x97f0('0x0')]={'name':{'type':Sequelize[_0x97f0('0x1')]},'username':{'type':Sequelize[_0x97f0('0x1')]},'password':{'type':Sequelize[_0x97f0('0x1')]},'remoteUri':{'type':Sequelize[_0x97f0('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x97f0('0x1')]},'clientSecret':{'type':Sequelize[_0x97f0('0x1')]},'serverUrl':{'type':Sequelize[_0x97f0('0x1')]},'description':{'type':Sequelize[_0x97f0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 508bf4c..80065f6 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 _0xe1ae=['createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','owneridtype','owneridyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','MetadataId','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','log','Dynamics365\x20error:\x20','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','4.0','OptionSet','forEach','UserLocalizedLabel','Label','Value','DisplayName','push',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Account,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','stack','name','send','index','Dynamics365Account','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','include','rows','show','params','includeAll','find','create','body','getConfigurations','Dynamics365Configuration','rawAttributes','order','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','ticketType','Incident','PhoneCall','title','description','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname'];(function(_0x2be6bc,_0x76f100){var _0xc25e=function(_0x2c719b){while(--_0x2c719b){_0x2be6bc['push'](_0x2be6bc['shift']());}};_0xc25e(++_0x76f100);}(_0xe1ae,0x137));var _0xee1a=function(_0x2ea4c4,_0x1fe353){_0x2ea4c4=_0x2ea4c4-0x0;var _0x34fcb0=_0xe1ae[_0x2ea4c4];return _0x34fcb0;};'use strict';var pdf=require(_0xee1a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xee1a('0x1'));var zipdir=require(_0xee1a('0x2'));var jsonpatch=require(_0xee1a('0x3'));var rp=require(_0xee1a('0x4'));var moment=require('moment');var BPromise=require(_0xee1a('0x5'));var Mustache=require(_0xee1a('0x6'));var util=require(_0xee1a('0x7'));var path=require('path');var sox=require(_0xee1a('0x8'));var csv=require(_0xee1a('0x9'));var ejs=require(_0xee1a('0xa'));var fs=require('fs');var _=require(_0xee1a('0xb'));var squel=require(_0xee1a('0xc'));var crypto=require(_0xee1a('0xd'));var jsforce=require(_0xee1a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xee1a('0xf'));var Papa=require(_0xee1a('0x10'));var authService=require(_0xee1a('0x11'));var hardwareService=require(_0xee1a('0x12'));var Redis=require(_0xee1a('0x13'));var qs=require(_0xee1a('0x14'));var logger=require(_0xee1a('0x15'))(_0xee1a('0x16'));var utils=require(_0xee1a('0x17'));var config=require(_0xee1a('0x18'));var db=require(_0xee1a('0x19'))['db'];var integrations=require(_0xee1a('0x1a'));var jayson=require(_0xee1a('0x1b'));var client=jayson[_0xee1a('0x1c')][_0xee1a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3c2c84,_0x1336d7,_0x3f40b0,_0x4afc0d){return new BPromise(function(_0x2a2820,_0x1dc765){var _0x99163d=_0x4afc0d||client;return _0x99163d[_0xee1a('0x1e')](_0x3c2c84,_0x3f40b0)[_0xee1a('0x1f')](function(_0x508676){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x1336d7,_0xee1a('0x20'));logger[_0xee1a('0x21')](_0xee1a('0x22'),_0x1336d7,'request\x20sent',JSON['stringify'](_0x508676));if(_0x508676['error']){if(_0x508676[_0xee1a('0x23')][_0xee1a('0x24')]===0x1f4){logger['error'](_0xee1a('0x25'),_0x1336d7,_0x508676[_0xee1a('0x23')][_0xee1a('0x26')]);return _0x1dc765(_0x508676[_0xee1a('0x23')][_0xee1a('0x26')]);}logger[_0xee1a('0x23')](_0xee1a('0x25'),_0x1336d7,_0x508676['error']['message']);return _0x2a2820(_0x508676[_0xee1a('0x23')][_0xee1a('0x26')]);}else{logger[_0xee1a('0x27')](_0xee1a('0x25'),_0x1336d7,_0xee1a('0x20'));_0x2a2820(_0x508676[_0xee1a('0x28')][_0xee1a('0x26')]);}})[_0xee1a('0x29')](function(_0x54a9fd){logger[_0xee1a('0x23')]('Dynamics365Account,\x20%s,\x20%s',_0x1336d7,_0x54a9fd);_0x1dc765(_0x54a9fd);});});}function respondWithStatusCode(_0x4bd1da,_0x39c389){_0x39c389=_0x39c389||0xcc;return function(_0x2d167c){if(_0x2d167c){return _0x4bd1da[_0xee1a('0x2a')](_0x39c389);}return _0x4bd1da[_0xee1a('0x2b')](_0x39c389)[_0xee1a('0x2c')]();};}function respondWithResult(_0x4893ee,_0x475f71){_0x475f71=_0x475f71||0xc8;return function(_0x300a31){if(_0x300a31){return _0x4893ee[_0xee1a('0x2b')](_0x475f71)[_0xee1a('0x2d')](_0x300a31);}};}function respondWithFilteredResult(_0xad1b2f,_0x403201){return function(_0x317942){if(_0x317942){var _0x4a9a0c=_0x317942[_0xee1a('0x2e')],_0x6b8b77=_0x403201['offset'],_0x5bba97=_0x403201[_0xee1a('0x2f')]+_0x403201[_0xee1a('0x30')],_0x606c27;if(_0x5bba97>=_0x4a9a0c){_0x5bba97=_0x4a9a0c;_0x606c27=0xc8;}else{_0x606c27=0xce;}_0xad1b2f[_0xee1a('0x2b')](_0x606c27);return _0xad1b2f[_0xee1a('0x31')](_0xee1a('0x32'),_0x6b8b77+'-'+_0x5bba97+'/'+_0x4a9a0c)[_0xee1a('0x2d')](_0x317942);}return null;};}function patchUpdates(_0x5109fa){return function(_0x1ffca6){try{jsonpatch['apply'](_0x1ffca6,_0x5109fa,!![]);}catch(_0x432cff){return BPromise[_0xee1a('0x33')](_0x432cff);}return _0x1ffca6['save']();};}function saveUpdates(_0xaca959,_0x13470f){return function(_0x246477){if(_0x246477){return _0x246477[_0xee1a('0x34')](_0xaca959)[_0xee1a('0x1f')](function(_0x21a7fa){return _0x21a7fa;});}return null;};}function removeEntity(_0x22fc4a,_0x2d1f86){return function(_0x8af493){if(_0x8af493){return _0x8af493[_0xee1a('0x35')]()[_0xee1a('0x1f')](function(){_0x22fc4a[_0xee1a('0x2b')](0xcc)[_0xee1a('0x2c')]();});}};}function handleEntityNotFound(_0x54fc22,_0x3f096b){return function(_0x3ea0f5){if(!_0x3ea0f5){_0x54fc22[_0xee1a('0x2a')](0x194);}return _0x3ea0f5;};}function handleError(_0x120684,_0x3309ad){_0x3309ad=_0x3309ad||0x1f4;return function(_0xaf227f){logger[_0xee1a('0x23')](_0xaf227f[_0xee1a('0x36')]);if(_0xaf227f[_0xee1a('0x37')]){delete _0xaf227f[_0xee1a('0x37')];}_0x120684[_0xee1a('0x2b')](_0x3309ad)[_0xee1a('0x38')](_0xaf227f);};}exports[_0xee1a('0x39')]=function(_0xaf380f,_0x3eaf56){var _0x4e1443={},_0x26e3ed={},_0xa5a8d7={'count':0x0,'rows':[]};var _0x32ceba=db[_0xee1a('0x3a')]['rawAttributes'];_0x26e3ed[_0xee1a('0x3b')]=_[_0xee1a('0x3c')](_0x32ceba);_0x26e3ed[_0xee1a('0x3d')]=_[_0xee1a('0x3c')](_0xaf380f[_0xee1a('0x3d')]);_0x26e3ed[_0xee1a('0x3e')]=_[_0xee1a('0x3f')](_0x26e3ed[_0xee1a('0x3b')],_0x26e3ed['query']);_0x4e1443[_0xee1a('0x40')]=_[_0xee1a('0x3f')](_0x26e3ed[_0xee1a('0x3b')],qs[_0xee1a('0x41')](_0xaf380f[_0xee1a('0x3d')]['fields']));_0x4e1443['attributes']=_0x4e1443[_0xee1a('0x40')][_0xee1a('0x42')]?_0x4e1443['attributes']:_0x26e3ed[_0xee1a('0x3b')];if(!_0xaf380f['query'][_0xee1a('0x43')]('nolimit')){_0x4e1443[_0xee1a('0x30')]=qs['limit'](_0xaf380f['query'][_0xee1a('0x30')]);_0x4e1443[_0xee1a('0x2f')]=qs[_0xee1a('0x2f')](_0xaf380f[_0xee1a('0x3d')][_0xee1a('0x2f')]);}_0x4e1443['order']=qs['sort'](_0xaf380f[_0xee1a('0x3d')][_0xee1a('0x44')]);_0x4e1443[_0xee1a('0x45')]=qs[_0xee1a('0x3e')](_[_0xee1a('0x46')](_0xaf380f[_0xee1a('0x3d')],_0x26e3ed[_0xee1a('0x3e')]));if(_0xaf380f['query']['filter']){_0x4e1443[_0xee1a('0x45')]=_[_0xee1a('0x47')](_0x4e1443[_0xee1a('0x45')],{'$or':_[_0xee1a('0x48')](_0x32ceba,function(_0x172964){if(_0x172964[_0xee1a('0x49')][_0xee1a('0x4a')]!==_0xee1a('0x4b')){var _0x11e534={};_0x11e534[_0x172964['field']]={'$like':'%'+_0xaf380f[_0xee1a('0x3d')][_0xee1a('0x4c')]+'%'};return _0x11e534;}})});}_0x4e1443=_[_0xee1a('0x47')]({},_0x4e1443,_0xaf380f[_0xee1a('0x4d')]);var _0x563856={'where':_0x4e1443['where']};return db[_0xee1a('0x3a')]['count'](_0x563856)['then'](function(_0x3d5864){_0xa5a8d7[_0xee1a('0x2e')]=_0x3d5864;if(_0xaf380f['query']['includeAll']){_0x4e1443[_0xee1a('0x4e')]=[{'all':!![]}];}return db[_0xee1a('0x3a')]['findAll'](_0x4e1443);})['then'](function(_0x58801e){_0xa5a8d7[_0xee1a('0x4f')]=_0x58801e;return _0xa5a8d7;})[_0xee1a('0x1f')](respondWithFilteredResult(_0x3eaf56,_0x4e1443))[_0xee1a('0x29')](handleError(_0x3eaf56,null));};exports[_0xee1a('0x50')]=function(_0x165a2c,_0x4eaa84){var _0x1bc7d0={'raw':![],'where':{'id':_0x165a2c[_0xee1a('0x51')]['id']}},_0x4c3452={};_0x4c3452[_0xee1a('0x3b')]=_[_0xee1a('0x3c')](db['Dynamics365Account']['rawAttributes']);_0x4c3452[_0xee1a('0x3d')]=_[_0xee1a('0x3c')](_0x165a2c[_0xee1a('0x3d')]);_0x4c3452[_0xee1a('0x3e')]=_['intersection'](_0x4c3452[_0xee1a('0x3b')],_0x4c3452[_0xee1a('0x3d')]);_0x1bc7d0[_0xee1a('0x40')]=_[_0xee1a('0x3f')](_0x4c3452[_0xee1a('0x3b')],qs['fields'](_0x165a2c[_0xee1a('0x3d')][_0xee1a('0x41')]));_0x1bc7d0[_0xee1a('0x40')]=_0x1bc7d0['attributes'][_0xee1a('0x42')]?_0x1bc7d0[_0xee1a('0x40')]:_0x4c3452[_0xee1a('0x3b')];if(_0x165a2c[_0xee1a('0x3d')][_0xee1a('0x52')]){_0x1bc7d0[_0xee1a('0x4e')]=[{'all':!![]}];}_0x1bc7d0=_[_0xee1a('0x47')]({},_0x1bc7d0,_0x165a2c[_0xee1a('0x4d')]);return db[_0xee1a('0x3a')][_0xee1a('0x53')](_0x1bc7d0)[_0xee1a('0x1f')](handleEntityNotFound(_0x4eaa84,null))[_0xee1a('0x1f')](respondWithResult(_0x4eaa84,null))[_0xee1a('0x29')](handleError(_0x4eaa84,null));};exports['create']=function(_0x2561d0,_0x2e10dd){return db['Dynamics365Account'][_0xee1a('0x54')](_0x2561d0[_0xee1a('0x55')],{})[_0xee1a('0x1f')](respondWithResult(_0x2e10dd,0xc9))[_0xee1a('0x29')](handleError(_0x2e10dd,null));};exports['update']=function(_0x4cbd90,_0xeb0a96){if(_0x4cbd90[_0xee1a('0x55')]['id']){delete _0x4cbd90[_0xee1a('0x55')]['id'];}return db[_0xee1a('0x3a')][_0xee1a('0x53')]({'where':{'id':_0x4cbd90[_0xee1a('0x51')]['id']}})[_0xee1a('0x1f')](handleEntityNotFound(_0xeb0a96,null))[_0xee1a('0x1f')](saveUpdates(_0x4cbd90[_0xee1a('0x55')],null))['then'](respondWithResult(_0xeb0a96,null))[_0xee1a('0x29')](handleError(_0xeb0a96,null));};exports['destroy']=function(_0x10c1fe,_0x14c5f6){return db[_0xee1a('0x3a')]['find']({'where':{'id':_0x10c1fe['params']['id']}})['then'](handleEntityNotFound(_0x14c5f6,null))[_0xee1a('0x1f')](removeEntity(_0x14c5f6,null))[_0xee1a('0x29')](handleError(_0x14c5f6,null));};exports[_0xee1a('0x56')]=function(_0xaceb05,_0x4da456,_0x59871c){var _0x30763e={};var _0x5be76a={};var _0x379398;var _0x2c08f6;return db[_0xee1a('0x3a')]['findOne']({'where':{'id':_0xaceb05[_0xee1a('0x51')]['id']}})['then'](handleEntityNotFound(_0x4da456,null))[_0xee1a('0x1f')](function(_0x1ad824){if(_0x1ad824){_0x379398=_0x1ad824;_0x5be76a[_0xee1a('0x3b')]=_[_0xee1a('0x3c')](db[_0xee1a('0x57')][_0xee1a('0x58')]);_0x5be76a[_0xee1a('0x3d')]=_[_0xee1a('0x3c')](_0xaceb05[_0xee1a('0x3d')]);_0x5be76a['filters']=_[_0xee1a('0x3f')](_0x5be76a[_0xee1a('0x3b')],_0x5be76a['query']);_0x30763e['attributes']=_[_0xee1a('0x3f')](_0x5be76a['model'],qs['fields'](_0xaceb05[_0xee1a('0x3d')][_0xee1a('0x41')]));_0x30763e['attributes']=_0x30763e[_0xee1a('0x40')]['length']?_0x30763e['attributes']:_0x5be76a[_0xee1a('0x3b')];_0x30763e[_0xee1a('0x59')]=qs['sort'](_0xaceb05[_0xee1a('0x3d')][_0xee1a('0x44')]);_0x30763e[_0xee1a('0x45')]=qs[_0xee1a('0x3e')](_[_0xee1a('0x46')](_0xaceb05[_0xee1a('0x3d')],_0x5be76a['filters']));if(_0xaceb05[_0xee1a('0x3d')][_0xee1a('0x4c')]){_0x30763e['where']=_['merge'](_0x30763e['where'],{'$or':_['map'](_0x30763e[_0xee1a('0x40')],function(_0x286763){var _0x15bc51={};_0x15bc51[_0x286763]={'$like':'%'+_0xaceb05[_0xee1a('0x3d')]['filter']+'%'};return _0x15bc51;})});}_0x30763e=_['merge']({},_0x30763e,_0xaceb05[_0xee1a('0x4d')]);return _0x379398[_0xee1a('0x56')](_0x30763e);}})[_0xee1a('0x1f')](function(_0xaf110b){if(_0xaf110b){_0x2c08f6=_0xaf110b[_0xee1a('0x42')];if(!_0xaceb05[_0xee1a('0x3d')]['hasOwnProperty'](_0xee1a('0x5a'))){_0x30763e[_0xee1a('0x30')]=qs[_0xee1a('0x30')](_0xaceb05[_0xee1a('0x3d')][_0xee1a('0x30')]);_0x30763e[_0xee1a('0x2f')]=qs[_0xee1a('0x2f')](_0xaceb05[_0xee1a('0x3d')][_0xee1a('0x2f')]);}return _0x379398[_0xee1a('0x56')](_0x30763e);}})[_0xee1a('0x1f')](function(_0x429b1a){if(_0x429b1a){return _0x429b1a?{'count':_0x2c08f6,'rows':_0x429b1a}:null;}})[_0xee1a('0x1f')](respondWithResult(_0x4da456,null))[_0xee1a('0x29')](handleError(_0x4da456,null));};exports[_0xee1a('0x5b')]=function(_0x5500a0,_0x1105aa,_0xa619ca){if(_0x5500a0['body']['id']){delete _0x5500a0[_0xee1a('0x55')]['id'];}return db[_0xee1a('0x3a')][_0xee1a('0x5c')]({'where':{'id':_0x5500a0[_0xee1a('0x51')]['id']}})[_0xee1a('0x1f')](handleEntityNotFound(_0x1105aa,null))[_0xee1a('0x1f')](function(_0x82ff38){if(_0x82ff38){_0x5500a0[_0xee1a('0x55')][_0xee1a('0x5d')]=_0x82ff38['id'];_0x5500a0['body'][_0xee1a('0x5e')]=integrations[_0xee1a('0x5f')](_0x5500a0[_0xee1a('0x55')][_0xee1a('0x60')],_0x5500a0[_0xee1a('0x55')][_0xee1a('0x49')]);_0x5500a0[_0xee1a('0x55')][_0xee1a('0x61')]=integrations[_0xee1a('0x62')](_0x5500a0[_0xee1a('0x55')][_0xee1a('0x60')],_0x5500a0[_0xee1a('0x55')][_0xee1a('0x49')]);return db[_0xee1a('0x57')][_0xee1a('0x54')](_0x5500a0['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0xee1a('0x5e')},{'model':db['Dynamics365Field'],'as':_0xee1a('0x61')}]});}return null;})[_0xee1a('0x1f')](respondWithResult(_0x1105aa,null))[_0xee1a('0x29')](handleError(_0x1105aa,null));};exports[_0xee1a('0x63')]=function(_0x323f5e,_0x4ef2a8,_0x292647){var _0x145070=_0x323f5e[_0xee1a('0x3d')][_0xee1a('0x64')];var _0x591b29=_0x145070==='incident'?_0xee1a('0x65'):_0xee1a('0x66');var _0x20471c='';var _0x35af59='';var _0x35c301='';var _0x465305='';var _0x1052c2='';var _0x14aed0='';var _0x2f28a3='';var _0x433580='';var _0xd25328=[_0xee1a('0x67'),_0xee1a('0x68'),_0xee1a('0x69'),_0xee1a('0x6a'),'caseorigincode',_0xee1a('0x6b'),_0xee1a('0x6c'),_0xee1a('0x6d'),_0xee1a('0x6e'),_0xee1a('0x6f')];var _0x1e74d6=[_0xee1a('0x70'),_0xee1a('0x71'),_0xee1a('0x72'),_0xee1a('0x73'),_0xee1a('0x74'),_0xee1a('0x75'),_0xee1a('0x76'),_0xee1a('0x77'),'createdbyexternalpartyname',_0xee1a('0x78'),_0xee1a('0x79'),_0xee1a('0x7a'),_0xee1a('0x7b'),_0xee1a('0x7c'),_0xee1a('0x7d'),_0xee1a('0x7e'),_0xee1a('0x7f'),_0xee1a('0x80'),'emailaddress','entitlementidname','entityimage_timestamp',_0xee1a('0x81'),_0xee1a('0x82'),'exchangerate',_0xee1a('0x83'),_0xee1a('0x84'),'importsequencenumber',_0xee1a('0x85'),'kbarticleidname',_0xee1a('0x86'),_0xee1a('0x87'),'modifiedbyexternalpartyname',_0xee1a('0x88'),_0xee1a('0x89'),'modifiedbyyominame',_0xee1a('0x8a'),_0xee1a('0x8b'),'modifiedonbehalfbyyominame',_0xee1a('0x8c'),'msdyn_iotalertname',_0xee1a('0x8d'),_0xee1a('0x8e'),'overriddencreatedon','owneridname',_0xee1a('0x8f'),_0xee1a('0x90'),'parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename',_0xee1a('0x91'),_0xee1a('0x92'),_0xee1a('0x93'),_0xee1a('0x94'),'responseby',_0xee1a('0x95'),_0xee1a('0x96'),_0xee1a('0x97'),_0xee1a('0x98'),_0xee1a('0x99'),'socialprofileidname',_0xee1a('0x9a'),'statuscode',_0xee1a('0x9b'),_0xee1a('0x9c'),_0xee1a('0x9d'),_0xee1a('0x9e'),_0xee1a('0x9f'),_0xee1a('0xa0'),_0xee1a('0xa1')];var _0xb2486=_0xd25328['concat'](_0x1e74d6);return db['Dynamics365Account'][_0xee1a('0x5c')]({'where':{'id':_0x323f5e['params']['id']},'attributes':['id',_0xee1a('0xa2'),_0xee1a('0xa3'),_0xee1a('0xa4'),_0xee1a('0xa5'),_0xee1a('0xa6'),_0xee1a('0xa7')]})['then'](handleEntityNotFound(_0x4ef2a8,null))[_0xee1a('0x1f')](function(_0x11b2f0){if(_0x11b2f0){_0x433580=_0x11b2f0[_0xee1a('0xa4')];var _0x157e82=_0x433580[_0xee1a('0xa8')](-0x1);if(_0x157e82==='/'){_0x433580=_0x433580[_0xee1a('0xa9')](0x0,_0x433580[_0xee1a('0xaa')](_0x157e82));}_0x2f28a3=util[_0xee1a('0xab')]('%s/api/data/v9.0/',_0x433580);var _0x2485dc={'method':_0xee1a('0xac'),'uri':_0xee1a('0xad')+_0x11b2f0['tenantId']+'/oauth2/token','form':{'client_id':_0x11b2f0[_0xee1a('0xa6')],'resource':_0x433580,'username':_0x11b2f0[_0xee1a('0xa2')],'password':_0x11b2f0[_0xee1a('0xa3')],'grant_type':_0xee1a('0xa3'),'client_secret':_0x11b2f0[_0xee1a('0xa7')]},'json':!![]};return rp(_0x2485dc);}})[_0xee1a('0x1f')](function(_0x44100a){_0x14aed0=_0x44100a['access_token'];var _0x548d81={'method':_0xee1a('0xae'),'uri':encodeURI(_0x2f28a3+_0xee1a('0xaf')+_0x591b29+'\x27'),'headers':{'Authorization':_0xee1a('0xb0')+_0x14aed0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x548d81);})[_0xee1a('0x1f')](function(_0x5e5f9c){var _0x319f83=_0x5e5f9c['value'][0x0];var _0x2e9481=_0x319f83['MetadataId'];var _0x5263c0={'method':_0xee1a('0xae'),'uri':_0x2f28a3+_0xee1a('0xb1')+_0x2e9481+_0xee1a('0xb2'),'headers':{'Authorization':_0xee1a('0xb0')+_0x14aed0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5263c0);})[_0xee1a('0x1f')](function(_0x3eab6e){_0x20471c=_0x3eab6e;_0x35af59=_0x20471c[_0xee1a('0xb3')];_0x35af59=_[_0xee1a('0xb4')](_0x35af59,function(_0x2df637){return!_0xb2486[_0xee1a('0xb5')](_0x2df637[_0xee1a('0xb6')]);});var _0x403249=[];var _0x4abf11=[];_0x35af59['forEach'](function(_0x572240){if(_0x572240[_0xee1a('0xb7')]){var _0x2e5eea=_0x572240['@odata.type'][_0xee1a('0xa9')](_0x572240[_0xee1a('0xb7')][_0xee1a('0xaa')]('.')+0x1);if(_0x2e5eea===_0xee1a('0xb8')){_0x403249['push'](getSelectList(_0x2f28a3,_0x145070,_0x4abf11,_0x20471c[_0xee1a('0xb9')],_0x572240[_0xee1a('0xb9')],_0x14aed0));}}});return Promise[_0xee1a('0xba')](_0x403249);})[_0xee1a('0x1f')](function(_0x3e326c){_0x35c301=_0x3e326c[0x0];var _0x11f54e=[];var _0x18b8ac=[];_0x35af59['forEach'](function(_0x5dd35f){if(_0x5dd35f['@odata.type']){var _0x42ca7f=_0x5dd35f[_0xee1a('0xb7')][_0xee1a('0xa9')](_0x5dd35f[_0xee1a('0xb7')]['lastIndexOf']('.')+0x1);if(_0x42ca7f===_0xee1a('0xbb')){_0x11f54e['push'](getBooleanList(_0x2f28a3,_0x145070,_0x18b8ac,_0x20471c['MetadataId'],_0x5dd35f[_0xee1a('0xb9')],_0x14aed0));}}});return Promise[_0xee1a('0xba')](_0x11f54e);})[_0xee1a('0x1f')](function(_0x2bb831){_0x465305=_0x2bb831[0x0];var _0x566f6e=[];var _0x12c179=[];_0x35af59['forEach'](function(_0x592d81){if(_0x592d81[_0xee1a('0xb7')]){var _0x13c85c=_0x592d81[_0xee1a('0xb7')][_0xee1a('0xa9')](_0x592d81[_0xee1a('0xb7')][_0xee1a('0xaa')]('.')+0x1);if(_0x13c85c===_0xee1a('0xbc')||_0x13c85c===_0xee1a('0xbd')||_0x13c85c==='BigIntAttributeMetadata'||_0x13c85c===_0xee1a('0xbe')||_0x13c85c===_0xee1a('0xbf')||_0x13c85c===_0xee1a('0xc0')||_0x13c85c==='StatusAttributeMetadata'||_0x13c85c===_0xee1a('0xc1')||_0x13c85c===_0xee1a('0xc2')||_0x13c85c===_0xee1a('0xc3')){_0x566f6e['push'](getInputList(_0x2f28a3,_0x145070,_0x13c85c,_0x12c179,_0x20471c[_0xee1a('0xb9')],_0x592d81[_0xee1a('0xb9')],_0x14aed0));}}});return Promise['all'](_0x566f6e);})['then'](function(_0x2e1aaa){_0x1052c2=_0x2e1aaa[0x0];var _0xd8a8b9=_0x35c301[_0xee1a('0xc4')](_0x465305)['concat'](_0x1052c2);var _0x2d8bd3={'count':_0xd8a8b9[_0xee1a('0x42')],'rows':_0xd8a8b9};return _0x2d8bd3;})[_0xee1a('0x1f')](respondWithResult(_0x4ef2a8,null))['catch'](function(_0x10d39e){console[_0xee1a('0xc5')](_0xee1a('0xc6')+_0x10d39e);var _0x31601e=_0x323f5e[_0xee1a('0x3d')][_0xee1a('0xc7')]?0x1f4:_0x10d39e['statusCode']||0x1f4;logger[_0xee1a('0x23')](_0x10d39e[_0xee1a('0x36')]);delete _0x10d39e[_0xee1a('0x37')];if(_0x31601e===0x191){_0x31601e=0x190;}_0x4ef2a8['status'](_0x31601e)[_0xee1a('0x38')](_0x323f5e[_0xee1a('0x3d')]['test']?{'message':_0xee1a('0xc8'),'statusCode':_0x10d39e[_0xee1a('0xc9')]}:_0x10d39e);});};function getSelectList(_0x25322f,_0x301957,_0xc830f1,_0x484dd9,_0x2d4631,_0x3e0f2b){var _0x4525f9={'method':'GET','uri':_0x25322f+_0xee1a('0xb1')+_0x484dd9+_0xee1a('0xca')+_0x2d4631+_0xee1a('0xcb')+_0xee1a('0xcc'),'headers':{'Authorization':'Bearer\x20'+_0x3e0f2b,'If-None-Match':null,'OData-Version':_0xee1a('0xcd')},'json':!![]};return rp(_0x4525f9)[_0xee1a('0x1f')](function(_0xb3e841){var _0x545b05=[];var _0x3f8de8=_0xb3e841[_0xee1a('0xce')]['Options'];_0x3f8de8[_0xee1a('0xcf')](function(_0x4105b4){_0x545b05['push']({'name':_0x4105b4['Label'][_0xee1a('0xd0')][_0xee1a('0xd1')],'value':String(_0x4105b4[_0xee1a('0xd2')])});});var _0x305a81={'id':_0x301957+'_'+_0xb3e841[_0xee1a('0xb6')],'name':_0xb3e841[_0xee1a('0xd3')][_0xee1a('0xd0')]['Label'],'custom':![],'options':_0x545b05};_0xc830f1[_0xee1a('0xd4')](_0x305a81);return _0xc830f1;});}function getBooleanList(_0x5e3f4e,_0x1417fd,_0x2c8787,_0x1df45d,_0x19c717,_0x4c4a03){var _0x3bb144={'method':_0xee1a('0xae'),'uri':_0x5e3f4e+_0xee1a('0xb1')+_0x1df45d+_0xee1a('0xca')+_0x19c717+_0xee1a('0xd5'),'headers':{'Authorization':_0xee1a('0xb0')+_0x4c4a03,'If-None-Match':null,'OData-Version':_0xee1a('0xcd')},'json':!![]};return rp(_0x3bb144)[_0xee1a('0x1f')](function(_0x2d230f){var _0x5ce49a=[];_0x5ce49a[_0xee1a('0xd4')]({'name':_0x2d230f[_0xee1a('0xce')]['TrueOption'][_0xee1a('0xd1')][_0xee1a('0xd0')][_0xee1a('0xd1')],'value':String(_0x2d230f['OptionSet'][_0xee1a('0xd6')][_0xee1a('0xd2')])},{'name':_0x2d230f[_0xee1a('0xce')][_0xee1a('0xd7')][_0xee1a('0xd1')]['UserLocalizedLabel'][_0xee1a('0xd1')],'value':String(_0x2d230f[_0xee1a('0xce')]['FalseOption'][_0xee1a('0xd2')])});var _0x3d375e={'id':_0x1417fd+'_'+_0x2d230f[_0xee1a('0xb6')],'name':_0x2d230f[_0xee1a('0xd3')][_0xee1a('0xd0')]['Label'],'custom':![],'options':_0x5ce49a};_0x2c8787['push'](_0x3d375e);return _0x2c8787;});}function getInputList(_0xa01a32,_0x32f30a,_0x23980b,_0x2fff51,_0x167086,_0x43f668,_0x190ac4){var _0x1e4a60={'method':_0xee1a('0xae'),'uri':_0xa01a32+_0xee1a('0xb1')+_0x167086+_0xee1a('0xca')+_0x43f668+_0xee1a('0xd8')+_0x23980b+_0xee1a('0xd9'),'headers':{'Authorization':'Bearer\x20'+_0x190ac4,'If-None-Match':null,'OData-Version':_0xee1a('0xcd')},'json':!![]};return rp(_0x1e4a60)[_0xee1a('0x1f')](function(_0x5ac31e){var _0x61aae7={'id':_0x32f30a+'_'+_0x5ac31e[_0xee1a('0xb6')],'name':_0x5ac31e[_0xee1a('0xd3')][_0xee1a('0xd0')]?_0x5ac31e['DisplayName'][_0xee1a('0xd0')]['Label']:_0x5ac31e['LogicalName'],'custom':![],'options':[]};_0x2fff51['push'](_0x61aae7);return _0x2fff51;});} \ No newline at end of file +var _0x5139=['model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','key','VIRTUAL','field','options','Dynamics365Account','count','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','Dynamics365Configuration','order','map','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','type','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','description','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','MetadataId','forEach','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Dynamics365\x20error:\x20','test','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','rawAttributes'];(function(_0x3fcd8d,_0x4db30c){var _0x189952=function(_0x42652c){while(--_0x42652c){_0x3fcd8d['push'](_0x3fcd8d['shift']());}};_0x189952(++_0x4db30c);}(_0x5139,0xa7));var _0x9513=function(_0x38f5f8,_0xefe164){_0x38f5f8=_0x38f5f8-0x0;var _0x34e820=_0x5139[_0x38f5f8];return _0x34e820;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9513('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9513('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9513('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9513('0x3'));var util=require(_0x9513('0x4'));var path=require(_0x9513('0x5'));var sox=require(_0x9513('0x6'));var csv=require('to-csv');var ejs=require(_0x9513('0x7'));var fs=require('fs');var _=require(_0x9513('0x8'));var squel=require('squel');var crypto=require(_0x9513('0x9'));var jsforce=require(_0x9513('0xa'));var deskjs=require(_0x9513('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9513('0xc'));var authService=require(_0x9513('0xd'));var hardwareService=require(_0x9513('0xe'));var Redis=require(_0x9513('0xf'));var qs=require(_0x9513('0x10'));var logger=require(_0x9513('0x11'))(_0x9513('0x12'));var utils=require(_0x9513('0x13'));var config=require(_0x9513('0x14'));var db=require(_0x9513('0x15'))['db'];var integrations=require(_0x9513('0x16'));var jayson=require(_0x9513('0x17'));var client=jayson[_0x9513('0x18')][_0x9513('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x15af83,_0x20036e,_0x3b2df6,_0x2d0d95){return new BPromise(function(_0x30ce51,_0x59e71a){var _0x59ec9c=_0x2d0d95||client;return _0x59ec9c['request'](_0x15af83,_0x3b2df6)[_0x9513('0x1a')](function(_0x20ccf0){logger[_0x9513('0x1b')](_0x9513('0x1c'),_0x20036e,_0x9513('0x1d'));logger[_0x9513('0x1e')](_0x9513('0x1f'),_0x20036e,'request\x20sent',JSON[_0x9513('0x20')](_0x20ccf0));if(_0x20ccf0['error']){if(_0x20ccf0['error'][_0x9513('0x21')]===0x1f4){logger['error'](_0x9513('0x1c'),_0x20036e,_0x20ccf0[_0x9513('0x22')][_0x9513('0x23')]);return _0x59e71a(_0x20ccf0[_0x9513('0x22')][_0x9513('0x23')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x20036e,_0x20ccf0['error'][_0x9513('0x23')]);return _0x30ce51(_0x20ccf0[_0x9513('0x22')]['message']);}else{logger[_0x9513('0x1b')]('Dynamics365Account,\x20%s,\x20%s',_0x20036e,_0x9513('0x1d'));_0x30ce51(_0x20ccf0[_0x9513('0x24')][_0x9513('0x23')]);}})[_0x9513('0x25')](function(_0x26dfc0){logger[_0x9513('0x22')](_0x9513('0x1c'),_0x20036e,_0x26dfc0);_0x59e71a(_0x26dfc0);});});}function respondWithStatusCode(_0x339968,_0x21a7cd){_0x21a7cd=_0x21a7cd||0xcc;return function(_0x29d747){if(_0x29d747){return _0x339968[_0x9513('0x26')](_0x21a7cd);}return _0x339968[_0x9513('0x27')](_0x21a7cd)['end']();};}function respondWithResult(_0x560424,_0x3a6233){_0x3a6233=_0x3a6233||0xc8;return function(_0x3729b1){if(_0x3729b1){return _0x560424[_0x9513('0x27')](_0x3a6233)[_0x9513('0x28')](_0x3729b1);}};}function respondWithFilteredResult(_0x2716b7,_0x432a00){return function(_0x21a9a8){if(_0x21a9a8){var _0x3a6fa9=_0x21a9a8['count'],_0x369ad7=_0x432a00[_0x9513('0x29')],_0x10b493=_0x432a00[_0x9513('0x29')]+_0x432a00[_0x9513('0x2a')],_0x44f700;if(_0x10b493>=_0x3a6fa9){_0x10b493=_0x3a6fa9;_0x44f700=0xc8;}else{_0x44f700=0xce;}_0x2716b7[_0x9513('0x27')](_0x44f700);return _0x2716b7['set'](_0x9513('0x2b'),_0x369ad7+'-'+_0x10b493+'/'+_0x3a6fa9)[_0x9513('0x28')](_0x21a9a8);}return null;};}function patchUpdates(_0x255b38){return function(_0x1c1dfc){try{jsonpatch[_0x9513('0x2c')](_0x1c1dfc,_0x255b38,!![]);}catch(_0x54824d){return BPromise[_0x9513('0x2d')](_0x54824d);}return _0x1c1dfc[_0x9513('0x2e')]();};}function saveUpdates(_0x3eb081,_0x3d1035){return function(_0x2494a7){if(_0x2494a7){return _0x2494a7[_0x9513('0x2f')](_0x3eb081)[_0x9513('0x1a')](function(_0x19604b){return _0x19604b;});}return null;};}function removeEntity(_0x2887bc,_0x141075){return function(_0x1d7f18){if(_0x1d7f18){return _0x1d7f18[_0x9513('0x30')]()[_0x9513('0x1a')](function(){_0x2887bc[_0x9513('0x27')](0xcc)[_0x9513('0x31')]();});}};}function handleEntityNotFound(_0x5876f0,_0x5590be){return function(_0x53087e){if(!_0x53087e){_0x5876f0[_0x9513('0x26')](0x194);}return _0x53087e;};}function handleError(_0x15d1dc,_0x18524c){_0x18524c=_0x18524c||0x1f4;return function(_0x295513){logger['error'](_0x295513[_0x9513('0x32')]);if(_0x295513[_0x9513('0x33')]){delete _0x295513[_0x9513('0x33')];}_0x15d1dc['status'](_0x18524c)[_0x9513('0x34')](_0x295513);};}exports[_0x9513('0x35')]=function(_0x264021,_0x538b8b){var _0x57cb2d={},_0x23d116={},_0x511587={'count':0x0,'rows':[]};var _0x2b8a9a=db['Dynamics365Account'][_0x9513('0x36')];_0x23d116[_0x9513('0x37')]=_[_0x9513('0x38')](_0x2b8a9a);_0x23d116[_0x9513('0x39')]=_[_0x9513('0x38')](_0x264021[_0x9513('0x39')]);_0x23d116['filters']=_[_0x9513('0x3a')](_0x23d116['model'],_0x23d116['query']);_0x57cb2d[_0x9513('0x3b')]=_[_0x9513('0x3a')](_0x23d116[_0x9513('0x37')],qs[_0x9513('0x3c')](_0x264021['query']['fields']));_0x57cb2d[_0x9513('0x3b')]=_0x57cb2d[_0x9513('0x3b')][_0x9513('0x3d')]?_0x57cb2d[_0x9513('0x3b')]:_0x23d116[_0x9513('0x37')];if(!_0x264021[_0x9513('0x39')][_0x9513('0x3e')]('nolimit')){_0x57cb2d['limit']=qs['limit'](_0x264021[_0x9513('0x39')]['limit']);_0x57cb2d[_0x9513('0x29')]=qs[_0x9513('0x29')](_0x264021[_0x9513('0x39')]['offset']);}_0x57cb2d['order']=qs[_0x9513('0x3f')](_0x264021['query'][_0x9513('0x3f')]);_0x57cb2d[_0x9513('0x40')]=qs[_0x9513('0x41')](_[_0x9513('0x42')](_0x264021[_0x9513('0x39')],_0x23d116[_0x9513('0x41')]));if(_0x264021[_0x9513('0x39')][_0x9513('0x43')]){_0x57cb2d['where']=_[_0x9513('0x44')](_0x57cb2d[_0x9513('0x40')],{'$or':_['map'](_0x2b8a9a,function(_0x4b0c79){if(_0x4b0c79['type'][_0x9513('0x45')]!==_0x9513('0x46')){var _0x3d580d={};_0x3d580d[_0x4b0c79[_0x9513('0x47')]]={'$like':'%'+_0x264021[_0x9513('0x39')][_0x9513('0x43')]+'%'};return _0x3d580d;}})});}_0x57cb2d=_[_0x9513('0x44')]({},_0x57cb2d,_0x264021[_0x9513('0x48')]);var _0x4ac363={'where':_0x57cb2d[_0x9513('0x40')]};return db[_0x9513('0x49')][_0x9513('0x4a')](_0x4ac363)[_0x9513('0x1a')](function(_0x307964){_0x511587['count']=_0x307964;if(_0x264021['query'][_0x9513('0x4b')]){_0x57cb2d[_0x9513('0x4c')]=[{'all':!![]}];}return db[_0x9513('0x49')][_0x9513('0x4d')](_0x57cb2d);})[_0x9513('0x1a')](function(_0x4370f4){_0x511587[_0x9513('0x4e')]=_0x4370f4;return _0x511587;})['then'](respondWithFilteredResult(_0x538b8b,_0x57cb2d))[_0x9513('0x25')](handleError(_0x538b8b,null));};exports[_0x9513('0x4f')]=function(_0x2316ec,_0x5b0dd3){var _0xd730f5={'raw':![],'where':{'id':_0x2316ec[_0x9513('0x50')]['id']}},_0x40aaf3={};_0x40aaf3[_0x9513('0x37')]=_[_0x9513('0x38')](db[_0x9513('0x49')][_0x9513('0x36')]);_0x40aaf3[_0x9513('0x39')]=_[_0x9513('0x38')](_0x2316ec[_0x9513('0x39')]);_0x40aaf3[_0x9513('0x41')]=_[_0x9513('0x3a')](_0x40aaf3[_0x9513('0x37')],_0x40aaf3[_0x9513('0x39')]);_0xd730f5[_0x9513('0x3b')]=_[_0x9513('0x3a')](_0x40aaf3['model'],qs['fields'](_0x2316ec[_0x9513('0x39')][_0x9513('0x3c')]));_0xd730f5[_0x9513('0x3b')]=_0xd730f5[_0x9513('0x3b')][_0x9513('0x3d')]?_0xd730f5[_0x9513('0x3b')]:_0x40aaf3['model'];if(_0x2316ec['query'][_0x9513('0x4b')]){_0xd730f5[_0x9513('0x4c')]=[{'all':!![]}];}_0xd730f5=_[_0x9513('0x44')]({},_0xd730f5,_0x2316ec['options']);return db[_0x9513('0x49')][_0x9513('0x51')](_0xd730f5)[_0x9513('0x1a')](handleEntityNotFound(_0x5b0dd3,null))['then'](respondWithResult(_0x5b0dd3,null))[_0x9513('0x25')](handleError(_0x5b0dd3,null));};exports[_0x9513('0x52')]=function(_0x241692,_0x168e3a){return db[_0x9513('0x49')]['create'](_0x241692[_0x9513('0x53')],{})['then'](respondWithResult(_0x168e3a,0xc9))[_0x9513('0x25')](handleError(_0x168e3a,null));};exports[_0x9513('0x2f')]=function(_0x269365,_0x6f9be9){if(_0x269365['body']['id']){delete _0x269365[_0x9513('0x53')]['id'];}return db[_0x9513('0x49')][_0x9513('0x51')]({'where':{'id':_0x269365['params']['id']}})['then'](handleEntityNotFound(_0x6f9be9,null))[_0x9513('0x1a')](saveUpdates(_0x269365[_0x9513('0x53')],null))[_0x9513('0x1a')](respondWithResult(_0x6f9be9,null))[_0x9513('0x25')](handleError(_0x6f9be9,null));};exports[_0x9513('0x30')]=function(_0x5dd26d,_0x4f4635){return db[_0x9513('0x49')]['find']({'where':{'id':_0x5dd26d[_0x9513('0x50')]['id']}})[_0x9513('0x1a')](handleEntityNotFound(_0x4f4635,null))[_0x9513('0x1a')](removeEntity(_0x4f4635,null))[_0x9513('0x25')](handleError(_0x4f4635,null));};exports[_0x9513('0x54')]=function(_0x5b2f98,_0x571962,_0x2ddc67){var _0x1a496c={};var _0x1b3a62={};var _0x2c6115;var _0x3eb58;return db['Dynamics365Account']['findOne']({'where':{'id':_0x5b2f98[_0x9513('0x50')]['id']}})['then'](handleEntityNotFound(_0x571962,null))[_0x9513('0x1a')](function(_0x40b0be){if(_0x40b0be){_0x2c6115=_0x40b0be;_0x1b3a62[_0x9513('0x37')]=_[_0x9513('0x38')](db[_0x9513('0x55')]['rawAttributes']);_0x1b3a62['query']=_[_0x9513('0x38')](_0x5b2f98[_0x9513('0x39')]);_0x1b3a62[_0x9513('0x41')]=_['intersection'](_0x1b3a62['model'],_0x1b3a62['query']);_0x1a496c['attributes']=_[_0x9513('0x3a')](_0x1b3a62[_0x9513('0x37')],qs[_0x9513('0x3c')](_0x5b2f98[_0x9513('0x39')]['fields']));_0x1a496c[_0x9513('0x3b')]=_0x1a496c[_0x9513('0x3b')][_0x9513('0x3d')]?_0x1a496c['attributes']:_0x1b3a62[_0x9513('0x37')];_0x1a496c[_0x9513('0x56')]=qs['sort'](_0x5b2f98['query'][_0x9513('0x3f')]);_0x1a496c[_0x9513('0x40')]=qs[_0x9513('0x41')](_[_0x9513('0x42')](_0x5b2f98[_0x9513('0x39')],_0x1b3a62[_0x9513('0x41')]));if(_0x5b2f98[_0x9513('0x39')][_0x9513('0x43')]){_0x1a496c['where']=_[_0x9513('0x44')](_0x1a496c[_0x9513('0x40')],{'$or':_[_0x9513('0x57')](_0x1a496c[_0x9513('0x3b')],function(_0x307262){var _0x3284a8={};_0x3284a8[_0x307262]={'$like':'%'+_0x5b2f98[_0x9513('0x39')][_0x9513('0x43')]+'%'};return _0x3284a8;})});}_0x1a496c=_[_0x9513('0x44')]({},_0x1a496c,_0x5b2f98['options']);return _0x2c6115[_0x9513('0x54')](_0x1a496c);}})['then'](function(_0xbf7274){if(_0xbf7274){_0x3eb58=_0xbf7274['length'];if(!_0x5b2f98['query'][_0x9513('0x3e')]('nolimit')){_0x1a496c[_0x9513('0x2a')]=qs[_0x9513('0x2a')](_0x5b2f98[_0x9513('0x39')]['limit']);_0x1a496c['offset']=qs[_0x9513('0x29')](_0x5b2f98[_0x9513('0x39')][_0x9513('0x29')]);}return _0x2c6115[_0x9513('0x54')](_0x1a496c);}})[_0x9513('0x1a')](function(_0x58f081){if(_0x58f081){return _0x58f081?{'count':_0x3eb58,'rows':_0x58f081}:null;}})[_0x9513('0x1a')](respondWithResult(_0x571962,null))[_0x9513('0x25')](handleError(_0x571962,null));};exports[_0x9513('0x58')]=function(_0x1cbdd6,_0x5a6c11,_0x19e808){if(_0x1cbdd6[_0x9513('0x53')]['id']){delete _0x1cbdd6[_0x9513('0x53')]['id'];}return db['Dynamics365Account'][_0x9513('0x59')]({'where':{'id':_0x1cbdd6['params']['id']}})['then'](handleEntityNotFound(_0x5a6c11,null))[_0x9513('0x1a')](function(_0x568a81){if(_0x568a81){_0x1cbdd6[_0x9513('0x53')][_0x9513('0x5a')]=_0x568a81['id'];_0x1cbdd6[_0x9513('0x53')][_0x9513('0x5b')]=integrations[_0x9513('0x5c')](_0x1cbdd6['body'][_0x9513('0x5d')],_0x1cbdd6['body']['type']);_0x1cbdd6[_0x9513('0x53')][_0x9513('0x5e')]=integrations[_0x9513('0x5f')](_0x1cbdd6[_0x9513('0x53')][_0x9513('0x5d')],_0x1cbdd6[_0x9513('0x53')][_0x9513('0x60')]);return db[_0x9513('0x55')][_0x9513('0x52')](_0x1cbdd6[_0x9513('0x53')],{'include':[{'model':db[_0x9513('0x61')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x9513('0x5e')}]});}return null;})['then'](respondWithResult(_0x5a6c11,null))[_0x9513('0x25')](handleError(_0x5a6c11,null));};exports[_0x9513('0x62')]=function(_0x25d560,_0x583b8a,_0x5e197c){var _0x15e97f=_0x25d560[_0x9513('0x39')][_0x9513('0x63')];var _0xfb3ba6=_0x15e97f===_0x9513('0x64')?_0x9513('0x65'):_0x9513('0x66');var _0x2fe6c6='';var _0x279659='';var _0x1f84d2='';var _0x5a66ce='';var _0x3310b0='';var _0x1da869='';var _0xc36d3e='';var _0x2680ec='';var _0x3b7e0c=['title',_0x9513('0x67'),'customerid',_0x9513('0x68'),_0x9513('0x69'),_0x9513('0x6a'),'phonenumber',_0x9513('0x6b'),_0x9513('0x6c'),_0x9513('0x6d')];var _0x282423=[_0x9513('0x6e'),_0x9513('0x6f'),'actualserviceunits',_0x9513('0x70'),_0x9513('0x71'),'contactidyominame',_0x9513('0x72'),_0x9513('0x73'),_0x9513('0x74'),_0x9513('0x75'),_0x9513('0x76'),_0x9513('0x77'),'createdon','createdonbehalfbyname','createdonbehalfbyyominame',_0x9513('0x78'),_0x9513('0x79'),_0x9513('0x7a'),_0x9513('0x7b'),_0x9513('0x7c'),_0x9513('0x7d'),_0x9513('0x7e'),_0x9513('0x7f'),_0x9513('0x80'),_0x9513('0x81'),_0x9513('0x82'),_0x9513('0x83'),_0x9513('0x84'),_0x9513('0x85'),_0x9513('0x86'),_0x9513('0x87'),_0x9513('0x88'),'modifiedbyexternalpartyyominame',_0x9513('0x89'),'modifiedbyyominame',_0x9513('0x8a'),'modifiedonbehalfbyname',_0x9513('0x8b'),_0x9513('0x8c'),'msdyn_iotalertname',_0x9513('0x8d'),_0x9513('0x8e'),'overriddencreatedon',_0x9513('0x8f'),_0x9513('0x90'),_0x9513('0x91'),_0x9513('0x92'),_0x9513('0x93'),'primarycontactidyominame','prioritycodename',_0x9513('0x94'),_0x9513('0x95'),_0x9513('0x96'),_0x9513('0x97'),_0x9513('0x98'),_0x9513('0x99'),'responsiblecontactidyominame',_0x9513('0x9a'),'slainvokedidname',_0x9513('0x9b'),_0x9513('0x9c'),_0x9513('0x9d'),_0x9513('0x9e'),_0x9513('0x9f'),_0x9513('0xa0'),_0x9513('0xa1'),_0x9513('0xa2'),_0x9513('0xa3'),_0x9513('0xa4'),_0x9513('0xa5')];var _0x2db8d9=_0x3b7e0c[_0x9513('0xa6')](_0x282423);return db[_0x9513('0x49')][_0x9513('0x59')]({'where':{'id':_0x25d560[_0x9513('0x50')]['id']},'attributes':['id',_0x9513('0xa7'),_0x9513('0xa8'),_0x9513('0xa9'),_0x9513('0xaa'),_0x9513('0xab'),_0x9513('0xac')]})[_0x9513('0x1a')](handleEntityNotFound(_0x583b8a,null))[_0x9513('0x1a')](function(_0x1ca071){if(_0x1ca071){_0x2680ec=_0x1ca071[_0x9513('0xa9')];var _0x3a278d=_0x2680ec['slice'](-0x1);if(_0x3a278d==='/'){_0x2680ec=_0x2680ec[_0x9513('0xad')](0x0,_0x2680ec[_0x9513('0xae')](_0x3a278d));}_0xc36d3e=util[_0x9513('0xaf')]('%s/api/data/v9.0/',_0x2680ec);var _0x494ca8={'method':_0x9513('0xb0'),'uri':_0x9513('0xb1')+_0x1ca071['tenantId']+_0x9513('0xb2'),'form':{'client_id':_0x1ca071[_0x9513('0xab')],'resource':_0x2680ec,'username':_0x1ca071[_0x9513('0xa7')],'password':_0x1ca071['password'],'grant_type':_0x9513('0xa8'),'client_secret':_0x1ca071[_0x9513('0xac')]},'json':!![]};return rp(_0x494ca8);}})[_0x9513('0x1a')](function(_0x4cb85f){_0x1da869=_0x4cb85f[_0x9513('0xb3')];var _0x13109b={'method':_0x9513('0xb4'),'uri':encodeURI(_0xc36d3e+_0x9513('0xb5')+_0xfb3ba6+'\x27'),'headers':{'Authorization':_0x9513('0xb6')+_0x1da869,'If-None-Match':null,'OData-Version':_0x9513('0xb7')},'json':!![]};return rp(_0x13109b);})[_0x9513('0x1a')](function(_0x2ef6b6){var _0x54a7b2=_0x2ef6b6[_0x9513('0xb8')][0x0];var _0x5551bd=_0x54a7b2['MetadataId'];var _0x5292ba={'method':'GET','uri':_0xc36d3e+'EntityDefinitions('+_0x5551bd+_0x9513('0xb9'),'headers':{'Authorization':_0x9513('0xb6')+_0x1da869,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5292ba);})['then'](function(_0x4c7aab){_0x2fe6c6=_0x4c7aab;_0x279659=_0x2fe6c6[_0x9513('0xba')];_0x279659=_[_0x9513('0xbb')](_0x279659,function(_0x3eb593){return!_0x2db8d9[_0x9513('0xbc')](_0x3eb593[_0x9513('0xbd')]);});var _0x1b019a=[];var _0x57b91b=[];_0x279659['forEach'](function(_0x38c8aa){if(_0x38c8aa['@odata.type']){var _0x587778=_0x38c8aa[_0x9513('0xbe')][_0x9513('0xad')](_0x38c8aa['@odata.type']['lastIndexOf']('.')+0x1);if(_0x587778===_0x9513('0xbf')){_0x1b019a[_0x9513('0xc0')](getSelectList(_0xc36d3e,_0x15e97f,_0x57b91b,_0x2fe6c6[_0x9513('0xc1')],_0x38c8aa['MetadataId'],_0x1da869));}}});return Promise['all'](_0x1b019a);})['then'](function(_0x617e2a){_0x1f84d2=_0x617e2a[0x0];var _0x532da8=[];var _0xd0066c=[];_0x279659[_0x9513('0xc2')](function(_0x268ef3){if(_0x268ef3[_0x9513('0xbe')]){var _0x1996a2=_0x268ef3[_0x9513('0xbe')][_0x9513('0xad')](_0x268ef3[_0x9513('0xbe')][_0x9513('0xae')]('.')+0x1);if(_0x1996a2===_0x9513('0xc3')){_0x532da8[_0x9513('0xc0')](getBooleanList(_0xc36d3e,_0x15e97f,_0xd0066c,_0x2fe6c6['MetadataId'],_0x268ef3['MetadataId'],_0x1da869));}}});return Promise[_0x9513('0xc4')](_0x532da8);})['then'](function(_0x364073){_0x5a66ce=_0x364073[0x0];var _0x48a65f=[];var _0x582b03=[];_0x279659['forEach'](function(_0x2cf306){if(_0x2cf306[_0x9513('0xbe')]){var _0x341ed6=_0x2cf306[_0x9513('0xbe')]['substring'](_0x2cf306[_0x9513('0xbe')][_0x9513('0xae')]('.')+0x1);if(_0x341ed6===_0x9513('0xc5')||_0x341ed6===_0x9513('0xc6')||_0x341ed6===_0x9513('0xc7')||_0x341ed6==='IntegerAttributeMetadata'||_0x341ed6==='MemoAttributeMetadata'||_0x341ed6===_0x9513('0xc8')||_0x341ed6===_0x9513('0xc9')||_0x341ed6==='EntityNameAttributeMetadata'||_0x341ed6===_0x9513('0xca')||_0x341ed6===_0x9513('0xcb')){_0x48a65f['push'](getInputList(_0xc36d3e,_0x15e97f,_0x341ed6,_0x582b03,_0x2fe6c6[_0x9513('0xc1')],_0x2cf306[_0x9513('0xc1')],_0x1da869));}}});return Promise[_0x9513('0xc4')](_0x48a65f);})[_0x9513('0x1a')](function(_0x1eb8d4){_0x3310b0=_0x1eb8d4[0x0];var _0x2ccde1=_0x1f84d2[_0x9513('0xa6')](_0x5a66ce)[_0x9513('0xa6')](_0x3310b0);var _0x1a6bd={'count':_0x2ccde1[_0x9513('0x3d')],'rows':_0x2ccde1};return _0x1a6bd;})[_0x9513('0x1a')](respondWithResult(_0x583b8a,null))['catch'](function(_0xab6979){console['log'](_0x9513('0xcc')+_0xab6979);var _0x13b5bd=_0x25d560['query'][_0x9513('0xcd')]?0x1f4:_0xab6979[_0x9513('0xce')]||0x1f4;logger[_0x9513('0x22')](_0xab6979[_0x9513('0x32')]);delete _0xab6979[_0x9513('0x33')];if(_0x13b5bd===0x191){_0x13b5bd=0x190;}_0x583b8a[_0x9513('0x27')](_0x13b5bd)[_0x9513('0x34')](_0x25d560[_0x9513('0x39')][_0x9513('0xcd')]?{'message':'Wrong\x20credentials','statusCode':_0xab6979['statusCode']}:_0xab6979);});};function getSelectList(_0x543973,_0x253e26,_0x43536c,_0x4912a3,_0x155693,_0x475ed8){var _0x150ff8={'method':_0x9513('0xb4'),'uri':_0x543973+_0x9513('0xcf')+_0x4912a3+_0x9513('0xd0')+_0x155693+_0x9513('0xd1')+_0x9513('0xd2'),'headers':{'Authorization':_0x9513('0xb6')+_0x475ed8,'If-None-Match':null,'OData-Version':_0x9513('0xb7')},'json':!![]};return rp(_0x150ff8)['then'](function(_0x14cf74){var _0x3b829f=[];var _0x3272d7=_0x14cf74[_0x9513('0xd3')][_0x9513('0xd4')];_0x3272d7['forEach'](function(_0x1fcaee){_0x3b829f[_0x9513('0xc0')]({'name':_0x1fcaee['Label'][_0x9513('0xd5')][_0x9513('0xd6')],'value':String(_0x1fcaee[_0x9513('0xd7')])});});var _0x2381bd={'id':_0x253e26+'_'+_0x14cf74['LogicalName'],'name':_0x14cf74[_0x9513('0xd8')][_0x9513('0xd5')]['Label'],'custom':![],'options':_0x3b829f};_0x43536c[_0x9513('0xc0')](_0x2381bd);return _0x43536c;});}function getBooleanList(_0x5dcf19,_0x45c676,_0x513106,_0x13dcea,_0x46d3cf,_0x21adab){var _0x4a8745={'method':_0x9513('0xb4'),'uri':_0x5dcf19+_0x9513('0xcf')+_0x13dcea+_0x9513('0xd0')+_0x46d3cf+_0x9513('0xd9'),'headers':{'Authorization':'Bearer\x20'+_0x21adab,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4a8745)[_0x9513('0x1a')](function(_0x25f3e0){var _0x5e0b55=[];_0x5e0b55[_0x9513('0xc0')]({'name':_0x25f3e0['OptionSet']['TrueOption']['Label'][_0x9513('0xd5')][_0x9513('0xd6')],'value':String(_0x25f3e0[_0x9513('0xd3')][_0x9513('0xda')][_0x9513('0xd7')])},{'name':_0x25f3e0[_0x9513('0xd3')][_0x9513('0xdb')][_0x9513('0xd6')][_0x9513('0xd5')][_0x9513('0xd6')],'value':String(_0x25f3e0[_0x9513('0xd3')][_0x9513('0xdb')][_0x9513('0xd7')])});var _0x1b94e5={'id':_0x45c676+'_'+_0x25f3e0[_0x9513('0xbd')],'name':_0x25f3e0['DisplayName'][_0x9513('0xd5')][_0x9513('0xd6')],'custom':![],'options':_0x5e0b55};_0x513106[_0x9513('0xc0')](_0x1b94e5);return _0x513106;});}function getInputList(_0xcba5e8,_0x7295bc,_0x178c49,_0x6eba2a,_0x44251a,_0x3284c7,_0x2038c3){var _0x4d8e9c={'method':'GET','uri':_0xcba5e8+_0x9513('0xcf')+_0x44251a+_0x9513('0xd0')+_0x3284c7+_0x9513('0xdc')+_0x178c49+_0x9513('0xdd'),'headers':{'Authorization':_0x9513('0xb6')+_0x2038c3,'If-None-Match':null,'OData-Version':_0x9513('0xb7')},'json':!![]};return rp(_0x4d8e9c)[_0x9513('0x1a')](function(_0x297ca1){var _0x1d5e8e={'id':_0x7295bc+'_'+_0x297ca1[_0x9513('0xbd')],'name':_0x297ca1[_0x9513('0xd8')]['UserLocalizedLabel']?_0x297ca1[_0x9513('0xd8')]['UserLocalizedLabel'][_0x9513('0xd6')]:_0x297ca1[_0x9513('0xbd')],'custom':![],'options':[]};_0x6eba2a[_0x9513('0xc0')](_0x1d5e8e);return _0x6eba2a;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b3f5649..7a09599 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 _0x14d4=['define','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','bluebird','request-promise','../../components/integrations/configuration'];(function(_0x5d43b5,_0x3d1c74){var _0x2c5fba=function(_0x3532a8){while(--_0x3532a8){_0x5d43b5['push'](_0x5d43b5['shift']());}};_0x2c5fba(++_0x3d1c74);}(_0x14d4,0x10b));var _0x414d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x414d('0x0'))(_0x414d('0x1'));var moment=require('moment');var BPromise=require(_0x414d('0x2'));var rp=require(_0x414d('0x3'));var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0x414d('0x4'));module['exports']=function(_0x1fb962,_0x40c7a4){return _0x1fb962[_0x414d('0x5')](_0x414d('0x6'),attributes,{'tableName':_0x414d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa497=['define','int_dynamics365_accounts','util','../../config/logger','api','moment','bluebird','request-promise','./intDynamics365Account.attributes','../../components/integrations/configuration','exports'];(function(_0x2fbcbc,_0x38625f){var _0x3ff406=function(_0x10a6b3){while(--_0x10a6b3){_0x2fbcbc['push'](_0x2fbcbc['shift']());}};_0x3ff406(++_0x38625f);}(_0xa497,0x18e));var _0x7a49=function(_0x53f9dc,_0x55479e){_0x53f9dc=_0x53f9dc-0x0;var _0x1edbec=_0xa497[_0x53f9dc];return _0x1edbec;};'use strict';var _=require('lodash');var util=require(_0x7a49('0x0'));var logger=require(_0x7a49('0x1'))(_0x7a49('0x2'));var moment=require(_0x7a49('0x3'));var BPromise=require(_0x7a49('0x4'));var rp=require(_0x7a49('0x5'));var attributes=require(_0x7a49('0x6'));var integrations=require(_0x7a49('0x7'));module[_0x7a49('0x8')]=function(_0x3002d6,_0x3b18f3){return _0x3002d6[_0x7a49('0x9')]('Dynamics365Account',attributes,{'tableName':_0x7a49('0xa'),'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 8f432a0..2cbd365 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 _0x4b9e=['debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetDynamics365Account','Dynamics365Account','options','raw','attributes','limit','include','map','model','catch','ShowDynamics365Account','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent'];(function(_0xbee367,_0x559555){var _0x48ac63=function(_0x50d624){while(--_0x50d624){_0xbee367['push'](_0xbee367['shift']());}};_0x48ac63(++_0x559555);}(_0x4b9e,0xf2));var _0xe4b9=function(_0x178176,_0x326f1a){_0x178176=_0x178176-0x0;var _0x36c404=_0x4b9e[_0x178176];return _0x36c404;};'use strict';var _=require(_0xe4b9('0x0'));var util=require(_0xe4b9('0x1'));var moment=require('moment');var BPromise=require(_0xe4b9('0x2'));var rs=require(_0xe4b9('0x3'));var fs=require('fs');var Redis=require(_0xe4b9('0x4'));var db=require(_0xe4b9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4b9('0x6'))(_0xe4b9('0x7'));var config=require('../../config/environment');var jayson=require(_0xe4b9('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3927ba,_0x19277d,_0x18552d){return new BPromise(function(_0x40c6ff,_0x853625){return client[_0xe4b9('0x9')](_0x3927ba,_0x18552d)[_0xe4b9('0xa')](function(_0x1017f0){logger[_0xe4b9('0xb')](_0xe4b9('0xc'),_0x19277d,_0xe4b9('0xd'));logger[_0xe4b9('0xe')](_0xe4b9('0xf'),_0x19277d,_0xe4b9('0xd'),JSON[_0xe4b9('0x10')](_0x1017f0));if(_0x1017f0['error']){if(_0x1017f0[_0xe4b9('0x11')][_0xe4b9('0x12')]===0x1f4){logger['error'](_0xe4b9('0xc'),_0x19277d,_0x1017f0[_0xe4b9('0x11')][_0xe4b9('0x13')]);return _0x853625(_0x1017f0['error'][_0xe4b9('0x13')]);}logger['error'](_0xe4b9('0xc'),_0x19277d,_0x1017f0[_0xe4b9('0x11')][_0xe4b9('0x13')]);return _0x40c6ff(_0x1017f0[_0xe4b9('0x11')][_0xe4b9('0x13')]);}else{logger[_0xe4b9('0xb')](_0xe4b9('0xc'),_0x19277d,_0xe4b9('0xd'));_0x40c6ff(_0x1017f0['result'][_0xe4b9('0x13')]);}})['catch'](function(_0x47219f){logger[_0xe4b9('0x11')](_0xe4b9('0xc'),_0x19277d,_0x47219f);_0x853625(_0x47219f);});});}exports[_0xe4b9('0x14')]=function(_0x7e89ba){var _0x1815e6=this;return new Promise(function(_0x62eb6c,_0x6d9c65){return db[_0xe4b9('0x15')]['findAll']({'raw':_0x7e89ba[_0xe4b9('0x16')]?_0x7e89ba[_0xe4b9('0x16')][_0xe4b9('0x17')]===undefined?!![]:![]:!![],'where':_0x7e89ba[_0xe4b9('0x16')]?_0x7e89ba[_0xe4b9('0x16')]['where']||null:null,'attributes':_0x7e89ba[_0xe4b9('0x16')]?_0x7e89ba[_0xe4b9('0x16')][_0xe4b9('0x18')]||null:null,'limit':_0x7e89ba[_0xe4b9('0x16')]?_0x7e89ba[_0xe4b9('0x16')][_0xe4b9('0x19')]||null:null,'include':_0x7e89ba[_0xe4b9('0x16')]?_0x7e89ba[_0xe4b9('0x16')][_0xe4b9('0x1a')]?_[_0xe4b9('0x1b')](_0x7e89ba['options'][_0xe4b9('0x1a')],function(_0x598586){return{'model':db[_0x598586[_0xe4b9('0x1c')]],'as':_0x598586['as'],'attributes':_0x598586['attributes'],'include':_0x598586[_0xe4b9('0x1a')]?_['map'](_0x598586['include'],function(_0x5006c8){return{'model':db[_0x5006c8['model']],'as':_0x5006c8['as'],'attributes':_0x5006c8['attributes'],'include':_0x5006c8[_0xe4b9('0x1a')]?_[_0xe4b9('0x1b')](_0x5006c8['include'],function(_0x3caa05){return{'model':db[_0x3caa05[_0xe4b9('0x1c')]],'as':_0x3caa05['as'],'attributes':_0x3caa05[_0xe4b9('0x18')]};}):[]};}):[]};}):[]:[]})[_0xe4b9('0xa')](function(_0x220f6e){logger['info'](_0xe4b9('0x14'),_0x7e89ba);logger[_0xe4b9('0xe')](_0xe4b9('0x14'),_0x7e89ba,JSON[_0xe4b9('0x10')](_0x220f6e));_0x62eb6c(_0x220f6e);})[_0xe4b9('0x1d')](function(_0x339b27){logger[_0xe4b9('0x11')](_0xe4b9('0x14'),_0x339b27['message'],_0x7e89ba);_0x6d9c65(_0x1815e6[_0xe4b9('0x11')](0x1f4,_0x339b27['message']));});});};exports[_0xe4b9('0x1e')]=function(_0x2c0a7d){var _0x2b4172=this;return new Promise(function(_0x4a9d56,_0x46aa54){return db[_0xe4b9('0x15')]['find']({'raw':_0x2c0a7d[_0xe4b9('0x16')]?_0x2c0a7d[_0xe4b9('0x16')][_0xe4b9('0x17')]===undefined?!![]:![]:!![],'where':_0x2c0a7d['options']?_0x2c0a7d[_0xe4b9('0x16')][_0xe4b9('0x1f')]||null:null,'attributes':_0x2c0a7d[_0xe4b9('0x16')]?_0x2c0a7d['options']['attributes']||null:null,'include':_0x2c0a7d['options']?_0x2c0a7d['options'][_0xe4b9('0x1a')]?_[_0xe4b9('0x1b')](_0x2c0a7d[_0xe4b9('0x16')]['include'],function(_0x5b8c5e){return{'model':db[_0x5b8c5e[_0xe4b9('0x1c')]],'as':_0x5b8c5e['as'],'attributes':_0x5b8c5e[_0xe4b9('0x18')],'include':_0x5b8c5e['include']?_[_0xe4b9('0x1b')](_0x5b8c5e[_0xe4b9('0x1a')],function(_0x574816){return{'model':db[_0x574816[_0xe4b9('0x1c')]],'as':_0x574816['as'],'attributes':_0x574816['attributes'],'include':_0x574816[_0xe4b9('0x1a')]?_[_0xe4b9('0x1b')](_0x574816['include'],function(_0x4c03b6){return{'model':db[_0x4c03b6['model']],'as':_0x4c03b6['as'],'attributes':_0x4c03b6['attributes']};}):[]};}):[]};}):[]:[]})[_0xe4b9('0xa')](function(_0x5b1b59){logger[_0xe4b9('0xb')](_0xe4b9('0x1e'),_0x2c0a7d);logger[_0xe4b9('0xe')](_0xe4b9('0x1e'),_0x2c0a7d,JSON[_0xe4b9('0x10')](_0x5b1b59));_0x4a9d56(_0x5b1b59);})[_0xe4b9('0x1d')](function(_0x356c10){logger[_0xe4b9('0x11')](_0xe4b9('0x1e'),_0x356c10[_0xe4b9('0x13')],_0x2c0a7d);_0x46aa54(_0x2b4172[_0xe4b9('0x11')](0x1f4,_0x356c10[_0xe4b9('0x13')]));});});}; \ No newline at end of file +var _0xb6e1=['Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','options','where','limit','include','map','model','attributes','ShowDynamics365Account','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3126d5,_0x2e61ad){var _0x1299b2=function(_0x577de0){while(--_0x577de0){_0x3126d5['push'](_0x3126d5['shift']());}};_0x1299b2(++_0x2e61ad);}(_0xb6e1,0x12a));var _0x1b6e=function(_0x45bfed,_0x187e96){_0x45bfed=_0x45bfed-0x0;var _0x51c6f5=_0xb6e1[_0x45bfed];return _0x51c6f5;};'use strict';var _=require(_0x1b6e('0x0'));var util=require(_0x1b6e('0x1'));var moment=require('moment');var BPromise=require(_0x1b6e('0x2'));var rs=require(_0x1b6e('0x3'));var fs=require('fs');var Redis=require(_0x1b6e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b6e('0x5'));var logger=require(_0x1b6e('0x6'))(_0x1b6e('0x7'));var config=require(_0x1b6e('0x8'));var jayson=require(_0x1b6e('0x9'));var client=jayson[_0x1b6e('0xa')][_0x1b6e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d5628,_0x541334,_0x350580){return new BPromise(function(_0x2cc15b,_0x4a603a){return client['request'](_0x5d5628,_0x350580)[_0x1b6e('0xc')](function(_0x5ea8d7){logger[_0x1b6e('0xd')](_0x1b6e('0xe'),_0x541334,_0x1b6e('0xf'));logger[_0x1b6e('0x10')](_0x1b6e('0x11'),_0x541334,_0x1b6e('0xf'),JSON[_0x1b6e('0x12')](_0x5ea8d7));if(_0x5ea8d7[_0x1b6e('0x13')]){if(_0x5ea8d7['error'][_0x1b6e('0x14')]===0x1f4){logger['error'](_0x1b6e('0xe'),_0x541334,_0x5ea8d7[_0x1b6e('0x13')][_0x1b6e('0x15')]);return _0x4a603a(_0x5ea8d7[_0x1b6e('0x13')]['message']);}logger[_0x1b6e('0x13')](_0x1b6e('0xe'),_0x541334,_0x5ea8d7[_0x1b6e('0x13')]['message']);return _0x2cc15b(_0x5ea8d7[_0x1b6e('0x13')][_0x1b6e('0x15')]);}else{logger[_0x1b6e('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x541334,_0x1b6e('0xf'));_0x2cc15b(_0x5ea8d7[_0x1b6e('0x16')][_0x1b6e('0x15')]);}})[_0x1b6e('0x17')](function(_0x594e53){logger[_0x1b6e('0x13')](_0x1b6e('0xe'),_0x541334,_0x594e53);_0x4a603a(_0x594e53);});});}exports[_0x1b6e('0x18')]=function(_0x3f7147){var _0x2eb800=this;return new Promise(function(_0x1944a9,_0x4b9211){return db[_0x1b6e('0x19')]['findAll']({'raw':_0x3f7147[_0x1b6e('0x1a')]?_0x3f7147[_0x1b6e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3f7147[_0x1b6e('0x1a')]?_0x3f7147['options'][_0x1b6e('0x1b')]||null:null,'attributes':_0x3f7147[_0x1b6e('0x1a')]?_0x3f7147['options']['attributes']||null:null,'limit':_0x3f7147[_0x1b6e('0x1a')]?_0x3f7147[_0x1b6e('0x1a')][_0x1b6e('0x1c')]||null:null,'include':_0x3f7147['options']?_0x3f7147[_0x1b6e('0x1a')][_0x1b6e('0x1d')]?_[_0x1b6e('0x1e')](_0x3f7147['options']['include'],function(_0xcdde10){return{'model':db[_0xcdde10[_0x1b6e('0x1f')]],'as':_0xcdde10['as'],'attributes':_0xcdde10[_0x1b6e('0x20')],'include':_0xcdde10[_0x1b6e('0x1d')]?_['map'](_0xcdde10[_0x1b6e('0x1d')],function(_0x205c61){return{'model':db[_0x205c61[_0x1b6e('0x1f')]],'as':_0x205c61['as'],'attributes':_0x205c61[_0x1b6e('0x20')],'include':_0x205c61[_0x1b6e('0x1d')]?_[_0x1b6e('0x1e')](_0x205c61[_0x1b6e('0x1d')],function(_0x3c2617){return{'model':db[_0x3c2617[_0x1b6e('0x1f')]],'as':_0x3c2617['as'],'attributes':_0x3c2617[_0x1b6e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1b6e('0xc')](function(_0x2b22e0){logger[_0x1b6e('0xd')](_0x1b6e('0x18'),_0x3f7147);logger[_0x1b6e('0x10')]('GetDynamics365Account',_0x3f7147,JSON[_0x1b6e('0x12')](_0x2b22e0));_0x1944a9(_0x2b22e0);})[_0x1b6e('0x17')](function(_0x214907){logger[_0x1b6e('0x13')](_0x1b6e('0x18'),_0x214907[_0x1b6e('0x15')],_0x3f7147);_0x4b9211(_0x2eb800[_0x1b6e('0x13')](0x1f4,_0x214907['message']));});});};exports[_0x1b6e('0x21')]=function(_0x2b2400){var _0x491364=this;return new Promise(function(_0x57a461,_0x5a72dc){return db[_0x1b6e('0x19')]['find']({'raw':_0x2b2400[_0x1b6e('0x1a')]?_0x2b2400[_0x1b6e('0x1a')][_0x1b6e('0x22')]===undefined?!![]:![]:!![],'where':_0x2b2400[_0x1b6e('0x1a')]?_0x2b2400[_0x1b6e('0x1a')][_0x1b6e('0x1b')]||null:null,'attributes':_0x2b2400[_0x1b6e('0x1a')]?_0x2b2400['options'][_0x1b6e('0x20')]||null:null,'include':_0x2b2400[_0x1b6e('0x1a')]?_0x2b2400[_0x1b6e('0x1a')]['include']?_[_0x1b6e('0x1e')](_0x2b2400[_0x1b6e('0x1a')][_0x1b6e('0x1d')],function(_0x3926ff){return{'model':db[_0x3926ff[_0x1b6e('0x1f')]],'as':_0x3926ff['as'],'attributes':_0x3926ff[_0x1b6e('0x20')],'include':_0x3926ff[_0x1b6e('0x1d')]?_[_0x1b6e('0x1e')](_0x3926ff[_0x1b6e('0x1d')],function(_0x1db883){return{'model':db[_0x1db883[_0x1b6e('0x1f')]],'as':_0x1db883['as'],'attributes':_0x1db883['attributes'],'include':_0x1db883[_0x1b6e('0x1d')]?_[_0x1b6e('0x1e')](_0x1db883[_0x1b6e('0x1d')],function(_0x8928a8){return{'model':db[_0x8928a8[_0x1b6e('0x1f')]],'as':_0x8928a8['as'],'attributes':_0x8928a8[_0x1b6e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1b6e('0xc')](function(_0x336b38){logger[_0x1b6e('0xd')]('ShowDynamics365Account',_0x2b2400);logger[_0x1b6e('0x10')](_0x1b6e('0x21'),_0x2b2400,JSON[_0x1b6e('0x12')](_0x336b38));_0x57a461(_0x336b38);})[_0x1b6e('0x17')](function(_0x484737){logger['error'](_0x1b6e('0x21'),_0x484737['message'],_0x2b2400);_0x5a72dc(_0x491364[_0x1b6e('0x13')](0x1f4,_0x484737[_0x1b6e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 98d38e7..a538673 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 _0x27e1=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','path'];(function(_0x4279f1,_0x2e9d88){var _0x5a106e=function(_0x45db79){while(--_0x45db79){_0x4279f1['push'](_0x4279f1['shift']());}};_0x5a106e(++_0x2e9d88);}(_0x27e1,0xa7));var _0x127e=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x27e1[_0x391c55];return _0xa434e0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x127e('0x0'));var timeout=require(_0x127e('0x1'));var express=require(_0x127e('0x2'));var router=express[_0x127e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x127e('0x4'));var config=require(_0x127e('0x5'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0x127e('0x6')](),controller[_0x127e('0x7')]);router['get'](_0x127e('0x8'),auth[_0x127e('0x6')](),controller[_0x127e('0x9')]);router[_0x127e('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x127e('0xb')]);router['get'](_0x127e('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x127e('0xa')](_0x127e('0xd'),auth[_0x127e('0x6')](),controller[_0x127e('0xe')]);router[_0x127e('0xf')]('/',auth[_0x127e('0x6')](),controller[_0x127e('0x10')]);router[_0x127e('0x11')](_0x127e('0x8'),auth[_0x127e('0x6')](),controller['update']);router[_0x127e('0x12')](_0x127e('0x8'),auth['isAuthenticated'](),controller[_0x127e('0x13')]);module[_0x127e('0x14')]=router; \ No newline at end of file +var _0xab79=['/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated'];(function(_0x454eab,_0x66c5c0){var _0x50d522=function(_0x52f7d1){while(--_0x52f7d1){_0x454eab['push'](_0x454eab['shift']());}};_0x50d522(++_0x66c5c0);}(_0xab79,0xae));var _0x9ab7=function(_0x2303f6,_0x171ae9){_0x2303f6=_0x2303f6-0x0;var _0x96314c=_0xab79[_0x2303f6];return _0x96314c;};'use strict';var multer=require(_0x9ab7('0x0'));var util=require(_0x9ab7('0x1'));var path=require(_0x9ab7('0x2'));var timeout=require(_0x9ab7('0x3'));var express=require('express');var router=express[_0x9ab7('0x4')]();var auth=require(_0x9ab7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ab7('0x6'));var controller=require(_0x9ab7('0x7'));router[_0x9ab7('0x8')]('/',auth[_0x9ab7('0x9')](),controller['index']);router['get'](_0x9ab7('0xa'),auth[_0x9ab7('0x9')](),controller[_0x9ab7('0xb')]);router['get']('/:id/fields',auth[_0x9ab7('0x9')](),controller[_0x9ab7('0xc')]);router[_0x9ab7('0x8')](_0x9ab7('0xd'),auth[_0x9ab7('0x9')](),controller[_0x9ab7('0xe')]);router[_0x9ab7('0x8')](_0x9ab7('0xf'),auth[_0x9ab7('0x9')](),controller[_0x9ab7('0x10')]);router[_0x9ab7('0x11')]('/',auth[_0x9ab7('0x9')](),controller['create']);router[_0x9ab7('0x12')](_0x9ab7('0xa'),auth[_0x9ab7('0x9')](),controller[_0x9ab7('0x13')]);router[_0x9ab7('0x14')]('/:id',auth[_0x9ab7('0x9')](),controller[_0x9ab7('0x15')]);module[_0x9ab7('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 54af72e..7838ef7 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 _0x4fe5=['phonecall','sequelize','exports','STRING','incident'];(function(_0x3e10c0,_0x385bdc){var _0x2fb415=function(_0x2bfb7b){while(--_0x2bfb7b){_0x3e10c0['push'](_0x3e10c0['shift']());}};_0x2fb415(++_0x385bdc);}(_0x4fe5,0x178));var _0x54fe=function(_0x4ec9ff,_0xd20ba){_0x4ec9ff=_0x4ec9ff-0x0;var _0x33e8ca=_0x4fe5[_0x4ec9ff];return _0x33e8ca;};'use strict';var Sequelize=require(_0x54fe('0x0'));module[_0x54fe('0x1')]={'name':{'type':Sequelize[_0x54fe('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x54fe('0x3'),_0x54fe('0x4')),'defaultValue':_0x54fe('0x3')}}; \ No newline at end of file +var _0xc32d=['sequelize','STRING','ENUM','incident'];(function(_0x517586,_0xc97d01){var _0x4d7494=function(_0x1383d8){while(--_0x1383d8){_0x517586['push'](_0x517586['shift']());}};_0x4d7494(++_0xc97d01);}(_0xc32d,0x18c));var _0xdc32=function(_0x50a29e,_0x5ccc18){_0x50a29e=_0x50a29e-0x0;var _0x4e49c5=_0xc32d[_0x50a29e];return _0x4e49c5;};'use strict';var Sequelize=require(_0xdc32('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdc32('0x1')]},'ticketType':{'type':Sequelize[_0xdc32('0x2')](_0xdc32('0x3'),'phonecall'),'defaultValue':_0xdc32('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 37a67e3..4cd0333 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 _0x958a=['where','merge','map','type','field','options','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','find','getFields','findOne','Dynamics365Field','getSubjects','order','hasOwnProperty','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','count','offset','limit','set','apply','save','update','destroy','then','stack','name','send','index','Dynamics365Configuration','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter'];(function(_0x4f84e4,_0x2dc37c){var _0x1a372a=function(_0x1da236){while(--_0x1da236){_0x4f84e4['push'](_0x4f84e4['shift']());}};_0x1a372a(++_0x2dc37c);}(_0x958a,0x128));var _0xa958=function(_0x255a7c,_0x3edb5b){_0x255a7c=_0x255a7c-0x0;var _0x12e1ea=_0x958a[_0x255a7c];return _0x12e1ea;};'use strict';var pdf=require(_0xa958('0x0'));var emlformat=require(_0xa958('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa958('0x2'));var jsonpatch=require(_0xa958('0x3'));var rp=require(_0xa958('0x4'));var moment=require(_0xa958('0x5'));var BPromise=require(_0xa958('0x6'));var Mustache=require('mustache');var util=require(_0xa958('0x7'));var path=require('path');var sox=require(_0xa958('0x8'));var csv=require(_0xa958('0x9'));var ejs=require(_0xa958('0xa'));var fs=require('fs');var _=require(_0xa958('0xb'));var squel=require(_0xa958('0xc'));var crypto=require(_0xa958('0xd'));var jsforce=require(_0xa958('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa958('0xf'));var Papa=require(_0xa958('0x10'));var authService=require(_0xa958('0x11'));var hardwareService=require(_0xa958('0x12'));var Redis=require(_0xa958('0x13'));var qs=require(_0xa958('0x14'));var logger=require(_0xa958('0x15'))(_0xa958('0x16'));var utils=require(_0xa958('0x17'));var config=require(_0xa958('0x18'));var db=require(_0xa958('0x19'))['db'];var jayson=require(_0xa958('0x1a'));var client=jayson[_0xa958('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5063ae,_0x5bcc66,_0x13285b,_0x346af4){return new BPromise(function(_0x17e575,_0x591d4d){var _0x3ebc66=_0x346af4||client;return _0x3ebc66['request'](_0x5063ae,_0x13285b)['then'](function(_0x53d5c7){logger[_0xa958('0x1c')](_0xa958('0x1d'),_0x5bcc66,_0xa958('0x1e'));logger[_0xa958('0x1f')](_0xa958('0x20'),_0x5bcc66,_0xa958('0x1e'),JSON[_0xa958('0x21')](_0x53d5c7));if(_0x53d5c7[_0xa958('0x22')]){if(_0x53d5c7['error'][_0xa958('0x23')]===0x1f4){logger['error'](_0xa958('0x1d'),_0x5bcc66,_0x53d5c7[_0xa958('0x22')]['message']);return _0x591d4d(_0x53d5c7[_0xa958('0x22')][_0xa958('0x24')]);}logger[_0xa958('0x22')](_0xa958('0x1d'),_0x5bcc66,_0x53d5c7[_0xa958('0x22')][_0xa958('0x24')]);return _0x17e575(_0x53d5c7['error']['message']);}else{logger[_0xa958('0x1c')](_0xa958('0x1d'),_0x5bcc66,_0xa958('0x1e'));_0x17e575(_0x53d5c7['result'][_0xa958('0x24')]);}})[_0xa958('0x25')](function(_0x5c091a){logger[_0xa958('0x22')](_0xa958('0x1d'),_0x5bcc66,_0x5c091a);_0x591d4d(_0x5c091a);});});}function respondWithStatusCode(_0x5c45e8,_0x5c5a2b){_0x5c5a2b=_0x5c5a2b||0xcc;return function(_0x201ed3){if(_0x201ed3){return _0x5c45e8[_0xa958('0x26')](_0x5c5a2b);}return _0x5c45e8['status'](_0x5c5a2b)[_0xa958('0x27')]();};}function respondWithResult(_0x27097a,_0x2f03df){_0x2f03df=_0x2f03df||0xc8;return function(_0x347b72){if(_0x347b72){return _0x27097a[_0xa958('0x28')](_0x2f03df)[_0xa958('0x29')](_0x347b72);}};}function respondWithFilteredResult(_0x50fdb1,_0x3e3d77){return function(_0x48ef34){if(_0x48ef34){var _0x43df63=_0x48ef34[_0xa958('0x2a')],_0x3c2ea3=_0x3e3d77[_0xa958('0x2b')],_0x32ea36=_0x3e3d77[_0xa958('0x2b')]+_0x3e3d77[_0xa958('0x2c')],_0x18f600;if(_0x32ea36>=_0x43df63){_0x32ea36=_0x43df63;_0x18f600=0xc8;}else{_0x18f600=0xce;}_0x50fdb1[_0xa958('0x28')](_0x18f600);return _0x50fdb1[_0xa958('0x2d')]('Content-Range',_0x3c2ea3+'-'+_0x32ea36+'/'+_0x43df63)['json'](_0x48ef34);}return null;};}function patchUpdates(_0xd2fcc9){return function(_0x4ef4f6){try{jsonpatch[_0xa958('0x2e')](_0x4ef4f6,_0xd2fcc9,!![]);}catch(_0x1b76de){return BPromise['reject'](_0x1b76de);}return _0x4ef4f6[_0xa958('0x2f')]();};}function saveUpdates(_0x3d4711,_0x179bc2){return function(_0x374c77){if(_0x374c77){return _0x374c77[_0xa958('0x30')](_0x3d4711)['then'](function(_0x51e17c){return _0x51e17c;});}return null;};}function removeEntity(_0x28e6f0,_0x5d9a3d){return function(_0x51e50b){if(_0x51e50b){return _0x51e50b[_0xa958('0x31')]()[_0xa958('0x32')](function(){_0x28e6f0[_0xa958('0x28')](0xcc)[_0xa958('0x27')]();});}};}function handleEntityNotFound(_0x1ac775,_0x11fddf){return function(_0x516a2f){if(!_0x516a2f){_0x1ac775[_0xa958('0x26')](0x194);}return _0x516a2f;};}function handleError(_0x52b35a,_0x489502){_0x489502=_0x489502||0x1f4;return function(_0x39b615){logger[_0xa958('0x22')](_0x39b615[_0xa958('0x33')]);if(_0x39b615[_0xa958('0x34')]){delete _0x39b615[_0xa958('0x34')];}_0x52b35a[_0xa958('0x28')](_0x489502)[_0xa958('0x35')](_0x39b615);};}exports[_0xa958('0x36')]=function(_0x4aaad8,_0x579e4c){var _0x46e370={},_0x2e1f94={},_0x322d0e={'count':0x0,'rows':[]};var _0x3ceb1e=db[_0xa958('0x37')]['rawAttributes'];_0x2e1f94[_0xa958('0x38')]=_[_0xa958('0x39')](_0x3ceb1e);_0x2e1f94[_0xa958('0x3a')]=_[_0xa958('0x39')](_0x4aaad8['query']);_0x2e1f94[_0xa958('0x3b')]=_[_0xa958('0x3c')](_0x2e1f94[_0xa958('0x38')],_0x2e1f94[_0xa958('0x3a')]);_0x46e370[_0xa958('0x3d')]=_['intersection'](_0x2e1f94[_0xa958('0x38')],qs[_0xa958('0x3e')](_0x4aaad8[_0xa958('0x3a')][_0xa958('0x3e')]));_0x46e370[_0xa958('0x3d')]=_0x46e370[_0xa958('0x3d')][_0xa958('0x3f')]?_0x46e370[_0xa958('0x3d')]:_0x2e1f94[_0xa958('0x38')];if(!_0x4aaad8[_0xa958('0x3a')]['hasOwnProperty'](_0xa958('0x40'))){_0x46e370[_0xa958('0x2c')]=qs[_0xa958('0x2c')](_0x4aaad8['query'][_0xa958('0x2c')]);_0x46e370[_0xa958('0x2b')]=qs['offset'](_0x4aaad8['query'][_0xa958('0x2b')]);}_0x46e370['order']=qs[_0xa958('0x41')](_0x4aaad8['query'][_0xa958('0x41')]);_0x46e370['where']=qs[_0xa958('0x3b')](_[_0xa958('0x42')](_0x4aaad8[_0xa958('0x3a')],_0x2e1f94[_0xa958('0x3b')]));if(_0x4aaad8[_0xa958('0x3a')][_0xa958('0x43')]){_0x46e370[_0xa958('0x44')]=_[_0xa958('0x45')](_0x46e370['where'],{'$or':_[_0xa958('0x46')](_0x3ceb1e,function(_0x38dfb4){if(_0x38dfb4[_0xa958('0x47')]['key']!=='VIRTUAL'){var _0x58367b={};_0x58367b[_0x38dfb4[_0xa958('0x48')]]={'$like':'%'+_0x4aaad8[_0xa958('0x3a')][_0xa958('0x43')]+'%'};return _0x58367b;}})});}_0x46e370=_[_0xa958('0x45')]({},_0x46e370,_0x4aaad8[_0xa958('0x49')]);var _0x4e1ed1={'where':_0x46e370[_0xa958('0x44')]};return db[_0xa958('0x37')][_0xa958('0x2a')](_0x4e1ed1)[_0xa958('0x32')](function(_0x303331){_0x322d0e[_0xa958('0x2a')]=_0x303331;if(_0x4aaad8[_0xa958('0x3a')][_0xa958('0x4a')]){_0x46e370[_0xa958('0x4b')]=[{'all':!![]}];}return db[_0xa958('0x37')][_0xa958('0x4c')](_0x46e370);})[_0xa958('0x32')](function(_0x22f4c2){_0x322d0e[_0xa958('0x4d')]=_0x22f4c2;return _0x322d0e;})[_0xa958('0x32')](respondWithFilteredResult(_0x579e4c,_0x46e370))[_0xa958('0x25')](handleError(_0x579e4c,null));};exports[_0xa958('0x4e')]=function(_0x4e3b53,_0x5b8111){var _0x5bfe18={'raw':![],'where':{'id':_0x4e3b53[_0xa958('0x4f')]['id']}},_0x4724ab={};_0x4724ab[_0xa958('0x38')]=_[_0xa958('0x39')](db['Dynamics365Configuration'][_0xa958('0x50')]);_0x4724ab[_0xa958('0x3a')]=_[_0xa958('0x39')](_0x4e3b53[_0xa958('0x3a')]);_0x4724ab[_0xa958('0x3b')]=_['intersection'](_0x4724ab[_0xa958('0x38')],_0x4724ab[_0xa958('0x3a')]);_0x5bfe18[_0xa958('0x3d')]=_['intersection'](_0x4724ab[_0xa958('0x38')],qs['fields'](_0x4e3b53[_0xa958('0x3a')][_0xa958('0x3e')]));_0x5bfe18[_0xa958('0x3d')]=_0x5bfe18['attributes'][_0xa958('0x3f')]?_0x5bfe18['attributes']:_0x4724ab[_0xa958('0x38')];if(_0x4e3b53[_0xa958('0x3a')][_0xa958('0x4a')]){_0x5bfe18[_0xa958('0x4b')]=[{'all':!![]}];}_0x5bfe18=_[_0xa958('0x45')]({},_0x5bfe18,_0x4e3b53['options']);return db[_0xa958('0x37')]['find'](_0x5bfe18)[_0xa958('0x32')](handleEntityNotFound(_0x5b8111,null))[_0xa958('0x32')](respondWithResult(_0x5b8111,null))['catch'](handleError(_0x5b8111,null));};exports[_0xa958('0x51')]=function(_0x4f0a27,_0x317059){return db[_0xa958('0x37')][_0xa958('0x51')](_0x4f0a27[_0xa958('0x52')],{})[_0xa958('0x32')](respondWithResult(_0x317059,0xc9))[_0xa958('0x25')](handleError(_0x317059,null));};exports[_0xa958('0x30')]=function(_0x4060ba,_0x39e0b6){if(_0x4060ba['body']['id']){delete _0x4060ba[_0xa958('0x52')]['id'];}return db['Dynamics365Configuration'][_0xa958('0x53')]({'where':{'id':_0x4060ba[_0xa958('0x4f')]['id']}})[_0xa958('0x32')](handleEntityNotFound(_0x39e0b6,null))['then'](saveUpdates(_0x4060ba['body'],null))[_0xa958('0x32')](respondWithResult(_0x39e0b6,null))[_0xa958('0x25')](handleError(_0x39e0b6,null));};exports[_0xa958('0x31')]=function(_0x307127,_0x4a61e7){return db[_0xa958('0x37')][_0xa958('0x53')]({'where':{'id':_0x307127['params']['id']}})[_0xa958('0x32')](handleEntityNotFound(_0x4a61e7,null))[_0xa958('0x32')](removeEntity(_0x4a61e7,null))['catch'](handleError(_0x4a61e7,null));};exports[_0xa958('0x54')]=function(_0x541ba2,_0x5629c4,_0x58488a){var _0x45b6f5={};var _0x108cb1={};var _0x439a72;var _0xe1a8ba;return db['Dynamics365Configuration'][_0xa958('0x55')]({'where':{'id':_0x541ba2['params']['id']}})[_0xa958('0x32')](handleEntityNotFound(_0x5629c4,null))[_0xa958('0x32')](function(_0x1d75d7){if(_0x1d75d7){_0x439a72=_0x1d75d7;_0x108cb1[_0xa958('0x38')]=_[_0xa958('0x39')](db[_0xa958('0x56')]['rawAttributes']);_0x108cb1['query']=_[_0xa958('0x39')](_0x541ba2[_0xa958('0x3a')]);_0x108cb1[_0xa958('0x3b')]=_[_0xa958('0x3c')](_0x108cb1[_0xa958('0x38')],_0x108cb1['query']);_0x45b6f5[_0xa958('0x3d')]=_[_0xa958('0x3c')](_0x108cb1[_0xa958('0x38')],qs['fields'](_0x541ba2[_0xa958('0x3a')][_0xa958('0x3e')]));_0x45b6f5[_0xa958('0x3d')]=_0x45b6f5[_0xa958('0x3d')][_0xa958('0x3f')]?_0x45b6f5[_0xa958('0x3d')]:_0x108cb1[_0xa958('0x38')];_0x45b6f5['order']=qs['sort'](_0x541ba2[_0xa958('0x3a')]['sort']);_0x45b6f5[_0xa958('0x44')]=qs[_0xa958('0x3b')](_[_0xa958('0x42')](_0x541ba2[_0xa958('0x3a')],_0x108cb1[_0xa958('0x3b')]));if(_0x541ba2[_0xa958('0x3a')][_0xa958('0x43')]){_0x45b6f5[_0xa958('0x44')]=_[_0xa958('0x45')](_0x45b6f5['where'],{'$or':_[_0xa958('0x46')](_0x45b6f5[_0xa958('0x3d')],function(_0x4f9358){var _0x53a26d={};_0x53a26d[_0x4f9358]={'$like':'%'+_0x541ba2[_0xa958('0x3a')][_0xa958('0x43')]+'%'};return _0x53a26d;})});}_0x45b6f5=_[_0xa958('0x45')]({},_0x45b6f5,_0x541ba2[_0xa958('0x49')]);return _0x439a72[_0xa958('0x54')](_0x45b6f5);}})['then'](function(_0x25ca0b){if(_0x25ca0b){_0xe1a8ba=_0x25ca0b['length'];if(!_0x541ba2[_0xa958('0x3a')]['hasOwnProperty'](_0xa958('0x40'))){_0x45b6f5[_0xa958('0x2c')]=qs['limit'](_0x541ba2[_0xa958('0x3a')][_0xa958('0x2c')]);_0x45b6f5[_0xa958('0x2b')]=qs[_0xa958('0x2b')](_0x541ba2[_0xa958('0x3a')][_0xa958('0x2b')]);}return _0x439a72[_0xa958('0x54')](_0x45b6f5);}})[_0xa958('0x32')](function(_0x50af45){if(_0x50af45){return _0x50af45?{'count':_0xe1a8ba,'rows':_0x50af45}:null;}})['then'](respondWithResult(_0x5629c4,null))['catch'](handleError(_0x5629c4,null));};exports[_0xa958('0x57')]=function(_0x5f0791,_0x21d139,_0x739fa1){var _0x52484f={};var _0x4932ef={};var _0x689b3f;var _0x19a262;return db[_0xa958('0x37')][_0xa958('0x55')]({'where':{'id':_0x5f0791[_0xa958('0x4f')]['id']}})['then'](handleEntityNotFound(_0x21d139,null))[_0xa958('0x32')](function(_0x5379f1){if(_0x5379f1){_0x689b3f=_0x5379f1;_0x4932ef[_0xa958('0x38')]=_[_0xa958('0x39')](db[_0xa958('0x56')]['rawAttributes']);_0x4932ef[_0xa958('0x3a')]=_[_0xa958('0x39')](_0x5f0791['query']);_0x4932ef[_0xa958('0x3b')]=_[_0xa958('0x3c')](_0x4932ef[_0xa958('0x38')],_0x4932ef[_0xa958('0x3a')]);_0x52484f[_0xa958('0x3d')]=_['intersection'](_0x4932ef[_0xa958('0x38')],qs['fields'](_0x5f0791[_0xa958('0x3a')]['fields']));_0x52484f[_0xa958('0x3d')]=_0x52484f[_0xa958('0x3d')][_0xa958('0x3f')]?_0x52484f[_0xa958('0x3d')]:_0x4932ef[_0xa958('0x38')];_0x52484f[_0xa958('0x58')]=qs[_0xa958('0x41')](_0x5f0791['query']['sort']);_0x52484f[_0xa958('0x44')]=qs['filters'](_[_0xa958('0x42')](_0x5f0791[_0xa958('0x3a')],_0x4932ef[_0xa958('0x3b')]));if(_0x5f0791[_0xa958('0x3a')][_0xa958('0x43')]){_0x52484f[_0xa958('0x44')]=_[_0xa958('0x45')](_0x52484f[_0xa958('0x44')],{'$or':_['map'](_0x52484f[_0xa958('0x3d')],function(_0x42a058){var _0x375c87={};_0x375c87[_0x42a058]={'$like':'%'+_0x5f0791[_0xa958('0x3a')]['filter']+'%'};return _0x375c87;})});}_0x52484f=_[_0xa958('0x45')]({},_0x52484f,_0x5f0791[_0xa958('0x49')]);return _0x689b3f[_0xa958('0x57')](_0x52484f);}})[_0xa958('0x32')](function(_0x10039e){if(_0x10039e){_0x19a262=_0x10039e[_0xa958('0x3f')];if(!_0x5f0791['query'][_0xa958('0x59')](_0xa958('0x40'))){_0x52484f[_0xa958('0x2c')]=qs[_0xa958('0x2c')](_0x5f0791[_0xa958('0x3a')][_0xa958('0x2c')]);_0x52484f['offset']=qs['offset'](_0x5f0791['query'][_0xa958('0x2b')]);}return _0x689b3f['getSubjects'](_0x52484f);}})['then'](function(_0x1c05fa){if(_0x1c05fa){return _0x1c05fa?{'count':_0x19a262,'rows':_0x1c05fa}:null;}})[_0xa958('0x32')](respondWithResult(_0x21d139,null))[_0xa958('0x25')](handleError(_0x21d139,null));};exports[_0xa958('0x5a')]=function(_0x97d275,_0x59e4d0,_0x55908f){var _0x180dc6={};var _0x477402={};var _0x203931;var _0x3e8df4;return db['Dynamics365Configuration'][_0xa958('0x55')]({'where':{'id':_0x97d275[_0xa958('0x4f')]['id']}})[_0xa958('0x32')](handleEntityNotFound(_0x59e4d0,null))[_0xa958('0x32')](function(_0x43b7e0){if(_0x43b7e0){_0x203931=_0x43b7e0;_0x477402['model']=_['keys'](db[_0xa958('0x56')]['rawAttributes']);_0x477402[_0xa958('0x3a')]=_[_0xa958('0x39')](_0x97d275[_0xa958('0x3a')]);_0x477402['filters']=_[_0xa958('0x3c')](_0x477402['model'],_0x477402[_0xa958('0x3a')]);_0x180dc6[_0xa958('0x3d')]=_['intersection'](_0x477402['model'],qs['fields'](_0x97d275['query'][_0xa958('0x3e')]));_0x180dc6[_0xa958('0x3d')]=_0x180dc6[_0xa958('0x3d')][_0xa958('0x3f')]?_0x180dc6[_0xa958('0x3d')]:_0x477402['model'];_0x180dc6[_0xa958('0x58')]=qs['sort'](_0x97d275['query'][_0xa958('0x41')]);_0x180dc6[_0xa958('0x44')]=qs[_0xa958('0x3b')](_['pick'](_0x97d275[_0xa958('0x3a')],_0x477402['filters']));if(_0x97d275[_0xa958('0x3a')][_0xa958('0x43')]){_0x180dc6['where']=_['merge'](_0x180dc6[_0xa958('0x44')],{'$or':_[_0xa958('0x46')](_0x180dc6[_0xa958('0x3d')],function(_0x366c63){var _0x5a0542={};_0x5a0542[_0x366c63]={'$like':'%'+_0x97d275[_0xa958('0x3a')][_0xa958('0x43')]+'%'};return _0x5a0542;})});}_0x180dc6=_['merge']({},_0x180dc6,_0x97d275[_0xa958('0x49')]);return _0x203931['getDescriptions'](_0x180dc6);}})[_0xa958('0x32')](function(_0x142b81){if(_0x142b81){_0x3e8df4=_0x142b81[_0xa958('0x3f')];if(!_0x97d275['query'][_0xa958('0x59')](_0xa958('0x40'))){_0x180dc6['limit']=qs[_0xa958('0x2c')](_0x97d275[_0xa958('0x3a')][_0xa958('0x2c')]);_0x180dc6[_0xa958('0x2b')]=qs[_0xa958('0x2b')](_0x97d275[_0xa958('0x3a')][_0xa958('0x2b')]);}return _0x203931[_0xa958('0x5a')](_0x180dc6);}})[_0xa958('0x32')](function(_0x5b6ccb){if(_0x5b6ccb){return _0x5b6ccb?{'count':_0x3e8df4,'rows':_0x5b6ccb}:null;}})[_0xa958('0x32')](respondWithResult(_0x59e4d0,null))[_0xa958('0x25')](handleError(_0x59e4d0,null));}; \ No newline at end of file +var _0x7894=['merge','map','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','getFields','findOne','Dynamics365Field','rawAttributes','getSubjects','order','hasOwnProperty','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','client','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','count','offset','limit','set','Content-Range','update','destroy','sendStatus','stack','name','send','Dynamics365Configuration','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x7894,0x170));var _0x4789=function(_0x5aac00,_0x1c0cd1){_0x5aac00=_0x5aac00-0x0;var _0x59cf43=_0x7894[_0x5aac00];return _0x59cf43;};'use strict';var pdf=require(_0x4789('0x0'));var emlformat=require(_0x4789('0x1'));var rimraf=require(_0x4789('0x2'));var zipdir=require(_0x4789('0x3'));var jsonpatch=require(_0x4789('0x4'));var rp=require(_0x4789('0x5'));var moment=require('moment');var BPromise=require(_0x4789('0x6'));var Mustache=require(_0x4789('0x7'));var util=require('util');var path=require(_0x4789('0x8'));var sox=require(_0x4789('0x9'));var csv=require(_0x4789('0xa'));var ejs=require(_0x4789('0xb'));var fs=require('fs');var _=require(_0x4789('0xc'));var squel=require(_0x4789('0xd'));var crypto=require(_0x4789('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4789('0xa'));var querystring=require('querystring');var Papa=require(_0x4789('0xf'));var authService=require(_0x4789('0x10'));var hardwareService=require(_0x4789('0x11'));var Redis=require('ioredis');var qs=require(_0x4789('0x12'));var logger=require('../../config/logger')(_0x4789('0x13'));var utils=require(_0x4789('0x14'));var config=require(_0x4789('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x4789('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf73460,_0x58743a,_0x25a4a9,_0x27ed2f){return new BPromise(function(_0x515a8d,_0x37a816){var _0x4e0fde=_0x27ed2f||client;return _0x4e0fde[_0x4789('0x17')](_0xf73460,_0x25a4a9)[_0x4789('0x18')](function(_0x5162bd){logger['info'](_0x4789('0x19'),_0x58743a,_0x4789('0x1a'));logger['debug'](_0x4789('0x1b'),_0x58743a,'request\x20sent',JSON[_0x4789('0x1c')](_0x5162bd));if(_0x5162bd[_0x4789('0x1d')]){if(_0x5162bd['error'][_0x4789('0x1e')]===0x1f4){logger['error'](_0x4789('0x19'),_0x58743a,_0x5162bd['error'][_0x4789('0x1f')]);return _0x37a816(_0x5162bd[_0x4789('0x1d')]['message']);}logger[_0x4789('0x1d')](_0x4789('0x19'),_0x58743a,_0x5162bd[_0x4789('0x1d')][_0x4789('0x1f')]);return _0x515a8d(_0x5162bd[_0x4789('0x1d')][_0x4789('0x1f')]);}else{logger[_0x4789('0x20')](_0x4789('0x19'),_0x58743a,_0x4789('0x1a'));_0x515a8d(_0x5162bd[_0x4789('0x21')][_0x4789('0x1f')]);}})[_0x4789('0x22')](function(_0x4f7ceb){logger[_0x4789('0x1d')](_0x4789('0x19'),_0x58743a,_0x4f7ceb);_0x37a816(_0x4f7ceb);});});}function respondWithStatusCode(_0x5c1166,_0x20841e){_0x20841e=_0x20841e||0xcc;return function(_0x26884c){if(_0x26884c){return _0x5c1166['sendStatus'](_0x20841e);}return _0x5c1166[_0x4789('0x23')](_0x20841e)[_0x4789('0x24')]();};}function respondWithResult(_0x54d9c1,_0xd8601e){_0xd8601e=_0xd8601e||0xc8;return function(_0x50d00f){if(_0x50d00f){return _0x54d9c1[_0x4789('0x23')](_0xd8601e)[_0x4789('0x25')](_0x50d00f);}};}function respondWithFilteredResult(_0x307b90,_0x13a69c){return function(_0x435016){if(_0x435016){var _0x3b60f4=_0x435016[_0x4789('0x26')],_0x182958=_0x13a69c[_0x4789('0x27')],_0x3ccbb9=_0x13a69c[_0x4789('0x27')]+_0x13a69c[_0x4789('0x28')],_0x4647fc;if(_0x3ccbb9>=_0x3b60f4){_0x3ccbb9=_0x3b60f4;_0x4647fc=0xc8;}else{_0x4647fc=0xce;}_0x307b90[_0x4789('0x23')](_0x4647fc);return _0x307b90[_0x4789('0x29')](_0x4789('0x2a'),_0x182958+'-'+_0x3ccbb9+'/'+_0x3b60f4)[_0x4789('0x25')](_0x435016);}return null;};}function patchUpdates(_0x1f4fbc){return function(_0x5d869e){try{jsonpatch['apply'](_0x5d869e,_0x1f4fbc,!![]);}catch(_0x3d414e){return BPromise['reject'](_0x3d414e);}return _0x5d869e['save']();};}function saveUpdates(_0x5894f8,_0xab907b){return function(_0x41f560){if(_0x41f560){return _0x41f560[_0x4789('0x2b')](_0x5894f8)[_0x4789('0x18')](function(_0x17e699){return _0x17e699;});}return null;};}function removeEntity(_0x1f72ee,_0x2e9f3a){return function(_0x3948d6){if(_0x3948d6){return _0x3948d6[_0x4789('0x2c')]()['then'](function(){_0x1f72ee[_0x4789('0x23')](0xcc)[_0x4789('0x24')]();});}};}function handleEntityNotFound(_0x443647,_0x9a43ad){return function(_0x3c529d){if(!_0x3c529d){_0x443647[_0x4789('0x2d')](0x194);}return _0x3c529d;};}function handleError(_0x1debe1,_0x1b1ac5){_0x1b1ac5=_0x1b1ac5||0x1f4;return function(_0x33b4bb){logger[_0x4789('0x1d')](_0x33b4bb[_0x4789('0x2e')]);if(_0x33b4bb[_0x4789('0x2f')]){delete _0x33b4bb[_0x4789('0x2f')];}_0x1debe1[_0x4789('0x23')](_0x1b1ac5)[_0x4789('0x30')](_0x33b4bb);};}exports['index']=function(_0x2bd202,_0x294d7b){var _0x285f30={},_0x602b1f={},_0x45785a={'count':0x0,'rows':[]};var _0xbb8ab2=db[_0x4789('0x31')]['rawAttributes'];_0x602b1f[_0x4789('0x32')]=_[_0x4789('0x33')](_0xbb8ab2);_0x602b1f['query']=_['keys'](_0x2bd202[_0x4789('0x34')]);_0x602b1f[_0x4789('0x35')]=_[_0x4789('0x36')](_0x602b1f[_0x4789('0x32')],_0x602b1f[_0x4789('0x34')]);_0x285f30[_0x4789('0x37')]=_[_0x4789('0x36')](_0x602b1f['model'],qs['fields'](_0x2bd202['query'][_0x4789('0x38')]));_0x285f30[_0x4789('0x37')]=_0x285f30[_0x4789('0x37')][_0x4789('0x39')]?_0x285f30[_0x4789('0x37')]:_0x602b1f[_0x4789('0x32')];if(!_0x2bd202[_0x4789('0x34')]['hasOwnProperty'](_0x4789('0x3a'))){_0x285f30[_0x4789('0x28')]=qs[_0x4789('0x28')](_0x2bd202['query'][_0x4789('0x28')]);_0x285f30[_0x4789('0x27')]=qs[_0x4789('0x27')](_0x2bd202[_0x4789('0x34')][_0x4789('0x27')]);}_0x285f30['order']=qs[_0x4789('0x3b')](_0x2bd202['query'][_0x4789('0x3b')]);_0x285f30[_0x4789('0x3c')]=qs[_0x4789('0x35')](_[_0x4789('0x3d')](_0x2bd202[_0x4789('0x34')],_0x602b1f['filters']));if(_0x2bd202[_0x4789('0x34')]['filter']){_0x285f30[_0x4789('0x3c')]=_[_0x4789('0x3e')](_0x285f30['where'],{'$or':_[_0x4789('0x3f')](_0xbb8ab2,function(_0x4c30e8){if(_0x4c30e8[_0x4789('0x40')][_0x4789('0x41')]!==_0x4789('0x42')){var _0x14edb5={};_0x14edb5[_0x4c30e8['field']]={'$like':'%'+_0x2bd202[_0x4789('0x34')][_0x4789('0x43')]+'%'};return _0x14edb5;}})});}_0x285f30=_['merge']({},_0x285f30,_0x2bd202[_0x4789('0x44')]);var _0x4dd6b6={'where':_0x285f30[_0x4789('0x3c')]};return db['Dynamics365Configuration']['count'](_0x4dd6b6)[_0x4789('0x18')](function(_0x559162){_0x45785a[_0x4789('0x26')]=_0x559162;if(_0x2bd202['query'][_0x4789('0x45')]){_0x285f30[_0x4789('0x46')]=[{'all':!![]}];}return db[_0x4789('0x31')][_0x4789('0x47')](_0x285f30);})[_0x4789('0x18')](function(_0x4081bb){_0x45785a[_0x4789('0x48')]=_0x4081bb;return _0x45785a;})['then'](respondWithFilteredResult(_0x294d7b,_0x285f30))[_0x4789('0x22')](handleError(_0x294d7b,null));};exports[_0x4789('0x49')]=function(_0x1d33d8,_0x1c8117){var _0x23d5ca={'raw':![],'where':{'id':_0x1d33d8[_0x4789('0x4a')]['id']}},_0x11ce78={};_0x11ce78[_0x4789('0x32')]=_[_0x4789('0x33')](db[_0x4789('0x31')]['rawAttributes']);_0x11ce78[_0x4789('0x34')]=_[_0x4789('0x33')](_0x1d33d8['query']);_0x11ce78[_0x4789('0x35')]=_[_0x4789('0x36')](_0x11ce78[_0x4789('0x32')],_0x11ce78[_0x4789('0x34')]);_0x23d5ca[_0x4789('0x37')]=_['intersection'](_0x11ce78[_0x4789('0x32')],qs[_0x4789('0x38')](_0x1d33d8[_0x4789('0x34')][_0x4789('0x38')]));_0x23d5ca[_0x4789('0x37')]=_0x23d5ca[_0x4789('0x37')][_0x4789('0x39')]?_0x23d5ca[_0x4789('0x37')]:_0x11ce78[_0x4789('0x32')];if(_0x1d33d8[_0x4789('0x34')][_0x4789('0x45')]){_0x23d5ca['include']=[{'all':!![]}];}_0x23d5ca=_[_0x4789('0x3e')]({},_0x23d5ca,_0x1d33d8[_0x4789('0x44')]);return db[_0x4789('0x31')][_0x4789('0x4b')](_0x23d5ca)[_0x4789('0x18')](handleEntityNotFound(_0x1c8117,null))['then'](respondWithResult(_0x1c8117,null))[_0x4789('0x22')](handleError(_0x1c8117,null));};exports['create']=function(_0x5744bd,_0x413e02){return db[_0x4789('0x31')][_0x4789('0x4c')](_0x5744bd[_0x4789('0x4d')],{})[_0x4789('0x18')](respondWithResult(_0x413e02,0xc9))[_0x4789('0x22')](handleError(_0x413e02,null));};exports[_0x4789('0x2b')]=function(_0x288488,_0x51a5f0){if(_0x288488[_0x4789('0x4d')]['id']){delete _0x288488['body']['id'];}return db['Dynamics365Configuration'][_0x4789('0x4b')]({'where':{'id':_0x288488['params']['id']}})[_0x4789('0x18')](handleEntityNotFound(_0x51a5f0,null))[_0x4789('0x18')](saveUpdates(_0x288488[_0x4789('0x4d')],null))['then'](respondWithResult(_0x51a5f0,null))[_0x4789('0x22')](handleError(_0x51a5f0,null));};exports['destroy']=function(_0x44e71e,_0x555a13){return db[_0x4789('0x31')][_0x4789('0x4b')]({'where':{'id':_0x44e71e[_0x4789('0x4a')]['id']}})[_0x4789('0x18')](handleEntityNotFound(_0x555a13,null))[_0x4789('0x18')](removeEntity(_0x555a13,null))[_0x4789('0x22')](handleError(_0x555a13,null));};exports[_0x4789('0x4e')]=function(_0x3f4e55,_0x27cb96,_0x4901f2){var _0xa1dcef={};var _0x5f0696={};var _0x26162a;var _0xa04ff5;return db['Dynamics365Configuration'][_0x4789('0x4f')]({'where':{'id':_0x3f4e55[_0x4789('0x4a')]['id']}})[_0x4789('0x18')](handleEntityNotFound(_0x27cb96,null))[_0x4789('0x18')](function(_0x33fdd3){if(_0x33fdd3){_0x26162a=_0x33fdd3;_0x5f0696[_0x4789('0x32')]=_[_0x4789('0x33')](db[_0x4789('0x50')][_0x4789('0x51')]);_0x5f0696[_0x4789('0x34')]=_[_0x4789('0x33')](_0x3f4e55[_0x4789('0x34')]);_0x5f0696['filters']=_['intersection'](_0x5f0696[_0x4789('0x32')],_0x5f0696['query']);_0xa1dcef[_0x4789('0x37')]=_[_0x4789('0x36')](_0x5f0696[_0x4789('0x32')],qs[_0x4789('0x38')](_0x3f4e55[_0x4789('0x34')][_0x4789('0x38')]));_0xa1dcef[_0x4789('0x37')]=_0xa1dcef[_0x4789('0x37')]['length']?_0xa1dcef[_0x4789('0x37')]:_0x5f0696[_0x4789('0x32')];_0xa1dcef['order']=qs[_0x4789('0x3b')](_0x3f4e55[_0x4789('0x34')][_0x4789('0x3b')]);_0xa1dcef[_0x4789('0x3c')]=qs[_0x4789('0x35')](_[_0x4789('0x3d')](_0x3f4e55['query'],_0x5f0696['filters']));if(_0x3f4e55[_0x4789('0x34')][_0x4789('0x43')]){_0xa1dcef[_0x4789('0x3c')]=_[_0x4789('0x3e')](_0xa1dcef[_0x4789('0x3c')],{'$or':_[_0x4789('0x3f')](_0xa1dcef[_0x4789('0x37')],function(_0x111644){var _0x1c5f9a={};_0x1c5f9a[_0x111644]={'$like':'%'+_0x3f4e55[_0x4789('0x34')]['filter']+'%'};return _0x1c5f9a;})});}_0xa1dcef=_[_0x4789('0x3e')]({},_0xa1dcef,_0x3f4e55[_0x4789('0x44')]);return _0x26162a[_0x4789('0x4e')](_0xa1dcef);}})['then'](function(_0x40d6a6){if(_0x40d6a6){_0xa04ff5=_0x40d6a6[_0x4789('0x39')];if(!_0x3f4e55['query']['hasOwnProperty']('nolimit')){_0xa1dcef[_0x4789('0x28')]=qs['limit'](_0x3f4e55[_0x4789('0x34')][_0x4789('0x28')]);_0xa1dcef[_0x4789('0x27')]=qs['offset'](_0x3f4e55[_0x4789('0x34')][_0x4789('0x27')]);}return _0x26162a['getFields'](_0xa1dcef);}})['then'](function(_0x10e15b){if(_0x10e15b){return _0x10e15b?{'count':_0xa04ff5,'rows':_0x10e15b}:null;}})[_0x4789('0x18')](respondWithResult(_0x27cb96,null))['catch'](handleError(_0x27cb96,null));};exports[_0x4789('0x52')]=function(_0x538e94,_0x3457c1,_0x215011){var _0x30ef0b={};var _0x316c40={};var _0x49e0ad;var _0x16e7f8;return db[_0x4789('0x31')][_0x4789('0x4f')]({'where':{'id':_0x538e94[_0x4789('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3457c1,null))[_0x4789('0x18')](function(_0x2f99ad){if(_0x2f99ad){_0x49e0ad=_0x2f99ad;_0x316c40[_0x4789('0x32')]=_[_0x4789('0x33')](db[_0x4789('0x50')][_0x4789('0x51')]);_0x316c40[_0x4789('0x34')]=_[_0x4789('0x33')](_0x538e94[_0x4789('0x34')]);_0x316c40[_0x4789('0x35')]=_[_0x4789('0x36')](_0x316c40['model'],_0x316c40['query']);_0x30ef0b['attributes']=_['intersection'](_0x316c40[_0x4789('0x32')],qs['fields'](_0x538e94[_0x4789('0x34')][_0x4789('0x38')]));_0x30ef0b[_0x4789('0x37')]=_0x30ef0b[_0x4789('0x37')][_0x4789('0x39')]?_0x30ef0b[_0x4789('0x37')]:_0x316c40['model'];_0x30ef0b[_0x4789('0x53')]=qs[_0x4789('0x3b')](_0x538e94[_0x4789('0x34')][_0x4789('0x3b')]);_0x30ef0b['where']=qs['filters'](_['pick'](_0x538e94[_0x4789('0x34')],_0x316c40[_0x4789('0x35')]));if(_0x538e94[_0x4789('0x34')][_0x4789('0x43')]){_0x30ef0b[_0x4789('0x3c')]=_[_0x4789('0x3e')](_0x30ef0b[_0x4789('0x3c')],{'$or':_[_0x4789('0x3f')](_0x30ef0b['attributes'],function(_0x8cc3f4){var _0x32cb0c={};_0x32cb0c[_0x8cc3f4]={'$like':'%'+_0x538e94[_0x4789('0x34')][_0x4789('0x43')]+'%'};return _0x32cb0c;})});}_0x30ef0b=_[_0x4789('0x3e')]({},_0x30ef0b,_0x538e94[_0x4789('0x44')]);return _0x49e0ad[_0x4789('0x52')](_0x30ef0b);}})[_0x4789('0x18')](function(_0x1871eb){if(_0x1871eb){_0x16e7f8=_0x1871eb[_0x4789('0x39')];if(!_0x538e94[_0x4789('0x34')][_0x4789('0x54')](_0x4789('0x3a'))){_0x30ef0b['limit']=qs[_0x4789('0x28')](_0x538e94[_0x4789('0x34')][_0x4789('0x28')]);_0x30ef0b[_0x4789('0x27')]=qs[_0x4789('0x27')](_0x538e94[_0x4789('0x34')][_0x4789('0x27')]);}return _0x49e0ad[_0x4789('0x52')](_0x30ef0b);}})[_0x4789('0x18')](function(_0x4139b9){if(_0x4139b9){return _0x4139b9?{'count':_0x16e7f8,'rows':_0x4139b9}:null;}})[_0x4789('0x18')](respondWithResult(_0x3457c1,null))['catch'](handleError(_0x3457c1,null));};exports[_0x4789('0x55')]=function(_0x20badb,_0x4bf605,_0x566b39){var _0xa6817e={};var _0x2ece85={};var _0x4631af;var _0x172d3d;return db[_0x4789('0x31')]['findOne']({'where':{'id':_0x20badb[_0x4789('0x4a')]['id']}})[_0x4789('0x18')](handleEntityNotFound(_0x4bf605,null))[_0x4789('0x18')](function(_0x20414b){if(_0x20414b){_0x4631af=_0x20414b;_0x2ece85[_0x4789('0x32')]=_[_0x4789('0x33')](db['Dynamics365Field']['rawAttributes']);_0x2ece85[_0x4789('0x34')]=_[_0x4789('0x33')](_0x20badb[_0x4789('0x34')]);_0x2ece85[_0x4789('0x35')]=_[_0x4789('0x36')](_0x2ece85['model'],_0x2ece85[_0x4789('0x34')]);_0xa6817e[_0x4789('0x37')]=_[_0x4789('0x36')](_0x2ece85[_0x4789('0x32')],qs[_0x4789('0x38')](_0x20badb['query'][_0x4789('0x38')]));_0xa6817e[_0x4789('0x37')]=_0xa6817e[_0x4789('0x37')][_0x4789('0x39')]?_0xa6817e[_0x4789('0x37')]:_0x2ece85[_0x4789('0x32')];_0xa6817e[_0x4789('0x53')]=qs[_0x4789('0x3b')](_0x20badb[_0x4789('0x34')]['sort']);_0xa6817e[_0x4789('0x3c')]=qs[_0x4789('0x35')](_['pick'](_0x20badb[_0x4789('0x34')],_0x2ece85[_0x4789('0x35')]));if(_0x20badb[_0x4789('0x34')][_0x4789('0x43')]){_0xa6817e[_0x4789('0x3c')]=_['merge'](_0xa6817e[_0x4789('0x3c')],{'$or':_['map'](_0xa6817e['attributes'],function(_0x595cee){var _0x1ba419={};_0x1ba419[_0x595cee]={'$like':'%'+_0x20badb[_0x4789('0x34')][_0x4789('0x43')]+'%'};return _0x1ba419;})});}_0xa6817e=_[_0x4789('0x3e')]({},_0xa6817e,_0x20badb[_0x4789('0x44')]);return _0x4631af[_0x4789('0x55')](_0xa6817e);}})[_0x4789('0x18')](function(_0x42efd1){if(_0x42efd1){_0x172d3d=_0x42efd1[_0x4789('0x39')];if(!_0x20badb[_0x4789('0x34')][_0x4789('0x54')](_0x4789('0x3a'))){_0xa6817e[_0x4789('0x28')]=qs[_0x4789('0x28')](_0x20badb[_0x4789('0x34')]['limit']);_0xa6817e[_0x4789('0x27')]=qs[_0x4789('0x27')](_0x20badb[_0x4789('0x34')][_0x4789('0x27')]);}return _0x4631af[_0x4789('0x55')](_0xa6817e);}})[_0x4789('0x18')](function(_0x1e0a52){if(_0x1e0a52){return _0x1e0a52?{'count':_0x172d3d,'rows':_0x1e0a52}:null;}})[_0x4789('0x18')](respondWithResult(_0x4bf605,null))[_0x4789('0x22')](handleError(_0x4bf605,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 7f7e166..e0a903c 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 _0x4030=['exports','Dynamics365Configuration','lodash','../../config/logger','moment','request-promise'];(function(_0xfdca7f,_0x25fa9a){var _0x49681e=function(_0x38cf48){while(--_0x38cf48){_0xfdca7f['push'](_0xfdca7f['shift']());}};_0x49681e(++_0x25fa9a);}(_0x4030,0x1e8));var _0x0403=function(_0xc2bf5e,_0x3b48c1){_0xc2bf5e=_0xc2bf5e-0x0;var _0x3e4354=_0x4030[_0xc2bf5e];return _0x3e4354;};'use strict';var _=require(_0x0403('0x0'));var util=require('util');var logger=require(_0x0403('0x1'))('api');var moment=require(_0x0403('0x2'));var BPromise=require('bluebird');var rp=require(_0x0403('0x3'));var attributes=require('./intDynamics365Configuration.attributes');module[_0x0403('0x4')]=function(_0x34d620,_0x444a79){return _0x34d620['define'](_0x0403('0x5'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6069=['exports','define','int_dynamics365_configurations','lodash','api','bluebird','./intDynamics365Configuration.attributes'];(function(_0x323d86,_0x37bbf5){var _0x4b1ad1=function(_0x27de31){while(--_0x27de31){_0x323d86['push'](_0x323d86['shift']());}};_0x4b1ad1(++_0x37bbf5);}(_0x6069,0xd5));var _0x9606=function(_0xb1e60e,_0x4ce2df){_0xb1e60e=_0xb1e60e-0x0;var _0x17e274=_0x6069[_0xb1e60e];return _0x17e274;};'use strict';var _=require(_0x9606('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9606('0x1'));var moment=require('moment');var BPromise=require(_0x9606('0x2'));var rp=require('request-promise');var attributes=require(_0x9606('0x3'));module[_0x9606('0x4')]=function(_0x54d1bf,_0xaa353c){return _0x54d1bf[_0x9606('0x5')]('Dynamics365Configuration',attributes,{'tableName':_0x9606('0x6'),'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 c4bb744..2a66eb1 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 _0x7817=['bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','moment'];(function(_0x2f3a0d,_0x5021c0){var _0x15ec12=function(_0x2f3f1c){while(--_0x2f3f1c){_0x2f3a0d['push'](_0x2f3a0d['shift']());}};_0x15ec12(++_0x5021c0);}(_0x7817,0xfb));var _0x7781=function(_0x31741b,_0x5aeb18){_0x31741b=_0x31741b-0x0;var _0x49e96b=_0x7817[_0x31741b];return _0x49e96b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7781('0x0'));var BPromise=require(_0x7781('0x1'));var rs=require(_0x7781('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7781('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x7781('0x4'));var jayson=require(_0x7781('0x5'));var client=jayson[_0x7781('0x6')][_0x7781('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x352e42,_0x35c735,_0x358b61){return new BPromise(function(_0x3c2a06,_0x1ba35e){return client['request'](_0x352e42,_0x358b61)['then'](function(_0x1ece5c){logger[_0x7781('0x8')]('Dynamics365Configuration,\x20%s,\x20%s',_0x35c735,_0x7781('0x9'));logger['debug'](_0x7781('0xa'),_0x35c735,_0x7781('0x9'),JSON[_0x7781('0xb')](_0x1ece5c));if(_0x1ece5c[_0x7781('0xc')]){if(_0x1ece5c[_0x7781('0xc')][_0x7781('0xd')]===0x1f4){logger[_0x7781('0xc')](_0x7781('0xe'),_0x35c735,_0x1ece5c[_0x7781('0xc')][_0x7781('0xf')]);return _0x1ba35e(_0x1ece5c[_0x7781('0xc')][_0x7781('0xf')]);}logger[_0x7781('0xc')](_0x7781('0xe'),_0x35c735,_0x1ece5c[_0x7781('0xc')]['message']);return _0x3c2a06(_0x1ece5c[_0x7781('0xc')][_0x7781('0xf')]);}else{logger[_0x7781('0x8')]('Dynamics365Configuration,\x20%s,\x20%s',_0x35c735,_0x7781('0x9'));_0x3c2a06(_0x1ece5c[_0x7781('0x10')][_0x7781('0xf')]);}})[_0x7781('0x11')](function(_0x1b3fc2){logger[_0x7781('0xc')](_0x7781('0xe'),_0x35c735,_0x1b3fc2);_0x1ba35e(_0x1b3fc2);});});} \ No newline at end of file +var _0x35bd=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x47905a,_0x39559b){var _0x2a6875=function(_0x48f1ab){while(--_0x48f1ab){_0x47905a['push'](_0x47905a['shift']());}};_0x2a6875(++_0x39559b);}(_0x35bd,0x1d2));var _0xd35b=function(_0x130e9,_0x9babf9){_0x130e9=_0x130e9-0x0;var _0x2a4932=_0x35bd[_0x130e9];return _0x2a4932;};'use strict';var _=require('lodash');var util=require(_0xd35b('0x0'));var moment=require(_0xd35b('0x1'));var BPromise=require('bluebird');var rs=require(_0xd35b('0x2'));var fs=require('fs');var Redis=require(_0xd35b('0x3'));var db=require(_0xd35b('0x4'))['db'];var utils=require(_0xd35b('0x5'));var logger=require(_0xd35b('0x6'))(_0xd35b('0x7'));var config=require(_0xd35b('0x8'));var jayson=require(_0xd35b('0x9'));var client=jayson['client'][_0xd35b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x199ed7,_0x1eea88,_0xe548ef){return new BPromise(function(_0x220c3b,_0x4c60ba){return client[_0xd35b('0xb')](_0x199ed7,_0xe548ef)['then'](function(_0xfcbd75){logger[_0xd35b('0xc')](_0xd35b('0xd'),_0x1eea88,'request\x20sent');logger[_0xd35b('0xe')](_0xd35b('0xf'),_0x1eea88,'request\x20sent',JSON[_0xd35b('0x10')](_0xfcbd75));if(_0xfcbd75[_0xd35b('0x11')]){if(_0xfcbd75[_0xd35b('0x11')][_0xd35b('0x12')]===0x1f4){logger['error'](_0xd35b('0xd'),_0x1eea88,_0xfcbd75['error'][_0xd35b('0x13')]);return _0x4c60ba(_0xfcbd75['error']['message']);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x1eea88,_0xfcbd75[_0xd35b('0x11')][_0xd35b('0x13')]);return _0x220c3b(_0xfcbd75[_0xd35b('0x11')][_0xd35b('0x13')]);}else{logger[_0xd35b('0xc')](_0xd35b('0xd'),_0x1eea88,'request\x20sent');_0x220c3b(_0xfcbd75['result'][_0xd35b('0x13')]);}})['catch'](function(_0xaa50b9){logger[_0xd35b('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1eea88,_0xaa50b9);_0x4c60ba(_0xaa50b9);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 9dd6158..10db752 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 _0xab0b=['../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service'];(function(_0x358927,_0x1eee11){var _0x4d5873=function(_0x46cc25){while(--_0x46cc25){_0x358927['push'](_0x358927['shift']());}};_0x4d5873(++_0x1eee11);}(_0xab0b,0x1ac));var _0xbab0=function(_0x256d9a,_0x1dc479){_0x256d9a=_0x256d9a-0x0;var _0x705ca4=_0xab0b[_0x256d9a];return _0x705ca4;};'use strict';var multer=require(_0xbab0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbab0('0x1'));var express=require(_0xbab0('0x2'));var router=express['Router']();var auth=require(_0xbab0('0x3'));var interaction=require(_0xbab0('0x4'));var config=require(_0xbab0('0x5'));var controller=require(_0xbab0('0x6'));router[_0xbab0('0x7')]('/',auth[_0xbab0('0x8')](),controller[_0xbab0('0x9')]);router['get'](_0xbab0('0xa'),auth['isAuthenticated'](),controller[_0xbab0('0xb')]);router[_0xbab0('0xc')]('/',auth[_0xbab0('0x8')](),controller['create']);router[_0xbab0('0xd')](_0xbab0('0xa'),auth[_0xbab0('0x8')](),controller[_0xbab0('0xe')]);router[_0xbab0('0xf')](_0xbab0('0xa'),auth[_0xbab0('0x8')](),controller[_0xbab0('0x10')]);module[_0xbab0('0x11')]=router; \ No newline at end of file +var _0x36e6=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','update','destroy','exports','util','path'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x36e6,0xca));var _0x636e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x36e6[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0x636e('0x0'));var path=require(_0x636e('0x1'));var timeout=require(_0x636e('0x2'));var express=require(_0x636e('0x3'));var router=express['Router']();var auth=require(_0x636e('0x4'));var interaction=require(_0x636e('0x5'));var config=require(_0x636e('0x6'));var controller=require('./intDynamics365Field.controller');router[_0x636e('0x7')]('/',auth['isAuthenticated'](),controller[_0x636e('0x8')]);router[_0x636e('0x7')](_0x636e('0x9'),auth[_0x636e('0xa')](),controller[_0x636e('0xb')]);router[_0x636e('0xc')]('/',auth[_0x636e('0xa')](),controller[_0x636e('0xd')]);router['put'](_0x636e('0x9'),auth[_0x636e('0xa')](),controller[_0x636e('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x636e('0xf')]);module[_0x636e('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index cf483e2..51ca1a1 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 _0x6324=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','STRING'];(function(_0x572f17,_0x368b41){var _0x209580=function(_0x315a2b){while(--_0x315a2b){_0x572f17['push'](_0x572f17['shift']());}};_0x209580(++_0x368b41);}(_0x6324,0x142));var _0x4632=function(_0x43eadd,_0x36ca50){_0x43eadd=_0x43eadd-0x0;var _0x125bde=_0x6324[_0x43eadd];return _0x125bde;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'type':{'type':Sequelize[_0x4632('0x2')](_0x4632('0x3'),'variable',_0x4632('0x4'),'keyValue'),'defaultValue':_0x4632('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4632('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x4632('0x3'),_0x4632('0x6'),_0x4632('0x4'))},'keyContent':{'type':Sequelize[_0x4632('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4632('0x5')]},'customField':{'type':Sequelize[_0x4632('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4632('0x5')]}}; \ No newline at end of file +var _0x6c76=['customVariable','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x6c76,0x184));var _0x66c7=function(_0x3e53e3,_0x54ec72){_0x3e53e3=_0x3e53e3-0x0;var _0x14f938=_0x6c76[_0x3e53e3];return _0x14f938;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'type':{'type':Sequelize[_0x66c7('0x2')]('string',_0x66c7('0x3'),_0x66c7('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x66c7('0x5')]},'key':{'type':Sequelize[_0x66c7('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x66c7('0x6'),_0x66c7('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x66c7('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x66c7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x66c7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 50f9699..386c477 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 _0x2202=['status','set','Content-Range','apply','save','update','then','destroy','end','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','type','key','VIRTUAL','field','merge','count','includeAll','include','Dynamics365Field','findAll','catch','params','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','squel','jsforce','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','api','sendStatus','json','offset','limit'];(function(_0x1b473e,_0x757cc2){var _0x2f843c=function(_0xc48e1a){while(--_0xc48e1a){_0x1b473e['push'](_0x1b473e['shift']());}};_0x2f843c(++_0x757cc2);}(_0x2202,0xab));var _0x2220=function(_0x213a90,_0x350053){_0x213a90=_0x213a90-0x0;var _0x175803=_0x2202[_0x213a90];return _0x175803;};'use strict';var pdf=require(_0x2220('0x0'));var emlformat=require(_0x2220('0x1'));var rimraf=require(_0x2220('0x2'));var zipdir=require(_0x2220('0x3'));var jsonpatch=require(_0x2220('0x4'));var rp=require(_0x2220('0x5'));var moment=require(_0x2220('0x6'));var BPromise=require(_0x2220('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2220('0x8'));var sox=require('sox');var csv=require(_0x2220('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2220('0xa'));var crypto=require('crypto');var jsforce=require(_0x2220('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2220('0xc'));var Papa=require('papaparse');var authService=require(_0x2220('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x2220('0xe'));var qs=require(_0x2220('0xf'));var logger=require('../../config/logger')(_0x2220('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ee783,_0x2231f3){_0x2231f3=_0x2231f3||0xcc;return function(_0x1c981d){if(_0x1c981d){return _0x3ee783[_0x2220('0x11')](_0x2231f3);}return _0x3ee783['status'](_0x2231f3)['end']();};}function respondWithResult(_0x1f24c5,_0x4312d2){_0x4312d2=_0x4312d2||0xc8;return function(_0x9c11f5){if(_0x9c11f5){return _0x1f24c5['status'](_0x4312d2)[_0x2220('0x12')](_0x9c11f5);}};}function respondWithFilteredResult(_0x43c935,_0x3a8e87){return function(_0x437d67){if(_0x437d67){var _0x5e41d9=_0x437d67['count'],_0x1e9ebb=_0x3a8e87[_0x2220('0x13')],_0x12c552=_0x3a8e87[_0x2220('0x13')]+_0x3a8e87[_0x2220('0x14')],_0x1d8dde;if(_0x12c552>=_0x5e41d9){_0x12c552=_0x5e41d9;_0x1d8dde=0xc8;}else{_0x1d8dde=0xce;}_0x43c935[_0x2220('0x15')](_0x1d8dde);return _0x43c935[_0x2220('0x16')](_0x2220('0x17'),_0x1e9ebb+'-'+_0x12c552+'/'+_0x5e41d9)[_0x2220('0x12')](_0x437d67);}return null;};}function patchUpdates(_0x86254){return function(_0x2fc222){try{jsonpatch[_0x2220('0x18')](_0x2fc222,_0x86254,!![]);}catch(_0x46f540){return BPromise['reject'](_0x46f540);}return _0x2fc222[_0x2220('0x19')]();};}function saveUpdates(_0x56002d,_0x5c9fd7){return function(_0x5a93a0){if(_0x5a93a0){return _0x5a93a0[_0x2220('0x1a')](_0x56002d)[_0x2220('0x1b')](function(_0x5cfe45){return _0x5cfe45;});}return null;};}function removeEntity(_0x5a3749,_0x87d6ca){return function(_0x238856){if(_0x238856){return _0x238856[_0x2220('0x1c')]()[_0x2220('0x1b')](function(){_0x5a3749[_0x2220('0x15')](0xcc)[_0x2220('0x1d')]();});}};}function handleEntityNotFound(_0x71f1ea,_0x2ee136){return function(_0x206c87){if(!_0x206c87){_0x71f1ea[_0x2220('0x11')](0x194);}return _0x206c87;};}function handleError(_0x5add06,_0x9bddd){_0x9bddd=_0x9bddd||0x1f4;return function(_0x4b0103){logger['error'](_0x4b0103[_0x2220('0x1e')]);if(_0x4b0103[_0x2220('0x1f')]){delete _0x4b0103[_0x2220('0x1f')];}_0x5add06['status'](_0x9bddd)['send'](_0x4b0103);};}exports[_0x2220('0x20')]=function(_0x52d029,_0x19c1cf){var _0x22745f={},_0x5e69d9={},_0x538de8={'count':0x0,'rows':[]};var _0x469a49=db['Dynamics365Field'][_0x2220('0x21')];_0x5e69d9[_0x2220('0x22')]=_[_0x2220('0x23')](_0x469a49);_0x5e69d9[_0x2220('0x24')]=_[_0x2220('0x23')](_0x52d029[_0x2220('0x24')]);_0x5e69d9[_0x2220('0x25')]=_[_0x2220('0x26')](_0x5e69d9[_0x2220('0x22')],_0x5e69d9[_0x2220('0x24')]);_0x22745f[_0x2220('0x27')]=_['intersection'](_0x5e69d9[_0x2220('0x22')],qs[_0x2220('0x28')](_0x52d029[_0x2220('0x24')][_0x2220('0x28')]));_0x22745f[_0x2220('0x27')]=_0x22745f[_0x2220('0x27')][_0x2220('0x29')]?_0x22745f['attributes']:_0x5e69d9['model'];if(!_0x52d029[_0x2220('0x24')][_0x2220('0x2a')](_0x2220('0x2b'))){_0x22745f[_0x2220('0x14')]=qs[_0x2220('0x14')](_0x52d029[_0x2220('0x24')]['limit']);_0x22745f[_0x2220('0x13')]=qs[_0x2220('0x13')](_0x52d029[_0x2220('0x24')][_0x2220('0x13')]);}_0x22745f['order']=qs[_0x2220('0x2c')](_0x52d029['query'][_0x2220('0x2c')]);_0x22745f[_0x2220('0x2d')]=qs[_0x2220('0x25')](_['pick'](_0x52d029[_0x2220('0x24')],_0x5e69d9[_0x2220('0x25')]));if(_0x52d029[_0x2220('0x24')][_0x2220('0x2e')]){_0x22745f[_0x2220('0x2d')]=_['merge'](_0x22745f[_0x2220('0x2d')],{'$or':_[_0x2220('0x2f')](_0x469a49,function(_0x46b14b){if(_0x46b14b[_0x2220('0x30')][_0x2220('0x31')]!==_0x2220('0x32')){var _0x2c588d={};_0x2c588d[_0x46b14b[_0x2220('0x33')]]={'$like':'%'+_0x52d029[_0x2220('0x24')][_0x2220('0x2e')]+'%'};return _0x2c588d;}})});}_0x22745f=_[_0x2220('0x34')]({},_0x22745f,_0x52d029['options']);var _0x1adf31={'where':_0x22745f['where']};return db['Dynamics365Field'][_0x2220('0x35')](_0x1adf31)[_0x2220('0x1b')](function(_0x2c1499){_0x538de8[_0x2220('0x35')]=_0x2c1499;if(_0x52d029['query'][_0x2220('0x36')]){_0x22745f[_0x2220('0x37')]=[{'all':!![]}];}return db[_0x2220('0x38')][_0x2220('0x39')](_0x22745f);})[_0x2220('0x1b')](function(_0x31103e){_0x538de8['rows']=_0x31103e;return _0x538de8;})[_0x2220('0x1b')](respondWithFilteredResult(_0x19c1cf,_0x22745f))[_0x2220('0x3a')](handleError(_0x19c1cf,null));};exports['show']=function(_0x550f1a,_0x4f425a){var _0x326007={'raw':!![],'where':{'id':_0x550f1a[_0x2220('0x3b')]['id']}},_0x24522a={};_0x24522a['model']=_[_0x2220('0x23')](db[_0x2220('0x38')][_0x2220('0x21')]);_0x24522a['query']=_['keys'](_0x550f1a[_0x2220('0x24')]);_0x24522a[_0x2220('0x25')]=_['intersection'](_0x24522a['model'],_0x24522a['query']);_0x326007[_0x2220('0x27')]=_['intersection'](_0x24522a['model'],qs[_0x2220('0x28')](_0x550f1a[_0x2220('0x24')][_0x2220('0x28')]));_0x326007[_0x2220('0x27')]=_0x326007['attributes'][_0x2220('0x29')]?_0x326007[_0x2220('0x27')]:_0x24522a[_0x2220('0x22')];if(_0x550f1a[_0x2220('0x24')]['includeAll']){_0x326007[_0x2220('0x37')]=[{'all':!![]}];}_0x326007=_['merge']({},_0x326007,_0x550f1a[_0x2220('0x3c')]);return db['Dynamics365Field'][_0x2220('0x3d')](_0x326007)[_0x2220('0x1b')](handleEntityNotFound(_0x4f425a,null))[_0x2220('0x1b')](respondWithResult(_0x4f425a,null))[_0x2220('0x3a')](handleError(_0x4f425a,null));};exports[_0x2220('0x3e')]=function(_0x1eacfe,_0x4478a2){return db[_0x2220('0x38')]['create'](_0x1eacfe[_0x2220('0x3f')],{})[_0x2220('0x1b')](respondWithResult(_0x4478a2,0xc9))[_0x2220('0x3a')](handleError(_0x4478a2,null));};exports[_0x2220('0x1a')]=function(_0x433639,_0x353191){if(_0x433639[_0x2220('0x3f')]['id']){delete _0x433639[_0x2220('0x3f')]['id'];}return db['Dynamics365Field'][_0x2220('0x3d')]({'where':{'id':_0x433639['params']['id']}})[_0x2220('0x1b')](handleEntityNotFound(_0x353191,null))[_0x2220('0x1b')](saveUpdates(_0x433639['body'],null))[_0x2220('0x1b')](respondWithResult(_0x353191,null))['catch'](handleError(_0x353191,null));};exports[_0x2220('0x1c')]=function(_0x553288,_0x47cbe9){return db[_0x2220('0x38')]['find']({'where':{'id':_0x553288[_0x2220('0x3b')]['id']}})[_0x2220('0x1b')](handleEntityNotFound(_0x47cbe9,null))[_0x2220('0x1b')](removeEntity(_0x47cbe9,null))[_0x2220('0x3a')](handleError(_0x47cbe9,null));}; \ No newline at end of file +var _0x757c=['path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','error','name','send','index','Dynamics365Field','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','options','count','then','includeAll','include','findAll','catch','show','params','create','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x5618c4,_0x4e8f57){var _0xdf390f=function(_0x1406cb){while(--_0x1406cb){_0x5618c4['push'](_0x5618c4['shift']());}};_0xdf390f(++_0x4e8f57);}(_0x757c,0xc9));var _0xc757=function(_0x32a590,_0xabc263){_0x32a590=_0x32a590-0x0;var _0x397898=_0x757c[_0x32a590];return _0x397898;};'use strict';var pdf=require(_0xc757('0x0'));var emlformat=require(_0xc757('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc757('0x2'));var jsonpatch=require(_0xc757('0x3'));var rp=require(_0xc757('0x4'));var moment=require(_0xc757('0x5'));var BPromise=require(_0xc757('0x6'));var Mustache=require(_0xc757('0x7'));var util=require(_0xc757('0x8'));var path=require(_0xc757('0x9'));var sox=require(_0xc757('0xa'));var csv=require(_0xc757('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc757('0xc'));var squel=require(_0xc757('0xd'));var crypto=require(_0xc757('0xe'));var jsforce=require(_0xc757('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc757('0xb'));var querystring=require('querystring');var Papa=require(_0xc757('0x10'));var authService=require(_0xc757('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xc757('0x12'));var qs=require(_0xc757('0x13'));var logger=require(_0xc757('0x14'))(_0xc757('0x15'));var utils=require(_0xc757('0x16'));var config=require(_0xc757('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ba1d8,_0xb1de9d){_0xb1de9d=_0xb1de9d||0xcc;return function(_0x41a474){if(_0x41a474){return _0x4ba1d8[_0xc757('0x18')](_0xb1de9d);}return _0x4ba1d8[_0xc757('0x19')](_0xb1de9d)['end']();};}function respondWithResult(_0x42b6d8,_0x290f8d){_0x290f8d=_0x290f8d||0xc8;return function(_0x54c11b){if(_0x54c11b){return _0x42b6d8[_0xc757('0x19')](_0x290f8d)[_0xc757('0x1a')](_0x54c11b);}};}function respondWithFilteredResult(_0x2ea92d,_0xf93448){return function(_0x1d1981){if(_0x1d1981){var _0x433927=_0x1d1981['count'],_0x510b81=_0xf93448[_0xc757('0x1b')],_0x409361=_0xf93448[_0xc757('0x1b')]+_0xf93448[_0xc757('0x1c')],_0x123b10;if(_0x409361>=_0x433927){_0x409361=_0x433927;_0x123b10=0xc8;}else{_0x123b10=0xce;}_0x2ea92d[_0xc757('0x19')](_0x123b10);return _0x2ea92d[_0xc757('0x1d')](_0xc757('0x1e'),_0x510b81+'-'+_0x409361+'/'+_0x433927)[_0xc757('0x1a')](_0x1d1981);}return null;};}function patchUpdates(_0x31ff90){return function(_0x1e10c3){try{jsonpatch['apply'](_0x1e10c3,_0x31ff90,!![]);}catch(_0x478ae3){return BPromise[_0xc757('0x1f')](_0x478ae3);}return _0x1e10c3[_0xc757('0x20')]();};}function saveUpdates(_0x478c78,_0x2cd76c){return function(_0xcbc879){if(_0xcbc879){return _0xcbc879[_0xc757('0x21')](_0x478c78)['then'](function(_0x41758c){return _0x41758c;});}return null;};}function removeEntity(_0x333a4a,_0x372df5){return function(_0x16bbce){if(_0x16bbce){return _0x16bbce[_0xc757('0x22')]()['then'](function(){_0x333a4a[_0xc757('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x157431,_0x77a843){return function(_0xc2218){if(!_0xc2218){_0x157431[_0xc757('0x18')](0x194);}return _0xc2218;};}function handleError(_0x10b490,_0x4add36){_0x4add36=_0x4add36||0x1f4;return function(_0x3c3eb3){logger[_0xc757('0x23')](_0x3c3eb3['stack']);if(_0x3c3eb3['name']){delete _0x3c3eb3[_0xc757('0x24')];}_0x10b490[_0xc757('0x19')](_0x4add36)[_0xc757('0x25')](_0x3c3eb3);};}exports[_0xc757('0x26')]=function(_0x4a228f,_0x644cd7){var _0x255ac0={},_0x3f4c5e={},_0x2b9d6f={'count':0x0,'rows':[]};var _0x417920=db[_0xc757('0x27')][_0xc757('0x28')];_0x3f4c5e[_0xc757('0x29')]=_[_0xc757('0x2a')](_0x417920);_0x3f4c5e[_0xc757('0x2b')]=_['keys'](_0x4a228f[_0xc757('0x2b')]);_0x3f4c5e[_0xc757('0x2c')]=_[_0xc757('0x2d')](_0x3f4c5e['model'],_0x3f4c5e[_0xc757('0x2b')]);_0x255ac0[_0xc757('0x2e')]=_[_0xc757('0x2d')](_0x3f4c5e[_0xc757('0x29')],qs[_0xc757('0x2f')](_0x4a228f[_0xc757('0x2b')][_0xc757('0x2f')]));_0x255ac0[_0xc757('0x2e')]=_0x255ac0['attributes'][_0xc757('0x30')]?_0x255ac0[_0xc757('0x2e')]:_0x3f4c5e[_0xc757('0x29')];if(!_0x4a228f[_0xc757('0x2b')][_0xc757('0x31')](_0xc757('0x32'))){_0x255ac0[_0xc757('0x1c')]=qs[_0xc757('0x1c')](_0x4a228f[_0xc757('0x2b')][_0xc757('0x1c')]);_0x255ac0[_0xc757('0x1b')]=qs[_0xc757('0x1b')](_0x4a228f[_0xc757('0x2b')][_0xc757('0x1b')]);}_0x255ac0[_0xc757('0x33')]=qs['sort'](_0x4a228f[_0xc757('0x2b')][_0xc757('0x34')]);_0x255ac0[_0xc757('0x35')]=qs[_0xc757('0x2c')](_['pick'](_0x4a228f[_0xc757('0x2b')],_0x3f4c5e[_0xc757('0x2c')]));if(_0x4a228f['query'][_0xc757('0x36')]){_0x255ac0[_0xc757('0x35')]=_[_0xc757('0x37')](_0x255ac0[_0xc757('0x35')],{'$or':_[_0xc757('0x38')](_0x417920,function(_0x39e384){if(_0x39e384[_0xc757('0x39')]['key']!==_0xc757('0x3a')){var _0x5a6434={};_0x5a6434[_0x39e384['field']]={'$like':'%'+_0x4a228f[_0xc757('0x2b')][_0xc757('0x36')]+'%'};return _0x5a6434;}})});}_0x255ac0=_[_0xc757('0x37')]({},_0x255ac0,_0x4a228f[_0xc757('0x3b')]);var _0x375718={'where':_0x255ac0['where']};return db[_0xc757('0x27')][_0xc757('0x3c')](_0x375718)[_0xc757('0x3d')](function(_0x59fbad){_0x2b9d6f[_0xc757('0x3c')]=_0x59fbad;if(_0x4a228f[_0xc757('0x2b')][_0xc757('0x3e')]){_0x255ac0[_0xc757('0x3f')]=[{'all':!![]}];}return db[_0xc757('0x27')][_0xc757('0x40')](_0x255ac0);})[_0xc757('0x3d')](function(_0x19b5f6){_0x2b9d6f['rows']=_0x19b5f6;return _0x2b9d6f;})['then'](respondWithFilteredResult(_0x644cd7,_0x255ac0))[_0xc757('0x41')](handleError(_0x644cd7,null));};exports[_0xc757('0x42')]=function(_0xcbb89f,_0x3d7639){var _0x4e6ac2={'raw':!![],'where':{'id':_0xcbb89f[_0xc757('0x43')]['id']}},_0x1f31fb={};_0x1f31fb['model']=_[_0xc757('0x2a')](db[_0xc757('0x27')][_0xc757('0x28')]);_0x1f31fb['query']=_['keys'](_0xcbb89f[_0xc757('0x2b')]);_0x1f31fb['filters']=_[_0xc757('0x2d')](_0x1f31fb[_0xc757('0x29')],_0x1f31fb[_0xc757('0x2b')]);_0x4e6ac2[_0xc757('0x2e')]=_[_0xc757('0x2d')](_0x1f31fb[_0xc757('0x29')],qs[_0xc757('0x2f')](_0xcbb89f[_0xc757('0x2b')][_0xc757('0x2f')]));_0x4e6ac2[_0xc757('0x2e')]=_0x4e6ac2[_0xc757('0x2e')][_0xc757('0x30')]?_0x4e6ac2[_0xc757('0x2e')]:_0x1f31fb[_0xc757('0x29')];if(_0xcbb89f[_0xc757('0x2b')][_0xc757('0x3e')]){_0x4e6ac2['include']=[{'all':!![]}];}_0x4e6ac2=_[_0xc757('0x37')]({},_0x4e6ac2,_0xcbb89f[_0xc757('0x3b')]);return db[_0xc757('0x27')]['find'](_0x4e6ac2)['then'](handleEntityNotFound(_0x3d7639,null))[_0xc757('0x3d')](respondWithResult(_0x3d7639,null))[_0xc757('0x41')](handleError(_0x3d7639,null));};exports['create']=function(_0x58b114,_0xf5f72b){return db[_0xc757('0x27')][_0xc757('0x44')](_0x58b114['body'],{})[_0xc757('0x3d')](respondWithResult(_0xf5f72b,0xc9))[_0xc757('0x41')](handleError(_0xf5f72b,null));};exports['update']=function(_0x3cd971,_0x1e1f66){if(_0x3cd971['body']['id']){delete _0x3cd971['body']['id'];}return db[_0xc757('0x27')][_0xc757('0x45')]({'where':{'id':_0x3cd971[_0xc757('0x43')]['id']}})[_0xc757('0x3d')](handleEntityNotFound(_0x1e1f66,null))[_0xc757('0x3d')](saveUpdates(_0x3cd971['body'],null))[_0xc757('0x3d')](respondWithResult(_0x1e1f66,null))[_0xc757('0x41')](handleError(_0x1e1f66,null));};exports[_0xc757('0x22')]=function(_0x3a3baa,_0x4d8073){return db['Dynamics365Field']['find']({'where':{'id':_0x3a3baa[_0xc757('0x43')]['id']}})[_0xc757('0x3d')](handleEntityNotFound(_0x4d8073,null))[_0xc757('0x3d')](removeEntity(_0x4d8073,null))[_0xc757('0x41')](handleError(_0x4d8073,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 2d83177..b6406bb 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 _0xa2c4=['dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x3611a8,_0x57303c){var _0x2acfb9=function(_0x1211bf){while(--_0x1211bf){_0x3611a8['push'](_0x3611a8['shift']());}};_0x2acfb9(++_0x57303c);}(_0xa2c4,0x1ba));var _0x4a2c=function(_0x5916fd,_0xfe91ac){_0x5916fd=_0x5916fd-0x0;var _0x54b69a=_0xa2c4[_0x5916fd];return _0x54b69a;};'use strict';var _=require(_0x4a2c('0x0'));var util=require(_0x4a2c('0x1'));var logger=require(_0x4a2c('0x2'))(_0x4a2c('0x3'));var moment=require('moment');var BPromise=require(_0x4a2c('0x4'));var rp=require(_0x4a2c('0x5'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x107698,_0x2cf3d2){return _0x107698[_0x4a2c('0x6')](_0x4a2c('0x7'),attributes,{'tableName':_0x4a2c('0x8'),'paranoid':![],'indexes':[{'name':_0x4a2c('0x9'),'fields':['idField',_0x4a2c('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac8d=['dynamics365_unique_index','FieldId','util','../../config/logger','api','bluebird','request-promise','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0x263b83,_0x511756){var _0x411c83=function(_0x116536){while(--_0x116536){_0x263b83['push'](_0x263b83['shift']());}};_0x411c83(++_0x511756);}(_0xac8d,0xb2));var _0xdac8=function(_0xcc51d,_0x10c495){_0xcc51d=_0xcc51d-0x0;var _0x17d867=_0xac8d[_0xcc51d];return _0x17d867;};'use strict';var _=require('lodash');var util=require(_0xdac8('0x0'));var logger=require(_0xdac8('0x1'))(_0xdac8('0x2'));var moment=require('moment');var BPromise=require(_0xdac8('0x3'));var rp=require(_0xdac8('0x4'));var attributes=require(_0xdac8('0x5'));module[_0xdac8('0x6')]=function(_0x5d4331,_0x3d0f25){return _0x5d4331[_0xdac8('0x7')](_0xdac8('0x8'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xdac8('0x9'),'fields':['idField',_0xdac8('0xa')],'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 fa3298b..1852e48 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 _0xffdd=['message','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','debug','stringify','error','code'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xffdd,0x193));var _0xdffd=function(_0x57ba88,_0x65ae7){_0x57ba88=_0x57ba88-0x0;var _0x177ec8=_0xffdd[_0x57ba88];return _0x177ec8;};'use strict';var _=require(_0xdffd('0x0'));var util=require(_0xdffd('0x1'));var moment=require(_0xdffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdffd('0x3'));var db=require(_0xdffd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdffd('0x5'))(_0xdffd('0x6'));var config=require(_0xdffd('0x7'));var jayson=require(_0xdffd('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4835f6,_0x372e34,_0x25cd14){return new BPromise(function(_0x1c39c6,_0x2e9eb0){return client[_0xdffd('0x9')](_0x4835f6,_0x25cd14)[_0xdffd('0xa')](function(_0x19137c){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x372e34,'request\x20sent');logger[_0xdffd('0xb')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x372e34,'request\x20sent',JSON[_0xdffd('0xc')](_0x19137c));if(_0x19137c[_0xdffd('0xd')]){if(_0x19137c[_0xdffd('0xd')][_0xdffd('0xe')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x372e34,_0x19137c[_0xdffd('0xd')]['message']);return _0x2e9eb0(_0x19137c[_0xdffd('0xd')][_0xdffd('0xf')]);}logger[_0xdffd('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x372e34,_0x19137c[_0xdffd('0xd')][_0xdffd('0xf')]);return _0x1c39c6(_0x19137c[_0xdffd('0xd')][_0xdffd('0xf')]);}else{logger[_0xdffd('0x10')](_0xdffd('0x11'),_0x372e34,_0xdffd('0x12'));_0x1c39c6(_0x19137c['result'][_0xdffd('0xf')]);}})['catch'](function(_0xa5dd99){logger[_0xdffd('0xd')](_0xdffd('0x11'),_0x372e34,_0xa5dd99);_0x2e9eb0(_0xa5dd99);});});} \ No newline at end of file +var _0x5b12=['Dynamics365Field,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x5b12,0xa3));var _0x25b1=function(_0x103e6e,_0x43bfe9){_0x103e6e=_0x103e6e-0x0;var _0x21c9bf=_0x5b12[_0x103e6e];return _0x21c9bf;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 3b1f020..93007b1 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 _0x4ef0=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer'];(function(_0x1b915f,_0x56c5f8){var _0x577ee3=function(_0x3d7376){while(--_0x3d7376){_0x1b915f['push'](_0x1b915f['shift']());}};_0x577ee3(++_0x56c5f8);}(_0x4ef0,0x14f));var _0x04ef=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x4ef0[_0x547456];return _0xc1fd7b;};'use strict';var multer=require(_0x04ef('0x0'));var util=require(_0x04ef('0x1'));var path=require(_0x04ef('0x2'));var timeout=require(_0x04ef('0x3'));var express=require('express');var router=express[_0x04ef('0x4')]();var auth=require(_0x04ef('0x5'));var interaction=require(_0x04ef('0x6'));var config=require('../../config/environment');var controller=require(_0x04ef('0x7'));router[_0x04ef('0x8')]('/',auth['isAuthenticated'](),controller[_0x04ef('0x9')]);router['get'](_0x04ef('0xa'),auth[_0x04ef('0xb')](),controller[_0x04ef('0xc')]);router['get'](_0x04ef('0xd'),auth['isAuthenticated'](),controller[_0x04ef('0xe')]);router['get'](_0x04ef('0xf'),auth['isAuthenticated'](),controller[_0x04ef('0x10')]);router[_0x04ef('0x11')]('/',auth[_0x04ef('0xb')](),controller[_0x04ef('0x12')]);router[_0x04ef('0x11')](_0x04ef('0xd'),auth[_0x04ef('0xb')](),controller[_0x04ef('0x13')]);router[_0x04ef('0x14')](_0x04ef('0xa'),auth[_0x04ef('0xb')](),controller[_0x04ef('0x15')]);router[_0x04ef('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x04ef('0x17')]);module['exports']=router; \ No newline at end of file +var _0x4134=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','index','isAuthenticated','show','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4134,0x6e));var _0x4413=function(_0x556b43,_0x33f59c){_0x556b43=_0x556b43-0x0;var _0x32c8d4=_0x4134[_0x556b43];return _0x32c8d4;};'use strict';var multer=require(_0x4413('0x0'));var util=require(_0x4413('0x1'));var path=require(_0x4413('0x2'));var timeout=require(_0x4413('0x3'));var express=require('express');var router=express[_0x4413('0x4')]();var auth=require(_0x4413('0x5'));var interaction=require(_0x4413('0x6'));var config=require('../../config/environment');var controller=require(_0x4413('0x7'));router[_0x4413('0x8')]('/',auth['isAuthenticated'](),controller[_0x4413('0x9')]);router[_0x4413('0x8')]('/:id',auth[_0x4413('0xa')](),controller[_0x4413('0xb')]);router[_0x4413('0x8')]('/:id/configurations',auth[_0x4413('0xa')](),controller[_0x4413('0xc')]);router[_0x4413('0x8')](_0x4413('0xd'),auth[_0x4413('0xa')](),controller['getFields']);router[_0x4413('0xe')]('/',auth[_0x4413('0xa')](),controller[_0x4413('0xf')]);router['post']('/:id/configurations',auth[_0x4413('0xa')](),controller[_0x4413('0x10')]);router[_0x4413('0x11')](_0x4413('0x12'),auth['isAuthenticated'](),controller[_0x4413('0x13')]);router[_0x4413('0x14')](_0x4413('0x12'),auth[_0x4413('0xa')](),controller['destroy']);module[_0x4413('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index d2eea44..ba83174 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 _0xf9d5=['username','remoteUri','exports','STRING'];(function(_0x51183f,_0x585a89){var _0xa47ca5=function(_0x506bcc){while(--_0x506bcc){_0x51183f['push'](_0x51183f['shift']());}};_0xa47ca5(++_0x585a89);}(_0xf9d5,0x122));var _0x5f9d=function(_0x32d330,_0xe907c8){_0x32d330=_0x32d330-0x0;var _0xe81a43=_0xf9d5[_0x32d330];return _0xe81a43;};'use strict';var Sequelize=require('sequelize');module[_0x5f9d('0x0')]={'name':{'type':Sequelize[_0x5f9d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x5f9d('0x1')],'unique':_0x5f9d('0x2')},'apiKey':{'type':Sequelize[_0x5f9d('0x1')]},'remoteUri':{'type':Sequelize[_0x5f9d('0x1')],'unique':_0x5f9d('0x3')},'serverUrl':{'type':Sequelize[_0x5f9d('0x1')]}}; \ No newline at end of file +var _0x0b11=['username','remoteUri','sequelize','STRING'];(function(_0x47febb,_0x5b35c0){var _0x4599db=function(_0x4fd759){while(--_0x4fd759){_0x47febb['push'](_0x47febb['shift']());}};_0x4599db(++_0x5b35c0);}(_0x0b11,0xf6));var _0x10b1=function(_0x4d467f,_0x54d2e7){_0x4d467f=_0x4d467f-0x0;var _0x521bb5=_0x0b11[_0x4d467f];return _0x521bb5;};'use strict';var Sequelize=require(_0x10b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x10b1('0x1')]},'description':{'type':Sequelize[_0x10b1('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x10b1('0x2')},'apiKey':{'type':Sequelize[_0x10b1('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x10b1('0x3')},'serverUrl':{'type':Sequelize[_0x10b1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 7057b8e..1b66875 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 _0x74ce=['Descriptions','getDescriptions','Subjects','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','subject','agent','description','status','priority','group','source','company','remove','includes','default','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','jsforce','desk.js','to-csv','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','json','count','limit','Content-Range','reject','save','update','end','stack','name','send','index','FreshdeskAccount','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','include','find','create','body','params','FreshdeskConfiguration','order','getConfigurations','findOne','getSubjects','channel'];(function(_0x3c356e,_0x4938f2){var _0x23876b=function(_0x183faa){while(--_0x183faa){_0x3c356e['push'](_0x3c356e['shift']());}};_0x23876b(++_0x4938f2);}(_0x74ce,0x18e));var _0xe74c=function(_0x5460bd,_0x458555){_0x5460bd=_0x5460bd-0x0;var _0x234804=_0x74ce[_0x5460bd];return _0x234804;};'use strict';var pdf=require(_0xe74c('0x0'));var emlformat=require(_0xe74c('0x1'));var rimraf=require(_0xe74c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe74c('0x3'));var moment=require(_0xe74c('0x4'));var BPromise=require(_0xe74c('0x5'));var Mustache=require(_0xe74c('0x6'));var util=require(_0xe74c('0x7'));var path=require('path');var sox=require(_0xe74c('0x8'));var csv=require('to-csv');var ejs=require(_0xe74c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe74c('0xa'));var crypto=require('crypto');var jsforce=require(_0xe74c('0xb'));var deskjs=require(_0xe74c('0xc'));var toCsv=require(_0xe74c('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xe74c('0xe'));var Redis=require(_0xe74c('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xe74c('0x10'))(_0xe74c('0x11'));var utils=require(_0xe74c('0x12'));var config=require(_0xe74c('0x13'));var db=require(_0xe74c('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client'][_0xe74c('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x1d58ac,_0x18500f,_0x124892,_0x274676){return new BPromise(function(_0x1abe75,_0x2950ea){var _0x4b2ceb=_0x274676||client;return _0x4b2ceb[_0xe74c('0x16')](_0x1d58ac,_0x124892)[_0xe74c('0x17')](function(_0x2fc62b){logger[_0xe74c('0x18')](_0xe74c('0x19'),_0x18500f,_0xe74c('0x1a'));logger[_0xe74c('0x1b')](_0xe74c('0x1c'),_0x18500f,_0xe74c('0x1a'),JSON[_0xe74c('0x1d')](_0x2fc62b));if(_0x2fc62b[_0xe74c('0x1e')]){if(_0x2fc62b[_0xe74c('0x1e')][_0xe74c('0x1f')]===0x1f4){logger[_0xe74c('0x1e')]('FreshdeskAccount,\x20%s,\x20%s',_0x18500f,_0x2fc62b[_0xe74c('0x1e')][_0xe74c('0x20')]);return _0x2950ea(_0x2fc62b['error'][_0xe74c('0x20')]);}logger[_0xe74c('0x1e')](_0xe74c('0x19'),_0x18500f,_0x2fc62b['error'][_0xe74c('0x20')]);return _0x1abe75(_0x2fc62b[_0xe74c('0x1e')][_0xe74c('0x20')]);}else{logger[_0xe74c('0x18')](_0xe74c('0x19'),_0x18500f,_0xe74c('0x1a'));_0x1abe75(_0x2fc62b[_0xe74c('0x21')][_0xe74c('0x20')]);}})[_0xe74c('0x22')](function(_0x9881bb){logger[_0xe74c('0x1e')](_0xe74c('0x19'),_0x18500f,_0x9881bb);_0x2950ea(_0x9881bb);});});}function respondWithStatusCode(_0x4597cf,_0x23fb24){_0x23fb24=_0x23fb24||0xcc;return function(_0x3e4ba6){if(_0x3e4ba6){return _0x4597cf[_0xe74c('0x23')](_0x23fb24);}return _0x4597cf['status'](_0x23fb24)['end']();};}function respondWithResult(_0x1ba2a7,_0x573d8c){_0x573d8c=_0x573d8c||0xc8;return function(_0x447559){if(_0x447559){return _0x1ba2a7['status'](_0x573d8c)[_0xe74c('0x24')](_0x447559);}};}function respondWithFilteredResult(_0x549270,_0x2990cd){return function(_0x99feac){if(_0x99feac){var _0x5ec44f=_0x99feac[_0xe74c('0x25')],_0x4d62fb=_0x2990cd['offset'],_0x5beac8=_0x2990cd['offset']+_0x2990cd[_0xe74c('0x26')],_0x2ddf25;if(_0x5beac8>=_0x5ec44f){_0x5beac8=_0x5ec44f;_0x2ddf25=0xc8;}else{_0x2ddf25=0xce;}_0x549270['status'](_0x2ddf25);return _0x549270['set'](_0xe74c('0x27'),_0x4d62fb+'-'+_0x5beac8+'/'+_0x5ec44f)['json'](_0x99feac);}return null;};}function patchUpdates(_0x2fe40b){return function(_0x274012){try{jsonpatch['apply'](_0x274012,_0x2fe40b,!![]);}catch(_0x33dea1){return BPromise[_0xe74c('0x28')](_0x33dea1);}return _0x274012[_0xe74c('0x29')]();};}function saveUpdates(_0x1ff71f,_0x2b0831){return function(_0x41ff4e){if(_0x41ff4e){return _0x41ff4e[_0xe74c('0x2a')](_0x1ff71f)['then'](function(_0x5f4461){return _0x5f4461;});}return null;};}function removeEntity(_0x5f218b,_0x499db9){return function(_0x5584aa){if(_0x5584aa){return _0x5584aa['destroy']()[_0xe74c('0x17')](function(){_0x5f218b['status'](0xcc)[_0xe74c('0x2b')]();});}};}function handleEntityNotFound(_0x35d098,_0x1e133b){return function(_0x5790fb){if(!_0x5790fb){_0x35d098['sendStatus'](0x194);}return _0x5790fb;};}function handleError(_0x1e8331,_0x215852){_0x215852=_0x215852||0x1f4;return function(_0x4794c1){logger['error'](_0x4794c1[_0xe74c('0x2c')]);if(_0x4794c1[_0xe74c('0x2d')]){delete _0x4794c1[_0xe74c('0x2d')];}_0x1e8331['status'](_0x215852)[_0xe74c('0x2e')](_0x4794c1);};}exports[_0xe74c('0x2f')]=function(_0x3a9dbe,_0x347b46){var _0x528508={},_0x47204e={},_0x39f6fb={'count':0x0,'rows':[]};var _0x23958c=db[_0xe74c('0x30')][_0xe74c('0x31')];_0x47204e['model']=_['keys'](_0x23958c);_0x47204e[_0xe74c('0x32')]=_[_0xe74c('0x33')](_0x3a9dbe['query']);_0x47204e[_0xe74c('0x34')]=_['intersection'](_0x47204e[_0xe74c('0x35')],_0x47204e[_0xe74c('0x32')]);_0x528508[_0xe74c('0x36')]=_[_0xe74c('0x37')](_0x47204e[_0xe74c('0x35')],qs['fields'](_0x3a9dbe[_0xe74c('0x32')][_0xe74c('0x38')]));_0x528508[_0xe74c('0x36')]=_0x528508[_0xe74c('0x36')][_0xe74c('0x39')]?_0x528508[_0xe74c('0x36')]:_0x47204e['model'];if(!_0x3a9dbe[_0xe74c('0x32')][_0xe74c('0x3a')](_0xe74c('0x3b'))){_0x528508['limit']=qs[_0xe74c('0x26')](_0x3a9dbe[_0xe74c('0x32')][_0xe74c('0x26')]);_0x528508[_0xe74c('0x3c')]=qs[_0xe74c('0x3c')](_0x3a9dbe[_0xe74c('0x32')][_0xe74c('0x3c')]);}_0x528508['order']=qs['sort'](_0x3a9dbe[_0xe74c('0x32')][_0xe74c('0x3d')]);_0x528508[_0xe74c('0x3e')]=qs['filters'](_['pick'](_0x3a9dbe[_0xe74c('0x32')],_0x47204e['filters']));if(_0x3a9dbe[_0xe74c('0x32')][_0xe74c('0x3f')]){_0x528508['where']=_[_0xe74c('0x40')](_0x528508[_0xe74c('0x3e')],{'$or':_[_0xe74c('0x41')](_0x23958c,function(_0x3eeca6){if(_0x3eeca6[_0xe74c('0x42')][_0xe74c('0x43')]!==_0xe74c('0x44')){var _0x4404c7={};_0x4404c7[_0x3eeca6[_0xe74c('0x45')]]={'$like':'%'+_0x3a9dbe[_0xe74c('0x32')][_0xe74c('0x3f')]+'%'};return _0x4404c7;}})});}_0x528508=_[_0xe74c('0x40')]({},_0x528508,_0x3a9dbe[_0xe74c('0x46')]);var _0x43b5bf={'where':_0x528508[_0xe74c('0x3e')]};return db[_0xe74c('0x30')][_0xe74c('0x25')](_0x43b5bf)[_0xe74c('0x17')](function(_0x20f6b7){_0x39f6fb[_0xe74c('0x25')]=_0x20f6b7;if(_0x3a9dbe[_0xe74c('0x32')][_0xe74c('0x47')]){_0x528508['include']=[{'all':!![]}];}return db[_0xe74c('0x30')][_0xe74c('0x48')](_0x528508);})[_0xe74c('0x17')](function(_0x5e66ea){_0x39f6fb[_0xe74c('0x49')]=_0x5e66ea;return _0x39f6fb;})[_0xe74c('0x17')](respondWithFilteredResult(_0x347b46,_0x528508))['catch'](handleError(_0x347b46,null));};exports[_0xe74c('0x4a')]=function(_0x34da04,_0x2516f2){var _0x2e4f46={'raw':![],'where':{'id':_0x34da04['params']['id']}},_0x1d39a2={};_0x1d39a2[_0xe74c('0x35')]=_[_0xe74c('0x33')](db[_0xe74c('0x30')]['rawAttributes']);_0x1d39a2[_0xe74c('0x32')]=_['keys'](_0x34da04[_0xe74c('0x32')]);_0x1d39a2['filters']=_[_0xe74c('0x37')](_0x1d39a2[_0xe74c('0x35')],_0x1d39a2[_0xe74c('0x32')]);_0x2e4f46[_0xe74c('0x36')]=_[_0xe74c('0x37')](_0x1d39a2['model'],qs[_0xe74c('0x38')](_0x34da04[_0xe74c('0x32')][_0xe74c('0x38')]));_0x2e4f46['attributes']=_0x2e4f46[_0xe74c('0x36')][_0xe74c('0x39')]?_0x2e4f46[_0xe74c('0x36')]:_0x1d39a2[_0xe74c('0x35')];if(_0x34da04[_0xe74c('0x32')]['includeAll']){_0x2e4f46[_0xe74c('0x4b')]=[{'all':!![]}];}_0x2e4f46=_[_0xe74c('0x40')]({},_0x2e4f46,_0x34da04[_0xe74c('0x46')]);return db['FreshdeskAccount'][_0xe74c('0x4c')](_0x2e4f46)[_0xe74c('0x17')](handleEntityNotFound(_0x2516f2,null))[_0xe74c('0x17')](respondWithResult(_0x2516f2,null))['catch'](handleError(_0x2516f2,null));};exports[_0xe74c('0x4d')]=function(_0x39482b,_0x128542){return db[_0xe74c('0x30')][_0xe74c('0x4d')](_0x39482b['body'],{})[_0xe74c('0x17')](respondWithResult(_0x128542,0xc9))[_0xe74c('0x22')](handleError(_0x128542,null));};exports['update']=function(_0x3e1c3e,_0xb3ab3){if(_0x3e1c3e[_0xe74c('0x4e')]['id']){delete _0x3e1c3e[_0xe74c('0x4e')]['id'];}return db[_0xe74c('0x30')][_0xe74c('0x4c')]({'where':{'id':_0x3e1c3e['params']['id']}})[_0xe74c('0x17')](handleEntityNotFound(_0xb3ab3,null))[_0xe74c('0x17')](saveUpdates(_0x3e1c3e[_0xe74c('0x4e')],null))['then'](respondWithResult(_0xb3ab3,null))['catch'](handleError(_0xb3ab3,null));};exports['destroy']=function(_0x913489,_0xedbac6){return db[_0xe74c('0x30')][_0xe74c('0x4c')]({'where':{'id':_0x913489[_0xe74c('0x4f')]['id']}})[_0xe74c('0x17')](handleEntityNotFound(_0xedbac6,null))[_0xe74c('0x17')](removeEntity(_0xedbac6,null))['catch'](handleError(_0xedbac6,null));};exports['getConfigurations']=function(_0x35115d,_0x2c0f4f,_0x410092){var _0x74ce35={};var _0x53af3e={};var _0x37d32b;var _0x5994c0;return db[_0xe74c('0x30')]['findOne']({'where':{'id':_0x35115d[_0xe74c('0x4f')]['id']}})[_0xe74c('0x17')](handleEntityNotFound(_0x2c0f4f,null))[_0xe74c('0x17')](function(_0x4ef70f){if(_0x4ef70f){_0x37d32b=_0x4ef70f;_0x53af3e[_0xe74c('0x35')]=_['keys'](db[_0xe74c('0x50')][_0xe74c('0x31')]);_0x53af3e['query']=_[_0xe74c('0x33')](_0x35115d[_0xe74c('0x32')]);_0x53af3e[_0xe74c('0x34')]=_['intersection'](_0x53af3e['model'],_0x53af3e['query']);_0x74ce35['attributes']=_[_0xe74c('0x37')](_0x53af3e[_0xe74c('0x35')],qs[_0xe74c('0x38')](_0x35115d[_0xe74c('0x32')]['fields']));_0x74ce35[_0xe74c('0x36')]=_0x74ce35[_0xe74c('0x36')][_0xe74c('0x39')]?_0x74ce35[_0xe74c('0x36')]:_0x53af3e['model'];_0x74ce35[_0xe74c('0x51')]=qs['sort'](_0x35115d[_0xe74c('0x32')][_0xe74c('0x3d')]);_0x74ce35['where']=qs['filters'](_['pick'](_0x35115d[_0xe74c('0x32')],_0x53af3e[_0xe74c('0x34')]));if(_0x35115d[_0xe74c('0x32')]['filter']){_0x74ce35[_0xe74c('0x3e')]=_['merge'](_0x74ce35[_0xe74c('0x3e')],{'$or':_[_0xe74c('0x41')](_0x74ce35[_0xe74c('0x36')],function(_0xb64b79){var _0x2517ae={};_0x2517ae[_0xb64b79]={'$like':'%'+_0x35115d[_0xe74c('0x32')][_0xe74c('0x3f')]+'%'};return _0x2517ae;})});}_0x74ce35=_['merge']({},_0x74ce35,_0x35115d['options']);return _0x37d32b[_0xe74c('0x52')](_0x74ce35);}})['then'](function(_0x3d1f7d){if(_0x3d1f7d){_0x5994c0=_0x3d1f7d[_0xe74c('0x39')];if(!_0x35115d[_0xe74c('0x32')]['hasOwnProperty'](_0xe74c('0x3b'))){_0x74ce35[_0xe74c('0x26')]=qs[_0xe74c('0x26')](_0x35115d[_0xe74c('0x32')][_0xe74c('0x26')]);_0x74ce35[_0xe74c('0x3c')]=qs['offset'](_0x35115d[_0xe74c('0x32')][_0xe74c('0x3c')]);}return _0x37d32b['getConfigurations'](_0x74ce35);}})[_0xe74c('0x17')](function(_0x2118a7){if(_0x2118a7){return _0x2118a7?{'count':_0x5994c0,'rows':_0x2118a7}:null;}})[_0xe74c('0x17')](respondWithResult(_0x2c0f4f,null))[_0xe74c('0x22')](handleError(_0x2c0f4f,null));};exports['addConfiguration']=function(_0x5218cd,_0x1ffda,_0x2aa246){if(_0x5218cd[_0xe74c('0x4e')]['id']){delete _0x5218cd[_0xe74c('0x4e')]['id'];}return db['FreshdeskAccount'][_0xe74c('0x53')]({'where':{'id':_0x5218cd[_0xe74c('0x4f')]['id']}})[_0xe74c('0x17')](handleEntityNotFound(_0x1ffda,null))[_0xe74c('0x17')](function(_0x3d5324){if(_0x3d5324){_0x5218cd[_0xe74c('0x4e')]['AccountId']=_0x3d5324['id'];_0x5218cd['body']['Subjects']=integrations[_0xe74c('0x54')](_0x5218cd[_0xe74c('0x4e')][_0xe74c('0x55')],_0x5218cd[_0xe74c('0x4e')][_0xe74c('0x42')]);_0x5218cd[_0xe74c('0x4e')][_0xe74c('0x56')]=integrations[_0xe74c('0x57')](_0x5218cd[_0xe74c('0x4e')][_0xe74c('0x55')],_0x5218cd['body']['type']);return db['FreshdeskConfiguration'][_0xe74c('0x4d')](_0x5218cd[_0xe74c('0x4e')],{'include':[{'model':db['FreshdeskField'],'as':_0xe74c('0x58')},{'model':db[_0xe74c('0x59')],'as':_0xe74c('0x56')}]});}return null;})[_0xe74c('0x17')](respondWithResult(_0x1ffda,null))[_0xe74c('0x22')](handleError(_0x1ffda,null));};exports[_0xe74c('0x5a')]=function(_0x50f382,_0x4b4695,_0x3af93d){var _0x3bed98='';return db[_0xe74c('0x30')][_0xe74c('0x53')]({'where':{'id':_0x50f382[_0xe74c('0x4f')]['id']},'attributes':['id',_0xe74c('0x5b'),_0xe74c('0x5c')]})[_0xe74c('0x17')](handleEntityNotFound(_0x4b4695,null))[_0xe74c('0x17')](function(_0x2e96b3){if(_0x2e96b3){_0x3bed98=_0x2e96b3[_0xe74c('0x5b')];var _0x44286b=_0x3bed98[_0xe74c('0x5d')](-0x1);if(_0x44286b==='/'){_0x3bed98=_0x3bed98['substring'](0x0,_0x3bed98[_0xe74c('0x5e')](_0x44286b));}return rp({'method':_0xe74c('0x5f'),'uri':util[_0xe74c('0x60')](_0xe74c('0x61'),_0x3bed98,_0xe74c('0x62')),'headers':{'Authorization':util[_0xe74c('0x60')](_0xe74c('0x63'),new Buffer(util[_0xe74c('0x60')](_0xe74c('0x64'),_0x2e96b3[_0xe74c('0x5c')]))[_0xe74c('0x65')](_0xe74c('0x66')))},'json':!![]});}})[_0xe74c('0x17')](function(_0x378f97){if(_0x378f97){var _0x1e6808=['requester',_0xe74c('0x67'),_0xe74c('0x68'),_0xe74c('0x69'),_0xe74c('0x6a'),_0xe74c('0x6b'),_0xe74c('0x6c'),_0xe74c('0x6d'),'ticket_type',_0xe74c('0x6c'),_0xe74c('0x6e')];_[_0xe74c('0x6f')](_0x378f97,function(_0x241fd2){return _0x1e6808[_0xe74c('0x70')](_0x241fd2[_0xe74c('0x2d')])||!_0x241fd2[_0xe74c('0x71')]&&_0x241fd2[_0xe74c('0x42')]!=='custom_text';});return{'count':_0x378f97[_0xe74c('0x39')],'rows':_[_0xe74c('0x41')](_0x378f97,function(_0x403dba){return{'id':_0x403dba[_0xe74c('0x2d')],'name':_0x403dba[_0xe74c('0x72')],'custom':!_0x403dba[_0xe74c('0x71')],'options':_0x403dba[_0xe74c('0x73')]?_[_0xe74c('0x41')](_0x403dba[_0xe74c('0x73')],function(_0x218d15){return{'name':_[_0xe74c('0x74')](_0x218d15),'value':_0x218d15};}):[]};})};}})[_0xe74c('0x17')](respondWithResult(_0x4b4695,null))[_0xe74c('0x22')](function(_0x436653){var _0x3bd5d8=_0x50f382[_0xe74c('0x32')][_0xe74c('0x75')]?0x1f4:_0x436653[_0xe74c('0x76')]||0x1f4;logger['error'](_0xe74c('0x77'),'getFields',_0x3bd5d8,JSON[_0xe74c('0x1d')](_0x436653));delete _0x436653[_0xe74c('0x2d')];if(_0x3bd5d8===0x191){_0x3bd5d8=0x190;}_0x4b4695['status'](_0x3bd5d8)['send'](_0x50f382[_0xe74c('0x32')][_0xe74c('0x75')]?{'message':_0xe74c('0x78'),'statusCode':_0x436653['statusCode']}:_0x436653);});}; \ No newline at end of file +var _0xfab1=['to-csv','ejs','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','apply','save','update','destroy','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','key','field','options','FreshdeskAccount','include','findAll','show','create','body','find','params','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','toString','requester','agent','description','priority','company','remove','includes','custom_text','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3ea77f,_0x35053d){var _0x48f9cb=function(_0x5c82fa){while(--_0x5c82fa){_0x3ea77f['push'](_0x3ea77f['shift']());}};_0x48f9cb(++_0x35053d);}(_0xfab1,0xe5));var _0x1fab=function(_0x37c219,_0x16d29c){_0x37c219=_0x37c219-0x0;var _0x52b594=_0xfab1[_0x37c219];return _0x52b594;};'use strict';var pdf=require(_0x1fab('0x0'));var emlformat=require(_0x1fab('0x1'));var rimraf=require(_0x1fab('0x2'));var zipdir=require(_0x1fab('0x3'));var jsonpatch=require(_0x1fab('0x4'));var rp=require(_0x1fab('0x5'));var moment=require('moment');var BPromise=require(_0x1fab('0x6'));var Mustache=require(_0x1fab('0x7'));var util=require(_0x1fab('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x1fab('0x9'));var ejs=require(_0x1fab('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1fab('0xb'));var jsforce=require(_0x1fab('0xc'));var deskjs=require(_0x1fab('0xd'));var toCsv=require(_0x1fab('0x9'));var querystring=require(_0x1fab('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x1fab('0xf'));var Redis=require('ioredis');var qs=require(_0x1fab('0x10'));var logger=require(_0x1fab('0x11'))(_0x1fab('0x12'));var utils=require(_0x1fab('0x13'));var config=require(_0x1fab('0x14'));var db=require(_0x1fab('0x15'))['db'];var integrations=require(_0x1fab('0x16'));var jayson=require(_0x1fab('0x17'));var client=jayson[_0x1fab('0x18')][_0x1fab('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x415145,_0x15bc04,_0x57063a,_0x334297){return new BPromise(function(_0x4336a9,_0x14c5cb){var _0x803e2=_0x334297||client;return _0x803e2[_0x1fab('0x1a')](_0x415145,_0x57063a)[_0x1fab('0x1b')](function(_0x1cfe06){logger[_0x1fab('0x1c')](_0x1fab('0x1d'),_0x15bc04,'request\x20sent');logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x15bc04,_0x1fab('0x1e'),JSON[_0x1fab('0x1f')](_0x1cfe06));if(_0x1cfe06[_0x1fab('0x20')]){if(_0x1cfe06[_0x1fab('0x20')][_0x1fab('0x21')]===0x1f4){logger[_0x1fab('0x20')](_0x1fab('0x1d'),_0x15bc04,_0x1cfe06['error'][_0x1fab('0x22')]);return _0x14c5cb(_0x1cfe06[_0x1fab('0x20')][_0x1fab('0x22')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x15bc04,_0x1cfe06[_0x1fab('0x20')][_0x1fab('0x22')]);return _0x4336a9(_0x1cfe06['error']['message']);}else{logger[_0x1fab('0x1c')](_0x1fab('0x1d'),_0x15bc04,_0x1fab('0x1e'));_0x4336a9(_0x1cfe06[_0x1fab('0x23')][_0x1fab('0x22')]);}})[_0x1fab('0x24')](function(_0x219e16){logger['error'](_0x1fab('0x1d'),_0x15bc04,_0x219e16);_0x14c5cb(_0x219e16);});});}function respondWithStatusCode(_0x1eb3f5,_0x1715c5){_0x1715c5=_0x1715c5||0xcc;return function(_0x1535ac){if(_0x1535ac){return _0x1eb3f5[_0x1fab('0x25')](_0x1715c5);}return _0x1eb3f5['status'](_0x1715c5)[_0x1fab('0x26')]();};}function respondWithResult(_0xa9ddf1,_0x4b6557){_0x4b6557=_0x4b6557||0xc8;return function(_0x485122){if(_0x485122){return _0xa9ddf1[_0x1fab('0x27')](_0x4b6557)[_0x1fab('0x28')](_0x485122);}};}function respondWithFilteredResult(_0x1e147c,_0x1e3154){return function(_0x3930c0){if(_0x3930c0){var _0x316942=_0x3930c0[_0x1fab('0x29')],_0x5a7ce4=_0x1e3154['offset'],_0x55e07c=_0x1e3154[_0x1fab('0x2a')]+_0x1e3154[_0x1fab('0x2b')],_0x21c134;if(_0x55e07c>=_0x316942){_0x55e07c=_0x316942;_0x21c134=0xc8;}else{_0x21c134=0xce;}_0x1e147c[_0x1fab('0x27')](_0x21c134);return _0x1e147c['set']('Content-Range',_0x5a7ce4+'-'+_0x55e07c+'/'+_0x316942)[_0x1fab('0x28')](_0x3930c0);}return null;};}function patchUpdates(_0x26493d){return function(_0x31b1c0){try{jsonpatch[_0x1fab('0x2c')](_0x31b1c0,_0x26493d,!![]);}catch(_0x1f7016){return BPromise['reject'](_0x1f7016);}return _0x31b1c0[_0x1fab('0x2d')]();};}function saveUpdates(_0x59a0bf,_0x33a781){return function(_0x4bf6a7){if(_0x4bf6a7){return _0x4bf6a7[_0x1fab('0x2e')](_0x59a0bf)[_0x1fab('0x1b')](function(_0x477638){return _0x477638;});}return null;};}function removeEntity(_0x284ef9,_0x594a8d){return function(_0x177a41){if(_0x177a41){return _0x177a41[_0x1fab('0x2f')]()['then'](function(){_0x284ef9['status'](0xcc)[_0x1fab('0x26')]();});}};}function handleEntityNotFound(_0x36a4ea,_0x3b6ef6){return function(_0x2a6ab3){if(!_0x2a6ab3){_0x36a4ea[_0x1fab('0x25')](0x194);}return _0x2a6ab3;};}function handleError(_0x1c31f0,_0x39630b){_0x39630b=_0x39630b||0x1f4;return function(_0x5df110){logger['error'](_0x5df110[_0x1fab('0x30')]);if(_0x5df110[_0x1fab('0x31')]){delete _0x5df110[_0x1fab('0x31')];}_0x1c31f0[_0x1fab('0x27')](_0x39630b)[_0x1fab('0x32')](_0x5df110);};}exports[_0x1fab('0x33')]=function(_0xf2de60,_0x5623ae){var _0x5f5cb5={},_0x517f5b={},_0x1f1e7c={'count':0x0,'rows':[]};var _0x18ec7e=db['FreshdeskAccount'][_0x1fab('0x34')];_0x517f5b['model']=_[_0x1fab('0x35')](_0x18ec7e);_0x517f5b[_0x1fab('0x36')]=_[_0x1fab('0x35')](_0xf2de60['query']);_0x517f5b[_0x1fab('0x37')]=_[_0x1fab('0x38')](_0x517f5b[_0x1fab('0x39')],_0x517f5b[_0x1fab('0x36')]);_0x5f5cb5[_0x1fab('0x3a')]=_[_0x1fab('0x38')](_0x517f5b[_0x1fab('0x39')],qs[_0x1fab('0x3b')](_0xf2de60[_0x1fab('0x36')][_0x1fab('0x3b')]));_0x5f5cb5['attributes']=_0x5f5cb5[_0x1fab('0x3a')][_0x1fab('0x3c')]?_0x5f5cb5[_0x1fab('0x3a')]:_0x517f5b['model'];if(!_0xf2de60[_0x1fab('0x36')][_0x1fab('0x3d')]('nolimit')){_0x5f5cb5[_0x1fab('0x2b')]=qs[_0x1fab('0x2b')](_0xf2de60[_0x1fab('0x36')][_0x1fab('0x2b')]);_0x5f5cb5['offset']=qs[_0x1fab('0x2a')](_0xf2de60['query'][_0x1fab('0x2a')]);}_0x5f5cb5[_0x1fab('0x3e')]=qs[_0x1fab('0x3f')](_0xf2de60[_0x1fab('0x36')][_0x1fab('0x3f')]);_0x5f5cb5['where']=qs[_0x1fab('0x37')](_[_0x1fab('0x40')](_0xf2de60[_0x1fab('0x36')],_0x517f5b[_0x1fab('0x37')]));if(_0xf2de60['query'][_0x1fab('0x41')]){_0x5f5cb5[_0x1fab('0x42')]=_[_0x1fab('0x43')](_0x5f5cb5[_0x1fab('0x42')],{'$or':_[_0x1fab('0x44')](_0x18ec7e,function(_0x130db1){if(_0x130db1[_0x1fab('0x45')][_0x1fab('0x46')]!=='VIRTUAL'){var _0x5b9464={};_0x5b9464[_0x130db1[_0x1fab('0x47')]]={'$like':'%'+_0xf2de60[_0x1fab('0x36')]['filter']+'%'};return _0x5b9464;}})});}_0x5f5cb5=_[_0x1fab('0x43')]({},_0x5f5cb5,_0xf2de60[_0x1fab('0x48')]);var _0x5f5956={'where':_0x5f5cb5[_0x1fab('0x42')]};return db[_0x1fab('0x49')][_0x1fab('0x29')](_0x5f5956)[_0x1fab('0x1b')](function(_0x4df35b){_0x1f1e7c[_0x1fab('0x29')]=_0x4df35b;if(_0xf2de60[_0x1fab('0x36')]['includeAll']){_0x5f5cb5[_0x1fab('0x4a')]=[{'all':!![]}];}return db[_0x1fab('0x49')][_0x1fab('0x4b')](_0x5f5cb5);})['then'](function(_0x2b43df){_0x1f1e7c['rows']=_0x2b43df;return _0x1f1e7c;})['then'](respondWithFilteredResult(_0x5623ae,_0x5f5cb5))[_0x1fab('0x24')](handleError(_0x5623ae,null));};exports[_0x1fab('0x4c')]=function(_0x35bd90,_0x2def32){var _0x320fb1={'raw':![],'where':{'id':_0x35bd90['params']['id']}},_0x71318={};_0x71318['model']=_[_0x1fab('0x35')](db[_0x1fab('0x49')]['rawAttributes']);_0x71318['query']=_[_0x1fab('0x35')](_0x35bd90[_0x1fab('0x36')]);_0x71318[_0x1fab('0x37')]=_[_0x1fab('0x38')](_0x71318[_0x1fab('0x39')],_0x71318[_0x1fab('0x36')]);_0x320fb1[_0x1fab('0x3a')]=_['intersection'](_0x71318['model'],qs[_0x1fab('0x3b')](_0x35bd90[_0x1fab('0x36')][_0x1fab('0x3b')]));_0x320fb1[_0x1fab('0x3a')]=_0x320fb1[_0x1fab('0x3a')][_0x1fab('0x3c')]?_0x320fb1[_0x1fab('0x3a')]:_0x71318[_0x1fab('0x39')];if(_0x35bd90[_0x1fab('0x36')]['includeAll']){_0x320fb1[_0x1fab('0x4a')]=[{'all':!![]}];}_0x320fb1=_[_0x1fab('0x43')]({},_0x320fb1,_0x35bd90[_0x1fab('0x48')]);return db['FreshdeskAccount']['find'](_0x320fb1)['then'](handleEntityNotFound(_0x2def32,null))[_0x1fab('0x1b')](respondWithResult(_0x2def32,null))[_0x1fab('0x24')](handleError(_0x2def32,null));};exports[_0x1fab('0x4d')]=function(_0x3b9a6a,_0x4a4ade){return db[_0x1fab('0x49')][_0x1fab('0x4d')](_0x3b9a6a[_0x1fab('0x4e')],{})[_0x1fab('0x1b')](respondWithResult(_0x4a4ade,0xc9))[_0x1fab('0x24')](handleError(_0x4a4ade,null));};exports[_0x1fab('0x2e')]=function(_0x446100,_0x14d864){if(_0x446100[_0x1fab('0x4e')]['id']){delete _0x446100['body']['id'];}return db[_0x1fab('0x49')][_0x1fab('0x4f')]({'where':{'id':_0x446100[_0x1fab('0x50')]['id']}})[_0x1fab('0x1b')](handleEntityNotFound(_0x14d864,null))[_0x1fab('0x1b')](saveUpdates(_0x446100['body'],null))[_0x1fab('0x1b')](respondWithResult(_0x14d864,null))[_0x1fab('0x24')](handleError(_0x14d864,null));};exports[_0x1fab('0x2f')]=function(_0x14ea1d,_0x596d4a){return db[_0x1fab('0x49')][_0x1fab('0x4f')]({'where':{'id':_0x14ea1d[_0x1fab('0x50')]['id']}})[_0x1fab('0x1b')](handleEntityNotFound(_0x596d4a,null))['then'](removeEntity(_0x596d4a,null))[_0x1fab('0x24')](handleError(_0x596d4a,null));};exports[_0x1fab('0x51')]=function(_0x2b09f6,_0x427836,_0x98a146){var _0x71960e={};var _0xc80104={};var _0x19fe6a;var _0x21ca66;return db[_0x1fab('0x49')][_0x1fab('0x52')]({'where':{'id':_0x2b09f6['params']['id']}})[_0x1fab('0x1b')](handleEntityNotFound(_0x427836,null))[_0x1fab('0x1b')](function(_0x3ba8cd){if(_0x3ba8cd){_0x19fe6a=_0x3ba8cd;_0xc80104[_0x1fab('0x39')]=_[_0x1fab('0x35')](db['FreshdeskConfiguration'][_0x1fab('0x34')]);_0xc80104[_0x1fab('0x36')]=_['keys'](_0x2b09f6[_0x1fab('0x36')]);_0xc80104[_0x1fab('0x37')]=_[_0x1fab('0x38')](_0xc80104[_0x1fab('0x39')],_0xc80104['query']);_0x71960e[_0x1fab('0x3a')]=_[_0x1fab('0x38')](_0xc80104[_0x1fab('0x39')],qs[_0x1fab('0x3b')](_0x2b09f6[_0x1fab('0x36')][_0x1fab('0x3b')]));_0x71960e[_0x1fab('0x3a')]=_0x71960e[_0x1fab('0x3a')][_0x1fab('0x3c')]?_0x71960e['attributes']:_0xc80104[_0x1fab('0x39')];_0x71960e[_0x1fab('0x3e')]=qs['sort'](_0x2b09f6[_0x1fab('0x36')]['sort']);_0x71960e[_0x1fab('0x42')]=qs['filters'](_[_0x1fab('0x40')](_0x2b09f6['query'],_0xc80104['filters']));if(_0x2b09f6[_0x1fab('0x36')]['filter']){_0x71960e[_0x1fab('0x42')]=_[_0x1fab('0x43')](_0x71960e[_0x1fab('0x42')],{'$or':_[_0x1fab('0x44')](_0x71960e[_0x1fab('0x3a')],function(_0x6150ba){var _0x280098={};_0x280098[_0x6150ba]={'$like':'%'+_0x2b09f6[_0x1fab('0x36')][_0x1fab('0x41')]+'%'};return _0x280098;})});}_0x71960e=_[_0x1fab('0x43')]({},_0x71960e,_0x2b09f6[_0x1fab('0x48')]);return _0x19fe6a['getConfigurations'](_0x71960e);}})[_0x1fab('0x1b')](function(_0x1abfc1){if(_0x1abfc1){_0x21ca66=_0x1abfc1[_0x1fab('0x3c')];if(!_0x2b09f6[_0x1fab('0x36')][_0x1fab('0x3d')](_0x1fab('0x53'))){_0x71960e['limit']=qs[_0x1fab('0x2b')](_0x2b09f6[_0x1fab('0x36')][_0x1fab('0x2b')]);_0x71960e[_0x1fab('0x2a')]=qs[_0x1fab('0x2a')](_0x2b09f6[_0x1fab('0x36')][_0x1fab('0x2a')]);}return _0x19fe6a[_0x1fab('0x51')](_0x71960e);}})[_0x1fab('0x1b')](function(_0x59b07e){if(_0x59b07e){return _0x59b07e?{'count':_0x21ca66,'rows':_0x59b07e}:null;}})[_0x1fab('0x1b')](respondWithResult(_0x427836,null))['catch'](handleError(_0x427836,null));};exports[_0x1fab('0x54')]=function(_0xea53fa,_0x1f46a6,_0x1f9408){if(_0xea53fa[_0x1fab('0x4e')]['id']){delete _0xea53fa['body']['id'];}return db[_0x1fab('0x49')][_0x1fab('0x52')]({'where':{'id':_0xea53fa[_0x1fab('0x50')]['id']}})[_0x1fab('0x1b')](handleEntityNotFound(_0x1f46a6,null))[_0x1fab('0x1b')](function(_0x379bb3){if(_0x379bb3){_0xea53fa[_0x1fab('0x4e')][_0x1fab('0x55')]=_0x379bb3['id'];_0xea53fa[_0x1fab('0x4e')][_0x1fab('0x56')]=integrations[_0x1fab('0x57')](_0xea53fa[_0x1fab('0x4e')][_0x1fab('0x58')],_0xea53fa[_0x1fab('0x4e')][_0x1fab('0x45')]);_0xea53fa[_0x1fab('0x4e')][_0x1fab('0x59')]=integrations['getDescriptions'](_0xea53fa[_0x1fab('0x4e')]['channel'],_0xea53fa['body'][_0x1fab('0x45')]);return db[_0x1fab('0x5a')][_0x1fab('0x4d')](_0xea53fa['body'],{'include':[{'model':db[_0x1fab('0x5b')],'as':_0x1fab('0x56')},{'model':db['FreshdeskField'],'as':_0x1fab('0x59')}]});}return null;})[_0x1fab('0x1b')](respondWithResult(_0x1f46a6,null))[_0x1fab('0x24')](handleError(_0x1f46a6,null));};exports['getFields']=function(_0x354a57,_0x2af695,_0x1b03f0){var _0x440ec5='';return db[_0x1fab('0x49')][_0x1fab('0x52')]({'where':{'id':_0x354a57[_0x1fab('0x50')]['id']},'attributes':['id',_0x1fab('0x5c'),'apiKey']})[_0x1fab('0x1b')](handleEntityNotFound(_0x2af695,null))['then'](function(_0x331e7b){if(_0x331e7b){_0x440ec5=_0x331e7b[_0x1fab('0x5c')];var _0x1e163c=_0x440ec5[_0x1fab('0x5d')](-0x1);if(_0x1e163c==='/'){_0x440ec5=_0x440ec5[_0x1fab('0x5e')](0x0,_0x440ec5[_0x1fab('0x5f')](_0x1e163c));}return rp({'method':_0x1fab('0x60'),'uri':util['format'](_0x1fab('0x61'),_0x440ec5,_0x1fab('0x62')),'headers':{'Authorization':util[_0x1fab('0x63')](_0x1fab('0x64'),new Buffer(util[_0x1fab('0x63')]('%s:X',_0x331e7b['apiKey']))[_0x1fab('0x65')]('base64'))},'json':!![]});}})[_0x1fab('0x1b')](function(_0x83bea8){if(_0x83bea8){var _0x2ae45f=[_0x1fab('0x66'),'subject',_0x1fab('0x67'),_0x1fab('0x68'),'status',_0x1fab('0x69'),'group','source','ticket_type','group',_0x1fab('0x6a')];_[_0x1fab('0x6b')](_0x83bea8,function(_0x23ca56){return _0x2ae45f[_0x1fab('0x6c')](_0x23ca56['name'])||!_0x23ca56['default']&&_0x23ca56[_0x1fab('0x45')]!==_0x1fab('0x6d');});return{'count':_0x83bea8[_0x1fab('0x3c')],'rows':_[_0x1fab('0x44')](_0x83bea8,function(_0x40a21e){return{'id':_0x40a21e[_0x1fab('0x31')],'name':_0x40a21e[_0x1fab('0x6e')],'custom':!_0x40a21e[_0x1fab('0x6f')],'options':_0x40a21e[_0x1fab('0x70')]?_[_0x1fab('0x44')](_0x40a21e[_0x1fab('0x70')],function(_0x3fb8b3){return{'name':_[_0x1fab('0x71')](_0x3fb8b3),'value':_0x3fb8b3};}):[]};})};}})[_0x1fab('0x1b')](respondWithResult(_0x2af695,null))[_0x1fab('0x24')](function(_0xaa39f){var _0x36014d=_0x354a57[_0x1fab('0x36')][_0x1fab('0x72')]?0x1f4:_0xaa39f[_0x1fab('0x73')]||0x1f4;logger['error'](_0x1fab('0x74'),_0x1fab('0x75'),_0x36014d,JSON[_0x1fab('0x1f')](_0xaa39f));delete _0xaa39f['name'];if(_0x36014d===0x191){_0x36014d=0x190;}_0x2af695[_0x1fab('0x27')](_0x36014d)[_0x1fab('0x32')](_0x354a57['query'][_0x1fab('0x72')]?{'message':_0x1fab('0x76'),'statusCode':_0xaa39f['statusCode']}:_0xaa39f);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index c47de3f..ae9fbc4 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 _0xe0af=['moment','bluebird','request-promise','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger'];(function(_0x216a01,_0x572ada){var _0xe308e9=function(_0x1e2b1f){while(--_0x1e2b1f){_0x216a01['push'](_0x216a01['shift']());}};_0xe308e9(++_0x572ada);}(_0xe0af,0x1c9));var _0xfe0a=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0xe0af[_0x3e0b8f];return _0x22f742;};'use strict';var _=require(_0xfe0a('0x0'));var util=require(_0xfe0a('0x1'));var logger=require(_0xfe0a('0x2'))('api');var moment=require(_0xfe0a('0x3'));var BPromise=require(_0xfe0a('0x4'));var rp=require(_0xfe0a('0x5'));var attributes=require(_0xfe0a('0x6'));var integrations=require(_0xfe0a('0x7'));module[_0xfe0a('0x8')]=function(_0x1b0d0f,_0x1ef91f){return _0x1b0d0f[_0xfe0a('0x9')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd54=['exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','request-promise','../../components/integrations/configuration'];(function(_0x527f33,_0x12b632){var _0x2bdabd=function(_0x410d55){while(--_0x410d55){_0x527f33['push'](_0x527f33['shift']());}};_0x2bdabd(++_0x12b632);}(_0xcd54,0xaf));var _0x4cd5=function(_0x2399a0,_0x4d0cf1){_0x2399a0=_0x2399a0-0x0;var _0x120940=_0xcd54[_0x2399a0];return _0x120940;};'use strict';var _=require(_0x4cd5('0x0'));var util=require(_0x4cd5('0x1'));var logger=require(_0x4cd5('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4cd5('0x3'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x4cd5('0x4'));module[_0x4cd5('0x5')]=function(_0x4b3e38,_0x598a69){return _0x4b3e38[_0x4cd5('0x6')](_0x4cd5('0x7'),attributes,{'tableName':_0x4cd5('0x8'),'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 50b2d11..e4054c0 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 _0xbeb6=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','catch','ShowFreshdeskAccount','find','then','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xbeb6,0x13f));var _0x6beb=function(_0x5c4038,_0x16f339){_0x5c4038=_0x5c4038-0x0;var _0x5c30d1=_0xbeb6[_0x5c4038];return _0x5c30d1;};'use strict';var _=require(_0x6beb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6beb('0x1'));var rs=require(_0x6beb('0x2'));var fs=require('fs');var Redis=require(_0x6beb('0x3'));var db=require(_0x6beb('0x4'))['db'];var utils=require(_0x6beb('0x5'));var logger=require('../../config/logger')(_0x6beb('0x6'));var config=require(_0x6beb('0x7'));var jayson=require(_0x6beb('0x8'));var client=jayson[_0x6beb('0x9')][_0x6beb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42bb46,_0x9589e5,_0x24f467){return new BPromise(function(_0x53e1d2,_0xdf7c59){return client[_0x6beb('0xb')](_0x42bb46,_0x24f467)['then'](function(_0x3cc324){logger[_0x6beb('0xc')](_0x6beb('0xd'),_0x9589e5,'request\x20sent');logger[_0x6beb('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x9589e5,'request\x20sent',JSON[_0x6beb('0xf')](_0x3cc324));if(_0x3cc324[_0x6beb('0x10')]){if(_0x3cc324['error'][_0x6beb('0x11')]===0x1f4){logger[_0x6beb('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x9589e5,_0x3cc324[_0x6beb('0x10')][_0x6beb('0x12')]);return _0xdf7c59(_0x3cc324['error'][_0x6beb('0x12')]);}logger['error'](_0x6beb('0xd'),_0x9589e5,_0x3cc324[_0x6beb('0x10')][_0x6beb('0x12')]);return _0x53e1d2(_0x3cc324[_0x6beb('0x10')]['message']);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x9589e5,_0x6beb('0x13'));_0x53e1d2(_0x3cc324[_0x6beb('0x14')][_0x6beb('0x12')]);}})['catch'](function(_0x3feffa){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x9589e5,_0x3feffa);_0xdf7c59(_0x3feffa);});});}exports[_0x6beb('0x15')]=function(_0x521368){var _0x2fa98d=this;return new Promise(function(_0x2bc228,_0x19ed82){return db[_0x6beb('0x16')][_0x6beb('0x17')]({'raw':_0x521368[_0x6beb('0x18')]?_0x521368[_0x6beb('0x18')][_0x6beb('0x19')]===undefined?!![]:![]:!![],'where':_0x521368[_0x6beb('0x18')]?_0x521368[_0x6beb('0x18')][_0x6beb('0x1a')]||null:null,'attributes':_0x521368[_0x6beb('0x18')]?_0x521368[_0x6beb('0x18')]['attributes']||null:null,'limit':_0x521368[_0x6beb('0x18')]?_0x521368[_0x6beb('0x18')][_0x6beb('0x1b')]||null:null,'include':_0x521368[_0x6beb('0x18')]?_0x521368[_0x6beb('0x18')][_0x6beb('0x1c')]?_[_0x6beb('0x1d')](_0x521368[_0x6beb('0x18')][_0x6beb('0x1c')],function(_0x6e6b86){return{'model':db[_0x6e6b86[_0x6beb('0x1e')]],'as':_0x6e6b86['as'],'attributes':_0x6e6b86[_0x6beb('0x1f')],'include':_0x6e6b86[_0x6beb('0x1c')]?_[_0x6beb('0x1d')](_0x6e6b86[_0x6beb('0x1c')],function(_0x1bc09c){return{'model':db[_0x1bc09c[_0x6beb('0x1e')]],'as':_0x1bc09c['as'],'attributes':_0x1bc09c[_0x6beb('0x1f')],'include':_0x1bc09c[_0x6beb('0x1c')]?_['map'](_0x1bc09c[_0x6beb('0x1c')],function(_0x2c23c8){return{'model':db[_0x2c23c8[_0x6beb('0x1e')]],'as':_0x2c23c8['as'],'attributes':_0x2c23c8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x26d143){logger[_0x6beb('0xc')]('GetFreshdeskAccount',_0x521368);logger[_0x6beb('0xe')]('GetFreshdeskAccount',_0x521368,JSON[_0x6beb('0xf')](_0x26d143));_0x2bc228(_0x26d143);})[_0x6beb('0x20')](function(_0x3b345f){logger['error']('GetFreshdeskAccount',_0x3b345f['message'],_0x521368);_0x19ed82(_0x2fa98d[_0x6beb('0x10')](0x1f4,_0x3b345f['message']));});});};exports[_0x6beb('0x21')]=function(_0x243d01){var _0x37dfa2=this;return new Promise(function(_0x1516cf,_0x51c973){return db['FreshdeskAccount'][_0x6beb('0x22')]({'raw':_0x243d01[_0x6beb('0x18')]?_0x243d01['options']['raw']===undefined?!![]:![]:!![],'where':_0x243d01['options']?_0x243d01[_0x6beb('0x18')][_0x6beb('0x1a')]||null:null,'attributes':_0x243d01[_0x6beb('0x18')]?_0x243d01[_0x6beb('0x18')][_0x6beb('0x1f')]||null:null,'include':_0x243d01[_0x6beb('0x18')]?_0x243d01[_0x6beb('0x18')][_0x6beb('0x1c')]?_[_0x6beb('0x1d')](_0x243d01[_0x6beb('0x18')][_0x6beb('0x1c')],function(_0x4ce42e){return{'model':db[_0x4ce42e[_0x6beb('0x1e')]],'as':_0x4ce42e['as'],'attributes':_0x4ce42e['attributes'],'include':_0x4ce42e[_0x6beb('0x1c')]?_[_0x6beb('0x1d')](_0x4ce42e[_0x6beb('0x1c')],function(_0xed61f5){return{'model':db[_0xed61f5['model']],'as':_0xed61f5['as'],'attributes':_0xed61f5[_0x6beb('0x1f')],'include':_0xed61f5[_0x6beb('0x1c')]?_[_0x6beb('0x1d')](_0xed61f5[_0x6beb('0x1c')],function(_0x2c8b97){return{'model':db[_0x2c8b97[_0x6beb('0x1e')]],'as':_0x2c8b97['as'],'attributes':_0x2c8b97[_0x6beb('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6beb('0x23')](function(_0x7760eb){logger[_0x6beb('0xc')]('ShowFreshdeskAccount',_0x243d01);logger['debug'](_0x6beb('0x21'),_0x243d01,JSON['stringify'](_0x7760eb));_0x1516cf(_0x7760eb);})[_0x6beb('0x20')](function(_0xe77cce){logger[_0x6beb('0x10')](_0x6beb('0x21'),_0xe77cce[_0x6beb('0x12')],_0x243d01);_0x51c973(_0x37dfa2['error'](0x1f4,_0xe77cce[_0x6beb('0x12')]));});});}; \ No newline at end of file +var _0xcdbc=['debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FreshdeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xcdbc,0xa5));var _0xccdb=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xcdbc[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xccdb('0x0'));var util=require(_0xccdb('0x1'));var moment=require('moment');var BPromise=require(_0xccdb('0x2'));var rs=require(_0xccdb('0x3'));var fs=require('fs');var Redis=require(_0xccdb('0x4'));var db=require(_0xccdb('0x5'))['db'];var utils=require(_0xccdb('0x6'));var logger=require(_0xccdb('0x7'))('rpc');var config=require(_0xccdb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xccdb('0x9')][_0xccdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x352c06,_0x39e39a,_0x5035c1){return new BPromise(function(_0x212dae,_0x39013e){return client[_0xccdb('0xb')](_0x352c06,_0x5035c1)['then'](function(_0x48a8fc){logger[_0xccdb('0xc')](_0xccdb('0xd'),_0x39e39a,_0xccdb('0xe'));logger[_0xccdb('0xf')](_0xccdb('0x10'),_0x39e39a,_0xccdb('0xe'),JSON[_0xccdb('0x11')](_0x48a8fc));if(_0x48a8fc[_0xccdb('0x12')]){if(_0x48a8fc[_0xccdb('0x12')][_0xccdb('0x13')]===0x1f4){logger['error'](_0xccdb('0xd'),_0x39e39a,_0x48a8fc[_0xccdb('0x12')][_0xccdb('0x14')]);return _0x39013e(_0x48a8fc[_0xccdb('0x12')][_0xccdb('0x14')]);}logger['error'](_0xccdb('0xd'),_0x39e39a,_0x48a8fc[_0xccdb('0x12')][_0xccdb('0x14')]);return _0x212dae(_0x48a8fc[_0xccdb('0x12')][_0xccdb('0x14')]);}else{logger[_0xccdb('0xc')](_0xccdb('0xd'),_0x39e39a,_0xccdb('0xe'));_0x212dae(_0x48a8fc[_0xccdb('0x15')]['message']);}})['catch'](function(_0x5965f0){logger[_0xccdb('0x12')](_0xccdb('0xd'),_0x39e39a,_0x5965f0);_0x39013e(_0x5965f0);});});}exports['GetFreshdeskAccount']=function(_0x1c89a8){var _0x36d53b=this;return new Promise(function(_0x28c78c,_0x4dfb56){return db[_0xccdb('0x16')][_0xccdb('0x17')]({'raw':_0x1c89a8[_0xccdb('0x18')]?_0x1c89a8['options'][_0xccdb('0x19')]===undefined?!![]:![]:!![],'where':_0x1c89a8[_0xccdb('0x18')]?_0x1c89a8['options'][_0xccdb('0x1a')]||null:null,'attributes':_0x1c89a8[_0xccdb('0x18')]?_0x1c89a8[_0xccdb('0x18')][_0xccdb('0x1b')]||null:null,'limit':_0x1c89a8[_0xccdb('0x18')]?_0x1c89a8[_0xccdb('0x18')][_0xccdb('0x1c')]||null:null,'include':_0x1c89a8[_0xccdb('0x18')]?_0x1c89a8[_0xccdb('0x18')]['include']?_[_0xccdb('0x1d')](_0x1c89a8[_0xccdb('0x18')]['include'],function(_0x30b073){return{'model':db[_0x30b073['model']],'as':_0x30b073['as'],'attributes':_0x30b073[_0xccdb('0x1b')],'include':_0x30b073['include']?_['map'](_0x30b073[_0xccdb('0x1e')],function(_0x36ba8d){return{'model':db[_0x36ba8d[_0xccdb('0x1f')]],'as':_0x36ba8d['as'],'attributes':_0x36ba8d[_0xccdb('0x1b')],'include':_0x36ba8d[_0xccdb('0x1e')]?_['map'](_0x36ba8d[_0xccdb('0x1e')],function(_0x4a98e5){return{'model':db[_0x4a98e5[_0xccdb('0x1f')]],'as':_0x4a98e5['as'],'attributes':_0x4a98e5[_0xccdb('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bd2b2){logger['info'](_0xccdb('0x20'),_0x1c89a8);logger[_0xccdb('0xf')](_0xccdb('0x20'),_0x1c89a8,JSON[_0xccdb('0x11')](_0x3bd2b2));_0x28c78c(_0x3bd2b2);})['catch'](function(_0x35f35e){logger[_0xccdb('0x12')](_0xccdb('0x20'),_0x35f35e['message'],_0x1c89a8);_0x4dfb56(_0x36d53b[_0xccdb('0x12')](0x1f4,_0x35f35e[_0xccdb('0x14')]));});});};exports[_0xccdb('0x21')]=function(_0x51e150){var _0x2d301f=this;return new Promise(function(_0x228c36,_0x4b382f){return db['FreshdeskAccount'][_0xccdb('0x22')]({'raw':_0x51e150[_0xccdb('0x18')]?_0x51e150[_0xccdb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x51e150[_0xccdb('0x18')]?_0x51e150[_0xccdb('0x18')][_0xccdb('0x1a')]||null:null,'attributes':_0x51e150['options']?_0x51e150['options'][_0xccdb('0x1b')]||null:null,'include':_0x51e150[_0xccdb('0x18')]?_0x51e150[_0xccdb('0x18')][_0xccdb('0x1e')]?_[_0xccdb('0x1d')](_0x51e150[_0xccdb('0x18')][_0xccdb('0x1e')],function(_0x116f2a){return{'model':db[_0x116f2a[_0xccdb('0x1f')]],'as':_0x116f2a['as'],'attributes':_0x116f2a[_0xccdb('0x1b')],'include':_0x116f2a[_0xccdb('0x1e')]?_['map'](_0x116f2a[_0xccdb('0x1e')],function(_0x3778d6){return{'model':db[_0x3778d6[_0xccdb('0x1f')]],'as':_0x3778d6['as'],'attributes':_0x3778d6[_0xccdb('0x1b')],'include':_0x3778d6[_0xccdb('0x1e')]?_[_0xccdb('0x1d')](_0x3778d6['include'],function(_0x5d8eb1){return{'model':db[_0x5d8eb1[_0xccdb('0x1f')]],'as':_0x5d8eb1['as'],'attributes':_0x5d8eb1['attributes']};}):[]};}):[]};}):[]:[]})[_0xccdb('0x23')](function(_0x4e3dc3){logger[_0xccdb('0xc')]('ShowFreshdeskAccount',_0x51e150);logger[_0xccdb('0xf')](_0xccdb('0x21'),_0x51e150,JSON[_0xccdb('0x11')](_0x4e3dc3));_0x228c36(_0x4e3dc3);})['catch'](function(_0x2ba5b2){logger['error'](_0xccdb('0x21'),_0x2ba5b2[_0xccdb('0x14')],_0x51e150);_0x4b382f(_0x2d301f[_0xccdb('0x12')](0x1f4,_0x2ba5b2[_0xccdb('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 9e1b590..9cb60e7 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 _0x7bae=['setTags','update','delete','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7bae,0x13b));var _0xe7ba=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x7bae[_0xd09668];return _0x68726;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7ba('0x0'));var timeout=require(_0xe7ba('0x1'));var express=require('express');var router=express[_0xe7ba('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe7ba('0x3'));var config=require(_0xe7ba('0x4'));var controller=require(_0xe7ba('0x5'));router[_0xe7ba('0x6')]('/',auth[_0xe7ba('0x7')](),controller[_0xe7ba('0x8')]);router[_0xe7ba('0x6')](_0xe7ba('0x9'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xa')]);router[_0xe7ba('0x6')](_0xe7ba('0xb'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xc')]);router['get'](_0xe7ba('0xd'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xe')]);router[_0xe7ba('0x6')](_0xe7ba('0xf'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0x10')]);router[_0xe7ba('0x6')](_0xe7ba('0x11'),auth['isAuthenticated'](),controller[_0xe7ba('0x12')]);router['post']('/',auth[_0xe7ba('0x7')](),controller[_0xe7ba('0x13')]);router[_0xe7ba('0x14')](_0xe7ba('0x11'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0x15')]);router['put']('/:id',auth[_0xe7ba('0x7')](),controller[_0xe7ba('0x16')]);router[_0xe7ba('0x17')]('/:id',auth[_0xe7ba('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xaba6=['/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','/:id','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x82192c,_0x5948b5){var _0x17ceb6=function(_0x3de34d){while(--_0x3de34d){_0x82192c['push'](_0x82192c['shift']());}};_0x17ceb6(++_0x5948b5);}(_0xaba6,0xe2));var _0x6aba=function(_0x5dc9f5,_0x5362c7){_0x5dc9f5=_0x5dc9f5-0x0;var _0x4faea5=_0xaba6[_0x5dc9f5];return _0x4faea5;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x6aba('0x2'));var interaction=require(_0x6aba('0x3'));var config=require('../../config/environment');var controller=require(_0x6aba('0x4'));router[_0x6aba('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6aba('0x6'),auth['isAuthenticated'](),controller[_0x6aba('0x7')]);router[_0x6aba('0x5')]('/:id/fields',auth[_0x6aba('0x8')](),controller[_0x6aba('0x9')]);router['get'](_0x6aba('0xa'),auth[_0x6aba('0x8')](),controller[_0x6aba('0xb')]);router[_0x6aba('0x5')](_0x6aba('0xc'),auth[_0x6aba('0x8')](),controller[_0x6aba('0xd')]);router['get'](_0x6aba('0xe'),auth[_0x6aba('0x8')](),controller[_0x6aba('0xf')]);router[_0x6aba('0x10')]('/',auth['isAuthenticated'](),controller[_0x6aba('0x11')]);router[_0x6aba('0x10')]('/:id/tags',auth[_0x6aba('0x8')](),controller[_0x6aba('0x12')]);router[_0x6aba('0x13')]('/:id',auth[_0x6aba('0x8')](),controller[_0x6aba('0x14')]);router[_0x6aba('0x15')]('/:id',auth[_0x6aba('0x8')](),controller[_0x6aba('0x16')]);module[_0x6aba('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 471fcb4..dc53fd1 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 _0x9943=['STRING','sequelize'];(function(_0x47b5c4,_0xce4a7c){var _0x592b29=function(_0x3bca1c){while(--_0x3bca1c){_0x47b5c4['push'](_0x47b5c4['shift']());}};_0x592b29(++_0xce4a7c);}(_0x9943,0x109));var _0x3994=function(_0x55cc6a,_0x5dbd65){_0x55cc6a=_0x55cc6a-0x0;var _0x26e2cd=_0x9943[_0x55cc6a];return _0x26e2cd;};'use strict';var Sequelize=require(_0x3994('0x0'));module['exports']={'name':{'type':Sequelize[_0x3994('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8282=['STRING','exports'];(function(_0x2ba9ef,_0x1d9e86){var _0x3e26fe=function(_0x16bada){while(--_0x16bada){_0x2ba9ef['push'](_0x2ba9ef['shift']());}};_0x3e26fe(++_0x1d9e86);}(_0x8282,0x7f));var _0x2828=function(_0x3aefc7,_0x3441f7){_0x3aefc7=_0x3aefc7-0x0;var _0x2d3097=_0x8282[_0x3aefc7];return _0x2d3097;};'use strict';var Sequelize=require('sequelize');module[_0x2828('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2828('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index d0925b3..1b4bfb2 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 _0xa962=['getFields','getSubjects','pick','findOne','FreshdeskField','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','send','index','FreshdeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','map','type','VIRTUAL','filter','merge','includeAll','rows','catch','include','options','find','create','body','params'];(function(_0x28d7aa,_0x4b223b){var _0x4e3ed3=function(_0x298b05){while(--_0x298b05){_0x28d7aa['push'](_0x28d7aa['shift']());}};_0x4e3ed3(++_0x4b223b);}(_0xa962,0x1c7));var _0x2a96=function(_0x1afe40,_0x824761){_0x1afe40=_0x1afe40-0x0;var _0x243412=_0xa962[_0x1afe40];return _0x243412;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2a96('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a96('0x1'));var rp=require(_0x2a96('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2a96('0x3'));var util=require(_0x2a96('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x2a96('0x5'));var ejs=require(_0x2a96('0x6'));var fs=require('fs');var _=require(_0x2a96('0x7'));var squel=require(_0x2a96('0x8'));var crypto=require(_0x2a96('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a96('0x5'));var querystring=require('querystring');var Papa=require(_0x2a96('0xa'));var authService=require(_0x2a96('0xb'));var hardwareService=require(_0x2a96('0xc'));var Redis=require('ioredis');var qs=require(_0x2a96('0xd'));var logger=require(_0x2a96('0xe'))(_0x2a96('0xf'));var utils=require(_0x2a96('0x10'));var config=require(_0x2a96('0x11'));var db=require(_0x2a96('0x12'))['db'];var jayson=require(_0x2a96('0x13'));var client=jayson[_0x2a96('0x14')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3735bb,_0x2fb346,_0x4d5725,_0x5e3d57){return new BPromise(function(_0x2080d3,_0x118b85){var _0x1f367b=_0x5e3d57||client;return _0x1f367b[_0x2a96('0x15')](_0x3735bb,_0x4d5725)[_0x2a96('0x16')](function(_0x185cca){logger['info'](_0x2a96('0x17'),_0x2fb346,'request\x20sent');logger[_0x2a96('0x18')](_0x2a96('0x19'),_0x2fb346,'request\x20sent',JSON[_0x2a96('0x1a')](_0x185cca));if(_0x185cca[_0x2a96('0x1b')]){if(_0x185cca[_0x2a96('0x1b')][_0x2a96('0x1c')]===0x1f4){logger[_0x2a96('0x1b')](_0x2a96('0x17'),_0x2fb346,_0x185cca[_0x2a96('0x1b')]['message']);return _0x118b85(_0x185cca[_0x2a96('0x1b')][_0x2a96('0x1d')]);}logger['error'](_0x2a96('0x17'),_0x2fb346,_0x185cca[_0x2a96('0x1b')][_0x2a96('0x1d')]);return _0x2080d3(_0x185cca[_0x2a96('0x1b')]['message']);}else{logger[_0x2a96('0x1e')](_0x2a96('0x17'),_0x2fb346,_0x2a96('0x1f'));_0x2080d3(_0x185cca[_0x2a96('0x20')][_0x2a96('0x1d')]);}})['catch'](function(_0x131bb4){logger['error'](_0x2a96('0x17'),_0x2fb346,_0x131bb4);_0x118b85(_0x131bb4);});});}function respondWithStatusCode(_0x469595,_0x3eecb5){_0x3eecb5=_0x3eecb5||0xcc;return function(_0x3c1634){if(_0x3c1634){return _0x469595[_0x2a96('0x21')](_0x3eecb5);}return _0x469595[_0x2a96('0x22')](_0x3eecb5)[_0x2a96('0x23')]();};}function respondWithResult(_0x5dcab4,_0x15ee10){_0x15ee10=_0x15ee10||0xc8;return function(_0x2daedc){if(_0x2daedc){return _0x5dcab4[_0x2a96('0x22')](_0x15ee10)['json'](_0x2daedc);}};}function respondWithFilteredResult(_0x589e07,_0x32e763){return function(_0x3c23ce){if(_0x3c23ce){var _0x1a60da=_0x3c23ce[_0x2a96('0x24')],_0x481e33=_0x32e763['offset'],_0x4a1b85=_0x32e763[_0x2a96('0x25')]+_0x32e763[_0x2a96('0x26')],_0x1e0c80;if(_0x4a1b85>=_0x1a60da){_0x4a1b85=_0x1a60da;_0x1e0c80=0xc8;}else{_0x1e0c80=0xce;}_0x589e07[_0x2a96('0x22')](_0x1e0c80);return _0x589e07[_0x2a96('0x27')](_0x2a96('0x28'),_0x481e33+'-'+_0x4a1b85+'/'+_0x1a60da)[_0x2a96('0x29')](_0x3c23ce);}return null;};}function patchUpdates(_0x1d6d39){return function(_0x260dc8){try{jsonpatch[_0x2a96('0x2a')](_0x260dc8,_0x1d6d39,!![]);}catch(_0x11fcf5){return BPromise[_0x2a96('0x2b')](_0x11fcf5);}return _0x260dc8[_0x2a96('0x2c')]();};}function saveUpdates(_0x26e8ac,_0x61e6e){return function(_0x30388){if(_0x30388){return _0x30388[_0x2a96('0x2d')](_0x26e8ac)[_0x2a96('0x16')](function(_0x46f78b){return _0x46f78b;});}return null;};}function removeEntity(_0x48a7f0,_0x12d591){return function(_0x127ad1){if(_0x127ad1){return _0x127ad1[_0x2a96('0x2e')]()[_0x2a96('0x16')](function(){_0x48a7f0[_0x2a96('0x22')](0xcc)[_0x2a96('0x23')]();});}};}function handleEntityNotFound(_0x50679f,_0x2d2aae){return function(_0x37ef00){if(!_0x37ef00){_0x50679f[_0x2a96('0x21')](0x194);}return _0x37ef00;};}function handleError(_0x547170,_0x26de63){_0x26de63=_0x26de63||0x1f4;return function(_0x10c062){logger[_0x2a96('0x1b')](_0x10c062['stack']);if(_0x10c062[_0x2a96('0x2f')]){delete _0x10c062[_0x2a96('0x2f')];}_0x547170[_0x2a96('0x22')](_0x26de63)[_0x2a96('0x30')](_0x10c062);};}exports[_0x2a96('0x31')]=function(_0x1ba7f1,_0x58b7cb){var _0x49d20d={},_0x3f43b2={},_0xf963b7={'count':0x0,'rows':[]};var _0x5690e8=db[_0x2a96('0x32')][_0x2a96('0x33')];_0x3f43b2[_0x2a96('0x34')]=_['keys'](_0x5690e8);_0x3f43b2['query']=_[_0x2a96('0x35')](_0x1ba7f1[_0x2a96('0x36')]);_0x3f43b2[_0x2a96('0x37')]=_[_0x2a96('0x38')](_0x3f43b2['model'],_0x3f43b2[_0x2a96('0x36')]);_0x49d20d[_0x2a96('0x39')]=_['intersection'](_0x3f43b2[_0x2a96('0x34')],qs[_0x2a96('0x3a')](_0x1ba7f1[_0x2a96('0x36')]['fields']));_0x49d20d['attributes']=_0x49d20d[_0x2a96('0x39')][_0x2a96('0x3b')]?_0x49d20d['attributes']:_0x3f43b2[_0x2a96('0x34')];if(!_0x1ba7f1[_0x2a96('0x36')][_0x2a96('0x3c')](_0x2a96('0x3d'))){_0x49d20d[_0x2a96('0x26')]=qs['limit'](_0x1ba7f1['query'][_0x2a96('0x26')]);_0x49d20d[_0x2a96('0x25')]=qs[_0x2a96('0x25')](_0x1ba7f1[_0x2a96('0x36')]['offset']);}_0x49d20d[_0x2a96('0x3e')]=qs[_0x2a96('0x3f')](_0x1ba7f1[_0x2a96('0x36')]['sort']);_0x49d20d['where']=qs[_0x2a96('0x37')](_['pick'](_0x1ba7f1[_0x2a96('0x36')],_0x3f43b2['filters']));if(_0x1ba7f1[_0x2a96('0x36')]['filter']){_0x49d20d[_0x2a96('0x40')]=_['merge'](_0x49d20d['where'],{'$or':_[_0x2a96('0x41')](_0x5690e8,function(_0x1c4c5e){if(_0x1c4c5e[_0x2a96('0x42')]['key']!==_0x2a96('0x43')){var _0x4ba020={};_0x4ba020[_0x1c4c5e['field']]={'$like':'%'+_0x1ba7f1[_0x2a96('0x36')][_0x2a96('0x44')]+'%'};return _0x4ba020;}})});}_0x49d20d=_[_0x2a96('0x45')]({},_0x49d20d,_0x1ba7f1['options']);var _0x6dd06e={'where':_0x49d20d[_0x2a96('0x40')]};return db[_0x2a96('0x32')][_0x2a96('0x24')](_0x6dd06e)[_0x2a96('0x16')](function(_0x4c3d66){_0xf963b7[_0x2a96('0x24')]=_0x4c3d66;if(_0x1ba7f1[_0x2a96('0x36')][_0x2a96('0x46')]){_0x49d20d['include']=[{'all':!![]}];}return db[_0x2a96('0x32')]['findAll'](_0x49d20d);})[_0x2a96('0x16')](function(_0x1ba63c){_0xf963b7[_0x2a96('0x47')]=_0x1ba63c;return _0xf963b7;})[_0x2a96('0x16')](respondWithFilteredResult(_0x58b7cb,_0x49d20d))[_0x2a96('0x48')](handleError(_0x58b7cb,null));};exports['show']=function(_0x34571d,_0x30180e){var _0x3563e8={'raw':![],'where':{'id':_0x34571d['params']['id']}},_0x3a5a29={};_0x3a5a29[_0x2a96('0x34')]=_[_0x2a96('0x35')](db[_0x2a96('0x32')][_0x2a96('0x33')]);_0x3a5a29[_0x2a96('0x36')]=_['keys'](_0x34571d[_0x2a96('0x36')]);_0x3a5a29[_0x2a96('0x37')]=_[_0x2a96('0x38')](_0x3a5a29[_0x2a96('0x34')],_0x3a5a29[_0x2a96('0x36')]);_0x3563e8[_0x2a96('0x39')]=_[_0x2a96('0x38')](_0x3a5a29['model'],qs['fields'](_0x34571d['query'][_0x2a96('0x3a')]));_0x3563e8[_0x2a96('0x39')]=_0x3563e8['attributes'][_0x2a96('0x3b')]?_0x3563e8[_0x2a96('0x39')]:_0x3a5a29[_0x2a96('0x34')];if(_0x34571d[_0x2a96('0x36')][_0x2a96('0x46')]){_0x3563e8[_0x2a96('0x49')]=[{'all':!![]}];}_0x3563e8=_[_0x2a96('0x45')]({},_0x3563e8,_0x34571d[_0x2a96('0x4a')]);return db[_0x2a96('0x32')][_0x2a96('0x4b')](_0x3563e8)[_0x2a96('0x16')](handleEntityNotFound(_0x30180e,null))[_0x2a96('0x16')](respondWithResult(_0x30180e,null))[_0x2a96('0x48')](handleError(_0x30180e,null));};exports[_0x2a96('0x4c')]=function(_0x2cf5ee,_0x3b2c68){return db[_0x2a96('0x32')][_0x2a96('0x4c')](_0x2cf5ee['body'],{})['then'](respondWithResult(_0x3b2c68,0xc9))[_0x2a96('0x48')](handleError(_0x3b2c68,null));};exports[_0x2a96('0x2d')]=function(_0x21e7e4,_0x5c29b5){if(_0x21e7e4[_0x2a96('0x4d')]['id']){delete _0x21e7e4[_0x2a96('0x4d')]['id'];}return db['FreshdeskConfiguration'][_0x2a96('0x4b')]({'where':{'id':_0x21e7e4[_0x2a96('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5c29b5,null))[_0x2a96('0x16')](saveUpdates(_0x21e7e4[_0x2a96('0x4d')],null))[_0x2a96('0x16')](respondWithResult(_0x5c29b5,null))[_0x2a96('0x48')](handleError(_0x5c29b5,null));};exports[_0x2a96('0x2e')]=function(_0x3ba53b,_0x2cc659){return db[_0x2a96('0x32')]['find']({'where':{'id':_0x3ba53b[_0x2a96('0x4e')]['id']}})[_0x2a96('0x16')](handleEntityNotFound(_0x2cc659,null))[_0x2a96('0x16')](removeEntity(_0x2cc659,null))[_0x2a96('0x48')](handleError(_0x2cc659,null));};exports[_0x2a96('0x4f')]=function(_0x4d73fc,_0x26d8b7,_0x31ec16){var _0xf790d4={};var _0x2aa682={};var _0x5a2fed;var _0x4b3531;return db[_0x2a96('0x32')]['findOne']({'where':{'id':_0x4d73fc[_0x2a96('0x4e')]['id']}})[_0x2a96('0x16')](handleEntityNotFound(_0x26d8b7,null))[_0x2a96('0x16')](function(_0x3d93f5){if(_0x3d93f5){_0x5a2fed=_0x3d93f5;_0x2aa682[_0x2a96('0x34')]=_[_0x2a96('0x35')](db['FreshdeskField'][_0x2a96('0x33')]);_0x2aa682[_0x2a96('0x36')]=_[_0x2a96('0x35')](_0x4d73fc[_0x2a96('0x36')]);_0x2aa682[_0x2a96('0x37')]=_[_0x2a96('0x38')](_0x2aa682[_0x2a96('0x34')],_0x2aa682[_0x2a96('0x36')]);_0xf790d4['attributes']=_[_0x2a96('0x38')](_0x2aa682[_0x2a96('0x34')],qs[_0x2a96('0x3a')](_0x4d73fc[_0x2a96('0x36')][_0x2a96('0x3a')]));_0xf790d4[_0x2a96('0x39')]=_0xf790d4[_0x2a96('0x39')][_0x2a96('0x3b')]?_0xf790d4[_0x2a96('0x39')]:_0x2aa682[_0x2a96('0x34')];_0xf790d4[_0x2a96('0x3e')]=qs[_0x2a96('0x3f')](_0x4d73fc[_0x2a96('0x36')][_0x2a96('0x3f')]);_0xf790d4[_0x2a96('0x40')]=qs[_0x2a96('0x37')](_['pick'](_0x4d73fc[_0x2a96('0x36')],_0x2aa682[_0x2a96('0x37')]));if(_0x4d73fc['query'][_0x2a96('0x44')]){_0xf790d4['where']=_[_0x2a96('0x45')](_0xf790d4[_0x2a96('0x40')],{'$or':_['map'](_0xf790d4['attributes'],function(_0x42ec68){var _0x2ea561={};_0x2ea561[_0x42ec68]={'$like':'%'+_0x4d73fc[_0x2a96('0x36')][_0x2a96('0x44')]+'%'};return _0x2ea561;})});}_0xf790d4=_['merge']({},_0xf790d4,_0x4d73fc[_0x2a96('0x4a')]);return _0x5a2fed[_0x2a96('0x4f')](_0xf790d4);}})[_0x2a96('0x16')](function(_0x44f6de){if(_0x44f6de){_0x4b3531=_0x44f6de[_0x2a96('0x3b')];if(!_0x4d73fc[_0x2a96('0x36')][_0x2a96('0x3c')]('nolimit')){_0xf790d4['limit']=qs[_0x2a96('0x26')](_0x4d73fc['query'][_0x2a96('0x26')]);_0xf790d4[_0x2a96('0x25')]=qs[_0x2a96('0x25')](_0x4d73fc[_0x2a96('0x36')][_0x2a96('0x25')]);}return _0x5a2fed[_0x2a96('0x4f')](_0xf790d4);}})[_0x2a96('0x16')](function(_0x5a6ba4){if(_0x5a6ba4){return _0x5a6ba4?{'count':_0x4b3531,'rows':_0x5a6ba4}:null;}})[_0x2a96('0x16')](respondWithResult(_0x26d8b7,null))[_0x2a96('0x48')](handleError(_0x26d8b7,null));};exports[_0x2a96('0x50')]=function(_0x4cd61d,_0xb02ed6,_0x5e6516){var _0x5834f9={};var _0x51e660={};var _0x248e7a;var _0x2cb2a1;return db[_0x2a96('0x32')]['findOne']({'where':{'id':_0x4cd61d[_0x2a96('0x4e')]['id']}})[_0x2a96('0x16')](handleEntityNotFound(_0xb02ed6,null))[_0x2a96('0x16')](function(_0x4b658f){if(_0x4b658f){_0x248e7a=_0x4b658f;_0x51e660['model']=_[_0x2a96('0x35')](db['FreshdeskField'][_0x2a96('0x33')]);_0x51e660[_0x2a96('0x36')]=_[_0x2a96('0x35')](_0x4cd61d[_0x2a96('0x36')]);_0x51e660[_0x2a96('0x37')]=_[_0x2a96('0x38')](_0x51e660['model'],_0x51e660[_0x2a96('0x36')]);_0x5834f9[_0x2a96('0x39')]=_[_0x2a96('0x38')](_0x51e660[_0x2a96('0x34')],qs['fields'](_0x4cd61d[_0x2a96('0x36')][_0x2a96('0x3a')]));_0x5834f9['attributes']=_0x5834f9[_0x2a96('0x39')][_0x2a96('0x3b')]?_0x5834f9['attributes']:_0x51e660[_0x2a96('0x34')];_0x5834f9['order']=qs['sort'](_0x4cd61d[_0x2a96('0x36')][_0x2a96('0x3f')]);_0x5834f9[_0x2a96('0x40')]=qs['filters'](_[_0x2a96('0x51')](_0x4cd61d[_0x2a96('0x36')],_0x51e660['filters']));if(_0x4cd61d[_0x2a96('0x36')]['filter']){_0x5834f9[_0x2a96('0x40')]=_['merge'](_0x5834f9[_0x2a96('0x40')],{'$or':_[_0x2a96('0x41')](_0x5834f9[_0x2a96('0x39')],function(_0x2f25e2){var _0x55b74e={};_0x55b74e[_0x2f25e2]={'$like':'%'+_0x4cd61d[_0x2a96('0x36')][_0x2a96('0x44')]+'%'};return _0x55b74e;})});}_0x5834f9=_[_0x2a96('0x45')]({},_0x5834f9,_0x4cd61d[_0x2a96('0x4a')]);return _0x248e7a['getSubjects'](_0x5834f9);}})[_0x2a96('0x16')](function(_0x1cdfb9){if(_0x1cdfb9){_0x2cb2a1=_0x1cdfb9[_0x2a96('0x3b')];if(!_0x4cd61d['query'][_0x2a96('0x3c')](_0x2a96('0x3d'))){_0x5834f9[_0x2a96('0x26')]=qs[_0x2a96('0x26')](_0x4cd61d[_0x2a96('0x36')][_0x2a96('0x26')]);_0x5834f9[_0x2a96('0x25')]=qs[_0x2a96('0x25')](_0x4cd61d['query'][_0x2a96('0x25')]);}return _0x248e7a[_0x2a96('0x50')](_0x5834f9);}})[_0x2a96('0x16')](function(_0x8449bc){if(_0x8449bc){return _0x8449bc?{'count':_0x2cb2a1,'rows':_0x8449bc}:null;}})[_0x2a96('0x16')](respondWithResult(_0xb02ed6,null))['catch'](handleError(_0xb02ed6,null));};exports['getDescriptions']=function(_0xf431cb,_0x63ed04,_0x1002b4){var _0x4269bf={};var _0x3da0ae={};var _0x3c3920;var _0x34f08e;return db['FreshdeskConfiguration'][_0x2a96('0x52')]({'where':{'id':_0xf431cb[_0x2a96('0x4e')]['id']}})[_0x2a96('0x16')](handleEntityNotFound(_0x63ed04,null))[_0x2a96('0x16')](function(_0x20382d){if(_0x20382d){_0x3c3920=_0x20382d;_0x3da0ae[_0x2a96('0x34')]=_[_0x2a96('0x35')](db[_0x2a96('0x53')]['rawAttributes']);_0x3da0ae[_0x2a96('0x36')]=_['keys'](_0xf431cb[_0x2a96('0x36')]);_0x3da0ae['filters']=_[_0x2a96('0x38')](_0x3da0ae[_0x2a96('0x34')],_0x3da0ae['query']);_0x4269bf[_0x2a96('0x39')]=_[_0x2a96('0x38')](_0x3da0ae['model'],qs[_0x2a96('0x3a')](_0xf431cb[_0x2a96('0x36')][_0x2a96('0x3a')]));_0x4269bf[_0x2a96('0x39')]=_0x4269bf[_0x2a96('0x39')][_0x2a96('0x3b')]?_0x4269bf[_0x2a96('0x39')]:_0x3da0ae[_0x2a96('0x34')];_0x4269bf[_0x2a96('0x3e')]=qs[_0x2a96('0x3f')](_0xf431cb[_0x2a96('0x36')][_0x2a96('0x3f')]);_0x4269bf[_0x2a96('0x40')]=qs['filters'](_[_0x2a96('0x51')](_0xf431cb['query'],_0x3da0ae[_0x2a96('0x37')]));if(_0xf431cb[_0x2a96('0x36')][_0x2a96('0x44')]){_0x4269bf[_0x2a96('0x40')]=_[_0x2a96('0x45')](_0x4269bf[_0x2a96('0x40')],{'$or':_[_0x2a96('0x41')](_0x4269bf[_0x2a96('0x39')],function(_0x41d989){var _0x395fb7={};_0x395fb7[_0x41d989]={'$like':'%'+_0xf431cb[_0x2a96('0x36')][_0x2a96('0x44')]+'%'};return _0x395fb7;})});}_0x4269bf=_[_0x2a96('0x45')]({},_0x4269bf,_0xf431cb[_0x2a96('0x4a')]);return _0x3c3920[_0x2a96('0x54')](_0x4269bf);}})['then'](function(_0x546f02){if(_0x546f02){_0x34f08e=_0x546f02[_0x2a96('0x3b')];if(!_0xf431cb['query'][_0x2a96('0x3c')](_0x2a96('0x3d'))){_0x4269bf[_0x2a96('0x26')]=qs[_0x2a96('0x26')](_0xf431cb[_0x2a96('0x36')]['limit']);_0x4269bf[_0x2a96('0x25')]=qs['offset'](_0xf431cb['query']['offset']);}return _0x3c3920['getDescriptions'](_0x4269bf);}})[_0x2a96('0x16')](function(_0x27da79){if(_0x27da79){return _0x27da79?{'count':_0x34f08e,'rows':_0x27da79}:null;}})[_0x2a96('0x16')](respondWithResult(_0x63ed04,null))[_0x2a96('0x48')](handleError(_0x63ed04,null));};exports[_0x2a96('0x55')]=function(_0x321bf4,_0x3d1846,_0x47df5f){var _0x50be3d={};var _0x157847={};var _0x33f083;var _0x39f651;return db['FreshdeskConfiguration'][_0x2a96('0x52')]({'where':{'id':_0x321bf4[_0x2a96('0x4e')]['id']}})[_0x2a96('0x16')](handleEntityNotFound(_0x3d1846,null))['then'](function(_0x513219){if(_0x513219){_0x33f083=_0x513219;_0x157847[_0x2a96('0x34')]=_[_0x2a96('0x35')](db[_0x2a96('0x56')]['rawAttributes']);_0x157847[_0x2a96('0x36')]=_[_0x2a96('0x35')](_0x321bf4[_0x2a96('0x36')]);_0x157847[_0x2a96('0x37')]=_['intersection'](_0x157847[_0x2a96('0x34')],_0x157847['query']);_0x50be3d[_0x2a96('0x39')]=_[_0x2a96('0x38')](_0x157847[_0x2a96('0x34')],qs[_0x2a96('0x3a')](_0x321bf4['query'][_0x2a96('0x3a')]));_0x50be3d[_0x2a96('0x39')]=_0x50be3d['attributes']['length']?_0x50be3d[_0x2a96('0x39')]:_0x157847[_0x2a96('0x34')];_0x50be3d[_0x2a96('0x3e')]=qs[_0x2a96('0x3f')](_0x321bf4['query'][_0x2a96('0x3f')]);_0x50be3d[_0x2a96('0x40')]=qs[_0x2a96('0x37')](_[_0x2a96('0x51')](_0x321bf4[_0x2a96('0x36')],_0x157847[_0x2a96('0x37')]));if(_0x321bf4[_0x2a96('0x36')][_0x2a96('0x44')]){_0x50be3d[_0x2a96('0x40')]=_[_0x2a96('0x45')](_0x50be3d['where'],{'$or':_['map'](_0x50be3d[_0x2a96('0x39')],function(_0x29df34){var _0x4b1e08={};_0x4b1e08[_0x29df34]={'$like':'%'+_0x321bf4[_0x2a96('0x36')][_0x2a96('0x44')]+'%'};return _0x4b1e08;})});}_0x50be3d=_[_0x2a96('0x45')]({},_0x50be3d,_0x321bf4[_0x2a96('0x4a')]);return _0x33f083['getTags'](_0x50be3d);}})[_0x2a96('0x16')](function(_0x24f14e){if(_0x24f14e){_0x39f651=_0x24f14e[_0x2a96('0x3b')];if(!_0x321bf4[_0x2a96('0x36')][_0x2a96('0x3c')]('nolimit')){_0x50be3d[_0x2a96('0x26')]=qs[_0x2a96('0x26')](_0x321bf4[_0x2a96('0x36')]['limit']);_0x50be3d[_0x2a96('0x25')]=qs[_0x2a96('0x25')](_0x321bf4[_0x2a96('0x36')]['offset']);}return _0x33f083[_0x2a96('0x55')](_0x50be3d);}})[_0x2a96('0x16')](function(_0x5960a7){if(_0x5960a7){return _0x5960a7?{'count':_0x39f651,'rows':_0x5960a7}:null;}})[_0x2a96('0x16')](respondWithResult(_0x3d1846,null))['catch'](handleError(_0x3d1846,null));};exports[_0x2a96('0x57')]=function(_0x1d6517,_0x53a170,_0x3aa844){if(_0x1d6517[_0x2a96('0x4d')]['id']){delete _0x1d6517[_0x2a96('0x4d')]['id'];}return db[_0x2a96('0x32')][_0x2a96('0x52')]({'where':{'id':_0x1d6517['params']['id']}})[_0x2a96('0x16')](handleEntityNotFound(_0x53a170,null))[_0x2a96('0x16')](function(_0x357a21){if(_0x357a21){return _0x357a21['setTags'](_0x1d6517['body'][_0x2a96('0x58')]||[]);}return null;})[_0x2a96('0x16')](respondWithResult(_0x53a170,null))[_0x2a96('0x48')](handleError(_0x53a170,null));}; \ No newline at end of file +var _0xe072=['message','info','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','destroy','stack','name','FreshdeskConfiguration','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','map','type','VIRTUAL','field','merge','count','includeAll','include','findAll','params','rawAttributes','options','find','create','body','update','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe072,0x1ba));var _0x2e07=function(_0x51d6b5,_0x130f64){_0x51d6b5=_0x51d6b5-0x0;var _0x3ae607=_0xe072[_0x51d6b5];return _0x3ae607;};'use strict';var pdf=require(_0x2e07('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2e07('0x1'));var zipdir=require(_0x2e07('0x2'));var jsonpatch=require(_0x2e07('0x3'));var rp=require(_0x2e07('0x4'));var moment=require(_0x2e07('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2e07('0x6'));var util=require(_0x2e07('0x7'));var path=require(_0x2e07('0x8'));var sox=require(_0x2e07('0x9'));var csv=require(_0x2e07('0xa'));var ejs=require(_0x2e07('0xb'));var fs=require('fs');var _=require(_0x2e07('0xc'));var squel=require(_0x2e07('0xd'));var crypto=require(_0x2e07('0xe'));var jsforce=require(_0x2e07('0xf'));var deskjs=require(_0x2e07('0x10'));var toCsv=require(_0x2e07('0xa'));var querystring=require('querystring');var Papa=require(_0x2e07('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0x2e07('0x12'));var Redis=require(_0x2e07('0x13'));var qs=require(_0x2e07('0x14'));var logger=require(_0x2e07('0x15'))(_0x2e07('0x16'));var utils=require(_0x2e07('0x17'));var config=require(_0x2e07('0x18'));var db=require(_0x2e07('0x19'))['db'];var jayson=require(_0x2e07('0x1a'));var client=jayson[_0x2e07('0x1b')][_0x2e07('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x230d36,_0x59c302,_0x4ccdaf,_0xc7bc12){return new BPromise(function(_0x193297,_0x17a8d0){var _0x517c10=_0xc7bc12||client;return _0x517c10[_0x2e07('0x1d')](_0x230d36,_0x4ccdaf)[_0x2e07('0x1e')](function(_0xa3ea6){logger['info'](_0x2e07('0x1f'),_0x59c302,_0x2e07('0x20'));logger[_0x2e07('0x21')](_0x2e07('0x22'),_0x59c302,_0x2e07('0x20'),JSON[_0x2e07('0x23')](_0xa3ea6));if(_0xa3ea6[_0x2e07('0x24')]){if(_0xa3ea6[_0x2e07('0x24')][_0x2e07('0x25')]===0x1f4){logger[_0x2e07('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x59c302,_0xa3ea6[_0x2e07('0x24')][_0x2e07('0x26')]);return _0x17a8d0(_0xa3ea6[_0x2e07('0x24')][_0x2e07('0x26')]);}logger[_0x2e07('0x24')](_0x2e07('0x1f'),_0x59c302,_0xa3ea6[_0x2e07('0x24')][_0x2e07('0x26')]);return _0x193297(_0xa3ea6[_0x2e07('0x24')][_0x2e07('0x26')]);}else{logger[_0x2e07('0x27')](_0x2e07('0x1f'),_0x59c302,'request\x20sent');_0x193297(_0xa3ea6[_0x2e07('0x28')][_0x2e07('0x26')]);}})[_0x2e07('0x29')](function(_0x22c49c){logger[_0x2e07('0x24')](_0x2e07('0x1f'),_0x59c302,_0x22c49c);_0x17a8d0(_0x22c49c);});});}function respondWithStatusCode(_0x4f8e38,_0xd74656){_0xd74656=_0xd74656||0xcc;return function(_0x594c98){if(_0x594c98){return _0x4f8e38[_0x2e07('0x2a')](_0xd74656);}return _0x4f8e38[_0x2e07('0x2b')](_0xd74656)[_0x2e07('0x2c')]();};}function respondWithResult(_0x247b15,_0x4d9af2){_0x4d9af2=_0x4d9af2||0xc8;return function(_0x767e91){if(_0x767e91){return _0x247b15[_0x2e07('0x2b')](_0x4d9af2)[_0x2e07('0x2d')](_0x767e91);}};}function respondWithFilteredResult(_0x5c3d03,_0x2022ea){return function(_0xcd7727){if(_0xcd7727){var _0x39d201=_0xcd7727['count'],_0x1c4b89=_0x2022ea['offset'],_0x10047c=_0x2022ea[_0x2e07('0x2e')]+_0x2022ea['limit'],_0x1efbc4;if(_0x10047c>=_0x39d201){_0x10047c=_0x39d201;_0x1efbc4=0xc8;}else{_0x1efbc4=0xce;}_0x5c3d03[_0x2e07('0x2b')](_0x1efbc4);return _0x5c3d03[_0x2e07('0x2f')](_0x2e07('0x30'),_0x1c4b89+'-'+_0x10047c+'/'+_0x39d201)[_0x2e07('0x2d')](_0xcd7727);}return null;};}function patchUpdates(_0x544816){return function(_0x166b3d){try{jsonpatch[_0x2e07('0x31')](_0x166b3d,_0x544816,!![]);}catch(_0x57989d){return BPromise[_0x2e07('0x32')](_0x57989d);}return _0x166b3d[_0x2e07('0x33')]();};}function saveUpdates(_0x4d4f4e,_0x406014){return function(_0xbadddc){if(_0xbadddc){return _0xbadddc['update'](_0x4d4f4e)[_0x2e07('0x1e')](function(_0x479de0){return _0x479de0;});}return null;};}function removeEntity(_0x2f2bce,_0xea6f2a){return function(_0x5d679b){if(_0x5d679b){return _0x5d679b[_0x2e07('0x34')]()['then'](function(){_0x2f2bce['status'](0xcc)[_0x2e07('0x2c')]();});}};}function handleEntityNotFound(_0x119744,_0x19df5a){return function(_0x57d8cb){if(!_0x57d8cb){_0x119744[_0x2e07('0x2a')](0x194);}return _0x57d8cb;};}function handleError(_0x5de79a,_0x16a7fd){_0x16a7fd=_0x16a7fd||0x1f4;return function(_0x547fb2){logger[_0x2e07('0x24')](_0x547fb2[_0x2e07('0x35')]);if(_0x547fb2[_0x2e07('0x36')]){delete _0x547fb2[_0x2e07('0x36')];}_0x5de79a['status'](_0x16a7fd)['send'](_0x547fb2);};}exports['index']=function(_0x2fafdf,_0x3e97e5){var _0x5ef61f={},_0x5138dc={},_0x5e335a={'count':0x0,'rows':[]};var _0x5a9780=db[_0x2e07('0x37')]['rawAttributes'];_0x5138dc[_0x2e07('0x38')]=_[_0x2e07('0x39')](_0x5a9780);_0x5138dc[_0x2e07('0x3a')]=_['keys'](_0x2fafdf[_0x2e07('0x3a')]);_0x5138dc['filters']=_[_0x2e07('0x3b')](_0x5138dc[_0x2e07('0x38')],_0x5138dc[_0x2e07('0x3a')]);_0x5ef61f['attributes']=_[_0x2e07('0x3b')](_0x5138dc[_0x2e07('0x38')],qs[_0x2e07('0x3c')](_0x2fafdf[_0x2e07('0x3a')]['fields']));_0x5ef61f['attributes']=_0x5ef61f[_0x2e07('0x3d')][_0x2e07('0x3e')]?_0x5ef61f[_0x2e07('0x3d')]:_0x5138dc[_0x2e07('0x38')];if(!_0x2fafdf[_0x2e07('0x3a')][_0x2e07('0x3f')](_0x2e07('0x40'))){_0x5ef61f[_0x2e07('0x41')]=qs[_0x2e07('0x41')](_0x2fafdf[_0x2e07('0x3a')]['limit']);_0x5ef61f['offset']=qs[_0x2e07('0x2e')](_0x2fafdf['query']['offset']);}_0x5ef61f[_0x2e07('0x42')]=qs[_0x2e07('0x43')](_0x2fafdf[_0x2e07('0x3a')][_0x2e07('0x43')]);_0x5ef61f[_0x2e07('0x44')]=qs[_0x2e07('0x45')](_[_0x2e07('0x46')](_0x2fafdf[_0x2e07('0x3a')],_0x5138dc['filters']));if(_0x2fafdf[_0x2e07('0x3a')][_0x2e07('0x47')]){_0x5ef61f[_0x2e07('0x44')]=_['merge'](_0x5ef61f[_0x2e07('0x44')],{'$or':_[_0x2e07('0x48')](_0x5a9780,function(_0x16cb61){if(_0x16cb61[_0x2e07('0x49')]['key']!==_0x2e07('0x4a')){var _0x22ed81={};_0x22ed81[_0x16cb61[_0x2e07('0x4b')]]={'$like':'%'+_0x2fafdf[_0x2e07('0x3a')]['filter']+'%'};return _0x22ed81;}})});}_0x5ef61f=_[_0x2e07('0x4c')]({},_0x5ef61f,_0x2fafdf['options']);var _0x35e1bb={'where':_0x5ef61f['where']};return db[_0x2e07('0x37')][_0x2e07('0x4d')](_0x35e1bb)[_0x2e07('0x1e')](function(_0x45afec){_0x5e335a[_0x2e07('0x4d')]=_0x45afec;if(_0x2fafdf['query'][_0x2e07('0x4e')]){_0x5ef61f[_0x2e07('0x4f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x2e07('0x50')](_0x5ef61f);})[_0x2e07('0x1e')](function(_0x49799b){_0x5e335a['rows']=_0x49799b;return _0x5e335a;})[_0x2e07('0x1e')](respondWithFilteredResult(_0x3e97e5,_0x5ef61f))[_0x2e07('0x29')](handleError(_0x3e97e5,null));};exports['show']=function(_0x12211a,_0x1215f0){var _0x54578c={'raw':![],'where':{'id':_0x12211a[_0x2e07('0x51')]['id']}},_0x57bbb2={};_0x57bbb2[_0x2e07('0x38')]=_[_0x2e07('0x39')](db['FreshdeskConfiguration'][_0x2e07('0x52')]);_0x57bbb2[_0x2e07('0x3a')]=_['keys'](_0x12211a[_0x2e07('0x3a')]);_0x57bbb2[_0x2e07('0x45')]=_[_0x2e07('0x3b')](_0x57bbb2[_0x2e07('0x38')],_0x57bbb2[_0x2e07('0x3a')]);_0x54578c[_0x2e07('0x3d')]=_[_0x2e07('0x3b')](_0x57bbb2[_0x2e07('0x38')],qs[_0x2e07('0x3c')](_0x12211a[_0x2e07('0x3a')][_0x2e07('0x3c')]));_0x54578c[_0x2e07('0x3d')]=_0x54578c[_0x2e07('0x3d')][_0x2e07('0x3e')]?_0x54578c['attributes']:_0x57bbb2[_0x2e07('0x38')];if(_0x12211a[_0x2e07('0x3a')][_0x2e07('0x4e')]){_0x54578c['include']=[{'all':!![]}];}_0x54578c=_[_0x2e07('0x4c')]({},_0x54578c,_0x12211a[_0x2e07('0x53')]);return db[_0x2e07('0x37')][_0x2e07('0x54')](_0x54578c)['then'](handleEntityNotFound(_0x1215f0,null))[_0x2e07('0x1e')](respondWithResult(_0x1215f0,null))[_0x2e07('0x29')](handleError(_0x1215f0,null));};exports[_0x2e07('0x55')]=function(_0x5675f4,_0x569262){return db['FreshdeskConfiguration'][_0x2e07('0x55')](_0x5675f4[_0x2e07('0x56')],{})[_0x2e07('0x1e')](respondWithResult(_0x569262,0xc9))['catch'](handleError(_0x569262,null));};exports[_0x2e07('0x57')]=function(_0x441423,_0x434e6e){if(_0x441423[_0x2e07('0x56')]['id']){delete _0x441423[_0x2e07('0x56')]['id'];}return db[_0x2e07('0x37')][_0x2e07('0x54')]({'where':{'id':_0x441423[_0x2e07('0x51')]['id']}})[_0x2e07('0x1e')](handleEntityNotFound(_0x434e6e,null))[_0x2e07('0x1e')](saveUpdates(_0x441423[_0x2e07('0x56')],null))[_0x2e07('0x1e')](respondWithResult(_0x434e6e,null))['catch'](handleError(_0x434e6e,null));};exports[_0x2e07('0x34')]=function(_0x51a8ed,_0x1e5d20){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x51a8ed[_0x2e07('0x51')]['id']}})['then'](handleEntityNotFound(_0x1e5d20,null))['then'](removeEntity(_0x1e5d20,null))['catch'](handleError(_0x1e5d20,null));};exports[_0x2e07('0x58')]=function(_0x2fec6e,_0x49aae0,_0x4689e6){var _0x5a6a6a={};var _0x52bc97={};var _0x3c019f;var _0x45eaef;return db[_0x2e07('0x37')][_0x2e07('0x59')]({'where':{'id':_0x2fec6e[_0x2e07('0x51')]['id']}})[_0x2e07('0x1e')](handleEntityNotFound(_0x49aae0,null))['then'](function(_0x35e265){if(_0x35e265){_0x3c019f=_0x35e265;_0x52bc97['model']=_[_0x2e07('0x39')](db[_0x2e07('0x5a')][_0x2e07('0x52')]);_0x52bc97[_0x2e07('0x3a')]=_['keys'](_0x2fec6e['query']);_0x52bc97[_0x2e07('0x45')]=_[_0x2e07('0x3b')](_0x52bc97[_0x2e07('0x38')],_0x52bc97[_0x2e07('0x3a')]);_0x5a6a6a[_0x2e07('0x3d')]=_[_0x2e07('0x3b')](_0x52bc97[_0x2e07('0x38')],qs['fields'](_0x2fec6e[_0x2e07('0x3a')][_0x2e07('0x3c')]));_0x5a6a6a[_0x2e07('0x3d')]=_0x5a6a6a[_0x2e07('0x3d')][_0x2e07('0x3e')]?_0x5a6a6a[_0x2e07('0x3d')]:_0x52bc97[_0x2e07('0x38')];_0x5a6a6a[_0x2e07('0x42')]=qs[_0x2e07('0x43')](_0x2fec6e['query'][_0x2e07('0x43')]);_0x5a6a6a[_0x2e07('0x44')]=qs['filters'](_[_0x2e07('0x46')](_0x2fec6e[_0x2e07('0x3a')],_0x52bc97['filters']));if(_0x2fec6e[_0x2e07('0x3a')][_0x2e07('0x47')]){_0x5a6a6a[_0x2e07('0x44')]=_[_0x2e07('0x4c')](_0x5a6a6a[_0x2e07('0x44')],{'$or':_[_0x2e07('0x48')](_0x5a6a6a['attributes'],function(_0x2a75d5){var _0x27efd8={};_0x27efd8[_0x2a75d5]={'$like':'%'+_0x2fec6e[_0x2e07('0x3a')][_0x2e07('0x47')]+'%'};return _0x27efd8;})});}_0x5a6a6a=_[_0x2e07('0x4c')]({},_0x5a6a6a,_0x2fec6e[_0x2e07('0x53')]);return _0x3c019f[_0x2e07('0x58')](_0x5a6a6a);}})[_0x2e07('0x1e')](function(_0x14ddd7){if(_0x14ddd7){_0x45eaef=_0x14ddd7[_0x2e07('0x3e')];if(!_0x2fec6e['query'][_0x2e07('0x3f')](_0x2e07('0x40'))){_0x5a6a6a[_0x2e07('0x41')]=qs[_0x2e07('0x41')](_0x2fec6e[_0x2e07('0x3a')][_0x2e07('0x41')]);_0x5a6a6a[_0x2e07('0x2e')]=qs[_0x2e07('0x2e')](_0x2fec6e[_0x2e07('0x3a')][_0x2e07('0x2e')]);}return _0x3c019f[_0x2e07('0x58')](_0x5a6a6a);}})[_0x2e07('0x1e')](function(_0x179b6a){if(_0x179b6a){return _0x179b6a?{'count':_0x45eaef,'rows':_0x179b6a}:null;}})[_0x2e07('0x1e')](respondWithResult(_0x49aae0,null))[_0x2e07('0x29')](handleError(_0x49aae0,null));};exports[_0x2e07('0x5b')]=function(_0x184469,_0x307ab5,_0x560104){var _0x43e3fa={};var _0x1cecec={};var _0x18dcbf;var _0x1ef1af;return db[_0x2e07('0x37')][_0x2e07('0x59')]({'where':{'id':_0x184469[_0x2e07('0x51')]['id']}})[_0x2e07('0x1e')](handleEntityNotFound(_0x307ab5,null))['then'](function(_0x358739){if(_0x358739){_0x18dcbf=_0x358739;_0x1cecec[_0x2e07('0x38')]=_[_0x2e07('0x39')](db[_0x2e07('0x5a')][_0x2e07('0x52')]);_0x1cecec[_0x2e07('0x3a')]=_['keys'](_0x184469[_0x2e07('0x3a')]);_0x1cecec['filters']=_[_0x2e07('0x3b')](_0x1cecec[_0x2e07('0x38')],_0x1cecec['query']);_0x43e3fa[_0x2e07('0x3d')]=_[_0x2e07('0x3b')](_0x1cecec[_0x2e07('0x38')],qs[_0x2e07('0x3c')](_0x184469[_0x2e07('0x3a')]['fields']));_0x43e3fa[_0x2e07('0x3d')]=_0x43e3fa['attributes']['length']?_0x43e3fa[_0x2e07('0x3d')]:_0x1cecec[_0x2e07('0x38')];_0x43e3fa[_0x2e07('0x42')]=qs[_0x2e07('0x43')](_0x184469[_0x2e07('0x3a')][_0x2e07('0x43')]);_0x43e3fa[_0x2e07('0x44')]=qs[_0x2e07('0x45')](_[_0x2e07('0x46')](_0x184469[_0x2e07('0x3a')],_0x1cecec[_0x2e07('0x45')]));if(_0x184469['query'][_0x2e07('0x47')]){_0x43e3fa[_0x2e07('0x44')]=_['merge'](_0x43e3fa[_0x2e07('0x44')],{'$or':_[_0x2e07('0x48')](_0x43e3fa[_0x2e07('0x3d')],function(_0x35a03e){var _0x7a4e21={};_0x7a4e21[_0x35a03e]={'$like':'%'+_0x184469[_0x2e07('0x3a')][_0x2e07('0x47')]+'%'};return _0x7a4e21;})});}_0x43e3fa=_['merge']({},_0x43e3fa,_0x184469[_0x2e07('0x53')]);return _0x18dcbf['getSubjects'](_0x43e3fa);}})[_0x2e07('0x1e')](function(_0x1fbba0){if(_0x1fbba0){_0x1ef1af=_0x1fbba0[_0x2e07('0x3e')];if(!_0x184469['query'][_0x2e07('0x3f')](_0x2e07('0x40'))){_0x43e3fa[_0x2e07('0x41')]=qs[_0x2e07('0x41')](_0x184469[_0x2e07('0x3a')]['limit']);_0x43e3fa[_0x2e07('0x2e')]=qs[_0x2e07('0x2e')](_0x184469['query']['offset']);}return _0x18dcbf[_0x2e07('0x5b')](_0x43e3fa);}})['then'](function(_0x3631db){if(_0x3631db){return _0x3631db?{'count':_0x1ef1af,'rows':_0x3631db}:null;}})[_0x2e07('0x1e')](respondWithResult(_0x307ab5,null))[_0x2e07('0x29')](handleError(_0x307ab5,null));};exports['getDescriptions']=function(_0x42e7e8,_0x2f379e,_0x3efbf5){var _0x3514cd={};var _0x6b17e5={};var _0x2c0429;var _0x18fc7c;return db['FreshdeskConfiguration'][_0x2e07('0x59')]({'where':{'id':_0x42e7e8[_0x2e07('0x51')]['id']}})[_0x2e07('0x1e')](handleEntityNotFound(_0x2f379e,null))[_0x2e07('0x1e')](function(_0xd223b1){if(_0xd223b1){_0x2c0429=_0xd223b1;_0x6b17e5['model']=_[_0x2e07('0x39')](db['FreshdeskField'][_0x2e07('0x52')]);_0x6b17e5[_0x2e07('0x3a')]=_[_0x2e07('0x39')](_0x42e7e8['query']);_0x6b17e5[_0x2e07('0x45')]=_[_0x2e07('0x3b')](_0x6b17e5[_0x2e07('0x38')],_0x6b17e5[_0x2e07('0x3a')]);_0x3514cd[_0x2e07('0x3d')]=_[_0x2e07('0x3b')](_0x6b17e5[_0x2e07('0x38')],qs['fields'](_0x42e7e8[_0x2e07('0x3a')]['fields']));_0x3514cd['attributes']=_0x3514cd[_0x2e07('0x3d')][_0x2e07('0x3e')]?_0x3514cd[_0x2e07('0x3d')]:_0x6b17e5['model'];_0x3514cd[_0x2e07('0x42')]=qs['sort'](_0x42e7e8[_0x2e07('0x3a')][_0x2e07('0x43')]);_0x3514cd[_0x2e07('0x44')]=qs[_0x2e07('0x45')](_[_0x2e07('0x46')](_0x42e7e8[_0x2e07('0x3a')],_0x6b17e5[_0x2e07('0x45')]));if(_0x42e7e8[_0x2e07('0x3a')]['filter']){_0x3514cd[_0x2e07('0x44')]=_[_0x2e07('0x4c')](_0x3514cd[_0x2e07('0x44')],{'$or':_[_0x2e07('0x48')](_0x3514cd[_0x2e07('0x3d')],function(_0x54b7f6){var _0xd6b3e5={};_0xd6b3e5[_0x54b7f6]={'$like':'%'+_0x42e7e8['query']['filter']+'%'};return _0xd6b3e5;})});}_0x3514cd=_[_0x2e07('0x4c')]({},_0x3514cd,_0x42e7e8['options']);return _0x2c0429[_0x2e07('0x5c')](_0x3514cd);}})[_0x2e07('0x1e')](function(_0x37da01){if(_0x37da01){_0x18fc7c=_0x37da01[_0x2e07('0x3e')];if(!_0x42e7e8[_0x2e07('0x3a')]['hasOwnProperty'](_0x2e07('0x40'))){_0x3514cd[_0x2e07('0x41')]=qs[_0x2e07('0x41')](_0x42e7e8['query'][_0x2e07('0x41')]);_0x3514cd['offset']=qs['offset'](_0x42e7e8[_0x2e07('0x3a')][_0x2e07('0x2e')]);}return _0x2c0429[_0x2e07('0x5c')](_0x3514cd);}})[_0x2e07('0x1e')](function(_0x5e5997){if(_0x5e5997){return _0x5e5997?{'count':_0x18fc7c,'rows':_0x5e5997}:null;}})['then'](respondWithResult(_0x2f379e,null))[_0x2e07('0x29')](handleError(_0x2f379e,null));};exports[_0x2e07('0x5d')]=function(_0x59eab7,_0x192826,_0x55afb6){var _0x5436ea={};var _0x8ca0b7={};var _0x3b3d34;var _0x240b23;return db[_0x2e07('0x37')][_0x2e07('0x59')]({'where':{'id':_0x59eab7[_0x2e07('0x51')]['id']}})[_0x2e07('0x1e')](handleEntityNotFound(_0x192826,null))[_0x2e07('0x1e')](function(_0x3900db){if(_0x3900db){_0x3b3d34=_0x3900db;_0x8ca0b7[_0x2e07('0x38')]=_[_0x2e07('0x39')](db[_0x2e07('0x5e')]['rawAttributes']);_0x8ca0b7[_0x2e07('0x3a')]=_['keys'](_0x59eab7[_0x2e07('0x3a')]);_0x8ca0b7[_0x2e07('0x45')]=_[_0x2e07('0x3b')](_0x8ca0b7[_0x2e07('0x38')],_0x8ca0b7[_0x2e07('0x3a')]);_0x5436ea[_0x2e07('0x3d')]=_[_0x2e07('0x3b')](_0x8ca0b7[_0x2e07('0x38')],qs[_0x2e07('0x3c')](_0x59eab7[_0x2e07('0x3a')][_0x2e07('0x3c')]));_0x5436ea[_0x2e07('0x3d')]=_0x5436ea[_0x2e07('0x3d')][_0x2e07('0x3e')]?_0x5436ea[_0x2e07('0x3d')]:_0x8ca0b7[_0x2e07('0x38')];_0x5436ea[_0x2e07('0x42')]=qs[_0x2e07('0x43')](_0x59eab7[_0x2e07('0x3a')][_0x2e07('0x43')]);_0x5436ea[_0x2e07('0x44')]=qs[_0x2e07('0x45')](_[_0x2e07('0x46')](_0x59eab7['query'],_0x8ca0b7['filters']));if(_0x59eab7[_0x2e07('0x3a')][_0x2e07('0x47')]){_0x5436ea['where']=_[_0x2e07('0x4c')](_0x5436ea[_0x2e07('0x44')],{'$or':_[_0x2e07('0x48')](_0x5436ea[_0x2e07('0x3d')],function(_0x1c14ed){var _0x5ab3ac={};_0x5ab3ac[_0x1c14ed]={'$like':'%'+_0x59eab7[_0x2e07('0x3a')][_0x2e07('0x47')]+'%'};return _0x5ab3ac;})});}_0x5436ea=_[_0x2e07('0x4c')]({},_0x5436ea,_0x59eab7['options']);return _0x3b3d34['getTags'](_0x5436ea);}})[_0x2e07('0x1e')](function(_0x2ca6a0){if(_0x2ca6a0){_0x240b23=_0x2ca6a0['length'];if(!_0x59eab7[_0x2e07('0x3a')][_0x2e07('0x3f')](_0x2e07('0x40'))){_0x5436ea['limit']=qs[_0x2e07('0x41')](_0x59eab7[_0x2e07('0x3a')][_0x2e07('0x41')]);_0x5436ea[_0x2e07('0x2e')]=qs[_0x2e07('0x2e')](_0x59eab7['query'][_0x2e07('0x2e')]);}return _0x3b3d34['getTags'](_0x5436ea);}})[_0x2e07('0x1e')](function(_0x41ad0d){if(_0x41ad0d){return _0x41ad0d?{'count':_0x240b23,'rows':_0x41ad0d}:null;}})[_0x2e07('0x1e')](respondWithResult(_0x192826,null))[_0x2e07('0x29')](handleError(_0x192826,null));};exports['setTags']=function(_0x5bc0af,_0x4c1a8e,_0x57ef04){if(_0x5bc0af[_0x2e07('0x56')]['id']){delete _0x5bc0af[_0x2e07('0x56')]['id'];}return db['FreshdeskConfiguration'][_0x2e07('0x59')]({'where':{'id':_0x5bc0af['params']['id']}})['then'](handleEntityNotFound(_0x4c1a8e,null))['then'](function(_0xf65922){if(_0xf65922){return _0xf65922[_0x2e07('0x5f')](_0x5bc0af[_0x2e07('0x56')]['ids']||[]);}return null;})[_0x2e07('0x1e')](respondWithResult(_0x4c1a8e,null))[_0x2e07('0x29')](handleError(_0x4c1a8e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 8915949..8da6351 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 _0xb6a6=['api','moment','request-promise','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0xb6a6,0x1ed));var _0x6b6a=function(_0x1d5677,_0x342d27){_0x1d5677=_0x1d5677-0x0;var _0x274227=_0xb6a6[_0x1d5677];return _0x274227;};'use strict';var _=require('lodash');var util=require(_0x6b6a('0x0'));var logger=require(_0x6b6a('0x1'))(_0x6b6a('0x2'));var moment=require(_0x6b6a('0x3'));var BPromise=require('bluebird');var rp=require(_0x6b6a('0x4'));var attributes=require(_0x6b6a('0x5'));module[_0x6b6a('0x6')]=function(_0x33600e,_0x5bd7a4){return _0x33600e['define'](_0x6b6a('0x7'),attributes,{'tableName':_0x6b6a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa41a=['moment','bluebird','request-promise','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa41a,0x6b));var _0xaa41=function(_0x459b60,_0x59d8e8){_0x459b60=_0x459b60-0x0;var _0x77496c=_0xa41a[_0x459b60];return _0x77496c;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var attributes=require(_0xaa41('0x6'));module[_0xaa41('0x7')]=function(_0x42896b,_0x251efa){return _0x42896b['define'](_0xaa41('0x8'),attributes,{'tableName':_0xaa41('0x9'),'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 c780b8a..439629c 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 _0x4674=['request\x20sent','stringify','error','message','result','catch','util','moment','randomstring','../../config/logger','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x2ba914,_0x3f321c){var _0x490578=function(_0x2bcc3e){while(--_0x2bcc3e){_0x2ba914['push'](_0x2ba914['shift']());}};_0x490578(++_0x3f321c);}(_0x4674,0x15c));var _0x4467=function(_0x179d19,_0x3f63fc){_0x179d19=_0x179d19-0x0;var _0x1ca47f=_0x4674[_0x179d19];return _0x1ca47f;};'use strict';var _=require('lodash');var util=require(_0x4467('0x0'));var moment=require(_0x4467('0x1'));var BPromise=require('bluebird');var rs=require(_0x4467('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4467('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4467('0x4'));var client=jayson[_0x4467('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4014f0,_0x584865,_0x951674){return new BPromise(function(_0x3b83b9,_0x2a617c){return client[_0x4467('0x6')](_0x4014f0,_0x951674)[_0x4467('0x7')](function(_0x25b927){logger[_0x4467('0x8')](_0x4467('0x9'),_0x584865,'request\x20sent');logger[_0x4467('0xa')](_0x4467('0xb'),_0x584865,_0x4467('0xc'),JSON[_0x4467('0xd')](_0x25b927));if(_0x25b927[_0x4467('0xe')]){if(_0x25b927[_0x4467('0xe')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x584865,_0x25b927[_0x4467('0xe')][_0x4467('0xf')]);return _0x2a617c(_0x25b927['error'][_0x4467('0xf')]);}logger['error'](_0x4467('0x9'),_0x584865,_0x25b927['error']['message']);return _0x3b83b9(_0x25b927['error']['message']);}else{logger['info'](_0x4467('0x9'),_0x584865,'request\x20sent');_0x3b83b9(_0x25b927[_0x4467('0x10')][_0x4467('0xf')]);}})[_0x4467('0x11')](function(_0x30ab64){logger[_0x4467('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x584865,_0x30ab64);_0x2a617c(_0x30ab64);});});} \ No newline at end of file +var _0x9fa1=['http','request','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x502096,_0x10a090){var _0x2a2ebb=function(_0xd70986){while(--_0xd70986){_0x502096['push'](_0x502096['shift']());}};_0x2a2ebb(++_0x10a090);}(_0x9fa1,0xe8));var _0x19fa=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9fa1[_0x2dea24];return _0x309d58;};'use strict';var _=require('lodash');var util=require(_0x19fa('0x0'));var moment=require(_0x19fa('0x1'));var BPromise=require(_0x19fa('0x2'));var rs=require(_0x19fa('0x3'));var fs=require('fs');var Redis=require(_0x19fa('0x4'));var db=require(_0x19fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x19fa('0x6'))('rpc');var config=require(_0x19fa('0x7'));var jayson=require(_0x19fa('0x8'));var client=jayson[_0x19fa('0x9')][_0x19fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x921a18,_0x56e1ee,_0x531392){return new BPromise(function(_0x128bd8,_0x1e0e66){return client[_0x19fa('0xb')](_0x921a18,_0x531392)['then'](function(_0x4020a7){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x56e1ee,_0x19fa('0xc'));logger[_0x19fa('0xd')](_0x19fa('0xe'),_0x56e1ee,_0x19fa('0xc'),JSON[_0x19fa('0xf')](_0x4020a7));if(_0x4020a7['error']){if(_0x4020a7[_0x19fa('0x10')]['code']===0x1f4){logger['error'](_0x19fa('0x11'),_0x56e1ee,_0x4020a7['error'][_0x19fa('0x12')]);return _0x1e0e66(_0x4020a7[_0x19fa('0x10')][_0x19fa('0x12')]);}logger[_0x19fa('0x10')](_0x19fa('0x11'),_0x56e1ee,_0x4020a7['error'][_0x19fa('0x12')]);return _0x128bd8(_0x4020a7[_0x19fa('0x10')]['message']);}else{logger[_0x19fa('0x13')](_0x19fa('0x11'),_0x56e1ee,_0x19fa('0xc'));_0x128bd8(_0x4020a7[_0x19fa('0x14')]['message']);}})[_0x19fa('0x15')](function(_0x6d2e90){logger[_0x19fa('0x10')](_0x19fa('0x11'),_0x56e1ee,_0x6d2e90);_0x1e0e66(_0x6d2e90);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 1e1c27c..4a235a3 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 _0xe975=['show','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xe975,0x1da));var _0x5e97=function(_0x22063c,_0x552c1f){_0x22063c=_0x22063c-0x0;var _0x30ef16=_0xe975[_0x22063c];return _0x30ef16;};'use strict';var multer=require('multer');var util=require(_0x5e97('0x0'));var path=require(_0x5e97('0x1'));var timeout=require(_0x5e97('0x2'));var express=require(_0x5e97('0x3'));var router=express[_0x5e97('0x4')]();var auth=require(_0x5e97('0x5'));var interaction=require(_0x5e97('0x6'));var config=require('../../config/environment');var controller=require(_0x5e97('0x7'));router[_0x5e97('0x8')]('/',auth[_0x5e97('0x9')](),controller[_0x5e97('0xa')]);router['get'](_0x5e97('0xb'),auth[_0x5e97('0x9')](),controller[_0x5e97('0xc')]);router['post']('/',auth[_0x5e97('0x9')](),controller[_0x5e97('0xd')]);router['put'](_0x5e97('0xb'),auth[_0x5e97('0x9')](),controller[_0x5e97('0xe')]);router[_0x5e97('0xf')]('/:id',auth[_0x5e97('0x9')](),controller[_0x5e97('0x10')]);module[_0x5e97('0x11')]=router; \ No newline at end of file +var _0x1780=['put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','/:id','isAuthenticated','show','create'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x1780,0xbf));var _0x0178=function(_0x36598d,_0x355f4c){_0x36598d=_0x36598d-0x0;var _0x559735=_0x1780[_0x36598d];return _0x559735;};'use strict';var multer=require(_0x0178('0x0'));var util=require('util');var path=require(_0x0178('0x1'));var timeout=require(_0x0178('0x2'));var express=require(_0x0178('0x3'));var router=express[_0x0178('0x4')]();var auth=require(_0x0178('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0178('0x6'));var controller=require(_0x0178('0x7'));router[_0x0178('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0178('0x8')](_0x0178('0x9'),auth[_0x0178('0xa')](),controller[_0x0178('0xb')]);router['post']('/',auth[_0x0178('0xa')](),controller[_0x0178('0xc')]);router[_0x0178('0xd')](_0x0178('0x9'),auth[_0x0178('0xa')](),controller['update']);router[_0x0178('0xe')](_0x0178('0x9'),auth[_0x0178('0xa')](),controller[_0x0178('0xf')]);module[_0x0178('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index cf652a2..74092b2 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 _0x96cc=['keyValue','string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable'];(function(_0x14a664,_0x4d175d){var _0x241a1f=function(_0x49cc80){while(--_0x49cc80){_0x14a664['push'](_0x14a664['shift']());}};_0x241a1f(++_0x4d175d);}(_0x96cc,0x16c));var _0xc96c=function(_0x8c32ff,_0x49d75f){_0x8c32ff=_0x8c32ff-0x0;var _0x197b7b=_0x96cc[_0x8c32ff];return _0x197b7b;};'use strict';var Sequelize=require(_0xc96c('0x0'));module['exports']={'type':{'type':Sequelize[_0xc96c('0x1')]('string',_0xc96c('0x2'),_0xc96c('0x3'),_0xc96c('0x4')),'defaultValue':_0xc96c('0x5')},'content':{'type':Sequelize[_0xc96c('0x6')]},'key':{'type':Sequelize[_0xc96c('0x6')]},'keyType':{'type':Sequelize[_0xc96c('0x1')](_0xc96c('0x5'),_0xc96c('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xc96c('0x6')]},'idField':{'type':Sequelize[_0xc96c('0x6')]},'nameField':{'type':Sequelize[_0xc96c('0x6')]},'customField':{'type':Sequelize[_0xc96c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc96c('0x6')]}}; \ No newline at end of file +var _0x6c76=['customVariable','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x6c76,0x184));var _0x66c7=function(_0x4ee642,_0x19132e){_0x4ee642=_0x4ee642-0x0;var _0xae0940=_0x6c76[_0x4ee642];return _0xae0940;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'type':{'type':Sequelize[_0x66c7('0x2')]('string',_0x66c7('0x3'),_0x66c7('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x66c7('0x5')]},'key':{'type':Sequelize[_0x66c7('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x66c7('0x6'),_0x66c7('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x66c7('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x66c7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x66c7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 9b6b89a..046d985 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 _0xa4ce=['body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','VIRTUAL','field','options','FreshdeskField','includeAll','include','findAll','rows','show','params','merge','find','catch','create','update'];(function(_0x3f889c,_0x1c16af){var _0x5edf2a=function(_0x5adbc1){while(--_0x5adbc1){_0x3f889c['push'](_0x3f889c['shift']());}};_0x5edf2a(++_0x1c16af);}(_0xa4ce,0x93));var _0xea4c=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa4ce[_0x40ac5e];return _0x2839d6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xea4c('0x0'));var rimraf=require(_0xea4c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea4c('0x2'));var rp=require(_0xea4c('0x3'));var moment=require(_0xea4c('0x4'));var BPromise=require(_0xea4c('0x5'));var Mustache=require(_0xea4c('0x6'));var util=require(_0xea4c('0x7'));var path=require('path');var sox=require(_0xea4c('0x8'));var csv=require('to-csv');var ejs=require(_0xea4c('0x9'));var fs=require('fs');var _=require(_0xea4c('0xa'));var squel=require(_0xea4c('0xb'));var crypto=require(_0xea4c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xea4c('0xd'));var querystring=require('querystring');var Papa=require(_0xea4c('0xe'));var authService=require(_0xea4c('0xf'));var hardwareService=require(_0xea4c('0x10'));var Redis=require(_0xea4c('0x11'));var qs=require(_0xea4c('0x12'));var logger=require('../../config/logger')(_0xea4c('0x13'));var utils=require(_0xea4c('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53c192,_0x2f62f0){_0x2f62f0=_0x2f62f0||0xcc;return function(_0x35e9ef){if(_0x35e9ef){return _0x53c192['sendStatus'](_0x2f62f0);}return _0x53c192[_0xea4c('0x15')](_0x2f62f0)[_0xea4c('0x16')]();};}function respondWithResult(_0x283a3b,_0x25df80){_0x25df80=_0x25df80||0xc8;return function(_0x56b377){if(_0x56b377){return _0x283a3b[_0xea4c('0x15')](_0x25df80)[_0xea4c('0x17')](_0x56b377);}};}function respondWithFilteredResult(_0x2acd03,_0x5d2264){return function(_0x25c986){if(_0x25c986){var _0x525965=_0x25c986[_0xea4c('0x18')],_0x4359dc=_0x5d2264[_0xea4c('0x19')],_0x1598ee=_0x5d2264[_0xea4c('0x19')]+_0x5d2264[_0xea4c('0x1a')],_0x37b9d6;if(_0x1598ee>=_0x525965){_0x1598ee=_0x525965;_0x37b9d6=0xc8;}else{_0x37b9d6=0xce;}_0x2acd03[_0xea4c('0x15')](_0x37b9d6);return _0x2acd03[_0xea4c('0x1b')](_0xea4c('0x1c'),_0x4359dc+'-'+_0x1598ee+'/'+_0x525965)[_0xea4c('0x17')](_0x25c986);}return null;};}function patchUpdates(_0x3ea181){return function(_0x4ee2b3){try{jsonpatch['apply'](_0x4ee2b3,_0x3ea181,!![]);}catch(_0x51bb3){return BPromise[_0xea4c('0x1d')](_0x51bb3);}return _0x4ee2b3[_0xea4c('0x1e')]();};}function saveUpdates(_0x22b457,_0x5d6d37){return function(_0x53a5d2){if(_0x53a5d2){return _0x53a5d2['update'](_0x22b457)['then'](function(_0x34d142){return _0x34d142;});}return null;};}function removeEntity(_0x190943,_0x4518b3){return function(_0x478175){if(_0x478175){return _0x478175[_0xea4c('0x1f')]()[_0xea4c('0x20')](function(){_0x190943['status'](0xcc)[_0xea4c('0x16')]();});}};}function handleEntityNotFound(_0x227b96,_0x24dfaf){return function(_0x2db141){if(!_0x2db141){_0x227b96[_0xea4c('0x21')](0x194);}return _0x2db141;};}function handleError(_0x645394,_0x50cef3){_0x50cef3=_0x50cef3||0x1f4;return function(_0x46d0f4){logger[_0xea4c('0x22')](_0x46d0f4[_0xea4c('0x23')]);if(_0x46d0f4[_0xea4c('0x24')]){delete _0x46d0f4[_0xea4c('0x24')];}_0x645394[_0xea4c('0x15')](_0x50cef3)[_0xea4c('0x25')](_0x46d0f4);};}exports[_0xea4c('0x26')]=function(_0x27f9c4,_0x2b9d34){var _0x1e1afc={},_0xc59b71={},_0x40d408={'count':0x0,'rows':[]};var _0x5e8e4a=db['FreshdeskField'][_0xea4c('0x27')];_0xc59b71[_0xea4c('0x28')]=_[_0xea4c('0x29')](_0x5e8e4a);_0xc59b71[_0xea4c('0x2a')]=_[_0xea4c('0x29')](_0x27f9c4[_0xea4c('0x2a')]);_0xc59b71[_0xea4c('0x2b')]=_[_0xea4c('0x2c')](_0xc59b71[_0xea4c('0x28')],_0xc59b71[_0xea4c('0x2a')]);_0x1e1afc[_0xea4c('0x2d')]=_[_0xea4c('0x2c')](_0xc59b71[_0xea4c('0x28')],qs[_0xea4c('0x2e')](_0x27f9c4['query']['fields']));_0x1e1afc[_0xea4c('0x2d')]=_0x1e1afc[_0xea4c('0x2d')][_0xea4c('0x2f')]?_0x1e1afc[_0xea4c('0x2d')]:_0xc59b71[_0xea4c('0x28')];if(!_0x27f9c4[_0xea4c('0x2a')][_0xea4c('0x30')](_0xea4c('0x31'))){_0x1e1afc[_0xea4c('0x1a')]=qs[_0xea4c('0x1a')](_0x27f9c4[_0xea4c('0x2a')][_0xea4c('0x1a')]);_0x1e1afc[_0xea4c('0x19')]=qs[_0xea4c('0x19')](_0x27f9c4[_0xea4c('0x2a')][_0xea4c('0x19')]);}_0x1e1afc[_0xea4c('0x32')]=qs[_0xea4c('0x33')](_0x27f9c4[_0xea4c('0x2a')][_0xea4c('0x33')]);_0x1e1afc[_0xea4c('0x34')]=qs[_0xea4c('0x2b')](_[_0xea4c('0x35')](_0x27f9c4[_0xea4c('0x2a')],_0xc59b71[_0xea4c('0x2b')]));if(_0x27f9c4[_0xea4c('0x2a')][_0xea4c('0x36')]){_0x1e1afc['where']=_['merge'](_0x1e1afc[_0xea4c('0x34')],{'$or':_['map'](_0x5e8e4a,function(_0x492cdb){if(_0x492cdb[_0xea4c('0x37')][_0xea4c('0x38')]!==_0xea4c('0x39')){var _0x51a069={};_0x51a069[_0x492cdb[_0xea4c('0x3a')]]={'$like':'%'+_0x27f9c4[_0xea4c('0x2a')]['filter']+'%'};return _0x51a069;}})});}_0x1e1afc=_['merge']({},_0x1e1afc,_0x27f9c4[_0xea4c('0x3b')]);var _0x46e153={'where':_0x1e1afc['where']};return db[_0xea4c('0x3c')][_0xea4c('0x18')](_0x46e153)['then'](function(_0x56b966){_0x40d408[_0xea4c('0x18')]=_0x56b966;if(_0x27f9c4[_0xea4c('0x2a')][_0xea4c('0x3d')]){_0x1e1afc[_0xea4c('0x3e')]=[{'all':!![]}];}return db[_0xea4c('0x3c')][_0xea4c('0x3f')](_0x1e1afc);})[_0xea4c('0x20')](function(_0x360cf1){_0x40d408[_0xea4c('0x40')]=_0x360cf1;return _0x40d408;})[_0xea4c('0x20')](respondWithFilteredResult(_0x2b9d34,_0x1e1afc))['catch'](handleError(_0x2b9d34,null));};exports[_0xea4c('0x41')]=function(_0x548f42,_0x5c7362){var _0x4ea41f={'raw':!![],'where':{'id':_0x548f42[_0xea4c('0x42')]['id']}},_0x2bec96={};_0x2bec96[_0xea4c('0x28')]=_[_0xea4c('0x29')](db[_0xea4c('0x3c')][_0xea4c('0x27')]);_0x2bec96['query']=_[_0xea4c('0x29')](_0x548f42[_0xea4c('0x2a')]);_0x2bec96[_0xea4c('0x2b')]=_['intersection'](_0x2bec96[_0xea4c('0x28')],_0x2bec96[_0xea4c('0x2a')]);_0x4ea41f['attributes']=_[_0xea4c('0x2c')](_0x2bec96['model'],qs[_0xea4c('0x2e')](_0x548f42[_0xea4c('0x2a')]['fields']));_0x4ea41f[_0xea4c('0x2d')]=_0x4ea41f[_0xea4c('0x2d')][_0xea4c('0x2f')]?_0x4ea41f[_0xea4c('0x2d')]:_0x2bec96[_0xea4c('0x28')];if(_0x548f42['query'][_0xea4c('0x3d')]){_0x4ea41f[_0xea4c('0x3e')]=[{'all':!![]}];}_0x4ea41f=_[_0xea4c('0x43')]({},_0x4ea41f,_0x548f42[_0xea4c('0x3b')]);return db[_0xea4c('0x3c')][_0xea4c('0x44')](_0x4ea41f)[_0xea4c('0x20')](handleEntityNotFound(_0x5c7362,null))[_0xea4c('0x20')](respondWithResult(_0x5c7362,null))[_0xea4c('0x45')](handleError(_0x5c7362,null));};exports[_0xea4c('0x46')]=function(_0x248100,_0x1500cd){return db[_0xea4c('0x3c')][_0xea4c('0x46')](_0x248100['body'],{})['then'](respondWithResult(_0x1500cd,0xc9))[_0xea4c('0x45')](handleError(_0x1500cd,null));};exports[_0xea4c('0x47')]=function(_0x2dd880,_0x1fc5f8){if(_0x2dd880[_0xea4c('0x48')]['id']){delete _0x2dd880['body']['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x2dd880[_0xea4c('0x42')]['id']}})[_0xea4c('0x20')](handleEntityNotFound(_0x1fc5f8,null))[_0xea4c('0x20')](saveUpdates(_0x2dd880[_0xea4c('0x48')],null))[_0xea4c('0x20')](respondWithResult(_0x1fc5f8,null))[_0xea4c('0x45')](handleError(_0x1fc5f8,null));};exports['destroy']=function(_0xbdc9db,_0x3d86e2){return db[_0xea4c('0x3c')][_0xea4c('0x44')]({'where':{'id':_0xbdc9db['params']['id']}})['then'](handleEntityNotFound(_0x3d86e2,null))[_0xea4c('0x20')](removeEntity(_0x3d86e2,null))[_0xea4c('0x45')](handleError(_0x3d86e2,null));}; \ No newline at end of file +var _0xe31a=['ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','options','FreshdeskField','include','findAll','show','params','includeAll','find','catch','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe31a,0x87));var _0xae31=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe31a[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0xae31('0x0'));var emlformat=require(_0xae31('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xae31('0x2'));var rp=require(_0xae31('0x3'));var moment=require(_0xae31('0x4'));var BPromise=require(_0xae31('0x5'));var Mustache=require(_0xae31('0x6'));var util=require(_0xae31('0x7'));var path=require(_0xae31('0x8'));var sox=require(_0xae31('0x9'));var csv=require('to-csv');var ejs=require(_0xae31('0xa'));var fs=require('fs');var _=require(_0xae31('0xb'));var squel=require(_0xae31('0xc'));var crypto=require(_0xae31('0xd'));var jsforce=require(_0xae31('0xe'));var deskjs=require(_0xae31('0xf'));var toCsv=require(_0xae31('0x10'));var querystring=require(_0xae31('0x11'));var Papa=require(_0xae31('0x12'));var authService=require(_0xae31('0x13'));var hardwareService=require(_0xae31('0x14'));var Redis=require(_0xae31('0x15'));var qs=require(_0xae31('0x16'));var logger=require(_0xae31('0x17'))('api');var utils=require(_0xae31('0x18'));var config=require(_0xae31('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51c2d9,_0x184630){_0x184630=_0x184630||0xcc;return function(_0x12fdd0){if(_0x12fdd0){return _0x51c2d9[_0xae31('0x1a')](_0x184630);}return _0x51c2d9[_0xae31('0x1b')](_0x184630)[_0xae31('0x1c')]();};}function respondWithResult(_0x7a4fcb,_0x2c4c86){_0x2c4c86=_0x2c4c86||0xc8;return function(_0x4e5d0b){if(_0x4e5d0b){return _0x7a4fcb['status'](_0x2c4c86)[_0xae31('0x1d')](_0x4e5d0b);}};}function respondWithFilteredResult(_0x109ce0,_0x5eb452){return function(_0xb36584){if(_0xb36584){var _0x24e069=_0xb36584[_0xae31('0x1e')],_0xe69711=_0x5eb452[_0xae31('0x1f')],_0x3efcb1=_0x5eb452[_0xae31('0x1f')]+_0x5eb452[_0xae31('0x20')],_0x11d0cd;if(_0x3efcb1>=_0x24e069){_0x3efcb1=_0x24e069;_0x11d0cd=0xc8;}else{_0x11d0cd=0xce;}_0x109ce0[_0xae31('0x1b')](_0x11d0cd);return _0x109ce0[_0xae31('0x21')](_0xae31('0x22'),_0xe69711+'-'+_0x3efcb1+'/'+_0x24e069)[_0xae31('0x1d')](_0xb36584);}return null;};}function patchUpdates(_0x2c3c27){return function(_0x523fb6){try{jsonpatch['apply'](_0x523fb6,_0x2c3c27,!![]);}catch(_0x166783){return BPromise[_0xae31('0x23')](_0x166783);}return _0x523fb6[_0xae31('0x24')]();};}function saveUpdates(_0x301f90,_0x4da5cb){return function(_0x599de3){if(_0x599de3){return _0x599de3[_0xae31('0x25')](_0x301f90)[_0xae31('0x26')](function(_0x463e6b){return _0x463e6b;});}return null;};}function removeEntity(_0x581432,_0x11f80d){return function(_0x3289c1){if(_0x3289c1){return _0x3289c1[_0xae31('0x27')]()[_0xae31('0x26')](function(){_0x581432[_0xae31('0x1b')](0xcc)[_0xae31('0x1c')]();});}};}function handleEntityNotFound(_0x9cdd28,_0x27e55d){return function(_0x296841){if(!_0x296841){_0x9cdd28['sendStatus'](0x194);}return _0x296841;};}function handleError(_0x3c8ca3,_0x337cbb){_0x337cbb=_0x337cbb||0x1f4;return function(_0x5b51a7){logger[_0xae31('0x28')](_0x5b51a7[_0xae31('0x29')]);if(_0x5b51a7[_0xae31('0x2a')]){delete _0x5b51a7['name'];}_0x3c8ca3[_0xae31('0x1b')](_0x337cbb)[_0xae31('0x2b')](_0x5b51a7);};}exports[_0xae31('0x2c')]=function(_0x325770,_0x1b997a){var _0x40b99a={},_0xc6882c={},_0x501431={'count':0x0,'rows':[]};var _0x5c27c3=db['FreshdeskField'][_0xae31('0x2d')];_0xc6882c[_0xae31('0x2e')]=_[_0xae31('0x2f')](_0x5c27c3);_0xc6882c[_0xae31('0x30')]=_['keys'](_0x325770[_0xae31('0x30')]);_0xc6882c[_0xae31('0x31')]=_['intersection'](_0xc6882c[_0xae31('0x2e')],_0xc6882c['query']);_0x40b99a['attributes']=_[_0xae31('0x32')](_0xc6882c[_0xae31('0x2e')],qs[_0xae31('0x33')](_0x325770[_0xae31('0x30')][_0xae31('0x33')]));_0x40b99a['attributes']=_0x40b99a[_0xae31('0x34')][_0xae31('0x35')]?_0x40b99a[_0xae31('0x34')]:_0xc6882c[_0xae31('0x2e')];if(!_0x325770[_0xae31('0x30')][_0xae31('0x36')](_0xae31('0x37'))){_0x40b99a[_0xae31('0x20')]=qs[_0xae31('0x20')](_0x325770[_0xae31('0x30')][_0xae31('0x20')]);_0x40b99a['offset']=qs[_0xae31('0x1f')](_0x325770[_0xae31('0x30')]['offset']);}_0x40b99a[_0xae31('0x38')]=qs[_0xae31('0x39')](_0x325770[_0xae31('0x30')][_0xae31('0x39')]);_0x40b99a[_0xae31('0x3a')]=qs[_0xae31('0x31')](_[_0xae31('0x3b')](_0x325770['query'],_0xc6882c['filters']));if(_0x325770[_0xae31('0x30')]['filter']){_0x40b99a[_0xae31('0x3a')]=_['merge'](_0x40b99a[_0xae31('0x3a')],{'$or':_[_0xae31('0x3c')](_0x5c27c3,function(_0x20ca49){if(_0x20ca49[_0xae31('0x3d')][_0xae31('0x3e')]!==_0xae31('0x3f')){var _0x371755={};_0x371755[_0x20ca49[_0xae31('0x40')]]={'$like':'%'+_0x325770[_0xae31('0x30')][_0xae31('0x41')]+'%'};return _0x371755;}})});}_0x40b99a=_[_0xae31('0x42')]({},_0x40b99a,_0x325770[_0xae31('0x43')]);var _0xb06e2e={'where':_0x40b99a[_0xae31('0x3a')]};return db[_0xae31('0x44')][_0xae31('0x1e')](_0xb06e2e)[_0xae31('0x26')](function(_0x34339e){_0x501431[_0xae31('0x1e')]=_0x34339e;if(_0x325770[_0xae31('0x30')]['includeAll']){_0x40b99a[_0xae31('0x45')]=[{'all':!![]}];}return db['FreshdeskField'][_0xae31('0x46')](_0x40b99a);})[_0xae31('0x26')](function(_0x101341){_0x501431['rows']=_0x101341;return _0x501431;})[_0xae31('0x26')](respondWithFilteredResult(_0x1b997a,_0x40b99a))['catch'](handleError(_0x1b997a,null));};exports[_0xae31('0x47')]=function(_0x286429,_0xec4d52){var _0x404431={'raw':!![],'where':{'id':_0x286429[_0xae31('0x48')]['id']}},_0x15cb80={};_0x15cb80[_0xae31('0x2e')]=_[_0xae31('0x2f')](db[_0xae31('0x44')][_0xae31('0x2d')]);_0x15cb80[_0xae31('0x30')]=_[_0xae31('0x2f')](_0x286429[_0xae31('0x30')]);_0x15cb80['filters']=_['intersection'](_0x15cb80[_0xae31('0x2e')],_0x15cb80[_0xae31('0x30')]);_0x404431[_0xae31('0x34')]=_[_0xae31('0x32')](_0x15cb80[_0xae31('0x2e')],qs[_0xae31('0x33')](_0x286429[_0xae31('0x30')][_0xae31('0x33')]));_0x404431[_0xae31('0x34')]=_0x404431[_0xae31('0x34')]['length']?_0x404431[_0xae31('0x34')]:_0x15cb80[_0xae31('0x2e')];if(_0x286429[_0xae31('0x30')][_0xae31('0x49')]){_0x404431[_0xae31('0x45')]=[{'all':!![]}];}_0x404431=_[_0xae31('0x42')]({},_0x404431,_0x286429[_0xae31('0x43')]);return db['FreshdeskField'][_0xae31('0x4a')](_0x404431)[_0xae31('0x26')](handleEntityNotFound(_0xec4d52,null))[_0xae31('0x26')](respondWithResult(_0xec4d52,null))[_0xae31('0x4b')](handleError(_0xec4d52,null));};exports[_0xae31('0x4c')]=function(_0x40157a,_0x688a7f){return db[_0xae31('0x44')][_0xae31('0x4c')](_0x40157a[_0xae31('0x4d')],{})['then'](respondWithResult(_0x688a7f,0xc9))[_0xae31('0x4b')](handleError(_0x688a7f,null));};exports['update']=function(_0x226d54,_0x5eceb5){if(_0x226d54[_0xae31('0x4d')]['id']){delete _0x226d54[_0xae31('0x4d')]['id'];}return db['FreshdeskField'][_0xae31('0x4a')]({'where':{'id':_0x226d54[_0xae31('0x48')]['id']}})[_0xae31('0x26')](handleEntityNotFound(_0x5eceb5,null))[_0xae31('0x26')](saveUpdates(_0x226d54['body'],null))['then'](respondWithResult(_0x5eceb5,null))[_0xae31('0x4b')](handleError(_0x5eceb5,null));};exports[_0xae31('0x27')]=function(_0x19b8fc,_0x2dcbe8){return db[_0xae31('0x44')][_0xae31('0x4a')]({'where':{'id':_0x19b8fc['params']['id']}})[_0xae31('0x26')](handleEntityNotFound(_0x2dcbe8,null))[_0xae31('0x26')](removeEntity(_0x2dcbe8,null))[_0xae31('0x4b')](handleError(_0x2dcbe8,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 2daa2ef..c01fa4d 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 _0xe657=['exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','lodash','util','../../config/logger','bluebird','request-promise','./intFreshdeskField.attributes'];(function(_0xfb61f0,_0x69e563){var _0x482683=function(_0xe9d4f9){while(--_0xe9d4f9){_0xfb61f0['push'](_0xfb61f0['shift']());}};_0x482683(++_0x69e563);}(_0xe657,0xaa));var _0x7e65=function(_0x3c9472,_0x4a6e8d){_0x3c9472=_0x3c9472-0x0;var _0x4bae7c=_0xe657[_0x3c9472];return _0x4bae7c;};'use strict';var _=require(_0x7e65('0x0'));var util=require(_0x7e65('0x1'));var logger=require(_0x7e65('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7e65('0x3'));var rp=require(_0x7e65('0x4'));var attributes=require(_0x7e65('0x5'));module[_0x7e65('0x6')]=function(_0x5d8c1c,_0x265a40){return _0x5d8c1c[_0x7e65('0x7')](_0x7e65('0x8'),attributes,{'tableName':_0x7e65('0x9'),'paranoid':![],'indexes':[{'name':_0x7e65('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ddd=['int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','bluebird','request-promise','exports'];(function(_0x5b8f44,_0x3e5100){var _0x482868=function(_0x46efbb){while(--_0x46efbb){_0x5b8f44['push'](_0x5b8f44['shift']());}};_0x482868(++_0x3e5100);}(_0x0ddd,0x93));var _0xd0dd=function(_0x2a5588,_0x4a996a){_0x2a5588=_0x2a5588-0x0;var _0x5c50d0=_0x0ddd[_0x2a5588];return _0x5c50d0;};'use strict';var _=require(_0xd0dd('0x0'));var util=require(_0xd0dd('0x1'));var logger=require(_0xd0dd('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd0dd('0x3'));var rp=require(_0xd0dd('0x4'));var attributes=require('./intFreshdeskField.attributes');module[_0xd0dd('0x5')]=function(_0x369449,_0x1b2227){return _0x369449['define']('FreshdeskField',attributes,{'tableName':_0xd0dd('0x6'),'paranoid':![],'indexes':[{'name':_0xd0dd('0x7'),'fields':['idField',_0xd0dd('0x8')],'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 d11d5ca..eedc41b 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 _0xd13e=['FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x180a94,_0x1306db){var _0x1dd98c=function(_0xb0109f){while(--_0xb0109f){_0x180a94['push'](_0x180a94['shift']());}};_0x1dd98c(++_0x1306db);}(_0xd13e,0x193));var _0xed13=function(_0x2f1072,_0x543d25){_0x2f1072=_0x2f1072-0x0;var _0x22ebc9=_0xd13e[_0x2f1072];return _0x22ebc9;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var moment=require(_0xed13('0x2'));var BPromise=require(_0xed13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed13('0x5'));var logger=require('../../config/logger')(_0xed13('0x6'));var config=require(_0xed13('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x95ff4c,_0x134929,_0xab0fff){return new BPromise(function(_0x3b3984,_0x369798){return client[_0xed13('0x8')](_0x95ff4c,_0xab0fff)[_0xed13('0x9')](function(_0x9bc191){logger[_0xed13('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x134929,_0xed13('0xb'));logger[_0xed13('0xc')](_0xed13('0xd'),_0x134929,_0xed13('0xb'),JSON[_0xed13('0xe')](_0x9bc191));if(_0x9bc191['error']){if(_0x9bc191[_0xed13('0xf')][_0xed13('0x10')]===0x1f4){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x9bc191[_0xed13('0xf')][_0xed13('0x12')]);return _0x369798(_0x9bc191['error'][_0xed13('0x12')]);}logger['error'](_0xed13('0x11'),_0x134929,_0x9bc191['error'][_0xed13('0x12')]);return _0x3b3984(_0x9bc191['error'][_0xed13('0x12')]);}else{logger['info'](_0xed13('0x11'),_0x134929,_0xed13('0xb'));_0x3b3984(_0x9bc191[_0xed13('0x13')][_0xed13('0x12')]);}})[_0xed13('0x14')](function(_0x1f8585){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x1f8585);_0x369798(_0x1f8585);});});} \ No newline at end of file +var _0x402f=['http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','message','error','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x1038fe,_0xf39a26){var _0x33b526=function(_0x33d712){while(--_0x33d712){_0x1038fe['push'](_0x1038fe['shift']());}};_0x33b526(++_0xf39a26);}(_0x402f,0x6f));var _0xf402=function(_0x1bbe08,_0x1421f3){_0x1bbe08=_0x1bbe08-0x0;var _0x58c034=_0x402f[_0x1bbe08];return _0x58c034;};'use strict';var _=require(_0xf402('0x0'));var util=require('util');var moment=require(_0xf402('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf402('0x2'));var db=require(_0xf402('0x3'))['db'];var utils=require(_0xf402('0x4'));var logger=require('../../config/logger')(_0xf402('0x5'));var config=require('../../config/environment');var jayson=require(_0xf402('0x6'));var client=jayson[_0xf402('0x7')][_0xf402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a8774,_0xa1b27d,_0x55c515){return new BPromise(function(_0x4d1771,_0x2f0ffe){return client[_0xf402('0x9')](_0x2a8774,_0x55c515)[_0xf402('0xa')](function(_0xdc18e0){logger[_0xf402('0xb')](_0xf402('0xc'),_0xa1b27d,_0xf402('0xd'));logger[_0xf402('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0xa1b27d,_0xf402('0xd'),JSON['stringify'](_0xdc18e0));if(_0xdc18e0['error']){if(_0xdc18e0['error']['code']===0x1f4){logger['error'](_0xf402('0xc'),_0xa1b27d,_0xdc18e0['error']['message']);return _0x2f0ffe(_0xdc18e0['error'][_0xf402('0xf')]);}logger['error'](_0xf402('0xc'),_0xa1b27d,_0xdc18e0[_0xf402('0x10')][_0xf402('0xf')]);return _0x4d1771(_0xdc18e0[_0xf402('0x10')]['message']);}else{logger[_0xf402('0xb')]('FreshdeskField,\x20%s,\x20%s',_0xa1b27d,_0xf402('0xd'));_0x4d1771(_0xdc18e0['result']['message']);}})['catch'](function(_0xb45d00){logger[_0xf402('0x10')](_0xf402('0xc'),_0xa1b27d,_0xb45d00);_0x2f0ffe(_0xb45d00);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index e5d988d..43a48a2 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 _0x481c=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','post','create','addConfiguration','put','destroy','multer'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x481c,0x18e));var _0xc481=function(_0x44f9e3,_0x51faec){_0x44f9e3=_0x44f9e3-0x0;var _0x356274=_0x481c[_0x44f9e3];return _0x356274;};'use strict';var multer=require(_0xc481('0x0'));var util=require(_0xc481('0x1'));var path=require(_0xc481('0x2'));var timeout=require('connect-timeout');var express=require(_0xc481('0x3'));var router=express[_0xc481('0x4')]();var auth=require(_0xc481('0x5'));var interaction=require(_0xc481('0x6'));var config=require(_0xc481('0x7'));var controller=require('./intSalesforceAccount.controller');router[_0xc481('0x8')]('/',auth[_0xc481('0x9')](),controller[_0xc481('0xa')]);router[_0xc481('0x8')](_0xc481('0xb'),auth[_0xc481('0x9')](),controller['show']);router['get'](_0xc481('0xc'),auth[_0xc481('0x9')](),controller[_0xc481('0xd')]);router[_0xc481('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xc481('0xe')]('/',auth['isAuthenticated'](),controller[_0xc481('0xf')]);router['post']('/:id/configurations',auth[_0xc481('0x9')](),controller[_0xc481('0x10')]);router[_0xc481('0x11')](_0xc481('0xb'),auth[_0xc481('0x9')](),controller['update']);router['delete'](_0xc481('0xb'),auth[_0xc481('0x9')](),controller[_0xc481('0x12')]);module['exports']=router; \ No newline at end of file +var _0x17ae=['create','/:id/configurations','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x504e15,_0xf4258b){var _0x52bc7f=function(_0x1466aa){while(--_0x1466aa){_0x504e15['push'](_0x504e15['shift']());}};_0x52bc7f(++_0xf4258b);}(_0x17ae,0x8c));var _0xe17a=function(_0x26d234,_0x40b2c3){_0x26d234=_0x26d234-0x0;var _0x18428d=_0x17ae[_0x26d234];return _0x18428d;};'use strict';var multer=require(_0xe17a('0x0'));var util=require(_0xe17a('0x1'));var path=require(_0xe17a('0x2'));var timeout=require(_0xe17a('0x3'));var express=require('express');var router=express[_0xe17a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe17a('0x5'));var config=require('../../config/environment');var controller=require('./intSalesforceAccount.controller');router[_0xe17a('0x6')]('/',auth[_0xe17a('0x7')](),controller[_0xe17a('0x8')]);router[_0xe17a('0x6')]('/:id',auth[_0xe17a('0x7')](),controller[_0xe17a('0x9')]);router['get']('/:id/configurations',auth[_0xe17a('0x7')](),controller[_0xe17a('0xa')]);router[_0xe17a('0x6')](_0xe17a('0xb'),auth[_0xe17a('0x7')](),controller[_0xe17a('0xc')]);router[_0xe17a('0xd')]('/',auth['isAuthenticated'](),controller[_0xe17a('0xe')]);router[_0xe17a('0xd')](_0xe17a('0xf'),auth[_0xe17a('0x7')](),controller['addConfiguration']);router[_0xe17a('0x10')](_0xe17a('0x11'),auth[_0xe17a('0x7')](),controller[_0xe17a('0x12')]);router[_0xe17a('0x13')](_0xe17a('0x11'),auth[_0xe17a('0x7')](),controller[_0xe17a('0x14')]);module[_0xe17a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index c178a25..0d056b8 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 _0xd432=['sequelize','exports','STRING','username','integrationTab'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xd432,0x17c));var _0x2d43=function(_0x942ff9,_0x4db791){_0x942ff9=_0x942ff9-0x0;var _0x5defb5=_0xd432[_0x942ff9];return _0x5defb5;};'use strict';var Sequelize=require(_0x2d43('0x0'));module[_0x2d43('0x1')]={'name':{'type':Sequelize[_0x2d43('0x2')]},'description':{'type':Sequelize[_0x2d43('0x2')]},'username':{'type':Sequelize[_0x2d43('0x2')],'unique':_0x2d43('0x3')},'remoteUri':{'type':Sequelize[_0x2d43('0x2')]},'password':{'type':Sequelize[_0x2d43('0x2')]},'clientId':{'type':Sequelize[_0x2d43('0x2')]},'clientSecret':{'type':Sequelize[_0x2d43('0x2')]},'securityToken':{'type':Sequelize[_0x2d43('0x2')]},'serverUrl':{'type':Sequelize[_0x2d43('0x2')]},'type':{'type':Sequelize['ENUM'](_0x2d43('0x4'),'newTab'),'defaultValue':_0x2d43('0x4')}}; \ No newline at end of file +var _0xd62e=['sequelize','exports','STRING','username','integrationTab','newTab'];(function(_0x149240,_0x40ccce){var _0x12d260=function(_0x5729fa){while(--_0x5729fa){_0x149240['push'](_0x149240['shift']());}};_0x12d260(++_0x40ccce);}(_0xd62e,0xe4));var _0xed62=function(_0x43f936,_0x1c6af5){_0x43f936=_0x43f936-0x0;var _0x5e9285=_0xd62e[_0x43f936];return _0x5e9285;};'use strict';var Sequelize=require(_0xed62('0x0'));module[_0xed62('0x1')]={'name':{'type':Sequelize[_0xed62('0x2')]},'description':{'type':Sequelize[_0xed62('0x2')]},'username':{'type':Sequelize[_0xed62('0x2')],'unique':_0xed62('0x3')},'remoteUri':{'type':Sequelize[_0xed62('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xed62('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xed62('0x4'),_0xed62('0x5')),'defaultValue':_0xed62('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 861a8b5..2fce626 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 _0xda2d=['value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','stack','name','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','map','type','key','field','filter','options','SalesforceAccount','then','includeAll','include','findAll','params','rawAttributes','merge','find','create','body','findOne','SalesforceConfiguration','sort','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','Connection','login','concat','Task','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Type','remove','custom','includes','label','picklistValues'];(function(_0x38dafd,_0x544c9c){var _0x3ab48e=function(_0x24a290){while(--_0x24a290){_0x38dafd['push'](_0x38dafd['shift']());}};_0x3ab48e(++_0x544c9c);}(_0xda2d,0x102));var _0xdda2=function(_0x3caef3,_0x192370){_0x3caef3=_0x3caef3-0x0;var _0x1ca8bf=_0xda2d[_0x3caef3];return _0x1ca8bf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdda2('0x0'));var rimraf=require(_0xdda2('0x1'));var zipdir=require(_0xdda2('0x2'));var jsonpatch=require(_0xdda2('0x3'));var rp=require(_0xdda2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdda2('0x5'));var path=require(_0xdda2('0x6'));var sox=require(_0xdda2('0x7'));var csv=require(_0xdda2('0x8'));var ejs=require(_0xdda2('0x9'));var fs=require('fs');var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var authService=require('../../components/auth/service');var hardwareService=require(_0xdda2('0x11'));var Redis=require(_0xdda2('0x12'));var qs=require(_0xdda2('0x13'));var logger=require(_0xdda2('0x14'))(_0xdda2('0x15'));var utils=require(_0xdda2('0x16'));var config=require(_0xdda2('0x17'));var db=require(_0xdda2('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client'][_0xdda2('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x320f73,_0x3518b9,_0x1503a7,_0x2e4132){return new BPromise(function(_0x475222,_0x3490f1){var _0x4df902=_0x2e4132||client;return _0x4df902[_0xdda2('0x1a')](_0x320f73,_0x1503a7)['then'](function(_0xbef148){logger[_0xdda2('0x1b')](_0xdda2('0x1c'),_0x3518b9,_0xdda2('0x1d'));logger[_0xdda2('0x1e')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x3518b9,'request\x20sent',JSON[_0xdda2('0x1f')](_0xbef148));if(_0xbef148['error']){if(_0xbef148[_0xdda2('0x20')][_0xdda2('0x21')]===0x1f4){logger[_0xdda2('0x20')](_0xdda2('0x1c'),_0x3518b9,_0xbef148[_0xdda2('0x20')][_0xdda2('0x22')]);return _0x3490f1(_0xbef148[_0xdda2('0x20')][_0xdda2('0x22')]);}logger[_0xdda2('0x20')](_0xdda2('0x1c'),_0x3518b9,_0xbef148[_0xdda2('0x20')][_0xdda2('0x22')]);return _0x475222(_0xbef148['error'][_0xdda2('0x22')]);}else{logger['info'](_0xdda2('0x1c'),_0x3518b9,_0xdda2('0x1d'));_0x475222(_0xbef148[_0xdda2('0x23')]['message']);}})[_0xdda2('0x24')](function(_0x5a9bb8){logger[_0xdda2('0x20')](_0xdda2('0x1c'),_0x3518b9,_0x5a9bb8);_0x3490f1(_0x5a9bb8);});});}function respondWithStatusCode(_0x4ac3eb,_0x144f1e){_0x144f1e=_0x144f1e||0xcc;return function(_0xfda248){if(_0xfda248){return _0x4ac3eb[_0xdda2('0x25')](_0x144f1e);}return _0x4ac3eb[_0xdda2('0x26')](_0x144f1e)[_0xdda2('0x27')]();};}function respondWithResult(_0x5739ad,_0x38cdf){_0x38cdf=_0x38cdf||0xc8;return function(_0x4be5ea){if(_0x4be5ea){return _0x5739ad[_0xdda2('0x26')](_0x38cdf)[_0xdda2('0x28')](_0x4be5ea);}};}function respondWithFilteredResult(_0x5436d1,_0x4e97dc){return function(_0x28da54){if(_0x28da54){var _0x4567e7=_0x28da54[_0xdda2('0x29')],_0x2e8591=_0x4e97dc[_0xdda2('0x2a')],_0x5e9e74=_0x4e97dc[_0xdda2('0x2a')]+_0x4e97dc[_0xdda2('0x2b')],_0x90d919;if(_0x5e9e74>=_0x4567e7){_0x5e9e74=_0x4567e7;_0x90d919=0xc8;}else{_0x90d919=0xce;}_0x5436d1[_0xdda2('0x26')](_0x90d919);return _0x5436d1['set'](_0xdda2('0x2c'),_0x2e8591+'-'+_0x5e9e74+'/'+_0x4567e7)[_0xdda2('0x28')](_0x28da54);}return null;};}function patchUpdates(_0x53acb5){return function(_0x45e800){try{jsonpatch[_0xdda2('0x2d')](_0x45e800,_0x53acb5,!![]);}catch(_0x3b18b8){return BPromise[_0xdda2('0x2e')](_0x3b18b8);}return _0x45e800['save']();};}function saveUpdates(_0x129eba,_0x5e107f){return function(_0x4b19b7){if(_0x4b19b7){return _0x4b19b7[_0xdda2('0x2f')](_0x129eba)['then'](function(_0x2b8cd6){return _0x2b8cd6;});}return null;};}function removeEntity(_0x55809a,_0x53ff76){return function(_0x510b7b){if(_0x510b7b){return _0x510b7b[_0xdda2('0x30')]()['then'](function(){_0x55809a[_0xdda2('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cba58,_0x52a509){return function(_0x4637c1){if(!_0x4637c1){_0x5cba58[_0xdda2('0x25')](0x194);}return _0x4637c1;};}function handleError(_0xca6046,_0x2fd592){_0x2fd592=_0x2fd592||0x1f4;return function(_0x12e96d){logger[_0xdda2('0x20')](_0x12e96d[_0xdda2('0x31')]);if(_0x12e96d[_0xdda2('0x32')]){delete _0x12e96d[_0xdda2('0x32')];}_0xca6046[_0xdda2('0x26')](_0x2fd592)['send'](_0x12e96d);};}exports[_0xdda2('0x33')]=function(_0x4212da,_0x2f8674){var _0x3d510c={},_0x392373={},_0x33c4b0={'count':0x0,'rows':[]};var _0x45d3ad=db['SalesforceAccount']['rawAttributes'];_0x392373[_0xdda2('0x34')]=_[_0xdda2('0x35')](_0x45d3ad);_0x392373[_0xdda2('0x36')]=_['keys'](_0x4212da['query']);_0x392373[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x392373[_0xdda2('0x34')],_0x392373[_0xdda2('0x36')]);_0x3d510c[_0xdda2('0x39')]=_['intersection'](_0x392373[_0xdda2('0x34')],qs[_0xdda2('0x3a')](_0x4212da['query']['fields']));_0x3d510c[_0xdda2('0x39')]=_0x3d510c[_0xdda2('0x39')][_0xdda2('0x3b')]?_0x3d510c[_0xdda2('0x39')]:_0x392373[_0xdda2('0x34')];if(!_0x4212da['query'][_0xdda2('0x3c')](_0xdda2('0x3d'))){_0x3d510c[_0xdda2('0x2b')]=qs[_0xdda2('0x2b')](_0x4212da['query']['limit']);_0x3d510c[_0xdda2('0x2a')]=qs[_0xdda2('0x2a')](_0x4212da[_0xdda2('0x36')]['offset']);}_0x3d510c[_0xdda2('0x3e')]=qs['sort'](_0x4212da[_0xdda2('0x36')]['sort']);_0x3d510c[_0xdda2('0x3f')]=qs[_0xdda2('0x37')](_[_0xdda2('0x40')](_0x4212da[_0xdda2('0x36')],_0x392373['filters']));if(_0x4212da[_0xdda2('0x36')]['filter']){_0x3d510c[_0xdda2('0x3f')]=_['merge'](_0x3d510c[_0xdda2('0x3f')],{'$or':_[_0xdda2('0x41')](_0x45d3ad,function(_0x153acf){if(_0x153acf[_0xdda2('0x42')][_0xdda2('0x43')]!=='VIRTUAL'){var _0x1e29dc={};_0x1e29dc[_0x153acf[_0xdda2('0x44')]]={'$like':'%'+_0x4212da['query'][_0xdda2('0x45')]+'%'};return _0x1e29dc;}})});}_0x3d510c=_['merge']({},_0x3d510c,_0x4212da[_0xdda2('0x46')]);var _0x45c802={'where':_0x3d510c[_0xdda2('0x3f')]};return db[_0xdda2('0x47')][_0xdda2('0x29')](_0x45c802)[_0xdda2('0x48')](function(_0x550351){_0x33c4b0[_0xdda2('0x29')]=_0x550351;if(_0x4212da[_0xdda2('0x36')][_0xdda2('0x49')]){_0x3d510c[_0xdda2('0x4a')]=[{'all':!![]}];}return db[_0xdda2('0x47')][_0xdda2('0x4b')](_0x3d510c);})['then'](function(_0x5cb8b5){_0x33c4b0['rows']=_0x5cb8b5;return _0x33c4b0;})[_0xdda2('0x48')](respondWithFilteredResult(_0x2f8674,_0x3d510c))[_0xdda2('0x24')](handleError(_0x2f8674,null));};exports['show']=function(_0x2c41dc,_0x18f229){var _0x22a99e={'raw':![],'where':{'id':_0x2c41dc[_0xdda2('0x4c')]['id']}},_0x5e56a8={};_0x5e56a8[_0xdda2('0x34')]=_['keys'](db['SalesforceAccount'][_0xdda2('0x4d')]);_0x5e56a8['query']=_[_0xdda2('0x35')](_0x2c41dc['query']);_0x5e56a8[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x5e56a8['model'],_0x5e56a8['query']);_0x22a99e[_0xdda2('0x39')]=_[_0xdda2('0x38')](_0x5e56a8[_0xdda2('0x34')],qs[_0xdda2('0x3a')](_0x2c41dc['query'][_0xdda2('0x3a')]));_0x22a99e[_0xdda2('0x39')]=_0x22a99e[_0xdda2('0x39')][_0xdda2('0x3b')]?_0x22a99e[_0xdda2('0x39')]:_0x5e56a8['model'];if(_0x2c41dc[_0xdda2('0x36')][_0xdda2('0x49')]){_0x22a99e['include']=[{'all':!![]}];}_0x22a99e=_[_0xdda2('0x4e')]({},_0x22a99e,_0x2c41dc[_0xdda2('0x46')]);return db[_0xdda2('0x47')][_0xdda2('0x4f')](_0x22a99e)[_0xdda2('0x48')](handleEntityNotFound(_0x18f229,null))[_0xdda2('0x48')](respondWithResult(_0x18f229,null))['catch'](handleError(_0x18f229,null));};exports[_0xdda2('0x50')]=function(_0x4a9814,_0x361038){return db['SalesforceAccount'][_0xdda2('0x50')](_0x4a9814['body'],{})[_0xdda2('0x48')](respondWithResult(_0x361038,0xc9))[_0xdda2('0x24')](handleError(_0x361038,null));};exports[_0xdda2('0x2f')]=function(_0x119f70,_0xfc7dd7){if(_0x119f70[_0xdda2('0x51')]['id']){delete _0x119f70[_0xdda2('0x51')]['id'];}return db[_0xdda2('0x47')]['find']({'where':{'id':_0x119f70[_0xdda2('0x4c')]['id']}})[_0xdda2('0x48')](handleEntityNotFound(_0xfc7dd7,null))[_0xdda2('0x48')](saveUpdates(_0x119f70['body'],null))[_0xdda2('0x48')](respondWithResult(_0xfc7dd7,null))[_0xdda2('0x24')](handleError(_0xfc7dd7,null));};exports['destroy']=function(_0x3868e7,_0x5d9437){return db[_0xdda2('0x47')][_0xdda2('0x4f')]({'where':{'id':_0x3868e7[_0xdda2('0x4c')]['id']}})[_0xdda2('0x48')](handleEntityNotFound(_0x5d9437,null))[_0xdda2('0x48')](removeEntity(_0x5d9437,null))['catch'](handleError(_0x5d9437,null));};exports['getConfigurations']=function(_0x5c2cb2,_0x1672ce,_0x1a940b){var _0x5984f2={};var _0x44637d={};var _0x126977;var _0x23e55b;return db['SalesforceAccount'][_0xdda2('0x52')]({'where':{'id':_0x5c2cb2[_0xdda2('0x4c')]['id']}})[_0xdda2('0x48')](handleEntityNotFound(_0x1672ce,null))['then'](function(_0x2b2c1d){if(_0x2b2c1d){_0x126977=_0x2b2c1d;_0x44637d[_0xdda2('0x34')]=_[_0xdda2('0x35')](db[_0xdda2('0x53')]['rawAttributes']);_0x44637d[_0xdda2('0x36')]=_['keys'](_0x5c2cb2['query']);_0x44637d['filters']=_[_0xdda2('0x38')](_0x44637d[_0xdda2('0x34')],_0x44637d[_0xdda2('0x36')]);_0x5984f2[_0xdda2('0x39')]=_[_0xdda2('0x38')](_0x44637d[_0xdda2('0x34')],qs[_0xdda2('0x3a')](_0x5c2cb2[_0xdda2('0x36')][_0xdda2('0x3a')]));_0x5984f2[_0xdda2('0x39')]=_0x5984f2[_0xdda2('0x39')]['length']?_0x5984f2[_0xdda2('0x39')]:_0x44637d[_0xdda2('0x34')];_0x5984f2[_0xdda2('0x3e')]=qs[_0xdda2('0x54')](_0x5c2cb2[_0xdda2('0x36')][_0xdda2('0x54')]);_0x5984f2[_0xdda2('0x3f')]=qs['filters'](_[_0xdda2('0x40')](_0x5c2cb2[_0xdda2('0x36')],_0x44637d[_0xdda2('0x37')]));if(_0x5c2cb2[_0xdda2('0x36')][_0xdda2('0x45')]){_0x5984f2['where']=_[_0xdda2('0x4e')](_0x5984f2[_0xdda2('0x3f')],{'$or':_[_0xdda2('0x41')](_0x5984f2[_0xdda2('0x39')],function(_0x21d0e4){var _0x4a6f28={};_0x4a6f28[_0x21d0e4]={'$like':'%'+_0x5c2cb2[_0xdda2('0x36')][_0xdda2('0x45')]+'%'};return _0x4a6f28;})});}_0x5984f2=_[_0xdda2('0x4e')]({},_0x5984f2,_0x5c2cb2[_0xdda2('0x46')]);return _0x126977[_0xdda2('0x55')](_0x5984f2);}})['then'](function(_0x29dd19){if(_0x29dd19){_0x23e55b=_0x29dd19[_0xdda2('0x3b')];if(!_0x5c2cb2[_0xdda2('0x36')]['hasOwnProperty'](_0xdda2('0x3d'))){_0x5984f2['limit']=qs[_0xdda2('0x2b')](_0x5c2cb2[_0xdda2('0x36')][_0xdda2('0x2b')]);_0x5984f2['offset']=qs[_0xdda2('0x2a')](_0x5c2cb2[_0xdda2('0x36')]['offset']);}return _0x126977[_0xdda2('0x55')](_0x5984f2);}})['then'](function(_0x3d645b){if(_0x3d645b){return _0x3d645b?{'count':_0x23e55b,'rows':_0x3d645b}:null;}})[_0xdda2('0x48')](respondWithResult(_0x1672ce,null))[_0xdda2('0x24')](handleError(_0x1672ce,null));};exports[_0xdda2('0x56')]=function(_0x10d1de,_0x4a061a,_0x586ca1){if(_0x10d1de[_0xdda2('0x51')]['id']){delete _0x10d1de[_0xdda2('0x51')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x10d1de[_0xdda2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4a061a,null))[_0xdda2('0x48')](function(_0x1a33ba){if(_0x1a33ba){_0x10d1de['body'][_0xdda2('0x57')]=_0x1a33ba['id'];_0x10d1de[_0xdda2('0x51')][_0xdda2('0x58')]=integrations[_0xdda2('0x59')](_0x10d1de[_0xdda2('0x51')][_0xdda2('0x5a')],_0x10d1de['body'][_0xdda2('0x42')]);_0x10d1de[_0xdda2('0x51')][_0xdda2('0x5b')]=integrations['getDescriptions'](_0x10d1de[_0xdda2('0x51')][_0xdda2('0x5a')],_0x10d1de['body']['type']);return db[_0xdda2('0x53')][_0xdda2('0x50')](_0x10d1de[_0xdda2('0x51')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xdda2('0x5c')],'as':'Descriptions'}]});}return null;})[_0xdda2('0x48')](respondWithResult(_0x4a061a,null))[_0xdda2('0x24')](handleError(_0x4a061a,null));};exports[_0xdda2('0x5d')]=function(_0x12fd67,_0x597b09,_0x29006f){var _0x58d1ad;var _0x5170b7='';return db[_0xdda2('0x47')]['findOne']({'where':{'id':_0x12fd67[_0xdda2('0x4c')]['id']},'attributes':['id',_0xdda2('0x5e'),_0xdda2('0x5f'),_0xdda2('0x60'),_0xdda2('0x61'),_0xdda2('0x62'),_0xdda2('0x63')]})[_0xdda2('0x48')](handleEntityNotFound(_0x597b09,null))[_0xdda2('0x48')](function(_0x495a28){if(_0x495a28){_0x5170b7=_0x495a28[_0xdda2('0x5e')];var _0x40d931=_0x5170b7[_0xdda2('0x64')](-0x1);if(_0x40d931==='/'){_0x5170b7=_0x5170b7[_0xdda2('0x65')](0x0,_0x5170b7['lastIndexOf'](_0x40d931));}_0x58d1ad=new jsforce[(_0xdda2('0x66'))]({'oauth2':{'loginUrl':_0x5170b7,'clientId':_0x495a28[_0xdda2('0x5f')],'clientSecret':_0x495a28[_0xdda2('0x60')]}});return _0x58d1ad[_0xdda2('0x67')](_0x495a28['username'],_0x495a28['password'][_0xdda2('0x68')](_0x495a28[_0xdda2('0x63')]));}})[_0xdda2('0x48')](function(_0xe1c6e6){if(_0xe1c6e6){return _0x58d1ad['sobject'](_0xdda2('0x69'))[_0xdda2('0x6a')]();}})[_0xdda2('0x48')](function(_0x152ba3){var _0x2dda16=[_0xdda2('0x6b'),_0xdda2('0x6c'),_0xdda2('0x6d'),_0xdda2('0x6e'),_0xdda2('0x6f'),_0xdda2('0x70'),_0xdda2('0x71'),_0xdda2('0x72')];if(_0x152ba3){_[_0xdda2('0x73')](_0x152ba3[_0xdda2('0x3a')],function(_0x4b9481){return _0x4b9481[_0xdda2('0x74')]===![]&&!_0x2dda16[_0xdda2('0x75')](_0x4b9481['name']);});return{'count':_0x152ba3['fields'][_0xdda2('0x3b')],'rows':_[_0xdda2('0x41')](_0x152ba3[_0xdda2('0x3a')],function(_0xdc4cdc){return{'id':_0xdc4cdc[_0xdda2('0x32')],'name':_0xdc4cdc[_0xdda2('0x76')],'custom':_0xdc4cdc['custom'],'options':_0xdc4cdc[_0xdda2('0x77')]?_[_0xdda2('0x41')](_0xdc4cdc[_0xdda2('0x77')],function(_0x2bb4f3){return{'name':_0x2bb4f3['label'],'value':_0x2bb4f3[_0xdda2('0x78')]};}):[]};})};}})['then'](respondWithResult(_0x597b09,null))[_0xdda2('0x24')](function(_0x6b6dad){var _0x4c8739=_0x12fd67[_0xdda2('0x36')][_0xdda2('0x79')]?0x1f4:_0x6b6dad[_0xdda2('0x7a')]||0x1f4;logger[_0xdda2('0x20')](_0xdda2('0x7b'),_0xdda2('0x5d'),_0x4c8739,JSON[_0xdda2('0x1f')](_0x6b6dad));delete _0x6b6dad[_0xdda2('0x32')];if(_0x4c8739===0x191){_0x4c8739=0x190;}_0x597b09[_0xdda2('0x26')](_0x4c8739)[_0xdda2('0x7c')](_0x12fd67[_0xdda2('0x36')]['test']?{'message':_0xdda2('0x7d'),'statusCode':_0x6b6dad[_0xdda2('0x7a')]}:_0x6b6dad);});}; \ No newline at end of file +var _0xac4a=['save','update','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','map','type','key','field','options','includeAll','include','rows','show','params','find','create','body','findOne','SalesforceConfiguration','getConfigurations','hasOwnProperty','Subjects','getSubjects','channel','Descriptions','SalesforceField','clientId','clientSecret','username','password','securityToken','remoteUri','substring','lastIndexOf','Connection','login','concat','sobject','Task','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','remove','custom','includes','label','picklistValues','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply'];(function(_0x107d61,_0x1765a4){var _0x3c9ec2=function(_0x546dd5){while(--_0x546dd5){_0x107d61['push'](_0x107d61['shift']());}};_0x3c9ec2(++_0x1765a4);}(_0xac4a,0x13f));var _0xaac4=function(_0x3f74b8,_0xba271f){_0x3f74b8=_0x3f74b8-0x0;var _0x4a9464=_0xac4a[_0x3f74b8];return _0x4a9464;};'use strict';var pdf=require(_0xaac4('0x0'));var emlformat=require(_0xaac4('0x1'));var rimraf=require(_0xaac4('0x2'));var zipdir=require(_0xaac4('0x3'));var jsonpatch=require(_0xaac4('0x4'));var rp=require(_0xaac4('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaac4('0x6'));var util=require(_0xaac4('0x7'));var path=require(_0xaac4('0x8'));var sox=require('sox');var csv=require(_0xaac4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var authService=require(_0xaac4('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xaac4('0xf'));var logger=require(_0xaac4('0x10'))(_0xaac4('0x11'));var utils=require(_0xaac4('0x12'));var config=require(_0xaac4('0x13'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xaac4('0x14'));var client=jayson[_0xaac4('0x15')][_0xaac4('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x5a4801,_0x6a808d,_0x45c129,_0x5bcacd){return new BPromise(function(_0xf06b1d,_0x2b20d0){var _0x46698d=_0x5bcacd||client;return _0x46698d[_0xaac4('0x17')](_0x5a4801,_0x45c129)[_0xaac4('0x18')](function(_0x2fbeb7){logger[_0xaac4('0x19')](_0xaac4('0x1a'),_0x6a808d,_0xaac4('0x1b'));logger[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x6a808d,_0xaac4('0x1b'),JSON[_0xaac4('0x1e')](_0x2fbeb7));if(_0x2fbeb7['error']){if(_0x2fbeb7[_0xaac4('0x1f')]['code']===0x1f4){logger[_0xaac4('0x1f')]('SalesforceAccount,\x20%s,\x20%s',_0x6a808d,_0x2fbeb7[_0xaac4('0x1f')][_0xaac4('0x20')]);return _0x2b20d0(_0x2fbeb7[_0xaac4('0x1f')][_0xaac4('0x20')]);}logger[_0xaac4('0x1f')](_0xaac4('0x1a'),_0x6a808d,_0x2fbeb7[_0xaac4('0x1f')][_0xaac4('0x20')]);return _0xf06b1d(_0x2fbeb7[_0xaac4('0x1f')]['message']);}else{logger[_0xaac4('0x19')]('SalesforceAccount,\x20%s,\x20%s',_0x6a808d,_0xaac4('0x1b'));_0xf06b1d(_0x2fbeb7[_0xaac4('0x21')][_0xaac4('0x20')]);}})[_0xaac4('0x22')](function(_0x17140f){logger[_0xaac4('0x1f')]('SalesforceAccount,\x20%s,\x20%s',_0x6a808d,_0x17140f);_0x2b20d0(_0x17140f);});});}function respondWithStatusCode(_0x43ccdc,_0x27a84d){_0x27a84d=_0x27a84d||0xcc;return function(_0x174860){if(_0x174860){return _0x43ccdc[_0xaac4('0x23')](_0x27a84d);}return _0x43ccdc[_0xaac4('0x24')](_0x27a84d)[_0xaac4('0x25')]();};}function respondWithResult(_0xb2577b,_0x577b3d){_0x577b3d=_0x577b3d||0xc8;return function(_0x24186b){if(_0x24186b){return _0xb2577b['status'](_0x577b3d)['json'](_0x24186b);}};}function respondWithFilteredResult(_0x4fac85,_0x5a0bb3){return function(_0x22d5a6){if(_0x22d5a6){var _0x17d25f=_0x22d5a6[_0xaac4('0x26')],_0x22cda2=_0x5a0bb3[_0xaac4('0x27')],_0xe93120=_0x5a0bb3[_0xaac4('0x27')]+_0x5a0bb3[_0xaac4('0x28')],_0x3c1445;if(_0xe93120>=_0x17d25f){_0xe93120=_0x17d25f;_0x3c1445=0xc8;}else{_0x3c1445=0xce;}_0x4fac85[_0xaac4('0x24')](_0x3c1445);return _0x4fac85['set'](_0xaac4('0x29'),_0x22cda2+'-'+_0xe93120+'/'+_0x17d25f)[_0xaac4('0x2a')](_0x22d5a6);}return null;};}function patchUpdates(_0xda10b6){return function(_0xb76ccc){try{jsonpatch[_0xaac4('0x2b')](_0xb76ccc,_0xda10b6,!![]);}catch(_0x442b87){return BPromise['reject'](_0x442b87);}return _0xb76ccc[_0xaac4('0x2c')]();};}function saveUpdates(_0x5d2c9a,_0x2df7e3){return function(_0xab5d04){if(_0xab5d04){return _0xab5d04[_0xaac4('0x2d')](_0x5d2c9a)[_0xaac4('0x18')](function(_0x48bf50){return _0x48bf50;});}return null;};}function removeEntity(_0x5000e1,_0x58f748){return function(_0x20abcc){if(_0x20abcc){return _0x20abcc[_0xaac4('0x2e')]()[_0xaac4('0x18')](function(){_0x5000e1[_0xaac4('0x24')](0xcc)[_0xaac4('0x25')]();});}};}function handleEntityNotFound(_0x1e9062,_0x25f6fc){return function(_0x379cbd){if(!_0x379cbd){_0x1e9062[_0xaac4('0x23')](0x194);}return _0x379cbd;};}function handleError(_0x3b2091,_0x8b003b){_0x8b003b=_0x8b003b||0x1f4;return function(_0x22c902){logger[_0xaac4('0x1f')](_0x22c902[_0xaac4('0x2f')]);if(_0x22c902[_0xaac4('0x30')]){delete _0x22c902['name'];}_0x3b2091['status'](_0x8b003b)[_0xaac4('0x31')](_0x22c902);};}exports[_0xaac4('0x32')]=function(_0xa07d0,_0x5e6080){var _0x191d0f={},_0x16fae8={},_0x2cbf8d={'count':0x0,'rows':[]};var _0x1bce61=db[_0xaac4('0x33')][_0xaac4('0x34')];_0x16fae8[_0xaac4('0x35')]=_['keys'](_0x1bce61);_0x16fae8[_0xaac4('0x36')]=_[_0xaac4('0x37')](_0xa07d0[_0xaac4('0x36')]);_0x16fae8['filters']=_[_0xaac4('0x38')](_0x16fae8['model'],_0x16fae8['query']);_0x191d0f[_0xaac4('0x39')]=_[_0xaac4('0x38')](_0x16fae8[_0xaac4('0x35')],qs['fields'](_0xa07d0['query'][_0xaac4('0x3a')]));_0x191d0f[_0xaac4('0x39')]=_0x191d0f[_0xaac4('0x39')][_0xaac4('0x3b')]?_0x191d0f[_0xaac4('0x39')]:_0x16fae8[_0xaac4('0x35')];if(!_0xa07d0['query']['hasOwnProperty'](_0xaac4('0x3c'))){_0x191d0f[_0xaac4('0x28')]=qs['limit'](_0xa07d0[_0xaac4('0x36')][_0xaac4('0x28')]);_0x191d0f[_0xaac4('0x27')]=qs['offset'](_0xa07d0[_0xaac4('0x36')][_0xaac4('0x27')]);}_0x191d0f[_0xaac4('0x3d')]=qs['sort'](_0xa07d0[_0xaac4('0x36')][_0xaac4('0x3e')]);_0x191d0f[_0xaac4('0x3f')]=qs[_0xaac4('0x40')](_['pick'](_0xa07d0[_0xaac4('0x36')],_0x16fae8['filters']));if(_0xa07d0['query'][_0xaac4('0x41')]){_0x191d0f[_0xaac4('0x3f')]=_[_0xaac4('0x42')](_0x191d0f[_0xaac4('0x3f')],{'$or':_[_0xaac4('0x43')](_0x1bce61,function(_0xb78221){if(_0xb78221[_0xaac4('0x44')][_0xaac4('0x45')]!=='VIRTUAL'){var _0x15191a={};_0x15191a[_0xb78221[_0xaac4('0x46')]]={'$like':'%'+_0xa07d0[_0xaac4('0x36')][_0xaac4('0x41')]+'%'};return _0x15191a;}})});}_0x191d0f=_['merge']({},_0x191d0f,_0xa07d0[_0xaac4('0x47')]);var _0x12944f={'where':_0x191d0f[_0xaac4('0x3f')]};return db['SalesforceAccount'][_0xaac4('0x26')](_0x12944f)[_0xaac4('0x18')](function(_0x141eb9){_0x2cbf8d[_0xaac4('0x26')]=_0x141eb9;if(_0xa07d0['query'][_0xaac4('0x48')]){_0x191d0f[_0xaac4('0x49')]=[{'all':!![]}];}return db[_0xaac4('0x33')]['findAll'](_0x191d0f);})[_0xaac4('0x18')](function(_0x2e9a33){_0x2cbf8d[_0xaac4('0x4a')]=_0x2e9a33;return _0x2cbf8d;})[_0xaac4('0x18')](respondWithFilteredResult(_0x5e6080,_0x191d0f))[_0xaac4('0x22')](handleError(_0x5e6080,null));};exports[_0xaac4('0x4b')]=function(_0x25e1b1,_0xa8d1c9){var _0x6c713={'raw':![],'where':{'id':_0x25e1b1[_0xaac4('0x4c')]['id']}},_0x5bce3c={};_0x5bce3c[_0xaac4('0x35')]=_[_0xaac4('0x37')](db[_0xaac4('0x33')][_0xaac4('0x34')]);_0x5bce3c['query']=_['keys'](_0x25e1b1[_0xaac4('0x36')]);_0x5bce3c[_0xaac4('0x40')]=_[_0xaac4('0x38')](_0x5bce3c[_0xaac4('0x35')],_0x5bce3c['query']);_0x6c713[_0xaac4('0x39')]=_['intersection'](_0x5bce3c[_0xaac4('0x35')],qs[_0xaac4('0x3a')](_0x25e1b1['query'][_0xaac4('0x3a')]));_0x6c713[_0xaac4('0x39')]=_0x6c713[_0xaac4('0x39')]['length']?_0x6c713['attributes']:_0x5bce3c[_0xaac4('0x35')];if(_0x25e1b1[_0xaac4('0x36')][_0xaac4('0x48')]){_0x6c713[_0xaac4('0x49')]=[{'all':!![]}];}_0x6c713=_[_0xaac4('0x42')]({},_0x6c713,_0x25e1b1[_0xaac4('0x47')]);return db['SalesforceAccount'][_0xaac4('0x4d')](_0x6c713)[_0xaac4('0x18')](handleEntityNotFound(_0xa8d1c9,null))[_0xaac4('0x18')](respondWithResult(_0xa8d1c9,null))[_0xaac4('0x22')](handleError(_0xa8d1c9,null));};exports['create']=function(_0x3ca377,_0x571418){return db[_0xaac4('0x33')][_0xaac4('0x4e')](_0x3ca377[_0xaac4('0x4f')],{})[_0xaac4('0x18')](respondWithResult(_0x571418,0xc9))[_0xaac4('0x22')](handleError(_0x571418,null));};exports[_0xaac4('0x2d')]=function(_0x3d7720,_0x3aa764){if(_0x3d7720[_0xaac4('0x4f')]['id']){delete _0x3d7720[_0xaac4('0x4f')]['id'];}return db[_0xaac4('0x33')][_0xaac4('0x4d')]({'where':{'id':_0x3d7720[_0xaac4('0x4c')]['id']}})[_0xaac4('0x18')](handleEntityNotFound(_0x3aa764,null))['then'](saveUpdates(_0x3d7720[_0xaac4('0x4f')],null))[_0xaac4('0x18')](respondWithResult(_0x3aa764,null))[_0xaac4('0x22')](handleError(_0x3aa764,null));};exports[_0xaac4('0x2e')]=function(_0x3b39a1,_0x10e218){return db[_0xaac4('0x33')][_0xaac4('0x4d')]({'where':{'id':_0x3b39a1['params']['id']}})[_0xaac4('0x18')](handleEntityNotFound(_0x10e218,null))['then'](removeEntity(_0x10e218,null))[_0xaac4('0x22')](handleError(_0x10e218,null));};exports['getConfigurations']=function(_0x3762b5,_0x5d56ae,_0x5155a4){var _0x19764c={};var _0x3a4e29={};var _0x48ae39;var _0x2f287c;return db[_0xaac4('0x33')][_0xaac4('0x50')]({'where':{'id':_0x3762b5[_0xaac4('0x4c')]['id']}})[_0xaac4('0x18')](handleEntityNotFound(_0x5d56ae,null))[_0xaac4('0x18')](function(_0x5d38bc){if(_0x5d38bc){_0x48ae39=_0x5d38bc;_0x3a4e29[_0xaac4('0x35')]=_['keys'](db[_0xaac4('0x51')]['rawAttributes']);_0x3a4e29['query']=_['keys'](_0x3762b5[_0xaac4('0x36')]);_0x3a4e29[_0xaac4('0x40')]=_[_0xaac4('0x38')](_0x3a4e29[_0xaac4('0x35')],_0x3a4e29['query']);_0x19764c[_0xaac4('0x39')]=_[_0xaac4('0x38')](_0x3a4e29[_0xaac4('0x35')],qs['fields'](_0x3762b5[_0xaac4('0x36')][_0xaac4('0x3a')]));_0x19764c[_0xaac4('0x39')]=_0x19764c[_0xaac4('0x39')][_0xaac4('0x3b')]?_0x19764c[_0xaac4('0x39')]:_0x3a4e29[_0xaac4('0x35')];_0x19764c['order']=qs['sort'](_0x3762b5[_0xaac4('0x36')]['sort']);_0x19764c['where']=qs[_0xaac4('0x40')](_['pick'](_0x3762b5[_0xaac4('0x36')],_0x3a4e29['filters']));if(_0x3762b5[_0xaac4('0x36')][_0xaac4('0x41')]){_0x19764c['where']=_['merge'](_0x19764c['where'],{'$or':_['map'](_0x19764c[_0xaac4('0x39')],function(_0x18451f){var _0x1a6804={};_0x1a6804[_0x18451f]={'$like':'%'+_0x3762b5[_0xaac4('0x36')]['filter']+'%'};return _0x1a6804;})});}_0x19764c=_[_0xaac4('0x42')]({},_0x19764c,_0x3762b5[_0xaac4('0x47')]);return _0x48ae39[_0xaac4('0x52')](_0x19764c);}})[_0xaac4('0x18')](function(_0x3f5f8d){if(_0x3f5f8d){_0x2f287c=_0x3f5f8d[_0xaac4('0x3b')];if(!_0x3762b5[_0xaac4('0x36')][_0xaac4('0x53')](_0xaac4('0x3c'))){_0x19764c[_0xaac4('0x28')]=qs[_0xaac4('0x28')](_0x3762b5['query']['limit']);_0x19764c[_0xaac4('0x27')]=qs['offset'](_0x3762b5['query'][_0xaac4('0x27')]);}return _0x48ae39['getConfigurations'](_0x19764c);}})[_0xaac4('0x18')](function(_0x34b950){if(_0x34b950){return _0x34b950?{'count':_0x2f287c,'rows':_0x34b950}:null;}})[_0xaac4('0x18')](respondWithResult(_0x5d56ae,null))[_0xaac4('0x22')](handleError(_0x5d56ae,null));};exports['addConfiguration']=function(_0x1a49c5,_0x2de8d4,_0x987b2e){if(_0x1a49c5[_0xaac4('0x4f')]['id']){delete _0x1a49c5[_0xaac4('0x4f')]['id'];}return db[_0xaac4('0x33')]['findOne']({'where':{'id':_0x1a49c5[_0xaac4('0x4c')]['id']}})[_0xaac4('0x18')](handleEntityNotFound(_0x2de8d4,null))['then'](function(_0x2e3fd9){if(_0x2e3fd9){_0x1a49c5[_0xaac4('0x4f')]['AccountId']=_0x2e3fd9['id'];_0x1a49c5['body'][_0xaac4('0x54')]=integrations[_0xaac4('0x55')](_0x1a49c5[_0xaac4('0x4f')][_0xaac4('0x56')],_0x1a49c5[_0xaac4('0x4f')][_0xaac4('0x44')]);_0x1a49c5[_0xaac4('0x4f')][_0xaac4('0x57')]=integrations['getDescriptions'](_0x1a49c5[_0xaac4('0x4f')][_0xaac4('0x56')],_0x1a49c5[_0xaac4('0x4f')][_0xaac4('0x44')]);return db[_0xaac4('0x51')][_0xaac4('0x4e')](_0x1a49c5['body'],{'include':[{'model':db[_0xaac4('0x58')],'as':_0xaac4('0x54')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2de8d4,null))[_0xaac4('0x22')](handleError(_0x2de8d4,null));};exports['getFields']=function(_0x5e3bf1,_0x5cc49b,_0x54af97){var _0x5769ab;var _0x430a49='';return db[_0xaac4('0x33')][_0xaac4('0x50')]({'where':{'id':_0x5e3bf1[_0xaac4('0x4c')]['id']},'attributes':['id','remoteUri',_0xaac4('0x59'),_0xaac4('0x5a'),_0xaac4('0x5b'),_0xaac4('0x5c'),_0xaac4('0x5d')]})[_0xaac4('0x18')](handleEntityNotFound(_0x5cc49b,null))[_0xaac4('0x18')](function(_0x4d8e3d){if(_0x4d8e3d){_0x430a49=_0x4d8e3d[_0xaac4('0x5e')];var _0x51959a=_0x430a49['slice'](-0x1);if(_0x51959a==='/'){_0x430a49=_0x430a49[_0xaac4('0x5f')](0x0,_0x430a49[_0xaac4('0x60')](_0x51959a));}_0x5769ab=new jsforce[(_0xaac4('0x61'))]({'oauth2':{'loginUrl':_0x430a49,'clientId':_0x4d8e3d[_0xaac4('0x59')],'clientSecret':_0x4d8e3d[_0xaac4('0x5a')]}});return _0x5769ab[_0xaac4('0x62')](_0x4d8e3d[_0xaac4('0x5b')],_0x4d8e3d[_0xaac4('0x5c')][_0xaac4('0x63')](_0x4d8e3d[_0xaac4('0x5d')]));}})[_0xaac4('0x18')](function(_0x36d93b){if(_0x36d93b){return _0x5769ab[_0xaac4('0x64')](_0xaac4('0x65'))[_0xaac4('0x66')]();}})[_0xaac4('0x18')](function(_0xfc870b){var _0x34565a=[_0xaac4('0x67'),_0xaac4('0x68'),_0xaac4('0x69'),_0xaac4('0x6a'),_0xaac4('0x6b'),_0xaac4('0x6c'),_0xaac4('0x6d'),'Type'];if(_0xfc870b){_[_0xaac4('0x6e')](_0xfc870b[_0xaac4('0x3a')],function(_0x29cd95){return _0x29cd95[_0xaac4('0x6f')]===![]&&!_0x34565a[_0xaac4('0x70')](_0x29cd95['name']);});return{'count':_0xfc870b[_0xaac4('0x3a')][_0xaac4('0x3b')],'rows':_[_0xaac4('0x43')](_0xfc870b[_0xaac4('0x3a')],function(_0x270b56){return{'id':_0x270b56['name'],'name':_0x270b56[_0xaac4('0x71')],'custom':_0x270b56['custom'],'options':_0x270b56[_0xaac4('0x72')]?_[_0xaac4('0x43')](_0x270b56['picklistValues'],function(_0x30227e){return{'name':_0x30227e['label'],'value':_0x30227e[_0xaac4('0x73')]};}):[]};})};}})[_0xaac4('0x18')](respondWithResult(_0x5cc49b,null))['catch'](function(_0x3dea56){var _0x3fe616=_0x5e3bf1['query'][_0xaac4('0x74')]?0x1f4:_0x3dea56[_0xaac4('0x75')]||0x1f4;logger[_0xaac4('0x1f')](_0xaac4('0x76'),_0xaac4('0x77'),_0x3fe616,JSON[_0xaac4('0x1e')](_0x3dea56));delete _0x3dea56[_0xaac4('0x30')];if(_0x3fe616===0x191){_0x3fe616=0x190;}_0x5cc49b[_0xaac4('0x24')](_0x3fe616)[_0xaac4('0x31')](_0x5e3bf1['query'][_0xaac4('0x74')]?{'message':_0xaac4('0x78'),'statusCode':_0x3dea56[_0xaac4('0x75')]}:_0x3dea56);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 5504268..2cdda8d 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 _0x20cf=['./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x20cf,0x162));var _0xf20c=function(_0x459060,_0x3740d0){_0x459060=_0x459060-0x0;var _0x2a1be2=_0x20cf[_0x459060];return _0x2a1be2;};'use strict';var _=require('lodash');var util=require(_0xf20c('0x0'));var logger=require(_0xf20c('0x1'))(_0xf20c('0x2'));var moment=require(_0xf20c('0x3'));var BPromise=require(_0xf20c('0x4'));var rp=require(_0xf20c('0x5'));var attributes=require(_0xf20c('0x6'));var integrations=require(_0xf20c('0x7'));module['exports']=function(_0x1790bf,_0x54988b){return _0x1790bf['define'](_0xf20c('0x8'),attributes,{'tableName':_0xf20c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25b4=['api','moment','bluebird','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger'];(function(_0x43831f,_0x3103ad){var _0x58ab74=function(_0x391e71){while(--_0x391e71){_0x43831f['push'](_0x43831f['shift']());}};_0x58ab74(++_0x3103ad);}(_0x25b4,0x1ab));var _0x425b=function(_0x1488cd,_0x25a893){_0x1488cd=_0x1488cd-0x0;var _0x63fa13=_0x25b4[_0x1488cd];return _0x63fa13;};'use strict';var _=require(_0x425b('0x0'));var util=require('util');var logger=require(_0x425b('0x1'))(_0x425b('0x2'));var moment=require(_0x425b('0x3'));var BPromise=require(_0x425b('0x4'));var rp=require('request-promise');var attributes=require(_0x425b('0x5'));var integrations=require(_0x425b('0x6'));module[_0x425b('0x7')]=function(_0x3a364e,_0x566fda){return _0x3a364e[_0x425b('0x8')](_0x425b('0x9'),attributes,{'tableName':_0x425b('0xa'),'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 9e698bb..42ea8ad 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 _0xf4cb=['options','raw','attributes','limit','include','model','map','GetSalesforceAccount','ShowSalesforceAccount','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','catch','SalesforceAccount','findAll'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0xf4cb,0x18c));var _0xbf4c=function(_0x21223d,_0x40e8e5){_0x21223d=_0x21223d-0x0;var _0x42e673=_0xf4cb[_0x21223d];return _0x42e673;};'use strict';var _=require(_0xbf4c('0x0'));var util=require(_0xbf4c('0x1'));var moment=require(_0xbf4c('0x2'));var BPromise=require(_0xbf4c('0x3'));var rs=require(_0xbf4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf4c('0x5'))['db'];var utils=require(_0xbf4c('0x6'));var logger=require(_0xbf4c('0x7'))('rpc');var config=require(_0xbf4c('0x8'));var jayson=require(_0xbf4c('0x9'));var client=jayson['client'][_0xbf4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x586cf7,_0x23c462,_0x1ed0bb){return new BPromise(function(_0x40a4f0,_0x3fbed6){return client['request'](_0x586cf7,_0x1ed0bb)[_0xbf4c('0xb')](function(_0x2f548a){logger[_0xbf4c('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x23c462,'request\x20sent');logger[_0xbf4c('0xd')](_0xbf4c('0xe'),_0x23c462,_0xbf4c('0xf'),JSON[_0xbf4c('0x10')](_0x2f548a));if(_0x2f548a[_0xbf4c('0x11')]){if(_0x2f548a[_0xbf4c('0x11')][_0xbf4c('0x12')]===0x1f4){logger[_0xbf4c('0x11')](_0xbf4c('0x13'),_0x23c462,_0x2f548a['error'][_0xbf4c('0x14')]);return _0x3fbed6(_0x2f548a[_0xbf4c('0x11')][_0xbf4c('0x14')]);}logger['error'](_0xbf4c('0x13'),_0x23c462,_0x2f548a[_0xbf4c('0x11')][_0xbf4c('0x14')]);return _0x40a4f0(_0x2f548a[_0xbf4c('0x11')]['message']);}else{logger[_0xbf4c('0xc')](_0xbf4c('0x13'),_0x23c462,'request\x20sent');_0x40a4f0(_0x2f548a['result']['message']);}})[_0xbf4c('0x15')](function(_0x4ec426){logger[_0xbf4c('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x23c462,_0x4ec426);_0x3fbed6(_0x4ec426);});});}exports['GetSalesforceAccount']=function(_0x3c43e8){var _0x5bb71f=this;return new Promise(function(_0x24c140,_0x3b7427){return db[_0xbf4c('0x16')][_0xbf4c('0x17')]({'raw':_0x3c43e8[_0xbf4c('0x18')]?_0x3c43e8[_0xbf4c('0x18')][_0xbf4c('0x19')]===undefined?!![]:![]:!![],'where':_0x3c43e8[_0xbf4c('0x18')]?_0x3c43e8['options']['where']||null:null,'attributes':_0x3c43e8['options']?_0x3c43e8['options'][_0xbf4c('0x1a')]||null:null,'limit':_0x3c43e8['options']?_0x3c43e8[_0xbf4c('0x18')][_0xbf4c('0x1b')]||null:null,'include':_0x3c43e8['options']?_0x3c43e8[_0xbf4c('0x18')][_0xbf4c('0x1c')]?_['map'](_0x3c43e8['options'][_0xbf4c('0x1c')],function(_0x17a042){return{'model':db[_0x17a042[_0xbf4c('0x1d')]],'as':_0x17a042['as'],'attributes':_0x17a042[_0xbf4c('0x1a')],'include':_0x17a042[_0xbf4c('0x1c')]?_[_0xbf4c('0x1e')](_0x17a042['include'],function(_0x78bd67){return{'model':db[_0x78bd67[_0xbf4c('0x1d')]],'as':_0x78bd67['as'],'attributes':_0x78bd67[_0xbf4c('0x1a')],'include':_0x78bd67[_0xbf4c('0x1c')]?_[_0xbf4c('0x1e')](_0x78bd67['include'],function(_0x3f07f9){return{'model':db[_0x3f07f9['model']],'as':_0x3f07f9['as'],'attributes':_0x3f07f9[_0xbf4c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcea0dc){logger[_0xbf4c('0xc')](_0xbf4c('0x1f'),_0x3c43e8);logger[_0xbf4c('0xd')](_0xbf4c('0x1f'),_0x3c43e8,JSON['stringify'](_0xcea0dc));_0x24c140(_0xcea0dc);})[_0xbf4c('0x15')](function(_0x58e96c){logger[_0xbf4c('0x11')](_0xbf4c('0x1f'),_0x58e96c[_0xbf4c('0x14')],_0x3c43e8);_0x3b7427(_0x5bb71f[_0xbf4c('0x11')](0x1f4,_0x58e96c[_0xbf4c('0x14')]));});});};exports[_0xbf4c('0x20')]=function(_0x87b63){var _0x31e42b=this;return new Promise(function(_0x5c2ed3,_0x1df817){return db[_0xbf4c('0x16')][_0xbf4c('0x21')]({'raw':_0x87b63[_0xbf4c('0x18')]?_0x87b63[_0xbf4c('0x18')][_0xbf4c('0x19')]===undefined?!![]:![]:!![],'where':_0x87b63['options']?_0x87b63[_0xbf4c('0x18')][_0xbf4c('0x22')]||null:null,'attributes':_0x87b63['options']?_0x87b63[_0xbf4c('0x18')][_0xbf4c('0x1a')]||null:null,'include':_0x87b63[_0xbf4c('0x18')]?_0x87b63[_0xbf4c('0x18')][_0xbf4c('0x1c')]?_[_0xbf4c('0x1e')](_0x87b63['options'][_0xbf4c('0x1c')],function(_0x3ab139){return{'model':db[_0x3ab139['model']],'as':_0x3ab139['as'],'attributes':_0x3ab139[_0xbf4c('0x1a')],'include':_0x3ab139[_0xbf4c('0x1c')]?_[_0xbf4c('0x1e')](_0x3ab139[_0xbf4c('0x1c')],function(_0x13865e){return{'model':db[_0x13865e['model']],'as':_0x13865e['as'],'attributes':_0x13865e[_0xbf4c('0x1a')],'include':_0x13865e[_0xbf4c('0x1c')]?_['map'](_0x13865e['include'],function(_0x2ec983){return{'model':db[_0x2ec983['model']],'as':_0x2ec983['as'],'attributes':_0x2ec983['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf4c('0xb')](function(_0x573411){logger[_0xbf4c('0xc')](_0xbf4c('0x20'),_0x87b63);logger[_0xbf4c('0xd')](_0xbf4c('0x20'),_0x87b63,JSON[_0xbf4c('0x10')](_0x573411));_0x5c2ed3(_0x573411);})[_0xbf4c('0x15')](function(_0x5d5ba0){logger[_0xbf4c('0x11')]('ShowSalesforceAccount',_0x5d5ba0[_0xbf4c('0x14')],_0x87b63);_0x1df817(_0x31e42b[_0xbf4c('0x11')](0x1f4,_0x5d5ba0[_0xbf4c('0x14')]));});});}; \ No newline at end of file +var _0xfef9=['SalesforceAccount','options','raw','where','attributes','limit','include','map','model','find','ShowSalesforceAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetSalesforceAccount'];(function(_0x17ac0c,_0xeb53bc){var _0x3e8e70=function(_0x448bf9){while(--_0x448bf9){_0x17ac0c['push'](_0x17ac0c['shift']());}};_0x3e8e70(++_0xeb53bc);}(_0xfef9,0x107));var _0x9fef=function(_0x414ff1,_0xf0462b){_0x414ff1=_0x414ff1-0x0;var _0x29c53f=_0xfef9[_0x414ff1];return _0x29c53f;};'use strict';var _=require('lodash');var util=require(_0x9fef('0x0'));var moment=require(_0x9fef('0x1'));var BPromise=require(_0x9fef('0x2'));var rs=require(_0x9fef('0x3'));var fs=require('fs');var Redis=require(_0x9fef('0x4'));var db=require(_0x9fef('0x5'))['db'];var utils=require(_0x9fef('0x6'));var logger=require(_0x9fef('0x7'))(_0x9fef('0x8'));var config=require(_0x9fef('0x9'));var jayson=require(_0x9fef('0xa'));var client=jayson['client'][_0x9fef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x606055,_0x3953ab,_0x5ecbc6){return new BPromise(function(_0x3521eb,_0x1bb8cf){return client[_0x9fef('0xc')](_0x606055,_0x5ecbc6)[_0x9fef('0xd')](function(_0x1110ad){logger[_0x9fef('0xe')](_0x9fef('0xf'),_0x3953ab,'request\x20sent');logger[_0x9fef('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x3953ab,_0x9fef('0x11'),JSON[_0x9fef('0x12')](_0x1110ad));if(_0x1110ad[_0x9fef('0x13')]){if(_0x1110ad[_0x9fef('0x13')][_0x9fef('0x14')]===0x1f4){logger[_0x9fef('0x13')](_0x9fef('0xf'),_0x3953ab,_0x1110ad[_0x9fef('0x13')][_0x9fef('0x15')]);return _0x1bb8cf(_0x1110ad[_0x9fef('0x13')][_0x9fef('0x15')]);}logger['error'](_0x9fef('0xf'),_0x3953ab,_0x1110ad['error'][_0x9fef('0x15')]);return _0x3521eb(_0x1110ad[_0x9fef('0x13')]['message']);}else{logger[_0x9fef('0xe')](_0x9fef('0xf'),_0x3953ab,_0x9fef('0x11'));_0x3521eb(_0x1110ad[_0x9fef('0x16')][_0x9fef('0x15')]);}})[_0x9fef('0x17')](function(_0x3be2d6){logger[_0x9fef('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x3953ab,_0x3be2d6);_0x1bb8cf(_0x3be2d6);});});}exports[_0x9fef('0x18')]=function(_0x3868dd){var _0x3516c1=this;return new Promise(function(_0x9aaa30,_0xe1d8f9){return db[_0x9fef('0x19')]['findAll']({'raw':_0x3868dd['options']?_0x3868dd[_0x9fef('0x1a')][_0x9fef('0x1b')]===undefined?!![]:![]:!![],'where':_0x3868dd[_0x9fef('0x1a')]?_0x3868dd[_0x9fef('0x1a')][_0x9fef('0x1c')]||null:null,'attributes':_0x3868dd[_0x9fef('0x1a')]?_0x3868dd[_0x9fef('0x1a')][_0x9fef('0x1d')]||null:null,'limit':_0x3868dd[_0x9fef('0x1a')]?_0x3868dd[_0x9fef('0x1a')][_0x9fef('0x1e')]||null:null,'include':_0x3868dd[_0x9fef('0x1a')]?_0x3868dd[_0x9fef('0x1a')][_0x9fef('0x1f')]?_[_0x9fef('0x20')](_0x3868dd[_0x9fef('0x1a')]['include'],function(_0xd3226d){return{'model':db[_0xd3226d[_0x9fef('0x21')]],'as':_0xd3226d['as'],'attributes':_0xd3226d['attributes'],'include':_0xd3226d[_0x9fef('0x1f')]?_[_0x9fef('0x20')](_0xd3226d[_0x9fef('0x1f')],function(_0x2b9d69){return{'model':db[_0x2b9d69[_0x9fef('0x21')]],'as':_0x2b9d69['as'],'attributes':_0x2b9d69['attributes'],'include':_0x2b9d69[_0x9fef('0x1f')]?_[_0x9fef('0x20')](_0x2b9d69[_0x9fef('0x1f')],function(_0x20a2ef){return{'model':db[_0x20a2ef[_0x9fef('0x21')]],'as':_0x20a2ef['as'],'attributes':_0x20a2ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x9fef('0xd')](function(_0x1a1865){logger[_0x9fef('0xe')](_0x9fef('0x18'),_0x3868dd);logger['debug'](_0x9fef('0x18'),_0x3868dd,JSON['stringify'](_0x1a1865));_0x9aaa30(_0x1a1865);})['catch'](function(_0x4a5ff7){logger[_0x9fef('0x13')]('GetSalesforceAccount',_0x4a5ff7[_0x9fef('0x15')],_0x3868dd);_0xe1d8f9(_0x3516c1[_0x9fef('0x13')](0x1f4,_0x4a5ff7[_0x9fef('0x15')]));});});};exports['ShowSalesforceAccount']=function(_0x3e2424){var _0x211e05=this;return new Promise(function(_0x148aa7,_0x33ba9d){return db[_0x9fef('0x19')][_0x9fef('0x22')]({'raw':_0x3e2424[_0x9fef('0x1a')]?_0x3e2424['options'][_0x9fef('0x1b')]===undefined?!![]:![]:!![],'where':_0x3e2424['options']?_0x3e2424[_0x9fef('0x1a')]['where']||null:null,'attributes':_0x3e2424['options']?_0x3e2424['options'][_0x9fef('0x1d')]||null:null,'include':_0x3e2424['options']?_0x3e2424[_0x9fef('0x1a')][_0x9fef('0x1f')]?_[_0x9fef('0x20')](_0x3e2424[_0x9fef('0x1a')]['include'],function(_0x2c7003){return{'model':db[_0x2c7003['model']],'as':_0x2c7003['as'],'attributes':_0x2c7003[_0x9fef('0x1d')],'include':_0x2c7003[_0x9fef('0x1f')]?_[_0x9fef('0x20')](_0x2c7003[_0x9fef('0x1f')],function(_0x1a996f){return{'model':db[_0x1a996f[_0x9fef('0x21')]],'as':_0x1a996f['as'],'attributes':_0x1a996f['attributes'],'include':_0x1a996f[_0x9fef('0x1f')]?_[_0x9fef('0x20')](_0x1a996f['include'],function(_0x18a056){return{'model':db[_0x18a056[_0x9fef('0x21')]],'as':_0x18a056['as'],'attributes':_0x18a056[_0x9fef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9fef('0xd')](function(_0x136ac6){logger[_0x9fef('0xe')]('ShowSalesforceAccount',_0x3e2424);logger['debug'](_0x9fef('0x23'),_0x3e2424,JSON[_0x9fef('0x12')](_0x136ac6));_0x148aa7(_0x136ac6);})[_0x9fef('0x17')](function(_0x308200){logger[_0x9fef('0x13')](_0x9fef('0x23'),_0x308200[_0x9fef('0x15')],_0x3e2424);_0x33ba9d(_0x211e05[_0x9fef('0x13')](0x1f4,_0x308200['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 28482fc..9f9cd6b 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 _0x2326=['update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','put'];(function(_0x526046,_0x154040){var _0x5b92a2=function(_0x1e92af){while(--_0x1e92af){_0x526046['push'](_0x526046['shift']());}};_0x5b92a2(++_0x154040);}(_0x2326,0xb2));var _0x6232=function(_0x191f47,_0x14dff4){_0x191f47=_0x191f47-0x0;var _0x49eb5d=_0x2326[_0x191f47];return _0x49eb5d;};'use strict';var multer=require(_0x6232('0x0'));var util=require(_0x6232('0x1'));var path=require('path');var timeout=require(_0x6232('0x2'));var express=require(_0x6232('0x3'));var router=express[_0x6232('0x4')]();var auth=require(_0x6232('0x5'));var interaction=require(_0x6232('0x6'));var config=require(_0x6232('0x7'));var controller=require(_0x6232('0x8'));router[_0x6232('0x9')]('/',auth[_0x6232('0xa')](),controller[_0x6232('0xb')]);router[_0x6232('0x9')](_0x6232('0xc'),auth[_0x6232('0xa')](),controller[_0x6232('0xd')]);router[_0x6232('0x9')]('/:id/fields',auth[_0x6232('0xa')](),controller[_0x6232('0xe')]);router[_0x6232('0x9')](_0x6232('0xf'),auth[_0x6232('0xa')](),controller[_0x6232('0x10')]);router[_0x6232('0x9')]('/:id/descriptions',auth[_0x6232('0xa')](),controller[_0x6232('0x11')]);router[_0x6232('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6232('0x13')](_0x6232('0xc'),auth[_0x6232('0xa')](),controller[_0x6232('0x14')]);router[_0x6232('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3b34=['update','delete','destroy','multer','util','connect-timeout','express','Router','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put'];(function(_0x805d1b,_0x4de44b){var _0x158e24=function(_0x4aabaa){while(--_0x4aabaa){_0x805d1b['push'](_0x805d1b['shift']());}};_0x158e24(++_0x4de44b);}(_0x3b34,0xff));var _0x43b3=function(_0x516253,_0x44bec9){_0x516253=_0x516253-0x0;var _0x167f8c=_0x3b34[_0x516253];return _0x167f8c;};'use strict';var multer=require(_0x43b3('0x0'));var util=require(_0x43b3('0x1'));var path=require('path');var timeout=require(_0x43b3('0x2'));var express=require(_0x43b3('0x3'));var router=express[_0x43b3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x43b3('0x5'));var controller=require(_0x43b3('0x6'));router[_0x43b3('0x7')]('/',auth[_0x43b3('0x8')](),controller[_0x43b3('0x9')]);router[_0x43b3('0x7')](_0x43b3('0xa'),auth[_0x43b3('0x8')](),controller[_0x43b3('0xb')]);router[_0x43b3('0x7')](_0x43b3('0xc'),auth[_0x43b3('0x8')](),controller[_0x43b3('0xd')]);router[_0x43b3('0x7')](_0x43b3('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x43b3('0xf'),auth[_0x43b3('0x8')](),controller[_0x43b3('0x10')]);router['post']('/',auth[_0x43b3('0x8')](),controller['create']);router[_0x43b3('0x11')](_0x43b3('0xa'),auth['isAuthenticated'](),controller[_0x43b3('0x12')]);router[_0x43b3('0x13')]('/:id',auth[_0x43b3('0x8')](),controller[_0x43b3('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 54f6819..ea95f6e 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 _0xbd81=['sequelize','exports','STRING','ENUM','contact_lead','contact','lead','nothing'];(function(_0x4c1823,_0x1967e6){var _0x5c6e74=function(_0x45aa99){while(--_0x45aa99){_0x4c1823['push'](_0x4c1823['shift']());}};_0x5c6e74(++_0x1967e6);}(_0xbd81,0x110));var _0x1bd8=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xbd81[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x1bd8('0x0'));module[_0x1bd8('0x1')]={'name':{'type':Sequelize[_0x1bd8('0x2')]},'description':{'type':Sequelize[_0x1bd8('0x2')]},'moduleSearch':{'type':Sequelize[_0x1bd8('0x3')](_0x1bd8('0x4'),_0x1bd8('0x5'),_0x1bd8('0x6')),'defaultValue':_0x1bd8('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x1bd8('0x7'),_0x1bd8('0x5'),_0x1bd8('0x6')),'defaultValue':'lead'}}; \ No newline at end of file +var _0x5256=['ENUM','contact','lead','contact_lead','nothing','sequelize','exports','STRING'];(function(_0xb07cd4,_0x5d5323){var _0x41f517=function(_0x2b8634){while(--_0x2b8634){_0xb07cd4['push'](_0xb07cd4['shift']());}};_0x41f517(++_0x5d5323);}(_0x5256,0x13d));var _0x6525=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x5256[_0x21549c];return _0x426cbd;};'use strict';var Sequelize=require(_0x6525('0x0'));module[_0x6525('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6525('0x2')]},'moduleSearch':{'type':Sequelize[_0x6525('0x3')]('contact_lead',_0x6525('0x4'),_0x6525('0x5')),'defaultValue':_0x6525('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x6525('0x7'),_0x6525('0x4'),_0x6525('0x5')),'defaultValue':'lead'}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 3ffde74..ab3432f 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 _0xc4aa=['util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','index','SalesforceConfiguration','rawAttributes','model','keys','query','intersection','fields','attributes','order','sort','filters','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','length','find','create','body','findOne','SalesforceField','pick','hasOwnProperty','getFields','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5d9e39,_0x27003b){var _0x1f4229=function(_0x2d7fde){while(--_0x2d7fde){_0x5d9e39['push'](_0x5d9e39['shift']());}};_0x1f4229(++_0x27003b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0xac4a('0x10'));var Redis=require(_0xac4a('0x11'));var qs=require(_0xac4a('0x12'));var logger=require('../../config/logger')(_0xac4a('0x13'));var utils=require('../../config/utils');var config=require(_0xac4a('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xac4a('0x15'));var client=jayson[_0xac4a('0x16')][_0xac4a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5e16aa,_0x21a79,_0x68424a,_0x247b78){return new BPromise(function(_0x6e00d4,_0x1b4313){var _0x3b71c0=_0x247b78||client;return _0x3b71c0[_0xac4a('0x18')](_0x5e16aa,_0x68424a)[_0xac4a('0x19')](function(_0x190418){logger[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x21a79,_0xac4a('0x1c'));logger['debug'](_0xac4a('0x1d'),_0x21a79,_0xac4a('0x1c'),JSON[_0xac4a('0x1e')](_0x190418));if(_0x190418[_0xac4a('0x1f')]){if(_0x190418[_0xac4a('0x1f')][_0xac4a('0x20')]===0x1f4){logger[_0xac4a('0x1f')](_0xac4a('0x1b'),_0x21a79,_0x190418['error']['message']);return _0x1b4313(_0x190418[_0xac4a('0x1f')][_0xac4a('0x21')]);}logger[_0xac4a('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x21a79,_0x190418[_0xac4a('0x1f')][_0xac4a('0x21')]);return _0x6e00d4(_0x190418[_0xac4a('0x1f')][_0xac4a('0x21')]);}else{logger[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x21a79,_0xac4a('0x1c'));_0x6e00d4(_0x190418[_0xac4a('0x22')]['message']);}})[_0xac4a('0x23')](function(_0x3204ad){logger['error'](_0xac4a('0x1b'),_0x21a79,_0x3204ad);_0x1b4313(_0x3204ad);});});}function respondWithStatusCode(_0x4169c0,_0x3eacd3){_0x3eacd3=_0x3eacd3||0xcc;return function(_0x947d8e){if(_0x947d8e){return _0x4169c0['sendStatus'](_0x3eacd3);}return _0x4169c0[_0xac4a('0x24')](_0x3eacd3)[_0xac4a('0x25')]();};}function respondWithResult(_0x15435c,_0x412494){_0x412494=_0x412494||0xc8;return function(_0x594f36){if(_0x594f36){return _0x15435c[_0xac4a('0x24')](_0x412494)[_0xac4a('0x26')](_0x594f36);}};}function respondWithFilteredResult(_0x36054a,_0x3e2c69){return function(_0x3bc318){if(_0x3bc318){var _0x1d0539=_0x3bc318[_0xac4a('0x27')],_0x215a31=_0x3e2c69[_0xac4a('0x28')],_0x14832b=_0x3e2c69['offset']+_0x3e2c69[_0xac4a('0x29')],_0x472c57;if(_0x14832b>=_0x1d0539){_0x14832b=_0x1d0539;_0x472c57=0xc8;}else{_0x472c57=0xce;}_0x36054a[_0xac4a('0x24')](_0x472c57);return _0x36054a[_0xac4a('0x2a')](_0xac4a('0x2b'),_0x215a31+'-'+_0x14832b+'/'+_0x1d0539)[_0xac4a('0x26')](_0x3bc318);}return null;};}function patchUpdates(_0x4a5a9e){return function(_0x47f49c){try{jsonpatch[_0xac4a('0x2c')](_0x47f49c,_0x4a5a9e,!![]);}catch(_0x7a948b){return BPromise[_0xac4a('0x2d')](_0x7a948b);}return _0x47f49c['save']();};}function saveUpdates(_0x4bda1f,_0x355755){return function(_0x2896bc){if(_0x2896bc){return _0x2896bc[_0xac4a('0x2e')](_0x4bda1f)[_0xac4a('0x19')](function(_0x17118e){return _0x17118e;});}return null;};}function removeEntity(_0x53d3a5,_0x6dcc7f){return function(_0x482afc){if(_0x482afc){return _0x482afc[_0xac4a('0x2f')]()['then'](function(){_0x53d3a5[_0xac4a('0x24')](0xcc)[_0xac4a('0x25')]();});}};}function handleEntityNotFound(_0x31501b,_0x228aa7){return function(_0x34577f){if(!_0x34577f){_0x31501b[_0xac4a('0x30')](0x194);}return _0x34577f;};}function handleError(_0xbd4591,_0x1f13f3){_0x1f13f3=_0x1f13f3||0x1f4;return function(_0x29fb3b){logger[_0xac4a('0x1f')](_0x29fb3b[_0xac4a('0x31')]);if(_0x29fb3b[_0xac4a('0x32')]){delete _0x29fb3b[_0xac4a('0x32')];}_0xbd4591[_0xac4a('0x24')](_0x1f13f3)['send'](_0x29fb3b);};}exports[_0xac4a('0x33')]=function(_0x1c41fb,_0x5a4e2b){var _0x2a5419={},_0x1af1c1={},_0x565164={'count':0x0,'rows':[]};var _0x58804b=db[_0xac4a('0x34')][_0xac4a('0x35')];_0x1af1c1[_0xac4a('0x36')]=_[_0xac4a('0x37')](_0x58804b);_0x1af1c1['query']=_[_0xac4a('0x37')](_0x1c41fb[_0xac4a('0x38')]);_0x1af1c1['filters']=_[_0xac4a('0x39')](_0x1af1c1[_0xac4a('0x36')],_0x1af1c1[_0xac4a('0x38')]);_0x2a5419['attributes']=_[_0xac4a('0x39')](_0x1af1c1[_0xac4a('0x36')],qs[_0xac4a('0x3a')](_0x1c41fb['query'][_0xac4a('0x3a')]));_0x2a5419[_0xac4a('0x3b')]=_0x2a5419['attributes']['length']?_0x2a5419[_0xac4a('0x3b')]:_0x1af1c1['model'];if(!_0x1c41fb['query']['hasOwnProperty']('nolimit')){_0x2a5419[_0xac4a('0x29')]=qs[_0xac4a('0x29')](_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x29')]);_0x2a5419[_0xac4a('0x28')]=qs[_0xac4a('0x28')](_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x28')]);}_0x2a5419[_0xac4a('0x3c')]=qs[_0xac4a('0x3d')](_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x3d')]);_0x2a5419['where']=qs['filters'](_['pick'](_0x1c41fb[_0xac4a('0x38')],_0x1af1c1[_0xac4a('0x3e')]));if(_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x3f')]){_0x2a5419[_0xac4a('0x40')]=_[_0xac4a('0x41')](_0x2a5419[_0xac4a('0x40')],{'$or':_[_0xac4a('0x42')](_0x58804b,function(_0x3e9973){if(_0x3e9973[_0xac4a('0x43')]['key']!==_0xac4a('0x44')){var _0x31bfaf={};_0x31bfaf[_0x3e9973[_0xac4a('0x45')]]={'$like':'%'+_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x3f')]+'%'};return _0x31bfaf;}})});}_0x2a5419=_['merge']({},_0x2a5419,_0x1c41fb[_0xac4a('0x46')]);var _0x1b77bb={'where':_0x2a5419['where']};return db[_0xac4a('0x34')]['count'](_0x1b77bb)[_0xac4a('0x19')](function(_0x65494e){_0x565164[_0xac4a('0x27')]=_0x65494e;if(_0x1c41fb[_0xac4a('0x38')][_0xac4a('0x47')]){_0x2a5419[_0xac4a('0x48')]=[{'all':!![]}];}return db[_0xac4a('0x34')][_0xac4a('0x49')](_0x2a5419);})[_0xac4a('0x19')](function(_0xcb002b){_0x565164[_0xac4a('0x4a')]=_0xcb002b;return _0x565164;})[_0xac4a('0x19')](respondWithFilteredResult(_0x5a4e2b,_0x2a5419))['catch'](handleError(_0x5a4e2b,null));};exports[_0xac4a('0x4b')]=function(_0x41d11d,_0xeca4e9){var _0x58759a={'raw':![],'where':{'id':_0x41d11d[_0xac4a('0x4c')]['id']}},_0x1764bf={};_0x1764bf['model']=_[_0xac4a('0x37')](db['SalesforceConfiguration'][_0xac4a('0x35')]);_0x1764bf[_0xac4a('0x38')]=_[_0xac4a('0x37')](_0x41d11d['query']);_0x1764bf['filters']=_[_0xac4a('0x39')](_0x1764bf['model'],_0x1764bf[_0xac4a('0x38')]);_0x58759a['attributes']=_[_0xac4a('0x39')](_0x1764bf['model'],qs[_0xac4a('0x3a')](_0x41d11d[_0xac4a('0x38')][_0xac4a('0x3a')]));_0x58759a[_0xac4a('0x3b')]=_0x58759a['attributes'][_0xac4a('0x4d')]?_0x58759a[_0xac4a('0x3b')]:_0x1764bf[_0xac4a('0x36')];if(_0x41d11d[_0xac4a('0x38')][_0xac4a('0x47')]){_0x58759a[_0xac4a('0x48')]=[{'all':!![]}];}_0x58759a=_[_0xac4a('0x41')]({},_0x58759a,_0x41d11d['options']);return db[_0xac4a('0x34')][_0xac4a('0x4e')](_0x58759a)['then'](handleEntityNotFound(_0xeca4e9,null))[_0xac4a('0x19')](respondWithResult(_0xeca4e9,null))[_0xac4a('0x23')](handleError(_0xeca4e9,null));};exports[_0xac4a('0x4f')]=function(_0x3ac36e,_0x4bb2fb){return db[_0xac4a('0x34')][_0xac4a('0x4f')](_0x3ac36e[_0xac4a('0x50')],{})[_0xac4a('0x19')](respondWithResult(_0x4bb2fb,0xc9))[_0xac4a('0x23')](handleError(_0x4bb2fb,null));};exports['update']=function(_0x179373,_0x564b10){if(_0x179373[_0xac4a('0x50')]['id']){delete _0x179373[_0xac4a('0x50')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x179373[_0xac4a('0x4c')]['id']}})[_0xac4a('0x19')](handleEntityNotFound(_0x564b10,null))['then'](saveUpdates(_0x179373[_0xac4a('0x50')],null))[_0xac4a('0x19')](respondWithResult(_0x564b10,null))[_0xac4a('0x23')](handleError(_0x564b10,null));};exports[_0xac4a('0x2f')]=function(_0x48900f,_0x3057d6){return db[_0xac4a('0x34')][_0xac4a('0x4e')]({'where':{'id':_0x48900f[_0xac4a('0x4c')]['id']}})[_0xac4a('0x19')](handleEntityNotFound(_0x3057d6,null))[_0xac4a('0x19')](removeEntity(_0x3057d6,null))[_0xac4a('0x23')](handleError(_0x3057d6,null));};exports['getFields']=function(_0x39123d,_0xef51d0,_0xe870ba){var _0x156dd2={};var _0x1b7231={};var _0x2ac1e9;var _0x213df2;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0x39123d[_0xac4a('0x4c')]['id']}})[_0xac4a('0x19')](handleEntityNotFound(_0xef51d0,null))[_0xac4a('0x19')](function(_0x400ac4){if(_0x400ac4){_0x2ac1e9=_0x400ac4;_0x1b7231[_0xac4a('0x36')]=_[_0xac4a('0x37')](db[_0xac4a('0x52')]['rawAttributes']);_0x1b7231[_0xac4a('0x38')]=_['keys'](_0x39123d[_0xac4a('0x38')]);_0x1b7231['filters']=_[_0xac4a('0x39')](_0x1b7231['model'],_0x1b7231[_0xac4a('0x38')]);_0x156dd2['attributes']=_['intersection'](_0x1b7231[_0xac4a('0x36')],qs[_0xac4a('0x3a')](_0x39123d[_0xac4a('0x38')][_0xac4a('0x3a')]));_0x156dd2[_0xac4a('0x3b')]=_0x156dd2[_0xac4a('0x3b')]['length']?_0x156dd2[_0xac4a('0x3b')]:_0x1b7231['model'];_0x156dd2[_0xac4a('0x3c')]=qs['sort'](_0x39123d[_0xac4a('0x38')][_0xac4a('0x3d')]);_0x156dd2[_0xac4a('0x40')]=qs[_0xac4a('0x3e')](_[_0xac4a('0x53')](_0x39123d[_0xac4a('0x38')],_0x1b7231[_0xac4a('0x3e')]));if(_0x39123d[_0xac4a('0x38')][_0xac4a('0x3f')]){_0x156dd2[_0xac4a('0x40')]=_[_0xac4a('0x41')](_0x156dd2[_0xac4a('0x40')],{'$or':_[_0xac4a('0x42')](_0x156dd2[_0xac4a('0x3b')],function(_0x17ae93){var _0xf07212={};_0xf07212[_0x17ae93]={'$like':'%'+_0x39123d[_0xac4a('0x38')]['filter']+'%'};return _0xf07212;})});}_0x156dd2=_[_0xac4a('0x41')]({},_0x156dd2,_0x39123d[_0xac4a('0x46')]);return _0x2ac1e9['getFields'](_0x156dd2);}})[_0xac4a('0x19')](function(_0x34bd1c){if(_0x34bd1c){_0x213df2=_0x34bd1c[_0xac4a('0x4d')];if(!_0x39123d[_0xac4a('0x38')][_0xac4a('0x54')]('nolimit')){_0x156dd2['limit']=qs[_0xac4a('0x29')](_0x39123d[_0xac4a('0x38')][_0xac4a('0x29')]);_0x156dd2[_0xac4a('0x28')]=qs[_0xac4a('0x28')](_0x39123d[_0xac4a('0x38')][_0xac4a('0x28')]);}return _0x2ac1e9[_0xac4a('0x55')](_0x156dd2);}})[_0xac4a('0x19')](function(_0x295f21){if(_0x295f21){return _0x295f21?{'count':_0x213df2,'rows':_0x295f21}:null;}})[_0xac4a('0x19')](respondWithResult(_0xef51d0,null))['catch'](handleError(_0xef51d0,null));};exports['getSubjects']=function(_0x1ee825,_0x1febff,_0x2954fc){var _0x423f70={};var _0x663a97={};var _0x283107;var _0x1d24bb;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0x1ee825[_0xac4a('0x4c')]['id']}})[_0xac4a('0x19')](handleEntityNotFound(_0x1febff,null))[_0xac4a('0x19')](function(_0x5f0173){if(_0x5f0173){_0x283107=_0x5f0173;_0x663a97[_0xac4a('0x36')]=_[_0xac4a('0x37')](db[_0xac4a('0x52')][_0xac4a('0x35')]);_0x663a97['query']=_[_0xac4a('0x37')](_0x1ee825['query']);_0x663a97[_0xac4a('0x3e')]=_[_0xac4a('0x39')](_0x663a97['model'],_0x663a97['query']);_0x423f70[_0xac4a('0x3b')]=_[_0xac4a('0x39')](_0x663a97[_0xac4a('0x36')],qs['fields'](_0x1ee825[_0xac4a('0x38')]['fields']));_0x423f70[_0xac4a('0x3b')]=_0x423f70['attributes']['length']?_0x423f70[_0xac4a('0x3b')]:_0x663a97['model'];_0x423f70[_0xac4a('0x3c')]=qs['sort'](_0x1ee825[_0xac4a('0x38')][_0xac4a('0x3d')]);_0x423f70['where']=qs[_0xac4a('0x3e')](_['pick'](_0x1ee825[_0xac4a('0x38')],_0x663a97[_0xac4a('0x3e')]));if(_0x1ee825['query'][_0xac4a('0x3f')]){_0x423f70['where']=_['merge'](_0x423f70[_0xac4a('0x40')],{'$or':_['map'](_0x423f70[_0xac4a('0x3b')],function(_0x558c43){var _0x4ccd67={};_0x4ccd67[_0x558c43]={'$like':'%'+_0x1ee825[_0xac4a('0x38')][_0xac4a('0x3f')]+'%'};return _0x4ccd67;})});}_0x423f70=_[_0xac4a('0x41')]({},_0x423f70,_0x1ee825['options']);return _0x283107['getSubjects'](_0x423f70);}})[_0xac4a('0x19')](function(_0x9c0fa1){if(_0x9c0fa1){_0x1d24bb=_0x9c0fa1['length'];if(!_0x1ee825['query'][_0xac4a('0x54')](_0xac4a('0x56'))){_0x423f70[_0xac4a('0x29')]=qs[_0xac4a('0x29')](_0x1ee825[_0xac4a('0x38')][_0xac4a('0x29')]);_0x423f70[_0xac4a('0x28')]=qs[_0xac4a('0x28')](_0x1ee825[_0xac4a('0x38')]['offset']);}return _0x283107[_0xac4a('0x57')](_0x423f70);}})[_0xac4a('0x19')](function(_0x3ba61e){if(_0x3ba61e){return _0x3ba61e?{'count':_0x1d24bb,'rows':_0x3ba61e}:null;}})['then'](respondWithResult(_0x1febff,null))[_0xac4a('0x23')](handleError(_0x1febff,null));};exports[_0xac4a('0x58')]=function(_0x7c9bbe,_0x391c35,_0x3d2b5c){var _0x5daf44={};var _0x290a73={};var _0x19ce24;var _0xc9d040;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0x7c9bbe[_0xac4a('0x4c')]['id']}})[_0xac4a('0x19')](handleEntityNotFound(_0x391c35,null))['then'](function(_0x2e3bb7){if(_0x2e3bb7){_0x19ce24=_0x2e3bb7;_0x290a73[_0xac4a('0x36')]=_[_0xac4a('0x37')](db[_0xac4a('0x52')][_0xac4a('0x35')]);_0x290a73[_0xac4a('0x38')]=_['keys'](_0x7c9bbe[_0xac4a('0x38')]);_0x290a73[_0xac4a('0x3e')]=_[_0xac4a('0x39')](_0x290a73[_0xac4a('0x36')],_0x290a73['query']);_0x5daf44[_0xac4a('0x3b')]=_['intersection'](_0x290a73[_0xac4a('0x36')],qs[_0xac4a('0x3a')](_0x7c9bbe['query']['fields']));_0x5daf44[_0xac4a('0x3b')]=_0x5daf44[_0xac4a('0x3b')][_0xac4a('0x4d')]?_0x5daf44['attributes']:_0x290a73[_0xac4a('0x36')];_0x5daf44['order']=qs[_0xac4a('0x3d')](_0x7c9bbe[_0xac4a('0x38')][_0xac4a('0x3d')]);_0x5daf44[_0xac4a('0x40')]=qs[_0xac4a('0x3e')](_['pick'](_0x7c9bbe['query'],_0x290a73[_0xac4a('0x3e')]));if(_0x7c9bbe[_0xac4a('0x38')][_0xac4a('0x3f')]){_0x5daf44[_0xac4a('0x40')]=_[_0xac4a('0x41')](_0x5daf44[_0xac4a('0x40')],{'$or':_[_0xac4a('0x42')](_0x5daf44[_0xac4a('0x3b')],function(_0x49ac09){var _0x52b3e6={};_0x52b3e6[_0x49ac09]={'$like':'%'+_0x7c9bbe[_0xac4a('0x38')][_0xac4a('0x3f')]+'%'};return _0x52b3e6;})});}_0x5daf44=_[_0xac4a('0x41')]({},_0x5daf44,_0x7c9bbe[_0xac4a('0x46')]);return _0x19ce24[_0xac4a('0x58')](_0x5daf44);}})[_0xac4a('0x19')](function(_0xdaa2ef){if(_0xdaa2ef){_0xc9d040=_0xdaa2ef[_0xac4a('0x4d')];if(!_0x7c9bbe['query']['hasOwnProperty'](_0xac4a('0x56'))){_0x5daf44[_0xac4a('0x29')]=qs[_0xac4a('0x29')](_0x7c9bbe[_0xac4a('0x38')][_0xac4a('0x29')]);_0x5daf44[_0xac4a('0x28')]=qs[_0xac4a('0x28')](_0x7c9bbe['query'][_0xac4a('0x28')]);}return _0x19ce24[_0xac4a('0x58')](_0x5daf44);}})[_0xac4a('0x19')](function(_0x5f323d){if(_0x5f323d){return _0x5f323d?{'count':_0xc9d040,'rows':_0x5f323d}:null;}})[_0xac4a('0x19')](respondWithResult(_0x391c35,null))[_0xac4a('0x23')](handleError(_0x391c35,null));}; \ No newline at end of file +var _0x326f=['keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','findAll','catch','show','params','rawAttributes','include','body','find','getFields','findOne','order','nolimit','getSubjects','SalesforceField','getDescriptions','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/environment','jayson/promise','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','stack','name','send','index','SalesforceConfiguration'];(function(_0x18eb0b,_0x11077e){var _0x1ddc58=function(_0x42dffa){while(--_0x42dffa){_0x18eb0b['push'](_0x18eb0b['shift']());}};_0x1ddc58(++_0x11077e);}(_0x326f,0xd1));var _0xf326=function(_0x1a0188,_0x2c6ea0){_0x1a0188=_0x1a0188-0x0;var _0x1be89d=_0x326f[_0x1a0188];return _0x1be89d;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var authService=require(_0xf326('0x10'));var hardwareService=require(_0xf326('0x11'));var Redis=require(_0xf326('0x12'));var qs=require(_0xf326('0x13'));var logger=require('../../config/logger')(_0xf326('0x14'));var utils=require('../../config/utils');var config=require(_0xf326('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf326('0x16'));var client=jayson['client'][_0xf326('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x9ed463,_0x4b3966,_0x342fe5,_0x472632){return new BPromise(function(_0x3504eb,_0x17a098){var _0x5c8483=_0x472632||client;return _0x5c8483[_0xf326('0x18')](_0x9ed463,_0x342fe5)['then'](function(_0x54bd1a){logger[_0xf326('0x19')](_0xf326('0x1a'),_0x4b3966,_0xf326('0x1b'));logger[_0xf326('0x1c')](_0xf326('0x1d'),_0x4b3966,_0xf326('0x1b'),JSON[_0xf326('0x1e')](_0x54bd1a));if(_0x54bd1a[_0xf326('0x1f')]){if(_0x54bd1a['error'][_0xf326('0x20')]===0x1f4){logger[_0xf326('0x1f')](_0xf326('0x1a'),_0x4b3966,_0x54bd1a[_0xf326('0x1f')][_0xf326('0x21')]);return _0x17a098(_0x54bd1a[_0xf326('0x1f')]['message']);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x4b3966,_0x54bd1a[_0xf326('0x1f')][_0xf326('0x21')]);return _0x3504eb(_0x54bd1a['error']['message']);}else{logger[_0xf326('0x19')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4b3966,'request\x20sent');_0x3504eb(_0x54bd1a[_0xf326('0x22')][_0xf326('0x21')]);}})['catch'](function(_0x5aa184){logger[_0xf326('0x1f')](_0xf326('0x1a'),_0x4b3966,_0x5aa184);_0x17a098(_0x5aa184);});});}function respondWithStatusCode(_0x5f21a2,_0x337ed5){_0x337ed5=_0x337ed5||0xcc;return function(_0x1b9039){if(_0x1b9039){return _0x5f21a2[_0xf326('0x23')](_0x337ed5);}return _0x5f21a2[_0xf326('0x24')](_0x337ed5)[_0xf326('0x25')]();};}function respondWithResult(_0x2049ec,_0x5ce532){_0x5ce532=_0x5ce532||0xc8;return function(_0x55b9f4){if(_0x55b9f4){return _0x2049ec['status'](_0x5ce532)[_0xf326('0x26')](_0x55b9f4);}};}function respondWithFilteredResult(_0x1a2c4e,_0x2cd45a){return function(_0x1ff2b5){if(_0x1ff2b5){var _0x148953=_0x1ff2b5[_0xf326('0x27')],_0x410237=_0x2cd45a[_0xf326('0x28')],_0x5217d4=_0x2cd45a['offset']+_0x2cd45a[_0xf326('0x29')],_0x201d28;if(_0x5217d4>=_0x148953){_0x5217d4=_0x148953;_0x201d28=0xc8;}else{_0x201d28=0xce;}_0x1a2c4e['status'](_0x201d28);return _0x1a2c4e['set'](_0xf326('0x2a'),_0x410237+'-'+_0x5217d4+'/'+_0x148953)[_0xf326('0x26')](_0x1ff2b5);}return null;};}function patchUpdates(_0x2fa28e){return function(_0x5dbe63){try{jsonpatch[_0xf326('0x2b')](_0x5dbe63,_0x2fa28e,!![]);}catch(_0x292500){return BPromise['reject'](_0x292500);}return _0x5dbe63[_0xf326('0x2c')]();};}function saveUpdates(_0x119ab8,_0xd77aba){return function(_0x18d110){if(_0x18d110){return _0x18d110[_0xf326('0x2d')](_0x119ab8)[_0xf326('0x2e')](function(_0x161143){return _0x161143;});}return null;};}function removeEntity(_0x39a1e2,_0x43b951){return function(_0x349a03){if(_0x349a03){return _0x349a03['destroy']()[_0xf326('0x2e')](function(){_0x39a1e2[_0xf326('0x24')](0xcc)[_0xf326('0x25')]();});}};}function handleEntityNotFound(_0x4792d2,_0x2c0cac){return function(_0x1721fd){if(!_0x1721fd){_0x4792d2[_0xf326('0x23')](0x194);}return _0x1721fd;};}function handleError(_0x4df451,_0x5b101d){_0x5b101d=_0x5b101d||0x1f4;return function(_0x2b8b31){logger[_0xf326('0x1f')](_0x2b8b31[_0xf326('0x2f')]);if(_0x2b8b31[_0xf326('0x30')]){delete _0x2b8b31[_0xf326('0x30')];}_0x4df451[_0xf326('0x24')](_0x5b101d)[_0xf326('0x31')](_0x2b8b31);};}exports[_0xf326('0x32')]=function(_0x580374,_0x461e93){var _0x1981bc={},_0x51207a={},_0x4083a2={'count':0x0,'rows':[]};var _0x4e5d7c=db[_0xf326('0x33')]['rawAttributes'];_0x51207a['model']=_[_0xf326('0x34')](_0x4e5d7c);_0x51207a['query']=_[_0xf326('0x34')](_0x580374['query']);_0x51207a[_0xf326('0x35')]=_[_0xf326('0x36')](_0x51207a[_0xf326('0x37')],_0x51207a['query']);_0x1981bc[_0xf326('0x38')]=_[_0xf326('0x36')](_0x51207a['model'],qs[_0xf326('0x39')](_0x580374[_0xf326('0x3a')][_0xf326('0x39')]));_0x1981bc[_0xf326('0x38')]=_0x1981bc['attributes'][_0xf326('0x3b')]?_0x1981bc[_0xf326('0x38')]:_0x51207a[_0xf326('0x37')];if(!_0x580374[_0xf326('0x3a')][_0xf326('0x3c')]('nolimit')){_0x1981bc[_0xf326('0x29')]=qs[_0xf326('0x29')](_0x580374['query']['limit']);_0x1981bc[_0xf326('0x28')]=qs['offset'](_0x580374['query'][_0xf326('0x28')]);}_0x1981bc['order']=qs[_0xf326('0x3d')](_0x580374[_0xf326('0x3a')][_0xf326('0x3d')]);_0x1981bc[_0xf326('0x3e')]=qs['filters'](_[_0xf326('0x3f')](_0x580374[_0xf326('0x3a')],_0x51207a[_0xf326('0x35')]));if(_0x580374[_0xf326('0x3a')][_0xf326('0x40')]){_0x1981bc[_0xf326('0x3e')]=_[_0xf326('0x41')](_0x1981bc[_0xf326('0x3e')],{'$or':_[_0xf326('0x42')](_0x4e5d7c,function(_0x1227d3){if(_0x1227d3[_0xf326('0x43')][_0xf326('0x44')]!=='VIRTUAL'){var _0x1b6126={};_0x1b6126[_0x1227d3[_0xf326('0x45')]]={'$like':'%'+_0x580374[_0xf326('0x3a')][_0xf326('0x40')]+'%'};return _0x1b6126;}})});}_0x1981bc=_[_0xf326('0x41')]({},_0x1981bc,_0x580374[_0xf326('0x46')]);var _0x4f4c51={'where':_0x1981bc[_0xf326('0x3e')]};return db[_0xf326('0x33')]['count'](_0x4f4c51)[_0xf326('0x2e')](function(_0x819bf6){_0x4083a2[_0xf326('0x27')]=_0x819bf6;if(_0x580374[_0xf326('0x3a')][_0xf326('0x47')]){_0x1981bc['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xf326('0x48')](_0x1981bc);})[_0xf326('0x2e')](function(_0x5ed62e){_0x4083a2['rows']=_0x5ed62e;return _0x4083a2;})[_0xf326('0x2e')](respondWithFilteredResult(_0x461e93,_0x1981bc))[_0xf326('0x49')](handleError(_0x461e93,null));};exports[_0xf326('0x4a')]=function(_0x5b3705,_0x301e65){var _0xe96e1e={'raw':![],'where':{'id':_0x5b3705[_0xf326('0x4b')]['id']}},_0x2180d6={};_0x2180d6[_0xf326('0x37')]=_[_0xf326('0x34')](db[_0xf326('0x33')][_0xf326('0x4c')]);_0x2180d6[_0xf326('0x3a')]=_[_0xf326('0x34')](_0x5b3705[_0xf326('0x3a')]);_0x2180d6[_0xf326('0x35')]=_[_0xf326('0x36')](_0x2180d6[_0xf326('0x37')],_0x2180d6[_0xf326('0x3a')]);_0xe96e1e['attributes']=_[_0xf326('0x36')](_0x2180d6[_0xf326('0x37')],qs[_0xf326('0x39')](_0x5b3705[_0xf326('0x3a')]['fields']));_0xe96e1e[_0xf326('0x38')]=_0xe96e1e[_0xf326('0x38')][_0xf326('0x3b')]?_0xe96e1e[_0xf326('0x38')]:_0x2180d6['model'];if(_0x5b3705[_0xf326('0x3a')][_0xf326('0x47')]){_0xe96e1e[_0xf326('0x4d')]=[{'all':!![]}];}_0xe96e1e=_[_0xf326('0x41')]({},_0xe96e1e,_0x5b3705[_0xf326('0x46')]);return db['SalesforceConfiguration']['find'](_0xe96e1e)[_0xf326('0x2e')](handleEntityNotFound(_0x301e65,null))[_0xf326('0x2e')](respondWithResult(_0x301e65,null))[_0xf326('0x49')](handleError(_0x301e65,null));};exports['create']=function(_0x102fba,_0x4650db){return db[_0xf326('0x33')]['create'](_0x102fba['body'],{})[_0xf326('0x2e')](respondWithResult(_0x4650db,0xc9))['catch'](handleError(_0x4650db,null));};exports[_0xf326('0x2d')]=function(_0x554277,_0x458e5f){if(_0x554277[_0xf326('0x4e')]['id']){delete _0x554277[_0xf326('0x4e')]['id'];}return db[_0xf326('0x33')][_0xf326('0x4f')]({'where':{'id':_0x554277[_0xf326('0x4b')]['id']}})[_0xf326('0x2e')](handleEntityNotFound(_0x458e5f,null))['then'](saveUpdates(_0x554277[_0xf326('0x4e')],null))[_0xf326('0x2e')](respondWithResult(_0x458e5f,null))[_0xf326('0x49')](handleError(_0x458e5f,null));};exports['destroy']=function(_0x208ba4,_0x3a832f){return db[_0xf326('0x33')][_0xf326('0x4f')]({'where':{'id':_0x208ba4[_0xf326('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3a832f,null))[_0xf326('0x2e')](removeEntity(_0x3a832f,null))[_0xf326('0x49')](handleError(_0x3a832f,null));};exports[_0xf326('0x50')]=function(_0x46a21f,_0x50690e,_0x3d0c12){var _0x2c362f={};var _0x227850={};var _0x29e52e;var _0x4d3b9e;return db['SalesforceConfiguration'][_0xf326('0x51')]({'where':{'id':_0x46a21f[_0xf326('0x4b')]['id']}})['then'](handleEntityNotFound(_0x50690e,null))[_0xf326('0x2e')](function(_0x29de71){if(_0x29de71){_0x29e52e=_0x29de71;_0x227850[_0xf326('0x37')]=_[_0xf326('0x34')](db['SalesforceField'][_0xf326('0x4c')]);_0x227850['query']=_['keys'](_0x46a21f[_0xf326('0x3a')]);_0x227850['filters']=_[_0xf326('0x36')](_0x227850[_0xf326('0x37')],_0x227850[_0xf326('0x3a')]);_0x2c362f['attributes']=_['intersection'](_0x227850[_0xf326('0x37')],qs[_0xf326('0x39')](_0x46a21f[_0xf326('0x3a')]['fields']));_0x2c362f[_0xf326('0x38')]=_0x2c362f['attributes'][_0xf326('0x3b')]?_0x2c362f[_0xf326('0x38')]:_0x227850[_0xf326('0x37')];_0x2c362f[_0xf326('0x52')]=qs[_0xf326('0x3d')](_0x46a21f[_0xf326('0x3a')][_0xf326('0x3d')]);_0x2c362f[_0xf326('0x3e')]=qs[_0xf326('0x35')](_[_0xf326('0x3f')](_0x46a21f[_0xf326('0x3a')],_0x227850[_0xf326('0x35')]));if(_0x46a21f[_0xf326('0x3a')]['filter']){_0x2c362f[_0xf326('0x3e')]=_['merge'](_0x2c362f[_0xf326('0x3e')],{'$or':_[_0xf326('0x42')](_0x2c362f['attributes'],function(_0x2b770c){var _0x5283da={};_0x5283da[_0x2b770c]={'$like':'%'+_0x46a21f[_0xf326('0x3a')][_0xf326('0x40')]+'%'};return _0x5283da;})});}_0x2c362f=_[_0xf326('0x41')]({},_0x2c362f,_0x46a21f[_0xf326('0x46')]);return _0x29e52e[_0xf326('0x50')](_0x2c362f);}})['then'](function(_0x4ec099){if(_0x4ec099){_0x4d3b9e=_0x4ec099[_0xf326('0x3b')];if(!_0x46a21f[_0xf326('0x3a')][_0xf326('0x3c')](_0xf326('0x53'))){_0x2c362f[_0xf326('0x29')]=qs['limit'](_0x46a21f[_0xf326('0x3a')][_0xf326('0x29')]);_0x2c362f['offset']=qs['offset'](_0x46a21f['query'][_0xf326('0x28')]);}return _0x29e52e[_0xf326('0x50')](_0x2c362f);}})[_0xf326('0x2e')](function(_0x235525){if(_0x235525){return _0x235525?{'count':_0x4d3b9e,'rows':_0x235525}:null;}})[_0xf326('0x2e')](respondWithResult(_0x50690e,null))[_0xf326('0x49')](handleError(_0x50690e,null));};exports[_0xf326('0x54')]=function(_0x4b9013,_0x5c558,_0x588d26){var _0x3c3379={};var _0x13cf83={};var _0x58de1e;var _0x3717fe;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x4b9013[_0xf326('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5c558,null))[_0xf326('0x2e')](function(_0x3411a4){if(_0x3411a4){_0x58de1e=_0x3411a4;_0x13cf83[_0xf326('0x37')]=_[_0xf326('0x34')](db[_0xf326('0x55')]['rawAttributes']);_0x13cf83['query']=_['keys'](_0x4b9013[_0xf326('0x3a')]);_0x13cf83[_0xf326('0x35')]=_[_0xf326('0x36')](_0x13cf83[_0xf326('0x37')],_0x13cf83[_0xf326('0x3a')]);_0x3c3379['attributes']=_[_0xf326('0x36')](_0x13cf83[_0xf326('0x37')],qs[_0xf326('0x39')](_0x4b9013['query']['fields']));_0x3c3379[_0xf326('0x38')]=_0x3c3379[_0xf326('0x38')]['length']?_0x3c3379['attributes']:_0x13cf83[_0xf326('0x37')];_0x3c3379['order']=qs[_0xf326('0x3d')](_0x4b9013['query']['sort']);_0x3c3379['where']=qs[_0xf326('0x35')](_[_0xf326('0x3f')](_0x4b9013[_0xf326('0x3a')],_0x13cf83['filters']));if(_0x4b9013[_0xf326('0x3a')][_0xf326('0x40')]){_0x3c3379[_0xf326('0x3e')]=_[_0xf326('0x41')](_0x3c3379[_0xf326('0x3e')],{'$or':_[_0xf326('0x42')](_0x3c3379[_0xf326('0x38')],function(_0x23cc31){var _0x3855a4={};_0x3855a4[_0x23cc31]={'$like':'%'+_0x4b9013['query'][_0xf326('0x40')]+'%'};return _0x3855a4;})});}_0x3c3379=_['merge']({},_0x3c3379,_0x4b9013[_0xf326('0x46')]);return _0x58de1e[_0xf326('0x54')](_0x3c3379);}})[_0xf326('0x2e')](function(_0x4ba982){if(_0x4ba982){_0x3717fe=_0x4ba982[_0xf326('0x3b')];if(!_0x4b9013[_0xf326('0x3a')][_0xf326('0x3c')]('nolimit')){_0x3c3379[_0xf326('0x29')]=qs[_0xf326('0x29')](_0x4b9013[_0xf326('0x3a')][_0xf326('0x29')]);_0x3c3379['offset']=qs[_0xf326('0x28')](_0x4b9013['query']['offset']);}return _0x58de1e[_0xf326('0x54')](_0x3c3379);}})[_0xf326('0x2e')](function(_0x5af6b7){if(_0x5af6b7){return _0x5af6b7?{'count':_0x3717fe,'rows':_0x5af6b7}:null;}})['then'](respondWithResult(_0x5c558,null))['catch'](handleError(_0x5c558,null));};exports[_0xf326('0x56')]=function(_0x543689,_0x102d03,_0x37a564){var _0x3434b2={};var _0x2ec314={};var _0xf76a89;var _0x25b56c;return db['SalesforceConfiguration'][_0xf326('0x51')]({'where':{'id':_0x543689[_0xf326('0x4b')]['id']}})['then'](handleEntityNotFound(_0x102d03,null))['then'](function(_0x14eecc){if(_0x14eecc){_0xf76a89=_0x14eecc;_0x2ec314['model']=_[_0xf326('0x34')](db[_0xf326('0x55')][_0xf326('0x4c')]);_0x2ec314[_0xf326('0x3a')]=_[_0xf326('0x34')](_0x543689[_0xf326('0x3a')]);_0x2ec314[_0xf326('0x35')]=_[_0xf326('0x36')](_0x2ec314[_0xf326('0x37')],_0x2ec314['query']);_0x3434b2[_0xf326('0x38')]=_[_0xf326('0x36')](_0x2ec314['model'],qs[_0xf326('0x39')](_0x543689['query'][_0xf326('0x39')]));_0x3434b2[_0xf326('0x38')]=_0x3434b2[_0xf326('0x38')]['length']?_0x3434b2[_0xf326('0x38')]:_0x2ec314[_0xf326('0x37')];_0x3434b2[_0xf326('0x52')]=qs[_0xf326('0x3d')](_0x543689[_0xf326('0x3a')][_0xf326('0x3d')]);_0x3434b2[_0xf326('0x3e')]=qs[_0xf326('0x35')](_[_0xf326('0x3f')](_0x543689[_0xf326('0x3a')],_0x2ec314[_0xf326('0x35')]));if(_0x543689[_0xf326('0x3a')][_0xf326('0x40')]){_0x3434b2[_0xf326('0x3e')]=_[_0xf326('0x41')](_0x3434b2['where'],{'$or':_[_0xf326('0x42')](_0x3434b2[_0xf326('0x38')],function(_0x4829ae){var _0x438daa={};_0x438daa[_0x4829ae]={'$like':'%'+_0x543689[_0xf326('0x3a')]['filter']+'%'};return _0x438daa;})});}_0x3434b2=_[_0xf326('0x41')]({},_0x3434b2,_0x543689[_0xf326('0x46')]);return _0xf76a89[_0xf326('0x56')](_0x3434b2);}})[_0xf326('0x2e')](function(_0x2ab607){if(_0x2ab607){_0x25b56c=_0x2ab607[_0xf326('0x3b')];if(!_0x543689[_0xf326('0x3a')]['hasOwnProperty'](_0xf326('0x53'))){_0x3434b2[_0xf326('0x29')]=qs[_0xf326('0x29')](_0x543689[_0xf326('0x3a')][_0xf326('0x29')]);_0x3434b2[_0xf326('0x28')]=qs[_0xf326('0x28')](_0x543689[_0xf326('0x3a')]['offset']);}return _0xf76a89[_0xf326('0x56')](_0x3434b2);}})[_0xf326('0x2e')](function(_0x49c3da){if(_0x49c3da){return _0x49c3da?{'count':_0x25b56c,'rows':_0x49c3da}:null;}})[_0xf326('0x2e')](respondWithResult(_0x102d03,null))['catch'](handleError(_0x102d03,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 31d4dc9..b0581f5 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 _0xb5e7=['util','../../config/logger','api','moment','request-promise','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash'];(function(_0x1682c0,_0x14af51){var _0x456341=function(_0x151a67){while(--_0x151a67){_0x1682c0['push'](_0x1682c0['shift']());}};_0x456341(++_0x14af51);}(_0xb5e7,0x9f));var _0x7b5e=function(_0x298e99,_0x1a095c){_0x298e99=_0x298e99-0x0;var _0x4fe630=_0xb5e7[_0x298e99];return _0x4fe630;};'use strict';var _=require(_0x7b5e('0x0'));var util=require(_0x7b5e('0x1'));var logger=require(_0x7b5e('0x2'))(_0x7b5e('0x3'));var moment=require(_0x7b5e('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b5e('0x5'));var attributes=require(_0x7b5e('0x6'));module[_0x7b5e('0x7')]=function(_0x4772f7,_0x2f9072){return _0x4772f7[_0x7b5e('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0x7b5e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdec3=['moment','request-promise','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api'];(function(_0x5499c2,_0x492ea1){var _0x220de1=function(_0x15db67){while(--_0x15db67){_0x5499c2['push'](_0x5499c2['shift']());}};_0x220de1(++_0x492ea1);}(_0xdec3,0x89));var _0x3dec=function(_0x17c8cd,_0x230826){_0x17c8cd=_0x17c8cd-0x0;var _0x1a8039=_0xdec3[_0x17c8cd];return _0x1a8039;};'use strict';var _=require(_0x3dec('0x0'));var util=require('util');var logger=require(_0x3dec('0x1'))(_0x3dec('0x2'));var moment=require(_0x3dec('0x3'));var BPromise=require('bluebird');var rp=require(_0x3dec('0x4'));var attributes=require(_0x3dec('0x5'));module[_0x3dec('0x6')]=function(_0x113b21,_0x5ca438){return _0x113b21[_0x3dec('0x7')](_0x3dec('0x8'),attributes,{'tableName':_0x3dec('0x9'),'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 988ca62..3c76471 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 _0x1261=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x57013d,_0x290a6b){var _0x3cc9ee=function(_0x1266ce){while(--_0x1266ce){_0x57013d['push'](_0x57013d['shift']());}};_0x3cc9ee(++_0x290a6b);}(_0x1261,0x144));var _0x1126=function(_0x36b037,_0x2b234e){_0x36b037=_0x36b037-0x0;var _0x409194=_0x1261[_0x36b037];return _0x409194;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x326f=['info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x578a85,_0x37735b){var _0x129db2=function(_0x5a0dda){while(--_0x5a0dda){_0x578a85['push'](_0x578a85['shift']());}};_0x129db2(++_0x37735b);}(_0x326f,0xd1));var _0xf326=function(_0x559c21,_0x4673d4){_0x559c21=_0x559c21-0x0;var _0x325cb0=_0x326f[_0x559c21];return _0x325cb0;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 47eebde..441d03d 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 _0xf1aa=['connect-timeout','express','./intSalesforceField.controller','isAuthenticated','get','/:id','show','post','create','update','delete','exports','util','path'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xf1aa,0x7c));var _0xaf1a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf1aa[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xaf1a('0x0'));var path=require(_0xaf1a('0x1'));var timeout=require(_0xaf1a('0x2'));var express=require(_0xaf1a('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaf1a('0x4'));router['get']('/',auth[_0xaf1a('0x5')](),controller['index']);router[_0xaf1a('0x6')](_0xaf1a('0x7'),auth[_0xaf1a('0x5')](),controller[_0xaf1a('0x8')]);router[_0xaf1a('0x9')]('/',auth[_0xaf1a('0x5')](),controller[_0xaf1a('0xa')]);router['put'](_0xaf1a('0x7'),auth[_0xaf1a('0x5')](),controller[_0xaf1a('0xb')]);router[_0xaf1a('0xc')](_0xaf1a('0x7'),auth[_0xaf1a('0x5')](),controller['destroy']);module[_0xaf1a('0xd')]=router; \ No newline at end of file +var _0x1bae=['show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id'];(function(_0x462fe4,_0x394d3e){var _0x82b23a=function(_0x2c071f){while(--_0x2c071f){_0x462fe4['push'](_0x462fe4['shift']());}};_0x82b23a(++_0x394d3e);}(_0x1bae,0x170));var _0xe1ba=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1bae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xe1ba('0x0'));var path=require(_0xe1ba('0x1'));var timeout=require(_0xe1ba('0x2'));var express=require(_0xe1ba('0x3'));var router=express[_0xe1ba('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe1ba('0x5'));var config=require(_0xe1ba('0x6'));var controller=require(_0xe1ba('0x7'));router[_0xe1ba('0x8')]('/',auth[_0xe1ba('0x9')](),controller[_0xe1ba('0xa')]);router[_0xe1ba('0x8')](_0xe1ba('0xb'),auth['isAuthenticated'](),controller[_0xe1ba('0xc')]);router['post']('/',auth[_0xe1ba('0x9')](),controller[_0xe1ba('0xd')]);router[_0xe1ba('0xe')](_0xe1ba('0xb'),auth[_0xe1ba('0x9')](),controller[_0xe1ba('0xf')]);router[_0xe1ba('0x10')](_0xe1ba('0xb'),auth[_0xe1ba('0x9')](),controller[_0xe1ba('0x11')]);module[_0xe1ba('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 02700e8..0cb0ee6 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 _0xe2b0=['exports','ENUM','string','variable','customVariable','STRING'];(function(_0xf9ca46,_0x551b56){var _0x54a850=function(_0x2af45a){while(--_0x2af45a){_0xf9ca46['push'](_0xf9ca46['shift']());}};_0x54a850(++_0x551b56);}(_0xe2b0,0x168));var _0x0e2b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe2b0[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x0e2b('0x0')]={'type':{'type':Sequelize[_0x0e2b('0x1')](_0x0e2b('0x2'),_0x0e2b('0x3'),_0x0e2b('0x4'),'keyValue'),'defaultValue':_0x0e2b('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0e2b('0x5')]},'keyType':{'type':Sequelize[_0x0e2b('0x1')](_0x0e2b('0x2'),'variable',_0x0e2b('0x4'))},'keyContent':{'type':Sequelize[_0x0e2b('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x0e2b('0x5')]}}; \ No newline at end of file +var _0x2f40=['exports','ENUM','string','variable','customVariable','STRING','sequelize'];(function(_0x1a1d4a,_0x48ef2b){var _0x44fda1=function(_0x1c68b9){while(--_0x1c68b9){_0x1a1d4a['push'](_0x1a1d4a['shift']());}};_0x44fda1(++_0x48ef2b);}(_0x2f40,0x1e9));var _0x02f4=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x2f40[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x02f4('0x0'));module[_0x02f4('0x1')]={'type':{'type':Sequelize[_0x02f4('0x2')](_0x02f4('0x3'),_0x02f4('0x4'),_0x02f4('0x5'),'keyValue'),'defaultValue':_0x02f4('0x3')},'content':{'type':Sequelize[_0x02f4('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x02f4('0x2')](_0x02f4('0x3'),_0x02f4('0x4'),_0x02f4('0x5'))},'keyContent':{'type':Sequelize[_0x02f4('0x6')]},'idField':{'type':Sequelize[_0x02f4('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index a8b2396..3f019bc 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 _0xad94=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','count','offset','limit','set','json','apply','then','end','error','name','send','index','SalesforceField','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','type','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','create','update','body','find','destroy'];(function(_0x13f0dc,_0x50b425){var _0x50def6=function(_0x142254){while(--_0x142254){_0x13f0dc['push'](_0x13f0dc['shift']());}};_0x50def6(++_0x50b425);}(_0xad94,0x1dc));var _0x4ad9=function(_0x4e7a65,_0x56cff5){_0x4e7a65=_0x4e7a65-0x0;var _0x44cc29=_0xad94[_0x4e7a65];return _0x44cc29;};'use strict';var pdf=require(_0x4ad9('0x0'));var emlformat=require(_0x4ad9('0x1'));var rimraf=require(_0x4ad9('0x2'));var zipdir=require(_0x4ad9('0x3'));var jsonpatch=require(_0x4ad9('0x4'));var rp=require(_0x4ad9('0x5'));var moment=require(_0x4ad9('0x6'));var BPromise=require(_0x4ad9('0x7'));var Mustache=require('mustache');var util=require(_0x4ad9('0x8'));var path=require('path');var sox=require(_0x4ad9('0x9'));var csv=require(_0x4ad9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4ad9('0xb'));var jsforce=require(_0x4ad9('0xc'));var deskjs=require(_0x4ad9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4ad9('0xe'));var Papa=require('papaparse');var authService=require(_0x4ad9('0xf'));var hardwareService=require(_0x4ad9('0x10'));var Redis=require(_0x4ad9('0x11'));var qs=require(_0x4ad9('0x12'));var logger=require(_0x4ad9('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48c16a,_0x3b8b2c){_0x3b8b2c=_0x3b8b2c||0xcc;return function(_0x526c48){if(_0x526c48){return _0x48c16a[_0x4ad9('0x14')](_0x3b8b2c);}return _0x48c16a[_0x4ad9('0x15')](_0x3b8b2c)['end']();};}function respondWithResult(_0x188d4b,_0x109c68){_0x109c68=_0x109c68||0xc8;return function(_0x22a7b2){if(_0x22a7b2){return _0x188d4b[_0x4ad9('0x15')](_0x109c68)['json'](_0x22a7b2);}};}function respondWithFilteredResult(_0xae9f3e,_0x2e0831){return function(_0x2e86af){if(_0x2e86af){var _0x55b02d=_0x2e86af[_0x4ad9('0x16')],_0x4a5266=_0x2e0831[_0x4ad9('0x17')],_0x39abf4=_0x2e0831[_0x4ad9('0x17')]+_0x2e0831[_0x4ad9('0x18')],_0x5cb15c;if(_0x39abf4>=_0x55b02d){_0x39abf4=_0x55b02d;_0x5cb15c=0xc8;}else{_0x5cb15c=0xce;}_0xae9f3e[_0x4ad9('0x15')](_0x5cb15c);return _0xae9f3e[_0x4ad9('0x19')]('Content-Range',_0x4a5266+'-'+_0x39abf4+'/'+_0x55b02d)[_0x4ad9('0x1a')](_0x2e86af);}return null;};}function patchUpdates(_0x51defa){return function(_0x49ee6a){try{jsonpatch[_0x4ad9('0x1b')](_0x49ee6a,_0x51defa,!![]);}catch(_0x176a38){return BPromise['reject'](_0x176a38);}return _0x49ee6a['save']();};}function saveUpdates(_0xd88a7f,_0x4eef13){return function(_0x5cf1d6){if(_0x5cf1d6){return _0x5cf1d6['update'](_0xd88a7f)[_0x4ad9('0x1c')](function(_0x51c2be){return _0x51c2be;});}return null;};}function removeEntity(_0x5e3956,_0x1c56d2){return function(_0x3635c2){if(_0x3635c2){return _0x3635c2['destroy']()[_0x4ad9('0x1c')](function(){_0x5e3956[_0x4ad9('0x15')](0xcc)[_0x4ad9('0x1d')]();});}};}function handleEntityNotFound(_0x34e763,_0x2017e2){return function(_0x182c9d){if(!_0x182c9d){_0x34e763[_0x4ad9('0x14')](0x194);}return _0x182c9d;};}function handleError(_0x36c20b,_0x2e2365){_0x2e2365=_0x2e2365||0x1f4;return function(_0x359665){logger[_0x4ad9('0x1e')](_0x359665['stack']);if(_0x359665[_0x4ad9('0x1f')]){delete _0x359665[_0x4ad9('0x1f')];}_0x36c20b['status'](_0x2e2365)[_0x4ad9('0x20')](_0x359665);};}exports[_0x4ad9('0x21')]=function(_0x73538f,_0x4704d0){var _0x459754={},_0x1dc33c={},_0x4c1f8d={'count':0x0,'rows':[]};var _0x47e2eb=db[_0x4ad9('0x22')]['rawAttributes'];_0x1dc33c[_0x4ad9('0x23')]=_[_0x4ad9('0x24')](_0x47e2eb);_0x1dc33c[_0x4ad9('0x25')]=_[_0x4ad9('0x24')](_0x73538f[_0x4ad9('0x25')]);_0x1dc33c['filters']=_['intersection'](_0x1dc33c[_0x4ad9('0x23')],_0x1dc33c[_0x4ad9('0x25')]);_0x459754[_0x4ad9('0x26')]=_[_0x4ad9('0x27')](_0x1dc33c[_0x4ad9('0x23')],qs[_0x4ad9('0x28')](_0x73538f[_0x4ad9('0x25')][_0x4ad9('0x28')]));_0x459754[_0x4ad9('0x26')]=_0x459754[_0x4ad9('0x26')]['length']?_0x459754['attributes']:_0x1dc33c[_0x4ad9('0x23')];if(!_0x73538f['query'][_0x4ad9('0x29')](_0x4ad9('0x2a'))){_0x459754['limit']=qs[_0x4ad9('0x18')](_0x73538f[_0x4ad9('0x25')][_0x4ad9('0x18')]);_0x459754[_0x4ad9('0x17')]=qs[_0x4ad9('0x17')](_0x73538f[_0x4ad9('0x25')][_0x4ad9('0x17')]);}_0x459754[_0x4ad9('0x2b')]=qs[_0x4ad9('0x2c')](_0x73538f[_0x4ad9('0x25')]['sort']);_0x459754[_0x4ad9('0x2d')]=qs['filters'](_['pick'](_0x73538f[_0x4ad9('0x25')],_0x1dc33c[_0x4ad9('0x2e')]));if(_0x73538f[_0x4ad9('0x25')][_0x4ad9('0x2f')]){_0x459754['where']=_[_0x4ad9('0x30')](_0x459754[_0x4ad9('0x2d')],{'$or':_[_0x4ad9('0x31')](_0x47e2eb,function(_0x4996e0){if(_0x4996e0[_0x4ad9('0x32')]['key']!==_0x4ad9('0x33')){var _0x3d5fc8={};_0x3d5fc8[_0x4996e0[_0x4ad9('0x34')]]={'$like':'%'+_0x73538f[_0x4ad9('0x25')]['filter']+'%'};return _0x3d5fc8;}})});}_0x459754=_['merge']({},_0x459754,_0x73538f[_0x4ad9('0x35')]);var _0x32bfc7={'where':_0x459754['where']};return db[_0x4ad9('0x22')][_0x4ad9('0x16')](_0x32bfc7)[_0x4ad9('0x1c')](function(_0x1bdf7d){_0x4c1f8d[_0x4ad9('0x16')]=_0x1bdf7d;if(_0x73538f['query'][_0x4ad9('0x36')]){_0x459754['include']=[{'all':!![]}];}return db['SalesforceField'][_0x4ad9('0x37')](_0x459754);})[_0x4ad9('0x1c')](function(_0x406ea1){_0x4c1f8d[_0x4ad9('0x38')]=_0x406ea1;return _0x4c1f8d;})[_0x4ad9('0x1c')](respondWithFilteredResult(_0x4704d0,_0x459754))[_0x4ad9('0x39')](handleError(_0x4704d0,null));};exports[_0x4ad9('0x3a')]=function(_0x3f0041,_0x5b99dc){var _0xa05cdd={'raw':!![],'where':{'id':_0x3f0041[_0x4ad9('0x3b')]['id']}},_0x557026={};_0x557026['model']=_[_0x4ad9('0x24')](db[_0x4ad9('0x22')][_0x4ad9('0x3c')]);_0x557026['query']=_[_0x4ad9('0x24')](_0x3f0041[_0x4ad9('0x25')]);_0x557026[_0x4ad9('0x2e')]=_[_0x4ad9('0x27')](_0x557026[_0x4ad9('0x23')],_0x557026[_0x4ad9('0x25')]);_0xa05cdd['attributes']=_[_0x4ad9('0x27')](_0x557026['model'],qs[_0x4ad9('0x28')](_0x3f0041[_0x4ad9('0x25')]['fields']));_0xa05cdd['attributes']=_0xa05cdd[_0x4ad9('0x26')][_0x4ad9('0x3d')]?_0xa05cdd[_0x4ad9('0x26')]:_0x557026[_0x4ad9('0x23')];if(_0x3f0041[_0x4ad9('0x25')]['includeAll']){_0xa05cdd[_0x4ad9('0x3e')]=[{'all':!![]}];}_0xa05cdd=_['merge']({},_0xa05cdd,_0x3f0041[_0x4ad9('0x35')]);return db[_0x4ad9('0x22')]['find'](_0xa05cdd)[_0x4ad9('0x1c')](handleEntityNotFound(_0x5b99dc,null))['then'](respondWithResult(_0x5b99dc,null))[_0x4ad9('0x39')](handleError(_0x5b99dc,null));};exports[_0x4ad9('0x3f')]=function(_0x28a049,_0x4eb429){return db[_0x4ad9('0x22')]['create'](_0x28a049['body'],{})[_0x4ad9('0x1c')](respondWithResult(_0x4eb429,0xc9))[_0x4ad9('0x39')](handleError(_0x4eb429,null));};exports[_0x4ad9('0x40')]=function(_0x5ad84e,_0x5d6107){if(_0x5ad84e[_0x4ad9('0x41')]['id']){delete _0x5ad84e[_0x4ad9('0x41')]['id'];}return db[_0x4ad9('0x22')][_0x4ad9('0x42')]({'where':{'id':_0x5ad84e['params']['id']}})[_0x4ad9('0x1c')](handleEntityNotFound(_0x5d6107,null))[_0x4ad9('0x1c')](saveUpdates(_0x5ad84e[_0x4ad9('0x41')],null))[_0x4ad9('0x1c')](respondWithResult(_0x5d6107,null))['catch'](handleError(_0x5d6107,null));};exports[_0x4ad9('0x43')]=function(_0x323cde,_0x16e696){return db[_0x4ad9('0x22')][_0x4ad9('0x42')]({'where':{'id':_0x323cde[_0x4ad9('0x3b')]['id']}})[_0x4ad9('0x1c')](handleEntityNotFound(_0x16e696,null))[_0x4ad9('0x1c')](removeEntity(_0x16e696,null))[_0x4ad9('0x39')](handleError(_0x16e696,null));}; \ No newline at end of file +var _0xe351=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','error','name','index','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','map','type','key','filter','options','SalesforceField','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x51fe0f,_0x50bdf8){var _0x57a835=function(_0x168c3b){while(--_0x168c3b){_0x51fe0f['push'](_0x51fe0f['shift']());}};_0x57a835(++_0x50bdf8);}(_0xe351,0x10b));var _0x1e35=function(_0x3325d1,_0x31429c){_0x3325d1=_0x3325d1-0x0;var _0x58b818=_0xe351[_0x3325d1];return _0x58b818;};'use strict';var pdf=require(_0x1e35('0x0'));var emlformat=require(_0x1e35('0x1'));var rimraf=require(_0x1e35('0x2'));var zipdir=require(_0x1e35('0x3'));var jsonpatch=require(_0x1e35('0x4'));var rp=require(_0x1e35('0x5'));var moment=require('moment');var BPromise=require(_0x1e35('0x6'));var Mustache=require(_0x1e35('0x7'));var util=require(_0x1e35('0x8'));var path=require(_0x1e35('0x9'));var sox=require(_0x1e35('0xa'));var csv=require(_0x1e35('0xb'));var ejs=require(_0x1e35('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1e35('0xd'));var crypto=require(_0x1e35('0xe'));var jsforce=require(_0x1e35('0xf'));var deskjs=require(_0x1e35('0x10'));var toCsv=require(_0x1e35('0xb'));var querystring=require(_0x1e35('0x11'));var Papa=require(_0x1e35('0x12'));var authService=require(_0x1e35('0x13'));var hardwareService=require(_0x1e35('0x14'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x1e35('0x15'))(_0x1e35('0x16'));var utils=require(_0x1e35('0x17'));var config=require('../../config/environment');var db=require(_0x1e35('0x18'))['db'];function respondWithStatusCode(_0x253231,_0x5ce219){_0x5ce219=_0x5ce219||0xcc;return function(_0x1a123b){if(_0x1a123b){return _0x253231[_0x1e35('0x19')](_0x5ce219);}return _0x253231[_0x1e35('0x1a')](_0x5ce219)[_0x1e35('0x1b')]();};}function respondWithResult(_0x16a7c8,_0x44a12d){_0x44a12d=_0x44a12d||0xc8;return function(_0x1cae72){if(_0x1cae72){return _0x16a7c8[_0x1e35('0x1a')](_0x44a12d)[_0x1e35('0x1c')](_0x1cae72);}};}function respondWithFilteredResult(_0x26cac4,_0x55ecc8){return function(_0x751709){if(_0x751709){var _0x54c5fa=_0x751709[_0x1e35('0x1d')],_0xec2e70=_0x55ecc8[_0x1e35('0x1e')],_0xcf431f=_0x55ecc8[_0x1e35('0x1e')]+_0x55ecc8[_0x1e35('0x1f')],_0x6f7e9f;if(_0xcf431f>=_0x54c5fa){_0xcf431f=_0x54c5fa;_0x6f7e9f=0xc8;}else{_0x6f7e9f=0xce;}_0x26cac4['status'](_0x6f7e9f);return _0x26cac4['set'](_0x1e35('0x20'),_0xec2e70+'-'+_0xcf431f+'/'+_0x54c5fa)[_0x1e35('0x1c')](_0x751709);}return null;};}function patchUpdates(_0x466134){return function(_0x636cfe){try{jsonpatch[_0x1e35('0x21')](_0x636cfe,_0x466134,!![]);}catch(_0x332206){return BPromise['reject'](_0x332206);}return _0x636cfe[_0x1e35('0x22')]();};}function saveUpdates(_0x33be6d,_0x3ce13c){return function(_0x32b996){if(_0x32b996){return _0x32b996[_0x1e35('0x23')](_0x33be6d)[_0x1e35('0x24')](function(_0x268b90){return _0x268b90;});}return null;};}function removeEntity(_0x33caa9,_0x38ce21){return function(_0x4ffaeb){if(_0x4ffaeb){return _0x4ffaeb['destroy']()[_0x1e35('0x24')](function(){_0x33caa9[_0x1e35('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x128d16,_0x418393){return function(_0x332f09){if(!_0x332f09){_0x128d16[_0x1e35('0x19')](0x194);}return _0x332f09;};}function handleError(_0x5ab0e1,_0x3c5c1d){_0x3c5c1d=_0x3c5c1d||0x1f4;return function(_0x4d25e8){logger[_0x1e35('0x25')](_0x4d25e8['stack']);if(_0x4d25e8[_0x1e35('0x26')]){delete _0x4d25e8[_0x1e35('0x26')];}_0x5ab0e1[_0x1e35('0x1a')](_0x3c5c1d)['send'](_0x4d25e8);};}exports[_0x1e35('0x27')]=function(_0x474c5c,_0xd832b2){var _0x9fe364={},_0x1b1656={},_0x2a9167={'count':0x0,'rows':[]};var _0x5ad740=db['SalesforceField']['rawAttributes'];_0x1b1656[_0x1e35('0x28')]=_['keys'](_0x5ad740);_0x1b1656[_0x1e35('0x29')]=_[_0x1e35('0x2a')](_0x474c5c['query']);_0x1b1656[_0x1e35('0x2b')]=_[_0x1e35('0x2c')](_0x1b1656[_0x1e35('0x28')],_0x1b1656[_0x1e35('0x29')]);_0x9fe364[_0x1e35('0x2d')]=_['intersection'](_0x1b1656[_0x1e35('0x28')],qs[_0x1e35('0x2e')](_0x474c5c[_0x1e35('0x29')][_0x1e35('0x2e')]));_0x9fe364[_0x1e35('0x2d')]=_0x9fe364[_0x1e35('0x2d')][_0x1e35('0x2f')]?_0x9fe364[_0x1e35('0x2d')]:_0x1b1656[_0x1e35('0x28')];if(!_0x474c5c[_0x1e35('0x29')][_0x1e35('0x30')](_0x1e35('0x31'))){_0x9fe364['limit']=qs[_0x1e35('0x1f')](_0x474c5c['query'][_0x1e35('0x1f')]);_0x9fe364[_0x1e35('0x1e')]=qs[_0x1e35('0x1e')](_0x474c5c[_0x1e35('0x29')][_0x1e35('0x1e')]);}_0x9fe364[_0x1e35('0x32')]=qs['sort'](_0x474c5c[_0x1e35('0x29')]['sort']);_0x9fe364[_0x1e35('0x33')]=qs[_0x1e35('0x2b')](_['pick'](_0x474c5c[_0x1e35('0x29')],_0x1b1656[_0x1e35('0x2b')]));if(_0x474c5c[_0x1e35('0x29')]['filter']){_0x9fe364[_0x1e35('0x33')]=_[_0x1e35('0x34')](_0x9fe364[_0x1e35('0x33')],{'$or':_[_0x1e35('0x35')](_0x5ad740,function(_0x30d154){if(_0x30d154[_0x1e35('0x36')][_0x1e35('0x37')]!=='VIRTUAL'){var _0x21e756={};_0x21e756[_0x30d154['field']]={'$like':'%'+_0x474c5c[_0x1e35('0x29')][_0x1e35('0x38')]+'%'};return _0x21e756;}})});}_0x9fe364=_[_0x1e35('0x34')]({},_0x9fe364,_0x474c5c[_0x1e35('0x39')]);var _0x2a38ac={'where':_0x9fe364[_0x1e35('0x33')]};return db[_0x1e35('0x3a')]['count'](_0x2a38ac)[_0x1e35('0x24')](function(_0x490d88){_0x2a9167[_0x1e35('0x1d')]=_0x490d88;if(_0x474c5c[_0x1e35('0x29')][_0x1e35('0x3b')]){_0x9fe364[_0x1e35('0x3c')]=[{'all':!![]}];}return db[_0x1e35('0x3a')][_0x1e35('0x3d')](_0x9fe364);})['then'](function(_0x14cd6d){_0x2a9167['rows']=_0x14cd6d;return _0x2a9167;})[_0x1e35('0x24')](respondWithFilteredResult(_0xd832b2,_0x9fe364))[_0x1e35('0x3e')](handleError(_0xd832b2,null));};exports[_0x1e35('0x3f')]=function(_0x12c962,_0xd36411){var _0x28d184={'raw':!![],'where':{'id':_0x12c962['params']['id']}},_0xaae193={};_0xaae193['model']=_[_0x1e35('0x2a')](db[_0x1e35('0x3a')][_0x1e35('0x40')]);_0xaae193[_0x1e35('0x29')]=_[_0x1e35('0x2a')](_0x12c962[_0x1e35('0x29')]);_0xaae193[_0x1e35('0x2b')]=_['intersection'](_0xaae193[_0x1e35('0x28')],_0xaae193[_0x1e35('0x29')]);_0x28d184[_0x1e35('0x2d')]=_[_0x1e35('0x2c')](_0xaae193[_0x1e35('0x28')],qs['fields'](_0x12c962['query'][_0x1e35('0x2e')]));_0x28d184[_0x1e35('0x2d')]=_0x28d184[_0x1e35('0x2d')][_0x1e35('0x2f')]?_0x28d184['attributes']:_0xaae193[_0x1e35('0x28')];if(_0x12c962[_0x1e35('0x29')]['includeAll']){_0x28d184[_0x1e35('0x3c')]=[{'all':!![]}];}_0x28d184=_[_0x1e35('0x34')]({},_0x28d184,_0x12c962[_0x1e35('0x39')]);return db[_0x1e35('0x3a')][_0x1e35('0x41')](_0x28d184)['then'](handleEntityNotFound(_0xd36411,null))[_0x1e35('0x24')](respondWithResult(_0xd36411,null))[_0x1e35('0x3e')](handleError(_0xd36411,null));};exports[_0x1e35('0x42')]=function(_0xf589ba,_0xbccedc){return db['SalesforceField']['create'](_0xf589ba[_0x1e35('0x43')],{})[_0x1e35('0x24')](respondWithResult(_0xbccedc,0xc9))[_0x1e35('0x3e')](handleError(_0xbccedc,null));};exports[_0x1e35('0x23')]=function(_0x1e26da,_0x494d16){if(_0x1e26da[_0x1e35('0x43')]['id']){delete _0x1e26da[_0x1e35('0x43')]['id'];}return db[_0x1e35('0x3a')][_0x1e35('0x41')]({'where':{'id':_0x1e26da[_0x1e35('0x44')]['id']}})[_0x1e35('0x24')](handleEntityNotFound(_0x494d16,null))[_0x1e35('0x24')](saveUpdates(_0x1e26da['body'],null))[_0x1e35('0x24')](respondWithResult(_0x494d16,null))[_0x1e35('0x3e')](handleError(_0x494d16,null));};exports[_0x1e35('0x45')]=function(_0x189a98,_0x11dca1){return db[_0x1e35('0x3a')]['find']({'where':{'id':_0x189a98['params']['id']}})[_0x1e35('0x24')](handleEntityNotFound(_0x11dca1,null))['then'](removeEntity(_0x11dca1,null))[_0x1e35('0x3e')](handleError(_0x11dca1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b803c6d..f2ef3cc 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 _0xd3ca=['lodash','api','moment','bluebird','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0x30be3d,_0x1e4354){var _0x516750=function(_0x5af8a5){while(--_0x5af8a5){_0x30be3d['push'](_0x30be3d['shift']());}};_0x516750(++_0x1e4354);}(_0xd3ca,0xfd));var _0xad3c=function(_0x20473f,_0x488290){_0x20473f=_0x20473f-0x0;var _0x2343ca=_0xd3ca[_0x20473f];return _0x2343ca;};'use strict';var _=require(_0xad3c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xad3c('0x1'));var moment=require(_0xad3c('0x2'));var BPromise=require(_0xad3c('0x3'));var rp=require('request-promise');var attributes=require(_0xad3c('0x4'));module['exports']=function(_0xec3bf5,_0x477677){return _0xec3bf5[_0xad3c('0x5')](_0xad3c('0x6'),attributes,{'tableName':_0xad3c('0x7'),'paranoid':![],'indexes':[{'name':_0xad3c('0x8'),'fields':[_0xad3c('0x9'),_0xad3c('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfaac=['../../config/logger','api','moment','bluebird','request-promise','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash'];(function(_0x2381dc,_0x31fc82){var _0x4b009f=function(_0x5e8fd2){while(--_0x5e8fd2){_0x2381dc['push'](_0x2381dc['shift']());}};_0x4b009f(++_0x31fc82);}(_0xfaac,0x8b));var _0xcfaa=function(_0xa2d980,_0xc66e83){_0xa2d980=_0xa2d980-0x0;var _0x4849a3=_0xfaac[_0xa2d980];return _0x4849a3;};'use strict';var _=require(_0xcfaa('0x0'));var util=require('util');var logger=require(_0xcfaa('0x1'))(_0xcfaa('0x2'));var moment=require(_0xcfaa('0x3'));var BPromise=require(_0xcfaa('0x4'));var rp=require(_0xcfaa('0x5'));var attributes=require(_0xcfaa('0x6'));module[_0xcfaa('0x7')]=function(_0x47244a,_0x5553b5){return _0x47244a[_0xcfaa('0x8')](_0xcfaa('0x9'),attributes,{'tableName':_0xcfaa('0xa'),'paranoid':![],'indexes':[{'name':_0xcfaa('0xb'),'fields':[_0xcfaa('0xc'),_0xcfaa('0xd')],'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 6ab5182..d903214 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 _0x059d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2c21a6,_0x430837){var _0x59fb85=function(_0xa79408){while(--_0xa79408){_0x2c21a6['push'](_0x2c21a6['shift']());}};_0x59fb85(++_0x430837);}(_0x059d,0xc9));var _0xd059=function(_0x223a2e,_0x285a32){_0x223a2e=_0x223a2e-0x0;var _0x1edb90=_0x059d[_0x223a2e];return _0x1edb90;};'use strict';var _=require(_0xd059('0x0'));var util=require(_0xd059('0x1'));var moment=require(_0xd059('0x2'));var BPromise=require(_0xd059('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd059('0x4'));var db=require(_0xd059('0x5'))['db'];var utils=require(_0xd059('0x6'));var logger=require(_0xd059('0x7'))(_0xd059('0x8'));var config=require(_0xd059('0x9'));var jayson=require(_0xd059('0xa'));var client=jayson['client'][_0xd059('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x123b4e,_0x3f257e,_0x40a0a9){return new BPromise(function(_0x1bcae7,_0x41fb11){return client[_0xd059('0xc')](_0x123b4e,_0x40a0a9)['then'](function(_0x47c432){logger[_0xd059('0xd')](_0xd059('0xe'),_0x3f257e,_0xd059('0xf'));logger[_0xd059('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3f257e,'request\x20sent',JSON[_0xd059('0x11')](_0x47c432));if(_0x47c432['error']){if(_0x47c432['error'][_0xd059('0x12')]===0x1f4){logger[_0xd059('0x13')]('SalesforceField,\x20%s,\x20%s',_0x3f257e,_0x47c432[_0xd059('0x13')][_0xd059('0x14')]);return _0x41fb11(_0x47c432[_0xd059('0x13')][_0xd059('0x14')]);}logger['error'](_0xd059('0xe'),_0x3f257e,_0x47c432[_0xd059('0x13')][_0xd059('0x14')]);return _0x1bcae7(_0x47c432['error']['message']);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x3f257e,'request\x20sent');_0x1bcae7(_0x47c432[_0xd059('0x15')][_0xd059('0x14')]);}})[_0xd059('0x16')](function(_0x38404f){logger[_0xd059('0x13')](_0xd059('0xe'),_0x3f257e,_0x38404f);_0x41fb11(_0x38404f);});});} \ No newline at end of file +var _0xc3fa=['http','request','info','SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xc3fa,0x84));var _0xac3f=function(_0x5aef17,_0x592cd4){_0x5aef17=_0x5aef17-0x0;var _0x43f9d0=_0xc3fa[_0x5aef17];return _0x43f9d0;};'use strict';var _=require(_0xac3f('0x0'));var util=require(_0xac3f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac3f('0x2'));var db=require(_0xac3f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac3f('0x4'));var config=require(_0xac3f('0x5'));var jayson=require(_0xac3f('0x6'));var client=jayson[_0xac3f('0x7')][_0xac3f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b253a,_0x3aa122,_0xc06517){return new BPromise(function(_0x5e7fa3,_0x51a801){return client[_0xac3f('0x9')](_0x5b253a,_0xc06517)['then'](function(_0x1fc879){logger[_0xac3f('0xa')](_0xac3f('0xb'),_0x3aa122,'request\x20sent');logger['debug'](_0xac3f('0xc'),_0x3aa122,'request\x20sent',JSON[_0xac3f('0xd')](_0x1fc879));if(_0x1fc879[_0xac3f('0xe')]){if(_0x1fc879[_0xac3f('0xe')][_0xac3f('0xf')]===0x1f4){logger[_0xac3f('0xe')](_0xac3f('0xb'),_0x3aa122,_0x1fc879[_0xac3f('0xe')][_0xac3f('0x10')]);return _0x51a801(_0x1fc879[_0xac3f('0xe')]['message']);}logger['error'](_0xac3f('0xb'),_0x3aa122,_0x1fc879['error'][_0xac3f('0x10')]);return _0x5e7fa3(_0x1fc879[_0xac3f('0xe')]['message']);}else{logger[_0xac3f('0xa')]('SalesforceField,\x20%s,\x20%s',_0x3aa122,_0xac3f('0x11'));_0x5e7fa3(_0x1fc879[_0xac3f('0x12')][_0xac3f('0x10')]);}})[_0xac3f('0x13')](function(_0x28cf74){logger[_0xac3f('0xe')](_0xac3f('0xb'),_0x3aa122,_0x28cf74);_0x51a801(_0x28cf74);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 2bd29bc..c76d143 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 _0xf996=['index','/:id','show','/:id/configurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated'];(function(_0xa42d39,_0x414d0a){var _0x12719a=function(_0x119f80){while(--_0x119f80){_0xa42d39['push'](_0xa42d39['shift']());}};_0x12719a(++_0x414d0a);}(_0xf996,0x132));var _0x6f99=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0xf996[_0xd63e3a];return _0x19c178;};'use strict';var multer=require(_0x6f99('0x0'));var util=require('util');var path=require(_0x6f99('0x1'));var timeout=require('connect-timeout');var express=require(_0x6f99('0x2'));var router=express[_0x6f99('0x3')]();var auth=require(_0x6f99('0x4'));var interaction=require(_0x6f99('0x5'));var config=require('../../config/environment');var controller=require(_0x6f99('0x6'));router[_0x6f99('0x7')]('/',auth[_0x6f99('0x8')](),controller[_0x6f99('0x9')]);router[_0x6f99('0x7')](_0x6f99('0xa'),auth[_0x6f99('0x8')](),controller[_0x6f99('0xb')]);router[_0x6f99('0x7')](_0x6f99('0xc'),auth[_0x6f99('0x8')](),controller['getConfigurations']);router[_0x6f99('0x7')](_0x6f99('0xd'),auth[_0x6f99('0x8')](),controller[_0x6f99('0xe')]);router[_0x6f99('0xf')]('/',auth[_0x6f99('0x8')](),controller['create']);router[_0x6f99('0xf')](_0x6f99('0xc'),auth[_0x6f99('0x8')](),controller['addConfiguration']);router[_0x6f99('0x10')](_0x6f99('0xa'),auth[_0x6f99('0x8')](),controller[_0x6f99('0x11')]);router[_0x6f99('0x12')](_0x6f99('0xa'),auth[_0x6f99('0x8')](),controller[_0x6f99('0x13')]);module[_0x6f99('0x14')]=router; \ No newline at end of file +var _0xda78=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update'];(function(_0x567e69,_0x1dc29c){var _0x1bf534=function(_0x917776){while(--_0x917776){_0x567e69['push'](_0x567e69['shift']());}};_0x1bf534(++_0x1dc29c);}(_0xda78,0x152));var _0x8da7=function(_0x4e949c,_0x551a49){_0x4e949c=_0x4e949c-0x0;var _0x344bf2=_0xda78[_0x4e949c];return _0x344bf2;};'use strict';var multer=require('multer');var util=require(_0x8da7('0x0'));var path=require(_0x8da7('0x1'));var timeout=require(_0x8da7('0x2'));var express=require(_0x8da7('0x3'));var router=express['Router']();var auth=require(_0x8da7('0x4'));var interaction=require(_0x8da7('0x5'));var config=require(_0x8da7('0x6'));var controller=require(_0x8da7('0x7'));router[_0x8da7('0x8')]('/',auth[_0x8da7('0x9')](),controller[_0x8da7('0xa')]);router['get'](_0x8da7('0xb'),auth[_0x8da7('0x9')](),controller['show']);router['get'](_0x8da7('0xc'),auth[_0x8da7('0x9')](),controller[_0x8da7('0xd')]);router[_0x8da7('0x8')](_0x8da7('0xe'),auth['isAuthenticated'](),controller[_0x8da7('0xf')]);router[_0x8da7('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8da7('0x10')](_0x8da7('0xc'),auth[_0x8da7('0x9')](),controller['addConfiguration']);router[_0x8da7('0x11')](_0x8da7('0xb'),auth['isAuthenticated'](),controller[_0x8da7('0x12')]);router['delete'](_0x8da7('0xb'),auth[_0x8da7('0x9')](),controller[_0x8da7('0x13')]);module[_0x8da7('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 7603d62..916e595 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 _0xbf6e=['username','STRING'];(function(_0x157c24,_0x164f98){var _0x34f2e1=function(_0x2ec48d){while(--_0x2ec48d){_0x157c24['push'](_0x157c24['shift']());}};_0x34f2e1(++_0x164f98);}(_0xbf6e,0x149));var _0xebf6=function(_0x14ba8b,_0x306a0a){_0x14ba8b=_0x14ba8b-0x0;var _0x44aaf0=_0xbf6e[_0x14ba8b];return _0x44aaf0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xebf6('0x0')]},'description':{'type':Sequelize[_0xebf6('0x0')]},'username':{'type':Sequelize[_0xebf6('0x0')],'unique':_0xebf6('0x1')},'password':{'type':Sequelize[_0xebf6('0x0')]},'email':{'type':Sequelize[_0xebf6('0x0')]},'remoteUri':{'type':Sequelize[_0xebf6('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xebf6('0x0')]}}; \ No newline at end of file +var _0x4c6d=['exports','STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x1667fd,_0x1d12fd){_0x1667fd=_0x1667fd-0x0;var _0x42f457=_0x4c6d[_0x1667fd];return _0x42f457;};'use strict';var Sequelize=require(_0xd4c6('0x0'));module[_0xd4c6('0x1')]={'name':{'type':Sequelize[_0xd4c6('0x2')]},'description':{'type':Sequelize[_0xd4c6('0x2')]},'username':{'type':Sequelize[_0xd4c6('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xd4c6('0x2')]},'email':{'type':Sequelize[_0xd4c6('0x2')]},'remoteUri':{'type':Sequelize[_0xd4c6('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd4c6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 5106617..36bbf87 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 _0x7bd0=['short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','category','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','log','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','statusCode','stack','send','test','Wrong\x20credentials','True','true','False','false','inactive','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','index','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','ServicenowAccount','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','knowledge','closed_at','impact','active','work_notes_list','business_service','priority','rfc','time_worked','expected_start','business_duration','group_list','reopened_time','resolved_at','approval_set','work_notes'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x7bd0,0x111));var _0x07bd=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0x7bd0[_0x562faa];return _0xc70f59;};'use strict';var pdf=require(_0x07bd('0x0'));var emlformat=require(_0x07bd('0x1'));var rimraf=require(_0x07bd('0x2'));var zipdir=require(_0x07bd('0x3'));var jsonpatch=require(_0x07bd('0x4'));var rp=require(_0x07bd('0x5'));var moment=require(_0x07bd('0x6'));var BPromise=require(_0x07bd('0x7'));var Mustache=require('mustache');var util=require(_0x07bd('0x8'));var path=require(_0x07bd('0x9'));var sox=require(_0x07bd('0xa'));var csv=require(_0x07bd('0xb'));var ejs=require(_0x07bd('0xc'));var fs=require('fs');var _=require(_0x07bd('0xd'));var squel=require(_0x07bd('0xe'));var crypto=require('crypto');var jsforce=require(_0x07bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07bd('0xb'));var querystring=require(_0x07bd('0x10'));var Papa=require(_0x07bd('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0x07bd('0x12'));var Redis=require(_0x07bd('0x13'));var qs=require(_0x07bd('0x14'));var logger=require(_0x07bd('0x15'))('api');var utils=require(_0x07bd('0x16'));var config=require(_0x07bd('0x17'));var db=require(_0x07bd('0x18'))['db'];var integrations=require(_0x07bd('0x19'));var jayson=require(_0x07bd('0x1a'));var client=jayson[_0x07bd('0x1b')][_0x07bd('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2b8409,_0x5c37dd,_0x51eb2a,_0x2ca1bc){return new BPromise(function(_0x3fe523,_0x1c59c2){var _0x247f3f=_0x2ca1bc||client;return _0x247f3f[_0x07bd('0x1d')](_0x2b8409,_0x51eb2a)[_0x07bd('0x1e')](function(_0x2c9166){logger['info'](_0x07bd('0x1f'),_0x5c37dd,'request\x20sent');logger[_0x07bd('0x20')](_0x07bd('0x21'),_0x5c37dd,_0x07bd('0x22'),JSON[_0x07bd('0x23')](_0x2c9166));if(_0x2c9166[_0x07bd('0x24')]){if(_0x2c9166['error'][_0x07bd('0x25')]===0x1f4){logger[_0x07bd('0x24')]('ServicenowAccount,\x20%s,\x20%s',_0x5c37dd,_0x2c9166[_0x07bd('0x24')][_0x07bd('0x26')]);return _0x1c59c2(_0x2c9166[_0x07bd('0x24')][_0x07bd('0x26')]);}logger[_0x07bd('0x24')](_0x07bd('0x1f'),_0x5c37dd,_0x2c9166[_0x07bd('0x24')][_0x07bd('0x26')]);return _0x3fe523(_0x2c9166[_0x07bd('0x24')]['message']);}else{logger[_0x07bd('0x27')](_0x07bd('0x1f'),_0x5c37dd,_0x07bd('0x22'));_0x3fe523(_0x2c9166[_0x07bd('0x28')][_0x07bd('0x26')]);}})['catch'](function(_0x4c673a){logger[_0x07bd('0x24')]('ServicenowAccount,\x20%s,\x20%s',_0x5c37dd,_0x4c673a);_0x1c59c2(_0x4c673a);});});}function respondWithStatusCode(_0x2b0dee,_0x480c9c){_0x480c9c=_0x480c9c||0xcc;return function(_0x50bd12){if(_0x50bd12){return _0x2b0dee[_0x07bd('0x29')](_0x480c9c);}return _0x2b0dee[_0x07bd('0x2a')](_0x480c9c)[_0x07bd('0x2b')]();};}function respondWithResult(_0xdb47ba,_0x28bd91){_0x28bd91=_0x28bd91||0xc8;return function(_0x43cbc8){if(_0x43cbc8){return _0xdb47ba['status'](_0x28bd91)[_0x07bd('0x2c')](_0x43cbc8);}};}function respondWithFilteredResult(_0x271623,_0x3db9d0){return function(_0x2a7202){if(_0x2a7202){var _0x12ce26=_0x2a7202['count'],_0x1c1fda=_0x3db9d0[_0x07bd('0x2d')],_0x571dab=_0x3db9d0[_0x07bd('0x2d')]+_0x3db9d0[_0x07bd('0x2e')],_0x56687f;if(_0x571dab>=_0x12ce26){_0x571dab=_0x12ce26;_0x56687f=0xc8;}else{_0x56687f=0xce;}_0x271623['status'](_0x56687f);return _0x271623[_0x07bd('0x2f')](_0x07bd('0x30'),_0x1c1fda+'-'+_0x571dab+'/'+_0x12ce26)[_0x07bd('0x2c')](_0x2a7202);}return null;};}function patchUpdates(_0x46ed12){return function(_0x3f9424){try{jsonpatch[_0x07bd('0x31')](_0x3f9424,_0x46ed12,!![]);}catch(_0x58f189){return BPromise[_0x07bd('0x32')](_0x58f189);}return _0x3f9424[_0x07bd('0x33')]();};}function saveUpdates(_0x4182b9,_0x321200){return function(_0x1b6cc){if(_0x1b6cc){return _0x1b6cc[_0x07bd('0x34')](_0x4182b9)[_0x07bd('0x1e')](function(_0x456004){return _0x456004;});}return null;};}function removeEntity(_0x4ff162,_0x594967){return function(_0x3fe506){if(_0x3fe506){return _0x3fe506[_0x07bd('0x35')]()[_0x07bd('0x1e')](function(){_0x4ff162['status'](0xcc)[_0x07bd('0x2b')]();});}};}function handleEntityNotFound(_0x2c8612,_0x208aca){return function(_0x5eb6ca){if(!_0x5eb6ca){_0x2c8612['sendStatus'](0x194);}return _0x5eb6ca;};}function handleError(_0x2c46f5,_0x185783){_0x185783=_0x185783||0x1f4;return function(_0x71c030){logger[_0x07bd('0x24')](_0x71c030['stack']);if(_0x71c030[_0x07bd('0x36')]){delete _0x71c030[_0x07bd('0x36')];}_0x2c46f5[_0x07bd('0x2a')](_0x185783)['send'](_0x71c030);};}exports[_0x07bd('0x37')]=function(_0x31c381,_0x51a232){var _0x41f039={},_0x2a3f40={},_0x204eb7={'count':0x0,'rows':[]};var _0x354546=db['ServicenowAccount']['rawAttributes'];_0x2a3f40[_0x07bd('0x38')]=_['keys'](_0x354546);_0x2a3f40[_0x07bd('0x39')]=_[_0x07bd('0x3a')](_0x31c381[_0x07bd('0x39')]);_0x2a3f40[_0x07bd('0x3b')]=_[_0x07bd('0x3c')](_0x2a3f40[_0x07bd('0x38')],_0x2a3f40[_0x07bd('0x39')]);_0x41f039[_0x07bd('0x3d')]=_[_0x07bd('0x3c')](_0x2a3f40[_0x07bd('0x38')],qs[_0x07bd('0x3e')](_0x31c381[_0x07bd('0x39')][_0x07bd('0x3e')]));_0x41f039['attributes']=_0x41f039[_0x07bd('0x3d')][_0x07bd('0x3f')]?_0x41f039[_0x07bd('0x3d')]:_0x2a3f40[_0x07bd('0x38')];if(!_0x31c381['query'][_0x07bd('0x40')](_0x07bd('0x41'))){_0x41f039[_0x07bd('0x2e')]=qs[_0x07bd('0x2e')](_0x31c381[_0x07bd('0x39')]['limit']);_0x41f039['offset']=qs[_0x07bd('0x2d')](_0x31c381[_0x07bd('0x39')][_0x07bd('0x2d')]);}_0x41f039[_0x07bd('0x42')]=qs['sort'](_0x31c381[_0x07bd('0x39')][_0x07bd('0x43')]);_0x41f039[_0x07bd('0x44')]=qs[_0x07bd('0x3b')](_[_0x07bd('0x45')](_0x31c381[_0x07bd('0x39')],_0x2a3f40[_0x07bd('0x3b')]));if(_0x31c381['query'][_0x07bd('0x46')]){_0x41f039[_0x07bd('0x44')]=_[_0x07bd('0x47')](_0x41f039[_0x07bd('0x44')],{'$or':_[_0x07bd('0x48')](_0x354546,function(_0x4d43b1){if(_0x4d43b1[_0x07bd('0x49')][_0x07bd('0x4a')]!==_0x07bd('0x4b')){var _0x460124={};_0x460124[_0x4d43b1[_0x07bd('0x4c')]]={'$like':'%'+_0x31c381['query'][_0x07bd('0x46')]+'%'};return _0x460124;}})});}_0x41f039=_[_0x07bd('0x47')]({},_0x41f039,_0x31c381[_0x07bd('0x4d')]);var _0x3954a7={'where':_0x41f039['where']};return db['ServicenowAccount'][_0x07bd('0x4e')](_0x3954a7)[_0x07bd('0x1e')](function(_0x2f17f2){_0x204eb7[_0x07bd('0x4e')]=_0x2f17f2;if(_0x31c381[_0x07bd('0x39')][_0x07bd('0x4f')]){_0x41f039[_0x07bd('0x50')]=[{'all':!![]}];}return db[_0x07bd('0x51')][_0x07bd('0x52')](_0x41f039);})['then'](function(_0x522c34){_0x204eb7[_0x07bd('0x53')]=_0x522c34;return _0x204eb7;})[_0x07bd('0x1e')](respondWithFilteredResult(_0x51a232,_0x41f039))[_0x07bd('0x54')](handleError(_0x51a232,null));};exports[_0x07bd('0x55')]=function(_0x44274b,_0xe534c0){var _0x4f5183={'raw':![],'where':{'id':_0x44274b[_0x07bd('0x56')]['id']}},_0x7a0447={};_0x7a0447[_0x07bd('0x38')]=_[_0x07bd('0x3a')](db[_0x07bd('0x51')][_0x07bd('0x57')]);_0x7a0447['query']=_[_0x07bd('0x3a')](_0x44274b[_0x07bd('0x39')]);_0x7a0447[_0x07bd('0x3b')]=_[_0x07bd('0x3c')](_0x7a0447[_0x07bd('0x38')],_0x7a0447[_0x07bd('0x39')]);_0x4f5183[_0x07bd('0x3d')]=_[_0x07bd('0x3c')](_0x7a0447[_0x07bd('0x38')],qs[_0x07bd('0x3e')](_0x44274b[_0x07bd('0x39')][_0x07bd('0x3e')]));_0x4f5183['attributes']=_0x4f5183[_0x07bd('0x3d')][_0x07bd('0x3f')]?_0x4f5183[_0x07bd('0x3d')]:_0x7a0447['model'];if(_0x44274b['query'][_0x07bd('0x4f')]){_0x4f5183['include']=[{'all':!![]}];}_0x4f5183=_[_0x07bd('0x47')]({},_0x4f5183,_0x44274b[_0x07bd('0x4d')]);return db[_0x07bd('0x51')][_0x07bd('0x58')](_0x4f5183)[_0x07bd('0x1e')](handleEntityNotFound(_0xe534c0,null))[_0x07bd('0x1e')](respondWithResult(_0xe534c0,null))[_0x07bd('0x54')](handleError(_0xe534c0,null));};exports[_0x07bd('0x59')]=function(_0x5d1c53,_0x351d90){return db[_0x07bd('0x51')][_0x07bd('0x59')](_0x5d1c53['body'],{})['then'](respondWithResult(_0x351d90,0xc9))['catch'](handleError(_0x351d90,null));};exports[_0x07bd('0x34')]=function(_0x381932,_0x12eae6){if(_0x381932['body']['id']){delete _0x381932[_0x07bd('0x5a')]['id'];}return db[_0x07bd('0x51')][_0x07bd('0x58')]({'where':{'id':_0x381932[_0x07bd('0x56')]['id']}})[_0x07bd('0x1e')](handleEntityNotFound(_0x12eae6,null))[_0x07bd('0x1e')](saveUpdates(_0x381932['body'],null))['then'](respondWithResult(_0x12eae6,null))[_0x07bd('0x54')](handleError(_0x12eae6,null));};exports['destroy']=function(_0x57926d,_0x31ce49){return db[_0x07bd('0x51')][_0x07bd('0x58')]({'where':{'id':_0x57926d['params']['id']}})[_0x07bd('0x1e')](handleEntityNotFound(_0x31ce49,null))[_0x07bd('0x1e')](removeEntity(_0x31ce49,null))[_0x07bd('0x54')](handleError(_0x31ce49,null));};exports[_0x07bd('0x5b')]=function(_0x1d4584,_0x1a6df7,_0x1982be){var _0x248d6f={};var _0x27ff6b={};var _0x5a6da6;var _0x38a9ef;return db['ServicenowAccount'][_0x07bd('0x5c')]({'where':{'id':_0x1d4584[_0x07bd('0x56')]['id']}})[_0x07bd('0x1e')](handleEntityNotFound(_0x1a6df7,null))['then'](function(_0xc1d8b2){if(_0xc1d8b2){_0x5a6da6=_0xc1d8b2;_0x27ff6b['model']=_[_0x07bd('0x3a')](db[_0x07bd('0x5d')][_0x07bd('0x57')]);_0x27ff6b[_0x07bd('0x39')]=_['keys'](_0x1d4584['query']);_0x27ff6b[_0x07bd('0x3b')]=_['intersection'](_0x27ff6b[_0x07bd('0x38')],_0x27ff6b[_0x07bd('0x39')]);_0x248d6f[_0x07bd('0x3d')]=_[_0x07bd('0x3c')](_0x27ff6b[_0x07bd('0x38')],qs[_0x07bd('0x3e')](_0x1d4584['query'][_0x07bd('0x3e')]));_0x248d6f[_0x07bd('0x3d')]=_0x248d6f[_0x07bd('0x3d')][_0x07bd('0x3f')]?_0x248d6f[_0x07bd('0x3d')]:_0x27ff6b['model'];_0x248d6f[_0x07bd('0x42')]=qs[_0x07bd('0x43')](_0x1d4584[_0x07bd('0x39')]['sort']);_0x248d6f[_0x07bd('0x44')]=qs['filters'](_[_0x07bd('0x45')](_0x1d4584[_0x07bd('0x39')],_0x27ff6b['filters']));if(_0x1d4584['query'][_0x07bd('0x46')]){_0x248d6f[_0x07bd('0x44')]=_[_0x07bd('0x47')](_0x248d6f[_0x07bd('0x44')],{'$or':_[_0x07bd('0x48')](_0x248d6f['attributes'],function(_0x145482){var _0x498223={};_0x498223[_0x145482]={'$like':'%'+_0x1d4584[_0x07bd('0x39')]['filter']+'%'};return _0x498223;})});}_0x248d6f=_[_0x07bd('0x47')]({},_0x248d6f,_0x1d4584['options']);return _0x5a6da6['getConfigurations'](_0x248d6f);}})[_0x07bd('0x1e')](function(_0x3ea829){if(_0x3ea829){_0x38a9ef=_0x3ea829[_0x07bd('0x3f')];if(!_0x1d4584[_0x07bd('0x39')][_0x07bd('0x40')](_0x07bd('0x41'))){_0x248d6f[_0x07bd('0x2e')]=qs[_0x07bd('0x2e')](_0x1d4584[_0x07bd('0x39')][_0x07bd('0x2e')]);_0x248d6f['offset']=qs[_0x07bd('0x2d')](_0x1d4584['query'][_0x07bd('0x2d')]);}return _0x5a6da6[_0x07bd('0x5b')](_0x248d6f);}})[_0x07bd('0x1e')](function(_0x5855e7){if(_0x5855e7){return _0x5855e7?{'count':_0x38a9ef,'rows':_0x5855e7}:null;}})[_0x07bd('0x1e')](respondWithResult(_0x1a6df7,null))[_0x07bd('0x54')](handleError(_0x1a6df7,null));};exports[_0x07bd('0x5e')]=function(_0x3f7194,_0x4d8abc,_0x28ec9e){if(_0x3f7194[_0x07bd('0x5a')]['id']){delete _0x3f7194['body']['id'];}return db[_0x07bd('0x51')][_0x07bd('0x5c')]({'where':{'id':_0x3f7194[_0x07bd('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d8abc,null))[_0x07bd('0x1e')](function(_0xa83eb9){if(_0xa83eb9){_0x3f7194[_0x07bd('0x5a')][_0x07bd('0x5f')]=_0xa83eb9['id'];_0x3f7194['body'][_0x07bd('0x60')]=integrations[_0x07bd('0x61')](_0x3f7194[_0x07bd('0x5a')][_0x07bd('0x62')],_0x3f7194['body'][_0x07bd('0x49')]);_0x3f7194['body'][_0x07bd('0x63')]=integrations[_0x07bd('0x64')](_0x3f7194[_0x07bd('0x5a')][_0x07bd('0x62')],_0x3f7194['body'][_0x07bd('0x49')]);return db[_0x07bd('0x5d')][_0x07bd('0x59')](_0x3f7194[_0x07bd('0x5a')],{'include':[{'model':db[_0x07bd('0x65')],'as':_0x07bd('0x60')},{'model':db[_0x07bd('0x65')],'as':'Descriptions'}]});}return null;})[_0x07bd('0x1e')](respondWithResult(_0x4d8abc,null))[_0x07bd('0x54')](handleError(_0x4d8abc,null));};exports[_0x07bd('0x66')]=function(_0x2b3dd6,_0x475e69,_0x4d1c79){var _0x4213e8=[_0x07bd('0x67'),_0x07bd('0x68'),'knowledge',_0x07bd('0x69'),_0x07bd('0x6a'),_0x07bd('0x6b'),_0x07bd('0x6c'),_0x07bd('0x6d'),'category'];var _0x5eee41=[_0x07bd('0x6e'),_0x07bd('0x67'),_0x07bd('0x6f'),_0x07bd('0x70'),_0x07bd('0x71'),_0x07bd('0x72'),_0x07bd('0x73'),_0x07bd('0x68'),_0x07bd('0x74'),'number',_0x07bd('0x75'),_0x07bd('0x76'),_0x07bd('0x77'),_0x07bd('0x78'),_0x07bd('0x79'),'sys_domain',_0x07bd('0x7a'),'sys_created_by',_0x07bd('0x7b'),_0x07bd('0x42'),'calendar_stc',_0x07bd('0x7c'),'cmdb_ci','delivery_plan',_0x07bd('0x7d'),_0x07bd('0x7e'),_0x07bd('0x7f'),_0x07bd('0x80'),_0x07bd('0x81'),'sys_domain_path',_0x07bd('0x82'),_0x07bd('0x83'),_0x07bd('0x84'),'opened_at',_0x07bd('0x85'),_0x07bd('0x86'),'work_end',_0x07bd('0x87'),_0x07bd('0x88'),'caller_id',_0x07bd('0x89'),_0x07bd('0x69'),_0x07bd('0x8a'),_0x07bd('0x8b'),_0x07bd('0x6a'),_0x07bd('0x8c'),_0x07bd('0x8d'),_0x07bd('0x8e'),'assignment_group',_0x07bd('0x8f'),_0x07bd('0x90'),'description',_0x07bd('0x91'),_0x07bd('0x6b'),_0x07bd('0x92'),_0x07bd('0x93'),'closed_by',_0x07bd('0x94'),_0x07bd('0x95'),_0x07bd('0x96'),_0x07bd('0x97'),'reopened_by',_0x07bd('0x6c'),_0x07bd('0x98'),_0x07bd('0x99'),_0x07bd('0x9a'),_0x07bd('0x9b'),_0x07bd('0x9c'),_0x07bd('0x9d'),_0x07bd('0x6d'),_0x07bd('0x9e'),_0x07bd('0x9f'),_0x07bd('0xa0'),_0x07bd('0xa1'),_0x07bd('0xa2'),_0x07bd('0xa3'),_0x07bd('0xa4'),_0x07bd('0xa5'),_0x07bd('0xa6'),_0x07bd('0xa7'),'correlation_id',_0x07bd('0xa8'),_0x07bd('0xa9')];var _0x2aeceb='';var _0x2704c7='';var _0x3447f0=[];var _0x208646='';var _0x13c81f='';var _0x3e50e8=[];var _0x3727d7='';var _0xdc66d1='';var _0x49a808={};var _0x289d10='';return db[_0x07bd('0x51')][_0x07bd('0x5c')]({'where':{'id':_0x2b3dd6[_0x07bd('0x56')]['id']},'attributes':['id',_0x07bd('0xaa'),_0x07bd('0xab'),_0x07bd('0xac'),_0x07bd('0xad'),_0x07bd('0xae')]})[_0x07bd('0x1e')](handleEntityNotFound(_0x475e69,null))[_0x07bd('0x1e')](function(_0x32a49c){if(_0x32a49c){_0x289d10=_0x32a49c[_0x07bd('0xad')];var _0x2af323=_0x289d10[_0x07bd('0xaf')](-0x1);if(_0x2af323==='/'){_0x289d10=_0x289d10[_0x07bd('0xb0')](0x0,_0x289d10[_0x07bd('0xb1')](_0x2af323));}_0xdc66d1=util[_0x07bd('0xb2')](_0x07bd('0xb3'),_0x289d10);_0x3727d7=util[_0x07bd('0xb2')](_0x07bd('0xb4'),_0x289d10);_0x49a808={'user':_0x32a49c[_0x07bd('0xaa')],'pass':_0x32a49c['password']};var _0x18eecd={'method':_0x07bd('0xb5'),'uri':_0xdc66d1+'incident?sysparm_display_value=all','auth':_0x49a808,'json':!![]};return rp(_0x18eecd);}})[_0x07bd('0x1e')](function(_0x4f4c6c){if(_0x4f4c6c[_0x07bd('0x28')]['length']>0x0){_0x2aeceb=_0x4f4c6c[_0x07bd('0x28')];}console[_0x07bd('0xb6')]('incident\x20table\x20objects',_0x2aeceb);_0x3e50e8=[];_0x2704c7=Object[_0x07bd('0xb7')]([],_0x2aeceb);_[_0x07bd('0xb8')](_0x2704c7,function(_0x5209d9){return!_0x4213e8[_0x07bd('0xb9')](_0x5209d9['name']);});_0x2704c7[_0x07bd('0xba')](function(_0x36cde5){var _0x207fde=createFieldObject(_0x3727d7,_0x49a808,_0x36cde5[_0x07bd('0xbb')],_0x36cde5[_0x07bd('0x36')],_0x36cde5[_0x07bd('0xbc')],![]);_0x3e50e8[_0x07bd('0xbd')](_0x207fde);});return Promise['all'](_0x3e50e8);})['then'](function(_0x46d212){_0x3447f0=_0x46d212;_0x208646=Object[_0x07bd('0xb7')]([],_0x2aeceb);console[_0x07bd('0xb6')](_0x07bd('0xbe'),_0x2aeceb);_[_0x07bd('0xb8')](_0x208646,function(_0x1b1e3a){return _0x5eee41['includes'](_0x1b1e3a[_0x07bd('0x36')]);});console['log'](_0x07bd('0xbf'),_0x208646);_0x3e50e8=[];_0x208646['forEach'](function(_0x27ad00){var _0x29d0d1=createFieldObject(_0x3727d7,_0x49a808,_0x27ad00[_0x07bd('0xbb')],_0x27ad00[_0x07bd('0x36')],_0x27ad00[_0x07bd('0xbc')],!![]);_0x3e50e8['push'](_0x29d0d1);});return Promise[_0x07bd('0xc0')](_0x3e50e8);})[_0x07bd('0x1e')](function(_0x145647){_0x13c81f=_0x145647;var _0x283532=_0x3447f0[_0x07bd('0xc1')](_0x13c81f);return{'count':_0x283532[_0x07bd('0x3f')],'rows':_0x283532};})[_0x07bd('0x1e')](respondWithResult(_0x475e69,null))[_0x07bd('0x54')](function(_0xae49a7){console['log'](_0x07bd('0xc2')+_0xae49a7);var _0x3ca8ed=_0x2b3dd6[_0x07bd('0x39')]['test']?0x1f4:_0xae49a7[_0x07bd('0xc3')]||0x1f4;logger[_0x07bd('0x24')](_0xae49a7[_0x07bd('0xc4')]);delete _0xae49a7[_0x07bd('0x36')];if(_0x3ca8ed===0x191){_0x3ca8ed=0x190;}_0x475e69['status'](_0x3ca8ed)[_0x07bd('0xc5')](_0x2b3dd6[_0x07bd('0x39')][_0x07bd('0xc6')]?{'message':_0x07bd('0xc7'),'statusCode':_0xae49a7['statusCode']}:_0xae49a7);});};function createFieldObject(_0x2b523e,_0x3466cc,_0x12c7c2,_0x4e1abc,_0x1797d1,_0x3d924a){return new Promise(function(_0x11afa0,_0x3b63ea){var _0x56faa8={'id':_0x4e1abc,'name':_0x1797d1,'custom':_0x3d924a};if(_0x12c7c2==='boolean'){_0x56faa8[_0x07bd('0x4d')]=[{'name':_0x07bd('0xc8'),'value':_0x07bd('0xc9')},{'name':_0x07bd('0xca'),'value':_0x07bd('0xcb')}];_0x11afa0(_0x56faa8);}else{var _0x1e2178={'method':_0x07bd('0xb5'),'uri':_0x2b523e+'sys_choice?sysparm_query=name=incident^element='+_0x4e1abc,'auth':_0x3466cc,'json':!![]};return rp(_0x1e2178)['then'](function(_0x3a872b){var _0x4e397c=[];if(_0x3a872b[_0x07bd('0x28')][_0x07bd('0x3f')]>0x0){_0x3a872b['result'][_0x07bd('0xba')](function(_0x142fb1){if(_0x142fb1[_0x07bd('0xcc')]===_0x07bd('0xcb')){var _0x4d619d={'name':_0x142fb1['label'],'value':_0x142fb1[_0x07bd('0xcd')]};_0x4e397c[_0x07bd('0xbd')](_0x4d619d);}});}_0x56faa8[_0x07bd('0x4d')]=_0x4e397c;if(_0x56faa8[_0x07bd('0x4d')][_0x07bd('0x3f')]>0x0){_0x11afa0(_0x56faa8);}else{if(_0x3d924a==![]){_0x11afa0();}else{_0x11afa0(_0x56faa8);}}});}});} \ No newline at end of file +var _0xb44a=['cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','parent_incident','sys_id','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','comments','sla_due','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','concat','test','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','then','info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','sendStatus','json','offset','status','set','Content-Range','reject','save','destroy','end','stack','name','send','index','ServicenowAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','pick','filter','where','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','getConfigurations','findOne','sort','nolimit','addConfiguration','getSubjects','channel','type','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','hold_reason','subcategory','close_code','notify','incident_state','severity','category','made_sla','watch_list','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','knowledge','calendar_stc','closed_at'];(function(_0x246a25,_0x2c0c46){var _0x5996f4=function(_0x5ae4bb){while(--_0x5ae4bb){_0x246a25['push'](_0x246a25['shift']());}};_0x5996f4(++_0x2c0c46);}(_0xb44a,0x1c2));var _0xab44=function(_0x101dce,_0x3b887c){_0x101dce=_0x101dce-0x0;var _0x5a92bb=_0xb44a[_0x101dce];return _0x5a92bb;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xab44('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab44('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab44('0x2'));var Mustache=require('mustache');var util=require(_0xab44('0x3'));var path=require(_0xab44('0x4'));var sox=require(_0xab44('0x5'));var csv=require(_0xab44('0x6'));var ejs=require(_0xab44('0x7'));var fs=require('fs');var _=require(_0xab44('0x8'));var squel=require(_0xab44('0x9'));var crypto=require(_0xab44('0xa'));var jsforce=require(_0xab44('0xb'));var deskjs=require(_0xab44('0xc'));var toCsv=require(_0xab44('0x6'));var querystring=require(_0xab44('0xd'));var Papa=require(_0xab44('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xab44('0xf'));var Redis=require('ioredis');var qs=require(_0xab44('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xab44('0x11'));var config=require(_0xab44('0x12'));var db=require(_0xab44('0x13'))['db'];var integrations=require(_0xab44('0x14'));var jayson=require(_0xab44('0x15'));var client=jayson[_0xab44('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57fcff,_0x13a1ca,_0x478b7e,_0x15db10){return new BPromise(function(_0x5ae369,_0x25f611){var _0x15b98a=_0x15db10||client;return _0x15b98a[_0xab44('0x17')](_0x57fcff,_0x478b7e)[_0xab44('0x18')](function(_0x31404d){logger[_0xab44('0x19')]('ServicenowAccount,\x20%s,\x20%s',_0x13a1ca,'request\x20sent');logger[_0xab44('0x1a')](_0xab44('0x1b'),_0x13a1ca,_0xab44('0x1c'),JSON[_0xab44('0x1d')](_0x31404d));if(_0x31404d[_0xab44('0x1e')]){if(_0x31404d[_0xab44('0x1e')][_0xab44('0x1f')]===0x1f4){logger[_0xab44('0x1e')](_0xab44('0x20'),_0x13a1ca,_0x31404d[_0xab44('0x1e')][_0xab44('0x21')]);return _0x25f611(_0x31404d['error'][_0xab44('0x21')]);}logger[_0xab44('0x1e')](_0xab44('0x20'),_0x13a1ca,_0x31404d[_0xab44('0x1e')][_0xab44('0x21')]);return _0x5ae369(_0x31404d['error'][_0xab44('0x21')]);}else{logger['info'](_0xab44('0x20'),_0x13a1ca,_0xab44('0x1c'));_0x5ae369(_0x31404d[_0xab44('0x22')][_0xab44('0x21')]);}})['catch'](function(_0x3a2b1d){logger[_0xab44('0x1e')](_0xab44('0x20'),_0x13a1ca,_0x3a2b1d);_0x25f611(_0x3a2b1d);});});}function respondWithStatusCode(_0x3b17d5,_0x11f0b){_0x11f0b=_0x11f0b||0xcc;return function(_0x402950){if(_0x402950){return _0x3b17d5[_0xab44('0x23')](_0x11f0b);}return _0x3b17d5['status'](_0x11f0b)['end']();};}function respondWithResult(_0x1d4a2f,_0x572e0b){_0x572e0b=_0x572e0b||0xc8;return function(_0x2439f3){if(_0x2439f3){return _0x1d4a2f['status'](_0x572e0b)[_0xab44('0x24')](_0x2439f3);}};}function respondWithFilteredResult(_0x5ac42f,_0x531583){return function(_0x8e60fa){if(_0x8e60fa){var _0x25287b=_0x8e60fa['count'],_0x259192=_0x531583[_0xab44('0x25')],_0x4620ed=_0x531583[_0xab44('0x25')]+_0x531583['limit'],_0x132bf6;if(_0x4620ed>=_0x25287b){_0x4620ed=_0x25287b;_0x132bf6=0xc8;}else{_0x132bf6=0xce;}_0x5ac42f[_0xab44('0x26')](_0x132bf6);return _0x5ac42f[_0xab44('0x27')](_0xab44('0x28'),_0x259192+'-'+_0x4620ed+'/'+_0x25287b)[_0xab44('0x24')](_0x8e60fa);}return null;};}function patchUpdates(_0x4550c8){return function(_0xdc50a1){try{jsonpatch['apply'](_0xdc50a1,_0x4550c8,!![]);}catch(_0x22f28e){return BPromise[_0xab44('0x29')](_0x22f28e);}return _0xdc50a1[_0xab44('0x2a')]();};}function saveUpdates(_0x47e1be,_0x54cac8){return function(_0x106d3a){if(_0x106d3a){return _0x106d3a['update'](_0x47e1be)['then'](function(_0x24b117){return _0x24b117;});}return null;};}function removeEntity(_0x2f8a1d,_0x160177){return function(_0x1e9715){if(_0x1e9715){return _0x1e9715[_0xab44('0x2b')]()[_0xab44('0x18')](function(){_0x2f8a1d[_0xab44('0x26')](0xcc)[_0xab44('0x2c')]();});}};}function handleEntityNotFound(_0x9d1950,_0x1e8e9d){return function(_0x43aa7f){if(!_0x43aa7f){_0x9d1950[_0xab44('0x23')](0x194);}return _0x43aa7f;};}function handleError(_0x20fc84,_0x3f99d3){_0x3f99d3=_0x3f99d3||0x1f4;return function(_0x599f0d){logger['error'](_0x599f0d[_0xab44('0x2d')]);if(_0x599f0d[_0xab44('0x2e')]){delete _0x599f0d['name'];}_0x20fc84[_0xab44('0x26')](_0x3f99d3)[_0xab44('0x2f')](_0x599f0d);};}exports[_0xab44('0x30')]=function(_0x1e0be7,_0x1a2839){var _0x1b58aa={},_0x468fd3={},_0x1e31b5={'count':0x0,'rows':[]};var _0x25a089=db[_0xab44('0x31')][_0xab44('0x32')];_0x468fd3[_0xab44('0x33')]=_[_0xab44('0x34')](_0x25a089);_0x468fd3[_0xab44('0x35')]=_[_0xab44('0x34')](_0x1e0be7[_0xab44('0x35')]);_0x468fd3[_0xab44('0x36')]=_[_0xab44('0x37')](_0x468fd3['model'],_0x468fd3[_0xab44('0x35')]);_0x1b58aa[_0xab44('0x38')]=_[_0xab44('0x37')](_0x468fd3[_0xab44('0x33')],qs['fields'](_0x1e0be7[_0xab44('0x35')][_0xab44('0x39')]));_0x1b58aa[_0xab44('0x38')]=_0x1b58aa[_0xab44('0x38')][_0xab44('0x3a')]?_0x1b58aa['attributes']:_0x468fd3[_0xab44('0x33')];if(!_0x1e0be7[_0xab44('0x35')][_0xab44('0x3b')]('nolimit')){_0x1b58aa[_0xab44('0x3c')]=qs[_0xab44('0x3c')](_0x1e0be7[_0xab44('0x35')][_0xab44('0x3c')]);_0x1b58aa[_0xab44('0x25')]=qs['offset'](_0x1e0be7[_0xab44('0x35')]['offset']);}_0x1b58aa[_0xab44('0x3d')]=qs['sort'](_0x1e0be7['query']['sort']);_0x1b58aa['where']=qs['filters'](_[_0xab44('0x3e')](_0x1e0be7[_0xab44('0x35')],_0x468fd3[_0xab44('0x36')]));if(_0x1e0be7[_0xab44('0x35')][_0xab44('0x3f')]){_0x1b58aa[_0xab44('0x40')]=_[_0xab44('0x41')](_0x1b58aa[_0xab44('0x40')],{'$or':_[_0xab44('0x42')](_0x25a089,function(_0x19b769){if(_0x19b769['type'][_0xab44('0x43')]!==_0xab44('0x44')){var _0x3cb9fc={};_0x3cb9fc[_0x19b769[_0xab44('0x45')]]={'$like':'%'+_0x1e0be7['query'][_0xab44('0x3f')]+'%'};return _0x3cb9fc;}})});}_0x1b58aa=_[_0xab44('0x41')]({},_0x1b58aa,_0x1e0be7[_0xab44('0x46')]);var _0xb4ab38={'where':_0x1b58aa[_0xab44('0x40')]};return db[_0xab44('0x31')]['count'](_0xb4ab38)['then'](function(_0x2dd6f8){_0x1e31b5[_0xab44('0x47')]=_0x2dd6f8;if(_0x1e0be7[_0xab44('0x35')][_0xab44('0x48')]){_0x1b58aa[_0xab44('0x49')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xab44('0x4a')](_0x1b58aa);})[_0xab44('0x18')](function(_0x165a51){_0x1e31b5[_0xab44('0x4b')]=_0x165a51;return _0x1e31b5;})['then'](respondWithFilteredResult(_0x1a2839,_0x1b58aa))[_0xab44('0x4c')](handleError(_0x1a2839,null));};exports[_0xab44('0x4d')]=function(_0x3e2ba1,_0x556f7a){var _0x3e55fc={'raw':![],'where':{'id':_0x3e2ba1[_0xab44('0x4e')]['id']}},_0x73026c={};_0x73026c[_0xab44('0x33')]=_['keys'](db[_0xab44('0x31')]['rawAttributes']);_0x73026c[_0xab44('0x35')]=_[_0xab44('0x34')](_0x3e2ba1[_0xab44('0x35')]);_0x73026c[_0xab44('0x36')]=_['intersection'](_0x73026c[_0xab44('0x33')],_0x73026c['query']);_0x3e55fc[_0xab44('0x38')]=_[_0xab44('0x37')](_0x73026c[_0xab44('0x33')],qs[_0xab44('0x39')](_0x3e2ba1[_0xab44('0x35')]['fields']));_0x3e55fc[_0xab44('0x38')]=_0x3e55fc['attributes'][_0xab44('0x3a')]?_0x3e55fc[_0xab44('0x38')]:_0x73026c[_0xab44('0x33')];if(_0x3e2ba1['query'][_0xab44('0x48')]){_0x3e55fc[_0xab44('0x49')]=[{'all':!![]}];}_0x3e55fc=_[_0xab44('0x41')]({},_0x3e55fc,_0x3e2ba1[_0xab44('0x46')]);return db[_0xab44('0x31')]['find'](_0x3e55fc)['then'](handleEntityNotFound(_0x556f7a,null))[_0xab44('0x18')](respondWithResult(_0x556f7a,null))[_0xab44('0x4c')](handleError(_0x556f7a,null));};exports[_0xab44('0x4f')]=function(_0x51ee03,_0x11bcd9){return db[_0xab44('0x31')][_0xab44('0x4f')](_0x51ee03[_0xab44('0x50')],{})['then'](respondWithResult(_0x11bcd9,0xc9))['catch'](handleError(_0x11bcd9,null));};exports[_0xab44('0x51')]=function(_0x313398,_0x309455){if(_0x313398[_0xab44('0x50')]['id']){delete _0x313398[_0xab44('0x50')]['id'];}return db[_0xab44('0x31')][_0xab44('0x52')]({'where':{'id':_0x313398[_0xab44('0x4e')]['id']}})['then'](handleEntityNotFound(_0x309455,null))['then'](saveUpdates(_0x313398[_0xab44('0x50')],null))[_0xab44('0x18')](respondWithResult(_0x309455,null))[_0xab44('0x4c')](handleError(_0x309455,null));};exports[_0xab44('0x2b')]=function(_0x291fe0,_0x220779){return db[_0xab44('0x31')][_0xab44('0x52')]({'where':{'id':_0x291fe0[_0xab44('0x4e')]['id']}})['then'](handleEntityNotFound(_0x220779,null))[_0xab44('0x18')](removeEntity(_0x220779,null))[_0xab44('0x4c')](handleError(_0x220779,null));};exports[_0xab44('0x53')]=function(_0xf8edd8,_0xc3018f,_0x2e6902){var _0x392936={};var _0x637306={};var _0x4b1c8c;var _0x4d667f;return db[_0xab44('0x31')][_0xab44('0x54')]({'where':{'id':_0xf8edd8[_0xab44('0x4e')]['id']}})[_0xab44('0x18')](handleEntityNotFound(_0xc3018f,null))[_0xab44('0x18')](function(_0x1a5788){if(_0x1a5788){_0x4b1c8c=_0x1a5788;_0x637306[_0xab44('0x33')]=_[_0xab44('0x34')](db['ServicenowConfiguration']['rawAttributes']);_0x637306['query']=_['keys'](_0xf8edd8[_0xab44('0x35')]);_0x637306[_0xab44('0x36')]=_[_0xab44('0x37')](_0x637306[_0xab44('0x33')],_0x637306[_0xab44('0x35')]);_0x392936['attributes']=_[_0xab44('0x37')](_0x637306[_0xab44('0x33')],qs[_0xab44('0x39')](_0xf8edd8[_0xab44('0x35')][_0xab44('0x39')]));_0x392936[_0xab44('0x38')]=_0x392936[_0xab44('0x38')][_0xab44('0x3a')]?_0x392936['attributes']:_0x637306[_0xab44('0x33')];_0x392936[_0xab44('0x3d')]=qs[_0xab44('0x55')](_0xf8edd8[_0xab44('0x35')]['sort']);_0x392936[_0xab44('0x40')]=qs['filters'](_['pick'](_0xf8edd8[_0xab44('0x35')],_0x637306['filters']));if(_0xf8edd8['query'][_0xab44('0x3f')]){_0x392936[_0xab44('0x40')]=_[_0xab44('0x41')](_0x392936[_0xab44('0x40')],{'$or':_[_0xab44('0x42')](_0x392936['attributes'],function(_0x242795){var _0x1cd144={};_0x1cd144[_0x242795]={'$like':'%'+_0xf8edd8[_0xab44('0x35')][_0xab44('0x3f')]+'%'};return _0x1cd144;})});}_0x392936=_[_0xab44('0x41')]({},_0x392936,_0xf8edd8[_0xab44('0x46')]);return _0x4b1c8c['getConfigurations'](_0x392936);}})['then'](function(_0x5ef6b9){if(_0x5ef6b9){_0x4d667f=_0x5ef6b9[_0xab44('0x3a')];if(!_0xf8edd8[_0xab44('0x35')]['hasOwnProperty'](_0xab44('0x56'))){_0x392936[_0xab44('0x3c')]=qs[_0xab44('0x3c')](_0xf8edd8[_0xab44('0x35')][_0xab44('0x3c')]);_0x392936[_0xab44('0x25')]=qs[_0xab44('0x25')](_0xf8edd8[_0xab44('0x35')][_0xab44('0x25')]);}return _0x4b1c8c[_0xab44('0x53')](_0x392936);}})[_0xab44('0x18')](function(_0x26c990){if(_0x26c990){return _0x26c990?{'count':_0x4d667f,'rows':_0x26c990}:null;}})[_0xab44('0x18')](respondWithResult(_0xc3018f,null))[_0xab44('0x4c')](handleError(_0xc3018f,null));};exports[_0xab44('0x57')]=function(_0x3f0eb0,_0x445555,_0x3c0668){if(_0x3f0eb0[_0xab44('0x50')]['id']){delete _0x3f0eb0[_0xab44('0x50')]['id'];}return db[_0xab44('0x31')][_0xab44('0x54')]({'where':{'id':_0x3f0eb0[_0xab44('0x4e')]['id']}})[_0xab44('0x18')](handleEntityNotFound(_0x445555,null))[_0xab44('0x18')](function(_0x15dd86){if(_0x15dd86){_0x3f0eb0[_0xab44('0x50')]['AccountId']=_0x15dd86['id'];_0x3f0eb0[_0xab44('0x50')]['Subjects']=integrations[_0xab44('0x58')](_0x3f0eb0[_0xab44('0x50')][_0xab44('0x59')],_0x3f0eb0[_0xab44('0x50')][_0xab44('0x5a')]);_0x3f0eb0[_0xab44('0x50')][_0xab44('0x5b')]=integrations[_0xab44('0x5c')](_0x3f0eb0[_0xab44('0x50')][_0xab44('0x59')],_0x3f0eb0[_0xab44('0x50')]['type']);return db[_0xab44('0x5d')][_0xab44('0x4f')](_0x3f0eb0['body'],{'include':[{'model':db[_0xab44('0x5e')],'as':'Subjects'},{'model':db[_0xab44('0x5e')],'as':_0xab44('0x5b')}]});}return null;})[_0xab44('0x18')](respondWithResult(_0x445555,null))[_0xab44('0x4c')](handleError(_0x445555,null));};exports[_0xab44('0x5f')]=function(_0x9115d9,_0x114499,_0x4b3107){var _0x33211d=['made_sla',_0xab44('0x60'),'knowledge',_0xab44('0x61'),_0xab44('0x62'),_0xab44('0x63'),_0xab44('0x64'),_0xab44('0x65'),_0xab44('0x66')];var _0x64bb66=['parent',_0xab44('0x67'),'caused_by',_0xab44('0x68'),'upon_reject',_0xab44('0x69'),_0xab44('0x6a'),_0xab44('0x60'),_0xab44('0x6b'),_0xab44('0x6c'),'resolved_by',_0xab44('0x6d'),_0xab44('0x6e'),_0xab44('0x6f'),'sys_created_on',_0xab44('0x70'),'state',_0xab44('0x71'),_0xab44('0x72'),_0xab44('0x3d'),_0xab44('0x73'),_0xab44('0x74'),_0xab44('0x75'),_0xab44('0x76'),_0xab44('0x77'),_0xab44('0x78'),_0xab44('0x79'),_0xab44('0x7a'),_0xab44('0x7b'),_0xab44('0x7c'),'rfc','time_worked',_0xab44('0x7d'),_0xab44('0x7e'),'business_duration',_0xab44('0x7f'),_0xab44('0x80'),_0xab44('0x81'),_0xab44('0x82'),_0xab44('0x83'),'approval_set',_0xab44('0x61'),_0xab44('0x84'),'short_description','close_code','correlation_display','delivery_task',_0xab44('0x85'),_0xab44('0x86'),_0xab44('0x87'),_0xab44('0x88'),_0xab44('0x89'),_0xab44('0x8a'),'notify',_0xab44('0x8b'),_0xab44('0x8c'),'closed_by','follow_up',_0xab44('0x8d'),_0xab44('0x8e'),'contact_type',_0xab44('0x8f'),_0xab44('0x64'),_0xab44('0x90'),'problem_id',_0xab44('0x91'),_0xab44('0x92'),_0xab44('0x93'),_0xab44('0x94'),_0xab44('0x65'),_0xab44('0x95'),_0xab44('0x96'),'approval','comments_and_work_notes',_0xab44('0x97'),_0xab44('0x98'),_0xab44('0x99'),_0xab44('0x9a'),_0xab44('0x9b'),'upon_approval',_0xab44('0x9c'),_0xab44('0x9d'),'category'];var _0x5796a7='';var _0xc3c0d8='';var _0x560ffc=[];var _0x2a50d1='';var _0xb9860='';var _0x254918=[];var _0x59207b='';var _0x107dcb='';var _0xdca83a={};var _0x27c69d='';return db[_0xab44('0x31')][_0xab44('0x54')]({'where':{'id':_0x9115d9['params']['id']},'attributes':['id',_0xab44('0x9e'),_0xab44('0x9f'),'email',_0xab44('0xa0'),_0xab44('0xa1')]})[_0xab44('0x18')](handleEntityNotFound(_0x114499,null))['then'](function(_0x194b55){if(_0x194b55){_0x27c69d=_0x194b55[_0xab44('0xa0')];var _0x2fc9f8=_0x27c69d[_0xab44('0xa2')](-0x1);if(_0x2fc9f8==='/'){_0x27c69d=_0x27c69d[_0xab44('0xa3')](0x0,_0x27c69d[_0xab44('0xa4')](_0x2fc9f8));}_0x107dcb=util[_0xab44('0xa5')]('%s/api/now/doc/table/schema/',_0x27c69d);_0x59207b=util[_0xab44('0xa5')](_0xab44('0xa6'),_0x27c69d);_0xdca83a={'user':_0x194b55['username'],'pass':_0x194b55[_0xab44('0x9f')]};var _0x180fe7={'method':_0xab44('0xa7'),'uri':_0x107dcb+_0xab44('0xa8'),'auth':_0xdca83a,'json':!![]};return rp(_0x180fe7);}})[_0xab44('0x18')](function(_0x428298){if(_0x428298[_0xab44('0x22')][_0xab44('0x3a')]>0x0){_0x5796a7=_0x428298[_0xab44('0x22')];}console[_0xab44('0xa9')](_0xab44('0xaa'),_0x5796a7);_0x254918=[];_0xc3c0d8=Object[_0xab44('0xab')]([],_0x5796a7);_[_0xab44('0xac')](_0xc3c0d8,function(_0x5e8820){return!_0x33211d[_0xab44('0xad')](_0x5e8820['name']);});_0xc3c0d8[_0xab44('0xae')](function(_0x594482){var _0x3d6be6=createFieldObject(_0x59207b,_0xdca83a,_0x594482[_0xab44('0xaf')],_0x594482[_0xab44('0x2e')],_0x594482[_0xab44('0xb0')],![]);_0x254918[_0xab44('0xb1')](_0x3d6be6);});return Promise[_0xab44('0xb2')](_0x254918);})[_0xab44('0x18')](function(_0x14c9a7){_0x560ffc=_0x14c9a7;_0x2a50d1=Object['assign']([],_0x5796a7);console['log']('TCL:\x20_object',_0x5796a7);_['remove'](_0x2a50d1,function(_0x4250a4){return _0x64bb66[_0xab44('0xad')](_0x4250a4[_0xab44('0x2e')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2a50d1);_0x254918=[];_0x2a50d1['forEach'](function(_0x4da0ed){var _0x40fc3c=createFieldObject(_0x59207b,_0xdca83a,_0x4da0ed[_0xab44('0xaf')],_0x4da0ed[_0xab44('0x2e')],_0x4da0ed[_0xab44('0xb0')],!![]);_0x254918['push'](_0x40fc3c);});return Promise[_0xab44('0xb2')](_0x254918);})[_0xab44('0x18')](function(_0x3a2669){_0xb9860=_0x3a2669;var _0x555cc7=_0x560ffc[_0xab44('0xb3')](_0xb9860);return{'count':_0x555cc7[_0xab44('0x3a')],'rows':_0x555cc7};})[_0xab44('0x18')](respondWithResult(_0x114499,null))[_0xab44('0x4c')](function(_0x63d38d){console[_0xab44('0xa9')]('ServiceNow\x20error:\x20'+_0x63d38d);var _0x3150f1=_0x9115d9[_0xab44('0x35')][_0xab44('0xb4')]?0x1f4:_0x63d38d['statusCode']||0x1f4;logger[_0xab44('0x1e')](_0x63d38d['stack']);delete _0x63d38d[_0xab44('0x2e')];if(_0x3150f1===0x191){_0x3150f1=0x190;}_0x114499[_0xab44('0x26')](_0x3150f1)[_0xab44('0x2f')](_0x9115d9[_0xab44('0x35')]['test']?{'message':_0xab44('0xb5'),'statusCode':_0x63d38d['statusCode']}:_0x63d38d);});};function createFieldObject(_0x278da2,_0x26169a,_0x38ccd1,_0x423142,_0x41a7bc,_0x122b8b){return new Promise(function(_0x38e92f,_0x213dd8){var _0x4531d6={'id':_0x423142,'name':_0x41a7bc,'custom':_0x122b8b};if(_0x38ccd1===_0xab44('0xb6')){_0x4531d6[_0xab44('0x46')]=[{'name':'True','value':_0xab44('0xb7')},{'name':_0xab44('0xb8'),'value':_0xab44('0xb9')}];_0x38e92f(_0x4531d6);}else{var _0x4ac522={'method':_0xab44('0xa7'),'uri':_0x278da2+_0xab44('0xba')+_0x423142,'auth':_0x26169a,'json':!![]};return rp(_0x4ac522)[_0xab44('0x18')](function(_0x4c8a45){var _0x388d95=[];if(_0x4c8a45[_0xab44('0x22')][_0xab44('0x3a')]>0x0){_0x4c8a45['result']['forEach'](function(_0x2b71dc){if(_0x2b71dc[_0xab44('0xbb')]==='false'){var _0x5bd319={'name':_0x2b71dc[_0xab44('0xb0')],'value':_0x2b71dc[_0xab44('0xbc')]};_0x388d95[_0xab44('0xb1')](_0x5bd319);}});}_0x4531d6[_0xab44('0x46')]=_0x388d95;if(_0x4531d6[_0xab44('0x46')]['length']>0x0){_0x38e92f(_0x4531d6);}else{if(_0x122b8b==![]){_0x38e92f();}else{_0x38e92f(_0x4531d6);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index d46f4bf..c8d830d 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 _0x3de8=['lodash','util','../../config/logger','moment','bluebird','request-promise','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts'];(function(_0x593c9c,_0x1fe355){var _0x35a1a0=function(_0x5686f2){while(--_0x5686f2){_0x593c9c['push'](_0x593c9c['shift']());}};_0x35a1a0(++_0x1fe355);}(_0x3de8,0x1a4));var _0x83de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x83de('0x0'));var util=require(_0x83de('0x1'));var logger=require(_0x83de('0x2'))('api');var moment=require(_0x83de('0x3'));var BPromise=require(_0x83de('0x4'));var rp=require(_0x83de('0x5'));var attributes=require(_0x83de('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x83de('0x7')]=function(_0x13f9ed,_0x44d7af){return _0x13f9ed[_0x83de('0x8')]('ServicenowAccount',attributes,{'tableName':_0x83de('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x610a=['define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intServicenowAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1bdeeb,_0x33a63f){var _0x2a0f92=function(_0x51bb6f){while(--_0x51bb6f){_0x1bdeeb['push'](_0x1bdeeb['shift']());}};_0x2a0f92(++_0x33a63f);}(_0x610a,0xc6));var _0xa610=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x610a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa610('0x0'));var util=require(_0xa610('0x1'));var logger=require(_0xa610('0x2'))(_0xa610('0x3'));var moment=require(_0xa610('0x4'));var BPromise=require(_0xa610('0x5'));var rp=require(_0xa610('0x6'));var attributes=require(_0xa610('0x7'));var integrations=require(_0xa610('0x8'));module[_0xa610('0x9')]=function(_0x5f3fda,_0x4afade){return _0x5f3fda[_0xa610('0xa')](_0xa610('0xb'),attributes,{'tableName':_0xa610('0xc'),'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 bc2cbf9..c7349d0 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 _0x77a7=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowServicenowAccount','find','lodash','util'];(function(_0x1086f6,_0x2dcdaa){var _0x281347=function(_0x55ff41){while(--_0x55ff41){_0x1086f6['push'](_0x1086f6['shift']());}};_0x281347(++_0x2dcdaa);}(_0x77a7,0x8a));var _0x777a=function(_0x251542,_0x590047){_0x251542=_0x251542-0x0;var _0x3d1052=_0x77a7[_0x251542];return _0x3d1052;};'use strict';var _=require(_0x777a('0x0'));var util=require(_0x777a('0x1'));var moment=require(_0x777a('0x2'));var BPromise=require(_0x777a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x777a('0x4'));var db=require(_0x777a('0x5'))['db'];var utils=require(_0x777a('0x6'));var logger=require('../../config/logger')(_0x777a('0x7'));var config=require('../../config/environment');var jayson=require(_0x777a('0x8'));var client=jayson['client'][_0x777a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4679b5,_0x580f5b,_0x55d4d5){return new BPromise(function(_0x2976d2,_0x4829c8){return client['request'](_0x4679b5,_0x55d4d5)[_0x777a('0xa')](function(_0x4c0cb6){logger[_0x777a('0xb')](_0x777a('0xc'),_0x580f5b,_0x777a('0xd'));logger[_0x777a('0xe')](_0x777a('0xf'),_0x580f5b,_0x777a('0xd'),JSON['stringify'](_0x4c0cb6));if(_0x4c0cb6[_0x777a('0x10')]){if(_0x4c0cb6[_0x777a('0x10')][_0x777a('0x11')]===0x1f4){logger[_0x777a('0x10')](_0x777a('0xc'),_0x580f5b,_0x4c0cb6['error']['message']);return _0x4829c8(_0x4c0cb6[_0x777a('0x10')][_0x777a('0x12')]);}logger['error'](_0x777a('0xc'),_0x580f5b,_0x4c0cb6[_0x777a('0x10')][_0x777a('0x12')]);return _0x2976d2(_0x4c0cb6[_0x777a('0x10')]['message']);}else{logger['info'](_0x777a('0xc'),_0x580f5b,_0x777a('0xd'));_0x2976d2(_0x4c0cb6[_0x777a('0x13')]['message']);}})[_0x777a('0x14')](function(_0x143a68){logger['error'](_0x777a('0xc'),_0x580f5b,_0x143a68);_0x4829c8(_0x143a68);});});}exports[_0x777a('0x15')]=function(_0xef5a4e){var _0x470c49=this;return new Promise(function(_0x499d7b,_0xb2a21f){return db[_0x777a('0x16')][_0x777a('0x17')]({'raw':_0xef5a4e[_0x777a('0x18')]?_0xef5a4e[_0x777a('0x18')][_0x777a('0x19')]===undefined?!![]:![]:!![],'where':_0xef5a4e['options']?_0xef5a4e[_0x777a('0x18')][_0x777a('0x1a')]||null:null,'attributes':_0xef5a4e[_0x777a('0x18')]?_0xef5a4e[_0x777a('0x18')][_0x777a('0x1b')]||null:null,'limit':_0xef5a4e['options']?_0xef5a4e[_0x777a('0x18')][_0x777a('0x1c')]||null:null,'include':_0xef5a4e[_0x777a('0x18')]?_0xef5a4e[_0x777a('0x18')][_0x777a('0x1d')]?_[_0x777a('0x1e')](_0xef5a4e['options'][_0x777a('0x1d')],function(_0xe77b70){return{'model':db[_0xe77b70[_0x777a('0x1f')]],'as':_0xe77b70['as'],'attributes':_0xe77b70[_0x777a('0x1b')],'include':_0xe77b70[_0x777a('0x1d')]?_[_0x777a('0x1e')](_0xe77b70[_0x777a('0x1d')],function(_0x4f1720){return{'model':db[_0x4f1720[_0x777a('0x1f')]],'as':_0x4f1720['as'],'attributes':_0x4f1720['attributes'],'include':_0x4f1720[_0x777a('0x1d')]?_[_0x777a('0x1e')](_0x4f1720[_0x777a('0x1d')],function(_0x148a04){return{'model':db[_0x148a04[_0x777a('0x1f')]],'as':_0x148a04['as'],'attributes':_0x148a04[_0x777a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x777a('0xa')](function(_0x1064d1){logger[_0x777a('0xb')]('GetServicenowAccount',_0xef5a4e);logger['debug'](_0x777a('0x15'),_0xef5a4e,JSON[_0x777a('0x20')](_0x1064d1));_0x499d7b(_0x1064d1);})[_0x777a('0x14')](function(_0x5d4253){logger['error'](_0x777a('0x15'),_0x5d4253[_0x777a('0x12')],_0xef5a4e);_0xb2a21f(_0x470c49[_0x777a('0x10')](0x1f4,_0x5d4253['message']));});});};exports[_0x777a('0x21')]=function(_0x9fb4d1){var _0x74d829=this;return new Promise(function(_0x2de97e,_0x2b155b){return db[_0x777a('0x16')][_0x777a('0x22')]({'raw':_0x9fb4d1['options']?_0x9fb4d1['options'][_0x777a('0x19')]===undefined?!![]:![]:!![],'where':_0x9fb4d1[_0x777a('0x18')]?_0x9fb4d1[_0x777a('0x18')][_0x777a('0x1a')]||null:null,'attributes':_0x9fb4d1[_0x777a('0x18')]?_0x9fb4d1[_0x777a('0x18')][_0x777a('0x1b')]||null:null,'include':_0x9fb4d1[_0x777a('0x18')]?_0x9fb4d1[_0x777a('0x18')][_0x777a('0x1d')]?_[_0x777a('0x1e')](_0x9fb4d1['options'][_0x777a('0x1d')],function(_0x413d88){return{'model':db[_0x413d88[_0x777a('0x1f')]],'as':_0x413d88['as'],'attributes':_0x413d88[_0x777a('0x1b')],'include':_0x413d88['include']?_[_0x777a('0x1e')](_0x413d88[_0x777a('0x1d')],function(_0x545376){return{'model':db[_0x545376[_0x777a('0x1f')]],'as':_0x545376['as'],'attributes':_0x545376[_0x777a('0x1b')],'include':_0x545376[_0x777a('0x1d')]?_['map'](_0x545376[_0x777a('0x1d')],function(_0x345995){return{'model':db[_0x345995[_0x777a('0x1f')]],'as':_0x345995['as'],'attributes':_0x345995[_0x777a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x777a('0xa')](function(_0x463b68){logger[_0x777a('0xb')](_0x777a('0x21'),_0x9fb4d1);logger[_0x777a('0xe')](_0x777a('0x21'),_0x9fb4d1,JSON[_0x777a('0x20')](_0x463b68));_0x2de97e(_0x463b68);})[_0x777a('0x14')](function(_0x218cd0){logger[_0x777a('0x10')](_0x777a('0x21'),_0x218cd0[_0x777a('0x12')],_0x9fb4d1);_0x2b155b(_0x74d829[_0x777a('0x10')](0x1f4,_0x218cd0[_0x777a('0x12')]));});});}; \ No newline at end of file +var _0x61e6=['message','info','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','map','include','model','debug','stringify','find','ShowServicenowAccount','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','then','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','ServicenowAccount,\x20%s,\x20%s'];(function(_0x4cb095,_0x58da07){var _0x2b565d=function(_0x4d41b3){while(--_0x4d41b3){_0x4cb095['push'](_0x4cb095['shift']());}};_0x2b565d(++_0x58da07);}(_0x61e6,0x151));var _0x661e=function(_0x39f7d6,_0x5d3385){_0x39f7d6=_0x39f7d6-0x0;var _0x25c37e=_0x61e6[_0x39f7d6];return _0x25c37e;};'use strict';var _=require(_0x661e('0x0'));var util=require(_0x661e('0x1'));var moment=require(_0x661e('0x2'));var BPromise=require(_0x661e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x661e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x661e('0x5'));var logger=require(_0x661e('0x6'))(_0x661e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x661e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x371562,_0x590fad,_0xbb23bc){return new BPromise(function(_0x35ed1b,_0x4a3a47){return client['request'](_0x371562,_0xbb23bc)[_0x661e('0x9')](function(_0x1e3233){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x590fad,_0x661e('0xa'));logger['debug'](_0x661e('0xb'),_0x590fad,_0x661e('0xa'),JSON['stringify'](_0x1e3233));if(_0x1e3233[_0x661e('0xc')]){if(_0x1e3233['error'][_0x661e('0xd')]===0x1f4){logger[_0x661e('0xc')](_0x661e('0xe'),_0x590fad,_0x1e3233['error'][_0x661e('0xf')]);return _0x4a3a47(_0x1e3233['error'][_0x661e('0xf')]);}logger[_0x661e('0xc')](_0x661e('0xe'),_0x590fad,_0x1e3233[_0x661e('0xc')]['message']);return _0x35ed1b(_0x1e3233[_0x661e('0xc')][_0x661e('0xf')]);}else{logger[_0x661e('0x10')](_0x661e('0xe'),_0x590fad,_0x661e('0xa'));_0x35ed1b(_0x1e3233[_0x661e('0x11')][_0x661e('0xf')]);}})[_0x661e('0x12')](function(_0x39bf72){logger[_0x661e('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x590fad,_0x39bf72);_0x4a3a47(_0x39bf72);});});}exports[_0x661e('0x13')]=function(_0x292ad5){var _0x5a435b=this;return new Promise(function(_0x555632,_0x3ff7a2){return db[_0x661e('0x14')]['findAll']({'raw':_0x292ad5['options']?_0x292ad5[_0x661e('0x15')][_0x661e('0x16')]===undefined?!![]:![]:!![],'where':_0x292ad5[_0x661e('0x15')]?_0x292ad5[_0x661e('0x15')][_0x661e('0x17')]||null:null,'attributes':_0x292ad5['options']?_0x292ad5[_0x661e('0x15')][_0x661e('0x18')]||null:null,'limit':_0x292ad5['options']?_0x292ad5[_0x661e('0x15')]['limit']||null:null,'include':_0x292ad5['options']?_0x292ad5['options']['include']?_[_0x661e('0x19')](_0x292ad5[_0x661e('0x15')][_0x661e('0x1a')],function(_0x53af47){return{'model':db[_0x53af47[_0x661e('0x1b')]],'as':_0x53af47['as'],'attributes':_0x53af47[_0x661e('0x18')],'include':_0x53af47[_0x661e('0x1a')]?_['map'](_0x53af47[_0x661e('0x1a')],function(_0x18c1e7){return{'model':db[_0x18c1e7[_0x661e('0x1b')]],'as':_0x18c1e7['as'],'attributes':_0x18c1e7['attributes'],'include':_0x18c1e7[_0x661e('0x1a')]?_[_0x661e('0x19')](_0x18c1e7[_0x661e('0x1a')],function(_0x4ff4fe){return{'model':db[_0x4ff4fe[_0x661e('0x1b')]],'as':_0x4ff4fe['as'],'attributes':_0x4ff4fe[_0x661e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x661e('0x9')](function(_0x3e9915){logger[_0x661e('0x10')](_0x661e('0x13'),_0x292ad5);logger[_0x661e('0x1c')]('GetServicenowAccount',_0x292ad5,JSON[_0x661e('0x1d')](_0x3e9915));_0x555632(_0x3e9915);})['catch'](function(_0x2938bc){logger[_0x661e('0xc')](_0x661e('0x13'),_0x2938bc['message'],_0x292ad5);_0x3ff7a2(_0x5a435b[_0x661e('0xc')](0x1f4,_0x2938bc[_0x661e('0xf')]));});});};exports['ShowServicenowAccount']=function(_0x5c3ceb){var _0x5c6009=this;return new Promise(function(_0x3eda13,_0x470be9){return db[_0x661e('0x14')][_0x661e('0x1e')]({'raw':_0x5c3ceb[_0x661e('0x15')]?_0x5c3ceb[_0x661e('0x15')][_0x661e('0x16')]===undefined?!![]:![]:!![],'where':_0x5c3ceb[_0x661e('0x15')]?_0x5c3ceb[_0x661e('0x15')]['where']||null:null,'attributes':_0x5c3ceb[_0x661e('0x15')]?_0x5c3ceb['options'][_0x661e('0x18')]||null:null,'include':_0x5c3ceb['options']?_0x5c3ceb['options'][_0x661e('0x1a')]?_[_0x661e('0x19')](_0x5c3ceb['options'][_0x661e('0x1a')],function(_0x2bba43){return{'model':db[_0x2bba43[_0x661e('0x1b')]],'as':_0x2bba43['as'],'attributes':_0x2bba43['attributes'],'include':_0x2bba43[_0x661e('0x1a')]?_[_0x661e('0x19')](_0x2bba43[_0x661e('0x1a')],function(_0x591989){return{'model':db[_0x591989[_0x661e('0x1b')]],'as':_0x591989['as'],'attributes':_0x591989[_0x661e('0x18')],'include':_0x591989[_0x661e('0x1a')]?_['map'](_0x591989[_0x661e('0x1a')],function(_0x48fba0){return{'model':db[_0x48fba0[_0x661e('0x1b')]],'as':_0x48fba0['as'],'attributes':_0x48fba0[_0x661e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x661e('0x9')](function(_0x4f3a7d){logger[_0x661e('0x10')](_0x661e('0x1f'),_0x5c3ceb);logger[_0x661e('0x1c')](_0x661e('0x1f'),_0x5c3ceb,JSON[_0x661e('0x1d')](_0x4f3a7d));_0x3eda13(_0x4f3a7d);})[_0x661e('0x12')](function(_0x4a301d){logger['error']('ShowServicenowAccount',_0x4a301d['message'],_0x5c3ceb);_0x470be9(_0x5c6009[_0x661e('0xc')](0x1f4,_0x4a301d[_0x661e('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 2fe417c..f89b227 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 _0x700e=['/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x39746d,_0x41c9e6){var _0x3196e3=function(_0x2c709e){while(--_0x2c709e){_0x39746d['push'](_0x39746d['shift']());}};_0x3196e3(++_0x41c9e6);}(_0x700e,0xe3));var _0xe700=function(_0x3afff1,_0x5d55b0){_0x3afff1=_0x3afff1-0x0;var _0x1c5412=_0x700e[_0x3afff1];return _0x1c5412;};'use strict';var multer=require(_0xe700('0x0'));var util=require(_0xe700('0x1'));var path=require('path');var timeout=require(_0xe700('0x2'));var express=require(_0xe700('0x3'));var router=express[_0xe700('0x4')]();var auth=require(_0xe700('0x5'));var interaction=require(_0xe700('0x6'));var config=require(_0xe700('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xe700('0x8')]('/',auth[_0xe700('0x9')](),controller[_0xe700('0xa')]);router['get'](_0xe700('0xb'),auth[_0xe700('0x9')](),controller[_0xe700('0xc')]);router[_0xe700('0x8')](_0xe700('0xd'),auth[_0xe700('0x9')](),controller['getFields']);router[_0xe700('0x8')](_0xe700('0xe'),auth[_0xe700('0x9')](),controller[_0xe700('0xf')]);router[_0xe700('0x8')](_0xe700('0x10'),auth['isAuthenticated'](),controller[_0xe700('0x11')]);router[_0xe700('0x12')]('/',auth[_0xe700('0x9')](),controller['create']);router[_0xe700('0x13')]('/:id',auth[_0xe700('0x9')](),controller[_0xe700('0x14')]);router[_0xe700('0x15')](_0xe700('0xb'),auth[_0xe700('0x9')](),controller[_0xe700('0x16')]);module[_0xe700('0x17')]=router; \ No newline at end of file +var _0xd1df=['/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index'];(function(_0x34ee85,_0x1015e5){var _0x6dcaff=function(_0x2896e3){while(--_0x2896e3){_0x34ee85['push'](_0x34ee85['shift']());}};_0x6dcaff(++_0x1015e5);}(_0xd1df,0x1bd));var _0xfd1d=function(_0x2a2481,_0x40367e){_0x2a2481=_0x2a2481-0x0;var _0x3bd844=_0xd1df[_0x2a2481];return _0x3bd844;};'use strict';var multer=require(_0xfd1d('0x0'));var util=require(_0xfd1d('0x1'));var path=require(_0xfd1d('0x2'));var timeout=require(_0xfd1d('0x3'));var express=require(_0xfd1d('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfd1d('0x5'));var config=require(_0xfd1d('0x6'));var controller=require(_0xfd1d('0x7'));router[_0xfd1d('0x8')]('/',auth[_0xfd1d('0x9')](),controller[_0xfd1d('0xa')]);router[_0xfd1d('0x8')]('/:id',auth[_0xfd1d('0x9')](),controller['show']);router['get'](_0xfd1d('0xb'),auth['isAuthenticated'](),controller[_0xfd1d('0xc')]);router[_0xfd1d('0x8')](_0xfd1d('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xfd1d('0x8')](_0xfd1d('0xe'),auth[_0xfd1d('0x9')](),controller['getDescriptions']);router[_0xfd1d('0xf')]('/',auth['isAuthenticated'](),controller[_0xfd1d('0x10')]);router['put']('/:id',auth[_0xfd1d('0x9')](),controller['update']);router[_0xfd1d('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xfd1d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index eace2b9..357bfd5 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 _0x7f6f=['STRING','exports'];(function(_0x1a1f3a,_0x1547a7){var _0xf8b031=function(_0x236ffb){while(--_0x236ffb){_0x1a1f3a['push'](_0x1a1f3a['shift']());}};_0xf8b031(++_0x1547a7);}(_0x7f6f,0x105));var _0xf7f6=function(_0x1c8bb1,_0x5621e8){_0x1c8bb1=_0x1c8bb1-0x0;var _0x1f5c9f=_0x7f6f[_0x1c8bb1];return _0x1f5c9f;};'use strict';var Sequelize=require('sequelize');module[_0xf7f6('0x0')]={'name':{'type':Sequelize[_0xf7f6('0x1')]},'description':{'type':Sequelize[_0xf7f6('0x1')]}}; \ No newline at end of file +var _0x9371=['STRING','exports'];(function(_0x5c64ae,_0x463dcb){var _0x422e59=function(_0x2bfda5){while(--_0x2bfda5){_0x5c64ae['push'](_0x5c64ae['shift']());}};_0x422e59(++_0x463dcb);}(_0x9371,0x119));var _0x1937=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9371[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0x1937('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1937('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 2702029..4ffdbda 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 _0x153f=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','ServicenowConfiguration','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','include','findAll','rows','show','params','rawAttributes','includeAll','options','find','create','body','getFields','findOne','ServicenowField','order','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x4e4591,_0x4424f4){var _0x453e2a=function(_0x274f2d){while(--_0x274f2d){_0x4e4591['push'](_0x4e4591['shift']());}};_0x453e2a(++_0x4424f4);}(_0x153f,0x15b));var _0xf153=function(_0xa81666,_0x128630){_0xa81666=_0xa81666-0x0;var _0x40cbbf=_0x153f[_0xa81666];return _0x40cbbf;};'use strict';var pdf=require(_0xf153('0x0'));var emlformat=require(_0xf153('0x1'));var rimraf=require(_0xf153('0x2'));var zipdir=require(_0xf153('0x3'));var jsonpatch=require(_0xf153('0x4'));var rp=require(_0xf153('0x5'));var moment=require(_0xf153('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf153('0x7'));var util=require('util');var path=require(_0xf153('0x8'));var sox=require(_0xf153('0x9'));var csv=require(_0xf153('0xa'));var ejs=require(_0xf153('0xb'));var fs=require('fs');var _=require(_0xf153('0xc'));var squel=require('squel');var crypto=require(_0xf153('0xd'));var jsforce=require(_0xf153('0xe'));var deskjs=require(_0xf153('0xf'));var toCsv=require(_0xf153('0xa'));var querystring=require(_0xf153('0x10'));var Papa=require(_0xf153('0x11'));var authService=require(_0xf153('0x12'));var hardwareService=require(_0xf153('0x13'));var Redis=require(_0xf153('0x14'));var qs=require(_0xf153('0x15'));var logger=require('../../config/logger')(_0xf153('0x16'));var utils=require(_0xf153('0x17'));var config=require(_0xf153('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf153('0x19'));var client=jayson[_0xf153('0x1a')][_0xf153('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1cc666,_0x256b7d,_0x107d31,_0x3f915c){return new BPromise(function(_0x1d54c4,_0x3e34fb){var _0x4c5283=_0x3f915c||client;return _0x4c5283[_0xf153('0x1c')](_0x1cc666,_0x107d31)[_0xf153('0x1d')](function(_0x2b666e){logger[_0xf153('0x1e')](_0xf153('0x1f'),_0x256b7d,_0xf153('0x20'));logger[_0xf153('0x21')](_0xf153('0x22'),_0x256b7d,'request\x20sent',JSON[_0xf153('0x23')](_0x2b666e));if(_0x2b666e['error']){if(_0x2b666e[_0xf153('0x24')][_0xf153('0x25')]===0x1f4){logger[_0xf153('0x24')](_0xf153('0x1f'),_0x256b7d,_0x2b666e['error'][_0xf153('0x26')]);return _0x3e34fb(_0x2b666e[_0xf153('0x24')][_0xf153('0x26')]);}logger[_0xf153('0x24')](_0xf153('0x1f'),_0x256b7d,_0x2b666e[_0xf153('0x24')][_0xf153('0x26')]);return _0x1d54c4(_0x2b666e[_0xf153('0x24')][_0xf153('0x26')]);}else{logger[_0xf153('0x1e')](_0xf153('0x1f'),_0x256b7d,_0xf153('0x20'));_0x1d54c4(_0x2b666e['result'][_0xf153('0x26')]);}})[_0xf153('0x27')](function(_0x3d3e41){logger[_0xf153('0x24')](_0xf153('0x1f'),_0x256b7d,_0x3d3e41);_0x3e34fb(_0x3d3e41);});});}function respondWithStatusCode(_0x3e94b5,_0x465d88){_0x465d88=_0x465d88||0xcc;return function(_0x4376f7){if(_0x4376f7){return _0x3e94b5[_0xf153('0x28')](_0x465d88);}return _0x3e94b5[_0xf153('0x29')](_0x465d88)[_0xf153('0x2a')]();};}function respondWithResult(_0x39f3ed,_0x35cfe3){_0x35cfe3=_0x35cfe3||0xc8;return function(_0x1e0e49){if(_0x1e0e49){return _0x39f3ed[_0xf153('0x29')](_0x35cfe3)[_0xf153('0x2b')](_0x1e0e49);}};}function respondWithFilteredResult(_0x141ef4,_0x703adb){return function(_0x23acc3){if(_0x23acc3){var _0x17f7a4=_0x23acc3['count'],_0x48ebdc=_0x703adb[_0xf153('0x2c')],_0x6d62ef=_0x703adb[_0xf153('0x2c')]+_0x703adb['limit'],_0x3f1c6f;if(_0x6d62ef>=_0x17f7a4){_0x6d62ef=_0x17f7a4;_0x3f1c6f=0xc8;}else{_0x3f1c6f=0xce;}_0x141ef4[_0xf153('0x29')](_0x3f1c6f);return _0x141ef4[_0xf153('0x2d')](_0xf153('0x2e'),_0x48ebdc+'-'+_0x6d62ef+'/'+_0x17f7a4)[_0xf153('0x2b')](_0x23acc3);}return null;};}function patchUpdates(_0x339e96){return function(_0x258976){try{jsonpatch[_0xf153('0x2f')](_0x258976,_0x339e96,!![]);}catch(_0x3b5f4f){return BPromise[_0xf153('0x30')](_0x3b5f4f);}return _0x258976[_0xf153('0x31')]();};}function saveUpdates(_0x13b541,_0x415a5f){return function(_0x5b5237){if(_0x5b5237){return _0x5b5237[_0xf153('0x32')](_0x13b541)[_0xf153('0x1d')](function(_0x313516){return _0x313516;});}return null;};}function removeEntity(_0x2b6d41,_0x4d6b50){return function(_0x47b715){if(_0x47b715){return _0x47b715[_0xf153('0x33')]()['then'](function(){_0x2b6d41['status'](0xcc)[_0xf153('0x2a')]();});}};}function handleEntityNotFound(_0x4ab958,_0x2b9623){return function(_0x4d1a71){if(!_0x4d1a71){_0x4ab958[_0xf153('0x28')](0x194);}return _0x4d1a71;};}function handleError(_0x10f461,_0x4bc442){_0x4bc442=_0x4bc442||0x1f4;return function(_0x7077dd){logger[_0xf153('0x24')](_0x7077dd[_0xf153('0x34')]);if(_0x7077dd[_0xf153('0x35')]){delete _0x7077dd[_0xf153('0x35')];}_0x10f461[_0xf153('0x29')](_0x4bc442)['send'](_0x7077dd);};}exports[_0xf153('0x36')]=function(_0x5c333b,_0x40834b){var _0x2523c0={},_0x9b3f4c={},_0x1820c3={'count':0x0,'rows':[]};var _0x274bcc=db[_0xf153('0x37')]['rawAttributes'];_0x9b3f4c[_0xf153('0x38')]=_[_0xf153('0x39')](_0x274bcc);_0x9b3f4c[_0xf153('0x3a')]=_['keys'](_0x5c333b[_0xf153('0x3a')]);_0x9b3f4c[_0xf153('0x3b')]=_[_0xf153('0x3c')](_0x9b3f4c[_0xf153('0x38')],_0x9b3f4c[_0xf153('0x3a')]);_0x2523c0[_0xf153('0x3d')]=_['intersection'](_0x9b3f4c[_0xf153('0x38')],qs[_0xf153('0x3e')](_0x5c333b['query'][_0xf153('0x3e')]));_0x2523c0[_0xf153('0x3d')]=_0x2523c0[_0xf153('0x3d')][_0xf153('0x3f')]?_0x2523c0[_0xf153('0x3d')]:_0x9b3f4c[_0xf153('0x38')];if(!_0x5c333b[_0xf153('0x3a')]['hasOwnProperty'](_0xf153('0x40'))){_0x2523c0[_0xf153('0x41')]=qs[_0xf153('0x41')](_0x5c333b[_0xf153('0x3a')][_0xf153('0x41')]);_0x2523c0[_0xf153('0x2c')]=qs['offset'](_0x5c333b['query'][_0xf153('0x2c')]);}_0x2523c0['order']=qs[_0xf153('0x42')](_0x5c333b[_0xf153('0x3a')][_0xf153('0x42')]);_0x2523c0[_0xf153('0x43')]=qs[_0xf153('0x3b')](_[_0xf153('0x44')](_0x5c333b['query'],_0x9b3f4c['filters']));if(_0x5c333b[_0xf153('0x3a')][_0xf153('0x45')]){_0x2523c0['where']=_[_0xf153('0x46')](_0x2523c0[_0xf153('0x43')],{'$or':_[_0xf153('0x47')](_0x274bcc,function(_0x3a9cb2){if(_0x3a9cb2[_0xf153('0x48')][_0xf153('0x49')]!==_0xf153('0x4a')){var _0x17fb17={};_0x17fb17[_0x3a9cb2[_0xf153('0x4b')]]={'$like':'%'+_0x5c333b[_0xf153('0x3a')][_0xf153('0x45')]+'%'};return _0x17fb17;}})});}_0x2523c0=_[_0xf153('0x46')]({},_0x2523c0,_0x5c333b['options']);var _0x8cd44a={'where':_0x2523c0[_0xf153('0x43')]};return db[_0xf153('0x37')]['count'](_0x8cd44a)[_0xf153('0x1d')](function(_0x136611){_0x1820c3['count']=_0x136611;if(_0x5c333b[_0xf153('0x3a')]['includeAll']){_0x2523c0[_0xf153('0x4c')]=[{'all':!![]}];}return db[_0xf153('0x37')][_0xf153('0x4d')](_0x2523c0);})['then'](function(_0x1f540b){_0x1820c3[_0xf153('0x4e')]=_0x1f540b;return _0x1820c3;})[_0xf153('0x1d')](respondWithFilteredResult(_0x40834b,_0x2523c0))[_0xf153('0x27')](handleError(_0x40834b,null));};exports[_0xf153('0x4f')]=function(_0x595b60,_0x33db6f){var _0x3bc265={'raw':![],'where':{'id':_0x595b60[_0xf153('0x50')]['id']}},_0x5bbf89={};_0x5bbf89[_0xf153('0x38')]=_[_0xf153('0x39')](db['ServicenowConfiguration'][_0xf153('0x51')]);_0x5bbf89[_0xf153('0x3a')]=_[_0xf153('0x39')](_0x595b60[_0xf153('0x3a')]);_0x5bbf89[_0xf153('0x3b')]=_[_0xf153('0x3c')](_0x5bbf89[_0xf153('0x38')],_0x5bbf89[_0xf153('0x3a')]);_0x3bc265[_0xf153('0x3d')]=_['intersection'](_0x5bbf89[_0xf153('0x38')],qs['fields'](_0x595b60['query']['fields']));_0x3bc265[_0xf153('0x3d')]=_0x3bc265[_0xf153('0x3d')]['length']?_0x3bc265[_0xf153('0x3d')]:_0x5bbf89[_0xf153('0x38')];if(_0x595b60['query'][_0xf153('0x52')]){_0x3bc265[_0xf153('0x4c')]=[{'all':!![]}];}_0x3bc265=_[_0xf153('0x46')]({},_0x3bc265,_0x595b60[_0xf153('0x53')]);return db[_0xf153('0x37')][_0xf153('0x54')](_0x3bc265)['then'](handleEntityNotFound(_0x33db6f,null))[_0xf153('0x1d')](respondWithResult(_0x33db6f,null))[_0xf153('0x27')](handleError(_0x33db6f,null));};exports['create']=function(_0x566a65,_0x1a92cb){return db[_0xf153('0x37')][_0xf153('0x55')](_0x566a65[_0xf153('0x56')],{})[_0xf153('0x1d')](respondWithResult(_0x1a92cb,0xc9))[_0xf153('0x27')](handleError(_0x1a92cb,null));};exports['update']=function(_0xbea48,_0x51d813){if(_0xbea48[_0xf153('0x56')]['id']){delete _0xbea48[_0xf153('0x56')]['id'];}return db[_0xf153('0x37')]['find']({'where':{'id':_0xbea48[_0xf153('0x50')]['id']}})[_0xf153('0x1d')](handleEntityNotFound(_0x51d813,null))[_0xf153('0x1d')](saveUpdates(_0xbea48[_0xf153('0x56')],null))[_0xf153('0x1d')](respondWithResult(_0x51d813,null))[_0xf153('0x27')](handleError(_0x51d813,null));};exports[_0xf153('0x33')]=function(_0x49b1f8,_0x84e55){return db[_0xf153('0x37')][_0xf153('0x54')]({'where':{'id':_0x49b1f8['params']['id']}})[_0xf153('0x1d')](handleEntityNotFound(_0x84e55,null))[_0xf153('0x1d')](removeEntity(_0x84e55,null))[_0xf153('0x27')](handleError(_0x84e55,null));};exports[_0xf153('0x57')]=function(_0x368ac1,_0x984ce8,_0x245124){var _0x29cfe8={};var _0x4e1e51={};var _0x308b5f;var _0xca443;return db['ServicenowConfiguration'][_0xf153('0x58')]({'where':{'id':_0x368ac1[_0xf153('0x50')]['id']}})[_0xf153('0x1d')](handleEntityNotFound(_0x984ce8,null))[_0xf153('0x1d')](function(_0x1f2830){if(_0x1f2830){_0x308b5f=_0x1f2830;_0x4e1e51[_0xf153('0x38')]=_[_0xf153('0x39')](db[_0xf153('0x59')][_0xf153('0x51')]);_0x4e1e51[_0xf153('0x3a')]=_[_0xf153('0x39')](_0x368ac1['query']);_0x4e1e51[_0xf153('0x3b')]=_[_0xf153('0x3c')](_0x4e1e51['model'],_0x4e1e51[_0xf153('0x3a')]);_0x29cfe8[_0xf153('0x3d')]=_[_0xf153('0x3c')](_0x4e1e51[_0xf153('0x38')],qs[_0xf153('0x3e')](_0x368ac1[_0xf153('0x3a')][_0xf153('0x3e')]));_0x29cfe8['attributes']=_0x29cfe8[_0xf153('0x3d')][_0xf153('0x3f')]?_0x29cfe8[_0xf153('0x3d')]:_0x4e1e51[_0xf153('0x38')];_0x29cfe8[_0xf153('0x5a')]=qs[_0xf153('0x42')](_0x368ac1[_0xf153('0x3a')][_0xf153('0x42')]);_0x29cfe8[_0xf153('0x43')]=qs['filters'](_[_0xf153('0x44')](_0x368ac1[_0xf153('0x3a')],_0x4e1e51['filters']));if(_0x368ac1[_0xf153('0x3a')]['filter']){_0x29cfe8[_0xf153('0x43')]=_[_0xf153('0x46')](_0x29cfe8['where'],{'$or':_[_0xf153('0x47')](_0x29cfe8['attributes'],function(_0x375d73){var _0x2338e2={};_0x2338e2[_0x375d73]={'$like':'%'+_0x368ac1[_0xf153('0x3a')][_0xf153('0x45')]+'%'};return _0x2338e2;})});}_0x29cfe8=_['merge']({},_0x29cfe8,_0x368ac1[_0xf153('0x53')]);return _0x308b5f[_0xf153('0x57')](_0x29cfe8);}})['then'](function(_0x43d10b){if(_0x43d10b){_0xca443=_0x43d10b[_0xf153('0x3f')];if(!_0x368ac1[_0xf153('0x3a')][_0xf153('0x5b')](_0xf153('0x40'))){_0x29cfe8['limit']=qs[_0xf153('0x41')](_0x368ac1['query'][_0xf153('0x41')]);_0x29cfe8[_0xf153('0x2c')]=qs['offset'](_0x368ac1['query'][_0xf153('0x2c')]);}return _0x308b5f[_0xf153('0x57')](_0x29cfe8);}})['then'](function(_0x4775b1){if(_0x4775b1){return _0x4775b1?{'count':_0xca443,'rows':_0x4775b1}:null;}})[_0xf153('0x1d')](respondWithResult(_0x984ce8,null))[_0xf153('0x27')](handleError(_0x984ce8,null));};exports['getSubjects']=function(_0x671efe,_0x2d3c38,_0x3b87e7){var _0x1e5e95={};var _0x20b6d3={};var _0x10fad8;var _0x37443f;return db[_0xf153('0x37')][_0xf153('0x58')]({'where':{'id':_0x671efe[_0xf153('0x50')]['id']}})[_0xf153('0x1d')](handleEntityNotFound(_0x2d3c38,null))[_0xf153('0x1d')](function(_0x21202e){if(_0x21202e){_0x10fad8=_0x21202e;_0x20b6d3[_0xf153('0x38')]=_[_0xf153('0x39')](db[_0xf153('0x59')]['rawAttributes']);_0x20b6d3[_0xf153('0x3a')]=_['keys'](_0x671efe['query']);_0x20b6d3[_0xf153('0x3b')]=_['intersection'](_0x20b6d3[_0xf153('0x38')],_0x20b6d3[_0xf153('0x3a')]);_0x1e5e95[_0xf153('0x3d')]=_[_0xf153('0x3c')](_0x20b6d3[_0xf153('0x38')],qs[_0xf153('0x3e')](_0x671efe['query'][_0xf153('0x3e')]));_0x1e5e95[_0xf153('0x3d')]=_0x1e5e95[_0xf153('0x3d')]['length']?_0x1e5e95['attributes']:_0x20b6d3[_0xf153('0x38')];_0x1e5e95[_0xf153('0x5a')]=qs[_0xf153('0x42')](_0x671efe['query'][_0xf153('0x42')]);_0x1e5e95['where']=qs['filters'](_[_0xf153('0x44')](_0x671efe[_0xf153('0x3a')],_0x20b6d3[_0xf153('0x3b')]));if(_0x671efe['query'][_0xf153('0x45')]){_0x1e5e95[_0xf153('0x43')]=_['merge'](_0x1e5e95[_0xf153('0x43')],{'$or':_[_0xf153('0x47')](_0x1e5e95[_0xf153('0x3d')],function(_0x21d51f){var _0x103eff={};_0x103eff[_0x21d51f]={'$like':'%'+_0x671efe['query'][_0xf153('0x45')]+'%'};return _0x103eff;})});}_0x1e5e95=_[_0xf153('0x46')]({},_0x1e5e95,_0x671efe[_0xf153('0x53')]);return _0x10fad8[_0xf153('0x5c')](_0x1e5e95);}})[_0xf153('0x1d')](function(_0x276187){if(_0x276187){_0x37443f=_0x276187[_0xf153('0x3f')];if(!_0x671efe['query'][_0xf153('0x5b')](_0xf153('0x40'))){_0x1e5e95[_0xf153('0x41')]=qs[_0xf153('0x41')](_0x671efe[_0xf153('0x3a')][_0xf153('0x41')]);_0x1e5e95['offset']=qs[_0xf153('0x2c')](_0x671efe[_0xf153('0x3a')][_0xf153('0x2c')]);}return _0x10fad8[_0xf153('0x5c')](_0x1e5e95);}})[_0xf153('0x1d')](function(_0x20db97){if(_0x20db97){return _0x20db97?{'count':_0x37443f,'rows':_0x20db97}:null;}})[_0xf153('0x1d')](respondWithResult(_0x2d3c38,null))[_0xf153('0x27')](handleError(_0x2d3c38,null));};exports[_0xf153('0x5d')]=function(_0x37bfa1,_0x5a1ffb,_0x5f3d56){var _0x56827a={};var _0x4f66b1={};var _0x239c06;var _0x43aa7f;return db[_0xf153('0x37')][_0xf153('0x58')]({'where':{'id':_0x37bfa1[_0xf153('0x50')]['id']}})['then'](handleEntityNotFound(_0x5a1ffb,null))[_0xf153('0x1d')](function(_0x175234){if(_0x175234){_0x239c06=_0x175234;_0x4f66b1[_0xf153('0x38')]=_[_0xf153('0x39')](db['ServicenowField'][_0xf153('0x51')]);_0x4f66b1[_0xf153('0x3a')]=_[_0xf153('0x39')](_0x37bfa1['query']);_0x4f66b1[_0xf153('0x3b')]=_['intersection'](_0x4f66b1[_0xf153('0x38')],_0x4f66b1[_0xf153('0x3a')]);_0x56827a[_0xf153('0x3d')]=_['intersection'](_0x4f66b1['model'],qs['fields'](_0x37bfa1[_0xf153('0x3a')][_0xf153('0x3e')]));_0x56827a['attributes']=_0x56827a['attributes'][_0xf153('0x3f')]?_0x56827a['attributes']:_0x4f66b1[_0xf153('0x38')];_0x56827a['order']=qs[_0xf153('0x42')](_0x37bfa1[_0xf153('0x3a')][_0xf153('0x42')]);_0x56827a[_0xf153('0x43')]=qs[_0xf153('0x3b')](_[_0xf153('0x44')](_0x37bfa1['query'],_0x4f66b1[_0xf153('0x3b')]));if(_0x37bfa1[_0xf153('0x3a')]['filter']){_0x56827a[_0xf153('0x43')]=_[_0xf153('0x46')](_0x56827a[_0xf153('0x43')],{'$or':_[_0xf153('0x47')](_0x56827a['attributes'],function(_0x3e36fc){var _0x19534a={};_0x19534a[_0x3e36fc]={'$like':'%'+_0x37bfa1['query'][_0xf153('0x45')]+'%'};return _0x19534a;})});}_0x56827a=_[_0xf153('0x46')]({},_0x56827a,_0x37bfa1[_0xf153('0x53')]);return _0x239c06[_0xf153('0x5d')](_0x56827a);}})['then'](function(_0x23454f){if(_0x23454f){_0x43aa7f=_0x23454f[_0xf153('0x3f')];if(!_0x37bfa1[_0xf153('0x3a')][_0xf153('0x5b')](_0xf153('0x40'))){_0x56827a[_0xf153('0x41')]=qs[_0xf153('0x41')](_0x37bfa1[_0xf153('0x3a')][_0xf153('0x41')]);_0x56827a['offset']=qs[_0xf153('0x2c')](_0x37bfa1[_0xf153('0x3a')][_0xf153('0x2c')]);}return _0x239c06['getDescriptions'](_0x56827a);}})['then'](function(_0x249bda){if(_0x249bda){return _0x249bda?{'count':_0x43aa7f,'rows':_0x249bda}:null;}})['then'](respondWithResult(_0x5a1ffb,null))[_0xf153('0x27')](handleError(_0x5a1ffb,null));}; \ No newline at end of file +var _0x91a7=['jayson/promise','client','request','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','ServicenowConfiguration,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','name','send','index','ServicenowConfiguration','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','filter','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','show','create','body','find','destroy','params','findOne','ServicenowField','sort','getFields','getSubjects','merge','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2b940d,_0x11c65c){var _0x407e41=function(_0x319d61){while(--_0x319d61){_0x2b940d['push'](_0x2b940d['shift']());}};_0x407e41(++_0x11c65c);}(_0x91a7,0xe7));var _0x791a=function(_0xc622b8,_0x278865){_0xc622b8=_0xc622b8-0x0;var _0x2b53a7=_0x91a7[_0xc622b8];return _0x2b53a7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x791a('0x0'));var rimraf=require(_0x791a('0x1'));var zipdir=require(_0x791a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x791a('0x3'));var moment=require('moment');var BPromise=require(_0x791a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x791a('0x5'));var sox=require(_0x791a('0x6'));var csv=require('to-csv');var ejs=require(_0x791a('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0xb'));var querystring=require(_0x791a('0xc'));var Papa=require(_0x791a('0xd'));var authService=require(_0x791a('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x791a('0xf'));var qs=require(_0x791a('0x10'));var logger=require('../../config/logger')(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var db=require(_0x791a('0x14'))['db'];var jayson=require(_0x791a('0x15'));var client=jayson[_0x791a('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5daecd,_0xc92016,_0x2f2d8d,_0x4c56f0){return new BPromise(function(_0x346c44,_0x3a2ec6){var _0x5d5b11=_0x4c56f0||client;return _0x5d5b11[_0x791a('0x17')](_0x5daecd,_0x2f2d8d)[_0x791a('0x18')](function(_0x2ef5c5){logger[_0x791a('0x19')]('ServicenowConfiguration,\x20%s,\x20%s',_0xc92016,_0x791a('0x1a'));logger['debug'](_0x791a('0x1b'),_0xc92016,_0x791a('0x1a'),JSON['stringify'](_0x2ef5c5));if(_0x2ef5c5[_0x791a('0x1c')]){if(_0x2ef5c5['error'][_0x791a('0x1d')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0xc92016,_0x2ef5c5['error'][_0x791a('0x1e')]);return _0x3a2ec6(_0x2ef5c5['error']['message']);}logger[_0x791a('0x1c')](_0x791a('0x1f'),_0xc92016,_0x2ef5c5[_0x791a('0x1c')][_0x791a('0x1e')]);return _0x346c44(_0x2ef5c5['error'][_0x791a('0x1e')]);}else{logger[_0x791a('0x19')](_0x791a('0x1f'),_0xc92016,_0x791a('0x1a'));_0x346c44(_0x2ef5c5['result'][_0x791a('0x1e')]);}})[_0x791a('0x20')](function(_0x25bae5){logger[_0x791a('0x1c')](_0x791a('0x1f'),_0xc92016,_0x25bae5);_0x3a2ec6(_0x25bae5);});});}function respondWithStatusCode(_0x1091af,_0x2241a0){_0x2241a0=_0x2241a0||0xcc;return function(_0x45a67d){if(_0x45a67d){return _0x1091af[_0x791a('0x21')](_0x2241a0);}return _0x1091af[_0x791a('0x22')](_0x2241a0)[_0x791a('0x23')]();};}function respondWithResult(_0x5e03a3,_0x1102c9){_0x1102c9=_0x1102c9||0xc8;return function(_0x2728a0){if(_0x2728a0){return _0x5e03a3[_0x791a('0x22')](_0x1102c9)[_0x791a('0x24')](_0x2728a0);}};}function respondWithFilteredResult(_0x4d748a,_0x456480){return function(_0x2db3f7){if(_0x2db3f7){var _0x51dcca=_0x2db3f7['count'],_0xdfa84f=_0x456480[_0x791a('0x25')],_0x1785f5=_0x456480[_0x791a('0x25')]+_0x456480[_0x791a('0x26')],_0x16dbaf;if(_0x1785f5>=_0x51dcca){_0x1785f5=_0x51dcca;_0x16dbaf=0xc8;}else{_0x16dbaf=0xce;}_0x4d748a[_0x791a('0x22')](_0x16dbaf);return _0x4d748a[_0x791a('0x27')](_0x791a('0x28'),_0xdfa84f+'-'+_0x1785f5+'/'+_0x51dcca)[_0x791a('0x24')](_0x2db3f7);}return null;};}function patchUpdates(_0x889534){return function(_0x58bbc0){try{jsonpatch[_0x791a('0x29')](_0x58bbc0,_0x889534,!![]);}catch(_0x9e9332){return BPromise[_0x791a('0x2a')](_0x9e9332);}return _0x58bbc0['save']();};}function saveUpdates(_0x1cdda9,_0x5df656){return function(_0xc59f5e){if(_0xc59f5e){return _0xc59f5e[_0x791a('0x2b')](_0x1cdda9)[_0x791a('0x18')](function(_0xe72e0c){return _0xe72e0c;});}return null;};}function removeEntity(_0x6f7624,_0x32c7b2){return function(_0x15ff6e){if(_0x15ff6e){return _0x15ff6e['destroy']()[_0x791a('0x18')](function(){_0x6f7624[_0x791a('0x22')](0xcc)[_0x791a('0x23')]();});}};}function handleEntityNotFound(_0x27f758,_0x7d5dd0){return function(_0x53c5b4){if(!_0x53c5b4){_0x27f758[_0x791a('0x21')](0x194);}return _0x53c5b4;};}function handleError(_0x8e7002,_0x423a1e){_0x423a1e=_0x423a1e||0x1f4;return function(_0x2adf35){logger[_0x791a('0x1c')](_0x2adf35['stack']);if(_0x2adf35[_0x791a('0x2c')]){delete _0x2adf35[_0x791a('0x2c')];}_0x8e7002[_0x791a('0x22')](_0x423a1e)[_0x791a('0x2d')](_0x2adf35);};}exports[_0x791a('0x2e')]=function(_0x52104d,_0xd5609){var _0x5d7435={},_0x1cf048={},_0x4cd047={'count':0x0,'rows':[]};var _0x5edb88=db[_0x791a('0x2f')][_0x791a('0x30')];_0x1cf048[_0x791a('0x31')]=_[_0x791a('0x32')](_0x5edb88);_0x1cf048[_0x791a('0x33')]=_[_0x791a('0x32')](_0x52104d[_0x791a('0x33')]);_0x1cf048['filters']=_[_0x791a('0x34')](_0x1cf048['model'],_0x1cf048[_0x791a('0x33')]);_0x5d7435['attributes']=_[_0x791a('0x34')](_0x1cf048[_0x791a('0x31')],qs['fields'](_0x52104d[_0x791a('0x33')][_0x791a('0x35')]));_0x5d7435['attributes']=_0x5d7435[_0x791a('0x36')][_0x791a('0x37')]?_0x5d7435[_0x791a('0x36')]:_0x1cf048[_0x791a('0x31')];if(!_0x52104d[_0x791a('0x33')][_0x791a('0x38')](_0x791a('0x39'))){_0x5d7435[_0x791a('0x26')]=qs[_0x791a('0x26')](_0x52104d[_0x791a('0x33')]['limit']);_0x5d7435[_0x791a('0x25')]=qs[_0x791a('0x25')](_0x52104d[_0x791a('0x33')]['offset']);}_0x5d7435[_0x791a('0x3a')]=qs['sort'](_0x52104d['query']['sort']);_0x5d7435[_0x791a('0x3b')]=qs[_0x791a('0x3c')](_['pick'](_0x52104d[_0x791a('0x33')],_0x1cf048[_0x791a('0x3c')]));if(_0x52104d[_0x791a('0x33')][_0x791a('0x3d')]){_0x5d7435['where']=_['merge'](_0x5d7435['where'],{'$or':_[_0x791a('0x3e')](_0x5edb88,function(_0x216dd3){if(_0x216dd3['type'][_0x791a('0x3f')]!==_0x791a('0x40')){var _0x2493fa={};_0x2493fa[_0x216dd3[_0x791a('0x41')]]={'$like':'%'+_0x52104d['query'][_0x791a('0x3d')]+'%'};return _0x2493fa;}})});}_0x5d7435=_['merge']({},_0x5d7435,_0x52104d[_0x791a('0x42')]);var _0x31e5d3={'where':_0x5d7435[_0x791a('0x3b')]};return db[_0x791a('0x2f')][_0x791a('0x43')](_0x31e5d3)['then'](function(_0x21ef06){_0x4cd047[_0x791a('0x43')]=_0x21ef06;if(_0x52104d[_0x791a('0x33')][_0x791a('0x44')]){_0x5d7435[_0x791a('0x45')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x791a('0x46')](_0x5d7435);})[_0x791a('0x18')](function(_0x4e379e){_0x4cd047['rows']=_0x4e379e;return _0x4cd047;})[_0x791a('0x18')](respondWithFilteredResult(_0xd5609,_0x5d7435))[_0x791a('0x20')](handleError(_0xd5609,null));};exports[_0x791a('0x47')]=function(_0x5877f4,_0x5d1343){var _0x37ca2e={'raw':![],'where':{'id':_0x5877f4['params']['id']}},_0x378cc2={};_0x378cc2[_0x791a('0x31')]=_[_0x791a('0x32')](db[_0x791a('0x2f')]['rawAttributes']);_0x378cc2['query']=_[_0x791a('0x32')](_0x5877f4[_0x791a('0x33')]);_0x378cc2[_0x791a('0x3c')]=_[_0x791a('0x34')](_0x378cc2['model'],_0x378cc2[_0x791a('0x33')]);_0x37ca2e[_0x791a('0x36')]=_[_0x791a('0x34')](_0x378cc2[_0x791a('0x31')],qs['fields'](_0x5877f4[_0x791a('0x33')][_0x791a('0x35')]));_0x37ca2e[_0x791a('0x36')]=_0x37ca2e[_0x791a('0x36')][_0x791a('0x37')]?_0x37ca2e[_0x791a('0x36')]:_0x378cc2[_0x791a('0x31')];if(_0x5877f4['query'][_0x791a('0x44')]){_0x37ca2e[_0x791a('0x45')]=[{'all':!![]}];}_0x37ca2e=_['merge']({},_0x37ca2e,_0x5877f4[_0x791a('0x42')]);return db[_0x791a('0x2f')]['find'](_0x37ca2e)[_0x791a('0x18')](handleEntityNotFound(_0x5d1343,null))[_0x791a('0x18')](respondWithResult(_0x5d1343,null))[_0x791a('0x20')](handleError(_0x5d1343,null));};exports[_0x791a('0x48')]=function(_0xd5ec90,_0x4d82eb){return db['ServicenowConfiguration']['create'](_0xd5ec90[_0x791a('0x49')],{})['then'](respondWithResult(_0x4d82eb,0xc9))['catch'](handleError(_0x4d82eb,null));};exports[_0x791a('0x2b')]=function(_0x548a4b,_0x3e0b17){if(_0x548a4b[_0x791a('0x49')]['id']){delete _0x548a4b['body']['id'];}return db['ServicenowConfiguration'][_0x791a('0x4a')]({'where':{'id':_0x548a4b['params']['id']}})[_0x791a('0x18')](handleEntityNotFound(_0x3e0b17,null))[_0x791a('0x18')](saveUpdates(_0x548a4b[_0x791a('0x49')],null))['then'](respondWithResult(_0x3e0b17,null))[_0x791a('0x20')](handleError(_0x3e0b17,null));};exports[_0x791a('0x4b')]=function(_0x5159dd,_0x2a2b95){return db[_0x791a('0x2f')][_0x791a('0x4a')]({'where':{'id':_0x5159dd[_0x791a('0x4c')]['id']}})[_0x791a('0x18')](handleEntityNotFound(_0x2a2b95,null))[_0x791a('0x18')](removeEntity(_0x2a2b95,null))['catch'](handleError(_0x2a2b95,null));};exports['getFields']=function(_0x35ccdf,_0x52d52f,_0x45541b){var _0x424549={};var _0x18ad89={};var _0xf11dea;var _0x3b760c;return db[_0x791a('0x2f')][_0x791a('0x4d')]({'where':{'id':_0x35ccdf['params']['id']}})[_0x791a('0x18')](handleEntityNotFound(_0x52d52f,null))[_0x791a('0x18')](function(_0xc34c5b){if(_0xc34c5b){_0xf11dea=_0xc34c5b;_0x18ad89[_0x791a('0x31')]=_[_0x791a('0x32')](db[_0x791a('0x4e')][_0x791a('0x30')]);_0x18ad89['query']=_[_0x791a('0x32')](_0x35ccdf['query']);_0x18ad89['filters']=_[_0x791a('0x34')](_0x18ad89[_0x791a('0x31')],_0x18ad89[_0x791a('0x33')]);_0x424549[_0x791a('0x36')]=_[_0x791a('0x34')](_0x18ad89[_0x791a('0x31')],qs[_0x791a('0x35')](_0x35ccdf[_0x791a('0x33')][_0x791a('0x35')]));_0x424549[_0x791a('0x36')]=_0x424549[_0x791a('0x36')][_0x791a('0x37')]?_0x424549[_0x791a('0x36')]:_0x18ad89[_0x791a('0x31')];_0x424549[_0x791a('0x3a')]=qs[_0x791a('0x4f')](_0x35ccdf[_0x791a('0x33')][_0x791a('0x4f')]);_0x424549[_0x791a('0x3b')]=qs[_0x791a('0x3c')](_['pick'](_0x35ccdf[_0x791a('0x33')],_0x18ad89[_0x791a('0x3c')]));if(_0x35ccdf[_0x791a('0x33')][_0x791a('0x3d')]){_0x424549[_0x791a('0x3b')]=_['merge'](_0x424549[_0x791a('0x3b')],{'$or':_[_0x791a('0x3e')](_0x424549[_0x791a('0x36')],function(_0x120122){var _0x5468c4={};_0x5468c4[_0x120122]={'$like':'%'+_0x35ccdf[_0x791a('0x33')]['filter']+'%'};return _0x5468c4;})});}_0x424549=_['merge']({},_0x424549,_0x35ccdf['options']);return _0xf11dea['getFields'](_0x424549);}})[_0x791a('0x18')](function(_0x40207b){if(_0x40207b){_0x3b760c=_0x40207b[_0x791a('0x37')];if(!_0x35ccdf[_0x791a('0x33')][_0x791a('0x38')](_0x791a('0x39'))){_0x424549[_0x791a('0x26')]=qs['limit'](_0x35ccdf['query'][_0x791a('0x26')]);_0x424549[_0x791a('0x25')]=qs['offset'](_0x35ccdf['query'][_0x791a('0x25')]);}return _0xf11dea[_0x791a('0x50')](_0x424549);}})['then'](function(_0xde2e9a){if(_0xde2e9a){return _0xde2e9a?{'count':_0x3b760c,'rows':_0xde2e9a}:null;}})[_0x791a('0x18')](respondWithResult(_0x52d52f,null))[_0x791a('0x20')](handleError(_0x52d52f,null));};exports[_0x791a('0x51')]=function(_0x4845c2,_0x5e576d,_0x3d33e2){var _0xffe403={};var _0x566f0a={};var _0x1143f2;var _0x13da2e;return db[_0x791a('0x2f')][_0x791a('0x4d')]({'where':{'id':_0x4845c2['params']['id']}})[_0x791a('0x18')](handleEntityNotFound(_0x5e576d,null))[_0x791a('0x18')](function(_0x1f544c){if(_0x1f544c){_0x1143f2=_0x1f544c;_0x566f0a[_0x791a('0x31')]=_[_0x791a('0x32')](db[_0x791a('0x4e')][_0x791a('0x30')]);_0x566f0a[_0x791a('0x33')]=_['keys'](_0x4845c2['query']);_0x566f0a['filters']=_[_0x791a('0x34')](_0x566f0a[_0x791a('0x31')],_0x566f0a[_0x791a('0x33')]);_0xffe403[_0x791a('0x36')]=_[_0x791a('0x34')](_0x566f0a[_0x791a('0x31')],qs[_0x791a('0x35')](_0x4845c2[_0x791a('0x33')][_0x791a('0x35')]));_0xffe403[_0x791a('0x36')]=_0xffe403['attributes'][_0x791a('0x37')]?_0xffe403[_0x791a('0x36')]:_0x566f0a['model'];_0xffe403[_0x791a('0x3a')]=qs[_0x791a('0x4f')](_0x4845c2['query']['sort']);_0xffe403[_0x791a('0x3b')]=qs[_0x791a('0x3c')](_['pick'](_0x4845c2['query'],_0x566f0a[_0x791a('0x3c')]));if(_0x4845c2[_0x791a('0x33')][_0x791a('0x3d')]){_0xffe403['where']=_[_0x791a('0x52')](_0xffe403['where'],{'$or':_[_0x791a('0x3e')](_0xffe403[_0x791a('0x36')],function(_0x1d20a9){var _0x4072d0={};_0x4072d0[_0x1d20a9]={'$like':'%'+_0x4845c2[_0x791a('0x33')][_0x791a('0x3d')]+'%'};return _0x4072d0;})});}_0xffe403=_['merge']({},_0xffe403,_0x4845c2[_0x791a('0x42')]);return _0x1143f2[_0x791a('0x51')](_0xffe403);}})[_0x791a('0x18')](function(_0x291e8a){if(_0x291e8a){_0x13da2e=_0x291e8a[_0x791a('0x37')];if(!_0x4845c2[_0x791a('0x33')][_0x791a('0x38')](_0x791a('0x39'))){_0xffe403[_0x791a('0x26')]=qs[_0x791a('0x26')](_0x4845c2[_0x791a('0x33')][_0x791a('0x26')]);_0xffe403[_0x791a('0x25')]=qs[_0x791a('0x25')](_0x4845c2[_0x791a('0x33')][_0x791a('0x25')]);}return _0x1143f2[_0x791a('0x51')](_0xffe403);}})[_0x791a('0x18')](function(_0x5347e5){if(_0x5347e5){return _0x5347e5?{'count':_0x13da2e,'rows':_0x5347e5}:null;}})[_0x791a('0x18')](respondWithResult(_0x5e576d,null))[_0x791a('0x20')](handleError(_0x5e576d,null));};exports[_0x791a('0x53')]=function(_0x2cbe3a,_0x70fcdd,_0x5ab894){var _0x2c7197={};var _0x492a8f={};var _0x467d65;var _0x48b8dc;return db[_0x791a('0x2f')][_0x791a('0x4d')]({'where':{'id':_0x2cbe3a['params']['id']}})[_0x791a('0x18')](handleEntityNotFound(_0x70fcdd,null))[_0x791a('0x18')](function(_0x207ab0){if(_0x207ab0){_0x467d65=_0x207ab0;_0x492a8f['model']=_[_0x791a('0x32')](db['ServicenowField'][_0x791a('0x30')]);_0x492a8f['query']=_['keys'](_0x2cbe3a['query']);_0x492a8f[_0x791a('0x3c')]=_[_0x791a('0x34')](_0x492a8f[_0x791a('0x31')],_0x492a8f[_0x791a('0x33')]);_0x2c7197['attributes']=_[_0x791a('0x34')](_0x492a8f[_0x791a('0x31')],qs['fields'](_0x2cbe3a[_0x791a('0x33')][_0x791a('0x35')]));_0x2c7197[_0x791a('0x36')]=_0x2c7197['attributes']['length']?_0x2c7197[_0x791a('0x36')]:_0x492a8f[_0x791a('0x31')];_0x2c7197[_0x791a('0x3a')]=qs[_0x791a('0x4f')](_0x2cbe3a[_0x791a('0x33')][_0x791a('0x4f')]);_0x2c7197[_0x791a('0x3b')]=qs[_0x791a('0x3c')](_['pick'](_0x2cbe3a[_0x791a('0x33')],_0x492a8f[_0x791a('0x3c')]));if(_0x2cbe3a[_0x791a('0x33')][_0x791a('0x3d')]){_0x2c7197['where']=_['merge'](_0x2c7197[_0x791a('0x3b')],{'$or':_[_0x791a('0x3e')](_0x2c7197[_0x791a('0x36')],function(_0x100c74){var _0x50c01b={};_0x50c01b[_0x100c74]={'$like':'%'+_0x2cbe3a[_0x791a('0x33')][_0x791a('0x3d')]+'%'};return _0x50c01b;})});}_0x2c7197=_[_0x791a('0x52')]({},_0x2c7197,_0x2cbe3a[_0x791a('0x42')]);return _0x467d65[_0x791a('0x53')](_0x2c7197);}})[_0x791a('0x18')](function(_0x27074b){if(_0x27074b){_0x48b8dc=_0x27074b[_0x791a('0x37')];if(!_0x2cbe3a['query'][_0x791a('0x38')](_0x791a('0x39'))){_0x2c7197[_0x791a('0x26')]=qs[_0x791a('0x26')](_0x2cbe3a[_0x791a('0x33')][_0x791a('0x26')]);_0x2c7197[_0x791a('0x25')]=qs[_0x791a('0x25')](_0x2cbe3a[_0x791a('0x33')][_0x791a('0x25')]);}return _0x467d65['getDescriptions'](_0x2c7197);}})[_0x791a('0x18')](function(_0x2a738b){if(_0x2a738b){return _0x2a738b?{'count':_0x48b8dc,'rows':_0x2a738b}:null;}})['then'](respondWithResult(_0x70fcdd,null))[_0x791a('0x20')](handleError(_0x70fcdd,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 4e0a99b..924f82b 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 _0x54ba=['util','../../config/logger','api','moment','bluebird','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','lodash'];(function(_0x1bba0e,_0x394023){var _0x46ebef=function(_0x1073d1){while(--_0x1073d1){_0x1bba0e['push'](_0x1bba0e['shift']());}};_0x46ebef(++_0x394023);}(_0x54ba,0x170));var _0xa54b=function(_0x501b5a,_0x2d631c){_0x501b5a=_0x501b5a-0x0;var _0x1916d6=_0x54ba[_0x501b5a];return _0x1916d6;};'use strict';var _=require(_0xa54b('0x0'));var util=require(_0xa54b('0x1'));var logger=require(_0xa54b('0x2'))(_0xa54b('0x3'));var moment=require(_0xa54b('0x4'));var BPromise=require(_0xa54b('0x5'));var rp=require('request-promise');var attributes=require(_0xa54b('0x6'));module['exports']=function(_0x3e1157,_0x36795b){return _0x3e1157[_0xa54b('0x7')](_0xa54b('0x8'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cbe=['../../config/logger','api','moment','exports','define','ServicenowConfiguration','util'];(function(_0x5d1a2f,_0x5b127e){var _0x33cd01=function(_0x282b49){while(--_0x282b49){_0x5d1a2f['push'](_0x5d1a2f['shift']());}};_0x33cd01(++_0x5b127e);}(_0x2cbe,0x110));var _0xe2cb=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x2cbe[_0x5471ec];return _0x121d4c;};'use strict';var _=require('lodash');var util=require(_0xe2cb('0x0'));var logger=require(_0xe2cb('0x1'))(_0xe2cb('0x2'));var moment=require(_0xe2cb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./intServicenowConfiguration.attributes');module[_0xe2cb('0x4')]=function(_0x2826bf,_0x28e5be){return _0x2826bf[_0xe2cb('0x5')](_0xe2cb('0x6'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index ed8ed8c..1a5e8e4 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 _0xe48d=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowConfiguration,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x200bd5,_0x1f13e8){var _0x277bd4=function(_0x2ae4f9){while(--_0x2ae4f9){_0x200bd5['push'](_0x200bd5['shift']());}};_0x277bd4(++_0x1f13e8);}(_0xe48d,0x1e7));var _0xde48=function(_0x465c3b,_0x384cf1){_0x465c3b=_0x465c3b-0x0;var _0x67f5d8=_0xe48d[_0x465c3b];return _0x67f5d8;};'use strict';var _=require(_0xde48('0x0'));var util=require(_0xde48('0x1'));var moment=require(_0xde48('0x2'));var BPromise=require(_0xde48('0x3'));var rs=require(_0xde48('0x4'));var fs=require('fs');var Redis=require(_0xde48('0x5'));var db=require(_0xde48('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xde48('0x7'));var config=require(_0xde48('0x8'));var jayson=require(_0xde48('0x9'));var client=jayson[_0xde48('0xa')][_0xde48('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d04d1,_0x1da5e9,_0x579886){return new BPromise(function(_0x5aeba3,_0x476f64){return client[_0xde48('0xc')](_0x2d04d1,_0x579886)[_0xde48('0xd')](function(_0x4d7e47){logger[_0xde48('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1da5e9,_0xde48('0xf'));logger[_0xde48('0x10')](_0xde48('0x11'),_0x1da5e9,_0xde48('0xf'),JSON[_0xde48('0x12')](_0x4d7e47));if(_0x4d7e47['error']){if(_0x4d7e47[_0xde48('0x13')][_0xde48('0x14')]===0x1f4){logger[_0xde48('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1da5e9,_0x4d7e47[_0xde48('0x13')][_0xde48('0x15')]);return _0x476f64(_0x4d7e47[_0xde48('0x13')][_0xde48('0x15')]);}logger[_0xde48('0x13')](_0xde48('0x16'),_0x1da5e9,_0x4d7e47['error'][_0xde48('0x15')]);return _0x5aeba3(_0x4d7e47['error'][_0xde48('0x15')]);}else{logger[_0xde48('0xe')](_0xde48('0x16'),_0x1da5e9,_0xde48('0xf'));_0x5aeba3(_0x4d7e47[_0xde48('0x17')][_0xde48('0x15')]);}})['catch'](function(_0x180e42){logger[_0xde48('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1da5e9,_0x180e42);_0x476f64(_0x180e42);});});} \ No newline at end of file +var _0x02e4=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','ServicenowConfiguration,\x20%s,\x20%s','catch'];(function(_0x9d93b0,_0x48eeed){var _0x3fe2da=function(_0x4b8a12){while(--_0x4b8a12){_0x9d93b0['push'](_0x9d93b0['shift']());}};_0x3fe2da(++_0x48eeed);}(_0x02e4,0xb8));var _0x402e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x02e4[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x402e('0x0'));var util=require(_0x402e('0x1'));var moment=require('moment');var BPromise=require(_0x402e('0x2'));var rs=require(_0x402e('0x3'));var fs=require('fs');var Redis=require(_0x402e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x402e('0x5'));var logger=require(_0x402e('0x6'))(_0x402e('0x7'));var config=require(_0x402e('0x8'));var jayson=require(_0x402e('0x9'));var client=jayson[_0x402e('0xa')][_0x402e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4188ff,_0x2f8d7b,_0x4b6a60){return new BPromise(function(_0x45fb64,_0x111507){return client[_0x402e('0xc')](_0x4188ff,_0x4b6a60)[_0x402e('0xd')](function(_0x3cd389){logger[_0x402e('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2f8d7b,_0x402e('0xf'));logger[_0x402e('0x10')](_0x402e('0x11'),_0x2f8d7b,_0x402e('0xf'),JSON['stringify'](_0x3cd389));if(_0x3cd389['error']){if(_0x3cd389[_0x402e('0x12')][_0x402e('0x13')]===0x1f4){logger[_0x402e('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2f8d7b,_0x3cd389['error'][_0x402e('0x14')]);return _0x111507(_0x3cd389['error']['message']);}logger[_0x402e('0x12')](_0x402e('0x15'),_0x2f8d7b,_0x3cd389['error']['message']);return _0x45fb64(_0x3cd389[_0x402e('0x12')][_0x402e('0x14')]);}else{logger['info'](_0x402e('0x15'),_0x2f8d7b,'request\x20sent');_0x45fb64(_0x3cd389['result']['message']);}})[_0x402e('0x16')](function(_0x43cd10){logger[_0x402e('0x12')](_0x402e('0x15'),_0x2f8d7b,_0x43cd10);_0x111507(_0x43cd10);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 55de846..8a73acb 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 _0x8826=['post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','index','isAuthenticated','show'];(function(_0xc1a70c,_0x198e01){var _0x34c010=function(_0x37acc3){while(--_0x37acc3){_0xc1a70c['push'](_0xc1a70c['shift']());}};_0x34c010(++_0x198e01);}(_0x8826,0xeb));var _0x6882=function(_0x5e84d5,_0x5700c8){_0x5e84d5=_0x5e84d5-0x0;var _0x1f5988=_0x8826[_0x5e84d5];return _0x1f5988;};'use strict';var multer=require(_0x6882('0x0'));var util=require(_0x6882('0x1'));var path=require(_0x6882('0x2'));var timeout=require(_0x6882('0x3'));var express=require('express');var router=express[_0x6882('0x4')]();var auth=require(_0x6882('0x5'));var interaction=require(_0x6882('0x6'));var config=require('../../config/environment');var controller=require(_0x6882('0x7'));router[_0x6882('0x8')]('/',auth['isAuthenticated'](),controller[_0x6882('0x9')]);router[_0x6882('0x8')]('/:id',auth[_0x6882('0xa')](),controller[_0x6882('0xb')]);router[_0x6882('0xc')]('/',auth['isAuthenticated'](),controller[_0x6882('0xd')]);router[_0x6882('0xe')](_0x6882('0xf'),auth[_0x6882('0xa')](),controller[_0x6882('0x10')]);router['delete']('/:id',auth[_0x6882('0xa')](),controller[_0x6882('0x11')]);module[_0x6882('0x12')]=router; \ No newline at end of file +var _0xf109=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','get','show','post','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf109,0xb1));var _0x9f10=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xf109[_0x51c819];return _0x15c5d2;};'use strict';var multer=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var path=require(_0x9f10('0x2'));var timeout=require(_0x9f10('0x3'));var express=require(_0x9f10('0x4'));var router=express[_0x9f10('0x5')]();var auth=require(_0x9f10('0x6'));var interaction=require(_0x9f10('0x7'));var config=require(_0x9f10('0x8'));var controller=require(_0x9f10('0x9'));router['get']('/',auth[_0x9f10('0xa')](),controller['index']);router[_0x9f10('0xb')]('/:id',auth[_0x9f10('0xa')](),controller[_0x9f10('0xc')]);router[_0x9f10('0xd')]('/',auth['isAuthenticated'](),controller[_0x9f10('0xe')]);router[_0x9f10('0xf')](_0x9f10('0x10'),auth[_0x9f10('0xa')](),controller[_0x9f10('0x11')]);router[_0x9f10('0x12')](_0x9f10('0x10'),auth[_0x9f10('0xa')](),controller['destroy']);module[_0x9f10('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index bb55654..86d6122 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 _0x6324=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','STRING'];(function(_0x4116bc,_0x51bbf1){var _0xd51649=function(_0x3edd8a){while(--_0x3edd8a){_0x4116bc['push'](_0x4116bc['shift']());}};_0xd51649(++_0x51bbf1);}(_0x6324,0x142));var _0x4632=function(_0x5de8bf,_0x24e115){_0x5de8bf=_0x5de8bf-0x0;var _0x2be3e3=_0x6324[_0x5de8bf];return _0x2be3e3;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'type':{'type':Sequelize[_0x4632('0x2')](_0x4632('0x3'),'variable',_0x4632('0x4'),'keyValue'),'defaultValue':_0x4632('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4632('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x4632('0x3'),_0x4632('0x6'),_0x4632('0x4'))},'keyContent':{'type':Sequelize[_0x4632('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4632('0x5')]},'customField':{'type':Sequelize[_0x4632('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4632('0x5')]}}; \ No newline at end of file +var _0x9354=['variable','customVariable','keyValue','string','STRING','BOOLEAN','exports','ENUM'];(function(_0x50a926,_0x33e0c3){var _0x5d51e6=function(_0x1ed767){while(--_0x1ed767){_0x50a926['push'](_0x50a926['shift']());}};_0x5d51e6(++_0x33e0c3);}(_0x9354,0x96));var _0x4935=function(_0x467488,_0x38c7ae){_0x467488=_0x467488-0x0;var _0x56107f=_0x9354[_0x467488];return _0x56107f;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'type':{'type':Sequelize[_0x4935('0x1')]('string',_0x4935('0x2'),_0x4935('0x3'),_0x4935('0x4')),'defaultValue':_0x4935('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4935('0x6')]},'keyType':{'type':Sequelize[_0x4935('0x1')](_0x4935('0x5'),_0x4935('0x2'),_0x4935('0x3'))},'keyContent':{'type':Sequelize[_0x4935('0x6')]},'idField':{'type':Sequelize[_0x4935('0x6')]},'nameField':{'type':Sequelize[_0x4935('0x6')]},'customField':{'type':Sequelize[_0x4935('0x7')],'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 a16999d..9ba93fb 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 _0x2505=['key','VIRTUAL','field','merge','options','ServicenowField','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','squel','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','status','json','count','offset','limit','apply','save','update','then','destroy','error','name','send','index','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2505,0x197));var _0x5250=function(_0x2ff948,_0x3146d4){_0x2ff948=_0x2ff948-0x0;var _0x16a8cf=_0x2505[_0x2ff948];return _0x16a8cf;};'use strict';var pdf=require(_0x5250('0x0'));var emlformat=require(_0x5250('0x1'));var rimraf=require(_0x5250('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5250('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5250('0x4'));var util=require(_0x5250('0x5'));var path=require(_0x5250('0x6'));var sox=require(_0x5250('0x7'));var csv=require(_0x5250('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5250('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5250('0xa'));var toCsv=require(_0x5250('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x5250('0xb'));var hardwareService=require(_0x5250('0xc'));var Redis=require(_0x5250('0xd'));var qs=require(_0x5250('0xe'));var logger=require('../../config/logger')(_0x5250('0xf'));var utils=require(_0x5250('0x10'));var config=require(_0x5250('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54e922,_0x3c1a91){_0x3c1a91=_0x3c1a91||0xcc;return function(_0xbf14b3){if(_0xbf14b3){return _0x54e922['sendStatus'](_0x3c1a91);}return _0x54e922[_0x5250('0x12')](_0x3c1a91)['end']();};}function respondWithResult(_0x5b7ec9,_0x5d5c80){_0x5d5c80=_0x5d5c80||0xc8;return function(_0x4f85dc){if(_0x4f85dc){return _0x5b7ec9[_0x5250('0x12')](_0x5d5c80)[_0x5250('0x13')](_0x4f85dc);}};}function respondWithFilteredResult(_0x490129,_0x204dd9){return function(_0x714d86){if(_0x714d86){var _0x3e6dff=_0x714d86[_0x5250('0x14')],_0x3e017a=_0x204dd9[_0x5250('0x15')],_0x153539=_0x204dd9[_0x5250('0x15')]+_0x204dd9[_0x5250('0x16')],_0x54aff9;if(_0x153539>=_0x3e6dff){_0x153539=_0x3e6dff;_0x54aff9=0xc8;}else{_0x54aff9=0xce;}_0x490129['status'](_0x54aff9);return _0x490129['set']('Content-Range',_0x3e017a+'-'+_0x153539+'/'+_0x3e6dff)['json'](_0x714d86);}return null;};}function patchUpdates(_0xba5466){return function(_0x375a44){try{jsonpatch[_0x5250('0x17')](_0x375a44,_0xba5466,!![]);}catch(_0x1854ef){return BPromise['reject'](_0x1854ef);}return _0x375a44[_0x5250('0x18')]();};}function saveUpdates(_0x5a232c,_0x51bf09){return function(_0x5e3069){if(_0x5e3069){return _0x5e3069[_0x5250('0x19')](_0x5a232c)[_0x5250('0x1a')](function(_0x4af015){return _0x4af015;});}return null;};}function removeEntity(_0x302d57,_0x572756){return function(_0x116887){if(_0x116887){return _0x116887[_0x5250('0x1b')]()[_0x5250('0x1a')](function(){_0x302d57[_0x5250('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e9e3f,_0x157554){return function(_0x58ae59){if(!_0x58ae59){_0x2e9e3f['sendStatus'](0x194);}return _0x58ae59;};}function handleError(_0x4c172e,_0x5607c4){_0x5607c4=_0x5607c4||0x1f4;return function(_0x300bd5){logger[_0x5250('0x1c')](_0x300bd5['stack']);if(_0x300bd5['name']){delete _0x300bd5[_0x5250('0x1d')];}_0x4c172e[_0x5250('0x12')](_0x5607c4)[_0x5250('0x1e')](_0x300bd5);};}exports[_0x5250('0x1f')]=function(_0x2337e9,_0x4888ef){var _0x4c566d={},_0x1f3a5e={},_0x2a67e7={'count':0x0,'rows':[]};var _0xb6a1de=db['ServicenowField']['rawAttributes'];_0x1f3a5e[_0x5250('0x20')]=_['keys'](_0xb6a1de);_0x1f3a5e['query']=_[_0x5250('0x21')](_0x2337e9[_0x5250('0x22')]);_0x1f3a5e['filters']=_['intersection'](_0x1f3a5e[_0x5250('0x20')],_0x1f3a5e[_0x5250('0x22')]);_0x4c566d[_0x5250('0x23')]=_[_0x5250('0x24')](_0x1f3a5e[_0x5250('0x20')],qs[_0x5250('0x25')](_0x2337e9[_0x5250('0x22')]['fields']));_0x4c566d[_0x5250('0x23')]=_0x4c566d[_0x5250('0x23')][_0x5250('0x26')]?_0x4c566d[_0x5250('0x23')]:_0x1f3a5e[_0x5250('0x20')];if(!_0x2337e9[_0x5250('0x22')][_0x5250('0x27')](_0x5250('0x28'))){_0x4c566d[_0x5250('0x16')]=qs[_0x5250('0x16')](_0x2337e9[_0x5250('0x22')]['limit']);_0x4c566d['offset']=qs[_0x5250('0x15')](_0x2337e9[_0x5250('0x22')][_0x5250('0x15')]);}_0x4c566d[_0x5250('0x29')]=qs['sort'](_0x2337e9['query'][_0x5250('0x2a')]);_0x4c566d['where']=qs[_0x5250('0x2b')](_[_0x5250('0x2c')](_0x2337e9[_0x5250('0x22')],_0x1f3a5e[_0x5250('0x2b')]));if(_0x2337e9[_0x5250('0x22')][_0x5250('0x2d')]){_0x4c566d['where']=_['merge'](_0x4c566d[_0x5250('0x2e')],{'$or':_['map'](_0xb6a1de,function(_0x49418a){if(_0x49418a[_0x5250('0x2f')][_0x5250('0x30')]!==_0x5250('0x31')){var _0x3286a4={};_0x3286a4[_0x49418a[_0x5250('0x32')]]={'$like':'%'+_0x2337e9[_0x5250('0x22')][_0x5250('0x2d')]+'%'};return _0x3286a4;}})});}_0x4c566d=_[_0x5250('0x33')]({},_0x4c566d,_0x2337e9[_0x5250('0x34')]);var _0xf32995={'where':_0x4c566d[_0x5250('0x2e')]};return db[_0x5250('0x35')][_0x5250('0x14')](_0xf32995)[_0x5250('0x1a')](function(_0x101e25){_0x2a67e7['count']=_0x101e25;if(_0x2337e9[_0x5250('0x22')][_0x5250('0x36')]){_0x4c566d['include']=[{'all':!![]}];}return db[_0x5250('0x35')][_0x5250('0x37')](_0x4c566d);})[_0x5250('0x1a')](function(_0x4ef327){_0x2a67e7[_0x5250('0x38')]=_0x4ef327;return _0x2a67e7;})[_0x5250('0x1a')](respondWithFilteredResult(_0x4888ef,_0x4c566d))['catch'](handleError(_0x4888ef,null));};exports[_0x5250('0x39')]=function(_0x29fef6,_0x3e7fa7){var _0x11adb6={'raw':!![],'where':{'id':_0x29fef6[_0x5250('0x3a')]['id']}},_0x3da7a3={};_0x3da7a3[_0x5250('0x20')]=_['keys'](db[_0x5250('0x35')][_0x5250('0x3b')]);_0x3da7a3[_0x5250('0x22')]=_[_0x5250('0x21')](_0x29fef6[_0x5250('0x22')]);_0x3da7a3['filters']=_[_0x5250('0x24')](_0x3da7a3[_0x5250('0x20')],_0x3da7a3[_0x5250('0x22')]);_0x11adb6[_0x5250('0x23')]=_[_0x5250('0x24')](_0x3da7a3['model'],qs['fields'](_0x29fef6[_0x5250('0x22')][_0x5250('0x25')]));_0x11adb6[_0x5250('0x23')]=_0x11adb6[_0x5250('0x23')][_0x5250('0x26')]?_0x11adb6[_0x5250('0x23')]:_0x3da7a3[_0x5250('0x20')];if(_0x29fef6[_0x5250('0x22')]['includeAll']){_0x11adb6[_0x5250('0x3c')]=[{'all':!![]}];}_0x11adb6=_[_0x5250('0x33')]({},_0x11adb6,_0x29fef6[_0x5250('0x34')]);return db[_0x5250('0x35')][_0x5250('0x3d')](_0x11adb6)[_0x5250('0x1a')](handleEntityNotFound(_0x3e7fa7,null))['then'](respondWithResult(_0x3e7fa7,null))[_0x5250('0x3e')](handleError(_0x3e7fa7,null));};exports[_0x5250('0x3f')]=function(_0x9e86f1,_0x2b2218){return db[_0x5250('0x35')][_0x5250('0x3f')](_0x9e86f1['body'],{})[_0x5250('0x1a')](respondWithResult(_0x2b2218,0xc9))[_0x5250('0x3e')](handleError(_0x2b2218,null));};exports[_0x5250('0x19')]=function(_0x3b56ea,_0x3c006e){if(_0x3b56ea[_0x5250('0x40')]['id']){delete _0x3b56ea[_0x5250('0x40')]['id'];}return db[_0x5250('0x35')][_0x5250('0x3d')]({'where':{'id':_0x3b56ea[_0x5250('0x3a')]['id']}})[_0x5250('0x1a')](handleEntityNotFound(_0x3c006e,null))[_0x5250('0x1a')](saveUpdates(_0x3b56ea[_0x5250('0x40')],null))[_0x5250('0x1a')](respondWithResult(_0x3c006e,null))[_0x5250('0x3e')](handleError(_0x3c006e,null));};exports[_0x5250('0x1b')]=function(_0x1fc29f,_0x1794ea){return db[_0x5250('0x35')]['find']({'where':{'id':_0x1fc29f[_0x5250('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1794ea,null))[_0x5250('0x1a')](removeEntity(_0x1794ea,null))[_0x5250('0x3e')](handleError(_0x1794ea,null));}; \ No newline at end of file +var _0xa36a=['ejs','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','ServicenowField','include','findAll','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x32d7f6,_0x4b39bf){var _0x3f440a=function(_0xd370d7){while(--_0xd370d7){_0x32d7f6['push'](_0x32d7f6['shift']());}};_0x3f440a(++_0x4b39bf);}(_0xa36a,0x1cc));var _0xaa36=function(_0x25d793,_0x31023e){_0x25d793=_0x25d793-0x0;var _0x19f4e9=_0xa36a[_0x25d793];return _0x19f4e9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaa36('0x0'));var rimraf=require(_0xaa36('0x1'));var zipdir=require(_0xaa36('0x2'));var jsonpatch=require(_0xaa36('0x3'));var rp=require(_0xaa36('0x4'));var moment=require(_0xaa36('0x5'));var BPromise=require(_0xaa36('0x6'));var Mustache=require(_0xaa36('0x7'));var util=require('util');var path=require(_0xaa36('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaa36('0x9'));var fs=require('fs');var _=require(_0xaa36('0xa'));var squel=require('squel');var crypto=require(_0xaa36('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xaa36('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaa36('0xd'));var authService=require(_0xaa36('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xaa36('0xf'));var logger=require('../../config/logger')(_0xaa36('0x10'));var utils=require(_0xaa36('0x11'));var config=require(_0xaa36('0x12'));var db=require(_0xaa36('0x13'))['db'];function respondWithStatusCode(_0x54c8b0,_0x380c63){_0x380c63=_0x380c63||0xcc;return function(_0x21d6a4){if(_0x21d6a4){return _0x54c8b0['sendStatus'](_0x380c63);}return _0x54c8b0['status'](_0x380c63)[_0xaa36('0x14')]();};}function respondWithResult(_0x11e622,_0x564d70){_0x564d70=_0x564d70||0xc8;return function(_0x2bbc45){if(_0x2bbc45){return _0x11e622[_0xaa36('0x15')](_0x564d70)[_0xaa36('0x16')](_0x2bbc45);}};}function respondWithFilteredResult(_0x1638fa,_0x4e0eac){return function(_0x3c4201){if(_0x3c4201){var _0x105d82=_0x3c4201[_0xaa36('0x17')],_0x15036a=_0x4e0eac[_0xaa36('0x18')],_0x87f5a9=_0x4e0eac[_0xaa36('0x18')]+_0x4e0eac[_0xaa36('0x19')],_0x4c11d8;if(_0x87f5a9>=_0x105d82){_0x87f5a9=_0x105d82;_0x4c11d8=0xc8;}else{_0x4c11d8=0xce;}_0x1638fa[_0xaa36('0x15')](_0x4c11d8);return _0x1638fa[_0xaa36('0x1a')](_0xaa36('0x1b'),_0x15036a+'-'+_0x87f5a9+'/'+_0x105d82)[_0xaa36('0x16')](_0x3c4201);}return null;};}function patchUpdates(_0x21be5f){return function(_0x510f00){try{jsonpatch[_0xaa36('0x1c')](_0x510f00,_0x21be5f,!![]);}catch(_0x457bd9){return BPromise['reject'](_0x457bd9);}return _0x510f00[_0xaa36('0x1d')]();};}function saveUpdates(_0x4e3e24,_0x56afac){return function(_0x48e723){if(_0x48e723){return _0x48e723['update'](_0x4e3e24)[_0xaa36('0x1e')](function(_0x4d9199){return _0x4d9199;});}return null;};}function removeEntity(_0x40ad04,_0x4a0e48){return function(_0x148136){if(_0x148136){return _0x148136[_0xaa36('0x1f')]()[_0xaa36('0x1e')](function(){_0x40ad04[_0xaa36('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d769b,_0x404ba2){return function(_0x4e2c93){if(!_0x4e2c93){_0x3d769b['sendStatus'](0x194);}return _0x4e2c93;};}function handleError(_0x5bb0dd,_0x11ae7f){_0x11ae7f=_0x11ae7f||0x1f4;return function(_0x3284ee){logger[_0xaa36('0x20')](_0x3284ee[_0xaa36('0x21')]);if(_0x3284ee[_0xaa36('0x22')]){delete _0x3284ee[_0xaa36('0x22')];}_0x5bb0dd['status'](_0x11ae7f)[_0xaa36('0x23')](_0x3284ee);};}exports[_0xaa36('0x24')]=function(_0x4bdc22,_0x521dd2){var _0x4edae2={},_0x156d9c={},_0x3e3ec3={'count':0x0,'rows':[]};var _0x5637af=db['ServicenowField'][_0xaa36('0x25')];_0x156d9c[_0xaa36('0x26')]=_[_0xaa36('0x27')](_0x5637af);_0x156d9c[_0xaa36('0x28')]=_[_0xaa36('0x27')](_0x4bdc22[_0xaa36('0x28')]);_0x156d9c['filters']=_[_0xaa36('0x29')](_0x156d9c[_0xaa36('0x26')],_0x156d9c['query']);_0x4edae2['attributes']=_[_0xaa36('0x29')](_0x156d9c[_0xaa36('0x26')],qs[_0xaa36('0x2a')](_0x4bdc22[_0xaa36('0x28')][_0xaa36('0x2a')]));_0x4edae2[_0xaa36('0x2b')]=_0x4edae2[_0xaa36('0x2b')][_0xaa36('0x2c')]?_0x4edae2[_0xaa36('0x2b')]:_0x156d9c[_0xaa36('0x26')];if(!_0x4bdc22[_0xaa36('0x28')]['hasOwnProperty'](_0xaa36('0x2d'))){_0x4edae2[_0xaa36('0x19')]=qs[_0xaa36('0x19')](_0x4bdc22[_0xaa36('0x28')][_0xaa36('0x19')]);_0x4edae2['offset']=qs['offset'](_0x4bdc22[_0xaa36('0x28')]['offset']);}_0x4edae2['order']=qs[_0xaa36('0x2e')](_0x4bdc22[_0xaa36('0x28')][_0xaa36('0x2e')]);_0x4edae2[_0xaa36('0x2f')]=qs[_0xaa36('0x30')](_[_0xaa36('0x31')](_0x4bdc22['query'],_0x156d9c[_0xaa36('0x30')]));if(_0x4bdc22[_0xaa36('0x28')][_0xaa36('0x32')]){_0x4edae2[_0xaa36('0x2f')]=_[_0xaa36('0x33')](_0x4edae2[_0xaa36('0x2f')],{'$or':_[_0xaa36('0x34')](_0x5637af,function(_0x9a106c){if(_0x9a106c['type'][_0xaa36('0x35')]!==_0xaa36('0x36')){var _0x53e8d4={};_0x53e8d4[_0x9a106c[_0xaa36('0x37')]]={'$like':'%'+_0x4bdc22['query'][_0xaa36('0x32')]+'%'};return _0x53e8d4;}})});}_0x4edae2=_[_0xaa36('0x33')]({},_0x4edae2,_0x4bdc22[_0xaa36('0x38')]);var _0xa7f023={'where':_0x4edae2[_0xaa36('0x2f')]};return db[_0xaa36('0x39')]['count'](_0xa7f023)[_0xaa36('0x1e')](function(_0x274795){_0x3e3ec3[_0xaa36('0x17')]=_0x274795;if(_0x4bdc22[_0xaa36('0x28')]['includeAll']){_0x4edae2[_0xaa36('0x3a')]=[{'all':!![]}];}return db[_0xaa36('0x39')][_0xaa36('0x3b')](_0x4edae2);})[_0xaa36('0x1e')](function(_0x49b6aa){_0x3e3ec3['rows']=_0x49b6aa;return _0x3e3ec3;})[_0xaa36('0x1e')](respondWithFilteredResult(_0x521dd2,_0x4edae2))[_0xaa36('0x3c')](handleError(_0x521dd2,null));};exports[_0xaa36('0x3d')]=function(_0x426f79,_0x29898b){var _0x1fb127={'raw':!![],'where':{'id':_0x426f79[_0xaa36('0x3e')]['id']}},_0xdb5a13={};_0xdb5a13['model']=_['keys'](db[_0xaa36('0x39')][_0xaa36('0x25')]);_0xdb5a13[_0xaa36('0x28')]=_['keys'](_0x426f79['query']);_0xdb5a13[_0xaa36('0x30')]=_[_0xaa36('0x29')](_0xdb5a13[_0xaa36('0x26')],_0xdb5a13[_0xaa36('0x28')]);_0x1fb127[_0xaa36('0x2b')]=_[_0xaa36('0x29')](_0xdb5a13[_0xaa36('0x26')],qs[_0xaa36('0x2a')](_0x426f79[_0xaa36('0x28')][_0xaa36('0x2a')]));_0x1fb127[_0xaa36('0x2b')]=_0x1fb127[_0xaa36('0x2b')][_0xaa36('0x2c')]?_0x1fb127['attributes']:_0xdb5a13[_0xaa36('0x26')];if(_0x426f79[_0xaa36('0x28')]['includeAll']){_0x1fb127[_0xaa36('0x3a')]=[{'all':!![]}];}_0x1fb127=_['merge']({},_0x1fb127,_0x426f79['options']);return db[_0xaa36('0x39')][_0xaa36('0x3f')](_0x1fb127)[_0xaa36('0x1e')](handleEntityNotFound(_0x29898b,null))['then'](respondWithResult(_0x29898b,null))['catch'](handleError(_0x29898b,null));};exports[_0xaa36('0x40')]=function(_0x24ecca,_0x3a5711){return db[_0xaa36('0x39')][_0xaa36('0x40')](_0x24ecca[_0xaa36('0x41')],{})[_0xaa36('0x1e')](respondWithResult(_0x3a5711,0xc9))[_0xaa36('0x3c')](handleError(_0x3a5711,null));};exports[_0xaa36('0x42')]=function(_0x270342,_0x180bec){if(_0x270342[_0xaa36('0x41')]['id']){delete _0x270342[_0xaa36('0x41')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x270342[_0xaa36('0x3e')]['id']}})[_0xaa36('0x1e')](handleEntityNotFound(_0x180bec,null))[_0xaa36('0x1e')](saveUpdates(_0x270342['body'],null))['then'](respondWithResult(_0x180bec,null))[_0xaa36('0x3c')](handleError(_0x180bec,null));};exports[_0xaa36('0x1f')]=function(_0x2b60ad,_0x27300b){return db[_0xaa36('0x39')][_0xaa36('0x3f')]({'where':{'id':_0x2b60ad['params']['id']}})[_0xaa36('0x1e')](handleEntityNotFound(_0x27300b,null))[_0xaa36('0x1e')](removeEntity(_0x27300b,null))[_0xaa36('0x3c')](handleError(_0x27300b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 25432d9..3655534 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 _0xbf4a=['define','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','util','../../config/logger','api','bluebird','request-promise','./intServicenowField.attributes','exports'];(function(_0x5747e2,_0x799324){var _0x2395b6=function(_0x173081){while(--_0x173081){_0x5747e2['push'](_0x5747e2['shift']());}};_0x2395b6(++_0x799324);}(_0xbf4a,0x101));var _0xabf4=function(_0x41db22,_0x203bea){_0x41db22=_0x41db22-0x0;var _0x2553b1=_0xbf4a[_0x41db22];return _0x2553b1;};'use strict';var _=require('lodash');var util=require(_0xabf4('0x0'));var logger=require(_0xabf4('0x1'))(_0xabf4('0x2'));var moment=require('moment');var BPromise=require(_0xabf4('0x3'));var rp=require(_0xabf4('0x4'));var attributes=require(_0xabf4('0x5'));module[_0xabf4('0x6')]=function(_0x2fe3ba,_0x2b8a71){return _0x2fe3ba[_0xabf4('0x7')](_0xabf4('0x8'),attributes,{'tableName':_0xabf4('0x9'),'paranoid':![],'indexes':[{'name':_0xabf4('0xa'),'fields':['idField',_0xabf4('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x62ff=['util','../../config/logger','api','moment','bluebird','request-promise','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x4d521e,_0x58ba39){var _0x3beb42=function(_0x1a7bd2){while(--_0x1a7bd2){_0x4d521e['push'](_0x4d521e['shift']());}};_0x3beb42(++_0x58ba39);}(_0x62ff,0xb3));var _0xf62f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x62ff[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf62f('0x0'));var util=require(_0xf62f('0x1'));var logger=require(_0xf62f('0x2'))(_0xf62f('0x3'));var moment=require(_0xf62f('0x4'));var BPromise=require(_0xf62f('0x5'));var rp=require(_0xf62f('0x6'));var attributes=require(_0xf62f('0x7'));module[_0xf62f('0x8')]=function(_0x4c3a71,_0x48ed50){return _0x4c3a71[_0xf62f('0x9')](_0xf62f('0xa'),attributes,{'tableName':_0xf62f('0xb'),'paranoid':![],'indexes':[{'name':_0xf62f('0xc'),'fields':[_0xf62f('0xd'),_0xf62f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 2b20bd6..8f6becc 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 _0x77d4=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x77d4,0x108));var _0x477d=function(_0x1f3977,_0x4dd46a){_0x1f3977=_0x1f3977-0x0;var _0x5f22ab=_0x77d4[_0x1f3977];return _0x5f22ab;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var moment=require('moment');var BPromise=require(_0x477d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x477d('0x4'));var config=require(_0x477d('0x5'));var jayson=require(_0x477d('0x6'));var client=jayson[_0x477d('0x7')][_0x477d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45ca2d,_0x5153df,_0x4f4fb4){return new BPromise(function(_0x2dd5d2,_0x579859){return client['request'](_0x45ca2d,_0x4f4fb4)[_0x477d('0x9')](function(_0x29f11b){logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));logger['debug'](_0x477d('0xd'),_0x5153df,'request\x20sent',JSON[_0x477d('0xe')](_0x29f11b));if(_0x29f11b[_0x477d('0xf')]){if(_0x29f11b['error'][_0x477d('0x10')]===0x1f4){logger[_0x477d('0xf')]('ServicenowField,\x20%s,\x20%s',_0x5153df,_0x29f11b['error'][_0x477d('0x11')]);return _0x579859(_0x29f11b[_0x477d('0xf')]['message']);}logger[_0x477d('0xf')](_0x477d('0xb'),_0x5153df,_0x29f11b['error']['message']);return _0x2dd5d2(_0x29f11b[_0x477d('0xf')]['message']);}else{logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));_0x2dd5d2(_0x29f11b['result'][_0x477d('0x11')]);}})[_0x477d('0x12')](function(_0x29c6f8){logger[_0x477d('0xf')]('ServicenowField,\x20%s,\x20%s',_0x5153df,_0x29c6f8);_0x579859(_0x29c6f8);});});} \ No newline at end of file +var _0x6d38=['request','then','ServicenowField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4c251f,_0x2d7fa4){var _0x56d948=function(_0x33e297){while(--_0x33e297){_0x4c251f['push'](_0x4c251f['shift']());}};_0x56d948(++_0x2d7fa4);}(_0x6d38,0x1ef));var _0x86d3=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x6d38[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('ServicenowField,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 020d23b..ab840e2 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 _0xb4f5=['/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index'];(function(_0x53eba7,_0x38744c){var _0x32491b=function(_0x61ea1d){while(--_0x61ea1d){_0x53eba7['push'](_0x53eba7['shift']());}};_0x32491b(++_0x38744c);}(_0xb4f5,0x68));var _0x5b4f=function(_0x489c95,_0x53159c){_0x489c95=_0x489c95-0x0;var _0x10e7a7=_0xb4f5[_0x489c95];return _0x10e7a7;};'use strict';var multer=require(_0x5b4f('0x0'));var util=require(_0x5b4f('0x1'));var path=require(_0x5b4f('0x2'));var timeout=require(_0x5b4f('0x3'));var express=require(_0x5b4f('0x4'));var router=express[_0x5b4f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5b4f('0x6'));var config=require(_0x5b4f('0x7'));var controller=require(_0x5b4f('0x8'));router[_0x5b4f('0x9')]('/',auth['isAuthenticated'](),controller[_0x5b4f('0xa')]);router[_0x5b4f('0x9')](_0x5b4f('0xb'),auth['isAuthenticated'](),controller[_0x5b4f('0xc')]);router[_0x5b4f('0x9')](_0x5b4f('0xd'),auth[_0x5b4f('0xe')](),controller[_0x5b4f('0xf')]);router[_0x5b4f('0x9')](_0x5b4f('0x10'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x5b4f('0xe')](),controller[_0x5b4f('0x11')]);router['post'](_0x5b4f('0xd'),auth[_0x5b4f('0xe')](),controller[_0x5b4f('0x12')]);router['put'](_0x5b4f('0xb'),auth['isAuthenticated'](),controller[_0x5b4f('0x13')]);router[_0x5b4f('0x14')](_0x5b4f('0xb'),auth[_0x5b4f('0xe')](),controller[_0x5b4f('0x15')]);module[_0x5b4f('0x16')]=router; \ No newline at end of file +var _0x3391=['exports','multer','path','express','Router','../../components/auth/service','./intSugarcrmAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete'];(function(_0x3e85a4,_0x18c3a9){var _0x21e7d1=function(_0x48457d){while(--_0x48457d){_0x3e85a4['push'](_0x3e85a4['shift']());}};_0x21e7d1(++_0x18c3a9);}(_0x3391,0x1ef));var _0x1339=function(_0x322884,_0x32c5f1){_0x322884=_0x322884-0x0;var _0x29dd47=_0x3391[_0x322884];return _0x29dd47;};'use strict';var multer=require(_0x1339('0x0'));var util=require('util');var path=require(_0x1339('0x1'));var timeout=require('connect-timeout');var express=require(_0x1339('0x2'));var router=express[_0x1339('0x3')]();var auth=require(_0x1339('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1339('0x5'));router['get']('/',auth[_0x1339('0x6')](),controller['index']);router[_0x1339('0x7')](_0x1339('0x8'),auth[_0x1339('0x6')](),controller[_0x1339('0x9')]);router[_0x1339('0x7')](_0x1339('0xa'),auth[_0x1339('0x6')](),controller[_0x1339('0xb')]);router[_0x1339('0x7')](_0x1339('0xc'),auth[_0x1339('0x6')](),controller['getFields']);router[_0x1339('0xd')]('/',auth[_0x1339('0x6')](),controller[_0x1339('0xe')]);router[_0x1339('0xd')](_0x1339('0xa'),auth[_0x1339('0x6')](),controller[_0x1339('0xf')]);router['put'](_0x1339('0x8'),auth[_0x1339('0x6')](),controller[_0x1339('0x10')]);router[_0x1339('0x11')](_0x1339('0x8'),auth[_0x1339('0x6')](),controller['destroy']);module[_0x1339('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 557a1b3..8e021c4 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 _0xf20b=['exports','STRING','remoteUri','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf20b,0x1ef));var _0xbf20=function(_0x554c1a,_0x1863d9){_0x554c1a=_0x554c1a-0x0;var _0x1a83c4=_0xf20b[_0x554c1a];return _0x1a83c4;};'use strict';var Sequelize=require(_0xbf20('0x0'));module[_0xbf20('0x1')]={'name':{'type':Sequelize[_0xbf20('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xbf20('0x2')]},'remoteUri':{'type':Sequelize[_0xbf20('0x2')],'unique':_0xbf20('0x3')},'serverUrl':{'type':Sequelize[_0xbf20('0x2')]}}; \ No newline at end of file +var _0xc283=['remoteUri','exports','STRING','username'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc283,0x1d9));var _0x3c28=function(_0x15f582,_0x2e85fc){_0x15f582=_0x15f582-0x0;var _0x4e6f16=_0xc283[_0x15f582];return _0x4e6f16;};'use strict';var Sequelize=require('sequelize');module[_0x3c28('0x0')]={'name':{'type':Sequelize[_0x3c28('0x1')]},'description':{'type':Sequelize[_0x3c28('0x1')]},'username':{'type':Sequelize[_0x3c28('0x1')],'unique':_0x3c28('0x2')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3c28('0x1')],'unique':_0x3c28('0x3')},'serverUrl':{'type':Sequelize[_0x3c28('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 462a240..51103a9 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 _0x00be=['substring','lastIndexOf','format','%s%s','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','/service/v4_1/rest.php','Calls','values','module_fields','remove','includes','label','endsWith','test','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','stack','name','index','SugarcrmAccount','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','merge','map','key','VIRTUAL','field','filter','options','include','rows','params','rawAttributes','create','body','find','getConfigurations','findOne','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','channel','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','description','parent_type','parent_name','direction','username','password','remoteUri','slice'];(function(_0xfe5d95,_0x382903){var _0x1613ee=function(_0x17d8a5){while(--_0x17d8a5){_0xfe5d95['push'](_0xfe5d95['shift']());}};_0x1613ee(++_0x382903);}(_0x00be,0x90));var _0xe00b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x00be[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0xe00b('0x0'));var emlformat=require(_0xe00b('0x1'));var rimraf=require(_0xe00b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe00b('0x3'));var rp=require('request-promise');var moment=require(_0xe00b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe00b('0x5'));var util=require(_0xe00b('0x6'));var path=require(_0xe00b('0x7'));var sox=require(_0xe00b('0x8'));var csv=require(_0xe00b('0x9'));var ejs=require(_0xe00b('0xa'));var fs=require('fs');var _=require(_0xe00b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe00b('0xc'));var deskjs=require(_0xe00b('0xd'));var toCsv=require(_0xe00b('0x9'));var querystring=require(_0xe00b('0xe'));var Papa=require(_0xe00b('0xf'));var authService=require(_0xe00b('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xe00b('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xe00b('0x12'))(_0xe00b('0x13'));var utils=require(_0xe00b('0x14'));var config=require(_0xe00b('0x15'));var db=require(_0xe00b('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xe00b('0x17'));var client=jayson['client'][_0xe00b('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x4ee202,_0x236a59,_0x3c4696,_0x68b315){return new BPromise(function(_0x4309a8,_0x5af4e5){var _0xaf6d5f=_0x68b315||client;return _0xaf6d5f[_0xe00b('0x19')](_0x4ee202,_0x3c4696)[_0xe00b('0x1a')](function(_0x13e30f){logger[_0xe00b('0x1b')](_0xe00b('0x1c'),_0x236a59,'request\x20sent');logger[_0xe00b('0x1d')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x236a59,'request\x20sent',JSON[_0xe00b('0x1e')](_0x13e30f));if(_0x13e30f['error']){if(_0x13e30f[_0xe00b('0x1f')]['code']===0x1f4){logger[_0xe00b('0x1f')](_0xe00b('0x1c'),_0x236a59,_0x13e30f[_0xe00b('0x1f')][_0xe00b('0x20')]);return _0x5af4e5(_0x13e30f[_0xe00b('0x1f')]['message']);}logger[_0xe00b('0x1f')]('SugarcrmAccount,\x20%s,\x20%s',_0x236a59,_0x13e30f[_0xe00b('0x1f')][_0xe00b('0x20')]);return _0x4309a8(_0x13e30f[_0xe00b('0x1f')][_0xe00b('0x20')]);}else{logger[_0xe00b('0x1b')](_0xe00b('0x1c'),_0x236a59,_0xe00b('0x21'));_0x4309a8(_0x13e30f['result'][_0xe00b('0x20')]);}})[_0xe00b('0x22')](function(_0x5bcb42){logger[_0xe00b('0x1f')](_0xe00b('0x1c'),_0x236a59,_0x5bcb42);_0x5af4e5(_0x5bcb42);});});}function respondWithStatusCode(_0x397ea7,_0x2fbf1c){_0x2fbf1c=_0x2fbf1c||0xcc;return function(_0x5a643d){if(_0x5a643d){return _0x397ea7[_0xe00b('0x23')](_0x2fbf1c);}return _0x397ea7[_0xe00b('0x24')](_0x2fbf1c)[_0xe00b('0x25')]();};}function respondWithResult(_0x3e7f5c,_0x48fa53){_0x48fa53=_0x48fa53||0xc8;return function(_0x14275d){if(_0x14275d){return _0x3e7f5c['status'](_0x48fa53)[_0xe00b('0x26')](_0x14275d);}};}function respondWithFilteredResult(_0x318303,_0x58f238){return function(_0x987ea2){if(_0x987ea2){var _0x5a124d=_0x987ea2[_0xe00b('0x27')],_0x48f7be=_0x58f238[_0xe00b('0x28')],_0x37123e=_0x58f238[_0xe00b('0x28')]+_0x58f238['limit'],_0x5b42a9;if(_0x37123e>=_0x5a124d){_0x37123e=_0x5a124d;_0x5b42a9=0xc8;}else{_0x5b42a9=0xce;}_0x318303[_0xe00b('0x24')](_0x5b42a9);return _0x318303[_0xe00b('0x29')](_0xe00b('0x2a'),_0x48f7be+'-'+_0x37123e+'/'+_0x5a124d)[_0xe00b('0x26')](_0x987ea2);}return null;};}function patchUpdates(_0x34b406){return function(_0x43dd8a){try{jsonpatch[_0xe00b('0x2b')](_0x43dd8a,_0x34b406,!![]);}catch(_0x147d3e){return BPromise[_0xe00b('0x2c')](_0x147d3e);}return _0x43dd8a['save']();};}function saveUpdates(_0x270a30,_0x220066){return function(_0x4a4231){if(_0x4a4231){return _0x4a4231[_0xe00b('0x2d')](_0x270a30)['then'](function(_0x16ea15){return _0x16ea15;});}return null;};}function removeEntity(_0x5d6238,_0x5cbc3d){return function(_0x3098c3){if(_0x3098c3){return _0x3098c3[_0xe00b('0x2e')]()[_0xe00b('0x1a')](function(){_0x5d6238[_0xe00b('0x24')](0xcc)[_0xe00b('0x25')]();});}};}function handleEntityNotFound(_0x57b5ee,_0x2e7ac5){return function(_0x1a9504){if(!_0x1a9504){_0x57b5ee[_0xe00b('0x23')](0x194);}return _0x1a9504;};}function handleError(_0x4d091b,_0x57a310){_0x57a310=_0x57a310||0x1f4;return function(_0x1dddfe){logger[_0xe00b('0x1f')](_0x1dddfe[_0xe00b('0x2f')]);if(_0x1dddfe[_0xe00b('0x30')]){delete _0x1dddfe[_0xe00b('0x30')];}_0x4d091b[_0xe00b('0x24')](_0x57a310)['send'](_0x1dddfe);};}exports[_0xe00b('0x31')]=function(_0x3c41c8,_0x579c50){var _0x5cacf5={},_0xb5ed67={},_0x384e59={'count':0x0,'rows':[]};var _0x582349=db[_0xe00b('0x32')]['rawAttributes'];_0xb5ed67[_0xe00b('0x33')]=_[_0xe00b('0x34')](_0x582349);_0xb5ed67[_0xe00b('0x35')]=_[_0xe00b('0x34')](_0x3c41c8[_0xe00b('0x35')]);_0xb5ed67[_0xe00b('0x36')]=_[_0xe00b('0x37')](_0xb5ed67[_0xe00b('0x33')],_0xb5ed67[_0xe00b('0x35')]);_0x5cacf5['attributes']=_[_0xe00b('0x37')](_0xb5ed67['model'],qs[_0xe00b('0x38')](_0x3c41c8[_0xe00b('0x35')][_0xe00b('0x38')]));_0x5cacf5[_0xe00b('0x39')]=_0x5cacf5[_0xe00b('0x39')][_0xe00b('0x3a')]?_0x5cacf5['attributes']:_0xb5ed67[_0xe00b('0x33')];if(!_0x3c41c8[_0xe00b('0x35')]['hasOwnProperty'](_0xe00b('0x3b'))){_0x5cacf5[_0xe00b('0x3c')]=qs[_0xe00b('0x3c')](_0x3c41c8[_0xe00b('0x35')][_0xe00b('0x3c')]);_0x5cacf5[_0xe00b('0x28')]=qs[_0xe00b('0x28')](_0x3c41c8['query'][_0xe00b('0x28')]);}_0x5cacf5[_0xe00b('0x3d')]=qs[_0xe00b('0x3e')](_0x3c41c8[_0xe00b('0x35')][_0xe00b('0x3e')]);_0x5cacf5[_0xe00b('0x3f')]=qs['filters'](_['pick'](_0x3c41c8[_0xe00b('0x35')],_0xb5ed67[_0xe00b('0x36')]));if(_0x3c41c8[_0xe00b('0x35')]['filter']){_0x5cacf5[_0xe00b('0x3f')]=_[_0xe00b('0x40')](_0x5cacf5[_0xe00b('0x3f')],{'$or':_[_0xe00b('0x41')](_0x582349,function(_0x4db89a){if(_0x4db89a['type'][_0xe00b('0x42')]!==_0xe00b('0x43')){var _0x2b75e9={};_0x2b75e9[_0x4db89a[_0xe00b('0x44')]]={'$like':'%'+_0x3c41c8['query'][_0xe00b('0x45')]+'%'};return _0x2b75e9;}})});}_0x5cacf5=_[_0xe00b('0x40')]({},_0x5cacf5,_0x3c41c8[_0xe00b('0x46')]);var _0x4f4948={'where':_0x5cacf5[_0xe00b('0x3f')]};return db[_0xe00b('0x32')][_0xe00b('0x27')](_0x4f4948)[_0xe00b('0x1a')](function(_0x13b66a){_0x384e59[_0xe00b('0x27')]=_0x13b66a;if(_0x3c41c8[_0xe00b('0x35')]['includeAll']){_0x5cacf5[_0xe00b('0x47')]=[{'all':!![]}];}return db[_0xe00b('0x32')]['findAll'](_0x5cacf5);})[_0xe00b('0x1a')](function(_0x3c2b71){_0x384e59[_0xe00b('0x48')]=_0x3c2b71;return _0x384e59;})[_0xe00b('0x1a')](respondWithFilteredResult(_0x579c50,_0x5cacf5))[_0xe00b('0x22')](handleError(_0x579c50,null));};exports['show']=function(_0x5450c2,_0x65e0f){var _0x2df642={'raw':![],'where':{'id':_0x5450c2[_0xe00b('0x49')]['id']}},_0x560015={};_0x560015[_0xe00b('0x33')]=_['keys'](db[_0xe00b('0x32')][_0xe00b('0x4a')]);_0x560015[_0xe00b('0x35')]=_['keys'](_0x5450c2[_0xe00b('0x35')]);_0x560015[_0xe00b('0x36')]=_['intersection'](_0x560015[_0xe00b('0x33')],_0x560015['query']);_0x2df642[_0xe00b('0x39')]=_[_0xe00b('0x37')](_0x560015[_0xe00b('0x33')],qs['fields'](_0x5450c2['query'][_0xe00b('0x38')]));_0x2df642[_0xe00b('0x39')]=_0x2df642[_0xe00b('0x39')][_0xe00b('0x3a')]?_0x2df642[_0xe00b('0x39')]:_0x560015[_0xe00b('0x33')];if(_0x5450c2['query']['includeAll']){_0x2df642[_0xe00b('0x47')]=[{'all':!![]}];}_0x2df642=_[_0xe00b('0x40')]({},_0x2df642,_0x5450c2[_0xe00b('0x46')]);return db[_0xe00b('0x32')]['find'](_0x2df642)[_0xe00b('0x1a')](handleEntityNotFound(_0x65e0f,null))[_0xe00b('0x1a')](respondWithResult(_0x65e0f,null))[_0xe00b('0x22')](handleError(_0x65e0f,null));};exports['create']=function(_0x52823c,_0xee6083){return db[_0xe00b('0x32')][_0xe00b('0x4b')](_0x52823c[_0xe00b('0x4c')],{})[_0xe00b('0x1a')](respondWithResult(_0xee6083,0xc9))['catch'](handleError(_0xee6083,null));};exports[_0xe00b('0x2d')]=function(_0x6b1902,_0xa5a87){if(_0x6b1902[_0xe00b('0x4c')]['id']){delete _0x6b1902[_0xe00b('0x4c')]['id'];}return db[_0xe00b('0x32')]['find']({'where':{'id':_0x6b1902[_0xe00b('0x49')]['id']}})[_0xe00b('0x1a')](handleEntityNotFound(_0xa5a87,null))[_0xe00b('0x1a')](saveUpdates(_0x6b1902[_0xe00b('0x4c')],null))[_0xe00b('0x1a')](respondWithResult(_0xa5a87,null))[_0xe00b('0x22')](handleError(_0xa5a87,null));};exports[_0xe00b('0x2e')]=function(_0xc91687,_0x23fed2){return db['SugarcrmAccount'][_0xe00b('0x4d')]({'where':{'id':_0xc91687['params']['id']}})[_0xe00b('0x1a')](handleEntityNotFound(_0x23fed2,null))[_0xe00b('0x1a')](removeEntity(_0x23fed2,null))[_0xe00b('0x22')](handleError(_0x23fed2,null));};exports[_0xe00b('0x4e')]=function(_0x424fd9,_0x1bdbcf,_0x103e8a){var _0x4817c4={};var _0x45f26c={};var _0x247201;var _0x3db20b;return db[_0xe00b('0x32')][_0xe00b('0x4f')]({'where':{'id':_0x424fd9[_0xe00b('0x49')]['id']}})[_0xe00b('0x1a')](handleEntityNotFound(_0x1bdbcf,null))[_0xe00b('0x1a')](function(_0x26e486){if(_0x26e486){_0x247201=_0x26e486;_0x45f26c[_0xe00b('0x33')]=_[_0xe00b('0x34')](db['SugarcrmConfiguration']['rawAttributes']);_0x45f26c[_0xe00b('0x35')]=_['keys'](_0x424fd9[_0xe00b('0x35')]);_0x45f26c[_0xe00b('0x36')]=_[_0xe00b('0x37')](_0x45f26c['model'],_0x45f26c['query']);_0x4817c4[_0xe00b('0x39')]=_[_0xe00b('0x37')](_0x45f26c[_0xe00b('0x33')],qs[_0xe00b('0x38')](_0x424fd9[_0xe00b('0x35')][_0xe00b('0x38')]));_0x4817c4[_0xe00b('0x39')]=_0x4817c4[_0xe00b('0x39')]['length']?_0x4817c4[_0xe00b('0x39')]:_0x45f26c[_0xe00b('0x33')];_0x4817c4['order']=qs['sort'](_0x424fd9[_0xe00b('0x35')][_0xe00b('0x3e')]);_0x4817c4[_0xe00b('0x3f')]=qs['filters'](_[_0xe00b('0x50')](_0x424fd9[_0xe00b('0x35')],_0x45f26c['filters']));if(_0x424fd9[_0xe00b('0x35')]['filter']){_0x4817c4[_0xe00b('0x3f')]=_['merge'](_0x4817c4['where'],{'$or':_[_0xe00b('0x41')](_0x4817c4[_0xe00b('0x39')],function(_0x53a433){var _0x47d8c7={};_0x47d8c7[_0x53a433]={'$like':'%'+_0x424fd9['query'][_0xe00b('0x45')]+'%'};return _0x47d8c7;})});}_0x4817c4=_[_0xe00b('0x40')]({},_0x4817c4,_0x424fd9[_0xe00b('0x46')]);return _0x247201['getConfigurations'](_0x4817c4);}})[_0xe00b('0x1a')](function(_0xd682a1){if(_0xd682a1){_0x3db20b=_0xd682a1[_0xe00b('0x3a')];if(!_0x424fd9[_0xe00b('0x35')][_0xe00b('0x51')](_0xe00b('0x3b'))){_0x4817c4['limit']=qs[_0xe00b('0x3c')](_0x424fd9[_0xe00b('0x35')]['limit']);_0x4817c4[_0xe00b('0x28')]=qs[_0xe00b('0x28')](_0x424fd9[_0xe00b('0x35')][_0xe00b('0x28')]);}return _0x247201['getConfigurations'](_0x4817c4);}})[_0xe00b('0x1a')](function(_0x57dd00){if(_0x57dd00){return _0x57dd00?{'count':_0x3db20b,'rows':_0x57dd00}:null;}})['then'](respondWithResult(_0x1bdbcf,null))[_0xe00b('0x22')](handleError(_0x1bdbcf,null));};exports[_0xe00b('0x52')]=function(_0x44ac3f,_0x49d89b,_0x544d8a){if(_0x44ac3f[_0xe00b('0x4c')]['id']){delete _0x44ac3f['body']['id'];}return db[_0xe00b('0x32')][_0xe00b('0x4f')]({'where':{'id':_0x44ac3f[_0xe00b('0x49')]['id']}})[_0xe00b('0x1a')](handleEntityNotFound(_0x49d89b,null))[_0xe00b('0x1a')](function(_0x3fe214){if(_0x3fe214){_0x44ac3f[_0xe00b('0x4c')][_0xe00b('0x53')]=_0x3fe214['id'];_0x44ac3f[_0xe00b('0x4c')][_0xe00b('0x54')]=integrations[_0xe00b('0x55')](_0x44ac3f[_0xe00b('0x4c')]['channel'],_0x44ac3f['body'][_0xe00b('0x56')]);_0x44ac3f[_0xe00b('0x4c')][_0xe00b('0x57')]=integrations['getDescriptions'](_0x44ac3f['body'][_0xe00b('0x58')],_0x44ac3f[_0xe00b('0x4c')][_0xe00b('0x56')]);return db[_0xe00b('0x59')]['create'](_0x44ac3f['body'],{'include':[{'model':db[_0xe00b('0x5a')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0xe00b('0x1a')](respondWithResult(_0x49d89b,null))['catch'](handleError(_0x49d89b,null));};exports[_0xe00b('0x5b')]=function(_0xe93265,_0x237681,_0x440219){var _0x3bd989='';var _0x40393f=['id',_0xe00b('0x30'),_0xe00b('0x5c'),_0xe00b('0x5d'),_0xe00b('0x5e'),'date_start','duration_hours','duration_minutes','parent_id',_0xe00b('0x5f'),_0xe00b('0x60'),_0xe00b('0x61')];return db[_0xe00b('0x32')][_0xe00b('0x4f')]({'where':{'id':_0xe93265[_0xe00b('0x49')]['id']},'attributes':['id',_0xe00b('0x62'),_0xe00b('0x63'),_0xe00b('0x64')]})[_0xe00b('0x1a')](handleEntityNotFound(_0x237681,null))[_0xe00b('0x1a')](function(_0x5ad395){if(_0x5ad395){_0x3bd989=_0x5ad395[_0xe00b('0x64')];var _0x2f91d5=_0x3bd989[_0xe00b('0x65')](-0x1);if(_0x2f91d5==='/'){_0x3bd989=_0x3bd989[_0xe00b('0x66')](0x0,_0x3bd989[_0xe00b('0x67')](_0x2f91d5));}return rp({'method':'POST','uri':util[_0xe00b('0x68')](_0xe00b('0x69'),_0x3bd989,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe00b('0x6a'),'input_type':_0xe00b('0x6b'),'response_type':_0xe00b('0x6b'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5ad395['username'],'password':_0x5ad395[_0xe00b('0x63')],'encryption':_0xe00b('0x6c')},'application':_0xe00b('0x6d')})}});}})[_0xe00b('0x1a')](function(_0x546e7b){if(_0x546e7b&&_0x546e7b[_0xe00b('0x30')]!=='Invalid\x20Login'&&_0x546e7b[_0xe00b('0x30')]!==_0xe00b('0x6e')){return rp({'method':'POST','uri':util[_0xe00b('0x68')]('%s%s',_0x3bd989,_0xe00b('0x6f')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xe00b('0x6b'),'response_type':'JSON','rest_data':JSON[_0xe00b('0x1e')]({'session':_0x546e7b['id'],'module_name':_0xe00b('0x70')})}})[_0xe00b('0x1a')](function(_0x5e7d66){if(_0x5e7d66){var _0x5dd1ea=_[_0xe00b('0x71')](_0x5e7d66[_0xe00b('0x72')]);_[_0xe00b('0x73')](_0x5dd1ea,function(_0x24976c){return _0x40393f[_0xe00b('0x74')](_0x24976c['name']);});return{'count':_0x5dd1ea[_0xe00b('0x3a')],'rows':_['map'](_0x5dd1ea,function(_0x389293){return{'id':_0x389293[_0xe00b('0x30')],'name':_0x389293[_0xe00b('0x75')],'custom':_[_0xe00b('0x76')](_0x389293[_0xe00b('0x30')],'_c')?!![]:![],'options':_0x389293[_0xe00b('0x46')]?_[_0xe00b('0x41')](_['values'](_0x389293[_0xe00b('0x46')]),function(_0x3b0d7c){return{'name':_0x3b0d7c['value'],'value':_0x3b0d7c[_0xe00b('0x30')]};}):[]};})};}})[_0xe00b('0x1a')](respondWithResult(_0x237681,null))[_0xe00b('0x22')](function(_0x5f0028){var _0x4c23cd=_0xe93265[_0xe00b('0x35')][_0xe00b('0x77')]?0x1f4:_0x5f0028['statusCode']||0x1f4;logger[_0xe00b('0x1f')](_0xe00b('0x78'),_0xe00b('0x5b'),_0x4c23cd,JSON[_0xe00b('0x1e')](_0x5f0028));delete _0x5f0028[_0xe00b('0x30')];if(_0x4c23cd===0x191){_0x4c23cd=0x190;}_0x237681[_0xe00b('0x24')](_0x4c23cd)[_0xe00b('0x79')](_0xe93265[_0xe00b('0x35')]['test']?{'message':_0xe00b('0x7a'),'statusCode':_0x5f0028['statusCode']}:_0x5f0028);});}else{var _0x4fb207=0x1f4;_0x237681[_0xe00b('0x24')](_0x4fb207)[_0xe00b('0x79')]({'message':_0xe00b('0x7a'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xb3d6=['json','offset','limit','set','Content-Range','apply','reject','save','end','stack','name','send','index','SugarcrmAccount','rawAttributes','model','query','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','map','type','key','VIRTUAL','field','filter','options','count','include','findAll','rows','show','params','fields','find','create','update','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','keys','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','values','module_fields','remove','label','test','statusCode','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0xb3d6,0x158));var _0x6b3d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb3d6[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require(_0x6b3d('0x0'));var emlformat=require(_0x6b3d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6b3d('0x2'));var jsonpatch=require(_0x6b3d('0x3'));var rp=require(_0x6b3d('0x4'));var moment=require(_0x6b3d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6b3d('0x6'));var util=require(_0x6b3d('0x7'));var path=require(_0x6b3d('0x8'));var sox=require(_0x6b3d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6b3d('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6b3d('0xb'));var toCsv=require(_0x6b3d('0xc'));var querystring=require('querystring');var Papa=require(_0x6b3d('0xd'));var authService=require(_0x6b3d('0xe'));var hardwareService=require(_0x6b3d('0xf'));var Redis=require('ioredis');var qs=require(_0x6b3d('0x10'));var logger=require(_0x6b3d('0x11'))('api');var utils=require(_0x6b3d('0x12'));var config=require(_0x6b3d('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6b3d('0x14'));var jayson=require(_0x6b3d('0x15'));var client=jayson[_0x6b3d('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x243a20,_0x23a169,_0x3daf0c,_0x1a1832){return new BPromise(function(_0x5f0ecb,_0x135288){var _0x5ea3ef=_0x1a1832||client;return _0x5ea3ef[_0x6b3d('0x17')](_0x243a20,_0x3daf0c)[_0x6b3d('0x18')](function(_0x10552e){logger[_0x6b3d('0x19')](_0x6b3d('0x1a'),_0x23a169,_0x6b3d('0x1b'));logger[_0x6b3d('0x1c')](_0x6b3d('0x1d'),_0x23a169,_0x6b3d('0x1b'),JSON[_0x6b3d('0x1e')](_0x10552e));if(_0x10552e[_0x6b3d('0x1f')]){if(_0x10552e[_0x6b3d('0x1f')][_0x6b3d('0x20')]===0x1f4){logger[_0x6b3d('0x1f')](_0x6b3d('0x1a'),_0x23a169,_0x10552e[_0x6b3d('0x1f')][_0x6b3d('0x21')]);return _0x135288(_0x10552e[_0x6b3d('0x1f')][_0x6b3d('0x21')]);}logger[_0x6b3d('0x1f')](_0x6b3d('0x1a'),_0x23a169,_0x10552e[_0x6b3d('0x1f')][_0x6b3d('0x21')]);return _0x5f0ecb(_0x10552e['error'][_0x6b3d('0x21')]);}else{logger[_0x6b3d('0x19')]('SugarcrmAccount,\x20%s,\x20%s',_0x23a169,_0x6b3d('0x1b'));_0x5f0ecb(_0x10552e[_0x6b3d('0x22')][_0x6b3d('0x21')]);}})[_0x6b3d('0x23')](function(_0x343981){logger[_0x6b3d('0x1f')]('SugarcrmAccount,\x20%s,\x20%s',_0x23a169,_0x343981);_0x135288(_0x343981);});});}function respondWithStatusCode(_0x2f2c43,_0x34ffff){_0x34ffff=_0x34ffff||0xcc;return function(_0x2908cb){if(_0x2908cb){return _0x2f2c43['sendStatus'](_0x34ffff);}return _0x2f2c43[_0x6b3d('0x24')](_0x34ffff)['end']();};}function respondWithResult(_0x5e9937,_0x41a8c2){_0x41a8c2=_0x41a8c2||0xc8;return function(_0x4ab3d5){if(_0x4ab3d5){return _0x5e9937['status'](_0x41a8c2)[_0x6b3d('0x25')](_0x4ab3d5);}};}function respondWithFilteredResult(_0x2c1feb,_0x2cc578){return function(_0x20be14){if(_0x20be14){var _0x36cec3=_0x20be14['count'],_0x443e76=_0x2cc578[_0x6b3d('0x26')],_0x1a1921=_0x2cc578[_0x6b3d('0x26')]+_0x2cc578[_0x6b3d('0x27')],_0x455ab4;if(_0x1a1921>=_0x36cec3){_0x1a1921=_0x36cec3;_0x455ab4=0xc8;}else{_0x455ab4=0xce;}_0x2c1feb['status'](_0x455ab4);return _0x2c1feb[_0x6b3d('0x28')](_0x6b3d('0x29'),_0x443e76+'-'+_0x1a1921+'/'+_0x36cec3)[_0x6b3d('0x25')](_0x20be14);}return null;};}function patchUpdates(_0x324da9){return function(_0x1cc927){try{jsonpatch[_0x6b3d('0x2a')](_0x1cc927,_0x324da9,!![]);}catch(_0x4d9a06){return BPromise[_0x6b3d('0x2b')](_0x4d9a06);}return _0x1cc927[_0x6b3d('0x2c')]();};}function saveUpdates(_0x262433,_0x27ac7d){return function(_0x4aa0e1){if(_0x4aa0e1){return _0x4aa0e1['update'](_0x262433)[_0x6b3d('0x18')](function(_0x5ce866){return _0x5ce866;});}return null;};}function removeEntity(_0x5c3f66,_0x335966){return function(_0x1b883f){if(_0x1b883f){return _0x1b883f['destroy']()[_0x6b3d('0x18')](function(){_0x5c3f66[_0x6b3d('0x24')](0xcc)[_0x6b3d('0x2d')]();});}};}function handleEntityNotFound(_0x36c406,_0x4aac2f){return function(_0x2395d7){if(!_0x2395d7){_0x36c406['sendStatus'](0x194);}return _0x2395d7;};}function handleError(_0x70c025,_0x42802a){_0x42802a=_0x42802a||0x1f4;return function(_0x57f576){logger[_0x6b3d('0x1f')](_0x57f576[_0x6b3d('0x2e')]);if(_0x57f576[_0x6b3d('0x2f')]){delete _0x57f576[_0x6b3d('0x2f')];}_0x70c025['status'](_0x42802a)[_0x6b3d('0x30')](_0x57f576);};}exports[_0x6b3d('0x31')]=function(_0x5f11fa,_0x34b470){var _0x4993d1={},_0x5883fa={},_0x3ec2b1={'count':0x0,'rows':[]};var _0x4e89dd=db[_0x6b3d('0x32')][_0x6b3d('0x33')];_0x5883fa[_0x6b3d('0x34')]=_['keys'](_0x4e89dd);_0x5883fa[_0x6b3d('0x35')]=_['keys'](_0x5f11fa[_0x6b3d('0x35')]);_0x5883fa['filters']=_[_0x6b3d('0x36')](_0x5883fa[_0x6b3d('0x34')],_0x5883fa['query']);_0x4993d1[_0x6b3d('0x37')]=_[_0x6b3d('0x36')](_0x5883fa[_0x6b3d('0x34')],qs['fields'](_0x5f11fa[_0x6b3d('0x35')]['fields']));_0x4993d1[_0x6b3d('0x37')]=_0x4993d1[_0x6b3d('0x37')][_0x6b3d('0x38')]?_0x4993d1[_0x6b3d('0x37')]:_0x5883fa['model'];if(!_0x5f11fa['query'][_0x6b3d('0x39')](_0x6b3d('0x3a'))){_0x4993d1[_0x6b3d('0x27')]=qs['limit'](_0x5f11fa[_0x6b3d('0x35')][_0x6b3d('0x27')]);_0x4993d1[_0x6b3d('0x26')]=qs[_0x6b3d('0x26')](_0x5f11fa[_0x6b3d('0x35')][_0x6b3d('0x26')]);}_0x4993d1['order']=qs[_0x6b3d('0x3b')](_0x5f11fa[_0x6b3d('0x35')][_0x6b3d('0x3b')]);_0x4993d1[_0x6b3d('0x3c')]=qs['filters'](_['pick'](_0x5f11fa[_0x6b3d('0x35')],_0x5883fa[_0x6b3d('0x3d')]));if(_0x5f11fa[_0x6b3d('0x35')]['filter']){_0x4993d1[_0x6b3d('0x3c')]=_[_0x6b3d('0x3e')](_0x4993d1[_0x6b3d('0x3c')],{'$or':_[_0x6b3d('0x3f')](_0x4e89dd,function(_0x5b469f){if(_0x5b469f[_0x6b3d('0x40')][_0x6b3d('0x41')]!==_0x6b3d('0x42')){var _0x541eb2={};_0x541eb2[_0x5b469f[_0x6b3d('0x43')]]={'$like':'%'+_0x5f11fa[_0x6b3d('0x35')][_0x6b3d('0x44')]+'%'};return _0x541eb2;}})});}_0x4993d1=_[_0x6b3d('0x3e')]({},_0x4993d1,_0x5f11fa[_0x6b3d('0x45')]);var _0x309c5b={'where':_0x4993d1[_0x6b3d('0x3c')]};return db[_0x6b3d('0x32')][_0x6b3d('0x46')](_0x309c5b)[_0x6b3d('0x18')](function(_0xc7b0d0){_0x3ec2b1[_0x6b3d('0x46')]=_0xc7b0d0;if(_0x5f11fa[_0x6b3d('0x35')]['includeAll']){_0x4993d1[_0x6b3d('0x47')]=[{'all':!![]}];}return db[_0x6b3d('0x32')][_0x6b3d('0x48')](_0x4993d1);})['then'](function(_0x15ee73){_0x3ec2b1[_0x6b3d('0x49')]=_0x15ee73;return _0x3ec2b1;})[_0x6b3d('0x18')](respondWithFilteredResult(_0x34b470,_0x4993d1))['catch'](handleError(_0x34b470,null));};exports[_0x6b3d('0x4a')]=function(_0x18f193,_0x457a01){var _0x34ed82={'raw':![],'where':{'id':_0x18f193[_0x6b3d('0x4b')]['id']}},_0x59e202={};_0x59e202[_0x6b3d('0x34')]=_['keys'](db['SugarcrmAccount'][_0x6b3d('0x33')]);_0x59e202['query']=_['keys'](_0x18f193[_0x6b3d('0x35')]);_0x59e202[_0x6b3d('0x3d')]=_[_0x6b3d('0x36')](_0x59e202[_0x6b3d('0x34')],_0x59e202[_0x6b3d('0x35')]);_0x34ed82['attributes']=_['intersection'](_0x59e202['model'],qs['fields'](_0x18f193[_0x6b3d('0x35')][_0x6b3d('0x4c')]));_0x34ed82[_0x6b3d('0x37')]=_0x34ed82[_0x6b3d('0x37')][_0x6b3d('0x38')]?_0x34ed82[_0x6b3d('0x37')]:_0x59e202[_0x6b3d('0x34')];if(_0x18f193[_0x6b3d('0x35')]['includeAll']){_0x34ed82[_0x6b3d('0x47')]=[{'all':!![]}];}_0x34ed82=_[_0x6b3d('0x3e')]({},_0x34ed82,_0x18f193[_0x6b3d('0x45')]);return db[_0x6b3d('0x32')][_0x6b3d('0x4d')](_0x34ed82)[_0x6b3d('0x18')](handleEntityNotFound(_0x457a01,null))[_0x6b3d('0x18')](respondWithResult(_0x457a01,null))[_0x6b3d('0x23')](handleError(_0x457a01,null));};exports[_0x6b3d('0x4e')]=function(_0x1914fc,_0x134bdc){return db[_0x6b3d('0x32')][_0x6b3d('0x4e')](_0x1914fc['body'],{})[_0x6b3d('0x18')](respondWithResult(_0x134bdc,0xc9))[_0x6b3d('0x23')](handleError(_0x134bdc,null));};exports[_0x6b3d('0x4f')]=function(_0x46a3ca,_0x4d89ca){if(_0x46a3ca[_0x6b3d('0x50')]['id']){delete _0x46a3ca['body']['id'];}return db[_0x6b3d('0x32')]['find']({'where':{'id':_0x46a3ca[_0x6b3d('0x4b')]['id']}})[_0x6b3d('0x18')](handleEntityNotFound(_0x4d89ca,null))[_0x6b3d('0x18')](saveUpdates(_0x46a3ca[_0x6b3d('0x50')],null))['then'](respondWithResult(_0x4d89ca,null))[_0x6b3d('0x23')](handleError(_0x4d89ca,null));};exports[_0x6b3d('0x51')]=function(_0x2b1cd3,_0x3338ba){return db[_0x6b3d('0x32')][_0x6b3d('0x4d')]({'where':{'id':_0x2b1cd3['params']['id']}})['then'](handleEntityNotFound(_0x3338ba,null))[_0x6b3d('0x18')](removeEntity(_0x3338ba,null))[_0x6b3d('0x23')](handleError(_0x3338ba,null));};exports[_0x6b3d('0x52')]=function(_0x362d78,_0x4f29f7,_0x154846){var _0x20c492={};var _0x31f6f3={};var _0x51b974;var _0x53c243;return db['SugarcrmAccount'][_0x6b3d('0x53')]({'where':{'id':_0x362d78[_0x6b3d('0x4b')]['id']}})[_0x6b3d('0x18')](handleEntityNotFound(_0x4f29f7,null))[_0x6b3d('0x18')](function(_0x434d3e){if(_0x434d3e){_0x51b974=_0x434d3e;_0x31f6f3[_0x6b3d('0x34')]=_['keys'](db[_0x6b3d('0x54')][_0x6b3d('0x33')]);_0x31f6f3[_0x6b3d('0x35')]=_[_0x6b3d('0x55')](_0x362d78['query']);_0x31f6f3['filters']=_[_0x6b3d('0x36')](_0x31f6f3[_0x6b3d('0x34')],_0x31f6f3['query']);_0x20c492[_0x6b3d('0x37')]=_['intersection'](_0x31f6f3[_0x6b3d('0x34')],qs[_0x6b3d('0x4c')](_0x362d78[_0x6b3d('0x35')][_0x6b3d('0x4c')]));_0x20c492['attributes']=_0x20c492[_0x6b3d('0x37')][_0x6b3d('0x38')]?_0x20c492[_0x6b3d('0x37')]:_0x31f6f3[_0x6b3d('0x34')];_0x20c492['order']=qs['sort'](_0x362d78[_0x6b3d('0x35')][_0x6b3d('0x3b')]);_0x20c492[_0x6b3d('0x3c')]=qs[_0x6b3d('0x3d')](_[_0x6b3d('0x56')](_0x362d78['query'],_0x31f6f3[_0x6b3d('0x3d')]));if(_0x362d78[_0x6b3d('0x35')][_0x6b3d('0x44')]){_0x20c492[_0x6b3d('0x3c')]=_['merge'](_0x20c492[_0x6b3d('0x3c')],{'$or':_[_0x6b3d('0x3f')](_0x20c492[_0x6b3d('0x37')],function(_0x421d28){var _0x3de57b={};_0x3de57b[_0x421d28]={'$like':'%'+_0x362d78['query'][_0x6b3d('0x44')]+'%'};return _0x3de57b;})});}_0x20c492=_[_0x6b3d('0x3e')]({},_0x20c492,_0x362d78[_0x6b3d('0x45')]);return _0x51b974[_0x6b3d('0x52')](_0x20c492);}})[_0x6b3d('0x18')](function(_0x25fd7e){if(_0x25fd7e){_0x53c243=_0x25fd7e['length'];if(!_0x362d78[_0x6b3d('0x35')][_0x6b3d('0x39')](_0x6b3d('0x3a'))){_0x20c492['limit']=qs[_0x6b3d('0x27')](_0x362d78[_0x6b3d('0x35')][_0x6b3d('0x27')]);_0x20c492['offset']=qs[_0x6b3d('0x26')](_0x362d78[_0x6b3d('0x35')][_0x6b3d('0x26')]);}return _0x51b974['getConfigurations'](_0x20c492);}})[_0x6b3d('0x18')](function(_0x5c6ae3){if(_0x5c6ae3){return _0x5c6ae3?{'count':_0x53c243,'rows':_0x5c6ae3}:null;}})[_0x6b3d('0x18')](respondWithResult(_0x4f29f7,null))['catch'](handleError(_0x4f29f7,null));};exports[_0x6b3d('0x57')]=function(_0x3f90a8,_0x2e4079,_0x42bf54){if(_0x3f90a8['body']['id']){delete _0x3f90a8[_0x6b3d('0x50')]['id'];}return db[_0x6b3d('0x32')][_0x6b3d('0x53')]({'where':{'id':_0x3f90a8['params']['id']}})['then'](handleEntityNotFound(_0x2e4079,null))[_0x6b3d('0x18')](function(_0x2f5548){if(_0x2f5548){_0x3f90a8[_0x6b3d('0x50')][_0x6b3d('0x58')]=_0x2f5548['id'];_0x3f90a8[_0x6b3d('0x50')][_0x6b3d('0x59')]=integrations[_0x6b3d('0x5a')](_0x3f90a8['body']['channel'],_0x3f90a8['body'][_0x6b3d('0x40')]);_0x3f90a8['body'][_0x6b3d('0x5b')]=integrations['getDescriptions'](_0x3f90a8[_0x6b3d('0x50')][_0x6b3d('0x5c')],_0x3f90a8[_0x6b3d('0x50')]['type']);return db[_0x6b3d('0x54')]['create'](_0x3f90a8['body'],{'include':[{'model':db[_0x6b3d('0x5d')],'as':_0x6b3d('0x59')},{'model':db[_0x6b3d('0x5d')],'as':'Descriptions'}]});}return null;})[_0x6b3d('0x18')](respondWithResult(_0x2e4079,null))['catch'](handleError(_0x2e4079,null));};exports[_0x6b3d('0x5e')]=function(_0x147f34,_0x10e860,_0x4a7d97){var _0x585845='';var _0x48f057=['id',_0x6b3d('0x2f'),_0x6b3d('0x5f'),_0x6b3d('0x60'),_0x6b3d('0x61'),_0x6b3d('0x62'),'duration_hours',_0x6b3d('0x63'),'parent_id',_0x6b3d('0x64'),_0x6b3d('0x65'),_0x6b3d('0x66')];return db['SugarcrmAccount'][_0x6b3d('0x53')]({'where':{'id':_0x147f34[_0x6b3d('0x4b')]['id']},'attributes':['id',_0x6b3d('0x67'),_0x6b3d('0x68'),_0x6b3d('0x69')]})[_0x6b3d('0x18')](handleEntityNotFound(_0x10e860,null))['then'](function(_0x1eb705){if(_0x1eb705){_0x585845=_0x1eb705[_0x6b3d('0x69')];var _0x43d546=_0x585845[_0x6b3d('0x6a')](-0x1);if(_0x43d546==='/'){_0x585845=_0x585845[_0x6b3d('0x6b')](0x0,_0x585845[_0x6b3d('0x6c')](_0x43d546));}return rp({'method':_0x6b3d('0x6d'),'uri':util[_0x6b3d('0x6e')](_0x6b3d('0x6f'),_0x585845,_0x6b3d('0x70')),'json':!![],'form':{'method':_0x6b3d('0x71'),'input_type':_0x6b3d('0x72'),'response_type':_0x6b3d('0x72'),'rest_data':JSON[_0x6b3d('0x1e')]({'user_auth':{'user_name':_0x1eb705[_0x6b3d('0x67')],'password':_0x1eb705[_0x6b3d('0x68')],'encryption':_0x6b3d('0x73')},'application':_0x6b3d('0x74')})}});}})['then'](function(_0x1bb072){if(_0x1bb072&&_0x1bb072[_0x6b3d('0x2f')]!==_0x6b3d('0x75')&&_0x1bb072[_0x6b3d('0x2f')]!==_0x6b3d('0x76')){return rp({'method':_0x6b3d('0x6d'),'uri':util[_0x6b3d('0x6e')](_0x6b3d('0x6f'),_0x585845,_0x6b3d('0x70')),'json':!![],'form':{'method':_0x6b3d('0x77'),'input_type':'JSON','response_type':_0x6b3d('0x72'),'rest_data':JSON[_0x6b3d('0x1e')]({'session':_0x1bb072['id'],'module_name':'Calls'})}})['then'](function(_0x44e7ce){if(_0x44e7ce){var _0x863e3f=_[_0x6b3d('0x78')](_0x44e7ce[_0x6b3d('0x79')]);_[_0x6b3d('0x7a')](_0x863e3f,function(_0x3eacf7){return _0x48f057['includes'](_0x3eacf7['name']);});return{'count':_0x863e3f[_0x6b3d('0x38')],'rows':_[_0x6b3d('0x3f')](_0x863e3f,function(_0xf86dac){return{'id':_0xf86dac[_0x6b3d('0x2f')],'name':_0xf86dac[_0x6b3d('0x7b')],'custom':_['endsWith'](_0xf86dac[_0x6b3d('0x2f')],'_c')?!![]:![],'options':_0xf86dac[_0x6b3d('0x45')]?_[_0x6b3d('0x3f')](_[_0x6b3d('0x78')](_0xf86dac[_0x6b3d('0x45')]),function(_0x462bd3){return{'name':_0x462bd3['value'],'value':_0x462bd3['name']};}):[]};})};}})[_0x6b3d('0x18')](respondWithResult(_0x10e860,null))[_0x6b3d('0x23')](function(_0x3dc344){var _0xde0866=_0x147f34[_0x6b3d('0x35')][_0x6b3d('0x7c')]?0x1f4:_0x3dc344[_0x6b3d('0x7d')]||0x1f4;logger[_0x6b3d('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0x6b3d('0x5e'),_0xde0866,JSON[_0x6b3d('0x1e')](_0x3dc344));delete _0x3dc344[_0x6b3d('0x2f')];if(_0xde0866===0x191){_0xde0866=0x190;}_0x10e860[_0x6b3d('0x24')](_0xde0866)['send'](_0x147f34[_0x6b3d('0x35')][_0x6b3d('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x3dc344['statusCode']}:_0x3dc344);});}else{var _0xf972f5=0x1f4;_0x10e860[_0x6b3d('0x24')](_0xf972f5)[_0x6b3d('0x30')]({'message':_0x6b3d('0x7e'),'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 53069e7..596f088 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 _0x12e2=['api','moment','bluebird','./intSugarcrmAccount.attributes','../../components/integrations/configuration','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger'];(function(_0x1cf3cb,_0xcd24a9){var _0x30fa5b=function(_0x517c11){while(--_0x517c11){_0x1cf3cb['push'](_0x1cf3cb['shift']());}};_0x30fa5b(++_0xcd24a9);}(_0x12e2,0x1c9));var _0x212e=function(_0x11e004,_0x4541cb){_0x11e004=_0x11e004-0x0;var _0x316e84=_0x12e2[_0x11e004];return _0x316e84;};'use strict';var _=require(_0x212e('0x0'));var util=require('util');var logger=require(_0x212e('0x1'))(_0x212e('0x2'));var moment=require(_0x212e('0x3'));var BPromise=require(_0x212e('0x4'));var rp=require('request-promise');var attributes=require(_0x212e('0x5'));var integrations=require(_0x212e('0x6'));module['exports']=function(_0x6ac427,_0x4ecb7e){return _0x6ac427['define'](_0x212e('0x7'),attributes,{'tableName':_0x212e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9517=['lodash','util','moment','bluebird','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts'];(function(_0x256812,_0x54ba24){var _0x23ceaf=function(_0x13afc7){while(--_0x13afc7){_0x256812['push'](_0x256812['shift']());}};_0x23ceaf(++_0x54ba24);}(_0x9517,0x1d4));var _0x7951=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9517[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7951('0x0'));var util=require(_0x7951('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7951('0x2'));var BPromise=require(_0x7951('0x3'));var rp=require('request-promise');var attributes=require(_0x7951('0x4'));var integrations=require(_0x7951('0x5'));module[_0x7951('0x6')]=function(_0x224866,_0x158ef9){return _0x224866[_0x7951('0x7')]('SugarcrmAccount',attributes,{'tableName':_0x7951('0x8'),'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 04cc0f2..9f30b34 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 _0x963b=['model','then','stringify','debug','ShowSugarcrmAccount','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x1f78d8,_0x317cd0){var _0x3a82d5=function(_0x10b991){while(--_0x10b991){_0x1f78d8['push'](_0x1f78d8['shift']());}};_0x3a82d5(++_0x317cd0);}(_0x963b,0x1e2));var _0xb963=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x963b[_0x4e9628];return _0x27bc8c;};'use strict';var _=require('lodash');var util=require(_0xb963('0x0'));var moment=require(_0xb963('0x1'));var BPromise=require(_0xb963('0x2'));var rs=require(_0xb963('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb963('0x4'))['db'];var utils=require(_0xb963('0x5'));var logger=require(_0xb963('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb963('0x7'));var client=jayson[_0xb963('0x8')][_0xb963('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x254936,_0x1d2bca,_0x38af92){return new BPromise(function(_0x1b8f12,_0x1d6b05){return client[_0xb963('0xa')](_0x254936,_0x38af92)['then'](function(_0x5b3c40){logger[_0xb963('0xb')](_0xb963('0xc'),_0x1d2bca,_0xb963('0xd'));logger['debug'](_0xb963('0xe'),_0x1d2bca,_0xb963('0xd'),JSON['stringify'](_0x5b3c40));if(_0x5b3c40['error']){if(_0x5b3c40[_0xb963('0xf')]['code']===0x1f4){logger[_0xb963('0xf')](_0xb963('0xc'),_0x1d2bca,_0x5b3c40['error']['message']);return _0x1d6b05(_0x5b3c40[_0xb963('0xf')][_0xb963('0x10')]);}logger[_0xb963('0xf')](_0xb963('0xc'),_0x1d2bca,_0x5b3c40[_0xb963('0xf')]['message']);return _0x1b8f12(_0x5b3c40[_0xb963('0xf')][_0xb963('0x10')]);}else{logger[_0xb963('0xb')](_0xb963('0xc'),_0x1d2bca,_0xb963('0xd'));_0x1b8f12(_0x5b3c40[_0xb963('0x11')]['message']);}})['catch'](function(_0xf4cef5){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1d2bca,_0xf4cef5);_0x1d6b05(_0xf4cef5);});});}exports[_0xb963('0x12')]=function(_0x2adbff){var _0x41f160=this;return new Promise(function(_0x318036,_0x1d7e9c){return db[_0xb963('0x13')][_0xb963('0x14')]({'raw':_0x2adbff[_0xb963('0x15')]?_0x2adbff[_0xb963('0x15')][_0xb963('0x16')]===undefined?!![]:![]:!![],'where':_0x2adbff['options']?_0x2adbff['options'][_0xb963('0x17')]||null:null,'attributes':_0x2adbff['options']?_0x2adbff[_0xb963('0x15')][_0xb963('0x18')]||null:null,'limit':_0x2adbff[_0xb963('0x15')]?_0x2adbff[_0xb963('0x15')][_0xb963('0x19')]||null:null,'include':_0x2adbff['options']?_0x2adbff[_0xb963('0x15')][_0xb963('0x1a')]?_[_0xb963('0x1b')](_0x2adbff[_0xb963('0x15')][_0xb963('0x1a')],function(_0x20de73){return{'model':db[_0x20de73[_0xb963('0x1c')]],'as':_0x20de73['as'],'attributes':_0x20de73[_0xb963('0x18')],'include':_0x20de73['include']?_[_0xb963('0x1b')](_0x20de73[_0xb963('0x1a')],function(_0x30f68a){return{'model':db[_0x30f68a[_0xb963('0x1c')]],'as':_0x30f68a['as'],'attributes':_0x30f68a[_0xb963('0x18')],'include':_0x30f68a[_0xb963('0x1a')]?_['map'](_0x30f68a[_0xb963('0x1a')],function(_0xe75ddd){return{'model':db[_0xe75ddd[_0xb963('0x1c')]],'as':_0xe75ddd['as'],'attributes':_0xe75ddd['attributes']};}):[]};}):[]};}):[]:[]})[_0xb963('0x1d')](function(_0xa15c92){logger[_0xb963('0xb')]('GetSugarcrmAccount',_0x2adbff);logger['debug'](_0xb963('0x12'),_0x2adbff,JSON[_0xb963('0x1e')](_0xa15c92));_0x318036(_0xa15c92);})['catch'](function(_0x2942e7){logger[_0xb963('0xf')](_0xb963('0x12'),_0x2942e7[_0xb963('0x10')],_0x2adbff);_0x1d7e9c(_0x41f160[_0xb963('0xf')](0x1f4,_0x2942e7[_0xb963('0x10')]));});});};exports['ShowSugarcrmAccount']=function(_0x5f134a){var _0x301220=this;return new Promise(function(_0x5b02b9,_0x4ea79e){return db[_0xb963('0x13')]['find']({'raw':_0x5f134a['options']?_0x5f134a[_0xb963('0x15')][_0xb963('0x16')]===undefined?!![]:![]:!![],'where':_0x5f134a['options']?_0x5f134a[_0xb963('0x15')][_0xb963('0x17')]||null:null,'attributes':_0x5f134a[_0xb963('0x15')]?_0x5f134a[_0xb963('0x15')]['attributes']||null:null,'include':_0x5f134a[_0xb963('0x15')]?_0x5f134a[_0xb963('0x15')][_0xb963('0x1a')]?_[_0xb963('0x1b')](_0x5f134a[_0xb963('0x15')][_0xb963('0x1a')],function(_0x4b4542){return{'model':db[_0x4b4542[_0xb963('0x1c')]],'as':_0x4b4542['as'],'attributes':_0x4b4542[_0xb963('0x18')],'include':_0x4b4542[_0xb963('0x1a')]?_[_0xb963('0x1b')](_0x4b4542[_0xb963('0x1a')],function(_0x1a8684){return{'model':db[_0x1a8684[_0xb963('0x1c')]],'as':_0x1a8684['as'],'attributes':_0x1a8684[_0xb963('0x18')],'include':_0x1a8684['include']?_[_0xb963('0x1b')](_0x1a8684[_0xb963('0x1a')],function(_0x5b4067){return{'model':db[_0x5b4067[_0xb963('0x1c')]],'as':_0x5b4067['as'],'attributes':_0x5b4067[_0xb963('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb963('0x1d')](function(_0x4b2e52){logger[_0xb963('0xb')]('ShowSugarcrmAccount',_0x5f134a);logger[_0xb963('0x1f')](_0xb963('0x20'),_0x5f134a,JSON['stringify'](_0x4b2e52));_0x5b02b9(_0x4b2e52);})[_0xb963('0x21')](function(_0x17dee8){logger[_0xb963('0xf')](_0xb963('0x20'),_0x17dee8[_0xb963('0x10')],_0x5f134a);_0x4ea79e(_0x301220[_0xb963('0xf')](0x1f4,_0x17dee8['message']));});});}; \ No newline at end of file +var _0xa937=['attributes','limit','include','model','map','stringify','ShowSugarcrmAccount','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','error','code','message','request\x20sent','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where'];(function(_0x3a07c1,_0x34d57f){var _0x2bbe15=function(_0x5a02fb){while(--_0x5a02fb){_0x3a07c1['push'](_0x3a07c1['shift']());}};_0x2bbe15(++_0x34d57f);}(_0xa937,0x194));var _0x7a93=function(_0x5b64e0,_0x2ffe64){_0x5b64e0=_0x5b64e0-0x0;var _0x5bc4fb=_0xa937[_0x5b64e0];return _0x5bc4fb;};'use strict';var _=require('lodash');var util=require(_0x7a93('0x0'));var moment=require(_0x7a93('0x1'));var BPromise=require(_0x7a93('0x2'));var rs=require(_0x7a93('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a93('0x4'))['db'];var utils=require(_0x7a93('0x5'));var logger=require(_0x7a93('0x6'))('rpc');var config=require(_0x7a93('0x7'));var jayson=require(_0x7a93('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c74ab,_0x7c1e97,_0x38b0ed){return new BPromise(function(_0x2a7a4f,_0x5a317e){return client[_0x7a93('0x9')](_0x5c74ab,_0x38b0ed)[_0x7a93('0xa')](function(_0x200c63){logger[_0x7a93('0xb')](_0x7a93('0xc'),_0x7c1e97,'request\x20sent');logger[_0x7a93('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x7c1e97,'request\x20sent',JSON['stringify'](_0x200c63));if(_0x200c63[_0x7a93('0xe')]){if(_0x200c63['error'][_0x7a93('0xf')]===0x1f4){logger[_0x7a93('0xe')](_0x7a93('0xc'),_0x7c1e97,_0x200c63[_0x7a93('0xe')][_0x7a93('0x10')]);return _0x5a317e(_0x200c63[_0x7a93('0xe')][_0x7a93('0x10')]);}logger[_0x7a93('0xe')](_0x7a93('0xc'),_0x7c1e97,_0x200c63[_0x7a93('0xe')][_0x7a93('0x10')]);return _0x2a7a4f(_0x200c63[_0x7a93('0xe')][_0x7a93('0x10')]);}else{logger[_0x7a93('0xb')](_0x7a93('0xc'),_0x7c1e97,_0x7a93('0x11'));_0x2a7a4f(_0x200c63['result'][_0x7a93('0x10')]);}})[_0x7a93('0x12')](function(_0x5a9a82){logger[_0x7a93('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x7c1e97,_0x5a9a82);_0x5a317e(_0x5a9a82);});});}exports[_0x7a93('0x13')]=function(_0x25ce83){var _0x3ad77a=this;return new Promise(function(_0x47c997,_0x20ba66){return db[_0x7a93('0x14')][_0x7a93('0x15')]({'raw':_0x25ce83[_0x7a93('0x16')]?_0x25ce83[_0x7a93('0x16')][_0x7a93('0x17')]===undefined?!![]:![]:!![],'where':_0x25ce83[_0x7a93('0x16')]?_0x25ce83[_0x7a93('0x16')][_0x7a93('0x18')]||null:null,'attributes':_0x25ce83[_0x7a93('0x16')]?_0x25ce83[_0x7a93('0x16')][_0x7a93('0x19')]||null:null,'limit':_0x25ce83[_0x7a93('0x16')]?_0x25ce83[_0x7a93('0x16')][_0x7a93('0x1a')]||null:null,'include':_0x25ce83[_0x7a93('0x16')]?_0x25ce83[_0x7a93('0x16')][_0x7a93('0x1b')]?_['map'](_0x25ce83[_0x7a93('0x16')][_0x7a93('0x1b')],function(_0x301395){return{'model':db[_0x301395[_0x7a93('0x1c')]],'as':_0x301395['as'],'attributes':_0x301395['attributes'],'include':_0x301395[_0x7a93('0x1b')]?_[_0x7a93('0x1d')](_0x301395[_0x7a93('0x1b')],function(_0x8e3345){return{'model':db[_0x8e3345['model']],'as':_0x8e3345['as'],'attributes':_0x8e3345[_0x7a93('0x19')],'include':_0x8e3345[_0x7a93('0x1b')]?_[_0x7a93('0x1d')](_0x8e3345['include'],function(_0x5af66c){return{'model':db[_0x5af66c[_0x7a93('0x1c')]],'as':_0x5af66c['as'],'attributes':_0x5af66c[_0x7a93('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5522b3){logger['info'](_0x7a93('0x13'),_0x25ce83);logger[_0x7a93('0xd')](_0x7a93('0x13'),_0x25ce83,JSON[_0x7a93('0x1e')](_0x5522b3));_0x47c997(_0x5522b3);})[_0x7a93('0x12')](function(_0x5f563f){logger[_0x7a93('0xe')](_0x7a93('0x13'),_0x5f563f[_0x7a93('0x10')],_0x25ce83);_0x20ba66(_0x3ad77a[_0x7a93('0xe')](0x1f4,_0x5f563f[_0x7a93('0x10')]));});});};exports[_0x7a93('0x1f')]=function(_0x35491e){var _0x43547c=this;return new Promise(function(_0x485a93,_0xc83778){return db[_0x7a93('0x14')][_0x7a93('0x20')]({'raw':_0x35491e['options']?_0x35491e[_0x7a93('0x16')][_0x7a93('0x17')]===undefined?!![]:![]:!![],'where':_0x35491e[_0x7a93('0x16')]?_0x35491e['options'][_0x7a93('0x18')]||null:null,'attributes':_0x35491e['options']?_0x35491e['options']['attributes']||null:null,'include':_0x35491e[_0x7a93('0x16')]?_0x35491e[_0x7a93('0x16')][_0x7a93('0x1b')]?_[_0x7a93('0x1d')](_0x35491e[_0x7a93('0x16')]['include'],function(_0x39c3bd){return{'model':db[_0x39c3bd[_0x7a93('0x1c')]],'as':_0x39c3bd['as'],'attributes':_0x39c3bd['attributes'],'include':_0x39c3bd['include']?_[_0x7a93('0x1d')](_0x39c3bd['include'],function(_0x2e77bd){return{'model':db[_0x2e77bd[_0x7a93('0x1c')]],'as':_0x2e77bd['as'],'attributes':_0x2e77bd[_0x7a93('0x19')],'include':_0x2e77bd[_0x7a93('0x1b')]?_[_0x7a93('0x1d')](_0x2e77bd[_0x7a93('0x1b')],function(_0x45e481){return{'model':db[_0x45e481[_0x7a93('0x1c')]],'as':_0x45e481['as'],'attributes':_0x45e481[_0x7a93('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b0c52){logger[_0x7a93('0xb')](_0x7a93('0x1f'),_0x35491e);logger[_0x7a93('0xd')](_0x7a93('0x1f'),_0x35491e,JSON[_0x7a93('0x1e')](_0x5b0c52));_0x485a93(_0x5b0c52);})[_0x7a93('0x12')](function(_0x48c56d){logger[_0x7a93('0xe')](_0x7a93('0x1f'),_0x48c56d[_0x7a93('0x10')],_0x35491e);_0xc83778(_0x43547c['error'](0x1f4,_0x48c56d[_0x7a93('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index a42d22a..e7042ef 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 _0x86e4=['../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','getFields','getSubjects','getDescriptions','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x86e4,0x149));var _0x486e=function(_0x138836,_0x229129){_0x138836=_0x138836-0x0;var _0x322688=_0x86e4[_0x138836];return _0x322688;};'use strict';var multer=require(_0x486e('0x0'));var util=require(_0x486e('0x1'));var path=require(_0x486e('0x2'));var timeout=require(_0x486e('0x3'));var express=require(_0x486e('0x4'));var router=express[_0x486e('0x5')]();var auth=require(_0x486e('0x6'));var interaction=require(_0x486e('0x7'));var config=require(_0x486e('0x8'));var controller=require(_0x486e('0x9'));router[_0x486e('0xa')]('/',auth[_0x486e('0xb')](),controller[_0x486e('0xc')]);router[_0x486e('0xa')]('/:id',auth[_0x486e('0xb')](),controller[_0x486e('0xd')]);router[_0x486e('0xa')]('/:id/fields',auth[_0x486e('0xb')](),controller[_0x486e('0xe')]);router[_0x486e('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x486e('0xf')]);router[_0x486e('0xa')]('/:id/descriptions',auth[_0x486e('0xb')](),controller[_0x486e('0x10')]);router[_0x486e('0x11')]('/',auth['isAuthenticated'](),controller[_0x486e('0x12')]);router[_0x486e('0x13')](_0x486e('0x14'),auth[_0x486e('0xb')](),controller[_0x486e('0x15')]);router[_0x486e('0x16')](_0x486e('0x14'),auth[_0x486e('0xb')](),controller['destroy']);module[_0x486e('0x17')]=router; \ No newline at end of file +var _0x88e9=['destroy','path','connect-timeout','express','Router','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','/:id'];(function(_0x4fec28,_0x39cd69){var _0x5643b2=function(_0x1152e0){while(--_0x1152e0){_0x4fec28['push'](_0x4fec28['shift']());}};_0x5643b2(++_0x39cd69);}(_0x88e9,0x141));var _0x988e=function(_0xdeee31,_0x39ae52){_0xdeee31=_0xdeee31-0x0;var _0xea0882=_0x88e9[_0xdeee31];return _0xea0882;};'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 auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x988e('0x4'));var controller=require(_0x988e('0x5'));router[_0x988e('0x6')]('/',auth[_0x988e('0x7')](),controller[_0x988e('0x8')]);router['get']('/:id',auth[_0x988e('0x7')](),controller[_0x988e('0x9')]);router[_0x988e('0x6')](_0x988e('0xa'),auth[_0x988e('0x7')](),controller[_0x988e('0xb')]);router[_0x988e('0x6')](_0x988e('0xc'),auth[_0x988e('0x7')](),controller[_0x988e('0xd')]);router[_0x988e('0x6')](_0x988e('0xe'),auth[_0x988e('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0x988e('0x7')](),controller[_0x988e('0xf')]);router[_0x988e('0x10')]('/:id',auth[_0x988e('0x7')](),controller[_0x988e('0x11')]);router['delete'](_0x988e('0x12'),auth[_0x988e('0x7')](),controller[_0x988e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 58fa5c9..9c62002 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 _0xbdbf=['STRING','exports'];(function(_0x310998,_0x30f797){var _0x147578=function(_0x23fb7f){while(--_0x23fb7f){_0x310998['push'](_0x310998['shift']());}};_0x147578(++_0x30f797);}(_0xbdbf,0x15b));var _0xfbdb=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0xbdbf[_0x19dd7a];return _0x3feb6a;};'use strict';var Sequelize=require('sequelize');module[_0xfbdb('0x0')]={'name':{'type':Sequelize[_0xfbdb('0x1')]},'description':{'type':Sequelize[_0xfbdb('0x1')]}}; \ No newline at end of file +var _0x588c=['STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x588c,0x163));var _0xc588=function(_0x4ca8ac,_0x1e970e){_0x4ca8ac=_0x4ca8ac-0x0;var _0x12fd3d=_0x588c[_0x4ca8ac];return _0x12fd3d;};'use strict';var Sequelize=require('sequelize');module[_0xc588('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc588('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 43400cf..a64a23d 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 _0x2451=['where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','findAll','rows','params','length','include','create','body','find','getFields','SugarcrmField','hasOwnProperty','getSubjects','findOne','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','client','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','catch','sendStatus','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','SugarcrmConfiguration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort'];(function(_0x5a0196,_0x4565f8){var _0x489070=function(_0x13f631){while(--_0x13f631){_0x5a0196['push'](_0x5a0196['shift']());}};_0x489070(++_0x4565f8);}(_0x2451,0xc8));var _0x1245=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0x2451[_0x29d6e6];return _0xc75ff0;};'use strict';var pdf=require(_0x1245('0x0'));var emlformat=require(_0x1245('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1245('0x2'));var jsonpatch=require(_0x1245('0x3'));var rp=require(_0x1245('0x4'));var moment=require(_0x1245('0x5'));var BPromise=require(_0x1245('0x6'));var Mustache=require(_0x1245('0x7'));var util=require(_0x1245('0x8'));var path=require(_0x1245('0x9'));var sox=require(_0x1245('0xa'));var csv=require(_0x1245('0xb'));var ejs=require(_0x1245('0xc'));var fs=require('fs');var _=require(_0x1245('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1245('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1245('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x1245('0xf'));var Redis=require(_0x1245('0x10'));var qs=require(_0x1245('0x11'));var logger=require(_0x1245('0x12'))(_0x1245('0x13'));var utils=require('../../config/utils');var config=require(_0x1245('0x14'));var db=require(_0x1245('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1245('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46f7d8,_0x3b95ea,_0x2dcfab,_0x3bed08){return new BPromise(function(_0x4d737a,_0x3fceb8){var _0x4ac051=_0x3bed08||client;return _0x4ac051[_0x1245('0x17')](_0x46f7d8,_0x2dcfab)[_0x1245('0x18')](function(_0x5db55b){logger[_0x1245('0x19')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3b95ea,_0x1245('0x1a'));logger[_0x1245('0x1b')](_0x1245('0x1c'),_0x3b95ea,_0x1245('0x1a'),JSON[_0x1245('0x1d')](_0x5db55b));if(_0x5db55b[_0x1245('0x1e')]){if(_0x5db55b[_0x1245('0x1e')][_0x1245('0x1f')]===0x1f4){logger['error'](_0x1245('0x20'),_0x3b95ea,_0x5db55b[_0x1245('0x1e')][_0x1245('0x21')]);return _0x3fceb8(_0x5db55b[_0x1245('0x1e')]['message']);}logger['error'](_0x1245('0x20'),_0x3b95ea,_0x5db55b[_0x1245('0x1e')][_0x1245('0x21')]);return _0x4d737a(_0x5db55b['error'][_0x1245('0x21')]);}else{logger[_0x1245('0x19')](_0x1245('0x20'),_0x3b95ea,_0x1245('0x1a'));_0x4d737a(_0x5db55b['result'][_0x1245('0x21')]);}})[_0x1245('0x22')](function(_0x28565a){logger['error'](_0x1245('0x20'),_0x3b95ea,_0x28565a);_0x3fceb8(_0x28565a);});});}function respondWithStatusCode(_0x3e430f,_0xae7e1){_0xae7e1=_0xae7e1||0xcc;return function(_0x5d0d25){if(_0x5d0d25){return _0x3e430f[_0x1245('0x23')](_0xae7e1);}return _0x3e430f['status'](_0xae7e1)[_0x1245('0x24')]();};}function respondWithResult(_0x29ddff,_0x162a9d){_0x162a9d=_0x162a9d||0xc8;return function(_0x225103){if(_0x225103){return _0x29ddff['status'](_0x162a9d)[_0x1245('0x25')](_0x225103);}};}function respondWithFilteredResult(_0x298480,_0x204408){return function(_0x30997f){if(_0x30997f){var _0x803be=_0x30997f[_0x1245('0x26')],_0x1bf8a9=_0x204408[_0x1245('0x27')],_0x35fbec=_0x204408[_0x1245('0x27')]+_0x204408[_0x1245('0x28')],_0x5be70c;if(_0x35fbec>=_0x803be){_0x35fbec=_0x803be;_0x5be70c=0xc8;}else{_0x5be70c=0xce;}_0x298480[_0x1245('0x29')](_0x5be70c);return _0x298480['set'](_0x1245('0x2a'),_0x1bf8a9+'-'+_0x35fbec+'/'+_0x803be)[_0x1245('0x25')](_0x30997f);}return null;};}function patchUpdates(_0x353cfa){return function(_0x49500c){try{jsonpatch[_0x1245('0x2b')](_0x49500c,_0x353cfa,!![]);}catch(_0x36876c){return BPromise[_0x1245('0x2c')](_0x36876c);}return _0x49500c[_0x1245('0x2d')]();};}function saveUpdates(_0x4eebf2,_0x22c5a1){return function(_0x25f5f2){if(_0x25f5f2){return _0x25f5f2[_0x1245('0x2e')](_0x4eebf2)['then'](function(_0x409d95){return _0x409d95;});}return null;};}function removeEntity(_0xd8bc72,_0xf604dc){return function(_0x21f6cc){if(_0x21f6cc){return _0x21f6cc[_0x1245('0x2f')]()[_0x1245('0x18')](function(){_0xd8bc72['status'](0xcc)[_0x1245('0x24')]();});}};}function handleEntityNotFound(_0x3d439c,_0x22dc48){return function(_0x312eab){if(!_0x312eab){_0x3d439c[_0x1245('0x23')](0x194);}return _0x312eab;};}function handleError(_0x49c031,_0x5b9b7e){_0x5b9b7e=_0x5b9b7e||0x1f4;return function(_0x2b8eb2){logger['error'](_0x2b8eb2[_0x1245('0x30')]);if(_0x2b8eb2[_0x1245('0x31')]){delete _0x2b8eb2['name'];}_0x49c031[_0x1245('0x29')](_0x5b9b7e)[_0x1245('0x32')](_0x2b8eb2);};}exports[_0x1245('0x33')]=function(_0x39ba4a,_0x281e3c){var _0x552263={},_0x29ae8a={},_0x184b22={'count':0x0,'rows':[]};var _0x3e4149=db[_0x1245('0x34')][_0x1245('0x35')];_0x29ae8a[_0x1245('0x36')]=_['keys'](_0x3e4149);_0x29ae8a[_0x1245('0x37')]=_[_0x1245('0x38')](_0x39ba4a['query']);_0x29ae8a[_0x1245('0x39')]=_[_0x1245('0x3a')](_0x29ae8a['model'],_0x29ae8a[_0x1245('0x37')]);_0x552263[_0x1245('0x3b')]=_[_0x1245('0x3a')](_0x29ae8a['model'],qs[_0x1245('0x3c')](_0x39ba4a[_0x1245('0x37')][_0x1245('0x3c')]));_0x552263[_0x1245('0x3b')]=_0x552263[_0x1245('0x3b')]['length']?_0x552263[_0x1245('0x3b')]:_0x29ae8a[_0x1245('0x36')];if(!_0x39ba4a[_0x1245('0x37')]['hasOwnProperty'](_0x1245('0x3d'))){_0x552263[_0x1245('0x28')]=qs[_0x1245('0x28')](_0x39ba4a[_0x1245('0x37')][_0x1245('0x28')]);_0x552263[_0x1245('0x27')]=qs[_0x1245('0x27')](_0x39ba4a[_0x1245('0x37')][_0x1245('0x27')]);}_0x552263[_0x1245('0x3e')]=qs[_0x1245('0x3f')](_0x39ba4a[_0x1245('0x37')][_0x1245('0x3f')]);_0x552263[_0x1245('0x40')]=qs['filters'](_[_0x1245('0x41')](_0x39ba4a[_0x1245('0x37')],_0x29ae8a['filters']));if(_0x39ba4a[_0x1245('0x37')][_0x1245('0x42')]){_0x552263['where']=_[_0x1245('0x43')](_0x552263['where'],{'$or':_[_0x1245('0x44')](_0x3e4149,function(_0x36c5f2){if(_0x36c5f2['type'][_0x1245('0x45')]!==_0x1245('0x46')){var _0x326013={};_0x326013[_0x36c5f2[_0x1245('0x47')]]={'$like':'%'+_0x39ba4a[_0x1245('0x37')]['filter']+'%'};return _0x326013;}})});}_0x552263=_[_0x1245('0x43')]({},_0x552263,_0x39ba4a[_0x1245('0x48')]);var _0x2ce55a={'where':_0x552263['where']};return db[_0x1245('0x34')][_0x1245('0x26')](_0x2ce55a)['then'](function(_0x247ff2){_0x184b22[_0x1245('0x26')]=_0x247ff2;if(_0x39ba4a[_0x1245('0x37')][_0x1245('0x49')]){_0x552263['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x1245('0x4a')](_0x552263);})[_0x1245('0x18')](function(_0x44fb63){_0x184b22[_0x1245('0x4b')]=_0x44fb63;return _0x184b22;})[_0x1245('0x18')](respondWithFilteredResult(_0x281e3c,_0x552263))[_0x1245('0x22')](handleError(_0x281e3c,null));};exports['show']=function(_0x3ec0f0,_0x22e5d0){var _0x2f8ab2={'raw':![],'where':{'id':_0x3ec0f0[_0x1245('0x4c')]['id']}},_0x1f8140={};_0x1f8140[_0x1245('0x36')]=_['keys'](db['SugarcrmConfiguration'][_0x1245('0x35')]);_0x1f8140['query']=_['keys'](_0x3ec0f0[_0x1245('0x37')]);_0x1f8140[_0x1245('0x39')]=_[_0x1245('0x3a')](_0x1f8140['model'],_0x1f8140[_0x1245('0x37')]);_0x2f8ab2[_0x1245('0x3b')]=_[_0x1245('0x3a')](_0x1f8140[_0x1245('0x36')],qs[_0x1245('0x3c')](_0x3ec0f0[_0x1245('0x37')][_0x1245('0x3c')]));_0x2f8ab2[_0x1245('0x3b')]=_0x2f8ab2['attributes'][_0x1245('0x4d')]?_0x2f8ab2[_0x1245('0x3b')]:_0x1f8140[_0x1245('0x36')];if(_0x3ec0f0['query'][_0x1245('0x49')]){_0x2f8ab2[_0x1245('0x4e')]=[{'all':!![]}];}_0x2f8ab2=_[_0x1245('0x43')]({},_0x2f8ab2,_0x3ec0f0[_0x1245('0x48')]);return db['SugarcrmConfiguration']['find'](_0x2f8ab2)[_0x1245('0x18')](handleEntityNotFound(_0x22e5d0,null))[_0x1245('0x18')](respondWithResult(_0x22e5d0,null))[_0x1245('0x22')](handleError(_0x22e5d0,null));};exports[_0x1245('0x4f')]=function(_0x4c28ae,_0x381989){return db[_0x1245('0x34')][_0x1245('0x4f')](_0x4c28ae[_0x1245('0x50')],{})[_0x1245('0x18')](respondWithResult(_0x381989,0xc9))[_0x1245('0x22')](handleError(_0x381989,null));};exports[_0x1245('0x2e')]=function(_0x5a0be3,_0x54985c){if(_0x5a0be3['body']['id']){delete _0x5a0be3['body']['id'];}return db[_0x1245('0x34')]['find']({'where':{'id':_0x5a0be3[_0x1245('0x4c')]['id']}})[_0x1245('0x18')](handleEntityNotFound(_0x54985c,null))[_0x1245('0x18')](saveUpdates(_0x5a0be3[_0x1245('0x50')],null))[_0x1245('0x18')](respondWithResult(_0x54985c,null))['catch'](handleError(_0x54985c,null));};exports[_0x1245('0x2f')]=function(_0x31464b,_0xeb02e7){return db['SugarcrmConfiguration'][_0x1245('0x51')]({'where':{'id':_0x31464b[_0x1245('0x4c')]['id']}})[_0x1245('0x18')](handleEntityNotFound(_0xeb02e7,null))[_0x1245('0x18')](removeEntity(_0xeb02e7,null))['catch'](handleError(_0xeb02e7,null));};exports[_0x1245('0x52')]=function(_0x234e76,_0x1e932e,_0x25515c){var _0x18acde={};var _0x16e8c5={};var _0x5d102c;var _0x3a97b3;return db[_0x1245('0x34')]['findOne']({'where':{'id':_0x234e76[_0x1245('0x4c')]['id']}})[_0x1245('0x18')](handleEntityNotFound(_0x1e932e,null))[_0x1245('0x18')](function(_0x42e89f){if(_0x42e89f){_0x5d102c=_0x42e89f;_0x16e8c5['model']=_[_0x1245('0x38')](db[_0x1245('0x53')]['rawAttributes']);_0x16e8c5[_0x1245('0x37')]=_['keys'](_0x234e76[_0x1245('0x37')]);_0x16e8c5[_0x1245('0x39')]=_[_0x1245('0x3a')](_0x16e8c5['model'],_0x16e8c5[_0x1245('0x37')]);_0x18acde[_0x1245('0x3b')]=_[_0x1245('0x3a')](_0x16e8c5[_0x1245('0x36')],qs['fields'](_0x234e76['query'][_0x1245('0x3c')]));_0x18acde['attributes']=_0x18acde[_0x1245('0x3b')]['length']?_0x18acde[_0x1245('0x3b')]:_0x16e8c5[_0x1245('0x36')];_0x18acde[_0x1245('0x3e')]=qs['sort'](_0x234e76['query'][_0x1245('0x3f')]);_0x18acde[_0x1245('0x40')]=qs[_0x1245('0x39')](_[_0x1245('0x41')](_0x234e76[_0x1245('0x37')],_0x16e8c5[_0x1245('0x39')]));if(_0x234e76['query'][_0x1245('0x42')]){_0x18acde[_0x1245('0x40')]=_['merge'](_0x18acde['where'],{'$or':_[_0x1245('0x44')](_0x18acde['attributes'],function(_0x230131){var _0x21ca62={};_0x21ca62[_0x230131]={'$like':'%'+_0x234e76[_0x1245('0x37')]['filter']+'%'};return _0x21ca62;})});}_0x18acde=_[_0x1245('0x43')]({},_0x18acde,_0x234e76['options']);return _0x5d102c['getFields'](_0x18acde);}})[_0x1245('0x18')](function(_0x1e9be5){if(_0x1e9be5){_0x3a97b3=_0x1e9be5['length'];if(!_0x234e76['query'][_0x1245('0x54')](_0x1245('0x3d'))){_0x18acde[_0x1245('0x28')]=qs['limit'](_0x234e76[_0x1245('0x37')][_0x1245('0x28')]);_0x18acde[_0x1245('0x27')]=qs['offset'](_0x234e76[_0x1245('0x37')][_0x1245('0x27')]);}return _0x5d102c[_0x1245('0x52')](_0x18acde);}})[_0x1245('0x18')](function(_0x4b8357){if(_0x4b8357){return _0x4b8357?{'count':_0x3a97b3,'rows':_0x4b8357}:null;}})[_0x1245('0x18')](respondWithResult(_0x1e932e,null))[_0x1245('0x22')](handleError(_0x1e932e,null));};exports[_0x1245('0x55')]=function(_0x2fd045,_0x68a031,_0x5c73d2){var _0x3f4023={};var _0x1e8223={};var _0x422f1f;var _0x2db28a;return db[_0x1245('0x34')][_0x1245('0x56')]({'where':{'id':_0x2fd045['params']['id']}})['then'](handleEntityNotFound(_0x68a031,null))[_0x1245('0x18')](function(_0x248e60){if(_0x248e60){_0x422f1f=_0x248e60;_0x1e8223[_0x1245('0x36')]=_[_0x1245('0x38')](db[_0x1245('0x53')][_0x1245('0x35')]);_0x1e8223[_0x1245('0x37')]=_[_0x1245('0x38')](_0x2fd045['query']);_0x1e8223[_0x1245('0x39')]=_[_0x1245('0x3a')](_0x1e8223[_0x1245('0x36')],_0x1e8223[_0x1245('0x37')]);_0x3f4023[_0x1245('0x3b')]=_[_0x1245('0x3a')](_0x1e8223[_0x1245('0x36')],qs[_0x1245('0x3c')](_0x2fd045[_0x1245('0x37')]['fields']));_0x3f4023['attributes']=_0x3f4023[_0x1245('0x3b')]['length']?_0x3f4023['attributes']:_0x1e8223[_0x1245('0x36')];_0x3f4023[_0x1245('0x3e')]=qs['sort'](_0x2fd045[_0x1245('0x37')][_0x1245('0x3f')]);_0x3f4023['where']=qs[_0x1245('0x39')](_['pick'](_0x2fd045[_0x1245('0x37')],_0x1e8223[_0x1245('0x39')]));if(_0x2fd045[_0x1245('0x37')]['filter']){_0x3f4023[_0x1245('0x40')]=_[_0x1245('0x43')](_0x3f4023[_0x1245('0x40')],{'$or':_[_0x1245('0x44')](_0x3f4023['attributes'],function(_0x6ef9ac){var _0x19366b={};_0x19366b[_0x6ef9ac]={'$like':'%'+_0x2fd045[_0x1245('0x37')][_0x1245('0x42')]+'%'};return _0x19366b;})});}_0x3f4023=_['merge']({},_0x3f4023,_0x2fd045[_0x1245('0x48')]);return _0x422f1f['getSubjects'](_0x3f4023);}})[_0x1245('0x18')](function(_0x3bee23){if(_0x3bee23){_0x2db28a=_0x3bee23[_0x1245('0x4d')];if(!_0x2fd045[_0x1245('0x37')][_0x1245('0x54')](_0x1245('0x3d'))){_0x3f4023[_0x1245('0x28')]=qs[_0x1245('0x28')](_0x2fd045[_0x1245('0x37')][_0x1245('0x28')]);_0x3f4023['offset']=qs[_0x1245('0x27')](_0x2fd045[_0x1245('0x37')][_0x1245('0x27')]);}return _0x422f1f[_0x1245('0x55')](_0x3f4023);}})[_0x1245('0x18')](function(_0x1d0efb){if(_0x1d0efb){return _0x1d0efb?{'count':_0x2db28a,'rows':_0x1d0efb}:null;}})['then'](respondWithResult(_0x68a031,null))[_0x1245('0x22')](handleError(_0x68a031,null));};exports['getDescriptions']=function(_0x46f59e,_0x5cd74a,_0x5b9ec9){var _0xb60c22={};var _0x460fab={};var _0x45ba6e;var _0x148975;return db['SugarcrmConfiguration'][_0x1245('0x56')]({'where':{'id':_0x46f59e[_0x1245('0x4c')]['id']}})[_0x1245('0x18')](handleEntityNotFound(_0x5cd74a,null))[_0x1245('0x18')](function(_0x529a58){if(_0x529a58){_0x45ba6e=_0x529a58;_0x460fab[_0x1245('0x36')]=_['keys'](db[_0x1245('0x53')]['rawAttributes']);_0x460fab[_0x1245('0x37')]=_['keys'](_0x46f59e[_0x1245('0x37')]);_0x460fab[_0x1245('0x39')]=_[_0x1245('0x3a')](_0x460fab[_0x1245('0x36')],_0x460fab[_0x1245('0x37')]);_0xb60c22[_0x1245('0x3b')]=_[_0x1245('0x3a')](_0x460fab[_0x1245('0x36')],qs[_0x1245('0x3c')](_0x46f59e[_0x1245('0x37')][_0x1245('0x3c')]));_0xb60c22[_0x1245('0x3b')]=_0xb60c22[_0x1245('0x3b')]['length']?_0xb60c22[_0x1245('0x3b')]:_0x460fab[_0x1245('0x36')];_0xb60c22[_0x1245('0x3e')]=qs[_0x1245('0x3f')](_0x46f59e['query'][_0x1245('0x3f')]);_0xb60c22['where']=qs[_0x1245('0x39')](_[_0x1245('0x41')](_0x46f59e['query'],_0x460fab[_0x1245('0x39')]));if(_0x46f59e['query'][_0x1245('0x42')]){_0xb60c22[_0x1245('0x40')]=_[_0x1245('0x43')](_0xb60c22[_0x1245('0x40')],{'$or':_[_0x1245('0x44')](_0xb60c22['attributes'],function(_0x45dc8a){var _0x45fe60={};_0x45fe60[_0x45dc8a]={'$like':'%'+_0x46f59e[_0x1245('0x37')]['filter']+'%'};return _0x45fe60;})});}_0xb60c22=_['merge']({},_0xb60c22,_0x46f59e[_0x1245('0x48')]);return _0x45ba6e[_0x1245('0x57')](_0xb60c22);}})['then'](function(_0x414226){if(_0x414226){_0x148975=_0x414226[_0x1245('0x4d')];if(!_0x46f59e[_0x1245('0x37')][_0x1245('0x54')](_0x1245('0x3d'))){_0xb60c22[_0x1245('0x28')]=qs[_0x1245('0x28')](_0x46f59e[_0x1245('0x37')][_0x1245('0x28')]);_0xb60c22['offset']=qs[_0x1245('0x27')](_0x46f59e[_0x1245('0x37')]['offset']);}return _0x45ba6e[_0x1245('0x57')](_0xb60c22);}})[_0x1245('0x18')](function(_0x20b2cb){if(_0x20b2cb){return _0x20b2cb?{'count':_0x148975,'rows':_0x20b2cb}:null;}})[_0x1245('0x18')](respondWithResult(_0x5cd74a,null))[_0x1245('0x22')](handleError(_0x5cd74a,null));}; \ No newline at end of file +var _0x9bad=['model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','where','merge','map','type','key','field','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','update','getFields','findOne','order','sort','pick','SugarcrmField','getSubjects','getDescriptions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','sendStatus','stack','name','send','index','SugarcrmConfiguration'];(function(_0x194b19,_0x27b098){var _0x45911d=function(_0xd99824){while(--_0xd99824){_0x194b19['push'](_0x194b19['shift']());}};_0x45911d(++_0x27b098);}(_0x9bad,0x185));var _0xd9ba=function(_0x4cb60e,_0x2f24f3){_0x4cb60e=_0x4cb60e-0x0;var _0x10ef20=_0x9bad[_0x4cb60e];return _0x10ef20;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd9ba('0x0'));var rimraf=require(_0xd9ba('0x1'));var zipdir=require(_0xd9ba('0x2'));var jsonpatch=require(_0xd9ba('0x3'));var rp=require(_0xd9ba('0x4'));var moment=require(_0xd9ba('0x5'));var BPromise=require(_0xd9ba('0x6'));var Mustache=require('mustache');var util=require(_0xd9ba('0x7'));var path=require('path');var sox=require(_0xd9ba('0x8'));var csv=require(_0xd9ba('0x9'));var ejs=require(_0xd9ba('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd9ba('0xb'));var crypto=require(_0xd9ba('0xc'));var jsforce=require(_0xd9ba('0xd'));var deskjs=require(_0xd9ba('0xe'));var toCsv=require(_0xd9ba('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0xd9ba('0xf'));var hardwareService=require(_0xd9ba('0x10'));var Redis=require(_0xd9ba('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xd9ba('0x12'))(_0xd9ba('0x13'));var utils=require(_0xd9ba('0x14'));var config=require('../../config/environment');var db=require(_0xd9ba('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xd9ba('0x16')][_0xd9ba('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xbb2723,_0x3d9b4d,_0x36d156,_0xaf5bf7){return new BPromise(function(_0xcf7e29,_0x55a9ec){var _0x5b14bc=_0xaf5bf7||client;return _0x5b14bc['request'](_0xbb2723,_0x36d156)['then'](function(_0x33e5d1){logger[_0xd9ba('0x18')](_0xd9ba('0x19'),_0x3d9b4d,'request\x20sent');logger[_0xd9ba('0x1a')](_0xd9ba('0x1b'),_0x3d9b4d,_0xd9ba('0x1c'),JSON[_0xd9ba('0x1d')](_0x33e5d1));if(_0x33e5d1[_0xd9ba('0x1e')]){if(_0x33e5d1[_0xd9ba('0x1e')][_0xd9ba('0x1f')]===0x1f4){logger['error'](_0xd9ba('0x19'),_0x3d9b4d,_0x33e5d1[_0xd9ba('0x1e')]['message']);return _0x55a9ec(_0x33e5d1[_0xd9ba('0x1e')][_0xd9ba('0x20')]);}logger['error'](_0xd9ba('0x19'),_0x3d9b4d,_0x33e5d1[_0xd9ba('0x1e')][_0xd9ba('0x20')]);return _0xcf7e29(_0x33e5d1['error'][_0xd9ba('0x20')]);}else{logger['info'](_0xd9ba('0x19'),_0x3d9b4d,_0xd9ba('0x1c'));_0xcf7e29(_0x33e5d1[_0xd9ba('0x21')][_0xd9ba('0x20')]);}})['catch'](function(_0x34d2ee){logger['error'](_0xd9ba('0x19'),_0x3d9b4d,_0x34d2ee);_0x55a9ec(_0x34d2ee);});});}function respondWithStatusCode(_0x1dc9bf,_0x408173){_0x408173=_0x408173||0xcc;return function(_0x30058e){if(_0x30058e){return _0x1dc9bf['sendStatus'](_0x408173);}return _0x1dc9bf[_0xd9ba('0x22')](_0x408173)[_0xd9ba('0x23')]();};}function respondWithResult(_0x221328,_0x897be2){_0x897be2=_0x897be2||0xc8;return function(_0x146091){if(_0x146091){return _0x221328['status'](_0x897be2)[_0xd9ba('0x24')](_0x146091);}};}function respondWithFilteredResult(_0x4c2cb5,_0x18ae19){return function(_0x5a2949){if(_0x5a2949){var _0x5d7e98=_0x5a2949[_0xd9ba('0x25')],_0x5a97aa=_0x18ae19[_0xd9ba('0x26')],_0xa906fe=_0x18ae19[_0xd9ba('0x26')]+_0x18ae19[_0xd9ba('0x27')],_0x1dcc56;if(_0xa906fe>=_0x5d7e98){_0xa906fe=_0x5d7e98;_0x1dcc56=0xc8;}else{_0x1dcc56=0xce;}_0x4c2cb5[_0xd9ba('0x22')](_0x1dcc56);return _0x4c2cb5[_0xd9ba('0x28')](_0xd9ba('0x29'),_0x5a97aa+'-'+_0xa906fe+'/'+_0x5d7e98)[_0xd9ba('0x24')](_0x5a2949);}return null;};}function patchUpdates(_0x4cdac0){return function(_0x2339b0){try{jsonpatch['apply'](_0x2339b0,_0x4cdac0,!![]);}catch(_0x490cd6){return BPromise['reject'](_0x490cd6);}return _0x2339b0[_0xd9ba('0x2a')]();};}function saveUpdates(_0x490e26,_0x1399a4){return function(_0x4188e0){if(_0x4188e0){return _0x4188e0['update'](_0x490e26)[_0xd9ba('0x2b')](function(_0x2a31b6){return _0x2a31b6;});}return null;};}function removeEntity(_0x1141d8,_0xb50a50){return function(_0x110636){if(_0x110636){return _0x110636[_0xd9ba('0x2c')]()[_0xd9ba('0x2b')](function(){_0x1141d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa450d,_0x3c52dc){return function(_0x280474){if(!_0x280474){_0xaa450d[_0xd9ba('0x2d')](0x194);}return _0x280474;};}function handleError(_0x56c92c,_0x23f4a4){_0x23f4a4=_0x23f4a4||0x1f4;return function(_0x40183a){logger[_0xd9ba('0x1e')](_0x40183a[_0xd9ba('0x2e')]);if(_0x40183a[_0xd9ba('0x2f')]){delete _0x40183a['name'];}_0x56c92c['status'](_0x23f4a4)[_0xd9ba('0x30')](_0x40183a);};}exports[_0xd9ba('0x31')]=function(_0x312656,_0x5548aa){var _0x3dcaa5={},_0x56cb9f={},_0x415819={'count':0x0,'rows':[]};var _0x50470d=db[_0xd9ba('0x32')]['rawAttributes'];_0x56cb9f[_0xd9ba('0x33')]=_[_0xd9ba('0x34')](_0x50470d);_0x56cb9f['query']=_[_0xd9ba('0x34')](_0x312656[_0xd9ba('0x35')]);_0x56cb9f[_0xd9ba('0x36')]=_[_0xd9ba('0x37')](_0x56cb9f[_0xd9ba('0x33')],_0x56cb9f[_0xd9ba('0x35')]);_0x3dcaa5['attributes']=_['intersection'](_0x56cb9f[_0xd9ba('0x33')],qs[_0xd9ba('0x38')](_0x312656[_0xd9ba('0x35')][_0xd9ba('0x38')]));_0x3dcaa5[_0xd9ba('0x39')]=_0x3dcaa5[_0xd9ba('0x39')][_0xd9ba('0x3a')]?_0x3dcaa5[_0xd9ba('0x39')]:_0x56cb9f[_0xd9ba('0x33')];if(!_0x312656['query'][_0xd9ba('0x3b')]('nolimit')){_0x3dcaa5[_0xd9ba('0x27')]=qs[_0xd9ba('0x27')](_0x312656[_0xd9ba('0x35')][_0xd9ba('0x27')]);_0x3dcaa5['offset']=qs[_0xd9ba('0x26')](_0x312656[_0xd9ba('0x35')][_0xd9ba('0x26')]);}_0x3dcaa5['order']=qs['sort'](_0x312656[_0xd9ba('0x35')]['sort']);_0x3dcaa5[_0xd9ba('0x3c')]=qs[_0xd9ba('0x36')](_['pick'](_0x312656['query'],_0x56cb9f[_0xd9ba('0x36')]));if(_0x312656[_0xd9ba('0x35')]['filter']){_0x3dcaa5[_0xd9ba('0x3c')]=_[_0xd9ba('0x3d')](_0x3dcaa5[_0xd9ba('0x3c')],{'$or':_[_0xd9ba('0x3e')](_0x50470d,function(_0x47e8e5){if(_0x47e8e5[_0xd9ba('0x3f')][_0xd9ba('0x40')]!=='VIRTUAL'){var _0x5178f2={};_0x5178f2[_0x47e8e5[_0xd9ba('0x41')]]={'$like':'%'+_0x312656['query'][_0xd9ba('0x42')]+'%'};return _0x5178f2;}})});}_0x3dcaa5=_[_0xd9ba('0x3d')]({},_0x3dcaa5,_0x312656[_0xd9ba('0x43')]);var _0xeac07b={'where':_0x3dcaa5['where']};return db[_0xd9ba('0x32')][_0xd9ba('0x25')](_0xeac07b)[_0xd9ba('0x2b')](function(_0x3c4b37){_0x415819[_0xd9ba('0x25')]=_0x3c4b37;if(_0x312656[_0xd9ba('0x35')][_0xd9ba('0x44')]){_0x3dcaa5[_0xd9ba('0x45')]=[{'all':!![]}];}return db[_0xd9ba('0x32')]['findAll'](_0x3dcaa5);})['then'](function(_0x25352f){_0x415819[_0xd9ba('0x46')]=_0x25352f;return _0x415819;})[_0xd9ba('0x2b')](respondWithFilteredResult(_0x5548aa,_0x3dcaa5))[_0xd9ba('0x47')](handleError(_0x5548aa,null));};exports[_0xd9ba('0x48')]=function(_0x314c34,_0x13fe80){var _0xc5ea47={'raw':![],'where':{'id':_0x314c34[_0xd9ba('0x49')]['id']}},_0x4e208d={};_0x4e208d[_0xd9ba('0x33')]=_[_0xd9ba('0x34')](db['SugarcrmConfiguration'][_0xd9ba('0x4a')]);_0x4e208d[_0xd9ba('0x35')]=_[_0xd9ba('0x34')](_0x314c34[_0xd9ba('0x35')]);_0x4e208d[_0xd9ba('0x36')]=_[_0xd9ba('0x37')](_0x4e208d[_0xd9ba('0x33')],_0x4e208d[_0xd9ba('0x35')]);_0xc5ea47[_0xd9ba('0x39')]=_[_0xd9ba('0x37')](_0x4e208d[_0xd9ba('0x33')],qs[_0xd9ba('0x38')](_0x314c34[_0xd9ba('0x35')][_0xd9ba('0x38')]));_0xc5ea47['attributes']=_0xc5ea47[_0xd9ba('0x39')][_0xd9ba('0x3a')]?_0xc5ea47[_0xd9ba('0x39')]:_0x4e208d['model'];if(_0x314c34[_0xd9ba('0x35')][_0xd9ba('0x44')]){_0xc5ea47[_0xd9ba('0x45')]=[{'all':!![]}];}_0xc5ea47=_[_0xd9ba('0x3d')]({},_0xc5ea47,_0x314c34[_0xd9ba('0x43')]);return db[_0xd9ba('0x32')][_0xd9ba('0x4b')](_0xc5ea47)[_0xd9ba('0x2b')](handleEntityNotFound(_0x13fe80,null))[_0xd9ba('0x2b')](respondWithResult(_0x13fe80,null))[_0xd9ba('0x47')](handleError(_0x13fe80,null));};exports[_0xd9ba('0x4c')]=function(_0x3fbbc2,_0x5862c0){return db['SugarcrmConfiguration'][_0xd9ba('0x4c')](_0x3fbbc2[_0xd9ba('0x4d')],{})['then'](respondWithResult(_0x5862c0,0xc9))[_0xd9ba('0x47')](handleError(_0x5862c0,null));};exports[_0xd9ba('0x4e')]=function(_0x45c61c,_0x152148){if(_0x45c61c[_0xd9ba('0x4d')]['id']){delete _0x45c61c[_0xd9ba('0x4d')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x45c61c[_0xd9ba('0x49')]['id']}})['then'](handleEntityNotFound(_0x152148,null))[_0xd9ba('0x2b')](saveUpdates(_0x45c61c['body'],null))['then'](respondWithResult(_0x152148,null))[_0xd9ba('0x47')](handleError(_0x152148,null));};exports['destroy']=function(_0x54b4fd,_0x44f2c0){return db[_0xd9ba('0x32')][_0xd9ba('0x4b')]({'where':{'id':_0x54b4fd['params']['id']}})[_0xd9ba('0x2b')](handleEntityNotFound(_0x44f2c0,null))[_0xd9ba('0x2b')](removeEntity(_0x44f2c0,null))[_0xd9ba('0x47')](handleError(_0x44f2c0,null));};exports[_0xd9ba('0x4f')]=function(_0x3ea911,_0x587c23,_0x4e9f41){var _0x2d3e78={};var _0x2bc9e4={};var _0xd8dce7;var _0x232007;return db[_0xd9ba('0x32')][_0xd9ba('0x50')]({'where':{'id':_0x3ea911[_0xd9ba('0x49')]['id']}})['then'](handleEntityNotFound(_0x587c23,null))[_0xd9ba('0x2b')](function(_0x2b6726){if(_0x2b6726){_0xd8dce7=_0x2b6726;_0x2bc9e4[_0xd9ba('0x33')]=_[_0xd9ba('0x34')](db['SugarcrmField'][_0xd9ba('0x4a')]);_0x2bc9e4['query']=_[_0xd9ba('0x34')](_0x3ea911[_0xd9ba('0x35')]);_0x2bc9e4[_0xd9ba('0x36')]=_[_0xd9ba('0x37')](_0x2bc9e4[_0xd9ba('0x33')],_0x2bc9e4[_0xd9ba('0x35')]);_0x2d3e78[_0xd9ba('0x39')]=_[_0xd9ba('0x37')](_0x2bc9e4[_0xd9ba('0x33')],qs['fields'](_0x3ea911['query'][_0xd9ba('0x38')]));_0x2d3e78[_0xd9ba('0x39')]=_0x2d3e78['attributes'][_0xd9ba('0x3a')]?_0x2d3e78[_0xd9ba('0x39')]:_0x2bc9e4['model'];_0x2d3e78[_0xd9ba('0x51')]=qs[_0xd9ba('0x52')](_0x3ea911['query'][_0xd9ba('0x52')]);_0x2d3e78[_0xd9ba('0x3c')]=qs[_0xd9ba('0x36')](_[_0xd9ba('0x53')](_0x3ea911[_0xd9ba('0x35')],_0x2bc9e4[_0xd9ba('0x36')]));if(_0x3ea911['query'][_0xd9ba('0x42')]){_0x2d3e78['where']=_['merge'](_0x2d3e78[_0xd9ba('0x3c')],{'$or':_[_0xd9ba('0x3e')](_0x2d3e78[_0xd9ba('0x39')],function(_0x3b5dc7){var _0x56e739={};_0x56e739[_0x3b5dc7]={'$like':'%'+_0x3ea911[_0xd9ba('0x35')][_0xd9ba('0x42')]+'%'};return _0x56e739;})});}_0x2d3e78=_['merge']({},_0x2d3e78,_0x3ea911[_0xd9ba('0x43')]);return _0xd8dce7[_0xd9ba('0x4f')](_0x2d3e78);}})['then'](function(_0x199fbc){if(_0x199fbc){_0x232007=_0x199fbc[_0xd9ba('0x3a')];if(!_0x3ea911[_0xd9ba('0x35')][_0xd9ba('0x3b')]('nolimit')){_0x2d3e78['limit']=qs[_0xd9ba('0x27')](_0x3ea911[_0xd9ba('0x35')][_0xd9ba('0x27')]);_0x2d3e78['offset']=qs[_0xd9ba('0x26')](_0x3ea911[_0xd9ba('0x35')]['offset']);}return _0xd8dce7[_0xd9ba('0x4f')](_0x2d3e78);}})[_0xd9ba('0x2b')](function(_0x1dae03){if(_0x1dae03){return _0x1dae03?{'count':_0x232007,'rows':_0x1dae03}:null;}})[_0xd9ba('0x2b')](respondWithResult(_0x587c23,null))[_0xd9ba('0x47')](handleError(_0x587c23,null));};exports['getSubjects']=function(_0x5099c4,_0x1547cd,_0x4c0f74){var _0x76df92={};var _0x550c3f={};var _0x3bf10d;var _0x133281;return db['SugarcrmConfiguration'][_0xd9ba('0x50')]({'where':{'id':_0x5099c4[_0xd9ba('0x49')]['id']}})[_0xd9ba('0x2b')](handleEntityNotFound(_0x1547cd,null))[_0xd9ba('0x2b')](function(_0x90868e){if(_0x90868e){_0x3bf10d=_0x90868e;_0x550c3f[_0xd9ba('0x33')]=_['keys'](db[_0xd9ba('0x54')][_0xd9ba('0x4a')]);_0x550c3f['query']=_[_0xd9ba('0x34')](_0x5099c4[_0xd9ba('0x35')]);_0x550c3f[_0xd9ba('0x36')]=_[_0xd9ba('0x37')](_0x550c3f['model'],_0x550c3f[_0xd9ba('0x35')]);_0x76df92[_0xd9ba('0x39')]=_[_0xd9ba('0x37')](_0x550c3f[_0xd9ba('0x33')],qs['fields'](_0x5099c4[_0xd9ba('0x35')][_0xd9ba('0x38')]));_0x76df92['attributes']=_0x76df92[_0xd9ba('0x39')][_0xd9ba('0x3a')]?_0x76df92[_0xd9ba('0x39')]:_0x550c3f[_0xd9ba('0x33')];_0x76df92['order']=qs[_0xd9ba('0x52')](_0x5099c4[_0xd9ba('0x35')][_0xd9ba('0x52')]);_0x76df92[_0xd9ba('0x3c')]=qs[_0xd9ba('0x36')](_[_0xd9ba('0x53')](_0x5099c4['query'],_0x550c3f[_0xd9ba('0x36')]));if(_0x5099c4['query']['filter']){_0x76df92[_0xd9ba('0x3c')]=_['merge'](_0x76df92[_0xd9ba('0x3c')],{'$or':_[_0xd9ba('0x3e')](_0x76df92[_0xd9ba('0x39')],function(_0x46c7a4){var _0x1e8c79={};_0x1e8c79[_0x46c7a4]={'$like':'%'+_0x5099c4[_0xd9ba('0x35')][_0xd9ba('0x42')]+'%'};return _0x1e8c79;})});}_0x76df92=_[_0xd9ba('0x3d')]({},_0x76df92,_0x5099c4[_0xd9ba('0x43')]);return _0x3bf10d[_0xd9ba('0x55')](_0x76df92);}})[_0xd9ba('0x2b')](function(_0x530410){if(_0x530410){_0x133281=_0x530410[_0xd9ba('0x3a')];if(!_0x5099c4['query'][_0xd9ba('0x3b')]('nolimit')){_0x76df92[_0xd9ba('0x27')]=qs[_0xd9ba('0x27')](_0x5099c4['query'][_0xd9ba('0x27')]);_0x76df92[_0xd9ba('0x26')]=qs[_0xd9ba('0x26')](_0x5099c4['query'][_0xd9ba('0x26')]);}return _0x3bf10d[_0xd9ba('0x55')](_0x76df92);}})[_0xd9ba('0x2b')](function(_0x2ecf68){if(_0x2ecf68){return _0x2ecf68?{'count':_0x133281,'rows':_0x2ecf68}:null;}})['then'](respondWithResult(_0x1547cd,null))[_0xd9ba('0x47')](handleError(_0x1547cd,null));};exports[_0xd9ba('0x56')]=function(_0x467ea1,_0x3a749f,_0x2bfce9){var _0x268e30={};var _0x1d6cb5={};var _0x54140f;var _0x55c9fa;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x467ea1[_0xd9ba('0x49')]['id']}})[_0xd9ba('0x2b')](handleEntityNotFound(_0x3a749f,null))[_0xd9ba('0x2b')](function(_0x25b387){if(_0x25b387){_0x54140f=_0x25b387;_0x1d6cb5[_0xd9ba('0x33')]=_[_0xd9ba('0x34')](db[_0xd9ba('0x54')][_0xd9ba('0x4a')]);_0x1d6cb5[_0xd9ba('0x35')]=_[_0xd9ba('0x34')](_0x467ea1[_0xd9ba('0x35')]);_0x1d6cb5['filters']=_[_0xd9ba('0x37')](_0x1d6cb5[_0xd9ba('0x33')],_0x1d6cb5[_0xd9ba('0x35')]);_0x268e30['attributes']=_['intersection'](_0x1d6cb5['model'],qs[_0xd9ba('0x38')](_0x467ea1['query']['fields']));_0x268e30['attributes']=_0x268e30[_0xd9ba('0x39')][_0xd9ba('0x3a')]?_0x268e30[_0xd9ba('0x39')]:_0x1d6cb5[_0xd9ba('0x33')];_0x268e30['order']=qs[_0xd9ba('0x52')](_0x467ea1[_0xd9ba('0x35')][_0xd9ba('0x52')]);_0x268e30['where']=qs[_0xd9ba('0x36')](_['pick'](_0x467ea1[_0xd9ba('0x35')],_0x1d6cb5[_0xd9ba('0x36')]));if(_0x467ea1[_0xd9ba('0x35')][_0xd9ba('0x42')]){_0x268e30[_0xd9ba('0x3c')]=_['merge'](_0x268e30['where'],{'$or':_[_0xd9ba('0x3e')](_0x268e30[_0xd9ba('0x39')],function(_0x3743b1){var _0x1b40f9={};_0x1b40f9[_0x3743b1]={'$like':'%'+_0x467ea1[_0xd9ba('0x35')][_0xd9ba('0x42')]+'%'};return _0x1b40f9;})});}_0x268e30=_[_0xd9ba('0x3d')]({},_0x268e30,_0x467ea1['options']);return _0x54140f[_0xd9ba('0x56')](_0x268e30);}})[_0xd9ba('0x2b')](function(_0x34dae4){if(_0x34dae4){_0x55c9fa=_0x34dae4['length'];if(!_0x467ea1[_0xd9ba('0x35')]['hasOwnProperty'](_0xd9ba('0x57'))){_0x268e30[_0xd9ba('0x27')]=qs[_0xd9ba('0x27')](_0x467ea1[_0xd9ba('0x35')]['limit']);_0x268e30['offset']=qs[_0xd9ba('0x26')](_0x467ea1[_0xd9ba('0x35')][_0xd9ba('0x26')]);}return _0x54140f[_0xd9ba('0x56')](_0x268e30);}})[_0xd9ba('0x2b')](function(_0x42419c){if(_0x42419c){return _0x42419c?{'count':_0x55c9fa,'rows':_0x42419c}:null;}})[_0xd9ba('0x2b')](respondWithResult(_0x3a749f,null))['catch'](handleError(_0x3a749f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 607bd4c..7a25bfc 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 _0x1485=['util','../../config/logger','api','bluebird','./intSugarcrmConfiguration.attributes','exports','int_sugarcrm_configurations'];(function(_0x245eab,_0x4b408d){var _0x30fcd2=function(_0x2fbfe8){while(--_0x2fbfe8){_0x245eab['push'](_0x245eab['shift']());}};_0x30fcd2(++_0x4b408d);}(_0x1485,0x77));var _0x5148=function(_0x2c2b3c,_0x3bd1d5){_0x2c2b3c=_0x2c2b3c-0x0;var _0x142906=_0x1485[_0x2c2b3c];return _0x142906;};'use strict';var _=require('lodash');var util=require(_0x5148('0x0'));var logger=require(_0x5148('0x1'))(_0x5148('0x2'));var moment=require('moment');var BPromise=require(_0x5148('0x3'));var rp=require('request-promise');var attributes=require(_0x5148('0x4'));module[_0x5148('0x5')]=function(_0x2ccc77,_0x4c539b){return _0x2ccc77['define']('SugarcrmConfiguration',attributes,{'tableName':_0x5148('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1f4=['util','moment','bluebird','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations'];(function(_0x331a31,_0x116709){var _0x521de0=function(_0x104a03){while(--_0x104a03){_0x331a31['push'](_0x331a31['shift']());}};_0x521de0(++_0x116709);}(_0xd1f4,0xa8));var _0x4d1f=function(_0x1219ac,_0xf5c1ac){_0x1219ac=_0x1219ac-0x0;var _0x2bafe5=_0xd1f4[_0x1219ac];return _0x2bafe5;};'use strict';var _=require('lodash');var util=require(_0x4d1f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4d1f('0x1'));var BPromise=require(_0x4d1f('0x2'));var rp=require('request-promise');var attributes=require(_0x4d1f('0x3'));module['exports']=function(_0x496881,_0x20bdde){return _0x496881[_0x4d1f('0x4')]('SugarcrmConfiguration',attributes,{'tableName':_0x4d1f('0x5'),'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 1f7f9c9..6058926 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 _0xff76=['util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x429256,_0x47b456){var _0x27b1a1=function(_0x4da794){while(--_0x4da794){_0x429256['push'](_0x429256['shift']());}};_0x27b1a1(++_0x47b456);}(_0xff76,0x87));var _0x6ff7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff76[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6ff7('0x0'));var util=require(_0x6ff7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6ff7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ff7('0x3'))['db'];var utils=require(_0x6ff7('0x4'));var logger=require(_0x6ff7('0x5'))(_0x6ff7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd8dac2,_0x435d01,_0x215811){return new BPromise(function(_0x3159ce,_0xbff263){return client['request'](_0xd8dac2,_0x215811)['then'](function(_0x2a59ef){logger[_0x6ff7('0x7')](_0x6ff7('0x8'),_0x435d01,_0x6ff7('0x9'));logger[_0x6ff7('0xa')](_0x6ff7('0xb'),_0x435d01,_0x6ff7('0x9'),JSON['stringify'](_0x2a59ef));if(_0x2a59ef[_0x6ff7('0xc')]){if(_0x2a59ef[_0x6ff7('0xc')][_0x6ff7('0xd')]===0x1f4){logger[_0x6ff7('0xc')](_0x6ff7('0x8'),_0x435d01,_0x2a59ef[_0x6ff7('0xc')][_0x6ff7('0xe')]);return _0xbff263(_0x2a59ef[_0x6ff7('0xc')][_0x6ff7('0xe')]);}logger[_0x6ff7('0xc')](_0x6ff7('0x8'),_0x435d01,_0x2a59ef[_0x6ff7('0xc')][_0x6ff7('0xe')]);return _0x3159ce(_0x2a59ef['error'][_0x6ff7('0xe')]);}else{logger[_0x6ff7('0x7')](_0x6ff7('0x8'),_0x435d01,_0x6ff7('0x9'));_0x3159ce(_0x2a59ef[_0x6ff7('0xf')][_0x6ff7('0xe')]);}})[_0x6ff7('0x10')](function(_0x6641e6){logger[_0x6ff7('0xc')](_0x6ff7('0x8'),_0x435d01,_0x6641e6);_0xbff263(_0x6641e6);});});} \ No newline at end of file +var _0x6e8e=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x1e53ab,_0x28ec50){var _0x2042ec=function(_0x339334){while(--_0x339334){_0x1e53ab['push'](_0x1e53ab['shift']());}};_0x2042ec(++_0x28ec50);}(_0x6e8e,0xba));var _0xe6e8=function(_0xc6d111,_0x5bd107){_0xc6d111=_0xc6d111-0x0;var _0x8ed673=_0x6e8e[_0xc6d111];return _0x8ed673;};'use strict';var _=require(_0xe6e8('0x0'));var util=require('util');var moment=require(_0xe6e8('0x1'));var BPromise=require(_0xe6e8('0x2'));var rs=require(_0xe6e8('0x3'));var fs=require('fs');var Redis=require(_0xe6e8('0x4'));var db=require(_0xe6e8('0x5'))['db'];var utils=require(_0xe6e8('0x6'));var logger=require('../../config/logger')(_0xe6e8('0x7'));var config=require(_0xe6e8('0x8'));var jayson=require(_0xe6e8('0x9'));var client=jayson[_0xe6e8('0xa')][_0xe6e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52eba2,_0x62e2b1,_0x5d80aa){return new BPromise(function(_0x69e88b,_0xc8c5d1){return client['request'](_0x52eba2,_0x5d80aa)[_0xe6e8('0xc')](function(_0x298185){logger[_0xe6e8('0xd')](_0xe6e8('0xe'),_0x62e2b1,'request\x20sent');logger[_0xe6e8('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x62e2b1,_0xe6e8('0x10'),JSON[_0xe6e8('0x11')](_0x298185));if(_0x298185[_0xe6e8('0x12')]){if(_0x298185['error'][_0xe6e8('0x13')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x62e2b1,_0x298185[_0xe6e8('0x12')][_0xe6e8('0x14')]);return _0xc8c5d1(_0x298185[_0xe6e8('0x12')][_0xe6e8('0x14')]);}logger[_0xe6e8('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x62e2b1,_0x298185[_0xe6e8('0x12')][_0xe6e8('0x14')]);return _0x69e88b(_0x298185['error'][_0xe6e8('0x14')]);}else{logger[_0xe6e8('0xd')](_0xe6e8('0xe'),_0x62e2b1,_0xe6e8('0x10'));_0x69e88b(_0x298185[_0xe6e8('0x15')][_0xe6e8('0x14')]);}})[_0xe6e8('0x16')](function(_0xbfa523){logger[_0xe6e8('0x12')](_0xe6e8('0xe'),_0x62e2b1,_0xbfa523);_0xc8c5d1(_0xbfa523);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 0dfab37..3335990 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 _0xffec=['create','put','delete','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x50da6d,_0x2e91c4){var _0x3a78a3=function(_0x1a8a5b){while(--_0x1a8a5b){_0x50da6d['push'](_0x50da6d['shift']());}};_0x3a78a3(++_0x2e91c4);}(_0xffec,0x1df));var _0xcffe=function(_0x526426,_0x88278c){_0x526426=_0x526426-0x0;var _0x438994=_0xffec[_0x526426];return _0x438994;};'use strict';var multer=require(_0xcffe('0x0'));var util=require('util');var path=require(_0xcffe('0x1'));var timeout=require(_0xcffe('0x2'));var express=require(_0xcffe('0x3'));var router=express['Router']();var auth=require(_0xcffe('0x4'));var interaction=require(_0xcffe('0x5'));var config=require(_0xcffe('0x6'));var controller=require(_0xcffe('0x7'));router[_0xcffe('0x8')]('/',auth[_0xcffe('0x9')](),controller[_0xcffe('0xa')]);router[_0xcffe('0x8')](_0xcffe('0xb'),auth[_0xcffe('0x9')](),controller[_0xcffe('0xc')]);router[_0xcffe('0xd')]('/',auth[_0xcffe('0x9')](),controller[_0xcffe('0xe')]);router[_0xcffe('0xf')]('/:id',auth[_0xcffe('0x9')](),controller['update']);router[_0xcffe('0x10')](_0xcffe('0xb'),auth[_0xcffe('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xad3a=['./intSugarcrmField.controller','get','isAuthenticated','index','show','post','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3308d4,_0x1a6e41){var _0x1fe36b=function(_0x345a61){while(--_0x345a61){_0x3308d4['push'](_0x3308d4['shift']());}};_0x1fe36b(++_0x1a6e41);}(_0xad3a,0x13d));var _0xaad3=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xad3a[_0x43f881];return _0x365c14;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaad3('0x0'));var timeout=require(_0xaad3('0x1'));var express=require(_0xaad3('0x2'));var router=express[_0xaad3('0x3')]();var auth=require(_0xaad3('0x4'));var interaction=require(_0xaad3('0x5'));var config=require(_0xaad3('0x6'));var controller=require(_0xaad3('0x7'));router[_0xaad3('0x8')]('/',auth[_0xaad3('0x9')](),controller[_0xaad3('0xa')]);router['get']('/:id',auth[_0xaad3('0x9')](),controller[_0xaad3('0xb')]);router[_0xaad3('0xc')]('/',auth[_0xaad3('0x9')](),controller['create']);router['put'](_0xaad3('0xd'),auth[_0xaad3('0x9')](),controller[_0xaad3('0xe')]);router[_0xaad3('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xaad3('0x10')]);module[_0xaad3('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 e3bbbfd..6e91e31 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 _0xd64b=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x4fbe65,_0x2a744d){var _0x10ade2=function(_0x416f4e){while(--_0x416f4e){_0x4fbe65['push'](_0x4fbe65['shift']());}};_0x10ade2(++_0x2a744d);}(_0xd64b,0xc1));var _0xbd64=function(_0x21f8a8,_0x1d7071){_0x21f8a8=_0x21f8a8-0x0;var _0x21d3d5=_0xd64b[_0x21f8a8];return _0x21d3d5;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'type':{'type':Sequelize[_0xbd64('0x1')]('string',_0xbd64('0x2'),_0xbd64('0x3'),_0xbd64('0x4')),'defaultValue':_0xbd64('0x5')},'content':{'type':Sequelize[_0xbd64('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xbd64('0x3'))},'keyContent':{'type':Sequelize[_0xbd64('0x6')]},'idField':{'type':Sequelize[_0xbd64('0x6')]},'nameField':{'type':Sequelize[_0xbd64('0x6')]},'customField':{'type':Sequelize[_0xbd64('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd64('0x6')]}}; \ No newline at end of file +var _0x3c81=['customVariable','BOOLEAN','sequelize','exports','string','variable','STRING','ENUM'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3c81,0x102));var _0x13c8=function(_0x252a87,_0x451c46){_0x252a87=_0x252a87-0x0;var _0x40ead3=_0x3c81[_0x252a87];return _0x40ead3;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x13c8('0x2'),_0x13c8('0x3'),'customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x13c8('0x4')]},'keyType':{'type':Sequelize[_0x13c8('0x5')](_0x13c8('0x2'),_0x13c8('0x3'),_0x13c8('0x6'))},'keyContent':{'type':Sequelize[_0x13c8('0x4')]},'idField':{'type':Sequelize[_0x13c8('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 944790f..8e5a4e5 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 _0x0f44=['name','index','SugarcrmField','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','field','options','includeAll','findAll','catch','show','params','include','find','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f44,0x173));var _0x40f4=function(_0x1797dd,_0x3e7c78){_0x1797dd=_0x1797dd-0x0;var _0x5e5e3d=_0x0f44[_0x1797dd];return _0x5e5e3d;};'use strict';var pdf=require(_0x40f4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x40f4('0x1'));var jsonpatch=require(_0x40f4('0x2'));var rp=require(_0x40f4('0x3'));var moment=require(_0x40f4('0x4'));var BPromise=require(_0x40f4('0x5'));var Mustache=require(_0x40f4('0x6'));var util=require('util');var path=require(_0x40f4('0x7'));var sox=require(_0x40f4('0x8'));var csv=require(_0x40f4('0x9'));var ejs=require(_0x40f4('0xa'));var fs=require('fs');var _=require(_0x40f4('0xb'));var squel=require('squel');var crypto=require(_0x40f4('0xc'));var jsforce=require(_0x40f4('0xd'));var deskjs=require(_0x40f4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x40f4('0xf'));var Papa=require(_0x40f4('0x10'));var authService=require(_0x40f4('0x11'));var hardwareService=require(_0x40f4('0x12'));var Redis=require(_0x40f4('0x13'));var qs=require(_0x40f4('0x14'));var logger=require(_0x40f4('0x15'))('api');var utils=require(_0x40f4('0x16'));var config=require(_0x40f4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e81be,_0x43dc64){_0x43dc64=_0x43dc64||0xcc;return function(_0x4f38ed){if(_0x4f38ed){return _0x1e81be[_0x40f4('0x18')](_0x43dc64);}return _0x1e81be[_0x40f4('0x19')](_0x43dc64)[_0x40f4('0x1a')]();};}function respondWithResult(_0x2d06d2,_0x5cacc4){_0x5cacc4=_0x5cacc4||0xc8;return function(_0x18bc8f){if(_0x18bc8f){return _0x2d06d2[_0x40f4('0x19')](_0x5cacc4)[_0x40f4('0x1b')](_0x18bc8f);}};}function respondWithFilteredResult(_0x149c8f,_0xd6e979){return function(_0x282939){if(_0x282939){var _0x760cb1=_0x282939[_0x40f4('0x1c')],_0x4ca06b=_0xd6e979[_0x40f4('0x1d')],_0x28de68=_0xd6e979[_0x40f4('0x1d')]+_0xd6e979[_0x40f4('0x1e')],_0x42dc93;if(_0x28de68>=_0x760cb1){_0x28de68=_0x760cb1;_0x42dc93=0xc8;}else{_0x42dc93=0xce;}_0x149c8f[_0x40f4('0x19')](_0x42dc93);return _0x149c8f['set']('Content-Range',_0x4ca06b+'-'+_0x28de68+'/'+_0x760cb1)[_0x40f4('0x1b')](_0x282939);}return null;};}function patchUpdates(_0x2b53e0){return function(_0x1eab8e){try{jsonpatch[_0x40f4('0x1f')](_0x1eab8e,_0x2b53e0,!![]);}catch(_0xf0b4dc){return BPromise[_0x40f4('0x20')](_0xf0b4dc);}return _0x1eab8e[_0x40f4('0x21')]();};}function saveUpdates(_0x52110c,_0x34a505){return function(_0x21da6c){if(_0x21da6c){return _0x21da6c[_0x40f4('0x22')](_0x52110c)[_0x40f4('0x23')](function(_0x206863){return _0x206863;});}return null;};}function removeEntity(_0xa952b9,_0x199e35){return function(_0x41b068){if(_0x41b068){return _0x41b068[_0x40f4('0x24')]()[_0x40f4('0x23')](function(){_0xa952b9[_0x40f4('0x19')](0xcc)[_0x40f4('0x1a')]();});}};}function handleEntityNotFound(_0x16d707,_0xb54c61){return function(_0x492461){if(!_0x492461){_0x16d707['sendStatus'](0x194);}return _0x492461;};}function handleError(_0x3b8612,_0x1acd14){_0x1acd14=_0x1acd14||0x1f4;return function(_0x26ac59){logger['error'](_0x26ac59['stack']);if(_0x26ac59[_0x40f4('0x25')]){delete _0x26ac59[_0x40f4('0x25')];}_0x3b8612[_0x40f4('0x19')](_0x1acd14)['send'](_0x26ac59);};}exports[_0x40f4('0x26')]=function(_0x44d264,_0x3ab961){var _0x231135={},_0x5fd81a={},_0x3be037={'count':0x0,'rows':[]};var _0x236a1f=db[_0x40f4('0x27')][_0x40f4('0x28')];_0x5fd81a['model']=_[_0x40f4('0x29')](_0x236a1f);_0x5fd81a[_0x40f4('0x2a')]=_[_0x40f4('0x29')](_0x44d264[_0x40f4('0x2a')]);_0x5fd81a[_0x40f4('0x2b')]=_[_0x40f4('0x2c')](_0x5fd81a[_0x40f4('0x2d')],_0x5fd81a[_0x40f4('0x2a')]);_0x231135[_0x40f4('0x2e')]=_[_0x40f4('0x2c')](_0x5fd81a[_0x40f4('0x2d')],qs[_0x40f4('0x2f')](_0x44d264[_0x40f4('0x2a')]['fields']));_0x231135[_0x40f4('0x2e')]=_0x231135[_0x40f4('0x2e')][_0x40f4('0x30')]?_0x231135[_0x40f4('0x2e')]:_0x5fd81a['model'];if(!_0x44d264['query'][_0x40f4('0x31')](_0x40f4('0x32'))){_0x231135[_0x40f4('0x1e')]=qs[_0x40f4('0x1e')](_0x44d264[_0x40f4('0x2a')][_0x40f4('0x1e')]);_0x231135[_0x40f4('0x1d')]=qs[_0x40f4('0x1d')](_0x44d264['query'][_0x40f4('0x1d')]);}_0x231135[_0x40f4('0x33')]=qs['sort'](_0x44d264[_0x40f4('0x2a')][_0x40f4('0x34')]);_0x231135['where']=qs[_0x40f4('0x2b')](_[_0x40f4('0x35')](_0x44d264[_0x40f4('0x2a')],_0x5fd81a[_0x40f4('0x2b')]));if(_0x44d264['query'][_0x40f4('0x36')]){_0x231135[_0x40f4('0x37')]=_[_0x40f4('0x38')](_0x231135[_0x40f4('0x37')],{'$or':_['map'](_0x236a1f,function(_0x1ebb97){if(_0x1ebb97[_0x40f4('0x39')]['key']!==_0x40f4('0x3a')){var _0x14749b={};_0x14749b[_0x1ebb97[_0x40f4('0x3b')]]={'$like':'%'+_0x44d264['query']['filter']+'%'};return _0x14749b;}})});}_0x231135=_[_0x40f4('0x38')]({},_0x231135,_0x44d264[_0x40f4('0x3c')]);var _0x140623={'where':_0x231135[_0x40f4('0x37')]};return db['SugarcrmField'][_0x40f4('0x1c')](_0x140623)[_0x40f4('0x23')](function(_0x3a5f44){_0x3be037[_0x40f4('0x1c')]=_0x3a5f44;if(_0x44d264[_0x40f4('0x2a')][_0x40f4('0x3d')]){_0x231135['include']=[{'all':!![]}];}return db[_0x40f4('0x27')][_0x40f4('0x3e')](_0x231135);})[_0x40f4('0x23')](function(_0x1a4d73){_0x3be037['rows']=_0x1a4d73;return _0x3be037;})[_0x40f4('0x23')](respondWithFilteredResult(_0x3ab961,_0x231135))[_0x40f4('0x3f')](handleError(_0x3ab961,null));};exports[_0x40f4('0x40')]=function(_0xd97f29,_0x4299d9){var _0x10849e={'raw':!![],'where':{'id':_0xd97f29[_0x40f4('0x41')]['id']}},_0x3552f4={};_0x3552f4[_0x40f4('0x2d')]=_[_0x40f4('0x29')](db[_0x40f4('0x27')][_0x40f4('0x28')]);_0x3552f4[_0x40f4('0x2a')]=_[_0x40f4('0x29')](_0xd97f29[_0x40f4('0x2a')]);_0x3552f4[_0x40f4('0x2b')]=_[_0x40f4('0x2c')](_0x3552f4[_0x40f4('0x2d')],_0x3552f4[_0x40f4('0x2a')]);_0x10849e[_0x40f4('0x2e')]=_[_0x40f4('0x2c')](_0x3552f4[_0x40f4('0x2d')],qs[_0x40f4('0x2f')](_0xd97f29[_0x40f4('0x2a')][_0x40f4('0x2f')]));_0x10849e[_0x40f4('0x2e')]=_0x10849e[_0x40f4('0x2e')][_0x40f4('0x30')]?_0x10849e[_0x40f4('0x2e')]:_0x3552f4[_0x40f4('0x2d')];if(_0xd97f29[_0x40f4('0x2a')][_0x40f4('0x3d')]){_0x10849e[_0x40f4('0x42')]=[{'all':!![]}];}_0x10849e=_['merge']({},_0x10849e,_0xd97f29[_0x40f4('0x3c')]);return db[_0x40f4('0x27')][_0x40f4('0x43')](_0x10849e)[_0x40f4('0x23')](handleEntityNotFound(_0x4299d9,null))[_0x40f4('0x23')](respondWithResult(_0x4299d9,null))[_0x40f4('0x3f')](handleError(_0x4299d9,null));};exports['create']=function(_0x5824bf,_0x5c0a7b){return db['SugarcrmField']['create'](_0x5824bf['body'],{})[_0x40f4('0x23')](respondWithResult(_0x5c0a7b,0xc9))[_0x40f4('0x3f')](handleError(_0x5c0a7b,null));};exports['update']=function(_0x389e66,_0x3093a1){if(_0x389e66['body']['id']){delete _0x389e66['body']['id'];}return db[_0x40f4('0x27')]['find']({'where':{'id':_0x389e66['params']['id']}})[_0x40f4('0x23')](handleEntityNotFound(_0x3093a1,null))[_0x40f4('0x23')](saveUpdates(_0x389e66['body'],null))[_0x40f4('0x23')](respondWithResult(_0x3093a1,null))[_0x40f4('0x3f')](handleError(_0x3093a1,null));};exports[_0x40f4('0x24')]=function(_0x75190e,_0x4cb784){return db[_0x40f4('0x27')]['find']({'where':{'id':_0x75190e[_0x40f4('0x41')]['id']}})['then'](handleEntityNotFound(_0x4cb784,null))[_0x40f4('0x23')](removeEntity(_0x4cb784,null))['catch'](handleError(_0x4cb784,null));}; \ No newline at end of file +var _0x54aa=['field','SugarcrmField','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','set','save','update','then','destroy','error','stack','send','index','rawAttributes','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','merge','map','type','key','VIRTUAL'];(function(_0x137e04,_0x3c0799){var _0x4c6762=function(_0x45f489){while(--_0x45f489){_0x137e04['push'](_0x137e04['shift']());}};_0x4c6762(++_0x3c0799);}(_0x54aa,0x1ce));var _0xa54a=function(_0x20919f,_0x1a8ff8){_0x20919f=_0x20919f-0x0;var _0x36fc6a=_0x54aa[_0x20919f];return _0x36fc6a;};'use strict';var pdf=require(_0xa54a('0x0'));var emlformat=require(_0xa54a('0x1'));var rimraf=require(_0xa54a('0x2'));var zipdir=require(_0xa54a('0x3'));var jsonpatch=require(_0xa54a('0x4'));var rp=require('request-promise');var moment=require(_0xa54a('0x5'));var BPromise=require(_0xa54a('0x6'));var Mustache=require(_0xa54a('0x7'));var util=require(_0xa54a('0x8'));var path=require(_0xa54a('0x9'));var sox=require(_0xa54a('0xa'));var csv=require(_0xa54a('0xb'));var ejs=require(_0xa54a('0xc'));var fs=require('fs');var _=require(_0xa54a('0xd'));var squel=require(_0xa54a('0xe'));var crypto=require(_0xa54a('0xf'));var jsforce=require(_0xa54a('0x10'));var deskjs=require(_0xa54a('0x11'));var toCsv=require(_0xa54a('0xb'));var querystring=require(_0xa54a('0x12'));var Papa=require(_0xa54a('0x13'));var authService=require('../../components/auth/service');var hardwareService=require(_0xa54a('0x14'));var Redis=require(_0xa54a('0x15'));var qs=require(_0xa54a('0x16'));var logger=require(_0xa54a('0x17'))(_0xa54a('0x18'));var utils=require(_0xa54a('0x19'));var config=require(_0xa54a('0x1a'));var db=require(_0xa54a('0x1b'))['db'];function respondWithStatusCode(_0x386f45,_0x59d9a8){_0x59d9a8=_0x59d9a8||0xcc;return function(_0x28d4a7){if(_0x28d4a7){return _0x386f45[_0xa54a('0x1c')](_0x59d9a8);}return _0x386f45['status'](_0x59d9a8)[_0xa54a('0x1d')]();};}function respondWithResult(_0xcaa1a9,_0x38831a){_0x38831a=_0x38831a||0xc8;return function(_0x31a4fe){if(_0x31a4fe){return _0xcaa1a9[_0xa54a('0x1e')](_0x38831a)[_0xa54a('0x1f')](_0x31a4fe);}};}function respondWithFilteredResult(_0x122c2c,_0x35fbc0){return function(_0x51ba8a){if(_0x51ba8a){var _0x2936ce=_0x51ba8a[_0xa54a('0x20')],_0x166e35=_0x35fbc0['offset'],_0x4949f0=_0x35fbc0['offset']+_0x35fbc0[_0xa54a('0x21')],_0x535454;if(_0x4949f0>=_0x2936ce){_0x4949f0=_0x2936ce;_0x535454=0xc8;}else{_0x535454=0xce;}_0x122c2c['status'](_0x535454);return _0x122c2c[_0xa54a('0x22')]('Content-Range',_0x166e35+'-'+_0x4949f0+'/'+_0x2936ce)[_0xa54a('0x1f')](_0x51ba8a);}return null;};}function patchUpdates(_0x31b2f2){return function(_0x8c0289){try{jsonpatch['apply'](_0x8c0289,_0x31b2f2,!![]);}catch(_0x302cb6){return BPromise['reject'](_0x302cb6);}return _0x8c0289[_0xa54a('0x23')]();};}function saveUpdates(_0x30757d,_0x2dcb6f){return function(_0x34cf50){if(_0x34cf50){return _0x34cf50[_0xa54a('0x24')](_0x30757d)[_0xa54a('0x25')](function(_0x4996b6){return _0x4996b6;});}return null;};}function removeEntity(_0x115f45,_0x932048){return function(_0x1112b0){if(_0x1112b0){return _0x1112b0[_0xa54a('0x26')]()[_0xa54a('0x25')](function(){_0x115f45['status'](0xcc)[_0xa54a('0x1d')]();});}};}function handleEntityNotFound(_0x5836da,_0x43a428){return function(_0x244892){if(!_0x244892){_0x5836da['sendStatus'](0x194);}return _0x244892;};}function handleError(_0xa0fde6,_0x1f4ed9){_0x1f4ed9=_0x1f4ed9||0x1f4;return function(_0x4bf355){logger[_0xa54a('0x27')](_0x4bf355[_0xa54a('0x28')]);if(_0x4bf355['name']){delete _0x4bf355['name'];}_0xa0fde6['status'](_0x1f4ed9)[_0xa54a('0x29')](_0x4bf355);};}exports[_0xa54a('0x2a')]=function(_0x561161,_0x39267d){var _0x24626c={},_0x3ebe88={},_0x2a8553={'count':0x0,'rows':[]};var _0x1c298d=db['SugarcrmField'][_0xa54a('0x2b')];_0x3ebe88['model']=_['keys'](_0x1c298d);_0x3ebe88['query']=_[_0xa54a('0x2c')](_0x561161['query']);_0x3ebe88[_0xa54a('0x2d')]=_['intersection'](_0x3ebe88[_0xa54a('0x2e')],_0x3ebe88[_0xa54a('0x2f')]);_0x24626c[_0xa54a('0x30')]=_[_0xa54a('0x31')](_0x3ebe88['model'],qs[_0xa54a('0x32')](_0x561161[_0xa54a('0x2f')][_0xa54a('0x32')]));_0x24626c[_0xa54a('0x30')]=_0x24626c[_0xa54a('0x30')][_0xa54a('0x33')]?_0x24626c[_0xa54a('0x30')]:_0x3ebe88[_0xa54a('0x2e')];if(!_0x561161['query'][_0xa54a('0x34')](_0xa54a('0x35'))){_0x24626c[_0xa54a('0x21')]=qs['limit'](_0x561161[_0xa54a('0x2f')][_0xa54a('0x21')]);_0x24626c[_0xa54a('0x36')]=qs[_0xa54a('0x36')](_0x561161[_0xa54a('0x2f')][_0xa54a('0x36')]);}_0x24626c['order']=qs[_0xa54a('0x37')](_0x561161[_0xa54a('0x2f')][_0xa54a('0x37')]);_0x24626c[_0xa54a('0x38')]=qs[_0xa54a('0x2d')](_[_0xa54a('0x39')](_0x561161[_0xa54a('0x2f')],_0x3ebe88[_0xa54a('0x2d')]));if(_0x561161[_0xa54a('0x2f')]['filter']){_0x24626c['where']=_[_0xa54a('0x3a')](_0x24626c['where'],{'$or':_[_0xa54a('0x3b')](_0x1c298d,function(_0x540e28){if(_0x540e28[_0xa54a('0x3c')][_0xa54a('0x3d')]!==_0xa54a('0x3e')){var _0x1b4e52={};_0x1b4e52[_0x540e28[_0xa54a('0x3f')]]={'$like':'%'+_0x561161[_0xa54a('0x2f')]['filter']+'%'};return _0x1b4e52;}})});}_0x24626c=_['merge']({},_0x24626c,_0x561161['options']);var _0xe3b930={'where':_0x24626c[_0xa54a('0x38')]};return db[_0xa54a('0x40')]['count'](_0xe3b930)[_0xa54a('0x25')](function(_0x4430ac){_0x2a8553[_0xa54a('0x20')]=_0x4430ac;if(_0x561161[_0xa54a('0x2f')][_0xa54a('0x41')]){_0x24626c['include']=[{'all':!![]}];}return db[_0xa54a('0x40')][_0xa54a('0x42')](_0x24626c);})['then'](function(_0x261966){_0x2a8553[_0xa54a('0x43')]=_0x261966;return _0x2a8553;})['then'](respondWithFilteredResult(_0x39267d,_0x24626c))[_0xa54a('0x44')](handleError(_0x39267d,null));};exports[_0xa54a('0x45')]=function(_0x368b79,_0x2fe062){var _0x5644f9={'raw':!![],'where':{'id':_0x368b79[_0xa54a('0x46')]['id']}},_0x1ff3f9={};_0x1ff3f9[_0xa54a('0x2e')]=_['keys'](db['SugarcrmField'][_0xa54a('0x2b')]);_0x1ff3f9[_0xa54a('0x2f')]=_[_0xa54a('0x2c')](_0x368b79[_0xa54a('0x2f')]);_0x1ff3f9['filters']=_[_0xa54a('0x31')](_0x1ff3f9[_0xa54a('0x2e')],_0x1ff3f9[_0xa54a('0x2f')]);_0x5644f9['attributes']=_[_0xa54a('0x31')](_0x1ff3f9['model'],qs[_0xa54a('0x32')](_0x368b79[_0xa54a('0x2f')]['fields']));_0x5644f9[_0xa54a('0x30')]=_0x5644f9['attributes'][_0xa54a('0x33')]?_0x5644f9[_0xa54a('0x30')]:_0x1ff3f9['model'];if(_0x368b79[_0xa54a('0x2f')][_0xa54a('0x41')]){_0x5644f9[_0xa54a('0x47')]=[{'all':!![]}];}_0x5644f9=_['merge']({},_0x5644f9,_0x368b79['options']);return db['SugarcrmField'][_0xa54a('0x48')](_0x5644f9)[_0xa54a('0x25')](handleEntityNotFound(_0x2fe062,null))[_0xa54a('0x25')](respondWithResult(_0x2fe062,null))[_0xa54a('0x44')](handleError(_0x2fe062,null));};exports['create']=function(_0x1681b7,_0x2b20eb){return db[_0xa54a('0x40')][_0xa54a('0x49')](_0x1681b7[_0xa54a('0x4a')],{})[_0xa54a('0x25')](respondWithResult(_0x2b20eb,0xc9))['catch'](handleError(_0x2b20eb,null));};exports[_0xa54a('0x24')]=function(_0x19e532,_0x92b102){if(_0x19e532[_0xa54a('0x4a')]['id']){delete _0x19e532[_0xa54a('0x4a')]['id'];}return db[_0xa54a('0x40')][_0xa54a('0x48')]({'where':{'id':_0x19e532[_0xa54a('0x46')]['id']}})['then'](handleEntityNotFound(_0x92b102,null))[_0xa54a('0x25')](saveUpdates(_0x19e532[_0xa54a('0x4a')],null))['then'](respondWithResult(_0x92b102,null))[_0xa54a('0x44')](handleError(_0x92b102,null));};exports[_0xa54a('0x26')]=function(_0x1728dc,_0x54b1f4){return db[_0xa54a('0x40')]['find']({'where':{'id':_0x1728dc['params']['id']}})['then'](handleEntityNotFound(_0x54b1f4,null))[_0xa54a('0x25')](removeEntity(_0x54b1f4,null))[_0xa54a('0x44')](handleError(_0x54b1f4,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 0ab06ec..88a29b1 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 _0x4d2d=['../../config/logger','moment','bluebird','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','util'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0x4d2d,0xbd));var _0xd4d2=function(_0x246426,_0x505c21){_0x246426=_0x246426-0x0;var _0x320fcf=_0x4d2d[_0x246426];return _0x320fcf;};'use strict';var _=require('lodash');var util=require(_0xd4d2('0x0'));var logger=require(_0xd4d2('0x1'))('api');var moment=require(_0xd4d2('0x2'));var BPromise=require(_0xd4d2('0x3'));var rp=require('request-promise');var attributes=require(_0xd4d2('0x4'));module['exports']=function(_0x5aeaf9,_0x263aad){return _0x5aeaf9[_0xd4d2('0x5')](_0xd4d2('0x6'),attributes,{'tableName':_0xd4d2('0x7'),'paranoid':![],'indexes':[{'name':_0xd4d2('0x8'),'fields':[_0xd4d2('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4dfd=['lodash','util','../../config/logger','request-promise','./intSugarcrmField.attributes','exports','sugarcrm_unique_index','idField','FieldId'];(function(_0x388c68,_0x33bf77){var _0xe2c91f=function(_0x4ea352){while(--_0x4ea352){_0x388c68['push'](_0x388c68['shift']());}};_0xe2c91f(++_0x33bf77);}(_0x4dfd,0x129));var _0xd4df=function(_0x27c29e,_0x2c11d5){_0x27c29e=_0x27c29e-0x0;var _0x3a20de=_0x4dfd[_0x27c29e];return _0x3a20de;};'use strict';var _=require(_0xd4df('0x0'));var util=require(_0xd4df('0x1'));var logger=require(_0xd4df('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd4df('0x3'));var attributes=require(_0xd4df('0x4'));module[_0xd4df('0x5')]=function(_0x466dc1,_0x4355b2){return _0x466dc1['define']('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xd4df('0x6'),'fields':[_0xd4df('0x7'),_0xd4df('0x8')],'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 458e888..97d8b4f 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 _0x2074=['stringify','error','code','message','SugarcrmField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5eb36e,_0x35b6f9){var _0x1fe342=function(_0x3c90d3){while(--_0x3c90d3){_0x5eb36e['push'](_0x5eb36e['shift']());}};_0x1fe342(++_0x35b6f9);}(_0x2074,0x10f));var _0x4207=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x2074[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x4207('0x0'));var util=require(_0x4207('0x1'));var moment=require(_0x4207('0x2'));var BPromise=require(_0x4207('0x3'));var rs=require(_0x4207('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4207('0x5'))['db'];var utils=require(_0x4207('0x6'));var logger=require(_0x4207('0x7'))(_0x4207('0x8'));var config=require('../../config/environment');var jayson=require(_0x4207('0x9'));var client=jayson['client'][_0x4207('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x443e6f,_0x5e0f70,_0x1c4728){return new BPromise(function(_0x40fe6e,_0x1bd72a){return client['request'](_0x443e6f,_0x1c4728)[_0x4207('0xb')](function(_0x3b9b20){logger[_0x4207('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x5e0f70,'request\x20sent');logger['debug'](_0x4207('0xd'),_0x5e0f70,_0x4207('0xe'),JSON[_0x4207('0xf')](_0x3b9b20));if(_0x3b9b20[_0x4207('0x10')]){if(_0x3b9b20[_0x4207('0x10')][_0x4207('0x11')]===0x1f4){logger[_0x4207('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x5e0f70,_0x3b9b20[_0x4207('0x10')][_0x4207('0x12')]);return _0x1bd72a(_0x3b9b20['error'][_0x4207('0x12')]);}logger[_0x4207('0x10')](_0x4207('0x13'),_0x5e0f70,_0x3b9b20['error']['message']);return _0x40fe6e(_0x3b9b20[_0x4207('0x10')][_0x4207('0x12')]);}else{logger['info'](_0x4207('0x13'),_0x5e0f70,_0x4207('0xe'));_0x40fe6e(_0x3b9b20[_0x4207('0x14')][_0x4207('0x12')]);}})[_0x4207('0x15')](function(_0xcd3138){logger[_0x4207('0x10')](_0x4207('0x13'),_0x5e0f70,_0xcd3138);_0x1bd72a(_0xcd3138);});});} \ No newline at end of file +var _0x1dde=['client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1dde,0x186));var _0xe1dd=function(_0x14f8e3,_0x3d8750){_0x14f8e3=_0x14f8e3-0x0;var _0x1f4b20=_0x1dde[_0x14f8e3];return _0x1f4b20;};'use strict';var _=require(_0xe1dd('0x0'));var util=require(_0xe1dd('0x1'));var moment=require(_0xe1dd('0x2'));var BPromise=require(_0xe1dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe1dd('0x4'));var db=require(_0xe1dd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe1dd('0x6'))(_0xe1dd('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1dd('0x8'));var client=jayson[_0xe1dd('0x9')][_0xe1dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xca5175,_0x10ab12,_0x1b08bf){return new BPromise(function(_0x4263af,_0x218508){return client[_0xe1dd('0xb')](_0xca5175,_0x1b08bf)[_0xe1dd('0xc')](function(_0x52b614){logger[_0xe1dd('0xd')](_0xe1dd('0xe'),_0x10ab12,_0xe1dd('0xf'));logger['debug'](_0xe1dd('0x10'),_0x10ab12,_0xe1dd('0xf'),JSON['stringify'](_0x52b614));if(_0x52b614['error']){if(_0x52b614[_0xe1dd('0x11')][_0xe1dd('0x12')]===0x1f4){logger['error'](_0xe1dd('0xe'),_0x10ab12,_0x52b614[_0xe1dd('0x11')]['message']);return _0x218508(_0x52b614['error'][_0xe1dd('0x13')]);}logger['error'](_0xe1dd('0xe'),_0x10ab12,_0x52b614[_0xe1dd('0x11')][_0xe1dd('0x13')]);return _0x4263af(_0x52b614[_0xe1dd('0x11')][_0xe1dd('0x13')]);}else{logger['info'](_0xe1dd('0xe'),_0x10ab12,_0xe1dd('0xf'));_0x4263af(_0x52b614['result']['message']);}})[_0xe1dd('0x14')](function(_0x5c8fa5){logger[_0xe1dd('0x11')](_0xe1dd('0xe'),_0x10ab12,_0x5c8fa5);_0x218508(_0x5c8fa5);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index cf738d1..a94eecf 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 _0x6b86=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','getFields','post','create','/:id/configurations','put','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x6b86,0x176));var _0x66b8=function(_0x4ad451,_0x58139f){_0x4ad451=_0x4ad451-0x0;var _0xd31fef=_0x6b86[_0x4ad451];return _0xd31fef;};'use strict';var multer=require(_0x66b8('0x0'));var util=require(_0x66b8('0x1'));var path=require(_0x66b8('0x2'));var timeout=require(_0x66b8('0x3'));var express=require('express');var router=express[_0x66b8('0x4')]();var auth=require(_0x66b8('0x5'));var interaction=require(_0x66b8('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x66b8('0x7')]('/',auth[_0x66b8('0x8')](),controller[_0x66b8('0x9')]);router[_0x66b8('0x7')](_0x66b8('0xa'),auth[_0x66b8('0x8')](),controller[_0x66b8('0xb')]);router[_0x66b8('0x7')]('/:id/configurations',auth[_0x66b8('0x8')](),controller['getConfigurations']);router[_0x66b8('0x7')]('/:id/fields',auth[_0x66b8('0x8')](),controller[_0x66b8('0xc')]);router[_0x66b8('0xd')]('/',auth[_0x66b8('0x8')](),controller[_0x66b8('0xe')]);router[_0x66b8('0xd')](_0x66b8('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x66b8('0x10')](_0x66b8('0xa'),auth[_0x66b8('0x8')](),controller[_0x66b8('0x11')]);router[_0x66b8('0x12')]('/:id',auth[_0x66b8('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xadc9=['get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','delete','destroy','exports','util','path','connect-timeout','../../config/environment','./intVtigerAccount.controller'];(function(_0x1c0538,_0x4d7428){var _0x281baa=function(_0x532c90){while(--_0x532c90){_0x1c0538['push'](_0x1c0538['shift']());}};_0x281baa(++_0x4d7428);}(_0xadc9,0x13e));var _0x9adc=function(_0x478791,_0x303727){_0x478791=_0x478791-0x0;var _0x3b0647=_0xadc9[_0x478791];return _0x3b0647;};'use strict';var multer=require('multer');var util=require(_0x9adc('0x0'));var path=require(_0x9adc('0x1'));var timeout=require(_0x9adc('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9adc('0x3'));var controller=require(_0x9adc('0x4'));router[_0x9adc('0x5')]('/',auth[_0x9adc('0x6')](),controller['index']);router[_0x9adc('0x5')](_0x9adc('0x7'),auth[_0x9adc('0x6')](),controller[_0x9adc('0x8')]);router['get'](_0x9adc('0x9'),auth[_0x9adc('0x6')](),controller['getConfigurations']);router[_0x9adc('0x5')](_0x9adc('0xa'),auth[_0x9adc('0x6')](),controller[_0x9adc('0xb')]);router[_0x9adc('0xc')]('/',auth[_0x9adc('0x6')](),controller['create']);router[_0x9adc('0xc')](_0x9adc('0x9'),auth['isAuthenticated'](),controller[_0x9adc('0xd')]);router['put'](_0x9adc('0x7'),auth[_0x9adc('0x6')](),controller['update']);router[_0x9adc('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x9adc('0xf')]);module[_0x9adc('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index efd894e..f11c83c 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 _0x03d1=['exports','STRING','HelpDesk'];(function(_0x12b4d8,_0x5a261f){var _0x2f168d=function(_0x13c0a7){while(--_0x13c0a7){_0x12b4d8['push'](_0x12b4d8['shift']());}};_0x2f168d(++_0x5a261f);}(_0x03d1,0x7e));var _0x103d=function(_0x50e893,_0x595ab5){_0x50e893=_0x50e893-0x0;var _0x39445b=_0x03d1[_0x50e893];return _0x39445b;};'use strict';var Sequelize=require('sequelize');module[_0x103d('0x0')]={'name':{'type':Sequelize[_0x103d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x103d('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x103d('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x103d('0x1')]},'accessKey':{'type':Sequelize[_0x103d('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x3d64=['STRING','HelpDesk','exports'];(function(_0x4ac6ef,_0x1fcdb8){var _0x3c268c=function(_0x361160){while(--_0x361160){_0x4ac6ef['push'](_0x4ac6ef['shift']());}};_0x3c268c(++_0x1fcdb8);}(_0x3d64,0x15b));var _0x43d6=function(_0x48c1f3,_0x257166){_0x48c1f3=_0x48c1f3-0x0;var _0x120e76=_0x3d64[_0x48c1f3];return _0x120e76;};'use strict';var Sequelize=require('sequelize');module[_0x43d6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x43d6('0x1')]},'username':{'type':Sequelize[_0x43d6('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x43d6('0x1')],'allowNull':![],'defaultValue':_0x43d6('0x2')},'remoteUri':{'type':Sequelize[_0x43d6('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x43d6('0x1')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 93c9fca..a873dde 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 _0x7d25=['cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','lodash','squel','crypto','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','destroy','end','stack','name','VtigerAccount','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','where','map','type','key','field','filter','options','includeAll','findAll','params','rawAttributes','length','find','body','update','findOne','VtigerConfiguration','merge','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','create','VtigerField','md5','getFields','description','remoteUri','serverUrl','accessKey','username','moduleName','slice','substring','lastIndexOf','format','GET','getchallenge','success','POST','login','token','describe','autogenerated','reference','owner','remove','editable','false','label','startsWith'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x7d25,0x8a));var _0x57d2=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x7d25[_0x5f309e];return _0x487b5e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x57d2('0x0'));var rimraf=require(_0x57d2('0x1'));var zipdir=require(_0x57d2('0x2'));var jsonpatch=require(_0x57d2('0x3'));var rp=require(_0x57d2('0x4'));var moment=require(_0x57d2('0x5'));var BPromise=require(_0x57d2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x57d2('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0x7'));var querystring=require('querystring');var Papa=require(_0x57d2('0xb'));var authService=require(_0x57d2('0xc'));var hardwareService=require(_0x57d2('0xd'));var Redis=require('ioredis');var qs=require(_0x57d2('0xe'));var logger=require(_0x57d2('0xf'))(_0x57d2('0x10'));var utils=require(_0x57d2('0x11'));var config=require(_0x57d2('0x12'));var db=require(_0x57d2('0x13'))['db'];var integrations=require(_0x57d2('0x14'));var jayson=require(_0x57d2('0x15'));var client=jayson[_0x57d2('0x16')][_0x57d2('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x28428b,_0x3181ad,_0x6940ef,_0x229734){return new BPromise(function(_0x1ba57e,_0x4086f3){var _0x5382d9=_0x229734||client;return _0x5382d9['request'](_0x28428b,_0x6940ef)[_0x57d2('0x18')](function(_0x148ef3){logger['info'](_0x57d2('0x19'),_0x3181ad,_0x57d2('0x1a'));logger['debug'](_0x57d2('0x1b'),_0x3181ad,'request\x20sent',JSON[_0x57d2('0x1c')](_0x148ef3));if(_0x148ef3['error']){if(_0x148ef3[_0x57d2('0x1d')][_0x57d2('0x1e')]===0x1f4){logger[_0x57d2('0x1d')]('VtigerAccount,\x20%s,\x20%s',_0x3181ad,_0x148ef3['error'][_0x57d2('0x1f')]);return _0x4086f3(_0x148ef3[_0x57d2('0x1d')][_0x57d2('0x1f')]);}logger[_0x57d2('0x1d')]('VtigerAccount,\x20%s,\x20%s',_0x3181ad,_0x148ef3[_0x57d2('0x1d')][_0x57d2('0x1f')]);return _0x1ba57e(_0x148ef3['error']['message']);}else{logger[_0x57d2('0x20')](_0x57d2('0x19'),_0x3181ad,_0x57d2('0x1a'));_0x1ba57e(_0x148ef3[_0x57d2('0x21')][_0x57d2('0x1f')]);}})[_0x57d2('0x22')](function(_0x32c7c8){logger[_0x57d2('0x1d')](_0x57d2('0x19'),_0x3181ad,_0x32c7c8);_0x4086f3(_0x32c7c8);});});}function respondWithStatusCode(_0x26718e,_0x46a4d1){_0x46a4d1=_0x46a4d1||0xcc;return function(_0x456fe1){if(_0x456fe1){return _0x26718e[_0x57d2('0x23')](_0x46a4d1);}return _0x26718e[_0x57d2('0x24')](_0x46a4d1)['end']();};}function respondWithResult(_0x424ddc,_0xb3a484){_0xb3a484=_0xb3a484||0xc8;return function(_0x3c7de8){if(_0x3c7de8){return _0x424ddc[_0x57d2('0x24')](_0xb3a484)[_0x57d2('0x25')](_0x3c7de8);}};}function respondWithFilteredResult(_0x5058be,_0x1d203c){return function(_0x608b10){if(_0x608b10){var _0x995928=_0x608b10[_0x57d2('0x26')],_0x16ee2f=_0x1d203c['offset'],_0x18d500=_0x1d203c[_0x57d2('0x27')]+_0x1d203c[_0x57d2('0x28')],_0x4b3d8e;if(_0x18d500>=_0x995928){_0x18d500=_0x995928;_0x4b3d8e=0xc8;}else{_0x4b3d8e=0xce;}_0x5058be[_0x57d2('0x24')](_0x4b3d8e);return _0x5058be[_0x57d2('0x29')](_0x57d2('0x2a'),_0x16ee2f+'-'+_0x18d500+'/'+_0x995928)[_0x57d2('0x25')](_0x608b10);}return null;};}function patchUpdates(_0x1dd6cb){return function(_0x1d3a3a){try{jsonpatch[_0x57d2('0x2b')](_0x1d3a3a,_0x1dd6cb,!![]);}catch(_0x2cf9d9){return BPromise['reject'](_0x2cf9d9);}return _0x1d3a3a[_0x57d2('0x2c')]();};}function saveUpdates(_0x3da926,_0x26e052){return function(_0x3e017c){if(_0x3e017c){return _0x3e017c['update'](_0x3da926)[_0x57d2('0x18')](function(_0x1fa0aa){return _0x1fa0aa;});}return null;};}function removeEntity(_0x21152e,_0x290c2d){return function(_0xb3051c){if(_0xb3051c){return _0xb3051c[_0x57d2('0x2d')]()[_0x57d2('0x18')](function(){_0x21152e[_0x57d2('0x24')](0xcc)[_0x57d2('0x2e')]();});}};}function handleEntityNotFound(_0x581cf7,_0xee0c82){return function(_0x213c99){if(!_0x213c99){_0x581cf7['sendStatus'](0x194);}return _0x213c99;};}function handleError(_0xcf7e0e,_0x1bd9b8){_0x1bd9b8=_0x1bd9b8||0x1f4;return function(_0x47dbfa){logger[_0x57d2('0x1d')](_0x47dbfa[_0x57d2('0x2f')]);if(_0x47dbfa[_0x57d2('0x30')]){delete _0x47dbfa[_0x57d2('0x30')];}_0xcf7e0e[_0x57d2('0x24')](_0x1bd9b8)['send'](_0x47dbfa);};}exports['index']=function(_0x581ebc,_0x5001c5){var _0x371939={},_0x39f54b={},_0x39f3b9={'count':0x0,'rows':[]};var _0x2f2173=db[_0x57d2('0x31')]['rawAttributes'];_0x39f54b[_0x57d2('0x32')]=_['keys'](_0x2f2173);_0x39f54b[_0x57d2('0x33')]=_[_0x57d2('0x34')](_0x581ebc[_0x57d2('0x33')]);_0x39f54b['filters']=_[_0x57d2('0x35')](_0x39f54b[_0x57d2('0x32')],_0x39f54b['query']);_0x371939[_0x57d2('0x36')]=_[_0x57d2('0x35')](_0x39f54b[_0x57d2('0x32')],qs[_0x57d2('0x37')](_0x581ebc[_0x57d2('0x33')][_0x57d2('0x37')]));_0x371939['attributes']=_0x371939[_0x57d2('0x36')]['length']?_0x371939[_0x57d2('0x36')]:_0x39f54b[_0x57d2('0x32')];if(!_0x581ebc[_0x57d2('0x33')][_0x57d2('0x38')](_0x57d2('0x39'))){_0x371939['limit']=qs[_0x57d2('0x28')](_0x581ebc[_0x57d2('0x33')]['limit']);_0x371939[_0x57d2('0x27')]=qs[_0x57d2('0x27')](_0x581ebc[_0x57d2('0x33')]['offset']);}_0x371939[_0x57d2('0x3a')]=qs[_0x57d2('0x3b')](_0x581ebc[_0x57d2('0x33')][_0x57d2('0x3b')]);_0x371939['where']=qs['filters'](_[_0x57d2('0x3c')](_0x581ebc[_0x57d2('0x33')],_0x39f54b[_0x57d2('0x3d')]));if(_0x581ebc['query']['filter']){_0x371939[_0x57d2('0x3e')]=_['merge'](_0x371939[_0x57d2('0x3e')],{'$or':_[_0x57d2('0x3f')](_0x2f2173,function(_0x4079b8){if(_0x4079b8[_0x57d2('0x40')][_0x57d2('0x41')]!=='VIRTUAL'){var _0x13216b={};_0x13216b[_0x4079b8[_0x57d2('0x42')]]={'$like':'%'+_0x581ebc['query'][_0x57d2('0x43')]+'%'};return _0x13216b;}})});}_0x371939=_['merge']({},_0x371939,_0x581ebc[_0x57d2('0x44')]);var _0xbbbb5f={'where':_0x371939[_0x57d2('0x3e')]};return db[_0x57d2('0x31')]['count'](_0xbbbb5f)['then'](function(_0x3d8256){_0x39f3b9['count']=_0x3d8256;if(_0x581ebc['query'][_0x57d2('0x45')]){_0x371939['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x57d2('0x46')](_0x371939);})['then'](function(_0x3cddfd){_0x39f3b9['rows']=_0x3cddfd;return _0x39f3b9;})[_0x57d2('0x18')](respondWithFilteredResult(_0x5001c5,_0x371939))['catch'](handleError(_0x5001c5,null));};exports['show']=function(_0x1090de,_0x3e39f5){var _0xba2cc8={'raw':![],'where':{'id':_0x1090de[_0x57d2('0x47')]['id']}},_0x28566d={};_0x28566d[_0x57d2('0x32')]=_['keys'](db[_0x57d2('0x31')][_0x57d2('0x48')]);_0x28566d[_0x57d2('0x33')]=_[_0x57d2('0x34')](_0x1090de[_0x57d2('0x33')]);_0x28566d[_0x57d2('0x3d')]=_[_0x57d2('0x35')](_0x28566d[_0x57d2('0x32')],_0x28566d['query']);_0xba2cc8[_0x57d2('0x36')]=_[_0x57d2('0x35')](_0x28566d['model'],qs[_0x57d2('0x37')](_0x1090de['query']['fields']));_0xba2cc8[_0x57d2('0x36')]=_0xba2cc8[_0x57d2('0x36')][_0x57d2('0x49')]?_0xba2cc8[_0x57d2('0x36')]:_0x28566d['model'];if(_0x1090de[_0x57d2('0x33')][_0x57d2('0x45')]){_0xba2cc8['include']=[{'all':!![]}];}_0xba2cc8=_['merge']({},_0xba2cc8,_0x1090de[_0x57d2('0x44')]);return db[_0x57d2('0x31')][_0x57d2('0x4a')](_0xba2cc8)[_0x57d2('0x18')](handleEntityNotFound(_0x3e39f5,null))[_0x57d2('0x18')](respondWithResult(_0x3e39f5,null))[_0x57d2('0x22')](handleError(_0x3e39f5,null));};exports['create']=function(_0x4b377f,_0x5a5edb){return db[_0x57d2('0x31')]['create'](_0x4b377f[_0x57d2('0x4b')],{})[_0x57d2('0x18')](respondWithResult(_0x5a5edb,0xc9))['catch'](handleError(_0x5a5edb,null));};exports[_0x57d2('0x4c')]=function(_0xdb19c5,_0x35ced7){if(_0xdb19c5['body']['id']){delete _0xdb19c5[_0x57d2('0x4b')]['id'];}return db[_0x57d2('0x31')][_0x57d2('0x4a')]({'where':{'id':_0xdb19c5[_0x57d2('0x47')]['id']}})[_0x57d2('0x18')](handleEntityNotFound(_0x35ced7,null))[_0x57d2('0x18')](saveUpdates(_0xdb19c5[_0x57d2('0x4b')],null))[_0x57d2('0x18')](respondWithResult(_0x35ced7,null))[_0x57d2('0x22')](handleError(_0x35ced7,null));};exports['destroy']=function(_0x67d499,_0x3ad348){return db[_0x57d2('0x31')]['find']({'where':{'id':_0x67d499[_0x57d2('0x47')]['id']}})[_0x57d2('0x18')](handleEntityNotFound(_0x3ad348,null))[_0x57d2('0x18')](removeEntity(_0x3ad348,null))['catch'](handleError(_0x3ad348,null));};exports['getConfigurations']=function(_0x56ddfd,_0x296a79,_0x52f829){var _0x682542={};var _0x4cdae5={};var _0x3111a2;var _0x573be1;return db[_0x57d2('0x31')][_0x57d2('0x4d')]({'where':{'id':_0x56ddfd[_0x57d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x296a79,null))['then'](function(_0xd5b87e){if(_0xd5b87e){_0x3111a2=_0xd5b87e;_0x4cdae5[_0x57d2('0x32')]=_[_0x57d2('0x34')](db[_0x57d2('0x4e')][_0x57d2('0x48')]);_0x4cdae5[_0x57d2('0x33')]=_['keys'](_0x56ddfd['query']);_0x4cdae5[_0x57d2('0x3d')]=_[_0x57d2('0x35')](_0x4cdae5[_0x57d2('0x32')],_0x4cdae5[_0x57d2('0x33')]);_0x682542['attributes']=_['intersection'](_0x4cdae5[_0x57d2('0x32')],qs[_0x57d2('0x37')](_0x56ddfd['query'][_0x57d2('0x37')]));_0x682542[_0x57d2('0x36')]=_0x682542[_0x57d2('0x36')][_0x57d2('0x49')]?_0x682542['attributes']:_0x4cdae5['model'];_0x682542['order']=qs['sort'](_0x56ddfd[_0x57d2('0x33')][_0x57d2('0x3b')]);_0x682542[_0x57d2('0x3e')]=qs[_0x57d2('0x3d')](_[_0x57d2('0x3c')](_0x56ddfd[_0x57d2('0x33')],_0x4cdae5[_0x57d2('0x3d')]));if(_0x56ddfd['query'][_0x57d2('0x43')]){_0x682542['where']=_[_0x57d2('0x4f')](_0x682542['where'],{'$or':_[_0x57d2('0x3f')](_0x682542[_0x57d2('0x36')],function(_0x453e6c){var _0x39e4cd={};_0x39e4cd[_0x453e6c]={'$like':'%'+_0x56ddfd[_0x57d2('0x33')][_0x57d2('0x43')]+'%'};return _0x39e4cd;})});}_0x682542=_['merge']({},_0x682542,_0x56ddfd[_0x57d2('0x44')]);return _0x3111a2[_0x57d2('0x50')](_0x682542);}})[_0x57d2('0x18')](function(_0x6da8c3){if(_0x6da8c3){_0x573be1=_0x6da8c3[_0x57d2('0x49')];if(!_0x56ddfd[_0x57d2('0x33')][_0x57d2('0x38')](_0x57d2('0x39'))){_0x682542[_0x57d2('0x28')]=qs['limit'](_0x56ddfd[_0x57d2('0x33')]['limit']);_0x682542['offset']=qs['offset'](_0x56ddfd[_0x57d2('0x33')]['offset']);}return _0x3111a2[_0x57d2('0x50')](_0x682542);}})[_0x57d2('0x18')](function(_0x4dadee){if(_0x4dadee){return _0x4dadee?{'count':_0x573be1,'rows':_0x4dadee}:null;}})[_0x57d2('0x18')](respondWithResult(_0x296a79,null))[_0x57d2('0x22')](handleError(_0x296a79,null));};exports[_0x57d2('0x51')]=function(_0x13741f,_0x5eb7a3,_0x3afeb9){if(_0x13741f[_0x57d2('0x4b')]['id']){delete _0x13741f['body']['id'];}return db['VtigerAccount'][_0x57d2('0x4d')]({'where':{'id':_0x13741f[_0x57d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x5eb7a3,null))[_0x57d2('0x18')](function(_0x5a1283){if(_0x5a1283){_0x13741f[_0x57d2('0x4b')][_0x57d2('0x52')]=_0x5a1283['id'];_0x13741f[_0x57d2('0x4b')][_0x57d2('0x53')]=integrations[_0x57d2('0x54')](_0x13741f[_0x57d2('0x4b')][_0x57d2('0x55')],_0x13741f[_0x57d2('0x4b')][_0x57d2('0x40')]);_0x13741f[_0x57d2('0x4b')][_0x57d2('0x56')]=integrations['getDescriptions'](_0x13741f[_0x57d2('0x4b')][_0x57d2('0x55')],_0x13741f[_0x57d2('0x4b')][_0x57d2('0x40')]);return db[_0x57d2('0x4e')][_0x57d2('0x57')](_0x13741f[_0x57d2('0x4b')],{'include':[{'model':db[_0x57d2('0x58')],'as':_0x57d2('0x53')},{'model':db[_0x57d2('0x58')],'as':_0x57d2('0x56')}]});}return null;})[_0x57d2('0x18')](respondWithResult(_0x5eb7a3,null))[_0x57d2('0x22')](handleError(_0x5eb7a3,null));};var md5=require(_0x57d2('0x59'));exports[_0x57d2('0x5a')]=function(_0x144229,_0x50a54f,_0x11a132){var _0x37d464=null;var _0x507de4=null;var _0x4713b8=null;var _0x17b3c1=null;var _0x3cc183='';return db[_0x57d2('0x31')]['findOne']({'where':{'id':_0x144229[_0x57d2('0x47')]['id']},'attributes':['id','name','username',_0x57d2('0x5b'),'moduleName',_0x57d2('0x5c'),_0x57d2('0x5d'),_0x57d2('0x5e')]})[_0x57d2('0x18')](handleEntityNotFound(_0x50a54f,null))['then'](function(_0xd0191b){if(_0xd0191b){_0x37d464=_0xd0191b[_0x57d2('0x5f')];_0x507de4=_0xd0191b[_0x57d2('0x5e')];_0x4713b8=_0xd0191b[_0x57d2('0x60')];_0x3cc183=_0xd0191b[_0x57d2('0x5c')];var _0x863137=_0x3cc183[_0x57d2('0x61')](-0x1);if(_0x863137==='/'){_0x3cc183=_0x3cc183[_0x57d2('0x62')](0x0,_0x3cc183[_0x57d2('0x63')](_0x863137));}_0x17b3c1=util[_0x57d2('0x64')]('%s/webservice.php',_0x3cc183);var _0x2a2416={'method':_0x57d2('0x65'),'uri':_0x17b3c1,'qs':{'operation':_0x57d2('0x66'),'username':_0xd0191b[_0x57d2('0x5f')]},'json':!![]};return rp(_0x2a2416);}})[_0x57d2('0x18')](function(_0x1375fa){if(_0x1375fa[_0x57d2('0x67')]){var _0x26804={'method':_0x57d2('0x68'),'uri':_0x17b3c1,'form':{'operation':_0x57d2('0x69'),'username':_0x37d464,'accessKey':md5(_0x1375fa[_0x57d2('0x21')][_0x57d2('0x6a')]+_0x507de4)},'json':!![]};return rp(_0x26804);}})['then'](function(_0x5aa569){if(_0x5aa569[_0x57d2('0x67')]){var _0x154fa8={'method':_0x57d2('0x65'),'uri':_0x17b3c1,'qs':{'operation':_0x57d2('0x6b'),'username':_0x37d464,'sessionName':_0x5aa569[_0x57d2('0x21')]['sessionName'],'elementType':_0x4713b8},'json':!![]};return rp(_0x154fa8);}})['then'](function(_0x3e9c36){if(_0x3e9c36[_0x57d2('0x67')]){var _0x20529b=[_0x57d2('0x6c'),_0x57d2('0x6d'),_0x57d2('0x6e')];_['remove'](_0x3e9c36[_0x57d2('0x21')][_0x57d2('0x37')],function(_0x5bb7cd){return _0x20529b['includes'](_0x5bb7cd['type']['name']);});_[_0x57d2('0x6f')](_0x3e9c36['result'][_0x57d2('0x37')],function(_0x55d309){return _0x55d309[_0x57d2('0x70')]===_0x57d2('0x71');});return{'count':_0x3e9c36[_0x57d2('0x21')][_0x57d2('0x37')][_0x57d2('0x49')],'rows':_['map'](_0x3e9c36[_0x57d2('0x21')][_0x57d2('0x37')],function(_0xb1a51){return{'id':_0xb1a51['name'],'name':_0xb1a51[_0x57d2('0x72')],'custom':_[_0x57d2('0x73')](_0xb1a51[_0x57d2('0x30')],_0x57d2('0x74'))?!![]:![],'options':_0xb1a51[_0x57d2('0x40')][_0x57d2('0x30')]===_0x57d2('0x75')&&_0xb1a51['type']['picklistValues']['length']>0x0?_[_0x57d2('0x3f')](_0xb1a51[_0x57d2('0x40')][_0x57d2('0x76')],function(_0x487b14){return{'name':_0x487b14[_0x57d2('0x72')],'value':_0x487b14[_0x57d2('0x77')]};}):[]};})};}})[_0x57d2('0x18')](respondWithResult(_0x50a54f,null))[_0x57d2('0x22')](function(_0x30fa19){console[_0x57d2('0x78')](_0x57d2('0x79')+_0x30fa19);var _0xca0e35=_0x144229['query'][_0x57d2('0x7a')]?0x1f4:_0x30fa19[_0x57d2('0x7b')]||0x1f4;logger[_0x57d2('0x1d')](_0x57d2('0x7c'),'getFields',_0xca0e35,JSON['stringify'](_0x30fa19));delete _0x30fa19[_0x57d2('0x30')];if(_0xca0e35===0x191){_0xca0e35=0x190;}_0x50a54f['status'](_0xca0e35)[_0x57d2('0x7d')](_0x144229['query'][_0x57d2('0x7a')]?{'message':_0x57d2('0x7e'),'statusCode':_0x30fa19[_0x57d2('0x7b')]}:_0x30fa19);});}; \ No newline at end of file +var _0x26f9=['value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','json','count','offset','set','reject','update','destroy','end','stack','name','send','index','VtigerAccount','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','include','findAll','rows','show','params','includeAll','find','create','body','getConfigurations','VtigerConfiguration','addConfiguration','findOne','Subjects','Descriptions','channel','VtigerField','md5','getFields','moduleName','remoteUri','serverUrl','username','accessKey','format','%s/webservice.php','getchallenge','POST','token','success','GET','sessionName','autogenerated','owner','includes','remove','cf_','picklist','picklistValues','label'];(function(_0x3da707,_0x30c36d){var _0x342ee7=function(_0x175135){while(--_0x175135){_0x3da707['push'](_0x3da707['shift']());}};_0x342ee7(++_0x30c36d);}(_0x26f9,0x16f));var _0x926f=function(_0x1f063b,_0x321a3c){_0x1f063b=_0x1f063b-0x0;var _0x4d864b=_0x26f9[_0x1f063b];return _0x4d864b;};'use strict';var pdf=require(_0x926f('0x0'));var emlformat=require(_0x926f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x926f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x926f('0x3'));var BPromise=require(_0x926f('0x4'));var Mustache=require('mustache');var util=require(_0x926f('0x5'));var path=require(_0x926f('0x6'));var sox=require(_0x926f('0x7'));var csv=require(_0x926f('0x8'));var ejs=require(_0x926f('0x9'));var fs=require('fs');var _=require(_0x926f('0xa'));var squel=require(_0x926f('0xb'));var crypto=require(_0x926f('0xc'));var jsforce=require(_0x926f('0xd'));var deskjs=require(_0x926f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x926f('0xf'));var Papa=require('papaparse');var authService=require(_0x926f('0x10'));var hardwareService=require(_0x926f('0x11'));var Redis=require('ioredis');var qs=require(_0x926f('0x12'));var logger=require(_0x926f('0x13'))(_0x926f('0x14'));var utils=require(_0x926f('0x15'));var config=require(_0x926f('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x926f('0x17'));var jayson=require(_0x926f('0x18'));var client=jayson[_0x926f('0x19')][_0x926f('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x44f5da,_0x450b6e,_0x378bb1,_0x539e5d){return new BPromise(function(_0x48ee07,_0x5e6fb1){var _0x11197b=_0x539e5d||client;return _0x11197b[_0x926f('0x1b')](_0x44f5da,_0x378bb1)[_0x926f('0x1c')](function(_0x280759){logger['info'](_0x926f('0x1d'),_0x450b6e,_0x926f('0x1e'));logger['debug'](_0x926f('0x1f'),_0x450b6e,'request\x20sent',JSON[_0x926f('0x20')](_0x280759));if(_0x280759['error']){if(_0x280759['error'][_0x926f('0x21')]===0x1f4){logger[_0x926f('0x22')]('VtigerAccount,\x20%s,\x20%s',_0x450b6e,_0x280759[_0x926f('0x22')][_0x926f('0x23')]);return _0x5e6fb1(_0x280759[_0x926f('0x22')]['message']);}logger[_0x926f('0x22')](_0x926f('0x1d'),_0x450b6e,_0x280759['error'][_0x926f('0x23')]);return _0x48ee07(_0x280759[_0x926f('0x22')]['message']);}else{logger[_0x926f('0x24')](_0x926f('0x1d'),_0x450b6e,_0x926f('0x1e'));_0x48ee07(_0x280759[_0x926f('0x25')][_0x926f('0x23')]);}})[_0x926f('0x26')](function(_0x412260){logger[_0x926f('0x22')](_0x926f('0x1d'),_0x450b6e,_0x412260);_0x5e6fb1(_0x412260);});});}function respondWithStatusCode(_0x61738a,_0x2be66b){_0x2be66b=_0x2be66b||0xcc;return function(_0x4a93a4){if(_0x4a93a4){return _0x61738a[_0x926f('0x27')](_0x2be66b);}return _0x61738a[_0x926f('0x28')](_0x2be66b)['end']();};}function respondWithResult(_0x640fe0,_0x84bccd){_0x84bccd=_0x84bccd||0xc8;return function(_0x36a17e){if(_0x36a17e){return _0x640fe0[_0x926f('0x28')](_0x84bccd)[_0x926f('0x29')](_0x36a17e);}};}function respondWithFilteredResult(_0x3887fc,_0x4b8964){return function(_0x110e59){if(_0x110e59){var _0x5065dd=_0x110e59[_0x926f('0x2a')],_0x17e071=_0x4b8964['offset'],_0x37230f=_0x4b8964[_0x926f('0x2b')]+_0x4b8964['limit'],_0x2a8fff;if(_0x37230f>=_0x5065dd){_0x37230f=_0x5065dd;_0x2a8fff=0xc8;}else{_0x2a8fff=0xce;}_0x3887fc[_0x926f('0x28')](_0x2a8fff);return _0x3887fc[_0x926f('0x2c')]('Content-Range',_0x17e071+'-'+_0x37230f+'/'+_0x5065dd)['json'](_0x110e59);}return null;};}function patchUpdates(_0x19bd54){return function(_0x1f2e2e){try{jsonpatch['apply'](_0x1f2e2e,_0x19bd54,!![]);}catch(_0x33c1fb){return BPromise[_0x926f('0x2d')](_0x33c1fb);}return _0x1f2e2e['save']();};}function saveUpdates(_0x5cae09,_0x39966d){return function(_0x1d61d6){if(_0x1d61d6){return _0x1d61d6[_0x926f('0x2e')](_0x5cae09)['then'](function(_0x681ceb){return _0x681ceb;});}return null;};}function removeEntity(_0x12de3e,_0x32c45f){return function(_0x553d93){if(_0x553d93){return _0x553d93[_0x926f('0x2f')]()[_0x926f('0x1c')](function(){_0x12de3e[_0x926f('0x28')](0xcc)[_0x926f('0x30')]();});}};}function handleEntityNotFound(_0x1061da,_0x426a40){return function(_0x589409){if(!_0x589409){_0x1061da[_0x926f('0x27')](0x194);}return _0x589409;};}function handleError(_0xf17230,_0x2ac053){_0x2ac053=_0x2ac053||0x1f4;return function(_0xb8117f){logger['error'](_0xb8117f[_0x926f('0x31')]);if(_0xb8117f[_0x926f('0x32')]){delete _0xb8117f[_0x926f('0x32')];}_0xf17230[_0x926f('0x28')](_0x2ac053)[_0x926f('0x33')](_0xb8117f);};}exports[_0x926f('0x34')]=function(_0x1d7e5c,_0xaad45d){var _0x2184c1={},_0x41bfac={},_0xd4d998={'count':0x0,'rows':[]};var _0x482322=db[_0x926f('0x35')][_0x926f('0x36')];_0x41bfac['model']=_[_0x926f('0x37')](_0x482322);_0x41bfac[_0x926f('0x38')]=_[_0x926f('0x37')](_0x1d7e5c[_0x926f('0x38')]);_0x41bfac[_0x926f('0x39')]=_[_0x926f('0x3a')](_0x41bfac[_0x926f('0x3b')],_0x41bfac[_0x926f('0x38')]);_0x2184c1['attributes']=_[_0x926f('0x3a')](_0x41bfac['model'],qs[_0x926f('0x3c')](_0x1d7e5c[_0x926f('0x38')][_0x926f('0x3c')]));_0x2184c1[_0x926f('0x3d')]=_0x2184c1[_0x926f('0x3d')][_0x926f('0x3e')]?_0x2184c1[_0x926f('0x3d')]:_0x41bfac[_0x926f('0x3b')];if(!_0x1d7e5c[_0x926f('0x38')][_0x926f('0x3f')](_0x926f('0x40'))){_0x2184c1[_0x926f('0x41')]=qs[_0x926f('0x41')](_0x1d7e5c[_0x926f('0x38')][_0x926f('0x41')]);_0x2184c1['offset']=qs[_0x926f('0x2b')](_0x1d7e5c[_0x926f('0x38')][_0x926f('0x2b')]);}_0x2184c1[_0x926f('0x42')]=qs[_0x926f('0x43')](_0x1d7e5c[_0x926f('0x38')][_0x926f('0x43')]);_0x2184c1[_0x926f('0x44')]=qs['filters'](_[_0x926f('0x45')](_0x1d7e5c[_0x926f('0x38')],_0x41bfac[_0x926f('0x39')]));if(_0x1d7e5c[_0x926f('0x38')][_0x926f('0x46')]){_0x2184c1['where']=_[_0x926f('0x47')](_0x2184c1[_0x926f('0x44')],{'$or':_[_0x926f('0x48')](_0x482322,function(_0x39cb80){if(_0x39cb80[_0x926f('0x49')]['key']!==_0x926f('0x4a')){var _0x10701e={};_0x10701e[_0x39cb80[_0x926f('0x4b')]]={'$like':'%'+_0x1d7e5c[_0x926f('0x38')][_0x926f('0x46')]+'%'};return _0x10701e;}})});}_0x2184c1=_['merge']({},_0x2184c1,_0x1d7e5c[_0x926f('0x4c')]);var _0x533ca7={'where':_0x2184c1[_0x926f('0x44')]};return db[_0x926f('0x35')][_0x926f('0x2a')](_0x533ca7)[_0x926f('0x1c')](function(_0x35e23a){_0xd4d998[_0x926f('0x2a')]=_0x35e23a;if(_0x1d7e5c[_0x926f('0x38')]['includeAll']){_0x2184c1[_0x926f('0x4d')]=[{'all':!![]}];}return db[_0x926f('0x35')][_0x926f('0x4e')](_0x2184c1);})[_0x926f('0x1c')](function(_0x3a39e8){_0xd4d998[_0x926f('0x4f')]=_0x3a39e8;return _0xd4d998;})[_0x926f('0x1c')](respondWithFilteredResult(_0xaad45d,_0x2184c1))[_0x926f('0x26')](handleError(_0xaad45d,null));};exports[_0x926f('0x50')]=function(_0x165cf3,_0x5b6f99){var _0x351ac6={'raw':![],'where':{'id':_0x165cf3[_0x926f('0x51')]['id']}},_0x5119aa={};_0x5119aa[_0x926f('0x3b')]=_[_0x926f('0x37')](db[_0x926f('0x35')][_0x926f('0x36')]);_0x5119aa['query']=_[_0x926f('0x37')](_0x165cf3[_0x926f('0x38')]);_0x5119aa[_0x926f('0x39')]=_[_0x926f('0x3a')](_0x5119aa[_0x926f('0x3b')],_0x5119aa['query']);_0x351ac6[_0x926f('0x3d')]=_[_0x926f('0x3a')](_0x5119aa[_0x926f('0x3b')],qs[_0x926f('0x3c')](_0x165cf3[_0x926f('0x38')][_0x926f('0x3c')]));_0x351ac6['attributes']=_0x351ac6[_0x926f('0x3d')]['length']?_0x351ac6['attributes']:_0x5119aa[_0x926f('0x3b')];if(_0x165cf3[_0x926f('0x38')][_0x926f('0x52')]){_0x351ac6[_0x926f('0x4d')]=[{'all':!![]}];}_0x351ac6=_[_0x926f('0x47')]({},_0x351ac6,_0x165cf3['options']);return db[_0x926f('0x35')][_0x926f('0x53')](_0x351ac6)[_0x926f('0x1c')](handleEntityNotFound(_0x5b6f99,null))['then'](respondWithResult(_0x5b6f99,null))[_0x926f('0x26')](handleError(_0x5b6f99,null));};exports[_0x926f('0x54')]=function(_0x46604e,_0x27b82a){return db['VtigerAccount'][_0x926f('0x54')](_0x46604e['body'],{})[_0x926f('0x1c')](respondWithResult(_0x27b82a,0xc9))['catch'](handleError(_0x27b82a,null));};exports[_0x926f('0x2e')]=function(_0x3728ea,_0x535d01){if(_0x3728ea[_0x926f('0x55')]['id']){delete _0x3728ea[_0x926f('0x55')]['id'];}return db[_0x926f('0x35')][_0x926f('0x53')]({'where':{'id':_0x3728ea[_0x926f('0x51')]['id']}})['then'](handleEntityNotFound(_0x535d01,null))[_0x926f('0x1c')](saveUpdates(_0x3728ea[_0x926f('0x55')],null))[_0x926f('0x1c')](respondWithResult(_0x535d01,null))[_0x926f('0x26')](handleError(_0x535d01,null));};exports[_0x926f('0x2f')]=function(_0xbc13b1,_0x5463c3){return db[_0x926f('0x35')][_0x926f('0x53')]({'where':{'id':_0xbc13b1[_0x926f('0x51')]['id']}})[_0x926f('0x1c')](handleEntityNotFound(_0x5463c3,null))[_0x926f('0x1c')](removeEntity(_0x5463c3,null))[_0x926f('0x26')](handleError(_0x5463c3,null));};exports[_0x926f('0x56')]=function(_0x3e0c4a,_0x4691fa,_0x3e6f36){var _0x36ac06={};var _0x25f95b={};var _0xc74fb2;var _0x126442;return db[_0x926f('0x35')]['findOne']({'where':{'id':_0x3e0c4a[_0x926f('0x51')]['id']}})['then'](handleEntityNotFound(_0x4691fa,null))[_0x926f('0x1c')](function(_0x39c37c){if(_0x39c37c){_0xc74fb2=_0x39c37c;_0x25f95b[_0x926f('0x3b')]=_[_0x926f('0x37')](db[_0x926f('0x57')][_0x926f('0x36')]);_0x25f95b[_0x926f('0x38')]=_[_0x926f('0x37')](_0x3e0c4a[_0x926f('0x38')]);_0x25f95b[_0x926f('0x39')]=_[_0x926f('0x3a')](_0x25f95b[_0x926f('0x3b')],_0x25f95b[_0x926f('0x38')]);_0x36ac06[_0x926f('0x3d')]=_[_0x926f('0x3a')](_0x25f95b[_0x926f('0x3b')],qs[_0x926f('0x3c')](_0x3e0c4a[_0x926f('0x38')][_0x926f('0x3c')]));_0x36ac06[_0x926f('0x3d')]=_0x36ac06[_0x926f('0x3d')][_0x926f('0x3e')]?_0x36ac06[_0x926f('0x3d')]:_0x25f95b[_0x926f('0x3b')];_0x36ac06[_0x926f('0x42')]=qs['sort'](_0x3e0c4a['query']['sort']);_0x36ac06[_0x926f('0x44')]=qs[_0x926f('0x39')](_[_0x926f('0x45')](_0x3e0c4a[_0x926f('0x38')],_0x25f95b[_0x926f('0x39')]));if(_0x3e0c4a[_0x926f('0x38')]['filter']){_0x36ac06[_0x926f('0x44')]=_[_0x926f('0x47')](_0x36ac06[_0x926f('0x44')],{'$or':_[_0x926f('0x48')](_0x36ac06[_0x926f('0x3d')],function(_0x182868){var _0x2c558e={};_0x2c558e[_0x182868]={'$like':'%'+_0x3e0c4a[_0x926f('0x38')]['filter']+'%'};return _0x2c558e;})});}_0x36ac06=_[_0x926f('0x47')]({},_0x36ac06,_0x3e0c4a[_0x926f('0x4c')]);return _0xc74fb2[_0x926f('0x56')](_0x36ac06);}})[_0x926f('0x1c')](function(_0x361756){if(_0x361756){_0x126442=_0x361756['length'];if(!_0x3e0c4a[_0x926f('0x38')][_0x926f('0x3f')](_0x926f('0x40'))){_0x36ac06['limit']=qs[_0x926f('0x41')](_0x3e0c4a[_0x926f('0x38')][_0x926f('0x41')]);_0x36ac06[_0x926f('0x2b')]=qs[_0x926f('0x2b')](_0x3e0c4a[_0x926f('0x38')]['offset']);}return _0xc74fb2[_0x926f('0x56')](_0x36ac06);}})[_0x926f('0x1c')](function(_0x44c503){if(_0x44c503){return _0x44c503?{'count':_0x126442,'rows':_0x44c503}:null;}})[_0x926f('0x1c')](respondWithResult(_0x4691fa,null))[_0x926f('0x26')](handleError(_0x4691fa,null));};exports[_0x926f('0x58')]=function(_0x36621d,_0xc791e6,_0x3bf842){if(_0x36621d[_0x926f('0x55')]['id']){delete _0x36621d[_0x926f('0x55')]['id'];}return db[_0x926f('0x35')][_0x926f('0x59')]({'where':{'id':_0x36621d[_0x926f('0x51')]['id']}})['then'](handleEntityNotFound(_0xc791e6,null))[_0x926f('0x1c')](function(_0x2a462a){if(_0x2a462a){_0x36621d[_0x926f('0x55')]['AccountId']=_0x2a462a['id'];_0x36621d[_0x926f('0x55')][_0x926f('0x5a')]=integrations['getSubjects'](_0x36621d[_0x926f('0x55')]['channel'],_0x36621d[_0x926f('0x55')][_0x926f('0x49')]);_0x36621d[_0x926f('0x55')][_0x926f('0x5b')]=integrations['getDescriptions'](_0x36621d['body'][_0x926f('0x5c')],_0x36621d[_0x926f('0x55')][_0x926f('0x49')]);return db['VtigerConfiguration'][_0x926f('0x54')](_0x36621d[_0x926f('0x55')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x926f('0x5d')],'as':_0x926f('0x5b')}]});}return null;})[_0x926f('0x1c')](respondWithResult(_0xc791e6,null))[_0x926f('0x26')](handleError(_0xc791e6,null));};var md5=require(_0x926f('0x5e'));exports[_0x926f('0x5f')]=function(_0xc31092,_0x36935d,_0x37860a){var _0x7d9025=null;var _0x1de15f=null;var _0x3c4387=null;var _0x56cbb1=null;var _0x1588b2='';return db[_0x926f('0x35')]['findOne']({'where':{'id':_0xc31092[_0x926f('0x51')]['id']},'attributes':['id','name','username','description',_0x926f('0x60'),_0x926f('0x61'),_0x926f('0x62'),'accessKey']})['then'](handleEntityNotFound(_0x36935d,null))[_0x926f('0x1c')](function(_0x3d59dc){if(_0x3d59dc){_0x7d9025=_0x3d59dc[_0x926f('0x63')];_0x1de15f=_0x3d59dc[_0x926f('0x64')];_0x3c4387=_0x3d59dc[_0x926f('0x60')];_0x1588b2=_0x3d59dc[_0x926f('0x61')];var _0x3c45e1=_0x1588b2['slice'](-0x1);if(_0x3c45e1==='/'){_0x1588b2=_0x1588b2['substring'](0x0,_0x1588b2['lastIndexOf'](_0x3c45e1));}_0x56cbb1=util[_0x926f('0x65')](_0x926f('0x66'),_0x1588b2);var _0x3e1664={'method':'GET','uri':_0x56cbb1,'qs':{'operation':_0x926f('0x67'),'username':_0x3d59dc['username']},'json':!![]};return rp(_0x3e1664);}})[_0x926f('0x1c')](function(_0x371bee){if(_0x371bee['success']){var _0x5a05ae={'method':_0x926f('0x68'),'uri':_0x56cbb1,'form':{'operation':'login','username':_0x7d9025,'accessKey':md5(_0x371bee[_0x926f('0x25')][_0x926f('0x69')]+_0x1de15f)},'json':!![]};return rp(_0x5a05ae);}})[_0x926f('0x1c')](function(_0x401bb3){if(_0x401bb3[_0x926f('0x6a')]){var _0x779a60={'method':_0x926f('0x6b'),'uri':_0x56cbb1,'qs':{'operation':'describe','username':_0x7d9025,'sessionName':_0x401bb3['result'][_0x926f('0x6c')],'elementType':_0x3c4387},'json':!![]};return rp(_0x779a60);}})[_0x926f('0x1c')](function(_0x15845d){if(_0x15845d[_0x926f('0x6a')]){var _0x496045=[_0x926f('0x6d'),'reference',_0x926f('0x6e')];_['remove'](_0x15845d[_0x926f('0x25')][_0x926f('0x3c')],function(_0x1ee903){return _0x496045[_0x926f('0x6f')](_0x1ee903[_0x926f('0x49')]['name']);});_[_0x926f('0x70')](_0x15845d[_0x926f('0x25')][_0x926f('0x3c')],function(_0x17df98){return _0x17df98['editable']==='false';});return{'count':_0x15845d[_0x926f('0x25')][_0x926f('0x3c')][_0x926f('0x3e')],'rows':_[_0x926f('0x48')](_0x15845d[_0x926f('0x25')][_0x926f('0x3c')],function(_0x5eb506){return{'id':_0x5eb506[_0x926f('0x32')],'name':_0x5eb506['label'],'custom':_['startsWith'](_0x5eb506['name'],_0x926f('0x71'))?!![]:![],'options':_0x5eb506[_0x926f('0x49')][_0x926f('0x32')]===_0x926f('0x72')&&_0x5eb506['type'][_0x926f('0x73')][_0x926f('0x3e')]>0x0?_[_0x926f('0x48')](_0x5eb506[_0x926f('0x49')][_0x926f('0x73')],function(_0x5bc24d){return{'name':_0x5bc24d[_0x926f('0x74')],'value':_0x5bc24d[_0x926f('0x75')]};}):[]};})};}})[_0x926f('0x1c')](respondWithResult(_0x36935d,null))['catch'](function(_0x5596f6){console['log']('vTiger\x20error:\x20'+_0x5596f6);var _0x5ee2f5=_0xc31092[_0x926f('0x38')]['test']?0x1f4:_0x5596f6[_0x926f('0x76')]||0x1f4;logger[_0x926f('0x22')](_0x926f('0x77'),_0x926f('0x5f'),_0x5ee2f5,JSON[_0x926f('0x20')](_0x5596f6));delete _0x5596f6[_0x926f('0x32')];if(_0x5ee2f5===0x191){_0x5ee2f5=0x190;}_0x36935d[_0x926f('0x28')](_0x5ee2f5)['send'](_0xc31092[_0x926f('0x38')]['test']?{'message':_0x926f('0x78'),'statusCode':_0x5596f6[_0x926f('0x76')]}:_0x5596f6);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index a0fe146..adcb5da 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 _0x394b=['moment','bluebird','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x394b,0x11c));var _0xb394=function(_0x1dd19f,_0x1fb022){_0x1dd19f=_0x1dd19f-0x0;var _0x5da1a7=_0x394b[_0x1dd19f];return _0x5da1a7;};'use strict';var _=require(_0xb394('0x0'));var util=require(_0xb394('0x1'));var logger=require(_0xb394('0x2'))(_0xb394('0x3'));var moment=require(_0xb394('0x4'));var BPromise=require(_0xb394('0x5'));var rp=require('request-promise');var attributes=require(_0xb394('0x6'));var integrations=require(_0xb394('0x7'));module[_0xb394('0x8')]=function(_0x49fcc1,_0x543e9d){return _0x49fcc1[_0xb394('0x9')](_0xb394('0xa'),attributes,{'tableName':_0xb394('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb353=['moment','bluebird','request-promise','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash','util','api'];(function(_0xee4227,_0x49d9bb){var _0x276176=function(_0x5b5b4c){while(--_0x5b5b4c){_0xee4227['push'](_0xee4227['shift']());}};_0x276176(++_0x49d9bb);}(_0xb353,0x131));var _0x3b35=function(_0xb54b2d,_0x2fa66b){_0xb54b2d=_0xb54b2d-0x0;var _0x3d4732=_0xb353[_0xb54b2d];return _0x3d4732;};'use strict';var _=require(_0x3b35('0x0'));var util=require(_0x3b35('0x1'));var logger=require('../../config/logger')(_0x3b35('0x2'));var moment=require(_0x3b35('0x3'));var BPromise=require(_0x3b35('0x4'));var rp=require(_0x3b35('0x5'));var attributes=require(_0x3b35('0x6'));var integrations=require(_0x3b35('0x7'));module[_0x3b35('0x8')]=function(_0x4c2790,_0x17dcc4){return _0x4c2790['define'](_0x3b35('0x9'),attributes,{'tableName':_0x3b35('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 0fefab3..7d353df 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 _0x5a75=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','VtigerAccount','findAll','options','raw','where','attributes','limit','map','include','model','info','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment'];(function(_0x15ae7e,_0x55f4ea){var _0x21386c=function(_0x31cf16){while(--_0x31cf16){_0x15ae7e['push'](_0x15ae7e['shift']());}};_0x21386c(++_0x55f4ea);}(_0x5a75,0xeb));var _0x55a7=function(_0x2e68db,_0x275d04){_0x2e68db=_0x2e68db-0x0;var _0x12df4c=_0x5a75[_0x2e68db];return _0x12df4c;};'use strict';var _=require(_0x55a7('0x0'));var util=require(_0x55a7('0x1'));var moment=require(_0x55a7('0x2'));var BPromise=require('bluebird');var rs=require(_0x55a7('0x3'));var fs=require('fs');var Redis=require(_0x55a7('0x4'));var db=require(_0x55a7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x55a7('0x6'))(_0x55a7('0x7'));var config=require('../../config/environment');var jayson=require(_0x55a7('0x8'));var client=jayson[_0x55a7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19157c,_0x32d176,_0x2ff1b0){return new BPromise(function(_0x4c9303,_0x407000){return client[_0x55a7('0xa')](_0x19157c,_0x2ff1b0)[_0x55a7('0xb')](function(_0x48acc0){logger['info'](_0x55a7('0xc'),_0x32d176,_0x55a7('0xd'));logger[_0x55a7('0xe')](_0x55a7('0xf'),_0x32d176,'request\x20sent',JSON['stringify'](_0x48acc0));if(_0x48acc0[_0x55a7('0x10')]){if(_0x48acc0[_0x55a7('0x10')][_0x55a7('0x11')]===0x1f4){logger['error'](_0x55a7('0xc'),_0x32d176,_0x48acc0[_0x55a7('0x10')][_0x55a7('0x12')]);return _0x407000(_0x48acc0[_0x55a7('0x10')][_0x55a7('0x12')]);}logger[_0x55a7('0x10')](_0x55a7('0xc'),_0x32d176,_0x48acc0['error'][_0x55a7('0x12')]);return _0x4c9303(_0x48acc0['error'][_0x55a7('0x12')]);}else{logger['info'](_0x55a7('0xc'),_0x32d176,'request\x20sent');_0x4c9303(_0x48acc0['result'][_0x55a7('0x12')]);}})[_0x55a7('0x13')](function(_0x8f5061){logger[_0x55a7('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x32d176,_0x8f5061);_0x407000(_0x8f5061);});});}exports['GetVtigerAccount']=function(_0x597802){var _0xfc39fc=this;return new Promise(function(_0x549f71,_0x56e9c2){return db[_0x55a7('0x14')][_0x55a7('0x15')]({'raw':_0x597802['options']?_0x597802[_0x55a7('0x16')][_0x55a7('0x17')]===undefined?!![]:![]:!![],'where':_0x597802['options']?_0x597802[_0x55a7('0x16')][_0x55a7('0x18')]||null:null,'attributes':_0x597802[_0x55a7('0x16')]?_0x597802[_0x55a7('0x16')][_0x55a7('0x19')]||null:null,'limit':_0x597802[_0x55a7('0x16')]?_0x597802[_0x55a7('0x16')][_0x55a7('0x1a')]||null:null,'include':_0x597802[_0x55a7('0x16')]?_0x597802[_0x55a7('0x16')]['include']?_[_0x55a7('0x1b')](_0x597802[_0x55a7('0x16')][_0x55a7('0x1c')],function(_0x8755e){return{'model':db[_0x8755e[_0x55a7('0x1d')]],'as':_0x8755e['as'],'attributes':_0x8755e[_0x55a7('0x19')],'include':_0x8755e['include']?_[_0x55a7('0x1b')](_0x8755e['include'],function(_0x4ae990){return{'model':db[_0x4ae990['model']],'as':_0x4ae990['as'],'attributes':_0x4ae990[_0x55a7('0x19')],'include':_0x4ae990['include']?_[_0x55a7('0x1b')](_0x4ae990[_0x55a7('0x1c')],function(_0x4c5ca0){return{'model':db[_0x4c5ca0[_0x55a7('0x1d')]],'as':_0x4c5ca0['as'],'attributes':_0x4c5ca0['attributes']};}):[]};}):[]};}):[]:[]})[_0x55a7('0xb')](function(_0x1a359b){logger[_0x55a7('0x1e')](_0x55a7('0x1f'),_0x597802);logger[_0x55a7('0xe')](_0x55a7('0x1f'),_0x597802,JSON['stringify'](_0x1a359b));_0x549f71(_0x1a359b);})[_0x55a7('0x13')](function(_0x28e355){logger[_0x55a7('0x10')](_0x55a7('0x1f'),_0x28e355[_0x55a7('0x12')],_0x597802);_0x56e9c2(_0xfc39fc['error'](0x1f4,_0x28e355[_0x55a7('0x12')]));});});};exports[_0x55a7('0x20')]=function(_0x295cc8){var _0x33dd27=this;return new Promise(function(_0x401a42,_0x8ee4c){return db[_0x55a7('0x14')][_0x55a7('0x21')]({'raw':_0x295cc8[_0x55a7('0x16')]?_0x295cc8['options']['raw']===undefined?!![]:![]:!![],'where':_0x295cc8[_0x55a7('0x16')]?_0x295cc8[_0x55a7('0x16')][_0x55a7('0x18')]||null:null,'attributes':_0x295cc8[_0x55a7('0x16')]?_0x295cc8[_0x55a7('0x16')]['attributes']||null:null,'include':_0x295cc8[_0x55a7('0x16')]?_0x295cc8[_0x55a7('0x16')]['include']?_[_0x55a7('0x1b')](_0x295cc8[_0x55a7('0x16')][_0x55a7('0x1c')],function(_0x7ee4d7){return{'model':db[_0x7ee4d7[_0x55a7('0x1d')]],'as':_0x7ee4d7['as'],'attributes':_0x7ee4d7['attributes'],'include':_0x7ee4d7['include']?_[_0x55a7('0x1b')](_0x7ee4d7[_0x55a7('0x1c')],function(_0x5403bf){return{'model':db[_0x5403bf[_0x55a7('0x1d')]],'as':_0x5403bf['as'],'attributes':_0x5403bf[_0x55a7('0x19')],'include':_0x5403bf['include']?_['map'](_0x5403bf[_0x55a7('0x1c')],function(_0x5df80b){return{'model':db[_0x5df80b['model']],'as':_0x5df80b['as'],'attributes':_0x5df80b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x576c2b){logger[_0x55a7('0x1e')](_0x55a7('0x20'),_0x295cc8);logger['debug'](_0x55a7('0x20'),_0x295cc8,JSON['stringify'](_0x576c2b));_0x401a42(_0x576c2b);})[_0x55a7('0x13')](function(_0x19adaa){logger[_0x55a7('0x10')]('ShowVtigerAccount',_0x19adaa[_0x55a7('0x12')],_0x295cc8);_0x8ee4c(_0x33dd27[_0x55a7('0x10')](0x1f4,_0x19adaa['message']));});});}; \ No newline at end of file +var _0x7232=['options','raw','attributes','include','map','model','GetVtigerAccount','where','ShowVtigerAccount','lodash','util','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll'];(function(_0x11c402,_0x14258c){var _0x1db251=function(_0x30e017){while(--_0x30e017){_0x11c402['push'](_0x11c402['shift']());}};_0x1db251(++_0x14258c);}(_0x7232,0x195));var _0x2723=function(_0x159828,_0x332273){_0x159828=_0x159828-0x0;var _0x4d61ca=_0x7232[_0x159828];return _0x4d61ca;};'use strict';var _=require(_0x2723('0x0'));var util=require(_0x2723('0x1'));var moment=require('moment');var BPromise=require(_0x2723('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2723('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2723('0x4'));var config=require(_0x2723('0x5'));var jayson=require(_0x2723('0x6'));var client=jayson[_0x2723('0x7')][_0x2723('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1907ad,_0x1f269f,_0x4afbb9){return new BPromise(function(_0x321f19,_0x599cd1){return client[_0x2723('0x9')](_0x1907ad,_0x4afbb9)[_0x2723('0xa')](function(_0x1717fe){logger[_0x2723('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x1f269f,_0x2723('0xc'));logger[_0x2723('0xd')](_0x2723('0xe'),_0x1f269f,'request\x20sent',JSON[_0x2723('0xf')](_0x1717fe));if(_0x1717fe[_0x2723('0x10')]){if(_0x1717fe[_0x2723('0x10')][_0x2723('0x11')]===0x1f4){logger[_0x2723('0x10')](_0x2723('0x12'),_0x1f269f,_0x1717fe[_0x2723('0x10')][_0x2723('0x13')]);return _0x599cd1(_0x1717fe[_0x2723('0x10')][_0x2723('0x13')]);}logger['error'](_0x2723('0x12'),_0x1f269f,_0x1717fe['error'][_0x2723('0x13')]);return _0x321f19(_0x1717fe['error'][_0x2723('0x13')]);}else{logger['info'](_0x2723('0x12'),_0x1f269f,_0x2723('0xc'));_0x321f19(_0x1717fe[_0x2723('0x14')]['message']);}})[_0x2723('0x15')](function(_0x1f19c9){logger[_0x2723('0x10')](_0x2723('0x12'),_0x1f269f,_0x1f19c9);_0x599cd1(_0x1f19c9);});});}exports['GetVtigerAccount']=function(_0x3fb2ac){var _0x4504c2=this;return new Promise(function(_0x15c0db,_0x21787d){return db[_0x2723('0x16')][_0x2723('0x17')]({'raw':_0x3fb2ac[_0x2723('0x18')]?_0x3fb2ac[_0x2723('0x18')][_0x2723('0x19')]===undefined?!![]:![]:!![],'where':_0x3fb2ac[_0x2723('0x18')]?_0x3fb2ac[_0x2723('0x18')]['where']||null:null,'attributes':_0x3fb2ac[_0x2723('0x18')]?_0x3fb2ac['options'][_0x2723('0x1a')]||null:null,'limit':_0x3fb2ac[_0x2723('0x18')]?_0x3fb2ac[_0x2723('0x18')]['limit']||null:null,'include':_0x3fb2ac[_0x2723('0x18')]?_0x3fb2ac[_0x2723('0x18')][_0x2723('0x1b')]?_[_0x2723('0x1c')](_0x3fb2ac[_0x2723('0x18')]['include'],function(_0x53b08f){return{'model':db[_0x53b08f[_0x2723('0x1d')]],'as':_0x53b08f['as'],'attributes':_0x53b08f[_0x2723('0x1a')],'include':_0x53b08f[_0x2723('0x1b')]?_[_0x2723('0x1c')](_0x53b08f[_0x2723('0x1b')],function(_0x5ef592){return{'model':db[_0x5ef592[_0x2723('0x1d')]],'as':_0x5ef592['as'],'attributes':_0x5ef592[_0x2723('0x1a')],'include':_0x5ef592[_0x2723('0x1b')]?_[_0x2723('0x1c')](_0x5ef592[_0x2723('0x1b')],function(_0x30dcec){return{'model':db[_0x30dcec[_0x2723('0x1d')]],'as':_0x30dcec['as'],'attributes':_0x30dcec[_0x2723('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2723('0xa')](function(_0x353c5b){logger[_0x2723('0xb')]('GetVtigerAccount',_0x3fb2ac);logger[_0x2723('0xd')]('GetVtigerAccount',_0x3fb2ac,JSON[_0x2723('0xf')](_0x353c5b));_0x15c0db(_0x353c5b);})['catch'](function(_0x373cb5){logger[_0x2723('0x10')](_0x2723('0x1e'),_0x373cb5[_0x2723('0x13')],_0x3fb2ac);_0x21787d(_0x4504c2[_0x2723('0x10')](0x1f4,_0x373cb5[_0x2723('0x13')]));});});};exports['ShowVtigerAccount']=function(_0x25b2fd){var _0x176b66=this;return new Promise(function(_0x2af2bb,_0x3d5bb8){return db[_0x2723('0x16')]['find']({'raw':_0x25b2fd[_0x2723('0x18')]?_0x25b2fd['options'][_0x2723('0x19')]===undefined?!![]:![]:!![],'where':_0x25b2fd[_0x2723('0x18')]?_0x25b2fd['options'][_0x2723('0x1f')]||null:null,'attributes':_0x25b2fd['options']?_0x25b2fd[_0x2723('0x18')][_0x2723('0x1a')]||null:null,'include':_0x25b2fd[_0x2723('0x18')]?_0x25b2fd['options'][_0x2723('0x1b')]?_[_0x2723('0x1c')](_0x25b2fd[_0x2723('0x18')][_0x2723('0x1b')],function(_0x5a9f36){return{'model':db[_0x5a9f36[_0x2723('0x1d')]],'as':_0x5a9f36['as'],'attributes':_0x5a9f36['attributes'],'include':_0x5a9f36[_0x2723('0x1b')]?_[_0x2723('0x1c')](_0x5a9f36[_0x2723('0x1b')],function(_0xb47c0d){return{'model':db[_0xb47c0d[_0x2723('0x1d')]],'as':_0xb47c0d['as'],'attributes':_0xb47c0d[_0x2723('0x1a')],'include':_0xb47c0d['include']?_[_0x2723('0x1c')](_0xb47c0d[_0x2723('0x1b')],function(_0x4c277d){return{'model':db[_0x4c277d['model']],'as':_0x4c277d['as'],'attributes':_0x4c277d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x31ba56){logger['info']('ShowVtigerAccount',_0x25b2fd);logger[_0x2723('0xd')](_0x2723('0x20'),_0x25b2fd,JSON['stringify'](_0x31ba56));_0x2af2bb(_0x31ba56);})[_0x2723('0x15')](function(_0x182cb2){logger[_0x2723('0x10')](_0x2723('0x20'),_0x182cb2[_0x2723('0x13')],_0x25b2fd);_0x3d5bb8(_0x176b66['error'](0x1f4,_0x182cb2['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 269f3aa..71865de 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 _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x36c2b2,_0x390508){var _0x154b9a=function(_0x2ba57c){while(--_0x2ba57c){_0x36c2b2['push'](_0x36c2b2['shift']());}};_0x154b9a(++_0x390508);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d4364,_0x4a6c71){_0x5d4364=_0x5d4364-0x0;var _0x460809=_0xb10b[_0x5d4364];return _0x460809;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file +var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x509678,_0x542f94){var _0x46d2fd=function(_0x52893d){while(--_0x52893d){_0x509678['push'](_0x509678['shift']());}};_0x46d2fd(++_0x542f94);}(_0xb10b,0x12a));var _0xbb10=function(_0x4aa78a,_0x15c09c){_0x4aa78a=_0x4aa78a-0x0;var _0x444b3b=_0xb10b[_0x4aa78a];return _0x444b3b;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index d79cde7..51c1467 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 _0x67da=['exports','STRING'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x67da,0x10a));var _0xa67d=function(_0x54cc89,_0x356323){_0x54cc89=_0x54cc89-0x0;var _0x38fada=_0x67da[_0x54cc89];return _0x38fada;};'use strict';var Sequelize=require('sequelize');module[_0xa67d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa67d('0x1')]}}; \ No newline at end of file +var _0xd95a=['sequelize','STRING'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0xd95a,0xa0));var _0xad95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd95a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xad95('0x0'));module['exports']={'name':{'type':Sequelize[_0xad95('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 9a272f3..d0ecaec 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 _0x4bd3=['limit','set','Content-Range','reject','update','destroy','sendStatus','stack','name','send','rawAttributes','model','keys','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','type','key','filter','options','VtigerConfiguration','then','rows','params','filters','intersection','include','find','create','body','getFields','findOne','hasOwnProperty','getSubjects','VtigerField','getDescriptions','html-pdf','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','request','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','status','end','json','count','offset'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x4bd3,0x174));var _0x34bd=function(_0x4f0656,_0x2e93fb){_0x4f0656=_0x4f0656-0x0;var _0x31bdef=_0x4bd3[_0x4f0656];return _0x31bdef;};'use strict';var pdf=require(_0x34bd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x34bd('0x1'));var zipdir=require(_0x34bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x34bd('0x3'));var Mustache=require(_0x34bd('0x4'));var util=require(_0x34bd('0x5'));var path=require('path');var sox=require(_0x34bd('0x6'));var csv=require(_0x34bd('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x34bd('0x8'));var squel=require(_0x34bd('0x9'));var crypto=require('crypto');var jsforce=require(_0x34bd('0xa'));var deskjs=require(_0x34bd('0xb'));var toCsv=require(_0x34bd('0x7'));var querystring=require(_0x34bd('0xc'));var Papa=require(_0x34bd('0xd'));var authService=require(_0x34bd('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x34bd('0xf'));var qs=require(_0x34bd('0x10'));var logger=require(_0x34bd('0x11'))(_0x34bd('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x34bd('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x34bd('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x1f19b9,_0x282af4,_0x1d627d,_0x2ee180){return new BPromise(function(_0x14cd37,_0x4134ee){var _0x236f6b=_0x2ee180||client;return _0x236f6b[_0x34bd('0x15')](_0x1f19b9,_0x1d627d)['then'](function(_0x3fa6a8){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x282af4,_0x34bd('0x16'));logger[_0x34bd('0x17')](_0x34bd('0x18'),_0x282af4,_0x34bd('0x16'),JSON[_0x34bd('0x19')](_0x3fa6a8));if(_0x3fa6a8[_0x34bd('0x1a')]){if(_0x3fa6a8[_0x34bd('0x1a')][_0x34bd('0x1b')]===0x1f4){logger[_0x34bd('0x1a')](_0x34bd('0x1c'),_0x282af4,_0x3fa6a8[_0x34bd('0x1a')]['message']);return _0x4134ee(_0x3fa6a8[_0x34bd('0x1a')][_0x34bd('0x1d')]);}logger[_0x34bd('0x1a')](_0x34bd('0x1c'),_0x282af4,_0x3fa6a8[_0x34bd('0x1a')][_0x34bd('0x1d')]);return _0x14cd37(_0x3fa6a8[_0x34bd('0x1a')][_0x34bd('0x1d')]);}else{logger[_0x34bd('0x1e')]('VtigerConfiguration,\x20%s,\x20%s',_0x282af4,_0x34bd('0x16'));_0x14cd37(_0x3fa6a8[_0x34bd('0x1f')][_0x34bd('0x1d')]);}})[_0x34bd('0x20')](function(_0x463224){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x282af4,_0x463224);_0x4134ee(_0x463224);});});}function respondWithStatusCode(_0x5da62a,_0x4edf84){_0x4edf84=_0x4edf84||0xcc;return function(_0x3dafe8){if(_0x3dafe8){return _0x5da62a['sendStatus'](_0x4edf84);}return _0x5da62a[_0x34bd('0x21')](_0x4edf84)[_0x34bd('0x22')]();};}function respondWithResult(_0x428140,_0x5c3c85){_0x5c3c85=_0x5c3c85||0xc8;return function(_0x41bffd){if(_0x41bffd){return _0x428140[_0x34bd('0x21')](_0x5c3c85)[_0x34bd('0x23')](_0x41bffd);}};}function respondWithFilteredResult(_0x457006,_0x5be702){return function(_0x29bda8){if(_0x29bda8){var _0xb256e8=_0x29bda8[_0x34bd('0x24')],_0x264c94=_0x5be702[_0x34bd('0x25')],_0x3e4dc3=_0x5be702['offset']+_0x5be702[_0x34bd('0x26')],_0x56baf7;if(_0x3e4dc3>=_0xb256e8){_0x3e4dc3=_0xb256e8;_0x56baf7=0xc8;}else{_0x56baf7=0xce;}_0x457006[_0x34bd('0x21')](_0x56baf7);return _0x457006[_0x34bd('0x27')](_0x34bd('0x28'),_0x264c94+'-'+_0x3e4dc3+'/'+_0xb256e8)[_0x34bd('0x23')](_0x29bda8);}return null;};}function patchUpdates(_0x4500c8){return function(_0x177d43){try{jsonpatch['apply'](_0x177d43,_0x4500c8,!![]);}catch(_0x43b92d){return BPromise[_0x34bd('0x29')](_0x43b92d);}return _0x177d43['save']();};}function saveUpdates(_0x5d1662,_0x38bdba){return function(_0xca9897){if(_0xca9897){return _0xca9897[_0x34bd('0x2a')](_0x5d1662)['then'](function(_0x4c786c){return _0x4c786c;});}return null;};}function removeEntity(_0x3cf514,_0x386ee6){return function(_0x1387b5){if(_0x1387b5){return _0x1387b5[_0x34bd('0x2b')]()['then'](function(){_0x3cf514[_0x34bd('0x21')](0xcc)[_0x34bd('0x22')]();});}};}function handleEntityNotFound(_0x41ca58,_0x17296b){return function(_0x2ef58f){if(!_0x2ef58f){_0x41ca58[_0x34bd('0x2c')](0x194);}return _0x2ef58f;};}function handleError(_0x4ae886,_0x72bb10){_0x72bb10=_0x72bb10||0x1f4;return function(_0x4b3587){logger[_0x34bd('0x1a')](_0x4b3587[_0x34bd('0x2d')]);if(_0x4b3587[_0x34bd('0x2e')]){delete _0x4b3587['name'];}_0x4ae886[_0x34bd('0x21')](_0x72bb10)[_0x34bd('0x2f')](_0x4b3587);};}exports['index']=function(_0x3c5e1d,_0x21c7d6){var _0x2b81ca={},_0x4d0a02={},_0x1574c8={'count':0x0,'rows':[]};var _0x235576=db['VtigerConfiguration'][_0x34bd('0x30')];_0x4d0a02[_0x34bd('0x31')]=_[_0x34bd('0x32')](_0x235576);_0x4d0a02[_0x34bd('0x33')]=_[_0x34bd('0x32')](_0x3c5e1d[_0x34bd('0x33')]);_0x4d0a02['filters']=_['intersection'](_0x4d0a02['model'],_0x4d0a02[_0x34bd('0x33')]);_0x2b81ca[_0x34bd('0x34')]=_['intersection'](_0x4d0a02['model'],qs[_0x34bd('0x35')](_0x3c5e1d['query']['fields']));_0x2b81ca[_0x34bd('0x34')]=_0x2b81ca[_0x34bd('0x34')][_0x34bd('0x36')]?_0x2b81ca[_0x34bd('0x34')]:_0x4d0a02[_0x34bd('0x31')];if(!_0x3c5e1d['query']['hasOwnProperty'](_0x34bd('0x37'))){_0x2b81ca['limit']=qs[_0x34bd('0x26')](_0x3c5e1d[_0x34bd('0x33')][_0x34bd('0x26')]);_0x2b81ca[_0x34bd('0x25')]=qs[_0x34bd('0x25')](_0x3c5e1d['query'][_0x34bd('0x25')]);}_0x2b81ca[_0x34bd('0x38')]=qs[_0x34bd('0x39')](_0x3c5e1d[_0x34bd('0x33')]['sort']);_0x2b81ca[_0x34bd('0x3a')]=qs['filters'](_[_0x34bd('0x3b')](_0x3c5e1d[_0x34bd('0x33')],_0x4d0a02['filters']));if(_0x3c5e1d[_0x34bd('0x33')]['filter']){_0x2b81ca[_0x34bd('0x3a')]=_[_0x34bd('0x3c')](_0x2b81ca[_0x34bd('0x3a')],{'$or':_[_0x34bd('0x3d')](_0x235576,function(_0x26d73e){if(_0x26d73e[_0x34bd('0x3e')][_0x34bd('0x3f')]!=='VIRTUAL'){var _0x4986bb={};_0x4986bb[_0x26d73e['field']]={'$like':'%'+_0x3c5e1d[_0x34bd('0x33')][_0x34bd('0x40')]+'%'};return _0x4986bb;}})});}_0x2b81ca=_[_0x34bd('0x3c')]({},_0x2b81ca,_0x3c5e1d[_0x34bd('0x41')]);var _0x514fb3={'where':_0x2b81ca[_0x34bd('0x3a')]};return db[_0x34bd('0x42')][_0x34bd('0x24')](_0x514fb3)[_0x34bd('0x43')](function(_0x109e7b){_0x1574c8['count']=_0x109e7b;if(_0x3c5e1d[_0x34bd('0x33')]['includeAll']){_0x2b81ca['include']=[{'all':!![]}];}return db[_0x34bd('0x42')]['findAll'](_0x2b81ca);})[_0x34bd('0x43')](function(_0x293457){_0x1574c8[_0x34bd('0x44')]=_0x293457;return _0x1574c8;})[_0x34bd('0x43')](respondWithFilteredResult(_0x21c7d6,_0x2b81ca))[_0x34bd('0x20')](handleError(_0x21c7d6,null));};exports['show']=function(_0x4d22ff,_0x33e8e8){var _0x51f892={'raw':![],'where':{'id':_0x4d22ff[_0x34bd('0x45')]['id']}},_0x1f3db3={};_0x1f3db3[_0x34bd('0x31')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x1f3db3['query']=_[_0x34bd('0x32')](_0x4d22ff['query']);_0x1f3db3[_0x34bd('0x46')]=_['intersection'](_0x1f3db3[_0x34bd('0x31')],_0x1f3db3[_0x34bd('0x33')]);_0x51f892[_0x34bd('0x34')]=_[_0x34bd('0x47')](_0x1f3db3[_0x34bd('0x31')],qs['fields'](_0x4d22ff[_0x34bd('0x33')][_0x34bd('0x35')]));_0x51f892[_0x34bd('0x34')]=_0x51f892[_0x34bd('0x34')][_0x34bd('0x36')]?_0x51f892['attributes']:_0x1f3db3[_0x34bd('0x31')];if(_0x4d22ff[_0x34bd('0x33')]['includeAll']){_0x51f892[_0x34bd('0x48')]=[{'all':!![]}];}_0x51f892=_[_0x34bd('0x3c')]({},_0x51f892,_0x4d22ff['options']);return db['VtigerConfiguration'][_0x34bd('0x49')](_0x51f892)['then'](handleEntityNotFound(_0x33e8e8,null))['then'](respondWithResult(_0x33e8e8,null))[_0x34bd('0x20')](handleError(_0x33e8e8,null));};exports[_0x34bd('0x4a')]=function(_0x556ce8,_0x52d479){return db['VtigerConfiguration']['create'](_0x556ce8[_0x34bd('0x4b')],{})[_0x34bd('0x43')](respondWithResult(_0x52d479,0xc9))['catch'](handleError(_0x52d479,null));};exports['update']=function(_0x5a95f1,_0x477fd4){if(_0x5a95f1[_0x34bd('0x4b')]['id']){delete _0x5a95f1['body']['id'];}return db[_0x34bd('0x42')][_0x34bd('0x49')]({'where':{'id':_0x5a95f1[_0x34bd('0x45')]['id']}})[_0x34bd('0x43')](handleEntityNotFound(_0x477fd4,null))[_0x34bd('0x43')](saveUpdates(_0x5a95f1[_0x34bd('0x4b')],null))['then'](respondWithResult(_0x477fd4,null))[_0x34bd('0x20')](handleError(_0x477fd4,null));};exports[_0x34bd('0x2b')]=function(_0xbade43,_0x26294a){return db['VtigerConfiguration'][_0x34bd('0x49')]({'where':{'id':_0xbade43['params']['id']}})[_0x34bd('0x43')](handleEntityNotFound(_0x26294a,null))['then'](removeEntity(_0x26294a,null))[_0x34bd('0x20')](handleError(_0x26294a,null));};exports[_0x34bd('0x4c')]=function(_0x2a428a,_0xc7c58a,_0xd5b451){var _0x418fa5={};var _0x6db4ba={};var _0x28394c;var _0x4768f8;return db[_0x34bd('0x42')][_0x34bd('0x4d')]({'where':{'id':_0x2a428a['params']['id']}})[_0x34bd('0x43')](handleEntityNotFound(_0xc7c58a,null))['then'](function(_0x15fea7){if(_0x15fea7){_0x28394c=_0x15fea7;_0x6db4ba['model']=_[_0x34bd('0x32')](db['VtigerField'][_0x34bd('0x30')]);_0x6db4ba[_0x34bd('0x33')]=_[_0x34bd('0x32')](_0x2a428a[_0x34bd('0x33')]);_0x6db4ba[_0x34bd('0x46')]=_[_0x34bd('0x47')](_0x6db4ba[_0x34bd('0x31')],_0x6db4ba[_0x34bd('0x33')]);_0x418fa5[_0x34bd('0x34')]=_[_0x34bd('0x47')](_0x6db4ba[_0x34bd('0x31')],qs[_0x34bd('0x35')](_0x2a428a[_0x34bd('0x33')][_0x34bd('0x35')]));_0x418fa5[_0x34bd('0x34')]=_0x418fa5['attributes']['length']?_0x418fa5[_0x34bd('0x34')]:_0x6db4ba[_0x34bd('0x31')];_0x418fa5[_0x34bd('0x38')]=qs[_0x34bd('0x39')](_0x2a428a[_0x34bd('0x33')]['sort']);_0x418fa5['where']=qs['filters'](_['pick'](_0x2a428a[_0x34bd('0x33')],_0x6db4ba[_0x34bd('0x46')]));if(_0x2a428a['query'][_0x34bd('0x40')]){_0x418fa5[_0x34bd('0x3a')]=_[_0x34bd('0x3c')](_0x418fa5['where'],{'$or':_[_0x34bd('0x3d')](_0x418fa5[_0x34bd('0x34')],function(_0x2fac2a){var _0x344be3={};_0x344be3[_0x2fac2a]={'$like':'%'+_0x2a428a[_0x34bd('0x33')][_0x34bd('0x40')]+'%'};return _0x344be3;})});}_0x418fa5=_[_0x34bd('0x3c')]({},_0x418fa5,_0x2a428a[_0x34bd('0x41')]);return _0x28394c['getFields'](_0x418fa5);}})['then'](function(_0xabf582){if(_0xabf582){_0x4768f8=_0xabf582['length'];if(!_0x2a428a[_0x34bd('0x33')][_0x34bd('0x4e')](_0x34bd('0x37'))){_0x418fa5['limit']=qs['limit'](_0x2a428a[_0x34bd('0x33')][_0x34bd('0x26')]);_0x418fa5[_0x34bd('0x25')]=qs['offset'](_0x2a428a['query'][_0x34bd('0x25')]);}return _0x28394c[_0x34bd('0x4c')](_0x418fa5);}})[_0x34bd('0x43')](function(_0x1f408a){if(_0x1f408a){return _0x1f408a?{'count':_0x4768f8,'rows':_0x1f408a}:null;}})[_0x34bd('0x43')](respondWithResult(_0xc7c58a,null))[_0x34bd('0x20')](handleError(_0xc7c58a,null));};exports[_0x34bd('0x4f')]=function(_0x42677f,_0x31bedd,_0x4f397f){var _0x4d3118={};var _0x3878a0={};var _0x4fab21;var _0x2b9bc3;return db[_0x34bd('0x42')][_0x34bd('0x4d')]({'where':{'id':_0x42677f[_0x34bd('0x45')]['id']}})['then'](handleEntityNotFound(_0x31bedd,null))['then'](function(_0x3d60fa){if(_0x3d60fa){_0x4fab21=_0x3d60fa;_0x3878a0[_0x34bd('0x31')]=_[_0x34bd('0x32')](db['VtigerField'][_0x34bd('0x30')]);_0x3878a0['query']=_[_0x34bd('0x32')](_0x42677f[_0x34bd('0x33')]);_0x3878a0[_0x34bd('0x46')]=_['intersection'](_0x3878a0[_0x34bd('0x31')],_0x3878a0['query']);_0x4d3118['attributes']=_[_0x34bd('0x47')](_0x3878a0[_0x34bd('0x31')],qs[_0x34bd('0x35')](_0x42677f['query'][_0x34bd('0x35')]));_0x4d3118[_0x34bd('0x34')]=_0x4d3118[_0x34bd('0x34')]['length']?_0x4d3118[_0x34bd('0x34')]:_0x3878a0[_0x34bd('0x31')];_0x4d3118[_0x34bd('0x38')]=qs[_0x34bd('0x39')](_0x42677f[_0x34bd('0x33')][_0x34bd('0x39')]);_0x4d3118[_0x34bd('0x3a')]=qs[_0x34bd('0x46')](_[_0x34bd('0x3b')](_0x42677f[_0x34bd('0x33')],_0x3878a0[_0x34bd('0x46')]));if(_0x42677f['query'][_0x34bd('0x40')]){_0x4d3118['where']=_[_0x34bd('0x3c')](_0x4d3118['where'],{'$or':_[_0x34bd('0x3d')](_0x4d3118[_0x34bd('0x34')],function(_0x28040c){var _0x1a6aaf={};_0x1a6aaf[_0x28040c]={'$like':'%'+_0x42677f[_0x34bd('0x33')][_0x34bd('0x40')]+'%'};return _0x1a6aaf;})});}_0x4d3118=_[_0x34bd('0x3c')]({},_0x4d3118,_0x42677f[_0x34bd('0x41')]);return _0x4fab21[_0x34bd('0x4f')](_0x4d3118);}})[_0x34bd('0x43')](function(_0x4ac734){if(_0x4ac734){_0x2b9bc3=_0x4ac734['length'];if(!_0x42677f[_0x34bd('0x33')][_0x34bd('0x4e')](_0x34bd('0x37'))){_0x4d3118['limit']=qs['limit'](_0x42677f['query'][_0x34bd('0x26')]);_0x4d3118[_0x34bd('0x25')]=qs[_0x34bd('0x25')](_0x42677f[_0x34bd('0x33')][_0x34bd('0x25')]);}return _0x4fab21['getSubjects'](_0x4d3118);}})[_0x34bd('0x43')](function(_0x4d94d0){if(_0x4d94d0){return _0x4d94d0?{'count':_0x2b9bc3,'rows':_0x4d94d0}:null;}})[_0x34bd('0x43')](respondWithResult(_0x31bedd,null))[_0x34bd('0x20')](handleError(_0x31bedd,null));};exports['getDescriptions']=function(_0x36ebad,_0x5df452,_0x242093){var _0x54f0db={};var _0x4c513a={};var _0x57cdea;var _0x397396;return db[_0x34bd('0x42')][_0x34bd('0x4d')]({'where':{'id':_0x36ebad[_0x34bd('0x45')]['id']}})[_0x34bd('0x43')](handleEntityNotFound(_0x5df452,null))[_0x34bd('0x43')](function(_0x1b7210){if(_0x1b7210){_0x57cdea=_0x1b7210;_0x4c513a[_0x34bd('0x31')]=_['keys'](db[_0x34bd('0x50')][_0x34bd('0x30')]);_0x4c513a[_0x34bd('0x33')]=_['keys'](_0x36ebad['query']);_0x4c513a['filters']=_[_0x34bd('0x47')](_0x4c513a[_0x34bd('0x31')],_0x4c513a['query']);_0x54f0db[_0x34bd('0x34')]=_['intersection'](_0x4c513a[_0x34bd('0x31')],qs[_0x34bd('0x35')](_0x36ebad[_0x34bd('0x33')]['fields']));_0x54f0db[_0x34bd('0x34')]=_0x54f0db['attributes'][_0x34bd('0x36')]?_0x54f0db[_0x34bd('0x34')]:_0x4c513a[_0x34bd('0x31')];_0x54f0db[_0x34bd('0x38')]=qs[_0x34bd('0x39')](_0x36ebad[_0x34bd('0x33')][_0x34bd('0x39')]);_0x54f0db[_0x34bd('0x3a')]=qs[_0x34bd('0x46')](_[_0x34bd('0x3b')](_0x36ebad[_0x34bd('0x33')],_0x4c513a[_0x34bd('0x46')]));if(_0x36ebad[_0x34bd('0x33')][_0x34bd('0x40')]){_0x54f0db['where']=_[_0x34bd('0x3c')](_0x54f0db[_0x34bd('0x3a')],{'$or':_[_0x34bd('0x3d')](_0x54f0db[_0x34bd('0x34')],function(_0x36aca5){var _0x49455c={};_0x49455c[_0x36aca5]={'$like':'%'+_0x36ebad[_0x34bd('0x33')][_0x34bd('0x40')]+'%'};return _0x49455c;})});}_0x54f0db=_[_0x34bd('0x3c')]({},_0x54f0db,_0x36ebad[_0x34bd('0x41')]);return _0x57cdea['getDescriptions'](_0x54f0db);}})[_0x34bd('0x43')](function(_0x572ac2){if(_0x572ac2){_0x397396=_0x572ac2['length'];if(!_0x36ebad['query']['hasOwnProperty'](_0x34bd('0x37'))){_0x54f0db[_0x34bd('0x26')]=qs[_0x34bd('0x26')](_0x36ebad['query'][_0x34bd('0x26')]);_0x54f0db[_0x34bd('0x25')]=qs[_0x34bd('0x25')](_0x36ebad[_0x34bd('0x33')][_0x34bd('0x25')]);}return _0x57cdea[_0x34bd('0x51')](_0x54f0db);}})[_0x34bd('0x43')](function(_0x5b0585){if(_0x5b0585){return _0x5b0585?{'count':_0x397396,'rows':_0x5b0585}:null;}})[_0x34bd('0x43')](respondWithResult(_0x5df452,null))[_0x34bd('0x20')](handleError(_0x5df452,null));}; \ No newline at end of file +var _0x4888=['jayson/promise','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','update','destroy','name','index','VtigerConfiguration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','findOne','VtigerField','map','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x4888,0x198));var _0x8488=function(_0x3feec6,_0x4db012){_0x3feec6=_0x3feec6-0x0;var _0x56d5e2=_0x4888[_0x3feec6];return _0x56d5e2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8488('0x0'));var rimraf=require(_0x8488('0x1'));var zipdir=require(_0x8488('0x2'));var jsonpatch=require(_0x8488('0x3'));var rp=require(_0x8488('0x4'));var moment=require(_0x8488('0x5'));var BPromise=require(_0x8488('0x6'));var Mustache=require('mustache');var util=require(_0x8488('0x7'));var path=require(_0x8488('0x8'));var sox=require(_0x8488('0x9'));var csv=require(_0x8488('0xa'));var ejs=require(_0x8488('0xb'));var fs=require('fs');var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0xa'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var authService=require(_0x8488('0xe'));var hardwareService=require(_0x8488('0xf'));var Redis=require(_0x8488('0x10'));var qs=require(_0x8488('0x11'));var logger=require('../../config/logger')(_0x8488('0x12'));var utils=require(_0x8488('0x13'));var config=require(_0x8488('0x14'));var db=require(_0x8488('0x15'))['db'];var jayson=require(_0x8488('0x16'));var client=jayson['client'][_0x8488('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x3d1f7a,_0x58f83d,_0x4a9ae2,_0x150b52){return new BPromise(function(_0x496dd1,_0x214083){var _0x4e94fc=_0x150b52||client;return _0x4e94fc['request'](_0x3d1f7a,_0x4a9ae2)[_0x8488('0x18')](function(_0x3635da){logger[_0x8488('0x19')](_0x8488('0x1a'),_0x58f83d,_0x8488('0x1b'));logger[_0x8488('0x1c')](_0x8488('0x1d'),_0x58f83d,'request\x20sent',JSON[_0x8488('0x1e')](_0x3635da));if(_0x3635da[_0x8488('0x1f')]){if(_0x3635da[_0x8488('0x1f')][_0x8488('0x20')]===0x1f4){logger[_0x8488('0x1f')](_0x8488('0x1a'),_0x58f83d,_0x3635da[_0x8488('0x1f')][_0x8488('0x21')]);return _0x214083(_0x3635da[_0x8488('0x1f')][_0x8488('0x21')]);}logger[_0x8488('0x1f')](_0x8488('0x1a'),_0x58f83d,_0x3635da[_0x8488('0x1f')]['message']);return _0x496dd1(_0x3635da['error'][_0x8488('0x21')]);}else{logger[_0x8488('0x19')](_0x8488('0x1a'),_0x58f83d,_0x8488('0x1b'));_0x496dd1(_0x3635da[_0x8488('0x22')][_0x8488('0x21')]);}})[_0x8488('0x23')](function(_0x3c078c){logger[_0x8488('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x58f83d,_0x3c078c);_0x214083(_0x3c078c);});});}function respondWithStatusCode(_0x476a14,_0x4e07e1){_0x4e07e1=_0x4e07e1||0xcc;return function(_0x140b0b){if(_0x140b0b){return _0x476a14[_0x8488('0x24')](_0x4e07e1);}return _0x476a14[_0x8488('0x25')](_0x4e07e1)['end']();};}function respondWithResult(_0x577234,_0x5b8885){_0x5b8885=_0x5b8885||0xc8;return function(_0x59b5e2){if(_0x59b5e2){return _0x577234[_0x8488('0x25')](_0x5b8885)['json'](_0x59b5e2);}};}function respondWithFilteredResult(_0x58057a,_0x26bdbb){return function(_0x2f350a){if(_0x2f350a){var _0x2b3c97=_0x2f350a[_0x8488('0x26')],_0x6ebee0=_0x26bdbb[_0x8488('0x27')],_0x287662=_0x26bdbb[_0x8488('0x27')]+_0x26bdbb[_0x8488('0x28')],_0x503b83;if(_0x287662>=_0x2b3c97){_0x287662=_0x2b3c97;_0x503b83=0xc8;}else{_0x503b83=0xce;}_0x58057a[_0x8488('0x25')](_0x503b83);return _0x58057a[_0x8488('0x29')](_0x8488('0x2a'),_0x6ebee0+'-'+_0x287662+'/'+_0x2b3c97)[_0x8488('0x2b')](_0x2f350a);}return null;};}function patchUpdates(_0x368f9c){return function(_0x1d9317){try{jsonpatch[_0x8488('0x2c')](_0x1d9317,_0x368f9c,!![]);}catch(_0x58d0cc){return BPromise['reject'](_0x58d0cc);}return _0x1d9317['save']();};}function saveUpdates(_0x292fe8,_0x408c36){return function(_0x19cf42){if(_0x19cf42){return _0x19cf42[_0x8488('0x2d')](_0x292fe8)[_0x8488('0x18')](function(_0x2f1399){return _0x2f1399;});}return null;};}function removeEntity(_0x4d3a03,_0x2292e0){return function(_0x14f378){if(_0x14f378){return _0x14f378[_0x8488('0x2e')]()[_0x8488('0x18')](function(){_0x4d3a03[_0x8488('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46c95b,_0x23f67a){return function(_0x579d50){if(!_0x579d50){_0x46c95b[_0x8488('0x24')](0x194);}return _0x579d50;};}function handleError(_0x21dff0,_0x4d3ed2){_0x4d3ed2=_0x4d3ed2||0x1f4;return function(_0x446f90){logger[_0x8488('0x1f')](_0x446f90['stack']);if(_0x446f90[_0x8488('0x2f')]){delete _0x446f90[_0x8488('0x2f')];}_0x21dff0[_0x8488('0x25')](_0x4d3ed2)['send'](_0x446f90);};}exports[_0x8488('0x30')]=function(_0x5bc335,_0x205ccc){var _0x2ac9f9={},_0x3ce30b={},_0x16b0cd={'count':0x0,'rows':[]};var _0x4c3b59=db[_0x8488('0x31')][_0x8488('0x32')];_0x3ce30b[_0x8488('0x33')]=_['keys'](_0x4c3b59);_0x3ce30b[_0x8488('0x34')]=_[_0x8488('0x35')](_0x5bc335[_0x8488('0x34')]);_0x3ce30b[_0x8488('0x36')]=_[_0x8488('0x37')](_0x3ce30b[_0x8488('0x33')],_0x3ce30b[_0x8488('0x34')]);_0x2ac9f9[_0x8488('0x38')]=_[_0x8488('0x37')](_0x3ce30b[_0x8488('0x33')],qs[_0x8488('0x39')](_0x5bc335['query']['fields']));_0x2ac9f9[_0x8488('0x38')]=_0x2ac9f9[_0x8488('0x38')][_0x8488('0x3a')]?_0x2ac9f9[_0x8488('0x38')]:_0x3ce30b[_0x8488('0x33')];if(!_0x5bc335[_0x8488('0x34')][_0x8488('0x3b')](_0x8488('0x3c'))){_0x2ac9f9[_0x8488('0x28')]=qs['limit'](_0x5bc335[_0x8488('0x34')][_0x8488('0x28')]);_0x2ac9f9[_0x8488('0x27')]=qs['offset'](_0x5bc335[_0x8488('0x34')][_0x8488('0x27')]);}_0x2ac9f9[_0x8488('0x3d')]=qs[_0x8488('0x3e')](_0x5bc335[_0x8488('0x34')][_0x8488('0x3e')]);_0x2ac9f9[_0x8488('0x3f')]=qs['filters'](_[_0x8488('0x40')](_0x5bc335[_0x8488('0x34')],_0x3ce30b[_0x8488('0x36')]));if(_0x5bc335['query'][_0x8488('0x41')]){_0x2ac9f9['where']=_[_0x8488('0x42')](_0x2ac9f9[_0x8488('0x3f')],{'$or':_['map'](_0x4c3b59,function(_0x22a3f3){if(_0x22a3f3[_0x8488('0x43')][_0x8488('0x44')]!==_0x8488('0x45')){var _0x2158b2={};_0x2158b2[_0x22a3f3['field']]={'$like':'%'+_0x5bc335[_0x8488('0x34')]['filter']+'%'};return _0x2158b2;}})});}_0x2ac9f9=_[_0x8488('0x42')]({},_0x2ac9f9,_0x5bc335[_0x8488('0x46')]);var _0x1bbc6f={'where':_0x2ac9f9[_0x8488('0x3f')]};return db[_0x8488('0x31')][_0x8488('0x26')](_0x1bbc6f)[_0x8488('0x18')](function(_0x192617){_0x16b0cd[_0x8488('0x26')]=_0x192617;if(_0x5bc335[_0x8488('0x34')][_0x8488('0x47')]){_0x2ac9f9[_0x8488('0x48')]=[{'all':!![]}];}return db[_0x8488('0x31')][_0x8488('0x49')](_0x2ac9f9);})[_0x8488('0x18')](function(_0x368170){_0x16b0cd[_0x8488('0x4a')]=_0x368170;return _0x16b0cd;})['then'](respondWithFilteredResult(_0x205ccc,_0x2ac9f9))[_0x8488('0x23')](handleError(_0x205ccc,null));};exports[_0x8488('0x4b')]=function(_0xb816a2,_0x206fd2){var _0x5067fa={'raw':![],'where':{'id':_0xb816a2[_0x8488('0x4c')]['id']}},_0x44e74f={};_0x44e74f[_0x8488('0x33')]=_[_0x8488('0x35')](db['VtigerConfiguration'][_0x8488('0x32')]);_0x44e74f[_0x8488('0x34')]=_[_0x8488('0x35')](_0xb816a2[_0x8488('0x34')]);_0x44e74f[_0x8488('0x36')]=_[_0x8488('0x37')](_0x44e74f[_0x8488('0x33')],_0x44e74f[_0x8488('0x34')]);_0x5067fa[_0x8488('0x38')]=_[_0x8488('0x37')](_0x44e74f[_0x8488('0x33')],qs[_0x8488('0x39')](_0xb816a2[_0x8488('0x34')]['fields']));_0x5067fa['attributes']=_0x5067fa[_0x8488('0x38')][_0x8488('0x3a')]?_0x5067fa[_0x8488('0x38')]:_0x44e74f[_0x8488('0x33')];if(_0xb816a2[_0x8488('0x34')][_0x8488('0x47')]){_0x5067fa[_0x8488('0x48')]=[{'all':!![]}];}_0x5067fa=_[_0x8488('0x42')]({},_0x5067fa,_0xb816a2[_0x8488('0x46')]);return db['VtigerConfiguration'][_0x8488('0x4d')](_0x5067fa)[_0x8488('0x18')](handleEntityNotFound(_0x206fd2,null))['then'](respondWithResult(_0x206fd2,null))[_0x8488('0x23')](handleError(_0x206fd2,null));};exports[_0x8488('0x4e')]=function(_0x186747,_0x1ff9c5){return db['VtigerConfiguration'][_0x8488('0x4e')](_0x186747[_0x8488('0x4f')],{})[_0x8488('0x18')](respondWithResult(_0x1ff9c5,0xc9))['catch'](handleError(_0x1ff9c5,null));};exports[_0x8488('0x2d')]=function(_0x30d0d8,_0x1bed0e){if(_0x30d0d8[_0x8488('0x4f')]['id']){delete _0x30d0d8['body']['id'];}return db[_0x8488('0x31')]['find']({'where':{'id':_0x30d0d8['params']['id']}})[_0x8488('0x18')](handleEntityNotFound(_0x1bed0e,null))['then'](saveUpdates(_0x30d0d8[_0x8488('0x4f')],null))[_0x8488('0x18')](respondWithResult(_0x1bed0e,null))[_0x8488('0x23')](handleError(_0x1bed0e,null));};exports[_0x8488('0x2e')]=function(_0x45c8b8,_0x362b00){return db['VtigerConfiguration'][_0x8488('0x4d')]({'where':{'id':_0x45c8b8[_0x8488('0x4c')]['id']}})[_0x8488('0x18')](handleEntityNotFound(_0x362b00,null))[_0x8488('0x18')](removeEntity(_0x362b00,null))[_0x8488('0x23')](handleError(_0x362b00,null));};exports['getFields']=function(_0x4745ef,_0x5a04d7,_0x137f50){var _0x4f617c={};var _0x5da71e={};var _0x342188;var _0x4382ad;return db[_0x8488('0x31')][_0x8488('0x50')]({'where':{'id':_0x4745ef[_0x8488('0x4c')]['id']}})[_0x8488('0x18')](handleEntityNotFound(_0x5a04d7,null))['then'](function(_0xb3574c){if(_0xb3574c){_0x342188=_0xb3574c;_0x5da71e['model']=_[_0x8488('0x35')](db[_0x8488('0x51')][_0x8488('0x32')]);_0x5da71e[_0x8488('0x34')]=_[_0x8488('0x35')](_0x4745ef[_0x8488('0x34')]);_0x5da71e['filters']=_[_0x8488('0x37')](_0x5da71e['model'],_0x5da71e[_0x8488('0x34')]);_0x4f617c[_0x8488('0x38')]=_[_0x8488('0x37')](_0x5da71e[_0x8488('0x33')],qs[_0x8488('0x39')](_0x4745ef[_0x8488('0x34')]['fields']));_0x4f617c['attributes']=_0x4f617c['attributes'][_0x8488('0x3a')]?_0x4f617c[_0x8488('0x38')]:_0x5da71e[_0x8488('0x33')];_0x4f617c[_0x8488('0x3d')]=qs[_0x8488('0x3e')](_0x4745ef[_0x8488('0x34')][_0x8488('0x3e')]);_0x4f617c[_0x8488('0x3f')]=qs[_0x8488('0x36')](_[_0x8488('0x40')](_0x4745ef['query'],_0x5da71e[_0x8488('0x36')]));if(_0x4745ef[_0x8488('0x34')][_0x8488('0x41')]){_0x4f617c['where']=_['merge'](_0x4f617c[_0x8488('0x3f')],{'$or':_[_0x8488('0x52')](_0x4f617c[_0x8488('0x38')],function(_0xf975a6){var _0x52bc90={};_0x52bc90[_0xf975a6]={'$like':'%'+_0x4745ef['query'][_0x8488('0x41')]+'%'};return _0x52bc90;})});}_0x4f617c=_[_0x8488('0x42')]({},_0x4f617c,_0x4745ef[_0x8488('0x46')]);return _0x342188['getFields'](_0x4f617c);}})[_0x8488('0x18')](function(_0x401f4d){if(_0x401f4d){_0x4382ad=_0x401f4d[_0x8488('0x3a')];if(!_0x4745ef[_0x8488('0x34')][_0x8488('0x3b')]('nolimit')){_0x4f617c[_0x8488('0x28')]=qs[_0x8488('0x28')](_0x4745ef['query'][_0x8488('0x28')]);_0x4f617c[_0x8488('0x27')]=qs['offset'](_0x4745ef[_0x8488('0x34')][_0x8488('0x27')]);}return _0x342188[_0x8488('0x53')](_0x4f617c);}})[_0x8488('0x18')](function(_0x493041){if(_0x493041){return _0x493041?{'count':_0x4382ad,'rows':_0x493041}:null;}})[_0x8488('0x18')](respondWithResult(_0x5a04d7,null))[_0x8488('0x23')](handleError(_0x5a04d7,null));};exports['getSubjects']=function(_0xfdb4dd,_0x3b7aa8,_0x480666){var _0x49ef10={};var _0x397683={};var _0x370a9c;var _0x3ff6c0;return db['VtigerConfiguration'][_0x8488('0x50')]({'where':{'id':_0xfdb4dd[_0x8488('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b7aa8,null))[_0x8488('0x18')](function(_0x59da4a){if(_0x59da4a){_0x370a9c=_0x59da4a;_0x397683[_0x8488('0x33')]=_[_0x8488('0x35')](db[_0x8488('0x51')]['rawAttributes']);_0x397683[_0x8488('0x34')]=_[_0x8488('0x35')](_0xfdb4dd['query']);_0x397683['filters']=_[_0x8488('0x37')](_0x397683[_0x8488('0x33')],_0x397683[_0x8488('0x34')]);_0x49ef10[_0x8488('0x38')]=_[_0x8488('0x37')](_0x397683[_0x8488('0x33')],qs[_0x8488('0x39')](_0xfdb4dd[_0x8488('0x34')][_0x8488('0x39')]));_0x49ef10[_0x8488('0x38')]=_0x49ef10['attributes'][_0x8488('0x3a')]?_0x49ef10['attributes']:_0x397683[_0x8488('0x33')];_0x49ef10[_0x8488('0x3d')]=qs[_0x8488('0x3e')](_0xfdb4dd[_0x8488('0x34')]['sort']);_0x49ef10[_0x8488('0x3f')]=qs[_0x8488('0x36')](_['pick'](_0xfdb4dd[_0x8488('0x34')],_0x397683['filters']));if(_0xfdb4dd[_0x8488('0x34')][_0x8488('0x41')]){_0x49ef10[_0x8488('0x3f')]=_[_0x8488('0x42')](_0x49ef10[_0x8488('0x3f')],{'$or':_[_0x8488('0x52')](_0x49ef10[_0x8488('0x38')],function(_0x452131){var _0x510f42={};_0x510f42[_0x452131]={'$like':'%'+_0xfdb4dd[_0x8488('0x34')]['filter']+'%'};return _0x510f42;})});}_0x49ef10=_['merge']({},_0x49ef10,_0xfdb4dd[_0x8488('0x46')]);return _0x370a9c[_0x8488('0x54')](_0x49ef10);}})[_0x8488('0x18')](function(_0x481e4b){if(_0x481e4b){_0x3ff6c0=_0x481e4b['length'];if(!_0xfdb4dd[_0x8488('0x34')][_0x8488('0x3b')]('nolimit')){_0x49ef10[_0x8488('0x28')]=qs[_0x8488('0x28')](_0xfdb4dd[_0x8488('0x34')][_0x8488('0x28')]);_0x49ef10[_0x8488('0x27')]=qs[_0x8488('0x27')](_0xfdb4dd['query'][_0x8488('0x27')]);}return _0x370a9c[_0x8488('0x54')](_0x49ef10);}})[_0x8488('0x18')](function(_0x4a2fd9){if(_0x4a2fd9){return _0x4a2fd9?{'count':_0x3ff6c0,'rows':_0x4a2fd9}:null;}})[_0x8488('0x18')](respondWithResult(_0x3b7aa8,null))[_0x8488('0x23')](handleError(_0x3b7aa8,null));};exports[_0x8488('0x55')]=function(_0x52e034,_0x28468b,_0xaf7f76){var _0x54918e={};var _0x48860c={};var _0x92f0ec;var _0x18c724;return db['VtigerConfiguration'][_0x8488('0x50')]({'where':{'id':_0x52e034[_0x8488('0x4c')]['id']}})['then'](handleEntityNotFound(_0x28468b,null))['then'](function(_0x877856){if(_0x877856){_0x92f0ec=_0x877856;_0x48860c['model']=_[_0x8488('0x35')](db[_0x8488('0x51')][_0x8488('0x32')]);_0x48860c[_0x8488('0x34')]=_['keys'](_0x52e034[_0x8488('0x34')]);_0x48860c['filters']=_[_0x8488('0x37')](_0x48860c['model'],_0x48860c[_0x8488('0x34')]);_0x54918e[_0x8488('0x38')]=_[_0x8488('0x37')](_0x48860c[_0x8488('0x33')],qs[_0x8488('0x39')](_0x52e034[_0x8488('0x34')][_0x8488('0x39')]));_0x54918e[_0x8488('0x38')]=_0x54918e[_0x8488('0x38')][_0x8488('0x3a')]?_0x54918e[_0x8488('0x38')]:_0x48860c[_0x8488('0x33')];_0x54918e[_0x8488('0x3d')]=qs[_0x8488('0x3e')](_0x52e034['query'][_0x8488('0x3e')]);_0x54918e[_0x8488('0x3f')]=qs['filters'](_[_0x8488('0x40')](_0x52e034[_0x8488('0x34')],_0x48860c[_0x8488('0x36')]));if(_0x52e034[_0x8488('0x34')][_0x8488('0x41')]){_0x54918e[_0x8488('0x3f')]=_[_0x8488('0x42')](_0x54918e[_0x8488('0x3f')],{'$or':_[_0x8488('0x52')](_0x54918e[_0x8488('0x38')],function(_0xfe2fbe){var _0x5e022a={};_0x5e022a[_0xfe2fbe]={'$like':'%'+_0x52e034[_0x8488('0x34')][_0x8488('0x41')]+'%'};return _0x5e022a;})});}_0x54918e=_['merge']({},_0x54918e,_0x52e034[_0x8488('0x46')]);return _0x92f0ec[_0x8488('0x55')](_0x54918e);}})[_0x8488('0x18')](function(_0x1099ae){if(_0x1099ae){_0x18c724=_0x1099ae[_0x8488('0x3a')];if(!_0x52e034['query']['hasOwnProperty'](_0x8488('0x3c'))){_0x54918e[_0x8488('0x28')]=qs[_0x8488('0x28')](_0x52e034[_0x8488('0x34')][_0x8488('0x28')]);_0x54918e[_0x8488('0x27')]=qs[_0x8488('0x27')](_0x52e034[_0x8488('0x34')][_0x8488('0x27')]);}return _0x92f0ec[_0x8488('0x55')](_0x54918e);}})[_0x8488('0x18')](function(_0xb045bc){if(_0xb045bc){return _0xb045bc?{'count':_0x18c724,'rows':_0xb045bc}:null;}})[_0x8488('0x18')](respondWithResult(_0x28468b,null))[_0x8488('0x23')](handleError(_0x28468b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 9c05c85..ba6fb30 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 _0x5d36=['exports','VtigerConfiguration','util','../../config/logger','api','bluebird','request-promise','./intVtigerConfiguration.attributes'];(function(_0x5a3359,_0x4bd12d){var _0x374727=function(_0x52b0cd){while(--_0x52b0cd){_0x5a3359['push'](_0x5a3359['shift']());}};_0x374727(++_0x4bd12d);}(_0x5d36,0x132));var _0x65d3=function(_0x2e440b,_0x540f27){_0x2e440b=_0x2e440b-0x0;var _0x46e1a4=_0x5d36[_0x2e440b];return _0x46e1a4;};'use strict';var _=require('lodash');var util=require(_0x65d3('0x0'));var logger=require(_0x65d3('0x1'))(_0x65d3('0x2'));var moment=require('moment');var BPromise=require(_0x65d3('0x3'));var rp=require(_0x65d3('0x4'));var attributes=require(_0x65d3('0x5'));module[_0x65d3('0x6')]=function(_0x5c5238,_0x3b4017){return _0x5c5238['define'](_0x65d3('0x7'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4798=['bluebird','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api'];(function(_0x55a780,_0x50788c){var _0x1fe30d=function(_0x2b05ba){while(--_0x2b05ba){_0x55a780['push'](_0x55a780['shift']());}};_0x1fe30d(++_0x50788c);}(_0x4798,0x185));var _0x8479=function(_0x2bc68d,_0x561c96){_0x2bc68d=_0x2bc68d-0x0;var _0x1eaca9=_0x4798[_0x2bc68d];return _0x1eaca9;};'use strict';var _=require('lodash');var util=require(_0x8479('0x0'));var logger=require(_0x8479('0x1'))(_0x8479('0x2'));var moment=require('moment');var BPromise=require(_0x8479('0x3'));var rp=require('request-promise');var attributes=require(_0x8479('0x4'));module[_0x8479('0x5')]=function(_0x26d05e,_0x57b47f){return _0x26d05e['define'](_0x8479('0x6'),attributes,{'tableName':_0x8479('0x7'),'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 b890532..8f56bd5 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 _0x8f7b=['message','info','result','catch','lodash','util','bluebird','../../config/logger','rpc','../../config/environment','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4a604a,_0xb471bb){var _0x48e2f6=function(_0x333d4e){while(--_0x333d4e){_0x4a604a['push'](_0x4a604a['shift']());}};_0x48e2f6(++_0xb471bb);}(_0x8f7b,0x1d8));var _0xb8f7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8f7b[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xb8f7('0x0'));var util=require(_0xb8f7('0x1'));var moment=require('moment');var BPromise=require(_0xb8f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb8f7('0x3'))(_0xb8f7('0x4'));var config=require(_0xb8f7('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e9961,_0x97bc55,_0x23facc){return new BPromise(function(_0x2c0301,_0x4a14c3){return client[_0xb8f7('0x6')](_0x2e9961,_0x23facc)[_0xb8f7('0x7')](function(_0x343c86){logger['info'](_0xb8f7('0x8'),_0x97bc55,_0xb8f7('0x9'));logger[_0xb8f7('0xa')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x97bc55,_0xb8f7('0x9'),JSON[_0xb8f7('0xb')](_0x343c86));if(_0x343c86[_0xb8f7('0xc')]){if(_0x343c86[_0xb8f7('0xc')][_0xb8f7('0xd')]===0x1f4){logger[_0xb8f7('0xc')](_0xb8f7('0x8'),_0x97bc55,_0x343c86[_0xb8f7('0xc')][_0xb8f7('0xe')]);return _0x4a14c3(_0x343c86[_0xb8f7('0xc')][_0xb8f7('0xe')]);}logger[_0xb8f7('0xc')](_0xb8f7('0x8'),_0x97bc55,_0x343c86[_0xb8f7('0xc')][_0xb8f7('0xe')]);return _0x2c0301(_0x343c86[_0xb8f7('0xc')][_0xb8f7('0xe')]);}else{logger[_0xb8f7('0xf')](_0xb8f7('0x8'),_0x97bc55,'request\x20sent');_0x2c0301(_0x343c86[_0xb8f7('0x10')]['message']);}})[_0xb8f7('0x11')](function(_0x14b966){logger[_0xb8f7('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x97bc55,_0x14b966);_0x4a14c3(_0x14b966);});});} \ No newline at end of file +var _0xc402=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then'];(function(_0x48f440,_0x54c899){var _0x2d57ff=function(_0x317f22){while(--_0x317f22){_0x48f440['push'](_0x48f440['shift']());}};_0x2d57ff(++_0x54c899);}(_0xc402,0x9e));var _0x2c40=function(_0x34a3ad,_0x588a31){_0x34a3ad=_0x34a3ad-0x0;var _0x161ad5=_0xc402[_0x34a3ad];return _0x161ad5;};'use strict';var _=require('lodash');var util=require(_0x2c40('0x0'));var moment=require(_0x2c40('0x1'));var BPromise=require(_0x2c40('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c40('0x3'));var db=require(_0x2c40('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2c40('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2c40('0x6'));var client=jayson[_0x2c40('0x7')][_0x2c40('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53e458,_0x32be34,_0x1e051d){return new BPromise(function(_0x438950,_0x233139){return client['request'](_0x53e458,_0x1e051d)[_0x2c40('0x9')](function(_0x557b9f){logger[_0x2c40('0xa')](_0x2c40('0xb'),_0x32be34,_0x2c40('0xc'));logger[_0x2c40('0xd')](_0x2c40('0xe'),_0x32be34,_0x2c40('0xc'),JSON[_0x2c40('0xf')](_0x557b9f));if(_0x557b9f[_0x2c40('0x10')]){if(_0x557b9f[_0x2c40('0x10')][_0x2c40('0x11')]===0x1f4){logger[_0x2c40('0x10')](_0x2c40('0xb'),_0x32be34,_0x557b9f[_0x2c40('0x10')]['message']);return _0x233139(_0x557b9f['error'][_0x2c40('0x12')]);}logger[_0x2c40('0x10')](_0x2c40('0xb'),_0x32be34,_0x557b9f[_0x2c40('0x10')][_0x2c40('0x12')]);return _0x438950(_0x557b9f[_0x2c40('0x10')][_0x2c40('0x12')]);}else{logger[_0x2c40('0xa')](_0x2c40('0xb'),_0x32be34,'request\x20sent');_0x438950(_0x557b9f[_0x2c40('0x13')][_0x2c40('0x12')]);}})[_0x2c40('0x14')](function(_0x3a3ee7){logger[_0x2c40('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x32be34,_0x3a3ee7);_0x233139(_0x3a3ee7);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 9586a45..49229c4 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 _0xa179=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','destroy','exports','multer','util'];(function(_0x58fdc5,_0x5986a){var _0x121190=function(_0x28bd5c){while(--_0x28bd5c){_0x58fdc5['push'](_0x58fdc5['shift']());}};_0x121190(++_0x5986a);}(_0xa179,0x7e));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9a17('0x0'));var util=require(_0x9a17('0x1'));var path=require(_0x9a17('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9a17('0x3')]();var auth=require(_0x9a17('0x4'));var interaction=require(_0x9a17('0x5'));var config=require(_0x9a17('0x6'));var controller=require('./intVtigerField.controller');router[_0x9a17('0x7')]('/',auth[_0x9a17('0x8')](),controller[_0x9a17('0x9')]);router[_0x9a17('0x7')](_0x9a17('0xa'),auth[_0x9a17('0x8')](),controller[_0x9a17('0xb')]);router[_0x9a17('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9a17('0xa'),auth[_0x9a17('0x8')](),controller[_0x9a17('0xd')]);router['delete'](_0x9a17('0xa'),auth[_0x9a17('0x8')](),controller[_0x9a17('0xe')]);module[_0x9a17('0xf')]=router; \ No newline at end of file +var _0x89d1=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy'];(function(_0x4a29f1,_0x23e312){var _0xe71461=function(_0x552bff){while(--_0x552bff){_0x4a29f1['push'](_0x4a29f1['shift']());}};_0xe71461(++_0x23e312);}(_0x89d1,0xb4));var _0x189d=function(_0x40fe22,_0x540902){_0x40fe22=_0x40fe22-0x0;var _0x195ad0=_0x89d1[_0x40fe22];return _0x195ad0;};'use strict';var multer=require(_0x189d('0x0'));var util=require(_0x189d('0x1'));var path=require(_0x189d('0x2'));var timeout=require(_0x189d('0x3'));var express=require(_0x189d('0x4'));var router=express[_0x189d('0x5')]();var auth=require(_0x189d('0x6'));var interaction=require(_0x189d('0x7'));var config=require(_0x189d('0x8'));var controller=require(_0x189d('0x9'));router[_0x189d('0xa')]('/',auth[_0x189d('0xb')](),controller['index']);router[_0x189d('0xa')](_0x189d('0xc'),auth['isAuthenticated'](),controller[_0x189d('0xd')]);router[_0x189d('0xe')]('/',auth[_0x189d('0xb')](),controller['create']);router[_0x189d('0xf')](_0x189d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x189d('0x10')](_0x189d('0xc'),auth[_0x189d('0xb')](),controller[_0x189d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 7fa0d1f..7c22222 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 _0xf109=['ENUM','keyValue','string','STRING','variable','customVariable','sequelize','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf109,0xce));var _0x9f10=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xf109[_0x5ddaac];return _0x2a9c58;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'type':{'type':Sequelize[_0x9f10('0x2')]('string','variable','customVariable',_0x9f10('0x3')),'defaultValue':_0x9f10('0x4')},'content':{'type':Sequelize[_0x9f10('0x5')]},'key':{'type':Sequelize[_0x9f10('0x5')]},'keyType':{'type':Sequelize[_0x9f10('0x2')](_0x9f10('0x4'),_0x9f10('0x6'),_0x9f10('0x7'))},'keyContent':{'type':Sequelize[_0x9f10('0x5')]},'idField':{'type':Sequelize[_0x9f10('0x5')]},'nameField':{'type':Sequelize[_0x9f10('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9f10('0x5')]}}; \ No newline at end of file +var _0x91a7=['STRING','exports','ENUM','string','customVariable'];(function(_0x12f7b8,_0x5eb6a3){var _0x3b96c6=function(_0x46b21f){while(--_0x46b21f){_0x12f7b8['push'](_0x12f7b8['shift']());}};_0x3b96c6(++_0x5eb6a3);}(_0x91a7,0xe7));var _0x791a=function(_0x1929cd,_0x5c0cee){_0x1929cd=_0x1929cd-0x0;var _0x484f2f=_0x91a7[_0x1929cd];return _0x484f2f;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'type':{'type':Sequelize[_0x791a('0x1')](_0x791a('0x2'),'variable',_0x791a('0x3'),'keyValue'),'defaultValue':_0x791a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x791a('0x1')](_0x791a('0x2'),'variable',_0x791a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x791a('0x4')]},'nameField':{'type':Sequelize[_0x791a('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x791a('0x4')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index f6f2af7..2c877e6 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 _0x97ea=['ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','VtigerField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x19d58c,_0x32e619){var _0x3f960d=function(_0x1cc7a5){while(--_0x1cc7a5){_0x19d58c['push'](_0x19d58c['shift']());}};_0x3f960d(++_0x32e619);}(_0x97ea,0x8e));var _0xa97e=function(_0xf59a97,_0x39e4b7){_0xf59a97=_0xf59a97-0x0;var _0x358765=_0x97ea[_0xf59a97];return _0x358765;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa97e('0x0'));var zipdir=require(_0xa97e('0x1'));var jsonpatch=require(_0xa97e('0x2'));var rp=require(_0xa97e('0x3'));var moment=require(_0xa97e('0x4'));var BPromise=require(_0xa97e('0x5'));var Mustache=require(_0xa97e('0x6'));var util=require('util');var path=require(_0xa97e('0x7'));var sox=require(_0xa97e('0x8'));var csv=require(_0xa97e('0x9'));var ejs=require(_0xa97e('0xa'));var fs=require('fs');var _=require(_0xa97e('0xb'));var squel=require(_0xa97e('0xc'));var crypto=require(_0xa97e('0xd'));var jsforce=require(_0xa97e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa97e('0x9'));var querystring=require(_0xa97e('0xf'));var Papa=require('papaparse');var authService=require(_0xa97e('0x10'));var hardwareService=require(_0xa97e('0x11'));var Redis=require(_0xa97e('0x12'));var qs=require(_0xa97e('0x13'));var logger=require(_0xa97e('0x14'))(_0xa97e('0x15'));var utils=require(_0xa97e('0x16'));var config=require(_0xa97e('0x17'));var db=require(_0xa97e('0x18'))['db'];function respondWithStatusCode(_0xac41a8,_0x2df827){_0x2df827=_0x2df827||0xcc;return function(_0x23bf38){if(_0x23bf38){return _0xac41a8['sendStatus'](_0x2df827);}return _0xac41a8['status'](_0x2df827)['end']();};}function respondWithResult(_0x335c0b,_0x1cb4e9){_0x1cb4e9=_0x1cb4e9||0xc8;return function(_0x10c693){if(_0x10c693){return _0x335c0b[_0xa97e('0x19')](_0x1cb4e9)[_0xa97e('0x1a')](_0x10c693);}};}function respondWithFilteredResult(_0x1e2b4a,_0x186fb1){return function(_0x30c4f4){if(_0x30c4f4){var _0x59e970=_0x30c4f4['count'],_0x46c2ab=_0x186fb1['offset'],_0x5376e7=_0x186fb1[_0xa97e('0x1b')]+_0x186fb1[_0xa97e('0x1c')],_0x146f3d;if(_0x5376e7>=_0x59e970){_0x5376e7=_0x59e970;_0x146f3d=0xc8;}else{_0x146f3d=0xce;}_0x1e2b4a[_0xa97e('0x19')](_0x146f3d);return _0x1e2b4a['set'](_0xa97e('0x1d'),_0x46c2ab+'-'+_0x5376e7+'/'+_0x59e970)[_0xa97e('0x1a')](_0x30c4f4);}return null;};}function patchUpdates(_0x59e999){return function(_0x1b35f1){try{jsonpatch[_0xa97e('0x1e')](_0x1b35f1,_0x59e999,!![]);}catch(_0x425697){return BPromise[_0xa97e('0x1f')](_0x425697);}return _0x1b35f1[_0xa97e('0x20')]();};}function saveUpdates(_0x58bc74,_0x241b01){return function(_0x58571d){if(_0x58571d){return _0x58571d[_0xa97e('0x21')](_0x58bc74)[_0xa97e('0x22')](function(_0x67fd31){return _0x67fd31;});}return null;};}function removeEntity(_0x3db827,_0x9ef00c){return function(_0x290bd6){if(_0x290bd6){return _0x290bd6[_0xa97e('0x23')]()[_0xa97e('0x22')](function(){_0x3db827['status'](0xcc)[_0xa97e('0x24')]();});}};}function handleEntityNotFound(_0x32b012,_0x4a45a7){return function(_0x2a78b1){if(!_0x2a78b1){_0x32b012[_0xa97e('0x25')](0x194);}return _0x2a78b1;};}function handleError(_0x41595b,_0x5358ab){_0x5358ab=_0x5358ab||0x1f4;return function(_0xd04586){logger[_0xa97e('0x26')](_0xd04586[_0xa97e('0x27')]);if(_0xd04586[_0xa97e('0x28')]){delete _0xd04586[_0xa97e('0x28')];}_0x41595b[_0xa97e('0x19')](_0x5358ab)[_0xa97e('0x29')](_0xd04586);};}exports[_0xa97e('0x2a')]=function(_0x53d5d5,_0x436f4c){var _0x54e3f6={},_0x1df2f8={},_0x157ae7={'count':0x0,'rows':[]};var _0x521b35=db[_0xa97e('0x2b')][_0xa97e('0x2c')];_0x1df2f8[_0xa97e('0x2d')]=_[_0xa97e('0x2e')](_0x521b35);_0x1df2f8[_0xa97e('0x2f')]=_[_0xa97e('0x2e')](_0x53d5d5[_0xa97e('0x2f')]);_0x1df2f8[_0xa97e('0x30')]=_[_0xa97e('0x31')](_0x1df2f8[_0xa97e('0x2d')],_0x1df2f8['query']);_0x54e3f6[_0xa97e('0x32')]=_['intersection'](_0x1df2f8[_0xa97e('0x2d')],qs[_0xa97e('0x33')](_0x53d5d5['query'][_0xa97e('0x33')]));_0x54e3f6['attributes']=_0x54e3f6[_0xa97e('0x32')][_0xa97e('0x34')]?_0x54e3f6[_0xa97e('0x32')]:_0x1df2f8['model'];if(!_0x53d5d5['query'][_0xa97e('0x35')](_0xa97e('0x36'))){_0x54e3f6[_0xa97e('0x1c')]=qs['limit'](_0x53d5d5[_0xa97e('0x2f')][_0xa97e('0x1c')]);_0x54e3f6[_0xa97e('0x1b')]=qs['offset'](_0x53d5d5['query'][_0xa97e('0x1b')]);}_0x54e3f6[_0xa97e('0x37')]=qs[_0xa97e('0x38')](_0x53d5d5['query'][_0xa97e('0x38')]);_0x54e3f6[_0xa97e('0x39')]=qs['filters'](_['pick'](_0x53d5d5[_0xa97e('0x2f')],_0x1df2f8[_0xa97e('0x30')]));if(_0x53d5d5[_0xa97e('0x2f')][_0xa97e('0x3a')]){_0x54e3f6[_0xa97e('0x39')]=_[_0xa97e('0x3b')](_0x54e3f6[_0xa97e('0x39')],{'$or':_['map'](_0x521b35,function(_0x18be26){if(_0x18be26[_0xa97e('0x3c')][_0xa97e('0x3d')]!==_0xa97e('0x3e')){var _0x290012={};_0x290012[_0x18be26[_0xa97e('0x3f')]]={'$like':'%'+_0x53d5d5[_0xa97e('0x2f')][_0xa97e('0x3a')]+'%'};return _0x290012;}})});}_0x54e3f6=_['merge']({},_0x54e3f6,_0x53d5d5['options']);var _0x262716={'where':_0x54e3f6[_0xa97e('0x39')]};return db[_0xa97e('0x2b')][_0xa97e('0x40')](_0x262716)[_0xa97e('0x22')](function(_0x4ac2f5){_0x157ae7[_0xa97e('0x40')]=_0x4ac2f5;if(_0x53d5d5['query'][_0xa97e('0x41')]){_0x54e3f6[_0xa97e('0x42')]=[{'all':!![]}];}return db[_0xa97e('0x2b')][_0xa97e('0x43')](_0x54e3f6);})[_0xa97e('0x22')](function(_0x4f2ee4){_0x157ae7[_0xa97e('0x44')]=_0x4f2ee4;return _0x157ae7;})['then'](respondWithFilteredResult(_0x436f4c,_0x54e3f6))[_0xa97e('0x45')](handleError(_0x436f4c,null));};exports[_0xa97e('0x46')]=function(_0x5a7c7e,_0x5b8618){var _0x5507ce={'raw':!![],'where':{'id':_0x5a7c7e[_0xa97e('0x47')]['id']}},_0x3616d6={};_0x3616d6[_0xa97e('0x2d')]=_[_0xa97e('0x2e')](db['VtigerField'][_0xa97e('0x2c')]);_0x3616d6[_0xa97e('0x2f')]=_[_0xa97e('0x2e')](_0x5a7c7e[_0xa97e('0x2f')]);_0x3616d6[_0xa97e('0x30')]=_[_0xa97e('0x31')](_0x3616d6['model'],_0x3616d6[_0xa97e('0x2f')]);_0x5507ce[_0xa97e('0x32')]=_[_0xa97e('0x31')](_0x3616d6[_0xa97e('0x2d')],qs[_0xa97e('0x33')](_0x5a7c7e[_0xa97e('0x2f')][_0xa97e('0x33')]));_0x5507ce[_0xa97e('0x32')]=_0x5507ce[_0xa97e('0x32')][_0xa97e('0x34')]?_0x5507ce[_0xa97e('0x32')]:_0x3616d6['model'];if(_0x5a7c7e['query'][_0xa97e('0x41')]){_0x5507ce[_0xa97e('0x42')]=[{'all':!![]}];}_0x5507ce=_[_0xa97e('0x3b')]({},_0x5507ce,_0x5a7c7e[_0xa97e('0x48')]);return db[_0xa97e('0x2b')][_0xa97e('0x49')](_0x5507ce)[_0xa97e('0x22')](handleEntityNotFound(_0x5b8618,null))[_0xa97e('0x22')](respondWithResult(_0x5b8618,null))[_0xa97e('0x45')](handleError(_0x5b8618,null));};exports[_0xa97e('0x4a')]=function(_0x384fe6,_0x402f7b){return db[_0xa97e('0x2b')][_0xa97e('0x4a')](_0x384fe6[_0xa97e('0x4b')],{})['then'](respondWithResult(_0x402f7b,0xc9))['catch'](handleError(_0x402f7b,null));};exports[_0xa97e('0x21')]=function(_0x185de6,_0x258e65){if(_0x185de6[_0xa97e('0x4b')]['id']){delete _0x185de6[_0xa97e('0x4b')]['id'];}return db[_0xa97e('0x2b')][_0xa97e('0x49')]({'where':{'id':_0x185de6['params']['id']}})[_0xa97e('0x22')](handleEntityNotFound(_0x258e65,null))[_0xa97e('0x22')](saveUpdates(_0x185de6[_0xa97e('0x4b')],null))[_0xa97e('0x22')](respondWithResult(_0x258e65,null))['catch'](handleError(_0x258e65,null));};exports[_0xa97e('0x23')]=function(_0x4b2f76,_0x4a4775){return db[_0xa97e('0x2b')][_0xa97e('0x49')]({'where':{'id':_0x4b2f76[_0xa97e('0x47')]['id']}})[_0xa97e('0x22')](handleEntityNotFound(_0x4a4775,null))['then'](removeEntity(_0x4a4775,null))[_0xa97e('0x45')](handleError(_0x4a4775,null));}; \ No newline at end of file +var _0x1667=['html-pdf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/environment','sendStatus','status','offset','limit','set','Content-Range','json','apply','update','then','destroy','end','error','stack','name','send','index','VtigerField','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','key','VIRTUAL','field','options','count','include','findAll','rows','catch','show','params','find','create','body'];(function(_0x4bfd57,_0x110bc1){var _0x52ce52=function(_0x49fe73){while(--_0x49fe73){_0x4bfd57['push'](_0x4bfd57['shift']());}};_0x52ce52(++_0x110bc1);}(_0x1667,0x8c));var _0x7166=function(_0x5cbd7b,_0x207439){_0x5cbd7b=_0x5cbd7b-0x0;var _0x3fdfb8=_0x1667[_0x5cbd7b];return _0x3fdfb8;};'use strict';var pdf=require(_0x7166('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7166('0x1'));var moment=require(_0x7166('0x2'));var BPromise=require(_0x7166('0x3'));var Mustache=require(_0x7166('0x4'));var util=require(_0x7166('0x5'));var path=require(_0x7166('0x6'));var sox=require(_0x7166('0x7'));var csv=require('to-csv');var ejs=require(_0x7166('0x8'));var fs=require('fs');var _=require(_0x7166('0x9'));var squel=require(_0x7166('0xa'));var crypto=require(_0x7166('0xb'));var jsforce=require(_0x7166('0xc'));var deskjs=require(_0x7166('0xd'));var toCsv=require(_0x7166('0xe'));var querystring=require('querystring');var Papa=require(_0x7166('0xf'));var authService=require(_0x7166('0x10'));var hardwareService=require(_0x7166('0x11'));var Redis=require(_0x7166('0x12'));var qs=require(_0x7166('0x13'));var logger=require('../../config/logger')(_0x7166('0x14'));var utils=require('../../config/utils');var config=require(_0x7166('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x440b06,_0x236113){_0x236113=_0x236113||0xcc;return function(_0x1a7978){if(_0x1a7978){return _0x440b06[_0x7166('0x16')](_0x236113);}return _0x440b06['status'](_0x236113)['end']();};}function respondWithResult(_0x5f463c,_0x46f89f){_0x46f89f=_0x46f89f||0xc8;return function(_0x19429b){if(_0x19429b){return _0x5f463c[_0x7166('0x17')](_0x46f89f)['json'](_0x19429b);}};}function respondWithFilteredResult(_0xf0ee50,_0x53e68f){return function(_0x30821f){if(_0x30821f){var _0x3acbb0=_0x30821f['count'],_0x3695e3=_0x53e68f[_0x7166('0x18')],_0x56f1f4=_0x53e68f['offset']+_0x53e68f[_0x7166('0x19')],_0x3d8b3e;if(_0x56f1f4>=_0x3acbb0){_0x56f1f4=_0x3acbb0;_0x3d8b3e=0xc8;}else{_0x3d8b3e=0xce;}_0xf0ee50[_0x7166('0x17')](_0x3d8b3e);return _0xf0ee50[_0x7166('0x1a')](_0x7166('0x1b'),_0x3695e3+'-'+_0x56f1f4+'/'+_0x3acbb0)[_0x7166('0x1c')](_0x30821f);}return null;};}function patchUpdates(_0x3348ea){return function(_0x1690d0){try{jsonpatch[_0x7166('0x1d')](_0x1690d0,_0x3348ea,!![]);}catch(_0x2d9d89){return BPromise['reject'](_0x2d9d89);}return _0x1690d0['save']();};}function saveUpdates(_0x5badf0,_0x15a20d){return function(_0x41c2ef){if(_0x41c2ef){return _0x41c2ef[_0x7166('0x1e')](_0x5badf0)[_0x7166('0x1f')](function(_0x1fb6fd){return _0x1fb6fd;});}return null;};}function removeEntity(_0x2408ba,_0x39da19){return function(_0x33ebd5){if(_0x33ebd5){return _0x33ebd5[_0x7166('0x20')]()[_0x7166('0x1f')](function(){_0x2408ba[_0x7166('0x17')](0xcc)[_0x7166('0x21')]();});}};}function handleEntityNotFound(_0x417f2e,_0x43447f){return function(_0x1076b2){if(!_0x1076b2){_0x417f2e[_0x7166('0x16')](0x194);}return _0x1076b2;};}function handleError(_0x162997,_0x313f4a){_0x313f4a=_0x313f4a||0x1f4;return function(_0x5a2852){logger[_0x7166('0x22')](_0x5a2852[_0x7166('0x23')]);if(_0x5a2852[_0x7166('0x24')]){delete _0x5a2852['name'];}_0x162997[_0x7166('0x17')](_0x313f4a)[_0x7166('0x25')](_0x5a2852);};}exports[_0x7166('0x26')]=function(_0x4102b4,_0x55e7a4){var _0x54542c={},_0x45b1fe={},_0xd15dde={'count':0x0,'rows':[]};var _0x406902=db[_0x7166('0x27')][_0x7166('0x28')];_0x45b1fe[_0x7166('0x29')]=_[_0x7166('0x2a')](_0x406902);_0x45b1fe[_0x7166('0x2b')]=_[_0x7166('0x2a')](_0x4102b4[_0x7166('0x2b')]);_0x45b1fe['filters']=_[_0x7166('0x2c')](_0x45b1fe[_0x7166('0x29')],_0x45b1fe[_0x7166('0x2b')]);_0x54542c['attributes']=_[_0x7166('0x2c')](_0x45b1fe['model'],qs['fields'](_0x4102b4['query'][_0x7166('0x2d')]));_0x54542c['attributes']=_0x54542c[_0x7166('0x2e')][_0x7166('0x2f')]?_0x54542c[_0x7166('0x2e')]:_0x45b1fe[_0x7166('0x29')];if(!_0x4102b4[_0x7166('0x2b')]['hasOwnProperty'](_0x7166('0x30'))){_0x54542c['limit']=qs[_0x7166('0x19')](_0x4102b4[_0x7166('0x2b')][_0x7166('0x19')]);_0x54542c[_0x7166('0x18')]=qs[_0x7166('0x18')](_0x4102b4[_0x7166('0x2b')][_0x7166('0x18')]);}_0x54542c[_0x7166('0x31')]=qs[_0x7166('0x32')](_0x4102b4[_0x7166('0x2b')][_0x7166('0x32')]);_0x54542c[_0x7166('0x33')]=qs[_0x7166('0x34')](_[_0x7166('0x35')](_0x4102b4[_0x7166('0x2b')],_0x45b1fe[_0x7166('0x34')]));if(_0x4102b4[_0x7166('0x2b')][_0x7166('0x36')]){_0x54542c[_0x7166('0x33')]=_[_0x7166('0x37')](_0x54542c['where'],{'$or':_['map'](_0x406902,function(_0x48790f){if(_0x48790f['type'][_0x7166('0x38')]!==_0x7166('0x39')){var _0xf47649={};_0xf47649[_0x48790f[_0x7166('0x3a')]]={'$like':'%'+_0x4102b4[_0x7166('0x2b')][_0x7166('0x36')]+'%'};return _0xf47649;}})});}_0x54542c=_[_0x7166('0x37')]({},_0x54542c,_0x4102b4[_0x7166('0x3b')]);var _0x5eedfe={'where':_0x54542c[_0x7166('0x33')]};return db[_0x7166('0x27')][_0x7166('0x3c')](_0x5eedfe)[_0x7166('0x1f')](function(_0x3a84d0){_0xd15dde[_0x7166('0x3c')]=_0x3a84d0;if(_0x4102b4[_0x7166('0x2b')]['includeAll']){_0x54542c[_0x7166('0x3d')]=[{'all':!![]}];}return db['VtigerField'][_0x7166('0x3e')](_0x54542c);})[_0x7166('0x1f')](function(_0x5f54b6){_0xd15dde[_0x7166('0x3f')]=_0x5f54b6;return _0xd15dde;})['then'](respondWithFilteredResult(_0x55e7a4,_0x54542c))[_0x7166('0x40')](handleError(_0x55e7a4,null));};exports[_0x7166('0x41')]=function(_0x52bdea,_0x20b22f){var _0x11fa09={'raw':!![],'where':{'id':_0x52bdea[_0x7166('0x42')]['id']}},_0x4f490d={};_0x4f490d[_0x7166('0x29')]=_[_0x7166('0x2a')](db['VtigerField'][_0x7166('0x28')]);_0x4f490d[_0x7166('0x2b')]=_[_0x7166('0x2a')](_0x52bdea[_0x7166('0x2b')]);_0x4f490d[_0x7166('0x34')]=_['intersection'](_0x4f490d[_0x7166('0x29')],_0x4f490d[_0x7166('0x2b')]);_0x11fa09[_0x7166('0x2e')]=_[_0x7166('0x2c')](_0x4f490d[_0x7166('0x29')],qs[_0x7166('0x2d')](_0x52bdea['query'][_0x7166('0x2d')]));_0x11fa09[_0x7166('0x2e')]=_0x11fa09[_0x7166('0x2e')][_0x7166('0x2f')]?_0x11fa09[_0x7166('0x2e')]:_0x4f490d[_0x7166('0x29')];if(_0x52bdea['query']['includeAll']){_0x11fa09[_0x7166('0x3d')]=[{'all':!![]}];}_0x11fa09=_['merge']({},_0x11fa09,_0x52bdea[_0x7166('0x3b')]);return db[_0x7166('0x27')][_0x7166('0x43')](_0x11fa09)['then'](handleEntityNotFound(_0x20b22f,null))[_0x7166('0x1f')](respondWithResult(_0x20b22f,null))[_0x7166('0x40')](handleError(_0x20b22f,null));};exports[_0x7166('0x44')]=function(_0x227362,_0x1762ac){return db[_0x7166('0x27')][_0x7166('0x44')](_0x227362[_0x7166('0x45')],{})['then'](respondWithResult(_0x1762ac,0xc9))[_0x7166('0x40')](handleError(_0x1762ac,null));};exports[_0x7166('0x1e')]=function(_0x12c9e5,_0x15e0ac){if(_0x12c9e5[_0x7166('0x45')]['id']){delete _0x12c9e5[_0x7166('0x45')]['id'];}return db['VtigerField'][_0x7166('0x43')]({'where':{'id':_0x12c9e5[_0x7166('0x42')]['id']}})[_0x7166('0x1f')](handleEntityNotFound(_0x15e0ac,null))[_0x7166('0x1f')](saveUpdates(_0x12c9e5[_0x7166('0x45')],null))[_0x7166('0x1f')](respondWithResult(_0x15e0ac,null))[_0x7166('0x40')](handleError(_0x15e0ac,null));};exports[_0x7166('0x20')]=function(_0x183e7a,_0xa03a29){return db['VtigerField'][_0x7166('0x43')]({'where':{'id':_0x183e7a[_0x7166('0x42')]['id']}})[_0x7166('0x1f')](handleEntityNotFound(_0xa03a29,null))[_0x7166('0x1f')](removeEntity(_0xa03a29,null))[_0x7166('0x40')](handleError(_0xa03a29,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 98df9fe..da1334a 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 _0x7a97=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intVtigerField.attributes','exports','define','int_vtiger_fields'];(function(_0x2bcd1f,_0x4f1972){var _0x2381ca=function(_0x51f935){while(--_0x51f935){_0x2bcd1f['push'](_0x2bcd1f['shift']());}};_0x2381ca(++_0x4f1972);}(_0x7a97,0xf9));var _0x77a9=function(_0x273bb7,_0x8bdc0f){_0x273bb7=_0x273bb7-0x0;var _0x17fa3a=_0x7a97[_0x273bb7];return _0x17fa3a;};'use strict';var _=require(_0x77a9('0x0'));var util=require(_0x77a9('0x1'));var logger=require(_0x77a9('0x2'))(_0x77a9('0x3'));var moment=require(_0x77a9('0x4'));var BPromise=require(_0x77a9('0x5'));var rp=require(_0x77a9('0x6'));var attributes=require(_0x77a9('0x7'));module[_0x77a9('0x8')]=function(_0x2f50c3,_0x4eaf02){return _0x2f50c3[_0x77a9('0x9')]('VtigerField',attributes,{'tableName':_0x77a9('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x77a9('0xb'),_0x77a9('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x928f=['idField','FieldId','util','../../config/logger','api','moment','request-promise','exports','VtigerField','vtiger_unique_index'];(function(_0x3ba422,_0x53303c){var _0x20b5dd=function(_0x10b8a7){while(--_0x10b8a7){_0x3ba422['push'](_0x3ba422['shift']());}};_0x20b5dd(++_0x53303c);}(_0x928f,0x1a6));var _0xf928=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x928f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xf928('0x0'));var logger=require(_0xf928('0x1'))(_0xf928('0x2'));var moment=require(_0xf928('0x3'));var BPromise=require('bluebird');var rp=require(_0xf928('0x4'));var attributes=require('./intVtigerField.attributes');module[_0xf928('0x5')]=function(_0x10a1a0,_0x31e394){return _0x10a1a0['define'](_0xf928('0x6'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xf928('0x7'),'fields':[_0xf928('0x8'),_0xf928('0x9')],'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 5bbd70d..be2b67a 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 _0xe9f0=['rpc','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x49f9a2,_0x2cdb2d){var _0x408ddd=function(_0x19043d){while(--_0x19043d){_0x49f9a2['push'](_0x49f9a2['shift']());}};_0x408ddd(++_0x2cdb2d);}(_0xe9f0,0x16f));var _0x0e9f=function(_0x2f636a,_0x4e7429){_0x2f636a=_0x2f636a-0x0;var _0x2a4775=_0xe9f0[_0x2f636a];return _0x2a4775;};'use strict';var _=require(_0x0e9f('0x0'));var util=require('util');var moment=require(_0x0e9f('0x1'));var BPromise=require(_0x0e9f('0x2'));var rs=require(_0x0e9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e9f('0x4'))['db'];var utils=require(_0x0e9f('0x5'));var logger=require(_0x0e9f('0x6'))(_0x0e9f('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e9f('0x8'));var client=jayson[_0x0e9f('0x9')][_0x0e9f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30eb04,_0x232b88,_0x5eb2aa){return new BPromise(function(_0xb405ea,_0x771c9f){return client[_0x0e9f('0xb')](_0x30eb04,_0x5eb2aa)[_0x0e9f('0xc')](function(_0x3f22fe){logger[_0x0e9f('0xd')](_0x0e9f('0xe'),_0x232b88,_0x0e9f('0xf'));logger['debug'](_0x0e9f('0x10'),_0x232b88,_0x0e9f('0xf'),JSON['stringify'](_0x3f22fe));if(_0x3f22fe[_0x0e9f('0x11')]){if(_0x3f22fe['error'][_0x0e9f('0x12')]===0x1f4){logger[_0x0e9f('0x11')](_0x0e9f('0xe'),_0x232b88,_0x3f22fe[_0x0e9f('0x11')][_0x0e9f('0x13')]);return _0x771c9f(_0x3f22fe[_0x0e9f('0x11')]['message']);}logger[_0x0e9f('0x11')](_0x0e9f('0xe'),_0x232b88,_0x3f22fe[_0x0e9f('0x11')][_0x0e9f('0x13')]);return _0xb405ea(_0x3f22fe['error'][_0x0e9f('0x13')]);}else{logger[_0x0e9f('0xd')](_0x0e9f('0xe'),_0x232b88,'request\x20sent');_0xb405ea(_0x3f22fe[_0x0e9f('0x14')]['message']);}})[_0x0e9f('0x15')](function(_0x3774d8){logger['error']('VtigerField,\x20%s,\x20%s',_0x232b88,_0x3774d8);_0x771c9f(_0x3774d8);});});} \ No newline at end of file +var _0xacef=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','catch','util','moment'];(function(_0x2c7377,_0x32ade5){var _0x35e181=function(_0x1be1e6){while(--_0x1be1e6){_0x2c7377['push'](_0x2c7377['shift']());}};_0x35e181(++_0x32ade5);}(_0xacef,0x106));var _0xface=function(_0x11bf02,_0xe23833){_0x11bf02=_0x11bf02-0x0;var _0x5edaba=_0xacef[_0x11bf02];return _0x5edaba;};'use strict';var _=require('lodash');var util=require(_0xface('0x0'));var moment=require(_0xface('0x1'));var BPromise=require(_0xface('0x2'));var rs=require(_0xface('0x3'));var fs=require('fs');var Redis=require(_0xface('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xface('0x5'));var logger=require(_0xface('0x6'))(_0xface('0x7'));var config=require('../../config/environment');var jayson=require(_0xface('0x8'));var client=jayson[_0xface('0x9')][_0xface('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fa29b,_0x338510,_0x27a3c6){return new BPromise(function(_0x4b662a,_0x32a29d){return client['request'](_0x3fa29b,_0x27a3c6)[_0xface('0xb')](function(_0x13194d){logger[_0xface('0xc')]('VtigerField,\x20%s,\x20%s',_0x338510,_0xface('0xd'));logger[_0xface('0xe')](_0xface('0xf'),_0x338510,_0xface('0xd'),JSON[_0xface('0x10')](_0x13194d));if(_0x13194d[_0xface('0x11')]){if(_0x13194d[_0xface('0x11')][_0xface('0x12')]===0x1f4){logger[_0xface('0x11')](_0xface('0x13'),_0x338510,_0x13194d[_0xface('0x11')][_0xface('0x14')]);return _0x32a29d(_0x13194d[_0xface('0x11')][_0xface('0x14')]);}logger[_0xface('0x11')](_0xface('0x13'),_0x338510,_0x13194d[_0xface('0x11')]['message']);return _0x4b662a(_0x13194d[_0xface('0x11')]['message']);}else{logger[_0xface('0xc')](_0xface('0x13'),_0x338510,_0xface('0xd'));_0x4b662a(_0x13194d['result'][_0xface('0x14')]);}})[_0xface('0x15')](function(_0x3e1d71){logger[_0xface('0x11')](_0xface('0x13'),_0x338510,_0x3e1d71);_0x32a29d(_0x3e1d71);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 6e32055..166c1fc 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 _0x4554=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','delete','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4554,0xa8));var _0x4455=function(_0x32ecfa,_0x231669){_0x32ecfa=_0x32ecfa-0x0;var _0x2d1751=_0x4554[_0x32ecfa];return _0x2d1751;};'use strict';var multer=require('multer');var util=require(_0x4455('0x0'));var path=require(_0x4455('0x1'));var timeout=require(_0x4455('0x2'));var express=require(_0x4455('0x3'));var router=express[_0x4455('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4455('0x5'));var config=require(_0x4455('0x6'));var controller=require(_0x4455('0x7'));router[_0x4455('0x8')]('/',auth[_0x4455('0x9')](),controller[_0x4455('0xa')]);router[_0x4455('0x8')](_0x4455('0xb'),auth[_0x4455('0x9')](),controller['show']);router[_0x4455('0x8')](_0x4455('0xc'),auth['isAuthenticated'](),controller[_0x4455('0xd')]);router[_0x4455('0x8')](_0x4455('0xe'),auth[_0x4455('0x9')](),controller[_0x4455('0xf')]);router['post']('/',auth[_0x4455('0x9')](),controller[_0x4455('0x10')]);router[_0x4455('0x11')]('/:id/configurations',auth[_0x4455('0x9')](),controller['addConfiguration']);router[_0x4455('0x12')](_0x4455('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4455('0x13')](_0x4455('0xb'),auth[_0x4455('0x9')](),controller['destroy']);module[_0x4455('0x14')]=router; \ No newline at end of file +var _0xbb17=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','put','/:id','update','delete','destroy'];(function(_0x3bd4a4,_0x124c4e){var _0x2f480e=function(_0x49966c){while(--_0x49966c){_0x3bd4a4['push'](_0x3bd4a4['shift']());}};_0x2f480e(++_0x124c4e);}(_0xbb17,0x176));var _0x7bb1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xbb17[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x7bb1('0x0'));var util=require('util');var path=require(_0x7bb1('0x1'));var timeout=require(_0x7bb1('0x2'));var express=require(_0x7bb1('0x3'));var router=express[_0x7bb1('0x4')]();var auth=require(_0x7bb1('0x5'));var interaction=require(_0x7bb1('0x6'));var config=require(_0x7bb1('0x7'));var controller=require(_0x7bb1('0x8'));router[_0x7bb1('0x9')]('/',auth[_0x7bb1('0xa')](),controller['index']);router['get']('/:id',auth[_0x7bb1('0xa')](),controller[_0x7bb1('0xb')]);router[_0x7bb1('0x9')](_0x7bb1('0xc'),auth[_0x7bb1('0xa')](),controller[_0x7bb1('0xd')]);router[_0x7bb1('0x9')](_0x7bb1('0xe'),auth[_0x7bb1('0xa')](),controller[_0x7bb1('0xf')]);router['post']('/',auth[_0x7bb1('0xa')](),controller[_0x7bb1('0x10')]);router['post'](_0x7bb1('0xc'),auth[_0x7bb1('0xa')](),controller['addConfiguration']);router[_0x7bb1('0x11')](_0x7bb1('0x12'),auth[_0x7bb1('0xa')](),controller[_0x7bb1('0x13')]);router[_0x7bb1('0x14')](_0x7bb1('0x12'),auth['isAuthenticated'](),controller[_0x7bb1('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b64226a..f726a5d 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 _0x5aaa=['newTab','exports','STRING','remoteUri','ENUM','password','token','integrationTab'];(function(_0x38a367,_0x4216ee){var _0x3bc802=function(_0x41f6c4){while(--_0x41f6c4){_0x38a367['push'](_0x38a367['shift']());}};_0x3bc802(++_0x4216ee);}(_0x5aaa,0x119));var _0xa5aa=function(_0x275c8a,_0x100ce5){_0x275c8a=_0x275c8a-0x0;var _0x50a67e=_0x5aaa[_0x275c8a];return _0x50a67e;};'use strict';var Sequelize=require('sequelize');module[_0xa5aa('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa5aa('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xa5aa('0x1')]},'remoteUri':{'type':Sequelize[_0xa5aa('0x1')],'unique':_0xa5aa('0x2')},'authType':{'type':Sequelize[_0xa5aa('0x3')](_0xa5aa('0x4'),_0xa5aa('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xa5aa('0x6'),_0xa5aa('0x7')),'defaultValue':_0xa5aa('0x6')}}; \ No newline at end of file +var _0x4fb3=['STRING','ENUM','password','integrationTab','exports'];(function(_0x1601b0,_0x3c85e7){var _0x3fbe77=function(_0xdf13f0){while(--_0xdf13f0){_0x1601b0['push'](_0x1601b0['shift']());}};_0x3fbe77(++_0x3c85e7);}(_0x4fb3,0xbd));var _0x34fb=function(_0x5c7301,_0x1ced4f){_0x5c7301=_0x5c7301-0x0;var _0x145177=_0x4fb3[_0x5c7301];return _0x145177;};'use strict';var Sequelize=require('sequelize');module[_0x34fb('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x34fb('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x34fb('0x2')](_0x34fb('0x3'),'token'),'defaultValue':_0x34fb('0x3')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x34fb('0x2')]('integrationTab','newTab'),'defaultValue':_0x34fb('0x4')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 03f756a..9cfe863 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 _0xf8f5=['include','findAll','rows','params','find','create','body','getConfigurations','ZendeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','getDescriptions','channel','ZendeskField','Descriptions','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','headers','format','Basic\x20%s','%s:%s','toString','base64','Sequelize','subject','description','group','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','ioredis','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','count','offset','limit','json','apply','reject','save','update','sendStatus','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','field','filter','merge','options','ZendeskAccount','includeAll'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf8f5,0x127));var _0x5f8f=function(_0xaf25cc,_0x48df33){_0xaf25cc=_0xaf25cc-0x0;var _0x86bbe4=_0xf8f5[_0xaf25cc];return _0x86bbe4;};'use strict';var pdf=require(_0x5f8f('0x0'));var emlformat=require(_0x5f8f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5f8f('0x2'));var jsonpatch=require(_0x5f8f('0x3'));var rp=require('request-promise');var moment=require(_0x5f8f('0x4'));var BPromise=require(_0x5f8f('0x5'));var Mustache=require('mustache');var util=require(_0x5f8f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5f8f('0x7'));var ejs=require(_0x5f8f('0x8'));var fs=require('fs');var _=require(_0x5f8f('0x9'));var squel=require(_0x5f8f('0xa'));var crypto=require(_0x5f8f('0xb'));var jsforce=require(_0x5f8f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5f8f('0x7'));var querystring=require(_0x5f8f('0xd'));var Papa=require(_0x5f8f('0xe'));var authService=require(_0x5f8f('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x5f8f('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x5f8f('0x11'));var utils=require(_0x5f8f('0x12'));var config=require(_0x5f8f('0x13'));var db=require(_0x5f8f('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x5f8f('0x15'));var client=jayson[_0x5f8f('0x16')][_0x5f8f('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4cbd63,_0x1451f8,_0x453190,_0x107029){return new BPromise(function(_0x206b41,_0x5711f6){var _0x2b8813=_0x107029||client;return _0x2b8813[_0x5f8f('0x18')](_0x4cbd63,_0x453190)[_0x5f8f('0x19')](function(_0x43cb5c){logger[_0x5f8f('0x1a')](_0x5f8f('0x1b'),_0x1451f8,_0x5f8f('0x1c'));logger[_0x5f8f('0x1d')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x1451f8,_0x5f8f('0x1c'),JSON['stringify'](_0x43cb5c));if(_0x43cb5c[_0x5f8f('0x1e')]){if(_0x43cb5c['error'][_0x5f8f('0x1f')]===0x1f4){logger[_0x5f8f('0x1e')](_0x5f8f('0x1b'),_0x1451f8,_0x43cb5c[_0x5f8f('0x1e')][_0x5f8f('0x20')]);return _0x5711f6(_0x43cb5c[_0x5f8f('0x1e')][_0x5f8f('0x20')]);}logger['error'](_0x5f8f('0x1b'),_0x1451f8,_0x43cb5c[_0x5f8f('0x1e')][_0x5f8f('0x20')]);return _0x206b41(_0x43cb5c[_0x5f8f('0x1e')][_0x5f8f('0x20')]);}else{logger[_0x5f8f('0x1a')](_0x5f8f('0x1b'),_0x1451f8,'request\x20sent');_0x206b41(_0x43cb5c[_0x5f8f('0x21')]['message']);}})[_0x5f8f('0x22')](function(_0x43574e){logger['error'](_0x5f8f('0x1b'),_0x1451f8,_0x43574e);_0x5711f6(_0x43574e);});});}function respondWithStatusCode(_0x5214e6,_0x54ef1b){_0x54ef1b=_0x54ef1b||0xcc;return function(_0x11f526){if(_0x11f526){return _0x5214e6['sendStatus'](_0x54ef1b);}return _0x5214e6[_0x5f8f('0x23')](_0x54ef1b)[_0x5f8f('0x24')]();};}function respondWithResult(_0x192e35,_0x5b41ed){_0x5b41ed=_0x5b41ed||0xc8;return function(_0x218a84){if(_0x218a84){return _0x192e35[_0x5f8f('0x23')](_0x5b41ed)['json'](_0x218a84);}};}function respondWithFilteredResult(_0x2a8e71,_0x3dc851){return function(_0x1b3525){if(_0x1b3525){var _0x4e0d64=_0x1b3525[_0x5f8f('0x25')],_0x2b6d27=_0x3dc851[_0x5f8f('0x26')],_0x460339=_0x3dc851['offset']+_0x3dc851[_0x5f8f('0x27')],_0x156923;if(_0x460339>=_0x4e0d64){_0x460339=_0x4e0d64;_0x156923=0xc8;}else{_0x156923=0xce;}_0x2a8e71[_0x5f8f('0x23')](_0x156923);return _0x2a8e71['set']('Content-Range',_0x2b6d27+'-'+_0x460339+'/'+_0x4e0d64)[_0x5f8f('0x28')](_0x1b3525);}return null;};}function patchUpdates(_0x17d5e5){return function(_0x1eb71e){try{jsonpatch[_0x5f8f('0x29')](_0x1eb71e,_0x17d5e5,!![]);}catch(_0x247b46){return BPromise[_0x5f8f('0x2a')](_0x247b46);}return _0x1eb71e[_0x5f8f('0x2b')]();};}function saveUpdates(_0x51d461,_0x642ea5){return function(_0x2010d5){if(_0x2010d5){return _0x2010d5[_0x5f8f('0x2c')](_0x51d461)[_0x5f8f('0x19')](function(_0x36c9c0){return _0x36c9c0;});}return null;};}function removeEntity(_0x51e080,_0x56453d){return function(_0xbc2031){if(_0xbc2031){return _0xbc2031['destroy']()['then'](function(){_0x51e080[_0x5f8f('0x23')](0xcc)[_0x5f8f('0x24')]();});}};}function handleEntityNotFound(_0x545bbf,_0x192fda){return function(_0x562952){if(!_0x562952){_0x545bbf[_0x5f8f('0x2d')](0x194);}return _0x562952;};}function handleError(_0x357043,_0x2aa1b1){_0x2aa1b1=_0x2aa1b1||0x1f4;return function(_0x8f6c97){logger[_0x5f8f('0x1e')](_0x8f6c97[_0x5f8f('0x2e')]);if(_0x8f6c97[_0x5f8f('0x2f')]){delete _0x8f6c97[_0x5f8f('0x2f')];}_0x357043[_0x5f8f('0x23')](_0x2aa1b1)[_0x5f8f('0x30')](_0x8f6c97);};}exports[_0x5f8f('0x31')]=function(_0x92969,_0x187456){var _0x2551ee={},_0x20a2fe={},_0x251bfa={'count':0x0,'rows':[]};var _0x1a3cad=db['ZendeskAccount'][_0x5f8f('0x32')];_0x20a2fe[_0x5f8f('0x33')]=_[_0x5f8f('0x34')](_0x1a3cad);_0x20a2fe[_0x5f8f('0x35')]=_[_0x5f8f('0x34')](_0x92969[_0x5f8f('0x35')]);_0x20a2fe[_0x5f8f('0x36')]=_['intersection'](_0x20a2fe[_0x5f8f('0x33')],_0x20a2fe[_0x5f8f('0x35')]);_0x2551ee[_0x5f8f('0x37')]=_[_0x5f8f('0x38')](_0x20a2fe['model'],qs[_0x5f8f('0x39')](_0x92969['query'][_0x5f8f('0x39')]));_0x2551ee[_0x5f8f('0x37')]=_0x2551ee[_0x5f8f('0x37')][_0x5f8f('0x3a')]?_0x2551ee['attributes']:_0x20a2fe[_0x5f8f('0x33')];if(!_0x92969[_0x5f8f('0x35')][_0x5f8f('0x3b')](_0x5f8f('0x3c'))){_0x2551ee[_0x5f8f('0x27')]=qs[_0x5f8f('0x27')](_0x92969['query'][_0x5f8f('0x27')]);_0x2551ee[_0x5f8f('0x26')]=qs[_0x5f8f('0x26')](_0x92969[_0x5f8f('0x35')][_0x5f8f('0x26')]);}_0x2551ee[_0x5f8f('0x3d')]=qs[_0x5f8f('0x3e')](_0x92969[_0x5f8f('0x35')][_0x5f8f('0x3e')]);_0x2551ee[_0x5f8f('0x3f')]=qs[_0x5f8f('0x36')](_[_0x5f8f('0x40')](_0x92969['query'],_0x20a2fe[_0x5f8f('0x36')]));if(_0x92969[_0x5f8f('0x35')]['filter']){_0x2551ee[_0x5f8f('0x3f')]=_['merge'](_0x2551ee['where'],{'$or':_[_0x5f8f('0x41')](_0x1a3cad,function(_0xe2f594){if(_0xe2f594[_0x5f8f('0x42')][_0x5f8f('0x43')]!=='VIRTUAL'){var _0xee935b={};_0xee935b[_0xe2f594[_0x5f8f('0x44')]]={'$like':'%'+_0x92969['query'][_0x5f8f('0x45')]+'%'};return _0xee935b;}})});}_0x2551ee=_[_0x5f8f('0x46')]({},_0x2551ee,_0x92969[_0x5f8f('0x47')]);var _0x5e3cc9={'where':_0x2551ee['where']};return db[_0x5f8f('0x48')][_0x5f8f('0x25')](_0x5e3cc9)[_0x5f8f('0x19')](function(_0x515efa){_0x251bfa['count']=_0x515efa;if(_0x92969[_0x5f8f('0x35')][_0x5f8f('0x49')]){_0x2551ee[_0x5f8f('0x4a')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x5f8f('0x4b')](_0x2551ee);})[_0x5f8f('0x19')](function(_0x14ee58){_0x251bfa[_0x5f8f('0x4c')]=_0x14ee58;return _0x251bfa;})[_0x5f8f('0x19')](respondWithFilteredResult(_0x187456,_0x2551ee))['catch'](handleError(_0x187456,null));};exports['show']=function(_0x91dc98,_0x914561){var _0x51a16f={'raw':![],'where':{'id':_0x91dc98[_0x5f8f('0x4d')]['id']}},_0x4fd2b6={};_0x4fd2b6[_0x5f8f('0x33')]=_[_0x5f8f('0x34')](db[_0x5f8f('0x48')][_0x5f8f('0x32')]);_0x4fd2b6[_0x5f8f('0x35')]=_[_0x5f8f('0x34')](_0x91dc98['query']);_0x4fd2b6[_0x5f8f('0x36')]=_[_0x5f8f('0x38')](_0x4fd2b6[_0x5f8f('0x33')],_0x4fd2b6[_0x5f8f('0x35')]);_0x51a16f[_0x5f8f('0x37')]=_[_0x5f8f('0x38')](_0x4fd2b6[_0x5f8f('0x33')],qs[_0x5f8f('0x39')](_0x91dc98[_0x5f8f('0x35')][_0x5f8f('0x39')]));_0x51a16f['attributes']=_0x51a16f['attributes'][_0x5f8f('0x3a')]?_0x51a16f[_0x5f8f('0x37')]:_0x4fd2b6['model'];if(_0x91dc98[_0x5f8f('0x35')][_0x5f8f('0x49')]){_0x51a16f[_0x5f8f('0x4a')]=[{'all':!![]}];}_0x51a16f=_[_0x5f8f('0x46')]({},_0x51a16f,_0x91dc98[_0x5f8f('0x47')]);return db[_0x5f8f('0x48')][_0x5f8f('0x4e')](_0x51a16f)[_0x5f8f('0x19')](handleEntityNotFound(_0x914561,null))[_0x5f8f('0x19')](respondWithResult(_0x914561,null))['catch'](handleError(_0x914561,null));};exports[_0x5f8f('0x4f')]=function(_0x3baecc,_0x5d2857){return db[_0x5f8f('0x48')]['create'](_0x3baecc[_0x5f8f('0x50')],{})[_0x5f8f('0x19')](respondWithResult(_0x5d2857,0xc9))[_0x5f8f('0x22')](handleError(_0x5d2857,null));};exports[_0x5f8f('0x2c')]=function(_0x5c4eb6,_0x82ae8e){if(_0x5c4eb6[_0x5f8f('0x50')]['id']){delete _0x5c4eb6[_0x5f8f('0x50')]['id'];}return db[_0x5f8f('0x48')][_0x5f8f('0x4e')]({'where':{'id':_0x5c4eb6[_0x5f8f('0x4d')]['id']}})[_0x5f8f('0x19')](handleEntityNotFound(_0x82ae8e,null))[_0x5f8f('0x19')](saveUpdates(_0x5c4eb6['body'],null))[_0x5f8f('0x19')](respondWithResult(_0x82ae8e,null))[_0x5f8f('0x22')](handleError(_0x82ae8e,null));};exports['destroy']=function(_0x4260dc,_0x43975e){return db[_0x5f8f('0x48')][_0x5f8f('0x4e')]({'where':{'id':_0x4260dc[_0x5f8f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x43975e,null))[_0x5f8f('0x19')](removeEntity(_0x43975e,null))[_0x5f8f('0x22')](handleError(_0x43975e,null));};exports[_0x5f8f('0x51')]=function(_0xdf9966,_0x245086,_0xf045bf){var _0x4c2594={};var _0x4fc7af={};var _0x320a1c;var _0xb895a6;return db[_0x5f8f('0x48')]['findOne']({'where':{'id':_0xdf9966['params']['id']}})[_0x5f8f('0x19')](handleEntityNotFound(_0x245086,null))['then'](function(_0x4967cf){if(_0x4967cf){_0x320a1c=_0x4967cf;_0x4fc7af[_0x5f8f('0x33')]=_[_0x5f8f('0x34')](db[_0x5f8f('0x52')][_0x5f8f('0x32')]);_0x4fc7af['query']=_[_0x5f8f('0x34')](_0xdf9966['query']);_0x4fc7af[_0x5f8f('0x36')]=_['intersection'](_0x4fc7af['model'],_0x4fc7af[_0x5f8f('0x35')]);_0x4c2594['attributes']=_[_0x5f8f('0x38')](_0x4fc7af[_0x5f8f('0x33')],qs[_0x5f8f('0x39')](_0xdf9966[_0x5f8f('0x35')][_0x5f8f('0x39')]));_0x4c2594[_0x5f8f('0x37')]=_0x4c2594[_0x5f8f('0x37')]['length']?_0x4c2594[_0x5f8f('0x37')]:_0x4fc7af[_0x5f8f('0x33')];_0x4c2594[_0x5f8f('0x3d')]=qs[_0x5f8f('0x3e')](_0xdf9966[_0x5f8f('0x35')][_0x5f8f('0x3e')]);_0x4c2594[_0x5f8f('0x3f')]=qs[_0x5f8f('0x36')](_[_0x5f8f('0x40')](_0xdf9966[_0x5f8f('0x35')],_0x4fc7af['filters']));if(_0xdf9966[_0x5f8f('0x35')][_0x5f8f('0x45')]){_0x4c2594[_0x5f8f('0x3f')]=_[_0x5f8f('0x46')](_0x4c2594[_0x5f8f('0x3f')],{'$or':_[_0x5f8f('0x41')](_0x4c2594[_0x5f8f('0x37')],function(_0x1d56ed){var _0xe65108={};_0xe65108[_0x1d56ed]={'$like':'%'+_0xdf9966[_0x5f8f('0x35')][_0x5f8f('0x45')]+'%'};return _0xe65108;})});}_0x4c2594=_[_0x5f8f('0x46')]({},_0x4c2594,_0xdf9966[_0x5f8f('0x47')]);return _0x320a1c[_0x5f8f('0x51')](_0x4c2594);}})[_0x5f8f('0x19')](function(_0x6176cb){if(_0x6176cb){_0xb895a6=_0x6176cb[_0x5f8f('0x3a')];if(!_0xdf9966[_0x5f8f('0x35')][_0x5f8f('0x3b')](_0x5f8f('0x3c'))){_0x4c2594[_0x5f8f('0x27')]=qs[_0x5f8f('0x27')](_0xdf9966['query']['limit']);_0x4c2594[_0x5f8f('0x26')]=qs[_0x5f8f('0x26')](_0xdf9966[_0x5f8f('0x35')][_0x5f8f('0x26')]);}return _0x320a1c[_0x5f8f('0x51')](_0x4c2594);}})[_0x5f8f('0x19')](function(_0x4d60d2){if(_0x4d60d2){return _0x4d60d2?{'count':_0xb895a6,'rows':_0x4d60d2}:null;}})[_0x5f8f('0x19')](respondWithResult(_0x245086,null))['catch'](handleError(_0x245086,null));};exports[_0x5f8f('0x53')]=function(_0x6c695f,_0x407fa2,_0x1d6098){if(_0x6c695f[_0x5f8f('0x50')]['id']){delete _0x6c695f[_0x5f8f('0x50')]['id'];}return db[_0x5f8f('0x48')][_0x5f8f('0x54')]({'where':{'id':_0x6c695f['params']['id']}})[_0x5f8f('0x19')](handleEntityNotFound(_0x407fa2,null))['then'](function(_0x147798){if(_0x147798){_0x6c695f[_0x5f8f('0x50')][_0x5f8f('0x55')]=_0x147798['id'];_0x6c695f[_0x5f8f('0x50')][_0x5f8f('0x56')]=integrations[_0x5f8f('0x57')](_0x6c695f[_0x5f8f('0x50')]['channel'],_0x6c695f[_0x5f8f('0x50')][_0x5f8f('0x42')]);_0x6c695f[_0x5f8f('0x50')]['Descriptions']=integrations[_0x5f8f('0x58')](_0x6c695f[_0x5f8f('0x50')][_0x5f8f('0x59')],_0x6c695f[_0x5f8f('0x50')][_0x5f8f('0x42')]);return db[_0x5f8f('0x52')][_0x5f8f('0x4f')](_0x6c695f[_0x5f8f('0x50')],{'include':[{'model':db[_0x5f8f('0x5a')],'as':_0x5f8f('0x56')},{'model':db[_0x5f8f('0x5a')],'as':_0x5f8f('0x5b')}]});}return null;})[_0x5f8f('0x19')](respondWithResult(_0x407fa2,null))[_0x5f8f('0x22')](handleError(_0x407fa2,null));};exports[_0x5f8f('0x5c')]=function(_0x756a2a,_0x458426,_0x305db4){var _0x22af71='';return db[_0x5f8f('0x48')][_0x5f8f('0x54')]({'where':{'id':_0x756a2a['params']['id']},'attributes':['id',_0x5f8f('0x5d'),_0x5f8f('0x5e'),_0x5f8f('0x5f'),_0x5f8f('0x60'),'remoteUri']})[_0x5f8f('0x19')](handleEntityNotFound(_0x458426,null))['then'](function(_0x366206){if(_0x366206){_0x22af71=_0x366206[_0x5f8f('0x61')];var _0x273487=_0x22af71[_0x5f8f('0x62')](-0x1);if(_0x273487==='/'){_0x22af71=_0x22af71[_0x5f8f('0x63')](0x0,_0x22af71[_0x5f8f('0x64')](_0x273487));}var _0x13a644={'method':_0x5f8f('0x65'),'uri':util['format'](_0x5f8f('0x66'),_0x22af71,'ticket_fields'),'json':!![]};switch(_0x366206[_0x5f8f('0x60')]){case _0x5f8f('0x5e'):_0x13a644[_0x5f8f('0x67')]={'Authorization':util[_0x5f8f('0x68')](_0x5f8f('0x69'),new Buffer(util['format'](_0x5f8f('0x6a'),_0x366206[_0x5f8f('0x5d')],_0x366206['password']))[_0x5f8f('0x6b')](_0x5f8f('0x6c')))};break;case _0x5f8f('0x5f'):_0x13a644['headers']={'Authorization':util[_0x5f8f('0x68')](_0x5f8f('0x69'),new Buffer(util[_0x5f8f('0x68')]('%s/token:%s',_0x366206['username'],_0x366206[_0x5f8f('0x5f')]))[_0x5f8f('0x6b')](_0x5f8f('0x6c')))};break;default:throw new db[(_0x5f8f('0x6d'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x13a644);}})[_0x5f8f('0x19')](function(_0x3122d7){if(_0x3122d7){var _0x3a3bfc=[_0x5f8f('0x6e'),_0x5f8f('0x6f'),_0x5f8f('0x70'),'assignee'];_[_0x5f8f('0x71')](_0x3122d7[_0x5f8f('0x72')],function(_0x52451a){return _0x3a3bfc[_0x5f8f('0x73')](_0x52451a[_0x5f8f('0x42')]);});return{'count':_0x3122d7[_0x5f8f('0x72')][_0x5f8f('0x3a')],'rows':_['map'](_0x3122d7[_0x5f8f('0x72')],function(_0x2c4524){return{'id':_0x2c4524['id'],'name':_0x2c4524[_0x5f8f('0x74')]>0x7?_0x2c4524[_0x5f8f('0x75')]:_0x2c4524['type'],'custom':_0x2c4524[_0x5f8f('0x74')]>0x7?!![]:![],'options':_0x2c4524['system_field_options']?_0x2c4524[_0x5f8f('0x76')]:_0x2c4524[_0x5f8f('0x77')]?_0x2c4524['custom_field_options']:[]};})};}})[_0x5f8f('0x19')](respondWithResult(_0x458426,null))[_0x5f8f('0x22')](function(_0x2546b5){var _0x2cb784=_0x756a2a[_0x5f8f('0x35')][_0x5f8f('0x78')]?0x1f4:_0x2546b5['statusCode']||0x1f4;logger[_0x5f8f('0x1e')](_0x5f8f('0x79'),_0x5f8f('0x5c'),_0x2cb784,JSON['stringify'](_0x2546b5));delete _0x2546b5[_0x5f8f('0x2f')];if(_0x2cb784===0x191){_0x2cb784=0x190;}_0x458426[_0x5f8f('0x23')](_0x2cb784)[_0x5f8f('0x30')](_0x756a2a[_0x5f8f('0x35')][_0x5f8f('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x2546b5[_0x5f8f('0x7a')]}:_0x2546b5);});}; \ No newline at end of file +var _0x2657=['catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','ZendeskAccount','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','field','options','count','includeAll','include','findAll','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','getSubjects','channel','ZendeskField','Subjects','Descriptions','getFields','username','password','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','authType','headers','format','Basic\x20%s','%s:%s','toString','base64','token','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','remove','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4d70b6,_0x354121){var _0x1f1f3b=function(_0x45eab4){while(--_0x45eab4){_0x4d70b6['push'](_0x4d70b6['shift']());}};_0x1f1f3b(++_0x354121);}(_0x2657,0xd1));var _0x7265=function(_0x197970,_0x17efe6){_0x197970=_0x197970-0x0;var _0x58bbdd=_0x2657[_0x197970];return _0x58bbdd;};'use strict';var pdf=require(_0x7265('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7265('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7265('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7265('0x3'));var util=require(_0x7265('0x4'));var path=require('path');var sox=require(_0x7265('0x5'));var csv=require(_0x7265('0x6'));var ejs=require(_0x7265('0x7'));var fs=require('fs');var _=require(_0x7265('0x8'));var squel=require(_0x7265('0x9'));var crypto=require(_0x7265('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7265('0xb'));var toCsv=require(_0x7265('0x6'));var querystring=require(_0x7265('0xc'));var Papa=require(_0x7265('0xd'));var authService=require(_0x7265('0xe'));var hardwareService=require(_0x7265('0xf'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x7265('0x10'))(_0x7265('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x7265('0x12'));var client=jayson[_0x7265('0x13')][_0x7265('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x44ef66,_0x4da63b,_0x258e8d,_0x59b84f){return new BPromise(function(_0x2c8b51,_0x5ec7a5){var _0x1bb634=_0x59b84f||client;return _0x1bb634[_0x7265('0x15')](_0x44ef66,_0x258e8d)[_0x7265('0x16')](function(_0x4d1b61){logger[_0x7265('0x17')](_0x7265('0x18'),_0x4da63b,'request\x20sent');logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x4da63b,_0x7265('0x19'),JSON[_0x7265('0x1a')](_0x4d1b61));if(_0x4d1b61[_0x7265('0x1b')]){if(_0x4d1b61[_0x7265('0x1b')][_0x7265('0x1c')]===0x1f4){logger['error'](_0x7265('0x18'),_0x4da63b,_0x4d1b61[_0x7265('0x1b')][_0x7265('0x1d')]);return _0x5ec7a5(_0x4d1b61['error'][_0x7265('0x1d')]);}logger[_0x7265('0x1b')]('ZendeskAccount,\x20%s,\x20%s',_0x4da63b,_0x4d1b61[_0x7265('0x1b')][_0x7265('0x1d')]);return _0x2c8b51(_0x4d1b61[_0x7265('0x1b')][_0x7265('0x1d')]);}else{logger['info'](_0x7265('0x18'),_0x4da63b,_0x7265('0x19'));_0x2c8b51(_0x4d1b61[_0x7265('0x1e')]['message']);}})[_0x7265('0x1f')](function(_0xfc19bf){logger[_0x7265('0x1b')](_0x7265('0x18'),_0x4da63b,_0xfc19bf);_0x5ec7a5(_0xfc19bf);});});}function respondWithStatusCode(_0x1d7666,_0x21fa04){_0x21fa04=_0x21fa04||0xcc;return function(_0x114173){if(_0x114173){return _0x1d7666[_0x7265('0x20')](_0x21fa04);}return _0x1d7666[_0x7265('0x21')](_0x21fa04)[_0x7265('0x22')]();};}function respondWithResult(_0x594159,_0x4336e2){_0x4336e2=_0x4336e2||0xc8;return function(_0x30661d){if(_0x30661d){return _0x594159[_0x7265('0x21')](_0x4336e2)[_0x7265('0x23')](_0x30661d);}};}function respondWithFilteredResult(_0x3ef6c2,_0x10bacd){return function(_0x6bd693){if(_0x6bd693){var _0x157add=_0x6bd693['count'],_0x239e24=_0x10bacd[_0x7265('0x24')],_0x144122=_0x10bacd[_0x7265('0x24')]+_0x10bacd[_0x7265('0x25')],_0x499c5c;if(_0x144122>=_0x157add){_0x144122=_0x157add;_0x499c5c=0xc8;}else{_0x499c5c=0xce;}_0x3ef6c2['status'](_0x499c5c);return _0x3ef6c2[_0x7265('0x26')](_0x7265('0x27'),_0x239e24+'-'+_0x144122+'/'+_0x157add)[_0x7265('0x23')](_0x6bd693);}return null;};}function patchUpdates(_0x154daf){return function(_0x28a74a){try{jsonpatch['apply'](_0x28a74a,_0x154daf,!![]);}catch(_0x7bfe31){return BPromise[_0x7265('0x28')](_0x7bfe31);}return _0x28a74a[_0x7265('0x29')]();};}function saveUpdates(_0xf6288d,_0x4f3a5e){return function(_0x51ca67){if(_0x51ca67){return _0x51ca67[_0x7265('0x2a')](_0xf6288d)[_0x7265('0x16')](function(_0x5a32ba){return _0x5a32ba;});}return null;};}function removeEntity(_0x22fbcd,_0x3ff309){return function(_0x56ad5d){if(_0x56ad5d){return _0x56ad5d[_0x7265('0x2b')]()[_0x7265('0x16')](function(){_0x22fbcd[_0x7265('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d839b,_0x22c9b3){return function(_0x2942cf){if(!_0x2942cf){_0x2d839b['sendStatus'](0x194);}return _0x2942cf;};}function handleError(_0x37c316,_0x104f8a){_0x104f8a=_0x104f8a||0x1f4;return function(_0x5db63a){logger['error'](_0x5db63a[_0x7265('0x2c')]);if(_0x5db63a[_0x7265('0x2d')]){delete _0x5db63a['name'];}_0x37c316[_0x7265('0x21')](_0x104f8a)[_0x7265('0x2e')](_0x5db63a);};}exports[_0x7265('0x2f')]=function(_0x47c658,_0x3722ce){var _0x5953e0={},_0x3e4076={},_0x2cb28e={'count':0x0,'rows':[]};var _0x373e4f=db[_0x7265('0x30')][_0x7265('0x31')];_0x3e4076[_0x7265('0x32')]=_['keys'](_0x373e4f);_0x3e4076[_0x7265('0x33')]=_[_0x7265('0x34')](_0x47c658[_0x7265('0x33')]);_0x3e4076[_0x7265('0x35')]=_[_0x7265('0x36')](_0x3e4076[_0x7265('0x32')],_0x3e4076[_0x7265('0x33')]);_0x5953e0[_0x7265('0x37')]=_[_0x7265('0x36')](_0x3e4076['model'],qs[_0x7265('0x38')](_0x47c658[_0x7265('0x33')][_0x7265('0x38')]));_0x5953e0[_0x7265('0x37')]=_0x5953e0[_0x7265('0x37')][_0x7265('0x39')]?_0x5953e0[_0x7265('0x37')]:_0x3e4076[_0x7265('0x32')];if(!_0x47c658['query'][_0x7265('0x3a')](_0x7265('0x3b'))){_0x5953e0['limit']=qs[_0x7265('0x25')](_0x47c658[_0x7265('0x33')][_0x7265('0x25')]);_0x5953e0['offset']=qs[_0x7265('0x24')](_0x47c658[_0x7265('0x33')][_0x7265('0x24')]);}_0x5953e0[_0x7265('0x3c')]=qs[_0x7265('0x3d')](_0x47c658[_0x7265('0x33')][_0x7265('0x3d')]);_0x5953e0[_0x7265('0x3e')]=qs[_0x7265('0x35')](_['pick'](_0x47c658[_0x7265('0x33')],_0x3e4076[_0x7265('0x35')]));if(_0x47c658[_0x7265('0x33')][_0x7265('0x3f')]){_0x5953e0[_0x7265('0x3e')]=_[_0x7265('0x40')](_0x5953e0[_0x7265('0x3e')],{'$or':_[_0x7265('0x41')](_0x373e4f,function(_0x5eb3d6){if(_0x5eb3d6[_0x7265('0x42')]['key']!=='VIRTUAL'){var _0x2244f0={};_0x2244f0[_0x5eb3d6[_0x7265('0x43')]]={'$like':'%'+_0x47c658['query'][_0x7265('0x3f')]+'%'};return _0x2244f0;}})});}_0x5953e0=_[_0x7265('0x40')]({},_0x5953e0,_0x47c658[_0x7265('0x44')]);var _0x31e1cc={'where':_0x5953e0[_0x7265('0x3e')]};return db[_0x7265('0x30')]['count'](_0x31e1cc)[_0x7265('0x16')](function(_0x53b25c){_0x2cb28e[_0x7265('0x45')]=_0x53b25c;if(_0x47c658[_0x7265('0x33')][_0x7265('0x46')]){_0x5953e0[_0x7265('0x47')]=[{'all':!![]}];}return db[_0x7265('0x30')][_0x7265('0x48')](_0x5953e0);})[_0x7265('0x16')](function(_0x3ed677){_0x2cb28e['rows']=_0x3ed677;return _0x2cb28e;})['then'](respondWithFilteredResult(_0x3722ce,_0x5953e0))[_0x7265('0x1f')](handleError(_0x3722ce,null));};exports[_0x7265('0x49')]=function(_0x245da3,_0x1f9a54){var _0x316161={'raw':![],'where':{'id':_0x245da3[_0x7265('0x4a')]['id']}},_0x5c55d4={};_0x5c55d4['model']=_[_0x7265('0x34')](db[_0x7265('0x30')][_0x7265('0x31')]);_0x5c55d4[_0x7265('0x33')]=_[_0x7265('0x34')](_0x245da3[_0x7265('0x33')]);_0x5c55d4[_0x7265('0x35')]=_[_0x7265('0x36')](_0x5c55d4[_0x7265('0x32')],_0x5c55d4['query']);_0x316161[_0x7265('0x37')]=_['intersection'](_0x5c55d4[_0x7265('0x32')],qs[_0x7265('0x38')](_0x245da3['query'][_0x7265('0x38')]));_0x316161[_0x7265('0x37')]=_0x316161[_0x7265('0x37')]['length']?_0x316161[_0x7265('0x37')]:_0x5c55d4[_0x7265('0x32')];if(_0x245da3[_0x7265('0x33')][_0x7265('0x46')]){_0x316161[_0x7265('0x47')]=[{'all':!![]}];}_0x316161=_['merge']({},_0x316161,_0x245da3[_0x7265('0x44')]);return db[_0x7265('0x30')][_0x7265('0x4b')](_0x316161)[_0x7265('0x16')](handleEntityNotFound(_0x1f9a54,null))['then'](respondWithResult(_0x1f9a54,null))[_0x7265('0x1f')](handleError(_0x1f9a54,null));};exports[_0x7265('0x4c')]=function(_0x124963,_0x2ee236){return db['ZendeskAccount'][_0x7265('0x4c')](_0x124963[_0x7265('0x4d')],{})[_0x7265('0x16')](respondWithResult(_0x2ee236,0xc9))[_0x7265('0x1f')](handleError(_0x2ee236,null));};exports[_0x7265('0x2a')]=function(_0x28aae1,_0x74a5f1){if(_0x28aae1[_0x7265('0x4d')]['id']){delete _0x28aae1[_0x7265('0x4d')]['id'];}return db[_0x7265('0x30')][_0x7265('0x4b')]({'where':{'id':_0x28aae1[_0x7265('0x4a')]['id']}})[_0x7265('0x16')](handleEntityNotFound(_0x74a5f1,null))[_0x7265('0x16')](saveUpdates(_0x28aae1['body'],null))[_0x7265('0x16')](respondWithResult(_0x74a5f1,null))['catch'](handleError(_0x74a5f1,null));};exports[_0x7265('0x2b')]=function(_0x7f6bb7,_0x395e1c){return db[_0x7265('0x30')][_0x7265('0x4b')]({'where':{'id':_0x7f6bb7['params']['id']}})[_0x7265('0x16')](handleEntityNotFound(_0x395e1c,null))[_0x7265('0x16')](removeEntity(_0x395e1c,null))[_0x7265('0x1f')](handleError(_0x395e1c,null));};exports[_0x7265('0x4e')]=function(_0x5c9fd2,_0x209407,_0xf6a05b){var _0x3f49d7={};var _0x3c3317={};var _0x1512d6;var _0x3aeb8e;return db[_0x7265('0x30')][_0x7265('0x4f')]({'where':{'id':_0x5c9fd2[_0x7265('0x4a')]['id']}})['then'](handleEntityNotFound(_0x209407,null))[_0x7265('0x16')](function(_0x3b03b8){if(_0x3b03b8){_0x1512d6=_0x3b03b8;_0x3c3317[_0x7265('0x32')]=_[_0x7265('0x34')](db[_0x7265('0x50')][_0x7265('0x31')]);_0x3c3317['query']=_['keys'](_0x5c9fd2['query']);_0x3c3317[_0x7265('0x35')]=_['intersection'](_0x3c3317[_0x7265('0x32')],_0x3c3317[_0x7265('0x33')]);_0x3f49d7['attributes']=_[_0x7265('0x36')](_0x3c3317[_0x7265('0x32')],qs['fields'](_0x5c9fd2['query'][_0x7265('0x38')]));_0x3f49d7[_0x7265('0x37')]=_0x3f49d7[_0x7265('0x37')]['length']?_0x3f49d7['attributes']:_0x3c3317['model'];_0x3f49d7[_0x7265('0x3c')]=qs[_0x7265('0x3d')](_0x5c9fd2['query']['sort']);_0x3f49d7['where']=qs['filters'](_['pick'](_0x5c9fd2['query'],_0x3c3317[_0x7265('0x35')]));if(_0x5c9fd2[_0x7265('0x33')][_0x7265('0x3f')]){_0x3f49d7[_0x7265('0x3e')]=_['merge'](_0x3f49d7['where'],{'$or':_[_0x7265('0x41')](_0x3f49d7['attributes'],function(_0x1b8b67){var _0x2d2734={};_0x2d2734[_0x1b8b67]={'$like':'%'+_0x5c9fd2['query'][_0x7265('0x3f')]+'%'};return _0x2d2734;})});}_0x3f49d7=_[_0x7265('0x40')]({},_0x3f49d7,_0x5c9fd2[_0x7265('0x44')]);return _0x1512d6[_0x7265('0x4e')](_0x3f49d7);}})[_0x7265('0x16')](function(_0x5a21c4){if(_0x5a21c4){_0x3aeb8e=_0x5a21c4[_0x7265('0x39')];if(!_0x5c9fd2[_0x7265('0x33')][_0x7265('0x3a')](_0x7265('0x3b'))){_0x3f49d7['limit']=qs[_0x7265('0x25')](_0x5c9fd2[_0x7265('0x33')][_0x7265('0x25')]);_0x3f49d7['offset']=qs[_0x7265('0x24')](_0x5c9fd2['query'][_0x7265('0x24')]);}return _0x1512d6[_0x7265('0x4e')](_0x3f49d7);}})[_0x7265('0x16')](function(_0x19e268){if(_0x19e268){return _0x19e268?{'count':_0x3aeb8e,'rows':_0x19e268}:null;}})[_0x7265('0x16')](respondWithResult(_0x209407,null))[_0x7265('0x1f')](handleError(_0x209407,null));};exports[_0x7265('0x51')]=function(_0x2090af,_0x51b819,_0x51de38){if(_0x2090af[_0x7265('0x4d')]['id']){delete _0x2090af[_0x7265('0x4d')]['id'];}return db[_0x7265('0x30')][_0x7265('0x4f')]({'where':{'id':_0x2090af[_0x7265('0x4a')]['id']}})[_0x7265('0x16')](handleEntityNotFound(_0x51b819,null))['then'](function(_0x2f3380){if(_0x2f3380){_0x2090af[_0x7265('0x4d')][_0x7265('0x52')]=_0x2f3380['id'];_0x2090af['body']['Subjects']=integrations[_0x7265('0x53')](_0x2090af[_0x7265('0x4d')]['channel'],_0x2090af[_0x7265('0x4d')]['type']);_0x2090af[_0x7265('0x4d')]['Descriptions']=integrations['getDescriptions'](_0x2090af[_0x7265('0x4d')][_0x7265('0x54')],_0x2090af[_0x7265('0x4d')]['type']);return db[_0x7265('0x50')][_0x7265('0x4c')](_0x2090af[_0x7265('0x4d')],{'include':[{'model':db[_0x7265('0x55')],'as':_0x7265('0x56')},{'model':db[_0x7265('0x55')],'as':_0x7265('0x57')}]});}return null;})[_0x7265('0x16')](respondWithResult(_0x51b819,null))[_0x7265('0x1f')](handleError(_0x51b819,null));};exports[_0x7265('0x58')]=function(_0x1fae08,_0x453269,_0xf9a48){var _0x2bec72='';return db[_0x7265('0x30')][_0x7265('0x4f')]({'where':{'id':_0x1fae08[_0x7265('0x4a')]['id']},'attributes':['id',_0x7265('0x59'),_0x7265('0x5a'),'token','authType',_0x7265('0x5b')]})[_0x7265('0x16')](handleEntityNotFound(_0x453269,null))[_0x7265('0x16')](function(_0x2a79f8){if(_0x2a79f8){_0x2bec72=_0x2a79f8['remoteUri'];var _0x43b53a=_0x2bec72[_0x7265('0x5c')](-0x1);if(_0x43b53a==='/'){_0x2bec72=_0x2bec72[_0x7265('0x5d')](0x0,_0x2bec72[_0x7265('0x5e')](_0x43b53a));}var _0x33da8e={'method':_0x7265('0x5f'),'uri':util['format'](_0x7265('0x60'),_0x2bec72,_0x7265('0x61')),'json':!![]};switch(_0x2a79f8[_0x7265('0x62')]){case'password':_0x33da8e[_0x7265('0x63')]={'Authorization':util[_0x7265('0x64')](_0x7265('0x65'),new Buffer(util[_0x7265('0x64')](_0x7265('0x66'),_0x2a79f8['username'],_0x2a79f8[_0x7265('0x5a')]))[_0x7265('0x67')](_0x7265('0x68')))};break;case'token':_0x33da8e[_0x7265('0x63')]={'Authorization':util[_0x7265('0x64')](_0x7265('0x65'),new Buffer(util[_0x7265('0x64')]('%s/token:%s',_0x2a79f8['username'],_0x2a79f8[_0x7265('0x69')]))[_0x7265('0x67')](_0x7265('0x68')))};break;default:throw new db[(_0x7265('0x6a'))][(_0x7265('0x6b'))](_0x7265('0x6c'));}return rp(_0x33da8e);}})[_0x7265('0x16')](function(_0x4a6e20){if(_0x4a6e20){var _0x43cbae=[_0x7265('0x6d'),'description',_0x7265('0x6e'),'assignee'];_[_0x7265('0x6f')](_0x4a6e20[_0x7265('0x61')],function(_0x36c46c){return _0x43cbae['includes'](_0x36c46c[_0x7265('0x42')]);});return{'count':_0x4a6e20[_0x7265('0x61')][_0x7265('0x39')],'rows':_[_0x7265('0x41')](_0x4a6e20['ticket_fields'],function(_0x2c46bf){return{'id':_0x2c46bf['id'],'name':_0x2c46bf[_0x7265('0x70')]>0x7?_0x2c46bf[_0x7265('0x71')]:_0x2c46bf[_0x7265('0x42')],'custom':_0x2c46bf[_0x7265('0x70')]>0x7?!![]:![],'options':_0x2c46bf[_0x7265('0x72')]?_0x2c46bf[_0x7265('0x72')]:_0x2c46bf[_0x7265('0x73')]?_0x2c46bf[_0x7265('0x73')]:[]};})};}})[_0x7265('0x16')](respondWithResult(_0x453269,null))['catch'](function(_0x5a2b87){var _0x223378=_0x1fae08[_0x7265('0x33')][_0x7265('0x74')]?0x1f4:_0x5a2b87[_0x7265('0x75')]||0x1f4;logger[_0x7265('0x1b')](_0x7265('0x76'),'getFields',_0x223378,JSON[_0x7265('0x1a')](_0x5a2b87));delete _0x5a2b87[_0x7265('0x2d')];if(_0x223378===0x191){_0x223378=0x190;}_0x453269['status'](_0x223378)[_0x7265('0x2e')](_0x1fae08[_0x7265('0x33')][_0x7265('0x74')]?{'message':_0x7265('0x77'),'statusCode':_0x5a2b87[_0x7265('0x75')]}:_0x5a2b87);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 44f1b95..fb130e3 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 _0xe123=['int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','../../components/integrations/configuration','exports','ZendeskAccount'];(function(_0x17d133,_0x3aebc5){var _0xf4f7a2=function(_0x30277d){while(--_0x30277d){_0x17d133['push'](_0x17d133['shift']());}};_0xf4f7a2(++_0x3aebc5);}(_0xe123,0x10f));var _0x3e12=function(_0xc5bf09,_0x4fb788){_0xc5bf09=_0xc5bf09-0x0;var _0x2073d8=_0xe123[_0xc5bf09];return _0x2073d8;};'use strict';var _=require(_0x3e12('0x0'));var util=require('util');var logger=require(_0x3e12('0x1'))(_0x3e12('0x2'));var moment=require(_0x3e12('0x3'));var BPromise=require(_0x3e12('0x4'));var rp=require(_0x3e12('0x5'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x3e12('0x6'));module[_0x3e12('0x7')]=function(_0x186e25,_0xc3d49e){return _0x186e25['define'](_0x3e12('0x8'),attributes,{'tableName':_0x3e12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfeb2=['util','../../config/logger','api','moment','bluebird','request-promise','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash'];(function(_0x539a34,_0x3a79ec){var _0x5ac50a=function(_0x5efeb0){while(--_0x5efeb0){_0x539a34['push'](_0x539a34['shift']());}};_0x5ac50a(++_0x3a79ec);}(_0xfeb2,0x1b9));var _0x2feb=function(_0x512f81,_0x4a7986){_0x512f81=_0x512f81-0x0;var _0xa15099=_0xfeb2[_0x512f81];return _0xa15099;};'use strict';var _=require(_0x2feb('0x0'));var util=require(_0x2feb('0x1'));var logger=require(_0x2feb('0x2'))(_0x2feb('0x3'));var moment=require(_0x2feb('0x4'));var BPromise=require(_0x2feb('0x5'));var rp=require(_0x2feb('0x6'));var attributes=require(_0x2feb('0x7'));var integrations=require(_0x2feb('0x8'));module[_0x2feb('0x9')]=function(_0x46c14c,_0x5d8acc){return _0x46c14c[_0x2feb('0xa')](_0x2feb('0xb'),attributes,{'tableName':_0x2feb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 84add9b..1fb40b7 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 _0x0e17=['../../config/logger','rpc','../../config/environment','jayson/promise','http','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','map','model','include','info','debug','stringify','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5423f0,_0x3f4e38){var _0x6a312e=function(_0x5cdf2b){while(--_0x5cdf2b){_0x5423f0['push'](_0x5423f0['shift']());}};_0x6a312e(++_0x3f4e38);}(_0x0e17,0xd6));var _0x70e1=function(_0x50c538,_0x533db5){_0x50c538=_0x50c538-0x0;var _0x5354cc=_0x0e17[_0x50c538];return _0x5354cc;};'use strict';var _=require(_0x70e1('0x0'));var util=require(_0x70e1('0x1'));var moment=require(_0x70e1('0x2'));var BPromise=require(_0x70e1('0x3'));var rs=require(_0x70e1('0x4'));var fs=require('fs');var Redis=require(_0x70e1('0x5'));var db=require(_0x70e1('0x6'))['db'];var utils=require(_0x70e1('0x7'));var logger=require(_0x70e1('0x8'))(_0x70e1('0x9'));var config=require(_0x70e1('0xa'));var jayson=require(_0x70e1('0xb'));var client=jayson['client'][_0x70e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16a2ad,_0x191d53,_0x27f310){return new BPromise(function(_0x26218a,_0x2c45c3){return client['request'](_0x16a2ad,_0x27f310)['then'](function(_0xfe25b1){logger['info'](_0x70e1('0xd'),_0x191d53,_0x70e1('0xe'));logger['debug'](_0x70e1('0xf'),_0x191d53,_0x70e1('0xe'),JSON['stringify'](_0xfe25b1));if(_0xfe25b1[_0x70e1('0x10')]){if(_0xfe25b1['error'][_0x70e1('0x11')]===0x1f4){logger['error'](_0x70e1('0xd'),_0x191d53,_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);return _0x2c45c3(_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);}logger[_0x70e1('0x10')](_0x70e1('0xd'),_0x191d53,_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);return _0x26218a(_0xfe25b1[_0x70e1('0x10')][_0x70e1('0x12')]);}else{logger['info'](_0x70e1('0xd'),_0x191d53,_0x70e1('0xe'));_0x26218a(_0xfe25b1[_0x70e1('0x13')][_0x70e1('0x12')]);}})[_0x70e1('0x14')](function(_0xc18a09){logger[_0x70e1('0x10')](_0x70e1('0xd'),_0x191d53,_0xc18a09);_0x2c45c3(_0xc18a09);});});}exports[_0x70e1('0x15')]=function(_0xa98e90){var _0x28ed4b=this;return new Promise(function(_0x593db8,_0x5a7f4e){return db[_0x70e1('0x16')][_0x70e1('0x17')]({'raw':_0xa98e90[_0x70e1('0x18')]?_0xa98e90[_0x70e1('0x18')][_0x70e1('0x19')]===undefined?!![]:![]:!![],'where':_0xa98e90[_0x70e1('0x18')]?_0xa98e90[_0x70e1('0x18')][_0x70e1('0x1a')]||null:null,'attributes':_0xa98e90[_0x70e1('0x18')]?_0xa98e90[_0x70e1('0x18')][_0x70e1('0x1b')]||null:null,'limit':_0xa98e90[_0x70e1('0x18')]?_0xa98e90[_0x70e1('0x18')][_0x70e1('0x1c')]||null:null,'include':_0xa98e90[_0x70e1('0x18')]?_0xa98e90[_0x70e1('0x18')]['include']?_[_0x70e1('0x1d')](_0xa98e90['options']['include'],function(_0x1b4043){return{'model':db[_0x1b4043[_0x70e1('0x1e')]],'as':_0x1b4043['as'],'attributes':_0x1b4043[_0x70e1('0x1b')],'include':_0x1b4043[_0x70e1('0x1f')]?_[_0x70e1('0x1d')](_0x1b4043[_0x70e1('0x1f')],function(_0x5201f1){return{'model':db[_0x5201f1[_0x70e1('0x1e')]],'as':_0x5201f1['as'],'attributes':_0x5201f1[_0x70e1('0x1b')],'include':_0x5201f1[_0x70e1('0x1f')]?_[_0x70e1('0x1d')](_0x5201f1['include'],function(_0x181abc){return{'model':db[_0x181abc[_0x70e1('0x1e')]],'as':_0x181abc['as'],'attributes':_0x181abc[_0x70e1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1908fb){logger[_0x70e1('0x20')](_0x70e1('0x15'),_0xa98e90);logger[_0x70e1('0x21')](_0x70e1('0x15'),_0xa98e90,JSON[_0x70e1('0x22')](_0x1908fb));_0x593db8(_0x1908fb);})['catch'](function(_0x47c97c){logger[_0x70e1('0x10')]('GetZendeskAccount',_0x47c97c['message'],_0xa98e90);_0x5a7f4e(_0x28ed4b[_0x70e1('0x10')](0x1f4,_0x47c97c[_0x70e1('0x12')]));});});};exports[_0x70e1('0x23')]=function(_0x49d57d){var _0x54d187=this;return new Promise(function(_0x4d2e82,_0x2fecb3){return db[_0x70e1('0x16')][_0x70e1('0x24')]({'raw':_0x49d57d[_0x70e1('0x18')]?_0x49d57d[_0x70e1('0x18')][_0x70e1('0x19')]===undefined?!![]:![]:!![],'where':_0x49d57d[_0x70e1('0x18')]?_0x49d57d[_0x70e1('0x18')]['where']||null:null,'attributes':_0x49d57d[_0x70e1('0x18')]?_0x49d57d[_0x70e1('0x18')]['attributes']||null:null,'include':_0x49d57d[_0x70e1('0x18')]?_0x49d57d[_0x70e1('0x18')][_0x70e1('0x1f')]?_[_0x70e1('0x1d')](_0x49d57d['options'][_0x70e1('0x1f')],function(_0x2293cd){return{'model':db[_0x2293cd[_0x70e1('0x1e')]],'as':_0x2293cd['as'],'attributes':_0x2293cd[_0x70e1('0x1b')],'include':_0x2293cd[_0x70e1('0x1f')]?_[_0x70e1('0x1d')](_0x2293cd['include'],function(_0x55c888){return{'model':db[_0x55c888['model']],'as':_0x55c888['as'],'attributes':_0x55c888[_0x70e1('0x1b')],'include':_0x55c888[_0x70e1('0x1f')]?_[_0x70e1('0x1d')](_0x55c888['include'],function(_0x515f62){return{'model':db[_0x515f62[_0x70e1('0x1e')]],'as':_0x515f62['as'],'attributes':_0x515f62[_0x70e1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x328a49){logger[_0x70e1('0x20')](_0x70e1('0x23'),_0x49d57d);logger[_0x70e1('0x21')](_0x70e1('0x23'),_0x49d57d,JSON[_0x70e1('0x22')](_0x328a49));_0x4d2e82(_0x328a49);})[_0x70e1('0x14')](function(_0x389c68){logger['error'](_0x70e1('0x23'),_0x389c68[_0x70e1('0x12')],_0x49d57d);_0x2fecb3(_0x54d187['error'](0x1f4,_0x389c68['message']));});});}; \ No newline at end of file +var _0x1f0d=['debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','info','catch','findAll','options','where','limit','include','attributes','map','model','then','GetZendeskAccount','ZendeskAccount','find','raw','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0xf19644,_0x971491){var _0x17d077=function(_0x8126bc){while(--_0x8126bc){_0xf19644['push'](_0xf19644['shift']());}};_0x17d077(++_0x971491);}(_0x1f0d,0x165));var _0xd1f0=function(_0x2d8801,_0x3bc2f5){_0x2d8801=_0x2d8801-0x0;var _0x4c4d82=_0x1f0d[_0x2d8801];return _0x4c4d82;};'use strict';var _=require(_0xd1f0('0x0'));var util=require(_0xd1f0('0x1'));var moment=require(_0xd1f0('0x2'));var BPromise=require(_0xd1f0('0x3'));var rs=require(_0xd1f0('0x4'));var fs=require('fs');var Redis=require(_0xd1f0('0x5'));var db=require(_0xd1f0('0x6'))['db'];var utils=require(_0xd1f0('0x7'));var logger=require(_0xd1f0('0x8'))('rpc');var config=require(_0xd1f0('0x9'));var jayson=require(_0xd1f0('0xa'));var client=jayson[_0xd1f0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2525a4,_0x13e060,_0x4475ac){return new BPromise(function(_0x1acf66,_0x5b74ba){return client[_0xd1f0('0xc')](_0x2525a4,_0x4475ac)['then'](function(_0x33fd81){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x13e060,'request\x20sent');logger[_0xd1f0('0xd')](_0xd1f0('0xe'),_0x13e060,_0xd1f0('0xf'),JSON[_0xd1f0('0x10')](_0x33fd81));if(_0x33fd81[_0xd1f0('0x11')]){if(_0x33fd81[_0xd1f0('0x11')][_0xd1f0('0x12')]===0x1f4){logger[_0xd1f0('0x11')](_0xd1f0('0x13'),_0x13e060,_0x33fd81[_0xd1f0('0x11')]['message']);return _0x5b74ba(_0x33fd81['error'][_0xd1f0('0x14')]);}logger[_0xd1f0('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x13e060,_0x33fd81['error'][_0xd1f0('0x14')]);return _0x1acf66(_0x33fd81[_0xd1f0('0x11')]['message']);}else{logger[_0xd1f0('0x15')](_0xd1f0('0x13'),_0x13e060,_0xd1f0('0xf'));_0x1acf66(_0x33fd81['result']['message']);}})[_0xd1f0('0x16')](function(_0x4988f4){logger['error'](_0xd1f0('0x13'),_0x13e060,_0x4988f4);_0x5b74ba(_0x4988f4);});});}exports['GetZendeskAccount']=function(_0x3ecf7d){var _0x3a7ea0=this;return new Promise(function(_0x43a875,_0x3931a6){return db['ZendeskAccount'][_0xd1f0('0x17')]({'raw':_0x3ecf7d[_0xd1f0('0x18')]?_0x3ecf7d['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ecf7d[_0xd1f0('0x18')]?_0x3ecf7d[_0xd1f0('0x18')][_0xd1f0('0x19')]||null:null,'attributes':_0x3ecf7d[_0xd1f0('0x18')]?_0x3ecf7d[_0xd1f0('0x18')]['attributes']||null:null,'limit':_0x3ecf7d['options']?_0x3ecf7d[_0xd1f0('0x18')][_0xd1f0('0x1a')]||null:null,'include':_0x3ecf7d[_0xd1f0('0x18')]?_0x3ecf7d[_0xd1f0('0x18')][_0xd1f0('0x1b')]?_['map'](_0x3ecf7d[_0xd1f0('0x18')][_0xd1f0('0x1b')],function(_0x479c4e){return{'model':db[_0x479c4e['model']],'as':_0x479c4e['as'],'attributes':_0x479c4e[_0xd1f0('0x1c')],'include':_0x479c4e[_0xd1f0('0x1b')]?_[_0xd1f0('0x1d')](_0x479c4e[_0xd1f0('0x1b')],function(_0x2cff9c){return{'model':db[_0x2cff9c['model']],'as':_0x2cff9c['as'],'attributes':_0x2cff9c[_0xd1f0('0x1c')],'include':_0x2cff9c[_0xd1f0('0x1b')]?_[_0xd1f0('0x1d')](_0x2cff9c[_0xd1f0('0x1b')],function(_0x17568f){return{'model':db[_0x17568f[_0xd1f0('0x1e')]],'as':_0x17568f['as'],'attributes':_0x17568f[_0xd1f0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd1f0('0x1f')](function(_0x171d36){logger[_0xd1f0('0x15')](_0xd1f0('0x20'),_0x3ecf7d);logger['debug']('GetZendeskAccount',_0x3ecf7d,JSON[_0xd1f0('0x10')](_0x171d36));_0x43a875(_0x171d36);})[_0xd1f0('0x16')](function(_0x3c34d7){logger[_0xd1f0('0x11')]('GetZendeskAccount',_0x3c34d7[_0xd1f0('0x14')],_0x3ecf7d);_0x3931a6(_0x3a7ea0[_0xd1f0('0x11')](0x1f4,_0x3c34d7['message']));});});};exports['ShowZendeskAccount']=function(_0xa396d8){var _0x355483=this;return new Promise(function(_0x3adb3f,_0xd7d59b){return db[_0xd1f0('0x21')][_0xd1f0('0x22')]({'raw':_0xa396d8[_0xd1f0('0x18')]?_0xa396d8['options'][_0xd1f0('0x23')]===undefined?!![]:![]:!![],'where':_0xa396d8[_0xd1f0('0x18')]?_0xa396d8[_0xd1f0('0x18')][_0xd1f0('0x19')]||null:null,'attributes':_0xa396d8[_0xd1f0('0x18')]?_0xa396d8[_0xd1f0('0x18')][_0xd1f0('0x1c')]||null:null,'include':_0xa396d8['options']?_0xa396d8[_0xd1f0('0x18')]['include']?_[_0xd1f0('0x1d')](_0xa396d8[_0xd1f0('0x18')][_0xd1f0('0x1b')],function(_0x35b13a){return{'model':db[_0x35b13a[_0xd1f0('0x1e')]],'as':_0x35b13a['as'],'attributes':_0x35b13a[_0xd1f0('0x1c')],'include':_0x35b13a[_0xd1f0('0x1b')]?_[_0xd1f0('0x1d')](_0x35b13a[_0xd1f0('0x1b')],function(_0x5f15e7){return{'model':db[_0x5f15e7[_0xd1f0('0x1e')]],'as':_0x5f15e7['as'],'attributes':_0x5f15e7[_0xd1f0('0x1c')],'include':_0x5f15e7[_0xd1f0('0x1b')]?_['map'](_0x5f15e7[_0xd1f0('0x1b')],function(_0x1a6ce){return{'model':db[_0x1a6ce[_0xd1f0('0x1e')]],'as':_0x1a6ce['as'],'attributes':_0x1a6ce['attributes']};}):[]};}):[]};}):[]:[]})[_0xd1f0('0x1f')](function(_0x5b1a31){logger[_0xd1f0('0x15')](_0xd1f0('0x24'),_0xa396d8);logger['debug'](_0xd1f0('0x24'),_0xa396d8,JSON[_0xd1f0('0x10')](_0x5b1a31));_0x3adb3f(_0x5b1a31);})[_0xd1f0('0x16')](function(_0x74d4dc){logger[_0xd1f0('0x11')](_0xd1f0('0x24'),_0x74d4dc[_0xd1f0('0x14')],_0xa396d8);_0xd7d59b(_0x355483[_0xd1f0('0x11')](0x1f4,_0x74d4dc[_0xd1f0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 345df77..306f0c6 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 _0xe7f6=['show','/:id/fields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','/:id','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2a206d,_0x142bef){var _0x4c2017=function(_0x4093a6){while(--_0x4093a6){_0x2a206d['push'](_0x2a206d['shift']());}};_0x4c2017(++_0x142bef);}(_0xe7f6,0xab));var _0x6e7f=function(_0x5b8310,_0x77ea6f){_0x5b8310=_0x5b8310-0x0;var _0xd3ebc1=_0xe7f6[_0x5b8310];return _0xd3ebc1;};'use strict';var multer=require(_0x6e7f('0x0'));var util=require('util');var path=require(_0x6e7f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6e7f('0x2')]();var auth=require(_0x6e7f('0x3'));var interaction=require(_0x6e7f('0x4'));var config=require(_0x6e7f('0x5'));var controller=require('./intZendeskConfiguration.controller');router[_0x6e7f('0x6')]('/',auth[_0x6e7f('0x7')](),controller[_0x6e7f('0x8')]);router['get']('/:id',auth[_0x6e7f('0x7')](),controller[_0x6e7f('0x9')]);router[_0x6e7f('0x6')](_0x6e7f('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0x6e7f('0x6')]('/:id/subjects',auth[_0x6e7f('0x7')](),controller['getSubjects']);router[_0x6e7f('0x6')](_0x6e7f('0xb'),auth['isAuthenticated'](),controller[_0x6e7f('0xc')]);router[_0x6e7f('0x6')](_0x6e7f('0xd'),auth['isAuthenticated'](),controller[_0x6e7f('0xe')]);router[_0x6e7f('0xf')]('/',auth[_0x6e7f('0x7')](),controller['create']);router['post'](_0x6e7f('0xd'),auth[_0x6e7f('0x7')](),controller['setTags']);router['put'](_0x6e7f('0x10'),auth[_0x6e7f('0x7')](),controller['update']);router[_0x6e7f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6e7f('0x12')]);module[_0x6e7f('0x13')]=router; \ No newline at end of file +var _0x6d14=['./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x6d14,0x1c7));var _0x46d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d14[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x46d1('0x0'));var util=require(_0x46d1('0x1'));var path=require(_0x46d1('0x2'));var timeout=require(_0x46d1('0x3'));var express=require(_0x46d1('0x4'));var router=express[_0x46d1('0x5')]();var auth=require(_0x46d1('0x6'));var interaction=require(_0x46d1('0x7'));var config=require(_0x46d1('0x8'));var controller=require(_0x46d1('0x9'));router[_0x46d1('0xa')]('/',auth[_0x46d1('0xb')](),controller[_0x46d1('0xc')]);router['get'](_0x46d1('0xd'),auth[_0x46d1('0xb')](),controller[_0x46d1('0xe')]);router[_0x46d1('0xa')](_0x46d1('0xf'),auth[_0x46d1('0xb')](),controller[_0x46d1('0x10')]);router[_0x46d1('0xa')](_0x46d1('0x11'),auth['isAuthenticated'](),controller[_0x46d1('0x12')]);router[_0x46d1('0xa')](_0x46d1('0x13'),auth[_0x46d1('0xb')](),controller[_0x46d1('0x14')]);router[_0x46d1('0xa')](_0x46d1('0x15'),auth[_0x46d1('0xb')](),controller[_0x46d1('0x16')]);router[_0x46d1('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0x46d1('0x17')](_0x46d1('0x15'),auth['isAuthenticated'](),controller[_0x46d1('0x18')]);router[_0x46d1('0x19')](_0x46d1('0xd'),auth['isAuthenticated'](),controller[_0x46d1('0x1a')]);router[_0x46d1('0x1b')]('/:id',auth[_0x46d1('0xb')](),controller['destroy']);module[_0x46d1('0x1c')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index f04409d..6acc106 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 _0xb8cf=['sequelize','STRING'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xb8cf,0x190));var _0xfb8c=function(_0x40f6c7,_0x304d4a){_0x40f6c7=_0x40f6c7-0x0;var _0x4e16b8=_0xb8cf[_0x40f6c7];return _0x4e16b8;};'use strict';var Sequelize=require(_0xfb8c('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfb8c('0x1')]}}; \ No newline at end of file +var _0xaaa1=['sequelize','exports','STRING'];(function(_0x368c67,_0x4955d5){var _0x175a75=function(_0x3fa925){while(--_0x3fa925){_0x368c67['push'](_0x368c67['shift']());}};_0x175a75(++_0x4955d5);}(_0xaaa1,0xc3));var _0x1aaa=function(_0x9bde43,_0x106150){_0x9bde43=_0x9bde43-0x0;var _0xeeee2c=_0xaaa1[_0x9bde43];return _0xeeee2c;};'use strict';var Sequelize=require(_0x1aaa('0x0'));module[_0x1aaa('0x1')]={'name':{'type':Sequelize[_0x1aaa('0x2')]},'description':{'type':Sequelize[_0x1aaa('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 10531f3..2656fc1 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 _0x7e7b=['model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','show','params','find','body','update','getFields','order','getSubjects','findOne','ZendeskField','getDescriptions','Tag','getTags','setTags','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/utils','../../config/environment','../../mysqldb','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','end','stack','name','index','ZendeskConfiguration','rawAttributes','keys','query','filters','intersection'];(function(_0x3d56b5,_0x45ce64){var _0x2a960e=function(_0xfcf925){while(--_0xfcf925){_0x3d56b5['push'](_0x3d56b5['shift']());}};_0x2a960e(++_0x45ce64);}(_0x7e7b,0x133));var _0xb7e7=function(_0x827e6f,_0x22820b){_0x827e6f=_0x827e6f-0x0;var _0x136675=_0x7e7b[_0x827e6f];return _0x136675;};'use strict';var pdf=require(_0xb7e7('0x0'));var emlformat=require(_0xb7e7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb7e7('0x2'));var jsonpatch=require(_0xb7e7('0x3'));var rp=require(_0xb7e7('0x4'));var moment=require(_0xb7e7('0x5'));var BPromise=require(_0xb7e7('0x6'));var Mustache=require(_0xb7e7('0x7'));var util=require(_0xb7e7('0x8'));var path=require(_0xb7e7('0x9'));var sox=require(_0xb7e7('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb7e7('0xb'));var squel=require(_0xb7e7('0xc'));var crypto=require(_0xb7e7('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb7e7('0xe'));var querystring=require('querystring');var Papa=require(_0xb7e7('0xf'));var authService=require(_0xb7e7('0x10'));var hardwareService=require(_0xb7e7('0x11'));var Redis=require(_0xb7e7('0x12'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0xb7e7('0x13'));var config=require(_0xb7e7('0x14'));var db=require(_0xb7e7('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb7e7('0x16')][_0xb7e7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x21ad56,_0x4169f6,_0x37ef54,_0x44a5bd){return new BPromise(function(_0x1766eb,_0x4e95e2){var _0x2c89b6=_0x44a5bd||client;return _0x2c89b6['request'](_0x21ad56,_0x37ef54)[_0xb7e7('0x18')](function(_0x330593){logger[_0xb7e7('0x19')](_0xb7e7('0x1a'),_0x4169f6,_0xb7e7('0x1b'));logger[_0xb7e7('0x1c')](_0xb7e7('0x1d'),_0x4169f6,_0xb7e7('0x1b'),JSON['stringify'](_0x330593));if(_0x330593['error']){if(_0x330593[_0xb7e7('0x1e')][_0xb7e7('0x1f')]===0x1f4){logger[_0xb7e7('0x1e')](_0xb7e7('0x1a'),_0x4169f6,_0x330593[_0xb7e7('0x1e')]['message']);return _0x4e95e2(_0x330593['error']['message']);}logger[_0xb7e7('0x1e')](_0xb7e7('0x1a'),_0x4169f6,_0x330593['error']['message']);return _0x1766eb(_0x330593[_0xb7e7('0x1e')][_0xb7e7('0x20')]);}else{logger[_0xb7e7('0x19')](_0xb7e7('0x1a'),_0x4169f6,_0xb7e7('0x1b'));_0x1766eb(_0x330593[_0xb7e7('0x21')][_0xb7e7('0x20')]);}})[_0xb7e7('0x22')](function(_0x41c7a4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x4169f6,_0x41c7a4);_0x4e95e2(_0x41c7a4);});});}function respondWithStatusCode(_0x590ab3,_0x3295fb){_0x3295fb=_0x3295fb||0xcc;return function(_0x5c508e){if(_0x5c508e){return _0x590ab3[_0xb7e7('0x23')](_0x3295fb);}return _0x590ab3['status'](_0x3295fb)['end']();};}function respondWithResult(_0x3e1173,_0x1c83ac){_0x1c83ac=_0x1c83ac||0xc8;return function(_0x7b127a){if(_0x7b127a){return _0x3e1173[_0xb7e7('0x24')](_0x1c83ac)['json'](_0x7b127a);}};}function respondWithFilteredResult(_0x259a60,_0x4c9129){return function(_0x3d457e){if(_0x3d457e){var _0x15cd42=_0x3d457e[_0xb7e7('0x25')],_0x2c5999=_0x4c9129[_0xb7e7('0x26')],_0xd6e6f6=_0x4c9129['offset']+_0x4c9129[_0xb7e7('0x27')],_0x227858;if(_0xd6e6f6>=_0x15cd42){_0xd6e6f6=_0x15cd42;_0x227858=0xc8;}else{_0x227858=0xce;}_0x259a60[_0xb7e7('0x24')](_0x227858);return _0x259a60[_0xb7e7('0x28')](_0xb7e7('0x29'),_0x2c5999+'-'+_0xd6e6f6+'/'+_0x15cd42)[_0xb7e7('0x2a')](_0x3d457e);}return null;};}function patchUpdates(_0x529c1b){return function(_0x518000){try{jsonpatch[_0xb7e7('0x2b')](_0x518000,_0x529c1b,!![]);}catch(_0x540db2){return BPromise[_0xb7e7('0x2c')](_0x540db2);}return _0x518000[_0xb7e7('0x2d')]();};}function saveUpdates(_0x39602f,_0x1902b8){return function(_0x2b11ab){if(_0x2b11ab){return _0x2b11ab['update'](_0x39602f)['then'](function(_0x3548c8){return _0x3548c8;});}return null;};}function removeEntity(_0x3c81ba,_0x42f63b){return function(_0x4e415a){if(_0x4e415a){return _0x4e415a[_0xb7e7('0x2e')]()[_0xb7e7('0x18')](function(){_0x3c81ba['status'](0xcc)[_0xb7e7('0x2f')]();});}};}function handleEntityNotFound(_0x57ec1d,_0x2bed98){return function(_0x1ad0ca){if(!_0x1ad0ca){_0x57ec1d[_0xb7e7('0x23')](0x194);}return _0x1ad0ca;};}function handleError(_0x17f81b,_0x4cf5da){_0x4cf5da=_0x4cf5da||0x1f4;return function(_0x3bc2fd){logger[_0xb7e7('0x1e')](_0x3bc2fd[_0xb7e7('0x30')]);if(_0x3bc2fd[_0xb7e7('0x31')]){delete _0x3bc2fd[_0xb7e7('0x31')];}_0x17f81b[_0xb7e7('0x24')](_0x4cf5da)['send'](_0x3bc2fd);};}exports[_0xb7e7('0x32')]=function(_0x3dcea7,_0x1c45b4){var _0x2b6bbd={},_0x5cdae1={},_0x13ea4c={'count':0x0,'rows':[]};var _0x392dfe=db[_0xb7e7('0x33')][_0xb7e7('0x34')];_0x5cdae1['model']=_[_0xb7e7('0x35')](_0x392dfe);_0x5cdae1[_0xb7e7('0x36')]=_[_0xb7e7('0x35')](_0x3dcea7[_0xb7e7('0x36')]);_0x5cdae1[_0xb7e7('0x37')]=_[_0xb7e7('0x38')](_0x5cdae1[_0xb7e7('0x39')],_0x5cdae1[_0xb7e7('0x36')]);_0x2b6bbd[_0xb7e7('0x3a')]=_[_0xb7e7('0x38')](_0x5cdae1[_0xb7e7('0x39')],qs[_0xb7e7('0x3b')](_0x3dcea7[_0xb7e7('0x36')][_0xb7e7('0x3b')]));_0x2b6bbd[_0xb7e7('0x3a')]=_0x2b6bbd[_0xb7e7('0x3a')][_0xb7e7('0x3c')]?_0x2b6bbd[_0xb7e7('0x3a')]:_0x5cdae1[_0xb7e7('0x39')];if(!_0x3dcea7[_0xb7e7('0x36')][_0xb7e7('0x3d')](_0xb7e7('0x3e'))){_0x2b6bbd[_0xb7e7('0x27')]=qs[_0xb7e7('0x27')](_0x3dcea7[_0xb7e7('0x36')]['limit']);_0x2b6bbd[_0xb7e7('0x26')]=qs[_0xb7e7('0x26')](_0x3dcea7[_0xb7e7('0x36')][_0xb7e7('0x26')]);}_0x2b6bbd['order']=qs[_0xb7e7('0x3f')](_0x3dcea7[_0xb7e7('0x36')][_0xb7e7('0x3f')]);_0x2b6bbd[_0xb7e7('0x40')]=qs[_0xb7e7('0x37')](_[_0xb7e7('0x41')](_0x3dcea7['query'],_0x5cdae1['filters']));if(_0x3dcea7[_0xb7e7('0x36')]['filter']){_0x2b6bbd[_0xb7e7('0x40')]=_[_0xb7e7('0x42')](_0x2b6bbd[_0xb7e7('0x40')],{'$or':_[_0xb7e7('0x43')](_0x392dfe,function(_0x5247c0){if(_0x5247c0[_0xb7e7('0x44')][_0xb7e7('0x45')]!==_0xb7e7('0x46')){var _0x255fd3={};_0x255fd3[_0x5247c0[_0xb7e7('0x47')]]={'$like':'%'+_0x3dcea7[_0xb7e7('0x36')][_0xb7e7('0x48')]+'%'};return _0x255fd3;}})});}_0x2b6bbd=_['merge']({},_0x2b6bbd,_0x3dcea7[_0xb7e7('0x49')]);var _0x4df95e={'where':_0x2b6bbd['where']};return db[_0xb7e7('0x33')][_0xb7e7('0x25')](_0x4df95e)[_0xb7e7('0x18')](function(_0x3b47af){_0x13ea4c[_0xb7e7('0x25')]=_0x3b47af;if(_0x3dcea7['query'][_0xb7e7('0x4a')]){_0x2b6bbd[_0xb7e7('0x4b')]=[{'all':!![]}];}return db[_0xb7e7('0x33')][_0xb7e7('0x4c')](_0x2b6bbd);})['then'](function(_0x1f06a9){_0x13ea4c['rows']=_0x1f06a9;return _0x13ea4c;})[_0xb7e7('0x18')](respondWithFilteredResult(_0x1c45b4,_0x2b6bbd))['catch'](handleError(_0x1c45b4,null));};exports[_0xb7e7('0x4d')]=function(_0x69ef66,_0x5a32b4){var _0x19c8e9={'raw':![],'where':{'id':_0x69ef66[_0xb7e7('0x4e')]['id']}},_0x4de2bd={};_0x4de2bd[_0xb7e7('0x39')]=_[_0xb7e7('0x35')](db[_0xb7e7('0x33')][_0xb7e7('0x34')]);_0x4de2bd[_0xb7e7('0x36')]=_[_0xb7e7('0x35')](_0x69ef66[_0xb7e7('0x36')]);_0x4de2bd[_0xb7e7('0x37')]=_[_0xb7e7('0x38')](_0x4de2bd['model'],_0x4de2bd['query']);_0x19c8e9[_0xb7e7('0x3a')]=_['intersection'](_0x4de2bd['model'],qs['fields'](_0x69ef66[_0xb7e7('0x36')][_0xb7e7('0x3b')]));_0x19c8e9[_0xb7e7('0x3a')]=_0x19c8e9['attributes']['length']?_0x19c8e9['attributes']:_0x4de2bd['model'];if(_0x69ef66[_0xb7e7('0x36')][_0xb7e7('0x4a')]){_0x19c8e9[_0xb7e7('0x4b')]=[{'all':!![]}];}_0x19c8e9=_[_0xb7e7('0x42')]({},_0x19c8e9,_0x69ef66[_0xb7e7('0x49')]);return db[_0xb7e7('0x33')][_0xb7e7('0x4f')](_0x19c8e9)[_0xb7e7('0x18')](handleEntityNotFound(_0x5a32b4,null))[_0xb7e7('0x18')](respondWithResult(_0x5a32b4,null))[_0xb7e7('0x22')](handleError(_0x5a32b4,null));};exports['create']=function(_0x29ec44,_0x2911a1){return db[_0xb7e7('0x33')]['create'](_0x29ec44[_0xb7e7('0x50')],{})['then'](respondWithResult(_0x2911a1,0xc9))[_0xb7e7('0x22')](handleError(_0x2911a1,null));};exports[_0xb7e7('0x51')]=function(_0x54d01d,_0x57bb8e){if(_0x54d01d[_0xb7e7('0x50')]['id']){delete _0x54d01d[_0xb7e7('0x50')]['id'];}return db[_0xb7e7('0x33')]['find']({'where':{'id':_0x54d01d['params']['id']}})[_0xb7e7('0x18')](handleEntityNotFound(_0x57bb8e,null))[_0xb7e7('0x18')](saveUpdates(_0x54d01d['body'],null))[_0xb7e7('0x18')](respondWithResult(_0x57bb8e,null))[_0xb7e7('0x22')](handleError(_0x57bb8e,null));};exports[_0xb7e7('0x2e')]=function(_0x122b49,_0x24fda4){return db[_0xb7e7('0x33')][_0xb7e7('0x4f')]({'where':{'id':_0x122b49['params']['id']}})[_0xb7e7('0x18')](handleEntityNotFound(_0x24fda4,null))[_0xb7e7('0x18')](removeEntity(_0x24fda4,null))[_0xb7e7('0x22')](handleError(_0x24fda4,null));};exports[_0xb7e7('0x52')]=function(_0x1a14c3,_0x18d846,_0x2d3763){var _0x2e1ac8={};var _0x320b1b={};var _0x5db757;var _0xe2e9b9;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x1a14c3[_0xb7e7('0x4e')]['id']}})['then'](handleEntityNotFound(_0x18d846,null))['then'](function(_0x4b4359){if(_0x4b4359){_0x5db757=_0x4b4359;_0x320b1b[_0xb7e7('0x39')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x320b1b[_0xb7e7('0x36')]=_[_0xb7e7('0x35')](_0x1a14c3['query']);_0x320b1b[_0xb7e7('0x37')]=_[_0xb7e7('0x38')](_0x320b1b['model'],_0x320b1b[_0xb7e7('0x36')]);_0x2e1ac8[_0xb7e7('0x3a')]=_[_0xb7e7('0x38')](_0x320b1b[_0xb7e7('0x39')],qs[_0xb7e7('0x3b')](_0x1a14c3[_0xb7e7('0x36')][_0xb7e7('0x3b')]));_0x2e1ac8[_0xb7e7('0x3a')]=_0x2e1ac8[_0xb7e7('0x3a')]['length']?_0x2e1ac8[_0xb7e7('0x3a')]:_0x320b1b[_0xb7e7('0x39')];_0x2e1ac8[_0xb7e7('0x53')]=qs[_0xb7e7('0x3f')](_0x1a14c3[_0xb7e7('0x36')][_0xb7e7('0x3f')]);_0x2e1ac8[_0xb7e7('0x40')]=qs['filters'](_['pick'](_0x1a14c3[_0xb7e7('0x36')],_0x320b1b['filters']));if(_0x1a14c3['query'][_0xb7e7('0x48')]){_0x2e1ac8[_0xb7e7('0x40')]=_[_0xb7e7('0x42')](_0x2e1ac8[_0xb7e7('0x40')],{'$or':_[_0xb7e7('0x43')](_0x2e1ac8[_0xb7e7('0x3a')],function(_0x5b9290){var _0x5d0d4b={};_0x5d0d4b[_0x5b9290]={'$like':'%'+_0x1a14c3[_0xb7e7('0x36')][_0xb7e7('0x48')]+'%'};return _0x5d0d4b;})});}_0x2e1ac8=_[_0xb7e7('0x42')]({},_0x2e1ac8,_0x1a14c3[_0xb7e7('0x49')]);return _0x5db757['getFields'](_0x2e1ac8);}})['then'](function(_0x5c4be9){if(_0x5c4be9){_0xe2e9b9=_0x5c4be9[_0xb7e7('0x3c')];if(!_0x1a14c3[_0xb7e7('0x36')][_0xb7e7('0x3d')](_0xb7e7('0x3e'))){_0x2e1ac8[_0xb7e7('0x27')]=qs[_0xb7e7('0x27')](_0x1a14c3[_0xb7e7('0x36')]['limit']);_0x2e1ac8[_0xb7e7('0x26')]=qs[_0xb7e7('0x26')](_0x1a14c3[_0xb7e7('0x36')][_0xb7e7('0x26')]);}return _0x5db757[_0xb7e7('0x52')](_0x2e1ac8);}})[_0xb7e7('0x18')](function(_0x26e30e){if(_0x26e30e){return _0x26e30e?{'count':_0xe2e9b9,'rows':_0x26e30e}:null;}})[_0xb7e7('0x18')](respondWithResult(_0x18d846,null))[_0xb7e7('0x22')](handleError(_0x18d846,null));};exports[_0xb7e7('0x54')]=function(_0x392a02,_0x320e44,_0x5453c0){var _0x53b5b1={};var _0x394d49={};var _0x560ff9;var _0x58a337;return db[_0xb7e7('0x33')][_0xb7e7('0x55')]({'where':{'id':_0x392a02['params']['id']}})[_0xb7e7('0x18')](handleEntityNotFound(_0x320e44,null))[_0xb7e7('0x18')](function(_0x201ab5){if(_0x201ab5){_0x560ff9=_0x201ab5;_0x394d49['model']=_['keys'](db[_0xb7e7('0x56')][_0xb7e7('0x34')]);_0x394d49[_0xb7e7('0x36')]=_[_0xb7e7('0x35')](_0x392a02[_0xb7e7('0x36')]);_0x394d49['filters']=_[_0xb7e7('0x38')](_0x394d49[_0xb7e7('0x39')],_0x394d49[_0xb7e7('0x36')]);_0x53b5b1['attributes']=_[_0xb7e7('0x38')](_0x394d49[_0xb7e7('0x39')],qs[_0xb7e7('0x3b')](_0x392a02['query'][_0xb7e7('0x3b')]));_0x53b5b1[_0xb7e7('0x3a')]=_0x53b5b1[_0xb7e7('0x3a')][_0xb7e7('0x3c')]?_0x53b5b1[_0xb7e7('0x3a')]:_0x394d49['model'];_0x53b5b1[_0xb7e7('0x53')]=qs[_0xb7e7('0x3f')](_0x392a02['query'][_0xb7e7('0x3f')]);_0x53b5b1[_0xb7e7('0x40')]=qs[_0xb7e7('0x37')](_[_0xb7e7('0x41')](_0x392a02[_0xb7e7('0x36')],_0x394d49[_0xb7e7('0x37')]));if(_0x392a02[_0xb7e7('0x36')]['filter']){_0x53b5b1[_0xb7e7('0x40')]=_['merge'](_0x53b5b1[_0xb7e7('0x40')],{'$or':_[_0xb7e7('0x43')](_0x53b5b1[_0xb7e7('0x3a')],function(_0x2cb447){var _0x31f4fc={};_0x31f4fc[_0x2cb447]={'$like':'%'+_0x392a02[_0xb7e7('0x36')][_0xb7e7('0x48')]+'%'};return _0x31f4fc;})});}_0x53b5b1=_[_0xb7e7('0x42')]({},_0x53b5b1,_0x392a02['options']);return _0x560ff9[_0xb7e7('0x54')](_0x53b5b1);}})[_0xb7e7('0x18')](function(_0x1e8989){if(_0x1e8989){_0x58a337=_0x1e8989[_0xb7e7('0x3c')];if(!_0x392a02[_0xb7e7('0x36')][_0xb7e7('0x3d')](_0xb7e7('0x3e'))){_0x53b5b1['limit']=qs[_0xb7e7('0x27')](_0x392a02[_0xb7e7('0x36')][_0xb7e7('0x27')]);_0x53b5b1[_0xb7e7('0x26')]=qs[_0xb7e7('0x26')](_0x392a02['query'][_0xb7e7('0x26')]);}return _0x560ff9['getSubjects'](_0x53b5b1);}})[_0xb7e7('0x18')](function(_0x4fec86){if(_0x4fec86){return _0x4fec86?{'count':_0x58a337,'rows':_0x4fec86}:null;}})[_0xb7e7('0x18')](respondWithResult(_0x320e44,null))[_0xb7e7('0x22')](handleError(_0x320e44,null));};exports[_0xb7e7('0x57')]=function(_0x5d0479,_0x5c2509,_0x254d2c){var _0xc07171={};var _0x1659eb={};var _0x856f75;var _0xde02f6;return db[_0xb7e7('0x33')][_0xb7e7('0x55')]({'where':{'id':_0x5d0479[_0xb7e7('0x4e')]['id']}})[_0xb7e7('0x18')](handleEntityNotFound(_0x5c2509,null))[_0xb7e7('0x18')](function(_0x385bc4){if(_0x385bc4){_0x856f75=_0x385bc4;_0x1659eb[_0xb7e7('0x39')]=_[_0xb7e7('0x35')](db[_0xb7e7('0x56')][_0xb7e7('0x34')]);_0x1659eb[_0xb7e7('0x36')]=_['keys'](_0x5d0479[_0xb7e7('0x36')]);_0x1659eb['filters']=_[_0xb7e7('0x38')](_0x1659eb[_0xb7e7('0x39')],_0x1659eb['query']);_0xc07171['attributes']=_[_0xb7e7('0x38')](_0x1659eb[_0xb7e7('0x39')],qs[_0xb7e7('0x3b')](_0x5d0479[_0xb7e7('0x36')][_0xb7e7('0x3b')]));_0xc07171['attributes']=_0xc07171[_0xb7e7('0x3a')][_0xb7e7('0x3c')]?_0xc07171['attributes']:_0x1659eb[_0xb7e7('0x39')];_0xc07171[_0xb7e7('0x53')]=qs[_0xb7e7('0x3f')](_0x5d0479[_0xb7e7('0x36')][_0xb7e7('0x3f')]);_0xc07171[_0xb7e7('0x40')]=qs[_0xb7e7('0x37')](_[_0xb7e7('0x41')](_0x5d0479[_0xb7e7('0x36')],_0x1659eb['filters']));if(_0x5d0479['query'][_0xb7e7('0x48')]){_0xc07171['where']=_['merge'](_0xc07171['where'],{'$or':_[_0xb7e7('0x43')](_0xc07171[_0xb7e7('0x3a')],function(_0x3385d3){var _0x538839={};_0x538839[_0x3385d3]={'$like':'%'+_0x5d0479[_0xb7e7('0x36')][_0xb7e7('0x48')]+'%'};return _0x538839;})});}_0xc07171=_[_0xb7e7('0x42')]({},_0xc07171,_0x5d0479[_0xb7e7('0x49')]);return _0x856f75[_0xb7e7('0x57')](_0xc07171);}})[_0xb7e7('0x18')](function(_0x1ec964){if(_0x1ec964){_0xde02f6=_0x1ec964[_0xb7e7('0x3c')];if(!_0x5d0479[_0xb7e7('0x36')]['hasOwnProperty']('nolimit')){_0xc07171['limit']=qs[_0xb7e7('0x27')](_0x5d0479[_0xb7e7('0x36')][_0xb7e7('0x27')]);_0xc07171['offset']=qs[_0xb7e7('0x26')](_0x5d0479[_0xb7e7('0x36')]['offset']);}return _0x856f75['getDescriptions'](_0xc07171);}})[_0xb7e7('0x18')](function(_0x466a5c){if(_0x466a5c){return _0x466a5c?{'count':_0xde02f6,'rows':_0x466a5c}:null;}})[_0xb7e7('0x18')](respondWithResult(_0x5c2509,null))['catch'](handleError(_0x5c2509,null));};exports['getTags']=function(_0x3e5daa,_0x2d37fc,_0x6f7c75){var _0x5cc037={};var _0x4a93e3={};var _0x2761bc;var _0x59e92b;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3e5daa[_0xb7e7('0x4e')]['id']}})[_0xb7e7('0x18')](handleEntityNotFound(_0x2d37fc,null))[_0xb7e7('0x18')](function(_0x17278e){if(_0x17278e){_0x2761bc=_0x17278e;_0x4a93e3['model']=_[_0xb7e7('0x35')](db[_0xb7e7('0x58')]['rawAttributes']);_0x4a93e3[_0xb7e7('0x36')]=_['keys'](_0x3e5daa[_0xb7e7('0x36')]);_0x4a93e3[_0xb7e7('0x37')]=_[_0xb7e7('0x38')](_0x4a93e3[_0xb7e7('0x39')],_0x4a93e3[_0xb7e7('0x36')]);_0x5cc037[_0xb7e7('0x3a')]=_['intersection'](_0x4a93e3[_0xb7e7('0x39')],qs[_0xb7e7('0x3b')](_0x3e5daa[_0xb7e7('0x36')][_0xb7e7('0x3b')]));_0x5cc037[_0xb7e7('0x3a')]=_0x5cc037[_0xb7e7('0x3a')][_0xb7e7('0x3c')]?_0x5cc037[_0xb7e7('0x3a')]:_0x4a93e3[_0xb7e7('0x39')];_0x5cc037[_0xb7e7('0x53')]=qs[_0xb7e7('0x3f')](_0x3e5daa['query']['sort']);_0x5cc037['where']=qs[_0xb7e7('0x37')](_[_0xb7e7('0x41')](_0x3e5daa[_0xb7e7('0x36')],_0x4a93e3[_0xb7e7('0x37')]));if(_0x3e5daa[_0xb7e7('0x36')]['filter']){_0x5cc037['where']=_[_0xb7e7('0x42')](_0x5cc037[_0xb7e7('0x40')],{'$or':_[_0xb7e7('0x43')](_0x5cc037[_0xb7e7('0x3a')],function(_0x3926b6){var _0x1a2de5={};_0x1a2de5[_0x3926b6]={'$like':'%'+_0x3e5daa['query'][_0xb7e7('0x48')]+'%'};return _0x1a2de5;})});}_0x5cc037=_[_0xb7e7('0x42')]({},_0x5cc037,_0x3e5daa[_0xb7e7('0x49')]);return _0x2761bc['getTags'](_0x5cc037);}})[_0xb7e7('0x18')](function(_0x455f1c){if(_0x455f1c){_0x59e92b=_0x455f1c[_0xb7e7('0x3c')];if(!_0x3e5daa['query'][_0xb7e7('0x3d')]('nolimit')){_0x5cc037['limit']=qs[_0xb7e7('0x27')](_0x3e5daa[_0xb7e7('0x36')][_0xb7e7('0x27')]);_0x5cc037[_0xb7e7('0x26')]=qs['offset'](_0x3e5daa[_0xb7e7('0x36')][_0xb7e7('0x26')]);}return _0x2761bc[_0xb7e7('0x59')](_0x5cc037);}})[_0xb7e7('0x18')](function(_0x260626){if(_0x260626){return _0x260626?{'count':_0x59e92b,'rows':_0x260626}:null;}})['then'](respondWithResult(_0x2d37fc,null))[_0xb7e7('0x22')](handleError(_0x2d37fc,null));};exports[_0xb7e7('0x5a')]=function(_0x50921c,_0x3b2551,_0x15e80e){if(_0x50921c[_0xb7e7('0x50')]['id']){delete _0x50921c['body']['id'];}return db[_0xb7e7('0x33')][_0xb7e7('0x55')]({'where':{'id':_0x50921c[_0xb7e7('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3b2551,null))[_0xb7e7('0x18')](function(_0x4e82ef){if(_0x4e82ef){return _0x4e82ef['setTags'](_0x50921c[_0xb7e7('0x50')]['ids']||[]);}return null;})[_0xb7e7('0x18')](respondWithResult(_0x3b2551,null))[_0xb7e7('0x22')](handleError(_0x3b2551,null));}; \ No newline at end of file +var _0xad99=['json','reject','save','update','stack','name','send','index','ZendeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','map','key','VIRTUAL','filter','includeAll','include','rows','show','params','create','body','find','destroy','getFields','findOne','ZendeskField','options','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','set'];(function(_0x4d0299,_0x5551c9){var _0x25968a=function(_0x43889a){while(--_0x43889a){_0x4d0299['push'](_0x4d0299['shift']());}};_0x25968a(++_0x5551c9);}(_0xad99,0x195));var _0x9ad9=function(_0x287785,_0xc49ede){_0x287785=_0x287785-0x0;var _0x4fb012=_0xad99[_0x287785];return _0x4fb012;};'use strict';var pdf=require(_0x9ad9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9ad9('0x1'));var rp=require('request-promise');var moment=require(_0x9ad9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9ad9('0x3'));var util=require('util');var path=require(_0x9ad9('0x4'));var sox=require(_0x9ad9('0x5'));var csv=require(_0x9ad9('0x6'));var ejs=require(_0x9ad9('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9ad9('0x8'));var crypto=require('crypto');var jsforce=require(_0x9ad9('0x9'));var deskjs=require(_0x9ad9('0xa'));var toCsv=require(_0x9ad9('0x6'));var querystring=require(_0x9ad9('0xb'));var Papa=require(_0x9ad9('0xc'));var authService=require(_0x9ad9('0xd'));var hardwareService=require(_0x9ad9('0xe'));var Redis=require('ioredis');var qs=require(_0x9ad9('0xf'));var logger=require(_0x9ad9('0x10'))('api');var utils=require(_0x9ad9('0x11'));var config=require(_0x9ad9('0x12'));var db=require(_0x9ad9('0x13'))['db'];var jayson=require(_0x9ad9('0x14'));var client=jayson[_0x9ad9('0x15')][_0x9ad9('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x19b5dc,_0x521690,_0x3a3459,_0x140991){return new BPromise(function(_0x37eea1,_0x4a3fc2){var _0x523737=_0x140991||client;return _0x523737['request'](_0x19b5dc,_0x3a3459)[_0x9ad9('0x17')](function(_0x3df9ec){logger[_0x9ad9('0x18')](_0x9ad9('0x19'),_0x521690,_0x9ad9('0x1a'));logger[_0x9ad9('0x1b')](_0x9ad9('0x1c'),_0x521690,_0x9ad9('0x1a'),JSON[_0x9ad9('0x1d')](_0x3df9ec));if(_0x3df9ec[_0x9ad9('0x1e')]){if(_0x3df9ec['error'][_0x9ad9('0x1f')]===0x1f4){logger[_0x9ad9('0x1e')](_0x9ad9('0x19'),_0x521690,_0x3df9ec[_0x9ad9('0x1e')]['message']);return _0x4a3fc2(_0x3df9ec['error'][_0x9ad9('0x20')]);}logger[_0x9ad9('0x1e')](_0x9ad9('0x19'),_0x521690,_0x3df9ec[_0x9ad9('0x1e')]['message']);return _0x37eea1(_0x3df9ec[_0x9ad9('0x1e')][_0x9ad9('0x20')]);}else{logger[_0x9ad9('0x18')](_0x9ad9('0x19'),_0x521690,_0x9ad9('0x1a'));_0x37eea1(_0x3df9ec['result'][_0x9ad9('0x20')]);}})[_0x9ad9('0x21')](function(_0x2969a2){logger['error'](_0x9ad9('0x19'),_0x521690,_0x2969a2);_0x4a3fc2(_0x2969a2);});});}function respondWithStatusCode(_0x29f245,_0x2d3d87){_0x2d3d87=_0x2d3d87||0xcc;return function(_0x23ab90){if(_0x23ab90){return _0x29f245[_0x9ad9('0x22')](_0x2d3d87);}return _0x29f245[_0x9ad9('0x23')](_0x2d3d87)[_0x9ad9('0x24')]();};}function respondWithResult(_0x31a37b,_0x764384){_0x764384=_0x764384||0xc8;return function(_0x5475fd){if(_0x5475fd){return _0x31a37b[_0x9ad9('0x23')](_0x764384)['json'](_0x5475fd);}};}function respondWithFilteredResult(_0x3fa57c,_0x1b90b3){return function(_0x333d5b){if(_0x333d5b){var _0x37efcd=_0x333d5b[_0x9ad9('0x25')],_0x2046aa=_0x1b90b3['offset'],_0x189574=_0x1b90b3[_0x9ad9('0x26')]+_0x1b90b3['limit'],_0xd55bf5;if(_0x189574>=_0x37efcd){_0x189574=_0x37efcd;_0xd55bf5=0xc8;}else{_0xd55bf5=0xce;}_0x3fa57c[_0x9ad9('0x23')](_0xd55bf5);return _0x3fa57c[_0x9ad9('0x27')]('Content-Range',_0x2046aa+'-'+_0x189574+'/'+_0x37efcd)[_0x9ad9('0x28')](_0x333d5b);}return null;};}function patchUpdates(_0x1d6a9b){return function(_0x3303cb){try{jsonpatch['apply'](_0x3303cb,_0x1d6a9b,!![]);}catch(_0x3b7596){return BPromise[_0x9ad9('0x29')](_0x3b7596);}return _0x3303cb[_0x9ad9('0x2a')]();};}function saveUpdates(_0x593d2d,_0x1fb2cd){return function(_0x1cb364){if(_0x1cb364){return _0x1cb364[_0x9ad9('0x2b')](_0x593d2d)[_0x9ad9('0x17')](function(_0x4aae8f){return _0x4aae8f;});}return null;};}function removeEntity(_0x83b868,_0x3924de){return function(_0x12f1b2){if(_0x12f1b2){return _0x12f1b2['destroy']()[_0x9ad9('0x17')](function(){_0x83b868[_0x9ad9('0x23')](0xcc)[_0x9ad9('0x24')]();});}};}function handleEntityNotFound(_0xb4e9b9,_0x501893){return function(_0x239d3d){if(!_0x239d3d){_0xb4e9b9[_0x9ad9('0x22')](0x194);}return _0x239d3d;};}function handleError(_0x29773b,_0x50f7ef){_0x50f7ef=_0x50f7ef||0x1f4;return function(_0x3634a2){logger['error'](_0x3634a2[_0x9ad9('0x2c')]);if(_0x3634a2[_0x9ad9('0x2d')]){delete _0x3634a2[_0x9ad9('0x2d')];}_0x29773b[_0x9ad9('0x23')](_0x50f7ef)[_0x9ad9('0x2e')](_0x3634a2);};}exports[_0x9ad9('0x2f')]=function(_0x3550ca,_0x1308d7){var _0xf32061={},_0x19edf5={},_0x4abd4c={'count':0x0,'rows':[]};var _0x54b83a=db[_0x9ad9('0x30')][_0x9ad9('0x31')];_0x19edf5[_0x9ad9('0x32')]=_[_0x9ad9('0x33')](_0x54b83a);_0x19edf5[_0x9ad9('0x34')]=_[_0x9ad9('0x33')](_0x3550ca['query']);_0x19edf5[_0x9ad9('0x35')]=_[_0x9ad9('0x36')](_0x19edf5[_0x9ad9('0x32')],_0x19edf5[_0x9ad9('0x34')]);_0xf32061[_0x9ad9('0x37')]=_[_0x9ad9('0x36')](_0x19edf5['model'],qs[_0x9ad9('0x38')](_0x3550ca[_0x9ad9('0x34')][_0x9ad9('0x38')]));_0xf32061[_0x9ad9('0x37')]=_0xf32061[_0x9ad9('0x37')][_0x9ad9('0x39')]?_0xf32061[_0x9ad9('0x37')]:_0x19edf5['model'];if(!_0x3550ca[_0x9ad9('0x34')]['hasOwnProperty'](_0x9ad9('0x3a'))){_0xf32061[_0x9ad9('0x3b')]=qs['limit'](_0x3550ca[_0x9ad9('0x34')][_0x9ad9('0x3b')]);_0xf32061['offset']=qs[_0x9ad9('0x26')](_0x3550ca['query'][_0x9ad9('0x26')]);}_0xf32061[_0x9ad9('0x3c')]=qs[_0x9ad9('0x3d')](_0x3550ca[_0x9ad9('0x34')][_0x9ad9('0x3d')]);_0xf32061[_0x9ad9('0x3e')]=qs[_0x9ad9('0x35')](_[_0x9ad9('0x3f')](_0x3550ca[_0x9ad9('0x34')],_0x19edf5[_0x9ad9('0x35')]));if(_0x3550ca['query']['filter']){_0xf32061[_0x9ad9('0x3e')]=_[_0x9ad9('0x40')](_0xf32061[_0x9ad9('0x3e')],{'$or':_[_0x9ad9('0x41')](_0x54b83a,function(_0xb7e063){if(_0xb7e063['type'][_0x9ad9('0x42')]!==_0x9ad9('0x43')){var _0x7dd580={};_0x7dd580[_0xb7e063['field']]={'$like':'%'+_0x3550ca[_0x9ad9('0x34')][_0x9ad9('0x44')]+'%'};return _0x7dd580;}})});}_0xf32061=_[_0x9ad9('0x40')]({},_0xf32061,_0x3550ca['options']);var _0x2fcb21={'where':_0xf32061[_0x9ad9('0x3e')]};return db[_0x9ad9('0x30')]['count'](_0x2fcb21)[_0x9ad9('0x17')](function(_0x5312dd){_0x4abd4c[_0x9ad9('0x25')]=_0x5312dd;if(_0x3550ca[_0x9ad9('0x34')][_0x9ad9('0x45')]){_0xf32061[_0x9ad9('0x46')]=[{'all':!![]}];}return db[_0x9ad9('0x30')]['findAll'](_0xf32061);})[_0x9ad9('0x17')](function(_0x3244ea){_0x4abd4c[_0x9ad9('0x47')]=_0x3244ea;return _0x4abd4c;})[_0x9ad9('0x17')](respondWithFilteredResult(_0x1308d7,_0xf32061))[_0x9ad9('0x21')](handleError(_0x1308d7,null));};exports[_0x9ad9('0x48')]=function(_0x55d8b0,_0x1b7eb7){var _0x333556={'raw':![],'where':{'id':_0x55d8b0[_0x9ad9('0x49')]['id']}},_0x34c31f={};_0x34c31f[_0x9ad9('0x32')]=_['keys'](db[_0x9ad9('0x30')]['rawAttributes']);_0x34c31f[_0x9ad9('0x34')]=_[_0x9ad9('0x33')](_0x55d8b0['query']);_0x34c31f[_0x9ad9('0x35')]=_['intersection'](_0x34c31f['model'],_0x34c31f[_0x9ad9('0x34')]);_0x333556['attributes']=_[_0x9ad9('0x36')](_0x34c31f[_0x9ad9('0x32')],qs[_0x9ad9('0x38')](_0x55d8b0[_0x9ad9('0x34')][_0x9ad9('0x38')]));_0x333556['attributes']=_0x333556[_0x9ad9('0x37')]['length']?_0x333556[_0x9ad9('0x37')]:_0x34c31f[_0x9ad9('0x32')];if(_0x55d8b0['query'][_0x9ad9('0x45')]){_0x333556[_0x9ad9('0x46')]=[{'all':!![]}];}_0x333556=_[_0x9ad9('0x40')]({},_0x333556,_0x55d8b0['options']);return db[_0x9ad9('0x30')]['find'](_0x333556)[_0x9ad9('0x17')](handleEntityNotFound(_0x1b7eb7,null))[_0x9ad9('0x17')](respondWithResult(_0x1b7eb7,null))['catch'](handleError(_0x1b7eb7,null));};exports['create']=function(_0x336fa7,_0x55a677){return db[_0x9ad9('0x30')][_0x9ad9('0x4a')](_0x336fa7[_0x9ad9('0x4b')],{})[_0x9ad9('0x17')](respondWithResult(_0x55a677,0xc9))[_0x9ad9('0x21')](handleError(_0x55a677,null));};exports[_0x9ad9('0x2b')]=function(_0x5af760,_0x3c129b){if(_0x5af760[_0x9ad9('0x4b')]['id']){delete _0x5af760[_0x9ad9('0x4b')]['id'];}return db['ZendeskConfiguration'][_0x9ad9('0x4c')]({'where':{'id':_0x5af760[_0x9ad9('0x49')]['id']}})[_0x9ad9('0x17')](handleEntityNotFound(_0x3c129b,null))[_0x9ad9('0x17')](saveUpdates(_0x5af760[_0x9ad9('0x4b')],null))[_0x9ad9('0x17')](respondWithResult(_0x3c129b,null))[_0x9ad9('0x21')](handleError(_0x3c129b,null));};exports[_0x9ad9('0x4d')]=function(_0x4ccb3b,_0x5e5729){return db[_0x9ad9('0x30')][_0x9ad9('0x4c')]({'where':{'id':_0x4ccb3b['params']['id']}})[_0x9ad9('0x17')](handleEntityNotFound(_0x5e5729,null))[_0x9ad9('0x17')](removeEntity(_0x5e5729,null))[_0x9ad9('0x21')](handleError(_0x5e5729,null));};exports[_0x9ad9('0x4e')]=function(_0x2511d0,_0x24681d,_0x3b241f){var _0x32aba3={};var _0x589b46={};var _0x580197;var _0x3081f0;return db['ZendeskConfiguration'][_0x9ad9('0x4f')]({'where':{'id':_0x2511d0['params']['id']}})[_0x9ad9('0x17')](handleEntityNotFound(_0x24681d,null))[_0x9ad9('0x17')](function(_0x260289){if(_0x260289){_0x580197=_0x260289;_0x589b46[_0x9ad9('0x32')]=_[_0x9ad9('0x33')](db[_0x9ad9('0x50')][_0x9ad9('0x31')]);_0x589b46[_0x9ad9('0x34')]=_[_0x9ad9('0x33')](_0x2511d0['query']);_0x589b46[_0x9ad9('0x35')]=_[_0x9ad9('0x36')](_0x589b46[_0x9ad9('0x32')],_0x589b46['query']);_0x32aba3['attributes']=_['intersection'](_0x589b46[_0x9ad9('0x32')],qs[_0x9ad9('0x38')](_0x2511d0['query'][_0x9ad9('0x38')]));_0x32aba3[_0x9ad9('0x37')]=_0x32aba3['attributes'][_0x9ad9('0x39')]?_0x32aba3['attributes']:_0x589b46[_0x9ad9('0x32')];_0x32aba3[_0x9ad9('0x3c')]=qs['sort'](_0x2511d0[_0x9ad9('0x34')]['sort']);_0x32aba3[_0x9ad9('0x3e')]=qs[_0x9ad9('0x35')](_[_0x9ad9('0x3f')](_0x2511d0[_0x9ad9('0x34')],_0x589b46[_0x9ad9('0x35')]));if(_0x2511d0[_0x9ad9('0x34')][_0x9ad9('0x44')]){_0x32aba3[_0x9ad9('0x3e')]=_['merge'](_0x32aba3[_0x9ad9('0x3e')],{'$or':_[_0x9ad9('0x41')](_0x32aba3[_0x9ad9('0x37')],function(_0x402569){var _0xfeb477={};_0xfeb477[_0x402569]={'$like':'%'+_0x2511d0[_0x9ad9('0x34')][_0x9ad9('0x44')]+'%'};return _0xfeb477;})});}_0x32aba3=_[_0x9ad9('0x40')]({},_0x32aba3,_0x2511d0[_0x9ad9('0x51')]);return _0x580197[_0x9ad9('0x4e')](_0x32aba3);}})[_0x9ad9('0x17')](function(_0x34b378){if(_0x34b378){_0x3081f0=_0x34b378['length'];if(!_0x2511d0[_0x9ad9('0x34')][_0x9ad9('0x52')]('nolimit')){_0x32aba3[_0x9ad9('0x3b')]=qs[_0x9ad9('0x3b')](_0x2511d0[_0x9ad9('0x34')][_0x9ad9('0x3b')]);_0x32aba3[_0x9ad9('0x26')]=qs[_0x9ad9('0x26')](_0x2511d0[_0x9ad9('0x34')][_0x9ad9('0x26')]);}return _0x580197[_0x9ad9('0x4e')](_0x32aba3);}})['then'](function(_0x8ff2ed){if(_0x8ff2ed){return _0x8ff2ed?{'count':_0x3081f0,'rows':_0x8ff2ed}:null;}})[_0x9ad9('0x17')](respondWithResult(_0x24681d,null))['catch'](handleError(_0x24681d,null));};exports[_0x9ad9('0x53')]=function(_0x15899b,_0x5a09fd,_0x28c52e){var _0x4285ab={};var _0x564626={};var _0x53a9f1;var _0x4206d1;return db[_0x9ad9('0x30')][_0x9ad9('0x4f')]({'where':{'id':_0x15899b[_0x9ad9('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a09fd,null))[_0x9ad9('0x17')](function(_0x1791bf){if(_0x1791bf){_0x53a9f1=_0x1791bf;_0x564626['model']=_[_0x9ad9('0x33')](db[_0x9ad9('0x50')][_0x9ad9('0x31')]);_0x564626['query']=_[_0x9ad9('0x33')](_0x15899b[_0x9ad9('0x34')]);_0x564626['filters']=_[_0x9ad9('0x36')](_0x564626[_0x9ad9('0x32')],_0x564626[_0x9ad9('0x34')]);_0x4285ab['attributes']=_[_0x9ad9('0x36')](_0x564626[_0x9ad9('0x32')],qs['fields'](_0x15899b[_0x9ad9('0x34')]['fields']));_0x4285ab[_0x9ad9('0x37')]=_0x4285ab[_0x9ad9('0x37')][_0x9ad9('0x39')]?_0x4285ab['attributes']:_0x564626[_0x9ad9('0x32')];_0x4285ab['order']=qs['sort'](_0x15899b[_0x9ad9('0x34')][_0x9ad9('0x3d')]);_0x4285ab[_0x9ad9('0x3e')]=qs[_0x9ad9('0x35')](_[_0x9ad9('0x3f')](_0x15899b['query'],_0x564626[_0x9ad9('0x35')]));if(_0x15899b[_0x9ad9('0x34')][_0x9ad9('0x44')]){_0x4285ab[_0x9ad9('0x3e')]=_['merge'](_0x4285ab[_0x9ad9('0x3e')],{'$or':_[_0x9ad9('0x41')](_0x4285ab['attributes'],function(_0x49faf3){var _0x580bdc={};_0x580bdc[_0x49faf3]={'$like':'%'+_0x15899b[_0x9ad9('0x34')][_0x9ad9('0x44')]+'%'};return _0x580bdc;})});}_0x4285ab=_[_0x9ad9('0x40')]({},_0x4285ab,_0x15899b[_0x9ad9('0x51')]);return _0x53a9f1[_0x9ad9('0x53')](_0x4285ab);}})[_0x9ad9('0x17')](function(_0x2d98fc){if(_0x2d98fc){_0x4206d1=_0x2d98fc[_0x9ad9('0x39')];if(!_0x15899b[_0x9ad9('0x34')][_0x9ad9('0x52')](_0x9ad9('0x3a'))){_0x4285ab[_0x9ad9('0x3b')]=qs[_0x9ad9('0x3b')](_0x15899b['query']['limit']);_0x4285ab[_0x9ad9('0x26')]=qs[_0x9ad9('0x26')](_0x15899b['query'][_0x9ad9('0x26')]);}return _0x53a9f1[_0x9ad9('0x53')](_0x4285ab);}})['then'](function(_0x38493d){if(_0x38493d){return _0x38493d?{'count':_0x4206d1,'rows':_0x38493d}:null;}})[_0x9ad9('0x17')](respondWithResult(_0x5a09fd,null))[_0x9ad9('0x21')](handleError(_0x5a09fd,null));};exports[_0x9ad9('0x54')]=function(_0x354f51,_0x2da153,_0x925cf7){var _0x4c0863={};var _0x493a3c={};var _0x392ba5;var _0x267d86;return db[_0x9ad9('0x30')][_0x9ad9('0x4f')]({'where':{'id':_0x354f51[_0x9ad9('0x49')]['id']}})[_0x9ad9('0x17')](handleEntityNotFound(_0x2da153,null))[_0x9ad9('0x17')](function(_0xc49931){if(_0xc49931){_0x392ba5=_0xc49931;_0x493a3c['model']=_['keys'](db[_0x9ad9('0x50')][_0x9ad9('0x31')]);_0x493a3c['query']=_[_0x9ad9('0x33')](_0x354f51[_0x9ad9('0x34')]);_0x493a3c[_0x9ad9('0x35')]=_[_0x9ad9('0x36')](_0x493a3c['model'],_0x493a3c[_0x9ad9('0x34')]);_0x4c0863[_0x9ad9('0x37')]=_['intersection'](_0x493a3c['model'],qs[_0x9ad9('0x38')](_0x354f51[_0x9ad9('0x34')][_0x9ad9('0x38')]));_0x4c0863[_0x9ad9('0x37')]=_0x4c0863[_0x9ad9('0x37')][_0x9ad9('0x39')]?_0x4c0863[_0x9ad9('0x37')]:_0x493a3c[_0x9ad9('0x32')];_0x4c0863[_0x9ad9('0x3c')]=qs[_0x9ad9('0x3d')](_0x354f51['query']['sort']);_0x4c0863[_0x9ad9('0x3e')]=qs[_0x9ad9('0x35')](_[_0x9ad9('0x3f')](_0x354f51[_0x9ad9('0x34')],_0x493a3c[_0x9ad9('0x35')]));if(_0x354f51[_0x9ad9('0x34')]['filter']){_0x4c0863[_0x9ad9('0x3e')]=_['merge'](_0x4c0863[_0x9ad9('0x3e')],{'$or':_['map'](_0x4c0863[_0x9ad9('0x37')],function(_0x22f6b8){var _0x1d1edd={};_0x1d1edd[_0x22f6b8]={'$like':'%'+_0x354f51[_0x9ad9('0x34')]['filter']+'%'};return _0x1d1edd;})});}_0x4c0863=_['merge']({},_0x4c0863,_0x354f51['options']);return _0x392ba5[_0x9ad9('0x54')](_0x4c0863);}})[_0x9ad9('0x17')](function(_0x113d4a){if(_0x113d4a){_0x267d86=_0x113d4a[_0x9ad9('0x39')];if(!_0x354f51[_0x9ad9('0x34')][_0x9ad9('0x52')](_0x9ad9('0x3a'))){_0x4c0863['limit']=qs[_0x9ad9('0x3b')](_0x354f51[_0x9ad9('0x34')]['limit']);_0x4c0863['offset']=qs[_0x9ad9('0x26')](_0x354f51[_0x9ad9('0x34')][_0x9ad9('0x26')]);}return _0x392ba5['getDescriptions'](_0x4c0863);}})[_0x9ad9('0x17')](function(_0x484838){if(_0x484838){return _0x484838?{'count':_0x267d86,'rows':_0x484838}:null;}})[_0x9ad9('0x17')](respondWithResult(_0x2da153,null))['catch'](handleError(_0x2da153,null));};exports[_0x9ad9('0x55')]=function(_0x3c6a36,_0x268f8c,_0x538583){var _0xb7fd78={};var _0x1e770a={};var _0x39015c;var _0x489ee5;return db[_0x9ad9('0x30')]['findOne']({'where':{'id':_0x3c6a36['params']['id']}})[_0x9ad9('0x17')](handleEntityNotFound(_0x268f8c,null))[_0x9ad9('0x17')](function(_0x19c8bc){if(_0x19c8bc){_0x39015c=_0x19c8bc;_0x1e770a[_0x9ad9('0x32')]=_[_0x9ad9('0x33')](db[_0x9ad9('0x56')][_0x9ad9('0x31')]);_0x1e770a[_0x9ad9('0x34')]=_['keys'](_0x3c6a36[_0x9ad9('0x34')]);_0x1e770a[_0x9ad9('0x35')]=_['intersection'](_0x1e770a['model'],_0x1e770a[_0x9ad9('0x34')]);_0xb7fd78[_0x9ad9('0x37')]=_[_0x9ad9('0x36')](_0x1e770a[_0x9ad9('0x32')],qs['fields'](_0x3c6a36[_0x9ad9('0x34')][_0x9ad9('0x38')]));_0xb7fd78[_0x9ad9('0x37')]=_0xb7fd78[_0x9ad9('0x37')]['length']?_0xb7fd78[_0x9ad9('0x37')]:_0x1e770a[_0x9ad9('0x32')];_0xb7fd78[_0x9ad9('0x3c')]=qs[_0x9ad9('0x3d')](_0x3c6a36['query']['sort']);_0xb7fd78[_0x9ad9('0x3e')]=qs[_0x9ad9('0x35')](_['pick'](_0x3c6a36[_0x9ad9('0x34')],_0x1e770a[_0x9ad9('0x35')]));if(_0x3c6a36[_0x9ad9('0x34')][_0x9ad9('0x44')]){_0xb7fd78[_0x9ad9('0x3e')]=_[_0x9ad9('0x40')](_0xb7fd78[_0x9ad9('0x3e')],{'$or':_['map'](_0xb7fd78['attributes'],function(_0x11eade){var _0x40329f={};_0x40329f[_0x11eade]={'$like':'%'+_0x3c6a36[_0x9ad9('0x34')][_0x9ad9('0x44')]+'%'};return _0x40329f;})});}_0xb7fd78=_[_0x9ad9('0x40')]({},_0xb7fd78,_0x3c6a36['options']);return _0x39015c['getTags'](_0xb7fd78);}})[_0x9ad9('0x17')](function(_0x564a9c){if(_0x564a9c){_0x489ee5=_0x564a9c[_0x9ad9('0x39')];if(!_0x3c6a36[_0x9ad9('0x34')]['hasOwnProperty'](_0x9ad9('0x3a'))){_0xb7fd78[_0x9ad9('0x3b')]=qs['limit'](_0x3c6a36[_0x9ad9('0x34')][_0x9ad9('0x3b')]);_0xb7fd78[_0x9ad9('0x26')]=qs[_0x9ad9('0x26')](_0x3c6a36[_0x9ad9('0x34')][_0x9ad9('0x26')]);}return _0x39015c[_0x9ad9('0x55')](_0xb7fd78);}})['then'](function(_0x34ec31){if(_0x34ec31){return _0x34ec31?{'count':_0x489ee5,'rows':_0x34ec31}:null;}})[_0x9ad9('0x17')](respondWithResult(_0x268f8c,null))[_0x9ad9('0x21')](handleError(_0x268f8c,null));};exports[_0x9ad9('0x57')]=function(_0x3fee7d,_0x29a383,_0x5f4ea1){if(_0x3fee7d['body']['id']){delete _0x3fee7d['body']['id'];}return db[_0x9ad9('0x30')][_0x9ad9('0x4f')]({'where':{'id':_0x3fee7d[_0x9ad9('0x49')]['id']}})[_0x9ad9('0x17')](handleEntityNotFound(_0x29a383,null))[_0x9ad9('0x17')](function(_0xea988d){if(_0xea988d){return _0xea988d[_0x9ad9('0x57')](_0x3fee7d[_0x9ad9('0x4b')][_0x9ad9('0x58')]||[]);}return null;})[_0x9ad9('0x17')](respondWithResult(_0x29a383,null))[_0x9ad9('0x21')](handleError(_0x29a383,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 360445c..b7ad70a 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 _0xded9=['bluebird','request-promise','ZendeskConfiguration','int_zendesk_configurations','util','moment'];(function(_0x5206f3,_0x4d69a5){var _0x58414e=function(_0x13b3fc){while(--_0x13b3fc){_0x5206f3['push'](_0x5206f3['shift']());}};_0x58414e(++_0x4d69a5);}(_0xded9,0x1d2));var _0x9ded=function(_0x30a443,_0x4e7b2f){_0x30a443=_0x30a443-0x0;var _0x49ed50=_0xded9[_0x30a443];return _0x49ed50;};'use strict';var _=require('lodash');var util=require(_0x9ded('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9ded('0x1'));var BPromise=require(_0x9ded('0x2'));var rp=require(_0x9ded('0x3'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x20961a,_0x490cbb){return _0x20961a['define'](_0x9ded('0x4'),attributes,{'tableName':_0x9ded('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4281=['api','moment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger'];(function(_0xbce1a9,_0xc5994e){var _0x1533e3=function(_0x9f3c52){while(--_0x9f3c52){_0xbce1a9['push'](_0xbce1a9['shift']());}};_0x1533e3(++_0xc5994e);}(_0x4281,0x1dd));var _0x1428=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x4281[_0x390733];return _0x33beb9;};'use strict';var _=require(_0x1428('0x0'));var util=require(_0x1428('0x1'));var logger=require(_0x1428('0x2'))(_0x1428('0x3'));var moment=require(_0x1428('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x1428('0x5'));module[_0x1428('0x6')]=function(_0x333a0d,_0x5589c1){return _0x333a0d[_0x1428('0x7')](_0x1428('0x8'),attributes,{'tableName':_0x1428('0x9'),'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 ef20cc2..56c2e59 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 _0x0e18=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','ZendeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x52af35,_0x2b3d93){var _0x2a07e9=function(_0x2d3e2e){while(--_0x2d3e2e){_0x52af35['push'](_0x52af35['shift']());}};_0x2a07e9(++_0x2b3d93);}(_0x0e18,0x1c2));var _0x80e1=function(_0x2db6fc,_0x38f2a6){_0x2db6fc=_0x2db6fc-0x0;var _0xa0f599=_0x0e18[_0x2db6fc];return _0xa0f599;};'use strict';var _=require(_0x80e1('0x0'));var util=require(_0x80e1('0x1'));var moment=require(_0x80e1('0x2'));var BPromise=require(_0x80e1('0x3'));var rs=require(_0x80e1('0x4'));var fs=require('fs');var Redis=require(_0x80e1('0x5'));var db=require(_0x80e1('0x6'))['db'];var utils=require(_0x80e1('0x7'));var logger=require(_0x80e1('0x8'))(_0x80e1('0x9'));var config=require(_0x80e1('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x80e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x384968,_0x35afc3,_0x2a60da){return new BPromise(function(_0x141766,_0x4efaa2){return client[_0x80e1('0xc')](_0x384968,_0x2a60da)[_0x80e1('0xd')](function(_0x197fea){logger[_0x80e1('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x35afc3,_0x80e1('0xf'));logger[_0x80e1('0x10')](_0x80e1('0x11'),_0x35afc3,'request\x20sent',JSON['stringify'](_0x197fea));if(_0x197fea[_0x80e1('0x12')]){if(_0x197fea[_0x80e1('0x12')][_0x80e1('0x13')]===0x1f4){logger[_0x80e1('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x35afc3,_0x197fea[_0x80e1('0x12')][_0x80e1('0x14')]);return _0x4efaa2(_0x197fea[_0x80e1('0x12')][_0x80e1('0x14')]);}logger[_0x80e1('0x12')](_0x80e1('0x15'),_0x35afc3,_0x197fea['error'][_0x80e1('0x14')]);return _0x141766(_0x197fea['error'][_0x80e1('0x14')]);}else{logger[_0x80e1('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x35afc3,_0x80e1('0xf'));_0x141766(_0x197fea[_0x80e1('0x16')]['message']);}})[_0x80e1('0x17')](function(_0x5abcfc){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x35afc3,_0x5abcfc);_0x4efaa2(_0x5abcfc);});});} \ No newline at end of file +var _0x2ea3=['then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/logger','rpc','http','request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2ea3,0x14e));var _0x32ea=function(_0x28d71e,_0x5c246c){_0x28d71e=_0x28d71e-0x0;var _0x51aa25=_0x2ea3[_0x28d71e];return _0x51aa25;};'use strict';var _=require(_0x32ea('0x0'));var util=require(_0x32ea('0x1'));var moment=require(_0x32ea('0x2'));var BPromise=require('bluebird');var rs=require(_0x32ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x32ea('0x4'))(_0x32ea('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x32ea('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x33e022,_0x34b41a,_0x2063eb){return new BPromise(function(_0x3df428,_0x467f6d){return client[_0x32ea('0x7')](_0x33e022,_0x2063eb)[_0x32ea('0x8')](function(_0x253d67){logger[_0x32ea('0x9')](_0x32ea('0xa'),_0x34b41a,_0x32ea('0xb'));logger['debug'](_0x32ea('0xc'),_0x34b41a,_0x32ea('0xb'),JSON[_0x32ea('0xd')](_0x253d67));if(_0x253d67[_0x32ea('0xe')]){if(_0x253d67[_0x32ea('0xe')][_0x32ea('0xf')]===0x1f4){logger[_0x32ea('0xe')](_0x32ea('0xa'),_0x34b41a,_0x253d67[_0x32ea('0xe')][_0x32ea('0x10')]);return _0x467f6d(_0x253d67[_0x32ea('0xe')][_0x32ea('0x10')]);}logger['error'](_0x32ea('0xa'),_0x34b41a,_0x253d67['error'][_0x32ea('0x10')]);return _0x3df428(_0x253d67[_0x32ea('0xe')][_0x32ea('0x10')]);}else{logger[_0x32ea('0x9')]('ZendeskConfiguration,\x20%s,\x20%s',_0x34b41a,_0x32ea('0xb'));_0x3df428(_0x253d67[_0x32ea('0x11')]['message']);}})[_0x32ea('0x12')](function(_0x5d2b11){logger[_0x32ea('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x34b41a,_0x5d2b11);_0x467f6d(_0x5d2b11);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 7c14367..64071a2 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 _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x44b54f,_0xe07a57){var _0x396a5c=function(_0x3c866d){while(--_0x3c866d){_0x44b54f['push'](_0x44b54f['shift']());}};_0x396a5c(++_0xe07a57);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./intZendeskField.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router; \ No newline at end of file +var _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x213d2e,_0x2effc7){var _0x3a7ae0=function(_0x3b22d4){while(--_0x3b22d4){_0x213d2e['push'](_0x213d2e['shift']());}};_0x3a7ae0(++_0x2effc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 8151694..d7cde67 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 _0x55e0=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x10a8d8,_0x28f292){var _0x3b2b79=function(_0x55a3fe){while(--_0x55a3fe){_0x10a8d8['push'](_0x10a8d8['shift']());}};_0x3b2b79(++_0x28f292);}(_0x55e0,0xdc));var _0x055e=function(_0x5524b0,_0x17b4fd){_0x5524b0=_0x5524b0-0x0;var _0x5c551e=_0x55e0[_0x5524b0];return _0x5c551e;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'type':{'type':Sequelize[_0x055e('0x2')](_0x055e('0x3'),'variable','customVariable',_0x055e('0x4')),'defaultValue':_0x055e('0x3')},'content':{'type':Sequelize[_0x055e('0x5')]},'key':{'type':Sequelize[_0x055e('0x5')]},'keyType':{'type':Sequelize[_0x055e('0x2')](_0x055e('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x055e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x055e('0x5')]},'customField':{'type':Sequelize[_0x055e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x055e('0x5')]}}; \ No newline at end of file +var _0xcb91=['string','variable','customVariable','STRING','BOOLEAN','ENUM'];(function(_0x2f5f75,_0x33f102){var _0x18dba6=function(_0x3e998a){while(--_0x3e998a){_0x2f5f75['push'](_0x2f5f75['shift']());}};_0x18dba6(++_0x33f102);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xcb91[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1cb9('0x0')](_0x1cb9('0x1'),_0x1cb9('0x2'),_0x1cb9('0x3'),'keyValue'),'defaultValue':_0x1cb9('0x1')},'content':{'type':Sequelize[_0x1cb9('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1cb9('0x0')](_0x1cb9('0x1'),'variable',_0x1cb9('0x3'))},'keyContent':{'type':Sequelize[_0x1cb9('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1cb9('0x4')]},'customField':{'type':Sequelize[_0x1cb9('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 447b165..9700f3d 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 _0x155b=['field','filter','options','includeAll','findAll','show','params','merge','find','catch','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','json','count','offset','limit','set','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','ZendeskField','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','map','type','key'];(function(_0x30f897,_0x37455e){var _0x40bfff=function(_0x5530bf){while(--_0x5530bf){_0x30f897['push'](_0x30f897['shift']());}};_0x40bfff(++_0x37455e);}(_0x155b,0x1af));var _0xb155=function(_0x50ffbb,_0x21a925){_0x50ffbb=_0x50ffbb-0x0;var _0x576a1c=_0x155b[_0x50ffbb];return _0x576a1c;};'use strict';var pdf=require(_0xb155('0x0'));var emlformat=require(_0xb155('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb155('0x2'));var jsonpatch=require(_0xb155('0x3'));var rp=require(_0xb155('0x4'));var moment=require(_0xb155('0x5'));var BPromise=require(_0xb155('0x6'));var Mustache=require('mustache');var util=require(_0xb155('0x7'));var path=require(_0xb155('0x8'));var sox=require(_0xb155('0x9'));var csv=require(_0xb155('0xa'));var ejs=require(_0xb155('0xb'));var fs=require('fs');var _=require(_0xb155('0xc'));var squel=require(_0xb155('0xd'));var crypto=require(_0xb155('0xe'));var jsforce=require(_0xb155('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb155('0xa'));var querystring=require(_0xb155('0x10'));var Papa=require(_0xb155('0x11'));var authService=require(_0xb155('0x12'));var hardwareService=require(_0xb155('0x13'));var Redis=require('ioredis');var qs=require(_0xb155('0x14'));var logger=require(_0xb155('0x15'))(_0xb155('0x16'));var utils=require(_0xb155('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53efe1,_0x4f16a2){_0x4f16a2=_0x4f16a2||0xcc;return function(_0x34a0ef){if(_0x34a0ef){return _0x53efe1['sendStatus'](_0x4f16a2);}return _0x53efe1['status'](_0x4f16a2)['end']();};}function respondWithResult(_0x4f4236,_0x2aa529){_0x2aa529=_0x2aa529||0xc8;return function(_0x59f37e){if(_0x59f37e){return _0x4f4236[_0xb155('0x18')](_0x2aa529)[_0xb155('0x19')](_0x59f37e);}};}function respondWithFilteredResult(_0x55acf0,_0x4545ea){return function(_0x41fb94){if(_0x41fb94){var _0x52564e=_0x41fb94[_0xb155('0x1a')],_0x5e40db=_0x4545ea[_0xb155('0x1b')],_0x1ff88c=_0x4545ea[_0xb155('0x1b')]+_0x4545ea[_0xb155('0x1c')],_0x35acae;if(_0x1ff88c>=_0x52564e){_0x1ff88c=_0x52564e;_0x35acae=0xc8;}else{_0x35acae=0xce;}_0x55acf0[_0xb155('0x18')](_0x35acae);return _0x55acf0[_0xb155('0x1d')]('Content-Range',_0x5e40db+'-'+_0x1ff88c+'/'+_0x52564e)['json'](_0x41fb94);}return null;};}function patchUpdates(_0x5f2ca9){return function(_0x567cc9){try{jsonpatch[_0xb155('0x1e')](_0x567cc9,_0x5f2ca9,!![]);}catch(_0xaabd3f){return BPromise[_0xb155('0x1f')](_0xaabd3f);}return _0x567cc9[_0xb155('0x20')]();};}function saveUpdates(_0x1101e0,_0x2f70d7){return function(_0x5ed9a6){if(_0x5ed9a6){return _0x5ed9a6['update'](_0x1101e0)[_0xb155('0x21')](function(_0x489763){return _0x489763;});}return null;};}function removeEntity(_0xaba126,_0x555443){return function(_0x5ee2a0){if(_0x5ee2a0){return _0x5ee2a0[_0xb155('0x22')]()[_0xb155('0x21')](function(){_0xaba126[_0xb155('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d508,_0xeafed5){return function(_0x1f0225){if(!_0x1f0225){_0x50d508[_0xb155('0x23')](0x194);}return _0x1f0225;};}function handleError(_0x14f48c,_0x4f65f3){_0x4f65f3=_0x4f65f3||0x1f4;return function(_0x33169c){logger[_0xb155('0x24')](_0x33169c[_0xb155('0x25')]);if(_0x33169c[_0xb155('0x26')]){delete _0x33169c[_0xb155('0x26')];}_0x14f48c['status'](_0x4f65f3)[_0xb155('0x27')](_0x33169c);};}exports['index']=function(_0x28e3d6,_0x5f574a){var _0x4838eb={},_0x48762d={},_0x17776e={'count':0x0,'rows':[]};var _0x29233a=db[_0xb155('0x28')][_0xb155('0x29')];_0x48762d[_0xb155('0x2a')]=_[_0xb155('0x2b')](_0x29233a);_0x48762d['query']=_[_0xb155('0x2b')](_0x28e3d6[_0xb155('0x2c')]);_0x48762d['filters']=_[_0xb155('0x2d')](_0x48762d['model'],_0x48762d[_0xb155('0x2c')]);_0x4838eb[_0xb155('0x2e')]=_[_0xb155('0x2d')](_0x48762d[_0xb155('0x2a')],qs[_0xb155('0x2f')](_0x28e3d6[_0xb155('0x2c')][_0xb155('0x2f')]));_0x4838eb[_0xb155('0x2e')]=_0x4838eb[_0xb155('0x2e')][_0xb155('0x30')]?_0x4838eb[_0xb155('0x2e')]:_0x48762d[_0xb155('0x2a')];if(!_0x28e3d6[_0xb155('0x2c')][_0xb155('0x31')](_0xb155('0x32'))){_0x4838eb[_0xb155('0x1c')]=qs[_0xb155('0x1c')](_0x28e3d6[_0xb155('0x2c')][_0xb155('0x1c')]);_0x4838eb[_0xb155('0x1b')]=qs[_0xb155('0x1b')](_0x28e3d6[_0xb155('0x2c')][_0xb155('0x1b')]);}_0x4838eb[_0xb155('0x33')]=qs[_0xb155('0x34')](_0x28e3d6['query']['sort']);_0x4838eb['where']=qs['filters'](_[_0xb155('0x35')](_0x28e3d6['query'],_0x48762d[_0xb155('0x36')]));if(_0x28e3d6['query']['filter']){_0x4838eb[_0xb155('0x37')]=_['merge'](_0x4838eb[_0xb155('0x37')],{'$or':_[_0xb155('0x38')](_0x29233a,function(_0x2a76d2){if(_0x2a76d2[_0xb155('0x39')][_0xb155('0x3a')]!=='VIRTUAL'){var _0x54d020={};_0x54d020[_0x2a76d2[_0xb155('0x3b')]]={'$like':'%'+_0x28e3d6[_0xb155('0x2c')][_0xb155('0x3c')]+'%'};return _0x54d020;}})});}_0x4838eb=_['merge']({},_0x4838eb,_0x28e3d6[_0xb155('0x3d')]);var _0x522768={'where':_0x4838eb['where']};return db['ZendeskField'][_0xb155('0x1a')](_0x522768)[_0xb155('0x21')](function(_0x4d4a4b){_0x17776e[_0xb155('0x1a')]=_0x4d4a4b;if(_0x28e3d6[_0xb155('0x2c')][_0xb155('0x3e')]){_0x4838eb['include']=[{'all':!![]}];}return db[_0xb155('0x28')][_0xb155('0x3f')](_0x4838eb);})[_0xb155('0x21')](function(_0x8dc284){_0x17776e['rows']=_0x8dc284;return _0x17776e;})[_0xb155('0x21')](respondWithFilteredResult(_0x5f574a,_0x4838eb))['catch'](handleError(_0x5f574a,null));};exports[_0xb155('0x40')]=function(_0x1ceb56,_0x314398){var _0x1a11ba={'raw':!![],'where':{'id':_0x1ceb56[_0xb155('0x41')]['id']}},_0x3b7389={};_0x3b7389[_0xb155('0x2a')]=_[_0xb155('0x2b')](db[_0xb155('0x28')][_0xb155('0x29')]);_0x3b7389['query']=_[_0xb155('0x2b')](_0x1ceb56[_0xb155('0x2c')]);_0x3b7389[_0xb155('0x36')]=_[_0xb155('0x2d')](_0x3b7389[_0xb155('0x2a')],_0x3b7389[_0xb155('0x2c')]);_0x1a11ba['attributes']=_[_0xb155('0x2d')](_0x3b7389['model'],qs[_0xb155('0x2f')](_0x1ceb56[_0xb155('0x2c')][_0xb155('0x2f')]));_0x1a11ba['attributes']=_0x1a11ba[_0xb155('0x2e')][_0xb155('0x30')]?_0x1a11ba[_0xb155('0x2e')]:_0x3b7389['model'];if(_0x1ceb56[_0xb155('0x2c')][_0xb155('0x3e')]){_0x1a11ba['include']=[{'all':!![]}];}_0x1a11ba=_[_0xb155('0x42')]({},_0x1a11ba,_0x1ceb56['options']);return db[_0xb155('0x28')][_0xb155('0x43')](_0x1a11ba)[_0xb155('0x21')](handleEntityNotFound(_0x314398,null))[_0xb155('0x21')](respondWithResult(_0x314398,null))['catch'](handleError(_0x314398,null));};exports['create']=function(_0x5a5bcd,_0x165b13){return db[_0xb155('0x28')]['create'](_0x5a5bcd['body'],{})[_0xb155('0x21')](respondWithResult(_0x165b13,0xc9))[_0xb155('0x44')](handleError(_0x165b13,null));};exports['update']=function(_0x1436b7,_0x303c9e){if(_0x1436b7[_0xb155('0x45')]['id']){delete _0x1436b7[_0xb155('0x45')]['id'];}return db['ZendeskField'][_0xb155('0x43')]({'where':{'id':_0x1436b7[_0xb155('0x41')]['id']}})[_0xb155('0x21')](handleEntityNotFound(_0x303c9e,null))['then'](saveUpdates(_0x1436b7[_0xb155('0x45')],null))[_0xb155('0x21')](respondWithResult(_0x303c9e,null))[_0xb155('0x44')](handleError(_0x303c9e,null));};exports['destroy']=function(_0x2f8c92,_0x35dbb1){return db[_0xb155('0x28')][_0xb155('0x43')]({'where':{'id':_0x2f8c92[_0xb155('0x41')]['id']}})[_0xb155('0x21')](handleEntityNotFound(_0x35dbb1,null))[_0xb155('0x21')](removeEntity(_0x35dbb1,null))[_0xb155('0x44')](handleError(_0x35dbb1,null));}; \ No newline at end of file +var _0xe66a=['findAll','catch','params','length','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','ZendeskField','rawAttributes','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','sort','where','pick','filter','map','key','merge','count','includeAll','include'];(function(_0x51c726,_0x332b95){var _0x23fe86=function(_0x3145c8){while(--_0x3145c8){_0x51c726['push'](_0x51c726['shift']());}};_0x23fe86(++_0x332b95);}(_0xe66a,0x14b));var _0xae66=function(_0x51b7df,_0x43aa0c){_0x51b7df=_0x51b7df-0x0;var _0x16d827=_0xe66a[_0x51b7df];return _0x16d827;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xae66('0x0'));var rimraf=require(_0xae66('0x1'));var zipdir=require(_0xae66('0x2'));var jsonpatch=require(_0xae66('0x3'));var rp=require(_0xae66('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xae66('0x5'));var util=require('util');var path=require(_0xae66('0x6'));var sox=require(_0xae66('0x7'));var csv=require(_0xae66('0x8'));var ejs=require(_0xae66('0x9'));var fs=require('fs');var _=require(_0xae66('0xa'));var squel=require(_0xae66('0xb'));var crypto=require(_0xae66('0xc'));var jsforce=require(_0xae66('0xd'));var deskjs=require(_0xae66('0xe'));var toCsv=require(_0xae66('0x8'));var querystring=require(_0xae66('0xf'));var Papa=require(_0xae66('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xae66('0x11'));var qs=require(_0xae66('0x12'));var logger=require(_0xae66('0x13'))(_0xae66('0x14'));var utils=require(_0xae66('0x15'));var config=require(_0xae66('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b6759,_0x471ad1){_0x471ad1=_0x471ad1||0xcc;return function(_0x3d51cc){if(_0x3d51cc){return _0x2b6759['sendStatus'](_0x471ad1);}return _0x2b6759[_0xae66('0x17')](_0x471ad1)[_0xae66('0x18')]();};}function respondWithResult(_0x12a639,_0x2cf272){_0x2cf272=_0x2cf272||0xc8;return function(_0x2bde33){if(_0x2bde33){return _0x12a639[_0xae66('0x17')](_0x2cf272)[_0xae66('0x19')](_0x2bde33);}};}function respondWithFilteredResult(_0x48f4bc,_0x5e9bcf){return function(_0x168eaa){if(_0x168eaa){var _0x5d3175=_0x168eaa['count'],_0xe399b5=_0x5e9bcf[_0xae66('0x1a')],_0x23938f=_0x5e9bcf[_0xae66('0x1a')]+_0x5e9bcf[_0xae66('0x1b')],_0x4205e3;if(_0x23938f>=_0x5d3175){_0x23938f=_0x5d3175;_0x4205e3=0xc8;}else{_0x4205e3=0xce;}_0x48f4bc[_0xae66('0x17')](_0x4205e3);return _0x48f4bc[_0xae66('0x1c')]('Content-Range',_0xe399b5+'-'+_0x23938f+'/'+_0x5d3175)[_0xae66('0x19')](_0x168eaa);}return null;};}function patchUpdates(_0x52423){return function(_0xe91fbb){try{jsonpatch[_0xae66('0x1d')](_0xe91fbb,_0x52423,!![]);}catch(_0x288680){return BPromise[_0xae66('0x1e')](_0x288680);}return _0xe91fbb[_0xae66('0x1f')]();};}function saveUpdates(_0x2de586,_0xc02c93){return function(_0x5ed3df){if(_0x5ed3df){return _0x5ed3df[_0xae66('0x20')](_0x2de586)[_0xae66('0x21')](function(_0x24a374){return _0x24a374;});}return null;};}function removeEntity(_0x3db457,_0x3cb400){return function(_0x313a9d){if(_0x313a9d){return _0x313a9d[_0xae66('0x22')]()[_0xae66('0x21')](function(){_0x3db457[_0xae66('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x424e5e,_0x43898c){return function(_0xb7855f){if(!_0xb7855f){_0x424e5e['sendStatus'](0x194);}return _0xb7855f;};}function handleError(_0x1a8df6,_0x4034b7){_0x4034b7=_0x4034b7||0x1f4;return function(_0x228e2d){logger['error'](_0x228e2d[_0xae66('0x23')]);if(_0x228e2d[_0xae66('0x24')]){delete _0x228e2d[_0xae66('0x24')];}_0x1a8df6[_0xae66('0x17')](_0x4034b7)[_0xae66('0x25')](_0x228e2d);};}exports[_0xae66('0x26')]=function(_0x993b2e,_0x282c00){var _0x2ed1bd={},_0x53838c={},_0x10fb9a={'count':0x0,'rows':[]};var _0x5abaa1=db[_0xae66('0x27')][_0xae66('0x28')];_0x53838c['model']=_[_0xae66('0x29')](_0x5abaa1);_0x53838c['query']=_[_0xae66('0x29')](_0x993b2e['query']);_0x53838c[_0xae66('0x2a')]=_[_0xae66('0x2b')](_0x53838c[_0xae66('0x2c')],_0x53838c[_0xae66('0x2d')]);_0x2ed1bd[_0xae66('0x2e')]=_[_0xae66('0x2b')](_0x53838c['model'],qs[_0xae66('0x2f')](_0x993b2e[_0xae66('0x2d')][_0xae66('0x2f')]));_0x2ed1bd[_0xae66('0x2e')]=_0x2ed1bd[_0xae66('0x2e')]['length']?_0x2ed1bd[_0xae66('0x2e')]:_0x53838c[_0xae66('0x2c')];if(!_0x993b2e[_0xae66('0x2d')][_0xae66('0x30')]('nolimit')){_0x2ed1bd[_0xae66('0x1b')]=qs[_0xae66('0x1b')](_0x993b2e[_0xae66('0x2d')][_0xae66('0x1b')]);_0x2ed1bd[_0xae66('0x1a')]=qs[_0xae66('0x1a')](_0x993b2e[_0xae66('0x2d')][_0xae66('0x1a')]);}_0x2ed1bd['order']=qs['sort'](_0x993b2e[_0xae66('0x2d')][_0xae66('0x31')]);_0x2ed1bd[_0xae66('0x32')]=qs['filters'](_[_0xae66('0x33')](_0x993b2e['query'],_0x53838c[_0xae66('0x2a')]));if(_0x993b2e['query'][_0xae66('0x34')]){_0x2ed1bd[_0xae66('0x32')]=_['merge'](_0x2ed1bd[_0xae66('0x32')],{'$or':_[_0xae66('0x35')](_0x5abaa1,function(_0x489432){if(_0x489432['type'][_0xae66('0x36')]!=='VIRTUAL'){var _0x15773a={};_0x15773a[_0x489432['field']]={'$like':'%'+_0x993b2e[_0xae66('0x2d')][_0xae66('0x34')]+'%'};return _0x15773a;}})});}_0x2ed1bd=_[_0xae66('0x37')]({},_0x2ed1bd,_0x993b2e['options']);var _0x91b4de={'where':_0x2ed1bd[_0xae66('0x32')]};return db[_0xae66('0x27')]['count'](_0x91b4de)['then'](function(_0x51648e){_0x10fb9a[_0xae66('0x38')]=_0x51648e;if(_0x993b2e[_0xae66('0x2d')][_0xae66('0x39')]){_0x2ed1bd[_0xae66('0x3a')]=[{'all':!![]}];}return db[_0xae66('0x27')][_0xae66('0x3b')](_0x2ed1bd);})['then'](function(_0x2b0795){_0x10fb9a['rows']=_0x2b0795;return _0x10fb9a;})[_0xae66('0x21')](respondWithFilteredResult(_0x282c00,_0x2ed1bd))[_0xae66('0x3c')](handleError(_0x282c00,null));};exports['show']=function(_0xe2fd53,_0xda373c){var _0x48bea7={'raw':!![],'where':{'id':_0xe2fd53[_0xae66('0x3d')]['id']}},_0x25244a={};_0x25244a[_0xae66('0x2c')]=_[_0xae66('0x29')](db['ZendeskField'][_0xae66('0x28')]);_0x25244a[_0xae66('0x2d')]=_[_0xae66('0x29')](_0xe2fd53[_0xae66('0x2d')]);_0x25244a[_0xae66('0x2a')]=_[_0xae66('0x2b')](_0x25244a[_0xae66('0x2c')],_0x25244a[_0xae66('0x2d')]);_0x48bea7[_0xae66('0x2e')]=_[_0xae66('0x2b')](_0x25244a[_0xae66('0x2c')],qs[_0xae66('0x2f')](_0xe2fd53[_0xae66('0x2d')][_0xae66('0x2f')]));_0x48bea7[_0xae66('0x2e')]=_0x48bea7[_0xae66('0x2e')][_0xae66('0x3e')]?_0x48bea7[_0xae66('0x2e')]:_0x25244a[_0xae66('0x2c')];if(_0xe2fd53[_0xae66('0x2d')][_0xae66('0x39')]){_0x48bea7[_0xae66('0x3a')]=[{'all':!![]}];}_0x48bea7=_[_0xae66('0x37')]({},_0x48bea7,_0xe2fd53['options']);return db['ZendeskField']['find'](_0x48bea7)[_0xae66('0x21')](handleEntityNotFound(_0xda373c,null))[_0xae66('0x21')](respondWithResult(_0xda373c,null))[_0xae66('0x3c')](handleError(_0xda373c,null));};exports[_0xae66('0x3f')]=function(_0x4af4b9,_0x571f23){return db[_0xae66('0x27')][_0xae66('0x3f')](_0x4af4b9[_0xae66('0x40')],{})[_0xae66('0x21')](respondWithResult(_0x571f23,0xc9))[_0xae66('0x3c')](handleError(_0x571f23,null));};exports[_0xae66('0x20')]=function(_0x3d5cff,_0x2054ce){if(_0x3d5cff[_0xae66('0x40')]['id']){delete _0x3d5cff[_0xae66('0x40')]['id'];}return db[_0xae66('0x27')]['find']({'where':{'id':_0x3d5cff[_0xae66('0x3d')]['id']}})[_0xae66('0x21')](handleEntityNotFound(_0x2054ce,null))[_0xae66('0x21')](saveUpdates(_0x3d5cff[_0xae66('0x40')],null))[_0xae66('0x21')](respondWithResult(_0x2054ce,null))[_0xae66('0x3c')](handleError(_0x2054ce,null));};exports[_0xae66('0x22')]=function(_0x5c5394,_0x550c18){return db[_0xae66('0x27')]['find']({'where':{'id':_0x5c5394[_0xae66('0x3d')]['id']}})['then'](handleEntityNotFound(_0x550c18,null))[_0xae66('0x21')](removeEntity(_0x550c18,null))[_0xae66('0x3c')](handleError(_0x550c18,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 1962a46..33b470a 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 _0x0b0e=['./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x119c21,_0xa9d031){var _0x133dd1=function(_0x2508bf){while(--_0x2508bf){_0x119c21['push'](_0x119c21['shift']());}};_0x133dd1(++_0xa9d031);}(_0x0b0e,0x187));var _0xe0b0=function(_0xfad1a7,_0x2e3b8d){_0xfad1a7=_0xfad1a7-0x0;var _0x571012=_0x0b0e[_0xfad1a7];return _0x571012;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var attributes=require(_0xe0b0('0x5'));module[_0xe0b0('0x6')]=function(_0x38a058,_0x399e67){return _0x38a058[_0xe0b0('0x7')](_0xe0b0('0x8'),attributes,{'tableName':_0xe0b0('0x9'),'paranoid':![],'indexes':[{'name':_0xe0b0('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb62e=['../../config/logger','api','bluebird','request-promise','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb62e,0x1de));var _0xeb62=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xb62e[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var attributes=require(_0xeb62('0x6'));module[_0xeb62('0x7')]=function(_0x3c7ad5,_0x1ebdbb){return _0x3c7ad5['define'](_0xeb62('0x8'),attributes,{'tableName':_0xeb62('0x9'),'paranoid':![],'indexes':[{'name':_0xeb62('0xa'),'fields':['idField',_0xeb62('0xb')],'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 2112ba4..a5469e8 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 _0x0833=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xb96ef3,_0x59a2fc){var _0x56676b=function(_0x37193b){while(--_0x37193b){_0xb96ef3['push'](_0xb96ef3['shift']());}};_0x56676b(++_0x59a2fc);}(_0x0833,0x1bd));var _0x3083=function(_0x432640,_0x29b4c1){_0x432640=_0x432640-0x0;var _0x261e0f=_0x0833[_0x432640];return _0x261e0f;};'use strict';var _=require(_0x3083('0x0'));var util=require(_0x3083('0x1'));var moment=require(_0x3083('0x2'));var BPromise=require(_0x3083('0x3'));var rs=require(_0x3083('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3083('0x5'))('rpc');var config=require(_0x3083('0x6'));var jayson=require(_0x3083('0x7'));var client=jayson[_0x3083('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f9c3a,_0x1378a5,_0x529df1){return new BPromise(function(_0x5591b0,_0x4f51da){return client[_0x3083('0x9')](_0x2f9c3a,_0x529df1)['then'](function(_0x5cce3c){logger[_0x3083('0xa')](_0x3083('0xb'),_0x1378a5,_0x3083('0xc'));logger[_0x3083('0xd')](_0x3083('0xe'),_0x1378a5,_0x3083('0xc'),JSON[_0x3083('0xf')](_0x5cce3c));if(_0x5cce3c[_0x3083('0x10')]){if(_0x5cce3c[_0x3083('0x10')][_0x3083('0x11')]===0x1f4){logger[_0x3083('0x10')](_0x3083('0xb'),_0x1378a5,_0x5cce3c[_0x3083('0x10')][_0x3083('0x12')]);return _0x4f51da(_0x5cce3c[_0x3083('0x10')]['message']);}logger[_0x3083('0x10')](_0x3083('0xb'),_0x1378a5,_0x5cce3c['error'][_0x3083('0x12')]);return _0x5591b0(_0x5cce3c[_0x3083('0x10')]['message']);}else{logger[_0x3083('0xa')](_0x3083('0xb'),_0x1378a5,_0x3083('0xc'));_0x5591b0(_0x5cce3c[_0x3083('0x13')][_0x3083('0x12')]);}})[_0x3083('0x14')](function(_0xecb368){logger['error']('ZendeskField,\x20%s,\x20%s',_0x1378a5,_0xecb368);_0x4f51da(_0xecb368);});});} \ No newline at end of file +var _0x7d25=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0xdb2727,_0xce46aa){var _0x36d766=function(_0x62a5a7){while(--_0x62a5a7){_0xdb2727['push'](_0xdb2727['shift']());}};_0x36d766(++_0xce46aa);}(_0x7d25,0x8a));var _0x57d2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x7d25[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f43b2,_0x263d35,_0x147194){return new BPromise(function(_0x59ae87,_0x49e3e5){return client[_0x57d2('0x8')](_0x1f43b2,_0x147194)['then'](function(_0x3a1ec5){logger[_0x57d2('0x9')](_0x57d2('0xa'),_0x263d35,'request\x20sent');logger[_0x57d2('0xb')](_0x57d2('0xc'),_0x263d35,_0x57d2('0xd'),JSON[_0x57d2('0xe')](_0x3a1ec5));if(_0x3a1ec5[_0x57d2('0xf')]){if(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x10')]===0x1f4){logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);return _0x49e3e5(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);}logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')]['message']);return _0x59ae87(_0x3a1ec5['error'][_0x57d2('0x11')]);}else{logger[_0x57d2('0x9')]('ZendeskField,\x20%s,\x20%s',_0x263d35,_0x57d2('0xd'));_0x59ae87(_0x3a1ec5[_0x57d2('0x12')]['message']);}})[_0x57d2('0x13')](function(_0x4986ad){logger[_0x57d2('0xf')]('ZendeskField,\x20%s,\x20%s',_0x263d35,_0x4986ad);_0x49e3e5(_0x4986ad);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 537e952..38d8f9d 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 _0xb03e=['/:id/fields','post','create','addConfiguration','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x58ad63,_0x493f93){var _0x40ff45=function(_0x538409){while(--_0x538409){_0x58ad63['push'](_0x58ad63['shift']());}};_0x40ff45(++_0x493f93);}(_0xb03e,0x1eb));var _0xeb03=function(_0x9608a2,_0x146a37){_0x9608a2=_0x9608a2-0x0;var _0x441788=_0xb03e[_0x9608a2];return _0x441788;};'use strict';var multer=require('multer');var util=require(_0xeb03('0x0'));var path=require(_0xeb03('0x1'));var timeout=require(_0xeb03('0x2'));var express=require(_0xeb03('0x3'));var router=express[_0xeb03('0x4')]();var auth=require(_0xeb03('0x5'));var interaction=require(_0xeb03('0x6'));var config=require(_0xeb03('0x7'));var controller=require(_0xeb03('0x8'));router[_0xeb03('0x9')]('/',auth[_0xeb03('0xa')](),controller[_0xeb03('0xb')]);router['get'](_0xeb03('0xc'),auth[_0xeb03('0xa')](),controller[_0xeb03('0xd')]);router[_0xeb03('0x9')](_0xeb03('0xe'),auth[_0xeb03('0xa')](),controller['getConfigurations']);router[_0xeb03('0x9')](_0xeb03('0xf'),auth[_0xeb03('0xa')](),controller['getFields']);router[_0xeb03('0x10')]('/',auth['isAuthenticated'](),controller[_0xeb03('0x11')]);router[_0xeb03('0x10')](_0xeb03('0xe'),auth[_0xeb03('0xa')](),controller[_0xeb03('0x12')]);router[_0xeb03('0x13')](_0xeb03('0xc'),auth[_0xeb03('0xa')](),controller[_0xeb03('0x14')]);router[_0xeb03('0x15')](_0xeb03('0xc'),auth[_0xeb03('0xa')](),controller['destroy']);module[_0xeb03('0x16')]=router; \ No newline at end of file +var _0x3423=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','post','addConfiguration','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller'];(function(_0x4d5ff1,_0x4c00c9){var _0x1a0cca=function(_0x505d9f){while(--_0x505d9f){_0x4d5ff1['push'](_0x4d5ff1['shift']());}};_0x1a0cca(++_0x4c00c9);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var auth=require(_0x3342('0x4'));var interaction=require(_0x3342('0x5'));var config=require(_0x3342('0x6'));var controller=require(_0x3342('0x7'));router[_0x3342('0x8')]('/',auth[_0x3342('0x9')](),controller[_0x3342('0xa')]);router[_0x3342('0x8')](_0x3342('0xb'),auth[_0x3342('0x9')](),controller[_0x3342('0xc')]);router[_0x3342('0x8')](_0x3342('0xd'),auth[_0x3342('0x9')](),controller[_0x3342('0xe')]);router['get']('/:id/fields',auth[_0x3342('0x9')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3342('0xf')](_0x3342('0xd'),auth['isAuthenticated'](),controller[_0x3342('0x10')]);router['put'](_0x3342('0xb'),auth[_0x3342('0x9')](),controller['update']);router[_0x3342('0x11')](_0x3342('0xb'),auth[_0x3342('0x9')](),controller[_0x3342('0x12')]);module[_0x3342('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index bf91023..f589de1 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 _0x0f64=['STRING','sequelize','exports'];(function(_0xea6952,_0x4ffeb0){var _0x41b441=function(_0x1f4ca5){while(--_0x1f4ca5){_0xea6952['push'](_0xea6952['shift']());}};_0x41b441(++_0x4ffeb0);}(_0x0f64,0xa0));var _0x40f6=function(_0x56f2f3,_0xb4c4ad){_0x56f2f3=_0x56f2f3-0x0;var _0x16668b=_0x0f64[_0x56f2f3];return _0x16668b;};'use strict';var Sequelize=require(_0x40f6('0x0'));module[_0x40f6('0x1')]={'name':{'type':Sequelize[_0x40f6('0x2')]},'description':{'type':Sequelize[_0x40f6('0x2')]},'authToken':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x40f6('0x2')]},'serverUrl':{'type':Sequelize[_0x40f6('0x2')]}}; \ No newline at end of file +var _0xb87c=['exports','STRING'];(function(_0x5462f0,_0x3c0f55){var _0x41c56c=function(_0x921fd){while(--_0x921fd){_0x5462f0['push'](_0x5462f0['shift']());}};_0x41c56c(++_0x3c0f55);}(_0xb87c,0x17c));var _0xcb87=function(_0x1c756c,_0x3c52e6){_0x1c756c=_0x1c756c-0x0;var _0x42f795=_0xb87c[_0x1c756c];return _0x42f795;};'use strict';var Sequelize=require('sequelize');module[_0xcb87('0x0')]={'name':{'type':Sequelize[_0xcb87('0x1')]},'description':{'type':Sequelize[_0xcb87('0x1')]},'authToken':{'type':Sequelize[_0xcb87('0x1')]},'host':{'type':Sequelize[_0xcb87('0x1')]},'serverUrl':{'type':Sequelize[_0xcb87('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 16b7d08..b8ca240 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 _0x6cca=['type','VIRTUAL','field','count','include','findAll','rows','catch','show','length','includeAll','options','find','create','body','params','destroy','findOne','ZohoConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','channel','Descriptions','getDescriptions','ZohoField','Subjects','authToken','host','lastIndexOf','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','Call\x20Purpose','section','push','customfield','true','Pick\x20List','val','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','offset','limit','set','Content-Range','json','reject','update','name','send','ZohoAccount','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','map'];(function(_0x78d9a9,_0x179ec9){var _0x4a0e02=function(_0x1af26c){while(--_0x1af26c){_0x78d9a9['push'](_0x78d9a9['shift']());}};_0x4a0e02(++_0x179ec9);}(_0x6cca,0x10e));var _0xa6cc=function(_0x1ddbe0,_0x705eb4){_0x1ddbe0=_0x1ddbe0-0x0;var _0x10c329=_0x6cca[_0x1ddbe0];return _0x10c329;};'use strict';var pdf=require(_0xa6cc('0x0'));var emlformat=require(_0xa6cc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa6cc('0x2'));var jsonpatch=require(_0xa6cc('0x3'));var rp=require(_0xa6cc('0x4'));var moment=require(_0xa6cc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa6cc('0x6'));var util=require(_0xa6cc('0x7'));var path=require(_0xa6cc('0x8'));var sox=require(_0xa6cc('0x9'));var csv=require(_0xa6cc('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa6cc('0xb'));var squel=require(_0xa6cc('0xc'));var crypto=require(_0xa6cc('0xd'));var jsforce=require(_0xa6cc('0xe'));var deskjs=require(_0xa6cc('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa6cc('0x10'));var Papa=require('papaparse');var authService=require(_0xa6cc('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xa6cc('0x12'));var logger=require(_0xa6cc('0x13'))(_0xa6cc('0x14'));var utils=require(_0xa6cc('0x15'));var config=require('../../config/environment');var db=require(_0xa6cc('0x16'))['db'];var integrations=require(_0xa6cc('0x17'));var jayson=require(_0xa6cc('0x18'));var client=jayson[_0xa6cc('0x19')][_0xa6cc('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3d854f,_0x4e1553,_0x4ca2aa,_0x2c783e){return new BPromise(function(_0x17c995,_0x4f7819){var _0x2d50ff=_0x2c783e||client;return _0x2d50ff['request'](_0x3d854f,_0x4ca2aa)[_0xa6cc('0x1b')](function(_0x3b797e){logger[_0xa6cc('0x1c')](_0xa6cc('0x1d'),_0x4e1553,_0xa6cc('0x1e'));logger[_0xa6cc('0x1f')](_0xa6cc('0x20'),_0x4e1553,_0xa6cc('0x1e'),JSON[_0xa6cc('0x21')](_0x3b797e));if(_0x3b797e[_0xa6cc('0x22')]){if(_0x3b797e['error'][_0xa6cc('0x23')]===0x1f4){logger[_0xa6cc('0x22')](_0xa6cc('0x1d'),_0x4e1553,_0x3b797e['error'][_0xa6cc('0x24')]);return _0x4f7819(_0x3b797e[_0xa6cc('0x22')][_0xa6cc('0x24')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4e1553,_0x3b797e[_0xa6cc('0x22')][_0xa6cc('0x24')]);return _0x17c995(_0x3b797e[_0xa6cc('0x22')][_0xa6cc('0x24')]);}else{logger[_0xa6cc('0x1c')]('ZohoAccount,\x20%s,\x20%s',_0x4e1553,_0xa6cc('0x1e'));_0x17c995(_0x3b797e[_0xa6cc('0x25')][_0xa6cc('0x24')]);}})['catch'](function(_0x21b05c){logger[_0xa6cc('0x22')](_0xa6cc('0x1d'),_0x4e1553,_0x21b05c);_0x4f7819(_0x21b05c);});});}function respondWithStatusCode(_0x3e13c3,_0xddaddc){_0xddaddc=_0xddaddc||0xcc;return function(_0x3ca6e3){if(_0x3ca6e3){return _0x3e13c3[_0xa6cc('0x26')](_0xddaddc);}return _0x3e13c3[_0xa6cc('0x27')](_0xddaddc)['end']();};}function respondWithResult(_0x1dd7da,_0xf6f086){_0xf6f086=_0xf6f086||0xc8;return function(_0x1aa1ba){if(_0x1aa1ba){return _0x1dd7da[_0xa6cc('0x27')](_0xf6f086)['json'](_0x1aa1ba);}};}function respondWithFilteredResult(_0x35da28,_0x1b33b1){return function(_0x5bf90e){if(_0x5bf90e){var _0x68cf25=_0x5bf90e['count'],_0x43955c=_0x1b33b1['offset'],_0x45252b=_0x1b33b1[_0xa6cc('0x28')]+_0x1b33b1[_0xa6cc('0x29')],_0x239c54;if(_0x45252b>=_0x68cf25){_0x45252b=_0x68cf25;_0x239c54=0xc8;}else{_0x239c54=0xce;}_0x35da28[_0xa6cc('0x27')](_0x239c54);return _0x35da28[_0xa6cc('0x2a')](_0xa6cc('0x2b'),_0x43955c+'-'+_0x45252b+'/'+_0x68cf25)[_0xa6cc('0x2c')](_0x5bf90e);}return null;};}function patchUpdates(_0x2340de){return function(_0x55eb9b){try{jsonpatch['apply'](_0x55eb9b,_0x2340de,!![]);}catch(_0x261fb7){return BPromise[_0xa6cc('0x2d')](_0x261fb7);}return _0x55eb9b['save']();};}function saveUpdates(_0x2e9a2f,_0x2491d6){return function(_0x1bf811){if(_0x1bf811){return _0x1bf811[_0xa6cc('0x2e')](_0x2e9a2f)['then'](function(_0x55ef9c){return _0x55ef9c;});}return null;};}function removeEntity(_0x2e41d9,_0x473bd2){return function(_0x4ca4a1){if(_0x4ca4a1){return _0x4ca4a1['destroy']()[_0xa6cc('0x1b')](function(){_0x2e41d9[_0xa6cc('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b5714,_0x2f4d60){return function(_0xdd4ed1){if(!_0xdd4ed1){_0x2b5714[_0xa6cc('0x26')](0x194);}return _0xdd4ed1;};}function handleError(_0x2ced02,_0x210082){_0x210082=_0x210082||0x1f4;return function(_0x26cfeb){logger[_0xa6cc('0x22')](_0x26cfeb['stack']);if(_0x26cfeb[_0xa6cc('0x2f')]){delete _0x26cfeb['name'];}_0x2ced02[_0xa6cc('0x27')](_0x210082)[_0xa6cc('0x30')](_0x26cfeb);};}exports['index']=function(_0x6d79df,_0x15a5f6){var _0x33a151={},_0x6e937a={},_0x370b04={'count':0x0,'rows':[]};var _0x10d15f=db[_0xa6cc('0x31')][_0xa6cc('0x32')];_0x6e937a[_0xa6cc('0x33')]=_[_0xa6cc('0x34')](_0x10d15f);_0x6e937a[_0xa6cc('0x35')]=_['keys'](_0x6d79df['query']);_0x6e937a['filters']=_[_0xa6cc('0x36')](_0x6e937a[_0xa6cc('0x33')],_0x6e937a['query']);_0x33a151[_0xa6cc('0x37')]=_[_0xa6cc('0x36')](_0x6e937a[_0xa6cc('0x33')],qs[_0xa6cc('0x38')](_0x6d79df['query']['fields']));_0x33a151[_0xa6cc('0x37')]=_0x33a151[_0xa6cc('0x37')]['length']?_0x33a151[_0xa6cc('0x37')]:_0x6e937a[_0xa6cc('0x33')];if(!_0x6d79df['query']['hasOwnProperty'](_0xa6cc('0x39'))){_0x33a151[_0xa6cc('0x29')]=qs[_0xa6cc('0x29')](_0x6d79df[_0xa6cc('0x35')][_0xa6cc('0x29')]);_0x33a151[_0xa6cc('0x28')]=qs[_0xa6cc('0x28')](_0x6d79df['query'][_0xa6cc('0x28')]);}_0x33a151[_0xa6cc('0x3a')]=qs[_0xa6cc('0x3b')](_0x6d79df['query']['sort']);_0x33a151[_0xa6cc('0x3c')]=qs[_0xa6cc('0x3d')](_[_0xa6cc('0x3e')](_0x6d79df[_0xa6cc('0x35')],_0x6e937a['filters']));if(_0x6d79df[_0xa6cc('0x35')][_0xa6cc('0x3f')]){_0x33a151[_0xa6cc('0x3c')]=_[_0xa6cc('0x40')](_0x33a151[_0xa6cc('0x3c')],{'$or':_[_0xa6cc('0x41')](_0x10d15f,function(_0x58a0e5){if(_0x58a0e5[_0xa6cc('0x42')]['key']!==_0xa6cc('0x43')){var _0x301170={};_0x301170[_0x58a0e5[_0xa6cc('0x44')]]={'$like':'%'+_0x6d79df[_0xa6cc('0x35')][_0xa6cc('0x3f')]+'%'};return _0x301170;}})});}_0x33a151=_[_0xa6cc('0x40')]({},_0x33a151,_0x6d79df['options']);var _0x24ccad={'where':_0x33a151[_0xa6cc('0x3c')]};return db['ZohoAccount'][_0xa6cc('0x45')](_0x24ccad)[_0xa6cc('0x1b')](function(_0x84c00d){_0x370b04[_0xa6cc('0x45')]=_0x84c00d;if(_0x6d79df['query']['includeAll']){_0x33a151[_0xa6cc('0x46')]=[{'all':!![]}];}return db[_0xa6cc('0x31')][_0xa6cc('0x47')](_0x33a151);})[_0xa6cc('0x1b')](function(_0x5c18ad){_0x370b04[_0xa6cc('0x48')]=_0x5c18ad;return _0x370b04;})[_0xa6cc('0x1b')](respondWithFilteredResult(_0x15a5f6,_0x33a151))[_0xa6cc('0x49')](handleError(_0x15a5f6,null));};exports[_0xa6cc('0x4a')]=function(_0x3d4652,_0x56952b){var _0x3a7355={'raw':![],'where':{'id':_0x3d4652['params']['id']}},_0x16c219={};_0x16c219[_0xa6cc('0x33')]=_['keys'](db[_0xa6cc('0x31')][_0xa6cc('0x32')]);_0x16c219[_0xa6cc('0x35')]=_[_0xa6cc('0x34')](_0x3d4652[_0xa6cc('0x35')]);_0x16c219[_0xa6cc('0x3d')]=_[_0xa6cc('0x36')](_0x16c219[_0xa6cc('0x33')],_0x16c219[_0xa6cc('0x35')]);_0x3a7355[_0xa6cc('0x37')]=_[_0xa6cc('0x36')](_0x16c219[_0xa6cc('0x33')],qs[_0xa6cc('0x38')](_0x3d4652[_0xa6cc('0x35')][_0xa6cc('0x38')]));_0x3a7355[_0xa6cc('0x37')]=_0x3a7355[_0xa6cc('0x37')][_0xa6cc('0x4b')]?_0x3a7355[_0xa6cc('0x37')]:_0x16c219[_0xa6cc('0x33')];if(_0x3d4652[_0xa6cc('0x35')][_0xa6cc('0x4c')]){_0x3a7355[_0xa6cc('0x46')]=[{'all':!![]}];}_0x3a7355=_['merge']({},_0x3a7355,_0x3d4652[_0xa6cc('0x4d')]);return db[_0xa6cc('0x31')][_0xa6cc('0x4e')](_0x3a7355)[_0xa6cc('0x1b')](handleEntityNotFound(_0x56952b,null))['then'](respondWithResult(_0x56952b,null))[_0xa6cc('0x49')](handleError(_0x56952b,null));};exports[_0xa6cc('0x4f')]=function(_0x4380cb,_0x433a8f){return db[_0xa6cc('0x31')][_0xa6cc('0x4f')](_0x4380cb['body'],{})[_0xa6cc('0x1b')](respondWithResult(_0x433a8f,0xc9))[_0xa6cc('0x49')](handleError(_0x433a8f,null));};exports[_0xa6cc('0x2e')]=function(_0x353b3e,_0x5eec20){if(_0x353b3e[_0xa6cc('0x50')]['id']){delete _0x353b3e['body']['id'];}return db[_0xa6cc('0x31')][_0xa6cc('0x4e')]({'where':{'id':_0x353b3e[_0xa6cc('0x51')]['id']}})['then'](handleEntityNotFound(_0x5eec20,null))[_0xa6cc('0x1b')](saveUpdates(_0x353b3e['body'],null))[_0xa6cc('0x1b')](respondWithResult(_0x5eec20,null))[_0xa6cc('0x49')](handleError(_0x5eec20,null));};exports[_0xa6cc('0x52')]=function(_0x253187,_0x4484d4){return db[_0xa6cc('0x31')][_0xa6cc('0x4e')]({'where':{'id':_0x253187[_0xa6cc('0x51')]['id']}})[_0xa6cc('0x1b')](handleEntityNotFound(_0x4484d4,null))[_0xa6cc('0x1b')](removeEntity(_0x4484d4,null))[_0xa6cc('0x49')](handleError(_0x4484d4,null));};exports['getConfigurations']=function(_0x575721,_0x2bff68,_0x21b47b){var _0x6f2997={};var _0x4443b5={};var _0x59194b;var _0x565506;return db[_0xa6cc('0x31')][_0xa6cc('0x53')]({'where':{'id':_0x575721[_0xa6cc('0x51')]['id']}})[_0xa6cc('0x1b')](handleEntityNotFound(_0x2bff68,null))[_0xa6cc('0x1b')](function(_0x28e8e1){if(_0x28e8e1){_0x59194b=_0x28e8e1;_0x4443b5['model']=_[_0xa6cc('0x34')](db[_0xa6cc('0x54')]['rawAttributes']);_0x4443b5[_0xa6cc('0x35')]=_[_0xa6cc('0x34')](_0x575721[_0xa6cc('0x35')]);_0x4443b5[_0xa6cc('0x3d')]=_[_0xa6cc('0x36')](_0x4443b5[_0xa6cc('0x33')],_0x4443b5[_0xa6cc('0x35')]);_0x6f2997[_0xa6cc('0x37')]=_['intersection'](_0x4443b5[_0xa6cc('0x33')],qs[_0xa6cc('0x38')](_0x575721[_0xa6cc('0x35')][_0xa6cc('0x38')]));_0x6f2997[_0xa6cc('0x37')]=_0x6f2997['attributes'][_0xa6cc('0x4b')]?_0x6f2997['attributes']:_0x4443b5['model'];_0x6f2997[_0xa6cc('0x3a')]=qs[_0xa6cc('0x3b')](_0x575721[_0xa6cc('0x35')][_0xa6cc('0x3b')]);_0x6f2997[_0xa6cc('0x3c')]=qs['filters'](_[_0xa6cc('0x3e')](_0x575721[_0xa6cc('0x35')],_0x4443b5[_0xa6cc('0x3d')]));if(_0x575721[_0xa6cc('0x35')][_0xa6cc('0x3f')]){_0x6f2997[_0xa6cc('0x3c')]=_[_0xa6cc('0x40')](_0x6f2997[_0xa6cc('0x3c')],{'$or':_[_0xa6cc('0x41')](_0x6f2997['attributes'],function(_0x768325){var _0x15b0c6={};_0x15b0c6[_0x768325]={'$like':'%'+_0x575721[_0xa6cc('0x35')]['filter']+'%'};return _0x15b0c6;})});}_0x6f2997=_[_0xa6cc('0x40')]({},_0x6f2997,_0x575721[_0xa6cc('0x4d')]);return _0x59194b[_0xa6cc('0x55')](_0x6f2997);}})[_0xa6cc('0x1b')](function(_0x13f0c3){if(_0x13f0c3){_0x565506=_0x13f0c3[_0xa6cc('0x4b')];if(!_0x575721[_0xa6cc('0x35')][_0xa6cc('0x56')](_0xa6cc('0x39'))){_0x6f2997[_0xa6cc('0x29')]=qs['limit'](_0x575721[_0xa6cc('0x35')][_0xa6cc('0x29')]);_0x6f2997[_0xa6cc('0x28')]=qs[_0xa6cc('0x28')](_0x575721['query'][_0xa6cc('0x28')]);}return _0x59194b['getConfigurations'](_0x6f2997);}})[_0xa6cc('0x1b')](function(_0x1e89b1){if(_0x1e89b1){return _0x1e89b1?{'count':_0x565506,'rows':_0x1e89b1}:null;}})[_0xa6cc('0x1b')](respondWithResult(_0x2bff68,null))[_0xa6cc('0x49')](handleError(_0x2bff68,null));};exports[_0xa6cc('0x57')]=function(_0x4ebd43,_0x14330b,_0x36b050){if(_0x4ebd43[_0xa6cc('0x50')]['id']){delete _0x4ebd43[_0xa6cc('0x50')]['id'];}return db[_0xa6cc('0x31')][_0xa6cc('0x53')]({'where':{'id':_0x4ebd43[_0xa6cc('0x51')]['id']}})[_0xa6cc('0x1b')](handleEntityNotFound(_0x14330b,null))['then'](function(_0x44e9df){if(_0x44e9df){_0x4ebd43['body'][_0xa6cc('0x58')]=_0x44e9df['id'];_0x4ebd43[_0xa6cc('0x50')]['Subjects']=integrations['getSubjects'](_0x4ebd43[_0xa6cc('0x50')][_0xa6cc('0x59')],_0x4ebd43[_0xa6cc('0x50')]['type']);_0x4ebd43['body'][_0xa6cc('0x5a')]=integrations[_0xa6cc('0x5b')](_0x4ebd43[_0xa6cc('0x50')][_0xa6cc('0x59')],_0x4ebd43[_0xa6cc('0x50')][_0xa6cc('0x42')]);return db[_0xa6cc('0x54')][_0xa6cc('0x4f')](_0x4ebd43[_0xa6cc('0x50')],{'include':[{'model':db[_0xa6cc('0x5c')],'as':_0xa6cc('0x5d')},{'model':db[_0xa6cc('0x5c')],'as':_0xa6cc('0x5a')}]});}return null;})[_0xa6cc('0x1b')](respondWithResult(_0x14330b,null))['catch'](handleError(_0x14330b,null));};exports['getFields']=function(_0x160706,_0xe013ab,_0x57588f){var _0x268931='';return db['ZohoAccount'][_0xa6cc('0x53')]({'where':{'id':_0x160706[_0xa6cc('0x51')]['id']},'attributes':['id','host',_0xa6cc('0x5e')]})[_0xa6cc('0x1b')](handleEntityNotFound(_0xe013ab,null))[_0xa6cc('0x1b')](function(_0x1ba21c){if(_0x1ba21c){_0x268931=_0x1ba21c[_0xa6cc('0x5f')];var _0x3030ac=_0x268931['slice'](-0x1);if(_0x3030ac==='/'){_0x268931=_0x268931['substring'](0x0,_0x268931[_0xa6cc('0x60')](_0x3030ac));}return rp({'method':'GET','uri':util['format'](_0xa6cc('0x61'),_0x268931),'qs':{'authtoken':_0x1ba21c[_0xa6cc('0x5e')],'scope':_0xa6cc('0x62')},'json':!![]});}})[_0xa6cc('0x1b')](function(_0x5869d4){if(_0x5869d4){if(_0x5869d4[_0xa6cc('0x63')]&&_0x5869d4[_0xa6cc('0x63')][_0xa6cc('0x22')]){throw new Error(_0x5869d4['response'][_0xa6cc('0x22')][_0xa6cc('0x24')]);}var _0x4f0d10=[];if(_0x5869d4[_0xa6cc('0x64')]&&_0x5869d4['Calls']['section']){if(_0x5869d4[_0xa6cc('0x64')]['section']['FL']){var _0x52dd94=[_0xa6cc('0x65')];for(var _0x52cd60=0x0,_0x1bec32=_0x5869d4[_0xa6cc('0x64')][_0xa6cc('0x66')]['FL'][_0xa6cc('0x4b')];_0x52cd60<_0x1bec32;_0x52cd60++){if(_['includes'](_0x52dd94,_0x5869d4[_0xa6cc('0x64')][_0xa6cc('0x66')]['FL'][_0x52cd60]['dv'])){_0x4f0d10[_0xa6cc('0x67')]({'id':_0x5869d4[_0xa6cc('0x64')][_0xa6cc('0x66')]['FL'][_0x52cd60]['dv'],'name':_0x5869d4[_0xa6cc('0x64')]['section']['FL'][_0x52cd60]['label'],'custom':_0x5869d4['Calls'][_0xa6cc('0x66')]['FL'][_0x52cd60][_0xa6cc('0x68')]===_0xa6cc('0x69')?!![]:![],'options':_0x5869d4[_0xa6cc('0x64')][_0xa6cc('0x66')]['FL'][_0x52cd60]['type']===_0xa6cc('0x6a')&&_0x5869d4[_0xa6cc('0x64')][_0xa6cc('0x66')]['FL'][_0x52cd60]['val']?_[_0xa6cc('0x41')](_0x5869d4[_0xa6cc('0x64')][_0xa6cc('0x66')]['FL'][_0x52cd60][_0xa6cc('0x6b')],function(_0x5685fc){return{'name':_0x5685fc,'value':_0x5685fc};}):[]});}}}}return{'count':_0x4f0d10[_0xa6cc('0x4b')],'rows':_0x4f0d10};}})[_0xa6cc('0x1b')](respondWithResult(_0xe013ab,null))['catch'](function(_0x43e90c){var _0x101315=_0x160706[_0xa6cc('0x35')][_0xa6cc('0x6c')]?0x1f4:_0x43e90c[_0xa6cc('0x6d')]||0x1f4;logger['error'](_0xa6cc('0x6e'),_0xa6cc('0x6f'),_0x101315,JSON[_0xa6cc('0x21')](_0x43e90c));delete _0x43e90c[_0xa6cc('0x2f')];if(_0x101315===0x191){_0x101315=0x190;}_0xe013ab[_0xa6cc('0x27')](_0x101315)[_0xa6cc('0x30')](_0x160706['query'][_0xa6cc('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x43e90c[_0xa6cc('0x6d')]}:_0x43e90c);});}; \ No newline at end of file +var _0x34e7=['addConfiguration','getSubjects','channel','Descriptions','ZohoField','Subjects','getFields','host','authToken','slice','substring','lastIndexOf','GET','format','https://crm.%s/crm/private/json/Calls/getFields','response','Calls','section','Call\x20Purpose','push','customfield','true','map','val','test','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','then','info','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','ZohoAccount,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','name','send','index','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','ZohoAccount','count','includeAll','rows','catch','rawAttributes','include','find','create','body','params','getConfigurations','findOne','ZohoConfiguration'];(function(_0x195cb1,_0x3b0228){var _0x3260ad=function(_0x354bb3){while(--_0x354bb3){_0x195cb1['push'](_0x195cb1['shift']());}};_0x3260ad(++_0x3b0228);}(_0x34e7,0x164));var _0x734e=function(_0x47500b,_0x302762){_0x47500b=_0x47500b-0x0;var _0x492943=_0x34e7[_0x47500b];return _0x492943;};'use strict';var pdf=require(_0x734e('0x0'));var emlformat=require(_0x734e('0x1'));var rimraf=require(_0x734e('0x2'));var zipdir=require(_0x734e('0x3'));var jsonpatch=require(_0x734e('0x4'));var rp=require(_0x734e('0x5'));var moment=require(_0x734e('0x6'));var BPromise=require(_0x734e('0x7'));var Mustache=require(_0x734e('0x8'));var util=require(_0x734e('0x9'));var path=require(_0x734e('0xa'));var sox=require(_0x734e('0xb'));var csv=require(_0x734e('0xc'));var ejs=require(_0x734e('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x734e('0xe'));var crypto=require(_0x734e('0xf'));var jsforce=require(_0x734e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x734e('0xc'));var querystring=require('querystring');var Papa=require(_0x734e('0x11'));var authService=require(_0x734e('0x12'));var hardwareService=require(_0x734e('0x13'));var Redis=require(_0x734e('0x14'));var qs=require(_0x734e('0x15'));var logger=require(_0x734e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x734e('0x17'));var db=require(_0x734e('0x18'))['db'];var integrations=require(_0x734e('0x19'));var jayson=require(_0x734e('0x1a'));var client=jayson['client'][_0x734e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2cfb3a,_0x507bca,_0x17f200,_0x58df71){return new BPromise(function(_0x1b7510,_0x44653e){var _0x4f16d8=_0x58df71||client;return _0x4f16d8['request'](_0x2cfb3a,_0x17f200)[_0x734e('0x1c')](function(_0x2e0d33){logger[_0x734e('0x1d')]('ZohoAccount,\x20%s,\x20%s',_0x507bca,_0x734e('0x1e'));logger['debug'](_0x734e('0x1f'),_0x507bca,_0x734e('0x1e'),JSON['stringify'](_0x2e0d33));if(_0x2e0d33[_0x734e('0x20')]){if(_0x2e0d33['error'][_0x734e('0x21')]===0x1f4){logger['error'](_0x734e('0x22'),_0x507bca,_0x2e0d33[_0x734e('0x20')][_0x734e('0x23')]);return _0x44653e(_0x2e0d33[_0x734e('0x20')][_0x734e('0x23')]);}logger[_0x734e('0x20')](_0x734e('0x22'),_0x507bca,_0x2e0d33[_0x734e('0x20')][_0x734e('0x23')]);return _0x1b7510(_0x2e0d33['error'][_0x734e('0x23')]);}else{logger['info'](_0x734e('0x22'),_0x507bca,'request\x20sent');_0x1b7510(_0x2e0d33['result'][_0x734e('0x23')]);}})['catch'](function(_0x21b1a0){logger['error'](_0x734e('0x22'),_0x507bca,_0x21b1a0);_0x44653e(_0x21b1a0);});});}function respondWithStatusCode(_0x3afcc3,_0xfe35c3){_0xfe35c3=_0xfe35c3||0xcc;return function(_0x25ae9d){if(_0x25ae9d){return _0x3afcc3[_0x734e('0x24')](_0xfe35c3);}return _0x3afcc3[_0x734e('0x25')](_0xfe35c3)[_0x734e('0x26')]();};}function respondWithResult(_0x3170c5,_0x30c384){_0x30c384=_0x30c384||0xc8;return function(_0x482e66){if(_0x482e66){return _0x3170c5['status'](_0x30c384)[_0x734e('0x27')](_0x482e66);}};}function respondWithFilteredResult(_0x417961,_0x2f1ce4){return function(_0xd97b18){if(_0xd97b18){var _0x130daf=_0xd97b18['count'],_0x2a3762=_0x2f1ce4[_0x734e('0x28')],_0xe7de3=_0x2f1ce4['offset']+_0x2f1ce4[_0x734e('0x29')],_0x30c742;if(_0xe7de3>=_0x130daf){_0xe7de3=_0x130daf;_0x30c742=0xc8;}else{_0x30c742=0xce;}_0x417961[_0x734e('0x25')](_0x30c742);return _0x417961[_0x734e('0x2a')](_0x734e('0x2b'),_0x2a3762+'-'+_0xe7de3+'/'+_0x130daf)['json'](_0xd97b18);}return null;};}function patchUpdates(_0x3c965c){return function(_0x273438){try{jsonpatch[_0x734e('0x2c')](_0x273438,_0x3c965c,!![]);}catch(_0xa9aaba){return BPromise[_0x734e('0x2d')](_0xa9aaba);}return _0x273438['save']();};}function saveUpdates(_0x27cc50,_0x24558b){return function(_0x33652f){if(_0x33652f){return _0x33652f[_0x734e('0x2e')](_0x27cc50)['then'](function(_0x520623){return _0x520623;});}return null;};}function removeEntity(_0x496aa3,_0x3765ba){return function(_0xbf389e){if(_0xbf389e){return _0xbf389e[_0x734e('0x2f')]()[_0x734e('0x1c')](function(){_0x496aa3[_0x734e('0x25')](0xcc)[_0x734e('0x26')]();});}};}function handleEntityNotFound(_0x1fc59a,_0x11574e){return function(_0x2a0409){if(!_0x2a0409){_0x1fc59a['sendStatus'](0x194);}return _0x2a0409;};}function handleError(_0x4d9687,_0x18a9a8){_0x18a9a8=_0x18a9a8||0x1f4;return function(_0x3c308f){logger[_0x734e('0x20')](_0x3c308f['stack']);if(_0x3c308f[_0x734e('0x30')]){delete _0x3c308f[_0x734e('0x30')];}_0x4d9687['status'](_0x18a9a8)[_0x734e('0x31')](_0x3c308f);};}exports[_0x734e('0x32')]=function(_0x28baa4,_0x3d1a41){var _0x5a55c5={},_0x29e410={},_0x2267ec={'count':0x0,'rows':[]};var _0x2c99a1=db['ZohoAccount']['rawAttributes'];_0x29e410['model']=_[_0x734e('0x33')](_0x2c99a1);_0x29e410[_0x734e('0x34')]=_[_0x734e('0x33')](_0x28baa4[_0x734e('0x34')]);_0x29e410['filters']=_['intersection'](_0x29e410[_0x734e('0x35')],_0x29e410[_0x734e('0x34')]);_0x5a55c5[_0x734e('0x36')]=_[_0x734e('0x37')](_0x29e410[_0x734e('0x35')],qs[_0x734e('0x38')](_0x28baa4['query'][_0x734e('0x38')]));_0x5a55c5[_0x734e('0x36')]=_0x5a55c5['attributes'][_0x734e('0x39')]?_0x5a55c5[_0x734e('0x36')]:_0x29e410[_0x734e('0x35')];if(!_0x28baa4[_0x734e('0x34')][_0x734e('0x3a')](_0x734e('0x3b'))){_0x5a55c5[_0x734e('0x29')]=qs['limit'](_0x28baa4['query'][_0x734e('0x29')]);_0x5a55c5[_0x734e('0x28')]=qs[_0x734e('0x28')](_0x28baa4['query'][_0x734e('0x28')]);}_0x5a55c5[_0x734e('0x3c')]=qs[_0x734e('0x3d')](_0x28baa4[_0x734e('0x34')][_0x734e('0x3d')]);_0x5a55c5[_0x734e('0x3e')]=qs[_0x734e('0x3f')](_[_0x734e('0x40')](_0x28baa4['query'],_0x29e410[_0x734e('0x3f')]));if(_0x28baa4['query'][_0x734e('0x41')]){_0x5a55c5['where']=_[_0x734e('0x42')](_0x5a55c5[_0x734e('0x3e')],{'$or':_['map'](_0x2c99a1,function(_0x1f452e){if(_0x1f452e[_0x734e('0x43')]['key']!==_0x734e('0x44')){var _0xdd2767={};_0xdd2767[_0x1f452e['field']]={'$like':'%'+_0x28baa4[_0x734e('0x34')]['filter']+'%'};return _0xdd2767;}})});}_0x5a55c5=_[_0x734e('0x42')]({},_0x5a55c5,_0x28baa4[_0x734e('0x45')]);var _0x4650bb={'where':_0x5a55c5[_0x734e('0x3e')]};return db[_0x734e('0x46')]['count'](_0x4650bb)[_0x734e('0x1c')](function(_0x4672d8){_0x2267ec[_0x734e('0x47')]=_0x4672d8;if(_0x28baa4['query'][_0x734e('0x48')]){_0x5a55c5['include']=[{'all':!![]}];}return db[_0x734e('0x46')]['findAll'](_0x5a55c5);})[_0x734e('0x1c')](function(_0x39d76a){_0x2267ec[_0x734e('0x49')]=_0x39d76a;return _0x2267ec;})[_0x734e('0x1c')](respondWithFilteredResult(_0x3d1a41,_0x5a55c5))[_0x734e('0x4a')](handleError(_0x3d1a41,null));};exports['show']=function(_0x366876,_0x478f9e){var _0x30725b={'raw':![],'where':{'id':_0x366876['params']['id']}},_0x4cc207={};_0x4cc207[_0x734e('0x35')]=_['keys'](db[_0x734e('0x46')][_0x734e('0x4b')]);_0x4cc207[_0x734e('0x34')]=_[_0x734e('0x33')](_0x366876['query']);_0x4cc207[_0x734e('0x3f')]=_['intersection'](_0x4cc207[_0x734e('0x35')],_0x4cc207[_0x734e('0x34')]);_0x30725b[_0x734e('0x36')]=_[_0x734e('0x37')](_0x4cc207[_0x734e('0x35')],qs[_0x734e('0x38')](_0x366876[_0x734e('0x34')][_0x734e('0x38')]));_0x30725b['attributes']=_0x30725b[_0x734e('0x36')][_0x734e('0x39')]?_0x30725b[_0x734e('0x36')]:_0x4cc207[_0x734e('0x35')];if(_0x366876[_0x734e('0x34')]['includeAll']){_0x30725b[_0x734e('0x4c')]=[{'all':!![]}];}_0x30725b=_['merge']({},_0x30725b,_0x366876[_0x734e('0x45')]);return db[_0x734e('0x46')][_0x734e('0x4d')](_0x30725b)[_0x734e('0x1c')](handleEntityNotFound(_0x478f9e,null))['then'](respondWithResult(_0x478f9e,null))[_0x734e('0x4a')](handleError(_0x478f9e,null));};exports[_0x734e('0x4e')]=function(_0x26d993,_0x4e33d5){return db[_0x734e('0x46')][_0x734e('0x4e')](_0x26d993[_0x734e('0x4f')],{})[_0x734e('0x1c')](respondWithResult(_0x4e33d5,0xc9))[_0x734e('0x4a')](handleError(_0x4e33d5,null));};exports['update']=function(_0x4d6d31,_0x54dcc8){if(_0x4d6d31[_0x734e('0x4f')]['id']){delete _0x4d6d31[_0x734e('0x4f')]['id'];}return db[_0x734e('0x46')][_0x734e('0x4d')]({'where':{'id':_0x4d6d31[_0x734e('0x50')]['id']}})[_0x734e('0x1c')](handleEntityNotFound(_0x54dcc8,null))[_0x734e('0x1c')](saveUpdates(_0x4d6d31[_0x734e('0x4f')],null))[_0x734e('0x1c')](respondWithResult(_0x54dcc8,null))['catch'](handleError(_0x54dcc8,null));};exports[_0x734e('0x2f')]=function(_0x34ffa4,_0x90e457){return db[_0x734e('0x46')][_0x734e('0x4d')]({'where':{'id':_0x34ffa4['params']['id']}})[_0x734e('0x1c')](handleEntityNotFound(_0x90e457,null))[_0x734e('0x1c')](removeEntity(_0x90e457,null))['catch'](handleError(_0x90e457,null));};exports[_0x734e('0x51')]=function(_0x39d14a,_0x4e1f5f,_0x48897e){var _0x58eb7d={};var _0x56cce8={};var _0x10581d;var _0x438ab0;return db[_0x734e('0x46')][_0x734e('0x52')]({'where':{'id':_0x39d14a['params']['id']}})[_0x734e('0x1c')](handleEntityNotFound(_0x4e1f5f,null))[_0x734e('0x1c')](function(_0x3b46da){if(_0x3b46da){_0x10581d=_0x3b46da;_0x56cce8['model']=_[_0x734e('0x33')](db[_0x734e('0x53')]['rawAttributes']);_0x56cce8[_0x734e('0x34')]=_[_0x734e('0x33')](_0x39d14a[_0x734e('0x34')]);_0x56cce8[_0x734e('0x3f')]=_[_0x734e('0x37')](_0x56cce8[_0x734e('0x35')],_0x56cce8[_0x734e('0x34')]);_0x58eb7d[_0x734e('0x36')]=_['intersection'](_0x56cce8['model'],qs[_0x734e('0x38')](_0x39d14a[_0x734e('0x34')][_0x734e('0x38')]));_0x58eb7d['attributes']=_0x58eb7d[_0x734e('0x36')][_0x734e('0x39')]?_0x58eb7d[_0x734e('0x36')]:_0x56cce8[_0x734e('0x35')];_0x58eb7d[_0x734e('0x3c')]=qs[_0x734e('0x3d')](_0x39d14a[_0x734e('0x34')][_0x734e('0x3d')]);_0x58eb7d[_0x734e('0x3e')]=qs['filters'](_[_0x734e('0x40')](_0x39d14a[_0x734e('0x34')],_0x56cce8[_0x734e('0x3f')]));if(_0x39d14a[_0x734e('0x34')]['filter']){_0x58eb7d[_0x734e('0x3e')]=_[_0x734e('0x42')](_0x58eb7d[_0x734e('0x3e')],{'$or':_['map'](_0x58eb7d[_0x734e('0x36')],function(_0x5fdfe5){var _0x485752={};_0x485752[_0x5fdfe5]={'$like':'%'+_0x39d14a[_0x734e('0x34')][_0x734e('0x41')]+'%'};return _0x485752;})});}_0x58eb7d=_[_0x734e('0x42')]({},_0x58eb7d,_0x39d14a[_0x734e('0x45')]);return _0x10581d[_0x734e('0x51')](_0x58eb7d);}})[_0x734e('0x1c')](function(_0x15a5a0){if(_0x15a5a0){_0x438ab0=_0x15a5a0['length'];if(!_0x39d14a[_0x734e('0x34')]['hasOwnProperty'](_0x734e('0x3b'))){_0x58eb7d[_0x734e('0x29')]=qs['limit'](_0x39d14a[_0x734e('0x34')][_0x734e('0x29')]);_0x58eb7d['offset']=qs[_0x734e('0x28')](_0x39d14a[_0x734e('0x34')]['offset']);}return _0x10581d[_0x734e('0x51')](_0x58eb7d);}})['then'](function(_0x4f04f3){if(_0x4f04f3){return _0x4f04f3?{'count':_0x438ab0,'rows':_0x4f04f3}:null;}})[_0x734e('0x1c')](respondWithResult(_0x4e1f5f,null))[_0x734e('0x4a')](handleError(_0x4e1f5f,null));};exports[_0x734e('0x54')]=function(_0x3681c8,_0x49ee4e,_0x52c24a){if(_0x3681c8['body']['id']){delete _0x3681c8['body']['id'];}return db[_0x734e('0x46')][_0x734e('0x52')]({'where':{'id':_0x3681c8[_0x734e('0x50')]['id']}})['then'](handleEntityNotFound(_0x49ee4e,null))[_0x734e('0x1c')](function(_0x153660){if(_0x153660){_0x3681c8['body']['AccountId']=_0x153660['id'];_0x3681c8['body']['Subjects']=integrations[_0x734e('0x55')](_0x3681c8['body'][_0x734e('0x56')],_0x3681c8[_0x734e('0x4f')][_0x734e('0x43')]);_0x3681c8[_0x734e('0x4f')][_0x734e('0x57')]=integrations['getDescriptions'](_0x3681c8[_0x734e('0x4f')][_0x734e('0x56')],_0x3681c8[_0x734e('0x4f')][_0x734e('0x43')]);return db[_0x734e('0x53')]['create'](_0x3681c8[_0x734e('0x4f')],{'include':[{'model':db[_0x734e('0x58')],'as':_0x734e('0x59')},{'model':db[_0x734e('0x58')],'as':_0x734e('0x57')}]});}return null;})[_0x734e('0x1c')](respondWithResult(_0x49ee4e,null))[_0x734e('0x4a')](handleError(_0x49ee4e,null));};exports[_0x734e('0x5a')]=function(_0x5e7960,_0x2ce236,_0x3edc3b){var _0x144b86='';return db['ZohoAccount'][_0x734e('0x52')]({'where':{'id':_0x5e7960[_0x734e('0x50')]['id']},'attributes':['id',_0x734e('0x5b'),_0x734e('0x5c')]})['then'](handleEntityNotFound(_0x2ce236,null))[_0x734e('0x1c')](function(_0x127208){if(_0x127208){_0x144b86=_0x127208[_0x734e('0x5b')];var _0x46057d=_0x144b86[_0x734e('0x5d')](-0x1);if(_0x46057d==='/'){_0x144b86=_0x144b86[_0x734e('0x5e')](0x0,_0x144b86[_0x734e('0x5f')](_0x46057d));}return rp({'method':_0x734e('0x60'),'uri':util[_0x734e('0x61')](_0x734e('0x62'),_0x144b86),'qs':{'authtoken':_0x127208[_0x734e('0x5c')],'scope':'crmapi'},'json':!![]});}})[_0x734e('0x1c')](function(_0x444705){if(_0x444705){if(_0x444705[_0x734e('0x63')]&&_0x444705[_0x734e('0x63')][_0x734e('0x20')]){throw new Error(_0x444705['response']['error'][_0x734e('0x23')]);}var _0x2cb91a=[];if(_0x444705[_0x734e('0x64')]&&_0x444705['Calls'][_0x734e('0x65')]){if(_0x444705[_0x734e('0x64')][_0x734e('0x65')]['FL']){var _0x5f5423=[_0x734e('0x66')];for(var _0x422247=0x0,_0x52bf8e=_0x444705[_0x734e('0x64')]['section']['FL'][_0x734e('0x39')];_0x422247<_0x52bf8e;_0x422247++){if(_['includes'](_0x5f5423,_0x444705[_0x734e('0x64')][_0x734e('0x65')]['FL'][_0x422247]['dv'])){_0x2cb91a[_0x734e('0x67')]({'id':_0x444705[_0x734e('0x64')]['section']['FL'][_0x422247]['dv'],'name':_0x444705['Calls'][_0x734e('0x65')]['FL'][_0x422247]['label'],'custom':_0x444705[_0x734e('0x64')][_0x734e('0x65')]['FL'][_0x422247][_0x734e('0x68')]===_0x734e('0x69')?!![]:![],'options':_0x444705[_0x734e('0x64')][_0x734e('0x65')]['FL'][_0x422247]['type']==='Pick\x20List'&&_0x444705[_0x734e('0x64')][_0x734e('0x65')]['FL'][_0x422247]['val']?_[_0x734e('0x6a')](_0x444705['Calls'][_0x734e('0x65')]['FL'][_0x422247][_0x734e('0x6b')],function(_0xba242c){return{'name':_0xba242c,'value':_0xba242c};}):[]});}}}}return{'count':_0x2cb91a[_0x734e('0x39')],'rows':_0x2cb91a};}})[_0x734e('0x1c')](respondWithResult(_0x2ce236,null))[_0x734e('0x4a')](function(_0x7ddbef){var _0x16a950=_0x5e7960[_0x734e('0x34')][_0x734e('0x6c')]?0x1f4:_0x7ddbef['statusCode']||0x1f4;logger[_0x734e('0x20')]('getFields,\x20%s,\x20%s,\x20%s',_0x734e('0x5a'),_0x16a950,JSON['stringify'](_0x7ddbef));delete _0x7ddbef[_0x734e('0x30')];if(_0x16a950===0x191){_0x16a950=0x190;}_0x2ce236[_0x734e('0x25')](_0x16a950)[_0x734e('0x31')](_0x5e7960[_0x734e('0x34')]['test']?{'message':_0x734e('0x6d'),'statusCode':_0x7ddbef['statusCode']}:_0x7ddbef);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 3e85acf..709277d 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 _0x93b6=['int_zoho_accounts','lodash','util','../../config/logger','api','moment','bluebird','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount'];(function(_0x53afa6,_0x59e786){var _0x51f86a=function(_0x368385){while(--_0x368385){_0x53afa6['push'](_0x53afa6['shift']());}};_0x51f86a(++_0x59e786);}(_0x93b6,0x7a));var _0x693b=function(_0x5085cf,_0x3f9116){_0x5085cf=_0x5085cf-0x0;var _0x4d2949=_0x93b6[_0x5085cf];return _0x4d2949;};'use strict';var _=require(_0x693b('0x0'));var util=require(_0x693b('0x1'));var logger=require(_0x693b('0x2'))(_0x693b('0x3'));var moment=require(_0x693b('0x4'));var BPromise=require(_0x693b('0x5'));var rp=require('request-promise');var attributes=require(_0x693b('0x6'));var integrations=require(_0x693b('0x7'));module[_0x693b('0x8')]=function(_0x3f99aa,_0xdebd32){return _0x3f99aa['define'](_0x693b('0x9'),attributes,{'tableName':_0x693b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fda=['ZohoAccount','int_zoho_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','./intZohoAccount.attributes','define'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x6fda,0xa2));var _0xa6fd=function(_0x5cf2ad,_0x35e77d){_0x5cf2ad=_0x5cf2ad-0x0;var _0x3aa735=_0x6fda[_0x5cf2ad];return _0x3aa735;};'use strict';var _=require(_0xa6fd('0x0'));var util=require(_0xa6fd('0x1'));var logger=require(_0xa6fd('0x2'))('api');var moment=require(_0xa6fd('0x3'));var BPromise=require(_0xa6fd('0x4'));var rp=require(_0xa6fd('0x5'));var attributes=require(_0xa6fd('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xb871aa,_0xcd05d6){return _0xb871aa[_0xa6fd('0x7')](_0xa6fd('0x8'),attributes,{'tableName':_0xa6fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 83729f8..9d34476 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 _0xe451=['raw','where','attributes','limit','map','include','model','stringify','find','then','ShowZohoAccount','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetZohoAccount','options'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xe451,0x12c));var _0x1e45=function(_0x161e9b,_0x3f56eb){_0x161e9b=_0x161e9b-0x0;var _0x8ccb77=_0xe451[_0x161e9b];return _0x8ccb77;};'use strict';var _=require(_0x1e45('0x0'));var util=require(_0x1e45('0x1'));var moment=require(_0x1e45('0x2'));var BPromise=require(_0x1e45('0x3'));var rs=require(_0x1e45('0x4'));var fs=require('fs');var Redis=require(_0x1e45('0x5'));var db=require(_0x1e45('0x6'))['db'];var utils=require(_0x1e45('0x7'));var logger=require('../../config/logger')(_0x1e45('0x8'));var config=require(_0x1e45('0x9'));var jayson=require(_0x1e45('0xa'));var client=jayson[_0x1e45('0xb')][_0x1e45('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55d10a,_0x23c39c,_0x2fde13){return new BPromise(function(_0x57e1ac,_0xeb83aa){return client[_0x1e45('0xd')](_0x55d10a,_0x2fde13)['then'](function(_0x4272bf){logger[_0x1e45('0xe')](_0x1e45('0xf'),_0x23c39c,_0x1e45('0x10'));logger[_0x1e45('0x11')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x23c39c,_0x1e45('0x10'),JSON['stringify'](_0x4272bf));if(_0x4272bf['error']){if(_0x4272bf[_0x1e45('0x12')][_0x1e45('0x13')]===0x1f4){logger[_0x1e45('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x23c39c,_0x4272bf[_0x1e45('0x12')][_0x1e45('0x14')]);return _0xeb83aa(_0x4272bf[_0x1e45('0x12')][_0x1e45('0x14')]);}logger[_0x1e45('0x12')](_0x1e45('0xf'),_0x23c39c,_0x4272bf['error'][_0x1e45('0x14')]);return _0x57e1ac(_0x4272bf['error'][_0x1e45('0x14')]);}else{logger['info'](_0x1e45('0xf'),_0x23c39c,'request\x20sent');_0x57e1ac(_0x4272bf[_0x1e45('0x15')][_0x1e45('0x14')]);}})['catch'](function(_0x443b8e){logger['error'](_0x1e45('0xf'),_0x23c39c,_0x443b8e);_0xeb83aa(_0x443b8e);});});}exports[_0x1e45('0x16')]=function(_0x51b079){var _0x596e8d=this;return new Promise(function(_0x1f9734,_0x17cf81){return db['ZohoAccount']['findAll']({'raw':_0x51b079['options']?_0x51b079[_0x1e45('0x17')][_0x1e45('0x18')]===undefined?!![]:![]:!![],'where':_0x51b079[_0x1e45('0x17')]?_0x51b079['options'][_0x1e45('0x19')]||null:null,'attributes':_0x51b079['options']?_0x51b079[_0x1e45('0x17')][_0x1e45('0x1a')]||null:null,'limit':_0x51b079['options']?_0x51b079[_0x1e45('0x17')][_0x1e45('0x1b')]||null:null,'include':_0x51b079[_0x1e45('0x17')]?_0x51b079[_0x1e45('0x17')]['include']?_[_0x1e45('0x1c')](_0x51b079[_0x1e45('0x17')][_0x1e45('0x1d')],function(_0x4f4d4c){return{'model':db[_0x4f4d4c[_0x1e45('0x1e')]],'as':_0x4f4d4c['as'],'attributes':_0x4f4d4c['attributes'],'include':_0x4f4d4c[_0x1e45('0x1d')]?_[_0x1e45('0x1c')](_0x4f4d4c[_0x1e45('0x1d')],function(_0xac963){return{'model':db[_0xac963[_0x1e45('0x1e')]],'as':_0xac963['as'],'attributes':_0xac963[_0x1e45('0x1a')],'include':_0xac963[_0x1e45('0x1d')]?_[_0x1e45('0x1c')](_0xac963[_0x1e45('0x1d')],function(_0x131d77){return{'model':db[_0x131d77[_0x1e45('0x1e')]],'as':_0x131d77['as'],'attributes':_0x131d77[_0x1e45('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d0254){logger['info'](_0x1e45('0x16'),_0x51b079);logger[_0x1e45('0x11')](_0x1e45('0x16'),_0x51b079,JSON[_0x1e45('0x1f')](_0x2d0254));_0x1f9734(_0x2d0254);})['catch'](function(_0x5d6459){logger[_0x1e45('0x12')](_0x1e45('0x16'),_0x5d6459[_0x1e45('0x14')],_0x51b079);_0x17cf81(_0x596e8d[_0x1e45('0x12')](0x1f4,_0x5d6459[_0x1e45('0x14')]));});});};exports['ShowZohoAccount']=function(_0x15bad7){var _0x4cda0e=this;return new Promise(function(_0x3ab938,_0x165a3c){return db['ZohoAccount'][_0x1e45('0x20')]({'raw':_0x15bad7['options']?_0x15bad7[_0x1e45('0x17')][_0x1e45('0x18')]===undefined?!![]:![]:!![],'where':_0x15bad7[_0x1e45('0x17')]?_0x15bad7[_0x1e45('0x17')][_0x1e45('0x19')]||null:null,'attributes':_0x15bad7['options']?_0x15bad7[_0x1e45('0x17')][_0x1e45('0x1a')]||null:null,'include':_0x15bad7['options']?_0x15bad7[_0x1e45('0x17')][_0x1e45('0x1d')]?_[_0x1e45('0x1c')](_0x15bad7['options'][_0x1e45('0x1d')],function(_0x5405fb){return{'model':db[_0x5405fb[_0x1e45('0x1e')]],'as':_0x5405fb['as'],'attributes':_0x5405fb[_0x1e45('0x1a')],'include':_0x5405fb['include']?_['map'](_0x5405fb['include'],function(_0x21febb){return{'model':db[_0x21febb[_0x1e45('0x1e')]],'as':_0x21febb['as'],'attributes':_0x21febb[_0x1e45('0x1a')],'include':_0x21febb['include']?_[_0x1e45('0x1c')](_0x21febb[_0x1e45('0x1d')],function(_0x3628a1){return{'model':db[_0x3628a1['model']],'as':_0x3628a1['as'],'attributes':_0x3628a1['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e45('0x21')](function(_0x2a8dc9){logger[_0x1e45('0xe')](_0x1e45('0x22'),_0x15bad7);logger['debug'](_0x1e45('0x22'),_0x15bad7,JSON[_0x1e45('0x1f')](_0x2a8dc9));_0x3ab938(_0x2a8dc9);})[_0x1e45('0x23')](function(_0x1ca9ef){logger[_0x1e45('0x12')](_0x1e45('0x22'),_0x1ca9ef[_0x1e45('0x14')],_0x15bad7);_0x165a3c(_0x4cda0e[_0x1e45('0x12')](0x1f4,_0x1ca9ef['message']));});});}; \ No newline at end of file +var _0x570d=['model','ShowZohoAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','raw','options','where','limit','map','include','attributes'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0x570d,0x113));var _0xd570=function(_0x12f58e,_0x1ea042){_0x12f58e=_0x12f58e-0x0;var _0x1f88d7=_0x570d[_0x12f58e];return _0x1f88d7;};'use strict';var _=require(_0xd570('0x0'));var util=require('util');var moment=require(_0xd570('0x1'));var BPromise=require(_0xd570('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd570('0x3'));var db=require(_0xd570('0x4'))['db'];var utils=require(_0xd570('0x5'));var logger=require(_0xd570('0x6'))(_0xd570('0x7'));var config=require('../../config/environment');var jayson=require(_0xd570('0x8'));var client=jayson['client'][_0xd570('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1426d3,_0x4b4981,_0x39b813){return new BPromise(function(_0x12b087,_0x3ed3f9){return client[_0xd570('0xa')](_0x1426d3,_0x39b813)[_0xd570('0xb')](function(_0x368b73){logger[_0xd570('0xc')](_0xd570('0xd'),_0x4b4981,_0xd570('0xe'));logger[_0xd570('0xf')](_0xd570('0x10'),_0x4b4981,'request\x20sent',JSON['stringify'](_0x368b73));if(_0x368b73[_0xd570('0x11')]){if(_0x368b73[_0xd570('0x11')][_0xd570('0x12')]===0x1f4){logger[_0xd570('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x4b4981,_0x368b73['error'][_0xd570('0x13')]);return _0x3ed3f9(_0x368b73[_0xd570('0x11')]['message']);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4b4981,_0x368b73[_0xd570('0x11')][_0xd570('0x13')]);return _0x12b087(_0x368b73[_0xd570('0x11')][_0xd570('0x13')]);}else{logger[_0xd570('0xc')](_0xd570('0xd'),_0x4b4981,_0xd570('0xe'));_0x12b087(_0x368b73['result'][_0xd570('0x13')]);}})[_0xd570('0x14')](function(_0x67270b){logger[_0xd570('0x11')](_0xd570('0xd'),_0x4b4981,_0x67270b);_0x3ed3f9(_0x67270b);});});}exports[_0xd570('0x15')]=function(_0x296a24){var _0x9056a1=this;return new Promise(function(_0x55b1e7,_0x5be4d3){return db[_0xd570('0x16')][_0xd570('0x17')]({'raw':_0x296a24['options']?_0x296a24['options'][_0xd570('0x18')]===undefined?!![]:![]:!![],'where':_0x296a24[_0xd570('0x19')]?_0x296a24[_0xd570('0x19')][_0xd570('0x1a')]||null:null,'attributes':_0x296a24['options']?_0x296a24[_0xd570('0x19')]['attributes']||null:null,'limit':_0x296a24[_0xd570('0x19')]?_0x296a24['options'][_0xd570('0x1b')]||null:null,'include':_0x296a24[_0xd570('0x19')]?_0x296a24[_0xd570('0x19')]['include']?_[_0xd570('0x1c')](_0x296a24[_0xd570('0x19')][_0xd570('0x1d')],function(_0x11ebbf){return{'model':db[_0x11ebbf['model']],'as':_0x11ebbf['as'],'attributes':_0x11ebbf['attributes'],'include':_0x11ebbf['include']?_['map'](_0x11ebbf[_0xd570('0x1d')],function(_0x4145d7){return{'model':db[_0x4145d7['model']],'as':_0x4145d7['as'],'attributes':_0x4145d7[_0xd570('0x1e')],'include':_0x4145d7[_0xd570('0x1d')]?_['map'](_0x4145d7['include'],function(_0x4c43a5){return{'model':db[_0x4c43a5[_0xd570('0x1f')]],'as':_0x4c43a5['as'],'attributes':_0x4c43a5['attributes']};}):[]};}):[]};}):[]:[]})[_0xd570('0xb')](function(_0x327172){logger[_0xd570('0xc')](_0xd570('0x15'),_0x296a24);logger[_0xd570('0xf')](_0xd570('0x15'),_0x296a24,JSON['stringify'](_0x327172));_0x55b1e7(_0x327172);})[_0xd570('0x14')](function(_0x387637){logger['error'](_0xd570('0x15'),_0x387637[_0xd570('0x13')],_0x296a24);_0x5be4d3(_0x9056a1['error'](0x1f4,_0x387637[_0xd570('0x13')]));});});};exports[_0xd570('0x20')]=function(_0x5da214){var _0x40db2e=this;return new Promise(function(_0x20ac18,_0x292bcc){return db[_0xd570('0x16')][_0xd570('0x21')]({'raw':_0x5da214[_0xd570('0x19')]?_0x5da214[_0xd570('0x19')][_0xd570('0x18')]===undefined?!![]:![]:!![],'where':_0x5da214[_0xd570('0x19')]?_0x5da214[_0xd570('0x19')][_0xd570('0x1a')]||null:null,'attributes':_0x5da214['options']?_0x5da214[_0xd570('0x19')]['attributes']||null:null,'include':_0x5da214[_0xd570('0x19')]?_0x5da214['options'][_0xd570('0x1d')]?_[_0xd570('0x1c')](_0x5da214[_0xd570('0x19')]['include'],function(_0x2a5c62){return{'model':db[_0x2a5c62['model']],'as':_0x2a5c62['as'],'attributes':_0x2a5c62[_0xd570('0x1e')],'include':_0x2a5c62['include']?_[_0xd570('0x1c')](_0x2a5c62[_0xd570('0x1d')],function(_0xc159b0){return{'model':db[_0xc159b0['model']],'as':_0xc159b0['as'],'attributes':_0xc159b0[_0xd570('0x1e')],'include':_0xc159b0['include']?_[_0xd570('0x1c')](_0xc159b0[_0xd570('0x1d')],function(_0x408253){return{'model':db[_0x408253[_0xd570('0x1f')]],'as':_0x408253['as'],'attributes':_0x408253['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x15259c){logger['info'](_0xd570('0x20'),_0x5da214);logger[_0xd570('0xf')](_0xd570('0x20'),_0x5da214,JSON['stringify'](_0x15259c));_0x20ac18(_0x15259c);})[_0xd570('0x14')](function(_0x251938){logger[_0xd570('0x11')](_0xd570('0x20'),_0x251938[_0xd570('0x13')],_0x5da214);_0x292bcc(_0x40db2e[_0xd570('0x11')](0x1f4,_0x251938[_0xd570('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 086a4a2..f14d84e 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 _0x5144=['connect-timeout','express','Router','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','exports','util','path'];(function(_0x1a863f,_0x168742){var _0x28de64=function(_0x4c31c5){while(--_0x4c31c5){_0x1a863f['push'](_0x1a863f['shift']());}};_0x28de64(++_0x168742);}(_0x5144,0xe2));var _0x4514=function(_0x5b6935,_0x85f2c8){_0x5b6935=_0x5b6935-0x0;var _0x227439=_0x5144[_0x5b6935];return _0x227439;};'use strict';var multer=require('multer');var util=require(_0x4514('0x0'));var path=require(_0x4514('0x1'));var timeout=require(_0x4514('0x2'));var express=require(_0x4514('0x3'));var router=express[_0x4514('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4514('0x5'));var config=require('../../config/environment');var controller=require(_0x4514('0x6'));router[_0x4514('0x7')]('/',auth[_0x4514('0x8')](),controller['index']);router[_0x4514('0x7')](_0x4514('0x9'),auth[_0x4514('0x8')](),controller[_0x4514('0xa')]);router[_0x4514('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x4514('0xb')]);router[_0x4514('0x7')](_0x4514('0xc'),auth[_0x4514('0x8')](),controller[_0x4514('0xd')]);router['get']('/:id/descriptions',auth[_0x4514('0x8')](),controller[_0x4514('0xe')]);router[_0x4514('0xf')]('/',auth[_0x4514('0x8')](),controller[_0x4514('0x10')]);router['put'](_0x4514('0x9'),auth[_0x4514('0x8')](),controller[_0x4514('0x11')]);router['delete'](_0x4514('0x9'),auth[_0x4514('0x8')](),controller['destroy']);module[_0x4514('0x12')]=router; \ No newline at end of file +var _0x16e4=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x16e4,0x97));var _0x416e=function(_0x1dd5a9,_0x308cd7){_0x1dd5a9=_0x1dd5a9-0x0;var _0x42f2c5=_0x16e4[_0x1dd5a9];return _0x42f2c5;};'use strict';var multer=require(_0x416e('0x0'));var util=require(_0x416e('0x1'));var path=require(_0x416e('0x2'));var timeout=require(_0x416e('0x3'));var express=require(_0x416e('0x4'));var router=express[_0x416e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x416e('0x6'));var config=require('../../config/environment');var controller=require(_0x416e('0x7'));router[_0x416e('0x8')]('/',auth['isAuthenticated'](),controller[_0x416e('0x9')]);router[_0x416e('0x8')](_0x416e('0xa'),auth[_0x416e('0xb')](),controller[_0x416e('0xc')]);router[_0x416e('0x8')](_0x416e('0xd'),auth[_0x416e('0xb')](),controller[_0x416e('0xe')]);router['get'](_0x416e('0xf'),auth['isAuthenticated'](),controller[_0x416e('0x10')]);router[_0x416e('0x8')](_0x416e('0x11'),auth['isAuthenticated'](),controller[_0x416e('0x12')]);router[_0x416e('0x13')]('/',auth[_0x416e('0xb')](),controller['create']);router[_0x416e('0x14')]('/:id',auth[_0x416e('0xb')](),controller[_0x416e('0x15')]);router[_0x416e('0x16')](_0x416e('0xa'),auth['isAuthenticated'](),controller[_0x416e('0x17')]);module[_0x416e('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 3ae2dc6..a8555be 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 _0x8879=['sequelize','STRING'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x8879,0x1ea));var _0x9887=function(_0x11f7a7,_0x66f872){_0x11f7a7=_0x11f7a7-0x0;var _0x184017=_0x8879[_0x11f7a7];return _0x184017;};'use strict';var Sequelize=require(_0x9887('0x0'));module['exports']={'name':{'type':Sequelize[_0x9887('0x1')]},'description':{'type':Sequelize[_0x9887('0x1')]}}; \ No newline at end of file +var _0xfcb5=['exports','STRING','sequelize'];(function(_0x263002,_0x48fe3f){var _0x2dae4c=function(_0x1c626f){while(--_0x1c626f){_0x263002['push'](_0x263002['shift']());}};_0x2dae4c(++_0x48fe3f);}(_0xfcb5,0x14f));var _0x5fcb=function(_0x449a49,_0x136972){_0x449a49=_0x449a49-0x0;var _0x43c572=_0xfcb5[_0x449a49];return _0x43c572;};'use strict';var Sequelize=require(_0x5fcb('0x0'));module[_0x5fcb('0x1')]={'name':{'type':Sequelize[_0x5fcb('0x2')]},'description':{'type':Sequelize[_0x5fcb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 943b4d3..eaab7e6 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 _0x545f=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','map','type','field','merge','includeAll','include','findAll','show','options','create','body','find','params','getFields','ZohoField','getSubjects','findOne','getDescriptions','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','ZohoConfiguration','rawAttributes','model','keys','query'];(function(_0x262691,_0xe5d121){var _0x284af7=function(_0x4ef99c){while(--_0x4ef99c){_0x262691['push'](_0x262691['shift']());}};_0x284af7(++_0xe5d121);}(_0x545f,0x75));var _0xf545=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0x545f[_0x18fb16];return _0x147b0d;};'use strict';var pdf=require(_0xf545('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf545('0x1'));var zipdir=require(_0xf545('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf545('0x3'));var moment=require(_0xf545('0x4'));var BPromise=require(_0xf545('0x5'));var Mustache=require(_0xf545('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf545('0x7'));var csv=require('to-csv');var ejs=require(_0xf545('0x8'));var fs=require('fs');var _=require(_0xf545('0x9'));var squel=require(_0xf545('0xa'));var crypto=require(_0xf545('0xb'));var jsforce=require(_0xf545('0xc'));var deskjs=require(_0xf545('0xd'));var toCsv=require(_0xf545('0xe'));var querystring=require(_0xf545('0xf'));var Papa=require(_0xf545('0x10'));var authService=require(_0xf545('0x11'));var hardwareService=require(_0xf545('0x12'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xf545('0x13'))(_0xf545('0x14'));var utils=require(_0xf545('0x15'));var config=require(_0xf545('0x16'));var db=require(_0xf545('0x17'))['db'];var jayson=require(_0xf545('0x18'));var client=jayson[_0xf545('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36001b,_0x3f51dd,_0x38d7a1,_0x15f930){return new BPromise(function(_0x3a32d7,_0x2018cf){var _0x49ba19=_0x15f930||client;return _0x49ba19['request'](_0x36001b,_0x38d7a1)['then'](function(_0x1e532e){logger[_0xf545('0x1a')](_0xf545('0x1b'),_0x3f51dd,_0xf545('0x1c'));logger['debug'](_0xf545('0x1d'),_0x3f51dd,_0xf545('0x1c'),JSON[_0xf545('0x1e')](_0x1e532e));if(_0x1e532e['error']){if(_0x1e532e[_0xf545('0x1f')][_0xf545('0x20')]===0x1f4){logger[_0xf545('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f51dd,_0x1e532e[_0xf545('0x1f')][_0xf545('0x21')]);return _0x2018cf(_0x1e532e[_0xf545('0x1f')][_0xf545('0x21')]);}logger[_0xf545('0x1f')](_0xf545('0x1b'),_0x3f51dd,_0x1e532e[_0xf545('0x1f')]['message']);return _0x3a32d7(_0x1e532e['error'][_0xf545('0x21')]);}else{logger[_0xf545('0x1a')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f51dd,'request\x20sent');_0x3a32d7(_0x1e532e['result'][_0xf545('0x21')]);}})[_0xf545('0x22')](function(_0x137710){logger[_0xf545('0x1f')](_0xf545('0x1b'),_0x3f51dd,_0x137710);_0x2018cf(_0x137710);});});}function respondWithStatusCode(_0xc74b28,_0x5e8d9b){_0x5e8d9b=_0x5e8d9b||0xcc;return function(_0x350dbe){if(_0x350dbe){return _0xc74b28[_0xf545('0x23')](_0x5e8d9b);}return _0xc74b28[_0xf545('0x24')](_0x5e8d9b)[_0xf545('0x25')]();};}function respondWithResult(_0x449722,_0x5a39c8){_0x5a39c8=_0x5a39c8||0xc8;return function(_0x3dae87){if(_0x3dae87){return _0x449722[_0xf545('0x24')](_0x5a39c8)[_0xf545('0x26')](_0x3dae87);}};}function respondWithFilteredResult(_0x1f5871,_0x16d754){return function(_0x6232e3){if(_0x6232e3){var _0x2f73d1=_0x6232e3[_0xf545('0x27')],_0x313bea=_0x16d754[_0xf545('0x28')],_0x5e9d35=_0x16d754[_0xf545('0x28')]+_0x16d754[_0xf545('0x29')],_0x14a51d;if(_0x5e9d35>=_0x2f73d1){_0x5e9d35=_0x2f73d1;_0x14a51d=0xc8;}else{_0x14a51d=0xce;}_0x1f5871[_0xf545('0x24')](_0x14a51d);return _0x1f5871[_0xf545('0x2a')](_0xf545('0x2b'),_0x313bea+'-'+_0x5e9d35+'/'+_0x2f73d1)[_0xf545('0x26')](_0x6232e3);}return null;};}function patchUpdates(_0x2e7c7e){return function(_0x588342){try{jsonpatch[_0xf545('0x2c')](_0x588342,_0x2e7c7e,!![]);}catch(_0x27b8d7){return BPromise[_0xf545('0x2d')](_0x27b8d7);}return _0x588342['save']();};}function saveUpdates(_0x7c41d3,_0x36d03d){return function(_0x3a2b3f){if(_0x3a2b3f){return _0x3a2b3f[_0xf545('0x2e')](_0x7c41d3)[_0xf545('0x2f')](function(_0x59b3d0){return _0x59b3d0;});}return null;};}function removeEntity(_0x3b7e6d,_0x58f634){return function(_0x526c67){if(_0x526c67){return _0x526c67[_0xf545('0x30')]()[_0xf545('0x2f')](function(){_0x3b7e6d[_0xf545('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31ef8f,_0x4f5277){return function(_0x4fc0c3){if(!_0x4fc0c3){_0x31ef8f[_0xf545('0x23')](0x194);}return _0x4fc0c3;};}function handleError(_0x3297a6,_0x3cda03){_0x3cda03=_0x3cda03||0x1f4;return function(_0x4a75be){logger['error'](_0x4a75be[_0xf545('0x31')]);if(_0x4a75be[_0xf545('0x32')]){delete _0x4a75be[_0xf545('0x32')];}_0x3297a6[_0xf545('0x24')](_0x3cda03)['send'](_0x4a75be);};}exports[_0xf545('0x33')]=function(_0x2b1f3e,_0x32f6c2){var _0x2dddd2={},_0x2dd2a2={},_0x150fac={'count':0x0,'rows':[]};var _0x236fa3=db[_0xf545('0x34')][_0xf545('0x35')];_0x2dd2a2[_0xf545('0x36')]=_[_0xf545('0x37')](_0x236fa3);_0x2dd2a2[_0xf545('0x38')]=_[_0xf545('0x37')](_0x2b1f3e[_0xf545('0x38')]);_0x2dd2a2['filters']=_[_0xf545('0x39')](_0x2dd2a2['model'],_0x2dd2a2[_0xf545('0x38')]);_0x2dddd2[_0xf545('0x3a')]=_['intersection'](_0x2dd2a2['model'],qs[_0xf545('0x3b')](_0x2b1f3e[_0xf545('0x38')]['fields']));_0x2dddd2[_0xf545('0x3a')]=_0x2dddd2[_0xf545('0x3a')][_0xf545('0x3c')]?_0x2dddd2[_0xf545('0x3a')]:_0x2dd2a2[_0xf545('0x36')];if(!_0x2b1f3e[_0xf545('0x38')][_0xf545('0x3d')](_0xf545('0x3e'))){_0x2dddd2[_0xf545('0x29')]=qs[_0xf545('0x29')](_0x2b1f3e[_0xf545('0x38')][_0xf545('0x29')]);_0x2dddd2[_0xf545('0x28')]=qs[_0xf545('0x28')](_0x2b1f3e['query']['offset']);}_0x2dddd2[_0xf545('0x3f')]=qs[_0xf545('0x40')](_0x2b1f3e[_0xf545('0x38')][_0xf545('0x40')]);_0x2dddd2['where']=qs['filters'](_[_0xf545('0x41')](_0x2b1f3e['query'],_0x2dd2a2[_0xf545('0x42')]));if(_0x2b1f3e[_0xf545('0x38')][_0xf545('0x43')]){_0x2dddd2[_0xf545('0x44')]=_['merge'](_0x2dddd2[_0xf545('0x44')],{'$or':_[_0xf545('0x45')](_0x236fa3,function(_0x4c582a){if(_0x4c582a[_0xf545('0x46')]['key']!=='VIRTUAL'){var _0x40602b={};_0x40602b[_0x4c582a[_0xf545('0x47')]]={'$like':'%'+_0x2b1f3e['query'][_0xf545('0x43')]+'%'};return _0x40602b;}})});}_0x2dddd2=_[_0xf545('0x48')]({},_0x2dddd2,_0x2b1f3e['options']);var _0x3fda10={'where':_0x2dddd2['where']};return db[_0xf545('0x34')][_0xf545('0x27')](_0x3fda10)['then'](function(_0x4e3894){_0x150fac['count']=_0x4e3894;if(_0x2b1f3e['query'][_0xf545('0x49')]){_0x2dddd2[_0xf545('0x4a')]=[{'all':!![]}];}return db[_0xf545('0x34')][_0xf545('0x4b')](_0x2dddd2);})[_0xf545('0x2f')](function(_0x45d079){_0x150fac['rows']=_0x45d079;return _0x150fac;})[_0xf545('0x2f')](respondWithFilteredResult(_0x32f6c2,_0x2dddd2))[_0xf545('0x22')](handleError(_0x32f6c2,null));};exports[_0xf545('0x4c')]=function(_0x3187f2,_0x59b964){var _0x178278={'raw':![],'where':{'id':_0x3187f2['params']['id']}},_0x53d22f={};_0x53d22f['model']=_['keys'](db[_0xf545('0x34')][_0xf545('0x35')]);_0x53d22f[_0xf545('0x38')]=_[_0xf545('0x37')](_0x3187f2[_0xf545('0x38')]);_0x53d22f[_0xf545('0x42')]=_[_0xf545('0x39')](_0x53d22f[_0xf545('0x36')],_0x53d22f[_0xf545('0x38')]);_0x178278['attributes']=_[_0xf545('0x39')](_0x53d22f['model'],qs[_0xf545('0x3b')](_0x3187f2[_0xf545('0x38')][_0xf545('0x3b')]));_0x178278[_0xf545('0x3a')]=_0x178278[_0xf545('0x3a')]['length']?_0x178278[_0xf545('0x3a')]:_0x53d22f['model'];if(_0x3187f2[_0xf545('0x38')][_0xf545('0x49')]){_0x178278['include']=[{'all':!![]}];}_0x178278=_['merge']({},_0x178278,_0x3187f2[_0xf545('0x4d')]);return db['ZohoConfiguration']['find'](_0x178278)[_0xf545('0x2f')](handleEntityNotFound(_0x59b964,null))[_0xf545('0x2f')](respondWithResult(_0x59b964,null))[_0xf545('0x22')](handleError(_0x59b964,null));};exports[_0xf545('0x4e')]=function(_0x5cd814,_0xf51b96){return db[_0xf545('0x34')][_0xf545('0x4e')](_0x5cd814[_0xf545('0x4f')],{})[_0xf545('0x2f')](respondWithResult(_0xf51b96,0xc9))[_0xf545('0x22')](handleError(_0xf51b96,null));};exports[_0xf545('0x2e')]=function(_0x345e13,_0x3c1a42){if(_0x345e13[_0xf545('0x4f')]['id']){delete _0x345e13['body']['id'];}return db[_0xf545('0x34')][_0xf545('0x50')]({'where':{'id':_0x345e13[_0xf545('0x51')]['id']}})[_0xf545('0x2f')](handleEntityNotFound(_0x3c1a42,null))['then'](saveUpdates(_0x345e13[_0xf545('0x4f')],null))[_0xf545('0x2f')](respondWithResult(_0x3c1a42,null))[_0xf545('0x22')](handleError(_0x3c1a42,null));};exports[_0xf545('0x30')]=function(_0x4231fe,_0x4cffca){return db['ZohoConfiguration'][_0xf545('0x50')]({'where':{'id':_0x4231fe['params']['id']}})[_0xf545('0x2f')](handleEntityNotFound(_0x4cffca,null))[_0xf545('0x2f')](removeEntity(_0x4cffca,null))[_0xf545('0x22')](handleError(_0x4cffca,null));};exports[_0xf545('0x52')]=function(_0x52dada,_0xc8edf2,_0x4876f5){var _0x29f6bf={};var _0x240a76={};var _0x36a5f7;var _0x2e1dc6;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x52dada[_0xf545('0x51')]['id']}})['then'](handleEntityNotFound(_0xc8edf2,null))[_0xf545('0x2f')](function(_0x3773e9){if(_0x3773e9){_0x36a5f7=_0x3773e9;_0x240a76[_0xf545('0x36')]=_[_0xf545('0x37')](db[_0xf545('0x53')][_0xf545('0x35')]);_0x240a76[_0xf545('0x38')]=_['keys'](_0x52dada[_0xf545('0x38')]);_0x240a76[_0xf545('0x42')]=_[_0xf545('0x39')](_0x240a76[_0xf545('0x36')],_0x240a76[_0xf545('0x38')]);_0x29f6bf[_0xf545('0x3a')]=_[_0xf545('0x39')](_0x240a76[_0xf545('0x36')],qs[_0xf545('0x3b')](_0x52dada[_0xf545('0x38')][_0xf545('0x3b')]));_0x29f6bf[_0xf545('0x3a')]=_0x29f6bf['attributes'][_0xf545('0x3c')]?_0x29f6bf['attributes']:_0x240a76[_0xf545('0x36')];_0x29f6bf[_0xf545('0x3f')]=qs[_0xf545('0x40')](_0x52dada[_0xf545('0x38')][_0xf545('0x40')]);_0x29f6bf[_0xf545('0x44')]=qs[_0xf545('0x42')](_['pick'](_0x52dada[_0xf545('0x38')],_0x240a76[_0xf545('0x42')]));if(_0x52dada[_0xf545('0x38')][_0xf545('0x43')]){_0x29f6bf[_0xf545('0x44')]=_[_0xf545('0x48')](_0x29f6bf['where'],{'$or':_[_0xf545('0x45')](_0x29f6bf[_0xf545('0x3a')],function(_0xae1253){var _0x43c516={};_0x43c516[_0xae1253]={'$like':'%'+_0x52dada['query'][_0xf545('0x43')]+'%'};return _0x43c516;})});}_0x29f6bf=_[_0xf545('0x48')]({},_0x29f6bf,_0x52dada[_0xf545('0x4d')]);return _0x36a5f7[_0xf545('0x52')](_0x29f6bf);}})[_0xf545('0x2f')](function(_0x304fdb){if(_0x304fdb){_0x2e1dc6=_0x304fdb[_0xf545('0x3c')];if(!_0x52dada['query'][_0xf545('0x3d')](_0xf545('0x3e'))){_0x29f6bf[_0xf545('0x29')]=qs[_0xf545('0x29')](_0x52dada[_0xf545('0x38')][_0xf545('0x29')]);_0x29f6bf[_0xf545('0x28')]=qs[_0xf545('0x28')](_0x52dada[_0xf545('0x38')][_0xf545('0x28')]);}return _0x36a5f7[_0xf545('0x52')](_0x29f6bf);}})[_0xf545('0x2f')](function(_0xcb9a29){if(_0xcb9a29){return _0xcb9a29?{'count':_0x2e1dc6,'rows':_0xcb9a29}:null;}})['then'](respondWithResult(_0xc8edf2,null))[_0xf545('0x22')](handleError(_0xc8edf2,null));};exports[_0xf545('0x54')]=function(_0x329c03,_0x171d55,_0x2d52f3){var _0x399c51={};var _0x4734d2={};var _0xe59470;var _0xff6b67;return db[_0xf545('0x34')][_0xf545('0x55')]({'where':{'id':_0x329c03[_0xf545('0x51')]['id']}})[_0xf545('0x2f')](handleEntityNotFound(_0x171d55,null))[_0xf545('0x2f')](function(_0xa0a8dd){if(_0xa0a8dd){_0xe59470=_0xa0a8dd;_0x4734d2[_0xf545('0x36')]=_[_0xf545('0x37')](db[_0xf545('0x53')][_0xf545('0x35')]);_0x4734d2[_0xf545('0x38')]=_[_0xf545('0x37')](_0x329c03['query']);_0x4734d2[_0xf545('0x42')]=_[_0xf545('0x39')](_0x4734d2['model'],_0x4734d2[_0xf545('0x38')]);_0x399c51[_0xf545('0x3a')]=_[_0xf545('0x39')](_0x4734d2[_0xf545('0x36')],qs[_0xf545('0x3b')](_0x329c03[_0xf545('0x38')][_0xf545('0x3b')]));_0x399c51[_0xf545('0x3a')]=_0x399c51['attributes']['length']?_0x399c51[_0xf545('0x3a')]:_0x4734d2[_0xf545('0x36')];_0x399c51['order']=qs[_0xf545('0x40')](_0x329c03[_0xf545('0x38')]['sort']);_0x399c51[_0xf545('0x44')]=qs[_0xf545('0x42')](_['pick'](_0x329c03['query'],_0x4734d2[_0xf545('0x42')]));if(_0x329c03['query'][_0xf545('0x43')]){_0x399c51[_0xf545('0x44')]=_[_0xf545('0x48')](_0x399c51[_0xf545('0x44')],{'$or':_[_0xf545('0x45')](_0x399c51[_0xf545('0x3a')],function(_0x5494d9){var _0x25c8d0={};_0x25c8d0[_0x5494d9]={'$like':'%'+_0x329c03[_0xf545('0x38')][_0xf545('0x43')]+'%'};return _0x25c8d0;})});}_0x399c51=_[_0xf545('0x48')]({},_0x399c51,_0x329c03[_0xf545('0x4d')]);return _0xe59470[_0xf545('0x54')](_0x399c51);}})[_0xf545('0x2f')](function(_0x5136ff){if(_0x5136ff){_0xff6b67=_0x5136ff['length'];if(!_0x329c03['query'][_0xf545('0x3d')]('nolimit')){_0x399c51[_0xf545('0x29')]=qs['limit'](_0x329c03[_0xf545('0x38')][_0xf545('0x29')]);_0x399c51[_0xf545('0x28')]=qs[_0xf545('0x28')](_0x329c03['query'][_0xf545('0x28')]);}return _0xe59470['getSubjects'](_0x399c51);}})[_0xf545('0x2f')](function(_0x4f471d){if(_0x4f471d){return _0x4f471d?{'count':_0xff6b67,'rows':_0x4f471d}:null;}})[_0xf545('0x2f')](respondWithResult(_0x171d55,null))[_0xf545('0x22')](handleError(_0x171d55,null));};exports[_0xf545('0x56')]=function(_0x540042,_0x1b21ab,_0x4d44bb){var _0xb7bd5f={};var _0x245e74={};var _0x288124;var _0x4f17bc;return db['ZohoConfiguration'][_0xf545('0x55')]({'where':{'id':_0x540042[_0xf545('0x51')]['id']}})[_0xf545('0x2f')](handleEntityNotFound(_0x1b21ab,null))[_0xf545('0x2f')](function(_0x41693d){if(_0x41693d){_0x288124=_0x41693d;_0x245e74[_0xf545('0x36')]=_['keys'](db[_0xf545('0x53')][_0xf545('0x35')]);_0x245e74[_0xf545('0x38')]=_[_0xf545('0x37')](_0x540042['query']);_0x245e74[_0xf545('0x42')]=_['intersection'](_0x245e74['model'],_0x245e74[_0xf545('0x38')]);_0xb7bd5f[_0xf545('0x3a')]=_[_0xf545('0x39')](_0x245e74[_0xf545('0x36')],qs[_0xf545('0x3b')](_0x540042[_0xf545('0x38')][_0xf545('0x3b')]));_0xb7bd5f['attributes']=_0xb7bd5f[_0xf545('0x3a')]['length']?_0xb7bd5f[_0xf545('0x3a')]:_0x245e74[_0xf545('0x36')];_0xb7bd5f[_0xf545('0x3f')]=qs[_0xf545('0x40')](_0x540042[_0xf545('0x38')][_0xf545('0x40')]);_0xb7bd5f[_0xf545('0x44')]=qs[_0xf545('0x42')](_[_0xf545('0x41')](_0x540042['query'],_0x245e74['filters']));if(_0x540042['query'][_0xf545('0x43')]){_0xb7bd5f[_0xf545('0x44')]=_['merge'](_0xb7bd5f[_0xf545('0x44')],{'$or':_[_0xf545('0x45')](_0xb7bd5f[_0xf545('0x3a')],function(_0x2e5891){var _0x8af638={};_0x8af638[_0x2e5891]={'$like':'%'+_0x540042[_0xf545('0x38')][_0xf545('0x43')]+'%'};return _0x8af638;})});}_0xb7bd5f=_[_0xf545('0x48')]({},_0xb7bd5f,_0x540042[_0xf545('0x4d')]);return _0x288124['getDescriptions'](_0xb7bd5f);}})['then'](function(_0x217978){if(_0x217978){_0x4f17bc=_0x217978['length'];if(!_0x540042[_0xf545('0x38')]['hasOwnProperty'](_0xf545('0x3e'))){_0xb7bd5f[_0xf545('0x29')]=qs[_0xf545('0x29')](_0x540042['query'][_0xf545('0x29')]);_0xb7bd5f[_0xf545('0x28')]=qs['offset'](_0x540042['query'][_0xf545('0x28')]);}return _0x288124[_0xf545('0x56')](_0xb7bd5f);}})[_0xf545('0x2f')](function(_0x48d4db){if(_0x48d4db){return _0x48d4db?{'count':_0x4f17bc,'rows':_0x48d4db}:null;}})[_0xf545('0x2f')](respondWithResult(_0x1b21ab,null))[_0xf545('0x22')](handleError(_0x1b21ab,null));}; \ No newline at end of file +var _0x178a=['util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','request','then','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','stack','name','send','ZohoConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','filter','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','getFields','findOne','ZohoField','map','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x43fc79,_0x4c9eee){var _0x1aa4a6=function(_0x4077ed){while(--_0x4077ed){_0x43fc79['push'](_0x43fc79['shift']());}};_0x1aa4a6(++_0x4c9eee);}(_0x178a,0xff));var _0xa178=function(_0x1c0e9c,_0x1d02d7){_0x1c0e9c=_0x1c0e9c-0x0;var _0x3ed367=_0x178a[_0x1c0e9c];return _0x3ed367;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa178('0x0'));var rimraf=require(_0xa178('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa178('0x2'));var rp=require(_0xa178('0x3'));var moment=require(_0xa178('0x4'));var BPromise=require(_0xa178('0x5'));var Mustache=require('mustache');var util=require(_0xa178('0x6'));var path=require(_0xa178('0x7'));var sox=require(_0xa178('0x8'));var csv=require(_0xa178('0x9'));var ejs=require(_0xa178('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa178('0xb'));var crypto=require(_0xa178('0xc'));var jsforce=require(_0xa178('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa178('0x9'));var querystring=require(_0xa178('0xe'));var Papa=require(_0xa178('0xf'));var authService=require(_0xa178('0x10'));var hardwareService=require(_0xa178('0x11'));var Redis=require(_0xa178('0x12'));var qs=require(_0xa178('0x13'));var logger=require(_0xa178('0x14'))(_0xa178('0x15'));var utils=require('../../config/utils');var config=require(_0xa178('0x16'));var db=require(_0xa178('0x17'))['db'];var jayson=require(_0xa178('0x18'));var client=jayson['client'][_0xa178('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x49f51d,_0x24eb46,_0x50131d,_0x185719){return new BPromise(function(_0x138a36,_0x230523){var _0x543c80=_0x185719||client;return _0x543c80[_0xa178('0x1a')](_0x49f51d,_0x50131d)[_0xa178('0x1b')](function(_0x3643a4){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x24eb46,_0xa178('0x1c'));logger[_0xa178('0x1d')](_0xa178('0x1e'),_0x24eb46,'request\x20sent',JSON[_0xa178('0x1f')](_0x3643a4));if(_0x3643a4['error']){if(_0x3643a4[_0xa178('0x20')][_0xa178('0x21')]===0x1f4){logger[_0xa178('0x20')](_0xa178('0x22'),_0x24eb46,_0x3643a4['error'][_0xa178('0x23')]);return _0x230523(_0x3643a4['error'][_0xa178('0x23')]);}logger[_0xa178('0x20')](_0xa178('0x22'),_0x24eb46,_0x3643a4[_0xa178('0x20')][_0xa178('0x23')]);return _0x138a36(_0x3643a4['error'][_0xa178('0x23')]);}else{logger['info'](_0xa178('0x22'),_0x24eb46,_0xa178('0x1c'));_0x138a36(_0x3643a4['result']['message']);}})['catch'](function(_0x530cf4){logger[_0xa178('0x20')](_0xa178('0x22'),_0x24eb46,_0x530cf4);_0x230523(_0x530cf4);});});}function respondWithStatusCode(_0x5598fa,_0x59fa11){_0x59fa11=_0x59fa11||0xcc;return function(_0x51bc4d){if(_0x51bc4d){return _0x5598fa[_0xa178('0x24')](_0x59fa11);}return _0x5598fa[_0xa178('0x25')](_0x59fa11)[_0xa178('0x26')]();};}function respondWithResult(_0x165e79,_0x32d770){_0x32d770=_0x32d770||0xc8;return function(_0x48e9b){if(_0x48e9b){return _0x165e79[_0xa178('0x25')](_0x32d770)['json'](_0x48e9b);}};}function respondWithFilteredResult(_0xd7483d,_0x34e7eb){return function(_0xb24738){if(_0xb24738){var _0x5bf7bd=_0xb24738[_0xa178('0x27')],_0x536d9f=_0x34e7eb[_0xa178('0x28')],_0x3dae6c=_0x34e7eb[_0xa178('0x28')]+_0x34e7eb[_0xa178('0x29')],_0x2b1e12;if(_0x3dae6c>=_0x5bf7bd){_0x3dae6c=_0x5bf7bd;_0x2b1e12=0xc8;}else{_0x2b1e12=0xce;}_0xd7483d['status'](_0x2b1e12);return _0xd7483d[_0xa178('0x2a')](_0xa178('0x2b'),_0x536d9f+'-'+_0x3dae6c+'/'+_0x5bf7bd)[_0xa178('0x2c')](_0xb24738);}return null;};}function patchUpdates(_0x5adb70){return function(_0x2ce9cb){try{jsonpatch['apply'](_0x2ce9cb,_0x5adb70,!![]);}catch(_0x18c4a1){return BPromise[_0xa178('0x2d')](_0x18c4a1);}return _0x2ce9cb[_0xa178('0x2e')]();};}function saveUpdates(_0x10c55c,_0x1b0fc3){return function(_0x56a26d){if(_0x56a26d){return _0x56a26d['update'](_0x10c55c)[_0xa178('0x1b')](function(_0x5d8741){return _0x5d8741;});}return null;};}function removeEntity(_0x24b6c7,_0x84d81b){return function(_0x581634){if(_0x581634){return _0x581634['destroy']()[_0xa178('0x1b')](function(){_0x24b6c7[_0xa178('0x25')](0xcc)[_0xa178('0x26')]();});}};}function handleEntityNotFound(_0x8708ed,_0x29c50a){return function(_0x23b401){if(!_0x23b401){_0x8708ed[_0xa178('0x24')](0x194);}return _0x23b401;};}function handleError(_0x5a9d2c,_0x525c61){_0x525c61=_0x525c61||0x1f4;return function(_0x5f52e7){logger[_0xa178('0x20')](_0x5f52e7[_0xa178('0x2f')]);if(_0x5f52e7[_0xa178('0x30')]){delete _0x5f52e7[_0xa178('0x30')];}_0x5a9d2c[_0xa178('0x25')](_0x525c61)[_0xa178('0x31')](_0x5f52e7);};}exports['index']=function(_0x5de012,_0x25ef87){var _0x1c474a={},_0x2c58ea={},_0x29db87={'count':0x0,'rows':[]};var _0x436a90=db[_0xa178('0x32')][_0xa178('0x33')];_0x2c58ea[_0xa178('0x34')]=_[_0xa178('0x35')](_0x436a90);_0x2c58ea[_0xa178('0x36')]=_[_0xa178('0x35')](_0x5de012['query']);_0x2c58ea[_0xa178('0x37')]=_[_0xa178('0x38')](_0x2c58ea[_0xa178('0x34')],_0x2c58ea[_0xa178('0x36')]);_0x1c474a[_0xa178('0x39')]=_['intersection'](_0x2c58ea[_0xa178('0x34')],qs[_0xa178('0x3a')](_0x5de012[_0xa178('0x36')][_0xa178('0x3a')]));_0x1c474a[_0xa178('0x39')]=_0x1c474a[_0xa178('0x39')]['length']?_0x1c474a['attributes']:_0x2c58ea[_0xa178('0x34')];if(!_0x5de012[_0xa178('0x36')][_0xa178('0x3b')](_0xa178('0x3c'))){_0x1c474a[_0xa178('0x29')]=qs[_0xa178('0x29')](_0x5de012[_0xa178('0x36')][_0xa178('0x29')]);_0x1c474a[_0xa178('0x28')]=qs[_0xa178('0x28')](_0x5de012[_0xa178('0x36')]['offset']);}_0x1c474a[_0xa178('0x3d')]=qs[_0xa178('0x3e')](_0x5de012[_0xa178('0x36')][_0xa178('0x3e')]);_0x1c474a[_0xa178('0x3f')]=qs[_0xa178('0x37')](_[_0xa178('0x40')](_0x5de012[_0xa178('0x36')],_0x2c58ea[_0xa178('0x37')]));if(_0x5de012[_0xa178('0x36')]['filter']){_0x1c474a[_0xa178('0x3f')]=_[_0xa178('0x41')](_0x1c474a[_0xa178('0x3f')],{'$or':_['map'](_0x436a90,function(_0x1831b6){if(_0x1831b6['type'][_0xa178('0x42')]!=='VIRTUAL'){var _0x4585b8={};_0x4585b8[_0x1831b6['field']]={'$like':'%'+_0x5de012['query'][_0xa178('0x43')]+'%'};return _0x4585b8;}})});}_0x1c474a=_[_0xa178('0x41')]({},_0x1c474a,_0x5de012['options']);var _0x1fdb13={'where':_0x1c474a[_0xa178('0x3f')]};return db[_0xa178('0x32')][_0xa178('0x27')](_0x1fdb13)[_0xa178('0x1b')](function(_0x59d1e5){_0x29db87[_0xa178('0x27')]=_0x59d1e5;if(_0x5de012[_0xa178('0x36')][_0xa178('0x44')]){_0x1c474a[_0xa178('0x45')]=[{'all':!![]}];}return db[_0xa178('0x32')][_0xa178('0x46')](_0x1c474a);})[_0xa178('0x1b')](function(_0x43c3f7){_0x29db87[_0xa178('0x47')]=_0x43c3f7;return _0x29db87;})['then'](respondWithFilteredResult(_0x25ef87,_0x1c474a))[_0xa178('0x48')](handleError(_0x25ef87,null));};exports[_0xa178('0x49')]=function(_0x5efb90,_0x35d92b){var _0x27cb86={'raw':![],'where':{'id':_0x5efb90[_0xa178('0x4a')]['id']}},_0x38e3f7={};_0x38e3f7['model']=_['keys'](db[_0xa178('0x32')][_0xa178('0x33')]);_0x38e3f7[_0xa178('0x36')]=_[_0xa178('0x35')](_0x5efb90[_0xa178('0x36')]);_0x38e3f7[_0xa178('0x37')]=_[_0xa178('0x38')](_0x38e3f7[_0xa178('0x34')],_0x38e3f7['query']);_0x27cb86[_0xa178('0x39')]=_[_0xa178('0x38')](_0x38e3f7[_0xa178('0x34')],qs[_0xa178('0x3a')](_0x5efb90[_0xa178('0x36')]['fields']));_0x27cb86[_0xa178('0x39')]=_0x27cb86[_0xa178('0x39')][_0xa178('0x4b')]?_0x27cb86[_0xa178('0x39')]:_0x38e3f7[_0xa178('0x34')];if(_0x5efb90[_0xa178('0x36')][_0xa178('0x44')]){_0x27cb86[_0xa178('0x45')]=[{'all':!![]}];}_0x27cb86=_[_0xa178('0x41')]({},_0x27cb86,_0x5efb90[_0xa178('0x4c')]);return db[_0xa178('0x32')][_0xa178('0x4d')](_0x27cb86)[_0xa178('0x1b')](handleEntityNotFound(_0x35d92b,null))['then'](respondWithResult(_0x35d92b,null))[_0xa178('0x48')](handleError(_0x35d92b,null));};exports[_0xa178('0x4e')]=function(_0x1af695,_0x4018b9){return db[_0xa178('0x32')][_0xa178('0x4e')](_0x1af695['body'],{})[_0xa178('0x1b')](respondWithResult(_0x4018b9,0xc9))[_0xa178('0x48')](handleError(_0x4018b9,null));};exports['update']=function(_0x418f9c,_0x2fa9c7){if(_0x418f9c[_0xa178('0x4f')]['id']){delete _0x418f9c[_0xa178('0x4f')]['id'];}return db[_0xa178('0x32')]['find']({'where':{'id':_0x418f9c[_0xa178('0x4a')]['id']}})[_0xa178('0x1b')](handleEntityNotFound(_0x2fa9c7,null))[_0xa178('0x1b')](saveUpdates(_0x418f9c['body'],null))[_0xa178('0x1b')](respondWithResult(_0x2fa9c7,null))[_0xa178('0x48')](handleError(_0x2fa9c7,null));};exports[_0xa178('0x50')]=function(_0x2eb0e2,_0x1364ec){return db[_0xa178('0x32')]['find']({'where':{'id':_0x2eb0e2[_0xa178('0x4a')]['id']}})[_0xa178('0x1b')](handleEntityNotFound(_0x1364ec,null))[_0xa178('0x1b')](removeEntity(_0x1364ec,null))[_0xa178('0x48')](handleError(_0x1364ec,null));};exports[_0xa178('0x51')]=function(_0x25395d,_0x1fdabe,_0x40f34a){var _0x35670c={};var _0x439339={};var _0x57326e;var _0x2506bc;return db[_0xa178('0x32')][_0xa178('0x52')]({'where':{'id':_0x25395d['params']['id']}})[_0xa178('0x1b')](handleEntityNotFound(_0x1fdabe,null))[_0xa178('0x1b')](function(_0x5b33f0){if(_0x5b33f0){_0x57326e=_0x5b33f0;_0x439339[_0xa178('0x34')]=_['keys'](db[_0xa178('0x53')][_0xa178('0x33')]);_0x439339[_0xa178('0x36')]=_['keys'](_0x25395d['query']);_0x439339[_0xa178('0x37')]=_[_0xa178('0x38')](_0x439339[_0xa178('0x34')],_0x439339['query']);_0x35670c[_0xa178('0x39')]=_[_0xa178('0x38')](_0x439339['model'],qs[_0xa178('0x3a')](_0x25395d[_0xa178('0x36')]['fields']));_0x35670c[_0xa178('0x39')]=_0x35670c[_0xa178('0x39')][_0xa178('0x4b')]?_0x35670c['attributes']:_0x439339['model'];_0x35670c['order']=qs[_0xa178('0x3e')](_0x25395d['query'][_0xa178('0x3e')]);_0x35670c['where']=qs[_0xa178('0x37')](_['pick'](_0x25395d['query'],_0x439339[_0xa178('0x37')]));if(_0x25395d['query'][_0xa178('0x43')]){_0x35670c[_0xa178('0x3f')]=_[_0xa178('0x41')](_0x35670c[_0xa178('0x3f')],{'$or':_[_0xa178('0x54')](_0x35670c[_0xa178('0x39')],function(_0x46e3f9){var _0x3743e5={};_0x3743e5[_0x46e3f9]={'$like':'%'+_0x25395d[_0xa178('0x36')][_0xa178('0x43')]+'%'};return _0x3743e5;})});}_0x35670c=_[_0xa178('0x41')]({},_0x35670c,_0x25395d[_0xa178('0x4c')]);return _0x57326e[_0xa178('0x51')](_0x35670c);}})[_0xa178('0x1b')](function(_0x247fe0){if(_0x247fe0){_0x2506bc=_0x247fe0[_0xa178('0x4b')];if(!_0x25395d['query'][_0xa178('0x3b')](_0xa178('0x3c'))){_0x35670c[_0xa178('0x29')]=qs[_0xa178('0x29')](_0x25395d[_0xa178('0x36')][_0xa178('0x29')]);_0x35670c[_0xa178('0x28')]=qs[_0xa178('0x28')](_0x25395d[_0xa178('0x36')][_0xa178('0x28')]);}return _0x57326e['getFields'](_0x35670c);}})[_0xa178('0x1b')](function(_0x283095){if(_0x283095){return _0x283095?{'count':_0x2506bc,'rows':_0x283095}:null;}})[_0xa178('0x1b')](respondWithResult(_0x1fdabe,null))[_0xa178('0x48')](handleError(_0x1fdabe,null));};exports['getSubjects']=function(_0x1d4761,_0x5dddd0,_0x3c102d){var _0x1614fa={};var _0xe1a702={};var _0x53b543;var _0x41c461;return db[_0xa178('0x32')][_0xa178('0x52')]({'where':{'id':_0x1d4761[_0xa178('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5dddd0,null))[_0xa178('0x1b')](function(_0x5a922b){if(_0x5a922b){_0x53b543=_0x5a922b;_0xe1a702[_0xa178('0x34')]=_[_0xa178('0x35')](db['ZohoField'][_0xa178('0x33')]);_0xe1a702[_0xa178('0x36')]=_[_0xa178('0x35')](_0x1d4761[_0xa178('0x36')]);_0xe1a702[_0xa178('0x37')]=_[_0xa178('0x38')](_0xe1a702[_0xa178('0x34')],_0xe1a702[_0xa178('0x36')]);_0x1614fa[_0xa178('0x39')]=_['intersection'](_0xe1a702[_0xa178('0x34')],qs[_0xa178('0x3a')](_0x1d4761['query'][_0xa178('0x3a')]));_0x1614fa[_0xa178('0x39')]=_0x1614fa[_0xa178('0x39')][_0xa178('0x4b')]?_0x1614fa['attributes']:_0xe1a702[_0xa178('0x34')];_0x1614fa['order']=qs[_0xa178('0x3e')](_0x1d4761['query']['sort']);_0x1614fa[_0xa178('0x3f')]=qs[_0xa178('0x37')](_[_0xa178('0x40')](_0x1d4761[_0xa178('0x36')],_0xe1a702['filters']));if(_0x1d4761[_0xa178('0x36')]['filter']){_0x1614fa[_0xa178('0x3f')]=_[_0xa178('0x41')](_0x1614fa['where'],{'$or':_[_0xa178('0x54')](_0x1614fa[_0xa178('0x39')],function(_0x2f42dd){var _0x4894be={};_0x4894be[_0x2f42dd]={'$like':'%'+_0x1d4761[_0xa178('0x36')][_0xa178('0x43')]+'%'};return _0x4894be;})});}_0x1614fa=_[_0xa178('0x41')]({},_0x1614fa,_0x1d4761['options']);return _0x53b543[_0xa178('0x55')](_0x1614fa);}})[_0xa178('0x1b')](function(_0x5eed43){if(_0x5eed43){_0x41c461=_0x5eed43[_0xa178('0x4b')];if(!_0x1d4761[_0xa178('0x36')]['hasOwnProperty'](_0xa178('0x3c'))){_0x1614fa[_0xa178('0x29')]=qs[_0xa178('0x29')](_0x1d4761[_0xa178('0x36')][_0xa178('0x29')]);_0x1614fa[_0xa178('0x28')]=qs['offset'](_0x1d4761[_0xa178('0x36')]['offset']);}return _0x53b543[_0xa178('0x55')](_0x1614fa);}})['then'](function(_0x40830b){if(_0x40830b){return _0x40830b?{'count':_0x41c461,'rows':_0x40830b}:null;}})['then'](respondWithResult(_0x5dddd0,null))['catch'](handleError(_0x5dddd0,null));};exports[_0xa178('0x56')]=function(_0x476ac6,_0x1f0463,_0x299a58){var _0xf279={};var _0x37ccfe={};var _0x3fcdbd;var _0x30a401;return db['ZohoConfiguration'][_0xa178('0x52')]({'where':{'id':_0x476ac6[_0xa178('0x4a')]['id']}})[_0xa178('0x1b')](handleEntityNotFound(_0x1f0463,null))[_0xa178('0x1b')](function(_0x496cd3){if(_0x496cd3){_0x3fcdbd=_0x496cd3;_0x37ccfe['model']=_[_0xa178('0x35')](db[_0xa178('0x53')]['rawAttributes']);_0x37ccfe[_0xa178('0x36')]=_['keys'](_0x476ac6[_0xa178('0x36')]);_0x37ccfe[_0xa178('0x37')]=_[_0xa178('0x38')](_0x37ccfe[_0xa178('0x34')],_0x37ccfe[_0xa178('0x36')]);_0xf279[_0xa178('0x39')]=_[_0xa178('0x38')](_0x37ccfe[_0xa178('0x34')],qs[_0xa178('0x3a')](_0x476ac6[_0xa178('0x36')][_0xa178('0x3a')]));_0xf279[_0xa178('0x39')]=_0xf279[_0xa178('0x39')][_0xa178('0x4b')]?_0xf279['attributes']:_0x37ccfe[_0xa178('0x34')];_0xf279[_0xa178('0x3d')]=qs[_0xa178('0x3e')](_0x476ac6[_0xa178('0x36')][_0xa178('0x3e')]);_0xf279['where']=qs[_0xa178('0x37')](_[_0xa178('0x40')](_0x476ac6[_0xa178('0x36')],_0x37ccfe[_0xa178('0x37')]));if(_0x476ac6[_0xa178('0x36')][_0xa178('0x43')]){_0xf279['where']=_['merge'](_0xf279['where'],{'$or':_[_0xa178('0x54')](_0xf279['attributes'],function(_0x36c530){var _0x3dc756={};_0x3dc756[_0x36c530]={'$like':'%'+_0x476ac6[_0xa178('0x36')][_0xa178('0x43')]+'%'};return _0x3dc756;})});}_0xf279=_[_0xa178('0x41')]({},_0xf279,_0x476ac6['options']);return _0x3fcdbd[_0xa178('0x56')](_0xf279);}})[_0xa178('0x1b')](function(_0x1b03fe){if(_0x1b03fe){_0x30a401=_0x1b03fe['length'];if(!_0x476ac6[_0xa178('0x36')][_0xa178('0x3b')](_0xa178('0x3c'))){_0xf279[_0xa178('0x29')]=qs[_0xa178('0x29')](_0x476ac6[_0xa178('0x36')][_0xa178('0x29')]);_0xf279[_0xa178('0x28')]=qs[_0xa178('0x28')](_0x476ac6[_0xa178('0x36')]['offset']);}return _0x3fcdbd[_0xa178('0x56')](_0xf279);}})[_0xa178('0x1b')](function(_0x3ba2f8){if(_0x3ba2f8){return _0x3ba2f8?{'count':_0x30a401,'rows':_0x3ba2f8}:null;}})[_0xa178('0x1b')](respondWithResult(_0x1f0463,null))['catch'](handleError(_0x1f0463,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 2e5ee2f..b19d6d5 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 _0xa216=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x489ac6,_0x913ba4){var _0x2088cc=function(_0x2429c5){while(--_0x2429c5){_0x489ac6['push'](_0x489ac6['shift']());}};_0x2088cc(++_0x913ba4);}(_0xa216,0xf4));var _0x6a21=function(_0x29df5d,_0x4dbd4f){_0x29df5d=_0x29df5d-0x0;var _0x10d79c=_0xa216[_0x29df5d];return _0x10d79c;};'use strict';var _=require('lodash');var util=require(_0x6a21('0x0'));var logger=require(_0x6a21('0x1'))(_0x6a21('0x2'));var moment=require(_0x6a21('0x3'));var BPromise=require(_0x6a21('0x4'));var rp=require(_0x6a21('0x5'));var attributes=require(_0x6a21('0x6'));module[_0x6a21('0x7')]=function(_0x1e0eee,_0x58e6f4){return _0x1e0eee[_0x6a21('0x8')](_0x6a21('0x9'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x502a=['lodash','util','api','moment','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x5cfb48,_0x174bf4){var _0xc7b421=function(_0x1e44a4){while(--_0x1e44a4){_0x5cfb48['push'](_0x5cfb48['shift']());}};_0xc7b421(++_0x174bf4);}(_0x502a,0xd8));var _0xa502=function(_0x5df285,_0xee1d75){_0x5df285=_0x5df285-0x0;var _0xe34ae=_0x502a[_0x5df285];return _0xe34ae;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var logger=require('../../config/logger')(_0xa502('0x2'));var moment=require(_0xa502('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xa502('0x4'));module['exports']=function(_0x13ee72,_0x437bb8){return _0x13ee72[_0xa502('0x5')](_0xa502('0x6'),attributes,{'tableName':_0xa502('0x7'),'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 ae6b605..6f66574 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 _0x8d0b=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','ZohoConfiguration,\x20%s,\x20%s','message'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0x8d0b,0x70));var _0xb8d0=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x8d0b[_0xc67528];return _0x38e26d;};'use strict';var _=require('lodash');var util=require(_0xb8d0('0x0'));var moment=require(_0xb8d0('0x1'));var BPromise=require(_0xb8d0('0x2'));var rs=require(_0xb8d0('0x3'));var fs=require('fs');var Redis=require(_0xb8d0('0x4'));var db=require(_0xb8d0('0x5'))['db'];var utils=require(_0xb8d0('0x6'));var logger=require(_0xb8d0('0x7'))(_0xb8d0('0x8'));var config=require('../../config/environment');var jayson=require(_0xb8d0('0x9'));var client=jayson[_0xb8d0('0xa')][_0xb8d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x319345,_0x3f278b,_0xbe79ce){return new BPromise(function(_0xb992ee,_0x4cf366){return client[_0xb8d0('0xc')](_0x319345,_0xbe79ce)['then'](function(_0x36c597){logger[_0xb8d0('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f278b,_0xb8d0('0xe'));logger[_0xb8d0('0xf')](_0xb8d0('0x10'),_0x3f278b,_0xb8d0('0xe'),JSON['stringify'](_0x36c597));if(_0x36c597[_0xb8d0('0x11')]){if(_0x36c597[_0xb8d0('0x11')]['code']===0x1f4){logger['error'](_0xb8d0('0x12'),_0x3f278b,_0x36c597[_0xb8d0('0x11')][_0xb8d0('0x13')]);return _0x4cf366(_0x36c597[_0xb8d0('0x11')]['message']);}logger[_0xb8d0('0x11')](_0xb8d0('0x12'),_0x3f278b,_0x36c597['error'][_0xb8d0('0x13')]);return _0xb992ee(_0x36c597[_0xb8d0('0x11')]['message']);}else{logger[_0xb8d0('0xd')](_0xb8d0('0x12'),_0x3f278b,_0xb8d0('0xe'));_0xb992ee(_0x36c597[_0xb8d0('0x14')][_0xb8d0('0x13')]);}})[_0xb8d0('0x15')](function(_0x50e64f){logger[_0xb8d0('0x11')](_0xb8d0('0x12'),_0x3f278b,_0x50e64f);_0x4cf366(_0x50e64f);});});} \ No newline at end of file +var _0x0706=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0x15cae6,_0x12badf){var _0x5da1fd=function(_0x48127d){while(--_0x48127d){_0x15cae6['push'](_0x15cae6['shift']());}};_0x5da1fd(++_0x12badf);}(_0x0706,0x127));var _0x6070=function(_0x39745b,_0x28f20f){_0x39745b=_0x39745b-0x0;var _0x4259bf=_0x0706[_0x39745b];return _0x4259bf;};'use strict';var _=require(_0x6070('0x0'));var util=require(_0x6070('0x1'));var moment=require(_0x6070('0x2'));var BPromise=require('bluebird');var rs=require(_0x6070('0x3'));var fs=require('fs');var Redis=require(_0x6070('0x4'));var db=require(_0x6070('0x5'))['db'];var utils=require(_0x6070('0x6'));var logger=require(_0x6070('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6070('0x8'));var client=jayson[_0x6070('0x9')][_0x6070('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23138a,_0x2915c7,_0x112b46){return new BPromise(function(_0x1d60a6,_0x3f8565){return client[_0x6070('0xb')](_0x23138a,_0x112b46)[_0x6070('0xc')](function(_0xedb27){logger[_0x6070('0xd')](_0x6070('0xe'),_0x2915c7,_0x6070('0xf'));logger[_0x6070('0x10')](_0x6070('0x11'),_0x2915c7,_0x6070('0xf'),JSON[_0x6070('0x12')](_0xedb27));if(_0xedb27[_0x6070('0x13')]){if(_0xedb27[_0x6070('0x13')]['code']===0x1f4){logger[_0x6070('0x13')](_0x6070('0xe'),_0x2915c7,_0xedb27[_0x6070('0x13')][_0x6070('0x14')]);return _0x3f8565(_0xedb27[_0x6070('0x13')][_0x6070('0x14')]);}logger[_0x6070('0x13')](_0x6070('0xe'),_0x2915c7,_0xedb27[_0x6070('0x13')][_0x6070('0x14')]);return _0x1d60a6(_0xedb27[_0x6070('0x13')]['message']);}else{logger['info'](_0x6070('0xe'),_0x2915c7,_0x6070('0xf'));_0x1d60a6(_0xedb27[_0x6070('0x15')][_0x6070('0x14')]);}})[_0x6070('0x16')](function(_0x368cc9){logger['error'](_0x6070('0xe'),_0x2915c7,_0x368cc9);_0x3f8565(_0x368cc9);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 6ed6072..3eb59c9 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 _0xe801=['show','isAuthenticated','destroy','util','path','../../components/auth/service','../../config/environment','./intZohoField.controller','get','index','/:id'];(function(_0x37cd9a,_0x5b1850){var _0xce24d7=function(_0x5e3150){while(--_0x5e3150){_0x37cd9a['push'](_0x37cd9a['shift']());}};_0xce24d7(++_0x5b1850);}(_0xe801,0x16e));var _0x1e80=function(_0x376551,_0x58a3ce){_0x376551=_0x376551-0x0;var _0x2b76c6=_0xe801[_0x376551];return _0x2b76c6;};'use strict';var multer=require('multer');var util=require(_0x1e80('0x0'));var path=require(_0x1e80('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x1e80('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x1e80('0x3'));var controller=require(_0x1e80('0x4'));router[_0x1e80('0x5')]('/',auth['isAuthenticated'](),controller[_0x1e80('0x6')]);router[_0x1e80('0x5')](_0x1e80('0x7'),auth['isAuthenticated'](),controller[_0x1e80('0x8')]);router['post']('/',auth[_0x1e80('0x9')](),controller['create']);router['put'](_0x1e80('0x7'),auth[_0x1e80('0x9')](),controller['update']);router['delete'](_0x1e80('0x7'),auth['isAuthenticated'](),controller[_0x1e80('0xa')]);module['exports']=router; \ No newline at end of file +var _0xbf45=['multer','util','path','Router','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x25d020,_0x1ea8ef){var _0x1d2d88=function(_0x11add3){while(--_0x11add3){_0x25d020['push'](_0x25d020['shift']());}};_0x1d2d88(++_0x1ea8ef);}(_0xbf45,0x1a9));var _0x5bf4=function(_0x52bdf5,_0x1f5684){_0x52bdf5=_0x52bdf5-0x0;var _0x1c10d7=_0xbf45[_0x52bdf5];return _0x1c10d7;};'use strict';var multer=require(_0x5bf4('0x0'));var util=require(_0x5bf4('0x1'));var path=require(_0x5bf4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5bf4('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5bf4('0x4'));var controller=require('./intZohoField.controller');router[_0x5bf4('0x5')]('/',auth[_0x5bf4('0x6')](),controller[_0x5bf4('0x7')]);router[_0x5bf4('0x5')](_0x5bf4('0x8'),auth[_0x5bf4('0x6')](),controller[_0x5bf4('0x9')]);router[_0x5bf4('0xa')]('/',auth[_0x5bf4('0x6')](),controller[_0x5bf4('0xb')]);router[_0x5bf4('0xc')](_0x5bf4('0x8'),auth[_0x5bf4('0x6')](),controller[_0x5bf4('0xd')]);router[_0x5bf4('0xe')]('/:id',auth[_0x5bf4('0x6')](),controller[_0x5bf4('0xf')]);module[_0x5bf4('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index d7f0ced..223e6a1 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 _0x55e0=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x1aed01,_0x3b59f3){var _0x34ccb8=function(_0x1420db){while(--_0x1420db){_0x1aed01['push'](_0x1aed01['shift']());}};_0x34ccb8(++_0x3b59f3);}(_0x55e0,0xdc));var _0x055e=function(_0x5100ab,_0x189cbf){_0x5100ab=_0x5100ab-0x0;var _0xd09579=_0x55e0[_0x5100ab];return _0xd09579;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'type':{'type':Sequelize[_0x055e('0x2')](_0x055e('0x3'),'variable','customVariable',_0x055e('0x4')),'defaultValue':_0x055e('0x3')},'content':{'type':Sequelize[_0x055e('0x5')]},'key':{'type':Sequelize[_0x055e('0x5')]},'keyType':{'type':Sequelize[_0x055e('0x2')](_0x055e('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x055e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x055e('0x5')]},'customField':{'type':Sequelize[_0x055e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x055e('0x5')]}}; \ No newline at end of file +var _0xe5b5=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x239b31,_0x44a64d){_0x239b31=_0x239b31-0x0;var _0x41c8be=_0xe5b5[_0x239b31];return _0x41c8be;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'type':{'type':Sequelize[_0x5e5b('0x2')](_0x5e5b('0x3'),_0x5e5b('0x4'),_0x5e5b('0x5'),_0x5e5b('0x6')),'defaultValue':_0x5e5b('0x3')},'content':{'type':Sequelize[_0x5e5b('0x7')]},'key':{'type':Sequelize[_0x5e5b('0x7')]},'keyType':{'type':Sequelize[_0x5e5b('0x2')](_0x5e5b('0x3'),_0x5e5b('0x4'),_0x5e5b('0x5'))},'keyContent':{'type':Sequelize[_0x5e5b('0x7')]},'idField':{'type':Sequelize[_0x5e5b('0x7')]},'nameField':{'type':Sequelize[_0x5e5b('0x7')]},'customField':{'type':Sequelize[_0x5e5b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5e5b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index cb9929e..6d43a12 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 _0xf115=['error','stack','name','send','ZohoField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','end'];(function(_0x221c80,_0x1e0608){var _0x30b7e5=function(_0x4ea206){while(--_0x4ea206){_0x221c80['push'](_0x221c80['shift']());}};_0x30b7e5(++_0x1e0608);}(_0xf115,0x183));var _0x5f11=function(_0x5363a1,_0x41f3bf){_0x5363a1=_0x5363a1-0x0;var _0x481518=_0xf115[_0x5363a1];return _0x481518;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5f11('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f11('0x1'));var jsonpatch=require(_0x5f11('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5f11('0x3'));var path=require('path');var sox=require(_0x5f11('0x4'));var csv=require(_0x5f11('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5f11('0x6'));var squel=require('squel');var crypto=require(_0x5f11('0x7'));var jsforce=require(_0x5f11('0x8'));var deskjs=require(_0x5f11('0x9'));var toCsv=require(_0x5f11('0x5'));var querystring=require(_0x5f11('0xa'));var Papa=require(_0x5f11('0xb'));var authService=require(_0x5f11('0xc'));var hardwareService=require(_0x5f11('0xd'));var Redis=require(_0x5f11('0xe'));var qs=require(_0x5f11('0xf'));var logger=require(_0x5f11('0x10'))(_0x5f11('0x11'));var utils=require(_0x5f11('0x12'));var config=require(_0x5f11('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xff3b01,_0x235319){_0x235319=_0x235319||0xcc;return function(_0x268f34){if(_0x268f34){return _0xff3b01[_0x5f11('0x14')](_0x235319);}return _0xff3b01[_0x5f11('0x15')](_0x235319)['end']();};}function respondWithResult(_0x2674af,_0x23e63c){_0x23e63c=_0x23e63c||0xc8;return function(_0x54bb90){if(_0x54bb90){return _0x2674af[_0x5f11('0x15')](_0x23e63c)[_0x5f11('0x16')](_0x54bb90);}};}function respondWithFilteredResult(_0x24140a,_0x48d75c){return function(_0xa37b9d){if(_0xa37b9d){var _0x23954a=_0xa37b9d[_0x5f11('0x17')],_0x4bf51a=_0x48d75c['offset'],_0x24c432=_0x48d75c[_0x5f11('0x18')]+_0x48d75c[_0x5f11('0x19')],_0x1390e0;if(_0x24c432>=_0x23954a){_0x24c432=_0x23954a;_0x1390e0=0xc8;}else{_0x1390e0=0xce;}_0x24140a[_0x5f11('0x15')](_0x1390e0);return _0x24140a[_0x5f11('0x1a')]('Content-Range',_0x4bf51a+'-'+_0x24c432+'/'+_0x23954a)[_0x5f11('0x16')](_0xa37b9d);}return null;};}function patchUpdates(_0x204193){return function(_0x5dfd10){try{jsonpatch[_0x5f11('0x1b')](_0x5dfd10,_0x204193,!![]);}catch(_0x160aed){return BPromise[_0x5f11('0x1c')](_0x160aed);}return _0x5dfd10[_0x5f11('0x1d')]();};}function saveUpdates(_0x564817,_0x58acea){return function(_0x44103d){if(_0x44103d){return _0x44103d[_0x5f11('0x1e')](_0x564817)[_0x5f11('0x1f')](function(_0x3b38e8){return _0x3b38e8;});}return null;};}function removeEntity(_0x5f4cdd,_0x357193){return function(_0x10e3d1){if(_0x10e3d1){return _0x10e3d1['destroy']()[_0x5f11('0x1f')](function(){_0x5f4cdd[_0x5f11('0x15')](0xcc)[_0x5f11('0x20')]();});}};}function handleEntityNotFound(_0x5cd8d2,_0x4f544f){return function(_0x4654bb){if(!_0x4654bb){_0x5cd8d2['sendStatus'](0x194);}return _0x4654bb;};}function handleError(_0x40d616,_0x50e420){_0x50e420=_0x50e420||0x1f4;return function(_0xeac46d){logger[_0x5f11('0x21')](_0xeac46d[_0x5f11('0x22')]);if(_0xeac46d['name']){delete _0xeac46d[_0x5f11('0x23')];}_0x40d616[_0x5f11('0x15')](_0x50e420)[_0x5f11('0x24')](_0xeac46d);};}exports['index']=function(_0x18e40a,_0x2524e0){var _0x2c3439={},_0x2d54af={},_0x4bf696={'count':0x0,'rows':[]};var _0x2f70cf=db[_0x5f11('0x25')][_0x5f11('0x26')];_0x2d54af[_0x5f11('0x27')]=_[_0x5f11('0x28')](_0x2f70cf);_0x2d54af[_0x5f11('0x29')]=_[_0x5f11('0x28')](_0x18e40a[_0x5f11('0x29')]);_0x2d54af[_0x5f11('0x2a')]=_[_0x5f11('0x2b')](_0x2d54af['model'],_0x2d54af[_0x5f11('0x29')]);_0x2c3439[_0x5f11('0x2c')]=_[_0x5f11('0x2b')](_0x2d54af[_0x5f11('0x27')],qs[_0x5f11('0x2d')](_0x18e40a[_0x5f11('0x29')]['fields']));_0x2c3439[_0x5f11('0x2c')]=_0x2c3439[_0x5f11('0x2c')]['length']?_0x2c3439[_0x5f11('0x2c')]:_0x2d54af[_0x5f11('0x27')];if(!_0x18e40a['query'][_0x5f11('0x2e')](_0x5f11('0x2f'))){_0x2c3439['limit']=qs[_0x5f11('0x19')](_0x18e40a[_0x5f11('0x29')][_0x5f11('0x19')]);_0x2c3439[_0x5f11('0x18')]=qs[_0x5f11('0x18')](_0x18e40a['query'][_0x5f11('0x18')]);}_0x2c3439['order']=qs[_0x5f11('0x30')](_0x18e40a[_0x5f11('0x29')][_0x5f11('0x30')]);_0x2c3439[_0x5f11('0x31')]=qs[_0x5f11('0x2a')](_[_0x5f11('0x32')](_0x18e40a[_0x5f11('0x29')],_0x2d54af[_0x5f11('0x2a')]));if(_0x18e40a[_0x5f11('0x29')][_0x5f11('0x33')]){_0x2c3439[_0x5f11('0x31')]=_[_0x5f11('0x34')](_0x2c3439['where'],{'$or':_[_0x5f11('0x35')](_0x2f70cf,function(_0x18dae6){if(_0x18dae6[_0x5f11('0x36')][_0x5f11('0x37')]!==_0x5f11('0x38')){var _0x6069a7={};_0x6069a7[_0x18dae6[_0x5f11('0x39')]]={'$like':'%'+_0x18e40a[_0x5f11('0x29')][_0x5f11('0x33')]+'%'};return _0x6069a7;}})});}_0x2c3439=_[_0x5f11('0x34')]({},_0x2c3439,_0x18e40a['options']);var _0x5e86ef={'where':_0x2c3439['where']};return db[_0x5f11('0x25')]['count'](_0x5e86ef)[_0x5f11('0x1f')](function(_0x5d2e1a){_0x4bf696[_0x5f11('0x17')]=_0x5d2e1a;if(_0x18e40a[_0x5f11('0x29')][_0x5f11('0x3a')]){_0x2c3439[_0x5f11('0x3b')]=[{'all':!![]}];}return db[_0x5f11('0x25')][_0x5f11('0x3c')](_0x2c3439);})[_0x5f11('0x1f')](function(_0x21674e){_0x4bf696[_0x5f11('0x3d')]=_0x21674e;return _0x4bf696;})[_0x5f11('0x1f')](respondWithFilteredResult(_0x2524e0,_0x2c3439))[_0x5f11('0x3e')](handleError(_0x2524e0,null));};exports[_0x5f11('0x3f')]=function(_0x4bf788,_0x4b6bf2){var _0x543c26={'raw':!![],'where':{'id':_0x4bf788['params']['id']}},_0x109b77={};_0x109b77['model']=_['keys'](db[_0x5f11('0x25')][_0x5f11('0x26')]);_0x109b77[_0x5f11('0x29')]=_[_0x5f11('0x28')](_0x4bf788['query']);_0x109b77[_0x5f11('0x2a')]=_[_0x5f11('0x2b')](_0x109b77[_0x5f11('0x27')],_0x109b77['query']);_0x543c26[_0x5f11('0x2c')]=_[_0x5f11('0x2b')](_0x109b77[_0x5f11('0x27')],qs[_0x5f11('0x2d')](_0x4bf788[_0x5f11('0x29')][_0x5f11('0x2d')]));_0x543c26['attributes']=_0x543c26[_0x5f11('0x2c')][_0x5f11('0x40')]?_0x543c26['attributes']:_0x109b77[_0x5f11('0x27')];if(_0x4bf788[_0x5f11('0x29')][_0x5f11('0x3a')]){_0x543c26[_0x5f11('0x3b')]=[{'all':!![]}];}_0x543c26=_[_0x5f11('0x34')]({},_0x543c26,_0x4bf788['options']);return db['ZohoField'][_0x5f11('0x41')](_0x543c26)['then'](handleEntityNotFound(_0x4b6bf2,null))[_0x5f11('0x1f')](respondWithResult(_0x4b6bf2,null))[_0x5f11('0x3e')](handleError(_0x4b6bf2,null));};exports[_0x5f11('0x42')]=function(_0x965d8f,_0x7cdbce){return db['ZohoField'][_0x5f11('0x42')](_0x965d8f['body'],{})['then'](respondWithResult(_0x7cdbce,0xc9))[_0x5f11('0x3e')](handleError(_0x7cdbce,null));};exports['update']=function(_0x162113,_0x13805e){if(_0x162113[_0x5f11('0x43')]['id']){delete _0x162113[_0x5f11('0x43')]['id'];}return db[_0x5f11('0x25')][_0x5f11('0x41')]({'where':{'id':_0x162113[_0x5f11('0x44')]['id']}})[_0x5f11('0x1f')](handleEntityNotFound(_0x13805e,null))[_0x5f11('0x1f')](saveUpdates(_0x162113['body'],null))[_0x5f11('0x1f')](respondWithResult(_0x13805e,null))[_0x5f11('0x3e')](handleError(_0x13805e,null));};exports[_0x5f11('0x45')]=function(_0x3f6e11,_0x24d5d6){return db[_0x5f11('0x25')][_0x5f11('0x41')]({'where':{'id':_0x3f6e11[_0x5f11('0x44')]['id']}})[_0x5f11('0x1f')](handleEntityNotFound(_0x24d5d6,null))[_0x5f11('0x1f')](removeEntity(_0x24d5d6,null))['catch'](handleError(_0x24d5d6,null));}; \ No newline at end of file +var _0xdf1f=['desk.js','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','ZohoField','rawAttributes','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce'];(function(_0x5cde73,_0x35324d){var _0x4ecb5d=function(_0x528d6d){while(--_0x528d6d){_0x5cde73['push'](_0x5cde73['shift']());}};_0x4ecb5d(++_0x35324d);}(_0xdf1f,0x1ec));var _0xfdf1=function(_0x534b58,_0x53ecd6){_0x534b58=_0x534b58-0x0;var _0x446260=_0xdf1f[_0x534b58];return _0x446260;};'use strict';var pdf=require(_0xfdf1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfdf1('0x1'));var jsonpatch=require(_0xfdf1('0x2'));var rp=require(_0xfdf1('0x3'));var moment=require('moment');var BPromise=require(_0xfdf1('0x4'));var Mustache=require('mustache');var util=require(_0xfdf1('0x5'));var path=require(_0xfdf1('0x6'));var sox=require(_0xfdf1('0x7'));var csv=require(_0xfdf1('0x8'));var ejs=require(_0xfdf1('0x9'));var fs=require('fs');var _=require(_0xfdf1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfdf1('0xb'));var deskjs=require(_0xfdf1('0xc'));var toCsv=require(_0xfdf1('0x8'));var querystring=require(_0xfdf1('0xd'));var Papa=require('papaparse');var authService=require(_0xfdf1('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xfdf1('0xf'));var qs=require(_0xfdf1('0x10'));var logger=require(_0xfdf1('0x11'))(_0xfdf1('0x12'));var utils=require(_0xfdf1('0x13'));var config=require('../../config/environment');var db=require(_0xfdf1('0x14'))['db'];function respondWithStatusCode(_0x140170,_0x4600ff){_0x4600ff=_0x4600ff||0xcc;return function(_0x5ada07){if(_0x5ada07){return _0x140170['sendStatus'](_0x4600ff);}return _0x140170[_0xfdf1('0x15')](_0x4600ff)[_0xfdf1('0x16')]();};}function respondWithResult(_0x406265,_0x39610f){_0x39610f=_0x39610f||0xc8;return function(_0xbf475d){if(_0xbf475d){return _0x406265[_0xfdf1('0x15')](_0x39610f)[_0xfdf1('0x17')](_0xbf475d);}};}function respondWithFilteredResult(_0x4403b3,_0x1e15a0){return function(_0x1a5b45){if(_0x1a5b45){var _0x28b9b1=_0x1a5b45[_0xfdf1('0x18')],_0x15188b=_0x1e15a0['offset'],_0x3a507d=_0x1e15a0['offset']+_0x1e15a0['limit'],_0x47da5b;if(_0x3a507d>=_0x28b9b1){_0x3a507d=_0x28b9b1;_0x47da5b=0xc8;}else{_0x47da5b=0xce;}_0x4403b3[_0xfdf1('0x15')](_0x47da5b);return _0x4403b3['set']('Content-Range',_0x15188b+'-'+_0x3a507d+'/'+_0x28b9b1)[_0xfdf1('0x17')](_0x1a5b45);}return null;};}function patchUpdates(_0x48a8fa){return function(_0x11adf2){try{jsonpatch[_0xfdf1('0x19')](_0x11adf2,_0x48a8fa,!![]);}catch(_0x537a56){return BPromise[_0xfdf1('0x1a')](_0x537a56);}return _0x11adf2[_0xfdf1('0x1b')]();};}function saveUpdates(_0xa3ae95,_0x5380f0){return function(_0x167434){if(_0x167434){return _0x167434[_0xfdf1('0x1c')](_0xa3ae95)[_0xfdf1('0x1d')](function(_0x3dba1c){return _0x3dba1c;});}return null;};}function removeEntity(_0x406dc0,_0x2fe80f){return function(_0x2c9d74){if(_0x2c9d74){return _0x2c9d74[_0xfdf1('0x1e')]()['then'](function(){_0x406dc0[_0xfdf1('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6746a7,_0x43e1c1){return function(_0x449f05){if(!_0x449f05){_0x6746a7[_0xfdf1('0x1f')](0x194);}return _0x449f05;};}function handleError(_0x49be71,_0x2fbd80){_0x2fbd80=_0x2fbd80||0x1f4;return function(_0x546392){logger[_0xfdf1('0x20')](_0x546392[_0xfdf1('0x21')]);if(_0x546392[_0xfdf1('0x22')]){delete _0x546392[_0xfdf1('0x22')];}_0x49be71[_0xfdf1('0x15')](_0x2fbd80)[_0xfdf1('0x23')](_0x546392);};}exports['index']=function(_0x3944e6,_0x20d090){var _0x5cce8f={},_0x2b5ef2={},_0x463da0={'count':0x0,'rows':[]};var _0x153219=db[_0xfdf1('0x24')][_0xfdf1('0x25')];_0x2b5ef2['model']=_[_0xfdf1('0x26')](_0x153219);_0x2b5ef2['query']=_[_0xfdf1('0x26')](_0x3944e6['query']);_0x2b5ef2[_0xfdf1('0x27')]=_[_0xfdf1('0x28')](_0x2b5ef2['model'],_0x2b5ef2[_0xfdf1('0x29')]);_0x5cce8f[_0xfdf1('0x2a')]=_['intersection'](_0x2b5ef2[_0xfdf1('0x2b')],qs[_0xfdf1('0x2c')](_0x3944e6[_0xfdf1('0x29')][_0xfdf1('0x2c')]));_0x5cce8f['attributes']=_0x5cce8f[_0xfdf1('0x2a')][_0xfdf1('0x2d')]?_0x5cce8f['attributes']:_0x2b5ef2[_0xfdf1('0x2b')];if(!_0x3944e6[_0xfdf1('0x29')][_0xfdf1('0x2e')](_0xfdf1('0x2f'))){_0x5cce8f[_0xfdf1('0x30')]=qs[_0xfdf1('0x30')](_0x3944e6[_0xfdf1('0x29')][_0xfdf1('0x30')]);_0x5cce8f[_0xfdf1('0x31')]=qs['offset'](_0x3944e6['query']['offset']);}_0x5cce8f[_0xfdf1('0x32')]=qs[_0xfdf1('0x33')](_0x3944e6[_0xfdf1('0x29')][_0xfdf1('0x33')]);_0x5cce8f['where']=qs[_0xfdf1('0x27')](_[_0xfdf1('0x34')](_0x3944e6[_0xfdf1('0x29')],_0x2b5ef2[_0xfdf1('0x27')]));if(_0x3944e6[_0xfdf1('0x29')]['filter']){_0x5cce8f[_0xfdf1('0x35')]=_[_0xfdf1('0x36')](_0x5cce8f[_0xfdf1('0x35')],{'$or':_[_0xfdf1('0x37')](_0x153219,function(_0x170474){if(_0x170474[_0xfdf1('0x38')][_0xfdf1('0x39')]!==_0xfdf1('0x3a')){var _0x5d8bea={};_0x5d8bea[_0x170474[_0xfdf1('0x3b')]]={'$like':'%'+_0x3944e6[_0xfdf1('0x29')][_0xfdf1('0x3c')]+'%'};return _0x5d8bea;}})});}_0x5cce8f=_[_0xfdf1('0x36')]({},_0x5cce8f,_0x3944e6[_0xfdf1('0x3d')]);var _0x416053={'where':_0x5cce8f[_0xfdf1('0x35')]};return db['ZohoField'][_0xfdf1('0x18')](_0x416053)[_0xfdf1('0x1d')](function(_0x422820){_0x463da0[_0xfdf1('0x18')]=_0x422820;if(_0x3944e6[_0xfdf1('0x29')]['includeAll']){_0x5cce8f[_0xfdf1('0x3e')]=[{'all':!![]}];}return db[_0xfdf1('0x24')][_0xfdf1('0x3f')](_0x5cce8f);})[_0xfdf1('0x1d')](function(_0x444133){_0x463da0[_0xfdf1('0x40')]=_0x444133;return _0x463da0;})[_0xfdf1('0x1d')](respondWithFilteredResult(_0x20d090,_0x5cce8f))[_0xfdf1('0x41')](handleError(_0x20d090,null));};exports[_0xfdf1('0x42')]=function(_0x507eb9,_0x2c0d1c){var _0x27c97d={'raw':!![],'where':{'id':_0x507eb9[_0xfdf1('0x43')]['id']}},_0x302978={};_0x302978[_0xfdf1('0x2b')]=_['keys'](db[_0xfdf1('0x24')][_0xfdf1('0x25')]);_0x302978['query']=_['keys'](_0x507eb9['query']);_0x302978[_0xfdf1('0x27')]=_['intersection'](_0x302978[_0xfdf1('0x2b')],_0x302978[_0xfdf1('0x29')]);_0x27c97d[_0xfdf1('0x2a')]=_[_0xfdf1('0x28')](_0x302978['model'],qs[_0xfdf1('0x2c')](_0x507eb9[_0xfdf1('0x29')][_0xfdf1('0x2c')]));_0x27c97d[_0xfdf1('0x2a')]=_0x27c97d['attributes'][_0xfdf1('0x2d')]?_0x27c97d['attributes']:_0x302978[_0xfdf1('0x2b')];if(_0x507eb9[_0xfdf1('0x29')][_0xfdf1('0x44')]){_0x27c97d['include']=[{'all':!![]}];}_0x27c97d=_[_0xfdf1('0x36')]({},_0x27c97d,_0x507eb9[_0xfdf1('0x3d')]);return db[_0xfdf1('0x24')][_0xfdf1('0x45')](_0x27c97d)[_0xfdf1('0x1d')](handleEntityNotFound(_0x2c0d1c,null))[_0xfdf1('0x1d')](respondWithResult(_0x2c0d1c,null))[_0xfdf1('0x41')](handleError(_0x2c0d1c,null));};exports['create']=function(_0x3b7d62,_0x46bdd9){return db[_0xfdf1('0x24')][_0xfdf1('0x46')](_0x3b7d62[_0xfdf1('0x47')],{})['then'](respondWithResult(_0x46bdd9,0xc9))[_0xfdf1('0x41')](handleError(_0x46bdd9,null));};exports[_0xfdf1('0x1c')]=function(_0x38e7bc,_0x145098){if(_0x38e7bc['body']['id']){delete _0x38e7bc[_0xfdf1('0x47')]['id'];}return db[_0xfdf1('0x24')]['find']({'where':{'id':_0x38e7bc[_0xfdf1('0x43')]['id']}})[_0xfdf1('0x1d')](handleEntityNotFound(_0x145098,null))['then'](saveUpdates(_0x38e7bc[_0xfdf1('0x47')],null))[_0xfdf1('0x1d')](respondWithResult(_0x145098,null))['catch'](handleError(_0x145098,null));};exports[_0xfdf1('0x1e')]=function(_0x212c1e,_0x46599c){return db[_0xfdf1('0x24')][_0xfdf1('0x45')]({'where':{'id':_0x212c1e[_0xfdf1('0x43')]['id']}})[_0xfdf1('0x1d')](handleEntityNotFound(_0x46599c,null))[_0xfdf1('0x1d')](removeEntity(_0x46599c,null))[_0xfdf1('0x41')](handleError(_0x46599c,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 8fb0ed2..15955d4 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 _0xbe51=['zoho_unique_index','idField','lodash','util','api','bluebird','request-promise','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields'];(function(_0xe040b7,_0x3d2aa7){var _0xc550bf=function(_0x23715e){while(--_0x23715e){_0xe040b7['push'](_0xe040b7['shift']());}};_0xc550bf(++_0x3d2aa7);}(_0xbe51,0x1e2));var _0x1be5=function(_0x4cdd26,_0x3db6d8){_0x4cdd26=_0x4cdd26-0x0;var _0x3b058d=_0xbe51[_0x4cdd26];return _0x3b058d;};'use strict';var _=require(_0x1be5('0x0'));var util=require(_0x1be5('0x1'));var logger=require('../../config/logger')(_0x1be5('0x2'));var moment=require('moment');var BPromise=require(_0x1be5('0x3'));var rp=require(_0x1be5('0x4'));var attributes=require(_0x1be5('0x5'));module[_0x1be5('0x6')]=function(_0x1e43d4,_0x2df147){return _0x1e43d4[_0x1be5('0x7')](_0x1be5('0x8'),attributes,{'tableName':_0x1be5('0x9'),'paranoid':![],'indexes':[{'name':_0x1be5('0xa'),'fields':[_0x1be5('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x076b=['util','../../config/logger','api','moment','bluebird','exports','zoho_unique_index','idField','lodash'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x076b,0x1c1));var _0xb076=function(_0x3fb21f,_0x2fdc1e){_0x3fb21f=_0x3fb21f-0x0;var _0x1edbac=_0x076b[_0x3fb21f];return _0x1edbac;};'use strict';var _=require(_0xb076('0x0'));var util=require(_0xb076('0x1'));var logger=require(_0xb076('0x2'))(_0xb076('0x3'));var moment=require(_0xb076('0x4'));var BPromise=require(_0xb076('0x5'));var rp=require('request-promise');var attributes=require('./intZohoField.attributes');module[_0xb076('0x6')]=function(_0x3168a5,_0x3d872a){return _0x3168a5['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xb076('0x7'),'fields':[_0xb076('0x8'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index f085882..ee2b707 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 _0x98af=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x5f4e26,_0x30da09){var _0x411498=function(_0x4005a1){while(--_0x4005a1){_0x5f4e26['push'](_0x5f4e26['shift']());}};_0x411498(++_0x30da09);}(_0x98af,0x105));var _0xf98a=function(_0x4beb74,_0xc3e98e){_0x4beb74=_0x4beb74-0x0;var _0x5002ff=_0x98af[_0x4beb74];return _0x5002ff;};'use strict';var _=require('lodash');var util=require(_0xf98a('0x0'));var moment=require(_0xf98a('0x1'));var BPromise=require(_0xf98a('0x2'));var rs=require(_0xf98a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf98a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf98a('0x5'))(_0xf98a('0x6'));var config=require(_0xf98a('0x7'));var jayson=require(_0xf98a('0x8'));var client=jayson[_0xf98a('0x9')][_0xf98a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b72c6,_0x4ad640,_0x1dc547){return new BPromise(function(_0x247203,_0x410335){return client[_0xf98a('0xb')](_0x4b72c6,_0x1dc547)[_0xf98a('0xc')](function(_0x2a0796){logger[_0xf98a('0xd')](_0xf98a('0xe'),_0x4ad640,_0xf98a('0xf'));logger[_0xf98a('0x10')](_0xf98a('0x11'),_0x4ad640,'request\x20sent',JSON[_0xf98a('0x12')](_0x2a0796));if(_0x2a0796[_0xf98a('0x13')]){if(_0x2a0796[_0xf98a('0x13')][_0xf98a('0x14')]===0x1f4){logger[_0xf98a('0x13')](_0xf98a('0xe'),_0x4ad640,_0x2a0796[_0xf98a('0x13')][_0xf98a('0x15')]);return _0x410335(_0x2a0796['error'][_0xf98a('0x15')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0x4ad640,_0x2a0796[_0xf98a('0x13')][_0xf98a('0x15')]);return _0x247203(_0x2a0796[_0xf98a('0x13')][_0xf98a('0x15')]);}else{logger[_0xf98a('0xd')]('ZohoField,\x20%s,\x20%s',_0x4ad640,_0xf98a('0xf'));_0x247203(_0x2a0796[_0xf98a('0x16')][_0xf98a('0x15')]);}})[_0xf98a('0x17')](function(_0xd425e2){logger[_0xf98a('0x13')](_0xf98a('0xe'),_0x4ad640,_0xd425e2);_0x410335(_0xd425e2);});});} \ No newline at end of file +var _0x3c8d=['request','then','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x3c8d,0x185));var _0xd3c8=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x3c8d[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0xd3c8('0x0'));var util=require(_0xd3c8('0x1'));var moment=require(_0xd3c8('0x2'));var BPromise=require(_0xd3c8('0x3'));var rs=require(_0xd3c8('0x4'));var fs=require('fs');var Redis=require(_0xd3c8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3c8('0x6'));var logger=require(_0xd3c8('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd3c8('0x8'));var client=jayson['client'][_0xd3c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f8f14,_0x169a1b,_0x2e32c5){return new BPromise(function(_0x116b84,_0x247965){return client[_0xd3c8('0xa')](_0x1f8f14,_0x2e32c5)[_0xd3c8('0xb')](function(_0x327a9f){logger['info'](_0xd3c8('0xc'),_0x169a1b,_0xd3c8('0xd'));logger['debug'](_0xd3c8('0xe'),_0x169a1b,_0xd3c8('0xd'),JSON[_0xd3c8('0xf')](_0x327a9f));if(_0x327a9f[_0xd3c8('0x10')]){if(_0x327a9f[_0xd3c8('0x10')][_0xd3c8('0x11')]===0x1f4){logger[_0xd3c8('0x10')]('ZohoField,\x20%s,\x20%s',_0x169a1b,_0x327a9f[_0xd3c8('0x10')][_0xd3c8('0x12')]);return _0x247965(_0x327a9f[_0xd3c8('0x10')][_0xd3c8('0x12')]);}logger[_0xd3c8('0x10')](_0xd3c8('0xc'),_0x169a1b,_0x327a9f[_0xd3c8('0x10')]['message']);return _0x116b84(_0x327a9f[_0xd3c8('0x10')]['message']);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x169a1b,_0xd3c8('0xd'));_0x116b84(_0x327a9f[_0xd3c8('0x13')][_0xd3c8('0x12')]);}})[_0xd3c8('0x14')](function(_0x154343){logger[_0xd3c8('0x10')]('ZohoField,\x20%s,\x20%s',_0x169a1b,_0x154343);_0x247965(_0x154343);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 5f59c9e..4ff491f 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 _0xfcbe=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x384d39,_0xf060fc){var _0x13bf22=function(_0x5d83f2){while(--_0x5d83f2){_0x384d39['push'](_0x384d39['shift']());}};_0x13bf22(++_0xf060fc);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x1c3a8f,_0x5ed837){_0x1c3a8f=_0x1c3a8f-0x0;var _0x5892e8=_0xfcbe[_0x1c3a8f];return _0x5892e8;};'use strict';var multer=require('multer');var util=require(_0xefcb('0x0'));var path=require(_0xefcb('0x1'));var timeout=require(_0xefcb('0x2'));var express=require(_0xefcb('0x3'));var router=express[_0xefcb('0x4')]();var auth=require(_0xefcb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xefcb('0x6'));module[_0xefcb('0x7')]=router; \ No newline at end of file +var _0x6931=['../../components/interaction/service','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x23513e,_0x15e329){var _0x570dea=function(_0x22b681){while(--_0x22b681){_0x23513e['push'](_0x23513e['shift']());}};_0x570dea(++_0x15e329);}(_0x6931,0x1a9));var _0x1693=function(_0x197d0a,_0x246338){_0x197d0a=_0x197d0a-0x0;var _0x3176ad=_0x6931[_0x197d0a];return _0x3176ad;};'use strict';var multer=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var path=require(_0x1693('0x2'));var timeout=require(_0x1693('0x3'));var express=require(_0x1693('0x4'));var router=express[_0x1693('0x5')]();var auth=require(_0x1693('0x6'));var interaction=require(_0x1693('0x7'));var config=require('../../config/environment');module[_0x1693('0x8')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index cc812cc..616913a 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 _0xb61f=['app.js','INTEGER','BOOLEAN','sequelize','STRING','unique_name_and_version'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb61f,0x6f));var _0xfb61=function(_0x23b6d0,_0x53e825){_0x23b6d0=_0x23b6d0-0x0;var _0x27047e=_0xb61f[_0x23b6d0];return _0x27047e;};'use strict';var Sequelize=require(_0xfb61('0x0'));module['exports']={'name':{'type':Sequelize[_0xfb61('0x1')],'allowNull':![],'unique':_0xfb61('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfb61('0x2')},'main':{'type':Sequelize[_0xfb61('0x1')],'defaultValue':_0xfb61('0x3')},'filename':{'type':Sequelize[_0xfb61('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfb61('0x1')]},'size':{'type':Sequelize[_0xfb61('0x4')]},'active':{'type':Sequelize[_0xfb61('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xfb61('0x1')]},'state':{'type':Sequelize[_0xfb61('0x1')],'unique':'state'},'description':{'type':Sequelize[_0xfb61('0x1')]},'title':{'type':Sequelize[_0xfb61('0x1')]},'remoteUri':{'type':Sequelize[_0xfb61('0x1')]},'link':{'type':Sequelize[_0xfb61('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x8405=['STRING','unique_name_and_version','app.js','BOOLEAN','sequelize'];(function(_0x5882b1,_0x4b19bf){var _0x3acdf0=function(_0x3559ff){while(--_0x3559ff){_0x5882b1['push'](_0x5882b1['shift']());}};_0x3acdf0(++_0x4b19bf);}(_0x8405,0x7c));var _0x5840=function(_0x399c2b,_0x39cf78){_0x399c2b=_0x399c2b-0x0;var _0x5330aa=_0x8405[_0x399c2b];return _0x5330aa;};'use strict';var Sequelize=require(_0x5840('0x0'));module['exports']={'name':{'type':Sequelize[_0x5840('0x1')],'allowNull':![],'unique':_0x5840('0x2')},'version':{'type':Sequelize[_0x5840('0x1')],'allowNull':![],'unique':_0x5840('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x5840('0x3')},'filename':{'type':Sequelize[_0x5840('0x1')]},'path':{'type':Sequelize[_0x5840('0x1')]},'type':{'type':Sequelize[_0x5840('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x5840('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x5840('0x1')]},'state':{'type':Sequelize[_0x5840('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x5840('0x1')]},'title':{'type':Sequelize[_0x5840('0x1')]},'remoteUri':{'type':Sequelize[_0x5840('0x1')]},'link':{'type':Sequelize[_0x5840('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index d7b8726..59b8d86 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 _0x4123=['sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','status','json','count','offset','limit','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','Integration','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','type','field','includeAll','include','show','params','options','catch','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path'];(function(_0x685346,_0x3ef2e5){var _0x52e15b=function(_0x4435da){while(--_0x4435da){_0x685346['push'](_0x685346['shift']());}};_0x52e15b(++_0x3ef2e5);}(_0x4123,0x87));var _0x3412=function(_0x9e7635,_0x2b15b4){_0x9e7635=_0x9e7635-0x0;var _0x26cd14=_0x4123[_0x9e7635];return _0x26cd14;};'use strict';var pdf=require(_0x3412('0x0'));var emlformat=require(_0x3412('0x1'));var rimraf=require(_0x3412('0x2'));var zipdir=require(_0x3412('0x3'));var jsonpatch=require(_0x3412('0x4'));var rp=require(_0x3412('0x5'));var moment=require(_0x3412('0x6'));var BPromise=require(_0x3412('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3412('0x8'));var sox=require(_0x3412('0x9'));var csv=require('to-csv');var ejs=require(_0x3412('0xa'));var fs=require('fs');var _=require(_0x3412('0xb'));var squel=require(_0x3412('0xc'));var crypto=require(_0x3412('0xd'));var jsforce=require(_0x3412('0xe'));var deskjs=require(_0x3412('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3412('0x10'));var Papa=require(_0x3412('0x11'));var authService=require(_0x3412('0x12'));var hardwareService=require(_0x3412('0x13'));var Redis=require(_0x3412('0x14'));var qs=require(_0x3412('0x15'));var logger=require(_0x3412('0x16'))(_0x3412('0x17'));var utils=require(_0x3412('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2967ee,_0x151e34){_0x151e34=_0x151e34||0xcc;return function(_0x154c9b){if(_0x154c9b){return _0x2967ee['sendStatus'](_0x151e34);}return _0x2967ee['status'](_0x151e34)['end']();};}function respondWithResult(_0x644c94,_0x2f99b3){_0x2f99b3=_0x2f99b3||0xc8;return function(_0x31ab2d){if(_0x31ab2d){return _0x644c94[_0x3412('0x19')](_0x2f99b3)[_0x3412('0x1a')](_0x31ab2d);}};}function respondWithFilteredResult(_0x226006,_0x746f22){return function(_0x20e8fd){if(_0x20e8fd){var _0x464929=_0x20e8fd[_0x3412('0x1b')],_0x1fa489=_0x746f22[_0x3412('0x1c')],_0x37c3a4=_0x746f22['offset']+_0x746f22[_0x3412('0x1d')],_0x382f11;if(_0x37c3a4>=_0x464929){_0x37c3a4=_0x464929;_0x382f11=0xc8;}else{_0x382f11=0xce;}_0x226006[_0x3412('0x19')](_0x382f11);return _0x226006['set']('Content-Range',_0x1fa489+'-'+_0x37c3a4+'/'+_0x464929)['json'](_0x20e8fd);}return null;};}function patchUpdates(_0x3abf70){return function(_0x1bbda2){try{jsonpatch[_0x3412('0x1e')](_0x1bbda2,_0x3abf70,!![]);}catch(_0x4480a9){return BPromise[_0x3412('0x1f')](_0x4480a9);}return _0x1bbda2[_0x3412('0x20')]();};}function saveUpdates(_0x4f0a5f,_0x48845a){return function(_0x2e1e53){if(_0x2e1e53){return _0x2e1e53[_0x3412('0x21')](_0x4f0a5f)[_0x3412('0x22')](function(_0x1d2349){return _0x1d2349;});}return null;};}function removeEntity(_0x48ff5c,_0x231f00){return function(_0x1eb494){if(_0x1eb494){return _0x1eb494[_0x3412('0x23')]()[_0x3412('0x22')](function(){_0x48ff5c[_0x3412('0x19')](0xcc)[_0x3412('0x24')]();});}};}function handleEntityNotFound(_0x46cd4b,_0x393a0b){return function(_0x4e936e){if(!_0x4e936e){_0x46cd4b[_0x3412('0x25')](0x194);}return _0x4e936e;};}function handleError(_0x3fae63,_0x27654a){_0x27654a=_0x27654a||0x1f4;return function(_0x23db59){logger[_0x3412('0x26')](_0x23db59[_0x3412('0x27')]);if(_0x23db59[_0x3412('0x28')]){delete _0x23db59[_0x3412('0x28')];}_0x3fae63['status'](_0x27654a)[_0x3412('0x29')](_0x23db59);};}exports[_0x3412('0x2a')]=function(_0x318586,_0x55dfb9){var _0x253e50={},_0x2768fa={},_0x2af6e9={'count':0x0,'rows':[]};var _0x57030f=db[_0x3412('0x2b')][_0x3412('0x2c')];_0x2768fa[_0x3412('0x2d')]=_[_0x3412('0x2e')](_0x57030f);_0x2768fa[_0x3412('0x2f')]=_[_0x3412('0x2e')](_0x318586[_0x3412('0x2f')]);_0x2768fa['filters']=_[_0x3412('0x30')](_0x2768fa[_0x3412('0x2d')],_0x2768fa[_0x3412('0x2f')]);_0x253e50[_0x3412('0x31')]=_[_0x3412('0x30')](_0x2768fa[_0x3412('0x2d')],qs[_0x3412('0x32')](_0x318586['query'][_0x3412('0x32')]));_0x253e50['attributes']=_0x253e50['attributes'][_0x3412('0x33')]?_0x253e50[_0x3412('0x31')]:_0x2768fa[_0x3412('0x2d')];if(!_0x318586[_0x3412('0x2f')]['hasOwnProperty'](_0x3412('0x34'))){_0x253e50[_0x3412('0x1d')]=qs[_0x3412('0x1d')](_0x318586['query']['limit']);_0x253e50[_0x3412('0x1c')]=qs[_0x3412('0x1c')](_0x318586['query'][_0x3412('0x1c')]);}_0x253e50[_0x3412('0x35')]=qs[_0x3412('0x36')](_0x318586[_0x3412('0x2f')]['sort']);_0x253e50[_0x3412('0x37')]=qs[_0x3412('0x38')](_[_0x3412('0x39')](_0x318586[_0x3412('0x2f')],_0x2768fa['filters']));if(_0x318586[_0x3412('0x2f')][_0x3412('0x3a')]){_0x253e50['where']=_[_0x3412('0x3b')](_0x253e50[_0x3412('0x37')],{'$or':_[_0x3412('0x3c')](_0x57030f,function(_0x5af331){if(_0x5af331[_0x3412('0x3d')]['key']!=='VIRTUAL'){var _0x9df395={};_0x9df395[_0x5af331[_0x3412('0x3e')]]={'$like':'%'+_0x318586['query']['filter']+'%'};return _0x9df395;}})});}_0x253e50=_[_0x3412('0x3b')]({},_0x253e50,_0x318586['options']);var _0x4fbc09={'where':_0x253e50[_0x3412('0x37')]};return db[_0x3412('0x2b')]['count'](_0x4fbc09)[_0x3412('0x22')](function(_0x3d7c68){_0x2af6e9['count']=_0x3d7c68;if(_0x318586[_0x3412('0x2f')][_0x3412('0x3f')]){_0x253e50[_0x3412('0x40')]=[{'all':!![]}];}return db[_0x3412('0x2b')]['findAll'](_0x253e50);})[_0x3412('0x22')](function(_0x5dab7c){_0x2af6e9['rows']=_0x5dab7c;return _0x2af6e9;})[_0x3412('0x22')](respondWithFilteredResult(_0x55dfb9,_0x253e50))['catch'](handleError(_0x55dfb9,null));};exports[_0x3412('0x41')]=function(_0x55678b,_0x3e8534){var _0x38e6ee={'raw':![],'where':{'id':_0x55678b[_0x3412('0x42')]['id']}},_0x39f448={};_0x39f448[_0x3412('0x2d')]=_[_0x3412('0x2e')](db[_0x3412('0x2b')][_0x3412('0x2c')]);_0x39f448[_0x3412('0x2f')]=_[_0x3412('0x2e')](_0x55678b[_0x3412('0x2f')]);_0x39f448[_0x3412('0x38')]=_[_0x3412('0x30')](_0x39f448[_0x3412('0x2d')],_0x39f448[_0x3412('0x2f')]);_0x38e6ee['attributes']=_[_0x3412('0x30')](_0x39f448[_0x3412('0x2d')],qs[_0x3412('0x32')](_0x55678b[_0x3412('0x2f')]['fields']));_0x38e6ee[_0x3412('0x31')]=_0x38e6ee['attributes'][_0x3412('0x33')]?_0x38e6ee[_0x3412('0x31')]:_0x39f448[_0x3412('0x2d')];if(_0x55678b[_0x3412('0x2f')][_0x3412('0x3f')]){_0x38e6ee['include']=[{'all':!![]}];}_0x38e6ee=_['merge']({},_0x38e6ee,_0x55678b[_0x3412('0x43')]);return db['Integration']['find'](_0x38e6ee)[_0x3412('0x22')](handleEntityNotFound(_0x3e8534,null))[_0x3412('0x22')](respondWithResult(_0x3e8534,null))[_0x3412('0x44')](handleError(_0x3e8534,null));};exports[_0x3412('0x45')]=function(_0x5a2ea2,_0x4800a0){return db['Integration'][_0x3412('0x45')](_0x5a2ea2[_0x3412('0x46')],{})[_0x3412('0x22')](respondWithResult(_0x4800a0,0xc9))[_0x3412('0x44')](handleError(_0x4800a0,null));};exports['update']=function(_0x57cfc7,_0x266ec8){if(_0x57cfc7[_0x3412('0x46')]['id']){delete _0x57cfc7[_0x3412('0x46')]['id'];}return db[_0x3412('0x2b')][_0x3412('0x47')]({'where':{'id':_0x57cfc7['params']['id']}})[_0x3412('0x22')](handleEntityNotFound(_0x266ec8,null))[_0x3412('0x22')](saveUpdates(_0x57cfc7['body'],null))[_0x3412('0x22')](respondWithResult(_0x266ec8,null))[_0x3412('0x44')](handleError(_0x266ec8,null));};exports[_0x3412('0x23')]=function(_0x3fe1a3,_0x28cf60){return db[_0x3412('0x2b')][_0x3412('0x47')]({'where':{'id':_0x3fe1a3[_0x3412('0x42')]['id']}})[_0x3412('0x22')](handleEntityNotFound(_0x28cf60,null))[_0x3412('0x22')](removeEntity(_0x28cf60,null))[_0x3412('0x44')](handleError(_0x28cf60,null));}; \ No newline at end of file +var _0x608a=['set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','Integration','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','map','key','field','options','count','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','limit'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x608a,0xff));var _0xa608=function(_0x2faef1,_0x70d10f){_0x2faef1=_0x2faef1-0x0;var _0x31ae4b=_0x608a[_0x2faef1];return _0x31ae4b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa608('0x0'));var rimraf=require(_0xa608('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa608('0x2'));var rp=require(_0xa608('0x3'));var moment=require(_0xa608('0x4'));var BPromise=require(_0xa608('0x5'));var Mustache=require('mustache');var util=require(_0xa608('0x6'));var path=require(_0xa608('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa608('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa608('0x9'));var crypto=require(_0xa608('0xa'));var jsforce=require(_0xa608('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa608('0xc'));var querystring=require('querystring');var Papa=require(_0xa608('0xd'));var authService=require(_0xa608('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xa608('0xf'));var qs=require(_0xa608('0x10'));var logger=require(_0xa608('0x11'))(_0xa608('0x12'));var utils=require('../../config/utils');var config=require(_0xa608('0x13'));var db=require(_0xa608('0x14'))['db'];function respondWithStatusCode(_0x2f90a1,_0x15e29f){_0x15e29f=_0x15e29f||0xcc;return function(_0x30d74b){if(_0x30d74b){return _0x2f90a1['sendStatus'](_0x15e29f);}return _0x2f90a1[_0xa608('0x15')](_0x15e29f)[_0xa608('0x16')]();};}function respondWithResult(_0x5cc272,_0x55642d){_0x55642d=_0x55642d||0xc8;return function(_0x162821){if(_0x162821){return _0x5cc272[_0xa608('0x15')](_0x55642d)[_0xa608('0x17')](_0x162821);}};}function respondWithFilteredResult(_0x1b223c,_0x565a3f){return function(_0x35cd7a){if(_0x35cd7a){var _0x4564f5=_0x35cd7a['count'],_0x49d154=_0x565a3f['offset'],_0xf4fcf6=_0x565a3f['offset']+_0x565a3f[_0xa608('0x18')],_0x2d6790;if(_0xf4fcf6>=_0x4564f5){_0xf4fcf6=_0x4564f5;_0x2d6790=0xc8;}else{_0x2d6790=0xce;}_0x1b223c[_0xa608('0x15')](_0x2d6790);return _0x1b223c[_0xa608('0x19')](_0xa608('0x1a'),_0x49d154+'-'+_0xf4fcf6+'/'+_0x4564f5)['json'](_0x35cd7a);}return null;};}function patchUpdates(_0x5c4167){return function(_0x349397){try{jsonpatch['apply'](_0x349397,_0x5c4167,!![]);}catch(_0x1b568f){return BPromise[_0xa608('0x1b')](_0x1b568f);}return _0x349397[_0xa608('0x1c')]();};}function saveUpdates(_0x345e7b,_0x33b96d){return function(_0x408060){if(_0x408060){return _0x408060[_0xa608('0x1d')](_0x345e7b)[_0xa608('0x1e')](function(_0x37abec){return _0x37abec;});}return null;};}function removeEntity(_0x272fd2,_0x3f152f){return function(_0x30bb22){if(_0x30bb22){return _0x30bb22[_0xa608('0x1f')]()[_0xa608('0x1e')](function(){_0x272fd2['status'](0xcc)[_0xa608('0x16')]();});}};}function handleEntityNotFound(_0x4d9de0,_0x4f218f){return function(_0x215f00){if(!_0x215f00){_0x4d9de0[_0xa608('0x20')](0x194);}return _0x215f00;};}function handleError(_0x239761,_0x46f931){_0x46f931=_0x46f931||0x1f4;return function(_0x243f71){logger[_0xa608('0x21')](_0x243f71[_0xa608('0x22')]);if(_0x243f71[_0xa608('0x23')]){delete _0x243f71['name'];}_0x239761['status'](_0x46f931)[_0xa608('0x24')](_0x243f71);};}exports[_0xa608('0x25')]=function(_0x38d67b,_0x3f74b2){var _0x4d5774={},_0x2da2e2={},_0x3968dc={'count':0x0,'rows':[]};var _0xa5b4f7=db[_0xa608('0x26')][_0xa608('0x27')];_0x2da2e2['model']=_[_0xa608('0x28')](_0xa5b4f7);_0x2da2e2[_0xa608('0x29')]=_['keys'](_0x38d67b[_0xa608('0x29')]);_0x2da2e2['filters']=_[_0xa608('0x2a')](_0x2da2e2[_0xa608('0x2b')],_0x2da2e2[_0xa608('0x29')]);_0x4d5774[_0xa608('0x2c')]=_['intersection'](_0x2da2e2['model'],qs['fields'](_0x38d67b[_0xa608('0x29')][_0xa608('0x2d')]));_0x4d5774['attributes']=_0x4d5774['attributes']['length']?_0x4d5774['attributes']:_0x2da2e2[_0xa608('0x2b')];if(!_0x38d67b[_0xa608('0x29')][_0xa608('0x2e')](_0xa608('0x2f'))){_0x4d5774[_0xa608('0x18')]=qs['limit'](_0x38d67b['query'][_0xa608('0x18')]);_0x4d5774['offset']=qs[_0xa608('0x30')](_0x38d67b[_0xa608('0x29')]['offset']);}_0x4d5774[_0xa608('0x31')]=qs[_0xa608('0x32')](_0x38d67b['query']['sort']);_0x4d5774[_0xa608('0x33')]=qs[_0xa608('0x34')](_[_0xa608('0x35')](_0x38d67b['query'],_0x2da2e2[_0xa608('0x34')]));if(_0x38d67b[_0xa608('0x29')][_0xa608('0x36')]){_0x4d5774[_0xa608('0x33')]=_[_0xa608('0x37')](_0x4d5774['where'],{'$or':_[_0xa608('0x38')](_0xa5b4f7,function(_0x3375be){if(_0x3375be['type'][_0xa608('0x39')]!=='VIRTUAL'){var _0x23298e={};_0x23298e[_0x3375be[_0xa608('0x3a')]]={'$like':'%'+_0x38d67b[_0xa608('0x29')][_0xa608('0x36')]+'%'};return _0x23298e;}})});}_0x4d5774=_[_0xa608('0x37')]({},_0x4d5774,_0x38d67b[_0xa608('0x3b')]);var _0x36a393={'where':_0x4d5774['where']};return db['Integration']['count'](_0x36a393)[_0xa608('0x1e')](function(_0x2172fc){_0x3968dc[_0xa608('0x3c')]=_0x2172fc;if(_0x38d67b['query'][_0xa608('0x3d')]){_0x4d5774['include']=[{'all':!![]}];}return db['Integration'][_0xa608('0x3e')](_0x4d5774);})[_0xa608('0x1e')](function(_0x332cb8){_0x3968dc[_0xa608('0x3f')]=_0x332cb8;return _0x3968dc;})['then'](respondWithFilteredResult(_0x3f74b2,_0x4d5774))[_0xa608('0x40')](handleError(_0x3f74b2,null));};exports[_0xa608('0x41')]=function(_0x3dd255,_0x384858){var _0xbf2008={'raw':![],'where':{'id':_0x3dd255[_0xa608('0x42')]['id']}},_0x2d1a41={};_0x2d1a41[_0xa608('0x2b')]=_[_0xa608('0x28')](db[_0xa608('0x26')][_0xa608('0x27')]);_0x2d1a41[_0xa608('0x29')]=_[_0xa608('0x28')](_0x3dd255[_0xa608('0x29')]);_0x2d1a41['filters']=_[_0xa608('0x2a')](_0x2d1a41[_0xa608('0x2b')],_0x2d1a41[_0xa608('0x29')]);_0xbf2008[_0xa608('0x2c')]=_[_0xa608('0x2a')](_0x2d1a41[_0xa608('0x2b')],qs[_0xa608('0x2d')](_0x3dd255['query'][_0xa608('0x2d')]));_0xbf2008[_0xa608('0x2c')]=_0xbf2008[_0xa608('0x2c')]['length']?_0xbf2008[_0xa608('0x2c')]:_0x2d1a41[_0xa608('0x2b')];if(_0x3dd255[_0xa608('0x29')][_0xa608('0x3d')]){_0xbf2008['include']=[{'all':!![]}];}_0xbf2008=_[_0xa608('0x37')]({},_0xbf2008,_0x3dd255[_0xa608('0x3b')]);return db[_0xa608('0x26')][_0xa608('0x43')](_0xbf2008)[_0xa608('0x1e')](handleEntityNotFound(_0x384858,null))['then'](respondWithResult(_0x384858,null))[_0xa608('0x40')](handleError(_0x384858,null));};exports[_0xa608('0x44')]=function(_0x45a40e,_0x40223b){return db[_0xa608('0x26')]['create'](_0x45a40e[_0xa608('0x45')],{})[_0xa608('0x1e')](respondWithResult(_0x40223b,0xc9))[_0xa608('0x40')](handleError(_0x40223b,null));};exports['update']=function(_0x35cd12,_0x550b16){if(_0x35cd12[_0xa608('0x45')]['id']){delete _0x35cd12['body']['id'];}return db[_0xa608('0x26')][_0xa608('0x43')]({'where':{'id':_0x35cd12[_0xa608('0x42')]['id']}})[_0xa608('0x1e')](handleEntityNotFound(_0x550b16,null))['then'](saveUpdates(_0x35cd12['body'],null))[_0xa608('0x1e')](respondWithResult(_0x550b16,null))[_0xa608('0x40')](handleError(_0x550b16,null));};exports[_0xa608('0x1f')]=function(_0x5ca777,_0x155922){return db[_0xa608('0x26')]['find']({'where':{'id':_0x5ca777[_0xa608('0x42')]['id']}})[_0xa608('0x1e')](handleEntityNotFound(_0x155922,null))[_0xa608('0x1e')](removeEntity(_0x155922,null))['catch'](handleError(_0x155922,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 391ad1f..744d76b 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 _0x4819=['api','moment','bluebird','request-promise','./integration.attributes','exports','Integration','util','../../config/logger'];(function(_0x4f412b,_0x1d72b4){var _0x367aba=function(_0x4a7de9){while(--_0x4a7de9){_0x4f412b['push'](_0x4f412b['shift']());}};_0x367aba(++_0x1d72b4);}(_0x4819,0xcd));var _0x9481=function(_0x26483b,_0xfd2c48){_0x26483b=_0x26483b-0x0;var _0x4b5988=_0x4819[_0x26483b];return _0x4b5988;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var attributes=require(_0x9481('0x6'));module[_0x9481('0x7')]=function(_0xc39edf,_0x16c617){return _0xc39edf['define'](_0x9481('0x8'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['./integration.attributes','exports','define','integrations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x34c75d,_0x3645fa){var _0x3138b2=function(_0x58793d){while(--_0x58793d){_0x34c75d['push'](_0x34c75d['shift']());}};_0x3138b2(++_0x3645fa);}(_0x4975,0x86));var _0x5497=function(_0x4fa30c,_0x28aa6c){_0x4fa30c=_0x4fa30c-0x0;var _0x2d62c7=_0x4975[_0x4fa30c];return _0x2d62c7;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var attributes=require(_0x5497('0x6'));module[_0x5497('0x7')]=function(_0xeb31af,_0xbb1888){return _0xeb31af[_0x5497('0x8')]('Integration',attributes,{'tableName':_0x5497('0x9'),'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 be6a10e..ee7743e 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 _0x43a7=['jayson/promise','client','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x376e38,_0x583895){var _0x441ad4=function(_0x775939){while(--_0x775939){_0x376e38['push'](_0x376e38['shift']());}};_0x441ad4(++_0x583895);}(_0x43a7,0x1c5));var _0x743a=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0x43a7[_0x1a809b];return _0x5d90e6;};'use strict';var _=require(_0x743a('0x0'));var util=require(_0x743a('0x1'));var moment=require('moment');var BPromise=require(_0x743a('0x2'));var rs=require(_0x743a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x743a('0x4'))['db'];var utils=require(_0x743a('0x5'));var logger=require(_0x743a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x743a('0x7'));var client=jayson[_0x743a('0x8')][_0x743a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cf9d8,_0x89a40,_0x359a21){return new BPromise(function(_0x5360c4,_0x2ee545){return client[_0x743a('0xa')](_0x5cf9d8,_0x359a21)['then'](function(_0x1f10dc){logger[_0x743a('0xb')](_0x743a('0xc'),_0x89a40,_0x743a('0xd'));logger['debug'](_0x743a('0xe'),_0x89a40,_0x743a('0xd'),JSON[_0x743a('0xf')](_0x1f10dc));if(_0x1f10dc[_0x743a('0x10')]){if(_0x1f10dc[_0x743a('0x10')]['code']===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x89a40,_0x1f10dc['error'][_0x743a('0x11')]);return _0x2ee545(_0x1f10dc[_0x743a('0x10')]['message']);}logger[_0x743a('0x10')](_0x743a('0xc'),_0x89a40,_0x1f10dc[_0x743a('0x10')][_0x743a('0x11')]);return _0x5360c4(_0x1f10dc[_0x743a('0x10')][_0x743a('0x11')]);}else{logger['info'](_0x743a('0xc'),_0x89a40,'request\x20sent');_0x5360c4(_0x1f10dc[_0x743a('0x12')]['message']);}})[_0x743a('0x13')](function(_0x1208f4){logger['error'](_0x743a('0xc'),_0x89a40,_0x1208f4);_0x2ee545(_0x1208f4);});});} \ No newline at end of file +var _0x9f7d=['Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3ff0f0,_0x5523bf){var _0x5dc82a=function(_0x14d26d){while(--_0x14d26d){_0x3ff0f0['push'](_0x3ff0f0['shift']());}};_0x5dc82a(++_0x5523bf);}(_0x9f7d,0x1b9));var _0xd9f7=function(_0x51ecef,_0x19e224){_0x51ecef=_0x51ecef-0x0;var _0x5f30cc=_0x9f7d[_0x51ecef];return _0x5f30cc;};'use strict';var _=require(_0xd9f7('0x0'));var util=require('util');var moment=require(_0xd9f7('0x1'));var BPromise=require(_0xd9f7('0x2'));var rs=require(_0xd9f7('0x3'));var fs=require('fs');var Redis=require(_0xd9f7('0x4'));var db=require(_0xd9f7('0x5'))['db'];var utils=require(_0xd9f7('0x6'));var logger=require(_0xd9f7('0x7'))('rpc');var config=require(_0xd9f7('0x8'));var jayson=require(_0xd9f7('0x9'));var client=jayson[_0xd9f7('0xa')][_0xd9f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b35c6,_0x5db43b,_0x55a6af){return new BPromise(function(_0x2333cc,_0x55b591){return client[_0xd9f7('0xc')](_0x3b35c6,_0x55a6af)[_0xd9f7('0xd')](function(_0xec3e64){logger[_0xd9f7('0xe')](_0xd9f7('0xf'),_0x5db43b,'request\x20sent');logger[_0xd9f7('0x10')](_0xd9f7('0x11'),_0x5db43b,_0xd9f7('0x12'),JSON['stringify'](_0xec3e64));if(_0xec3e64['error']){if(_0xec3e64[_0xd9f7('0x13')][_0xd9f7('0x14')]===0x1f4){logger[_0xd9f7('0x13')](_0xd9f7('0xf'),_0x5db43b,_0xec3e64['error'][_0xd9f7('0x15')]);return _0x55b591(_0xec3e64[_0xd9f7('0x13')]['message']);}logger['error'](_0xd9f7('0xf'),_0x5db43b,_0xec3e64[_0xd9f7('0x13')][_0xd9f7('0x15')]);return _0x2333cc(_0xec3e64['error'][_0xd9f7('0x15')]);}else{logger['info'](_0xd9f7('0xf'),_0x5db43b,'request\x20sent');_0x2333cc(_0xec3e64[_0xd9f7('0x16')][_0xd9f7('0x15')]);}})[_0xd9f7('0x17')](function(_0x3b757a){logger[_0xd9f7('0x13')](_0xd9f7('0xf'),_0x5db43b,_0x3b757a);_0x55b591(_0x3b757a);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index e6913c8..e282e03 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 _0x60da=['get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./integrationReport.controller'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x60da,0x161));var _0xa60d=function(_0x4af5ee,_0x1b21cc){_0x4af5ee=_0x4af5ee-0x0;var _0x2408d8=_0x60da[_0x4af5ee];return _0x2408d8;};'use strict';var multer=require(_0xa60d('0x0'));var util=require(_0xa60d('0x1'));var path=require(_0xa60d('0x2'));var timeout=require(_0xa60d('0x3'));var express=require(_0xa60d('0x4'));var router=express['Router']();var auth=require(_0xa60d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa60d('0x6'));var controller=require(_0xa60d('0x7'));router[_0xa60d('0x8')]('/',auth[_0xa60d('0x9')](),controller[_0xa60d('0xa')]);router[_0xa60d('0x8')](_0xa60d('0xb'),auth[_0xa60d('0x9')](),controller['describe']);router[_0xa60d('0x8')](_0xa60d('0xc'),auth[_0xa60d('0x9')](),controller[_0xa60d('0xd')]);router[_0xa60d('0xe')]('/',auth[_0xa60d('0x9')](),controller[_0xa60d('0xf')]);router[_0xa60d('0x10')](_0xa60d('0xc'),auth[_0xa60d('0x9')](),controller[_0xa60d('0x11')]);router['delete'](_0xa60d('0xc'),auth[_0xa60d('0x9')](),controller[_0xa60d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3893=['destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/:id','post','create','delete'];(function(_0x35beed,_0x9b2680){var _0x5c3c2d=function(_0x161b5c){while(--_0x161b5c){_0x35beed['push'](_0x35beed['shift']());}};_0x5c3c2d(++_0x9b2680);}(_0x3893,0x169));var _0x3389=function(_0x100dcb,_0x2cfcdf){_0x100dcb=_0x100dcb-0x0;var _0x690bf=_0x3893[_0x100dcb];return _0x690bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3389('0x0'));var timeout=require(_0x3389('0x1'));var express=require(_0x3389('0x2'));var router=express[_0x3389('0x3')]();var auth=require(_0x3389('0x4'));var interaction=require(_0x3389('0x5'));var config=require('../../config/environment');var controller=require(_0x3389('0x6'));router[_0x3389('0x7')]('/',auth[_0x3389('0x8')](),controller[_0x3389('0x9')]);router[_0x3389('0x7')]('/describe',auth[_0x3389('0x8')](),controller['describe']);router['get'](_0x3389('0xa'),auth[_0x3389('0x8')](),controller['show']);router[_0x3389('0xb')]('/',auth[_0x3389('0x8')](),controller[_0x3389('0xc')]);router['put'](_0x3389('0xa'),auth[_0x3389('0x8')](),controller['update']);router[_0x3389('0xd')](_0x3389('0xa'),auth[_0x3389('0x8')](),controller[_0x3389('0xe')]);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 a8170c2..bffef8b 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 _0x1296=['ENUM','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x40dc7e,_0x322488){var _0x31f6d4=function(_0x2db5e2){while(--_0x2db5e2){_0x40dc7e['push'](_0x40dc7e['shift']());}};_0x31f6d4(++_0x322488);}(_0x1296,0x143));var _0x6129=function(_0x3ecdfc,_0x264c0a){_0x3ecdfc=_0x3ecdfc-0x0;var _0x16f168=_0x1296[_0x3ecdfc];return _0x16f168;};'use strict';var Sequelize=require(_0x6129('0x0'));module[_0x6129('0x1')]={'integration':{'type':Sequelize[_0x6129('0x2')]},'eventChannel':{'type':Sequelize[_0x6129('0x2')]},'exitStatus':{'type':Sequelize[_0x6129('0x2')]},'ticketId':{'type':Sequelize[_0x6129('0x2')]},'integrationId':{'type':Sequelize[_0x6129('0x3')]},'contacts':{'type':Sequelize[_0x6129('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6129('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6129('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x6129('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6129('0x4')]},'talktime':{'type':Sequelize[_0x6129('0x3')]},'agentacw':{'type':Sequelize[_0x6129('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6129('0x3')]},'reason':{'type':Sequelize[_0x6129('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x6129('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x6129('0x2')]},'channel':{'type':Sequelize[_0x6129('0x2')]},'channelstate':{'type':Sequelize[_0x6129('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6129('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6129('0x2')]},'connectedlinename':{'type':Sequelize[_0x6129('0x2')]},'language':{'type':Sequelize[_0x6129('0x2')]},'accountcode':{'type':Sequelize[_0x6129('0x2')]},'context':{'type':Sequelize[_0x6129('0x2')]},'exten':{'type':Sequelize[_0x6129('0x2')]},'priority':{'type':Sequelize[_0x6129('0x2')]},'destchannel':{'type':Sequelize[_0x6129('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x6129('0x2')]},'destcalleridnum':{'type':Sequelize[_0x6129('0x2')]},'destcalleridname':{'type':Sequelize[_0x6129('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x6129('0x2')]},'destlanguage':{'type':Sequelize[_0x6129('0x2')]},'destaccountcode':{'type':Sequelize[_0x6129('0x2')]},'destcontext':{'type':Sequelize[_0x6129('0x2')]},'destexten':{'type':Sequelize[_0x6129('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6129('0x2')]},'messageId':{'type':Sequelize[_0x6129('0x2')]},'inReplyTo':{'type':Sequelize[_0x6129('0x2')]},'subject':{'type':Sequelize[_0x6129('0x2')]},'from':{'type':Sequelize[_0x6129('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6129('0x2')]},'attachment':{'type':Sequelize[_0x6129('0x6')]},'html':{'type':Sequelize[_0x6129('0x6')]},'text':{'type':Sequelize[_0x6129('0x6')]},'status':{'type':Sequelize[_0x6129('0x7')]('SENT','SENDING',_0x6129('0x8'),_0x6129('0x9'))},'url':{'type':Sequelize[_0x6129('0x2')]},'app':{'type':Sequelize[_0x6129('0x2')]},'appdata':{'type':Sequelize[_0x6129('0x2')]},'projectId':{'type':Sequelize[_0x6129('0x3')]}}; \ No newline at end of file +var _0xec7d=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports'];(function(_0xe4c48b,_0x3c6790){var _0x51872b=function(_0x61dea9){while(--_0x61dea9){_0xe4c48b['push'](_0xe4c48b['shift']());}};_0x51872b(++_0x3c6790);}(_0xec7d,0xfa));var _0xdec7=function(_0x451d28,_0x1bca56){_0x451d28=_0x451d28-0x0;var _0x3a4497=_0xec7d[_0x451d28];return _0x3a4497;};'use strict';var Sequelize=require(_0xdec7('0x0'));module[_0xdec7('0x1')]={'integration':{'type':Sequelize[_0xdec7('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xdec7('0x2')]},'integrationId':{'type':Sequelize[_0xdec7('0x3')]},'contacts':{'type':Sequelize[_0xdec7('0x2')]},'uniqueid':{'type':Sequelize[_0xdec7('0x2')]},'calleridnum':{'type':Sequelize[_0xdec7('0x2')]},'calleridname':{'type':Sequelize[_0xdec7('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xdec7('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xdec7('0x4')]},'holdtime':{'type':Sequelize[_0xdec7('0x3')]},'agentcomplete':{'type':Sequelize[_0xdec7('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xdec7('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xdec7('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdec7('0x3')]},'reason':{'type':Sequelize[_0xdec7('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xdec7('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xdec7('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xdec7('0x4')]},'lastevent':{'type':Sequelize[_0xdec7('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xdec7('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdec7('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdec7('0x2')]},'connectedlinename':{'type':Sequelize[_0xdec7('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdec7('0x2')]},'context':{'type':Sequelize[_0xdec7('0x2')]},'exten':{'type':Sequelize[_0xdec7('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xdec7('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdec7('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xdec7('0x2')]},'destlanguage':{'type':Sequelize[_0xdec7('0x2')]},'destaccountcode':{'type':Sequelize[_0xdec7('0x2')]},'destcontext':{'type':Sequelize[_0xdec7('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xdec7('0x2')]},'destuniqueid':{'type':Sequelize[_0xdec7('0x2')]},'messageId':{'type':Sequelize[_0xdec7('0x2')]},'inReplyTo':{'type':Sequelize[_0xdec7('0x2')]},'subject':{'type':Sequelize[_0xdec7('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xdec7('0x2')]},'cc':{'type':Sequelize[_0xdec7('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xdec7('0x6')]},'status':{'type':Sequelize[_0xdec7('0x7')](_0xdec7('0x8'),_0xdec7('0x9'),_0xdec7('0xa'),_0xdec7('0xb'))},'url':{'type':Sequelize[_0xdec7('0x2')]},'app':{'type':Sequelize[_0xdec7('0x2')]},'appdata':{'type':Sequelize[_0xdec7('0x2')]},'projectId':{'type':Sequelize[_0xdec7('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 66adac7..5c989a3 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 _0x83b9=['request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','where','pick','filter','merge','map','type','key','VIRTUAL','field','IntegrationReport','include','findAll','rows','catch','params','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x42ce8c,_0x21c257){var _0x436a7f=function(_0x3b1dca){while(--_0x3b1dca){_0x42ce8c['push'](_0x42ce8c['shift']());}};_0x436a7f(++_0x21c257);}(_0x83b9,0x155));var _0x983b=function(_0xa89d9c,_0x375f83){_0xa89d9c=_0xa89d9c-0x0;var _0x2cfe5e=_0x83b9[_0xa89d9c];return _0x2cfe5e;};'use strict';var pdf=require(_0x983b('0x0'));var emlformat=require(_0x983b('0x1'));var rimraf=require(_0x983b('0x2'));var zipdir=require(_0x983b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x983b('0x4'));var moment=require(_0x983b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x983b('0x6'));var path=require(_0x983b('0x7'));var sox=require(_0x983b('0x8'));var csv=require(_0x983b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x983b('0xa'));var squel=require(_0x983b('0xb'));var crypto=require(_0x983b('0xc'));var jsforce=require(_0x983b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x983b('0x9'));var querystring=require(_0x983b('0xe'));var Papa=require(_0x983b('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x983b('0x10'));var Redis=require(_0x983b('0x11'));var qs=require(_0x983b('0x12'));var logger=require('../../config/logger')(_0x983b('0x13'));var utils=require(_0x983b('0x14'));var config=require(_0x983b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ba2c6,_0x574c23){_0x574c23=_0x574c23||0xcc;return function(_0x2cd357){if(_0x2cd357){return _0x1ba2c6[_0x983b('0x16')](_0x574c23);}return _0x1ba2c6[_0x983b('0x17')](_0x574c23)[_0x983b('0x18')]();};}function respondWithResult(_0x53d64c,_0x29c127){_0x29c127=_0x29c127||0xc8;return function(_0x409720){if(_0x409720){return _0x53d64c[_0x983b('0x17')](_0x29c127)['json'](_0x409720);}};}function respondWithFilteredResult(_0x577691,_0x333c4b){return function(_0x2d867a){if(_0x2d867a){var _0x5cafbe=_0x2d867a[_0x983b('0x19')],_0x990cd=_0x333c4b[_0x983b('0x1a')],_0xefa8f1=_0x333c4b[_0x983b('0x1a')]+_0x333c4b['limit'],_0x3f9ffb;if(_0xefa8f1>=_0x5cafbe){_0xefa8f1=_0x5cafbe;_0x3f9ffb=0xc8;}else{_0x3f9ffb=0xce;}_0x577691['status'](_0x3f9ffb);return _0x577691['set'](_0x983b('0x1b'),_0x990cd+'-'+_0xefa8f1+'/'+_0x5cafbe)['json'](_0x2d867a);}return null;};}function patchUpdates(_0x4a2a44){return function(_0x370fe7){try{jsonpatch[_0x983b('0x1c')](_0x370fe7,_0x4a2a44,!![]);}catch(_0x5ef1db){return BPromise[_0x983b('0x1d')](_0x5ef1db);}return _0x370fe7[_0x983b('0x1e')]();};}function saveUpdates(_0x1c1b8a,_0x30c086){return function(_0x51850c){if(_0x51850c){return _0x51850c[_0x983b('0x1f')](_0x1c1b8a)[_0x983b('0x20')](function(_0x471741){return _0x471741;});}return null;};}function removeEntity(_0x3fa7d1,_0x2abfbd){return function(_0x31fd8c){if(_0x31fd8c){return _0x31fd8c[_0x983b('0x21')]()[_0x983b('0x20')](function(){_0x3fa7d1[_0x983b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19bde7,_0x430f7c){return function(_0x408a44){if(!_0x408a44){_0x19bde7['sendStatus'](0x194);}return _0x408a44;};}function handleError(_0x1337c0,_0x53dfc3){_0x53dfc3=_0x53dfc3||0x1f4;return function(_0x3caa92){logger[_0x983b('0x22')](_0x3caa92[_0x983b('0x23')]);if(_0x3caa92[_0x983b('0x24')]){delete _0x3caa92[_0x983b('0x24')];}_0x1337c0[_0x983b('0x17')](_0x53dfc3)[_0x983b('0x25')](_0x3caa92);};}exports[_0x983b('0x26')]=function(_0x4c828a,_0x4248bc){var _0x2d8912={},_0x151e38={},_0xbeb33d={'count':0x0,'rows':[]};var _0x3018c9=db['IntegrationReport']['rawAttributes'];_0x151e38[_0x983b('0x27')]=_[_0x983b('0x28')](_0x3018c9);_0x151e38[_0x983b('0x29')]=_[_0x983b('0x28')](_0x4c828a[_0x983b('0x29')]);_0x151e38[_0x983b('0x2a')]=_[_0x983b('0x2b')](_0x151e38[_0x983b('0x27')],_0x151e38['query']);_0x2d8912[_0x983b('0x2c')]=_[_0x983b('0x2b')](_0x151e38[_0x983b('0x27')],qs['fields'](_0x4c828a['query'][_0x983b('0x2d')]));_0x2d8912[_0x983b('0x2c')]=_0x2d8912[_0x983b('0x2c')]['length']?_0x2d8912[_0x983b('0x2c')]:_0x151e38['model'];if(!_0x4c828a['query']['hasOwnProperty'](_0x983b('0x2e'))){_0x2d8912[_0x983b('0x2f')]=qs[_0x983b('0x2f')](_0x4c828a[_0x983b('0x29')][_0x983b('0x2f')]);_0x2d8912[_0x983b('0x1a')]=qs['offset'](_0x4c828a['query']['offset']);}_0x2d8912[_0x983b('0x30')]=qs['sort'](_0x4c828a['query']['sort']);_0x2d8912[_0x983b('0x31')]=qs[_0x983b('0x2a')](_[_0x983b('0x32')](_0x4c828a['query'],_0x151e38[_0x983b('0x2a')]));if(_0x4c828a[_0x983b('0x29')][_0x983b('0x33')]){_0x2d8912[_0x983b('0x31')]=_[_0x983b('0x34')](_0x2d8912[_0x983b('0x31')],{'$or':_[_0x983b('0x35')](_0x3018c9,function(_0xdfe5fb){if(_0xdfe5fb[_0x983b('0x36')][_0x983b('0x37')]!==_0x983b('0x38')){var _0x38215e={};_0x38215e[_0xdfe5fb[_0x983b('0x39')]]={'$like':'%'+_0x4c828a[_0x983b('0x29')][_0x983b('0x33')]+'%'};return _0x38215e;}})});}_0x2d8912=_[_0x983b('0x34')]({},_0x2d8912,_0x4c828a['options']);var _0x2fb17d={'where':_0x2d8912[_0x983b('0x31')]};return db[_0x983b('0x3a')][_0x983b('0x19')](_0x2fb17d)[_0x983b('0x20')](function(_0x4d0b5b){_0xbeb33d['count']=_0x4d0b5b;if(_0x4c828a[_0x983b('0x29')]['includeAll']){_0x2d8912[_0x983b('0x3b')]=[{'all':!![]}];}return db[_0x983b('0x3a')][_0x983b('0x3c')](_0x2d8912);})['then'](function(_0x296c8c){_0xbeb33d[_0x983b('0x3d')]=_0x296c8c;return _0xbeb33d;})[_0x983b('0x20')](respondWithFilteredResult(_0x4248bc,_0x2d8912))[_0x983b('0x3e')](handleError(_0x4248bc,null));};exports['show']=function(_0x2471e0,_0xee39e7){var _0x2b91e9={'raw':![],'where':{'id':_0x2471e0[_0x983b('0x3f')]['id']}},_0x36abba={};_0x36abba[_0x983b('0x27')]=_[_0x983b('0x28')](db['IntegrationReport']['rawAttributes']);_0x36abba[_0x983b('0x29')]=_['keys'](_0x2471e0['query']);_0x36abba[_0x983b('0x2a')]=_[_0x983b('0x2b')](_0x36abba[_0x983b('0x27')],_0x36abba[_0x983b('0x29')]);_0x2b91e9[_0x983b('0x2c')]=_[_0x983b('0x2b')](_0x36abba[_0x983b('0x27')],qs['fields'](_0x2471e0[_0x983b('0x29')][_0x983b('0x2d')]));_0x2b91e9['attributes']=_0x2b91e9[_0x983b('0x2c')]['length']?_0x2b91e9[_0x983b('0x2c')]:_0x36abba[_0x983b('0x27')];if(_0x2471e0[_0x983b('0x29')]['includeAll']){_0x2b91e9[_0x983b('0x3b')]=[{'all':!![]}];}_0x2b91e9=_[_0x983b('0x34')]({},_0x2b91e9,_0x2471e0[_0x983b('0x40')]);return db[_0x983b('0x3a')][_0x983b('0x41')](_0x2b91e9)[_0x983b('0x20')](handleEntityNotFound(_0xee39e7,null))[_0x983b('0x20')](respondWithResult(_0xee39e7,null))['catch'](handleError(_0xee39e7,null));};exports[_0x983b('0x42')]=function(_0x2551a5,_0x435b3a){return db[_0x983b('0x3a')]['create'](_0x2551a5['body'],{})['then'](respondWithResult(_0x435b3a,0xc9))[_0x983b('0x3e')](handleError(_0x435b3a,null));};exports[_0x983b('0x1f')]=function(_0x5864b9,_0x37d079){if(_0x5864b9[_0x983b('0x43')]['id']){delete _0x5864b9[_0x983b('0x43')]['id'];}return db[_0x983b('0x3a')][_0x983b('0x41')]({'where':{'id':_0x5864b9['params']['id']}})[_0x983b('0x20')](handleEntityNotFound(_0x37d079,null))['then'](saveUpdates(_0x5864b9[_0x983b('0x43')],null))[_0x983b('0x20')](respondWithResult(_0x37d079,null))[_0x983b('0x3e')](handleError(_0x37d079,null));};exports[_0x983b('0x21')]=function(_0x1aeda2,_0x57605a){return db['IntegrationReport'][_0x983b('0x41')]({'where':{'id':_0x1aeda2['params']['id']}})[_0x983b('0x20')](handleEntityNotFound(_0x57605a,null))[_0x983b('0x20')](removeEntity(_0x57605a,null))[_0x983b('0x3e')](handleError(_0x57605a,null));};exports[_0x983b('0x44')]=function(_0xd794c5,_0x569dd2){return db[_0x983b('0x3a')]['describe']()[_0x983b('0x20')](respondWithResult(_0x569dd2,null))['catch'](handleError(_0x569dd2,null));}; \ No newline at end of file +var _0xe931=['set','Content-Range','json','reject','save','update','then','stack','index','keys','query','filters','intersection','model','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','IntegrationReport','count','include','findAll','rows','catch','rawAttributes','fields','includeAll','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','limit'];(function(_0x39ff85,_0x58612d){var _0x5302af=function(_0xf308fd){while(--_0xf308fd){_0x39ff85['push'](_0x39ff85['shift']());}};_0x5302af(++_0x58612d);}(_0xe931,0xbb));var _0x1e93=function(_0x5551f4,_0x4161e0){_0x5551f4=_0x5551f4-0x0;var _0x4e495c=_0xe931[_0x5551f4];return _0x4e495c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1e93('0x0'));var rimraf=require(_0x1e93('0x1'));var zipdir=require(_0x1e93('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e93('0x3'));var moment=require(_0x1e93('0x4'));var BPromise=require(_0x1e93('0x5'));var Mustache=require(_0x1e93('0x6'));var util=require('util');var path=require(_0x1e93('0x7'));var sox=require(_0x1e93('0x8'));var csv=require(_0x1e93('0x9'));var ejs=require(_0x1e93('0xa'));var fs=require('fs');var _=require(_0x1e93('0xb'));var squel=require('squel');var crypto=require(_0x1e93('0xc'));var jsforce=require(_0x1e93('0xd'));var deskjs=require(_0x1e93('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e93('0xf'));var Papa=require(_0x1e93('0x10'));var authService=require(_0x1e93('0x11'));var hardwareService=require(_0x1e93('0x12'));var Redis=require(_0x1e93('0x13'));var qs=require(_0x1e93('0x14'));var logger=require(_0x1e93('0x15'))(_0x1e93('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1e93('0x17'))['db'];function respondWithStatusCode(_0x5d4384,_0x459701){_0x459701=_0x459701||0xcc;return function(_0x71f206){if(_0x71f206){return _0x5d4384[_0x1e93('0x18')](_0x459701);}return _0x5d4384[_0x1e93('0x19')](_0x459701)[_0x1e93('0x1a')]();};}function respondWithResult(_0x27a54e,_0x182e57){_0x182e57=_0x182e57||0xc8;return function(_0x53f575){if(_0x53f575){return _0x27a54e[_0x1e93('0x19')](_0x182e57)['json'](_0x53f575);}};}function respondWithFilteredResult(_0x2b55cd,_0x3e6eb6){return function(_0x397c61){if(_0x397c61){var _0x476e7d=_0x397c61['count'],_0x5c33c5=_0x3e6eb6[_0x1e93('0x1b')],_0x1dd591=_0x3e6eb6['offset']+_0x3e6eb6[_0x1e93('0x1c')],_0x5e3e3b;if(_0x1dd591>=_0x476e7d){_0x1dd591=_0x476e7d;_0x5e3e3b=0xc8;}else{_0x5e3e3b=0xce;}_0x2b55cd[_0x1e93('0x19')](_0x5e3e3b);return _0x2b55cd[_0x1e93('0x1d')](_0x1e93('0x1e'),_0x5c33c5+'-'+_0x1dd591+'/'+_0x476e7d)[_0x1e93('0x1f')](_0x397c61);}return null;};}function patchUpdates(_0x320ed2){return function(_0x5e0d99){try{jsonpatch['apply'](_0x5e0d99,_0x320ed2,!![]);}catch(_0x51b517){return BPromise[_0x1e93('0x20')](_0x51b517);}return _0x5e0d99[_0x1e93('0x21')]();};}function saveUpdates(_0x3ed610,_0x4e603c){return function(_0x35a2e5){if(_0x35a2e5){return _0x35a2e5[_0x1e93('0x22')](_0x3ed610)['then'](function(_0x392a60){return _0x392a60;});}return null;};}function removeEntity(_0x3e8a18,_0x223422){return function(_0x58e817){if(_0x58e817){return _0x58e817['destroy']()[_0x1e93('0x23')](function(){_0x3e8a18[_0x1e93('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19c191,_0x14dbc5){return function(_0x161515){if(!_0x161515){_0x19c191[_0x1e93('0x18')](0x194);}return _0x161515;};}function handleError(_0x441d1d,_0x4ec0df){_0x4ec0df=_0x4ec0df||0x1f4;return function(_0x385ca2){logger['error'](_0x385ca2[_0x1e93('0x24')]);if(_0x385ca2['name']){delete _0x385ca2['name'];}_0x441d1d[_0x1e93('0x19')](_0x4ec0df)['send'](_0x385ca2);};}exports[_0x1e93('0x25')]=function(_0x2b8ae9,_0x32b7df){var _0x6c9ea0={},_0x265852={},_0x3c35be={'count':0x0,'rows':[]};var _0x46cf2d=db['IntegrationReport']['rawAttributes'];_0x265852['model']=_[_0x1e93('0x26')](_0x46cf2d);_0x265852[_0x1e93('0x27')]=_[_0x1e93('0x26')](_0x2b8ae9[_0x1e93('0x27')]);_0x265852[_0x1e93('0x28')]=_[_0x1e93('0x29')](_0x265852['model'],_0x265852[_0x1e93('0x27')]);_0x6c9ea0['attributes']=_['intersection'](_0x265852[_0x1e93('0x2a')],qs['fields'](_0x2b8ae9[_0x1e93('0x27')]['fields']));_0x6c9ea0['attributes']=_0x6c9ea0['attributes'][_0x1e93('0x2b')]?_0x6c9ea0[_0x1e93('0x2c')]:_0x265852[_0x1e93('0x2a')];if(!_0x2b8ae9['query'][_0x1e93('0x2d')]('nolimit')){_0x6c9ea0['limit']=qs[_0x1e93('0x1c')](_0x2b8ae9[_0x1e93('0x27')][_0x1e93('0x1c')]);_0x6c9ea0[_0x1e93('0x1b')]=qs[_0x1e93('0x1b')](_0x2b8ae9['query']['offset']);}_0x6c9ea0[_0x1e93('0x2e')]=qs[_0x1e93('0x2f')](_0x2b8ae9[_0x1e93('0x27')][_0x1e93('0x2f')]);_0x6c9ea0[_0x1e93('0x30')]=qs[_0x1e93('0x28')](_[_0x1e93('0x31')](_0x2b8ae9[_0x1e93('0x27')],_0x265852['filters']));if(_0x2b8ae9[_0x1e93('0x27')][_0x1e93('0x32')]){_0x6c9ea0[_0x1e93('0x30')]=_[_0x1e93('0x33')](_0x6c9ea0['where'],{'$or':_[_0x1e93('0x34')](_0x46cf2d,function(_0xfc5eae){if(_0xfc5eae[_0x1e93('0x35')][_0x1e93('0x36')]!==_0x1e93('0x37')){var _0x588aef={};_0x588aef[_0xfc5eae['field']]={'$like':'%'+_0x2b8ae9[_0x1e93('0x27')]['filter']+'%'};return _0x588aef;}})});}_0x6c9ea0=_[_0x1e93('0x33')]({},_0x6c9ea0,_0x2b8ae9[_0x1e93('0x38')]);var _0x5b0c2d={'where':_0x6c9ea0[_0x1e93('0x30')]};return db[_0x1e93('0x39')][_0x1e93('0x3a')](_0x5b0c2d)[_0x1e93('0x23')](function(_0xb5c210){_0x3c35be['count']=_0xb5c210;if(_0x2b8ae9[_0x1e93('0x27')]['includeAll']){_0x6c9ea0[_0x1e93('0x3b')]=[{'all':!![]}];}return db['IntegrationReport'][_0x1e93('0x3c')](_0x6c9ea0);})[_0x1e93('0x23')](function(_0x34d281){_0x3c35be[_0x1e93('0x3d')]=_0x34d281;return _0x3c35be;})[_0x1e93('0x23')](respondWithFilteredResult(_0x32b7df,_0x6c9ea0))[_0x1e93('0x3e')](handleError(_0x32b7df,null));};exports['show']=function(_0x32f682,_0x37a3af){var _0x58a377={'raw':![],'where':{'id':_0x32f682['params']['id']}},_0x16c5d5={};_0x16c5d5[_0x1e93('0x2a')]=_['keys'](db[_0x1e93('0x39')][_0x1e93('0x3f')]);_0x16c5d5[_0x1e93('0x27')]=_[_0x1e93('0x26')](_0x32f682['query']);_0x16c5d5[_0x1e93('0x28')]=_[_0x1e93('0x29')](_0x16c5d5[_0x1e93('0x2a')],_0x16c5d5[_0x1e93('0x27')]);_0x58a377[_0x1e93('0x2c')]=_[_0x1e93('0x29')](_0x16c5d5['model'],qs['fields'](_0x32f682['query'][_0x1e93('0x40')]));_0x58a377[_0x1e93('0x2c')]=_0x58a377[_0x1e93('0x2c')]['length']?_0x58a377[_0x1e93('0x2c')]:_0x16c5d5[_0x1e93('0x2a')];if(_0x32f682[_0x1e93('0x27')][_0x1e93('0x41')]){_0x58a377[_0x1e93('0x3b')]=[{'all':!![]}];}_0x58a377=_['merge']({},_0x58a377,_0x32f682['options']);return db[_0x1e93('0x39')][_0x1e93('0x42')](_0x58a377)[_0x1e93('0x23')](handleEntityNotFound(_0x37a3af,null))[_0x1e93('0x23')](respondWithResult(_0x37a3af,null))[_0x1e93('0x3e')](handleError(_0x37a3af,null));};exports[_0x1e93('0x43')]=function(_0x647507,_0x53d53a){return db['IntegrationReport'][_0x1e93('0x43')](_0x647507[_0x1e93('0x44')],{})['then'](respondWithResult(_0x53d53a,0xc9))[_0x1e93('0x3e')](handleError(_0x53d53a,null));};exports['update']=function(_0x2a63ac,_0x2dc17d){if(_0x2a63ac['body']['id']){delete _0x2a63ac[_0x1e93('0x44')]['id'];}return db['IntegrationReport'][_0x1e93('0x42')]({'where':{'id':_0x2a63ac[_0x1e93('0x45')]['id']}})[_0x1e93('0x23')](handleEntityNotFound(_0x2dc17d,null))[_0x1e93('0x23')](saveUpdates(_0x2a63ac['body'],null))[_0x1e93('0x23')](respondWithResult(_0x2dc17d,null))[_0x1e93('0x3e')](handleError(_0x2dc17d,null));};exports[_0x1e93('0x46')]=function(_0x146f74,_0x549dbc){return db['IntegrationReport'][_0x1e93('0x42')]({'where':{'id':_0x146f74[_0x1e93('0x45')]['id']}})[_0x1e93('0x23')](handleEntityNotFound(_0x549dbc,null))['then'](removeEntity(_0x549dbc,null))[_0x1e93('0x3e')](handleError(_0x549dbc,null));};exports[_0x1e93('0x47')]=function(_0x569658,_0xa0ab8c){return db[_0x1e93('0x39')][_0x1e93('0x47')]()[_0x1e93('0x23')](respondWithResult(_0xa0ab8c,null))['catch'](handleError(_0xa0ab8c,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 3df9106..e41160e 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 _0x5292=['./integrationReport.attributes','exports','lodash','util','api','bluebird','request-promise'];(function(_0x1d603a,_0x2b814e){var _0x4b76b4=function(_0x2ac4d1){while(--_0x2ac4d1){_0x1d603a['push'](_0x1d603a['shift']());}};_0x4b76b4(++_0x2b814e);}(_0x5292,0xf7));var _0x2529=function(_0x44b585,_0x120e48){_0x44b585=_0x44b585-0x0;var _0x38dd43=_0x5292[_0x44b585];return _0x38dd43;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var logger=require('../../config/logger')(_0x2529('0x2'));var moment=require('moment');var BPromise=require(_0x2529('0x3'));var rp=require(_0x2529('0x4'));var attributes=require(_0x2529('0x5'));module[_0x2529('0x6')]=function(_0x5d25dc,_0x28c08d){return _0x5d25dc['define']('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd59=['report_integration','lodash','util','../../config/logger','api','moment','bluebird','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x505439,_0x5a4a50){var _0x54267a=function(_0x5e635f){while(--_0x5e635f){_0x505439['push'](_0x505439['shift']());}};_0x54267a(++_0x5a4a50);}(_0xcd59,0x14b));var _0x9cd5=function(_0x4a0b15,_0x54818b){_0x4a0b15=_0x4a0b15-0x0;var _0x54f515=_0xcd59[_0x4a0b15];return _0x54f515;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var logger=require(_0x9cd5('0x2'))(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var BPromise=require(_0x9cd5('0x5'));var rp=require('request-promise');var attributes=require(_0x9cd5('0x6'));module[_0x9cd5('0x7')]=function(_0xf96efa,_0x717731){return _0xf96efa[_0x9cd5('0x8')](_0x9cd5('0x9'),attributes,{'tableName':_0x9cd5('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 709f290..d1b1ba5 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 _0xd716=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug','request\x20sent','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','result','catch','util'];(function(_0x52a0da,_0x34d07){var _0x1d7959=function(_0x74da5e){while(--_0x74da5e){_0x52a0da['push'](_0x52a0da['shift']());}};_0x1d7959(++_0x34d07);}(_0xd716,0x158));var _0x6d71=function(_0x1c441b,_0x113389){_0x1c441b=_0x1c441b-0x0;var _0x50b12c=_0xd716[_0x1c441b];return _0x50b12c;};'use strict';var _=require('lodash');var util=require(_0x6d71('0x0'));var moment=require(_0x6d71('0x1'));var BPromise=require(_0x6d71('0x2'));var rs=require(_0x6d71('0x3'));var fs=require('fs');var Redis=require(_0x6d71('0x4'));var db=require(_0x6d71('0x5'))['db'];var utils=require(_0x6d71('0x6'));var logger=require(_0x6d71('0x7'))('rpc');var config=require(_0x6d71('0x8'));var jayson=require(_0x6d71('0x9'));var client=jayson[_0x6d71('0xa')][_0x6d71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x456122,_0x33458e,_0x38abe2){return new BPromise(function(_0x3a1c46,_0x241dad){return client[_0x6d71('0xc')](_0x456122,_0x38abe2)['then'](function(_0x298584){logger[_0x6d71('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x33458e,'request\x20sent');logger[_0x6d71('0xe')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x33458e,_0x6d71('0xf'),JSON[_0x6d71('0x10')](_0x298584));if(_0x298584[_0x6d71('0x11')]){if(_0x298584[_0x6d71('0x11')][_0x6d71('0x12')]===0x1f4){logger[_0x6d71('0x11')](_0x6d71('0x13'),_0x33458e,_0x298584[_0x6d71('0x11')][_0x6d71('0x14')]);return _0x241dad(_0x298584[_0x6d71('0x11')][_0x6d71('0x14')]);}logger[_0x6d71('0x11')]('IntegrationReport,\x20%s,\x20%s',_0x33458e,_0x298584[_0x6d71('0x11')]['message']);return _0x3a1c46(_0x298584[_0x6d71('0x11')][_0x6d71('0x14')]);}else{logger[_0x6d71('0xd')](_0x6d71('0x13'),_0x33458e,_0x6d71('0xf'));_0x3a1c46(_0x298584[_0x6d71('0x15')][_0x6d71('0x14')]);}})[_0x6d71('0x16')](function(_0x3633ac){logger['error'](_0x6d71('0x13'),_0x33458e,_0x3633ac);_0x241dad(_0x3633ac);});});} \ No newline at end of file +var _0x04ac=['request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x5b201f,_0x20c0e5){var _0x476fe2=function(_0x1b27a1){while(--_0x1b27a1){_0x5b201f['push'](_0x5b201f['shift']());}};_0x476fe2(++_0x20c0e5);}(_0x04ac,0xdc));var _0xc04a=function(_0x1aa429,_0x4869b6){_0x1aa429=_0x1aa429-0x0;var _0xc24246=_0x04ac[_0x1aa429];return _0xc24246;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc04a('0x0'));var BPromise=require('bluebird');var rs=require(_0xc04a('0x1'));var fs=require('fs');var Redis=require(_0xc04a('0x2'));var db=require(_0xc04a('0x3'))['db'];var utils=require(_0xc04a('0x4'));var logger=require('../../config/logger')(_0xc04a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc04a('0x6')][_0xc04a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xf912ce,_0x259d47,_0x3c8721){return new BPromise(function(_0x40dc98,_0x7fc636){return client[_0xc04a('0x8')](_0xf912ce,_0x3c8721)[_0xc04a('0x9')](function(_0x2c21bd){logger['info'](_0xc04a('0xa'),_0x259d47,_0xc04a('0xb'));logger[_0xc04a('0xc')](_0xc04a('0xd'),_0x259d47,_0xc04a('0xb'),JSON['stringify'](_0x2c21bd));if(_0x2c21bd['error']){if(_0x2c21bd[_0xc04a('0xe')]['code']===0x1f4){logger[_0xc04a('0xe')](_0xc04a('0xa'),_0x259d47,_0x2c21bd[_0xc04a('0xe')][_0xc04a('0xf')]);return _0x7fc636(_0x2c21bd[_0xc04a('0xe')][_0xc04a('0xf')]);}logger[_0xc04a('0xe')](_0xc04a('0xa'),_0x259d47,_0x2c21bd[_0xc04a('0xe')][_0xc04a('0xf')]);return _0x40dc98(_0x2c21bd[_0xc04a('0xe')]['message']);}else{logger[_0xc04a('0x10')](_0xc04a('0xa'),_0x259d47,_0xc04a('0xb'));_0x40dc98(_0x2c21bd[_0xc04a('0x11')][_0xc04a('0xf')]);}})[_0xc04a('0x12')](function(_0x30ae43){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x259d47,_0x30ae43);_0x7fc636(_0x30ae43);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index aa830ad..850ed26 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 _0x51cf=['../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','show','getIntervals','post','create','/:id/sub_intervals','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x55da1e,_0x3d7259){var _0x3317de=function(_0x3461f4){while(--_0x3461f4){_0x55da1e['push'](_0x55da1e['shift']());}};_0x3317de(++_0x3d7259);}(_0x51cf,0x16a));var _0xf51c=function(_0x586634,_0x2aad59){_0x586634=_0x586634-0x0;var _0x362c8b=_0x51cf[_0x586634];return _0x362c8b;};'use strict';var multer=require(_0xf51c('0x0'));var util=require(_0xf51c('0x1'));var path=require(_0xf51c('0x2'));var timeout=require(_0xf51c('0x3'));var express=require(_0xf51c('0x4'));var router=express['Router']();var auth=require(_0xf51c('0x5'));var interaction=require(_0xf51c('0x6'));var config=require('../../config/environment');var controller=require(_0xf51c('0x7'));router[_0xf51c('0x8')]('/',auth[_0xf51c('0x9')](),controller[_0xf51c('0xa')]);router[_0xf51c('0x8')](_0xf51c('0xb'),auth[_0xf51c('0x9')](),controller[_0xf51c('0xc')]);router[_0xf51c('0x8')]('/:id/sub_intervals',auth[_0xf51c('0x9')](),controller[_0xf51c('0xd')]);router[_0xf51c('0xe')]('/',auth['isAuthenticated'](),controller[_0xf51c('0xf')]);router[_0xf51c('0xe')](_0xf51c('0x10'),auth[_0xf51c('0x9')](),controller['addInterval']);router[_0xf51c('0xe')]('/:id/sub_intervals/create_many',auth[_0xf51c('0x9')](),controller[_0xf51c('0x11')]);router[_0xf51c('0x12')](_0xf51c('0xb'),auth[_0xf51c('0x9')](),controller[_0xf51c('0x13')]);router[_0xf51c('0x14')](_0xf51c('0xb'),auth[_0xf51c('0x9')](),controller[_0xf51c('0x15')]);module[_0xf51c('0x16')]=router; \ No newline at end of file +var _0x8814=['multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sub_intervals','getIntervals','create','addInterval','post','/:id/sub_intervals/create_many','put','/:id','update','destroy','exports'];(function(_0x7f816c,_0x25f12e){var _0x9106ca=function(_0x9958b3){while(--_0x9958b3){_0x7f816c['push'](_0x7f816c['shift']());}};_0x9106ca(++_0x25f12e);}(_0x8814,0x1b8));var _0x4881=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x8814[_0x2afbb0];return _0x411ff2;};'use strict';var multer=require(_0x4881('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4881('0x1'));var express=require('express');var router=express[_0x4881('0x2')]();var auth=require(_0x4881('0x3'));var interaction=require(_0x4881('0x4'));var config=require(_0x4881('0x5'));var controller=require('./interval.controller');router[_0x4881('0x6')]('/',auth[_0x4881('0x7')](),controller[_0x4881('0x8')]);router[_0x4881('0x6')]('/:id',auth[_0x4881('0x7')](),controller['show']);router[_0x4881('0x6')](_0x4881('0x9'),auth[_0x4881('0x7')](),controller[_0x4881('0xa')]);router['post']('/',auth[_0x4881('0x7')](),controller[_0x4881('0xb')]);router['post'](_0x4881('0x9'),auth[_0x4881('0x7')](),controller[_0x4881('0xc')]);router[_0x4881('0xd')](_0x4881('0xe'),auth[_0x4881('0x7')](),controller['addIntervals']);router[_0x4881('0xf')](_0x4881('0x10'),auth[_0x4881('0x7')](),controller[_0x4881('0x11')]);router['delete'](_0x4881('0x10'),auth[_0x4881('0x7')](),controller[_0x4881('0x12')]);module[_0x4881('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 77cc72d..7611346 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 _0xa40b=['sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa40b,0x154));var _0xba40=function(_0x524735,_0x21ced1){_0x524735=_0x524735-0x0;var _0x763c3a=_0xa40b[_0x524735];return _0x763c3a;};'use strict';var Sequelize=require(_0xba40('0x0'));module[_0xba40('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x9b3b=['STRING','sequelize','exports'];(function(_0x50cdba,_0x5a19ae){var _0x354d22=function(_0x3a3a4c){while(--_0x3a3a4c){_0x50cdba['push'](_0x50cdba['shift']());}};_0x354d22(++_0x5a19ae);}(_0x9b3b,0x17e));var _0xb9b3=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x9b3b[_0x4653f7];return _0x5454da;};'use strict';var Sequelize=require(_0xb9b3('0x0'));module[_0xb9b3('0x1')]={'name':{'type':Sequelize[_0xb9b3('0x2')]},'description':{'type':Sequelize[_0xb9b3('0x2')]},'interval':{'type':Sequelize[_0xb9b3('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 ff0a3ba..323f5e5 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 _0xf271=['ioredis','../../config/logger','api','../../config/utils','../../components/extensions/rewrite','end','status','json','count','offset','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','sendStatus','error','name','index','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','merge','map','type','key','field','filter','Interval','rows','show','params','rawAttributes','includeAll','include','options','find','create','body','user','role','Intervals','UserProfileSection','userProfileId','autoAssociation','catch','addInterval','findOne','length','getIntervals','nolimit','addIntervals','transaction','IntervalId','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xf271,0x9c));var _0x1f27=function(_0x350132,_0x31283d){_0x350132=_0x350132-0x0;var _0xf3e713=_0xf271[_0x350132];return _0xf3e713;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1f27('0x0'));var rimraf=require(_0x1f27('0x1'));var zipdir=require(_0x1f27('0x2'));var jsonpatch=require(_0x1f27('0x3'));var rp=require(_0x1f27('0x4'));var moment=require(_0x1f27('0x5'));var BPromise=require(_0x1f27('0x6'));var Mustache=require(_0x1f27('0x7'));var util=require(_0x1f27('0x8'));var path=require(_0x1f27('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1f27('0xa'));var fs=require('fs');var _=require(_0x1f27('0xb'));var squel=require(_0x1f27('0xc'));var crypto=require(_0x1f27('0xd'));var jsforce=require(_0x1f27('0xe'));var deskjs=require(_0x1f27('0xf'));var toCsv=require(_0x1f27('0x10'));var querystring=require('querystring');var Papa=require(_0x1f27('0x11'));var authService=require(_0x1f27('0x12'));var hardwareService=require(_0x1f27('0x13'));var Redis=require(_0x1f27('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0x1f27('0x15'))(_0x1f27('0x16'));var utils=require(_0x1f27('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var extensions=require(_0x1f27('0x18'));function respondWithStatusCode(_0x41808e,_0x1f7ae4){_0x1f7ae4=_0x1f7ae4||0xcc;return function(_0x9714a9){if(_0x9714a9){return _0x41808e['sendStatus'](_0x1f7ae4);}return _0x41808e['status'](_0x1f7ae4)[_0x1f27('0x19')]();};}function respondWithResult(_0x58b543,_0x53291f){_0x53291f=_0x53291f||0xc8;return function(_0x232239){if(_0x232239){return _0x58b543[_0x1f27('0x1a')](_0x53291f)[_0x1f27('0x1b')](_0x232239);}};}function respondWithFilteredResult(_0x207b12,_0x3b6bb7){return function(_0x583eb4){if(_0x583eb4){var _0xc5ebf9=_0x583eb4[_0x1f27('0x1c')],_0x134af6=_0x3b6bb7[_0x1f27('0x1d')],_0x1809a0=_0x3b6bb7[_0x1f27('0x1d')]+_0x3b6bb7['limit'],_0x38b95c;if(_0x1809a0>=_0xc5ebf9){_0x1809a0=_0xc5ebf9;_0x38b95c=0xc8;}else{_0x38b95c=0xce;}_0x207b12[_0x1f27('0x1a')](_0x38b95c);return _0x207b12['set'](_0x1f27('0x1e'),_0x134af6+'-'+_0x1809a0+'/'+_0xc5ebf9)[_0x1f27('0x1b')](_0x583eb4);}return null;};}function patchUpdates(_0x375ff7){return function(_0x565e06){try{jsonpatch[_0x1f27('0x1f')](_0x565e06,_0x375ff7,!![]);}catch(_0x284ad9){return BPromise[_0x1f27('0x20')](_0x284ad9);}return _0x565e06[_0x1f27('0x21')]();};}function saveUpdates(_0x403824,_0x294c12){return function(_0x53f282){if(_0x53f282){return _0x53f282['update'](_0x403824)[_0x1f27('0x22')](function(_0x46aedf){return _0x46aedf;});}return null;};}function removeEntity(_0x2c4371,_0x137edb){return function(_0x386a9b){if(_0x386a9b){return _0x386a9b[_0x1f27('0x23')]()[_0x1f27('0x22')](function(){var _0x54f781=_0x386a9b[_0x1f27('0x24')]({'plain':!![]});var _0x1bc80d='Intervals';return db[_0x1f27('0x25')][_0x1f27('0x23')]({'where':{'type':_0x1bc80d,'resourceId':_0x54f781['id']}})[_0x1f27('0x22')](function(){return _0x386a9b;});})[_0x1f27('0x22')](function(){_0x2c4371[_0x1f27('0x1a')](0xcc)[_0x1f27('0x19')]();});}};}function handleEntityNotFound(_0x729fb2,_0x320e5d){return function(_0x184696){if(!_0x184696){_0x729fb2[_0x1f27('0x26')](0x194);}return _0x184696;};}function handleError(_0x47d7c5,_0xf49d63){_0xf49d63=_0xf49d63||0x1f4;return function(_0x5ede80){logger[_0x1f27('0x27')](_0x5ede80['stack']);if(_0x5ede80[_0x1f27('0x28')]){delete _0x5ede80['name'];}_0x47d7c5['status'](_0xf49d63)['send'](_0x5ede80);};}exports[_0x1f27('0x29')]=function(_0x9430ef,_0xefa154){var _0x5a4f38={},_0x1fb8aa={},_0x30e92a={'count':0x0,'rows':[]};var _0x1f8b48=db['Interval']['rawAttributes'];_0x1fb8aa[_0x1f27('0x2a')]=_[_0x1f27('0x2b')](_0x1f8b48);_0x1fb8aa[_0x1f27('0x2c')]=_[_0x1f27('0x2b')](_0x9430ef['query']);_0x1fb8aa[_0x1f27('0x2d')]=_['intersection'](_0x1fb8aa[_0x1f27('0x2a')],_0x1fb8aa[_0x1f27('0x2c')]);_0x5a4f38[_0x1f27('0x2e')]=_[_0x1f27('0x2f')](_0x1fb8aa[_0x1f27('0x2a')],qs['fields'](_0x9430ef[_0x1f27('0x2c')][_0x1f27('0x30')]));_0x5a4f38[_0x1f27('0x2e')]=_0x5a4f38[_0x1f27('0x2e')]['length']?_0x5a4f38[_0x1f27('0x2e')]:_0x1fb8aa[_0x1f27('0x2a')];if(!_0x9430ef['query'][_0x1f27('0x31')]('nolimit')){_0x5a4f38[_0x1f27('0x32')]=qs['limit'](_0x9430ef['query'][_0x1f27('0x32')]);_0x5a4f38[_0x1f27('0x1d')]=qs[_0x1f27('0x1d')](_0x9430ef['query'][_0x1f27('0x1d')]);}_0x5a4f38[_0x1f27('0x33')]=qs[_0x1f27('0x34')](_0x9430ef['query'][_0x1f27('0x34')]);_0x5a4f38[_0x1f27('0x35')]=qs[_0x1f27('0x2d')](_['pick'](_0x9430ef[_0x1f27('0x2c')],_0x1fb8aa[_0x1f27('0x2d')]));if(_0x9430ef[_0x1f27('0x2c')]['filter']){_0x5a4f38[_0x1f27('0x35')]=_[_0x1f27('0x36')](_0x5a4f38[_0x1f27('0x35')],{'$or':_[_0x1f27('0x37')](_0x1f8b48,function(_0x29df2f){if(_0x29df2f[_0x1f27('0x38')][_0x1f27('0x39')]!=='VIRTUAL'){var _0x24e02c={};_0x24e02c[_0x29df2f[_0x1f27('0x3a')]]={'$like':'%'+_0x9430ef[_0x1f27('0x2c')][_0x1f27('0x3b')]+'%'};return _0x24e02c;}})});}_0x5a4f38=_['merge']({},_0x5a4f38,_0x9430ef['options']);var _0x3b8eaf={'where':_0x5a4f38[_0x1f27('0x35')]};return db[_0x1f27('0x3c')][_0x1f27('0x1c')](_0x3b8eaf)[_0x1f27('0x22')](function(_0x598236){_0x30e92a[_0x1f27('0x1c')]=_0x598236;if(_0x9430ef[_0x1f27('0x2c')]['includeAll']){_0x5a4f38['include']=[{'all':!![]}];}return db['Interval']['findAll'](_0x5a4f38);})[_0x1f27('0x22')](function(_0x4266d1){_0x30e92a[_0x1f27('0x3d')]=_0x4266d1;return _0x30e92a;})['then'](respondWithFilteredResult(_0xefa154,_0x5a4f38))['catch'](handleError(_0xefa154,null));};exports[_0x1f27('0x3e')]=function(_0x2c1dda,_0x11e5db){var _0x34802b={'raw':!![],'where':{'id':_0x2c1dda[_0x1f27('0x3f')]['id']}},_0x4f64c8={};_0x4f64c8[_0x1f27('0x2a')]=_[_0x1f27('0x2b')](db[_0x1f27('0x3c')][_0x1f27('0x40')]);_0x4f64c8[_0x1f27('0x2c')]=_[_0x1f27('0x2b')](_0x2c1dda[_0x1f27('0x2c')]);_0x4f64c8[_0x1f27('0x2d')]=_['intersection'](_0x4f64c8[_0x1f27('0x2a')],_0x4f64c8[_0x1f27('0x2c')]);_0x34802b[_0x1f27('0x2e')]=_[_0x1f27('0x2f')](_0x4f64c8['model'],qs['fields'](_0x2c1dda[_0x1f27('0x2c')][_0x1f27('0x30')]));_0x34802b[_0x1f27('0x2e')]=_0x34802b['attributes']['length']?_0x34802b[_0x1f27('0x2e')]:_0x4f64c8[_0x1f27('0x2a')];if(_0x2c1dda['query'][_0x1f27('0x41')]){_0x34802b[_0x1f27('0x42')]=[{'all':!![]}];}_0x34802b=_[_0x1f27('0x36')]({},_0x34802b,_0x2c1dda[_0x1f27('0x43')]);return db[_0x1f27('0x3c')][_0x1f27('0x44')](_0x34802b)[_0x1f27('0x22')](handleEntityNotFound(_0x11e5db,null))[_0x1f27('0x22')](respondWithResult(_0x11e5db,null))['catch'](handleError(_0x11e5db,null));};exports[_0x1f27('0x45')]=function(_0x2e138d,_0x4f00da){return db['Interval'][_0x1f27('0x45')](_0x2e138d[_0x1f27('0x46')],{})[_0x1f27('0x22')](function(_0x3bc497){var _0xd47bcb=_0x2e138d[_0x1f27('0x47')][_0x1f27('0x24')]({'plain':!![]});if(!_0xd47bcb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd47bcb[_0x1f27('0x48')]===_0x1f27('0x47')){var _0x1db7fc=_0x3bc497[_0x1f27('0x24')]({'plain':!![]});var _0x2fbb32=_0x1f27('0x49');return db[_0x1f27('0x4a')][_0x1f27('0x44')]({'where':{'name':_0x2fbb32,'userProfileId':_0xd47bcb[_0x1f27('0x4b')]},'raw':!![]})[_0x1f27('0x22')](function(_0x35eb33){if(_0x35eb33&&_0x35eb33[_0x1f27('0x4c')]===0x0){return db[_0x1f27('0x25')][_0x1f27('0x45')]({'name':_0x1db7fc[_0x1f27('0x28')],'resourceId':_0x1db7fc['id'],'type':_0x35eb33[_0x1f27('0x28')],'sectionId':_0x35eb33['id']},{})[_0x1f27('0x22')](function(){return _0x3bc497;});}else{return _0x3bc497;}})['catch'](function(_0x2cccf3){logger[_0x1f27('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cccf3);throw _0x2cccf3;});}return _0x3bc497;})['then'](respondWithResult(_0x4f00da,0xc9))[_0x1f27('0x4d')](handleError(_0x4f00da,null));};exports['update']=function(_0x422796,_0x1f15c7){if(_0x422796[_0x1f27('0x46')]['id']){delete _0x422796[_0x1f27('0x46')]['id'];}return db[_0x1f27('0x3c')][_0x1f27('0x44')]({'where':{'id':_0x422796['params']['id']}})[_0x1f27('0x22')](handleEntityNotFound(_0x1f15c7,null))[_0x1f27('0x22')](saveUpdates(_0x422796['body'],null))['then'](respondWithResult(_0x1f15c7,null))['catch'](handleError(_0x1f15c7,null));};exports[_0x1f27('0x23')]=function(_0x33c2f2,_0x44d0e2){return db[_0x1f27('0x3c')][_0x1f27('0x44')]({'where':{'id':_0x33c2f2[_0x1f27('0x3f')]['id']}})[_0x1f27('0x22')](handleEntityNotFound(_0x44d0e2,null))['then'](removeEntity(_0x44d0e2,null))[_0x1f27('0x4d')](handleError(_0x44d0e2,null));};exports[_0x1f27('0x4e')]=function(_0x362089,_0x10063f,_0x44999e){if(_0x362089[_0x1f27('0x46')]['id']){delete _0x362089['body']['id'];}return db['Interval'][_0x1f27('0x44')]({'where':{'id':_0x362089[_0x1f27('0x3f')]['id']}})['then'](handleEntityNotFound(_0x10063f,null))['then'](function(_0x541e32){if(_0x541e32){_0x362089['body']['IntervalId']=_0x541e32['id'];return db[_0x1f27('0x3c')][_0x1f27('0x45')](_0x362089[_0x1f27('0x46')]);}})[_0x1f27('0x22')](respondWithResult(_0x10063f,null))['catch'](handleError(_0x10063f,null));};exports['getIntervals']=function(_0x29c143,_0x1e565a,_0x3dfbac){var _0x245c13={};var _0x56dc22={};var _0x5b07eb;var _0x5da99b;return db[_0x1f27('0x3c')][_0x1f27('0x4f')]({'where':{'id':_0x29c143[_0x1f27('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1e565a,null))[_0x1f27('0x22')](function(_0x41fef6){if(_0x41fef6){_0x5b07eb=_0x41fef6;_0x56dc22[_0x1f27('0x2a')]=_['keys'](db['Interval'][_0x1f27('0x40')]);_0x56dc22[_0x1f27('0x2c')]=_[_0x1f27('0x2b')](_0x29c143[_0x1f27('0x2c')]);_0x56dc22[_0x1f27('0x2d')]=_[_0x1f27('0x2f')](_0x56dc22[_0x1f27('0x2a')],_0x56dc22[_0x1f27('0x2c')]);_0x245c13['attributes']=_[_0x1f27('0x2f')](_0x56dc22['model'],qs['fields'](_0x29c143[_0x1f27('0x2c')][_0x1f27('0x30')]));_0x245c13[_0x1f27('0x2e')]=_0x245c13['attributes'][_0x1f27('0x50')]?_0x245c13['attributes']:_0x56dc22[_0x1f27('0x2a')];_0x245c13['order']=qs['sort'](_0x29c143['query'][_0x1f27('0x34')]);_0x245c13[_0x1f27('0x35')]=qs[_0x1f27('0x2d')](_['pick'](_0x29c143[_0x1f27('0x2c')],_0x56dc22['filters']));if(_0x29c143[_0x1f27('0x2c')][_0x1f27('0x3b')]){_0x245c13[_0x1f27('0x35')]=_[_0x1f27('0x36')](_0x245c13[_0x1f27('0x35')],{'$or':_[_0x1f27('0x37')](_0x245c13[_0x1f27('0x2e')],function(_0x5f3f94){var _0x1b5327={};_0x1b5327[_0x5f3f94]={'$like':'%'+_0x29c143['query'][_0x1f27('0x3b')]+'%'};return _0x1b5327;})});}_0x245c13=_[_0x1f27('0x36')]({},_0x245c13,_0x29c143[_0x1f27('0x43')]);return _0x5b07eb[_0x1f27('0x51')](_0x245c13);}})['then'](function(_0x163c8b){if(_0x163c8b){_0x5da99b=_0x163c8b[_0x1f27('0x50')];if(!_0x29c143['query']['hasOwnProperty'](_0x1f27('0x52'))){_0x245c13[_0x1f27('0x32')]=qs['limit'](_0x29c143[_0x1f27('0x2c')][_0x1f27('0x32')]);_0x245c13[_0x1f27('0x1d')]=qs[_0x1f27('0x1d')](_0x29c143[_0x1f27('0x2c')][_0x1f27('0x1d')]);}return _0x5b07eb[_0x1f27('0x51')](_0x245c13);}})['then'](function(_0x272630){if(_0x272630){return _0x272630?{'count':_0x5da99b,'rows':_0x272630}:null;}})['then'](respondWithResult(_0x1e565a,null))['catch'](handleError(_0x1e565a,null));};exports[_0x1f27('0x53')]=function(_0x43a05e,_0x518eab,_0x1dead7){return db[_0x1f27('0x3c')][_0x1f27('0x4f')]({'where':{'id':_0x43a05e[_0x1f27('0x3f')]['id']}})[_0x1f27('0x22')](handleEntityNotFound(_0x518eab,null))['then'](function(_0xfaf2cd){if(_0xfaf2cd){return db['sequelize'][_0x1f27('0x54')](function(_0x1de2f2){return db[_0x1f27('0x3c')][_0x1f27('0x23')]({'where':{'IntervalId':_0x43a05e[_0x1f27('0x3f')]['id']},'transaction':_0x1de2f2})[_0x1f27('0x22')](function(_0x4ab65f){var _0x31917d=_[_0x1f27('0x37')](_0x43a05e[_0x1f27('0x46')],function(_0x157067){delete _0x157067['id'];_0x157067[_0x1f27('0x55')]=_0x43a05e['params']['id'];return _0x157067;});return db[_0x1f27('0x3c')][_0x1f27('0x56')](_0x31917d,{'transaction':_0x1de2f2});});})['then'](function(){return db[_0x1f27('0x3c')][_0x1f27('0x57')]({'where':{'IntervalId':_0x43a05e[_0x1f27('0x3f')]['id']}});});}})['then'](respondWithResult(_0x518eab,null))[_0x1f27('0x4d')](handleError(_0x518eab,null));}; \ No newline at end of file +var _0x9177=['rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','IntervalId','findOne','getIntervals','addIntervals','sequelize','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/extensions/rewrite','status','end','json','count','limit','set','Content-Range','apply','reject','update','then','get','Intervals','UserProfileResource','sendStatus','error','stack','Interval','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x9177,0x126));var _0x7917=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0x9177[_0x1fc1f9];return _0x4987ca;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7917('0x0'));var zipdir=require(_0x7917('0x1'));var jsonpatch=require(_0x7917('0x2'));var rp=require(_0x7917('0x3'));var moment=require(_0x7917('0x4'));var BPromise=require(_0x7917('0x5'));var Mustache=require(_0x7917('0x6'));var util=require(_0x7917('0x7'));var path=require(_0x7917('0x8'));var sox=require(_0x7917('0x9'));var csv=require(_0x7917('0xa'));var ejs=require(_0x7917('0xb'));var fs=require('fs');var _=require(_0x7917('0xc'));var squel=require(_0x7917('0xd'));var crypto=require(_0x7917('0xe'));var jsforce=require(_0x7917('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7917('0xa'));var querystring=require(_0x7917('0x10'));var Papa=require(_0x7917('0x11'));var authService=require(_0x7917('0x12'));var hardwareService=require(_0x7917('0x13'));var Redis=require(_0x7917('0x14'));var qs=require(_0x7917('0x15'));var logger=require(_0x7917('0x16'))(_0x7917('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7917('0x18'))['db'];var extensions=require(_0x7917('0x19'));function respondWithStatusCode(_0xf1a3fb,_0x61567f){_0x61567f=_0x61567f||0xcc;return function(_0x435b86){if(_0x435b86){return _0xf1a3fb['sendStatus'](_0x61567f);}return _0xf1a3fb[_0x7917('0x1a')](_0x61567f)[_0x7917('0x1b')]();};}function respondWithResult(_0x336aa0,_0x1dd256){_0x1dd256=_0x1dd256||0xc8;return function(_0x33fd1f){if(_0x33fd1f){return _0x336aa0['status'](_0x1dd256)[_0x7917('0x1c')](_0x33fd1f);}};}function respondWithFilteredResult(_0x14ce3b,_0x10600a){return function(_0x496e2e){if(_0x496e2e){var _0x261090=_0x496e2e[_0x7917('0x1d')],_0x2b7304=_0x10600a['offset'],_0x435d80=_0x10600a['offset']+_0x10600a[_0x7917('0x1e')],_0x9b4b88;if(_0x435d80>=_0x261090){_0x435d80=_0x261090;_0x9b4b88=0xc8;}else{_0x9b4b88=0xce;}_0x14ce3b[_0x7917('0x1a')](_0x9b4b88);return _0x14ce3b[_0x7917('0x1f')](_0x7917('0x20'),_0x2b7304+'-'+_0x435d80+'/'+_0x261090)['json'](_0x496e2e);}return null;};}function patchUpdates(_0x135b0f){return function(_0x5e222e){try{jsonpatch[_0x7917('0x21')](_0x5e222e,_0x135b0f,!![]);}catch(_0x2460cf){return BPromise[_0x7917('0x22')](_0x2460cf);}return _0x5e222e['save']();};}function saveUpdates(_0x1eed97,_0x154af2){return function(_0x350a43){if(_0x350a43){return _0x350a43[_0x7917('0x23')](_0x1eed97)[_0x7917('0x24')](function(_0x6f9c19){return _0x6f9c19;});}return null;};}function removeEntity(_0x2e85e6,_0x50b636){return function(_0x3f2a10){if(_0x3f2a10){return _0x3f2a10['destroy']()[_0x7917('0x24')](function(){var _0x262847=_0x3f2a10[_0x7917('0x25')]({'plain':!![]});var _0x19f0b2=_0x7917('0x26');return db[_0x7917('0x27')]['destroy']({'where':{'type':_0x19f0b2,'resourceId':_0x262847['id']}})[_0x7917('0x24')](function(){return _0x3f2a10;});})[_0x7917('0x24')](function(){_0x2e85e6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x525e25,_0x2496f1){return function(_0x225157){if(!_0x225157){_0x525e25[_0x7917('0x28')](0x194);}return _0x225157;};}function handleError(_0x1099d5,_0x44aac2){_0x44aac2=_0x44aac2||0x1f4;return function(_0x5230b8){logger[_0x7917('0x29')](_0x5230b8[_0x7917('0x2a')]);if(_0x5230b8['name']){delete _0x5230b8['name'];}_0x1099d5[_0x7917('0x1a')](_0x44aac2)['send'](_0x5230b8);};}exports['index']=function(_0x6bd57d,_0x2d0c08){var _0x451378={},_0x3b9a90={},_0xd14f49={'count':0x0,'rows':[]};var _0x3636b8=db[_0x7917('0x2b')][_0x7917('0x2c')];_0x3b9a90[_0x7917('0x2d')]=_[_0x7917('0x2e')](_0x3636b8);_0x3b9a90[_0x7917('0x2f')]=_[_0x7917('0x2e')](_0x6bd57d['query']);_0x3b9a90['filters']=_[_0x7917('0x30')](_0x3b9a90[_0x7917('0x2d')],_0x3b9a90[_0x7917('0x2f')]);_0x451378[_0x7917('0x31')]=_[_0x7917('0x30')](_0x3b9a90[_0x7917('0x2d')],qs[_0x7917('0x32')](_0x6bd57d[_0x7917('0x2f')][_0x7917('0x32')]));_0x451378['attributes']=_0x451378['attributes'][_0x7917('0x33')]?_0x451378[_0x7917('0x31')]:_0x3b9a90['model'];if(!_0x6bd57d[_0x7917('0x2f')][_0x7917('0x34')](_0x7917('0x35'))){_0x451378[_0x7917('0x1e')]=qs[_0x7917('0x1e')](_0x6bd57d[_0x7917('0x2f')][_0x7917('0x1e')]);_0x451378[_0x7917('0x36')]=qs['offset'](_0x6bd57d[_0x7917('0x2f')][_0x7917('0x36')]);}_0x451378[_0x7917('0x37')]=qs['sort'](_0x6bd57d[_0x7917('0x2f')][_0x7917('0x38')]);_0x451378['where']=qs[_0x7917('0x39')](_[_0x7917('0x3a')](_0x6bd57d[_0x7917('0x2f')],_0x3b9a90[_0x7917('0x39')]));if(_0x6bd57d[_0x7917('0x2f')][_0x7917('0x3b')]){_0x451378[_0x7917('0x3c')]=_[_0x7917('0x3d')](_0x451378['where'],{'$or':_[_0x7917('0x3e')](_0x3636b8,function(_0x44e6ac){if(_0x44e6ac[_0x7917('0x3f')][_0x7917('0x40')]!==_0x7917('0x41')){var _0x25f43c={};_0x25f43c[_0x44e6ac['field']]={'$like':'%'+_0x6bd57d[_0x7917('0x2f')][_0x7917('0x3b')]+'%'};return _0x25f43c;}})});}_0x451378=_[_0x7917('0x3d')]({},_0x451378,_0x6bd57d[_0x7917('0x42')]);var _0x4fb0a6={'where':_0x451378[_0x7917('0x3c')]};return db[_0x7917('0x2b')][_0x7917('0x1d')](_0x4fb0a6)[_0x7917('0x24')](function(_0x4c4231){_0xd14f49[_0x7917('0x1d')]=_0x4c4231;if(_0x6bd57d['query'][_0x7917('0x43')]){_0x451378[_0x7917('0x44')]=[{'all':!![]}];}return db[_0x7917('0x2b')][_0x7917('0x45')](_0x451378);})['then'](function(_0x5b506d){_0xd14f49[_0x7917('0x46')]=_0x5b506d;return _0xd14f49;})[_0x7917('0x24')](respondWithFilteredResult(_0x2d0c08,_0x451378))[_0x7917('0x47')](handleError(_0x2d0c08,null));};exports[_0x7917('0x48')]=function(_0x39e7df,_0xc91679){var _0xca71d1={'raw':!![],'where':{'id':_0x39e7df['params']['id']}},_0x24ce7a={};_0x24ce7a[_0x7917('0x2d')]=_[_0x7917('0x2e')](db[_0x7917('0x2b')][_0x7917('0x2c')]);_0x24ce7a['query']=_[_0x7917('0x2e')](_0x39e7df[_0x7917('0x2f')]);_0x24ce7a[_0x7917('0x39')]=_['intersection'](_0x24ce7a['model'],_0x24ce7a[_0x7917('0x2f')]);_0xca71d1['attributes']=_[_0x7917('0x30')](_0x24ce7a[_0x7917('0x2d')],qs[_0x7917('0x32')](_0x39e7df[_0x7917('0x2f')]['fields']));_0xca71d1['attributes']=_0xca71d1[_0x7917('0x31')][_0x7917('0x33')]?_0xca71d1[_0x7917('0x31')]:_0x24ce7a[_0x7917('0x2d')];if(_0x39e7df[_0x7917('0x2f')][_0x7917('0x43')]){_0xca71d1[_0x7917('0x44')]=[{'all':!![]}];}_0xca71d1=_[_0x7917('0x3d')]({},_0xca71d1,_0x39e7df[_0x7917('0x42')]);return db['Interval'][_0x7917('0x49')](_0xca71d1)[_0x7917('0x24')](handleEntityNotFound(_0xc91679,null))[_0x7917('0x24')](respondWithResult(_0xc91679,null))[_0x7917('0x47')](handleError(_0xc91679,null));};exports[_0x7917('0x4a')]=function(_0x1e827b,_0x3c5fce){return db[_0x7917('0x2b')][_0x7917('0x4a')](_0x1e827b[_0x7917('0x4b')],{})['then'](function(_0xafa944){var _0x75b546=_0x1e827b[_0x7917('0x4c')][_0x7917('0x25')]({'plain':!![]});if(!_0x75b546)throw new Error(_0x7917('0x4d'));if(_0x75b546[_0x7917('0x4e')]===_0x7917('0x4c')){var _0x4e48fe=_0xafa944[_0x7917('0x25')]({'plain':!![]});var _0xcddaef=_0x7917('0x26');return db[_0x7917('0x4f')][_0x7917('0x49')]({'where':{'name':_0xcddaef,'userProfileId':_0x75b546[_0x7917('0x50')]},'raw':!![]})[_0x7917('0x24')](function(_0x24a7cb){if(_0x24a7cb&&_0x24a7cb[_0x7917('0x51')]===0x0){return db[_0x7917('0x27')]['create']({'name':_0x4e48fe['name'],'resourceId':_0x4e48fe['id'],'type':_0x24a7cb['name'],'sectionId':_0x24a7cb['id']},{})[_0x7917('0x24')](function(){return _0xafa944;});}else{return _0xafa944;}})[_0x7917('0x47')](function(_0x330f03){logger[_0x7917('0x29')](_0x7917('0x52'),_0x330f03);throw _0x330f03;});}return _0xafa944;})[_0x7917('0x24')](respondWithResult(_0x3c5fce,0xc9))[_0x7917('0x47')](handleError(_0x3c5fce,null));};exports[_0x7917('0x23')]=function(_0x6b4a7b,_0x5e571c){if(_0x6b4a7b[_0x7917('0x4b')]['id']){delete _0x6b4a7b[_0x7917('0x4b')]['id'];}return db['Interval'][_0x7917('0x49')]({'where':{'id':_0x6b4a7b[_0x7917('0x53')]['id']}})[_0x7917('0x24')](handleEntityNotFound(_0x5e571c,null))['then'](saveUpdates(_0x6b4a7b[_0x7917('0x4b')],null))['then'](respondWithResult(_0x5e571c,null))[_0x7917('0x47')](handleError(_0x5e571c,null));};exports['destroy']=function(_0x5b7937,_0x4d927b){return db[_0x7917('0x2b')]['find']({'where':{'id':_0x5b7937[_0x7917('0x53')]['id']}})[_0x7917('0x24')](handleEntityNotFound(_0x4d927b,null))[_0x7917('0x24')](removeEntity(_0x4d927b,null))['catch'](handleError(_0x4d927b,null));};exports[_0x7917('0x54')]=function(_0x241482,_0x4abb1c,_0x293f53){if(_0x241482['body']['id']){delete _0x241482['body']['id'];}return db[_0x7917('0x2b')][_0x7917('0x49')]({'where':{'id':_0x241482['params']['id']}})[_0x7917('0x24')](handleEntityNotFound(_0x4abb1c,null))[_0x7917('0x24')](function(_0x148519){if(_0x148519){_0x241482['body'][_0x7917('0x55')]=_0x148519['id'];return db[_0x7917('0x2b')]['create'](_0x241482[_0x7917('0x4b')]);}})[_0x7917('0x24')](respondWithResult(_0x4abb1c,null))[_0x7917('0x47')](handleError(_0x4abb1c,null));};exports['getIntervals']=function(_0x272bfa,_0x400b7e,_0x133fcc){var _0x59de72={};var _0x13ff29={};var _0x4e9a4d;var _0x292c3b;return db[_0x7917('0x2b')][_0x7917('0x56')]({'where':{'id':_0x272bfa['params']['id']}})[_0x7917('0x24')](handleEntityNotFound(_0x400b7e,null))[_0x7917('0x24')](function(_0x122e4a){if(_0x122e4a){_0x4e9a4d=_0x122e4a;_0x13ff29[_0x7917('0x2d')]=_[_0x7917('0x2e')](db[_0x7917('0x2b')]['rawAttributes']);_0x13ff29[_0x7917('0x2f')]=_[_0x7917('0x2e')](_0x272bfa[_0x7917('0x2f')]);_0x13ff29[_0x7917('0x39')]=_[_0x7917('0x30')](_0x13ff29[_0x7917('0x2d')],_0x13ff29['query']);_0x59de72[_0x7917('0x31')]=_[_0x7917('0x30')](_0x13ff29[_0x7917('0x2d')],qs[_0x7917('0x32')](_0x272bfa[_0x7917('0x2f')][_0x7917('0x32')]));_0x59de72[_0x7917('0x31')]=_0x59de72[_0x7917('0x31')][_0x7917('0x33')]?_0x59de72[_0x7917('0x31')]:_0x13ff29[_0x7917('0x2d')];_0x59de72[_0x7917('0x37')]=qs[_0x7917('0x38')](_0x272bfa[_0x7917('0x2f')]['sort']);_0x59de72[_0x7917('0x3c')]=qs[_0x7917('0x39')](_[_0x7917('0x3a')](_0x272bfa[_0x7917('0x2f')],_0x13ff29['filters']));if(_0x272bfa[_0x7917('0x2f')]['filter']){_0x59de72[_0x7917('0x3c')]=_[_0x7917('0x3d')](_0x59de72[_0x7917('0x3c')],{'$or':_['map'](_0x59de72[_0x7917('0x31')],function(_0x5e130f){var _0x35357d={};_0x35357d[_0x5e130f]={'$like':'%'+_0x272bfa[_0x7917('0x2f')][_0x7917('0x3b')]+'%'};return _0x35357d;})});}_0x59de72=_[_0x7917('0x3d')]({},_0x59de72,_0x272bfa[_0x7917('0x42')]);return _0x4e9a4d[_0x7917('0x57')](_0x59de72);}})['then'](function(_0x5c4625){if(_0x5c4625){_0x292c3b=_0x5c4625[_0x7917('0x33')];if(!_0x272bfa[_0x7917('0x2f')][_0x7917('0x34')]('nolimit')){_0x59de72['limit']=qs['limit'](_0x272bfa['query']['limit']);_0x59de72[_0x7917('0x36')]=qs['offset'](_0x272bfa['query']['offset']);}return _0x4e9a4d[_0x7917('0x57')](_0x59de72);}})[_0x7917('0x24')](function(_0x443363){if(_0x443363){return _0x443363?{'count':_0x292c3b,'rows':_0x443363}:null;}})[_0x7917('0x24')](respondWithResult(_0x400b7e,null))[_0x7917('0x47')](handleError(_0x400b7e,null));};exports[_0x7917('0x58')]=function(_0x2fbbf6,_0x5b473d,_0x4cca57){return db[_0x7917('0x2b')][_0x7917('0x56')]({'where':{'id':_0x2fbbf6[_0x7917('0x53')]['id']}})['then'](handleEntityNotFound(_0x5b473d,null))[_0x7917('0x24')](function(_0x4236e9){if(_0x4236e9){return db[_0x7917('0x59')]['transaction'](function(_0x1e516b){return db[_0x7917('0x2b')]['destroy']({'where':{'IntervalId':_0x2fbbf6[_0x7917('0x53')]['id']},'transaction':_0x1e516b})[_0x7917('0x24')](function(_0x1c1e97){var _0x5204f3=_[_0x7917('0x3e')](_0x2fbbf6[_0x7917('0x4b')],function(_0x35c3c4){delete _0x35c3c4['id'];_0x35c3c4[_0x7917('0x55')]=_0x2fbbf6[_0x7917('0x53')]['id'];return _0x35c3c4;});return db['Interval'][_0x7917('0x5a')](_0x5204f3,{'transaction':_0x1e516b});});})['then'](function(){return db['Interval'][_0x7917('0x45')]({'where':{'IntervalId':_0x2fbbf6[_0x7917('0x53')]['id']}});});}})[_0x7917('0x24')](respondWithResult(_0x5b473d,null))[_0x7917('0x47')](handleError(_0x5b473d,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 8bc0d3c..53d51ad 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 _0xb97f=['lodash','../../config/logger','moment','bluebird','request-promise','./interval.attributes','../../components/extensions/rewrite','define','tools_intervals','rewrite'];(function(_0x536689,_0x3cf681){var _0x1164af=function(_0x221c0f){while(--_0x221c0f){_0x536689['push'](_0x536689['shift']());}};_0x1164af(++_0x3cf681);}(_0xb97f,0xe6));var _0xfb97=function(_0x5b6169,_0x32a98f){_0x5b6169=_0x5b6169-0x0;var _0x421607=_0xb97f[_0x5b6169];return _0x421607;};'use strict';var _=require(_0xfb97('0x0'));var util=require('util');var logger=require(_0xfb97('0x1'))('api');var moment=require(_0xfb97('0x2'));var BPromise=require(_0xfb97('0x3'));var rp=require(_0xfb97('0x4'));var attributes=require(_0xfb97('0x5'));var extensions=require(_0xfb97('0x6'));module['exports']=function(_0x2fb2b8,_0x2cd337){return _0x2fb2b8[_0xfb97('0x7')]('Interval',attributes,{'tableName':_0xfb97('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xd7e453,_0x6adae8){extensions['rewrite'](_0x2fb2b8,_0xd7e453);},'afterBulkCreate':function(_0x57c3ce,_0x1e91df,_0x360e59){_0x360e59();extensions[_0xfb97('0x9')](_0x2fb2b8,_0x57c3ce[0x0]);},'afterUpdate':function(_0x474305,_0x3bca9f){extensions[_0xfb97('0x9')](_0x2fb2b8,_0x474305);},'afterDestroy':function(_0x5d2f36,_0x53a74a){extensions[_0xfb97('0x9')](_0x2fb2b8,_0x5d2f36);}}});}; \ No newline at end of file +var _0x4b2a=['rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../components/extensions/rewrite','define','Interval','tools_intervals'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x4b2a,0x91));var _0xa4b2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4b2a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xa4b2('0x0'));var util=require(_0xa4b2('0x1'));var logger=require(_0xa4b2('0x2'))(_0xa4b2('0x3'));var moment=require(_0xa4b2('0x4'));var BPromise=require(_0xa4b2('0x5'));var rp=require(_0xa4b2('0x6'));var attributes=require('./interval.attributes');var extensions=require(_0xa4b2('0x7'));module['exports']=function(_0x43d27d,_0x3da990){return _0x43d27d[_0xa4b2('0x8')](_0xa4b2('0x9'),attributes,{'tableName':_0xa4b2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x566a7b,_0x3c4c5d){extensions['rewrite'](_0x43d27d,_0x566a7b);},'afterBulkCreate':function(_0x32c7a6,_0x5f30c5,_0x18ef27){_0x18ef27();extensions[_0xa4b2('0xb')](_0x43d27d,_0x32c7a6[0x0]);},'afterUpdate':function(_0x52ec85,_0x4a3b4f){extensions[_0xa4b2('0xb')](_0x43d27d,_0x52ec85);},'afterDestroy':function(_0x13b46c,_0x5c2c36){extensions[_0xa4b2('0xb')](_0x43d27d,_0x13b46c);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index df5d2cd..62df747 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 _0x6334=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','Interval,\x20%s,\x20%s','result','catch','GetInterval','findAll','options','where','attributes','limit','map','include','model','message','ShowInterval','Interval','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x330a8d,_0x35a886){var _0x4cfc2f=function(_0x1e8889){while(--_0x1e8889){_0x330a8d['push'](_0x330a8d['shift']());}};_0x4cfc2f(++_0x35a886);}(_0x6334,0x119));var _0x4633=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0x6334[_0x40b493];return _0x548365;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var moment=require(_0x4633('0x2'));var BPromise=require(_0x4633('0x3'));var rs=require(_0x4633('0x4'));var fs=require('fs');var Redis=require(_0x4633('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4633('0x6'));var logger=require(_0x4633('0x7'))(_0x4633('0x8'));var config=require(_0x4633('0x9'));var jayson=require(_0x4633('0xa'));var client=jayson[_0x4633('0xb')][_0x4633('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a8997,_0x5647f1,_0x56891d){return new BPromise(function(_0x21af74,_0x148e72){return client['request'](_0x4a8997,_0x56891d)[_0x4633('0xd')](function(_0x31e794){logger[_0x4633('0xe')]('Interval,\x20%s,\x20%s',_0x5647f1,_0x4633('0xf'));logger[_0x4633('0x10')]('Interval,\x20%s,\x20%s,\x20%s',_0x5647f1,_0x4633('0xf'),JSON[_0x4633('0x11')](_0x31e794));if(_0x31e794[_0x4633('0x12')]){if(_0x31e794[_0x4633('0x12')]['code']===0x1f4){logger[_0x4633('0x12')](_0x4633('0x13'),_0x5647f1,_0x31e794[_0x4633('0x12')]['message']);return _0x148e72(_0x31e794['error']['message']);}logger[_0x4633('0x12')](_0x4633('0x13'),_0x5647f1,_0x31e794['error']['message']);return _0x21af74(_0x31e794[_0x4633('0x12')]['message']);}else{logger[_0x4633('0xe')](_0x4633('0x13'),_0x5647f1,_0x4633('0xf'));_0x21af74(_0x31e794[_0x4633('0x14')]['message']);}})[_0x4633('0x15')](function(_0x15bd98){logger[_0x4633('0x12')]('Interval,\x20%s,\x20%s',_0x5647f1,_0x15bd98);_0x148e72(_0x15bd98);});});}exports[_0x4633('0x16')]=function(_0x37e536){var _0x1c7186=this;return new Promise(function(_0x2ad562,_0xbab957){return db['Interval'][_0x4633('0x17')]({'raw':_0x37e536[_0x4633('0x18')]?_0x37e536['options']['raw']===undefined?!![]:![]:!![],'where':_0x37e536[_0x4633('0x18')]?_0x37e536['options'][_0x4633('0x19')]||null:null,'attributes':_0x37e536['options']?_0x37e536['options'][_0x4633('0x1a')]||null:null,'limit':_0x37e536[_0x4633('0x18')]?_0x37e536[_0x4633('0x18')][_0x4633('0x1b')]||null:null,'include':_0x37e536[_0x4633('0x18')]?_0x37e536[_0x4633('0x18')]['include']?_[_0x4633('0x1c')](_0x37e536['options'][_0x4633('0x1d')],function(_0xcfac3f){return{'model':db[_0xcfac3f[_0x4633('0x1e')]],'as':_0xcfac3f['as'],'attributes':_0xcfac3f[_0x4633('0x1a')],'include':_0xcfac3f[_0x4633('0x1d')]?_['map'](_0xcfac3f[_0x4633('0x1d')],function(_0x399220){return{'model':db[_0x399220[_0x4633('0x1e')]],'as':_0x399220['as'],'attributes':_0x399220[_0x4633('0x1a')],'include':_0x399220[_0x4633('0x1d')]?_[_0x4633('0x1c')](_0x399220[_0x4633('0x1d')],function(_0x368582){return{'model':db[_0x368582[_0x4633('0x1e')]],'as':_0x368582['as'],'attributes':_0x368582[_0x4633('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4633('0xd')](function(_0x2539a2){logger[_0x4633('0xe')](_0x4633('0x16'),_0x37e536);logger[_0x4633('0x10')](_0x4633('0x16'),_0x37e536,JSON[_0x4633('0x11')](_0x2539a2));_0x2ad562(_0x2539a2);})[_0x4633('0x15')](function(_0x5de12a){logger[_0x4633('0x12')](_0x4633('0x16'),_0x5de12a[_0x4633('0x1f')],_0x37e536);_0xbab957(_0x1c7186[_0x4633('0x12')](0x1f4,_0x5de12a[_0x4633('0x1f')]));});});};exports[_0x4633('0x20')]=function(_0x559fa5){var _0x23c33c=this;return new Promise(function(_0x52fc85,_0x1d3811){return db[_0x4633('0x21')][_0x4633('0x22')]({'raw':_0x559fa5[_0x4633('0x18')]?_0x559fa5[_0x4633('0x18')][_0x4633('0x23')]===undefined?!![]:![]:!![],'where':_0x559fa5[_0x4633('0x18')]?_0x559fa5[_0x4633('0x18')][_0x4633('0x19')]||null:null,'attributes':_0x559fa5[_0x4633('0x18')]?_0x559fa5[_0x4633('0x18')][_0x4633('0x1a')]||null:null,'include':_0x559fa5[_0x4633('0x18')]?_0x559fa5[_0x4633('0x18')]['include']?_['map'](_0x559fa5[_0x4633('0x18')][_0x4633('0x1d')],function(_0x5177f2){return{'model':db[_0x5177f2[_0x4633('0x1e')]],'as':_0x5177f2['as'],'attributes':_0x5177f2[_0x4633('0x1a')],'include':_0x5177f2[_0x4633('0x1d')]?_[_0x4633('0x1c')](_0x5177f2['include'],function(_0x3f92ef){return{'model':db[_0x3f92ef['model']],'as':_0x3f92ef['as'],'attributes':_0x3f92ef[_0x4633('0x1a')],'include':_0x3f92ef[_0x4633('0x1d')]?_[_0x4633('0x1c')](_0x3f92ef[_0x4633('0x1d')],function(_0x213768){return{'model':db[_0x213768[_0x4633('0x1e')]],'as':_0x213768['as'],'attributes':_0x213768[_0x4633('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4633('0xd')](function(_0x546390){logger[_0x4633('0xe')](_0x4633('0x20'),_0x559fa5);logger['debug'](_0x4633('0x20'),_0x559fa5,JSON[_0x4633('0x11')](_0x546390));_0x52fc85(_0x546390);})[_0x4633('0x15')](function(_0x468648){logger['error']('ShowInterval',_0x468648[_0x4633('0x1f')],_0x559fa5);_0x1d3811(_0x23c33c['error'](0x1f4,_0x468648['message']));});});}; \ No newline at end of file +var _0xbd50=['Interval,\x20%s,\x20%s,\x20%s','error','code','message','result','GetInterval','Interval','findAll','options','raw','limit','map','include','model','attributes','info','debug','stringify','catch','ShowInterval','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','Interval,\x20%s,\x20%s','request\x20sent'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0xbd50,0x196));var _0x0bd5=function(_0x23520e,_0x3deec9){_0x23520e=_0x23520e-0x0;var _0x1a9d93=_0xbd50[_0x23520e];return _0x1a9d93;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});}exports[_0x0bd5('0x13')]=function(_0x833c14){var _0x23be38=this;return new Promise(function(_0xc58e12,_0x19fe20){return db[_0x0bd5('0x14')][_0x0bd5('0x15')]({'raw':_0x833c14[_0x0bd5('0x16')]?_0x833c14[_0x0bd5('0x16')][_0x0bd5('0x17')]===undefined?!![]:![]:!![],'where':_0x833c14[_0x0bd5('0x16')]?_0x833c14['options']['where']||null:null,'attributes':_0x833c14['options']?_0x833c14['options']['attributes']||null:null,'limit':_0x833c14[_0x0bd5('0x16')]?_0x833c14[_0x0bd5('0x16')][_0x0bd5('0x18')]||null:null,'include':_0x833c14[_0x0bd5('0x16')]?_0x833c14[_0x0bd5('0x16')]['include']?_[_0x0bd5('0x19')](_0x833c14[_0x0bd5('0x16')][_0x0bd5('0x1a')],function(_0x5a8139){return{'model':db[_0x5a8139[_0x0bd5('0x1b')]],'as':_0x5a8139['as'],'attributes':_0x5a8139['attributes'],'include':_0x5a8139['include']?_[_0x0bd5('0x19')](_0x5a8139[_0x0bd5('0x1a')],function(_0x184db3){return{'model':db[_0x184db3['model']],'as':_0x184db3['as'],'attributes':_0x184db3[_0x0bd5('0x1c')],'include':_0x184db3['include']?_[_0x0bd5('0x19')](_0x184db3[_0x0bd5('0x1a')],function(_0x18cec3){return{'model':db[_0x18cec3[_0x0bd5('0x1b')]],'as':_0x18cec3['as'],'attributes':_0x18cec3[_0x0bd5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0bd5('0xb')](function(_0x19bb5e){logger[_0x0bd5('0x1d')](_0x0bd5('0x13'),_0x833c14);logger[_0x0bd5('0x1e')](_0x0bd5('0x13'),_0x833c14,JSON[_0x0bd5('0x1f')](_0x19bb5e));_0xc58e12(_0x19bb5e);})[_0x0bd5('0x20')](function(_0x2704ee){logger['error'](_0x0bd5('0x13'),_0x2704ee[_0x0bd5('0x11')],_0x833c14);_0x19fe20(_0x23be38['error'](0x1f4,_0x2704ee[_0x0bd5('0x11')]));});});};exports[_0x0bd5('0x21')]=function(_0x5d9d20){var _0x11f482=this;return new Promise(function(_0x1b7cf4,_0x28ab82){return db[_0x0bd5('0x14')]['find']({'raw':_0x5d9d20[_0x0bd5('0x16')]?_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x17')]===undefined?!![]:![]:!![],'where':_0x5d9d20[_0x0bd5('0x16')]?_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x22')]||null:null,'attributes':_0x5d9d20['options']?_0x5d9d20[_0x0bd5('0x16')]['attributes']||null:null,'include':_0x5d9d20[_0x0bd5('0x16')]?_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x1a')]?_[_0x0bd5('0x19')](_0x5d9d20[_0x0bd5('0x16')][_0x0bd5('0x1a')],function(_0x15e380){return{'model':db[_0x15e380[_0x0bd5('0x1b')]],'as':_0x15e380['as'],'attributes':_0x15e380[_0x0bd5('0x1c')],'include':_0x15e380[_0x0bd5('0x1a')]?_[_0x0bd5('0x19')](_0x15e380[_0x0bd5('0x1a')],function(_0x3cfb74){return{'model':db[_0x3cfb74['model']],'as':_0x3cfb74['as'],'attributes':_0x3cfb74[_0x0bd5('0x1c')],'include':_0x3cfb74[_0x0bd5('0x1a')]?_['map'](_0x3cfb74['include'],function(_0x6b93ed){return{'model':db[_0x6b93ed[_0x0bd5('0x1b')]],'as':_0x6b93ed['as'],'attributes':_0x6b93ed[_0x0bd5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0bd5('0xb')](function(_0x1dd2e1){logger[_0x0bd5('0x1d')](_0x0bd5('0x21'),_0x5d9d20);logger[_0x0bd5('0x1e')](_0x0bd5('0x21'),_0x5d9d20,JSON[_0x0bd5('0x1f')](_0x1dd2e1));_0x1b7cf4(_0x1dd2e1);})[_0x0bd5('0x20')](function(_0x3c6aa5){logger[_0x0bd5('0xf')]('ShowInterval',_0x3c6aa5[_0x0bd5('0x11')],_0x5d9d20);_0x28ab82(_0x11f482['error'](0x1f4,_0x3c6aa5[_0x0bd5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index fc198b4..cbd0c41 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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x0b0e,0x187));var _0xe0b0=function(_0x45f4e9,_0x5246fd){_0x45f4e9=_0x45f4e9-0x0;var _0x559d8f=_0x0b0e[_0x45f4e9];return _0x559d8f;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0b0e,0x187));var _0xe0b0=function(_0x56d1ed,_0x237e84){_0x56d1ed=_0x56d1ed-0x0;var _0x1b282b=_0x0b0e[_0x56d1ed];return _0x1b282b;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('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 f5f9b02..e2e65ee 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 _0x0713=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','/rest/api/2/issue','POST','Basic\x20','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error'];(function(_0x265b8a,_0x1c5f49){var _0x204a98=function(_0x4debf5){while(--_0x4debf5){_0x265b8a['push'](_0x265b8a['shift']());}};_0x204a98(++_0x1c5f49);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var USERNAME=_0x3071('0x2');var PASSWORD=_0x3071('0x3');function openIssue(_0x864539,_0x52b5fb){var _0x2c547f={'fields':{'project':{'key':_0x864539[_0x3071('0x4')]||_0x3071('0x5')},'summary':(_0x864539[_0x3071('0x6')]||_0x3071('0x7'))+_0x3071('0x8')+_0x864539['ip'],'description':_0x864539[_0x3071('0x9')]||JSON[_0x3071('0xa')](_0x864539),'issuetype':{'name':_0x864539[_0x3071('0xb')]||_0x3071('0xc')}}};_0x2c547f[_0x3071('0xd')][_0x3071('0xe')]=_0x864539[_0x3071('0xf')];_0x2c547f['fields'][_0x3071('0x10')]=_0x864539[_0x3071('0x11')];_0x2c547f[_0x3071('0xd')][_0x3071('0x12')]=_0x864539[_0x3071('0x13')];_0x2c547f['fields'][_0x3071('0x14')]=_0x864539[_0x3071('0x15')];_0x2c547f[_0x3071('0xd')][_0x3071('0x16')]=_0x864539[_0x3071('0x17')];_0x2c547f['fields']['customfield_10102']=_0x864539['ip'];var _0x1826ca={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x3071('0x18'),'method':_0x3071('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x3071('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x3071('0x1b'))}};var _0x45c93b=JSON[_0x3071('0xa')](_0x2c547f);var _0x1f14e1=https[_0x3071('0x1c')](_0x1826ca,function(_0x2a6a4b){_0x2a6a4b[_0x3071('0x1d')](_0x3071('0x1e'));var _0x21aad3='';_0x2a6a4b['on'](_0x3071('0x1f'),function(_0x5f3c22){_0x21aad3+=_0x5f3c22;});_0x2a6a4b['on'](_0x3071('0x20'),function(){if(_0x52b5fb){return _0x52b5fb[_0x3071('0x21')](_0x2a6a4b[_0x3071('0x22')])[_0x3071('0x23')](JSON[_0x3071('0x24')](_0x21aad3));}});});_0x1f14e1['on'](_0x3071('0x25'),function(_0x105bbb){if(_0x52b5fb){return _0x52b5fb[_0x3071('0x21')](0x1f4)['json']({'errors':[{'message':_0x3071('0x26'),'type':_0x3071('0x27')}]});}});_0x1f14e1[_0x3071('0x28')](_0x45c93b);_0x1f14e1['end']();}exports[_0x3071('0x29')]=openIssue;exports['send']=function(_0x833074,_0x43128c){_0x833074[_0x3071('0x2a')]['ip']=_0x833074[_0x3071('0x2b')][_0x3071('0x2c')]||_0x833074[_0x3071('0x2d')][_0x3071('0x2e')]||_0x833074[_0x3071('0x2f')]['remoteAddress']||_0x833074['connection'][_0x3071('0x2f')][_0x3071('0x2e')];return openIssue(_0x833074[_0x3071('0x2a')],_0x43128c);}; \ No newline at end of file +var _0xb7e7=['reason','track.xcallymotion.com','POST','toString','base64','setEncoding','utf8','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','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','support','key','MOTGUI','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb7e7[_0x16d10f];return _0x50c823;};'use strict';var BPromise=require(_0x7b7e('0x0'));var https=require('https');var logger=require(_0x7b7e('0x1'))('api');var USERNAME=_0x7b7e('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x3f5804,_0x556d68){var _0x31d0ed={'fields':{'project':{'key':_0x3f5804[_0x7b7e('0x3')]||_0x7b7e('0x4')},'summary':(_0x3f5804['summary']||'Report')+_0x7b7e('0x5')+_0x3f5804['ip'],'description':_0x3f5804[_0x7b7e('0x6')]||JSON[_0x7b7e('0x7')](_0x3f5804),'issuetype':{'name':_0x3f5804['issuetype']||_0x7b7e('0x8')}}};_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0xa')]=_0x3f5804[_0x7b7e('0xb')];_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0xc')]=_0x3f5804[_0x7b7e('0xd')];_0x31d0ed['fields'][_0x7b7e('0xe')]=_0x3f5804[_0x7b7e('0xf')];_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0x10')]=_0x3f5804[_0x7b7e('0x11')];_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0x12')]=_0x3f5804[_0x7b7e('0x13')];_0x31d0ed[_0x7b7e('0x9')]['customfield_10102']=_0x3f5804['ip'];var _0x267446={'host':_0x7b7e('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x7b7e('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x7b7e('0x16')](_0x7b7e('0x17'))}};var _0xf067da=JSON[_0x7b7e('0x7')](_0x31d0ed);var _0x3d2fb2=https['request'](_0x267446,function(_0x51baf6){_0x51baf6[_0x7b7e('0x18')](_0x7b7e('0x19'));var _0x27f999='';_0x51baf6['on'](_0x7b7e('0x1a'),function(_0x2cc400){_0x27f999+=_0x2cc400;});_0x51baf6['on'](_0x7b7e('0x1b'),function(){if(_0x556d68){return _0x556d68[_0x7b7e('0x1c')](_0x51baf6[_0x7b7e('0x1d')])[_0x7b7e('0x1e')](JSON[_0x7b7e('0x1f')](_0x27f999));}});});_0x3d2fb2['on'](_0x7b7e('0x20'),function(_0x14f4fe){if(_0x556d68){return _0x556d68[_0x7b7e('0x1c')](0x1f4)[_0x7b7e('0x1e')]({'errors':[{'message':_0x7b7e('0x21'),'type':_0x7b7e('0x22')}]});}});_0x3d2fb2[_0x7b7e('0x23')](_0xf067da);_0x3d2fb2['end']();}exports[_0x7b7e('0x24')]=openIssue;exports[_0x7b7e('0x25')]=function(_0x24718c,_0x4c0647){_0x24718c[_0x7b7e('0x26')]['ip']=_0x24718c[_0x7b7e('0x27')][_0x7b7e('0x28')]||_0x24718c[_0x7b7e('0x29')][_0x7b7e('0x2a')]||_0x24718c[_0x7b7e('0x2b')][_0x7b7e('0x2a')]||_0x24718c[_0x7b7e('0x29')]['socket']['remoteAddress'];return openIssue(_0x24718c['body'],_0x4c0647);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 6572f59..416e582 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 _0xc2d4=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x427563,_0x120178){var _0x21c87a=function(_0x14a0b6){while(--_0x14a0b6){_0x427563['push'](_0x427563['shift']());}};_0x21c87a(++_0x120178);}(_0xc2d4,0xdf));var _0x4c2d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc2d4[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x4c2d('0x0'));var path=require(_0x4c2d('0x1'));var timeout=require(_0x4c2d('0x2'));var express=require(_0x4c2d('0x3'));var router=express[_0x4c2d('0x4')]();var auth=require(_0x4c2d('0x5'));var interaction=require(_0x4c2d('0x6'));var config=require(_0x4c2d('0x7'));var controller=require(_0x4c2d('0x8'));router[_0x4c2d('0x9')]('/',auth[_0x4c2d('0xa')](),controller[_0x4c2d('0xb')]);router[_0x4c2d('0x9')](_0x4c2d('0xc'),auth[_0x4c2d('0xa')](),controller[_0x4c2d('0xd')]);router[_0x4c2d('0x9')]('/:id',auth[_0x4c2d('0xa')](),controller['show']);router[_0x4c2d('0xe')]('/',auth[_0x4c2d('0xa')](),controller[_0x4c2d('0xf')]);router[_0x4c2d('0x10')](_0x4c2d('0x11'),auth[_0x4c2d('0xa')](),controller['update']);router[_0x4c2d('0x12')](_0x4c2d('0x11'),auth[_0x4c2d('0xa')](),controller[_0x4c2d('0x13')]);module[_0x4c2d('0x14')]=router; \ No newline at end of file +var _0x997d=['/:id','update','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','describe','show','post','create'];(function(_0x371cfd,_0x3d0a78){var _0x38ebda=function(_0x13c934){while(--_0x13c934){_0x371cfd['push'](_0x371cfd['shift']());}};_0x38ebda(++_0x3d0a78);}(_0x997d,0x135));var _0xd997=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0x997d[_0x59b439];return _0x521ea3;};'use strict';var multer=require(_0xd997('0x0'));var util=require(_0xd997('0x1'));var path=require(_0xd997('0x2'));var timeout=require('connect-timeout');var express=require(_0xd997('0x3'));var router=express['Router']();var auth=require(_0xd997('0x4'));var interaction=require(_0xd997('0x5'));var config=require(_0xd997('0x6'));var controller=require(_0xd997('0x7'));router[_0xd997('0x8')]('/',auth[_0xd997('0x9')](),controller['index']);router['get'](_0xd997('0xa'),auth[_0xd997('0x9')](),controller[_0xd997('0xb')]);router['get']('/:id',auth[_0xd997('0x9')](),controller[_0xd997('0xc')]);router[_0xd997('0xd')]('/',auth[_0xd997('0x9')](),controller[_0xd997('0xe')]);router['put'](_0xd997('0xf'),auth[_0xd997('0x9')](),controller[_0xd997('0x10')]);router['delete'](_0xd997('0xf'),auth[_0xd997('0x9')](),controller['destroy']);module[_0xd997('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index ed5ae05..631795b 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 _0xa769=['STRING','TEXT','long','sequelize'];(function(_0x39da73,_0x4a8538){var _0x50ae1d=function(_0x253e98){while(--_0x253e98){_0x39da73['push'](_0x39da73['shift']());}};_0x50ae1d(++_0x4a8538);}(_0xa769,0xfb));var _0x9a76=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa769[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x9a76('0x0'));module['exports']={'question':{'type':Sequelize[_0x9a76('0x1')]},'answer':{'type':Sequelize[_0x9a76('0x2')](_0x9a76('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x9a76('0x1')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9a76('0x1')]},'calleridnum':{'type':Sequelize[_0x9a76('0x1')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb575=['TEXT','STRING','sequelize','exports'];(function(_0x2727c2,_0x368a6c){var _0x4a61a5=function(_0x594598){while(--_0x594598){_0x2727c2['push'](_0x2727c2['shift']());}};_0x4a61a5(++_0x368a6c);}(_0xb575,0xda));var _0x5b57=function(_0x4fff08,_0x1b0463){_0x4fff08=_0x4fff08-0x0;var _0x43ca39=_0xb575[_0x4fff08];return _0x43ca39;};'use strict';var Sequelize=require(_0x5b57('0x0'));module[_0x5b57('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x5b57('0x2')]('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x5b57('0x3')]},'uniqueid':{'type':Sequelize[_0x5b57('0x3')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5b57('0x3')]},'questionId':{'type':Sequelize[_0x5b57('0x3')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 90b54a9..f6e1ea2 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 _0x7a54=['mustache','util','path','sox','ejs','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','index','JscriptyAnswerReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','offset','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','include','rows','catch','show','params','length','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x385ca7,_0x1c4290){var _0x2f122f=function(_0x366592){while(--_0x366592){_0x385ca7['push'](_0x385ca7['shift']());}};_0x2f122f(++_0x1c4290);}(_0x7a54,0x106));var _0x47a5=function(_0x3f2289,_0x3a4ccb){_0x3f2289=_0x3f2289-0x0;var _0x264190=_0x7a54[_0x3f2289];return _0x264190;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x47a5('0xe'));var hardwareService=require(_0x47a5('0xf'));var Redis=require('ioredis');var qs=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];function respondWithStatusCode(_0x250fad,_0xd612dd){_0xd612dd=_0xd612dd||0xcc;return function(_0xd308b8){if(_0xd308b8){return _0x250fad[_0x47a5('0x14')](_0xd612dd);}return _0x250fad['status'](_0xd612dd)[_0x47a5('0x15')]();};}function respondWithResult(_0x221b54,_0x1cf309){_0x1cf309=_0x1cf309||0xc8;return function(_0x711793){if(_0x711793){return _0x221b54[_0x47a5('0x16')](_0x1cf309)[_0x47a5('0x17')](_0x711793);}};}function respondWithFilteredResult(_0x3c6c46,_0x190faa){return function(_0x4e99a8){if(_0x4e99a8){var _0x362359=_0x4e99a8[_0x47a5('0x18')],_0x11faf5=_0x190faa['offset'],_0x3b001e=_0x190faa['offset']+_0x190faa[_0x47a5('0x19')],_0x2a2cbb;if(_0x3b001e>=_0x362359){_0x3b001e=_0x362359;_0x2a2cbb=0xc8;}else{_0x2a2cbb=0xce;}_0x3c6c46['status'](_0x2a2cbb);return _0x3c6c46['set'](_0x47a5('0x1a'),_0x11faf5+'-'+_0x3b001e+'/'+_0x362359)[_0x47a5('0x17')](_0x4e99a8);}return null;};}function patchUpdates(_0x2ce454){return function(_0x1ef371){try{jsonpatch[_0x47a5('0x1b')](_0x1ef371,_0x2ce454,!![]);}catch(_0x12b98e){return BPromise[_0x47a5('0x1c')](_0x12b98e);}return _0x1ef371[_0x47a5('0x1d')]();};}function saveUpdates(_0x3aed38,_0x4a9fcb){return function(_0x1570bc){if(_0x1570bc){return _0x1570bc[_0x47a5('0x1e')](_0x3aed38)['then'](function(_0x2b0360){return _0x2b0360;});}return null;};}function removeEntity(_0x1f03f7,_0x36874d){return function(_0x4c5910){if(_0x4c5910){return _0x4c5910[_0x47a5('0x1f')]()[_0x47a5('0x20')](function(){_0x1f03f7[_0x47a5('0x16')](0xcc)[_0x47a5('0x15')]();});}};}function handleEntityNotFound(_0x5ef1b1,_0xe2dea9){return function(_0x385687){if(!_0x385687){_0x5ef1b1['sendStatus'](0x194);}return _0x385687;};}function handleError(_0x28747d,_0xc4cd63){_0xc4cd63=_0xc4cd63||0x1f4;return function(_0x4437f1){logger[_0x47a5('0x21')](_0x4437f1[_0x47a5('0x22')]);if(_0x4437f1['name']){delete _0x4437f1['name'];}_0x28747d[_0x47a5('0x16')](_0xc4cd63)['send'](_0x4437f1);};}exports[_0x47a5('0x23')]=function(_0x5b6c4e,_0x23cb77){var _0x378208={},_0x36ad34={},_0x1dac65={'count':0x0,'rows':[]};var _0x21f296=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x36ad34[_0x47a5('0x26')]=_[_0x47a5('0x27')](_0x21f296);_0x36ad34[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x5b6c4e[_0x47a5('0x28')]);_0x36ad34[_0x47a5('0x29')]=_['intersection'](_0x36ad34[_0x47a5('0x26')],_0x36ad34['query']);_0x378208[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x36ad34[_0x47a5('0x26')],qs['fields'](_0x5b6c4e[_0x47a5('0x28')][_0x47a5('0x2c')]));_0x378208[_0x47a5('0x2a')]=_0x378208[_0x47a5('0x2a')]['length']?_0x378208['attributes']:_0x36ad34[_0x47a5('0x26')];if(!_0x5b6c4e[_0x47a5('0x28')]['hasOwnProperty']('nolimit')){_0x378208[_0x47a5('0x19')]=qs[_0x47a5('0x19')](_0x5b6c4e['query'][_0x47a5('0x19')]);_0x378208['offset']=qs[_0x47a5('0x2d')](_0x5b6c4e[_0x47a5('0x28')]['offset']);}_0x378208['order']=qs[_0x47a5('0x2e')](_0x5b6c4e['query'][_0x47a5('0x2e')]);_0x378208[_0x47a5('0x2f')]=qs[_0x47a5('0x29')](_['pick'](_0x5b6c4e[_0x47a5('0x28')],_0x36ad34['filters']));if(_0x5b6c4e['query'][_0x47a5('0x30')]){_0x378208['where']=_[_0x47a5('0x31')](_0x378208['where'],{'$or':_[_0x47a5('0x32')](_0x21f296,function(_0x3534cb){if(_0x3534cb[_0x47a5('0x33')][_0x47a5('0x34')]!==_0x47a5('0x35')){var _0xed6320={};_0xed6320[_0x3534cb[_0x47a5('0x36')]]={'$like':'%'+_0x5b6c4e[_0x47a5('0x28')][_0x47a5('0x30')]+'%'};return _0xed6320;}})});}_0x378208=_['merge']({},_0x378208,_0x5b6c4e[_0x47a5('0x37')]);var _0x10f136={'where':_0x378208['where']};return db[_0x47a5('0x24')][_0x47a5('0x18')](_0x10f136)[_0x47a5('0x20')](function(_0x49c4b5){_0x1dac65[_0x47a5('0x18')]=_0x49c4b5;if(_0x5b6c4e[_0x47a5('0x28')]['includeAll']){_0x378208[_0x47a5('0x38')]=[{'all':!![]}];}return db[_0x47a5('0x24')]['findAll'](_0x378208);})['then'](function(_0x5ebd8c){_0x1dac65[_0x47a5('0x39')]=_0x5ebd8c;return _0x1dac65;})['then'](respondWithFilteredResult(_0x23cb77,_0x378208))[_0x47a5('0x3a')](handleError(_0x23cb77,null));};exports[_0x47a5('0x3b')]=function(_0x301a85,_0x111f0d){var _0x1b2c80={'raw':!![],'where':{'id':_0x301a85[_0x47a5('0x3c')]['id']}},_0xcb5243={};_0xcb5243[_0x47a5('0x26')]=_[_0x47a5('0x27')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0xcb5243[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x301a85['query']);_0xcb5243[_0x47a5('0x29')]=_[_0x47a5('0x2b')](_0xcb5243[_0x47a5('0x26')],_0xcb5243[_0x47a5('0x28')]);_0x1b2c80['attributes']=_[_0x47a5('0x2b')](_0xcb5243['model'],qs['fields'](_0x301a85['query']['fields']));_0x1b2c80[_0x47a5('0x2a')]=_0x1b2c80['attributes'][_0x47a5('0x3d')]?_0x1b2c80[_0x47a5('0x2a')]:_0xcb5243[_0x47a5('0x26')];if(_0x301a85['query'][_0x47a5('0x3e')]){_0x1b2c80[_0x47a5('0x38')]=[{'all':!![]}];}_0x1b2c80=_['merge']({},_0x1b2c80,_0x301a85['options']);return db[_0x47a5('0x24')]['find'](_0x1b2c80)[_0x47a5('0x20')](handleEntityNotFound(_0x111f0d,null))[_0x47a5('0x20')](respondWithResult(_0x111f0d,null))[_0x47a5('0x3a')](handleError(_0x111f0d,null));};exports[_0x47a5('0x3f')]=function(_0x34a9ae,_0xf0edbb){return db[_0x47a5('0x24')][_0x47a5('0x3f')](_0x34a9ae[_0x47a5('0x40')],{})[_0x47a5('0x20')](respondWithResult(_0xf0edbb,0xc9))[_0x47a5('0x3a')](handleError(_0xf0edbb,null));};exports[_0x47a5('0x1e')]=function(_0xe28d76,_0x3574d4){if(_0xe28d76[_0x47a5('0x40')]['id']){delete _0xe28d76[_0x47a5('0x40')]['id'];}return db['JscriptyAnswerReport'][_0x47a5('0x41')]({'where':{'id':_0xe28d76[_0x47a5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3574d4,null))['then'](saveUpdates(_0xe28d76[_0x47a5('0x40')],null))['then'](respondWithResult(_0x3574d4,null))[_0x47a5('0x3a')](handleError(_0x3574d4,null));};exports[_0x47a5('0x1f')]=function(_0x54c35f,_0x4f62d3){return db[_0x47a5('0x24')]['find']({'where':{'id':_0x54c35f[_0x47a5('0x3c')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x20')](removeEntity(_0x4f62d3,null))[_0x47a5('0x3a')](handleError(_0x4f62d3,null));};exports[_0x47a5('0x42')]=function(_0x26acd2,_0x238ebb){return db['JscriptyAnswerReport']['describe']()[_0x47a5('0x20')](respondWithResult(_0x238ebb,null))[_0x47a5('0x3a')](handleError(_0x238ebb,null));}; \ No newline at end of file +var _0x7a54=['mustache','util','path','sox','ejs','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','index','JscriptyAnswerReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','offset','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','include','rows','catch','show','params','length','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x27c0b5,_0xafe27d){var _0xdeeb41=function(_0x4a7a07){while(--_0x4a7a07){_0x27c0b5['push'](_0x27c0b5['shift']());}};_0xdeeb41(++_0xafe27d);}(_0x7a54,0x106));var _0x47a5=function(_0x56408f,_0x45c6f8){_0x56408f=_0x56408f-0x0;var _0x56c951=_0x7a54[_0x56408f];return _0x56c951;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x47a5('0xe'));var hardwareService=require(_0x47a5('0xf'));var Redis=require('ioredis');var qs=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];function respondWithStatusCode(_0x250fad,_0xd612dd){_0xd612dd=_0xd612dd||0xcc;return function(_0xd308b8){if(_0xd308b8){return _0x250fad[_0x47a5('0x14')](_0xd612dd);}return _0x250fad['status'](_0xd612dd)[_0x47a5('0x15')]();};}function respondWithResult(_0x221b54,_0x1cf309){_0x1cf309=_0x1cf309||0xc8;return function(_0x711793){if(_0x711793){return _0x221b54[_0x47a5('0x16')](_0x1cf309)[_0x47a5('0x17')](_0x711793);}};}function respondWithFilteredResult(_0x3c6c46,_0x190faa){return function(_0x4e99a8){if(_0x4e99a8){var _0x362359=_0x4e99a8[_0x47a5('0x18')],_0x11faf5=_0x190faa['offset'],_0x3b001e=_0x190faa['offset']+_0x190faa[_0x47a5('0x19')],_0x2a2cbb;if(_0x3b001e>=_0x362359){_0x3b001e=_0x362359;_0x2a2cbb=0xc8;}else{_0x2a2cbb=0xce;}_0x3c6c46['status'](_0x2a2cbb);return _0x3c6c46['set'](_0x47a5('0x1a'),_0x11faf5+'-'+_0x3b001e+'/'+_0x362359)[_0x47a5('0x17')](_0x4e99a8);}return null;};}function patchUpdates(_0x2ce454){return function(_0x1ef371){try{jsonpatch[_0x47a5('0x1b')](_0x1ef371,_0x2ce454,!![]);}catch(_0x12b98e){return BPromise[_0x47a5('0x1c')](_0x12b98e);}return _0x1ef371[_0x47a5('0x1d')]();};}function saveUpdates(_0x3aed38,_0x4a9fcb){return function(_0x1570bc){if(_0x1570bc){return _0x1570bc[_0x47a5('0x1e')](_0x3aed38)['then'](function(_0x2b0360){return _0x2b0360;});}return null;};}function removeEntity(_0x1f03f7,_0x36874d){return function(_0x4c5910){if(_0x4c5910){return _0x4c5910[_0x47a5('0x1f')]()[_0x47a5('0x20')](function(){_0x1f03f7[_0x47a5('0x16')](0xcc)[_0x47a5('0x15')]();});}};}function handleEntityNotFound(_0x5ef1b1,_0xe2dea9){return function(_0x385687){if(!_0x385687){_0x5ef1b1['sendStatus'](0x194);}return _0x385687;};}function handleError(_0x28747d,_0xc4cd63){_0xc4cd63=_0xc4cd63||0x1f4;return function(_0x4437f1){logger[_0x47a5('0x21')](_0x4437f1[_0x47a5('0x22')]);if(_0x4437f1['name']){delete _0x4437f1['name'];}_0x28747d[_0x47a5('0x16')](_0xc4cd63)['send'](_0x4437f1);};}exports[_0x47a5('0x23')]=function(_0x5b6c4e,_0x23cb77){var _0x378208={},_0x36ad34={},_0x1dac65={'count':0x0,'rows':[]};var _0x21f296=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x36ad34[_0x47a5('0x26')]=_[_0x47a5('0x27')](_0x21f296);_0x36ad34[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x5b6c4e[_0x47a5('0x28')]);_0x36ad34[_0x47a5('0x29')]=_['intersection'](_0x36ad34[_0x47a5('0x26')],_0x36ad34['query']);_0x378208[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x36ad34[_0x47a5('0x26')],qs['fields'](_0x5b6c4e[_0x47a5('0x28')][_0x47a5('0x2c')]));_0x378208[_0x47a5('0x2a')]=_0x378208[_0x47a5('0x2a')]['length']?_0x378208['attributes']:_0x36ad34[_0x47a5('0x26')];if(!_0x5b6c4e[_0x47a5('0x28')]['hasOwnProperty']('nolimit')){_0x378208[_0x47a5('0x19')]=qs[_0x47a5('0x19')](_0x5b6c4e['query'][_0x47a5('0x19')]);_0x378208['offset']=qs[_0x47a5('0x2d')](_0x5b6c4e[_0x47a5('0x28')]['offset']);}_0x378208['order']=qs[_0x47a5('0x2e')](_0x5b6c4e['query'][_0x47a5('0x2e')]);_0x378208[_0x47a5('0x2f')]=qs[_0x47a5('0x29')](_['pick'](_0x5b6c4e[_0x47a5('0x28')],_0x36ad34['filters']));if(_0x5b6c4e['query'][_0x47a5('0x30')]){_0x378208['where']=_[_0x47a5('0x31')](_0x378208['where'],{'$or':_[_0x47a5('0x32')](_0x21f296,function(_0x3534cb){if(_0x3534cb[_0x47a5('0x33')][_0x47a5('0x34')]!==_0x47a5('0x35')){var _0xed6320={};_0xed6320[_0x3534cb[_0x47a5('0x36')]]={'$like':'%'+_0x5b6c4e[_0x47a5('0x28')][_0x47a5('0x30')]+'%'};return _0xed6320;}})});}_0x378208=_['merge']({},_0x378208,_0x5b6c4e[_0x47a5('0x37')]);var _0x10f136={'where':_0x378208['where']};return db[_0x47a5('0x24')][_0x47a5('0x18')](_0x10f136)[_0x47a5('0x20')](function(_0x49c4b5){_0x1dac65[_0x47a5('0x18')]=_0x49c4b5;if(_0x5b6c4e[_0x47a5('0x28')]['includeAll']){_0x378208[_0x47a5('0x38')]=[{'all':!![]}];}return db[_0x47a5('0x24')]['findAll'](_0x378208);})['then'](function(_0x5ebd8c){_0x1dac65[_0x47a5('0x39')]=_0x5ebd8c;return _0x1dac65;})['then'](respondWithFilteredResult(_0x23cb77,_0x378208))[_0x47a5('0x3a')](handleError(_0x23cb77,null));};exports[_0x47a5('0x3b')]=function(_0x301a85,_0x111f0d){var _0x1b2c80={'raw':!![],'where':{'id':_0x301a85[_0x47a5('0x3c')]['id']}},_0xcb5243={};_0xcb5243[_0x47a5('0x26')]=_[_0x47a5('0x27')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0xcb5243[_0x47a5('0x28')]=_[_0x47a5('0x27')](_0x301a85['query']);_0xcb5243[_0x47a5('0x29')]=_[_0x47a5('0x2b')](_0xcb5243[_0x47a5('0x26')],_0xcb5243[_0x47a5('0x28')]);_0x1b2c80['attributes']=_[_0x47a5('0x2b')](_0xcb5243['model'],qs['fields'](_0x301a85['query']['fields']));_0x1b2c80[_0x47a5('0x2a')]=_0x1b2c80['attributes'][_0x47a5('0x3d')]?_0x1b2c80[_0x47a5('0x2a')]:_0xcb5243[_0x47a5('0x26')];if(_0x301a85['query'][_0x47a5('0x3e')]){_0x1b2c80[_0x47a5('0x38')]=[{'all':!![]}];}_0x1b2c80=_['merge']({},_0x1b2c80,_0x301a85['options']);return db[_0x47a5('0x24')]['find'](_0x1b2c80)[_0x47a5('0x20')](handleEntityNotFound(_0x111f0d,null))[_0x47a5('0x20')](respondWithResult(_0x111f0d,null))[_0x47a5('0x3a')](handleError(_0x111f0d,null));};exports[_0x47a5('0x3f')]=function(_0x34a9ae,_0xf0edbb){return db[_0x47a5('0x24')][_0x47a5('0x3f')](_0x34a9ae[_0x47a5('0x40')],{})[_0x47a5('0x20')](respondWithResult(_0xf0edbb,0xc9))[_0x47a5('0x3a')](handleError(_0xf0edbb,null));};exports[_0x47a5('0x1e')]=function(_0xe28d76,_0x3574d4){if(_0xe28d76[_0x47a5('0x40')]['id']){delete _0xe28d76[_0x47a5('0x40')]['id'];}return db['JscriptyAnswerReport'][_0x47a5('0x41')]({'where':{'id':_0xe28d76[_0x47a5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3574d4,null))['then'](saveUpdates(_0xe28d76[_0x47a5('0x40')],null))['then'](respondWithResult(_0x3574d4,null))[_0x47a5('0x3a')](handleError(_0x3574d4,null));};exports[_0x47a5('0x1f')]=function(_0x54c35f,_0x4f62d3){return db[_0x47a5('0x24')]['find']({'where':{'id':_0x54c35f[_0x47a5('0x3c')]['id']}})[_0x47a5('0x20')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x20')](removeEntity(_0x4f62d3,null))[_0x47a5('0x3a')](handleError(_0x4f62d3,null));};exports[_0x47a5('0x42')]=function(_0x26acd2,_0x238ebb){return db['JscriptyAnswerReport']['describe']()[_0x47a5('0x20')](respondWithResult(_0x238ebb,null))[_0x47a5('0x3a')](handleError(_0x238ebb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 9d8f406..5fbab09 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 _0x7f17=['request-promise','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','bluebird'];(function(_0x4e7a64,_0xd09f5c){var _0x2a7b59=function(_0x55f6ad){while(--_0x55f6ad){_0x4e7a64['push'](_0x4e7a64['shift']());}};_0x2a7b59(++_0xd09f5c);}(_0x7f17,0xd7));var _0x77f1=function(_0x4a232c,_0x4db76b){_0x4a232c=_0x4a232c-0x0;var _0xb5807f=_0x7f17[_0x4a232c];return _0xb5807f;};'use strict';var _=require('lodash');var util=require(_0x77f1('0x0'));var logger=require(_0x77f1('0x1'))(_0x77f1('0x2'));var moment=require(_0x77f1('0x3'));var BPromise=require(_0x77f1('0x4'));var rp=require(_0x77f1('0x5'));var attributes=require(_0x77f1('0x6'));module['exports']=function(_0x59c9f7,_0x230259){return _0x59c9f7[_0x77f1('0x7')](_0x77f1('0x8'),attributes,{'tableName':_0x77f1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92e8=['./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','util','api','bluebird'];(function(_0x3d4149,_0x3c59fb){var _0x3a4460=function(_0x1293e0){while(--_0x1293e0){_0x3d4149['push'](_0x3d4149['shift']());}};_0x3a4460(++_0x3c59fb);}(_0x92e8,0x1e4));var _0x892e=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0x92e8[_0x25bca6];return _0x3f8d02;};'use strict';var _=require(_0x892e('0x0'));var util=require(_0x892e('0x1'));var logger=require('../../config/logger')(_0x892e('0x2'));var moment=require('moment');var BPromise=require(_0x892e('0x3'));var rp=require('request-promise');var attributes=require(_0x892e('0x4'));module[_0x892e('0x5')]=function(_0x415310,_0x11266f){return _0x415310[_0x892e('0x6')]('JscriptyAnswerReport',attributes,{'tableName':_0x892e('0x7'),'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 0d962ae..347f5c7 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 _0x206a=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x326cef,_0x390649){var _0x733254=function(_0xd442c5){while(--_0xd442c5){_0x326cef['push'](_0x326cef['shift']());}};_0x733254(++_0x390649);}(_0x206a,0xa8));var _0xa206=function(_0x5e6487,_0x2718b8){_0x5e6487=_0x5e6487-0x0;var _0x70c092=_0x206a[_0x5e6487];return _0x70c092;};'use strict';var _=require(_0xa206('0x0'));var util=require(_0xa206('0x1'));var moment=require(_0xa206('0x2'));var BPromise=require('bluebird');var rs=require(_0xa206('0x3'));var fs=require('fs');var Redis=require(_0xa206('0x4'));var db=require(_0xa206('0x5'))['db'];var utils=require(_0xa206('0x6'));var logger=require(_0xa206('0x7'))('rpc');var config=require(_0xa206('0x8'));var jayson=require(_0xa206('0x9'));var client=jayson[_0xa206('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d586a,_0x3ac123,_0xb0c444){return new BPromise(function(_0x5c1f8f,_0x2c54ec){return client['request'](_0x2d586a,_0xb0c444)[_0xa206('0xb')](function(_0x1ee907){logger['info'](_0xa206('0xc'),_0x3ac123,_0xa206('0xd'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3ac123,'request\x20sent',JSON[_0xa206('0xe')](_0x1ee907));if(_0x1ee907[_0xa206('0xf')]){if(_0x1ee907['error'][_0xa206('0x10')]===0x1f4){logger[_0xa206('0xf')](_0xa206('0xc'),_0x3ac123,_0x1ee907['error'][_0xa206('0x11')]);return _0x2c54ec(_0x1ee907[_0xa206('0xf')][_0xa206('0x11')]);}logger[_0xa206('0xf')](_0xa206('0xc'),_0x3ac123,_0x1ee907[_0xa206('0xf')]['message']);return _0x5c1f8f(_0x1ee907[_0xa206('0xf')][_0xa206('0x11')]);}else{logger[_0xa206('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3ac123,'request\x20sent');_0x5c1f8f(_0x1ee907[_0xa206('0x13')]['message']);}})[_0xa206('0x14')](function(_0x4ecc15){logger[_0xa206('0xf')](_0xa206('0xc'),_0x3ac123,_0x4ecc15);_0x2c54ec(_0x4ecc15);});});} \ No newline at end of file +var _0x6302=['moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util'];(function(_0x4a690d,_0x51473d){var _0x31e44c=function(_0x442593){while(--_0x442593){_0x4a690d['push'](_0x4a690d['shift']());}};_0x31e44c(++_0x51473d);}(_0x6302,0x109));var _0x2630=function(_0x16bb42,_0x52a3b9){_0x16bb42=_0x16bb42-0x0;var _0x3a342b=_0x6302[_0x16bb42];return _0x3a342b;};'use strict';var _=require('lodash');var util=require(_0x2630('0x0'));var moment=require(_0x2630('0x1'));var BPromise=require(_0x2630('0x2'));var rs=require(_0x2630('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2630('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x2630('0x5'));var jayson=require(_0x2630('0x6'));var client=jayson[_0x2630('0x7')][_0x2630('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2867f8,_0x19231a,_0x2e1867){return new BPromise(function(_0x353f73,_0x581f4d){return client['request'](_0x2867f8,_0x2e1867)[_0x2630('0x9')](function(_0x10ffdf){logger['info'](_0x2630('0xa'),_0x19231a,'request\x20sent');logger[_0x2630('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x19231a,_0x2630('0xc'),JSON[_0x2630('0xd')](_0x10ffdf));if(_0x10ffdf[_0x2630('0xe')]){if(_0x10ffdf[_0x2630('0xe')][_0x2630('0xf')]===0x1f4){logger[_0x2630('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x19231a,_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);return _0x581f4d(_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);}logger['error'](_0x2630('0xa'),_0x19231a,_0x10ffdf[_0x2630('0xe')][_0x2630('0x10')]);return _0x353f73(_0x10ffdf['error'][_0x2630('0x10')]);}else{logger['info'](_0x2630('0xa'),_0x19231a,_0x2630('0xc'));_0x353f73(_0x10ffdf[_0x2630('0x11')][_0x2630('0x10')]);}})[_0x2630('0x12')](function(_0x18b2b0){logger[_0x2630('0xe')](_0x2630('0xa'),_0x19231a,_0x18b2b0);_0x581f4d(_0x18b2b0);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 358d692..fb82476 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 _0xbb68=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/sessions','getSessions','post','create','/:id/clone','clone'];(function(_0x3c7607,_0x3265f2){var _0xc704ed=function(_0x1b45ee){while(--_0x1b45ee){_0x3c7607['push'](_0x3c7607['shift']());}};_0xc704ed(++_0x3265f2);}(_0xbb68,0xad));var _0x8bb6=function(_0x5cedc0,_0x386a75){_0x5cedc0=_0x5cedc0-0x0;var _0x26c616=_0xbb68[_0x5cedc0];return _0x26c616;};'use strict';var multer=require(_0x8bb6('0x0'));var util=require(_0x8bb6('0x1'));var path=require(_0x8bb6('0x2'));var timeout=require(_0x8bb6('0x3'));var express=require(_0x8bb6('0x4'));var router=express['Router']();var auth=require(_0x8bb6('0x5'));var interaction=require(_0x8bb6('0x6'));var config=require(_0x8bb6('0x7'));var controller=require('./jscriptyProject.controller');router[_0x8bb6('0x8')]('/',auth['isAuthenticated'](),controller[_0x8bb6('0x9')]);router[_0x8bb6('0x8')](_0x8bb6('0xa'),auth[_0x8bb6('0xb')](),controller[_0x8bb6('0xc')]);router[_0x8bb6('0x8')](_0x8bb6('0xd'),auth[_0x8bb6('0xb')](),controller[_0x8bb6('0xe')]);router['get']('/:id/answers',auth[_0x8bb6('0xb')](),controller['getAnswers']);router[_0x8bb6('0x8')]('/:id/summary',auth[_0x8bb6('0xb')](),timeout('30s'),controller['getSummary']);router[_0x8bb6('0xf')]('/',auth[_0x8bb6('0xb')](),controller[_0x8bb6('0x10')]);router[_0x8bb6('0xf')](_0x8bb6('0x11'),auth[_0x8bb6('0xb')](),controller[_0x8bb6('0x12')]);router[_0x8bb6('0x13')](_0x8bb6('0xa'),auth['isAuthenticated'](),controller[_0x8bb6('0x14')]);router[_0x8bb6('0x15')](_0x8bb6('0xa'),auth[_0x8bb6('0xb')](),controller[_0x8bb6('0x16')]);module[_0x8bb6('0x17')]=router; \ No newline at end of file +var _0x6262=['post','/:id/clone','clone','put','update','delete','/:id','destroy','exports','util','connect-timeout','express','Router','./jscriptyProject.controller','isAuthenticated','get','show','/:id/sessions','getSessions','getAnswers','/:id/summary'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x6262,0x72));var _0x2626=function(_0x34022f,_0x21134c){_0x34022f=_0x34022f-0x0;var _0x1bebdf=_0x6262[_0x34022f];return _0x1bebdf;};'use strict';var multer=require('multer');var util=require(_0x2626('0x0'));var path=require('path');var timeout=require(_0x2626('0x1'));var express=require(_0x2626('0x2'));var router=express[_0x2626('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2626('0x4'));router['get']('/',auth[_0x2626('0x5')](),controller['index']);router[_0x2626('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x2626('0x7')]);router[_0x2626('0x6')](_0x2626('0x8'),auth[_0x2626('0x5')](),controller[_0x2626('0x9')]);router['get']('/:id/answers',auth[_0x2626('0x5')](),controller[_0x2626('0xa')]);router[_0x2626('0x6')](_0x2626('0xb'),auth[_0x2626('0x5')](),timeout('30s'),controller['getSummary']);router[_0x2626('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x2626('0xd'),auth['isAuthenticated'](),controller[_0x2626('0xe')]);router[_0x2626('0xf')]('/:id',auth[_0x2626('0x5')](),controller[_0x2626('0x10')]);router[_0x2626('0x11')](_0x2626('0x12'),auth['isAuthenticated'](),controller[_0x2626('0x13')]);module[_0x2626('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index aade54d..aa93526 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 _0xa800=['STRING','name','TEXT','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','sequelize','lodash','util','exports'];(function(_0x49f183,_0x5b9c1a){var _0x21aa14=function(_0x2a24d1){while(--_0x2a24d1){_0x49f183['push'](_0x49f183['shift']());}};_0x21aa14(++_0x5b9c1a);}(_0xa800,0x1eb));var _0x0a80=function(_0x93d7e0,_0x3ecdf4){_0x93d7e0=_0x93d7e0-0x0;var _0x1e93e8=_0xa800[_0x93d7e0];return _0x1e93e8;};'use strict';var Sequelize=require(_0x0a80('0x0'));var _=require(_0x0a80('0x1'));var util=require(_0x0a80('0x2'));module[_0x0a80('0x3')]={'name':{'type':Sequelize[_0x0a80('0x4')],'unique':_0x0a80('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x0a80('0x6')]('long'),'set':function(_0x331cc0){if(_[_0x0a80('0x7')](_0x331cc0)){this[_0x0a80('0x8')](_0x0a80('0x9'),JSON[_0x0a80('0xa')](_0x331cc0));}else if(_[_0x0a80('0xb')](_0x331cc0)){this[_0x0a80('0x8')](_0x0a80('0x9'),_0x331cc0);}else{this[_0x0a80('0x8')](_0x0a80('0x9'),util[_0x0a80('0xc')](_0x0a80('0xd'),this['getDataValue'](_0x0a80('0x5'))||'',this[_0x0a80('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4659=['formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT','isObjectLike','setDataValue','stringify','isString'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x4659,0x1c6));var _0x9465=function(_0x445a3b,_0x415df7){_0x445a3b=_0x445a3b-0x0;var _0x37fbde=_0x4659[_0x445a3b];return _0x37fbde;};'use strict';var Sequelize=require(_0x9465('0x0'));var _=require(_0x9465('0x1'));var util=require(_0x9465('0x2'));module[_0x9465('0x3')]={'name':{'type':Sequelize[_0x9465('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x9465('0x4')]},'formData':{'type':Sequelize[_0x9465('0x5')]('long'),'set':function(_0x70f076){if(_[_0x9465('0x6')](_0x70f076)){this[_0x9465('0x7')]('formData',JSON[_0x9465('0x8')](_0x70f076));}else if(_[_0x9465('0x9')](_0x70f076)){this[_0x9465('0x7')](_0x9465('0xa'),_0x70f076);}else{this[_0x9465('0x7')]('formData',util['format'](_0x9465('0xb'),this[_0x9465('0xc')](_0x9465('0xd'))||'',this[_0x9465('0xc')](_0x9465('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9465('0xf')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 2f2e4d3..5158f89 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 _0x1fc5=['questionId','question','format','SessionId','answer','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','JscriptyProject','rawAttributes','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','count','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','UserProfileSection','userProfileId','clone','createdAt','updatedAt','omit','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','indexOf','toString','replace','getSummary','startTime','starttime','JscriptyQuestionReport'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x1fc5,0x86));var _0x51fc=function(_0x2246c6,_0x37032d){_0x2246c6=_0x2246c6-0x0;var _0x5baf4a=_0x1fc5[_0x2246c6];return _0x5baf4a;};'use strict';var pdf=require(_0x51fc('0x0'));var emlformat=require(_0x51fc('0x1'));var rimraf=require(_0x51fc('0x2'));var zipdir=require(_0x51fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51fc('0x4'));var moment=require(_0x51fc('0x5'));var BPromise=require(_0x51fc('0x6'));var Mustache=require(_0x51fc('0x7'));var util=require(_0x51fc('0x8'));var path=require(_0x51fc('0x9'));var sox=require(_0x51fc('0xa'));var csv=require(_0x51fc('0xb'));var ejs=require(_0x51fc('0xc'));var fs=require('fs');var _=require(_0x51fc('0xd'));var squel=require('squel');var crypto=require(_0x51fc('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x51fc('0xb'));var querystring=require(_0x51fc('0xf'));var Papa=require(_0x51fc('0x10'));var authService=require(_0x51fc('0x11'));var hardwareService=require(_0x51fc('0x12'));var Redis=require(_0x51fc('0x13'));var qs=require(_0x51fc('0x14'));var logger=require(_0x51fc('0x15'))(_0x51fc('0x16'));var utils=require(_0x51fc('0x17'));var config=require(_0x51fc('0x18'));var db=require(_0x51fc('0x19'))['db'];function respondWithStatusCode(_0x3700e3,_0x15bac0){_0x15bac0=_0x15bac0||0xcc;return function(_0x411b87){if(_0x411b87){return _0x3700e3[_0x51fc('0x1a')](_0x15bac0);}return _0x3700e3[_0x51fc('0x1b')](_0x15bac0)[_0x51fc('0x1c')]();};}function respondWithResult(_0x2b2d70,_0x519959){_0x519959=_0x519959||0xc8;return function(_0x206336){if(_0x206336){return _0x2b2d70[_0x51fc('0x1b')](_0x519959)[_0x51fc('0x1d')](_0x206336);}};}function respondWithFilteredResult(_0x280ba1,_0x3066a1){return function(_0x5081e5){if(_0x5081e5){var _0x131cbd=_0x5081e5['count'],_0x53386d=_0x3066a1[_0x51fc('0x1e')],_0x1b5c92=_0x3066a1[_0x51fc('0x1e')]+_0x3066a1['limit'],_0x416efa;if(_0x1b5c92>=_0x131cbd){_0x1b5c92=_0x131cbd;_0x416efa=0xc8;}else{_0x416efa=0xce;}_0x280ba1[_0x51fc('0x1b')](_0x416efa);return _0x280ba1['set'](_0x51fc('0x1f'),_0x53386d+'-'+_0x1b5c92+'/'+_0x131cbd)[_0x51fc('0x1d')](_0x5081e5);}return null;};}function patchUpdates(_0x1cc38c){return function(_0x27b84b){try{jsonpatch['apply'](_0x27b84b,_0x1cc38c,!![]);}catch(_0x55c1a3){return BPromise['reject'](_0x55c1a3);}return _0x27b84b[_0x51fc('0x20')]();};}function saveUpdates(_0x50c094,_0x5d0725){return function(_0x498e32){if(_0x498e32){return _0x498e32[_0x51fc('0x21')](_0x50c094)[_0x51fc('0x22')](function(_0x3fdd12){return _0x3fdd12;});}return null;};}function removeEntity(_0x15f1ce,_0x1926db){return function(_0x3e81d3){if(_0x3e81d3){return _0x3e81d3[_0x51fc('0x23')]()[_0x51fc('0x22')](function(){var _0x5cdd6e=_0x3e81d3[_0x51fc('0x24')]({'plain':!![]});var _0x4ecaa2='Projects';return db[_0x51fc('0x25')][_0x51fc('0x23')]({'where':{'type':_0x4ecaa2,'resourceId':_0x5cdd6e['id']}})[_0x51fc('0x22')](function(){return _0x3e81d3;});})[_0x51fc('0x22')](function(){_0x15f1ce[_0x51fc('0x1b')](0xcc)[_0x51fc('0x1c')]();});}};}function handleEntityNotFound(_0x2221c6,_0x345a7f){return function(_0x35f491){if(!_0x35f491){_0x2221c6[_0x51fc('0x1a')](0x194);}return _0x35f491;};}function handleError(_0x589aa6,_0x4e9b00){_0x4e9b00=_0x4e9b00||0x1f4;return function(_0x239258){logger[_0x51fc('0x26')](_0x239258[_0x51fc('0x27')]);if(_0x239258[_0x51fc('0x28')]){delete _0x239258[_0x51fc('0x28')];}_0x589aa6[_0x51fc('0x1b')](_0x4e9b00)[_0x51fc('0x29')](_0x239258);};}exports[_0x51fc('0x2a')]=function(_0x1968a2,_0x22acb6){var _0x4e8a76={},_0x59d6c8={},_0x1d1a20={'count':0x0,'rows':[]};var _0x5ba457=db[_0x51fc('0x2b')][_0x51fc('0x2c')];_0x59d6c8[_0x51fc('0x2d')]=_[_0x51fc('0x2e')](_0x5ba457);_0x59d6c8['query']=_[_0x51fc('0x2e')](_0x1968a2[_0x51fc('0x2f')]);_0x59d6c8[_0x51fc('0x30')]=_['intersection'](_0x59d6c8['model'],_0x59d6c8[_0x51fc('0x2f')]);_0x4e8a76['attributes']=_['intersection'](_0x59d6c8[_0x51fc('0x2d')],qs[_0x51fc('0x31')](_0x1968a2['query'][_0x51fc('0x31')]));_0x4e8a76[_0x51fc('0x32')]=_0x4e8a76[_0x51fc('0x32')]['length']?_0x4e8a76['attributes']:_0x59d6c8[_0x51fc('0x2d')];if(!_0x1968a2[_0x51fc('0x2f')][_0x51fc('0x33')](_0x51fc('0x34'))){_0x4e8a76[_0x51fc('0x35')]=qs[_0x51fc('0x35')](_0x1968a2[_0x51fc('0x2f')]['limit']);_0x4e8a76[_0x51fc('0x1e')]=qs[_0x51fc('0x1e')](_0x1968a2[_0x51fc('0x2f')][_0x51fc('0x1e')]);}_0x4e8a76[_0x51fc('0x36')]=qs[_0x51fc('0x37')](_0x1968a2[_0x51fc('0x2f')][_0x51fc('0x37')]);_0x4e8a76[_0x51fc('0x38')]=qs[_0x51fc('0x30')](_[_0x51fc('0x39')](_0x1968a2[_0x51fc('0x2f')],_0x59d6c8['filters']));if(_0x1968a2[_0x51fc('0x2f')][_0x51fc('0x3a')]){_0x4e8a76[_0x51fc('0x38')]=_[_0x51fc('0x3b')](_0x4e8a76[_0x51fc('0x38')],{'$or':_[_0x51fc('0x3c')](_0x5ba457,function(_0xe97bd2){if(_0xe97bd2[_0x51fc('0x3d')]['key']!=='VIRTUAL'){var _0x1ddb35={};_0x1ddb35[_0xe97bd2['field']]={'$like':'%'+_0x1968a2[_0x51fc('0x2f')]['filter']+'%'};return _0x1ddb35;}})});}_0x4e8a76=_[_0x51fc('0x3b')]({},_0x4e8a76,_0x1968a2['options']);var _0x5e8e0e={'where':_0x4e8a76['where']};return db[_0x51fc('0x2b')][_0x51fc('0x3e')](_0x5e8e0e)['then'](function(_0x36339c){_0x1d1a20[_0x51fc('0x3e')]=_0x36339c;if(_0x1968a2[_0x51fc('0x2f')][_0x51fc('0x3f')]){_0x4e8a76[_0x51fc('0x40')]=[{'all':!![]}];}return db[_0x51fc('0x2b')][_0x51fc('0x41')](_0x4e8a76);})['then'](function(_0x269a0a){_0x1d1a20[_0x51fc('0x42')]=_0x269a0a;return _0x1d1a20;})[_0x51fc('0x22')](respondWithFilteredResult(_0x22acb6,_0x4e8a76))[_0x51fc('0x43')](handleError(_0x22acb6,null));};exports[_0x51fc('0x44')]=function(_0x4b148f,_0x21af6a){var _0x1b3e79={'raw':![],'where':{'id':_0x4b148f[_0x51fc('0x45')]['id']}},_0x37228a={};_0x37228a[_0x51fc('0x2d')]=_['keys'](db[_0x51fc('0x2b')][_0x51fc('0x2c')]);_0x37228a[_0x51fc('0x2f')]=_['keys'](_0x4b148f[_0x51fc('0x2f')]);_0x37228a[_0x51fc('0x30')]=_[_0x51fc('0x46')](_0x37228a[_0x51fc('0x2d')],_0x37228a['query']);_0x1b3e79[_0x51fc('0x32')]=_[_0x51fc('0x46')](_0x37228a[_0x51fc('0x2d')],qs[_0x51fc('0x31')](_0x4b148f[_0x51fc('0x2f')][_0x51fc('0x31')]));_0x1b3e79[_0x51fc('0x32')]=_0x1b3e79[_0x51fc('0x32')][_0x51fc('0x47')]?_0x1b3e79[_0x51fc('0x32')]:_0x37228a[_0x51fc('0x2d')];if(_0x4b148f[_0x51fc('0x2f')][_0x51fc('0x3f')]){_0x1b3e79['include']=[{'all':!![]}];}_0x1b3e79=_['merge']({},_0x1b3e79,_0x4b148f[_0x51fc('0x48')]);return db[_0x51fc('0x2b')][_0x51fc('0x49')](_0x1b3e79)[_0x51fc('0x22')](handleEntityNotFound(_0x21af6a,null))[_0x51fc('0x22')](respondWithResult(_0x21af6a,null))[_0x51fc('0x43')](handleError(_0x21af6a,null));};exports['create']=function(_0xec78b8,_0x3be577){return db[_0x51fc('0x2b')][_0x51fc('0x4a')](_0xec78b8[_0x51fc('0x4b')],{})[_0x51fc('0x22')](function(_0x2773b5){var _0x341d3c=_0xec78b8[_0x51fc('0x4c')][_0x51fc('0x24')]({'plain':!![]});if(!_0x341d3c)throw new Error(_0x51fc('0x4d'));if(_0x341d3c['role']===_0x51fc('0x4c')){var _0x2f6a4e=_0x2773b5[_0x51fc('0x24')]({'plain':!![]});var _0x3af435=_0x51fc('0x4e');return db[_0x51fc('0x4f')][_0x51fc('0x49')]({'where':{'name':_0x3af435,'userProfileId':_0x341d3c[_0x51fc('0x50')]},'raw':!![]})[_0x51fc('0x22')](function(_0x3b8d4d){if(_0x3b8d4d&&_0x3b8d4d['autoAssociation']===0x0){return db[_0x51fc('0x25')]['create']({'name':_0x2f6a4e[_0x51fc('0x28')],'resourceId':_0x2f6a4e['id'],'type':_0x3b8d4d['name'],'sectionId':_0x3b8d4d['id']},{})[_0x51fc('0x22')](function(){return _0x2773b5;});}else{return _0x2773b5;}})[_0x51fc('0x43')](function(_0x1d2548){logger[_0x51fc('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d2548);throw _0x1d2548;});}return _0x2773b5;})['then'](respondWithResult(_0x3be577,0xc9))[_0x51fc('0x43')](handleError(_0x3be577,null));};exports[_0x51fc('0x51')]=function(_0x30845e,_0x39493a){var _0x4869bc={'raw':![],'where':{'id':_0x30845e[_0x51fc('0x45')]['id']}},_0x5b2f3e={};_0x5b2f3e[_0x51fc('0x2d')]=_['keys'](db[_0x51fc('0x2b')][_0x51fc('0x2c')]);_0x4869bc[_0x51fc('0x32')]=_[_0x51fc('0x46')](_0x5b2f3e['model'],qs[_0x51fc('0x31')](_0x30845e[_0x51fc('0x2f')][_0x51fc('0x31')]));_0x4869bc[_0x51fc('0x32')]=_0x4869bc['attributes'][_0x51fc('0x47')]?_0x4869bc['attributes']:_0x5b2f3e[_0x51fc('0x2d')];if(_0x30845e[_0x51fc('0x2f')][_0x51fc('0x3f')]){_0x4869bc['include']=[{'all':!![]}];}_0x4869bc=_[_0x51fc('0x3b')]({},_0x4869bc,_0x30845e[_0x51fc('0x48')]);return db[_0x51fc('0x2b')][_0x51fc('0x49')](_0x4869bc)[_0x51fc('0x22')](handleEntityNotFound(_0x39493a,null))[_0x51fc('0x22')](function(_0x3ab106){if(_0x3ab106){var _0x34f7de=_0x3ab106['get']({'plain':!![]});_0x34f7de=qs['omit'](_0x34f7de,['id',_0x51fc('0x52'),_0x51fc('0x53')]);_0x30845e['body']=_[_0x51fc('0x54')](_0x30845e[_0x51fc('0x4b')],['id',_0x51fc('0x52'),'updatedAt']);return db[_0x51fc('0x2b')][_0x51fc('0x4a')](_['merge'](_0x34f7de,_0x30845e['body']),{'include':_0x30845e['query']['includeAll']?[{'all':!![]}]:undefined})[_0x51fc('0x22')](function(_0x2be6fb){var _0x294c2c=_0x30845e['user'][_0x51fc('0x24')]({'plain':!![]});if(!_0x294c2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x294c2c[_0x51fc('0x55')]===_0x51fc('0x4c')){var _0x178b85=_0x2be6fb[_0x51fc('0x24')]({'plain':!![]});var _0x2baa38='Projects';return db['UserProfileSection'][_0x51fc('0x49')]({'where':{'name':_0x2baa38,'userProfileId':_0x294c2c['userProfileId']},'raw':!![]})['then'](function(_0x5cc50a){if(_0x5cc50a&&_0x5cc50a[_0x51fc('0x56')]===0x0){return db['UserProfileResource'][_0x51fc('0x4a')]({'name':_0x178b85[_0x51fc('0x28')],'resourceId':_0x178b85['id'],'type':_0x5cc50a[_0x51fc('0x28')],'sectionId':_0x5cc50a['id']},{})[_0x51fc('0x22')](function(){return _0x2be6fb;});}else{return _0x2be6fb;}})[_0x51fc('0x43')](function(_0x5992e7){logger['error'](_0x51fc('0x57'),_0x5992e7);throw _0x5992e7;});}return _0x2be6fb;});}})[_0x51fc('0x22')](respondWithResult(_0x39493a,0xc9))[_0x51fc('0x43')](handleError(_0x39493a,null));};exports['update']=function(_0x7e862d,_0x215a72){if(_0x7e862d[_0x51fc('0x4b')]['id']){delete _0x7e862d[_0x51fc('0x4b')]['id'];}return db[_0x51fc('0x2b')][_0x51fc('0x49')]({'where':{'id':_0x7e862d['params']['id']}})[_0x51fc('0x22')](handleEntityNotFound(_0x215a72,null))[_0x51fc('0x22')](saveUpdates(_0x7e862d[_0x51fc('0x4b')],null))[_0x51fc('0x22')](respondWithResult(_0x215a72,null))[_0x51fc('0x43')](handleError(_0x215a72,null));};exports[_0x51fc('0x23')]=function(_0x545007,_0x5ba542){return db[_0x51fc('0x2b')][_0x51fc('0x49')]({'where':{'id':_0x545007[_0x51fc('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ba542,null))[_0x51fc('0x22')](removeEntity(_0x5ba542,null))[_0x51fc('0x43')](handleError(_0x5ba542,null));};exports[_0x51fc('0x58')]=function(_0x31e63d,_0x3e9394,_0x2c8ef6){var _0xe4f003={'raw':!![],'where':{}};var _0x3e9dc4={};var _0x29520c={'count':0x0,'rows':[]};return db[_0x51fc('0x2b')][_0x51fc('0x59')]({'where':{'id':_0x31e63d[_0x51fc('0x45')]['id']}})[_0x51fc('0x22')](handleEntityNotFound(_0x3e9394,null))[_0x51fc('0x22')](function(_0x1944ab){if(_0x1944ab){_0x3e9dc4['model']=_['keys'](db[_0x51fc('0x5a')][_0x51fc('0x2c')]);_0x3e9dc4['query']=_[_0x51fc('0x2e')](_0x31e63d['query']);_0x3e9dc4[_0x51fc('0x30')]=_[_0x51fc('0x46')](_0x3e9dc4[_0x51fc('0x2d')],_0x3e9dc4[_0x51fc('0x2f')]);_0xe4f003['attributes']=_[_0x51fc('0x46')](_0x3e9dc4[_0x51fc('0x2d')],qs[_0x51fc('0x31')](_0x31e63d[_0x51fc('0x2f')][_0x51fc('0x31')]));_0xe4f003[_0x51fc('0x32')]=_0xe4f003[_0x51fc('0x32')]['length']?_0xe4f003['attributes']:_0x3e9dc4[_0x51fc('0x2d')];if(!_0x31e63d['query'][_0x51fc('0x33')](_0x51fc('0x34'))){_0xe4f003[_0x51fc('0x35')]=qs[_0x51fc('0x35')](_0x31e63d[_0x51fc('0x2f')][_0x51fc('0x35')]);_0xe4f003[_0x51fc('0x1e')]=qs[_0x51fc('0x1e')](_0x31e63d['query'][_0x51fc('0x1e')]);}_0xe4f003[_0x51fc('0x36')]=qs[_0x51fc('0x37')](_0x31e63d[_0x51fc('0x2f')][_0x51fc('0x37')]);_0xe4f003[_0x51fc('0x38')]=qs[_0x51fc('0x30')](_[_0x51fc('0x39')](_0x31e63d[_0x51fc('0x2f')],_0x3e9dc4[_0x51fc('0x30')]));_0xe4f003[_0x51fc('0x38')][_0x51fc('0x5b')]=_0x1944ab['id'];if(_0x31e63d[_0x51fc('0x2f')][_0x51fc('0x3a')]){_0xe4f003[_0x51fc('0x38')]=_[_0x51fc('0x3b')](_0xe4f003[_0x51fc('0x38')],{'$or':_[_0x51fc('0x3c')](_0xe4f003['attributes'],function(_0xee658){var _0x5558e5={};_0x5558e5[_0xee658]={'$like':'%'+_0x31e63d['query'][_0x51fc('0x3a')]+'%'};return _0x5558e5;})});}_0xe4f003=_[_0x51fc('0x3b')]({},_0xe4f003,_0x31e63d[_0x51fc('0x48')]);return db[_0x51fc('0x5a')][_0x51fc('0x3e')]({'where':_0xe4f003[_0x51fc('0x38')]})[_0x51fc('0x22')](function(_0x1c13a5){_0x29520c['count']=_0x1c13a5;if(_0x31e63d['query'][_0x51fc('0x3f')]){_0xe4f003[_0x51fc('0x40')]=[{'all':!![]}];}return db[_0x51fc('0x5a')]['findAll'](_0xe4f003);})[_0x51fc('0x22')](function(_0x31ad06){_0x29520c[_0x51fc('0x42')]=_0x31ad06;return _0x29520c;});}})[_0x51fc('0x22')](respondWithFilteredResult(_0x3e9394,_0xe4f003))[_0x51fc('0x43')](handleError(_0x3e9394,null));};exports[_0x51fc('0x5c')]=function(_0x177c32,_0x4bcb74,_0x2ec12d){var _0x4982bc={'raw':!![],'where':{}};var _0x5438b1={};var _0x1e611a={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x51fc('0x59')]({'where':{'id':_0x177c32[_0x51fc('0x45')]['id']}})[_0x51fc('0x22')](handleEntityNotFound(_0x4bcb74,null))[_0x51fc('0x22')](function(_0x228bab){if(_0x228bab){_0x5438b1[_0x51fc('0x2d')]=_['keys'](db[_0x51fc('0x5d')][_0x51fc('0x2c')]);_0x5438b1['query']=_['keys'](_0x177c32[_0x51fc('0x2f')]);_0x5438b1[_0x51fc('0x30')]=_[_0x51fc('0x46')](_0x5438b1[_0x51fc('0x2d')],_0x5438b1[_0x51fc('0x2f')]);_0x4982bc[_0x51fc('0x32')]=_[_0x51fc('0x46')](_0x5438b1[_0x51fc('0x2d')],qs[_0x51fc('0x31')](_0x177c32[_0x51fc('0x2f')][_0x51fc('0x31')]));_0x4982bc[_0x51fc('0x32')]=_0x4982bc[_0x51fc('0x32')][_0x51fc('0x47')]?_0x4982bc[_0x51fc('0x32')]:_0x5438b1['model'];if(!_0x177c32[_0x51fc('0x2f')][_0x51fc('0x33')](_0x51fc('0x34'))){_0x4982bc[_0x51fc('0x35')]=qs[_0x51fc('0x35')](_0x177c32[_0x51fc('0x2f')][_0x51fc('0x35')]);_0x4982bc[_0x51fc('0x1e')]=qs[_0x51fc('0x1e')](_0x177c32[_0x51fc('0x2f')][_0x51fc('0x1e')]);}_0x4982bc['order']=qs[_0x51fc('0x37')](_0x177c32['query'][_0x51fc('0x37')]);_0x4982bc[_0x51fc('0x38')]=qs['filters'](_[_0x51fc('0x39')](_0x177c32[_0x51fc('0x2f')],_0x5438b1[_0x51fc('0x30')]));_0x4982bc['where']['ProjectId']=_0x228bab['id'];if(_0x177c32['query'][_0x51fc('0x3a')]){_0x4982bc['where']=_['merge'](_0x4982bc[_0x51fc('0x38')],{'$or':_[_0x51fc('0x3c')](_0x4982bc[_0x51fc('0x32')],function(_0x4dd775){var _0x46f60c={};_0x46f60c[_0x4dd775]={'$like':'%'+_0x177c32[_0x51fc('0x2f')][_0x51fc('0x3a')]+'%'};return _0x46f60c;})});}_0x4982bc=_[_0x51fc('0x3b')]({},_0x4982bc,_0x177c32[_0x51fc('0x48')]);return db[_0x51fc('0x5d')][_0x51fc('0x3e')]({'where':_0x4982bc['where']})[_0x51fc('0x22')](function(_0x72abeb){_0x1e611a[_0x51fc('0x3e')]=_0x72abeb;if(_0x177c32[_0x51fc('0x2f')][_0x51fc('0x3f')]){_0x4982bc['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x51fc('0x41')](_0x4982bc);})[_0x51fc('0x22')](function(_0x23c625){_0x1e611a['rows']=_0x23c625;return _0x1e611a;});}})[_0x51fc('0x22')](respondWithFilteredResult(_0x4bcb74,_0x4982bc))[_0x51fc('0x43')](handleError(_0x4bcb74,null));};function char(_0x541800){return _0x51fc('0x5e')===typeof _0x541800?String[_0x51fc('0x5f')][_0x51fc('0x60')](null,arguments):_0x541800;}function needsEncapsulation(_0x1dc54b){return!!_0x1dc54b&&(_0x1dc54b['toString']()[_0x51fc('0x61')](char(0xd))>=0x0||_0x1dc54b['toString']()[_0x51fc('0x61')](char(0xa))>=0x0||_0x1dc54b[_0x51fc('0x62')]()[_0x51fc('0x61')](char(0x2c))>=0x0||_0x1dc54b[_0x51fc('0x62')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x422a53){var _0x1fd4f2=char(0x22),_0x18e708='\x5c'+char(0x22),_0x551970=_0x422a53['toString']()[_0x51fc('0x63')](new RegExp(_0x1fd4f2,'g'),_0x18e708);return _0x1fd4f2+_0x551970+_0x1fd4f2;}exports[_0x51fc('0x64')]=function(_0x4787ee,_0x470748,_0x2a4ae3){var _0x43739e,_0x469101;var _0x49e53b={'where':{'ProjectId':_0x4787ee[_0x51fc('0x45')]['id']}};if(_0x4787ee['query'][_0x51fc('0x65')]){_0x49e53b[_0x51fc('0x38')][_0x51fc('0x66')]=JSON['parse'](_0x4787ee[_0x51fc('0x2f')][_0x51fc('0x65')]);}return db[_0x51fc('0x5a')][_0x51fc('0x41')](_0x49e53b)['then'](handleEntityNotFound(_0x470748,null))[_0x51fc('0x22')](function(_0x50e9df){if(_0x50e9df){_0x43739e=_0x50e9df;return db[_0x51fc('0x67')][_0x51fc('0x41')]({'where':{'SessionId':{'$in':_[_0x51fc('0x3c')](_0x43739e,'id')},'ProjectId':_0x4787ee[_0x51fc('0x45')]['id']},'order':'-createdAt'});}})[_0x51fc('0x22')](handleEntityNotFound(_0x470748,null))[_0x51fc('0x22')](function(_0x287b93){if(_0x287b93){_0x469101=_0x287b93;var _0x1d2aae={};for(var _0x2a17b9=0x0,_0x4ab053=_0x469101[_0x51fc('0x47')];_0x2a17b9<_0x4ab053;_0x2a17b9++){if(!_0x1d2aae[_0x51fc('0x33')](_0x469101[_0x2a17b9][_0x51fc('0x68')])){_0x1d2aae[_0x469101[_0x2a17b9]['questionId']]=needsEncapsulation(_0x469101[_0x2a17b9][_0x51fc('0x69')])?encapsulate(_0x469101[_0x2a17b9][_0x51fc('0x69')]):_0x469101[_0x2a17b9][_0x51fc('0x69')];}}var _0xcfefba=[],_0x2800c1={};for(var _0x3bbb41=0x0,_0x1a0d66=_0x43739e['length'];_0x3bbb41<_0x1a0d66;_0x3bbb41++){_0x2800c1={'ProjectId':_0x4787ee[_0x51fc('0x45')]['id'],'SessionId':_0x43739e[_0x3bbb41]['id'],'StartTime':moment(_0x43739e[_0x3bbb41][_0x51fc('0x66')])[_0x51fc('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x122e77=0x0,_0x4f01f5=_0x469101[_0x51fc('0x47')];_0x122e77<_0x4f01f5;_0x122e77++){if(_0x469101[_0x122e77][_0x51fc('0x6b')]==_0x43739e[_0x3bbb41]['id']&&_0x1d2aae['hasOwnProperty'](_0x469101[_0x122e77][_0x51fc('0x68')])){_0x2800c1[_0x1d2aae[_0x469101[_0x122e77]['questionId']]]=_0x469101[_0x122e77][_0x51fc('0x6c')];}}for(var _0x3b6169 in _0x1d2aae){if(!_0x2800c1[_0x51fc('0x33')](_0x1d2aae[_0x3b6169])){_0x2800c1[_0x1d2aae[_0x3b6169]]=null;}}_0xcfefba['push'](_0x2800c1);}return _0xcfefba;}})[_0x51fc('0x22')](function(_0x41177d){if(!_[_0x51fc('0x6d')](_0x41177d)){var _0x55367b=toCsv(_0x41177d);var _0x5e2593=Date[_0x51fc('0x6e')]();fs[_0x51fc('0x6f')](util[_0x51fc('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4787ee['params']['id'],_0x5e2593),_0x55367b);_0x470748[_0x51fc('0x70')]('Content-disposition',_0x51fc('0x71')+util[_0x51fc('0x6a')](_0x51fc('0x72'),_0x4787ee[_0x51fc('0x45')]['id'],_0x5e2593));_0x470748[_0x51fc('0x70')](_0x51fc('0x73'),_0x51fc('0x74'));return _0x470748[_0x51fc('0x75')](util[_0x51fc('0x6a')](_0x51fc('0x76'),_0x4787ee[_0x51fc('0x45')]['id'],_0x5e2593));}else{return _0x470748['sendStatus'](0xcc);}})[_0x51fc('0x43')](handleError(_0x470748,null));}; \ No newline at end of file +var _0xaae9=['questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','text/csv','download','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','end','json','count','offset','status','set','reject','update','then','destroy','Projects','UserProfileResource','sendStatus','error','stack','name','send','index','JscriptyProject','rawAttributes','model','query','intersection','attributes','fields','limit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','body','getSessions','JscriptySessionReport','length','hasOwnProperty','nolimit','ProjectId','findAll','findOne','JscriptyAnswerReport','apply','indexOf','toString','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xaae9,0x1cc));var _0x9aae=function(_0xe8ae1,_0x48da04){_0xe8ae1=_0xe8ae1-0x0;var _0x32a154=_0xaae9[_0xe8ae1];return _0x32a154;};'use strict';var pdf=require(_0x9aae('0x0'));var emlformat=require(_0x9aae('0x1'));var rimraf=require(_0x9aae('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9aae('0x3'));var rp=require(_0x9aae('0x4'));var moment=require(_0x9aae('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9aae('0x6'));var util=require(_0x9aae('0x7'));var path=require('path');var sox=require(_0x9aae('0x8'));var csv=require(_0x9aae('0x9'));var ejs=require(_0x9aae('0xa'));var fs=require('fs');var _=require(_0x9aae('0xb'));var squel=require(_0x9aae('0xc'));var crypto=require(_0x9aae('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9aae('0x9'));var querystring=require(_0x9aae('0xe'));var Papa=require(_0x9aae('0xf'));var authService=require(_0x9aae('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x9aae('0x11'));var qs=require(_0x9aae('0x12'));var logger=require(_0x9aae('0x13'))(_0x9aae('0x14'));var utils=require(_0x9aae('0x15'));var config=require('../../config/environment');var db=require(_0x9aae('0x16'))['db'];function respondWithStatusCode(_0xeaf2fc,_0x3be497){_0x3be497=_0x3be497||0xcc;return function(_0x160ba6){if(_0x160ba6){return _0xeaf2fc['sendStatus'](_0x3be497);}return _0xeaf2fc['status'](_0x3be497)[_0x9aae('0x17')]();};}function respondWithResult(_0x55b63c,_0x427b92){_0x427b92=_0x427b92||0xc8;return function(_0x2e052a){if(_0x2e052a){return _0x55b63c['status'](_0x427b92)[_0x9aae('0x18')](_0x2e052a);}};}function respondWithFilteredResult(_0x361194,_0x94219b){return function(_0x1d0d02){if(_0x1d0d02){var _0x60174c=_0x1d0d02[_0x9aae('0x19')],_0x3c1475=_0x94219b[_0x9aae('0x1a')],_0x3e724d=_0x94219b[_0x9aae('0x1a')]+_0x94219b['limit'],_0x20a8bf;if(_0x3e724d>=_0x60174c){_0x3e724d=_0x60174c;_0x20a8bf=0xc8;}else{_0x20a8bf=0xce;}_0x361194[_0x9aae('0x1b')](_0x20a8bf);return _0x361194[_0x9aae('0x1c')]('Content-Range',_0x3c1475+'-'+_0x3e724d+'/'+_0x60174c)['json'](_0x1d0d02);}return null;};}function patchUpdates(_0x275820){return function(_0xc85c72){try{jsonpatch['apply'](_0xc85c72,_0x275820,!![]);}catch(_0x14db76){return BPromise[_0x9aae('0x1d')](_0x14db76);}return _0xc85c72['save']();};}function saveUpdates(_0x34f55,_0x4f20d0){return function(_0x150169){if(_0x150169){return _0x150169[_0x9aae('0x1e')](_0x34f55)[_0x9aae('0x1f')](function(_0x5620a4){return _0x5620a4;});}return null;};}function removeEntity(_0x17b90e,_0x4d5b5b){return function(_0x47975c){if(_0x47975c){return _0x47975c[_0x9aae('0x20')]()['then'](function(){var _0x2ca5e9=_0x47975c['get']({'plain':!![]});var _0x1d0a0f=_0x9aae('0x21');return db[_0x9aae('0x22')]['destroy']({'where':{'type':_0x1d0a0f,'resourceId':_0x2ca5e9['id']}})[_0x9aae('0x1f')](function(){return _0x47975c;});})[_0x9aae('0x1f')](function(){_0x17b90e[_0x9aae('0x1b')](0xcc)[_0x9aae('0x17')]();});}};}function handleEntityNotFound(_0x168023,_0x36a849){return function(_0x1479c6){if(!_0x1479c6){_0x168023[_0x9aae('0x23')](0x194);}return _0x1479c6;};}function handleError(_0x691cb5,_0x4ceba0){_0x4ceba0=_0x4ceba0||0x1f4;return function(_0x5bc01e){logger[_0x9aae('0x24')](_0x5bc01e[_0x9aae('0x25')]);if(_0x5bc01e['name']){delete _0x5bc01e[_0x9aae('0x26')];}_0x691cb5[_0x9aae('0x1b')](_0x4ceba0)[_0x9aae('0x27')](_0x5bc01e);};}exports[_0x9aae('0x28')]=function(_0x439453,_0x2a3588){var _0x10c290={},_0x50f3d7={},_0xcff25a={'count':0x0,'rows':[]};var _0x3b4d53=db[_0x9aae('0x29')][_0x9aae('0x2a')];_0x50f3d7[_0x9aae('0x2b')]=_['keys'](_0x3b4d53);_0x50f3d7[_0x9aae('0x2c')]=_['keys'](_0x439453[_0x9aae('0x2c')]);_0x50f3d7['filters']=_[_0x9aae('0x2d')](_0x50f3d7[_0x9aae('0x2b')],_0x50f3d7['query']);_0x10c290[_0x9aae('0x2e')]=_[_0x9aae('0x2d')](_0x50f3d7[_0x9aae('0x2b')],qs[_0x9aae('0x2f')](_0x439453['query']['fields']));_0x10c290[_0x9aae('0x2e')]=_0x10c290['attributes']['length']?_0x10c290[_0x9aae('0x2e')]:_0x50f3d7[_0x9aae('0x2b')];if(!_0x439453[_0x9aae('0x2c')]['hasOwnProperty']('nolimit')){_0x10c290[_0x9aae('0x30')]=qs['limit'](_0x439453[_0x9aae('0x2c')][_0x9aae('0x30')]);_0x10c290[_0x9aae('0x1a')]=qs['offset'](_0x439453[_0x9aae('0x2c')][_0x9aae('0x1a')]);}_0x10c290[_0x9aae('0x31')]=qs['sort'](_0x439453['query'][_0x9aae('0x32')]);_0x10c290[_0x9aae('0x33')]=qs[_0x9aae('0x34')](_[_0x9aae('0x35')](_0x439453['query'],_0x50f3d7[_0x9aae('0x34')]));if(_0x439453[_0x9aae('0x2c')][_0x9aae('0x36')]){_0x10c290[_0x9aae('0x33')]=_['merge'](_0x10c290[_0x9aae('0x33')],{'$or':_[_0x9aae('0x37')](_0x3b4d53,function(_0x2d643e){if(_0x2d643e[_0x9aae('0x38')][_0x9aae('0x39')]!==_0x9aae('0x3a')){var _0x4b1b46={};_0x4b1b46[_0x2d643e[_0x9aae('0x3b')]]={'$like':'%'+_0x439453['query'][_0x9aae('0x36')]+'%'};return _0x4b1b46;}})});}_0x10c290=_[_0x9aae('0x3c')]({},_0x10c290,_0x439453[_0x9aae('0x3d')]);var _0x1b241b={'where':_0x10c290[_0x9aae('0x33')]};return db[_0x9aae('0x29')][_0x9aae('0x19')](_0x1b241b)[_0x9aae('0x1f')](function(_0x56c498){_0xcff25a[_0x9aae('0x19')]=_0x56c498;if(_0x439453['query'][_0x9aae('0x3e')]){_0x10c290[_0x9aae('0x3f')]=[{'all':!![]}];}return db[_0x9aae('0x29')]['findAll'](_0x10c290);})['then'](function(_0x19b85d){_0xcff25a[_0x9aae('0x40')]=_0x19b85d;return _0xcff25a;})[_0x9aae('0x1f')](respondWithFilteredResult(_0x2a3588,_0x10c290))[_0x9aae('0x41')](handleError(_0x2a3588,null));};exports[_0x9aae('0x42')]=function(_0x516bf3,_0x4ef735){var _0x28311c={'raw':![],'where':{'id':_0x516bf3[_0x9aae('0x43')]['id']}},_0x48013b={};_0x48013b['model']=_[_0x9aae('0x44')](db[_0x9aae('0x29')][_0x9aae('0x2a')]);_0x48013b['query']=_[_0x9aae('0x44')](_0x516bf3[_0x9aae('0x2c')]);_0x48013b['filters']=_[_0x9aae('0x2d')](_0x48013b['model'],_0x48013b[_0x9aae('0x2c')]);_0x28311c[_0x9aae('0x2e')]=_[_0x9aae('0x2d')](_0x48013b[_0x9aae('0x2b')],qs[_0x9aae('0x2f')](_0x516bf3[_0x9aae('0x2c')]['fields']));_0x28311c[_0x9aae('0x2e')]=_0x28311c[_0x9aae('0x2e')]['length']?_0x28311c[_0x9aae('0x2e')]:_0x48013b[_0x9aae('0x2b')];if(_0x516bf3[_0x9aae('0x2c')][_0x9aae('0x3e')]){_0x28311c[_0x9aae('0x3f')]=[{'all':!![]}];}_0x28311c=_[_0x9aae('0x3c')]({},_0x28311c,_0x516bf3[_0x9aae('0x3d')]);return db['JscriptyProject'][_0x9aae('0x45')](_0x28311c)[_0x9aae('0x1f')](handleEntityNotFound(_0x4ef735,null))[_0x9aae('0x1f')](respondWithResult(_0x4ef735,null))['catch'](handleError(_0x4ef735,null));};exports['create']=function(_0x412b6e,_0x4ccc5e){return db[_0x9aae('0x29')][_0x9aae('0x46')](_0x412b6e['body'],{})[_0x9aae('0x1f')](function(_0x42ab23){var _0x22e96d=_0x412b6e[_0x9aae('0x47')][_0x9aae('0x48')]({'plain':!![]});if(!_0x22e96d)throw new Error(_0x9aae('0x49'));if(_0x22e96d[_0x9aae('0x4a')]==='user'){var _0x3e8a43=_0x42ab23['get']({'plain':!![]});var _0x1d7f3c=_0x9aae('0x21');return db[_0x9aae('0x4b')][_0x9aae('0x45')]({'where':{'name':_0x1d7f3c,'userProfileId':_0x22e96d[_0x9aae('0x4c')]},'raw':!![]})[_0x9aae('0x1f')](function(_0x3a5f6d){if(_0x3a5f6d&&_0x3a5f6d[_0x9aae('0x4d')]===0x0){return db[_0x9aae('0x22')]['create']({'name':_0x3e8a43['name'],'resourceId':_0x3e8a43['id'],'type':_0x3a5f6d['name'],'sectionId':_0x3a5f6d['id']},{})[_0x9aae('0x1f')](function(){return _0x42ab23;});}else{return _0x42ab23;}})['catch'](function(_0x332f0b){logger[_0x9aae('0x24')](_0x9aae('0x4e'),_0x332f0b);throw _0x332f0b;});}return _0x42ab23;})[_0x9aae('0x1f')](respondWithResult(_0x4ccc5e,0xc9))['catch'](handleError(_0x4ccc5e,null));};exports['clone']=function(_0x3c041c,_0xc4166f){var _0x4b0f47={'raw':![],'where':{'id':_0x3c041c[_0x9aae('0x43')]['id']}},_0x337a87={};_0x337a87[_0x9aae('0x2b')]=_[_0x9aae('0x44')](db[_0x9aae('0x29')][_0x9aae('0x2a')]);_0x4b0f47['attributes']=_['intersection'](_0x337a87['model'],qs[_0x9aae('0x2f')](_0x3c041c[_0x9aae('0x2c')][_0x9aae('0x2f')]));_0x4b0f47[_0x9aae('0x2e')]=_0x4b0f47[_0x9aae('0x2e')]['length']?_0x4b0f47[_0x9aae('0x2e')]:_0x337a87[_0x9aae('0x2b')];if(_0x3c041c[_0x9aae('0x2c')][_0x9aae('0x3e')]){_0x4b0f47[_0x9aae('0x3f')]=[{'all':!![]}];}_0x4b0f47=_[_0x9aae('0x3c')]({},_0x4b0f47,_0x3c041c['options']);return db[_0x9aae('0x29')][_0x9aae('0x45')](_0x4b0f47)[_0x9aae('0x1f')](handleEntityNotFound(_0xc4166f,null))[_0x9aae('0x1f')](function(_0xfe74f9){if(_0xfe74f9){var _0x4a2c07=_0xfe74f9[_0x9aae('0x48')]({'plain':!![]});_0x4a2c07=qs[_0x9aae('0x4f')](_0x4a2c07,['id','createdAt',_0x9aae('0x50')]);_0x3c041c[_0x9aae('0x51')]=_['omit'](_0x3c041c['body'],['id','createdAt',_0x9aae('0x50')]);return db[_0x9aae('0x29')][_0x9aae('0x46')](_['merge'](_0x4a2c07,_0x3c041c[_0x9aae('0x51')]),{'include':_0x3c041c[_0x9aae('0x2c')][_0x9aae('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x58dab4){var _0x5e524e=_0x3c041c[_0x9aae('0x47')][_0x9aae('0x48')]({'plain':!![]});if(!_0x5e524e)throw new Error(_0x9aae('0x49'));if(_0x5e524e['role']===_0x9aae('0x47')){var _0x5db664=_0x58dab4[_0x9aae('0x48')]({'plain':!![]});var _0x4c3732=_0x9aae('0x21');return db[_0x9aae('0x4b')][_0x9aae('0x45')]({'where':{'name':_0x4c3732,'userProfileId':_0x5e524e['userProfileId']},'raw':!![]})[_0x9aae('0x1f')](function(_0x27d94f){if(_0x27d94f&&_0x27d94f[_0x9aae('0x4d')]===0x0){return db[_0x9aae('0x22')][_0x9aae('0x46')]({'name':_0x5db664[_0x9aae('0x26')],'resourceId':_0x5db664['id'],'type':_0x27d94f['name'],'sectionId':_0x27d94f['id']},{})[_0x9aae('0x1f')](function(){return _0x58dab4;});}else{return _0x58dab4;}})[_0x9aae('0x41')](function(_0x1b40cd){logger[_0x9aae('0x24')](_0x9aae('0x4e'),_0x1b40cd);throw _0x1b40cd;});}return _0x58dab4;});}})[_0x9aae('0x1f')](respondWithResult(_0xc4166f,0xc9))[_0x9aae('0x41')](handleError(_0xc4166f,null));};exports[_0x9aae('0x1e')]=function(_0x485a59,_0xbe574b){if(_0x485a59[_0x9aae('0x51')]['id']){delete _0x485a59[_0x9aae('0x51')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x485a59[_0x9aae('0x43')]['id']}})[_0x9aae('0x1f')](handleEntityNotFound(_0xbe574b,null))['then'](saveUpdates(_0x485a59['body'],null))['then'](respondWithResult(_0xbe574b,null))[_0x9aae('0x41')](handleError(_0xbe574b,null));};exports[_0x9aae('0x20')]=function(_0x562861,_0x214841){return db[_0x9aae('0x29')][_0x9aae('0x45')]({'where':{'id':_0x562861[_0x9aae('0x43')]['id']}})[_0x9aae('0x1f')](handleEntityNotFound(_0x214841,null))[_0x9aae('0x1f')](removeEntity(_0x214841,null))[_0x9aae('0x41')](handleError(_0x214841,null));};exports[_0x9aae('0x52')]=function(_0x275e95,_0x478580,_0x5644d2){var _0x384dbd={'raw':!![],'where':{}};var _0x33d9e1={};var _0x3af8d9={'count':0x0,'rows':[]};return db[_0x9aae('0x29')]['findOne']({'where':{'id':_0x275e95[_0x9aae('0x43')]['id']}})[_0x9aae('0x1f')](handleEntityNotFound(_0x478580,null))[_0x9aae('0x1f')](function(_0x37418c){if(_0x37418c){_0x33d9e1[_0x9aae('0x2b')]=_[_0x9aae('0x44')](db[_0x9aae('0x53')]['rawAttributes']);_0x33d9e1[_0x9aae('0x2c')]=_[_0x9aae('0x44')](_0x275e95[_0x9aae('0x2c')]);_0x33d9e1[_0x9aae('0x34')]=_['intersection'](_0x33d9e1['model'],_0x33d9e1[_0x9aae('0x2c')]);_0x384dbd[_0x9aae('0x2e')]=_[_0x9aae('0x2d')](_0x33d9e1[_0x9aae('0x2b')],qs[_0x9aae('0x2f')](_0x275e95['query'][_0x9aae('0x2f')]));_0x384dbd[_0x9aae('0x2e')]=_0x384dbd['attributes'][_0x9aae('0x54')]?_0x384dbd['attributes']:_0x33d9e1[_0x9aae('0x2b')];if(!_0x275e95['query'][_0x9aae('0x55')](_0x9aae('0x56'))){_0x384dbd[_0x9aae('0x30')]=qs[_0x9aae('0x30')](_0x275e95[_0x9aae('0x2c')][_0x9aae('0x30')]);_0x384dbd[_0x9aae('0x1a')]=qs[_0x9aae('0x1a')](_0x275e95[_0x9aae('0x2c')][_0x9aae('0x1a')]);}_0x384dbd[_0x9aae('0x31')]=qs[_0x9aae('0x32')](_0x275e95['query'][_0x9aae('0x32')]);_0x384dbd[_0x9aae('0x33')]=qs[_0x9aae('0x34')](_['pick'](_0x275e95[_0x9aae('0x2c')],_0x33d9e1[_0x9aae('0x34')]));_0x384dbd[_0x9aae('0x33')][_0x9aae('0x57')]=_0x37418c['id'];if(_0x275e95[_0x9aae('0x2c')][_0x9aae('0x36')]){_0x384dbd[_0x9aae('0x33')]=_['merge'](_0x384dbd['where'],{'$or':_[_0x9aae('0x37')](_0x384dbd[_0x9aae('0x2e')],function(_0x59902b){var _0x33b40f={};_0x33b40f[_0x59902b]={'$like':'%'+_0x275e95[_0x9aae('0x2c')][_0x9aae('0x36')]+'%'};return _0x33b40f;})});}_0x384dbd=_[_0x9aae('0x3c')]({},_0x384dbd,_0x275e95[_0x9aae('0x3d')]);return db[_0x9aae('0x53')][_0x9aae('0x19')]({'where':_0x384dbd[_0x9aae('0x33')]})[_0x9aae('0x1f')](function(_0x55f94d){_0x3af8d9[_0x9aae('0x19')]=_0x55f94d;if(_0x275e95[_0x9aae('0x2c')][_0x9aae('0x3e')]){_0x384dbd[_0x9aae('0x3f')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x9aae('0x58')](_0x384dbd);})[_0x9aae('0x1f')](function(_0x1c1975){_0x3af8d9[_0x9aae('0x40')]=_0x1c1975;return _0x3af8d9;});}})[_0x9aae('0x1f')](respondWithFilteredResult(_0x478580,_0x384dbd))[_0x9aae('0x41')](handleError(_0x478580,null));};exports['getAnswers']=function(_0x2cbdaa,_0x4e7921,_0x4a7bf3){var _0x2509c9={'raw':!![],'where':{}};var _0x1a0351={};var _0x8c611a={'count':0x0,'rows':[]};return db[_0x9aae('0x29')][_0x9aae('0x59')]({'where':{'id':_0x2cbdaa[_0x9aae('0x43')]['id']}})[_0x9aae('0x1f')](handleEntityNotFound(_0x4e7921,null))[_0x9aae('0x1f')](function(_0x22487c){if(_0x22487c){_0x1a0351[_0x9aae('0x2b')]=_['keys'](db[_0x9aae('0x5a')]['rawAttributes']);_0x1a0351['query']=_['keys'](_0x2cbdaa['query']);_0x1a0351[_0x9aae('0x34')]=_['intersection'](_0x1a0351[_0x9aae('0x2b')],_0x1a0351[_0x9aae('0x2c')]);_0x2509c9[_0x9aae('0x2e')]=_[_0x9aae('0x2d')](_0x1a0351['model'],qs[_0x9aae('0x2f')](_0x2cbdaa[_0x9aae('0x2c')]['fields']));_0x2509c9[_0x9aae('0x2e')]=_0x2509c9[_0x9aae('0x2e')][_0x9aae('0x54')]?_0x2509c9['attributes']:_0x1a0351[_0x9aae('0x2b')];if(!_0x2cbdaa[_0x9aae('0x2c')][_0x9aae('0x55')](_0x9aae('0x56'))){_0x2509c9[_0x9aae('0x30')]=qs[_0x9aae('0x30')](_0x2cbdaa[_0x9aae('0x2c')]['limit']);_0x2509c9['offset']=qs[_0x9aae('0x1a')](_0x2cbdaa[_0x9aae('0x2c')]['offset']);}_0x2509c9[_0x9aae('0x31')]=qs[_0x9aae('0x32')](_0x2cbdaa['query']['sort']);_0x2509c9[_0x9aae('0x33')]=qs[_0x9aae('0x34')](_['pick'](_0x2cbdaa[_0x9aae('0x2c')],_0x1a0351[_0x9aae('0x34')]));_0x2509c9[_0x9aae('0x33')][_0x9aae('0x57')]=_0x22487c['id'];if(_0x2cbdaa['query'][_0x9aae('0x36')]){_0x2509c9[_0x9aae('0x33')]=_[_0x9aae('0x3c')](_0x2509c9[_0x9aae('0x33')],{'$or':_[_0x9aae('0x37')](_0x2509c9[_0x9aae('0x2e')],function(_0x3ff628){var _0x21f507={};_0x21f507[_0x3ff628]={'$like':'%'+_0x2cbdaa[_0x9aae('0x2c')][_0x9aae('0x36')]+'%'};return _0x21f507;})});}_0x2509c9=_[_0x9aae('0x3c')]({},_0x2509c9,_0x2cbdaa[_0x9aae('0x3d')]);return db[_0x9aae('0x5a')][_0x9aae('0x19')]({'where':_0x2509c9[_0x9aae('0x33')]})['then'](function(_0x13ad72){_0x8c611a['count']=_0x13ad72;if(_0x2cbdaa[_0x9aae('0x2c')][_0x9aae('0x3e')]){_0x2509c9['include']=[{'all':!![]}];}return db[_0x9aae('0x5a')][_0x9aae('0x58')](_0x2509c9);})['then'](function(_0x468845){_0x8c611a[_0x9aae('0x40')]=_0x468845;return _0x8c611a;});}})[_0x9aae('0x1f')](respondWithFilteredResult(_0x4e7921,_0x2509c9))['catch'](handleError(_0x4e7921,null));};function char(_0x57fae3){return'number'===typeof _0x57fae3?String['fromCharCode'][_0x9aae('0x5b')](null,arguments):_0x57fae3;}function needsEncapsulation(_0x142f30){return!!_0x142f30&&(_0x142f30['toString']()[_0x9aae('0x5c')](char(0xd))>=0x0||_0x142f30[_0x9aae('0x5d')]()['indexOf'](char(0xa))>=0x0||_0x142f30[_0x9aae('0x5d')]()[_0x9aae('0x5c')](char(0x2c))>=0x0||_0x142f30[_0x9aae('0x5d')]()[_0x9aae('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x35d4cd){var _0x1e4db8=char(0x22),_0x18745d='\x5c'+char(0x22),_0x5103fe=_0x35d4cd[_0x9aae('0x5d')]()['replace'](new RegExp(_0x1e4db8,'g'),_0x18745d);return _0x1e4db8+_0x5103fe+_0x1e4db8;}exports[_0x9aae('0x5e')]=function(_0x19e9a1,_0xd318d4,_0x3c5669){var _0x249315,_0x3a2f7d;var _0x498e36={'where':{'ProjectId':_0x19e9a1[_0x9aae('0x43')]['id']}};if(_0x19e9a1['query']['startTime']){_0x498e36[_0x9aae('0x33')][_0x9aae('0x5f')]=JSON[_0x9aae('0x60')](_0x19e9a1[_0x9aae('0x2c')][_0x9aae('0x61')]);}return db[_0x9aae('0x53')]['findAll'](_0x498e36)[_0x9aae('0x1f')](handleEntityNotFound(_0xd318d4,null))[_0x9aae('0x1f')](function(_0x268d2e){if(_0x268d2e){_0x249315=_0x268d2e;return db[_0x9aae('0x62')][_0x9aae('0x58')]({'where':{'SessionId':{'$in':_[_0x9aae('0x37')](_0x249315,'id')},'ProjectId':_0x19e9a1[_0x9aae('0x43')]['id']},'order':_0x9aae('0x63')});}})[_0x9aae('0x1f')](handleEntityNotFound(_0xd318d4,null))[_0x9aae('0x1f')](function(_0x12d638){if(_0x12d638){_0x3a2f7d=_0x12d638;var _0x91d252={};for(var _0x535078=0x0,_0x5030f9=_0x3a2f7d['length'];_0x535078<_0x5030f9;_0x535078++){if(!_0x91d252['hasOwnProperty'](_0x3a2f7d[_0x535078][_0x9aae('0x64')])){_0x91d252[_0x3a2f7d[_0x535078][_0x9aae('0x64')]]=needsEncapsulation(_0x3a2f7d[_0x535078][_0x9aae('0x65')])?encapsulate(_0x3a2f7d[_0x535078]['question']):_0x3a2f7d[_0x535078][_0x9aae('0x65')];}}var _0x5a5531=[],_0x3af3da={};for(var _0x1e8205=0x0,_0x2b13aa=_0x249315[_0x9aae('0x54')];_0x1e8205<_0x2b13aa;_0x1e8205++){_0x3af3da={'ProjectId':_0x19e9a1['params']['id'],'SessionId':_0x249315[_0x1e8205]['id'],'StartTime':moment(_0x249315[_0x1e8205]['starttime'])[_0x9aae('0x66')](_0x9aae('0x67'))};for(var _0x1fb353=0x0,_0xf531e8=_0x3a2f7d['length'];_0x1fb353<_0xf531e8;_0x1fb353++){if(_0x3a2f7d[_0x1fb353]['SessionId']==_0x249315[_0x1e8205]['id']&&_0x91d252[_0x9aae('0x55')](_0x3a2f7d[_0x1fb353][_0x9aae('0x64')])){_0x3af3da[_0x91d252[_0x3a2f7d[_0x1fb353]['questionId']]]=_0x3a2f7d[_0x1fb353][_0x9aae('0x68')];}}for(var _0x2befb0 in _0x91d252){if(!_0x3af3da[_0x9aae('0x55')](_0x91d252[_0x2befb0])){_0x3af3da[_0x91d252[_0x2befb0]]=null;}}_0x5a5531['push'](_0x3af3da);}return _0x5a5531;}})[_0x9aae('0x1f')](function(_0x1d3e4e){if(!_['isEmpty'](_0x1d3e4e)){var _0xb9c09=toCsv(_0x1d3e4e);var _0x23d3b2=Date['now']();fs[_0x9aae('0x69')](util[_0x9aae('0x66')](_0x9aae('0x6a'),_0x19e9a1[_0x9aae('0x43')]['id'],_0x23d3b2),_0xb9c09);_0xd318d4['setHeader'](_0x9aae('0x6b'),_0x9aae('0x6c')+util[_0x9aae('0x66')]('Jscripty_Project_%d_Summary_%s.csv',_0x19e9a1[_0x9aae('0x43')]['id'],_0x23d3b2));_0xd318d4[_0x9aae('0x6d')]('Content-type',_0x9aae('0x6e'));return _0xd318d4[_0x9aae('0x6f')](util['format'](_0x9aae('0x6a'),_0x19e9a1[_0x9aae('0x43')]['id'],_0x23d3b2));}else{return _0xd318d4[_0x9aae('0x23')](0xcc);}})[_0x9aae('0x41')](handleError(_0xd318d4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 4910add..d520951 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 _0x655c=['lodash','util','api','moment','bluebird','request-promise','exports','define','JscriptyProject','jscripty_projects'];(function(_0xe02c79,_0x2007c9){var _0x2858cc=function(_0x5cd68e){while(--_0x5cd68e){_0xe02c79['push'](_0xe02c79['shift']());}};_0x2858cc(++_0x2007c9);}(_0x655c,0x15e));var _0xc655=function(_0x43565f,_0x4a2e53){_0x43565f=_0x43565f-0x0;var _0x2e7547=_0x655c[_0x43565f];return _0x2e7547;};'use strict';var _=require(_0xc655('0x0'));var util=require(_0xc655('0x1'));var logger=require('../../config/logger')(_0xc655('0x2'));var moment=require(_0xc655('0x3'));var BPromise=require(_0xc655('0x4'));var rp=require(_0xc655('0x5'));var attributes=require('./jscriptyProject.attributes');module[_0xc655('0x6')]=function(_0x27f4fe,_0x1ae7f8){return _0x27f4fe[_0xc655('0x7')](_0xc655('0x8'),attributes,{'tableName':_0xc655('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f8c=['jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x1a982c,_0x240c39){var _0xe07e20=function(_0x548361){while(--_0x548361){_0x1a982c['push'](_0x1a982c['shift']());}};_0xe07e20(++_0x240c39);}(_0x7f8c,0x139));var _0xc7f8=function(_0x265303,_0x2cea2d){_0x265303=_0x265303-0x0;var _0x2b2946=_0x7f8c[_0x265303];return _0x2b2946;};'use strict';var _=require(_0xc7f8('0x0'));var util=require(_0xc7f8('0x1'));var logger=require(_0xc7f8('0x2'))(_0xc7f8('0x3'));var moment=require(_0xc7f8('0x4'));var BPromise=require(_0xc7f8('0x5'));var rp=require(_0xc7f8('0x6'));var attributes=require(_0xc7f8('0x7'));module[_0xc7f8('0x8')]=function(_0x52563b,_0x5f71f6){return _0x52563b[_0xc7f8('0x9')](_0xc7f8('0xa'),attributes,{'tableName':_0xc7f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index a315347..c3d262e 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 _0x4d2a=['debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','then','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x480b0c,_0x4dab08){var _0x567587=function(_0x293136){while(--_0x293136){_0x480b0c['push'](_0x480b0c['shift']());}};_0x567587(++_0x4dab08);}(_0x4d2a,0x95));var _0xa4d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d2a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa4d2('0x0'));var moment=require('moment');var BPromise=require(_0xa4d2('0x1'));var rs=require(_0xa4d2('0x2'));var fs=require('fs');var Redis=require(_0xa4d2('0x3'));var db=require(_0xa4d2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa4d2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa4d2('0x6')][_0xa4d2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1acd5e,_0x3d6a36,_0x27da77){return new BPromise(function(_0x98344,_0x2dad0b){return client['request'](_0x1acd5e,_0x27da77)[_0xa4d2('0x8')](function(_0x44aa03){logger[_0xa4d2('0x9')](_0xa4d2('0xa'),_0x3d6a36,'request\x20sent');logger[_0xa4d2('0xb')](_0xa4d2('0xc'),_0x3d6a36,_0xa4d2('0xd'),JSON[_0xa4d2('0xe')](_0x44aa03));if(_0x44aa03[_0xa4d2('0xf')]){if(_0x44aa03[_0xa4d2('0xf')][_0xa4d2('0x10')]===0x1f4){logger[_0xa4d2('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x3d6a36,_0x44aa03[_0xa4d2('0xf')][_0xa4d2('0x11')]);return _0x2dad0b(_0x44aa03['error'][_0xa4d2('0x11')]);}logger[_0xa4d2('0xf')](_0xa4d2('0xa'),_0x3d6a36,_0x44aa03[_0xa4d2('0xf')][_0xa4d2('0x11')]);return _0x98344(_0x44aa03[_0xa4d2('0xf')][_0xa4d2('0x11')]);}else{logger['info'](_0xa4d2('0xa'),_0x3d6a36,_0xa4d2('0xd'));_0x98344(_0x44aa03[_0xa4d2('0x12')][_0xa4d2('0x11')]);}})[_0xa4d2('0x13')](function(_0x1fd6f2){logger['error'](_0xa4d2('0xa'),_0x3d6a36,_0x1fd6f2);_0x2dad0b(_0x1fd6f2);});});} \ No newline at end of file +var _0xf337=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x213996,_0x4de2a7){var _0x3a8c69=function(_0xdc7081){while(--_0xdc7081){_0x213996['push'](_0x213996['shift']());}};_0x3a8c69(++_0x4de2a7);}(_0xf337,0x10d));var _0x7f33=function(_0x12e6c5,_0x92303b){_0x12e6c5=_0x12e6c5-0x0;var _0x2270c4=_0xf337[_0x12e6c5];return _0x2270c4;};'use strict';var _=require(_0x7f33('0x0'));var util=require('util');var moment=require(_0x7f33('0x1'));var BPromise=require(_0x7f33('0x2'));var rs=require(_0x7f33('0x3'));var fs=require('fs');var Redis=require(_0x7f33('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f33('0x5'));var logger=require(_0x7f33('0x6'))(_0x7f33('0x7'));var config=require(_0x7f33('0x8'));var jayson=require(_0x7f33('0x9'));var client=jayson['client'][_0x7f33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5168bc,_0x411ad2,_0xc3c433){return new BPromise(function(_0x4b52e9,_0x8348d1){return client[_0x7f33('0xb')](_0x5168bc,_0xc3c433)[_0x7f33('0xc')](function(_0x1d9072){logger[_0x7f33('0xd')](_0x7f33('0xe'),_0x411ad2,_0x7f33('0xf'));logger[_0x7f33('0x10')](_0x7f33('0x11'),_0x411ad2,'request\x20sent',JSON[_0x7f33('0x12')](_0x1d9072));if(_0x1d9072[_0x7f33('0x13')]){if(_0x1d9072['error'][_0x7f33('0x14')]===0x1f4){logger[_0x7f33('0x13')](_0x7f33('0xe'),_0x411ad2,_0x1d9072['error'][_0x7f33('0x15')]);return _0x8348d1(_0x1d9072['error']['message']);}logger[_0x7f33('0x13')](_0x7f33('0xe'),_0x411ad2,_0x1d9072['error'][_0x7f33('0x15')]);return _0x4b52e9(_0x1d9072[_0x7f33('0x13')][_0x7f33('0x15')]);}else{logger[_0x7f33('0xd')](_0x7f33('0xe'),_0x411ad2,_0x7f33('0xf'));_0x4b52e9(_0x1d9072[_0x7f33('0x16')][_0x7f33('0x15')]);}})[_0x7f33('0x17')](function(_0x51b8bc){logger[_0x7f33('0x13')](_0x7f33('0xe'),_0x411ad2,_0x51b8bc);_0x8348d1(_0x51b8bc);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 4dba616..02e3432 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 _0x8e2e=['express','Router','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x2b0074,_0x42d50b){var _0x25b012=function(_0x53d3b9){while(--_0x53d3b9){_0x2b0074['push'](_0x2b0074['shift']());}};_0x25b012(++_0x42d50b);}(_0x8e2e,0x6a));var _0xe8e2=function(_0x868b7c,_0xfa438b){_0x868b7c=_0x868b7c-0x0;var _0x21683c=_0x8e2e[_0x868b7c];return _0x21683c;};'use strict';var multer=require(_0xe8e2('0x0'));var util=require('util');var path=require(_0xe8e2('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8e2('0x2'));var router=express[_0xe8e2('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe8e2('0x4'));router[_0xe8e2('0x5')]('/',auth[_0xe8e2('0x6')](),controller['index']);router[_0xe8e2('0x5')](_0xe8e2('0x7'),auth[_0xe8e2('0x6')](),controller[_0xe8e2('0x8')]);router['get'](_0xe8e2('0x9'),auth[_0xe8e2('0x6')](),controller[_0xe8e2('0xa')]);router[_0xe8e2('0xb')]('/',auth[_0xe8e2('0x6')](),controller[_0xe8e2('0xc')]);router[_0xe8e2('0xd')](_0xe8e2('0x9'),auth[_0xe8e2('0x6')](),controller[_0xe8e2('0xe')]);router[_0xe8e2('0xf')](_0xe8e2('0x9'),auth[_0xe8e2('0x6')](),controller[_0xe8e2('0x10')]);module[_0xe8e2('0x11')]=router; \ No newline at end of file +var _0xcf75=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf75,0x142));var _0x5cf7=function(_0x55a994,_0x4128ea){_0x55a994=_0x55a994-0x0;var _0x238510=_0xcf75[_0x55a994];return _0x238510;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5cf7('0x0'));var timeout=require(_0x5cf7('0x1'));var express=require(_0x5cf7('0x2'));var router=express[_0x5cf7('0x3')]();var auth=require(_0x5cf7('0x4'));var interaction=require(_0x5cf7('0x5'));var config=require(_0x5cf7('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x5cf7('0x7')]('/',auth[_0x5cf7('0x8')](),controller['index']);router['get'](_0x5cf7('0x9'),auth[_0x5cf7('0x8')](),controller[_0x5cf7('0xa')]);router[_0x5cf7('0x7')](_0x5cf7('0xb'),auth[_0x5cf7('0x8')](),controller[_0x5cf7('0xc')]);router[_0x5cf7('0xd')]('/',auth['isAuthenticated'](),controller[_0x5cf7('0xe')]);router['put'](_0x5cf7('0xb'),auth[_0x5cf7('0x8')](),controller[_0x5cf7('0xf')]);router[_0x5cf7('0x10')](_0x5cf7('0xb'),auth[_0x5cf7('0x8')](),controller[_0x5cf7('0x11')]);module[_0x5cf7('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 909906d..bba8593 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 _0x0eaa=['STRING','sequelize','exports','long'];(function(_0xa041de,_0x3600e2){var _0x1d654c=function(_0x295d70){while(--_0x295d70){_0xa041de['push'](_0xa041de['shift']());}};_0x1d654c(++_0x3600e2);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x222524,_0x100b31){_0x222524=_0x222524-0x0;var _0x2871e0=_0x0eaa[_0x222524];return _0x2871e0;};'use strict';var Sequelize=require(_0xa0ea('0x0'));module[_0xa0ea('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize['TEXT'](_0xa0ea('0x2'))},'membername':{'type':Sequelize[_0xa0ea('0x3')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa0ea('0x3')]},'uniqueid':{'type':Sequelize[_0xa0ea('0x3')]},'calleridname':{'type':Sequelize[_0xa0ea('0x3')]},'calleridnum':{'type':Sequelize[_0xa0ea('0x3')]},'questionId':{'type':Sequelize[_0xa0ea('0x3')]}}; \ No newline at end of file +var _0x9bc3=['exports','STRING','long','sequelize'];(function(_0x118a93,_0xd83a8d){var _0x47e504=function(_0x59eaee){while(--_0x59eaee){_0x118a93['push'](_0x118a93['shift']());}};_0x47e504(++_0xd83a8d);}(_0x9bc3,0x137));var _0x39bc=function(_0x2a6e6a,_0x26e879){_0x2a6e6a=_0x2a6e6a-0x0;var _0xd216a4=_0x9bc3[_0x2a6e6a];return _0xd216a4;};'use strict';var Sequelize=require(_0x39bc('0x0'));module[_0x39bc('0x1')]={'question':{'type':Sequelize[_0x39bc('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x39bc('0x3'))},'membername':{'type':Sequelize[_0x39bc('0x2')]},'projectname':{'type':Sequelize[_0x39bc('0x2')]},'queue':{'type':Sequelize[_0x39bc('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x39bc('0x2')]},'calleridnum':{'type':Sequelize[_0x39bc('0x2')]},'questionId':{'type':Sequelize[_0x39bc('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 5aff2fb..be0da6a 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 _0xa7fa=['count','offset','limit','set','json','apply','save','then','error','stack','send','JscriptyQuestionReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','map','type','key','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','destroy','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','crypto','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end'];(function(_0x2d7a8c,_0x25b0f1){var _0x277cf8=function(_0x55c4e6){while(--_0x55c4e6){_0x2d7a8c['push'](_0x2d7a8c['shift']());}};_0x277cf8(++_0x25b0f1);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xaa7f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa7f('0x1'));var jsonpatch=require(_0xaa7f('0x2'));var rp=require(_0xaa7f('0x3'));var moment=require(_0xaa7f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaa7f('0x5'));var util=require(_0xaa7f('0x6'));var path=require(_0xaa7f('0x7'));var sox=require(_0xaa7f('0x8'));var csv=require('to-csv');var ejs=require(_0xaa7f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa7f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xaa7f('0xb'));var toCsv=require(_0xaa7f('0xc'));var querystring=require(_0xaa7f('0xd'));var Papa=require(_0xaa7f('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xaa7f('0xf'));var Redis=require(_0xaa7f('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xaa7f('0x11'))(_0xaa7f('0x12'));var utils=require(_0xaa7f('0x13'));var config=require(_0xaa7f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ecdc6,_0x1f7a10){_0x1f7a10=_0x1f7a10||0xcc;return function(_0x7e736){if(_0x7e736){return _0x5ecdc6[_0xaa7f('0x15')](_0x1f7a10);}return _0x5ecdc6[_0xaa7f('0x16')](_0x1f7a10)[_0xaa7f('0x17')]();};}function respondWithResult(_0x392b8a,_0x39ba70){_0x39ba70=_0x39ba70||0xc8;return function(_0x347929){if(_0x347929){return _0x392b8a[_0xaa7f('0x16')](_0x39ba70)['json'](_0x347929);}};}function respondWithFilteredResult(_0x11436b,_0x4c7809){return function(_0x3c1615){if(_0x3c1615){var _0x6ba90d=_0x3c1615[_0xaa7f('0x18')],_0x470c74=_0x4c7809[_0xaa7f('0x19')],_0x48844f=_0x4c7809[_0xaa7f('0x19')]+_0x4c7809[_0xaa7f('0x1a')],_0x7276be;if(_0x48844f>=_0x6ba90d){_0x48844f=_0x6ba90d;_0x7276be=0xc8;}else{_0x7276be=0xce;}_0x11436b[_0xaa7f('0x16')](_0x7276be);return _0x11436b[_0xaa7f('0x1b')]('Content-Range',_0x470c74+'-'+_0x48844f+'/'+_0x6ba90d)[_0xaa7f('0x1c')](_0x3c1615);}return null;};}function patchUpdates(_0x1e18a6){return function(_0x132382){try{jsonpatch[_0xaa7f('0x1d')](_0x132382,_0x1e18a6,!![]);}catch(_0x4d1119){return BPromise['reject'](_0x4d1119);}return _0x132382[_0xaa7f('0x1e')]();};}function saveUpdates(_0x4cded6,_0x2a0980){return function(_0x21e870){if(_0x21e870){return _0x21e870['update'](_0x4cded6)[_0xaa7f('0x1f')](function(_0x489b56){return _0x489b56;});}return null;};}function removeEntity(_0x1903f9,_0xcf5c01){return function(_0x3e203b){if(_0x3e203b){return _0x3e203b['destroy']()[_0xaa7f('0x1f')](function(){_0x1903f9[_0xaa7f('0x16')](0xcc)[_0xaa7f('0x17')]();});}};}function handleEntityNotFound(_0x3900df,_0x55363c){return function(_0x5e3d5e){if(!_0x5e3d5e){_0x3900df[_0xaa7f('0x15')](0x194);}return _0x5e3d5e;};}function handleError(_0x3effde,_0x3076f4){_0x3076f4=_0x3076f4||0x1f4;return function(_0x246a18){logger[_0xaa7f('0x20')](_0x246a18[_0xaa7f('0x21')]);if(_0x246a18['name']){delete _0x246a18['name'];}_0x3effde['status'](_0x3076f4)[_0xaa7f('0x22')](_0x246a18);};}exports['index']=function(_0xbff8a0,_0x23bd9e){var _0x4c79fa={},_0x46c83e={},_0x48e8e8={'count':0x0,'rows':[]};var _0x41b368=db[_0xaa7f('0x23')][_0xaa7f('0x24')];_0x46c83e[_0xaa7f('0x25')]=_[_0xaa7f('0x26')](_0x41b368);_0x46c83e['query']=_[_0xaa7f('0x26')](_0xbff8a0[_0xaa7f('0x27')]);_0x46c83e[_0xaa7f('0x28')]=_['intersection'](_0x46c83e[_0xaa7f('0x25')],_0x46c83e[_0xaa7f('0x27')]);_0x4c79fa[_0xaa7f('0x29')]=_[_0xaa7f('0x2a')](_0x46c83e[_0xaa7f('0x25')],qs[_0xaa7f('0x2b')](_0xbff8a0['query'][_0xaa7f('0x2b')]));_0x4c79fa[_0xaa7f('0x29')]=_0x4c79fa['attributes'][_0xaa7f('0x2c')]?_0x4c79fa[_0xaa7f('0x29')]:_0x46c83e[_0xaa7f('0x25')];if(!_0xbff8a0[_0xaa7f('0x27')][_0xaa7f('0x2d')](_0xaa7f('0x2e'))){_0x4c79fa[_0xaa7f('0x1a')]=qs[_0xaa7f('0x1a')](_0xbff8a0[_0xaa7f('0x27')][_0xaa7f('0x1a')]);_0x4c79fa[_0xaa7f('0x19')]=qs[_0xaa7f('0x19')](_0xbff8a0[_0xaa7f('0x27')][_0xaa7f('0x19')]);}_0x4c79fa[_0xaa7f('0x2f')]=qs['sort'](_0xbff8a0[_0xaa7f('0x27')]['sort']);_0x4c79fa[_0xaa7f('0x30')]=qs[_0xaa7f('0x28')](_['pick'](_0xbff8a0[_0xaa7f('0x27')],_0x46c83e[_0xaa7f('0x28')]));if(_0xbff8a0['query'][_0xaa7f('0x31')]){_0x4c79fa[_0xaa7f('0x30')]=_['merge'](_0x4c79fa['where'],{'$or':_[_0xaa7f('0x32')](_0x41b368,function(_0xdf428e){if(_0xdf428e[_0xaa7f('0x33')][_0xaa7f('0x34')]!==_0xaa7f('0x35')){var _0x4c9301={};_0x4c9301[_0xdf428e['field']]={'$like':'%'+_0xbff8a0[_0xaa7f('0x27')][_0xaa7f('0x31')]+'%'};return _0x4c9301;}})});}_0x4c79fa=_[_0xaa7f('0x36')]({},_0x4c79fa,_0xbff8a0[_0xaa7f('0x37')]);var _0x376a96={'where':_0x4c79fa[_0xaa7f('0x30')]};return db[_0xaa7f('0x23')]['count'](_0x376a96)[_0xaa7f('0x1f')](function(_0x300a07){_0x48e8e8[_0xaa7f('0x18')]=_0x300a07;if(_0xbff8a0[_0xaa7f('0x27')][_0xaa7f('0x38')]){_0x4c79fa[_0xaa7f('0x39')]=[{'all':!![]}];}return db[_0xaa7f('0x23')][_0xaa7f('0x3a')](_0x4c79fa);})[_0xaa7f('0x1f')](function(_0x2ad879){_0x48e8e8[_0xaa7f('0x3b')]=_0x2ad879;return _0x48e8e8;})[_0xaa7f('0x1f')](respondWithFilteredResult(_0x23bd9e,_0x4c79fa))[_0xaa7f('0x3c')](handleError(_0x23bd9e,null));};exports[_0xaa7f('0x3d')]=function(_0x47a079,_0x23392a){var _0x2c45e2={'raw':!![],'where':{'id':_0x47a079[_0xaa7f('0x3e')]['id']}},_0x406bd0={};_0x406bd0[_0xaa7f('0x25')]=_[_0xaa7f('0x26')](db[_0xaa7f('0x23')][_0xaa7f('0x24')]);_0x406bd0['query']=_[_0xaa7f('0x26')](_0x47a079[_0xaa7f('0x27')]);_0x406bd0[_0xaa7f('0x28')]=_[_0xaa7f('0x2a')](_0x406bd0['model'],_0x406bd0['query']);_0x2c45e2[_0xaa7f('0x29')]=_['intersection'](_0x406bd0['model'],qs['fields'](_0x47a079['query'][_0xaa7f('0x2b')]));_0x2c45e2[_0xaa7f('0x29')]=_0x2c45e2[_0xaa7f('0x29')][_0xaa7f('0x2c')]?_0x2c45e2[_0xaa7f('0x29')]:_0x406bd0[_0xaa7f('0x25')];if(_0x47a079[_0xaa7f('0x27')][_0xaa7f('0x38')]){_0x2c45e2['include']=[{'all':!![]}];}_0x2c45e2=_[_0xaa7f('0x36')]({},_0x2c45e2,_0x47a079['options']);return db['JscriptyQuestionReport']['find'](_0x2c45e2)[_0xaa7f('0x1f')](handleEntityNotFound(_0x23392a,null))[_0xaa7f('0x1f')](respondWithResult(_0x23392a,null))[_0xaa7f('0x3c')](handleError(_0x23392a,null));};exports[_0xaa7f('0x3f')]=function(_0x4155c0,_0x504593){return db[_0xaa7f('0x23')][_0xaa7f('0x3f')](_0x4155c0[_0xaa7f('0x40')],{})['then'](respondWithResult(_0x504593,0xc9))[_0xaa7f('0x3c')](handleError(_0x504593,null));};exports[_0xaa7f('0x41')]=function(_0x3f2880,_0x578795){if(_0x3f2880[_0xaa7f('0x40')]['id']){delete _0x3f2880[_0xaa7f('0x40')]['id'];}return db[_0xaa7f('0x23')][_0xaa7f('0x42')]({'where':{'id':_0x3f2880[_0xaa7f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x578795,null))[_0xaa7f('0x1f')](saveUpdates(_0x3f2880[_0xaa7f('0x40')],null))['then'](respondWithResult(_0x578795,null))[_0xaa7f('0x3c')](handleError(_0x578795,null));};exports[_0xaa7f('0x43')]=function(_0x38313f,_0x406f7f){return db[_0xaa7f('0x23')][_0xaa7f('0x42')]({'where':{'id':_0x38313f[_0xaa7f('0x3e')]['id']}})[_0xaa7f('0x1f')](handleEntityNotFound(_0x406f7f,null))['then'](removeEntity(_0x406f7f,null))['catch'](handleError(_0x406f7f,null));};exports[_0xaa7f('0x44')]=function(_0xbd5e02,_0x4751c9){return db[_0xaa7f('0x23')][_0xaa7f('0x44')]()['then'](respondWithResult(_0x4751c9,null))[_0xaa7f('0x3c')](handleError(_0x4751c9,null));}; \ No newline at end of file +var _0x02ce=['papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','status','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','includeAll','JscriptyQuestionReport','rows','catch','length','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring'];(function(_0x1735df,_0x310d27){var _0x4a7c37=function(_0x5e4a9c){while(--_0x5e4a9c){_0x1735df['push'](_0x1735df['shift']());}};_0x4a7c37(++_0x310d27);}(_0x02ce,0x1ac));var _0xe02c=function(_0x223d34,_0x483275){_0x223d34=_0x223d34-0x0;var _0x236bea=_0x02ce[_0x223d34];return _0x236bea;};'use strict';var pdf=require(_0xe02c('0x0'));var emlformat=require(_0xe02c('0x1'));var rimraf=require(_0xe02c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe02c('0x3'));var rp=require('request-promise');var moment=require(_0xe02c('0x4'));var BPromise=require(_0xe02c('0x5'));var Mustache=require(_0xe02c('0x6'));var util=require(_0xe02c('0x7'));var path=require(_0xe02c('0x8'));var sox=require(_0xe02c('0x9'));var csv=require(_0xe02c('0xa'));var ejs=require(_0xe02c('0xb'));var fs=require('fs');var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0xa'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var authService=require(_0xe02c('0x11'));var hardwareService=require(_0xe02c('0x12'));var Redis=require(_0xe02c('0x13'));var qs=require(_0xe02c('0x14'));var logger=require(_0xe02c('0x15'))(_0xe02c('0x16'));var utils=require(_0xe02c('0x17'));var config=require(_0xe02c('0x18'));var db=require(_0xe02c('0x19'))['db'];function respondWithStatusCode(_0x27d301,_0x144037){_0x144037=_0x144037||0xcc;return function(_0x23d886){if(_0x23d886){return _0x27d301[_0xe02c('0x1a')](_0x144037);}return _0x27d301['status'](_0x144037)[_0xe02c('0x1b')]();};}function respondWithResult(_0x525538,_0x5165f6){_0x5165f6=_0x5165f6||0xc8;return function(_0x3f4e28){if(_0x3f4e28){return _0x525538['status'](_0x5165f6)[_0xe02c('0x1c')](_0x3f4e28);}};}function respondWithFilteredResult(_0x59614c,_0x3a5a2c){return function(_0x4e9c6d){if(_0x4e9c6d){var _0x256311=_0x4e9c6d[_0xe02c('0x1d')],_0x366893=_0x3a5a2c['offset'],_0x59f2f6=_0x3a5a2c[_0xe02c('0x1e')]+_0x3a5a2c[_0xe02c('0x1f')],_0x10a2a6;if(_0x59f2f6>=_0x256311){_0x59f2f6=_0x256311;_0x10a2a6=0xc8;}else{_0x10a2a6=0xce;}_0x59614c['status'](_0x10a2a6);return _0x59614c['set'](_0xe02c('0x20'),_0x366893+'-'+_0x59f2f6+'/'+_0x256311)['json'](_0x4e9c6d);}return null;};}function patchUpdates(_0x1f8f37){return function(_0x28b21a){try{jsonpatch[_0xe02c('0x21')](_0x28b21a,_0x1f8f37,!![]);}catch(_0x36fed0){return BPromise[_0xe02c('0x22')](_0x36fed0);}return _0x28b21a['save']();};}function saveUpdates(_0x4261ad,_0x59026f){return function(_0x4ea9b5){if(_0x4ea9b5){return _0x4ea9b5[_0xe02c('0x23')](_0x4261ad)[_0xe02c('0x24')](function(_0x480b9a){return _0x480b9a;});}return null;};}function removeEntity(_0x3fe8f7,_0x2d652e){return function(_0x4ce5ee){if(_0x4ce5ee){return _0x4ce5ee[_0xe02c('0x25')]()[_0xe02c('0x24')](function(){_0x3fe8f7[_0xe02c('0x26')](0xcc)[_0xe02c('0x1b')]();});}};}function handleEntityNotFound(_0x2d44c8,_0x557142){return function(_0x3e80e3){if(!_0x3e80e3){_0x2d44c8[_0xe02c('0x1a')](0x194);}return _0x3e80e3;};}function handleError(_0xeae877,_0x18b538){_0x18b538=_0x18b538||0x1f4;return function(_0x60b65e){logger['error'](_0x60b65e[_0xe02c('0x27')]);if(_0x60b65e[_0xe02c('0x28')]){delete _0x60b65e[_0xe02c('0x28')];}_0xeae877[_0xe02c('0x26')](_0x18b538)[_0xe02c('0x29')](_0x60b65e);};}exports[_0xe02c('0x2a')]=function(_0x43dc78,_0x1c14d6){var _0x55ef2a={},_0x55e475={},_0x3790eb={'count':0x0,'rows':[]};var _0x148e2b=db['JscriptyQuestionReport'][_0xe02c('0x2b')];_0x55e475[_0xe02c('0x2c')]=_[_0xe02c('0x2d')](_0x148e2b);_0x55e475[_0xe02c('0x2e')]=_[_0xe02c('0x2d')](_0x43dc78[_0xe02c('0x2e')]);_0x55e475[_0xe02c('0x2f')]=_[_0xe02c('0x30')](_0x55e475[_0xe02c('0x2c')],_0x55e475[_0xe02c('0x2e')]);_0x55ef2a[_0xe02c('0x31')]=_['intersection'](_0x55e475[_0xe02c('0x2c')],qs[_0xe02c('0x32')](_0x43dc78[_0xe02c('0x2e')][_0xe02c('0x32')]));_0x55ef2a[_0xe02c('0x31')]=_0x55ef2a[_0xe02c('0x31')]['length']?_0x55ef2a[_0xe02c('0x31')]:_0x55e475[_0xe02c('0x2c')];if(!_0x43dc78['query'][_0xe02c('0x33')](_0xe02c('0x34'))){_0x55ef2a[_0xe02c('0x1f')]=qs[_0xe02c('0x1f')](_0x43dc78[_0xe02c('0x2e')]['limit']);_0x55ef2a['offset']=qs[_0xe02c('0x1e')](_0x43dc78[_0xe02c('0x2e')]['offset']);}_0x55ef2a[_0xe02c('0x35')]=qs['sort'](_0x43dc78[_0xe02c('0x2e')][_0xe02c('0x36')]);_0x55ef2a[_0xe02c('0x37')]=qs[_0xe02c('0x2f')](_[_0xe02c('0x38')](_0x43dc78['query'],_0x55e475[_0xe02c('0x2f')]));if(_0x43dc78['query'][_0xe02c('0x39')]){_0x55ef2a[_0xe02c('0x37')]=_[_0xe02c('0x3a')](_0x55ef2a[_0xe02c('0x37')],{'$or':_[_0xe02c('0x3b')](_0x148e2b,function(_0x232d36){if(_0x232d36['type'][_0xe02c('0x3c')]!==_0xe02c('0x3d')){var _0x534c09={};_0x534c09[_0x232d36[_0xe02c('0x3e')]]={'$like':'%'+_0x43dc78[_0xe02c('0x2e')]['filter']+'%'};return _0x534c09;}})});}_0x55ef2a=_[_0xe02c('0x3a')]({},_0x55ef2a,_0x43dc78['options']);var _0x2bf07b={'where':_0x55ef2a[_0xe02c('0x37')]};return db['JscriptyQuestionReport'][_0xe02c('0x1d')](_0x2bf07b)[_0xe02c('0x24')](function(_0x2502c8){_0x3790eb[_0xe02c('0x1d')]=_0x2502c8;if(_0x43dc78[_0xe02c('0x2e')][_0xe02c('0x3f')]){_0x55ef2a['include']=[{'all':!![]}];}return db[_0xe02c('0x40')]['findAll'](_0x55ef2a);})['then'](function(_0x3db057){_0x3790eb[_0xe02c('0x41')]=_0x3db057;return _0x3790eb;})[_0xe02c('0x24')](respondWithFilteredResult(_0x1c14d6,_0x55ef2a))[_0xe02c('0x42')](handleError(_0x1c14d6,null));};exports['show']=function(_0x37e4fe,_0x17830e){var _0x163573={'raw':!![],'where':{'id':_0x37e4fe['params']['id']}},_0x5baef6={};_0x5baef6[_0xe02c('0x2c')]=_[_0xe02c('0x2d')](db[_0xe02c('0x40')][_0xe02c('0x2b')]);_0x5baef6[_0xe02c('0x2e')]=_[_0xe02c('0x2d')](_0x37e4fe[_0xe02c('0x2e')]);_0x5baef6[_0xe02c('0x2f')]=_[_0xe02c('0x30')](_0x5baef6['model'],_0x5baef6[_0xe02c('0x2e')]);_0x163573['attributes']=_['intersection'](_0x5baef6[_0xe02c('0x2c')],qs[_0xe02c('0x32')](_0x37e4fe[_0xe02c('0x2e')][_0xe02c('0x32')]));_0x163573[_0xe02c('0x31')]=_0x163573[_0xe02c('0x31')][_0xe02c('0x43')]?_0x163573[_0xe02c('0x31')]:_0x5baef6['model'];if(_0x37e4fe['query'][_0xe02c('0x3f')]){_0x163573[_0xe02c('0x44')]=[{'all':!![]}];}_0x163573=_[_0xe02c('0x3a')]({},_0x163573,_0x37e4fe['options']);return db[_0xe02c('0x40')][_0xe02c('0x45')](_0x163573)[_0xe02c('0x24')](handleEntityNotFound(_0x17830e,null))[_0xe02c('0x24')](respondWithResult(_0x17830e,null))[_0xe02c('0x42')](handleError(_0x17830e,null));};exports[_0xe02c('0x46')]=function(_0x1fd713,_0x4363e0){return db[_0xe02c('0x40')][_0xe02c('0x46')](_0x1fd713['body'],{})[_0xe02c('0x24')](respondWithResult(_0x4363e0,0xc9))[_0xe02c('0x42')](handleError(_0x4363e0,null));};exports[_0xe02c('0x23')]=function(_0x1a39ea,_0x1e05cb){if(_0x1a39ea[_0xe02c('0x47')]['id']){delete _0x1a39ea[_0xe02c('0x47')]['id'];}return db[_0xe02c('0x40')][_0xe02c('0x45')]({'where':{'id':_0x1a39ea[_0xe02c('0x48')]['id']}})[_0xe02c('0x24')](handleEntityNotFound(_0x1e05cb,null))[_0xe02c('0x24')](saveUpdates(_0x1a39ea[_0xe02c('0x47')],null))['then'](respondWithResult(_0x1e05cb,null))[_0xe02c('0x42')](handleError(_0x1e05cb,null));};exports['destroy']=function(_0x15b05c,_0x324911){return db[_0xe02c('0x40')][_0xe02c('0x45')]({'where':{'id':_0x15b05c[_0xe02c('0x48')]['id']}})[_0xe02c('0x24')](handleEntityNotFound(_0x324911,null))[_0xe02c('0x24')](removeEntity(_0x324911,null))[_0xe02c('0x42')](handleError(_0x324911,null));};exports[_0xe02c('0x49')]=function(_0x385497,_0x4f2a6e){return db[_0xe02c('0x40')][_0xe02c('0x49')]()[_0xe02c('0x24')](respondWithResult(_0x4f2a6e,null))['catch'](handleError(_0x4f2a6e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index d0f74ac..0d519ca 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 _0xf3e5=['api','moment','bluebird','request-promise','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger'];(function(_0x33e161,_0x1a89c6){var _0x48181d=function(_0x103112){while(--_0x103112){_0x33e161['push'](_0x33e161['shift']());}};_0x48181d(++_0x1a89c6);}(_0xf3e5,0xc3));var _0x5f3e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xf3e5[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x5f3e('0x0'));var util=require(_0x5f3e('0x1'));var logger=require(_0x5f3e('0x2'))(_0x5f3e('0x3'));var moment=require(_0x5f3e('0x4'));var BPromise=require(_0x5f3e('0x5'));var rp=require(_0x5f3e('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x5f3e('0x7')]=function(_0x35c558,_0x20b1f2){return _0x35c558[_0x5f3e('0x8')](_0x5f3e('0x9'),attributes,{'tableName':_0x5f3e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e4a=['lodash','util','bluebird','request-promise','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0e4a,0xd8));var _0xa0e4=function(_0x1c5103,_0x77531c){_0x1c5103=_0x1c5103-0x0;var _0x128a4a=_0x0e4a[_0x1c5103];return _0x128a4a;};'use strict';var _=require(_0xa0e4('0x0'));var util=require(_0xa0e4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa0e4('0x2'));var rp=require(_0xa0e4('0x3'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xa0e4('0x4')]=function(_0x4383e7,_0x13085d){return _0x4383e7[_0xa0e4('0x5')](_0xa0e4('0x6'),attributes,{'tableName':_0xa0e4('0x7'),'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 54a7703..18acd52 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 _0x5385=['http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1092ef,_0x48b4dc){var _0xc3cca3=function(_0x5b7fbb){while(--_0x5b7fbb){_0x1092ef['push'](_0x1092ef['shift']());}};_0xc3cca3(++_0x48b4dc);}(_0x5385,0x15a));var _0x5538=function(_0x1d05f0,_0x240119){_0x1d05f0=_0x1d05f0-0x0;var _0x2e2bc9=_0x5385[_0x1d05f0];return _0x2e2bc9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5538('0x0'));var BPromise=require(_0x5538('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5538('0x2'));var db=require(_0x5538('0x3'))['db'];var utils=require(_0x5538('0x4'));var logger=require(_0x5538('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5538('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3726e1,_0x1fce65,_0x5d915c){return new BPromise(function(_0x5d7d63,_0x42d7cb){return client[_0x5538('0x7')](_0x3726e1,_0x5d915c)['then'](function(_0x779abd){logger[_0x5538('0x8')](_0x5538('0x9'),_0x1fce65,_0x5538('0xa'));logger[_0x5538('0xb')](_0x5538('0xc'),_0x1fce65,'request\x20sent',JSON['stringify'](_0x779abd));if(_0x779abd[_0x5538('0xd')]){if(_0x779abd['error'][_0x5538('0xe')]===0x1f4){logger[_0x5538('0xd')](_0x5538('0x9'),_0x1fce65,_0x779abd[_0x5538('0xd')]['message']);return _0x42d7cb(_0x779abd['error'][_0x5538('0xf')]);}logger[_0x5538('0xd')](_0x5538('0x9'),_0x1fce65,_0x779abd[_0x5538('0xd')][_0x5538('0xf')]);return _0x5d7d63(_0x779abd[_0x5538('0xd')][_0x5538('0xf')]);}else{logger['info'](_0x5538('0x9'),_0x1fce65,'request\x20sent');_0x5d7d63(_0x779abd['result'][_0x5538('0xf')]);}})['catch'](function(_0x6ffdf3){logger[_0x5538('0xd')](_0x5538('0x9'),_0x1fce65,_0x6ffdf3);_0x42d7cb(_0x6ffdf3);});});} \ No newline at end of file +var _0x370f=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util'];(function(_0x181613,_0x43258d){var _0x314e4e=function(_0x35d78e){while(--_0x35d78e){_0x181613['push'](_0x181613['shift']());}};_0x314e4e(++_0x43258d);}(_0x370f,0x140));var _0xf370=function(_0x17c8cc,_0x5e5647){_0x17c8cc=_0x17c8cc-0x0;var _0x3db4eb=_0x370f[_0x17c8cc];return _0x3db4eb;};'use strict';var _=require(_0xf370('0x0'));var util=require(_0xf370('0x1'));var moment=require(_0xf370('0x2'));var BPromise=require(_0xf370('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf370('0x4'));var db=require(_0xf370('0x5'))['db'];var utils=require(_0xf370('0x6'));var logger=require(_0xf370('0x7'))(_0xf370('0x8'));var config=require(_0xf370('0x9'));var jayson=require(_0xf370('0xa'));var client=jayson[_0xf370('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ecd61,_0xee8e6b,_0x36c13a){return new BPromise(function(_0x1b7bcd,_0x65c377){return client[_0xf370('0xc')](_0x2ecd61,_0x36c13a)[_0xf370('0xd')](function(_0x4c859a){logger[_0xf370('0xe')](_0xf370('0xf'),_0xee8e6b,_0xf370('0x10'));logger['debug'](_0xf370('0x11'),_0xee8e6b,_0xf370('0x10'),JSON['stringify'](_0x4c859a));if(_0x4c859a['error']){if(_0x4c859a['error'][_0xf370('0x12')]===0x1f4){logger[_0xf370('0x13')](_0xf370('0xf'),_0xee8e6b,_0x4c859a[_0xf370('0x13')][_0xf370('0x14')]);return _0x65c377(_0x4c859a[_0xf370('0x13')][_0xf370('0x14')]);}logger[_0xf370('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xee8e6b,_0x4c859a[_0xf370('0x13')][_0xf370('0x14')]);return _0x1b7bcd(_0x4c859a[_0xf370('0x13')]['message']);}else{logger[_0xf370('0xe')](_0xf370('0xf'),_0xee8e6b,_0xf370('0x10'));_0x1b7bcd(_0x4c859a[_0xf370('0x15')][_0xf370('0x14')]);}})[_0xf370('0x16')](function(_0x35a73d){logger[_0xf370('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xee8e6b,_0x35a73d);_0x65c377(_0x35a73d);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 91caa06..512aedc 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 _0xae9b=['Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','multer','util','path'];(function(_0x1f93eb,_0x57a065){var _0x119d1e=function(_0x499c1c){while(--_0x499c1c){_0x1f93eb['push'](_0x1f93eb['shift']());}};_0x119d1e(++_0x57a065);}(_0xae9b,0x81));var _0xbae9=function(_0xb2cb0b,_0x564603){_0xb2cb0b=_0xb2cb0b-0x0;var _0x3d4fe8=_0xae9b[_0xb2cb0b];return _0x3d4fe8;};'use strict';var multer=require(_0xbae9('0x0'));var util=require(_0xbae9('0x1'));var path=require(_0xbae9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbae9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbae9('0x4'));var config=require(_0xbae9('0x5'));var controller=require(_0xbae9('0x6'));router['get']('/',auth[_0xbae9('0x7')](),controller[_0xbae9('0x8')]);router[_0xbae9('0x9')](_0xbae9('0xa'),auth[_0xbae9('0x7')](),controller[_0xbae9('0xb')]);router[_0xbae9('0x9')](_0xbae9('0xc'),auth['isAuthenticated'](),controller[_0xbae9('0xd')]);router['get'](_0xbae9('0xe'),auth[_0xbae9('0x7')](),controller[_0xbae9('0xf')]);router[_0xbae9('0x10')]('/',auth[_0xbae9('0x7')](),controller[_0xbae9('0x11')]);router[_0xbae9('0x12')](_0xbae9('0xc'),auth[_0xbae9('0x7')](),controller[_0xbae9('0x13')]);router[_0xbae9('0x14')](_0xbae9('0xc'),auth[_0xbae9('0x7')](),controller[_0xbae9('0x15')]);module['exports']=router; \ No newline at end of file +var _0x2d04=['express','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','show','/:id/questions','getQuestions','post','create','/:id','update','destroy','exports','multer','util','path'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x2d04,0x129));var _0x42d0=function(_0x51c440,_0x3b6802){_0x51c440=_0x51c440-0x0;var _0x67a2d6=_0x2d04[_0x51c440];return _0x67a2d6;};'use strict';var multer=require(_0x42d0('0x0'));var util=require(_0x42d0('0x1'));var path=require(_0x42d0('0x2'));var timeout=require('connect-timeout');var express=require(_0x42d0('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x42d0('0x4'));var config=require(_0x42d0('0x5'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x42d0('0x6')](),controller[_0x42d0('0x7')]);router['get'](_0x42d0('0x8'),auth[_0x42d0('0x6')](),controller[_0x42d0('0x9')]);router[_0x42d0('0xa')]('/:id',auth[_0x42d0('0x6')](),controller[_0x42d0('0xb')]);router[_0x42d0('0xa')](_0x42d0('0xc'),auth[_0x42d0('0x6')](),controller[_0x42d0('0xd')]);router[_0x42d0('0xe')]('/',auth[_0x42d0('0x6')](),controller[_0x42d0('0xf')]);router['put'](_0x42d0('0x10'),auth[_0x42d0('0x6')](),controller[_0x42d0('0x11')]);router['delete']('/:id',auth[_0x42d0('0x6')](),controller[_0x42d0('0x12')]);module[_0x42d0('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 887cc16..7d23c08 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 _0x17d1=['BOOLEAN','moment','sequelize','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x2ff739,_0x1c8e0f){var _0x12dc13=function(_0x26fc97){while(--_0x26fc97){_0x2ff739['push'](_0x2ff739['shift']());}};_0x12dc13(++_0x1c8e0f);}(_0x17d1,0xc9));var _0x117d=function(_0x15a65c,_0x2c7c50){_0x15a65c=_0x15a65c-0x0;var _0x296e92=_0x17d1[_0x15a65c];return _0x296e92;};'use strict';var moment=require(_0x117d('0x0'));var Sequelize=require(_0x117d('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x831feb){this[_0x117d('0x2')]('starttime',_0x831feb);this['setDataValue'](_0x117d('0x3'),moment()[_0x117d('0x4')](_0x117d('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x117d('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x117d('0x6')]},'calleridname':{'type':Sequelize[_0x117d('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x117d('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x902b=['STRING','moment','exports','DATE','setDataValue','starttime','format'];(function(_0x4c77ef,_0x14285d){var _0x16c527=function(_0x5bdb24){while(--_0x5bdb24){_0x4c77ef['push'](_0x4c77ef['shift']());}};_0x16c527(++_0x14285d);}(_0x902b,0x6a));var _0xb902=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x902b[_0x45d3f0];return _0x314b79;};'use strict';var moment=require(_0xb902('0x0'));var Sequelize=require('sequelize');module[_0xb902('0x1')]={'starttime':{'type':Sequelize[_0xb902('0x2')],'set':function(_0x26d7c7){this[_0xb902('0x3')](_0xb902('0x4'),_0x26d7c7);this[_0xb902('0x3')]('endtime',moment()[_0xb902('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xb902('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xb902('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 883e7a4..aacec08 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 _0x3493=['../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','limit','where','filter','merge','type','key','VIRTUAL','JscriptySessionReport','includeAll','include','rows','catch','show','params','options','find','create','body','describe','sort','SessionId','JscriptyQuestionReport','findAll','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','ioredis','api','../../config/utils'];(function(_0x7eb996,_0x40bcdc){var _0x14b53a=function(_0xdc131a){while(--_0xdc131a){_0x7eb996['push'](_0x7eb996['shift']());}};_0x14b53a(++_0x40bcdc);}(_0x3493,0xc5));var _0x3349=function(_0x95381d,_0x11c0bd){_0x95381d=_0x95381d-0x0;var _0x44682b=_0x3493[_0x95381d];return _0x44682b;};'use strict';var pdf=require(_0x3349('0x0'));var emlformat=require(_0x3349('0x1'));var rimraf=require(_0x3349('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3349('0x3'));var rp=require(_0x3349('0x4'));var moment=require(_0x3349('0x5'));var BPromise=require(_0x3349('0x6'));var Mustache=require('mustache');var util=require(_0x3349('0x7'));var path=require(_0x3349('0x8'));var sox=require('sox');var csv=require(_0x3349('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3349('0xa'));var squel=require(_0x3349('0xb'));var crypto=require(_0x3349('0xc'));var jsforce=require(_0x3349('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3349('0x9'));var querystring=require('querystring');var Papa=require(_0x3349('0xe'));var authService=require(_0x3349('0xf'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x3349('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3349('0x11'));var utils=require(_0x3349('0x12'));var config=require(_0x3349('0x13'));var db=require(_0x3349('0x14'))['db'];function respondWithStatusCode(_0x2e173a,_0x11fd12){_0x11fd12=_0x11fd12||0xcc;return function(_0xa3bd36){if(_0xa3bd36){return _0x2e173a[_0x3349('0x15')](_0x11fd12);}return _0x2e173a[_0x3349('0x16')](_0x11fd12)[_0x3349('0x17')]();};}function respondWithResult(_0x39bc3a,_0x49e584){_0x49e584=_0x49e584||0xc8;return function(_0x2dae35){if(_0x2dae35){return _0x39bc3a[_0x3349('0x16')](_0x49e584)['json'](_0x2dae35);}};}function respondWithFilteredResult(_0x4fc4fe,_0x9c77e0){return function(_0x2f1814){if(_0x2f1814){var _0x25f151=_0x2f1814[_0x3349('0x18')],_0x3d51e9=_0x9c77e0[_0x3349('0x19')],_0xd6e369=_0x9c77e0[_0x3349('0x19')]+_0x9c77e0['limit'],_0x286359;if(_0xd6e369>=_0x25f151){_0xd6e369=_0x25f151;_0x286359=0xc8;}else{_0x286359=0xce;}_0x4fc4fe[_0x3349('0x16')](_0x286359);return _0x4fc4fe['set'](_0x3349('0x1a'),_0x3d51e9+'-'+_0xd6e369+'/'+_0x25f151)[_0x3349('0x1b')](_0x2f1814);}return null;};}function patchUpdates(_0x39aa2c){return function(_0x4e7eab){try{jsonpatch[_0x3349('0x1c')](_0x4e7eab,_0x39aa2c,!![]);}catch(_0x3ae030){return BPromise[_0x3349('0x1d')](_0x3ae030);}return _0x4e7eab['save']();};}function saveUpdates(_0xa2717e,_0x1a9000){return function(_0x41225a){if(_0x41225a){return _0x41225a[_0x3349('0x1e')](_0xa2717e)[_0x3349('0x1f')](function(_0x3bb8a8){return _0x3bb8a8;});}return null;};}function removeEntity(_0x515554,_0x2a5ffb){return function(_0x5338d1){if(_0x5338d1){return _0x5338d1[_0x3349('0x20')]()[_0x3349('0x1f')](function(){_0x515554['status'](0xcc)[_0x3349('0x17')]();});}};}function handleEntityNotFound(_0x2e4658,_0x17f654){return function(_0x6d6c95){if(!_0x6d6c95){_0x2e4658[_0x3349('0x15')](0x194);}return _0x6d6c95;};}function handleError(_0x3ea81b,_0x487f92){_0x487f92=_0x487f92||0x1f4;return function(_0x182ec7){logger[_0x3349('0x21')](_0x182ec7[_0x3349('0x22')]);if(_0x182ec7[_0x3349('0x23')]){delete _0x182ec7[_0x3349('0x23')];}_0x3ea81b[_0x3349('0x16')](_0x487f92)[_0x3349('0x24')](_0x182ec7);};}exports[_0x3349('0x25')]=function(_0x22b0a9,_0x39715a){var _0x36acdc={},_0x232831={},_0x2bc905={'count':0x0,'rows':[]};var _0xb825f3=db['JscriptySessionReport'][_0x3349('0x26')];_0x232831['model']=_['keys'](_0xb825f3);_0x232831[_0x3349('0x27')]=_[_0x3349('0x28')](_0x22b0a9[_0x3349('0x27')]);_0x232831[_0x3349('0x29')]=_[_0x3349('0x2a')](_0x232831['model'],_0x232831[_0x3349('0x27')]);_0x36acdc['attributes']=_[_0x3349('0x2a')](_0x232831['model'],qs[_0x3349('0x2b')](_0x22b0a9[_0x3349('0x27')][_0x3349('0x2b')]));_0x36acdc['attributes']=_0x36acdc[_0x3349('0x2c')][_0x3349('0x2d')]?_0x36acdc[_0x3349('0x2c')]:_0x232831[_0x3349('0x2e')];if(!_0x22b0a9[_0x3349('0x27')][_0x3349('0x2f')](_0x3349('0x30'))){_0x36acdc['limit']=qs[_0x3349('0x31')](_0x22b0a9[_0x3349('0x27')][_0x3349('0x31')]);_0x36acdc[_0x3349('0x19')]=qs['offset'](_0x22b0a9[_0x3349('0x27')][_0x3349('0x19')]);}_0x36acdc['order']=qs['sort'](_0x22b0a9[_0x3349('0x27')]['sort']);_0x36acdc[_0x3349('0x32')]=qs['filters'](_['pick'](_0x22b0a9[_0x3349('0x27')],_0x232831[_0x3349('0x29')]));if(_0x22b0a9['query'][_0x3349('0x33')]){_0x36acdc[_0x3349('0x32')]=_[_0x3349('0x34')](_0x36acdc[_0x3349('0x32')],{'$or':_['map'](_0xb825f3,function(_0x4c551a){if(_0x4c551a[_0x3349('0x35')][_0x3349('0x36')]!==_0x3349('0x37')){var _0x5238f2={};_0x5238f2[_0x4c551a['field']]={'$like':'%'+_0x22b0a9[_0x3349('0x27')][_0x3349('0x33')]+'%'};return _0x5238f2;}})});}_0x36acdc=_[_0x3349('0x34')]({},_0x36acdc,_0x22b0a9['options']);var _0x2eec85={'where':_0x36acdc[_0x3349('0x32')]};return db[_0x3349('0x38')][_0x3349('0x18')](_0x2eec85)[_0x3349('0x1f')](function(_0x3dc32e){_0x2bc905[_0x3349('0x18')]=_0x3dc32e;if(_0x22b0a9[_0x3349('0x27')][_0x3349('0x39')]){_0x36acdc[_0x3349('0x3a')]=[{'all':!![]}];}return db[_0x3349('0x38')]['findAll'](_0x36acdc);})[_0x3349('0x1f')](function(_0x151217){_0x2bc905[_0x3349('0x3b')]=_0x151217;return _0x2bc905;})[_0x3349('0x1f')](respondWithFilteredResult(_0x39715a,_0x36acdc))[_0x3349('0x3c')](handleError(_0x39715a,null));};exports[_0x3349('0x3d')]=function(_0x4675e2,_0xb0e878){var _0x10ec56={'raw':!![],'where':{'id':_0x4675e2[_0x3349('0x3e')]['id']}},_0x176782={};_0x176782[_0x3349('0x2e')]=_['keys'](db[_0x3349('0x38')][_0x3349('0x26')]);_0x176782[_0x3349('0x27')]=_[_0x3349('0x28')](_0x4675e2[_0x3349('0x27')]);_0x176782[_0x3349('0x29')]=_[_0x3349('0x2a')](_0x176782[_0x3349('0x2e')],_0x176782[_0x3349('0x27')]);_0x10ec56[_0x3349('0x2c')]=_['intersection'](_0x176782[_0x3349('0x2e')],qs[_0x3349('0x2b')](_0x4675e2[_0x3349('0x27')][_0x3349('0x2b')]));_0x10ec56[_0x3349('0x2c')]=_0x10ec56[_0x3349('0x2c')][_0x3349('0x2d')]?_0x10ec56[_0x3349('0x2c')]:_0x176782[_0x3349('0x2e')];if(_0x4675e2[_0x3349('0x27')][_0x3349('0x39')]){_0x10ec56[_0x3349('0x3a')]=[{'all':!![]}];}_0x10ec56=_[_0x3349('0x34')]({},_0x10ec56,_0x4675e2[_0x3349('0x3f')]);return db['JscriptySessionReport'][_0x3349('0x40')](_0x10ec56)[_0x3349('0x1f')](handleEntityNotFound(_0xb0e878,null))[_0x3349('0x1f')](respondWithResult(_0xb0e878,null))['catch'](handleError(_0xb0e878,null));};exports[_0x3349('0x41')]=function(_0x132260,_0x41d006){return db[_0x3349('0x38')][_0x3349('0x41')](_0x132260[_0x3349('0x42')],{})[_0x3349('0x1f')](respondWithResult(_0x41d006,0xc9))[_0x3349('0x3c')](handleError(_0x41d006,null));};exports[_0x3349('0x1e')]=function(_0x2793a5,_0x391ce6){if(_0x2793a5[_0x3349('0x42')]['id']){delete _0x2793a5[_0x3349('0x42')]['id'];}return db[_0x3349('0x38')]['find']({'where':{'id':_0x2793a5['params']['id']}})[_0x3349('0x1f')](handleEntityNotFound(_0x391ce6,null))['then'](saveUpdates(_0x2793a5[_0x3349('0x42')],null))['then'](respondWithResult(_0x391ce6,null))['catch'](handleError(_0x391ce6,null));};exports[_0x3349('0x20')]=function(_0xdd1521,_0x495328){return db[_0x3349('0x38')][_0x3349('0x40')]({'where':{'id':_0xdd1521[_0x3349('0x3e')]['id']}})['then'](handleEntityNotFound(_0x495328,null))[_0x3349('0x1f')](removeEntity(_0x495328,null))['catch'](handleError(_0x495328,null));};exports[_0x3349('0x43')]=function(_0x356411,_0x1c52dc){return db[_0x3349('0x38')][_0x3349('0x43')]()['then'](respondWithResult(_0x1c52dc,null))[_0x3349('0x3c')](handleError(_0x1c52dc,null));};exports['getQuestions']=function(_0x250931,_0x225520,_0x5352bf){var _0x24a7e2={'raw':!![],'where':{}};var _0x32a8fc={};var _0x2f1413={'count':0x0,'rows':[]};return db[_0x3349('0x38')]['findOne']({'where':{'id':_0x250931[_0x3349('0x3e')]['id']}})[_0x3349('0x1f')](handleEntityNotFound(_0x225520,null))['then'](function(_0x12ab20){if(_0x12ab20){_0x32a8fc['model']=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x32a8fc[_0x3349('0x27')]=_[_0x3349('0x28')](_0x250931[_0x3349('0x27')]);_0x32a8fc[_0x3349('0x29')]=_[_0x3349('0x2a')](_0x32a8fc[_0x3349('0x2e')],_0x32a8fc[_0x3349('0x27')]);_0x24a7e2[_0x3349('0x2c')]=_['intersection'](_0x32a8fc['model'],qs[_0x3349('0x2b')](_0x250931[_0x3349('0x27')]['fields']));_0x24a7e2[_0x3349('0x2c')]=_0x24a7e2[_0x3349('0x2c')][_0x3349('0x2d')]?_0x24a7e2[_0x3349('0x2c')]:_0x32a8fc[_0x3349('0x2e')];if(!_0x250931[_0x3349('0x27')][_0x3349('0x2f')](_0x3349('0x30'))){_0x24a7e2[_0x3349('0x31')]=qs[_0x3349('0x31')](_0x250931[_0x3349('0x27')][_0x3349('0x31')]);_0x24a7e2['offset']=qs[_0x3349('0x19')](_0x250931[_0x3349('0x27')][_0x3349('0x19')]);}_0x24a7e2['order']=qs[_0x3349('0x44')](_0x250931[_0x3349('0x27')][_0x3349('0x44')]);_0x24a7e2[_0x3349('0x32')]=qs[_0x3349('0x29')](_['pick'](_0x250931[_0x3349('0x27')],_0x32a8fc[_0x3349('0x29')]));_0x24a7e2['where'][_0x3349('0x45')]=_0x12ab20['id'];if(_0x250931[_0x3349('0x27')][_0x3349('0x33')]){_0x24a7e2[_0x3349('0x32')]=_[_0x3349('0x34')](_0x24a7e2[_0x3349('0x32')],{'$or':_['map'](_0x24a7e2['attributes'],function(_0x462b94){var _0x4e6f68={};_0x4e6f68[_0x462b94]={'$like':'%'+_0x250931['query']['filter']+'%'};return _0x4e6f68;})});}_0x24a7e2=_['merge']({},_0x24a7e2,_0x250931[_0x3349('0x3f')]);return db[_0x3349('0x46')][_0x3349('0x18')]({'where':_0x24a7e2[_0x3349('0x32')]})[_0x3349('0x1f')](function(_0x1f2331){_0x2f1413[_0x3349('0x18')]=_0x1f2331;if(_0x250931['query']['includeAll']){_0x24a7e2['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x3349('0x47')](_0x24a7e2);})[_0x3349('0x1f')](function(_0x1fe7a3){_0x2f1413[_0x3349('0x3b')]=_0x1fe7a3;return _0x2f1413;});}})[_0x3349('0x1f')](respondWithFilteredResult(_0x225520,_0x24a7e2))[_0x3349('0x3c')](handleError(_0x225520,null));}; \ No newline at end of file +var _0x9cd7=['jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','error','name','send','index','JscriptySessionReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','merge','map','type','key','field','options','include','findAll','show','includeAll','find','catch','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','length','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9cd7,0x1b9));var _0x79cd=function(_0x117a06,_0x3860e4){_0x117a06=_0x117a06-0x0;var _0x53bfc2=_0x9cd7[_0x117a06];return _0x53bfc2;};'use strict';var pdf=require(_0x79cd('0x0'));var emlformat=require(_0x79cd('0x1'));var rimraf=require(_0x79cd('0x2'));var zipdir=require(_0x79cd('0x3'));var jsonpatch=require(_0x79cd('0x4'));var rp=require(_0x79cd('0x5'));var moment=require('moment');var BPromise=require(_0x79cd('0x6'));var Mustache=require(_0x79cd('0x7'));var util=require(_0x79cd('0x8'));var path=require(_0x79cd('0x9'));var sox=require('sox');var csv=require(_0x79cd('0xa'));var ejs=require(_0x79cd('0xb'));var fs=require('fs');var _=require(_0x79cd('0xc'));var squel=require(_0x79cd('0xd'));var crypto=require(_0x79cd('0xe'));var jsforce=require(_0x79cd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x79cd('0xa'));var querystring=require(_0x79cd('0x10'));var Papa=require(_0x79cd('0x11'));var authService=require(_0x79cd('0x12'));var hardwareService=require(_0x79cd('0x13'));var Redis=require('ioredis');var qs=require(_0x79cd('0x14'));var logger=require(_0x79cd('0x15'))(_0x79cd('0x16'));var utils=require(_0x79cd('0x17'));var config=require(_0x79cd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3efd34,_0xcb04fb){_0xcb04fb=_0xcb04fb||0xcc;return function(_0x361ddd){if(_0x361ddd){return _0x3efd34[_0x79cd('0x19')](_0xcb04fb);}return _0x3efd34[_0x79cd('0x1a')](_0xcb04fb)[_0x79cd('0x1b')]();};}function respondWithResult(_0x4398f3,_0x473aa3){_0x473aa3=_0x473aa3||0xc8;return function(_0x514a68){if(_0x514a68){return _0x4398f3[_0x79cd('0x1a')](_0x473aa3)[_0x79cd('0x1c')](_0x514a68);}};}function respondWithFilteredResult(_0x240918,_0x12ff38){return function(_0x5229d2){if(_0x5229d2){var _0x4c2a79=_0x5229d2[_0x79cd('0x1d')],_0x4e9c37=_0x12ff38[_0x79cd('0x1e')],_0x3619b0=_0x12ff38[_0x79cd('0x1e')]+_0x12ff38[_0x79cd('0x1f')],_0x5898f1;if(_0x3619b0>=_0x4c2a79){_0x3619b0=_0x4c2a79;_0x5898f1=0xc8;}else{_0x5898f1=0xce;}_0x240918[_0x79cd('0x1a')](_0x5898f1);return _0x240918[_0x79cd('0x20')]('Content-Range',_0x4e9c37+'-'+_0x3619b0+'/'+_0x4c2a79)[_0x79cd('0x1c')](_0x5229d2);}return null;};}function patchUpdates(_0x53c544){return function(_0x28132d){try{jsonpatch[_0x79cd('0x21')](_0x28132d,_0x53c544,!![]);}catch(_0x5217af){return BPromise['reject'](_0x5217af);}return _0x28132d[_0x79cd('0x22')]();};}function saveUpdates(_0x565f24,_0x48bcde){return function(_0x169234){if(_0x169234){return _0x169234[_0x79cd('0x23')](_0x565f24)[_0x79cd('0x24')](function(_0x41152a){return _0x41152a;});}return null;};}function removeEntity(_0x1f2e67,_0x259ba2){return function(_0x581abb){if(_0x581abb){return _0x581abb[_0x79cd('0x25')]()[_0x79cd('0x24')](function(){_0x1f2e67['status'](0xcc)[_0x79cd('0x1b')]();});}};}function handleEntityNotFound(_0x3f9470,_0x384ef1){return function(_0x37b12a){if(!_0x37b12a){_0x3f9470['sendStatus'](0x194);}return _0x37b12a;};}function handleError(_0x1aa44a,_0x2d2f74){_0x2d2f74=_0x2d2f74||0x1f4;return function(_0x4633c0){logger[_0x79cd('0x26')](_0x4633c0['stack']);if(_0x4633c0[_0x79cd('0x27')]){delete _0x4633c0['name'];}_0x1aa44a[_0x79cd('0x1a')](_0x2d2f74)[_0x79cd('0x28')](_0x4633c0);};}exports[_0x79cd('0x29')]=function(_0x547826,_0x2d8bb1){var _0x4fa0b9={},_0x4f3623={},_0x49911f={'count':0x0,'rows':[]};var _0x17f772=db[_0x79cd('0x2a')][_0x79cd('0x2b')];_0x4f3623[_0x79cd('0x2c')]=_[_0x79cd('0x2d')](_0x17f772);_0x4f3623['query']=_[_0x79cd('0x2d')](_0x547826[_0x79cd('0x2e')]);_0x4f3623[_0x79cd('0x2f')]=_['intersection'](_0x4f3623[_0x79cd('0x2c')],_0x4f3623[_0x79cd('0x2e')]);_0x4fa0b9[_0x79cd('0x30')]=_[_0x79cd('0x31')](_0x4f3623[_0x79cd('0x2c')],qs['fields'](_0x547826['query'][_0x79cd('0x32')]));_0x4fa0b9[_0x79cd('0x30')]=_0x4fa0b9[_0x79cd('0x30')]['length']?_0x4fa0b9[_0x79cd('0x30')]:_0x4f3623['model'];if(!_0x547826[_0x79cd('0x2e')]['hasOwnProperty'](_0x79cd('0x33'))){_0x4fa0b9[_0x79cd('0x1f')]=qs['limit'](_0x547826['query'][_0x79cd('0x1f')]);_0x4fa0b9[_0x79cd('0x1e')]=qs[_0x79cd('0x1e')](_0x547826[_0x79cd('0x2e')][_0x79cd('0x1e')]);}_0x4fa0b9[_0x79cd('0x34')]=qs[_0x79cd('0x35')](_0x547826[_0x79cd('0x2e')][_0x79cd('0x35')]);_0x4fa0b9[_0x79cd('0x36')]=qs[_0x79cd('0x2f')](_['pick'](_0x547826['query'],_0x4f3623[_0x79cd('0x2f')]));if(_0x547826[_0x79cd('0x2e')][_0x79cd('0x37')]){_0x4fa0b9[_0x79cd('0x36')]=_[_0x79cd('0x38')](_0x4fa0b9[_0x79cd('0x36')],{'$or':_[_0x79cd('0x39')](_0x17f772,function(_0x2856fd){if(_0x2856fd[_0x79cd('0x3a')][_0x79cd('0x3b')]!=='VIRTUAL'){var _0x18eec9={};_0x18eec9[_0x2856fd[_0x79cd('0x3c')]]={'$like':'%'+_0x547826['query']['filter']+'%'};return _0x18eec9;}})});}_0x4fa0b9=_[_0x79cd('0x38')]({},_0x4fa0b9,_0x547826[_0x79cd('0x3d')]);var _0x3c2f0b={'where':_0x4fa0b9[_0x79cd('0x36')]};return db[_0x79cd('0x2a')][_0x79cd('0x1d')](_0x3c2f0b)['then'](function(_0x4afa60){_0x49911f[_0x79cd('0x1d')]=_0x4afa60;if(_0x547826[_0x79cd('0x2e')]['includeAll']){_0x4fa0b9[_0x79cd('0x3e')]=[{'all':!![]}];}return db[_0x79cd('0x2a')][_0x79cd('0x3f')](_0x4fa0b9);})[_0x79cd('0x24')](function(_0x13242d){_0x49911f['rows']=_0x13242d;return _0x49911f;})[_0x79cd('0x24')](respondWithFilteredResult(_0x2d8bb1,_0x4fa0b9))['catch'](handleError(_0x2d8bb1,null));};exports[_0x79cd('0x40')]=function(_0x4c7773,_0x129d82){var _0x33baad={'raw':!![],'where':{'id':_0x4c7773['params']['id']}},_0x4a9cb2={};_0x4a9cb2[_0x79cd('0x2c')]=_[_0x79cd('0x2d')](db[_0x79cd('0x2a')][_0x79cd('0x2b')]);_0x4a9cb2[_0x79cd('0x2e')]=_['keys'](_0x4c7773[_0x79cd('0x2e')]);_0x4a9cb2[_0x79cd('0x2f')]=_['intersection'](_0x4a9cb2['model'],_0x4a9cb2['query']);_0x33baad['attributes']=_[_0x79cd('0x31')](_0x4a9cb2['model'],qs['fields'](_0x4c7773[_0x79cd('0x2e')][_0x79cd('0x32')]));_0x33baad[_0x79cd('0x30')]=_0x33baad[_0x79cd('0x30')]['length']?_0x33baad[_0x79cd('0x30')]:_0x4a9cb2[_0x79cd('0x2c')];if(_0x4c7773[_0x79cd('0x2e')][_0x79cd('0x41')]){_0x33baad[_0x79cd('0x3e')]=[{'all':!![]}];}_0x33baad=_['merge']({},_0x33baad,_0x4c7773[_0x79cd('0x3d')]);return db['JscriptySessionReport'][_0x79cd('0x42')](_0x33baad)[_0x79cd('0x24')](handleEntityNotFound(_0x129d82,null))[_0x79cd('0x24')](respondWithResult(_0x129d82,null))[_0x79cd('0x43')](handleError(_0x129d82,null));};exports[_0x79cd('0x44')]=function(_0x5481a0,_0x369af8){return db[_0x79cd('0x2a')][_0x79cd('0x44')](_0x5481a0[_0x79cd('0x45')],{})[_0x79cd('0x24')](respondWithResult(_0x369af8,0xc9))['catch'](handleError(_0x369af8,null));};exports[_0x79cd('0x23')]=function(_0x260e88,_0x2ec45a){if(_0x260e88[_0x79cd('0x45')]['id']){delete _0x260e88[_0x79cd('0x45')]['id'];}return db['JscriptySessionReport'][_0x79cd('0x42')]({'where':{'id':_0x260e88[_0x79cd('0x46')]['id']}})[_0x79cd('0x24')](handleEntityNotFound(_0x2ec45a,null))[_0x79cd('0x24')](saveUpdates(_0x260e88[_0x79cd('0x45')],null))[_0x79cd('0x24')](respondWithResult(_0x2ec45a,null))[_0x79cd('0x43')](handleError(_0x2ec45a,null));};exports[_0x79cd('0x25')]=function(_0x559983,_0x19e5c9){return db[_0x79cd('0x2a')]['find']({'where':{'id':_0x559983[_0x79cd('0x46')]['id']}})[_0x79cd('0x24')](handleEntityNotFound(_0x19e5c9,null))[_0x79cd('0x24')](removeEntity(_0x19e5c9,null))[_0x79cd('0x43')](handleError(_0x19e5c9,null));};exports['describe']=function(_0x24ec98,_0xdf039e){return db[_0x79cd('0x2a')][_0x79cd('0x47')]()['then'](respondWithResult(_0xdf039e,null))['catch'](handleError(_0xdf039e,null));};exports[_0x79cd('0x48')]=function(_0x3a4bd2,_0x5ca20b,_0x52132e){var _0x51bb03={'raw':!![],'where':{}};var _0xa0c360={};var _0x3589ee={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x79cd('0x49')]({'where':{'id':_0x3a4bd2[_0x79cd('0x46')]['id']}})[_0x79cd('0x24')](handleEntityNotFound(_0x5ca20b,null))[_0x79cd('0x24')](function(_0x5d9339){if(_0x5d9339){_0xa0c360[_0x79cd('0x2c')]=_[_0x79cd('0x2d')](db[_0x79cd('0x4a')][_0x79cd('0x2b')]);_0xa0c360[_0x79cd('0x2e')]=_['keys'](_0x3a4bd2[_0x79cd('0x2e')]);_0xa0c360[_0x79cd('0x2f')]=_[_0x79cd('0x31')](_0xa0c360[_0x79cd('0x2c')],_0xa0c360[_0x79cd('0x2e')]);_0x51bb03[_0x79cd('0x30')]=_[_0x79cd('0x31')](_0xa0c360['model'],qs[_0x79cd('0x32')](_0x3a4bd2[_0x79cd('0x2e')]['fields']));_0x51bb03[_0x79cd('0x30')]=_0x51bb03[_0x79cd('0x30')][_0x79cd('0x4b')]?_0x51bb03[_0x79cd('0x30')]:_0xa0c360[_0x79cd('0x2c')];if(!_0x3a4bd2['query']['hasOwnProperty'](_0x79cd('0x33'))){_0x51bb03['limit']=qs[_0x79cd('0x1f')](_0x3a4bd2[_0x79cd('0x2e')][_0x79cd('0x1f')]);_0x51bb03['offset']=qs['offset'](_0x3a4bd2[_0x79cd('0x2e')][_0x79cd('0x1e')]);}_0x51bb03[_0x79cd('0x34')]=qs[_0x79cd('0x35')](_0x3a4bd2['query']['sort']);_0x51bb03['where']=qs[_0x79cd('0x2f')](_['pick'](_0x3a4bd2[_0x79cd('0x2e')],_0xa0c360[_0x79cd('0x2f')]));_0x51bb03[_0x79cd('0x36')]['SessionId']=_0x5d9339['id'];if(_0x3a4bd2[_0x79cd('0x2e')][_0x79cd('0x37')]){_0x51bb03['where']=_[_0x79cd('0x38')](_0x51bb03[_0x79cd('0x36')],{'$or':_[_0x79cd('0x39')](_0x51bb03['attributes'],function(_0x24ccea){var _0x41fd03={};_0x41fd03[_0x24ccea]={'$like':'%'+_0x3a4bd2[_0x79cd('0x2e')][_0x79cd('0x37')]+'%'};return _0x41fd03;})});}_0x51bb03=_[_0x79cd('0x38')]({},_0x51bb03,_0x3a4bd2[_0x79cd('0x3d')]);return db[_0x79cd('0x4a')][_0x79cd('0x1d')]({'where':_0x51bb03[_0x79cd('0x36')]})[_0x79cd('0x24')](function(_0x4aa84b){_0x3589ee['count']=_0x4aa84b;if(_0x3a4bd2['query']['includeAll']){_0x51bb03[_0x79cd('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x79cd('0x3f')](_0x51bb03);})['then'](function(_0x30de52){_0x3589ee['rows']=_0x30de52;return _0x3589ee;});}})[_0x79cd('0x24')](respondWithFilteredResult(_0x5ca20b,_0x51bb03))[_0x79cd('0x43')](handleError(_0x5ca20b,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 8cdc7a0..60c5b7a 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 _0x9526=['request-promise','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api'];(function(_0x47643e,_0x337374){var _0x2aa5db=function(_0x5dcbf2){while(--_0x5dcbf2){_0x47643e['push'](_0x47643e['shift']());}};_0x2aa5db(++_0x337374);}(_0x9526,0xc2));var _0x6952=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x9526[_0x3b96cf];return _0x2e315a;};'use strict';var _=require(_0x6952('0x0'));var util=require(_0x6952('0x1'));var logger=require(_0x6952('0x2'))(_0x6952('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6952('0x4'));var attributes=require(_0x6952('0x5'));module[_0x6952('0x6')]=function(_0x3b4034,_0x3419cf){return _0x3b4034['define'](_0x6952('0x7'),attributes,{'tableName':_0x6952('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43a=['define','JscriptySessionReport','report_jscripty_sessions','util','../../config/logger','api','moment','request-promise','exports'];(function(_0x51028d,_0x4a5d44){var _0x2bbef4=function(_0x219699){while(--_0x219699){_0x51028d['push'](_0x51028d['shift']());}};_0x2bbef4(++_0x4a5d44);}(_0xb43a,0x16b));var _0xab43=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0xb43a[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require('lodash');var util=require(_0xab43('0x0'));var logger=require(_0xab43('0x1'))(_0xab43('0x2'));var moment=require(_0xab43('0x3'));var BPromise=require('bluebird');var rp=require(_0xab43('0x4'));var attributes=require('./jscriptySessionReport.attributes');module[_0xab43('0x5')]=function(_0x25d329,_0x20c88f){return _0x25d329[_0xab43('0x6')](_0xab43('0x7'),attributes,{'tableName':_0xab43('0x8'),'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 ce2c9c8..e6e8099 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 _0xc74c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0xc74c,0x163));var _0xcc74=function(_0x2f8830,_0x235e39){_0x2f8830=_0x2f8830-0x0;var _0xcc790f=_0xc74c[_0x2f8830];return _0xcc790f;};'use strict';var _=require(_0xcc74('0x0'));var util=require(_0xcc74('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc74('0x2'));var fs=require('fs');var Redis=require(_0xcc74('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc74('0x4'));var logger=require(_0xcc74('0x5'))(_0xcc74('0x6'));var config=require(_0xcc74('0x7'));var jayson=require(_0xcc74('0x8'));var client=jayson[_0xcc74('0x9')][_0xcc74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d46a6,_0x15248f,_0x86f429){return new BPromise(function(_0x1eb886,_0x473308){return client[_0xcc74('0xb')](_0x5d46a6,_0x86f429)['then'](function(_0x4b4534){logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));logger['debug'](_0xcc74('0xf'),_0x15248f,_0xcc74('0xe'),JSON[_0xcc74('0x10')](_0x4b4534));if(_0x4b4534['error']){if(_0x4b4534[_0xcc74('0x11')]['code']===0x1f4){logger[_0xcc74('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x15248f,_0x4b4534['error']['message']);return _0x473308(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0x4b4534[_0xcc74('0x11')]['message']);return _0x1eb886(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}else{logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));_0x1eb886(_0x4b4534['result'][_0xcc74('0x12')]);}})[_0xcc74('0x13')](function(_0xe44014){logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0xe44014);_0x473308(_0xe44014);});});} \ No newline at end of file +var _0xa848=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x141a47,_0x29ef8a){var _0x332325=function(_0xf1ec2){while(--_0xf1ec2){_0x141a47['push'](_0x141a47['shift']());}};_0x332325(++_0x29ef8a);}(_0xa848,0x99));var _0x8a84=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa848[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8a84('0x0'));var util=require(_0x8a84('0x1'));var moment=require(_0x8a84('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a84('0x3'));var fs=require('fs');var Redis=require(_0x8a84('0x4'));var db=require(_0x8a84('0x5'))['db'];var utils=require(_0x8a84('0x6'));var logger=require(_0x8a84('0x7'))(_0x8a84('0x8'));var config=require(_0x8a84('0x9'));var jayson=require(_0x8a84('0xa'));var client=jayson[_0x8a84('0xb')][_0x8a84('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d463b,_0x1b958b,_0x764e89){return new BPromise(function(_0xd33118,_0x5a76f4){return client[_0x8a84('0xd')](_0x1d463b,_0x764e89)[_0x8a84('0xe')](function(_0x2294c8){logger['info'](_0x8a84('0xf'),_0x1b958b,_0x8a84('0x10'));logger[_0x8a84('0x11')](_0x8a84('0x12'),_0x1b958b,_0x8a84('0x10'),JSON[_0x8a84('0x13')](_0x2294c8));if(_0x2294c8[_0x8a84('0x14')]){if(_0x2294c8[_0x8a84('0x14')][_0x8a84('0x15')]===0x1f4){logger[_0x8a84('0x14')](_0x8a84('0xf'),_0x1b958b,_0x2294c8[_0x8a84('0x14')]['message']);return _0x5a76f4(_0x2294c8[_0x8a84('0x14')][_0x8a84('0x16')]);}logger[_0x8a84('0x14')]('JscriptySessionReport,\x20%s,\x20%s',_0x1b958b,_0x2294c8[_0x8a84('0x14')][_0x8a84('0x16')]);return _0xd33118(_0x2294c8[_0x8a84('0x14')]['message']);}else{logger[_0x8a84('0x17')](_0x8a84('0xf'),_0x1b958b,'request\x20sent');_0xd33118(_0x2294c8[_0x8a84('0x18')][_0x8a84('0x16')]);}})[_0x8a84('0x19')](function(_0x209516){logger['error'](_0x8a84('0xf'),_0x1b958b,_0x209516);_0x5a76f4(_0x209516);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index d3ae643..f26bb4c 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 _0x5508=['../../components/interaction/service','../../config/environment','get','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x40f9cf,_0x1901ed){var _0x4f2f4d=function(_0x35db79){while(--_0x35db79){_0x40f9cf['push'](_0x40f9cf['shift']());}};_0x4f2f4d(++_0x1901ed);}(_0x5508,0x93));var _0x8550=function(_0x5e7e72,_0x1a39f3){_0x5e7e72=_0x5e7e72-0x0;var _0x5d65f3=_0x5508[_0x5e7e72];return _0x5d65f3;};'use strict';var multer=require(_0x8550('0x0'));var util=require(_0x8550('0x1'));var path=require(_0x8550('0x2'));var timeout=require(_0x8550('0x3'));var express=require(_0x8550('0x4'));var router=express[_0x8550('0x5')]();var auth=require(_0x8550('0x6'));var interaction=require(_0x8550('0x7'));var config=require(_0x8550('0x8'));var controller=require('./license.controller');router[_0x8550('0x9')]('/',controller['index']);router[_0x8550('0xa')](_0x8550('0xb'),auth['isAuthenticated'](),controller[_0x8550('0xc')]);module[_0x8550('0xd')]=router; \ No newline at end of file +var _0xb99d=['../../config/environment','get','put','/:id','isAuthenticated','update','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x401329,_0x2c688b){var _0x46137c=function(_0x1cde3c){while(--_0x1cde3c){_0x401329['push'](_0x401329['shift']());}};_0x46137c(++_0x2c688b);}(_0xb99d,0x1db));var _0xdb99=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0xb99d[_0xdbd4f7];return _0x5c3f9d;};'use strict';var multer=require(_0xdb99('0x0'));var util=require('util');var path=require(_0xdb99('0x1'));var timeout=require('connect-timeout');var express=require(_0xdb99('0x2'));var router=express[_0xdb99('0x3')]();var auth=require(_0xdb99('0x4'));var interaction=require(_0xdb99('0x5'));var config=require(_0xdb99('0x6'));var controller=require('./license.controller');router[_0xdb99('0x7')]('/',controller['index']);router[_0xdb99('0x8')](_0xdb99('0x9'),auth[_0xdb99('0xa')](),controller[_0xdb99('0xb')]);module[_0xdb99('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 dbc21ec..8e5bbe4 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 _0x31e8=['sequelize','STRING','INTEGER'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x31e8,0x75));var _0x831e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x31e8[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x831e('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x831e('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x831e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbd1c=['STRING','INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd1c,0x1a2));var _0xcbd1=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xbd1c[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0xcbd1('0x0'));module[_0xcbd1('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xcbd1('0x2')]},'data2':{'type':Sequelize[_0xcbd1('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xcbd1('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index b5d69b4..94fca3c 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 _0x2dfb=['send','../../config/license/util','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','catch','update','body','params','checkLicense','key','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','Content-Range','reject','save','destroy','then','sendStatus','error','name'];(function(_0x5bd5fc,_0x57597){var _0x420110=function(_0x3d99d8){while(--_0x3d99d8){_0x5bd5fc['push'](_0x5bd5fc['shift']());}};_0x420110(++_0x57597);}(_0x2dfb,0x7d));var _0xb2df=function(_0x31c317,_0x1c2e8b){_0x31c317=_0x31c317-0x0;var _0x5b81fb=_0x2dfb[_0x31c317];return _0x5b81fb;};'use strict';var pdf=require(_0xb2df('0x0'));var emlformat=require(_0xb2df('0x1'));var rimraf=require(_0xb2df('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2df('0x3'));var rp=require(_0xb2df('0x4'));var moment=require(_0xb2df('0x5'));var BPromise=require(_0xb2df('0x6'));var Mustache=require(_0xb2df('0x7'));var util=require(_0xb2df('0x8'));var path=require('path');var sox=require(_0xb2df('0x9'));var csv=require(_0xb2df('0xa'));var ejs=require(_0xb2df('0xb'));var fs=require('fs');var _=require(_0xb2df('0xc'));var squel=require(_0xb2df('0xd'));var crypto=require(_0xb2df('0xe'));var jsforce=require(_0xb2df('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb2df('0xa'));var querystring=require(_0xb2df('0x10'));var Papa=require('papaparse');var authService=require(_0xb2df('0x11'));var hardwareService=require(_0xb2df('0x12'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xb2df('0x13'));var utils=require(_0xb2df('0x14'));var config=require(_0xb2df('0x15'));var db=require(_0xb2df('0x16'))['db'];function respondWithStatusCode(_0x5d427a,_0x304db9){_0x304db9=_0x304db9||0xcc;return function(_0x39fb9a){if(_0x39fb9a){return _0x5d427a['sendStatus'](_0x304db9);}return _0x5d427a['status'](_0x304db9)[_0xb2df('0x17')]();};}function respondWithResult(_0x4e1335,_0x40c502){_0x40c502=_0x40c502||0xc8;return function(_0x3b5f2f){if(_0x3b5f2f){return _0x4e1335[_0xb2df('0x18')](_0x40c502)[_0xb2df('0x19')](_0x3b5f2f);}};}function respondWithFilteredResult(_0x1977c9,_0x927cf){return function(_0x523502){if(_0x523502){var _0x1199cc=_0x523502[_0xb2df('0x1a')],_0x4514a3=_0x927cf[_0xb2df('0x1b')],_0x84b93f=_0x927cf['offset']+_0x927cf[_0xb2df('0x1c')],_0x1bf73f;if(_0x84b93f>=_0x1199cc){_0x84b93f=_0x1199cc;_0x1bf73f=0xc8;}else{_0x1bf73f=0xce;}_0x1977c9[_0xb2df('0x18')](_0x1bf73f);return _0x1977c9['set'](_0xb2df('0x1d'),_0x4514a3+'-'+_0x84b93f+'/'+_0x1199cc)[_0xb2df('0x19')](_0x523502);}return null;};}function patchUpdates(_0x1d85a7){return function(_0x31237d){try{jsonpatch['apply'](_0x31237d,_0x1d85a7,!![]);}catch(_0x1305f9){return BPromise[_0xb2df('0x1e')](_0x1305f9);}return _0x31237d[_0xb2df('0x1f')]();};}function saveUpdates(_0x47bacf,_0x26741b){return function(_0x1a99e4){if(_0x1a99e4){return _0x1a99e4['update'](_0x47bacf)['then'](function(_0x22d813){return _0x22d813;});}return null;};}function removeEntity(_0x1140ea,_0x41d497){return function(_0x5a3f5b){if(_0x5a3f5b){return _0x5a3f5b[_0xb2df('0x20')]()[_0xb2df('0x21')](function(){_0x1140ea['status'](0xcc)[_0xb2df('0x17')]();});}};}function handleEntityNotFound(_0x329a5f,_0x341271){return function(_0x4d0410){if(!_0x4d0410){_0x329a5f[_0xb2df('0x22')](0x194);}return _0x4d0410;};}function handleError(_0x1e2084,_0x422332){_0x422332=_0x422332||0x1f4;return function(_0x5da963){logger[_0xb2df('0x23')](_0x5da963['stack']);if(_0x5da963['name']){delete _0x5da963[_0xb2df('0x24')];}_0x1e2084[_0xb2df('0x18')](_0x422332)[_0xb2df('0x25')](_0x5da963);};}var utilLicense=require(_0xb2df('0x26'));exports['index']=function(_0x500623,_0x143780){var _0x491b40={'raw':!![],'where':{'id':0x1}},_0x4afff4={};_0x4afff4['model']=_['keys'](db['License'][_0xb2df('0x27')]);_0x4afff4[_0xb2df('0x28')]=_['keys'](_0x500623[_0xb2df('0x28')]);_0x4afff4[_0xb2df('0x29')]=_[_0xb2df('0x2a')](_0x4afff4['model'],_0x4afff4[_0xb2df('0x28')]);_0x491b40[_0xb2df('0x2b')]=_[_0xb2df('0x2a')](_0x4afff4['model'],qs[_0xb2df('0x2c')](_0x500623[_0xb2df('0x28')][_0xb2df('0x2c')]));_0x491b40[_0xb2df('0x2b')]=_0x491b40[_0xb2df('0x2b')][_0xb2df('0x2d')]?_0x491b40[_0xb2df('0x2b')]:_0x4afff4['model'];_0x491b40=_[_0xb2df('0x2e')]({},_0x491b40,_0x500623[_0xb2df('0x2f')]);return utilLicense['getLicense'](_0x491b40)[_0xb2df('0x21')](respondWithResult(_0x143780,null))[_0xb2df('0x30')](handleError(_0x143780,null));};exports[_0xb2df('0x31')]=function(_0x4a0b3e,_0x1a0383){if(_0x4a0b3e[_0xb2df('0x32')]['id']){delete _0x4a0b3e['body']['id'];}return db['License']['find']({'where':{'id':_0x4a0b3e[_0xb2df('0x33')]['id']}})[_0xb2df('0x21')](handleEntityNotFound(_0x1a0383,null))[_0xb2df('0x21')](function(_0x512581){var _0x41777a=_0x512581['get']({'plain':!![]});return utilLicense[_0xb2df('0x34')](_0x41777a,_0x4a0b3e['body'][_0xb2df('0x35')]);})['then'](function(_0x9f269){if(!_0x9f269['demo']){return saveUpdates(_0x4a0b3e['body'],null);}return _0x9f269;})['then'](respondWithResult(_0x1a0383,null))[_0xb2df('0x30')](handleError(_0x1a0383,null));}; \ No newline at end of file +var _0x04f8=['attributes','fields','length','merge','options','catch','body','License','checkLicense','key','demo','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','../../config/license/util','rawAttributes','keys','query','filters','intersection','model'];(function(_0x3d5769,_0x10d297){var _0x46e7c4=function(_0x512330){while(--_0x512330){_0x3d5769['push'](_0x3d5769['shift']());}};_0x46e7c4(++_0x10d297);}(_0x04f8,0x161));var _0x804f=function(_0xbd059b,_0x5db45f){_0xbd059b=_0xbd059b-0x0;var _0x42bce1=_0x04f8[_0xbd059b];return _0x42bce1;};'use strict';var pdf=require(_0x804f('0x0'));var emlformat=require(_0x804f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x804f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x804f('0x3'));var moment=require(_0x804f('0x4'));var BPromise=require(_0x804f('0x5'));var Mustache=require('mustache');var util=require(_0x804f('0x6'));var path=require('path');var sox=require(_0x804f('0x7'));var csv=require(_0x804f('0x8'));var ejs=require(_0x804f('0x9'));var fs=require('fs');var _=require(_0x804f('0xa'));var squel=require('squel');var crypto=require(_0x804f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x804f('0x8'));var querystring=require(_0x804f('0xc'));var Papa=require(_0x804f('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x804f('0xe'));var Redis=require(_0x804f('0xf'));var qs=require(_0x804f('0x10'));var logger=require(_0x804f('0x11'))(_0x804f('0x12'));var utils=require(_0x804f('0x13'));var config=require(_0x804f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d51e4,_0x47a06a){_0x47a06a=_0x47a06a||0xcc;return function(_0x10c666){if(_0x10c666){return _0x5d51e4[_0x804f('0x15')](_0x47a06a);}return _0x5d51e4[_0x804f('0x16')](_0x47a06a)[_0x804f('0x17')]();};}function respondWithResult(_0x76e166,_0x7432ef){_0x7432ef=_0x7432ef||0xc8;return function(_0x365929){if(_0x365929){return _0x76e166['status'](_0x7432ef)[_0x804f('0x18')](_0x365929);}};}function respondWithFilteredResult(_0x3153bb,_0x325a97){return function(_0x45caba){if(_0x45caba){var _0x4d1302=_0x45caba[_0x804f('0x19')],_0x50d75c=_0x325a97[_0x804f('0x1a')],_0x1883ac=_0x325a97[_0x804f('0x1a')]+_0x325a97[_0x804f('0x1b')],_0x78b7f1;if(_0x1883ac>=_0x4d1302){_0x1883ac=_0x4d1302;_0x78b7f1=0xc8;}else{_0x78b7f1=0xce;}_0x3153bb[_0x804f('0x16')](_0x78b7f1);return _0x3153bb[_0x804f('0x1c')](_0x804f('0x1d'),_0x50d75c+'-'+_0x1883ac+'/'+_0x4d1302)[_0x804f('0x18')](_0x45caba);}return null;};}function patchUpdates(_0x42243d){return function(_0x523165){try{jsonpatch[_0x804f('0x1e')](_0x523165,_0x42243d,!![]);}catch(_0x19a128){return BPromise[_0x804f('0x1f')](_0x19a128);}return _0x523165[_0x804f('0x20')]();};}function saveUpdates(_0x3485b3,_0x3013f2){return function(_0x1c7dfe){if(_0x1c7dfe){return _0x1c7dfe[_0x804f('0x21')](_0x3485b3)[_0x804f('0x22')](function(_0x258ce2){return _0x258ce2;});}return null;};}function removeEntity(_0x5754a3,_0x14237e){return function(_0x32674a){if(_0x32674a){return _0x32674a[_0x804f('0x23')]()[_0x804f('0x22')](function(){_0x5754a3[_0x804f('0x16')](0xcc)[_0x804f('0x17')]();});}};}function handleEntityNotFound(_0x189290,_0x58c239){return function(_0x137ecf){if(!_0x137ecf){_0x189290[_0x804f('0x15')](0x194);}return _0x137ecf;};}function handleError(_0x4c2238,_0x57477d){_0x57477d=_0x57477d||0x1f4;return function(_0xbed99d){logger[_0x804f('0x24')](_0xbed99d['stack']);if(_0xbed99d[_0x804f('0x25')]){delete _0xbed99d[_0x804f('0x25')];}_0x4c2238[_0x804f('0x16')](_0x57477d)[_0x804f('0x26')](_0xbed99d);};}var utilLicense=require(_0x804f('0x27'));exports['index']=function(_0x3e0b98,_0x461ac5){var _0x1f061d={'raw':!![],'where':{'id':0x1}},_0x56a0e5={};_0x56a0e5['model']=_['keys'](db['License'][_0x804f('0x28')]);_0x56a0e5['query']=_[_0x804f('0x29')](_0x3e0b98[_0x804f('0x2a')]);_0x56a0e5[_0x804f('0x2b')]=_[_0x804f('0x2c')](_0x56a0e5[_0x804f('0x2d')],_0x56a0e5[_0x804f('0x2a')]);_0x1f061d[_0x804f('0x2e')]=_[_0x804f('0x2c')](_0x56a0e5[_0x804f('0x2d')],qs[_0x804f('0x2f')](_0x3e0b98[_0x804f('0x2a')][_0x804f('0x2f')]));_0x1f061d[_0x804f('0x2e')]=_0x1f061d[_0x804f('0x2e')][_0x804f('0x30')]?_0x1f061d[_0x804f('0x2e')]:_0x56a0e5[_0x804f('0x2d')];_0x1f061d=_[_0x804f('0x31')]({},_0x1f061d,_0x3e0b98[_0x804f('0x32')]);return utilLicense['getLicense'](_0x1f061d)[_0x804f('0x22')](respondWithResult(_0x461ac5,null))[_0x804f('0x33')](handleError(_0x461ac5,null));};exports[_0x804f('0x21')]=function(_0x4bffed,_0x365255){if(_0x4bffed[_0x804f('0x34')]['id']){delete _0x4bffed[_0x804f('0x34')]['id'];}return db[_0x804f('0x35')]['find']({'where':{'id':_0x4bffed['params']['id']}})[_0x804f('0x22')](handleEntityNotFound(_0x365255,null))['then'](function(_0x17ea77){var _0x50e809=_0x17ea77['get']({'plain':!![]});return utilLicense[_0x804f('0x36')](_0x50e809,_0x4bffed[_0x804f('0x34')][_0x804f('0x37')]);})[_0x804f('0x22')](function(_0x273859){if(!_0x273859[_0x804f('0x38')]){return saveUpdates(_0x4bffed[_0x804f('0x34')],null);}return _0x273859;})[_0x804f('0x22')](respondWithResult(_0x365255,null))[_0x804f('0x33')](handleError(_0x365255,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index bf14b28..3bd4a10 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 _0x3eec=['util','../../config/logger','api','bluebird','request-promise','./license.attributes','exports','License','license','lodash'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x5c3897,_0x3848d9){_0x5c3897=_0x5c3897-0x0;var _0x5e21f2=_0x3eec[_0x5c3897];return _0x5e21f2;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var logger=require(_0xc3ee('0x2'))(_0xc3ee('0x3'));var moment=require('moment');var BPromise=require(_0xc3ee('0x4'));var rp=require(_0xc3ee('0x5'));var attributes=require(_0xc3ee('0x6'));module[_0xc3ee('0x7')]=function(_0x25074b,_0x237115){return _0x25074b['define'](_0xc3ee('0x8'),attributes,{'tableName':_0xc3ee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c6f=['../../config/logger','api','moment','bluebird','request-promise','./license.attributes','exports','License','lodash','util'];(function(_0x2ae509,_0x2a9efc){var _0x398935=function(_0x1549a0){while(--_0x1549a0){_0x2ae509['push'](_0x2ae509['shift']());}};_0x398935(++_0x2a9efc);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x2054f9,_0x3a6ccd){_0x2054f9=_0x2054f9-0x0;var _0x4f190f=_0x6c6f[_0x2054f9];return _0x4f190f;};'use strict';var _=require(_0xf6c6('0x0'));var util=require(_0xf6c6('0x1'));var logger=require(_0xf6c6('0x2'))(_0xf6c6('0x3'));var moment=require(_0xf6c6('0x4'));var BPromise=require(_0xf6c6('0x5'));var rp=require(_0xf6c6('0x6'));var attributes=require(_0xf6c6('0x7'));module[_0xf6c6('0x8')]=function(_0xa1183,_0x46f625){return _0xa1183['define'](_0xf6c6('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 2ae54df..534487d 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 _0xbcf3=['debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','request','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x3fa56f,_0x710279){var _0x4adb9e=function(_0x4652f0){while(--_0x4652f0){_0x3fa56f['push'](_0x3fa56f['shift']());}};_0x4adb9e(++_0x710279);}(_0xbcf3,0x1bf));var _0x3bcf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbcf3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3bcf('0x0'));var util=require(_0x3bcf('0x1'));var moment=require(_0x3bcf('0x2'));var BPromise=require(_0x3bcf('0x3'));var rs=require(_0x3bcf('0x4'));var fs=require('fs');var Redis=require(_0x3bcf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3bcf('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3bcf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3bcf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd081,_0x2de508,_0x562007){return new BPromise(function(_0xb2bbb6,_0x48d236){return client[_0x3bcf('0x9')](_0x3dd081,_0x562007)['then'](function(_0x2b0598){logger[_0x3bcf('0xa')](_0x3bcf('0xb'),_0x2de508,_0x3bcf('0xc'));logger[_0x3bcf('0xd')](_0x3bcf('0xe'),_0x2de508,_0x3bcf('0xc'),JSON[_0x3bcf('0xf')](_0x2b0598));if(_0x2b0598[_0x3bcf('0x10')]){if(_0x2b0598['error']['code']===0x1f4){logger[_0x3bcf('0x10')](_0x3bcf('0xb'),_0x2de508,_0x2b0598[_0x3bcf('0x10')][_0x3bcf('0x11')]);return _0x48d236(_0x2b0598[_0x3bcf('0x10')]['message']);}logger[_0x3bcf('0x10')]('License,\x20%s,\x20%s',_0x2de508,_0x2b0598[_0x3bcf('0x10')][_0x3bcf('0x11')]);return _0xb2bbb6(_0x2b0598[_0x3bcf('0x10')][_0x3bcf('0x11')]);}else{logger['info']('License,\x20%s,\x20%s',_0x2de508,_0x3bcf('0xc'));_0xb2bbb6(_0x2b0598[_0x3bcf('0x12')]['message']);}})[_0x3bcf('0x13')](function(_0x38df32){logger[_0x3bcf('0x10')](_0x3bcf('0xb'),_0x2de508,_0x38df32);_0x48d236(_0x38df32);});});} \ No newline at end of file +var _0x066f=['client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1e4767,_0x677140){var _0x282ac5=function(_0x2e3c79){while(--_0x2e3c79){_0x1e4767['push'](_0x1e4767['shift']());}};_0x282ac5(++_0x677140);}(_0x066f,0x1d0));var _0xf066=function(_0x57da8d,_0x101608){_0x57da8d=_0x57da8d-0x0;var _0x1b0c77=_0x066f[_0x57da8d];return _0x1b0c77;};'use strict';var _=require(_0xf066('0x0'));var util=require(_0xf066('0x1'));var moment=require(_0xf066('0x2'));var BPromise=require(_0xf066('0x3'));var rs=require(_0xf066('0x4'));var fs=require('fs');var Redis=require(_0xf066('0x5'));var db=require(_0xf066('0x6'))['db'];var utils=require(_0xf066('0x7'));var logger=require('../../config/logger')(_0xf066('0x8'));var config=require(_0xf066('0x9'));var jayson=require(_0xf066('0xa'));var client=jayson[_0xf066('0xb')][_0xf066('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc76e52,_0x5c1ec6,_0x1aa4bf){return new BPromise(function(_0x21bd37,_0xaf5a12){return client[_0xf066('0xd')](_0xc76e52,_0x1aa4bf)[_0xf066('0xe')](function(_0x385ab3){logger[_0xf066('0xf')](_0xf066('0x10'),_0x5c1ec6,_0xf066('0x11'));logger[_0xf066('0x12')]('License,\x20%s,\x20%s,\x20%s',_0x5c1ec6,_0xf066('0x11'),JSON[_0xf066('0x13')](_0x385ab3));if(_0x385ab3[_0xf066('0x14')]){if(_0x385ab3[_0xf066('0x14')][_0xf066('0x15')]===0x1f4){logger[_0xf066('0x14')](_0xf066('0x10'),_0x5c1ec6,_0x385ab3[_0xf066('0x14')][_0xf066('0x16')]);return _0xaf5a12(_0x385ab3[_0xf066('0x14')]['message']);}logger[_0xf066('0x14')](_0xf066('0x10'),_0x5c1ec6,_0x385ab3[_0xf066('0x14')]['message']);return _0x21bd37(_0x385ab3[_0xf066('0x14')][_0xf066('0x16')]);}else{logger['info'](_0xf066('0x10'),_0x5c1ec6,_0xf066('0x11'));_0x21bd37(_0x385ab3[_0xf066('0x17')][_0xf066('0x16')]);}})[_0xf066('0x18')](function(_0x470316){logger[_0xf066('0x14')]('License,\x20%s,\x20%s',_0x5c1ec6,_0x470316);_0xaf5a12(_0x470316);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 30b9b74..2afd880 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 _0xd022=['path','connect-timeout','express','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/canned_answers','addAnswer','create','addImap','addSmtp','addInteraction','/:id/send','send','addAgents','put','delete','removeDispositions','removeAnswers','removeSmtp','removeAgents','multer','util'];(function(_0x231431,_0x46cdea){var _0x3d9720=function(_0x307792){while(--_0x307792){_0x231431['push'](_0x231431['shift']());}};_0x3d9720(++_0x46cdea);}(_0xd022,0x18a));var _0x2d02=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xd022[_0x4fde08];return _0x12e725;};'use strict';var multer=require(_0x2d02('0x0'));var util=require(_0x2d02('0x1'));var path=require(_0x2d02('0x2'));var timeout=require(_0x2d02('0x3'));var express=require(_0x2d02('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2d02('0x5'));var controller=require(_0x2d02('0x6'));router['get']('/',auth[_0x2d02('0x7')](),controller[_0x2d02('0x8')]);router[_0x2d02('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x2d02('0xa')]);router[_0x2d02('0x9')](_0x2d02('0xb'),auth[_0x2d02('0x7')](),controller[_0x2d02('0xc')]);router[_0x2d02('0x9')](_0x2d02('0xd'),auth[_0x2d02('0x7')](),controller['getDispositions']);router[_0x2d02('0x9')]('/:id/canned_answers',auth[_0x2d02('0x7')](),controller[_0x2d02('0xe')]);router[_0x2d02('0x9')](_0x2d02('0xf'),auth[_0x2d02('0x7')](),controller[_0x2d02('0x10')]);router['get'](_0x2d02('0x11'),auth['isAuthenticated'](),controller[_0x2d02('0x12')]);router[_0x2d02('0x9')](_0x2d02('0x13'),auth['isAuthenticated'](),controller[_0x2d02('0x14')]);router[_0x2d02('0x9')](_0x2d02('0x15'),auth['isAuthenticated'](),controller['getApplications']);router[_0x2d02('0x9')](_0x2d02('0x16'),auth[_0x2d02('0x7')](),controller[_0x2d02('0x17')]);router[_0x2d02('0x9')](_0x2d02('0x18'),auth[_0x2d02('0x7')](),controller[_0x2d02('0x19')]);router[_0x2d02('0x9')](_0x2d02('0x1a'),auth[_0x2d02('0x7')](),controller[_0x2d02('0x1b')]);router[_0x2d02('0x1c')](_0x2d02('0xd'),auth[_0x2d02('0x7')](),controller['addDisposition']);router[_0x2d02('0x1c')](_0x2d02('0x1d'),auth['isAuthenticated'](),controller[_0x2d02('0x1e')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2d02('0x1f')]);router['post'](_0x2d02('0xf'),auth[_0x2d02('0x7')](),controller[_0x2d02('0x20')]);router[_0x2d02('0x1c')](_0x2d02('0x11'),auth[_0x2d02('0x7')](),controller[_0x2d02('0x21')]);router['post'](_0x2d02('0x13'),auth[_0x2d02('0x7')](),controller[_0x2d02('0x22')]);router[_0x2d02('0x1c')](_0x2d02('0x15'),auth[_0x2d02('0x7')](),controller['addApplications']);router['post'](_0x2d02('0x23'),auth['isAuthenticated'](),controller[_0x2d02('0x24')]);router[_0x2d02('0x1c')](_0x2d02('0x1a'),auth[_0x2d02('0x7')](),controller[_0x2d02('0x25')]);router[_0x2d02('0x26')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2d02('0x27')]('/:id/dispositions',auth[_0x2d02('0x7')](),controller[_0x2d02('0x28')]);router[_0x2d02('0x27')](_0x2d02('0x1d'),auth[_0x2d02('0x7')](),controller[_0x2d02('0x29')]);router['delete'](_0x2d02('0xf'),auth['isAuthenticated'](),controller['removeImap']);router[_0x2d02('0x27')](_0x2d02('0x11'),auth[_0x2d02('0x7')](),controller[_0x2d02('0x2a')]);router[_0x2d02('0x27')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x2d02('0x27')](_0x2d02('0x1a'),auth['isAuthenticated'](),controller[_0x2d02('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x344a=['isAuthenticated','index','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/out_servers','addSmtp','addApplications','/:id/send','put','update','removeAnswers','delete','removeSmtp','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x344a,0x73));var _0xa344=function(_0x54249e,_0x565943){_0x54249e=_0x54249e-0x0;var _0x141c69=_0x344a[_0x54249e];return _0x141c69;};'use strict';var multer=require('multer');var util=require(_0xa344('0x0'));var path=require(_0xa344('0x1'));var timeout=require('connect-timeout');var express=require(_0xa344('0x2'));var router=express['Router']();var auth=require(_0xa344('0x3'));var interaction=require(_0xa344('0x4'));var config=require(_0xa344('0x5'));var controller=require(_0xa344('0x6'));router[_0xa344('0x7')]('/',auth[_0xa344('0x8')](),controller[_0xa344('0x9')]);router[_0xa344('0x7')]('/describe',auth[_0xa344('0x8')](),controller['describe']);router[_0xa344('0x7')](_0xa344('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa344('0x7')](_0xa344('0xb'),auth[_0xa344('0x8')](),controller[_0xa344('0xc')]);router[_0xa344('0x7')](_0xa344('0xd'),auth[_0xa344('0x8')](),controller['getAnswers']);router['get'](_0xa344('0xe'),auth[_0xa344('0x8')](),controller[_0xa344('0xf')]);router[_0xa344('0x7')]('/:id/out_servers',auth[_0xa344('0x8')](),controller[_0xa344('0x10')]);router[_0xa344('0x7')](_0xa344('0x11'),auth[_0xa344('0x8')](),controller[_0xa344('0x12')]);router[_0xa344('0x7')](_0xa344('0x13'),auth[_0xa344('0x8')](),controller[_0xa344('0x14')]);router[_0xa344('0x7')](_0xa344('0x15'),auth[_0xa344('0x8')](),controller[_0xa344('0x16')]);router[_0xa344('0x7')](_0xa344('0x17'),auth[_0xa344('0x8')](),controller[_0xa344('0x18')]);router[_0xa344('0x7')](_0xa344('0x19'),auth[_0xa344('0x8')](),controller[_0xa344('0x1a')]);router[_0xa344('0x1b')](_0xa344('0xb'),auth['isAuthenticated'](),controller[_0xa344('0x1c')]);router[_0xa344('0x1b')](_0xa344('0xd'),auth[_0xa344('0x8')](),controller[_0xa344('0x1d')]);router[_0xa344('0x1b')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa344('0x1b')](_0xa344('0xe'),auth[_0xa344('0x8')](),controller['addImap']);router[_0xa344('0x1b')](_0xa344('0x1e'),auth[_0xa344('0x8')](),controller[_0xa344('0x1f')]);router[_0xa344('0x1b')](_0xa344('0x11'),auth[_0xa344('0x8')](),controller['addInteraction']);router['post'](_0xa344('0x13'),auth[_0xa344('0x8')](),controller[_0xa344('0x20')]);router['post'](_0xa344('0x21'),auth[_0xa344('0x8')](),controller['send']);router[_0xa344('0x1b')](_0xa344('0x19'),auth[_0xa344('0x8')](),controller['addAgents']);router[_0xa344('0x22')](_0xa344('0xa'),auth[_0xa344('0x8')](),controller[_0xa344('0x23')]);router['delete'](_0xa344('0xb'),auth[_0xa344('0x8')](),controller['removeDispositions']);router['delete'](_0xa344('0xd'),auth[_0xa344('0x8')](),controller[_0xa344('0x24')]);router['delete'](_0xa344('0xe'),auth[_0xa344('0x8')](),controller['removeImap']);router[_0xa344('0x25')]('/:id/out_servers',auth[_0xa344('0x8')](),controller[_0xa344('0x26')]);router['delete'](_0xa344('0xa'),auth['isAuthenticated'](),controller[_0xa344('0x27')]);router[_0xa344('0x25')](_0xa344('0x19'),auth[_0xa344('0x8')](),controller['removeAgents']);module[_0xa344('0x28')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 2721457..fa94937 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 _0x81d9=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81d9,0x146));var _0x981d=function(_0x1a6fa0,_0x542237){_0x1a6fa0=_0x1a6fa0-0x0;var _0x246d52=_0x81d9[_0x1a6fa0];return _0x246d52;};'use strict';var Sequelize=require(_0x981d('0x0'));module[_0x981d('0x1')]={'description':{'type':Sequelize[_0x981d('0x2')]},'name':{'type':Sequelize[_0x981d('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x981d('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x981d('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x981d('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x981d('0x4')},'fontSize':{'type':Sequelize[_0x981d('0x5')](0x2)[_0x981d('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x981d('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x981d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x981d('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x981d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x981d('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x981d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x981d('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x981d('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x981d('0x3')],'defaultValue':![],'comment':_0x981d('0x8'),'set':function(_0x878fc9){if(!_0x878fc9)this[_0x981d('0x9')](_0x981d('0xa'),null);this[_0x981d('0x9')]('mandatoryDisposition',_0x878fc9);}}}; \ No newline at end of file +var _0xccc5=['STRING','TEXT','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','setDataValue','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xccc5,0x1e8));var _0x5ccc=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xccc5[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require(_0x5ccc('0x0'));module[_0x5ccc('0x1')]={'description':{'type':Sequelize[_0x5ccc('0x2')]},'name':{'type':Sequelize[_0x5ccc('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x5ccc('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x5ccc('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x5ccc('0x3')]},'markAsUnread':{'type':Sequelize[_0x5ccc('0x4')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5ccc('0x2')],'allowNull':![],'defaultValue':_0x5ccc('0x5')},'fontSize':{'type':Sequelize[_0x5ccc('0x6')](0x2)[_0x5ccc('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5ccc('0x3')],'defaultValue':function(){return _0x5ccc('0x8');}},'notificationSound':{'type':Sequelize[_0x5ccc('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5ccc('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5ccc('0x6')],'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[_0x5ccc('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5ccc('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5ccc('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5ccc('0x4')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1032b5){if(!_0x1032b5)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x5ccc('0x9')]('mandatoryDisposition',_0x1032b5);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 605df28..d8c25fd 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 _0x714c=['omit','CmContact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','from','%s\x20<%s>','attachments','server/files/attachments','auth','secure','SendMail','List\x20not\x20found','subject','out','messageId','Interaction','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','rimraf','zip-dir','request-promise','moment','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','client','http','request','then','info','request\x20sent','error','code','message','MailAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','destroy','get','stack','name','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','MailAccount','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','key','VIRTUAL','field','merge','options','includeAll','findAll','rows','show','params','length','include','find','body','mandatoryDispositionPause','describe','addDisposition','MailAccountId','create','getDispositions','findOne','Disposition','rawAttributes','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','description','isNil','cservice','cauthentication','cuser','cpassword','authentication','host','port','service','user','password','pass','role','UserProfileSection','MailAccounts','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x714c,0x19c));var _0xc714=function(_0x4350c2,_0x112f3c){_0x4350c2=_0x4350c2-0x0;var _0x8b6406=_0x714c[_0x4350c2];return _0x8b6406;};'use strict';var pdf=require(_0xc714('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc714('0x1'));var zipdir=require(_0xc714('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc714('0x3'));var moment=require(_0xc714('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc714('0x5'));var path=require('path');var sox=require(_0xc714('0x6'));var csv=require('to-csv');var ejs=require(_0xc714('0x7'));var fs=require('fs');var _=require(_0xc714('0x8'));var squel=require(_0xc714('0x9'));var crypto=require(_0xc714('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc714('0xb'));var toCsv=require(_0xc714('0xc'));var querystring=require(_0xc714('0xd'));var Papa=require(_0xc714('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xc714('0xf'));var Redis=require(_0xc714('0x10'));var qs=require(_0xc714('0x11'));var logger=require('../../config/logger')(_0xc714('0x12'));var utils=require(_0xc714('0x13'));var config=require(_0xc714('0x14'));var db=require(_0xc714('0x15'))['db'];config[_0xc714('0x16')]=_[_0xc714('0x17')](config[_0xc714('0x16')],{'host':_0xc714('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc714('0x19')][_0xc714('0x1a')]({'port':0x232b});function respondWithRpcPromise(_0x3cffa9,_0x550245,_0xf00299,_0x395ca0){return new BPromise(function(_0x508384,_0x387e7b){var _0x31e78d=_0x395ca0||client;return _0x31e78d[_0xc714('0x1b')](_0x3cffa9,_0xf00299)[_0xc714('0x1c')](function(_0x750b9e){logger[_0xc714('0x1d')]('MailAccount,\x20%s,\x20%s',_0x550245,_0xc714('0x1e'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x550245,_0xc714('0x1e'),JSON['stringify'](_0x750b9e));if(_0x750b9e[_0xc714('0x1f')]){if(_0x750b9e['error'][_0xc714('0x20')]===0x1f4){logger[_0xc714('0x1f')]('MailAccount,\x20%s,\x20%s',_0x550245,_0x750b9e[_0xc714('0x1f')][_0xc714('0x21')]);return _0x387e7b(_0x750b9e[_0xc714('0x1f')][_0xc714('0x21')]);}logger[_0xc714('0x1f')]('MailAccount,\x20%s,\x20%s',_0x550245,_0x750b9e[_0xc714('0x1f')][_0xc714('0x21')]);return _0x508384(_0x750b9e[_0xc714('0x1f')][_0xc714('0x21')]);}else{logger[_0xc714('0x1d')](_0xc714('0x22'),_0x550245,_0xc714('0x1e'));_0x508384(_0x750b9e[_0xc714('0x23')][_0xc714('0x21')]);}})[_0xc714('0x24')](function(_0xb13d60){logger['error']('MailAccount,\x20%s,\x20%s',_0x550245,_0xb13d60);_0x387e7b(_0xb13d60);});});}function respondWithStatusCode(_0x40263d,_0x20a7ee){_0x20a7ee=_0x20a7ee||0xcc;return function(_0x4576b6){if(_0x4576b6){return _0x40263d[_0xc714('0x25')](_0x20a7ee);}return _0x40263d[_0xc714('0x26')](_0x20a7ee)[_0xc714('0x27')]();};}function respondWithResult(_0x1faeb6,_0x53924f){_0x53924f=_0x53924f||0xc8;return function(_0x16f4a3){if(_0x16f4a3){return _0x1faeb6[_0xc714('0x26')](_0x53924f)[_0xc714('0x28')](_0x16f4a3);}};}function respondWithFilteredResult(_0x37959d,_0xe68f2){return function(_0x516a71){if(_0x516a71){var _0x535a82=_0x516a71[_0xc714('0x29')],_0x1a216c=_0xe68f2[_0xc714('0x2a')],_0x3a6e73=_0xe68f2['offset']+_0xe68f2[_0xc714('0x2b')],_0x490fda;if(_0x3a6e73>=_0x535a82){_0x3a6e73=_0x535a82;_0x490fda=0xc8;}else{_0x490fda=0xce;}_0x37959d[_0xc714('0x26')](_0x490fda);return _0x37959d[_0xc714('0x2c')]('Content-Range',_0x1a216c+'-'+_0x3a6e73+'/'+_0x535a82)[_0xc714('0x28')](_0x516a71);}return null;};}function patchUpdates(_0x276d0a){return function(_0x4a9ae0){try{jsonpatch[_0xc714('0x2d')](_0x4a9ae0,_0x276d0a,!![]);}catch(_0x502e0d){return BPromise['reject'](_0x502e0d);}return _0x4a9ae0[_0xc714('0x2e')]();};}function saveUpdates(_0x38876b,_0x41fc95){return function(_0x31bd10){if(_0x31bd10){return _0x31bd10[_0xc714('0x2f')](_0x38876b)[_0xc714('0x1c')](function(_0x2df849){return _0x2df849;});}return null;};}function removeEntity(_0xd2d958,_0x30ae48){return function(_0x5ca4c4){if(_0x5ca4c4){return _0x5ca4c4[_0xc714('0x30')]()['then'](function(){var _0xf0d12=_0x5ca4c4[_0xc714('0x31')]({'plain':!![]});var _0x43a440='MailAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x43a440,'resourceId':_0xf0d12['id']}})[_0xc714('0x1c')](function(){return _0x5ca4c4;});})[_0xc714('0x1c')](function(){_0xd2d958[_0xc714('0x26')](0xcc)[_0xc714('0x27')]();});}};}function handleEntityNotFound(_0x290ad4,_0x5cb3eb){return function(_0x10b1bb){if(!_0x10b1bb){_0x290ad4[_0xc714('0x25')](0x194);}return _0x10b1bb;};}function handleError(_0x4c4fe3,_0x4a8fb9){_0x4a8fb9=_0x4a8fb9||0x1f4;return function(_0x13d630){logger[_0xc714('0x1f')](_0x13d630[_0xc714('0x32')]);if(_0x13d630[_0xc714('0x33')]){delete _0x13d630[_0xc714('0x33')];}_0x4c4fe3[_0xc714('0x26')](_0x4a8fb9)['send'](_0x13d630);};}exports[_0xc714('0x34')]=function(_0x43d7dc,_0x22811a){var _0xdb9622={'include':[{'model':db[_0xc714('0x35')],'as':_0xc714('0x36')},{'model':db[_0xc714('0x37')],'as':_0xc714('0x38')},{'model':db[_0xc714('0x39')],'as':'mandatoryDispositionPause'}]},_0x382bda={},_0x5037d5={'count':0x0,'rows':[]};var _0xbd57c4=db[_0xc714('0x3a')]['rawAttributes'];_0x382bda[_0xc714('0x3b')]=_['keys'](_0xbd57c4);_0x382bda[_0xc714('0x3c')]=_[_0xc714('0x3d')](_0x43d7dc['query']);_0x382bda['filters']=_[_0xc714('0x3e')](_0x382bda[_0xc714('0x3b')],_0x382bda[_0xc714('0x3c')]);_0xdb9622[_0xc714('0x3f')]=_[_0xc714('0x3e')](_0x382bda[_0xc714('0x3b')],qs[_0xc714('0x40')](_0x43d7dc[_0xc714('0x3c')][_0xc714('0x40')]));_0xdb9622['attributes']=_0xdb9622[_0xc714('0x3f')]['length']?_0xdb9622[_0xc714('0x3f')]:_0x382bda[_0xc714('0x3b')];if(!_0x43d7dc['query'][_0xc714('0x41')](_0xc714('0x42'))){_0xdb9622['limit']=qs[_0xc714('0x2b')](_0x43d7dc[_0xc714('0x3c')][_0xc714('0x2b')]);_0xdb9622[_0xc714('0x2a')]=qs['offset'](_0x43d7dc[_0xc714('0x3c')]['offset']);}_0xdb9622['order']=qs[_0xc714('0x43')](_0x43d7dc[_0xc714('0x3c')][_0xc714('0x43')]);_0xdb9622[_0xc714('0x44')]=qs[_0xc714('0x45')](_[_0xc714('0x46')](_0x43d7dc['query'],_0x382bda[_0xc714('0x45')]));if(_0x43d7dc[_0xc714('0x3c')][_0xc714('0x47')]){_0xdb9622[_0xc714('0x44')]=_['merge'](_0xdb9622[_0xc714('0x44')],{'$or':_[_0xc714('0x48')](_0xbd57c4,function(_0x4ef830){if(_0x4ef830['type'][_0xc714('0x49')]!==_0xc714('0x4a')){var _0x5d89e7={};_0x5d89e7[_0x4ef830[_0xc714('0x4b')]]={'$like':'%'+_0x43d7dc[_0xc714('0x3c')][_0xc714('0x47')]+'%'};return _0x5d89e7;}})});}_0xdb9622=_[_0xc714('0x4c')]({},_0xdb9622,_0x43d7dc[_0xc714('0x4d')]);var _0x1c5fee={'where':_0xdb9622[_0xc714('0x44')]};return db['MailAccount'][_0xc714('0x29')](_0x1c5fee)[_0xc714('0x1c')](function(_0x4e1aef){_0x5037d5[_0xc714('0x29')]=_0x4e1aef;if(_0x43d7dc[_0xc714('0x3c')][_0xc714('0x4e')]){_0xdb9622['include']=[{'all':!![]}];}return db['MailAccount'][_0xc714('0x4f')](_0xdb9622);})[_0xc714('0x1c')](function(_0x532beb){_0x5037d5[_0xc714('0x50')]=_0x532beb;return _0x5037d5;})[_0xc714('0x1c')](respondWithFilteredResult(_0x22811a,_0xdb9622))[_0xc714('0x24')](handleError(_0x22811a,null));};exports[_0xc714('0x51')]=function(_0x4c0533,_0x43ffb8){var _0x4e34c1={'raw':![],'where':{'id':_0x4c0533[_0xc714('0x52')]['id']},'include':[{'model':db[_0xc714('0x35')],'as':_0xc714('0x36')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x104f4c={};_0x104f4c['model']=_[_0xc714('0x3d')](db[_0xc714('0x3a')]['rawAttributes']);_0x104f4c[_0xc714('0x3c')]=_['keys'](_0x4c0533['query']);_0x104f4c[_0xc714('0x45')]=_[_0xc714('0x3e')](_0x104f4c[_0xc714('0x3b')],_0x104f4c[_0xc714('0x3c')]);_0x4e34c1['attributes']=_[_0xc714('0x3e')](_0x104f4c[_0xc714('0x3b')],qs['fields'](_0x4c0533[_0xc714('0x3c')][_0xc714('0x40')]));_0x4e34c1[_0xc714('0x3f')]=_0x4e34c1[_0xc714('0x3f')][_0xc714('0x53')]?_0x4e34c1[_0xc714('0x3f')]:_0x104f4c[_0xc714('0x3b')];if(_0x4c0533[_0xc714('0x3c')][_0xc714('0x4e')]){_0x4e34c1[_0xc714('0x54')]=[{'all':!![]}];}_0x4e34c1=_[_0xc714('0x4c')]({},_0x4e34c1,_0x4c0533[_0xc714('0x4d')]);return db[_0xc714('0x3a')][_0xc714('0x55')](_0x4e34c1)[_0xc714('0x1c')](handleEntityNotFound(_0x43ffb8,null))[_0xc714('0x1c')](respondWithResult(_0x43ffb8,null))[_0xc714('0x24')](handleError(_0x43ffb8,null));};exports[_0xc714('0x2f')]=function(_0x34e731,_0x12e6f5){if(_0x34e731[_0xc714('0x56')]['id']){delete _0x34e731[_0xc714('0x56')]['id'];}return db[_0xc714('0x3a')][_0xc714('0x55')]({'where':{'id':_0x34e731[_0xc714('0x52')]['id']},'include':[{'model':db[_0xc714('0x35')],'as':_0xc714('0x36')},{'model':db[_0xc714('0x37')],'as':_0xc714('0x38')},{'model':db[_0xc714('0x39')],'as':_0xc714('0x57')}]})['then'](handleEntityNotFound(_0x12e6f5,null))[_0xc714('0x1c')](saveUpdates(_0x34e731[_0xc714('0x56')],null))[_0xc714('0x1c')](function(_0xaad6af){if(_0xaad6af&&_0x34e731['body']['Imap']){return db[_0xc714('0x35')]['update'](_0x34e731[_0xc714('0x56')][_0xc714('0x36')],{'where':{'MailAccountId':_0xaad6af['id']}})['then'](function(){return _0xaad6af;});}return _0xaad6af;})[_0xc714('0x1c')](function(_0x4b6a7b){if(_0x4b6a7b&&_0x34e731[_0xc714('0x56')][_0xc714('0x38')]){return db[_0xc714('0x37')][_0xc714('0x2f')](_0x34e731['body'][_0xc714('0x38')],{'where':{'MailAccountId':_0x4b6a7b['id']}})[_0xc714('0x1c')](function(){return _0x4b6a7b;});}return _0x4b6a7b;})[_0xc714('0x1c')](function(_0xe755f3){if(_0xe755f3&&_0x34e731['body'][_0xc714('0x57')]){return db[_0xc714('0x39')]['update'](_0x34e731['body'][_0xc714('0x57')],{'where':{'MailAccountId':_0xe755f3['id']}})['then'](function(){return _0xe755f3;});}return _0xe755f3;})[_0xc714('0x1c')](respondWithResult(_0x12e6f5,null))[_0xc714('0x24')](handleError(_0x12e6f5,null));};exports[_0xc714('0x58')]=function(_0x3e9518,_0x5df2a1){return db[_0xc714('0x3a')][_0xc714('0x58')]()['then'](respondWithResult(_0x5df2a1,null))[_0xc714('0x24')](handleError(_0x5df2a1,null));};exports[_0xc714('0x59')]=function(_0x50b31e,_0x1f733d,_0x6bd12c){if(_0x50b31e['body']['id']){delete _0x50b31e[_0xc714('0x56')]['id'];}return db[_0xc714('0x3a')][_0xc714('0x55')]({'where':{'id':_0x50b31e[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x1f733d,null))[_0xc714('0x1c')](function(_0x4310fc){if(_0x4310fc){_0x50b31e['body'][_0xc714('0x5a')]=_0x4310fc['id'];return db['Disposition'][_0xc714('0x5b')](_0x50b31e[_0xc714('0x56')]);}})[_0xc714('0x1c')](respondWithResult(_0x1f733d,null))[_0xc714('0x24')](handleError(_0x1f733d,null));};exports[_0xc714('0x5c')]=function(_0xbd2d55,_0x4a9b59,_0x26a479){var _0x2e881b={'raw':![],'where':{}};var _0x2c40f4={};var _0x5f0d61={'count':0x0,'rows':[]};return db[_0xc714('0x3a')][_0xc714('0x5d')]({'where':{'id':_0xbd2d55['params']['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x4a9b59,null))['then'](function(_0x2ad13e){if(_0x2ad13e){_0x2c40f4['model']=_[_0xc714('0x3d')](db[_0xc714('0x5e')][_0xc714('0x5f')]);_0x2c40f4[_0xc714('0x3c')]=_[_0xc714('0x3d')](_0xbd2d55['query']);_0x2c40f4[_0xc714('0x45')]=_[_0xc714('0x3e')](_0x2c40f4['model'],_0x2c40f4[_0xc714('0x3c')]);_0x2e881b[_0xc714('0x3f')]=_[_0xc714('0x3e')](_0x2c40f4[_0xc714('0x3b')],qs[_0xc714('0x40')](_0xbd2d55['query'][_0xc714('0x40')]));_0x2e881b['attributes']=_0x2e881b['attributes'][_0xc714('0x53')]?_0x2e881b[_0xc714('0x3f')]:_0x2c40f4[_0xc714('0x3b')];if(!_0xbd2d55['query'][_0xc714('0x41')]('nolimit')){_0x2e881b[_0xc714('0x2b')]=qs[_0xc714('0x2b')](_0xbd2d55[_0xc714('0x3c')]['limit']);_0x2e881b[_0xc714('0x2a')]=qs[_0xc714('0x2a')](_0xbd2d55[_0xc714('0x3c')][_0xc714('0x2a')]);}_0x2e881b[_0xc714('0x60')]=qs[_0xc714('0x43')](_0xbd2d55['query'][_0xc714('0x43')]);_0x2e881b[_0xc714('0x44')]=qs[_0xc714('0x45')](_[_0xc714('0x46')](_0xbd2d55[_0xc714('0x3c')],_0x2c40f4[_0xc714('0x45')]));_0x2e881b[_0xc714('0x44')][_0xc714('0x5a')]=_0x2ad13e['id'];if(_0xbd2d55[_0xc714('0x3c')][_0xc714('0x47')]){_0x2e881b[_0xc714('0x44')]=_[_0xc714('0x4c')](_0x2e881b[_0xc714('0x44')],{'$or':_[_0xc714('0x48')](_0x2e881b[_0xc714('0x3f')],function(_0x490b6f){var _0x4d02c3={};_0x4d02c3[_0x490b6f]={'$like':'%'+_0xbd2d55['query'][_0xc714('0x47')]+'%'};return _0x4d02c3;})});}_0x2e881b=_[_0xc714('0x4c')]({},_0x2e881b,_0xbd2d55['options']);return db[_0xc714('0x5e')][_0xc714('0x29')]({'where':_0x2e881b['where']})[_0xc714('0x1c')](function(_0x4969e9){_0x5f0d61['count']=_0x4969e9;if(_0xbd2d55[_0xc714('0x3c')]['includeAll']){_0x2e881b[_0xc714('0x54')]=[{'all':!![]}];}return db['Disposition'][_0xc714('0x4f')](_0x2e881b);})[_0xc714('0x1c')](function(_0x436670){_0x5f0d61[_0xc714('0x50')]=_0x436670;return _0x5f0d61;});}})[_0xc714('0x1c')](respondWithFilteredResult(_0x4a9b59,_0x2e881b))[_0xc714('0x24')](handleError(_0x4a9b59,null));};exports[_0xc714('0x61')]=function(_0x20a208,_0x2ca338,_0x1efdb5){var _0x717091;return db['MailAccount']['find']({'where':{'id':_0x20a208[_0xc714('0x52')]['id']}})['then'](handleEntityNotFound(_0x2ca338,null))[_0xc714('0x1c')](function(_0x48d704){if(_0x48d704){return _0x48d704[_0xc714('0x61')](_0x20a208['query'][_0xc714('0x62')]);}})[_0xc714('0x1c')](respondWithStatusCode(_0x2ca338,null))[_0xc714('0x24')](handleError(_0x2ca338,null));};exports[_0xc714('0x63')]=function(_0x5b1e26,_0x251d56,_0x399bbc){if(_0x5b1e26[_0xc714('0x56')]['id']){delete _0x5b1e26[_0xc714('0x56')]['id'];}return db['MailAccount'][_0xc714('0x55')]({'where':{'id':_0x5b1e26[_0xc714('0x52')]['id']}})['then'](handleEntityNotFound(_0x251d56,null))[_0xc714('0x1c')](function(_0x5d3407){if(_0x5d3407){_0x5b1e26[_0xc714('0x56')][_0xc714('0x5a')]=_0x5d3407['id'];return db[_0xc714('0x64')][_0xc714('0x5b')](_0x5b1e26['body']);}})[_0xc714('0x1c')](respondWithResult(_0x251d56,null))['catch'](handleError(_0x251d56,null));};exports[_0xc714('0x65')]=function(_0x46cec3,_0x109c2d,_0x1606d4){var _0x2063c9={'raw':![],'where':{}};var _0x86ae02={};var _0x54fe84={'count':0x0,'rows':[]};return db[_0xc714('0x3a')][_0xc714('0x5d')]({'where':{'id':_0x46cec3[_0xc714('0x52')]['id']}})['then'](handleEntityNotFound(_0x109c2d,null))['then'](function(_0x5f5c65){if(_0x5f5c65){_0x86ae02['model']=_[_0xc714('0x3d')](db[_0xc714('0x64')]['rawAttributes']);_0x86ae02[_0xc714('0x3c')]=_[_0xc714('0x3d')](_0x46cec3[_0xc714('0x3c')]);_0x86ae02[_0xc714('0x45')]=_[_0xc714('0x3e')](_0x86ae02[_0xc714('0x3b')],_0x86ae02['query']);_0x2063c9[_0xc714('0x3f')]=_['intersection'](_0x86ae02[_0xc714('0x3b')],qs['fields'](_0x46cec3[_0xc714('0x3c')][_0xc714('0x40')]));_0x2063c9[_0xc714('0x3f')]=_0x2063c9['attributes'][_0xc714('0x53')]?_0x2063c9[_0xc714('0x3f')]:_0x86ae02[_0xc714('0x3b')];if(!_0x46cec3[_0xc714('0x3c')][_0xc714('0x41')](_0xc714('0x42'))){_0x2063c9[_0xc714('0x2b')]=qs[_0xc714('0x2b')](_0x46cec3[_0xc714('0x3c')][_0xc714('0x2b')]);_0x2063c9[_0xc714('0x2a')]=qs[_0xc714('0x2a')](_0x46cec3['query'][_0xc714('0x2a')]);}_0x2063c9[_0xc714('0x60')]=qs[_0xc714('0x43')](_0x46cec3[_0xc714('0x3c')][_0xc714('0x43')]);_0x2063c9['where']=qs[_0xc714('0x45')](_['pick'](_0x46cec3[_0xc714('0x3c')],_0x86ae02[_0xc714('0x45')]));_0x2063c9[_0xc714('0x44')][_0xc714('0x5a')]=_0x5f5c65['id'];if(_0x46cec3['query'][_0xc714('0x47')]){_0x2063c9[_0xc714('0x44')]=_[_0xc714('0x4c')](_0x2063c9['where'],{'$or':_[_0xc714('0x48')](_0x2063c9[_0xc714('0x3f')],function(_0x74005){var _0x4c2fa1={};_0x4c2fa1[_0x74005]={'$like':'%'+_0x46cec3[_0xc714('0x3c')]['filter']+'%'};return _0x4c2fa1;})});}_0x2063c9=_['merge']({},_0x2063c9,_0x46cec3[_0xc714('0x4d')]);return db[_0xc714('0x64')][_0xc714('0x29')]({'where':_0x2063c9[_0xc714('0x44')]})[_0xc714('0x1c')](function(_0x2fe05e){_0x54fe84[_0xc714('0x29')]=_0x2fe05e;if(_0x46cec3[_0xc714('0x3c')]['includeAll']){_0x2063c9[_0xc714('0x54')]=[{'all':!![]}];}return db[_0xc714('0x64')]['findAll'](_0x2063c9);})[_0xc714('0x1c')](function(_0x54b3c8){_0x54fe84[_0xc714('0x50')]=_0x54b3c8;return _0x54fe84;});}})[_0xc714('0x1c')](respondWithFilteredResult(_0x109c2d,_0x2063c9))[_0xc714('0x24')](handleError(_0x109c2d,null));};exports[_0xc714('0x66')]=function(_0x28c234,_0x378e25,_0x24ac89){var _0x42e8b3;return db['MailAccount'][_0xc714('0x55')]({'where':{'id':_0x28c234['params']['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x378e25,null))[_0xc714('0x1c')](function(_0x77262c){if(_0x77262c){return _0x77262c[_0xc714('0x66')](_0x28c234['query'][_0xc714('0x62')]);}})['then'](respondWithStatusCode(_0x378e25,null))[_0xc714('0x24')](handleError(_0x378e25,null));};exports['create']=function(_0xed2a0e,_0x4cced9){var _0x405b79={'name':_0xed2a0e[_0xc714('0x56')][_0xc714('0x33')],'key':_0xed2a0e['body'][_0xc714('0x49')],'email':_0xed2a0e[_0xc714('0x56')][_0xc714('0x67')],'ListId':_0xed2a0e['body'][_0xc714('0x68')],'active':!_['isNil'](_0xed2a0e[_0xc714('0x56')][_0xc714('0x69')])?_0xed2a0e[_0xc714('0x56')][_0xc714('0x69')]:!![],'description':_0xed2a0e[_0xc714('0x56')][_0xc714('0x6a')]||null,'Imap':{},'Smtp':{}};if(_[_0xc714('0x6b')](_0xed2a0e[_0xc714('0x56')][_0xc714('0x6c')])){if(_0xed2a0e[_0xc714('0x56')][_0xc714('0x6d')]){_0x405b79['Imap']['user']=_0x405b79[_0xc714('0x38')]['user']=_0xed2a0e[_0xc714('0x56')][_0xc714('0x6e')];_0x405b79[_0xc714('0x36')]['password']=_0x405b79['Smtp']['pass']=_0xed2a0e[_0xc714('0x56')][_0xc714('0x6f')];}else{_0x405b79[_0xc714('0x36')][_0xc714('0x70')]=_0x405b79['Smtp'][_0xc714('0x70')]=![];}_0x405b79[_0xc714('0x36')]['host']=_0xed2a0e[_0xc714('0x56')][_0xc714('0x36')][_0xc714('0x71')];_0x405b79['Imap'][_0xc714('0x72')]=_0xed2a0e[_0xc714('0x56')][_0xc714('0x36')]['port'];_0x405b79[_0xc714('0x38')]['host']=_0xed2a0e[_0xc714('0x56')]['Smtp'][_0xc714('0x71')];_0x405b79[_0xc714('0x38')][_0xc714('0x72')]=_0xed2a0e[_0xc714('0x56')]['Smtp'][_0xc714('0x72')];}else{_0x405b79[_0xc714('0x36')]['service']=_0x405b79[_0xc714('0x38')][_0xc714('0x73')]=_0xed2a0e[_0xc714('0x56')][_0xc714('0x6c')];_0x405b79['Imap']['user']=_0x405b79[_0xc714('0x38')][_0xc714('0x74')]=_0xed2a0e[_0xc714('0x56')][_0xc714('0x6e')];_0x405b79[_0xc714('0x36')][_0xc714('0x75')]=_0x405b79[_0xc714('0x38')][_0xc714('0x76')]=_0xed2a0e['body'][_0xc714('0x6f')];}return db[_0xc714('0x3a')][_0xc714('0x5b')](_0x405b79,{'include':[{'model':db[_0xc714('0x37')],'as':_0xc714('0x38')},{'model':db[_0xc714('0x35')],'as':_0xc714('0x36')}]})['then'](function(_0x13f9e4){var _0x38a3fb=_0xed2a0e[_0xc714('0x74')][_0xc714('0x31')]({'plain':!![]});if(!_0x38a3fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38a3fb[_0xc714('0x77')]==='user'){var _0x5b39c6=_0x13f9e4[_0xc714('0x31')]({'plain':!![]});return db[_0xc714('0x78')]['find']({'where':{'name':_0xc714('0x79'),'userProfileId':_0x38a3fb['userProfileId']},'raw':!![]})[_0xc714('0x1c')](function(_0x496e2b){if(_0x496e2b&&_0x496e2b['autoAssociation']===0x0){return db[_0xc714('0x7a')][_0xc714('0x5b')]({'name':_0x5b39c6[_0xc714('0x33')],'resourceId':_0x5b39c6['id'],'type':_0x496e2b[_0xc714('0x33')],'sectionId':_0x496e2b['id']},{})[_0xc714('0x1c')](function(){return _0x13f9e4;});}else{return _0x13f9e4;}})[_0xc714('0x24')](function(_0x5e4ef8){logger[_0xc714('0x1f')](_0xc714('0x7b'),_0x5e4ef8);throw _0x5e4ef8;});}return _0x13f9e4;})[_0xc714('0x1c')](respondWithResult(_0x4cced9,0xc9))[_0xc714('0x24')](handleError(_0x4cced9,null));};exports['getImap']=function(_0x4166cb,_0x1f070d,_0x26b5fc){return db['MailAccount'][_0xc714('0x5d')]({'where':{'id':_0x4166cb[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x1f070d,null))[_0xc714('0x1c')](function(_0x257f16){if(_0x257f16){return _0x257f16[_0xc714('0x7c')]();}return null;})[_0xc714('0x1c')](respondWithResult(_0x1f070d,null))[_0xc714('0x24')](handleError(_0x1f070d,null));};exports[_0xc714('0x7d')]=function(_0x16f0a0,_0x530333,_0x150c3b){if(_0x16f0a0['body']['id']){delete _0x16f0a0['body']['id'];}return db[_0xc714('0x3a')][_0xc714('0x55')]({'where':{'id':_0x16f0a0[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x530333,null))[_0xc714('0x1c')](function(_0x41f731){if(_0x41f731){_0x16f0a0[_0xc714('0x56')][_0xc714('0x5a')]=_0x41f731['id'];return db[_0xc714('0x35')][_0xc714('0x5b')](_0x16f0a0[_0xc714('0x56')]);}})[_0xc714('0x1c')](respondWithResult(_0x530333,null))[_0xc714('0x24')](handleError(_0x530333,null));};exports[_0xc714('0x7e')]=function(_0x20432,_0x366ce8,_0x1b30ce){return db[_0xc714('0x3a')]['findOne']({'where':{'id':_0x20432[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x366ce8,null))[_0xc714('0x1c')](function(_0x45e652){if(_0x45e652){return _0x45e652[_0xc714('0x7f')](null);}return null;})[_0xc714('0x1c')](respondWithStatusCode(_0x366ce8,null))[_0xc714('0x24')](handleError(_0x366ce8,null));};exports[_0xc714('0x80')]=function(_0x29febb,_0xa558b1,_0x238607){return db[_0xc714('0x3a')][_0xc714('0x5d')]({'where':{'id':_0x29febb[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0xa558b1,null))[_0xc714('0x1c')](function(_0x358d9a){if(_0x358d9a){return _0x358d9a[_0xc714('0x80')]();}return null;})[_0xc714('0x1c')](respondWithResult(_0xa558b1,null))[_0xc714('0x24')](handleError(_0xa558b1,null));};exports[_0xc714('0x81')]=function(_0x313013,_0x8fd25,_0x5b56d2){if(_0x313013['body']['id']){delete _0x313013[_0xc714('0x56')]['id'];}return db[_0xc714('0x3a')]['find']({'where':{'id':_0x313013[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x8fd25,null))[_0xc714('0x1c')](function(_0x38f27d){if(_0x38f27d){_0x313013[_0xc714('0x56')][_0xc714('0x5a')]=_0x38f27d['id'];return db[_0xc714('0x37')][_0xc714('0x5b')](_0x313013[_0xc714('0x56')]);}})[_0xc714('0x1c')](respondWithResult(_0x8fd25,null))[_0xc714('0x24')](handleError(_0x8fd25,null));};exports[_0xc714('0x82')]=function(_0x52c75b,_0x1e06da,_0x5e1c6c){return db[_0xc714('0x3a')][_0xc714('0x5d')]({'where':{'id':_0x52c75b[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x1e06da,null))['then'](function(_0x27ff7c){if(_0x27ff7c){return _0x27ff7c[_0xc714('0x83')](null);}return null;})[_0xc714('0x1c')](respondWithStatusCode(_0x1e06da,null))[_0xc714('0x24')](handleError(_0x1e06da,null));};exports[_0xc714('0x84')]=function(_0x15eea1,_0x16100d,_0x584df7){return db[_0xc714('0x85')]['find']({'where':{'id':_0x15eea1[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x16100d,null))[_0xc714('0x1c')](function(_0x98991d){if(_0x98991d){return _0x98991d[_0xc714('0x84')](_0x15eea1[_0xc714('0x56')][_0xc714('0x62')],_[_0xc714('0x86')](_0x15eea1[_0xc714('0x56')],['ids','id'])||{});}})[_0xc714('0x1c')](respondWithResult(_0x16100d,null))[_0xc714('0x24')](handleError(_0x16100d,null));};exports['getInteractions']=function(_0xba7f11,_0x5513ac,_0x480b6b){var _0xfcba1e={'raw':![],'where':{}};var _0x58a6bf={};var _0x35caad={'count':0x0,'rows':[]};return db[_0xc714('0x3a')][_0xc714('0x5d')]({'where':{'id':_0xba7f11[_0xc714('0x52')]['id']}})['then'](handleEntityNotFound(_0x5513ac,null))[_0xc714('0x1c')](function(_0x451f05){if(_0x451f05){_0x58a6bf[_0xc714('0x3b')]=_[_0xc714('0x3d')](db['MailInteraction'][_0xc714('0x5f')]);_0x58a6bf[_0xc714('0x3c')]=_[_0xc714('0x3d')](_0xba7f11[_0xc714('0x3c')]);_0x58a6bf['filters']=_[_0xc714('0x3e')](_0x58a6bf[_0xc714('0x3b')],_0x58a6bf[_0xc714('0x3c')]);_0xfcba1e['attributes']=_[_0xc714('0x3e')](_0x58a6bf[_0xc714('0x3b')],qs[_0xc714('0x40')](_0xba7f11[_0xc714('0x3c')][_0xc714('0x40')]));_0xfcba1e[_0xc714('0x3f')]=_0xfcba1e[_0xc714('0x3f')]['length']?_0xfcba1e[_0xc714('0x3f')]:_0x58a6bf['model'];if(!_0xba7f11[_0xc714('0x3c')][_0xc714('0x41')](_0xc714('0x42'))){_0xfcba1e[_0xc714('0x2b')]=qs[_0xc714('0x2b')](_0xba7f11[_0xc714('0x3c')][_0xc714('0x2b')]);_0xfcba1e[_0xc714('0x2a')]=qs[_0xc714('0x2a')](_0xba7f11['query']['offset']);}_0xfcba1e[_0xc714('0x60')]=qs['sort'](_0xba7f11[_0xc714('0x3c')]['sort']);_0xfcba1e[_0xc714('0x44')]=qs[_0xc714('0x45')](_[_0xc714('0x46')](_0xba7f11['query'],_0x58a6bf[_0xc714('0x45')]));_0xfcba1e['where']['MailAccountId']=_0x451f05['id'];if(_0xba7f11['query'][_0xc714('0x47')]){_0xfcba1e[_0xc714('0x44')]=_[_0xc714('0x4c')](_0xfcba1e['where'],{'$or':_[_0xc714('0x48')](_0xfcba1e[_0xc714('0x3f')],function(_0x12ce1b){var _0x569d3d={};_0x569d3d[_0x12ce1b]={'$like':'%'+_0xba7f11[_0xc714('0x3c')][_0xc714('0x47')]+'%'};return _0x569d3d;})});}_0xfcba1e=_[_0xc714('0x4c')]({},_0xfcba1e,_0xba7f11[_0xc714('0x4d')]);return db['MailInteraction'][_0xc714('0x29')]({'where':_0xfcba1e[_0xc714('0x44')]})[_0xc714('0x1c')](function(_0x4843f8){_0x35caad[_0xc714('0x29')]=_0x4843f8;if(_0xba7f11[_0xc714('0x3c')]['includeAll']){_0xfcba1e[_0xc714('0x54')]=[{'model':db[_0xc714('0x87')],'as':'Contact','required':![]},{'model':db[_0xc714('0x88')],'as':_0xc714('0x89'),'attributes':[_0xc714('0x33'),_0xc714('0x8a'),_0xc714('0x8b')],'required':![]},{'model':db['Tag'],'as':_0xc714('0x8c'),'attributes':['id','name',_0xc714('0x8d')],'where':_0xba7f11[_0xc714('0x3c')][_0xc714('0x8e')]?{'id':_0xba7f11['query'][_0xc714('0x8e')]}:undefined,'required':_0xba7f11['query']['tag']?!![]:![]}];}return db[_0xc714('0x85')][_0xc714('0x4f')](_0xfcba1e);})[_0xc714('0x1c')](function(_0x785723){_0x35caad['rows']=_0x785723;return _0x35caad;});}})['then'](respondWithFilteredResult(_0x5513ac,_0xfcba1e))[_0xc714('0x24')](handleError(_0x5513ac,null));};exports[_0xc714('0x8f')]=function(_0x4dd56f,_0x31c277,_0x4c77d5){return db[_0xc714('0x3a')]['findOne']({'where':{'id':_0x4dd56f[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x31c277,null))[_0xc714('0x1c')](function(_0x32ae94){if(_0x32ae94){return db[_0xc714('0x90')]['transaction'](function(_0x43befc){return db[_0xc714('0x91')]['destroy']({'where':{'MailAccountId':_0x4dd56f[_0xc714('0x52')]['id']},'transaction':_0x43befc})['then'](function(_0x100654){var _0x11853b=_[_0xc714('0x48')](_0x4dd56f['body'],function(_0x52bed6){_0x52bed6[_0xc714('0x5a')]=_0x4dd56f[_0xc714('0x52')]['id'];return _0x52bed6;});return db[_0xc714('0x91')][_0xc714('0x92')](_0x11853b,{'transaction':_0x43befc});});})[_0xc714('0x1c')](function(){return db[_0xc714('0x91')]['findAndCountAll']({'where':{'MailAccountId':_0x4dd56f[_0xc714('0x52')]['id']},'order':_0xc714('0x93')});});}})[_0xc714('0x1c')](respondWithResult(_0x31c277,null))[_0xc714('0x24')](handleError(_0x31c277,null));};exports[_0xc714('0x94')]=function(_0x113411,_0x8440e7,_0x462802){var _0x2c16d9={};var _0x5893a9={};var _0x16a5d5;var _0x20ae16;return db['MailAccount']['findOne']({'where':{'id':_0x113411[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x8440e7,null))[_0xc714('0x1c')](function(_0x15bc94){if(_0x15bc94){_0x16a5d5=_0x15bc94;_0x5893a9['model']=_['keys'](db[_0xc714('0x91')][_0xc714('0x5f')]);_0x5893a9[_0xc714('0x3c')]=_[_0xc714('0x3d')](_0x113411[_0xc714('0x3c')]);_0x5893a9[_0xc714('0x45')]=_[_0xc714('0x3e')](_0x5893a9['model'],_0x5893a9[_0xc714('0x3c')]);_0x2c16d9[_0xc714('0x3f')]=_['intersection'](_0x5893a9[_0xc714('0x3b')],qs[_0xc714('0x40')](_0x113411['query'][_0xc714('0x40')]));_0x2c16d9[_0xc714('0x3f')]=_0x2c16d9[_0xc714('0x3f')]['length']?_0x2c16d9[_0xc714('0x3f')]:_0x5893a9[_0xc714('0x3b')];_0x2c16d9[_0xc714('0x60')]=qs[_0xc714('0x43')](_0x113411[_0xc714('0x3c')][_0xc714('0x43')]);_0x2c16d9[_0xc714('0x44')]=qs[_0xc714('0x45')](_[_0xc714('0x46')](_0x113411[_0xc714('0x3c')],_0x5893a9['filters']));if(_0x113411[_0xc714('0x3c')][_0xc714('0x47')]){_0x2c16d9[_0xc714('0x44')]=_['merge'](_0x2c16d9[_0xc714('0x44')],{'$or':_[_0xc714('0x48')](_0x2c16d9['attributes'],function(_0x2be6cc){var _0x2818e1={};_0x2818e1[_0x2be6cc]={'$like':'%'+_0x113411['query'][_0xc714('0x47')]+'%'};return _0x2818e1;})});}_0x2c16d9=_[_0xc714('0x4c')]({},_0x2c16d9,_0x113411['options']);return _0x16a5d5[_0xc714('0x94')](_0x2c16d9);}})[_0xc714('0x1c')](function(_0x2b76a3){if(_0x2b76a3){_0x20ae16=_0x2b76a3[_0xc714('0x53')];if(!_0x113411['query'][_0xc714('0x41')](_0xc714('0x42'))){_0x2c16d9[_0xc714('0x2b')]=qs[_0xc714('0x2b')](_0x113411[_0xc714('0x3c')][_0xc714('0x2b')]);_0x2c16d9[_0xc714('0x2a')]=qs[_0xc714('0x2a')](_0x113411[_0xc714('0x3c')]['offset']);}return _0x16a5d5['getApplications'](_0x2c16d9);}})['then'](function(_0x20c94c){if(_0x20c94c){return _0x20c94c?{'count':_0x20ae16,'rows':_0x20c94c}:null;}})['then'](respondWithResult(_0x8440e7,null))[_0xc714('0x24')](handleError(_0x8440e7,null));};exports[_0xc714('0x95')]=function(_0x216bcc,_0x433a2,_0x19c8e6){var _0xc5328b={'raw':!![],'where':{}};var _0x5d2426={};var _0x36b92b={'count':0x0,'rows':[]};return db[_0xc714('0x3a')]['findOne']({'where':{'id':_0x216bcc[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x433a2,null))['then'](function(_0x52dbd0){if(_0x52dbd0){_0x5d2426[_0xc714('0x3b')]=_[_0xc714('0x3d')](db[_0xc714('0x96')]['rawAttributes']);_0x5d2426['query']=_[_0xc714('0x3d')](_0x216bcc['query']);_0x5d2426[_0xc714('0x45')]=_[_0xc714('0x3e')](_0x5d2426[_0xc714('0x3b')],_0x5d2426[_0xc714('0x3c')]);_0xc5328b[_0xc714('0x3f')]=_[_0xc714('0x3e')](_0x5d2426[_0xc714('0x3b')],qs[_0xc714('0x40')](_0x216bcc[_0xc714('0x3c')]['fields']));_0xc5328b[_0xc714('0x3f')]=_0xc5328b['attributes'][_0xc714('0x53')]?_0xc5328b[_0xc714('0x3f')]:_0x5d2426['model'];if(!_0x216bcc[_0xc714('0x3c')]['hasOwnProperty']('nolimit')){_0xc5328b['limit']=qs[_0xc714('0x2b')](_0x216bcc[_0xc714('0x3c')][_0xc714('0x2b')]);_0xc5328b[_0xc714('0x2a')]=qs[_0xc714('0x2a')](_0x216bcc[_0xc714('0x3c')][_0xc714('0x2a')]);}_0xc5328b[_0xc714('0x60')]=qs[_0xc714('0x43')](_0x216bcc[_0xc714('0x3c')][_0xc714('0x43')]);_0xc5328b[_0xc714('0x44')]=qs['filters'](_[_0xc714('0x46')](_0x216bcc['query'],_0x5d2426[_0xc714('0x45')]));_0xc5328b['where'][_0xc714('0x5a')]=_0x52dbd0['id'];if(_0x216bcc[_0xc714('0x3c')][_0xc714('0x47')]){_0xc5328b[_0xc714('0x44')]=_[_0xc714('0x4c')](_0xc5328b[_0xc714('0x44')],{'$or':_[_0xc714('0x48')](_0xc5328b[_0xc714('0x3f')],function(_0x52f6d5){var _0x48fe30={};_0x48fe30[_0x52f6d5]={'$like':'%'+_0x216bcc['query'][_0xc714('0x47')]+'%'};return _0x48fe30;})});}if(_0x216bcc[_0xc714('0x3c')]['$gte']){var _0x2c5dbb=_0x216bcc[_0xc714('0x3c')][_0xc714('0x97')][_0xc714('0x98')](',');var _0x402add={};_0x402add[_0x2c5dbb[0x0]]={'$gte':moment(_0x2c5dbb[0x1])[_0xc714('0x99')](_0xc714('0x9a'))};_0xc5328b[_0xc714('0x44')]=_[_0xc714('0x4c')](_0xc5328b[_0xc714('0x44')],_0x402add);}_0xc5328b=_[_0xc714('0x4c')]({},_0xc5328b,_0x216bcc['options']);return db[_0xc714('0x96')][_0xc714('0x29')]({'where':_0xc5328b[_0xc714('0x44')]})[_0xc714('0x1c')](function(_0x3ec860){_0x36b92b['count']=_0x3ec860;if(_0x216bcc['query'][_0xc714('0x4e')]){_0xc5328b['include']=[{'all':!![]}];}return db[_0xc714('0x96')][_0xc714('0x4f')](_0xc5328b);})[_0xc714('0x1c')](function(_0x2756ff){_0x36b92b[_0xc714('0x50')]=_0x2756ff;return _0x36b92b;});}})[_0xc714('0x1c')](respondWithFilteredResult(_0x433a2,_0xc5328b))[_0xc714('0x24')](handleError(_0x433a2,null));};exports['send']=function(_0x3e1bb3,_0x320825,_0x166290){var _0x453051,_0x5e7c85={},_0x469ca2;if(_0x3e1bb3['body']['to']){_0x469ca2=_0x3e1bb3['body']['to']['split'](',')[0x0];}return db[_0xc714('0x3a')]['find']({'where':{'id':_0x3e1bb3[_0xc714('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0xc714('0x9b'),'include':[{'model':db[_0xc714('0x87')],'as':_0xc714('0x9c'),'where':{'email':_0x469ca2},'limit':0x1,'order':[['updatedAt',_0xc714('0x9d')]]}]},{'model':db[_0xc714('0x37')],'as':_0xc714('0x38'),'raw':!![]}]})['then'](handleEntityNotFound(_0x320825,null))[_0xc714('0x1c')](function(_0x2bde58){if(_0x2bde58){_0x453051=_0x2bde58;if(_0x2bde58[_0xc714('0x38')]){if(_[_0xc714('0x6b')](_0x3e1bb3['body'][_0xc714('0x9e')])){_0x3e1bb3[_0xc714('0x56')][_0xc714('0x9e')]=util['format'](_0xc714('0x9f'),_0x2bde58['name'],_0x2bde58[_0xc714('0x67')]||_0x2bde58['Smtp'][_0xc714('0x74')]);}if(_0x3e1bb3['body'][_0xc714('0xa0')]&&_0x3e1bb3['body'][_0xc714('0xa0')][_0xc714('0x53')]){for(var _0x6f7dea=0x0;_0x6f7dea<_0x3e1bb3['body'][_0xc714('0xa0')][_0xc714('0x53')];_0x6f7dea+=0x1){_0x3e1bb3[_0xc714('0x56')][_0xc714('0xa0')][_0x6f7dea]={'filename':_0x3e1bb3[_0xc714('0x56')][_0xc714('0xa0')][_0x6f7dea][_0xc714('0x33')],'path':path['join'](config['root'],_0xc714('0xa1'),_0x3e1bb3['body']['attachments'][_0x6f7dea]['basename'])};}}var _0x154df6={'tls':{'rejectUnauthorized':![]}};if(_[_0xc714('0x6b')](_0x2bde58['Smtp'][_0xc714('0x73')])){if(_0x2bde58[_0xc714('0x38')][_0xc714('0x70')]){_0x154df6[_0xc714('0xa2')]={'user':_0x2bde58[_0xc714('0x38')][_0xc714('0x74')],'pass':_0x2bde58[_0xc714('0x38')][_0xc714('0x76')]};}_0x154df6[_0xc714('0x71')]=_0x2bde58[_0xc714('0x38')][_0xc714('0x71')];_0x154df6[_0xc714('0x72')]=_0x2bde58['Smtp']['port'];_0x154df6[_0xc714('0xa3')]=_0x2bde58[_0xc714('0x38')][_0xc714('0xa3')];}else{_0x154df6[_0xc714('0x73')]=_0x2bde58[_0xc714('0x38')][_0xc714('0x73')];_0x154df6[_0xc714('0xa2')]={'user':_0x2bde58[_0xc714('0x38')][_0xc714('0x74')],'pass':_0x2bde58[_0xc714('0x38')][_0xc714('0x76')]};}return respondWithRpcPromise(_0xc714('0xa4'),'sendMail',{'account':_0x154df6,'message':_0x3e1bb3[_0xc714('0x56')]});}else{throw new Error(_0xc714('0xa5'));}}})[_0xc714('0x1c')](function(_0x30457f){if(_0x30457f){_0x5e7c85=_0x30457f;if(_0x453051[_0xc714('0x9b')]){if(_0x453051[_0xc714('0x9b')][_0xc714('0x9c')][_0xc714('0x53')]){return _0x453051[_0xc714('0x9b')]['Contacts'][0x0];}else{return db[_0xc714('0x87')]['create'](_[_0xc714('0x17')](_0x3e1bb3['body'],{'firstName':_0x3e1bb3[_0xc714('0x56')]['to'],'email':_0x3e1bb3[_0xc714('0x56')]['to'],'phone':_0x3e1bb3['body']['to'],'ListId':_0x453051[_0xc714('0x68')]}));}}else{throw new Error(_0xc714('0xa5'));}}})['then'](function(_0xac479){if(_0xac479){var _0x2a8e15={'UserId':_0x3e1bb3[_0xc714('0x74')]['id'],'ContactId':_0xac479['id'],'MailAccountId':_0x453051['id'],'inReplyTo':_0x5e7c85['messageId'],'to':_0x3e1bb3[_0xc714('0x56')][_0xc714('0x9e')],'cc':_0x3e1bb3[_0xc714('0x56')]['cc'],'subject':_0x3e1bb3[_0xc714('0x56')][_0xc714('0xa6')],'attach':_0x3e1bb3[_0xc714('0x56')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0xc714('0x9a')),'lastMsgDirection':_0xc714('0xa7'),'lastMsgBody':_0x3e1bb3[_0xc714('0x56')][_0xc714('0x56')],'Messages':[_[_0xc714('0x4c')](_0x3e1bb3[_0xc714('0x56')],{'messageId':_0x5e7c85[_0xc714('0xa8')],'sentAt':moment()['format'](_0xc714('0x9a')),'read':!![],'MailAccountId':_0x453051['id'],'UserId':_0x3e1bb3[_0xc714('0x74')]['id'],'ContactId':_0xac479['id']})]};if(_0x3e1bb3[_0xc714('0x56')][_0xc714('0xa9')]){_0x2a8e15=_['merge'](_0x2a8e15,_0x3e1bb3[_0xc714('0x56')][_0xc714('0xa9')]);}return db[_0xc714('0x85')][_0xc714('0x5b')](_0x2a8e15,{'include':[{'model':db[_0xc714('0x96')],'as':'Messages'}]});}})['then'](respondWithResult(_0x320825,null))[_0xc714('0x24')](handleError(_0x320825,null));};exports[_0xc714('0xaa')]=function(_0x1ac0a6,_0x886f49,_0x524070){return db['MailAccount'][_0xc714('0x55')]({'where':{'id':_0x1ac0a6[_0xc714('0x52')]['id']},'include':[{'model':db[_0xc714('0x37')],'as':_0xc714('0x38'),'raw':!![]}]})[_0xc714('0x1c')](handleEntityNotFound(_0x886f49,null))['then'](function(_0x4b49a1){if(_0x4b49a1&&_0x4b49a1[_0xc714('0x38')]){var _0xc7fd9d={'id':_0x4b49a1['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4b49a1['Smtp']['service']){_0xc7fd9d[_0xc714('0x73')]=_0x4b49a1[_0xc714('0x38')][_0xc714('0x73')];}else{_0xc7fd9d[_0xc714('0x71')]=_0x4b49a1[_0xc714('0x38')]['host'];_0xc7fd9d[_0xc714('0x72')]=_0x4b49a1['Smtp'][_0xc714('0x72')];_0xc7fd9d[_0xc714('0xa3')]=_0x4b49a1['Smtp'][_0xc714('0xa3')];}if(_0x4b49a1[_0xc714('0x38')][_0xc714('0x70')]){_0xc7fd9d[_0xc714('0xa2')]={'user':_0x4b49a1['Smtp'][_0xc714('0x74')],'pass':_0x4b49a1[_0xc714('0x38')][_0xc714('0x76')]};}return respondWithRpcPromise(_0xc714('0xab'),_0xc714('0xaa'),{'account':_0xc7fd9d});}})['then'](respondWithResult(_0x886f49,null))[_0xc714('0x24')](handleError(_0x886f49,null));};exports[_0xc714('0x30')]=function(_0x19e9b9,_0x2660de){return db[_0xc714('0x3a')][_0xc714('0x55')]({'where':{'id':_0x19e9b9[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x2660de,null))['then'](function(_0x48a0f1){if(_0x48a0f1&&_0x48a0f1[_0xc714('0x73')]){throw new db['Sequelize'][(_0xc714('0xac'))](_0xc714('0xad'));}return _0x48a0f1;})['then'](removeEntity(_0x2660de,null))[_0xc714('0x24')](handleError(_0x2660de,null));};exports['addAgents']=function(_0x208011,_0x3f8196,_0x2d1638){return db['MailAccount']['find']({'where':{'id':_0x208011[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x3f8196,null))[_0xc714('0x1c')](function(_0x16e89b){if(_0x16e89b){return _0x16e89b[_0xc714('0xae')](_0x208011[_0xc714('0x56')]['ids'],_[_0xc714('0x86')](_0x208011[_0xc714('0x56')],[_0xc714('0x62'),'id'])||{})[_0xc714('0xaf')](function(_0x410392){for(var _0x1d7a0d=0x0;_0x1d7a0d<_0x208011['body'][_0xc714('0x62')][_0xc714('0x53')];_0x1d7a0d+=0x1){socket[_0xc714('0xb0')](_0xc714('0xb1'),{'UserId':_0x208011[_0xc714('0x56')][_0xc714('0x62')][_0x1d7a0d],'MailAccountId':_0x208011[_0xc714('0x52')]['id']});}return _0x410392;});}})[_0xc714('0x1c')](respondWithResult(_0x3f8196,null))['catch'](handleError(_0x3f8196,null));};exports[_0xc714('0xb2')]=function(_0x5e9b2d,_0x379ebd,_0x46d82d){var _0x226236;return db[_0xc714('0x3a')][_0xc714('0x55')]({'where':{'id':_0x5e9b2d['params']['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x379ebd,null))[_0xc714('0x1c')](function(_0x22f21d){if(_0x22f21d){return _0x22f21d[_0xc714('0xb2')](_0x5e9b2d[_0xc714('0x3c')][_0xc714('0x62')])[_0xc714('0x1c')](function(_0x2368f0){if(_[_0xc714('0xb3')](_0x5e9b2d[_0xc714('0x3c')][_0xc714('0x62')])){for(var _0x5d6ae3=0x0;_0x5d6ae3<_0x5e9b2d[_0xc714('0x3c')]['ids'][_0xc714('0x53')];_0x5d6ae3+=0x1){socket['emit'](_0xc714('0xb4'),{'UserId':_0x5e9b2d[_0xc714('0x3c')][_0xc714('0x62')][_0x5d6ae3],'MailAccountId':_0x5e9b2d[_0xc714('0x52')]['id']});}}else{socket[_0xc714('0xb0')]('userMailAccount:remove',{'UserId':_0x5e9b2d['query'][_0xc714('0x62')],'MailAccountId':_0x5e9b2d['params']['id']});}});}})[_0xc714('0x1c')](respondWithStatusCode(_0x379ebd,null))[_0xc714('0x24')](handleError(_0x379ebd,null));};exports[_0xc714('0xb5')]=function(_0x49b25c,_0x68421,_0x28611e){var _0x146df2={};var _0x9854f={};var _0x4f0a08;var _0x3ffe7c;return db[_0xc714('0x3a')]['findOne']({'where':{'id':_0x49b25c[_0xc714('0x52')]['id']}})[_0xc714('0x1c')](handleEntityNotFound(_0x68421,null))['then'](function(_0x3e5e3f){if(_0x3e5e3f){_0x4f0a08=_0x3e5e3f;_0x9854f[_0xc714('0x3b')]=_[_0xc714('0x3d')](db[_0xc714('0x88')][_0xc714('0x5f')]);_0x9854f[_0xc714('0x3c')]=_[_0xc714('0x3d')](_0x49b25c['query']);_0x9854f['filters']=_[_0xc714('0x3e')](_0x9854f[_0xc714('0x3b')],_0x9854f[_0xc714('0x3c')]);_0x146df2['attributes']=_[_0xc714('0x3e')](_0x9854f['model'],qs[_0xc714('0x40')](_0x49b25c[_0xc714('0x3c')][_0xc714('0x40')]));_0x146df2[_0xc714('0x3f')]=_0x146df2['attributes'][_0xc714('0x53')]?_0x146df2[_0xc714('0x3f')]:_0x9854f['model'];_0x146df2[_0xc714('0x60')]=qs['sort'](_0x49b25c[_0xc714('0x3c')][_0xc714('0x43')]);_0x146df2[_0xc714('0x44')]=qs[_0xc714('0x45')](_[_0xc714('0x46')](_0x49b25c[_0xc714('0x3c')],_0x9854f[_0xc714('0x45')]));if(_0x49b25c[_0xc714('0x3c')][_0xc714('0x47')]){_0x146df2[_0xc714('0x44')]=_[_0xc714('0x4c')](_0x146df2[_0xc714('0x44')],{'$or':_[_0xc714('0x48')](_0x146df2[_0xc714('0x3f')],function(_0x3be85e){var _0x1a7b23={};_0x1a7b23[_0x3be85e]={'$like':'%'+_0x49b25c[_0xc714('0x3c')][_0xc714('0x47')]+'%'};return _0x1a7b23;})});}_0x146df2=_[_0xc714('0x4c')]({},_0x146df2,_0x49b25c['options']);return _0x4f0a08[_0xc714('0xb5')](_0x146df2);}})[_0xc714('0x1c')](function(_0x42d620){if(_0x42d620){_0x3ffe7c=_0x42d620[_0xc714('0x53')];if(!_0x49b25c[_0xc714('0x3c')]['hasOwnProperty'](_0xc714('0x42'))){_0x146df2[_0xc714('0x2b')]=qs[_0xc714('0x2b')](_0x49b25c[_0xc714('0x3c')][_0xc714('0x2b')]);_0x146df2[_0xc714('0x2a')]=qs['offset'](_0x49b25c[_0xc714('0x3c')][_0xc714('0x2a')]);}return _0x4f0a08[_0xc714('0xb5')](_0x146df2);}})[_0xc714('0x1c')](function(_0x1952e9){if(_0x1952e9){return _0x1952e9?{'count':_0x3ffe7c,'rows':_0x1952e9}:null;}})['then'](respondWithResult(_0x68421,null))[_0xc714('0x24')](handleError(_0x68421,null));}; \ No newline at end of file +var _0xcdf2=['result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','get','UserProfileResource','stack','name','send','index','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','findAll','rows','show','params','MailServerIn','includeAll','include','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','removeDispositions','ids','addAnswer','map','CannedAnswer','removeAnswers','email','isNil','active','description','cservice','cauthentication','cuser','pass','cpassword','authentication','host','port','service','user','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','hasOwnProperty','MailInteraction','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','Contacts','defaults','messageId','subject','attach','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xcdf2,0x9b));var _0x2cdf=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0xcdf2[_0x57474e];return _0xfaae8c;};'use strict';var pdf=require(_0x2cdf('0x0'));var emlformat=require(_0x2cdf('0x1'));var rimraf=require(_0x2cdf('0x2'));var zipdir=require(_0x2cdf('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2cdf('0x4'));var Mustache=require(_0x2cdf('0x5'));var util=require(_0x2cdf('0x6'));var path=require(_0x2cdf('0x7'));var sox=require('sox');var csv=require(_0x2cdf('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2cdf('0x9'));var crypto=require(_0x2cdf('0xa'));var jsforce=require(_0x2cdf('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2cdf('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0x2cdf('0xd'));var Redis=require(_0x2cdf('0xe'));var qs=require(_0x2cdf('0xf'));var logger=require(_0x2cdf('0x10'))('api');var utils=require(_0x2cdf('0x11'));var config=require('../../config/environment');var db=require(_0x2cdf('0x12'))['db'];config[_0x2cdf('0x13')]=_['defaults'](config[_0x2cdf('0x13')],{'host':_0x2cdf('0x14'),'port':0x18eb});var socket=require(_0x2cdf('0x15'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x2cdf('0x16')](socket);var jayson=require(_0x2cdf('0x17'));var client=jayson[_0x2cdf('0x18')][_0x2cdf('0x19')]({'port':0x232b});function respondWithRpcPromise(_0x2419bc,_0x4e01f1,_0x26df51,_0x2dd507){return new BPromise(function(_0x4fd33e,_0x58ee82){var _0x281c92=_0x2dd507||client;return _0x281c92[_0x2cdf('0x1a')](_0x2419bc,_0x26df51)['then'](function(_0x1fc004){logger[_0x2cdf('0x1b')]('MailAccount,\x20%s,\x20%s',_0x4e01f1,_0x2cdf('0x1c'));logger[_0x2cdf('0x1d')](_0x2cdf('0x1e'),_0x4e01f1,_0x2cdf('0x1c'),JSON['stringify'](_0x1fc004));if(_0x1fc004[_0x2cdf('0x1f')]){if(_0x1fc004[_0x2cdf('0x1f')][_0x2cdf('0x20')]===0x1f4){logger['error'](_0x2cdf('0x21'),_0x4e01f1,_0x1fc004[_0x2cdf('0x1f')]['message']);return _0x58ee82(_0x1fc004[_0x2cdf('0x1f')]['message']);}logger[_0x2cdf('0x1f')](_0x2cdf('0x21'),_0x4e01f1,_0x1fc004[_0x2cdf('0x1f')][_0x2cdf('0x22')]);return _0x4fd33e(_0x1fc004[_0x2cdf('0x1f')][_0x2cdf('0x22')]);}else{logger[_0x2cdf('0x1b')]('MailAccount,\x20%s,\x20%s',_0x4e01f1,'request\x20sent');_0x4fd33e(_0x1fc004[_0x2cdf('0x23')]['message']);}})[_0x2cdf('0x24')](function(_0x2ec259){logger[_0x2cdf('0x1f')]('MailAccount,\x20%s,\x20%s',_0x4e01f1,_0x2ec259);_0x58ee82(_0x2ec259);});});}function respondWithStatusCode(_0x46fae2,_0x1ed131){_0x1ed131=_0x1ed131||0xcc;return function(_0x6d1825){if(_0x6d1825){return _0x46fae2[_0x2cdf('0x25')](_0x1ed131);}return _0x46fae2['status'](_0x1ed131)[_0x2cdf('0x26')]();};}function respondWithResult(_0x18bcb2,_0x36c6a7){_0x36c6a7=_0x36c6a7||0xc8;return function(_0x3cfc61){if(_0x3cfc61){return _0x18bcb2[_0x2cdf('0x27')](_0x36c6a7)['json'](_0x3cfc61);}};}function respondWithFilteredResult(_0x423fc1,_0x290407){return function(_0x3c4879){if(_0x3c4879){var _0x53fa25=_0x3c4879[_0x2cdf('0x28')],_0x5f3d7d=_0x290407['offset'],_0x587f3a=_0x290407[_0x2cdf('0x29')]+_0x290407[_0x2cdf('0x2a')],_0x391ded;if(_0x587f3a>=_0x53fa25){_0x587f3a=_0x53fa25;_0x391ded=0xc8;}else{_0x391ded=0xce;}_0x423fc1[_0x2cdf('0x27')](_0x391ded);return _0x423fc1[_0x2cdf('0x2b')](_0x2cdf('0x2c'),_0x5f3d7d+'-'+_0x587f3a+'/'+_0x53fa25)[_0x2cdf('0x2d')](_0x3c4879);}return null;};}function patchUpdates(_0x5af476){return function(_0x5123cd){try{jsonpatch[_0x2cdf('0x2e')](_0x5123cd,_0x5af476,!![]);}catch(_0x349c12){return BPromise[_0x2cdf('0x2f')](_0x349c12);}return _0x5123cd['save']();};}function saveUpdates(_0x57447a,_0x495abc){return function(_0x34bb95){if(_0x34bb95){return _0x34bb95[_0x2cdf('0x30')](_0x57447a)['then'](function(_0x566835){return _0x566835;});}return null;};}function removeEntity(_0x177b66,_0x531c4b){return function(_0x5ee4b2){if(_0x5ee4b2){return _0x5ee4b2[_0x2cdf('0x31')]()[_0x2cdf('0x32')](function(){var _0x7f67e4=_0x5ee4b2[_0x2cdf('0x33')]({'plain':!![]});var _0x2a2c03='MailAccounts';return db[_0x2cdf('0x34')][_0x2cdf('0x31')]({'where':{'type':_0x2a2c03,'resourceId':_0x7f67e4['id']}})[_0x2cdf('0x32')](function(){return _0x5ee4b2;});})[_0x2cdf('0x32')](function(){_0x177b66[_0x2cdf('0x27')](0xcc)[_0x2cdf('0x26')]();});}};}function handleEntityNotFound(_0x509d32,_0x325460){return function(_0x3ba7e0){if(!_0x3ba7e0){_0x509d32[_0x2cdf('0x25')](0x194);}return _0x3ba7e0;};}function handleError(_0x59c755,_0x1131de){_0x1131de=_0x1131de||0x1f4;return function(_0x39b8be){logger[_0x2cdf('0x1f')](_0x39b8be[_0x2cdf('0x35')]);if(_0x39b8be['name']){delete _0x39b8be[_0x2cdf('0x36')];}_0x59c755['status'](_0x1131de)[_0x2cdf('0x37')](_0x39b8be);};}exports[_0x2cdf('0x38')]=function(_0x4fd364,_0x52da40){var _0x3fa3d1={'include':[{'model':db['MailServerIn'],'as':_0x2cdf('0x39')},{'model':db[_0x2cdf('0x3a')],'as':_0x2cdf('0x3b')},{'model':db[_0x2cdf('0x3c')],'as':_0x2cdf('0x3d')}]},_0x22018a={},_0x1deb73={'count':0x0,'rows':[]};var _0x1e7ce5=db[_0x2cdf('0x3e')][_0x2cdf('0x3f')];_0x22018a[_0x2cdf('0x40')]=_[_0x2cdf('0x41')](_0x1e7ce5);_0x22018a[_0x2cdf('0x42')]=_[_0x2cdf('0x41')](_0x4fd364[_0x2cdf('0x42')]);_0x22018a[_0x2cdf('0x43')]=_[_0x2cdf('0x44')](_0x22018a[_0x2cdf('0x40')],_0x22018a['query']);_0x3fa3d1['attributes']=_[_0x2cdf('0x44')](_0x22018a[_0x2cdf('0x40')],qs[_0x2cdf('0x45')](_0x4fd364[_0x2cdf('0x42')][_0x2cdf('0x45')]));_0x3fa3d1[_0x2cdf('0x46')]=_0x3fa3d1['attributes'][_0x2cdf('0x47')]?_0x3fa3d1[_0x2cdf('0x46')]:_0x22018a['model'];if(!_0x4fd364[_0x2cdf('0x42')]['hasOwnProperty'](_0x2cdf('0x48'))){_0x3fa3d1['limit']=qs[_0x2cdf('0x2a')](_0x4fd364['query'][_0x2cdf('0x2a')]);_0x3fa3d1['offset']=qs['offset'](_0x4fd364['query'][_0x2cdf('0x29')]);}_0x3fa3d1['order']=qs['sort'](_0x4fd364['query'][_0x2cdf('0x49')]);_0x3fa3d1['where']=qs[_0x2cdf('0x43')](_[_0x2cdf('0x4a')](_0x4fd364[_0x2cdf('0x42')],_0x22018a[_0x2cdf('0x43')]));if(_0x4fd364[_0x2cdf('0x42')][_0x2cdf('0x4b')]){_0x3fa3d1[_0x2cdf('0x4c')]=_[_0x2cdf('0x4d')](_0x3fa3d1[_0x2cdf('0x4c')],{'$or':_['map'](_0x1e7ce5,function(_0x4e8e08){if(_0x4e8e08[_0x2cdf('0x4e')][_0x2cdf('0x4f')]!==_0x2cdf('0x50')){var _0x51597e={};_0x51597e[_0x4e8e08[_0x2cdf('0x51')]]={'$like':'%'+_0x4fd364['query'][_0x2cdf('0x4b')]+'%'};return _0x51597e;}})});}_0x3fa3d1=_[_0x2cdf('0x4d')]({},_0x3fa3d1,_0x4fd364[_0x2cdf('0x52')]);var _0x31a5f1={'where':_0x3fa3d1[_0x2cdf('0x4c')]};return db['MailAccount'][_0x2cdf('0x28')](_0x31a5f1)[_0x2cdf('0x32')](function(_0x49aa59){_0x1deb73[_0x2cdf('0x28')]=_0x49aa59;if(_0x4fd364[_0x2cdf('0x42')]['includeAll']){_0x3fa3d1['include']=[{'all':!![]}];}return db[_0x2cdf('0x3e')][_0x2cdf('0x53')](_0x3fa3d1);})['then'](function(_0x2eee65){_0x1deb73[_0x2cdf('0x54')]=_0x2eee65;return _0x1deb73;})[_0x2cdf('0x32')](respondWithFilteredResult(_0x52da40,_0x3fa3d1))[_0x2cdf('0x24')](handleError(_0x52da40,null));};exports[_0x2cdf('0x55')]=function(_0x1fc6f3,_0x91caab){var _0x27befc={'raw':![],'where':{'id':_0x1fc6f3[_0x2cdf('0x56')]['id']},'include':[{'model':db[_0x2cdf('0x57')],'as':_0x2cdf('0x39')},{'model':db[_0x2cdf('0x3a')],'as':'Smtp'},{'model':db[_0x2cdf('0x3c')],'as':_0x2cdf('0x3d')}]},_0x4dca38={};_0x4dca38[_0x2cdf('0x40')]=_[_0x2cdf('0x41')](db['MailAccount']['rawAttributes']);_0x4dca38[_0x2cdf('0x42')]=_[_0x2cdf('0x41')](_0x1fc6f3[_0x2cdf('0x42')]);_0x4dca38[_0x2cdf('0x43')]=_['intersection'](_0x4dca38[_0x2cdf('0x40')],_0x4dca38[_0x2cdf('0x42')]);_0x27befc[_0x2cdf('0x46')]=_[_0x2cdf('0x44')](_0x4dca38[_0x2cdf('0x40')],qs[_0x2cdf('0x45')](_0x1fc6f3[_0x2cdf('0x42')][_0x2cdf('0x45')]));_0x27befc[_0x2cdf('0x46')]=_0x27befc[_0x2cdf('0x46')][_0x2cdf('0x47')]?_0x27befc[_0x2cdf('0x46')]:_0x4dca38[_0x2cdf('0x40')];if(_0x1fc6f3['query'][_0x2cdf('0x58')]){_0x27befc[_0x2cdf('0x59')]=[{'all':!![]}];}_0x27befc=_[_0x2cdf('0x4d')]({},_0x27befc,_0x1fc6f3['options']);return db[_0x2cdf('0x3e')][_0x2cdf('0x5a')](_0x27befc)[_0x2cdf('0x32')](handleEntityNotFound(_0x91caab,null))[_0x2cdf('0x32')](respondWithResult(_0x91caab,null))[_0x2cdf('0x24')](handleError(_0x91caab,null));};exports[_0x2cdf('0x30')]=function(_0x1daa3b,_0x359241){if(_0x1daa3b[_0x2cdf('0x5b')]['id']){delete _0x1daa3b['body']['id'];}return db['MailAccount'][_0x2cdf('0x5a')]({'where':{'id':_0x1daa3b[_0x2cdf('0x56')]['id']},'include':[{'model':db[_0x2cdf('0x57')],'as':_0x2cdf('0x39')},{'model':db[_0x2cdf('0x3a')],'as':_0x2cdf('0x3b')},{'model':db[_0x2cdf('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x2cdf('0x32')](handleEntityNotFound(_0x359241,null))[_0x2cdf('0x32')](saveUpdates(_0x1daa3b[_0x2cdf('0x5b')],null))[_0x2cdf('0x32')](function(_0x13f14b){if(_0x13f14b&&_0x1daa3b[_0x2cdf('0x5b')][_0x2cdf('0x39')]){return db[_0x2cdf('0x57')]['update'](_0x1daa3b[_0x2cdf('0x5b')][_0x2cdf('0x39')],{'where':{'MailAccountId':_0x13f14b['id']}})[_0x2cdf('0x32')](function(){return _0x13f14b;});}return _0x13f14b;})[_0x2cdf('0x32')](function(_0x5f1cba){if(_0x5f1cba&&_0x1daa3b[_0x2cdf('0x5b')][_0x2cdf('0x3b')]){return db['MailServerOut'][_0x2cdf('0x30')](_0x1daa3b[_0x2cdf('0x5b')][_0x2cdf('0x3b')],{'where':{'MailAccountId':_0x5f1cba['id']}})[_0x2cdf('0x32')](function(){return _0x5f1cba;});}return _0x5f1cba;})['then'](function(_0x423bf2){if(_0x423bf2&&_0x1daa3b[_0x2cdf('0x5b')][_0x2cdf('0x3d')]){return db['Pause'][_0x2cdf('0x30')](_0x1daa3b[_0x2cdf('0x5b')][_0x2cdf('0x3d')],{'where':{'MailAccountId':_0x423bf2['id']}})[_0x2cdf('0x32')](function(){return _0x423bf2;});}return _0x423bf2;})[_0x2cdf('0x32')](respondWithResult(_0x359241,null))[_0x2cdf('0x24')](handleError(_0x359241,null));};exports[_0x2cdf('0x5c')]=function(_0x423456,_0x1203b2){return db[_0x2cdf('0x3e')][_0x2cdf('0x5c')]()[_0x2cdf('0x32')](respondWithResult(_0x1203b2,null))[_0x2cdf('0x24')](handleError(_0x1203b2,null));};exports[_0x2cdf('0x5d')]=function(_0x12f1d9,_0x4c7443,_0x2a2063){if(_0x12f1d9[_0x2cdf('0x5b')]['id']){delete _0x12f1d9[_0x2cdf('0x5b')]['id'];}return db[_0x2cdf('0x3e')][_0x2cdf('0x5a')]({'where':{'id':_0x12f1d9['params']['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0x4c7443,null))['then'](function(_0x562304){if(_0x562304){_0x12f1d9[_0x2cdf('0x5b')][_0x2cdf('0x5e')]=_0x562304['id'];return db[_0x2cdf('0x5f')][_0x2cdf('0x60')](_0x12f1d9[_0x2cdf('0x5b')]);}})[_0x2cdf('0x32')](respondWithResult(_0x4c7443,null))['catch'](handleError(_0x4c7443,null));};exports[_0x2cdf('0x61')]=function(_0x42532d,_0x2f88b9,_0x23a501){var _0x21b7f9={'raw':![],'where':{}};var _0x5d125c={};var _0x1ef84c={'count':0x0,'rows':[]};return db['MailAccount'][_0x2cdf('0x62')]({'where':{'id':_0x42532d[_0x2cdf('0x56')]['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0x2f88b9,null))[_0x2cdf('0x32')](function(_0x4e52fc){if(_0x4e52fc){_0x5d125c[_0x2cdf('0x40')]=_[_0x2cdf('0x41')](db[_0x2cdf('0x5f')]['rawAttributes']);_0x5d125c[_0x2cdf('0x42')]=_[_0x2cdf('0x41')](_0x42532d[_0x2cdf('0x42')]);_0x5d125c['filters']=_[_0x2cdf('0x44')](_0x5d125c[_0x2cdf('0x40')],_0x5d125c[_0x2cdf('0x42')]);_0x21b7f9['attributes']=_[_0x2cdf('0x44')](_0x5d125c[_0x2cdf('0x40')],qs[_0x2cdf('0x45')](_0x42532d[_0x2cdf('0x42')][_0x2cdf('0x45')]));_0x21b7f9[_0x2cdf('0x46')]=_0x21b7f9['attributes'][_0x2cdf('0x47')]?_0x21b7f9[_0x2cdf('0x46')]:_0x5d125c[_0x2cdf('0x40')];if(!_0x42532d[_0x2cdf('0x42')]['hasOwnProperty']('nolimit')){_0x21b7f9[_0x2cdf('0x2a')]=qs['limit'](_0x42532d[_0x2cdf('0x42')]['limit']);_0x21b7f9[_0x2cdf('0x29')]=qs[_0x2cdf('0x29')](_0x42532d[_0x2cdf('0x42')][_0x2cdf('0x29')]);}_0x21b7f9[_0x2cdf('0x63')]=qs[_0x2cdf('0x49')](_0x42532d['query'][_0x2cdf('0x49')]);_0x21b7f9[_0x2cdf('0x4c')]=qs['filters'](_[_0x2cdf('0x4a')](_0x42532d[_0x2cdf('0x42')],_0x5d125c[_0x2cdf('0x43')]));_0x21b7f9['where']['MailAccountId']=_0x4e52fc['id'];if(_0x42532d[_0x2cdf('0x42')][_0x2cdf('0x4b')]){_0x21b7f9['where']=_[_0x2cdf('0x4d')](_0x21b7f9[_0x2cdf('0x4c')],{'$or':_['map'](_0x21b7f9[_0x2cdf('0x46')],function(_0x4d56d2){var _0xd1c830={};_0xd1c830[_0x4d56d2]={'$like':'%'+_0x42532d['query'][_0x2cdf('0x4b')]+'%'};return _0xd1c830;})});}_0x21b7f9=_[_0x2cdf('0x4d')]({},_0x21b7f9,_0x42532d[_0x2cdf('0x52')]);return db[_0x2cdf('0x5f')][_0x2cdf('0x28')]({'where':_0x21b7f9['where']})[_0x2cdf('0x32')](function(_0x58dd24){_0x1ef84c[_0x2cdf('0x28')]=_0x58dd24;if(_0x42532d[_0x2cdf('0x42')][_0x2cdf('0x58')]){_0x21b7f9['include']=[{'all':!![]}];}return db[_0x2cdf('0x5f')]['findAll'](_0x21b7f9);})[_0x2cdf('0x32')](function(_0x3e7c10){_0x1ef84c[_0x2cdf('0x54')]=_0x3e7c10;return _0x1ef84c;});}})['then'](respondWithFilteredResult(_0x2f88b9,_0x21b7f9))['catch'](handleError(_0x2f88b9,null));};exports[_0x2cdf('0x64')]=function(_0x11450f,_0x459bf4,_0x1b985b){var _0x5934cc;return db['MailAccount']['find']({'where':{'id':_0x11450f[_0x2cdf('0x56')]['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0x459bf4,null))[_0x2cdf('0x32')](function(_0x340ae0){if(_0x340ae0){return _0x340ae0[_0x2cdf('0x64')](_0x11450f['query'][_0x2cdf('0x65')]);}})[_0x2cdf('0x32')](respondWithStatusCode(_0x459bf4,null))['catch'](handleError(_0x459bf4,null));};exports[_0x2cdf('0x66')]=function(_0x2f9ff1,_0x302a4c,_0x426ccb){if(_0x2f9ff1['body']['id']){delete _0x2f9ff1[_0x2cdf('0x5b')]['id'];}return db[_0x2cdf('0x3e')][_0x2cdf('0x5a')]({'where':{'id':_0x2f9ff1[_0x2cdf('0x56')]['id']}})['then'](handleEntityNotFound(_0x302a4c,null))[_0x2cdf('0x32')](function(_0x368f36){if(_0x368f36){_0x2f9ff1[_0x2cdf('0x5b')][_0x2cdf('0x5e')]=_0x368f36['id'];return db['CannedAnswer'][_0x2cdf('0x60')](_0x2f9ff1[_0x2cdf('0x5b')]);}})[_0x2cdf('0x32')](respondWithResult(_0x302a4c,null))[_0x2cdf('0x24')](handleError(_0x302a4c,null));};exports['getAnswers']=function(_0x4bdd13,_0x3fbb75,_0x285f42){var _0x2e6c4e={'raw':![],'where':{}};var _0x4fe5c2={};var _0x18eb7a={'count':0x0,'rows':[]};return db['MailAccount'][_0x2cdf('0x62')]({'where':{'id':_0x4bdd13[_0x2cdf('0x56')]['id']}})['then'](handleEntityNotFound(_0x3fbb75,null))[_0x2cdf('0x32')](function(_0x1ccfbf){if(_0x1ccfbf){_0x4fe5c2[_0x2cdf('0x40')]=_[_0x2cdf('0x41')](db['CannedAnswer'][_0x2cdf('0x3f')]);_0x4fe5c2['query']=_[_0x2cdf('0x41')](_0x4bdd13[_0x2cdf('0x42')]);_0x4fe5c2['filters']=_[_0x2cdf('0x44')](_0x4fe5c2[_0x2cdf('0x40')],_0x4fe5c2['query']);_0x2e6c4e[_0x2cdf('0x46')]=_['intersection'](_0x4fe5c2['model'],qs[_0x2cdf('0x45')](_0x4bdd13[_0x2cdf('0x42')][_0x2cdf('0x45')]));_0x2e6c4e[_0x2cdf('0x46')]=_0x2e6c4e[_0x2cdf('0x46')]['length']?_0x2e6c4e[_0x2cdf('0x46')]:_0x4fe5c2[_0x2cdf('0x40')];if(!_0x4bdd13['query']['hasOwnProperty']('nolimit')){_0x2e6c4e[_0x2cdf('0x2a')]=qs[_0x2cdf('0x2a')](_0x4bdd13[_0x2cdf('0x42')]['limit']);_0x2e6c4e['offset']=qs[_0x2cdf('0x29')](_0x4bdd13[_0x2cdf('0x42')][_0x2cdf('0x29')]);}_0x2e6c4e['order']=qs[_0x2cdf('0x49')](_0x4bdd13[_0x2cdf('0x42')][_0x2cdf('0x49')]);_0x2e6c4e['where']=qs['filters'](_['pick'](_0x4bdd13[_0x2cdf('0x42')],_0x4fe5c2[_0x2cdf('0x43')]));_0x2e6c4e[_0x2cdf('0x4c')][_0x2cdf('0x5e')]=_0x1ccfbf['id'];if(_0x4bdd13['query'][_0x2cdf('0x4b')]){_0x2e6c4e[_0x2cdf('0x4c')]=_[_0x2cdf('0x4d')](_0x2e6c4e[_0x2cdf('0x4c')],{'$or':_[_0x2cdf('0x67')](_0x2e6c4e[_0x2cdf('0x46')],function(_0x100e49){var _0x154acb={};_0x154acb[_0x100e49]={'$like':'%'+_0x4bdd13[_0x2cdf('0x42')]['filter']+'%'};return _0x154acb;})});}_0x2e6c4e=_[_0x2cdf('0x4d')]({},_0x2e6c4e,_0x4bdd13[_0x2cdf('0x52')]);return db[_0x2cdf('0x68')][_0x2cdf('0x28')]({'where':_0x2e6c4e[_0x2cdf('0x4c')]})[_0x2cdf('0x32')](function(_0x1b66a2){_0x18eb7a[_0x2cdf('0x28')]=_0x1b66a2;if(_0x4bdd13[_0x2cdf('0x42')][_0x2cdf('0x58')]){_0x2e6c4e[_0x2cdf('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2cdf('0x53')](_0x2e6c4e);})[_0x2cdf('0x32')](function(_0x37d3d9){_0x18eb7a[_0x2cdf('0x54')]=_0x37d3d9;return _0x18eb7a;});}})['then'](respondWithFilteredResult(_0x3fbb75,_0x2e6c4e))[_0x2cdf('0x24')](handleError(_0x3fbb75,null));};exports[_0x2cdf('0x69')]=function(_0x5d6136,_0x1b684a,_0x1f90ed){var _0x3f784d;return db['MailAccount'][_0x2cdf('0x5a')]({'where':{'id':_0x5d6136['params']['id']}})['then'](handleEntityNotFound(_0x1b684a,null))[_0x2cdf('0x32')](function(_0x16a641){if(_0x16a641){return _0x16a641['removeAnswers'](_0x5d6136[_0x2cdf('0x42')][_0x2cdf('0x65')]);}})[_0x2cdf('0x32')](respondWithStatusCode(_0x1b684a,null))[_0x2cdf('0x24')](handleError(_0x1b684a,null));};exports['create']=function(_0x13d59b,_0x3c6ece){var _0x1832d2={'name':_0x13d59b[_0x2cdf('0x5b')][_0x2cdf('0x36')],'key':_0x13d59b[_0x2cdf('0x5b')]['key'],'email':_0x13d59b[_0x2cdf('0x5b')][_0x2cdf('0x6a')],'ListId':_0x13d59b[_0x2cdf('0x5b')]['ListId'],'active':!_[_0x2cdf('0x6b')](_0x13d59b['body'][_0x2cdf('0x6c')])?_0x13d59b['body'][_0x2cdf('0x6c')]:!![],'description':_0x13d59b[_0x2cdf('0x5b')][_0x2cdf('0x6d')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x13d59b[_0x2cdf('0x5b')][_0x2cdf('0x6e')])){if(_0x13d59b[_0x2cdf('0x5b')][_0x2cdf('0x6f')]){_0x1832d2[_0x2cdf('0x39')]['user']=_0x1832d2[_0x2cdf('0x3b')]['user']=_0x13d59b[_0x2cdf('0x5b')][_0x2cdf('0x70')];_0x1832d2['Imap']['password']=_0x1832d2[_0x2cdf('0x3b')][_0x2cdf('0x71')]=_0x13d59b[_0x2cdf('0x5b')][_0x2cdf('0x72')];}else{_0x1832d2[_0x2cdf('0x39')][_0x2cdf('0x73')]=_0x1832d2['Smtp'][_0x2cdf('0x73')]=![];}_0x1832d2[_0x2cdf('0x39')][_0x2cdf('0x74')]=_0x13d59b[_0x2cdf('0x5b')][_0x2cdf('0x39')][_0x2cdf('0x74')];_0x1832d2['Imap'][_0x2cdf('0x75')]=_0x13d59b[_0x2cdf('0x5b')]['Imap'][_0x2cdf('0x75')];_0x1832d2[_0x2cdf('0x3b')][_0x2cdf('0x74')]=_0x13d59b[_0x2cdf('0x5b')][_0x2cdf('0x3b')][_0x2cdf('0x74')];_0x1832d2[_0x2cdf('0x3b')][_0x2cdf('0x75')]=_0x13d59b[_0x2cdf('0x5b')][_0x2cdf('0x3b')]['port'];}else{_0x1832d2['Imap'][_0x2cdf('0x76')]=_0x1832d2['Smtp']['service']=_0x13d59b['body'][_0x2cdf('0x6e')];_0x1832d2['Imap'][_0x2cdf('0x77')]=_0x1832d2[_0x2cdf('0x3b')]['user']=_0x13d59b['body']['cuser'];_0x1832d2[_0x2cdf('0x39')][_0x2cdf('0x78')]=_0x1832d2[_0x2cdf('0x3b')][_0x2cdf('0x71')]=_0x13d59b['body'][_0x2cdf('0x72')];}return db[_0x2cdf('0x3e')][_0x2cdf('0x60')](_0x1832d2,{'include':[{'model':db[_0x2cdf('0x3a')],'as':_0x2cdf('0x3b')},{'model':db[_0x2cdf('0x57')],'as':'Imap'}]})[_0x2cdf('0x32')](function(_0x1e9da3){var _0x1a5d0d=_0x13d59b[_0x2cdf('0x77')][_0x2cdf('0x33')]({'plain':!![]});if(!_0x1a5d0d)throw new Error(_0x2cdf('0x79'));if(_0x1a5d0d[_0x2cdf('0x7a')]===_0x2cdf('0x77')){var _0x4a3aac=_0x1e9da3[_0x2cdf('0x33')]({'plain':!![]});return db[_0x2cdf('0x7b')][_0x2cdf('0x5a')]({'where':{'name':_0x2cdf('0x7c'),'userProfileId':_0x1a5d0d[_0x2cdf('0x7d')]},'raw':!![]})[_0x2cdf('0x32')](function(_0x3e0e79){if(_0x3e0e79&&_0x3e0e79['autoAssociation']===0x0){return db[_0x2cdf('0x34')][_0x2cdf('0x60')]({'name':_0x4a3aac['name'],'resourceId':_0x4a3aac['id'],'type':_0x3e0e79[_0x2cdf('0x36')],'sectionId':_0x3e0e79['id']},{})[_0x2cdf('0x32')](function(){return _0x1e9da3;});}else{return _0x1e9da3;}})[_0x2cdf('0x24')](function(_0x13e0ee){logger[_0x2cdf('0x1f')](_0x2cdf('0x7e'),_0x13e0ee);throw _0x13e0ee;});}return _0x1e9da3;})[_0x2cdf('0x32')](respondWithResult(_0x3c6ece,0xc9))[_0x2cdf('0x24')](handleError(_0x3c6ece,null));};exports[_0x2cdf('0x7f')]=function(_0x17670b,_0x15b783,_0x5e9dde){return db['MailAccount'][_0x2cdf('0x62')]({'where':{'id':_0x17670b[_0x2cdf('0x56')]['id']}})['then'](handleEntityNotFound(_0x15b783,null))[_0x2cdf('0x32')](function(_0xdbbd7){if(_0xdbbd7){return _0xdbbd7[_0x2cdf('0x7f')]();}return null;})[_0x2cdf('0x32')](respondWithResult(_0x15b783,null))[_0x2cdf('0x24')](handleError(_0x15b783,null));};exports[_0x2cdf('0x80')]=function(_0x27aabb,_0x179890,_0x16d585){if(_0x27aabb[_0x2cdf('0x5b')]['id']){delete _0x27aabb[_0x2cdf('0x5b')]['id'];}return db[_0x2cdf('0x3e')][_0x2cdf('0x5a')]({'where':{'id':_0x27aabb[_0x2cdf('0x56')]['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0x179890,null))[_0x2cdf('0x32')](function(_0x26733d){if(_0x26733d){_0x27aabb[_0x2cdf('0x5b')][_0x2cdf('0x5e')]=_0x26733d['id'];return db[_0x2cdf('0x57')]['create'](_0x27aabb[_0x2cdf('0x5b')]);}})[_0x2cdf('0x32')](respondWithResult(_0x179890,null))[_0x2cdf('0x24')](handleError(_0x179890,null));};exports[_0x2cdf('0x81')]=function(_0x2542ba,_0x5134e2,_0x2ca741){return db['MailAccount'][_0x2cdf('0x62')]({'where':{'id':_0x2542ba['params']['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0x5134e2,null))['then'](function(_0x29bda3){if(_0x29bda3){return _0x29bda3['setImap'](null);}return null;})[_0x2cdf('0x32')](respondWithStatusCode(_0x5134e2,null))[_0x2cdf('0x24')](handleError(_0x5134e2,null));};exports['getSmtp']=function(_0x402565,_0x587d1b,_0x23c2b6){return db[_0x2cdf('0x3e')][_0x2cdf('0x62')]({'where':{'id':_0x402565['params']['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0x587d1b,null))['then'](function(_0x4f5be8){if(_0x4f5be8){return _0x4f5be8['getSmtp']();}return null;})['then'](respondWithResult(_0x587d1b,null))['catch'](handleError(_0x587d1b,null));};exports[_0x2cdf('0x82')]=function(_0x997d8e,_0x66c18a,_0x21d6e4){if(_0x997d8e[_0x2cdf('0x5b')]['id']){delete _0x997d8e[_0x2cdf('0x5b')]['id'];}return db[_0x2cdf('0x3e')]['find']({'where':{'id':_0x997d8e[_0x2cdf('0x56')]['id']}})['then'](handleEntityNotFound(_0x66c18a,null))[_0x2cdf('0x32')](function(_0x1b831e){if(_0x1b831e){_0x997d8e['body'][_0x2cdf('0x5e')]=_0x1b831e['id'];return db[_0x2cdf('0x3a')][_0x2cdf('0x60')](_0x997d8e[_0x2cdf('0x5b')]);}})[_0x2cdf('0x32')](respondWithResult(_0x66c18a,null))[_0x2cdf('0x24')](handleError(_0x66c18a,null));};exports[_0x2cdf('0x83')]=function(_0x3c8a9b,_0x57ffb3,_0x320eee){return db[_0x2cdf('0x3e')][_0x2cdf('0x62')]({'where':{'id':_0x3c8a9b['params']['id']}})['then'](handleEntityNotFound(_0x57ffb3,null))[_0x2cdf('0x32')](function(_0x62bc93){if(_0x62bc93){return _0x62bc93[_0x2cdf('0x84')](null);}return null;})[_0x2cdf('0x32')](respondWithStatusCode(_0x57ffb3,null))[_0x2cdf('0x24')](handleError(_0x57ffb3,null));};exports['addInteraction']=function(_0x27781e,_0x510290,_0x4a99cf){return db['MailInteraction'][_0x2cdf('0x5a')]({'where':{'id':_0x27781e['params']['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0x510290,null))['then'](function(_0x222b8c){if(_0x222b8c){return _0x222b8c[_0x2cdf('0x85')](_0x27781e[_0x2cdf('0x5b')]['ids'],_[_0x2cdf('0x86')](_0x27781e[_0x2cdf('0x5b')],[_0x2cdf('0x65'),'id'])||{});}})[_0x2cdf('0x32')](respondWithResult(_0x510290,null))[_0x2cdf('0x24')](handleError(_0x510290,null));};exports[_0x2cdf('0x87')]=function(_0x3951bf,_0x51fbde,_0xb70ffc){var _0xc51ffe={'raw':![],'where':{}};var _0x44f967={};var _0x779ce5={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x3951bf[_0x2cdf('0x56')]['id']}})['then'](handleEntityNotFound(_0x51fbde,null))[_0x2cdf('0x32')](function(_0x8e8305){if(_0x8e8305){_0x44f967[_0x2cdf('0x40')]=_[_0x2cdf('0x41')](db['MailInteraction'][_0x2cdf('0x3f')]);_0x44f967['query']=_[_0x2cdf('0x41')](_0x3951bf[_0x2cdf('0x42')]);_0x44f967[_0x2cdf('0x43')]=_[_0x2cdf('0x44')](_0x44f967['model'],_0x44f967['query']);_0xc51ffe[_0x2cdf('0x46')]=_['intersection'](_0x44f967[_0x2cdf('0x40')],qs['fields'](_0x3951bf[_0x2cdf('0x42')][_0x2cdf('0x45')]));_0xc51ffe[_0x2cdf('0x46')]=_0xc51ffe[_0x2cdf('0x46')][_0x2cdf('0x47')]?_0xc51ffe['attributes']:_0x44f967[_0x2cdf('0x40')];if(!_0x3951bf['query'][_0x2cdf('0x88')](_0x2cdf('0x48'))){_0xc51ffe[_0x2cdf('0x2a')]=qs[_0x2cdf('0x2a')](_0x3951bf[_0x2cdf('0x42')][_0x2cdf('0x2a')]);_0xc51ffe[_0x2cdf('0x29')]=qs['offset'](_0x3951bf[_0x2cdf('0x42')][_0x2cdf('0x29')]);}_0xc51ffe[_0x2cdf('0x63')]=qs[_0x2cdf('0x49')](_0x3951bf[_0x2cdf('0x42')][_0x2cdf('0x49')]);_0xc51ffe[_0x2cdf('0x4c')]=qs[_0x2cdf('0x43')](_[_0x2cdf('0x4a')](_0x3951bf[_0x2cdf('0x42')],_0x44f967['filters']));_0xc51ffe[_0x2cdf('0x4c')][_0x2cdf('0x5e')]=_0x8e8305['id'];if(_0x3951bf[_0x2cdf('0x42')][_0x2cdf('0x4b')]){_0xc51ffe['where']=_[_0x2cdf('0x4d')](_0xc51ffe[_0x2cdf('0x4c')],{'$or':_[_0x2cdf('0x67')](_0xc51ffe[_0x2cdf('0x46')],function(_0x413e5a){var _0x3042ce={};_0x3042ce[_0x413e5a]={'$like':'%'+_0x3951bf[_0x2cdf('0x42')][_0x2cdf('0x4b')]+'%'};return _0x3042ce;})});}_0xc51ffe=_[_0x2cdf('0x4d')]({},_0xc51ffe,_0x3951bf[_0x2cdf('0x52')]);return db[_0x2cdf('0x89')]['count']({'where':_0xc51ffe[_0x2cdf('0x4c')]})[_0x2cdf('0x32')](function(_0x5b276f){_0x779ce5[_0x2cdf('0x28')]=_0x5b276f;if(_0x3951bf[_0x2cdf('0x42')][_0x2cdf('0x58')]){_0xc51ffe['include']=[{'model':db[_0x2cdf('0x8a')],'as':_0x2cdf('0x8b'),'required':![]},{'model':db[_0x2cdf('0x8c')],'as':'Owner','attributes':[_0x2cdf('0x36'),_0x2cdf('0x8d'),_0x2cdf('0x8e')],'required':![]},{'model':db[_0x2cdf('0x8f')],'as':_0x2cdf('0x90'),'attributes':['id',_0x2cdf('0x36'),_0x2cdf('0x91')],'where':_0x3951bf[_0x2cdf('0x42')][_0x2cdf('0x92')]?{'id':_0x3951bf[_0x2cdf('0x42')]['tag']}:undefined,'required':_0x3951bf[_0x2cdf('0x42')]['tag']?!![]:![]}];}return db[_0x2cdf('0x89')][_0x2cdf('0x53')](_0xc51ffe);})[_0x2cdf('0x32')](function(_0x5a9e29){_0x779ce5['rows']=_0x5a9e29;return _0x779ce5;});}})[_0x2cdf('0x32')](respondWithFilteredResult(_0x51fbde,_0xc51ffe))[_0x2cdf('0x24')](handleError(_0x51fbde,null));};exports[_0x2cdf('0x93')]=function(_0x5ce14a,_0xf20878,_0x2da95f){return db['MailAccount'][_0x2cdf('0x62')]({'where':{'id':_0x5ce14a[_0x2cdf('0x56')]['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0xf20878,null))[_0x2cdf('0x32')](function(_0x29a5b){if(_0x29a5b){return db[_0x2cdf('0x94')]['transaction'](function(_0x41d9f0){return db[_0x2cdf('0x95')][_0x2cdf('0x31')]({'where':{'MailAccountId':_0x5ce14a[_0x2cdf('0x56')]['id']},'transaction':_0x41d9f0})[_0x2cdf('0x32')](function(_0x119160){var _0x417c16=_[_0x2cdf('0x67')](_0x5ce14a[_0x2cdf('0x5b')],function(_0x1b96a8){_0x1b96a8['MailAccountId']=_0x5ce14a[_0x2cdf('0x56')]['id'];return _0x1b96a8;});return db[_0x2cdf('0x95')][_0x2cdf('0x96')](_0x417c16,{'transaction':_0x41d9f0});});})[_0x2cdf('0x32')](function(){return db[_0x2cdf('0x95')][_0x2cdf('0x97')]({'where':{'MailAccountId':_0x5ce14a[_0x2cdf('0x56')]['id']},'order':_0x2cdf('0x98')});});}})[_0x2cdf('0x32')](respondWithResult(_0xf20878,null))[_0x2cdf('0x24')](handleError(_0xf20878,null));};exports[_0x2cdf('0x99')]=function(_0x3db4b7,_0x21180d,_0x4be667){var _0x44de7b={};var _0x18ea44={};var _0x4c73b1;var _0xdf4da8;return db['MailAccount'][_0x2cdf('0x62')]({'where':{'id':_0x3db4b7['params']['id']}})['then'](handleEntityNotFound(_0x21180d,null))[_0x2cdf('0x32')](function(_0x49b3b7){if(_0x49b3b7){_0x4c73b1=_0x49b3b7;_0x18ea44['model']=_['keys'](db[_0x2cdf('0x95')][_0x2cdf('0x3f')]);_0x18ea44[_0x2cdf('0x42')]=_[_0x2cdf('0x41')](_0x3db4b7[_0x2cdf('0x42')]);_0x18ea44[_0x2cdf('0x43')]=_[_0x2cdf('0x44')](_0x18ea44[_0x2cdf('0x40')],_0x18ea44[_0x2cdf('0x42')]);_0x44de7b[_0x2cdf('0x46')]=_[_0x2cdf('0x44')](_0x18ea44[_0x2cdf('0x40')],qs[_0x2cdf('0x45')](_0x3db4b7[_0x2cdf('0x42')][_0x2cdf('0x45')]));_0x44de7b[_0x2cdf('0x46')]=_0x44de7b[_0x2cdf('0x46')][_0x2cdf('0x47')]?_0x44de7b[_0x2cdf('0x46')]:_0x18ea44[_0x2cdf('0x40')];_0x44de7b[_0x2cdf('0x63')]=qs[_0x2cdf('0x49')](_0x3db4b7[_0x2cdf('0x42')][_0x2cdf('0x49')]);_0x44de7b[_0x2cdf('0x4c')]=qs[_0x2cdf('0x43')](_['pick'](_0x3db4b7[_0x2cdf('0x42')],_0x18ea44[_0x2cdf('0x43')]));if(_0x3db4b7[_0x2cdf('0x42')][_0x2cdf('0x4b')]){_0x44de7b[_0x2cdf('0x4c')]=_[_0x2cdf('0x4d')](_0x44de7b['where'],{'$or':_[_0x2cdf('0x67')](_0x44de7b[_0x2cdf('0x46')],function(_0x4fd774){var _0x44b25a={};_0x44b25a[_0x4fd774]={'$like':'%'+_0x3db4b7['query'][_0x2cdf('0x4b')]+'%'};return _0x44b25a;})});}_0x44de7b=_['merge']({},_0x44de7b,_0x3db4b7[_0x2cdf('0x52')]);return _0x4c73b1['getApplications'](_0x44de7b);}})[_0x2cdf('0x32')](function(_0x16f2b6){if(_0x16f2b6){_0xdf4da8=_0x16f2b6['length'];if(!_0x3db4b7['query'][_0x2cdf('0x88')](_0x2cdf('0x48'))){_0x44de7b['limit']=qs[_0x2cdf('0x2a')](_0x3db4b7[_0x2cdf('0x42')]['limit']);_0x44de7b[_0x2cdf('0x29')]=qs[_0x2cdf('0x29')](_0x3db4b7[_0x2cdf('0x42')][_0x2cdf('0x29')]);}return _0x4c73b1[_0x2cdf('0x99')](_0x44de7b);}})[_0x2cdf('0x32')](function(_0x377971){if(_0x377971){return _0x377971?{'count':_0xdf4da8,'rows':_0x377971}:null;}})[_0x2cdf('0x32')](respondWithResult(_0x21180d,null))['catch'](handleError(_0x21180d,null));};exports[_0x2cdf('0x9a')]=function(_0x273a49,_0xf75562,_0x3f9178){var _0xb30279={'raw':!![],'where':{}};var _0x42162e={};var _0x582ac8={'count':0x0,'rows':[]};return db[_0x2cdf('0x3e')][_0x2cdf('0x62')]({'where':{'id':_0x273a49[_0x2cdf('0x56')]['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0xf75562,null))[_0x2cdf('0x32')](function(_0x45886b){if(_0x45886b){_0x42162e[_0x2cdf('0x40')]=_[_0x2cdf('0x41')](db[_0x2cdf('0x9b')][_0x2cdf('0x3f')]);_0x42162e[_0x2cdf('0x42')]=_['keys'](_0x273a49[_0x2cdf('0x42')]);_0x42162e[_0x2cdf('0x43')]=_[_0x2cdf('0x44')](_0x42162e['model'],_0x42162e[_0x2cdf('0x42')]);_0xb30279['attributes']=_['intersection'](_0x42162e[_0x2cdf('0x40')],qs[_0x2cdf('0x45')](_0x273a49[_0x2cdf('0x42')]['fields']));_0xb30279[_0x2cdf('0x46')]=_0xb30279['attributes'][_0x2cdf('0x47')]?_0xb30279[_0x2cdf('0x46')]:_0x42162e[_0x2cdf('0x40')];if(!_0x273a49[_0x2cdf('0x42')]['hasOwnProperty'](_0x2cdf('0x48'))){_0xb30279['limit']=qs[_0x2cdf('0x2a')](_0x273a49[_0x2cdf('0x42')][_0x2cdf('0x2a')]);_0xb30279['offset']=qs[_0x2cdf('0x29')](_0x273a49[_0x2cdf('0x42')][_0x2cdf('0x29')]);}_0xb30279[_0x2cdf('0x63')]=qs[_0x2cdf('0x49')](_0x273a49[_0x2cdf('0x42')]['sort']);_0xb30279[_0x2cdf('0x4c')]=qs[_0x2cdf('0x43')](_[_0x2cdf('0x4a')](_0x273a49[_0x2cdf('0x42')],_0x42162e['filters']));_0xb30279['where'][_0x2cdf('0x5e')]=_0x45886b['id'];if(_0x273a49[_0x2cdf('0x42')][_0x2cdf('0x4b')]){_0xb30279[_0x2cdf('0x4c')]=_[_0x2cdf('0x4d')](_0xb30279[_0x2cdf('0x4c')],{'$or':_['map'](_0xb30279[_0x2cdf('0x46')],function(_0x3a72b8){var _0x557786={};_0x557786[_0x3a72b8]={'$like':'%'+_0x273a49[_0x2cdf('0x42')][_0x2cdf('0x4b')]+'%'};return _0x557786;})});}if(_0x273a49['query']['$gte']){var _0x691431=_0x273a49[_0x2cdf('0x42')][_0x2cdf('0x9c')][_0x2cdf('0x9d')](',');var _0x347024={};_0x347024[_0x691431[0x0]]={'$gte':moment(_0x691431[0x1])[_0x2cdf('0x9e')](_0x2cdf('0x9f'))};_0xb30279[_0x2cdf('0x4c')]=_[_0x2cdf('0x4d')](_0xb30279[_0x2cdf('0x4c')],_0x347024);}_0xb30279=_[_0x2cdf('0x4d')]({},_0xb30279,_0x273a49[_0x2cdf('0x52')]);return db[_0x2cdf('0x9b')][_0x2cdf('0x28')]({'where':_0xb30279[_0x2cdf('0x4c')]})[_0x2cdf('0x32')](function(_0x314a8b){_0x582ac8[_0x2cdf('0x28')]=_0x314a8b;if(_0x273a49[_0x2cdf('0x42')]['includeAll']){_0xb30279[_0x2cdf('0x59')]=[{'all':!![]}];}return db[_0x2cdf('0x9b')][_0x2cdf('0x53')](_0xb30279);})[_0x2cdf('0x32')](function(_0x56840b){_0x582ac8[_0x2cdf('0x54')]=_0x56840b;return _0x582ac8;});}})[_0x2cdf('0x32')](respondWithFilteredResult(_0xf75562,_0xb30279))['catch'](handleError(_0xf75562,null));};exports[_0x2cdf('0x37')]=function(_0x455383,_0x75a169,_0x49e579){var _0x2e5aea,_0x18424d={},_0x27efff;if(_0x455383[_0x2cdf('0x5b')]['to']){_0x27efff=_0x455383['body']['to'][_0x2cdf('0x9d')](',')[0x0];}return db[_0x2cdf('0x3e')][_0x2cdf('0x5a')]({'where':{'id':_0x455383['params']['id']},'include':[{'model':db[_0x2cdf('0xa0')],'as':_0x2cdf('0xa1'),'include':[{'model':db[_0x2cdf('0x8a')],'as':'Contacts','where':{'email':_0x27efff},'limit':0x1,'order':[['updatedAt',_0x2cdf('0xa2')]]}]},{'model':db[_0x2cdf('0x3a')],'as':_0x2cdf('0x3b'),'raw':!![]}]})[_0x2cdf('0x32')](handleEntityNotFound(_0x75a169,null))[_0x2cdf('0x32')](function(_0x126c63){if(_0x126c63){_0x2e5aea=_0x126c63;if(_0x126c63[_0x2cdf('0x3b')]){if(_['isNil'](_0x455383[_0x2cdf('0x5b')][_0x2cdf('0xa3')])){_0x455383[_0x2cdf('0x5b')][_0x2cdf('0xa3')]=util[_0x2cdf('0x9e')](_0x2cdf('0xa4'),_0x126c63[_0x2cdf('0x36')],_0x126c63[_0x2cdf('0x6a')]||_0x126c63[_0x2cdf('0x3b')][_0x2cdf('0x77')]);}if(_0x455383[_0x2cdf('0x5b')][_0x2cdf('0xa5')]&&_0x455383[_0x2cdf('0x5b')][_0x2cdf('0xa5')][_0x2cdf('0x47')]){for(var _0xfa9043=0x0;_0xfa9043<_0x455383[_0x2cdf('0x5b')][_0x2cdf('0xa5')][_0x2cdf('0x47')];_0xfa9043+=0x1){_0x455383['body'][_0x2cdf('0xa5')][_0xfa9043]={'filename':_0x455383[_0x2cdf('0x5b')][_0x2cdf('0xa5')][_0xfa9043][_0x2cdf('0x36')],'path':path['join'](config[_0x2cdf('0xa6')],_0x2cdf('0xa7'),_0x455383['body'][_0x2cdf('0xa5')][_0xfa9043][_0x2cdf('0xa8')])};}}var _0x30e55e={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x126c63[_0x2cdf('0x3b')][_0x2cdf('0x76')])){if(_0x126c63[_0x2cdf('0x3b')]['authentication']){_0x30e55e[_0x2cdf('0xa9')]={'user':_0x126c63[_0x2cdf('0x3b')][_0x2cdf('0x77')],'pass':_0x126c63[_0x2cdf('0x3b')]['pass']};}_0x30e55e[_0x2cdf('0x74')]=_0x126c63[_0x2cdf('0x3b')]['host'];_0x30e55e['port']=_0x126c63[_0x2cdf('0x3b')][_0x2cdf('0x75')];_0x30e55e[_0x2cdf('0xaa')]=_0x126c63['Smtp'][_0x2cdf('0xaa')];}else{_0x30e55e[_0x2cdf('0x76')]=_0x126c63[_0x2cdf('0x3b')][_0x2cdf('0x76')];_0x30e55e[_0x2cdf('0xa9')]={'user':_0x126c63[_0x2cdf('0x3b')]['user'],'pass':_0x126c63[_0x2cdf('0x3b')][_0x2cdf('0x71')]};}return respondWithRpcPromise('SendMail',_0x2cdf('0xab'),{'account':_0x30e55e,'message':_0x455383['body']});}else{throw new Error(_0x2cdf('0xac'));}}})[_0x2cdf('0x32')](function(_0xb8886f){if(_0xb8886f){_0x18424d=_0xb8886f;if(_0x2e5aea[_0x2cdf('0xa1')]){if(_0x2e5aea[_0x2cdf('0xa1')][_0x2cdf('0xad')]['length']){return _0x2e5aea['List']['Contacts'][0x0];}else{return db[_0x2cdf('0x8a')][_0x2cdf('0x60')](_[_0x2cdf('0xae')](_0x455383[_0x2cdf('0x5b')],{'firstName':_0x455383['body']['to'],'email':_0x455383[_0x2cdf('0x5b')]['to'],'phone':_0x455383[_0x2cdf('0x5b')]['to'],'ListId':_0x2e5aea['ListId']}));}}else{throw new Error(_0x2cdf('0xac'));}}})[_0x2cdf('0x32')](function(_0x33eda6){if(_0x33eda6){var _0x220067={'UserId':_0x455383[_0x2cdf('0x77')]['id'],'ContactId':_0x33eda6['id'],'MailAccountId':_0x2e5aea['id'],'inReplyTo':_0x18424d[_0x2cdf('0xaf')],'to':_0x455383[_0x2cdf('0x5b')][_0x2cdf('0xa3')],'cc':_0x455383[_0x2cdf('0x5b')]['cc'],'subject':_0x455383[_0x2cdf('0x5b')][_0x2cdf('0xb0')],'attach':_0x455383[_0x2cdf('0x5b')][_0x2cdf('0xb1')],'firstMsgDirection':'out','lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','lastMsgBody':_0x455383[_0x2cdf('0x5b')][_0x2cdf('0x5b')],'Messages':[_[_0x2cdf('0x4d')](_0x455383['body'],{'messageId':_0x18424d[_0x2cdf('0xaf')],'sentAt':moment()[_0x2cdf('0x9e')](_0x2cdf('0x9f')),'read':!![],'MailAccountId':_0x2e5aea['id'],'UserId':_0x455383['user']['id'],'ContactId':_0x33eda6['id']})]};if(_0x455383[_0x2cdf('0x5b')]['Interaction']){_0x220067=_['merge'](_0x220067,_0x455383[_0x2cdf('0x5b')]['Interaction']);}return db[_0x2cdf('0x89')][_0x2cdf('0x60')](_0x220067,{'include':[{'model':db[_0x2cdf('0x9b')],'as':_0x2cdf('0xb2')}]});}})['then'](respondWithResult(_0x75a169,null))[_0x2cdf('0x24')](handleError(_0x75a169,null));};exports[_0x2cdf('0xb3')]=function(_0x15eedb,_0x42eae2,_0x3eb2ac){return db[_0x2cdf('0x3e')][_0x2cdf('0x5a')]({'where':{'id':_0x15eedb[_0x2cdf('0x56')]['id']},'include':[{'model':db[_0x2cdf('0x3a')],'as':'Smtp','raw':!![]}]})[_0x2cdf('0x32')](handleEntityNotFound(_0x42eae2,null))[_0x2cdf('0x32')](function(_0x6766f5){if(_0x6766f5&&_0x6766f5[_0x2cdf('0x3b')]){var _0x99cc37={'id':_0x6766f5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x6766f5[_0x2cdf('0x3b')]['service']){_0x99cc37[_0x2cdf('0x76')]=_0x6766f5['Smtp']['service'];}else{_0x99cc37[_0x2cdf('0x74')]=_0x6766f5[_0x2cdf('0x3b')][_0x2cdf('0x74')];_0x99cc37[_0x2cdf('0x75')]=_0x6766f5[_0x2cdf('0x3b')][_0x2cdf('0x75')];_0x99cc37[_0x2cdf('0xaa')]=_0x6766f5['Smtp'][_0x2cdf('0xaa')];}if(_0x6766f5[_0x2cdf('0x3b')][_0x2cdf('0x73')]){_0x99cc37[_0x2cdf('0xa9')]={'user':_0x6766f5[_0x2cdf('0x3b')]['user'],'pass':_0x6766f5[_0x2cdf('0x3b')][_0x2cdf('0x71')]};}return respondWithRpcPromise('VerifySmtp',_0x2cdf('0xb3'),{'account':_0x99cc37});}})[_0x2cdf('0x32')](respondWithResult(_0x42eae2,null))[_0x2cdf('0x24')](handleError(_0x42eae2,null));};exports[_0x2cdf('0x31')]=function(_0x2a5ff8,_0x129ada){return db['MailAccount'][_0x2cdf('0x5a')]({'where':{'id':_0x2a5ff8[_0x2cdf('0x56')]['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0x129ada,null))[_0x2cdf('0x32')](function(_0x5f4917){if(_0x5f4917&&_0x5f4917[_0x2cdf('0x76')]){throw new db[(_0x2cdf('0xb4'))][(_0x2cdf('0xb5'))](_0x2cdf('0xb6'));}return _0x5f4917;})[_0x2cdf('0x32')](removeEntity(_0x129ada,null))[_0x2cdf('0x24')](handleError(_0x129ada,null));};exports['addAgents']=function(_0x58a2d5,_0x5d4d22,_0x4b97cd){return db[_0x2cdf('0x3e')]['find']({'where':{'id':_0x58a2d5[_0x2cdf('0x56')]['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0x5d4d22,null))[_0x2cdf('0x32')](function(_0x30e802){if(_0x30e802){return _0x30e802['addAgents'](_0x58a2d5[_0x2cdf('0x5b')][_0x2cdf('0x65')],_[_0x2cdf('0x86')](_0x58a2d5['body'],[_0x2cdf('0x65'),'id'])||{})[_0x2cdf('0xb7')](function(_0xd02b19){for(var _0x5e5506=0x0;_0x5e5506<_0x58a2d5['body'][_0x2cdf('0x65')][_0x2cdf('0x47')];_0x5e5506+=0x1){socket['emit'](_0x2cdf('0xb8'),{'UserId':_0x58a2d5[_0x2cdf('0x5b')][_0x2cdf('0x65')][_0x5e5506],'MailAccountId':_0x58a2d5[_0x2cdf('0x56')]['id']});}return _0xd02b19;});}})[_0x2cdf('0x32')](respondWithResult(_0x5d4d22,null))[_0x2cdf('0x24')](handleError(_0x5d4d22,null));};exports[_0x2cdf('0xb9')]=function(_0x46c7e6,_0x304d03,_0x3b24c3){var _0x1442d1;return db[_0x2cdf('0x3e')][_0x2cdf('0x5a')]({'where':{'id':_0x46c7e6[_0x2cdf('0x56')]['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0x304d03,null))[_0x2cdf('0x32')](function(_0x4dae41){if(_0x4dae41){return _0x4dae41[_0x2cdf('0xb9')](_0x46c7e6[_0x2cdf('0x42')][_0x2cdf('0x65')])['then'](function(_0x15cb64){if(_[_0x2cdf('0xba')](_0x46c7e6[_0x2cdf('0x42')]['ids'])){for(var _0xa7f0b5=0x0;_0xa7f0b5<_0x46c7e6[_0x2cdf('0x42')][_0x2cdf('0x65')]['length'];_0xa7f0b5+=0x1){socket[_0x2cdf('0xbb')](_0x2cdf('0xbc'),{'UserId':_0x46c7e6[_0x2cdf('0x42')][_0x2cdf('0x65')][_0xa7f0b5],'MailAccountId':_0x46c7e6[_0x2cdf('0x56')]['id']});}}else{socket[_0x2cdf('0xbb')](_0x2cdf('0xbc'),{'UserId':_0x46c7e6[_0x2cdf('0x42')][_0x2cdf('0x65')],'MailAccountId':_0x46c7e6['params']['id']});}});}})[_0x2cdf('0x32')](respondWithStatusCode(_0x304d03,null))[_0x2cdf('0x24')](handleError(_0x304d03,null));};exports[_0x2cdf('0xbd')]=function(_0x3f0343,_0x1cb70e,_0x1d9de8){var _0x10f8d1={};var _0x41097c={};var _0x111f67;var _0x302466;return db[_0x2cdf('0x3e')][_0x2cdf('0x62')]({'where':{'id':_0x3f0343[_0x2cdf('0x56')]['id']}})[_0x2cdf('0x32')](handleEntityNotFound(_0x1cb70e,null))[_0x2cdf('0x32')](function(_0x4bff21){if(_0x4bff21){_0x111f67=_0x4bff21;_0x41097c[_0x2cdf('0x40')]=_[_0x2cdf('0x41')](db[_0x2cdf('0x8c')][_0x2cdf('0x3f')]);_0x41097c['query']=_['keys'](_0x3f0343[_0x2cdf('0x42')]);_0x41097c[_0x2cdf('0x43')]=_[_0x2cdf('0x44')](_0x41097c[_0x2cdf('0x40')],_0x41097c['query']);_0x10f8d1[_0x2cdf('0x46')]=_[_0x2cdf('0x44')](_0x41097c[_0x2cdf('0x40')],qs[_0x2cdf('0x45')](_0x3f0343['query'][_0x2cdf('0x45')]));_0x10f8d1[_0x2cdf('0x46')]=_0x10f8d1['attributes'][_0x2cdf('0x47')]?_0x10f8d1['attributes']:_0x41097c['model'];_0x10f8d1[_0x2cdf('0x63')]=qs[_0x2cdf('0x49')](_0x3f0343['query'][_0x2cdf('0x49')]);_0x10f8d1[_0x2cdf('0x4c')]=qs[_0x2cdf('0x43')](_[_0x2cdf('0x4a')](_0x3f0343[_0x2cdf('0x42')],_0x41097c[_0x2cdf('0x43')]));if(_0x3f0343['query']['filter']){_0x10f8d1[_0x2cdf('0x4c')]=_[_0x2cdf('0x4d')](_0x10f8d1['where'],{'$or':_[_0x2cdf('0x67')](_0x10f8d1[_0x2cdf('0x46')],function(_0x30b4d3){var _0x3a88c8={};_0x3a88c8[_0x30b4d3]={'$like':'%'+_0x3f0343[_0x2cdf('0x42')][_0x2cdf('0x4b')]+'%'};return _0x3a88c8;})});}_0x10f8d1=_[_0x2cdf('0x4d')]({},_0x10f8d1,_0x3f0343[_0x2cdf('0x52')]);return _0x111f67[_0x2cdf('0xbd')](_0x10f8d1);}})[_0x2cdf('0x32')](function(_0x150889){if(_0x150889){_0x302466=_0x150889[_0x2cdf('0x47')];if(!_0x3f0343['query'][_0x2cdf('0x88')](_0x2cdf('0x48'))){_0x10f8d1['limit']=qs[_0x2cdf('0x2a')](_0x3f0343['query'][_0x2cdf('0x2a')]);_0x10f8d1['offset']=qs['offset'](_0x3f0343[_0x2cdf('0x42')]['offset']);}return _0x111f67['getAgents'](_0x10f8d1);}})['then'](function(_0x540904){if(_0x540904){return _0x540904?{'count':_0x302466,'rows':_0x540904}:null;}})[_0x2cdf('0x32')](respondWithResult(_0x1cb70e,null))[_0x2cdf('0x24')](handleError(_0x1cb70e,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 44471e8..09b750c 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 _0xb5f5=['MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x443316,_0x286c90){var _0x187fed=function(_0x235740){while(--_0x235740){_0x443316['push'](_0x443316['shift']());}};_0x187fed(++_0x286c90);}(_0xb5f5,0x7f));var _0x5b5f=function(_0x48385f,_0x3d7bd9){_0x48385f=_0x48385f-0x0;var _0x2de191=_0xb5f5[_0x48385f];return _0x2de191;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x5b5f('0x0'))['db'][_0x5b5f('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x5b5f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5b5f('0x3'),'afterDestroy':_0x5b5f('0x4')};function emitEvent(_0x3d6371){return function(_0x5dbbe3,_0x1c668b,_0x366c1b){MailAccountEvents[_0x5b5f('0x5')](_0x3d6371+':'+_0x5dbbe3['id'],_0x5dbbe3);MailAccountEvents[_0x5b5f('0x5')](_0x3d6371,_0x5dbbe3);_0x366c1b(null);};}for(var e in events){if(events[_0x5b5f('0x6')](e)){var event=events[e];MailAccount[_0x5b5f('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x4be1=['save','remove','hasOwnProperty','hook','exports','MailAccount','setMaxListeners'];(function(_0x476bca,_0x451471){var _0x1e7350=function(_0x45d6a9){while(--_0x45d6a9){_0x476bca['push'](_0x476bca['shift']());}};_0x1e7350(++_0x451471);}(_0x4be1,0x1a9));var _0x14be=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x4be1[_0x555b2f];return _0x81c0a6;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x14be('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x14be('0x1')](0x0);var events={'afterCreate':_0x14be('0x2'),'afterUpdate':'update','afterDestroy':_0x14be('0x3')};function emitEvent(_0x46cc93){return function(_0x1d0826,_0x4841f5,_0x2f954f){MailAccountEvents['emit'](_0x46cc93+':'+_0x1d0826['id'],_0x1d0826);MailAccountEvents['emit'](_0x46cc93,_0x1d0826);_0x2f954f(null);};}for(var e in events){if(events[_0x14be('0x4')](e)){var event=events[e];MailAccount[_0x14be('0x5')](e,emitEvent(event));}}module[_0x14be('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2fb8057..5d4d5dc 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 _0xba93=['mail_accounts','lodash','util','../../config/logger','api','moment','bluebird','MailAccount'];(function(_0x408eef,_0x215cfc){var _0x3fd847=function(_0x51899f){while(--_0x51899f){_0x408eef['push'](_0x408eef['shift']());}};_0x3fd847(++_0x215cfc);}(_0xba93,0x139));var _0x3ba9=function(_0x1a36d5,_0x3bdfbc){_0x1a36d5=_0x1a36d5-0x0;var _0x1108e4=_0xba93[_0x1a36d5];return _0x1108e4;};'use strict';var _=require(_0x3ba9('0x0'));var util=require(_0x3ba9('0x1'));var logger=require(_0x3ba9('0x2'))(_0x3ba9('0x3'));var moment=require(_0x3ba9('0x4'));var BPromise=require(_0x3ba9('0x5'));var rp=require('request-promise');var attributes=require('./mailAccount.attributes');module['exports']=function(_0x2eae8a,_0x5657f7){return _0x2eae8a['define'](_0x3ba9('0x6'),attributes,{'tableName':_0x3ba9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5de8=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4fd8d3,_0x329eab){var _0x235007=function(_0x57b9c1){while(--_0x57b9c1){_0x4fd8d3['push'](_0x4fd8d3['shift']());}};_0x235007(++_0x329eab);}(_0x5de8,0x131));var _0x85de=function(_0x96e245,_0x42f526){_0x96e245=_0x96e245-0x0;var _0x22f0ec=_0x5de8[_0x96e245];return _0x22f0ec;};'use strict';var _=require(_0x85de('0x0'));var util=require(_0x85de('0x1'));var logger=require(_0x85de('0x2'))(_0x85de('0x3'));var moment=require(_0x85de('0x4'));var BPromise=require(_0x85de('0x5'));var rp=require(_0x85de('0x6'));var attributes=require(_0x85de('0x7'));module[_0x85de('0x8')]=function(_0x330b22,_0x1e5b6c){return _0x330b22[_0x85de('0x9')](_0x85de('0xa'),attributes,{'tableName':_0x85de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 6112e24..e63b1ee 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 _0x2432=['Messages','inReplyTo','spread','update','interaction','created','MailMessage','originTo','originCc','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','MailAccount','findAll','options','where','attributes','include','map','model','ShowMailAccount','find','NotifyMailAccount','mail','difference','keys','rawAttributes','createdAt','updatedAt','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','account','applications','list','priority','autoclose','push','length','close','*,*,*,*','ListId','CmContact','create','List\x20not\x20found','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction'];(function(_0x4465f5,_0x140ddd){var _0x2fc7da=function(_0x2df87d){while(--_0x2df87d){_0x4465f5['push'](_0x4465f5['shift']());}};_0x2fc7da(++_0x140ddd);}(_0x2432,0x1a3));var _0x2243=function(_0x5bff0d,_0x3d9cfd){_0x5bff0d=_0x5bff0d-0x0;var _0x4c47dd=_0x2432[_0x5bff0d];return _0x4c47dd;};'use strict';var _=require(_0x2243('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2243('0x1'));var rs=require(_0x2243('0x2'));var fs=require('fs');var Redis=require(_0x2243('0x3'));var db=require(_0x2243('0x4'))['db'];var utils=require(_0x2243('0x5'));var logger=require(_0x2243('0x6'))(_0x2243('0x7'));var config=require('../../config/environment');var jayson=require(_0x2243('0x8'));var client=jayson[_0x2243('0x9')][_0x2243('0xa')]({'port':0x232c});config[_0x2243('0xb')]=_[_0x2243('0xc')](config[_0x2243('0xb')],{'host':_0x2243('0xd'),'port':0x18eb});var socket=require(_0x2243('0xe'))(new Redis(config[_0x2243('0xb')]));require(_0x2243('0xf'))[_0x2243('0x10')](socket);function respondWithRpcPromise(_0xd5233b,_0xc77187,_0x267abd){return new BPromise(function(_0x44fd5f,_0x2076cf){return client['request'](_0xd5233b,_0x267abd)[_0x2243('0x11')](function(_0x337df0){logger[_0x2243('0x12')]('MailAccount,\x20%s,\x20%s',_0xc77187,_0x2243('0x13'));logger[_0x2243('0x14')](_0x2243('0x15'),_0xc77187,_0x2243('0x13'),JSON[_0x2243('0x16')](_0x337df0));if(_0x337df0[_0x2243('0x17')]){if(_0x337df0['error']['code']===0x1f4){logger[_0x2243('0x17')](_0x2243('0x18'),_0xc77187,_0x337df0[_0x2243('0x17')][_0x2243('0x19')]);return _0x2076cf(_0x337df0[_0x2243('0x17')][_0x2243('0x19')]);}logger[_0x2243('0x17')]('MailAccount,\x20%s,\x20%s',_0xc77187,_0x337df0['error'][_0x2243('0x19')]);return _0x44fd5f(_0x337df0['error'][_0x2243('0x19')]);}else{logger[_0x2243('0x12')](_0x2243('0x18'),_0xc77187,_0x2243('0x13'));_0x44fd5f(_0x337df0['result'][_0x2243('0x19')]);}})[_0x2243('0x1a')](function(_0x345dee){logger[_0x2243('0x17')]('MailAccount,\x20%s,\x20%s',_0xc77187,_0x345dee);_0x2076cf(_0x345dee);});});}exports[_0x2243('0x1b')]=function(_0x4e67ca){var _0x51fe32=this;return new Promise(function(_0x20b021,_0x2e0e52){return db[_0x2243('0x1c')][_0x2243('0x1d')]({'raw':_0x4e67ca[_0x2243('0x1e')]?_0x4e67ca['options']['raw']===undefined?!![]:![]:!![],'where':_0x4e67ca[_0x2243('0x1e')]?_0x4e67ca[_0x2243('0x1e')][_0x2243('0x1f')]||null:null,'attributes':_0x4e67ca[_0x2243('0x1e')]?_0x4e67ca[_0x2243('0x1e')][_0x2243('0x20')]||null:null,'limit':_0x4e67ca[_0x2243('0x1e')]?_0x4e67ca[_0x2243('0x1e')]['limit']||null:null,'include':_0x4e67ca['options']?_0x4e67ca[_0x2243('0x1e')][_0x2243('0x21')]?_[_0x2243('0x22')](_0x4e67ca['options'][_0x2243('0x21')],function(_0x2c3667){return{'model':db[_0x2c3667[_0x2243('0x23')]],'as':_0x2c3667['as'],'attributes':_0x2c3667[_0x2243('0x20')],'include':_0x2c3667[_0x2243('0x21')]?_[_0x2243('0x22')](_0x2c3667[_0x2243('0x21')],function(_0x2d81b0){return{'model':db[_0x2d81b0[_0x2243('0x23')]],'as':_0x2d81b0['as'],'attributes':_0x2d81b0[_0x2243('0x20')],'include':_0x2d81b0[_0x2243('0x21')]?_[_0x2243('0x22')](_0x2d81b0[_0x2243('0x21')],function(_0x9eb99e){return{'model':db[_0x9eb99e['model']],'as':_0x9eb99e['as'],'attributes':_0x9eb99e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x15bc31){logger['info'](_0x2243('0x1b'),_0x4e67ca);logger['debug'](_0x2243('0x1b'),_0x4e67ca,JSON[_0x2243('0x16')](_0x15bc31));_0x20b021(_0x15bc31);})[_0x2243('0x1a')](function(_0x522535){logger[_0x2243('0x17')]('GetMailAccount',_0x522535[_0x2243('0x19')],_0x4e67ca);_0x2e0e52(_0x51fe32['error'](0x1f4,_0x522535['message']));});});};exports[_0x2243('0x24')]=function(_0x175539){var _0x547aa3=this;return new Promise(function(_0x2b4610,_0x54f063){return db['MailAccount'][_0x2243('0x25')]({'raw':_0x175539[_0x2243('0x1e')]?_0x175539[_0x2243('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x175539[_0x2243('0x1e')]?_0x175539[_0x2243('0x1e')][_0x2243('0x1f')]||null:null,'attributes':_0x175539[_0x2243('0x1e')]?_0x175539[_0x2243('0x1e')][_0x2243('0x20')]||null:null,'include':_0x175539['options']?_0x175539['options'][_0x2243('0x21')]?_[_0x2243('0x22')](_0x175539[_0x2243('0x1e')][_0x2243('0x21')],function(_0x5d9738){return{'model':db[_0x5d9738[_0x2243('0x23')]],'as':_0x5d9738['as'],'attributes':_0x5d9738['attributes'],'include':_0x5d9738[_0x2243('0x21')]?_[_0x2243('0x22')](_0x5d9738[_0x2243('0x21')],function(_0x38131c){return{'model':db[_0x38131c[_0x2243('0x23')]],'as':_0x38131c['as'],'attributes':_0x38131c['attributes'],'include':_0x38131c['include']?_[_0x2243('0x22')](_0x38131c[_0x2243('0x21')],function(_0x37e4ea){return{'model':db[_0x37e4ea['model']],'as':_0x37e4ea['as'],'attributes':_0x37e4ea[_0x2243('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2243('0x11')](function(_0x480f94){logger['info']('ShowMailAccount',_0x175539);logger[_0x2243('0x14')](_0x2243('0x24'),_0x175539,JSON['stringify'](_0x480f94));_0x2b4610(_0x480f94);})[_0x2243('0x1a')](function(_0x5165f9){logger[_0x2243('0x17')](_0x2243('0x24'),_0x5165f9['message'],_0x175539);_0x54f063(_0x547aa3[_0x2243('0x17')](0x1f4,_0x5165f9[_0x2243('0x19')]));});});};exports[_0x2243('0x26')]=function(_0x4dbfd9){var _0x336d3f=this;return new Promise(function(_0x50423c,_0x210c49){var _0x18b752={'body':_0x4dbfd9['body'],'channel':_0x2243('0x27')};var _0x4851b5=_[_0x2243('0x28')](_[_0x2243('0x29')](db['CmContact'][_0x2243('0x2a')]),[_0x2243('0x2b'),_0x2243('0x2c'),'CompanyId','ListId']);var _0x2db02f=![];if(_0x4dbfd9[_0x2243('0x2d')]['id']){delete _0x4dbfd9[_0x2243('0x2d')]['id'];}if(_[_0x2243('0x2e')](_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x2f')])){return _0x210c49(_0x336d3f[_0x2243('0x17')](0x1f4,_0x2243('0x30')));}if(_[_0x2243('0x2e')](_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x2d')])||_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x2d')]===''){return _0x210c49(_0x336d3f[_0x2243('0x17')](0x1f4,_0x2243('0x31')));}if(_[_0x2243('0x2e')](_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x32')])){return _0x210c49(_0x336d3f[_0x2243('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4851b5));}if(!_[_0x2243('0x33')](_0x4851b5,_0x4dbfd9[_0x2243('0x2d')]['mapKey'])){return _0x210c49(_0x336d3f['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4851b5));}var _0xfff5f3={};_0xfff5f3[_0x4dbfd9[_0x2243('0x2d')]['mapKey']]=_0x4dbfd9['body'][_0x2243('0x2f')];return db['MailAccount'][_0x2243('0x25')]({'where':{'id':_0x4dbfd9['account']['id']},'include':[{'model':db[_0x2243('0x34')],'as':_0x2243('0x35'),'include':[{'model':db['CmContact'],'as':_0x2243('0x36'),'where':_0xfff5f3,'limit':0x1,'order':[[_0x2243('0x2c'),_0x2243('0x37')]]}]},{'model':db[_0x2243('0x38')],'as':_0x2243('0x39')},{'model':db[_0x2243('0x3a')],'as':_0x2243('0x3b')}]})['then'](function(_0x474446){if(_0x474446&&_0x474446[_0x2243('0x35')]){var _0xe9c294=_0x474446[_0x2243('0x3c')]({'plain':!![]});_0x18b752[_0x2243('0x3d')]=_['omit'](_0xe9c294,['Applications',_0x2243('0x35')]);_0x18b752[_0x2243('0x3e')]=_0xe9c294[_0x2243('0x39')];_0x18b752[_0x2243('0x3f')]=_0xe9c294['List'];_0x18b752[_0x2243('0x3e')]=_['orderBy'](_0x18b752[_0x2243('0x3e')],[_0x2243('0x40')],['asc']);if(_0x18b752['account']&&_0x18b752[_0x2243('0x3d')][_0x2243('0x41')]){_0x18b752['applications'][_0x2243('0x42')]({'id':0x0,'priority':_0x18b752[_0x2243('0x3e')][_0x2243('0x43')]+0x1,'app':_0x2243('0x44'),'appdata':_0x2243('0x41'),'interval':_0x2243('0x45')});}if(_0x18b752[_0x2243('0x3d')][_0x2243('0x39')]){delete _0x18b752['account']['Applications'];}if(_0x18b752['account']['List']){delete _0x18b752[_0x2243('0x3d')]['List'];}if(_0xe9c294['List'][_0x2243('0x36')][_0x2243('0x43')]){return _0xe9c294[_0x2243('0x35')][_0x2243('0x36')][0x0];}var _0x5ff3ba=_[_0x2243('0xc')](_0x4dbfd9[_0x2243('0x2d')],{'firstName':_0x4dbfd9['body']['from'],'ListId':_0xe9c294[_0x2243('0x46')]});_0x5ff3ba[_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x32')]]=_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x2f')];return db[_0x2243('0x47')][_0x2243('0x48')](_0x5ff3ba);}else{throw new Error(_0x2243('0x49'));}})['then'](function(_0x112b87){_0x18b752[_0x2243('0x4a')]=_0x112b87;if(_0x112b87){if(!_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')][_0x2243('0x4b')]){_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')]['messageId']=rs['generate']()+'\x20'+_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')]['from'];}var _0x3af7fd={'ContactId':_0x112b87['id'],'MailAccountId':_0x4dbfd9['account']['id'],'inReplyTo':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')][_0x2243('0x4b')],'to':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')][_0x2243('0x2f')],'cc':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')]['cc'],'subject':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')][_0x2243('0x4c')],'attach':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')][_0x2243('0x4d')],'lastMsgAt':moment()[_0x2243('0x4e')](_0x2243('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x4dbfd9['body']['body']};return db[_0x2243('0x50')][_0x2243('0x25')]({'where':{'closed':![],'MailAccountId':_0x4dbfd9[_0x2243('0x3d')]['id']},'include':[{'model':db['MailMessage'],'as':_0x2243('0x51'),'attributes':[_0x2243('0x4b')],'where':{'messageId':_0x4dbfd9[_0x2243('0x2d')]['message'][_0x2243('0x52')]}}]})['then'](function(_0xa3c94d){if(_0xa3c94d){return[_0xa3c94d,![]];}return db['MailInteraction'][_0x2243('0x48')](_0x3af7fd)['then'](function(_0x4f971a){return[_0x4f971a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x2243('0x53')](function(_0x3f2a17,_0x5c7f27){if(_0x3f2a17){_0x2db02f=_0x5c7f27;if(!_0x5c7f27){return _0x3f2a17[_0x2243('0x54')]({'inReplyTo':_0x4dbfd9['body'][_0x2243('0x19')][_0x2243('0x4b')],'to':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')][_0x2243('0x2f')],'cc':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')]['cc'],'subject':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')][_0x2243('0x4c')],'attach':_0x3f2a17[_0x2243('0x4d')]?_0x3f2a17[_0x2243('0x4d')]:_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')][_0x2243('0x4d')],'substatus':null,'substatusAt':moment()[_0x2243('0x4e')](_0x2243('0x4f')),'lastMsgAt':moment()[_0x2243('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x2d')]});}else{return _0x3f2a17;}}})['then'](function(_0x3ee311){_0x18b752['interaction']=_0x3ee311[_0x2243('0x3c')]({'plain':!![]});_0x18b752[_0x2243('0x55')][_0x2243('0x56')]=_0x2db02f;return db[_0x2243('0x57')]['create']({'body':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x2d')],'MailAccountId':_0x4dbfd9[_0x2243('0x3d')]['id'],'MailInteractionId':_0x3ee311['id'],'direction':'in','ContactId':_0x18b752[_0x2243('0x4a')]['id'],'messageId':_0x4dbfd9['body']['message'][_0x2243('0x4b')],'from':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')][_0x2243('0x2f')],'to':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')]['to'],'cc':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')]['cc'],'subject':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')][_0x2243('0x4c')],'attach':_0x4dbfd9['body'][_0x2243('0x19')][_0x2243('0x4d')],'Attachments':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')]['attachments'],'originTo':_0x4dbfd9['body'][_0x2243('0x19')][_0x2243('0x58')],'originCc':_0x4dbfd9['body'][_0x2243('0x19')][_0x2243('0x59')],'bcc':_0x4dbfd9[_0x2243('0x2d')][_0x2243('0x19')]['bcc']},{'include':[{'model':db[_0x2243('0x5a')],'as':_0x2243('0x5b')}]});})[_0x2243('0x11')](function(_0x34254a){_0x18b752[_0x2243('0x19')]=_0x34254a;if(_0x18b752[_0x2243('0x55')][_0x2243('0x5c')]){return db[_0x2243('0x5d')]['find']({'attributes':['id',_0x2243('0x5e')],'where':{'id':_0x18b752[_0x2243('0x55')][_0x2243('0x5c')]}})['then'](function(_0x4bcd21){if(_0x4bcd21){_0x18b752[_0x2243('0x3e')][_0x2243('0x5f')]({'id':0x0,'priority':0x0,'app':_0x2243('0x60'),'appdata':_0x4bcd21[_0x2243('0x5e')]+','+(_0x18b752['account'][_0x2243('0x61')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x2243('0x62'),_0x2243('0x63'),_0x18b752);});}return respondWithRpcPromise(_0x2243('0x62'),_0x2243('0x63'),_0x18b752);})[_0x2243('0x11')](function(_0x1d2acf){_0x50423c(_0x1d2acf);})[_0x2243('0x1a')](function(_0x155065){_0x210c49(_0x336d3f[_0x2243('0x17')](0x1f4,_0x155065[_0x2243('0x19')]));});});}; \ No newline at end of file +var _0x129c=['close','*,*,*,*','Contacts','length','ListId','List\x20not\x20found','contact','messageId','generate','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','update','attach','interaction','created','create','subject','attachments','originTo','originCc','bcc','Attachments','UserId','name','agent','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./mailAccount.socket','info','request\x20sent','debug','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','options','raw','where','attributes','limit','map','model','include','then','ShowMailAccount','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','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','account','CmList','DESC','MailApplication','Applications','Smtp','List','get','applications','orderBy','priority','autoclose','push'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x129c,0xe4));var _0xc129=function(_0x546afa,_0x2f850d){_0x546afa=_0x546afa-0x0;var _0x2aae2e=_0x129c[_0x546afa];return _0x2aae2e;};'use strict';var _=require(_0xc129('0x0'));var util=require(_0xc129('0x1'));var moment=require(_0xc129('0x2'));var BPromise=require('bluebird');var rs=require(_0xc129('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc129('0x4'))['db'];var utils=require(_0xc129('0x5'));var logger=require(_0xc129('0x6'))(_0xc129('0x7'));var config=require('../../config/environment');var jayson=require(_0xc129('0x8'));var client=jayson[_0xc129('0x9')][_0xc129('0xa')]({'port':0x232c});config['redis']=_[_0xc129('0xb')](config[_0xc129('0xc')],{'host':_0xc129('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc129('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e7c3d,_0x383390,_0x19f582){return new BPromise(function(_0x4069a1,_0x5ecb11){return client['request'](_0x2e7c3d,_0x19f582)['then'](function(_0x344440){logger[_0xc129('0xf')]('MailAccount,\x20%s,\x20%s',_0x383390,_0xc129('0x10'));logger[_0xc129('0x11')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x383390,_0xc129('0x10'),JSON['stringify'](_0x344440));if(_0x344440[_0xc129('0x12')]){if(_0x344440['error'][_0xc129('0x13')]===0x1f4){logger[_0xc129('0x12')](_0xc129('0x14'),_0x383390,_0x344440['error'][_0xc129('0x15')]);return _0x5ecb11(_0x344440[_0xc129('0x12')][_0xc129('0x15')]);}logger[_0xc129('0x12')]('MailAccount,\x20%s,\x20%s',_0x383390,_0x344440[_0xc129('0x12')][_0xc129('0x15')]);return _0x4069a1(_0x344440[_0xc129('0x12')]['message']);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x383390,_0xc129('0x10'));_0x4069a1(_0x344440[_0xc129('0x16')][_0xc129('0x15')]);}})[_0xc129('0x17')](function(_0x162a60){logger[_0xc129('0x12')](_0xc129('0x14'),_0x383390,_0x162a60);_0x5ecb11(_0x162a60);});});}exports[_0xc129('0x18')]=function(_0x2bf8ed){var _0x16d16c=this;return new Promise(function(_0x56e3ac,_0x328050){return db[_0xc129('0x19')]['findAll']({'raw':_0x2bf8ed[_0xc129('0x1a')]?_0x2bf8ed[_0xc129('0x1a')][_0xc129('0x1b')]===undefined?!![]:![]:!![],'where':_0x2bf8ed[_0xc129('0x1a')]?_0x2bf8ed[_0xc129('0x1a')][_0xc129('0x1c')]||null:null,'attributes':_0x2bf8ed[_0xc129('0x1a')]?_0x2bf8ed[_0xc129('0x1a')][_0xc129('0x1d')]||null:null,'limit':_0x2bf8ed[_0xc129('0x1a')]?_0x2bf8ed[_0xc129('0x1a')][_0xc129('0x1e')]||null:null,'include':_0x2bf8ed[_0xc129('0x1a')]?_0x2bf8ed['options']['include']?_[_0xc129('0x1f')](_0x2bf8ed[_0xc129('0x1a')]['include'],function(_0x528607){return{'model':db[_0x528607[_0xc129('0x20')]],'as':_0x528607['as'],'attributes':_0x528607[_0xc129('0x1d')],'include':_0x528607['include']?_[_0xc129('0x1f')](_0x528607['include'],function(_0x1125a3){return{'model':db[_0x1125a3[_0xc129('0x20')]],'as':_0x1125a3['as'],'attributes':_0x1125a3[_0xc129('0x1d')],'include':_0x1125a3['include']?_['map'](_0x1125a3[_0xc129('0x21')],function(_0x46f119){return{'model':db[_0x46f119['model']],'as':_0x46f119['as'],'attributes':_0x46f119[_0xc129('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc129('0x22')](function(_0x2a48c6){logger[_0xc129('0xf')]('GetMailAccount',_0x2bf8ed);logger[_0xc129('0x11')](_0xc129('0x18'),_0x2bf8ed,JSON['stringify'](_0x2a48c6));_0x56e3ac(_0x2a48c6);})['catch'](function(_0x46eba7){logger[_0xc129('0x12')](_0xc129('0x18'),_0x46eba7[_0xc129('0x15')],_0x2bf8ed);_0x328050(_0x16d16c[_0xc129('0x12')](0x1f4,_0x46eba7[_0xc129('0x15')]));});});};exports[_0xc129('0x23')]=function(_0x12b718){var _0x3f6f1a=this;return new Promise(function(_0x463d97,_0x4327c2){return db[_0xc129('0x19')]['find']({'raw':_0x12b718[_0xc129('0x1a')]?_0x12b718[_0xc129('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x12b718['options']?_0x12b718['options'][_0xc129('0x1c')]||null:null,'attributes':_0x12b718[_0xc129('0x1a')]?_0x12b718[_0xc129('0x1a')][_0xc129('0x1d')]||null:null,'include':_0x12b718[_0xc129('0x1a')]?_0x12b718['options'][_0xc129('0x21')]?_[_0xc129('0x1f')](_0x12b718['options'][_0xc129('0x21')],function(_0x59c416){return{'model':db[_0x59c416[_0xc129('0x20')]],'as':_0x59c416['as'],'attributes':_0x59c416[_0xc129('0x1d')],'include':_0x59c416[_0xc129('0x21')]?_[_0xc129('0x1f')](_0x59c416[_0xc129('0x21')],function(_0x520934){return{'model':db[_0x520934[_0xc129('0x20')]],'as':_0x520934['as'],'attributes':_0x520934[_0xc129('0x1d')],'include':_0x520934[_0xc129('0x21')]?_[_0xc129('0x1f')](_0x520934[_0xc129('0x21')],function(_0x44ff74){return{'model':db[_0x44ff74[_0xc129('0x20')]],'as':_0x44ff74['as'],'attributes':_0x44ff74[_0xc129('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc129('0x22')](function(_0x5ebd78){logger['info']('ShowMailAccount',_0x12b718);logger['debug']('ShowMailAccount',_0x12b718,JSON['stringify'](_0x5ebd78));_0x463d97(_0x5ebd78);})[_0xc129('0x17')](function(_0x14cdf1){logger[_0xc129('0x12')](_0xc129('0x23'),_0x14cdf1['message'],_0x12b718);_0x4327c2(_0x3f6f1a[_0xc129('0x12')](0x1f4,_0x14cdf1[_0xc129('0x15')]));});});};exports[_0xc129('0x24')]=function(_0xa5098b){var _0x3653dc=this;return new Promise(function(_0x286563,_0xa3b1b1){var _0x1ecdd9={'body':_0xa5098b[_0xc129('0x25')],'channel':'mail'};var _0x2d7750=_[_0xc129('0x26')](_[_0xc129('0x27')](db[_0xc129('0x28')][_0xc129('0x29')]),[_0xc129('0x2a'),_0xc129('0x2b'),'CompanyId','ListId']);var _0x269d48=![];if(_0xa5098b[_0xc129('0x25')]['id']){delete _0xa5098b[_0xc129('0x25')]['id'];}if(_[_0xc129('0x2c')](_0xa5098b[_0xc129('0x25')][_0xc129('0x2d')])){return _0xa3b1b1(_0x3653dc[_0xc129('0x12')](0x1f4,_0xc129('0x2e')));}if(_['isNil'](_0xa5098b[_0xc129('0x25')][_0xc129('0x25')])||_0xa5098b[_0xc129('0x25')]['body']===''){return _0xa3b1b1(_0x3653dc[_0xc129('0x12')](0x1f4,_0xc129('0x2f')));}if(_['isNil'](_0xa5098b[_0xc129('0x25')][_0xc129('0x30')])){return _0xa3b1b1(_0x3653dc[_0xc129('0x12')](0x1f4,_0xc129('0x31')+_0x2d7750));}if(!_[_0xc129('0x32')](_0x2d7750,_0xa5098b[_0xc129('0x25')]['mapKey'])){return _0xa3b1b1(_0x3653dc['error'](0x1f4,_0xc129('0x33')+_0x2d7750));}var _0x57bf2a={};_0x57bf2a[_0xa5098b['body']['mapKey']]=_0xa5098b[_0xc129('0x25')][_0xc129('0x2d')];return db[_0xc129('0x19')][_0xc129('0x34')]({'where':{'id':_0xa5098b[_0xc129('0x35')]['id']},'include':[{'model':db[_0xc129('0x36')],'as':'List','include':[{'model':db[_0xc129('0x28')],'as':'Contacts','where':_0x57bf2a,'limit':0x1,'order':[[_0xc129('0x2b'),_0xc129('0x37')]]}]},{'model':db[_0xc129('0x38')],'as':_0xc129('0x39')},{'model':db['MailServerOut'],'as':_0xc129('0x3a')}]})[_0xc129('0x22')](function(_0x368938){if(_0x368938&&_0x368938[_0xc129('0x3b')]){var _0x41e44c=_0x368938[_0xc129('0x3c')]({'plain':!![]});_0x1ecdd9[_0xc129('0x35')]=_['omit'](_0x41e44c,[_0xc129('0x39'),_0xc129('0x3b')]);_0x1ecdd9[_0xc129('0x3d')]=_0x41e44c[_0xc129('0x39')];_0x1ecdd9['list']=_0x41e44c[_0xc129('0x3b')];_0x1ecdd9[_0xc129('0x3d')]=_[_0xc129('0x3e')](_0x1ecdd9[_0xc129('0x3d')],[_0xc129('0x3f')],['asc']);if(_0x1ecdd9['account']&&_0x1ecdd9[_0xc129('0x35')][_0xc129('0x40')]){_0x1ecdd9[_0xc129('0x3d')][_0xc129('0x41')]({'id':0x0,'priority':_0x1ecdd9[_0xc129('0x3d')]['length']+0x1,'app':_0xc129('0x42'),'appdata':_0xc129('0x40'),'interval':_0xc129('0x43')});}if(_0x1ecdd9[_0xc129('0x35')][_0xc129('0x39')]){delete _0x1ecdd9['account'][_0xc129('0x39')];}if(_0x1ecdd9[_0xc129('0x35')][_0xc129('0x3b')]){delete _0x1ecdd9[_0xc129('0x35')]['List'];}if(_0x41e44c[_0xc129('0x3b')][_0xc129('0x44')][_0xc129('0x45')]){return _0x41e44c['List'][_0xc129('0x44')][0x0];}var _0x2ad09d=_[_0xc129('0xb')](_0xa5098b[_0xc129('0x25')],{'firstName':_0xa5098b[_0xc129('0x25')][_0xc129('0x2d')],'ListId':_0x41e44c[_0xc129('0x46')]});_0x2ad09d[_0xa5098b['body'][_0xc129('0x30')]]=_0xa5098b[_0xc129('0x25')][_0xc129('0x2d')];return db[_0xc129('0x28')]['create'](_0x2ad09d);}else{throw new Error(_0xc129('0x47'));}})[_0xc129('0x22')](function(_0xc41d1f){_0x1ecdd9[_0xc129('0x48')]=_0xc41d1f;if(_0xc41d1f){if(!_0xa5098b['body'][_0xc129('0x15')][_0xc129('0x49')]){_0xa5098b['body'][_0xc129('0x15')][_0xc129('0x49')]=rs[_0xc129('0x4a')]()+'\x20'+_0xa5098b[_0xc129('0x25')][_0xc129('0x15')][_0xc129('0x2d')];}var _0x59001e={'ContactId':_0xc41d1f['id'],'MailAccountId':_0xa5098b['account']['id'],'inReplyTo':_0xa5098b[_0xc129('0x25')][_0xc129('0x15')][_0xc129('0x49')],'to':_0xa5098b['body'][_0xc129('0x15')]['from'],'cc':_0xa5098b[_0xc129('0x25')][_0xc129('0x15')]['cc'],'subject':_0xa5098b['body'][_0xc129('0x15')]['subject'],'attach':_0xa5098b[_0xc129('0x25')][_0xc129('0x15')]['attach'],'lastMsgAt':moment()[_0xc129('0x4b')](_0xc129('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0xa5098b[_0xc129('0x25')]['body']};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0xa5098b[_0xc129('0x35')]['id']},'include':[{'model':db[_0xc129('0x4d')],'as':_0xc129('0x4e'),'attributes':[_0xc129('0x49')],'where':{'messageId':_0xa5098b['body']['message'][_0xc129('0x4f')]}}]})[_0xc129('0x22')](function(_0x2e4cf3){if(_0x2e4cf3){return[_0x2e4cf3,![]];}return db[_0xc129('0x50')]['create'](_0x59001e)['then'](function(_0x45027c){return[_0x45027c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x420aaf,_0x4dafb0){if(_0x420aaf){_0x269d48=_0x4dafb0;if(!_0x4dafb0){return _0x420aaf[_0xc129('0x51')]({'inReplyTo':_0xa5098b['body'][_0xc129('0x15')][_0xc129('0x49')],'to':_0xa5098b[_0xc129('0x25')]['message'][_0xc129('0x2d')],'cc':_0xa5098b['body'][_0xc129('0x15')]['cc'],'subject':_0xa5098b[_0xc129('0x25')]['message']['subject'],'attach':_0x420aaf[_0xc129('0x52')]?_0x420aaf['attach']:_0xa5098b['body'][_0xc129('0x15')][_0xc129('0x52')],'substatus':null,'substatusAt':moment()[_0xc129('0x4b')](_0xc129('0x4c')),'lastMsgAt':moment()[_0xc129('0x4b')](_0xc129('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0xa5098b['body'][_0xc129('0x25')]});}else{return _0x420aaf;}}})[_0xc129('0x22')](function(_0x1e26a7){_0x1ecdd9[_0xc129('0x53')]=_0x1e26a7[_0xc129('0x3c')]({'plain':!![]});_0x1ecdd9[_0xc129('0x53')][_0xc129('0x54')]=_0x269d48;return db[_0xc129('0x4d')][_0xc129('0x55')]({'body':_0xa5098b[_0xc129('0x25')][_0xc129('0x25')],'MailAccountId':_0xa5098b[_0xc129('0x35')]['id'],'MailInteractionId':_0x1e26a7['id'],'direction':'in','ContactId':_0x1ecdd9[_0xc129('0x48')]['id'],'messageId':_0xa5098b[_0xc129('0x25')][_0xc129('0x15')][_0xc129('0x49')],'from':_0xa5098b[_0xc129('0x25')][_0xc129('0x15')][_0xc129('0x2d')],'to':_0xa5098b[_0xc129('0x25')]['message']['to'],'cc':_0xa5098b[_0xc129('0x25')][_0xc129('0x15')]['cc'],'subject':_0xa5098b[_0xc129('0x25')][_0xc129('0x15')][_0xc129('0x56')],'attach':_0xa5098b['body']['message'][_0xc129('0x52')],'Attachments':_0xa5098b[_0xc129('0x25')][_0xc129('0x15')][_0xc129('0x57')],'originTo':_0xa5098b[_0xc129('0x25')][_0xc129('0x15')][_0xc129('0x58')],'originCc':_0xa5098b[_0xc129('0x25')][_0xc129('0x15')][_0xc129('0x59')],'bcc':_0xa5098b[_0xc129('0x25')][_0xc129('0x15')][_0xc129('0x5a')]},{'include':[{'model':db['Attachment'],'as':_0xc129('0x5b')}]});})[_0xc129('0x22')](function(_0x36965f){_0x1ecdd9[_0xc129('0x15')]=_0x36965f;if(_0x1ecdd9[_0xc129('0x53')][_0xc129('0x5c')]){return db['User'][_0xc129('0x34')]({'attributes':['id',_0xc129('0x5d')],'where':{'id':_0x1ecdd9[_0xc129('0x53')]['UserId']}})[_0xc129('0x22')](function(_0x470cc3){if(_0x470cc3){_0x1ecdd9[_0xc129('0x3d')]['unshift']({'id':0x0,'priority':0x0,'app':_0xc129('0x5e'),'appdata':_0x470cc3[_0xc129('0x5d')]+','+(_0x1ecdd9[_0xc129('0x35')][_0xc129('0x5f')]||0xa),'interval':_0xc129('0x43')});}return respondWithRpcPromise('Start',_0xc129('0x60'),_0x1ecdd9);});}return respondWithRpcPromise(_0xc129('0x61'),_0xc129('0x60'),_0x1ecdd9);})[_0xc129('0x22')](function(_0x115143){_0x286563(_0x115143);})[_0xc129('0x17')](function(_0x400e1f){_0xa3b1b1(_0x3653dc[_0xc129('0x12')](0x1f4,_0x400e1f[_0xc129('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 3c815f6..2f80b90 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 _0x8a0e=['emit','removeListener','register','mailAccount:','./mailAccount.events','save','remove'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0x8a0e,0x123));var _0xe8a0=function(_0x45053d,_0x8523cf){_0x45053d=_0x45053d-0x0;var _0x538421=_0x8a0e[_0x45053d];return _0x538421;};'use strict';var MailAccountEvents=require(_0xe8a0('0x0'));var events=[_0xe8a0('0x1'),_0xe8a0('0x2'),'update'];function createListener(_0x495568,_0x54116a){return function(_0x384099){_0x54116a[_0xe8a0('0x3')](_0x495568,_0x384099);};}function removeListener(_0x128acf,_0x4187a9){return function(){MailAccountEvents[_0xe8a0('0x4')](_0x128acf,_0x4187a9);};}exports[_0xe8a0('0x5')]=function(_0x5dbf9b){for(var _0x5979d9=0x0,_0x380591=events['length'];_0x5979d9<_0x380591;_0x5979d9++){var _0x3aa9a7=events[_0x5979d9];var _0xbcc372=createListener(_0xe8a0('0x6')+_0x3aa9a7,_0x5dbf9b);MailAccountEvents['on'](_0x3aa9a7,_0xbcc372);}}; \ No newline at end of file +var _0x5918=['remove','update','removeListener','length','./mailAccount.events','save'];(function(_0x5a5ad3,_0x10c3ed){var _0x40243b=function(_0x3a0508){while(--_0x3a0508){_0x5a5ad3['push'](_0x5a5ad3['shift']());}};_0x40243b(++_0x10c3ed);}(_0x5918,0x1c0));var _0x8591=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5918[_0x321bb2];return _0x9c12ed;};'use strict';var MailAccountEvents=require(_0x8591('0x0'));var events=[_0x8591('0x1'),_0x8591('0x2'),_0x8591('0x3')];function createListener(_0x42efc6,_0x260f7e){return function(_0x8743b){_0x260f7e['emit'](_0x42efc6,_0x8743b);};}function removeListener(_0x4c6d42,_0x27497e){return function(){MailAccountEvents[_0x8591('0x4')](_0x4c6d42,_0x27497e);};}exports['register']=function(_0x16eee2){for(var _0x4cb55f=0x0,_0x542830=events[_0x8591('0x5')];_0x4cb55f<_0x542830;_0x4cb55f++){var _0x3debba=events[_0x4cb55f];var _0x39d38e=createListener('mailAccount:'+_0x3debba,_0x16eee2);MailAccountEvents['on'](_0x3debba,_0x39d38e);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 8a1c531..1a39de8 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 _0xed95=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','put','isAuthenticated','update','delete','exports','multer','util'];(function(_0x2d48ae,_0x39f9d6){var _0xb6b018=function(_0x14b9ab){while(--_0x14b9ab){_0x2d48ae['push'](_0x2d48ae['shift']());}};_0xb6b018(++_0x39f9d6);}(_0xed95,0xb9));var _0x5ed9=function(_0x2eddb0,_0x5cd3bb){_0x2eddb0=_0x2eddb0-0x0;var _0x44298f=_0xed95[_0x2eddb0];return _0x44298f;};'use strict';var multer=require(_0x5ed9('0x0'));var util=require(_0x5ed9('0x1'));var path=require(_0x5ed9('0x2'));var timeout=require(_0x5ed9('0x3'));var express=require(_0x5ed9('0x4'));var router=express[_0x5ed9('0x5')]();var auth=require(_0x5ed9('0x6'));var interaction=require(_0x5ed9('0x7'));var config=require(_0x5ed9('0x8'));var controller=require(_0x5ed9('0x9'));router[_0x5ed9('0xa')](_0x5ed9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x5ed9('0xc')](_0x5ed9('0xb'),auth[_0x5ed9('0xd')](),controller[_0x5ed9('0xe')]);router[_0x5ed9('0xf')](_0x5ed9('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x5ed9('0x10')]=router; \ No newline at end of file +var _0x5c12=['get','isAuthenticated','show','put','update','delete','/:id','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x329571,_0x563c79){var _0x1c3fcd=function(_0x46e028){while(--_0x46e028){_0x329571['push'](_0x329571['shift']());}};_0x1c3fcd(++_0x563c79);}(_0x5c12,0x188));var _0x25c1=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x5c12[_0xa2c0a3];return _0x52c618;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var auth=require(_0x25c1('0x4'));var interaction=require(_0x25c1('0x5'));var config=require(_0x25c1('0x6'));var controller=require(_0x25c1('0x7'));router[_0x25c1('0x8')]('/:id',auth[_0x25c1('0x9')](),controller[_0x25c1('0xa')]);router[_0x25c1('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x25c1('0xc')]);router[_0x25c1('0xd')](_0x25c1('0xe'),auth[_0x25c1('0x9')](),controller[_0x25c1('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index aa0016a..ac121d0 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 _0x8066=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8066,0x192));var _0x6806=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x8066[_0x20ef64];return _0x3707d8;};'use strict';var Sequelize=require(_0x6806('0x0'));module[_0x6806('0x1')]={'priority':{'type':Sequelize[_0x6806('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6806('0x3')],'allowNull':![],'defaultValue':_0x6806('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6806('0x5')}}; \ No newline at end of file +var _0x9494=['exports','STRING','noop','sequelize'];(function(_0x1d669e,_0x4921c9){var _0x1d1ec7=function(_0x332a50){while(--_0x332a50){_0x1d669e['push'](_0x1d669e['shift']());}};_0x1d1ec7(++_0x4921c9);}(_0x9494,0x1a7));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4949('0x0'));module[_0x4949('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4949('0x2')],'allowNull':![],'defaultValue':_0x4949('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4949('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 9baded0..7dd4ca8 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=['Content-Range','apply','reject','save','then','error','stack','send','show','params','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','merge','find','catch','body','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x2d650c,_0x3070d2){var _0x4b2791=function(_0x4d6231){while(--_0x4d6231){_0x2d650c['push'](_0x2d650c['shift']());}};_0x4b2791(++_0x3070d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={'raw':!![],'where':{'id':_0x33161b[_0x0a9e('0x24')]['id']}},_0x479bc4={};_0x479bc4['model']=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')]);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x25')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_[_0x0a9e('0x2a')](_0x479bc4['model'],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2b')]=_[_0x0a9e('0x2a')](_0x479bc4[_0x0a9e('0x2c')],qs['fields'](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2b')]=_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x2e')]?_0x384319[_0x0a9e('0x2b')]:_0x479bc4[_0x0a9e('0x2c')];if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2f')]){_0x384319['include']=[{'all':!![]}];}_0x384319=_[_0x0a9e('0x30')]({},_0x384319,_0x33161b['options']);return db[_0x0a9e('0x26')][_0x0a9e('0x31')](_0x384319)[_0x0a9e('0x1f')](handleEntityNotFound(_0x526cf3,null))[_0x0a9e('0x1f')](respondWithResult(_0x526cf3,null))[_0x0a9e('0x32')](handleError(_0x526cf3,null));};exports['update']=function(_0x66c1d2,_0x46f0a5){if(_0x66c1d2[_0x0a9e('0x33')]['id']){delete _0x66c1d2[_0x0a9e('0x33')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x31')]({'where':{'id':_0x66c1d2[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x46f0a5,null))['then'](saveUpdates(_0x66c1d2[_0x0a9e('0x33')],null))['then'](respondWithResult(_0x46f0a5,null))[_0x0a9e('0x32')](handleError(_0x46f0a5,null));};exports[_0x0a9e('0x34')]=function(_0x2b7e7f,_0x3f3d41){return db['MailApplication'][_0x0a9e('0x31')]({'where':{'id':_0x2b7e7f[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x3f3d41,null))[_0x0a9e('0x1f')](removeEntity(_0x3f3d41,null))['catch'](handleError(_0x3f3d41,null));}; \ No newline at end of file +var _0xa9e0=['Content-Range','apply','reject','save','then','error','stack','send','show','params','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','merge','find','catch','body','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x17e9bd,_0x5038c5){var _0x3e9580=function(_0x4905ea){while(--_0x4905ea){_0x17e9bd['push'](_0x17e9bd['shift']());}};_0x3e9580(++_0x5038c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={'raw':!![],'where':{'id':_0x33161b[_0x0a9e('0x24')]['id']}},_0x479bc4={};_0x479bc4['model']=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')]);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x25')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_[_0x0a9e('0x2a')](_0x479bc4['model'],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2b')]=_[_0x0a9e('0x2a')](_0x479bc4[_0x0a9e('0x2c')],qs['fields'](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2d')]));_0x384319[_0x0a9e('0x2b')]=_0x384319[_0x0a9e('0x2b')][_0x0a9e('0x2e')]?_0x384319[_0x0a9e('0x2b')]:_0x479bc4[_0x0a9e('0x2c')];if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2f')]){_0x384319['include']=[{'all':!![]}];}_0x384319=_[_0x0a9e('0x30')]({},_0x384319,_0x33161b['options']);return db[_0x0a9e('0x26')][_0x0a9e('0x31')](_0x384319)[_0x0a9e('0x1f')](handleEntityNotFound(_0x526cf3,null))[_0x0a9e('0x1f')](respondWithResult(_0x526cf3,null))[_0x0a9e('0x32')](handleError(_0x526cf3,null));};exports['update']=function(_0x66c1d2,_0x46f0a5){if(_0x66c1d2[_0x0a9e('0x33')]['id']){delete _0x66c1d2[_0x0a9e('0x33')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x31')]({'where':{'id':_0x66c1d2[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x46f0a5,null))['then'](saveUpdates(_0x66c1d2[_0x0a9e('0x33')],null))['then'](respondWithResult(_0x46f0a5,null))[_0x0a9e('0x32')](handleError(_0x46f0a5,null));};exports[_0x0a9e('0x34')]=function(_0x2b7e7f,_0x3f3d41){return db['MailApplication'][_0x0a9e('0x31')]({'where':{'id':_0x2b7e7f[_0x0a9e('0x24')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x3f3d41,null))[_0x0a9e('0x1f')](removeEntity(_0x3f3d41,null))['catch'](handleError(_0x3f3d41,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 267eec7..d3a23ff 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 _0x3315=['MailApplication','util','../../config/logger','moment','bluebird','./mailApplication.attributes','exports'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x3315,0x86));var _0x5331=function(_0x32af09,_0x5b1dc4){_0x32af09=_0x32af09-0x0;var _0x3fa300=_0x3315[_0x32af09];return _0x3fa300;};'use strict';var _=require('lodash');var util=require(_0x5331('0x0'));var logger=require(_0x5331('0x1'))('api');var moment=require(_0x5331('0x2'));var BPromise=require(_0x5331('0x3'));var rp=require('request-promise');var attributes=require(_0x5331('0x4'));module[_0x5331('0x5')]=function(_0x3599,_0x18d197){return _0x3599['define'](_0x5331('0x6'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90d5=['define','MailApplication','mail_applications','lodash','../../config/logger','moment','request-promise','exports'];(function(_0x5063c9,_0x4896b9){var _0x297360=function(_0x3185f2){while(--_0x3185f2){_0x5063c9['push'](_0x5063c9['shift']());}};_0x297360(++_0x4896b9);}(_0x90d5,0x143));var _0x590d=function(_0x54c9d1,_0x3ea5ef){_0x54c9d1=_0x54c9d1-0x0;var _0x28b119=_0x90d5[_0x54c9d1];return _0x28b119;};'use strict';var _=require(_0x590d('0x0'));var util=require('util');var logger=require(_0x590d('0x1'))('api');var moment=require(_0x590d('0x2'));var BPromise=require('bluebird');var rp=require(_0x590d('0x3'));var attributes=require('./mailApplication.attributes');module[_0x590d('0x4')]=function(_0x46bcb2,_0x31c1ed){return _0x46bcb2[_0x590d('0x5')](_0x590d('0x6'),attributes,{'tableName':_0x590d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 8c32176..4aedd0e 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 _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x34b6cc,_0x1ddc8d){var _0x553c13=function(_0x141e0f){while(--_0x141e0f){_0x34b6cc['push'](_0x34b6cc['shift']());}};_0x553c13(++_0x1ddc8d);}(_0x7a54,0x106));var _0x47a5=function(_0x245b05,_0x5d17cc){_0x245b05=_0x245b05-0x0;var _0x1179c0=_0x7a54[_0x245b05];return _0x1179c0;};'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')]('MailApplication,\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['UpdateMailApplication']=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?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x2478fe,_0x120b6b){var _0x16ee6f=function(_0x1e262a){while(--_0x1e262a){_0x2478fe['push'](_0x2478fe['shift']());}};_0x16ee6f(++_0x120b6b);}(_0x7a54,0x106));var _0x47a5=function(_0x1e0f51,_0x3795c8){_0x1e0f51=_0x1e0f51-0x0;var _0x315379=_0x7a54[_0x1e0f51];return _0x315379;};'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')]('MailApplication,\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['UpdateMailApplication']=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?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index c305cd8..023b0a7 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 _0xea27=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','update','mailinteraction:destroy','destroy','delete','removeTags'];(function(_0x535192,_0x3893ee){var _0x133724=function(_0xf55b86){while(--_0xf55b86){_0x535192['push'](_0x535192['shift']());}};_0x133724(++_0x3893ee);}(_0xea27,0x1cf));var _0x7ea2=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xea27[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x7ea2('0x0'));var util=require(_0x7ea2('0x1'));var path=require(_0x7ea2('0x2'));var timeout=require(_0x7ea2('0x3'));var express=require(_0x7ea2('0x4'));var router=express[_0x7ea2('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7ea2('0x6'));var config=require(_0x7ea2('0x7'));var controller=require(_0x7ea2('0x8'));router[_0x7ea2('0x9')]('/',auth[_0x7ea2('0xa')](),controller['index']);router[_0x7ea2('0x9')](_0x7ea2('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x7ea2('0x9')](_0x7ea2('0xc'),auth[_0x7ea2('0xa')](),controller[_0x7ea2('0xd')]);router[_0x7ea2('0x9')](_0x7ea2('0xe'),auth[_0x7ea2('0xa')](),controller[_0x7ea2('0xf')]);router[_0x7ea2('0x9')](_0x7ea2('0x10'),auth[_0x7ea2('0xa')](),controller[_0x7ea2('0x11')]);router[_0x7ea2('0x12')]('/',auth[_0x7ea2('0xa')](),controller[_0x7ea2('0x13')]);router[_0x7ea2('0x12')](_0x7ea2('0xe'),auth['isAuthenticated'](),controller[_0x7ea2('0x14')]);router[_0x7ea2('0x12')](_0x7ea2('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0x7ea2('0x16'),_0x7ea2('0x17')),controller[_0x7ea2('0x18')]);router[_0x7ea2('0x19')]('/:id',auth[_0x7ea2('0xa')](),interaction[_0x7ea2('0x1a')](_0x7ea2('0x16'),'mailinteraction:update'),controller[_0x7ea2('0x1b')]);router['delete'](_0x7ea2('0xc'),auth[_0x7ea2('0xa')](),interaction[_0x7ea2('0x1a')](_0x7ea2('0x16'),_0x7ea2('0x1c')),controller[_0x7ea2('0x1d')]);router[_0x7ea2('0x1e')]('/:id/tags',auth[_0x7ea2('0xa')](),controller[_0x7ea2('0x1f')]);module[_0x7ea2('0x20')]=router; \ No newline at end of file +var _0x1803=['get','index','describe','/:id','isAuthenticated','show','getMessages','download','create','post','/:id/messages','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','delete','mailinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x44468d,_0x499cda){var _0x36c705=function(_0x3d3fc0){while(--_0x3d3fc0){_0x44468d['push'](_0x44468d['shift']());}};_0x36c705(++_0x499cda);}(_0x1803,0x1c9));var _0x3180=function(_0x51b0ce,_0x25216f){_0x51b0ce=_0x51b0ce-0x0;var _0x13a581=_0x1803[_0x51b0ce];return _0x13a581;};'use strict';var multer=require(_0x3180('0x0'));var util=require(_0x3180('0x1'));var path=require(_0x3180('0x2'));var timeout=require(_0x3180('0x3'));var express=require(_0x3180('0x4'));var router=express[_0x3180('0x5')]();var auth=require(_0x3180('0x6'));var interaction=require(_0x3180('0x7'));var config=require('../../config/environment');var controller=require('./mailInteraction.controller');router[_0x3180('0x8')]('/',auth['isAuthenticated'](),controller[_0x3180('0x9')]);router[_0x3180('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x3180('0xa')]);router[_0x3180('0x8')](_0x3180('0xb'),auth[_0x3180('0xc')](),controller[_0x3180('0xd')]);router[_0x3180('0x8')]('/:id/messages',auth[_0x3180('0xc')](),controller[_0x3180('0xe')]);router[_0x3180('0x8')]('/:id/download',auth[_0x3180('0xc')](),controller[_0x3180('0xf')]);router['post']('/',auth[_0x3180('0xc')](),controller[_0x3180('0x10')]);router[_0x3180('0x11')](_0x3180('0x12'),auth[_0x3180('0xc')](),controller[_0x3180('0x13')]);router[_0x3180('0x11')](_0x3180('0x14'),auth['isAuthenticated'](),interaction[_0x3180('0x15')](_0x3180('0x16'),_0x3180('0x17')),controller[_0x3180('0x18')]);router[_0x3180('0x19')]('/:id',auth[_0x3180('0xc')](),interaction[_0x3180('0x15')](_0x3180('0x16'),'mailinteraction:update'),controller[_0x3180('0x1a')]);router[_0x3180('0x1b')](_0x3180('0xb'),auth[_0x3180('0xc')](),interaction[_0x3180('0x15')](_0x3180('0x16'),_0x3180('0x1c')),controller[_0x3180('0x1d')]);router[_0x3180('0x1b')](_0x3180('0x14'),auth[_0x3180('0xc')](),controller['removeTags']);module[_0x3180('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index f14b18e..329a8a7 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 _0x00ee=['DATE','STRING','TEXT','long','ENUM','out','lastMsgBody','fromString','getDataValue','split','slice','sequelize','html-to-text','iconv','exports'];(function(_0x3d67d0,_0x59d1f9){var _0x34a470=function(_0x3c0a41){while(--_0x3c0a41){_0x3d67d0['push'](_0x3d67d0['shift']());}};_0x34a470(++_0x59d1f9);}(_0x00ee,0xdd));var _0xe00e=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x00ee[_0x238671];return _0x474844;};'use strict';var Sequelize=require(_0xe00e('0x0'));var htmlToText=require(_0xe00e('0x1'));var iconv=require(_0xe00e('0x2'));module[_0xe00e('0x3')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe00e('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe00e('0x5')]},'inReplyTo':{'type':Sequelize[_0xe00e('0x5')](0x1fe)},'to':{'type':Sequelize[_0xe00e('0x5')]},'cc':{'type':Sequelize[_0xe00e('0x6')](_0xe00e('0x7'))},'subject':{'type':Sequelize[_0xe00e('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xe00e('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xe00e('0x8')]('in',_0xe00e('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe00e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xe00e('0x8')]('in',_0xe00e('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xe00e('0x6')](_0xe00e('0x7')),'get':function(){try{return this['getDataValue'](_0xe00e('0xa'))?htmlToText[_0xe00e('0xb')](this[_0xe00e('0xc')](_0xe00e('0xa')),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})[_0xe00e('0xd')]('\x0a')[_0xe00e('0xe')](0x0,0x6)['join']('\x0a'):null;}catch(_0x421fb1){return null;}}}}; \ No newline at end of file +var _0xd28c=['lastMsgBody','fromString','split','slice','html-to-text','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','getDataValue'];(function(_0x402baa,_0x713d8d){var _0x11fcaa=function(_0x598088){while(--_0x598088){_0x402baa['push'](_0x402baa['shift']());}};_0x11fcaa(++_0x713d8d);}(_0xd28c,0xad));var _0xcd28=function(_0x12480b,_0x14f9db){_0x12480b=_0x12480b-0x0;var _0x286a8b=_0xd28c[_0x12480b];return _0x286a8b;};'use strict';var Sequelize=require('sequelize');var htmlToText=require(_0xcd28('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcd28('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xcd28('0x3')](0x1fe)},'to':{'type':Sequelize[_0xcd28('0x3')]},'cc':{'type':Sequelize[_0xcd28('0x4')](_0xcd28('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xcd28('0x2')]},'substatus':{'type':Sequelize[_0xcd28('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xcd28('0x6')]('in',_0xcd28('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcd28('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xcd28('0x6')]('in',_0xcd28('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xcd28('0x4')](_0xcd28('0x5')),'get':function(){try{return this[_0xcd28('0x8')](_0xcd28('0x9'))?htmlToText[_0xcd28('0xa')](this['getDataValue'](_0xcd28('0x9')),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})[_0xcd28('0xb')]('\x0a')[_0xcd28('0xc')](0x0,0x6)['join']('\x0a'):null;}catch(_0x32e4df){return null;}}}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index fb25ebb..beed982 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 _0x3ee5=['order','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','emit','removeTags','download','unix','root','server','files','attachments','join','tmp','interaction-%s.zip','from','Attachments','mkdirSync','each','subject','basename','existsSync','readFileSync','message%d.eml','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','end','count','offset','set','Content-Range','apply','update','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','limit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','tag','include','push','Tag','Tags','read','MailMessage','Messages','direction','createdAt','distinct','then','includeAll','fullname','CmContact','Contact','User','internal','MailAccount','color','findAll','catch','params','MailInteraction','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty'];(function(_0x3eee6f,_0x4b3c9f){var _0x2b4995=function(_0x2a7cc2){while(--_0x2a7cc2){_0x3eee6f['push'](_0x3eee6f['shift']());}};_0x2b4995(++_0x4b3c9f);}(_0x3ee5,0x122));var _0x53ee=function(_0x2a36dd,_0x3af179){_0x2a36dd=_0x2a36dd-0x0;var _0x306ac6=_0x3ee5[_0x2a36dd];return _0x306ac6;};'use strict';var pdf=require(_0x53ee('0x0'));var emlformat=require(_0x53ee('0x1'));var rimraf=require(_0x53ee('0x2'));var zipdir=require(_0x53ee('0x3'));var jsonpatch=require(_0x53ee('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x53ee('0x5'));var Mustache=require(_0x53ee('0x6'));var util=require(_0x53ee('0x7'));var path=require(_0x53ee('0x8'));var sox=require('sox');var csv=require(_0x53ee('0x9'));var ejs=require(_0x53ee('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x53ee('0xb'));var crypto=require(_0x53ee('0xc'));var jsforce=require(_0x53ee('0xd'));var deskjs=require(_0x53ee('0xe'));var toCsv=require(_0x53ee('0x9'));var querystring=require(_0x53ee('0xf'));var Papa=require(_0x53ee('0x10'));var authService=require(_0x53ee('0x11'));var hardwareService=require(_0x53ee('0x12'));var Redis=require('ioredis');var qs=require(_0x53ee('0x13'));var logger=require(_0x53ee('0x14'))('api');var utils=require(_0x53ee('0x15'));var config=require(_0x53ee('0x16'));var db=require(_0x53ee('0x17'))['db'];config[_0x53ee('0x18')]=_[_0x53ee('0x19')](config[_0x53ee('0x18')],{'host':_0x53ee('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53ee('0x18')]));require(_0x53ee('0x1b'))[_0x53ee('0x1c')](socket);function respondWithStatusCode(_0xe04945,_0x3b9dc7){_0x3b9dc7=_0x3b9dc7||0xcc;return function(_0x2f0fdb){if(_0x2f0fdb){return _0xe04945[_0x53ee('0x1d')](_0x3b9dc7);}return _0xe04945[_0x53ee('0x1e')](_0x3b9dc7)[_0x53ee('0x1f')]();};}function respondWithResult(_0x7fa021,_0x18bcae){_0x18bcae=_0x18bcae||0xc8;return function(_0x54d1e8){if(_0x54d1e8){return _0x7fa021['status'](_0x18bcae)['json'](_0x54d1e8);}};}function respondWithFilteredResult(_0x5f80d4,_0x37953c){return function(_0xe88fe2){if(_0xe88fe2){var _0x3e4bf8=_0xe88fe2[_0x53ee('0x20')],_0x4b131c=_0x37953c['offset'],_0x2f8f32=_0x37953c[_0x53ee('0x21')]+_0x37953c['limit'],_0x285aa7;if(_0x2f8f32>=_0x3e4bf8){_0x2f8f32=_0x3e4bf8;_0x285aa7=0xc8;}else{_0x285aa7=0xce;}_0x5f80d4[_0x53ee('0x1e')](_0x285aa7);return _0x5f80d4[_0x53ee('0x22')](_0x53ee('0x23'),_0x4b131c+'-'+_0x2f8f32+'/'+_0x3e4bf8)['json'](_0xe88fe2);}return null;};}function patchUpdates(_0xf8f7f2){return function(_0x70737d){try{jsonpatch[_0x53ee('0x24')](_0x70737d,_0xf8f7f2,!![]);}catch(_0x4d2fa8){return BPromise['reject'](_0x4d2fa8);}return _0x70737d['save']();};}function saveUpdates(_0x51307f,_0x4ed09e){return function(_0x22df7a){if(_0x22df7a){return _0x22df7a[_0x53ee('0x25')](_0x51307f)['then'](function(_0x2334da){return _0x2334da;});}return null;};}function removeEntity(_0x45aac0,_0x1e623d){return function(_0x5f1f53){if(_0x5f1f53){return _0x5f1f53[_0x53ee('0x26')]()['then'](function(){_0x45aac0[_0x53ee('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1df48f,_0xb17238){return function(_0x56d730){if(!_0x56d730){_0x1df48f[_0x53ee('0x1d')](0x194);}return _0x56d730;};}function handleError(_0x45c7f2,_0x27939a){_0x27939a=_0x27939a||0x1f4;return function(_0x4cdb15){logger[_0x53ee('0x27')](_0x4cdb15[_0x53ee('0x28')]);if(_0x4cdb15['name']){delete _0x4cdb15[_0x53ee('0x29')];}_0x45c7f2[_0x53ee('0x1e')](_0x27939a)[_0x53ee('0x2a')](_0x4cdb15);};}exports[_0x53ee('0x2b')]=function(_0x56c1c4,_0x2dbae9){var _0xdeec0={},_0x50e6d2={},_0x50832f={'count':0x0,'rows':[]};var _0x4ba085=db['MailInteraction'][_0x53ee('0x2c')];_0x50e6d2[_0x53ee('0x2d')]=_['keys'](_0x4ba085);_0x50e6d2['query']=_[_0x53ee('0x2e')](_0x56c1c4[_0x53ee('0x2f')]);_0x50e6d2['filters']=_[_0x53ee('0x30')](_0x50e6d2[_0x53ee('0x2d')],_0x50e6d2[_0x53ee('0x2f')]);_0xdeec0[_0x53ee('0x31')]=_[_0x53ee('0x30')](_0x50e6d2[_0x53ee('0x2d')],qs[_0x53ee('0x32')](_0x56c1c4['query']['fields']));_0xdeec0['attributes']=_0xdeec0[_0x53ee('0x31')][_0x53ee('0x33')]?_0xdeec0[_0x53ee('0x31')]:_0x50e6d2[_0x53ee('0x2d')];if(!_0x56c1c4[_0x53ee('0x2f')]['hasOwnProperty'](_0x53ee('0x34'))){_0xdeec0[_0x53ee('0x35')]=qs[_0x53ee('0x35')](_0x56c1c4['query'][_0x53ee('0x35')]);_0xdeec0[_0x53ee('0x21')]=qs[_0x53ee('0x21')](_0x56c1c4['query'][_0x53ee('0x21')]);}_0xdeec0['order']=qs[_0x53ee('0x36')](_0x56c1c4[_0x53ee('0x2f')][_0x53ee('0x36')]);_0xdeec0[_0x53ee('0x37')]=qs[_0x53ee('0x38')](_[_0x53ee('0x39')](_0x56c1c4['query'],_0x50e6d2[_0x53ee('0x38')]));if(_0x56c1c4['query'][_0x53ee('0x3a')]){_0xdeec0[_0x53ee('0x37')]=_[_0x53ee('0x3b')](_0xdeec0['where'],{'$or':_[_0x53ee('0x3c')](_0x4ba085,function(_0x57c8b1){if(_0x57c8b1[_0x53ee('0x3d')][_0x53ee('0x3e')]!==_0x53ee('0x3f')){var _0x188669={};_0x188669[_0x57c8b1[_0x53ee('0x40')]]={'$like':'%'+_0x56c1c4[_0x53ee('0x2f')][_0x53ee('0x3a')]+'%'};return _0x188669;}})});}_0xdeec0=_[_0x53ee('0x3b')]({},_0xdeec0,_0x56c1c4[_0x53ee('0x41')]);var _0x6050e3={'where':_0xdeec0['where']};_0x6050e3['include']=[];if(_0x56c1c4[_0x53ee('0x2f')][_0x53ee('0x42')]){_0x6050e3[_0x53ee('0x43')][_0x53ee('0x44')]({'model':db[_0x53ee('0x45')],'as':_0x53ee('0x46'),'attributes':['id'],'where':{'id':_0x56c1c4[_0x53ee('0x2f')][_0x53ee('0x42')]},'required':!![]});_0x6050e3['distinct']=!![];}if(_0x56c1c4['query'][_0x53ee('0x47')]){_0x6050e3[_0x53ee('0x43')][_0x53ee('0x44')]({'model':db[_0x53ee('0x48')],'as':_0x53ee('0x49'),'attributes':['id',_0x53ee('0x4a'),_0x53ee('0x4b'),'read'],'where':{'direction':'in','read':_0x56c1c4[_0x53ee('0x2f')][_0x53ee('0x47')]||![]},'required':!![]});_0x6050e3[_0x53ee('0x4c')]=!![];}return db['MailInteraction'][_0x53ee('0x20')](_0x6050e3)[_0x53ee('0x4d')](function(_0x334052){_0x50832f[_0x53ee('0x20')]=_0x334052;if(_0x56c1c4[_0x53ee('0x2f')][_0x53ee('0x4e')]){_0xdeec0[_0x53ee('0x43')]=[{'model':db['User'],'as':'Users','required':![],'attributes':['id',_0x53ee('0x29'),_0x53ee('0x4f')]},{'model':db[_0x53ee('0x50')],'as':_0x53ee('0x51'),'required':![]},{'model':db[_0x53ee('0x52')],'as':'Owner','attributes':[_0x53ee('0x29'),_0x53ee('0x4f'),_0x53ee('0x53')],'required':![]},{'model':db[_0x53ee('0x54')],'as':'Account','attributes':[_0x53ee('0x29'),'key','email'],'required':![]},{'model':db['MailMessage'],'as':_0x53ee('0x49'),'attributes':['id',_0x53ee('0x4a'),_0x53ee('0x4b'),_0x53ee('0x47')],'where':{'direction':'in','read':_0x56c1c4[_0x53ee('0x2f')][_0x53ee('0x47')]||![]},'required':_0x56c1c4['query']['read']||![]},{'model':db[_0x53ee('0x45')],'as':_0x53ee('0x46'),'attributes':['id',_0x53ee('0x29'),_0x53ee('0x55')],'required':_0x56c1c4[_0x53ee('0x2f')][_0x53ee('0x42')]?!![]:![]},{'model':db['Tag'],'as':'ThroughTags','attributes':['id','name',_0x53ee('0x55')],'through':_0x56c1c4[_0x53ee('0x2f')]['tag']?{'attributes':[],'where':{'TagId':_0x56c1c4[_0x53ee('0x2f')][_0x53ee('0x42')]||undefined}}:{},'required':_0x56c1c4[_0x53ee('0x2f')]['tag']?!![]:![]}];}return db['MailInteraction'][_0x53ee('0x56')](_0xdeec0);})[_0x53ee('0x4d')](function(_0x2e3437){_0x50832f['rows']=_0x2e3437;return _0x50832f;})['then'](respondWithFilteredResult(_0x2dbae9,_0xdeec0))[_0x53ee('0x57')](handleError(_0x2dbae9,null));};exports['show']=function(_0x2b6568,_0x543048){var _0x34baa5={'raw':![],'where':{'id':_0x2b6568[_0x53ee('0x58')]['id']}},_0x49e777={};_0x49e777[_0x53ee('0x2d')]=_['keys'](db[_0x53ee('0x59')][_0x53ee('0x2c')]);_0x49e777[_0x53ee('0x2f')]=_[_0x53ee('0x2e')](_0x2b6568[_0x53ee('0x2f')]);_0x49e777['filters']=_[_0x53ee('0x30')](_0x49e777[_0x53ee('0x2d')],_0x49e777[_0x53ee('0x2f')]);_0x34baa5['attributes']=_['intersection'](_0x49e777['model'],qs[_0x53ee('0x32')](_0x2b6568[_0x53ee('0x2f')][_0x53ee('0x32')]));_0x34baa5['attributes']=_0x34baa5['attributes'][_0x53ee('0x33')]?_0x34baa5[_0x53ee('0x31')]:_0x49e777['model'];if(_0x2b6568['query'][_0x53ee('0x4e')]){_0x34baa5['include']=[{'all':!![]}];}_0x34baa5=_[_0x53ee('0x3b')]({},_0x34baa5,_0x2b6568[_0x53ee('0x41')]);return db[_0x53ee('0x59')][_0x53ee('0x5a')](_0x34baa5)[_0x53ee('0x4d')](handleEntityNotFound(_0x543048,null))['then'](respondWithResult(_0x543048,null))['catch'](handleError(_0x543048,null));};exports['create']=function(_0x47abde,_0x409e6d){return db[_0x53ee('0x59')][_0x53ee('0x5b')](_0x47abde[_0x53ee('0x5c')],{})['then'](respondWithResult(_0x409e6d,0xc9))[_0x53ee('0x57')](handleError(_0x409e6d,null));};exports['update']=function(_0x3d7502,_0xd6a3d8){if(_0x3d7502[_0x53ee('0x5c')]['id']){delete _0x3d7502[_0x53ee('0x5c')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x3d7502[_0x53ee('0x58')]['id']}})[_0x53ee('0x4d')](handleEntityNotFound(_0xd6a3d8,null))['then'](saveUpdates(_0x3d7502[_0x53ee('0x5c')],null))[_0x53ee('0x4d')](respondWithResult(_0xd6a3d8,null))[_0x53ee('0x57')](handleError(_0xd6a3d8,null));};exports[_0x53ee('0x26')]=function(_0x873e2a,_0x5aaa08){return db[_0x53ee('0x59')][_0x53ee('0x5a')]({'where':{'id':_0x873e2a[_0x53ee('0x58')]['id']}})[_0x53ee('0x4d')](handleEntityNotFound(_0x5aaa08,null))['then'](removeEntity(_0x5aaa08,null))[_0x53ee('0x57')](handleError(_0x5aaa08,null));};exports[_0x53ee('0x5d')]=function(_0x13f6c8,_0x1b7f51){return db[_0x53ee('0x59')]['describe']()[_0x53ee('0x4d')](respondWithResult(_0x1b7f51,null))['catch'](handleError(_0x1b7f51,null));};exports[_0x53ee('0x5e')]=function(_0x2adab9,_0x1f1d5e,_0x151d9c){return db[_0x53ee('0x48')][_0x53ee('0x5a')]({'where':{'id':_0x2adab9[_0x53ee('0x58')]['id']}})[_0x53ee('0x4d')](handleEntityNotFound(_0x1f1d5e,null))[_0x53ee('0x4d')](function(_0x5ad9f1){if(_0x5ad9f1){return _0x5ad9f1[_0x53ee('0x5e')](_0x2adab9[_0x53ee('0x5c')][_0x53ee('0x5f')],_[_0x53ee('0x60')](_0x2adab9[_0x53ee('0x5c')],[_0x53ee('0x5f'),'id'])||{});}})[_0x53ee('0x4d')](respondWithResult(_0x1f1d5e,null))[_0x53ee('0x57')](handleError(_0x1f1d5e,null));};exports[_0x53ee('0x61')]=function(_0x5493ec,_0x1e8429,_0x212184){var _0x2302c8={'raw':![],'where':{}};var _0x1560b1={};var _0x80cac0={'count':0x0,'rows':[]};return db['MailInteraction'][_0x53ee('0x62')]({'where':{'id':_0x5493ec['params']['id']}})[_0x53ee('0x4d')](handleEntityNotFound(_0x1e8429,null))[_0x53ee('0x4d')](function(_0x1a9c73){if(_0x1a9c73){_0x1560b1[_0x53ee('0x2d')]=_[_0x53ee('0x2e')](db[_0x53ee('0x48')][_0x53ee('0x2c')]);_0x1560b1[_0x53ee('0x2f')]=_[_0x53ee('0x2e')](_0x5493ec[_0x53ee('0x2f')]);_0x1560b1[_0x53ee('0x38')]=_['intersection'](_0x1560b1[_0x53ee('0x2d')],_0x1560b1['query']);_0x2302c8[_0x53ee('0x31')]=_[_0x53ee('0x30')](_0x1560b1[_0x53ee('0x2d')],qs[_0x53ee('0x32')](_0x5493ec[_0x53ee('0x2f')][_0x53ee('0x32')]));_0x2302c8[_0x53ee('0x31')]=_0x2302c8[_0x53ee('0x31')][_0x53ee('0x33')]?_0x2302c8['attributes']:_0x1560b1[_0x53ee('0x2d')];if(!_0x5493ec[_0x53ee('0x2f')][_0x53ee('0x63')]('nolimit')){_0x2302c8[_0x53ee('0x35')]=qs[_0x53ee('0x35')](_0x5493ec[_0x53ee('0x2f')][_0x53ee('0x35')]);_0x2302c8[_0x53ee('0x21')]=qs['offset'](_0x5493ec['query']['offset']);}_0x2302c8[_0x53ee('0x64')]=qs['sort'](_0x5493ec[_0x53ee('0x2f')][_0x53ee('0x36')]);_0x2302c8[_0x53ee('0x37')]=qs[_0x53ee('0x38')](_[_0x53ee('0x39')](_0x5493ec[_0x53ee('0x2f')],_0x1560b1[_0x53ee('0x38')]));_0x2302c8[_0x53ee('0x37')][_0x53ee('0x65')]=_0x1a9c73['id'];if(_0x5493ec[_0x53ee('0x2f')][_0x53ee('0x3a')]){_0x2302c8[_0x53ee('0x37')]=_[_0x53ee('0x3b')](_0x2302c8[_0x53ee('0x37')],{'$or':_[_0x53ee('0x3c')](_0x2302c8[_0x53ee('0x31')],function(_0x102b2e){var _0x32a960={};_0x32a960[_0x102b2e]={'$like':'%'+_0x5493ec[_0x53ee('0x2f')]['filter']+'%'};return _0x32a960;})});}if(_0x5493ec[_0x53ee('0x2f')]['$gte']){var _0x58262f=_0x5493ec[_0x53ee('0x2f')]['$gte']['split'](',');var _0x4a9e9f={};_0x4a9e9f[_0x58262f[0x0]]={'$gte':moment(_0x58262f[0x1])[_0x53ee('0x66')](_0x53ee('0x67'))};_0x2302c8['where']=_['merge'](_0x2302c8['where'],_0x4a9e9f);}_0x2302c8=_[_0x53ee('0x3b')]({},_0x2302c8,_0x5493ec[_0x53ee('0x41')]);return db[_0x53ee('0x48')][_0x53ee('0x20')]({'where':_0x2302c8['where']})[_0x53ee('0x4d')](function(_0x3a65c0){_0x80cac0[_0x53ee('0x20')]=_0x3a65c0;if(_0x5493ec[_0x53ee('0x2f')][_0x53ee('0x4e')]){_0x2302c8[_0x53ee('0x43')]=[{'all':!![]}];}return db[_0x53ee('0x48')][_0x53ee('0x56')](_0x2302c8);})[_0x53ee('0x4d')](function(_0x4c1c69){_0x80cac0[_0x53ee('0x68')]=_0x4c1c69;return _0x80cac0;});}})[_0x53ee('0x4d')](respondWithFilteredResult(_0x1e8429,_0x2302c8))[_0x53ee('0x57')](handleError(_0x1e8429,null));};exports[_0x53ee('0x69')]=function(_0x2cdae3,_0x262e47,_0x4cd8c1){return db[_0x53ee('0x59')][_0x53ee('0x5a')]({'where':{'id':_0x2cdae3[_0x53ee('0x58')]['id']}})[_0x53ee('0x4d')](handleEntityNotFound(_0x262e47,null))[_0x53ee('0x4d')](function(_0x395446){if(_0x395446){return _0x395446[_0x53ee('0x6a')](_0x2cdae3[_0x53ee('0x5c')]['ids'],_[_0x53ee('0x60')](_0x2cdae3['body'],[_0x53ee('0x5f'),'id'])||{})[_0x53ee('0x6b')](function(){return db[_0x53ee('0x45')][_0x53ee('0x56')]({'attributes':['id',_0x53ee('0x29'),_0x53ee('0x55')],'where':{'id':_0x2cdae3[_0x53ee('0x5c')]['ids']}});})['then'](function(_0x17f6e9){socket[_0x53ee('0x6c')]('mailInteractionTags:save',{'id':Number(_0x2cdae3[_0x53ee('0x58')]['id']),'tags':_0x17f6e9||[]});return{'id':Number(_0x2cdae3[_0x53ee('0x58')]['id']),'tags':_0x17f6e9||[]};});}})[_0x53ee('0x4d')](respondWithResult(_0x262e47,null))[_0x53ee('0x57')](handleError(_0x262e47,null));};exports[_0x53ee('0x6d')]=function(_0x53e30e,_0x4f5f55,_0x96b9fa){var _0x3cfdc3;return db['MailInteraction'][_0x53ee('0x5a')]({'where':{'id':_0x53e30e[_0x53ee('0x58')]['id']}})['then'](handleEntityNotFound(_0x4f5f55,null))[_0x53ee('0x4d')](function(_0x25bdeb){if(_0x25bdeb){return _0x25bdeb[_0x53ee('0x6d')](_0x53e30e[_0x53ee('0x2f')][_0x53ee('0x5f')]);}})[_0x53ee('0x4d')](respondWithStatusCode(_0x4f5f55,null))[_0x53ee('0x57')](handleError(_0x4f5f55,null));};exports[_0x53ee('0x6e')]=function(_0x5166ed,_0x55815b){var _0x59c604=moment()[_0x53ee('0x6f')]()['toString']();var _0x3bf7c9=path['join'](config[_0x53ee('0x70')],_0x53ee('0x71'),_0x53ee('0x72'),_0x53ee('0x73'));var _0x5ebaed=path[_0x53ee('0x74')](config[_0x53ee('0x70')],_0x53ee('0x71'),_0x53ee('0x72'),_0x53ee('0x75'));var _0x58b140=path[_0x53ee('0x74')](_0x5ebaed,_0x59c604);var _0x2d7a0f=util[_0x53ee('0x66')](_0x53ee('0x76'),_0x59c604);var _0x2f5899=path[_0x53ee('0x74')](_0x5ebaed,_0x2d7a0f);var _0x142b29=![];return db['MailInteraction']['find']({'where':{'id':_0x5166ed[_0x53ee('0x58')]['id']}})['then'](handleEntityNotFound(_0x55815b,null))['then'](function(_0x17fbba){if(_0x17fbba){return _0x17fbba[_0x53ee('0x61')]({'attributes':['id','body',_0x53ee('0x77'),'to','cc','subject','createdAt'],'where':{'secret':![]},'include':_0x5166ed['query']['attachments']?[{'model':db['Attachment'],'as':_0x53ee('0x78')}]:undefined,'order':qs[_0x53ee('0x36')]('id')});}return[];})[_0x53ee('0x4d')](function(_0x1845e4){_0x142b29=_0x1845e4[_0x53ee('0x33')];if(_0x1845e4[_0x53ee('0x33')]){fs[_0x53ee('0x79')](_0x58b140);return BPromise[_0x53ee('0x7a')](_0x1845e4,function(_0x18030e,_0x498bd3){var _0x2f7f2f=_0x18030e;var _0x5c68be={'from':_0x2f7f2f[_0x53ee('0x77')],'to':_0x2f7f2f['to'],'subject':_0x2f7f2f[_0x53ee('0x7b')],'html':_0x2f7f2f[_0x53ee('0x5c')],'headers':{'Date':moment(_0x2f7f2f['createdAt'])['format']('ddd,\x20d\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};return new BPromise(function(_0xb68fa1,_0x26a21a){if(_0x18030e[_0x53ee('0x78')]){for(var _0x356d05=0x0;_0x356d05<_0x18030e[_0x53ee('0x78')]['length'];_0x356d05++){var _0x16f655=_0x18030e[_0x53ee('0x78')][_0x356d05];var _0x23cbe6=path[_0x53ee('0x74')](_0x3bf7c9,_0x16f655[_0x53ee('0x7c')]);if(fs[_0x53ee('0x7d')](_0x23cbe6)){_0x5c68be[_0x53ee('0x73')][_0x53ee('0x44')]({'name':_0x16f655[_0x53ee('0x29')],'contentType':_0x16f655[_0x53ee('0x3d')],'data':fs[_0x53ee('0x7e')](_0x23cbe6)});}}}emlformat['build'](_0x5c68be,function(_0x5c5d71,_0x2e7122){if(_0x5c5d71)return _0x26a21a(_0x5c5d71);fs['writeFileSync'](path['join'](_0x58b140,util[_0x53ee('0x66')](_0x53ee('0x7f'),_0x498bd3)),_0x2e7122);return _0xb68fa1(_0x2e7122);});});});}})[_0x53ee('0x4d')](function(){if(_0x142b29){return new BPromise(function(_0x5f4f54,_0x290fcc){zipdir(_0x58b140,{'saveTo':_0x2f5899},function(_0x49cfde,_0x5ce4b0){if(_0x49cfde)return _0x290fcc(_0x49cfde);return _0x5f4f54(_0x5ce4b0);});});}})[_0x53ee('0x4d')](function(){if(_0x142b29){return new BPromise(function(_0x5723fb,_0x5aa6b1){rimraf(_0x58b140,function(_0x40a7f8){if(_0x40a7f8)_0x5aa6b1(_0x40a7f8);return _0x5723fb();});});}})[_0x53ee('0x4d')](function(){if(_0x142b29){return _0x55815b[_0x53ee('0x6e')](_0x2f5899,_0x2d7a0f,function(_0x1a0950){if(_0x1a0950){console[_0x53ee('0x80')]('err',_0x1a0950);}else{fs[_0x53ee('0x81')](_0x2f5899);}});}else{return _0x55815b[_0x53ee('0x1d')](0xc8);}})[_0x53ee('0x57')](handleError(_0x55815b,null));}; \ No newline at end of file +var _0x0b0e=['unlinkSync','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','json','offset','set','apply','reject','save','then','destroy','status','error','stack','name','index','MailInteraction','rawAttributes','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','map','type','VIRTUAL','field','merge','options','include','tag','push','Tags','distinct','read','MailMessage','Messages','direction','createdAt','count','User','Users','fullname','Owner','internal','MailAccount','Account','key','color','Tag','catch','show','includeAll','find','create','body','update','params','describe','addMessage','ids','omit','getMessages','findOne','length','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','removeTags','download','unix','toString','join','root','server','files','tmp','from','subject','attachments','Attachment','Attachments','mkdirSync','format','basename','readFileSync','writeFileSync','message%d.eml','log','err'];(function(_0x4b6333,_0x277e07){var _0x11671d=function(_0x1e0546){while(--_0x1e0546){_0x4b6333['push'](_0x4b6333['shift']());}};_0x11671d(++_0x277e07);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2242a1,_0x38f44d){_0x2242a1=_0x2242a1-0x0;var _0x2c298b=_0x0b0e[_0x2242a1];return _0x2c298b;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var authService=require(_0xe0b0('0x10'));var hardwareService=require(_0xe0b0('0x11'));var Redis=require('ioredis');var qs=require(_0xe0b0('0x12'));var logger=require(_0xe0b0('0x13'))('api');var utils=require(_0xe0b0('0x14'));var config=require(_0xe0b0('0x15'));var db=require(_0xe0b0('0x16'))['db'];config['redis']=_[_0xe0b0('0x17')](config[_0xe0b0('0x18')],{'host':_0xe0b0('0x19'),'port':0x18eb});var socket=require(_0xe0b0('0x1a'))(new Redis(config[_0xe0b0('0x18')]));require('./mailInteraction.socket')[_0xe0b0('0x1b')](socket);function respondWithStatusCode(_0x154de6,_0x743318){_0x743318=_0x743318||0xcc;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1c')](_0x743318);}return _0x154de6['status'](_0x743318)[_0xe0b0('0x1d')]();};}function respondWithResult(_0x5adb01,_0x35cb40){_0x35cb40=_0x35cb40||0xc8;return function(_0xadee6e){if(_0xadee6e){return _0x5adb01['status'](_0x35cb40)[_0xe0b0('0x1e')](_0xadee6e);}};}function respondWithFilteredResult(_0x4a4cc0,_0x2d6fb6){return function(_0x100204){if(_0x100204){var _0x56bcc7=_0x100204['count'],_0x54a3eb=_0x2d6fb6['offset'],_0x46bb44=_0x2d6fb6[_0xe0b0('0x1f')]+_0x2d6fb6['limit'],_0x50a441;if(_0x46bb44>=_0x56bcc7){_0x46bb44=_0x56bcc7;_0x50a441=0xc8;}else{_0x50a441=0xce;}_0x4a4cc0['status'](_0x50a441);return _0x4a4cc0[_0xe0b0('0x20')]('Content-Range',_0x54a3eb+'-'+_0x46bb44+'/'+_0x56bcc7)[_0xe0b0('0x1e')](_0x100204);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x21')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x22')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x23')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x24')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x25')]()['then'](function(){_0x513e63[_0xe0b0('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x27')](_0x362aba[_0xe0b0('0x28')]);if(_0x362aba[_0xe0b0('0x29')]){delete _0x362aba[_0xe0b0('0x29')];}_0x3c221d[_0xe0b0('0x26')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x2a')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=db[_0xe0b0('0x2b')][_0xe0b0('0x2c')];_0x419b1f[_0xe0b0('0x2d')]=_['keys'](_0x1d5759);_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8['query']);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x2d')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x31')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x32')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x32')]));_0x15e13b[_0xe0b0('0x31')]=_0x15e13b[_0xe0b0('0x31')]['length']?_0x15e13b[_0xe0b0('0x31')]:_0x419b1f[_0xe0b0('0x2d')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')](_0xe0b0('0x34'))){_0x15e13b[_0xe0b0('0x35')]=qs[_0xe0b0('0x35')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')]);_0x15e13b[_0xe0b0('0x1f')]=qs[_0xe0b0('0x1f')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1f')]);}_0x15e13b[_0xe0b0('0x36')]=qs[_0xe0b0('0x37')](_0x1b8aa8['query'][_0xe0b0('0x37')]);_0x15e13b[_0xe0b0('0x38')]=qs[_0xe0b0('0x39')](_[_0xe0b0('0x3a')](_0x1b8aa8[_0xe0b0('0x2e')],_0x419b1f[_0xe0b0('0x39')]));if(_0x1b8aa8[_0xe0b0('0x2e')]['filter']){_0x15e13b['where']=_['merge'](_0x15e13b['where'],{'$or':_[_0xe0b0('0x3b')](_0x1d5759,function(_0xc3d967){if(_0xc3d967[_0xe0b0('0x3c')]['key']!==_0xe0b0('0x3d')){var _0x352c09={};_0x352c09[_0xc3d967[_0xe0b0('0x3e')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')]['filter']+'%'};return _0x352c09;}})});}_0x15e13b=_[_0xe0b0('0x3f')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x40')]);var _0x43d352={'where':_0x15e13b[_0xe0b0('0x38')]};_0x43d352[_0xe0b0('0x41')]=[];if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x42')]){_0x43d352[_0xe0b0('0x41')][_0xe0b0('0x43')]({'model':db['Tag'],'as':_0xe0b0('0x44'),'attributes':['id'],'where':{'id':_0x1b8aa8['query'][_0xe0b0('0x42')]},'required':!![]});_0x43d352[_0xe0b0('0x45')]=!![];}if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x46')]){_0x43d352['include'][_0xe0b0('0x43')]({'model':db[_0xe0b0('0x47')],'as':_0xe0b0('0x48'),'attributes':['id',_0xe0b0('0x49'),_0xe0b0('0x4a'),_0xe0b0('0x46')],'where':{'direction':'in','read':_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x46')]||![]},'required':!![]});_0x43d352['distinct']=!![];}return db[_0xe0b0('0x2b')][_0xe0b0('0x4b')](_0x43d352)['then'](function(_0x515bd2){_0x36d137[_0xe0b0('0x4b')]=_0x515bd2;if(_0x1b8aa8[_0xe0b0('0x2e')]['includeAll']){_0x15e13b[_0xe0b0('0x41')]=[{'model':db[_0xe0b0('0x4c')],'as':_0xe0b0('0x4d'),'required':![],'attributes':['id',_0xe0b0('0x29'),_0xe0b0('0x4e')]},{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xe0b0('0x4f'),'attributes':[_0xe0b0('0x29'),'fullname',_0xe0b0('0x50')],'required':![]},{'model':db[_0xe0b0('0x51')],'as':_0xe0b0('0x52'),'attributes':[_0xe0b0('0x29'),_0xe0b0('0x53'),'email'],'required':![]},{'model':db['MailMessage'],'as':_0xe0b0('0x48'),'attributes':['id',_0xe0b0('0x49'),_0xe0b0('0x4a'),_0xe0b0('0x46')],'where':{'direction':'in','read':_0x1b8aa8[_0xe0b0('0x2e')]['read']||![]},'required':_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x46')]||![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0xe0b0('0x54')],'required':_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x42')]?!![]:![]},{'model':db[_0xe0b0('0x55')],'as':'ThroughTags','attributes':['id',_0xe0b0('0x29'),_0xe0b0('0x54')],'through':_0x1b8aa8['query']['tag']?{'attributes':[],'where':{'TagId':_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x42')]||undefined}}:{},'required':_0x1b8aa8['query'][_0xe0b0('0x42')]?!![]:![]}];}return db[_0xe0b0('0x2b')]['findAll'](_0x15e13b);})['then'](function(_0x123ad2){_0x36d137['rows']=_0x123ad2;return _0x36d137;})[_0xe0b0('0x24')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x56')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x57')]=function(_0x45cc4e,_0x19ee71){var _0xf9e694={'raw':![],'where':{'id':_0x45cc4e['params']['id']}},_0x5f5486={};_0x5f5486[_0xe0b0('0x2d')]=_['keys'](db['MailInteraction'][_0xe0b0('0x2c')]);_0x5f5486[_0xe0b0('0x2e')]=_['keys'](_0x45cc4e['query']);_0x5f5486[_0xe0b0('0x39')]=_[_0xe0b0('0x30')](_0x5f5486[_0xe0b0('0x2d')],_0x5f5486[_0xe0b0('0x2e')]);_0xf9e694[_0xe0b0('0x31')]=_[_0xe0b0('0x30')](_0x5f5486[_0xe0b0('0x2d')],qs['fields'](_0x45cc4e[_0xe0b0('0x2e')]['fields']));_0xf9e694[_0xe0b0('0x31')]=_0xf9e694['attributes']['length']?_0xf9e694[_0xe0b0('0x31')]:_0x5f5486[_0xe0b0('0x2d')];if(_0x45cc4e[_0xe0b0('0x2e')][_0xe0b0('0x58')]){_0xf9e694[_0xe0b0('0x41')]=[{'all':!![]}];}_0xf9e694=_[_0xe0b0('0x3f')]({},_0xf9e694,_0x45cc4e[_0xe0b0('0x40')]);return db[_0xe0b0('0x2b')][_0xe0b0('0x59')](_0xf9e694)['then'](handleEntityNotFound(_0x19ee71,null))[_0xe0b0('0x24')](respondWithResult(_0x19ee71,null))['catch'](handleError(_0x19ee71,null));};exports[_0xe0b0('0x5a')]=function(_0x3ae36e,_0x30c4a9){return db[_0xe0b0('0x2b')][_0xe0b0('0x5a')](_0x3ae36e[_0xe0b0('0x5b')],{})['then'](respondWithResult(_0x30c4a9,0xc9))[_0xe0b0('0x56')](handleError(_0x30c4a9,null));};exports[_0xe0b0('0x5c')]=function(_0x437a15,_0x271445){if(_0x437a15[_0xe0b0('0x5b')]['id']){delete _0x437a15[_0xe0b0('0x5b')]['id'];}return db[_0xe0b0('0x2b')][_0xe0b0('0x59')]({'where':{'id':_0x437a15[_0xe0b0('0x5d')]['id']}})[_0xe0b0('0x24')](handleEntityNotFound(_0x271445,null))[_0xe0b0('0x24')](saveUpdates(_0x437a15[_0xe0b0('0x5b')],null))[_0xe0b0('0x24')](respondWithResult(_0x271445,null))[_0xe0b0('0x56')](handleError(_0x271445,null));};exports[_0xe0b0('0x25')]=function(_0x34c642,_0x4c7661){return db[_0xe0b0('0x2b')]['find']({'where':{'id':_0x34c642[_0xe0b0('0x5d')]['id']}})[_0xe0b0('0x24')](handleEntityNotFound(_0x4c7661,null))[_0xe0b0('0x24')](removeEntity(_0x4c7661,null))[_0xe0b0('0x56')](handleError(_0x4c7661,null));};exports[_0xe0b0('0x5e')]=function(_0x405d7e,_0x2bdb59){return db['MailInteraction']['describe']()[_0xe0b0('0x24')](respondWithResult(_0x2bdb59,null))[_0xe0b0('0x56')](handleError(_0x2bdb59,null));};exports[_0xe0b0('0x5f')]=function(_0x47ecc1,_0x117d20,_0x13fb4b){return db[_0xe0b0('0x47')][_0xe0b0('0x59')]({'where':{'id':_0x47ecc1[_0xe0b0('0x5d')]['id']}})['then'](handleEntityNotFound(_0x117d20,null))[_0xe0b0('0x24')](function(_0x242120){if(_0x242120){return _0x242120[_0xe0b0('0x5f')](_0x47ecc1['body'][_0xe0b0('0x60')],_[_0xe0b0('0x61')](_0x47ecc1['body'],[_0xe0b0('0x60'),'id'])||{});}})['then'](respondWithResult(_0x117d20,null))['catch'](handleError(_0x117d20,null));};exports[_0xe0b0('0x62')]=function(_0x57b51e,_0x4d75e4,_0x416e0c){var _0xd750b4={'raw':![],'where':{}};var _0x2d91f1={};var _0x1a4fad={'count':0x0,'rows':[]};return db['MailInteraction'][_0xe0b0('0x63')]({'where':{'id':_0x57b51e[_0xe0b0('0x5d')]['id']}})[_0xe0b0('0x24')](handleEntityNotFound(_0x4d75e4,null))[_0xe0b0('0x24')](function(_0x1b29c){if(_0x1b29c){_0x2d91f1[_0xe0b0('0x2d')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x47')]['rawAttributes']);_0x2d91f1['query']=_[_0xe0b0('0x2f')](_0x57b51e[_0xe0b0('0x2e')]);_0x2d91f1[_0xe0b0('0x39')]=_['intersection'](_0x2d91f1['model'],_0x2d91f1[_0xe0b0('0x2e')]);_0xd750b4[_0xe0b0('0x31')]=_['intersection'](_0x2d91f1['model'],qs[_0xe0b0('0x32')](_0x57b51e[_0xe0b0('0x2e')][_0xe0b0('0x32')]));_0xd750b4[_0xe0b0('0x31')]=_0xd750b4[_0xe0b0('0x31')][_0xe0b0('0x64')]?_0xd750b4[_0xe0b0('0x31')]:_0x2d91f1[_0xe0b0('0x2d')];if(!_0x57b51e['query'][_0xe0b0('0x33')](_0xe0b0('0x34'))){_0xd750b4[_0xe0b0('0x35')]=qs['limit'](_0x57b51e['query']['limit']);_0xd750b4['offset']=qs['offset'](_0x57b51e['query'][_0xe0b0('0x1f')]);}_0xd750b4['order']=qs['sort'](_0x57b51e[_0xe0b0('0x2e')][_0xe0b0('0x37')]);_0xd750b4[_0xe0b0('0x38')]=qs[_0xe0b0('0x39')](_[_0xe0b0('0x3a')](_0x57b51e[_0xe0b0('0x2e')],_0x2d91f1[_0xe0b0('0x39')]));_0xd750b4[_0xe0b0('0x38')]['MailInteractionId']=_0x1b29c['id'];if(_0x57b51e[_0xe0b0('0x2e')][_0xe0b0('0x65')]){_0xd750b4[_0xe0b0('0x38')]=_[_0xe0b0('0x3f')](_0xd750b4[_0xe0b0('0x38')],{'$or':_[_0xe0b0('0x3b')](_0xd750b4[_0xe0b0('0x31')],function(_0x5e3e28){var _0xaf2607={};_0xaf2607[_0x5e3e28]={'$like':'%'+_0x57b51e['query'][_0xe0b0('0x65')]+'%'};return _0xaf2607;})});}if(_0x57b51e[_0xe0b0('0x2e')][_0xe0b0('0x66')]){var _0x9c7221=_0x57b51e['query'][_0xe0b0('0x66')][_0xe0b0('0x67')](',');var _0x49deef={};_0x49deef[_0x9c7221[0x0]]={'$gte':moment(_0x9c7221[0x1])['format'](_0xe0b0('0x68'))};_0xd750b4[_0xe0b0('0x38')]=_[_0xe0b0('0x3f')](_0xd750b4[_0xe0b0('0x38')],_0x49deef);}_0xd750b4=_[_0xe0b0('0x3f')]({},_0xd750b4,_0x57b51e[_0xe0b0('0x40')]);return db[_0xe0b0('0x47')][_0xe0b0('0x4b')]({'where':_0xd750b4[_0xe0b0('0x38')]})[_0xe0b0('0x24')](function(_0x5a63e6){_0x1a4fad['count']=_0x5a63e6;if(_0x57b51e[_0xe0b0('0x2e')]['includeAll']){_0xd750b4['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0xd750b4);})[_0xe0b0('0x24')](function(_0x584350){_0x1a4fad[_0xe0b0('0x69')]=_0x584350;return _0x1a4fad;});}})[_0xe0b0('0x24')](respondWithFilteredResult(_0x4d75e4,_0xd750b4))[_0xe0b0('0x56')](handleError(_0x4d75e4,null));};exports[_0xe0b0('0x6a')]=function(_0x5b1b6b,_0x31b218,_0x948708){return db['MailInteraction'][_0xe0b0('0x59')]({'where':{'id':_0x5b1b6b[_0xe0b0('0x5d')]['id']}})[_0xe0b0('0x24')](handleEntityNotFound(_0x31b218,null))[_0xe0b0('0x24')](function(_0x27af09){if(_0x27af09){return _0x27af09['setTags'](_0x5b1b6b['body']['ids'],_['omit'](_0x5b1b6b['body'],[_0xe0b0('0x60'),'id'])||{})['spread'](function(){return db[_0xe0b0('0x55')]['findAll']({'attributes':['id',_0xe0b0('0x29'),_0xe0b0('0x54')],'where':{'id':_0x5b1b6b[_0xe0b0('0x5b')][_0xe0b0('0x60')]}});})[_0xe0b0('0x24')](function(_0x31a5e1){socket['emit']('mailInteractionTags:save',{'id':Number(_0x5b1b6b['params']['id']),'tags':_0x31a5e1||[]});return{'id':Number(_0x5b1b6b['params']['id']),'tags':_0x31a5e1||[]};});}})[_0xe0b0('0x24')](respondWithResult(_0x31b218,null))[_0xe0b0('0x56')](handleError(_0x31b218,null));};exports[_0xe0b0('0x6b')]=function(_0x4377f7,_0x2c1149,_0x534881){var _0x234716;return db[_0xe0b0('0x2b')][_0xe0b0('0x59')]({'where':{'id':_0x4377f7[_0xe0b0('0x5d')]['id']}})[_0xe0b0('0x24')](handleEntityNotFound(_0x2c1149,null))[_0xe0b0('0x24')](function(_0x3ef24a){if(_0x3ef24a){return _0x3ef24a[_0xe0b0('0x6b')](_0x4377f7[_0xe0b0('0x2e')]['ids']);}})['then'](respondWithStatusCode(_0x2c1149,null))[_0xe0b0('0x56')](handleError(_0x2c1149,null));};exports[_0xe0b0('0x6c')]=function(_0x5a32b0,_0x7feff4){var _0x4593f1=moment()[_0xe0b0('0x6d')]()[_0xe0b0('0x6e')]();var _0x7358ce=path[_0xe0b0('0x6f')](config[_0xe0b0('0x70')],_0xe0b0('0x71'),'files','attachments');var _0x55e8c6=path[_0xe0b0('0x6f')](config[_0xe0b0('0x70')],'server',_0xe0b0('0x72'),_0xe0b0('0x73'));var _0x396eec=path[_0xe0b0('0x6f')](_0x55e8c6,_0x4593f1);var _0x5c45ae=util['format']('interaction-%s.zip',_0x4593f1);var _0x22029a=path[_0xe0b0('0x6f')](_0x55e8c6,_0x5c45ae);var _0x57535b=![];return db[_0xe0b0('0x2b')][_0xe0b0('0x59')]({'where':{'id':_0x5a32b0['params']['id']}})['then'](handleEntityNotFound(_0x7feff4,null))[_0xe0b0('0x24')](function(_0x554181){if(_0x554181){return _0x554181[_0xe0b0('0x62')]({'attributes':['id','body',_0xe0b0('0x74'),'to','cc',_0xe0b0('0x75'),_0xe0b0('0x4a')],'where':{'secret':![]},'include':_0x5a32b0[_0xe0b0('0x2e')][_0xe0b0('0x76')]?[{'model':db[_0xe0b0('0x77')],'as':_0xe0b0('0x78')}]:undefined,'order':qs[_0xe0b0('0x37')]('id')});}return[];})[_0xe0b0('0x24')](function(_0x48497e){_0x57535b=_0x48497e[_0xe0b0('0x64')];if(_0x48497e[_0xe0b0('0x64')]){fs[_0xe0b0('0x79')](_0x396eec);return BPromise['each'](_0x48497e,function(_0x1b7336,_0x4ad24f){var _0x328c96=_0x1b7336;var _0x350c40={'from':_0x328c96['from'],'to':_0x328c96['to'],'subject':_0x328c96[_0xe0b0('0x75')],'html':_0x328c96['body'],'headers':{'Date':moment(_0x328c96['createdAt'])[_0xe0b0('0x7a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};return new BPromise(function(_0x5085b0,_0x4f027c){if(_0x1b7336[_0xe0b0('0x78')]){for(var _0x238979=0x0;_0x238979<_0x1b7336[_0xe0b0('0x78')][_0xe0b0('0x64')];_0x238979++){var _0x3da0ce=_0x1b7336['Attachments'][_0x238979];var _0x2af9d8=path[_0xe0b0('0x6f')](_0x7358ce,_0x3da0ce[_0xe0b0('0x7b')]);if(fs['existsSync'](_0x2af9d8)){_0x350c40[_0xe0b0('0x76')][_0xe0b0('0x43')]({'name':_0x3da0ce['name'],'contentType':_0x3da0ce['type'],'data':fs[_0xe0b0('0x7c')](_0x2af9d8)});}}}emlformat['build'](_0x350c40,function(_0x46ab89,_0xadc32){if(_0x46ab89)return _0x4f027c(_0x46ab89);fs[_0xe0b0('0x7d')](path[_0xe0b0('0x6f')](_0x396eec,util[_0xe0b0('0x7a')](_0xe0b0('0x7e'),_0x4ad24f)),_0xadc32);return _0x5085b0(_0xadc32);});});});}})[_0xe0b0('0x24')](function(){if(_0x57535b){return new BPromise(function(_0x504483,_0x355edf){zipdir(_0x396eec,{'saveTo':_0x22029a},function(_0x13d617,_0x135fec){if(_0x13d617)return _0x355edf(_0x13d617);return _0x504483(_0x135fec);});});}})[_0xe0b0('0x24')](function(){if(_0x57535b){return new BPromise(function(_0x2b087b,_0x545dfd){rimraf(_0x396eec,function(_0x5b91a2){if(_0x5b91a2)_0x545dfd(_0x5b91a2);return _0x2b087b();});});}})[_0xe0b0('0x24')](function(){if(_0x57535b){return _0x7feff4[_0xe0b0('0x6c')](_0x22029a,_0x5c45ae,function(_0xd4af91){if(_0xd4af91){console[_0xe0b0('0x7f')](_0xe0b0('0x80'),_0xd4af91);}else{fs[_0xe0b0('0x81')](_0x22029a);}});}else{return _0x7feff4[_0xe0b0('0x1c')](0xc8);}})[_0xe0b0('0x56')](handleError(_0x7feff4,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 4d21b90..5298a69 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 _0x170f=['events','../../mysqldb','setMaxListeners','update','remove','emit','hook'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x170f,0x1c7));var _0xf170=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0x170f[_0x384231];return _0x2480bf;};'use strict';var EventEmitter=require(_0xf170('0x0'));var MailInteraction=require(_0xf170('0x1'))['db']['MailInteraction'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf170('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf170('0x3'),'afterDestroy':_0xf170('0x4')};function emitEvent(_0x4670ac){return function(_0x35f00b,_0x4d168c,_0x505867){MailInteractionEvents[_0xf170('0x5')](_0x4670ac+':'+_0x35f00b['id'],_0x35f00b);MailInteractionEvents[_0xf170('0x5')](_0x4670ac,_0x35f00b);_0x505867(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xf170('0x6')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x2d75=['hook','exports','events','../../mysqldb','MailInteraction','update','remove','emit','hasOwnProperty'];(function(_0x36113d,_0x3ddd18){var _0x2f589f=function(_0x54caf3){while(--_0x54caf3){_0x36113d['push'](_0x36113d['shift']());}};_0x2f589f(++_0x3ddd18);}(_0x2d75,0xda));var _0x52d7=function(_0x141e5f,_0x216927){_0x141e5f=_0x141e5f-0x0;var _0x5bea96=_0x2d75[_0x141e5f];return _0x5bea96;};'use strict';var EventEmitter=require(_0x52d7('0x0'));var MailInteraction=require(_0x52d7('0x1'))['db'][_0x52d7('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x52d7('0x3'),'afterDestroy':_0x52d7('0x4')};function emitEvent(_0x2762cb){return function(_0x4190bc,_0x1b34c,_0x5a320a){MailInteractionEvents[_0x52d7('0x5')](_0x2762cb+':'+_0x4190bc['id'],_0x4190bc);MailInteractionEvents[_0x52d7('0x5')](_0x2762cb,_0x4190bc);_0x5a320a(null);};}for(var e in events){if(events[_0x52d7('0x6')](e)){var event=events[e];MailInteraction[_0x52d7('0x7')](e,emitEvent(event));}}module[_0x52d7('0x8')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 33270b8..1686889 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 _0x453b=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','exports','define','MailInteraction','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closed','closedAt','utf8mb4'];(function(_0x297b8b,_0x10031d){var _0x4566e9=function(_0x45062b){while(--_0x45062b){_0x297b8b['push'](_0x297b8b['shift']());}};_0x4566e9(++_0x10031d);}(_0x453b,0x1aa));var _0xb453=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x453b[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xb453('0x0'));var util=require(_0xb453('0x1'));var logger=require('../../config/logger')(_0xb453('0x2'));var moment=require(_0xb453('0x3'));var BPromise=require(_0xb453('0x4'));var rp=require('request-promise');var attributes=require('./mailInteraction.attributes');module[_0xb453('0x5')]=function(_0x5e790c,_0x32c225){return _0x5e790c[_0xb453('0x6')](_0xb453('0x7'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5b3aff,_0x4f68c5,_0x57555e){if(_0x5b3aff[_0xb453('0x8')]){_0x5b3aff[_0xb453('0x9')]=moment()[_0xb453('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5b3aff['closed']){_0x5b3aff['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x57555e(null,_0x4f68c5);},'beforeUpdate':function(_0x11dfc9,_0x193a62,_0x38c98b){if(_0x11dfc9['changed']('substatus')){_0x11dfc9[_0xb453('0x9')]=moment()[_0xb453('0xa')](_0xb453('0xb'));}if(_0x11dfc9[_0xb453('0xc')](_0xb453('0xd'))){_0x11dfc9[_0xb453('0xe')]=moment()['format'](_0xb453('0xb'));}_0x38c98b(null,_0x11dfc9);}},'charset':_0xb453('0xf'),'collate':_0xb453('0x10')});}; \ No newline at end of file +var _0x8ce1=['request-promise','./mailInteraction.attributes','exports','mail_interactions','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird'];(function(_0x1d0a84,_0x5b74c0){var _0xc51c70=function(_0x36cabc){while(--_0x36cabc){_0x1d0a84['push'](_0x1d0a84['shift']());}};_0xc51c70(++_0x5b74c0);}(_0x8ce1,0x18c));var _0x18ce=function(_0x2d491d,_0x23bab6){_0x2d491d=_0x2d491d-0x0;var _0x29f5fe=_0x8ce1[_0x2d491d];return _0x29f5fe;};'use strict';var _=require('lodash');var util=require(_0x18ce('0x0'));var logger=require(_0x18ce('0x1'))('api');var moment=require(_0x18ce('0x2'));var BPromise=require(_0x18ce('0x3'));var rp=require(_0x18ce('0x4'));var attributes=require(_0x18ce('0x5'));module[_0x18ce('0x6')]=function(_0x56cff1,_0x266e47){return _0x56cff1['define']('MailInteraction',attributes,{'tableName':_0x18ce('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x344500,_0xf2d76f,_0x35d9f8){if(_0x344500[_0x18ce('0x8')]){_0x344500['substatusAt']=moment()[_0x18ce('0x9')](_0x18ce('0xa'));}if(_0x344500[_0x18ce('0xb')]){_0x344500[_0x18ce('0xc')]=moment()[_0x18ce('0x9')](_0x18ce('0xa'));}_0x35d9f8(null,_0xf2d76f);},'beforeUpdate':function(_0x397caf,_0x3a3534,_0x5f0063){if(_0x397caf[_0x18ce('0xd')](_0x18ce('0x8'))){_0x397caf['substatusAt']=moment()[_0x18ce('0x9')](_0x18ce('0xa'));}if(_0x397caf[_0x18ce('0xd')]('closed')){_0x397caf[_0x18ce('0xc')]=moment()['format'](_0x18ce('0xa'));}_0x5f0063(null,_0x397caf);}},'charset':_0x18ce('0xe'),'collate':_0x18ce('0xf')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 8eb54e6..1421564 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 _0x9c63=['update','raw','where','options','attributes','limit','debug','catch','ids','omit','body','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','stringify','error','message','MailInteraction,\x20%s,\x20%s','result','UpdateMailInteraction','MailInteraction'];(function(_0x42d57a,_0xec2432){var _0xacd449=function(_0x14bcb4){while(--_0x14bcb4){_0x42d57a['push'](_0x42d57a['shift']());}};_0xacd449(++_0xec2432);}(_0x9c63,0x1a7));var _0x39c6=function(_0x3508fa,_0x2078fc){_0x3508fa=_0x3508fa-0x0;var _0x1473a2=_0x9c63[_0x3508fa];return _0x1473a2;};'use strict';var _=require(_0x39c6('0x0'));var util=require(_0x39c6('0x1'));var moment=require(_0x39c6('0x2'));var BPromise=require(_0x39c6('0x3'));var rs=require(_0x39c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39c6('0x5'))['db'];var utils=require(_0x39c6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x39c6('0x7'));var jayson=require(_0x39c6('0x8'));var client=jayson[_0x39c6('0x9')][_0x39c6('0xa')]({'port':0x232a});config[_0x39c6('0xb')]=_[_0x39c6('0xc')](config['redis'],{'host':_0x39c6('0xd'),'port':0x18eb});var socket=require(_0x39c6('0xe'))(new Redis(config[_0x39c6('0xb')]));require(_0x39c6('0xf'))[_0x39c6('0x10')](socket);function respondWithRpcPromise(_0x5cbca3,_0x2cd260,_0x4fccae){return new BPromise(function(_0x114818,_0x538210){return client[_0x39c6('0x11')](_0x5cbca3,_0x4fccae)[_0x39c6('0x12')](function(_0x3aa1b0){logger[_0x39c6('0x13')]('MailInteraction,\x20%s,\x20%s',_0x2cd260,_0x39c6('0x14'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x2cd260,_0x39c6('0x14'),JSON[_0x39c6('0x15')](_0x3aa1b0));if(_0x3aa1b0[_0x39c6('0x16')]){if(_0x3aa1b0[_0x39c6('0x16')]['code']===0x1f4){logger[_0x39c6('0x16')]('MailInteraction,\x20%s,\x20%s',_0x2cd260,_0x3aa1b0[_0x39c6('0x16')][_0x39c6('0x17')]);return _0x538210(_0x3aa1b0[_0x39c6('0x16')]['message']);}logger['error'](_0x39c6('0x18'),_0x2cd260,_0x3aa1b0[_0x39c6('0x16')]['message']);return _0x114818(_0x3aa1b0[_0x39c6('0x16')][_0x39c6('0x17')]);}else{logger[_0x39c6('0x13')](_0x39c6('0x18'),_0x2cd260,_0x39c6('0x14'));_0x114818(_0x3aa1b0[_0x39c6('0x19')]['message']);}})['catch'](function(_0x4d6fcb){logger['error']('MailInteraction,\x20%s,\x20%s',_0x2cd260,_0x4d6fcb);_0x538210(_0x4d6fcb);});});}exports[_0x39c6('0x1a')]=function(_0x5d4eec){var _0x548352=this;return new Promise(function(_0x26d07b,_0x37dce5){return db[_0x39c6('0x1b')][_0x39c6('0x1c')](_0x5d4eec['body'],{'raw':_0x5d4eec['options']?_0x5d4eec['options'][_0x39c6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d4eec['options']?_0x5d4eec['options'][_0x39c6('0x1e')]||null:null,'attributes':_0x5d4eec[_0x39c6('0x1f')]?_0x5d4eec[_0x39c6('0x1f')][_0x39c6('0x20')]||null:null,'limit':_0x5d4eec[_0x39c6('0x1f')]?_0x5d4eec[_0x39c6('0x1f')][_0x39c6('0x21')]||null:null})[_0x39c6('0x12')](function(_0x26ab52){logger[_0x39c6('0x13')](_0x39c6('0x1a'),_0x5d4eec);logger[_0x39c6('0x22')](_0x39c6('0x1a'),_0x5d4eec,JSON[_0x39c6('0x15')](_0x26ab52));_0x26d07b(_0x26ab52);})[_0x39c6('0x23')](function(_0x46d0c3){logger[_0x39c6('0x16')]('UpdateMailInteraction',_0x46d0c3[_0x39c6('0x17')],_0x5d4eec);_0x37dce5(_0x548352[_0x39c6('0x16')](0x1f4,_0x46d0c3[_0x39c6('0x17')]));});});};exports['AddTagsToMailInteraction']=function(_0xf06e09){return new Promise(function(_0x348f90,_0x185869){return db[_0x39c6('0x1b')]['find']({'where':_0xf06e09['options']?_0xf06e09[_0x39c6('0x1f')][_0x39c6('0x1e')]||null:null})['then'](function(_0x42f502){if(_0x42f502){return _0x42f502['addTags'](_0xf06e09['body'][_0x39c6('0x24')],_[_0x39c6('0x25')](_0xf06e09[_0x39c6('0x26')],[_0x39c6('0x24'),'id'])||{});}})[_0x39c6('0x27')](function(_0x1d5d33){logger[_0x39c6('0x13')](_0x39c6('0x28'),_0xf06e09);logger[_0x39c6('0x22')](_0x39c6('0x28'),_0xf06e09,JSON[_0x39c6('0x15')](_0x1d5d33));_0x348f90(_0x1d5d33);})[_0x39c6('0x23')](function(_0x33db66){logger[_0x39c6('0x16')](_0x39c6('0x28'),_0x33db66[_0x39c6('0x17')],_0xf06e09);_0x185869(_this[_0x39c6('0x16')](0x1f4,_0x33db66['message']));});});}; \ No newline at end of file +var _0x00f0=['MailInteraction,\x20%s,\x20%s','request\x20sent','result','catch','UpdateMailInteraction','update','body','options','attributes','limit','then','stringify','AddTagsToMailInteraction','MailInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x30a639,_0x52177d){var _0x454e3e=function(_0x2bd518){while(--_0x2bd518){_0x30a639['push'](_0x30a639['shift']());}};_0x454e3e(++_0x52177d);}(_0x00f0,0xec));var _0x000f=function(_0x1b90ab,_0x101f79){_0x1b90ab=_0x1b90ab-0x0;var _0xe397f2=_0x00f0[_0x1b90ab];return _0xe397f2;};'use strict';var _=require(_0x000f('0x0'));var util=require(_0x000f('0x1'));var moment=require(_0x000f('0x2'));var BPromise=require(_0x000f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x000f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x000f('0x5'))('rpc');var config=require(_0x000f('0x6'));var jayson=require(_0x000f('0x7'));var client=jayson['client'][_0x000f('0x8')]({'port':0x232a});config[_0x000f('0x9')]=_[_0x000f('0xa')](config[_0x000f('0x9')],{'host':_0x000f('0xb'),'port':0x18eb});var socket=require(_0x000f('0xc'))(new Redis(config[_0x000f('0x9')]));require(_0x000f('0xd'))[_0x000f('0xe')](socket);function respondWithRpcPromise(_0x278cd8,_0x190417,_0x504f65){return new BPromise(function(_0x59749b,_0x1a8ebf){return client[_0x000f('0xf')](_0x278cd8,_0x504f65)['then'](function(_0x2bac47){logger[_0x000f('0x10')]('MailInteraction,\x20%s,\x20%s',_0x190417,'request\x20sent');logger[_0x000f('0x11')](_0x000f('0x12'),_0x190417,'request\x20sent',JSON['stringify'](_0x2bac47));if(_0x2bac47[_0x000f('0x13')]){if(_0x2bac47[_0x000f('0x13')][_0x000f('0x14')]===0x1f4){logger[_0x000f('0x13')]('MailInteraction,\x20%s,\x20%s',_0x190417,_0x2bac47[_0x000f('0x13')]['message']);return _0x1a8ebf(_0x2bac47['error'][_0x000f('0x15')]);}logger['error'](_0x000f('0x16'),_0x190417,_0x2bac47[_0x000f('0x13')][_0x000f('0x15')]);return _0x59749b(_0x2bac47[_0x000f('0x13')][_0x000f('0x15')]);}else{logger[_0x000f('0x10')](_0x000f('0x16'),_0x190417,_0x000f('0x17'));_0x59749b(_0x2bac47[_0x000f('0x18')][_0x000f('0x15')]);}})[_0x000f('0x19')](function(_0x156342){logger[_0x000f('0x13')]('MailInteraction,\x20%s,\x20%s',_0x190417,_0x156342);_0x1a8ebf(_0x156342);});});}exports[_0x000f('0x1a')]=function(_0x26aad4){var _0x53f06f=this;return new Promise(function(_0x2cdb5c,_0x51e8c7){return db['MailInteraction'][_0x000f('0x1b')](_0x26aad4[_0x000f('0x1c')],{'raw':_0x26aad4[_0x000f('0x1d')]?_0x26aad4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26aad4[_0x000f('0x1d')]?_0x26aad4[_0x000f('0x1d')]['where']||null:null,'attributes':_0x26aad4[_0x000f('0x1d')]?_0x26aad4['options'][_0x000f('0x1e')]||null:null,'limit':_0x26aad4['options']?_0x26aad4[_0x000f('0x1d')][_0x000f('0x1f')]||null:null})[_0x000f('0x20')](function(_0xb7a76d){logger[_0x000f('0x10')](_0x000f('0x1a'),_0x26aad4);logger['debug'](_0x000f('0x1a'),_0x26aad4,JSON[_0x000f('0x21')](_0xb7a76d));_0x2cdb5c(_0xb7a76d);})[_0x000f('0x19')](function(_0x55d962){logger[_0x000f('0x13')](_0x000f('0x1a'),_0x55d962[_0x000f('0x15')],_0x26aad4);_0x51e8c7(_0x53f06f[_0x000f('0x13')](0x1f4,_0x55d962[_0x000f('0x15')]));});});};exports[_0x000f('0x22')]=function(_0x1099f7){return new Promise(function(_0x4a776b,_0x11c2a2){return db[_0x000f('0x23')][_0x000f('0x24')]({'where':_0x1099f7[_0x000f('0x1d')]?_0x1099f7['options'][_0x000f('0x25')]||null:null})['then'](function(_0x229252){if(_0x229252){return _0x229252[_0x000f('0x26')](_0x1099f7[_0x000f('0x1c')][_0x000f('0x27')],_[_0x000f('0x28')](_0x1099f7['body'],[_0x000f('0x27'),'id'])||{});}})[_0x000f('0x29')](function(_0x51e477){logger[_0x000f('0x10')](_0x000f('0x2a'),_0x1099f7);logger[_0x000f('0x11')](_0x000f('0x2a'),_0x1099f7,JSON[_0x000f('0x21')](_0x51e477));_0x4a776b(_0x51e477);})[_0x000f('0x19')](function(_0x2c9b3a){logger[_0x000f('0x13')]('AddTags',_0x2c9b3a[_0x000f('0x15')],_0x1099f7);_0x11c2a2(_this['error'](0x1f4,_0x2c9b3a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 9dbe1b3..e3f52b0 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 _0x405c=['removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove','emit'];(function(_0x548cc0,_0x2013e2){var _0x56c27b=function(_0x25216e){while(--_0x25216e){_0x548cc0['push'](_0x548cc0['shift']());}};_0x56c27b(++_0x2013e2);}(_0x405c,0x154));var _0xc405=function(_0x24aaca,_0x42de88){_0x24aaca=_0x24aaca-0x0;var _0x732300=_0x405c[_0x24aaca];return _0x732300;};'use strict';var MailInteractionEvents=require(_0xc405('0x0'));var events=[_0xc405('0x1'),_0xc405('0x2'),'update'];function createListener(_0x43c0b5,_0x2a39a1){return function(_0x33d60d){_0x2a39a1[_0xc405('0x3')](_0x43c0b5,_0x33d60d);};}function removeListener(_0x8ceec8,_0x42b2c4){return function(){MailInteractionEvents[_0xc405('0x4')](_0x8ceec8,_0x42b2c4);};}exports[_0xc405('0x5')]=function(_0x2a022f){for(var _0x5b8826=0x0,_0x372f2c=events[_0xc405('0x6')];_0x5b8826<_0x372f2c;_0x5b8826++){var _0x448307=events[_0x5b8826];var _0x4e0a37=createListener(_0xc405('0x7')+_0x448307,_0x2a022f);MailInteractionEvents['on'](_0x448307,_0x4e0a37);}}; \ No newline at end of file +var _0x6ffe=['./mailInteraction.events','save','update','emit','removeListener','register','mailInteraction:'];(function(_0x36128b,_0x4dc6dc){var _0x502d15=function(_0x2034b3){while(--_0x2034b3){_0x36128b['push'](_0x36128b['shift']());}};_0x502d15(++_0x4dc6dc);}(_0x6ffe,0x77));var _0xe6ff=function(_0x518b8f,_0x476de4){_0x518b8f=_0x518b8f-0x0;var _0x51cece=_0x6ffe[_0x518b8f];return _0x51cece;};'use strict';var MailInteractionEvents=require(_0xe6ff('0x0'));var events=[_0xe6ff('0x1'),'remove',_0xe6ff('0x2')];function createListener(_0x50aac2,_0x93c497){return function(_0x57a5b4){_0x93c497[_0xe6ff('0x3')](_0x50aac2,_0x57a5b4);};}function removeListener(_0x1b5463,_0x1e3eea){return function(){MailInteractionEvents[_0xe6ff('0x4')](_0x1b5463,_0x1e3eea);};}exports[_0xe6ff('0x5')]=function(_0x200b6d){for(var _0x20c23f=0x0,_0x53ab62=events['length'];_0x20c23f<_0x53ab62;_0x20c23f++){var _0x2c9288=events[_0x20c23f];var _0xc205a9=createListener(_0xe6ff('0x6')+_0x2c9288,_0x200b6d);MailInteractionEvents['on'](_0x2c9288,_0xc205a9);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 418e333..08c9d94 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 _0xee14=['../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4e1211,_0x1c0e26){var _0x4ae887=function(_0x6e55ff){while(--_0x6e55ff){_0x4e1211['push'](_0x4e1211['shift']());}};_0x4ae887(++_0x1c0e26);}(_0xee14,0x13a));var _0x4ee1=function(_0x1b8873,_0xd62bef){_0x1b8873=_0x1b8873-0x0;var _0x35fa2=_0xee14[_0x1b8873];return _0x35fa2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var auth=require(_0x4ee1('0x4'));var interaction=require(_0x4ee1('0x5'));var config=require(_0x4ee1('0x6'));var controller=require(_0x4ee1('0x7'));router[_0x4ee1('0x8')]('/',auth['isAuthenticated'](),controller[_0x4ee1('0x9')]);router['get'](_0x4ee1('0xa'),auth[_0x4ee1('0xb')](),controller[_0x4ee1('0xc')]);router[_0x4ee1('0x8')](_0x4ee1('0xd'),auth[_0x4ee1('0xb')](),controller['show']);router[_0x4ee1('0x8')](_0x4ee1('0xe'),auth['isAuthenticated'](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')]('/',auth[_0x4ee1('0xb')](),interaction[_0x4ee1('0x11')]('mail',_0x4ee1('0x12')),controller[_0x4ee1('0x13')]);router[_0x4ee1('0x14')](_0x4ee1('0xd'),auth[_0x4ee1('0xb')](),controller[_0x4ee1('0x15')]);router['put'](_0x4ee1('0x16'),auth[_0x4ee1('0xb')](),controller[_0x4ee1('0x17')]);router[_0x4ee1('0x14')](_0x4ee1('0x18'),auth[_0x4ee1('0xb')](),controller[_0x4ee1('0x19')]);router[_0x4ee1('0x1a')](_0x4ee1('0xd'),auth['isAuthenticated'](),controller[_0x4ee1('0x1b')]);module[_0x4ee1('0x1c')]=router; \ No newline at end of file +var _0x5fc3=['update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','create','put'];(function(_0x5b76ea,_0x3b5743){var _0x42270a=function(_0x521d29){while(--_0x521d29){_0x5b76ea['push'](_0x5b76ea['shift']());}};_0x42270a(++_0x3b5743);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x5fc3[_0x1a8f86];return _0x20d876;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');var controller=require(_0x35fc('0x7'));router[_0x35fc('0x8')]('/',auth[_0x35fc('0x9')](),controller['index']);router['get'](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0xb')]);router[_0x35fc('0x8')](_0x35fc('0xc'),auth[_0x35fc('0x9')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x8')](_0x35fc('0xe'),auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/',auth['isAuthenticated'](),interaction[_0x35fc('0x11')](_0x35fc('0x12'),'mailmessage:create'),controller[_0x35fc('0x13')]);router[_0x35fc('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x35fc('0x15')]);router['put'](_0x35fc('0x16'),auth[_0x35fc('0x9')](),controller[_0x35fc('0x17')]);router[_0x35fc('0x14')](_0x35fc('0x18'),auth['isAuthenticated'](),controller['reject']);router['delete']('/:id',auth[_0x35fc('0x9')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index f730254..7e0f9b2 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 _0xb7fc=['INTEGER','exports','TEXT','BOOLEAN','ENUM','out','STRING','long','DATE'];(function(_0x465324,_0x2f5c50){var _0x392a9f=function(_0x4cf1b1){while(--_0x4cf1b1){_0x465324['push'](_0x465324['shift']());}};_0x392a9f(++_0x2f5c50);}(_0xb7fc,0x106));var _0xcb7f=function(_0x2e9b61,_0x2120cf){_0x2e9b61=_0x2e9b61-0x0;var _0x597ccd=_0xb7fc[_0x2e9b61];return _0x597ccd;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xcb7f('0x0')]={'body':{'type':Sequelize[_0xcb7f('0x1')]('long'),'allowNull':![]},'read':{'type':Sequelize[_0xcb7f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcb7f('0x3')]('in',_0xcb7f('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xcb7f('0x5')]},'to':{'type':Sequelize[_0xcb7f('0x1')](_0xcb7f('0x6'))},'cc':{'type':Sequelize['TEXT'](_0xcb7f('0x6'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xcb7f('0x7')]},'attach':{'type':Sequelize[_0xcb7f('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xcb7f('0x2')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xcb7f('0x1')](_0xcb7f('0x6'))},'originCc':{'type':Sequelize[_0xcb7f('0x1')]('long')}}; \ No newline at end of file +var _0xb059=['DATE','INTEGER','sequelize','lodash','TEXT','BOOLEAN','out','STRING','long'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0xb059,0x65));var _0x9b05=function(_0x5cf359,_0x14beb5){_0x5cf359=_0x5cf359-0x0;var _0x41f6d1=_0xb059[_0x5cf359];return _0x41f6d1;};'use strict';var Sequelize=require(_0x9b05('0x0'));var _=require(_0x9b05('0x1'));module['exports']={'body':{'type':Sequelize[_0x9b05('0x2')]('long'),'allowNull':![]},'read':{'type':Sequelize[_0x9b05('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x9b05('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9b05('0x5')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x9b05('0x2')]('long')},'cc':{'type':Sequelize['TEXT'](_0x9b05('0x6'))},'bcc':{'type':Sequelize[_0x9b05('0x2')](_0x9b05('0x6'))},'subject':{'type':Sequelize[_0x9b05('0x2')]},'sentAt':{'type':Sequelize[_0x9b05('0x7')]},'attach':{'type':Sequelize[_0x9b05('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x9b05('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x9b05('0x7')]},'originTo':{'type':Sequelize['TEXT'](_0x9b05('0x6'))},'originCc':{'type':Sequelize['TEXT'](_0x9b05('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 65251ee..0915b2b 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 _0xf53d=['json','count','offset','limit','set','apply','reject','save','update','stack','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','field','options','MailMessage','findAll','rows','catch','show','params','include','body','find','describe','create','direction','secret','MailAccount','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','user','auth','pass','attachments','name','join','basename','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','UserId','Contact','MailInteraction','MailInteractionId','read1stAt','interaction','get','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','mail-interactions','mail','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectmessage','download','unix','toString','root','server','files','message-%s.eml','from','subject','createdAt','Attachments','existsSync','push','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','MailMessage,\x20%s,\x20%s','result','sendStatus','status','end'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf53d,0x199));var _0xdf53=function(_0x1d3978,_0x38fbbe){_0x1d3978=_0x1d3978-0x0;var _0x1db18a=_0xf53d[_0x1d3978];return _0x1db18a;};'use strict';var pdf=require(_0xdf53('0x0'));var emlformat=require(_0xdf53('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdf53('0x2'));var jsonpatch=require(_0xdf53('0x3'));var rp=require(_0xdf53('0x4'));var moment=require('moment');var BPromise=require(_0xdf53('0x5'));var Mustache=require('mustache');var util=require(_0xdf53('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xdf53('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdf53('0x8'));var squel=require(_0xdf53('0x9'));var crypto=require(_0xdf53('0xa'));var jsforce=require(_0xdf53('0xb'));var deskjs=require(_0xdf53('0xc'));var toCsv=require(_0xdf53('0x7'));var querystring=require(_0xdf53('0xd'));var Papa=require(_0xdf53('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xdf53('0xf'));var Redis=require(_0xdf53('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xdf53('0x11'))('api');var utils=require(_0xdf53('0x12'));var config=require(_0xdf53('0x13'));var db=require(_0xdf53('0x14'))['db'];config[_0xdf53('0x15')]=_[_0xdf53('0x16')](config[_0xdf53('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf53('0x17'))(new Redis(config['redis']));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xdf53('0x18'));var client=jayson[_0xdf53('0x19')][_0xdf53('0x1a')]({'port':0x232c});var client9003=jayson['client'][_0xdf53('0x1a')]({'port':0x232b});var client9002=jayson[_0xdf53('0x19')][_0xdf53('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x174b19,_0x22deb2,_0x413151,_0x3359c6){return new BPromise(function(_0xf49866,_0x3af2fa){var _0x5965a3=_0x3359c6||client;return _0x5965a3[_0xdf53('0x1b')](_0x174b19,_0x413151)[_0xdf53('0x1c')](function(_0x47b4b3){logger[_0xdf53('0x1d')]('MailMessage,\x20%s,\x20%s',_0x22deb2,_0xdf53('0x1e'));logger[_0xdf53('0x1f')](_0xdf53('0x20'),_0x22deb2,'request\x20sent',JSON[_0xdf53('0x21')](_0x47b4b3));if(_0x47b4b3[_0xdf53('0x22')]){if(_0x47b4b3[_0xdf53('0x22')]['code']===0x1f4){logger[_0xdf53('0x22')]('MailMessage,\x20%s,\x20%s',_0x22deb2,_0x47b4b3['error'][_0xdf53('0x23')]);return _0x3af2fa(_0x47b4b3['error'][_0xdf53('0x23')]);}logger[_0xdf53('0x22')](_0xdf53('0x24'),_0x22deb2,_0x47b4b3[_0xdf53('0x22')][_0xdf53('0x23')]);return _0xf49866(_0x47b4b3[_0xdf53('0x22')][_0xdf53('0x23')]);}else{logger['info'](_0xdf53('0x24'),_0x22deb2,_0xdf53('0x1e'));_0xf49866(_0x47b4b3[_0xdf53('0x25')][_0xdf53('0x23')]);}})['catch'](function(_0x35a387){logger[_0xdf53('0x22')](_0xdf53('0x24'),_0x22deb2,_0x35a387);_0x3af2fa(_0x35a387);});});}function respondWithStatusCode(_0x42a64e,_0x681c59){_0x681c59=_0x681c59||0xcc;return function(_0x116136){if(_0x116136){return _0x42a64e[_0xdf53('0x26')](_0x681c59);}return _0x42a64e[_0xdf53('0x27')](_0x681c59)[_0xdf53('0x28')]();};}function respondWithResult(_0x2e023c,_0x19928f){_0x19928f=_0x19928f||0xc8;return function(_0x2f897e){if(_0x2f897e){return _0x2e023c[_0xdf53('0x27')](_0x19928f)[_0xdf53('0x29')](_0x2f897e);}};}function respondWithFilteredResult(_0x1ed29a,_0x5abbc2){return function(_0x1687d1){if(_0x1687d1){var _0x5b2877=_0x1687d1[_0xdf53('0x2a')],_0x4e9056=_0x5abbc2[_0xdf53('0x2b')],_0x210e3f=_0x5abbc2[_0xdf53('0x2b')]+_0x5abbc2[_0xdf53('0x2c')],_0x2526fa;if(_0x210e3f>=_0x5b2877){_0x210e3f=_0x5b2877;_0x2526fa=0xc8;}else{_0x2526fa=0xce;}_0x1ed29a[_0xdf53('0x27')](_0x2526fa);return _0x1ed29a[_0xdf53('0x2d')]('Content-Range',_0x4e9056+'-'+_0x210e3f+'/'+_0x5b2877)[_0xdf53('0x29')](_0x1687d1);}return null;};}function patchUpdates(_0x12c4f6){return function(_0x2afa60){try{jsonpatch[_0xdf53('0x2e')](_0x2afa60,_0x12c4f6,!![]);}catch(_0x23aef4){return BPromise[_0xdf53('0x2f')](_0x23aef4);}return _0x2afa60[_0xdf53('0x30')]();};}function saveUpdates(_0x295f60,_0xfc19b1){return function(_0x39cb04){if(_0x39cb04){return _0x39cb04[_0xdf53('0x31')](_0x295f60)[_0xdf53('0x1c')](function(_0x5f6515){return _0x5f6515;});}return null;};}function removeEntity(_0xd351da,_0x502c78){return function(_0x387e96){if(_0x387e96){return _0x387e96['destroy']()[_0xdf53('0x1c')](function(){_0xd351da[_0xdf53('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a993d,_0x576e6c){return function(_0xf8b5e4){if(!_0xf8b5e4){_0x3a993d['sendStatus'](0x194);}return _0xf8b5e4;};}function handleError(_0x3461d4,_0x25f5d8){_0x25f5d8=_0x25f5d8||0x1f4;return function(_0x283487){logger['error'](_0x283487[_0xdf53('0x32')]);if(_0x283487['name']){delete _0x283487['name'];}_0x3461d4[_0xdf53('0x27')](_0x25f5d8)['send'](_0x283487);};}exports['index']=function(_0x34ca53,_0x28a750){var _0x56f4a={},_0x2b5a3c={},_0x5a7d0d={'count':0x0,'rows':[]};var _0x2066b5=db['MailMessage'][_0xdf53('0x33')];_0x2b5a3c['model']=_[_0xdf53('0x34')](_0x2066b5);_0x2b5a3c[_0xdf53('0x35')]=_['keys'](_0x34ca53[_0xdf53('0x35')]);_0x2b5a3c[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x2b5a3c[_0xdf53('0x38')],_0x2b5a3c[_0xdf53('0x35')]);_0x56f4a[_0xdf53('0x39')]=_[_0xdf53('0x37')](_0x2b5a3c[_0xdf53('0x38')],qs[_0xdf53('0x3a')](_0x34ca53[_0xdf53('0x35')][_0xdf53('0x3a')]));_0x56f4a[_0xdf53('0x39')]=_0x56f4a['attributes'][_0xdf53('0x3b')]?_0x56f4a[_0xdf53('0x39')]:_0x2b5a3c[_0xdf53('0x38')];if(!_0x34ca53[_0xdf53('0x35')][_0xdf53('0x3c')](_0xdf53('0x3d'))){_0x56f4a[_0xdf53('0x2c')]=qs[_0xdf53('0x2c')](_0x34ca53['query']['limit']);_0x56f4a[_0xdf53('0x2b')]=qs[_0xdf53('0x2b')](_0x34ca53['query']['offset']);}_0x56f4a[_0xdf53('0x3e')]=qs[_0xdf53('0x3f')](_0x34ca53['query'][_0xdf53('0x3f')]);_0x56f4a[_0xdf53('0x40')]=qs[_0xdf53('0x36')](_[_0xdf53('0x41')](_0x34ca53['query'],_0x2b5a3c[_0xdf53('0x36')]));if(_0x34ca53[_0xdf53('0x35')][_0xdf53('0x42')]){_0x56f4a[_0xdf53('0x40')]=_[_0xdf53('0x43')](_0x56f4a[_0xdf53('0x40')],{'$or':_['map'](_0x2066b5,function(_0x5be750){if(_0x5be750[_0xdf53('0x44')]['key']!=='VIRTUAL'){var _0x23d558={};_0x23d558[_0x5be750[_0xdf53('0x45')]]={'$like':'%'+_0x34ca53['query'][_0xdf53('0x42')]+'%'};return _0x23d558;}})});}_0x56f4a=_[_0xdf53('0x43')]({},_0x56f4a,_0x34ca53[_0xdf53('0x46')]);var _0x32a37b={'where':_0x56f4a['where']};return db[_0xdf53('0x47')][_0xdf53('0x2a')](_0x32a37b)[_0xdf53('0x1c')](function(_0x5735a0){_0x5a7d0d[_0xdf53('0x2a')]=_0x5735a0;if(_0x34ca53[_0xdf53('0x35')]['includeAll']){_0x56f4a['include']=[{'all':!![]}];}return db['MailMessage'][_0xdf53('0x48')](_0x56f4a);})[_0xdf53('0x1c')](function(_0xb20e5){_0x5a7d0d[_0xdf53('0x49')]=_0xb20e5;return _0x5a7d0d;})[_0xdf53('0x1c')](respondWithFilteredResult(_0x28a750,_0x56f4a))[_0xdf53('0x4a')](handleError(_0x28a750,null));};exports[_0xdf53('0x4b')]=function(_0x4de257,_0x4fca5f){var _0x94f1d9={'raw':!![],'where':{'id':_0x4de257[_0xdf53('0x4c')]['id']}},_0x37f56c={};_0x37f56c[_0xdf53('0x38')]=_[_0xdf53('0x34')](db[_0xdf53('0x47')][_0xdf53('0x33')]);_0x37f56c[_0xdf53('0x35')]=_[_0xdf53('0x34')](_0x4de257[_0xdf53('0x35')]);_0x37f56c[_0xdf53('0x36')]=_[_0xdf53('0x37')](_0x37f56c[_0xdf53('0x38')],_0x37f56c[_0xdf53('0x35')]);_0x94f1d9[_0xdf53('0x39')]=_[_0xdf53('0x37')](_0x37f56c[_0xdf53('0x38')],qs[_0xdf53('0x3a')](_0x4de257[_0xdf53('0x35')]['fields']));_0x94f1d9[_0xdf53('0x39')]=_0x94f1d9[_0xdf53('0x39')][_0xdf53('0x3b')]?_0x94f1d9['attributes']:_0x37f56c[_0xdf53('0x38')];if(_0x4de257[_0xdf53('0x35')]['includeAll']){_0x94f1d9[_0xdf53('0x4d')]=[{'all':!![]}];}_0x94f1d9=_['merge']({},_0x94f1d9,_0x4de257[_0xdf53('0x46')]);return db[_0xdf53('0x47')]['find'](_0x94f1d9)[_0xdf53('0x1c')](handleEntityNotFound(_0x4fca5f,null))[_0xdf53('0x1c')](respondWithResult(_0x4fca5f,null))[_0xdf53('0x4a')](handleError(_0x4fca5f,null));};exports[_0xdf53('0x31')]=function(_0x1cbef5,_0x81150d){if(_0x1cbef5[_0xdf53('0x4e')]['id']){delete _0x1cbef5[_0xdf53('0x4e')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x1cbef5[_0xdf53('0x4c')]['id']}})[_0xdf53('0x1c')](handleEntityNotFound(_0x81150d,null))[_0xdf53('0x1c')](saveUpdates(_0x1cbef5[_0xdf53('0x4e')],null))[_0xdf53('0x1c')](respondWithResult(_0x81150d,null))['catch'](handleError(_0x81150d,null));};exports['destroy']=function(_0x4e96ac,_0x3c62d0){return db['MailMessage'][_0xdf53('0x4f')]({'where':{'id':_0x4e96ac[_0xdf53('0x4c')]['id']}})[_0xdf53('0x1c')](handleEntityNotFound(_0x3c62d0,null))[_0xdf53('0x1c')](removeEntity(_0x3c62d0,null))[_0xdf53('0x4a')](handleError(_0x3c62d0,null));};exports[_0xdf53('0x50')]=function(_0x2dadc7,_0x30af72){return db[_0xdf53('0x47')][_0xdf53('0x50')]()[_0xdf53('0x1c')](respondWithResult(_0x30af72,null))[_0xdf53('0x4a')](handleError(_0x30af72,null));};exports[_0xdf53('0x51')]=function(_0x359e56,_0x5568b1){return db[_0xdf53('0x47')][_0xdf53('0x51')](_0x359e56['body'])[_0xdf53('0x1c')](function(_0x3e6b33){if(_0x3e6b33){if(_0x3e6b33[_0xdf53('0x52')]==='out'&&!_0x3e6b33[_0xdf53('0x53')]){return db[_0xdf53('0x54')][_0xdf53('0x55')]({'where':{'id':_0x3e6b33[_0xdf53('0x56')]},'include':[{'model':db[_0xdf53('0x57')],'as':_0xdf53('0x58'),'raw':!![]}]})[_0xdf53('0x1c')](function(_0x27ee48){if(_0x27ee48&&_0x27ee48['Smtp']){var _0x46e5ca={'tls':{'rejectUnauthorized':![]}};if(_[_0xdf53('0x59')](_0x27ee48[_0xdf53('0x58')][_0xdf53('0x5a')])){_0x46e5ca[_0xdf53('0x5b')]=_0x27ee48[_0xdf53('0x58')]['host'];_0x46e5ca['port']=_0x27ee48[_0xdf53('0x58')][_0xdf53('0x5c')];_0x46e5ca['secure']=_0x27ee48[_0xdf53('0x58')][_0xdf53('0x5d')];if(_0x27ee48[_0xdf53('0x58')]['authentication']){_0x46e5ca['auth']={'user':_0x27ee48[_0xdf53('0x58')][_0xdf53('0x5e')],'pass':_0x27ee48[_0xdf53('0x58')]['pass']};}}else{_0x46e5ca[_0xdf53('0x5a')]=_0x27ee48['Smtp'][_0xdf53('0x5a')];_0x46e5ca[_0xdf53('0x5f')]={'user':_0x27ee48[_0xdf53('0x58')]['user'],'pass':_0x27ee48['Smtp'][_0xdf53('0x60')]};_0x46e5ca['secure']=_0x27ee48[_0xdf53('0x58')]['secure'];}if(_0x359e56['body']['attachments']&&_0x359e56[_0xdf53('0x4e')][_0xdf53('0x61')][_0xdf53('0x3b')]){for(var _0x44d72b=0x0;_0x44d72b<_0x359e56['body'][_0xdf53('0x61')][_0xdf53('0x3b')];_0x44d72b+=0x1){_0x359e56[_0xdf53('0x4e')][_0xdf53('0x61')][_0x44d72b]={'filename':_0x359e56[_0xdf53('0x4e')][_0xdf53('0x61')][_0x44d72b][_0xdf53('0x62')],'path':path[_0xdf53('0x63')](config['root'],'server/files/attachments',_0x359e56[_0xdf53('0x4e')]['attachments'][_0x44d72b][_0xdf53('0x64')])};}}return{'account':_0x46e5ca,'message':_0x359e56[_0xdf53('0x4e')]};}})[_0xdf53('0x1c')](function(_0x352c5b){if(_0x352c5b){return respondWithRpcPromise(_0xdf53('0x65'),_0xdf53('0x66'),_0x352c5b,client9003)[_0xdf53('0x1c')](function(_0x20595c){return _0x3e6b33[_0xdf53('0x31')]({'read':!![],'messageId':_0x20595c[_0xdf53('0x67')],'sentAt':moment()[_0xdf53('0x68')](_0xdf53('0x69'))});})['catch'](function(_0x3dbe4c){logger[_0xdf53('0x22')]('%s',JSON['stringify'](_0x3dbe4c));return _0x3e6b33;});}return _0x3e6b33;});}return _0x3e6b33;}})[_0xdf53('0x1c')](respondWithResult(_0x5568b1,0xc9))[_0xdf53('0x4a')](handleError(_0x5568b1,null));};var interaction_log=require(_0xdf53('0x11'))('mail-interactions');exports[_0xdf53('0x6a')]=function(_0x432b9e,_0x2534c2,_0x514d1d){var _0x4f2a7a={'channel':'mail'};if(_0x432b9e['body']['id']){delete _0x432b9e[_0xdf53('0x4e')]['id'];}_0x432b9e[_0xdf53('0x4e')]['read']=!![];_0x432b9e['body'][_0xdf53('0x6b')]=moment()[_0xdf53('0x68')](_0xdf53('0x69'));_0x432b9e[_0xdf53('0x4e')][_0xdf53('0x6c')]=_0x432b9e['body'][_0xdf53('0x6c')]||_0x432b9e[_0xdf53('0x5e')]['id'];return db[_0xdf53('0x47')][_0xdf53('0x4f')]({'where':{'id':_0x432b9e[_0xdf53('0x4c')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xdf53('0x6d')}]})[_0xdf53('0x1c')](handleEntityNotFound(_0x2534c2,null))[_0xdf53('0x1c')](saveUpdates(_0x432b9e[_0xdf53('0x4e')],null))[_0xdf53('0x1c')](function(_0x5e5211){if(_0x5e5211){_0x4f2a7a['message']=_0x5e5211['get']({'plain':!![]});return db[_0xdf53('0x6e')][_0xdf53('0x4f')]({'where':{'id':_0x5e5211[_0xdf53('0x6f')]}});}return null;})[_0xdf53('0x1c')](handleEntityNotFound(_0x2534c2,null))['then'](function(_0x234cfa){if(_0x234cfa){return _0x234cfa[_0xdf53('0x31')]({'UserId':_0x432b9e[_0xdf53('0x4e')][_0xdf53('0x6c')],'read1stAt':_[_0xdf53('0x59')](_0x234cfa[_0xdf53('0x70')])?moment()[_0xdf53('0x68')](_0xdf53('0x69')):undefined});}return null;})['then'](function(_0xf3916f){if(_0xf3916f){_0x4f2a7a[_0xdf53('0x71')]=_0xf3916f[_0xdf53('0x72')]({'plain':!![]});interaction_log[_0xdf53('0x1d')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x432b9e[_0xdf53('0x5e')]['id'],_0x432b9e[_0xdf53('0x5e')]['name'],_0x432b9e[_0xdf53('0x5e')]['role'],_0x4f2a7a[_0xdf53('0x71')]['id'],_0x432b9e[_0xdf53('0x4e')]?JSON[_0xdf53('0x21')](_0x432b9e[_0xdf53('0x4e')]):_0xdf53('0x73'));return respondWithRpcPromise(_0xdf53('0x74'),_0xdf53('0x75'),_0x4f2a7a);}return null;})['then'](function(_0x10356b){if(_0x10356b){if(_0x432b9e[_0xdf53('0x4e')][_0xdf53('0x76')]){_0x4f2a7a[_0xdf53('0x23')][_0xdf53('0x77')]=util['format'](_0xdf53('0x78'),_0x432b9e[_0xdf53('0x5e')]['name']);_0x4f2a7a['message'][_0xdf53('0x79')]=_0x4f2a7a[_0xdf53('0x79')];_0x4f2a7a['message'][_0xdf53('0x7a')]=_0xdf53('0x6a');return respondWithRpcPromise(_0xdf53('0x7b'),_0xdf53('0x7b'),{'event':'acceptmessage','message':_0x4f2a7a['message']},client9002)[_0xdf53('0x1c')](function(){return _0x4f2a7a;});}return _0x4f2a7a;}return null;})[_0xdf53('0x1c')](respondWithResult(_0x2534c2,null))['catch'](handleError(_0x2534c2,null));};var interaction_log=require(_0xdf53('0x11'))(_0xdf53('0x7c'));exports[_0xdf53('0x2f')]=function(_0x14ff76,_0x194aee,_0x565710){var _0xef11a6={'agent':{},'channel':_0xdf53('0x7d')};if(_0x14ff76[_0xdf53('0x4e')]['id']){delete _0x14ff76[_0xdf53('0x4e')]['id'];}_0x14ff76[_0xdf53('0x4e')][_0xdf53('0x6c')]=_0x14ff76[_0xdf53('0x4e')][_0xdf53('0x6c')]||_0x14ff76[_0xdf53('0x5e')]['id'];_0xef11a6[_0xdf53('0x7e')]['id']=_0x14ff76['body']['UserId'];return db[_0xdf53('0x47')][_0xdf53('0x4f')]({'where':{'id':_0x14ff76[_0xdf53('0x4c')]['id'],'UserId':null}})[_0xdf53('0x1c')](handleEntityNotFound(_0x194aee,null))['then'](function(_0x2e34b2){if(_0x2e34b2){_0xef11a6[_0xdf53('0x23')]=_0x2e34b2[_0xdf53('0x72')]({'plain':!![]});return db[_0xdf53('0x6e')][_0xdf53('0x4f')]({'where':{'id':_0x2e34b2[_0xdf53('0x6f')]}});}return null;})[_0xdf53('0x1c')](handleEntityNotFound(_0x194aee,null))[_0xdf53('0x1c')](function(_0x54da93){if(_0x54da93){_0xef11a6[_0xdf53('0x71')]=_0x54da93[_0xdf53('0x72')]({'plain':!![]});interaction_log[_0xdf53('0x1d')](_0xdf53('0x7f'),_0x14ff76['user']['id'],_0x14ff76[_0xdf53('0x5e')][_0xdf53('0x62')],_0x14ff76[_0xdf53('0x5e')][_0xdf53('0x80')],_0xef11a6[_0xdf53('0x71')]['id'],_0x14ff76[_0xdf53('0x4e')]?JSON[_0xdf53('0x21')](_0x14ff76[_0xdf53('0x4e')]):'null');return respondWithRpcPromise(_0xdf53('0x81'),'rejectMessage',_0xef11a6);}return null;})[_0xdf53('0x1c')](function(_0x366493){if(_0x366493){_0x366493[_0xdf53('0x23')][_0xdf53('0x77')]=util['format'](_0xdf53('0x78'),_0x14ff76[_0xdf53('0x5e')]['name']);_0x366493[_0xdf53('0x23')][_0xdf53('0x79')]=_0xef11a6['channel'];_0x366493[_0xdf53('0x23')][_0xdf53('0x7a')]=_0xdf53('0x2f');respondWithRpcPromise(_0xdf53('0x7b'),_0xdf53('0x7b'),{'event':_0xdf53('0x82'),'message':_0x366493[_0xdf53('0x23')]},client9002);return _0xef11a6;}return null;})[_0xdf53('0x1c')](respondWithResult(_0x194aee,null))[_0xdf53('0x4a')](handleError(_0x194aee,null));};exports[_0xdf53('0x83')]=function(_0x1ffff0,_0x2149a5){var _0x5e1448=moment()[_0xdf53('0x84')]()[_0xdf53('0x85')]();var _0x2fefa2=path[_0xdf53('0x63')](config[_0xdf53('0x86')],_0xdf53('0x87'),'files','tmp');var _0x1e4f96=path['join'](config[_0xdf53('0x86')],_0xdf53('0x87'),_0xdf53('0x88'),'attachments');var _0x273abe=util[_0xdf53('0x68')](_0xdf53('0x89'),_0x5e1448);return db[_0xdf53('0x47')][_0xdf53('0x4f')]({'where':{'id':_0x1ffff0[_0xdf53('0x4c')]['id']},'attributes':['id',_0xdf53('0x4e'),_0xdf53('0x8a'),'to','cc',_0xdf53('0x8b'),_0xdf53('0x8c')],'include':_0x1ffff0['query'][_0xdf53('0x61')]?[{'model':db['Attachment'],'as':_0xdf53('0x8d')}]:undefined})[_0xdf53('0x1c')](handleEntityNotFound(_0x2149a5,null))['then'](function(_0x5044a0){if(_0x5044a0){var _0x4454ae=_0x5044a0;var _0x164a90={'from':_0x4454ae[_0xdf53('0x8a')],'to':_0x4454ae['to'],'subject':_0x4454ae['subject'],'html':_0x4454ae[_0xdf53('0x4e')],'headers':{'Date':moment(_0x4454ae[_0xdf53('0x8c')])[_0xdf53('0x68')]('ddd,\x20d\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};return new BPromise(function(_0x2f2053,_0x364c01){if(_0x5044a0[_0xdf53('0x8d')]){for(var _0x40f724=0x0;_0x40f724<_0x5044a0[_0xdf53('0x8d')][_0xdf53('0x3b')];_0x40f724++){var _0x11bb78=_0x5044a0[_0xdf53('0x8d')][_0x40f724];var _0x45a682=path[_0xdf53('0x63')](_0x1e4f96,_0x11bb78[_0xdf53('0x64')]);if(fs[_0xdf53('0x8e')](_0x45a682)){_0x164a90[_0xdf53('0x61')][_0xdf53('0x8f')]({'name':_0x11bb78[_0xdf53('0x62')],'contentType':_0x11bb78[_0xdf53('0x44')],'data':fs[_0xdf53('0x90')](_0x45a682)});}}}emlformat[_0xdf53('0x91')](_0x164a90,function(_0x136dd1,_0x796339){if(_0x136dd1)return _0x364c01(_0x136dd1);fs[_0xdf53('0x92')](path[_0xdf53('0x63')](_0x2fefa2,_0x273abe),_0x796339);return _0x2f2053(_0x796339);});});}})[_0xdf53('0x1c')](function(_0xeb8a01){if(_0xeb8a01){return _0x2149a5[_0xdf53('0x83')](path[_0xdf53('0x63')](_0x2fefa2,_0x273abe),_0x273abe,function(_0x22d36d){if(_0x22d36d){console[_0xdf53('0x93')](_0xdf53('0x94'),_0x22d36d);}else{fs[_0xdf53('0x95')](path[_0xdf53('0x63')](_0x2fefa2,_0x273abe));}});}})['catch'](handleError(_0x2149a5,null));}; \ No newline at end of file +var _0x3e74=['isNil','host','port','secure','authentication','auth','user','pass','service','attachments','server/files/attachments','basename','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','mail-interactions','mail','read','readAt','format','UserId','MailInteraction','MailInteractionId','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','agent','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','join','files','tmp','root','message-%s.eml','createdAt','Attachment','Attachments','from','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','existsSync','push','build','writeFileSync','log','err','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','show','params','include','MailMessage','body','find','describe','create','out','secret','findOne','MailAccountId','MailServerOut','Smtp'];(function(_0x4ec216,_0xa8ac4d){var _0x24d4d5=function(_0x166eb7){while(--_0x166eb7){_0x4ec216['push'](_0x4ec216['shift']());}};_0x24d4d5(++_0xa8ac4d);}(_0x3e74,0x175));var _0x43e7=function(_0x5e2a76,_0x1ddc6e){_0x5e2a76=_0x5e2a76-0x0;var _0x5342eb=_0x3e74[_0x5e2a76];return _0x5342eb;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x43e7('0xf'));var qs=require(_0x43e7('0x10'));var logger=require('../../config/logger')(_0x43e7('0x11'));var utils=require('../../config/utils');var config=require(_0x43e7('0x12'));var db=require(_0x43e7('0x13'))['db'];config['redis']=_[_0x43e7('0x14')](config[_0x43e7('0x15')],{'host':_0x43e7('0x16'),'port':0x18eb});var socket=require(_0x43e7('0x17'))(new Redis(config['redis']));require('./mailMessage.socket')[_0x43e7('0x18')](socket);var jayson=require(_0x43e7('0x19'));var client=jayson[_0x43e7('0x1a')]['http']({'port':0x232c});var client9003=jayson['client'][_0x43e7('0x1b')]({'port':0x232b});var client9002=jayson[_0x43e7('0x1a')][_0x43e7('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x328445,_0x4de324,_0x5c4eaa,_0xdf16c){return new BPromise(function(_0x264575,_0x273a32){var _0x5d346f=_0xdf16c||client;return _0x5d346f['request'](_0x328445,_0x5c4eaa)[_0x43e7('0x1c')](function(_0x1ca758){logger[_0x43e7('0x1d')](_0x43e7('0x1e'),_0x4de324,_0x43e7('0x1f'));logger[_0x43e7('0x20')](_0x43e7('0x21'),_0x4de324,_0x43e7('0x1f'),JSON[_0x43e7('0x22')](_0x1ca758));if(_0x1ca758[_0x43e7('0x23')]){if(_0x1ca758[_0x43e7('0x23')][_0x43e7('0x24')]===0x1f4){logger['error'](_0x43e7('0x1e'),_0x4de324,_0x1ca758[_0x43e7('0x23')]['message']);return _0x273a32(_0x1ca758[_0x43e7('0x23')][_0x43e7('0x25')]);}logger[_0x43e7('0x23')](_0x43e7('0x1e'),_0x4de324,_0x1ca758[_0x43e7('0x23')][_0x43e7('0x25')]);return _0x264575(_0x1ca758['error'][_0x43e7('0x25')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x4de324,_0x43e7('0x1f'));_0x264575(_0x1ca758[_0x43e7('0x26')]['message']);}})[_0x43e7('0x27')](function(_0x4ca5cf){logger[_0x43e7('0x23')]('MailMessage,\x20%s,\x20%s',_0x4de324,_0x4ca5cf);_0x273a32(_0x4ca5cf);});});}function respondWithStatusCode(_0x1af208,_0x1b5f50){_0x1b5f50=_0x1b5f50||0xcc;return function(_0x20888b){if(_0x20888b){return _0x1af208[_0x43e7('0x28')](_0x1b5f50);}return _0x1af208['status'](_0x1b5f50)['end']();};}function respondWithResult(_0x805b54,_0x501551){_0x501551=_0x501551||0xc8;return function(_0x2dd5f){if(_0x2dd5f){return _0x805b54[_0x43e7('0x29')](_0x501551)[_0x43e7('0x2a')](_0x2dd5f);}};}function respondWithFilteredResult(_0xb1fc63,_0x5087d7){return function(_0x33a1a5){if(_0x33a1a5){var _0x4690a6=_0x33a1a5[_0x43e7('0x2b')],_0x45b675=_0x5087d7[_0x43e7('0x2c')],_0x50f9f5=_0x5087d7[_0x43e7('0x2c')]+_0x5087d7[_0x43e7('0x2d')],_0x442c3b;if(_0x50f9f5>=_0x4690a6){_0x50f9f5=_0x4690a6;_0x442c3b=0xc8;}else{_0x442c3b=0xce;}_0xb1fc63[_0x43e7('0x29')](_0x442c3b);return _0xb1fc63[_0x43e7('0x2e')](_0x43e7('0x2f'),_0x45b675+'-'+_0x50f9f5+'/'+_0x4690a6)[_0x43e7('0x2a')](_0x33a1a5);}return null;};}function patchUpdates(_0x208706){return function(_0x4bdb17){try{jsonpatch[_0x43e7('0x30')](_0x4bdb17,_0x208706,!![]);}catch(_0x44f6b0){return BPromise[_0x43e7('0x31')](_0x44f6b0);}return _0x4bdb17[_0x43e7('0x32')]();};}function saveUpdates(_0x4251c8,_0x4c8650){return function(_0x1eba65){if(_0x1eba65){return _0x1eba65[_0x43e7('0x33')](_0x4251c8)[_0x43e7('0x1c')](function(_0x3f280d){return _0x3f280d;});}return null;};}function removeEntity(_0x4c61b9,_0x5a7342){return function(_0x5e203f){if(_0x5e203f){return _0x5e203f[_0x43e7('0x34')]()[_0x43e7('0x1c')](function(){_0x4c61b9[_0x43e7('0x29')](0xcc)[_0x43e7('0x35')]();});}};}function handleEntityNotFound(_0x108313,_0xde7ed){return function(_0x485c6c){if(!_0x485c6c){_0x108313['sendStatus'](0x194);}return _0x485c6c;};}function handleError(_0x4ac23d,_0x59e5b2){_0x59e5b2=_0x59e5b2||0x1f4;return function(_0x4e8e86){logger['error'](_0x4e8e86['stack']);if(_0x4e8e86[_0x43e7('0x36')]){delete _0x4e8e86['name'];}_0x4ac23d[_0x43e7('0x29')](_0x59e5b2)[_0x43e7('0x37')](_0x4e8e86);};}exports[_0x43e7('0x38')]=function(_0x50a2d0,_0x40f72f){var _0x449803={},_0x101d45={},_0x4f1a5f={'count':0x0,'rows':[]};var _0x5332d9=db['MailMessage'][_0x43e7('0x39')];_0x101d45[_0x43e7('0x3a')]=_[_0x43e7('0x3b')](_0x5332d9);_0x101d45[_0x43e7('0x3c')]=_[_0x43e7('0x3b')](_0x50a2d0[_0x43e7('0x3c')]);_0x101d45[_0x43e7('0x3d')]=_[_0x43e7('0x3e')](_0x101d45['model'],_0x101d45[_0x43e7('0x3c')]);_0x449803[_0x43e7('0x3f')]=_['intersection'](_0x101d45[_0x43e7('0x3a')],qs['fields'](_0x50a2d0[_0x43e7('0x3c')][_0x43e7('0x40')]));_0x449803[_0x43e7('0x3f')]=_0x449803[_0x43e7('0x3f')][_0x43e7('0x41')]?_0x449803[_0x43e7('0x3f')]:_0x101d45['model'];if(!_0x50a2d0['query'][_0x43e7('0x42')](_0x43e7('0x43'))){_0x449803[_0x43e7('0x2d')]=qs[_0x43e7('0x2d')](_0x50a2d0[_0x43e7('0x3c')]['limit']);_0x449803[_0x43e7('0x2c')]=qs[_0x43e7('0x2c')](_0x50a2d0['query'][_0x43e7('0x2c')]);}_0x449803['order']=qs[_0x43e7('0x44')](_0x50a2d0['query'][_0x43e7('0x44')]);_0x449803[_0x43e7('0x45')]=qs[_0x43e7('0x3d')](_[_0x43e7('0x46')](_0x50a2d0['query'],_0x101d45['filters']));if(_0x50a2d0[_0x43e7('0x3c')][_0x43e7('0x47')]){_0x449803[_0x43e7('0x45')]=_[_0x43e7('0x48')](_0x449803['where'],{'$or':_['map'](_0x5332d9,function(_0x5dd988){if(_0x5dd988[_0x43e7('0x49')]['key']!==_0x43e7('0x4a')){var _0x4b3a59={};_0x4b3a59[_0x5dd988['field']]={'$like':'%'+_0x50a2d0[_0x43e7('0x3c')]['filter']+'%'};return _0x4b3a59;}})});}_0x449803=_[_0x43e7('0x48')]({},_0x449803,_0x50a2d0[_0x43e7('0x4b')]);var _0x257bd8={'where':_0x449803[_0x43e7('0x45')]};return db['MailMessage'][_0x43e7('0x2b')](_0x257bd8)[_0x43e7('0x1c')](function(_0x23a611){_0x4f1a5f[_0x43e7('0x2b')]=_0x23a611;if(_0x50a2d0[_0x43e7('0x3c')][_0x43e7('0x4c')]){_0x449803['include']=[{'all':!![]}];}return db['MailMessage'][_0x43e7('0x4d')](_0x449803);})[_0x43e7('0x1c')](function(_0x212841){_0x4f1a5f['rows']=_0x212841;return _0x4f1a5f;})['then'](respondWithFilteredResult(_0x40f72f,_0x449803))['catch'](handleError(_0x40f72f,null));};exports[_0x43e7('0x4e')]=function(_0x42ed10,_0x52b098){var _0x351ca2={'raw':!![],'where':{'id':_0x42ed10[_0x43e7('0x4f')]['id']}},_0x47686e={};_0x47686e['model']=_['keys'](db['MailMessage']['rawAttributes']);_0x47686e[_0x43e7('0x3c')]=_[_0x43e7('0x3b')](_0x42ed10['query']);_0x47686e[_0x43e7('0x3d')]=_[_0x43e7('0x3e')](_0x47686e[_0x43e7('0x3a')],_0x47686e[_0x43e7('0x3c')]);_0x351ca2['attributes']=_[_0x43e7('0x3e')](_0x47686e['model'],qs['fields'](_0x42ed10[_0x43e7('0x3c')][_0x43e7('0x40')]));_0x351ca2[_0x43e7('0x3f')]=_0x351ca2[_0x43e7('0x3f')][_0x43e7('0x41')]?_0x351ca2[_0x43e7('0x3f')]:_0x47686e[_0x43e7('0x3a')];if(_0x42ed10[_0x43e7('0x3c')][_0x43e7('0x4c')]){_0x351ca2[_0x43e7('0x50')]=[{'all':!![]}];}_0x351ca2=_['merge']({},_0x351ca2,_0x42ed10[_0x43e7('0x4b')]);return db[_0x43e7('0x51')]['find'](_0x351ca2)[_0x43e7('0x1c')](handleEntityNotFound(_0x52b098,null))['then'](respondWithResult(_0x52b098,null))[_0x43e7('0x27')](handleError(_0x52b098,null));};exports[_0x43e7('0x33')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x52')]['id']){delete _0x34e2ec['body']['id'];}return db['MailMessage'][_0x43e7('0x53')]({'where':{'id':_0x34e2ec[_0x43e7('0x4f')]['id']}})[_0x43e7('0x1c')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x1c')](saveUpdates(_0x34e2ec[_0x43e7('0x52')],null))[_0x43e7('0x1c')](respondWithResult(_0x1f561f,null))[_0x43e7('0x27')](handleError(_0x1f561f,null));};exports[_0x43e7('0x34')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x51')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x4f')]['id']}})[_0x43e7('0x1c')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x27')](handleError(_0x24e758,null));};exports[_0x43e7('0x54')]=function(_0x2d0052,_0x558d54){return db['MailMessage'][_0x43e7('0x54')]()[_0x43e7('0x1c')](respondWithResult(_0x558d54,null))['catch'](handleError(_0x558d54,null));};exports[_0x43e7('0x55')]=function(_0x54506d,_0x49a6ce){return db[_0x43e7('0x51')][_0x43e7('0x55')](_0x54506d[_0x43e7('0x52')])[_0x43e7('0x1c')](function(_0x68697){if(_0x68697){if(_0x68697['direction']===_0x43e7('0x56')&&!_0x68697[_0x43e7('0x57')]){return db['MailAccount'][_0x43e7('0x58')]({'where':{'id':_0x68697[_0x43e7('0x59')]},'include':[{'model':db[_0x43e7('0x5a')],'as':'Smtp','raw':!![]}]})['then'](function(_0x557a47){if(_0x557a47&&_0x557a47[_0x43e7('0x5b')]){var _0x4058ce={'tls':{'rejectUnauthorized':![]}};if(_[_0x43e7('0x5c')](_0x557a47[_0x43e7('0x5b')]['service'])){_0x4058ce['host']=_0x557a47[_0x43e7('0x5b')][_0x43e7('0x5d')];_0x4058ce[_0x43e7('0x5e')]=_0x557a47[_0x43e7('0x5b')]['port'];_0x4058ce[_0x43e7('0x5f')]=_0x557a47[_0x43e7('0x5b')][_0x43e7('0x5f')];if(_0x557a47[_0x43e7('0x5b')][_0x43e7('0x60')]){_0x4058ce[_0x43e7('0x61')]={'user':_0x557a47[_0x43e7('0x5b')][_0x43e7('0x62')],'pass':_0x557a47[_0x43e7('0x5b')][_0x43e7('0x63')]};}}else{_0x4058ce[_0x43e7('0x64')]=_0x557a47['Smtp']['service'];_0x4058ce[_0x43e7('0x61')]={'user':_0x557a47['Smtp']['user'],'pass':_0x557a47['Smtp'][_0x43e7('0x63')]};_0x4058ce[_0x43e7('0x5f')]=_0x557a47['Smtp'][_0x43e7('0x5f')];}if(_0x54506d[_0x43e7('0x52')][_0x43e7('0x65')]&&_0x54506d['body'][_0x43e7('0x65')][_0x43e7('0x41')]){for(var _0x289f86=0x0;_0x289f86<_0x54506d[_0x43e7('0x52')][_0x43e7('0x65')][_0x43e7('0x41')];_0x289f86+=0x1){_0x54506d[_0x43e7('0x52')]['attachments'][_0x289f86]={'filename':_0x54506d[_0x43e7('0x52')][_0x43e7('0x65')][_0x289f86][_0x43e7('0x36')],'path':path['join'](config['root'],_0x43e7('0x66'),_0x54506d['body']['attachments'][_0x289f86][_0x43e7('0x67')])};}}return{'account':_0x4058ce,'message':_0x54506d[_0x43e7('0x52')]};}})['then'](function(_0x88c7f){if(_0x88c7f){return respondWithRpcPromise(_0x43e7('0x68'),_0x43e7('0x69'),_0x88c7f,client9003)[_0x43e7('0x1c')](function(_0x16499c){return _0x68697[_0x43e7('0x33')]({'read':!![],'messageId':_0x16499c[_0x43e7('0x6a')],'sentAt':moment()['format'](_0x43e7('0x6b'))});})[_0x43e7('0x27')](function(_0x4e5956){logger[_0x43e7('0x23')]('%s',JSON['stringify'](_0x4e5956));return _0x68697;});}return _0x68697;});}return _0x68697;}})[_0x43e7('0x1c')](respondWithResult(_0x49a6ce,0xc9))[_0x43e7('0x27')](handleError(_0x49a6ce,null));};var interaction_log=require(_0x43e7('0x6c'))(_0x43e7('0x6d'));exports['accept']=function(_0x2d25b5,_0x2646c2,_0xf929a5){var _0x556001={'channel':_0x43e7('0x6e')};if(_0x2d25b5[_0x43e7('0x52')]['id']){delete _0x2d25b5[_0x43e7('0x52')]['id'];}_0x2d25b5[_0x43e7('0x52')][_0x43e7('0x6f')]=!![];_0x2d25b5['body'][_0x43e7('0x70')]=moment()[_0x43e7('0x71')](_0x43e7('0x6b'));_0x2d25b5[_0x43e7('0x52')][_0x43e7('0x72')]=_0x2d25b5[_0x43e7('0x52')][_0x43e7('0x72')]||_0x2d25b5['user']['id'];return db['MailMessage'][_0x43e7('0x53')]({'where':{'id':_0x2d25b5['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x43e7('0x1c')](handleEntityNotFound(_0x2646c2,null))[_0x43e7('0x1c')](saveUpdates(_0x2d25b5[_0x43e7('0x52')],null))[_0x43e7('0x1c')](function(_0x18713b){if(_0x18713b){_0x556001[_0x43e7('0x25')]=_0x18713b['get']({'plain':!![]});return db[_0x43e7('0x73')][_0x43e7('0x53')]({'where':{'id':_0x18713b[_0x43e7('0x74')]}});}return null;})['then'](handleEntityNotFound(_0x2646c2,null))[_0x43e7('0x1c')](function(_0xea84ec){if(_0xea84ec){return _0xea84ec[_0x43e7('0x33')]({'UserId':_0x2d25b5[_0x43e7('0x52')][_0x43e7('0x72')],'read1stAt':_[_0x43e7('0x5c')](_0xea84ec[_0x43e7('0x75')])?moment()[_0x43e7('0x71')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x55990c){if(_0x55990c){_0x556001[_0x43e7('0x76')]=_0x55990c[_0x43e7('0x77')]({'plain':!![]});interaction_log['info'](_0x43e7('0x78'),_0x2d25b5[_0x43e7('0x62')]['id'],_0x2d25b5[_0x43e7('0x62')][_0x43e7('0x36')],_0x2d25b5['user']['role'],_0x556001['interaction']['id'],_0x2d25b5[_0x43e7('0x52')]?JSON[_0x43e7('0x22')](_0x2d25b5['body']):'null');return respondWithRpcPromise(_0x43e7('0x79'),_0x43e7('0x7a'),_0x556001);}return null;})[_0x43e7('0x1c')](function(_0x4ae26f){if(_0x4ae26f){if(_0x2d25b5[_0x43e7('0x52')][_0x43e7('0x7b')]){_0x556001[_0x43e7('0x25')][_0x43e7('0x7c')]=util['format'](_0x43e7('0x7d'),_0x2d25b5['user'][_0x43e7('0x36')]);_0x556001[_0x43e7('0x25')][_0x43e7('0x7e')]=_0x556001[_0x43e7('0x7e')];_0x556001[_0x43e7('0x25')][_0x43e7('0x7f')]=_0x43e7('0x80');return respondWithRpcPromise('EventManager',_0x43e7('0x81'),{'event':_0x43e7('0x82'),'message':_0x556001[_0x43e7('0x25')]},client9002)[_0x43e7('0x1c')](function(){return _0x556001;});}return _0x556001;}return null;})['then'](respondWithResult(_0x2646c2,null))['catch'](handleError(_0x2646c2,null));};var interaction_log=require('../../config/logger')(_0x43e7('0x6d'));exports['reject']=function(_0x240f0d,_0x36b768,_0x2d02bf){var _0x7387f6={'agent':{},'channel':_0x43e7('0x6e')};if(_0x240f0d[_0x43e7('0x52')]['id']){delete _0x240f0d[_0x43e7('0x52')]['id'];}_0x240f0d[_0x43e7('0x52')][_0x43e7('0x72')]=_0x240f0d[_0x43e7('0x52')][_0x43e7('0x72')]||_0x240f0d['user']['id'];_0x7387f6[_0x43e7('0x83')]['id']=_0x240f0d[_0x43e7('0x52')][_0x43e7('0x72')];return db[_0x43e7('0x51')][_0x43e7('0x53')]({'where':{'id':_0x240f0d['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x36b768,null))[_0x43e7('0x1c')](function(_0x3e3c82){if(_0x3e3c82){_0x7387f6['message']=_0x3e3c82[_0x43e7('0x77')]({'plain':!![]});return db[_0x43e7('0x73')]['find']({'where':{'id':_0x3e3c82['MailInteractionId']}});}return null;})[_0x43e7('0x1c')](handleEntityNotFound(_0x36b768,null))[_0x43e7('0x1c')](function(_0x22947e){if(_0x22947e){_0x7387f6[_0x43e7('0x76')]=_0x22947e[_0x43e7('0x77')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x240f0d[_0x43e7('0x62')]['id'],_0x240f0d[_0x43e7('0x62')][_0x43e7('0x36')],_0x240f0d[_0x43e7('0x62')]['role'],_0x7387f6[_0x43e7('0x76')]['id'],_0x240f0d[_0x43e7('0x52')]?JSON[_0x43e7('0x22')](_0x240f0d[_0x43e7('0x52')]):'null');return respondWithRpcPromise(_0x43e7('0x84'),_0x43e7('0x85'),_0x7387f6);}return null;})[_0x43e7('0x1c')](function(_0x2ba752){if(_0x2ba752){_0x2ba752[_0x43e7('0x25')]['interface']=util[_0x43e7('0x71')](_0x43e7('0x7d'),_0x240f0d['user'][_0x43e7('0x36')]);_0x2ba752[_0x43e7('0x25')][_0x43e7('0x7e')]=_0x7387f6[_0x43e7('0x7e')];_0x2ba752['message'][_0x43e7('0x7f')]='reject';respondWithRpcPromise(_0x43e7('0x81'),_0x43e7('0x81'),{'event':_0x43e7('0x86'),'message':_0x2ba752[_0x43e7('0x25')]},client9002);return _0x7387f6;}return null;})[_0x43e7('0x1c')](respondWithResult(_0x36b768,null))[_0x43e7('0x27')](handleError(_0x36b768,null));};exports[_0x43e7('0x87')]=function(_0x350d0f,_0xa693a3){var _0x5460cf=moment()[_0x43e7('0x88')]()[_0x43e7('0x89')]();var _0x376256=path[_0x43e7('0x8a')](config['root'],'server',_0x43e7('0x8b'),_0x43e7('0x8c'));var _0x213dea=path['join'](config[_0x43e7('0x8d')],'server','files','attachments');var _0x472075=util['format'](_0x43e7('0x8e'),_0x5460cf);return db[_0x43e7('0x51')][_0x43e7('0x53')]({'where':{'id':_0x350d0f[_0x43e7('0x4f')]['id']},'attributes':['id',_0x43e7('0x52'),'from','to','cc','subject',_0x43e7('0x8f')],'include':_0x350d0f[_0x43e7('0x3c')]['attachments']?[{'model':db[_0x43e7('0x90')],'as':_0x43e7('0x91')}]:undefined})[_0x43e7('0x1c')](handleEntityNotFound(_0xa693a3,null))[_0x43e7('0x1c')](function(_0xc83a14){if(_0xc83a14){var _0x1dbbb9=_0xc83a14;var _0x399253={'from':_0x1dbbb9[_0x43e7('0x92')],'to':_0x1dbbb9['to'],'subject':_0x1dbbb9[_0x43e7('0x93')],'html':_0x1dbbb9[_0x43e7('0x52')],'headers':{'Date':moment(_0x1dbbb9[_0x43e7('0x8f')])[_0x43e7('0x71')](_0x43e7('0x94'))},'attachments':[]};return new BPromise(function(_0x277b80,_0x37ee16){if(_0xc83a14[_0x43e7('0x91')]){for(var _0x3286b1=0x0;_0x3286b1<_0xc83a14[_0x43e7('0x91')][_0x43e7('0x41')];_0x3286b1++){var _0x3bdcc9=_0xc83a14[_0x43e7('0x91')][_0x3286b1];var _0x11f7d8=path['join'](_0x213dea,_0x3bdcc9[_0x43e7('0x67')]);if(fs[_0x43e7('0x95')](_0x11f7d8)){_0x399253[_0x43e7('0x65')][_0x43e7('0x96')]({'name':_0x3bdcc9['name'],'contentType':_0x3bdcc9[_0x43e7('0x49')],'data':fs['readFileSync'](_0x11f7d8)});}}}emlformat[_0x43e7('0x97')](_0x399253,function(_0x42413e,_0x328646){if(_0x42413e)return _0x37ee16(_0x42413e);fs[_0x43e7('0x98')](path[_0x43e7('0x8a')](_0x376256,_0x472075),_0x328646);return _0x277b80(_0x328646);});});}})[_0x43e7('0x1c')](function(_0x4cdfcf){if(_0x4cdfcf){return _0xa693a3[_0x43e7('0x87')](path[_0x43e7('0x8a')](_0x376256,_0x472075),_0x472075,function(_0x9d146b){if(_0x9d146b){console[_0x43e7('0x99')](_0x43e7('0x9a'),_0x9d146b);}else{fs['unlinkSync'](path['join'](_0x376256,_0x472075));}});}})[_0x43e7('0x27')](handleError(_0xa693a3,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 0e60989..f510739 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 _0xab3f=['save','update','remove','emit','hook','exports','events','MailMessage','setMaxListeners'];(function(_0x3d1478,_0x3c9cb3){var _0x2b32d3=function(_0x5af15b){while(--_0x5af15b){_0x3d1478['push'](_0x3d1478['shift']());}};_0x2b32d3(++_0x3c9cb3);}(_0xab3f,0x72));var _0xfab3=function(_0x48af58,_0x27a297){_0x48af58=_0x48af58-0x0;var _0x55468d=_0xab3f[_0x48af58];return _0x55468d;};'use strict';var EventEmitter=require(_0xfab3('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xfab3('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xfab3('0x2')](0x0);var events={'afterCreate':_0xfab3('0x3'),'afterUpdate':_0xfab3('0x4'),'afterDestroy':_0xfab3('0x5')};function emitEvent(_0x12c3ab){return function(_0x394308,_0x4387f8,_0x3e2de2){MailMessageEvents[_0xfab3('0x6')](_0x12c3ab+':'+_0x394308['id'],_0x394308);MailMessageEvents[_0xfab3('0x6')](_0x12c3ab,_0x394308);_0x3e2de2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xfab3('0x7')](e,emitEvent(event));}}module[_0xfab3('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x1dcc=['hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners','update','emit'];(function(_0x228321,_0xb1d38){var _0x4a90d7=function(_0x89d02e){while(--_0x89d02e){_0x228321['push'](_0x228321['shift']());}};_0x4a90d7(++_0xb1d38);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x524a05,_0x4b92d5){_0x524a05=_0x524a05-0x0;var _0x3f88a6=_0x1dcc[_0x524a05];return _0x3f88a6;};'use strict';var EventEmitter=require(_0xc1dc('0x0'));var MailMessage=require(_0xc1dc('0x1'))['db'][_0xc1dc('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc1dc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc1dc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x20abc9){return function(_0x3eb139,_0x2a8ff9,_0x5deaf7){MailMessageEvents['emit'](_0x20abc9+':'+_0x3eb139['id'],_0x3eb139);MailMessageEvents[_0xc1dc('0x5')](_0x20abc9,_0x3eb139);_0x5deaf7(null);};}for(var e in events){if(events[_0xc1dc('0x6')](e)){var event=events[e];MailMessage[_0xc1dc('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 78bf4a5..fb689ef 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 _0x9548=['toLowerCase','out','isNil','UserId','MailInteraction','then','update','createdAt','body','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','models','direction'];(function(_0x263521,_0x1f2dab){var _0x509771=function(_0x3c2412){while(--_0x3c2412){_0x263521['push'](_0x263521['shift']());}};_0x509771(++_0x1f2dab);}(_0x9548,0x1d9));var _0x8954=function(_0x258d0e,_0x10226a){_0x258d0e=_0x258d0e-0x0;var _0x344204=_0x9548[_0x258d0e];return _0x344204;};'use strict';var _=require('lodash');var util=require(_0x8954('0x0'));var logger=require(_0x8954('0x1'))(_0x8954('0x2'));var moment=require('moment');var BPromise=require(_0x8954('0x3'));var rp=require('request-promise');var attributes=require(_0x8954('0x4'));module['exports']=function(_0x2af290,_0x1e820d){return _0x2af290[_0x8954('0x5')](_0x8954('0x6'),attributes,{'tableName':_0x8954('0x7'),'paranoid':![],'indexes':[{'name':_0x8954('0x8'),'fields':[_0x8954('0x8')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1cab49,_0x4617f5,_0x3b6a65){var _0x54830a=_0x2af290[_0x8954('0x9')];var _0x65b433=_0x1cab49['get']({'plain':!![]});if(_0x65b433[_0x8954('0xa')][_0x8954('0xb')]()==='in'||_0x65b433[_0x8954('0xa')]['toLowerCase']()===_0x8954('0xc')&&!_0x65b433['secret']&&!_[_0x8954('0xd')](_0x65b433[_0x8954('0xe')])){_0x54830a[_0x8954('0xf')]['findOne']({'where':{'id':_0x65b433['MailInteractionId']}})[_0x8954('0x10')](function(_0x1686f2){if(_0x1686f2){_0x1686f2[_0x8954('0x11')]({'lastMsgAt':_0x65b433[_0x8954('0x12')],'lastMsgDirection':_0x65b433[_0x8954('0xa')]['toLowerCase'](),'lastMsgBody':_0x65b433[_0x8954('0x13')]});}})['catch'](function(_0x44ebdc){console['error'](_0x44ebdc);});}_0x3b6a65();}},'charset':_0x8954('0x14'),'collate':_0x8954('0x15')});}; \ No newline at end of file +var _0x82eb=['bluebird','request-promise','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','models','get','direction','toLowerCase','out','secret','UserId','then','createdAt','body','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x3987a1,_0x447793){var _0xe2596e=function(_0x546925){while(--_0x546925){_0x3987a1['push'](_0x3987a1['shift']());}};_0xe2596e(++_0x447793);}(_0x82eb,0xaa));var _0xb82e=function(_0x11cc11,_0x533956){_0x11cc11=_0x11cc11-0x0;var _0x4e75bc=_0x82eb[_0x11cc11];return _0x4e75bc;};'use strict';var _=require(_0xb82e('0x0'));var util=require(_0xb82e('0x1'));var logger=require(_0xb82e('0x2'))(_0xb82e('0x3'));var moment=require(_0xb82e('0x4'));var BPromise=require(_0xb82e('0x5'));var rp=require(_0xb82e('0x6'));var attributes=require(_0xb82e('0x7'));module[_0xb82e('0x8')]=function(_0x54ed3b,_0x2bd00f){return _0x54ed3b['define'](_0xb82e('0x9'),attributes,{'tableName':_0xb82e('0xa'),'paranoid':![],'indexes':[{'name':_0xb82e('0xb'),'fields':[_0xb82e('0xb')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2721d3,_0x40993a,_0x3e7ceb){var _0x33628b=_0x54ed3b[_0xb82e('0xc')];var _0x837b47=_0x2721d3[_0xb82e('0xd')]({'plain':!![]});if(_0x837b47[_0xb82e('0xe')][_0xb82e('0xf')]()==='in'||_0x837b47[_0xb82e('0xe')][_0xb82e('0xf')]()===_0xb82e('0x10')&&!_0x837b47[_0xb82e('0x11')]&&!_['isNil'](_0x837b47[_0xb82e('0x12')])){_0x33628b['MailInteraction']['findOne']({'where':{'id':_0x837b47['MailInteractionId']}})[_0xb82e('0x13')](function(_0x5ce55b){if(_0x5ce55b){_0x5ce55b['update']({'lastMsgAt':_0x837b47[_0xb82e('0x14')],'lastMsgDirection':_0x837b47[_0xb82e('0xe')][_0xb82e('0xf')](),'lastMsgBody':_0x837b47[_0xb82e('0x15')]});}})['catch'](function(_0x1d68b1){console[_0xb82e('0x16')](_0x1d68b1);});}_0x3e7ceb();}},'charset':_0xb82e('0x17'),'collate':_0xb82e('0x18')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index c71604c..2537163 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 _0x943c=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc943('0x0'));var util=require(_0xc943('0x1'));var moment=require(_0xc943('0x2'));var BPromise=require(_0xc943('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc943('0x4'))['db'];var utils=require(_0xc943('0x5'));var logger=require(_0xc943('0x6'))('rpc');var config=require(_0xc943('0x7'));var jayson=require(_0xc943('0x8'));var client=jayson[_0xc943('0x9')][_0xc943('0xa')]({'port':0x232a});config[_0xc943('0xb')]=_[_0xc943('0xc')](config[_0xc943('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc943('0xd'))(new Redis(config[_0xc943('0xb')]));require(_0xc943('0xe'))[_0xc943('0xf')](socket);function respondWithRpcPromise(_0x5ea94b,_0x4b054c,_0x4a4313){return new BPromise(function(_0x142a27,_0x578a7b){return client['request'](_0x5ea94b,_0x4a4313)[_0xc943('0x10')](function(_0x401b9a){logger[_0xc943('0x11')](_0xc943('0x12'),_0x4b054c,_0xc943('0x13'));logger[_0xc943('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4b054c,_0xc943('0x13'),JSON[_0xc943('0x15')](_0x401b9a));if(_0x401b9a['error']){if(_0x401b9a['error']['code']===0x1f4){logger[_0xc943('0x16')](_0xc943('0x12'),_0x4b054c,_0x401b9a['error'][_0xc943('0x17')]);return _0x578a7b(_0x401b9a['error']['message']);}logger[_0xc943('0x16')]('MailMessage,\x20%s,\x20%s',_0x4b054c,_0x401b9a[_0xc943('0x16')][_0xc943('0x17')]);return _0x142a27(_0x401b9a[_0xc943('0x16')][_0xc943('0x17')]);}else{logger['info'](_0xc943('0x12'),_0x4b054c,_0xc943('0x13'));_0x142a27(_0x401b9a[_0xc943('0x18')]['message']);}})[_0xc943('0x19')](function(_0x320b62){logger[_0xc943('0x16')](_0xc943('0x12'),_0x4b054c,_0x320b62);_0x578a7b(_0x320b62);});});}exports[_0xc943('0x1a')]=function(_0x23da3a){var _0x18a50c=this;return new Promise(function(_0x397598,_0x2dbb35){return db[_0xc943('0x1b')][_0xc943('0x1c')](_0x23da3a[_0xc943('0x1d')],{'raw':_0x23da3a[_0xc943('0x1e')]?_0x23da3a[_0xc943('0x1e')][_0xc943('0x1f')]===undefined?!![]:![]:!![]})[_0xc943('0x10')](function(_0x43712d){logger[_0xc943('0x11')](_0xc943('0x1a'),_0x23da3a);logger['debug'](_0xc943('0x1a'),_0x23da3a,JSON[_0xc943('0x15')](_0x43712d));_0x397598(_0x43712d);})[_0xc943('0x19')](function(_0x3f5761){logger[_0xc943('0x16')](_0xc943('0x1a'),_0x3f5761[_0xc943('0x17')],_0x23da3a);_0x2dbb35(_0x18a50c[_0xc943('0x16')](0x1f4,_0x3f5761[_0xc943('0x17')]));});});}; \ No newline at end of file +var _0x0f89=['../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','request\x20sent','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x56c2c4,_0x365407){var _0x16243b=function(_0x53697d){while(--_0x53697d){_0x56c2c4['push'](_0x56c2c4['shift']());}};_0x16243b(++_0x365407);}(_0x0f89,0x111));var _0x90f8=function(_0x45e3c4,_0x2881d3){_0x45e3c4=_0x45e3c4-0x0;var _0x4365d7=_0x0f89[_0x45e3c4];return _0x4365d7;};'use strict';var _=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var moment=require(_0x90f8('0x2'));var BPromise=require('bluebird');var rs=require(_0x90f8('0x3'));var fs=require('fs');var Redis=require(_0x90f8('0x4'));var db=require(_0x90f8('0x5'))['db'];var utils=require(_0x90f8('0x6'));var logger=require('../../config/logger')(_0x90f8('0x7'));var config=require(_0x90f8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x90f8('0x9')][_0x90f8('0xa')]({'port':0x232a});config[_0x90f8('0xb')]=_[_0x90f8('0xc')](config[_0x90f8('0xb')],{'host':_0x90f8('0xd'),'port':0x18eb});var socket=require(_0x90f8('0xe'))(new Redis(config[_0x90f8('0xb')]));require(_0x90f8('0xf'))[_0x90f8('0x10')](socket);function respondWithRpcPromise(_0x46b3ad,_0x55ed12,_0x4f8f90){return new BPromise(function(_0x99ae07,_0x2e2134){return client[_0x90f8('0x11')](_0x46b3ad,_0x4f8f90)[_0x90f8('0x12')](function(_0x3cdde3){logger[_0x90f8('0x13')]('MailMessage,\x20%s,\x20%s',_0x55ed12,_0x90f8('0x14'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x55ed12,_0x90f8('0x14'),JSON[_0x90f8('0x15')](_0x3cdde3));if(_0x3cdde3['error']){if(_0x3cdde3[_0x90f8('0x16')]['code']===0x1f4){logger[_0x90f8('0x16')](_0x90f8('0x17'),_0x55ed12,_0x3cdde3[_0x90f8('0x16')][_0x90f8('0x18')]);return _0x2e2134(_0x3cdde3['error'][_0x90f8('0x18')]);}logger[_0x90f8('0x16')](_0x90f8('0x17'),_0x55ed12,_0x3cdde3[_0x90f8('0x16')]['message']);return _0x99ae07(_0x3cdde3[_0x90f8('0x16')][_0x90f8('0x18')]);}else{logger['info'](_0x90f8('0x17'),_0x55ed12,_0x90f8('0x14'));_0x99ae07(_0x3cdde3[_0x90f8('0x19')][_0x90f8('0x18')]);}})[_0x90f8('0x1a')](function(_0x38a493){logger[_0x90f8('0x16')](_0x90f8('0x17'),_0x55ed12,_0x38a493);_0x2e2134(_0x38a493);});});}exports[_0x90f8('0x1b')]=function(_0x299ef4){var _0x45aa55=this;return new Promise(function(_0x2a6d02,_0x2994f9){return db['MailMessage']['create'](_0x299ef4[_0x90f8('0x1c')],{'raw':_0x299ef4[_0x90f8('0x1d')]?_0x299ef4[_0x90f8('0x1d')][_0x90f8('0x1e')]===undefined?!![]:![]:!![]})[_0x90f8('0x12')](function(_0x17dfe7){logger[_0x90f8('0x13')](_0x90f8('0x1b'),_0x299ef4);logger['debug'](_0x90f8('0x1b'),_0x299ef4,JSON[_0x90f8('0x15')](_0x17dfe7));_0x2a6d02(_0x17dfe7);})[_0x90f8('0x1a')](function(_0x43afbc){logger['error']('CreateMailMessage',_0x43afbc[_0x90f8('0x18')],_0x299ef4);_0x2994f9(_0x45aa55[_0x90f8('0x16')](0x1f4,_0x43afbc['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 849ecd8..afd87e5 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 _0xbb4d=['length','mailMessage:','./mailMessage.events','save','emit','removeListener'];(function(_0x283781,_0x154fa2){var _0x21ad38=function(_0x8cb322){while(--_0x8cb322){_0x283781['push'](_0x283781['shift']());}};_0x21ad38(++_0x154fa2);}(_0xbb4d,0x74));var _0xdbb4=function(_0xa9d6d1,_0x3762b2){_0xa9d6d1=_0xa9d6d1-0x0;var _0x53a4cb=_0xbb4d[_0xa9d6d1];return _0x53a4cb;};'use strict';var MailMessageEvents=require(_0xdbb4('0x0'));var events=[_0xdbb4('0x1'),'remove','update'];function createListener(_0x44f26a,_0x46f717){return function(_0x1abd6e){_0x46f717[_0xdbb4('0x2')](_0x44f26a,_0x1abd6e);};}function removeListener(_0x3fc156,_0x1101ed){return function(){MailMessageEvents[_0xdbb4('0x3')](_0x3fc156,_0x1101ed);};}exports['register']=function(_0x3f7b12){for(var _0x3d1c5f=0x0,_0x546472=events[_0xdbb4('0x4')];_0x3d1c5f<_0x546472;_0x3d1c5f++){var _0x29a25b=events[_0x3d1c5f];var _0x10c1c2=createListener(_0xdbb4('0x5')+_0x29a25b,_0x3f7b12);MailMessageEvents['on'](_0x29a25b,_0x10c1c2);}}; \ No newline at end of file +var _0xb93f=['removeListener','register','length','mailMessage:','./mailMessage.events','save','remove','update','emit'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xb93f,0x9d));var _0xfb93=function(_0x45161c,_0x5494fc){_0x45161c=_0x45161c-0x0;var _0x186581=_0xb93f[_0x45161c];return _0x186581;};'use strict';var MailMessageEvents=require(_0xfb93('0x0'));var events=[_0xfb93('0x1'),_0xfb93('0x2'),_0xfb93('0x3')];function createListener(_0x11349c,_0x3a00e9){return function(_0x5b90a1){_0x3a00e9[_0xfb93('0x4')](_0x11349c,_0x5b90a1);};}function removeListener(_0x52cb38,_0x443d55){return function(){MailMessageEvents[_0xfb93('0x5')](_0x52cb38,_0x443d55);};}exports[_0xfb93('0x6')]=function(_0x25794b){for(var _0x28fe35=0x0,_0x23bc90=events[_0xfb93('0x7')];_0x28fe35<_0x23bc90;_0x28fe35++){var _0x676e66=events[_0x28fe35];var _0x319452=createListener(_0xfb93('0x8')+_0x676e66,_0x25794b);MailMessageEvents['on'](_0x676e66,_0x319452);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 8dddcbe..3584e69 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 _0x1865=['path','connect-timeout','express','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','destroy','delete','removeAgents','exports','multer'];(function(_0x5b2263,_0x2df183){var _0x487cbe=function(_0x5240ff){while(--_0x5240ff){_0x5b2263['push'](_0x5b2263['shift']());}};_0x487cbe(++_0x2df183);}(_0x1865,0xd7));var _0x5186=function(_0x911353,_0x1648ed){_0x911353=_0x911353-0x0;var _0x2f05fa=_0x1865[_0x911353];return _0x2f05fa;};'use strict';var multer=require(_0x5186('0x0'));var util=require('util');var path=require(_0x5186('0x1'));var timeout=require(_0x5186('0x2'));var express=require(_0x5186('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5186('0x4'));var config=require('../../config/environment');var controller=require(_0x5186('0x5'));router[_0x5186('0x6')]('/',auth[_0x5186('0x7')](),controller[_0x5186('0x8')]);router[_0x5186('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5186('0x6')]('/:id',auth[_0x5186('0x7')](),controller['show']);router['get'](_0x5186('0x9'),auth[_0x5186('0x7')](),controller[_0x5186('0xa')]);router[_0x5186('0x6')]('/:id/teams',auth[_0x5186('0x7')](),controller[_0x5186('0xb')]);router[_0x5186('0x6')](_0x5186('0xc'),auth[_0x5186('0x7')](),controller[_0x5186('0xd')]);router[_0x5186('0xe')]('/',auth[_0x5186('0x7')](),controller[_0x5186('0xf')]);router['post'](_0x5186('0x10'),auth[_0x5186('0x7')](),controller[_0x5186('0x11')]);router[_0x5186('0xe')](_0x5186('0xc'),auth[_0x5186('0x7')](),controller[_0x5186('0x12')]);router[_0x5186('0x13')]('/:id',auth[_0x5186('0x7')](),controller['update']);router['delete']('/:id',auth[_0x5186('0x7')](),controller[_0x5186('0x14')]);router[_0x5186('0x15')](_0x5186('0x10'),auth[_0x5186('0x7')](),controller['removeTeams']);router[_0x5186('0x15')](_0x5186('0xc'),auth['isAuthenticated'](),controller[_0x5186('0x16')]);module[_0x5186('0x17')]=router; \ No newline at end of file +var _0x823c=['destroy','delete','removeTeams','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','post','addTeams','addAgents','put'];(function(_0x12bfce,_0x1e250f){var _0x45b82b=function(_0x44ae85){while(--_0x44ae85){_0x12bfce['push'](_0x12bfce['shift']());}};_0x45b82b(++_0x1e250f);}(_0x823c,0x162));var _0xc823=function(_0x324b7f,_0x5d898e){_0x324b7f=_0x324b7f-0x0;var _0x21e938=_0x823c[_0x324b7f];return _0x21e938;};'use strict';var multer=require(_0xc823('0x0'));var util=require(_0xc823('0x1'));var path=require('path');var timeout=require(_0xc823('0x2'));var express=require(_0xc823('0x3'));var router=express[_0xc823('0x4')]();var auth=require(_0xc823('0x5'));var interaction=require(_0xc823('0x6'));var config=require(_0xc823('0x7'));var controller=require(_0xc823('0x8'));router[_0xc823('0x9')]('/',auth[_0xc823('0xa')](),controller[_0xc823('0xb')]);router[_0xc823('0x9')](_0xc823('0xc'),auth[_0xc823('0xa')](),controller[_0xc823('0xd')]);router[_0xc823('0x9')](_0xc823('0xe'),auth[_0xc823('0xa')](),controller[_0xc823('0xf')]);router[_0xc823('0x9')](_0xc823('0x10'),auth[_0xc823('0xa')](),controller[_0xc823('0x11')]);router[_0xc823('0x9')](_0xc823('0x12'),auth[_0xc823('0xa')](),controller['getTeams']);router[_0xc823('0x9')]('/:id/users',auth[_0xc823('0xa')](),controller['getAgents']);router[_0xc823('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc823('0x13')](_0xc823('0x12'),auth['isAuthenticated'](),controller[_0xc823('0x14')]);router[_0xc823('0x13')]('/:id/users',auth[_0xc823('0xa')](),controller[_0xc823('0x15')]);router[_0xc823('0x16')](_0xc823('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc823('0xe'),auth[_0xc823('0xa')](),controller[_0xc823('0x17')]);router[_0xc823('0x18')](_0xc823('0x12'),auth[_0xc823('0xa')](),controller[_0xc823('0x19')]);router[_0xc823('0x18')](_0xc823('0x1a'),auth[_0xc823('0xa')](),controller[_0xc823('0x1b')]);module[_0xc823('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 44ec4eb..7446d0a 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 _0xf0e8=['STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x466410,_0x4bc92e){var _0x464279=function(_0x31e33e){while(--_0x31e33e){_0x466410['push'](_0x466410['shift']());}};_0x464279(++_0x4bc92e);}(_0xf0e8,0xf5));var _0x8f0e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xf0e8[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8f0e('0x0')],'unique':_0x8f0e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8f0e('0x0')]},'timeout':{'type':Sequelize[_0x8f0e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8f0e('0x3')](_0x8f0e('0x4'),'beepall','roundrobin')}}; \ No newline at end of file +var _0xe3da=['sequelize','exports','STRING','name','INTEGER','rrmemory','roundrobin'];(function(_0x19acf9,_0x339ed4){var _0x1163ff=function(_0x5d58d7){while(--_0x5d58d7){_0x19acf9['push'](_0x19acf9['shift']());}};_0x1163ff(++_0x339ed4);}(_0xe3da,0x149));var _0xae3d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe3da[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xae3d('0x0'));module[_0xae3d('0x1')]={'name':{'type':Sequelize[_0xae3d('0x2')],'unique':_0xae3d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xae3d('0x2')]},'timeout':{'type':Sequelize[_0xae3d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xae3d('0x5'),'beepall',_0xae3d('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index d1407d6..fb9a6be 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 _0xa9e0=['stack','name','index','MailQueue','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','pick','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','Agents','union','addAgents','penalty','ids','removeTeams','omit','emit','removeAgents','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error'];(function(_0x35b5fb,_0x175955){var _0xb76d8c=function(_0xebf80c){while(--_0xebf80c){_0x35b5fb['push'](_0x35b5fb['shift']());}};_0xb76d8c(++_0x175955);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./mailQueue.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='MailQueues';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':!![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['MailQueue'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['MailQueue'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931){return db['MailQueue'][_0x0a9e('0x4f')]()['then'](respondWithResult(_0x145931,null))[_0x0a9e('0x42')](handleError(_0x145931,null));};exports['getMembers']=function(_0x5da27d,_0x5df0ad,_0x2da03c){var _0x47de4c={'raw':!![],'where':{}},_0x2f7092={},_0x65432;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x5da27d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5df0ad,null))[_0x0a9e('0x23')](function(_0x28d814){if(_0x28d814){_0x65432=_0x28d814['get']({'plain':!![]});_0x2f7092[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x51')][_0x0a9e('0x2b')]);_0x2f7092[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5da27d['query']);_0x2f7092[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2f7092['model'],_0x2f7092[_0x0a9e('0x2e')]);_0x47de4c['attributes']=_[_0x0a9e('0x2f')](_0x2f7092['model'],qs['fields'](_0x5da27d['query'][_0x0a9e('0x31')]));_0x47de4c['attributes']=_0x47de4c[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x47de4c[_0x0a9e('0x30')]:_0x2f7092[_0x0a9e('0x2c')];if(!_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x47de4c[_0x0a9e('0x1d')]=qs['limit'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x47de4c[_0x0a9e('0x1c')]=qs['offset'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}_0x47de4c[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x5da27d['query'][_0x0a9e('0x35')]);_0x47de4c[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x52')](_0x5da27d[_0x0a9e('0x2e')],_0x2f7092[_0x0a9e('0x36')]));_0x47de4c[_0x0a9e('0x39')][_0x0a9e('0x53')]=_0x28d814['id'];if(_0x5da27d['query'][_0x0a9e('0x37')]){_0x47de4c[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x47de4c['where'],{'$or':_[_0x0a9e('0x3a')](_0x47de4c['attributes'],function(_0x5211e3){var _0x242745={};_0x242745[_0x5211e3]={'$like':'%'+_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x242745;})});}_0x47de4c=_[_0x0a9e('0x38')]({},_0x47de4c,_0x5da27d[_0x0a9e('0x3e')]);return db[_0x0a9e('0x51')][_0x0a9e('0x54')](_0x47de4c);}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){return db[_0x0a9e('0x55')][_0x0a9e('0x56')]({'where':{'id':_[_0x0a9e('0x3a')](_0x2d7205,_0x0a9e('0x57')),'role':_0x0a9e('0x58')},'attributes':['id',_0x0a9e('0x28'),_0x0a9e('0x59'),_0x0a9e('0x5a'),_0x0a9e('0x5b')]});}})['then'](function(_0x1b0b98){if(_0x1b0b98){return{'count':_0x1b0b98[_0x0a9e('0x1b')],'rows':_[_0x0a9e('0x3a')](_0x1b0b98['rows'],function(_0x1148a1){return{'membername':_0x1148a1[_0x0a9e('0x28')],'UserId':_0x1148a1['id'],'queue_name':_0x65432['name'],'MailQueueId':_0x65432['id'],'interface':util[_0x0a9e('0x5c')](_0x0a9e('0x5d'),_0x0a9e('0x5e'),_0x1148a1[_0x0a9e('0x28')]),'penalty':0x0,'paused':_0x1148a1[_0x0a9e('0x59')],'createdAt':_0x1148a1['createdAt'],'updatedAt':_0x1148a1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5df0ad,_0x47de4c))[_0x0a9e('0x42')](handleError(_0x5df0ad,null));};exports[_0x0a9e('0x5f')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x1104ad[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x23')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db['Team'][_0x0a9e('0x2b')]);_0xeef20[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x1104ad[_0x0a9e('0x2e')]);_0xeef20['filters']=_[_0x0a9e('0x2f')](_0xeef20[_0x0a9e('0x2c')],_0xeef20[_0x0a9e('0x2e')]);_0x380ab3[_0x0a9e('0x30')]=_['intersection'](_0xeef20[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x380ab3[_0x0a9e('0x30')]:_0xeef20[_0x0a9e('0x2c')];_0x380ab3[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x380ab3[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x1104ad[_0x0a9e('0x2e')],_0xeef20[_0x0a9e('0x36')]));if(_0x1104ad[_0x0a9e('0x2e')]['filter']){_0x380ab3[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x380ab3[_0x0a9e('0x39')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x30')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2e')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x3e')]);return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x380ab3[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x380ab3[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x1104ad[_0x0a9e('0x2e')]['offset']);}return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})[_0x0a9e('0x23')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x60')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){var _0x5b7940=[];var _0x163710;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0xf0db1[_0x0a9e('0x47')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x94dcf5){if(_0x94dcf5){for(var _0x5ac73d=0x0;_0x5ac73d<_0x94dcf5[_0x0a9e('0x32')];_0x5ac73d+=0x1){for(var _0x36e975=0x0;_0x36e975<_0x94dcf5[_0x5ac73d]['Agents']['length'];_0x36e975+=0x1){_0x5b7940=_[_0x0a9e('0x63')](_0x5b7940,[_0x94dcf5[_0x5ac73d]['Agents'][_0x36e975]['id']]);}}return _0x5b7940;}})['then'](function(_0x4dc6b3){if(_0x4dc6b3){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0xf0db1[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3c6dd6){if(_0x3c6dd6){_0x163710=_0x3c6dd6;return _0x163710[_0x0a9e('0x64')](_0x5b7940,{'penalty':_0xf0db1['body'][_0x0a9e('0x65')]});}})['then'](function(_0x2871c1){if(_0x2871c1){return _0x163710[_0x0a9e('0x60')](_0xf0db1[_0x0a9e('0x47')][_0x0a9e('0x66')]);}})['then'](handleEntityNotFound(_0x4bf3a5,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x4bf3a5,null))[_0x0a9e('0x42')](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x67')]=function(_0x5b74c3,_0xb6e411,_0x21e592){var _0x2a563d=[];var _0x22063c;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x589ff3){if(_0x589ff3){for(var _0x40e0f0=0x0;_0x40e0f0<_0x589ff3[_0x0a9e('0x32')];_0x40e0f0+=0x1){for(var _0x3a1974=0x0;_0x3a1974<_0x589ff3[_0x40e0f0]['Agents'][_0x0a9e('0x32')];_0x3a1974+=0x1){_0x2a563d=_['union'](_0x2a563d,[_0x589ff3[_0x40e0f0][_0x0a9e('0x62')][_0x3a1974]['id']]);}}return _0x2a563d;}})[_0x0a9e('0x23')](function(_0x558a87){if(_0x558a87){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x5b74c3[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3a9a85){if(_0x3a9a85){_0x22063c=_0x3a9a85;return _0x22063c['removeAgents'](_0x2a563d);}})[_0x0a9e('0x23')](function(_0x31d25a){if(_0x22063c){return _0x22063c[_0x0a9e('0x67')](_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]);}})[_0x0a9e('0x23')](handleEntityNotFound(_0xb6e411,null))[_0x0a9e('0x23')](respondWithStatusCode(_0xb6e411,null))[_0x0a9e('0x42')](handleError(_0xb6e411,null));};exports[_0x0a9e('0x64')]=function(_0x31af8c,_0x151956,_0x3754e2){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x31af8c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x151956,null))[_0x0a9e('0x23')](function(_0x2ed526){if(_0x2ed526){return _0x2ed526[_0x0a9e('0x64')](_0x31af8c['body'][_0x0a9e('0x66')],_[_0x0a9e('0x68')](_0x31af8c['body'],[_0x0a9e('0x66'),'id'])||{})['spread'](function(_0x45d113){for(var _0x27041d=0x0;_0x27041d<_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')]['length'];_0x27041d+=0x1){socket[_0x0a9e('0x69')]('userMailQueue:save',{'UserId':_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')][_0x27041d],'MailQueueId':_0x31af8c['params']['id']});}return _0x45d113;});}})[_0x0a9e('0x23')](respondWithResult(_0x151956,null))[_0x0a9e('0x42')](handleError(_0x151956,null));};exports[_0x0a9e('0x6a')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4ab276[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4c788f,null))[_0x0a9e('0x23')](function(_0x3c75b9){if(_0x3c75b9){return _0x3c75b9[_0x0a9e('0x6a')](_0x4ab276['query'][_0x0a9e('0x66')])['then'](function(_0x287324){if(_[_0x0a9e('0x6b')](_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')])){for(var _0x1b61d5=0x0;_0x1b61d5<_0x4ab276['query'][_0x0a9e('0x66')][_0x0a9e('0x32')];_0x1b61d5+=0x1){socket[_0x0a9e('0x69')](_0x0a9e('0x6c'),{'UserId':_0x4ab276[_0x0a9e('0x2e')]['ids'][_0x1b61d5],'MailQueueId':_0x4ab276['params']['id']});}}else{socket[_0x0a9e('0x69')]('userMailQueue:remove',{'UserId':_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')],'MailQueueId':_0x4ab276[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x4c788f,null))[_0x0a9e('0x42')](handleError(_0x4c788f,null));};exports[_0x0a9e('0x6d')]=function(_0x596312,_0x4db918,_0x1889ed){var _0x5dfbe2={};var _0x2469d1={};var _0x5c689c;var _0x427ccc;return db['MailQueue']['findOne']({'where':{'id':_0x596312[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4db918,null))['then'](function(_0x170af6){if(_0x170af6){_0x5c689c=_0x170af6;_0x2469d1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x55')][_0x0a9e('0x2b')]);_0x2469d1['query']=_['keys'](_0x596312[_0x0a9e('0x2e')]);_0x2469d1[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],_0x2469d1[_0x0a9e('0x2e')]);_0x5dfbe2['attributes']=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],qs['fields'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5dfbe2[_0x0a9e('0x30')]=_0x5dfbe2[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5dfbe2[_0x0a9e('0x30')]:_0x2469d1[_0x0a9e('0x2c')];_0x5dfbe2[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x596312[_0x0a9e('0x2e')]['sort']);_0x5dfbe2[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x596312[_0x0a9e('0x2e')],_0x2469d1[_0x0a9e('0x36')]));if(_0x596312['query']['filter']){_0x5dfbe2[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x5dfbe2[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x5dfbe2[_0x0a9e('0x30')],function(_0x59e46f){var _0x1339d0={};_0x1339d0[_0x59e46f]={'$like':'%'+_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x1339d0;})});}_0x5dfbe2=_['merge']({},_0x5dfbe2,_0x596312[_0x0a9e('0x3e')]);return _0x5c689c['getAgents'](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x4799d4){if(_0x4799d4){_0x427ccc=_0x4799d4[_0x0a9e('0x32')];if(!_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x5dfbe2[_0x0a9e('0x1d')]=qs['limit'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5dfbe2[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x5c689c[_0x0a9e('0x6d')](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x2aaf07){if(_0x2aaf07){return _0x2aaf07?{'count':_0x427ccc,'rows':_0x2aaf07}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x4db918,null))[_0x0a9e('0x42')](handleError(_0x4db918,null));}; \ No newline at end of file +var _0xa9e0=['stack','name','index','MailQueue','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserMailQueue','pick','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','Agents','union','addAgents','penalty','ids','removeTeams','omit','emit','removeAgents','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error'];(function(_0x422a85,_0x3d047a){var _0x1be50f=function(_0x5938b0){while(--_0x5938b0){_0x422a85['push'](_0x422a85['shift']());}};_0x1be50f(++_0x3d047a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./mailQueue.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='MailQueues';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':!![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['MailQueue'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['MailQueue'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931){return db['MailQueue'][_0x0a9e('0x4f')]()['then'](respondWithResult(_0x145931,null))[_0x0a9e('0x42')](handleError(_0x145931,null));};exports['getMembers']=function(_0x5da27d,_0x5df0ad,_0x2da03c){var _0x47de4c={'raw':!![],'where':{}},_0x2f7092={},_0x65432;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x5da27d[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5df0ad,null))[_0x0a9e('0x23')](function(_0x28d814){if(_0x28d814){_0x65432=_0x28d814['get']({'plain':!![]});_0x2f7092[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x51')][_0x0a9e('0x2b')]);_0x2f7092[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5da27d['query']);_0x2f7092[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2f7092['model'],_0x2f7092[_0x0a9e('0x2e')]);_0x47de4c['attributes']=_[_0x0a9e('0x2f')](_0x2f7092['model'],qs['fields'](_0x5da27d['query'][_0x0a9e('0x31')]));_0x47de4c['attributes']=_0x47de4c[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x47de4c[_0x0a9e('0x30')]:_0x2f7092[_0x0a9e('0x2c')];if(!_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x47de4c[_0x0a9e('0x1d')]=qs['limit'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x47de4c[_0x0a9e('0x1c')]=qs['offset'](_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}_0x47de4c[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x5da27d['query'][_0x0a9e('0x35')]);_0x47de4c[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x52')](_0x5da27d[_0x0a9e('0x2e')],_0x2f7092[_0x0a9e('0x36')]));_0x47de4c[_0x0a9e('0x39')][_0x0a9e('0x53')]=_0x28d814['id'];if(_0x5da27d['query'][_0x0a9e('0x37')]){_0x47de4c[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x47de4c['where'],{'$or':_[_0x0a9e('0x3a')](_0x47de4c['attributes'],function(_0x5211e3){var _0x242745={};_0x242745[_0x5211e3]={'$like':'%'+_0x5da27d[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x242745;})});}_0x47de4c=_[_0x0a9e('0x38')]({},_0x47de4c,_0x5da27d[_0x0a9e('0x3e')]);return db[_0x0a9e('0x51')][_0x0a9e('0x54')](_0x47de4c);}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){return db[_0x0a9e('0x55')][_0x0a9e('0x56')]({'where':{'id':_[_0x0a9e('0x3a')](_0x2d7205,_0x0a9e('0x57')),'role':_0x0a9e('0x58')},'attributes':['id',_0x0a9e('0x28'),_0x0a9e('0x59'),_0x0a9e('0x5a'),_0x0a9e('0x5b')]});}})['then'](function(_0x1b0b98){if(_0x1b0b98){return{'count':_0x1b0b98[_0x0a9e('0x1b')],'rows':_[_0x0a9e('0x3a')](_0x1b0b98['rows'],function(_0x1148a1){return{'membername':_0x1148a1[_0x0a9e('0x28')],'UserId':_0x1148a1['id'],'queue_name':_0x65432['name'],'MailQueueId':_0x65432['id'],'interface':util[_0x0a9e('0x5c')](_0x0a9e('0x5d'),_0x0a9e('0x5e'),_0x1148a1[_0x0a9e('0x28')]),'penalty':0x0,'paused':_0x1148a1[_0x0a9e('0x59')],'createdAt':_0x1148a1['createdAt'],'updatedAt':_0x1148a1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5df0ad,_0x47de4c))[_0x0a9e('0x42')](handleError(_0x5df0ad,null));};exports[_0x0a9e('0x5f')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x2a')][_0x0a9e('0x50')]({'where':{'id':_0x1104ad[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x23')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db['Team'][_0x0a9e('0x2b')]);_0xeef20[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x1104ad[_0x0a9e('0x2e')]);_0xeef20['filters']=_[_0x0a9e('0x2f')](_0xeef20[_0x0a9e('0x2c')],_0xeef20[_0x0a9e('0x2e')]);_0x380ab3[_0x0a9e('0x30')]=_['intersection'](_0xeef20[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x380ab3[_0x0a9e('0x30')]:_0xeef20[_0x0a9e('0x2c')];_0x380ab3[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x380ab3[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x1104ad[_0x0a9e('0x2e')],_0xeef20[_0x0a9e('0x36')]));if(_0x1104ad[_0x0a9e('0x2e')]['filter']){_0x380ab3[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x380ab3[_0x0a9e('0x39')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x30')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2e')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x3e')]);return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x380ab3[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x1104ad[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x380ab3[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x1104ad[_0x0a9e('0x2e')]['offset']);}return _0x1a0677[_0x0a9e('0x5f')](_0x380ab3);}})[_0x0a9e('0x23')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x60')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){var _0x5b7940=[];var _0x163710;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0xf0db1[_0x0a9e('0x47')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x94dcf5){if(_0x94dcf5){for(var _0x5ac73d=0x0;_0x5ac73d<_0x94dcf5[_0x0a9e('0x32')];_0x5ac73d+=0x1){for(var _0x36e975=0x0;_0x36e975<_0x94dcf5[_0x5ac73d]['Agents']['length'];_0x36e975+=0x1){_0x5b7940=_[_0x0a9e('0x63')](_0x5b7940,[_0x94dcf5[_0x5ac73d]['Agents'][_0x36e975]['id']]);}}return _0x5b7940;}})['then'](function(_0x4dc6b3){if(_0x4dc6b3){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0xf0db1[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3c6dd6){if(_0x3c6dd6){_0x163710=_0x3c6dd6;return _0x163710[_0x0a9e('0x64')](_0x5b7940,{'penalty':_0xf0db1['body'][_0x0a9e('0x65')]});}})['then'](function(_0x2871c1){if(_0x2871c1){return _0x163710[_0x0a9e('0x60')](_0xf0db1[_0x0a9e('0x47')][_0x0a9e('0x66')]);}})['then'](handleEntityNotFound(_0x4bf3a5,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x4bf3a5,null))[_0x0a9e('0x42')](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x67')]=function(_0x5b74c3,_0xb6e411,_0x21e592){var _0x2a563d=[];var _0x22063c;return db[_0x0a9e('0x61')][_0x0a9e('0x54')]({'where':{'id':_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a9e('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0a9e('0x23')](function(_0x589ff3){if(_0x589ff3){for(var _0x40e0f0=0x0;_0x40e0f0<_0x589ff3[_0x0a9e('0x32')];_0x40e0f0+=0x1){for(var _0x3a1974=0x0;_0x3a1974<_0x589ff3[_0x40e0f0]['Agents'][_0x0a9e('0x32')];_0x3a1974+=0x1){_0x2a563d=_['union'](_0x2a563d,[_0x589ff3[_0x40e0f0][_0x0a9e('0x62')][_0x3a1974]['id']]);}}return _0x2a563d;}})[_0x0a9e('0x23')](function(_0x558a87){if(_0x558a87){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x5b74c3[_0x0a9e('0x44')]['id']}});}})[_0x0a9e('0x23')](function(_0x3a9a85){if(_0x3a9a85){_0x22063c=_0x3a9a85;return _0x22063c['removeAgents'](_0x2a563d);}})[_0x0a9e('0x23')](function(_0x31d25a){if(_0x22063c){return _0x22063c[_0x0a9e('0x67')](_0x5b74c3[_0x0a9e('0x2e')][_0x0a9e('0x66')]);}})[_0x0a9e('0x23')](handleEntityNotFound(_0xb6e411,null))[_0x0a9e('0x23')](respondWithStatusCode(_0xb6e411,null))[_0x0a9e('0x42')](handleError(_0xb6e411,null));};exports[_0x0a9e('0x64')]=function(_0x31af8c,_0x151956,_0x3754e2){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x31af8c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x151956,null))[_0x0a9e('0x23')](function(_0x2ed526){if(_0x2ed526){return _0x2ed526[_0x0a9e('0x64')](_0x31af8c['body'][_0x0a9e('0x66')],_[_0x0a9e('0x68')](_0x31af8c['body'],[_0x0a9e('0x66'),'id'])||{})['spread'](function(_0x45d113){for(var _0x27041d=0x0;_0x27041d<_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')]['length'];_0x27041d+=0x1){socket[_0x0a9e('0x69')]('userMailQueue:save',{'UserId':_0x31af8c[_0x0a9e('0x47')][_0x0a9e('0x66')][_0x27041d],'MailQueueId':_0x31af8c['params']['id']});}return _0x45d113;});}})[_0x0a9e('0x23')](respondWithResult(_0x151956,null))[_0x0a9e('0x42')](handleError(_0x151956,null));};exports[_0x0a9e('0x6a')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4ab276[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4c788f,null))[_0x0a9e('0x23')](function(_0x3c75b9){if(_0x3c75b9){return _0x3c75b9[_0x0a9e('0x6a')](_0x4ab276['query'][_0x0a9e('0x66')])['then'](function(_0x287324){if(_[_0x0a9e('0x6b')](_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')])){for(var _0x1b61d5=0x0;_0x1b61d5<_0x4ab276['query'][_0x0a9e('0x66')][_0x0a9e('0x32')];_0x1b61d5+=0x1){socket[_0x0a9e('0x69')](_0x0a9e('0x6c'),{'UserId':_0x4ab276[_0x0a9e('0x2e')]['ids'][_0x1b61d5],'MailQueueId':_0x4ab276['params']['id']});}}else{socket[_0x0a9e('0x69')]('userMailQueue:remove',{'UserId':_0x4ab276[_0x0a9e('0x2e')][_0x0a9e('0x66')],'MailQueueId':_0x4ab276[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x4c788f,null))[_0x0a9e('0x42')](handleError(_0x4c788f,null));};exports[_0x0a9e('0x6d')]=function(_0x596312,_0x4db918,_0x1889ed){var _0x5dfbe2={};var _0x2469d1={};var _0x5c689c;var _0x427ccc;return db['MailQueue']['findOne']({'where':{'id':_0x596312[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x4db918,null))['then'](function(_0x170af6){if(_0x170af6){_0x5c689c=_0x170af6;_0x2469d1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x55')][_0x0a9e('0x2b')]);_0x2469d1['query']=_['keys'](_0x596312[_0x0a9e('0x2e')]);_0x2469d1[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],_0x2469d1[_0x0a9e('0x2e')]);_0x5dfbe2['attributes']=_[_0x0a9e('0x2f')](_0x2469d1[_0x0a9e('0x2c')],qs['fields'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x5dfbe2[_0x0a9e('0x30')]=_0x5dfbe2[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x5dfbe2[_0x0a9e('0x30')]:_0x2469d1[_0x0a9e('0x2c')];_0x5dfbe2[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x596312[_0x0a9e('0x2e')]['sort']);_0x5dfbe2[_0x0a9e('0x39')]=qs[_0x0a9e('0x36')](_[_0x0a9e('0x52')](_0x596312[_0x0a9e('0x2e')],_0x2469d1[_0x0a9e('0x36')]));if(_0x596312['query']['filter']){_0x5dfbe2[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x5dfbe2[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x5dfbe2[_0x0a9e('0x30')],function(_0x59e46f){var _0x1339d0={};_0x1339d0[_0x59e46f]={'$like':'%'+_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x1339d0;})});}_0x5dfbe2=_['merge']({},_0x5dfbe2,_0x596312[_0x0a9e('0x3e')]);return _0x5c689c['getAgents'](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x4799d4){if(_0x4799d4){_0x427ccc=_0x4799d4[_0x0a9e('0x32')];if(!_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x5dfbe2[_0x0a9e('0x1d')]=qs['limit'](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x5dfbe2[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x596312[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x5c689c[_0x0a9e('0x6d')](_0x5dfbe2);}})[_0x0a9e('0x23')](function(_0x2aaf07){if(_0x2aaf07){return _0x2aaf07?{'count':_0x427ccc,'rows':_0x2aaf07}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x4db918,null))[_0x0a9e('0x42')](handleError(_0x4db918,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index ff2ab0e..387b14e 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 _0x7de1=['hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','save','update','remove','emit'];(function(_0x49f33d,_0x5010a1){var _0x443e73=function(_0x1832fb){while(--_0x1832fb){_0x49f33d['push'](_0x49f33d['shift']());}};_0x443e73(++_0x5010a1);}(_0x7de1,0x1c5));var _0x17de=function(_0x409fb8,_0x5ab3d3){_0x409fb8=_0x409fb8-0x0;var _0x278270=_0x7de1[_0x409fb8];return _0x278270;};'use strict';var EventEmitter=require(_0x17de('0x0'));var MailQueue=require(_0x17de('0x1'))['db'][_0x17de('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17de('0x3'),'afterUpdate':_0x17de('0x4'),'afterDestroy':_0x17de('0x5')};function emitEvent(_0xf27329){return function(_0x477147,_0x562bd1,_0x316e35){MailQueueEvents[_0x17de('0x6')](_0xf27329+':'+_0x477147['id'],_0x477147);MailQueueEvents['emit'](_0xf27329,_0x477147);_0x316e35(null);};}for(var e in events){if(events[_0x17de('0x7')](e)){var event=events[e];MailQueue[_0x17de('0x8')](e,emitEvent(event));}}module[_0x17de('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x0c87=['update','remove','emit','hasOwnProperty','hook','events','MailQueue','save'];(function(_0x271cbe,_0x45fb38){var _0x1ee427=function(_0x5f18b0){while(--_0x5f18b0){_0x271cbe['push'](_0x271cbe['shift']());}};_0x1ee427(++_0x45fb38);}(_0x0c87,0x115));var _0x70c8=function(_0x1fd0d6,_0x1be60f){_0x1fd0d6=_0x1fd0d6-0x0;var _0x28afa7=_0x0c87[_0x1fd0d6];return _0x28afa7;};'use strict';var EventEmitter=require(_0x70c8('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x70c8('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x70c8('0x2'),'afterUpdate':_0x70c8('0x3'),'afterDestroy':_0x70c8('0x4')};function emitEvent(_0xe8e52e){return function(_0x4aec09,_0x4ae5d3,_0x36f336){MailQueueEvents[_0x70c8('0x5')](_0xe8e52e+':'+_0x4aec09['id'],_0x4aec09);MailQueueEvents[_0x70c8('0x5')](_0xe8e52e,_0x4aec09);_0x36f336(null);};}for(var e in events){if(events[_0x70c8('0x6')](e)){var event=events[e];MailQueue[_0x70c8('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 8653320..7cff769 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 _0x6a4c=['bluebird','define','MailQueue','mail_queues','lodash','util','../../config/logger','moment'];(function(_0x2fcd90,_0x4780cc){var _0x55b596=function(_0xe475f6){while(--_0xe475f6){_0x2fcd90['push'](_0x2fcd90['shift']());}};_0x55b596(++_0x4780cc);}(_0x6a4c,0x17c));var _0xc6a4=function(_0x463779,_0x4cfd61){_0x463779=_0x463779-0x0;var _0x681942=_0x6a4c[_0x463779];return _0x681942;};'use strict';var _=require(_0xc6a4('0x0'));var util=require(_0xc6a4('0x1'));var logger=require(_0xc6a4('0x2'))('api');var moment=require(_0xc6a4('0x3'));var BPromise=require(_0xc6a4('0x4'));var rp=require('request-promise');var attributes=require('./mailQueue.attributes');module['exports']=function(_0x52b3d1,_0xb1ede5){return _0x52b3d1[_0xc6a4('0x5')](_0xc6a4('0x6'),attributes,{'tableName':_0xc6a4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9772=['./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x9772,0x102));var _0x2977=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x9772[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x2977('0x0'));var util=require(_0x2977('0x1'));var logger=require(_0x2977('0x2'))(_0x2977('0x3'));var moment=require(_0x2977('0x4'));var BPromise=require(_0x2977('0x5'));var rp=require('request-promise');var attributes=require(_0x2977('0x6'));module[_0x2977('0x7')]=function(_0x5f5884,_0x4caeab){return _0x5f5884[_0x2977('0x8')](_0x2977('0x9'),attributes,{'tableName':_0x2977('0xa'),'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 bb31210..6e434ba 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 _0x42b8=['then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','info','result','message','catch','GetMailQueue','findAll','options','limit','include','map','model','attributes','ShowMailQueue','MailQueue','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request'];(function(_0x424d84,_0x1ae7b3){var _0x470900=function(_0x5c5eb8){while(--_0x5c5eb8){_0x424d84['push'](_0x424d84['shift']());}};_0x470900(++_0x1ae7b3);}(_0x42b8,0x1d0));var _0x842b=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x42b8[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x842b('0x0'));var util=require(_0x842b('0x1'));var moment=require(_0x842b('0x2'));var BPromise=require(_0x842b('0x3'));var rs=require(_0x842b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x842b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x842b('0x6'))(_0x842b('0x7'));var config=require(_0x842b('0x8'));var jayson=require(_0x842b('0x9'));var client=jayson[_0x842b('0xa')]['http']({'port':0x232a});config[_0x842b('0xb')]=_[_0x842b('0xc')](config[_0x842b('0xb')],{'host':_0x842b('0xd'),'port':0x18eb});var socket=require(_0x842b('0xe'))(new Redis(config[_0x842b('0xb')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x17b506,_0x575d40,_0x3708c8){return new BPromise(function(_0x3b108e,_0x352367){return client[_0x842b('0xf')](_0x17b506,_0x3708c8)[_0x842b('0x10')](function(_0x19e7ef){logger['info'](_0x842b('0x11'),_0x575d40,_0x842b('0x12'));logger[_0x842b('0x13')](_0x842b('0x14'),_0x575d40,_0x842b('0x12'),JSON[_0x842b('0x15')](_0x19e7ef));if(_0x19e7ef['error']){if(_0x19e7ef[_0x842b('0x16')][_0x842b('0x17')]===0x1f4){logger['error'](_0x842b('0x11'),_0x575d40,_0x19e7ef['error']['message']);return _0x352367(_0x19e7ef[_0x842b('0x16')]['message']);}logger['error'](_0x842b('0x11'),_0x575d40,_0x19e7ef[_0x842b('0x16')]['message']);return _0x3b108e(_0x19e7ef[_0x842b('0x16')]['message']);}else{logger[_0x842b('0x18')](_0x842b('0x11'),_0x575d40,'request\x20sent');_0x3b108e(_0x19e7ef[_0x842b('0x19')][_0x842b('0x1a')]);}})[_0x842b('0x1b')](function(_0x172380){logger[_0x842b('0x16')]('MailQueue,\x20%s,\x20%s',_0x575d40,_0x172380);_0x352367(_0x172380);});});}exports[_0x842b('0x1c')]=function(_0x2a7577){var _0x1ae00f=this;return new Promise(function(_0x27823d,_0x50d6b3){return db['MailQueue'][_0x842b('0x1d')]({'raw':_0x2a7577[_0x842b('0x1e')]?_0x2a7577[_0x842b('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2a7577[_0x842b('0x1e')]?_0x2a7577[_0x842b('0x1e')]['where']||null:null,'attributes':_0x2a7577[_0x842b('0x1e')]?_0x2a7577['options']['attributes']||null:null,'limit':_0x2a7577['options']?_0x2a7577[_0x842b('0x1e')][_0x842b('0x1f')]||null:null,'include':_0x2a7577['options']?_0x2a7577[_0x842b('0x1e')][_0x842b('0x20')]?_[_0x842b('0x21')](_0x2a7577['options'][_0x842b('0x20')],function(_0x270041){return{'model':db[_0x270041['model']],'as':_0x270041['as'],'attributes':_0x270041['attributes'],'include':_0x270041['include']?_[_0x842b('0x21')](_0x270041['include'],function(_0x2d9c89){return{'model':db[_0x2d9c89[_0x842b('0x22')]],'as':_0x2d9c89['as'],'attributes':_0x2d9c89[_0x842b('0x23')],'include':_0x2d9c89[_0x842b('0x20')]?_[_0x842b('0x21')](_0x2d9c89[_0x842b('0x20')],function(_0x7d0a4f){return{'model':db[_0x7d0a4f['model']],'as':_0x7d0a4f['as'],'attributes':_0x7d0a4f[_0x842b('0x23')]};}):[]};}):[]};}):[]:[]})[_0x842b('0x10')](function(_0x3e46b3){logger[_0x842b('0x18')](_0x842b('0x1c'),_0x2a7577);logger['debug'](_0x842b('0x1c'),_0x2a7577,JSON['stringify'](_0x3e46b3));_0x27823d(_0x3e46b3);})['catch'](function(_0x4b16fd){logger['error']('GetMailQueue',_0x4b16fd[_0x842b('0x1a')],_0x2a7577);_0x50d6b3(_0x1ae00f[_0x842b('0x16')](0x1f4,_0x4b16fd[_0x842b('0x1a')]));});});};exports[_0x842b('0x24')]=function(_0x19fc66){var _0x2a70a8=this;return new Promise(function(_0x52547c,_0x42a4e4){return db[_0x842b('0x25')][_0x842b('0x26')]({'raw':_0x19fc66[_0x842b('0x1e')]?_0x19fc66[_0x842b('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x19fc66[_0x842b('0x1e')]?_0x19fc66[_0x842b('0x1e')][_0x842b('0x27')]||null:null,'attributes':_0x19fc66[_0x842b('0x1e')]?_0x19fc66[_0x842b('0x1e')][_0x842b('0x23')]||null:null,'include':_0x19fc66[_0x842b('0x1e')]?_0x19fc66[_0x842b('0x1e')][_0x842b('0x20')]?_[_0x842b('0x21')](_0x19fc66['options']['include'],function(_0x508d26){return{'model':db[_0x508d26[_0x842b('0x22')]],'as':_0x508d26['as'],'attributes':_0x508d26[_0x842b('0x23')],'include':_0x508d26[_0x842b('0x20')]?_['map'](_0x508d26[_0x842b('0x20')],function(_0x253723){return{'model':db[_0x253723[_0x842b('0x22')]],'as':_0x253723['as'],'attributes':_0x253723[_0x842b('0x23')],'include':_0x253723['include']?_[_0x842b('0x21')](_0x253723[_0x842b('0x20')],function(_0x4d5630){return{'model':db[_0x4d5630[_0x842b('0x22')]],'as':_0x4d5630['as'],'attributes':_0x4d5630[_0x842b('0x23')]};}):[]};}):[]};}):[]:[]})[_0x842b('0x10')](function(_0x3c84a3){logger['info'](_0x842b('0x24'),_0x19fc66);logger[_0x842b('0x13')]('ShowMailQueue',_0x19fc66,JSON['stringify'](_0x3c84a3));_0x52547c(_0x3c84a3);})[_0x842b('0x1b')](function(_0x56d97f){logger[_0x842b('0x16')]('ShowMailQueue',_0x56d97f[_0x842b('0x1a')],_0x19fc66);_0x42a4e4(_0x2a70a8[_0x842b('0x16')](0x1f4,_0x56d97f[_0x842b('0x1a')]));});});}; \ No newline at end of file +var _0x21cd=['code','message','result','GetMailQueue','findAll','options','where','attributes','limit','map','include','model','debug','catch','ShowMailQueue','MailQueue','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xf89c3,_0x351bf1){var _0x274fc8=function(_0x5e0c91){while(--_0x5e0c91){_0xf89c3['push'](_0xf89c3['shift']());}};_0x274fc8(++_0x351bf1);}(_0x21cd,0x11b));var _0xd21c=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x21cd[_0x176329];return _0x31997c;};'use strict';var _=require(_0xd21c('0x0'));var util=require('util');var moment=require(_0xd21c('0x1'));var BPromise=require(_0xd21c('0x2'));var rs=require(_0xd21c('0x3'));var fs=require('fs');var Redis=require(_0xd21c('0x4'));var db=require(_0xd21c('0x5'))['db'];var utils=require(_0xd21c('0x6'));var logger=require('../../config/logger')(_0xd21c('0x7'));var config=require(_0xd21c('0x8'));var jayson=require(_0xd21c('0x9'));var client=jayson[_0xd21c('0xa')]['http']({'port':0x232a});config[_0xd21c('0xb')]=_['defaults'](config[_0xd21c('0xb')],{'host':_0xd21c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd21c('0xb')]));require(_0xd21c('0xd'))[_0xd21c('0xe')](socket);function respondWithRpcPromise(_0x45b279,_0x27c03f,_0x53d1e5){return new BPromise(function(_0x2c1b21,_0x2cd2b6){return client['request'](_0x45b279,_0x53d1e5)[_0xd21c('0xf')](function(_0x1cbff1){logger[_0xd21c('0x10')](_0xd21c('0x11'),_0x27c03f,'request\x20sent');logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x27c03f,_0xd21c('0x12'),JSON[_0xd21c('0x13')](_0x1cbff1));if(_0x1cbff1[_0xd21c('0x14')]){if(_0x1cbff1['error'][_0xd21c('0x15')]===0x1f4){logger['error'](_0xd21c('0x11'),_0x27c03f,_0x1cbff1[_0xd21c('0x14')][_0xd21c('0x16')]);return _0x2cd2b6(_0x1cbff1[_0xd21c('0x14')]['message']);}logger[_0xd21c('0x14')](_0xd21c('0x11'),_0x27c03f,_0x1cbff1[_0xd21c('0x14')][_0xd21c('0x16')]);return _0x2c1b21(_0x1cbff1[_0xd21c('0x14')][_0xd21c('0x16')]);}else{logger[_0xd21c('0x10')](_0xd21c('0x11'),_0x27c03f,_0xd21c('0x12'));_0x2c1b21(_0x1cbff1[_0xd21c('0x17')][_0xd21c('0x16')]);}})['catch'](function(_0x503fe3){logger[_0xd21c('0x14')]('MailQueue,\x20%s,\x20%s',_0x27c03f,_0x503fe3);_0x2cd2b6(_0x503fe3);});});}exports[_0xd21c('0x18')]=function(_0x4526ad){var _0x1c25f0=this;return new Promise(function(_0x11175e,_0x588d3d){return db['MailQueue'][_0xd21c('0x19')]({'raw':_0x4526ad[_0xd21c('0x1a')]?_0x4526ad['options']['raw']===undefined?!![]:![]:!![],'where':_0x4526ad[_0xd21c('0x1a')]?_0x4526ad[_0xd21c('0x1a')][_0xd21c('0x1b')]||null:null,'attributes':_0x4526ad[_0xd21c('0x1a')]?_0x4526ad[_0xd21c('0x1a')][_0xd21c('0x1c')]||null:null,'limit':_0x4526ad[_0xd21c('0x1a')]?_0x4526ad[_0xd21c('0x1a')][_0xd21c('0x1d')]||null:null,'include':_0x4526ad['options']?_0x4526ad[_0xd21c('0x1a')]['include']?_[_0xd21c('0x1e')](_0x4526ad[_0xd21c('0x1a')][_0xd21c('0x1f')],function(_0x11f103){return{'model':db[_0x11f103['model']],'as':_0x11f103['as'],'attributes':_0x11f103[_0xd21c('0x1c')],'include':_0x11f103['include']?_['map'](_0x11f103[_0xd21c('0x1f')],function(_0x47fe19){return{'model':db[_0x47fe19[_0xd21c('0x20')]],'as':_0x47fe19['as'],'attributes':_0x47fe19[_0xd21c('0x1c')],'include':_0x47fe19['include']?_['map'](_0x47fe19[_0xd21c('0x1f')],function(_0x45b704){return{'model':db[_0x45b704[_0xd21c('0x20')]],'as':_0x45b704['as'],'attributes':_0x45b704[_0xd21c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd21c('0xf')](function(_0x1e1e02){logger[_0xd21c('0x10')]('GetMailQueue',_0x4526ad);logger[_0xd21c('0x21')]('GetMailQueue',_0x4526ad,JSON[_0xd21c('0x13')](_0x1e1e02));_0x11175e(_0x1e1e02);})[_0xd21c('0x22')](function(_0x415162){logger['error'](_0xd21c('0x18'),_0x415162[_0xd21c('0x16')],_0x4526ad);_0x588d3d(_0x1c25f0['error'](0x1f4,_0x415162['message']));});});};exports[_0xd21c('0x23')]=function(_0x6de70f){var _0x56a927=this;return new Promise(function(_0x2bd8d2,_0x355fb6){return db[_0xd21c('0x24')]['find']({'raw':_0x6de70f[_0xd21c('0x1a')]?_0x6de70f['options'][_0xd21c('0x25')]===undefined?!![]:![]:!![],'where':_0x6de70f['options']?_0x6de70f['options'][_0xd21c('0x1b')]||null:null,'attributes':_0x6de70f[_0xd21c('0x1a')]?_0x6de70f[_0xd21c('0x1a')][_0xd21c('0x1c')]||null:null,'include':_0x6de70f['options']?_0x6de70f[_0xd21c('0x1a')]['include']?_[_0xd21c('0x1e')](_0x6de70f[_0xd21c('0x1a')]['include'],function(_0x478795){return{'model':db[_0x478795[_0xd21c('0x20')]],'as':_0x478795['as'],'attributes':_0x478795[_0xd21c('0x1c')],'include':_0x478795[_0xd21c('0x1f')]?_[_0xd21c('0x1e')](_0x478795[_0xd21c('0x1f')],function(_0x2c2afe){return{'model':db[_0x2c2afe[_0xd21c('0x20')]],'as':_0x2c2afe['as'],'attributes':_0x2c2afe['attributes'],'include':_0x2c2afe[_0xd21c('0x1f')]?_['map'](_0x2c2afe[_0xd21c('0x1f')],function(_0x565f59){return{'model':db[_0x565f59[_0xd21c('0x20')]],'as':_0x565f59['as'],'attributes':_0x565f59['attributes']};}):[]};}):[]};}):[]:[]})[_0xd21c('0xf')](function(_0x5cb937){logger[_0xd21c('0x10')](_0xd21c('0x23'),_0x6de70f);logger[_0xd21c('0x21')](_0xd21c('0x23'),_0x6de70f,JSON[_0xd21c('0x13')](_0x5cb937));_0x2bd8d2(_0x5cb937);})[_0xd21c('0x22')](function(_0x38653f){logger[_0xd21c('0x14')](_0xd21c('0x23'),_0x38653f[_0xd21c('0x16')],_0x6de70f);_0x355fb6(_0x56a927[_0xd21c('0x14')](0x1f4,_0x38653f[_0xd21c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index ff8a8c2..50a9383 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 _0xdf78=['register','length','mailQueue:','./mailQueue.events','remove','update','emit'];(function(_0x556d13,_0xc7e4d6){var _0x410b54=function(_0x761b0e){while(--_0x761b0e){_0x556d13['push'](_0x556d13['shift']());}};_0x410b54(++_0xc7e4d6);}(_0xdf78,0x129));var _0x8df7=function(_0x3c47cb,_0x1dfee0){_0x3c47cb=_0x3c47cb-0x0;var _0x3afc6c=_0xdf78[_0x3c47cb];return _0x3afc6c;};'use strict';var MailQueueEvents=require(_0x8df7('0x0'));var events=['save',_0x8df7('0x1'),_0x8df7('0x2')];function createListener(_0x19c864,_0x533cd6){return function(_0x401ab4){_0x533cd6[_0x8df7('0x3')](_0x19c864,_0x401ab4);};}function removeListener(_0x2c9fa7,_0x3badb0){return function(){MailQueueEvents['removeListener'](_0x2c9fa7,_0x3badb0);};}exports[_0x8df7('0x4')]=function(_0x71e4e2){for(var _0x23f6c9=0x0,_0x127af2=events[_0x8df7('0x5')];_0x23f6c9<_0x127af2;_0x23f6c9++){var _0x478dd5=events[_0x23f6c9];var _0x37774d=createListener(_0x8df7('0x6')+_0x478dd5,_0x71e4e2);MailQueueEvents['on'](_0x478dd5,_0x37774d);}}; \ No newline at end of file +var _0x9328=['length','mailQueue:','./mailQueue.events','save','remove','update','removeListener','register'];(function(_0x1c7386,_0x298a93){var _0x2b6b71=function(_0x3dfaf0){while(--_0x3dfaf0){_0x1c7386['push'](_0x1c7386['shift']());}};_0x2b6b71(++_0x298a93);}(_0x9328,0x1d2));var _0x8932=function(_0x3b40e6,_0x1c7054){_0x3b40e6=_0x3b40e6-0x0;var _0x2dda36=_0x9328[_0x3b40e6];return _0x2dda36;};'use strict';var MailQueueEvents=require(_0x8932('0x0'));var events=[_0x8932('0x1'),_0x8932('0x2'),_0x8932('0x3')];function createListener(_0x1393de,_0x186d3c){return function(_0x5de48d){_0x186d3c['emit'](_0x1393de,_0x5de48d);};}function removeListener(_0x2edb84,_0x3c3652){return function(){MailQueueEvents[_0x8932('0x4')](_0x2edb84,_0x3c3652);};}exports[_0x8932('0x5')]=function(_0x4af234){for(var _0x2cd1d5=0x0,_0x37a6dd=events[_0x8932('0x6')];_0x2cd1d5<_0x37a6dd;_0x2cd1d5++){var _0x15fb96=events[_0x2cd1d5];var _0x58c4d4=createListener(_0x8932('0x7')+_0x15fb96,_0x4af234);MailQueueEvents['on'](_0x15fb96,_0x58c4d4);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 4e2128e..c1b2338 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 _0x53b8=['get','/describe','describe','show','post','create','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x53b8,0x1be));var _0x853b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53b8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x853b('0x0'));var util=require(_0x853b('0x1'));var path=require('path');var timeout=require(_0x853b('0x2'));var express=require(_0x853b('0x3'));var router=express[_0x853b('0x4')]();var auth=require(_0x853b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x853b('0x6'));var controller=require(_0x853b('0x7'));router['get']('/',auth[_0x853b('0x8')](),controller[_0x853b('0x9')]);router[_0x853b('0xa')](_0x853b('0xb'),auth[_0x853b('0x8')](),controller[_0x853b('0xc')]);router[_0x853b('0xa')]('/:id',auth[_0x853b('0x8')](),controller[_0x853b('0xd')]);router[_0x853b('0xe')]('/',auth['isAuthenticated'](),controller[_0x853b('0xf')]);router['put']('/:id',auth[_0x853b('0x8')](),controller[_0x853b('0x10')]);router[_0x853b('0x11')]('/:id',auth[_0x853b('0x8')](),controller['destroy']);module[_0x853b('0x12')]=router; \ No newline at end of file +var _0x3ce6=['describe','/:id','show','post','update','delete','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index','isAuthenticated'];(function(_0x184013,_0x572c35){var _0x3762be=function(_0x21246e){while(--_0x21246e){_0x184013['push'](_0x184013['shift']());}};_0x3762be(++_0x572c35);}(_0x3ce6,0x1d6));var _0x63ce=function(_0x2abb6a,_0x52ce5f){_0x2abb6a=_0x2abb6a-0x0;var _0x5ef175=_0x3ce6[_0x2abb6a];return _0x5ef175;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x63ce('0x0'));var timeout=require(_0x63ce('0x1'));var express=require(_0x63ce('0x2'));var router=express[_0x63ce('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x63ce('0x4'));var config=require(_0x63ce('0x5'));var controller=require(_0x63ce('0x6'));router[_0x63ce('0x7')]('/',auth['isAuthenticated'](),controller[_0x63ce('0x8')]);router[_0x63ce('0x7')]('/describe',auth[_0x63ce('0x9')](),controller[_0x63ce('0xa')]);router[_0x63ce('0x7')](_0x63ce('0xb'),auth[_0x63ce('0x9')](),controller[_0x63ce('0xc')]);router[_0x63ce('0xd')]('/',auth[_0x63ce('0x9')](),controller['create']);router['put'](_0x63ce('0xb'),auth[_0x63ce('0x9')](),controller[_0x63ce('0xe')]);router[_0x63ce('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 80802ae..04ae01a 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 _0x21c2=['STRING','DATE','exports'];(function(_0x5d72a9,_0x565074){var _0x10c1c5=function(_0x14f629){while(--_0x14f629){_0x5d72a9['push'](_0x5d72a9['shift']());}};_0x10c1c5(++_0x565074);}(_0x21c2,0x1a9));var _0x221c=function(_0x6a141d,_0x91cc18){_0x6a141d=_0x6a141d-0x0;var _0x372205=_0x21c2[_0x6a141d];return _0x372205;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x221c('0x0')]={'uniqueid':{'type':Sequelize[_0x221c('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x221c('0x2')]},'leaveAt':{'type':Sequelize[_0x221c('0x2')]},'acceptAt':{'type':Sequelize[_0x221c('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x221c('0x1')]}}; \ No newline at end of file +var _0x22c9=['sequelize','STRING','DATE'];(function(_0x21409b,_0x125417){var _0x3933c2=function(_0x4a34b1){while(--_0x4a34b1){_0x21409b['push'](_0x21409b['shift']());}};_0x3933c2(++_0x125417);}(_0x22c9,0x1b0));var _0x922c=function(_0x499a43,_0x3cbee7){_0x499a43=_0x499a43-0x0;var _0x4e607e=_0x22c9[_0x499a43];return _0x4e607e;};'use strict';var moment=require('moment');var Sequelize=require(_0x922c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x922c('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x922c('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x922c('0x2')]},'exitAt':{'type':Sequelize[_0x922c('0x2')]},'reason':{'type':Sequelize[_0x922c('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 8899260..30ecc04 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 _0xa568=['sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','count','includeAll','findAll','rows','catch','show','MailQueueReport','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path'];(function(_0x5d7290,_0xe9e211){var _0x1383fe=function(_0x2cfbbd){while(--_0x2cfbbd){_0x5d7290['push'](_0x5d7290['shift']());}};_0x1383fe(++_0xe9e211);}(_0xa568,0x1a8));var _0x8a56=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xa568[_0x1cc8fe];return _0x230054;};'use strict';var pdf=require(_0x8a56('0x0'));var emlformat=require(_0x8a56('0x1'));var rimraf=require(_0x8a56('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8a56('0x3'));var moment=require(_0x8a56('0x4'));var BPromise=require(_0x8a56('0x5'));var Mustache=require('mustache');var util=require(_0x8a56('0x6'));var path=require(_0x8a56('0x7'));var sox=require(_0x8a56('0x8'));var csv=require(_0x8a56('0x9'));var ejs=require(_0x8a56('0xa'));var fs=require('fs');var _=require(_0x8a56('0xb'));var squel=require(_0x8a56('0xc'));var crypto=require('crypto');var jsforce=require(_0x8a56('0xd'));var deskjs=require(_0x8a56('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8a56('0xf'));var Papa=require('papaparse');var authService=require(_0x8a56('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x8a56('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x8a56('0x12'));var db=require(_0x8a56('0x13'))['db'];function respondWithStatusCode(_0x2b397b,_0x3ec341){_0x3ec341=_0x3ec341||0xcc;return function(_0x3b2a22){if(_0x3b2a22){return _0x2b397b[_0x8a56('0x14')](_0x3ec341);}return _0x2b397b[_0x8a56('0x15')](_0x3ec341)['end']();};}function respondWithResult(_0x494f37,_0x4fc8e0){_0x4fc8e0=_0x4fc8e0||0xc8;return function(_0x3756cb){if(_0x3756cb){return _0x494f37['status'](_0x4fc8e0)[_0x8a56('0x16')](_0x3756cb);}};}function respondWithFilteredResult(_0x23e86a,_0x3360bc){return function(_0x2dd3eb){if(_0x2dd3eb){var _0x324aba=_0x2dd3eb['count'],_0x213115=_0x3360bc[_0x8a56('0x17')],_0x11b5ba=_0x3360bc[_0x8a56('0x17')]+_0x3360bc[_0x8a56('0x18')],_0x1cf729;if(_0x11b5ba>=_0x324aba){_0x11b5ba=_0x324aba;_0x1cf729=0xc8;}else{_0x1cf729=0xce;}_0x23e86a[_0x8a56('0x15')](_0x1cf729);return _0x23e86a[_0x8a56('0x19')]('Content-Range',_0x213115+'-'+_0x11b5ba+'/'+_0x324aba)['json'](_0x2dd3eb);}return null;};}function patchUpdates(_0x1c51f8){return function(_0x2e5fb9){try{jsonpatch[_0x8a56('0x1a')](_0x2e5fb9,_0x1c51f8,!![]);}catch(_0x51649c){return BPromise[_0x8a56('0x1b')](_0x51649c);}return _0x2e5fb9[_0x8a56('0x1c')]();};}function saveUpdates(_0x1c2f32,_0x5e7b4b){return function(_0x32ae53){if(_0x32ae53){return _0x32ae53[_0x8a56('0x1d')](_0x1c2f32)[_0x8a56('0x1e')](function(_0x563347){return _0x563347;});}return null;};}function removeEntity(_0xe2934b,_0x29a322){return function(_0x26e436){if(_0x26e436){return _0x26e436[_0x8a56('0x1f')]()['then'](function(){_0xe2934b['status'](0xcc)[_0x8a56('0x20')]();});}};}function handleEntityNotFound(_0x566067,_0x383582){return function(_0x4b0028){if(!_0x4b0028){_0x566067['sendStatus'](0x194);}return _0x4b0028;};}function handleError(_0x2d1927,_0x337a4c){_0x337a4c=_0x337a4c||0x1f4;return function(_0x5a0596){logger[_0x8a56('0x21')](_0x5a0596[_0x8a56('0x22')]);if(_0x5a0596[_0x8a56('0x23')]){delete _0x5a0596[_0x8a56('0x23')];}_0x2d1927[_0x8a56('0x15')](_0x337a4c)[_0x8a56('0x24')](_0x5a0596);};}exports[_0x8a56('0x25')]=function(_0x22e366,_0xb672cf){var _0x23b86b={},_0x89ebb5={},_0x491e7c={'count':0x0,'rows':[]};var _0x1c7bc5=db['MailQueueReport'][_0x8a56('0x26')];_0x89ebb5[_0x8a56('0x27')]=_['keys'](_0x1c7bc5);_0x89ebb5[_0x8a56('0x28')]=_[_0x8a56('0x29')](_0x22e366['query']);_0x89ebb5[_0x8a56('0x2a')]=_[_0x8a56('0x2b')](_0x89ebb5[_0x8a56('0x27')],_0x89ebb5['query']);_0x23b86b[_0x8a56('0x2c')]=_[_0x8a56('0x2b')](_0x89ebb5[_0x8a56('0x27')],qs[_0x8a56('0x2d')](_0x22e366[_0x8a56('0x28')]['fields']));_0x23b86b[_0x8a56('0x2c')]=_0x23b86b[_0x8a56('0x2c')][_0x8a56('0x2e')]?_0x23b86b['attributes']:_0x89ebb5[_0x8a56('0x27')];if(!_0x22e366[_0x8a56('0x28')][_0x8a56('0x2f')](_0x8a56('0x30'))){_0x23b86b[_0x8a56('0x18')]=qs['limit'](_0x22e366[_0x8a56('0x28')][_0x8a56('0x18')]);_0x23b86b[_0x8a56('0x17')]=qs[_0x8a56('0x17')](_0x22e366[_0x8a56('0x28')][_0x8a56('0x17')]);}_0x23b86b['order']=qs[_0x8a56('0x31')](_0x22e366['query'][_0x8a56('0x31')]);_0x23b86b[_0x8a56('0x32')]=qs[_0x8a56('0x2a')](_[_0x8a56('0x33')](_0x22e366[_0x8a56('0x28')],_0x89ebb5['filters']));if(_0x22e366[_0x8a56('0x28')]['filter']){_0x23b86b['where']=_['merge'](_0x23b86b[_0x8a56('0x32')],{'$or':_[_0x8a56('0x34')](_0x1c7bc5,function(_0x5dda2c){if(_0x5dda2c[_0x8a56('0x35')][_0x8a56('0x36')]!==_0x8a56('0x37')){var _0x580ae5={};_0x580ae5[_0x5dda2c[_0x8a56('0x38')]]={'$like':'%'+_0x22e366[_0x8a56('0x28')][_0x8a56('0x39')]+'%'};return _0x580ae5;}})});}_0x23b86b=_[_0x8a56('0x3a')]({},_0x23b86b,_0x22e366['options']);var _0x4ff197={'where':_0x23b86b[_0x8a56('0x32')]};return db['MailQueueReport'][_0x8a56('0x3b')](_0x4ff197)['then'](function(_0x479fc9){_0x491e7c[_0x8a56('0x3b')]=_0x479fc9;if(_0x22e366[_0x8a56('0x28')][_0x8a56('0x3c')]){_0x23b86b['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x8a56('0x3d')](_0x23b86b);})[_0x8a56('0x1e')](function(_0x489883){_0x491e7c[_0x8a56('0x3e')]=_0x489883;return _0x491e7c;})[_0x8a56('0x1e')](respondWithFilteredResult(_0xb672cf,_0x23b86b))[_0x8a56('0x3f')](handleError(_0xb672cf,null));};exports[_0x8a56('0x40')]=function(_0x55ff58,_0x5e8cac){var _0x36cb3d={'raw':!![],'where':{'id':_0x55ff58['params']['id']}},_0x104d9b={};_0x104d9b['model']=_['keys'](db[_0x8a56('0x41')][_0x8a56('0x26')]);_0x104d9b[_0x8a56('0x28')]=_[_0x8a56('0x29')](_0x55ff58[_0x8a56('0x28')]);_0x104d9b[_0x8a56('0x2a')]=_[_0x8a56('0x2b')](_0x104d9b[_0x8a56('0x27')],_0x104d9b[_0x8a56('0x28')]);_0x36cb3d[_0x8a56('0x2c')]=_[_0x8a56('0x2b')](_0x104d9b['model'],qs['fields'](_0x55ff58[_0x8a56('0x28')][_0x8a56('0x2d')]));_0x36cb3d[_0x8a56('0x2c')]=_0x36cb3d[_0x8a56('0x2c')][_0x8a56('0x2e')]?_0x36cb3d[_0x8a56('0x2c')]:_0x104d9b['model'];if(_0x55ff58[_0x8a56('0x28')][_0x8a56('0x3c')]){_0x36cb3d[_0x8a56('0x42')]=[{'all':!![]}];}_0x36cb3d=_[_0x8a56('0x3a')]({},_0x36cb3d,_0x55ff58['options']);return db['MailQueueReport'][_0x8a56('0x43')](_0x36cb3d)[_0x8a56('0x1e')](handleEntityNotFound(_0x5e8cac,null))[_0x8a56('0x1e')](respondWithResult(_0x5e8cac,null))['catch'](handleError(_0x5e8cac,null));};exports[_0x8a56('0x44')]=function(_0x4c5844,_0x1abbb4){return db[_0x8a56('0x41')]['create'](_0x4c5844['body'],{})[_0x8a56('0x1e')](respondWithResult(_0x1abbb4,0xc9))[_0x8a56('0x3f')](handleError(_0x1abbb4,null));};exports['update']=function(_0x335008,_0x539c37){if(_0x335008[_0x8a56('0x45')]['id']){delete _0x335008[_0x8a56('0x45')]['id'];}return db[_0x8a56('0x41')][_0x8a56('0x43')]({'where':{'id':_0x335008[_0x8a56('0x46')]['id']}})[_0x8a56('0x1e')](handleEntityNotFound(_0x539c37,null))[_0x8a56('0x1e')](saveUpdates(_0x335008['body'],null))[_0x8a56('0x1e')](respondWithResult(_0x539c37,null))['catch'](handleError(_0x539c37,null));};exports[_0x8a56('0x1f')]=function(_0x1b718e,_0x1a0677){return db[_0x8a56('0x41')][_0x8a56('0x43')]({'where':{'id':_0x1b718e[_0x8a56('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a0677,null))[_0x8a56('0x1e')](removeEntity(_0x1a0677,null))['catch'](handleError(_0x1a0677,null));};exports[_0x8a56('0x47')]=function(_0x9f191f,_0x1bd811){return db[_0x8a56('0x41')]['describe']()[_0x8a56('0x1e')](respondWithResult(_0x1bd811,null))[_0x8a56('0x3f')](handleError(_0x1bd811,null));}; \ No newline at end of file +var _0x620f=['status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','MailQueueReport','findAll','rows','catch','show','params','include','options','find','create','body','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x620f,0x10a));var _0xf620=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x620f[_0x2641f9];return _0x585741;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf620('0x0'));var zipdir=require(_0xf620('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf620('0x2'));var moment=require(_0xf620('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf620('0x4'));var util=require(_0xf620('0x5'));var path=require(_0xf620('0x6'));var sox=require(_0xf620('0x7'));var csv=require(_0xf620('0x8'));var ejs=require(_0xf620('0x9'));var fs=require('fs');var _=require(_0xf620('0xa'));var squel=require('squel');var crypto=require(_0xf620('0xb'));var jsforce=require(_0xf620('0xc'));var deskjs=require(_0xf620('0xd'));var toCsv=require(_0xf620('0x8'));var querystring=require(_0xf620('0xe'));var Papa=require('papaparse');var authService=require(_0xf620('0xf'));var hardwareService=require(_0xf620('0x10'));var Redis=require(_0xf620('0x11'));var qs=require(_0xf620('0x12'));var logger=require(_0xf620('0x13'))('api');var utils=require(_0xf620('0x14'));var config=require(_0xf620('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x395af9,_0x509660){_0x509660=_0x509660||0xcc;return function(_0x1bf218){if(_0x1bf218){return _0x395af9['sendStatus'](_0x509660);}return _0x395af9[_0xf620('0x16')](_0x509660)[_0xf620('0x17')]();};}function respondWithResult(_0x373a33,_0x47a60d){_0x47a60d=_0x47a60d||0xc8;return function(_0x160539){if(_0x160539){return _0x373a33['status'](_0x47a60d)['json'](_0x160539);}};}function respondWithFilteredResult(_0x4f6125,_0xabe56f){return function(_0x5ec98a){if(_0x5ec98a){var _0x4cbb7e=_0x5ec98a[_0xf620('0x18')],_0x1b795f=_0xabe56f[_0xf620('0x19')],_0xc56331=_0xabe56f[_0xf620('0x19')]+_0xabe56f[_0xf620('0x1a')],_0x21423e;if(_0xc56331>=_0x4cbb7e){_0xc56331=_0x4cbb7e;_0x21423e=0xc8;}else{_0x21423e=0xce;}_0x4f6125[_0xf620('0x16')](_0x21423e);return _0x4f6125[_0xf620('0x1b')](_0xf620('0x1c'),_0x1b795f+'-'+_0xc56331+'/'+_0x4cbb7e)[_0xf620('0x1d')](_0x5ec98a);}return null;};}function patchUpdates(_0x44b403){return function(_0x37e892){try{jsonpatch['apply'](_0x37e892,_0x44b403,!![]);}catch(_0x434a4f){return BPromise[_0xf620('0x1e')](_0x434a4f);}return _0x37e892[_0xf620('0x1f')]();};}function saveUpdates(_0x115283,_0x54ab9d){return function(_0x582b9f){if(_0x582b9f){return _0x582b9f[_0xf620('0x20')](_0x115283)[_0xf620('0x21')](function(_0x5d6457){return _0x5d6457;});}return null;};}function removeEntity(_0xd2af31,_0x406219){return function(_0x24baa2){if(_0x24baa2){return _0x24baa2[_0xf620('0x22')]()['then'](function(){_0xd2af31[_0xf620('0x16')](0xcc)[_0xf620('0x17')]();});}};}function handleEntityNotFound(_0x9d0e8c,_0x32d0e8){return function(_0x3c5e92){if(!_0x3c5e92){_0x9d0e8c[_0xf620('0x23')](0x194);}return _0x3c5e92;};}function handleError(_0x392372,_0x508bea){_0x508bea=_0x508bea||0x1f4;return function(_0x4c51a6){logger[_0xf620('0x24')](_0x4c51a6[_0xf620('0x25')]);if(_0x4c51a6['name']){delete _0x4c51a6['name'];}_0x392372['status'](_0x508bea)[_0xf620('0x26')](_0x4c51a6);};}exports[_0xf620('0x27')]=function(_0x42c7d6,_0x4ec43e){var _0x55781f={},_0x3b6e8e={},_0x539c58={'count':0x0,'rows':[]};var _0x1c0003=db['MailQueueReport'][_0xf620('0x28')];_0x3b6e8e[_0xf620('0x29')]=_[_0xf620('0x2a')](_0x1c0003);_0x3b6e8e[_0xf620('0x2b')]=_[_0xf620('0x2a')](_0x42c7d6[_0xf620('0x2b')]);_0x3b6e8e[_0xf620('0x2c')]=_[_0xf620('0x2d')](_0x3b6e8e[_0xf620('0x29')],_0x3b6e8e[_0xf620('0x2b')]);_0x55781f[_0xf620('0x2e')]=_[_0xf620('0x2d')](_0x3b6e8e[_0xf620('0x29')],qs[_0xf620('0x2f')](_0x42c7d6['query']['fields']));_0x55781f['attributes']=_0x55781f[_0xf620('0x2e')][_0xf620('0x30')]?_0x55781f['attributes']:_0x3b6e8e['model'];if(!_0x42c7d6['query']['hasOwnProperty'](_0xf620('0x31'))){_0x55781f[_0xf620('0x1a')]=qs[_0xf620('0x1a')](_0x42c7d6['query']['limit']);_0x55781f[_0xf620('0x19')]=qs[_0xf620('0x19')](_0x42c7d6[_0xf620('0x2b')][_0xf620('0x19')]);}_0x55781f['order']=qs[_0xf620('0x32')](_0x42c7d6[_0xf620('0x2b')][_0xf620('0x32')]);_0x55781f[_0xf620('0x33')]=qs[_0xf620('0x2c')](_[_0xf620('0x34')](_0x42c7d6[_0xf620('0x2b')],_0x3b6e8e['filters']));if(_0x42c7d6[_0xf620('0x2b')][_0xf620('0x35')]){_0x55781f[_0xf620('0x33')]=_['merge'](_0x55781f['where'],{'$or':_[_0xf620('0x36')](_0x1c0003,function(_0x133b1c){if(_0x133b1c[_0xf620('0x37')][_0xf620('0x38')]!==_0xf620('0x39')){var _0x508cb1={};_0x508cb1[_0x133b1c[_0xf620('0x3a')]]={'$like':'%'+_0x42c7d6['query'][_0xf620('0x35')]+'%'};return _0x508cb1;}})});}_0x55781f=_[_0xf620('0x3b')]({},_0x55781f,_0x42c7d6['options']);var _0x30a327={'where':_0x55781f['where']};return db[_0xf620('0x3c')]['count'](_0x30a327)[_0xf620('0x21')](function(_0x2044ba){_0x539c58['count']=_0x2044ba;if(_0x42c7d6[_0xf620('0x2b')]['includeAll']){_0x55781f['include']=[{'all':!![]}];}return db[_0xf620('0x3c')][_0xf620('0x3d')](_0x55781f);})[_0xf620('0x21')](function(_0x441252){_0x539c58[_0xf620('0x3e')]=_0x441252;return _0x539c58;})[_0xf620('0x21')](respondWithFilteredResult(_0x4ec43e,_0x55781f))[_0xf620('0x3f')](handleError(_0x4ec43e,null));};exports[_0xf620('0x40')]=function(_0x4e0f8f,_0x55f9c6){var _0x2d9725={'raw':!![],'where':{'id':_0x4e0f8f[_0xf620('0x41')]['id']}},_0x531dba={};_0x531dba[_0xf620('0x29')]=_[_0xf620('0x2a')](db['MailQueueReport']['rawAttributes']);_0x531dba[_0xf620('0x2b')]=_[_0xf620('0x2a')](_0x4e0f8f['query']);_0x531dba[_0xf620('0x2c')]=_[_0xf620('0x2d')](_0x531dba[_0xf620('0x29')],_0x531dba[_0xf620('0x2b')]);_0x2d9725[_0xf620('0x2e')]=_[_0xf620('0x2d')](_0x531dba[_0xf620('0x29')],qs['fields'](_0x4e0f8f['query'][_0xf620('0x2f')]));_0x2d9725[_0xf620('0x2e')]=_0x2d9725[_0xf620('0x2e')][_0xf620('0x30')]?_0x2d9725[_0xf620('0x2e')]:_0x531dba[_0xf620('0x29')];if(_0x4e0f8f['query']['includeAll']){_0x2d9725[_0xf620('0x42')]=[{'all':!![]}];}_0x2d9725=_[_0xf620('0x3b')]({},_0x2d9725,_0x4e0f8f[_0xf620('0x43')]);return db[_0xf620('0x3c')][_0xf620('0x44')](_0x2d9725)[_0xf620('0x21')](handleEntityNotFound(_0x55f9c6,null))[_0xf620('0x21')](respondWithResult(_0x55f9c6,null))[_0xf620('0x3f')](handleError(_0x55f9c6,null));};exports[_0xf620('0x45')]=function(_0x59e763,_0x4d320c){return db[_0xf620('0x3c')][_0xf620('0x45')](_0x59e763[_0xf620('0x46')],{})[_0xf620('0x21')](respondWithResult(_0x4d320c,0xc9))[_0xf620('0x3f')](handleError(_0x4d320c,null));};exports[_0xf620('0x20')]=function(_0x41e6fc,_0x2ec85d){if(_0x41e6fc[_0xf620('0x46')]['id']){delete _0x41e6fc[_0xf620('0x46')]['id'];}return db[_0xf620('0x3c')][_0xf620('0x44')]({'where':{'id':_0x41e6fc[_0xf620('0x41')]['id']}})['then'](handleEntityNotFound(_0x2ec85d,null))[_0xf620('0x21')](saveUpdates(_0x41e6fc[_0xf620('0x46')],null))[_0xf620('0x21')](respondWithResult(_0x2ec85d,null))['catch'](handleError(_0x2ec85d,null));};exports[_0xf620('0x22')]=function(_0x21bde0,_0x5d8402){return db[_0xf620('0x3c')]['find']({'where':{'id':_0x21bde0[_0xf620('0x41')]['id']}})['then'](handleEntityNotFound(_0x5d8402,null))[_0xf620('0x21')](removeEntity(_0x5d8402,null))['catch'](handleError(_0x5d8402,null));};exports[_0xf620('0x47')]=function(_0x30c5a3,_0x236a36){return db['MailQueueReport']['describe']()[_0xf620('0x21')](respondWithResult(_0x236a36,null))[_0xf620('0x3f')](handleError(_0x236a36,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index f55cbcb..60e44b3 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 _0xe9ca=['util','../../config/logger','api','moment','bluebird','request-promise','./mailQueueReport.attributes','MailQueueReport','report_mail_queue','uniqueid','lodash'];(function(_0x5bfa51,_0x5b732c){var _0x22a2a4=function(_0x1f5205){while(--_0x1f5205){_0x5bfa51['push'](_0x5bfa51['shift']());}};_0x22a2a4(++_0x5b732c);}(_0xe9ca,0x83));var _0xae9c=function(_0x53c709,_0xa6ecc5){_0x53c709=_0x53c709-0x0;var _0x2a6887=_0xe9ca[_0x53c709];return _0x2a6887;};'use strict';var _=require(_0xae9c('0x0'));var util=require(_0xae9c('0x1'));var logger=require(_0xae9c('0x2'))(_0xae9c('0x3'));var moment=require(_0xae9c('0x4'));var BPromise=require(_0xae9c('0x5'));var rp=require(_0xae9c('0x6'));var attributes=require(_0xae9c('0x7'));module['exports']=function(_0x4cc983,_0x4df6c1){return _0x4cc983['define'](_0xae9c('0x8'),attributes,{'tableName':_0xae9c('0x9'),'paranoid':![],'indexes':[{'name':_0xae9c('0xa'),'fields':[_0xae9c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x68c9=['request-promise','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment'];(function(_0xb7bea1,_0x2544e5){var _0xc16caf=function(_0x558444){while(--_0x558444){_0xb7bea1['push'](_0xb7bea1['shift']());}};_0xc16caf(++_0x2544e5);}(_0x68c9,0x140));var _0x968c=function(_0x2101d4,_0x4fe7aa){_0x2101d4=_0x2101d4-0x0;var _0x59e359=_0x68c9[_0x2101d4];return _0x59e359;};'use strict';var _=require(_0x968c('0x0'));var util=require(_0x968c('0x1'));var logger=require(_0x968c('0x2'))('api');var moment=require(_0x968c('0x3'));var BPromise=require('bluebird');var rp=require(_0x968c('0x4'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0xb42377,_0x5ada7a){return _0xb42377[_0x968c('0x5')](_0x968c('0x6'),attributes,{'tableName':_0x968c('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x968c('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 3d7f7c7..55ef666 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 _0x1ffa=['attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','request\x20sent','debug','error','code','MailQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','stringify','UpdateMailQueueReport','update','where'];(function(_0x22ace0,_0x5bbade){var _0x3947ae=function(_0x13bc7f){while(--_0x13bc7f){_0x22ace0['push'](_0x22ace0['shift']());}};_0x3947ae(++_0x5bbade);}(_0x1ffa,0x1b3));var _0xa1ff=function(_0x76c490,_0x5ecbfe){_0x76c490=_0x76c490-0x0;var _0x1d373f=_0x1ffa[_0x76c490];return _0x1d373f;};'use strict';var _=require(_0xa1ff('0x0'));var util=require(_0xa1ff('0x1'));var moment=require('moment');var BPromise=require(_0xa1ff('0x2'));var rs=require(_0xa1ff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1ff('0x4'))['db'];var utils=require(_0xa1ff('0x5'));var logger=require('../../config/logger')(_0xa1ff('0x6'));var config=require('../../config/environment');var jayson=require(_0xa1ff('0x7'));var client=jayson[_0xa1ff('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f7164,_0x2b2b84,_0x49d48c){return new BPromise(function(_0x2d9cee,_0x19cb42){return client[_0xa1ff('0x9')](_0x2f7164,_0x49d48c)[_0xa1ff('0xa')](function(_0x3c4356){logger['info']('MailQueueReport,\x20%s,\x20%s',_0x2b2b84,_0xa1ff('0xb'));logger[_0xa1ff('0xc')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x2b2b84,_0xa1ff('0xb'),JSON['stringify'](_0x3c4356));if(_0x3c4356[_0xa1ff('0xd')]){if(_0x3c4356['error'][_0xa1ff('0xe')]===0x1f4){logger['error'](_0xa1ff('0xf'),_0x2b2b84,_0x3c4356[_0xa1ff('0xd')][_0xa1ff('0x10')]);return _0x19cb42(_0x3c4356[_0xa1ff('0xd')][_0xa1ff('0x10')]);}logger[_0xa1ff('0xd')](_0xa1ff('0xf'),_0x2b2b84,_0x3c4356['error'][_0xa1ff('0x10')]);return _0x2d9cee(_0x3c4356[_0xa1ff('0xd')][_0xa1ff('0x10')]);}else{logger[_0xa1ff('0x11')]('MailQueueReport,\x20%s,\x20%s',_0x2b2b84,_0xa1ff('0xb'));_0x2d9cee(_0x3c4356[_0xa1ff('0x12')]['message']);}})[_0xa1ff('0x13')](function(_0x551d24){logger[_0xa1ff('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x2b2b84,_0x551d24);_0x19cb42(_0x551d24);});});}exports[_0xa1ff('0x14')]=function(_0x23685f){var _0x2fb53a=this;return new Promise(function(_0x3947a6,_0x5ea249){return db[_0xa1ff('0x15')][_0xa1ff('0x16')](_0x23685f[_0xa1ff('0x17')],{'raw':_0x23685f[_0xa1ff('0x18')]?_0x23685f['options'][_0xa1ff('0x19')]===undefined?!![]:![]:!![]})[_0xa1ff('0xa')](function(_0x3bc1c3){logger[_0xa1ff('0x11')](_0xa1ff('0x14'),_0x23685f);logger['debug'](_0xa1ff('0x14'),_0x23685f,JSON[_0xa1ff('0x1a')](_0x3bc1c3));_0x3947a6(_0x3bc1c3);})[_0xa1ff('0x13')](function(_0x24c285){logger['error'](_0xa1ff('0x14'),_0x24c285[_0xa1ff('0x10')],_0x23685f);_0x5ea249(_0x2fb53a[_0xa1ff('0xd')](0x1f4,_0x24c285[_0xa1ff('0x10')]));});});};exports[_0xa1ff('0x1b')]=function(_0x489d76){var _0x2c8424=this;return new Promise(function(_0x3c6979,_0x5cb841){return db[_0xa1ff('0x15')][_0xa1ff('0x1c')](_0x489d76[_0xa1ff('0x17')],{'raw':_0x489d76[_0xa1ff('0x18')]?_0x489d76[_0xa1ff('0x18')][_0xa1ff('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x489d76[_0xa1ff('0x18')]?_0x489d76[_0xa1ff('0x18')][_0xa1ff('0x1d')]||null:null,'attributes':_0x489d76[_0xa1ff('0x18')]?_0x489d76[_0xa1ff('0x18')][_0xa1ff('0x1e')]||null:null,'limit':_0x489d76[_0xa1ff('0x18')]?_0x489d76[_0xa1ff('0x18')]['limit']||null:null})[_0xa1ff('0xa')](function(_0x2f1f68){logger[_0xa1ff('0x11')]('UpdateMailQueueReport',_0x489d76);logger['debug'](_0xa1ff('0x1b'),_0x489d76,JSON[_0xa1ff('0x1a')](_0x2f1f68));_0x3c6979(_0x2f1f68);})[_0xa1ff('0x13')](function(_0x16ffb4){logger[_0xa1ff('0xd')](_0xa1ff('0x1b'),_0x16ffb4[_0xa1ff('0x10')],_0x489d76);_0x5cb841(_0x2c8424[_0xa1ff('0xd')](0x1f4,_0x16ffb4[_0xa1ff('0x10')]));});});}; \ No newline at end of file +var _0x1711=['create','body','options','raw','then','UpdateMailQueueReport','MailQueueReport','update','where','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateMailQueueReport'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x1711,0x1e9));var _0x1171=function(_0xb1c61e,_0x130b1f){_0xb1c61e=_0xb1c61e-0x0;var _0x3c4e42=_0x1711[_0xb1c61e];return _0x3c4e42;};'use strict';var _=require(_0x1171('0x0'));var util=require('util');var moment=require(_0x1171('0x1'));var BPromise=require(_0x1171('0x2'));var rs=require(_0x1171('0x3'));var fs=require('fs');var Redis=require(_0x1171('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1171('0x5'));var logger=require('../../config/logger')(_0x1171('0x6'));var config=require(_0x1171('0x7'));var jayson=require(_0x1171('0x8'));var client=jayson[_0x1171('0x9')][_0x1171('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x404642,_0x1500a4,_0x60447f){return new BPromise(function(_0x46fc42,_0x28ff01){return client[_0x1171('0xb')](_0x404642,_0x60447f)['then'](function(_0x23f2c7){logger[_0x1171('0xc')](_0x1171('0xd'),_0x1500a4,_0x1171('0xe'));logger[_0x1171('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x1500a4,_0x1171('0xe'),JSON[_0x1171('0x10')](_0x23f2c7));if(_0x23f2c7[_0x1171('0x11')]){if(_0x23f2c7[_0x1171('0x11')][_0x1171('0x12')]===0x1f4){logger[_0x1171('0x11')](_0x1171('0xd'),_0x1500a4,_0x23f2c7[_0x1171('0x11')]['message']);return _0x28ff01(_0x23f2c7[_0x1171('0x11')][_0x1171('0x13')]);}logger['error'](_0x1171('0xd'),_0x1500a4,_0x23f2c7[_0x1171('0x11')]['message']);return _0x46fc42(_0x23f2c7[_0x1171('0x11')][_0x1171('0x13')]);}else{logger[_0x1171('0xc')](_0x1171('0xd'),_0x1500a4,'request\x20sent');_0x46fc42(_0x23f2c7[_0x1171('0x14')][_0x1171('0x13')]);}})[_0x1171('0x15')](function(_0x44867f){logger[_0x1171('0x11')](_0x1171('0xd'),_0x1500a4,_0x44867f);_0x28ff01(_0x44867f);});});}exports[_0x1171('0x16')]=function(_0x7107bd){var _0x6c3938=this;return new Promise(function(_0x2541a6,_0x486271){return db['MailQueueReport'][_0x1171('0x17')](_0x7107bd[_0x1171('0x18')],{'raw':_0x7107bd[_0x1171('0x19')]?_0x7107bd[_0x1171('0x19')][_0x1171('0x1a')]===undefined?!![]:![]:!![]})[_0x1171('0x1b')](function(_0x34454e){logger['info'](_0x1171('0x16'),_0x7107bd);logger[_0x1171('0xf')]('CreateMailQueueReport',_0x7107bd,JSON[_0x1171('0x10')](_0x34454e));_0x2541a6(_0x34454e);})[_0x1171('0x15')](function(_0x5790d7){logger['error'](_0x1171('0x16'),_0x5790d7[_0x1171('0x13')],_0x7107bd);_0x486271(_0x6c3938[_0x1171('0x11')](0x1f4,_0x5790d7[_0x1171('0x13')]));});});};exports[_0x1171('0x1c')]=function(_0x4ce47f){var _0x4cc180=this;return new Promise(function(_0x222b6e,_0x5c92c2){return db[_0x1171('0x1d')][_0x1171('0x1e')](_0x4ce47f['body'],{'raw':_0x4ce47f[_0x1171('0x19')]?_0x4ce47f['options'][_0x1171('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ce47f['options']?_0x4ce47f[_0x1171('0x19')][_0x1171('0x1f')]||null:null,'attributes':_0x4ce47f['options']?_0x4ce47f[_0x1171('0x19')]['attributes']||null:null,'limit':_0x4ce47f['options']?_0x4ce47f[_0x1171('0x19')]['limit']||null:null})['then'](function(_0x470e2a){logger['info']('UpdateMailQueueReport',_0x4ce47f);logger[_0x1171('0xf')](_0x1171('0x1c'),_0x4ce47f,JSON[_0x1171('0x10')](_0x470e2a));_0x222b6e(_0x470e2a);})[_0x1171('0x15')](function(_0x154cdf){logger['error']('UpdateMailQueueReport',_0x154cdf[_0x1171('0x13')],_0x4ce47f);_0x5c92c2(_0x4cc180['error'](0x1f4,_0x154cdf[_0x1171('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 1a7a9ab..1e1f7f2 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 _0xe6e9=['../../components/interaction/service','../../config/environment','multer','util','path','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6e9,0x182));var _0x9e6e=function(_0x5cc5bf,_0x243d75){_0x5cc5bf=_0x5cc5bf-0x0;var _0x4768f4=_0xe6e9[_0x5cc5bf];return _0x4768f4;};'use strict';var multer=require(_0x9e6e('0x0'));var util=require(_0x9e6e('0x1'));var path=require(_0x9e6e('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e6e('0x3'));var router=express[_0x9e6e('0x4')]();var auth=require(_0x9e6e('0x5'));var interaction=require(_0x9e6e('0x6'));var config=require(_0x9e6e('0x7'));module['exports']=router; \ No newline at end of file +var _0x9c63=['express','../../components/auth/service','../../components/interaction/service','multer','util','path','connect-timeout'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x9c63,0x1a7));var _0x39c6=function(_0x58b7a6,_0x4da47a){_0x58b7a6=_0x58b7a6-0x0;var _0x171783=_0x9c63[_0x58b7a6];return _0x171783;};'use strict';var multer=require(_0x39c6('0x0'));var util=require(_0x39c6('0x1'));var path=require(_0x39c6('0x2'));var timeout=require(_0x39c6('0x3'));var express=require(_0x39c6('0x4'));var router=express['Router']();var auth=require(_0x39c6('0x5'));var interaction=require(_0x39c6('0x6'));var config=require('../../config/environment');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 ab810b2..a3abcbf 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 _0x6308=['username','INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6308,0x1f2));var _0x8630=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x6308[_0x2aa0e7];return _0x1472c0;};'use strict';var Sequelize=require(_0x8630('0x0'));module['exports']={'description':{'type':Sequelize[_0x8630('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x8630('0x1')],'unique':_0x8630('0x2')},'password':{'type':Sequelize[_0x8630('0x1')]},'port':{'type':Sequelize[_0x8630('0x3')]},'tls':{'type':Sequelize[_0x8630('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x8630('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x8630('0x1')]}}; \ No newline at end of file +var _0xeffd=['STRING','BOOLEAN','username','INTEGER','INBOX','sequelize'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xeffd,0x6b));var _0xdeff=function(_0x2d1268,_0x272c10){_0x2d1268=_0x2d1268-0x0;var _0x410cb5=_0xeffd[_0x2d1268];return _0x410cb5;};'use strict';var Sequelize=require(_0xdeff('0x0'));module['exports']={'description':{'type':Sequelize[_0xdeff('0x1')]},'host':{'type':Sequelize[_0xdeff('0x1')]},'authentication':{'type':Sequelize[_0xdeff('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xdeff('0x1')],'unique':_0xdeff('0x3')},'password':{'type':Sequelize[_0xdeff('0x1')]},'port':{'type':Sequelize[_0xdeff('0x4')]},'tls':{'type':Sequelize[_0xdeff('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xdeff('0x1')],'defaultValue':_0xdeff('0x5')},'connTimeout':{'type':Sequelize[_0xdeff('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xdeff('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xdeff('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index f885836..7fe3ccb 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 _0x6f54=['util','../../config/logger','bluebird','request-promise','./mailServerIn.attributes','exports','mail_servers_in','lodash'];(function(_0x436dc8,_0x290b21){var _0x4e091f=function(_0x5e734a){while(--_0x5e734a){_0x436dc8['push'](_0x436dc8['shift']());}};_0x4e091f(++_0x290b21);}(_0x6f54,0xcf));var _0x46f5=function(_0x2f7c78,_0x1ad1a8){_0x2f7c78=_0x2f7c78-0x0;var _0x51dea4=_0x6f54[_0x2f7c78];return _0x51dea4;};'use strict';var _=require(_0x46f5('0x0'));var util=require(_0x46f5('0x1'));var logger=require(_0x46f5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x46f5('0x3'));var rp=require(_0x46f5('0x4'));var attributes=require(_0x46f5('0x5'));module[_0x46f5('0x6')]=function(_0x4d97ff,_0x441c49){return _0x4d97ff['define']('MailServerIn',attributes,{'tableName':_0x46f5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f59=['lodash','util','api','moment','bluebird','request-promise','./mailServerIn.attributes','exports','define'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3f59,0x1b0));var _0x93f5=function(_0x106aa5,_0x37864b){_0x106aa5=_0x106aa5-0x0;var _0x51abe3=_0x3f59[_0x106aa5];return _0x51abe3;};'use strict';var _=require(_0x93f5('0x0'));var util=require(_0x93f5('0x1'));var logger=require('../../config/logger')(_0x93f5('0x2'));var moment=require(_0x93f5('0x3'));var BPromise=require(_0x93f5('0x4'));var rp=require(_0x93f5('0x5'));var attributes=require(_0x93f5('0x6'));module[_0x93f5('0x7')]=function(_0x374022,_0x333f53){return _0x374022[_0x93f5('0x8')]('MailServerIn',attributes,{'tableName':'mail_servers_in','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 5961815..8eb72ff 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 _0xaa6a=['result','catch','GetMailServerIn','MailServerIn','options','raw','attributes','limit','include','model','map','then','debug','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa6a,0x1de));var _0xaaa6=function(_0x287692,_0x4d4f47){_0x287692=_0x287692-0x0;var _0x3d1302=_0xaa6a[_0x287692];return _0x3d1302;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaaa6('0x0'));var BPromise=require('bluebird');var rs=require(_0xaaa6('0x1'));var fs=require('fs');var Redis=require(_0xaaa6('0x2'));var db=require(_0xaaa6('0x3'))['db'];var utils=require(_0xaaa6('0x4'));var logger=require('../../config/logger')(_0xaaa6('0x5'));var config=require(_0xaaa6('0x6'));var jayson=require(_0xaaa6('0x7'));var client=jayson[_0xaaa6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ab52b,_0x23ae17,_0x27cce0){return new BPromise(function(_0x416765,_0x491c10){return client[_0xaaa6('0x9')](_0x2ab52b,_0x27cce0)['then'](function(_0x1d4c2a){logger['info'](_0xaaa6('0xa'),_0x23ae17,'request\x20sent');logger['debug'](_0xaaa6('0xb'),_0x23ae17,_0xaaa6('0xc'),JSON[_0xaaa6('0xd')](_0x1d4c2a));if(_0x1d4c2a[_0xaaa6('0xe')]){if(_0x1d4c2a[_0xaaa6('0xe')][_0xaaa6('0xf')]===0x1f4){logger[_0xaaa6('0xe')]('MailServerIn,\x20%s,\x20%s',_0x23ae17,_0x1d4c2a['error']['message']);return _0x491c10(_0x1d4c2a[_0xaaa6('0xe')][_0xaaa6('0x10')]);}logger['error'](_0xaaa6('0xa'),_0x23ae17,_0x1d4c2a[_0xaaa6('0xe')][_0xaaa6('0x10')]);return _0x416765(_0x1d4c2a[_0xaaa6('0xe')]['message']);}else{logger[_0xaaa6('0x11')](_0xaaa6('0xa'),_0x23ae17,_0xaaa6('0xc'));_0x416765(_0x1d4c2a[_0xaaa6('0x12')][_0xaaa6('0x10')]);}})[_0xaaa6('0x13')](function(_0x3ba80f){logger['error'](_0xaaa6('0xa'),_0x23ae17,_0x3ba80f);_0x491c10(_0x3ba80f);});});}exports[_0xaaa6('0x14')]=function(_0x2b85f9){var _0x24d936=this;return new Promise(function(_0x5358d7,_0x37f1d7){return db[_0xaaa6('0x15')]['findAll']({'raw':_0x2b85f9[_0xaaa6('0x16')]?_0x2b85f9[_0xaaa6('0x16')][_0xaaa6('0x17')]===undefined?!![]:![]:!![],'where':_0x2b85f9[_0xaaa6('0x16')]?_0x2b85f9[_0xaaa6('0x16')]['where']||null:null,'attributes':_0x2b85f9[_0xaaa6('0x16')]?_0x2b85f9['options'][_0xaaa6('0x18')]||null:null,'limit':_0x2b85f9[_0xaaa6('0x16')]?_0x2b85f9[_0xaaa6('0x16')][_0xaaa6('0x19')]||null:null,'include':_0x2b85f9[_0xaaa6('0x16')]?_0x2b85f9[_0xaaa6('0x16')][_0xaaa6('0x1a')]?_['map'](_0x2b85f9['options'][_0xaaa6('0x1a')],function(_0x37eedd){return{'model':db[_0x37eedd[_0xaaa6('0x1b')]],'as':_0x37eedd['as'],'attributes':_0x37eedd[_0xaaa6('0x18')],'include':_0x37eedd[_0xaaa6('0x1a')]?_[_0xaaa6('0x1c')](_0x37eedd[_0xaaa6('0x1a')],function(_0x381124){return{'model':db[_0x381124[_0xaaa6('0x1b')]],'as':_0x381124['as'],'attributes':_0x381124[_0xaaa6('0x18')],'include':_0x381124['include']?_['map'](_0x381124[_0xaaa6('0x1a')],function(_0x32dfe9){return{'model':db[_0x32dfe9[_0xaaa6('0x1b')]],'as':_0x32dfe9['as'],'attributes':_0x32dfe9[_0xaaa6('0x18')]};}):[]};}):[]};}):[]:[]})[_0xaaa6('0x1d')](function(_0x3dcebd){logger[_0xaaa6('0x11')](_0xaaa6('0x14'),_0x2b85f9);logger[_0xaaa6('0x1e')]('GetMailServerIn',_0x2b85f9,JSON['stringify'](_0x3dcebd));_0x5358d7(_0x3dcebd);})[_0xaaa6('0x13')](function(_0x2d3aed){logger[_0xaaa6('0xe')](_0xaaa6('0x14'),_0x2d3aed[_0xaaa6('0x10')],_0x2b85f9);_0x37f1d7(_0x24d936[_0xaaa6('0xe')](0x1f4,_0x2d3aed[_0xaaa6('0x10')]));});});}; \ No newline at end of file +var _0xfc0e=['MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','options','raw','attributes','limit','include','map','model','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info'];(function(_0x5a40cc,_0x2fc06c){var _0x55ced5=function(_0x179adc){while(--_0x179adc){_0x5a40cc['push'](_0x5a40cc['shift']());}};_0x55ced5(++_0x2fc06c);}(_0xfc0e,0xa2));var _0xefc0=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0xfc0e[_0x152aa1];return _0x1bc01a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xefc0('0x0'));var BPromise=require(_0xefc0('0x1'));var rs=require(_0xefc0('0x2'));var fs=require('fs');var Redis=require(_0xefc0('0x3'));var db=require(_0xefc0('0x4'))['db'];var utils=require(_0xefc0('0x5'));var logger=require(_0xefc0('0x6'))(_0xefc0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xefc0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37408a,_0x9a3711,_0x4d54d6){return new BPromise(function(_0x1b3002,_0x43f3d8){return client[_0xefc0('0x9')](_0x37408a,_0x4d54d6)[_0xefc0('0xa')](function(_0x56da8c){logger[_0xefc0('0xb')](_0xefc0('0xc'),_0x9a3711,_0xefc0('0xd'));logger[_0xefc0('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x9a3711,_0xefc0('0xd'),JSON[_0xefc0('0xf')](_0x56da8c));if(_0x56da8c[_0xefc0('0x10')]){if(_0x56da8c['error']['code']===0x1f4){logger[_0xefc0('0x10')](_0xefc0('0xc'),_0x9a3711,_0x56da8c[_0xefc0('0x10')][_0xefc0('0x11')]);return _0x43f3d8(_0x56da8c['error'][_0xefc0('0x11')]);}logger[_0xefc0('0x10')](_0xefc0('0xc'),_0x9a3711,_0x56da8c['error'][_0xefc0('0x11')]);return _0x1b3002(_0x56da8c[_0xefc0('0x10')][_0xefc0('0x11')]);}else{logger[_0xefc0('0xb')](_0xefc0('0xc'),_0x9a3711,'request\x20sent');_0x1b3002(_0x56da8c[_0xefc0('0x12')][_0xefc0('0x11')]);}})[_0xefc0('0x13')](function(_0x46eccf){logger[_0xefc0('0x10')](_0xefc0('0xc'),_0x9a3711,_0x46eccf);_0x43f3d8(_0x46eccf);});});}exports[_0xefc0('0x14')]=function(_0x984bbd){var _0x17876b=this;return new Promise(function(_0x392305,_0xf400ea){return db[_0xefc0('0x15')]['findAll']({'raw':_0x984bbd[_0xefc0('0x16')]?_0x984bbd['options'][_0xefc0('0x17')]===undefined?!![]:![]:!![],'where':_0x984bbd['options']?_0x984bbd[_0xefc0('0x16')]['where']||null:null,'attributes':_0x984bbd['options']?_0x984bbd[_0xefc0('0x16')][_0xefc0('0x18')]||null:null,'limit':_0x984bbd[_0xefc0('0x16')]?_0x984bbd[_0xefc0('0x16')][_0xefc0('0x19')]||null:null,'include':_0x984bbd['options']?_0x984bbd['options'][_0xefc0('0x1a')]?_[_0xefc0('0x1b')](_0x984bbd['options'][_0xefc0('0x1a')],function(_0x1ace15){return{'model':db[_0x1ace15['model']],'as':_0x1ace15['as'],'attributes':_0x1ace15['attributes'],'include':_0x1ace15[_0xefc0('0x1a')]?_[_0xefc0('0x1b')](_0x1ace15[_0xefc0('0x1a')],function(_0x1b841c){return{'model':db[_0x1b841c['model']],'as':_0x1b841c['as'],'attributes':_0x1b841c[_0xefc0('0x18')],'include':_0x1b841c['include']?_[_0xefc0('0x1b')](_0x1b841c[_0xefc0('0x1a')],function(_0x1d64b4){return{'model':db[_0x1d64b4[_0xefc0('0x1c')]],'as':_0x1d64b4['as'],'attributes':_0x1d64b4[_0xefc0('0x18')]};}):[]};}):[]};}):[]:[]})[_0xefc0('0xa')](function(_0x407571){logger['info'](_0xefc0('0x14'),_0x984bbd);logger['debug'](_0xefc0('0x14'),_0x984bbd,JSON[_0xefc0('0xf')](_0x407571));_0x392305(_0x407571);})[_0xefc0('0x13')](function(_0x47d070){logger[_0xefc0('0x10')](_0xefc0('0x14'),_0x47d070[_0xefc0('0x11')],_0x984bbd);_0xf400ea(_0x17876b[_0xefc0('0x10')](0x1f4,_0x47d070[_0xefc0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 33f8790..7e0cc25 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 _0x180a=['./mailServerOut.controller','get','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3eea50,_0x54d651){var _0x3f1f0e=function(_0x1f50f7){while(--_0x1f50f7){_0x3eea50['push'](_0x3eea50['shift']());}};_0x3f1f0e(++_0x54d651);}(_0x180a,0xd4));var _0xa180=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x180a[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0xa180('0x0'));var util=require(_0xa180('0x1'));var path=require(_0xa180('0x2'));var timeout=require(_0xa180('0x3'));var express=require(_0xa180('0x4'));var router=express[_0xa180('0x5')]();var auth=require(_0xa180('0x6'));var interaction=require(_0xa180('0x7'));var config=require('../../config/environment');var controller=require(_0xa180('0x8'));router[_0xa180('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xa180('0xa')](),controller[_0xa180('0xb')]);router[_0xa180('0xc')]('/',auth['isAuthenticated'](),controller[_0xa180('0xd')]);router[_0xa180('0xe')]('/:id',auth[_0xa180('0xa')](),controller[_0xa180('0xf')]);router[_0xa180('0x10')](_0xa180('0x11'),auth[_0xa180('0xa')](),controller[_0xa180('0x12')]);module[_0xa180('0x13')]=router; \ No newline at end of file +var _0xd400=['isAuthenticated','index','/:id','show','post','create','update','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x21f0a8,_0x52fd67){var _0x46219a=function(_0x383d89){while(--_0x383d89){_0x21f0a8['push'](_0x21f0a8['shift']());}};_0x46219a(++_0x52fd67);}(_0xd400,0x17e));var _0x0d40=function(_0x45cb57,_0x40230d){_0x45cb57=_0x45cb57-0x0;var _0x2f0aa1=_0xd400[_0x45cb57];return _0x2f0aa1;};'use strict';var multer=require('multer');var util=require(_0x0d40('0x0'));var path=require(_0x0d40('0x1'));var timeout=require('connect-timeout');var express=require(_0x0d40('0x2'));var router=express[_0x0d40('0x3')]();var auth=require(_0x0d40('0x4'));var interaction=require(_0x0d40('0x5'));var config=require(_0x0d40('0x6'));var controller=require(_0x0d40('0x7'));router[_0x0d40('0x8')]('/',auth[_0x0d40('0x9')](),controller[_0x0d40('0xa')]);router[_0x0d40('0x8')](_0x0d40('0xb'),auth[_0x0d40('0x9')](),controller[_0x0d40('0xc')]);router[_0x0d40('0xd')]('/',auth[_0x0d40('0x9')](),controller[_0x0d40('0xe')]);router['put'](_0x0d40('0xb'),auth[_0x0d40('0x9')](),controller[_0x0d40('0xf')]);router['delete'](_0x0d40('0xb'),auth[_0x0d40('0x9')](),controller['destroy']);module[_0x0d40('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index bf56fd0..8d0ee94 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 _0x4b2d=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x4a4f50,_0x728c80){var _0x2d2788=function(_0x36bca6){while(--_0x36bca6){_0x4a4f50['push'](_0x4a4f50['shift']());}};_0x2d2788(++_0x728c80);}(_0x4b2d,0xac));var _0xd4b2=function(_0x3dd0b9,_0x1d6c92){_0x3dd0b9=_0x3dd0b9-0x0;var _0x4c0351=_0x4b2d[_0x3dd0b9];return _0x4c0351;};'use strict';var Sequelize=require('sequelize');module[_0xd4b2('0x0')]={'description':{'type':Sequelize[_0xd4b2('0x1')]},'host':{'type':Sequelize[_0xd4b2('0x1')]},'user':{'type':Sequelize[_0xd4b2('0x1')]},'pass':{'type':Sequelize[_0xd4b2('0x1')]},'port':{'type':Sequelize[_0xd4b2('0x2')]},'secure':{'type':Sequelize[_0xd4b2('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xd4b2('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xedbe=['STRING','BOOLEAN','sequelize'];(function(_0x5dbc36,_0x89a50d){var _0x5392e1=function(_0x295f52){while(--_0x295f52){_0x5dbc36['push'](_0x5dbc36['shift']());}};_0x5392e1(++_0x89a50d);}(_0xedbe,0x1f4));var _0xeedb=function(_0x4462c6,_0x10ced5){_0x4462c6=_0x4462c6-0x0;var _0x1050eb=_0xedbe[_0x4462c6];return _0x1050eb;};'use strict';var Sequelize=require(_0xeedb('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xeedb('0x1')]},'user':{'type':Sequelize[_0xeedb('0x1')]},'pass':{'type':Sequelize[_0xeedb('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xeedb('0x1')]},'authentication':{'type':Sequelize[_0xeedb('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index c8e1eba..dea37f3 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 _0xe706=['includeAll','include','findAll','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','MailServerOut','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options'];(function(_0x2b1ce7,_0x2f82e6){var _0x4c8e9b=function(_0x3e4262){while(--_0x3e4262){_0x2b1ce7['push'](_0x2b1ce7['shift']());}};_0x4c8e9b(++_0x2f82e6);}(_0xe706,0xa3));var _0x6e70=function(_0x150a67,_0x4406ca){_0x150a67=_0x150a67-0x0;var _0x505c8f=_0xe706[_0x150a67];return _0x505c8f;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var authService=require(_0x6e70('0x14'));var hardwareService=require(_0x6e70('0x15'));var Redis=require(_0x6e70('0x16'));var qs=require(_0x6e70('0x17'));var logger=require(_0x6e70('0x18'))(_0x6e70('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6e70('0x1a'))['db'];function respondWithStatusCode(_0x15a1a5,_0x18cf27){_0x18cf27=_0x18cf27||0xcc;return function(_0x27dd9b){if(_0x27dd9b){return _0x15a1a5[_0x6e70('0x1b')](_0x18cf27);}return _0x15a1a5[_0x6e70('0x1c')](_0x18cf27)[_0x6e70('0x1d')]();};}function respondWithResult(_0x181005,_0x5dfbaa){_0x5dfbaa=_0x5dfbaa||0xc8;return function(_0x52737e){if(_0x52737e){return _0x181005['status'](_0x5dfbaa)[_0x6e70('0x1e')](_0x52737e);}};}function respondWithFilteredResult(_0x5a37a6,_0x53aed0){return function(_0x304716){if(_0x304716){var _0x22c50c=_0x304716[_0x6e70('0x1f')],_0x5d9263=_0x53aed0[_0x6e70('0x20')],_0x24f3ac=_0x53aed0['offset']+_0x53aed0['limit'],_0x5c3fe7;if(_0x24f3ac>=_0x22c50c){_0x24f3ac=_0x22c50c;_0x5c3fe7=0xc8;}else{_0x5c3fe7=0xce;}_0x5a37a6[_0x6e70('0x1c')](_0x5c3fe7);return _0x5a37a6['set'](_0x6e70('0x21'),_0x5d9263+'-'+_0x24f3ac+'/'+_0x22c50c)[_0x6e70('0x1e')](_0x304716);}return null;};}function patchUpdates(_0x53acdc){return function(_0x497d61){try{jsonpatch[_0x6e70('0x22')](_0x497d61,_0x53acdc,!![]);}catch(_0x208e21){return BPromise[_0x6e70('0x23')](_0x208e21);}return _0x497d61[_0x6e70('0x24')]();};}function saveUpdates(_0x3af484,_0xcdf9f2){return function(_0x1b2453){if(_0x1b2453){return _0x1b2453[_0x6e70('0x25')](_0x3af484)[_0x6e70('0x26')](function(_0xb29a2a){return _0xb29a2a;});}return null;};}function removeEntity(_0x4a0cfe,_0x228350){return function(_0x344b65){if(_0x344b65){return _0x344b65[_0x6e70('0x27')]()['then'](function(){_0x4a0cfe[_0x6e70('0x1c')](0xcc)[_0x6e70('0x1d')]();});}};}function handleEntityNotFound(_0x3337a6,_0x50da2c){return function(_0x10fc91){if(!_0x10fc91){_0x3337a6['sendStatus'](0x194);}return _0x10fc91;};}function handleError(_0x50aec2,_0x4e97c7){_0x4e97c7=_0x4e97c7||0x1f4;return function(_0x41e352){logger[_0x6e70('0x28')](_0x41e352['stack']);if(_0x41e352[_0x6e70('0x29')]){delete _0x41e352[_0x6e70('0x29')];}_0x50aec2['status'](_0x4e97c7)[_0x6e70('0x2a')](_0x41e352);};}exports[_0x6e70('0x2b')]=function(_0x2bb231,_0x4a67ac){var _0x54a5fe={},_0x2c4d37={},_0x3af17f={'count':0x0,'rows':[]};var _0x83c836=db[_0x6e70('0x2c')][_0x6e70('0x2d')];_0x2c4d37['model']=_[_0x6e70('0x2e')](_0x83c836);_0x2c4d37[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x2bb231[_0x6e70('0x2f')]);_0x2c4d37[_0x6e70('0x30')]=_[_0x6e70('0x31')](_0x2c4d37[_0x6e70('0x32')],_0x2c4d37[_0x6e70('0x2f')]);_0x54a5fe[_0x6e70('0x33')]=_[_0x6e70('0x31')](_0x2c4d37['model'],qs[_0x6e70('0x34')](_0x2bb231['query'][_0x6e70('0x34')]));_0x54a5fe['attributes']=_0x54a5fe[_0x6e70('0x33')][_0x6e70('0x35')]?_0x54a5fe[_0x6e70('0x33')]:_0x2c4d37['model'];if(!_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x36')]('nolimit')){_0x54a5fe[_0x6e70('0x37')]=qs[_0x6e70('0x37')](_0x2bb231['query'][_0x6e70('0x37')]);_0x54a5fe[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x20')]);}_0x54a5fe[_0x6e70('0x38')]=qs[_0x6e70('0x39')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x39')]);_0x54a5fe[_0x6e70('0x3a')]=qs['filters'](_[_0x6e70('0x3b')](_0x2bb231['query'],_0x2c4d37[_0x6e70('0x30')]));if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x3c')]){_0x54a5fe[_0x6e70('0x3a')]=_[_0x6e70('0x3d')](_0x54a5fe[_0x6e70('0x3a')],{'$or':_[_0x6e70('0x3e')](_0x83c836,function(_0xdd0bee){if(_0xdd0bee[_0x6e70('0x3f')][_0x6e70('0x40')]!==_0x6e70('0x41')){var _0x23d5e2={};_0x23d5e2[_0xdd0bee[_0x6e70('0x42')]]={'$like':'%'+_0x2bb231['query']['filter']+'%'};return _0x23d5e2;}})});}_0x54a5fe=_['merge']({},_0x54a5fe,_0x2bb231[_0x6e70('0x43')]);var _0x3841a0={'where':_0x54a5fe[_0x6e70('0x3a')]};return db[_0x6e70('0x2c')][_0x6e70('0x1f')](_0x3841a0)[_0x6e70('0x26')](function(_0x572a71){_0x3af17f[_0x6e70('0x1f')]=_0x572a71;if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x44')]){_0x54a5fe[_0x6e70('0x45')]=[{'all':!![]}];}return db[_0x6e70('0x2c')][_0x6e70('0x46')](_0x54a5fe);})[_0x6e70('0x26')](function(_0x16fc7d){_0x3af17f['rows']=_0x16fc7d;return _0x3af17f;})[_0x6e70('0x26')](respondWithFilteredResult(_0x4a67ac,_0x54a5fe))[_0x6e70('0x47')](handleError(_0x4a67ac,null));};exports[_0x6e70('0x48')]=function(_0x31cad2,_0x201da9){var _0x1de947={'raw':!![],'where':{'id':_0x31cad2['params']['id']}},_0x21b0e7={};_0x21b0e7['model']=_['keys'](db[_0x6e70('0x2c')][_0x6e70('0x2d')]);_0x21b0e7[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x31cad2[_0x6e70('0x2f')]);_0x21b0e7['filters']=_[_0x6e70('0x31')](_0x21b0e7[_0x6e70('0x32')],_0x21b0e7[_0x6e70('0x2f')]);_0x1de947['attributes']=_['intersection'](_0x21b0e7['model'],qs[_0x6e70('0x34')](_0x31cad2['query'][_0x6e70('0x34')]));_0x1de947[_0x6e70('0x33')]=_0x1de947[_0x6e70('0x33')][_0x6e70('0x35')]?_0x1de947['attributes']:_0x21b0e7[_0x6e70('0x32')];if(_0x31cad2['query'][_0x6e70('0x44')]){_0x1de947[_0x6e70('0x45')]=[{'all':!![]}];}_0x1de947=_[_0x6e70('0x3d')]({},_0x1de947,_0x31cad2[_0x6e70('0x43')]);return db['MailServerOut'][_0x6e70('0x49')](_0x1de947)[_0x6e70('0x26')](handleEntityNotFound(_0x201da9,null))[_0x6e70('0x26')](respondWithResult(_0x201da9,null))[_0x6e70('0x47')](handleError(_0x201da9,null));};exports[_0x6e70('0x4a')]=function(_0x3fcb2d,_0x3d9c5){return db['MailServerOut'][_0x6e70('0x4a')](_0x3fcb2d[_0x6e70('0x4b')],{})[_0x6e70('0x26')](respondWithResult(_0x3d9c5,0xc9))[_0x6e70('0x47')](handleError(_0x3d9c5,null));};exports[_0x6e70('0x25')]=function(_0x172e8a,_0x1e2095){if(_0x172e8a['body']['id']){delete _0x172e8a[_0x6e70('0x4b')]['id'];}return db['MailServerOut'][_0x6e70('0x49')]({'where':{'id':_0x172e8a[_0x6e70('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e2095,null))['then'](saveUpdates(_0x172e8a[_0x6e70('0x4b')],null))[_0x6e70('0x26')](respondWithResult(_0x1e2095,null))[_0x6e70('0x47')](handleError(_0x1e2095,null));};exports['destroy']=function(_0x4af9b1,_0x238ebb){return db[_0x6e70('0x2c')][_0x6e70('0x49')]({'where':{'id':_0x4af9b1[_0x6e70('0x4c')]['id']}})[_0x6e70('0x26')](handleEntityNotFound(_0x238ebb,null))[_0x6e70('0x26')](removeEntity(_0x238ebb,null))['catch'](handleError(_0x238ebb,null));}; \ No newline at end of file +var _0xedd9=['limit','set','apply','save','then','destroy','error','stack','name','send','index','MailServerOut','rawAttributes','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x40ea6f,_0x26a879){var _0x10b4d4=function(_0x1c0881){while(--_0x1c0881){_0x40ea6f['push'](_0x40ea6f['shift']());}};_0x10b4d4(++_0x26a879);}(_0xedd9,0xfc));var _0x9edd=function(_0x3e6e61,_0x1214ae){_0x3e6e61=_0x3e6e61-0x0;var _0xbadc73=_0xedd9[_0x3e6e61];return _0xbadc73;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var authService=require(_0x9edd('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x9edd('0x11'));var qs=require(_0x9edd('0x12'));var logger=require('../../config/logger')(_0x9edd('0x13'));var utils=require(_0x9edd('0x14'));var config=require('../../config/environment');var db=require(_0x9edd('0x15'))['db'];function respondWithStatusCode(_0x1b73d1,_0x25e64c){_0x25e64c=_0x25e64c||0xcc;return function(_0xfd544a){if(_0xfd544a){return _0x1b73d1[_0x9edd('0x16')](_0x25e64c);}return _0x1b73d1[_0x9edd('0x17')](_0x25e64c)[_0x9edd('0x18')]();};}function respondWithResult(_0xef5498,_0x47eb64){_0x47eb64=_0x47eb64||0xc8;return function(_0x176bfa){if(_0x176bfa){return _0xef5498[_0x9edd('0x17')](_0x47eb64)[_0x9edd('0x19')](_0x176bfa);}};}function respondWithFilteredResult(_0x4d9a7,_0x13b6b6){return function(_0x338f3c){if(_0x338f3c){var _0x1042aa=_0x338f3c[_0x9edd('0x1a')],_0x75a4ab=_0x13b6b6[_0x9edd('0x1b')],_0x4ea60f=_0x13b6b6['offset']+_0x13b6b6[_0x9edd('0x1c')],_0x5f5bf4;if(_0x4ea60f>=_0x1042aa){_0x4ea60f=_0x1042aa;_0x5f5bf4=0xc8;}else{_0x5f5bf4=0xce;}_0x4d9a7[_0x9edd('0x17')](_0x5f5bf4);return _0x4d9a7[_0x9edd('0x1d')]('Content-Range',_0x75a4ab+'-'+_0x4ea60f+'/'+_0x1042aa)[_0x9edd('0x19')](_0x338f3c);}return null;};}function patchUpdates(_0x5d879c){return function(_0x2cdcef){try{jsonpatch[_0x9edd('0x1e')](_0x2cdcef,_0x5d879c,!![]);}catch(_0x4bdb88){return BPromise['reject'](_0x4bdb88);}return _0x2cdcef[_0x9edd('0x1f')]();};}function saveUpdates(_0x50338f,_0x27a95a){return function(_0x54a03f){if(_0x54a03f){return _0x54a03f['update'](_0x50338f)[_0x9edd('0x20')](function(_0x1c46a8){return _0x1c46a8;});}return null;};}function removeEntity(_0x4fb7bf,_0x5823bc){return function(_0x341d67){if(_0x341d67){return _0x341d67[_0x9edd('0x21')]()[_0x9edd('0x20')](function(){_0x4fb7bf['status'](0xcc)[_0x9edd('0x18')]();});}};}function handleEntityNotFound(_0x1dca43,_0x44a6c1){return function(_0x2ca65f){if(!_0x2ca65f){_0x1dca43[_0x9edd('0x16')](0x194);}return _0x2ca65f;};}function handleError(_0x4c75d2,_0x46c383){_0x46c383=_0x46c383||0x1f4;return function(_0xeaf55a){logger[_0x9edd('0x22')](_0xeaf55a[_0x9edd('0x23')]);if(_0xeaf55a[_0x9edd('0x24')]){delete _0xeaf55a['name'];}_0x4c75d2['status'](_0x46c383)[_0x9edd('0x25')](_0xeaf55a);};}exports[_0x9edd('0x26')]=function(_0x8d67aa,_0x25e135){var _0x3c2227={},_0x4fe471={},_0x57a2cc={'count':0x0,'rows':[]};var _0x214d0a=db[_0x9edd('0x27')][_0x9edd('0x28')];_0x4fe471['model']=_[_0x9edd('0x29')](_0x214d0a);_0x4fe471[_0x9edd('0x2a')]=_[_0x9edd('0x29')](_0x8d67aa[_0x9edd('0x2a')]);_0x4fe471['filters']=_[_0x9edd('0x2b')](_0x4fe471[_0x9edd('0x2c')],_0x4fe471[_0x9edd('0x2a')]);_0x3c2227[_0x9edd('0x2d')]=_[_0x9edd('0x2b')](_0x4fe471[_0x9edd('0x2c')],qs[_0x9edd('0x2e')](_0x8d67aa[_0x9edd('0x2a')][_0x9edd('0x2e')]));_0x3c2227[_0x9edd('0x2d')]=_0x3c2227[_0x9edd('0x2d')][_0x9edd('0x2f')]?_0x3c2227[_0x9edd('0x2d')]:_0x4fe471[_0x9edd('0x2c')];if(!_0x8d67aa[_0x9edd('0x2a')]['hasOwnProperty'](_0x9edd('0x30'))){_0x3c2227[_0x9edd('0x1c')]=qs[_0x9edd('0x1c')](_0x8d67aa['query'][_0x9edd('0x1c')]);_0x3c2227[_0x9edd('0x1b')]=qs[_0x9edd('0x1b')](_0x8d67aa[_0x9edd('0x2a')][_0x9edd('0x1b')]);}_0x3c2227[_0x9edd('0x31')]=qs[_0x9edd('0x32')](_0x8d67aa[_0x9edd('0x2a')][_0x9edd('0x32')]);_0x3c2227[_0x9edd('0x33')]=qs[_0x9edd('0x34')](_[_0x9edd('0x35')](_0x8d67aa[_0x9edd('0x2a')],_0x4fe471[_0x9edd('0x34')]));if(_0x8d67aa['query'][_0x9edd('0x36')]){_0x3c2227['where']=_[_0x9edd('0x37')](_0x3c2227[_0x9edd('0x33')],{'$or':_[_0x9edd('0x38')](_0x214d0a,function(_0x434d26){if(_0x434d26[_0x9edd('0x39')]['key']!==_0x9edd('0x3a')){var _0x44dbfc={};_0x44dbfc[_0x434d26[_0x9edd('0x3b')]]={'$like':'%'+_0x8d67aa[_0x9edd('0x2a')][_0x9edd('0x36')]+'%'};return _0x44dbfc;}})});}_0x3c2227=_[_0x9edd('0x37')]({},_0x3c2227,_0x8d67aa[_0x9edd('0x3c')]);var _0x1cbbac={'where':_0x3c2227[_0x9edd('0x33')]};return db[_0x9edd('0x27')]['count'](_0x1cbbac)[_0x9edd('0x20')](function(_0x56a228){_0x57a2cc[_0x9edd('0x1a')]=_0x56a228;if(_0x8d67aa['query'][_0x9edd('0x3d')]){_0x3c2227[_0x9edd('0x3e')]=[{'all':!![]}];}return db[_0x9edd('0x27')]['findAll'](_0x3c2227);})[_0x9edd('0x20')](function(_0xcbd0ef){_0x57a2cc[_0x9edd('0x3f')]=_0xcbd0ef;return _0x57a2cc;})['then'](respondWithFilteredResult(_0x25e135,_0x3c2227))[_0x9edd('0x40')](handleError(_0x25e135,null));};exports['show']=function(_0x1fc4fb,_0xfbc492){var _0x50be2c={'raw':!![],'where':{'id':_0x1fc4fb[_0x9edd('0x41')]['id']}},_0x315f52={};_0x315f52[_0x9edd('0x2c')]=_[_0x9edd('0x29')](db['MailServerOut'][_0x9edd('0x28')]);_0x315f52['query']=_[_0x9edd('0x29')](_0x1fc4fb[_0x9edd('0x2a')]);_0x315f52['filters']=_[_0x9edd('0x2b')](_0x315f52['model'],_0x315f52['query']);_0x50be2c[_0x9edd('0x2d')]=_[_0x9edd('0x2b')](_0x315f52[_0x9edd('0x2c')],qs[_0x9edd('0x2e')](_0x1fc4fb[_0x9edd('0x2a')][_0x9edd('0x2e')]));_0x50be2c[_0x9edd('0x2d')]=_0x50be2c[_0x9edd('0x2d')][_0x9edd('0x2f')]?_0x50be2c[_0x9edd('0x2d')]:_0x315f52[_0x9edd('0x2c')];if(_0x1fc4fb[_0x9edd('0x2a')][_0x9edd('0x3d')]){_0x50be2c[_0x9edd('0x3e')]=[{'all':!![]}];}_0x50be2c=_[_0x9edd('0x37')]({},_0x50be2c,_0x1fc4fb['options']);return db[_0x9edd('0x27')][_0x9edd('0x42')](_0x50be2c)[_0x9edd('0x20')](handleEntityNotFound(_0xfbc492,null))[_0x9edd('0x20')](respondWithResult(_0xfbc492,null))[_0x9edd('0x40')](handleError(_0xfbc492,null));};exports[_0x9edd('0x43')]=function(_0x10d41e,_0x4e9ad1){return db['MailServerOut']['create'](_0x10d41e[_0x9edd('0x44')],{})['then'](respondWithResult(_0x4e9ad1,0xc9))[_0x9edd('0x40')](handleError(_0x4e9ad1,null));};exports[_0x9edd('0x45')]=function(_0x2b06d3,_0x8db801){if(_0x2b06d3[_0x9edd('0x44')]['id']){delete _0x2b06d3['body']['id'];}return db[_0x9edd('0x27')][_0x9edd('0x42')]({'where':{'id':_0x2b06d3[_0x9edd('0x41')]['id']}})['then'](handleEntityNotFound(_0x8db801,null))[_0x9edd('0x20')](saveUpdates(_0x2b06d3[_0x9edd('0x44')],null))[_0x9edd('0x20')](respondWithResult(_0x8db801,null))[_0x9edd('0x40')](handleError(_0x8db801,null));};exports[_0x9edd('0x21')]=function(_0x35bdec,_0x4d4f33){return db[_0x9edd('0x27')][_0x9edd('0x42')]({'where':{'id':_0x35bdec['params']['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x20')](removeEntity(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 510892a..df79ccf 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 _0x9505=['request-promise','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash','util','api','moment','bluebird'];(function(_0x3710e3,_0x5694cd){var _0xeef0b3=function(_0x194756){while(--_0x194756){_0x3710e3['push'](_0x3710e3['shift']());}};_0xeef0b3(++_0x5694cd);}(_0x9505,0x1e5));var _0x5950=function(_0x5227d4,_0x2103d9){_0x5227d4=_0x5227d4-0x0;var _0x461491=_0x9505[_0x5227d4];return _0x461491;};'use strict';var _=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var logger=require('../../config/logger')(_0x5950('0x2'));var moment=require(_0x5950('0x3'));var BPromise=require(_0x5950('0x4'));var rp=require(_0x5950('0x5'));var attributes=require(_0x5950('0x6'));module['exports']=function(_0x48219e,_0x2494fc){return _0x48219e[_0x5950('0x7')](_0x5950('0x8'),attributes,{'tableName':_0x5950('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf69d=['MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','request-promise','./mailServerOut.attributes','exports','define'];(function(_0x117b82,_0x13554b){var _0x3a8975=function(_0x54d531){while(--_0x54d531){_0x117b82['push'](_0x117b82['shift']());}};_0x3a8975(++_0x13554b);}(_0xf69d,0xd3));var _0xdf69=function(_0x16d0c8,_0x2d15d9){_0x16d0c8=_0x16d0c8-0x0;var _0x5d3e6b=_0xf69d[_0x16d0c8];return _0x5d3e6b;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var moment=require(_0xdf69('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf69('0x5'));var attributes=require(_0xdf69('0x6'));module[_0xdf69('0x7')]=function(_0x13ecb6,_0x177ff7){return _0x13ecb6[_0xdf69('0x8')](_0xdf69('0x9'),attributes,{'tableName':_0xdf69('0xa'),'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 b0f38f2..3ea5664 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 _0x86e6=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0x4ca99f,_0x464d1c){var _0x216622=function(_0x3afdc8){while(--_0x3afdc8){_0x4ca99f['push'](_0x4ca99f['shift']());}};_0x216622(++_0x464d1c);}(_0x86e6,0x1b1));var _0x686e=function(_0x11553f,_0x3495d4){_0x11553f=_0x11553f-0x0;var _0x1fba18=_0x86e6[_0x11553f];return _0x1fba18;};'use strict';var _=require(_0x686e('0x0'));var util=require(_0x686e('0x1'));var moment=require(_0x686e('0x2'));var BPromise=require('bluebird');var rs=require(_0x686e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x686e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x686e('0x5'))(_0x686e('0x6'));var config=require(_0x686e('0x7'));var jayson=require(_0x686e('0x8'));var client=jayson['client'][_0x686e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b70ac,_0x3fca1d,_0x5e7cac){return new BPromise(function(_0x506b33,_0x11273f){return client['request'](_0x1b70ac,_0x5e7cac)['then'](function(_0x53ec76){logger[_0x686e('0xa')](_0x686e('0xb'),_0x3fca1d,_0x686e('0xc'));logger['debug'](_0x686e('0xd'),_0x3fca1d,_0x686e('0xc'),JSON[_0x686e('0xe')](_0x53ec76));if(_0x53ec76[_0x686e('0xf')]){if(_0x53ec76[_0x686e('0xf')]['code']===0x1f4){logger[_0x686e('0xf')](_0x686e('0xb'),_0x3fca1d,_0x53ec76[_0x686e('0xf')][_0x686e('0x10')]);return _0x11273f(_0x53ec76[_0x686e('0xf')][_0x686e('0x10')]);}logger['error'](_0x686e('0xb'),_0x3fca1d,_0x53ec76['error']['message']);return _0x506b33(_0x53ec76[_0x686e('0xf')][_0x686e('0x10')]);}else{logger[_0x686e('0xa')](_0x686e('0xb'),_0x3fca1d,'request\x20sent');_0x506b33(_0x53ec76[_0x686e('0x11')][_0x686e('0x10')]);}})[_0x686e('0x12')](function(_0x5b67f0){logger[_0x686e('0xf')](_0x686e('0xb'),_0x3fca1d,_0x5b67f0);_0x11273f(_0x5b67f0);});});} \ No newline at end of file +var _0x66f3=['debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailServerOut,\x20%s,\x20%s','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','request\x20sent'];(function(_0x7cf8eb,_0x5a470e){var _0x24e417=function(_0x10caea){while(--_0x10caea){_0x7cf8eb['push'](_0x7cf8eb['shift']());}};_0x24e417(++_0x5a470e);}(_0x66f3,0x185));var _0x366f=function(_0x4f6afc,_0x4dfa88){_0x4f6afc=_0x4f6afc-0x0;var _0x256eeb=_0x66f3[_0x4f6afc];return _0x256eeb;};'use strict';var _=require(_0x366f('0x0'));var util=require(_0x366f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x366f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x366f('0x3'))['db'];var utils=require(_0x366f('0x4'));var logger=require('../../config/logger')(_0x366f('0x5'));var config=require('../../config/environment');var jayson=require(_0x366f('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ca82c,_0x350385,_0x57cbb2){return new BPromise(function(_0x516d21,_0x2aaf64){return client[_0x366f('0x7')](_0x1ca82c,_0x57cbb2)[_0x366f('0x8')](function(_0x47f71e){logger['info']('MailServerOut,\x20%s,\x20%s',_0x350385,_0x366f('0x9'));logger[_0x366f('0xa')](_0x366f('0xb'),_0x350385,_0x366f('0x9'),JSON[_0x366f('0xc')](_0x47f71e));if(_0x47f71e['error']){if(_0x47f71e[_0x366f('0xd')][_0x366f('0xe')]===0x1f4){logger['error']('MailServerOut,\x20%s,\x20%s',_0x350385,_0x47f71e[_0x366f('0xd')][_0x366f('0xf')]);return _0x2aaf64(_0x47f71e[_0x366f('0xd')][_0x366f('0xf')]);}logger[_0x366f('0xd')](_0x366f('0x10'),_0x350385,_0x47f71e[_0x366f('0xd')][_0x366f('0xf')]);return _0x516d21(_0x47f71e['error']['message']);}else{logger['info'](_0x366f('0x10'),_0x350385,'request\x20sent');_0x516d21(_0x47f71e[_0x366f('0x11')][_0x366f('0xf')]);}})[_0x366f('0x12')](function(_0x4a2bcb){logger[_0x366f('0xd')]('MailServerOut,\x20%s,\x20%s',_0x350385,_0x4a2bcb);_0x2aaf64(_0x4a2bcb);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index a8bccce..f188905 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 _0xe750=['post','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x420d8d,_0x78b67f){var _0x4865d7=function(_0x2965df){while(--_0x2965df){_0x420d8d['push'](_0x420d8d['shift']());}};_0x4865d7(++_0x78b67f);}(_0xe750,0x1df));var _0x0e75=function(_0x54fbc5,_0x346329){_0x54fbc5=_0x54fbc5-0x0;var _0x3e10f8=_0xe750[_0x54fbc5];return _0x3e10f8;};'use strict';var multer=require(_0x0e75('0x0'));var util=require(_0x0e75('0x1'));var path=require(_0x0e75('0x2'));var timeout=require(_0x0e75('0x3'));var express=require(_0x0e75('0x4'));var router=express[_0x0e75('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x0e75('0x6'));var config=require(_0x0e75('0x7'));var controller=require(_0x0e75('0x8'));router[_0x0e75('0x9')]('/',auth[_0x0e75('0xa')](),controller[_0x0e75('0xb')]);router['get'](_0x0e75('0xc'),auth[_0x0e75('0xa')](),controller['describe']);router['get'](_0x0e75('0xd'),auth[_0x0e75('0xa')](),controller[_0x0e75('0xe')]);router[_0x0e75('0xf')]('/',auth[_0x0e75('0xa')](),controller['create']);router[_0x0e75('0x10')](_0x0e75('0xd'),auth[_0x0e75('0xa')](),controller['update']);router[_0x0e75('0x11')]('/:id',auth[_0x0e75('0xa')](),controller['destroy']);module[_0x0e75('0x12')]=router; \ No newline at end of file +var _0x4973=['get','isAuthenticated','index','/describe','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0x49a99c,_0x5924a2){var _0x460b95=function(_0x3f6a96){while(--_0x3f6a96){_0x49a99c['push'](_0x49a99c['shift']());}};_0x460b95(++_0x5924a2);}(_0x4973,0x160));var _0x3497=function(_0x2187b0,_0x10504c){_0x2187b0=_0x2187b0-0x0;var _0x341dc1=_0x4973[_0x2187b0];return _0x341dc1;};'use strict';var multer=require(_0x3497('0x0'));var util=require(_0x3497('0x1'));var path=require(_0x3497('0x2'));var timeout=require(_0x3497('0x3'));var express=require(_0x3497('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3497('0x5'));var config=require(_0x3497('0x6'));var controller=require(_0x3497('0x7'));router[_0x3497('0x8')]('/',auth[_0x3497('0x9')](),controller[_0x3497('0xa')]);router[_0x3497('0x8')](_0x3497('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3497('0x8')]('/:id',auth[_0x3497('0x9')](),controller['show']);router[_0x3497('0xc')]('/',auth[_0x3497('0x9')](),controller[_0x3497('0xd')]);router[_0x3497('0xe')]('/:id',auth[_0x3497('0x9')](),controller['update']);router[_0x3497('0xf')]('/:id',auth[_0x3497('0x9')](),controller[_0x3497('0x10')]);module[_0x3497('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 7522d30..5b516e6 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 _0xee4e=['exports','STRING','sequelize'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0xee4e,0x122));var _0xeee4=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xee4e[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0xeee4('0x0'));module[_0xeee4('0x1')]={'name':{'type':Sequelize[_0xeee4('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeee4('0x2')]}}; \ No newline at end of file +var _0x0db9=['STRING','sequelize'];(function(_0x4e06bf,_0x5bf7de){var _0x1f17ae=function(_0x2f6ab8){while(--_0x2f6ab8){_0x4e06bf['push'](_0x4e06bf['shift']());}};_0x1f17ae(++_0x5bf7de);}(_0x0db9,0xa3));var _0x90db=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x0db9[_0x267d8d];return _0x11a98f;};'use strict';var Sequelize=require(_0x90db('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x90db('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 947d4e0..3f5e14b 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 _0x3831=['body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','offset','set','save','update','then','destroy','sendStatus','error','stack','name','MailSubstatus','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','merge','where','map','VIRTUAL','field','filter','options','findAll','rows','catch','show','params','includeAll','include','find','create'];(function(_0xf94d6a,_0x15536d){var _0x2ee03f=function(_0x1a6403){while(--_0x1a6403){_0xf94d6a['push'](_0xf94d6a['shift']());}};_0x2ee03f(++_0x15536d);}(_0x3831,0x14c));var _0x1383=function(_0x37473e,_0x4a1aa8){_0x37473e=_0x37473e-0x0;var _0x2635f7=_0x3831[_0x37473e];return _0x2635f7;};'use strict';var pdf=require(_0x1383('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1383('0x1'));var zipdir=require(_0x1383('0x2'));var jsonpatch=require(_0x1383('0x3'));var rp=require(_0x1383('0x4'));var moment=require(_0x1383('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1383('0x6'));var util=require('util');var path=require(_0x1383('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1383('0x8'));var squel=require('squel');var crypto=require(_0x1383('0x9'));var jsforce=require(_0x1383('0xa'));var deskjs=require(_0x1383('0xb'));var toCsv=require(_0x1383('0xc'));var querystring=require(_0x1383('0xd'));var Papa=require(_0x1383('0xe'));var authService=require(_0x1383('0xf'));var hardwareService=require(_0x1383('0x10'));var Redis=require('ioredis');var qs=require(_0x1383('0x11'));var logger=require(_0x1383('0x12'))(_0x1383('0x13'));var utils=require(_0x1383('0x14'));var config=require(_0x1383('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x275046,_0xbc12ea){_0xbc12ea=_0xbc12ea||0xcc;return function(_0x1d35fc){if(_0x1d35fc){return _0x275046['sendStatus'](_0xbc12ea);}return _0x275046['status'](_0xbc12ea)[_0x1383('0x16')]();};}function respondWithResult(_0x27b818,_0x43b1da){_0x43b1da=_0x43b1da||0xc8;return function(_0x1ba3d1){if(_0x1ba3d1){return _0x27b818[_0x1383('0x17')](_0x43b1da)[_0x1383('0x18')](_0x1ba3d1);}};}function respondWithFilteredResult(_0x42d869,_0x22895c){return function(_0x5e9ed9){if(_0x5e9ed9){var _0x7a50d0=_0x5e9ed9[_0x1383('0x19')],_0x1f46de=_0x22895c[_0x1383('0x1a')],_0x41d895=_0x22895c[_0x1383('0x1a')]+_0x22895c['limit'],_0x1c6d7b;if(_0x41d895>=_0x7a50d0){_0x41d895=_0x7a50d0;_0x1c6d7b=0xc8;}else{_0x1c6d7b=0xce;}_0x42d869['status'](_0x1c6d7b);return _0x42d869[_0x1383('0x1b')]('Content-Range',_0x1f46de+'-'+_0x41d895+'/'+_0x7a50d0)[_0x1383('0x18')](_0x5e9ed9);}return null;};}function patchUpdates(_0x5b3705){return function(_0x529d49){try{jsonpatch['apply'](_0x529d49,_0x5b3705,!![]);}catch(_0x1c8fe7){return BPromise['reject'](_0x1c8fe7);}return _0x529d49[_0x1383('0x1c')]();};}function saveUpdates(_0x57a840,_0x416986){return function(_0x1e6d5e){if(_0x1e6d5e){return _0x1e6d5e[_0x1383('0x1d')](_0x57a840)[_0x1383('0x1e')](function(_0x32fb05){return _0x32fb05;});}return null;};}function removeEntity(_0x3f0dcb,_0x315e42){return function(_0x10ed33){if(_0x10ed33){return _0x10ed33[_0x1383('0x1f')]()['then'](function(){_0x3f0dcb[_0x1383('0x17')](0xcc)[_0x1383('0x16')]();});}};}function handleEntityNotFound(_0x39fea2,_0x241c3d){return function(_0x186524){if(!_0x186524){_0x39fea2[_0x1383('0x20')](0x194);}return _0x186524;};}function handleError(_0x38f1d6,_0x4a50d5){_0x4a50d5=_0x4a50d5||0x1f4;return function(_0x5c4658){logger[_0x1383('0x21')](_0x5c4658[_0x1383('0x22')]);if(_0x5c4658[_0x1383('0x23')]){delete _0x5c4658[_0x1383('0x23')];}_0x38f1d6[_0x1383('0x17')](_0x4a50d5)['send'](_0x5c4658);};}exports['index']=function(_0x4a8b6e,_0xf6979a){var _0x128628={},_0x30877f={},_0x263aea={'count':0x0,'rows':[]};var _0x5866a1=db[_0x1383('0x24')]['rawAttributes'];_0x30877f[_0x1383('0x25')]=_[_0x1383('0x26')](_0x5866a1);_0x30877f[_0x1383('0x27')]=_[_0x1383('0x26')](_0x4a8b6e[_0x1383('0x27')]);_0x30877f[_0x1383('0x28')]=_[_0x1383('0x29')](_0x30877f[_0x1383('0x25')],_0x30877f[_0x1383('0x27')]);_0x128628[_0x1383('0x2a')]=_[_0x1383('0x29')](_0x30877f[_0x1383('0x25')],qs[_0x1383('0x2b')](_0x4a8b6e[_0x1383('0x27')]['fields']));_0x128628[_0x1383('0x2a')]=_0x128628[_0x1383('0x2a')][_0x1383('0x2c')]?_0x128628[_0x1383('0x2a')]:_0x30877f[_0x1383('0x25')];if(!_0x4a8b6e[_0x1383('0x27')]['hasOwnProperty'](_0x1383('0x2d'))){_0x128628[_0x1383('0x2e')]=qs[_0x1383('0x2e')](_0x4a8b6e[_0x1383('0x27')][_0x1383('0x2e')]);_0x128628[_0x1383('0x1a')]=qs['offset'](_0x4a8b6e[_0x1383('0x27')]['offset']);}_0x128628['order']=qs[_0x1383('0x2f')](_0x4a8b6e[_0x1383('0x27')][_0x1383('0x2f')]);_0x128628['where']=qs['filters'](_['pick'](_0x4a8b6e[_0x1383('0x27')],_0x30877f[_0x1383('0x28')]));if(_0x4a8b6e[_0x1383('0x27')]['filter']){_0x128628['where']=_[_0x1383('0x30')](_0x128628[_0x1383('0x31')],{'$or':_[_0x1383('0x32')](_0x5866a1,function(_0x1a3d12){if(_0x1a3d12['type']['key']!==_0x1383('0x33')){var _0x4c41c3={};_0x4c41c3[_0x1a3d12[_0x1383('0x34')]]={'$like':'%'+_0x4a8b6e[_0x1383('0x27')][_0x1383('0x35')]+'%'};return _0x4c41c3;}})});}_0x128628=_[_0x1383('0x30')]({},_0x128628,_0x4a8b6e[_0x1383('0x36')]);var _0x513619={'where':_0x128628[_0x1383('0x31')]};return db['MailSubstatus'][_0x1383('0x19')](_0x513619)[_0x1383('0x1e')](function(_0x384e54){_0x263aea['count']=_0x384e54;if(_0x4a8b6e[_0x1383('0x27')]['includeAll']){_0x128628['include']=[{'all':!![]}];}return db[_0x1383('0x24')][_0x1383('0x37')](_0x128628);})[_0x1383('0x1e')](function(_0x53bcb0){_0x263aea[_0x1383('0x38')]=_0x53bcb0;return _0x263aea;})[_0x1383('0x1e')](respondWithFilteredResult(_0xf6979a,_0x128628))[_0x1383('0x39')](handleError(_0xf6979a,null));};exports[_0x1383('0x3a')]=function(_0x56c269,_0x1ea73e){var _0x4c465e={'raw':!![],'where':{'id':_0x56c269[_0x1383('0x3b')]['id']}},_0x59aeb8={};_0x59aeb8[_0x1383('0x25')]=_['keys'](db['MailSubstatus']['rawAttributes']);_0x59aeb8[_0x1383('0x27')]=_[_0x1383('0x26')](_0x56c269[_0x1383('0x27')]);_0x59aeb8[_0x1383('0x28')]=_[_0x1383('0x29')](_0x59aeb8[_0x1383('0x25')],_0x59aeb8[_0x1383('0x27')]);_0x4c465e[_0x1383('0x2a')]=_[_0x1383('0x29')](_0x59aeb8['model'],qs[_0x1383('0x2b')](_0x56c269[_0x1383('0x27')][_0x1383('0x2b')]));_0x4c465e['attributes']=_0x4c465e[_0x1383('0x2a')]['length']?_0x4c465e[_0x1383('0x2a')]:_0x59aeb8[_0x1383('0x25')];if(_0x56c269[_0x1383('0x27')][_0x1383('0x3c')]){_0x4c465e[_0x1383('0x3d')]=[{'all':!![]}];}_0x4c465e=_[_0x1383('0x30')]({},_0x4c465e,_0x56c269[_0x1383('0x36')]);return db[_0x1383('0x24')][_0x1383('0x3e')](_0x4c465e)['then'](handleEntityNotFound(_0x1ea73e,null))['then'](respondWithResult(_0x1ea73e,null))['catch'](handleError(_0x1ea73e,null));};exports[_0x1383('0x3f')]=function(_0x38fa73,_0x3a8f5f){return db[_0x1383('0x24')][_0x1383('0x3f')](_0x38fa73[_0x1383('0x40')],{})['then'](respondWithResult(_0x3a8f5f,0xc9))[_0x1383('0x39')](handleError(_0x3a8f5f,null));};exports[_0x1383('0x1d')]=function(_0x406f39,_0x5663a7){if(_0x406f39[_0x1383('0x40')]['id']){delete _0x406f39[_0x1383('0x40')]['id'];}return db[_0x1383('0x24')][_0x1383('0x3e')]({'where':{'id':_0x406f39[_0x1383('0x3b')]['id']}})['then'](handleEntityNotFound(_0x5663a7,null))[_0x1383('0x1e')](saveUpdates(_0x406f39['body'],null))[_0x1383('0x1e')](respondWithResult(_0x5663a7,null))[_0x1383('0x39')](handleError(_0x5663a7,null));};exports['destroy']=function(_0x16c74e,_0x2e41c3){return db[_0x1383('0x24')][_0x1383('0x3e')]({'where':{'id':_0x16c74e[_0x1383('0x3b')]['id']}})[_0x1383('0x1e')](handleEntityNotFound(_0x2e41c3,null))[_0x1383('0x1e')](removeEntity(_0x2e41c3,null))[_0x1383('0x39')](handleError(_0x2e41c3,null));};exports[_0x1383('0x41')]=function(_0x79b64f,_0x4f1709){return db[_0x1383('0x24')][_0x1383('0x41')]()[_0x1383('0x1e')](respondWithResult(_0x4f1709,null))[_0x1383('0x39')](handleError(_0x4f1709,null));}; \ No newline at end of file +var _0x44c2=['request-promise','moment','bluebird','mustache','util','path','ejs','squel','desk.js','to-csv','papaparse','ioredis','../../config/logger','../../config/utils','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','name','send','index','MailSubstatus','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','type','VIRTUAL','field','findAll','catch','params','includeAll','include','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x4c2f30,_0xa91340){var _0xb8854d=function(_0x5ddf3d){while(--_0x5ddf3d){_0x4c2f30['push'](_0x4c2f30['shift']());}};_0xb8854d(++_0xa91340);}(_0x44c2,0x100));var _0x244c=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0x44c2[_0xad57ee];return _0x3eaea9;};'use strict';var pdf=require(_0x244c('0x0'));var emlformat=require(_0x244c('0x1'));var rimraf=require(_0x244c('0x2'));var zipdir=require(_0x244c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x244c('0x4'));var moment=require(_0x244c('0x5'));var BPromise=require(_0x244c('0x6'));var Mustache=require(_0x244c('0x7'));var util=require(_0x244c('0x8'));var path=require(_0x244c('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x244c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x244c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x244c('0xc'));var toCsv=require(_0x244c('0xd'));var querystring=require('querystring');var Papa=require(_0x244c('0xe'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x244c('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x244c('0x10'))('api');var utils=require(_0x244c('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe9b017,_0x313368){_0x313368=_0x313368||0xcc;return function(_0x2440d0){if(_0x2440d0){return _0xe9b017['sendStatus'](_0x313368);}return _0xe9b017[_0x244c('0x12')](_0x313368)[_0x244c('0x13')]();};}function respondWithResult(_0xc2602,_0x2ee162){_0x2ee162=_0x2ee162||0xc8;return function(_0x7785a7){if(_0x7785a7){return _0xc2602[_0x244c('0x12')](_0x2ee162)[_0x244c('0x14')](_0x7785a7);}};}function respondWithFilteredResult(_0x58f634,_0xb399e4){return function(_0x4c4001){if(_0x4c4001){var _0x50538b=_0x4c4001[_0x244c('0x15')],_0x151f1f=_0xb399e4['offset'],_0x94e7a4=_0xb399e4[_0x244c('0x16')]+_0xb399e4[_0x244c('0x17')],_0x2773e7;if(_0x94e7a4>=_0x50538b){_0x94e7a4=_0x50538b;_0x2773e7=0xc8;}else{_0x2773e7=0xce;}_0x58f634[_0x244c('0x12')](_0x2773e7);return _0x58f634[_0x244c('0x18')](_0x244c('0x19'),_0x151f1f+'-'+_0x94e7a4+'/'+_0x50538b)['json'](_0x4c4001);}return null;};}function patchUpdates(_0x3531b){return function(_0x2af7eb){try{jsonpatch[_0x244c('0x1a')](_0x2af7eb,_0x3531b,!![]);}catch(_0x5a7356){return BPromise['reject'](_0x5a7356);}return _0x2af7eb['save']();};}function saveUpdates(_0x330719,_0x1d9711){return function(_0x1ad17c){if(_0x1ad17c){return _0x1ad17c[_0x244c('0x1b')](_0x330719)[_0x244c('0x1c')](function(_0x2ed849){return _0x2ed849;});}return null;};}function removeEntity(_0x4b55af,_0x2b9691){return function(_0x2de472){if(_0x2de472){return _0x2de472[_0x244c('0x1d')]()['then'](function(){_0x4b55af[_0x244c('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bd46e,_0x458fc5){return function(_0x6aa1f4){if(!_0x6aa1f4){_0x4bd46e['sendStatus'](0x194);}return _0x6aa1f4;};}function handleError(_0x43c5af,_0x189e5e){_0x189e5e=_0x189e5e||0x1f4;return function(_0x2147bf){logger[_0x244c('0x1e')](_0x2147bf['stack']);if(_0x2147bf[_0x244c('0x1f')]){delete _0x2147bf[_0x244c('0x1f')];}_0x43c5af[_0x244c('0x12')](_0x189e5e)[_0x244c('0x20')](_0x2147bf);};}exports[_0x244c('0x21')]=function(_0x584d44,_0x5269cd){var _0x19c4fc={},_0x2f35a5={},_0x193c50={'count':0x0,'rows':[]};var _0x2e1bfc=db[_0x244c('0x22')][_0x244c('0x23')];_0x2f35a5[_0x244c('0x24')]=_[_0x244c('0x25')](_0x2e1bfc);_0x2f35a5[_0x244c('0x26')]=_[_0x244c('0x25')](_0x584d44['query']);_0x2f35a5['filters']=_[_0x244c('0x27')](_0x2f35a5[_0x244c('0x24')],_0x2f35a5[_0x244c('0x26')]);_0x19c4fc[_0x244c('0x28')]=_[_0x244c('0x27')](_0x2f35a5[_0x244c('0x24')],qs['fields'](_0x584d44[_0x244c('0x26')][_0x244c('0x29')]));_0x19c4fc[_0x244c('0x28')]=_0x19c4fc[_0x244c('0x28')][_0x244c('0x2a')]?_0x19c4fc[_0x244c('0x28')]:_0x2f35a5[_0x244c('0x24')];if(!_0x584d44[_0x244c('0x26')][_0x244c('0x2b')](_0x244c('0x2c'))){_0x19c4fc[_0x244c('0x17')]=qs[_0x244c('0x17')](_0x584d44['query'][_0x244c('0x17')]);_0x19c4fc[_0x244c('0x16')]=qs[_0x244c('0x16')](_0x584d44[_0x244c('0x26')][_0x244c('0x16')]);}_0x19c4fc[_0x244c('0x2d')]=qs[_0x244c('0x2e')](_0x584d44[_0x244c('0x26')]['sort']);_0x19c4fc[_0x244c('0x2f')]=qs[_0x244c('0x30')](_['pick'](_0x584d44[_0x244c('0x26')],_0x2f35a5[_0x244c('0x30')]));if(_0x584d44[_0x244c('0x26')][_0x244c('0x31')]){_0x19c4fc[_0x244c('0x2f')]=_[_0x244c('0x32')](_0x19c4fc[_0x244c('0x2f')],{'$or':_[_0x244c('0x33')](_0x2e1bfc,function(_0x10454a){if(_0x10454a[_0x244c('0x34')]['key']!==_0x244c('0x35')){var _0x1a32c8={};_0x1a32c8[_0x10454a[_0x244c('0x36')]]={'$like':'%'+_0x584d44[_0x244c('0x26')][_0x244c('0x31')]+'%'};return _0x1a32c8;}})});}_0x19c4fc=_['merge']({},_0x19c4fc,_0x584d44['options']);var _0x3e5a34={'where':_0x19c4fc['where']};return db[_0x244c('0x22')][_0x244c('0x15')](_0x3e5a34)[_0x244c('0x1c')](function(_0x1849b3){_0x193c50[_0x244c('0x15')]=_0x1849b3;if(_0x584d44[_0x244c('0x26')]['includeAll']){_0x19c4fc['include']=[{'all':!![]}];}return db[_0x244c('0x22')][_0x244c('0x37')](_0x19c4fc);})[_0x244c('0x1c')](function(_0x16c2d9){_0x193c50['rows']=_0x16c2d9;return _0x193c50;})[_0x244c('0x1c')](respondWithFilteredResult(_0x5269cd,_0x19c4fc))[_0x244c('0x38')](handleError(_0x5269cd,null));};exports['show']=function(_0xbb14b1,_0x543484){var _0x3d201d={'raw':!![],'where':{'id':_0xbb14b1[_0x244c('0x39')]['id']}},_0x2e09bc={};_0x2e09bc[_0x244c('0x24')]=_['keys'](db['MailSubstatus'][_0x244c('0x23')]);_0x2e09bc['query']=_[_0x244c('0x25')](_0xbb14b1[_0x244c('0x26')]);_0x2e09bc[_0x244c('0x30')]=_[_0x244c('0x27')](_0x2e09bc[_0x244c('0x24')],_0x2e09bc[_0x244c('0x26')]);_0x3d201d[_0x244c('0x28')]=_['intersection'](_0x2e09bc[_0x244c('0x24')],qs[_0x244c('0x29')](_0xbb14b1[_0x244c('0x26')][_0x244c('0x29')]));_0x3d201d[_0x244c('0x28')]=_0x3d201d[_0x244c('0x28')][_0x244c('0x2a')]?_0x3d201d[_0x244c('0x28')]:_0x2e09bc[_0x244c('0x24')];if(_0xbb14b1[_0x244c('0x26')][_0x244c('0x3a')]){_0x3d201d[_0x244c('0x3b')]=[{'all':!![]}];}_0x3d201d=_[_0x244c('0x32')]({},_0x3d201d,_0xbb14b1[_0x244c('0x3c')]);return db[_0x244c('0x22')][_0x244c('0x3d')](_0x3d201d)[_0x244c('0x1c')](handleEntityNotFound(_0x543484,null))[_0x244c('0x1c')](respondWithResult(_0x543484,null))[_0x244c('0x38')](handleError(_0x543484,null));};exports['create']=function(_0x5a2508,_0x21fc79){return db[_0x244c('0x22')][_0x244c('0x3e')](_0x5a2508[_0x244c('0x3f')],{})['then'](respondWithResult(_0x21fc79,0xc9))[_0x244c('0x38')](handleError(_0x21fc79,null));};exports[_0x244c('0x1b')]=function(_0x6f340d,_0x240342){if(_0x6f340d[_0x244c('0x3f')]['id']){delete _0x6f340d[_0x244c('0x3f')]['id'];}return db[_0x244c('0x22')][_0x244c('0x3d')]({'where':{'id':_0x6f340d['params']['id']}})[_0x244c('0x1c')](handleEntityNotFound(_0x240342,null))['then'](saveUpdates(_0x6f340d[_0x244c('0x3f')],null))[_0x244c('0x1c')](respondWithResult(_0x240342,null))['catch'](handleError(_0x240342,null));};exports[_0x244c('0x1d')]=function(_0x21c9e9,_0x22219f){return db[_0x244c('0x22')]['find']({'where':{'id':_0x21c9e9[_0x244c('0x39')]['id']}})[_0x244c('0x1c')](handleEntityNotFound(_0x22219f,null))[_0x244c('0x1c')](removeEntity(_0x22219f,null))[_0x244c('0x38')](handleError(_0x22219f,null));};exports[_0x244c('0x40')]=function(_0x1a2968,_0x58f136){return db['MailSubstatus'][_0x244c('0x40')]()[_0x244c('0x1c')](respondWithResult(_0x58f136,null))[_0x244c('0x38')](handleError(_0x58f136,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 602c511..a793e5c 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 _0xd969=['moment','bluebird','request-promise','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api'];(function(_0x4e4741,_0x473f01){var _0x1c61ad=function(_0x182ee5){while(--_0x182ee5){_0x4e4741['push'](_0x4e4741['shift']());}};_0x1c61ad(++_0x473f01);}(_0xd969,0x68));var _0x9d96=function(_0x5df61d,_0x158640){_0x5df61d=_0x5df61d-0x0;var _0x24cc4c=_0xd969[_0x5df61d];return _0x24cc4c;};'use strict';var _=require(_0x9d96('0x0'));var util=require(_0x9d96('0x1'));var logger=require(_0x9d96('0x2'))(_0x9d96('0x3'));var moment=require(_0x9d96('0x4'));var BPromise=require(_0x9d96('0x5'));var rp=require(_0x9d96('0x6'));var attributes=require(_0x9d96('0x7'));module[_0x9d96('0x8')]=function(_0x793804,_0x450476){return _0x793804[_0x9d96('0x9')](_0x9d96('0xa'),attributes,{'tableName':_0x9d96('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x141b=['exports','define','MailSubstatus','lodash','util','api','moment','request-promise','./mailSubstatus.attributes'];(function(_0x4bbdbe,_0x24e1fa){var _0xe4a7d8=function(_0x412cb5){while(--_0x412cb5){_0x4bbdbe['push'](_0x4bbdbe['shift']());}};_0xe4a7d8(++_0x24e1fa);}(_0x141b,0x17d));var _0xb141=function(_0x1144bb,_0x305bba){_0x1144bb=_0x1144bb-0x0;var _0x15e4b0=_0x141b[_0x1144bb];return _0x15e4b0;};'use strict';var _=require(_0xb141('0x0'));var util=require(_0xb141('0x1'));var logger=require('../../config/logger')(_0xb141('0x2'));var moment=require(_0xb141('0x3'));var BPromise=require('bluebird');var rp=require(_0xb141('0x4'));var attributes=require(_0xb141('0x5'));module[_0xb141('0x6')]=function(_0x36f828,_0x1f6e73){return _0x36f828[_0xb141('0x7')](_0xb141('0x8'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 5a930a1..b775417 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 _0x83b4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','bluebird'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0x83b4,0x111));var _0x483b=function(_0x155bf8,_0x13c4c0){_0x155bf8=_0x155bf8-0x0;var _0x43114e=_0x83b4[_0x155bf8];return _0x43114e;};'use strict';var _=require(_0x483b('0x0'));var util=require(_0x483b('0x1'));var moment=require('moment');var BPromise=require(_0x483b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x483b('0x3'));var db=require(_0x483b('0x4'))['db'];var utils=require(_0x483b('0x5'));var logger=require(_0x483b('0x6'))(_0x483b('0x7'));var config=require(_0x483b('0x8'));var jayson=require(_0x483b('0x9'));var client=jayson[_0x483b('0xa')][_0x483b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd22c19,_0x38d649,_0x22e9c9){return new BPromise(function(_0x4a56fb,_0x43b05b){return client[_0x483b('0xc')](_0xd22c19,_0x22e9c9)[_0x483b('0xd')](function(_0xc679b9){logger['info'](_0x483b('0xe'),_0x38d649,_0x483b('0xf'));logger[_0x483b('0x10')](_0x483b('0x11'),_0x38d649,_0x483b('0xf'),JSON[_0x483b('0x12')](_0xc679b9));if(_0xc679b9[_0x483b('0x13')]){if(_0xc679b9[_0x483b('0x13')]['code']===0x1f4){logger[_0x483b('0x13')](_0x483b('0xe'),_0x38d649,_0xc679b9[_0x483b('0x13')][_0x483b('0x14')]);return _0x43b05b(_0xc679b9[_0x483b('0x13')][_0x483b('0x14')]);}logger[_0x483b('0x13')](_0x483b('0xe'),_0x38d649,_0xc679b9[_0x483b('0x13')][_0x483b('0x14')]);return _0x4a56fb(_0xc679b9['error'][_0x483b('0x14')]);}else{logger[_0x483b('0x15')](_0x483b('0xe'),_0x38d649,_0x483b('0xf'));_0x4a56fb(_0xc679b9[_0x483b('0x16')][_0x483b('0x14')]);}})['catch'](function(_0x1d07ac){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x38d649,_0x1d07ac);_0x43b05b(_0x1d07ac);});});} \ No newline at end of file +var _0xb6ca=['MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb6ca,0x166));var _0xab6c=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xb6ca[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xab6c('0x0'));var util=require('util');var moment=require(_0xab6c('0x1'));var BPromise=require(_0xab6c('0x2'));var rs=require(_0xab6c('0x3'));var fs=require('fs');var Redis=require(_0xab6c('0x4'));var db=require(_0xab6c('0x5'))['db'];var utils=require(_0xab6c('0x6'));var logger=require(_0xab6c('0x7'))(_0xab6c('0x8'));var config=require(_0xab6c('0x9'));var jayson=require(_0xab6c('0xa'));var client=jayson[_0xab6c('0xb')][_0xab6c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x454a54,_0x487483,_0xa7aef4){return new BPromise(function(_0x8f2579,_0x53481c){return client[_0xab6c('0xd')](_0x454a54,_0xa7aef4)[_0xab6c('0xe')](function(_0x3745cb){logger[_0xab6c('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x487483,'request\x20sent');logger[_0xab6c('0x10')](_0xab6c('0x11'),_0x487483,_0xab6c('0x12'),JSON[_0xab6c('0x13')](_0x3745cb));if(_0x3745cb['error']){if(_0x3745cb[_0xab6c('0x14')][_0xab6c('0x15')]===0x1f4){logger[_0xab6c('0x14')](_0xab6c('0x16'),_0x487483,_0x3745cb[_0xab6c('0x14')]['message']);return _0x53481c(_0x3745cb[_0xab6c('0x14')][_0xab6c('0x17')]);}logger[_0xab6c('0x14')](_0xab6c('0x16'),_0x487483,_0x3745cb['error'][_0xab6c('0x17')]);return _0x8f2579(_0x3745cb[_0xab6c('0x14')][_0xab6c('0x17')]);}else{logger[_0xab6c('0xf')](_0xab6c('0x16'),_0x487483,_0xab6c('0x12'));_0x8f2579(_0x3745cb[_0xab6c('0x18')][_0xab6c('0x17')]);}})['catch'](function(_0x4392c1){logger[_0xab6c('0x14')](_0xab6c('0x16'),_0x487483,_0x4392c1);_0x53481c(_0x4392c1);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 617b40d..3d82852 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 _0xcaaf=['post','create','delete','/:id','destroy','exports','multer','path','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0x11c090,_0x7d8e4e){var _0x444c13=function(_0x2fd312){while(--_0x2fd312){_0x11c090['push'](_0x11c090['shift']());}};_0x444c13(++_0x7d8e4e);}(_0xcaaf,0x66));var _0xfcaa=function(_0x5b6dec,_0x17c5bc){_0x5b6dec=_0x5b6dec-0x0;var _0x2924dd=_0xcaaf[_0x5b6dec];return _0x2924dd;};'use strict';var multer=require(_0xfcaa('0x0'));var util=require('util');var path=require(_0xfcaa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfcaa('0x2')]();var auth=require(_0xfcaa('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfcaa('0x4'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0xfcaa('0x5')](),controller[_0xfcaa('0x6')]);router[_0xfcaa('0x7')](_0xfcaa('0x8'),auth[_0xfcaa('0x5')](),controller[_0xfcaa('0x9')]);router[_0xfcaa('0x7')]('/:id',auth[_0xfcaa('0x5')](),controller['show']);router[_0xfcaa('0xa')]('/',auth['isAuthenticated'](),controller[_0xfcaa('0xb')]);router['put']('/:id',auth[_0xfcaa('0x5')](),controller['update']);router[_0xfcaa('0xc')](_0xfcaa('0xd'),auth[_0xfcaa('0x5')](),controller[_0xfcaa('0xe')]);module[_0xfcaa('0xf')]=router; \ No newline at end of file +var _0xf072=['update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x4c2693,_0xcbe941){var _0x8335e2=function(_0x1242fa){while(--_0x1242fa){_0x4c2693['push'](_0x4c2693['shift']());}};_0x8335e2(++_0xcbe941);}(_0xf072,0x1cf));var _0x2f07=function(_0x211d06,_0x10d6f2){_0x211d06=_0x211d06-0x0;var _0x15cd9d=_0xf072[_0x211d06];return _0x15cd9d;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var auth=require(_0x2f07('0x4'));var interaction=require(_0x2f07('0x5'));var config=require(_0x2f07('0x6'));var controller=require('./mailTransferReport.controller');router[_0x2f07('0x7')]('/',auth[_0x2f07('0x8')](),controller[_0x2f07('0x9')]);router[_0x2f07('0x7')](_0x2f07('0xa'),auth[_0x2f07('0x8')](),controller[_0x2f07('0xb')]);router[_0x2f07('0x7')](_0x2f07('0xc'),auth[_0x2f07('0x8')](),controller[_0x2f07('0xd')]);router[_0x2f07('0xe')]('/',auth[_0x2f07('0x8')](),controller[_0x2f07('0xf')]);router[_0x2f07('0x10')]('/:id',auth[_0x2f07('0x8')](),controller[_0x2f07('0x11')]);router[_0x2f07('0x12')](_0x2f07('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x2f07('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 71e4451..e7c42db 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 _0x27b9=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','agent','queue'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x27b9,0x80));var _0x927b=function(_0x4a75f9,_0x3aad60){_0x4a75f9=_0x4a75f9-0x0;var _0x2bb528=_0x27b9[_0x4a75f9];return _0x2bb528;};'use strict';var moment=require(_0x927b('0x0'));var Sequelize=require(_0x927b('0x1'));module[_0x927b('0x2')]={'uniqueid':{'type':Sequelize[_0x927b('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x927b('0x4')]('account',_0x927b('0x5'),_0x927b('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x927b('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x927b('0x8')]}}; \ No newline at end of file +var _0x71d4=['queue','DATE','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x380198,_0x24c368){var _0x119a5d=function(_0xbee9d0){while(--_0xbee9d0){_0x380198['push'](_0x380198['shift']());}};_0x119a5d(++_0x24c368);}(_0x71d4,0xca));var _0x471d=function(_0x5a9666,_0x30bc94){_0x5a9666=_0x5a9666-0x0;var _0x28601f=_0x71d4[_0x5a9666];return _0x28601f;};'use strict';var moment=require(_0x471d('0x0'));var Sequelize=require(_0x471d('0x1'));module[_0x471d('0x2')]={'uniqueid':{'type':Sequelize[_0x471d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x471d('0x4')](_0x471d('0x5'),'agent',_0x471d('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x471d('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 862a2af..81de540 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 _0x9ffd=['sendStatus','stack','name','send','index','MailTransferReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','key','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x49088a,_0xa2b35c){var _0x3a522d=function(_0x19cf27){while(--_0x19cf27){_0x49088a['push'](_0x49088a['shift']());}};_0x3a522d(++_0xa2b35c);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x453a99,_0x170575){_0x453a99=_0x453a99-0x0;var _0x2423df=_0x9ffd[_0x453a99];return _0x2423df;};'use strict';var pdf=require(_0xd9ff('0x0'));var emlformat=require(_0xd9ff('0x1'));var rimraf=require(_0xd9ff('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9ff('0x3'));var rp=require(_0xd9ff('0x4'));var moment=require(_0xd9ff('0x5'));var BPromise=require(_0xd9ff('0x6'));var Mustache=require('mustache');var util=require(_0xd9ff('0x7'));var path=require(_0xd9ff('0x8'));var sox=require('sox');var csv=require(_0xd9ff('0x9'));var ejs=require(_0xd9ff('0xa'));var fs=require('fs');var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x9'));var querystring=require(_0xd9ff('0x10'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xd9ff('0x11'));var logger=require(_0xd9ff('0x12'))(_0xd9ff('0x13'));var utils=require(_0xd9ff('0x14'));var config=require(_0xd9ff('0x15'));var db=require(_0xd9ff('0x16'))['db'];function respondWithStatusCode(_0x1885da,_0x1c2a16){_0x1c2a16=_0x1c2a16||0xcc;return function(_0x47d842){if(_0x47d842){return _0x1885da['sendStatus'](_0x1c2a16);}return _0x1885da[_0xd9ff('0x17')](_0x1c2a16)[_0xd9ff('0x18')]();};}function respondWithResult(_0x415c58,_0x350a5d){_0x350a5d=_0x350a5d||0xc8;return function(_0x12c39a){if(_0x12c39a){return _0x415c58['status'](_0x350a5d)[_0xd9ff('0x19')](_0x12c39a);}};}function respondWithFilteredResult(_0x3c9ace,_0x5c1a28){return function(_0xf14c9f){if(_0xf14c9f){var _0x5db010=_0xf14c9f[_0xd9ff('0x1a')],_0x4ffe54=_0x5c1a28['offset'],_0x547e28=_0x5c1a28[_0xd9ff('0x1b')]+_0x5c1a28[_0xd9ff('0x1c')],_0x4c5718;if(_0x547e28>=_0x5db010){_0x547e28=_0x5db010;_0x4c5718=0xc8;}else{_0x4c5718=0xce;}_0x3c9ace[_0xd9ff('0x17')](_0x4c5718);return _0x3c9ace[_0xd9ff('0x1d')](_0xd9ff('0x1e'),_0x4ffe54+'-'+_0x547e28+'/'+_0x5db010)[_0xd9ff('0x19')](_0xf14c9f);}return null;};}function patchUpdates(_0x3ccf15){return function(_0x128588){try{jsonpatch[_0xd9ff('0x1f')](_0x128588,_0x3ccf15,!![]);}catch(_0x1f028f){return BPromise[_0xd9ff('0x20')](_0x1f028f);}return _0x128588[_0xd9ff('0x21')]();};}function saveUpdates(_0x46a6ab,_0x4c8740){return function(_0x4cf8ec){if(_0x4cf8ec){return _0x4cf8ec[_0xd9ff('0x22')](_0x46a6ab)[_0xd9ff('0x23')](function(_0x4eea4d){return _0x4eea4d;});}return null;};}function removeEntity(_0x588151,_0x5ab7b6){return function(_0x4b1477){if(_0x4b1477){return _0x4b1477[_0xd9ff('0x24')]()['then'](function(){_0x588151[_0xd9ff('0x17')](0xcc)[_0xd9ff('0x18')]();});}};}function handleEntityNotFound(_0x291f52,_0x9f074e){return function(_0x278b66){if(!_0x278b66){_0x291f52[_0xd9ff('0x25')](0x194);}return _0x278b66;};}function handleError(_0x4b058a,_0x4fada1){_0x4fada1=_0x4fada1||0x1f4;return function(_0x1136e9){logger['error'](_0x1136e9[_0xd9ff('0x26')]);if(_0x1136e9['name']){delete _0x1136e9[_0xd9ff('0x27')];}_0x4b058a['status'](_0x4fada1)[_0xd9ff('0x28')](_0x1136e9);};}exports[_0xd9ff('0x29')]=function(_0x2138b4,_0x2970e8){var _0x5d685e={},_0x11a17b={},_0xe11f88={'count':0x0,'rows':[]};var _0x1c78c4=db[_0xd9ff('0x2a')]['rawAttributes'];_0x11a17b[_0xd9ff('0x2b')]=_[_0xd9ff('0x2c')](_0x1c78c4);_0x11a17b[_0xd9ff('0x2d')]=_[_0xd9ff('0x2c')](_0x2138b4[_0xd9ff('0x2d')]);_0x11a17b[_0xd9ff('0x2e')]=_[_0xd9ff('0x2f')](_0x11a17b[_0xd9ff('0x2b')],_0x11a17b[_0xd9ff('0x2d')]);_0x5d685e['attributes']=_[_0xd9ff('0x2f')](_0x11a17b['model'],qs[_0xd9ff('0x30')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x30')]));_0x5d685e['attributes']=_0x5d685e[_0xd9ff('0x31')][_0xd9ff('0x32')]?_0x5d685e[_0xd9ff('0x31')]:_0x11a17b[_0xd9ff('0x2b')];if(!_0x2138b4['query'][_0xd9ff('0x33')]('nolimit')){_0x5d685e[_0xd9ff('0x1c')]=qs[_0xd9ff('0x1c')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x1c')]);_0x5d685e[_0xd9ff('0x1b')]=qs[_0xd9ff('0x1b')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x1b')]);}_0x5d685e[_0xd9ff('0x34')]=qs[_0xd9ff('0x35')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x5d685e[_0xd9ff('0x36')]=qs[_0xd9ff('0x2e')](_['pick'](_0x2138b4[_0xd9ff('0x2d')],_0x11a17b[_0xd9ff('0x2e')]));if(_0x2138b4[_0xd9ff('0x2d')]['filter']){_0x5d685e[_0xd9ff('0x36')]=_['merge'](_0x5d685e[_0xd9ff('0x36')],{'$or':_['map'](_0x1c78c4,function(_0x20a021){if(_0x20a021['type'][_0xd9ff('0x37')]!==_0xd9ff('0x38')){var _0x11566b={};_0x11566b[_0x20a021['field']]={'$like':'%'+_0x2138b4['query']['filter']+'%'};return _0x11566b;}})});}_0x5d685e=_[_0xd9ff('0x39')]({},_0x5d685e,_0x2138b4[_0xd9ff('0x3a')]);var _0x405c3b={'where':_0x5d685e[_0xd9ff('0x36')]};return db[_0xd9ff('0x2a')][_0xd9ff('0x1a')](_0x405c3b)['then'](function(_0x4c00c2){_0xe11f88['count']=_0x4c00c2;if(_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x3b')]){_0x5d685e[_0xd9ff('0x3c')]=[{'all':!![]}];}return db[_0xd9ff('0x2a')]['findAll'](_0x5d685e);})[_0xd9ff('0x23')](function(_0x5b8e17){_0xe11f88[_0xd9ff('0x3d')]=_0x5b8e17;return _0xe11f88;})[_0xd9ff('0x23')](respondWithFilteredResult(_0x2970e8,_0x5d685e))[_0xd9ff('0x3e')](handleError(_0x2970e8,null));};exports[_0xd9ff('0x3f')]=function(_0x59fc07,_0x1e34da){var _0x2d4d97={'raw':!![],'where':{'id':_0x59fc07[_0xd9ff('0x40')]['id']}},_0x4961a7={};_0x4961a7[_0xd9ff('0x2b')]=_[_0xd9ff('0x2c')](db[_0xd9ff('0x2a')][_0xd9ff('0x41')]);_0x4961a7[_0xd9ff('0x2d')]=_['keys'](_0x59fc07[_0xd9ff('0x2d')]);_0x4961a7[_0xd9ff('0x2e')]=_[_0xd9ff('0x2f')](_0x4961a7[_0xd9ff('0x2b')],_0x4961a7[_0xd9ff('0x2d')]);_0x2d4d97['attributes']=_[_0xd9ff('0x2f')](_0x4961a7[_0xd9ff('0x2b')],qs[_0xd9ff('0x30')](_0x59fc07['query']['fields']));_0x2d4d97[_0xd9ff('0x31')]=_0x2d4d97[_0xd9ff('0x31')][_0xd9ff('0x32')]?_0x2d4d97[_0xd9ff('0x31')]:_0x4961a7[_0xd9ff('0x2b')];if(_0x59fc07[_0xd9ff('0x2d')]['includeAll']){_0x2d4d97[_0xd9ff('0x3c')]=[{'all':!![]}];}_0x2d4d97=_[_0xd9ff('0x39')]({},_0x2d4d97,_0x59fc07['options']);return db[_0xd9ff('0x2a')][_0xd9ff('0x42')](_0x2d4d97)[_0xd9ff('0x23')](handleEntityNotFound(_0x1e34da,null))[_0xd9ff('0x23')](respondWithResult(_0x1e34da,null))[_0xd9ff('0x3e')](handleError(_0x1e34da,null));};exports['create']=function(_0x5cf34e,_0x5718ab){return db[_0xd9ff('0x2a')]['create'](_0x5cf34e[_0xd9ff('0x43')],{})[_0xd9ff('0x23')](respondWithResult(_0x5718ab,0xc9))[_0xd9ff('0x3e')](handleError(_0x5718ab,null));};exports['update']=function(_0x396736,_0x153f09){if(_0x396736['body']['id']){delete _0x396736[_0xd9ff('0x43')]['id'];}return db[_0xd9ff('0x2a')][_0xd9ff('0x42')]({'where':{'id':_0x396736[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0x153f09,null))[_0xd9ff('0x23')](saveUpdates(_0x396736['body'],null))[_0xd9ff('0x23')](respondWithResult(_0x153f09,null))['catch'](handleError(_0x153f09,null));};exports[_0xd9ff('0x24')]=function(_0x3d91e6,_0x2bf37a){return db[_0xd9ff('0x2a')][_0xd9ff('0x42')]({'where':{'id':_0x3d91e6['params']['id']}})[_0xd9ff('0x23')](handleEntityNotFound(_0x2bf37a,null))[_0xd9ff('0x23')](removeEntity(_0x2bf37a,null))[_0xd9ff('0x3e')](handleError(_0x2bf37a,null));};exports[_0xd9ff('0x44')]=function(_0x5c3e11,_0x537282){return db['MailTransferReport'][_0xd9ff('0x44')]()[_0xd9ff('0x23')](respondWithResult(_0x537282,null))[_0xd9ff('0x3e')](handleError(_0x537282,null));}; \ No newline at end of file +var _0x9ffd=['sendStatus','stack','name','send','index','MailTransferReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','key','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x24ffa5,_0x119b94){var _0x1f0a5f=function(_0x3c013f){while(--_0x3c013f){_0x24ffa5['push'](_0x24ffa5['shift']());}};_0x1f0a5f(++_0x119b94);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1c3ff7,_0x3f904e){_0x1c3ff7=_0x1c3ff7-0x0;var _0x30bd90=_0x9ffd[_0x1c3ff7];return _0x30bd90;};'use strict';var pdf=require(_0xd9ff('0x0'));var emlformat=require(_0xd9ff('0x1'));var rimraf=require(_0xd9ff('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9ff('0x3'));var rp=require(_0xd9ff('0x4'));var moment=require(_0xd9ff('0x5'));var BPromise=require(_0xd9ff('0x6'));var Mustache=require('mustache');var util=require(_0xd9ff('0x7'));var path=require(_0xd9ff('0x8'));var sox=require('sox');var csv=require(_0xd9ff('0x9'));var ejs=require(_0xd9ff('0xa'));var fs=require('fs');var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x9'));var querystring=require(_0xd9ff('0x10'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0xd9ff('0x11'));var logger=require(_0xd9ff('0x12'))(_0xd9ff('0x13'));var utils=require(_0xd9ff('0x14'));var config=require(_0xd9ff('0x15'));var db=require(_0xd9ff('0x16'))['db'];function respondWithStatusCode(_0x1885da,_0x1c2a16){_0x1c2a16=_0x1c2a16||0xcc;return function(_0x47d842){if(_0x47d842){return _0x1885da['sendStatus'](_0x1c2a16);}return _0x1885da[_0xd9ff('0x17')](_0x1c2a16)[_0xd9ff('0x18')]();};}function respondWithResult(_0x415c58,_0x350a5d){_0x350a5d=_0x350a5d||0xc8;return function(_0x12c39a){if(_0x12c39a){return _0x415c58['status'](_0x350a5d)[_0xd9ff('0x19')](_0x12c39a);}};}function respondWithFilteredResult(_0x3c9ace,_0x5c1a28){return function(_0xf14c9f){if(_0xf14c9f){var _0x5db010=_0xf14c9f[_0xd9ff('0x1a')],_0x4ffe54=_0x5c1a28['offset'],_0x547e28=_0x5c1a28[_0xd9ff('0x1b')]+_0x5c1a28[_0xd9ff('0x1c')],_0x4c5718;if(_0x547e28>=_0x5db010){_0x547e28=_0x5db010;_0x4c5718=0xc8;}else{_0x4c5718=0xce;}_0x3c9ace[_0xd9ff('0x17')](_0x4c5718);return _0x3c9ace[_0xd9ff('0x1d')](_0xd9ff('0x1e'),_0x4ffe54+'-'+_0x547e28+'/'+_0x5db010)[_0xd9ff('0x19')](_0xf14c9f);}return null;};}function patchUpdates(_0x3ccf15){return function(_0x128588){try{jsonpatch[_0xd9ff('0x1f')](_0x128588,_0x3ccf15,!![]);}catch(_0x1f028f){return BPromise[_0xd9ff('0x20')](_0x1f028f);}return _0x128588[_0xd9ff('0x21')]();};}function saveUpdates(_0x46a6ab,_0x4c8740){return function(_0x4cf8ec){if(_0x4cf8ec){return _0x4cf8ec[_0xd9ff('0x22')](_0x46a6ab)[_0xd9ff('0x23')](function(_0x4eea4d){return _0x4eea4d;});}return null;};}function removeEntity(_0x588151,_0x5ab7b6){return function(_0x4b1477){if(_0x4b1477){return _0x4b1477[_0xd9ff('0x24')]()['then'](function(){_0x588151[_0xd9ff('0x17')](0xcc)[_0xd9ff('0x18')]();});}};}function handleEntityNotFound(_0x291f52,_0x9f074e){return function(_0x278b66){if(!_0x278b66){_0x291f52[_0xd9ff('0x25')](0x194);}return _0x278b66;};}function handleError(_0x4b058a,_0x4fada1){_0x4fada1=_0x4fada1||0x1f4;return function(_0x1136e9){logger['error'](_0x1136e9[_0xd9ff('0x26')]);if(_0x1136e9['name']){delete _0x1136e9[_0xd9ff('0x27')];}_0x4b058a['status'](_0x4fada1)[_0xd9ff('0x28')](_0x1136e9);};}exports[_0xd9ff('0x29')]=function(_0x2138b4,_0x2970e8){var _0x5d685e={},_0x11a17b={},_0xe11f88={'count':0x0,'rows':[]};var _0x1c78c4=db[_0xd9ff('0x2a')]['rawAttributes'];_0x11a17b[_0xd9ff('0x2b')]=_[_0xd9ff('0x2c')](_0x1c78c4);_0x11a17b[_0xd9ff('0x2d')]=_[_0xd9ff('0x2c')](_0x2138b4[_0xd9ff('0x2d')]);_0x11a17b[_0xd9ff('0x2e')]=_[_0xd9ff('0x2f')](_0x11a17b[_0xd9ff('0x2b')],_0x11a17b[_0xd9ff('0x2d')]);_0x5d685e['attributes']=_[_0xd9ff('0x2f')](_0x11a17b['model'],qs[_0xd9ff('0x30')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x30')]));_0x5d685e['attributes']=_0x5d685e[_0xd9ff('0x31')][_0xd9ff('0x32')]?_0x5d685e[_0xd9ff('0x31')]:_0x11a17b[_0xd9ff('0x2b')];if(!_0x2138b4['query'][_0xd9ff('0x33')]('nolimit')){_0x5d685e[_0xd9ff('0x1c')]=qs[_0xd9ff('0x1c')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x1c')]);_0x5d685e[_0xd9ff('0x1b')]=qs[_0xd9ff('0x1b')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x1b')]);}_0x5d685e[_0xd9ff('0x34')]=qs[_0xd9ff('0x35')](_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x5d685e[_0xd9ff('0x36')]=qs[_0xd9ff('0x2e')](_['pick'](_0x2138b4[_0xd9ff('0x2d')],_0x11a17b[_0xd9ff('0x2e')]));if(_0x2138b4[_0xd9ff('0x2d')]['filter']){_0x5d685e[_0xd9ff('0x36')]=_['merge'](_0x5d685e[_0xd9ff('0x36')],{'$or':_['map'](_0x1c78c4,function(_0x20a021){if(_0x20a021['type'][_0xd9ff('0x37')]!==_0xd9ff('0x38')){var _0x11566b={};_0x11566b[_0x20a021['field']]={'$like':'%'+_0x2138b4['query']['filter']+'%'};return _0x11566b;}})});}_0x5d685e=_[_0xd9ff('0x39')]({},_0x5d685e,_0x2138b4[_0xd9ff('0x3a')]);var _0x405c3b={'where':_0x5d685e[_0xd9ff('0x36')]};return db[_0xd9ff('0x2a')][_0xd9ff('0x1a')](_0x405c3b)['then'](function(_0x4c00c2){_0xe11f88['count']=_0x4c00c2;if(_0x2138b4[_0xd9ff('0x2d')][_0xd9ff('0x3b')]){_0x5d685e[_0xd9ff('0x3c')]=[{'all':!![]}];}return db[_0xd9ff('0x2a')]['findAll'](_0x5d685e);})[_0xd9ff('0x23')](function(_0x5b8e17){_0xe11f88[_0xd9ff('0x3d')]=_0x5b8e17;return _0xe11f88;})[_0xd9ff('0x23')](respondWithFilteredResult(_0x2970e8,_0x5d685e))[_0xd9ff('0x3e')](handleError(_0x2970e8,null));};exports[_0xd9ff('0x3f')]=function(_0x59fc07,_0x1e34da){var _0x2d4d97={'raw':!![],'where':{'id':_0x59fc07[_0xd9ff('0x40')]['id']}},_0x4961a7={};_0x4961a7[_0xd9ff('0x2b')]=_[_0xd9ff('0x2c')](db[_0xd9ff('0x2a')][_0xd9ff('0x41')]);_0x4961a7[_0xd9ff('0x2d')]=_['keys'](_0x59fc07[_0xd9ff('0x2d')]);_0x4961a7[_0xd9ff('0x2e')]=_[_0xd9ff('0x2f')](_0x4961a7[_0xd9ff('0x2b')],_0x4961a7[_0xd9ff('0x2d')]);_0x2d4d97['attributes']=_[_0xd9ff('0x2f')](_0x4961a7[_0xd9ff('0x2b')],qs[_0xd9ff('0x30')](_0x59fc07['query']['fields']));_0x2d4d97[_0xd9ff('0x31')]=_0x2d4d97[_0xd9ff('0x31')][_0xd9ff('0x32')]?_0x2d4d97[_0xd9ff('0x31')]:_0x4961a7[_0xd9ff('0x2b')];if(_0x59fc07[_0xd9ff('0x2d')]['includeAll']){_0x2d4d97[_0xd9ff('0x3c')]=[{'all':!![]}];}_0x2d4d97=_[_0xd9ff('0x39')]({},_0x2d4d97,_0x59fc07['options']);return db[_0xd9ff('0x2a')][_0xd9ff('0x42')](_0x2d4d97)[_0xd9ff('0x23')](handleEntityNotFound(_0x1e34da,null))[_0xd9ff('0x23')](respondWithResult(_0x1e34da,null))[_0xd9ff('0x3e')](handleError(_0x1e34da,null));};exports['create']=function(_0x5cf34e,_0x5718ab){return db[_0xd9ff('0x2a')]['create'](_0x5cf34e[_0xd9ff('0x43')],{})[_0xd9ff('0x23')](respondWithResult(_0x5718ab,0xc9))[_0xd9ff('0x3e')](handleError(_0x5718ab,null));};exports['update']=function(_0x396736,_0x153f09){if(_0x396736['body']['id']){delete _0x396736[_0xd9ff('0x43')]['id'];}return db[_0xd9ff('0x2a')][_0xd9ff('0x42')]({'where':{'id':_0x396736[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0x153f09,null))[_0xd9ff('0x23')](saveUpdates(_0x396736['body'],null))[_0xd9ff('0x23')](respondWithResult(_0x153f09,null))['catch'](handleError(_0x153f09,null));};exports[_0xd9ff('0x24')]=function(_0x3d91e6,_0x2bf37a){return db[_0xd9ff('0x2a')][_0xd9ff('0x42')]({'where':{'id':_0x3d91e6['params']['id']}})[_0xd9ff('0x23')](handleEntityNotFound(_0x2bf37a,null))[_0xd9ff('0x23')](removeEntity(_0x2bf37a,null))[_0xd9ff('0x3e')](handleError(_0x2bf37a,null));};exports[_0xd9ff('0x44')]=function(_0x5c3e11,_0x537282){return db['MailTransferReport'][_0xd9ff('0x44')]()[_0xd9ff('0x23')](respondWithResult(_0x537282,null))[_0xd9ff('0x3e')](handleError(_0x537282,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 1af9d64..c9e878c 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 _0xef0a=['./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x174a4d,_0x203ae3){var _0x240fa1=function(_0x7139f){while(--_0x7139f){_0x174a4d['push'](_0x174a4d['shift']());}};_0x240fa1(++_0x203ae3);}(_0xef0a,0xdd));var _0xaef0=function(_0x130547,_0x390046){_0x130547=_0x130547-0x0;var _0x554bfb=_0xef0a[_0x130547];return _0x554bfb;};'use strict';var _=require(_0xaef0('0x0'));var util=require(_0xaef0('0x1'));var logger=require(_0xaef0('0x2'))(_0xaef0('0x3'));var moment=require(_0xaef0('0x4'));var BPromise=require(_0xaef0('0x5'));var rp=require(_0xaef0('0x6'));var attributes=require(_0xaef0('0x7'));module[_0xaef0('0x8')]=function(_0x2798e6,_0x9c7ece){return _0x2798e6['define'](_0xaef0('0x9'),attributes,{'tableName':_0xaef0('0xa'),'paranoid':![],'indexes':[{'name':_0xaef0('0xb'),'fields':[_0xaef0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd0ee=['request-promise','./mailTransferReport.attributes','define','MailTransferReport','util','api','moment'];(function(_0xfa4e7,_0x516f6e){var _0x4e179b=function(_0x355aa6){while(--_0x355aa6){_0xfa4e7['push'](_0xfa4e7['shift']());}};_0x4e179b(++_0x516f6e);}(_0xd0ee,0x19a));var _0xed0e=function(_0x5d8362,_0x36b88f){_0x5d8362=_0x5d8362-0x0;var _0x587f38=_0xd0ee[_0x5d8362];return _0x587f38;};'use strict';var _=require('lodash');var util=require(_0xed0e('0x0'));var logger=require('../../config/logger')(_0xed0e('0x1'));var moment=require(_0xed0e('0x2'));var BPromise=require('bluebird');var rp=require(_0xed0e('0x3'));var attributes=require(_0xed0e('0x4'));module['exports']=function(_0x224a63,_0x400523){return _0x224a63[_0xed0e('0x5')](_0xed0e('0x6'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index ce6005d..c3f5fb4 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 _0x6bcd=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','info','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','request\x20sent','result','catch','moment'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0x6bcd,0x6b));var _0xd6bc=function(_0x40d673,_0x58614e){_0x40d673=_0x40d673-0x0;var _0x38fe9b=_0x6bcd[_0x40d673];return _0x38fe9b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6bc('0x0'));var BPromise=require('bluebird');var rs=require(_0xd6bc('0x1'));var fs=require('fs');var Redis=require(_0xd6bc('0x2'));var db=require(_0xd6bc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6bc('0x4'))('rpc');var config=require(_0xd6bc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd6bc('0x6')][_0xd6bc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x136beb,_0x2903e3,_0x22bd2a){return new BPromise(function(_0x1f5a7e,_0x5823c2){return client['request'](_0x136beb,_0x22bd2a)['then'](function(_0x183c3b){logger[_0xd6bc('0x8')]('MailTransferReport,\x20%s,\x20%s',_0x2903e3,'request\x20sent');logger['debug'](_0xd6bc('0x9'),_0x2903e3,'request\x20sent',JSON[_0xd6bc('0xa')](_0x183c3b));if(_0x183c3b[_0xd6bc('0xb')]){if(_0x183c3b[_0xd6bc('0xb')][_0xd6bc('0xc')]===0x1f4){logger[_0xd6bc('0xb')](_0xd6bc('0xd'),_0x2903e3,_0x183c3b[_0xd6bc('0xb')][_0xd6bc('0xe')]);return _0x5823c2(_0x183c3b[_0xd6bc('0xb')]['message']);}logger[_0xd6bc('0xb')](_0xd6bc('0xd'),_0x2903e3,_0x183c3b[_0xd6bc('0xb')]['message']);return _0x1f5a7e(_0x183c3b[_0xd6bc('0xb')][_0xd6bc('0xe')]);}else{logger[_0xd6bc('0x8')](_0xd6bc('0xd'),_0x2903e3,_0xd6bc('0xf'));_0x1f5a7e(_0x183c3b[_0xd6bc('0x10')][_0xd6bc('0xe')]);}})[_0xd6bc('0x11')](function(_0x209d25){logger['error'](_0xd6bc('0xd'),_0x2903e3,_0x209d25);_0x5823c2(_0x209d25);});});} \ No newline at end of file +var _0xc061=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x5e8b55,_0x25e3d6){var _0x4facac=function(_0x53d80f){while(--_0x53d80f){_0x5e8b55['push'](_0x5e8b55['shift']());}};_0x4facac(++_0x25e3d6);}(_0xc061,0x12c));var _0x1c06=function(_0x17ffc7,_0x3ead6e){_0x17ffc7=_0x17ffc7-0x0;var _0x354a6b=_0xc061[_0x17ffc7];return _0x354a6b;};'use strict';var _=require(_0x1c06('0x0'));var util=require('util');var moment=require(_0x1c06('0x1'));var BPromise=require(_0x1c06('0x2'));var rs=require(_0x1c06('0x3'));var fs=require('fs');var Redis=require(_0x1c06('0x4'));var db=require(_0x1c06('0x5'))['db'];var utils=require(_0x1c06('0x6'));var logger=require(_0x1c06('0x7'))(_0x1c06('0x8'));var config=require(_0x1c06('0x9'));var jayson=require(_0x1c06('0xa'));var client=jayson[_0x1c06('0xb')][_0x1c06('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52cf66,_0x5dd354,_0x272525){return new BPromise(function(_0x24f7d,_0x5a43e8){return client[_0x1c06('0xd')](_0x52cf66,_0x272525)[_0x1c06('0xe')](function(_0x4675e8){logger[_0x1c06('0xf')](_0x1c06('0x10'),_0x5dd354,_0x1c06('0x11'));logger[_0x1c06('0x12')](_0x1c06('0x13'),_0x5dd354,_0x1c06('0x11'),JSON[_0x1c06('0x14')](_0x4675e8));if(_0x4675e8[_0x1c06('0x15')]){if(_0x4675e8['error'][_0x1c06('0x16')]===0x1f4){logger['error'](_0x1c06('0x10'),_0x5dd354,_0x4675e8[_0x1c06('0x15')]['message']);return _0x5a43e8(_0x4675e8['error'][_0x1c06('0x17')]);}logger['error'](_0x1c06('0x10'),_0x5dd354,_0x4675e8[_0x1c06('0x15')]['message']);return _0x24f7d(_0x4675e8['error'][_0x1c06('0x17')]);}else{logger[_0x1c06('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x5dd354,_0x1c06('0x11'));_0x24f7d(_0x4675e8['result'][_0x1c06('0x17')]);}})[_0x1c06('0x18')](function(_0x10e18b){logger[_0x1c06('0x15')]('MailTransferReport,\x20%s,\x20%s',_0x5dd354,_0x10e18b);_0x5a43e8(_0x10e18b);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 4f85a50..43f5a1f 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 _0xaed4=['../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaed4,0xb6));var _0x4aed=function(_0x37062b,_0x1d9e05){_0x37062b=_0x37062b-0x0;var _0x3a9d05=_0xaed4[_0x37062b];return _0x3a9d05;};'use strict';var multer=require(_0x4aed('0x0'));var util=require(_0x4aed('0x1'));var path=require(_0x4aed('0x2'));var timeout=require(_0x4aed('0x3'));var express=require('express');var router=express[_0x4aed('0x4')]();var auth=require(_0x4aed('0x5'));var interaction=require(_0x4aed('0x6'));var config=require(_0x4aed('0x7'));var controller=require(_0x4aed('0x8'));router[_0x4aed('0x9')]('/',auth[_0x4aed('0xa')](),controller[_0x4aed('0xb')]);router[_0x4aed('0x9')]('/describe',auth[_0x4aed('0xa')](),controller[_0x4aed('0xc')]);router['get'](_0x4aed('0xd'),auth[_0x4aed('0xa')](),controller[_0x4aed('0xe')]);router[_0x4aed('0xf')]('/',auth[_0x4aed('0xa')](),controller['create']);router[_0x4aed('0x10')](_0x4aed('0xd'),auth[_0x4aed('0xa')](),controller[_0x4aed('0x11')]);router[_0x4aed('0x12')](_0x4aed('0xd'),auth['isAuthenticated'](),controller[_0x4aed('0x13')]);module[_0x4aed('0x14')]=router; \ No newline at end of file +var _0x40c5=['post','create','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x4e21ba,_0x18097f){var _0x55b94b=function(_0x3b9add){while(--_0x3b9add){_0x4e21ba['push'](_0x4e21ba['shift']());}};_0x55b94b(++_0x18097f);}(_0x40c5,0x1a8));var _0x540c=function(_0x478219,_0x28aa3d){_0x478219=_0x478219-0x0;var _0x4ff324=_0x40c5[_0x478219];return _0x4ff324;};'use strict';var multer=require(_0x540c('0x0'));var util=require(_0x540c('0x1'));var path=require(_0x540c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x540c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x540c('0x4'));var config=require(_0x540c('0x5'));var controller=require('./memberReport.controller');router[_0x540c('0x6')]('/',auth['isAuthenticated'](),controller[_0x540c('0x7')]);router['get'](_0x540c('0x8'),auth[_0x540c('0x9')](),controller[_0x540c('0xa')]);router[_0x540c('0x6')](_0x540c('0xb'),auth['isAuthenticated'](),controller[_0x540c('0xc')]);router[_0x540c('0xd')]('/',auth[_0x540c('0x9')](),controller[_0x540c('0xe')]);router['put'](_0x540c('0xb'),auth[_0x540c('0x9')](),controller[_0x540c('0xf')]);router[_0x540c('0x10')](_0x540c('0xb'),auth[_0x540c('0x9')](),controller[_0x540c('0x11')]);module[_0x540c('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index add061a..52c587e 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 _0x0cc9=['talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x30f07a,_0x98341){var _0xb38461=function(_0x7b287a){while(--_0x7b287a){_0x30f07a['push'](_0x30f07a['shift']());}};_0xb38461(++_0x98341);}(_0x0cc9,0x16a));var _0x90cc=function(_0x348e46,_0x5187dc){_0x348e46=_0x348e46-0x0;var _0x58b74f=_0x0cc9[_0x348e46];return _0x58b74f;};'use strict';var Sequelize=require(_0x90cc('0x0'));var moment=require(_0x90cc('0x1'));module[_0x90cc('0x2')]={'channel':{'type':Sequelize[_0x90cc('0x3')]},'membername':{'type':Sequelize[_0x90cc('0x3')]},'interface':{'type':Sequelize[_0x90cc('0x3')]},'type':{'type':Sequelize[_0x90cc('0x3')],'defaultValue':_0x90cc('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x90cc('0x5')]},'enterAt':{'type':Sequelize[_0x90cc('0x6')]},'exitAt':{'type':Sequelize[_0x90cc('0x6')],'set':function(_0x4adfff){var _0x331218=moment(_0x4adfff);var _0x38ceea=moment(this[_0x90cc('0x7')](_0x90cc('0x8')));var _0x4d194e=_0x331218[_0x90cc('0x9')](_0x38ceea,_0x90cc('0xa'));this[_0x90cc('0xb')](_0x90cc('0xc'),_0x4adfff);this[_0x90cc('0xb')](_0x90cc('0xd'),_0x4d194e||null);}},'data1':{'type':Sequelize[_0x90cc('0x3')],'comment':_0x90cc('0xe')},'data2':{'type':Sequelize[_0x90cc('0x3')],'comment':_0x90cc('0xf')},'data3':{'type':Sequelize[_0x90cc('0x3')],'comment':_0x90cc('0x10')},'data4':{'type':Sequelize[_0x90cc('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x90cc('0x3')],'comment':_0x90cc('0x11')},'role':{'type':Sequelize[_0x90cc('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x90cc('0x3')]}}; \ No newline at end of file +var _0xcf53=['talk:[destination]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','setDataValue','exitAt','duration','talk:[start]'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xcf53,0x169));var _0x3cf5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcf53[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x3cf5('0x0'));var moment=require(_0x3cf5('0x1'));module['exports']={'channel':{'type':Sequelize[_0x3cf5('0x2')]},'membername':{'type':Sequelize[_0x3cf5('0x2')]},'interface':{'type':Sequelize[_0x3cf5('0x2')]},'type':{'type':Sequelize[_0x3cf5('0x2')],'defaultValue':_0x3cf5('0x3'),'comment':_0x3cf5('0x4')},'duration':{'type':Sequelize[_0x3cf5('0x5')]},'enterAt':{'type':Sequelize[_0x3cf5('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x3e5afd){var _0x2a22ce=moment(_0x3e5afd);var _0x2c0103=moment(this['getDataValue']('enterAt'));var _0x5b46d8=_0x2a22ce['diff'](_0x2c0103,'seconds');this[_0x3cf5('0x7')](_0x3cf5('0x8'),_0x3e5afd);this[_0x3cf5('0x7')](_0x3cf5('0x9'),_0x5b46d8||null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x3cf5('0x2')],'comment':_0x3cf5('0xa')},'data3':{'type':Sequelize[_0x3cf5('0x2')],'comment':_0x3cf5('0xb')},'data4':{'type':Sequelize[_0x3cf5('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x3cf5('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x3cf5('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x3cf5('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index d4f4a5e..6288876 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 _0x3353=['params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','MemberReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','findAll','catch','show'];(function(_0x313877,_0x566b84){var _0x37b699=function(_0x137c6c){while(--_0x137c6c){_0x313877['push'](_0x313877['shift']());}};_0x37b699(++_0x566b84);}(_0x3353,0x1ef));var _0x3335=function(_0x13e9f0,_0x1543da){_0x13e9f0=_0x13e9f0-0x0;var _0x3eb3bf=_0x3353[_0x13e9f0];return _0x3eb3bf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3335('0x0'));var rimraf=require(_0x3335('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3335('0x2'));var rp=require(_0x3335('0x3'));var moment=require(_0x3335('0x4'));var BPromise=require(_0x3335('0x5'));var Mustache=require(_0x3335('0x6'));var util=require(_0x3335('0x7'));var path=require(_0x3335('0x8'));var sox=require(_0x3335('0x9'));var csv=require(_0x3335('0xa'));var ejs=require(_0x3335('0xb'));var fs=require('fs');var _=require(_0x3335('0xc'));var squel=require(_0x3335('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3335('0xe'));var toCsv=require(_0x3335('0xa'));var querystring=require(_0x3335('0xf'));var Papa=require(_0x3335('0x10'));var authService=require(_0x3335('0x11'));var hardwareService=require(_0x3335('0x12'));var Redis=require('ioredis');var qs=require(_0x3335('0x13'));var logger=require(_0x3335('0x14'))('api');var utils=require(_0x3335('0x15'));var config=require('../../config/environment');var db=require(_0x3335('0x16'))['db'];function respondWithStatusCode(_0x32e87d,_0x3524c8){_0x3524c8=_0x3524c8||0xcc;return function(_0x66e23){if(_0x66e23){return _0x32e87d[_0x3335('0x17')](_0x3524c8);}return _0x32e87d[_0x3335('0x18')](_0x3524c8)[_0x3335('0x19')]();};}function respondWithResult(_0x5e5efe,_0x4634de){_0x4634de=_0x4634de||0xc8;return function(_0x16edd8){if(_0x16edd8){return _0x5e5efe['status'](_0x4634de)[_0x3335('0x1a')](_0x16edd8);}};}function respondWithFilteredResult(_0x731fb9,_0x7c70ab){return function(_0x4bd6e8){if(_0x4bd6e8){var _0x2fbfe3=_0x4bd6e8[_0x3335('0x1b')],_0x1d1dc9=_0x7c70ab[_0x3335('0x1c')],_0xf05e45=_0x7c70ab[_0x3335('0x1c')]+_0x7c70ab['limit'],_0x467125;if(_0xf05e45>=_0x2fbfe3){_0xf05e45=_0x2fbfe3;_0x467125=0xc8;}else{_0x467125=0xce;}_0x731fb9[_0x3335('0x18')](_0x467125);return _0x731fb9[_0x3335('0x1d')](_0x3335('0x1e'),_0x1d1dc9+'-'+_0xf05e45+'/'+_0x2fbfe3)[_0x3335('0x1a')](_0x4bd6e8);}return null;};}function patchUpdates(_0x1ab21b){return function(_0x5e4c72){try{jsonpatch[_0x3335('0x1f')](_0x5e4c72,_0x1ab21b,!![]);}catch(_0x168da3){return BPromise[_0x3335('0x20')](_0x168da3);}return _0x5e4c72[_0x3335('0x21')]();};}function saveUpdates(_0x55ef42,_0xcdb437){return function(_0xb08d00){if(_0xb08d00){return _0xb08d00[_0x3335('0x22')](_0x55ef42)[_0x3335('0x23')](function(_0x3621a1){return _0x3621a1;});}return null;};}function removeEntity(_0xdcdd95,_0x236b97){return function(_0x5bb106){if(_0x5bb106){return _0x5bb106[_0x3335('0x24')]()[_0x3335('0x23')](function(){_0xdcdd95['status'](0xcc)[_0x3335('0x19')]();});}};}function handleEntityNotFound(_0x489b5c,_0x2ede29){return function(_0x4edfd6){if(!_0x4edfd6){_0x489b5c[_0x3335('0x17')](0x194);}return _0x4edfd6;};}function handleError(_0x2d17eb,_0x2c4d3c){_0x2c4d3c=_0x2c4d3c||0x1f4;return function(_0xf8fea9){logger['error'](_0xf8fea9[_0x3335('0x25')]);if(_0xf8fea9['name']){delete _0xf8fea9[_0x3335('0x26')];}_0x2d17eb[_0x3335('0x18')](_0x2c4d3c)['send'](_0xf8fea9);};}exports[_0x3335('0x27')]=function(_0x4bdefe,_0x497152){var _0x8e9f8b={},_0x45f4c8={},_0x3a2262={'count':0x0,'rows':[]};var _0x5e2251=db[_0x3335('0x28')][_0x3335('0x29')];_0x45f4c8[_0x3335('0x2a')]=_[_0x3335('0x2b')](_0x5e2251);_0x45f4c8[_0x3335('0x2c')]=_[_0x3335('0x2b')](_0x4bdefe[_0x3335('0x2c')]);_0x45f4c8[_0x3335('0x2d')]=_[_0x3335('0x2e')](_0x45f4c8[_0x3335('0x2a')],_0x45f4c8[_0x3335('0x2c')]);_0x8e9f8b[_0x3335('0x2f')]=_[_0x3335('0x2e')](_0x45f4c8[_0x3335('0x2a')],qs[_0x3335('0x30')](_0x4bdefe[_0x3335('0x2c')][_0x3335('0x30')]));_0x8e9f8b[_0x3335('0x2f')]=_0x8e9f8b[_0x3335('0x2f')][_0x3335('0x31')]?_0x8e9f8b[_0x3335('0x2f')]:_0x45f4c8[_0x3335('0x2a')];if(!_0x4bdefe[_0x3335('0x2c')][_0x3335('0x32')]('nolimit')){_0x8e9f8b[_0x3335('0x33')]=qs[_0x3335('0x33')](_0x4bdefe['query'][_0x3335('0x33')]);_0x8e9f8b[_0x3335('0x1c')]=qs[_0x3335('0x1c')](_0x4bdefe['query'][_0x3335('0x1c')]);}_0x8e9f8b['order']=qs[_0x3335('0x34')](_0x4bdefe[_0x3335('0x2c')][_0x3335('0x34')]);_0x8e9f8b[_0x3335('0x35')]=qs[_0x3335('0x2d')](_[_0x3335('0x36')](_0x4bdefe[_0x3335('0x2c')],_0x45f4c8[_0x3335('0x2d')]));if(_0x4bdefe[_0x3335('0x2c')][_0x3335('0x37')]){_0x8e9f8b[_0x3335('0x35')]=_[_0x3335('0x38')](_0x8e9f8b[_0x3335('0x35')],{'$or':_['map'](_0x5e2251,function(_0x4a69f3){if(_0x4a69f3[_0x3335('0x39')][_0x3335('0x3a')]!==_0x3335('0x3b')){var _0x295022={};_0x295022[_0x4a69f3['field']]={'$like':'%'+_0x4bdefe[_0x3335('0x2c')]['filter']+'%'};return _0x295022;}})});}_0x8e9f8b=_['merge']({},_0x8e9f8b,_0x4bdefe[_0x3335('0x3c')]);var _0x10d65b={'where':_0x8e9f8b[_0x3335('0x35')]};return db['MemberReport'][_0x3335('0x1b')](_0x10d65b)[_0x3335('0x23')](function(_0x2fa4a1){_0x3a2262[_0x3335('0x1b')]=_0x2fa4a1;if(_0x4bdefe[_0x3335('0x2c')][_0x3335('0x3d')]){_0x8e9f8b['include']=[{'all':!![]}];}return db['MemberReport'][_0x3335('0x3e')](_0x8e9f8b);})['then'](function(_0x4b45ca){_0x3a2262['rows']=_0x4b45ca;return _0x3a2262;})[_0x3335('0x23')](respondWithFilteredResult(_0x497152,_0x8e9f8b))[_0x3335('0x3f')](handleError(_0x497152,null));};exports[_0x3335('0x40')]=function(_0x14b02a,_0x2e56b8){var _0x201bf7={'raw':!![],'where':{'id':_0x14b02a[_0x3335('0x41')]['id']}},_0x19e01f={};_0x19e01f[_0x3335('0x2a')]=_[_0x3335('0x2b')](db[_0x3335('0x28')][_0x3335('0x29')]);_0x19e01f[_0x3335('0x2c')]=_[_0x3335('0x2b')](_0x14b02a['query']);_0x19e01f[_0x3335('0x2d')]=_[_0x3335('0x2e')](_0x19e01f[_0x3335('0x2a')],_0x19e01f[_0x3335('0x2c')]);_0x201bf7['attributes']=_[_0x3335('0x2e')](_0x19e01f[_0x3335('0x2a')],qs[_0x3335('0x30')](_0x14b02a[_0x3335('0x2c')][_0x3335('0x30')]));_0x201bf7[_0x3335('0x2f')]=_0x201bf7[_0x3335('0x2f')][_0x3335('0x31')]?_0x201bf7[_0x3335('0x2f')]:_0x19e01f[_0x3335('0x2a')];if(_0x14b02a[_0x3335('0x2c')][_0x3335('0x3d')]){_0x201bf7['include']=[{'all':!![]}];}_0x201bf7=_[_0x3335('0x38')]({},_0x201bf7,_0x14b02a[_0x3335('0x3c')]);return db[_0x3335('0x28')][_0x3335('0x42')](_0x201bf7)[_0x3335('0x23')](handleEntityNotFound(_0x2e56b8,null))[_0x3335('0x23')](respondWithResult(_0x2e56b8,null))[_0x3335('0x3f')](handleError(_0x2e56b8,null));};exports[_0x3335('0x43')]=function(_0x48a3f6,_0x400efa){return db['MemberReport']['create'](_0x48a3f6[_0x3335('0x44')],{})['then'](respondWithResult(_0x400efa,0xc9))[_0x3335('0x3f')](handleError(_0x400efa,null));};exports[_0x3335('0x22')]=function(_0x3eb172,_0x7222e){if(_0x3eb172[_0x3335('0x44')]['id']){delete _0x3eb172[_0x3335('0x44')]['id'];}return db[_0x3335('0x28')]['find']({'where':{'id':_0x3eb172[_0x3335('0x41')]['id']}})['then'](handleEntityNotFound(_0x7222e,null))[_0x3335('0x23')](saveUpdates(_0x3eb172[_0x3335('0x44')],null))[_0x3335('0x23')](respondWithResult(_0x7222e,null))[_0x3335('0x3f')](handleError(_0x7222e,null));};exports[_0x3335('0x24')]=function(_0x301a4a,_0x589ee4){return db['MemberReport']['find']({'where':{'id':_0x301a4a[_0x3335('0x41')]['id']}})[_0x3335('0x23')](handleEntityNotFound(_0x589ee4,null))[_0x3335('0x23')](removeEntity(_0x589ee4,null))['catch'](handleError(_0x589ee4,null));};exports['describe']=function(_0x532b67,_0x38293a){return db[_0x3335('0x28')][_0x3335('0x45')]()[_0x3335('0x23')](respondWithResult(_0x38293a,null))[_0x3335('0x3f')](handleError(_0x38293a,null));}; \ No newline at end of file +var _0x35ff=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','options','include','rows','catch','show','params','MemberReport','includeAll','merge','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','name','send','index','rawAttributes','model','keys'];(function(_0x1d963b,_0x83934d){var _0x4422a8=function(_0xe2bc27){while(--_0xe2bc27){_0x1d963b['push'](_0x1d963b['shift']());}};_0x4422a8(++_0x83934d);}(_0x35ff,0xb3));var _0xf35f=function(_0x16fa14,_0x163e52){_0x16fa14=_0x16fa14-0x0;var _0x32c285=_0x35ff[_0x16fa14];return _0x32c285;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf35f('0x0'));var rimraf=require(_0xf35f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf35f('0x2'));var rp=require(_0xf35f('0x3'));var moment=require('moment');var BPromise=require(_0xf35f('0x4'));var Mustache=require('mustache');var util=require(_0xf35f('0x5'));var path=require(_0xf35f('0x6'));var sox=require(_0xf35f('0x7'));var csv=require(_0xf35f('0x8'));var ejs=require(_0xf35f('0x9'));var fs=require('fs');var _=require(_0xf35f('0xa'));var squel=require('squel');var crypto=require(_0xf35f('0xb'));var jsforce=require(_0xf35f('0xc'));var deskjs=require(_0xf35f('0xd'));var toCsv=require(_0xf35f('0x8'));var querystring=require('querystring');var Papa=require(_0xf35f('0xe'));var authService=require(_0xf35f('0xf'));var hardwareService=require(_0xf35f('0x10'));var Redis=require(_0xf35f('0x11'));var qs=require(_0xf35f('0x12'));var logger=require(_0xf35f('0x13'))(_0xf35f('0x14'));var utils=require('../../config/utils');var config=require(_0xf35f('0x15'));var db=require(_0xf35f('0x16'))['db'];function respondWithStatusCode(_0x53ace5,_0x30b231){_0x30b231=_0x30b231||0xcc;return function(_0x2a5109){if(_0x2a5109){return _0x53ace5[_0xf35f('0x17')](_0x30b231);}return _0x53ace5[_0xf35f('0x18')](_0x30b231)[_0xf35f('0x19')]();};}function respondWithResult(_0x5b38be,_0x2f6645){_0x2f6645=_0x2f6645||0xc8;return function(_0x47b652){if(_0x47b652){return _0x5b38be[_0xf35f('0x18')](_0x2f6645)[_0xf35f('0x1a')](_0x47b652);}};}function respondWithFilteredResult(_0x577fb0,_0x375bd3){return function(_0x378009){if(_0x378009){var _0x83110d=_0x378009[_0xf35f('0x1b')],_0x2fff4c=_0x375bd3[_0xf35f('0x1c')],_0x246cc8=_0x375bd3[_0xf35f('0x1c')]+_0x375bd3[_0xf35f('0x1d')],_0x4974a9;if(_0x246cc8>=_0x83110d){_0x246cc8=_0x83110d;_0x4974a9=0xc8;}else{_0x4974a9=0xce;}_0x577fb0['status'](_0x4974a9);return _0x577fb0[_0xf35f('0x1e')](_0xf35f('0x1f'),_0x2fff4c+'-'+_0x246cc8+'/'+_0x83110d)[_0xf35f('0x1a')](_0x378009);}return null;};}function patchUpdates(_0xe0165){return function(_0x26f540){try{jsonpatch['apply'](_0x26f540,_0xe0165,!![]);}catch(_0x4348af){return BPromise[_0xf35f('0x20')](_0x4348af);}return _0x26f540[_0xf35f('0x21')]();};}function saveUpdates(_0x1f76fe,_0x35eddb){return function(_0x2b86b7){if(_0x2b86b7){return _0x2b86b7[_0xf35f('0x22')](_0x1f76fe)['then'](function(_0x111519){return _0x111519;});}return null;};}function removeEntity(_0x27459a,_0x4a8e78){return function(_0x319a63){if(_0x319a63){return _0x319a63['destroy']()[_0xf35f('0x23')](function(){_0x27459a['status'](0xcc)[_0xf35f('0x19')]();});}};}function handleEntityNotFound(_0x31ac01,_0x43e723){return function(_0x577c4b){if(!_0x577c4b){_0x31ac01[_0xf35f('0x17')](0x194);}return _0x577c4b;};}function handleError(_0x45eda6,_0x168266){_0x168266=_0x168266||0x1f4;return function(_0x30a846){logger[_0xf35f('0x24')](_0x30a846['stack']);if(_0x30a846['name']){delete _0x30a846[_0xf35f('0x25')];}_0x45eda6[_0xf35f('0x18')](_0x168266)[_0xf35f('0x26')](_0x30a846);};}exports[_0xf35f('0x27')]=function(_0x306783,_0x538af6){var _0x16c0e3={},_0x4e9741={},_0x24a76c={'count':0x0,'rows':[]};var _0x3a67de=db['MemberReport'][_0xf35f('0x28')];_0x4e9741[_0xf35f('0x29')]=_[_0xf35f('0x2a')](_0x3a67de);_0x4e9741[_0xf35f('0x2b')]=_[_0xf35f('0x2a')](_0x306783[_0xf35f('0x2b')]);_0x4e9741[_0xf35f('0x2c')]=_[_0xf35f('0x2d')](_0x4e9741[_0xf35f('0x29')],_0x4e9741[_0xf35f('0x2b')]);_0x16c0e3[_0xf35f('0x2e')]=_[_0xf35f('0x2d')](_0x4e9741[_0xf35f('0x29')],qs[_0xf35f('0x2f')](_0x306783['query'][_0xf35f('0x2f')]));_0x16c0e3[_0xf35f('0x2e')]=_0x16c0e3[_0xf35f('0x2e')][_0xf35f('0x30')]?_0x16c0e3[_0xf35f('0x2e')]:_0x4e9741[_0xf35f('0x29')];if(!_0x306783[_0xf35f('0x2b')][_0xf35f('0x31')](_0xf35f('0x32'))){_0x16c0e3['limit']=qs[_0xf35f('0x1d')](_0x306783['query'][_0xf35f('0x1d')]);_0x16c0e3[_0xf35f('0x1c')]=qs[_0xf35f('0x1c')](_0x306783['query'][_0xf35f('0x1c')]);}_0x16c0e3[_0xf35f('0x33')]=qs[_0xf35f('0x34')](_0x306783[_0xf35f('0x2b')][_0xf35f('0x34')]);_0x16c0e3[_0xf35f('0x35')]=qs[_0xf35f('0x2c')](_[_0xf35f('0x36')](_0x306783['query'],_0x4e9741[_0xf35f('0x2c')]));if(_0x306783[_0xf35f('0x2b')]['filter']){_0x16c0e3['where']=_['merge'](_0x16c0e3['where'],{'$or':_[_0xf35f('0x37')](_0x3a67de,function(_0x50616b){if(_0x50616b[_0xf35f('0x38')][_0xf35f('0x39')]!==_0xf35f('0x3a')){var _0xcfef44={};_0xcfef44[_0x50616b[_0xf35f('0x3b')]]={'$like':'%'+_0x306783[_0xf35f('0x2b')][_0xf35f('0x3c')]+'%'};return _0xcfef44;}})});}_0x16c0e3=_['merge']({},_0x16c0e3,_0x306783[_0xf35f('0x3d')]);var _0x386036={'where':_0x16c0e3['where']};return db['MemberReport'][_0xf35f('0x1b')](_0x386036)[_0xf35f('0x23')](function(_0x19429d){_0x24a76c[_0xf35f('0x1b')]=_0x19429d;if(_0x306783[_0xf35f('0x2b')]['includeAll']){_0x16c0e3[_0xf35f('0x3e')]=[{'all':!![]}];}return db['MemberReport']['findAll'](_0x16c0e3);})[_0xf35f('0x23')](function(_0x5de59e){_0x24a76c[_0xf35f('0x3f')]=_0x5de59e;return _0x24a76c;})[_0xf35f('0x23')](respondWithFilteredResult(_0x538af6,_0x16c0e3))[_0xf35f('0x40')](handleError(_0x538af6,null));};exports[_0xf35f('0x41')]=function(_0x4f1ecb,_0x223be5){var _0x377c22={'raw':!![],'where':{'id':_0x4f1ecb[_0xf35f('0x42')]['id']}},_0x4071a2={};_0x4071a2['model']=_['keys'](db[_0xf35f('0x43')][_0xf35f('0x28')]);_0x4071a2['query']=_[_0xf35f('0x2a')](_0x4f1ecb['query']);_0x4071a2[_0xf35f('0x2c')]=_[_0xf35f('0x2d')](_0x4071a2[_0xf35f('0x29')],_0x4071a2[_0xf35f('0x2b')]);_0x377c22[_0xf35f('0x2e')]=_['intersection'](_0x4071a2['model'],qs['fields'](_0x4f1ecb['query'][_0xf35f('0x2f')]));_0x377c22[_0xf35f('0x2e')]=_0x377c22[_0xf35f('0x2e')][_0xf35f('0x30')]?_0x377c22[_0xf35f('0x2e')]:_0x4071a2[_0xf35f('0x29')];if(_0x4f1ecb[_0xf35f('0x2b')][_0xf35f('0x44')]){_0x377c22[_0xf35f('0x3e')]=[{'all':!![]}];}_0x377c22=_[_0xf35f('0x45')]({},_0x377c22,_0x4f1ecb[_0xf35f('0x3d')]);return db[_0xf35f('0x43')][_0xf35f('0x46')](_0x377c22)[_0xf35f('0x23')](handleEntityNotFound(_0x223be5,null))['then'](respondWithResult(_0x223be5,null))[_0xf35f('0x40')](handleError(_0x223be5,null));};exports[_0xf35f('0x47')]=function(_0x36291c,_0x1f5a85){return db[_0xf35f('0x43')][_0xf35f('0x47')](_0x36291c[_0xf35f('0x48')],{})['then'](respondWithResult(_0x1f5a85,0xc9))[_0xf35f('0x40')](handleError(_0x1f5a85,null));};exports[_0xf35f('0x22')]=function(_0x4d49ea,_0x49aa7e){if(_0x4d49ea['body']['id']){delete _0x4d49ea[_0xf35f('0x48')]['id'];}return db[_0xf35f('0x43')][_0xf35f('0x46')]({'where':{'id':_0x4d49ea['params']['id']}})[_0xf35f('0x23')](handleEntityNotFound(_0x49aa7e,null))[_0xf35f('0x23')](saveUpdates(_0x4d49ea[_0xf35f('0x48')],null))[_0xf35f('0x23')](respondWithResult(_0x49aa7e,null))[_0xf35f('0x40')](handleError(_0x49aa7e,null));};exports['destroy']=function(_0x28cd8d,_0x5978e1){return db[_0xf35f('0x43')][_0xf35f('0x46')]({'where':{'id':_0x28cd8d['params']['id']}})[_0xf35f('0x23')](handleEntityNotFound(_0x5978e1,null))['then'](removeEntity(_0x5978e1,null))[_0xf35f('0x40')](handleError(_0x5978e1,null));};exports[_0xf35f('0x49')]=function(_0x3c4ddb,_0x18e06b){return db[_0xf35f('0x43')][_0xf35f('0x49')]()[_0xf35f('0x23')](respondWithResult(_0x18e06b,null))[_0xf35f('0x40')](handleError(_0x18e06b,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index e7a02dd..7c9be1f 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 _0xf269=['./memberReport.attributes','MemberReport','report_member','membername_interface','lodash','util','request-promise'];(function(_0x43bed9,_0x26adca){var _0x27b03d=function(_0x5c47c9){while(--_0x5c47c9){_0x43bed9['push'](_0x43bed9['shift']());}};_0x27b03d(++_0x26adca);}(_0xf269,0xf9));var _0x9f26=function(_0x2549ec,_0x20c37e){_0x2549ec=_0x2549ec-0x0;var _0x30fb2d=_0xf269[_0x2549ec];return _0x30fb2d;};'use strict';var _=require(_0x9f26('0x0'));var util=require(_0x9f26('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f26('0x2'));var attributes=require(_0x9f26('0x3'));module['exports']=function(_0x541cfb,_0x1a5cbf){return _0x541cfb['define'](_0x9f26('0x4'),attributes,{'tableName':_0x9f26('0x5'),'paranoid':![],'indexes':[{'name':_0x9f26('0x6'),'fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd672=['exports','MemberReport','report_member','membername_interface','lodash','util','api','./memberReport.attributes'];(function(_0x5d4600,_0x5b4609){var _0x402eec=function(_0x260d96){while(--_0x260d96){_0x5d4600['push'](_0x5d4600['shift']());}};_0x402eec(++_0x5b4609);}(_0xd672,0x1f4));var _0x2d67=function(_0x58b9a7,_0x1920c9){_0x58b9a7=_0x58b9a7-0x0;var _0x21bd75=_0xd672[_0x58b9a7];return _0x21bd75;};'use strict';var _=require(_0x2d67('0x0'));var util=require(_0x2d67('0x1'));var logger=require('../../config/logger')(_0x2d67('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x2d67('0x3'));module[_0x2d67('0x4')]=function(_0x59a2a7,_0x3febbe){return _0x59a2a7['define'](_0x2d67('0x5'),attributes,{'tableName':_0x2d67('0x6'),'paranoid':![],'indexes':[{'name':_0x2d67('0x7'),'fields':['membername','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 4d6c77c..5ad244c 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 _0xcccd=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','attributes','limit','include','model','map','CreateMemberReport','create','body','UpdateMemberReport','update','raw','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x95d590,_0xf6cd00){var _0x49f0d3=function(_0x1af711){while(--_0x1af711){_0x95d590['push'](_0x95d590['shift']());}};_0x49f0d3(++_0xf6cd00);}(_0xcccd,0x177));var _0xdccc=function(_0x2c2244,_0x197be1){_0x2c2244=_0x2c2244-0x0;var _0x1e3b27=_0xcccd[_0x2c2244];return _0x1e3b27;};'use strict';var _=require('lodash');var util=require(_0xdccc('0x0'));var moment=require('moment');var BPromise=require(_0xdccc('0x1'));var rs=require(_0xdccc('0x2'));var fs=require('fs');var Redis=require(_0xdccc('0x3'));var db=require(_0xdccc('0x4'))['db'];var utils=require(_0xdccc('0x5'));var logger=require(_0xdccc('0x6'))(_0xdccc('0x7'));var config=require(_0xdccc('0x8'));var jayson=require(_0xdccc('0x9'));var client=jayson[_0xdccc('0xa')][_0xdccc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2532d5,_0x41e8f9,_0x1aa6b2){return new BPromise(function(_0x1c5362,_0x1a9df0){return client[_0xdccc('0xc')](_0x2532d5,_0x1aa6b2)[_0xdccc('0xd')](function(_0x5d068f){logger[_0xdccc('0xe')](_0xdccc('0xf'),_0x41e8f9,_0xdccc('0x10'));logger[_0xdccc('0x11')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x41e8f9,_0xdccc('0x10'),JSON[_0xdccc('0x12')](_0x5d068f));if(_0x5d068f[_0xdccc('0x13')]){if(_0x5d068f[_0xdccc('0x13')]['code']===0x1f4){logger['error'](_0xdccc('0xf'),_0x41e8f9,_0x5d068f[_0xdccc('0x13')][_0xdccc('0x14')]);return _0x1a9df0(_0x5d068f[_0xdccc('0x13')]['message']);}logger[_0xdccc('0x13')]('MemberReport,\x20%s,\x20%s',_0x41e8f9,_0x5d068f[_0xdccc('0x13')][_0xdccc('0x14')]);return _0x1c5362(_0x5d068f[_0xdccc('0x13')][_0xdccc('0x14')]);}else{logger[_0xdccc('0xe')](_0xdccc('0xf'),_0x41e8f9,_0xdccc('0x10'));_0x1c5362(_0x5d068f[_0xdccc('0x15')]['message']);}})[_0xdccc('0x16')](function(_0x5bf2f5){logger[_0xdccc('0x13')](_0xdccc('0xf'),_0x41e8f9,_0x5bf2f5);_0x1a9df0(_0x5bf2f5);});});}exports[_0xdccc('0x17')]=function(_0x59d90d){var _0x8ac9fc=this;return new Promise(function(_0x3ceb5d,_0x36e57c){return db[_0xdccc('0x18')][_0xdccc('0x19')]({'raw':_0x59d90d[_0xdccc('0x1a')]?_0x59d90d['options']['raw']===undefined?!![]:![]:!![],'where':_0x59d90d[_0xdccc('0x1a')]?_0x59d90d[_0xdccc('0x1a')]['where']||null:null,'attributes':_0x59d90d[_0xdccc('0x1a')]?_0x59d90d['options'][_0xdccc('0x1b')]||null:null,'limit':_0x59d90d[_0xdccc('0x1a')]?_0x59d90d['options'][_0xdccc('0x1c')]||null:null,'include':_0x59d90d[_0xdccc('0x1a')]?_0x59d90d[_0xdccc('0x1a')][_0xdccc('0x1d')]?_['map'](_0x59d90d['options'][_0xdccc('0x1d')],function(_0x1300bf){return{'model':db[_0x1300bf[_0xdccc('0x1e')]],'as':_0x1300bf['as'],'attributes':_0x1300bf['attributes'],'include':_0x1300bf[_0xdccc('0x1d')]?_[_0xdccc('0x1f')](_0x1300bf['include'],function(_0xee10c1){return{'model':db[_0xee10c1[_0xdccc('0x1e')]],'as':_0xee10c1['as'],'attributes':_0xee10c1[_0xdccc('0x1b')],'include':_0xee10c1[_0xdccc('0x1d')]?_[_0xdccc('0x1f')](_0xee10c1[_0xdccc('0x1d')],function(_0x26507a){return{'model':db[_0x26507a['model']],'as':_0x26507a['as'],'attributes':_0x26507a['attributes']};}):[]};}):[]};}):[]:[]})[_0xdccc('0xd')](function(_0x48a70b){logger[_0xdccc('0xe')](_0xdccc('0x17'),_0x59d90d);logger[_0xdccc('0x11')](_0xdccc('0x17'),_0x59d90d,JSON[_0xdccc('0x12')](_0x48a70b));_0x3ceb5d(_0x48a70b);})[_0xdccc('0x16')](function(_0xa3ff0f){logger[_0xdccc('0x13')](_0xdccc('0x17'),_0xa3ff0f[_0xdccc('0x14')],_0x59d90d);_0x36e57c(_0x8ac9fc[_0xdccc('0x13')](0x1f4,_0xa3ff0f[_0xdccc('0x14')]));});});};exports[_0xdccc('0x20')]=function(_0x7728c0){var _0x3e47be=this;return new Promise(function(_0x3874fe,_0xcdd19c){return db[_0xdccc('0x18')][_0xdccc('0x21')](_0x7728c0[_0xdccc('0x22')],{'raw':_0x7728c0['options']?_0x7728c0[_0xdccc('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xdccc('0xd')](function(_0x25adb5){logger[_0xdccc('0xe')](_0xdccc('0x20'),_0x7728c0);logger[_0xdccc('0x11')](_0xdccc('0x20'),_0x7728c0,JSON['stringify'](_0x25adb5));_0x3874fe(_0x25adb5);})[_0xdccc('0x16')](function(_0x4b2b28){logger[_0xdccc('0x13')]('CreateMemberReport',_0x4b2b28[_0xdccc('0x14')],_0x7728c0);_0xcdd19c(_0x3e47be[_0xdccc('0x13')](0x1f4,_0x4b2b28[_0xdccc('0x14')]));});});};exports[_0xdccc('0x23')]=function(_0x5ed6b7){var _0x1d1f76=this;return new Promise(function(_0x41f8cf,_0x43e09d){return db[_0xdccc('0x18')][_0xdccc('0x24')](_0x5ed6b7[_0xdccc('0x22')],{'raw':_0x5ed6b7['options']?_0x5ed6b7[_0xdccc('0x1a')][_0xdccc('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ed6b7[_0xdccc('0x1a')]?_0x5ed6b7['options']['where']||null:null,'attributes':_0x5ed6b7[_0xdccc('0x1a')]?_0x5ed6b7[_0xdccc('0x1a')][_0xdccc('0x1b')]||null:null,'limit':_0x5ed6b7[_0xdccc('0x1a')]?_0x5ed6b7['options'][_0xdccc('0x1c')]||null:null})[_0xdccc('0xd')](function(_0x51c027){logger[_0xdccc('0xe')](_0xdccc('0x23'),_0x5ed6b7);logger[_0xdccc('0x11')]('UpdateMemberReport',_0x5ed6b7,JSON[_0xdccc('0x12')](_0x51c027));_0x41f8cf(_0x51c027);})[_0xdccc('0x16')](function(_0x1cfe5f){logger[_0xdccc('0x13')](_0xdccc('0x23'),_0x1cfe5f[_0xdccc('0x14')],_0x5ed6b7);_0x43e09d(_0x1d1f76[_0xdccc('0x13')](0x1f4,_0x1cfe5f[_0xdccc('0x14')]));});});}; \ No newline at end of file +var _0x4e9c=['include','map','model','then','GetMemberReport','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','MemberReport','findAll','options','raw','where','attributes','limit'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x4e9c,0xaa));var _0xc4e9=function(_0x4ecb36,_0x3df5df){_0x4ecb36=_0x4ecb36-0x0;var _0x24a839=_0x4e9c[_0x4ecb36];return _0x24a839;};'use strict';var _=require(_0xc4e9('0x0'));var util=require(_0xc4e9('0x1'));var moment=require('moment');var BPromise=require(_0xc4e9('0x2'));var rs=require(_0xc4e9('0x3'));var fs=require('fs');var Redis=require(_0xc4e9('0x4'));var db=require(_0xc4e9('0x5'))['db'];var utils=require(_0xc4e9('0x6'));var logger=require(_0xc4e9('0x7'))(_0xc4e9('0x8'));var config=require(_0xc4e9('0x9'));var jayson=require(_0xc4e9('0xa'));var client=jayson[_0xc4e9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d388a,_0x13f44a,_0x1a6039){return new BPromise(function(_0x484504,_0x244680){return client[_0xc4e9('0xc')](_0x1d388a,_0x1a6039)['then'](function(_0x4440b5){logger[_0xc4e9('0xd')](_0xc4e9('0xe'),_0x13f44a,_0xc4e9('0xf'));logger[_0xc4e9('0x10')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x13f44a,_0xc4e9('0xf'),JSON[_0xc4e9('0x11')](_0x4440b5));if(_0x4440b5[_0xc4e9('0x12')]){if(_0x4440b5[_0xc4e9('0x12')][_0xc4e9('0x13')]===0x1f4){logger[_0xc4e9('0x12')](_0xc4e9('0xe'),_0x13f44a,_0x4440b5[_0xc4e9('0x12')][_0xc4e9('0x14')]);return _0x244680(_0x4440b5['error'][_0xc4e9('0x14')]);}logger['error'](_0xc4e9('0xe'),_0x13f44a,_0x4440b5[_0xc4e9('0x12')][_0xc4e9('0x14')]);return _0x484504(_0x4440b5[_0xc4e9('0x12')][_0xc4e9('0x14')]);}else{logger[_0xc4e9('0xd')](_0xc4e9('0xe'),_0x13f44a,_0xc4e9('0xf'));_0x484504(_0x4440b5[_0xc4e9('0x15')]['message']);}})[_0xc4e9('0x16')](function(_0x5be6ad){logger[_0xc4e9('0x12')](_0xc4e9('0xe'),_0x13f44a,_0x5be6ad);_0x244680(_0x5be6ad);});});}exports['GetMemberReport']=function(_0x2ff13a){var _0x381674=this;return new Promise(function(_0x371351,_0x1ce877){return db[_0xc4e9('0x17')][_0xc4e9('0x18')]({'raw':_0x2ff13a[_0xc4e9('0x19')]?_0x2ff13a['options'][_0xc4e9('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ff13a[_0xc4e9('0x19')]?_0x2ff13a[_0xc4e9('0x19')][_0xc4e9('0x1b')]||null:null,'attributes':_0x2ff13a[_0xc4e9('0x19')]?_0x2ff13a[_0xc4e9('0x19')][_0xc4e9('0x1c')]||null:null,'limit':_0x2ff13a[_0xc4e9('0x19')]?_0x2ff13a[_0xc4e9('0x19')][_0xc4e9('0x1d')]||null:null,'include':_0x2ff13a[_0xc4e9('0x19')]?_0x2ff13a[_0xc4e9('0x19')][_0xc4e9('0x1e')]?_['map'](_0x2ff13a[_0xc4e9('0x19')][_0xc4e9('0x1e')],function(_0x25373c){return{'model':db[_0x25373c['model']],'as':_0x25373c['as'],'attributes':_0x25373c[_0xc4e9('0x1c')],'include':_0x25373c['include']?_[_0xc4e9('0x1f')](_0x25373c['include'],function(_0x1aef7b){return{'model':db[_0x1aef7b[_0xc4e9('0x20')]],'as':_0x1aef7b['as'],'attributes':_0x1aef7b[_0xc4e9('0x1c')],'include':_0x1aef7b[_0xc4e9('0x1e')]?_[_0xc4e9('0x1f')](_0x1aef7b[_0xc4e9('0x1e')],function(_0x1e25a0){return{'model':db[_0x1e25a0[_0xc4e9('0x20')]],'as':_0x1e25a0['as'],'attributes':_0x1e25a0['attributes']};}):[]};}):[]};}):[]:[]})[_0xc4e9('0x21')](function(_0x694eae){logger[_0xc4e9('0xd')](_0xc4e9('0x22'),_0x2ff13a);logger[_0xc4e9('0x10')](_0xc4e9('0x22'),_0x2ff13a,JSON['stringify'](_0x694eae));_0x371351(_0x694eae);})['catch'](function(_0x555775){logger[_0xc4e9('0x12')](_0xc4e9('0x22'),_0x555775[_0xc4e9('0x14')],_0x2ff13a);_0x1ce877(_0x381674[_0xc4e9('0x12')](0x1f4,_0x555775[_0xc4e9('0x14')]));});});};exports[_0xc4e9('0x23')]=function(_0x2702d5){var _0x57159c=this;return new Promise(function(_0x3483f0,_0x39134e){return db[_0xc4e9('0x17')][_0xc4e9('0x24')](_0x2702d5[_0xc4e9('0x25')],{'raw':_0x2702d5[_0xc4e9('0x19')]?_0x2702d5['options'][_0xc4e9('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3f1bc7){logger[_0xc4e9('0xd')](_0xc4e9('0x23'),_0x2702d5);logger['debug']('CreateMemberReport',_0x2702d5,JSON['stringify'](_0x3f1bc7));_0x3483f0(_0x3f1bc7);})[_0xc4e9('0x16')](function(_0x43610b){logger[_0xc4e9('0x12')](_0xc4e9('0x23'),_0x43610b[_0xc4e9('0x14')],_0x2702d5);_0x39134e(_0x57159c['error'](0x1f4,_0x43610b[_0xc4e9('0x14')]));});});};exports[_0xc4e9('0x26')]=function(_0x336a22){var _0x14f759=this;return new Promise(function(_0x34b23e,_0x261a5d){return db[_0xc4e9('0x17')][_0xc4e9('0x27')](_0x336a22[_0xc4e9('0x25')],{'raw':_0x336a22[_0xc4e9('0x19')]?_0x336a22[_0xc4e9('0x19')][_0xc4e9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x336a22[_0xc4e9('0x19')]?_0x336a22[_0xc4e9('0x19')][_0xc4e9('0x1b')]||null:null,'attributes':_0x336a22[_0xc4e9('0x19')]?_0x336a22[_0xc4e9('0x19')][_0xc4e9('0x1c')]||null:null,'limit':_0x336a22['options']?_0x336a22[_0xc4e9('0x19')]['limit']||null:null})[_0xc4e9('0x21')](function(_0x38f757){logger['info']('UpdateMemberReport',_0x336a22);logger[_0xc4e9('0x10')]('UpdateMemberReport',_0x336a22,JSON['stringify'](_0x38f757));_0x34b23e(_0x38f757);})[_0xc4e9('0x16')](function(_0x23ed78){logger[_0xc4e9('0x12')](_0xc4e9('0x26'),_0x23ed78[_0xc4e9('0x14')],_0x336a22);_0x261a5d(_0x14f759[_0xc4e9('0x12')](0x1f4,_0x23ed78[_0xc4e9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index ee4bef8..229ed82 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 _0xbcda=['express','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index','exports','connect-timeout'];(function(_0x2e6c19,_0x131233){var _0x52885d=function(_0x38f224){while(--_0x38f224){_0x2e6c19['push'](_0x2e6c19['shift']());}};_0x52885d(++_0x131233);}(_0xbcda,0x10d));var _0xabcd=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xbcda[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xabcd('0x0'));var express=require(_0xabcd('0x1'));var router=express[_0xabcd('0x2')]();var auth=require(_0xabcd('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xabcd('0x4'));var controller=require(_0xabcd('0x5'));router[_0xabcd('0x6')]('/',controller[_0xabcd('0x7')]);module[_0xabcd('0x8')]=router; \ No newline at end of file +var _0xd66a=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','exports'];(function(_0x502413,_0x12a31f){var _0x5ca9c7=function(_0xd6ce7d){while(--_0xd6ce7d){_0x502413['push'](_0x502413['shift']());}};_0x5ca9c7(++_0x12a31f);}(_0xd66a,0x1e4));var _0xad66=function(_0x2134b7,_0x1eb5e2){_0x2134b7=_0x2134b7-0x0;var _0x6c5914=_0xd66a[_0x2134b7];return _0x6c5914;};'use strict';var multer=require(_0xad66('0x0'));var util=require(_0xad66('0x1'));var path=require(_0xad66('0x2'));var timeout=require(_0xad66('0x3'));var express=require('express');var router=express[_0xad66('0x4')]();var auth=require(_0xad66('0x5'));var interaction=require(_0xad66('0x6'));var config=require(_0xad66('0x7'));var controller=require('./migration.controller');router[_0xad66('0x8')]('/',controller[_0xad66('0x9')]);module[_0xad66('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 2b06b81..2cba4c5 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 _0xd9ed=['sequelize','STRING'];(function(_0x36c3e1,_0x479ab4){var _0x4494dc=function(_0xb4e687){while(--_0xb4e687){_0x36c3e1['push'](_0x36c3e1['shift']());}};_0x4494dc(++_0x479ab4);}(_0xd9ed,0x18a));var _0xdd9e=function(_0x53301c,_0x4fdb57){_0x53301c=_0x53301c-0x0;var _0x26d280=_0xd9ed[_0x53301c];return _0x26d280;};'use strict';var Sequelize=require(_0xdd9e('0x0'));module['exports']={'version':{'type':Sequelize[_0xdd9e('0x1')],'primaryKey':!![],'autoIncrement':![]}}; \ No newline at end of file +var _0x9341=['exports','sequelize'];(function(_0x1231ac,_0x40a578){var _0x537a63=function(_0x148250){while(--_0x148250){_0x1231ac['push'](_0x1231ac['shift']());}};_0x537a63(++_0x40a578);}(_0x9341,0xff));var _0x1934=function(_0x3d9af4,_0x1963fa){_0x3d9af4=_0x3d9af4-0x0;var _0x52b53d=_0x9341[_0x3d9af4];return _0x52b53d;};'use strict';var Sequelize=require(_0x1934('0x0'));module[_0x1934('0x1')]={'version':{'type':Sequelize['STRING'],'primaryKey':!![],'autoIncrement':![]}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index b5fda97..3b40cfe 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 _0x25c8=['VIRTUAL','field','merge','options','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','crypto','desk.js','querystring','../../components/auth/service','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','error','stack','name','send','index','Migration','keys','query','filters','intersection','model','attributes','fields','length','sort','pick','where','type'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x25c8,0xb3));var _0x825c=function(_0x548709,_0x2d03bb){_0x548709=_0x548709-0x0;var _0x21e82f=_0x25c8[_0x548709];return _0x21e82f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x825c('0x0'));var rimraf=require(_0x825c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x825c('0x2'));var rp=require(_0x825c('0x3'));var moment=require(_0x825c('0x4'));var BPromise=require(_0x825c('0x5'));var Mustache=require(_0x825c('0x6'));var util=require(_0x825c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x825c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x825c('0x9'));var squel=require('squel');var crypto=require(_0x825c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x825c('0xb'));var toCsv=require(_0x825c('0x8'));var querystring=require(_0x825c('0xc'));var Papa=require('papaparse');var authService=require(_0x825c('0xd'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x825c('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x825c('0xf'))(_0x825c('0x10'));var utils=require(_0x825c('0x11'));var config=require(_0x825c('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16f565,_0x402a83){_0x402a83=_0x402a83||0xcc;return function(_0x59cf4a){if(_0x59cf4a){return _0x16f565[_0x825c('0x13')](_0x402a83);}return _0x16f565[_0x825c('0x14')](_0x402a83)[_0x825c('0x15')]();};}function respondWithResult(_0x2f9dd9,_0xe3c19c){_0xe3c19c=_0xe3c19c||0xc8;return function(_0x3f3d39){if(_0x3f3d39){return _0x2f9dd9['status'](_0xe3c19c)[_0x825c('0x16')](_0x3f3d39);}};}function respondWithFilteredResult(_0x9799b4,_0xca58eb){return function(_0x26c105){if(_0x26c105){var _0xbe93fd=_0x26c105[_0x825c('0x17')],_0x22d703=_0xca58eb[_0x825c('0x18')],_0x59daf3=_0xca58eb[_0x825c('0x18')]+_0xca58eb[_0x825c('0x19')],_0x24fcea;if(_0x59daf3>=_0xbe93fd){_0x59daf3=_0xbe93fd;_0x24fcea=0xc8;}else{_0x24fcea=0xce;}_0x9799b4[_0x825c('0x14')](_0x24fcea);return _0x9799b4[_0x825c('0x1a')]('Content-Range',_0x22d703+'-'+_0x59daf3+'/'+_0xbe93fd)[_0x825c('0x16')](_0x26c105);}return null;};}function patchUpdates(_0x321255){return function(_0x27c715){try{jsonpatch['apply'](_0x27c715,_0x321255,!![]);}catch(_0x43adbd){return BPromise[_0x825c('0x1b')](_0x43adbd);}return _0x27c715[_0x825c('0x1c')]();};}function saveUpdates(_0x3c494b,_0xc3a846){return function(_0x49ecad){if(_0x49ecad){return _0x49ecad[_0x825c('0x1d')](_0x3c494b)[_0x825c('0x1e')](function(_0x5e1e16){return _0x5e1e16;});}return null;};}function removeEntity(_0x5a2d22,_0x43a955){return function(_0x33af52){if(_0x33af52){return _0x33af52['destroy']()['then'](function(){_0x5a2d22['status'](0xcc)[_0x825c('0x15')]();});}};}function handleEntityNotFound(_0x34dec2,_0x2ca367){return function(_0x52ebbb){if(!_0x52ebbb){_0x34dec2[_0x825c('0x13')](0x194);}return _0x52ebbb;};}function handleError(_0x5f103c,_0xaab55b){_0xaab55b=_0xaab55b||0x1f4;return function(_0x5caf1d){logger[_0x825c('0x1f')](_0x5caf1d[_0x825c('0x20')]);if(_0x5caf1d[_0x825c('0x21')]){delete _0x5caf1d[_0x825c('0x21')];}_0x5f103c[_0x825c('0x14')](_0xaab55b)[_0x825c('0x22')](_0x5caf1d);};}exports[_0x825c('0x23')]=function(_0x2fa593,_0x359d4b){var _0x2ca1ed={},_0xadb83d={},_0x50c36d={'count':0x0,'rows':[]};var _0x593117=db[_0x825c('0x24')]['rawAttributes'];_0xadb83d['model']=_[_0x825c('0x25')](_0x593117);_0xadb83d[_0x825c('0x26')]=_[_0x825c('0x25')](_0x2fa593[_0x825c('0x26')]);_0xadb83d[_0x825c('0x27')]=_[_0x825c('0x28')](_0xadb83d[_0x825c('0x29')],_0xadb83d[_0x825c('0x26')]);_0x2ca1ed[_0x825c('0x2a')]=_['intersection'](_0xadb83d[_0x825c('0x29')],qs[_0x825c('0x2b')](_0x2fa593[_0x825c('0x26')][_0x825c('0x2b')]));_0x2ca1ed[_0x825c('0x2a')]=_0x2ca1ed[_0x825c('0x2a')][_0x825c('0x2c')]?_0x2ca1ed[_0x825c('0x2a')]:_0xadb83d[_0x825c('0x29')];if(!_0x2fa593[_0x825c('0x26')]['hasOwnProperty']('nolimit')){_0x2ca1ed[_0x825c('0x19')]=qs['limit'](_0x2fa593['query'][_0x825c('0x19')]);_0x2ca1ed[_0x825c('0x18')]=qs[_0x825c('0x18')](_0x2fa593[_0x825c('0x26')][_0x825c('0x18')]);}_0x2ca1ed['order']=qs[_0x825c('0x2d')](_0x2fa593[_0x825c('0x26')][_0x825c('0x2d')]);_0x2ca1ed['where']=qs[_0x825c('0x27')](_[_0x825c('0x2e')](_0x2fa593[_0x825c('0x26')],_0xadb83d['filters']));if(_0x2fa593[_0x825c('0x26')]['filter']){_0x2ca1ed[_0x825c('0x2f')]=_['merge'](_0x2ca1ed[_0x825c('0x2f')],{'$or':_['map'](_0x593117,function(_0x3612eb){if(_0x3612eb[_0x825c('0x30')]['key']!==_0x825c('0x31')){var _0x45f4e3={};_0x45f4e3[_0x3612eb[_0x825c('0x32')]]={'$like':'%'+_0x2fa593[_0x825c('0x26')]['filter']+'%'};return _0x45f4e3;}})});}_0x2ca1ed=_[_0x825c('0x33')]({},_0x2ca1ed,_0x2fa593[_0x825c('0x34')]);var _0x5cb992={'where':_0x2ca1ed['where']};return db[_0x825c('0x24')][_0x825c('0x17')](_0x5cb992)[_0x825c('0x1e')](function(_0x14bd27){_0x50c36d[_0x825c('0x17')]=_0x14bd27;if(_0x2fa593['query']['includeAll']){_0x2ca1ed[_0x825c('0x35')]=[{'all':!![]}];}return db[_0x825c('0x24')][_0x825c('0x36')](_0x2ca1ed);})[_0x825c('0x1e')](function(_0xc30a92){_0x50c36d[_0x825c('0x37')]=_0xc30a92;return _0x50c36d;})['then'](respondWithFilteredResult(_0x359d4b,_0x2ca1ed))[_0x825c('0x38')](handleError(_0x359d4b,null));}; \ No newline at end of file +var _0x8bdf=['count','offset','json','apply','reject','save','update','then','destroy','error','name','send','index','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','pick','filter','key','VIRTUAL','field','merge','options','includeAll','Migration','findAll','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','sendStatus','status','end'];(function(_0x3a86a7,_0x12ade0){var _0x19b1b6=function(_0x2af9d0){while(--_0x2af9d0){_0x3a86a7['push'](_0x3a86a7['shift']());}};_0x19b1b6(++_0x12ade0);}(_0x8bdf,0x15b));var _0xf8bd=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x8bdf[_0x311c35];return _0x5cc50c;};'use strict';var pdf=require(_0xf8bd('0x0'));var emlformat=require(_0xf8bd('0x1'));var rimraf=require(_0xf8bd('0x2'));var zipdir=require(_0xf8bd('0x3'));var jsonpatch=require(_0xf8bd('0x4'));var rp=require(_0xf8bd('0x5'));var moment=require(_0xf8bd('0x6'));var BPromise=require(_0xf8bd('0x7'));var Mustache=require('mustache');var util=require(_0xf8bd('0x8'));var path=require('path');var sox=require(_0xf8bd('0x9'));var csv=require('to-csv');var ejs=require(_0xf8bd('0xa'));var fs=require('fs');var _=require(_0xf8bd('0xb'));var squel=require(_0xf8bd('0xc'));var crypto=require(_0xf8bd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8bd('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf8bd('0xf'));var authService=require(_0xf8bd('0x10'));var hardwareService=require(_0xf8bd('0x11'));var Redis=require(_0xf8bd('0x12'));var qs=require(_0xf8bd('0x13'));var logger=require(_0xf8bd('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xf8bd('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x192b66,_0x58194e){_0x58194e=_0x58194e||0xcc;return function(_0x3945d9){if(_0x3945d9){return _0x192b66[_0xf8bd('0x16')](_0x58194e);}return _0x192b66[_0xf8bd('0x17')](_0x58194e)[_0xf8bd('0x18')]();};}function respondWithResult(_0x907bc4,_0x17bd90){_0x17bd90=_0x17bd90||0xc8;return function(_0xbe2781){if(_0xbe2781){return _0x907bc4[_0xf8bd('0x17')](_0x17bd90)['json'](_0xbe2781);}};}function respondWithFilteredResult(_0x162136,_0x220a0a){return function(_0x427253){if(_0x427253){var _0x543493=_0x427253[_0xf8bd('0x19')],_0x541024=_0x220a0a[_0xf8bd('0x1a')],_0x16873e=_0x220a0a[_0xf8bd('0x1a')]+_0x220a0a['limit'],_0xaa6aaf;if(_0x16873e>=_0x543493){_0x16873e=_0x543493;_0xaa6aaf=0xc8;}else{_0xaa6aaf=0xce;}_0x162136[_0xf8bd('0x17')](_0xaa6aaf);return _0x162136['set']('Content-Range',_0x541024+'-'+_0x16873e+'/'+_0x543493)[_0xf8bd('0x1b')](_0x427253);}return null;};}function patchUpdates(_0x2b5ae2){return function(_0x5e8bb9){try{jsonpatch[_0xf8bd('0x1c')](_0x5e8bb9,_0x2b5ae2,!![]);}catch(_0x3c3b62){return BPromise[_0xf8bd('0x1d')](_0x3c3b62);}return _0x5e8bb9[_0xf8bd('0x1e')]();};}function saveUpdates(_0x29c66c,_0x4bf682){return function(_0x4f5ad1){if(_0x4f5ad1){return _0x4f5ad1[_0xf8bd('0x1f')](_0x29c66c)[_0xf8bd('0x20')](function(_0x28d267){return _0x28d267;});}return null;};}function removeEntity(_0x4a0fdd,_0x459324){return function(_0x298051){if(_0x298051){return _0x298051[_0xf8bd('0x21')]()[_0xf8bd('0x20')](function(){_0x4a0fdd[_0xf8bd('0x17')](0xcc)[_0xf8bd('0x18')]();});}};}function handleEntityNotFound(_0x13c4dc,_0x486358){return function(_0x5005cd){if(!_0x5005cd){_0x13c4dc[_0xf8bd('0x16')](0x194);}return _0x5005cd;};}function handleError(_0xcf7203,_0x335ac8){_0x335ac8=_0x335ac8||0x1f4;return function(_0x33d9d8){logger[_0xf8bd('0x22')](_0x33d9d8['stack']);if(_0x33d9d8[_0xf8bd('0x23')]){delete _0x33d9d8[_0xf8bd('0x23')];}_0xcf7203[_0xf8bd('0x17')](_0x335ac8)[_0xf8bd('0x24')](_0x33d9d8);};}exports[_0xf8bd('0x25')]=function(_0x58514a,_0x3ed662){var _0x1161d1={},_0x2bb682={},_0x33a04f={'count':0x0,'rows':[]};var _0x1e8d7f=db['Migration']['rawAttributes'];_0x2bb682['model']=_[_0xf8bd('0x26')](_0x1e8d7f);_0x2bb682['query']=_[_0xf8bd('0x26')](_0x58514a[_0xf8bd('0x27')]);_0x2bb682[_0xf8bd('0x28')]=_['intersection'](_0x2bb682[_0xf8bd('0x29')],_0x2bb682['query']);_0x1161d1[_0xf8bd('0x2a')]=_[_0xf8bd('0x2b')](_0x2bb682[_0xf8bd('0x29')],qs[_0xf8bd('0x2c')](_0x58514a[_0xf8bd('0x27')][_0xf8bd('0x2c')]));_0x1161d1[_0xf8bd('0x2a')]=_0x1161d1['attributes']['length']?_0x1161d1[_0xf8bd('0x2a')]:_0x2bb682[_0xf8bd('0x29')];if(!_0x58514a[_0xf8bd('0x27')][_0xf8bd('0x2d')]('nolimit')){_0x1161d1[_0xf8bd('0x2e')]=qs['limit'](_0x58514a[_0xf8bd('0x27')][_0xf8bd('0x2e')]);_0x1161d1['offset']=qs[_0xf8bd('0x1a')](_0x58514a[_0xf8bd('0x27')][_0xf8bd('0x1a')]);}_0x1161d1[_0xf8bd('0x2f')]=qs[_0xf8bd('0x30')](_0x58514a[_0xf8bd('0x27')]['sort']);_0x1161d1[_0xf8bd('0x31')]=qs['filters'](_[_0xf8bd('0x32')](_0x58514a[_0xf8bd('0x27')],_0x2bb682[_0xf8bd('0x28')]));if(_0x58514a['query'][_0xf8bd('0x33')]){_0x1161d1[_0xf8bd('0x31')]=_['merge'](_0x1161d1[_0xf8bd('0x31')],{'$or':_['map'](_0x1e8d7f,function(_0x289598){if(_0x289598['type'][_0xf8bd('0x34')]!==_0xf8bd('0x35')){var _0x5f0ebc={};_0x5f0ebc[_0x289598[_0xf8bd('0x36')]]={'$like':'%'+_0x58514a[_0xf8bd('0x27')]['filter']+'%'};return _0x5f0ebc;}})});}_0x1161d1=_[_0xf8bd('0x37')]({},_0x1161d1,_0x58514a[_0xf8bd('0x38')]);var _0x3857a5={'where':_0x1161d1[_0xf8bd('0x31')]};return db['Migration'][_0xf8bd('0x19')](_0x3857a5)[_0xf8bd('0x20')](function(_0x4db020){_0x33a04f[_0xf8bd('0x19')]=_0x4db020;if(_0x58514a[_0xf8bd('0x27')][_0xf8bd('0x39')]){_0x1161d1['include']=[{'all':!![]}];}return db[_0xf8bd('0x3a')][_0xf8bd('0x3b')](_0x1161d1);})[_0xf8bd('0x20')](function(_0x117592){_0x33a04f[_0xf8bd('0x3c')]=_0x117592;return _0x33a04f;})['then'](respondWithFilteredResult(_0x3ed662,_0x1161d1))[_0xf8bd('0x3d')](handleError(_0x3ed662,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 1e3663c..8f3dceb 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 _0xf08c=['migrations','lodash','util','../../config/logger','moment','bluebird','request-promise','./migration.attributes','define'];(function(_0x142643,_0x143d17){var _0x41576b=function(_0x2262e4){while(--_0x2262e4){_0x142643['push'](_0x142643['shift']());}};_0x41576b(++_0x143d17);}(_0xf08c,0xb5));var _0xcf08=function(_0x395733,_0x5ef459){_0x395733=_0x395733-0x0;var _0x16c8cb=_0xf08c[_0x395733];return _0x16c8cb;};'use strict';var _=require(_0xcf08('0x0'));var util=require(_0xcf08('0x1'));var logger=require(_0xcf08('0x2'))('api');var moment=require(_0xcf08('0x3'));var BPromise=require(_0xcf08('0x4'));var rp=require(_0xcf08('0x5'));var attributes=require(_0xcf08('0x6'));module['exports']=function(_0x5c54ac,_0x1fd91d){return _0x5c54ac[_0xcf08('0x7')]('Migration',attributes,{'tableName':_0xcf08('0x8'),'paranoid':![],'indexes':[],'timestamps':![]});}; \ No newline at end of file +var _0x9bd9=['api','moment','bluebird','./migration.attributes','Migration','migrations','lodash','util','../../config/logger'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x2eda7d,_0x162382){_0x2eda7d=_0x2eda7d-0x0;var _0x2fd21d=_0x9bd9[_0x2eda7d];return _0x2fd21d;};'use strict';var _=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var logger=require(_0x99bd('0x2'))(_0x99bd('0x3'));var moment=require(_0x99bd('0x4'));var BPromise=require(_0x99bd('0x5'));var rp=require('request-promise');var attributes=require(_0x99bd('0x6'));module['exports']=function(_0x204fbb,_0x1b3141){return _0x204fbb['define'](_0x99bd('0x7'),attributes,{'tableName':_0x99bd('0x8'),'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 9f4d2ce..de50780 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 _0xa37e=['Migration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0xe94ada,_0x4b2897){var _0x4dc5e3=function(_0x5cdfd8){while(--_0x5cdfd8){_0xe94ada['push'](_0xe94ada['shift']());}};_0x4dc5e3(++_0x4b2897);}(_0xa37e,0x97));var _0xea37=function(_0x3aac8e,_0x1d725a){_0x3aac8e=_0x3aac8e-0x0;var _0x1b0049=_0xa37e[_0x3aac8e];return _0x1b0049;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea37('0x0'));var BPromise=require(_0xea37('0x1'));var rs=require(_0xea37('0x2'));var fs=require('fs');var Redis=require(_0xea37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea37('0x4'));var logger=require('../../config/logger')(_0xea37('0x5'));var config=require(_0xea37('0x6'));var jayson=require(_0xea37('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36c489,_0x4a9e08,_0x4ae081){return new BPromise(function(_0x2c2890,_0x1401e1){return client[_0xea37('0x8')](_0x36c489,_0x4ae081)[_0xea37('0x9')](function(_0x5e4ebe){logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,_0xea37('0xc'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x4a9e08,_0xea37('0xc'),JSON[_0xea37('0xd')](_0x5e4ebe));if(_0x5e4ebe[_0xea37('0xe')]){if(_0x5e4ebe['error'][_0xea37('0xf')]===0x1f4){logger[_0xea37('0xe')](_0xea37('0xb'),_0x4a9e08,_0x5e4ebe['error'][_0xea37('0x10')]);return _0x1401e1(_0x5e4ebe[_0xea37('0xe')]['message']);}logger[_0xea37('0xe')]('Migration,\x20%s,\x20%s',_0x4a9e08,_0x5e4ebe[_0xea37('0xe')]['message']);return _0x2c2890(_0x5e4ebe[_0xea37('0xe')][_0xea37('0x10')]);}else{logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,'request\x20sent');_0x2c2890(_0x5e4ebe[_0xea37('0x11')]['message']);}})['catch'](function(_0x3ae3cc){logger['error'](_0xea37('0xb'),_0x4a9e08,_0x3ae3cc);_0x1401e1(_0x3ae3cc);});});} \ No newline at end of file +var _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x268394,_0x1d52c4){var _0x5a32ce=function(_0x1cba5c){while(--_0x1cba5c){_0x268394['push'](_0x268394['shift']());}};_0x5a32ce(++_0x1d52c4);}(_0xac9d,0x14d));var _0xdac9=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0xac9d[_0x139b85];return _0x1e833f;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3066928..c0c449b 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 _0x8466=['create','put','update','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8466,0x139));var _0x6846=function(_0x50ca14,_0x1d2686){_0x50ca14=_0x50ca14-0x0;var _0x508bc5=_0x8466[_0x50ca14];return _0x508bc5;};'use strict';var multer=require(_0x6846('0x0'));var util=require(_0x6846('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6846('0x2'));var router=express['Router']();var auth=require(_0x6846('0x3'));var interaction=require(_0x6846('0x4'));var config=require('../../config/environment');var controller=require('./network.controller');router['get']('/',auth[_0x6846('0x5')](),controller[_0x6846('0x6')]);router[_0x6846('0x7')](_0x6846('0x8'),auth[_0x6846('0x5')](),controller['show']);router['post']('/',auth[_0x6846('0x5')](),controller[_0x6846('0x9')]);router[_0x6846('0xa')](_0x6846('0x8'),auth[_0x6846('0x5')](),controller[_0x6846('0xb')]);router['delete'](_0x6846('0x8'),auth[_0x6846('0x5')](),controller[_0x6846('0xc')]);module[_0x6846('0xd')]=router; \ No newline at end of file +var _0x57c9=['express','Router','./network.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','path'];(function(_0x139a25,_0x1707d7){var _0x330a62=function(_0x3092b4){while(--_0x3092b4){_0x139a25['push'](_0x139a25['shift']());}};_0x330a62(++_0x1707d7);}(_0x57c9,0xee));var _0x957c=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x57c9[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x957c('0x0'));var util=require('util');var path=require(_0x957c('0x1'));var timeout=require('connect-timeout');var express=require(_0x957c('0x2'));var router=express[_0x957c('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x957c('0x4'));router[_0x957c('0x5')]('/',auth[_0x957c('0x6')](),controller[_0x957c('0x7')]);router[_0x957c('0x5')](_0x957c('0x8'),auth[_0x957c('0x6')](),controller[_0x957c('0x9')]);router[_0x957c('0xa')]('/',auth[_0x957c('0x6')](),controller['create']);router['put'](_0x957c('0x8'),auth[_0x957c('0x6')](),controller[_0x957c('0xb')]);router[_0x957c('0xc')](_0x957c('0x8'),auth[_0x957c('0x6')](),controller[_0x957c('0xd')]);module[_0x957c('0xe')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 8d52df3..bb9ca57 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 _0xf8c8=['ENUM','localnet','externip','STRING','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf8c8,0x8b));var _0x8f8c=function(_0xe9e16e,_0x144428){_0xe9e16e=_0xe9e16e-0x0;var _0x405d1d=_0xf8c8[_0xe9e16e];return _0x405d1d;};'use strict';var Sequelize=require('sequelize');module[_0x8f8c('0x0')]={'type':{'type':Sequelize[_0x8f8c('0x1')](_0x8f8c('0x2'),_0x8f8c('0x3'))},'value':{'type':Sequelize[_0x8f8c('0x4')]}}; \ No newline at end of file +var _0x3ca7=['sequelize','exports','ENUM','localnet','externip','STRING'];(function(_0x59ee84,_0x50a826){var _0x3c25ac=function(_0x277fc8){while(--_0x277fc8){_0x59ee84['push'](_0x59ee84['shift']());}};_0x3c25ac(++_0x50a826);}(_0x3ca7,0x15c));var _0x73ca=function(_0x28509b,_0x5831ff){_0x28509b=_0x28509b-0x0;var _0x1e0b6=_0x3ca7[_0x28509b];return _0x1e0b6;};'use strict';var Sequelize=require(_0x73ca('0x0'));module[_0x73ca('0x1')]={'type':{'type':Sequelize[_0x73ca('0x2')](_0x73ca('0x3'),_0x73ca('0x4'))},'value':{'type':Sequelize[_0x73ca('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index de5714b..80ac087 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 _0x2b31=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','http','request','then','info','request\x20sent','stringify','error','message','Network,\x20%s,\x20%s','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','Network','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','map','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','sequelize','transaction','create','body','join','root','server/files/templates/network.ejs','utf8','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','type','Reload','chan_sip.so','find','readFileSync','toLowerCase','render','html-pdf','eml-format'];(function(_0xc2c89,_0x22c701){var _0x4f9032=function(_0x1fbeae){while(--_0x1fbeae){_0xc2c89['push'](_0xc2c89['shift']());}};_0x4f9032(++_0x22c701);}(_0x2b31,0x1de));var _0x12b3=function(_0x586b1e,_0x82632c){_0x586b1e=_0x586b1e-0x0;var _0x57d65a=_0x2b31[_0x586b1e];return _0x57d65a;};'use strict';var pdf=require(_0x12b3('0x0'));var emlformat=require(_0x12b3('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x12b3('0x2'));var rp=require('request-promise');var moment=require(_0x12b3('0x3'));var BPromise=require(_0x12b3('0x4'));var Mustache=require(_0x12b3('0x5'));var util=require(_0x12b3('0x6'));var path=require(_0x12b3('0x7'));var sox=require(_0x12b3('0x8'));var csv=require(_0x12b3('0x9'));var ejs=require(_0x12b3('0xa'));var fs=require('fs');var _=require(_0x12b3('0xb'));var squel=require(_0x12b3('0xc'));var crypto=require(_0x12b3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x12b3('0xe'));var toCsv=require(_0x12b3('0x9'));var querystring=require(_0x12b3('0xf'));var Papa=require(_0x12b3('0x10'));var authService=require(_0x12b3('0x11'));var hardwareService=require(_0x12b3('0x12'));var Redis=require(_0x12b3('0x13'));var qs=require(_0x12b3('0x14'));var logger=require(_0x12b3('0x15'))(_0x12b3('0x16'));var utils=require(_0x12b3('0x17'));var config=require('../../config/environment');var db=require(_0x12b3('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x12b3('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x213987,_0x4318b9,_0x4a52ef,_0xa62fd6){return new BPromise(function(_0x3120f1,_0x31e49d){var _0x76848c=_0xa62fd6||client;return _0x76848c[_0x12b3('0x1a')](_0x213987,_0x4a52ef)[_0x12b3('0x1b')](function(_0x509b5d){logger[_0x12b3('0x1c')]('Network,\x20%s,\x20%s',_0x4318b9,_0x12b3('0x1d'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x4318b9,'request\x20sent',JSON[_0x12b3('0x1e')](_0x509b5d));if(_0x509b5d[_0x12b3('0x1f')]){if(_0x509b5d[_0x12b3('0x1f')]['code']===0x1f4){logger[_0x12b3('0x1f')]('Network,\x20%s,\x20%s',_0x4318b9,_0x509b5d['error'][_0x12b3('0x20')]);return _0x31e49d(_0x509b5d[_0x12b3('0x1f')]['message']);}logger[_0x12b3('0x1f')](_0x12b3('0x21'),_0x4318b9,_0x509b5d[_0x12b3('0x1f')]['message']);return _0x3120f1(_0x509b5d[_0x12b3('0x1f')][_0x12b3('0x20')]);}else{logger[_0x12b3('0x1c')]('Network,\x20%s,\x20%s',_0x4318b9,_0x12b3('0x1d'));_0x3120f1(_0x509b5d[_0x12b3('0x22')][_0x12b3('0x20')]);}})[_0x12b3('0x23')](function(_0x4b5c7a){logger['error']('Network,\x20%s,\x20%s',_0x4318b9,_0x4b5c7a);_0x31e49d(_0x4b5c7a);});});}function respondWithStatusCode(_0x15588d,_0x2728bd){_0x2728bd=_0x2728bd||0xcc;return function(_0x1f1fde){if(_0x1f1fde){return _0x15588d[_0x12b3('0x24')](_0x2728bd);}return _0x15588d['status'](_0x2728bd)[_0x12b3('0x25')]();};}function respondWithResult(_0x4cd818,_0x59d11c){_0x59d11c=_0x59d11c||0xc8;return function(_0x518699){if(_0x518699){return _0x4cd818[_0x12b3('0x26')](_0x59d11c)['json'](_0x518699);}};}function respondWithFilteredResult(_0x42423a,_0x49f6bc){return function(_0x5e0c33){if(_0x5e0c33){var _0x2aa132=_0x5e0c33[_0x12b3('0x27')],_0x42ab2c=_0x49f6bc[_0x12b3('0x28')],_0x3ae7af=_0x49f6bc['offset']+_0x49f6bc[_0x12b3('0x29')],_0x370694;if(_0x3ae7af>=_0x2aa132){_0x3ae7af=_0x2aa132;_0x370694=0xc8;}else{_0x370694=0xce;}_0x42423a[_0x12b3('0x26')](_0x370694);return _0x42423a[_0x12b3('0x2a')](_0x12b3('0x2b'),_0x42ab2c+'-'+_0x3ae7af+'/'+_0x2aa132)['json'](_0x5e0c33);}return null;};}function patchUpdates(_0x5f2d65){return function(_0xbf412b){try{jsonpatch[_0x12b3('0x2c')](_0xbf412b,_0x5f2d65,!![]);}catch(_0x1e6e4d){return BPromise[_0x12b3('0x2d')](_0x1e6e4d);}return _0xbf412b[_0x12b3('0x2e')]();};}function saveUpdates(_0x406177,_0xef63bf){return function(_0x3cc169){if(_0x3cc169){return _0x3cc169[_0x12b3('0x2f')](_0x406177)[_0x12b3('0x1b')](function(_0x15dbb6){return _0x15dbb6;});}return null;};}function removeEntity(_0x491f3f,_0x2721a3){return function(_0x47b70c){if(_0x47b70c){return _0x47b70c[_0x12b3('0x30')]()['then'](function(){_0x491f3f['status'](0xcc)[_0x12b3('0x25')]();});}};}function handleEntityNotFound(_0x40a891,_0x303679){return function(_0x1a4f11){if(!_0x1a4f11){_0x40a891[_0x12b3('0x24')](0x194);}return _0x1a4f11;};}function handleError(_0x3812d9,_0x36b4cb){_0x36b4cb=_0x36b4cb||0x1f4;return function(_0x2a233f){logger['error'](_0x2a233f['stack']);if(_0x2a233f[_0x12b3('0x31')]){delete _0x2a233f[_0x12b3('0x31')];}_0x3812d9[_0x12b3('0x26')](_0x36b4cb)[_0x12b3('0x32')](_0x2a233f);};}exports[_0x12b3('0x33')]=function(_0x15fd74,_0x1c92a8){var _0x5a2738={},_0x74702e={},_0x5b3c1b={'count':0x0,'rows':[]};var _0x59b1dd=db[_0x12b3('0x34')][_0x12b3('0x35')];_0x74702e[_0x12b3('0x36')]=_[_0x12b3('0x37')](_0x59b1dd);_0x74702e[_0x12b3('0x38')]=_[_0x12b3('0x37')](_0x15fd74[_0x12b3('0x38')]);_0x74702e[_0x12b3('0x39')]=_[_0x12b3('0x3a')](_0x74702e['model'],_0x74702e[_0x12b3('0x38')]);_0x5a2738[_0x12b3('0x3b')]=_[_0x12b3('0x3a')](_0x74702e[_0x12b3('0x36')],qs['fields'](_0x15fd74[_0x12b3('0x38')][_0x12b3('0x3c')]));_0x5a2738[_0x12b3('0x3b')]=_0x5a2738['attributes']['length']?_0x5a2738[_0x12b3('0x3b')]:_0x74702e[_0x12b3('0x36')];if(!_0x15fd74[_0x12b3('0x38')][_0x12b3('0x3d')](_0x12b3('0x3e'))){_0x5a2738['limit']=qs[_0x12b3('0x29')](_0x15fd74[_0x12b3('0x38')][_0x12b3('0x29')]);_0x5a2738[_0x12b3('0x28')]=qs[_0x12b3('0x28')](_0x15fd74[_0x12b3('0x38')][_0x12b3('0x28')]);}_0x5a2738['order']=qs[_0x12b3('0x3f')](_0x15fd74['query'][_0x12b3('0x3f')]);_0x5a2738[_0x12b3('0x40')]=qs[_0x12b3('0x39')](_['pick'](_0x15fd74[_0x12b3('0x38')],_0x74702e['filters']));if(_0x15fd74['query']['filter']){_0x5a2738[_0x12b3('0x40')]=_[_0x12b3('0x41')](_0x5a2738['where'],{'$or':_[_0x12b3('0x42')](_0x59b1dd,function(_0x143574){if(_0x143574['type'][_0x12b3('0x43')]!==_0x12b3('0x44')){var _0x1dea39={};_0x1dea39[_0x143574['field']]={'$like':'%'+_0x15fd74[_0x12b3('0x38')][_0x12b3('0x45')]+'%'};return _0x1dea39;}})});}_0x5a2738=_[_0x12b3('0x41')]({},_0x5a2738,_0x15fd74[_0x12b3('0x46')]);var _0x438d0d={'where':_0x5a2738[_0x12b3('0x40')]};return db[_0x12b3('0x34')]['count'](_0x438d0d)['then'](function(_0x28b50b){_0x5b3c1b[_0x12b3('0x27')]=_0x28b50b;if(_0x15fd74[_0x12b3('0x38')][_0x12b3('0x47')]){_0x5a2738[_0x12b3('0x48')]=[{'all':!![]}];}return db['Network'][_0x12b3('0x49')](_0x5a2738);})[_0x12b3('0x1b')](function(_0x2b98b0){_0x5b3c1b[_0x12b3('0x4a')]=_0x2b98b0;return _0x5b3c1b;})[_0x12b3('0x1b')](respondWithFilteredResult(_0x1c92a8,_0x5a2738))[_0x12b3('0x23')](handleError(_0x1c92a8,null));};exports[_0x12b3('0x4b')]=function(_0x28e377,_0x5bfff2){var _0x3b964e={'raw':!![],'where':{'id':_0x28e377[_0x12b3('0x4c')]['id']}},_0x4fdb53={};_0x4fdb53['model']=_['keys'](db[_0x12b3('0x34')]['rawAttributes']);_0x4fdb53[_0x12b3('0x38')]=_[_0x12b3('0x37')](_0x28e377[_0x12b3('0x38')]);_0x4fdb53[_0x12b3('0x39')]=_[_0x12b3('0x3a')](_0x4fdb53[_0x12b3('0x36')],_0x4fdb53[_0x12b3('0x38')]);_0x3b964e[_0x12b3('0x3b')]=_[_0x12b3('0x3a')](_0x4fdb53[_0x12b3('0x36')],qs[_0x12b3('0x3c')](_0x28e377[_0x12b3('0x38')][_0x12b3('0x3c')]));_0x3b964e[_0x12b3('0x3b')]=_0x3b964e[_0x12b3('0x3b')][_0x12b3('0x4d')]?_0x3b964e[_0x12b3('0x3b')]:_0x4fdb53[_0x12b3('0x36')];if(_0x28e377[_0x12b3('0x38')][_0x12b3('0x47')]){_0x3b964e[_0x12b3('0x48')]=[{'all':!![]}];}_0x3b964e=_[_0x12b3('0x41')]({},_0x3b964e,_0x28e377['options']);return db['Network']['find'](_0x3b964e)[_0x12b3('0x1b')](handleEntityNotFound(_0x5bfff2,null))[_0x12b3('0x1b')](respondWithResult(_0x5bfff2,null))[_0x12b3('0x23')](handleError(_0x5bfff2,null));};exports['create']=function(_0x3fade3,_0x302244,_0x35fb7b){var _0x493ea9;return db[_0x12b3('0x4e')][_0x12b3('0x4f')](function(_0x63f725){return db[_0x12b3('0x34')][_0x12b3('0x50')](_0x3fade3[_0x12b3('0x51')],{'raw':!![]})[_0x12b3('0x1b')](function(_0x201315){_0x493ea9=_0x201315;return db[_0x12b3('0x34')][_0x12b3('0x49')]({'where':{'type':_0x3fade3[_0x12b3('0x51')]['type']},'raw':!![]});})['then'](function(_0x3eb227){var _0x13c76f=fs['readFileSync'](path[_0x12b3('0x52')](config[_0x12b3('0x53')],_0x12b3('0x54')),_0x12b3('0x55'));var _0x12bccd=ejs['render'](_0x13c76f,{'networks':_0x3eb227||[]});fs[_0x12b3('0x56')](util[_0x12b3('0x57')](_0x12b3('0x58'),_0x3fade3[_0x12b3('0x51')][_0x12b3('0x59')]['toLowerCase']()),_0x12bccd);})['then'](function(){return respondWithRpcPromise(_0x12b3('0x5a'),_0x12b3('0x50'),{'module':_0x12b3('0x5b')});})[_0x12b3('0x1b')](function(){return _0x493ea9;});})[_0x12b3('0x1b')](respondWithResult(_0x302244,0xc9))[_0x12b3('0x23')](handleError(_0x302244,null));};exports[_0x12b3('0x2f')]=function(_0x3a4b13,_0x4d427c,_0x16d644){var _0x43c7eb;return db[_0x12b3('0x4e')]['transaction'](function(_0x6558e2){return db[_0x12b3('0x34')][_0x12b3('0x5c')]({'where':{'id':_0x3a4b13[_0x12b3('0x4c')]['id']}})[_0x12b3('0x1b')](handleEntityNotFound(_0x4d427c,null))[_0x12b3('0x1b')](saveUpdates(_0x3a4b13[_0x12b3('0x51')],null))[_0x12b3('0x1b')](function(_0x438d42){if(_0x438d42){_0x43c7eb=_0x438d42;return db['Network']['findAll']({'where':{'type':_0x43c7eb[_0x12b3('0x59')]},'raw':!![]});}return null;})[_0x12b3('0x1b')](function(_0x146a66){if(_0x146a66){var _0x1d16ee=fs[_0x12b3('0x5d')](path['join'](config[_0x12b3('0x53')],_0x12b3('0x54')),_0x12b3('0x55'));var _0x2bcc56=ejs['render'](_0x1d16ee,{'networks':_0x146a66||[]});fs[_0x12b3('0x56')](util[_0x12b3('0x57')](_0x12b3('0x58'),_0x43c7eb['type'][_0x12b3('0x5e')]()),_0x2bcc56);return respondWithRpcPromise(_0x12b3('0x5a'),'update',{'module':_0x12b3('0x5b')});}return null;})['then'](function(_0x591f3c){if(_0x591f3c){return _0x43c7eb;}return null;});})[_0x12b3('0x1b')](respondWithResult(_0x4d427c,null))['catch'](handleError(_0x4d427c,null));};exports['destroy']=function(_0x9386f7,_0xc6d8db,_0x58b0f3){var _0x3079a9;return db[_0x12b3('0x34')][_0x12b3('0x5c')]({'where':{'id':_0x9386f7[_0x12b3('0x4c')]['id']}})[_0x12b3('0x1b')](function(_0xecbcb0){_0x3079a9=_0xecbcb0;return _0xecbcb0;})['then'](handleEntityNotFound(_0xc6d8db,null))[_0x12b3('0x1b')](removeEntity(_0xc6d8db,null))[_0x12b3('0x1b')](function(){if(_0x3079a9){return db[_0x12b3('0x34')][_0x12b3('0x49')]({'where':{'type':_0x3079a9[_0x12b3('0x59')]},'raw':!![]});}})[_0x12b3('0x1b')](function(_0x3c334e){if(_0x3c334e){var _0xfd7cb9=fs['readFileSync'](path[_0x12b3('0x52')](config['root'],_0x12b3('0x54')),_0x12b3('0x55'));var _0x4872b3=ejs[_0x12b3('0x5f')](_0xfd7cb9,{'networks':_0x3c334e||[]});fs[_0x12b3('0x56')](util[_0x12b3('0x57')]('/etc/asterisk/sip_xcally_%s.conf',_0x3079a9[_0x12b3('0x59')][_0x12b3('0x5e')]()),_0x4872b3);return respondWithRpcPromise(_0x12b3('0x5a'),_0x12b3('0x30'),{'module':_0x12b3('0x5b')});}})[_0x12b3('0x23')](handleError(_0xc6d8db,null));}; \ No newline at end of file +var _0x7001=['utf8','destroy','join','html-pdf','rimraf','request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','stack','name','send','index','Network','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','map','type','key','VIRTUAL','field','filter','merge','options','where','includeAll','include','catch','params','find','create','sequelize','transaction','body','findAll','readFileSync','server/files/templates/network.ejs','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','update','root'];(function(_0x1f7eeb,_0xe9082a){var _0x1d86bb=function(_0x36b868){while(--_0x36b868){_0x1f7eeb['push'](_0x1f7eeb['shift']());}};_0x1d86bb(++_0xe9082a);}(_0x7001,0x126));var _0x1700=function(_0x1c55ab,_0x8529e3){_0x1c55ab=_0x1c55ab-0x0;var _0x3662bf=_0x7001[_0x1c55ab];return _0x3662bf;};'use strict';var pdf=require(_0x1700('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1700('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1700('0x2'));var moment=require(_0x1700('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1700('0x4'));var util=require(_0x1700('0x5'));var path=require('path');var sox=require(_0x1700('0x6'));var csv=require('to-csv');var ejs=require(_0x1700('0x7'));var fs=require('fs');var _=require(_0x1700('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1700('0x9'));var deskjs=require(_0x1700('0xa'));var toCsv=require(_0x1700('0xb'));var querystring=require(_0x1700('0xc'));var Papa=require(_0x1700('0xd'));var authService=require(_0x1700('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x1700('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x1700('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x1700('0x11'));var db=require(_0x1700('0x12'))['db'];var jayson=require(_0x1700('0x13'));var client=jayson[_0x1700('0x14')][_0x1700('0x15')]({'port':0x232a});function respondWithRpcPromise(_0xbce73e,_0x4252ce,_0x1eb9af,_0x177a4c){return new BPromise(function(_0xcbe10e,_0xd2565d){var _0x4c560f=_0x177a4c||client;return _0x4c560f[_0x1700('0x16')](_0xbce73e,_0x1eb9af)[_0x1700('0x17')](function(_0x1550fa){logger[_0x1700('0x18')](_0x1700('0x19'),_0x4252ce,'request\x20sent');logger['debug'](_0x1700('0x1a'),_0x4252ce,'request\x20sent',JSON[_0x1700('0x1b')](_0x1550fa));if(_0x1550fa[_0x1700('0x1c')]){if(_0x1550fa[_0x1700('0x1c')][_0x1700('0x1d')]===0x1f4){logger[_0x1700('0x1c')](_0x1700('0x19'),_0x4252ce,_0x1550fa[_0x1700('0x1c')][_0x1700('0x1e')]);return _0xd2565d(_0x1550fa[_0x1700('0x1c')]['message']);}logger[_0x1700('0x1c')](_0x1700('0x19'),_0x4252ce,_0x1550fa[_0x1700('0x1c')]['message']);return _0xcbe10e(_0x1550fa[_0x1700('0x1c')][_0x1700('0x1e')]);}else{logger[_0x1700('0x18')](_0x1700('0x19'),_0x4252ce,_0x1700('0x1f'));_0xcbe10e(_0x1550fa[_0x1700('0x20')][_0x1700('0x1e')]);}})['catch'](function(_0x235d03){logger[_0x1700('0x1c')](_0x1700('0x19'),_0x4252ce,_0x235d03);_0xd2565d(_0x235d03);});});}function respondWithStatusCode(_0x2a1069,_0x3d0416){_0x3d0416=_0x3d0416||0xcc;return function(_0x2f0a9a){if(_0x2f0a9a){return _0x2a1069[_0x1700('0x21')](_0x3d0416);}return _0x2a1069[_0x1700('0x22')](_0x3d0416)[_0x1700('0x23')]();};}function respondWithResult(_0x545c11,_0x5588ff){_0x5588ff=_0x5588ff||0xc8;return function(_0x30c3e6){if(_0x30c3e6){return _0x545c11[_0x1700('0x22')](_0x5588ff)[_0x1700('0x24')](_0x30c3e6);}};}function respondWithFilteredResult(_0x2bbe4e,_0x2bc6df){return function(_0x1e5bc7){if(_0x1e5bc7){var _0x3a488a=_0x1e5bc7[_0x1700('0x25')],_0xf71a5c=_0x2bc6df[_0x1700('0x26')],_0x51334f=_0x2bc6df[_0x1700('0x26')]+_0x2bc6df['limit'],_0x5304f4;if(_0x51334f>=_0x3a488a){_0x51334f=_0x3a488a;_0x5304f4=0xc8;}else{_0x5304f4=0xce;}_0x2bbe4e['status'](_0x5304f4);return _0x2bbe4e[_0x1700('0x27')](_0x1700('0x28'),_0xf71a5c+'-'+_0x51334f+'/'+_0x3a488a)[_0x1700('0x24')](_0x1e5bc7);}return null;};}function patchUpdates(_0x3c7726){return function(_0x1e6415){try{jsonpatch[_0x1700('0x29')](_0x1e6415,_0x3c7726,!![]);}catch(_0x43eadb){return BPromise[_0x1700('0x2a')](_0x43eadb);}return _0x1e6415[_0x1700('0x2b')]();};}function saveUpdates(_0x5b91ae,_0x2e55c7){return function(_0x527a06){if(_0x527a06){return _0x527a06['update'](_0x5b91ae)['then'](function(_0x28630e){return _0x28630e;});}return null;};}function removeEntity(_0x3cd959,_0x2deaa4){return function(_0x3383de){if(_0x3383de){return _0x3383de['destroy']()[_0x1700('0x17')](function(){_0x3cd959[_0x1700('0x22')](0xcc)[_0x1700('0x23')]();});}};}function handleEntityNotFound(_0x2fa7b0,_0x18e21f){return function(_0x497de7){if(!_0x497de7){_0x2fa7b0['sendStatus'](0x194);}return _0x497de7;};}function handleError(_0x3c4998,_0x399d5c){_0x399d5c=_0x399d5c||0x1f4;return function(_0x5db9e3){logger[_0x1700('0x1c')](_0x5db9e3[_0x1700('0x2c')]);if(_0x5db9e3['name']){delete _0x5db9e3[_0x1700('0x2d')];}_0x3c4998['status'](_0x399d5c)[_0x1700('0x2e')](_0x5db9e3);};}exports[_0x1700('0x2f')]=function(_0x2bcf2b,_0xda5e60){var _0x3735fe={},_0x205bce={},_0x524503={'count':0x0,'rows':[]};var _0x9b3392=db[_0x1700('0x30')][_0x1700('0x31')];_0x205bce[_0x1700('0x32')]=_['keys'](_0x9b3392);_0x205bce[_0x1700('0x33')]=_[_0x1700('0x34')](_0x2bcf2b[_0x1700('0x33')]);_0x205bce['filters']=_[_0x1700('0x35')](_0x205bce[_0x1700('0x32')],_0x205bce[_0x1700('0x33')]);_0x3735fe[_0x1700('0x36')]=_[_0x1700('0x35')](_0x205bce[_0x1700('0x32')],qs[_0x1700('0x37')](_0x2bcf2b[_0x1700('0x33')][_0x1700('0x37')]));_0x3735fe[_0x1700('0x36')]=_0x3735fe['attributes'][_0x1700('0x38')]?_0x3735fe[_0x1700('0x36')]:_0x205bce[_0x1700('0x32')];if(!_0x2bcf2b[_0x1700('0x33')][_0x1700('0x39')](_0x1700('0x3a'))){_0x3735fe[_0x1700('0x3b')]=qs[_0x1700('0x3b')](_0x2bcf2b[_0x1700('0x33')][_0x1700('0x3b')]);_0x3735fe[_0x1700('0x26')]=qs[_0x1700('0x26')](_0x2bcf2b[_0x1700('0x33')][_0x1700('0x26')]);}_0x3735fe[_0x1700('0x3c')]=qs[_0x1700('0x3d')](_0x2bcf2b[_0x1700('0x33')]['sort']);_0x3735fe['where']=qs[_0x1700('0x3e')](_[_0x1700('0x3f')](_0x2bcf2b['query'],_0x205bce[_0x1700('0x3e')]));if(_0x2bcf2b[_0x1700('0x33')]['filter']){_0x3735fe['where']=_['merge'](_0x3735fe['where'],{'$or':_[_0x1700('0x40')](_0x9b3392,function(_0x1f9662){if(_0x1f9662[_0x1700('0x41')][_0x1700('0x42')]!==_0x1700('0x43')){var _0x4793c5={};_0x4793c5[_0x1f9662[_0x1700('0x44')]]={'$like':'%'+_0x2bcf2b[_0x1700('0x33')][_0x1700('0x45')]+'%'};return _0x4793c5;}})});}_0x3735fe=_[_0x1700('0x46')]({},_0x3735fe,_0x2bcf2b[_0x1700('0x47')]);var _0x5e6056={'where':_0x3735fe[_0x1700('0x48')]};return db[_0x1700('0x30')][_0x1700('0x25')](_0x5e6056)['then'](function(_0x4243b8){_0x524503['count']=_0x4243b8;if(_0x2bcf2b[_0x1700('0x33')][_0x1700('0x49')]){_0x3735fe[_0x1700('0x4a')]=[{'all':!![]}];}return db[_0x1700('0x30')]['findAll'](_0x3735fe);})[_0x1700('0x17')](function(_0x5ed262){_0x524503['rows']=_0x5ed262;return _0x524503;})[_0x1700('0x17')](respondWithFilteredResult(_0xda5e60,_0x3735fe))[_0x1700('0x4b')](handleError(_0xda5e60,null));};exports['show']=function(_0x2cf9b4,_0x15951e){var _0x318059={'raw':!![],'where':{'id':_0x2cf9b4[_0x1700('0x4c')]['id']}},_0xdc40c1={};_0xdc40c1[_0x1700('0x32')]=_[_0x1700('0x34')](db[_0x1700('0x30')][_0x1700('0x31')]);_0xdc40c1[_0x1700('0x33')]=_['keys'](_0x2cf9b4[_0x1700('0x33')]);_0xdc40c1[_0x1700('0x3e')]=_[_0x1700('0x35')](_0xdc40c1[_0x1700('0x32')],_0xdc40c1[_0x1700('0x33')]);_0x318059[_0x1700('0x36')]=_[_0x1700('0x35')](_0xdc40c1[_0x1700('0x32')],qs[_0x1700('0x37')](_0x2cf9b4[_0x1700('0x33')][_0x1700('0x37')]));_0x318059[_0x1700('0x36')]=_0x318059[_0x1700('0x36')]['length']?_0x318059[_0x1700('0x36')]:_0xdc40c1[_0x1700('0x32')];if(_0x2cf9b4[_0x1700('0x33')][_0x1700('0x49')]){_0x318059[_0x1700('0x4a')]=[{'all':!![]}];}_0x318059=_['merge']({},_0x318059,_0x2cf9b4['options']);return db['Network'][_0x1700('0x4d')](_0x318059)['then'](handleEntityNotFound(_0x15951e,null))['then'](respondWithResult(_0x15951e,null))[_0x1700('0x4b')](handleError(_0x15951e,null));};exports[_0x1700('0x4e')]=function(_0x41e80e,_0x15756a,_0x5bc346){var _0x1c2eb7;return db[_0x1700('0x4f')][_0x1700('0x50')](function(_0x112584){return db[_0x1700('0x30')][_0x1700('0x4e')](_0x41e80e[_0x1700('0x51')],{'raw':!![]})[_0x1700('0x17')](function(_0x1a022f){_0x1c2eb7=_0x1a022f;return db[_0x1700('0x30')][_0x1700('0x52')]({'where':{'type':_0x41e80e[_0x1700('0x51')][_0x1700('0x41')]},'raw':!![]});})[_0x1700('0x17')](function(_0x508da5){var _0x2ef71a=fs[_0x1700('0x53')](path['join'](config['root'],_0x1700('0x54')),'utf8');var _0x543f3b=ejs[_0x1700('0x55')](_0x2ef71a,{'networks':_0x508da5||[]});fs[_0x1700('0x56')](util[_0x1700('0x57')](_0x1700('0x58'),_0x41e80e[_0x1700('0x51')][_0x1700('0x41')][_0x1700('0x59')]()),_0x543f3b);})[_0x1700('0x17')](function(){return respondWithRpcPromise(_0x1700('0x5a'),_0x1700('0x4e'),{'module':_0x1700('0x5b')});})[_0x1700('0x17')](function(){return _0x1c2eb7;});})['then'](respondWithResult(_0x15756a,0xc9))[_0x1700('0x4b')](handleError(_0x15756a,null));};exports[_0x1700('0x5c')]=function(_0x51a8a7,_0x107d79,_0xc8f846){var _0x2cb043;return db[_0x1700('0x4f')][_0x1700('0x50')](function(_0x293206){return db[_0x1700('0x30')]['find']({'where':{'id':_0x51a8a7[_0x1700('0x4c')]['id']}})[_0x1700('0x17')](handleEntityNotFound(_0x107d79,null))['then'](saveUpdates(_0x51a8a7[_0x1700('0x51')],null))[_0x1700('0x17')](function(_0x380291){if(_0x380291){_0x2cb043=_0x380291;return db[_0x1700('0x30')][_0x1700('0x52')]({'where':{'type':_0x2cb043[_0x1700('0x41')]},'raw':!![]});}return null;})[_0x1700('0x17')](function(_0x5bd7a7){if(_0x5bd7a7){var _0x48754a=fs[_0x1700('0x53')](path['join'](config[_0x1700('0x5d')],'server/files/templates/network.ejs'),_0x1700('0x5e'));var _0xfaa86e=ejs[_0x1700('0x55')](_0x48754a,{'networks':_0x5bd7a7||[]});fs[_0x1700('0x56')](util[_0x1700('0x57')](_0x1700('0x58'),_0x2cb043[_0x1700('0x41')][_0x1700('0x59')]()),_0xfaa86e);return respondWithRpcPromise(_0x1700('0x5a'),_0x1700('0x5c'),{'module':'chan_sip.so'});}return null;})[_0x1700('0x17')](function(_0x394a61){if(_0x394a61){return _0x2cb043;}return null;});})['then'](respondWithResult(_0x107d79,null))[_0x1700('0x4b')](handleError(_0x107d79,null));};exports[_0x1700('0x5f')]=function(_0x130004,_0x8bc5ed,_0x2ac641){var _0xbf8913;return db[_0x1700('0x30')][_0x1700('0x4d')]({'where':{'id':_0x130004['params']['id']}})[_0x1700('0x17')](function(_0x37a27d){_0xbf8913=_0x37a27d;return _0x37a27d;})[_0x1700('0x17')](handleEntityNotFound(_0x8bc5ed,null))[_0x1700('0x17')](removeEntity(_0x8bc5ed,null))[_0x1700('0x17')](function(){if(_0xbf8913){return db[_0x1700('0x30')][_0x1700('0x52')]({'where':{'type':_0xbf8913[_0x1700('0x41')]},'raw':!![]});}})[_0x1700('0x17')](function(_0x2ceb97){if(_0x2ceb97){var _0x1f7bd3=fs['readFileSync'](path[_0x1700('0x60')](config['root'],'server/files/templates/network.ejs'),_0x1700('0x5e'));var _0xf02ef=ejs['render'](_0x1f7bd3,{'networks':_0x2ceb97||[]});fs[_0x1700('0x56')](util[_0x1700('0x57')](_0x1700('0x58'),_0xbf8913[_0x1700('0x41')][_0x1700('0x59')]()),_0xf02ef);return respondWithRpcPromise(_0x1700('0x5a'),'destroy',{'module':_0x1700('0x5b')});}})[_0x1700('0x4b')](handleError(_0x8bc5ed,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 032eb66..27e6915 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 _0x625d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./network.attributes','exports','define','network'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x625d,0x11e));var _0xd625=function(_0x19a6c4,_0x1a5145){_0x19a6c4=_0x19a6c4-0x0;var _0x448f3e=_0x625d[_0x19a6c4];return _0x448f3e;};'use strict';var _=require(_0xd625('0x0'));var util=require(_0xd625('0x1'));var logger=require(_0xd625('0x2'))(_0xd625('0x3'));var moment=require(_0xd625('0x4'));var BPromise=require(_0xd625('0x5'));var rp=require(_0xd625('0x6'));var attributes=require(_0xd625('0x7'));module[_0xd625('0x8')]=function(_0x29d588,_0x284ca6){return _0x29d588[_0xd625('0x9')]('Network',attributes,{'tableName':_0xd625('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6171=['Network','network','lodash','util','../../config/logger','api','moment','request-promise','./network.attributes','exports','define'];(function(_0x4c1fa3,_0x249721){var _0x385fd4=function(_0x58129f){while(--_0x58129f){_0x4c1fa3['push'](_0x4c1fa3['shift']());}};_0x385fd4(++_0x249721);}(_0x6171,0x141));var _0x1617=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x6171[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x1617('0x0'));var util=require(_0x1617('0x1'));var logger=require(_0x1617('0x2'))(_0x1617('0x3'));var moment=require(_0x1617('0x4'));var BPromise=require('bluebird');var rp=require(_0x1617('0x5'));var attributes=require(_0x1617('0x6'));module[_0x1617('0x7')]=function(_0x257b67,_0x43b751){return _0x257b67[_0x1617('0x8')](_0x1617('0x9'),attributes,{'tableName':_0x1617('0xa'),'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 3f9b051..fd56ce4 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 _0xaa3f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Network,\x20%s,\x20%s','catch','lodash','util'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x5b2e84,_0x57fb80){_0x5b2e84=_0x5b2e84-0x0;var _0x167be3=_0xaa3f[_0x5b2e84];return _0x167be3;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var moment=require(_0xfaa3('0x2'));var BPromise=require(_0xfaa3('0x3'));var rs=require(_0xfaa3('0x4'));var fs=require('fs');var Redis=require(_0xfaa3('0x5'));var db=require(_0xfaa3('0x6'))['db'];var utils=require(_0xfaa3('0x7'));var logger=require(_0xfaa3('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfaa3('0x9'));var client=jayson['client'][_0xfaa3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeecce5,_0x352958,_0xbf270c){return new BPromise(function(_0x328d5f,_0x2e422d){return client[_0xfaa3('0xb')](_0xeecce5,_0xbf270c)['then'](function(_0x37bcd5){logger[_0xfaa3('0xc')]('Network,\x20%s,\x20%s',_0x352958,'request\x20sent');logger[_0xfaa3('0xd')](_0xfaa3('0xe'),_0x352958,_0xfaa3('0xf'),JSON[_0xfaa3('0x10')](_0x37bcd5));if(_0x37bcd5[_0xfaa3('0x11')]){if(_0x37bcd5[_0xfaa3('0x11')]['code']===0x1f4){logger[_0xfaa3('0x11')]('Network,\x20%s,\x20%s',_0x352958,_0x37bcd5[_0xfaa3('0x11')][_0xfaa3('0x12')]);return _0x2e422d(_0x37bcd5[_0xfaa3('0x11')]['message']);}logger[_0xfaa3('0x11')]('Network,\x20%s,\x20%s',_0x352958,_0x37bcd5[_0xfaa3('0x11')][_0xfaa3('0x12')]);return _0x328d5f(_0x37bcd5[_0xfaa3('0x11')][_0xfaa3('0x12')]);}else{logger[_0xfaa3('0xc')](_0xfaa3('0x13'),_0x352958,'request\x20sent');_0x328d5f(_0x37bcd5['result'][_0xfaa3('0x12')]);}})[_0xfaa3('0x14')](function(_0x407384){logger[_0xfaa3('0x11')]('Network,\x20%s,\x20%s',_0x352958,_0x407384);_0x2e422d(_0x407384);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x3e0a3a,_0x2289d7){var _0x3918f4=function(_0x25db38){while(--_0x25db38){_0x3e0a3a['push'](_0x3e0a3a['shift']());}};_0x3918f4(++_0x2289d7);}(_0xabce,0x103));var _0xeabc=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xabce[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Network,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index fd148e7..1aba552 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 _0x917b=['isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','getAgents','post','create','addDisposition','addAnswer','notify','addApplications','addAgents','/:id/send','send','put','update','destroy','removeDispositions','delete','removeAnswers','/:id/users','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','get'];(function(_0x4f5324,_0x2695b7){var _0x4aa4dd=function(_0x48cd11){while(--_0x48cd11){_0x4f5324['push'](_0x4f5324['shift']());}};_0x4aa4dd(++_0x2695b7);}(_0x917b,0x175));var _0xb917=function(_0x344eca,_0x253005){_0x344eca=_0x344eca-0x0;var _0x5e3f97=_0x917b[_0x344eca];return _0x5e3f97;};'use strict';var multer=require(_0xb917('0x0'));var util=require(_0xb917('0x1'));var path=require(_0xb917('0x2'));var timeout=require(_0xb917('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xb917('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb917('0x5'));var controller=require('./openchannelAccount.controller');router[_0xb917('0x6')]('/',auth[_0xb917('0x7')](),controller[_0xb917('0x8')]);router[_0xb917('0x6')](_0xb917('0x9'),auth[_0xb917('0x7')](),controller[_0xb917('0xa')]);router[_0xb917('0x6')](_0xb917('0xb'),auth[_0xb917('0x7')](),controller[_0xb917('0xc')]);router[_0xb917('0x6')](_0xb917('0xd'),auth[_0xb917('0x7')](),controller[_0xb917('0xe')]);router[_0xb917('0x6')](_0xb917('0xf'),auth[_0xb917('0x7')](),controller[_0xb917('0x10')]);router[_0xb917('0x6')](_0xb917('0x11'),auth[_0xb917('0x7')](),controller[_0xb917('0x12')]);router['get']('/:id/interactions',auth[_0xb917('0x7')](),controller[_0xb917('0x13')]);router[_0xb917('0x6')]('/:id/users',auth[_0xb917('0x7')](),controller[_0xb917('0x14')]);router[_0xb917('0x15')]('/',auth[_0xb917('0x7')](),controller[_0xb917('0x16')]);router[_0xb917('0x15')](_0xb917('0xd'),auth['isAuthenticated'](),controller[_0xb917('0x17')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb917('0x18')]);router[_0xb917('0x15')]('/:id/notify',controller[_0xb917('0x19')]);router[_0xb917('0x15')](_0xb917('0x11'),auth[_0xb917('0x7')](),controller[_0xb917('0x1a')]);router[_0xb917('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xb917('0x1b')]);router['post'](_0xb917('0x1c'),auth['isAuthenticated'](),controller[_0xb917('0x1d')]);router[_0xb917('0x1e')]('/:id',auth[_0xb917('0x7')](),controller[_0xb917('0x1f')]);router['delete'](_0xb917('0xb'),auth['isAuthenticated'](),controller[_0xb917('0x20')]);router['delete'](_0xb917('0xd'),auth[_0xb917('0x7')](),controller[_0xb917('0x21')]);router[_0xb917('0x22')](_0xb917('0xf'),auth[_0xb917('0x7')](),controller[_0xb917('0x23')]);router[_0xb917('0x22')](_0xb917('0x24'),auth[_0xb917('0x7')](),controller['removeAgents']);module[_0xb917('0x25')]=router; \ No newline at end of file +var _0x30e2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','/:id/applications','addAgents','send','put','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0x30e2,0x90));var _0x230e=function(_0x128c34,_0x4b6247){_0x128c34=_0x128c34-0x0;var _0x7d4606=_0x30e2[_0x128c34];return _0x7d4606;};'use strict';var multer=require('multer');var util=require(_0x230e('0x0'));var path=require(_0x230e('0x1'));var timeout=require(_0x230e('0x2'));var express=require(_0x230e('0x3'));var router=express['Router']();var auth=require(_0x230e('0x4'));var interaction=require(_0x230e('0x5'));var config=require(_0x230e('0x6'));var controller=require(_0x230e('0x7'));router[_0x230e('0x8')]('/',auth[_0x230e('0x9')](),controller[_0x230e('0xa')]);router[_0x230e('0x8')](_0x230e('0xb'),auth[_0x230e('0x9')](),controller[_0x230e('0xc')]);router[_0x230e('0x8')](_0x230e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x230e('0x8')](_0x230e('0xe'),auth[_0x230e('0x9')](),controller['getDispositions']);router[_0x230e('0x8')](_0x230e('0xf'),auth[_0x230e('0x9')](),controller[_0x230e('0x10')]);router['get']('/:id/applications',auth[_0x230e('0x9')](),controller[_0x230e('0x11')]);router[_0x230e('0x8')](_0x230e('0x12'),auth[_0x230e('0x9')](),controller[_0x230e('0x13')]);router['get'](_0x230e('0x14'),auth[_0x230e('0x9')](),controller[_0x230e('0x15')]);router[_0x230e('0x16')]('/',auth[_0x230e('0x9')](),controller[_0x230e('0x17')]);router['post'](_0x230e('0xe'),auth[_0x230e('0x9')](),controller[_0x230e('0x18')]);router[_0x230e('0x16')]('/:id/canned_answers',auth[_0x230e('0x9')](),controller[_0x230e('0x19')]);router[_0x230e('0x16')]('/:id/notify',controller[_0x230e('0x1a')]);router[_0x230e('0x16')](_0x230e('0x1b'),auth[_0x230e('0x9')](),controller['addApplications']);router[_0x230e('0x16')](_0x230e('0x14'),auth[_0x230e('0x9')](),controller[_0x230e('0x1c')]);router[_0x230e('0x16')]('/:id/send',auth[_0x230e('0x9')](),controller[_0x230e('0x1d')]);router[_0x230e('0x1e')]('/:id',auth[_0x230e('0x9')](),controller[_0x230e('0x1f')]);router[_0x230e('0x20')](_0x230e('0xd'),auth['isAuthenticated'](),controller[_0x230e('0x21')]);router[_0x230e('0x20')](_0x230e('0xe'),auth[_0x230e('0x9')](),controller['removeDispositions']);router['delete'](_0x230e('0xf'),auth[_0x230e('0x9')](),controller[_0x230e('0x22')]);router[_0x230e('0x20')](_0x230e('0x14'),auth[_0x230e('0x9')](),controller[_0x230e('0x23')]);module[_0x230e('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 346527a..252fcd1 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 _0x31b4=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x5e56de,_0x189fa7){var _0x26c6ec=function(_0x2ed7cf){while(--_0x2ed7cf){_0x5e56de['push'](_0x5e56de['shift']());}};_0x26c6ec(++_0x189fa7);}(_0x31b4,0xc9));var _0x431b=function(_0x27acd0,_0x444130){_0x27acd0=_0x27acd0-0x0;var _0x38da43=_0x31b4[_0x27acd0];return _0x38da43;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x431b('0x0'));module[_0x431b('0x1')]={'name':{'type':Sequelize[_0x431b('0x2')],'unique':_0x431b('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x431b('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x431b('0x4')]();}},'replyUri':{'type':Sequelize[_0x431b('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x431b('0x5');}},'notificationSound':{'type':Sequelize[_0x431b('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x431b('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x431b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x431b('0x2')]},'queueTransfer':{'type':Sequelize[_0x431b('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['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x431b('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x431b('0x6')],'defaultValue':![],'comment':_0x431b('0x9'),'set':function(_0x4b2816){if(!_0x4b2816)this[_0x431b('0xa')](_0x431b('0xb'),null);this[_0x431b('0xa')](_0x431b('0xc'),_0x4b2816);}}}; \ No newline at end of file +var _0x05c2=['name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x5b2761,_0xacc9f5){var _0x23c605=function(_0x18767d){while(--_0x18767d){_0x5b2761['push'](_0x5b2761['shift']());}};_0x23c605(++_0xacc9f5);}(_0x05c2,0x137));var _0x205c=function(_0x7c188b,_0x4e3c49){_0x7c188b=_0x7c188b-0x0;var _0x419c17=_0x05c2[_0x7c188b];return _0x419c17;};'use strict';var Sequelize=require(_0x205c('0x0'));var rs=require(_0x205c('0x1'));module[_0x205c('0x2')]={'name':{'type':Sequelize[_0x205c('0x3')],'unique':_0x205c('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x205c('0x3')]},'token':{'type':Sequelize[_0x205c('0x3')],'defaultValue':function(){return rs[_0x205c('0x5')]();}},'replyUri':{'type':Sequelize[_0x205c('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x205c('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x205c('0x6')],'defaultValue':function(){return _0x205c('0x7');}},'notificationSound':{'type':Sequelize[_0x205c('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x205c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x205c('0x3')]},'queueTransfer':{'type':Sequelize[_0x205c('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x205c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x205c('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x205c('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x205c('0x8')],'defaultValue':![],'comment':_0x205c('0xb'),'set':function(_0x3369c1){if(!_0x3369c1)this[_0x205c('0xc')](_0x205c('0xd'),null);this[_0x205c('0xc')](_0x205c('0xe'),_0x3369c1);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 3c89a1d..b2494af 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 _0x8a10=['sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','count','includeAll','findAll','rows','show','params','length','include','options','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','OpenchannelApplication','applications','Applications','list','priority','account','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','startRouting','Start','EventManager','addApplications','transaction','findAndCountAll','getInteractions','Contact','Owner','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','defaults','out','dataValues','Messages','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','end','json','offset','set','Content-Range','reject','update','destroy','get','OpenchannelAccounts','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','keys','query','filters','model','intersection','fields','attributes','nolimit','limit','order'];(function(_0x1ecf06,_0x23503f){var _0x18edb7=function(_0x4487d1){while(--_0x4487d1){_0x1ecf06['push'](_0x1ecf06['shift']());}};_0x18edb7(++_0x23503f);}(_0x8a10,0x72));var _0x08a1=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8a10[_0x2c91e9];return _0x13f0ff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x08a1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x08a1('0x1'));var rp=require(_0x08a1('0x2'));var moment=require(_0x08a1('0x3'));var BPromise=require(_0x08a1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x08a1('0x5'));var sox=require(_0x08a1('0x6'));var csv=require(_0x08a1('0x7'));var ejs=require(_0x08a1('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x08a1('0x9'));var crypto=require(_0x08a1('0xa'));var jsforce=require(_0x08a1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x08a1('0x7'));var querystring=require('querystring');var Papa=require(_0x08a1('0xc'));var authService=require(_0x08a1('0xd'));var hardwareService=require(_0x08a1('0xe'));var Redis=require('ioredis');var qs=require(_0x08a1('0xf'));var logger=require(_0x08a1('0x10'))(_0x08a1('0x11'));var utils=require(_0x08a1('0x12'));var config=require(_0x08a1('0x13'));var db=require(_0x08a1('0x14'))['db'];config[_0x08a1('0x15')]=_['defaults'](config[_0x08a1('0x15')],{'host':_0x08a1('0x16'),'port':0x18eb});var socket=require(_0x08a1('0x17'))(new Redis(config[_0x08a1('0x15')]));require(_0x08a1('0x18'))[_0x08a1('0x19')](socket);var jayson=require(_0x08a1('0x1a'));var client=jayson['client'][_0x08a1('0x1b')]({'port':0x232c});var client9002=jayson[_0x08a1('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x541c7d,_0x240eb0,_0x29b1c4,_0xa746c3){return new BPromise(function(_0x4ebc20,_0x532511){var _0x39574e=_0xa746c3||client;return _0x39574e[_0x08a1('0x1d')](_0x541c7d,_0x29b1c4)[_0x08a1('0x1e')](function(_0x5b579b){logger['info'](_0x08a1('0x1f'),_0x240eb0,_0x08a1('0x20'));logger[_0x08a1('0x21')](_0x08a1('0x22'),_0x240eb0,_0x08a1('0x20'),JSON['stringify'](_0x5b579b));if(_0x5b579b[_0x08a1('0x23')]){if(_0x5b579b['error']['code']===0x1f4){logger['error'](_0x08a1('0x1f'),_0x240eb0,_0x5b579b[_0x08a1('0x23')][_0x08a1('0x24')]);return _0x532511(_0x5b579b[_0x08a1('0x23')][_0x08a1('0x24')]);}logger[_0x08a1('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x240eb0,_0x5b579b[_0x08a1('0x23')][_0x08a1('0x24')]);return _0x4ebc20(_0x5b579b[_0x08a1('0x23')][_0x08a1('0x24')]);}else{logger[_0x08a1('0x25')](_0x08a1('0x1f'),_0x240eb0,_0x08a1('0x20'));_0x4ebc20(_0x5b579b[_0x08a1('0x26')][_0x08a1('0x24')]);}})[_0x08a1('0x27')](function(_0xec35cc){logger[_0x08a1('0x23')](_0x08a1('0x1f'),_0x240eb0,_0xec35cc);_0x532511(_0xec35cc);});});}function respondWithStatusCode(_0xcb73bd,_0x18d574){_0x18d574=_0x18d574||0xcc;return function(_0x1f23fc){if(_0x1f23fc){return _0xcb73bd[_0x08a1('0x28')](_0x18d574);}return _0xcb73bd[_0x08a1('0x29')](_0x18d574)[_0x08a1('0x2a')]();};}function respondWithResult(_0x4c6d55,_0x53155d){_0x53155d=_0x53155d||0xc8;return function(_0x29c410){if(_0x29c410){return _0x4c6d55[_0x08a1('0x29')](_0x53155d)[_0x08a1('0x2b')](_0x29c410);}};}function respondWithFilteredResult(_0x2d2331,_0x44fdac){return function(_0x19d02a){if(_0x19d02a){var _0x37b414=_0x19d02a['count'],_0x345d1a=_0x44fdac[_0x08a1('0x2c')],_0x333d3d=_0x44fdac[_0x08a1('0x2c')]+_0x44fdac['limit'],_0x28fd97;if(_0x333d3d>=_0x37b414){_0x333d3d=_0x37b414;_0x28fd97=0xc8;}else{_0x28fd97=0xce;}_0x2d2331['status'](_0x28fd97);return _0x2d2331[_0x08a1('0x2d')](_0x08a1('0x2e'),_0x345d1a+'-'+_0x333d3d+'/'+_0x37b414)['json'](_0x19d02a);}return null;};}function patchUpdates(_0x1e4fcb){return function(_0x2bc8c8){try{jsonpatch['apply'](_0x2bc8c8,_0x1e4fcb,!![]);}catch(_0x3eb571){return BPromise[_0x08a1('0x2f')](_0x3eb571);}return _0x2bc8c8['save']();};}function saveUpdates(_0x5d5d15,_0x4a9d2b){return function(_0xca6142){if(_0xca6142){return _0xca6142[_0x08a1('0x30')](_0x5d5d15)[_0x08a1('0x1e')](function(_0x46c046){return _0x46c046;});}return null;};}function removeEntity(_0x5de3bb,_0x48410b){return function(_0x3b2261){if(_0x3b2261){return _0x3b2261[_0x08a1('0x31')]()[_0x08a1('0x1e')](function(){var _0x3e1627=_0x3b2261[_0x08a1('0x32')]({'plain':!![]});var _0x3c78af=_0x08a1('0x33');return db['UserProfileResource'][_0x08a1('0x31')]({'where':{'type':_0x3c78af,'resourceId':_0x3e1627['id']}})[_0x08a1('0x1e')](function(){return _0x3b2261;});})[_0x08a1('0x1e')](function(){_0x5de3bb[_0x08a1('0x29')](0xcc)[_0x08a1('0x2a')]();});}};}function handleEntityNotFound(_0x2b35b1,_0x5161b3){return function(_0x359a1e){if(!_0x359a1e){_0x2b35b1[_0x08a1('0x28')](0x194);}return _0x359a1e;};}function handleError(_0x41a469,_0x4290ec){_0x4290ec=_0x4290ec||0x1f4;return function(_0x450eab){logger[_0x08a1('0x23')](_0x450eab['stack']);if(_0x450eab[_0x08a1('0x34')]){delete _0x450eab[_0x08a1('0x34')];}_0x41a469[_0x08a1('0x29')](_0x4290ec)[_0x08a1('0x35')](_0x450eab);};}exports[_0x08a1('0x36')]=function(_0x30e1e5,_0x3e1926){var _0x5c9611={'include':[{'model':db[_0x08a1('0x37')],'as':_0x08a1('0x38')}]},_0x5ad66f={},_0x2a2354={'count':0x0,'rows':[]};var _0x304e5d=db[_0x08a1('0x39')][_0x08a1('0x3a')];_0x5ad66f['model']=_['keys'](_0x304e5d);_0x5ad66f['query']=_[_0x08a1('0x3b')](_0x30e1e5[_0x08a1('0x3c')]);_0x5ad66f[_0x08a1('0x3d')]=_['intersection'](_0x5ad66f[_0x08a1('0x3e')],_0x5ad66f[_0x08a1('0x3c')]);_0x5c9611['attributes']=_[_0x08a1('0x3f')](_0x5ad66f[_0x08a1('0x3e')],qs[_0x08a1('0x40')](_0x30e1e5[_0x08a1('0x3c')][_0x08a1('0x40')]));_0x5c9611[_0x08a1('0x41')]=_0x5c9611[_0x08a1('0x41')]['length']?_0x5c9611[_0x08a1('0x41')]:_0x5ad66f[_0x08a1('0x3e')];if(!_0x30e1e5['query']['hasOwnProperty'](_0x08a1('0x42'))){_0x5c9611[_0x08a1('0x43')]=qs[_0x08a1('0x43')](_0x30e1e5[_0x08a1('0x3c')][_0x08a1('0x43')]);_0x5c9611['offset']=qs[_0x08a1('0x2c')](_0x30e1e5['query'][_0x08a1('0x2c')]);}_0x5c9611[_0x08a1('0x44')]=qs[_0x08a1('0x45')](_0x30e1e5[_0x08a1('0x3c')]['sort']);_0x5c9611[_0x08a1('0x46')]=qs[_0x08a1('0x3d')](_[_0x08a1('0x47')](_0x30e1e5['query'],_0x5ad66f[_0x08a1('0x3d')]));if(_0x30e1e5[_0x08a1('0x3c')][_0x08a1('0x48')]){_0x5c9611[_0x08a1('0x46')]=_[_0x08a1('0x49')](_0x5c9611[_0x08a1('0x46')],{'$or':_[_0x08a1('0x4a')](_0x304e5d,function(_0x3cf9ad){if(_0x3cf9ad[_0x08a1('0x4b')][_0x08a1('0x4c')]!==_0x08a1('0x4d')){var _0x3166d5={};_0x3166d5[_0x3cf9ad[_0x08a1('0x4e')]]={'$like':'%'+_0x30e1e5['query']['filter']+'%'};return _0x3166d5;}})});}_0x5c9611=_[_0x08a1('0x49')]({},_0x5c9611,_0x30e1e5['options']);var _0x1651ce={'where':_0x5c9611[_0x08a1('0x46')]};return db[_0x08a1('0x39')]['count'](_0x1651ce)[_0x08a1('0x1e')](function(_0x86ce63){_0x2a2354[_0x08a1('0x4f')]=_0x86ce63;if(_0x30e1e5['query'][_0x08a1('0x50')]){_0x5c9611['include']=[{'all':!![]}];}return db[_0x08a1('0x39')][_0x08a1('0x51')](_0x5c9611);})[_0x08a1('0x1e')](function(_0x3dc49c){_0x2a2354[_0x08a1('0x52')]=_0x3dc49c;return _0x2a2354;})[_0x08a1('0x1e')](respondWithFilteredResult(_0x3e1926,_0x5c9611))['catch'](handleError(_0x3e1926,null));};exports[_0x08a1('0x53')]=function(_0x263129,_0x16e996){var _0x1b523f={'raw':![],'where':{'id':_0x263129[_0x08a1('0x54')]['id']},'include':[{'model':db[_0x08a1('0x37')],'as':_0x08a1('0x38')}]},_0x1340de={};_0x1340de[_0x08a1('0x3e')]=_[_0x08a1('0x3b')](db['OpenchannelAccount'][_0x08a1('0x3a')]);_0x1340de['query']=_[_0x08a1('0x3b')](_0x263129['query']);_0x1340de[_0x08a1('0x3d')]=_['intersection'](_0x1340de[_0x08a1('0x3e')],_0x1340de[_0x08a1('0x3c')]);_0x1b523f[_0x08a1('0x41')]=_[_0x08a1('0x3f')](_0x1340de[_0x08a1('0x3e')],qs[_0x08a1('0x40')](_0x263129['query']['fields']));_0x1b523f['attributes']=_0x1b523f[_0x08a1('0x41')][_0x08a1('0x55')]?_0x1b523f['attributes']:_0x1340de['model'];if(_0x263129[_0x08a1('0x3c')][_0x08a1('0x50')]){_0x1b523f[_0x08a1('0x56')]=[{'all':!![]}];}_0x1b523f=_['merge']({},_0x1b523f,_0x263129[_0x08a1('0x57')]);return db['OpenchannelAccount']['find'](_0x1b523f)[_0x08a1('0x1e')](handleEntityNotFound(_0x16e996,null))[_0x08a1('0x1e')](respondWithResult(_0x16e996,null))['catch'](handleError(_0x16e996,null));};exports[_0x08a1('0x58')]=function(_0x1d6848,_0x258fea){return db[_0x08a1('0x39')][_0x08a1('0x58')](_0x1d6848['body'],{})[_0x08a1('0x1e')](function(_0x24c7b1){var _0x438e7d=_0x1d6848[_0x08a1('0x59')][_0x08a1('0x32')]({'plain':!![]});if(!_0x438e7d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x438e7d[_0x08a1('0x5a')]===_0x08a1('0x59')){var _0x12d948=_0x24c7b1['get']({'plain':!![]});var _0x36adaa=_0x08a1('0x33');return db[_0x08a1('0x5b')][_0x08a1('0x5c')]({'where':{'name':_0x36adaa,'userProfileId':_0x438e7d[_0x08a1('0x5d')]},'raw':!![]})[_0x08a1('0x1e')](function(_0x140a05){if(_0x140a05&&_0x140a05[_0x08a1('0x5e')]===0x0){return db[_0x08a1('0x5f')][_0x08a1('0x58')]({'name':_0x12d948['name'],'resourceId':_0x12d948['id'],'type':_0x140a05[_0x08a1('0x34')],'sectionId':_0x140a05['id']},{})[_0x08a1('0x1e')](function(){return _0x24c7b1;});}else{return _0x24c7b1;}})[_0x08a1('0x27')](function(_0x21a9b3){logger[_0x08a1('0x23')](_0x08a1('0x60'),_0x21a9b3);throw _0x21a9b3;});}return _0x24c7b1;})['then'](respondWithResult(_0x258fea,0xc9))[_0x08a1('0x27')](handleError(_0x258fea,null));};exports[_0x08a1('0x30')]=function(_0x2f1724,_0x129b02){if(_0x2f1724[_0x08a1('0x61')]['id']){delete _0x2f1724[_0x08a1('0x61')]['id'];}return db[_0x08a1('0x39')][_0x08a1('0x5c')]({'where':{'id':_0x2f1724[_0x08a1('0x54')]['id']},'include':[{'model':db[_0x08a1('0x37')],'as':_0x08a1('0x38')}]})[_0x08a1('0x1e')](handleEntityNotFound(_0x129b02,null))[_0x08a1('0x1e')](saveUpdates(_0x2f1724['body'],null))['then'](function(_0x23b710){if(_0x23b710&&_0x2f1724[_0x08a1('0x61')][_0x08a1('0x38')]){return db['Pause'][_0x08a1('0x30')](_0x2f1724[_0x08a1('0x61')][_0x08a1('0x38')],{'where':{'OpenchannelAccountId':_0x23b710['id']}})[_0x08a1('0x1e')](function(){return _0x23b710;});}return _0x23b710;})[_0x08a1('0x1e')](respondWithResult(_0x129b02,null))['catch'](handleError(_0x129b02,null));};exports[_0x08a1('0x31')]=function(_0x35b9e2,_0x4cfb7d){return db[_0x08a1('0x39')]['find']({'where':{'id':_0x35b9e2[_0x08a1('0x54')]['id']}})['then'](handleEntityNotFound(_0x4cfb7d,null))['then'](removeEntity(_0x4cfb7d,null))[_0x08a1('0x27')](handleError(_0x4cfb7d,null));};exports[_0x08a1('0x62')]=function(_0x48ea06,_0x2332e8){return db[_0x08a1('0x39')][_0x08a1('0x62')]()[_0x08a1('0x1e')](respondWithResult(_0x2332e8,null))['catch'](handleError(_0x2332e8,null));};exports['addDisposition']=function(_0x2a5cfc,_0x159c9d,_0x174dae){if(_0x2a5cfc[_0x08a1('0x61')]['id']){delete _0x2a5cfc[_0x08a1('0x61')]['id'];}return db['OpenchannelAccount'][_0x08a1('0x5c')]({'where':{'id':_0x2a5cfc[_0x08a1('0x54')]['id']}})[_0x08a1('0x1e')](handleEntityNotFound(_0x159c9d,null))[_0x08a1('0x1e')](function(_0x5463a2){if(_0x5463a2){_0x2a5cfc['body'][_0x08a1('0x63')]=_0x5463a2['id'];return db[_0x08a1('0x64')][_0x08a1('0x58')](_0x2a5cfc[_0x08a1('0x61')]);}})[_0x08a1('0x1e')](respondWithResult(_0x159c9d,null))[_0x08a1('0x27')](handleError(_0x159c9d,null));};exports[_0x08a1('0x65')]=function(_0x1566fb,_0x3b843a,_0x5c9bb8){var _0x341b0a={'raw':![],'where':{}};var _0x4e2faa={};var _0x332d90={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x08a1('0x66')]({'where':{'id':_0x1566fb[_0x08a1('0x54')]['id']}})['then'](handleEntityNotFound(_0x3b843a,null))['then'](function(_0xd07f73){if(_0xd07f73){_0x4e2faa[_0x08a1('0x3e')]=_[_0x08a1('0x3b')](db[_0x08a1('0x64')][_0x08a1('0x3a')]);_0x4e2faa[_0x08a1('0x3c')]=_[_0x08a1('0x3b')](_0x1566fb['query']);_0x4e2faa[_0x08a1('0x3d')]=_[_0x08a1('0x3f')](_0x4e2faa['model'],_0x4e2faa['query']);_0x341b0a[_0x08a1('0x41')]=_[_0x08a1('0x3f')](_0x4e2faa[_0x08a1('0x3e')],qs['fields'](_0x1566fb[_0x08a1('0x3c')][_0x08a1('0x40')]));_0x341b0a[_0x08a1('0x41')]=_0x341b0a[_0x08a1('0x41')][_0x08a1('0x55')]?_0x341b0a[_0x08a1('0x41')]:_0x4e2faa[_0x08a1('0x3e')];if(!_0x1566fb['query'][_0x08a1('0x67')](_0x08a1('0x42'))){_0x341b0a[_0x08a1('0x43')]=qs[_0x08a1('0x43')](_0x1566fb[_0x08a1('0x3c')][_0x08a1('0x43')]);_0x341b0a[_0x08a1('0x2c')]=qs['offset'](_0x1566fb['query']['offset']);}_0x341b0a['order']=qs[_0x08a1('0x45')](_0x1566fb[_0x08a1('0x3c')]['sort']);_0x341b0a[_0x08a1('0x46')]=qs[_0x08a1('0x3d')](_[_0x08a1('0x47')](_0x1566fb[_0x08a1('0x3c')],_0x4e2faa[_0x08a1('0x3d')]));_0x341b0a[_0x08a1('0x46')][_0x08a1('0x68')]=_0xd07f73['id'];if(_0x1566fb[_0x08a1('0x3c')][_0x08a1('0x48')]){_0x341b0a[_0x08a1('0x46')]=_[_0x08a1('0x49')](_0x341b0a['where'],{'$or':_[_0x08a1('0x4a')](_0x341b0a[_0x08a1('0x41')],function(_0x2f379c){var _0x5bf756={};_0x5bf756[_0x2f379c]={'$like':'%'+_0x1566fb[_0x08a1('0x3c')][_0x08a1('0x48')]+'%'};return _0x5bf756;})});}_0x341b0a=_[_0x08a1('0x49')]({},_0x341b0a,_0x1566fb[_0x08a1('0x57')]);return db[_0x08a1('0x64')]['count']({'where':_0x341b0a['where']})[_0x08a1('0x1e')](function(_0x47e4ab){_0x332d90[_0x08a1('0x4f')]=_0x47e4ab;if(_0x1566fb[_0x08a1('0x3c')]['includeAll']){_0x341b0a['include']=[{'all':!![]}];}return db['Disposition'][_0x08a1('0x51')](_0x341b0a);})[_0x08a1('0x1e')](function(_0x4a7684){_0x332d90[_0x08a1('0x52')]=_0x4a7684;return _0x332d90;});}})[_0x08a1('0x1e')](respondWithFilteredResult(_0x3b843a,_0x341b0a))['catch'](handleError(_0x3b843a,null));};exports[_0x08a1('0x69')]=function(_0x180661,_0x2e0279,_0x1acf09){var _0x2de4c6;return db[_0x08a1('0x39')]['find']({'where':{'id':_0x180661['params']['id']}})[_0x08a1('0x1e')](handleEntityNotFound(_0x2e0279,null))[_0x08a1('0x1e')](function(_0x50ff2b){if(_0x50ff2b){return _0x50ff2b[_0x08a1('0x69')](_0x180661[_0x08a1('0x3c')][_0x08a1('0x6a')]);}})['then'](respondWithStatusCode(_0x2e0279,null))[_0x08a1('0x27')](handleError(_0x2e0279,null));};exports[_0x08a1('0x6b')]=function(_0x20b343,_0x715119,_0x3a847d){if(_0x20b343[_0x08a1('0x61')]['id']){delete _0x20b343[_0x08a1('0x61')]['id'];}return db[_0x08a1('0x39')][_0x08a1('0x5c')]({'where':{'id':_0x20b343[_0x08a1('0x54')]['id']}})[_0x08a1('0x1e')](handleEntityNotFound(_0x715119,null))[_0x08a1('0x1e')](function(_0x4922fd){if(_0x4922fd){_0x20b343['body'][_0x08a1('0x68')]=_0x4922fd['id'];return db[_0x08a1('0x6c')]['create'](_0x20b343[_0x08a1('0x61')]);}})[_0x08a1('0x1e')](respondWithResult(_0x715119,null))['catch'](handleError(_0x715119,null));};exports[_0x08a1('0x6d')]=function(_0x396b2c,_0x4956bf,_0x15dbb3){var _0x585e00={'raw':![],'where':{}};var _0x4854a8={};var _0x546c01={'count':0x0,'rows':[]};return db[_0x08a1('0x39')][_0x08a1('0x66')]({'where':{'id':_0x396b2c['params']['id']}})[_0x08a1('0x1e')](handleEntityNotFound(_0x4956bf,null))[_0x08a1('0x1e')](function(_0x23fc9b){if(_0x23fc9b){_0x4854a8['model']=_[_0x08a1('0x3b')](db['CannedAnswer'][_0x08a1('0x3a')]);_0x4854a8['query']=_[_0x08a1('0x3b')](_0x396b2c['query']);_0x4854a8[_0x08a1('0x3d')]=_[_0x08a1('0x3f')](_0x4854a8[_0x08a1('0x3e')],_0x4854a8[_0x08a1('0x3c')]);_0x585e00['attributes']=_[_0x08a1('0x3f')](_0x4854a8['model'],qs[_0x08a1('0x40')](_0x396b2c['query'][_0x08a1('0x40')]));_0x585e00[_0x08a1('0x41')]=_0x585e00[_0x08a1('0x41')][_0x08a1('0x55')]?_0x585e00[_0x08a1('0x41')]:_0x4854a8[_0x08a1('0x3e')];if(!_0x396b2c[_0x08a1('0x3c')][_0x08a1('0x67')](_0x08a1('0x42'))){_0x585e00['limit']=qs[_0x08a1('0x43')](_0x396b2c['query'][_0x08a1('0x43')]);_0x585e00[_0x08a1('0x2c')]=qs[_0x08a1('0x2c')](_0x396b2c['query']['offset']);}_0x585e00[_0x08a1('0x44')]=qs['sort'](_0x396b2c[_0x08a1('0x3c')][_0x08a1('0x45')]);_0x585e00[_0x08a1('0x46')]=qs['filters'](_[_0x08a1('0x47')](_0x396b2c[_0x08a1('0x3c')],_0x4854a8[_0x08a1('0x3d')]));_0x585e00[_0x08a1('0x46')][_0x08a1('0x68')]=_0x23fc9b['id'];if(_0x396b2c[_0x08a1('0x3c')]['filter']){_0x585e00[_0x08a1('0x46')]=_[_0x08a1('0x49')](_0x585e00['where'],{'$or':_[_0x08a1('0x4a')](_0x585e00['attributes'],function(_0x5b2047){var _0x951d0c={};_0x951d0c[_0x5b2047]={'$like':'%'+_0x396b2c['query'][_0x08a1('0x48')]+'%'};return _0x951d0c;})});}_0x585e00=_[_0x08a1('0x49')]({},_0x585e00,_0x396b2c[_0x08a1('0x57')]);return db[_0x08a1('0x6c')][_0x08a1('0x4f')]({'where':_0x585e00[_0x08a1('0x46')]})[_0x08a1('0x1e')](function(_0x418493){_0x546c01['count']=_0x418493;if(_0x396b2c[_0x08a1('0x3c')][_0x08a1('0x50')]){_0x585e00['include']=[{'all':!![]}];}return db[_0x08a1('0x6c')][_0x08a1('0x51')](_0x585e00);})[_0x08a1('0x1e')](function(_0x4ba9d3){_0x546c01[_0x08a1('0x52')]=_0x4ba9d3;return _0x546c01;});}})[_0x08a1('0x1e')](respondWithFilteredResult(_0x4956bf,_0x585e00))[_0x08a1('0x27')](handleError(_0x4956bf,null));};exports['removeAnswers']=function(_0x423652,_0x49ae1c,_0x5abd74){var _0x251572;return db['OpenchannelAccount'][_0x08a1('0x5c')]({'where':{'id':_0x423652[_0x08a1('0x54')]['id']}})[_0x08a1('0x1e')](handleEntityNotFound(_0x49ae1c,null))[_0x08a1('0x1e')](function(_0x3a8ea2){if(_0x3a8ea2){return _0x3a8ea2[_0x08a1('0x6e')](_0x423652[_0x08a1('0x3c')]['ids']);}})[_0x08a1('0x1e')](respondWithStatusCode(_0x49ae1c,null))[_0x08a1('0x27')](handleError(_0x49ae1c,null));};exports[_0x08a1('0x6f')]=function(_0x4e22c4,_0x14c8a7,_0x4501ae){var _0x1ce2ed={'body':_0x4e22c4['body'],'channel':_0x08a1('0x70')};var _0x17e3cd=[];var _0x5492ae=[];var _0x24e219={};var _0x3fe570=![];return db[_0x08a1('0x71')][_0x08a1('0x62')]()[_0x08a1('0x1e')](function(_0x11a544){if(!_0x11a544){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x17e3cd=_[_0x08a1('0x72')](_[_0x08a1('0x3b')](_0x11a544),[_0x08a1('0x73'),_0x08a1('0x74')]);_0x5492ae=_[_0x08a1('0x72')](_[_0x08a1('0x3b')](_0x11a544),['createdAt',_0x08a1('0x74'),_0x08a1('0x75'),_0x08a1('0x76')]);if(_0x4e22c4['body']['id']){delete _0x4e22c4[_0x08a1('0x61')]['id'];}if(_['isNil'](_0x4e22c4[_0x08a1('0x61')]['from'])){throw new db[(_0x08a1('0x77'))][(_0x08a1('0x78'))](_0x08a1('0x79'));}if(_[_0x08a1('0x7a')](_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x61')])||_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x61')]===''){throw new db[(_0x08a1('0x77'))][(_0x08a1('0x78'))](_0x08a1('0x7b'));}if(_[_0x08a1('0x7a')](_0x4e22c4['body'][_0x08a1('0x7c')])){throw new db[(_0x08a1('0x77'))][(_0x08a1('0x78'))](_0x08a1('0x7d')+_0x5492ae);}if(!_['includes'](_0x5492ae,_0x4e22c4[_0x08a1('0x61')]['mapKey'])){throw new db[(_0x08a1('0x77'))][(_0x08a1('0x78'))](_0x08a1('0x7e')+_0x5492ae);}_0x24e219[_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x7c')]]=_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x7f')];})[_0x08a1('0x1e')](function(){return db[_0x08a1('0x39')][_0x08a1('0x5c')]({'where':{'id':_0x4e22c4['params']['id']},'include':[{'model':db[_0x08a1('0x80')],'as':_0x08a1('0x81'),'include':[{'model':db[_0x08a1('0x71')],'as':_0x08a1('0x82'),'where':_0x24e219,'limit':0x1,'order':[['updatedAt',_0x08a1('0x83')]]}]},{'model':db[_0x08a1('0x84')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x14c8a7,null))[_0x08a1('0x1e')](function(_0x1483e3){if(_0x1483e3&&_0x1483e3[_0x08a1('0x81')]){_0x1ce2ed['account']=_0x1483e3;_0x1ce2ed[_0x08a1('0x85')]=_0x1483e3[_0x08a1('0x86')];_0x1ce2ed[_0x08a1('0x87')]=_0x1483e3['List'];_0x1ce2ed[_0x08a1('0x85')]=_['orderBy'](_0x1ce2ed[_0x08a1('0x85')],[_0x08a1('0x88')],['asc']);if(_0x1ce2ed[_0x08a1('0x89')][_0x08a1('0x86')]){delete _0x1ce2ed[_0x08a1('0x89')][_0x08a1('0x86')];}if(_0x1ce2ed[_0x08a1('0x89')][_0x08a1('0x81')]&&_0x1ce2ed[_0x08a1('0x89')]['List']['Contacts']['length']){return _0x1ce2ed[_0x08a1('0x89')][_0x08a1('0x81')][_0x08a1('0x82')][0x0];}var _0x389cc2=_['defaults'](_0x4e22c4['body'],{'firstName':_0x4e22c4[_0x08a1('0x61')]['from'],'ListId':_0x1483e3[_0x08a1('0x76')]});_0x389cc2[_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x7c')]]=_0x4e22c4['body'][_0x08a1('0x7f')];return db[_0x08a1('0x71')][_0x08a1('0x58')](_0x389cc2,{'fields':_0x17e3cd,'raw':!![]});}})['then'](handleEntityNotFound(_0x14c8a7,null))[_0x08a1('0x1e')](function(_0x434620){_0x1ce2ed[_0x08a1('0x8a')]=_0x434620;if(_0x434620){var _0x544e32={'ContactId':_0x434620['id'],'OpenchannelAccountId':_0x4e22c4[_0x08a1('0x54')]['id'],'from':(_0x434620[_0x08a1('0x8b')]||'')+'\x20'+(_0x434620['lastName']||'')};var _0x480844={'OpenchannelAccountId':_0x4e22c4['params']['id'],'closed':![]};if(_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x8c')]){_0x480844[_0x08a1('0x8c')]=_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x8c')];return db[_0x08a1('0x8d')][_0x08a1('0x5c')]({'where':_0x480844})[_0x08a1('0x1e')](function(_0x56c947){if(_0x56c947){return[_0x56c947,![]];}_0x544e32['threadId']=_0x4e22c4[_0x08a1('0x61')]['threadId'];_0x544e32[_0x08a1('0x8e')]=_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x8e')];return db[_0x08a1('0x8d')][_0x08a1('0x58')](_0x544e32)[_0x08a1('0x1e')](function(_0x54774f){return[_0x54774f,!![]];});});}else{_0x480844[_0x08a1('0x8c')]=null;}_0x480844[_0x08a1('0x8f')]=_0x434620['id'];return db['OpenchannelInteraction'][_0x08a1('0x5c')]({'where':_0x480844})[_0x08a1('0x1e')](function(_0x5778b4){if(_0x5778b4){return[_0x5778b4,![]];}return db[_0x08a1('0x8d')][_0x08a1('0x58')](_0x544e32)['then'](function(_0x429498){return[_0x429498,!![]];});});}})[_0x08a1('0x90')](function(_0x328417,_0x44a22b){if(_0x328417){_0x3fe570=_0x44a22b;if(!_0x44a22b){var _0x53e23e={'from':(_0x1ce2ed[_0x08a1('0x8a')][_0x08a1('0x8b')]||'')+'\x20'+(_0x1ce2ed[_0x08a1('0x8a')][_0x08a1('0x91')]||'')};if(_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x8c')]&&_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x92')]&&_0x4e22c4[_0x08a1('0x61')]['threadId']!=_0x4e22c4[_0x08a1('0x61')]['messageId']){_0x53e23e[_0x08a1('0x8c')]=_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x92')];}return _0x328417[_0x08a1('0x30')](_0x53e23e);}else{return _0x328417;}}})['then'](function(_0xfea2fa){_0x1ce2ed['interaction']=_0xfea2fa[_0x08a1('0x32')]({'plain':!![]});_0x1ce2ed[_0x08a1('0x93')][_0x08a1('0x94')]=_0x3fe570;if(_0x1ce2ed['interaction']['created']){if(_0x1ce2ed['account'][_0x08a1('0x95')]){_0x1ce2ed[_0x08a1('0x85')][_0x08a1('0x96')]({'id':0x0,'priority':_0x1ce2ed[_0x08a1('0x85')][_0x08a1('0x55')]+0x1,'app':_0x08a1('0x97'),'appdata':_0x08a1('0x98'),'interval':_0x08a1('0x99')});}}return db[_0x08a1('0x9a')][_0x08a1('0x58')]({'body':_0x4e22c4[_0x08a1('0x61')][_0x08a1('0x61')],'OpenchannelAccountId':_0x4e22c4[_0x08a1('0x54')]['id'],'OpenchannelInteractionId':_0xfea2fa['id'],'direction':'in','ContactId':_0x1ce2ed[_0x08a1('0x8a')]['id'],'AttachmentId':_0x4e22c4['body']['AttachmentId']});})[_0x08a1('0x1e')](function(_0x1337e5){_0x1ce2ed[_0x08a1('0x24')]=_0x1337e5;if(_0x1ce2ed[_0x08a1('0x93')][_0x08a1('0x9b')]){return db[_0x08a1('0x9c')][_0x08a1('0x5c')]({'attributes':['id','name'],'where':{'id':_0x1ce2ed[_0x08a1('0x93')][_0x08a1('0x9b')]}})[_0x08a1('0x1e')](function(_0x322831){if(_0x322831){_0x1ce2ed[_0x08a1('0x85')][_0x08a1('0x9d')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x322831[_0x08a1('0x34')]+','+(_0x1ce2ed[_0x08a1('0x89')]['waitForTheAssignedAgent']||0xa),'interval':_0x08a1('0x99')});_0x1ce2ed['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0x08a1('0x9e'),_0x1ce2ed);});}return respondWithRpcPromise(_0x08a1('0x9f'),_0x08a1('0x9e'),_0x1ce2ed);})[_0x08a1('0x1e')](function(_0x31cc3c){respondWithRpcPromise('EventManager',_0x08a1('0xa0'),{'event':_0x08a1('0x6f'),'message':_0x31cc3c},client9002);return _0x31cc3c;})[_0x08a1('0x1e')](respondWithResult(_0x14c8a7,null))[_0x08a1('0x27')](handleError(_0x14c8a7,null));};exports[_0x08a1('0xa1')]=function(_0x118f74,_0x4a43d1,_0xcc4773){return db[_0x08a1('0x39')][_0x08a1('0x66')]({'where':{'id':_0x118f74['params']['id']}})['then'](handleEntityNotFound(_0x4a43d1,null))[_0x08a1('0x1e')](function(_0x138b3b){if(_0x138b3b){return db['sequelize'][_0x08a1('0xa2')](function(_0x40c319){return db[_0x08a1('0x84')][_0x08a1('0x31')]({'where':{'OpenchannelAccountId':_0x118f74[_0x08a1('0x54')]['id']},'transaction':_0x40c319})[_0x08a1('0x1e')](function(_0x5ac439){var _0x382a18=_[_0x08a1('0x4a')](_0x118f74['body'],function(_0x1a1970){_0x1a1970[_0x08a1('0x68')]=_0x118f74[_0x08a1('0x54')]['id'];return _0x1a1970;});return db[_0x08a1('0x84')]['bulkCreate'](_0x382a18,{'transaction':_0x40c319});});})[_0x08a1('0x1e')](function(){return db['OpenchannelApplication'][_0x08a1('0xa3')]({'where':{'OpenchannelAccountId':_0x118f74[_0x08a1('0x54')]['id']},'order':_0x08a1('0x88')});});}})['then'](respondWithResult(_0x4a43d1,null))['catch'](handleError(_0x4a43d1,null));};exports['getApplications']=function(_0xc8799e,_0x4dbea7,_0x4d0412){var _0x5da5e5={};var _0x18a99c={};var _0x27eff5;var _0x3793a7;return db['OpenchannelAccount'][_0x08a1('0x66')]({'where':{'id':_0xc8799e[_0x08a1('0x54')]['id']}})[_0x08a1('0x1e')](handleEntityNotFound(_0x4dbea7,null))[_0x08a1('0x1e')](function(_0x365b80){if(_0x365b80){_0x27eff5=_0x365b80;_0x18a99c[_0x08a1('0x3e')]=_['keys'](db[_0x08a1('0x84')][_0x08a1('0x3a')]);_0x18a99c[_0x08a1('0x3c')]=_[_0x08a1('0x3b')](_0xc8799e[_0x08a1('0x3c')]);_0x18a99c[_0x08a1('0x3d')]=_['intersection'](_0x18a99c[_0x08a1('0x3e')],_0x18a99c[_0x08a1('0x3c')]);_0x5da5e5[_0x08a1('0x41')]=_[_0x08a1('0x3f')](_0x18a99c['model'],qs[_0x08a1('0x40')](_0xc8799e[_0x08a1('0x3c')]['fields']));_0x5da5e5[_0x08a1('0x41')]=_0x5da5e5[_0x08a1('0x41')]['length']?_0x5da5e5['attributes']:_0x18a99c[_0x08a1('0x3e')];_0x5da5e5[_0x08a1('0x44')]=qs[_0x08a1('0x45')](_0xc8799e[_0x08a1('0x3c')][_0x08a1('0x45')]);_0x5da5e5['where']=qs[_0x08a1('0x3d')](_['pick'](_0xc8799e[_0x08a1('0x3c')],_0x18a99c[_0x08a1('0x3d')]));if(_0xc8799e[_0x08a1('0x3c')]['filter']){_0x5da5e5[_0x08a1('0x46')]=_[_0x08a1('0x49')](_0x5da5e5[_0x08a1('0x46')],{'$or':_[_0x08a1('0x4a')](_0x5da5e5['attributes'],function(_0x5e25f4){var _0x165189={};_0x165189[_0x5e25f4]={'$like':'%'+_0xc8799e[_0x08a1('0x3c')][_0x08a1('0x48')]+'%'};return _0x165189;})});}_0x5da5e5=_['merge']({},_0x5da5e5,_0xc8799e['options']);return _0x27eff5['getApplications'](_0x5da5e5);}})[_0x08a1('0x1e')](function(_0x2cc8f4){if(_0x2cc8f4){_0x3793a7=_0x2cc8f4['length'];if(!_0xc8799e['query']['hasOwnProperty'](_0x08a1('0x42'))){_0x5da5e5[_0x08a1('0x43')]=qs[_0x08a1('0x43')](_0xc8799e['query'][_0x08a1('0x43')]);_0x5da5e5[_0x08a1('0x2c')]=qs[_0x08a1('0x2c')](_0xc8799e[_0x08a1('0x3c')][_0x08a1('0x2c')]);}return _0x27eff5['getApplications'](_0x5da5e5);}})[_0x08a1('0x1e')](function(_0x408f18){if(_0x408f18){return _0x408f18?{'count':_0x3793a7,'rows':_0x408f18}:null;}})[_0x08a1('0x1e')](respondWithResult(_0x4dbea7,null))['catch'](handleError(_0x4dbea7,null));};exports[_0x08a1('0xa4')]=function(_0x30ae37,_0x59d81b,_0x34ca08){var _0x343bcb={'raw':![],'where':{}};var _0x8d205c={};var _0x3ef104={'count':0x0,'rows':[]};return db[_0x08a1('0x39')][_0x08a1('0x66')]({'where':{'id':_0x30ae37['params']['id']}})[_0x08a1('0x1e')](handleEntityNotFound(_0x59d81b,null))[_0x08a1('0x1e')](function(_0x5b677e){if(_0x5b677e){_0x8d205c[_0x08a1('0x3e')]=_['keys'](db['OpenchannelInteraction'][_0x08a1('0x3a')]);_0x8d205c[_0x08a1('0x3c')]=_['keys'](_0x30ae37['query']);_0x8d205c[_0x08a1('0x3d')]=_[_0x08a1('0x3f')](_0x8d205c[_0x08a1('0x3e')],_0x8d205c['query']);_0x343bcb[_0x08a1('0x41')]=_[_0x08a1('0x3f')](_0x8d205c['model'],qs[_0x08a1('0x40')](_0x30ae37[_0x08a1('0x3c')][_0x08a1('0x40')]));_0x343bcb[_0x08a1('0x41')]=_0x343bcb[_0x08a1('0x41')]['length']?_0x343bcb[_0x08a1('0x41')]:_0x8d205c[_0x08a1('0x3e')];if(!_0x30ae37[_0x08a1('0x3c')][_0x08a1('0x67')](_0x08a1('0x42'))){_0x343bcb[_0x08a1('0x43')]=qs[_0x08a1('0x43')](_0x30ae37[_0x08a1('0x3c')][_0x08a1('0x43')]);_0x343bcb[_0x08a1('0x2c')]=qs[_0x08a1('0x2c')](_0x30ae37['query'][_0x08a1('0x2c')]);}_0x343bcb[_0x08a1('0x44')]=qs[_0x08a1('0x45')](_0x30ae37[_0x08a1('0x3c')]['sort']);_0x343bcb[_0x08a1('0x46')]=qs['filters'](_[_0x08a1('0x47')](_0x30ae37[_0x08a1('0x3c')],_0x8d205c[_0x08a1('0x3d')]));_0x343bcb[_0x08a1('0x46')][_0x08a1('0x68')]=_0x5b677e['id'];if(_0x30ae37[_0x08a1('0x3c')]['filter']){_0x343bcb['where']=_[_0x08a1('0x49')](_0x343bcb[_0x08a1('0x46')],{'$or':_[_0x08a1('0x4a')](_0x343bcb[_0x08a1('0x41')],function(_0x3339c4){var _0x40a541={};_0x40a541[_0x3339c4]={'$like':'%'+_0x30ae37[_0x08a1('0x3c')][_0x08a1('0x48')]+'%'};return _0x40a541;})});}_0x343bcb=_[_0x08a1('0x49')]({},_0x343bcb,_0x30ae37[_0x08a1('0x57')]);return db[_0x08a1('0x8d')][_0x08a1('0x4f')]({'where':_0x343bcb[_0x08a1('0x46')]})['then'](function(_0x95afc5){_0x3ef104[_0x08a1('0x4f')]=_0x95afc5;if(_0x30ae37[_0x08a1('0x3c')]['includeAll']){_0x343bcb[_0x08a1('0x56')]=[{'model':db['CmContact'],'as':_0x08a1('0xa5'),'required':![]},{'model':db[_0x08a1('0x9c')],'as':_0x08a1('0xa6'),'attributes':[_0x08a1('0x34'),'fullname',_0x08a1('0xa7')],'required':![]},{'model':db['Tag'],'as':_0x08a1('0xa8'),'attributes':['id',_0x08a1('0x34'),_0x08a1('0xa9')],'where':_0x30ae37[_0x08a1('0x3c')]['tag']?{'id':_0x30ae37[_0x08a1('0x3c')][_0x08a1('0xaa')]}:undefined,'required':_0x30ae37[_0x08a1('0x3c')][_0x08a1('0xaa')]?!![]:![]}];}return db[_0x08a1('0x8d')][_0x08a1('0x51')](_0x343bcb);})[_0x08a1('0x1e')](function(_0x29244f){_0x3ef104[_0x08a1('0x52')]=_0x29244f;return _0x3ef104;});}})[_0x08a1('0x1e')](respondWithFilteredResult(_0x59d81b,_0x343bcb))[_0x08a1('0x27')](handleError(_0x59d81b,null));};exports[_0x08a1('0xab')]=function(_0x33ca92,_0x473a56,_0x4918b1){return db[_0x08a1('0x39')][_0x08a1('0x5c')]({'where':{'id':_0x33ca92[_0x08a1('0x54')]['id']}})[_0x08a1('0x1e')](handleEntityNotFound(_0x473a56,null))[_0x08a1('0x1e')](function(_0x35c2fa){if(_0x35c2fa){return _0x35c2fa[_0x08a1('0xab')](_0x33ca92[_0x08a1('0x61')][_0x08a1('0x6a')],_[_0x08a1('0xac')](_0x33ca92[_0x08a1('0x61')],['ids','id'])||{})[_0x08a1('0x90')](function(_0x49aaaa){for(var _0x16e445=0x0;_0x16e445<_0x33ca92['body']['ids'][_0x08a1('0x55')];_0x16e445+=0x1){socket[_0x08a1('0xad')](_0x08a1('0xae'),{'UserId':_0x33ca92[_0x08a1('0x61')]['ids'][_0x16e445],'OpenchannelAccountId':_0x33ca92[_0x08a1('0x54')]['id']});}return _0x49aaaa;});}})[_0x08a1('0x1e')](respondWithResult(_0x473a56,null))[_0x08a1('0x27')](handleError(_0x473a56,null));};exports['removeAgents']=function(_0x11da29,_0x46ca54,_0x11dac1){var _0x3a7d6e;return db[_0x08a1('0x39')]['find']({'where':{'id':_0x11da29[_0x08a1('0x54')]['id']}})[_0x08a1('0x1e')](handleEntityNotFound(_0x46ca54,null))['then'](function(_0x2ba948){if(_0x2ba948){return _0x2ba948[_0x08a1('0xaf')](_0x11da29[_0x08a1('0x3c')][_0x08a1('0x6a')])[_0x08a1('0x1e')](function(_0x52c19a){if(_[_0x08a1('0xb0')](_0x11da29[_0x08a1('0x3c')][_0x08a1('0x6a')])){for(var _0x2835ea=0x0;_0x2835ea<_0x11da29[_0x08a1('0x3c')][_0x08a1('0x6a')]['length'];_0x2835ea+=0x1){socket[_0x08a1('0xad')](_0x08a1('0xb1'),{'UserId':_0x11da29[_0x08a1('0x3c')][_0x08a1('0x6a')][_0x2835ea],'OpenchannelAccountId':_0x11da29[_0x08a1('0x54')]['id']});}}else{socket[_0x08a1('0xad')](_0x08a1('0xb1'),{'UserId':_0x11da29['query'][_0x08a1('0x6a')],'OpenchannelAccountId':_0x11da29[_0x08a1('0x54')]['id']});}});}})[_0x08a1('0x1e')](respondWithStatusCode(_0x46ca54,null))[_0x08a1('0x27')](handleError(_0x46ca54,null));};exports[_0x08a1('0xb2')]=function(_0x1dc984,_0x29918e,_0x269e3f){var _0xd990af={};var _0xe48e8f={};var _0x456462;var _0x201524;return db[_0x08a1('0x39')][_0x08a1('0x66')]({'where':{'id':_0x1dc984['params']['id']}})['then'](handleEntityNotFound(_0x29918e,null))['then'](function(_0x163b66){if(_0x163b66){_0x456462=_0x163b66;_0xe48e8f[_0x08a1('0x3e')]=_[_0x08a1('0x3b')](db['User']['rawAttributes']);_0xe48e8f[_0x08a1('0x3c')]=_[_0x08a1('0x3b')](_0x1dc984['query']);_0xe48e8f[_0x08a1('0x3d')]=_[_0x08a1('0x3f')](_0xe48e8f['model'],_0xe48e8f['query']);_0xd990af[_0x08a1('0x41')]=_[_0x08a1('0x3f')](_0xe48e8f['model'],qs['fields'](_0x1dc984['query'][_0x08a1('0x40')]));_0xd990af['attributes']=_0xd990af[_0x08a1('0x41')][_0x08a1('0x55')]?_0xd990af[_0x08a1('0x41')]:_0xe48e8f[_0x08a1('0x3e')];_0xd990af[_0x08a1('0x44')]=qs[_0x08a1('0x45')](_0x1dc984[_0x08a1('0x3c')][_0x08a1('0x45')]);_0xd990af[_0x08a1('0x46')]=qs[_0x08a1('0x3d')](_[_0x08a1('0x47')](_0x1dc984[_0x08a1('0x3c')],_0xe48e8f[_0x08a1('0x3d')]));if(_0x1dc984['query'][_0x08a1('0x48')]){_0xd990af[_0x08a1('0x46')]=_[_0x08a1('0x49')](_0xd990af[_0x08a1('0x46')],{'$or':_[_0x08a1('0x4a')](_0xd990af[_0x08a1('0x41')],function(_0x1d5207){var _0x192b3a={};_0x192b3a[_0x1d5207]={'$like':'%'+_0x1dc984['query']['filter']+'%'};return _0x192b3a;})});}_0xd990af=_[_0x08a1('0x49')]({},_0xd990af,_0x1dc984[_0x08a1('0x57')]);return _0x456462['getAgents'](_0xd990af);}})[_0x08a1('0x1e')](function(_0x5a5ccb){if(_0x5a5ccb){_0x201524=_0x5a5ccb[_0x08a1('0x55')];if(!_0x1dc984[_0x08a1('0x3c')][_0x08a1('0x67')](_0x08a1('0x42'))){_0xd990af[_0x08a1('0x43')]=qs[_0x08a1('0x43')](_0x1dc984[_0x08a1('0x3c')][_0x08a1('0x43')]);_0xd990af['offset']=qs[_0x08a1('0x2c')](_0x1dc984[_0x08a1('0x3c')]['offset']);}return _0x456462[_0x08a1('0xb2')](_0xd990af);}})[_0x08a1('0x1e')](function(_0x18ebee){if(_0x18ebee){return _0x18ebee?{'count':_0x201524,'rows':_0x18ebee}:null;}})[_0x08a1('0x1e')](respondWithResult(_0x29918e,null))['catch'](handleError(_0x29918e,null));};exports[_0x08a1('0x35')]=function(_0x5968e3,_0x56bafe,_0x1c3e5d){var _0x5b59be,_0x2d67d0,_0x3a09c0;if(_[_0x08a1('0x7a')](_0x5968e3[_0x08a1('0x61')][_0x08a1('0x61')])||_0x5968e3[_0x08a1('0x61')][_0x08a1('0x61')]===''){throw new db[(_0x08a1('0x77'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x5968e3[_0x08a1('0x61')]['to'])){}_0x5b59be=_0x5968e3[_0x08a1('0x61')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x5968e3['params']['id']}})[_0x08a1('0x1e')](handleEntityNotFound(_0x56bafe,null))[_0x08a1('0x1e')](function(_0x10a1a1){if(_0x10a1a1){return db[_0x08a1('0x39')][_0x08a1('0x5c')]({'where':{'id':_0x10a1a1['id']},'include':[{'model':db[_0x08a1('0x80')],'as':'List','include':[{'model':db[_0x08a1('0x71')],'as':'Contacts','where':{[_0x10a1a1[_0x08a1('0x7c')]]:_0x5b59be},'limit':0x1,'order':[[_0x08a1('0x74'),_0x08a1('0x83')]]}]}]})['then'](handleEntityNotFound(_0x56bafe,null))[_0x08a1('0x1e')](function(_0x3d4afa){if(_0x3d4afa&&_0x3d4afa[_0x08a1('0x81')]){_0x2d67d0=_0x3d4afa[_0x08a1('0x32')]({'plain':!![]});if(_0x2d67d0['List']&&_0x2d67d0[_0x08a1('0x81')][_0x08a1('0x82')][_0x08a1('0x55')]){return _0x2d67d0[_0x08a1('0x81')][_0x08a1('0x82')][0x0];}return db[_0x08a1('0x71')][_0x08a1('0x58')](_[_0x08a1('0xb3')](_0x5968e3[_0x08a1('0x61')],{'firstName':_0x5b59be,[_0x3d4afa['mapKey']]:_0x5b59be,'phone':_0x5b59be,'ListId':_0x2d67d0['ListId']}));}})[_0x08a1('0x1e')](handleEntityNotFound(_0x56bafe,null))['then'](function(_0x13da57){if(_0x13da57){_0x3a09c0=_0x13da57;return db[_0x08a1('0x8d')][_0x08a1('0x5c')]({'where':{'ContactId':_0x3a09c0['id'],'closed':![],'OpenchannelAccountId':_0x2d67d0['id']}})[_0x08a1('0x1e')](function(_0x463422){if(_0x463422){return[_0x463422,![]];}return db[_0x08a1('0x8d')][_0x08a1('0x58')]({'UserId':_0x5968e3[_0x08a1('0x59')]['id'],'ContactId':_0x3a09c0['id'],'OpenchannelAccountId':_0x2d67d0['id'],'lastMsgDirection':_0x08a1('0xb4'),'Messages':[_['merge'](_0x5968e3[_0x08a1('0x61')],{'read':![],'body':_0x5968e3[_0x08a1('0x61')][_0x08a1('0x61')],'OpenchannelAccountId':_0x2d67d0['id'],'UserId':_0x5968e3[_0x08a1('0x59')]['id'],'ContactId':_0x3a09c0['id']})]},{'include':[{'model':db[_0x08a1('0x9a')],'as':'Messages'}]})[_0x08a1('0x1e')](function(_0x2db2a7){return[_0x2db2a7,!![]];});});}})[_0x08a1('0x90')](function(_0x378d29,_0x4d82b6){if(_0x4d82b6){return _0x378d29;}return db[_0x08a1('0x9a')][_0x08a1('0x58')](_[_0x08a1('0x49')](_0x5968e3[_0x08a1('0x61')],{'read':![],'body':_0x5968e3[_0x08a1('0x61')][_0x08a1('0x61')],'OpenchannelAccountId':_0x2d67d0['id'],'OpenchannelInteractionId':_0x378d29['id'],'UserId':_0x5968e3['user']['id'],'ContactId':_0x3a09c0['id']}))[_0x08a1('0x1e')](function(_0x528968){_0x378d29[_0x08a1('0xb5')][_0x08a1('0xb6')]=[];_0x378d29[_0x08a1('0xb5')][_0x08a1('0xb6')][_0x08a1('0x96')](_0x528968['dataValues']);return _0x378d29;});});}})[_0x08a1('0x1e')](respondWithResult(_0x56bafe,null))[_0x08a1('0x27')](handleError(_0x56bafe,null));}; \ No newline at end of file +var _0xb334=['addAgents','omit','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','ListId','out','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','status','json','count','offset','limit','set','Content-Range','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','end','sendStatus','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','filter','merge','type','key','VIRTUAL','options','include','findAll','rows','fields','includeAll','find','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','params','getDispositions','findOne','Disposition','nolimit','pick','map','removeDispositions','ids','OpenchannelAccountId','CannedAnswer','create','getAnswers','order','removeAnswers','notify','openchannel','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','isNil','from','ValidationError','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','Contacts','OpenchannelApplication','Applications','account','applications','list','asc','CmContact','contact','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','bulkCreate','priority','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag'];(function(_0x53618a,_0x3ce1c8){var _0x588ddb=function(_0x2deeb9){while(--_0x2deeb9){_0x53618a['push'](_0x53618a['shift']());}};_0x588ddb(++_0x3ce1c8);}(_0xb334,0x179));var _0x4b33=function(_0x5c41e7,_0x15571e){_0x5c41e7=_0x5c41e7-0x0;var _0x514af7=_0xb334[_0x5c41e7];return _0x514af7;};'use strict';var pdf=require(_0x4b33('0x0'));var emlformat=require(_0x4b33('0x1'));var rimraf=require(_0x4b33('0x2'));var zipdir=require(_0x4b33('0x3'));var jsonpatch=require(_0x4b33('0x4'));var rp=require(_0x4b33('0x5'));var moment=require('moment');var BPromise=require(_0x4b33('0x6'));var Mustache=require(_0x4b33('0x7'));var util=require(_0x4b33('0x8'));var path=require(_0x4b33('0x9'));var sox=require(_0x4b33('0xa'));var csv=require(_0x4b33('0xb'));var ejs=require(_0x4b33('0xc'));var fs=require('fs');var _=require(_0x4b33('0xd'));var squel=require(_0x4b33('0xe'));var crypto=require('crypto');var jsforce=require(_0x4b33('0xf'));var deskjs=require(_0x4b33('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4b33('0x11'));var authService=require(_0x4b33('0x12'));var hardwareService=require(_0x4b33('0x13'));var Redis=require(_0x4b33('0x14'));var qs=require(_0x4b33('0x15'));var logger=require(_0x4b33('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x4b33('0x17'));var db=require(_0x4b33('0x18'))['db'];config['redis']=_['defaults'](config[_0x4b33('0x19')],{'host':_0x4b33('0x1a'),'port':0x18eb});var socket=require(_0x4b33('0x1b'))(new Redis(config[_0x4b33('0x19')]));require('./openchannelAccount.socket')[_0x4b33('0x1c')](socket);var jayson=require(_0x4b33('0x1d'));var client=jayson[_0x4b33('0x1e')][_0x4b33('0x1f')]({'port':0x232c});var client9002=jayson[_0x4b33('0x1e')][_0x4b33('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4d96a3,_0x328a30,_0x524bea,_0x623b3){return new BPromise(function(_0x1e219c,_0x20fbd0){var _0x4bcfff=_0x623b3||client;return _0x4bcfff[_0x4b33('0x20')](_0x4d96a3,_0x524bea)[_0x4b33('0x21')](function(_0xf6f47a){logger[_0x4b33('0x22')](_0x4b33('0x23'),_0x328a30,'request\x20sent');logger[_0x4b33('0x24')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x328a30,'request\x20sent',JSON[_0x4b33('0x25')](_0xf6f47a));if(_0xf6f47a[_0x4b33('0x26')]){if(_0xf6f47a[_0x4b33('0x26')][_0x4b33('0x27')]===0x1f4){logger[_0x4b33('0x26')](_0x4b33('0x23'),_0x328a30,_0xf6f47a[_0x4b33('0x26')][_0x4b33('0x28')]);return _0x20fbd0(_0xf6f47a[_0x4b33('0x26')][_0x4b33('0x28')]);}logger[_0x4b33('0x26')](_0x4b33('0x23'),_0x328a30,_0xf6f47a[_0x4b33('0x26')][_0x4b33('0x28')]);return _0x1e219c(_0xf6f47a['error']['message']);}else{logger[_0x4b33('0x22')](_0x4b33('0x23'),_0x328a30,_0x4b33('0x29'));_0x1e219c(_0xf6f47a['result']['message']);}})[_0x4b33('0x2a')](function(_0x27e96f){logger['error'](_0x4b33('0x23'),_0x328a30,_0x27e96f);_0x20fbd0(_0x27e96f);});});}function respondWithStatusCode(_0x3e27ab,_0x48a1e9){_0x48a1e9=_0x48a1e9||0xcc;return function(_0x30c351){if(_0x30c351){return _0x3e27ab['sendStatus'](_0x48a1e9);}return _0x3e27ab['status'](_0x48a1e9)['end']();};}function respondWithResult(_0x56b7a6,_0x240c44){_0x240c44=_0x240c44||0xc8;return function(_0x47bd9b){if(_0x47bd9b){return _0x56b7a6[_0x4b33('0x2b')](_0x240c44)[_0x4b33('0x2c')](_0x47bd9b);}};}function respondWithFilteredResult(_0x541a03,_0x71115a){return function(_0x4c245c){if(_0x4c245c){var _0x5bc322=_0x4c245c[_0x4b33('0x2d')],_0x20df87=_0x71115a['offset'],_0x4ae701=_0x71115a[_0x4b33('0x2e')]+_0x71115a[_0x4b33('0x2f')],_0x26f28;if(_0x4ae701>=_0x5bc322){_0x4ae701=_0x5bc322;_0x26f28=0xc8;}else{_0x26f28=0xce;}_0x541a03[_0x4b33('0x2b')](_0x26f28);return _0x541a03[_0x4b33('0x30')](_0x4b33('0x31'),_0x20df87+'-'+_0x4ae701+'/'+_0x5bc322)[_0x4b33('0x2c')](_0x4c245c);}return null;};}function patchUpdates(_0x5ec041){return function(_0x10ab39){try{jsonpatch['apply'](_0x10ab39,_0x5ec041,!![]);}catch(_0x212b5d){return BPromise[_0x4b33('0x32')](_0x212b5d);}return _0x10ab39['save']();};}function saveUpdates(_0x967312,_0x151fc4){return function(_0x14c188){if(_0x14c188){return _0x14c188[_0x4b33('0x33')](_0x967312)[_0x4b33('0x21')](function(_0x135a0a){return _0x135a0a;});}return null;};}function removeEntity(_0x351e52,_0x273380){return function(_0x22a811){if(_0x22a811){return _0x22a811[_0x4b33('0x34')]()[_0x4b33('0x21')](function(){var _0x229f84=_0x22a811[_0x4b33('0x35')]({'plain':!![]});var _0x11bd6b=_0x4b33('0x36');return db[_0x4b33('0x37')]['destroy']({'where':{'type':_0x11bd6b,'resourceId':_0x229f84['id']}})[_0x4b33('0x21')](function(){return _0x22a811;});})[_0x4b33('0x21')](function(){_0x351e52['status'](0xcc)[_0x4b33('0x38')]();});}};}function handleEntityNotFound(_0xa0466,_0x343bb1){return function(_0x3545f0){if(!_0x3545f0){_0xa0466[_0x4b33('0x39')](0x194);}return _0x3545f0;};}function handleError(_0x4d212d,_0x5dc0a2){_0x5dc0a2=_0x5dc0a2||0x1f4;return function(_0x51c6bb){logger['error'](_0x51c6bb['stack']);if(_0x51c6bb[_0x4b33('0x3a')]){delete _0x51c6bb['name'];}_0x4d212d['status'](_0x5dc0a2)[_0x4b33('0x3b')](_0x51c6bb);};}exports[_0x4b33('0x3c')]=function(_0x1c1bc3,_0x1b3420){var _0xae5efa={'include':[{'model':db[_0x4b33('0x3d')],'as':_0x4b33('0x3e')}]},_0x21f337={},_0x5d8ad3={'count':0x0,'rows':[]};var _0x293924=db[_0x4b33('0x3f')][_0x4b33('0x40')];_0x21f337[_0x4b33('0x41')]=_[_0x4b33('0x42')](_0x293924);_0x21f337[_0x4b33('0x43')]=_[_0x4b33('0x42')](_0x1c1bc3['query']);_0x21f337[_0x4b33('0x44')]=_['intersection'](_0x21f337[_0x4b33('0x41')],_0x21f337['query']);_0xae5efa['attributes']=_[_0x4b33('0x45')](_0x21f337[_0x4b33('0x41')],qs['fields'](_0x1c1bc3[_0x4b33('0x43')]['fields']));_0xae5efa['attributes']=_0xae5efa[_0x4b33('0x46')][_0x4b33('0x47')]?_0xae5efa['attributes']:_0x21f337['model'];if(!_0x1c1bc3[_0x4b33('0x43')][_0x4b33('0x48')]('nolimit')){_0xae5efa['limit']=qs[_0x4b33('0x2f')](_0x1c1bc3[_0x4b33('0x43')][_0x4b33('0x2f')]);_0xae5efa[_0x4b33('0x2e')]=qs[_0x4b33('0x2e')](_0x1c1bc3['query'][_0x4b33('0x2e')]);}_0xae5efa['order']=qs[_0x4b33('0x49')](_0x1c1bc3[_0x4b33('0x43')][_0x4b33('0x49')]);_0xae5efa[_0x4b33('0x4a')]=qs[_0x4b33('0x44')](_['pick'](_0x1c1bc3[_0x4b33('0x43')],_0x21f337[_0x4b33('0x44')]));if(_0x1c1bc3[_0x4b33('0x43')][_0x4b33('0x4b')]){_0xae5efa['where']=_[_0x4b33('0x4c')](_0xae5efa[_0x4b33('0x4a')],{'$or':_['map'](_0x293924,function(_0x328bf3){if(_0x328bf3[_0x4b33('0x4d')][_0x4b33('0x4e')]!==_0x4b33('0x4f')){var _0x4630a9={};_0x4630a9[_0x328bf3['field']]={'$like':'%'+_0x1c1bc3[_0x4b33('0x43')][_0x4b33('0x4b')]+'%'};return _0x4630a9;}})});}_0xae5efa=_[_0x4b33('0x4c')]({},_0xae5efa,_0x1c1bc3[_0x4b33('0x50')]);var _0x127e32={'where':_0xae5efa['where']};return db[_0x4b33('0x3f')][_0x4b33('0x2d')](_0x127e32)[_0x4b33('0x21')](function(_0x4e7258){_0x5d8ad3['count']=_0x4e7258;if(_0x1c1bc3[_0x4b33('0x43')]['includeAll']){_0xae5efa[_0x4b33('0x51')]=[{'all':!![]}];}return db[_0x4b33('0x3f')][_0x4b33('0x52')](_0xae5efa);})['then'](function(_0x2e21d8){_0x5d8ad3[_0x4b33('0x53')]=_0x2e21d8;return _0x5d8ad3;})['then'](respondWithFilteredResult(_0x1b3420,_0xae5efa))[_0x4b33('0x2a')](handleError(_0x1b3420,null));};exports['show']=function(_0x320692,_0x5c15ae){var _0x31396b={'raw':![],'where':{'id':_0x320692['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5114f1={};_0x5114f1['model']=_['keys'](db[_0x4b33('0x3f')][_0x4b33('0x40')]);_0x5114f1[_0x4b33('0x43')]=_[_0x4b33('0x42')](_0x320692[_0x4b33('0x43')]);_0x5114f1[_0x4b33('0x44')]=_[_0x4b33('0x45')](_0x5114f1[_0x4b33('0x41')],_0x5114f1[_0x4b33('0x43')]);_0x31396b[_0x4b33('0x46')]=_['intersection'](_0x5114f1['model'],qs[_0x4b33('0x54')](_0x320692[_0x4b33('0x43')][_0x4b33('0x54')]));_0x31396b[_0x4b33('0x46')]=_0x31396b[_0x4b33('0x46')]['length']?_0x31396b['attributes']:_0x5114f1[_0x4b33('0x41')];if(_0x320692[_0x4b33('0x43')][_0x4b33('0x55')]){_0x31396b[_0x4b33('0x51')]=[{'all':!![]}];}_0x31396b=_[_0x4b33('0x4c')]({},_0x31396b,_0x320692[_0x4b33('0x50')]);return db[_0x4b33('0x3f')][_0x4b33('0x56')](_0x31396b)['then'](handleEntityNotFound(_0x5c15ae,null))[_0x4b33('0x21')](respondWithResult(_0x5c15ae,null))[_0x4b33('0x2a')](handleError(_0x5c15ae,null));};exports['create']=function(_0x1f7e60,_0x20cf43){return db[_0x4b33('0x3f')]['create'](_0x1f7e60['body'],{})[_0x4b33('0x21')](function(_0x3db346){var _0x2d78b1=_0x1f7e60[_0x4b33('0x57')][_0x4b33('0x35')]({'plain':!![]});if(!_0x2d78b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d78b1[_0x4b33('0x58')]==='user'){var _0x239793=_0x3db346[_0x4b33('0x35')]({'plain':!![]});var _0x4ae1e=_0x4b33('0x36');return db[_0x4b33('0x59')][_0x4b33('0x56')]({'where':{'name':_0x4ae1e,'userProfileId':_0x2d78b1['userProfileId']},'raw':!![]})[_0x4b33('0x21')](function(_0x5d4938){if(_0x5d4938&&_0x5d4938['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x239793[_0x4b33('0x3a')],'resourceId':_0x239793['id'],'type':_0x5d4938[_0x4b33('0x3a')],'sectionId':_0x5d4938['id']},{})[_0x4b33('0x21')](function(){return _0x3db346;});}else{return _0x3db346;}})[_0x4b33('0x2a')](function(_0x4c9188){logger[_0x4b33('0x26')](_0x4b33('0x5a'),_0x4c9188);throw _0x4c9188;});}return _0x3db346;})[_0x4b33('0x21')](respondWithResult(_0x20cf43,0xc9))[_0x4b33('0x2a')](handleError(_0x20cf43,null));};exports[_0x4b33('0x33')]=function(_0x433e7c,_0x56d48e){if(_0x433e7c[_0x4b33('0x5b')]['id']){delete _0x433e7c['body']['id'];}return db[_0x4b33('0x3f')][_0x4b33('0x56')]({'where':{'id':_0x433e7c['params']['id']},'include':[{'model':db['Pause'],'as':_0x4b33('0x3e')}]})[_0x4b33('0x21')](handleEntityNotFound(_0x56d48e,null))['then'](saveUpdates(_0x433e7c[_0x4b33('0x5b')],null))[_0x4b33('0x21')](function(_0x1886b1){if(_0x1886b1&&_0x433e7c[_0x4b33('0x5b')][_0x4b33('0x3e')]){return db[_0x4b33('0x3d')][_0x4b33('0x33')](_0x433e7c[_0x4b33('0x5b')][_0x4b33('0x3e')],{'where':{'OpenchannelAccountId':_0x1886b1['id']}})[_0x4b33('0x21')](function(){return _0x1886b1;});}return _0x1886b1;})[_0x4b33('0x21')](respondWithResult(_0x56d48e,null))['catch'](handleError(_0x56d48e,null));};exports[_0x4b33('0x34')]=function(_0x37d5e2,_0x118747){return db['OpenchannelAccount'][_0x4b33('0x56')]({'where':{'id':_0x37d5e2['params']['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x118747,null))[_0x4b33('0x21')](removeEntity(_0x118747,null))[_0x4b33('0x2a')](handleError(_0x118747,null));};exports[_0x4b33('0x5c')]=function(_0x9438ca,_0x4c5b2a){return db[_0x4b33('0x3f')]['describe']()[_0x4b33('0x21')](respondWithResult(_0x4c5b2a,null))[_0x4b33('0x2a')](handleError(_0x4c5b2a,null));};exports[_0x4b33('0x5d')]=function(_0x462bcc,_0x45c9c7,_0x7af2b5){if(_0x462bcc[_0x4b33('0x5b')]['id']){delete _0x462bcc[_0x4b33('0x5b')]['id'];}return db[_0x4b33('0x3f')]['find']({'where':{'id':_0x462bcc[_0x4b33('0x5e')]['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x45c9c7,null))[_0x4b33('0x21')](function(_0x5b1bff){if(_0x5b1bff){_0x462bcc[_0x4b33('0x5b')]['OpnechannelAccountId']=_0x5b1bff['id'];return db['Disposition']['create'](_0x462bcc[_0x4b33('0x5b')]);}})['then'](respondWithResult(_0x45c9c7,null))[_0x4b33('0x2a')](handleError(_0x45c9c7,null));};exports[_0x4b33('0x5f')]=function(_0x2d83fd,_0x49059d,_0x561383){var _0x3284f8={'raw':![],'where':{}};var _0x4b23f6={};var _0x3e5a1a={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x4b33('0x60')]({'where':{'id':_0x2d83fd[_0x4b33('0x5e')]['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x49059d,null))['then'](function(_0x8bfaea){if(_0x8bfaea){_0x4b23f6['model']=_[_0x4b33('0x42')](db[_0x4b33('0x61')]['rawAttributes']);_0x4b23f6['query']=_['keys'](_0x2d83fd[_0x4b33('0x43')]);_0x4b23f6[_0x4b33('0x44')]=_[_0x4b33('0x45')](_0x4b23f6['model'],_0x4b23f6[_0x4b33('0x43')]);_0x3284f8['attributes']=_[_0x4b33('0x45')](_0x4b23f6[_0x4b33('0x41')],qs['fields'](_0x2d83fd['query'][_0x4b33('0x54')]));_0x3284f8[_0x4b33('0x46')]=_0x3284f8['attributes'][_0x4b33('0x47')]?_0x3284f8[_0x4b33('0x46')]:_0x4b23f6[_0x4b33('0x41')];if(!_0x2d83fd[_0x4b33('0x43')][_0x4b33('0x48')](_0x4b33('0x62'))){_0x3284f8[_0x4b33('0x2f')]=qs[_0x4b33('0x2f')](_0x2d83fd['query']['limit']);_0x3284f8[_0x4b33('0x2e')]=qs[_0x4b33('0x2e')](_0x2d83fd[_0x4b33('0x43')]['offset']);}_0x3284f8['order']=qs['sort'](_0x2d83fd[_0x4b33('0x43')]['sort']);_0x3284f8[_0x4b33('0x4a')]=qs[_0x4b33('0x44')](_[_0x4b33('0x63')](_0x2d83fd['query'],_0x4b23f6[_0x4b33('0x44')]));_0x3284f8[_0x4b33('0x4a')]['OpenchannelAccountId']=_0x8bfaea['id'];if(_0x2d83fd[_0x4b33('0x43')][_0x4b33('0x4b')]){_0x3284f8[_0x4b33('0x4a')]=_[_0x4b33('0x4c')](_0x3284f8[_0x4b33('0x4a')],{'$or':_[_0x4b33('0x64')](_0x3284f8[_0x4b33('0x46')],function(_0x3fff7f){var _0x54c4c8={};_0x54c4c8[_0x3fff7f]={'$like':'%'+_0x2d83fd['query']['filter']+'%'};return _0x54c4c8;})});}_0x3284f8=_['merge']({},_0x3284f8,_0x2d83fd['options']);return db[_0x4b33('0x61')][_0x4b33('0x2d')]({'where':_0x3284f8[_0x4b33('0x4a')]})[_0x4b33('0x21')](function(_0x4cbc60){_0x3e5a1a[_0x4b33('0x2d')]=_0x4cbc60;if(_0x2d83fd[_0x4b33('0x43')][_0x4b33('0x55')]){_0x3284f8[_0x4b33('0x51')]=[{'all':!![]}];}return db[_0x4b33('0x61')][_0x4b33('0x52')](_0x3284f8);})['then'](function(_0x5b044a){_0x3e5a1a['rows']=_0x5b044a;return _0x3e5a1a;});}})[_0x4b33('0x21')](respondWithFilteredResult(_0x49059d,_0x3284f8))[_0x4b33('0x2a')](handleError(_0x49059d,null));};exports[_0x4b33('0x65')]=function(_0x576ff1,_0x3c308a,_0x43d45f){var _0x1cffaa;return db[_0x4b33('0x3f')][_0x4b33('0x56')]({'where':{'id':_0x576ff1[_0x4b33('0x5e')]['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x3c308a,null))['then'](function(_0x110585){if(_0x110585){return _0x110585[_0x4b33('0x65')](_0x576ff1[_0x4b33('0x43')][_0x4b33('0x66')]);}})[_0x4b33('0x21')](respondWithStatusCode(_0x3c308a,null))[_0x4b33('0x2a')](handleError(_0x3c308a,null));};exports['addAnswer']=function(_0x2f61f5,_0x2c7b51,_0x3b47a7){if(_0x2f61f5['body']['id']){delete _0x2f61f5[_0x4b33('0x5b')]['id'];}return db[_0x4b33('0x3f')]['find']({'where':{'id':_0x2f61f5['params']['id']}})['then'](handleEntityNotFound(_0x2c7b51,null))['then'](function(_0x2b42a6){if(_0x2b42a6){_0x2f61f5[_0x4b33('0x5b')][_0x4b33('0x67')]=_0x2b42a6['id'];return db[_0x4b33('0x68')][_0x4b33('0x69')](_0x2f61f5[_0x4b33('0x5b')]);}})[_0x4b33('0x21')](respondWithResult(_0x2c7b51,null))[_0x4b33('0x2a')](handleError(_0x2c7b51,null));};exports[_0x4b33('0x6a')]=function(_0x36bb82,_0x4a44c9,_0x1fd564){var _0x15bb04={'raw':![],'where':{}};var _0x3c2848={};var _0x141035={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x36bb82[_0x4b33('0x5e')]['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x4a44c9,null))[_0x4b33('0x21')](function(_0x163d5e){if(_0x163d5e){_0x3c2848[_0x4b33('0x41')]=_[_0x4b33('0x42')](db[_0x4b33('0x68')][_0x4b33('0x40')]);_0x3c2848[_0x4b33('0x43')]=_[_0x4b33('0x42')](_0x36bb82[_0x4b33('0x43')]);_0x3c2848[_0x4b33('0x44')]=_['intersection'](_0x3c2848[_0x4b33('0x41')],_0x3c2848['query']);_0x15bb04['attributes']=_[_0x4b33('0x45')](_0x3c2848[_0x4b33('0x41')],qs['fields'](_0x36bb82[_0x4b33('0x43')][_0x4b33('0x54')]));_0x15bb04[_0x4b33('0x46')]=_0x15bb04[_0x4b33('0x46')]['length']?_0x15bb04[_0x4b33('0x46')]:_0x3c2848[_0x4b33('0x41')];if(!_0x36bb82['query'][_0x4b33('0x48')](_0x4b33('0x62'))){_0x15bb04[_0x4b33('0x2f')]=qs[_0x4b33('0x2f')](_0x36bb82[_0x4b33('0x43')][_0x4b33('0x2f')]);_0x15bb04[_0x4b33('0x2e')]=qs[_0x4b33('0x2e')](_0x36bb82['query']['offset']);}_0x15bb04[_0x4b33('0x6b')]=qs[_0x4b33('0x49')](_0x36bb82[_0x4b33('0x43')]['sort']);_0x15bb04['where']=qs['filters'](_[_0x4b33('0x63')](_0x36bb82['query'],_0x3c2848[_0x4b33('0x44')]));_0x15bb04[_0x4b33('0x4a')][_0x4b33('0x67')]=_0x163d5e['id'];if(_0x36bb82['query'][_0x4b33('0x4b')]){_0x15bb04[_0x4b33('0x4a')]=_[_0x4b33('0x4c')](_0x15bb04[_0x4b33('0x4a')],{'$or':_[_0x4b33('0x64')](_0x15bb04[_0x4b33('0x46')],function(_0x2f9df4){var _0x46cfd0={};_0x46cfd0[_0x2f9df4]={'$like':'%'+_0x36bb82[_0x4b33('0x43')]['filter']+'%'};return _0x46cfd0;})});}_0x15bb04=_[_0x4b33('0x4c')]({},_0x15bb04,_0x36bb82['options']);return db[_0x4b33('0x68')][_0x4b33('0x2d')]({'where':_0x15bb04[_0x4b33('0x4a')]})[_0x4b33('0x21')](function(_0x5ca70f){_0x141035['count']=_0x5ca70f;if(_0x36bb82[_0x4b33('0x43')][_0x4b33('0x55')]){_0x15bb04['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x4b33('0x52')](_0x15bb04);})[_0x4b33('0x21')](function(_0x3ee690){_0x141035['rows']=_0x3ee690;return _0x141035;});}})['then'](respondWithFilteredResult(_0x4a44c9,_0x15bb04))[_0x4b33('0x2a')](handleError(_0x4a44c9,null));};exports['removeAnswers']=function(_0x2aee97,_0x24a474,_0x4b3237){var _0x18508c;return db['OpenchannelAccount'][_0x4b33('0x56')]({'where':{'id':_0x2aee97['params']['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x24a474,null))[_0x4b33('0x21')](function(_0x440b23){if(_0x440b23){return _0x440b23[_0x4b33('0x6c')](_0x2aee97[_0x4b33('0x43')][_0x4b33('0x66')]);}})[_0x4b33('0x21')](respondWithStatusCode(_0x24a474,null))[_0x4b33('0x2a')](handleError(_0x24a474,null));};exports[_0x4b33('0x6d')]=function(_0x59850a,_0x465fc1,_0x3c8dd5){var _0x40b023={'body':_0x59850a[_0x4b33('0x5b')],'channel':_0x4b33('0x6e')};var _0xf4c7aa=[];var _0x18744f=[];var _0x2827ab={};var _0x5203eb=![];return db['CmContact'][_0x4b33('0x5c')]()['then'](function(_0x26fc58){if(!_0x26fc58){throw new db[(_0x4b33('0x6f'))]['ValidationError'](_0x4b33('0x70'));}_0xf4c7aa=_['difference'](_['keys'](_0x26fc58),[_0x4b33('0x71'),_0x4b33('0x72')]);_0x18744f=_[_0x4b33('0x73')](_[_0x4b33('0x42')](_0x26fc58),[_0x4b33('0x71'),_0x4b33('0x72'),_0x4b33('0x74'),'ListId']);if(_0x59850a[_0x4b33('0x5b')]['id']){delete _0x59850a['body']['id'];}if(_[_0x4b33('0x75')](_0x59850a[_0x4b33('0x5b')][_0x4b33('0x76')])){throw new db[(_0x4b33('0x6f'))][(_0x4b33('0x77'))](_0x4b33('0x78'));}if(_[_0x4b33('0x75')](_0x59850a[_0x4b33('0x5b')]['body'])||_0x59850a[_0x4b33('0x5b')][_0x4b33('0x5b')]===''){throw new db[(_0x4b33('0x6f'))][(_0x4b33('0x77'))](_0x4b33('0x79'));}if(_[_0x4b33('0x75')](_0x59850a[_0x4b33('0x5b')]['mapKey'])){throw new db[(_0x4b33('0x6f'))][(_0x4b33('0x77'))](_0x4b33('0x7a')+_0x18744f);}if(!_[_0x4b33('0x7b')](_0x18744f,_0x59850a['body'][_0x4b33('0x7c')])){throw new db[(_0x4b33('0x6f'))]['ValidationError'](_0x4b33('0x7d')+_0x18744f);}_0x2827ab[_0x59850a[_0x4b33('0x5b')][_0x4b33('0x7c')]]=_0x59850a[_0x4b33('0x5b')][_0x4b33('0x76')];})['then'](function(){return db[_0x4b33('0x3f')][_0x4b33('0x56')]({'where':{'id':_0x59850a[_0x4b33('0x5e')]['id']},'include':[{'model':db[_0x4b33('0x7e')],'as':_0x4b33('0x7f'),'include':[{'model':db['CmContact'],'as':_0x4b33('0x80'),'where':_0x2827ab,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x4b33('0x81')],'as':_0x4b33('0x82')}]});})['then'](handleEntityNotFound(_0x465fc1,null))[_0x4b33('0x21')](function(_0x4a193e){if(_0x4a193e&&_0x4a193e['List']){_0x40b023[_0x4b33('0x83')]=_0x4a193e;_0x40b023[_0x4b33('0x84')]=_0x4a193e['Applications'];_0x40b023[_0x4b33('0x85')]=_0x4a193e[_0x4b33('0x7f')];_0x40b023['applications']=_['orderBy'](_0x40b023[_0x4b33('0x84')],['priority'],[_0x4b33('0x86')]);if(_0x40b023['account'][_0x4b33('0x82')]){delete _0x40b023[_0x4b33('0x83')][_0x4b33('0x82')];}if(_0x40b023[_0x4b33('0x83')]['List']&&_0x40b023[_0x4b33('0x83')]['List'][_0x4b33('0x80')][_0x4b33('0x47')]){return _0x40b023[_0x4b33('0x83')][_0x4b33('0x7f')][_0x4b33('0x80')][0x0];}var _0x458f6e=_['defaults'](_0x59850a[_0x4b33('0x5b')],{'firstName':_0x59850a[_0x4b33('0x5b')][_0x4b33('0x76')],'ListId':_0x4a193e['ListId']});_0x458f6e[_0x59850a[_0x4b33('0x5b')][_0x4b33('0x7c')]]=_0x59850a[_0x4b33('0x5b')][_0x4b33('0x76')];return db[_0x4b33('0x87')]['create'](_0x458f6e,{'fields':_0xf4c7aa,'raw':!![]});}})[_0x4b33('0x21')](handleEntityNotFound(_0x465fc1,null))[_0x4b33('0x21')](function(_0x3e09fa){_0x40b023[_0x4b33('0x88')]=_0x3e09fa;if(_0x3e09fa){var _0x10473e={'ContactId':_0x3e09fa['id'],'OpenchannelAccountId':_0x59850a[_0x4b33('0x5e')]['id'],'from':(_0x3e09fa['firstName']||'')+'\x20'+(_0x3e09fa[_0x4b33('0x89')]||'')};var _0x2706df={'OpenchannelAccountId':_0x59850a['params']['id'],'closed':![]};if(_0x59850a[_0x4b33('0x5b')][_0x4b33('0x8a')]){_0x2706df['threadId']=_0x59850a[_0x4b33('0x5b')][_0x4b33('0x8a')];return db['OpenchannelInteraction']['find']({'where':_0x2706df})[_0x4b33('0x21')](function(_0xb452db){if(_0xb452db){return[_0xb452db,![]];}_0x10473e[_0x4b33('0x8a')]=_0x59850a[_0x4b33('0x5b')][_0x4b33('0x8a')];_0x10473e[_0x4b33('0x8b')]=_0x59850a['body'][_0x4b33('0x8b')];return db[_0x4b33('0x8c')][_0x4b33('0x69')](_0x10473e)[_0x4b33('0x21')](function(_0x3e6f66){return[_0x3e6f66,!![]];});});}else{_0x2706df[_0x4b33('0x8a')]=null;}_0x2706df[_0x4b33('0x8d')]=_0x3e09fa['id'];return db['OpenchannelInteraction'][_0x4b33('0x56')]({'where':_0x2706df})['then'](function(_0x1c6916){if(_0x1c6916){return[_0x1c6916,![]];}return db[_0x4b33('0x8c')]['create'](_0x10473e)[_0x4b33('0x21')](function(_0x271373){return[_0x271373,!![]];});});}})[_0x4b33('0x8e')](function(_0x5658a5,_0x2143eb){if(_0x5658a5){_0x5203eb=_0x2143eb;if(!_0x2143eb){var _0x38f877={'from':(_0x40b023[_0x4b33('0x88')][_0x4b33('0x8f')]||'')+'\x20'+(_0x40b023[_0x4b33('0x88')][_0x4b33('0x89')]||'')};if(_0x59850a['body']['threadId']&&_0x59850a[_0x4b33('0x5b')][_0x4b33('0x90')]&&_0x59850a[_0x4b33('0x5b')][_0x4b33('0x8a')]!=_0x59850a[_0x4b33('0x5b')][_0x4b33('0x90')]){_0x38f877[_0x4b33('0x8a')]=_0x59850a[_0x4b33('0x5b')]['messageId'];}return _0x5658a5['update'](_0x38f877);}else{return _0x5658a5;}}})['then'](function(_0x58908f){_0x40b023[_0x4b33('0x91')]=_0x58908f[_0x4b33('0x35')]({'plain':!![]});_0x40b023['interaction'][_0x4b33('0x92')]=_0x5203eb;if(_0x40b023[_0x4b33('0x91')][_0x4b33('0x92')]){if(_0x40b023[_0x4b33('0x83')][_0x4b33('0x93')]){_0x40b023[_0x4b33('0x84')][_0x4b33('0x94')]({'id':0x0,'priority':_0x40b023[_0x4b33('0x84')]['length']+0x1,'app':_0x4b33('0x95'),'appdata':_0x4b33('0x96'),'interval':_0x4b33('0x97')});}}return db[_0x4b33('0x98')][_0x4b33('0x69')]({'body':_0x59850a[_0x4b33('0x5b')][_0x4b33('0x5b')],'OpenchannelAccountId':_0x59850a['params']['id'],'OpenchannelInteractionId':_0x58908f['id'],'direction':'in','ContactId':_0x40b023[_0x4b33('0x88')]['id'],'AttachmentId':_0x59850a[_0x4b33('0x5b')][_0x4b33('0x99')]});})['then'](function(_0x21abf9){_0x40b023[_0x4b33('0x28')]=_0x21abf9;if(_0x40b023[_0x4b33('0x91')][_0x4b33('0x9a')]){return db[_0x4b33('0x9b')]['find']({'attributes':['id','name'],'where':{'id':_0x40b023['interaction'][_0x4b33('0x9a')]}})[_0x4b33('0x21')](function(_0x214093){if(_0x214093){_0x40b023['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x214093['name']+','+(_0x40b023[_0x4b33('0x83')]['waitForTheAssignedAgent']||0xa),'interval':_0x4b33('0x97')});_0x40b023[_0x4b33('0x9c')]=![];}return respondWithRpcPromise(_0x4b33('0x9d'),_0x4b33('0x9e'),_0x40b023);});}return respondWithRpcPromise('Start','startRouting',_0x40b023);})[_0x4b33('0x21')](function(_0x29b7fe){respondWithRpcPromise(_0x4b33('0x9f'),'EventManager',{'event':_0x4b33('0x6d'),'message':_0x29b7fe},client9002);return _0x29b7fe;})['then'](respondWithResult(_0x465fc1,null))[_0x4b33('0x2a')](handleError(_0x465fc1,null));};exports['addApplications']=function(_0x24c08c,_0x5ab5e1,_0x353547){return db[_0x4b33('0x3f')]['findOne']({'where':{'id':_0x24c08c[_0x4b33('0x5e')]['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x5ab5e1,null))['then'](function(_0x440511){if(_0x440511){return db[_0x4b33('0xa0')][_0x4b33('0xa1')](function(_0x3f2aa7){return db['OpenchannelApplication'][_0x4b33('0x34')]({'where':{'OpenchannelAccountId':_0x24c08c[_0x4b33('0x5e')]['id']},'transaction':_0x3f2aa7})[_0x4b33('0x21')](function(_0x5e21d5){var _0x56093b=_['map'](_0x24c08c[_0x4b33('0x5b')],function(_0x4b05e1){_0x4b05e1['OpenchannelAccountId']=_0x24c08c[_0x4b33('0x5e')]['id'];return _0x4b05e1;});return db['OpenchannelApplication'][_0x4b33('0xa2')](_0x56093b,{'transaction':_0x3f2aa7});});})[_0x4b33('0x21')](function(){return db[_0x4b33('0x81')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x24c08c['params']['id']},'order':_0x4b33('0xa3')});});}})[_0x4b33('0x21')](respondWithResult(_0x5ab5e1,null))['catch'](handleError(_0x5ab5e1,null));};exports[_0x4b33('0xa4')]=function(_0x385036,_0x13daa1,_0x4b15fb){var _0x22289a={};var _0xe377e4={};var _0x257880;var _0xec3e5f;return db[_0x4b33('0x3f')][_0x4b33('0x60')]({'where':{'id':_0x385036[_0x4b33('0x5e')]['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x13daa1,null))[_0x4b33('0x21')](function(_0x3bdf4e){if(_0x3bdf4e){_0x257880=_0x3bdf4e;_0xe377e4[_0x4b33('0x41')]=_['keys'](db[_0x4b33('0x81')][_0x4b33('0x40')]);_0xe377e4['query']=_[_0x4b33('0x42')](_0x385036[_0x4b33('0x43')]);_0xe377e4[_0x4b33('0x44')]=_[_0x4b33('0x45')](_0xe377e4[_0x4b33('0x41')],_0xe377e4[_0x4b33('0x43')]);_0x22289a[_0x4b33('0x46')]=_[_0x4b33('0x45')](_0xe377e4['model'],qs[_0x4b33('0x54')](_0x385036[_0x4b33('0x43')]['fields']));_0x22289a[_0x4b33('0x46')]=_0x22289a[_0x4b33('0x46')]['length']?_0x22289a[_0x4b33('0x46')]:_0xe377e4[_0x4b33('0x41')];_0x22289a[_0x4b33('0x6b')]=qs['sort'](_0x385036[_0x4b33('0x43')][_0x4b33('0x49')]);_0x22289a['where']=qs['filters'](_[_0x4b33('0x63')](_0x385036[_0x4b33('0x43')],_0xe377e4[_0x4b33('0x44')]));if(_0x385036[_0x4b33('0x43')][_0x4b33('0x4b')]){_0x22289a['where']=_[_0x4b33('0x4c')](_0x22289a[_0x4b33('0x4a')],{'$or':_[_0x4b33('0x64')](_0x22289a[_0x4b33('0x46')],function(_0x281029){var _0x228964={};_0x228964[_0x281029]={'$like':'%'+_0x385036[_0x4b33('0x43')][_0x4b33('0x4b')]+'%'};return _0x228964;})});}_0x22289a=_[_0x4b33('0x4c')]({},_0x22289a,_0x385036[_0x4b33('0x50')]);return _0x257880[_0x4b33('0xa4')](_0x22289a);}})[_0x4b33('0x21')](function(_0x17dde4){if(_0x17dde4){_0xec3e5f=_0x17dde4[_0x4b33('0x47')];if(!_0x385036[_0x4b33('0x43')][_0x4b33('0x48')]('nolimit')){_0x22289a[_0x4b33('0x2f')]=qs[_0x4b33('0x2f')](_0x385036['query'][_0x4b33('0x2f')]);_0x22289a['offset']=qs[_0x4b33('0x2e')](_0x385036['query'][_0x4b33('0x2e')]);}return _0x257880[_0x4b33('0xa4')](_0x22289a);}})[_0x4b33('0x21')](function(_0x1df76e){if(_0x1df76e){return _0x1df76e?{'count':_0xec3e5f,'rows':_0x1df76e}:null;}})[_0x4b33('0x21')](respondWithResult(_0x13daa1,null))[_0x4b33('0x2a')](handleError(_0x13daa1,null));};exports[_0x4b33('0xa5')]=function(_0x1266ac,_0x24b0b5,_0x30b032){var _0x3dec9b={'raw':![],'where':{}};var _0x4faa7e={};var _0x2af28a={'count':0x0,'rows':[]};return db[_0x4b33('0x3f')][_0x4b33('0x60')]({'where':{'id':_0x1266ac[_0x4b33('0x5e')]['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x24b0b5,null))[_0x4b33('0x21')](function(_0x36a2ba){if(_0x36a2ba){_0x4faa7e[_0x4b33('0x41')]=_[_0x4b33('0x42')](db[_0x4b33('0x8c')][_0x4b33('0x40')]);_0x4faa7e[_0x4b33('0x43')]=_[_0x4b33('0x42')](_0x1266ac['query']);_0x4faa7e['filters']=_[_0x4b33('0x45')](_0x4faa7e[_0x4b33('0x41')],_0x4faa7e[_0x4b33('0x43')]);_0x3dec9b[_0x4b33('0x46')]=_['intersection'](_0x4faa7e[_0x4b33('0x41')],qs[_0x4b33('0x54')](_0x1266ac[_0x4b33('0x43')]['fields']));_0x3dec9b[_0x4b33('0x46')]=_0x3dec9b[_0x4b33('0x46')][_0x4b33('0x47')]?_0x3dec9b[_0x4b33('0x46')]:_0x4faa7e['model'];if(!_0x1266ac[_0x4b33('0x43')][_0x4b33('0x48')]('nolimit')){_0x3dec9b['limit']=qs[_0x4b33('0x2f')](_0x1266ac[_0x4b33('0x43')]['limit']);_0x3dec9b[_0x4b33('0x2e')]=qs[_0x4b33('0x2e')](_0x1266ac[_0x4b33('0x43')][_0x4b33('0x2e')]);}_0x3dec9b['order']=qs[_0x4b33('0x49')](_0x1266ac[_0x4b33('0x43')]['sort']);_0x3dec9b['where']=qs[_0x4b33('0x44')](_[_0x4b33('0x63')](_0x1266ac['query'],_0x4faa7e['filters']));_0x3dec9b[_0x4b33('0x4a')][_0x4b33('0x67')]=_0x36a2ba['id'];if(_0x1266ac[_0x4b33('0x43')][_0x4b33('0x4b')]){_0x3dec9b['where']=_['merge'](_0x3dec9b['where'],{'$or':_[_0x4b33('0x64')](_0x3dec9b[_0x4b33('0x46')],function(_0x242cd9){var _0x1b978c={};_0x1b978c[_0x242cd9]={'$like':'%'+_0x1266ac['query'][_0x4b33('0x4b')]+'%'};return _0x1b978c;})});}_0x3dec9b=_[_0x4b33('0x4c')]({},_0x3dec9b,_0x1266ac[_0x4b33('0x50')]);return db[_0x4b33('0x8c')][_0x4b33('0x2d')]({'where':_0x3dec9b[_0x4b33('0x4a')]})[_0x4b33('0x21')](function(_0x598497){_0x2af28a[_0x4b33('0x2d')]=_0x598497;if(_0x1266ac[_0x4b33('0x43')][_0x4b33('0x55')]){_0x3dec9b[_0x4b33('0x51')]=[{'model':db[_0x4b33('0x87')],'as':_0x4b33('0xa6'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x4b33('0x3a'),_0x4b33('0xa7'),_0x4b33('0xa8')],'required':![]},{'model':db[_0x4b33('0xa9')],'as':'Tags','attributes':['id','name',_0x4b33('0xaa')],'where':_0x1266ac[_0x4b33('0x43')][_0x4b33('0xab')]?{'id':_0x1266ac['query'][_0x4b33('0xab')]}:undefined,'required':_0x1266ac[_0x4b33('0x43')][_0x4b33('0xab')]?!![]:![]}];}return db[_0x4b33('0x8c')]['findAll'](_0x3dec9b);})[_0x4b33('0x21')](function(_0x112785){_0x2af28a[_0x4b33('0x53')]=_0x112785;return _0x2af28a;});}})[_0x4b33('0x21')](respondWithFilteredResult(_0x24b0b5,_0x3dec9b))[_0x4b33('0x2a')](handleError(_0x24b0b5,null));};exports[_0x4b33('0xac')]=function(_0x5c672f,_0x2e5668,_0x7c15a5){return db['OpenchannelAccount'][_0x4b33('0x56')]({'where':{'id':_0x5c672f[_0x4b33('0x5e')]['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x2e5668,null))[_0x4b33('0x21')](function(_0x271de8){if(_0x271de8){return _0x271de8[_0x4b33('0xac')](_0x5c672f[_0x4b33('0x5b')][_0x4b33('0x66')],_[_0x4b33('0xad')](_0x5c672f[_0x4b33('0x5b')],[_0x4b33('0x66'),'id'])||{})['spread'](function(_0x329e29){for(var _0x11c0a4=0x0;_0x11c0a4<_0x5c672f[_0x4b33('0x5b')][_0x4b33('0x66')][_0x4b33('0x47')];_0x11c0a4+=0x1){socket['emit'](_0x4b33('0xae'),{'UserId':_0x5c672f[_0x4b33('0x5b')]['ids'][_0x11c0a4],'OpenchannelAccountId':_0x5c672f['params']['id']});}return _0x329e29;});}})[_0x4b33('0x21')](respondWithResult(_0x2e5668,null))[_0x4b33('0x2a')](handleError(_0x2e5668,null));};exports[_0x4b33('0xaf')]=function(_0x1cfac7,_0x389779,_0x4cc29b){var _0x3bb96c;return db[_0x4b33('0x3f')][_0x4b33('0x56')]({'where':{'id':_0x1cfac7[_0x4b33('0x5e')]['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x389779,null))[_0x4b33('0x21')](function(_0x232e01){if(_0x232e01){return _0x232e01[_0x4b33('0xaf')](_0x1cfac7[_0x4b33('0x43')]['ids'])[_0x4b33('0x21')](function(_0x3969a0){if(_['isArray'](_0x1cfac7[_0x4b33('0x43')][_0x4b33('0x66')])){for(var _0x2f4df7=0x0;_0x2f4df7<_0x1cfac7[_0x4b33('0x43')][_0x4b33('0x66')][_0x4b33('0x47')];_0x2f4df7+=0x1){socket[_0x4b33('0xb0')](_0x4b33('0xb1'),{'UserId':_0x1cfac7[_0x4b33('0x43')][_0x4b33('0x66')][_0x2f4df7],'OpenchannelAccountId':_0x1cfac7[_0x4b33('0x5e')]['id']});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':_0x1cfac7[_0x4b33('0x43')][_0x4b33('0x66')],'OpenchannelAccountId':_0x1cfac7[_0x4b33('0x5e')]['id']});}});}})['then'](respondWithStatusCode(_0x389779,null))[_0x4b33('0x2a')](handleError(_0x389779,null));};exports[_0x4b33('0xb2')]=function(_0x30cff0,_0x4326ee,_0x25019b){var _0xdf9af2={};var _0x236ba4={};var _0x59b8e7;var _0x390066;return db[_0x4b33('0x3f')][_0x4b33('0x60')]({'where':{'id':_0x30cff0[_0x4b33('0x5e')]['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x4326ee,null))[_0x4b33('0x21')](function(_0x4184a9){if(_0x4184a9){_0x59b8e7=_0x4184a9;_0x236ba4[_0x4b33('0x41')]=_[_0x4b33('0x42')](db[_0x4b33('0x9b')]['rawAttributes']);_0x236ba4[_0x4b33('0x43')]=_[_0x4b33('0x42')](_0x30cff0[_0x4b33('0x43')]);_0x236ba4[_0x4b33('0x44')]=_['intersection'](_0x236ba4[_0x4b33('0x41')],_0x236ba4[_0x4b33('0x43')]);_0xdf9af2[_0x4b33('0x46')]=_['intersection'](_0x236ba4[_0x4b33('0x41')],qs[_0x4b33('0x54')](_0x30cff0[_0x4b33('0x43')][_0x4b33('0x54')]));_0xdf9af2[_0x4b33('0x46')]=_0xdf9af2['attributes'][_0x4b33('0x47')]?_0xdf9af2[_0x4b33('0x46')]:_0x236ba4[_0x4b33('0x41')];_0xdf9af2['order']=qs[_0x4b33('0x49')](_0x30cff0[_0x4b33('0x43')]['sort']);_0xdf9af2[_0x4b33('0x4a')]=qs[_0x4b33('0x44')](_['pick'](_0x30cff0['query'],_0x236ba4[_0x4b33('0x44')]));if(_0x30cff0[_0x4b33('0x43')][_0x4b33('0x4b')]){_0xdf9af2[_0x4b33('0x4a')]=_[_0x4b33('0x4c')](_0xdf9af2['where'],{'$or':_['map'](_0xdf9af2[_0x4b33('0x46')],function(_0x5e8e66){var _0x35896a={};_0x35896a[_0x5e8e66]={'$like':'%'+_0x30cff0[_0x4b33('0x43')][_0x4b33('0x4b')]+'%'};return _0x35896a;})});}_0xdf9af2=_[_0x4b33('0x4c')]({},_0xdf9af2,_0x30cff0[_0x4b33('0x50')]);return _0x59b8e7['getAgents'](_0xdf9af2);}})['then'](function(_0x9612bb){if(_0x9612bb){_0x390066=_0x9612bb[_0x4b33('0x47')];if(!_0x30cff0[_0x4b33('0x43')][_0x4b33('0x48')](_0x4b33('0x62'))){_0xdf9af2[_0x4b33('0x2f')]=qs[_0x4b33('0x2f')](_0x30cff0['query'][_0x4b33('0x2f')]);_0xdf9af2[_0x4b33('0x2e')]=qs['offset'](_0x30cff0[_0x4b33('0x43')][_0x4b33('0x2e')]);}return _0x59b8e7[_0x4b33('0xb2')](_0xdf9af2);}})[_0x4b33('0x21')](function(_0x384d0b){if(_0x384d0b){return _0x384d0b?{'count':_0x390066,'rows':_0x384d0b}:null;}})[_0x4b33('0x21')](respondWithResult(_0x4326ee,null))[_0x4b33('0x2a')](handleError(_0x4326ee,null));};exports[_0x4b33('0x3b')]=function(_0x1c7b9d,_0x580fbd,_0x2cbad3){var _0x5f5b6a,_0xc756,_0x1d186d;if(_[_0x4b33('0x75')](_0x1c7b9d[_0x4b33('0x5b')]['body'])||_0x1c7b9d[_0x4b33('0x5b')][_0x4b33('0x5b')]===''){throw new db[(_0x4b33('0x6f'))][(_0x4b33('0x77'))](_0x4b33('0x79'));}if(_[_0x4b33('0x75')](_0x1c7b9d['body']['to'])){}_0x5f5b6a=_0x1c7b9d[_0x4b33('0x5b')]['to'];return db[_0x4b33('0x3f')][_0x4b33('0x60')]({'where':{'id':_0x1c7b9d[_0x4b33('0x5e')]['id']}})[_0x4b33('0x21')](handleEntityNotFound(_0x580fbd,null))['then'](function(_0x46969b){if(_0x46969b){return db[_0x4b33('0x3f')][_0x4b33('0x56')]({'where':{'id':_0x46969b['id']},'include':[{'model':db[_0x4b33('0x7e')],'as':_0x4b33('0x7f'),'include':[{'model':db[_0x4b33('0x87')],'as':_0x4b33('0x80'),'where':{[_0x46969b[_0x4b33('0x7c')]]:_0x5f5b6a},'limit':0x1,'order':[[_0x4b33('0x72'),'DESC']]}]}]})[_0x4b33('0x21')](handleEntityNotFound(_0x580fbd,null))[_0x4b33('0x21')](function(_0x42822d){if(_0x42822d&&_0x42822d[_0x4b33('0x7f')]){_0xc756=_0x42822d[_0x4b33('0x35')]({'plain':!![]});if(_0xc756['List']&&_0xc756[_0x4b33('0x7f')][_0x4b33('0x80')][_0x4b33('0x47')]){return _0xc756[_0x4b33('0x7f')][_0x4b33('0x80')][0x0];}return db['CmContact']['create'](_['defaults'](_0x1c7b9d[_0x4b33('0x5b')],{'firstName':_0x5f5b6a,[_0x42822d['mapKey']]:_0x5f5b6a,'phone':_0x5f5b6a,'ListId':_0xc756[_0x4b33('0xb3')]}));}})[_0x4b33('0x21')](handleEntityNotFound(_0x580fbd,null))['then'](function(_0x159664){if(_0x159664){_0x1d186d=_0x159664;return db[_0x4b33('0x8c')][_0x4b33('0x56')]({'where':{'ContactId':_0x1d186d['id'],'closed':![],'OpenchannelAccountId':_0xc756['id']}})[_0x4b33('0x21')](function(_0x2e3e5c){if(_0x2e3e5c){return[_0x2e3e5c,![]];}return db[_0x4b33('0x8c')]['create']({'UserId':_0x1c7b9d[_0x4b33('0x57')]['id'],'ContactId':_0x1d186d['id'],'OpenchannelAccountId':_0xc756['id'],'lastMsgDirection':_0x4b33('0xb4'),'Messages':[_[_0x4b33('0x4c')](_0x1c7b9d[_0x4b33('0x5b')],{'read':![],'body':_0x1c7b9d[_0x4b33('0x5b')][_0x4b33('0x5b')],'OpenchannelAccountId':_0xc756['id'],'UserId':_0x1c7b9d[_0x4b33('0x57')]['id'],'ContactId':_0x1d186d['id']})]},{'include':[{'model':db[_0x4b33('0x98')],'as':_0x4b33('0xb5')}]})[_0x4b33('0x21')](function(_0x2f5518){return[_0x2f5518,!![]];});});}})[_0x4b33('0x8e')](function(_0x54a36a,_0x5a4397){if(_0x5a4397){return _0x54a36a;}return db[_0x4b33('0x98')][_0x4b33('0x69')](_[_0x4b33('0x4c')](_0x1c7b9d[_0x4b33('0x5b')],{'read':![],'body':_0x1c7b9d[_0x4b33('0x5b')][_0x4b33('0x5b')],'OpenchannelAccountId':_0xc756['id'],'OpenchannelInteractionId':_0x54a36a['id'],'UserId':_0x1c7b9d[_0x4b33('0x57')]['id'],'ContactId':_0x1d186d['id']}))['then'](function(_0x1b5768){_0x54a36a[_0x4b33('0xb6')][_0x4b33('0xb5')]=[];_0x54a36a[_0x4b33('0xb6')][_0x4b33('0xb5')][_0x4b33('0x94')](_0x1b5768[_0x4b33('0xb6')]);return _0x54a36a;});});}})[_0x4b33('0x21')](respondWithResult(_0x580fbd,null))['catch'](handleError(_0x580fbd,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 3f5a3c6..7f57859 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 _0x2cdc=['hasOwnProperty','exports','events','../../mysqldb','OpenchannelAccount','save','update','remove','emit'];(function(_0x5e5c64,_0x19b9fb){var _0x1bf287=function(_0x19fb98){while(--_0x19fb98){_0x5e5c64['push'](_0x5e5c64['shift']());}};_0x1bf287(++_0x19b9fb);}(_0x2cdc,0x173));var _0xc2cd=function(_0x35bdab,_0x28a695){_0x35bdab=_0x35bdab-0x0;var _0xbe96b0=_0x2cdc[_0x35bdab];return _0xbe96b0;};'use strict';var EventEmitter=require(_0xc2cd('0x0'));var OpenchannelAccount=require(_0xc2cd('0x1'))['db'][_0xc2cd('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc2cd('0x3'),'afterUpdate':_0xc2cd('0x4'),'afterDestroy':_0xc2cd('0x5')};function emitEvent(_0x11d57f){return function(_0x34400e,_0x1f4990,_0xed8c18){OpenchannelAccountEvents['emit'](_0x11d57f+':'+_0x34400e['id'],_0x34400e);OpenchannelAccountEvents[_0xc2cd('0x6')](_0x11d57f,_0x34400e);_0xed8c18(null);};}for(var e in events){if(events[_0xc2cd('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xc2cd('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x7f53=['events','../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x52523c,_0x25ebc2){var _0x2e01cb=function(_0x26b8fb){while(--_0x26b8fb){_0x52523c['push'](_0x52523c['shift']());}};_0x2e01cb(++_0x25ebc2);}(_0x7f53,0xc0));var _0x37f5=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x7f53[_0x4c12ec];return _0x3ae42c;};'use strict';var EventEmitter=require(_0x37f5('0x0'));var OpenchannelAccount=require(_0x37f5('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x37f5('0x2')](0x0);var events={'afterCreate':_0x37f5('0x3'),'afterUpdate':_0x37f5('0x4'),'afterDestroy':'remove'};function emitEvent(_0xd14b8a){return function(_0x5be3c3,_0x362dd7,_0x3c3860){OpenchannelAccountEvents[_0x37f5('0x5')](_0xd14b8a+':'+_0x5be3c3['id'],_0x5be3c3);OpenchannelAccountEvents[_0x37f5('0x5')](_0xd14b8a,_0x5be3c3);_0x3c3860(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x37f5('0x6')](e,emitEvent(event));}}module[_0x37f5('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 5de7d84..67ace11 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 _0x4fc2=['./openchannelAccount.attributes','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xe485dd,_0x49a04a){var _0x355013=function(_0x4150d3){while(--_0x4150d3){_0xe485dd['push'](_0xe485dd['shift']());}};_0x355013(++_0x49a04a);}(_0x4fc2,0x111));var _0x24fc=function(_0x570995,_0x2dffdf){_0x570995=_0x570995-0x0;var _0x3b7ee9=_0x4fc2[_0x570995];return _0x3b7ee9;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var attributes=require(_0x24fc('0x6'));module['exports']=function(_0x126d90,_0x3772eb){return _0x126d90['define'](_0x24fc('0x7'),attributes,{'tableName':_0x24fc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['openchannel_accounts','lodash','../../config/logger','moment','request-promise','exports'];(function(_0x1d4592,_0x24174b){var _0x76f8b6=function(_0x5e562d){while(--_0x5e562d){_0x1d4592['push'](_0x1d4592['shift']());}};_0x76f8b6(++_0x24174b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xb7e7[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var attributes=require('./openchannelAccount.attributes');module[_0x7b7e('0x4')]=function(_0x118577,_0x1d9384){return _0x118577['define']('OpenchannelAccount',attributes,{'tableName':_0x7b7e('0x5'),'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 8f97ade..8f5dac1 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x49c957,_0x3509d8){var _0x5b1d38=function(_0x219976){while(--_0x219976){_0x49c957['push'](_0x49c957['shift']());}};_0x5b1d38(++_0x3509d8);}(_0xe14b,0x93));var _0xbe14=function(_0x51674a,_0x2ca337){_0x51674a=_0x51674a-0x0;var _0x4a1f4e=_0xe14b[_0x51674a];return _0x4a1f4e;};'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});config[_0xbe14('0x9')]=_[_0xbe14('0xa')](config[_0xbe14('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe14('0xb'))[_0xbe14('0xc')](socket);function respondWithRpcPromise(_0xd68cd7,_0x90b4f,_0x53c7ea){return new BPromise(function(_0x5b9fc6,_0x113243){return client[_0xbe14('0xd')](_0xd68cd7,_0x53c7ea)['then'](function(_0x254c3b){logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));logger[_0xbe14('0x11')](_0xbe14('0x12'),_0x90b4f,_0xbe14('0x10'),JSON[_0xbe14('0x13')](_0x254c3b));if(_0x254c3b[_0xbe14('0x14')]){if(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x15')]===0x1f4){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error']['message']);return _0x113243(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error'][_0xbe14('0x16')]);return _0x5b9fc6(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}else{logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));_0x5b9fc6(_0x254c3b[_0xbe14('0x17')]['message']);}})[_0xbe14('0x18')](function(_0x456ca8){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x456ca8);_0x113243(_0x456ca8);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0x2ef3,0xba));var _0x32ef=function(_0x13b477,_0x40b9b7){_0x13b477=_0x13b477-0x0;var _0x4b2559=_0x2ef3[_0x13b477];return _0x4b2559;};'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});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index c2dc9e3..a826930 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 _0x8faa=['emit','removeListener','register','./openchannelAccount.events','save'];(function(_0x2532a6,_0x25e8e9){var _0x1d6b92=function(_0x39158d){while(--_0x39158d){_0x2532a6['push'](_0x2532a6['shift']());}};_0x1d6b92(++_0x25e8e9);}(_0x8faa,0x189));var _0xa8fa=function(_0x38841c,_0x1af0bf){_0x38841c=_0x38841c-0x0;var _0x500610=_0x8faa[_0x38841c];return _0x500610;};'use strict';var OpenchannelAccountEvents=require(_0xa8fa('0x0'));var events=[_0xa8fa('0x1'),'remove','update'];function createListener(_0xbf8850,_0x19adc9){return function(_0xae459b){_0x19adc9[_0xa8fa('0x2')](_0xbf8850,_0xae459b);};}function removeListener(_0x3c4f23,_0x10c8bd){return function(){OpenchannelAccountEvents[_0xa8fa('0x3')](_0x3c4f23,_0x10c8bd);};}exports[_0xa8fa('0x4')]=function(_0x596fcd){for(var _0x239c1a=0x0,_0x599c58=events['length'];_0x239c1a<_0x599c58;_0x239c1a++){var _0x50e847=events[_0x239c1a];var _0x508ea2=createListener('openchannelAccount:'+_0x50e847,_0x596fcd);OpenchannelAccountEvents['on'](_0x50e847,_0x508ea2);}}; \ No newline at end of file +var _0x93d5=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','update','emit'];(function(_0x198dbc,_0x163468){var _0x1dc525=function(_0x1f2edb){while(--_0x1f2edb){_0x198dbc['push'](_0x198dbc['shift']());}};_0x1dc525(++_0x163468);}(_0x93d5,0x9c));var _0x593d=function(_0x168f7e,_0x275902){_0x168f7e=_0x168f7e-0x0;var _0x380dfd=_0x93d5[_0x168f7e];return _0x380dfd;};'use strict';var OpenchannelAccountEvents=require(_0x593d('0x0'));var events=[_0x593d('0x1'),'remove',_0x593d('0x2')];function createListener(_0x400962,_0x3aa69f){return function(_0x4307a5){_0x3aa69f[_0x593d('0x3')](_0x400962,_0x4307a5);};}function removeListener(_0x25bf63,_0x5b5733){return function(){OpenchannelAccountEvents[_0x593d('0x4')](_0x25bf63,_0x5b5733);};}exports[_0x593d('0x5')]=function(_0x2ccd91){for(var _0x5493de=0x0,_0x2e9465=events[_0x593d('0x6')];_0x5493de<_0x2e9465;_0x5493de++){var _0x1fa213=events[_0x5493de];var _0x225485=createListener(_0x593d('0x7')+_0x1fa213,_0x2ccd91);OpenchannelAccountEvents['on'](_0x1fa213,_0x225485);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 4be63d4..20c63b8 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 _0xea1f=['/:id','show','create','put','update','delete','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index'];(function(_0x45d240,_0x34912f){var _0x2562ff=function(_0x263eca){while(--_0x263eca){_0x45d240['push'](_0x45d240['shift']());}};_0x2562ff(++_0x34912f);}(_0xea1f,0x1c2));var _0xfea1=function(_0x30d4a4,_0x295888){_0x30d4a4=_0x30d4a4-0x0;var _0xd60212=_0xea1f[_0x30d4a4];return _0xd60212;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfea1('0x0'));var router=express[_0xfea1('0x1')]();var auth=require(_0xfea1('0x2'));var interaction=require(_0xfea1('0x3'));var config=require(_0xfea1('0x4'));var controller=require(_0xfea1('0x5'));router[_0xfea1('0x6')]('/',auth[_0xfea1('0x7')](),controller[_0xfea1('0x8')]);router[_0xfea1('0x6')](_0xfea1('0x9'),auth[_0xfea1('0x7')](),controller[_0xfea1('0xa')]);router['post']('/',auth[_0xfea1('0x7')](),controller[_0xfea1('0xb')]);router[_0xfea1('0xc')](_0xfea1('0x9'),auth[_0xfea1('0x7')](),controller[_0xfea1('0xd')]);router[_0xfea1('0xe')]('/:id',auth[_0xfea1('0x7')](),controller[_0xfea1('0xf')]);module[_0xfea1('0x10')]=router; \ No newline at end of file +var _0x5c5e=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show'];(function(_0x4211f2,_0x369159){var _0x2ed1f7=function(_0x369104){while(--_0x369104){_0x4211f2['push'](_0x4211f2['shift']());}};_0x2ed1f7(++_0x369159);}(_0x5c5e,0x123));var _0xe5c5=function(_0x452f32,_0x53b2d2){_0x452f32=_0x452f32-0x0;var _0x18845b=_0x5c5e[_0x452f32];return _0x18845b;};'use strict';var multer=require(_0xe5c5('0x0'));var util=require(_0xe5c5('0x1'));var path=require(_0xe5c5('0x2'));var timeout=require(_0xe5c5('0x3'));var express=require(_0xe5c5('0x4'));var router=express[_0xe5c5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe5c5('0x6'));var config=require(_0xe5c5('0x7'));var controller=require(_0xe5c5('0x8'));router[_0xe5c5('0x9')]('/',auth[_0xe5c5('0xa')](),controller['index']);router['get'](_0xe5c5('0xb'),auth[_0xe5c5('0xa')](),controller[_0xe5c5('0xc')]);router[_0xe5c5('0xd')]('/',auth[_0xe5c5('0xa')](),controller[_0xe5c5('0xe')]);router[_0xe5c5('0xf')](_0xe5c5('0xb'),auth[_0xe5c5('0xa')](),controller['update']);router[_0xe5c5('0x10')](_0xe5c5('0xb'),auth['isAuthenticated'](),controller[_0xe5c5('0x11')]);module[_0xe5c5('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index f7d6176..d9de509 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 _0x964b=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x25da9f,_0x47d72c){var _0x447588=function(_0x212fa5){while(--_0x212fa5){_0x25da9f['push'](_0x25da9f['shift']());}};_0x447588(++_0x47d72c);}(_0x964b,0x112));var _0xb964=function(_0x391132,_0x1010de){_0x391132=_0x391132-0x0;var _0x1d07b7=_0x964b[_0x391132];return _0x1d07b7;};'use strict';var Sequelize=require(_0xb964('0x0'));module[_0xb964('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb964('0x2')],'allowNull':![],'defaultValue':_0xb964('0x3')},'appdata':{'type':Sequelize[_0xb964('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb964('0x5')}}; \ No newline at end of file +var _0x2ed6=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x2ed6,0x128));var _0x62ed=function(_0x22d20d,_0x18217f){_0x22d20d=_0x22d20d-0x0;var _0x4a353a=_0x2ed6[_0x22d20d];return _0x4a353a;};'use strict';var Sequelize=require('sequelize');module[_0x62ed('0x0')]={'priority':{'type':Sequelize[_0x62ed('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x62ed('0x2')],'allowNull':![],'defaultValue':_0x62ed('0x3')},'appdata':{'type':Sequelize[_0x62ed('0x4')]()},'description':{'type':Sequelize[_0x62ed('0x2')]},'interval':{'type':Sequelize[_0x62ed('0x2')],'defaultValue':_0x62ed('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index b2b5fba..d48a810 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 _0xfd53=['order','sort','pick','filter','merge','where','type','key','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','update','then','destroy','end','name','OpenchannelApplication','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x4562bb,_0x5a8f8d){var _0x110188=function(_0x48aa24){while(--_0x48aa24){_0x4562bb['push'](_0x4562bb['shift']());}};_0x110188(++_0x5a8f8d);}(_0xfd53,0x123));var _0x3fd5=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xfd53[_0x1fc122];return _0xa2cb13;};'use strict';var pdf=require(_0x3fd5('0x0'));var emlformat=require(_0x3fd5('0x1'));var rimraf=require(_0x3fd5('0x2'));var zipdir=require(_0x3fd5('0x3'));var jsonpatch=require(_0x3fd5('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3fd5('0x5'));var Mustache=require('mustache');var util=require(_0x3fd5('0x6'));var path=require(_0x3fd5('0x7'));var sox=require(_0x3fd5('0x8'));var csv=require('to-csv');var ejs=require(_0x3fd5('0x9'));var fs=require('fs');var _=require(_0x3fd5('0xa'));var squel=require(_0x3fd5('0xb'));var crypto=require(_0x3fd5('0xc'));var jsforce=require(_0x3fd5('0xd'));var deskjs=require(_0x3fd5('0xe'));var toCsv=require(_0x3fd5('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x3fd5('0x10'));var qs=require(_0x3fd5('0x11'));var logger=require(_0x3fd5('0x12'))(_0x3fd5('0x13'));var utils=require(_0x3fd5('0x14'));var config=require(_0x3fd5('0x15'));var db=require(_0x3fd5('0x16'))['db'];function respondWithStatusCode(_0x471c83,_0x5dd358){_0x5dd358=_0x5dd358||0xcc;return function(_0x5a930d){if(_0x5a930d){return _0x471c83[_0x3fd5('0x17')](_0x5dd358);}return _0x471c83[_0x3fd5('0x18')](_0x5dd358)['end']();};}function respondWithResult(_0x2ae66d,_0x532027){_0x532027=_0x532027||0xc8;return function(_0x298a13){if(_0x298a13){return _0x2ae66d[_0x3fd5('0x18')](_0x532027)[_0x3fd5('0x19')](_0x298a13);}};}function respondWithFilteredResult(_0x69ba1b,_0x57cd8d){return function(_0x47a4e8){if(_0x47a4e8){var _0x311bfa=_0x47a4e8[_0x3fd5('0x1a')],_0x2a941a=_0x57cd8d[_0x3fd5('0x1b')],_0x396877=_0x57cd8d[_0x3fd5('0x1b')]+_0x57cd8d['limit'],_0x52fc60;if(_0x396877>=_0x311bfa){_0x396877=_0x311bfa;_0x52fc60=0xc8;}else{_0x52fc60=0xce;}_0x69ba1b[_0x3fd5('0x18')](_0x52fc60);return _0x69ba1b[_0x3fd5('0x1c')]('Content-Range',_0x2a941a+'-'+_0x396877+'/'+_0x311bfa)[_0x3fd5('0x19')](_0x47a4e8);}return null;};}function patchUpdates(_0x2450d1){return function(_0x5ce9d7){try{jsonpatch[_0x3fd5('0x1d')](_0x5ce9d7,_0x2450d1,!![]);}catch(_0xd6b4f5){return BPromise[_0x3fd5('0x1e')](_0xd6b4f5);}return _0x5ce9d7['save']();};}function saveUpdates(_0x49a148,_0x3b5662){return function(_0x4ff350){if(_0x4ff350){return _0x4ff350[_0x3fd5('0x1f')](_0x49a148)[_0x3fd5('0x20')](function(_0x33ac32){return _0x33ac32;});}return null;};}function removeEntity(_0x25589e,_0x48593c){return function(_0x1c3e46){if(_0x1c3e46){return _0x1c3e46[_0x3fd5('0x21')]()['then'](function(){_0x25589e['status'](0xcc)[_0x3fd5('0x22')]();});}};}function handleEntityNotFound(_0x545db2,_0x164080){return function(_0x420ae3){if(!_0x420ae3){_0x545db2[_0x3fd5('0x17')](0x194);}return _0x420ae3;};}function handleError(_0x2fcf32,_0x1fc18a){_0x1fc18a=_0x1fc18a||0x1f4;return function(_0x36fd33){logger['error'](_0x36fd33['stack']);if(_0x36fd33[_0x3fd5('0x23')]){delete _0x36fd33[_0x3fd5('0x23')];}_0x2fcf32[_0x3fd5('0x18')](_0x1fc18a)['send'](_0x36fd33);};}exports['index']=function(_0x2d2f0e,_0x172ee0){var _0x5e9505={},_0x4ffb01={},_0x3df627={'count':0x0,'rows':[]};var _0x4daafa=db[_0x3fd5('0x24')][_0x3fd5('0x25')];_0x4ffb01[_0x3fd5('0x26')]=_['keys'](_0x4daafa);_0x4ffb01[_0x3fd5('0x27')]=_[_0x3fd5('0x28')](_0x2d2f0e[_0x3fd5('0x27')]);_0x4ffb01[_0x3fd5('0x29')]=_[_0x3fd5('0x2a')](_0x4ffb01[_0x3fd5('0x26')],_0x4ffb01['query']);_0x5e9505[_0x3fd5('0x2b')]=_[_0x3fd5('0x2a')](_0x4ffb01['model'],qs['fields'](_0x2d2f0e[_0x3fd5('0x27')][_0x3fd5('0x2c')]));_0x5e9505[_0x3fd5('0x2b')]=_0x5e9505[_0x3fd5('0x2b')][_0x3fd5('0x2d')]?_0x5e9505[_0x3fd5('0x2b')]:_0x4ffb01['model'];if(!_0x2d2f0e[_0x3fd5('0x27')][_0x3fd5('0x2e')](_0x3fd5('0x2f'))){_0x5e9505[_0x3fd5('0x30')]=qs[_0x3fd5('0x30')](_0x2d2f0e[_0x3fd5('0x27')][_0x3fd5('0x30')]);_0x5e9505['offset']=qs['offset'](_0x2d2f0e[_0x3fd5('0x27')][_0x3fd5('0x1b')]);}_0x5e9505[_0x3fd5('0x31')]=qs[_0x3fd5('0x32')](_0x2d2f0e[_0x3fd5('0x27')][_0x3fd5('0x32')]);_0x5e9505['where']=qs[_0x3fd5('0x29')](_[_0x3fd5('0x33')](_0x2d2f0e[_0x3fd5('0x27')],_0x4ffb01['filters']));if(_0x2d2f0e[_0x3fd5('0x27')][_0x3fd5('0x34')]){_0x5e9505['where']=_[_0x3fd5('0x35')](_0x5e9505[_0x3fd5('0x36')],{'$or':_['map'](_0x4daafa,function(_0x44e53a){if(_0x44e53a[_0x3fd5('0x37')][_0x3fd5('0x38')]!==_0x3fd5('0x39')){var _0x193553={};_0x193553[_0x44e53a['field']]={'$like':'%'+_0x2d2f0e[_0x3fd5('0x27')][_0x3fd5('0x34')]+'%'};return _0x193553;}})});}_0x5e9505=_[_0x3fd5('0x35')]({},_0x5e9505,_0x2d2f0e['options']);var _0x680c48={'where':_0x5e9505[_0x3fd5('0x36')]};return db[_0x3fd5('0x24')][_0x3fd5('0x1a')](_0x680c48)[_0x3fd5('0x20')](function(_0x27dd5c){_0x3df627[_0x3fd5('0x1a')]=_0x27dd5c;if(_0x2d2f0e[_0x3fd5('0x27')]['includeAll']){_0x5e9505[_0x3fd5('0x3a')]=[{'all':!![]}];}return db[_0x3fd5('0x24')][_0x3fd5('0x3b')](_0x5e9505);})[_0x3fd5('0x20')](function(_0x543c59){_0x3df627['rows']=_0x543c59;return _0x3df627;})[_0x3fd5('0x20')](respondWithFilteredResult(_0x172ee0,_0x5e9505))[_0x3fd5('0x3c')](handleError(_0x172ee0,null));};exports[_0x3fd5('0x3d')]=function(_0x193888,_0x1c6a95){var _0x48e962={'raw':!![],'where':{'id':_0x193888[_0x3fd5('0x3e')]['id']}},_0x20d4b7={};_0x20d4b7['model']=_[_0x3fd5('0x28')](db[_0x3fd5('0x24')][_0x3fd5('0x25')]);_0x20d4b7['query']=_[_0x3fd5('0x28')](_0x193888[_0x3fd5('0x27')]);_0x20d4b7['filters']=_[_0x3fd5('0x2a')](_0x20d4b7[_0x3fd5('0x26')],_0x20d4b7['query']);_0x48e962[_0x3fd5('0x2b')]=_['intersection'](_0x20d4b7[_0x3fd5('0x26')],qs[_0x3fd5('0x2c')](_0x193888['query'][_0x3fd5('0x2c')]));_0x48e962[_0x3fd5('0x2b')]=_0x48e962[_0x3fd5('0x2b')][_0x3fd5('0x2d')]?_0x48e962['attributes']:_0x20d4b7[_0x3fd5('0x26')];if(_0x193888[_0x3fd5('0x27')][_0x3fd5('0x3f')]){_0x48e962[_0x3fd5('0x3a')]=[{'all':!![]}];}_0x48e962=_['merge']({},_0x48e962,_0x193888[_0x3fd5('0x40')]);return db['OpenchannelApplication'][_0x3fd5('0x41')](_0x48e962)['then'](handleEntityNotFound(_0x1c6a95,null))[_0x3fd5('0x20')](respondWithResult(_0x1c6a95,null))[_0x3fd5('0x3c')](handleError(_0x1c6a95,null));};exports['create']=function(_0x19df42,_0x3f5b21){return db[_0x3fd5('0x24')][_0x3fd5('0x42')](_0x19df42[_0x3fd5('0x43')],{})[_0x3fd5('0x20')](respondWithResult(_0x3f5b21,0xc9))['catch'](handleError(_0x3f5b21,null));};exports[_0x3fd5('0x1f')]=function(_0x4580ae,_0x2752e2){if(_0x4580ae[_0x3fd5('0x43')]['id']){delete _0x4580ae[_0x3fd5('0x43')]['id'];}return db[_0x3fd5('0x24')][_0x3fd5('0x41')]({'where':{'id':_0x4580ae[_0x3fd5('0x3e')]['id']}})[_0x3fd5('0x20')](handleEntityNotFound(_0x2752e2,null))[_0x3fd5('0x20')](saveUpdates(_0x4580ae[_0x3fd5('0x43')],null))[_0x3fd5('0x20')](respondWithResult(_0x2752e2,null))[_0x3fd5('0x3c')](handleError(_0x2752e2,null));};exports['destroy']=function(_0x337277,_0x183849){return db[_0x3fd5('0x24')][_0x3fd5('0x41')]({'where':{'id':_0x337277['params']['id']}})['then'](handleEntityNotFound(_0x183849,null))[_0x3fd5('0x20')](removeEntity(_0x183849,null))[_0x3fd5('0x3c')](handleError(_0x183849,null));}; \ No newline at end of file +var _0xeace=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','name','index','OpenchannelApplication','rawAttributes','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','rows','show','keys','catch','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','lodash','squel'];(function(_0x13cbfb,_0x5b397d){var _0x2b4439=function(_0x707df2){while(--_0x707df2){_0x13cbfb['push'](_0x13cbfb['shift']());}};_0x2b4439(++_0x5b397d);}(_0xeace,0x7d));var _0xeeac=function(_0x306c29,_0x67f04){_0x306c29=_0x306c29-0x0;var _0x2c74a7=_0xeace[_0x306c29];return _0x2c74a7;};'use strict';var pdf=require(_0xeeac('0x0'));var emlformat=require(_0xeeac('0x1'));var rimraf=require(_0xeeac('0x2'));var zipdir=require(_0xeeac('0x3'));var jsonpatch=require(_0xeeac('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeeac('0x5'));var Mustache=require('mustache');var util=require(_0xeeac('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xeeac('0x7'));var ejs=require(_0xeeac('0x8'));var fs=require('fs');var _=require(_0xeeac('0x9'));var squel=require(_0xeeac('0xa'));var crypto=require(_0xeeac('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xeeac('0xc'));var toCsv=require(_0xeeac('0x7'));var querystring=require(_0xeeac('0xd'));var Papa=require(_0xeeac('0xe'));var authService=require(_0xeeac('0xf'));var hardwareService=require(_0xeeac('0x10'));var Redis=require('ioredis');var qs=require(_0xeeac('0x11'));var logger=require(_0xeeac('0x12'))(_0xeeac('0x13'));var utils=require(_0xeeac('0x14'));var config=require(_0xeeac('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48c84f,_0x216e2d){_0x216e2d=_0x216e2d||0xcc;return function(_0x10deb3){if(_0x10deb3){return _0x48c84f['sendStatus'](_0x216e2d);}return _0x48c84f['status'](_0x216e2d)[_0xeeac('0x16')]();};}function respondWithResult(_0x23ac0b,_0x172b3c){_0x172b3c=_0x172b3c||0xc8;return function(_0x2fbd65){if(_0x2fbd65){return _0x23ac0b[_0xeeac('0x17')](_0x172b3c)[_0xeeac('0x18')](_0x2fbd65);}};}function respondWithFilteredResult(_0x951290,_0x27a40f){return function(_0x5a2a02){if(_0x5a2a02){var _0x44cc7b=_0x5a2a02[_0xeeac('0x19')],_0x98667c=_0x27a40f[_0xeeac('0x1a')],_0x5ec4e1=_0x27a40f[_0xeeac('0x1a')]+_0x27a40f[_0xeeac('0x1b')],_0x417134;if(_0x5ec4e1>=_0x44cc7b){_0x5ec4e1=_0x44cc7b;_0x417134=0xc8;}else{_0x417134=0xce;}_0x951290[_0xeeac('0x17')](_0x417134);return _0x951290[_0xeeac('0x1c')](_0xeeac('0x1d'),_0x98667c+'-'+_0x5ec4e1+'/'+_0x44cc7b)[_0xeeac('0x18')](_0x5a2a02);}return null;};}function patchUpdates(_0x3fb0f4){return function(_0x50bb4e){try{jsonpatch[_0xeeac('0x1e')](_0x50bb4e,_0x3fb0f4,!![]);}catch(_0x12bf6e){return BPromise[_0xeeac('0x1f')](_0x12bf6e);}return _0x50bb4e[_0xeeac('0x20')]();};}function saveUpdates(_0x168c83,_0x53ffe3){return function(_0xcfacb7){if(_0xcfacb7){return _0xcfacb7[_0xeeac('0x21')](_0x168c83)[_0xeeac('0x22')](function(_0x5b4642){return _0x5b4642;});}return null;};}function removeEntity(_0x5ea18c,_0x1958b4){return function(_0x12486f){if(_0x12486f){return _0x12486f['destroy']()['then'](function(){_0x5ea18c[_0xeeac('0x17')](0xcc)[_0xeeac('0x16')]();});}};}function handleEntityNotFound(_0x2659dc,_0x1487c4){return function(_0x1222a){if(!_0x1222a){_0x2659dc[_0xeeac('0x23')](0x194);}return _0x1222a;};}function handleError(_0x5ab8b7,_0x375b12){_0x375b12=_0x375b12||0x1f4;return function(_0x150f4d){logger['error'](_0x150f4d['stack']);if(_0x150f4d[_0xeeac('0x24')]){delete _0x150f4d[_0xeeac('0x24')];}_0x5ab8b7[_0xeeac('0x17')](_0x375b12)['send'](_0x150f4d);};}exports[_0xeeac('0x25')]=function(_0x14d975,_0x26459f){var _0x33b4f2={},_0x9c736b={},_0x180792={'count':0x0,'rows':[]};var _0x3e7c25=db[_0xeeac('0x26')][_0xeeac('0x27')];_0x9c736b[_0xeeac('0x28')]=_['keys'](_0x3e7c25);_0x9c736b[_0xeeac('0x29')]=_['keys'](_0x14d975[_0xeeac('0x29')]);_0x9c736b['filters']=_['intersection'](_0x9c736b[_0xeeac('0x28')],_0x9c736b[_0xeeac('0x29')]);_0x33b4f2[_0xeeac('0x2a')]=_[_0xeeac('0x2b')](_0x9c736b[_0xeeac('0x28')],qs[_0xeeac('0x2c')](_0x14d975['query']['fields']));_0x33b4f2[_0xeeac('0x2a')]=_0x33b4f2[_0xeeac('0x2a')][_0xeeac('0x2d')]?_0x33b4f2[_0xeeac('0x2a')]:_0x9c736b[_0xeeac('0x28')];if(!_0x14d975[_0xeeac('0x29')][_0xeeac('0x2e')]('nolimit')){_0x33b4f2[_0xeeac('0x1b')]=qs[_0xeeac('0x1b')](_0x14d975['query'][_0xeeac('0x1b')]);_0x33b4f2['offset']=qs['offset'](_0x14d975[_0xeeac('0x29')][_0xeeac('0x1a')]);}_0x33b4f2[_0xeeac('0x2f')]=qs['sort'](_0x14d975[_0xeeac('0x29')][_0xeeac('0x30')]);_0x33b4f2[_0xeeac('0x31')]=qs[_0xeeac('0x32')](_['pick'](_0x14d975['query'],_0x9c736b[_0xeeac('0x32')]));if(_0x14d975['query'][_0xeeac('0x33')]){_0x33b4f2[_0xeeac('0x31')]=_[_0xeeac('0x34')](_0x33b4f2['where'],{'$or':_[_0xeeac('0x35')](_0x3e7c25,function(_0x473337){if(_0x473337[_0xeeac('0x36')][_0xeeac('0x37')]!==_0xeeac('0x38')){var _0x116639={};_0x116639[_0x473337['field']]={'$like':'%'+_0x14d975['query'][_0xeeac('0x33')]+'%'};return _0x116639;}})});}_0x33b4f2=_[_0xeeac('0x34')]({},_0x33b4f2,_0x14d975[_0xeeac('0x39')]);var _0x4cf2c7={'where':_0x33b4f2[_0xeeac('0x31')]};return db[_0xeeac('0x26')][_0xeeac('0x19')](_0x4cf2c7)[_0xeeac('0x22')](function(_0x210016){_0x180792[_0xeeac('0x19')]=_0x210016;if(_0x14d975[_0xeeac('0x29')][_0xeeac('0x3a')]){_0x33b4f2[_0xeeac('0x3b')]=[{'all':!![]}];}return db[_0xeeac('0x26')]['findAll'](_0x33b4f2);})['then'](function(_0x3a3af4){_0x180792[_0xeeac('0x3c')]=_0x3a3af4;return _0x180792;})[_0xeeac('0x22')](respondWithFilteredResult(_0x26459f,_0x33b4f2))['catch'](handleError(_0x26459f,null));};exports[_0xeeac('0x3d')]=function(_0x3604fa,_0x4b32ad){var _0x3dcc67={'raw':!![],'where':{'id':_0x3604fa['params']['id']}},_0x4bc388={};_0x4bc388[_0xeeac('0x28')]=_[_0xeeac('0x3e')](db[_0xeeac('0x26')][_0xeeac('0x27')]);_0x4bc388[_0xeeac('0x29')]=_[_0xeeac('0x3e')](_0x3604fa[_0xeeac('0x29')]);_0x4bc388[_0xeeac('0x32')]=_[_0xeeac('0x2b')](_0x4bc388[_0xeeac('0x28')],_0x4bc388['query']);_0x3dcc67[_0xeeac('0x2a')]=_[_0xeeac('0x2b')](_0x4bc388[_0xeeac('0x28')],qs[_0xeeac('0x2c')](_0x3604fa['query'][_0xeeac('0x2c')]));_0x3dcc67['attributes']=_0x3dcc67[_0xeeac('0x2a')][_0xeeac('0x2d')]?_0x3dcc67[_0xeeac('0x2a')]:_0x4bc388['model'];if(_0x3604fa[_0xeeac('0x29')][_0xeeac('0x3a')]){_0x3dcc67[_0xeeac('0x3b')]=[{'all':!![]}];}_0x3dcc67=_['merge']({},_0x3dcc67,_0x3604fa[_0xeeac('0x39')]);return db['OpenchannelApplication']['find'](_0x3dcc67)['then'](handleEntityNotFound(_0x4b32ad,null))[_0xeeac('0x22')](respondWithResult(_0x4b32ad,null))[_0xeeac('0x3f')](handleError(_0x4b32ad,null));};exports['create']=function(_0x2681f4,_0x44bca4){return db[_0xeeac('0x26')][_0xeeac('0x40')](_0x2681f4[_0xeeac('0x41')],{})[_0xeeac('0x22')](respondWithResult(_0x44bca4,0xc9))[_0xeeac('0x3f')](handleError(_0x44bca4,null));};exports[_0xeeac('0x21')]=function(_0x2d072b,_0x2a01bf){if(_0x2d072b[_0xeeac('0x41')]['id']){delete _0x2d072b[_0xeeac('0x41')]['id'];}return db[_0xeeac('0x26')][_0xeeac('0x42')]({'where':{'id':_0x2d072b[_0xeeac('0x43')]['id']}})[_0xeeac('0x22')](handleEntityNotFound(_0x2a01bf,null))[_0xeeac('0x22')](saveUpdates(_0x2d072b[_0xeeac('0x41')],null))[_0xeeac('0x22')](respondWithResult(_0x2a01bf,null))[_0xeeac('0x3f')](handleError(_0x2a01bf,null));};exports['destroy']=function(_0x40171c,_0x1106f5){return db['OpenchannelApplication'][_0xeeac('0x42')]({'where':{'id':_0x40171c[_0xeeac('0x43')]['id']}})[_0xeeac('0x22')](handleEntityNotFound(_0x1106f5,null))[_0xeeac('0x22')](removeEntity(_0x1106f5,null))[_0xeeac('0x3f')](handleError(_0x1106f5,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 49a689d..f5fca48 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 _0xace1=['api','moment','bluebird','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','lodash','../../config/logger'];(function(_0xc8ace0,_0x46df0f){var _0x548e76=function(_0x578c76){while(--_0x578c76){_0xc8ace0['push'](_0xc8ace0['shift']());}};_0x548e76(++_0x46df0f);}(_0xace1,0x1db));var _0x1ace=function(_0x3a8c46,_0x5646a2){_0x3a8c46=_0x3a8c46-0x0;var _0x5551f5=_0xace1[_0x3a8c46];return _0x5551f5;};'use strict';var _=require(_0x1ace('0x0'));var util=require('util');var logger=require(_0x1ace('0x1'))(_0x1ace('0x2'));var moment=require(_0x1ace('0x3'));var BPromise=require(_0x1ace('0x4'));var rp=require('request-promise');var attributes=require(_0x1ace('0x5'));module['exports']=function(_0xbfb261,_0x2de3c5){return _0xbfb261[_0x1ace('0x6')](_0x1ace('0x7'),attributes,{'tableName':_0x1ace('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30ef=['api','moment','bluebird','request-promise','./openchannelApplication.attributes','exports','define','openchannel_applications','lodash','util','../../config/logger'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x30ef,0x13c));var _0xf30e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf30e('0x0'));var util=require(_0xf30e('0x1'));var logger=require(_0xf30e('0x2'))(_0xf30e('0x3'));var moment=require(_0xf30e('0x4'));var BPromise=require(_0xf30e('0x5'));var rp=require(_0xf30e('0x6'));var attributes=require(_0xf30e('0x7'));module[_0xf30e('0x8')]=function(_0x19e76b,_0x42a528){return _0x19e76b[_0xf30e('0x9')]('OpenchannelApplication',attributes,{'tableName':_0xf30e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index a606d61..26cdc8c 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 _0x0095=['result','catch','UpdateOpenchannelApplication','update','body','options','attributes','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x264bdb,_0x39415a){var _0x42098e=function(_0x122906){while(--_0x122906){_0x264bdb['push'](_0x264bdb['shift']());}};_0x42098e(++_0x39415a);}(_0x0095,0xaa));var _0x5009=function(_0x2bf67e,_0x16d378){_0x2bf67e=_0x2bf67e-0x0;var _0x5138d5=_0x0095[_0x2bf67e];return _0x5138d5;};'use strict';var _=require('lodash');var util=require(_0x5009('0x0'));var moment=require(_0x5009('0x1'));var BPromise=require(_0x5009('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5009('0x3'));var db=require(_0x5009('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5009('0x5'))('rpc');var config=require(_0x5009('0x6'));var jayson=require(_0x5009('0x7'));var client=jayson[_0x5009('0x8')][_0x5009('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38e96b,_0x2bc1bf,_0x203627){return new BPromise(function(_0xef3b3c,_0x1bef9e){return client['request'](_0x38e96b,_0x203627)[_0x5009('0xa')](function(_0x2f916f){logger[_0x5009('0xb')](_0x5009('0xc'),_0x2bc1bf,'request\x20sent');logger['debug'](_0x5009('0xd'),_0x2bc1bf,_0x5009('0xe'),JSON[_0x5009('0xf')](_0x2f916f));if(_0x2f916f[_0x5009('0x10')]){if(_0x2f916f['error'][_0x5009('0x11')]===0x1f4){logger[_0x5009('0x10')](_0x5009('0xc'),_0x2bc1bf,_0x2f916f[_0x5009('0x10')][_0x5009('0x12')]);return _0x1bef9e(_0x2f916f[_0x5009('0x10')][_0x5009('0x12')]);}logger['error'](_0x5009('0xc'),_0x2bc1bf,_0x2f916f[_0x5009('0x10')][_0x5009('0x12')]);return _0xef3b3c(_0x2f916f[_0x5009('0x10')][_0x5009('0x12')]);}else{logger[_0x5009('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x2bc1bf,_0x5009('0xe'));_0xef3b3c(_0x2f916f[_0x5009('0x13')]['message']);}})[_0x5009('0x14')](function(_0x2a4729){logger['error'](_0x5009('0xc'),_0x2bc1bf,_0x2a4729);_0x1bef9e(_0x2a4729);});});}exports[_0x5009('0x15')]=function(_0x1c2db6){var _0x2fe2a1=this;return new Promise(function(_0x58fbf3,_0x2d8858){return db['OpenchannelApplication'][_0x5009('0x16')](_0x1c2db6[_0x5009('0x17')],{'raw':_0x1c2db6['options']?_0x1c2db6[_0x5009('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c2db6[_0x5009('0x18')]?_0x1c2db6[_0x5009('0x18')]['where']||null:null,'attributes':_0x1c2db6[_0x5009('0x18')]?_0x1c2db6['options'][_0x5009('0x19')]||null:null,'limit':_0x1c2db6['options']?_0x1c2db6[_0x5009('0x18')]['limit']||null:null})[_0x5009('0xa')](function(_0x2283fb){logger[_0x5009('0xb')](_0x5009('0x15'),_0x1c2db6);logger[_0x5009('0x1a')](_0x5009('0x15'),_0x1c2db6,JSON[_0x5009('0xf')](_0x2283fb));_0x58fbf3(_0x2283fb);})['catch'](function(_0x2c275d){logger[_0x5009('0x10')](_0x5009('0x15'),_0x2c275d[_0x5009('0x12')],_0x1c2db6);_0x2d8858(_0x2fe2a1[_0x5009('0x10')](0x1f4,_0x2c275d['message']));});});}; \ No newline at end of file +var _0xd8d3=['update','body','options','raw','where','attributes','limit','then','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x47e8e7,_0x6a0c2c){var _0x3ef18a=function(_0x35ea83){while(--_0x35ea83){_0x47e8e7['push'](_0x47e8e7['shift']());}};_0x3ef18a(++_0x6a0c2c);}(_0xd8d3,0xa8));var _0x3d8d=function(_0x3a6a47,_0x3b903e){_0x3a6a47=_0x3a6a47-0x0;var _0xc8107=_0xd8d3[_0x3a6a47];return _0xc8107;};'use strict';var _=require(_0x3d8d('0x0'));var util=require('util');var moment=require(_0x3d8d('0x1'));var BPromise=require(_0x3d8d('0x2'));var rs=require(_0x3d8d('0x3'));var fs=require('fs');var Redis=require(_0x3d8d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3d8d('0x5'))(_0x3d8d('0x6'));var config=require(_0x3d8d('0x7'));var jayson=require(_0x3d8d('0x8'));var client=jayson[_0x3d8d('0x9')][_0x3d8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10c13f,_0x2f440f,_0x299d5f){return new BPromise(function(_0x7bb46a,_0x4423b9){return client[_0x3d8d('0xb')](_0x10c13f,_0x299d5f)['then'](function(_0x5a945b){logger[_0x3d8d('0xc')](_0x3d8d('0xd'),_0x2f440f,_0x3d8d('0xe'));logger[_0x3d8d('0xf')](_0x3d8d('0x10'),_0x2f440f,_0x3d8d('0xe'),JSON[_0x3d8d('0x11')](_0x5a945b));if(_0x5a945b['error']){if(_0x5a945b[_0x3d8d('0x12')][_0x3d8d('0x13')]===0x1f4){logger['error'](_0x3d8d('0xd'),_0x2f440f,_0x5a945b[_0x3d8d('0x12')]['message']);return _0x4423b9(_0x5a945b['error'][_0x3d8d('0x14')]);}logger['error'](_0x3d8d('0xd'),_0x2f440f,_0x5a945b[_0x3d8d('0x12')][_0x3d8d('0x14')]);return _0x7bb46a(_0x5a945b['error'][_0x3d8d('0x14')]);}else{logger[_0x3d8d('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x2f440f,_0x3d8d('0xe'));_0x7bb46a(_0x5a945b[_0x3d8d('0x15')][_0x3d8d('0x14')]);}})[_0x3d8d('0x16')](function(_0x1b3ee8){logger[_0x3d8d('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x2f440f,_0x1b3ee8);_0x4423b9(_0x1b3ee8);});});}exports[_0x3d8d('0x17')]=function(_0x10ca43){var _0x5f4ae1=this;return new Promise(function(_0x3318e0,_0x4be6dd){return db['OpenchannelApplication'][_0x3d8d('0x18')](_0x10ca43[_0x3d8d('0x19')],{'raw':_0x10ca43[_0x3d8d('0x1a')]?_0x10ca43['options'][_0x3d8d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10ca43[_0x3d8d('0x1a')]?_0x10ca43[_0x3d8d('0x1a')][_0x3d8d('0x1c')]||null:null,'attributes':_0x10ca43[_0x3d8d('0x1a')]?_0x10ca43[_0x3d8d('0x1a')][_0x3d8d('0x1d')]||null:null,'limit':_0x10ca43['options']?_0x10ca43[_0x3d8d('0x1a')][_0x3d8d('0x1e')]||null:null})[_0x3d8d('0x1f')](function(_0x58781b){logger['info']('UpdateOpenchannelApplication',_0x10ca43);logger['debug'](_0x3d8d('0x17'),_0x10ca43,JSON[_0x3d8d('0x11')](_0x58781b));_0x3318e0(_0x58781b);})[_0x3d8d('0x16')](function(_0x11ead4){logger[_0x3d8d('0x12')](_0x3d8d('0x17'),_0x11ead4['message'],_0x10ca43);_0x4be6dd(_0x5f4ae1[_0x3d8d('0x12')](0x1f4,_0x11ead4[_0x3d8d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 0252d9a..99f0806 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 _0x82e1=['post','create','addMessage','openchannelinteraction:addtags','put','openchannel','openchannelinteraction:update','update','delete','/:id','tracked','openchannelinteraction:destroy','/:id/tags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id/messages','getMessages','/:id/download'];(function(_0xaea88e,_0x260759){var _0x2f00e6=function(_0x573962){while(--_0x573962){_0xaea88e['push'](_0xaea88e['shift']());}};_0x2f00e6(++_0x260759);}(_0x82e1,0xc2));var _0x182e=function(_0x480fc2,_0x482fba){_0x480fc2=_0x480fc2-0x0;var _0x540a95=_0x82e1[_0x480fc2];return _0x540a95;};'use strict';var multer=require(_0x182e('0x0'));var util=require('util');var path=require(_0x182e('0x1'));var timeout=require(_0x182e('0x2'));var express=require(_0x182e('0x3'));var router=express[_0x182e('0x4')]();var auth=require(_0x182e('0x5'));var interaction=require(_0x182e('0x6'));var config=require(_0x182e('0x7'));var controller=require(_0x182e('0x8'));router[_0x182e('0x9')]('/',auth[_0x182e('0xa')](),controller['index']);router[_0x182e('0x9')](_0x182e('0xb'),auth[_0x182e('0xa')](),controller[_0x182e('0xc')]);router[_0x182e('0x9')]('/:id',auth[_0x182e('0xa')](),controller['show']);router[_0x182e('0x9')](_0x182e('0xd'),auth[_0x182e('0xa')](),controller[_0x182e('0xe')]);router['get'](_0x182e('0xf'),auth[_0x182e('0xa')](),controller['download']);router[_0x182e('0x10')]('/',auth[_0x182e('0xa')](),controller[_0x182e('0x11')]);router[_0x182e('0x10')]('/:id/messages',auth[_0x182e('0xa')](),controller[_0x182e('0x12')]);router['post']('/:id/tags',auth[_0x182e('0xa')](),interaction['tracked']('openchannel',_0x182e('0x13')),controller['addTags']);router[_0x182e('0x14')]('/:id',auth[_0x182e('0xa')](),interaction['tracked'](_0x182e('0x15'),_0x182e('0x16')),controller[_0x182e('0x17')]);router[_0x182e('0x18')](_0x182e('0x19'),auth['isAuthenticated'](),interaction[_0x182e('0x1a')]('openchannel',_0x182e('0x1b')),controller['destroy']);router[_0x182e('0x18')](_0x182e('0x1c'),auth[_0x182e('0xa')](),controller['removeTags']);module[_0x182e('0x1d')]=router; \ No newline at end of file +var _0xccfd=['/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','/:id','update','delete','tracked','openchannelinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show'];(function(_0x57627a,_0x5735e7){var _0x464632=function(_0x270a19){while(--_0x270a19){_0x57627a['push'](_0x57627a['shift']());}};_0x464632(++_0x5735e7);}(_0xccfd,0x72));var _0xdccf=function(_0x32dc05,_0x2ac60c){_0x32dc05=_0x32dc05-0x0;var _0x124ce2=_0xccfd[_0x32dc05];return _0x124ce2;};'use strict';var multer=require(_0xdccf('0x0'));var util=require(_0xdccf('0x1'));var path=require(_0xdccf('0x2'));var timeout=require(_0xdccf('0x3'));var express=require(_0xdccf('0x4'));var router=express[_0xdccf('0x5')]();var auth=require(_0xdccf('0x6'));var interaction=require(_0xdccf('0x7'));var config=require(_0xdccf('0x8'));var controller=require('./openchannelInteraction.controller');router[_0xdccf('0x9')]('/',auth[_0xdccf('0xa')](),controller[_0xdccf('0xb')]);router[_0xdccf('0x9')](_0xdccf('0xc'),auth[_0xdccf('0xa')](),controller['describe']);router[_0xdccf('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdccf('0xd')]);router[_0xdccf('0x9')](_0xdccf('0xe'),auth[_0xdccf('0xa')](),controller['getMessages']);router[_0xdccf('0x9')](_0xdccf('0xf'),auth[_0xdccf('0xa')](),controller[_0xdccf('0x10')]);router[_0xdccf('0x11')]('/',auth[_0xdccf('0xa')](),controller[_0xdccf('0x12')]);router['post'](_0xdccf('0xe'),auth[_0xdccf('0xa')](),controller[_0xdccf('0x13')]);router[_0xdccf('0x11')](_0xdccf('0x14'),auth[_0xdccf('0xa')](),interaction['tracked'](_0xdccf('0x15'),_0xdccf('0x16')),controller[_0xdccf('0x17')]);router[_0xdccf('0x18')](_0xdccf('0x19'),auth[_0xdccf('0xa')](),interaction['tracked'](_0xdccf('0x15'),'openchannelinteraction:update'),controller[_0xdccf('0x1a')]);router[_0xdccf('0x1b')](_0xdccf('0x19'),auth[_0xdccf('0xa')](),interaction[_0xdccf('0x1c')]('openchannel',_0xdccf('0x1d')),controller[_0xdccf('0x1e')]);router[_0xdccf('0x1b')](_0xdccf('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0xdccf('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 822c612..585ca07 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 _0xf50b=['ENUM','out','sequelize','exports','DATE','STRING'];(function(_0x5d5a77,_0x494dfd){var _0x342bba=function(_0x202128){while(--_0x202128){_0x5d5a77['push'](_0x5d5a77['shift']());}};_0x342bba(++_0x494dfd);}(_0xf50b,0xc8));var _0xbf50=function(_0x234dd5,_0x59ffda){_0x234dd5=_0x234dd5-0x0;var _0x4d84b3=_0xf50b[_0x234dd5];return _0x4d84b3;};'use strict';var Sequelize=require(_0xbf50('0x0'));module[_0xbf50('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbf50('0x2')]},'disposition':{'type':Sequelize[_0xbf50('0x3')]},'note':{'type':Sequelize[_0xbf50('0x3')]},'read1stAt':{'type':Sequelize[_0xbf50('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xbf50('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xbf50('0x4')]('in',_0xbf50('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbf50('0x3')]}}; \ No newline at end of file +var _0x45ea=['BOOLEAN','DATE','STRING','ENUM','sequelize','exports'];(function(_0x3f0042,_0x28f8af){var _0x52554c=function(_0x197e76){while(--_0x197e76){_0x3f0042['push'](_0x3f0042['shift']());}};_0x52554c(++_0x28f8af);}(_0x45ea,0x1f0));var _0xa45e=function(_0x4e353,_0x180c6e){_0x4e353=_0x4e353-0x0;var _0x995ad0=_0x45ea[_0x4e353];return _0x995ad0;};'use strict';var Sequelize=require(_0xa45e('0x0'));module[_0xa45e('0x1')]={'closed':{'type':Sequelize[_0xa45e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa45e('0x3')]},'disposition':{'type':Sequelize[_0xa45e('0x4')]},'note':{'type':Sequelize[_0xa45e('0x4')]},'read1stAt':{'type':Sequelize[_0xa45e('0x3')]},'threadId':{'type':Sequelize[_0xa45e('0x4')]},'externalUrl':{'type':Sequelize[_0xa45e('0x4')]},'lastMsgAt':{'type':Sequelize[_0xa45e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xa45e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xa45e('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 6992be3..41b24bb 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 _0xcee8=['getMessages','order','pick','OpenchannelInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','emit','removeTags','download','unix','join','root','server','files','attachments','interaction-%s.zip','firstName','Attachment','Letter','1cm','mkdirSync','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','toString','
','','%s:\x20%s

','','basename','createReadStream','createWriteStream','toFile','interaction-','.pdf','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','api','../../config/environment','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','stack','name','send','index','OpenchannelInteraction','rawAttributes','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','sort','where','merge','map','type','key','filter','options','include','push','Tag','distinct','read','OpenchannelMessage','direction','createdAt','User','Users','fullname','CmContact','Contact','Owner','internal','OpenchannelAccount','Account','Messages','Tags','tag','ThroughTags','color','rows','catch','show','includeAll','find','create','body','params','describe','addMessage','ids','omit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcee8,0xb1));var _0x8cee=function(_0x264405,_0x518eff){_0x264405=_0x264405-0x0;var _0x2a432b=_0xcee8[_0x264405];return _0x2a432b;};'use strict';var pdf=require(_0x8cee('0x0'));var emlformat=require(_0x8cee('0x1'));var rimraf=require(_0x8cee('0x2'));var zipdir=require(_0x8cee('0x3'));var jsonpatch=require(_0x8cee('0x4'));var rp=require(_0x8cee('0x5'));var moment=require('moment');var BPromise=require(_0x8cee('0x6'));var Mustache=require(_0x8cee('0x7'));var util=require(_0x8cee('0x8'));var path=require(_0x8cee('0x9'));var sox=require('sox');var csv=require(_0x8cee('0xa'));var ejs=require(_0x8cee('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8cee('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8cee('0xd'));var toCsv=require(_0x8cee('0xa'));var querystring=require(_0x8cee('0xe'));var Papa=require(_0x8cee('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x8cee('0x10'));var Redis=require(_0x8cee('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x8cee('0x12'))(_0x8cee('0x13'));var utils=require('../../config/utils');var config=require(_0x8cee('0x14'));var db=require('../../mysqldb')['db'];config[_0x8cee('0x15')]=_[_0x8cee('0x16')](config[_0x8cee('0x15')],{'host':_0x8cee('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8cee('0x18'))[_0x8cee('0x19')](socket);function respondWithStatusCode(_0x10d74f,_0x227762){_0x227762=_0x227762||0xcc;return function(_0xedc808){if(_0xedc808){return _0x10d74f[_0x8cee('0x1a')](_0x227762);}return _0x10d74f[_0x8cee('0x1b')](_0x227762)[_0x8cee('0x1c')]();};}function respondWithResult(_0x237248,_0x487241){_0x487241=_0x487241||0xc8;return function(_0x33b07e){if(_0x33b07e){return _0x237248[_0x8cee('0x1b')](_0x487241)[_0x8cee('0x1d')](_0x33b07e);}};}function respondWithFilteredResult(_0xc4cc22,_0x4613fa){return function(_0x5f53e3){if(_0x5f53e3){var _0x3015bf=_0x5f53e3[_0x8cee('0x1e')],_0x581ce9=_0x4613fa[_0x8cee('0x1f')],_0x4a3556=_0x4613fa[_0x8cee('0x1f')]+_0x4613fa[_0x8cee('0x20')],_0x8e242b;if(_0x4a3556>=_0x3015bf){_0x4a3556=_0x3015bf;_0x8e242b=0xc8;}else{_0x8e242b=0xce;}_0xc4cc22['status'](_0x8e242b);return _0xc4cc22[_0x8cee('0x21')](_0x8cee('0x22'),_0x581ce9+'-'+_0x4a3556+'/'+_0x3015bf)[_0x8cee('0x1d')](_0x5f53e3);}return null;};}function patchUpdates(_0x5d1a1d){return function(_0x31dbd5){try{jsonpatch[_0x8cee('0x23')](_0x31dbd5,_0x5d1a1d,!![]);}catch(_0x52262a){return BPromise['reject'](_0x52262a);}return _0x31dbd5[_0x8cee('0x24')]();};}function saveUpdates(_0x47b3c0,_0x54539b){return function(_0x51a93f){if(_0x51a93f){return _0x51a93f['update'](_0x47b3c0)[_0x8cee('0x25')](function(_0x5109df){return _0x5109df;});}return null;};}function removeEntity(_0x117bc6,_0x5e231e){return function(_0x2ea47b){if(_0x2ea47b){return _0x2ea47b[_0x8cee('0x26')]()[_0x8cee('0x25')](function(){_0x117bc6[_0x8cee('0x1b')](0xcc)[_0x8cee('0x1c')]();});}};}function handleEntityNotFound(_0x51f79f,_0x89974f){return function(_0x415f47){if(!_0x415f47){_0x51f79f['sendStatus'](0x194);}return _0x415f47;};}function handleError(_0x307de3,_0xc2ad7f){_0xc2ad7f=_0xc2ad7f||0x1f4;return function(_0x5df746){logger['error'](_0x5df746[_0x8cee('0x27')]);if(_0x5df746[_0x8cee('0x28')]){delete _0x5df746[_0x8cee('0x28')];}_0x307de3[_0x8cee('0x1b')](_0xc2ad7f)[_0x8cee('0x29')](_0x5df746);};}exports[_0x8cee('0x2a')]=function(_0x51003d,_0x1572d5){var _0x4a7781={},_0x75f082={},_0x139867={'count':0x0,'rows':[]};var _0x16f571=db[_0x8cee('0x2b')][_0x8cee('0x2c')];_0x75f082['model']=_[_0x8cee('0x2d')](_0x16f571);_0x75f082['query']=_[_0x8cee('0x2d')](_0x51003d[_0x8cee('0x2e')]);_0x75f082[_0x8cee('0x2f')]=_[_0x8cee('0x30')](_0x75f082['model'],_0x75f082[_0x8cee('0x2e')]);_0x4a7781['attributes']=_[_0x8cee('0x30')](_0x75f082['model'],qs[_0x8cee('0x31')](_0x51003d['query']['fields']));_0x4a7781[_0x8cee('0x32')]=_0x4a7781[_0x8cee('0x32')][_0x8cee('0x33')]?_0x4a7781[_0x8cee('0x32')]:_0x75f082[_0x8cee('0x34')];if(!_0x51003d[_0x8cee('0x2e')][_0x8cee('0x35')](_0x8cee('0x36'))){_0x4a7781['limit']=qs['limit'](_0x51003d[_0x8cee('0x2e')][_0x8cee('0x20')]);_0x4a7781[_0x8cee('0x1f')]=qs[_0x8cee('0x1f')](_0x51003d[_0x8cee('0x2e')][_0x8cee('0x1f')]);}_0x4a7781['order']=qs[_0x8cee('0x37')](_0x51003d[_0x8cee('0x2e')][_0x8cee('0x37')]);_0x4a7781[_0x8cee('0x38')]=qs['filters'](_['pick'](_0x51003d['query'],_0x75f082['filters']));if(_0x51003d[_0x8cee('0x2e')]['filter']){_0x4a7781['where']=_[_0x8cee('0x39')](_0x4a7781[_0x8cee('0x38')],{'$or':_[_0x8cee('0x3a')](_0x16f571,function(_0x1c34b2){if(_0x1c34b2[_0x8cee('0x3b')][_0x8cee('0x3c')]!=='VIRTUAL'){var _0x4df3d4={};_0x4df3d4[_0x1c34b2['field']]={'$like':'%'+_0x51003d[_0x8cee('0x2e')][_0x8cee('0x3d')]+'%'};return _0x4df3d4;}})});}_0x4a7781=_[_0x8cee('0x39')]({},_0x4a7781,_0x51003d[_0x8cee('0x3e')]);var _0x50e460={'where':_0x4a7781[_0x8cee('0x38')]};_0x50e460[_0x8cee('0x3f')]=[];if(_0x51003d['query']['tag']){_0x50e460[_0x8cee('0x3f')][_0x8cee('0x40')]({'model':db[_0x8cee('0x41')],'as':'Tags','attributes':['id'],'where':{'id':_0x51003d[_0x8cee('0x2e')]['tag']},'required':!![]});_0x50e460[_0x8cee('0x42')]=!![];}if(_0x51003d[_0x8cee('0x2e')][_0x8cee('0x43')]){_0x50e460[_0x8cee('0x3f')][_0x8cee('0x40')]({'model':db[_0x8cee('0x44')],'as':'Messages','attributes':['id',_0x8cee('0x45'),_0x8cee('0x46'),_0x8cee('0x43')],'where':{'direction':'in','read':_0x51003d[_0x8cee('0x2e')]['read']||![]},'required':!![]});_0x50e460[_0x8cee('0x42')]=!![];}return db[_0x8cee('0x2b')]['count'](_0x50e460)[_0x8cee('0x25')](function(_0x425eda){_0x139867['count']=_0x425eda;if(_0x51003d[_0x8cee('0x2e')]['includeAll']){_0x4a7781[_0x8cee('0x3f')]=[{'model':db[_0x8cee('0x47')],'as':_0x8cee('0x48'),'required':![],'attributes':['id',_0x8cee('0x28'),_0x8cee('0x49')]},{'model':db[_0x8cee('0x4a')],'as':_0x8cee('0x4b'),'required':![]},{'model':db[_0x8cee('0x47')],'as':_0x8cee('0x4c'),'attributes':[_0x8cee('0x28'),_0x8cee('0x49'),_0x8cee('0x4d')],'required':![]},{'model':db[_0x8cee('0x4e')],'as':_0x8cee('0x4f'),'attributes':['name',_0x8cee('0x3c')],'required':![]},{'model':db[_0x8cee('0x44')],'as':_0x8cee('0x50'),'attributes':['id',_0x8cee('0x45'),'createdAt',_0x8cee('0x43')],'where':{'direction':'in','read':_0x51003d[_0x8cee('0x2e')][_0x8cee('0x43')]||![]},'required':_0x51003d[_0x8cee('0x2e')][_0x8cee('0x43')]||![]},{'model':db[_0x8cee('0x41')],'as':_0x8cee('0x51'),'attributes':['id','name','color'],'required':_0x51003d[_0x8cee('0x2e')][_0x8cee('0x52')]?!![]:![]},{'model':db[_0x8cee('0x41')],'as':_0x8cee('0x53'),'attributes':['id',_0x8cee('0x28'),_0x8cee('0x54')],'through':_0x51003d[_0x8cee('0x2e')][_0x8cee('0x52')]?{'attributes':[],'where':{'TagId':_0x51003d['query'][_0x8cee('0x52')]||undefined}}:{},'required':_0x51003d[_0x8cee('0x2e')][_0x8cee('0x52')]?!![]:![]}];}return db[_0x8cee('0x2b')]['findAll'](_0x4a7781);})[_0x8cee('0x25')](function(_0x2d0973){_0x139867[_0x8cee('0x55')]=_0x2d0973;return _0x139867;})['then'](respondWithFilteredResult(_0x1572d5,_0x4a7781))[_0x8cee('0x56')](handleError(_0x1572d5,null));};exports[_0x8cee('0x57')]=function(_0x47e2a0,_0x22fe17){var _0x16fe5e={'raw':![],'where':{'id':_0x47e2a0['params']['id']}},_0x56182b={};_0x56182b[_0x8cee('0x34')]=_[_0x8cee('0x2d')](db['OpenchannelInteraction'][_0x8cee('0x2c')]);_0x56182b[_0x8cee('0x2e')]=_[_0x8cee('0x2d')](_0x47e2a0['query']);_0x56182b[_0x8cee('0x2f')]=_[_0x8cee('0x30')](_0x56182b[_0x8cee('0x34')],_0x56182b[_0x8cee('0x2e')]);_0x16fe5e['attributes']=_[_0x8cee('0x30')](_0x56182b['model'],qs[_0x8cee('0x31')](_0x47e2a0[_0x8cee('0x2e')]['fields']));_0x16fe5e['attributes']=_0x16fe5e['attributes'][_0x8cee('0x33')]?_0x16fe5e[_0x8cee('0x32')]:_0x56182b['model'];if(_0x47e2a0[_0x8cee('0x2e')][_0x8cee('0x58')]){_0x16fe5e[_0x8cee('0x3f')]=[{'all':!![]}];}_0x16fe5e=_[_0x8cee('0x39')]({},_0x16fe5e,_0x47e2a0['options']);return db[_0x8cee('0x2b')][_0x8cee('0x59')](_0x16fe5e)[_0x8cee('0x25')](handleEntityNotFound(_0x22fe17,null))[_0x8cee('0x25')](respondWithResult(_0x22fe17,null))[_0x8cee('0x56')](handleError(_0x22fe17,null));};exports[_0x8cee('0x5a')]=function(_0x3abeaf,_0x3caffa){return db[_0x8cee('0x2b')]['create'](_0x3abeaf[_0x8cee('0x5b')],{})[_0x8cee('0x25')](respondWithResult(_0x3caffa,0xc9))[_0x8cee('0x56')](handleError(_0x3caffa,null));};exports['update']=function(_0x55df6a,_0x4b2976){if(_0x55df6a['body']['id']){delete _0x55df6a[_0x8cee('0x5b')]['id'];}return db[_0x8cee('0x2b')][_0x8cee('0x59')]({'where':{'id':_0x55df6a['params']['id']}})[_0x8cee('0x25')](handleEntityNotFound(_0x4b2976,null))[_0x8cee('0x25')](saveUpdates(_0x55df6a[_0x8cee('0x5b')],null))[_0x8cee('0x25')](respondWithResult(_0x4b2976,null))[_0x8cee('0x56')](handleError(_0x4b2976,null));};exports[_0x8cee('0x26')]=function(_0x794808,_0x284da3){return db[_0x8cee('0x2b')][_0x8cee('0x59')]({'where':{'id':_0x794808[_0x8cee('0x5c')]['id']}})['then'](handleEntityNotFound(_0x284da3,null))[_0x8cee('0x25')](removeEntity(_0x284da3,null))[_0x8cee('0x56')](handleError(_0x284da3,null));};exports[_0x8cee('0x5d')]=function(_0x5571cd,_0x32f5a0){return db[_0x8cee('0x2b')]['describe']()[_0x8cee('0x25')](respondWithResult(_0x32f5a0,null))[_0x8cee('0x56')](handleError(_0x32f5a0,null));};exports[_0x8cee('0x5e')]=function(_0x4c6402,_0x2c76d5,_0x2ff0f4){return db[_0x8cee('0x44')][_0x8cee('0x59')]({'where':{'id':_0x4c6402[_0x8cee('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2c76d5,null))[_0x8cee('0x25')](function(_0x2c76b6){if(_0x2c76b6){return _0x2c76b6[_0x8cee('0x5e')](_0x4c6402['body'][_0x8cee('0x5f')],_[_0x8cee('0x60')](_0x4c6402[_0x8cee('0x5b')],[_0x8cee('0x5f'),'id'])||{});}})[_0x8cee('0x25')](respondWithResult(_0x2c76d5,null))['catch'](handleError(_0x2c76d5,null));};exports[_0x8cee('0x61')]=function(_0x5f2ac8,_0x44a2c5,_0x3059e6){var _0x1b41f0={'raw':![],'where':{}};var _0x1654d6={};var _0xa7a0b4={'count':0x0,'rows':[]};return db[_0x8cee('0x2b')]['findOne']({'where':{'id':_0x5f2ac8[_0x8cee('0x5c')]['id']}})[_0x8cee('0x25')](handleEntityNotFound(_0x44a2c5,null))[_0x8cee('0x25')](function(_0x3a59f1){if(_0x3a59f1){_0x1654d6[_0x8cee('0x34')]=_[_0x8cee('0x2d')](db[_0x8cee('0x44')][_0x8cee('0x2c')]);_0x1654d6[_0x8cee('0x2e')]=_[_0x8cee('0x2d')](_0x5f2ac8['query']);_0x1654d6['filters']=_[_0x8cee('0x30')](_0x1654d6[_0x8cee('0x34')],_0x1654d6[_0x8cee('0x2e')]);_0x1b41f0['attributes']=_['intersection'](_0x1654d6[_0x8cee('0x34')],qs[_0x8cee('0x31')](_0x5f2ac8[_0x8cee('0x2e')][_0x8cee('0x31')]));_0x1b41f0[_0x8cee('0x32')]=_0x1b41f0['attributes'][_0x8cee('0x33')]?_0x1b41f0['attributes']:_0x1654d6['model'];if(!_0x5f2ac8['query'][_0x8cee('0x35')]('nolimit')){_0x1b41f0[_0x8cee('0x20')]=qs[_0x8cee('0x20')](_0x5f2ac8['query'][_0x8cee('0x20')]);_0x1b41f0['offset']=qs[_0x8cee('0x1f')](_0x5f2ac8[_0x8cee('0x2e')]['offset']);}_0x1b41f0[_0x8cee('0x62')]=qs[_0x8cee('0x37')](_0x5f2ac8['query'][_0x8cee('0x37')]);_0x1b41f0['where']=qs['filters'](_[_0x8cee('0x63')](_0x5f2ac8[_0x8cee('0x2e')],_0x1654d6[_0x8cee('0x2f')]));_0x1b41f0[_0x8cee('0x38')][_0x8cee('0x64')]=_0x3a59f1['id'];if(_0x5f2ac8[_0x8cee('0x2e')][_0x8cee('0x3d')]){_0x1b41f0[_0x8cee('0x38')]=_['merge'](_0x1b41f0[_0x8cee('0x38')],{'$or':_[_0x8cee('0x3a')](_0x1b41f0[_0x8cee('0x32')],function(_0x27708a){var _0x16778d={};_0x16778d[_0x27708a]={'$like':'%'+_0x5f2ac8[_0x8cee('0x2e')][_0x8cee('0x3d')]+'%'};return _0x16778d;})});}if(_0x5f2ac8[_0x8cee('0x2e')]['$gte']){var _0x2a6d69=_0x5f2ac8[_0x8cee('0x2e')][_0x8cee('0x65')][_0x8cee('0x66')](',');var _0x5dc9de={};_0x5dc9de[_0x2a6d69[0x0]]={'$gte':moment(_0x2a6d69[0x1])[_0x8cee('0x67')](_0x8cee('0x68'))};_0x1b41f0[_0x8cee('0x38')]=_['merge'](_0x1b41f0[_0x8cee('0x38')],_0x5dc9de);}_0x1b41f0=_[_0x8cee('0x39')]({},_0x1b41f0,_0x5f2ac8[_0x8cee('0x3e')]);return db[_0x8cee('0x44')][_0x8cee('0x1e')]({'where':_0x1b41f0[_0x8cee('0x38')]})[_0x8cee('0x25')](function(_0x5ed0f0){_0xa7a0b4[_0x8cee('0x1e')]=_0x5ed0f0;if(_0x5f2ac8[_0x8cee('0x2e')][_0x8cee('0x58')]){_0x1b41f0[_0x8cee('0x3f')]=[{'all':!![]}];}return db[_0x8cee('0x44')]['findAll'](_0x1b41f0);})[_0x8cee('0x25')](function(_0x45261e){_0xa7a0b4[_0x8cee('0x55')]=_0x45261e;return _0xa7a0b4;});}})['then'](respondWithFilteredResult(_0x44a2c5,_0x1b41f0))['catch'](handleError(_0x44a2c5,null));};exports[_0x8cee('0x69')]=function(_0x4a455d,_0x3260ca,_0x680787){return db[_0x8cee('0x2b')][_0x8cee('0x59')]({'where':{'id':_0x4a455d[_0x8cee('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3260ca,null))[_0x8cee('0x25')](function(_0x13a6cb){if(_0x13a6cb){return _0x13a6cb[_0x8cee('0x6a')](_0x4a455d['body'][_0x8cee('0x5f')],_['omit'](_0x4a455d['body'],[_0x8cee('0x5f'),'id'])||{})[_0x8cee('0x6b')](function(){return db[_0x8cee('0x41')]['findAll']({'attributes':['id',_0x8cee('0x28'),_0x8cee('0x54')],'where':{'id':_0x4a455d[_0x8cee('0x5b')][_0x8cee('0x5f')]}});})[_0x8cee('0x25')](function(_0x48afb0){socket[_0x8cee('0x6c')]('openchannelInteractionTags:save',{'id':Number(_0x4a455d[_0x8cee('0x5c')]['id']),'tags':_0x48afb0||[]});return{'id':Number(_0x4a455d[_0x8cee('0x5c')]['id']),'tags':_0x48afb0||[]};});}})[_0x8cee('0x25')](respondWithResult(_0x3260ca,null))[_0x8cee('0x56')](handleError(_0x3260ca,null));};exports[_0x8cee('0x6d')]=function(_0x11262d,_0x4ee61e,_0x29f780){var _0xb63faf;return db[_0x8cee('0x2b')][_0x8cee('0x59')]({'where':{'id':_0x11262d['params']['id']}})[_0x8cee('0x25')](handleEntityNotFound(_0x4ee61e,null))['then'](function(_0x346dc3){if(_0x346dc3){return _0x346dc3[_0x8cee('0x6d')](_0x11262d['query'][_0x8cee('0x5f')]);}})['then'](respondWithStatusCode(_0x4ee61e,null))[_0x8cee('0x56')](handleError(_0x4ee61e,null));};exports[_0x8cee('0x6e')]=function(_0x41596b,_0x1b01af){var _0x21a385=moment()[_0x8cee('0x6f')]()['toString']();var _0x4977e1=path[_0x8cee('0x70')](config[_0x8cee('0x71')],_0x8cee('0x72'),_0x8cee('0x73'),'tmp');var _0x3eafd4=path[_0x8cee('0x70')](config['root'],'server',_0x8cee('0x73'),_0x8cee('0x74'));var _0x109c1f=path['join'](_0x4977e1,_0x21a385);var _0x36e419=util[_0x8cee('0x67')](_0x8cee('0x75'),_0x21a385);var _0x2d8c51=path[_0x8cee('0x70')](_0x4977e1,_0x36e419);var _0x50833e=![];return db[_0x8cee('0x2b')][_0x8cee('0x59')]({'where':{'id':_0x41596b[_0x8cee('0x5c')]['id']},'include':[{'model':db[_0x8cee('0x44')],'as':'Messages','attributes':['id','body'],'include':[{'model':db['User'],'as':_0x8cee('0x47'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x8cee('0x4a')],'as':'Contact','attributes':['id',_0x8cee('0x76')],'raw':!![]},{'model':db[_0x8cee('0x77')],'as':'Attachment','raw':!![]}]}]})[_0x8cee('0x25')](handleEntityNotFound(_0x1b01af,null))[_0x8cee('0x25')](function(_0xc874b6){if(_0xc874b6){_0x50833e=!![];var _0x167fd0='';var _0x45b043={'format':_0x8cee('0x78'),'border':_0x8cee('0x79')};fs[_0x8cee('0x7a')](_0x109c1f);_0x167fd0+=util['format']('

Openchannel\x20Interaction:\x20#%d

',_0xc874b6['id']);_0x167fd0+=util[_0x8cee('0x67')](_0x8cee('0x7b'),moment()['format'](_0x8cee('0x7c'))[_0x8cee('0x7d')]());_0x167fd0+=_0x8cee('0x7e');for(var _0x209e88=0x0;_0x209e88<_0xc874b6[_0x8cee('0x50')][_0x8cee('0x33')];_0x209e88++){var _0x22c3fb=_0xc874b6[_0x8cee('0x50')][_0x209e88];_0x167fd0+=_0x8cee('0x7f');_0x167fd0+=util[_0x8cee('0x67')](_0x8cee('0x80'),_0x22c3fb['User']?_0x22c3fb[_0x8cee('0x47')][_0x8cee('0x49')]:_0x22c3fb['Contact'][_0x8cee('0x76')],_0x22c3fb[_0x8cee('0x5b')]);_0x167fd0+=_0x8cee('0x81');if(_0x22c3fb[_0x8cee('0x77')]){var _0x473a8f=_0x22c3fb[_0x8cee('0x77')];var _0x544928=path['join'](_0x3eafd4,_0x473a8f[_0x8cee('0x82')]);if(fs['existsSync'](_0x544928)){fs[_0x8cee('0x83')](_0x544928)['pipe'](fs[_0x8cee('0x84')](path[_0x8cee('0x70')](_0x109c1f,_0x473a8f[_0x8cee('0x82')])));}}}return new BPromise(function(_0x4854b0,_0x13d0ca){pdf[_0x8cee('0x5a')](_0x167fd0,_0x45b043)[_0x8cee('0x85')](path['join'](_0x109c1f,_0x8cee('0x86')+_0x21a385+_0x8cee('0x87')),function(_0xbe1968,_0x280cc5){if(_0xbe1968)return _0x13d0ca(_0xbe1968);_0x4854b0(_0x280cc5);});});}})['then'](function(){if(_0x50833e){return new BPromise(function(_0x4a09f5,_0x593325){zipdir(_0x109c1f,{'saveTo':_0x2d8c51},function(_0x3a7b27,_0x4a1201){if(_0x3a7b27)return _0x593325(_0x3a7b27);return _0x4a09f5(_0x4a1201);});});}})['then'](function(){if(_0x50833e){return new BPromise(function(_0x3180d5,_0x1bc1dc){rimraf(_0x109c1f,function(_0x3768d9){if(_0x3768d9)_0x1bc1dc(_0x3768d9);return _0x3180d5();});});}})[_0x8cee('0x25')](function(){if(_0x50833e){return _0x1b01af['download'](_0x2d8c51,_0x36e419,function(_0x275f20){if(_0x275f20){console['log'](_0x8cee('0x88'),_0x275f20);}else{fs['unlinkSync'](_0x2d8c51);}});}else{return _0x1b01af[_0x8cee('0x1a')](0xc8);}})[_0x8cee('0x56')](handleError(_0x1b01af,null));}; \ No newline at end of file +var _0x2263=['json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','OpenchannelInteraction','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','key','VIRTUAL','field','filter','merge','options','include','tag','push','Tags','distinct','read','OpenchannelMessage','Messages','direction','createdAt','User','fullname','CmContact','Contact','Owner','OpenchannelAccount','Tag','ThroughTags','findAll','rows','catch','show','params','includeAll','find','create','body','describe','addMessage','ids','getMessages','findOne','order','$gte','format','addTags','setTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','join','server','tmp','root','files','attachments','interaction-%s.zip','firstName','Attachment','Letter','1cm','

Openchannel\x20Interaction:\x20#%d

','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','toString','
','','','basename','existsSync','pipe','createWriteStream','toFile','interaction-','.pdf','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','sendStatus'];(function(_0x5b92b2,_0xfcfc79){var _0xee798f=function(_0x39bf40){while(--_0x39bf40){_0x5b92b2['push'](_0x5b92b2['shift']());}};_0xee798f(++_0xfcfc79);}(_0x2263,0x6e));var _0x3226=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x2263[_0x406e46];return _0x4a3742;};'use strict';var pdf=require(_0x3226('0x0'));var emlformat=require(_0x3226('0x1'));var rimraf=require(_0x3226('0x2'));var zipdir=require(_0x3226('0x3'));var jsonpatch=require(_0x3226('0x4'));var rp=require(_0x3226('0x5'));var moment=require(_0x3226('0x6'));var BPromise=require(_0x3226('0x7'));var Mustache=require('mustache');var util=require(_0x3226('0x8'));var path=require(_0x3226('0x9'));var sox=require(_0x3226('0xa'));var csv=require(_0x3226('0xb'));var ejs=require(_0x3226('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3226('0xd'));var crypto=require(_0x3226('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3226('0xb'));var querystring=require(_0x3226('0xf'));var Papa=require('papaparse');var authService=require(_0x3226('0x10'));var hardwareService=require(_0x3226('0x11'));var Redis=require(_0x3226('0x12'));var qs=require(_0x3226('0x13'));var logger=require(_0x3226('0x14'))(_0x3226('0x15'));var utils=require(_0x3226('0x16'));var config=require('../../config/environment');var db=require(_0x3226('0x17'))['db'];config[_0x3226('0x18')]=_[_0x3226('0x19')](config[_0x3226('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x24ffc4,_0x425030){_0x425030=_0x425030||0xcc;return function(_0x114f4b){if(_0x114f4b){return _0x24ffc4[_0x3226('0x1a')](_0x425030);}return _0x24ffc4['status'](_0x425030)['end']();};}function respondWithResult(_0x2808e5,_0xfc7cb5){_0xfc7cb5=_0xfc7cb5||0xc8;return function(_0x86bb0f){if(_0x86bb0f){return _0x2808e5['status'](_0xfc7cb5)[_0x3226('0x1b')](_0x86bb0f);}};}function respondWithFilteredResult(_0x20f66c,_0xd76ab6){return function(_0x31d4f0){if(_0x31d4f0){var _0x1d62b6=_0x31d4f0[_0x3226('0x1c')],_0x4113a1=_0xd76ab6['offset'],_0x51bba9=_0xd76ab6[_0x3226('0x1d')]+_0xd76ab6[_0x3226('0x1e')],_0x4b3521;if(_0x51bba9>=_0x1d62b6){_0x51bba9=_0x1d62b6;_0x4b3521=0xc8;}else{_0x4b3521=0xce;}_0x20f66c[_0x3226('0x1f')](_0x4b3521);return _0x20f66c[_0x3226('0x20')](_0x3226('0x21'),_0x4113a1+'-'+_0x51bba9+'/'+_0x1d62b6)[_0x3226('0x1b')](_0x31d4f0);}return null;};}function patchUpdates(_0x4d4cd8){return function(_0x2b4d38){try{jsonpatch[_0x3226('0x22')](_0x2b4d38,_0x4d4cd8,!![]);}catch(_0x4dc9a8){return BPromise[_0x3226('0x23')](_0x4dc9a8);}return _0x2b4d38[_0x3226('0x24')]();};}function saveUpdates(_0x146362,_0x4eb7a9){return function(_0x29d92f){if(_0x29d92f){return _0x29d92f[_0x3226('0x25')](_0x146362)[_0x3226('0x26')](function(_0x3b7dad){return _0x3b7dad;});}return null;};}function removeEntity(_0x3191f8,_0x1109b7){return function(_0x29be67){if(_0x29be67){return _0x29be67[_0x3226('0x27')]()['then'](function(){_0x3191f8[_0x3226('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d6341,_0x5b8d32){return function(_0x26c845){if(!_0x26c845){_0x3d6341['sendStatus'](0x194);}return _0x26c845;};}function handleError(_0x1d7689,_0x4aff0c){_0x4aff0c=_0x4aff0c||0x1f4;return function(_0x10942a){logger[_0x3226('0x28')](_0x10942a['stack']);if(_0x10942a[_0x3226('0x29')]){delete _0x10942a[_0x3226('0x29')];}_0x1d7689[_0x3226('0x1f')](_0x4aff0c)[_0x3226('0x2a')](_0x10942a);};}exports[_0x3226('0x2b')]=function(_0x38c83c,_0x12e26d){var _0x4b9174={},_0x34d2aa={},_0x4e619b={'count':0x0,'rows':[]};var _0x2a2661=db[_0x3226('0x2c')][_0x3226('0x2d')];_0x34d2aa['model']=_[_0x3226('0x2e')](_0x2a2661);_0x34d2aa['query']=_['keys'](_0x38c83c[_0x3226('0x2f')]);_0x34d2aa[_0x3226('0x30')]=_[_0x3226('0x31')](_0x34d2aa[_0x3226('0x32')],_0x34d2aa[_0x3226('0x2f')]);_0x4b9174[_0x3226('0x33')]=_[_0x3226('0x31')](_0x34d2aa[_0x3226('0x32')],qs[_0x3226('0x34')](_0x38c83c['query'][_0x3226('0x34')]));_0x4b9174[_0x3226('0x33')]=_0x4b9174[_0x3226('0x33')][_0x3226('0x35')]?_0x4b9174[_0x3226('0x33')]:_0x34d2aa[_0x3226('0x32')];if(!_0x38c83c[_0x3226('0x2f')][_0x3226('0x36')](_0x3226('0x37'))){_0x4b9174[_0x3226('0x1e')]=qs[_0x3226('0x1e')](_0x38c83c[_0x3226('0x2f')][_0x3226('0x1e')]);_0x4b9174[_0x3226('0x1d')]=qs['offset'](_0x38c83c['query'][_0x3226('0x1d')]);}_0x4b9174['order']=qs[_0x3226('0x38')](_0x38c83c['query'][_0x3226('0x38')]);_0x4b9174[_0x3226('0x39')]=qs[_0x3226('0x30')](_[_0x3226('0x3a')](_0x38c83c[_0x3226('0x2f')],_0x34d2aa['filters']));if(_0x38c83c[_0x3226('0x2f')]['filter']){_0x4b9174[_0x3226('0x39')]=_['merge'](_0x4b9174[_0x3226('0x39')],{'$or':_[_0x3226('0x3b')](_0x2a2661,function(_0x1d1374){if(_0x1d1374['type'][_0x3226('0x3c')]!==_0x3226('0x3d')){var _0x20a8fd={};_0x20a8fd[_0x1d1374[_0x3226('0x3e')]]={'$like':'%'+_0x38c83c[_0x3226('0x2f')][_0x3226('0x3f')]+'%'};return _0x20a8fd;}})});}_0x4b9174=_[_0x3226('0x40')]({},_0x4b9174,_0x38c83c[_0x3226('0x41')]);var _0xd1565a={'where':_0x4b9174[_0x3226('0x39')]};_0xd1565a[_0x3226('0x42')]=[];if(_0x38c83c[_0x3226('0x2f')][_0x3226('0x43')]){_0xd1565a[_0x3226('0x42')][_0x3226('0x44')]({'model':db['Tag'],'as':_0x3226('0x45'),'attributes':['id'],'where':{'id':_0x38c83c[_0x3226('0x2f')][_0x3226('0x43')]},'required':!![]});_0xd1565a[_0x3226('0x46')]=!![];}if(_0x38c83c['query'][_0x3226('0x47')]){_0xd1565a[_0x3226('0x42')][_0x3226('0x44')]({'model':db[_0x3226('0x48')],'as':_0x3226('0x49'),'attributes':['id',_0x3226('0x4a'),_0x3226('0x4b'),_0x3226('0x47')],'where':{'direction':'in','read':_0x38c83c[_0x3226('0x2f')]['read']||![]},'required':!![]});_0xd1565a[_0x3226('0x46')]=!![];}return db[_0x3226('0x2c')][_0x3226('0x1c')](_0xd1565a)[_0x3226('0x26')](function(_0x9a8267){_0x4e619b[_0x3226('0x1c')]=_0x9a8267;if(_0x38c83c['query']['includeAll']){_0x4b9174[_0x3226('0x42')]=[{'model':db[_0x3226('0x4c')],'as':'Users','required':![],'attributes':['id',_0x3226('0x29'),_0x3226('0x4d')]},{'model':db[_0x3226('0x4e')],'as':_0x3226('0x4f'),'required':![]},{'model':db[_0x3226('0x4c')],'as':_0x3226('0x50'),'attributes':[_0x3226('0x29'),_0x3226('0x4d'),'internal'],'required':![]},{'model':db[_0x3226('0x51')],'as':'Account','attributes':[_0x3226('0x29'),_0x3226('0x3c')],'required':![]},{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0x3226('0x4a'),_0x3226('0x4b'),_0x3226('0x47')],'where':{'direction':'in','read':_0x38c83c[_0x3226('0x2f')]['read']||![]},'required':_0x38c83c[_0x3226('0x2f')][_0x3226('0x47')]||![]},{'model':db['Tag'],'as':_0x3226('0x45'),'attributes':['id',_0x3226('0x29'),'color'],'required':_0x38c83c[_0x3226('0x2f')][_0x3226('0x43')]?!![]:![]},{'model':db[_0x3226('0x52')],'as':_0x3226('0x53'),'attributes':['id',_0x3226('0x29'),'color'],'through':_0x38c83c[_0x3226('0x2f')][_0x3226('0x43')]?{'attributes':[],'where':{'TagId':_0x38c83c[_0x3226('0x2f')][_0x3226('0x43')]||undefined}}:{},'required':_0x38c83c[_0x3226('0x2f')]['tag']?!![]:![]}];}return db[_0x3226('0x2c')][_0x3226('0x54')](_0x4b9174);})[_0x3226('0x26')](function(_0x3be1c0){_0x4e619b[_0x3226('0x55')]=_0x3be1c0;return _0x4e619b;})[_0x3226('0x26')](respondWithFilteredResult(_0x12e26d,_0x4b9174))[_0x3226('0x56')](handleError(_0x12e26d,null));};exports[_0x3226('0x57')]=function(_0x1016e6,_0x1a545d){var _0x2fa2a7={'raw':![],'where':{'id':_0x1016e6[_0x3226('0x58')]['id']}},_0x3f555b={};_0x3f555b['model']=_[_0x3226('0x2e')](db['OpenchannelInteraction'][_0x3226('0x2d')]);_0x3f555b['query']=_[_0x3226('0x2e')](_0x1016e6[_0x3226('0x2f')]);_0x3f555b['filters']=_[_0x3226('0x31')](_0x3f555b[_0x3226('0x32')],_0x3f555b[_0x3226('0x2f')]);_0x2fa2a7['attributes']=_[_0x3226('0x31')](_0x3f555b[_0x3226('0x32')],qs[_0x3226('0x34')](_0x1016e6['query'][_0x3226('0x34')]));_0x2fa2a7[_0x3226('0x33')]=_0x2fa2a7[_0x3226('0x33')][_0x3226('0x35')]?_0x2fa2a7['attributes']:_0x3f555b['model'];if(_0x1016e6[_0x3226('0x2f')][_0x3226('0x59')]){_0x2fa2a7[_0x3226('0x42')]=[{'all':!![]}];}_0x2fa2a7=_[_0x3226('0x40')]({},_0x2fa2a7,_0x1016e6[_0x3226('0x41')]);return db[_0x3226('0x2c')][_0x3226('0x5a')](_0x2fa2a7)[_0x3226('0x26')](handleEntityNotFound(_0x1a545d,null))[_0x3226('0x26')](respondWithResult(_0x1a545d,null))['catch'](handleError(_0x1a545d,null));};exports[_0x3226('0x5b')]=function(_0x42cff3,_0x50a249){return db[_0x3226('0x2c')][_0x3226('0x5b')](_0x42cff3[_0x3226('0x5c')],{})['then'](respondWithResult(_0x50a249,0xc9))[_0x3226('0x56')](handleError(_0x50a249,null));};exports[_0x3226('0x25')]=function(_0x570ec7,_0x8877e2){if(_0x570ec7['body']['id']){delete _0x570ec7[_0x3226('0x5c')]['id'];}return db[_0x3226('0x2c')][_0x3226('0x5a')]({'where':{'id':_0x570ec7['params']['id']}})['then'](handleEntityNotFound(_0x8877e2,null))['then'](saveUpdates(_0x570ec7[_0x3226('0x5c')],null))[_0x3226('0x26')](respondWithResult(_0x8877e2,null))[_0x3226('0x56')](handleError(_0x8877e2,null));};exports[_0x3226('0x27')]=function(_0x479b95,_0x5d8293){return db[_0x3226('0x2c')][_0x3226('0x5a')]({'where':{'id':_0x479b95[_0x3226('0x58')]['id']}})[_0x3226('0x26')](handleEntityNotFound(_0x5d8293,null))[_0x3226('0x26')](removeEntity(_0x5d8293,null))[_0x3226('0x56')](handleError(_0x5d8293,null));};exports[_0x3226('0x5d')]=function(_0x3216ba,_0x5b6a6c){return db[_0x3226('0x2c')][_0x3226('0x5d')]()[_0x3226('0x26')](respondWithResult(_0x5b6a6c,null))[_0x3226('0x56')](handleError(_0x5b6a6c,null));};exports['addMessage']=function(_0x3610a6,_0x41eb63,_0x393601){return db[_0x3226('0x48')]['find']({'where':{'id':_0x3610a6['params']['id']}})[_0x3226('0x26')](handleEntityNotFound(_0x41eb63,null))['then'](function(_0x1c734f){if(_0x1c734f){return _0x1c734f[_0x3226('0x5e')](_0x3610a6[_0x3226('0x5c')][_0x3226('0x5f')],_['omit'](_0x3610a6[_0x3226('0x5c')],[_0x3226('0x5f'),'id'])||{});}})[_0x3226('0x26')](respondWithResult(_0x41eb63,null))['catch'](handleError(_0x41eb63,null));};exports[_0x3226('0x60')]=function(_0x17ede0,_0x580d28,_0x4df17c){var _0x450531={'raw':![],'where':{}};var _0x452971={};var _0xf6836c={'count':0x0,'rows':[]};return db[_0x3226('0x2c')][_0x3226('0x61')]({'where':{'id':_0x17ede0[_0x3226('0x58')]['id']}})[_0x3226('0x26')](handleEntityNotFound(_0x580d28,null))[_0x3226('0x26')](function(_0x508427){if(_0x508427){_0x452971[_0x3226('0x32')]=_['keys'](db['OpenchannelMessage'][_0x3226('0x2d')]);_0x452971[_0x3226('0x2f')]=_[_0x3226('0x2e')](_0x17ede0[_0x3226('0x2f')]);_0x452971[_0x3226('0x30')]=_[_0x3226('0x31')](_0x452971[_0x3226('0x32')],_0x452971[_0x3226('0x2f')]);_0x450531[_0x3226('0x33')]=_[_0x3226('0x31')](_0x452971[_0x3226('0x32')],qs['fields'](_0x17ede0[_0x3226('0x2f')][_0x3226('0x34')]));_0x450531['attributes']=_0x450531[_0x3226('0x33')]['length']?_0x450531[_0x3226('0x33')]:_0x452971[_0x3226('0x32')];if(!_0x17ede0['query']['hasOwnProperty']('nolimit')){_0x450531[_0x3226('0x1e')]=qs[_0x3226('0x1e')](_0x17ede0[_0x3226('0x2f')][_0x3226('0x1e')]);_0x450531[_0x3226('0x1d')]=qs['offset'](_0x17ede0[_0x3226('0x2f')][_0x3226('0x1d')]);}_0x450531[_0x3226('0x62')]=qs[_0x3226('0x38')](_0x17ede0[_0x3226('0x2f')][_0x3226('0x38')]);_0x450531[_0x3226('0x39')]=qs[_0x3226('0x30')](_['pick'](_0x17ede0[_0x3226('0x2f')],_0x452971[_0x3226('0x30')]));_0x450531[_0x3226('0x39')]['OpenchannelInteractionId']=_0x508427['id'];if(_0x17ede0[_0x3226('0x2f')]['filter']){_0x450531[_0x3226('0x39')]=_[_0x3226('0x40')](_0x450531[_0x3226('0x39')],{'$or':_[_0x3226('0x3b')](_0x450531['attributes'],function(_0x57bb7f){var _0x41b490={};_0x41b490[_0x57bb7f]={'$like':'%'+_0x17ede0[_0x3226('0x2f')]['filter']+'%'};return _0x41b490;})});}if(_0x17ede0[_0x3226('0x2f')][_0x3226('0x63')]){var _0x3680aa=_0x17ede0[_0x3226('0x2f')][_0x3226('0x63')]['split'](',');var _0xcd9a99={};_0xcd9a99[_0x3680aa[0x0]]={'$gte':moment(_0x3680aa[0x1])[_0x3226('0x64')]('YYYY-MM-DD\x20HH:mm:ss')};_0x450531[_0x3226('0x39')]=_[_0x3226('0x40')](_0x450531[_0x3226('0x39')],_0xcd9a99);}_0x450531=_[_0x3226('0x40')]({},_0x450531,_0x17ede0['options']);return db['OpenchannelMessage'][_0x3226('0x1c')]({'where':_0x450531[_0x3226('0x39')]})[_0x3226('0x26')](function(_0x4fdf5e){_0xf6836c[_0x3226('0x1c')]=_0x4fdf5e;if(_0x17ede0[_0x3226('0x2f')][_0x3226('0x59')]){_0x450531[_0x3226('0x42')]=[{'all':!![]}];}return db[_0x3226('0x48')][_0x3226('0x54')](_0x450531);})[_0x3226('0x26')](function(_0x34d1c8){_0xf6836c[_0x3226('0x55')]=_0x34d1c8;return _0xf6836c;});}})['then'](respondWithFilteredResult(_0x580d28,_0x450531))[_0x3226('0x56')](handleError(_0x580d28,null));};exports[_0x3226('0x65')]=function(_0x284353,_0x5b803a,_0xf0a93c){return db[_0x3226('0x2c')]['find']({'where':{'id':_0x284353[_0x3226('0x58')]['id']}})['then'](handleEntityNotFound(_0x5b803a,null))['then'](function(_0x45c9c8){if(_0x45c9c8){return _0x45c9c8[_0x3226('0x66')](_0x284353['body'][_0x3226('0x5f')],_[_0x3226('0x67')](_0x284353[_0x3226('0x5c')],[_0x3226('0x5f'),'id'])||{})[_0x3226('0x68')](function(){return db[_0x3226('0x52')][_0x3226('0x54')]({'attributes':['id',_0x3226('0x29'),'color'],'where':{'id':_0x284353[_0x3226('0x5c')][_0x3226('0x5f')]}});})[_0x3226('0x26')](function(_0x5770f4){socket[_0x3226('0x69')](_0x3226('0x6a'),{'id':Number(_0x284353[_0x3226('0x58')]['id']),'tags':_0x5770f4||[]});return{'id':Number(_0x284353[_0x3226('0x58')]['id']),'tags':_0x5770f4||[]};});}})['then'](respondWithResult(_0x5b803a,null))[_0x3226('0x56')](handleError(_0x5b803a,null));};exports['removeTags']=function(_0x5d8f82,_0x3b20db,_0x2dfebe){var _0x3df69e;return db[_0x3226('0x2c')][_0x3226('0x5a')]({'where':{'id':_0x5d8f82[_0x3226('0x58')]['id']}})['then'](handleEntityNotFound(_0x3b20db,null))[_0x3226('0x26')](function(_0x232218){if(_0x232218){return _0x232218[_0x3226('0x6b')](_0x5d8f82[_0x3226('0x2f')][_0x3226('0x5f')]);}})[_0x3226('0x26')](respondWithStatusCode(_0x3b20db,null))[_0x3226('0x56')](handleError(_0x3b20db,null));};exports['download']=function(_0x2eab8b,_0x275342){var _0x5cc8de=moment()['unix']()['toString']();var _0x1b663f=path[_0x3226('0x6c')](config['root'],_0x3226('0x6d'),'files',_0x3226('0x6e'));var _0x2248d3=path[_0x3226('0x6c')](config[_0x3226('0x6f')],_0x3226('0x6d'),_0x3226('0x70'),_0x3226('0x71'));var _0x4b3a9f=path['join'](_0x1b663f,_0x5cc8de);var _0x100485=util[_0x3226('0x64')](_0x3226('0x72'),_0x5cc8de);var _0x27f9d0=path['join'](_0x1b663f,_0x100485);var _0xe43e4d=![];return db[_0x3226('0x2c')][_0x3226('0x5a')]({'where':{'id':_0x2eab8b['params']['id']},'include':[{'model':db[_0x3226('0x48')],'as':_0x3226('0x49'),'attributes':['id','body'],'include':[{'model':db[_0x3226('0x4c')],'as':_0x3226('0x4c'),'attributes':['id',_0x3226('0x4d')],'raw':!![]},{'model':db[_0x3226('0x4e')],'as':'Contact','attributes':['id',_0x3226('0x73')],'raw':!![]},{'model':db[_0x3226('0x74')],'as':_0x3226('0x74'),'raw':!![]}]}]})[_0x3226('0x26')](handleEntityNotFound(_0x275342,null))['then'](function(_0x3dcf53){if(_0x3dcf53){_0xe43e4d=!![];var _0x5afdc2='';var _0x4896f0={'format':_0x3226('0x75'),'border':_0x3226('0x76')};fs['mkdirSync'](_0x4b3a9f);_0x5afdc2+=util[_0x3226('0x64')](_0x3226('0x77'),_0x3dcf53['id']);_0x5afdc2+=util['format'](_0x3226('0x78'),moment()[_0x3226('0x64')](_0x3226('0x79'))[_0x3226('0x7a')]());_0x5afdc2+=_0x3226('0x7b');for(var _0x219028=0x0;_0x219028<_0x3dcf53['Messages'][_0x3226('0x35')];_0x219028++){var _0x35ea94=_0x3dcf53[_0x3226('0x49')][_0x219028];_0x5afdc2+=_0x3226('0x7c');_0x5afdc2+=util[_0x3226('0x64')]('%s:\x20%s

',_0x35ea94[_0x3226('0x4c')]?_0x35ea94['User'][_0x3226('0x4d')]:_0x35ea94[_0x3226('0x4f')][_0x3226('0x73')],_0x35ea94['body']);_0x5afdc2+=_0x3226('0x7d');if(_0x35ea94[_0x3226('0x74')]){var _0x5c7376=_0x35ea94['Attachment'];var _0x3927a4=path[_0x3226('0x6c')](_0x2248d3,_0x5c7376[_0x3226('0x7e')]);if(fs[_0x3226('0x7f')](_0x3927a4)){fs['createReadStream'](_0x3927a4)[_0x3226('0x80')](fs[_0x3226('0x81')](path[_0x3226('0x6c')](_0x4b3a9f,_0x5c7376[_0x3226('0x7e')])));}}}return new BPromise(function(_0x1f821c,_0x8945ac){pdf[_0x3226('0x5b')](_0x5afdc2,_0x4896f0)[_0x3226('0x82')](path['join'](_0x4b3a9f,_0x3226('0x83')+_0x5cc8de+_0x3226('0x84')),function(_0x4f2e80,_0x5eea51){if(_0x4f2e80)return _0x8945ac(_0x4f2e80);_0x1f821c(_0x5eea51);});});}})['then'](function(){if(_0xe43e4d){return new BPromise(function(_0x226e35,_0x50266e){zipdir(_0x4b3a9f,{'saveTo':_0x27f9d0},function(_0x20ddd8,_0x38f038){if(_0x20ddd8)return _0x50266e(_0x20ddd8);return _0x226e35(_0x38f038);});});}})[_0x3226('0x26')](function(){if(_0xe43e4d){return new BPromise(function(_0x1042bd,_0x364c0d){rimraf(_0x4b3a9f,function(_0x205a46){if(_0x205a46)_0x364c0d(_0x205a46);return _0x1042bd();});});}})[_0x3226('0x26')](function(){if(_0xe43e4d){return _0x275342[_0x3226('0x85')](_0x27f9d0,_0x100485,function(_0x328ea4){if(_0x328ea4){console[_0x3226('0x86')](_0x3226('0x87'),_0x328ea4);}else{fs[_0x3226('0x88')](_0x27f9d0);}});}else{return _0x275342['sendStatus'](0xc8);}})[_0x3226('0x56')](handleError(_0x275342,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index d31f5fd..7913383 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 _0x6f4b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction'];(function(_0x250c78,_0x25b838){var _0x44f07a=function(_0x599b41){while(--_0x599b41){_0x250c78['push'](_0x250c78['shift']());}};_0x44f07a(++_0x25b838);}(_0x6f4b,0x1e7));var _0xb6f4=function(_0x52bcaa,_0x1ee769){_0x52bcaa=_0x52bcaa-0x0;var _0x3c483b=_0x6f4b[_0x52bcaa];return _0x3c483b;};'use strict';var EventEmitter=require(_0xb6f4('0x0'));var OpenchannelInteraction=require(_0xb6f4('0x1'))['db'][_0xb6f4('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb6f4('0x3')](0x0);var events={'afterCreate':_0xb6f4('0x4'),'afterUpdate':_0xb6f4('0x5'),'afterDestroy':_0xb6f4('0x6')};function emitEvent(_0x559aaf){return function(_0x4172e6,_0x5e9d4b,_0xa8c7f6){OpenchannelInteractionEvents[_0xb6f4('0x7')](_0x559aaf+':'+_0x4172e6['id'],_0x4172e6);OpenchannelInteractionEvents[_0xb6f4('0x7')](_0x559aaf,_0x4172e6);_0xa8c7f6(null);};}for(var e in events){if(events[_0xb6f4('0x8')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xb6f4('0x9')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6e2c=['emit','hook','exports','../../mysqldb','OpenchannelInteraction','save','update','remove'];(function(_0x496d06,_0x4fd724){var _0x424e9a=function(_0x4fee16){while(--_0x4fee16){_0x496d06['push'](_0x496d06['shift']());}};_0x424e9a(++_0x4fd724);}(_0x6e2c,0x153));var _0xc6e2=function(_0xe31aa,_0x201325){_0xe31aa=_0xe31aa-0x0;var _0x38268e=_0x6e2c[_0xe31aa];return _0x38268e;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xc6e2('0x0'))['db'][_0xc6e2('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc6e2('0x2'),'afterUpdate':_0xc6e2('0x3'),'afterDestroy':_0xc6e2('0x4')};function emitEvent(_0x2c2503){return function(_0x34b509,_0x1d8ad5,_0x3b792e){OpenchannelInteractionEvents[_0xc6e2('0x5')](_0x2c2503+':'+_0x34b509['id'],_0x34b509);OpenchannelInteractionEvents[_0xc6e2('0x5')](_0x2c2503,_0x34b509);_0x3b792e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xc6e2('0x6')](e,emitEvent(event));}}module[_0xc6e2('0x7')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 72a677d..0151190 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 _0x9f33=['define','OpenchannelInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','./openchannelInteraction.attributes','exports'];(function(_0x3d782d,_0x6cc47c){var _0xc966dc=function(_0x4f9fdc){while(--_0x4f9fdc){_0x3d782d['push'](_0x3d782d['shift']());}};_0xc966dc(++_0x6cc47c);}(_0x9f33,0xd9));var _0x39f3=function(_0x56f762,_0x287b26){_0x56f762=_0x56f762-0x0;var _0x185624=_0x9f33[_0x56f762];return _0x185624;};'use strict';var _=require('lodash');var util=require(_0x39f3('0x0'));var logger=require(_0x39f3('0x1'))(_0x39f3('0x2'));var moment=require(_0x39f3('0x3'));var BPromise=require(_0x39f3('0x4'));var rp=require(_0x39f3('0x5'));var attributes=require(_0x39f3('0x6'));module[_0x39f3('0x7')]=function(_0x241e45,_0x20a937){return _0x241e45[_0x39f3('0x8')](_0x39f3('0x9'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe45cc0,_0x174069,_0x16c16b){if(_0xe45cc0[_0x39f3('0xa')](_0x39f3('0xb'))){_0xe45cc0[_0x39f3('0xc')]=moment()[_0x39f3('0xd')](_0x39f3('0xe'));}_0x16c16b(null,_0xe45cc0);}}});}; \ No newline at end of file +var _0x9b8b=['openchannel_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','./openchannelInteraction.attributes','OpenchannelInteraction'];(function(_0x4fbb37,_0x19a40e){var _0x4e6613=function(_0x3eef9c){while(--_0x3eef9c){_0x4fbb37['push'](_0x4fbb37['shift']());}};_0x4e6613(++_0x19a40e);}(_0x9b8b,0x76));var _0xb9b8=function(_0xbbd387,_0x68f6b4){_0xbbd387=_0xbbd387-0x0;var _0x150509=_0x9b8b[_0xbbd387];return _0x150509;};'use strict';var _=require(_0xb9b8('0x0'));var util=require(_0xb9b8('0x1'));var logger=require(_0xb9b8('0x2'))('api');var moment=require(_0xb9b8('0x3'));var BPromise=require(_0xb9b8('0x4'));var rp=require(_0xb9b8('0x5'));var attributes=require(_0xb9b8('0x6'));module['exports']=function(_0x554ec2,_0x1c6c8c){return _0x554ec2['define'](_0xb9b8('0x7'),attributes,{'tableName':_0xb9b8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51dba5,_0x52554a,_0x5bc805){if(_0x51dba5[_0xb9b8('0x9')](_0xb9b8('0xa'))){_0x51dba5[_0xb9b8('0xb')]=moment()[_0xb9b8('0xc')](_0xb9b8('0xd'));}_0x5bc805(null,_0x51dba5);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 5e6b6ec..b14ab60 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 _0x687b=['localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x43e599,_0x514eb7){var _0x394dbe=function(_0x382b2c){while(--_0x382b2c){_0x43e599['push'](_0x43e599['shift']());}};_0x394dbe(++_0x514eb7);}(_0x687b,0x14a));var _0xb687=function(_0x326a44,_0x41c393){_0x326a44=_0x326a44-0x0;var _0x218e10=_0x687b[_0x326a44];return _0x218e10;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});config[_0xb687('0xc')]=_[_0xb687('0xd')](config['redis'],{'host':_0xb687('0xe'),'port':0x18eb});var socket=require(_0xb687('0xf'))(new Redis(config['redis']));require(_0xb687('0x10'))[_0xb687('0x11')](socket);function respondWithRpcPromise(_0x825ad,_0x15dc9a,_0x404fdb){return new BPromise(function(_0x309d84,_0x3e6271){return client[_0xb687('0x12')](_0x825ad,_0x404fdb)[_0xb687('0x13')](function(_0x5103b9){logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));logger[_0xb687('0x17')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x15dc9a,'request\x20sent',JSON[_0xb687('0x18')](_0x5103b9));if(_0x5103b9[_0xb687('0x19')]){if(_0x5103b9['error'][_0xb687('0x1a')]===0x1f4){logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x3e6271(_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);}logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x309d84(_0x5103b9[_0xb687('0x19')]['message']);}else{logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));_0x309d84(_0x5103b9['result']['message']);}})[_0xb687('0x1c')](function(_0x3a10ef){logger[_0xb687('0x19')]('OpenchannelInteraction,\x20%s,\x20%s',_0x15dc9a,_0x3a10ef);_0x3e6271(_0x3a10ef);});});}exports[_0xb687('0x1d')]=function(_0x481f1d){var _0x1bd2bf=this;return new Promise(function(_0x243236,_0x170dc0){return db[_0xb687('0x1e')]['update'](_0x481f1d[_0xb687('0x1f')],{'raw':_0x481f1d['options']?_0x481f1d[_0xb687('0x20')][_0xb687('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x481f1d[_0xb687('0x20')]?_0x481f1d['options'][_0xb687('0x22')]||null:null,'attributes':_0x481f1d[_0xb687('0x20')]?_0x481f1d[_0xb687('0x20')][_0xb687('0x23')]||null:null,'limit':_0x481f1d[_0xb687('0x20')]?_0x481f1d[_0xb687('0x20')][_0xb687('0x24')]||null:null})[_0xb687('0x13')](function(_0x57cd51){logger[_0xb687('0x14')](_0xb687('0x1d'),_0x481f1d);logger[_0xb687('0x17')](_0xb687('0x1d'),_0x481f1d,JSON[_0xb687('0x18')](_0x57cd51));_0x243236(_0x57cd51);})[_0xb687('0x1c')](function(_0x17ff2b){logger[_0xb687('0x19')](_0xb687('0x1d'),_0x17ff2b[_0xb687('0x1b')],_0x481f1d);_0x170dc0(_0x1bd2bf['error'](0x1f4,_0x17ff2b[_0xb687('0x1b')]));});});};exports[_0xb687('0x25')]=function(_0x392721){return new Promise(function(_0x265a4b,_0x2e5c8d){return db[_0xb687('0x1e')]['find']({'where':_0x392721[_0xb687('0x20')]?_0x392721['options'][_0xb687('0x22')]||null:null})[_0xb687('0x13')](function(_0x6df7a2){if(_0x6df7a2){return _0x6df7a2[_0xb687('0x26')](_0x392721[_0xb687('0x1f')][_0xb687('0x27')],_[_0xb687('0x28')](_0x392721['body'],[_0xb687('0x27'),'id'])||{});}})[_0xb687('0x29')](function(_0x3c08ab){logger[_0xb687('0x14')](_0xb687('0x2a'),_0x392721);logger[_0xb687('0x17')](_0xb687('0x2a'),_0x392721,JSON[_0xb687('0x18')](_0x3c08ab));_0x265a4b(_0x3c08ab);})[_0xb687('0x1c')](function(_0x576cc1){logger[_0xb687('0x19')]('AddTags',_0x576cc1['message'],_0x392721);_0x2e5c8d(_this[_0xb687('0x19')](0x1f4,_0x576cc1[_0xb687('0x1b')]));});});}; \ No newline at end of file +var _0x5162=['message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','catch','AddTagsToOpenchannelInteraction','find','then','addTags','ids','omit','spread','AddTags','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0xdf35b2,_0x2253a4){var _0x40f7f2=function(_0x574e4f){while(--_0x574e4f){_0xdf35b2['push'](_0xdf35b2['shift']());}};_0x40f7f2(++_0x2253a4);}(_0x5162,0x103));var _0x2516=function(_0x420d5b,_0x20cefc){_0x420d5b=_0x420d5b-0x0;var _0x24bb19=_0x5162[_0x420d5b];return _0x24bb19;};'use strict';var _=require(_0x2516('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2516('0x1'));var db=require(_0x2516('0x2'))['db'];var utils=require(_0x2516('0x3'));var logger=require(_0x2516('0x4'))(_0x2516('0x5'));var config=require(_0x2516('0x6'));var jayson=require(_0x2516('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2516('0x8')](config[_0x2516('0x9')],{'host':_0x2516('0xa'),'port':0x18eb});var socket=require(_0x2516('0xb'))(new Redis(config[_0x2516('0x9')]));require(_0x2516('0xc'))[_0x2516('0xd')](socket);function respondWithRpcPromise(_0x590875,_0x409550,_0x3f7e71){return new BPromise(function(_0x18bfd3,_0x5dda21){return client['request'](_0x590875,_0x3f7e71)['then'](function(_0x4ceaa1){logger[_0x2516('0xe')](_0x2516('0xf'),_0x409550,_0x2516('0x10'));logger[_0x2516('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x409550,_0x2516('0x10'),JSON[_0x2516('0x12')](_0x4ceaa1));if(_0x4ceaa1[_0x2516('0x13')]){if(_0x4ceaa1[_0x2516('0x13')][_0x2516('0x14')]===0x1f4){logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);return _0x5dda21(_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);}logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x4ceaa1[_0x2516('0x13')][_0x2516('0x15')]);return _0x18bfd3(_0x4ceaa1['error'][_0x2516('0x15')]);}else{logger[_0x2516('0xe')](_0x2516('0xf'),_0x409550,'request\x20sent');_0x18bfd3(_0x4ceaa1[_0x2516('0x16')]['message']);}})['catch'](function(_0x31a817){logger[_0x2516('0x13')](_0x2516('0xf'),_0x409550,_0x31a817);_0x5dda21(_0x31a817);});});}exports[_0x2516('0x17')]=function(_0x198b93){var _0x42ba50=this;return new Promise(function(_0x2bf0ee,_0x113616){return db[_0x2516('0x18')][_0x2516('0x19')](_0x198b93[_0x2516('0x1a')],{'raw':_0x198b93[_0x2516('0x1b')]?_0x198b93[_0x2516('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x198b93['options']?_0x198b93[_0x2516('0x1b')][_0x2516('0x1c')]||null:null,'attributes':_0x198b93[_0x2516('0x1b')]?_0x198b93[_0x2516('0x1b')][_0x2516('0x1d')]||null:null,'limit':_0x198b93[_0x2516('0x1b')]?_0x198b93[_0x2516('0x1b')][_0x2516('0x1e')]||null:null})['then'](function(_0xa4538d){logger[_0x2516('0xe')](_0x2516('0x17'),_0x198b93);logger[_0x2516('0x11')]('UpdateOpenchannelInteraction',_0x198b93,JSON[_0x2516('0x12')](_0xa4538d));_0x2bf0ee(_0xa4538d);})[_0x2516('0x1f')](function(_0x1f722c){logger[_0x2516('0x13')](_0x2516('0x17'),_0x1f722c['message'],_0x198b93);_0x113616(_0x42ba50[_0x2516('0x13')](0x1f4,_0x1f722c[_0x2516('0x15')]));});});};exports[_0x2516('0x20')]=function(_0x2cb847){return new Promise(function(_0x38ec50,_0x285e67){return db['OpenchannelInteraction'][_0x2516('0x21')]({'where':_0x2cb847[_0x2516('0x1b')]?_0x2cb847['options'][_0x2516('0x1c')]||null:null})[_0x2516('0x22')](function(_0x4527f1){if(_0x4527f1){return _0x4527f1[_0x2516('0x23')](_0x2cb847[_0x2516('0x1a')][_0x2516('0x24')],_[_0x2516('0x25')](_0x2cb847[_0x2516('0x1a')],[_0x2516('0x24'),'id'])||{});}})[_0x2516('0x26')](function(_0xc0d4a9){logger[_0x2516('0xe')](_0x2516('0x27'),_0x2cb847);logger[_0x2516('0x11')](_0x2516('0x27'),_0x2cb847,JSON['stringify'](_0xc0d4a9));_0x38ec50(_0xc0d4a9);})[_0x2516('0x1f')](function(_0x54147b){logger[_0x2516('0x13')]('AddTags',_0x54147b[_0x2516('0x15')],_0x2cb847);_0x285e67(_this['error'](0x1f4,_0x54147b[_0x2516('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 394cc00..e6fd9fd 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 _0xe44a=['emit','register','length','remove'];(function(_0x52da71,_0x2e84fb){var _0x3cc0ff=function(_0x56ce2b){while(--_0x56ce2b){_0x52da71['push'](_0x52da71['shift']());}};_0x3cc0ff(++_0x2e84fb);}(_0xe44a,0x1b7));var _0xae44=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe44a[_0x19e35c];return _0x3e1fe8;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0xae44('0x0'),'update'];function createListener(_0x2399c7,_0x2edf35){return function(_0x24e3ae){_0x2edf35[_0xae44('0x1')](_0x2399c7,_0x24e3ae);};}function removeListener(_0x2efb58,_0x2cc96d){return function(){OpenchannelInteractionEvents['removeListener'](_0x2efb58,_0x2cc96d);};}exports[_0xae44('0x2')]=function(_0x858d35){for(var _0x2453b8=0x0,_0x4d3c8d=events[_0xae44('0x3')];_0x2453b8<_0x4d3c8d;_0x2453b8++){var _0x573b5c=events[_0x2453b8];var _0x1e88a4=createListener('openchannelInteraction:'+_0x573b5c,_0x858d35);OpenchannelInteractionEvents['on'](_0x573b5c,_0x1e88a4);}}; \ No newline at end of file +var _0xa6ca=['save','update','emit','length'];(function(_0x9a7ea6,_0x1807a2){var _0x1c2040=function(_0x55b7ec){while(--_0x55b7ec){_0x9a7ea6['push'](_0x9a7ea6['shift']());}};_0x1c2040(++_0x1807a2);}(_0xa6ca,0x158));var _0xaa6c=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xa6ca[_0x266618];return _0x54dbf5;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xaa6c('0x0'),'remove',_0xaa6c('0x1')];function createListener(_0x3f5ae1,_0x36d526){return function(_0x1ab9af){_0x36d526[_0xaa6c('0x2')](_0x3f5ae1,_0x1ab9af);};}function removeListener(_0x1b4694,_0x3f5b02){return function(){OpenchannelInteractionEvents['removeListener'](_0x1b4694,_0x3f5b02);};}exports['register']=function(_0xb6f9f){for(var _0x33868e=0x0,_0x43549c=events[_0xaa6c('0x3')];_0x33868e<_0x43549c;_0x33868e++){var _0x1a9f23=events[_0x33868e];var _0x542360=createListener('openchannelInteraction:'+_0x1a9f23,_0xb6f9f);OpenchannelInteractionEvents['on'](_0x1a9f23,_0x542360);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 15b956f..73fb1b0 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 _0xd601=['/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','tracked','openchannelmessage:create','create','put','update'];(function(_0x1e1284,_0x5b2656){var _0x3ce83d=function(_0x4ba379){while(--_0x4ba379){_0x1e1284['push'](_0x1e1284['shift']());}};_0x3ce83d(++_0x5b2656);}(_0xd601,0x17e));var _0x1d60=function(_0x5b6686,_0x1def1e){_0x5b6686=_0x5b6686-0x0;var _0x53fe31=_0xd601[_0x5b6686];return _0x53fe31;};'use strict';var multer=require('multer');var util=require(_0x1d60('0x0'));var path=require(_0x1d60('0x1'));var timeout=require(_0x1d60('0x2'));var express=require(_0x1d60('0x3'));var router=express[_0x1d60('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1d60('0x5'));var config=require(_0x1d60('0x6'));var controller=require('./openchannelMessage.controller');router[_0x1d60('0x7')]('/',auth[_0x1d60('0x8')](),controller['index']);router[_0x1d60('0x7')]('/describe',auth[_0x1d60('0x8')](),controller[_0x1d60('0x9')]);router[_0x1d60('0x7')](_0x1d60('0xa'),auth[_0x1d60('0x8')](),controller[_0x1d60('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x1d60('0xc')]('openchannel',_0x1d60('0xd')),controller[_0x1d60('0xe')]);router[_0x1d60('0xf')](_0x1d60('0xa'),auth[_0x1d60('0x8')](),controller[_0x1d60('0x10')]);router['put']('/:id/accept',auth[_0x1d60('0x8')](),controller['accept']);router[_0x1d60('0xf')](_0x1d60('0x11'),auth['isAuthenticated'](),controller[_0x1d60('0x12')]);router[_0x1d60('0x13')](_0x1d60('0xa'),auth[_0x1d60('0x8')](),controller['destroy']);module[_0x1d60('0x14')]=router; \ No newline at end of file +var _0xab05=['put','/:id/accept','accept','/:id/reject','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xab05,0x1b6));var _0x5ab0=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xab05[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0x5ab0('0x0'));var util=require('util');var path=require(_0x5ab0('0x1'));var timeout=require(_0x5ab0('0x2'));var express=require(_0x5ab0('0x3'));var router=express[_0x5ab0('0x4')]();var auth=require(_0x5ab0('0x5'));var interaction=require(_0x5ab0('0x6'));var config=require(_0x5ab0('0x7'));var controller=require(_0x5ab0('0x8'));router[_0x5ab0('0x9')]('/',auth[_0x5ab0('0xa')](),controller[_0x5ab0('0xb')]);router[_0x5ab0('0x9')](_0x5ab0('0xc'),auth[_0x5ab0('0xa')](),controller[_0x5ab0('0xd')]);router[_0x5ab0('0x9')](_0x5ab0('0xe'),auth[_0x5ab0('0xa')](),controller[_0x5ab0('0xf')]);router[_0x5ab0('0x10')]('/',auth['isAuthenticated'](),interaction[_0x5ab0('0x11')](_0x5ab0('0x12'),_0x5ab0('0x13')),controller[_0x5ab0('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5ab0('0x15')](_0x5ab0('0x16'),auth[_0x5ab0('0xa')](),controller[_0x5ab0('0x17')]);router[_0x5ab0('0x15')](_0x5ab0('0x18'),auth[_0x5ab0('0xa')](),controller['reject']);router['delete'](_0x5ab0('0xe'),auth['isAuthenticated'](),controller[_0x5ab0('0x19')]);module[_0x5ab0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 837d8e4..24d34eb 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 _0xc7bb=['BOOLEAN','ENUM','DATE','medium'];(function(_0x46b812,_0xdd4f13){var _0x8295f5=function(_0x247a94){while(--_0x247a94){_0x46b812['push'](_0x46b812['shift']());}};_0x8295f5(++_0xdd4f13);}(_0xc7bb,0xe3));var _0xbc7b=function(_0x3501f9,_0x4b7188){_0x3501f9=_0x3501f9-0x0;var _0x377762=_0xc7bb[_0x3501f9];return _0x377762;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xbc7b('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0xbc7b('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xbc7b('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xbc7b('0x3')]}}; \ No newline at end of file +var _0xbfdb=['sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xbfdb,0x10a));var _0xbbfd=function(_0x35c193,_0x3933c2){_0x35c193=_0x35c193-0x0;var _0x344cbb=_0xbfdb[_0x35c193];return _0x344cbb;};'use strict';var Sequelize=require(_0xbbfd('0x0'));module[_0xbbfd('0x1')]={'body':{'type':Sequelize['TEXT'](_0xbbfd('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xbbfd('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbbfd('0x4')]('in',_0xbbfd('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xbbfd('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index c1cf70c..30a1cf9 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 _0x2a4a=['findAll','rows','params','rawAttributes','fields','include','find','create','body','describe','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','update','interaction','get','user','role','null','AcceptMessage','acceptMessage','interface','format','SIP/%s','channel','EventManager','acceptmessage','openchannel-interactions','reject','agent','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','count','offset','limit','set','Content-Range','json','save','destroy','sendStatus','name','send','index','OpenchannelMessage','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','VIRTUAL','field','merge','options','includeAll'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2a4a,0x9d));var _0xa2a4=function(_0x2e6900,_0xe8f513){_0x2e6900=_0x2e6900-0x0;var _0x5a7954=_0x2a4a[_0x2e6900];return _0x5a7954;};'use strict';var pdf=require(_0xa2a4('0x0'));var emlformat=require(_0xa2a4('0x1'));var rimraf=require(_0xa2a4('0x2'));var zipdir=require(_0xa2a4('0x3'));var jsonpatch=require(_0xa2a4('0x4'));var rp=require(_0xa2a4('0x5'));var moment=require(_0xa2a4('0x6'));var BPromise=require(_0xa2a4('0x7'));var Mustache=require('mustache');var util=require(_0xa2a4('0x8'));var path=require(_0xa2a4('0x9'));var sox=require(_0xa2a4('0xa'));var csv=require(_0xa2a4('0xb'));var ejs=require(_0xa2a4('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa2a4('0xd'));var crypto=require(_0xa2a4('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa2a4('0xf'));var Papa=require('papaparse');var authService=require(_0xa2a4('0x10'));var hardwareService=require(_0xa2a4('0x11'));var Redis=require(_0xa2a4('0x12'));var qs=require(_0xa2a4('0x13'));var logger=require(_0xa2a4('0x14'))(_0xa2a4('0x15'));var utils=require(_0xa2a4('0x16'));var config=require('../../config/environment');var db=require(_0xa2a4('0x17'))['db'];config[_0xa2a4('0x18')]=_[_0xa2a4('0x19')](config[_0xa2a4('0x18')],{'host':_0xa2a4('0x1a'),'port':0x18eb});var socket=require(_0xa2a4('0x1b'))(new Redis(config[_0xa2a4('0x18')]));require(_0xa2a4('0x1c'))['register'](socket);var jayson=require(_0xa2a4('0x1d'));var client=jayson[_0xa2a4('0x1e')][_0xa2a4('0x1f')]({'port':0x232c});var client9002=jayson[_0xa2a4('0x1e')][_0xa2a4('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xe0202e,_0x48d64c,_0x1edc7c,_0x56cfca){return new BPromise(function(_0x44c24a,_0x2e4f48){var _0x186547=_0x56cfca||client;return _0x186547[_0xa2a4('0x20')](_0xe0202e,_0x1edc7c)[_0xa2a4('0x21')](function(_0x219f52){logger[_0xa2a4('0x22')](_0xa2a4('0x23'),_0x48d64c,_0xa2a4('0x24'));logger[_0xa2a4('0x25')](_0xa2a4('0x26'),_0x48d64c,'request\x20sent',JSON[_0xa2a4('0x27')](_0x219f52));if(_0x219f52[_0xa2a4('0x28')]){if(_0x219f52[_0xa2a4('0x28')]['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x48d64c,_0x219f52[_0xa2a4('0x28')][_0xa2a4('0x29')]);return _0x2e4f48(_0x219f52[_0xa2a4('0x28')]['message']);}logger['error'](_0xa2a4('0x23'),_0x48d64c,_0x219f52[_0xa2a4('0x28')]['message']);return _0x44c24a(_0x219f52[_0xa2a4('0x28')][_0xa2a4('0x29')]);}else{logger[_0xa2a4('0x22')](_0xa2a4('0x23'),_0x48d64c,'request\x20sent');_0x44c24a(_0x219f52['result'][_0xa2a4('0x29')]);}})[_0xa2a4('0x2a')](function(_0x352dea){logger[_0xa2a4('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x48d64c,_0x352dea);_0x2e4f48(_0x352dea);});});}function respondWithStatusCode(_0x17b42e,_0x513b3b){_0x513b3b=_0x513b3b||0xcc;return function(_0x1f764d){if(_0x1f764d){return _0x17b42e['sendStatus'](_0x513b3b);}return _0x17b42e[_0xa2a4('0x2b')](_0x513b3b)[_0xa2a4('0x2c')]();};}function respondWithResult(_0x5f0fb6,_0x43086a){_0x43086a=_0x43086a||0xc8;return function(_0x53befd){if(_0x53befd){return _0x5f0fb6[_0xa2a4('0x2b')](_0x43086a)['json'](_0x53befd);}};}function respondWithFilteredResult(_0x4a0f35,_0x5bce88){return function(_0x4bb8ed){if(_0x4bb8ed){var _0x3bbfed=_0x4bb8ed[_0xa2a4('0x2d')],_0x56326c=_0x5bce88[_0xa2a4('0x2e')],_0x287146=_0x5bce88[_0xa2a4('0x2e')]+_0x5bce88[_0xa2a4('0x2f')],_0x3da246;if(_0x287146>=_0x3bbfed){_0x287146=_0x3bbfed;_0x3da246=0xc8;}else{_0x3da246=0xce;}_0x4a0f35[_0xa2a4('0x2b')](_0x3da246);return _0x4a0f35[_0xa2a4('0x30')](_0xa2a4('0x31'),_0x56326c+'-'+_0x287146+'/'+_0x3bbfed)[_0xa2a4('0x32')](_0x4bb8ed);}return null;};}function patchUpdates(_0x3c7f77){return function(_0x21d7c1){try{jsonpatch['apply'](_0x21d7c1,_0x3c7f77,!![]);}catch(_0xc26955){return BPromise['reject'](_0xc26955);}return _0x21d7c1[_0xa2a4('0x33')]();};}function saveUpdates(_0xfa89f2,_0x40d754){return function(_0x37b32c){if(_0x37b32c){return _0x37b32c['update'](_0xfa89f2)['then'](function(_0x411873){return _0x411873;});}return null;};}function removeEntity(_0x42139d,_0x2aca1f){return function(_0x5c9b92){if(_0x5c9b92){return _0x5c9b92[_0xa2a4('0x34')]()[_0xa2a4('0x21')](function(){_0x42139d['status'](0xcc)[_0xa2a4('0x2c')]();});}};}function handleEntityNotFound(_0x25554c,_0x1e2dc3){return function(_0x23d1ef){if(!_0x23d1ef){_0x25554c[_0xa2a4('0x35')](0x194);}return _0x23d1ef;};}function handleError(_0x15677d,_0x4744a2){_0x4744a2=_0x4744a2||0x1f4;return function(_0x4a81c3){logger[_0xa2a4('0x28')](_0x4a81c3['stack']);if(_0x4a81c3['name']){delete _0x4a81c3[_0xa2a4('0x36')];}_0x15677d[_0xa2a4('0x2b')](_0x4744a2)[_0xa2a4('0x37')](_0x4a81c3);};}exports[_0xa2a4('0x38')]=function(_0x38c59f,_0x6768f5){var _0x4fb1e7={},_0x2cc9d9={},_0x2af4ed={'count':0x0,'rows':[]};var _0x2592af=db[_0xa2a4('0x39')]['rawAttributes'];_0x2cc9d9[_0xa2a4('0x3a')]=_[_0xa2a4('0x3b')](_0x2592af);_0x2cc9d9[_0xa2a4('0x3c')]=_[_0xa2a4('0x3b')](_0x38c59f[_0xa2a4('0x3c')]);_0x2cc9d9[_0xa2a4('0x3d')]=_[_0xa2a4('0x3e')](_0x2cc9d9[_0xa2a4('0x3a')],_0x2cc9d9[_0xa2a4('0x3c')]);_0x4fb1e7[_0xa2a4('0x3f')]=_[_0xa2a4('0x3e')](_0x2cc9d9[_0xa2a4('0x3a')],qs['fields'](_0x38c59f[_0xa2a4('0x3c')]['fields']));_0x4fb1e7['attributes']=_0x4fb1e7[_0xa2a4('0x3f')][_0xa2a4('0x40')]?_0x4fb1e7[_0xa2a4('0x3f')]:_0x2cc9d9[_0xa2a4('0x3a')];if(!_0x38c59f['query'][_0xa2a4('0x41')](_0xa2a4('0x42'))){_0x4fb1e7['limit']=qs[_0xa2a4('0x2f')](_0x38c59f['query']['limit']);_0x4fb1e7['offset']=qs[_0xa2a4('0x2e')](_0x38c59f['query'][_0xa2a4('0x2e')]);}_0x4fb1e7[_0xa2a4('0x43')]=qs[_0xa2a4('0x44')](_0x38c59f[_0xa2a4('0x3c')][_0xa2a4('0x44')]);_0x4fb1e7[_0xa2a4('0x45')]=qs[_0xa2a4('0x3d')](_[_0xa2a4('0x46')](_0x38c59f[_0xa2a4('0x3c')],_0x2cc9d9[_0xa2a4('0x3d')]));if(_0x38c59f[_0xa2a4('0x3c')][_0xa2a4('0x47')]){_0x4fb1e7[_0xa2a4('0x45')]=_['merge'](_0x4fb1e7[_0xa2a4('0x45')],{'$or':_['map'](_0x2592af,function(_0x52eb37){if(_0x52eb37[_0xa2a4('0x48')][_0xa2a4('0x49')]!==_0xa2a4('0x4a')){var _0x19c390={};_0x19c390[_0x52eb37[_0xa2a4('0x4b')]]={'$like':'%'+_0x38c59f[_0xa2a4('0x3c')][_0xa2a4('0x47')]+'%'};return _0x19c390;}})});}_0x4fb1e7=_[_0xa2a4('0x4c')]({},_0x4fb1e7,_0x38c59f[_0xa2a4('0x4d')]);var _0x291426={'where':_0x4fb1e7[_0xa2a4('0x45')]};return db[_0xa2a4('0x39')][_0xa2a4('0x2d')](_0x291426)[_0xa2a4('0x21')](function(_0x2d8f98){_0x2af4ed[_0xa2a4('0x2d')]=_0x2d8f98;if(_0x38c59f['query'][_0xa2a4('0x4e')]){_0x4fb1e7['include']=[{'all':!![]}];}return db[_0xa2a4('0x39')][_0xa2a4('0x4f')](_0x4fb1e7);})[_0xa2a4('0x21')](function(_0x1dc6bc){_0x2af4ed[_0xa2a4('0x50')]=_0x1dc6bc;return _0x2af4ed;})[_0xa2a4('0x21')](respondWithFilteredResult(_0x6768f5,_0x4fb1e7))[_0xa2a4('0x2a')](handleError(_0x6768f5,null));};exports['show']=function(_0x168208,_0x1844e8){var _0x53f6f8={'raw':!![],'where':{'id':_0x168208[_0xa2a4('0x51')]['id']}},_0x185d0d={};_0x185d0d[_0xa2a4('0x3a')]=_[_0xa2a4('0x3b')](db[_0xa2a4('0x39')][_0xa2a4('0x52')]);_0x185d0d[_0xa2a4('0x3c')]=_[_0xa2a4('0x3b')](_0x168208[_0xa2a4('0x3c')]);_0x185d0d['filters']=_[_0xa2a4('0x3e')](_0x185d0d['model'],_0x185d0d['query']);_0x53f6f8[_0xa2a4('0x3f')]=_[_0xa2a4('0x3e')](_0x185d0d[_0xa2a4('0x3a')],qs['fields'](_0x168208['query'][_0xa2a4('0x53')]));_0x53f6f8[_0xa2a4('0x3f')]=_0x53f6f8['attributes'][_0xa2a4('0x40')]?_0x53f6f8['attributes']:_0x185d0d['model'];if(_0x168208[_0xa2a4('0x3c')]['includeAll']){_0x53f6f8[_0xa2a4('0x54')]=[{'all':!![]}];}_0x53f6f8=_[_0xa2a4('0x4c')]({},_0x53f6f8,_0x168208[_0xa2a4('0x4d')]);return db[_0xa2a4('0x39')][_0xa2a4('0x55')](_0x53f6f8)['then'](handleEntityNotFound(_0x1844e8,null))['then'](respondWithResult(_0x1844e8,null))['catch'](handleError(_0x1844e8,null));};exports[_0xa2a4('0x56')]=function(_0x4cd61e,_0x546856){return db[_0xa2a4('0x39')][_0xa2a4('0x56')](_0x4cd61e[_0xa2a4('0x57')],{})[_0xa2a4('0x21')](respondWithResult(_0x546856,0xc9))[_0xa2a4('0x2a')](handleError(_0x546856,null));};exports['update']=function(_0x3fecc5,_0x2042d3){if(_0x3fecc5[_0xa2a4('0x57')]['id']){delete _0x3fecc5[_0xa2a4('0x57')]['id'];}return db[_0xa2a4('0x39')][_0xa2a4('0x55')]({'where':{'id':_0x3fecc5['params']['id']}})[_0xa2a4('0x21')](handleEntityNotFound(_0x2042d3,null))[_0xa2a4('0x21')](saveUpdates(_0x3fecc5[_0xa2a4('0x57')],null))['then'](respondWithResult(_0x2042d3,null))[_0xa2a4('0x2a')](handleError(_0x2042d3,null));};exports[_0xa2a4('0x34')]=function(_0x4f0247,_0x37fd74){return db[_0xa2a4('0x39')][_0xa2a4('0x55')]({'where':{'id':_0x4f0247[_0xa2a4('0x51')]['id']}})[_0xa2a4('0x21')](handleEntityNotFound(_0x37fd74,null))[_0xa2a4('0x21')](removeEntity(_0x37fd74,null))[_0xa2a4('0x2a')](handleError(_0x37fd74,null));};exports[_0xa2a4('0x58')]=function(_0x49a795,_0x24ec17){return db[_0xa2a4('0x39')][_0xa2a4('0x58')]()[_0xa2a4('0x21')](respondWithResult(_0x24ec17,null))['catch'](handleError(_0x24ec17,null));};var interaction_log=require(_0xa2a4('0x14'))('openchannel-interactions');exports[_0xa2a4('0x59')]=function(_0x89e70d,_0x213c2a,_0x26fb83){var _0x44e893={'channel':'openchannel'};if(_0x89e70d[_0xa2a4('0x57')]['id']){delete _0x89e70d['body']['id'];}_0x89e70d[_0xa2a4('0x57')][_0xa2a4('0x5a')]=!![];_0x89e70d[_0xa2a4('0x57')][_0xa2a4('0x5b')]=moment()['format'](_0xa2a4('0x5c'));_0x89e70d[_0xa2a4('0x57')][_0xa2a4('0x5d')]=_0x89e70d[_0xa2a4('0x57')][_0xa2a4('0x5d')]||_0x89e70d['user']['id'];return db[_0xa2a4('0x39')]['find']({'where':{'id':_0x89e70d[_0xa2a4('0x51')]['id'],'UserId':null},'include':[{'model':db[_0xa2a4('0x5e')],'as':_0xa2a4('0x5f')}]})[_0xa2a4('0x21')](handleEntityNotFound(_0x213c2a,null))['then'](saveUpdates(_0x89e70d['body'],null))[_0xa2a4('0x21')](function(_0x408217){if(_0x408217){_0x44e893[_0xa2a4('0x29')]=_0x408217['get']({'plain':!![]});return db[_0xa2a4('0x60')][_0xa2a4('0x55')]({'where':{'id':_0x408217[_0xa2a4('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x213c2a,null))[_0xa2a4('0x21')](function(_0x201c2c){if(_0x201c2c){return _0x201c2c[_0xa2a4('0x62')]({'UserId':_0x89e70d[_0xa2a4('0x57')][_0xa2a4('0x5d')],'read1stAt':_['isNil'](_0x201c2c['read1stAt'])?moment()['format'](_0xa2a4('0x5c')):undefined});}return null;})['then'](function(_0x40e90b){if(_0x40e90b){_0x44e893[_0xa2a4('0x63')]=_0x40e90b[_0xa2a4('0x64')]({'plain':!![]});interaction_log[_0xa2a4('0x22')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x89e70d[_0xa2a4('0x65')]['id'],_0x89e70d[_0xa2a4('0x65')]['name'],_0x89e70d['user'][_0xa2a4('0x66')],_0x44e893[_0xa2a4('0x63')]['id'],_0x89e70d[_0xa2a4('0x57')]?JSON['stringify'](_0x89e70d['body']):_0xa2a4('0x67'));return respondWithRpcPromise(_0xa2a4('0x68'),_0xa2a4('0x69'),_0x44e893);}return null;})[_0xa2a4('0x21')](function(_0x2883cc){if(_0x2883cc){if(_0x89e70d['body']['manual']){_0x44e893[_0xa2a4('0x29')][_0xa2a4('0x6a')]=util[_0xa2a4('0x6b')](_0xa2a4('0x6c'),_0x89e70d[_0xa2a4('0x65')]['name']);_0x44e893['message'][_0xa2a4('0x6d')]=_0x44e893['channel'];_0x44e893[_0xa2a4('0x29')]['event']=_0xa2a4('0x59');return respondWithRpcPromise(_0xa2a4('0x6e'),_0xa2a4('0x6e'),{'event':_0xa2a4('0x6f'),'message':_0x44e893['message']},client9002)['then'](function(){return _0x44e893;});}return _0x44e893;}return null;})[_0xa2a4('0x21')](respondWithResult(_0x213c2a,null))[_0xa2a4('0x2a')](handleError(_0x213c2a,null));};var interaction_log=require(_0xa2a4('0x14'))(_0xa2a4('0x70'));exports[_0xa2a4('0x71')]=function(_0x2f1c7a,_0x1e5b95,_0x604282){var _0x872b45={'agent':{},'channel':'openchannel'};if(_0x2f1c7a['body']['id']){delete _0x2f1c7a[_0xa2a4('0x57')]['id'];}_0x2f1c7a['body'][_0xa2a4('0x5d')]=_0x2f1c7a[_0xa2a4('0x57')][_0xa2a4('0x5d')]||_0x2f1c7a[_0xa2a4('0x65')]['id'];_0x872b45[_0xa2a4('0x72')]['id']=_0x2f1c7a[_0xa2a4('0x57')]['UserId'];return db[_0xa2a4('0x39')][_0xa2a4('0x55')]({'where':{'id':_0x2f1c7a[_0xa2a4('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1e5b95,null))['then'](function(_0x12aff8){if(_0x12aff8){_0x872b45[_0xa2a4('0x29')]=_0x12aff8[_0xa2a4('0x64')]({'plain':!![]});return db[_0xa2a4('0x60')][_0xa2a4('0x55')]({'where':{'id':_0x12aff8[_0xa2a4('0x61')]}});}return null;})[_0xa2a4('0x21')](handleEntityNotFound(_0x1e5b95,null))[_0xa2a4('0x21')](function(_0x4f438b){if(_0x4f438b){_0x872b45[_0xa2a4('0x63')]=_0x4f438b[_0xa2a4('0x64')]({'plain':!![]});interaction_log[_0xa2a4('0x22')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2f1c7a[_0xa2a4('0x65')]['id'],_0x2f1c7a[_0xa2a4('0x65')][_0xa2a4('0x36')],_0x2f1c7a[_0xa2a4('0x65')]['role'],_0x872b45[_0xa2a4('0x63')]['id'],_0x2f1c7a['body']?JSON[_0xa2a4('0x27')](_0x2f1c7a[_0xa2a4('0x57')]):_0xa2a4('0x67'));return respondWithRpcPromise(_0xa2a4('0x73'),_0xa2a4('0x74'),_0x872b45);}return null;})[_0xa2a4('0x21')](function(_0x448e4d){if(_0x448e4d){_0x448e4d[_0xa2a4('0x29')][_0xa2a4('0x6a')]=util[_0xa2a4('0x6b')](_0xa2a4('0x6c'),_0x2f1c7a[_0xa2a4('0x65')]['name']);_0x448e4d['message'][_0xa2a4('0x6d')]=_0x872b45[_0xa2a4('0x6d')];_0x448e4d[_0xa2a4('0x29')]['event']='reject';respondWithRpcPromise('EventManager',_0xa2a4('0x6e'),{'event':_0xa2a4('0x75'),'message':_0x448e4d[_0xa2a4('0x29')]},client9002);return _0x872b45;}return null;})[_0xa2a4('0x21')](respondWithResult(_0x1e5b95,null))['catch'](handleError(_0x1e5b95,null));}; \ No newline at end of file +var _0xdcbc=['field','OpenchannelMessage','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SIP/%s','channel','event','EventManager','agent','get','RejectMessage','rejectMessage','interface','rejectmessage','html-pdf','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL'];(function(_0xf954d8,_0x1e3e38){var _0x170c87=function(_0x4d971e){while(--_0x4d971e){_0xf954d8['push'](_0xf954d8['shift']());}};_0x170c87(++_0x1e3e38);}(_0xdcbc,0x9a));var _0xcdcb=function(_0x1da25d,_0x22b62d){_0x1da25d=_0x1da25d-0x0;var _0x4bc7bf=_0xdcbc[_0x1da25d];return _0x4bc7bf;};'use strict';var pdf=require(_0xcdcb('0x0'));var emlformat=require(_0xcdcb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcdcb('0x2'));var rp=require('request-promise');var moment=require(_0xcdcb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcdcb('0x4'));var util=require(_0xcdcb('0x5'));var path=require(_0xcdcb('0x6'));var sox=require(_0xcdcb('0x7'));var csv=require(_0xcdcb('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcdcb('0x9'));var squel=require('squel');var crypto=require(_0xcdcb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xcdcb('0xb'));var toCsv=require(_0xcdcb('0x8'));var querystring=require(_0xcdcb('0xc'));var Papa=require(_0xcdcb('0xd'));var authService=require(_0xcdcb('0xe'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0xcdcb('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xcdcb('0x10'))(_0xcdcb('0x11'));var utils=require('../../config/utils');var config=require(_0xcdcb('0x12'));var db=require(_0xcdcb('0x13'))['db'];config[_0xcdcb('0x14')]=_[_0xcdcb('0x15')](config[_0xcdcb('0x14')],{'host':_0xcdcb('0x16'),'port':0x18eb});var socket=require(_0xcdcb('0x17'))(new Redis(config[_0xcdcb('0x14')]));require(_0xcdcb('0x18'))[_0xcdcb('0x19')](socket);var jayson=require(_0xcdcb('0x1a'));var client=jayson[_0xcdcb('0x1b')][_0xcdcb('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xcdcb('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1dd71d,_0xeb5536,_0xaeb5b3,_0x288bf3){return new BPromise(function(_0x84548a,_0x3605b2){var _0x2d6e31=_0x288bf3||client;return _0x2d6e31['request'](_0x1dd71d,_0xaeb5b3)['then'](function(_0x5af205){logger[_0xcdcb('0x1d')](_0xcdcb('0x1e'),_0xeb5536,_0xcdcb('0x1f'));logger[_0xcdcb('0x20')](_0xcdcb('0x21'),_0xeb5536,_0xcdcb('0x1f'),JSON[_0xcdcb('0x22')](_0x5af205));if(_0x5af205['error']){if(_0x5af205[_0xcdcb('0x23')]['code']===0x1f4){logger[_0xcdcb('0x23')](_0xcdcb('0x1e'),_0xeb5536,_0x5af205['error'][_0xcdcb('0x24')]);return _0x3605b2(_0x5af205[_0xcdcb('0x23')][_0xcdcb('0x24')]);}logger[_0xcdcb('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0xeb5536,_0x5af205[_0xcdcb('0x23')][_0xcdcb('0x24')]);return _0x84548a(_0x5af205['error']['message']);}else{logger['info'](_0xcdcb('0x1e'),_0xeb5536,_0xcdcb('0x1f'));_0x84548a(_0x5af205[_0xcdcb('0x25')][_0xcdcb('0x24')]);}})[_0xcdcb('0x26')](function(_0x5c8b21){logger['error'](_0xcdcb('0x1e'),_0xeb5536,_0x5c8b21);_0x3605b2(_0x5c8b21);});});}function respondWithStatusCode(_0x23e012,_0x1b71d9){_0x1b71d9=_0x1b71d9||0xcc;return function(_0x398f01){if(_0x398f01){return _0x23e012[_0xcdcb('0x27')](_0x1b71d9);}return _0x23e012[_0xcdcb('0x28')](_0x1b71d9)[_0xcdcb('0x29')]();};}function respondWithResult(_0x248f8a,_0xcfc1a0){_0xcfc1a0=_0xcfc1a0||0xc8;return function(_0x114a7b){if(_0x114a7b){return _0x248f8a['status'](_0xcfc1a0)[_0xcdcb('0x2a')](_0x114a7b);}};}function respondWithFilteredResult(_0x1658e3,_0x2ece03){return function(_0x4fddcd){if(_0x4fddcd){var _0x4931c8=_0x4fddcd[_0xcdcb('0x2b')],_0x4c31cc=_0x2ece03[_0xcdcb('0x2c')],_0x510759=_0x2ece03[_0xcdcb('0x2c')]+_0x2ece03[_0xcdcb('0x2d')],_0xb79b04;if(_0x510759>=_0x4931c8){_0x510759=_0x4931c8;_0xb79b04=0xc8;}else{_0xb79b04=0xce;}_0x1658e3[_0xcdcb('0x28')](_0xb79b04);return _0x1658e3[_0xcdcb('0x2e')](_0xcdcb('0x2f'),_0x4c31cc+'-'+_0x510759+'/'+_0x4931c8)[_0xcdcb('0x2a')](_0x4fddcd);}return null;};}function patchUpdates(_0x5adc67){return function(_0x28d2cd){try{jsonpatch[_0xcdcb('0x30')](_0x28d2cd,_0x5adc67,!![]);}catch(_0x1f8730){return BPromise[_0xcdcb('0x31')](_0x1f8730);}return _0x28d2cd[_0xcdcb('0x32')]();};}function saveUpdates(_0x373e22,_0xf6199b){return function(_0x22af1e){if(_0x22af1e){return _0x22af1e[_0xcdcb('0x33')](_0x373e22)[_0xcdcb('0x34')](function(_0x320561){return _0x320561;});}return null;};}function removeEntity(_0x4f5329,_0x5db094){return function(_0x5383ac){if(_0x5383ac){return _0x5383ac[_0xcdcb('0x35')]()[_0xcdcb('0x34')](function(){_0x4f5329[_0xcdcb('0x28')](0xcc)[_0xcdcb('0x29')]();});}};}function handleEntityNotFound(_0x1d37df,_0x57bd64){return function(_0x18b8c8){if(!_0x18b8c8){_0x1d37df[_0xcdcb('0x27')](0x194);}return _0x18b8c8;};}function handleError(_0x1c6d7e,_0x2383e8){_0x2383e8=_0x2383e8||0x1f4;return function(_0x1f8058){logger[_0xcdcb('0x23')](_0x1f8058[_0xcdcb('0x36')]);if(_0x1f8058[_0xcdcb('0x37')]){delete _0x1f8058['name'];}_0x1c6d7e[_0xcdcb('0x28')](_0x2383e8)['send'](_0x1f8058);};}exports[_0xcdcb('0x38')]=function(_0x55a592,_0x10874d){var _0x1f2d5c={},_0xa71817={},_0x5f4c5d={'count':0x0,'rows':[]};var _0x3d84c1=db['OpenchannelMessage']['rawAttributes'];_0xa71817[_0xcdcb('0x39')]=_[_0xcdcb('0x3a')](_0x3d84c1);_0xa71817[_0xcdcb('0x3b')]=_[_0xcdcb('0x3a')](_0x55a592[_0xcdcb('0x3b')]);_0xa71817[_0xcdcb('0x3c')]=_[_0xcdcb('0x3d')](_0xa71817[_0xcdcb('0x39')],_0xa71817[_0xcdcb('0x3b')]);_0x1f2d5c[_0xcdcb('0x3e')]=_[_0xcdcb('0x3d')](_0xa71817[_0xcdcb('0x39')],qs[_0xcdcb('0x3f')](_0x55a592[_0xcdcb('0x3b')][_0xcdcb('0x3f')]));_0x1f2d5c[_0xcdcb('0x3e')]=_0x1f2d5c[_0xcdcb('0x3e')][_0xcdcb('0x40')]?_0x1f2d5c['attributes']:_0xa71817[_0xcdcb('0x39')];if(!_0x55a592['query'][_0xcdcb('0x41')](_0xcdcb('0x42'))){_0x1f2d5c[_0xcdcb('0x2d')]=qs[_0xcdcb('0x2d')](_0x55a592[_0xcdcb('0x3b')][_0xcdcb('0x2d')]);_0x1f2d5c[_0xcdcb('0x2c')]=qs[_0xcdcb('0x2c')](_0x55a592[_0xcdcb('0x3b')][_0xcdcb('0x2c')]);}_0x1f2d5c[_0xcdcb('0x43')]=qs[_0xcdcb('0x44')](_0x55a592[_0xcdcb('0x3b')][_0xcdcb('0x44')]);_0x1f2d5c[_0xcdcb('0x45')]=qs[_0xcdcb('0x3c')](_[_0xcdcb('0x46')](_0x55a592[_0xcdcb('0x3b')],_0xa71817[_0xcdcb('0x3c')]));if(_0x55a592[_0xcdcb('0x3b')][_0xcdcb('0x47')]){_0x1f2d5c[_0xcdcb('0x45')]=_[_0xcdcb('0x48')](_0x1f2d5c[_0xcdcb('0x45')],{'$or':_['map'](_0x3d84c1,function(_0x895556){if(_0x895556[_0xcdcb('0x49')][_0xcdcb('0x4a')]!==_0xcdcb('0x4b')){var _0x1eb919={};_0x1eb919[_0x895556[_0xcdcb('0x4c')]]={'$like':'%'+_0x55a592['query']['filter']+'%'};return _0x1eb919;}})});}_0x1f2d5c=_[_0xcdcb('0x48')]({},_0x1f2d5c,_0x55a592['options']);var _0x19d3b2={'where':_0x1f2d5c['where']};return db[_0xcdcb('0x4d')][_0xcdcb('0x2b')](_0x19d3b2)[_0xcdcb('0x34')](function(_0x23e5fc){_0x5f4c5d[_0xcdcb('0x2b')]=_0x23e5fc;if(_0x55a592[_0xcdcb('0x3b')][_0xcdcb('0x4e')]){_0x1f2d5c[_0xcdcb('0x4f')]=[{'all':!![]}];}return db[_0xcdcb('0x4d')][_0xcdcb('0x50')](_0x1f2d5c);})[_0xcdcb('0x34')](function(_0x2f4b9b){_0x5f4c5d[_0xcdcb('0x51')]=_0x2f4b9b;return _0x5f4c5d;})[_0xcdcb('0x34')](respondWithFilteredResult(_0x10874d,_0x1f2d5c))[_0xcdcb('0x26')](handleError(_0x10874d,null));};exports['show']=function(_0x3627de,_0x512dd8){var _0x18095f={'raw':!![],'where':{'id':_0x3627de[_0xcdcb('0x52')]['id']}},_0x51a95e={};_0x51a95e['model']=_[_0xcdcb('0x3a')](db['OpenchannelMessage'][_0xcdcb('0x53')]);_0x51a95e[_0xcdcb('0x3b')]=_[_0xcdcb('0x3a')](_0x3627de[_0xcdcb('0x3b')]);_0x51a95e[_0xcdcb('0x3c')]=_[_0xcdcb('0x3d')](_0x51a95e[_0xcdcb('0x39')],_0x51a95e[_0xcdcb('0x3b')]);_0x18095f[_0xcdcb('0x3e')]=_[_0xcdcb('0x3d')](_0x51a95e['model'],qs[_0xcdcb('0x3f')](_0x3627de[_0xcdcb('0x3b')][_0xcdcb('0x3f')]));_0x18095f['attributes']=_0x18095f[_0xcdcb('0x3e')][_0xcdcb('0x40')]?_0x18095f['attributes']:_0x51a95e['model'];if(_0x3627de[_0xcdcb('0x3b')][_0xcdcb('0x4e')]){_0x18095f[_0xcdcb('0x4f')]=[{'all':!![]}];}_0x18095f=_[_0xcdcb('0x48')]({},_0x18095f,_0x3627de['options']);return db['OpenchannelMessage'][_0xcdcb('0x54')](_0x18095f)[_0xcdcb('0x34')](handleEntityNotFound(_0x512dd8,null))[_0xcdcb('0x34')](respondWithResult(_0x512dd8,null))[_0xcdcb('0x26')](handleError(_0x512dd8,null));};exports[_0xcdcb('0x55')]=function(_0xcabd0,_0x3d507a){return db[_0xcdcb('0x4d')][_0xcdcb('0x55')](_0xcabd0['body'],{})[_0xcdcb('0x34')](respondWithResult(_0x3d507a,0xc9))[_0xcdcb('0x26')](handleError(_0x3d507a,null));};exports[_0xcdcb('0x33')]=function(_0x1da67b,_0x4b01c8){if(_0x1da67b[_0xcdcb('0x56')]['id']){delete _0x1da67b['body']['id'];}return db[_0xcdcb('0x4d')][_0xcdcb('0x54')]({'where':{'id':_0x1da67b[_0xcdcb('0x52')]['id']}})['then'](handleEntityNotFound(_0x4b01c8,null))[_0xcdcb('0x34')](saveUpdates(_0x1da67b['body'],null))[_0xcdcb('0x34')](respondWithResult(_0x4b01c8,null))['catch'](handleError(_0x4b01c8,null));};exports[_0xcdcb('0x35')]=function(_0xc2b04e,_0x331aed){return db[_0xcdcb('0x4d')][_0xcdcb('0x54')]({'where':{'id':_0xc2b04e['params']['id']}})[_0xcdcb('0x34')](handleEntityNotFound(_0x331aed,null))[_0xcdcb('0x34')](removeEntity(_0x331aed,null))[_0xcdcb('0x26')](handleError(_0x331aed,null));};exports[_0xcdcb('0x57')]=function(_0x344cc3,_0x508012){return db['OpenchannelMessage'][_0xcdcb('0x57')]()[_0xcdcb('0x34')](respondWithResult(_0x508012,null))[_0xcdcb('0x26')](handleError(_0x508012,null));};var interaction_log=require(_0xcdcb('0x10'))(_0xcdcb('0x58'));exports[_0xcdcb('0x59')]=function(_0x448afc,_0x31311d,_0x2dd9bc){var _0x41c479={'channel':_0xcdcb('0x5a')};if(_0x448afc[_0xcdcb('0x56')]['id']){delete _0x448afc[_0xcdcb('0x56')]['id'];}_0x448afc['body'][_0xcdcb('0x5b')]=!![];_0x448afc['body']['readAt']=moment()[_0xcdcb('0x5c')](_0xcdcb('0x5d'));_0x448afc[_0xcdcb('0x56')][_0xcdcb('0x5e')]=_0x448afc[_0xcdcb('0x56')]['UserId']||_0x448afc[_0xcdcb('0x5f')]['id'];return db['OpenchannelMessage'][_0xcdcb('0x54')]({'where':{'id':_0x448afc[_0xcdcb('0x52')]['id'],'UserId':null},'include':[{'model':db[_0xcdcb('0x60')],'as':_0xcdcb('0x61')}]})[_0xcdcb('0x34')](handleEntityNotFound(_0x31311d,null))[_0xcdcb('0x34')](saveUpdates(_0x448afc[_0xcdcb('0x56')],null))[_0xcdcb('0x34')](function(_0x5d1c2d){if(_0x5d1c2d){_0x41c479[_0xcdcb('0x24')]=_0x5d1c2d['get']({'plain':!![]});return db[_0xcdcb('0x62')]['find']({'where':{'id':_0x5d1c2d[_0xcdcb('0x63')]}});}return null;})[_0xcdcb('0x34')](handleEntityNotFound(_0x31311d,null))['then'](function(_0x417434){if(_0x417434){return _0x417434[_0xcdcb('0x33')]({'UserId':_0x448afc[_0xcdcb('0x56')][_0xcdcb('0x5e')],'read1stAt':_[_0xcdcb('0x64')](_0x417434['read1stAt'])?moment()['format'](_0xcdcb('0x5d')):undefined});}return null;})[_0xcdcb('0x34')](function(_0x34bd3e){if(_0x34bd3e){_0x41c479[_0xcdcb('0x65')]=_0x34bd3e['get']({'plain':!![]});interaction_log[_0xcdcb('0x1d')](_0xcdcb('0x66'),_0x448afc[_0xcdcb('0x5f')]['id'],_0x448afc[_0xcdcb('0x5f')][_0xcdcb('0x37')],_0x448afc['user'][_0xcdcb('0x67')],_0x41c479[_0xcdcb('0x65')]['id'],_0x448afc[_0xcdcb('0x56')]?JSON[_0xcdcb('0x22')](_0x448afc[_0xcdcb('0x56')]):'null');return respondWithRpcPromise(_0xcdcb('0x68'),'acceptMessage',_0x41c479);}return null;})[_0xcdcb('0x34')](function(_0x5b5619){if(_0x5b5619){if(_0x448afc[_0xcdcb('0x56')]['manual']){_0x41c479[_0xcdcb('0x24')]['interface']=util[_0xcdcb('0x5c')](_0xcdcb('0x69'),_0x448afc[_0xcdcb('0x5f')][_0xcdcb('0x37')]);_0x41c479[_0xcdcb('0x24')][_0xcdcb('0x6a')]=_0x41c479[_0xcdcb('0x6a')];_0x41c479['message'][_0xcdcb('0x6b')]=_0xcdcb('0x59');return respondWithRpcPromise('EventManager',_0xcdcb('0x6c'),{'event':'acceptmessage','message':_0x41c479[_0xcdcb('0x24')]},client9002)[_0xcdcb('0x34')](function(){return _0x41c479;});}return _0x41c479;}return null;})[_0xcdcb('0x34')](respondWithResult(_0x31311d,null))[_0xcdcb('0x26')](handleError(_0x31311d,null));};var interaction_log=require('../../config/logger')(_0xcdcb('0x58'));exports['reject']=function(_0xcb7ca2,_0x49fb27,_0x4eac7f){var _0x46fb64={'agent':{},'channel':_0xcdcb('0x5a')};if(_0xcb7ca2[_0xcdcb('0x56')]['id']){delete _0xcb7ca2[_0xcdcb('0x56')]['id'];}_0xcb7ca2[_0xcdcb('0x56')][_0xcdcb('0x5e')]=_0xcb7ca2['body'][_0xcdcb('0x5e')]||_0xcb7ca2[_0xcdcb('0x5f')]['id'];_0x46fb64[_0xcdcb('0x6d')]['id']=_0xcb7ca2[_0xcdcb('0x56')][_0xcdcb('0x5e')];return db[_0xcdcb('0x4d')][_0xcdcb('0x54')]({'where':{'id':_0xcb7ca2[_0xcdcb('0x52')]['id'],'UserId':null}})[_0xcdcb('0x34')](handleEntityNotFound(_0x49fb27,null))[_0xcdcb('0x34')](function(_0x3810b9){if(_0x3810b9){_0x46fb64[_0xcdcb('0x24')]=_0x3810b9[_0xcdcb('0x6e')]({'plain':!![]});return db[_0xcdcb('0x62')][_0xcdcb('0x54')]({'where':{'id':_0x3810b9[_0xcdcb('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x49fb27,null))[_0xcdcb('0x34')](function(_0x56f187){if(_0x56f187){_0x46fb64[_0xcdcb('0x65')]=_0x56f187['get']({'plain':!![]});interaction_log[_0xcdcb('0x1d')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xcb7ca2[_0xcdcb('0x5f')]['id'],_0xcb7ca2[_0xcdcb('0x5f')][_0xcdcb('0x37')],_0xcb7ca2[_0xcdcb('0x5f')][_0xcdcb('0x67')],_0x46fb64[_0xcdcb('0x65')]['id'],_0xcb7ca2['body']?JSON[_0xcdcb('0x22')](_0xcb7ca2[_0xcdcb('0x56')]):'null');return respondWithRpcPromise(_0xcdcb('0x6f'),_0xcdcb('0x70'),_0x46fb64);}return null;})[_0xcdcb('0x34')](function(_0x5e5bca){if(_0x5e5bca){_0x5e5bca[_0xcdcb('0x24')][_0xcdcb('0x71')]=util[_0xcdcb('0x5c')](_0xcdcb('0x69'),_0xcb7ca2[_0xcdcb('0x5f')][_0xcdcb('0x37')]);_0x5e5bca[_0xcdcb('0x24')]['channel']=_0x46fb64[_0xcdcb('0x6a')];_0x5e5bca['message'][_0xcdcb('0x6b')]=_0xcdcb('0x31');respondWithRpcPromise('EventManager',_0xcdcb('0x6c'),{'event':_0xcdcb('0x72'),'message':_0x5e5bca['message']},client9002);return _0x46fb64;}return null;})['then'](respondWithResult(_0x49fb27,null))[_0xcdcb('0x26')](handleError(_0x49fb27,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index a1895de..9545ab5 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 _0x5974=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x166681,_0x2b9ee3){var _0x688a1e=function(_0x1cbdb6){while(--_0x1cbdb6){_0x166681['push'](_0x166681['shift']());}};_0x688a1e(++_0x2b9ee3);}(_0x5974,0x1d8));var _0x4597=function(_0x3a33ff,_0x431390){_0x3a33ff=_0x3a33ff-0x0;var _0x214ba7=_0x5974[_0x3a33ff];return _0x214ba7;};'use strict';var EventEmitter=require(_0x4597('0x0'));var OpenchannelMessage=require(_0x4597('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4597('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4597('0x3'),'afterDestroy':_0x4597('0x4')};function emitEvent(_0x2539be){return function(_0x477c3c,_0x195d4e,_0x1e9077){OpenchannelMessageEvents[_0x4597('0x5')](_0x2539be+':'+_0x477c3c['id'],_0x477c3c);OpenchannelMessageEvents[_0x4597('0x5')](_0x2539be,_0x477c3c);_0x1e9077(null);};}for(var e in events){if(events[_0x4597('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x4597('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x7dc9=['OpenchannelMessage','setMaxListeners','update','remove','emit','exports','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7dc9,0x84));var _0x97dc=function(_0x3208ae,_0x364076){_0x3208ae=_0x3208ae-0x0;var _0x362a7d=_0x7dc9[_0x3208ae];return _0x362a7d;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x97dc('0x0'))['db'][_0x97dc('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x97dc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x97dc('0x3'),'afterDestroy':_0x97dc('0x4')};function emitEvent(_0x5785b8){return function(_0x4ed9ca,_0x3445d6,_0x3487fa){OpenchannelMessageEvents[_0x97dc('0x5')](_0x5785b8+':'+_0x4ed9ca['id'],_0x4ed9ca);OpenchannelMessageEvents[_0x97dc('0x5')](_0x5785b8,_0x4ed9ca);_0x3487fa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x97dc('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 3725fba..f1d9f3c 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 _0xf87d=['error','CmContact','describe','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','POST','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','./openchannelMessage.attributes','exports','openchannel_messages','models','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','body','catch'];(function(_0x316c8a,_0x4d0eb2){var _0x4e4366=function(_0x220dff){while(--_0x220dff){_0x316c8a['push'](_0x316c8a['shift']());}};_0x4e4366(++_0x4d0eb2);}(_0xf87d,0xc1));var _0xdf87=function(_0x29e213,_0x201d3e){_0x29e213=_0x29e213-0x0;var _0x3ea622=_0xf87d[_0x29e213];return _0x3ea622;};'use strict';var _=require(_0xdf87('0x0'));var util=require(_0xdf87('0x1'));var logger=require(_0xdf87('0x2'))('api');var moment=require(_0xdf87('0x3'));var BPromise=require(_0xdf87('0x4'));var rp=require(_0xdf87('0x5'));var attributes=require(_0xdf87('0x6'));module[_0xdf87('0x7')]=function(_0x3e8b01,_0x7d6b7a){return _0x3e8b01['define']('OpenchannelMessage',attributes,{'tableName':_0xdf87('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xa6fe8e,_0x463f5f,_0x370430){var _0x4297d8=_0x3e8b01[_0xdf87('0x9')];var _0x4fb77e=_0xa6fe8e['get']({'plain':!![]});if(_0x4fb77e[_0xdf87('0xa')][_0xdf87('0xb')]()==='in'||_0x4fb77e[_0xdf87('0xa')][_0xdf87('0xb')]()===_0xdf87('0xc')&&!_0x4fb77e['secret']&&!_[_0xdf87('0xd')](_0x4fb77e[_0xdf87('0xe')])){_0x4297d8[_0xdf87('0xf')][_0xdf87('0x10')]({'where':{'id':_0x4fb77e['OpenchannelInteractionId']}})[_0xdf87('0x11')](function(_0x3760c7){if(_0x3760c7){_0x3760c7[_0xdf87('0x12')]({'lastMsgAt':_0x4fb77e[_0xdf87('0x13')],'lastMsgDirection':_0x4fb77e[_0xdf87('0xa')][_0xdf87('0xb')](),'lastMsgBody':_0x4fb77e[_0xdf87('0x14')]});}})[_0xdf87('0x15')](function(_0x4040c){console[_0xdf87('0x16')](_0x4040c);});}if(_0x4fb77e[_0xdf87('0xa')]===_0xdf87('0xc')&&!_0x4fb77e['secret']){var _0x536f92;_0x4297d8[_0xdf87('0x17')][_0xdf87('0x18')]()['then'](function(_0x42220d){return _0x4297d8['OpenchannelAccount']['find']({'where':{'id':_0x4fb77e[_0xdf87('0x19')]},'include':[{'model':_0x4297d8['OpenchannelInteraction'],'as':_0xdf87('0x1a'),'where':{'id':_0x4fb77e[_0xdf87('0x1b')]},'limit':0x1,'include':[{'model':_0x4297d8[_0xdf87('0x17')],'as':_0xdf87('0x1c'),'attributes':_[_0xdf87('0x1d')](_0x42220d)}]}]});})[_0xdf87('0x11')](function(_0x271ad2){_0x536f92=_0x271ad2['get']({'plain':!![]});if(_0x536f92&&_0x536f92[_0xdf87('0x1e')]){logger['info'](_0xdf87('0x1f'),'afterCreate',util[_0xdf87('0x20')](_0xdf87('0x21'),_0x4fb77e['id'],_0x536f92[_0xdf87('0x1e')]));if(_0x536f92[_0xdf87('0x1a')]&&_0x536f92['Interactions']['length']){_0x4fb77e[_0xdf87('0x22')]=_['omit'](_0x536f92[_0xdf87('0x1a')][0x0],_0xdf87('0x1c'));_0x4fb77e[_0xdf87('0x1c')]=_0x536f92[_0xdf87('0x1a')][0x0][_0xdf87('0x1c')];}var _0x463f5f={'method':_0xdf87('0x23'),'uri':encodeURI(_0x536f92[_0xdf87('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x463f5f['method']){case'GET':_0x463f5f['qs']=_0x4fb77e;break;case _0xdf87('0x23'):_0x463f5f[_0xdf87('0x14')]=_0x4fb77e;break;}return rp(_0x463f5f)['then'](function(_0x285464){logger[_0xdf87('0x24')](_0xdf87('0x1f'),_0xdf87('0x25'),util[_0xdf87('0x20')](_0xdf87('0x26'),_0x4fb77e['id'],_0x536f92[_0xdf87('0x1e')]));if(_0x285464[_0xdf87('0x14')][_0xdf87('0x27')]&&_0x285464[_0xdf87('0x14')]['threadId']!=_0x4fb77e[_0xdf87('0x22')][_0xdf87('0x27')]){return _0x4297d8[_0xdf87('0xf')]['update']({'threadId':_0x285464[_0xdf87('0x14')][_0xdf87('0x27')]},{'logging':!![],'where':{'id':_0x4fb77e['Interaction']['id']}});}else{return;}})[_0xdf87('0x11')](function(){return _0xa6fe8e['update']({'read':!![]});})[_0xdf87('0x15')](function(_0x4b1086){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xdf87('0x25'),util[_0xdf87('0x28')](_0x4b1086,{'showHidden':![],'depth':null}));_0x370430();});}else{_0x370430();}})['finally'](function(){_0x370430();});}else{_0x370430();}}},'charset':_0xdf87('0x29'),'collate':_0xdf87('0x2a')});}; \ No newline at end of file +var _0x99bc=['bluebird','request-promise','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','models','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','createdAt','direction','body','error','describe','then','OpenchannelAccount','find','Interactions','CmContact','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','omit','Contact','POST','threadId','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x166d7e,_0x61c9ac){var _0x528d67=function(_0x334883){while(--_0x334883){_0x166d7e['push'](_0x166d7e['shift']());}};_0x528d67(++_0x61c9ac);}(_0x99bc,0x10f));var _0xc99b=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x99bc[_0x2283dc];return _0x16db90;};'use strict';var _=require(_0xc99b('0x0'));var util=require(_0xc99b('0x1'));var logger=require(_0xc99b('0x2'))(_0xc99b('0x3'));var moment=require(_0xc99b('0x4'));var BPromise=require(_0xc99b('0x5'));var rp=require(_0xc99b('0x6'));var attributes=require(_0xc99b('0x7'));module[_0xc99b('0x8')]=function(_0xa5899b,_0x1283cb){return _0xa5899b['define'](_0xc99b('0x9'),attributes,{'tableName':_0xc99b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x103a30,_0x320cdf,_0x3bbbce){var _0x4bc656=_0xa5899b[_0xc99b('0xb')];var _0x301460=_0x103a30['get']({'plain':!![]});if(_0x301460['direction'][_0xc99b('0xc')]()==='in'||_0x301460['direction'][_0xc99b('0xc')]()===_0xc99b('0xd')&&!_0x301460['secret']&&!_[_0xc99b('0xe')](_0x301460[_0xc99b('0xf')])){_0x4bc656[_0xc99b('0x10')][_0xc99b('0x11')]({'where':{'id':_0x301460[_0xc99b('0x12')]}})['then'](function(_0x23881c){if(_0x23881c){_0x23881c['update']({'lastMsgAt':_0x301460[_0xc99b('0x13')],'lastMsgDirection':_0x301460[_0xc99b('0x14')][_0xc99b('0xc')](),'lastMsgBody':_0x301460[_0xc99b('0x15')]});}})['catch'](function(_0x1257e5){console[_0xc99b('0x16')](_0x1257e5);});}if(_0x301460[_0xc99b('0x14')]===_0xc99b('0xd')&&!_0x301460['secret']){var _0x2bc0d8;_0x4bc656['CmContact'][_0xc99b('0x17')]()[_0xc99b('0x18')](function(_0xdd82bd){return _0x4bc656[_0xc99b('0x19')][_0xc99b('0x1a')]({'where':{'id':_0x301460['OpenchannelAccountId']},'include':[{'model':_0x4bc656[_0xc99b('0x10')],'as':_0xc99b('0x1b'),'where':{'id':_0x301460[_0xc99b('0x12')]},'limit':0x1,'include':[{'model':_0x4bc656[_0xc99b('0x1c')],'as':'Contact','attributes':_['keys'](_0xdd82bd)}]}]});})[_0xc99b('0x18')](function(_0x32379b){_0x2bc0d8=_0x32379b[_0xc99b('0x1d')]({'plain':!![]});if(_0x2bc0d8&&_0x2bc0d8[_0xc99b('0x1e')]){logger[_0xc99b('0x1f')](_0xc99b('0x20'),_0xc99b('0x21'),util[_0xc99b('0x22')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x301460['id'],_0x2bc0d8[_0xc99b('0x1e')]));if(_0x2bc0d8[_0xc99b('0x1b')]&&_0x2bc0d8[_0xc99b('0x1b')][_0xc99b('0x23')]){_0x301460[_0xc99b('0x24')]=_[_0xc99b('0x25')](_0x2bc0d8[_0xc99b('0x1b')][0x0],_0xc99b('0x26'));_0x301460[_0xc99b('0x26')]=_0x2bc0d8[_0xc99b('0x1b')][0x0][_0xc99b('0x26')];}var _0x320cdf={'method':_0xc99b('0x27'),'uri':encodeURI(_0x2bc0d8[_0xc99b('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x320cdf['method']){case'GET':_0x320cdf['qs']=_0x301460;break;case'POST':_0x320cdf['body']=_0x301460;break;}return rp(_0x320cdf)['then'](function(_0x5ce842){logger[_0xc99b('0x1f')](_0xc99b('0x20'),_0xc99b('0x21'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x301460['id'],_0x2bc0d8['replyUri']));if(_0x5ce842['body'][_0xc99b('0x28')]&&_0x5ce842['body'][_0xc99b('0x28')]!=_0x301460[_0xc99b('0x24')][_0xc99b('0x28')]){return _0x4bc656[_0xc99b('0x10')]['update']({'threadId':_0x5ce842[_0xc99b('0x15')]['threadId']},{'logging':!![],'where':{'id':_0x301460[_0xc99b('0x24')]['id']}});}else{return;}})[_0xc99b('0x18')](function(){return _0x103a30['update']({'read':!![]});})[_0xc99b('0x29')](function(_0x57f75e){logger[_0xc99b('0x16')](_0xc99b('0x20'),'afterCreate',util[_0xc99b('0x2a')](_0x57f75e,{'showHidden':![],'depth':null}));_0x3bbbce();});}else{_0x3bbbce();}})[_0xc99b('0x2b')](function(){_0x3bbbce();});}else{_0x3bbbce();}}},'charset':_0xc99b('0x2c'),'collate':_0xc99b('0x2d')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 1a58233..888bfcf 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 _0x3dc3=['OpenchannelMessage','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','then','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelMessage,\x20%s,\x20%s','info','result','catch','CreateOpenchannelMessage'];(function(_0x32a743,_0x1fcb12){var _0x104485=function(_0x23c4dc){while(--_0x23c4dc){_0x32a743['push'](_0x32a743['shift']());}};_0x104485(++_0x1fcb12);}(_0x3dc3,0xea));var _0x33dc=function(_0x3e2bb3,_0x2a13bf){_0x3e2bb3=_0x3e2bb3-0x0;var _0x30d4dc=_0x3dc3[_0x3e2bb3];return _0x30d4dc;};'use strict';var _=require(_0x33dc('0x0'));var util=require('util');var moment=require(_0x33dc('0x1'));var BPromise=require(_0x33dc('0x2'));var rs=require(_0x33dc('0x3'));var fs=require('fs');var Redis=require(_0x33dc('0x4'));var db=require(_0x33dc('0x5'))['db'];var utils=require(_0x33dc('0x6'));var logger=require(_0x33dc('0x7'))(_0x33dc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x33dc('0x9')][_0x33dc('0xa')]({'port':0x232a});config[_0x33dc('0xb')]=_[_0x33dc('0xc')](config[_0x33dc('0xb')],{'host':_0x33dc('0xd'),'port':0x18eb});var socket=require(_0x33dc('0xe'))(new Redis(config['redis']));require(_0x33dc('0xf'))[_0x33dc('0x10')](socket);function respondWithRpcPromise(_0x13672d,_0x51a2f1,_0xf1e24){return new BPromise(function(_0x2eb8ac,_0x1d506f){return client['request'](_0x13672d,_0xf1e24)[_0x33dc('0x11')](function(_0x32b6dd){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x51a2f1,'request\x20sent');logger[_0x33dc('0x12')](_0x33dc('0x13'),_0x51a2f1,_0x33dc('0x14'),JSON[_0x33dc('0x15')](_0x32b6dd));if(_0x32b6dd[_0x33dc('0x16')]){if(_0x32b6dd['error'][_0x33dc('0x17')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x51a2f1,_0x32b6dd[_0x33dc('0x16')][_0x33dc('0x18')]);return _0x1d506f(_0x32b6dd[_0x33dc('0x16')][_0x33dc('0x18')]);}logger[_0x33dc('0x16')](_0x33dc('0x19'),_0x51a2f1,_0x32b6dd[_0x33dc('0x16')]['message']);return _0x2eb8ac(_0x32b6dd['error'][_0x33dc('0x18')]);}else{logger[_0x33dc('0x1a')](_0x33dc('0x19'),_0x51a2f1,_0x33dc('0x14'));_0x2eb8ac(_0x32b6dd[_0x33dc('0x1b')][_0x33dc('0x18')]);}})[_0x33dc('0x1c')](function(_0x2a8eb9){logger[_0x33dc('0x16')](_0x33dc('0x19'),_0x51a2f1,_0x2a8eb9);_0x1d506f(_0x2a8eb9);});});}exports[_0x33dc('0x1d')]=function(_0x22ee90){var _0x35e156=this;return new Promise(function(_0x3a5491,_0x33c199){return db[_0x33dc('0x1e')]['create'](_0x22ee90['body'],{'raw':_0x22ee90[_0x33dc('0x1f')]?_0x22ee90[_0x33dc('0x1f')][_0x33dc('0x20')]===undefined?!![]:![]:!![]})[_0x33dc('0x11')](function(_0x7cfa80){logger[_0x33dc('0x1a')](_0x33dc('0x1d'),_0x22ee90);logger[_0x33dc('0x12')](_0x33dc('0x1d'),_0x22ee90,JSON[_0x33dc('0x15')](_0x7cfa80));_0x3a5491(_0x7cfa80);})[_0x33dc('0x1c')](function(_0xabb393){logger[_0x33dc('0x16')](_0x33dc('0x1d'),_0xabb393[_0x33dc('0x18')],_0x22ee90);_0x33c199(_0x35e156['error'](0x1f4,_0xabb393[_0x33dc('0x18')]));});});}; \ No newline at end of file +var _0x1f0a=['../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelMessage','create','body','options','then','util','moment','bluebird','randomstring','ioredis'];(function(_0x39b38f,_0x15633f){var _0x358b99=function(_0x4b91eb){while(--_0x4b91eb){_0x39b38f['push'](_0x39b38f['shift']());}};_0x358b99(++_0x15633f);}(_0x1f0a,0x1cc));var _0xa1f0=function(_0x855b1c,_0x131bc8){_0x855b1c=_0x855b1c-0x0;var _0x5b4c9e=_0x1f0a[_0x855b1c];return _0x5b4c9e;};'use strict';var _=require('lodash');var util=require(_0xa1f0('0x0'));var moment=require(_0xa1f0('0x1'));var BPromise=require(_0xa1f0('0x2'));var rs=require(_0xa1f0('0x3'));var fs=require('fs');var Redis=require(_0xa1f0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa1f0('0x5'));var logger=require(_0xa1f0('0x6'))(_0xa1f0('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1f0('0x8'));var client=jayson[_0xa1f0('0x9')]['http']({'port':0x232a});config['redis']=_[_0xa1f0('0xa')](config[_0xa1f0('0xb')],{'host':_0xa1f0('0xc'),'port':0x18eb});var socket=require(_0xa1f0('0xd'))(new Redis(config[_0xa1f0('0xb')]));require('./openchannelMessage.socket')[_0xa1f0('0xe')](socket);function respondWithRpcPromise(_0x1e5cc3,_0x3457ae,_0x38e001){return new BPromise(function(_0x55b2d0,_0x4d3500){return client[_0xa1f0('0xf')](_0x1e5cc3,_0x38e001)['then'](function(_0x349e58){logger[_0xa1f0('0x10')](_0xa1f0('0x11'),_0x3457ae,_0xa1f0('0x12'));logger[_0xa1f0('0x13')](_0xa1f0('0x14'),_0x3457ae,_0xa1f0('0x12'),JSON[_0xa1f0('0x15')](_0x349e58));if(_0x349e58[_0xa1f0('0x16')]){if(_0x349e58[_0xa1f0('0x16')]['code']===0x1f4){logger[_0xa1f0('0x16')](_0xa1f0('0x11'),_0x3457ae,_0x349e58['error'][_0xa1f0('0x17')]);return _0x4d3500(_0x349e58['error'][_0xa1f0('0x17')]);}logger['error'](_0xa1f0('0x11'),_0x3457ae,_0x349e58['error']['message']);return _0x55b2d0(_0x349e58[_0xa1f0('0x16')]['message']);}else{logger[_0xa1f0('0x10')]('OpenchannelMessage,\x20%s,\x20%s',_0x3457ae,'request\x20sent');_0x55b2d0(_0x349e58[_0xa1f0('0x18')][_0xa1f0('0x17')]);}})[_0xa1f0('0x19')](function(_0x17bc8b){logger['error'](_0xa1f0('0x11'),_0x3457ae,_0x17bc8b);_0x4d3500(_0x17bc8b);});});}exports[_0xa1f0('0x1a')]=function(_0x52d6ee){var _0x379cce=this;return new Promise(function(_0x9601a0,_0x3c868f){return db['OpenchannelMessage'][_0xa1f0('0x1b')](_0x52d6ee[_0xa1f0('0x1c')],{'raw':_0x52d6ee[_0xa1f0('0x1d')]?_0x52d6ee[_0xa1f0('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xa1f0('0x1e')](function(_0x3c6604){logger[_0xa1f0('0x10')](_0xa1f0('0x1a'),_0x52d6ee);logger[_0xa1f0('0x13')]('CreateOpenchannelMessage',_0x52d6ee,JSON[_0xa1f0('0x15')](_0x3c6604));_0x9601a0(_0x3c6604);})[_0xa1f0('0x19')](function(_0x125e5c){logger['error'](_0xa1f0('0x1a'),_0x125e5c[_0xa1f0('0x17')],_0x52d6ee);_0x3c868f(_0x379cce[_0xa1f0('0x16')](0x1f4,_0x125e5c[_0xa1f0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 62d13d6..811b67c 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 _0x950a=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x950a,0x111));var _0xa950=function(_0x4c2fad,_0x1eb609){_0x4c2fad=_0x4c2fad-0x0;var _0x1a4825=_0x950a[_0x4c2fad];return _0x1a4825;};'use strict';var OpenchannelMessageEvents=require(_0xa950('0x0'));var events=[_0xa950('0x1'),_0xa950('0x2'),_0xa950('0x3')];function createListener(_0x5569f7,_0x305b26){return function(_0xa583df){_0x305b26[_0xa950('0x4')](_0x5569f7,_0xa583df);};}function removeListener(_0x2c80ed,_0x5cd4aa){return function(){OpenchannelMessageEvents[_0xa950('0x5')](_0x2c80ed,_0x5cd4aa);};}exports[_0xa950('0x6')]=function(_0x512c0e){for(var _0x14b4ac=0x0,_0x3645b6=events['length'];_0x14b4ac<_0x3645b6;_0x14b4ac++){var _0x5675f8=events[_0x14b4ac];var _0x26e05c=createListener(_0xa950('0x7')+_0x5675f8,_0x512c0e);OpenchannelMessageEvents['on'](_0x5675f8,_0x26e05c);}}; \ No newline at end of file +var _0x31af=['remove','emit','removeListener','length','openchannelMessage:','./openchannelMessage.events','save'];(function(_0x590887,_0x8a64b){var _0x56b574=function(_0x53ba35){while(--_0x53ba35){_0x590887['push'](_0x590887['shift']());}};_0x56b574(++_0x8a64b);}(_0x31af,0xde));var _0xf31a=function(_0x2000e3,_0x5d9d3f){_0x2000e3=_0x2000e3-0x0;var _0x4b4387=_0x31af[_0x2000e3];return _0x4b4387;};'use strict';var OpenchannelMessageEvents=require(_0xf31a('0x0'));var events=[_0xf31a('0x1'),_0xf31a('0x2'),'update'];function createListener(_0x5f5639,_0x4596f6){return function(_0x4a8ef1){_0x4596f6[_0xf31a('0x3')](_0x5f5639,_0x4a8ef1);};}function removeListener(_0x1853d7,_0x820362){return function(){OpenchannelMessageEvents[_0xf31a('0x4')](_0x1853d7,_0x820362);};}exports['register']=function(_0x8d7853){for(var _0x209fcc=0x0,_0x405926=events[_0xf31a('0x5')];_0x209fcc<_0x405926;_0x209fcc++){var _0x47b7a1=events[_0x209fcc];var _0x31f8e7=createListener(_0xf31a('0x6')+_0x47b7a1,_0x8d7853);OpenchannelMessageEvents['on'](_0x47b7a1,_0x31f8e7);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 62595ec..0d5163a 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 _0xa017=['describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addAgents','put','delete','destroy','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get'];(function(_0x49c957,_0x3509d8){var _0x5b1d38=function(_0x219976){while(--_0x219976){_0x49c957['push'](_0x49c957['shift']());}};_0x5b1d38(++_0x3509d8);}(_0xa017,0x189));var _0x7a01=function(_0xeb94a4,_0x166c7b){_0xeb94a4=_0xeb94a4-0x0;var _0x5a9285=_0xa017[_0xeb94a4];return _0x5a9285;};'use strict';var multer=require(_0x7a01('0x0'));var util=require(_0x7a01('0x1'));var path=require(_0x7a01('0x2'));var timeout=require('connect-timeout');var express=require(_0x7a01('0x3'));var router=express[_0x7a01('0x4')]();var auth=require(_0x7a01('0x5'));var interaction=require(_0x7a01('0x6'));var config=require(_0x7a01('0x7'));var controller=require(_0x7a01('0x8'));router['get']('/',auth[_0x7a01('0x9')](),controller[_0x7a01('0xa')]);router[_0x7a01('0xb')]('/describe',auth[_0x7a01('0x9')](),controller[_0x7a01('0xc')]);router['get'](_0x7a01('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x7a01('0xb')](_0x7a01('0xe'),auth['isAuthenticated'](),controller[_0x7a01('0xf')]);router[_0x7a01('0xb')](_0x7a01('0x10'),auth[_0x7a01('0x9')](),controller[_0x7a01('0x11')]);router[_0x7a01('0xb')](_0x7a01('0x12'),auth[_0x7a01('0x9')](),controller[_0x7a01('0x13')]);router['post']('/',auth[_0x7a01('0x9')](),controller[_0x7a01('0x14')]);router['post'](_0x7a01('0x10'),auth[_0x7a01('0x9')](),controller['addTeams']);router['post'](_0x7a01('0x12'),auth[_0x7a01('0x9')](),controller[_0x7a01('0x15')]);router[_0x7a01('0x16')](_0x7a01('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x7a01('0x17')](_0x7a01('0xd'),auth['isAuthenticated'](),controller[_0x7a01('0x18')]);router['delete'](_0x7a01('0x10'),auth[_0x7a01('0x9')](),controller['removeTeams']);router[_0x7a01('0x17')](_0x7a01('0x12'),auth[_0x7a01('0x9')](),controller[_0x7a01('0x19')]);module[_0x7a01('0x1a')]=router; \ No newline at end of file +var _0xb826=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','create','addTeams','/:id/users','update','delete','destroy','removeAgents','exports','multer','util','path'];(function(_0x3943fe,_0x1038fd){var _0x1e217b=function(_0x153d32){while(--_0x153d32){_0x3943fe['push'](_0x3943fe['shift']());}};_0x1e217b(++_0x1038fd);}(_0xb826,0x115));var _0x6b82=function(_0x2de22b,_0x11717c){_0x2de22b=_0x2de22b-0x0;var _0x11b175=_0xb826[_0x2de22b];return _0x11b175;};'use strict';var multer=require(_0x6b82('0x0'));var util=require(_0x6b82('0x1'));var path=require(_0x6b82('0x2'));var timeout=require(_0x6b82('0x3'));var express=require('express');var router=express[_0x6b82('0x4')]();var auth=require(_0x6b82('0x5'));var interaction=require(_0x6b82('0x6'));var config=require(_0x6b82('0x7'));var controller=require(_0x6b82('0x8'));router[_0x6b82('0x9')]('/',auth[_0x6b82('0xa')](),controller['index']);router[_0x6b82('0x9')](_0x6b82('0xb'),auth[_0x6b82('0xa')](),controller[_0x6b82('0xc')]);router[_0x6b82('0x9')](_0x6b82('0xd'),auth[_0x6b82('0xa')](),controller[_0x6b82('0xe')]);router['get'](_0x6b82('0xf'),auth[_0x6b82('0xa')](),controller[_0x6b82('0x10')]);router['get'](_0x6b82('0x11'),auth[_0x6b82('0xa')](),controller[_0x6b82('0x12')]);router[_0x6b82('0x9')]('/:id/users',auth[_0x6b82('0xa')](),controller['getAgents']);router[_0x6b82('0x13')]('/',auth[_0x6b82('0xa')](),controller[_0x6b82('0x14')]);router['post'](_0x6b82('0x11'),auth[_0x6b82('0xa')](),controller[_0x6b82('0x15')]);router['post'](_0x6b82('0x16'),auth[_0x6b82('0xa')](),controller['addAgents']);router['put'](_0x6b82('0xd'),auth['isAuthenticated'](),controller[_0x6b82('0x17')]);router[_0x6b82('0x18')](_0x6b82('0xd'),auth[_0x6b82('0xa')](),controller[_0x6b82('0x19')]);router[_0x6b82('0x18')](_0x6b82('0x11'),auth[_0x6b82('0xa')](),controller['removeTeams']);router[_0x6b82('0x18')]('/:id/users',auth[_0x6b82('0xa')](),controller[_0x6b82('0x1a')]);module[_0x6b82('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 2a7f406..1cc9b05 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 _0x68da=['beepall','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x3a7f8b,_0x7fe06c){var _0x34f066=function(_0x38f2a7){while(--_0x38f2a7){_0x3a7f8b['push'](_0x3a7f8b['shift']());}};_0x34f066(++_0x7fe06c);}(_0x68da,0x13c));var _0xa68d=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0x68da[_0x2bda14];return _0xb5dd49;};'use strict';var Sequelize=require(_0xa68d('0x0'));module[_0xa68d('0x1')]={'name':{'type':Sequelize[_0xa68d('0x2')],'unique':_0xa68d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa68d('0x2')]},'timeout':{'type':Sequelize[_0xa68d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa68d('0x5'),_0xa68d('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x0160=['ENUM','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0x0160,0x1bc));var _0x0016=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0x0160[_0x118139];return _0x2fece9;};'use strict';var Sequelize=require(_0x0016('0x0'));module[_0x0016('0x1')]={'name':{'type':Sequelize[_0x0016('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0016('0x2')]},'timeout':{'type':Sequelize[_0x0016('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0016('0x4')]('rrmemory',_0x0016('0x5'),_0x0016('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 4c53d31..503ccda 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 _0xb10b=['name','send','OpenchannelQueue','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','type','key','field','filter','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','hasOwnProperty','OpenchannelQueueId','map','UserOpenchannelQueue','UserId','agent','updatedAt','createdAt','format','%s/%s','getTeams','Team','ids','User','Agents','union','addAgents','penalty','addTeams','removeTeams','removeAgents','spread','emit','userOpenchannelQueue:save','userOpenchannelQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','then','destroy','get','error','stack'];(function(_0x2862cd,_0x433329){var _0x3c953c=function(_0x14f0fc){while(--_0x14f0fc){_0x2862cd['push'](_0x2862cd['shift']());}};_0x3c953c(++_0x433329);}(_0xb10b,0x12a));var _0xbb10=function(_0xffa302,_0xfd695c){_0xffa302=_0xffa302-0x0;var _0x38ea4b=_0xb10b[_0xffa302];return _0x38ea4b;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var hardwareService=require(_0xbb10('0x13'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var db=require(_0xbb10('0x17'))['db'];config['redis']=_[_0xbb10('0x18')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))['register'](socket);function respondWithStatusCode(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xcc;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x1d')](_0x42d7e4);}return _0x26e021[_0xbb10('0x1e')](_0x42d7e4)[_0xbb10('0x1f')]();};}function respondWithResult(_0x24a57b,_0x36b5e8){_0x36b5e8=_0x36b5e8||0xc8;return function(_0x3e26f4){if(_0x3e26f4){return _0x24a57b[_0xbb10('0x1e')](_0x36b5e8)['json'](_0x3e26f4);}};}function respondWithFilteredResult(_0x2eca0f,_0x1145f1){return function(_0x133ac2){if(_0x133ac2){var _0x42db98=_0x133ac2[_0xbb10('0x20')],_0x378da8=_0x1145f1[_0xbb10('0x21')],_0x1682a4=_0x1145f1[_0xbb10('0x21')]+_0x1145f1['limit'],_0x575cca;if(_0x1682a4>=_0x42db98){_0x1682a4=_0x42db98;_0x575cca=0xc8;}else{_0x575cca=0xce;}_0x2eca0f[_0xbb10('0x1e')](_0x575cca);return _0x2eca0f[_0xbb10('0x22')](_0xbb10('0x23'),_0x378da8+'-'+_0x1682a4+'/'+_0x42db98)[_0xbb10('0x24')](_0x133ac2);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x25')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x26')](_0x4c4b0d)[_0xbb10('0x27')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x28')]()[_0xbb10('0x27')](function(){var _0x3ba6cd=_0x436104[_0xbb10('0x29')]({'plain':!![]});var _0x537898='OpenchannelQueues';return db['UserProfileResource'][_0xbb10('0x28')]({'where':{'type':_0x537898,'resourceId':_0x3ba6cd['id']}})[_0xbb10('0x27')](function(){return _0x436104;});})[_0xbb10('0x27')](function(){_0x1824b7['status'](0xcc)[_0xbb10('0x1f')]();});}};}function handleEntityNotFound(_0x24d586,_0x6ed43b){return function(_0x1d5e95){if(!_0x1d5e95){_0x24d586[_0xbb10('0x1d')](0x194);}return _0x1d5e95;};}function handleError(_0x20d946,_0x2a0e8b){_0x2a0e8b=_0x2a0e8b||0x1f4;return function(_0x4aabb9){logger[_0xbb10('0x2a')](_0x4aabb9[_0xbb10('0x2b')]);if(_0x4aabb9[_0xbb10('0x2c')]){delete _0x4aabb9[_0xbb10('0x2c')];}_0x20d946[_0xbb10('0x1e')](_0x2a0e8b)[_0xbb10('0x2d')](_0x4aabb9);};}exports['index']=function(_0x221624,_0x4ee02e){var _0x448d5c={},_0x56f2da={},_0x16ad2a={'count':0x0,'rows':[]};var _0x1dcc9c=db[_0xbb10('0x2e')]['rawAttributes'];_0x56f2da['model']=_[_0xbb10('0x2f')](_0x1dcc9c);_0x56f2da[_0xbb10('0x30')]=_['keys'](_0x221624[_0xbb10('0x30')]);_0x56f2da[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x56f2da[_0xbb10('0x33')],_0x56f2da[_0xbb10('0x30')]);_0x448d5c[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x56f2da['model'],qs[_0xbb10('0x35')](_0x221624[_0xbb10('0x30')][_0xbb10('0x35')]));_0x448d5c[_0xbb10('0x34')]=_0x448d5c[_0xbb10('0x34')][_0xbb10('0x36')]?_0x448d5c[_0xbb10('0x34')]:_0x56f2da[_0xbb10('0x33')];if(!_0x221624[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x37'))){_0x448d5c[_0xbb10('0x38')]=qs[_0xbb10('0x38')](_0x221624[_0xbb10('0x30')]['limit']);_0x448d5c[_0xbb10('0x21')]=qs['offset'](_0x221624['query'][_0xbb10('0x21')]);}_0x448d5c[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_0x221624[_0xbb10('0x30')][_0xbb10('0x3a')]);_0x448d5c[_0xbb10('0x3b')]=qs['filters'](_[_0xbb10('0x3c')](_0x221624[_0xbb10('0x30')],_0x56f2da['filters']));if(_0x221624['query']['filter']){_0x448d5c[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x448d5c[_0xbb10('0x3b')],{'$or':_['map'](_0x1dcc9c,function(_0x3c0cd7){if(_0x3c0cd7[_0xbb10('0x3e')][_0xbb10('0x3f')]!=='VIRTUAL'){var _0x17b6c5={};_0x17b6c5[_0x3c0cd7[_0xbb10('0x40')]]={'$like':'%'+_0x221624[_0xbb10('0x30')][_0xbb10('0x41')]+'%'};return _0x17b6c5;}})});}_0x448d5c=_['merge']({},_0x448d5c,_0x221624[_0xbb10('0x42')]);var _0x110eb5={'where':_0x448d5c['where']};return db[_0xbb10('0x2e')][_0xbb10('0x20')](_0x110eb5)[_0xbb10('0x27')](function(_0x3a9934){_0x16ad2a[_0xbb10('0x20')]=_0x3a9934;if(_0x221624[_0xbb10('0x30')]['includeAll']){_0x448d5c[_0xbb10('0x43')]=[{'all':!![]}];}return db[_0xbb10('0x2e')][_0xbb10('0x44')](_0x448d5c);})[_0xbb10('0x27')](function(_0x4943d9){_0x16ad2a[_0xbb10('0x45')]=_0x4943d9;return _0x16ad2a;})[_0xbb10('0x27')](respondWithFilteredResult(_0x4ee02e,_0x448d5c))[_0xbb10('0x46')](handleError(_0x4ee02e,null));};exports[_0xbb10('0x47')]=function(_0x5e2cfa,_0x351484){var _0x202c60={'raw':!![],'where':{'id':_0x5e2cfa['params']['id']}},_0x54ac18={};_0x54ac18[_0xbb10('0x33')]=_['keys'](db[_0xbb10('0x2e')][_0xbb10('0x48')]);_0x54ac18['query']=_[_0xbb10('0x2f')](_0x5e2cfa[_0xbb10('0x30')]);_0x54ac18[_0xbb10('0x31')]=_['intersection'](_0x54ac18[_0xbb10('0x33')],_0x54ac18[_0xbb10('0x30')]);_0x202c60[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x54ac18[_0xbb10('0x33')],qs[_0xbb10('0x35')](_0x5e2cfa[_0xbb10('0x30')][_0xbb10('0x35')]));_0x202c60[_0xbb10('0x34')]=_0x202c60[_0xbb10('0x34')][_0xbb10('0x36')]?_0x202c60[_0xbb10('0x34')]:_0x54ac18['model'];if(_0x5e2cfa[_0xbb10('0x30')][_0xbb10('0x49')]){_0x202c60['include']=[{'all':!![]}];}_0x202c60=_[_0xbb10('0x3d')]({},_0x202c60,_0x5e2cfa[_0xbb10('0x42')]);return db[_0xbb10('0x2e')][_0xbb10('0x4a')](_0x202c60)[_0xbb10('0x27')](handleEntityNotFound(_0x351484,null))[_0xbb10('0x27')](respondWithResult(_0x351484,null))[_0xbb10('0x46')](handleError(_0x351484,null));};exports['create']=function(_0x4a9793,_0xcb3354){return db[_0xbb10('0x2e')][_0xbb10('0x4b')](_0x4a9793['body'],{})['then'](function(_0x3cd6f3){var _0x34cf4e=_0x4a9793[_0xbb10('0x4c')][_0xbb10('0x29')]({'plain':!![]});if(!_0x34cf4e)throw new Error(_0xbb10('0x4d'));if(_0x34cf4e[_0xbb10('0x4e')]===_0xbb10('0x4c')){var _0x460788=_0x3cd6f3[_0xbb10('0x29')]({'plain':!![]});var _0x3d7e7e='OpenchannelQueues';return db['UserProfileSection'][_0xbb10('0x4a')]({'where':{'name':_0x3d7e7e,'userProfileId':_0x34cf4e[_0xbb10('0x4f')]},'raw':!![]})[_0xbb10('0x27')](function(_0xb014b0){if(_0xb014b0&&_0xb014b0[_0xbb10('0x50')]===0x0){return db[_0xbb10('0x51')][_0xbb10('0x4b')]({'name':_0x460788[_0xbb10('0x2c')],'resourceId':_0x460788['id'],'type':_0xb014b0[_0xbb10('0x2c')],'sectionId':_0xb014b0['id']},{})[_0xbb10('0x27')](function(){return _0x3cd6f3;});}else{return _0x3cd6f3;}})[_0xbb10('0x46')](function(_0x20e18a){logger[_0xbb10('0x2a')](_0xbb10('0x52'),_0x20e18a);throw _0x20e18a;});}return _0x3cd6f3;})[_0xbb10('0x27')](respondWithResult(_0xcb3354,0xc9))['catch'](handleError(_0xcb3354,null));};exports[_0xbb10('0x26')]=function(_0x5bd44d,_0x33d60a){if(_0x5bd44d[_0xbb10('0x53')]['id']){delete _0x5bd44d[_0xbb10('0x53')]['id'];}return db[_0xbb10('0x2e')][_0xbb10('0x4a')]({'where':{'id':_0x5bd44d[_0xbb10('0x54')]['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0x33d60a,null))[_0xbb10('0x27')](saveUpdates(_0x5bd44d[_0xbb10('0x53')],null))[_0xbb10('0x27')](respondWithResult(_0x33d60a,null))[_0xbb10('0x46')](handleError(_0x33d60a,null));};exports[_0xbb10('0x28')]=function(_0x1d49e1,_0x3d7e17){return db[_0xbb10('0x2e')]['find']({'where':{'id':_0x1d49e1[_0xbb10('0x54')]['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0x3d7e17,null))[_0xbb10('0x27')](removeEntity(_0x3d7e17,null))[_0xbb10('0x46')](handleError(_0x3d7e17,null));};exports[_0xbb10('0x55')]=function(_0x379d8c,_0x4bedd0){return db[_0xbb10('0x2e')][_0xbb10('0x55')]()[_0xbb10('0x27')](respondWithResult(_0x4bedd0,null))[_0xbb10('0x46')](handleError(_0x4bedd0,null));};exports[_0xbb10('0x56')]=function(_0x22de7f,_0x175872,_0x12ec18){var _0x205e01={'raw':!![],'where':{}},_0x40c4fb={},_0x2eb05a;return db[_0xbb10('0x2e')][_0xbb10('0x57')]({'where':{'id':_0x22de7f['params']['id']}})['then'](handleEntityNotFound(_0x175872,null))[_0xbb10('0x27')](function(_0x3e6338){if(_0x3e6338){_0x2eb05a=_0x3e6338[_0xbb10('0x29')]({'plain':!![]});_0x40c4fb[_0xbb10('0x33')]=_['keys'](db['UserOpenchannelQueue'][_0xbb10('0x48')]);_0x40c4fb[_0xbb10('0x30')]=_[_0xbb10('0x2f')](_0x22de7f[_0xbb10('0x30')]);_0x40c4fb[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x40c4fb[_0xbb10('0x33')],_0x40c4fb['query']);_0x205e01[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x40c4fb['model'],qs['fields'](_0x22de7f['query'][_0xbb10('0x35')]));_0x205e01[_0xbb10('0x34')]=_0x205e01[_0xbb10('0x34')]['length']?_0x205e01['attributes']:_0x40c4fb['model'];if(!_0x22de7f[_0xbb10('0x30')][_0xbb10('0x58')](_0xbb10('0x37'))){_0x205e01['limit']=qs[_0xbb10('0x38')](_0x22de7f[_0xbb10('0x30')]['limit']);_0x205e01['offset']=qs[_0xbb10('0x21')](_0x22de7f[_0xbb10('0x30')][_0xbb10('0x21')]);}_0x205e01[_0xbb10('0x39')]=qs['sort'](_0x22de7f[_0xbb10('0x30')][_0xbb10('0x3a')]);_0x205e01[_0xbb10('0x3b')]=qs['filters'](_[_0xbb10('0x3c')](_0x22de7f[_0xbb10('0x30')],_0x40c4fb[_0xbb10('0x31')]));_0x205e01['where'][_0xbb10('0x59')]=_0x3e6338['id'];if(_0x22de7f[_0xbb10('0x30')][_0xbb10('0x41')]){_0x205e01[_0xbb10('0x3b')]=_['merge'](_0x205e01[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x5a')](_0x205e01[_0xbb10('0x34')],function(_0x2d0f4b){var _0x56b3a3={};_0x56b3a3[_0x2d0f4b]={'$like':'%'+_0x22de7f[_0xbb10('0x30')][_0xbb10('0x41')]+'%'};return _0x56b3a3;})});}_0x205e01=_[_0xbb10('0x3d')]({},_0x205e01,_0x22de7f[_0xbb10('0x42')]);return db[_0xbb10('0x5b')][_0xbb10('0x44')](_0x205e01);}})[_0xbb10('0x27')](function(_0x4a30c5){if(_0x4a30c5){return db['User']['findAndCountAll']({'where':{'id':_[_0xbb10('0x5a')](_0x4a30c5,_0xbb10('0x5c')),'role':_0xbb10('0x5d')},'attributes':['id','name','openchannelPause',_0xbb10('0x5e'),_0xbb10('0x5f')]});}})[_0xbb10('0x27')](function(_0x3a9677){if(_0x3a9677){return{'count':_0x3a9677[_0xbb10('0x20')],'rows':_[_0xbb10('0x5a')](_0x3a9677['rows'],function(_0x1a5ca5){return{'membername':_0x1a5ca5[_0xbb10('0x2c')],'UserId':_0x1a5ca5['id'],'queue_name':_0x2eb05a[_0xbb10('0x2c')],'OpenchannelQueueId':_0x2eb05a['id'],'interface':util[_0xbb10('0x60')](_0xbb10('0x61'),'SIP',_0x1a5ca5['name']),'penalty':0x0,'paused':_0x1a5ca5['openchannelPause'],'createdAt':_0x1a5ca5[_0xbb10('0x5f')],'updatedAt':_0x1a5ca5[_0xbb10('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbb10('0x27')](respondWithFilteredResult(_0x175872,_0x205e01))[_0xbb10('0x46')](handleError(_0x175872,null));};exports[_0xbb10('0x62')]=function(_0x1d40b8,_0x5d942d,_0x93f3c4){var _0x4bc316={};var _0x4fe3b5={};var _0x519a54;var _0xdf634f;return db[_0xbb10('0x2e')][_0xbb10('0x57')]({'where':{'id':_0x1d40b8[_0xbb10('0x54')]['id']}})['then'](handleEntityNotFound(_0x5d942d,null))[_0xbb10('0x27')](function(_0x5c583b){if(_0x5c583b){_0x519a54=_0x5c583b;_0x4fe3b5['model']=_[_0xbb10('0x2f')](db[_0xbb10('0x63')][_0xbb10('0x48')]);_0x4fe3b5[_0xbb10('0x30')]=_[_0xbb10('0x2f')](_0x1d40b8['query']);_0x4fe3b5[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0x4fe3b5[_0xbb10('0x33')],_0x4fe3b5[_0xbb10('0x30')]);_0x4bc316[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0x4fe3b5[_0xbb10('0x33')],qs['fields'](_0x1d40b8[_0xbb10('0x30')][_0xbb10('0x35')]));_0x4bc316[_0xbb10('0x34')]=_0x4bc316[_0xbb10('0x34')][_0xbb10('0x36')]?_0x4bc316[_0xbb10('0x34')]:_0x4fe3b5[_0xbb10('0x33')];_0x4bc316[_0xbb10('0x39')]=qs['sort'](_0x1d40b8[_0xbb10('0x30')][_0xbb10('0x3a')]);_0x4bc316[_0xbb10('0x3b')]=qs['filters'](_['pick'](_0x1d40b8['query'],_0x4fe3b5[_0xbb10('0x31')]));if(_0x1d40b8['query']['filter']){_0x4bc316[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x4bc316[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x5a')](_0x4bc316[_0xbb10('0x34')],function(_0x24dca6){var _0x33116={};_0x33116[_0x24dca6]={'$like':'%'+_0x1d40b8[_0xbb10('0x30')][_0xbb10('0x41')]+'%'};return _0x33116;})});}_0x4bc316=_['merge']({},_0x4bc316,_0x1d40b8[_0xbb10('0x42')]);return _0x519a54[_0xbb10('0x62')](_0x4bc316);}})[_0xbb10('0x27')](function(_0x35b811){if(_0x35b811){_0xdf634f=_0x35b811['length'];if(!_0x1d40b8['query'][_0xbb10('0x58')](_0xbb10('0x37'))){_0x4bc316[_0xbb10('0x38')]=qs[_0xbb10('0x38')](_0x1d40b8['query'][_0xbb10('0x38')]);_0x4bc316[_0xbb10('0x21')]=qs[_0xbb10('0x21')](_0x1d40b8[_0xbb10('0x30')][_0xbb10('0x21')]);}return _0x519a54['getTeams'](_0x4bc316);}})['then'](function(_0x372636){if(_0x372636){return _0x372636?{'count':_0xdf634f,'rows':_0x372636}:null;}})[_0xbb10('0x27')](respondWithResult(_0x5d942d,null))[_0xbb10('0x46')](handleError(_0x5d942d,null));};exports['addTeams']=function(_0x256b35,_0x13e2ab,_0x50bcc9){var _0x5caa06=[];var _0x2f667f;return db[_0xbb10('0x63')][_0xbb10('0x44')]({'where':{'id':_0x256b35['body'][_0xbb10('0x64')]},'attributes':['id'],'include':[{'model':db[_0xbb10('0x65')],'as':_0xbb10('0x66'),'attributes':['id'],'raw':!![]}]})[_0xbb10('0x27')](function(_0x2ef96f){if(_0x2ef96f){for(var _0x5de006=0x0;_0x5de006<_0x2ef96f[_0xbb10('0x36')];_0x5de006+=0x1){for(var _0x226363=0x0;_0x226363<_0x2ef96f[_0x5de006][_0xbb10('0x66')]['length'];_0x226363+=0x1){_0x5caa06=_[_0xbb10('0x67')](_0x5caa06,[_0x2ef96f[_0x5de006][_0xbb10('0x66')][_0x226363]['id']]);}}return _0x5caa06;}})[_0xbb10('0x27')](function(_0xdb7d3e){if(_0xdb7d3e){return db[_0xbb10('0x2e')][_0xbb10('0x4a')]({'where':{'id':_0x256b35[_0xbb10('0x54')]['id']}});}})[_0xbb10('0x27')](function(_0x17ed20){if(_0x17ed20){_0x2f667f=_0x17ed20;return _0x2f667f[_0xbb10('0x68')](_0x5caa06,{'penalty':_0x256b35[_0xbb10('0x53')][_0xbb10('0x69')]});}})['then'](function(_0x51f106){if(_0x51f106){return _0x2f667f[_0xbb10('0x6a')](_0x256b35[_0xbb10('0x53')][_0xbb10('0x64')]);}})[_0xbb10('0x27')](handleEntityNotFound(_0x13e2ab,null))[_0xbb10('0x27')](respondWithStatusCode(_0x13e2ab,null))['catch'](handleError(_0x13e2ab,null));};exports[_0xbb10('0x6b')]=function(_0x332fbe,_0x3b4d0b,_0x1a51d3){var _0x19694d=[];var _0x379d49;return db['Team'][_0xbb10('0x44')]({'where':{'id':_0x332fbe[_0xbb10('0x30')]['ids']},'attributes':['id'],'include':[{'model':db[_0xbb10('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbb10('0x27')](function(_0x28bd76){if(_0x28bd76){for(var _0x2b473c=0x0;_0x2b473c<_0x28bd76[_0xbb10('0x36')];_0x2b473c+=0x1){for(var _0x3a4a6e=0x0;_0x3a4a6e<_0x28bd76[_0x2b473c]['Agents'][_0xbb10('0x36')];_0x3a4a6e+=0x1){_0x19694d=_['union'](_0x19694d,[_0x28bd76[_0x2b473c][_0xbb10('0x66')][_0x3a4a6e]['id']]);}}return _0x19694d;}})[_0xbb10('0x27')](function(_0x5d767f){if(_0x5d767f){return db['OpenchannelQueue'][_0xbb10('0x4a')]({'where':{'id':_0x332fbe[_0xbb10('0x54')]['id']}});}})[_0xbb10('0x27')](function(_0x283bab){if(_0x283bab){_0x379d49=_0x283bab;return _0x379d49[_0xbb10('0x6c')](_0x19694d);}})[_0xbb10('0x27')](function(_0x1b6ebc){if(_0x379d49){return _0x379d49[_0xbb10('0x6b')](_0x332fbe[_0xbb10('0x30')][_0xbb10('0x64')]);}})[_0xbb10('0x27')](handleEntityNotFound(_0x3b4d0b,null))['then'](respondWithStatusCode(_0x3b4d0b,null))[_0xbb10('0x46')](handleError(_0x3b4d0b,null));};exports[_0xbb10('0x68')]=function(_0x1b0a6c,_0xcd5d35,_0xfe02f5){return db[_0xbb10('0x2e')][_0xbb10('0x4a')]({'where':{'id':_0x1b0a6c[_0xbb10('0x54')]['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0xcd5d35,null))[_0xbb10('0x27')](function(_0x1c4235){if(_0x1c4235){return _0x1c4235[_0xbb10('0x68')](_0x1b0a6c['body'][_0xbb10('0x64')],_['omit'](_0x1b0a6c[_0xbb10('0x53')],[_0xbb10('0x64'),'id'])||{})[_0xbb10('0x6d')](function(_0x40236c){for(var _0x38d369=0x0;_0x38d369<_0x1b0a6c['body'][_0xbb10('0x64')][_0xbb10('0x36')];_0x38d369+=0x1){socket[_0xbb10('0x6e')](_0xbb10('0x6f'),{'UserId':_0x1b0a6c[_0xbb10('0x53')][_0xbb10('0x64')][_0x38d369],'OpenchannelQueueId':_0x1b0a6c['params']['id']});}return _0x40236c;});}})['then'](respondWithResult(_0xcd5d35,null))[_0xbb10('0x46')](handleError(_0xcd5d35,null));};exports[_0xbb10('0x6c')]=function(_0x41d4d0,_0x57d5a1,_0x124b32){var _0x3d6a91;return db['OpenchannelQueue'][_0xbb10('0x4a')]({'where':{'id':_0x41d4d0[_0xbb10('0x54')]['id']}})['then'](handleEntityNotFound(_0x57d5a1,null))[_0xbb10('0x27')](function(_0x4d7bca){if(_0x4d7bca){return _0x4d7bca[_0xbb10('0x6c')](_0x41d4d0[_0xbb10('0x30')]['ids'])[_0xbb10('0x27')](function(_0x28cc74){if(_['isArray'](_0x41d4d0['query'][_0xbb10('0x64')])){for(var _0x13ae83=0x0;_0x13ae83<_0x41d4d0[_0xbb10('0x30')][_0xbb10('0x64')][_0xbb10('0x36')];_0x13ae83+=0x1){socket['emit'](_0xbb10('0x70'),{'UserId':_0x41d4d0[_0xbb10('0x30')][_0xbb10('0x64')][_0x13ae83],'OpenchannelQueueId':_0x41d4d0['params']['id']});}}else{socket[_0xbb10('0x6e')](_0xbb10('0x70'),{'UserId':_0x41d4d0[_0xbb10('0x30')][_0xbb10('0x64')],'OpenchannelQueueId':_0x41d4d0[_0xbb10('0x54')]['id']});}});}})[_0xbb10('0x27')](respondWithStatusCode(_0x57d5a1,null))[_0xbb10('0x46')](handleError(_0x57d5a1,null));};exports[_0xbb10('0x71')]=function(_0x2010d4,_0x5f1fcd,_0x4fc544){var _0x37e40c={};var _0xe7238b={};var _0x293f3f;var _0x44f097;return db[_0xbb10('0x2e')][_0xbb10('0x57')]({'where':{'id':_0x2010d4[_0xbb10('0x54')]['id']}})[_0xbb10('0x27')](handleEntityNotFound(_0x5f1fcd,null))[_0xbb10('0x27')](function(_0x471827){if(_0x471827){_0x293f3f=_0x471827;_0xe7238b[_0xbb10('0x33')]=_[_0xbb10('0x2f')](db[_0xbb10('0x65')]['rawAttributes']);_0xe7238b[_0xbb10('0x30')]=_[_0xbb10('0x2f')](_0x2010d4[_0xbb10('0x30')]);_0xe7238b[_0xbb10('0x31')]=_[_0xbb10('0x32')](_0xe7238b[_0xbb10('0x33')],_0xe7238b[_0xbb10('0x30')]);_0x37e40c[_0xbb10('0x34')]=_[_0xbb10('0x32')](_0xe7238b[_0xbb10('0x33')],qs[_0xbb10('0x35')](_0x2010d4['query'][_0xbb10('0x35')]));_0x37e40c['attributes']=_0x37e40c[_0xbb10('0x34')][_0xbb10('0x36')]?_0x37e40c[_0xbb10('0x34')]:_0xe7238b[_0xbb10('0x33')];_0x37e40c[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_0x2010d4['query'][_0xbb10('0x3a')]);_0x37e40c['where']=qs[_0xbb10('0x31')](_[_0xbb10('0x3c')](_0x2010d4[_0xbb10('0x30')],_0xe7238b[_0xbb10('0x31')]));if(_0x2010d4[_0xbb10('0x30')][_0xbb10('0x41')]){_0x37e40c[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x37e40c[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x5a')](_0x37e40c[_0xbb10('0x34')],function(_0xa09041){var _0x589565={};_0x589565[_0xa09041]={'$like':'%'+_0x2010d4[_0xbb10('0x30')]['filter']+'%'};return _0x589565;})});}_0x37e40c=_[_0xbb10('0x3d')]({},_0x37e40c,_0x2010d4[_0xbb10('0x42')]);return _0x293f3f[_0xbb10('0x71')](_0x37e40c);}})[_0xbb10('0x27')](function(_0x44c229){if(_0x44c229){_0x44f097=_0x44c229[_0xbb10('0x36')];if(!_0x2010d4[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x37'))){_0x37e40c['limit']=qs['limit'](_0x2010d4[_0xbb10('0x30')][_0xbb10('0x38')]);_0x37e40c[_0xbb10('0x21')]=qs[_0xbb10('0x21')](_0x2010d4[_0xbb10('0x30')][_0xbb10('0x21')]);}return _0x293f3f['getAgents'](_0x37e40c);}})[_0xbb10('0x27')](function(_0x2c25ab){if(_0x2c25ab){return _0x2c25ab?{'count':_0x44f097,'rows':_0x2c25ab}:null;}})[_0xbb10('0x27')](respondWithResult(_0x5f1fcd,null))[_0xbb10('0x46')](handleError(_0x5f1fcd,null));}; \ No newline at end of file +var _0xd8b0=['length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','OpenchannelQueue','findAll','rows','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','describe','getMembers','UserOpenchannelQueue','pick','OpenchannelQueueId','map','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','union','addAgents','removeTeams','omit','spread','emit','userOpenchannelQueue:save','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','OpenchannelQueues','end','error','name','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields'];(function(_0x348aaf,_0x2e1a54){var _0x9a670b=function(_0x1a3e42){while(--_0x1a3e42){_0x348aaf['push'](_0x348aaf['shift']());}};_0x9a670b(++_0x2e1a54);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var authService=require(_0x0d8b('0xe'));var hardwareService=require(_0x0d8b('0xf'));var Redis=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];config[_0x0d8b('0x15')]=_[_0x0d8b('0x16')](config[_0x0d8b('0x15')],{'host':_0x0d8b('0x17'),'port':0x18eb});var socket=require(_0x0d8b('0x18'))(new Redis(config[_0x0d8b('0x15')]));require(_0x0d8b('0x19'))[_0x0d8b('0x1a')](socket);function respondWithStatusCode(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xcc;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x1b')](_0x5ad086);}return _0x2ce75e[_0x0d8b('0x1c')](_0x5ad086)['end']();};}function respondWithResult(_0x23eb7b,_0xa86349){_0xa86349=_0xa86349||0xc8;return function(_0x17f7df){if(_0x17f7df){return _0x23eb7b[_0x0d8b('0x1c')](_0xa86349)[_0x0d8b('0x1d')](_0x17f7df);}};}function respondWithFilteredResult(_0x5cd485,_0x106a01){return function(_0x4586c2){if(_0x4586c2){var _0x2fd0fc=_0x4586c2[_0x0d8b('0x1e')],_0x5fecbd=_0x106a01[_0x0d8b('0x1f')],_0x333674=_0x106a01['offset']+_0x106a01[_0x0d8b('0x20')],_0x18dd2d;if(_0x333674>=_0x2fd0fc){_0x333674=_0x2fd0fc;_0x18dd2d=0xc8;}else{_0x18dd2d=0xce;}_0x5cd485[_0x0d8b('0x1c')](_0x18dd2d);return _0x5cd485[_0x0d8b('0x21')](_0x0d8b('0x22'),_0x5fecbd+'-'+_0x333674+'/'+_0x2fd0fc)[_0x0d8b('0x1d')](_0x4586c2);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x23')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x24')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x25')](_0x54a9a7)[_0x0d8b('0x26')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x27')]()[_0x0d8b('0x26')](function(){var _0x27b695=_0x2c64e2['get']({'plain':!![]});var _0xe8bbee=_0x0d8b('0x28');return db['UserProfileResource'][_0x0d8b('0x27')]({'where':{'type':_0xe8bbee,'resourceId':_0x27b695['id']}})['then'](function(){return _0x2c64e2;});})[_0x0d8b('0x26')](function(){_0x38efc8[_0x0d8b('0x1c')](0xcc)[_0x0d8b('0x29')]();});}};}function handleEntityNotFound(_0x4fe6f9,_0x59a905){return function(_0x28f639){if(!_0x28f639){_0x4fe6f9[_0x0d8b('0x1b')](0x194);}return _0x28f639;};}function handleError(_0x4c05ee,_0xcbc4ac){_0xcbc4ac=_0xcbc4ac||0x1f4;return function(_0x59aa83){logger[_0x0d8b('0x2a')](_0x59aa83['stack']);if(_0x59aa83[_0x0d8b('0x2b')]){delete _0x59aa83['name'];}_0x4c05ee[_0x0d8b('0x1c')](_0xcbc4ac)['send'](_0x59aa83);};}exports[_0x0d8b('0x2c')]=function(_0x544735,_0x3c8887){var _0x106e4c={},_0x2c058d={},_0x56120a={'count':0x0,'rows':[]};var _0x4c80a2=db['OpenchannelQueue'][_0x0d8b('0x2d')];_0x2c058d['model']=_[_0x0d8b('0x2e')](_0x4c80a2);_0x2c058d['query']=_['keys'](_0x544735[_0x0d8b('0x2f')]);_0x2c058d[_0x0d8b('0x30')]=_[_0x0d8b('0x31')](_0x2c058d[_0x0d8b('0x32')],_0x2c058d[_0x0d8b('0x2f')]);_0x106e4c[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0x2c058d[_0x0d8b('0x32')],qs['fields'](_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x34')]));_0x106e4c['attributes']=_0x106e4c[_0x0d8b('0x33')][_0x0d8b('0x35')]?_0x106e4c[_0x0d8b('0x33')]:_0x2c058d['model'];if(!_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x36')](_0x0d8b('0x37'))){_0x106e4c[_0x0d8b('0x20')]=qs[_0x0d8b('0x20')](_0x544735['query'][_0x0d8b('0x20')]);_0x106e4c[_0x0d8b('0x1f')]=qs['offset'](_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x1f')]);}_0x106e4c[_0x0d8b('0x38')]=qs[_0x0d8b('0x39')](_0x544735[_0x0d8b('0x2f')]['sort']);_0x106e4c['where']=qs[_0x0d8b('0x30')](_['pick'](_0x544735['query'],_0x2c058d[_0x0d8b('0x30')]));if(_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x3a')]){_0x106e4c[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x106e4c[_0x0d8b('0x3b')],{'$or':_['map'](_0x4c80a2,function(_0x6e5bab){if(_0x6e5bab[_0x0d8b('0x3d')][_0x0d8b('0x3e')]!==_0x0d8b('0x3f')){var _0x338ed3={};_0x338ed3[_0x6e5bab[_0x0d8b('0x40')]]={'$like':'%'+_0x544735[_0x0d8b('0x2f')]['filter']+'%'};return _0x338ed3;}})});}_0x106e4c=_[_0x0d8b('0x3c')]({},_0x106e4c,_0x544735[_0x0d8b('0x41')]);var _0x3fa955={'where':_0x106e4c[_0x0d8b('0x3b')]};return db['OpenchannelQueue'][_0x0d8b('0x1e')](_0x3fa955)['then'](function(_0x37b26c){_0x56120a[_0x0d8b('0x1e')]=_0x37b26c;if(_0x544735[_0x0d8b('0x2f')][_0x0d8b('0x42')]){_0x106e4c[_0x0d8b('0x43')]=[{'all':!![]}];}return db[_0x0d8b('0x44')][_0x0d8b('0x45')](_0x106e4c);})[_0x0d8b('0x26')](function(_0x89ab0d){_0x56120a[_0x0d8b('0x46')]=_0x89ab0d;return _0x56120a;})['then'](respondWithFilteredResult(_0x3c8887,_0x106e4c))['catch'](handleError(_0x3c8887,null));};exports['show']=function(_0x4d0811,_0x524d79){var _0x1a46f6={'raw':!![],'where':{'id':_0x4d0811[_0x0d8b('0x47')]['id']}},_0x402fe0={};_0x402fe0['model']=_['keys'](db[_0x0d8b('0x44')][_0x0d8b('0x2d')]);_0x402fe0[_0x0d8b('0x2f')]=_['keys'](_0x4d0811[_0x0d8b('0x2f')]);_0x402fe0[_0x0d8b('0x30')]=_['intersection'](_0x402fe0['model'],_0x402fe0[_0x0d8b('0x2f')]);_0x1a46f6['attributes']=_[_0x0d8b('0x31')](_0x402fe0['model'],qs['fields'](_0x4d0811[_0x0d8b('0x2f')][_0x0d8b('0x34')]));_0x1a46f6['attributes']=_0x1a46f6['attributes']['length']?_0x1a46f6['attributes']:_0x402fe0[_0x0d8b('0x32')];if(_0x4d0811[_0x0d8b('0x2f')][_0x0d8b('0x42')]){_0x1a46f6['include']=[{'all':!![]}];}_0x1a46f6=_[_0x0d8b('0x3c')]({},_0x1a46f6,_0x4d0811[_0x0d8b('0x41')]);return db[_0x0d8b('0x44')][_0x0d8b('0x48')](_0x1a46f6)[_0x0d8b('0x26')](handleEntityNotFound(_0x524d79,null))[_0x0d8b('0x26')](respondWithResult(_0x524d79,null))[_0x0d8b('0x49')](handleError(_0x524d79,null));};exports[_0x0d8b('0x4a')]=function(_0x384a5e,_0x1f2077){return db[_0x0d8b('0x44')][_0x0d8b('0x4a')](_0x384a5e[_0x0d8b('0x4b')],{})[_0x0d8b('0x26')](function(_0x570af8){var _0xdfcf32=_0x384a5e[_0x0d8b('0x4c')][_0x0d8b('0x4d')]({'plain':!![]});if(!_0xdfcf32)throw new Error(_0x0d8b('0x4e'));if(_0xdfcf32['role']===_0x0d8b('0x4c')){var _0x4d8850=_0x570af8['get']({'plain':!![]});var _0x39a31d=_0x0d8b('0x28');return db[_0x0d8b('0x4f')][_0x0d8b('0x48')]({'where':{'name':_0x39a31d,'userProfileId':_0xdfcf32['userProfileId']},'raw':!![]})[_0x0d8b('0x26')](function(_0x1106d6){if(_0x1106d6&&_0x1106d6[_0x0d8b('0x50')]===0x0){return db[_0x0d8b('0x51')][_0x0d8b('0x4a')]({'name':_0x4d8850['name'],'resourceId':_0x4d8850['id'],'type':_0x1106d6['name'],'sectionId':_0x1106d6['id']},{})['then'](function(){return _0x570af8;});}else{return _0x570af8;}})['catch'](function(_0x368ede){logger[_0x0d8b('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368ede);throw _0x368ede;});}return _0x570af8;})['then'](respondWithResult(_0x1f2077,0xc9))[_0x0d8b('0x49')](handleError(_0x1f2077,null));};exports[_0x0d8b('0x25')]=function(_0x5c5bd7,_0x5ef6c3){if(_0x5c5bd7[_0x0d8b('0x4b')]['id']){delete _0x5c5bd7[_0x0d8b('0x4b')]['id'];}return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x5c5bd7[_0x0d8b('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ef6c3,null))[_0x0d8b('0x26')](saveUpdates(_0x5c5bd7[_0x0d8b('0x4b')],null))['then'](respondWithResult(_0x5ef6c3,null))['catch'](handleError(_0x5ef6c3,null));};exports[_0x0d8b('0x27')]=function(_0x3f2d95,_0x546fef){return db['OpenchannelQueue'][_0x0d8b('0x48')]({'where':{'id':_0x3f2d95[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x546fef,null))[_0x0d8b('0x26')](removeEntity(_0x546fef,null))['catch'](handleError(_0x546fef,null));};exports[_0x0d8b('0x52')]=function(_0x598e03,_0x5c271c){return db[_0x0d8b('0x44')][_0x0d8b('0x52')]()['then'](respondWithResult(_0x5c271c,null))['catch'](handleError(_0x5c271c,null));};exports[_0x0d8b('0x53')]=function(_0x3d7161,_0xccc2a9,_0x2c1eb0){var _0x3afc3a={'raw':!![],'where':{}},_0xb66e76={},_0x3978e5;return db[_0x0d8b('0x44')]['findOne']({'where':{'id':_0x3d7161[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0xccc2a9,null))[_0x0d8b('0x26')](function(_0x3c7efb){if(_0x3c7efb){_0x3978e5=_0x3c7efb[_0x0d8b('0x4d')]({'plain':!![]});_0xb66e76[_0x0d8b('0x32')]=_[_0x0d8b('0x2e')](db[_0x0d8b('0x54')][_0x0d8b('0x2d')]);_0xb66e76['query']=_[_0x0d8b('0x2e')](_0x3d7161[_0x0d8b('0x2f')]);_0xb66e76[_0x0d8b('0x30')]=_[_0x0d8b('0x31')](_0xb66e76[_0x0d8b('0x32')],_0xb66e76['query']);_0x3afc3a[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0xb66e76[_0x0d8b('0x32')],qs[_0x0d8b('0x34')](_0x3d7161[_0x0d8b('0x2f')]['fields']));_0x3afc3a['attributes']=_0x3afc3a[_0x0d8b('0x33')][_0x0d8b('0x35')]?_0x3afc3a[_0x0d8b('0x33')]:_0xb66e76[_0x0d8b('0x32')];if(!_0x3d7161['query'][_0x0d8b('0x36')](_0x0d8b('0x37'))){_0x3afc3a[_0x0d8b('0x20')]=qs['limit'](_0x3d7161[_0x0d8b('0x2f')]['limit']);_0x3afc3a[_0x0d8b('0x1f')]=qs[_0x0d8b('0x1f')](_0x3d7161[_0x0d8b('0x2f')][_0x0d8b('0x1f')]);}_0x3afc3a[_0x0d8b('0x38')]=qs[_0x0d8b('0x39')](_0x3d7161['query'][_0x0d8b('0x39')]);_0x3afc3a['where']=qs[_0x0d8b('0x30')](_[_0x0d8b('0x55')](_0x3d7161[_0x0d8b('0x2f')],_0xb66e76[_0x0d8b('0x30')]));_0x3afc3a['where'][_0x0d8b('0x56')]=_0x3c7efb['id'];if(_0x3d7161[_0x0d8b('0x2f')][_0x0d8b('0x3a')]){_0x3afc3a[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x3afc3a[_0x0d8b('0x3b')],{'$or':_[_0x0d8b('0x57')](_0x3afc3a[_0x0d8b('0x33')],function(_0x2ce282){var _0x34affb={};_0x34affb[_0x2ce282]={'$like':'%'+_0x3d7161['query']['filter']+'%'};return _0x34affb;})});}_0x3afc3a=_[_0x0d8b('0x3c')]({},_0x3afc3a,_0x3d7161[_0x0d8b('0x41')]);return db['UserOpenchannelQueue'][_0x0d8b('0x45')](_0x3afc3a);}})['then'](function(_0x5cc960){if(_0x5cc960){return db[_0x0d8b('0x58')][_0x0d8b('0x59')]({'where':{'id':_['map'](_0x5cc960,'UserId'),'role':_0x0d8b('0x5a')},'attributes':['id',_0x0d8b('0x2b'),_0x0d8b('0x5b'),_0x0d8b('0x5c'),_0x0d8b('0x5d')]});}})[_0x0d8b('0x26')](function(_0x40d265){if(_0x40d265){return{'count':_0x40d265['count'],'rows':_[_0x0d8b('0x57')](_0x40d265['rows'],function(_0x1a203e){return{'membername':_0x1a203e[_0x0d8b('0x2b')],'UserId':_0x1a203e['id'],'queue_name':_0x3978e5[_0x0d8b('0x2b')],'OpenchannelQueueId':_0x3978e5['id'],'interface':util[_0x0d8b('0x5e')]('%s/%s',_0x0d8b('0x5f'),_0x1a203e['name']),'penalty':0x0,'paused':_0x1a203e[_0x0d8b('0x5b')],'createdAt':_0x1a203e[_0x0d8b('0x5d')],'updatedAt':_0x1a203e[_0x0d8b('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0d8b('0x26')](respondWithFilteredResult(_0xccc2a9,_0x3afc3a))[_0x0d8b('0x49')](handleError(_0xccc2a9,null));};exports[_0x0d8b('0x60')]=function(_0x3e927c,_0x91aa89,_0x266a69){var _0x44aa74={};var _0x4eb07e={};var _0x1436b3;var _0x54c28b;return db[_0x0d8b('0x44')][_0x0d8b('0x61')]({'where':{'id':_0x3e927c['params']['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x91aa89,null))['then'](function(_0x10c318){if(_0x10c318){_0x1436b3=_0x10c318;_0x4eb07e[_0x0d8b('0x32')]=_[_0x0d8b('0x2e')](db[_0x0d8b('0x62')][_0x0d8b('0x2d')]);_0x4eb07e[_0x0d8b('0x2f')]=_[_0x0d8b('0x2e')](_0x3e927c[_0x0d8b('0x2f')]);_0x4eb07e['filters']=_[_0x0d8b('0x31')](_0x4eb07e[_0x0d8b('0x32')],_0x4eb07e['query']);_0x44aa74[_0x0d8b('0x33')]=_[_0x0d8b('0x31')](_0x4eb07e[_0x0d8b('0x32')],qs[_0x0d8b('0x34')](_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x34')]));_0x44aa74[_0x0d8b('0x33')]=_0x44aa74[_0x0d8b('0x33')][_0x0d8b('0x35')]?_0x44aa74[_0x0d8b('0x33')]:_0x4eb07e[_0x0d8b('0x32')];_0x44aa74[_0x0d8b('0x38')]=qs['sort'](_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x39')]);_0x44aa74[_0x0d8b('0x3b')]=qs['filters'](_['pick'](_0x3e927c[_0x0d8b('0x2f')],_0x4eb07e[_0x0d8b('0x30')]));if(_0x3e927c[_0x0d8b('0x2f')]['filter']){_0x44aa74['where']=_[_0x0d8b('0x3c')](_0x44aa74[_0x0d8b('0x3b')],{'$or':_[_0x0d8b('0x57')](_0x44aa74[_0x0d8b('0x33')],function(_0x2a2b58){var _0x3f7895={};_0x3f7895[_0x2a2b58]={'$like':'%'+_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x3a')]+'%'};return _0x3f7895;})});}_0x44aa74=_[_0x0d8b('0x3c')]({},_0x44aa74,_0x3e927c[_0x0d8b('0x41')]);return _0x1436b3[_0x0d8b('0x60')](_0x44aa74);}})[_0x0d8b('0x26')](function(_0x3b060e){if(_0x3b060e){_0x54c28b=_0x3b060e['length'];if(!_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x36')]('nolimit')){_0x44aa74['limit']=qs[_0x0d8b('0x20')](_0x3e927c[_0x0d8b('0x2f')][_0x0d8b('0x20')]);_0x44aa74[_0x0d8b('0x1f')]=qs[_0x0d8b('0x1f')](_0x3e927c[_0x0d8b('0x2f')]['offset']);}return _0x1436b3['getTeams'](_0x44aa74);}})['then'](function(_0x1f1eae){if(_0x1f1eae){return _0x1f1eae?{'count':_0x54c28b,'rows':_0x1f1eae}:null;}})[_0x0d8b('0x26')](respondWithResult(_0x91aa89,null))[_0x0d8b('0x49')](handleError(_0x91aa89,null));};exports[_0x0d8b('0x63')]=function(_0x3f1eee,_0x21d620,_0x5ef461){var _0x302426=[];var _0x1d173f;return db['Team'][_0x0d8b('0x45')]({'where':{'id':_0x3f1eee['body'][_0x0d8b('0x64')]},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x58')],'as':_0x0d8b('0x65'),'attributes':['id'],'raw':!![]}]})[_0x0d8b('0x26')](function(_0x10c7ab){if(_0x10c7ab){for(var _0x8fae7f=0x0;_0x8fae7f<_0x10c7ab[_0x0d8b('0x35')];_0x8fae7f+=0x1){for(var _0xb73e32=0x0;_0xb73e32<_0x10c7ab[_0x8fae7f][_0x0d8b('0x65')][_0x0d8b('0x35')];_0xb73e32+=0x1){_0x302426=_[_0x0d8b('0x66')](_0x302426,[_0x10c7ab[_0x8fae7f][_0x0d8b('0x65')][_0xb73e32]['id']]);}}return _0x302426;}})['then'](function(_0x4dd64b){if(_0x4dd64b){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x3f1eee[_0x0d8b('0x47')]['id']}});}})[_0x0d8b('0x26')](function(_0xf91ecd){if(_0xf91ecd){_0x1d173f=_0xf91ecd;return _0x1d173f[_0x0d8b('0x67')](_0x302426,{'penalty':_0x3f1eee[_0x0d8b('0x4b')]['penalty']});}})[_0x0d8b('0x26')](function(_0x4c3948){if(_0x4c3948){return _0x1d173f[_0x0d8b('0x63')](_0x3f1eee['body']['ids']);}})[_0x0d8b('0x26')](handleEntityNotFound(_0x21d620,null))[_0x0d8b('0x26')](respondWithStatusCode(_0x21d620,null))[_0x0d8b('0x49')](handleError(_0x21d620,null));};exports[_0x0d8b('0x68')]=function(_0x2cf02c,_0x2eece2,_0x3c7b9b){var _0x180eda=[];var _0x35267a;return db[_0x0d8b('0x62')][_0x0d8b('0x45')]({'where':{'id':_0x2cf02c[_0x0d8b('0x2f')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x58')],'as':_0x0d8b('0x65'),'attributes':['id'],'raw':!![]}]})[_0x0d8b('0x26')](function(_0x5eba19){if(_0x5eba19){for(var _0x4ce443=0x0;_0x4ce443<_0x5eba19[_0x0d8b('0x35')];_0x4ce443+=0x1){for(var _0x671705=0x0;_0x671705<_0x5eba19[_0x4ce443][_0x0d8b('0x65')][_0x0d8b('0x35')];_0x671705+=0x1){_0x180eda=_[_0x0d8b('0x66')](_0x180eda,[_0x5eba19[_0x4ce443][_0x0d8b('0x65')][_0x671705]['id']]);}}return _0x180eda;}})['then'](function(_0x1a96ce){if(_0x1a96ce){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x2cf02c[_0x0d8b('0x47')]['id']}});}})[_0x0d8b('0x26')](function(_0x55ea97){if(_0x55ea97){_0x35267a=_0x55ea97;return _0x35267a['removeAgents'](_0x180eda);}})[_0x0d8b('0x26')](function(_0x41ea29){if(_0x35267a){return _0x35267a[_0x0d8b('0x68')](_0x2cf02c['query'][_0x0d8b('0x64')]);}})[_0x0d8b('0x26')](handleEntityNotFound(_0x2eece2,null))[_0x0d8b('0x26')](respondWithStatusCode(_0x2eece2,null))['catch'](handleError(_0x2eece2,null));};exports[_0x0d8b('0x67')]=function(_0x3bc6d5,_0xeca283,_0x9ec9bc){return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x3bc6d5[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0xeca283,null))[_0x0d8b('0x26')](function(_0x4bb4c7){if(_0x4bb4c7){return _0x4bb4c7[_0x0d8b('0x67')](_0x3bc6d5[_0x0d8b('0x4b')][_0x0d8b('0x64')],_[_0x0d8b('0x69')](_0x3bc6d5[_0x0d8b('0x4b')],[_0x0d8b('0x64'),'id'])||{})[_0x0d8b('0x6a')](function(_0x673201){for(var _0x35ebba=0x0;_0x35ebba<_0x3bc6d5['body']['ids'][_0x0d8b('0x35')];_0x35ebba+=0x1){socket[_0x0d8b('0x6b')](_0x0d8b('0x6c'),{'UserId':_0x3bc6d5[_0x0d8b('0x4b')]['ids'][_0x35ebba],'OpenchannelQueueId':_0x3bc6d5[_0x0d8b('0x47')]['id']});}return _0x673201;});}})[_0x0d8b('0x26')](respondWithResult(_0xeca283,null))['catch'](handleError(_0xeca283,null));};exports[_0x0d8b('0x6d')]=function(_0x4e1b5b,_0x4fb226,_0x2e5f7a){var _0x33965a;return db[_0x0d8b('0x44')][_0x0d8b('0x48')]({'where':{'id':_0x4e1b5b[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x4fb226,null))[_0x0d8b('0x26')](function(_0x4ceb3a){if(_0x4ceb3a){return _0x4ceb3a[_0x0d8b('0x6d')](_0x4e1b5b['query']['ids'])[_0x0d8b('0x26')](function(_0x5c50f2){if(_[_0x0d8b('0x6e')](_0x4e1b5b[_0x0d8b('0x2f')]['ids'])){for(var _0x12f2bb=0x0;_0x12f2bb<_0x4e1b5b['query']['ids'][_0x0d8b('0x35')];_0x12f2bb+=0x1){socket[_0x0d8b('0x6b')](_0x0d8b('0x6f'),{'UserId':_0x4e1b5b[_0x0d8b('0x2f')][_0x0d8b('0x64')][_0x12f2bb],'OpenchannelQueueId':_0x4e1b5b['params']['id']});}}else{socket['emit'](_0x0d8b('0x6f'),{'UserId':_0x4e1b5b[_0x0d8b('0x2f')][_0x0d8b('0x64')],'OpenchannelQueueId':_0x4e1b5b[_0x0d8b('0x47')]['id']});}});}})[_0x0d8b('0x26')](respondWithStatusCode(_0x4fb226,null))[_0x0d8b('0x49')](handleError(_0x4fb226,null));};exports[_0x0d8b('0x70')]=function(_0x21bfd1,_0x4e3dd1,_0x5ab046){var _0x3582d3={};var _0x2640a6={};var _0x4a453b;var _0x551995;return db['OpenchannelQueue'][_0x0d8b('0x61')]({'where':{'id':_0x21bfd1[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x26')](handleEntityNotFound(_0x4e3dd1,null))['then'](function(_0x21643d){if(_0x21643d){_0x4a453b=_0x21643d;_0x2640a6[_0x0d8b('0x32')]=_[_0x0d8b('0x2e')](db['User'][_0x0d8b('0x2d')]);_0x2640a6['query']=_[_0x0d8b('0x2e')](_0x21bfd1['query']);_0x2640a6[_0x0d8b('0x30')]=_[_0x0d8b('0x31')](_0x2640a6[_0x0d8b('0x32')],_0x2640a6[_0x0d8b('0x2f')]);_0x3582d3[_0x0d8b('0x33')]=_['intersection'](_0x2640a6[_0x0d8b('0x32')],qs['fields'](_0x21bfd1[_0x0d8b('0x2f')]['fields']));_0x3582d3[_0x0d8b('0x33')]=_0x3582d3['attributes']['length']?_0x3582d3[_0x0d8b('0x33')]:_0x2640a6[_0x0d8b('0x32')];_0x3582d3['order']=qs[_0x0d8b('0x39')](_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x39')]);_0x3582d3['where']=qs['filters'](_['pick'](_0x21bfd1[_0x0d8b('0x2f')],_0x2640a6[_0x0d8b('0x30')]));if(_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x3a')]){_0x3582d3[_0x0d8b('0x3b')]=_[_0x0d8b('0x3c')](_0x3582d3[_0x0d8b('0x3b')],{'$or':_[_0x0d8b('0x57')](_0x3582d3[_0x0d8b('0x33')],function(_0xba602f){var _0x4dc5bd={};_0x4dc5bd[_0xba602f]={'$like':'%'+_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x3a')]+'%'};return _0x4dc5bd;})});}_0x3582d3=_[_0x0d8b('0x3c')]({},_0x3582d3,_0x21bfd1['options']);return _0x4a453b[_0x0d8b('0x70')](_0x3582d3);}})[_0x0d8b('0x26')](function(_0x13bce2){if(_0x13bce2){_0x551995=_0x13bce2[_0x0d8b('0x35')];if(!_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x36')](_0x0d8b('0x37'))){_0x3582d3[_0x0d8b('0x20')]=qs[_0x0d8b('0x20')](_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x20')]);_0x3582d3[_0x0d8b('0x1f')]=qs['offset'](_0x21bfd1[_0x0d8b('0x2f')][_0x0d8b('0x1f')]);}return _0x4a453b[_0x0d8b('0x70')](_0x3582d3);}})[_0x0d8b('0x26')](function(_0x590889){if(_0x590889){return _0x590889?{'count':_0x551995,'rows':_0x590889}:null;}})['then'](respondWithResult(_0x4e3dd1,null))[_0x0d8b('0x49')](handleError(_0x4e3dd1,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index ac25d86..de5d099 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 _0x241d=['OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x216675,_0x50c3fc){var _0x3032e5=function(_0x1f57cd){while(--_0x1f57cd){_0x216675['push'](_0x216675['shift']());}};_0x3032e5(++_0x50c3fc);}(_0x241d,0xa1));var _0xd241=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x241d[_0x278e3c];return _0x3e2d9b;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xd241('0x0'))['db'][_0xd241('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd241('0x2')](0x0);var events={'afterCreate':_0xd241('0x3'),'afterUpdate':_0xd241('0x4'),'afterDestroy':_0xd241('0x5')};function emitEvent(_0x1bc456){return function(_0x5ca15b,_0x4b69fe,_0x3d7f52){OpenchannelQueueEvents[_0xd241('0x6')](_0x1bc456+':'+_0x5ca15b['id'],_0x5ca15b);OpenchannelQueueEvents[_0xd241('0x6')](_0x1bc456,_0x5ca15b);_0x3d7f52(null);};}for(var e in events){if(events[_0xd241('0x7')](e)){var event=events[e];OpenchannelQueue[_0xd241('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x28c5=['save','update','emit','hasOwnProperty','hook','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x28c5,0x195));var _0x528c=function(_0x249cc9,_0x270d56){_0x249cc9=_0x249cc9-0x0;var _0x307088=_0x28c5[_0x249cc9];return _0x307088;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x528c('0x0'))['db'][_0x528c('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x528c('0x2')](0x0);var events={'afterCreate':_0x528c('0x3'),'afterUpdate':_0x528c('0x4'),'afterDestroy':'remove'};function emitEvent(_0xf0a2d8){return function(_0x10b33b,_0x17d3ba,_0x2ccabc){OpenchannelQueueEvents[_0x528c('0x5')](_0xf0a2d8+':'+_0x10b33b['id'],_0x10b33b);OpenchannelQueueEvents[_0x528c('0x5')](_0xf0a2d8,_0x10b33b);_0x2ccabc(null);};}for(var e in events){if(events[_0x528c('0x6')](e)){var event=events[e];OpenchannelQueue[_0x528c('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index f7e72e7..2a4ea06 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 _0xb821=['../../config/logger','bluebird','exports','define','openchannel_queues','util'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0xb821,0xa7));var _0x1b82=function(_0x47d68b,_0x31a32c){_0x47d68b=_0x47d68b-0x0;var _0xdc962f=_0xb821[_0x47d68b];return _0xdc962f;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var attributes=require('./openchannelQueue.attributes');module[_0x1b82('0x3')]=function(_0x1403ab,_0x3fadf0){return _0x1403ab[_0x1b82('0x4')]('OpenchannelQueue',attributes,{'tableName':_0x1b82('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2750=['request-promise','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x53b611,_0x2912fa){var _0x5649aa=function(_0x18b222){while(--_0x18b222){_0x53b611['push'](_0x53b611['shift']());}};_0x5649aa(++_0x2912fa);}(_0x2750,0x13b));var _0x0275=function(_0x5b6743,_0x13a4c9){_0x5b6743=_0x5b6743-0x0;var _0x35fec4=_0x2750[_0x5b6743];return _0x35fec4;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var attributes=require(_0x0275('0x6'));module[_0x0275('0x7')]=function(_0x4960,_0x3d0c9c){return _0x4960[_0x0275('0x8')]('OpenchannelQueue',attributes,{'tableName':_0x0275('0x9'),'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 82f05ab..8b99dee 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 _0xc3fe=['localhost','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','OpenchannelQueue','findAll','options','raw','attributes','map','include','model','GetOpenchannelQueue','ShowOpenchannelQueue','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x5512c0,_0x329f0e){var _0x3501b5=function(_0xa6119e){while(--_0xa6119e){_0x5512c0['push'](_0x5512c0['shift']());}};_0x3501b5(++_0x329f0e);}(_0xc3fe,0xff));var _0xec3f=function(_0x632b39,_0x18a83b){_0x632b39=_0x632b39-0x0;var _0x25c9fb=_0xc3fe[_0x632b39];return _0x25c9fb;};'use strict';var _=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var moment=require(_0xec3f('0x2'));var BPromise=require('bluebird');var rs=require(_0xec3f('0x3'));var fs=require('fs');var Redis=require(_0xec3f('0x4'));var db=require(_0xec3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec3f('0x6'))(_0xec3f('0x7'));var config=require(_0xec3f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec3f('0x9')]({'port':0x232a});config[_0xec3f('0xa')]=_['defaults'](config['redis'],{'host':_0xec3f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec3f('0xa')]));require(_0xec3f('0xc'))[_0xec3f('0xd')](socket);function respondWithRpcPromise(_0x163eb8,_0x54a3fc,_0x3b5cc3){return new BPromise(function(_0x201b95,_0x12806d){return client[_0xec3f('0xe')](_0x163eb8,_0x3b5cc3)[_0xec3f('0xf')](function(_0x39f5a2){logger['info'](_0xec3f('0x10'),_0x54a3fc,_0xec3f('0x11'));logger[_0xec3f('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x54a3fc,'request\x20sent',JSON[_0xec3f('0x13')](_0x39f5a2));if(_0x39f5a2['error']){if(_0x39f5a2['error'][_0xec3f('0x14')]===0x1f4){logger[_0xec3f('0x15')](_0xec3f('0x10'),_0x54a3fc,_0x39f5a2['error']['message']);return _0x12806d(_0x39f5a2[_0xec3f('0x15')]['message']);}logger[_0xec3f('0x15')](_0xec3f('0x10'),_0x54a3fc,_0x39f5a2['error'][_0xec3f('0x16')]);return _0x201b95(_0x39f5a2[_0xec3f('0x15')][_0xec3f('0x16')]);}else{logger[_0xec3f('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x54a3fc,_0xec3f('0x11'));_0x201b95(_0x39f5a2[_0xec3f('0x18')][_0xec3f('0x16')]);}})[_0xec3f('0x19')](function(_0x2051cd){logger['error'](_0xec3f('0x10'),_0x54a3fc,_0x2051cd);_0x12806d(_0x2051cd);});});}exports['GetOpenchannelQueue']=function(_0x3f5bbc){var _0xd5311e=this;return new Promise(function(_0x1d6a23,_0x47b6f9){return db[_0xec3f('0x1a')][_0xec3f('0x1b')]({'raw':_0x3f5bbc['options']?_0x3f5bbc[_0xec3f('0x1c')][_0xec3f('0x1d')]===undefined?!![]:![]:!![],'where':_0x3f5bbc[_0xec3f('0x1c')]?_0x3f5bbc[_0xec3f('0x1c')]['where']||null:null,'attributes':_0x3f5bbc[_0xec3f('0x1c')]?_0x3f5bbc[_0xec3f('0x1c')][_0xec3f('0x1e')]||null:null,'limit':_0x3f5bbc['options']?_0x3f5bbc[_0xec3f('0x1c')]['limit']||null:null,'include':_0x3f5bbc[_0xec3f('0x1c')]?_0x3f5bbc['options']['include']?_[_0xec3f('0x1f')](_0x3f5bbc['options'][_0xec3f('0x20')],function(_0xa12054){return{'model':db[_0xa12054[_0xec3f('0x21')]],'as':_0xa12054['as'],'attributes':_0xa12054['attributes'],'include':_0xa12054[_0xec3f('0x20')]?_[_0xec3f('0x1f')](_0xa12054['include'],function(_0x53cc0d){return{'model':db[_0x53cc0d[_0xec3f('0x21')]],'as':_0x53cc0d['as'],'attributes':_0x53cc0d['attributes'],'include':_0x53cc0d[_0xec3f('0x20')]?_[_0xec3f('0x1f')](_0x53cc0d[_0xec3f('0x20')],function(_0x2eac8d){return{'model':db[_0x2eac8d[_0xec3f('0x21')]],'as':_0x2eac8d['as'],'attributes':_0x2eac8d[_0xec3f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xec3f('0xf')](function(_0x237134){logger['info'](_0xec3f('0x22'),_0x3f5bbc);logger[_0xec3f('0x12')]('GetOpenchannelQueue',_0x3f5bbc,JSON[_0xec3f('0x13')](_0x237134));_0x1d6a23(_0x237134);})[_0xec3f('0x19')](function(_0x328284){logger[_0xec3f('0x15')](_0xec3f('0x22'),_0x328284[_0xec3f('0x16')],_0x3f5bbc);_0x47b6f9(_0xd5311e[_0xec3f('0x15')](0x1f4,_0x328284[_0xec3f('0x16')]));});});};exports[_0xec3f('0x23')]=function(_0x1b5563){var _0x365147=this;return new Promise(function(_0x29b0e4,_0x3d95d4){return db[_0xec3f('0x1a')][_0xec3f('0x24')]({'raw':_0x1b5563['options']?_0x1b5563[_0xec3f('0x1c')][_0xec3f('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b5563[_0xec3f('0x1c')]?_0x1b5563[_0xec3f('0x1c')][_0xec3f('0x25')]||null:null,'attributes':_0x1b5563['options']?_0x1b5563[_0xec3f('0x1c')][_0xec3f('0x1e')]||null:null,'include':_0x1b5563[_0xec3f('0x1c')]?_0x1b5563['options']['include']?_[_0xec3f('0x1f')](_0x1b5563['options'][_0xec3f('0x20')],function(_0x55de27){return{'model':db[_0x55de27[_0xec3f('0x21')]],'as':_0x55de27['as'],'attributes':_0x55de27['attributes'],'include':_0x55de27['include']?_[_0xec3f('0x1f')](_0x55de27[_0xec3f('0x20')],function(_0x257ad7){return{'model':db[_0x257ad7[_0xec3f('0x21')]],'as':_0x257ad7['as'],'attributes':_0x257ad7[_0xec3f('0x1e')],'include':_0x257ad7[_0xec3f('0x20')]?_['map'](_0x257ad7['include'],function(_0x382faf){return{'model':db[_0x382faf[_0xec3f('0x21')]],'as':_0x382faf['as'],'attributes':_0x382faf[_0xec3f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xec3f('0xf')](function(_0x1ee3ec){logger[_0xec3f('0x17')](_0xec3f('0x23'),_0x1b5563);logger['debug'](_0xec3f('0x23'),_0x1b5563,JSON['stringify'](_0x1ee3ec));_0x29b0e4(_0x1ee3ec);})[_0xec3f('0x19')](function(_0x432605){logger[_0xec3f('0x15')](_0xec3f('0x23'),_0x432605[_0xec3f('0x16')],_0x1b5563);_0x3d95d4(_0x365147[_0xec3f('0x15')](0x1f4,_0x432605[_0xec3f('0x16')]));});});}; \ No newline at end of file +var _0x207c=['../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowOpenchannelQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1bd7b7,_0x18e7c4){var _0x46a408=function(_0x447563){while(--_0x447563){_0x1bd7b7['push'](_0x1bd7b7['shift']());}};_0x46a408(++_0x18e7c4);}(_0x207c,0x1e8));var _0xc207=function(_0x262b56,_0x489281){_0x262b56=_0x262b56-0x0;var _0x106c6e=_0x207c[_0x262b56];return _0x106c6e;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});config[_0xc207('0x9')]=_[_0xc207('0xa')](config['redis'],{'host':_0xc207('0xb'),'port':0x18eb});var socket=require(_0xc207('0xc'))(new Redis(config[_0xc207('0x9')]));require('./openchannelQueue.socket')[_0xc207('0xd')](socket);function respondWithRpcPromise(_0x817576,_0x216e14,_0x13ec41){return new BPromise(function(_0x201162,_0x347549){return client['request'](_0x817576,_0x13ec41)['then'](function(_0x5b556f){logger[_0xc207('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'));logger[_0xc207('0x10')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'),JSON[_0xc207('0x11')](_0x5b556f));if(_0x5b556f[_0xc207('0x12')]){if(_0x5b556f[_0xc207('0x12')][_0xc207('0x13')]===0x1f4){logger['error'](_0xc207('0x14'),_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x347549(_0x5b556f[_0xc207('0x12')]['message']);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x201162(_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);}else{logger['info'](_0xc207('0x14'),_0x216e14,_0xc207('0xf'));_0x201162(_0x5b556f[_0xc207('0x16')]['message']);}})[_0xc207('0x17')](function(_0x488cc0){logger[_0xc207('0x12')](_0xc207('0x14'),_0x216e14,_0x488cc0);_0x347549(_0x488cc0);});});}exports[_0xc207('0x18')]=function(_0x461f6a){var _0xce0770=this;return new Promise(function(_0x2caec5,_0x35c0b0){return db[_0xc207('0x19')][_0xc207('0x1a')]({'raw':_0x461f6a[_0xc207('0x1b')]?_0x461f6a[_0xc207('0x1b')][_0xc207('0x1c')]===undefined?!![]:![]:!![],'where':_0x461f6a[_0xc207('0x1b')]?_0x461f6a['options'][_0xc207('0x1d')]||null:null,'attributes':_0x461f6a['options']?_0x461f6a[_0xc207('0x1b')][_0xc207('0x1e')]||null:null,'limit':_0x461f6a[_0xc207('0x1b')]?_0x461f6a[_0xc207('0x1b')][_0xc207('0x1f')]||null:null,'include':_0x461f6a[_0xc207('0x1b')]?_0x461f6a[_0xc207('0x1b')][_0xc207('0x20')]?_[_0xc207('0x21')](_0x461f6a[_0xc207('0x1b')][_0xc207('0x20')],function(_0x27df03){return{'model':db[_0x27df03[_0xc207('0x22')]],'as':_0x27df03['as'],'attributes':_0x27df03[_0xc207('0x1e')],'include':_0x27df03[_0xc207('0x20')]?_['map'](_0x27df03[_0xc207('0x20')],function(_0x5e0bd1){return{'model':db[_0x5e0bd1['model']],'as':_0x5e0bd1['as'],'attributes':_0x5e0bd1[_0xc207('0x1e')],'include':_0x5e0bd1[_0xc207('0x20')]?_[_0xc207('0x21')](_0x5e0bd1[_0xc207('0x20')],function(_0x6a653d){return{'model':db[_0x6a653d['model']],'as':_0x6a653d['as'],'attributes':_0x6a653d[_0xc207('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc207('0x23')](function(_0x6223ef){logger[_0xc207('0xe')](_0xc207('0x18'),_0x461f6a);logger[_0xc207('0x10')](_0xc207('0x18'),_0x461f6a,JSON[_0xc207('0x11')](_0x6223ef));_0x2caec5(_0x6223ef);})[_0xc207('0x17')](function(_0x3f79e8){logger[_0xc207('0x12')](_0xc207('0x18'),_0x3f79e8[_0xc207('0x15')],_0x461f6a);_0x35c0b0(_0xce0770['error'](0x1f4,_0x3f79e8[_0xc207('0x15')]));});});};exports[_0xc207('0x24')]=function(_0x1c4027){var _0x448df1=this;return new Promise(function(_0x24df00,_0x2ce133){return db['OpenchannelQueue'][_0xc207('0x25')]({'raw':_0x1c4027[_0xc207('0x1b')]?_0x1c4027[_0xc207('0x1b')][_0xc207('0x1c')]===undefined?!![]:![]:!![],'where':_0x1c4027['options']?_0x1c4027[_0xc207('0x1b')][_0xc207('0x1d')]||null:null,'attributes':_0x1c4027[_0xc207('0x1b')]?_0x1c4027[_0xc207('0x1b')][_0xc207('0x1e')]||null:null,'include':_0x1c4027[_0xc207('0x1b')]?_0x1c4027[_0xc207('0x1b')][_0xc207('0x20')]?_[_0xc207('0x21')](_0x1c4027['options']['include'],function(_0x188c39){return{'model':db[_0x188c39[_0xc207('0x22')]],'as':_0x188c39['as'],'attributes':_0x188c39[_0xc207('0x1e')],'include':_0x188c39[_0xc207('0x20')]?_['map'](_0x188c39[_0xc207('0x20')],function(_0x433c0f){return{'model':db[_0x433c0f[_0xc207('0x22')]],'as':_0x433c0f['as'],'attributes':_0x433c0f[_0xc207('0x1e')],'include':_0x433c0f[_0xc207('0x20')]?_['map'](_0x433c0f[_0xc207('0x20')],function(_0xbed419){return{'model':db[_0xbed419['model']],'as':_0xbed419['as'],'attributes':_0xbed419[_0xc207('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x297c84){logger[_0xc207('0xe')]('ShowOpenchannelQueue',_0x1c4027);logger[_0xc207('0x10')](_0xc207('0x24'),_0x1c4027,JSON[_0xc207('0x11')](_0x297c84));_0x24df00(_0x297c84);})['catch'](function(_0x5b3041){logger[_0xc207('0x12')](_0xc207('0x24'),_0x5b3041[_0xc207('0x15')],_0x1c4027);_0x2ce133(_0x448df1[_0xc207('0x12')](0x1f4,_0x5b3041['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 31ae607..0a2bafa 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 _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.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(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index ac87c4a..ef2b4cd 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 _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xb10b=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5c8f3e,_0x33ba70){var _0xb55f35=function(_0x48f8ef){while(--_0x48f8ef){_0x5c8f3e['push'](_0x5c8f3e['shift']());}};_0xb55f35(++_0x33ba70);}(_0xb10b,0x12a));var _0xbb10=function(_0x20a4dc,_0x2bd7c7){_0x20a4dc=_0x20a4dc-0x0;var _0x49000f=_0xb10b[_0x20a4dc];return _0x49000f;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index c16a935..5475584 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 _0x3339=['DATE','moment','sequelize','exports','STRING'];(function(_0x4ae8ad,_0x199666){var _0x169c46=function(_0x379340){while(--_0x379340){_0x4ae8ad['push'](_0x4ae8ad['shift']());}};_0x169c46(++_0x199666);}(_0x3339,0xec));var _0x9333=function(_0xd98e9c,_0x17b7de){_0xd98e9c=_0xd98e9c-0x0;var _0x46c8e1=_0x3339[_0xd98e9c];return _0x46c8e1;};'use strict';var moment=require(_0x9333('0x0'));var Sequelize=require(_0x9333('0x1'));module[_0x9333('0x2')]={'uniqueid':{'type':Sequelize[_0x9333('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9333('0x3')]},'joinAt':{'type':Sequelize[_0x9333('0x4')]},'leaveAt':{'type':Sequelize[_0x9333('0x4')]},'acceptAt':{'type':Sequelize[_0x9333('0x4')]},'exitAt':{'type':Sequelize[_0x9333('0x4')]},'reason':{'type':Sequelize[_0x9333('0x3')]}}; \ No newline at end of file +var _0xfb63=['STRING','DATE','moment','sequelize','exports'];(function(_0x534d1a,_0x1ca125){var _0x3bdc8e=function(_0x42d6a8){while(--_0x42d6a8){_0x534d1a['push'](_0x534d1a['shift']());}};_0x3bdc8e(++_0x1ca125);}(_0xfb63,0x66));var _0x3fb6=function(_0x5513ad,_0x299524){_0x5513ad=_0x5513ad-0x0;var _0x4e0c43=_0xfb63[_0x5513ad];return _0x4e0c43;};'use strict';var moment=require(_0x3fb6('0x0'));var Sequelize=require(_0x3fb6('0x1'));module[_0x3fb6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3fb6('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3fb6('0x4')]},'acceptAt':{'type':Sequelize[_0x3fb6('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3fb6('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 9acae2b..6bd5d31 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 _0xddbc=['limit','sort','pick','filter','where','merge','map','type','key','options','OpenchannelQueueReport','includeAll','include','findAll','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','length','nolimit'];(function(_0x294fbf,_0x29df29){var _0x454412=function(_0xf17aec){while(--_0xf17aec){_0x294fbf['push'](_0x294fbf['shift']());}};_0x454412(++_0x29df29);}(_0xddbc,0x1cb));var _0xcddb=function(_0x1c5f16,_0x9e63f0){_0x1c5f16=_0x1c5f16-0x0;var _0x2ad854=_0xddbc[_0x1c5f16];return _0x2ad854;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcddb('0x0'));var rimraf=require(_0xcddb('0x1'));var zipdir=require(_0xcddb('0x2'));var jsonpatch=require(_0xcddb('0x3'));var rp=require(_0xcddb('0x4'));var moment=require(_0xcddb('0x5'));var BPromise=require(_0xcddb('0x6'));var Mustache=require(_0xcddb('0x7'));var util=require(_0xcddb('0x8'));var path=require(_0xcddb('0x9'));var sox=require(_0xcddb('0xa'));var csv=require('to-csv');var ejs=require(_0xcddb('0xb'));var fs=require('fs');var _=require(_0xcddb('0xc'));var squel=require(_0xcddb('0xd'));var crypto=require(_0xcddb('0xe'));var jsforce=require(_0xcddb('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcddb('0x10'));var querystring=require(_0xcddb('0x11'));var Papa=require(_0xcddb('0x12'));var authService=require(_0xcddb('0x13'));var hardwareService=require(_0xcddb('0x14'));var Redis=require(_0xcddb('0x15'));var qs=require(_0xcddb('0x16'));var logger=require(_0xcddb('0x17'))(_0xcddb('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xcddb('0x19'))['db'];function respondWithStatusCode(_0x5fb54f,_0x1ef1a6){_0x1ef1a6=_0x1ef1a6||0xcc;return function(_0x4bc03d){if(_0x4bc03d){return _0x5fb54f[_0xcddb('0x1a')](_0x1ef1a6);}return _0x5fb54f[_0xcddb('0x1b')](_0x1ef1a6)['end']();};}function respondWithResult(_0x336375,_0x12ae73){_0x12ae73=_0x12ae73||0xc8;return function(_0x333ac6){if(_0x333ac6){return _0x336375[_0xcddb('0x1b')](_0x12ae73)[_0xcddb('0x1c')](_0x333ac6);}};}function respondWithFilteredResult(_0x187d68,_0x2504f9){return function(_0x15e553){if(_0x15e553){var _0x4bfe13=_0x15e553[_0xcddb('0x1d')],_0x5b5db4=_0x2504f9[_0xcddb('0x1e')],_0x2047c3=_0x2504f9[_0xcddb('0x1e')]+_0x2504f9['limit'],_0x3caaa3;if(_0x2047c3>=_0x4bfe13){_0x2047c3=_0x4bfe13;_0x3caaa3=0xc8;}else{_0x3caaa3=0xce;}_0x187d68['status'](_0x3caaa3);return _0x187d68[_0xcddb('0x1f')](_0xcddb('0x20'),_0x5b5db4+'-'+_0x2047c3+'/'+_0x4bfe13)['json'](_0x15e553);}return null;};}function patchUpdates(_0x21394e){return function(_0x200e81){try{jsonpatch[_0xcddb('0x21')](_0x200e81,_0x21394e,!![]);}catch(_0x1ccb6){return BPromise['reject'](_0x1ccb6);}return _0x200e81[_0xcddb('0x22')]();};}function saveUpdates(_0x59ec7f,_0x226dad){return function(_0x223fb3){if(_0x223fb3){return _0x223fb3[_0xcddb('0x23')](_0x59ec7f)[_0xcddb('0x24')](function(_0x1a7955){return _0x1a7955;});}return null;};}function removeEntity(_0xfd940d,_0x58874e){return function(_0xe4ef20){if(_0xe4ef20){return _0xe4ef20[_0xcddb('0x25')]()[_0xcddb('0x24')](function(){_0xfd940d[_0xcddb('0x1b')](0xcc)[_0xcddb('0x26')]();});}};}function handleEntityNotFound(_0x17fdae,_0x5047ab){return function(_0x482ff7){if(!_0x482ff7){_0x17fdae[_0xcddb('0x1a')](0x194);}return _0x482ff7;};}function handleError(_0x246f26,_0x9a9ed0){_0x9a9ed0=_0x9a9ed0||0x1f4;return function(_0x4ad52c){logger['error'](_0x4ad52c[_0xcddb('0x27')]);if(_0x4ad52c[_0xcddb('0x28')]){delete _0x4ad52c[_0xcddb('0x28')];}_0x246f26[_0xcddb('0x1b')](_0x9a9ed0)[_0xcddb('0x29')](_0x4ad52c);};}exports[_0xcddb('0x2a')]=function(_0x5e0a77,_0x24139e){var _0x2e9032={},_0x145e65={},_0xb2d0fb={'count':0x0,'rows':[]};var _0x49e654=db['OpenchannelQueueReport'][_0xcddb('0x2b')];_0x145e65['model']=_[_0xcddb('0x2c')](_0x49e654);_0x145e65[_0xcddb('0x2d')]=_[_0xcddb('0x2c')](_0x5e0a77[_0xcddb('0x2d')]);_0x145e65[_0xcddb('0x2e')]=_[_0xcddb('0x2f')](_0x145e65[_0xcddb('0x30')],_0x145e65[_0xcddb('0x2d')]);_0x2e9032['attributes']=_[_0xcddb('0x2f')](_0x145e65[_0xcddb('0x30')],qs['fields'](_0x5e0a77[_0xcddb('0x2d')]['fields']));_0x2e9032[_0xcddb('0x31')]=_0x2e9032[_0xcddb('0x31')][_0xcddb('0x32')]?_0x2e9032[_0xcddb('0x31')]:_0x145e65[_0xcddb('0x30')];if(!_0x5e0a77[_0xcddb('0x2d')]['hasOwnProperty'](_0xcddb('0x33'))){_0x2e9032[_0xcddb('0x34')]=qs[_0xcddb('0x34')](_0x5e0a77[_0xcddb('0x2d')]['limit']);_0x2e9032[_0xcddb('0x1e')]=qs['offset'](_0x5e0a77['query']['offset']);}_0x2e9032['order']=qs['sort'](_0x5e0a77[_0xcddb('0x2d')][_0xcddb('0x35')]);_0x2e9032['where']=qs['filters'](_[_0xcddb('0x36')](_0x5e0a77[_0xcddb('0x2d')],_0x145e65[_0xcddb('0x2e')]));if(_0x5e0a77[_0xcddb('0x2d')][_0xcddb('0x37')]){_0x2e9032[_0xcddb('0x38')]=_[_0xcddb('0x39')](_0x2e9032[_0xcddb('0x38')],{'$or':_[_0xcddb('0x3a')](_0x49e654,function(_0x59489f){if(_0x59489f[_0xcddb('0x3b')][_0xcddb('0x3c')]!=='VIRTUAL'){var _0x4b86d9={};_0x4b86d9[_0x59489f['field']]={'$like':'%'+_0x5e0a77[_0xcddb('0x2d')][_0xcddb('0x37')]+'%'};return _0x4b86d9;}})});}_0x2e9032=_[_0xcddb('0x39')]({},_0x2e9032,_0x5e0a77[_0xcddb('0x3d')]);var _0x20f0fb={'where':_0x2e9032[_0xcddb('0x38')]};return db[_0xcddb('0x3e')]['count'](_0x20f0fb)[_0xcddb('0x24')](function(_0x42fb84){_0xb2d0fb[_0xcddb('0x1d')]=_0x42fb84;if(_0x5e0a77[_0xcddb('0x2d')][_0xcddb('0x3f')]){_0x2e9032[_0xcddb('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xcddb('0x41')](_0x2e9032);})['then'](function(_0x43ae03){_0xb2d0fb['rows']=_0x43ae03;return _0xb2d0fb;})[_0xcddb('0x24')](respondWithFilteredResult(_0x24139e,_0x2e9032))['catch'](handleError(_0x24139e,null));};exports[_0xcddb('0x42')]=function(_0x2b6b91,_0x3f0a69){var _0x5d8124={'raw':!![],'where':{'id':_0x2b6b91[_0xcddb('0x43')]['id']}},_0x1a701f={};_0x1a701f['model']=_[_0xcddb('0x2c')](db[_0xcddb('0x3e')]['rawAttributes']);_0x1a701f[_0xcddb('0x2d')]=_[_0xcddb('0x2c')](_0x2b6b91[_0xcddb('0x2d')]);_0x1a701f[_0xcddb('0x2e')]=_[_0xcddb('0x2f')](_0x1a701f[_0xcddb('0x30')],_0x1a701f[_0xcddb('0x2d')]);_0x5d8124[_0xcddb('0x31')]=_[_0xcddb('0x2f')](_0x1a701f[_0xcddb('0x30')],qs['fields'](_0x2b6b91[_0xcddb('0x2d')]['fields']));_0x5d8124[_0xcddb('0x31')]=_0x5d8124[_0xcddb('0x31')][_0xcddb('0x32')]?_0x5d8124[_0xcddb('0x31')]:_0x1a701f[_0xcddb('0x30')];if(_0x2b6b91['query'][_0xcddb('0x3f')]){_0x5d8124[_0xcddb('0x40')]=[{'all':!![]}];}_0x5d8124=_[_0xcddb('0x39')]({},_0x5d8124,_0x2b6b91[_0xcddb('0x3d')]);return db['OpenchannelQueueReport'][_0xcddb('0x44')](_0x5d8124)[_0xcddb('0x24')](handleEntityNotFound(_0x3f0a69,null))[_0xcddb('0x24')](respondWithResult(_0x3f0a69,null))[_0xcddb('0x45')](handleError(_0x3f0a69,null));};exports[_0xcddb('0x46')]=function(_0xaa7cc2,_0x45d9f6){return db[_0xcddb('0x3e')][_0xcddb('0x46')](_0xaa7cc2[_0xcddb('0x47')],{})[_0xcddb('0x24')](respondWithResult(_0x45d9f6,0xc9))[_0xcddb('0x45')](handleError(_0x45d9f6,null));};exports[_0xcddb('0x23')]=function(_0xe332c6,_0x26109b){if(_0xe332c6[_0xcddb('0x47')]['id']){delete _0xe332c6[_0xcddb('0x47')]['id'];}return db[_0xcddb('0x3e')][_0xcddb('0x44')]({'where':{'id':_0xe332c6['params']['id']}})[_0xcddb('0x24')](handleEntityNotFound(_0x26109b,null))[_0xcddb('0x24')](saveUpdates(_0xe332c6[_0xcddb('0x47')],null))['then'](respondWithResult(_0x26109b,null))[_0xcddb('0x45')](handleError(_0x26109b,null));};exports[_0xcddb('0x25')]=function(_0x1814b5,_0x514039){return db[_0xcddb('0x3e')][_0xcddb('0x44')]({'where':{'id':_0x1814b5[_0xcddb('0x43')]['id']}})[_0xcddb('0x24')](handleEntityNotFound(_0x514039,null))[_0xcddb('0x24')](removeEntity(_0x514039,null))[_0xcddb('0x45')](handleError(_0x514039,null));};exports[_0xcddb('0x48')]=function(_0x1fd4dd,_0x16d8d1){return db['OpenchannelQueueReport'][_0xcddb('0x48')]()['then'](respondWithResult(_0x16d8d1,null))[_0xcddb('0x45')](handleError(_0x16d8d1,null));}; \ No newline at end of file +var _0xf2b3=['params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','then','destroy','stack','name','send','index','rawAttributes','keys','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','map','key','merge','OpenchannelQueueReport','count','includeAll','include','rows','catch','show','options','find','create','body','update'];(function(_0x3925ff,_0x3fe6e5){var _0x1f16d5=function(_0xc538a2){while(--_0xc538a2){_0x3925ff['push'](_0x3925ff['shift']());}};_0x1f16d5(++_0x3fe6e5);}(_0xf2b3,0x122));var _0x3f2b=function(_0xf28d5c,_0x46101e){_0xf28d5c=_0xf28d5c-0x0;var _0x42850b=_0xf2b3[_0xf28d5c];return _0x42850b;};'use strict';var pdf=require(_0x3f2b('0x0'));var emlformat=require(_0x3f2b('0x1'));var rimraf=require(_0x3f2b('0x2'));var zipdir=require(_0x3f2b('0x3'));var jsonpatch=require(_0x3f2b('0x4'));var rp=require('request-promise');var moment=require(_0x3f2b('0x5'));var BPromise=require(_0x3f2b('0x6'));var Mustache=require(_0x3f2b('0x7'));var util=require(_0x3f2b('0x8'));var path=require(_0x3f2b('0x9'));var sox=require('sox');var csv=require(_0x3f2b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3f2b('0xb'));var squel=require(_0x3f2b('0xc'));var crypto=require('crypto');var jsforce=require(_0x3f2b('0xd'));var deskjs=require(_0x3f2b('0xe'));var toCsv=require(_0x3f2b('0xa'));var querystring=require(_0x3f2b('0xf'));var Papa=require(_0x3f2b('0x10'));var authService=require(_0x3f2b('0x11'));var hardwareService=require(_0x3f2b('0x12'));var Redis=require(_0x3f2b('0x13'));var qs=require(_0x3f2b('0x14'));var logger=require(_0x3f2b('0x15'))(_0x3f2b('0x16'));var utils=require(_0x3f2b('0x17'));var config=require('../../config/environment');var db=require(_0x3f2b('0x18'))['db'];function respondWithStatusCode(_0x5d35e8,_0x2943d3){_0x2943d3=_0x2943d3||0xcc;return function(_0x236623){if(_0x236623){return _0x5d35e8[_0x3f2b('0x19')](_0x2943d3);}return _0x5d35e8[_0x3f2b('0x1a')](_0x2943d3)[_0x3f2b('0x1b')]();};}function respondWithResult(_0x40e349,_0x2b75e8){_0x2b75e8=_0x2b75e8||0xc8;return function(_0x5f0289){if(_0x5f0289){return _0x40e349[_0x3f2b('0x1a')](_0x2b75e8)['json'](_0x5f0289);}};}function respondWithFilteredResult(_0x1b3d00,_0x487549){return function(_0x5792fa){if(_0x5792fa){var _0x1fc7aa=_0x5792fa['count'],_0x14e845=_0x487549[_0x3f2b('0x1c')],_0xe715d0=_0x487549[_0x3f2b('0x1c')]+_0x487549[_0x3f2b('0x1d')],_0x19c41d;if(_0xe715d0>=_0x1fc7aa){_0xe715d0=_0x1fc7aa;_0x19c41d=0xc8;}else{_0x19c41d=0xce;}_0x1b3d00[_0x3f2b('0x1a')](_0x19c41d);return _0x1b3d00[_0x3f2b('0x1e')](_0x3f2b('0x1f'),_0x14e845+'-'+_0xe715d0+'/'+_0x1fc7aa)[_0x3f2b('0x20')](_0x5792fa);}return null;};}function patchUpdates(_0x181a85){return function(_0xd76a07){try{jsonpatch[_0x3f2b('0x21')](_0xd76a07,_0x181a85,!![]);}catch(_0x35a989){return BPromise['reject'](_0x35a989);}return _0xd76a07['save']();};}function saveUpdates(_0x242c5f,_0x3c431b){return function(_0x589564){if(_0x589564){return _0x589564['update'](_0x242c5f)[_0x3f2b('0x22')](function(_0x3bcb7e){return _0x3bcb7e;});}return null;};}function removeEntity(_0x3572e2,_0x43138d){return function(_0x4e1b90){if(_0x4e1b90){return _0x4e1b90[_0x3f2b('0x23')]()[_0x3f2b('0x22')](function(){_0x3572e2[_0x3f2b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d71b8,_0x213af7){return function(_0x391639){if(!_0x391639){_0x5d71b8[_0x3f2b('0x19')](0x194);}return _0x391639;};}function handleError(_0x303b1f,_0x5b9f80){_0x5b9f80=_0x5b9f80||0x1f4;return function(_0x59b6c7){logger['error'](_0x59b6c7[_0x3f2b('0x24')]);if(_0x59b6c7[_0x3f2b('0x25')]){delete _0x59b6c7[_0x3f2b('0x25')];}_0x303b1f[_0x3f2b('0x1a')](_0x5b9f80)[_0x3f2b('0x26')](_0x59b6c7);};}exports[_0x3f2b('0x27')]=function(_0x29f179,_0x2222ca){var _0x47f4f1={},_0x54c09c={},_0x461bba={'count':0x0,'rows':[]};var _0x3fddc1=db['OpenchannelQueueReport'][_0x3f2b('0x28')];_0x54c09c['model']=_[_0x3f2b('0x29')](_0x3fddc1);_0x54c09c[_0x3f2b('0x2a')]=_[_0x3f2b('0x29')](_0x29f179[_0x3f2b('0x2a')]);_0x54c09c['filters']=_[_0x3f2b('0x2b')](_0x54c09c['model'],_0x54c09c[_0x3f2b('0x2a')]);_0x47f4f1[_0x3f2b('0x2c')]=_[_0x3f2b('0x2b')](_0x54c09c[_0x3f2b('0x2d')],qs[_0x3f2b('0x2e')](_0x29f179[_0x3f2b('0x2a')][_0x3f2b('0x2e')]));_0x47f4f1[_0x3f2b('0x2c')]=_0x47f4f1[_0x3f2b('0x2c')]['length']?_0x47f4f1[_0x3f2b('0x2c')]:_0x54c09c['model'];if(!_0x29f179[_0x3f2b('0x2a')][_0x3f2b('0x2f')](_0x3f2b('0x30'))){_0x47f4f1[_0x3f2b('0x1d')]=qs[_0x3f2b('0x1d')](_0x29f179['query'][_0x3f2b('0x1d')]);_0x47f4f1[_0x3f2b('0x1c')]=qs[_0x3f2b('0x1c')](_0x29f179[_0x3f2b('0x2a')]['offset']);}_0x47f4f1[_0x3f2b('0x31')]=qs[_0x3f2b('0x32')](_0x29f179[_0x3f2b('0x2a')][_0x3f2b('0x32')]);_0x47f4f1[_0x3f2b('0x33')]=qs['filters'](_[_0x3f2b('0x34')](_0x29f179['query'],_0x54c09c[_0x3f2b('0x35')]));if(_0x29f179[_0x3f2b('0x2a')][_0x3f2b('0x36')]){_0x47f4f1[_0x3f2b('0x33')]=_['merge'](_0x47f4f1[_0x3f2b('0x33')],{'$or':_[_0x3f2b('0x37')](_0x3fddc1,function(_0x474692){if(_0x474692['type'][_0x3f2b('0x38')]!=='VIRTUAL'){var _0xd32414={};_0xd32414[_0x474692['field']]={'$like':'%'+_0x29f179[_0x3f2b('0x2a')]['filter']+'%'};return _0xd32414;}})});}_0x47f4f1=_[_0x3f2b('0x39')]({},_0x47f4f1,_0x29f179['options']);var _0x5d145c={'where':_0x47f4f1[_0x3f2b('0x33')]};return db[_0x3f2b('0x3a')][_0x3f2b('0x3b')](_0x5d145c)[_0x3f2b('0x22')](function(_0xf99748){_0x461bba['count']=_0xf99748;if(_0x29f179[_0x3f2b('0x2a')][_0x3f2b('0x3c')]){_0x47f4f1[_0x3f2b('0x3d')]=[{'all':!![]}];}return db[_0x3f2b('0x3a')]['findAll'](_0x47f4f1);})[_0x3f2b('0x22')](function(_0x5bb939){_0x461bba[_0x3f2b('0x3e')]=_0x5bb939;return _0x461bba;})['then'](respondWithFilteredResult(_0x2222ca,_0x47f4f1))[_0x3f2b('0x3f')](handleError(_0x2222ca,null));};exports[_0x3f2b('0x40')]=function(_0x4d5439,_0xc4db96){var _0x4fe7de={'raw':!![],'where':{'id':_0x4d5439['params']['id']}},_0xf2eda2={};_0xf2eda2[_0x3f2b('0x2d')]=_[_0x3f2b('0x29')](db[_0x3f2b('0x3a')][_0x3f2b('0x28')]);_0xf2eda2[_0x3f2b('0x2a')]=_[_0x3f2b('0x29')](_0x4d5439['query']);_0xf2eda2[_0x3f2b('0x35')]=_[_0x3f2b('0x2b')](_0xf2eda2[_0x3f2b('0x2d')],_0xf2eda2[_0x3f2b('0x2a')]);_0x4fe7de[_0x3f2b('0x2c')]=_[_0x3f2b('0x2b')](_0xf2eda2[_0x3f2b('0x2d')],qs[_0x3f2b('0x2e')](_0x4d5439['query'][_0x3f2b('0x2e')]));_0x4fe7de[_0x3f2b('0x2c')]=_0x4fe7de['attributes']['length']?_0x4fe7de[_0x3f2b('0x2c')]:_0xf2eda2[_0x3f2b('0x2d')];if(_0x4d5439[_0x3f2b('0x2a')][_0x3f2b('0x3c')]){_0x4fe7de['include']=[{'all':!![]}];}_0x4fe7de=_['merge']({},_0x4fe7de,_0x4d5439[_0x3f2b('0x41')]);return db[_0x3f2b('0x3a')][_0x3f2b('0x42')](_0x4fe7de)[_0x3f2b('0x22')](handleEntityNotFound(_0xc4db96,null))['then'](respondWithResult(_0xc4db96,null))['catch'](handleError(_0xc4db96,null));};exports[_0x3f2b('0x43')]=function(_0x28437f,_0x15e158){return db[_0x3f2b('0x3a')]['create'](_0x28437f[_0x3f2b('0x44')],{})[_0x3f2b('0x22')](respondWithResult(_0x15e158,0xc9))[_0x3f2b('0x3f')](handleError(_0x15e158,null));};exports[_0x3f2b('0x45')]=function(_0x252991,_0x1f4fed){if(_0x252991[_0x3f2b('0x44')]['id']){delete _0x252991[_0x3f2b('0x44')]['id'];}return db['OpenchannelQueueReport'][_0x3f2b('0x42')]({'where':{'id':_0x252991['params']['id']}})[_0x3f2b('0x22')](handleEntityNotFound(_0x1f4fed,null))[_0x3f2b('0x22')](saveUpdates(_0x252991[_0x3f2b('0x44')],null))[_0x3f2b('0x22')](respondWithResult(_0x1f4fed,null))[_0x3f2b('0x3f')](handleError(_0x1f4fed,null));};exports[_0x3f2b('0x23')]=function(_0x53190e,_0x87db7a){return db[_0x3f2b('0x3a')][_0x3f2b('0x42')]({'where':{'id':_0x53190e[_0x3f2b('0x46')]['id']}})[_0x3f2b('0x22')](handleEntityNotFound(_0x87db7a,null))[_0x3f2b('0x22')](removeEntity(_0x87db7a,null))[_0x3f2b('0x3f')](handleError(_0x87db7a,null));};exports[_0x3f2b('0x47')]=function(_0x23051a,_0x3fe357){return db[_0x3f2b('0x3a')][_0x3f2b('0x47')]()[_0x3f2b('0x22')](respondWithResult(_0x3fe357,null))[_0x3f2b('0x3f')](handleError(_0x3fe357,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 231c41d..1abbbec 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 _0x6bb4=['define','OpenchannelQueueReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','./openchannelQueueReport.attributes','exports'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x19a562,_0x4b669f){_0x19a562=_0x19a562-0x0;var _0x3bd3f3=_0x6bb4[_0x19a562];return _0x3bd3f3;};'use strict';var _=require(_0x46bb('0x0'));var util=require(_0x46bb('0x1'));var logger=require(_0x46bb('0x2'))('api');var moment=require(_0x46bb('0x3'));var BPromise=require(_0x46bb('0x4'));var rp=require('request-promise');var attributes=require(_0x46bb('0x5'));module[_0x46bb('0x6')]=function(_0x2eefcc,_0x3c8bef){return _0x2eefcc[_0x46bb('0x7')](_0x46bb('0x8'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x46bb('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad78=['api','moment','request-promise','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x104359,_0x1fdb82){var _0x8a2a98=function(_0x27842d){while(--_0x27842d){_0x104359['push'](_0x104359['shift']());}};_0x8a2a98(++_0x1fdb82);}(_0xad78,0x149));var _0x8ad7=function(_0xd20adb,_0x48f653){_0xd20adb=_0xd20adb-0x0;var _0x2fc15a=_0xad78[_0xd20adb];return _0x2fc15a;};'use strict';var _=require(_0x8ad7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8ad7('0x1'));var moment=require(_0x8ad7('0x2'));var BPromise=require('bluebird');var rp=require(_0x8ad7('0x3'));var attributes=require(_0x8ad7('0x4'));module[_0x8ad7('0x5')]=function(_0x296a52,_0x1baf32){return _0x296a52[_0x8ad7('0x6')](_0x8ad7('0x7'),attributes,{'tableName':_0x8ad7('0x8'),'paranoid':![],'indexes':[{'name':_0x8ad7('0x9'),'fields':[_0x8ad7('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 64730c6..7500b3d 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 _0x88f8=['limit','UpdateOpenchannelQueueReport','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','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','debug','update','where'];(function(_0xaf8280,_0x5c1176){var _0x1b92a5=function(_0xd78685){while(--_0xd78685){_0xaf8280['push'](_0xaf8280['shift']());}};_0x1b92a5(++_0x5c1176);}(_0x88f8,0xc8));var _0x888f=function(_0x43934e,_0x65ba3f){_0x43934e=_0x43934e-0x0;var _0x2c0206=_0x88f8[_0x43934e];return _0x2c0206;};'use strict';var _=require(_0x888f('0x0'));var util=require('util');var moment=require(_0x888f('0x1'));var BPromise=require(_0x888f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x888f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x888f('0x4'));var logger=require('../../config/logger')(_0x888f('0x5'));var config=require(_0x888f('0x6'));var jayson=require(_0x888f('0x7'));var client=jayson[_0x888f('0x8')][_0x888f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14e297,_0x5dedfb,_0x428e22){return new BPromise(function(_0x3739f7,_0xc4cc65){return client[_0x888f('0xa')](_0x14e297,_0x428e22)[_0x888f('0xb')](function(_0x5bf82e){logger[_0x888f('0xc')](_0x888f('0xd'),_0x5dedfb,_0x888f('0xe'));logger['debug'](_0x888f('0xf'),_0x5dedfb,'request\x20sent',JSON[_0x888f('0x10')](_0x5bf82e));if(_0x5bf82e[_0x888f('0x11')]){if(_0x5bf82e[_0x888f('0x11')][_0x888f('0x12')]===0x1f4){logger['error'](_0x888f('0xd'),_0x5dedfb,_0x5bf82e[_0x888f('0x11')][_0x888f('0x13')]);return _0xc4cc65(_0x5bf82e[_0x888f('0x11')][_0x888f('0x13')]);}logger['error'](_0x888f('0xd'),_0x5dedfb,_0x5bf82e[_0x888f('0x11')][_0x888f('0x13')]);return _0x3739f7(_0x5bf82e[_0x888f('0x11')]['message']);}else{logger[_0x888f('0xc')](_0x888f('0xd'),_0x5dedfb,_0x888f('0xe'));_0x3739f7(_0x5bf82e[_0x888f('0x14')]['message']);}})[_0x888f('0x15')](function(_0x24efb0){logger[_0x888f('0x11')](_0x888f('0xd'),_0x5dedfb,_0x24efb0);_0xc4cc65(_0x24efb0);});});}exports[_0x888f('0x16')]=function(_0x298401){var _0x24c28d=this;return new Promise(function(_0x31a6f3,_0x4ebee4){return db[_0x888f('0x17')][_0x888f('0x18')](_0x298401[_0x888f('0x19')],{'raw':_0x298401[_0x888f('0x1a')]?_0x298401[_0x888f('0x1a')][_0x888f('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x543b09){logger[_0x888f('0xc')]('CreateOpenchannelQueueReport',_0x298401);logger[_0x888f('0x1c')]('CreateOpenchannelQueueReport',_0x298401,JSON['stringify'](_0x543b09));_0x31a6f3(_0x543b09);})[_0x888f('0x15')](function(_0xa1d226){logger[_0x888f('0x11')]('CreateOpenchannelQueueReport',_0xa1d226['message'],_0x298401);_0x4ebee4(_0x24c28d[_0x888f('0x11')](0x1f4,_0xa1d226[_0x888f('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x271a64){var _0x4d67b7=this;return new Promise(function(_0x16ab77,_0xbe290d){return db[_0x888f('0x17')][_0x888f('0x1d')](_0x271a64['body'],{'raw':_0x271a64[_0x888f('0x1a')]?_0x271a64[_0x888f('0x1a')][_0x888f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x271a64[_0x888f('0x1a')]?_0x271a64[_0x888f('0x1a')][_0x888f('0x1e')]||null:null,'attributes':_0x271a64[_0x888f('0x1a')]?_0x271a64[_0x888f('0x1a')]['attributes']||null:null,'limit':_0x271a64[_0x888f('0x1a')]?_0x271a64['options'][_0x888f('0x1f')]||null:null})[_0x888f('0xb')](function(_0x273ac3){logger[_0x888f('0xc')]('UpdateOpenchannelQueueReport',_0x271a64);logger[_0x888f('0x1c')]('UpdateOpenchannelQueueReport',_0x271a64,JSON[_0x888f('0x10')](_0x273ac3));_0x16ab77(_0x273ac3);})['catch'](function(_0x1624df){logger['error'](_0x888f('0x20'),_0x1624df['message'],_0x271a64);_0xbe290d(_0x4d67b7[_0x888f('0x11')](0x1f4,_0x1624df[_0x888f('0x13')]));});});}; \ No newline at end of file +var _0xbc5e=['request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','debug','UpdateOpenchannelQueueReport','raw','attributes','limit','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc5e,0x10f));var _0xebc5=function(_0x27663a,_0xf40ed5){_0x27663a=_0x27663a-0x0;var _0x3e2032=_0xbc5e[_0x27663a];return _0x3e2032;};'use strict';var _=require(_0xebc5('0x0'));var util=require(_0xebc5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xebc5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xebc5('0x3'));var logger=require(_0xebc5('0x4'))('rpc');var config=require(_0xebc5('0x5'));var jayson=require(_0xebc5('0x6'));var client=jayson[_0xebc5('0x7')][_0xebc5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ff988,_0x4c6971,_0x5a345e){return new BPromise(function(_0x388001,_0x4ca9e7){return client[_0xebc5('0x9')](_0x4ff988,_0x5a345e)[_0xebc5('0xa')](function(_0x56c3d){logger['info'](_0xebc5('0xb'),_0x4c6971,'request\x20sent');logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x4c6971,_0xebc5('0xc'),JSON['stringify'](_0x56c3d));if(_0x56c3d[_0xebc5('0xd')]){if(_0x56c3d[_0xebc5('0xd')][_0xebc5('0xe')]===0x1f4){logger[_0xebc5('0xd')](_0xebc5('0xb'),_0x4c6971,_0x56c3d['error'][_0xebc5('0xf')]);return _0x4ca9e7(_0x56c3d['error'][_0xebc5('0xf')]);}logger['error'](_0xebc5('0xb'),_0x4c6971,_0x56c3d['error'][_0xebc5('0xf')]);return _0x388001(_0x56c3d[_0xebc5('0xd')][_0xebc5('0xf')]);}else{logger[_0xebc5('0x10')](_0xebc5('0xb'),_0x4c6971,_0xebc5('0xc'));_0x388001(_0x56c3d['result'][_0xebc5('0xf')]);}})[_0xebc5('0x11')](function(_0x54de28){logger[_0xebc5('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4c6971,_0x54de28);_0x4ca9e7(_0x54de28);});});}exports[_0xebc5('0x12')]=function(_0x172e61){var _0x43f9d8=this;return new Promise(function(_0x471424,_0x48efd1){return db[_0xebc5('0x13')][_0xebc5('0x14')](_0x172e61[_0xebc5('0x15')],{'raw':_0x172e61[_0xebc5('0x16')]?_0x172e61[_0xebc5('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xebc5('0xa')](function(_0x3972cb){logger[_0xebc5('0x10')](_0xebc5('0x12'),_0x172e61);logger[_0xebc5('0x17')](_0xebc5('0x12'),_0x172e61,JSON['stringify'](_0x3972cb));_0x471424(_0x3972cb);})[_0xebc5('0x11')](function(_0x4204d7){logger['error'](_0xebc5('0x12'),_0x4204d7['message'],_0x172e61);_0x48efd1(_0x43f9d8[_0xebc5('0xd')](0x1f4,_0x4204d7['message']));});});};exports[_0xebc5('0x18')]=function(_0x4ea4fc){var _0x59ba99=this;return new Promise(function(_0x11f6b5,_0x32af70){return db[_0xebc5('0x13')]['update'](_0x4ea4fc['body'],{'raw':_0x4ea4fc['options']?_0x4ea4fc[_0xebc5('0x16')][_0xebc5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ea4fc[_0xebc5('0x16')]?_0x4ea4fc[_0xebc5('0x16')]['where']||null:null,'attributes':_0x4ea4fc[_0xebc5('0x16')]?_0x4ea4fc[_0xebc5('0x16')][_0xebc5('0x1a')]||null:null,'limit':_0x4ea4fc['options']?_0x4ea4fc[_0xebc5('0x16')][_0xebc5('0x1b')]||null:null})[_0xebc5('0xa')](function(_0x442e8f){logger[_0xebc5('0x10')]('UpdateOpenchannelQueueReport',_0x4ea4fc);logger[_0xebc5('0x17')]('UpdateOpenchannelQueueReport',_0x4ea4fc,JSON['stringify'](_0x442e8f));_0x11f6b5(_0x442e8f);})[_0xebc5('0x11')](function(_0x308898){logger[_0xebc5('0xd')](_0xebc5('0x18'),_0x308898[_0xebc5('0xf')],_0x4ea4fc);_0x32af70(_0x59ba99[_0xebc5('0xd')](0x1f4,_0x308898[_0xebc5('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 6ae8d18..18d891d 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 _0x7b54=['put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0x7b54,0x1ba));var _0x47b5=function(_0x279755,_0x42ad77){_0x279755=_0x279755-0x0;var _0x138178=_0x7b54[_0x279755];return _0x138178;};'use strict';var multer=require('multer');var util=require(_0x47b5('0x0'));var path=require('path');var timeout=require(_0x47b5('0x1'));var express=require('express');var router=express[_0x47b5('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x47b5('0x3'));var config=require(_0x47b5('0x4'));var controller=require(_0x47b5('0x5'));router[_0x47b5('0x6')]('/',auth['isAuthenticated'](),controller[_0x47b5('0x7')]);router[_0x47b5('0x6')](_0x47b5('0x8'),auth[_0x47b5('0x9')](),controller[_0x47b5('0xa')]);router[_0x47b5('0x6')](_0x47b5('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x47b5('0xc')]('/',auth['isAuthenticated'](),controller[_0x47b5('0xd')]);router[_0x47b5('0xe')]('/:id',auth[_0x47b5('0x9')](),controller[_0x47b5('0xf')]);router[_0x47b5('0x10')]('/:id',auth[_0x47b5('0x9')](),controller[_0x47b5('0x11')]);module[_0x47b5('0x12')]=router; \ No newline at end of file +var _0x087c=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','delete','exports','multer','util','path','connect-timeout'];(function(_0x38c600,_0x858cef){var _0x286f1a=function(_0x5d574d){while(--_0x5d574d){_0x38c600['push'](_0x38c600['shift']());}};_0x286f1a(++_0x858cef);}(_0x087c,0x165));var _0xc087=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x087c[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xc087('0x0'));var util=require(_0xc087('0x1'));var path=require(_0xc087('0x2'));var timeout=require(_0xc087('0x3'));var express=require(_0xc087('0x4'));var router=express['Router']();var auth=require(_0xc087('0x5'));var interaction=require(_0xc087('0x6'));var config=require(_0xc087('0x7'));var controller=require(_0xc087('0x8'));router[_0xc087('0x9')]('/',auth[_0xc087('0xa')](),controller[_0xc087('0xb')]);router['get'](_0xc087('0xc'),auth[_0xc087('0xa')](),controller[_0xc087('0xd')]);router[_0xc087('0x9')](_0xc087('0xe'),auth[_0xc087('0xa')](),controller[_0xc087('0xf')]);router[_0xc087('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc087('0xe'),auth[_0xc087('0xa')](),controller['update']);router[_0xc087('0x11')](_0xc087('0xe'),auth[_0xc087('0xa')](),controller['destroy']);module[_0xc087('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 1856f93..ea6041c 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 _0xf13d=['agent','queue','NOW','moment','sequelize','exports','STRING','ENUM'];(function(_0x3ce793,_0x1c5385){var _0x864c27=function(_0x16f613){while(--_0x16f613){_0x3ce793['push'](_0x3ce793['shift']());}};_0x864c27(++_0x1c5385);}(_0xf13d,0x1d3));var _0xdf13=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf13d[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0xdf13('0x0'));var Sequelize=require(_0xdf13('0x1'));module[_0xdf13('0x2')]={'uniqueid':{'type':Sequelize[_0xdf13('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf13('0x4')]('account',_0xdf13('0x5'),_0xdf13('0x6')),'allowNull':![],'defaultValue':_0xdf13('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xdf13('0x7')]}}; \ No newline at end of file +var _0x4065=['NOW','moment','sequelize','exports','ENUM','account','agent','queue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4065,0x1c9));var _0x5406=function(_0x406393,_0x529877){_0x406393=_0x406393-0x0;var _0x6206f3=_0x4065[_0x406393];return _0x6206f3;};'use strict';var moment=require(_0x5406('0x0'));var Sequelize=require(_0x5406('0x1'));module[_0x5406('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5406('0x3')](_0x5406('0x4'),_0x5406('0x5'),_0x5406('0x6')),'allowNull':![],'defaultValue':_0x5406('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x5406('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 5c2d83c..c1c0049 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 _0x84ab=['then','destroy','error','stack','name','send','index','OpenchannelTransferReport','keys','query','filters','attributes','model','fields','length','order','sort','pick','filter','where','type','key','field','merge','options','findAll','rows','catch','params','includeAll','include','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update'];(function(_0x524da3,_0x11d2c){var _0x1635e0=function(_0xcd264d){while(--_0xcd264d){_0x524da3['push'](_0x524da3['shift']());}};_0x1635e0(++_0x11d2c);}(_0x84ab,0x12f));var _0xb84a=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x84ab[_0x3df223];return _0x562d11;};'use strict';var pdf=require(_0xb84a('0x0'));var emlformat=require(_0xb84a('0x1'));var rimraf=require(_0xb84a('0x2'));var zipdir=require(_0xb84a('0x3'));var jsonpatch=require(_0xb84a('0x4'));var rp=require('request-promise');var moment=require(_0xb84a('0x5'));var BPromise=require(_0xb84a('0x6'));var Mustache=require('mustache');var util=require(_0xb84a('0x7'));var path=require(_0xb84a('0x8'));var sox=require(_0xb84a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var authService=require(_0xb84a('0xe'));var hardwareService=require(_0xb84a('0xf'));var Redis=require(_0xb84a('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0xb84a('0x11'));var config=require(_0xb84a('0x12'));var db=require(_0xb84a('0x13'))['db'];function respondWithStatusCode(_0x35c6c5,_0x1ed9ae){_0x1ed9ae=_0x1ed9ae||0xcc;return function(_0x4d3758){if(_0x4d3758){return _0x35c6c5[_0xb84a('0x14')](_0x1ed9ae);}return _0x35c6c5[_0xb84a('0x15')](_0x1ed9ae)[_0xb84a('0x16')]();};}function respondWithResult(_0x3c161c,_0x44b26b){_0x44b26b=_0x44b26b||0xc8;return function(_0x11dfe9){if(_0x11dfe9){return _0x3c161c[_0xb84a('0x15')](_0x44b26b)[_0xb84a('0x17')](_0x11dfe9);}};}function respondWithFilteredResult(_0x3113a2,_0x30fb61){return function(_0xc0b2e0){if(_0xc0b2e0){var _0x1251ec=_0xc0b2e0[_0xb84a('0x18')],_0x5716bd=_0x30fb61[_0xb84a('0x19')],_0x11dd4d=_0x30fb61[_0xb84a('0x19')]+_0x30fb61[_0xb84a('0x1a')],_0x4a691d;if(_0x11dd4d>=_0x1251ec){_0x11dd4d=_0x1251ec;_0x4a691d=0xc8;}else{_0x4a691d=0xce;}_0x3113a2[_0xb84a('0x15')](_0x4a691d);return _0x3113a2[_0xb84a('0x1b')](_0xb84a('0x1c'),_0x5716bd+'-'+_0x11dd4d+'/'+_0x1251ec)[_0xb84a('0x17')](_0xc0b2e0);}return null;};}function patchUpdates(_0x11d5a0){return function(_0x2de49c){try{jsonpatch[_0xb84a('0x1d')](_0x2de49c,_0x11d5a0,!![]);}catch(_0x200289){return BPromise['reject'](_0x200289);}return _0x2de49c[_0xb84a('0x1e')]();};}function saveUpdates(_0x319216,_0x55a633){return function(_0xac76d3){if(_0xac76d3){return _0xac76d3[_0xb84a('0x1f')](_0x319216)[_0xb84a('0x20')](function(_0x19f637){return _0x19f637;});}return null;};}function removeEntity(_0x50bac5,_0x4ac5f8){return function(_0x1466ae){if(_0x1466ae){return _0x1466ae[_0xb84a('0x21')]()[_0xb84a('0x20')](function(){_0x50bac5[_0xb84a('0x15')](0xcc)[_0xb84a('0x16')]();});}};}function handleEntityNotFound(_0x3b8fb2,_0x8b28cd){return function(_0x21d0d3){if(!_0x21d0d3){_0x3b8fb2[_0xb84a('0x14')](0x194);}return _0x21d0d3;};}function handleError(_0x26fe42,_0x10d860){_0x10d860=_0x10d860||0x1f4;return function(_0x1aab7d){logger[_0xb84a('0x22')](_0x1aab7d[_0xb84a('0x23')]);if(_0x1aab7d[_0xb84a('0x24')]){delete _0x1aab7d[_0xb84a('0x24')];}_0x26fe42[_0xb84a('0x15')](_0x10d860)[_0xb84a('0x25')](_0x1aab7d);};}exports[_0xb84a('0x26')]=function(_0xd468c3,_0x33bf1d){var _0x1db72c={},_0x2fe40d={},_0x35d1f7={'count':0x0,'rows':[]};var _0xefef48=db[_0xb84a('0x27')]['rawAttributes'];_0x2fe40d['model']=_[_0xb84a('0x28')](_0xefef48);_0x2fe40d[_0xb84a('0x29')]=_['keys'](_0xd468c3[_0xb84a('0x29')]);_0x2fe40d[_0xb84a('0x2a')]=_['intersection'](_0x2fe40d['model'],_0x2fe40d[_0xb84a('0x29')]);_0x1db72c[_0xb84a('0x2b')]=_['intersection'](_0x2fe40d[_0xb84a('0x2c')],qs[_0xb84a('0x2d')](_0xd468c3[_0xb84a('0x29')][_0xb84a('0x2d')]));_0x1db72c[_0xb84a('0x2b')]=_0x1db72c[_0xb84a('0x2b')][_0xb84a('0x2e')]?_0x1db72c[_0xb84a('0x2b')]:_0x2fe40d['model'];if(!_0xd468c3[_0xb84a('0x29')]['hasOwnProperty']('nolimit')){_0x1db72c[_0xb84a('0x1a')]=qs[_0xb84a('0x1a')](_0xd468c3['query']['limit']);_0x1db72c[_0xb84a('0x19')]=qs[_0xb84a('0x19')](_0xd468c3[_0xb84a('0x29')][_0xb84a('0x19')]);}_0x1db72c[_0xb84a('0x2f')]=qs[_0xb84a('0x30')](_0xd468c3[_0xb84a('0x29')][_0xb84a('0x30')]);_0x1db72c['where']=qs[_0xb84a('0x2a')](_[_0xb84a('0x31')](_0xd468c3[_0xb84a('0x29')],_0x2fe40d[_0xb84a('0x2a')]));if(_0xd468c3[_0xb84a('0x29')][_0xb84a('0x32')]){_0x1db72c[_0xb84a('0x33')]=_['merge'](_0x1db72c[_0xb84a('0x33')],{'$or':_['map'](_0xefef48,function(_0x1a3115){if(_0x1a3115[_0xb84a('0x34')][_0xb84a('0x35')]!=='VIRTUAL'){var _0x4af084={};_0x4af084[_0x1a3115[_0xb84a('0x36')]]={'$like':'%'+_0xd468c3[_0xb84a('0x29')][_0xb84a('0x32')]+'%'};return _0x4af084;}})});}_0x1db72c=_[_0xb84a('0x37')]({},_0x1db72c,_0xd468c3[_0xb84a('0x38')]);var _0x4cb5d4={'where':_0x1db72c[_0xb84a('0x33')]};return db[_0xb84a('0x27')]['count'](_0x4cb5d4)[_0xb84a('0x20')](function(_0xe6f19e){_0x35d1f7[_0xb84a('0x18')]=_0xe6f19e;if(_0xd468c3[_0xb84a('0x29')]['includeAll']){_0x1db72c['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xb84a('0x39')](_0x1db72c);})[_0xb84a('0x20')](function(_0x43a071){_0x35d1f7[_0xb84a('0x3a')]=_0x43a071;return _0x35d1f7;})['then'](respondWithFilteredResult(_0x33bf1d,_0x1db72c))[_0xb84a('0x3b')](handleError(_0x33bf1d,null));};exports['show']=function(_0x3081b4,_0x532005){var _0x48db18={'raw':!![],'where':{'id':_0x3081b4[_0xb84a('0x3c')]['id']}},_0x59d7a1={};_0x59d7a1[_0xb84a('0x2c')]=_[_0xb84a('0x28')](db[_0xb84a('0x27')]['rawAttributes']);_0x59d7a1[_0xb84a('0x29')]=_[_0xb84a('0x28')](_0x3081b4[_0xb84a('0x29')]);_0x59d7a1[_0xb84a('0x2a')]=_['intersection'](_0x59d7a1['model'],_0x59d7a1[_0xb84a('0x29')]);_0x48db18[_0xb84a('0x2b')]=_['intersection'](_0x59d7a1[_0xb84a('0x2c')],qs[_0xb84a('0x2d')](_0x3081b4[_0xb84a('0x29')][_0xb84a('0x2d')]));_0x48db18[_0xb84a('0x2b')]=_0x48db18[_0xb84a('0x2b')][_0xb84a('0x2e')]?_0x48db18[_0xb84a('0x2b')]:_0x59d7a1[_0xb84a('0x2c')];if(_0x3081b4[_0xb84a('0x29')][_0xb84a('0x3d')]){_0x48db18[_0xb84a('0x3e')]=[{'all':!![]}];}_0x48db18=_[_0xb84a('0x37')]({},_0x48db18,_0x3081b4[_0xb84a('0x38')]);return db[_0xb84a('0x27')]['find'](_0x48db18)[_0xb84a('0x20')](handleEntityNotFound(_0x532005,null))[_0xb84a('0x20')](respondWithResult(_0x532005,null))[_0xb84a('0x3b')](handleError(_0x532005,null));};exports[_0xb84a('0x3f')]=function(_0x37f4fe,_0x28b481){return db['OpenchannelTransferReport'][_0xb84a('0x3f')](_0x37f4fe['body'],{})[_0xb84a('0x20')](respondWithResult(_0x28b481,0xc9))[_0xb84a('0x3b')](handleError(_0x28b481,null));};exports[_0xb84a('0x1f')]=function(_0x4a14fb,_0x5e7327){if(_0x4a14fb[_0xb84a('0x40')]['id']){delete _0x4a14fb[_0xb84a('0x40')]['id'];}return db[_0xb84a('0x27')]['find']({'where':{'id':_0x4a14fb['params']['id']}})[_0xb84a('0x20')](handleEntityNotFound(_0x5e7327,null))[_0xb84a('0x20')](saveUpdates(_0x4a14fb[_0xb84a('0x40')],null))['then'](respondWithResult(_0x5e7327,null))['catch'](handleError(_0x5e7327,null));};exports['destroy']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x27')][_0xb84a('0x41')]({'where':{'id':_0x45630d[_0xb84a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x384a0d,null))['then'](removeEntity(_0x384a0d,null))['catch'](handleError(_0x384a0d,null));};exports['describe']=function(_0x421ba0,_0xd094be){return db['OpenchannelTransferReport'][_0xb84a('0x42')]()[_0xb84a('0x20')](respondWithResult(_0xd094be,null))[_0xb84a('0x3b')](handleError(_0xd094be,null));}; \ No newline at end of file +var _0xfd28=['where','merge','type','key','field','options','count','include','rows','catch','show','rawAttributes','length','includeAll','body','find','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../config/license/hardware','../../components/parsers/qs','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick'];(function(_0x4a51d3,_0x12c4f7){var _0x3634f7=function(_0x406433){while(--_0x406433){_0x4a51d3['push'](_0x4a51d3['shift']());}};_0x3634f7(++_0x12c4f7);}(_0xfd28,0x148));var _0x8fd2=function(_0x59b2a1,_0x1f631f){_0x59b2a1=_0x59b2a1-0x0;var _0x4908d1=_0xfd28[_0x59b2a1];return _0x4908d1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8fd2('0x0'));var rimraf=require(_0x8fd2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8fd2('0x2'));var rp=require('request-promise');var moment=require(_0x8fd2('0x3'));var BPromise=require(_0x8fd2('0x4'));var Mustache=require(_0x8fd2('0x5'));var util=require('util');var path=require(_0x8fd2('0x6'));var sox=require(_0x8fd2('0x7'));var csv=require(_0x8fd2('0x8'));var ejs=require(_0x8fd2('0x9'));var fs=require('fs');var _=require(_0x8fd2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8fd2('0xb'));var deskjs=require(_0x8fd2('0xc'));var toCsv=require(_0x8fd2('0x8'));var querystring=require('querystring');var Papa=require(_0x8fd2('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x8fd2('0xe'));var Redis=require('ioredis');var qs=require(_0x8fd2('0xf'));var logger=require('../../config/logger')(_0x8fd2('0x10'));var utils=require('../../config/utils');var config=require(_0x8fd2('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4706b2,_0x207298){_0x207298=_0x207298||0xcc;return function(_0xfd78d){if(_0xfd78d){return _0x4706b2[_0x8fd2('0x12')](_0x207298);}return _0x4706b2[_0x8fd2('0x13')](_0x207298)[_0x8fd2('0x14')]();};}function respondWithResult(_0x1e214c,_0xf22ae){_0xf22ae=_0xf22ae||0xc8;return function(_0x2b152c){if(_0x2b152c){return _0x1e214c[_0x8fd2('0x13')](_0xf22ae)[_0x8fd2('0x15')](_0x2b152c);}};}function respondWithFilteredResult(_0x6b8ef,_0x725d57){return function(_0x40712c){if(_0x40712c){var _0xa65b4=_0x40712c['count'],_0x596639=_0x725d57['offset'],_0x20daca=_0x725d57[_0x8fd2('0x16')]+_0x725d57[_0x8fd2('0x17')],_0x5ef478;if(_0x20daca>=_0xa65b4){_0x20daca=_0xa65b4;_0x5ef478=0xc8;}else{_0x5ef478=0xce;}_0x6b8ef[_0x8fd2('0x13')](_0x5ef478);return _0x6b8ef[_0x8fd2('0x18')]('Content-Range',_0x596639+'-'+_0x20daca+'/'+_0xa65b4)[_0x8fd2('0x15')](_0x40712c);}return null;};}function patchUpdates(_0x708421){return function(_0x411943){try{jsonpatch[_0x8fd2('0x19')](_0x411943,_0x708421,!![]);}catch(_0x14641a){return BPromise['reject'](_0x14641a);}return _0x411943['save']();};}function saveUpdates(_0x3a0939,_0x4a2002){return function(_0x3c03de){if(_0x3c03de){return _0x3c03de['update'](_0x3a0939)[_0x8fd2('0x1a')](function(_0x50f410){return _0x50f410;});}return null;};}function removeEntity(_0x4f81dc,_0x122b60){return function(_0x4c2be8){if(_0x4c2be8){return _0x4c2be8[_0x8fd2('0x1b')]()[_0x8fd2('0x1a')](function(){_0x4f81dc['status'](0xcc)[_0x8fd2('0x14')]();});}};}function handleEntityNotFound(_0x2a9c3c,_0x120285){return function(_0x490ea5){if(!_0x490ea5){_0x2a9c3c[_0x8fd2('0x12')](0x194);}return _0x490ea5;};}function handleError(_0x3b9e2f,_0x27d03b){_0x27d03b=_0x27d03b||0x1f4;return function(_0x4742cf){logger[_0x8fd2('0x1c')](_0x4742cf[_0x8fd2('0x1d')]);if(_0x4742cf[_0x8fd2('0x1e')]){delete _0x4742cf[_0x8fd2('0x1e')];}_0x3b9e2f[_0x8fd2('0x13')](_0x27d03b)[_0x8fd2('0x1f')](_0x4742cf);};}exports[_0x8fd2('0x20')]=function(_0x1f3237,_0x3f16a3){var _0x512e5a={},_0x4c6af7={},_0x345bc3={'count':0x0,'rows':[]};var _0x1858a9=db[_0x8fd2('0x21')]['rawAttributes'];_0x4c6af7[_0x8fd2('0x22')]=_[_0x8fd2('0x23')](_0x1858a9);_0x4c6af7[_0x8fd2('0x24')]=_[_0x8fd2('0x23')](_0x1f3237[_0x8fd2('0x24')]);_0x4c6af7[_0x8fd2('0x25')]=_[_0x8fd2('0x26')](_0x4c6af7['model'],_0x4c6af7[_0x8fd2('0x24')]);_0x512e5a[_0x8fd2('0x27')]=_[_0x8fd2('0x26')](_0x4c6af7[_0x8fd2('0x22')],qs[_0x8fd2('0x28')](_0x1f3237[_0x8fd2('0x24')][_0x8fd2('0x28')]));_0x512e5a['attributes']=_0x512e5a['attributes']['length']?_0x512e5a[_0x8fd2('0x27')]:_0x4c6af7[_0x8fd2('0x22')];if(!_0x1f3237[_0x8fd2('0x24')][_0x8fd2('0x29')]('nolimit')){_0x512e5a['limit']=qs[_0x8fd2('0x17')](_0x1f3237[_0x8fd2('0x24')][_0x8fd2('0x17')]);_0x512e5a[_0x8fd2('0x16')]=qs[_0x8fd2('0x16')](_0x1f3237['query'][_0x8fd2('0x16')]);}_0x512e5a['order']=qs[_0x8fd2('0x2a')](_0x1f3237['query'][_0x8fd2('0x2a')]);_0x512e5a['where']=qs[_0x8fd2('0x25')](_[_0x8fd2('0x2b')](_0x1f3237[_0x8fd2('0x24')],_0x4c6af7['filters']));if(_0x1f3237[_0x8fd2('0x24')]['filter']){_0x512e5a[_0x8fd2('0x2c')]=_[_0x8fd2('0x2d')](_0x512e5a[_0x8fd2('0x2c')],{'$or':_['map'](_0x1858a9,function(_0x14f382){if(_0x14f382[_0x8fd2('0x2e')][_0x8fd2('0x2f')]!=='VIRTUAL'){var _0x11ef3b={};_0x11ef3b[_0x14f382[_0x8fd2('0x30')]]={'$like':'%'+_0x1f3237[_0x8fd2('0x24')]['filter']+'%'};return _0x11ef3b;}})});}_0x512e5a=_[_0x8fd2('0x2d')]({},_0x512e5a,_0x1f3237[_0x8fd2('0x31')]);var _0x589d97={'where':_0x512e5a[_0x8fd2('0x2c')]};return db[_0x8fd2('0x21')][_0x8fd2('0x32')](_0x589d97)[_0x8fd2('0x1a')](function(_0x2ef293){_0x345bc3[_0x8fd2('0x32')]=_0x2ef293;if(_0x1f3237[_0x8fd2('0x24')]['includeAll']){_0x512e5a[_0x8fd2('0x33')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x512e5a);})[_0x8fd2('0x1a')](function(_0xb2c8cc){_0x345bc3[_0x8fd2('0x34')]=_0xb2c8cc;return _0x345bc3;})[_0x8fd2('0x1a')](respondWithFilteredResult(_0x3f16a3,_0x512e5a))[_0x8fd2('0x35')](handleError(_0x3f16a3,null));};exports[_0x8fd2('0x36')]=function(_0x5d3727,_0x5062ca){var _0x2df1da={'raw':!![],'where':{'id':_0x5d3727['params']['id']}},_0x4aff57={};_0x4aff57[_0x8fd2('0x22')]=_[_0x8fd2('0x23')](db[_0x8fd2('0x21')][_0x8fd2('0x37')]);_0x4aff57['query']=_[_0x8fd2('0x23')](_0x5d3727[_0x8fd2('0x24')]);_0x4aff57[_0x8fd2('0x25')]=_[_0x8fd2('0x26')](_0x4aff57[_0x8fd2('0x22')],_0x4aff57[_0x8fd2('0x24')]);_0x2df1da[_0x8fd2('0x27')]=_['intersection'](_0x4aff57[_0x8fd2('0x22')],qs[_0x8fd2('0x28')](_0x5d3727[_0x8fd2('0x24')][_0x8fd2('0x28')]));_0x2df1da[_0x8fd2('0x27')]=_0x2df1da[_0x8fd2('0x27')][_0x8fd2('0x38')]?_0x2df1da['attributes']:_0x4aff57[_0x8fd2('0x22')];if(_0x5d3727[_0x8fd2('0x24')][_0x8fd2('0x39')]){_0x2df1da[_0x8fd2('0x33')]=[{'all':!![]}];}_0x2df1da=_[_0x8fd2('0x2d')]({},_0x2df1da,_0x5d3727[_0x8fd2('0x31')]);return db[_0x8fd2('0x21')]['find'](_0x2df1da)[_0x8fd2('0x1a')](handleEntityNotFound(_0x5062ca,null))['then'](respondWithResult(_0x5062ca,null))[_0x8fd2('0x35')](handleError(_0x5062ca,null));};exports['create']=function(_0x17710f,_0xe511dd){return db[_0x8fd2('0x21')]['create'](_0x17710f[_0x8fd2('0x3a')],{})[_0x8fd2('0x1a')](respondWithResult(_0xe511dd,0xc9))[_0x8fd2('0x35')](handleError(_0xe511dd,null));};exports['update']=function(_0x3c65c4,_0x4c015e){if(_0x3c65c4[_0x8fd2('0x3a')]['id']){delete _0x3c65c4[_0x8fd2('0x3a')]['id'];}return db[_0x8fd2('0x21')][_0x8fd2('0x3b')]({'where':{'id':_0x3c65c4[_0x8fd2('0x3c')]['id']}})[_0x8fd2('0x1a')](handleEntityNotFound(_0x4c015e,null))[_0x8fd2('0x1a')](saveUpdates(_0x3c65c4[_0x8fd2('0x3a')],null))[_0x8fd2('0x1a')](respondWithResult(_0x4c015e,null))[_0x8fd2('0x35')](handleError(_0x4c015e,null));};exports[_0x8fd2('0x1b')]=function(_0x34f3a2,_0xd3d8cb){return db[_0x8fd2('0x21')][_0x8fd2('0x3b')]({'where':{'id':_0x34f3a2[_0x8fd2('0x3c')]['id']}})[_0x8fd2('0x1a')](handleEntityNotFound(_0xd3d8cb,null))[_0x8fd2('0x1a')](removeEntity(_0xd3d8cb,null))[_0x8fd2('0x35')](handleError(_0xd3d8cb,null));};exports['describe']=function(_0x50f894,_0x43a9a8){return db[_0x8fd2('0x21')][_0x8fd2('0x3d')]()['then'](respondWithResult(_0x43a9a8,null))['catch'](handleError(_0x43a9a8,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index d7ed0e8..22b473c 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 _0x814b=['lodash','util','../../config/logger','api','moment','bluebird','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid'];(function(_0x5d660b,_0x2b6023){var _0x29263a=function(_0x2320ff){while(--_0x2320ff){_0x5d660b['push'](_0x5d660b['shift']());}};_0x29263a(++_0x2b6023);}(_0x814b,0x1a2));var _0xb814=function(_0x4471b3,_0x511a9f){_0x4471b3=_0x4471b3-0x0;var _0x386593=_0x814b[_0x4471b3];return _0x386593;};'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 attributes=require(_0xb814('0x6'));module[_0xb814('0x7')]=function(_0x258866,_0x4237bc){return _0x258866[_0xb814('0x8')](_0xb814('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xb814('0xa'),'fields':[_0xb814('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2f=['bluebird','request-promise','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x18c8fd,_0x1ea9cc){var _0x31e0ba=function(_0x1c6cd5){while(--_0x1c6cd5){_0x18c8fd['push'](_0x18c8fd['shift']());}};_0x31e0ba(++_0x1ea9cc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5576a9,_0x330f68){_0x5576a9=_0x5576a9-0x0;var _0xa8eab7=_0x5f2f[_0x5576a9];return _0xa8eab7;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var attributes=require(_0xf5f2('0x7'));module['exports']=function(_0x4854b6,_0x1665c7){return _0x4854b6[_0xf5f2('0x8')](_0xf5f2('0x9'),attributes,{'tableName':_0xf5f2('0xa'),'paranoid':![],'indexes':[{'name':_0xf5f2('0xb'),'fields':[_0xf5f2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 5e1a05e..63440bf 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 _0xc3ce=['info','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3d6fda,_0x1a5e0c){var _0x2d66a2=function(_0x300e75){while(--_0x300e75){_0x3d6fda['push'](_0x3d6fda['shift']());}};_0x2d66a2(++_0x1a5e0c);}(_0xc3ce,0x1e6));var _0xec3c=function(_0x4623ce,_0x2d3678){_0x4623ce=_0x4623ce-0x0;var _0x1bac75=_0xc3ce[_0x4623ce];return _0x1bac75;};'use strict';var _=require(_0xec3c('0x0'));var util=require(_0xec3c('0x1'));var moment=require('moment');var BPromise=require(_0xec3c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec3c('0x3'))['db'];var utils=require(_0xec3c('0x4'));var logger=require(_0xec3c('0x5'))(_0xec3c('0x6'));var config=require(_0xec3c('0x7'));var jayson=require(_0xec3c('0x8'));var client=jayson[_0xec3c('0x9')][_0xec3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2909f0,_0x597daf,_0xc0252d){return new BPromise(function(_0x39be9b,_0x5ac262){return client[_0xec3c('0xb')](_0x2909f0,_0xc0252d)[_0xec3c('0xc')](function(_0xcc33b8){logger['info'](_0xec3c('0xd'),_0x597daf,_0xec3c('0xe'));logger['debug'](_0xec3c('0xf'),_0x597daf,_0xec3c('0xe'),JSON[_0xec3c('0x10')](_0xcc33b8));if(_0xcc33b8[_0xec3c('0x11')]){if(_0xcc33b8['error'][_0xec3c('0x12')]===0x1f4){logger[_0xec3c('0x11')](_0xec3c('0xd'),_0x597daf,_0xcc33b8[_0xec3c('0x11')][_0xec3c('0x13')]);return _0x5ac262(_0xcc33b8[_0xec3c('0x11')][_0xec3c('0x13')]);}logger[_0xec3c('0x11')](_0xec3c('0xd'),_0x597daf,_0xcc33b8[_0xec3c('0x11')][_0xec3c('0x13')]);return _0x39be9b(_0xcc33b8[_0xec3c('0x11')][_0xec3c('0x13')]);}else{logger[_0xec3c('0x14')](_0xec3c('0xd'),_0x597daf,_0xec3c('0xe'));_0x39be9b(_0xcc33b8['result'][_0xec3c('0x13')]);}})[_0xec3c('0x15')](function(_0x484b7e){logger['error'](_0xec3c('0xd'),_0x597daf,_0x484b7e);_0x5ac262(_0x484b7e);});});} \ No newline at end of file +var _0x34ee=['OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x23c2ed,_0x281ced){var _0x551fc4=function(_0x5cfd0a){while(--_0x5cfd0a){_0x23c2ed['push'](_0x23c2ed['shift']());}};_0x551fc4(++_0x281ced);}(_0x34ee,0x144));var _0xe34e=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x34ee[_0x3c4062];return _0x3f5bf3;};'use strict';var _=require(_0xe34e('0x0'));var util=require('util');var moment=require(_0xe34e('0x1'));var BPromise=require('bluebird');var rs=require(_0xe34e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe34e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe34e('0x4'))(_0xe34e('0x5'));var config=require('../../config/environment');var jayson=require(_0xe34e('0x6'));var client=jayson[_0xe34e('0x7')][_0xe34e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x449ca4,_0x3be1dc,_0x3832c9){return new BPromise(function(_0x3954f4,_0xf13fb9){return client[_0xe34e('0x9')](_0x449ca4,_0x3832c9)[_0xe34e('0xa')](function(_0x3396e2){logger[_0xe34e('0xb')](_0xe34e('0xc'),_0x3be1dc,_0xe34e('0xd'));logger[_0xe34e('0xe')](_0xe34e('0xf'),_0x3be1dc,_0xe34e('0xd'),JSON['stringify'](_0x3396e2));if(_0x3396e2[_0xe34e('0x10')]){if(_0x3396e2[_0xe34e('0x10')][_0xe34e('0x11')]===0x1f4){logger['error'](_0xe34e('0xc'),_0x3be1dc,_0x3396e2[_0xe34e('0x10')][_0xe34e('0x12')]);return _0xf13fb9(_0x3396e2['error']['message']);}logger[_0xe34e('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3be1dc,_0x3396e2['error'][_0xe34e('0x12')]);return _0x3954f4(_0x3396e2['error'][_0xe34e('0x12')]);}else{logger[_0xe34e('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3be1dc,_0xe34e('0xd'));_0x3954f4(_0x3396e2[_0xe34e('0x13')][_0xe34e('0x12')]);}})[_0xe34e('0x14')](function(_0x3537ff){logger[_0xe34e('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3be1dc,_0x3537ff);_0xf13fb9(_0x3537ff);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index ca9417c..5d52c86 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 _0x4f6f=['exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./pause.controller','get','index','/:id','show','create','put','isAuthenticated','update','delete','destroy'];(function(_0xc65ae2,_0x53119a){var _0x2432ea=function(_0x3f70f3){while(--_0x3f70f3){_0xc65ae2['push'](_0xc65ae2['shift']());}};_0x2432ea(++_0x53119a);}(_0x4f6f,0x157));var _0xf4f6=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x4f6f[_0x30faec];return _0x29484f;};'use strict';var multer=require(_0xf4f6('0x0'));var util=require(_0xf4f6('0x1'));var path=require(_0xf4f6('0x2'));var timeout=require('connect-timeout');var express=require(_0xf4f6('0x3'));var router=express['Router']();var auth=require(_0xf4f6('0x4'));var interaction=require(_0xf4f6('0x5'));var config=require('../../config/environment');var controller=require(_0xf4f6('0x6'));router[_0xf4f6('0x7')]('/',auth['isAuthenticated'](),controller[_0xf4f6('0x8')]);router[_0xf4f6('0x7')](_0xf4f6('0x9'),auth['isAuthenticated'](),controller[_0xf4f6('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf4f6('0xb')]);router[_0xf4f6('0xc')](_0xf4f6('0x9'),auth[_0xf4f6('0xd')](),controller[_0xf4f6('0xe')]);router[_0xf4f6('0xf')]('/:id',auth[_0xf4f6('0xd')](),controller[_0xf4f6('0x10')]);module[_0xf4f6('0x11')]=router; \ No newline at end of file +var _0x1948=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','show','create','update','delete','/:id'];(function(_0x17723c,_0x1ea81d){var _0x1ffbf3=function(_0x5276cd){while(--_0x5276cd){_0x17723c['push'](_0x17723c['shift']());}};_0x1ffbf3(++_0x1ea81d);}(_0x1948,0x145));var _0x8194=function(_0x58e3c5,_0x252be8){_0x58e3c5=_0x58e3c5-0x0;var _0x3e90da=_0x1948[_0x58e3c5];return _0x3e90da;};'use strict';var multer=require(_0x8194('0x0'));var util=require(_0x8194('0x1'));var path=require(_0x8194('0x2'));var timeout=require(_0x8194('0x3'));var express=require(_0x8194('0x4'));var router=express['Router']();var auth=require(_0x8194('0x5'));var interaction=require(_0x8194('0x6'));var config=require(_0x8194('0x7'));var controller=require(_0x8194('0x8'));router[_0x8194('0x9')]('/',auth[_0x8194('0xa')](),controller[_0x8194('0xb')]);router[_0x8194('0x9')]('/:id',auth[_0x8194('0xa')](),controller[_0x8194('0xc')]);router['post']('/',auth[_0x8194('0xa')](),controller[_0x8194('0xd')]);router['put']('/:id',auth[_0x8194('0xa')](),controller[_0x8194('0xe')]);router[_0x8194('0xf')](_0x8194('0x10'),auth[_0x8194('0xa')](),controller['destroy']);module[_0x8194('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index b506595..750256e 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 _0x1ded=['STRING','name','sequelize'];(function(_0x3b8ac0,_0x4519b8){var _0x334d9b=function(_0x5d5cae){while(--_0x5d5cae){_0x3b8ac0['push'](_0x3b8ac0['shift']());}};_0x334d9b(++_0x4519b8);}(_0x1ded,0xfb));var _0xd1de=function(_0x480759,_0x2affeb){_0x480759=_0x480759-0x0;var _0x36cce0=_0x1ded[_0x480759];return _0x36cce0;};'use strict';var Sequelize=require(_0xd1de('0x0'));module['exports']={'name':{'type':Sequelize[_0xd1de('0x1')],'unique':_0xd1de('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x07eb=['sequelize','exports','STRING'];(function(_0x37bf22,_0x365fa3){var _0x100485=function(_0x43f2f9){while(--_0x43f2f9){_0x37bf22['push'](_0x37bf22['shift']());}};_0x100485(++_0x365fa3);}(_0x07eb,0x17d));var _0xb07e=function(_0x2b9cf5,_0x2a7804){_0x2b9cf5=_0x2b9cf5-0x0;var _0xd0cf15=_0x07eb[_0x2b9cf5];return _0xd0cf15;};'use strict';var Sequelize=require(_0xb07e('0x0'));module[_0xb07e('0x1')]={'name':{'type':Sequelize[_0xb07e('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xb07e('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 56c4925..37f24df 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 _0x315a=['sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','status','end','stack','name','send','index','Pause','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','field','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','moment','bluebird','util'];(function(_0x494887,_0x10c1d7){var _0x52c72c=function(_0x555c8a){while(--_0x555c8a){_0x494887['push'](_0x494887['shift']());}};_0x52c72c(++_0x10c1d7);}(_0x315a,0x12b));var _0xa315=function(_0x3f2cfc,_0x2827b0){_0x3f2cfc=_0x3f2cfc-0x0;var _0x1d1e61=_0x315a[_0x3f2cfc];return _0x1d1e61;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa315('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa315('0x1'));var moment=require(_0xa315('0x2'));var BPromise=require(_0xa315('0x3'));var Mustache=require('mustache');var util=require(_0xa315('0x4'));var path=require('path');var sox=require(_0xa315('0x5'));var csv=require(_0xa315('0x6'));var ejs=require(_0xa315('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa315('0x8'));var crypto=require(_0xa315('0x9'));var jsforce=require(_0xa315('0xa'));var deskjs=require(_0xa315('0xb'));var toCsv=require(_0xa315('0x6'));var querystring=require(_0xa315('0xc'));var Papa=require(_0xa315('0xd'));var authService=require(_0xa315('0xe'));var hardwareService=require(_0xa315('0xf'));var Redis=require('ioredis');var qs=require(_0xa315('0x10'));var logger=require(_0xa315('0x11'))(_0xa315('0x12'));var utils=require(_0xa315('0x13'));var config=require(_0xa315('0x14'));var db=require(_0xa315('0x15'))['db'];function respondWithStatusCode(_0x1a3276,_0x43d618){_0x43d618=_0x43d618||0xcc;return function(_0x47822f){if(_0x47822f){return _0x1a3276[_0xa315('0x16')](_0x43d618);}return _0x1a3276['status'](_0x43d618)['end']();};}function respondWithResult(_0x19389b,_0x3fe88a){_0x3fe88a=_0x3fe88a||0xc8;return function(_0x3df14b){if(_0x3df14b){return _0x19389b['status'](_0x3fe88a)[_0xa315('0x17')](_0x3df14b);}};}function respondWithFilteredResult(_0x50cc62,_0x1213be){return function(_0x3f74d5){if(_0x3f74d5){var _0x1ab6cd=_0x3f74d5[_0xa315('0x18')],_0x446176=_0x1213be['offset'],_0xdb8ea=_0x1213be[_0xa315('0x19')]+_0x1213be[_0xa315('0x1a')],_0x4d0017;if(_0xdb8ea>=_0x1ab6cd){_0xdb8ea=_0x1ab6cd;_0x4d0017=0xc8;}else{_0x4d0017=0xce;}_0x50cc62['status'](_0x4d0017);return _0x50cc62['set'](_0xa315('0x1b'),_0x446176+'-'+_0xdb8ea+'/'+_0x1ab6cd)['json'](_0x3f74d5);}return null;};}function patchUpdates(_0x28f307){return function(_0x3e19a7){try{jsonpatch[_0xa315('0x1c')](_0x3e19a7,_0x28f307,!![]);}catch(_0x5d547e){return BPromise[_0xa315('0x1d')](_0x5d547e);}return _0x3e19a7[_0xa315('0x1e')]();};}function saveUpdates(_0x61b707,_0x156b7e){return function(_0x264dd1){if(_0x264dd1){return _0x264dd1['update'](_0x61b707)[_0xa315('0x1f')](function(_0x357ada){return _0x357ada;});}return null;};}function removeEntity(_0x52f2c9,_0x5420fd){return function(_0x159a85){if(_0x159a85){return _0x159a85[_0xa315('0x20')]()[_0xa315('0x1f')](function(){var _0x49813c=_0x159a85[_0xa315('0x21')]({'plain':!![]});var _0x412075='Pauses';return db[_0xa315('0x22')][_0xa315('0x20')]({'where':{'type':_0x412075,'resourceId':_0x49813c['id']}})[_0xa315('0x1f')](function(){return _0x159a85;});})[_0xa315('0x1f')](function(){_0x52f2c9[_0xa315('0x23')](0xcc)[_0xa315('0x24')]();});}};}function handleEntityNotFound(_0x49059b,_0x56ca2e){return function(_0x4ace72){if(!_0x4ace72){_0x49059b['sendStatus'](0x194);}return _0x4ace72;};}function handleError(_0x2ac147,_0xf39ba3){_0xf39ba3=_0xf39ba3||0x1f4;return function(_0x5df052){logger['error'](_0x5df052[_0xa315('0x25')]);if(_0x5df052[_0xa315('0x26')]){delete _0x5df052['name'];}_0x2ac147[_0xa315('0x23')](_0xf39ba3)[_0xa315('0x27')](_0x5df052);};}exports[_0xa315('0x28')]=function(_0x217790,_0x5344a1){var _0x10fa3a={},_0x1261d9={},_0x1a089f={'count':0x0,'rows':[]};var _0x1d2a76=db[_0xa315('0x29')][_0xa315('0x2a')];_0x1261d9['model']=_[_0xa315('0x2b')](_0x1d2a76);_0x1261d9[_0xa315('0x2c')]=_[_0xa315('0x2b')](_0x217790[_0xa315('0x2c')]);_0x1261d9['filters']=_[_0xa315('0x2d')](_0x1261d9[_0xa315('0x2e')],_0x1261d9['query']);_0x10fa3a[_0xa315('0x2f')]=_[_0xa315('0x2d')](_0x1261d9[_0xa315('0x2e')],qs['fields'](_0x217790[_0xa315('0x2c')][_0xa315('0x30')]));_0x10fa3a[_0xa315('0x2f')]=_0x10fa3a[_0xa315('0x2f')][_0xa315('0x31')]?_0x10fa3a[_0xa315('0x2f')]:_0x1261d9[_0xa315('0x2e')];if(!_0x217790[_0xa315('0x2c')][_0xa315('0x32')](_0xa315('0x33'))){_0x10fa3a[_0xa315('0x1a')]=qs[_0xa315('0x1a')](_0x217790[_0xa315('0x2c')][_0xa315('0x1a')]);_0x10fa3a['offset']=qs[_0xa315('0x19')](_0x217790['query'][_0xa315('0x19')]);}_0x10fa3a[_0xa315('0x34')]=qs[_0xa315('0x35')](_0x217790[_0xa315('0x2c')]['sort']);_0x10fa3a[_0xa315('0x36')]=qs['filters'](_['pick'](_0x217790[_0xa315('0x2c')],_0x1261d9['filters']));if(_0x217790[_0xa315('0x2c')][_0xa315('0x37')]){_0x10fa3a[_0xa315('0x36')]=_[_0xa315('0x38')](_0x10fa3a['where'],{'$or':_['map'](_0x1d2a76,function(_0x3bff27){if(_0x3bff27['type']['key']!==_0xa315('0x39')){var _0x455296={};_0x455296[_0x3bff27[_0xa315('0x3a')]]={'$like':'%'+_0x217790[_0xa315('0x2c')][_0xa315('0x37')]+'%'};return _0x455296;}})});}_0x10fa3a=_[_0xa315('0x38')]({},_0x10fa3a,_0x217790[_0xa315('0x3b')]);var _0x6bb9c0={'where':_0x10fa3a[_0xa315('0x36')]};return db[_0xa315('0x29')]['count'](_0x6bb9c0)['then'](function(_0x2a8bf3){_0x1a089f[_0xa315('0x18')]=_0x2a8bf3;if(_0x217790[_0xa315('0x2c')]['includeAll']){_0x10fa3a[_0xa315('0x3c')]=[{'all':!![]}];}return db[_0xa315('0x29')][_0xa315('0x3d')](_0x10fa3a);})[_0xa315('0x1f')](function(_0x2b7e02){_0x1a089f[_0xa315('0x3e')]=_0x2b7e02;return _0x1a089f;})[_0xa315('0x1f')](respondWithFilteredResult(_0x5344a1,_0x10fa3a))[_0xa315('0x3f')](handleError(_0x5344a1,null));};exports[_0xa315('0x40')]=function(_0x38c904,_0x1e1f05){var _0x3d75ca={'raw':!![],'where':{'id':_0x38c904[_0xa315('0x41')]['id']}},_0x5a6839={};_0x5a6839[_0xa315('0x2e')]=_[_0xa315('0x2b')](db[_0xa315('0x29')]['rawAttributes']);_0x5a6839['query']=_['keys'](_0x38c904[_0xa315('0x2c')]);_0x5a6839['filters']=_[_0xa315('0x2d')](_0x5a6839[_0xa315('0x2e')],_0x5a6839['query']);_0x3d75ca[_0xa315('0x2f')]=_['intersection'](_0x5a6839['model'],qs[_0xa315('0x30')](_0x38c904[_0xa315('0x2c')]['fields']));_0x3d75ca[_0xa315('0x2f')]=_0x3d75ca[_0xa315('0x2f')][_0xa315('0x31')]?_0x3d75ca[_0xa315('0x2f')]:_0x5a6839[_0xa315('0x2e')];if(_0x38c904['query'][_0xa315('0x42')]){_0x3d75ca[_0xa315('0x3c')]=[{'all':!![]}];}_0x3d75ca=_['merge']({},_0x3d75ca,_0x38c904[_0xa315('0x3b')]);return db[_0xa315('0x29')][_0xa315('0x43')](_0x3d75ca)[_0xa315('0x1f')](handleEntityNotFound(_0x1e1f05,null))['then'](respondWithResult(_0x1e1f05,null))['catch'](handleError(_0x1e1f05,null));};exports[_0xa315('0x44')]=function(_0x463bfc,_0x26631c){return db[_0xa315('0x29')][_0xa315('0x44')](_0x463bfc[_0xa315('0x45')],{})[_0xa315('0x1f')](function(_0x403b27){var _0x805fb=_0x463bfc[_0xa315('0x46')]['get']({'plain':!![]});if(!_0x805fb)throw new Error(_0xa315('0x47'));if(_0x805fb[_0xa315('0x48')]===_0xa315('0x46')){var _0x3b6997=_0x403b27[_0xa315('0x21')]({'plain':!![]});var _0xc715ae='Pauses';return db['UserProfileSection'][_0xa315('0x43')]({'where':{'name':_0xc715ae,'userProfileId':_0x805fb['userProfileId']},'raw':!![]})[_0xa315('0x1f')](function(_0x2be1c8){if(_0x2be1c8&&_0x2be1c8[_0xa315('0x49')]===0x0){return db[_0xa315('0x22')][_0xa315('0x44')]({'name':_0x3b6997[_0xa315('0x26')],'resourceId':_0x3b6997['id'],'type':_0x2be1c8[_0xa315('0x26')],'sectionId':_0x2be1c8['id']},{})['then'](function(){return _0x403b27;});}else{return _0x403b27;}})[_0xa315('0x3f')](function(_0x237306){logger[_0xa315('0x4a')](_0xa315('0x4b'),_0x237306);throw _0x237306;});}return _0x403b27;})[_0xa315('0x1f')](respondWithResult(_0x26631c,0xc9))[_0xa315('0x3f')](handleError(_0x26631c,null));};exports['update']=function(_0x58c22c,_0x530aed){if(_0x58c22c['body']['id']){delete _0x58c22c[_0xa315('0x45')]['id'];}return db['Pause']['find']({'where':{'id':_0x58c22c[_0xa315('0x41')]['id']}})['then'](handleEntityNotFound(_0x530aed,null))['then'](saveUpdates(_0x58c22c['body'],null))[_0xa315('0x1f')](respondWithResult(_0x530aed,null))[_0xa315('0x3f')](handleError(_0x530aed,null));};exports[_0xa315('0x20')]=function(_0x5e9804,_0x49fb60){return db[_0xa315('0x29')][_0xa315('0x43')]({'where':{'id':_0x5e9804[_0xa315('0x41')]['id']}})[_0xa315('0x1f')](handleEntityNotFound(_0x49fb60,null))[_0xa315('0x1f')](removeEntity(_0x49fb60,null))[_0xa315('0x3f')](handleError(_0x49fb60,null));}; \ No newline at end of file +var _0xcb3a=['findAll','rows','catch','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','body','html-pdf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','Pauses','destroy','error','stack','name','send','index','Pause','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','type','key','VIRTUAL','field','merge','options','includeAll'];(function(_0x567f0e,_0x2be7a0){var _0x15aca8=function(_0x1e6ca6){while(--_0x1e6ca6){_0x567f0e['push'](_0x567f0e['shift']());}};_0x15aca8(++_0x2be7a0);}(_0xcb3a,0x1ed));var _0xacb3=function(_0x2ddcc5,_0x371ab2){_0x2ddcc5=_0x2ddcc5-0x0;var _0x492749=_0xcb3a[_0x2ddcc5];return _0x492749;};'use strict';var pdf=require(_0xacb3('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xacb3('0x1'));var moment=require(_0xacb3('0x2'));var BPromise=require(_0xacb3('0x3'));var Mustache=require(_0xacb3('0x4'));var util=require(_0xacb3('0x5'));var path=require(_0xacb3('0x6'));var sox=require(_0xacb3('0x7'));var csv=require('to-csv');var ejs=require(_0xacb3('0x8'));var fs=require('fs');var _=require(_0xacb3('0x9'));var squel=require('squel');var crypto=require(_0xacb3('0xa'));var jsforce=require(_0xacb3('0xb'));var deskjs=require(_0xacb3('0xc'));var toCsv=require(_0xacb3('0xd'));var querystring=require('querystring');var Papa=require(_0xacb3('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xacb3('0xf'));var Redis=require(_0xacb3('0x10'));var qs=require(_0xacb3('0x11'));var logger=require(_0xacb3('0x12'))(_0xacb3('0x13'));var utils=require(_0xacb3('0x14'));var config=require(_0xacb3('0x15'));var db=require(_0xacb3('0x16'))['db'];function respondWithStatusCode(_0x1cf9a2,_0x267ee3){_0x267ee3=_0x267ee3||0xcc;return function(_0x28d480){if(_0x28d480){return _0x1cf9a2[_0xacb3('0x17')](_0x267ee3);}return _0x1cf9a2[_0xacb3('0x18')](_0x267ee3)[_0xacb3('0x19')]();};}function respondWithResult(_0x6df058,_0x478174){_0x478174=_0x478174||0xc8;return function(_0x404dbd){if(_0x404dbd){return _0x6df058[_0xacb3('0x18')](_0x478174)[_0xacb3('0x1a')](_0x404dbd);}};}function respondWithFilteredResult(_0xb1b4d,_0x16c8a8){return function(_0x33ebe8){if(_0x33ebe8){var _0x554b44=_0x33ebe8[_0xacb3('0x1b')],_0x31e8df=_0x16c8a8['offset'],_0x42af98=_0x16c8a8[_0xacb3('0x1c')]+_0x16c8a8[_0xacb3('0x1d')],_0x49eb81;if(_0x42af98>=_0x554b44){_0x42af98=_0x554b44;_0x49eb81=0xc8;}else{_0x49eb81=0xce;}_0xb1b4d[_0xacb3('0x18')](_0x49eb81);return _0xb1b4d[_0xacb3('0x1e')](_0xacb3('0x1f'),_0x31e8df+'-'+_0x42af98+'/'+_0x554b44)[_0xacb3('0x1a')](_0x33ebe8);}return null;};}function patchUpdates(_0x5c095e){return function(_0x503713){try{jsonpatch['apply'](_0x503713,_0x5c095e,!![]);}catch(_0xf3e290){return BPromise[_0xacb3('0x20')](_0xf3e290);}return _0x503713[_0xacb3('0x21')]();};}function saveUpdates(_0x5f9b63,_0x48cfca){return function(_0x48d2c1){if(_0x48d2c1){return _0x48d2c1[_0xacb3('0x22')](_0x5f9b63)[_0xacb3('0x23')](function(_0x4c5b19){return _0x4c5b19;});}return null;};}function removeEntity(_0x4e8587,_0x43480f){return function(_0x112a04){if(_0x112a04){return _0x112a04['destroy']()[_0xacb3('0x23')](function(){var _0x441682=_0x112a04[_0xacb3('0x24')]({'plain':!![]});var _0x40b831=_0xacb3('0x25');return db['UserProfileResource'][_0xacb3('0x26')]({'where':{'type':_0x40b831,'resourceId':_0x441682['id']}})['then'](function(){return _0x112a04;});})[_0xacb3('0x23')](function(){_0x4e8587[_0xacb3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e0459,_0x16b75c){return function(_0x55a50a){if(!_0x55a50a){_0x1e0459['sendStatus'](0x194);}return _0x55a50a;};}function handleError(_0x3c8e20,_0xb0a022){_0xb0a022=_0xb0a022||0x1f4;return function(_0xaf75b8){logger[_0xacb3('0x27')](_0xaf75b8[_0xacb3('0x28')]);if(_0xaf75b8[_0xacb3('0x29')]){delete _0xaf75b8[_0xacb3('0x29')];}_0x3c8e20[_0xacb3('0x18')](_0xb0a022)[_0xacb3('0x2a')](_0xaf75b8);};}exports[_0xacb3('0x2b')]=function(_0x1e38bb,_0x5439eb){var _0x544ce1={},_0x11b88f={},_0x58a5f5={'count':0x0,'rows':[]};var _0x30bc13=db[_0xacb3('0x2c')][_0xacb3('0x2d')];_0x11b88f[_0xacb3('0x2e')]=_[_0xacb3('0x2f')](_0x30bc13);_0x11b88f[_0xacb3('0x30')]=_[_0xacb3('0x2f')](_0x1e38bb[_0xacb3('0x30')]);_0x11b88f[_0xacb3('0x31')]=_[_0xacb3('0x32')](_0x11b88f['model'],_0x11b88f[_0xacb3('0x30')]);_0x544ce1[_0xacb3('0x33')]=_[_0xacb3('0x32')](_0x11b88f[_0xacb3('0x2e')],qs[_0xacb3('0x34')](_0x1e38bb[_0xacb3('0x30')]['fields']));_0x544ce1[_0xacb3('0x33')]=_0x544ce1[_0xacb3('0x33')][_0xacb3('0x35')]?_0x544ce1[_0xacb3('0x33')]:_0x11b88f['model'];if(!_0x1e38bb[_0xacb3('0x30')][_0xacb3('0x36')]('nolimit')){_0x544ce1[_0xacb3('0x1d')]=qs[_0xacb3('0x1d')](_0x1e38bb['query'][_0xacb3('0x1d')]);_0x544ce1[_0xacb3('0x1c')]=qs[_0xacb3('0x1c')](_0x1e38bb['query']['offset']);}_0x544ce1[_0xacb3('0x37')]=qs[_0xacb3('0x38')](_0x1e38bb[_0xacb3('0x30')][_0xacb3('0x38')]);_0x544ce1['where']=qs['filters'](_[_0xacb3('0x39')](_0x1e38bb[_0xacb3('0x30')],_0x11b88f[_0xacb3('0x31')]));if(_0x1e38bb[_0xacb3('0x30')][_0xacb3('0x3a')]){_0x544ce1['where']=_['merge'](_0x544ce1[_0xacb3('0x3b')],{'$or':_['map'](_0x30bc13,function(_0x2cb31a){if(_0x2cb31a[_0xacb3('0x3c')][_0xacb3('0x3d')]!==_0xacb3('0x3e')){var _0x6f3c8d={};_0x6f3c8d[_0x2cb31a[_0xacb3('0x3f')]]={'$like':'%'+_0x1e38bb[_0xacb3('0x30')][_0xacb3('0x3a')]+'%'};return _0x6f3c8d;}})});}_0x544ce1=_[_0xacb3('0x40')]({},_0x544ce1,_0x1e38bb[_0xacb3('0x41')]);var _0x143d50={'where':_0x544ce1['where']};return db[_0xacb3('0x2c')][_0xacb3('0x1b')](_0x143d50)[_0xacb3('0x23')](function(_0x103d47){_0x58a5f5[_0xacb3('0x1b')]=_0x103d47;if(_0x1e38bb[_0xacb3('0x30')][_0xacb3('0x42')]){_0x544ce1['include']=[{'all':!![]}];}return db[_0xacb3('0x2c')][_0xacb3('0x43')](_0x544ce1);})[_0xacb3('0x23')](function(_0x47995e){_0x58a5f5[_0xacb3('0x44')]=_0x47995e;return _0x58a5f5;})['then'](respondWithFilteredResult(_0x5439eb,_0x544ce1))[_0xacb3('0x45')](handleError(_0x5439eb,null));};exports['show']=function(_0x476bfe,_0x587c3d){var _0x119b4c={'raw':!![],'where':{'id':_0x476bfe[_0xacb3('0x46')]['id']}},_0x152c66={};_0x152c66[_0xacb3('0x2e')]=_[_0xacb3('0x2f')](db[_0xacb3('0x2c')][_0xacb3('0x2d')]);_0x152c66[_0xacb3('0x30')]=_['keys'](_0x476bfe['query']);_0x152c66[_0xacb3('0x31')]=_[_0xacb3('0x32')](_0x152c66[_0xacb3('0x2e')],_0x152c66[_0xacb3('0x30')]);_0x119b4c[_0xacb3('0x33')]=_[_0xacb3('0x32')](_0x152c66[_0xacb3('0x2e')],qs[_0xacb3('0x34')](_0x476bfe[_0xacb3('0x30')][_0xacb3('0x34')]));_0x119b4c[_0xacb3('0x33')]=_0x119b4c[_0xacb3('0x33')]['length']?_0x119b4c['attributes']:_0x152c66[_0xacb3('0x2e')];if(_0x476bfe[_0xacb3('0x30')][_0xacb3('0x42')]){_0x119b4c[_0xacb3('0x47')]=[{'all':!![]}];}_0x119b4c=_[_0xacb3('0x40')]({},_0x119b4c,_0x476bfe[_0xacb3('0x41')]);return db[_0xacb3('0x2c')][_0xacb3('0x48')](_0x119b4c)['then'](handleEntityNotFound(_0x587c3d,null))[_0xacb3('0x23')](respondWithResult(_0x587c3d,null))[_0xacb3('0x45')](handleError(_0x587c3d,null));};exports[_0xacb3('0x49')]=function(_0x427720,_0x17a816){return db[_0xacb3('0x2c')][_0xacb3('0x49')](_0x427720['body'],{})['then'](function(_0x34d38a){var _0x2f6e03=_0x427720[_0xacb3('0x4a')][_0xacb3('0x24')]({'plain':!![]});if(!_0x2f6e03)throw new Error(_0xacb3('0x4b'));if(_0x2f6e03[_0xacb3('0x4c')]===_0xacb3('0x4a')){var _0x282aca=_0x34d38a[_0xacb3('0x24')]({'plain':!![]});var _0x5bf452=_0xacb3('0x25');return db['UserProfileSection'][_0xacb3('0x48')]({'where':{'name':_0x5bf452,'userProfileId':_0x2f6e03[_0xacb3('0x4d')]},'raw':!![]})[_0xacb3('0x23')](function(_0x2a16cc){if(_0x2a16cc&&_0x2a16cc['autoAssociation']===0x0){return db[_0xacb3('0x4e')][_0xacb3('0x49')]({'name':_0x282aca[_0xacb3('0x29')],'resourceId':_0x282aca['id'],'type':_0x2a16cc[_0xacb3('0x29')],'sectionId':_0x2a16cc['id']},{})[_0xacb3('0x23')](function(){return _0x34d38a;});}else{return _0x34d38a;}})[_0xacb3('0x45')](function(_0x489c0d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x489c0d);throw _0x489c0d;});}return _0x34d38a;})[_0xacb3('0x23')](respondWithResult(_0x17a816,0xc9))['catch'](handleError(_0x17a816,null));};exports[_0xacb3('0x22')]=function(_0x188730,_0x57af57){if(_0x188730[_0xacb3('0x4f')]['id']){delete _0x188730[_0xacb3('0x4f')]['id'];}return db[_0xacb3('0x2c')]['find']({'where':{'id':_0x188730[_0xacb3('0x46')]['id']}})[_0xacb3('0x23')](handleEntityNotFound(_0x57af57,null))[_0xacb3('0x23')](saveUpdates(_0x188730['body'],null))['then'](respondWithResult(_0x57af57,null))[_0xacb3('0x45')](handleError(_0x57af57,null));};exports[_0xacb3('0x26')]=function(_0x25fa2e,_0x21075f){return db[_0xacb3('0x2c')][_0xacb3('0x48')]({'where':{'id':_0x25fa2e['params']['id']}})[_0xacb3('0x23')](handleEntityNotFound(_0x21075f,null))['then'](removeEntity(_0x21075f,null))[_0xacb3('0x45')](handleError(_0x21075f,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 72ec265..0fbc79f 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 _0x768b=['tools_pauses','lodash','../../config/logger','bluebird','request-promise','./pause.attributes','exports','define','Pause'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x768b,0x157));var _0xb768=function(_0x371bc3,_0x4fb976){_0x371bc3=_0x371bc3-0x0;var _0x53b54c=_0x768b[_0x371bc3];return _0x53b54c;};'use strict';var _=require(_0xb768('0x0'));var util=require('util');var logger=require(_0xb768('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb768('0x2'));var rp=require(_0xb768('0x3'));var attributes=require(_0xb768('0x4'));module[_0xb768('0x5')]=function(_0x43899a,_0x47cbe9){return _0x43899a[_0xb768('0x6')](_0xb768('0x7'),attributes,{'tableName':_0xb768('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x883e=['util','../../config/logger','api','request-promise','./pause.attributes','exports','tools_pauses','lodash'];(function(_0x353643,_0x568495){var _0x394b32=function(_0x3924ae){while(--_0x3924ae){_0x353643['push'](_0x353643['shift']());}};_0x394b32(++_0x568495);}(_0x883e,0x1a7));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe883('0x0'));var util=require(_0xe883('0x1'));var logger=require(_0xe883('0x2'))(_0xe883('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe883('0x4'));var attributes=require(_0xe883('0x5'));module[_0xe883('0x6')]=function(_0x4d4616,_0x35374a){return _0x4d4616['define']('Pause',attributes,{'tableName':_0xe883('0x7'),'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 5b850da..fe46dfb 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 _0x5dd5=['find','options','raw','where','include','model','attributes','map','then','stringify','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','Pause,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','ShowPause','Pause'];(function(_0x51aece,_0x961cd7){var _0x5629ad=function(_0x5c0db6){while(--_0x5c0db6){_0x51aece['push'](_0x51aece['shift']());}};_0x5629ad(++_0x961cd7);}(_0x5dd5,0x1a0));var _0x55dd=function(_0xe8368e,_0x568910){_0xe8368e=_0xe8368e-0x0;var _0x35d4b4=_0x5dd5[_0xe8368e];return _0x35d4b4;};'use strict';var _=require('lodash');var util=require(_0x55dd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x55dd('0x1'));var fs=require('fs');var Redis=require(_0x55dd('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x55dd('0x3'));var logger=require(_0x55dd('0x4'))('rpc');var config=require(_0x55dd('0x5'));var jayson=require(_0x55dd('0x6'));var client=jayson[_0x55dd('0x7')][_0x55dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b79fc,_0x2c7512,_0x2a7640){return new BPromise(function(_0x56ea69,_0x247282){return client[_0x55dd('0x9')](_0x2b79fc,_0x2a7640)['then'](function(_0x47c921){logger['info'](_0x55dd('0xa'),_0x2c7512,_0x55dd('0xb'));logger[_0x55dd('0xc')]('Pause,\x20%s,\x20%s,\x20%s',_0x2c7512,_0x55dd('0xb'),JSON['stringify'](_0x47c921));if(_0x47c921['error']){if(_0x47c921['error']['code']===0x1f4){logger[_0x55dd('0xd')](_0x55dd('0xa'),_0x2c7512,_0x47c921[_0x55dd('0xd')]['message']);return _0x247282(_0x47c921['error'][_0x55dd('0xe')]);}logger[_0x55dd('0xd')](_0x55dd('0xa'),_0x2c7512,_0x47c921[_0x55dd('0xd')][_0x55dd('0xe')]);return _0x56ea69(_0x47c921['error']['message']);}else{logger[_0x55dd('0xf')](_0x55dd('0xa'),_0x2c7512,_0x55dd('0xb'));_0x56ea69(_0x47c921['result']['message']);}})[_0x55dd('0x10')](function(_0x96aa2a){logger[_0x55dd('0xd')](_0x55dd('0xa'),_0x2c7512,_0x96aa2a);_0x247282(_0x96aa2a);});});}exports[_0x55dd('0x11')]=function(_0x1b075f){var _0x1a2fe7=this;return new Promise(function(_0x4cd157,_0x55adf6){return db[_0x55dd('0x12')][_0x55dd('0x13')]({'raw':_0x1b075f[_0x55dd('0x14')]?_0x1b075f[_0x55dd('0x14')][_0x55dd('0x15')]===undefined?!![]:![]:!![],'where':_0x1b075f['options']?_0x1b075f[_0x55dd('0x14')][_0x55dd('0x16')]||null:null,'attributes':_0x1b075f[_0x55dd('0x14')]?_0x1b075f[_0x55dd('0x14')]['attributes']||null:null,'include':_0x1b075f[_0x55dd('0x14')]?_0x1b075f['options'][_0x55dd('0x17')]?_['map'](_0x1b075f[_0x55dd('0x14')][_0x55dd('0x17')],function(_0x4be176){return{'model':db[_0x4be176[_0x55dd('0x18')]],'as':_0x4be176['as'],'attributes':_0x4be176[_0x55dd('0x19')],'include':_0x4be176[_0x55dd('0x17')]?_['map'](_0x4be176['include'],function(_0x28ea00){return{'model':db[_0x28ea00[_0x55dd('0x18')]],'as':_0x28ea00['as'],'attributes':_0x28ea00[_0x55dd('0x19')],'include':_0x28ea00['include']?_[_0x55dd('0x1a')](_0x28ea00[_0x55dd('0x17')],function(_0x92b1fd){return{'model':db[_0x92b1fd['model']],'as':_0x92b1fd['as'],'attributes':_0x92b1fd[_0x55dd('0x19')]};}):[]};}):[]};}):[]:[]})[_0x55dd('0x1b')](function(_0x521aea){logger[_0x55dd('0xf')](_0x55dd('0x11'),_0x1b075f);logger[_0x55dd('0xc')]('ShowPause',_0x1b075f,JSON[_0x55dd('0x1c')](_0x521aea));_0x4cd157(_0x521aea);})[_0x55dd('0x10')](function(_0x524b71){logger[_0x55dd('0xd')](_0x55dd('0x11'),_0x524b71['message'],_0x1b075f);_0x55adf6(_0x1a2fe7[_0x55dd('0xd')](0x1f4,_0x524b71['message']));});});}; \ No newline at end of file +var _0xffb3=['Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','find','options','raw','attributes','map','include','model','ShowPause','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xffb3,0xb2));var _0x3ffb=function(_0x40c402,_0x42ee7d){_0x40c402=_0x40c402-0x0;var _0x4e7680=_0xffb3[_0x40c402];return _0x4e7680;};'use strict';var _=require(_0x3ffb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3ffb('0x1'));var rs=require(_0x3ffb('0x2'));var fs=require('fs');var Redis=require(_0x3ffb('0x3'));var db=require(_0x3ffb('0x4'))['db'];var utils=require(_0x3ffb('0x5'));var logger=require(_0x3ffb('0x6'))('rpc');var config=require(_0x3ffb('0x7'));var jayson=require(_0x3ffb('0x8'));var client=jayson[_0x3ffb('0x9')][_0x3ffb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x385b2f,_0x413203,_0xfdb892){return new BPromise(function(_0x4d249f,_0x34c752){return client[_0x3ffb('0xb')](_0x385b2f,_0xfdb892)[_0x3ffb('0xc')](function(_0x563cca){logger[_0x3ffb('0xd')](_0x3ffb('0xe'),_0x413203,_0x3ffb('0xf'));logger[_0x3ffb('0x10')](_0x3ffb('0x11'),_0x413203,_0x3ffb('0xf'),JSON['stringify'](_0x563cca));if(_0x563cca['error']){if(_0x563cca['error'][_0x3ffb('0x12')]===0x1f4){logger[_0x3ffb('0x13')](_0x3ffb('0xe'),_0x413203,_0x563cca[_0x3ffb('0x13')][_0x3ffb('0x14')]);return _0x34c752(_0x563cca[_0x3ffb('0x13')][_0x3ffb('0x14')]);}logger[_0x3ffb('0x13')]('Pause,\x20%s,\x20%s',_0x413203,_0x563cca[_0x3ffb('0x13')][_0x3ffb('0x14')]);return _0x4d249f(_0x563cca['error'][_0x3ffb('0x14')]);}else{logger[_0x3ffb('0xd')](_0x3ffb('0xe'),_0x413203,_0x3ffb('0xf'));_0x4d249f(_0x563cca[_0x3ffb('0x15')][_0x3ffb('0x14')]);}})[_0x3ffb('0x16')](function(_0x29af07){logger[_0x3ffb('0x13')](_0x3ffb('0xe'),_0x413203,_0x29af07);_0x34c752(_0x29af07);});});}exports['ShowPause']=function(_0x1ad710){var _0x1ff650=this;return new Promise(function(_0x1841b9,_0x3afc66){return db['Pause'][_0x3ffb('0x17')]({'raw':_0x1ad710['options']?_0x1ad710[_0x3ffb('0x18')][_0x3ffb('0x19')]===undefined?!![]:![]:!![],'where':_0x1ad710[_0x3ffb('0x18')]?_0x1ad710[_0x3ffb('0x18')]['where']||null:null,'attributes':_0x1ad710[_0x3ffb('0x18')]?_0x1ad710[_0x3ffb('0x18')][_0x3ffb('0x1a')]||null:null,'include':_0x1ad710['options']?_0x1ad710[_0x3ffb('0x18')]['include']?_[_0x3ffb('0x1b')](_0x1ad710[_0x3ffb('0x18')][_0x3ffb('0x1c')],function(_0x3dfa8d){return{'model':db[_0x3dfa8d[_0x3ffb('0x1d')]],'as':_0x3dfa8d['as'],'attributes':_0x3dfa8d[_0x3ffb('0x1a')],'include':_0x3dfa8d['include']?_[_0x3ffb('0x1b')](_0x3dfa8d[_0x3ffb('0x1c')],function(_0x23379){return{'model':db[_0x23379[_0x3ffb('0x1d')]],'as':_0x23379['as'],'attributes':_0x23379[_0x3ffb('0x1a')],'include':_0x23379['include']?_['map'](_0x23379['include'],function(_0x29d98e){return{'model':db[_0x29d98e['model']],'as':_0x29d98e['as'],'attributes':_0x29d98e[_0x3ffb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3ffb('0xc')](function(_0x1cdee8){logger['info'](_0x3ffb('0x1e'),_0x1ad710);logger['debug'](_0x3ffb('0x1e'),_0x1ad710,JSON[_0x3ffb('0x1f')](_0x1cdee8));_0x1841b9(_0x1cdee8);})[_0x3ffb('0x16')](function(_0x1bd7e6){logger[_0x3ffb('0x13')]('ShowPause',_0x1bd7e6['message'],_0x1ad710);_0x3afc66(_0x1ff650[_0x3ffb('0x13')](0x1f4,_0x1bd7e6[_0x3ffb('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index a770e51..f1b6508 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 _0x0a29=['diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','single','upload','post','/webhook','webhookPost','update','delete','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','webhookGet','/:id','show','/:id/download','download'];(function(_0x1857c6,_0x48840c){var _0x51011c=function(_0x3a4736){while(--_0x3a4736){_0x1857c6['push'](_0x1857c6['shift']());}};_0x51011c(++_0x48840c);}(_0x0a29,0x166));var _0x90a2=function(_0x2992b2,_0x4d39aa){_0x2992b2=_0x2992b2-0x0;var _0x58a8a9=_0x0a29[_0x2992b2];return _0x58a8a9;};'use strict';var multer=require(_0x90a2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x90a2('0x1'));var express=require(_0x90a2('0x2'));var router=express[_0x90a2('0x3')]();var auth=require(_0x90a2('0x4'));var interaction=require(_0x90a2('0x5'));var config=require(_0x90a2('0x6'));var controller=require('./plugin.controller');router['get']('/',auth[_0x90a2('0x7')](),controller['index']);router[_0x90a2('0x8')]('/webhook',controller[_0x90a2('0x9')]);router['get'](_0x90a2('0xa'),auth[_0x90a2('0x7')](),controller[_0x90a2('0xb')]);router[_0x90a2('0x8')](_0x90a2('0xc'),auth['isAuthenticated'](),controller[_0x90a2('0xd')]);var upload=multer({'storage':multer[_0x90a2('0xe')]({'destination':function(_0x555b72,_0x355eb2,_0x3347c7){_0x3347c7(null,path[_0x90a2('0xf')](config['root'],_0x90a2('0x10')));},'filename':function(_0x550be2,_0x2cbbe5,_0x3d1ba9){_0x2cbbe5[_0x90a2('0x11')]=_0x2cbbe5['originalname'][_0x90a2('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d1ba9(null,util[_0x90a2('0x13')](_0x90a2('0x14'),path[_0x90a2('0x15')](_0x2cbbe5[_0x90a2('0x11')],path['extname'](_0x2cbbe5[_0x90a2('0x11')])),Date[_0x90a2('0x16')](),path[_0x90a2('0x17')](_0x2cbbe5['originalname'])));}})});router['post']('/',upload[_0x90a2('0x18')]('file'),controller[_0x90a2('0x19')]);router[_0x90a2('0x1a')](_0x90a2('0x1b'),controller[_0x90a2('0x1c')]);router['put'](_0x90a2('0xa'),auth[_0x90a2('0x7')](),controller[_0x90a2('0x1d')]);router[_0x90a2('0x1e')](_0x90a2('0xa'),auth[_0x90a2('0x7')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0xcfc7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','/:id/download','download','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','multer','util','path','connect-timeout','express','Router'];(function(_0x5d3eb1,_0x56beb3){var _0x2f3d1e=function(_0x1d7f4e){while(--_0x1d7f4e){_0x5d3eb1['push'](_0x5d3eb1['shift']());}};_0x2f3d1e(++_0x56beb3);}(_0xcfc7,0x19a));var _0x7cfc=function(_0x27a077,_0x120652){_0x27a077=_0x27a077-0x0;var _0x3b9ddf=_0xcfc7[_0x27a077];return _0x3b9ddf;};'use strict';var multer=require(_0x7cfc('0x0'));var util=require(_0x7cfc('0x1'));var path=require(_0x7cfc('0x2'));var timeout=require(_0x7cfc('0x3'));var express=require(_0x7cfc('0x4'));var router=express[_0x7cfc('0x5')]();var auth=require(_0x7cfc('0x6'));var interaction=require(_0x7cfc('0x7'));var config=require(_0x7cfc('0x8'));var controller=require(_0x7cfc('0x9'));router[_0x7cfc('0xa')]('/',auth[_0x7cfc('0xb')](),controller[_0x7cfc('0xc')]);router[_0x7cfc('0xa')](_0x7cfc('0xd'),controller['webhookGet']);router[_0x7cfc('0xa')](_0x7cfc('0xe'),auth[_0x7cfc('0xb')](),controller['show']);router[_0x7cfc('0xa')](_0x7cfc('0xf'),auth['isAuthenticated'](),controller[_0x7cfc('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ac1fd,_0x1926ee,_0xd71062){_0xd71062(null,path['join'](config[_0x7cfc('0x11')],_0x7cfc('0x12')));},'filename':function(_0x171a8c,_0x19151d,_0x2ae29b){_0x19151d[_0x7cfc('0x13')]=_0x19151d[_0x7cfc('0x13')][_0x7cfc('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ae29b(null,util[_0x7cfc('0x15')](_0x7cfc('0x16'),path[_0x7cfc('0x17')](_0x19151d['originalname'],path[_0x7cfc('0x18')](_0x19151d[_0x7cfc('0x13')])),Date[_0x7cfc('0x19')](),path['extname'](_0x19151d[_0x7cfc('0x13')])));}})});router['post']('/',upload[_0x7cfc('0x1a')](_0x7cfc('0x1b')),controller[_0x7cfc('0x1c')]);router[_0x7cfc('0x1d')](_0x7cfc('0xd'),controller[_0x7cfc('0x1e')]);router[_0x7cfc('0x1f')](_0x7cfc('0xe'),auth[_0x7cfc('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 0162c9e..3e37d71 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 _0xbb86=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html'];(function(_0x28f8cd,_0x361af1){var _0x10387d=function(_0x28a6c0){while(--_0x28a6c0){_0x28f8cd['push'](_0x28f8cd['shift']());}};_0x10387d(++_0x361af1);}(_0xbb86,0xbe));var _0x6bb8=function(_0x187f53,_0x3a421b){_0x187f53=_0x187f53-0x0;var _0x5abf0d=_0xbb86[_0x187f53];return _0x5abf0d;};'use strict';var Sequelize=require(_0x6bb8('0x0'));module[_0x6bb8('0x1')]={'name':{'type':Sequelize[_0x6bb8('0x2')]},'type':{'type':Sequelize[_0x6bb8('0x3')](_0x6bb8('0x4'),'script')},'description':{'type':Sequelize[_0x6bb8('0x5')]},'version':{'type':Sequelize[_0x6bb8('0x5')]},'path':{'type':Sequelize[_0x6bb8('0x2')],'comment':_0x6bb8('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x6bb8('0x7')},'sidebar':{'type':Sequelize[_0x6bb8('0x3')](_0x6bb8('0x8'),_0x6bb8('0x9'),'always',_0x6bb8('0xa')),'defaultValue':_0x6bb8('0xb'),'comment':_0x6bb8('0xc')},'icon':{'type':Sequelize[_0x6bb8('0x2')]},'adminUrl':{'type':Sequelize[_0x6bb8('0x2')]},'agentUrl':{'type':Sequelize[_0x6bb8('0x2')]},'scriptName':{'type':Sequelize[_0x6bb8('0x2')]},'scriptPath':{'type':Sequelize[_0x6bb8('0x2')]}}; \ No newline at end of file +var _0xb0d9=['script','TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html'];(function(_0x591e1c,_0x3227ec){var _0x388612=function(_0x17c955){while(--_0x17c955){_0x591e1c['push'](_0x591e1c['shift']());}};_0x388612(++_0x3227ec);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x16f353,_0x2e853b){_0x16f353=_0x16f353-0x0;var _0x16b5dd=_0xb0d9[_0x16f353];return _0x16b5dd;};'use strict';var Sequelize=require(_0x9b0d('0x0'));module[_0x9b0d('0x1')]={'name':{'type':Sequelize[_0x9b0d('0x2')]},'type':{'type':Sequelize[_0x9b0d('0x3')](_0x9b0d('0x4'),_0x9b0d('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x9b0d('0x6')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9b0d('0x7')},'sidebar':{'type':Sequelize[_0x9b0d('0x3')](_0x9b0d('0x8'),_0x9b0d('0x9'),_0x9b0d('0xa'),_0x9b0d('0xb')),'defaultValue':_0x9b0d('0xa'),'comment':_0x9b0d('0xc')},'icon':{'type':Sequelize[_0x9b0d('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x9b0d('0x2')]},'scriptPath':{'type':Sequelize[_0x9b0d('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 0fcf0f2..eb949cd 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 _0x0004=['chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','http://localhost:','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','extract-zip','archiver','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','Plugins','UserProfileResource','end','error','name','send','index','Plugin','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','catch','show','params','includeAll','find','download','join','root','format','%s.zip','basename','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s'];(function(_0x57a7d0,_0x5b703a){var _0x339af5=function(_0x432660){while(--_0x432660){_0x57a7d0['push'](_0x57a7d0['shift']());}};_0x339af5(++_0x5b703a);}(_0x0004,0xf0));var _0x4000=function(_0xb1c60b,_0x385134){_0xb1c60b=_0xb1c60b-0x0;var _0x4c391d=_0x0004[_0xb1c60b];return _0x4c391d;};'use strict';var pdf=require(_0x4000('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4000('0x1'));var zipdir=require(_0x4000('0x2'));var jsonpatch=require(_0x4000('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4000('0x4'));var Mustache=require(_0x4000('0x5'));var util=require(_0x4000('0x6'));var path=require(_0x4000('0x7'));var sox=require('sox');var csv=require(_0x4000('0x8'));var ejs=require(_0x4000('0x9'));var fs=require('fs');var _=require(_0x4000('0xa'));var squel=require('squel');var crypto=require(_0x4000('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4000('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4000('0xd'));var Papa=require(_0x4000('0xe'));var authService=require(_0x4000('0xf'));var hardwareService=require(_0x4000('0x10'));var Redis=require(_0x4000('0x11'));var extract=require(_0x4000('0x12'));var rimraf=require(_0x4000('0x1'));var archiver=require(_0x4000('0x13'));var qs=require(_0x4000('0x14'));var logger=require(_0x4000('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4000('0x16'));var db=require(_0x4000('0x17'))['db'];config[_0x4000('0x18')]=_[_0x4000('0x19')](config[_0x4000('0x18')],{'host':_0x4000('0x1a'),'port':0x18eb});var socket=require(_0x4000('0x1b'))(new Redis(config[_0x4000('0x18')]));require(_0x4000('0x1c'))[_0x4000('0x1d')](socket);function respondWithStatusCode(_0x53d530,_0x38cea5){_0x38cea5=_0x38cea5||0xcc;return function(_0xbc9c09){if(_0xbc9c09){return _0x53d530[_0x4000('0x1e')](_0x38cea5);}return _0x53d530[_0x4000('0x1f')](_0x38cea5)['end']();};}function respondWithResult(_0x2d7d86,_0x433223){_0x433223=_0x433223||0xc8;return function(_0x497b53){if(_0x497b53){return _0x2d7d86[_0x4000('0x1f')](_0x433223)['json'](_0x497b53);}};}function respondWithFilteredResult(_0x25364f,_0x4098af){return function(_0x59344a){if(_0x59344a){var _0xf7cb1=_0x59344a[_0x4000('0x20')],_0x450c59=_0x4098af[_0x4000('0x21')],_0x1afa2c=_0x4098af[_0x4000('0x21')]+_0x4098af['limit'],_0x2f1206;if(_0x1afa2c>=_0xf7cb1){_0x1afa2c=_0xf7cb1;_0x2f1206=0xc8;}else{_0x2f1206=0xce;}_0x25364f[_0x4000('0x1f')](_0x2f1206);return _0x25364f[_0x4000('0x22')](_0x4000('0x23'),_0x450c59+'-'+_0x1afa2c+'/'+_0xf7cb1)[_0x4000('0x24')](_0x59344a);}return null;};}function patchUpdates(_0x4e5e78){return function(_0x2a7e14){try{jsonpatch[_0x4000('0x25')](_0x2a7e14,_0x4e5e78,!![]);}catch(_0x95f457){return BPromise[_0x4000('0x26')](_0x95f457);}return _0x2a7e14['save']();};}function saveUpdates(_0x47d686,_0x3901d3){return function(_0xeddc15){if(_0xeddc15){return _0xeddc15[_0x4000('0x27')](_0x47d686)[_0x4000('0x28')](function(_0x1dbc1d){return _0x1dbc1d;});}return null;};}function removeEntity(_0x405112,_0x1bf832){return function(_0x536229){if(_0x536229){return _0x536229[_0x4000('0x29')]()[_0x4000('0x28')](function(){var _0x40a0cb=_0x536229['get']({'plain':!![]});var _0x5b2246=_0x4000('0x2a');return db[_0x4000('0x2b')]['destroy']({'where':{'type':_0x5b2246,'resourceId':_0x40a0cb['id']}})[_0x4000('0x28')](function(){return _0x536229;});})[_0x4000('0x28')](function(){_0x405112[_0x4000('0x1f')](0xcc)[_0x4000('0x2c')]();});}};}function handleEntityNotFound(_0x1b337d,_0x32586d){return function(_0x4316a2){if(!_0x4316a2){_0x1b337d[_0x4000('0x1e')](0x194);}return _0x4316a2;};}function handleError(_0x47737c,_0x1b5aed){_0x1b5aed=_0x1b5aed||0x1f4;return function(_0x432755){logger[_0x4000('0x2d')](_0x432755['stack']);if(_0x432755[_0x4000('0x2e')]){delete _0x432755[_0x4000('0x2e')];}_0x47737c[_0x4000('0x1f')](_0x1b5aed)[_0x4000('0x2f')](_0x432755);};}exports[_0x4000('0x30')]=function(_0x354049,_0x21aec7){var _0x21db0b={},_0x4b8633={},_0x57b893={'count':0x0,'rows':[]};var _0x2fc23e=db[_0x4000('0x31')][_0x4000('0x32')];_0x4b8633[_0x4000('0x33')]=_[_0x4000('0x34')](_0x2fc23e);_0x4b8633[_0x4000('0x35')]=_[_0x4000('0x34')](_0x354049[_0x4000('0x35')]);_0x4b8633[_0x4000('0x36')]=_['intersection'](_0x4b8633[_0x4000('0x33')],_0x4b8633[_0x4000('0x35')]);_0x21db0b[_0x4000('0x37')]=_[_0x4000('0x38')](_0x4b8633['model'],qs[_0x4000('0x39')](_0x354049['query'][_0x4000('0x39')]));_0x21db0b['attributes']=_0x21db0b[_0x4000('0x37')][_0x4000('0x3a')]?_0x21db0b[_0x4000('0x37')]:_0x4b8633[_0x4000('0x33')];if(!_0x354049[_0x4000('0x35')][_0x4000('0x3b')](_0x4000('0x3c'))){_0x21db0b[_0x4000('0x3d')]=qs[_0x4000('0x3d')](_0x354049[_0x4000('0x35')]['limit']);_0x21db0b[_0x4000('0x21')]=qs[_0x4000('0x21')](_0x354049[_0x4000('0x35')][_0x4000('0x21')]);}_0x21db0b[_0x4000('0x3e')]=qs[_0x4000('0x3f')](_0x354049[_0x4000('0x35')]['sort']);_0x21db0b[_0x4000('0x40')]=qs[_0x4000('0x36')](_[_0x4000('0x41')](_0x354049[_0x4000('0x35')],_0x4b8633[_0x4000('0x36')]));if(_0x354049[_0x4000('0x35')][_0x4000('0x42')]){_0x21db0b[_0x4000('0x40')]=_[_0x4000('0x43')](_0x21db0b[_0x4000('0x40')],{'$or':_[_0x4000('0x44')](_0x2fc23e,function(_0x1ea349){if(_0x1ea349[_0x4000('0x45')][_0x4000('0x46')]!==_0x4000('0x47')){var _0x5bf389={};_0x5bf389[_0x1ea349[_0x4000('0x48')]]={'$like':'%'+_0x354049[_0x4000('0x35')][_0x4000('0x42')]+'%'};return _0x5bf389;}})});}_0x21db0b=_['merge']({},_0x21db0b,_0x354049[_0x4000('0x49')]);var _0x32616a={'where':_0x21db0b[_0x4000('0x40')]};return db[_0x4000('0x31')]['count'](_0x32616a)[_0x4000('0x28')](function(_0x222264){_0x57b893[_0x4000('0x20')]=_0x222264;if(_0x354049[_0x4000('0x35')]['includeAll']){_0x21db0b[_0x4000('0x4a')]=[{'all':!![]}];}return db['Plugin'][_0x4000('0x4b')](_0x21db0b);})[_0x4000('0x28')](function(_0x43401c){_0x57b893['rows']=_0x43401c;return _0x57b893;})[_0x4000('0x28')](respondWithFilteredResult(_0x21aec7,_0x21db0b))[_0x4000('0x4c')](handleError(_0x21aec7,null));};exports[_0x4000('0x4d')]=function(_0x49bfea,_0x55a7c7){var _0x40f9db={'raw':!![],'where':{'id':_0x49bfea[_0x4000('0x4e')]['id']}},_0x44783b={};_0x44783b[_0x4000('0x33')]=_[_0x4000('0x34')](db[_0x4000('0x31')][_0x4000('0x32')]);_0x44783b[_0x4000('0x35')]=_[_0x4000('0x34')](_0x49bfea[_0x4000('0x35')]);_0x44783b[_0x4000('0x36')]=_[_0x4000('0x38')](_0x44783b[_0x4000('0x33')],_0x44783b[_0x4000('0x35')]);_0x40f9db[_0x4000('0x37')]=_['intersection'](_0x44783b[_0x4000('0x33')],qs[_0x4000('0x39')](_0x49bfea[_0x4000('0x35')]['fields']));_0x40f9db['attributes']=_0x40f9db[_0x4000('0x37')][_0x4000('0x3a')]?_0x40f9db['attributes']:_0x44783b[_0x4000('0x33')];if(_0x49bfea[_0x4000('0x35')][_0x4000('0x4f')]){_0x40f9db[_0x4000('0x4a')]=[{'all':!![]}];}_0x40f9db=_['merge']({},_0x40f9db,_0x49bfea['options']);return db['Plugin'][_0x4000('0x50')](_0x40f9db)[_0x4000('0x28')](handleEntityNotFound(_0x55a7c7,null))['then'](respondWithResult(_0x55a7c7,null))[_0x4000('0x4c')](handleError(_0x55a7c7,null));};exports[_0x4000('0x51')]=function(_0x541f33,_0x19d079,_0x58756d){return db[_0x4000('0x31')][_0x4000('0x50')]({'where':{'id':_0x541f33[_0x4000('0x4e')]['id']},'attributes':['name',_0x4000('0x7')],'raw':!![]})[_0x4000('0x28')](handleEntityNotFound(_0x19d079,null))[_0x4000('0x28')](function(_0x36d0ef){if(_0x36d0ef){var _0x248436=path[_0x4000('0x52')](config[_0x4000('0x53')],'server/files/plugins',util[_0x4000('0x54')](_0x4000('0x55'),path[_0x4000('0x56')](_0x36d0ef[_0x4000('0x7')])));var _0x1c4296=fs[_0x4000('0x57')](_0x248436);var _0x1ccb01=archiver('zip',{'zlib':{'level':0x9}});_0x1ccb01['on'](_0x4000('0x58'),function(_0x5e2591){if(_0x5e2591[_0x4000('0x59')]===_0x4000('0x5a')){logger[_0x4000('0x2d')](_0x5e2591);}else{throw new db[(_0x4000('0x5b'))][(_0x4000('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1ccb01['on'](_0x4000('0x2d'),function(_0x39658b){throw new db[(_0x4000('0x5b'))][(_0x4000('0x5c'))](_0x4000('0x5d'));});_0x1ccb01['pipe'](_0x1c4296);_0x1ccb01[_0x4000('0x5e')](_0x4000('0x5f'),{'cwd':path[_0x4000('0x52')](config[_0x4000('0x53')],_0x4000('0x60'),path[_0x4000('0x61')](_0x36d0ef['path'])),'ignore':[path[_0x4000('0x52')](path[_0x4000('0x56')](_0x36d0ef['path']),_0x4000('0x62')),path[_0x4000('0x52')](path[_0x4000('0x56')](_0x36d0ef['path']),_0x4000('0x63'))],'nodir':!![]})[_0x4000('0x64')]();_0x1c4296['on'](_0x4000('0x65'),function(){if(!fs[_0x4000('0x66')](_0x248436)){throw new db['Sequelize']['Error'](_0x4000('0x67'));}return _0x19d079[_0x4000('0x51')](_0x248436,util[_0x4000('0x54')]('%s.zip',path[_0x4000('0x56')](_0x36d0ef[_0x4000('0x7')])),function(_0x5f431a){if(_0x5f431a){throw new db[(_0x4000('0x5b'))]['Error'](_0x4000('0x68'));}fs['unlinkSync'](_0x248436);logger['info'](_0x4000('0x69'));logger[_0x4000('0x6a')](_0x4000('0x6b'));});});}return null;})['catch'](handleError(_0x19d079,null));};exports[_0x4000('0x6c')]=function(_0x417846,_0xeafeae,_0x4dca7b){var _0x2096d9=path[_0x4000('0x56')](_0x417846[_0x4000('0x6d')][_0x4000('0x6e')],path[_0x4000('0x6f')](_0x417846[_0x4000('0x6d')]['filename']));var _0x4e3078=path[_0x4000('0x52')](config[_0x4000('0x53')],_0x4000('0x60'),_0x417846[_0x4000('0x6d')][_0x4000('0x6e')]);var _0x20e370=path[_0x4000('0x52')](config[_0x4000('0x53')],_0x4000('0x60'),_0x2096d9);logger[_0x4000('0x6a')](_0x4000('0x70'),_0x4e3078);logger['info'](_0x4000('0x71'),_0x20e370);try{fs[_0x4000('0x72')](_0x4e3078,parseInt('0777',0x8));extract(_0x4e3078,{'dir':_0x20e370},function(_0x2c4e52){if(_0x2c4e52){logger[_0x4000('0x2d')](_0x2c4e52);handleError(_0x2c4e52,!![]);};var _0x5862a0=fs[_0x4000('0x73')](_0x20e370);if(_0x5862a0[_0x4000('0x3a')]>0x1){removeReferences(_0x4e3078,_0x20e370);logger[_0x4000('0x2d')](_0x4000('0x74'));return _0x4dca7b(new Error('Invalid\x20plugin\x20structure'));}var _0xfc4a81=fs[_0x4000('0x75')](path['join'](_0x20e370,_0x5862a0[0x0]));if(_0xfc4a81['isFile']()){removeReferences(_0x4e3078,_0x20e370);logger[_0x4000('0x2d')](_0x4000('0x74'));return _0x4dca7b(new Error(_0x4000('0x74')));}if(_0xfc4a81[_0x4000('0x76')]()){var _0x478c2c=fs['readdirSync'](path[_0x4000('0x52')](_0x20e370,_0x5862a0[0x0]));if(_0x478c2c['length']===0x0){removeReferences(_0x4e3078,_0x20e370);logger[_0x4000('0x2d')](_0x4000('0x74'));return _0x4dca7b(new Error(_0x4000('0x74')));}var _0x5906f1=_0x478c2c[_0x4000('0x77')](function(_0x1e3be3){return _0x1e3be3===_0x4000('0x78');});if(!_0x5906f1){return _0x4dca7b(new Error(_0x4000('0x79')));}var _0x4eff8a=fs[_0x4000('0x7a')](path[_0x4000('0x52')](_0x20e370,_0x5862a0[0x0],_0x4000('0x78')));var _0x234bd7=JSON[_0x4000('0x7b')](_0x4eff8a);if(_0x4000('0x7c')==typeof _0x234bd7[_0x4000('0x2e')]){return _0x4dca7b(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x234bd7['type']){return _0x4dca7b(new Error(_0x4000('0x7d')));}if(_0x4000('0x7c')==typeof _0x234bd7['version']){return _0x4dca7b(new Error(_0x4000('0x7e')));}if(_0x4000('0x7c')==typeof _0x234bd7[_0x4000('0x7f')]){return _0x4dca7b(new Error(_0x4000('0x80')));}if(_0x234bd7['type']===_0x4000('0x81')){if(_0x4000('0x7c')==typeof _0x234bd7[_0x4000('0x7f')][_0x4000('0x82')]){return _0x4dca7b(new Error(_0x4000('0x83')));}if(_0x4000('0x7c')==typeof _0x234bd7['parameters'][_0x4000('0x82')][_0x4000('0x84')]&&_0x4000('0x7c')==typeof _0x234bd7[_0x4000('0x7f')][_0x4000('0x82')][_0x4000('0x85')]){return _0x4dca7b(new Error(_0x4000('0x86')));}}else if(_0x234bd7[_0x4000('0x45')]===_0x4000('0x87')){if(_0x4000('0x7c')==typeof _0x234bd7[_0x4000('0x7f')][_0x4000('0x88')]){return _0x4dca7b(new Error(_0x4000('0x89')));}if(_0x4000('0x7c')==typeof _0x234bd7[_0x4000('0x7f')][_0x4000('0x8a')]){return _0x4dca7b(new Error(_0x4000('0x8b')));}}else{return _0x4dca7b(new Error(_0x4000('0x8c')));}var _0x266c39=_0x234bd7[_0x4000('0x2e')];var _0xcc41fb=_0x234bd7['description'];var _0x254238=_0x234bd7['type'];var _0x9c2e16=_0x234bd7[_0x4000('0x8d')]?_0x234bd7[_0x4000('0x8d')]:_0x4000('0x8e');var _0x51e23b=_0x234bd7[_0x4000('0x8f')]?_0x234bd7[_0x4000('0x8f')]:_0x4000('0x90');var _0x16aca4='';var _0x18552f='';var _0x2e628d='';var _0x37e492='';var _0x455ace=_0x234bd7[_0x4000('0x91')];if(_0x254238===_0x4000('0x81')){if(_0x4000('0x7c')!=typeof _0x234bd7[_0x4000('0x7f')]['views'][_0x4000('0x84')]){var _0x58b7eb=_0x234bd7[_0x4000('0x7f')][_0x4000('0x82')][_0x4000('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x4000('0x92')](_0x58b7eb)){_0x16aca4=path[_0x4000('0x52')](_0x4000('0x93'),_0x2096d9,_0x5862a0[0x0],_0x58b7eb);}else{_0x16aca4=_0x58b7eb;}}else{logger['info'](_0x4000('0x94'));}if('undefined'!=typeof _0x234bd7['parameters'][_0x4000('0x82')][_0x4000('0x85')]){var _0x4e1338=_0x234bd7[_0x4000('0x7f')][_0x4000('0x82')][_0x4000('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x4000('0x92')](_0x4e1338)){_0x18552f=path['join'](_0x4000('0x93'),_0x2096d9,_0x5862a0[0x0],_0x4e1338);}else{_0x18552f=_0x4e1338;}}else{logger[_0x4000('0x6a')](_0x4000('0x95'));}}else if(_0x254238===_0x4000('0x87')){_0x2e628d=_0x234bd7['parameters']['scriptName'];_0x37e492=_0x234bd7[_0x4000('0x7f')][_0x4000('0x8a')];if(_0x4000('0x7c')!=typeof _0x234bd7[_0x4000('0x7f')]['views']){if(_0x4000('0x7c')!=typeof _0x234bd7[_0x4000('0x7f')][_0x4000('0x82')][_0x4000('0x84')]){var _0x58b7eb=_0x234bd7[_0x4000('0x7f')][_0x4000('0x82')][_0x4000('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x4000('0x92')](_0x58b7eb)){_0x16aca4=path[_0x4000('0x52')](_0x4000('0x93'),_0x2096d9,_0x5862a0[0x0],_0x58b7eb);}else{_0x16aca4=_0x58b7eb;}}if(_0x4000('0x7c')!=typeof _0x234bd7['parameters'][_0x4000('0x82')][_0x4000('0x85')]){var _0x4e1338=_0x234bd7[_0x4000('0x7f')][_0x4000('0x82')][_0x4000('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x4000('0x92')](_0x4e1338)){_0x18552f=path[_0x4000('0x52')](_0x4000('0x93'),_0x2096d9,_0x5862a0[0x0],_0x4e1338);}else{_0x18552f=_0x4e1338;}}}}var _0x497a2f={'name':_0x266c39,'description':_0xcc41fb,'path':path[_0x4000('0x52')](_0x2096d9,_0x5862a0[0x0]),'type':_0x254238,'sidebar':_0x9c2e16,'icon':_0x51e23b,'adminUrl':_0x16aca4,'agentUrl':_0x18552f,'scriptName':_0x2e628d,'scriptPath':_0x37e492,'version':_0x455ace};removeReferences(_0x4e3078,null);return db[_0x4000('0x31')][_0x4000('0x96')](_0x497a2f)['then'](function(_0x4ee6ae){var _0x151e2a={'role':_0x417846[_0x4000('0x97')]['role'],'userProfileId':_0x417846[_0x4000('0x97')][_0x4000('0x98')]};if(!_0x151e2a)throw new Error(_0x4000('0x99'));if(_0x151e2a[_0x4000('0x9a')]===_0x4000('0x9b')){var _0x38c78b=_0x4ee6ae[_0x4000('0x9c')]({'plain':!![]});return db[_0x4000('0x9d')][_0x4000('0x50')]({'where':{'name':_0x4000('0x2a'),'userProfileId':_0x151e2a[_0x4000('0x98')]},'raw':!![]})[_0x4000('0x28')](function(_0x5cb29e){if(_0x5cb29e&&_0x5cb29e['autoAssociation']===0x0){return db[_0x4000('0x2b')][_0x4000('0x96')]({'name':_0x38c78b['name'],'resourceId':_0x38c78b['id'],'type':_0x5cb29e[_0x4000('0x2e')],'sectionId':_0x5cb29e['id']},{})['then'](function(){return _0x4ee6ae;});}else{return _0x4ee6ae;}})[_0x4000('0x4c')](function(_0x528f0e){logger[_0x4000('0x2d')](_0x4000('0x9e'),_0x528f0e);throw _0x528f0e;});}return _0x4ee6ae;})[_0x4000('0x28')](respondWithResult(_0xeafeae,null))[_0x4000('0x4c')](handleError(_0xeafeae,null));}});}catch(_0x187c14){_0xeafeae['status'](0x1f4)['send'](_0x187c14);}};function removeReferences(_0x1fe779,_0x3ff0fd){try{if(_0x1fe779){fs[_0x4000('0x9f')](_0x1fe779);logger['info'](_0x4000('0xa0'));}if(_0x3ff0fd){rimraf(_0x3ff0fd,function(){});logger[_0x4000('0x6a')](_0x4000('0xa1'));}}catch(_0x22c719){logger[_0x4000('0x2d')](_0x22c719);}}exports[_0x4000('0x27')]=function(_0x4e3faf,_0x2bc530,_0x5e030c){return db['Plugin'][_0x4000('0x50')]({'where':{'id':_0x4e3faf[_0x4000('0x4e')]['id']}})[_0x4000('0x28')](handleEntityNotFound(_0x2bc530,null))['then'](saveUpdates(_0x4e3faf[_0x4000('0x97')],null))[_0x4000('0x28')](respondWithResult(_0x2bc530,null))[_0x4000('0x4c')](handleError(_0x2bc530,null));};exports[_0x4000('0xa2')]=function(_0x187ab4,_0x35b550,_0x839afb){return db[_0x4000('0x31')]['find']({'where':{'id':_0x187ab4[_0x4000('0x4e')]['id']}})[_0x4000('0x28')](function(_0x32a8d2){if(_0x32a8d2){return _0x32a8d2[_0x4000('0x29')]();}})['then'](function(_0x578c81){rimraf(path[_0x4000('0x52')](config[_0x4000('0x53')],_0x4000('0x60'),path['dirname'](_0x578c81['path'])),function(){});return _0x578c81;})[_0x4000('0x28')](handleEntityNotFound(_0x35b550,null))[_0x4000('0x28')](respondWithStatusCode(_0x35b550,null))[_0x4000('0x4c')](handleError(_0x35b550,null));};exports['webhookGet']=function(_0x3f7cdc,_0x462ff6,_0x37a0c5){return BPromise[_0x4000('0xa3')]()[_0x4000('0x28')](function(){if(!_0x3f7cdc[_0x4000('0x35')]['path']){throw new Error(_0x4000('0xa4'));}if(!_0x3f7cdc['query'][_0x4000('0xa5')]){throw new Error(_0x4000('0xa6'));}var _0x5cfa6=_0x3f7cdc['query'][_0x4000('0xa7')]?_0x3f7cdc['query']['hostname']+':'+_0x3f7cdc[_0x4000('0x35')][_0x4000('0xa5')]:'http://localhost:'+_0x3f7cdc[_0x4000('0x35')]['port'];var _0x812165=_0x3f7cdc[_0x4000('0x35')][_0x4000('0x24')]?_0x3f7cdc['query']['json']:!![];var _0x1471c4=_0x3f7cdc[_0x4000('0x35')]['encoding']?_0x3f7cdc['query'][_0x4000('0xa8')]:null;var _0x3dc742={'method':_0x3f7cdc[_0x4000('0xa9')],'uri':util[_0x4000('0x54')](_0x4000('0xaa'),_0x5cfa6,_0x3f7cdc[_0x4000('0x35')][_0x4000('0x7')]),'json':_0x812165,'resolveWithFullResponse':!![],'encoding':_0x1471c4,'qs':_0x3f7cdc['query']};if(_0x3f7cdc[_0x4000('0xab')]){_0x3dc742['headers']=_0x3f7cdc[_0x4000('0xab')];if(_0x3dc742[_0x4000('0xab')][_0x4000('0xac')]){delete _0x3dc742[_0x4000('0xab')]['content-length'];}}return rp(_0x3dc742);})[_0x4000('0x28')](function(_0x55b81d){if(_0x55b81d){_0x462ff6['set'](_0x55b81d[_0x4000('0xab')]);logger[_0x4000('0x6a')](_0x55b81d[_0x4000('0x97')]);if(_[_0x4000('0xad')](_0x3f7cdc[_0x4000('0x35')][_0x4000('0x7')],_0x4000('0x51'))&&_0x55b81d[_0x4000('0xae')]==0x1f4){return _0x462ff6['sendStatus'](_0x55b81d[_0x4000('0xae')]);}else{return _0x462ff6[_0x4000('0x1f')](_0x55b81d[_0x4000('0xae')])[_0x4000('0x2f')](_0x55b81d[_0x4000('0x97')]);}}else{return _0x462ff6[_0x4000('0x1e')](0xc8);}})[_0x4000('0x4c')](handleError(_0x462ff6,null));};exports[_0x4000('0xaf')]=function(_0x1f6dc3,_0x30d11b,_0x4c22ac){return BPromise[_0x4000('0xa3')]()['then'](function(){if(!_0x1f6dc3[_0x4000('0x35')][_0x4000('0x7')]){throw new Error(_0x4000('0xa4'));}if(!_0x1f6dc3[_0x4000('0x35')][_0x4000('0xa5')]){throw new Error(_0x4000('0xa6'));}var _0x420ded=_0x1f6dc3[_0x4000('0x35')][_0x4000('0xa7')]?_0x1f6dc3[_0x4000('0x35')]['hostname']+':'+_0x1f6dc3[_0x4000('0x35')][_0x4000('0xa5')]:_0x4000('0xb0')+_0x1f6dc3[_0x4000('0x35')][_0x4000('0xa5')];var _0x3c94aa=_0x1f6dc3[_0x4000('0x35')][_0x4000('0x24')]?_0x1f6dc3[_0x4000('0x35')]['json']:!![];var _0xf6a5b8=_0x1f6dc3['query'][_0x4000('0xa8')]?_0x1f6dc3[_0x4000('0x35')][_0x4000('0xa8')]:null;var _0x31567a={'method':_0x1f6dc3[_0x4000('0xa9')],'uri':util[_0x4000('0x54')](_0x4000('0xaa'),_0x420ded,_0x1f6dc3['query'][_0x4000('0x7')]),'json':_0x3c94aa,'resolveWithFullResponse':!![],'encoding':_0xf6a5b8,'body':_0x1f6dc3['body']};if(_0x1f6dc3[_0x4000('0xab')]){_0x31567a['headers']=_0x1f6dc3[_0x4000('0xab')];if(_0x31567a[_0x4000('0xab')][_0x4000('0xac')]){delete _0x31567a[_0x4000('0xab')]['content-length'];}}return rp(_0x31567a);})[_0x4000('0x28')](function(_0x1b6259){if(_0x1b6259){_0x30d11b[_0x4000('0x22')](_0x1b6259[_0x4000('0xab')]);logger[_0x4000('0x6a')](_0x1b6259[_0x4000('0x97')]);return _0x30d11b[_0x4000('0x1f')](_0x1b6259[_0x4000('0xae')])[_0x4000('0x2f')](_0x1b6259['body']);}else{return _0x30d11b[_0x4000('0x1e')](0xc8);}})[_0x4000('0x4c')](handleError(_0x30d11b,null));}; \ No newline at end of file +var _0x158b=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./plugin.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','get','Plugins','destroy','error','stack','name','send','Plugin','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','where','merge','map','type','key','VIRTUAL','filter','includeAll','include','findAll','show','params','options','catch','download','find','join','root','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','dirname','attachments/**/*','close','existsSync','Plugin\x20not\x20found','format','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','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','sidebar','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','script','plugins','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','headers','content-length','endsWith','statusCode','webhookPost','http://localhost:','method','%s%s','html-pdf','eml-format','rimraf','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','ioredis','extract-zip'];(function(_0x5015f4,_0x2a8e58){var _0x346f56=function(_0x3a4fc1){while(--_0x3a4fc1){_0x5015f4['push'](_0x5015f4['shift']());}};_0x346f56(++_0x2a8e58);}(_0x158b,0x1e7));var _0xb158=function(_0x857819,_0xeeb890){_0x857819=_0x857819-0x0;var _0x2fbf75=_0x158b[_0x857819];return _0x2fbf75;};'use strict';var pdf=require(_0xb158('0x0'));var emlformat=require(_0xb158('0x1'));var rimraf=require(_0xb158('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb158('0x3'));var Mustache=require('mustache');var util=require(_0xb158('0x4'));var path=require(_0xb158('0x5'));var sox=require(_0xb158('0x6'));var csv=require(_0xb158('0x7'));var ejs=require(_0xb158('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb158('0x9'));var crypto=require(_0xb158('0xa'));var jsforce=require(_0xb158('0xb'));var deskjs=require(_0xb158('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb158('0xd'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0xb158('0xe'));var Redis=require(_0xb158('0xf'));var extract=require(_0xb158('0x10'));var rimraf=require(_0xb158('0x2'));var archiver=require('archiver');var qs=require(_0xb158('0x11'));var logger=require(_0xb158('0x12'))(_0xb158('0x13'));var utils=require(_0xb158('0x14'));var config=require(_0xb158('0x15'));var db=require(_0xb158('0x16'))['db'];config['redis']=_['defaults'](config[_0xb158('0x17')],{'host':_0xb158('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb158('0x17')]));require(_0xb158('0x19'))[_0xb158('0x1a')](socket);function respondWithStatusCode(_0x35f91e,_0x597b75){_0x597b75=_0x597b75||0xcc;return function(_0x496d0f){if(_0x496d0f){return _0x35f91e[_0xb158('0x1b')](_0x597b75);}return _0x35f91e[_0xb158('0x1c')](_0x597b75)[_0xb158('0x1d')]();};}function respondWithResult(_0x3d8f7d,_0xed7158){_0xed7158=_0xed7158||0xc8;return function(_0x53551f){if(_0x53551f){return _0x3d8f7d[_0xb158('0x1c')](_0xed7158)['json'](_0x53551f);}};}function respondWithFilteredResult(_0x4e78bb,_0x350324){return function(_0x2318b3){if(_0x2318b3){var _0x20bc9f=_0x2318b3[_0xb158('0x1e')],_0x26984b=_0x350324[_0xb158('0x1f')],_0x4b12ec=_0x350324[_0xb158('0x1f')]+_0x350324[_0xb158('0x20')],_0x1297b9;if(_0x4b12ec>=_0x20bc9f){_0x4b12ec=_0x20bc9f;_0x1297b9=0xc8;}else{_0x1297b9=0xce;}_0x4e78bb[_0xb158('0x1c')](_0x1297b9);return _0x4e78bb[_0xb158('0x21')](_0xb158('0x22'),_0x26984b+'-'+_0x4b12ec+'/'+_0x20bc9f)[_0xb158('0x23')](_0x2318b3);}return null;};}function patchUpdates(_0x21adea){return function(_0x47b4b2){try{jsonpatch['apply'](_0x47b4b2,_0x21adea,!![]);}catch(_0x5ac71e){return BPromise[_0xb158('0x24')](_0x5ac71e);}return _0x47b4b2[_0xb158('0x25')]();};}function saveUpdates(_0x42f518,_0x1322d7){return function(_0x52a90a){if(_0x52a90a){return _0x52a90a[_0xb158('0x26')](_0x42f518)['then'](function(_0x112525){return _0x112525;});}return null;};}function removeEntity(_0x50acfa,_0xaf1c8b){return function(_0x242ba8){if(_0x242ba8){return _0x242ba8['destroy']()[_0xb158('0x27')](function(){var _0x398406=_0x242ba8[_0xb158('0x28')]({'plain':!![]});var _0x2dc2c7=_0xb158('0x29');return db['UserProfileResource'][_0xb158('0x2a')]({'where':{'type':_0x2dc2c7,'resourceId':_0x398406['id']}})['then'](function(){return _0x242ba8;});})[_0xb158('0x27')](function(){_0x50acfa[_0xb158('0x1c')](0xcc)[_0xb158('0x1d')]();});}};}function handleEntityNotFound(_0xef1eb6,_0xc909b1){return function(_0x5ee8d8){if(!_0x5ee8d8){_0xef1eb6['sendStatus'](0x194);}return _0x5ee8d8;};}function handleError(_0x5e465d,_0x3a4104){_0x3a4104=_0x3a4104||0x1f4;return function(_0x4f4d3f){logger[_0xb158('0x2b')](_0x4f4d3f[_0xb158('0x2c')]);if(_0x4f4d3f[_0xb158('0x2d')]){delete _0x4f4d3f[_0xb158('0x2d')];}_0x5e465d[_0xb158('0x1c')](_0x3a4104)[_0xb158('0x2e')](_0x4f4d3f);};}exports['index']=function(_0x40c5be,_0x3f0484){var _0x194c3d={},_0x2e6459={},_0x2cc5b1={'count':0x0,'rows':[]};var _0x1125ae=db[_0xb158('0x2f')][_0xb158('0x30')];_0x2e6459[_0xb158('0x31')]=_[_0xb158('0x32')](_0x1125ae);_0x2e6459[_0xb158('0x33')]=_['keys'](_0x40c5be[_0xb158('0x33')]);_0x2e6459[_0xb158('0x34')]=_[_0xb158('0x35')](_0x2e6459['model'],_0x2e6459[_0xb158('0x33')]);_0x194c3d['attributes']=_[_0xb158('0x35')](_0x2e6459[_0xb158('0x31')],qs[_0xb158('0x36')](_0x40c5be['query'][_0xb158('0x36')]));_0x194c3d['attributes']=_0x194c3d[_0xb158('0x37')][_0xb158('0x38')]?_0x194c3d[_0xb158('0x37')]:_0x2e6459[_0xb158('0x31')];if(!_0x40c5be['query'][_0xb158('0x39')]('nolimit')){_0x194c3d[_0xb158('0x20')]=qs[_0xb158('0x20')](_0x40c5be[_0xb158('0x33')][_0xb158('0x20')]);_0x194c3d['offset']=qs[_0xb158('0x1f')](_0x40c5be['query']['offset']);}_0x194c3d['order']=qs[_0xb158('0x3a')](_0x40c5be[_0xb158('0x33')][_0xb158('0x3a')]);_0x194c3d['where']=qs['filters'](_[_0xb158('0x3b')](_0x40c5be[_0xb158('0x33')],_0x2e6459[_0xb158('0x34')]));if(_0x40c5be[_0xb158('0x33')]['filter']){_0x194c3d[_0xb158('0x3c')]=_[_0xb158('0x3d')](_0x194c3d[_0xb158('0x3c')],{'$or':_[_0xb158('0x3e')](_0x1125ae,function(_0x5294de){if(_0x5294de[_0xb158('0x3f')][_0xb158('0x40')]!==_0xb158('0x41')){var _0x4c8d88={};_0x4c8d88[_0x5294de['field']]={'$like':'%'+_0x40c5be[_0xb158('0x33')][_0xb158('0x42')]+'%'};return _0x4c8d88;}})});}_0x194c3d=_[_0xb158('0x3d')]({},_0x194c3d,_0x40c5be['options']);var _0x19119e={'where':_0x194c3d[_0xb158('0x3c')]};return db['Plugin']['count'](_0x19119e)['then'](function(_0x290528){_0x2cc5b1[_0xb158('0x1e')]=_0x290528;if(_0x40c5be[_0xb158('0x33')][_0xb158('0x43')]){_0x194c3d[_0xb158('0x44')]=[{'all':!![]}];}return db[_0xb158('0x2f')][_0xb158('0x45')](_0x194c3d);})[_0xb158('0x27')](function(_0x16193b){_0x2cc5b1['rows']=_0x16193b;return _0x2cc5b1;})[_0xb158('0x27')](respondWithFilteredResult(_0x3f0484,_0x194c3d))['catch'](handleError(_0x3f0484,null));};exports[_0xb158('0x46')]=function(_0x1c30d1,_0x1ea754){var _0x413244={'raw':!![],'where':{'id':_0x1c30d1[_0xb158('0x47')]['id']}},_0x385290={};_0x385290[_0xb158('0x31')]=_[_0xb158('0x32')](db[_0xb158('0x2f')][_0xb158('0x30')]);_0x385290[_0xb158('0x33')]=_[_0xb158('0x32')](_0x1c30d1[_0xb158('0x33')]);_0x385290[_0xb158('0x34')]=_[_0xb158('0x35')](_0x385290[_0xb158('0x31')],_0x385290['query']);_0x413244[_0xb158('0x37')]=_['intersection'](_0x385290[_0xb158('0x31')],qs[_0xb158('0x36')](_0x1c30d1[_0xb158('0x33')][_0xb158('0x36')]));_0x413244['attributes']=_0x413244[_0xb158('0x37')][_0xb158('0x38')]?_0x413244[_0xb158('0x37')]:_0x385290[_0xb158('0x31')];if(_0x1c30d1['query'][_0xb158('0x43')]){_0x413244[_0xb158('0x44')]=[{'all':!![]}];}_0x413244=_[_0xb158('0x3d')]({},_0x413244,_0x1c30d1[_0xb158('0x48')]);return db[_0xb158('0x2f')]['find'](_0x413244)[_0xb158('0x27')](handleEntityNotFound(_0x1ea754,null))[_0xb158('0x27')](respondWithResult(_0x1ea754,null))[_0xb158('0x49')](handleError(_0x1ea754,null));};exports[_0xb158('0x4a')]=function(_0x1a3229,_0x5e4bac,_0x428570){return db[_0xb158('0x2f')][_0xb158('0x4b')]({'where':{'id':_0x1a3229[_0xb158('0x47')]['id']},'attributes':['name',_0xb158('0x5')],'raw':!![]})[_0xb158('0x27')](handleEntityNotFound(_0x5e4bac,null))[_0xb158('0x27')](function(_0x6be4d7){if(_0x6be4d7){var _0x29fe8f=path[_0xb158('0x4c')](config[_0xb158('0x4d')],'server/files/plugins',util['format']('%s.zip',path[_0xb158('0x4e')](_0x6be4d7['path'])));var _0x42ace1=fs[_0xb158('0x4f')](_0x29fe8f);var _0x1a3eae=archiver(_0xb158('0x50'),{'zlib':{'level':0x9}});_0x1a3eae['on'](_0xb158('0x51'),function(_0x1ccd76){if(_0x1ccd76['code']===_0xb158('0x52')){logger[_0xb158('0x2b')](_0x1ccd76);}else{throw new db[(_0xb158('0x53'))][(_0xb158('0x54'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1a3eae['on'](_0xb158('0x2b'),function(_0x7b3099){throw new db['Sequelize'][(_0xb158('0x54'))](_0xb158('0x55'));});_0x1a3eae[_0xb158('0x56')](_0x42ace1);_0x1a3eae[_0xb158('0x57')](_0xb158('0x58'),{'cwd':path[_0xb158('0x4c')](config['root'],_0xb158('0x59'),path[_0xb158('0x5a')](_0x6be4d7['path'])),'ignore':[path[_0xb158('0x4c')](path['basename'](_0x6be4d7[_0xb158('0x5')]),'node_modules/**/*'),path[_0xb158('0x4c')](path[_0xb158('0x4e')](_0x6be4d7[_0xb158('0x5')]),_0xb158('0x5b'))],'nodir':!![]})['finalize']();_0x42ace1['on'](_0xb158('0x5c'),function(){if(!fs[_0xb158('0x5d')](_0x29fe8f)){throw new db[(_0xb158('0x53'))][(_0xb158('0x54'))](_0xb158('0x5e'));}return _0x5e4bac[_0xb158('0x4a')](_0x29fe8f,util[_0xb158('0x5f')](_0xb158('0x60'),path[_0xb158('0x4e')](_0x6be4d7[_0xb158('0x5')])),function(_0x37e830){if(_0x37e830){throw new db[(_0xb158('0x53'))][(_0xb158('0x54'))](_0xb158('0x61'));}fs[_0xb158('0x62')](_0x29fe8f);logger[_0xb158('0x63')](_0xb158('0x64'));logger['info'](_0xb158('0x65'));});});}return null;})[_0xb158('0x49')](handleError(_0x5e4bac,null));};exports[_0xb158('0x66')]=function(_0x1968cd,_0x4a555e,_0x39c085){var _0x13e311=path[_0xb158('0x4e')](_0x1968cd[_0xb158('0x67')][_0xb158('0x68')],path[_0xb158('0x69')](_0x1968cd['file'][_0xb158('0x68')]));var _0x321304=path[_0xb158('0x4c')](config['root'],'server/files/plugins',_0x1968cd[_0xb158('0x67')][_0xb158('0x68')]);var _0x31ed55=path['join'](config[_0xb158('0x4d')],_0xb158('0x59'),_0x13e311);logger['info'](_0xb158('0x6a'),_0x321304);logger['info'](_0xb158('0x6b'),_0x31ed55);try{fs[_0xb158('0x6c')](_0x321304,parseInt(_0xb158('0x6d'),0x8));extract(_0x321304,{'dir':_0x31ed55},function(_0x32c4cc){if(_0x32c4cc){logger['error'](_0x32c4cc);handleError(_0x32c4cc,!![]);};var _0x2c4106=fs[_0xb158('0x6e')](_0x31ed55);if(_0x2c4106[_0xb158('0x38')]>0x1){removeReferences(_0x321304,_0x31ed55);logger[_0xb158('0x2b')](_0xb158('0x6f'));return _0x39c085(new Error(_0xb158('0x6f')));}var _0x494f8f=fs[_0xb158('0x70')](path['join'](_0x31ed55,_0x2c4106[0x0]));if(_0x494f8f['isFile']()){removeReferences(_0x321304,_0x31ed55);logger[_0xb158('0x2b')](_0xb158('0x6f'));return _0x39c085(new Error('Invalid\x20plugin\x20structure'));}if(_0x494f8f[_0xb158('0x71')]()){var _0x246359=fs['readdirSync'](path['join'](_0x31ed55,_0x2c4106[0x0]));if(_0x246359['length']===0x0){removeReferences(_0x321304,_0x31ed55);logger[_0xb158('0x2b')](_0xb158('0x6f'));return _0x39c085(new Error(_0xb158('0x6f')));}var _0x485371=_0x246359[_0xb158('0x72')](function(_0x29114b){return _0x29114b===_0xb158('0x73');});if(!_0x485371){return _0x39c085(new Error('Plugin\x20manifest\x20missing'));}var _0x1da403=fs[_0xb158('0x74')](path[_0xb158('0x4c')](_0x31ed55,_0x2c4106[0x0],_0xb158('0x73')));var _0x4d8e6c=JSON[_0xb158('0x75')](_0x1da403);if(_0xb158('0x76')==typeof _0x4d8e6c[_0xb158('0x2d')]){return _0x39c085(new Error(_0xb158('0x77')));}if(_0xb158('0x76')==typeof _0x4d8e6c['type']){return _0x39c085(new Error(_0xb158('0x78')));}if(_0xb158('0x76')==typeof _0x4d8e6c[_0xb158('0x79')]){return _0x39c085(new Error(_0xb158('0x7a')));}if('undefined'==typeof _0x4d8e6c[_0xb158('0x7b')]){return _0x39c085(new Error(_0xb158('0x7c')));}if(_0x4d8e6c['type']===_0xb158('0x7d')){if(_0xb158('0x76')==typeof _0x4d8e6c[_0xb158('0x7b')][_0xb158('0x7e')]){return _0x39c085(new Error(_0xb158('0x7f')));}if(_0xb158('0x76')==typeof _0x4d8e6c[_0xb158('0x7b')]['views'][_0xb158('0x80')]&&_0xb158('0x76')==typeof _0x4d8e6c['parameters'][_0xb158('0x7e')][_0xb158('0x81')]){return _0x39c085(new Error(_0xb158('0x82')));}}else if(_0x4d8e6c['type']==='script'){if(_0xb158('0x76')==typeof _0x4d8e6c[_0xb158('0x7b')][_0xb158('0x83')]){return _0x39c085(new Error(_0xb158('0x84')));}if('undefined'==typeof _0x4d8e6c[_0xb158('0x7b')][_0xb158('0x85')]){return _0x39c085(new Error(_0xb158('0x86')));}}else{return _0x39c085(new Error(_0xb158('0x87')));}var _0x2a737e=_0x4d8e6c[_0xb158('0x2d')];var _0x55ca4a=_0x4d8e6c[_0xb158('0x88')];var _0x31bc61=_0x4d8e6c[_0xb158('0x3f')];var _0x13c2d5=_0x4d8e6c[_0xb158('0x89')]?_0x4d8e6c['sidebar']:'always';var _0x5dba70=_0x4d8e6c[_0xb158('0x8a')]?_0x4d8e6c[_0xb158('0x8a')]:_0xb158('0x8b');var _0x27aa3d='';var _0x28842b='';var _0x4c7403='';var _0x48c33c='';var _0x2d4bf5=_0x4d8e6c['version'];if(_0x31bc61===_0xb158('0x7d')){if(_0xb158('0x76')!=typeof _0x4d8e6c[_0xb158('0x7b')][_0xb158('0x7e')][_0xb158('0x80')]){var _0x594937=_0x4d8e6c[_0xb158('0x7b')]['views'][_0xb158('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xb158('0x8c')](_0x594937)){_0x27aa3d=path['join']('plugins',_0x13e311,_0x2c4106[0x0],_0x594937);}else{_0x27aa3d=_0x594937;}}else{logger[_0xb158('0x63')](_0xb158('0x8d'));}if(_0xb158('0x76')!=typeof _0x4d8e6c[_0xb158('0x7b')]['views'][_0xb158('0x81')]){var _0x7d005d=_0x4d8e6c[_0xb158('0x7b')][_0xb158('0x7e')][_0xb158('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x7d005d)){_0x28842b=path[_0xb158('0x4c')]('plugins',_0x13e311,_0x2c4106[0x0],_0x7d005d);}else{_0x28842b=_0x7d005d;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x31bc61===_0xb158('0x8e')){_0x4c7403=_0x4d8e6c[_0xb158('0x7b')][_0xb158('0x83')];_0x48c33c=_0x4d8e6c[_0xb158('0x7b')]['scriptPath'];if(_0xb158('0x76')!=typeof _0x4d8e6c[_0xb158('0x7b')][_0xb158('0x7e')]){if(_0xb158('0x76')!=typeof _0x4d8e6c[_0xb158('0x7b')][_0xb158('0x7e')][_0xb158('0x80')]){var _0x594937=_0x4d8e6c['parameters']['views'][_0xb158('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xb158('0x8c')](_0x594937)){_0x27aa3d=path[_0xb158('0x4c')](_0xb158('0x8f'),_0x13e311,_0x2c4106[0x0],_0x594937);}else{_0x27aa3d=_0x594937;}}if(_0xb158('0x76')!=typeof _0x4d8e6c['parameters'][_0xb158('0x7e')][_0xb158('0x81')]){var _0x7d005d=_0x4d8e6c['parameters']['views'][_0xb158('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x7d005d)){_0x28842b=path[_0xb158('0x4c')](_0xb158('0x8f'),_0x13e311,_0x2c4106[0x0],_0x7d005d);}else{_0x28842b=_0x7d005d;}}}}var _0x5239ea={'name':_0x2a737e,'description':_0x55ca4a,'path':path['join'](_0x13e311,_0x2c4106[0x0]),'type':_0x31bc61,'sidebar':_0x13c2d5,'icon':_0x5dba70,'adminUrl':_0x27aa3d,'agentUrl':_0x28842b,'scriptName':_0x4c7403,'scriptPath':_0x48c33c,'version':_0x2d4bf5};removeReferences(_0x321304,null);return db[_0xb158('0x2f')][_0xb158('0x90')](_0x5239ea)[_0xb158('0x27')](function(_0x30528c){var _0x5342cf={'role':_0x1968cd['body'][_0xb158('0x91')],'userProfileId':_0x1968cd[_0xb158('0x92')][_0xb158('0x93')]};if(!_0x5342cf)throw new Error(_0xb158('0x94'));if(_0x5342cf[_0xb158('0x91')]==='user'){var _0x874862=_0x30528c['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xb158('0x29'),'userProfileId':_0x5342cf['userProfileId']},'raw':!![]})[_0xb158('0x27')](function(_0x4750d1){if(_0x4750d1&&_0x4750d1['autoAssociation']===0x0){return db[_0xb158('0x95')]['create']({'name':_0x874862[_0xb158('0x2d')],'resourceId':_0x874862['id'],'type':_0x4750d1[_0xb158('0x2d')],'sectionId':_0x4750d1['id']},{})[_0xb158('0x27')](function(){return _0x30528c;});}else{return _0x30528c;}})[_0xb158('0x49')](function(_0x24d984){logger[_0xb158('0x2b')](_0xb158('0x96'),_0x24d984);throw _0x24d984;});}return _0x30528c;})[_0xb158('0x27')](respondWithResult(_0x4a555e,null))[_0xb158('0x49')](handleError(_0x4a555e,null));}});}catch(_0x36b199){_0x4a555e[_0xb158('0x1c')](0x1f4)[_0xb158('0x2e')](_0x36b199);}};function removeReferences(_0x1bef3b,_0x5622cf){try{if(_0x1bef3b){fs[_0xb158('0x62')](_0x1bef3b);logger['info']('Zip\x20archive\x20removed');}if(_0x5622cf){rimraf(_0x5622cf,function(){});logger[_0xb158('0x63')](_0xb158('0x97'));}}catch(_0xf70210){logger[_0xb158('0x2b')](_0xf70210);}}exports['update']=function(_0x56ec27,_0x35a9db,_0x5cc862){return db[_0xb158('0x2f')][_0xb158('0x4b')]({'where':{'id':_0x56ec27[_0xb158('0x47')]['id']}})[_0xb158('0x27')](handleEntityNotFound(_0x35a9db,null))['then'](saveUpdates(_0x56ec27['body'],null))[_0xb158('0x27')](respondWithResult(_0x35a9db,null))['catch'](handleError(_0x35a9db,null));};exports[_0xb158('0x98')]=function(_0x581475,_0x17ca7d,_0x1c57eb){return db['Plugin'][_0xb158('0x4b')]({'where':{'id':_0x581475['params']['id']}})[_0xb158('0x27')](function(_0x18334c){if(_0x18334c){return _0x18334c[_0xb158('0x2a')]();}})[_0xb158('0x27')](function(_0x3cc9e3){rimraf(path[_0xb158('0x4c')](config[_0xb158('0x4d')],'server/files/plugins',path[_0xb158('0x5a')](_0x3cc9e3['path'])),function(){});return _0x3cc9e3;})[_0xb158('0x27')](handleEntityNotFound(_0x17ca7d,null))[_0xb158('0x27')](respondWithStatusCode(_0x17ca7d,null))['catch'](handleError(_0x17ca7d,null));};exports[_0xb158('0x99')]=function(_0x3a1995,_0x1a907d,_0x37bcc4){return BPromise[_0xb158('0x9a')]()[_0xb158('0x27')](function(){if(!_0x3a1995[_0xb158('0x33')][_0xb158('0x5')]){throw new Error(_0xb158('0x9b'));}if(!_0x3a1995['query'][_0xb158('0x9c')]){throw new Error(_0xb158('0x9d'));}var _0x246de1=_0x3a1995[_0xb158('0x33')][_0xb158('0x9e')]?_0x3a1995[_0xb158('0x33')]['hostname']+':'+_0x3a1995[_0xb158('0x33')][_0xb158('0x9c')]:'http://localhost:'+_0x3a1995[_0xb158('0x33')][_0xb158('0x9c')];var _0x32bb59=_0x3a1995['query']['json']?_0x3a1995[_0xb158('0x33')]['json']:!![];var _0xaec523=_0x3a1995['query'][_0xb158('0x9f')]?_0x3a1995['query']['encoding']:null;var _0x4e5252={'method':_0x3a1995['method'],'uri':util['format']('%s%s',_0x246de1,_0x3a1995[_0xb158('0x33')][_0xb158('0x5')]),'json':_0x32bb59,'resolveWithFullResponse':!![],'encoding':_0xaec523,'qs':_0x3a1995[_0xb158('0x33')]};if(_0x3a1995['headers']){_0x4e5252[_0xb158('0xa0')]=_0x3a1995[_0xb158('0xa0')];if(_0x4e5252['headers'][_0xb158('0xa1')]){delete _0x4e5252[_0xb158('0xa0')][_0xb158('0xa1')];}}return rp(_0x4e5252);})[_0xb158('0x27')](function(_0x3e6453){if(_0x3e6453){_0x1a907d['set'](_0x3e6453[_0xb158('0xa0')]);logger[_0xb158('0x63')](_0x3e6453[_0xb158('0x92')]);if(_[_0xb158('0xa2')](_0x3a1995[_0xb158('0x33')][_0xb158('0x5')],_0xb158('0x4a'))&&_0x3e6453[_0xb158('0xa3')]==0x1f4){return _0x1a907d[_0xb158('0x1b')](_0x3e6453['statusCode']);}else{return _0x1a907d['status'](_0x3e6453['statusCode'])[_0xb158('0x2e')](_0x3e6453['body']);}}else{return _0x1a907d[_0xb158('0x1b')](0xc8);}})[_0xb158('0x49')](handleError(_0x1a907d,null));};exports[_0xb158('0xa4')]=function(_0x36c0ba,_0x127e7e,_0x5afb7e){return BPromise[_0xb158('0x9a')]()[_0xb158('0x27')](function(){if(!_0x36c0ba['query'][_0xb158('0x5')]){throw new Error(_0xb158('0x9b'));}if(!_0x36c0ba[_0xb158('0x33')][_0xb158('0x9c')]){throw new Error(_0xb158('0x9d'));}var _0x4339f7=_0x36c0ba[_0xb158('0x33')][_0xb158('0x9e')]?_0x36c0ba[_0xb158('0x33')]['hostname']+':'+_0x36c0ba['query'][_0xb158('0x9c')]:_0xb158('0xa5')+_0x36c0ba[_0xb158('0x33')][_0xb158('0x9c')];var _0x824a78=_0x36c0ba[_0xb158('0x33')][_0xb158('0x23')]?_0x36c0ba[_0xb158('0x33')][_0xb158('0x23')]:!![];var _0x5cc17a=_0x36c0ba[_0xb158('0x33')][_0xb158('0x9f')]?_0x36c0ba['query']['encoding']:null;var _0x2687b7={'method':_0x36c0ba[_0xb158('0xa6')],'uri':util[_0xb158('0x5f')](_0xb158('0xa7'),_0x4339f7,_0x36c0ba['query']['path']),'json':_0x824a78,'resolveWithFullResponse':!![],'encoding':_0x5cc17a,'body':_0x36c0ba['body']};if(_0x36c0ba[_0xb158('0xa0')]){_0x2687b7[_0xb158('0xa0')]=_0x36c0ba[_0xb158('0xa0')];if(_0x2687b7[_0xb158('0xa0')]['content-length']){delete _0x2687b7[_0xb158('0xa0')][_0xb158('0xa1')];}}return rp(_0x2687b7);})[_0xb158('0x27')](function(_0x483d4a){if(_0x483d4a){_0x127e7e['set'](_0x483d4a[_0xb158('0xa0')]);logger['info'](_0x483d4a[_0xb158('0x92')]);return _0x127e7e[_0xb158('0x1c')](_0x483d4a[_0xb158('0xa3')])['send'](_0x483d4a[_0xb158('0x92')]);}else{return _0x127e7e[_0xb158('0x1b')](0xc8);}})['catch'](handleError(_0x127e7e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 79ca82a..6b28e08 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 _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x11fd8b,_0x4ab04e){var _0x4311ce=function(_0x20cf90){while(--_0x20cf90){_0x11fd8b['push'](_0x11fd8b['shift']());}};_0x4311ce(++_0x4ab04e);}(_0xb10b,0x12a));var _0xbb10=function(_0x172012,_0x2cdb3d){_0x172012=_0x172012-0x0;var _0x1e529a=_0xb10b[_0x172012];return _0x1e529a;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Plugin=require('../../mysqldb')['db'][_0xbb10('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){PluginEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);PluginEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Plugin[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x7a54=['Plugin','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3b2040,_0x35ea49){var _0x47028e=function(_0x26d418){while(--_0x26d418){_0x3b2040['push'](_0x3b2040['shift']());}};_0x47028e(++_0x35ea49);}(_0x7a54,0x106));var _0x47a5=function(_0x19c356,_0x11b13a){_0x19c356=_0x19c356-0x0;var _0x24e788=_0x7a54[_0x19c356];return _0x24e788;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var Plugin=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47a5('0x3'),'afterUpdate':_0x47a5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f7f12){return function(_0x11bf85,_0x2a1a7e,_0x3717e1){PluginEvents[_0x47a5('0x5')](_0x5f7f12+':'+_0x11bf85['id'],_0x11bf85);PluginEvents['emit'](_0x5f7f12,_0x11bf85);_0x3717e1(null);};}for(var e in events){if(events[_0x47a5('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x47a5('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index f58fe67..26c703a 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 _0xf7e6=['define','plugins','lodash','util','../../config/logger','moment','bluebird','exports'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0xf7e6,0x162));var _0x6f7e=function(_0x49d2e3,_0x20d8e6){_0x49d2e3=_0x49d2e3-0x0;var _0x40d907=_0xf7e6[_0x49d2e3];return _0x40d907;};'use strict';var _=require(_0x6f7e('0x0'));var util=require(_0x6f7e('0x1'));var logger=require(_0x6f7e('0x2'))('api');var moment=require(_0x6f7e('0x3'));var BPromise=require(_0x6f7e('0x4'));var rp=require('request-promise');var attributes=require('./plugin.attributes');module[_0x6f7e('0x5')]=function(_0x5c9b8d,_0x1b2693){return _0x5c9b8d[_0x6f7e('0x6')]('Plugin',attributes,{'tableName':_0x6f7e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb08=['request-promise','./plugin.attributes','exports','Plugin','plugins','lodash','util','moment','bluebird'];(function(_0x561e0c,_0x430cc9){var _0x407440=function(_0x3c6706){while(--_0x3c6706){_0x561e0c['push'](_0x561e0c['shift']());}};_0x407440(++_0x430cc9);}(_0xeb08,0xc2));var _0x8eb0=function(_0x40ddc0,_0x41c082){_0x40ddc0=_0x40ddc0-0x0;var _0x1aebf1=_0xeb08[_0x40ddc0];return _0x1aebf1;};'use strict';var _=require(_0x8eb0('0x0'));var util=require(_0x8eb0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8eb0('0x2'));var BPromise=require(_0x8eb0('0x3'));var rp=require(_0x8eb0('0x4'));var attributes=require(_0x8eb0('0x5'));module[_0x8eb0('0x6')]=function(_0x24ceb2,_0x1f7a16){return _0x24ceb2['define'](_0x8eb0('0x7'),attributes,{'tableName':_0x8eb0('0x8'),'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 92d1fda..b21d9d9 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 _0x83f5=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','socket.io-emitter','redis','./plugin.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','message','Plugin,\x20%s,\x20%s','result','catch','CreatePlugin','Plugin','body','options','raw','lodash'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x83f5,0xb9));var _0x583f=function(_0x3f3148,_0x23027a){_0x3f3148=_0x3f3148-0x0;var _0x21b9af=_0x83f5[_0x3f3148];return _0x21b9af;};'use strict';var _=require(_0x583f('0x0'));var util=require('util');var moment=require(_0x583f('0x1'));var BPromise=require('bluebird');var rs=require(_0x583f('0x2'));var fs=require('fs');var Redis=require(_0x583f('0x3'));var db=require(_0x583f('0x4'))['db'];var utils=require(_0x583f('0x5'));var logger=require('../../config/logger')(_0x583f('0x6'));var config=require('../../config/environment');var jayson=require(_0x583f('0x7'));var client=jayson['client'][_0x583f('0x8')]({'port':0x232a});config['redis']=_[_0x583f('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x583f('0xa'))(new Redis(config[_0x583f('0xb')]));require(_0x583f('0xc'))[_0x583f('0xd')](socket);function respondWithRpcPromise(_0x2c28a0,_0x56c47c,_0x1965fe){return new BPromise(function(_0x29724f,_0x3f78ca){return client[_0x583f('0xe')](_0x2c28a0,_0x1965fe)[_0x583f('0xf')](function(_0x4a6596){logger[_0x583f('0x10')]('Plugin,\x20%s,\x20%s',_0x56c47c,_0x583f('0x11'));logger[_0x583f('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x56c47c,_0x583f('0x11'),JSON[_0x583f('0x13')](_0x4a6596));if(_0x4a6596[_0x583f('0x14')]){if(_0x4a6596[_0x583f('0x14')][_0x583f('0x15')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x56c47c,_0x4a6596[_0x583f('0x14')]['message']);return _0x3f78ca(_0x4a6596[_0x583f('0x14')][_0x583f('0x16')]);}logger[_0x583f('0x14')](_0x583f('0x17'),_0x56c47c,_0x4a6596['error']['message']);return _0x29724f(_0x4a6596[_0x583f('0x14')]['message']);}else{logger['info'](_0x583f('0x17'),_0x56c47c,_0x583f('0x11'));_0x29724f(_0x4a6596[_0x583f('0x18')][_0x583f('0x16')]);}})[_0x583f('0x19')](function(_0x10cdb0){logger['error'](_0x583f('0x17'),_0x56c47c,_0x10cdb0);_0x3f78ca(_0x10cdb0);});});}exports[_0x583f('0x1a')]=function(_0x3294e1){var _0x4f7756=this;return new Promise(function(_0x409e98,_0x199137){return db[_0x583f('0x1b')]['create'](_0x3294e1[_0x583f('0x1c')],{'raw':_0x3294e1[_0x583f('0x1d')]?_0x3294e1['options'][_0x583f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x47fd26){logger[_0x583f('0x10')]('CreatePlugin',_0x3294e1);logger[_0x583f('0x12')](_0x583f('0x1a'),_0x3294e1,JSON[_0x583f('0x13')](_0x47fd26));_0x409e98(_0x47fd26);})[_0x583f('0x19')](function(_0x1168a6){logger[_0x583f('0x14')](_0x583f('0x1a'),_0x1168a6[_0x583f('0x16')],_0x3294e1);_0x199137(_0x4f7756[_0x583f('0x14')](0x1f4,_0x1168a6[_0x583f('0x16')]));});});}; \ No newline at end of file +var _0xe863=['then','CreatePlugin','catch','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','Plugin','create','options'];(function(_0x3ab4e2,_0xd27979){var _0x149e36=function(_0x331644){while(--_0x331644){_0x3ab4e2['push'](_0x3ab4e2['shift']());}};_0x149e36(++_0xd27979);}(_0xe863,0x1e9));var _0x3e86=function(_0xc7d42d,_0x27afe7){_0xc7d42d=_0xc7d42d-0x0;var _0x1f5389=_0xe863[_0xc7d42d];return _0x1f5389;};'use strict';var _=require('lodash');var util=require(_0x3e86('0x0'));var moment=require(_0x3e86('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e86('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e86('0x3'))(_0x3e86('0x4'));var config=require('../../config/environment');var jayson=require(_0x3e86('0x5'));var client=jayson[_0x3e86('0x6')][_0x3e86('0x7')]({'port':0x232a});config[_0x3e86('0x8')]=_['defaults'](config[_0x3e86('0x8')],{'host':_0x3e86('0x9'),'port':0x18eb});var socket=require(_0x3e86('0xa'))(new Redis(config['redis']));require(_0x3e86('0xb'))[_0x3e86('0xc')](socket);function respondWithRpcPromise(_0x48be12,_0x2bbb0a,_0x53bb6a){return new BPromise(function(_0x3772ad,_0xa326ae){return client[_0x3e86('0xd')](_0x48be12,_0x53bb6a)['then'](function(_0x3d9cb0){logger['info'](_0x3e86('0xe'),_0x2bbb0a,_0x3e86('0xf'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x2bbb0a,'request\x20sent',JSON[_0x3e86('0x10')](_0x3d9cb0));if(_0x3d9cb0['error']){if(_0x3d9cb0[_0x3e86('0x11')][_0x3e86('0x12')]===0x1f4){logger[_0x3e86('0x11')](_0x3e86('0xe'),_0x2bbb0a,_0x3d9cb0[_0x3e86('0x11')][_0x3e86('0x13')]);return _0xa326ae(_0x3d9cb0[_0x3e86('0x11')][_0x3e86('0x13')]);}logger[_0x3e86('0x11')](_0x3e86('0xe'),_0x2bbb0a,_0x3d9cb0[_0x3e86('0x11')][_0x3e86('0x13')]);return _0x3772ad(_0x3d9cb0['error'][_0x3e86('0x13')]);}else{logger[_0x3e86('0x14')](_0x3e86('0xe'),_0x2bbb0a,_0x3e86('0xf'));_0x3772ad(_0x3d9cb0['result'][_0x3e86('0x13')]);}})['catch'](function(_0x2a399b){logger[_0x3e86('0x11')](_0x3e86('0xe'),_0x2bbb0a,_0x2a399b);_0xa326ae(_0x2a399b);});});}exports['CreatePlugin']=function(_0x47c338){var _0x5ea47d=this;return new Promise(function(_0x298f38,_0x400f17){return db[_0x3e86('0x15')][_0x3e86('0x16')](_0x47c338['body'],{'raw':_0x47c338[_0x3e86('0x17')]?_0x47c338[_0x3e86('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x3e86('0x18')](function(_0x16c704){logger['info'](_0x3e86('0x19'),_0x47c338);logger['debug']('CreatePlugin',_0x47c338,JSON[_0x3e86('0x10')](_0x16c704));_0x298f38(_0x16c704);})[_0x3e86('0x1a')](function(_0x14d68){logger[_0x3e86('0x11')]('CreatePlugin',_0x14d68[_0x3e86('0x13')],_0x47c338);_0x400f17(_0x5ea47d[_0x3e86('0x11')](0x1f4,_0x14d68[_0x3e86('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index e80bbfe..0f3d304 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 _0x6a73=['emit','removeListener','length','plugin:','./plugin.events','remove','update'];(function(_0x1fbf47,_0x516c8b){var _0x329a33=function(_0x36980c){while(--_0x36980c){_0x1fbf47['push'](_0x1fbf47['shift']());}};_0x329a33(++_0x516c8b);}(_0x6a73,0x97));var _0x36a7=function(_0x802997,_0x5534a2){_0x802997=_0x802997-0x0;var _0x35c641=_0x6a73[_0x802997];return _0x35c641;};'use strict';var PluginEvents=require(_0x36a7('0x0'));var events=['save',_0x36a7('0x1'),_0x36a7('0x2')];function createListener(_0x463c70,_0x17a2fa){return function(_0x1a17ba){_0x17a2fa[_0x36a7('0x3')](_0x463c70,_0x1a17ba);};}function removeListener(_0xe0b002,_0x517c67){return function(){PluginEvents[_0x36a7('0x4')](_0xe0b002,_0x517c67);};}exports['register']=function(_0x434a85){for(var _0x151081=0x0,_0xe66b22=events[_0x36a7('0x5')];_0x151081<_0xe66b22;_0x151081++){var _0x301665=events[_0x151081];var _0x48ddee=createListener(_0x36a7('0x6')+_0x301665,_0x434a85);PluginEvents['on'](_0x301665,_0x48ddee);}}; \ No newline at end of file +var _0xe92f=['remove','update','emit','removeListener','length','save'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0xe92f,0x7d));var _0xfe92=function(_0x4d8884,_0x2b6633){_0x4d8884=_0x4d8884-0x0;var _0x49300c=_0xe92f[_0x4d8884];return _0x49300c;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xfe92('0x0'),_0xfe92('0x1'),_0xfe92('0x2')];function createListener(_0x523121,_0x21881b){return function(_0x419f3a){_0x21881b[_0xfe92('0x3')](_0x523121,_0x419f3a);};}function removeListener(_0x448d37,_0x5b2a48){return function(){PluginEvents[_0xfe92('0x4')](_0x448d37,_0x5b2a48);};}exports['register']=function(_0x109fc4){for(var _0x4e50f8=0x0,_0x735eae=events[_0xfe92('0x5')];_0x4e50f8<_0x735eae;_0x4e50f8++){var _0x4a09c1=events[_0x4e50f8];var _0x4f7fac=createListener('plugin:'+_0x4a09c1,_0x109fc4);PluginEvents['on'](_0x4a09c1,_0x4f7fac);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index d7e8e99..61742f5 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(_0x56ec09,_0xd0c95f){var _0x1ddcaa=function(_0x321853){while(--_0x321853){_0x56ec09['push'](_0x56ec09['shift']());}};_0x1ddcaa(++_0xd0c95f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x21783b,_0x34e31d){var _0x3471a2=function(_0x22e066){while(--_0x22e066){_0x21783b['push'](_0x21783b['shift']());}};_0x3471a2(++_0x34e31d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 6b0e97d..cf5d2d8 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 _0x23bb=['Unknown\x20status','destroy','delete','Unknown\x20id','lodash','api','path','child_process','bluebird','stack','name','status','send','npm\x20install','info','error','index','list','then','reject','express','motion2','catch','show','params','create','body','script','join','../../files/plugins','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x23bb,0x79));var _0xb23b=function(_0x40e41e,_0x3d30e7){_0x40e41e=_0x40e41e-0x0;var _0x18b70c=_0x23bb[_0x40e41e];return _0x18b70c;};'use strict';var _=require(_0xb23b('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xb23b('0x1'));var path=require(_0xb23b('0x2'));var exec=require(_0xb23b('0x3'))['exec'];var BPromise=require(_0xb23b('0x4'));function handleEntityNotFound(_0xe2b77c,_0x38419d){return function(_0x58bf2a){if(!_0x58bf2a){_0xe2b77c['sendStatus'](0x194);;}return _0x58bf2a;};}function respondWithResult(_0x50f8a8,_0x306f8b){_0x306f8b=_0x306f8b||0xc8;return function(_0x4c5626){if(_0x4c5626){return _0x50f8a8['status'](_0x306f8b)['json'](_0x4c5626);}return null;};}function handleError(_0x29e8e9,_0x4d00fe){_0x4d00fe=_0x4d00fe||0x1f4;return function(_0x117bd5){logger['error'](_0x117bd5[_0xb23b('0x5')]);if(_0x117bd5[_0xb23b('0x6')]){delete _0x117bd5['name'];}_0x29e8e9[_0xb23b('0x7')](_0x4d00fe)[_0xb23b('0x8')](_0x117bd5);};}function execChildProcess(){return new BPromise(function(_0x56e9ba,_0x4517ca){exec(_0xb23b('0x9'),function(_0x1b5f93,_0x5cc7fd,_0x1048f2){logger[_0xb23b('0xa')](_0x5cc7fd);logger[_0xb23b('0xa')](_0x1048f2);if(_0x1b5f93){logger[_0xb23b('0xb')](_0x1b5f93);return _0x4517ca(_0x1b5f93);}return _0x56e9ba(_0x5cc7fd);});});}exports[_0xb23b('0xc')]=function(_0x2f2fb2,_0x3ee84b){return pm2[_0xb23b('0xd')]()[_0xb23b('0xe')](function(_0x2ff6e8){if(_0x2ff6e8){var _0x3ff740=_[_0xb23b('0xf')](_0x2ff6e8,function(_0x2e4897){return _0x2e4897[_0xb23b('0x6')]===_0xb23b('0x10')||_0x2e4897[_0xb23b('0x6')]===_0xb23b('0x11');});return{'rows':_0x3ff740,'count':_0x3ff740['length']};}return null;})[_0xb23b('0xe')](respondWithResult(_0x3ee84b,null))[_0xb23b('0x12')](handleError(_0x3ee84b,null));};exports[_0xb23b('0x13')]=function(_0x2d9584,_0x158e02){return pm2['describe'](_0x2d9584[_0xb23b('0x14')]['id'])['then'](respondWithResult(_0x158e02,null))[_0xb23b('0xe')](handleEntityNotFound(_0x158e02,null))[_0xb23b('0x12')](handleError(_0x158e02,null));};exports[_0xb23b('0x15')]=function(_0x5ddf16,_0x57c0df){if(_0x5ddf16[_0xb23b('0x16')][_0xb23b('0x6')]&&_0x5ddf16[_0xb23b('0x16')][_0xb23b('0x17')]){var _0x1ca831=path[_0xb23b('0x18')](__dirname,_0xb23b('0x19'),_0x5ddf16['body'][_0xb23b('0x17')]);var _0x197b14=process[_0xb23b('0x1a')]();process[_0xb23b('0x1b')](path['dirname'](_0x1ca831));return execChildProcess()[_0xb23b('0xe')](function(_0x3bec93){process['chdir'](_0x197b14);return pm2[_0xb23b('0x1c')]({'name':_0x5ddf16['body'][_0xb23b('0x6')],'script':_0x1ca831});})['then'](function(_0x3968db){pm2[_0xb23b('0x1d')]();return _0x3968db[0x0];})['then'](respondWithResult(_0x57c0df,0xc9))[_0xb23b('0x12')](handleError(_0x57c0df,null));}else{return _0x57c0df[_0xb23b('0x7')](0x1f4)[_0xb23b('0x8')]({'message':_0xb23b('0x1e')});}};exports[_0xb23b('0x1f')]=function(_0x5ebe63,_0x6c68fa){if(_0x5ebe63[_0xb23b('0x16')]['id']){delete _0x5ebe63[_0xb23b('0x16')]['id'];}var _0x35a723={'online':_0xb23b('0x20'),'stopped':_0xb23b('0x21')};if(_0x35a723[_0xb23b('0x22')](_0x5ebe63[_0xb23b('0x16')]['status'])){return pm2[_0x35a723[_0x5ebe63[_0xb23b('0x16')][_0xb23b('0x7')]]](_0x5ebe63[_0xb23b('0x14')]['id'])['then'](respondWithResult(_0x6c68fa,0xc8))[_0xb23b('0x12')](handleError(_0x6c68fa,null));}else{return _0x6c68fa[_0xb23b('0x7')](0x1f4)[_0xb23b('0x8')]({'message':_0xb23b('0x23')});}};exports[_0xb23b('0x24')]=function(_0x496a38,_0x8c65f3){if(_0x496a38[_0xb23b('0x16')]['id']){delete _0x496a38[_0xb23b('0x16')]['id'];}if(_0x496a38[_0xb23b('0x14')]['id']){return pm2[_0xb23b('0x25')](_0x496a38[_0xb23b('0x14')]['id'])[_0xb23b('0xe')](function(_0x2f0019){pm2[_0xb23b('0x1d')]();return _0x2f0019[0x0];})[_0xb23b('0xe')](respondWithResult(_0x8c65f3,null))[_0xb23b('0x12')](handleError(_0x8c65f3,null));}else{return _0x8c65f3[_0xb23b('0x7')](0x1f4)['send']({'message':_0xb23b('0x26')});}}; \ No newline at end of file +var _0xe643=['send','info','index','then','length','catch','show','describe','params','body','script','join','../../files/plugins','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','api','child_process','exec','bluebird','sendStatus','status','json','error','stack','name'];(function(_0x48a191,_0x1c3997){var _0x529bc0=function(_0x5d0624){while(--_0x5d0624){_0x48a191['push'](_0x48a191['shift']());}};_0x529bc0(++_0x1c3997);}(_0xe643,0x84));var _0x3e64=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xe643[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x3e64('0x0'));var pm2=require(_0x3e64('0x1'));var logger=require('../../config/logger')(_0x3e64('0x2'));var path=require('path');var exec=require(_0x3e64('0x3'))[_0x3e64('0x4')];var BPromise=require(_0x3e64('0x5'));function handleEntityNotFound(_0x12eb74,_0x13b250){return function(_0x5d4a4e){if(!_0x5d4a4e){_0x12eb74[_0x3e64('0x6')](0x194);;}return _0x5d4a4e;};}function respondWithResult(_0x26e4d9,_0x11e550){_0x11e550=_0x11e550||0xc8;return function(_0x253a3a){if(_0x253a3a){return _0x26e4d9[_0x3e64('0x7')](_0x11e550)[_0x3e64('0x8')](_0x253a3a);}return null;};}function handleError(_0x51cb2b,_0x1cc6b9){_0x1cc6b9=_0x1cc6b9||0x1f4;return function(_0x2ddf0e){logger[_0x3e64('0x9')](_0x2ddf0e[_0x3e64('0xa')]);if(_0x2ddf0e[_0x3e64('0xb')]){delete _0x2ddf0e[_0x3e64('0xb')];}_0x51cb2b[_0x3e64('0x7')](_0x1cc6b9)[_0x3e64('0xc')](_0x2ddf0e);};}function execChildProcess(){return new BPromise(function(_0x3ef250,_0x1fb2f8){exec('npm\x20install',function(_0x200a1c,_0x26378c,_0x1ae3dd){logger[_0x3e64('0xd')](_0x26378c);logger[_0x3e64('0xd')](_0x1ae3dd);if(_0x200a1c){logger[_0x3e64('0x9')](_0x200a1c);return _0x1fb2f8(_0x200a1c);}return _0x3ef250(_0x26378c);});});}exports[_0x3e64('0xe')]=function(_0x100b3e,_0x184ebd){return pm2['list']()[_0x3e64('0xf')](function(_0x438b13){if(_0x438b13){var _0x8232e4=_['reject'](_0x438b13,function(_0x5b53b2){return _0x5b53b2['name']==='express'||_0x5b53b2['name']==='motion2';});return{'rows':_0x8232e4,'count':_0x8232e4[_0x3e64('0x10')]};}return null;})[_0x3e64('0xf')](respondWithResult(_0x184ebd,null))[_0x3e64('0x11')](handleError(_0x184ebd,null));};exports[_0x3e64('0x12')]=function(_0x395fd6,_0x1c78a1){return pm2[_0x3e64('0x13')](_0x395fd6[_0x3e64('0x14')]['id'])[_0x3e64('0xf')](respondWithResult(_0x1c78a1,null))['then'](handleEntityNotFound(_0x1c78a1,null))[_0x3e64('0x11')](handleError(_0x1c78a1,null));};exports['create']=function(_0x5ba990,_0x43217f){if(_0x5ba990[_0x3e64('0x15')]['name']&&_0x5ba990[_0x3e64('0x15')][_0x3e64('0x16')]){var _0x1fb49e=path[_0x3e64('0x17')](__dirname,_0x3e64('0x18'),_0x5ba990[_0x3e64('0x15')][_0x3e64('0x16')]);var _0x579f31=process['cwd']();process[_0x3e64('0x19')](path[_0x3e64('0x1a')](_0x1fb49e));return execChildProcess()[_0x3e64('0xf')](function(_0x438507){process[_0x3e64('0x19')](_0x579f31);return pm2[_0x3e64('0x1b')]({'name':_0x5ba990[_0x3e64('0x15')][_0x3e64('0xb')],'script':_0x1fb49e});})[_0x3e64('0xf')](function(_0x272609){pm2['dump']();return _0x272609[0x0];})[_0x3e64('0xf')](respondWithResult(_0x43217f,0xc9))[_0x3e64('0x11')](handleError(_0x43217f,null));}else{return _0x43217f[_0x3e64('0x7')](0x1f4)[_0x3e64('0xc')]({'message':_0x3e64('0x1c')});}};exports[_0x3e64('0x1d')]=function(_0x4f3889,_0x325ae3){if(_0x4f3889[_0x3e64('0x15')]['id']){delete _0x4f3889['body']['id'];}var _0x32e35b={'online':_0x3e64('0x1e'),'stopped':'stop'};if(_0x32e35b[_0x3e64('0x1f')](_0x4f3889[_0x3e64('0x15')][_0x3e64('0x7')])){return pm2[_0x32e35b[_0x4f3889[_0x3e64('0x15')][_0x3e64('0x7')]]](_0x4f3889[_0x3e64('0x14')]['id'])[_0x3e64('0xf')](respondWithResult(_0x325ae3,0xc8))[_0x3e64('0x11')](handleError(_0x325ae3,null));}else{return _0x325ae3[_0x3e64('0x7')](0x1f4)['send']({'message':_0x3e64('0x20')});}};exports[_0x3e64('0x21')]=function(_0x1746aa,_0xcc78bf){if(_0x1746aa[_0x3e64('0x15')]['id']){delete _0x1746aa[_0x3e64('0x15')]['id'];}if(_0x1746aa[_0x3e64('0x14')]['id']){return pm2[_0x3e64('0x22')](_0x1746aa[_0x3e64('0x14')]['id'])[_0x3e64('0xf')](function(_0x1e6d06){pm2['dump']();return _0x1e6d06[0x0];})[_0x3e64('0xf')](respondWithResult(_0xcc78bf,null))[_0x3e64('0x11')](handleError(_0xcc78bf,null));}else{return _0xcc78bf[_0x3e64('0x7')](0x1f4)['send']({'message':_0x3e64('0x23')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 3ff6064..47b4043 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 _0x4c60=['path','connect-timeout','Router','multer','util'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x4c60,0xc1));var _0x04c6=function(_0x449ca6,_0x31e19a){_0x449ca6=_0x449ca6-0x0;var _0x75385e=_0x4c60[_0x449ca6];return _0x75385e;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x5e0e=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x5e0e,0x89));var _0xe5e0=function(_0x5e9f76,_0x2c585a){_0x5e9f76=_0x5e9f76-0x0;var _0x2c4635=_0x5e0e[_0x5e9f76];return _0x2c4635;};'use strict';var multer=require(_0xe5e0('0x0'));var util=require(_0xe5e0('0x1'));var path=require('path');var timeout=require(_0xe5e0('0x2'));var express=require(_0xe5e0('0x3'));var router=express[_0xe5e0('0x4')]();var auth=require(_0xe5e0('0x5'));var interaction=require(_0xe5e0('0x6'));var config=require('../../config/environment');module[_0xe5e0('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index b360639..473825b 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 _0xca6b=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x1075b8,_0xd606e2){var _0x5d047f=function(_0x5e6652){while(--_0x5e6652){_0x1075b8['push'](_0x1075b8['shift']());}};_0x5d047f(++_0xd606e2);}(_0xca6b,0x117));var _0xbca6=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xca6b[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require(_0xbca6('0x0'));module[_0xbca6('0x1')]={'state':{'type':Sequelize[_0xbca6('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xbca6('0x3')]},'scheduledat':{'type':Sequelize[_0xbca6('0x4')]},'uniqueid':{'type':Sequelize[_0xbca6('0x3')]},'starttime':{'type':Sequelize[_0xbca6('0x4')]},'responsetime':{'type':Sequelize[_0xbca6('0x4')]},'ringtime':{'type':Sequelize[_0xbca6('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xbca6('0x3')]},'campaigntype':{'type':Sequelize[_0xbca6('0x3')]},'membername':{'type':Sequelize[_0xbca6('0x3')]}}; \ No newline at end of file +var _0x2eda=['exports','STRING','DATE','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2eda,0x17b));var _0xa2ed=function(_0x57c2a0,_0x7d3468){_0x57c2a0=_0x57c2a0-0x0;var _0xb92168=_0x2eda[_0x57c2a0];return _0xb92168;};'use strict';var Sequelize=require(_0xa2ed('0x0'));module[_0xa2ed('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xa2ed('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xa2ed('0x3')]},'responsetime':{'type':Sequelize[_0xa2ed('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa2ed('0x2')]},'campaigntype':{'type':Sequelize[_0xa2ed('0x2')]},'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 eb24677..768d52f 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 _0x7f8d=['api','moment','bluebird','request-promise','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview'];(function(_0x175756,_0x4450bc){var _0x3be0a6=function(_0x3fb180){while(--_0x3fb180){_0x175756['push'](_0x175756['shift']());}};_0x3be0a6(++_0x4450bc);}(_0x7f8d,0xc8));var _0xd7f8=function(_0x1cc35d,_0x50136a){_0x1cc35d=_0x1cc35d-0x0;var _0x106da9=_0x7f8d[_0x1cc35d];return _0x106da9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd7f8('0x0'));var moment=require(_0xd7f8('0x1'));var BPromise=require(_0xd7f8('0x2'));var rp=require(_0xd7f8('0x3'));var attributes=require(_0xd7f8('0x4'));module[_0xd7f8('0x5')]=function(_0x273443,_0x128d9f){return _0x273443['define'](_0xd7f8('0x6'),attributes,{'tableName':_0xd7f8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc22=['./reportAgentPreview.attributes','exports','define','ReportAgentPreview','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1deb9e,_0x182b22){var _0x26a18f=function(_0x520f17){while(--_0x520f17){_0x1deb9e['push'](_0x1deb9e['shift']());}};_0x26a18f(++_0x182b22);}(_0xbc22,0x158));var _0x2bc2=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0xbc22[_0xe30e17];return _0x2342c9;};'use strict';var _=require('lodash');var util=require(_0x2bc2('0x0'));var logger=require(_0x2bc2('0x1'))(_0x2bc2('0x2'));var moment=require(_0x2bc2('0x3'));var BPromise=require(_0x2bc2('0x4'));var rp=require(_0x2bc2('0x5'));var attributes=require(_0x2bc2('0x6'));module[_0x2bc2('0x7')]=function(_0x7cf4,_0x15c71f){return _0x7cf4[_0x2bc2('0x8')](_0x2bc2('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index ee661f6..86e21ba 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 _0x487d=['http','request','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xd56522,_0x4d55f9){var _0xac12e3=function(_0x24a1fd){while(--_0x24a1fd){_0xd56522['push'](_0xd56522['shift']());}};_0xac12e3(++_0x4d55f9);}(_0x487d,0x1a7));var _0xd487=function(_0x490c02,_0x2faa1b){_0x490c02=_0x490c02-0x0;var _0x4604ab=_0x487d[_0x490c02];return _0x4604ab;};'use strict';var _=require(_0xd487('0x0'));var util=require(_0xd487('0x1'));var moment=require(_0xd487('0x2'));var BPromise=require(_0xd487('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd487('0x4'));var db=require(_0xd487('0x5'))['db'];var utils=require(_0xd487('0x6'));var logger=require(_0xd487('0x7'))('rpc');var config=require(_0xd487('0x8'));var jayson=require(_0xd487('0x9'));var client=jayson[_0xd487('0xa')][_0xd487('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28d16c,_0xd13eda,_0x230148){return new BPromise(function(_0x4d97dd,_0x2a01ef){return client[_0xd487('0xc')](_0x28d16c,_0x230148)['then'](function(_0x276049){logger['info'](_0xd487('0xd'),_0xd13eda,_0xd487('0xe'));logger['debug'](_0xd487('0xf'),_0xd13eda,_0xd487('0xe'),JSON[_0xd487('0x10')](_0x276049));if(_0x276049[_0xd487('0x11')]){if(_0x276049[_0xd487('0x11')][_0xd487('0x12')]===0x1f4){logger[_0xd487('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0xd13eda,_0x276049[_0xd487('0x11')][_0xd487('0x13')]);return _0x2a01ef(_0x276049['error']['message']);}logger[_0xd487('0x11')](_0xd487('0xd'),_0xd13eda,_0x276049[_0xd487('0x11')][_0xd487('0x13')]);return _0x4d97dd(_0x276049['error'][_0xd487('0x13')]);}else{logger[_0xd487('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0xd13eda,_0xd487('0xe'));_0x4d97dd(_0x276049[_0xd487('0x15')]['message']);}})[_0xd487('0x16')](function(_0x39fc24){logger[_0xd487('0x11')](_0xd487('0xd'),_0xd13eda,_0x39fc24);_0x2a01ef(_0x39fc24);});});}exports[_0xd487('0x17')]=function(_0x5df284){var _0x2e3b47=this;return new Promise(function(_0x218699,_0x49c332){return db[_0xd487('0x18')][_0xd487('0x19')](_0x5df284[_0xd487('0x1a')],{'raw':_0x5df284[_0xd487('0x1b')]?_0x5df284[_0xd487('0x1b')][_0xd487('0x1c')]===undefined?!![]:![]:!![]})[_0xd487('0x1d')](function(_0x4e1a1c){logger[_0xd487('0x14')](_0xd487('0x17'),_0x5df284);logger[_0xd487('0x1e')](_0xd487('0x17'),_0x5df284,JSON[_0xd487('0x10')](_0x4e1a1c));_0x218699(_0x4e1a1c);})[_0xd487('0x16')](function(_0x4a0836){logger[_0xd487('0x11')](_0xd487('0x17'),_0x4a0836['message'],_0x5df284);_0x49c332(_0x2e3b47[_0xd487('0x11')](0x1f4,_0x4a0836[_0xd487('0x13')]));});});}; \ No newline at end of file +var _0xd9af=['ReportAgentPreview','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateReportAgentPreview'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd9af,0x162));var _0xfd9a=function(_0x15ac0e,_0x3323fe){_0x15ac0e=_0x15ac0e-0x0;var _0x46262c=_0xd9af[_0x15ac0e];return _0x46262c;};'use strict';var _=require(_0xfd9a('0x0'));var util=require('util');var moment=require(_0xfd9a('0x1'));var BPromise=require(_0xfd9a('0x2'));var rs=require(_0xfd9a('0x3'));var fs=require('fs');var Redis=require(_0xfd9a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd9a('0x5'));var logger=require('../../config/logger')(_0xfd9a('0x6'));var config=require(_0xfd9a('0x7'));var jayson=require(_0xfd9a('0x8'));var client=jayson[_0xfd9a('0x9')][_0xfd9a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x557dcf,_0x1da006,_0x3b0fa2){return new BPromise(function(_0xe9ac8f,_0x1b056d){return client[_0xfd9a('0xb')](_0x557dcf,_0x3b0fa2)[_0xfd9a('0xc')](function(_0x22f07){logger['info'](_0xfd9a('0xd'),_0x1da006,_0xfd9a('0xe'));logger[_0xfd9a('0xf')](_0xfd9a('0x10'),_0x1da006,'request\x20sent',JSON[_0xfd9a('0x11')](_0x22f07));if(_0x22f07[_0xfd9a('0x12')]){if(_0x22f07['error']['code']===0x1f4){logger[_0xfd9a('0x12')](_0xfd9a('0xd'),_0x1da006,_0x22f07[_0xfd9a('0x12')]['message']);return _0x1b056d(_0x22f07[_0xfd9a('0x12')][_0xfd9a('0x13')]);}logger[_0xfd9a('0x12')](_0xfd9a('0xd'),_0x1da006,_0x22f07[_0xfd9a('0x12')][_0xfd9a('0x13')]);return _0xe9ac8f(_0x22f07[_0xfd9a('0x12')][_0xfd9a('0x13')]);}else{logger[_0xfd9a('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x1da006,_0xfd9a('0xe'));_0xe9ac8f(_0x22f07[_0xfd9a('0x15')]['message']);}})[_0xfd9a('0x16')](function(_0x5e8aaf){logger[_0xfd9a('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x1da006,_0x5e8aaf);_0x1b056d(_0x5e8aaf);});});}exports[_0xfd9a('0x17')]=function(_0x16177e){var _0x418f4c=this;return new Promise(function(_0x3f7bd9,_0xaf03){return db[_0xfd9a('0x18')]['create'](_0x16177e['body'],{'raw':_0x16177e[_0xfd9a('0x19')]?_0x16177e[_0xfd9a('0x19')][_0xfd9a('0x1a')]===undefined?!![]:![]:!![]})[_0xfd9a('0xc')](function(_0x5de024){logger[_0xfd9a('0x14')]('CreateReportAgentPreview',_0x16177e);logger[_0xfd9a('0xf')](_0xfd9a('0x17'),_0x16177e,JSON['stringify'](_0x5de024));_0x3f7bd9(_0x5de024);})[_0xfd9a('0x16')](function(_0x2fc94a){logger[_0xfd9a('0x12')]('CreateReportAgentPreview',_0x2fc94a[_0xfd9a('0x13')],_0x16177e);_0xaf03(_0x418f4c['error'](0x1f4,_0x2fc94a[_0xfd9a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 3621d04..f946889 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 _0x9d87=['/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','mail','/mail/queues/:id','post','queueNotify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','/openchannel/queues','/sms/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','outbound','/outbound/channels','outboundChannels','/agents','agents','put','agentCapacity','/telephones','telephones'];(function(_0x4b4d83,_0x2eda57){var _0xda5c19=function(_0xabbbac){while(--_0xabbbac){_0x4b4d83['push'](_0x4b4d83['shift']());}};_0xda5c19(++_0x2eda57);}(_0x9d87,0x102));var _0x79d8=function(_0x59238b,_0x3d6ebc){_0x59238b=_0x59238b-0x0;var _0x6d1834=_0x9d87[_0x59238b];return _0x6d1834;};'use strict';var multer=require(_0x79d8('0x0'));var util=require(_0x79d8('0x1'));var path=require(_0x79d8('0x2'));var express=require(_0x79d8('0x3'));var router=express[_0x79d8('0x4')]();var auth=require(_0x79d8('0x5'));var controller=require(_0x79d8('0x6'));router[_0x79d8('0x7')](_0x79d8('0x8'),auth['isAuthenticated'](),controller['voiceChannels']);router[_0x79d8('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x79d8('0x9')](),controller[_0x79d8('0xa')]);router[_0x79d8('0x7')](_0x79d8('0xb'),auth[_0x79d8('0x9')](),controller[_0x79d8('0xc')]);router[_0x79d8('0x7')](_0x79d8('0xd'),auth[_0x79d8('0x9')](),controller[_0x79d8('0xe')]);router['get'](_0x79d8('0xf'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x10')]);router[_0x79d8('0x7')]('/mail/queues',auth[_0x79d8('0x9')](),controller[_0x79d8('0x11')]);router[_0x79d8('0x7')](_0x79d8('0x12'),auth[_0x79d8('0x9')](),controller['mailAccounts']);router[_0x79d8('0x7')](_0x79d8('0x13'),auth[_0x79d8('0x9')](),controller['openchannelQueues']);router['get'](_0x79d8('0x14'),auth[_0x79d8('0x9')](),controller['smsQueues']);router[_0x79d8('0x7')](_0x79d8('0x15'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x16')]);router[_0x79d8('0x7')](_0x79d8('0x17'),auth['isAuthenticated'](),controller[_0x79d8('0x18')]);router[_0x79d8('0x7')](_0x79d8('0x19'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x1a')]);router[_0x79d8('0x7')](_0x79d8('0x1b'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x1c')]);router[_0x79d8('0x7')](_0x79d8('0x1d'),auth[_0x79d8('0x9')](),controller['voiceQueuesChannelHangup']);router['get'](_0x79d8('0x1e'),auth[_0x79d8('0x9')](),controller['voiceQueuesChannelRedirect']);router[_0x79d8('0x7')](_0x79d8('0x1f'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x20')]);router[_0x79d8('0x7')]('/outbound',auth[_0x79d8('0x9')](),controller[_0x79d8('0x21')]);router[_0x79d8('0x7')](_0x79d8('0x22'),auth['isAuthenticated'](),controller[_0x79d8('0x23')]);router[_0x79d8('0x7')](_0x79d8('0x24'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x25')]);router[_0x79d8('0x26')]('/agents/:id/capacity',auth[_0x79d8('0x9')](),controller[_0x79d8('0x27')]);router[_0x79d8('0x7')](_0x79d8('0x28'),auth['isAuthenticated'](),controller[_0x79d8('0x29')]);router[_0x79d8('0x7')](_0x79d8('0x2a'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x2b')]);router['get'](_0x79d8('0x2c'),auth['isAuthenticated'](),controller['campaigns']);router[_0x79d8('0x7')](_0x79d8('0x2d'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x2e')]);router[_0x79d8('0x7')](_0x79d8('0x2f'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x30')]);router[_0x79d8('0x7')]('/mail/queues/waitinginteractions',auth[_0x79d8('0x9')](),controller[_0x79d8('0x31')]);router[_0x79d8('0x7')](_0x79d8('0x32'),auth['isAuthenticated'](),controller[_0x79d8('0x33')]);router[_0x79d8('0x7')](_0x79d8('0x34'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x35')]);router[_0x79d8('0x7')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x79d8('0x36')]);router['post'](_0x79d8('0x37'),auth[_0x79d8('0x9')](),controller['queueNotify'](_0x79d8('0x38')));router[_0x79d8('0x7')](_0x79d8('0x39'),auth[_0x79d8('0x9')](),controller['showMailQueues']);router[_0x79d8('0x3a')]('/chat/queues/:id/notify',auth[_0x79d8('0x9')](),controller[_0x79d8('0x3b')](_0x79d8('0x3c')));router[_0x79d8('0x7')](_0x79d8('0x3d'),auth[_0x79d8('0x9')](),controller['showChatQueues']);router['post'](_0x79d8('0x3e'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x3b')](_0x79d8('0x3f')));router[_0x79d8('0x7')](_0x79d8('0x40'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x41')]);router[_0x79d8('0x3a')](_0x79d8('0x42'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x3b')]('openchannel'));router[_0x79d8('0x7')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0x79d8('0x43')]);router['post'](_0x79d8('0x44'),auth['isAuthenticated'](),controller['queueNotify'](_0x79d8('0x45')));router[_0x79d8('0x7')](_0x79d8('0x46'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x47')]);router[_0x79d8('0x3a')](_0x79d8('0x48'),auth[_0x79d8('0x9')](),controller[_0x79d8('0x49')]);module[_0x79d8('0x4a')]=router; \ No newline at end of file +var _0x3e33=['outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','queueNotify','mail','/mail/queues/:id','post','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','agentNotify','exports','multer','path','../../components/auth/service','./rpc.controller','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x3e33,0x137));var _0x33e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e33[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x33e3('0x0'));var util=require('util');var path=require(_0x33e3('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x33e3('0x2'));var controller=require(_0x33e3('0x3'));router['get']('/voice/channels',auth['isAuthenticated'](),controller['voiceChannels']);router[_0x33e3('0x4')](_0x33e3('0x5'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x7')]);router[_0x33e3('0x4')](_0x33e3('0x8'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x9')]);router[_0x33e3('0x4')]('/voice/queues',auth[_0x33e3('0x6')](),controller[_0x33e3('0xa')]);router[_0x33e3('0x4')](_0x33e3('0xb'),auth[_0x33e3('0x6')](),controller[_0x33e3('0xc')]);router[_0x33e3('0x4')](_0x33e3('0xd'),auth[_0x33e3('0x6')](),controller['mailQueues']);router[_0x33e3('0x4')]('/mail/accounts',auth[_0x33e3('0x6')](),controller['mailAccounts']);router[_0x33e3('0x4')](_0x33e3('0xe'),auth['isAuthenticated'](),controller[_0x33e3('0xf')]);router[_0x33e3('0x4')](_0x33e3('0x10'),auth['isAuthenticated'](),controller[_0x33e3('0x11')]);router[_0x33e3('0x4')](_0x33e3('0x12'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x13')]);router['get']('/voice/queues/preview/:id',auth[_0x33e3('0x6')](),controller['voiceQueuesPreview']);router[_0x33e3('0x4')](_0x33e3('0x14'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x15')]);router[_0x33e3('0x4')](_0x33e3('0x16'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x17')]);router[_0x33e3('0x4')](_0x33e3('0x18'),auth[_0x33e3('0x6')](),controller['voiceQueuesChannelHangup']);router['get'](_0x33e3('0x19'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x1a')]);router[_0x33e3('0x4')](_0x33e3('0x1b'),auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x33e3('0x4')](_0x33e3('0x1c'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x1d')]);router['get']('/outbound/channels',auth[_0x33e3('0x6')](),controller[_0x33e3('0x1e')]);router[_0x33e3('0x4')](_0x33e3('0x1f'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x20')]);router['put'](_0x33e3('0x21'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x22')]);router[_0x33e3('0x4')](_0x33e3('0x23'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x24')]);router['get'](_0x33e3('0x25'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x26')]);router['get'](_0x33e3('0x27'),auth['isAuthenticated'](),controller[_0x33e3('0x28')]);router[_0x33e3('0x4')]('/fax/accounts',auth[_0x33e3('0x6')](),controller[_0x33e3('0x29')]);router[_0x33e3('0x4')](_0x33e3('0x2a'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x2b')]);router['get']('/mail/queues/waitinginteractions',auth[_0x33e3('0x6')](),controller[_0x33e3('0x2c')]);router[_0x33e3('0x4')]('/openchannel/queues/waitinginteractions',auth[_0x33e3('0x6')](),controller[_0x33e3('0x2d')]);router[_0x33e3('0x4')](_0x33e3('0x2e'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x2f')]);router[_0x33e3('0x4')](_0x33e3('0x30'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x31')]);router['post']('/mail/queues/:id/notify',auth[_0x33e3('0x6')](),controller[_0x33e3('0x32')](_0x33e3('0x33')));router[_0x33e3('0x4')](_0x33e3('0x34'),auth[_0x33e3('0x6')](),controller['showMailQueues']);router[_0x33e3('0x35')]('/chat/queues/:id/notify',auth[_0x33e3('0x6')](),controller['queueNotify'](_0x33e3('0x36')));router[_0x33e3('0x4')](_0x33e3('0x37'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x38')]);router[_0x33e3('0x35')](_0x33e3('0x39'),auth['isAuthenticated'](),controller[_0x33e3('0x32')](_0x33e3('0x3a')));router[_0x33e3('0x4')](_0x33e3('0x3b'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x3c')]);router[_0x33e3('0x35')](_0x33e3('0x3d'),auth[_0x33e3('0x6')](),controller['queueNotify']('openchannel'));router['get'](_0x33e3('0x3e'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x3f')]);router[_0x33e3('0x35')](_0x33e3('0x40'),auth[_0x33e3('0x6')](),controller[_0x33e3('0x32')](_0x33e3('0x41')));router['get']('/sms/queues/:id',auth[_0x33e3('0x6')](),controller['showSmsQueues']);router[_0x33e3('0x35')]('/agents/:id/notify',auth[_0x33e3('0x6')](),controller[_0x33e3('0x42')]);module[_0x33e3('0x43')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 1ea789b..e895813 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 _0x9f26=['Agent\x20not\x20found','MessageId','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','status','stack','name','send','isNil','rows','find','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','user','interaction','hasOwnProperty','MemberReport','length','updateAttributes','INTERACTION','interface','format','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','queueNotify','chat','Website','Account','Message','findOne','messageId','\x20Message\x20not\x20found','Interaction','InteractionId','From','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','User'];(function(_0x268624,_0x3f1032){var _0x18faf4=function(_0x33cc11){while(--_0x33cc11){_0x268624['push'](_0x268624['shift']());}};_0x18faf4(++_0x3f1032);}(_0x9f26,0xe5));var _0x69f2=function(_0x4f7786,_0x4ffc01){_0x4f7786=_0x4f7786-0x0;var _0x42fbb9=_0x9f26[_0x4f7786];return _0x42fbb9;};'use strict';var BPromise=require(_0x69f2('0x0'));var moment=require(_0x69f2('0x1'));var _=require('lodash');var util=require(_0x69f2('0x2'));var db=require(_0x69f2('0x3'))['db'];var logger=require(_0x69f2('0x4'))(_0x69f2('0x5'));var jayson=require(_0x69f2('0x6'));var amiClient=jayson['client'][_0x69f2('0x7')]({'port':0x232a});var mailClient=jayson[_0x69f2('0x8')][_0x69f2('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0x69f2('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x295746,_0x9fb1bb,_0x396c3f){return new BPromise(function(_0x254633,_0x1f0837){var _0xac0fe8=_0x396c3f?_0x396c3f:amiClient;return _0xac0fe8[_0x69f2('0x9')](_0x295746,_0x9fb1bb)[_0x69f2('0xa')](function(_0x1df263){if(_0x1df263[_0x69f2('0xb')]){if(_0x1df263[_0x69f2('0xb')][_0x69f2('0xc')]===0x1f4){return _0x1f0837(_0x1df263[_0x69f2('0xb')][_0x69f2('0xd')]);}return _0x254633(_0x1df263['error'][_0x69f2('0xd')]);}else{_0x254633(_0x1df263[_0x69f2('0xe')]);}})[_0x69f2('0xf')](function(_0x3281ae){_0x1f0837(_0x3281ae);});});}function respondWithResult(_0x597e05,_0x235b21){_0x235b21=_0x235b21||0xc8;return function(_0x5978ef){if(_0x5978ef){return _0x597e05[_0x69f2('0x10')](_0x235b21)['json'](_0x5978ef);}return _0x597e05['sendStatus'](0x194);};}function handleError(_0x595fb5,_0x35bf26){_0x35bf26=_0x35bf26||0x1f4;return function(_0x25aeb9){logger[_0x69f2('0xb')](_0x25aeb9[_0x69f2('0x11')]);if(_0x25aeb9[_0x69f2('0x12')]){delete _0x25aeb9[_0x69f2('0x12')];}_0x595fb5[_0x69f2('0x10')](_0x35bf26)[_0x69f2('0x13')](_0x25aeb9);};}function findById(_0x6ac365){return function(_0x2a48f3){if(!_[_0x69f2('0x14')](_0x6ac365)&&!_['isNil'](_0x2a48f3)&&!_['isNil'](_0x2a48f3[_0x69f2('0x15')])){return _[_0x69f2('0x16')](_0x2a48f3['rows'],function(_0x1551df){return _0x1551df['id']==_0x6ac365;});}return null;};}exports['voiceChannels']=function(_0x5bf4e7,_0x4f6bf7){return respondWithRpcPromise(_0x69f2('0x17'),_0x5bf4e7[_0x69f2('0x18')])[_0x69f2('0xa')](respondWithResult(_0x4f6bf7,null))['catch'](handleError(_0x4f6bf7,null));};exports[_0x69f2('0x19')]=function(_0x8f92f3,_0x50ada1){return respondWithRpcPromise(_0x69f2('0x1a'),_['merge'](_0x8f92f3[_0x69f2('0x18')],_0x8f92f3[_0x69f2('0x1b')]))[_0x69f2('0xa')](respondWithResult(_0x50ada1,null))['catch'](handleError(_0x50ada1,null));};exports['voiceChannelStopMixMonitor']=function(_0x340d11,_0x2456ab){return respondWithRpcPromise(_0x69f2('0x1c'),_[_0x69f2('0x1d')](_0x340d11[_0x69f2('0x18')],_0x340d11['params']))['then'](respondWithResult(_0x2456ab,null))['catch'](handleError(_0x2456ab,null));};exports[_0x69f2('0x1e')]=function(_0x425467,_0x502a79){return respondWithRpcPromise(_0x69f2('0x1f'),_0x425467['query'])[_0x69f2('0xa')](respondWithResult(_0x502a79,null))[_0x69f2('0xf')](handleError(_0x502a79,null));};exports['showVoiceQueues']=function(_0x5aad8d,_0x13f916){return respondWithRpcPromise('VoiceQueues',_0x5aad8d[_0x69f2('0x18')])[_0x69f2('0xa')](findById(_0x5aad8d[_0x69f2('0x1b')]['id']))[_0x69f2('0xa')](respondWithResult(_0x13f916,null))[_0x69f2('0xf')](handleError(_0x13f916,null));};exports[_0x69f2('0x20')]=function(_0x3c0651,_0x29c46a){return respondWithRpcPromise(_0x69f2('0x21'),_['merge'](_0x3c0651[_0x69f2('0x18')],_0x3c0651['params']))[_0x69f2('0xa')](respondWithResult(_0x29c46a,null))[_0x69f2('0xf')](handleError(_0x29c46a,null));};exports['voiceQueuesChannels']=function(_0x4bb66c,_0x2cb443){return respondWithRpcPromise(_0x69f2('0x22'),_0x4bb66c[_0x69f2('0x18')])[_0x69f2('0xa')](respondWithResult(_0x2cb443,null))['catch'](handleError(_0x2cb443,null));};exports[_0x69f2('0x23')]=function(_0x118eb1,_0x29dbe2){return respondWithRpcPromise(_0x69f2('0x24'),_[_0x69f2('0x1d')](_0x118eb1['query'],_0x118eb1[_0x69f2('0x1b')]))[_0x69f2('0xa')](respondWithResult(_0x29dbe2,null))['catch'](handleError(_0x29dbe2,null));};exports[_0x69f2('0x25')]=function(_0x5ab0fd,_0x2fae25){return respondWithRpcPromise(_0x69f2('0x26'),_['merge'](_0x5ab0fd[_0x69f2('0x18')],_0x5ab0fd[_0x69f2('0x1b')]))[_0x69f2('0xa')](respondWithResult(_0x2fae25,null))[_0x69f2('0xf')](handleError(_0x2fae25,null));};exports[_0x69f2('0x27')]=function(_0x37c5a1,_0x1033ee){return respondWithRpcPromise(_0x69f2('0x28'),_['merge'](_0x37c5a1[_0x69f2('0x18')],_0x37c5a1[_0x69f2('0x1b')]))[_0x69f2('0xa')](respondWithResult(_0x1033ee,null))[_0x69f2('0xf')](handleError(_0x1033ee,null));};exports['outbound']=function(_0x4ecb2d,_0x440209){return respondWithRpcPromise(_0x69f2('0x29'),_0x4ecb2d[_0x69f2('0x18')])[_0x69f2('0xa')](respondWithResult(_0x440209,null))[_0x69f2('0xf')](handleError(_0x440209,null));};exports[_0x69f2('0x2a')]=function(_0x369201,_0x3df784){return respondWithRpcPromise(_0x69f2('0x2b'),_0x369201[_0x69f2('0x18')])[_0x69f2('0xa')](respondWithResult(_0x3df784,null))['catch'](handleError(_0x3df784,null));};exports[_0x69f2('0x2c')]=function(_0x1769ff,_0x12bf4d){var _0x13a6d7;return respondWithRpcPromise(_0x69f2('0x2d'),_0x1769ff[_0x69f2('0x18')])[_0x69f2('0xa')](function(_0x3f1df7){_0x13a6d7=_0x3f1df7;return respondWithRpcPromise(_0x69f2('0x2d'),_0x1769ff[_0x69f2('0x18')],routingClient);})[_0x69f2('0xa')](function(_0x254060){return _[_0x69f2('0x1d')]({},_0x254060,_0x13a6d7);})[_0x69f2('0xa')](respondWithResult(_0x12bf4d,null))['catch'](handleError(_0x12bf4d,null));};exports['agentCapacity']=function(_0x482cc2,_0xcd6905){if(_0x482cc2[_0x69f2('0x2e')]&&_0x482cc2[_0x69f2('0x2e')]['interaction']&&_0x482cc2[_0x69f2('0x2f')]&&_0x482cc2[_0x69f2('0x2f')][_0x69f2('0x12')]){for(var _0x4806d8 in _0x482cc2[_0x69f2('0x2e')][_0x69f2('0x30')]){if(_0x482cc2[_0x69f2('0x2e')]['interaction'][_0x69f2('0x31')](_0x4806d8)){db[_0x69f2('0x32')]['findAll']({'where':{'channel':_0x4806d8,'membername':_0x482cc2[_0x69f2('0x2f')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x482cc2[_0x69f2('0x2e')][_0x69f2('0x30')][_0x4806d8]&&_0x482cc2[_0x69f2('0x2e')][_0x69f2('0x30')][_0x4806d8][_0x69f2('0x33')]?{'$notIn':_0x482cc2[_0x69f2('0x2e')][_0x69f2('0x30')][_0x4806d8]}:{'$ne':null}}})[_0x69f2('0xa')](function(_0x57b630){var _0x4f3bd9=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x345b34=0x0,_0x512689=_0x57b630[_0x69f2('0x33')];_0x345b34<_0x512689;_0x345b34+=0x1){_0x57b630[_0x345b34][_0x69f2('0x34')]({'exitAt':_0x4f3bd9});}});for(var _0x23a30f=0x0;_0x23a30f<_0x482cc2[_0x69f2('0x2e')][_0x69f2('0x30')][_0x4806d8]['length'];_0x23a30f+=0x1){db[_0x69f2('0x32')]['findOrCreate']({'where':{'channel':_0x4806d8,'membername':_0x482cc2[_0x69f2('0x2f')][_0x69f2('0x12')],'type':_0x69f2('0x35'),'uniqueid':_0x482cc2[_0x69f2('0x2e')]['interaction'][_0x4806d8][_0x23a30f],'exitAt':null},'defaults':{'channel':_0x4806d8,'membername':_0x482cc2[_0x69f2('0x2f')][_0x69f2('0x12')],'interface':_[_0x69f2('0x14')](_0x482cc2[_0x69f2('0x2f')][_0x69f2('0x36')])?util[_0x69f2('0x37')]('SIP/%s',_0x482cc2[_0x69f2('0x2f')][_0x69f2('0x12')]):_0x482cc2[_0x69f2('0x2f')][_0x69f2('0x36')],'type':'INTERACTION','enterAt':moment()[_0x69f2('0x37')](_0x69f2('0x38')),'role':_0x69f2('0x39'),'internal':_0x482cc2[_0x69f2('0x2f')][_0x69f2('0x3a')],'uniqueid':_0x482cc2[_0x69f2('0x2e')]['interaction'][_0x4806d8][_0x23a30f]}});}}}}return respondWithRpcPromise(_0x69f2('0x3b'),{'id':_0x482cc2[_0x69f2('0x1b')]['id'],'capacity':_0x482cc2[_0x69f2('0x2e')][_0x69f2('0x3c')]},routingClient)[_0x69f2('0xa')](respondWithResult(_0xcd6905,null))['catch'](handleError(_0xcd6905,null));};exports[_0x69f2('0x3d')]=function(_0x17c36d,_0x1abb20){return respondWithRpcPromise('Telephones',_0x17c36d['query'])[_0x69f2('0xa')](respondWithResult(_0x1abb20,null))[_0x69f2('0xf')](handleError(_0x1abb20,null));};exports['trunks']=function(_0x458b71,_0x19c8eb){return respondWithRpcPromise(_0x69f2('0x3e'),_0x458b71[_0x69f2('0x18')])[_0x69f2('0xa')](respondWithResult(_0x19c8eb,null))['catch'](handleError(_0x19c8eb,null));};exports[_0x69f2('0x3f')]=function(_0x1552b8,_0x5c78d2){return respondWithRpcPromise('Campaigns',_0x1552b8['query'])[_0x69f2('0xa')](respondWithResult(_0x5c78d2,null))[_0x69f2('0xf')](handleError(_0x5c78d2,null));};exports[_0x69f2('0x40')]=function(_0x37dd2b,_0x26f5f9){return respondWithRpcPromise(_0x69f2('0x41'),_0x37dd2b[_0x69f2('0x18')],routingClient)[_0x69f2('0xa')](respondWithResult(_0x26f5f9,null))[_0x69f2('0xf')](handleError(_0x26f5f9,null));};exports[_0x69f2('0x42')]=function(_0xb68d0f,_0x389f18){return respondWithRpcPromise(_0x69f2('0x41'),_0xb68d0f[_0x69f2('0x18')],routingClient)[_0x69f2('0xa')](findById(_0xb68d0f[_0x69f2('0x1b')]['id']))[_0x69f2('0xa')](respondWithResult(_0x389f18,null))[_0x69f2('0xf')](handleError(_0x389f18,null));};exports['mailQueues']=function(_0x14b11a,_0x294115){return respondWithRpcPromise(_0x69f2('0x43'),_0x14b11a[_0x69f2('0x18')],routingClient)['then'](respondWithResult(_0x294115,null))['catch'](handleError(_0x294115,null));};exports[_0x69f2('0x44')]=function(_0x1e664d,_0x5b2361){return respondWithRpcPromise('MailQueues',_0x1e664d[_0x69f2('0x18')],routingClient)[_0x69f2('0xa')](findById(_0x1e664d[_0x69f2('0x1b')]['id']))[_0x69f2('0xa')](respondWithResult(_0x5b2361,null))[_0x69f2('0xf')](handleError(_0x5b2361,null));};exports[_0x69f2('0x45')]=function(_0x520340,_0x52d50d){return respondWithRpcPromise(_0x69f2('0x46'),_0x520340[_0x69f2('0x18')],mailClient)[_0x69f2('0xa')](respondWithResult(_0x52d50d,null))[_0x69f2('0xf')](handleError(_0x52d50d,null));};exports[_0x69f2('0x47')]=function(_0x18dfa4,_0x103009){return respondWithRpcPromise(_0x69f2('0x48'),_0x18dfa4[_0x69f2('0x18')],routingClient)[_0x69f2('0xa')](respondWithResult(_0x103009,null))[_0x69f2('0xf')](handleError(_0x103009,null));};exports[_0x69f2('0x49')]=function(_0x47fe55,_0x30dd77){return respondWithRpcPromise(_0x69f2('0x48'),_0x47fe55['query'],routingClient)[_0x69f2('0xa')](findById(_0x47fe55[_0x69f2('0x1b')]['id']))[_0x69f2('0xa')](respondWithResult(_0x30dd77,null))['catch'](handleError(_0x30dd77,null));};exports[_0x69f2('0x4a')]=function(_0x20318f,_0x5ce8ae){return respondWithRpcPromise(_0x69f2('0x4b'),_0x20318f[_0x69f2('0x18')],routingClient)[_0x69f2('0xa')](respondWithResult(_0x5ce8ae,null))[_0x69f2('0xf')](handleError(_0x5ce8ae,null));};exports[_0x69f2('0x4c')]=function(_0x361b33,_0x52d75d){return respondWithRpcPromise(_0x69f2('0x4b'),_0x361b33['query'],routingClient)[_0x69f2('0xa')](findById(_0x361b33[_0x69f2('0x1b')]['id']))['then'](respondWithResult(_0x52d75d,null))['catch'](handleError(_0x52d75d,null));};exports[_0x69f2('0x4d')]=function(_0x3221f3,_0x28fdc9){return respondWithRpcPromise(_0x69f2('0x4e'),_0x3221f3[_0x69f2('0x18')],routingClient)[_0x69f2('0xa')](respondWithResult(_0x28fdc9,null))['catch'](handleError(_0x28fdc9,null));};exports[_0x69f2('0x4f')]=function(_0x8e88cd,_0x5ed715){return respondWithRpcPromise(_0x69f2('0x4e'),_0x8e88cd[_0x69f2('0x18')],routingClient)[_0x69f2('0xa')](findById(_0x8e88cd[_0x69f2('0x1b')]['id']))[_0x69f2('0xa')](respondWithResult(_0x5ed715,null))['catch'](handleError(_0x5ed715,null));};exports[_0x69f2('0x50')]=function(_0x55b259,_0x1071d3){return respondWithRpcPromise(_0x69f2('0x51'),_0x55b259[_0x69f2('0x18')])[_0x69f2('0xa')](respondWithResult(_0x1071d3,null))[_0x69f2('0xf')](handleError(_0x1071d3,null));};exports[_0x69f2('0x52')]=function(_0x594ee8,_0x19e0bf){return respondWithRpcPromise(_0x69f2('0x53'),_0x594ee8[_0x69f2('0x18')],routingClient)[_0x69f2('0xa')](respondWithResult(_0x19e0bf,null))[_0x69f2('0xf')](handleError(_0x19e0bf,null));};exports[_0x69f2('0x54')]=function(_0xea9ec9,_0x481dd0){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0xea9ec9[_0x69f2('0x18')],routingClient)[_0x69f2('0xa')](respondWithResult(_0x481dd0,null))['catch'](handleError(_0x481dd0,null));};exports[_0x69f2('0x55')]=function(_0x3a8e37,_0x13db20){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x3a8e37[_0x69f2('0x18')],routingClient)['then'](respondWithResult(_0x13db20,null))[_0x69f2('0xf')](handleError(_0x13db20,null));};exports[_0x69f2('0x56')]=function(_0x1fd509,_0x1d5e50){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x1fd509['query'],routingClient)['then'](respondWithResult(_0x1d5e50,null))[_0x69f2('0xf')](handleError(_0x1d5e50,null));};exports['faxQueuesWaitingInteractions']=function(_0x35b8ef,_0x15fbd3){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x35b8ef['query'],routingClient)['then'](respondWithResult(_0x15fbd3,null))['catch'](handleError(_0x15fbd3,null));};exports[_0x69f2('0x57')]=function(_0x926f){return function(_0x599c1d,_0x297068){var _0x57a2b0,_0xd1ee6;var _0x491b73=_['capitalize'](_0x926f);var _0x387007=_0x926f===_0x69f2('0x58')?_0x69f2('0x59'):_0x69f2('0x5a');return db[_0x491b73+'Queue']['findOne']({'raw':!![],'where':{'id':_0x599c1d[_0x69f2('0x1b')]['id']}})[_0x69f2('0xa')](function(_0x17f892){if(_[_0x69f2('0x14')](_0x17f892)){throw new Error(_0x491b73+'\x20Queue\x20not\x20found');}_0x57a2b0=_0x17f892;return db[_0x491b73+_0x69f2('0x5b')][_0x69f2('0x5c')]({'where':{'id':_0x599c1d['body'][_0x69f2('0x5d')]},'include':[{'model':db[_0x491b73+'Interaction'],'as':'Interaction'},{'model':db[_0x491b73+_0x387007],'as':'Account'}]});})['then'](function(_0x19008b){if(_[_0x69f2('0x14')](_0x19008b)){throw new Error(_0x491b73+_0x69f2('0x5e'));}_0xd1ee6=_0x19008b;return _0x19008b['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x69f2('0xa')](function(){var _0x137668={'uniqueid':_0x926f+'.'+_0xd1ee6['id']+'.'+_0xd1ee6[_0x69f2('0x5f')]['id'],'FromUserId':_0x599c1d[_0x69f2('0x2f')]['id'],'type':'queue'};_0x137668[_0x491b73+'MessageId']=_0xd1ee6['id'];_0x137668[_0x491b73+_0x69f2('0x60')]=_0xd1ee6[_0x69f2('0x5f')]['id'];_0x137668[_0x69f2('0x61')+_0x491b73+_0x387007+'Id']=_0xd1ee6[_0x69f2('0x5a')]['id'];_0x137668['To'+_0x491b73+_0x69f2('0x62')]=_0x57a2b0['id'];return db[_0x491b73+_0x69f2('0x63')][_0x69f2('0x64')](_0x137668);})[_0x69f2('0xa')](function(){return respondWithRpcPromise(_0x69f2('0x65'),{'channel':_0x926f,'interaction':_0xd1ee6[_0x69f2('0x5f')],'message':_0xd1ee6,'account':_0xd1ee6['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x69f2('0x66'),'appdata':_0x57a2b0[_0x69f2('0x12')]+','+(_0xd1ee6[_0x69f2('0x5a')][_0x69f2('0x67')]||0x12c),'interval':_0x69f2('0x68')}]},routingClient);})[_0x69f2('0xa')](respondWithResult(_0x297068,null))[_0x69f2('0xf')](handleError(_0x297068,null));};};exports[_0x69f2('0x69')]=function(_0x246da3,_0x378d05){var _0x7611c2,_0x127975;if(_['isNil'](_0x246da3['body'][_0x69f2('0x6a')])){throw new Error(_0x69f2('0x6b'));}var _0x2e25f7=_0x246da3['body'][_0x69f2('0x6a')];var _0x327ed7=_[_0x69f2('0x6c')](_0x2e25f7);var _0x3fde45=_0x2e25f7===_0x69f2('0x58')?_0x69f2('0x59'):_0x69f2('0x5a');return db[_0x69f2('0x6d')][_0x69f2('0x5c')]({'raw':!![],'where':{'id':_0x246da3[_0x69f2('0x1b')]['id'],'role':_0x69f2('0x39')}})['then'](function(_0x3c4d36){if(_[_0x69f2('0x14')](_0x3c4d36)){throw new Error(_0x69f2('0x6e'));}_0x7611c2=_0x3c4d36;return db[_0x327ed7+_0x69f2('0x5b')][_0x69f2('0x5c')]({'where':{'id':_0x246da3['body'][_0x69f2('0x5d')]},'include':[{'model':db[_0x327ed7+_0x69f2('0x5f')],'as':'Interaction'},{'model':db[_0x327ed7+_0x3fde45],'as':_0x69f2('0x5a')}]});})[_0x69f2('0xa')](function(_0x1f2e8d){if(_[_0x69f2('0x14')](_0x1f2e8d)){throw new Error(_0x327ed7+'\x20Message\x20not\x20found');}_0x127975=_0x1f2e8d;return _0x1f2e8d['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x69f2('0xa')](function(){var _0x55ba6b={'uniqueid':_0x2e25f7+'.'+_0x127975['id']+'.'+_0x127975[_0x69f2('0x5f')]['id'],'FromUserId':_0x246da3[_0x69f2('0x2f')]['id'],'type':_0x69f2('0x66'),'ToUserId':_0x7611c2['id']};_0x55ba6b[_0x327ed7+_0x69f2('0x6f')]=_0x127975['id'];_0x55ba6b[_0x327ed7+_0x69f2('0x60')]=_0x127975['Interaction']['id'];_0x55ba6b[_0x69f2('0x61')+_0x327ed7+_0x3fde45+'Id']=_0x127975[_0x69f2('0x5a')]['id'];return db[_0x327ed7+'TransferReport'][_0x69f2('0x64')](_0x55ba6b);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x2e25f7,'interaction':_0x127975[_0x69f2('0x5f')],'message':_0x127975,'account':_0x127975[_0x69f2('0x5a')],'applications':[{'id':0x0,'priority':0x1,'app':_0x69f2('0x39'),'appdata':_0x7611c2[_0x69f2('0x12')]+','+(_0x127975['Account'][_0x69f2('0x70')]||0x12c),'interval':_0x69f2('0x68')}]},routingClient);})['then'](respondWithResult(_0x378d05,null))[_0x69f2('0xf')](handleError(_0x378d05,null));}; \ No newline at end of file +var _0x18a7=['\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','Agent\x20not\x20found','Message','agentTransferTimeout','bluebird','lodash','util','../../config/logger','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','stack','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','params','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','name','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','chatQueues','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','Account'];(function(_0x437a21,_0x3bcbd6){var _0x490f61=function(_0x57f395){while(--_0x57f395){_0x437a21['push'](_0x437a21['shift']());}};_0x490f61(++_0x3bcbd6);}(_0x18a7,0x104));var _0x718a=function(_0x204cd8,_0x16d4f1){_0x204cd8=_0x204cd8-0x0;var _0x2f6fca=_0x18a7[_0x204cd8];return _0x2f6fca;};'use strict';var BPromise=require(_0x718a('0x0'));var moment=require('moment');var _=require(_0x718a('0x1'));var util=require(_0x718a('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x718a('0x3'))('api');var jayson=require(_0x718a('0x4'));var amiClient=jayson[_0x718a('0x5')][_0x718a('0x6')]({'port':0x232a});var mailClient=jayson[_0x718a('0x5')][_0x718a('0x6')]({'port':0x232b});var routingClient=jayson[_0x718a('0x5')][_0x718a('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x2d16a3,_0x228050,_0x1e1c60){return new BPromise(function(_0x7f131,_0x11c57c){var _0x1615ae=_0x1e1c60?_0x1e1c60:amiClient;return _0x1615ae[_0x718a('0x7')](_0x2d16a3,_0x228050)[_0x718a('0x8')](function(_0x25a06d){if(_0x25a06d['error']){if(_0x25a06d[_0x718a('0x9')]['code']===0x1f4){return _0x11c57c(_0x25a06d[_0x718a('0x9')][_0x718a('0xa')]);}return _0x7f131(_0x25a06d[_0x718a('0x9')][_0x718a('0xa')]);}else{_0x7f131(_0x25a06d[_0x718a('0xb')]);}})[_0x718a('0xc')](function(_0x45e658){_0x11c57c(_0x45e658);});});}function respondWithResult(_0x113dd4,_0x27a4e9){_0x27a4e9=_0x27a4e9||0xc8;return function(_0x5a6102){if(_0x5a6102){return _0x113dd4[_0x718a('0xd')](_0x27a4e9)[_0x718a('0xe')](_0x5a6102);}return _0x113dd4[_0x718a('0xf')](0x194);};}function handleError(_0x3663e1,_0x930de1){_0x930de1=_0x930de1||0x1f4;return function(_0x1cec4b){logger[_0x718a('0x9')](_0x1cec4b[_0x718a('0x10')]);if(_0x1cec4b['name']){delete _0x1cec4b['name'];}_0x3663e1[_0x718a('0xd')](_0x930de1)[_0x718a('0x11')](_0x1cec4b);};}function findById(_0x461701){return function(_0x1da22c){if(!_[_0x718a('0x12')](_0x461701)&&!_[_0x718a('0x12')](_0x1da22c)&&!_[_0x718a('0x12')](_0x1da22c[_0x718a('0x13')])){return _['find'](_0x1da22c[_0x718a('0x13')],function(_0x302b79){return _0x302b79['id']==_0x461701;});}return null;};}exports[_0x718a('0x14')]=function(_0x513bf1,_0x12b0f2){return respondWithRpcPromise(_0x718a('0x15'),_0x513bf1[_0x718a('0x16')])[_0x718a('0x8')](respondWithResult(_0x12b0f2,null))[_0x718a('0xc')](handleError(_0x12b0f2,null));};exports[_0x718a('0x17')]=function(_0x5ec6a8,_0x5d4007){return respondWithRpcPromise(_0x718a('0x18'),_[_0x718a('0x19')](_0x5ec6a8[_0x718a('0x16')],_0x5ec6a8['params']))[_0x718a('0x8')](respondWithResult(_0x5d4007,null))[_0x718a('0xc')](handleError(_0x5d4007,null));};exports[_0x718a('0x1a')]=function(_0x38d5ac,_0x3396ce){return respondWithRpcPromise(_0x718a('0x1b'),_[_0x718a('0x19')](_0x38d5ac['query'],_0x38d5ac['params']))[_0x718a('0x8')](respondWithResult(_0x3396ce,null))['catch'](handleError(_0x3396ce,null));};exports[_0x718a('0x1c')]=function(_0x3daafe,_0x1f393b){return respondWithRpcPromise(_0x718a('0x1d'),_0x3daafe[_0x718a('0x16')])['then'](respondWithResult(_0x1f393b,null))['catch'](handleError(_0x1f393b,null));};exports[_0x718a('0x1e')]=function(_0x1d225d,_0xc523e4){return respondWithRpcPromise('VoiceQueues',_0x1d225d[_0x718a('0x16')])[_0x718a('0x8')](findById(_0x1d225d['params']['id']))['then'](respondWithResult(_0xc523e4,null))[_0x718a('0xc')](handleError(_0xc523e4,null));};exports[_0x718a('0x1f')]=function(_0x2c73c5,_0x4bc6dc){return respondWithRpcPromise(_0x718a('0x20'),_[_0x718a('0x19')](_0x2c73c5['query'],_0x2c73c5['params']))[_0x718a('0x8')](respondWithResult(_0x4bc6dc,null))[_0x718a('0xc')](handleError(_0x4bc6dc,null));};exports[_0x718a('0x21')]=function(_0x309c6e,_0x46c128){return respondWithRpcPromise(_0x718a('0x22'),_0x309c6e[_0x718a('0x16')])[_0x718a('0x8')](respondWithResult(_0x46c128,null))[_0x718a('0xc')](handleError(_0x46c128,null));};exports[_0x718a('0x23')]=function(_0x517141,_0x4c6591){return respondWithRpcPromise(_0x718a('0x24'),_[_0x718a('0x19')](_0x517141[_0x718a('0x16')],_0x517141[_0x718a('0x25')]))[_0x718a('0x8')](respondWithResult(_0x4c6591,null))[_0x718a('0xc')](handleError(_0x4c6591,null));};exports['voiceQueuesChannelHangup']=function(_0x1801cd,_0x4e186f){return respondWithRpcPromise(_0x718a('0x26'),_['merge'](_0x1801cd[_0x718a('0x16')],_0x1801cd[_0x718a('0x25')]))['then'](respondWithResult(_0x4e186f,null))[_0x718a('0xc')](handleError(_0x4e186f,null));};exports[_0x718a('0x27')]=function(_0x35ab48,_0x8e07b5){return respondWithRpcPromise(_0x718a('0x28'),_['merge'](_0x35ab48[_0x718a('0x16')],_0x35ab48[_0x718a('0x25')]))[_0x718a('0x8')](respondWithResult(_0x8e07b5,null))['catch'](handleError(_0x8e07b5,null));};exports[_0x718a('0x29')]=function(_0x54e929,_0x2de879){return respondWithRpcPromise(_0x718a('0x2a'),_0x54e929['query'])[_0x718a('0x8')](respondWithResult(_0x2de879,null))['catch'](handleError(_0x2de879,null));};exports['outboundChannels']=function(_0x12e0c8,_0x2009c0){return respondWithRpcPromise(_0x718a('0x2b'),_0x12e0c8['query'])[_0x718a('0x8')](respondWithResult(_0x2009c0,null))['catch'](handleError(_0x2009c0,null));};exports[_0x718a('0x2c')]=function(_0xf0e6d7,_0x39c790){var _0x5c4350;return respondWithRpcPromise('Agents',_0xf0e6d7['query'])[_0x718a('0x8')](function(_0x4232ad){_0x5c4350=_0x4232ad;return respondWithRpcPromise(_0x718a('0x2d'),_0xf0e6d7['query'],routingClient);})['then'](function(_0x9766fa){return _[_0x718a('0x19')]({},_0x9766fa,_0x5c4350);})[_0x718a('0x8')](respondWithResult(_0x39c790,null))['catch'](handleError(_0x39c790,null));};exports[_0x718a('0x2e')]=function(_0x465678,_0x278bf9){if(_0x465678['body']&&_0x465678[_0x718a('0x2f')][_0x718a('0x30')]&&_0x465678[_0x718a('0x31')]&&_0x465678[_0x718a('0x31')][_0x718a('0x32')]){for(var _0x57a926 in _0x465678[_0x718a('0x2f')]['interaction']){if(_0x465678[_0x718a('0x2f')][_0x718a('0x30')][_0x718a('0x33')](_0x57a926)){db[_0x718a('0x34')][_0x718a('0x35')]({'where':{'channel':_0x57a926,'membername':_0x465678[_0x718a('0x31')][_0x718a('0x32')],'type':_0x718a('0x36'),'exitAt':null,'uniqueid':_0x465678['body'][_0x718a('0x30')][_0x57a926]&&_0x465678[_0x718a('0x2f')]['interaction'][_0x57a926][_0x718a('0x37')]?{'$notIn':_0x465678['body'][_0x718a('0x30')][_0x57a926]}:{'$ne':null}}})[_0x718a('0x8')](function(_0x542ece){var _0x125b16=moment()[_0x718a('0x38')](_0x718a('0x39'));for(var _0x54ef50=0x0,_0x4720f7=_0x542ece['length'];_0x54ef50<_0x4720f7;_0x54ef50+=0x1){_0x542ece[_0x54ef50][_0x718a('0x3a')]({'exitAt':_0x125b16});}});for(var _0x3249fe=0x0;_0x3249fe<_0x465678[_0x718a('0x2f')][_0x718a('0x30')][_0x57a926]['length'];_0x3249fe+=0x1){db[_0x718a('0x34')][_0x718a('0x3b')]({'where':{'channel':_0x57a926,'membername':_0x465678[_0x718a('0x31')][_0x718a('0x32')],'type':_0x718a('0x36'),'uniqueid':_0x465678[_0x718a('0x2f')]['interaction'][_0x57a926][_0x3249fe],'exitAt':null},'defaults':{'channel':_0x57a926,'membername':_0x465678[_0x718a('0x31')][_0x718a('0x32')],'interface':_[_0x718a('0x12')](_0x465678[_0x718a('0x31')][_0x718a('0x3c')])?util[_0x718a('0x38')](_0x718a('0x3d'),_0x465678['user'][_0x718a('0x32')]):_0x465678['user'][_0x718a('0x3c')],'type':_0x718a('0x36'),'enterAt':moment()[_0x718a('0x38')](_0x718a('0x39')),'role':_0x718a('0x3e'),'internal':_0x465678[_0x718a('0x31')][_0x718a('0x3f')],'uniqueid':_0x465678[_0x718a('0x2f')][_0x718a('0x30')][_0x57a926][_0x3249fe]}});}}}}return respondWithRpcPromise(_0x718a('0x40'),{'id':_0x465678[_0x718a('0x25')]['id'],'capacity':_0x465678[_0x718a('0x2f')][_0x718a('0x41')]},routingClient)[_0x718a('0x8')](respondWithResult(_0x278bf9,null))['catch'](handleError(_0x278bf9,null));};exports[_0x718a('0x42')]=function(_0x9509bb,_0x2c6a62){return respondWithRpcPromise(_0x718a('0x43'),_0x9509bb[_0x718a('0x16')])['then'](respondWithResult(_0x2c6a62,null))[_0x718a('0xc')](handleError(_0x2c6a62,null));};exports[_0x718a('0x44')]=function(_0x42de39,_0x3e05a6){return respondWithRpcPromise(_0x718a('0x45'),_0x42de39[_0x718a('0x16')])[_0x718a('0x8')](respondWithResult(_0x3e05a6,null))[_0x718a('0xc')](handleError(_0x3e05a6,null));};exports[_0x718a('0x46')]=function(_0x2f48e0,_0x41466e){return respondWithRpcPromise('Campaigns',_0x2f48e0[_0x718a('0x16')])['then'](respondWithResult(_0x41466e,null))[_0x718a('0xc')](handleError(_0x41466e,null));};exports[_0x718a('0x47')]=function(_0x2eff85,_0x51012e){return respondWithRpcPromise(_0x718a('0x48'),_0x2eff85[_0x718a('0x16')],routingClient)[_0x718a('0x8')](respondWithResult(_0x51012e,null))[_0x718a('0xc')](handleError(_0x51012e,null));};exports['showChatQueues']=function(_0x1d601b,_0x41ca60){return respondWithRpcPromise(_0x718a('0x48'),_0x1d601b[_0x718a('0x16')],routingClient)[_0x718a('0x8')](findById(_0x1d601b[_0x718a('0x25')]['id']))[_0x718a('0x8')](respondWithResult(_0x41ca60,null))['catch'](handleError(_0x41ca60,null));};exports[_0x718a('0x49')]=function(_0x1f20be,_0x2b4354){return respondWithRpcPromise('MailQueues',_0x1f20be[_0x718a('0x16')],routingClient)[_0x718a('0x8')](respondWithResult(_0x2b4354,null))[_0x718a('0xc')](handleError(_0x2b4354,null));};exports[_0x718a('0x4a')]=function(_0xf39daf,_0x310bbe){return respondWithRpcPromise(_0x718a('0x4b'),_0xf39daf[_0x718a('0x16')],routingClient)['then'](findById(_0xf39daf[_0x718a('0x25')]['id']))[_0x718a('0x8')](respondWithResult(_0x310bbe,null))['catch'](handleError(_0x310bbe,null));};exports[_0x718a('0x4c')]=function(_0x35780e,_0x4512ef){return respondWithRpcPromise(_0x718a('0x4d'),_0x35780e[_0x718a('0x16')],mailClient)['then'](respondWithResult(_0x4512ef,null))['catch'](handleError(_0x4512ef,null));};exports[_0x718a('0x4e')]=function(_0x38d0e0,_0x433920){return respondWithRpcPromise('OpenchannelQueues',_0x38d0e0[_0x718a('0x16')],routingClient)['then'](respondWithResult(_0x433920,null))[_0x718a('0xc')](handleError(_0x433920,null));};exports[_0x718a('0x4f')]=function(_0x3b058a,_0x1abfde){return respondWithRpcPromise('OpenchannelQueues',_0x3b058a[_0x718a('0x16')],routingClient)[_0x718a('0x8')](findById(_0x3b058a[_0x718a('0x25')]['id']))['then'](respondWithResult(_0x1abfde,null))[_0x718a('0xc')](handleError(_0x1abfde,null));};exports[_0x718a('0x50')]=function(_0x25be75,_0x49ca3e){return respondWithRpcPromise(_0x718a('0x51'),_0x25be75[_0x718a('0x16')],routingClient)['then'](respondWithResult(_0x49ca3e,null))[_0x718a('0xc')](handleError(_0x49ca3e,null));};exports[_0x718a('0x52')]=function(_0x2e582b,_0x300ca0){return respondWithRpcPromise(_0x718a('0x51'),_0x2e582b[_0x718a('0x16')],routingClient)[_0x718a('0x8')](findById(_0x2e582b[_0x718a('0x25')]['id']))[_0x718a('0x8')](respondWithResult(_0x300ca0,null))[_0x718a('0xc')](handleError(_0x300ca0,null));};exports[_0x718a('0x53')]=function(_0x5e6a1e,_0x107c30){return respondWithRpcPromise(_0x718a('0x54'),_0x5e6a1e[_0x718a('0x16')],routingClient)[_0x718a('0x8')](respondWithResult(_0x107c30,null))['catch'](handleError(_0x107c30,null));};exports['showFaxQueues']=function(_0x355f2b,_0x4eabae){return respondWithRpcPromise('FaxQueues',_0x355f2b[_0x718a('0x16')],routingClient)[_0x718a('0x8')](findById(_0x355f2b[_0x718a('0x25')]['id']))[_0x718a('0x8')](respondWithResult(_0x4eabae,null))['catch'](handleError(_0x4eabae,null));};exports[_0x718a('0x55')]=function(_0x153c25,_0x587c96){return respondWithRpcPromise(_0x718a('0x56'),_0x153c25['query'])[_0x718a('0x8')](respondWithResult(_0x587c96,null))['catch'](handleError(_0x587c96,null));};exports['chatQueuesWaitingInteractions']=function(_0x48a425,_0xfcd6ef){return respondWithRpcPromise(_0x718a('0x57'),_0x48a425[_0x718a('0x16')],routingClient)[_0x718a('0x8')](respondWithResult(_0xfcd6ef,null))[_0x718a('0xc')](handleError(_0xfcd6ef,null));};exports['mailQueuesWaitingInteractions']=function(_0x3fb901,_0x38c95e){return respondWithRpcPromise(_0x718a('0x58'),_0x3fb901[_0x718a('0x16')],routingClient)[_0x718a('0x8')](respondWithResult(_0x38c95e,null))[_0x718a('0xc')](handleError(_0x38c95e,null));};exports[_0x718a('0x59')]=function(_0x5f0991,_0x5d98cd){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5f0991[_0x718a('0x16')],routingClient)[_0x718a('0x8')](respondWithResult(_0x5d98cd,null))['catch'](handleError(_0x5d98cd,null));};exports[_0x718a('0x5a')]=function(_0x57f24b,_0x1201ea){return respondWithRpcPromise(_0x718a('0x5b'),_0x57f24b[_0x718a('0x16')],routingClient)[_0x718a('0x8')](respondWithResult(_0x1201ea,null))[_0x718a('0xc')](handleError(_0x1201ea,null));};exports[_0x718a('0x5c')]=function(_0x14e0e8,_0x32619d){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x14e0e8[_0x718a('0x16')],routingClient)['then'](respondWithResult(_0x32619d,null))['catch'](handleError(_0x32619d,null));};exports['queueNotify']=function(_0xa38ad0){return function(_0x4d4a82,_0x1f15d2){var _0x18284f,_0x43fe2d;var _0x309c80=_['capitalize'](_0xa38ad0);var _0x3ce240=_0xa38ad0==='chat'?_0x718a('0x5d'):'Account';return db[_0x309c80+_0x718a('0x5e')]['findOne']({'raw':!![],'where':{'id':_0x4d4a82[_0x718a('0x25')]['id']}})[_0x718a('0x8')](function(_0x4eea84){if(_[_0x718a('0x12')](_0x4eea84)){throw new Error(_0x309c80+_0x718a('0x5f'));}_0x18284f=_0x4eea84;return db[_0x309c80+'Message'][_0x718a('0x60')]({'where':{'id':_0x4d4a82['body'][_0x718a('0x61')]},'include':[{'model':db[_0x309c80+_0x718a('0x62')],'as':_0x718a('0x62')},{'model':db[_0x309c80+_0x3ce240],'as':_0x718a('0x63')}]});})[_0x718a('0x8')](function(_0x4ab3aa){if(_[_0x718a('0x12')](_0x4ab3aa)){throw new Error(_0x309c80+_0x718a('0x64'));}_0x43fe2d=_0x4ab3aa;return _0x4ab3aa[_0x718a('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0x718a('0x8')](function(){var _0x25c27b={'uniqueid':_0xa38ad0+'.'+_0x43fe2d['id']+'.'+_0x43fe2d['Interaction']['id'],'FromUserId':_0x4d4a82['user']['id'],'type':'queue'};_0x25c27b[_0x309c80+_0x718a('0x66')]=_0x43fe2d['id'];_0x25c27b[_0x309c80+_0x718a('0x67')]=_0x43fe2d['Interaction']['id'];_0x25c27b[_0x718a('0x68')+_0x309c80+_0x3ce240+'Id']=_0x43fe2d[_0x718a('0x63')]['id'];_0x25c27b['To'+_0x309c80+_0x718a('0x69')]=_0x18284f['id'];return db[_0x309c80+_0x718a('0x6a')][_0x718a('0x6b')](_0x25c27b);})[_0x718a('0x8')](function(){return respondWithRpcPromise(_0x718a('0x6c'),{'channel':_0xa38ad0,'interaction':_0x43fe2d[_0x718a('0x62')],'message':_0x43fe2d,'account':_0x43fe2d[_0x718a('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x718a('0x6d'),'appdata':_0x18284f[_0x718a('0x32')]+','+(_0x43fe2d[_0x718a('0x63')][_0x718a('0x6e')]||0x12c),'interval':_0x718a('0x6f')}]},routingClient);})[_0x718a('0x8')](respondWithResult(_0x1f15d2,null))['catch'](handleError(_0x1f15d2,null));};};exports[_0x718a('0x70')]=function(_0x5599f2,_0x5a2856){var _0x242b4e,_0x18c579;if(_[_0x718a('0x12')](_0x5599f2[_0x718a('0x2f')][_0x718a('0x71')])){throw new Error(_0x718a('0x72'));}var _0x725f0c=_0x5599f2[_0x718a('0x2f')][_0x718a('0x71')];var _0x391d73=_[_0x718a('0x73')](_0x725f0c);var _0x35d477=_0x725f0c===_0x718a('0x74')?_0x718a('0x5d'):_0x718a('0x63');return db['User'][_0x718a('0x60')]({'raw':!![],'where':{'id':_0x5599f2[_0x718a('0x25')]['id'],'role':_0x718a('0x3e')}})[_0x718a('0x8')](function(_0xc79ea5){if(_[_0x718a('0x12')](_0xc79ea5)){throw new Error(_0x718a('0x75'));}_0x242b4e=_0xc79ea5;return db[_0x391d73+_0x718a('0x76')]['findOne']({'where':{'id':_0x5599f2[_0x718a('0x2f')]['messageId']},'include':[{'model':db[_0x391d73+_0x718a('0x62')],'as':_0x718a('0x62')},{'model':db[_0x391d73+_0x35d477],'as':_0x718a('0x63')}]});})[_0x718a('0x8')](function(_0x15a014){if(_['isNil'](_0x15a014)){throw new Error(_0x391d73+_0x718a('0x64'));}_0x18c579=_0x15a014;return _0x15a014[_0x718a('0x65')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x138c03={'uniqueid':_0x725f0c+'.'+_0x18c579['id']+'.'+_0x18c579[_0x718a('0x62')]['id'],'FromUserId':_0x5599f2['user']['id'],'type':_0x718a('0x6d'),'ToUserId':_0x242b4e['id']};_0x138c03[_0x391d73+_0x718a('0x66')]=_0x18c579['id'];_0x138c03[_0x391d73+_0x718a('0x67')]=_0x18c579[_0x718a('0x62')]['id'];_0x138c03['From'+_0x391d73+_0x35d477+'Id']=_0x18c579['Account']['id'];return db[_0x391d73+_0x718a('0x6a')]['create'](_0x138c03);})[_0x718a('0x8')](function(){return respondWithRpcPromise(_0x718a('0x6c'),{'channel':_0x725f0c,'interaction':_0x18c579[_0x718a('0x62')],'message':_0x18c579,'account':_0x18c579[_0x718a('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x718a('0x3e'),'appdata':_0x242b4e[_0x718a('0x32')]+','+(_0x18c579[_0x718a('0x63')][_0x718a('0x77')]||0x12c),'interval':_0x718a('0x6f')}]},routingClient);})[_0x718a('0x8')](respondWithResult(_0x5a2856,null))[_0x718a('0xc')](handleError(_0x5a2856,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 12dc44c..5704a24 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 _0x5204=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','/:id','get','run','post','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x5c6244,_0x112ab8){var _0x5800ce=function(_0x304e3d){while(--_0x304e3d){_0x5c6244['push'](_0x5c6244['shift']());}};_0x5800ce(++_0x112ab8);}(_0x5204,0x1b2));var _0x4520=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0x5204[_0x5216e0];return _0x5b3f40;};'use strict';var multer=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var path=require('path');var timeout=require(_0x4520('0x2'));var express=require(_0x4520('0x3'));var router=express['Router']();var auth=require(_0x4520('0x4'));var interaction=require(_0x4520('0x5'));var config=require(_0x4520('0x6'));var controller=require(_0x4520('0x7'));router['get']('/',auth[_0x4520('0x8')](),controller[_0x4520('0x9')]);router['get'](_0x4520('0xa'),auth[_0x4520('0x8')](),controller['show']);router[_0x4520('0xb')]('/:id/run',auth['isAuthenticated'](),controller[_0x4520('0xc')]);router[_0x4520('0xd')]('/',auth[_0x4520('0x8')](),controller['create']);router[_0x4520('0xe')](_0x4520('0xa'),auth[_0x4520('0x8')](),controller[_0x4520('0xf')]);router[_0x4520('0x10')](_0x4520('0xa'),auth[_0x4520('0x8')](),controller[_0x4520('0x11')]);module[_0x4520('0x12')]=router; \ No newline at end of file +var _0xdb94=['/:id/run','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show'];(function(_0x14f7fe,_0x5132c4){var _0x3d8309=function(_0x22f5c7){while(--_0x22f5c7){_0x14f7fe['push'](_0x14f7fe['shift']());}};_0x3d8309(++_0x5132c4);}(_0xdb94,0x194));var _0x4db9=function(_0x551531,_0x293670){_0x551531=_0x551531-0x0;var _0x13c854=_0xdb94[_0x551531];return _0x13c854;};'use strict';var multer=require('multer');var util=require(_0x4db9('0x0'));var path=require(_0x4db9('0x1'));var timeout=require(_0x4db9('0x2'));var express=require(_0x4db9('0x3'));var router=express['Router']();var auth=require(_0x4db9('0x4'));var interaction=require(_0x4db9('0x5'));var config=require(_0x4db9('0x6'));var controller=require(_0x4db9('0x7'));router[_0x4db9('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4db9('0x8')](_0x4db9('0x9'),auth[_0x4db9('0xa')](),controller[_0x4db9('0xb')]);router[_0x4db9('0x8')](_0x4db9('0xc'),auth[_0x4db9('0xa')](),controller['run']);router['post']('/',auth[_0x4db9('0xa')](),controller['create']);router['put'](_0x4db9('0x9'),auth[_0x4db9('0xa')](),controller[_0x4db9('0xd')]);router['delete'](_0x4db9('0x9'),auth['isAuthenticated'](),controller[_0x4db9('0xe')]);module[_0x4db9('0xf')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 48887de..5e45a15 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 _0x2eeb=['DATE','INTEGER','ENUM','years','months','weeks','hours','minutes','pdf','xlsx','csv','custom','default','BOOLEAN','TEXT','sequelize','STRING','0\x200\x20*\x20*\x20*'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x2eeb,0x69));var _0xb2ee=function(_0x267d24,_0x3875e1){_0x267d24=_0x267d24-0x0;var _0x3d0742=_0x2eeb[_0x267d24];return _0x3d0742;};'use strict';var Sequelize=require(_0xb2ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xb2ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb2ee('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xb2ee('0x1')],'allowNull':![],'defaultValue':_0xb2ee('0x2')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xb2ee('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb2ee('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb2ee('0x5')](_0xb2ee('0x6'),'quarters',_0xb2ee('0x7'),_0xb2ee('0x8'),'days',_0xb2ee('0x9'),_0xb2ee('0xa')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xb2ee('0x5')]('csv',_0xb2ee('0xb'),_0xb2ee('0xc')),'allowNull':![],'defaultValue':_0xb2ee('0xd')},'type':{'type':Sequelize['ENUM'](_0xb2ee('0xe'),_0xb2ee('0xf')),'allowNull':![],'defaultValue':_0xb2ee('0xe')},'sendMail':{'type':Sequelize[_0xb2ee('0x10')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xb2ee('0x11')]},'bcc':{'type':Sequelize[_0xb2ee('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xb2ee('0x10')],'defaultValue':!![]}}; \ No newline at end of file +var _0x481e=['BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','INTEGER','ENUM','quarters','months','weeks','hours','minutes','days','csv','pdf','custom','default'];(function(_0x1c2f29,_0x5a2668){var _0x258465=function(_0x30332f){while(--_0x30332f){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x258465(++_0x5a2668);}(_0x481e,0x16a));var _0xe481=function(_0x4c1514,_0x30cd30){_0x4c1514=_0x4c1514-0x0;var _0x40e43d=_0x481e[_0x4c1514];return _0x40e43d;};'use strict';var Sequelize=require(_0xe481('0x0'));module[_0xe481('0x1')]={'name':{'type':Sequelize[_0xe481('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe481('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe481('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe481('0x5')]('years',_0xe481('0x6'),_0xe481('0x7'),_0xe481('0x8'),'days',_0xe481('0x9'),_0xe481('0xa')),'allowNull':![],'defaultValue':_0xe481('0xb')},'output':{'type':Sequelize['ENUM'](_0xe481('0xc'),_0xe481('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0xe481('0xc')},'type':{'type':Sequelize[_0xe481('0x5')](_0xe481('0xe'),_0xe481('0xf')),'allowNull':![],'defaultValue':_0xe481('0xe')},'sendMail':{'type':Sequelize[_0xe481('0x10')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xe481('0x11')]},'bcc':{'type':Sequelize[_0xe481('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xe481('0x10')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 27f1190..909d5fd 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 _0xdd7e=['rows','catch','params','fields','length','include','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','html-pdf','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','index','Schedule','keys','query','model','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','findAll'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdd7e,0x191));var _0xedd7=function(_0x35eff0,_0x35b9df){_0x35eff0=_0x35eff0-0x0;var _0x2008c6=_0xdd7e[_0x35eff0];return _0x2008c6;};'use strict';var pdf=require(_0xedd7('0x0'));var emlformat=require(_0xedd7('0x1'));var rimraf=require(_0xedd7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xedd7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xedd7('0x4'));var util=require(_0xedd7('0x5'));var path=require(_0xedd7('0x6'));var sox=require(_0xedd7('0x7'));var csv=require(_0xedd7('0x8'));var ejs=require(_0xedd7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xedd7('0xa'));var crypto=require(_0xedd7('0xb'));var jsforce=require(_0xedd7('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xedd7('0xd'));var Papa=require('papaparse');var authService=require(_0xedd7('0xe'));var hardwareService=require(_0xedd7('0xf'));var Redis=require(_0xedd7('0x10'));var qs=require(_0xedd7('0x11'));var logger=require('../../config/logger')(_0xedd7('0x12'));var utils=require(_0xedd7('0x13'));var config=require('../../config/environment');var db=require(_0xedd7('0x14'))['db'];function respondWithStatusCode(_0x181706,_0x429346){_0x429346=_0x429346||0xcc;return function(_0x1d2b0e){if(_0x1d2b0e){return _0x181706[_0xedd7('0x15')](_0x429346);}return _0x181706[_0xedd7('0x16')](_0x429346)[_0xedd7('0x17')]();};}function respondWithResult(_0x1aec24,_0x212d66){_0x212d66=_0x212d66||0xc8;return function(_0x469ba4){if(_0x469ba4){return _0x1aec24['status'](_0x212d66)['json'](_0x469ba4);}};}function respondWithFilteredResult(_0x43f3c3,_0x574407){return function(_0x456bda){if(_0x456bda){var _0xc8762=_0x456bda['count'],_0x1056ca=_0x574407[_0xedd7('0x18')],_0x36d0fc=_0x574407[_0xedd7('0x18')]+_0x574407[_0xedd7('0x19')],_0x341a8a;if(_0x36d0fc>=_0xc8762){_0x36d0fc=_0xc8762;_0x341a8a=0xc8;}else{_0x341a8a=0xce;}_0x43f3c3[_0xedd7('0x16')](_0x341a8a);return _0x43f3c3[_0xedd7('0x1a')]('Content-Range',_0x1056ca+'-'+_0x36d0fc+'/'+_0xc8762)['json'](_0x456bda);}return null;};}function patchUpdates(_0x511cc9){return function(_0x563006){try{jsonpatch[_0xedd7('0x1b')](_0x563006,_0x511cc9,!![]);}catch(_0x4d99df){return BPromise['reject'](_0x4d99df);}return _0x563006[_0xedd7('0x1c')]();};}function saveUpdates(_0x149a86,_0x37303a){return function(_0x46682d){if(_0x46682d){return _0x46682d[_0xedd7('0x1d')](_0x149a86)[_0xedd7('0x1e')](function(_0x8b534a){return _0x8b534a;});}return null;};}function removeEntity(_0x22d8f1,_0x38a8fd){return function(_0x4173b7){if(_0x4173b7){return _0x4173b7[_0xedd7('0x1f')]()[_0xedd7('0x1e')](function(){var _0x5e64bd=_0x4173b7[_0xedd7('0x20')]({'plain':!![]});var _0x37491b=_0xedd7('0x21');return db[_0xedd7('0x22')][_0xedd7('0x1f')]({'where':{'type':_0x37491b,'resourceId':_0x5e64bd['id']}})[_0xedd7('0x1e')](function(){return _0x4173b7;});})['then'](function(){_0x22d8f1[_0xedd7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16531c,_0x395c1f){return function(_0x3a8bb4){if(!_0x3a8bb4){_0x16531c[_0xedd7('0x15')](0x194);}return _0x3a8bb4;};}function handleError(_0x396002,_0x345c6d){_0x345c6d=_0x345c6d||0x1f4;return function(_0x5bd987){logger[_0xedd7('0x23')](_0x5bd987[_0xedd7('0x24')]);if(_0x5bd987[_0xedd7('0x25')]){delete _0x5bd987[_0xedd7('0x25')];}_0x396002[_0xedd7('0x16')](_0x345c6d)['send'](_0x5bd987);};}exports[_0xedd7('0x26')]=function(_0x14a229,_0x31a5b7){var _0x33d222={},_0x1dc250={},_0x32394c={'count':0x0,'rows':[]};var _0x3bd250=db[_0xedd7('0x27')]['rawAttributes'];_0x1dc250['model']=_[_0xedd7('0x28')](_0x3bd250);_0x1dc250[_0xedd7('0x29')]=_[_0xedd7('0x28')](_0x14a229[_0xedd7('0x29')]);_0x1dc250['filters']=_['intersection'](_0x1dc250[_0xedd7('0x2a')],_0x1dc250['query']);_0x33d222[_0xedd7('0x2b')]=_[_0xedd7('0x2c')](_0x1dc250[_0xedd7('0x2a')],qs['fields'](_0x14a229['query']['fields']));_0x33d222['attributes']=_0x33d222[_0xedd7('0x2b')]['length']?_0x33d222[_0xedd7('0x2b')]:_0x1dc250[_0xedd7('0x2a')];if(!_0x14a229[_0xedd7('0x29')][_0xedd7('0x2d')](_0xedd7('0x2e'))){_0x33d222['limit']=qs[_0xedd7('0x19')](_0x14a229['query'][_0xedd7('0x19')]);_0x33d222[_0xedd7('0x18')]=qs[_0xedd7('0x18')](_0x14a229[_0xedd7('0x29')]['offset']);}_0x33d222[_0xedd7('0x2f')]=qs[_0xedd7('0x30')](_0x14a229['query'][_0xedd7('0x30')]);_0x33d222[_0xedd7('0x31')]=qs[_0xedd7('0x32')](_['pick'](_0x14a229[_0xedd7('0x29')],_0x1dc250['filters']));if(_0x14a229[_0xedd7('0x29')][_0xedd7('0x33')]){_0x33d222[_0xedd7('0x31')]=_[_0xedd7('0x34')](_0x33d222[_0xedd7('0x31')],{'$or':_['map'](_0x3bd250,function(_0x3f7f82){if(_0x3f7f82[_0xedd7('0x35')][_0xedd7('0x36')]!==_0xedd7('0x37')){var _0x289eef={};_0x289eef[_0x3f7f82[_0xedd7('0x38')]]={'$like':'%'+_0x14a229[_0xedd7('0x29')][_0xedd7('0x33')]+'%'};return _0x289eef;}})});}_0x33d222=_['merge']({},_0x33d222,_0x14a229[_0xedd7('0x39')]);var _0x347f5f={'where':_0x33d222[_0xedd7('0x31')]};return db[_0xedd7('0x27')][_0xedd7('0x3a')](_0x347f5f)['then'](function(_0x24c37c){_0x32394c['count']=_0x24c37c;if(_0x14a229[_0xedd7('0x29')][_0xedd7('0x3b')]){_0x33d222['include']=[{'all':!![]}];}return db['Schedule'][_0xedd7('0x3c')](_0x33d222);})[_0xedd7('0x1e')](function(_0x3119d5){_0x32394c[_0xedd7('0x3d')]=_0x3119d5;return _0x32394c;})[_0xedd7('0x1e')](respondWithFilteredResult(_0x31a5b7,_0x33d222))[_0xedd7('0x3e')](handleError(_0x31a5b7,null));};exports['show']=function(_0x2b008d,_0x3b1dab){var _0x44f9b2={'raw':![],'where':{'id':_0x2b008d[_0xedd7('0x3f')]['id']}},_0x124796={};_0x124796[_0xedd7('0x2a')]=_[_0xedd7('0x28')](db[_0xedd7('0x27')]['rawAttributes']);_0x124796[_0xedd7('0x29')]=_[_0xedd7('0x28')](_0x2b008d[_0xedd7('0x29')]);_0x124796[_0xedd7('0x32')]=_[_0xedd7('0x2c')](_0x124796[_0xedd7('0x2a')],_0x124796[_0xedd7('0x29')]);_0x44f9b2[_0xedd7('0x2b')]=_[_0xedd7('0x2c')](_0x124796['model'],qs['fields'](_0x2b008d['query'][_0xedd7('0x40')]));_0x44f9b2[_0xedd7('0x2b')]=_0x44f9b2[_0xedd7('0x2b')][_0xedd7('0x41')]?_0x44f9b2['attributes']:_0x124796[_0xedd7('0x2a')];if(_0x2b008d[_0xedd7('0x29')][_0xedd7('0x3b')]){_0x44f9b2[_0xedd7('0x42')]=[{'all':!![]}];}_0x44f9b2=_[_0xedd7('0x34')]({},_0x44f9b2,_0x2b008d['options']);return db[_0xedd7('0x27')][_0xedd7('0x43')](_0x44f9b2)[_0xedd7('0x1e')](handleEntityNotFound(_0x3b1dab,null))['then'](respondWithResult(_0x3b1dab,null))['catch'](handleError(_0x3b1dab,null));};exports[_0xedd7('0x44')]=function(_0x148f98,_0x2ea920){return db[_0xedd7('0x27')][_0xedd7('0x44')](_0x148f98[_0xedd7('0x45')],{})['then'](function(_0x211ef4){var _0x57e854=_0x148f98[_0xedd7('0x46')][_0xedd7('0x20')]({'plain':!![]});if(!_0x57e854)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57e854[_0xedd7('0x47')]===_0xedd7('0x46')){var _0x476931=_0x211ef4[_0xedd7('0x20')]({'plain':!![]});var _0x5c8586=_0xedd7('0x21');return db[_0xedd7('0x48')]['find']({'where':{'name':_0x5c8586,'userProfileId':_0x57e854['userProfileId']},'raw':!![]})[_0xedd7('0x1e')](function(_0x4f8f72){if(_0x4f8f72&&_0x4f8f72[_0xedd7('0x49')]===0x0){return db[_0xedd7('0x22')]['create']({'name':_0x476931[_0xedd7('0x25')],'resourceId':_0x476931['id'],'type':_0x4f8f72[_0xedd7('0x25')],'sectionId':_0x4f8f72['id']},{})[_0xedd7('0x1e')](function(){return _0x211ef4;});}else{return _0x211ef4;}})['catch'](function(_0x4f1487){logger[_0xedd7('0x23')](_0xedd7('0x4a'),_0x4f1487);throw _0x4f1487;});}return _0x211ef4;})[_0xedd7('0x1e')](respondWithResult(_0x2ea920,0xc9))['catch'](handleError(_0x2ea920,null));};exports[_0xedd7('0x1d')]=function(_0x1bbbba,_0x2b41dd){if(_0x1bbbba[_0xedd7('0x45')]['id']){delete _0x1bbbba['body']['id'];}return db[_0xedd7('0x27')][_0xedd7('0x43')]({'where':{'id':_0x1bbbba['params']['id']}})[_0xedd7('0x1e')](handleEntityNotFound(_0x2b41dd,null))['then'](saveUpdates(_0x1bbbba['body'],null))['then'](respondWithResult(_0x2b41dd,null))[_0xedd7('0x3e')](handleError(_0x2b41dd,null));};exports[_0xedd7('0x1f')]=function(_0x3e20c7,_0x397354){return db[_0xedd7('0x27')][_0xedd7('0x43')]({'where':{'id':_0x3e20c7[_0xedd7('0x3f')]['id']}})[_0xedd7('0x1e')](handleEntityNotFound(_0x397354,null))[_0xedd7('0x1e')](removeEntity(_0x397354,null))[_0xedd7('0x3e')](handleError(_0x397354,null));};exports[_0xedd7('0x4b')]=function(_0x2583b4,_0xd60fb9,_0x419cc9){var _0x5578f0=require(_0xedd7('0x4c'));return db['Schedule']['find']({'where':{'id':_0x2583b4[_0xedd7('0x3f')]['id']},'raw':!![]})[_0xedd7('0x1e')](handleEntityNotFound(_0xd60fb9,null))['then'](function(){_0x5578f0[_0xedd7('0x4b')](_0x2583b4[_0xedd7('0x3f')]['id']);})[_0xedd7('0x1e')](respondWithStatusCode(_0xd60fb9,null))[_0xedd7('0x3e')](handleError(_0xd60fb9,null));}; \ No newline at end of file +var _0xad6c=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json','offset','set','Content-Range','apply','reject','save','destroy','then','UserProfileResource','sendStatus','error','stack','name','index','Schedule','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','where','filters','pick','filter','merge','map','key','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Scheduler','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','html-pdf','rimraf','zip-dir'];(function(_0xdcff8e,_0x900ada){var _0x7a88e8=function(_0x15b20b){while(--_0x15b20b){_0xdcff8e['push'](_0xdcff8e['shift']());}};_0x7a88e8(++_0x900ada);}(_0xad6c,0xf9));var _0xcad6=function(_0x122da3,_0x54b11a){_0x122da3=_0x122da3-0x0;var _0x5bc2f0=_0xad6c[_0x122da3];return _0x5bc2f0;};'use strict';var pdf=require(_0xcad6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcad6('0x1'));var zipdir=require(_0xcad6('0x2'));var jsonpatch=require(_0xcad6('0x3'));var rp=require(_0xcad6('0x4'));var moment=require(_0xcad6('0x5'));var BPromise=require(_0xcad6('0x6'));var Mustache=require(_0xcad6('0x7'));var util=require(_0xcad6('0x8'));var path=require(_0xcad6('0x9'));var sox=require('sox');var csv=require(_0xcad6('0xa'));var ejs=require(_0xcad6('0xb'));var fs=require('fs');var _=require(_0xcad6('0xc'));var squel=require(_0xcad6('0xd'));var crypto=require(_0xcad6('0xe'));var jsforce=require(_0xcad6('0xf'));var deskjs=require(_0xcad6('0x10'));var toCsv=require(_0xcad6('0xa'));var querystring=require(_0xcad6('0x11'));var Papa=require(_0xcad6('0x12'));var authService=require(_0xcad6('0x13'));var hardwareService=require(_0xcad6('0x14'));var Redis=require(_0xcad6('0x15'));var qs=require(_0xcad6('0x16'));var logger=require(_0xcad6('0x17'))(_0xcad6('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xcad6('0x19'))['db'];function respondWithStatusCode(_0x337243,_0x4f58d5){_0x4f58d5=_0x4f58d5||0xcc;return function(_0x31a8c4){if(_0x31a8c4){return _0x337243['sendStatus'](_0x4f58d5);}return _0x337243[_0xcad6('0x1a')](_0x4f58d5)['end']();};}function respondWithResult(_0xc1fdeb,_0x4ad017){_0x4ad017=_0x4ad017||0xc8;return function(_0x2223f6){if(_0x2223f6){return _0xc1fdeb[_0xcad6('0x1a')](_0x4ad017)[_0xcad6('0x1b')](_0x2223f6);}};}function respondWithFilteredResult(_0x9572e3,_0x4cad59){return function(_0xc4ba44){if(_0xc4ba44){var _0x2d3749=_0xc4ba44['count'],_0x54aac3=_0x4cad59[_0xcad6('0x1c')],_0x341625=_0x4cad59[_0xcad6('0x1c')]+_0x4cad59['limit'],_0x228ef9;if(_0x341625>=_0x2d3749){_0x341625=_0x2d3749;_0x228ef9=0xc8;}else{_0x228ef9=0xce;}_0x9572e3[_0xcad6('0x1a')](_0x228ef9);return _0x9572e3[_0xcad6('0x1d')](_0xcad6('0x1e'),_0x54aac3+'-'+_0x341625+'/'+_0x2d3749)[_0xcad6('0x1b')](_0xc4ba44);}return null;};}function patchUpdates(_0x3c877d){return function(_0x5e418f){try{jsonpatch[_0xcad6('0x1f')](_0x5e418f,_0x3c877d,!![]);}catch(_0x1bcd2f){return BPromise[_0xcad6('0x20')](_0x1bcd2f);}return _0x5e418f[_0xcad6('0x21')]();};}function saveUpdates(_0x387e64,_0x45435a){return function(_0x5adb28){if(_0x5adb28){return _0x5adb28['update'](_0x387e64)['then'](function(_0xa874f){return _0xa874f;});}return null;};}function removeEntity(_0x4896a7,_0x12fc22){return function(_0x4b96c3){if(_0x4b96c3){return _0x4b96c3[_0xcad6('0x22')]()[_0xcad6('0x23')](function(){var _0x1f2854=_0x4b96c3['get']({'plain':!![]});var _0x484b3b='Scheduler';return db[_0xcad6('0x24')][_0xcad6('0x22')]({'where':{'type':_0x484b3b,'resourceId':_0x1f2854['id']}})[_0xcad6('0x23')](function(){return _0x4b96c3;});})['then'](function(){_0x4896a7[_0xcad6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x190025,_0xe53aaf){return function(_0x38cf86){if(!_0x38cf86){_0x190025[_0xcad6('0x25')](0x194);}return _0x38cf86;};}function handleError(_0x2b6f3b,_0x1f0f32){_0x1f0f32=_0x1f0f32||0x1f4;return function(_0x3336a3){logger[_0xcad6('0x26')](_0x3336a3[_0xcad6('0x27')]);if(_0x3336a3[_0xcad6('0x28')]){delete _0x3336a3[_0xcad6('0x28')];}_0x2b6f3b[_0xcad6('0x1a')](_0x1f0f32)['send'](_0x3336a3);};}exports[_0xcad6('0x29')]=function(_0x33838d,_0x1df668){var _0x2825a3={},_0x35e238={},_0x1f3e2c={'count':0x0,'rows':[]};var _0x278317=db[_0xcad6('0x2a')]['rawAttributes'];_0x35e238[_0xcad6('0x2b')]=_[_0xcad6('0x2c')](_0x278317);_0x35e238[_0xcad6('0x2d')]=_[_0xcad6('0x2c')](_0x33838d['query']);_0x35e238['filters']=_[_0xcad6('0x2e')](_0x35e238['model'],_0x35e238[_0xcad6('0x2d')]);_0x2825a3[_0xcad6('0x2f')]=_[_0xcad6('0x2e')](_0x35e238[_0xcad6('0x2b')],qs[_0xcad6('0x30')](_0x33838d[_0xcad6('0x2d')][_0xcad6('0x30')]));_0x2825a3[_0xcad6('0x2f')]=_0x2825a3[_0xcad6('0x2f')][_0xcad6('0x31')]?_0x2825a3[_0xcad6('0x2f')]:_0x35e238['model'];if(!_0x33838d[_0xcad6('0x2d')][_0xcad6('0x32')](_0xcad6('0x33'))){_0x2825a3[_0xcad6('0x34')]=qs['limit'](_0x33838d['query'][_0xcad6('0x34')]);_0x2825a3[_0xcad6('0x1c')]=qs['offset'](_0x33838d['query']['offset']);}_0x2825a3['order']=qs['sort'](_0x33838d[_0xcad6('0x2d')]['sort']);_0x2825a3[_0xcad6('0x35')]=qs[_0xcad6('0x36')](_[_0xcad6('0x37')](_0x33838d[_0xcad6('0x2d')],_0x35e238['filters']));if(_0x33838d['query'][_0xcad6('0x38')]){_0x2825a3[_0xcad6('0x35')]=_[_0xcad6('0x39')](_0x2825a3[_0xcad6('0x35')],{'$or':_[_0xcad6('0x3a')](_0x278317,function(_0x15ae4e){if(_0x15ae4e['type'][_0xcad6('0x3b')]!==_0xcad6('0x3c')){var _0x4dab74={};_0x4dab74[_0x15ae4e['field']]={'$like':'%'+_0x33838d[_0xcad6('0x2d')][_0xcad6('0x38')]+'%'};return _0x4dab74;}})});}_0x2825a3=_[_0xcad6('0x39')]({},_0x2825a3,_0x33838d[_0xcad6('0x3d')]);var _0x38ff97={'where':_0x2825a3['where']};return db[_0xcad6('0x2a')][_0xcad6('0x3e')](_0x38ff97)['then'](function(_0x122d87){_0x1f3e2c[_0xcad6('0x3e')]=_0x122d87;if(_0x33838d[_0xcad6('0x2d')][_0xcad6('0x3f')]){_0x2825a3[_0xcad6('0x40')]=[{'all':!![]}];}return db['Schedule'][_0xcad6('0x41')](_0x2825a3);})[_0xcad6('0x23')](function(_0x19ea78){_0x1f3e2c[_0xcad6('0x42')]=_0x19ea78;return _0x1f3e2c;})[_0xcad6('0x23')](respondWithFilteredResult(_0x1df668,_0x2825a3))[_0xcad6('0x43')](handleError(_0x1df668,null));};exports['show']=function(_0x12e210,_0x594cec){var _0x4c22e3={'raw':![],'where':{'id':_0x12e210[_0xcad6('0x44')]['id']}},_0x1c2332={};_0x1c2332[_0xcad6('0x2b')]=_[_0xcad6('0x2c')](db[_0xcad6('0x2a')][_0xcad6('0x45')]);_0x1c2332[_0xcad6('0x2d')]=_[_0xcad6('0x2c')](_0x12e210[_0xcad6('0x2d')]);_0x1c2332[_0xcad6('0x36')]=_['intersection'](_0x1c2332['model'],_0x1c2332[_0xcad6('0x2d')]);_0x4c22e3[_0xcad6('0x2f')]=_[_0xcad6('0x2e')](_0x1c2332[_0xcad6('0x2b')],qs[_0xcad6('0x30')](_0x12e210[_0xcad6('0x2d')][_0xcad6('0x30')]));_0x4c22e3[_0xcad6('0x2f')]=_0x4c22e3[_0xcad6('0x2f')]['length']?_0x4c22e3[_0xcad6('0x2f')]:_0x1c2332['model'];if(_0x12e210[_0xcad6('0x2d')]['includeAll']){_0x4c22e3['include']=[{'all':!![]}];}_0x4c22e3=_[_0xcad6('0x39')]({},_0x4c22e3,_0x12e210[_0xcad6('0x3d')]);return db['Schedule']['find'](_0x4c22e3)[_0xcad6('0x23')](handleEntityNotFound(_0x594cec,null))[_0xcad6('0x23')](respondWithResult(_0x594cec,null))[_0xcad6('0x43')](handleError(_0x594cec,null));};exports[_0xcad6('0x46')]=function(_0x29ee76,_0x57f0bf){return db[_0xcad6('0x2a')][_0xcad6('0x46')](_0x29ee76[_0xcad6('0x47')],{})[_0xcad6('0x23')](function(_0x55a92b){var _0x5e8eaf=_0x29ee76['user'][_0xcad6('0x48')]({'plain':!![]});if(!_0x5e8eaf)throw new Error(_0xcad6('0x49'));if(_0x5e8eaf[_0xcad6('0x4a')]===_0xcad6('0x4b')){var _0x624ef9=_0x55a92b[_0xcad6('0x48')]({'plain':!![]});var _0x37a4d5=_0xcad6('0x4c');return db[_0xcad6('0x4d')][_0xcad6('0x4e')]({'where':{'name':_0x37a4d5,'userProfileId':_0x5e8eaf[_0xcad6('0x4f')]},'raw':!![]})['then'](function(_0x580cc3){if(_0x580cc3&&_0x580cc3[_0xcad6('0x50')]===0x0){return db[_0xcad6('0x24')]['create']({'name':_0x624ef9[_0xcad6('0x28')],'resourceId':_0x624ef9['id'],'type':_0x580cc3[_0xcad6('0x28')],'sectionId':_0x580cc3['id']},{})[_0xcad6('0x23')](function(){return _0x55a92b;});}else{return _0x55a92b;}})[_0xcad6('0x43')](function(_0x9b05f3){logger['error'](_0xcad6('0x51'),_0x9b05f3);throw _0x9b05f3;});}return _0x55a92b;})['then'](respondWithResult(_0x57f0bf,0xc9))[_0xcad6('0x43')](handleError(_0x57f0bf,null));};exports['update']=function(_0x324115,_0x4c3b06){if(_0x324115[_0xcad6('0x47')]['id']){delete _0x324115[_0xcad6('0x47')]['id'];}return db[_0xcad6('0x2a')][_0xcad6('0x4e')]({'where':{'id':_0x324115['params']['id']}})[_0xcad6('0x23')](handleEntityNotFound(_0x4c3b06,null))[_0xcad6('0x23')](saveUpdates(_0x324115[_0xcad6('0x47')],null))[_0xcad6('0x23')](respondWithResult(_0x4c3b06,null))[_0xcad6('0x43')](handleError(_0x4c3b06,null));};exports[_0xcad6('0x22')]=function(_0x40c359,_0x40e6a4){return db[_0xcad6('0x2a')][_0xcad6('0x4e')]({'where':{'id':_0x40c359[_0xcad6('0x44')]['id']}})[_0xcad6('0x23')](handleEntityNotFound(_0x40e6a4,null))[_0xcad6('0x23')](removeEntity(_0x40e6a4,null))[_0xcad6('0x43')](handleError(_0x40e6a4,null));};exports[_0xcad6('0x52')]=function(_0x4e8658,_0x3deacd,_0x2b0e36){var _0xa41862=require(_0xcad6('0x53'));return db[_0xcad6('0x2a')]['find']({'where':{'id':_0x4e8658[_0xcad6('0x44')]['id']},'raw':!![]})[_0xcad6('0x23')](handleEntityNotFound(_0x3deacd,null))[_0xcad6('0x23')](function(){_0xa41862[_0xcad6('0x52')](_0x4e8658[_0xcad6('0x44')]['id']);})[_0xcad6('0x23')](respondWithStatusCode(_0x3deacd,null))[_0xcad6('0x43')](handleError(_0x3deacd,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 7c855df..f1a1c6c 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 _0x76a3=['exports','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./schedule.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x76a3,0x1b0));var _0x376a=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0x76a3[_0x4b03c9];return _0x161ba2;};'use strict';var _=require(_0x376a('0x0'));var util=require(_0x376a('0x1'));var logger=require(_0x376a('0x2'))(_0x376a('0x3'));var moment=require(_0x376a('0x4'));var BPromise=require(_0x376a('0x5'));var rp=require(_0x376a('0x6'));var attributes=require(_0x376a('0x7'));module[_0x376a('0x8')]=function(_0x1a2b04,_0x2785a2){return _0x1a2b04['define']('Schedule',attributes,{'tableName':_0x376a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0477=['../../config/logger','api','bluebird','request-promise','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0477,0x106));var _0x7047=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0x0477[_0x1e6659];return _0x4d16e4;};'use strict';var _=require(_0x7047('0x0'));var util=require(_0x7047('0x1'));var logger=require(_0x7047('0x2'))(_0x7047('0x3'));var moment=require('moment');var BPromise=require(_0x7047('0x4'));var rp=require(_0x7047('0x5'));var attributes=require(_0x7047('0x6'));module[_0x7047('0x7')]=function(_0x44ceab,_0x22c377){return _0x44ceab[_0x7047('0x8')](_0x7047('0x9'),attributes,{'tableName':_0x7047('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 aed77c6..700da49 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 _0x2151=['info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0x2151,0x1b3));var _0x1215=function(_0x7604b9,_0x445688){_0x7604b9=_0x7604b9-0x0;var _0x3892d4=_0x2151[_0x7604b9];return _0x3892d4;};'use strict';var _=require('lodash');var util=require(_0x1215('0x0'));var moment=require(_0x1215('0x1'));var BPromise=require(_0x1215('0x2'));var rs=require(_0x1215('0x3'));var fs=require('fs');var Redis=require(_0x1215('0x4'));var db=require(_0x1215('0x5'))['db'];var utils=require(_0x1215('0x6'));var logger=require(_0x1215('0x7'))(_0x1215('0x8'));var config=require(_0x1215('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1215('0xa')][_0x1215('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b0346,_0x55549a,_0xa7ec86){return new BPromise(function(_0x4b2e67,_0x737c3a){return client[_0x1215('0xc')](_0x1b0346,_0xa7ec86)[_0x1215('0xd')](function(_0x2655f2){logger['info'](_0x1215('0xe'),_0x55549a,_0x1215('0xf'));logger[_0x1215('0x10')](_0x1215('0x11'),_0x55549a,_0x1215('0xf'),JSON['stringify'](_0x2655f2));if(_0x2655f2['error']){if(_0x2655f2[_0x1215('0x12')][_0x1215('0x13')]===0x1f4){logger[_0x1215('0x12')](_0x1215('0xe'),_0x55549a,_0x2655f2['error'][_0x1215('0x14')]);return _0x737c3a(_0x2655f2['error'][_0x1215('0x14')]);}logger[_0x1215('0x12')](_0x1215('0xe'),_0x55549a,_0x2655f2['error'][_0x1215('0x14')]);return _0x4b2e67(_0x2655f2[_0x1215('0x12')][_0x1215('0x14')]);}else{logger[_0x1215('0x15')](_0x1215('0xe'),_0x55549a,_0x1215('0xf'));_0x4b2e67(_0x2655f2[_0x1215('0x16')]['message']);}})[_0x1215('0x17')](function(_0x375004){logger['error'](_0x1215('0xe'),_0x55549a,_0x375004);_0x737c3a(_0x375004);});});} \ No newline at end of file +var _0xd9e6=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash'];(function(_0x575b5c,_0x11aaf0){var _0x42d320=function(_0x13ef81){while(--_0x13ef81){_0x575b5c['push'](_0x575b5c['shift']());}};_0x42d320(++_0x11aaf0);}(_0xd9e6,0x17f));var _0x6d9e=function(_0x63067c,_0x435042){_0x63067c=_0x63067c-0x0;var _0x5a5f36=_0xd9e6[_0x63067c];return _0x5a5f36;};'use strict';var _=require(_0x6d9e('0x0'));var util=require(_0x6d9e('0x1'));var moment=require(_0x6d9e('0x2'));var BPromise=require(_0x6d9e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d9e('0x4'));var db=require(_0x6d9e('0x5'))['db'];var utils=require(_0x6d9e('0x6'));var logger=require(_0x6d9e('0x7'))(_0x6d9e('0x8'));var config=require(_0x6d9e('0x9'));var jayson=require(_0x6d9e('0xa'));var client=jayson[_0x6d9e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x197f22,_0x211043,_0x319791){return new BPromise(function(_0x2a4896,_0x1cd605){return client[_0x6d9e('0xc')](_0x197f22,_0x319791)[_0x6d9e('0xd')](function(_0x4836df){logger['info'](_0x6d9e('0xe'),_0x211043,_0x6d9e('0xf'));logger[_0x6d9e('0x10')](_0x6d9e('0x11'),_0x211043,_0x6d9e('0xf'),JSON[_0x6d9e('0x12')](_0x4836df));if(_0x4836df[_0x6d9e('0x13')]){if(_0x4836df[_0x6d9e('0x13')][_0x6d9e('0x14')]===0x1f4){logger[_0x6d9e('0x13')](_0x6d9e('0xe'),_0x211043,_0x4836df[_0x6d9e('0x13')][_0x6d9e('0x15')]);return _0x1cd605(_0x4836df[_0x6d9e('0x13')][_0x6d9e('0x15')]);}logger['error'](_0x6d9e('0xe'),_0x211043,_0x4836df['error'][_0x6d9e('0x15')]);return _0x2a4896(_0x4836df['error']['message']);}else{logger[_0x6d9e('0x16')](_0x6d9e('0xe'),_0x211043,_0x6d9e('0xf'));_0x2a4896(_0x4836df[_0x6d9e('0x17')][_0x6d9e('0x15')]);}})['catch'](function(_0x35fc46){logger['error'](_0x6d9e('0xe'),_0x211043,_0x35fc46);_0x1cd605(_0x35fc46);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 0abedf4..549e363 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 _0xe577=['file','addLogo','%s%s','logologin','originalname','post','single','addLogoLogin','addPreferred','put','isAuthenticated','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','diskStorage','join','root','server/files/images/logos/','format','logo','extname'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe577,0x193));var _0x7e57=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xe577[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0x7e57('0x0'));var util=require('util');var path=require(_0x7e57('0x1'));var timeout=require(_0x7e57('0x2'));var express=require(_0x7e57('0x3'));var router=express[_0x7e57('0x4')]();var auth=require(_0x7e57('0x5'));var interaction=require(_0x7e57('0x6'));var config=require(_0x7e57('0x7'));var controller=require('./setting.controller');router[_0x7e57('0x8')]('/',auth['isAuthenticated'](),controller[_0x7e57('0x9')]);router[_0x7e57('0x8')](_0x7e57('0xa'),controller[_0x7e57('0xb')]);router[_0x7e57('0x8')](_0x7e57('0xc'),controller[_0x7e57('0xd')]);router[_0x7e57('0x8')](_0x7e57('0xe'),controller[_0x7e57('0xf')]);router[_0x7e57('0x8')]('/:id/gdpr',controller[_0x7e57('0x10')]);router['get'](_0x7e57('0x11'),controller[_0x7e57('0x12')]);var upload=multer({'storage':multer[_0x7e57('0x13')]({'destination':function(_0x107958,_0x618418,_0x4b6e09){_0x4b6e09(null,path[_0x7e57('0x14')](config[_0x7e57('0x15')],_0x7e57('0x16')));},'filename':function(_0x3e3c5e,_0x34e95c,_0x50b45d){_0x50b45d(null,util[_0x7e57('0x17')]('%s%s',_0x7e57('0x18'),path[_0x7e57('0x19')](_0x34e95c['originalname'])));}})});router['post']('/:id/logo',upload['single'](_0x7e57('0x1a')),controller[_0x7e57('0x1b')]);var upload=multer({'storage':multer[_0x7e57('0x13')]({'destination':function(_0x38c28b,_0x15af7e,_0x4aeac0){_0x4aeac0(null,path[_0x7e57('0x14')](config[_0x7e57('0x15')],'server/files/images/logos/'));},'filename':function(_0x1cfbfc,_0x1e9c49,_0x46f02b){_0x46f02b(null,util[_0x7e57('0x17')](_0x7e57('0x1c'),_0x7e57('0x1d'),path['extname'](_0x1e9c49[_0x7e57('0x1e')])));}})});router[_0x7e57('0x1f')](_0x7e57('0xe'),upload[_0x7e57('0x20')](_0x7e57('0x1a')),controller[_0x7e57('0x21')]);var upload=multer({'storage':multer[_0x7e57('0x13')]({'destination':function(_0x2fed8c,_0x1e3364,_0x55ead0){_0x55ead0(null,path['join'](config[_0x7e57('0x15')],_0x7e57('0x16')));},'filename':function(_0x26da0a,_0x3c410b,_0x167534){_0x167534(null,util[_0x7e57('0x17')](_0x7e57('0x1c'),'preferred',path[_0x7e57('0x19')](_0x3c410b[_0x7e57('0x1e')])));}})});router[_0x7e57('0x1f')](_0x7e57('0x11'),upload[_0x7e57('0x20')]('file'),controller[_0x7e57('0x22')]);router[_0x7e57('0x23')](_0x7e57('0xa'),auth[_0x7e57('0x24')](),controller[_0x7e57('0x25')]);module[_0x7e57('0x26')]=router; \ No newline at end of file +var _0x5353=['update','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','file','logologin','originalname','post','single','addLogoLogin','preferred','addPreferred','put'];(function(_0x18985f,_0x509281){var _0x5415a0=function(_0x3e1815){while(--_0x3e1815){_0x18985f['push'](_0x18985f['shift']());}};_0x5415a0(++_0x509281);}(_0x5353,0x146));var _0x3535=function(_0x5b5b4e,_0x2dff43){_0x5b5b4e=_0x5b5b4e-0x0;var _0x35573d=_0x5353[_0x5b5b4e];return _0x35573d;};'use strict';var multer=require(_0x3535('0x0'));var util=require('util');var path=require(_0x3535('0x1'));var timeout=require('connect-timeout');var express=require(_0x3535('0x2'));var router=express[_0x3535('0x3')]();var auth=require(_0x3535('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3535('0x5'));var controller=require('./setting.controller');router[_0x3535('0x6')]('/',auth[_0x3535('0x7')](),controller[_0x3535('0x8')]);router[_0x3535('0x6')](_0x3535('0x9'),controller['show']);router['get'](_0x3535('0xa'),controller[_0x3535('0xb')]);router[_0x3535('0x6')](_0x3535('0xc'),controller['getLogoLogin']);router[_0x3535('0x6')](_0x3535('0xd'),controller[_0x3535('0xe')]);router[_0x3535('0x6')](_0x3535('0xf'),controller[_0x3535('0x10')]);var upload=multer({'storage':multer[_0x3535('0x11')]({'destination':function(_0xdcc493,_0x163ee5,_0xf9dd9c){_0xf9dd9c(null,path[_0x3535('0x12')](config[_0x3535('0x13')],_0x3535('0x14')));},'filename':function(_0x6a0974,_0x12ed0a,_0x35f1a6){_0x35f1a6(null,util[_0x3535('0x15')](_0x3535('0x16'),_0x3535('0x17'),path[_0x3535('0x18')](_0x12ed0a['originalname'])));}})});router['post']('/:id/logo',upload['single'](_0x3535('0x19')),controller['addLogo']);var upload=multer({'storage':multer[_0x3535('0x11')]({'destination':function(_0x2f8896,_0x1c506c,_0x1f934c){_0x1f934c(null,path['join'](config[_0x3535('0x13')],_0x3535('0x14')));},'filename':function(_0x22c9c5,_0x506411,_0x297162){_0x297162(null,util[_0x3535('0x15')](_0x3535('0x16'),_0x3535('0x1a'),path['extname'](_0x506411[_0x3535('0x1b')])));}})});router[_0x3535('0x1c')](_0x3535('0xc'),upload[_0x3535('0x1d')]('file'),controller[_0x3535('0x1e')]);var upload=multer({'storage':multer[_0x3535('0x11')]({'destination':function(_0x2a983a,_0x5467bb,_0x46f536){_0x46f536(null,path[_0x3535('0x12')](config[_0x3535('0x13')],_0x3535('0x14')));},'filename':function(_0xbf37cb,_0x2ec3c8,_0x2b10b5){_0x2b10b5(null,util[_0x3535('0x15')](_0x3535('0x16'),_0x3535('0x1f'),path[_0x3535('0x18')](_0x2ec3c8['originalname'])));}})});router[_0x3535('0x1c')]('/:id/preferred',upload[_0x3535('0x1d')](_0x3535('0x19')),controller[_0x3535('0x20')]);router[_0x3535('0x21')](_0x3535('0x9'),auth['isAuthenticated'](),controller[_0x3535('0x22')]);module[_0x3535('0x23')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 8c8bea9..129a68b 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 _0x7cc2=['alternate','sequelize','exports','INTEGER','min_internal','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0xd6d24d,_0x4491a8){var _0xff8567=function(_0x18f87f){while(--_0x18f87f){_0xd6d24d['push'](_0xd6d24d['shift']());}};_0xff8567(++_0x4491a8);}(_0x7cc2,0x196));var _0x27cc=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x7cc2[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require(_0x27cc('0x0'));module[_0x27cc('0x1')]={'min_internal':{'type':Sequelize[_0x27cc('0x2')](0xb),'unique':_0x27cc('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x27cc('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x27cc('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x27cc('0x4')},'logo':{'type':Sequelize[_0x27cc('0x5')]},'defaultLogo':{'type':Sequelize[_0x27cc('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x27cc('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x27cc('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x27cc('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x27cc('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x27cc('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x27cc('0x5')]},'turnpassword':{'type':Sequelize[_0x27cc('0x5')]},'pageTitle':{'type':Sequelize[_0x27cc('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x27cc('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x27cc('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x27cc('0x5')],'defaultValue':_0x27cc('0x7')},'enableEmailPreview':{'type':Sequelize[_0x27cc('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x27cc('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x27cc('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x27cc('0x5')],'defaultValue':_0x27cc('0x8')},'chatTimeout':{'type':Sequelize[_0x27cc('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x27cc('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x27cc('0x5')]},'defaultPreferred':{'type':Sequelize[_0x27cc('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf482=['sequelize','exports','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x17650f,_0x4f7b20){var _0x40d6b8=function(_0x5c6f14){while(--_0x5c6f14){_0x17650f['push'](_0x17650f['shift']());}};_0x40d6b8(++_0x4f7b20);}(_0xf482,0xf0));var _0x2f48=function(_0x4101f5,_0x52f193){_0x4101f5=_0x4101f5-0x0;var _0x344db7=_0xf482[_0x4101f5];return _0x344db7;};'use strict';var Sequelize=require(_0x2f48('0x0'));module[_0x2f48('0x1')]={'min_internal':{'type':Sequelize[_0x2f48('0x2')](0xb),'unique':_0x2f48('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x2f48('0x2')](0xb),'unique':_0x2f48('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x2f48('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x2f48('0x5')},'logo':{'type':Sequelize[_0x2f48('0x6')]},'defaultLogo':{'type':Sequelize[_0x2f48('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x2f48('0x6')]},'defaultLoginLogo':{'type':Sequelize[_0x2f48('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x2f48('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x2f48('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x2f48('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x2f48('0x6')]},'turnaddr':{'type':Sequelize[_0x2f48('0x6')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x2f48('0x6')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x2f48('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x2f48('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x2f48('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x2f48('0x8')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x2f48('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x2f48('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x2f48('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x2f48('0x6')],'defaultValue':_0x2f48('0x9')},'chatTimeout':{'type':Sequelize[_0x2f48('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x2f48('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x2f48('0x6')]},'defaultPreferred':{'type':Sequelize[_0x2f48('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x2f48('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index bb40c13..33baa33 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 _0xe056=['../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','json','count','limit','set','Content-Range','apply','reject','then','destroy','end','sendStatus','name','index','Setting','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','offset','sort','where','filters','pick','type','key','VIRTUAL','merge','include','rows','catch','show','params','includeAll','options','find','update','get','readFileSync','join','root','server/files/templates/stun.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','logo','body','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','default','upperFirst','custom','Sequelize','ValidationError','Logo\x20not\x20found','download','getLogoLogin','default_loginLogo.png','securePassword','addPreferred','getPreferred','default_preferred.png','rimraf','zip-dir','fast-json-patch','moment','mustache','util','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs'];(function(_0x14064a,_0xdc7bf0){var _0x4f993e=function(_0x5e9e3f){while(--_0x5e9e3f){_0x14064a['push'](_0x14064a['shift']());}};_0x4f993e(++_0xdc7bf0);}(_0xe056,0xdb));var _0x6e05=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xe056[_0xdc37a1];return _0x99b4fe;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6e05('0x0'));var zipdir=require(_0x6e05('0x1'));var jsonpatch=require(_0x6e05('0x2'));var rp=require('request-promise');var moment=require(_0x6e05('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6e05('0x4'));var util=require(_0x6e05('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6e05('0x6'));var fs=require('fs');var _=require(_0x6e05('0x7'));var squel=require(_0x6e05('0x8'));var crypto=require('crypto');var jsforce=require(_0x6e05('0x9'));var deskjs=require(_0x6e05('0xa'));var toCsv=require(_0x6e05('0xb'));var querystring=require(_0x6e05('0xc'));var Papa=require(_0x6e05('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x6e05('0xe'));var Redis=require(_0x6e05('0xf'));var qs=require(_0x6e05('0x10'));var logger=require(_0x6e05('0x11'))(_0x6e05('0x12'));var utils=require(_0x6e05('0x13'));var config=require('../../config/environment');var db=require(_0x6e05('0x14'))['db'];var jayson=require(_0x6e05('0x15'));var client=jayson[_0x6e05('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x111a7c,_0x41ce19,_0x474136,_0x1b4dff){return new BPromise(function(_0x38d325,_0x4f4fab){var _0x20afe3=_0x1b4dff||client;return _0x20afe3[_0x6e05('0x17')](_0x111a7c,_0x474136)['then'](function(_0x5459a6){logger[_0x6e05('0x18')](_0x6e05('0x19'),_0x41ce19,_0x6e05('0x1a'));logger['debug'](_0x6e05('0x1b'),_0x41ce19,'request\x20sent',JSON[_0x6e05('0x1c')](_0x5459a6));if(_0x5459a6[_0x6e05('0x1d')]){if(_0x5459a6['error']['code']===0x1f4){logger[_0x6e05('0x1d')](_0x6e05('0x19'),_0x41ce19,_0x5459a6[_0x6e05('0x1d')][_0x6e05('0x1e')]);return _0x4f4fab(_0x5459a6[_0x6e05('0x1d')]['message']);}logger[_0x6e05('0x1d')]('Setting,\x20%s,\x20%s',_0x41ce19,_0x5459a6['error'][_0x6e05('0x1e')]);return _0x38d325(_0x5459a6[_0x6e05('0x1d')][_0x6e05('0x1e')]);}else{logger[_0x6e05('0x18')](_0x6e05('0x19'),_0x41ce19,_0x6e05('0x1a'));_0x38d325(_0x5459a6[_0x6e05('0x1f')][_0x6e05('0x1e')]);}})['catch'](function(_0x1438a6){logger['error'](_0x6e05('0x19'),_0x41ce19,_0x1438a6);_0x4f4fab(_0x1438a6);});});}function respondWithStatusCode(_0xf8938e,_0x3eb6e4){_0x3eb6e4=_0x3eb6e4||0xcc;return function(_0x5988b5){if(_0x5988b5){return _0xf8938e['sendStatus'](_0x3eb6e4);}return _0xf8938e[_0x6e05('0x20')](_0x3eb6e4)['end']();};}function respondWithResult(_0xd37372,_0x63172e){_0x63172e=_0x63172e||0xc8;return function(_0x34e089){if(_0x34e089){return _0xd37372[_0x6e05('0x20')](_0x63172e)[_0x6e05('0x21')](_0x34e089);}};}function respondWithFilteredResult(_0x19f3a6,_0x46ce2e){return function(_0x5d7701){if(_0x5d7701){var _0x3b8842=_0x5d7701[_0x6e05('0x22')],_0x3bdfef=_0x46ce2e['offset'],_0x59a2e4=_0x46ce2e['offset']+_0x46ce2e[_0x6e05('0x23')],_0x169684;if(_0x59a2e4>=_0x3b8842){_0x59a2e4=_0x3b8842;_0x169684=0xc8;}else{_0x169684=0xce;}_0x19f3a6['status'](_0x169684);return _0x19f3a6[_0x6e05('0x24')](_0x6e05('0x25'),_0x3bdfef+'-'+_0x59a2e4+'/'+_0x3b8842)['json'](_0x5d7701);}return null;};}function patchUpdates(_0x4e15c7){return function(_0x3f19f7){try{jsonpatch[_0x6e05('0x26')](_0x3f19f7,_0x4e15c7,!![]);}catch(_0x2466aa){return BPromise[_0x6e05('0x27')](_0x2466aa);}return _0x3f19f7['save']();};}function saveUpdates(_0x2bc108,_0x2791ee){return function(_0x8fa8b1){if(_0x8fa8b1){return _0x8fa8b1['update'](_0x2bc108)[_0x6e05('0x28')](function(_0x584142){return _0x584142;});}return null;};}function removeEntity(_0x5a882e,_0x54065e){return function(_0x3a6f85){if(_0x3a6f85){return _0x3a6f85[_0x6e05('0x29')]()[_0x6e05('0x28')](function(){_0x5a882e[_0x6e05('0x20')](0xcc)[_0x6e05('0x2a')]();});}};}function handleEntityNotFound(_0xd3f7a6,_0x22d697){return function(_0x5c9446){if(!_0x5c9446){_0xd3f7a6[_0x6e05('0x2b')](0x194);}return _0x5c9446;};}function handleError(_0x4a1ed5,_0x332e21){_0x332e21=_0x332e21||0x1f4;return function(_0x4b17a1){logger[_0x6e05('0x1d')](_0x4b17a1['stack']);if(_0x4b17a1[_0x6e05('0x2c')]){delete _0x4b17a1['name'];}_0x4a1ed5[_0x6e05('0x20')](_0x332e21)['send'](_0x4b17a1);};}exports[_0x6e05('0x2d')]=function(_0x3156d0,_0x1cb3d7){var _0x43564e={},_0x3f03f8={},_0x2002c6={'count':0x0,'rows':[]};var _0x5d13f2=db[_0x6e05('0x2e')][_0x6e05('0x2f')];_0x3f03f8[_0x6e05('0x30')]=_[_0x6e05('0x31')](_0x5d13f2);_0x3f03f8['query']=_['keys'](_0x3156d0[_0x6e05('0x32')]);_0x3f03f8['filters']=_[_0x6e05('0x33')](_0x3f03f8[_0x6e05('0x30')],_0x3f03f8[_0x6e05('0x32')]);_0x43564e[_0x6e05('0x34')]=_['intersection'](_0x3f03f8[_0x6e05('0x30')],qs['fields'](_0x3156d0['query'][_0x6e05('0x35')]));_0x43564e['attributes']=_0x43564e[_0x6e05('0x34')][_0x6e05('0x36')]?_0x43564e[_0x6e05('0x34')]:_0x3f03f8[_0x6e05('0x30')];if(!_0x3156d0[_0x6e05('0x32')]['hasOwnProperty'](_0x6e05('0x37'))){_0x43564e['limit']=qs[_0x6e05('0x23')](_0x3156d0[_0x6e05('0x32')]['limit']);_0x43564e[_0x6e05('0x38')]=qs[_0x6e05('0x38')](_0x3156d0[_0x6e05('0x32')][_0x6e05('0x38')]);}_0x43564e['order']=qs['sort'](_0x3156d0[_0x6e05('0x32')][_0x6e05('0x39')]);_0x43564e[_0x6e05('0x3a')]=qs[_0x6e05('0x3b')](_[_0x6e05('0x3c')](_0x3156d0['query'],_0x3f03f8[_0x6e05('0x3b')]));if(_0x3156d0['query']['filter']){_0x43564e['where']=_['merge'](_0x43564e[_0x6e05('0x3a')],{'$or':_['map'](_0x5d13f2,function(_0x506515){if(_0x506515[_0x6e05('0x3d')][_0x6e05('0x3e')]!==_0x6e05('0x3f')){var _0xb5e988={};_0xb5e988[_0x506515['field']]={'$like':'%'+_0x3156d0[_0x6e05('0x32')]['filter']+'%'};return _0xb5e988;}})});}_0x43564e=_[_0x6e05('0x40')]({},_0x43564e,_0x3156d0['options']);var _0x6883dd={'where':_0x43564e['where']};return db[_0x6e05('0x2e')]['count'](_0x6883dd)[_0x6e05('0x28')](function(_0x9f98e9){_0x2002c6[_0x6e05('0x22')]=_0x9f98e9;if(_0x3156d0['query']['includeAll']){_0x43564e[_0x6e05('0x41')]=[{'all':!![]}];}return db[_0x6e05('0x2e')]['findAll'](_0x43564e);})[_0x6e05('0x28')](function(_0x393bc2){_0x2002c6[_0x6e05('0x42')]=_0x393bc2;return _0x2002c6;})[_0x6e05('0x28')](respondWithFilteredResult(_0x1cb3d7,_0x43564e))[_0x6e05('0x43')](handleError(_0x1cb3d7,null));};exports[_0x6e05('0x44')]=function(_0x38e20a,_0x3d0c95){var _0x3584a7={'raw':![],'where':{'id':_0x38e20a[_0x6e05('0x45')]['id']}},_0x3e6c8d={};_0x3e6c8d[_0x6e05('0x30')]=_[_0x6e05('0x31')](db[_0x6e05('0x2e')][_0x6e05('0x2f')]);_0x3e6c8d[_0x6e05('0x32')]=_['keys'](_0x38e20a[_0x6e05('0x32')]);_0x3e6c8d[_0x6e05('0x3b')]=_[_0x6e05('0x33')](_0x3e6c8d[_0x6e05('0x30')],_0x3e6c8d['query']);_0x3584a7['attributes']=_[_0x6e05('0x33')](_0x3e6c8d['model'],qs[_0x6e05('0x35')](_0x38e20a[_0x6e05('0x32')][_0x6e05('0x35')]));_0x3584a7[_0x6e05('0x34')]=_0x3584a7['attributes'][_0x6e05('0x36')]?_0x3584a7[_0x6e05('0x34')]:_0x3e6c8d[_0x6e05('0x30')];if(_0x38e20a[_0x6e05('0x32')][_0x6e05('0x46')]){_0x3584a7['include']=[{'all':!![]}];}_0x3584a7=_[_0x6e05('0x40')]({},_0x3584a7,_0x38e20a[_0x6e05('0x47')]);return db['Setting'][_0x6e05('0x48')](_0x3584a7)[_0x6e05('0x28')](handleEntityNotFound(_0x3d0c95,null))[_0x6e05('0x28')](respondWithResult(_0x3d0c95,null))[_0x6e05('0x43')](handleError(_0x3d0c95,null));};exports[_0x6e05('0x49')]=function(_0x4c28e6,_0x36578a,_0x1ca4b0){var _0x135c00;return db[_0x6e05('0x2e')][_0x6e05('0x48')]({'where':{'id':_0x4c28e6['params']['id']}})[_0x6e05('0x28')](handleEntityNotFound(_0x36578a,null))[_0x6e05('0x28')](saveUpdates(_0x4c28e6['body'],null))[_0x6e05('0x28')](function(_0xd57db1){if(_0xd57db1){_0x135c00=_0xd57db1[_0x6e05('0x4a')]({'plain':!![]});var _0x52f37b=fs[_0x6e05('0x4b')](path[_0x6e05('0x4c')](config[_0x6e05('0x4d')],_0x6e05('0x4e')),_0x6e05('0x4f'));var _0x50c0de=ejs['render'](_0x52f37b,_0x135c00);var _0x226906=fs[_0x6e05('0x4b')](path['join'](config[_0x6e05('0x4d')],'server/files/templates/turn.ejs'),_0x6e05('0x4f'));var _0x5d1699=ejs[_0x6e05('0x50')](_0x226906,_0x135c00);fs[_0x6e05('0x51')](_0x6e05('0x52'),_0x50c0de);fs['writeFileSync'](_0x6e05('0x53'),_0x5d1699);return respondWithRpcPromise(_0x6e05('0x54'),_0x6e05('0x49'),{'module':_0x6e05('0x55')});}})[_0x6e05('0x28')](function(){return respondWithRpcPromise(_0x6e05('0x54'),_0x6e05('0x49'),{'module':_0x6e05('0x56')});})[_0x6e05('0x28')](function(){return _0x135c00||null;})['then'](respondWithResult(_0x36578a,null))[_0x6e05('0x43')](handleError(_0x36578a,null));};exports[_0x6e05('0x57')]=function(_0x10ae95,_0x4913f4,_0x254f7a){if(_0x10ae95[_0x6e05('0x58')]&&_0x10ae95['file'][_0x6e05('0x59')]){_0x10ae95['body'][_0x6e05('0x5a')]=_0x10ae95[_0x6e05('0x58')][_0x6e05('0x59')];}return db['Setting'][_0x6e05('0x48')]({'where':{'id':_0x10ae95[_0x6e05('0x45')]['id']}})['then'](handleEntityNotFound(_0x4913f4,null))[_0x6e05('0x28')](saveUpdates(_0x10ae95[_0x6e05('0x5b')],null))[_0x6e05('0x28')](respondWithResult(_0x4913f4,null))['catch'](handleError(_0x4913f4,null));};exports[_0x6e05('0x5c')]=function(_0x4e4979,_0x146f86,_0x630edb){if(_0x4e4979[_0x6e05('0x58')]&&_0x4e4979[_0x6e05('0x58')][_0x6e05('0x59')]){_0x4e4979[_0x6e05('0x5b')][_0x6e05('0x5d')]=_0x4e4979[_0x6e05('0x58')]['filename'];}return db[_0x6e05('0x2e')][_0x6e05('0x48')]({'where':{'id':_0x4e4979[_0x6e05('0x45')]['id']}})[_0x6e05('0x28')](handleEntityNotFound(_0x146f86,null))['then'](saveUpdates(_0x4e4979[_0x6e05('0x5b')],null))[_0x6e05('0x28')](respondWithResult(_0x146f86,null))[_0x6e05('0x43')](handleError(_0x146f86,null));};var utilLicense=require(_0x6e05('0x5e'));exports[_0x6e05('0x5f')]=function(_0x27744b,_0x2d9a3e,_0x264eb0){var _0x5eb206=_0x6e05('0x60');var _0x49883d={'custom':![]};return utilLicense[_0x6e05('0x61')]()[_0x6e05('0x28')](function(_0x500c4b){if(_0x500c4b){_0x49883d=_0x500c4b;}return db[_0x6e05('0x2e')]['find']({'where':{'id':_0x27744b[_0x6e05('0x45')]['id']},'attributes':[_0x6e05('0x5a'),_0x6e05('0x5d'),_0x6e05('0x62'),_0x6e05('0x63'),_0x6e05('0x64'),_0x6e05('0x65')],'raw':!![]});})[_0x6e05('0x28')](handleEntityNotFound(_0x2d9a3e,null))[_0x6e05('0x28')](function(_0x2d275a){if(_0x2d275a){var _0x3d0b56=_0x2d275a['logo']&&fs[_0x6e05('0x66')](path['join'](config[_0x6e05('0x4d')],_0x5eb206,_[_0x6e05('0x67')](_0x2d275a[_0x6e05('0x5a')])))?path[_0x6e05('0x4c')](config[_0x6e05('0x4d')],_0x5eb206,_[_0x6e05('0x67')](_0x2d275a[_0x6e05('0x5a')])):path[_0x6e05('0x4c')](config[_0x6e05('0x4d')],_0x5eb206,_['toLower'](_0x6e05('0x68')));var _0x82862a=_0x6e05('0x69')+_[_0x6e05('0x6a')](_0x6e05('0x5a'));if(_0x2d275a[_0x82862a]||!_0x49883d[_0x6e05('0x6b')]){_0x3d0b56=path[_0x6e05('0x4c')](config[_0x6e05('0x4d')],_0x5eb206,_[_0x6e05('0x67')](_0x6e05('0x68')));}if(!fs[_0x6e05('0x66')](_0x3d0b56)){throw new db[(_0x6e05('0x6c'))][(_0x6e05('0x6d'))](_0x6e05('0x6e'));}return _0x2d9a3e[_0x6e05('0x6f')](_0x3d0b56);}})[_0x6e05('0x43')](handleError(_0x2d9a3e,null));};var utilLicense=require(_0x6e05('0x5e'));exports[_0x6e05('0x70')]=function(_0x3bf65c,_0x50d13e,_0xaea56e){var _0xb8d4e4='server/files/images/logos';var _0x45e510={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x4b90ab){if(_0x4b90ab){_0x45e510=_0x4b90ab;}return db[_0x6e05('0x2e')][_0x6e05('0x48')]({'where':{'id':_0x3bf65c[_0x6e05('0x45')]['id']},'attributes':[_0x6e05('0x5a'),'loginLogo','preferred',_0x6e05('0x63'),_0x6e05('0x64'),_0x6e05('0x65')],'raw':!![]});})[_0x6e05('0x28')](handleEntityNotFound(_0x50d13e,null))[_0x6e05('0x28')](function(_0x1af1d2){if(_0x1af1d2){var _0x535e4b=_0x1af1d2['loginLogo']&&fs['existsSync'](path[_0x6e05('0x4c')](config[_0x6e05('0x4d')],_0xb8d4e4,_[_0x6e05('0x67')](_0x1af1d2[_0x6e05('0x5d')])))?path[_0x6e05('0x4c')](config[_0x6e05('0x4d')],_0xb8d4e4,_['toLower'](_0x1af1d2[_0x6e05('0x5d')])):path['join'](config['root'],_0xb8d4e4,_['toLower'](_0x6e05('0x71')));var _0xaeee79=_0x6e05('0x69')+_[_0x6e05('0x6a')](_0x6e05('0x5d'));if(_0x1af1d2[_0xaeee79]||!_0x45e510[_0x6e05('0x6b')]){_0x535e4b=path[_0x6e05('0x4c')](config[_0x6e05('0x4d')],_0xb8d4e4,_[_0x6e05('0x67')](_0x6e05('0x71')));}if(!fs[_0x6e05('0x66')](_0x535e4b)){throw new db['Sequelize']['ValidationError']('Logo\x20not\x20found');}return _0x50d13e[_0x6e05('0x6f')](_0x535e4b);}})[_0x6e05('0x43')](handleError(_0x50d13e,null));};exports['gdpr']=function(_0x199e2c,_0x1c5735){return db['Setting'][_0x6e05('0x48')]({'where':{'id':_0x199e2c[_0x6e05('0x45')]['id']},'attributes':[_0x6e05('0x72')]})['then'](respondWithResult(_0x1c5735,null))['catch'](handleError(_0x1c5735,null));};exports[_0x6e05('0x73')]=function(_0x1bc1d0,_0x38bbca,_0x4a2951){if(_0x1bc1d0['file']&&_0x1bc1d0[_0x6e05('0x58')]['filename']){_0x1bc1d0[_0x6e05('0x5b')]['preferred']=_0x1bc1d0['file']['filename'];}return db[_0x6e05('0x2e')][_0x6e05('0x48')]({'where':{'id':_0x1bc1d0[_0x6e05('0x45')]['id']}})[_0x6e05('0x28')](handleEntityNotFound(_0x38bbca,null))[_0x6e05('0x28')](saveUpdates(_0x1bc1d0[_0x6e05('0x5b')],null))['then'](respondWithResult(_0x38bbca,null))[_0x6e05('0x43')](handleError(_0x38bbca,null));};var utilLicense=require(_0x6e05('0x5e'));exports[_0x6e05('0x74')]=function(_0x2d38fa,_0x57b112,_0x22c003){var _0x5cd205=_0x6e05('0x60');var _0x69f9dd={'custom':![]};return utilLicense[_0x6e05('0x61')]()['then'](function(_0x36987f){if(_0x36987f){_0x69f9dd=_0x36987f;}return db[_0x6e05('0x2e')][_0x6e05('0x48')]({'where':{'id':_0x2d38fa[_0x6e05('0x45')]['id']},'attributes':[_0x6e05('0x5a'),'loginLogo',_0x6e05('0x62'),_0x6e05('0x63'),_0x6e05('0x64'),'defaultPreferred'],'raw':!![]});})[_0x6e05('0x28')](handleEntityNotFound(_0x57b112,null))['then'](function(_0x17921c){if(_0x17921c){var _0x5c37ad=_0x17921c[_0x6e05('0x62')]&&fs['existsSync'](path[_0x6e05('0x4c')](config[_0x6e05('0x4d')],_0x5cd205,_[_0x6e05('0x67')](_0x17921c[_0x6e05('0x62')])))?path[_0x6e05('0x4c')](config[_0x6e05('0x4d')],_0x5cd205,_[_0x6e05('0x67')](_0x17921c[_0x6e05('0x62')])):path[_0x6e05('0x4c')](config[_0x6e05('0x4d')],_0x5cd205,_[_0x6e05('0x67')](_0x6e05('0x75')));var _0x3d5d53=_0x6e05('0x69')+_[_0x6e05('0x6a')](_0x6e05('0x62'));if(_0x17921c[_0x3d5d53]||!_0x69f9dd['custom']||!_0x69f9dd[_0x6e05('0x62')]){_0x5c37ad=path['join'](config['root'],_0x5cd205,_[_0x6e05('0x67')](_0x6e05('0x75')));}if(!fs[_0x6e05('0x66')](_0x5c37ad)){throw new db[(_0x6e05('0x6c'))][(_0x6e05('0x6d'))](_0x6e05('0x6e'));}return _0x57b112[_0x6e05('0x6f')](_0x5c37ad);}})[_0x6e05('0x43')](handleError(_0x57b112,null));}; \ No newline at end of file +var _0x33af=['mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','stack','Setting','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','map','type','key','field','merge','options','count','includeAll','include','findAll','params','find','body','get','readFileSync','root','server/files/templates/stun.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','existsSync','join','toLower','default_logo.png','default','upperFirst','custom','ValidationError','Logo\x20not\x20found','download','getLogoLogin','defaultPreferred','default_loginLogo.png','Sequelize','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x33af,0xec));var _0xf33a=function(_0x1d7466,_0x161771){_0x1d7466=_0x1d7466-0x0;var _0x3ebbb6=_0x33af[_0x1d7466];return _0x3ebbb6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf33a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf33a('0x1'));var jsonpatch=require(_0xf33a('0x2'));var rp=require(_0xf33a('0x3'));var moment=require(_0xf33a('0x4'));var BPromise=require(_0xf33a('0x5'));var Mustache=require(_0xf33a('0x6'));var util=require('util');var path=require(_0xf33a('0x7'));var sox=require(_0xf33a('0x8'));var csv=require('to-csv');var ejs=require(_0xf33a('0x9'));var fs=require('fs');var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var authService=require(_0xf33a('0x11'));var hardwareService=require(_0xf33a('0x12'));var Redis=require(_0xf33a('0x13'));var qs=require(_0xf33a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf33a('0x15'));var config=require(_0xf33a('0x16'));var db=require(_0xf33a('0x17'))['db'];var jayson=require(_0xf33a('0x18'));var client=jayson[_0xf33a('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9f87bc,_0x21b80e,_0x549978,_0x506924){return new BPromise(function(_0x374b01,_0x1b3bf0){var _0x17043=_0x506924||client;return _0x17043[_0xf33a('0x1a')](_0x9f87bc,_0x549978)[_0xf33a('0x1b')](function(_0xc01217){logger[_0xf33a('0x1c')](_0xf33a('0x1d'),_0x21b80e,'request\x20sent');logger[_0xf33a('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x21b80e,_0xf33a('0x1f'),JSON[_0xf33a('0x20')](_0xc01217));if(_0xc01217['error']){if(_0xc01217[_0xf33a('0x21')][_0xf33a('0x22')]===0x1f4){logger['error'](_0xf33a('0x1d'),_0x21b80e,_0xc01217[_0xf33a('0x21')][_0xf33a('0x23')]);return _0x1b3bf0(_0xc01217[_0xf33a('0x21')]['message']);}logger[_0xf33a('0x21')](_0xf33a('0x1d'),_0x21b80e,_0xc01217[_0xf33a('0x21')][_0xf33a('0x23')]);return _0x374b01(_0xc01217[_0xf33a('0x21')][_0xf33a('0x23')]);}else{logger[_0xf33a('0x1c')](_0xf33a('0x1d'),_0x21b80e,_0xf33a('0x1f'));_0x374b01(_0xc01217[_0xf33a('0x24')]['message']);}})[_0xf33a('0x25')](function(_0x272e60){logger[_0xf33a('0x21')](_0xf33a('0x1d'),_0x21b80e,_0x272e60);_0x1b3bf0(_0x272e60);});});}function respondWithStatusCode(_0x2ab756,_0x51d3fd){_0x51d3fd=_0x51d3fd||0xcc;return function(_0x44654c){if(_0x44654c){return _0x2ab756['sendStatus'](_0x51d3fd);}return _0x2ab756[_0xf33a('0x26')](_0x51d3fd)[_0xf33a('0x27')]();};}function respondWithResult(_0x394468,_0x17b12d){_0x17b12d=_0x17b12d||0xc8;return function(_0x429b83){if(_0x429b83){return _0x394468['status'](_0x17b12d)[_0xf33a('0x28')](_0x429b83);}};}function respondWithFilteredResult(_0x393005,_0x5edf1a){return function(_0x4af24a){if(_0x4af24a){var _0x16ef31=_0x4af24a['count'],_0x5f0a53=_0x5edf1a[_0xf33a('0x29')],_0x5cf981=_0x5edf1a['offset']+_0x5edf1a[_0xf33a('0x2a')],_0x38eba2;if(_0x5cf981>=_0x16ef31){_0x5cf981=_0x16ef31;_0x38eba2=0xc8;}else{_0x38eba2=0xce;}_0x393005[_0xf33a('0x26')](_0x38eba2);return _0x393005[_0xf33a('0x2b')](_0xf33a('0x2c'),_0x5f0a53+'-'+_0x5cf981+'/'+_0x16ef31)[_0xf33a('0x28')](_0x4af24a);}return null;};}function patchUpdates(_0x3068a9){return function(_0x1d19ee){try{jsonpatch[_0xf33a('0x2d')](_0x1d19ee,_0x3068a9,!![]);}catch(_0x26e81){return BPromise[_0xf33a('0x2e')](_0x26e81);}return _0x1d19ee[_0xf33a('0x2f')]();};}function saveUpdates(_0x8f8ddc,_0x22c9f2){return function(_0x3f714e){if(_0x3f714e){return _0x3f714e[_0xf33a('0x30')](_0x8f8ddc)['then'](function(_0x627fd2){return _0x627fd2;});}return null;};}function removeEntity(_0x293cb5,_0x1fc982){return function(_0xbdc10e){if(_0xbdc10e){return _0xbdc10e['destroy']()[_0xf33a('0x1b')](function(){_0x293cb5[_0xf33a('0x26')](0xcc)[_0xf33a('0x27')]();});}};}function handleEntityNotFound(_0x31cb7c,_0x341d10){return function(_0x109d84){if(!_0x109d84){_0x31cb7c['sendStatus'](0x194);}return _0x109d84;};}function handleError(_0x1e7179,_0x6f5b94){_0x6f5b94=_0x6f5b94||0x1f4;return function(_0x3956aa){logger[_0xf33a('0x21')](_0x3956aa[_0xf33a('0x31')]);if(_0x3956aa['name']){delete _0x3956aa['name'];}_0x1e7179[_0xf33a('0x26')](_0x6f5b94)['send'](_0x3956aa);};}exports['index']=function(_0x4b9036,_0x2c4840){var _0xbe711d={},_0x5ae415={},_0x21f250={'count':0x0,'rows':[]};var _0x55f457=db[_0xf33a('0x32')][_0xf33a('0x33')];_0x5ae415[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x55f457);_0x5ae415[_0xf33a('0x36')]=_[_0xf33a('0x35')](_0x4b9036['query']);_0x5ae415[_0xf33a('0x37')]=_[_0xf33a('0x38')](_0x5ae415['model'],_0x5ae415[_0xf33a('0x36')]);_0xbe711d[_0xf33a('0x39')]=_[_0xf33a('0x38')](_0x5ae415['model'],qs[_0xf33a('0x3a')](_0x4b9036[_0xf33a('0x36')][_0xf33a('0x3a')]));_0xbe711d[_0xf33a('0x39')]=_0xbe711d[_0xf33a('0x39')][_0xf33a('0x3b')]?_0xbe711d[_0xf33a('0x39')]:_0x5ae415[_0xf33a('0x34')];if(!_0x4b9036[_0xf33a('0x36')]['hasOwnProperty'](_0xf33a('0x3c'))){_0xbe711d[_0xf33a('0x2a')]=qs['limit'](_0x4b9036[_0xf33a('0x36')]['limit']);_0xbe711d['offset']=qs[_0xf33a('0x29')](_0x4b9036[_0xf33a('0x36')]['offset']);}_0xbe711d[_0xf33a('0x3d')]=qs[_0xf33a('0x3e')](_0x4b9036[_0xf33a('0x36')]['sort']);_0xbe711d[_0xf33a('0x3f')]=qs[_0xf33a('0x37')](_['pick'](_0x4b9036[_0xf33a('0x36')],_0x5ae415[_0xf33a('0x37')]));if(_0x4b9036[_0xf33a('0x36')][_0xf33a('0x40')]){_0xbe711d[_0xf33a('0x3f')]=_['merge'](_0xbe711d[_0xf33a('0x3f')],{'$or':_[_0xf33a('0x41')](_0x55f457,function(_0x2325eb){if(_0x2325eb[_0xf33a('0x42')][_0xf33a('0x43')]!=='VIRTUAL'){var _0x175825={};_0x175825[_0x2325eb[_0xf33a('0x44')]]={'$like':'%'+_0x4b9036[_0xf33a('0x36')]['filter']+'%'};return _0x175825;}})});}_0xbe711d=_[_0xf33a('0x45')]({},_0xbe711d,_0x4b9036[_0xf33a('0x46')]);var _0x428d75={'where':_0xbe711d[_0xf33a('0x3f')]};return db[_0xf33a('0x32')][_0xf33a('0x47')](_0x428d75)['then'](function(_0x19aade){_0x21f250[_0xf33a('0x47')]=_0x19aade;if(_0x4b9036[_0xf33a('0x36')][_0xf33a('0x48')]){_0xbe711d[_0xf33a('0x49')]=[{'all':!![]}];}return db['Setting'][_0xf33a('0x4a')](_0xbe711d);})[_0xf33a('0x1b')](function(_0x1541fa){_0x21f250['rows']=_0x1541fa;return _0x21f250;})[_0xf33a('0x1b')](respondWithFilteredResult(_0x2c4840,_0xbe711d))[_0xf33a('0x25')](handleError(_0x2c4840,null));};exports['show']=function(_0x4c0f24,_0x3cb451){var _0x5c971c={'raw':![],'where':{'id':_0x4c0f24[_0xf33a('0x4b')]['id']}},_0x36b8f6={};_0x36b8f6[_0xf33a('0x34')]=_[_0xf33a('0x35')](db[_0xf33a('0x32')][_0xf33a('0x33')]);_0x36b8f6[_0xf33a('0x36')]=_[_0xf33a('0x35')](_0x4c0f24[_0xf33a('0x36')]);_0x36b8f6[_0xf33a('0x37')]=_[_0xf33a('0x38')](_0x36b8f6[_0xf33a('0x34')],_0x36b8f6[_0xf33a('0x36')]);_0x5c971c[_0xf33a('0x39')]=_[_0xf33a('0x38')](_0x36b8f6[_0xf33a('0x34')],qs[_0xf33a('0x3a')](_0x4c0f24[_0xf33a('0x36')][_0xf33a('0x3a')]));_0x5c971c[_0xf33a('0x39')]=_0x5c971c[_0xf33a('0x39')][_0xf33a('0x3b')]?_0x5c971c[_0xf33a('0x39')]:_0x36b8f6[_0xf33a('0x34')];if(_0x4c0f24[_0xf33a('0x36')][_0xf33a('0x48')]){_0x5c971c[_0xf33a('0x49')]=[{'all':!![]}];}_0x5c971c=_[_0xf33a('0x45')]({},_0x5c971c,_0x4c0f24[_0xf33a('0x46')]);return db['Setting'][_0xf33a('0x4c')](_0x5c971c)[_0xf33a('0x1b')](handleEntityNotFound(_0x3cb451,null))['then'](respondWithResult(_0x3cb451,null))[_0xf33a('0x25')](handleError(_0x3cb451,null));};exports[_0xf33a('0x30')]=function(_0x36cba8,_0x48c9a6,_0x43a45e){var _0x1f5324;return db[_0xf33a('0x32')]['find']({'where':{'id':_0x36cba8[_0xf33a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x48c9a6,null))[_0xf33a('0x1b')](saveUpdates(_0x36cba8[_0xf33a('0x4d')],null))['then'](function(_0x4b7fd8){if(_0x4b7fd8){_0x1f5324=_0x4b7fd8[_0xf33a('0x4e')]({'plain':!![]});var _0x3ebf4c=fs[_0xf33a('0x4f')](path['join'](config[_0xf33a('0x50')],_0xf33a('0x51')),_0xf33a('0x52'));var _0x24f373=ejs[_0xf33a('0x53')](_0x3ebf4c,_0x1f5324);var _0x40e468=fs[_0xf33a('0x4f')](path['join'](config[_0xf33a('0x50')],'server/files/templates/turn.ejs'),'utf8');var _0x55c0ae=ejs[_0xf33a('0x53')](_0x40e468,_0x1f5324);fs[_0xf33a('0x54')](_0xf33a('0x55'),_0x24f373);fs['writeFileSync'](_0xf33a('0x56'),_0x55c0ae);return respondWithRpcPromise(_0xf33a('0x57'),_0xf33a('0x30'),{'module':_0xf33a('0x58')});}})[_0xf33a('0x1b')](function(){return respondWithRpcPromise('Reload','update',{'module':'res_rtp_asterisk.so'});})[_0xf33a('0x1b')](function(){return _0x1f5324||null;})['then'](respondWithResult(_0x48c9a6,null))[_0xf33a('0x25')](handleError(_0x48c9a6,null));};exports[_0xf33a('0x59')]=function(_0x1a8f75,_0x430d7b,_0xe5f799){if(_0x1a8f75[_0xf33a('0x5a')]&&_0x1a8f75['file'][_0xf33a('0x5b')]){_0x1a8f75[_0xf33a('0x4d')][_0xf33a('0x5c')]=_0x1a8f75['file'][_0xf33a('0x5b')];}return db[_0xf33a('0x32')][_0xf33a('0x4c')]({'where':{'id':_0x1a8f75[_0xf33a('0x4b')]['id']}})[_0xf33a('0x1b')](handleEntityNotFound(_0x430d7b,null))[_0xf33a('0x1b')](saveUpdates(_0x1a8f75[_0xf33a('0x4d')],null))[_0xf33a('0x1b')](respondWithResult(_0x430d7b,null))[_0xf33a('0x25')](handleError(_0x430d7b,null));};exports[_0xf33a('0x5d')]=function(_0x1d308e,_0x13cfbb,_0x2a544b){if(_0x1d308e[_0xf33a('0x5a')]&&_0x1d308e['file']['filename']){_0x1d308e[_0xf33a('0x4d')][_0xf33a('0x5e')]=_0x1d308e[_0xf33a('0x5a')][_0xf33a('0x5b')];}return db[_0xf33a('0x32')][_0xf33a('0x4c')]({'where':{'id':_0x1d308e[_0xf33a('0x4b')]['id']}})[_0xf33a('0x1b')](handleEntityNotFound(_0x13cfbb,null))[_0xf33a('0x1b')](saveUpdates(_0x1d308e[_0xf33a('0x4d')],null))[_0xf33a('0x1b')](respondWithResult(_0x13cfbb,null))['catch'](handleError(_0x13cfbb,null));};var utilLicense=require(_0xf33a('0x5f'));exports[_0xf33a('0x60')]=function(_0x3720e1,_0x375889,_0x3ffcca){var _0x2818a9=_0xf33a('0x61');var _0x1c2116={'custom':![]};return utilLicense[_0xf33a('0x62')]()['then'](function(_0x310f14){if(_0x310f14){_0x1c2116=_0x310f14;}return db[_0xf33a('0x32')]['find']({'where':{'id':_0x3720e1[_0xf33a('0x4b')]['id']},'attributes':[_0xf33a('0x5c'),_0xf33a('0x5e'),_0xf33a('0x63'),_0xf33a('0x64'),_0xf33a('0x65'),'defaultPreferred'],'raw':!![]});})[_0xf33a('0x1b')](handleEntityNotFound(_0x375889,null))[_0xf33a('0x1b')](function(_0x11f7a1){if(_0x11f7a1){var _0x289a08=_0x11f7a1[_0xf33a('0x5c')]&&fs[_0xf33a('0x66')](path[_0xf33a('0x67')](config['root'],_0x2818a9,_[_0xf33a('0x68')](_0x11f7a1[_0xf33a('0x5c')])))?path['join'](config['root'],_0x2818a9,_['toLower'](_0x11f7a1[_0xf33a('0x5c')])):path[_0xf33a('0x67')](config[_0xf33a('0x50')],_0x2818a9,_[_0xf33a('0x68')](_0xf33a('0x69')));var _0xb3a823=_0xf33a('0x6a')+_[_0xf33a('0x6b')](_0xf33a('0x5c'));if(_0x11f7a1[_0xb3a823]||!_0x1c2116[_0xf33a('0x6c')]){_0x289a08=path[_0xf33a('0x67')](config[_0xf33a('0x50')],_0x2818a9,_['toLower'](_0xf33a('0x69')));}if(!fs['existsSync'](_0x289a08)){throw new db['Sequelize'][(_0xf33a('0x6d'))](_0xf33a('0x6e'));}return _0x375889[_0xf33a('0x6f')](_0x289a08);}})['catch'](handleError(_0x375889,null));};var utilLicense=require('../../config/license/util');exports[_0xf33a('0x70')]=function(_0x4c414c,_0x2552f3,_0x15b91b){var _0x266d3e=_0xf33a('0x61');var _0x2530e5={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x2d3687){if(_0x2d3687){_0x2530e5=_0x2d3687;}return db[_0xf33a('0x32')][_0xf33a('0x4c')]({'where':{'id':_0x4c414c[_0xf33a('0x4b')]['id']},'attributes':['logo',_0xf33a('0x5e'),_0xf33a('0x63'),'defaultLogo',_0xf33a('0x65'),_0xf33a('0x71')],'raw':!![]});})[_0xf33a('0x1b')](handleEntityNotFound(_0x2552f3,null))['then'](function(_0x2b571f){if(_0x2b571f){var _0x37a991=_0x2b571f[_0xf33a('0x5e')]&&fs[_0xf33a('0x66')](path['join'](config[_0xf33a('0x50')],_0x266d3e,_[_0xf33a('0x68')](_0x2b571f[_0xf33a('0x5e')])))?path['join'](config[_0xf33a('0x50')],_0x266d3e,_[_0xf33a('0x68')](_0x2b571f[_0xf33a('0x5e')])):path[_0xf33a('0x67')](config[_0xf33a('0x50')],_0x266d3e,_[_0xf33a('0x68')](_0xf33a('0x72')));var _0x403e77=_0xf33a('0x6a')+_[_0xf33a('0x6b')](_0xf33a('0x5e'));if(_0x2b571f[_0x403e77]||!_0x2530e5[_0xf33a('0x6c')]){_0x37a991=path[_0xf33a('0x67')](config[_0xf33a('0x50')],_0x266d3e,_[_0xf33a('0x68')]('default_loginLogo.png'));}if(!fs[_0xf33a('0x66')](_0x37a991)){throw new db[(_0xf33a('0x73'))][(_0xf33a('0x6d'))](_0xf33a('0x6e'));}return _0x2552f3[_0xf33a('0x6f')](_0x37a991);}})[_0xf33a('0x25')](handleError(_0x2552f3,null));};exports[_0xf33a('0x74')]=function(_0x2dc012,_0x3df645){return db[_0xf33a('0x32')][_0xf33a('0x4c')]({'where':{'id':_0x2dc012[_0xf33a('0x4b')]['id']},'attributes':[_0xf33a('0x75')]})[_0xf33a('0x1b')](respondWithResult(_0x3df645,null))['catch'](handleError(_0x3df645,null));};exports[_0xf33a('0x76')]=function(_0x10e252,_0x29dcfd,_0x8925a4){if(_0x10e252['file']&&_0x10e252[_0xf33a('0x5a')][_0xf33a('0x5b')]){_0x10e252[_0xf33a('0x4d')][_0xf33a('0x63')]=_0x10e252[_0xf33a('0x5a')][_0xf33a('0x5b')];}return db[_0xf33a('0x32')][_0xf33a('0x4c')]({'where':{'id':_0x10e252['params']['id']}})[_0xf33a('0x1b')](handleEntityNotFound(_0x29dcfd,null))[_0xf33a('0x1b')](saveUpdates(_0x10e252[_0xf33a('0x4d')],null))[_0xf33a('0x1b')](respondWithResult(_0x29dcfd,null))['catch'](handleError(_0x29dcfd,null));};var utilLicense=require('../../config/license/util');exports[_0xf33a('0x77')]=function(_0x55aa7e,_0xa1783b,_0x1595b7){var _0x3d8dbe=_0xf33a('0x61');var _0x4e484b={'custom':![]};return utilLicense['getLicense']()[_0xf33a('0x1b')](function(_0x5c4a26){if(_0x5c4a26){_0x4e484b=_0x5c4a26;}return db[_0xf33a('0x32')][_0xf33a('0x4c')]({'where':{'id':_0x55aa7e[_0xf33a('0x4b')]['id']},'attributes':[_0xf33a('0x5c'),_0xf33a('0x5e'),_0xf33a('0x63'),_0xf33a('0x64'),_0xf33a('0x65'),_0xf33a('0x71')],'raw':!![]});})[_0xf33a('0x1b')](handleEntityNotFound(_0xa1783b,null))[_0xf33a('0x1b')](function(_0x291904){if(_0x291904){var _0x19c026=_0x291904[_0xf33a('0x63')]&&fs[_0xf33a('0x66')](path[_0xf33a('0x67')](config['root'],_0x3d8dbe,_[_0xf33a('0x68')](_0x291904['preferred'])))?path[_0xf33a('0x67')](config['root'],_0x3d8dbe,_['toLower'](_0x291904['preferred'])):path[_0xf33a('0x67')](config[_0xf33a('0x50')],_0x3d8dbe,_['toLower'](_0xf33a('0x78')));var _0x3e2af=_0xf33a('0x6a')+_[_0xf33a('0x6b')](_0xf33a('0x63'));if(_0x291904[_0x3e2af]||!_0x4e484b[_0xf33a('0x6c')]||!_0x4e484b['preferred']){_0x19c026=path[_0xf33a('0x67')](config[_0xf33a('0x50')],_0x3d8dbe,_['toLower'](_0xf33a('0x78')));}if(!fs[_0xf33a('0x66')](_0x19c026)){throw new db[(_0xf33a('0x73'))]['ValidationError'](_0xf33a('0x6e'));}return _0xa1783b[_0xf33a('0x6f')](_0x19c026);}})[_0xf33a('0x25')](handleError(_0xa1783b,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 09185db..ab89338 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 _0xd5ab=['moment','bluebird','request-promise','./setting.attributes','Setting','settings','util','api'];(function(_0x2a23de,_0x39e780){var _0x5bb70b=function(_0x1b9ab6){while(--_0x1b9ab6){_0x2a23de['push'](_0x2a23de['shift']());}};_0x5bb70b(++_0x39e780);}(_0xd5ab,0x186));var _0xbd5a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd5ab[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xbd5a('0x0'));var logger=require('../../config/logger')(_0xbd5a('0x1'));var moment=require(_0xbd5a('0x2'));var BPromise=require(_0xbd5a('0x3'));var rp=require(_0xbd5a('0x4'));var attributes=require(_0xbd5a('0x5'));module['exports']=function(_0x2ea8b4,_0x3cd112){return _0x2ea8b4['define'](_0xbd5a('0x6'),attributes,{'tableName':_0xbd5a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f31=['api','moment','bluebird','request-promise','./setting.attributes','Setting','lodash','../../config/logger'];(function(_0x3b7e6f,_0x1565b5){var _0x4873c3=function(_0x3f0ac6){while(--_0x3f0ac6){_0x3b7e6f['push'](_0x3b7e6f['shift']());}};_0x4873c3(++_0x1565b5);}(_0x0f31,0x136));var _0x10f3=function(_0x1d61e7,_0x16f71d){_0x1d61e7=_0x1d61e7-0x0;var _0x4aae76=_0x0f31[_0x1d61e7];return _0x4aae76;};'use strict';var _=require(_0x10f3('0x0'));var util=require('util');var logger=require(_0x10f3('0x1'))(_0x10f3('0x2'));var moment=require(_0x10f3('0x3'));var BPromise=require(_0x10f3('0x4'));var rp=require(_0x10f3('0x5'));var attributes=require(_0x10f3('0x6'));module['exports']=function(_0x3446ec,_0x2bbb2d){return _0x3446ec['define'](_0x10f3('0x7'),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 721baad..7ed1c36 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 _0x8138=['Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4d9a9a,_0x54498e){var _0x28c8b4=function(_0x475ffe){while(--_0x475ffe){_0x4d9a9a['push'](_0x4d9a9a['shift']());}};_0x28c8b4(++_0x54498e);}(_0x8138,0x1c2));var _0x8813=function(_0x522c6d,_0x4d250d){_0x522c6d=_0x522c6d-0x0;var _0x26300d=_0x8138[_0x522c6d];return _0x26300d;};'use strict';var _=require(_0x8813('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8813('0x1'));var rs=require(_0x8813('0x2'));var fs=require('fs');var Redis=require(_0x8813('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8813('0x4'))('rpc');var config=require(_0x8813('0x5'));var jayson=require(_0x8813('0x6'));var client=jayson[_0x8813('0x7')][_0x8813('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7d81f5,_0x4f60ec,_0x549eeb){return new BPromise(function(_0x26cffc,_0x3db220){return client[_0x8813('0x9')](_0x7d81f5,_0x549eeb)[_0x8813('0xa')](function(_0x484ab1){logger[_0x8813('0xb')](_0x8813('0xc'),_0x4f60ec,_0x8813('0xd'));logger['debug'](_0x8813('0xe'),_0x4f60ec,'request\x20sent',JSON[_0x8813('0xf')](_0x484ab1));if(_0x484ab1[_0x8813('0x10')]){if(_0x484ab1[_0x8813('0x10')][_0x8813('0x11')]===0x1f4){logger[_0x8813('0x10')](_0x8813('0xc'),_0x4f60ec,_0x484ab1[_0x8813('0x10')][_0x8813('0x12')]);return _0x3db220(_0x484ab1['error'][_0x8813('0x12')]);}logger[_0x8813('0x10')](_0x8813('0xc'),_0x4f60ec,_0x484ab1[_0x8813('0x10')][_0x8813('0x12')]);return _0x26cffc(_0x484ab1['error'][_0x8813('0x12')]);}else{logger[_0x8813('0xb')](_0x8813('0xc'),_0x4f60ec,_0x8813('0xd'));_0x26cffc(_0x484ab1[_0x8813('0x13')][_0x8813('0x12')]);}})[_0x8813('0x14')](function(_0x3019c3){logger[_0x8813('0x10')]('Setting,\x20%s,\x20%s',_0x4f60ec,_0x3019c3);_0x3db220(_0x3019c3);});});} \ No newline at end of file +var _0x54ac=['debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent'];(function(_0x5cbb53,_0x49895b){var _0x5ad011=function(_0x18391c){while(--_0x18391c){_0x5cbb53['push'](_0x5cbb53['shift']());}};_0x5ad011(++_0x49895b);}(_0x54ac,0x133));var _0xc54a=function(_0x30853f,_0x4aa320){_0x30853f=_0x30853f-0x0;var _0x3c416d=_0x54ac[_0x30853f];return _0x3c416d;};'use strict';var _=require(_0xc54a('0x0'));var util=require(_0xc54a('0x1'));var moment=require('moment');var BPromise=require(_0xc54a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc54a('0x3'));var db=require(_0xc54a('0x4'))['db'];var utils=require(_0xc54a('0x5'));var logger=require('../../config/logger')(_0xc54a('0x6'));var config=require(_0xc54a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc54a('0x8')][_0xc54a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x573e04,_0x61fcbd,_0x45f235){return new BPromise(function(_0x3062b4,_0x3e68be){return client[_0xc54a('0xa')](_0x573e04,_0x45f235)[_0xc54a('0xb')](function(_0x48d07f){logger[_0xc54a('0xc')](_0xc54a('0xd'),_0x61fcbd,_0xc54a('0xe'));logger[_0xc54a('0xf')](_0xc54a('0x10'),_0x61fcbd,'request\x20sent',JSON[_0xc54a('0x11')](_0x48d07f));if(_0x48d07f[_0xc54a('0x12')]){if(_0x48d07f[_0xc54a('0x12')][_0xc54a('0x13')]===0x1f4){logger[_0xc54a('0x12')](_0xc54a('0xd'),_0x61fcbd,_0x48d07f[_0xc54a('0x12')][_0xc54a('0x14')]);return _0x3e68be(_0x48d07f['error'][_0xc54a('0x14')]);}logger[_0xc54a('0x12')](_0xc54a('0xd'),_0x61fcbd,_0x48d07f[_0xc54a('0x12')][_0xc54a('0x14')]);return _0x3062b4(_0x48d07f['error'][_0xc54a('0x14')]);}else{logger[_0xc54a('0xc')]('Setting,\x20%s,\x20%s',_0x61fcbd,'request\x20sent');_0x3062b4(_0x48d07f[_0xc54a('0x15')][_0xc54a('0x14')]);}})[_0xc54a('0x16')](function(_0x3007d0){logger['error'](_0xc54a('0xd'),_0x61fcbd,_0x3007d0);_0x3e68be(_0x3007d0);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 076742a..02e7de1 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 _0x9555=['delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','notify','addApplications','/:id/send','send','destroy'];(function(_0x2b382e,_0x4e0c8e){var _0x545811=function(_0x493824){while(--_0x493824){_0x2b382e['push'](_0x2b382e['shift']());}};_0x545811(++_0x4e0c8e);}(_0x9555,0x149));var _0x5955=function(_0x333410,_0xa37d13){_0x333410=_0x333410-0x0;var _0x41b3d4=_0x9555[_0x333410];return _0x41b3d4;};'use strict';var multer=require(_0x5955('0x0'));var util=require(_0x5955('0x1'));var path=require(_0x5955('0x2'));var timeout=require('connect-timeout');var express=require(_0x5955('0x3'));var router=express[_0x5955('0x4')]();var auth=require(_0x5955('0x5'));var interaction=require(_0x5955('0x6'));var config=require('../../config/environment');var controller=require(_0x5955('0x7'));router[_0x5955('0x8')]('/',auth[_0x5955('0x9')](),controller[_0x5955('0xa')]);router[_0x5955('0x8')]('/describe',auth[_0x5955('0x9')](),controller['describe']);router[_0x5955('0x8')](_0x5955('0xb'),auth[_0x5955('0x9')](),controller[_0x5955('0xc')]);router['get'](_0x5955('0xd'),auth[_0x5955('0x9')](),controller[_0x5955('0xe')]);router[_0x5955('0x8')](_0x5955('0xf'),auth[_0x5955('0x9')](),controller[_0x5955('0x10')]);router['get'](_0x5955('0x11'),auth[_0x5955('0x9')](),controller['getApplications']);router[_0x5955('0x8')](_0x5955('0x12'),auth[_0x5955('0x9')](),controller['getInteractions']);router[_0x5955('0x8')](_0x5955('0x13'),controller[_0x5955('0x14')]);router[_0x5955('0x8')](_0x5955('0x15'),auth['isAuthenticated'](),controller[_0x5955('0x16')]);router[_0x5955('0x17')]('/',auth[_0x5955('0x9')](),controller[_0x5955('0x18')]);router[_0x5955('0x17')](_0x5955('0xd'),auth[_0x5955('0x9')](),controller[_0x5955('0x19')]);router[_0x5955('0x17')](_0x5955('0xf'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/:id/notify',controller[_0x5955('0x1a')]);router[_0x5955('0x17')](_0x5955('0x11'),auth[_0x5955('0x9')](),controller[_0x5955('0x1b')]);router[_0x5955('0x17')](_0x5955('0x1c'),auth[_0x5955('0x9')](),controller[_0x5955('0x1d')]);router[_0x5955('0x17')](_0x5955('0x13'),controller['status']);router[_0x5955('0x17')](_0x5955('0x15'),auth[_0x5955('0x9')](),controller['addAgents']);router['put'](_0x5955('0xb'),auth[_0x5955('0x9')](),controller['update']);router['delete']('/:id',auth[_0x5955('0x9')](),controller[_0x5955('0x1e')]);router[_0x5955('0x1f')]('/:id/dispositions',auth[_0x5955('0x9')](),controller[_0x5955('0x20')]);router[_0x5955('0x1f')](_0x5955('0xf'),auth['isAuthenticated'](),controller[_0x5955('0x21')]);router[_0x5955('0x1f')](_0x5955('0x15'),auth[_0x5955('0x9')](),controller[_0x5955('0x22')]);module[_0x5955('0x23')]=router; \ No newline at end of file +var _0xf7ee=['/:id/send','send','status','addAgents','put','update','delete','destroy','/:id/dispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xf7ee,0x83));var _0xef7e=function(_0x36d8b9,_0x20d42c){_0x36d8b9=_0x36d8b9-0x0;var _0x4f5b50=_0xf7ee[_0x36d8b9];return _0x4f5b50;};'use strict';var multer=require(_0xef7e('0x0'));var util=require('util');var path=require(_0xef7e('0x1'));var timeout=require(_0xef7e('0x2'));var express=require(_0xef7e('0x3'));var router=express[_0xef7e('0x4')]();var auth=require(_0xef7e('0x5'));var interaction=require(_0xef7e('0x6'));var config=require(_0xef7e('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0xef7e('0x8')](),controller[_0xef7e('0x9')]);router[_0xef7e('0xa')]('/describe',auth[_0xef7e('0x8')](),controller['describe']);router['get'](_0xef7e('0xb'),auth['isAuthenticated'](),controller[_0xef7e('0xc')]);router[_0xef7e('0xa')]('/:id/dispositions',auth[_0xef7e('0x8')](),controller[_0xef7e('0xd')]);router['get']('/:id/canned_answers',auth[_0xef7e('0x8')](),controller[_0xef7e('0xe')]);router['get'](_0xef7e('0xf'),auth[_0xef7e('0x8')](),controller[_0xef7e('0x10')]);router[_0xef7e('0xa')](_0xef7e('0x11'),auth[_0xef7e('0x8')](),controller['getInteractions']);router[_0xef7e('0xa')](_0xef7e('0x12'),controller['statusGet']);router[_0xef7e('0xa')](_0xef7e('0x13'),auth[_0xef7e('0x8')](),controller[_0xef7e('0x14')]);router[_0xef7e('0x15')]('/',auth[_0xef7e('0x8')](),controller[_0xef7e('0x16')]);router[_0xef7e('0x15')]('/:id/dispositions',auth[_0xef7e('0x8')](),controller[_0xef7e('0x17')]);router['post'](_0xef7e('0x18'),auth[_0xef7e('0x8')](),controller[_0xef7e('0x19')]);router[_0xef7e('0x15')](_0xef7e('0x1a'),controller[_0xef7e('0x1b')]);router[_0xef7e('0x15')]('/:id/applications',auth[_0xef7e('0x8')](),controller[_0xef7e('0x1c')]);router[_0xef7e('0x15')](_0xef7e('0x1d'),auth['isAuthenticated'](),controller[_0xef7e('0x1e')]);router[_0xef7e('0x15')](_0xef7e('0x12'),controller[_0xef7e('0x1f')]);router[_0xef7e('0x15')](_0xef7e('0x13'),auth['isAuthenticated'](),controller[_0xef7e('0x20')]);router[_0xef7e('0x21')](_0xef7e('0xb'),auth[_0xef7e('0x8')](),controller[_0xef7e('0x22')]);router[_0xef7e('0x23')](_0xef7e('0xb'),auth[_0xef7e('0x8')](),controller[_0xef7e('0x24')]);router[_0xef7e('0x23')](_0xef7e('0x25'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xef7e('0x23')](_0xef7e('0x18'),auth[_0xef7e('0x8')](),controller['removeAnswers']);router[_0xef7e('0x23')](_0xef7e('0x13'),auth[_0xef7e('0x8')](),controller[_0xef7e('0x26')]);module[_0xef7e('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 7e26d6a..a3081bf 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 _0x9593=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring','exports','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0x9593,0x138));var _0x3959=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0x9593[_0x402731];return _0x111736;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x3959('0x0'));module[_0x3959('0x1')]={'name':{'type':Sequelize[_0x3959('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x3959('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x3959('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x3959('0x3')]();}},'phone':{'type':Sequelize[_0x3959('0x2')]},'type':{'type':Sequelize[_0x3959('0x4')](_0x3959('0x5'),_0x3959('0x6'),_0x3959('0x7'),_0x3959('0x8'),_0x3959('0x9'),_0x3959('0xa'),_0x3959('0xb'),_0x3959('0xc'),_0x3959('0xd'))},'accountSid':{'type':Sequelize[_0x3959('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x3959('0x2')]},'smsMethod':{'type':Sequelize[_0x3959('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x3959('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x3959('0x2')]},'senderString':{'type':Sequelize[_0x3959('0x2')]},'deliveryReport':{'type':Sequelize[_0x3959('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x3959('0xf')],'defaultValue':function(){return _0x3959('0x10');}},'notificationSound':{'type':Sequelize[_0x3959('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3959('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3959('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3959('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3959('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3959('0x11')],'comment':_0x3959('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x3959('0xe')],'defaultValue':![],'comment':_0x3959('0x13'),'set':function(_0x5ddd06){if(!_0x5ddd06)this[_0x3959('0x14')]('mandatoryDispositionPauseId',null);this[_0x3959('0x14')](_0x3959('0x15'),_0x5ddd06);}}}; \ No newline at end of file +var _0x74af=['clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','generate','skebby','clicksend','plivo'];(function(_0x4a417a,_0x263221){var _0x17f79b=function(_0x28ef70){while(--_0x28ef70){_0x4a417a['push'](_0x4a417a['shift']());}};_0x17f79b(++_0x263221);}(_0x74af,0x89));var _0xf74a=function(_0x39994b,_0x5f3d08){_0x39994b=_0x39994b-0x0;var _0x53c3c6=_0x74af[_0x39994b];return _0x53c3c6;};'use strict';var Sequelize=require(_0xf74a('0x0'));var rs=require('randomstring');module[_0xf74a('0x1')]={'name':{'type':Sequelize[_0xf74a('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xf74a('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf74a('0x3')]();}},'phone':{'type':Sequelize[_0xf74a('0x2')]},'type':{'type':Sequelize['ENUM']('twilio',_0xf74a('0x4'),'connectel',_0xf74a('0x5'),_0xf74a('0x6'),_0xf74a('0x7'),_0xf74a('0x8'),_0xf74a('0x9'),_0xf74a('0xa'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xf74a('0x2')]},'authToken':{'type':Sequelize[_0xf74a('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xf74a('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xf74a('0x2')]},'deliveryReport':{'type':Sequelize[_0xf74a('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xf74a('0x2')]},'notificationTemplate':{'type':Sequelize[_0xf74a('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf74a('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf74a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf74a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf74a('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf74a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf74a('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xf74a('0xe')},'mandatoryDisposition':{'type':Sequelize[_0xf74a('0xb')],'defaultValue':![],'comment':_0xf74a('0xf'),'set':function(_0x476c31){if(!_0x476c31)this['setDataValue'](_0xf74a('0x10'),null);this[_0xf74a('0x11')]('mandatoryDisposition',_0x476c31);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 671e61a..f41a8b0 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 _0x44e0=['key','VIRTUAL','field','filter','merge','options','include','findAll','rows','Pause','mandatoryDispositionPause','fields','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','nolimit','order','SmsAccountId','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','SmsApplication','account','applications','Applications','priority','asc','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','clicksend','message_id','plivo','Text','MessageUUID','text','csc','originatingAddress','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','list','contact','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','text/xml','\x0a','addApplications','sequelize','findAndCountAll','getApplications','Contact','Owner','fullname','internal','Tag','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','dataValues','Messages','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','infobip','results','groupName','DELIVERED','clickatell','redif','error_code','DELIVRD','ACCEPTD','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./smsAccount.socket','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','count','offset','set','apply','reject','save','update','UserProfileResource','destroy','stack','name','send','index','SmsAccount','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','limit','sort','pick','where','map','type'];(function(_0x2b634b,_0x5646ef){var _0x434cae=function(_0x22ec92){while(--_0x22ec92){_0x2b634b['push'](_0x2b634b['shift']());}};_0x434cae(++_0x5646ef);}(_0x44e0,0x174));var _0x044e=function(_0x2ec8c4,_0x42e851){_0x2ec8c4=_0x2ec8c4-0x0;var _0x273dda=_0x44e0[_0x2ec8c4];return _0x273dda;};'use strict';var pdf=require(_0x044e('0x0'));var emlformat=require(_0x044e('0x1'));var rimraf=require(_0x044e('0x2'));var zipdir=require(_0x044e('0x3'));var jsonpatch=require(_0x044e('0x4'));var rp=require(_0x044e('0x5'));var moment=require(_0x044e('0x6'));var BPromise=require(_0x044e('0x7'));var Mustache=require(_0x044e('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x044e('0x9'));var ejs=require(_0x044e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x044e('0xb'));var crypto=require(_0x044e('0xc'));var jsforce=require(_0x044e('0xd'));var deskjs=require(_0x044e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x044e('0xf'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x044e('0x10'));var Redis=require('ioredis');var qs=require(_0x044e('0x11'));var logger=require(_0x044e('0x12'))(_0x044e('0x13'));var utils=require(_0x044e('0x14'));var config=require(_0x044e('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x044e('0x16')](config['redis'],{'host':_0x044e('0x17'),'port':0x18eb});var socket=require(_0x044e('0x18'))(new Redis(config[_0x044e('0x19')]));require(_0x044e('0x1a'))['register'](socket);var jayson=require(_0x044e('0x1b'));var client=jayson[_0x044e('0x1c')][_0x044e('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x597f53,_0x12b457,_0x6ac72a,_0x564a14){return new BPromise(function(_0x41646f,_0x22c4c3){var _0x132866=_0x564a14||client;return _0x132866['request'](_0x597f53,_0x6ac72a)[_0x044e('0x1e')](function(_0x278737){logger[_0x044e('0x1f')](_0x044e('0x20'),_0x12b457,_0x044e('0x21'));logger[_0x044e('0x22')](_0x044e('0x23'),_0x12b457,_0x044e('0x21'),JSON['stringify'](_0x278737));if(_0x278737['error']){if(_0x278737[_0x044e('0x24')][_0x044e('0x25')]===0x1f4){logger[_0x044e('0x24')](_0x044e('0x20'),_0x12b457,_0x278737[_0x044e('0x24')][_0x044e('0x26')]);return _0x22c4c3(_0x278737[_0x044e('0x24')][_0x044e('0x26')]);}logger[_0x044e('0x24')](_0x044e('0x20'),_0x12b457,_0x278737[_0x044e('0x24')][_0x044e('0x26')]);return _0x41646f(_0x278737['error'][_0x044e('0x26')]);}else{logger['info'](_0x044e('0x20'),_0x12b457,_0x044e('0x21'));_0x41646f(_0x278737[_0x044e('0x27')][_0x044e('0x26')]);}})['catch'](function(_0x51669e){logger[_0x044e('0x24')]('SmsAccount,\x20%s,\x20%s',_0x12b457,_0x51669e);_0x22c4c3(_0x51669e);});});}function respondWithStatusCode(_0xf98b57,_0x47b7bb){_0x47b7bb=_0x47b7bb||0xcc;return function(_0x2a99fe){if(_0x2a99fe){return _0xf98b57['sendStatus'](_0x47b7bb);}return _0xf98b57[_0x044e('0x28')](_0x47b7bb)[_0x044e('0x29')]();};}function respondWithResult(_0x167e7f,_0x198df0){_0x198df0=_0x198df0||0xc8;return function(_0x2a681e){if(_0x2a681e){return _0x167e7f[_0x044e('0x28')](_0x198df0)[_0x044e('0x2a')](_0x2a681e);}};}function respondWithFilteredResult(_0x1b760f,_0x24e96f){return function(_0x3be85b){if(_0x3be85b){var _0x1d4a4c=_0x3be85b[_0x044e('0x2b')],_0x7b59=_0x24e96f[_0x044e('0x2c')],_0x44ffd1=_0x24e96f[_0x044e('0x2c')]+_0x24e96f['limit'],_0x340b4b;if(_0x44ffd1>=_0x1d4a4c){_0x44ffd1=_0x1d4a4c;_0x340b4b=0xc8;}else{_0x340b4b=0xce;}_0x1b760f['status'](_0x340b4b);return _0x1b760f[_0x044e('0x2d')]('Content-Range',_0x7b59+'-'+_0x44ffd1+'/'+_0x1d4a4c)[_0x044e('0x2a')](_0x3be85b);}return null;};}function patchUpdates(_0x7dc159){return function(_0x189fd8){try{jsonpatch[_0x044e('0x2e')](_0x189fd8,_0x7dc159,!![]);}catch(_0x3e2924){return BPromise[_0x044e('0x2f')](_0x3e2924);}return _0x189fd8[_0x044e('0x30')]();};}function saveUpdates(_0x56fe81,_0x36210a){return function(_0x532b67){if(_0x532b67){return _0x532b67[_0x044e('0x31')](_0x56fe81)[_0x044e('0x1e')](function(_0x23ffd4){return _0x23ffd4;});}return null;};}function removeEntity(_0x5f30f9,_0x45ebfb){return function(_0xdf5383){if(_0xdf5383){return _0xdf5383['destroy']()[_0x044e('0x1e')](function(){var _0x1a09ac=_0xdf5383['get']({'plain':!![]});var _0x21dc76='SmsAccounts';return db[_0x044e('0x32')][_0x044e('0x33')]({'where':{'type':_0x21dc76,'resourceId':_0x1a09ac['id']}})[_0x044e('0x1e')](function(){return _0xdf5383;});})['then'](function(){_0x5f30f9['status'](0xcc)[_0x044e('0x29')]();});}};}function handleEntityNotFound(_0x5954ed,_0x51bc6c){return function(_0x3f4c02){if(!_0x3f4c02){_0x5954ed['sendStatus'](0x194);}return _0x3f4c02;};}function handleError(_0x2a5777,_0x59f32f){_0x59f32f=_0x59f32f||0x1f4;return function(_0xa8b364){logger[_0x044e('0x24')](_0xa8b364[_0x044e('0x34')]);if(_0xa8b364[_0x044e('0x35')]){delete _0xa8b364[_0x044e('0x35')];}_0x2a5777[_0x044e('0x28')](_0x59f32f)[_0x044e('0x36')](_0xa8b364);};}exports[_0x044e('0x37')]=function(_0x385100,_0x747cf1){var _0x1bf0d5={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1b0d49={},_0x17bf82={'count':0x0,'rows':[]};var _0x2e1539=db[_0x044e('0x38')][_0x044e('0x39')];_0x1b0d49[_0x044e('0x3a')]=_[_0x044e('0x3b')](_0x2e1539);_0x1b0d49[_0x044e('0x3c')]=_[_0x044e('0x3b')](_0x385100[_0x044e('0x3c')]);_0x1b0d49[_0x044e('0x3d')]=_[_0x044e('0x3e')](_0x1b0d49[_0x044e('0x3a')],_0x1b0d49[_0x044e('0x3c')]);_0x1bf0d5[_0x044e('0x3f')]=_[_0x044e('0x3e')](_0x1b0d49[_0x044e('0x3a')],qs['fields'](_0x385100[_0x044e('0x3c')]['fields']));_0x1bf0d5[_0x044e('0x3f')]=_0x1bf0d5[_0x044e('0x3f')][_0x044e('0x40')]?_0x1bf0d5[_0x044e('0x3f')]:_0x1b0d49[_0x044e('0x3a')];if(!_0x385100[_0x044e('0x3c')][_0x044e('0x41')]('nolimit')){_0x1bf0d5[_0x044e('0x42')]=qs[_0x044e('0x42')](_0x385100[_0x044e('0x3c')][_0x044e('0x42')]);_0x1bf0d5[_0x044e('0x2c')]=qs[_0x044e('0x2c')](_0x385100[_0x044e('0x3c')][_0x044e('0x2c')]);}_0x1bf0d5['order']=qs[_0x044e('0x43')](_0x385100[_0x044e('0x3c')][_0x044e('0x43')]);_0x1bf0d5['where']=qs[_0x044e('0x3d')](_[_0x044e('0x44')](_0x385100[_0x044e('0x3c')],_0x1b0d49[_0x044e('0x3d')]));if(_0x385100[_0x044e('0x3c')]['filter']){_0x1bf0d5['where']=_['merge'](_0x1bf0d5[_0x044e('0x45')],{'$or':_[_0x044e('0x46')](_0x2e1539,function(_0x199bef){if(_0x199bef[_0x044e('0x47')][_0x044e('0x48')]!==_0x044e('0x49')){var _0x5b8983={};_0x5b8983[_0x199bef[_0x044e('0x4a')]]={'$like':'%'+_0x385100['query'][_0x044e('0x4b')]+'%'};return _0x5b8983;}})});}_0x1bf0d5=_[_0x044e('0x4c')]({},_0x1bf0d5,_0x385100[_0x044e('0x4d')]);var _0x54dd51={'where':_0x1bf0d5['where']};return db['SmsAccount'][_0x044e('0x2b')](_0x54dd51)[_0x044e('0x1e')](function(_0xf74f6a){_0x17bf82['count']=_0xf74f6a;if(_0x385100[_0x044e('0x3c')]['includeAll']){_0x1bf0d5[_0x044e('0x4e')]=[{'all':!![]}];}return db['SmsAccount'][_0x044e('0x4f')](_0x1bf0d5);})[_0x044e('0x1e')](function(_0x206b05){_0x17bf82[_0x044e('0x50')]=_0x206b05;return _0x17bf82;})[_0x044e('0x1e')](respondWithFilteredResult(_0x747cf1,_0x1bf0d5))['catch'](handleError(_0x747cf1,null));};exports['show']=function(_0x8a42b,_0x2b70bf){var _0x8a3fc3={'raw':![],'where':{'id':_0x8a42b['params']['id']},'include':[{'model':db[_0x044e('0x51')],'as':_0x044e('0x52')}]},_0x43b844={};_0x43b844[_0x044e('0x3a')]=_[_0x044e('0x3b')](db['SmsAccount'][_0x044e('0x39')]);_0x43b844[_0x044e('0x3c')]=_['keys'](_0x8a42b[_0x044e('0x3c')]);_0x43b844[_0x044e('0x3d')]=_[_0x044e('0x3e')](_0x43b844[_0x044e('0x3a')],_0x43b844[_0x044e('0x3c')]);_0x8a3fc3['attributes']=_[_0x044e('0x3e')](_0x43b844[_0x044e('0x3a')],qs[_0x044e('0x53')](_0x8a42b[_0x044e('0x3c')][_0x044e('0x53')]));_0x8a3fc3[_0x044e('0x3f')]=_0x8a3fc3[_0x044e('0x3f')][_0x044e('0x40')]?_0x8a3fc3['attributes']:_0x43b844[_0x044e('0x3a')];if(_0x8a42b[_0x044e('0x3c')]['includeAll']){_0x8a3fc3['include']=[{'all':!![]}];}_0x8a3fc3=_[_0x044e('0x4c')]({},_0x8a3fc3,_0x8a42b[_0x044e('0x4d')]);return db[_0x044e('0x38')][_0x044e('0x54')](_0x8a3fc3)[_0x044e('0x1e')](handleEntityNotFound(_0x2b70bf,null))[_0x044e('0x1e')](respondWithResult(_0x2b70bf,null))[_0x044e('0x55')](handleError(_0x2b70bf,null));};exports[_0x044e('0x56')]=function(_0x44ca63,_0x51aa07){return db['SmsAccount'][_0x044e('0x56')](_0x44ca63[_0x044e('0x57')],{})['then'](function(_0x45729a){var _0x56b40d=_0x44ca63[_0x044e('0x58')][_0x044e('0x59')]({'plain':!![]});if(!_0x56b40d)throw new Error(_0x044e('0x5a'));if(_0x56b40d[_0x044e('0x5b')]===_0x044e('0x58')){var _0x15fc3c=_0x45729a['get']({'plain':!![]});var _0x1f6150=_0x044e('0x5c');return db[_0x044e('0x5d')]['find']({'where':{'name':_0x1f6150,'userProfileId':_0x56b40d[_0x044e('0x5e')]},'raw':!![]})['then'](function(_0x3ac415){if(_0x3ac415&&_0x3ac415[_0x044e('0x5f')]===0x0){return db[_0x044e('0x32')][_0x044e('0x56')]({'name':_0x15fc3c['name'],'resourceId':_0x15fc3c['id'],'type':_0x3ac415[_0x044e('0x35')],'sectionId':_0x3ac415['id']},{})[_0x044e('0x1e')](function(){return _0x45729a;});}else{return _0x45729a;}})[_0x044e('0x55')](function(_0x3b3360){logger[_0x044e('0x24')](_0x044e('0x60'),_0x3b3360);throw _0x3b3360;});}return _0x45729a;})[_0x044e('0x1e')](respondWithResult(_0x51aa07,0xc9))[_0x044e('0x55')](handleError(_0x51aa07,null));};exports[_0x044e('0x31')]=function(_0x4d28d2,_0x4af666){if(_0x4d28d2[_0x044e('0x57')]['id']){delete _0x4d28d2['body']['id'];}return db[_0x044e('0x38')][_0x044e('0x54')]({'where':{'id':_0x4d28d2[_0x044e('0x61')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x044e('0x1e')](handleEntityNotFound(_0x4af666,null))[_0x044e('0x1e')](saveUpdates(_0x4d28d2[_0x044e('0x57')],null))['then'](function(_0x5f3639){if(_0x5f3639&&_0x4d28d2[_0x044e('0x57')][_0x044e('0x52')]){return db[_0x044e('0x51')][_0x044e('0x31')](_0x4d28d2[_0x044e('0x57')][_0x044e('0x52')],{'where':{'SmsAccountId':_0x5f3639['id']}})[_0x044e('0x1e')](function(){return _0x5f3639;});}return _0x5f3639;})['then'](respondWithResult(_0x4af666,null))['catch'](handleError(_0x4af666,null));};exports[_0x044e('0x33')]=function(_0x3bf095,_0x15bc62){return db['SmsAccount'][_0x044e('0x54')]({'where':{'id':_0x3bf095[_0x044e('0x61')]['id']}})['then'](handleEntityNotFound(_0x15bc62,null))[_0x044e('0x1e')](removeEntity(_0x15bc62,null))[_0x044e('0x55')](handleError(_0x15bc62,null));};exports[_0x044e('0x62')]=function(_0x40bec1,_0x571087){return db[_0x044e('0x38')][_0x044e('0x62')]()['then'](respondWithResult(_0x571087,null))[_0x044e('0x55')](handleError(_0x571087,null));};exports[_0x044e('0x63')]=function(_0x982614,_0x216f00,_0x1427b7){if(_0x982614[_0x044e('0x57')]['id']){delete _0x982614[_0x044e('0x57')]['id'];}return db[_0x044e('0x38')]['find']({'where':{'id':_0x982614['params']['id']}})['then'](handleEntityNotFound(_0x216f00,null))[_0x044e('0x1e')](function(_0x15212e){if(_0x15212e){_0x982614['body']['SmsAccountId']=_0x15212e['id'];return db[_0x044e('0x64')][_0x044e('0x56')](_0x982614[_0x044e('0x57')]);}})[_0x044e('0x1e')](respondWithResult(_0x216f00,null))[_0x044e('0x55')](handleError(_0x216f00,null));};exports['getDispositions']=function(_0x5a0118,_0x4edc2d,_0x5e3785){var _0xf1b6c={'raw':![],'where':{}};var _0x103bd0={};var _0x390407={'count':0x0,'rows':[]};return db[_0x044e('0x38')]['findOne']({'where':{'id':_0x5a0118[_0x044e('0x61')]['id']}})[_0x044e('0x1e')](handleEntityNotFound(_0x4edc2d,null))[_0x044e('0x1e')](function(_0x1fab03){if(_0x1fab03){_0x103bd0[_0x044e('0x3a')]=_['keys'](db[_0x044e('0x64')]['rawAttributes']);_0x103bd0[_0x044e('0x3c')]=_[_0x044e('0x3b')](_0x5a0118[_0x044e('0x3c')]);_0x103bd0[_0x044e('0x3d')]=_[_0x044e('0x3e')](_0x103bd0[_0x044e('0x3a')],_0x103bd0[_0x044e('0x3c')]);_0xf1b6c[_0x044e('0x3f')]=_[_0x044e('0x3e')](_0x103bd0[_0x044e('0x3a')],qs[_0x044e('0x53')](_0x5a0118[_0x044e('0x3c')][_0x044e('0x53')]));_0xf1b6c[_0x044e('0x3f')]=_0xf1b6c[_0x044e('0x3f')][_0x044e('0x40')]?_0xf1b6c[_0x044e('0x3f')]:_0x103bd0[_0x044e('0x3a')];if(!_0x5a0118['query'][_0x044e('0x41')](_0x044e('0x65'))){_0xf1b6c[_0x044e('0x42')]=qs[_0x044e('0x42')](_0x5a0118[_0x044e('0x3c')][_0x044e('0x42')]);_0xf1b6c[_0x044e('0x2c')]=qs['offset'](_0x5a0118[_0x044e('0x3c')][_0x044e('0x2c')]);}_0xf1b6c[_0x044e('0x66')]=qs[_0x044e('0x43')](_0x5a0118[_0x044e('0x3c')][_0x044e('0x43')]);_0xf1b6c[_0x044e('0x45')]=qs[_0x044e('0x3d')](_[_0x044e('0x44')](_0x5a0118[_0x044e('0x3c')],_0x103bd0['filters']));_0xf1b6c[_0x044e('0x45')][_0x044e('0x67')]=_0x1fab03['id'];if(_0x5a0118[_0x044e('0x3c')][_0x044e('0x4b')]){_0xf1b6c['where']=_[_0x044e('0x4c')](_0xf1b6c[_0x044e('0x45')],{'$or':_[_0x044e('0x46')](_0xf1b6c[_0x044e('0x3f')],function(_0x48a490){var _0x4f4d5d={};_0x4f4d5d[_0x48a490]={'$like':'%'+_0x5a0118[_0x044e('0x3c')][_0x044e('0x4b')]+'%'};return _0x4f4d5d;})});}_0xf1b6c=_[_0x044e('0x4c')]({},_0xf1b6c,_0x5a0118['options']);return db['Disposition']['count']({'where':_0xf1b6c['where']})[_0x044e('0x1e')](function(_0x2fa2cf){_0x390407['count']=_0x2fa2cf;if(_0x5a0118[_0x044e('0x3c')][_0x044e('0x68')]){_0xf1b6c[_0x044e('0x4e')]=[{'all':!![]}];}return db[_0x044e('0x64')][_0x044e('0x4f')](_0xf1b6c);})[_0x044e('0x1e')](function(_0x45bf59){_0x390407[_0x044e('0x50')]=_0x45bf59;return _0x390407;});}})[_0x044e('0x1e')](respondWithFilteredResult(_0x4edc2d,_0xf1b6c))[_0x044e('0x55')](handleError(_0x4edc2d,null));};exports[_0x044e('0x69')]=function(_0x457a29,_0x172406,_0x2894b0){var _0x19cc7;return db[_0x044e('0x38')][_0x044e('0x54')]({'where':{'id':_0x457a29[_0x044e('0x61')]['id']}})[_0x044e('0x1e')](handleEntityNotFound(_0x172406,null))['then'](function(_0x5669d6){if(_0x5669d6){return _0x5669d6[_0x044e('0x69')](_0x457a29[_0x044e('0x3c')][_0x044e('0x6a')]);}})[_0x044e('0x1e')](respondWithStatusCode(_0x172406,null))[_0x044e('0x55')](handleError(_0x172406,null));};exports[_0x044e('0x6b')]=function(_0x5b16cc,_0x2afbfc,_0x50ea3b){if(_0x5b16cc['body']['id']){delete _0x5b16cc[_0x044e('0x57')]['id'];}return db[_0x044e('0x38')][_0x044e('0x54')]({'where':{'id':_0x5b16cc[_0x044e('0x61')]['id']}})[_0x044e('0x1e')](handleEntityNotFound(_0x2afbfc,null))[_0x044e('0x1e')](function(_0x2e6bbc){if(_0x2e6bbc){_0x5b16cc['body']['SmsAccountId']=_0x2e6bbc['id'];return db[_0x044e('0x6c')][_0x044e('0x56')](_0x5b16cc[_0x044e('0x57')]);}})[_0x044e('0x1e')](respondWithResult(_0x2afbfc,null))['catch'](handleError(_0x2afbfc,null));};exports[_0x044e('0x6d')]=function(_0x31b6df,_0x181e59,_0x1139d0){var _0x428679={'raw':![],'where':{}};var _0x5451ea={};var _0x55fdde={'count':0x0,'rows':[]};return db['SmsAccount'][_0x044e('0x6e')]({'where':{'id':_0x31b6df['params']['id']}})['then'](handleEntityNotFound(_0x181e59,null))[_0x044e('0x1e')](function(_0x1ab3cb){if(_0x1ab3cb){_0x5451ea[_0x044e('0x3a')]=_[_0x044e('0x3b')](db[_0x044e('0x6c')][_0x044e('0x39')]);_0x5451ea['query']=_['keys'](_0x31b6df[_0x044e('0x3c')]);_0x5451ea['filters']=_[_0x044e('0x3e')](_0x5451ea[_0x044e('0x3a')],_0x5451ea[_0x044e('0x3c')]);_0x428679[_0x044e('0x3f')]=_[_0x044e('0x3e')](_0x5451ea[_0x044e('0x3a')],qs['fields'](_0x31b6df[_0x044e('0x3c')][_0x044e('0x53')]));_0x428679[_0x044e('0x3f')]=_0x428679[_0x044e('0x3f')][_0x044e('0x40')]?_0x428679['attributes']:_0x5451ea['model'];if(!_0x31b6df[_0x044e('0x3c')]['hasOwnProperty'](_0x044e('0x65'))){_0x428679['limit']=qs[_0x044e('0x42')](_0x31b6df[_0x044e('0x3c')]['limit']);_0x428679[_0x044e('0x2c')]=qs[_0x044e('0x2c')](_0x31b6df[_0x044e('0x3c')][_0x044e('0x2c')]);}_0x428679[_0x044e('0x66')]=qs[_0x044e('0x43')](_0x31b6df[_0x044e('0x3c')][_0x044e('0x43')]);_0x428679[_0x044e('0x45')]=qs[_0x044e('0x3d')](_['pick'](_0x31b6df[_0x044e('0x3c')],_0x5451ea[_0x044e('0x3d')]));_0x428679[_0x044e('0x45')][_0x044e('0x67')]=_0x1ab3cb['id'];if(_0x31b6df['query'][_0x044e('0x4b')]){_0x428679[_0x044e('0x45')]=_[_0x044e('0x4c')](_0x428679[_0x044e('0x45')],{'$or':_[_0x044e('0x46')](_0x428679[_0x044e('0x3f')],function(_0x1f4e84){var _0x13545a={};_0x13545a[_0x1f4e84]={'$like':'%'+_0x31b6df[_0x044e('0x3c')][_0x044e('0x4b')]+'%'};return _0x13545a;})});}_0x428679=_[_0x044e('0x4c')]({},_0x428679,_0x31b6df['options']);return db[_0x044e('0x6c')]['count']({'where':_0x428679[_0x044e('0x45')]})[_0x044e('0x1e')](function(_0x433d8d){_0x55fdde[_0x044e('0x2b')]=_0x433d8d;if(_0x31b6df[_0x044e('0x3c')]['includeAll']){_0x428679['include']=[{'all':!![]}];}return db[_0x044e('0x6c')][_0x044e('0x4f')](_0x428679);})[_0x044e('0x1e')](function(_0x5724d0){_0x55fdde[_0x044e('0x50')]=_0x5724d0;return _0x55fdde;});}})['then'](respondWithFilteredResult(_0x181e59,_0x428679))[_0x044e('0x55')](handleError(_0x181e59,null));};exports[_0x044e('0x6f')]=function(_0x11b56a,_0x15fd1f,_0x28d51f){var _0x36e688;return db[_0x044e('0x38')]['find']({'where':{'id':_0x11b56a[_0x044e('0x61')]['id']}})[_0x044e('0x1e')](handleEntityNotFound(_0x15fd1f,null))['then'](function(_0x8f17ab){if(_0x8f17ab){return _0x8f17ab[_0x044e('0x6f')](_0x11b56a[_0x044e('0x3c')][_0x044e('0x6a')]);}})['then'](respondWithStatusCode(_0x15fd1f,null))['catch'](handleError(_0x15fd1f,null));};exports[_0x044e('0x70')]=function(_0x5a0378,_0x1aacf7,_0x168f86){var _0x584778={'channel':_0x044e('0x71')};var _0x3094e8=[];var _0x21a8dd=[];var _0x623cd1={};return db[_0x044e('0x38')][_0x044e('0x54')]({'where':{'id':_0x5a0378[_0x044e('0x61')]['id']},'include':[{'model':db[_0x044e('0x72')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x1aacf7,null))[_0x044e('0x1e')](function(_0x2c6463){_0x584778[_0x044e('0x73')]=_0x2c6463;_0x584778[_0x044e('0x74')]=_['orderBy'](_0x2c6463[_0x044e('0x75')],[_0x044e('0x76')],[_0x044e('0x77')]);if(_0x584778[_0x044e('0x73')]['Applications']){delete _0x584778[_0x044e('0x73')]['Applications'];}return db['CmContact'][_0x044e('0x62')]();})[_0x044e('0x1e')](function(_0x5ceefd){if(!_0x5ceefd){throw new db[(_0x044e('0x78'))][(_0x044e('0x79'))]('no\x20available\x20attributes');}_0x3094e8=_[_0x044e('0x7a')](_[_0x044e('0x3b')](_0x5ceefd),[_0x044e('0x7b'),_0x044e('0x7c')]);_0x21a8dd=_[_0x044e('0x7a')](_[_0x044e('0x3b')](_0x5ceefd),['createdAt',_0x044e('0x7c'),_0x044e('0x7d'),_0x044e('0x7e')]);_0x584778[_0x044e('0x57')]={'mapKey':_0x044e('0x7f')};if(_0x584778['account'][_0x044e('0x47')]){switch(_0x584778[_0x044e('0x73')]['type']){case _0x044e('0x80'):_0x584778[_0x044e('0x57')][_0x044e('0x81')]=_0x5a0378['body'][_0x044e('0x82')];_0x584778[_0x044e('0x57')]['body']=_0x5a0378[_0x044e('0x57')][_0x044e('0x83')];_0x584778[_0x044e('0x57')][_0x044e('0x84')]=_0x5a0378[_0x044e('0x57')][_0x044e('0x85')];break;case _0x044e('0x86'):_0x584778[_0x044e('0x57')][_0x044e('0x81')]='+'+_0x5a0378[_0x044e('0x57')][_0x044e('0x87')];_0x584778['body'][_0x044e('0x57')]=_0x5a0378[_0x044e('0x57')]['text'];break;case'connectel':_0x584778[_0x044e('0x57')][_0x044e('0x81')]=_0x5a0378[_0x044e('0x57')]['from'];_0x584778['body'][_0x044e('0x57')]=_0x5a0378[_0x044e('0x57')][_0x044e('0x26')];break;case _0x044e('0x88'):_0x584778[_0x044e('0x57')][_0x044e('0x81')]=_0x5a0378['body']['from'];_0x584778[_0x044e('0x57')]['body']=_0x5a0378[_0x044e('0x57')][_0x044e('0x57')];_0x584778[_0x044e('0x57')][_0x044e('0x84')]=_0x5a0378[_0x044e('0x57')][_0x044e('0x89')];break;case _0x044e('0x8a'):_0x584778[_0x044e('0x57')][_0x044e('0x81')]=_0x5a0378['body'][_0x044e('0x82')];_0x584778[_0x044e('0x57')][_0x044e('0x57')]=_0x5a0378[_0x044e('0x57')][_0x044e('0x8b')];_0x584778[_0x044e('0x57')][_0x044e('0x84')]=_0x5a0378[_0x044e('0x57')][_0x044e('0x8c')];break;case'infobip':_0x584778[_0x044e('0x57')]['from']='+'+_0x5a0378[_0x044e('0x57')]['results'][0x0][_0x044e('0x81')];_0x584778[_0x044e('0x57')][_0x044e('0x57')]=_0x5a0378[_0x044e('0x57')]['results'][0x0][_0x044e('0x8d')];_0x584778['body'][_0x044e('0x84')]=_0x5a0378[_0x044e('0x57')]['results'][0x0][_0x044e('0x84')];break;case _0x044e('0x8e'):_0x584778[_0x044e('0x57')][_0x044e('0x81')]=_0x5a0378[_0x044e('0x57')][_0x044e('0x8f')];_0x584778[_0x044e('0x57')]['body']=_0x5a0378[_0x044e('0x57')]['segmentedMessage'][_0x044e('0x26')];break;case'clickatell':_0x584778[_0x044e('0x57')][_0x044e('0x81')]=_0x5a0378[_0x044e('0x57')]['fromNumber'];_0x584778[_0x044e('0x57')][_0x044e('0x57')]=_0x5a0378['body'][_0x044e('0x8d')];_0x584778['body'][_0x044e('0x84')]=_0x5a0378[_0x044e('0x57')][_0x044e('0x90')];break;case _0x044e('0x91'):_0x584778['body'][_0x044e('0x81')]=_0x5a0378['body'][_0x044e('0x81')];_0x584778[_0x044e('0x57')][_0x044e('0x57')]=_0x5a0378[_0x044e('0x57')][_0x044e('0x26')];_0x584778[_0x044e('0x57')]['messageId']=_0x5a0378['body'][_0x044e('0x92')];break;}}if(_0x584778[_0x044e('0x57')]['id']){delete _0x584778['body']['id'];}if(_[_0x044e('0x93')](_0x584778[_0x044e('0x57')]['from'])){throw new db['Sequelize']['ValidationError'](_0x044e('0x94'));}if(_['isNil'](_0x584778[_0x044e('0x57')][_0x044e('0x57')])||_0x584778[_0x044e('0x57')][_0x044e('0x57')]===''){throw new db['Sequelize'][(_0x044e('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x044e('0x93')](_0x584778[_0x044e('0x57')][_0x044e('0x95')])){throw new db['Sequelize'][(_0x044e('0x79'))](_0x044e('0x96')+_0x21a8dd);}if(!_[_0x044e('0x97')](_0x21a8dd,_0x584778[_0x044e('0x57')][_0x044e('0x95')])){throw new db['Sequelize'][(_0x044e('0x79'))](_0x044e('0x98')+_0x21a8dd);}_0x623cd1[_0x584778[_0x044e('0x57')][_0x044e('0x95')]]=_0x584778[_0x044e('0x57')][_0x044e('0x81')];return db['CmList'][_0x044e('0x54')]({'where':{'id':_0x584778[_0x044e('0x73')][_0x044e('0x7e')]},'include':[{'model':db[_0x044e('0x99')],'as':_0x044e('0x9a'),'where':_0x623cd1,'limit':0x1,'order':[[_0x044e('0x7c'),'DESC']]}]});})[_0x044e('0x1e')](handleEntityNotFound(_0x1aacf7,null))[_0x044e('0x1e')](function(_0x20e00f){if(_0x20e00f){_0x584778[_0x044e('0x9b')]=_['omit'](_0x20e00f,[_0x044e('0x9a')]);if(_0x20e00f[_0x044e('0x9a')][_0x044e('0x40')]){return _0x20e00f[_0x044e('0x9a')][0x0];}var _0x1c98bd=_[_0x044e('0x16')](_0x584778['body'],{'firstName':_0x584778[_0x044e('0x57')]['from'],'ListId':_0x20e00f['id']});_0x1c98bd[_0x584778[_0x044e('0x57')]['mapKey']]=_0x584778['body'][_0x044e('0x81')];return db[_0x044e('0x99')]['create'](_0x1c98bd,{'fields':_0x3094e8,'raw':!![]});}})[_0x044e('0x1e')](handleEntityNotFound(_0x1aacf7,null))[_0x044e('0x1e')](function(_0x195251){if(_0x195251){_0x584778[_0x044e('0x9c')]=_0x195251;var _0x37cd5c={'ContactId':_0x195251['id'],'phone':_0x584778[_0x044e('0x57')][_0x044e('0x81')],'SmsAccountId':_0x5a0378['params']['id']};var _0x29d4b1={'ContactId':_0x195251['id'],'SmsAccountId':_0x5a0378['params']['id'],'closed':![]};return db[_0x044e('0x9d')][_0x044e('0x54')]({'where':_0x29d4b1})[_0x044e('0x1e')](function(_0x44de11){if(_0x44de11){return[_0x44de11,![]];}return db[_0x044e('0x9d')][_0x044e('0x56')](_0x37cd5c)[_0x044e('0x1e')](function(_0x2a6924){return[_0x2a6924,!![]];});});}})[_0x044e('0x9e')](function(_0x4ddc38,_0x570440){_0x584778[_0x044e('0x9f')]=_0x4ddc38['get']({'plain':!![]});_0x584778[_0x044e('0x9f')][_0x044e('0xa0')]=![];if(_0x570440){if(_0x584778[_0x044e('0x73')][_0x044e('0xa1')]){_0x584778['applications'][_0x044e('0xa2')]({'id':0x0,'priority':_0x584778[_0x044e('0x74')][_0x044e('0x40')]+0x1,'app':'close','appdata':_0x044e('0xa3'),'interval':'*,*,*,*'});}_0x584778[_0x044e('0x9f')][_0x044e('0xa0')]=!![];}return db[_0x044e('0xa4')][_0x044e('0x56')]({'phone':_0x584778[_0x044e('0x57')]['from'],'messageId':_0x584778[_0x044e('0x57')]['messageId'],'body':_0x584778['body']['body'],'SmsAccountId':_0x5a0378[_0x044e('0x61')]['id'],'SmsInteractionId':_0x4ddc38['id'],'direction':'in','ContactId':_0x4ddc38[_0x044e('0xa5')],'AttachmentId':_0x584778[_0x044e('0x57')][_0x044e('0xa6')]});})[_0x044e('0x1e')](function(_0x44a4af){_0x584778[_0x044e('0x26')]=_0x44a4af;if(_0x584778['interaction'][_0x044e('0xa7')]){return db[_0x044e('0xa8')][_0x044e('0x54')]({'attributes':['id',_0x044e('0x35')],'where':{'id':_0x584778[_0x044e('0x9f')][_0x044e('0xa7')]}})[_0x044e('0x1e')](function(_0x3b7d1d){if(_0x3b7d1d){_0x584778[_0x044e('0x74')][_0x044e('0xa9')]({'id':0x0,'priority':0x0,'app':_0x044e('0xaa'),'appdata':_0x3b7d1d[_0x044e('0x35')]+','+(_0x584778['account'][_0x044e('0xab')]||0xa),'interval':_0x044e('0xac')});}return respondWithRpcPromise('Start','startRouting',_0x584778);});}return respondWithRpcPromise('Start',_0x044e('0xad'),_0x584778);})[_0x044e('0x1e')](function(_0x141623){if(_0x141623){var _0x47d4af=0xc8;var _0x21b0b3=_0x044e('0xae');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x21b0b3,_0x47d4af,_0x044e('0xaf'));logger['debug'](_0x044e('0xb0'),_0x21b0b3,_0x47d4af,_0x044e('0xaf'),JSON[_0x044e('0xb1')](_0x141623));if(_0x584778[_0x044e('0x73')]['type']==='twilio'){return _0x1aacf7[_0x044e('0x28')](_0x47d4af)['set']('Content-Type',_0x044e('0xb2'))[_0x044e('0x36')](_0x044e('0xb3'));}else{return _0x1aacf7[_0x044e('0x28')](_0x47d4af)[_0x044e('0x2a')](_0x141623);}}})['catch'](handleError(_0x1aacf7,null));};exports[_0x044e('0xb4')]=function(_0x1acf50,_0x251947,_0x5a069c){return db[_0x044e('0x38')][_0x044e('0x6e')]({'where':{'id':_0x1acf50['params']['id']}})['then'](handleEntityNotFound(_0x251947,null))[_0x044e('0x1e')](function(_0x36ee74){if(_0x36ee74){return db[_0x044e('0xb5')]['transaction'](function(_0x202ae0){return db[_0x044e('0x72')][_0x044e('0x33')]({'where':{'SmsAccountId':_0x1acf50['params']['id']},'transaction':_0x202ae0})['then'](function(_0x596304){var _0x2a5951=_[_0x044e('0x46')](_0x1acf50[_0x044e('0x57')],function(_0x5aa9b4){_0x5aa9b4[_0x044e('0x67')]=_0x1acf50[_0x044e('0x61')]['id'];return _0x5aa9b4;});return db[_0x044e('0x72')]['bulkCreate'](_0x2a5951,{'transaction':_0x202ae0});});})[_0x044e('0x1e')](function(){return db[_0x044e('0x72')][_0x044e('0xb6')]({'where':{'SmsAccountId':_0x1acf50[_0x044e('0x61')]['id']},'order':_0x044e('0x76')});});}})[_0x044e('0x1e')](respondWithResult(_0x251947,null))[_0x044e('0x55')](handleError(_0x251947,null));};exports[_0x044e('0xb7')]=function(_0x268b7e,_0x261dae,_0x4fe42a){var _0x4df5e7={};var _0x5e79e1={};var _0x23fb55;var _0x5dc71e;return db[_0x044e('0x38')][_0x044e('0x6e')]({'where':{'id':_0x268b7e[_0x044e('0x61')]['id']}})[_0x044e('0x1e')](handleEntityNotFound(_0x261dae,null))[_0x044e('0x1e')](function(_0x3df9ae){if(_0x3df9ae){_0x23fb55=_0x3df9ae;_0x5e79e1[_0x044e('0x3a')]=_['keys'](db[_0x044e('0x72')][_0x044e('0x39')]);_0x5e79e1[_0x044e('0x3c')]=_[_0x044e('0x3b')](_0x268b7e[_0x044e('0x3c')]);_0x5e79e1[_0x044e('0x3d')]=_[_0x044e('0x3e')](_0x5e79e1[_0x044e('0x3a')],_0x5e79e1[_0x044e('0x3c')]);_0x4df5e7['attributes']=_['intersection'](_0x5e79e1[_0x044e('0x3a')],qs[_0x044e('0x53')](_0x268b7e[_0x044e('0x3c')][_0x044e('0x53')]));_0x4df5e7[_0x044e('0x3f')]=_0x4df5e7[_0x044e('0x3f')][_0x044e('0x40')]?_0x4df5e7[_0x044e('0x3f')]:_0x5e79e1[_0x044e('0x3a')];_0x4df5e7[_0x044e('0x66')]=qs[_0x044e('0x43')](_0x268b7e['query']['sort']);_0x4df5e7[_0x044e('0x45')]=qs[_0x044e('0x3d')](_[_0x044e('0x44')](_0x268b7e[_0x044e('0x3c')],_0x5e79e1[_0x044e('0x3d')]));if(_0x268b7e['query']['filter']){_0x4df5e7['where']=_[_0x044e('0x4c')](_0x4df5e7[_0x044e('0x45')],{'$or':_[_0x044e('0x46')](_0x4df5e7[_0x044e('0x3f')],function(_0x4a4693){var _0x49d875={};_0x49d875[_0x4a4693]={'$like':'%'+_0x268b7e[_0x044e('0x3c')][_0x044e('0x4b')]+'%'};return _0x49d875;})});}_0x4df5e7=_[_0x044e('0x4c')]({},_0x4df5e7,_0x268b7e['options']);return _0x23fb55[_0x044e('0xb7')](_0x4df5e7);}})[_0x044e('0x1e')](function(_0x1ea539){if(_0x1ea539){_0x5dc71e=_0x1ea539[_0x044e('0x40')];if(!_0x268b7e[_0x044e('0x3c')][_0x044e('0x41')]('nolimit')){_0x4df5e7[_0x044e('0x42')]=qs['limit'](_0x268b7e[_0x044e('0x3c')][_0x044e('0x42')]);_0x4df5e7[_0x044e('0x2c')]=qs[_0x044e('0x2c')](_0x268b7e[_0x044e('0x3c')][_0x044e('0x2c')]);}return _0x23fb55[_0x044e('0xb7')](_0x4df5e7);}})[_0x044e('0x1e')](function(_0x4ccd4b){if(_0x4ccd4b){return _0x4ccd4b?{'count':_0x5dc71e,'rows':_0x4ccd4b}:null;}})[_0x044e('0x1e')](respondWithResult(_0x261dae,null))[_0x044e('0x55')](handleError(_0x261dae,null));};exports['getInteractions']=function(_0x2b0a8a,_0x51e437,_0x1f71c4){var _0x4dcf56={'raw':![],'where':{}};var _0x369df4={};var _0x36642f={'count':0x0,'rows':[]};return db[_0x044e('0x38')][_0x044e('0x6e')]({'where':{'id':_0x2b0a8a[_0x044e('0x61')]['id']}})[_0x044e('0x1e')](handleEntityNotFound(_0x51e437,null))[_0x044e('0x1e')](function(_0x34639c){if(_0x34639c){_0x369df4['model']=_[_0x044e('0x3b')](db[_0x044e('0x9d')][_0x044e('0x39')]);_0x369df4['query']=_[_0x044e('0x3b')](_0x2b0a8a[_0x044e('0x3c')]);_0x369df4[_0x044e('0x3d')]=_[_0x044e('0x3e')](_0x369df4['model'],_0x369df4[_0x044e('0x3c')]);_0x4dcf56['attributes']=_['intersection'](_0x369df4[_0x044e('0x3a')],qs['fields'](_0x2b0a8a[_0x044e('0x3c')][_0x044e('0x53')]));_0x4dcf56['attributes']=_0x4dcf56['attributes'][_0x044e('0x40')]?_0x4dcf56[_0x044e('0x3f')]:_0x369df4['model'];if(!_0x2b0a8a[_0x044e('0x3c')][_0x044e('0x41')]('nolimit')){_0x4dcf56[_0x044e('0x42')]=qs[_0x044e('0x42')](_0x2b0a8a['query'][_0x044e('0x42')]);_0x4dcf56[_0x044e('0x2c')]=qs[_0x044e('0x2c')](_0x2b0a8a[_0x044e('0x3c')]['offset']);}_0x4dcf56[_0x044e('0x66')]=qs[_0x044e('0x43')](_0x2b0a8a[_0x044e('0x3c')][_0x044e('0x43')]);_0x4dcf56[_0x044e('0x45')]=qs[_0x044e('0x3d')](_[_0x044e('0x44')](_0x2b0a8a['query'],_0x369df4[_0x044e('0x3d')]));_0x4dcf56[_0x044e('0x45')][_0x044e('0x67')]=_0x34639c['id'];if(_0x2b0a8a['query'][_0x044e('0x4b')]){_0x4dcf56[_0x044e('0x45')]=_[_0x044e('0x4c')](_0x4dcf56[_0x044e('0x45')],{'$or':_['map'](_0x4dcf56['attributes'],function(_0xfc3167){var _0x3bf565={};_0x3bf565[_0xfc3167]={'$like':'%'+_0x2b0a8a[_0x044e('0x3c')][_0x044e('0x4b')]+'%'};return _0x3bf565;})});}_0x4dcf56=_['merge']({},_0x4dcf56,_0x2b0a8a['options']);return db[_0x044e('0x9d')][_0x044e('0x2b')]({'where':_0x4dcf56[_0x044e('0x45')]})[_0x044e('0x1e')](function(_0x41028e){_0x36642f[_0x044e('0x2b')]=_0x41028e;if(_0x2b0a8a[_0x044e('0x3c')][_0x044e('0x68')]){_0x4dcf56[_0x044e('0x4e')]=[{'model':db[_0x044e('0x99')],'as':_0x044e('0xb8'),'required':![]},{'model':db[_0x044e('0xa8')],'as':_0x044e('0xb9'),'attributes':[_0x044e('0x35'),_0x044e('0xba'),_0x044e('0xbb')],'required':![]},{'model':db[_0x044e('0xbc')],'as':'Tags','attributes':['id','name','color'],'where':_0x2b0a8a[_0x044e('0x3c')]['tag']?{'id':_0x2b0a8a[_0x044e('0x3c')][_0x044e('0xbd')]}:undefined,'required':_0x2b0a8a[_0x044e('0x3c')]['tag']?!![]:![]}];}return db[_0x044e('0x9d')]['findAll'](_0x4dcf56);})[_0x044e('0x1e')](function(_0x96a296){_0x36642f[_0x044e('0x50')]=_0x96a296;return _0x36642f;});}})[_0x044e('0x1e')](respondWithFilteredResult(_0x51e437,_0x4dcf56))[_0x044e('0x55')](handleError(_0x51e437,null));};exports[_0x044e('0x36')]=function(_0xadcc5e,_0x1c02a7,_0x3c118c){var _0x48f7f9,_0x43846b,_0x404a44;if(_['isNil'](_0xadcc5e[_0x044e('0x57')][_0x044e('0x57')])||_0xadcc5e['body'][_0x044e('0x57')]===''){throw new db[(_0x044e('0x78'))]['ValidationError'](_0x044e('0xbe'));}if(_['isNil'](_0xadcc5e[_0x044e('0x57')]['to'])){throw new db[(_0x044e('0x78'))][(_0x044e('0x79'))](_0x044e('0xbf'));}_0x48f7f9=_0xadcc5e['body']['to'];return db['SmsAccount']['find']({'where':{'id':_0xadcc5e['params']['id']},'include':[{'model':db['CmList'],'as':_0x044e('0xc0'),'include':[{'model':db['CmContact'],'as':_0x044e('0x9a'),'where':{'mobile':_0x48f7f9},'limit':0x1,'order':[[_0x044e('0x7c'),'DESC']]}]}]})[_0x044e('0x1e')](handleEntityNotFound(_0x1c02a7,null))[_0x044e('0x1e')](function(_0x2d2d74){if(_0x2d2d74&&_0x2d2d74[_0x044e('0xc0')]){_0x43846b=_0x2d2d74['get']({'plain':!![]});if(_0x43846b[_0x044e('0xc0')]&&_0x43846b[_0x044e('0xc0')][_0x044e('0x9a')][_0x044e('0x40')]){return _0x43846b[_0x044e('0xc0')][_0x044e('0x9a')][0x0];}return db[_0x044e('0x99')][_0x044e('0x56')](_['defaults'](_0xadcc5e[_0x044e('0x57')],{'firstName':_0x48f7f9,'mobile':_0x48f7f9,'phone':_0x48f7f9,'ListId':_0x43846b[_0x044e('0x7e')]}));}})[_0x044e('0x1e')](handleEntityNotFound(_0x1c02a7,null))['then'](function(_0x1c6268){if(_0x1c6268){_0x404a44=_0x1c6268;return db[_0x044e('0x9d')][_0x044e('0x54')]({'where':{'ContactId':_0x404a44['id'],'closed':![],'SmsAccountId':_0x43846b['id']}})[_0x044e('0x1e')](function(_0x553e69){if(_0x553e69){return[_0x553e69,![]];}return db[_0x044e('0x9d')][_0x044e('0x56')]({'UserId':_0xadcc5e[_0x044e('0x58')]['id'],'ContactId':_0x404a44['id'],'SmsAccountId':_0x43846b['id'],'phone':_0x48f7f9,'firstMsgDirection':'out','Messages':[_['merge'](_0xadcc5e[_0x044e('0x57')],{'read':![],'body':_0xadcc5e[_0x044e('0x57')][_0x044e('0x57')],'phone':_0x48f7f9,'SmsAccountId':_0x43846b['id'],'UserId':_0xadcc5e[_0x044e('0x58')]['id'],'ContactId':_0x404a44['id']})]},{'include':[{'model':db[_0x044e('0xa4')],'as':'Messages'}]})[_0x044e('0x1e')](function(_0x262711){return[_0x262711,!![]];});});}})[_0x044e('0x9e')](function(_0x29dd14,_0x47ed17){if(_0x47ed17){return _0x29dd14;}return db[_0x044e('0xa4')]['create'](_[_0x044e('0x4c')](_0xadcc5e[_0x044e('0x57')],{'read':![],'body':_0xadcc5e[_0x044e('0x57')][_0x044e('0x57')],'phone':_0x48f7f9,'SmsAccountId':_0x43846b['id'],'SmsInteractionId':_0x29dd14['id'],'UserId':_0xadcc5e[_0x044e('0x58')]['id'],'ContactId':_0x404a44['id']}))[_0x044e('0x1e')](function(_0x2a2f41){_0x29dd14[_0x044e('0xc1')][_0x044e('0xc2')]=[];_0x29dd14[_0x044e('0xc1')][_0x044e('0xc2')][_0x044e('0xa2')](_0x2a2f41[_0x044e('0xc1')]);return _0x29dd14;});})[_0x044e('0x1e')](respondWithResult(_0x1c02a7,null))[_0x044e('0x55')](handleError(_0x1c02a7,null));};exports[_0x044e('0x28')]=function(_0x130e7c,_0x523361,_0x499772){if(_0x130e7c['body']['id']){delete _0x130e7c['body']['id'];}console['log'](_0x044e('0xc3'),_0x130e7c[_0x044e('0x57')]);var _0x4910d5,_0x337d24,_0x4bd7bd;return db['SmsAccount'][_0x044e('0x54')]({'where':{'id':_0x130e7c['params']['id']}})[_0x044e('0x1e')](handleEntityNotFound(_0x523361,null))[_0x044e('0x1e')](function(_0x2f9aff){if(_0x2f9aff){_0x4bd7bd=_0x2f9aff;logger[_0x044e('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x044e('0x28'),_0x044e('0xc4'),_0x2f9aff[_0x044e('0x47')],util[_0x044e('0xc5')](_0x130e7c['body'],{'showHidden':![],'depth':null}));switch(_0x2f9aff[_0x044e('0x47')]){case'skebby':if(_0x130e7c[_0x044e('0x57')][_0x044e('0xc6')]&&_0x130e7c['body'][_0x044e('0x28')]){_0x337d24=_0x130e7c[_0x044e('0x57')][_0x044e('0x28')];return db['SmsMessage']['find']({'where':{'messageId':_0x130e7c[_0x044e('0x57')][_0x044e('0xc6')]}});}break;case _0x044e('0xc7'):if(_0x130e7c[_0x044e('0x57')][_0x044e('0xc8')]&&_0x130e7c['body'][_0x044e('0xc9')]){_0x337d24=_0x130e7c[_0x044e('0x57')][_0x044e('0xc9')];return db[_0x044e('0xa4')]['find']({'where':{'messageId':_0x130e7c[_0x044e('0x57')]['requestid']}});}break;case _0x044e('0x88'):if(_0x130e7c[_0x044e('0x57')][_0x044e('0x89')]&&_0x130e7c[_0x044e('0x57')][_0x044e('0xca')]){_0x337d24=_0x130e7c['body']['status_code'];return db[_0x044e('0xa4')][_0x044e('0x54')]({'where':{'messageId':_0x130e7c[_0x044e('0x57')]['message_id']}});}break;case _0x044e('0xcb'):var _0x4d3da3=_0x130e7c[_0x044e('0x57')][_0x044e('0xcc')][0x0];if(_0x4d3da3[_0x044e('0x84')]&&_0x4d3da3[_0x044e('0x28')][_0x044e('0xcd')]===_0x044e('0xce')){_0x337d24=_0x4d3da3[_0x044e('0x28')][_0x044e('0xcd')];return db[_0x044e('0xa4')][_0x044e('0x54')]({'where':{'messageId':_0x4d3da3['messageId']}});}break;case _0x044e('0xcf'):if(_0x130e7c[_0x044e('0x57')][_0x044e('0x84')]&&_0x130e7c[_0x044e('0x57')][_0x044e('0x28')]){_0x337d24=_0x130e7c[_0x044e('0x57')][_0x044e('0x28')];return db[_0x044e('0xa4')][_0x044e('0x54')]({'where':{'messageId':_0x130e7c['body'][_0x044e('0x84')]}});}break;case'intelepeer':if(_0x130e7c[_0x044e('0x57')][_0x044e('0xd0')]&&_0x130e7c[_0x044e('0x57')][_0x044e('0x28')]){_0x337d24=_0x130e7c[_0x044e('0x57')][_0x044e('0x28')];return db[_0x044e('0xa4')]['find']({'where':{'messageId':_0x130e7c['body'][_0x044e('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x523361,null))['then'](function(_0x171965){if(_0x171965){_0x4910d5=_0x171965;switch(_0x4bd7bd[_0x044e('0x47')]){case _0x044e('0x86'):if(_0x337d24===_0x044e('0xce')){return _0x4910d5[_0x044e('0x31')]({'read':!![]});}else{logger['error'](_0x044e('0x23'),_0x044e('0x28'),'skebby',util[_0x044e('0xc5')](_0x130e7c['body'],{'showHidden':![],'depth':null}));}break;case _0x044e('0xc7'):if(_0x337d24==='1'){return _0x4910d5[_0x044e('0x31')]({'read':!![]});}else{logger['error'](_0x044e('0x23'),'status',_0x044e('0x86'),util[_0x044e('0xc5')](_0x130e7c[_0x044e('0x57')],{'showHidden':![],'depth':null}));}break;case _0x044e('0x88'):if(!_0x130e7c[_0x044e('0x57')][_0x044e('0xd1')]&&_0x337d24>=0xc8&&_0x337d24<=0xce){return _0x4910d5[_0x044e('0x31')]({'read':!![]});}else{logger[_0x044e('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','clicksend',util['inspect'](_0x130e7c[_0x044e('0x57')],{'showHidden':![],'depth':null}));}break;case _0x044e('0xcb'):var _0x50a585=_0x130e7c[_0x044e('0x57')][_0x044e('0xcc')][0x0];if(_0x50a585[_0x044e('0x28')][_0x044e('0xcd')]===_0x044e('0xce')){return _0x4910d5[_0x044e('0x31')]({'read':!![]});}else{logger[_0x044e('0x24')](_0x044e('0x23'),'status','infobip',util[_0x044e('0xc5')](_0x130e7c[_0x044e('0x57')],{'showHidden':![],'depth':null}));}break;case _0x044e('0xcf'):if(_0x337d24=='DELIVERED_TO_GATEWAY'||_0x337d24=='RECEIVED_BY_RECIPIENT'){return _0x4910d5[_0x044e('0x31')]({'read':!![]});}else{logger[_0x044e('0x24')](_0x044e('0x23'),_0x044e('0x28'),_0x044e('0xcf'),util[_0x044e('0xc5')](_0x130e7c['body'],{'showHidden':![],'depth':null}));}break;case _0x044e('0x91'):if(_0x337d24===_0x044e('0xd2')||_0x337d24===_0x044e('0xd3')){return _0x4910d5[_0x044e('0x31')]({'read':!![]});}else{logger[_0x044e('0x24')](_0x044e('0x23'),'status','intelepeer',util['inspect'](_0x130e7c[_0x044e('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x4910d5;}})[_0x044e('0x1e')](respondWithResult(_0x523361,null))[_0x044e('0x55')](handleError(_0x523361,null));};exports['statusGet']=function(_0xce8059,_0xd99ffd,_0x3c0759){var _0x6bd84e,_0x5d493e,_0x2b2934;return db[_0x044e('0x38')][_0x044e('0x54')]({'where':{'id':_0xce8059[_0x044e('0x61')]['id']}})[_0x044e('0x1e')](handleEntityNotFound(_0xd99ffd,null))[_0x044e('0x1e')](function(_0x16d14a){if(_0x16d14a){_0x2b2934=_0x16d14a;logger['debug'](_0x044e('0x23'),_0x044e('0x28'),_0x044e('0xc4'),_0x16d14a[_0x044e('0x47')],util['inspect'](_0xce8059[_0x044e('0x3c')],{'showHidden':![],'depth':null}));switch(_0x16d14a[_0x044e('0x47')]){case _0x044e('0x8e'):if(_0xce8059['query'][_0x044e('0xd4')]&&_0xce8059[_0x044e('0x3c')][_0x044e('0xd5')]){_0x5d493e=_0xce8059[_0x044e('0x3c')][_0x044e('0xd5')];return db['SmsMessage']['find']({'where':{'messageId':_0xce8059['query'][_0x044e('0xd4')]}});}break;}}})[_0x044e('0x1e')](handleEntityNotFound(_0xd99ffd,null))[_0x044e('0x1e')](function(_0x54639f){if(_0x54639f){_0x6bd84e=_0x54639f;switch(_0x2b2934['type']){case'csc':if(_0x5d493e==='2'||_0x5d493e==='6'){return _0x6bd84e[_0x044e('0x31')]({'read':!![]});}else{logger[_0x044e('0x24')](_0x044e('0x23'),'status',_0x044e('0x8e'),util[_0x044e('0xc5')](_0xce8059[_0x044e('0x3c')],{'showHidden':![],'depth':null}));};break;}return _0x6bd84e;}})[_0x044e('0x1e')](respondWithResult(_0xd99ffd,null))[_0x044e('0x55')](handleError(_0xd99ffd,null));};exports[_0x044e('0xd6')]=function(_0x2267c6,_0x15062a,_0x597b4f){return db[_0x044e('0x38')][_0x044e('0x54')]({'where':{'id':_0x2267c6['params']['id']}})[_0x044e('0x1e')](handleEntityNotFound(_0x15062a,null))[_0x044e('0x1e')](function(_0x532f76){if(_0x532f76){return _0x532f76[_0x044e('0xd6')](_0x2267c6[_0x044e('0x57')][_0x044e('0x6a')],_[_0x044e('0xd7')](_0x2267c6[_0x044e('0x57')],[_0x044e('0x6a'),'id'])||{})[_0x044e('0x9e')](function(_0x26762f){for(var _0x3a4d46=0x0;_0x3a4d46<_0x2267c6[_0x044e('0x57')][_0x044e('0x6a')][_0x044e('0x40')];_0x3a4d46+=0x1){socket[_0x044e('0xd8')](_0x044e('0xd9'),{'UserId':_0x2267c6[_0x044e('0x57')][_0x044e('0x6a')][_0x3a4d46],'SmsAccountId':_0x2267c6[_0x044e('0x61')]['id']});}return _0x26762f;});}})[_0x044e('0x1e')](respondWithResult(_0x15062a,null))[_0x044e('0x55')](handleError(_0x15062a,null));};exports['removeAgents']=function(_0x2f2298,_0x331b13,_0x4eff15){var _0x279d4e;return db[_0x044e('0x38')][_0x044e('0x54')]({'where':{'id':_0x2f2298[_0x044e('0x61')]['id']}})[_0x044e('0x1e')](handleEntityNotFound(_0x331b13,null))[_0x044e('0x1e')](function(_0x50e561){if(_0x50e561){return _0x50e561[_0x044e('0xda')](_0x2f2298[_0x044e('0x3c')]['ids'])['then'](function(_0x55dfee){if(_[_0x044e('0xdb')](_0x2f2298[_0x044e('0x3c')][_0x044e('0x6a')])){for(var _0x9ecc5d=0x0;_0x9ecc5d<_0x2f2298[_0x044e('0x3c')][_0x044e('0x6a')][_0x044e('0x40')];_0x9ecc5d+=0x1){socket['emit'](_0x044e('0xdc'),{'UserId':_0x2f2298[_0x044e('0x3c')]['ids'][_0x9ecc5d],'SmsAccountId':_0x2f2298[_0x044e('0x61')]['id']});}}else{socket[_0x044e('0xd8')](_0x044e('0xdc'),{'UserId':_0x2f2298['query'][_0x044e('0x6a')],'SmsAccountId':_0x2f2298[_0x044e('0x61')]['id']});}});}})[_0x044e('0x1e')](respondWithStatusCode(_0x331b13,null))[_0x044e('0x55')](handleError(_0x331b13,null));};exports['getAgents']=function(_0x344523,_0x3cc46e,_0x5de6f5){var _0x3576a2={};var _0x3018de={};var _0x2cae41;var _0xecdba6;return db['SmsAccount'][_0x044e('0x6e')]({'where':{'id':_0x344523['params']['id']}})[_0x044e('0x1e')](handleEntityNotFound(_0x3cc46e,null))['then'](function(_0x33e7ef){if(_0x33e7ef){_0x2cae41=_0x33e7ef;_0x3018de[_0x044e('0x3a')]=_[_0x044e('0x3b')](db[_0x044e('0xa8')][_0x044e('0x39')]);_0x3018de[_0x044e('0x3c')]=_[_0x044e('0x3b')](_0x344523[_0x044e('0x3c')]);_0x3018de['filters']=_[_0x044e('0x3e')](_0x3018de['model'],_0x3018de[_0x044e('0x3c')]);_0x3576a2[_0x044e('0x3f')]=_[_0x044e('0x3e')](_0x3018de[_0x044e('0x3a')],qs[_0x044e('0x53')](_0x344523['query'][_0x044e('0x53')]));_0x3576a2[_0x044e('0x3f')]=_0x3576a2[_0x044e('0x3f')]['length']?_0x3576a2[_0x044e('0x3f')]:_0x3018de[_0x044e('0x3a')];_0x3576a2['order']=qs[_0x044e('0x43')](_0x344523[_0x044e('0x3c')][_0x044e('0x43')]);_0x3576a2[_0x044e('0x45')]=qs[_0x044e('0x3d')](_[_0x044e('0x44')](_0x344523['query'],_0x3018de[_0x044e('0x3d')]));if(_0x344523[_0x044e('0x3c')][_0x044e('0x4b')]){_0x3576a2[_0x044e('0x45')]=_[_0x044e('0x4c')](_0x3576a2['where'],{'$or':_[_0x044e('0x46')](_0x3576a2[_0x044e('0x3f')],function(_0x243fd2){var _0x14f3f2={};_0x14f3f2[_0x243fd2]={'$like':'%'+_0x344523['query'][_0x044e('0x4b')]+'%'};return _0x14f3f2;})});}_0x3576a2=_[_0x044e('0x4c')]({},_0x3576a2,_0x344523[_0x044e('0x4d')]);return _0x2cae41[_0x044e('0xdd')](_0x3576a2);}})[_0x044e('0x1e')](function(_0xc492a){if(_0xc492a){_0xecdba6=_0xc492a[_0x044e('0x40')];if(!_0x344523[_0x044e('0x3c')][_0x044e('0x41')]('nolimit')){_0x3576a2[_0x044e('0x42')]=qs[_0x044e('0x42')](_0x344523[_0x044e('0x3c')][_0x044e('0x42')]);_0x3576a2[_0x044e('0x2c')]=qs[_0x044e('0x2c')](_0x344523['query']['offset']);}return _0x2cae41[_0x044e('0xdd')](_0x3576a2);}})[_0x044e('0x1e')](function(_0x4d04c9){if(_0x4d04c9){return _0x4d04c9?{'count':_0xecdba6,'rows':_0x4d04c9}:null;}})[_0x044e('0x1e')](respondWithResult(_0x3cc46e,null))['catch'](handleError(_0x3cc46e,null));}; \ No newline at end of file +var _0xf492=['asc','CmContact','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','messageId','skebby','clicksend','message_id','plivo','Text','MessageUUID','results','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','SmsMessage','ContactId','UserId','User','unshift','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','twilio','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','redif','type','inspect','connectel','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','csc','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','end','sendStatus','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','key','VIRTUAL','options','includeAll','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','addDisposition','SmsAccountId','Disposition','getDispositions','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','include','findAll','removeAnswers','ids','notify','SmsApplication','Applications','account','priority'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0xf492,0x67));var _0x2f49=function(_0x151fb3,_0x35298e){_0x151fb3=_0x151fb3-0x0;var _0x21b3d5=_0xf492[_0x151fb3];return _0x21b3d5;};'use strict';var pdf=require(_0x2f49('0x0'));var emlformat=require(_0x2f49('0x1'));var rimraf=require(_0x2f49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f49('0x3'));var rp=require('request-promise');var moment=require(_0x2f49('0x4'));var BPromise=require(_0x2f49('0x5'));var Mustache=require(_0x2f49('0x6'));var util=require(_0x2f49('0x7'));var path=require('path');var sox=require(_0x2f49('0x8'));var csv=require(_0x2f49('0x9'));var ejs=require(_0x2f49('0xa'));var fs=require('fs');var _=require(_0x2f49('0xb'));var squel=require(_0x2f49('0xc'));var crypto=require(_0x2f49('0xd'));var jsforce=require(_0x2f49('0xe'));var deskjs=require(_0x2f49('0xf'));var toCsv=require(_0x2f49('0x9'));var querystring=require(_0x2f49('0x10'));var Papa=require(_0x2f49('0x11'));var authService=require('../../components/auth/service');var hardwareService=require(_0x2f49('0x12'));var Redis=require(_0x2f49('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x2f49('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x2f49('0x15'));var db=require(_0x2f49('0x16'))['db'];config[_0x2f49('0x17')]=_[_0x2f49('0x18')](config[_0x2f49('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x2f49('0x19'))(new Redis(config[_0x2f49('0x17')]));require(_0x2f49('0x1a'))[_0x2f49('0x1b')](socket);var jayson=require(_0x2f49('0x1c'));var client=jayson[_0x2f49('0x1d')][_0x2f49('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x364918,_0x13ba50,_0x3d6ea3,_0x170fc2){return new BPromise(function(_0x5f3de6,_0x21d77a){var _0x2703af=_0x170fc2||client;return _0x2703af[_0x2f49('0x1f')](_0x364918,_0x3d6ea3)[_0x2f49('0x20')](function(_0x597404){logger[_0x2f49('0x21')](_0x2f49('0x22'),_0x13ba50,_0x2f49('0x23'));logger[_0x2f49('0x24')](_0x2f49('0x25'),_0x13ba50,_0x2f49('0x23'),JSON[_0x2f49('0x26')](_0x597404));if(_0x597404[_0x2f49('0x27')]){if(_0x597404['error']['code']===0x1f4){logger[_0x2f49('0x27')](_0x2f49('0x22'),_0x13ba50,_0x597404[_0x2f49('0x27')][_0x2f49('0x28')]);return _0x21d77a(_0x597404['error'][_0x2f49('0x28')]);}logger[_0x2f49('0x27')]('SmsAccount,\x20%s,\x20%s',_0x13ba50,_0x597404[_0x2f49('0x27')][_0x2f49('0x28')]);return _0x5f3de6(_0x597404['error'][_0x2f49('0x28')]);}else{logger['info'](_0x2f49('0x22'),_0x13ba50,'request\x20sent');_0x5f3de6(_0x597404[_0x2f49('0x29')][_0x2f49('0x28')]);}})[_0x2f49('0x2a')](function(_0x385b82){logger['error'](_0x2f49('0x22'),_0x13ba50,_0x385b82);_0x21d77a(_0x385b82);});});}function respondWithStatusCode(_0x260590,_0x502183){_0x502183=_0x502183||0xcc;return function(_0x4be093){if(_0x4be093){return _0x260590['sendStatus'](_0x502183);}return _0x260590[_0x2f49('0x2b')](_0x502183)['end']();};}function respondWithResult(_0xc2c999,_0x2720dc){_0x2720dc=_0x2720dc||0xc8;return function(_0x2ddc51){if(_0x2ddc51){return _0xc2c999['status'](_0x2720dc)[_0x2f49('0x2c')](_0x2ddc51);}};}function respondWithFilteredResult(_0xec5144,_0x3135f0){return function(_0x2abd2c){if(_0x2abd2c){var _0x2c3641=_0x2abd2c[_0x2f49('0x2d')],_0x188578=_0x3135f0[_0x2f49('0x2e')],_0x288f66=_0x3135f0[_0x2f49('0x2e')]+_0x3135f0['limit'],_0x5b0742;if(_0x288f66>=_0x2c3641){_0x288f66=_0x2c3641;_0x5b0742=0xc8;}else{_0x5b0742=0xce;}_0xec5144[_0x2f49('0x2b')](_0x5b0742);return _0xec5144[_0x2f49('0x2f')](_0x2f49('0x30'),_0x188578+'-'+_0x288f66+'/'+_0x2c3641)[_0x2f49('0x2c')](_0x2abd2c);}return null;};}function patchUpdates(_0x15e006){return function(_0x2533f8){try{jsonpatch[_0x2f49('0x31')](_0x2533f8,_0x15e006,!![]);}catch(_0x2b7a9d){return BPromise[_0x2f49('0x32')](_0x2b7a9d);}return _0x2533f8[_0x2f49('0x33')]();};}function saveUpdates(_0x346a29,_0x5f5a7b){return function(_0x134983){if(_0x134983){return _0x134983[_0x2f49('0x34')](_0x346a29)[_0x2f49('0x20')](function(_0x4113b3){return _0x4113b3;});}return null;};}function removeEntity(_0x1cb905,_0x1528fa){return function(_0x4682dd){if(_0x4682dd){return _0x4682dd[_0x2f49('0x35')]()['then'](function(){var _0x4f6305=_0x4682dd[_0x2f49('0x36')]({'plain':!![]});var _0x3b21a5=_0x2f49('0x37');return db[_0x2f49('0x38')][_0x2f49('0x35')]({'where':{'type':_0x3b21a5,'resourceId':_0x4f6305['id']}})[_0x2f49('0x20')](function(){return _0x4682dd;});})['then'](function(){_0x1cb905[_0x2f49('0x2b')](0xcc)[_0x2f49('0x39')]();});}};}function handleEntityNotFound(_0x545f0f,_0x350c00){return function(_0x246aef){if(!_0x246aef){_0x545f0f[_0x2f49('0x3a')](0x194);}return _0x246aef;};}function handleError(_0x2ec930,_0x4877d6){_0x4877d6=_0x4877d6||0x1f4;return function(_0x59f1e8){logger['error'](_0x59f1e8['stack']);if(_0x59f1e8['name']){delete _0x59f1e8[_0x2f49('0x3b')];}_0x2ec930[_0x2f49('0x2b')](_0x4877d6)[_0x2f49('0x3c')](_0x59f1e8);};}exports[_0x2f49('0x3d')]=function(_0x24747a,_0x41279d){var _0x39a0ce={'include':[{'model':db[_0x2f49('0x3e')],'as':_0x2f49('0x3f')}]},_0x49c50c={},_0x561c3d={'count':0x0,'rows':[]};var _0x99a81b=db[_0x2f49('0x40')][_0x2f49('0x41')];_0x49c50c['model']=_[_0x2f49('0x42')](_0x99a81b);_0x49c50c['query']=_['keys'](_0x24747a[_0x2f49('0x43')]);_0x49c50c[_0x2f49('0x44')]=_[_0x2f49('0x45')](_0x49c50c[_0x2f49('0x46')],_0x49c50c['query']);_0x39a0ce[_0x2f49('0x47')]=_['intersection'](_0x49c50c[_0x2f49('0x46')],qs[_0x2f49('0x48')](_0x24747a[_0x2f49('0x43')][_0x2f49('0x48')]));_0x39a0ce[_0x2f49('0x47')]=_0x39a0ce[_0x2f49('0x47')][_0x2f49('0x49')]?_0x39a0ce['attributes']:_0x49c50c[_0x2f49('0x46')];if(!_0x24747a['query'][_0x2f49('0x4a')](_0x2f49('0x4b'))){_0x39a0ce[_0x2f49('0x4c')]=qs[_0x2f49('0x4c')](_0x24747a[_0x2f49('0x43')][_0x2f49('0x4c')]);_0x39a0ce[_0x2f49('0x2e')]=qs['offset'](_0x24747a[_0x2f49('0x43')][_0x2f49('0x2e')]);}_0x39a0ce['order']=qs[_0x2f49('0x4d')](_0x24747a['query'][_0x2f49('0x4d')]);_0x39a0ce[_0x2f49('0x4e')]=qs[_0x2f49('0x44')](_[_0x2f49('0x4f')](_0x24747a[_0x2f49('0x43')],_0x49c50c[_0x2f49('0x44')]));if(_0x24747a[_0x2f49('0x43')][_0x2f49('0x50')]){_0x39a0ce[_0x2f49('0x4e')]=_[_0x2f49('0x51')](_0x39a0ce[_0x2f49('0x4e')],{'$or':_[_0x2f49('0x52')](_0x99a81b,function(_0x24cb71){if(_0x24cb71['type'][_0x2f49('0x53')]!==_0x2f49('0x54')){var _0x277dec={};_0x277dec[_0x24cb71['field']]={'$like':'%'+_0x24747a[_0x2f49('0x43')]['filter']+'%'};return _0x277dec;}})});}_0x39a0ce=_[_0x2f49('0x51')]({},_0x39a0ce,_0x24747a[_0x2f49('0x55')]);var _0x29e86e={'where':_0x39a0ce[_0x2f49('0x4e')]};return db[_0x2f49('0x40')][_0x2f49('0x2d')](_0x29e86e)[_0x2f49('0x20')](function(_0x22d612){_0x561c3d[_0x2f49('0x2d')]=_0x22d612;if(_0x24747a[_0x2f49('0x43')][_0x2f49('0x56')]){_0x39a0ce['include']=[{'all':!![]}];}return db[_0x2f49('0x40')]['findAll'](_0x39a0ce);})[_0x2f49('0x20')](function(_0x282168){_0x561c3d[_0x2f49('0x57')]=_0x282168;return _0x561c3d;})[_0x2f49('0x20')](respondWithFilteredResult(_0x41279d,_0x39a0ce))[_0x2f49('0x2a')](handleError(_0x41279d,null));};exports[_0x2f49('0x58')]=function(_0x52026d,_0x1e2349){var _0x21814b={'raw':![],'where':{'id':_0x52026d[_0x2f49('0x59')]['id']},'include':[{'model':db[_0x2f49('0x3e')],'as':_0x2f49('0x3f')}]},_0x464244={};_0x464244[_0x2f49('0x46')]=_[_0x2f49('0x42')](db[_0x2f49('0x40')]['rawAttributes']);_0x464244[_0x2f49('0x43')]=_[_0x2f49('0x42')](_0x52026d[_0x2f49('0x43')]);_0x464244[_0x2f49('0x44')]=_[_0x2f49('0x45')](_0x464244[_0x2f49('0x46')],_0x464244[_0x2f49('0x43')]);_0x21814b[_0x2f49('0x47')]=_[_0x2f49('0x45')](_0x464244[_0x2f49('0x46')],qs[_0x2f49('0x48')](_0x52026d[_0x2f49('0x43')]['fields']));_0x21814b[_0x2f49('0x47')]=_0x21814b[_0x2f49('0x47')][_0x2f49('0x49')]?_0x21814b[_0x2f49('0x47')]:_0x464244[_0x2f49('0x46')];if(_0x52026d[_0x2f49('0x43')][_0x2f49('0x56')]){_0x21814b['include']=[{'all':!![]}];}_0x21814b=_['merge']({},_0x21814b,_0x52026d[_0x2f49('0x55')]);return db[_0x2f49('0x40')]['find'](_0x21814b)['then'](handleEntityNotFound(_0x1e2349,null))[_0x2f49('0x20')](respondWithResult(_0x1e2349,null))[_0x2f49('0x2a')](handleError(_0x1e2349,null));};exports[_0x2f49('0x5a')]=function(_0x4f4819,_0x598c60){return db[_0x2f49('0x40')]['create'](_0x4f4819[_0x2f49('0x5b')],{})[_0x2f49('0x20')](function(_0xf84f4a){var _0xd8896=_0x4f4819[_0x2f49('0x5c')]['get']({'plain':!![]});if(!_0xd8896)throw new Error(_0x2f49('0x5d'));if(_0xd8896[_0x2f49('0x5e')]==='user'){var _0x197045=_0xf84f4a['get']({'plain':!![]});var _0x5540b1=_0x2f49('0x37');return db[_0x2f49('0x5f')][_0x2f49('0x60')]({'where':{'name':_0x5540b1,'userProfileId':_0xd8896[_0x2f49('0x61')]},'raw':!![]})[_0x2f49('0x20')](function(_0x559a38){if(_0x559a38&&_0x559a38[_0x2f49('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x197045['name'],'resourceId':_0x197045['id'],'type':_0x559a38[_0x2f49('0x3b')],'sectionId':_0x559a38['id']},{})['then'](function(){return _0xf84f4a;});}else{return _0xf84f4a;}})[_0x2f49('0x2a')](function(_0x251081){logger[_0x2f49('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x251081);throw _0x251081;});}return _0xf84f4a;})['then'](respondWithResult(_0x598c60,0xc9))[_0x2f49('0x2a')](handleError(_0x598c60,null));};exports['update']=function(_0x2841d4,_0x62f2a2){if(_0x2841d4[_0x2f49('0x5b')]['id']){delete _0x2841d4[_0x2f49('0x5b')]['id'];}return db[_0x2f49('0x40')]['find']({'where':{'id':_0x2841d4[_0x2f49('0x59')]['id']},'include':[{'model':db[_0x2f49('0x3e')],'as':_0x2f49('0x3f')}]})[_0x2f49('0x20')](handleEntityNotFound(_0x62f2a2,null))[_0x2f49('0x20')](saveUpdates(_0x2841d4[_0x2f49('0x5b')],null))[_0x2f49('0x20')](function(_0x493ab7){if(_0x493ab7&&_0x2841d4[_0x2f49('0x5b')][_0x2f49('0x3f')]){return db['Pause'][_0x2f49('0x34')](_0x2841d4[_0x2f49('0x5b')][_0x2f49('0x3f')],{'where':{'SmsAccountId':_0x493ab7['id']}})[_0x2f49('0x20')](function(){return _0x493ab7;});}return _0x493ab7;})[_0x2f49('0x20')](respondWithResult(_0x62f2a2,null))[_0x2f49('0x2a')](handleError(_0x62f2a2,null));};exports[_0x2f49('0x35')]=function(_0x559d16,_0x93c4ae){return db[_0x2f49('0x40')][_0x2f49('0x60')]({'where':{'id':_0x559d16[_0x2f49('0x59')]['id']}})['then'](handleEntityNotFound(_0x93c4ae,null))[_0x2f49('0x20')](removeEntity(_0x93c4ae,null))['catch'](handleError(_0x93c4ae,null));};exports[_0x2f49('0x63')]=function(_0x149bd0,_0x447aa0){return db[_0x2f49('0x40')]['describe']()[_0x2f49('0x20')](respondWithResult(_0x447aa0,null))[_0x2f49('0x2a')](handleError(_0x447aa0,null));};exports[_0x2f49('0x64')]=function(_0x3e9d7f,_0x3be883,_0x460ec3){if(_0x3e9d7f[_0x2f49('0x5b')]['id']){delete _0x3e9d7f[_0x2f49('0x5b')]['id'];}return db[_0x2f49('0x40')][_0x2f49('0x60')]({'where':{'id':_0x3e9d7f['params']['id']}})[_0x2f49('0x20')](handleEntityNotFound(_0x3be883,null))[_0x2f49('0x20')](function(_0x2e7745){if(_0x2e7745){_0x3e9d7f['body'][_0x2f49('0x65')]=_0x2e7745['id'];return db[_0x2f49('0x66')]['create'](_0x3e9d7f[_0x2f49('0x5b')]);}})[_0x2f49('0x20')](respondWithResult(_0x3be883,null))['catch'](handleError(_0x3be883,null));};exports[_0x2f49('0x67')]=function(_0x593d8b,_0x5609fd,_0x2968bb){var _0x2863d9={'raw':![],'where':{}};var _0x2aed07={};var _0x2997c7={'count':0x0,'rows':[]};return db[_0x2f49('0x40')]['findOne']({'where':{'id':_0x593d8b['params']['id']}})[_0x2f49('0x20')](handleEntityNotFound(_0x5609fd,null))[_0x2f49('0x20')](function(_0x56d6a9){if(_0x56d6a9){_0x2aed07[_0x2f49('0x46')]=_['keys'](db[_0x2f49('0x66')][_0x2f49('0x41')]);_0x2aed07[_0x2f49('0x43')]=_['keys'](_0x593d8b['query']);_0x2aed07['filters']=_[_0x2f49('0x45')](_0x2aed07[_0x2f49('0x46')],_0x2aed07[_0x2f49('0x43')]);_0x2863d9[_0x2f49('0x47')]=_[_0x2f49('0x45')](_0x2aed07[_0x2f49('0x46')],qs[_0x2f49('0x48')](_0x593d8b['query']['fields']));_0x2863d9[_0x2f49('0x47')]=_0x2863d9['attributes'][_0x2f49('0x49')]?_0x2863d9[_0x2f49('0x47')]:_0x2aed07[_0x2f49('0x46')];if(!_0x593d8b[_0x2f49('0x43')]['hasOwnProperty'](_0x2f49('0x4b'))){_0x2863d9['limit']=qs[_0x2f49('0x4c')](_0x593d8b[_0x2f49('0x43')][_0x2f49('0x4c')]);_0x2863d9[_0x2f49('0x2e')]=qs['offset'](_0x593d8b[_0x2f49('0x43')][_0x2f49('0x2e')]);}_0x2863d9[_0x2f49('0x68')]=qs[_0x2f49('0x4d')](_0x593d8b['query']['sort']);_0x2863d9['where']=qs['filters'](_[_0x2f49('0x4f')](_0x593d8b[_0x2f49('0x43')],_0x2aed07[_0x2f49('0x44')]));_0x2863d9['where'][_0x2f49('0x65')]=_0x56d6a9['id'];if(_0x593d8b[_0x2f49('0x43')][_0x2f49('0x50')]){_0x2863d9[_0x2f49('0x4e')]=_[_0x2f49('0x51')](_0x2863d9[_0x2f49('0x4e')],{'$or':_['map'](_0x2863d9[_0x2f49('0x47')],function(_0x42b601){var _0x33252a={};_0x33252a[_0x42b601]={'$like':'%'+_0x593d8b['query'][_0x2f49('0x50')]+'%'};return _0x33252a;})});}_0x2863d9=_[_0x2f49('0x51')]({},_0x2863d9,_0x593d8b['options']);return db[_0x2f49('0x66')][_0x2f49('0x2d')]({'where':_0x2863d9['where']})[_0x2f49('0x20')](function(_0x54ddac){_0x2997c7[_0x2f49('0x2d')]=_0x54ddac;if(_0x593d8b[_0x2f49('0x43')][_0x2f49('0x56')]){_0x2863d9['include']=[{'all':!![]}];}return db[_0x2f49('0x66')]['findAll'](_0x2863d9);})[_0x2f49('0x20')](function(_0x51ee50){_0x2997c7[_0x2f49('0x57')]=_0x51ee50;return _0x2997c7;});}})['then'](respondWithFilteredResult(_0x5609fd,_0x2863d9))[_0x2f49('0x2a')](handleError(_0x5609fd,null));};exports[_0x2f49('0x69')]=function(_0x2335e3,_0x4be7b7,_0x27a7d5){var _0x4ad453;return db[_0x2f49('0x40')]['find']({'where':{'id':_0x2335e3['params']['id']}})['then'](handleEntityNotFound(_0x4be7b7,null))[_0x2f49('0x20')](function(_0x456a3a){if(_0x456a3a){return _0x456a3a['removeDispositions'](_0x2335e3[_0x2f49('0x43')]['ids']);}})[_0x2f49('0x20')](respondWithStatusCode(_0x4be7b7,null))['catch'](handleError(_0x4be7b7,null));};exports[_0x2f49('0x6a')]=function(_0x11cbcd,_0x550915,_0x1dd957){if(_0x11cbcd[_0x2f49('0x5b')]['id']){delete _0x11cbcd[_0x2f49('0x5b')]['id'];}return db[_0x2f49('0x40')]['find']({'where':{'id':_0x11cbcd[_0x2f49('0x59')]['id']}})[_0x2f49('0x20')](handleEntityNotFound(_0x550915,null))[_0x2f49('0x20')](function(_0x5a325a){if(_0x5a325a){_0x11cbcd[_0x2f49('0x5b')][_0x2f49('0x65')]=_0x5a325a['id'];return db[_0x2f49('0x6b')][_0x2f49('0x5a')](_0x11cbcd['body']);}})['then'](respondWithResult(_0x550915,null))[_0x2f49('0x2a')](handleError(_0x550915,null));};exports[_0x2f49('0x6c')]=function(_0x1a5b73,_0x361d54,_0x5c6788){var _0x165974={'raw':![],'where':{}};var _0x2f91d4={};var _0x329917={'count':0x0,'rows':[]};return db[_0x2f49('0x40')][_0x2f49('0x6d')]({'where':{'id':_0x1a5b73[_0x2f49('0x59')]['id']}})[_0x2f49('0x20')](handleEntityNotFound(_0x361d54,null))[_0x2f49('0x20')](function(_0x30b1d4){if(_0x30b1d4){_0x2f91d4[_0x2f49('0x46')]=_[_0x2f49('0x42')](db[_0x2f49('0x6b')][_0x2f49('0x41')]);_0x2f91d4['query']=_[_0x2f49('0x42')](_0x1a5b73[_0x2f49('0x43')]);_0x2f91d4[_0x2f49('0x44')]=_[_0x2f49('0x45')](_0x2f91d4[_0x2f49('0x46')],_0x2f91d4[_0x2f49('0x43')]);_0x165974[_0x2f49('0x47')]=_['intersection'](_0x2f91d4['model'],qs['fields'](_0x1a5b73['query'][_0x2f49('0x48')]));_0x165974[_0x2f49('0x47')]=_0x165974[_0x2f49('0x47')][_0x2f49('0x49')]?_0x165974[_0x2f49('0x47')]:_0x2f91d4[_0x2f49('0x46')];if(!_0x1a5b73[_0x2f49('0x43')][_0x2f49('0x4a')]('nolimit')){_0x165974[_0x2f49('0x4c')]=qs[_0x2f49('0x4c')](_0x1a5b73[_0x2f49('0x43')][_0x2f49('0x4c')]);_0x165974[_0x2f49('0x2e')]=qs['offset'](_0x1a5b73[_0x2f49('0x43')][_0x2f49('0x2e')]);}_0x165974[_0x2f49('0x68')]=qs[_0x2f49('0x4d')](_0x1a5b73[_0x2f49('0x43')][_0x2f49('0x4d')]);_0x165974[_0x2f49('0x4e')]=qs[_0x2f49('0x44')](_[_0x2f49('0x4f')](_0x1a5b73[_0x2f49('0x43')],_0x2f91d4['filters']));_0x165974[_0x2f49('0x4e')][_0x2f49('0x65')]=_0x30b1d4['id'];if(_0x1a5b73[_0x2f49('0x43')][_0x2f49('0x50')]){_0x165974[_0x2f49('0x4e')]=_[_0x2f49('0x51')](_0x165974['where'],{'$or':_[_0x2f49('0x52')](_0x165974[_0x2f49('0x47')],function(_0x193fa7){var _0x59a8d4={};_0x59a8d4[_0x193fa7]={'$like':'%'+_0x1a5b73[_0x2f49('0x43')][_0x2f49('0x50')]+'%'};return _0x59a8d4;})});}_0x165974=_[_0x2f49('0x51')]({},_0x165974,_0x1a5b73[_0x2f49('0x55')]);return db[_0x2f49('0x6b')][_0x2f49('0x2d')]({'where':_0x165974[_0x2f49('0x4e')]})[_0x2f49('0x20')](function(_0x4bc231){_0x329917[_0x2f49('0x2d')]=_0x4bc231;if(_0x1a5b73[_0x2f49('0x43')][_0x2f49('0x56')]){_0x165974[_0x2f49('0x6e')]=[{'all':!![]}];}return db[_0x2f49('0x6b')][_0x2f49('0x6f')](_0x165974);})[_0x2f49('0x20')](function(_0x36abec){_0x329917[_0x2f49('0x57')]=_0x36abec;return _0x329917;});}})[_0x2f49('0x20')](respondWithFilteredResult(_0x361d54,_0x165974))[_0x2f49('0x2a')](handleError(_0x361d54,null));};exports[_0x2f49('0x70')]=function(_0x2503f4,_0x482b2f,_0x49636d){var _0x4da631;return db[_0x2f49('0x40')][_0x2f49('0x60')]({'where':{'id':_0x2503f4[_0x2f49('0x59')]['id']}})['then'](handleEntityNotFound(_0x482b2f,null))['then'](function(_0x274f35){if(_0x274f35){return _0x274f35[_0x2f49('0x70')](_0x2503f4[_0x2f49('0x43')][_0x2f49('0x71')]);}})[_0x2f49('0x20')](respondWithStatusCode(_0x482b2f,null))[_0x2f49('0x2a')](handleError(_0x482b2f,null));};exports[_0x2f49('0x72')]=function(_0x492a09,_0x304118,_0x50b448){var _0x484cb5={'channel':'sms'};var _0xadaf53=[];var _0x523f2d=[];var _0x4b80ab={};return db['SmsAccount'][_0x2f49('0x60')]({'where':{'id':_0x492a09[_0x2f49('0x59')]['id']},'include':[{'model':db[_0x2f49('0x73')],'as':_0x2f49('0x74')}]})[_0x2f49('0x20')](handleEntityNotFound(_0x304118,null))['then'](function(_0x40be6a){_0x484cb5[_0x2f49('0x75')]=_0x40be6a;_0x484cb5['applications']=_['orderBy'](_0x40be6a['Applications'],[_0x2f49('0x76')],[_0x2f49('0x77')]);if(_0x484cb5[_0x2f49('0x75')][_0x2f49('0x74')]){delete _0x484cb5[_0x2f49('0x75')][_0x2f49('0x74')];}return db[_0x2f49('0x78')][_0x2f49('0x63')]();})[_0x2f49('0x20')](function(_0x2a4b7c){if(!_0x2a4b7c){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0xadaf53=_[_0x2f49('0x79')](_[_0x2f49('0x42')](_0x2a4b7c),[_0x2f49('0x7a'),_0x2f49('0x7b')]);_0x523f2d=_['difference'](_[_0x2f49('0x42')](_0x2a4b7c),['createdAt','updatedAt',_0x2f49('0x7c'),_0x2f49('0x7d')]);_0x484cb5[_0x2f49('0x5b')]={'mapKey':_0x2f49('0x7e')};if(_0x484cb5['account']['type']){switch(_0x484cb5[_0x2f49('0x75')]['type']){case'twilio':_0x484cb5['body'][_0x2f49('0x7f')]=_0x492a09[_0x2f49('0x5b')][_0x2f49('0x80')];_0x484cb5['body']['body']=_0x492a09[_0x2f49('0x5b')]['Body'];_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x81')]=_0x492a09['body']['MessageSid'];break;case _0x2f49('0x82'):_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x7f')]='+'+_0x492a09['body']['sender'];_0x484cb5['body'][_0x2f49('0x5b')]=_0x492a09[_0x2f49('0x5b')]['text'];break;case'connectel':_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x7f')]=_0x492a09[_0x2f49('0x5b')]['from'];_0x484cb5['body'][_0x2f49('0x5b')]=_0x492a09[_0x2f49('0x5b')][_0x2f49('0x28')];break;case _0x2f49('0x83'):_0x484cb5['body']['from']=_0x492a09['body'][_0x2f49('0x7f')];_0x484cb5['body'][_0x2f49('0x5b')]=_0x492a09[_0x2f49('0x5b')][_0x2f49('0x5b')];_0x484cb5['body'][_0x2f49('0x81')]=_0x492a09[_0x2f49('0x5b')][_0x2f49('0x84')];break;case _0x2f49('0x85'):_0x484cb5['body'][_0x2f49('0x7f')]=_0x492a09[_0x2f49('0x5b')]['From'];_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x5b')]=_0x492a09[_0x2f49('0x5b')][_0x2f49('0x86')];_0x484cb5['body'][_0x2f49('0x81')]=_0x492a09[_0x2f49('0x5b')][_0x2f49('0x87')];break;case'infobip':_0x484cb5[_0x2f49('0x5b')]['from']='+'+_0x492a09[_0x2f49('0x5b')]['results'][0x0]['from'];_0x484cb5['body'][_0x2f49('0x5b')]=_0x492a09[_0x2f49('0x5b')][_0x2f49('0x88')][0x0]['text'];_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x81')]=_0x492a09['body'][_0x2f49('0x88')][0x0][_0x2f49('0x81')];break;case'csc':_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x7f')]=_0x492a09['body'][_0x2f49('0x89')];_0x484cb5['body'][_0x2f49('0x5b')]=_0x492a09[_0x2f49('0x5b')]['segmentedMessage'][_0x2f49('0x28')];break;case _0x2f49('0x8a'):_0x484cb5['body']['from']=_0x492a09[_0x2f49('0x5b')][_0x2f49('0x8b')];_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x5b')]=_0x492a09[_0x2f49('0x5b')]['text'];_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x81')]=_0x492a09[_0x2f49('0x5b')][_0x2f49('0x8c')];break;case _0x2f49('0x8d'):_0x484cb5['body']['from']=_0x492a09[_0x2f49('0x5b')][_0x2f49('0x7f')];_0x484cb5[_0x2f49('0x5b')]['body']=_0x492a09[_0x2f49('0x5b')]['message'];_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x81')]=_0x492a09[_0x2f49('0x5b')][_0x2f49('0x8e')];break;}}if(_0x484cb5[_0x2f49('0x5b')]['id']){delete _0x484cb5[_0x2f49('0x5b')]['id'];}if(_[_0x2f49('0x8f')](_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x7f')])){throw new db[(_0x2f49('0x90'))][(_0x2f49('0x91'))](_0x2f49('0x92'));}if(_['isNil'](_0x484cb5[_0x2f49('0x5b')]['body'])||_0x484cb5[_0x2f49('0x5b')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x2f49('0x93'));}if(_[_0x2f49('0x8f')](_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x94')])){throw new db[(_0x2f49('0x90'))][(_0x2f49('0x91'))](_0x2f49('0x95')+_0x523f2d);}if(!_[_0x2f49('0x96')](_0x523f2d,_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x94')])){throw new db[(_0x2f49('0x90'))][(_0x2f49('0x91'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x523f2d);}_0x4b80ab[_0x484cb5['body'][_0x2f49('0x94')]]=_0x484cb5['body']['from'];return db[_0x2f49('0x97')]['find']({'where':{'id':_0x484cb5['account'][_0x2f49('0x7d')]},'include':[{'model':db['CmContact'],'as':_0x2f49('0x98'),'where':_0x4b80ab,'limit':0x1,'order':[[_0x2f49('0x7b'),_0x2f49('0x99')]]}]});})['then'](handleEntityNotFound(_0x304118,null))[_0x2f49('0x20')](function(_0x534ddb){if(_0x534ddb){_0x484cb5[_0x2f49('0x9a')]=_[_0x2f49('0x9b')](_0x534ddb,[_0x2f49('0x98')]);if(_0x534ddb[_0x2f49('0x98')]['length']){return _0x534ddb[_0x2f49('0x98')][0x0];}var _0x3abe24=_[_0x2f49('0x18')](_0x484cb5['body'],{'firstName':_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x7f')],'ListId':_0x534ddb['id']});_0x3abe24[_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x94')]]=_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x7f')];return db[_0x2f49('0x78')][_0x2f49('0x5a')](_0x3abe24,{'fields':_0xadaf53,'raw':!![]});}})[_0x2f49('0x20')](handleEntityNotFound(_0x304118,null))[_0x2f49('0x20')](function(_0x58a0e3){if(_0x58a0e3){_0x484cb5[_0x2f49('0x9c')]=_0x58a0e3;var _0xb92125={'ContactId':_0x58a0e3['id'],'phone':_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x7f')],'SmsAccountId':_0x492a09[_0x2f49('0x59')]['id']};var _0x1e6bef={'ContactId':_0x58a0e3['id'],'SmsAccountId':_0x492a09['params']['id'],'closed':![]};return db[_0x2f49('0x9d')][_0x2f49('0x60')]({'where':_0x1e6bef})['then'](function(_0x506eaa){if(_0x506eaa){return[_0x506eaa,![]];}return db[_0x2f49('0x9d')][_0x2f49('0x5a')](_0xb92125)[_0x2f49('0x20')](function(_0x37067a){return[_0x37067a,!![]];});});}})[_0x2f49('0x9e')](function(_0x53d840,_0xb6c395){_0x484cb5[_0x2f49('0x9f')]=_0x53d840[_0x2f49('0x36')]({'plain':!![]});_0x484cb5['interaction'][_0x2f49('0xa0')]=![];if(_0xb6c395){if(_0x484cb5['account'][_0x2f49('0xa1')]){_0x484cb5[_0x2f49('0xa2')][_0x2f49('0xa3')]({'id':0x0,'priority':_0x484cb5['applications']['length']+0x1,'app':_0x2f49('0xa4'),'appdata':_0x2f49('0xa5'),'interval':'*,*,*,*'});}_0x484cb5['interaction'][_0x2f49('0xa0')]=!![];}return db[_0x2f49('0xa6')]['create']({'phone':_0x484cb5[_0x2f49('0x5b')]['from'],'messageId':_0x484cb5['body'][_0x2f49('0x81')],'body':_0x484cb5[_0x2f49('0x5b')][_0x2f49('0x5b')],'SmsAccountId':_0x492a09[_0x2f49('0x59')]['id'],'SmsInteractionId':_0x53d840['id'],'direction':'in','ContactId':_0x53d840[_0x2f49('0xa7')],'AttachmentId':_0x484cb5['body']['AttachmentId']});})[_0x2f49('0x20')](function(_0x4a7c4a){_0x484cb5[_0x2f49('0x28')]=_0x4a7c4a;if(_0x484cb5['interaction'][_0x2f49('0xa8')]){return db[_0x2f49('0xa9')][_0x2f49('0x60')]({'attributes':['id',_0x2f49('0x3b')],'where':{'id':_0x484cb5[_0x2f49('0x9f')][_0x2f49('0xa8')]}})[_0x2f49('0x20')](function(_0x4c1c3f){if(_0x4c1c3f){_0x484cb5[_0x2f49('0xa2')][_0x2f49('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4c1c3f['name']+','+(_0x484cb5[_0x2f49('0x75')][_0x2f49('0xab')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x2f49('0xac'),_0x484cb5);});}return respondWithRpcPromise(_0x2f49('0xad'),_0x2f49('0xac'),_0x484cb5);})[_0x2f49('0x20')](function(_0x4d8e96){if(_0x4d8e96){var _0x2db22c=0xc8;var _0x3c167d=_0x2f49('0xae');logger[_0x2f49('0x21')](_0x2f49('0x25'),_0x3c167d,_0x2db22c,_0x2f49('0xaf'));logger[_0x2f49('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3c167d,_0x2db22c,_0x2f49('0xaf'),JSON[_0x2f49('0x26')](_0x4d8e96));if(_0x484cb5['account']['type']===_0x2f49('0xb0')){return _0x304118[_0x2f49('0x2b')](_0x2db22c)['set']('Content-Type','text/xml')[_0x2f49('0x3c')]('\x0a');}else{return _0x304118[_0x2f49('0x2b')](_0x2db22c)[_0x2f49('0x2c')](_0x4d8e96);}}})['catch'](handleError(_0x304118,null));};exports['addApplications']=function(_0x52f7d8,_0x20515c,_0x351805){return db[_0x2f49('0x40')]['findOne']({'where':{'id':_0x52f7d8[_0x2f49('0x59')]['id']}})[_0x2f49('0x20')](handleEntityNotFound(_0x20515c,null))['then'](function(_0x263b1c){if(_0x263b1c){return db[_0x2f49('0xb1')][_0x2f49('0xb2')](function(_0x2087a0){return db[_0x2f49('0x73')][_0x2f49('0x35')]({'where':{'SmsAccountId':_0x52f7d8[_0x2f49('0x59')]['id']},'transaction':_0x2087a0})['then'](function(_0x5c151f){var _0x2190be=_[_0x2f49('0x52')](_0x52f7d8[_0x2f49('0x5b')],function(_0x202259){_0x202259[_0x2f49('0x65')]=_0x52f7d8[_0x2f49('0x59')]['id'];return _0x202259;});return db[_0x2f49('0x73')][_0x2f49('0xb3')](_0x2190be,{'transaction':_0x2087a0});});})[_0x2f49('0x20')](function(){return db[_0x2f49('0x73')][_0x2f49('0xb4')]({'where':{'SmsAccountId':_0x52f7d8[_0x2f49('0x59')]['id']},'order':_0x2f49('0x76')});});}})[_0x2f49('0x20')](respondWithResult(_0x20515c,null))['catch'](handleError(_0x20515c,null));};exports[_0x2f49('0xb5')]=function(_0x1c300b,_0x1ea1b9,_0x2bf26c){var _0x59bf37={};var _0x1ec640={};var _0x161d41;var _0x4aac14;return db['SmsAccount']['findOne']({'where':{'id':_0x1c300b[_0x2f49('0x59')]['id']}})[_0x2f49('0x20')](handleEntityNotFound(_0x1ea1b9,null))[_0x2f49('0x20')](function(_0x55102c){if(_0x55102c){_0x161d41=_0x55102c;_0x1ec640['model']=_[_0x2f49('0x42')](db[_0x2f49('0x73')]['rawAttributes']);_0x1ec640['query']=_['keys'](_0x1c300b[_0x2f49('0x43')]);_0x1ec640[_0x2f49('0x44')]=_[_0x2f49('0x45')](_0x1ec640['model'],_0x1ec640['query']);_0x59bf37[_0x2f49('0x47')]=_[_0x2f49('0x45')](_0x1ec640[_0x2f49('0x46')],qs[_0x2f49('0x48')](_0x1c300b[_0x2f49('0x43')]['fields']));_0x59bf37['attributes']=_0x59bf37[_0x2f49('0x47')][_0x2f49('0x49')]?_0x59bf37[_0x2f49('0x47')]:_0x1ec640[_0x2f49('0x46')];_0x59bf37['order']=qs[_0x2f49('0x4d')](_0x1c300b[_0x2f49('0x43')][_0x2f49('0x4d')]);_0x59bf37[_0x2f49('0x4e')]=qs[_0x2f49('0x44')](_[_0x2f49('0x4f')](_0x1c300b['query'],_0x1ec640['filters']));if(_0x1c300b['query'][_0x2f49('0x50')]){_0x59bf37[_0x2f49('0x4e')]=_[_0x2f49('0x51')](_0x59bf37['where'],{'$or':_[_0x2f49('0x52')](_0x59bf37[_0x2f49('0x47')],function(_0x4075c6){var _0x4f06c3={};_0x4f06c3[_0x4075c6]={'$like':'%'+_0x1c300b[_0x2f49('0x43')][_0x2f49('0x50')]+'%'};return _0x4f06c3;})});}_0x59bf37=_['merge']({},_0x59bf37,_0x1c300b[_0x2f49('0x55')]);return _0x161d41[_0x2f49('0xb5')](_0x59bf37);}})[_0x2f49('0x20')](function(_0x25a4bf){if(_0x25a4bf){_0x4aac14=_0x25a4bf['length'];if(!_0x1c300b[_0x2f49('0x43')][_0x2f49('0x4a')](_0x2f49('0x4b'))){_0x59bf37['limit']=qs[_0x2f49('0x4c')](_0x1c300b[_0x2f49('0x43')][_0x2f49('0x4c')]);_0x59bf37[_0x2f49('0x2e')]=qs[_0x2f49('0x2e')](_0x1c300b[_0x2f49('0x43')][_0x2f49('0x2e')]);}return _0x161d41['getApplications'](_0x59bf37);}})[_0x2f49('0x20')](function(_0x15e7c8){if(_0x15e7c8){return _0x15e7c8?{'count':_0x4aac14,'rows':_0x15e7c8}:null;}})[_0x2f49('0x20')](respondWithResult(_0x1ea1b9,null))[_0x2f49('0x2a')](handleError(_0x1ea1b9,null));};exports['getInteractions']=function(_0xf6adf7,_0x217667,_0x483e17){var _0x49e029={'raw':![],'where':{}};var _0x3db858={};var _0x5159d3={'count':0x0,'rows':[]};return db[_0x2f49('0x40')][_0x2f49('0x6d')]({'where':{'id':_0xf6adf7[_0x2f49('0x59')]['id']}})[_0x2f49('0x20')](handleEntityNotFound(_0x217667,null))[_0x2f49('0x20')](function(_0x28b67b){if(_0x28b67b){_0x3db858['model']=_[_0x2f49('0x42')](db[_0x2f49('0x9d')][_0x2f49('0x41')]);_0x3db858['query']=_[_0x2f49('0x42')](_0xf6adf7[_0x2f49('0x43')]);_0x3db858[_0x2f49('0x44')]=_[_0x2f49('0x45')](_0x3db858[_0x2f49('0x46')],_0x3db858[_0x2f49('0x43')]);_0x49e029[_0x2f49('0x47')]=_[_0x2f49('0x45')](_0x3db858[_0x2f49('0x46')],qs[_0x2f49('0x48')](_0xf6adf7[_0x2f49('0x43')][_0x2f49('0x48')]));_0x49e029['attributes']=_0x49e029[_0x2f49('0x47')][_0x2f49('0x49')]?_0x49e029[_0x2f49('0x47')]:_0x3db858[_0x2f49('0x46')];if(!_0xf6adf7[_0x2f49('0x43')]['hasOwnProperty'](_0x2f49('0x4b'))){_0x49e029['limit']=qs[_0x2f49('0x4c')](_0xf6adf7[_0x2f49('0x43')][_0x2f49('0x4c')]);_0x49e029['offset']=qs['offset'](_0xf6adf7['query'][_0x2f49('0x2e')]);}_0x49e029[_0x2f49('0x68')]=qs[_0x2f49('0x4d')](_0xf6adf7[_0x2f49('0x43')][_0x2f49('0x4d')]);_0x49e029[_0x2f49('0x4e')]=qs['filters'](_['pick'](_0xf6adf7[_0x2f49('0x43')],_0x3db858[_0x2f49('0x44')]));_0x49e029[_0x2f49('0x4e')][_0x2f49('0x65')]=_0x28b67b['id'];if(_0xf6adf7['query']['filter']){_0x49e029['where']=_[_0x2f49('0x51')](_0x49e029[_0x2f49('0x4e')],{'$or':_[_0x2f49('0x52')](_0x49e029[_0x2f49('0x47')],function(_0x8a31da){var _0x5b9601={};_0x5b9601[_0x8a31da]={'$like':'%'+_0xf6adf7[_0x2f49('0x43')][_0x2f49('0x50')]+'%'};return _0x5b9601;})});}_0x49e029=_[_0x2f49('0x51')]({},_0x49e029,_0xf6adf7[_0x2f49('0x55')]);return db[_0x2f49('0x9d')]['count']({'where':_0x49e029[_0x2f49('0x4e')]})[_0x2f49('0x20')](function(_0x444841){_0x5159d3[_0x2f49('0x2d')]=_0x444841;if(_0xf6adf7['query'][_0x2f49('0x56')]){_0x49e029[_0x2f49('0x6e')]=[{'model':db[_0x2f49('0x78')],'as':'Contact','required':![]},{'model':db[_0x2f49('0xa9')],'as':_0x2f49('0xb6'),'attributes':['name',_0x2f49('0xb7'),'internal'],'required':![]},{'model':db[_0x2f49('0xb8')],'as':_0x2f49('0xb9'),'attributes':['id',_0x2f49('0x3b'),_0x2f49('0xba')],'where':_0xf6adf7[_0x2f49('0x43')]['tag']?{'id':_0xf6adf7[_0x2f49('0x43')]['tag']}:undefined,'required':_0xf6adf7[_0x2f49('0x43')][_0x2f49('0xbb')]?!![]:![]}];}return db[_0x2f49('0x9d')][_0x2f49('0x6f')](_0x49e029);})[_0x2f49('0x20')](function(_0x451518){_0x5159d3[_0x2f49('0x57')]=_0x451518;return _0x5159d3;});}})['then'](respondWithFilteredResult(_0x217667,_0x49e029))[_0x2f49('0x2a')](handleError(_0x217667,null));};exports['send']=function(_0x57355e,_0x15c96e,_0x5d575a){var _0x490e23,_0x1a7495,_0x56b88b;if(_[_0x2f49('0x8f')](_0x57355e['body']['body'])||_0x57355e[_0x2f49('0x5b')][_0x2f49('0x5b')]===''){throw new db[(_0x2f49('0x90'))][(_0x2f49('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2f49('0x8f')](_0x57355e[_0x2f49('0x5b')]['to'])){throw new db[(_0x2f49('0x90'))]['ValidationError'](_0x2f49('0xbc'));}_0x490e23=_0x57355e[_0x2f49('0x5b')]['to'];return db[_0x2f49('0x40')]['find']({'where':{'id':_0x57355e[_0x2f49('0x59')]['id']},'include':[{'model':db[_0x2f49('0x97')],'as':'List','include':[{'model':db[_0x2f49('0x78')],'as':_0x2f49('0x98'),'where':{'mobile':_0x490e23},'limit':0x1,'order':[[_0x2f49('0x7b'),_0x2f49('0x99')]]}]}]})['then'](handleEntityNotFound(_0x15c96e,null))[_0x2f49('0x20')](function(_0x8db7e8){if(_0x8db7e8&&_0x8db7e8[_0x2f49('0xbd')]){_0x1a7495=_0x8db7e8[_0x2f49('0x36')]({'plain':!![]});if(_0x1a7495[_0x2f49('0xbd')]&&_0x1a7495['List'][_0x2f49('0x98')][_0x2f49('0x49')]){return _0x1a7495[_0x2f49('0xbd')][_0x2f49('0x98')][0x0];}return db[_0x2f49('0x78')]['create'](_[_0x2f49('0x18')](_0x57355e[_0x2f49('0x5b')],{'firstName':_0x490e23,'mobile':_0x490e23,'phone':_0x490e23,'ListId':_0x1a7495[_0x2f49('0x7d')]}));}})[_0x2f49('0x20')](handleEntityNotFound(_0x15c96e,null))[_0x2f49('0x20')](function(_0x5abaf4){if(_0x5abaf4){_0x56b88b=_0x5abaf4;return db['SmsInteraction']['find']({'where':{'ContactId':_0x56b88b['id'],'closed':![],'SmsAccountId':_0x1a7495['id']}})[_0x2f49('0x20')](function(_0x581c9a){if(_0x581c9a){return[_0x581c9a,![]];}return db['SmsInteraction']['create']({'UserId':_0x57355e[_0x2f49('0x5c')]['id'],'ContactId':_0x56b88b['id'],'SmsAccountId':_0x1a7495['id'],'phone':_0x490e23,'firstMsgDirection':_0x2f49('0xbe'),'Messages':[_[_0x2f49('0x51')](_0x57355e['body'],{'read':![],'body':_0x57355e[_0x2f49('0x5b')]['body'],'phone':_0x490e23,'SmsAccountId':_0x1a7495['id'],'UserId':_0x57355e[_0x2f49('0x5c')]['id'],'ContactId':_0x56b88b['id']})]},{'include':[{'model':db[_0x2f49('0xa6')],'as':_0x2f49('0xbf')}]})[_0x2f49('0x20')](function(_0x37476c){return[_0x37476c,!![]];});});}})[_0x2f49('0x9e')](function(_0x5739b9,_0x168e9a){if(_0x168e9a){return _0x5739b9;}return db[_0x2f49('0xa6')]['create'](_[_0x2f49('0x51')](_0x57355e[_0x2f49('0x5b')],{'read':![],'body':_0x57355e[_0x2f49('0x5b')][_0x2f49('0x5b')],'phone':_0x490e23,'SmsAccountId':_0x1a7495['id'],'SmsInteractionId':_0x5739b9['id'],'UserId':_0x57355e[_0x2f49('0x5c')]['id'],'ContactId':_0x56b88b['id']}))[_0x2f49('0x20')](function(_0x481b76){_0x5739b9[_0x2f49('0xc0')]['Messages']=[];_0x5739b9[_0x2f49('0xc0')][_0x2f49('0xbf')][_0x2f49('0xa3')](_0x481b76[_0x2f49('0xc0')]);return _0x5739b9;});})['then'](respondWithResult(_0x15c96e,null))[_0x2f49('0x2a')](handleError(_0x15c96e,null));};exports[_0x2f49('0x2b')]=function(_0x5ae521,_0x473509,_0x1ac156){if(_0x5ae521[_0x2f49('0x5b')]['id']){delete _0x5ae521[_0x2f49('0x5b')]['id'];}console[_0x2f49('0xc1')](_0x2f49('0xc2'),_0x5ae521['body']);var _0x1d0857,_0x55eb1b,_0x4d3cdd;return db['SmsAccount']['find']({'where':{'id':_0x5ae521[_0x2f49('0x59')]['id']}})[_0x2f49('0x20')](handleEntityNotFound(_0x473509,null))[_0x2f49('0x20')](function(_0x1a4b73){if(_0x1a4b73){_0x4d3cdd=_0x1a4b73;logger[_0x2f49('0x24')](_0x2f49('0x25'),_0x2f49('0x2b'),_0x2f49('0xc3'),_0x1a4b73['type'],util['inspect'](_0x5ae521['body'],{'showHidden':![],'depth':null}));switch(_0x1a4b73['type']){case _0x2f49('0x82'):if(_0x5ae521['body'][_0x2f49('0xc4')]&&_0x5ae521[_0x2f49('0x5b')]['status']){_0x55eb1b=_0x5ae521[_0x2f49('0x5b')][_0x2f49('0x2b')];return db[_0x2f49('0xa6')][_0x2f49('0x60')]({'where':{'messageId':_0x5ae521[_0x2f49('0x5b')][_0x2f49('0xc4')]}});}break;case'connectel':if(_0x5ae521[_0x2f49('0x5b')][_0x2f49('0xc5')]&&_0x5ae521[_0x2f49('0x5b')][_0x2f49('0xc6')]){_0x55eb1b=_0x5ae521[_0x2f49('0x5b')][_0x2f49('0xc6')];return db[_0x2f49('0xa6')][_0x2f49('0x60')]({'where':{'messageId':_0x5ae521[_0x2f49('0x5b')]['requestid']}});}break;case'clicksend':if(_0x5ae521[_0x2f49('0x5b')][_0x2f49('0x84')]&&_0x5ae521[_0x2f49('0x5b')]['status_code']){_0x55eb1b=_0x5ae521['body'][_0x2f49('0xc7')];return db[_0x2f49('0xa6')]['find']({'where':{'messageId':_0x5ae521[_0x2f49('0x5b')][_0x2f49('0x84')]}});}break;case _0x2f49('0xc8'):var _0x117d8a=_0x5ae521[_0x2f49('0x5b')][_0x2f49('0x88')][0x0];if(_0x117d8a['messageId']&&_0x117d8a[_0x2f49('0x2b')][_0x2f49('0xc9')]===_0x2f49('0xca')){_0x55eb1b=_0x117d8a['status'][_0x2f49('0xc9')];return db['SmsMessage']['find']({'where':{'messageId':_0x117d8a[_0x2f49('0x81')]}});}break;case _0x2f49('0x8a'):if(_0x5ae521[_0x2f49('0x5b')][_0x2f49('0x81')]&&_0x5ae521[_0x2f49('0x5b')]['status']){_0x55eb1b=_0x5ae521[_0x2f49('0x5b')][_0x2f49('0x2b')];return db[_0x2f49('0xa6')]['find']({'where':{'messageId':_0x5ae521[_0x2f49('0x5b')][_0x2f49('0x81')]}});}break;case _0x2f49('0x8d'):if(_0x5ae521[_0x2f49('0x5b')][_0x2f49('0xcb')]&&_0x5ae521[_0x2f49('0x5b')][_0x2f49('0x2b')]){_0x55eb1b=_0x5ae521[_0x2f49('0x5b')][_0x2f49('0x2b')];return db[_0x2f49('0xa6')][_0x2f49('0x60')]({'where':{'messageId':_0x5ae521['body'][_0x2f49('0xcb')]}});}break;}}})[_0x2f49('0x20')](handleEntityNotFound(_0x473509,null))[_0x2f49('0x20')](function(_0x4bf66f){if(_0x4bf66f){_0x1d0857=_0x4bf66f;switch(_0x4d3cdd[_0x2f49('0xcc')]){case _0x2f49('0x82'):if(_0x55eb1b===_0x2f49('0xca')){return _0x1d0857['update']({'read':!![]});}else{logger[_0x2f49('0x27')](_0x2f49('0x25'),_0x2f49('0x2b'),_0x2f49('0x82'),util[_0x2f49('0xcd')](_0x5ae521[_0x2f49('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x2f49('0xce'):if(_0x55eb1b==='1'){return _0x1d0857['update']({'read':!![]});}else{logger[_0x2f49('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2f49('0x2b'),_0x2f49('0x82'),util['inspect'](_0x5ae521[_0x2f49('0x5b')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x5ae521[_0x2f49('0x5b')]['error_code']&&_0x55eb1b>=0xc8&&_0x55eb1b<=0xce){return _0x1d0857[_0x2f49('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2f49('0x2b'),_0x2f49('0x83'),util[_0x2f49('0xcd')](_0x5ae521[_0x2f49('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x2f49('0xc8'):var _0x37a9eb=_0x5ae521[_0x2f49('0x5b')][_0x2f49('0x88')][0x0];if(_0x37a9eb[_0x2f49('0x2b')][_0x2f49('0xc9')]===_0x2f49('0xca')){return _0x1d0857[_0x2f49('0x34')]({'read':!![]});}else{logger[_0x2f49('0x27')](_0x2f49('0x25'),_0x2f49('0x2b'),'infobip',util[_0x2f49('0xcd')](_0x5ae521[_0x2f49('0x5b')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x55eb1b==_0x2f49('0xcf')||_0x55eb1b==_0x2f49('0xd0')){return _0x1d0857[_0x2f49('0x34')]({'read':!![]});}else{logger[_0x2f49('0x27')](_0x2f49('0x25'),_0x2f49('0x2b'),_0x2f49('0x8a'),util['inspect'](_0x5ae521[_0x2f49('0x5b')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x55eb1b===_0x2f49('0xd1')||_0x55eb1b===_0x2f49('0xd2')){return _0x1d0857[_0x2f49('0x34')]({'read':!![]});}else{logger[_0x2f49('0x27')](_0x2f49('0x25'),'status',_0x2f49('0x8d'),util[_0x2f49('0xcd')](_0x5ae521[_0x2f49('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x1d0857;}})[_0x2f49('0x20')](respondWithResult(_0x473509,null))[_0x2f49('0x2a')](handleError(_0x473509,null));};exports[_0x2f49('0xd3')]=function(_0x26f5d0,_0x2cb088,_0xee82e0){var _0x2c7488,_0x590dbb,_0x360413;return db['SmsAccount'][_0x2f49('0x60')]({'where':{'id':_0x26f5d0[_0x2f49('0x59')]['id']}})[_0x2f49('0x20')](handleEntityNotFound(_0x2cb088,null))[_0x2f49('0x20')](function(_0x5e9872){if(_0x5e9872){_0x360413=_0x5e9872;logger['debug'](_0x2f49('0x25'),'status',_0x2f49('0xc3'),_0x5e9872['type'],util['inspect'](_0x26f5d0['query'],{'showHidden':![],'depth':null}));switch(_0x5e9872[_0x2f49('0xcc')]){case'csc':if(_0x26f5d0['query'][_0x2f49('0xd4')]&&_0x26f5d0[_0x2f49('0x43')]['state']){_0x590dbb=_0x26f5d0[_0x2f49('0x43')][_0x2f49('0xd5')];return db[_0x2f49('0xa6')][_0x2f49('0x60')]({'where':{'messageId':_0x26f5d0['query'][_0x2f49('0xd4')]}});}break;}}})['then'](handleEntityNotFound(_0x2cb088,null))[_0x2f49('0x20')](function(_0x4b3911){if(_0x4b3911){_0x2c7488=_0x4b3911;switch(_0x360413['type']){case _0x2f49('0xd6'):if(_0x590dbb==='2'||_0x590dbb==='6'){return _0x2c7488[_0x2f49('0x34')]({'read':!![]});}else{logger[_0x2f49('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2f49('0x2b'),_0x2f49('0xd6'),util['inspect'](_0x26f5d0[_0x2f49('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x2c7488;}})[_0x2f49('0x20')](respondWithResult(_0x2cb088,null))[_0x2f49('0x2a')](handleError(_0x2cb088,null));};exports[_0x2f49('0xd7')]=function(_0x3b00a8,_0x3d6afe,_0x1a2172){return db[_0x2f49('0x40')][_0x2f49('0x60')]({'where':{'id':_0x3b00a8[_0x2f49('0x59')]['id']}})[_0x2f49('0x20')](handleEntityNotFound(_0x3d6afe,null))[_0x2f49('0x20')](function(_0x48af14){if(_0x48af14){return _0x48af14[_0x2f49('0xd7')](_0x3b00a8['body'][_0x2f49('0x71')],_['omit'](_0x3b00a8[_0x2f49('0x5b')],[_0x2f49('0x71'),'id'])||{})[_0x2f49('0x9e')](function(_0x52a028){for(var _0x475abd=0x0;_0x475abd<_0x3b00a8[_0x2f49('0x5b')]['ids'][_0x2f49('0x49')];_0x475abd+=0x1){socket[_0x2f49('0xd8')](_0x2f49('0xd9'),{'UserId':_0x3b00a8[_0x2f49('0x5b')][_0x2f49('0x71')][_0x475abd],'SmsAccountId':_0x3b00a8[_0x2f49('0x59')]['id']});}return _0x52a028;});}})['then'](respondWithResult(_0x3d6afe,null))[_0x2f49('0x2a')](handleError(_0x3d6afe,null));};exports[_0x2f49('0xda')]=function(_0x28c42e,_0x2cdbae,_0x48cca4){var _0x509e6e;return db['SmsAccount'][_0x2f49('0x60')]({'where':{'id':_0x28c42e['params']['id']}})[_0x2f49('0x20')](handleEntityNotFound(_0x2cdbae,null))['then'](function(_0x3f52f1){if(_0x3f52f1){return _0x3f52f1[_0x2f49('0xda')](_0x28c42e['query']['ids'])[_0x2f49('0x20')](function(_0x509d32){if(_[_0x2f49('0xdb')](_0x28c42e[_0x2f49('0x43')][_0x2f49('0x71')])){for(var _0x88ad29=0x0;_0x88ad29<_0x28c42e[_0x2f49('0x43')]['ids'][_0x2f49('0x49')];_0x88ad29+=0x1){socket[_0x2f49('0xd8')](_0x2f49('0xdc'),{'UserId':_0x28c42e[_0x2f49('0x43')][_0x2f49('0x71')][_0x88ad29],'SmsAccountId':_0x28c42e[_0x2f49('0x59')]['id']});}}else{socket[_0x2f49('0xd8')](_0x2f49('0xdc'),{'UserId':_0x28c42e[_0x2f49('0x43')][_0x2f49('0x71')],'SmsAccountId':_0x28c42e[_0x2f49('0x59')]['id']});}});}})[_0x2f49('0x20')](respondWithStatusCode(_0x2cdbae,null))[_0x2f49('0x2a')](handleError(_0x2cdbae,null));};exports['getAgents']=function(_0x4b0914,_0xbeee40,_0x458393){var _0x407b76={};var _0x4d61b2={};var _0x2832bb;var _0x1d0b90;return db[_0x2f49('0x40')][_0x2f49('0x6d')]({'where':{'id':_0x4b0914[_0x2f49('0x59')]['id']}})['then'](handleEntityNotFound(_0xbeee40,null))[_0x2f49('0x20')](function(_0x72fa14){if(_0x72fa14){_0x2832bb=_0x72fa14;_0x4d61b2[_0x2f49('0x46')]=_[_0x2f49('0x42')](db['User'][_0x2f49('0x41')]);_0x4d61b2[_0x2f49('0x43')]=_[_0x2f49('0x42')](_0x4b0914[_0x2f49('0x43')]);_0x4d61b2[_0x2f49('0x44')]=_[_0x2f49('0x45')](_0x4d61b2[_0x2f49('0x46')],_0x4d61b2[_0x2f49('0x43')]);_0x407b76['attributes']=_[_0x2f49('0x45')](_0x4d61b2[_0x2f49('0x46')],qs['fields'](_0x4b0914[_0x2f49('0x43')][_0x2f49('0x48')]));_0x407b76[_0x2f49('0x47')]=_0x407b76['attributes'][_0x2f49('0x49')]?_0x407b76[_0x2f49('0x47')]:_0x4d61b2[_0x2f49('0x46')];_0x407b76[_0x2f49('0x68')]=qs[_0x2f49('0x4d')](_0x4b0914[_0x2f49('0x43')]['sort']);_0x407b76[_0x2f49('0x4e')]=qs[_0x2f49('0x44')](_[_0x2f49('0x4f')](_0x4b0914[_0x2f49('0x43')],_0x4d61b2[_0x2f49('0x44')]));if(_0x4b0914['query'][_0x2f49('0x50')]){_0x407b76['where']=_[_0x2f49('0x51')](_0x407b76[_0x2f49('0x4e')],{'$or':_['map'](_0x407b76[_0x2f49('0x47')],function(_0x1a3bd6){var _0x443025={};_0x443025[_0x1a3bd6]={'$like':'%'+_0x4b0914[_0x2f49('0x43')][_0x2f49('0x50')]+'%'};return _0x443025;})});}_0x407b76=_[_0x2f49('0x51')]({},_0x407b76,_0x4b0914[_0x2f49('0x55')]);return _0x2832bb[_0x2f49('0xdd')](_0x407b76);}})[_0x2f49('0x20')](function(_0x58f964){if(_0x58f964){_0x1d0b90=_0x58f964[_0x2f49('0x49')];if(!_0x4b0914[_0x2f49('0x43')][_0x2f49('0x4a')](_0x2f49('0x4b'))){_0x407b76[_0x2f49('0x4c')]=qs[_0x2f49('0x4c')](_0x4b0914[_0x2f49('0x43')]['limit']);_0x407b76[_0x2f49('0x2e')]=qs['offset'](_0x4b0914[_0x2f49('0x43')][_0x2f49('0x2e')]);}return _0x2832bb[_0x2f49('0xdd')](_0x407b76);}})[_0x2f49('0x20')](function(_0x384fdc){if(_0x384fdc){return _0x384fdc?{'count':_0x1d0b90,'rows':_0x384fdc}:null;}})[_0x2f49('0x20')](respondWithResult(_0xbeee40,null))['catch'](handleError(_0xbeee40,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 462050f..b45bf02 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 _0x1bf2=['exports','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x1bf2,0x160));var _0x21bf=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x1bf2[_0x580576];return _0x3f55a0;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x21bf('0x0'))['db'][_0x21bf('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x21bf('0x2')](0x0);var events={'afterCreate':_0x21bf('0x3'),'afterUpdate':_0x21bf('0x4'),'afterDestroy':_0x21bf('0x5')};function emitEvent(_0x1b56a2){return function(_0x3981a0,_0x2ee896,_0x5e3f61){SmsAccountEvents[_0x21bf('0x6')](_0x1b56a2+':'+_0x3981a0['id'],_0x3981a0);SmsAccountEvents[_0x21bf('0x6')](_0x1b56a2,_0x3981a0);_0x5e3f61(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x21bf('0x7')](e,emitEvent(event));}}module[_0x21bf('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0xac45=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xac45,0xed));var _0x5ac4=function(_0x43d789,_0x71f749){_0x43d789=_0x43d789-0x0;var _0x4a8db0=_0xac45[_0x43d789];return _0x4a8db0;};'use strict';var EventEmitter=require(_0x5ac4('0x0'));var SmsAccount=require(_0x5ac4('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x5ac4('0x2')](0x0);var events={'afterCreate':_0x5ac4('0x3'),'afterUpdate':_0x5ac4('0x4'),'afterDestroy':_0x5ac4('0x5')};function emitEvent(_0x272a77){return function(_0x55faa6,_0x491b90,_0x2ece87){SmsAccountEvents['emit'](_0x272a77+':'+_0x55faa6['id'],_0x55faa6);SmsAccountEvents[_0x5ac4('0x6')](_0x272a77,_0x55faa6);_0x2ece87(null);};}for(var e in events){if(events[_0x5ac4('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 15927dc..511f6af 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 _0xede3=['SmsAccount','sms_accounts','util','api','moment','bluebird','request-promise','./smsAccount.attributes','exports','define'];(function(_0x55a648,_0x186e88){var _0x180330=function(_0x377108){while(--_0x377108){_0x55a648['push'](_0x55a648['shift']());}};_0x180330(++_0x186e88);}(_0xede3,0xc0));var _0x3ede=function(_0x303df3,_0xff8bbc){_0x303df3=_0x303df3-0x0;var _0x564f25=_0xede3[_0x303df3];return _0x564f25;};'use strict';var _=require('lodash');var util=require(_0x3ede('0x0'));var logger=require('../../config/logger')(_0x3ede('0x1'));var moment=require(_0x3ede('0x2'));var BPromise=require(_0x3ede('0x3'));var rp=require(_0x3ede('0x4'));var attributes=require(_0x3ede('0x5'));module[_0x3ede('0x6')]=function(_0x10dbc8,_0x450f99){return _0x10dbc8[_0x3ede('0x7')](_0x3ede('0x8'),attributes,{'tableName':_0x3ede('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x112f=['moment','bluebird','request-promise','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','../../config/logger'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x112f,0x11e));var _0xf112=function(_0x69936b,_0x98c9f2){_0x69936b=_0x69936b-0x0;var _0x5c91c9=_0x112f[_0x69936b];return _0x5c91c9;};'use strict';var _=require(_0xf112('0x0'));var util=require('util');var logger=require(_0xf112('0x1'))('api');var moment=require(_0xf112('0x2'));var BPromise=require(_0xf112('0x3'));var rp=require(_0xf112('0x4'));var attributes=require(_0xf112('0x5'));module['exports']=function(_0x44a5f1,_0x4e7d6b){return _0x44a5f1[_0xf112('0x6')](_0xf112('0x7'),attributes,{'tableName':_0xf112('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 6ce8e06..cdb3269 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 _0x827c=['code','message','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','model','map','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./smsAccount.socket','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4d217c,_0x429076){var _0x1eff8f=function(_0x58fea9){while(--_0x58fea9){_0x4d217c['push'](_0x4d217c['shift']());}};_0x1eff8f(++_0x429076);}(_0x827c,0x152));var _0xc827=function(_0x473b78,_0xf81681){_0x473b78=_0x473b78-0x0;var _0x45b7ce=_0x827c[_0x473b78];return _0x45b7ce;};'use strict';var _=require(_0xc827('0x0'));var util=require('util');var moment=require(_0xc827('0x1'));var BPromise=require(_0xc827('0x2'));var rs=require(_0xc827('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc827('0x4'))['db'];var utils=require(_0xc827('0x5'));var logger=require(_0xc827('0x6'))(_0xc827('0x7'));var config=require(_0xc827('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc827('0x9')]({'port':0x232a});config[_0xc827('0xa')]=_['defaults'](config[_0xc827('0xa')],{'host':_0xc827('0xb'),'port':0x18eb});var socket=require(_0xc827('0xc'))(new Redis(config[_0xc827('0xa')]));require(_0xc827('0xd'))['register'](socket);function respondWithRpcPromise(_0x100494,_0x319bbe,_0x8376e8){return new BPromise(function(_0x35f860,_0x1cd925){return client[_0xc827('0xe')](_0x100494,_0x8376e8)['then'](function(_0x863ade){logger[_0xc827('0xf')](_0xc827('0x10'),_0x319bbe,_0xc827('0x11'));logger[_0xc827('0x12')](_0xc827('0x13'),_0x319bbe,_0xc827('0x11'),JSON[_0xc827('0x14')](_0x863ade));if(_0x863ade['error']){if(_0x863ade[_0xc827('0x15')][_0xc827('0x16')]===0x1f4){logger[_0xc827('0x15')]('SmsAccount,\x20%s,\x20%s',_0x319bbe,_0x863ade['error'][_0xc827('0x17')]);return _0x1cd925(_0x863ade[_0xc827('0x15')]['message']);}logger[_0xc827('0x15')](_0xc827('0x10'),_0x319bbe,_0x863ade[_0xc827('0x15')]['message']);return _0x35f860(_0x863ade[_0xc827('0x15')][_0xc827('0x17')]);}else{logger['info'](_0xc827('0x10'),_0x319bbe,_0xc827('0x11'));_0x35f860(_0x863ade['result'][_0xc827('0x17')]);}})[_0xc827('0x18')](function(_0x5ea8cf){logger['error'](_0xc827('0x10'),_0x319bbe,_0x5ea8cf);_0x1cd925(_0x5ea8cf);});});}exports[_0xc827('0x19')]=function(_0x2b4d41){var _0x3fa21a=this;return new Promise(function(_0x2a51e7,_0x29711b){return db[_0xc827('0x1a')][_0xc827('0x1b')]({'raw':_0x2b4d41['options']?_0x2b4d41[_0xc827('0x1c')][_0xc827('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b4d41[_0xc827('0x1c')]?_0x2b4d41['options'][_0xc827('0x1e')]||null:null,'attributes':_0x2b4d41[_0xc827('0x1c')]?_0x2b4d41[_0xc827('0x1c')][_0xc827('0x1f')]||null:null,'include':_0x2b4d41['options']?_0x2b4d41[_0xc827('0x1c')][_0xc827('0x20')]?_['map'](_0x2b4d41[_0xc827('0x1c')][_0xc827('0x20')],function(_0x4c0fdc){return{'model':db[_0x4c0fdc[_0xc827('0x21')]],'as':_0x4c0fdc['as'],'attributes':_0x4c0fdc[_0xc827('0x1f')],'include':_0x4c0fdc['include']?_[_0xc827('0x22')](_0x4c0fdc[_0xc827('0x20')],function(_0x297bb5){return{'model':db[_0x297bb5[_0xc827('0x21')]],'as':_0x297bb5['as'],'attributes':_0x297bb5[_0xc827('0x1f')],'include':_0x297bb5[_0xc827('0x20')]?_[_0xc827('0x22')](_0x297bb5['include'],function(_0x5ac34f){return{'model':db[_0x5ac34f[_0xc827('0x21')]],'as':_0x5ac34f['as'],'attributes':_0x5ac34f[_0xc827('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc827('0x23')](function(_0x5cdcc4){logger['info'](_0xc827('0x19'),_0x2b4d41);logger[_0xc827('0x12')](_0xc827('0x19'),_0x2b4d41,JSON['stringify'](_0x5cdcc4));_0x2a51e7(_0x5cdcc4);})[_0xc827('0x18')](function(_0x22b79c){logger[_0xc827('0x15')](_0xc827('0x19'),_0x22b79c[_0xc827('0x17')],_0x2b4d41);_0x29711b(_0x3fa21a[_0xc827('0x15')](0x1f4,_0x22b79c[_0xc827('0x17')]));});});}; \ No newline at end of file +var _0xd736=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis'];(function(_0x3eead7,_0x268750){var _0x32324f=function(_0x515a99){while(--_0x515a99){_0x3eead7['push'](_0x3eead7['shift']());}};_0x32324f(++_0x268750);}(_0xd736,0x187));var _0x6d73=function(_0x2ac65e,_0x2cf015){_0x2ac65e=_0x2ac65e-0x0;var _0x2967e0=_0xd736[_0x2ac65e];return _0x2967e0;};'use strict';var _=require('lodash');var util=require(_0x6d73('0x0'));var moment=require(_0x6d73('0x1'));var BPromise=require(_0x6d73('0x2'));var rs=require(_0x6d73('0x3'));var fs=require('fs');var Redis=require(_0x6d73('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d73('0x5'));var logger=require(_0x6d73('0x6'))('rpc');var config=require(_0x6d73('0x7'));var jayson=require(_0x6d73('0x8'));var client=jayson[_0x6d73('0x9')][_0x6d73('0xa')]({'port':0x232a});config[_0x6d73('0xb')]=_[_0x6d73('0xc')](config[_0x6d73('0xb')],{'host':_0x6d73('0xd'),'port':0x18eb});var socket=require(_0x6d73('0xe'))(new Redis(config[_0x6d73('0xb')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3a3f52,_0x491911,_0x29567b){return new BPromise(function(_0x1820f6,_0x3fc878){return client[_0x6d73('0xf')](_0x3a3f52,_0x29567b)[_0x6d73('0x10')](function(_0x3738e5){logger[_0x6d73('0x11')]('SmsAccount,\x20%s,\x20%s',_0x491911,_0x6d73('0x12'));logger[_0x6d73('0x13')](_0x6d73('0x14'),_0x491911,_0x6d73('0x12'),JSON[_0x6d73('0x15')](_0x3738e5));if(_0x3738e5[_0x6d73('0x16')]){if(_0x3738e5[_0x6d73('0x16')][_0x6d73('0x17')]===0x1f4){logger[_0x6d73('0x16')](_0x6d73('0x18'),_0x491911,_0x3738e5[_0x6d73('0x16')][_0x6d73('0x19')]);return _0x3fc878(_0x3738e5['error'][_0x6d73('0x19')]);}logger[_0x6d73('0x16')](_0x6d73('0x18'),_0x491911,_0x3738e5[_0x6d73('0x16')][_0x6d73('0x19')]);return _0x1820f6(_0x3738e5[_0x6d73('0x16')][_0x6d73('0x19')]);}else{logger[_0x6d73('0x11')](_0x6d73('0x18'),_0x491911,_0x6d73('0x12'));_0x1820f6(_0x3738e5['result'][_0x6d73('0x19')]);}})[_0x6d73('0x1a')](function(_0x7fe35){logger[_0x6d73('0x16')](_0x6d73('0x18'),_0x491911,_0x7fe35);_0x3fc878(_0x7fe35);});});}exports[_0x6d73('0x1b')]=function(_0x1dfad7){var _0x195b87=this;return new Promise(function(_0x423b7d,_0x500f17){return db[_0x6d73('0x1c')][_0x6d73('0x1d')]({'raw':_0x1dfad7['options']?_0x1dfad7[_0x6d73('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1dfad7['options']?_0x1dfad7['options'][_0x6d73('0x1f')]||null:null,'attributes':_0x1dfad7[_0x6d73('0x1e')]?_0x1dfad7[_0x6d73('0x1e')][_0x6d73('0x20')]||null:null,'include':_0x1dfad7[_0x6d73('0x1e')]?_0x1dfad7[_0x6d73('0x1e')][_0x6d73('0x21')]?_[_0x6d73('0x22')](_0x1dfad7['options'][_0x6d73('0x21')],function(_0x3d065b){return{'model':db[_0x3d065b[_0x6d73('0x23')]],'as':_0x3d065b['as'],'attributes':_0x3d065b[_0x6d73('0x20')],'include':_0x3d065b[_0x6d73('0x21')]?_['map'](_0x3d065b['include'],function(_0x4f93e5){return{'model':db[_0x4f93e5[_0x6d73('0x23')]],'as':_0x4f93e5['as'],'attributes':_0x4f93e5[_0x6d73('0x20')],'include':_0x4f93e5[_0x6d73('0x21')]?_[_0x6d73('0x22')](_0x4f93e5[_0x6d73('0x21')],function(_0x543596){return{'model':db[_0x543596[_0x6d73('0x23')]],'as':_0x543596['as'],'attributes':_0x543596[_0x6d73('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x224faf){logger[_0x6d73('0x11')](_0x6d73('0x1b'),_0x1dfad7);logger['debug'](_0x6d73('0x1b'),_0x1dfad7,JSON[_0x6d73('0x15')](_0x224faf));_0x423b7d(_0x224faf);})['catch'](function(_0x2e3275){logger[_0x6d73('0x16')](_0x6d73('0x1b'),_0x2e3275[_0x6d73('0x19')],_0x1dfad7);_0x500f17(_0x195b87[_0x6d73('0x16')](0x1f4,_0x2e3275['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 64ae579..7942551 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 _0x3c19=['removeListener','register','length','smsAccount:','save','update','emit'];(function(_0x32c6de,_0x291336){var _0x2cb723=function(_0x119499){while(--_0x119499){_0x32c6de['push'](_0x32c6de['shift']());}};_0x2cb723(++_0x291336);}(_0x3c19,0x169));var _0x93c1=function(_0x38c21f,_0x5d27a5){_0x38c21f=_0x38c21f-0x0;var _0x2e1b03=_0x3c19[_0x38c21f];return _0x2e1b03;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x93c1('0x0'),'remove',_0x93c1('0x1')];function createListener(_0x4b2105,_0x2a458d){return function(_0x26af89){_0x2a458d[_0x93c1('0x2')](_0x4b2105,_0x26af89);};}function removeListener(_0x3c2156,_0x228ada){return function(){SmsAccountEvents[_0x93c1('0x3')](_0x3c2156,_0x228ada);};}exports[_0x93c1('0x4')]=function(_0x21ecf9){for(var _0x3e3bfe=0x0,_0x1735b6=events[_0x93c1('0x5')];_0x3e3bfe<_0x1735b6;_0x3e3bfe++){var _0x33fda9=events[_0x3e3bfe];var _0x396e78=createListener(_0x93c1('0x6')+_0x33fda9,_0x21ecf9);SmsAccountEvents['on'](_0x33fda9,_0x396e78);}}; \ No newline at end of file +var _0x0050=['./smsAccount.events','save','remove','update','removeListener'];(function(_0x4dd0bf,_0xe17460){var _0x270956=function(_0x50f5d4){while(--_0x50f5d4){_0x4dd0bf['push'](_0x4dd0bf['shift']());}};_0x270956(++_0xe17460);}(_0x0050,0x186));var _0x0005=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x0050[_0x160c73];return _0xd9302;};'use strict';var SmsAccountEvents=require(_0x0005('0x0'));var events=[_0x0005('0x1'),_0x0005('0x2'),_0x0005('0x3')];function createListener(_0x5028e2,_0x53885d){return function(_0x4af7c3){_0x53885d['emit'](_0x5028e2,_0x4af7c3);};}function removeListener(_0x218355,_0x310e50){return function(){SmsAccountEvents[_0x0005('0x4')](_0x218355,_0x310e50);};}exports['register']=function(_0x54af4b){for(var _0x260d78=0x0,_0x580126=events['length'];_0x260d78<_0x580126;_0x260d78++){var _0x3ea2e8=events[_0x260d78];var _0x5ba7b5=createListener('smsAccount:'+_0x3ea2e8,_0x54af4b);SmsAccountEvents['on'](_0x3ea2e8,_0x5ba7b5);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 3d377df..fffd6ce 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 _0x5488=['../../components/interaction/service','../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','put','update','path','connect-timeout','express'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x5488,0x7b));var _0x8548=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x5488[_0x479160];return _0x47ac6d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8548('0x0'));var timeout=require(_0x8548('0x1'));var express=require(_0x8548('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8548('0x3'));var config=require(_0x8548('0x4'));var controller=require(_0x8548('0x5'));router[_0x8548('0x6')]('/',auth['isAuthenticated'](),controller[_0x8548('0x7')]);router[_0x8548('0x6')](_0x8548('0x8'),auth[_0x8548('0x9')](),controller[_0x8548('0xa')]);router[_0x8548('0xb')]('/',auth[_0x8548('0x9')](),controller['create']);router[_0x8548('0xc')](_0x8548('0x8'),auth[_0x8548('0x9')](),controller[_0x8548('0xd')]);router['delete'](_0x8548('0x8'),auth[_0x8548('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8fc9=['delete','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put'];(function(_0xda74a3,_0xdbc296){var _0x37243a=function(_0x1b3374){while(--_0x1b3374){_0xda74a3['push'](_0xda74a3['shift']());}};_0x37243a(++_0xdbc296);}(_0x8fc9,0x10b));var _0x98fc=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0x8fc9[_0x5cc8];return _0x450661;};'use strict';var multer=require('multer');var util=require(_0x98fc('0x0'));var path=require('path');var timeout=require(_0x98fc('0x1'));var express=require(_0x98fc('0x2'));var router=express['Router']();var auth=require(_0x98fc('0x3'));var interaction=require(_0x98fc('0x4'));var config=require(_0x98fc('0x5'));var controller=require('./smsApplication.controller');router[_0x98fc('0x6')]('/',auth[_0x98fc('0x7')](),controller[_0x98fc('0x8')]);router[_0x98fc('0x6')](_0x98fc('0x9'),auth[_0x98fc('0x7')](),controller['show']);router[_0x98fc('0xa')]('/',auth[_0x98fc('0x7')](),controller[_0x98fc('0xb')]);router[_0x98fc('0xc')](_0x98fc('0x9'),auth[_0x98fc('0x7')](),controller['update']);router[_0x98fc('0xd')](_0x98fc('0x9'),auth[_0x98fc('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 7e8dcfa..ec62364 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 _0xc50f=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x3f3bb1,_0x467efb){var _0x2c35f3=function(_0x169599){while(--_0x169599){_0x3f3bb1['push'](_0x3f3bb1['shift']());}};_0x2c35f3(++_0x467efb);}(_0xc50f,0x153));var _0xfc50=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc50f[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0xfc50('0x0'));module[_0xfc50('0x1')]={'priority':{'type':Sequelize[_0xfc50('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfc50('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfc50('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xfc50('0x5')}}; \ No newline at end of file +var _0x9261=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0xf82fe5,_0x2791de){var _0x2359fb=function(_0xcd7f0c){while(--_0xcd7f0c){_0xf82fe5['push'](_0xf82fe5['shift']());}};_0x2359fb(++_0x2791de);}(_0x9261,0x1de));var _0x1926=function(_0x34473f,_0x2b9c5c){_0x34473f=_0x34473f-0x0;var _0x25cf6f=_0x9261[_0x34473f];return _0x25cf6f;};'use strict';var Sequelize=require(_0x1926('0x0'));module[_0x1926('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1926('0x2')],'allowNull':![],'defaultValue':_0x1926('0x3')},'appdata':{'type':Sequelize[_0x1926('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1926('0x2')],'defaultValue':_0x1926('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 9f83185..b6d361d 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 _0x2982=['params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','SmsApplication','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','then','include','findAll','rows','catch','includeAll','find','create','body'];(function(_0x37cd56,_0x49d747){var _0x497e08=function(_0x2deb2d){while(--_0x2deb2d){_0x37cd56['push'](_0x37cd56['shift']());}};_0x497e08(++_0x49d747);}(_0x2982,0x8d));var _0x2298=function(_0x313e7f,_0x39d1d6){_0x313e7f=_0x313e7f-0x0;var _0x577d8c=_0x2982[_0x313e7f];return _0x577d8c;};'use strict';var pdf=require(_0x2298('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2298('0x1'));var zipdir=require(_0x2298('0x2'));var jsonpatch=require(_0x2298('0x3'));var rp=require(_0x2298('0x4'));var moment=require(_0x2298('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2298('0x6'));var util=require(_0x2298('0x7'));var path=require('path');var sox=require(_0x2298('0x8'));var csv=require(_0x2298('0x9'));var ejs=require(_0x2298('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2298('0xb'));var crypto=require(_0x2298('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2298('0xd'));var Papa=require('papaparse');var authService=require(_0x2298('0xe'));var hardwareService=require(_0x2298('0xf'));var Redis=require(_0x2298('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x2298('0x11'))(_0x2298('0x12'));var utils=require(_0x2298('0x13'));var config=require(_0x2298('0x14'));var db=require(_0x2298('0x15'))['db'];function respondWithStatusCode(_0x5c6669,_0x11f77a){_0x11f77a=_0x11f77a||0xcc;return function(_0x444fe9){if(_0x444fe9){return _0x5c6669[_0x2298('0x16')](_0x11f77a);}return _0x5c6669[_0x2298('0x17')](_0x11f77a)[_0x2298('0x18')]();};}function respondWithResult(_0x274223,_0x485793){_0x485793=_0x485793||0xc8;return function(_0x2d5e0d){if(_0x2d5e0d){return _0x274223['status'](_0x485793)[_0x2298('0x19')](_0x2d5e0d);}};}function respondWithFilteredResult(_0x1b2a45,_0x366215){return function(_0x569ee5){if(_0x569ee5){var _0x8208a4=_0x569ee5[_0x2298('0x1a')],_0x37e120=_0x366215[_0x2298('0x1b')],_0x46d9dc=_0x366215[_0x2298('0x1b')]+_0x366215[_0x2298('0x1c')],_0x380984;if(_0x46d9dc>=_0x8208a4){_0x46d9dc=_0x8208a4;_0x380984=0xc8;}else{_0x380984=0xce;}_0x1b2a45[_0x2298('0x17')](_0x380984);return _0x1b2a45[_0x2298('0x1d')](_0x2298('0x1e'),_0x37e120+'-'+_0x46d9dc+'/'+_0x8208a4)[_0x2298('0x19')](_0x569ee5);}return null;};}function patchUpdates(_0x10ce8d){return function(_0x453862){try{jsonpatch[_0x2298('0x1f')](_0x453862,_0x10ce8d,!![]);}catch(_0x4c6484){return BPromise['reject'](_0x4c6484);}return _0x453862['save']();};}function saveUpdates(_0x2a2acf,_0x3f9be9){return function(_0x599e9f){if(_0x599e9f){return _0x599e9f[_0x2298('0x20')](_0x2a2acf)['then'](function(_0x4e49ba){return _0x4e49ba;});}return null;};}function removeEntity(_0x12fe8a,_0x407e92){return function(_0x5cb8e9){if(_0x5cb8e9){return _0x5cb8e9[_0x2298('0x21')]()['then'](function(){_0x12fe8a[_0x2298('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14ffd2,_0x3368d6){return function(_0x1acb8c){if(!_0x1acb8c){_0x14ffd2[_0x2298('0x16')](0x194);}return _0x1acb8c;};}function handleError(_0x4cc5d5,_0x2b55f9){_0x2b55f9=_0x2b55f9||0x1f4;return function(_0x43715e){logger[_0x2298('0x22')](_0x43715e[_0x2298('0x23')]);if(_0x43715e[_0x2298('0x24')]){delete _0x43715e[_0x2298('0x24')];}_0x4cc5d5[_0x2298('0x17')](_0x2b55f9)['send'](_0x43715e);};}exports[_0x2298('0x25')]=function(_0x331137,_0x5a0b07){var _0x167702={},_0x27c9a5={},_0x31bcb4={'count':0x0,'rows':[]};var _0x2f7369=db[_0x2298('0x26')][_0x2298('0x27')];_0x27c9a5[_0x2298('0x28')]=_[_0x2298('0x29')](_0x2f7369);_0x27c9a5[_0x2298('0x2a')]=_[_0x2298('0x29')](_0x331137[_0x2298('0x2a')]);_0x27c9a5[_0x2298('0x2b')]=_['intersection'](_0x27c9a5['model'],_0x27c9a5['query']);_0x167702[_0x2298('0x2c')]=_[_0x2298('0x2d')](_0x27c9a5['model'],qs[_0x2298('0x2e')](_0x331137[_0x2298('0x2a')][_0x2298('0x2e')]));_0x167702['attributes']=_0x167702[_0x2298('0x2c')][_0x2298('0x2f')]?_0x167702[_0x2298('0x2c')]:_0x27c9a5[_0x2298('0x28')];if(!_0x331137[_0x2298('0x2a')][_0x2298('0x30')](_0x2298('0x31'))){_0x167702['limit']=qs['limit'](_0x331137[_0x2298('0x2a')][_0x2298('0x1c')]);_0x167702[_0x2298('0x1b')]=qs['offset'](_0x331137[_0x2298('0x2a')][_0x2298('0x1b')]);}_0x167702[_0x2298('0x32')]=qs['sort'](_0x331137[_0x2298('0x2a')][_0x2298('0x33')]);_0x167702[_0x2298('0x34')]=qs[_0x2298('0x2b')](_[_0x2298('0x35')](_0x331137[_0x2298('0x2a')],_0x27c9a5['filters']));if(_0x331137[_0x2298('0x2a')][_0x2298('0x36')]){_0x167702[_0x2298('0x34')]=_[_0x2298('0x37')](_0x167702['where'],{'$or':_[_0x2298('0x38')](_0x2f7369,function(_0x46abd2){if(_0x46abd2[_0x2298('0x39')]['key']!==_0x2298('0x3a')){var _0x445d0c={};_0x445d0c[_0x46abd2[_0x2298('0x3b')]]={'$like':'%'+_0x331137[_0x2298('0x2a')]['filter']+'%'};return _0x445d0c;}})});}_0x167702=_[_0x2298('0x37')]({},_0x167702,_0x331137['options']);var _0x4582ab={'where':_0x167702[_0x2298('0x34')]};return db[_0x2298('0x26')]['count'](_0x4582ab)[_0x2298('0x3c')](function(_0x4962a7){_0x31bcb4[_0x2298('0x1a')]=_0x4962a7;if(_0x331137[_0x2298('0x2a')]['includeAll']){_0x167702[_0x2298('0x3d')]=[{'all':!![]}];}return db[_0x2298('0x26')][_0x2298('0x3e')](_0x167702);})[_0x2298('0x3c')](function(_0x3f1b1c){_0x31bcb4[_0x2298('0x3f')]=_0x3f1b1c;return _0x31bcb4;})[_0x2298('0x3c')](respondWithFilteredResult(_0x5a0b07,_0x167702))[_0x2298('0x40')](handleError(_0x5a0b07,null));};exports['show']=function(_0x5461a0,_0x13b21a){var _0x5ad0ce={'raw':!![],'where':{'id':_0x5461a0['params']['id']}},_0x7d365d={};_0x7d365d['model']=_[_0x2298('0x29')](db[_0x2298('0x26')]['rawAttributes']);_0x7d365d['query']=_[_0x2298('0x29')](_0x5461a0[_0x2298('0x2a')]);_0x7d365d['filters']=_[_0x2298('0x2d')](_0x7d365d['model'],_0x7d365d[_0x2298('0x2a')]);_0x5ad0ce['attributes']=_['intersection'](_0x7d365d['model'],qs['fields'](_0x5461a0[_0x2298('0x2a')][_0x2298('0x2e')]));_0x5ad0ce[_0x2298('0x2c')]=_0x5ad0ce[_0x2298('0x2c')][_0x2298('0x2f')]?_0x5ad0ce[_0x2298('0x2c')]:_0x7d365d[_0x2298('0x28')];if(_0x5461a0[_0x2298('0x2a')][_0x2298('0x41')]){_0x5ad0ce[_0x2298('0x3d')]=[{'all':!![]}];}_0x5ad0ce=_[_0x2298('0x37')]({},_0x5ad0ce,_0x5461a0['options']);return db[_0x2298('0x26')][_0x2298('0x42')](_0x5ad0ce)['then'](handleEntityNotFound(_0x13b21a,null))[_0x2298('0x3c')](respondWithResult(_0x13b21a,null))[_0x2298('0x40')](handleError(_0x13b21a,null));};exports['create']=function(_0x53ca00,_0x2c67cd){return db['SmsApplication'][_0x2298('0x43')](_0x53ca00[_0x2298('0x44')],{})[_0x2298('0x3c')](respondWithResult(_0x2c67cd,0xc9))[_0x2298('0x40')](handleError(_0x2c67cd,null));};exports[_0x2298('0x20')]=function(_0x5ccb20,_0x593d83){if(_0x5ccb20[_0x2298('0x44')]['id']){delete _0x5ccb20[_0x2298('0x44')]['id'];}return db[_0x2298('0x26')][_0x2298('0x42')]({'where':{'id':_0x5ccb20[_0x2298('0x45')]['id']}})[_0x2298('0x3c')](handleEntityNotFound(_0x593d83,null))['then'](saveUpdates(_0x5ccb20[_0x2298('0x44')],null))['then'](respondWithResult(_0x593d83,null))[_0x2298('0x40')](handleError(_0x593d83,null));};exports[_0x2298('0x21')]=function(_0x2381c7,_0x33543b){return db[_0x2298('0x26')]['find']({'where':{'id':_0x2381c7['params']['id']}})[_0x2298('0x3c')](handleEntityNotFound(_0x33543b,null))[_0x2298('0x3c')](removeEntity(_0x33543b,null))[_0x2298('0x40')](handleError(_0x33543b,null));}; \ No newline at end of file +var _0xf752=['set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','SmsApplication','model','keys','query','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','map','key','field','options','includeAll','findAll','catch','intersection','find','create','body','params','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','sendStatus','status','json','count','offset','limit'];(function(_0x9bcaf9,_0x403de2){var _0xaabd9f=function(_0x5d7fa0){while(--_0x5d7fa0){_0x9bcaf9['push'](_0x9bcaf9['shift']());}};_0xaabd9f(++_0x403de2);}(_0xf752,0x1b9));var _0x2f75=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xf752[_0x178e48];return _0x440d7e;};'use strict';var pdf=require(_0x2f75('0x0'));var emlformat=require(_0x2f75('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f75('0x2'));var rp=require(_0x2f75('0x3'));var moment=require(_0x2f75('0x4'));var BPromise=require(_0x2f75('0x5'));var Mustache=require('mustache');var util=require(_0x2f75('0x6'));var path=require(_0x2f75('0x7'));var sox=require(_0x2f75('0x8'));var csv=require(_0x2f75('0x9'));var ejs=require(_0x2f75('0xa'));var fs=require('fs');var _=require(_0x2f75('0xb'));var squel=require(_0x2f75('0xc'));var crypto=require(_0x2f75('0xd'));var jsforce=require(_0x2f75('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2f75('0xf'));var Papa=require(_0x2f75('0x10'));var authService=require(_0x2f75('0x11'));var hardwareService=require(_0x2f75('0x12'));var Redis=require(_0x2f75('0x13'));var qs=require(_0x2f75('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2f75('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaeccfd,_0x42d79f){_0x42d79f=_0x42d79f||0xcc;return function(_0x47b39a){if(_0x47b39a){return _0xaeccfd[_0x2f75('0x16')](_0x42d79f);}return _0xaeccfd[_0x2f75('0x17')](_0x42d79f)['end']();};}function respondWithResult(_0xf94310,_0x189a3e){_0x189a3e=_0x189a3e||0xc8;return function(_0x933234){if(_0x933234){return _0xf94310[_0x2f75('0x17')](_0x189a3e)[_0x2f75('0x18')](_0x933234);}};}function respondWithFilteredResult(_0x2213e9,_0xc2f286){return function(_0x32965){if(_0x32965){var _0x26ae24=_0x32965[_0x2f75('0x19')],_0x4f4a9d=_0xc2f286[_0x2f75('0x1a')],_0x3c7272=_0xc2f286[_0x2f75('0x1a')]+_0xc2f286[_0x2f75('0x1b')],_0x58c65b;if(_0x3c7272>=_0x26ae24){_0x3c7272=_0x26ae24;_0x58c65b=0xc8;}else{_0x58c65b=0xce;}_0x2213e9[_0x2f75('0x17')](_0x58c65b);return _0x2213e9[_0x2f75('0x1c')](_0x2f75('0x1d'),_0x4f4a9d+'-'+_0x3c7272+'/'+_0x26ae24)['json'](_0x32965);}return null;};}function patchUpdates(_0x1ffc2d){return function(_0x228f02){try{jsonpatch[_0x2f75('0x1e')](_0x228f02,_0x1ffc2d,!![]);}catch(_0x50f1ce){return BPromise[_0x2f75('0x1f')](_0x50f1ce);}return _0x228f02['save']();};}function saveUpdates(_0x56ccdb,_0x24cb23){return function(_0x4fc383){if(_0x4fc383){return _0x4fc383[_0x2f75('0x20')](_0x56ccdb)[_0x2f75('0x21')](function(_0x295ef5){return _0x295ef5;});}return null;};}function removeEntity(_0x28e108,_0x486681){return function(_0x36b083){if(_0x36b083){return _0x36b083[_0x2f75('0x22')]()[_0x2f75('0x21')](function(){_0x28e108['status'](0xcc)[_0x2f75('0x23')]();});}};}function handleEntityNotFound(_0x120fbf,_0x3f625c){return function(_0x1c1243){if(!_0x1c1243){_0x120fbf[_0x2f75('0x16')](0x194);}return _0x1c1243;};}function handleError(_0x47abac,_0x91af86){_0x91af86=_0x91af86||0x1f4;return function(_0x2606b1){logger[_0x2f75('0x24')](_0x2606b1[_0x2f75('0x25')]);if(_0x2606b1[_0x2f75('0x26')]){delete _0x2606b1['name'];}_0x47abac[_0x2f75('0x17')](_0x91af86)[_0x2f75('0x27')](_0x2606b1);};}exports[_0x2f75('0x28')]=function(_0x3c8dec,_0x1131ab){var _0xcf494f={},_0x4fc51f={},_0x495081={'count':0x0,'rows':[]};var _0x2b5111=db[_0x2f75('0x29')]['rawAttributes'];_0x4fc51f[_0x2f75('0x2a')]=_[_0x2f75('0x2b')](_0x2b5111);_0x4fc51f['query']=_[_0x2f75('0x2b')](_0x3c8dec[_0x2f75('0x2c')]);_0x4fc51f['filters']=_['intersection'](_0x4fc51f[_0x2f75('0x2a')],_0x4fc51f[_0x2f75('0x2c')]);_0xcf494f[_0x2f75('0x2d')]=_['intersection'](_0x4fc51f['model'],qs[_0x2f75('0x2e')](_0x3c8dec[_0x2f75('0x2c')][_0x2f75('0x2e')]));_0xcf494f[_0x2f75('0x2d')]=_0xcf494f[_0x2f75('0x2d')][_0x2f75('0x2f')]?_0xcf494f[_0x2f75('0x2d')]:_0x4fc51f[_0x2f75('0x2a')];if(!_0x3c8dec[_0x2f75('0x2c')]['hasOwnProperty'](_0x2f75('0x30'))){_0xcf494f['limit']=qs[_0x2f75('0x1b')](_0x3c8dec[_0x2f75('0x2c')][_0x2f75('0x1b')]);_0xcf494f['offset']=qs[_0x2f75('0x1a')](_0x3c8dec[_0x2f75('0x2c')][_0x2f75('0x1a')]);}_0xcf494f[_0x2f75('0x31')]=qs['sort'](_0x3c8dec['query'][_0x2f75('0x32')]);_0xcf494f['where']=qs['filters'](_['pick'](_0x3c8dec[_0x2f75('0x2c')],_0x4fc51f[_0x2f75('0x33')]));if(_0x3c8dec[_0x2f75('0x2c')][_0x2f75('0x34')]){_0xcf494f[_0x2f75('0x35')]=_[_0x2f75('0x36')](_0xcf494f[_0x2f75('0x35')],{'$or':_[_0x2f75('0x37')](_0x2b5111,function(_0x47554c){if(_0x47554c['type'][_0x2f75('0x38')]!=='VIRTUAL'){var _0x55a544={};_0x55a544[_0x47554c[_0x2f75('0x39')]]={'$like':'%'+_0x3c8dec[_0x2f75('0x2c')][_0x2f75('0x34')]+'%'};return _0x55a544;}})});}_0xcf494f=_[_0x2f75('0x36')]({},_0xcf494f,_0x3c8dec[_0x2f75('0x3a')]);var _0x3b762e={'where':_0xcf494f[_0x2f75('0x35')]};return db[_0x2f75('0x29')][_0x2f75('0x19')](_0x3b762e)['then'](function(_0x13ed44){_0x495081[_0x2f75('0x19')]=_0x13ed44;if(_0x3c8dec[_0x2f75('0x2c')][_0x2f75('0x3b')]){_0xcf494f['include']=[{'all':!![]}];}return db[_0x2f75('0x29')][_0x2f75('0x3c')](_0xcf494f);})[_0x2f75('0x21')](function(_0x5e3365){_0x495081['rows']=_0x5e3365;return _0x495081;})[_0x2f75('0x21')](respondWithFilteredResult(_0x1131ab,_0xcf494f))[_0x2f75('0x3d')](handleError(_0x1131ab,null));};exports['show']=function(_0x104da6,_0x119261){var _0xf9d3ef={'raw':!![],'where':{'id':_0x104da6['params']['id']}},_0x43908c={};_0x43908c[_0x2f75('0x2a')]=_['keys'](db[_0x2f75('0x29')]['rawAttributes']);_0x43908c['query']=_['keys'](_0x104da6[_0x2f75('0x2c')]);_0x43908c[_0x2f75('0x33')]=_[_0x2f75('0x3e')](_0x43908c[_0x2f75('0x2a')],_0x43908c[_0x2f75('0x2c')]);_0xf9d3ef[_0x2f75('0x2d')]=_['intersection'](_0x43908c[_0x2f75('0x2a')],qs[_0x2f75('0x2e')](_0x104da6[_0x2f75('0x2c')][_0x2f75('0x2e')]));_0xf9d3ef[_0x2f75('0x2d')]=_0xf9d3ef[_0x2f75('0x2d')][_0x2f75('0x2f')]?_0xf9d3ef[_0x2f75('0x2d')]:_0x43908c[_0x2f75('0x2a')];if(_0x104da6[_0x2f75('0x2c')]['includeAll']){_0xf9d3ef['include']=[{'all':!![]}];}_0xf9d3ef=_['merge']({},_0xf9d3ef,_0x104da6[_0x2f75('0x3a')]);return db[_0x2f75('0x29')][_0x2f75('0x3f')](_0xf9d3ef)[_0x2f75('0x21')](handleEntityNotFound(_0x119261,null))[_0x2f75('0x21')](respondWithResult(_0x119261,null))[_0x2f75('0x3d')](handleError(_0x119261,null));};exports[_0x2f75('0x40')]=function(_0x1f7bec,_0x441ef1){return db['SmsApplication'][_0x2f75('0x40')](_0x1f7bec[_0x2f75('0x41')],{})['then'](respondWithResult(_0x441ef1,0xc9))[_0x2f75('0x3d')](handleError(_0x441ef1,null));};exports[_0x2f75('0x20')]=function(_0x4244cf,_0x2fa2f2){if(_0x4244cf[_0x2f75('0x41')]['id']){delete _0x4244cf[_0x2f75('0x41')]['id'];}return db[_0x2f75('0x29')][_0x2f75('0x3f')]({'where':{'id':_0x4244cf[_0x2f75('0x42')]['id']}})[_0x2f75('0x21')](handleEntityNotFound(_0x2fa2f2,null))[_0x2f75('0x21')](saveUpdates(_0x4244cf[_0x2f75('0x41')],null))['then'](respondWithResult(_0x2fa2f2,null))[_0x2f75('0x3d')](handleError(_0x2fa2f2,null));};exports[_0x2f75('0x22')]=function(_0x14ee13,_0x4cf81e){return db[_0x2f75('0x29')][_0x2f75('0x3f')]({'where':{'id':_0x14ee13[_0x2f75('0x42')]['id']}})[_0x2f75('0x21')](handleEntityNotFound(_0x4cf81e,null))[_0x2f75('0x21')](removeEntity(_0x4cf81e,null))[_0x2f75('0x3d')](handleError(_0x4cf81e,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 6c0c824..3a01e17 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 _0xa130=['util','../../config/logger','api','moment','bluebird','request-promise','define','SmsApplication','sms_applications','lodash'];(function(_0x2dc5e,_0x5376dd){var _0x384e3a=function(_0x136429){while(--_0x136429){_0x2dc5e['push'](_0x2dc5e['shift']());}};_0x384e3a(++_0x5376dd);}(_0xa130,0x1cb));var _0x0a13=function(_0x2c71af,_0x2c4152){_0x2c71af=_0x2c71af-0x0;var _0x20e3a6=_0xa130[_0x2c71af];return _0x20e3a6;};'use strict';var _=require(_0x0a13('0x0'));var util=require(_0x0a13('0x1'));var logger=require(_0x0a13('0x2'))(_0x0a13('0x3'));var moment=require(_0x0a13('0x4'));var BPromise=require(_0x0a13('0x5'));var rp=require(_0x0a13('0x6'));var attributes=require('./smsApplication.attributes');module['exports']=function(_0x5e4d3d,_0x50267e){return _0x5e4d3d[_0x0a13('0x7')](_0x0a13('0x8'),attributes,{'tableName':_0x0a13('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9a9=['../../config/logger','api','moment','bluebird','request-promise','exports','define','SmsApplication','sms_applications','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd9a9,0x149));var _0x9d9a=function(_0x41bccb,_0x539657){_0x41bccb=_0x41bccb-0x0;var _0x530f49=_0xd9a9[_0x41bccb];return _0x530f49;};'use strict';var _=require(_0x9d9a('0x0'));var util=require('util');var logger=require(_0x9d9a('0x1'))(_0x9d9a('0x2'));var moment=require(_0x9d9a('0x3'));var BPromise=require(_0x9d9a('0x4'));var rp=require(_0x9d9a('0x5'));var attributes=require('./smsApplication.attributes');module[_0x9d9a('0x6')]=function(_0x3c3eb1,_0x13da3f){return _0x3c3eb1[_0x9d9a('0x7')](_0x9d9a('0x8'),attributes,{'tableName':_0x9d9a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 614d0e7..aeadfd1 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 _0x2320=['SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2deb2b,_0x35f4e5){var _0x5836a0=function(_0x10d89b){while(--_0x10d89b){_0x2deb2b['push'](_0x2deb2b['shift']());}};_0x5836a0(++_0x35f4e5);}(_0x2320,0x68));var _0x0232=function(_0x363077,_0x4d0cb3){_0x363077=_0x363077-0x0;var _0x357efc=_0x2320[_0x363077];return _0x357efc;};'use strict';var _=require(_0x0232('0x0'));var util=require('util');var moment=require(_0x0232('0x1'));var BPromise=require(_0x0232('0x2'));var rs=require(_0x0232('0x3'));var fs=require('fs');var Redis=require(_0x0232('0x4'));var db=require(_0x0232('0x5'))['db'];var utils=require(_0x0232('0x6'));var logger=require(_0x0232('0x7'))(_0x0232('0x8'));var config=require(_0x0232('0x9'));var jayson=require(_0x0232('0xa'));var client=jayson[_0x0232('0xb')][_0x0232('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd79451,_0x302192,_0x1e3568){return new BPromise(function(_0x1249f3,_0x4eab5d){return client[_0x0232('0xd')](_0xd79451,_0x1e3568)['then'](function(_0x5c9fb7){logger[_0x0232('0xe')]('SmsApplication,\x20%s,\x20%s',_0x302192,_0x0232('0xf'));logger[_0x0232('0x10')](_0x0232('0x11'),_0x302192,_0x0232('0xf'),JSON[_0x0232('0x12')](_0x5c9fb7));if(_0x5c9fb7[_0x0232('0x13')]){if(_0x5c9fb7[_0x0232('0x13')][_0x0232('0x14')]===0x1f4){logger['error'](_0x0232('0x15'),_0x302192,_0x5c9fb7['error'][_0x0232('0x16')]);return _0x4eab5d(_0x5c9fb7[_0x0232('0x13')]['message']);}logger['error'](_0x0232('0x15'),_0x302192,_0x5c9fb7[_0x0232('0x13')][_0x0232('0x16')]);return _0x1249f3(_0x5c9fb7[_0x0232('0x13')]['message']);}else{logger[_0x0232('0xe')]('SmsApplication,\x20%s,\x20%s',_0x302192,_0x0232('0xf'));_0x1249f3(_0x5c9fb7[_0x0232('0x17')]['message']);}})[_0x0232('0x18')](function(_0x393a50){logger[_0x0232('0x13')]('SmsApplication,\x20%s,\x20%s',_0x302192,_0x393a50);_0x4eab5d(_0x393a50);});});} \ No newline at end of file +var _0x6dcb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','request\x20sent','debug','stringify','error','SmsApplication,\x20%s,\x20%s','message','catch','lodash','moment','randomstring'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x6dcb,0x1ad));var _0xb6dc=function(_0x1fd6cd,_0x67b90f){_0x1fd6cd=_0x1fd6cd-0x0;var _0x1b85a7=_0x6dcb[_0x1fd6cd];return _0x1b85a7;};'use strict';var _=require(_0xb6dc('0x0'));var util=require('util');var moment=require(_0xb6dc('0x1'));var BPromise=require('bluebird');var rs=require(_0xb6dc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb6dc('0x3'));var logger=require(_0xb6dc('0x4'))('rpc');var config=require(_0xb6dc('0x5'));var jayson=require(_0xb6dc('0x6'));var client=jayson['client'][_0xb6dc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa0a1eb,_0x54df19,_0xa95da2){return new BPromise(function(_0x5c5b52,_0x418069){return client['request'](_0xa0a1eb,_0xa95da2)[_0xb6dc('0x8')](function(_0xc10326){logger['info']('SmsApplication,\x20%s,\x20%s',_0x54df19,_0xb6dc('0x9'));logger[_0xb6dc('0xa')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x54df19,_0xb6dc('0x9'),JSON[_0xb6dc('0xb')](_0xc10326));if(_0xc10326[_0xb6dc('0xc')]){if(_0xc10326[_0xb6dc('0xc')]['code']===0x1f4){logger[_0xb6dc('0xc')](_0xb6dc('0xd'),_0x54df19,_0xc10326['error'][_0xb6dc('0xe')]);return _0x418069(_0xc10326[_0xb6dc('0xc')][_0xb6dc('0xe')]);}logger[_0xb6dc('0xc')](_0xb6dc('0xd'),_0x54df19,_0xc10326[_0xb6dc('0xc')][_0xb6dc('0xe')]);return _0x5c5b52(_0xc10326[_0xb6dc('0xc')][_0xb6dc('0xe')]);}else{logger['info'](_0xb6dc('0xd'),_0x54df19,_0xb6dc('0x9'));_0x5c5b52(_0xc10326['result'][_0xb6dc('0xe')]);}})[_0xb6dc('0xf')](function(_0x17d49e){logger[_0xb6dc('0xc')](_0xb6dc('0xd'),_0x54df19,_0x17d49e);_0x418069(_0x17d49e);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 0f5eb4f..c7bd062 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 _0x55c0=['addTags','smsinteraction:update','delete','destroy','/:id/tags','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','tracked','sms'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x55c0,0xc3));var _0x055c=function(_0xc4dbc9,_0x1aa6b6){_0xc4dbc9=_0xc4dbc9-0x0;var _0x531773=_0x55c0[_0xc4dbc9];return _0x531773;};'use strict';var multer=require('multer');var util=require(_0x055c('0x0'));var path=require(_0x055c('0x1'));var timeout=require(_0x055c('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x055c('0x3'));var interaction=require(_0x055c('0x4'));var config=require('../../config/environment');var controller=require(_0x055c('0x5'));router['get']('/',auth[_0x055c('0x6')](),controller[_0x055c('0x7')]);router[_0x055c('0x8')](_0x055c('0x9'),auth['isAuthenticated'](),controller[_0x055c('0xa')]);router[_0x055c('0x8')](_0x055c('0xb'),auth[_0x055c('0x6')](),controller[_0x055c('0xc')]);router[_0x055c('0x8')]('/:id/messages',auth[_0x055c('0x6')](),controller[_0x055c('0xd')]);router[_0x055c('0x8')](_0x055c('0xe'),auth[_0x055c('0x6')](),controller[_0x055c('0xf')]);router[_0x055c('0x10')]('/',auth[_0x055c('0x6')](),controller['create']);router['post'](_0x055c('0x11'),auth['isAuthenticated'](),controller[_0x055c('0x12')]);router[_0x055c('0x10')]('/:id/tags',auth[_0x055c('0x6')](),interaction[_0x055c('0x13')](_0x055c('0x14'),'smsinteraction:addtags'),controller[_0x055c('0x15')]);router['put'](_0x055c('0xb'),auth[_0x055c('0x6')](),interaction[_0x055c('0x13')]('sms',_0x055c('0x16')),controller['update']);router[_0x055c('0x17')](_0x055c('0xb'),auth[_0x055c('0x6')](),interaction[_0x055c('0x13')]('sms','smsinteraction:destroy'),controller[_0x055c('0x18')]);router[_0x055c('0x17')](_0x055c('0x19'),auth[_0x055c('0x6')](),controller['removeTags']);module[_0x055c('0x1a')]=router; \ No newline at end of file +var _0x362c=['create','/:id/tags','tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express','Router','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x5b19f9,_0x5752ab){var _0x541c23=function(_0x5c641d){while(--_0x5c641d){_0x5b19f9['push'](_0x5b19f9['shift']());}};_0x541c23(++_0x5752ab);}(_0x362c,0x15b));var _0xc362=function(_0x122525,_0x7652d8){_0x122525=_0x122525-0x0;var _0x511cf3=_0x362c[_0x122525];return _0x511cf3;};'use strict';var multer=require(_0xc362('0x0'));var util=require('util');var path=require(_0xc362('0x1'));var timeout=require(_0xc362('0x2'));var express=require(_0xc362('0x3'));var router=express[_0xc362('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc362('0x5'));var controller=require(_0xc362('0x6'));router[_0xc362('0x7')]('/',auth[_0xc362('0x8')](),controller[_0xc362('0x9')]);router[_0xc362('0x7')]('/describe',auth[_0xc362('0x8')](),controller['describe']);router['get'](_0xc362('0xa'),auth[_0xc362('0x8')](),controller[_0xc362('0xb')]);router[_0xc362('0x7')](_0xc362('0xc'),auth['isAuthenticated'](),controller[_0xc362('0xd')]);router['get'](_0xc362('0xe'),auth[_0xc362('0x8')](),controller[_0xc362('0xf')]);router[_0xc362('0x10')]('/',auth[_0xc362('0x8')](),controller[_0xc362('0x11')]);router[_0xc362('0x10')](_0xc362('0xc'),auth[_0xc362('0x8')](),controller['addMessage']);router[_0xc362('0x10')](_0xc362('0x12'),auth[_0xc362('0x8')](),interaction[_0xc362('0x13')](_0xc362('0x14'),'smsinteraction:addtags'),controller[_0xc362('0x15')]);router[_0xc362('0x16')](_0xc362('0xa'),auth[_0xc362('0x8')](),interaction[_0xc362('0x13')](_0xc362('0x14'),'smsinteraction:update'),controller[_0xc362('0x17')]);router[_0xc362('0x18')](_0xc362('0xa'),auth[_0xc362('0x8')](),interaction[_0xc362('0x13')](_0xc362('0x14'),_0xc362('0x19')),controller[_0xc362('0x1a')]);router['delete'](_0xc362('0x12'),auth[_0xc362('0x8')](),controller[_0xc362('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 5ccd0e1..d0727a9 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 _0x2cc1=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x10075c,_0x1c6300){var _0x410f78=function(_0xb4332f){while(--_0xb4332f){_0x10075c['push'](_0x10075c['shift']());}};_0x410f78(++_0x1c6300);}(_0x2cc1,0xec));var _0x12cc=function(_0x5bc4e2,_0x427ff9){_0x5bc4e2=_0x5bc4e2-0x0;var _0x4c93f9=_0x2cc1[_0x5bc4e2];return _0x4c93f9;};'use strict';var Sequelize=require(_0x12cc('0x0'));var moment=require(_0x12cc('0x1'));module[_0x12cc('0x2')]={'closed':{'type':Sequelize[_0x12cc('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x12cc('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x12cc('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x12cc('0x6')]('in',_0x12cc('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x12cc('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x12cc('0x6')]('in',_0x12cc('0x7')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb467=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x12bd5f,_0x46ed10){var _0x2f348e=function(_0x82335){while(--_0x82335){_0x12bd5f['push'](_0x12bd5f['shift']());}};_0x2f348e(++_0x46ed10);}(_0xb467,0x19f));var _0x7b46=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0xb467[_0xe39824];return _0x4bc31e;};'use strict';var Sequelize=require(_0x7b46('0x0'));var moment=require('moment');module[_0x7b46('0x1')]={'closed':{'type':Sequelize[_0x7b46('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7b46('0x3')]},'disposition':{'type':Sequelize[_0x7b46('0x4')]},'note':{'type':Sequelize[_0x7b46('0x4')]},'phone':{'type':Sequelize[_0x7b46('0x4')]},'read1stAt':{'type':Sequelize[_0x7b46('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7b46('0x5')]('in',_0x7b46('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7b46('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7b46('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 6f525be..e459ffc 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 _0x20ec=['SmsInteractionId','$gte','split','format','addTags','params','setTags','omit','spread','emit','smsInteractionTags:save','removeTags','join','root','server','files','tmp','attachments','interaction-%s.zip','firstName','Letter','1cm','

Sms\x20Interaction:\x20#%d

','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','toString','
','','toFile','interaction-','download','log','err','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','map','VIRTUAL','field','merge','options','tag','include','push','Tag','Tags','distinct','SmsMessage','Messages','createdAt','read','includeAll','User','Users','fullname','CmContact','Contact','Owner','SmsAccount','Account','direction','color','ThroughTags','findAll','catch','show','SmsInteraction','find','create','body','describe','addMessage','ids','findOne','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20ec,0x12f));var _0xc20e=function(_0xe66f5a,_0x20056b){_0xe66f5a=_0xe66f5a-0x0;var _0x9f6f71=_0x20ec[_0xe66f5a];return _0x9f6f71;};'use strict';var pdf=require(_0xc20e('0x0'));var emlformat=require(_0xc20e('0x1'));var rimraf=require(_0xc20e('0x2'));var zipdir=require(_0xc20e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc20e('0x4'));var BPromise=require(_0xc20e('0x5'));var Mustache=require(_0xc20e('0x6'));var util=require(_0xc20e('0x7'));var path=require(_0xc20e('0x8'));var sox=require(_0xc20e('0x9'));var csv=require(_0xc20e('0xa'));var ejs=require(_0xc20e('0xb'));var fs=require('fs');var _=require(_0xc20e('0xc'));var squel=require(_0xc20e('0xd'));var crypto=require(_0xc20e('0xe'));var jsforce=require(_0xc20e('0xf'));var deskjs=require(_0xc20e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc20e('0x11'));var Papa=require(_0xc20e('0x12'));var authService=require(_0xc20e('0x13'));var hardwareService=require(_0xc20e('0x14'));var Redis=require(_0xc20e('0x15'));var qs=require(_0xc20e('0x16'));var logger=require('../../config/logger')(_0xc20e('0x17'));var utils=require(_0xc20e('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xc20e('0x19')](config[_0xc20e('0x1a')],{'host':_0xc20e('0x1b'),'port':0x18eb});var socket=require(_0xc20e('0x1c'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xc20e('0x1d')](socket);function respondWithStatusCode(_0x5ba738,_0x217533){_0x217533=_0x217533||0xcc;return function(_0x28b844){if(_0x28b844){return _0x5ba738[_0xc20e('0x1e')](_0x217533);}return _0x5ba738[_0xc20e('0x1f')](_0x217533)[_0xc20e('0x20')]();};}function respondWithResult(_0x5dec3c,_0x5eeb13){_0x5eeb13=_0x5eeb13||0xc8;return function(_0x4ee521){if(_0x4ee521){return _0x5dec3c[_0xc20e('0x1f')](_0x5eeb13)[_0xc20e('0x21')](_0x4ee521);}};}function respondWithFilteredResult(_0xc9c331,_0x2de9af){return function(_0xb56baa){if(_0xb56baa){var _0xae3723=_0xb56baa[_0xc20e('0x22')],_0x417e4e=_0x2de9af[_0xc20e('0x23')],_0x3286ee=_0x2de9af['offset']+_0x2de9af[_0xc20e('0x24')],_0x20ba43;if(_0x3286ee>=_0xae3723){_0x3286ee=_0xae3723;_0x20ba43=0xc8;}else{_0x20ba43=0xce;}_0xc9c331[_0xc20e('0x1f')](_0x20ba43);return _0xc9c331['set'](_0xc20e('0x25'),_0x417e4e+'-'+_0x3286ee+'/'+_0xae3723)[_0xc20e('0x21')](_0xb56baa);}return null;};}function patchUpdates(_0x294d0c){return function(_0x51c68a){try{jsonpatch[_0xc20e('0x26')](_0x51c68a,_0x294d0c,!![]);}catch(_0x5686ed){return BPromise[_0xc20e('0x27')](_0x5686ed);}return _0x51c68a['save']();};}function saveUpdates(_0x4a2f24,_0x8a97c0){return function(_0x1a41a3){if(_0x1a41a3){return _0x1a41a3[_0xc20e('0x28')](_0x4a2f24)['then'](function(_0x39c209){return _0x39c209;});}return null;};}function removeEntity(_0x30509e,_0x2ff420){return function(_0x4d7616){if(_0x4d7616){return _0x4d7616[_0xc20e('0x29')]()[_0xc20e('0x2a')](function(){_0x30509e[_0xc20e('0x1f')](0xcc)[_0xc20e('0x20')]();});}};}function handleEntityNotFound(_0x2d1f89,_0x68f14f){return function(_0xa712ca){if(!_0xa712ca){_0x2d1f89['sendStatus'](0x194);}return _0xa712ca;};}function handleError(_0x4cfd34,_0x53abe2){_0x53abe2=_0x53abe2||0x1f4;return function(_0x546ff6){logger[_0xc20e('0x2b')](_0x546ff6[_0xc20e('0x2c')]);if(_0x546ff6['name']){delete _0x546ff6[_0xc20e('0x2d')];}_0x4cfd34['status'](_0x53abe2)[_0xc20e('0x2e')](_0x546ff6);};}exports[_0xc20e('0x2f')]=function(_0x1e9984,_0xa4ff48){var _0x476fa0={},_0x55bbbb={},_0x2e4a45={'count':0x0,'rows':[]};var _0x322106=db['SmsInteraction'][_0xc20e('0x30')];_0x55bbbb[_0xc20e('0x31')]=_[_0xc20e('0x32')](_0x322106);_0x55bbbb[_0xc20e('0x33')]=_[_0xc20e('0x32')](_0x1e9984['query']);_0x55bbbb[_0xc20e('0x34')]=_[_0xc20e('0x35')](_0x55bbbb['model'],_0x55bbbb[_0xc20e('0x33')]);_0x476fa0[_0xc20e('0x36')]=_[_0xc20e('0x35')](_0x55bbbb[_0xc20e('0x31')],qs['fields'](_0x1e9984[_0xc20e('0x33')][_0xc20e('0x37')]));_0x476fa0[_0xc20e('0x36')]=_0x476fa0[_0xc20e('0x36')][_0xc20e('0x38')]?_0x476fa0['attributes']:_0x55bbbb[_0xc20e('0x31')];if(!_0x1e9984[_0xc20e('0x33')]['hasOwnProperty']('nolimit')){_0x476fa0['limit']=qs[_0xc20e('0x24')](_0x1e9984['query'][_0xc20e('0x24')]);_0x476fa0['offset']=qs[_0xc20e('0x23')](_0x1e9984[_0xc20e('0x33')][_0xc20e('0x23')]);}_0x476fa0[_0xc20e('0x39')]=qs[_0xc20e('0x3a')](_0x1e9984[_0xc20e('0x33')][_0xc20e('0x3a')]);_0x476fa0['where']=qs[_0xc20e('0x34')](_[_0xc20e('0x3b')](_0x1e9984['query'],_0x55bbbb[_0xc20e('0x34')]));if(_0x1e9984[_0xc20e('0x33')][_0xc20e('0x3c')]){_0x476fa0[_0xc20e('0x3d')]=_['merge'](_0x476fa0[_0xc20e('0x3d')],{'$or':_[_0xc20e('0x3e')](_0x322106,function(_0x4a5c89){if(_0x4a5c89['type']['key']!==_0xc20e('0x3f')){var _0x235e02={};_0x235e02[_0x4a5c89[_0xc20e('0x40')]]={'$like':'%'+_0x1e9984['query'][_0xc20e('0x3c')]+'%'};return _0x235e02;}})});}_0x476fa0=_[_0xc20e('0x41')]({},_0x476fa0,_0x1e9984[_0xc20e('0x42')]);var _0x545376={'where':_0x476fa0[_0xc20e('0x3d')]};_0x545376['include']=[];if(_0x1e9984[_0xc20e('0x33')][_0xc20e('0x43')]){_0x545376[_0xc20e('0x44')][_0xc20e('0x45')]({'model':db[_0xc20e('0x46')],'as':_0xc20e('0x47'),'attributes':['id'],'where':{'id':_0x1e9984[_0xc20e('0x33')]['tag']},'required':!![]});_0x545376[_0xc20e('0x48')]=!![];}if(_0x1e9984[_0xc20e('0x33')]['read']){_0x545376['include'][_0xc20e('0x45')]({'model':db[_0xc20e('0x49')],'as':_0xc20e('0x4a'),'attributes':['id','direction',_0xc20e('0x4b'),'read'],'where':{'direction':'in','read':_0x1e9984[_0xc20e('0x33')][_0xc20e('0x4c')]||![]},'required':!![]});_0x545376['distinct']=!![];}return db['SmsInteraction'][_0xc20e('0x22')](_0x545376)[_0xc20e('0x2a')](function(_0x4cbc72){_0x2e4a45[_0xc20e('0x22')]=_0x4cbc72;if(_0x1e9984[_0xc20e('0x33')][_0xc20e('0x4d')]){_0x476fa0[_0xc20e('0x44')]=[{'model':db[_0xc20e('0x4e')],'as':_0xc20e('0x4f'),'required':![],'attributes':['id',_0xc20e('0x2d'),_0xc20e('0x50')]},{'model':db[_0xc20e('0x51')],'as':_0xc20e('0x52'),'required':![]},{'model':db[_0xc20e('0x4e')],'as':_0xc20e('0x53'),'attributes':[_0xc20e('0x2d'),_0xc20e('0x50'),'internal'],'required':![]},{'model':db[_0xc20e('0x54')],'as':_0xc20e('0x55'),'attributes':[_0xc20e('0x2d'),'key'],'required':![]},{'model':db[_0xc20e('0x49')],'as':_0xc20e('0x4a'),'attributes':['id',_0xc20e('0x56'),'createdAt','read'],'where':{'direction':'in','read':_0x1e9984[_0xc20e('0x33')][_0xc20e('0x4c')]||![]},'required':_0x1e9984['query'][_0xc20e('0x4c')]||![]},{'model':db[_0xc20e('0x46')],'as':'Tags','attributes':['id',_0xc20e('0x2d'),_0xc20e('0x57')],'required':_0x1e9984[_0xc20e('0x33')]['tag']?!![]:![]},{'model':db['Tag'],'as':_0xc20e('0x58'),'attributes':['id',_0xc20e('0x2d'),_0xc20e('0x57')],'through':_0x1e9984[_0xc20e('0x33')][_0xc20e('0x43')]?{'attributes':[],'where':{'TagId':_0x1e9984[_0xc20e('0x33')][_0xc20e('0x43')]||undefined}}:{},'required':_0x1e9984['query'][_0xc20e('0x43')]?!![]:![]}];}return db['SmsInteraction'][_0xc20e('0x59')](_0x476fa0);})[_0xc20e('0x2a')](function(_0x28cfb2){_0x2e4a45['rows']=_0x28cfb2;return _0x2e4a45;})[_0xc20e('0x2a')](respondWithFilteredResult(_0xa4ff48,_0x476fa0))[_0xc20e('0x5a')](handleError(_0xa4ff48,null));};exports[_0xc20e('0x5b')]=function(_0x185f69,_0x40574e){var _0x5a4a54={'raw':![],'where':{'id':_0x185f69['params']['id']}},_0x48db2f={};_0x48db2f['model']=_['keys'](db[_0xc20e('0x5c')][_0xc20e('0x30')]);_0x48db2f[_0xc20e('0x33')]=_[_0xc20e('0x32')](_0x185f69[_0xc20e('0x33')]);_0x48db2f[_0xc20e('0x34')]=_['intersection'](_0x48db2f[_0xc20e('0x31')],_0x48db2f[_0xc20e('0x33')]);_0x5a4a54[_0xc20e('0x36')]=_[_0xc20e('0x35')](_0x48db2f[_0xc20e('0x31')],qs[_0xc20e('0x37')](_0x185f69[_0xc20e('0x33')][_0xc20e('0x37')]));_0x5a4a54[_0xc20e('0x36')]=_0x5a4a54[_0xc20e('0x36')][_0xc20e('0x38')]?_0x5a4a54[_0xc20e('0x36')]:_0x48db2f['model'];if(_0x185f69['query'][_0xc20e('0x4d')]){_0x5a4a54[_0xc20e('0x44')]=[{'all':!![]}];}_0x5a4a54=_[_0xc20e('0x41')]({},_0x5a4a54,_0x185f69[_0xc20e('0x42')]);return db[_0xc20e('0x5c')][_0xc20e('0x5d')](_0x5a4a54)['then'](handleEntityNotFound(_0x40574e,null))[_0xc20e('0x2a')](respondWithResult(_0x40574e,null))['catch'](handleError(_0x40574e,null));};exports[_0xc20e('0x5e')]=function(_0x40b168,_0x3d57d5){return db[_0xc20e('0x5c')][_0xc20e('0x5e')](_0x40b168[_0xc20e('0x5f')],{})[_0xc20e('0x2a')](respondWithResult(_0x3d57d5,0xc9))[_0xc20e('0x5a')](handleError(_0x3d57d5,null));};exports[_0xc20e('0x28')]=function(_0x3e2e06,_0x20eb58){if(_0x3e2e06[_0xc20e('0x5f')]['id']){delete _0x3e2e06['body']['id'];}return db[_0xc20e('0x5c')][_0xc20e('0x5d')]({'where':{'id':_0x3e2e06['params']['id']}})[_0xc20e('0x2a')](handleEntityNotFound(_0x20eb58,null))['then'](saveUpdates(_0x3e2e06[_0xc20e('0x5f')],null))[_0xc20e('0x2a')](respondWithResult(_0x20eb58,null))['catch'](handleError(_0x20eb58,null));};exports[_0xc20e('0x29')]=function(_0x4db1d7,_0x2bdd5b){return db['SmsInteraction'][_0xc20e('0x5d')]({'where':{'id':_0x4db1d7['params']['id']}})[_0xc20e('0x2a')](handleEntityNotFound(_0x2bdd5b,null))[_0xc20e('0x2a')](removeEntity(_0x2bdd5b,null))[_0xc20e('0x5a')](handleError(_0x2bdd5b,null));};exports[_0xc20e('0x60')]=function(_0x11883e,_0x3a0b4f){return db['SmsInteraction'][_0xc20e('0x60')]()[_0xc20e('0x2a')](respondWithResult(_0x3a0b4f,null))[_0xc20e('0x5a')](handleError(_0x3a0b4f,null));};exports[_0xc20e('0x61')]=function(_0x2fc03d,_0xac853d,_0x261fdd){return db['SmsMessage'][_0xc20e('0x5d')]({'where':{'id':_0x2fc03d['params']['id']}})[_0xc20e('0x2a')](handleEntityNotFound(_0xac853d,null))['then'](function(_0x29b1b3){if(_0x29b1b3){return _0x29b1b3[_0xc20e('0x61')](_0x2fc03d[_0xc20e('0x5f')][_0xc20e('0x62')],_['omit'](_0x2fc03d[_0xc20e('0x5f')],[_0xc20e('0x62'),'id'])||{});}})['then'](respondWithResult(_0xac853d,null))[_0xc20e('0x5a')](handleError(_0xac853d,null));};exports['getMessages']=function(_0x3fff3a,_0x7f092e,_0x591e9b){var _0x5c4ee0={'raw':![],'where':{}};var _0x53639f={};var _0x3f4b84={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xc20e('0x63')]({'where':{'id':_0x3fff3a['params']['id']}})[_0xc20e('0x2a')](handleEntityNotFound(_0x7f092e,null))[_0xc20e('0x2a')](function(_0x5d678b){if(_0x5d678b){_0x53639f[_0xc20e('0x31')]=_[_0xc20e('0x32')](db[_0xc20e('0x49')][_0xc20e('0x30')]);_0x53639f['query']=_[_0xc20e('0x32')](_0x3fff3a[_0xc20e('0x33')]);_0x53639f[_0xc20e('0x34')]=_['intersection'](_0x53639f[_0xc20e('0x31')],_0x53639f[_0xc20e('0x33')]);_0x5c4ee0[_0xc20e('0x36')]=_[_0xc20e('0x35')](_0x53639f['model'],qs[_0xc20e('0x37')](_0x3fff3a[_0xc20e('0x33')][_0xc20e('0x37')]));_0x5c4ee0[_0xc20e('0x36')]=_0x5c4ee0['attributes']['length']?_0x5c4ee0['attributes']:_0x53639f['model'];if(!_0x3fff3a[_0xc20e('0x33')][_0xc20e('0x64')](_0xc20e('0x65'))){_0x5c4ee0[_0xc20e('0x24')]=qs[_0xc20e('0x24')](_0x3fff3a[_0xc20e('0x33')]['limit']);_0x5c4ee0[_0xc20e('0x23')]=qs['offset'](_0x3fff3a[_0xc20e('0x33')][_0xc20e('0x23')]);}_0x5c4ee0[_0xc20e('0x39')]=qs[_0xc20e('0x3a')](_0x3fff3a['query']['sort']);_0x5c4ee0['where']=qs[_0xc20e('0x34')](_[_0xc20e('0x3b')](_0x3fff3a['query'],_0x53639f['filters']));_0x5c4ee0[_0xc20e('0x3d')][_0xc20e('0x66')]=_0x5d678b['id'];if(_0x3fff3a[_0xc20e('0x33')][_0xc20e('0x3c')]){_0x5c4ee0[_0xc20e('0x3d')]=_[_0xc20e('0x41')](_0x5c4ee0[_0xc20e('0x3d')],{'$or':_[_0xc20e('0x3e')](_0x5c4ee0[_0xc20e('0x36')],function(_0x1c9281){var _0x24afe4={};_0x24afe4[_0x1c9281]={'$like':'%'+_0x3fff3a[_0xc20e('0x33')][_0xc20e('0x3c')]+'%'};return _0x24afe4;})});}if(_0x3fff3a[_0xc20e('0x33')][_0xc20e('0x67')]){var _0xf73924=_0x3fff3a['query'][_0xc20e('0x67')][_0xc20e('0x68')](',');var _0x8ffee6={};_0x8ffee6[_0xf73924[0x0]]={'$gte':moment(_0xf73924[0x1])[_0xc20e('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5c4ee0[_0xc20e('0x3d')]=_['merge'](_0x5c4ee0[_0xc20e('0x3d')],_0x8ffee6);}_0x5c4ee0=_['merge']({},_0x5c4ee0,_0x3fff3a['options']);return db[_0xc20e('0x49')][_0xc20e('0x22')]({'where':_0x5c4ee0[_0xc20e('0x3d')]})[_0xc20e('0x2a')](function(_0x1db206){_0x3f4b84[_0xc20e('0x22')]=_0x1db206;if(_0x3fff3a[_0xc20e('0x33')][_0xc20e('0x4d')]){_0x5c4ee0[_0xc20e('0x44')]=[{'all':!![]}];}return db[_0xc20e('0x49')][_0xc20e('0x59')](_0x5c4ee0);})['then'](function(_0x3ed4a6){_0x3f4b84['rows']=_0x3ed4a6;return _0x3f4b84;});}})[_0xc20e('0x2a')](respondWithFilteredResult(_0x7f092e,_0x5c4ee0))[_0xc20e('0x5a')](handleError(_0x7f092e,null));};exports[_0xc20e('0x6a')]=function(_0x1687ec,_0x2b03dc,_0x2de478){return db[_0xc20e('0x5c')][_0xc20e('0x5d')]({'where':{'id':_0x1687ec[_0xc20e('0x6b')]['id']}})[_0xc20e('0x2a')](handleEntityNotFound(_0x2b03dc,null))[_0xc20e('0x2a')](function(_0x137775){if(_0x137775){return _0x137775[_0xc20e('0x6c')](_0x1687ec[_0xc20e('0x5f')][_0xc20e('0x62')],_[_0xc20e('0x6d')](_0x1687ec[_0xc20e('0x5f')],[_0xc20e('0x62'),'id'])||{})[_0xc20e('0x6e')](function(){return db[_0xc20e('0x46')][_0xc20e('0x59')]({'attributes':['id',_0xc20e('0x2d'),_0xc20e('0x57')],'where':{'id':_0x1687ec[_0xc20e('0x5f')][_0xc20e('0x62')]}});})[_0xc20e('0x2a')](function(_0x39e0a8){socket[_0xc20e('0x6f')](_0xc20e('0x70'),{'id':Number(_0x1687ec['params']['id']),'tags':_0x39e0a8||[]});return{'id':Number(_0x1687ec['params']['id']),'tags':_0x39e0a8||[]};});}})[_0xc20e('0x2a')](respondWithResult(_0x2b03dc,null))[_0xc20e('0x5a')](handleError(_0x2b03dc,null));};exports[_0xc20e('0x71')]=function(_0x254edd,_0x4aa832,_0x1ec2d2){var _0x51dc27;return db['SmsInteraction'][_0xc20e('0x5d')]({'where':{'id':_0x254edd['params']['id']}})[_0xc20e('0x2a')](handleEntityNotFound(_0x4aa832,null))[_0xc20e('0x2a')](function(_0x3d6f30){if(_0x3d6f30){return _0x3d6f30[_0xc20e('0x71')](_0x254edd['query'][_0xc20e('0x62')]);}})['then'](respondWithStatusCode(_0x4aa832,null))['catch'](handleError(_0x4aa832,null));};exports['download']=function(_0x57622b,_0x19e069){var _0x2ec81b=moment()['unix']()['toString']();var _0x1a0dff=path[_0xc20e('0x72')](config[_0xc20e('0x73')],_0xc20e('0x74'),_0xc20e('0x75'),_0xc20e('0x76'));var _0xeed23=path[_0xc20e('0x72')](config[_0xc20e('0x73')],_0xc20e('0x74'),_0xc20e('0x75'),_0xc20e('0x77'));var _0x5580cd=path['join'](_0x1a0dff,_0x2ec81b);var _0x1724a6=util[_0xc20e('0x69')](_0xc20e('0x78'),_0x2ec81b);var _0x54e607=path['join'](_0x1a0dff,_0x1724a6);var _0x52c38d=![];return db['SmsInteraction'][_0xc20e('0x5d')]({'where':{'id':_0x57622b['params']['id']},'include':[{'model':db['SmsMessage'],'as':_0xc20e('0x4a'),'attributes':['id',_0xc20e('0x5f')],'include':[{'model':db[_0xc20e('0x4e')],'as':'User','attributes':['id',_0xc20e('0x50')],'raw':!![]},{'model':db['CmContact'],'as':_0xc20e('0x52'),'attributes':['id',_0xc20e('0x79')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x19e069,null))[_0xc20e('0x2a')](function(_0x123957){if(_0x123957){_0x52c38d=!![];var _0xb7da7d='';var _0xa19ab3={'format':_0xc20e('0x7a'),'border':_0xc20e('0x7b')};fs['mkdirSync'](_0x5580cd);_0xb7da7d+=util[_0xc20e('0x69')](_0xc20e('0x7c'),_0x123957['id']);_0xb7da7d+=util[_0xc20e('0x69')](_0xc20e('0x7d'),moment()['format'](_0xc20e('0x7e'))[_0xc20e('0x7f')]());_0xb7da7d+=_0xc20e('0x80');for(var _0x431b36=0x0;_0x431b36<_0x123957[_0xc20e('0x4a')][_0xc20e('0x38')];_0x431b36++){var _0x2f24fe=_0x123957[_0xc20e('0x4a')][_0x431b36];_0xb7da7d+=_0xc20e('0x81');_0xb7da7d+=util[_0xc20e('0x69')]('%s:\x20%s

',_0x2f24fe['User']?_0x2f24fe[_0xc20e('0x4e')][_0xc20e('0x50')]:_0x2f24fe['Contact'][_0xc20e('0x79')],_0x2f24fe[_0xc20e('0x5f')]);_0xb7da7d+='';}return new BPromise(function(_0x185533,_0x48d853){pdf[_0xc20e('0x5e')](_0xb7da7d,_0xa19ab3)[_0xc20e('0x82')](path['join'](_0x5580cd,_0xc20e('0x83')+_0x2ec81b+'.pdf'),function(_0x3c458a,_0x347a79){if(_0x3c458a)return _0x48d853(_0x3c458a);_0x185533(_0x347a79);});});}})[_0xc20e('0x2a')](function(){if(_0x52c38d){return new BPromise(function(_0x43f2a4,_0x44085e){zipdir(_0x5580cd,{'saveTo':_0x54e607},function(_0x4f948a,_0x52f57e){if(_0x4f948a)return _0x44085e(_0x4f948a);return _0x43f2a4(_0x52f57e);});});}})['then'](function(){if(_0x52c38d){return new BPromise(function(_0x1b71fa,_0x37f586){rimraf(_0x5580cd,function(_0x1fc900){if(_0x1fc900)_0x37f586(_0x1fc900);return _0x1b71fa();});});}})[_0xc20e('0x2a')](function(){if(_0x52c38d){return _0x19e069[_0xc20e('0x84')](_0x54e607,_0x1724a6,function(_0x4ee2cb){if(_0x4ee2cb){console[_0xc20e('0x85')](_0xc20e('0x86'),_0x4ee2cb);}else{fs['unlinkSync'](_0x54e607);}});}else{return _0x19e069[_0xc20e('0x1e')](0xc8);}})[_0xc20e('0x5a')](handleError(_0x19e069,null));}; \ No newline at end of file +var _0x8b2d=['set','Content-Range','update','then','destroy','sendStatus','error','stack','name','index','SmsInteraction','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','map','type','key','VIRTUAL','field','options','include','tag','Tag','distinct','SmsMessage','Messages','direction','read','User','fullname','CmContact','internal','SmsAccount','Account','createdAt','Tags','color','ThroughTags','rows','catch','show','includeAll','find','create','body','params','addMessage','ids','omit','getMessages','findOne','order','pick','SmsInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','format','Contact','Letter','1cm','mkdirSync','

Date:\x20%s

','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','
','','firstName','','interaction-','log','err','unlinkSync','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','status','end','json','count','offset','limit'];(function(_0x5847bb,_0x3f5e2d){var _0x5f2e0b=function(_0x220eb5){while(--_0x220eb5){_0x5847bb['push'](_0x5847bb['shift']());}};_0x5f2e0b(++_0x3f5e2d);}(_0x8b2d,0xe5));var _0xd8b2=function(_0x3497b5,_0x5775b8){_0x3497b5=_0x3497b5-0x0;var _0x9c5460=_0x8b2d[_0x3497b5];return _0x9c5460;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd8b2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8b2('0x1'));var rp=require(_0xd8b2('0x2'));var moment=require('moment');var BPromise=require(_0xd8b2('0x3'));var Mustache=require(_0xd8b2('0x4'));var util=require('util');var path=require(_0xd8b2('0x5'));var sox=require(_0xd8b2('0x6'));var csv=require(_0xd8b2('0x7'));var ejs=require(_0xd8b2('0x8'));var fs=require('fs');var _=require(_0xd8b2('0x9'));var squel=require(_0xd8b2('0xa'));var crypto=require(_0xd8b2('0xb'));var jsforce=require(_0xd8b2('0xc'));var deskjs=require(_0xd8b2('0xd'));var toCsv=require(_0xd8b2('0x7'));var querystring=require('querystring');var Papa=require(_0xd8b2('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xd8b2('0xf'));var Redis=require(_0xd8b2('0x10'));var qs=require(_0xd8b2('0x11'));var logger=require(_0xd8b2('0x12'))(_0xd8b2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xd8b2('0x14')]=_[_0xd8b2('0x15')](config[_0xd8b2('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xd8b2('0x16'))(new Redis(config[_0xd8b2('0x14')]));require(_0xd8b2('0x17'))[_0xd8b2('0x18')](socket);function respondWithStatusCode(_0x4c7f60,_0x3ecff2){_0x3ecff2=_0x3ecff2||0xcc;return function(_0x4c4d97){if(_0x4c4d97){return _0x4c7f60['sendStatus'](_0x3ecff2);}return _0x4c7f60[_0xd8b2('0x19')](_0x3ecff2)[_0xd8b2('0x1a')]();};}function respondWithResult(_0x227f86,_0x2a0b6){_0x2a0b6=_0x2a0b6||0xc8;return function(_0x35cbed){if(_0x35cbed){return _0x227f86[_0xd8b2('0x19')](_0x2a0b6)[_0xd8b2('0x1b')](_0x35cbed);}};}function respondWithFilteredResult(_0x4bf135,_0x4c4493){return function(_0x573d24){if(_0x573d24){var _0x5b63a1=_0x573d24[_0xd8b2('0x1c')],_0x323c79=_0x4c4493[_0xd8b2('0x1d')],_0x44185b=_0x4c4493['offset']+_0x4c4493[_0xd8b2('0x1e')],_0x3ae3b7;if(_0x44185b>=_0x5b63a1){_0x44185b=_0x5b63a1;_0x3ae3b7=0xc8;}else{_0x3ae3b7=0xce;}_0x4bf135[_0xd8b2('0x19')](_0x3ae3b7);return _0x4bf135[_0xd8b2('0x1f')](_0xd8b2('0x20'),_0x323c79+'-'+_0x44185b+'/'+_0x5b63a1)['json'](_0x573d24);}return null;};}function patchUpdates(_0x449b11){return function(_0x4d355c){try{jsonpatch['apply'](_0x4d355c,_0x449b11,!![]);}catch(_0x23ff29){return BPromise['reject'](_0x23ff29);}return _0x4d355c['save']();};}function saveUpdates(_0x3880cb,_0x42ae8f){return function(_0x4b2992){if(_0x4b2992){return _0x4b2992[_0xd8b2('0x21')](_0x3880cb)[_0xd8b2('0x22')](function(_0x12e44b){return _0x12e44b;});}return null;};}function removeEntity(_0x563c96,_0x16d996){return function(_0x4a92d5){if(_0x4a92d5){return _0x4a92d5[_0xd8b2('0x23')]()[_0xd8b2('0x22')](function(){_0x563c96['status'](0xcc)[_0xd8b2('0x1a')]();});}};}function handleEntityNotFound(_0x1cee26,_0x520143){return function(_0x101e23){if(!_0x101e23){_0x1cee26[_0xd8b2('0x24')](0x194);}return _0x101e23;};}function handleError(_0x542f88,_0x4f6fd5){_0x4f6fd5=_0x4f6fd5||0x1f4;return function(_0x2f1f15){logger[_0xd8b2('0x25')](_0x2f1f15[_0xd8b2('0x26')]);if(_0x2f1f15[_0xd8b2('0x27')]){delete _0x2f1f15[_0xd8b2('0x27')];}_0x542f88['status'](_0x4f6fd5)['send'](_0x2f1f15);};}exports[_0xd8b2('0x28')]=function(_0x4d3141,_0x249565){var _0x22c3cf={},_0x39ef2f={},_0x2ef26c={'count':0x0,'rows':[]};var _0x51a745=db[_0xd8b2('0x29')][_0xd8b2('0x2a')];_0x39ef2f[_0xd8b2('0x2b')]=_[_0xd8b2('0x2c')](_0x51a745);_0x39ef2f[_0xd8b2('0x2d')]=_[_0xd8b2('0x2c')](_0x4d3141[_0xd8b2('0x2d')]);_0x39ef2f[_0xd8b2('0x2e')]=_[_0xd8b2('0x2f')](_0x39ef2f[_0xd8b2('0x2b')],_0x39ef2f[_0xd8b2('0x2d')]);_0x22c3cf['attributes']=_[_0xd8b2('0x2f')](_0x39ef2f['model'],qs[_0xd8b2('0x30')](_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x30')]));_0x22c3cf[_0xd8b2('0x31')]=_0x22c3cf[_0xd8b2('0x31')][_0xd8b2('0x32')]?_0x22c3cf[_0xd8b2('0x31')]:_0x39ef2f[_0xd8b2('0x2b')];if(!_0x4d3141['query'][_0xd8b2('0x33')](_0xd8b2('0x34'))){_0x22c3cf[_0xd8b2('0x1e')]=qs[_0xd8b2('0x1e')](_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x1e')]);_0x22c3cf[_0xd8b2('0x1d')]=qs[_0xd8b2('0x1d')](_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x1d')]);}_0x22c3cf['order']=qs[_0xd8b2('0x35')](_0x4d3141[_0xd8b2('0x2d')]['sort']);_0x22c3cf['where']=qs[_0xd8b2('0x2e')](_['pick'](_0x4d3141[_0xd8b2('0x2d')],_0x39ef2f['filters']));if(_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x36')]){_0x22c3cf[_0xd8b2('0x37')]=_[_0xd8b2('0x38')](_0x22c3cf[_0xd8b2('0x37')],{'$or':_[_0xd8b2('0x39')](_0x51a745,function(_0xc508fa){if(_0xc508fa[_0xd8b2('0x3a')][_0xd8b2('0x3b')]!==_0xd8b2('0x3c')){var _0x49b05a={};_0x49b05a[_0xc508fa[_0xd8b2('0x3d')]]={'$like':'%'+_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x36')]+'%'};return _0x49b05a;}})});}_0x22c3cf=_[_0xd8b2('0x38')]({},_0x22c3cf,_0x4d3141[_0xd8b2('0x3e')]);var _0x141f11={'where':_0x22c3cf[_0xd8b2('0x37')]};_0x141f11[_0xd8b2('0x3f')]=[];if(_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x40')]){_0x141f11[_0xd8b2('0x3f')]['push']({'model':db[_0xd8b2('0x41')],'as':'Tags','attributes':['id'],'where':{'id':_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x40')]},'required':!![]});_0x141f11[_0xd8b2('0x42')]=!![];}if(_0x4d3141['query']['read']){_0x141f11['include']['push']({'model':db[_0xd8b2('0x43')],'as':_0xd8b2('0x44'),'attributes':['id',_0xd8b2('0x45'),'createdAt',_0xd8b2('0x46')],'where':{'direction':'in','read':_0x4d3141[_0xd8b2('0x2d')]['read']||![]},'required':!![]});_0x141f11[_0xd8b2('0x42')]=!![];}return db['SmsInteraction']['count'](_0x141f11)[_0xd8b2('0x22')](function(_0x2d29df){_0x2ef26c[_0xd8b2('0x1c')]=_0x2d29df;if(_0x4d3141['query']['includeAll']){_0x22c3cf[_0xd8b2('0x3f')]=[{'model':db[_0xd8b2('0x47')],'as':'Users','required':![],'attributes':['id',_0xd8b2('0x27'),_0xd8b2('0x48')]},{'model':db[_0xd8b2('0x49')],'as':'Contact','required':![]},{'model':db[_0xd8b2('0x47')],'as':'Owner','attributes':[_0xd8b2('0x27'),_0xd8b2('0x48'),_0xd8b2('0x4a')],'required':![]},{'model':db[_0xd8b2('0x4b')],'as':_0xd8b2('0x4c'),'attributes':['name',_0xd8b2('0x3b')],'required':![]},{'model':db[_0xd8b2('0x43')],'as':_0xd8b2('0x44'),'attributes':['id',_0xd8b2('0x45'),_0xd8b2('0x4d'),_0xd8b2('0x46')],'where':{'direction':'in','read':_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x46')]||![]},'required':_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x46')]||![]},{'model':db['Tag'],'as':_0xd8b2('0x4e'),'attributes':['id','name',_0xd8b2('0x4f')],'required':_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x40')]?!![]:![]},{'model':db[_0xd8b2('0x41')],'as':_0xd8b2('0x50'),'attributes':['id',_0xd8b2('0x27'),_0xd8b2('0x4f')],'through':_0x4d3141[_0xd8b2('0x2d')][_0xd8b2('0x40')]?{'attributes':[],'where':{'TagId':_0x4d3141[_0xd8b2('0x2d')]['tag']||undefined}}:{},'required':_0x4d3141['query'][_0xd8b2('0x40')]?!![]:![]}];}return db[_0xd8b2('0x29')]['findAll'](_0x22c3cf);})[_0xd8b2('0x22')](function(_0x2cb826){_0x2ef26c[_0xd8b2('0x51')]=_0x2cb826;return _0x2ef26c;})[_0xd8b2('0x22')](respondWithFilteredResult(_0x249565,_0x22c3cf))[_0xd8b2('0x52')](handleError(_0x249565,null));};exports[_0xd8b2('0x53')]=function(_0x306c52,_0x312249){var _0x3a1758={'raw':![],'where':{'id':_0x306c52['params']['id']}},_0x5cccf4={};_0x5cccf4[_0xd8b2('0x2b')]=_[_0xd8b2('0x2c')](db[_0xd8b2('0x29')][_0xd8b2('0x2a')]);_0x5cccf4['query']=_[_0xd8b2('0x2c')](_0x306c52[_0xd8b2('0x2d')]);_0x5cccf4[_0xd8b2('0x2e')]=_['intersection'](_0x5cccf4[_0xd8b2('0x2b')],_0x5cccf4[_0xd8b2('0x2d')]);_0x3a1758['attributes']=_[_0xd8b2('0x2f')](_0x5cccf4[_0xd8b2('0x2b')],qs[_0xd8b2('0x30')](_0x306c52[_0xd8b2('0x2d')]['fields']));_0x3a1758['attributes']=_0x3a1758[_0xd8b2('0x31')][_0xd8b2('0x32')]?_0x3a1758[_0xd8b2('0x31')]:_0x5cccf4[_0xd8b2('0x2b')];if(_0x306c52['query'][_0xd8b2('0x54')]){_0x3a1758['include']=[{'all':!![]}];}_0x3a1758=_[_0xd8b2('0x38')]({},_0x3a1758,_0x306c52[_0xd8b2('0x3e')]);return db['SmsInteraction'][_0xd8b2('0x55')](_0x3a1758)[_0xd8b2('0x22')](handleEntityNotFound(_0x312249,null))[_0xd8b2('0x22')](respondWithResult(_0x312249,null))['catch'](handleError(_0x312249,null));};exports[_0xd8b2('0x56')]=function(_0x379d7f,_0x416110){return db[_0xd8b2('0x29')][_0xd8b2('0x56')](_0x379d7f['body'],{})[_0xd8b2('0x22')](respondWithResult(_0x416110,0xc9))[_0xd8b2('0x52')](handleError(_0x416110,null));};exports['update']=function(_0xd4d2ea,_0x11dc8d){if(_0xd4d2ea['body']['id']){delete _0xd4d2ea[_0xd8b2('0x57')]['id'];}return db[_0xd8b2('0x29')][_0xd8b2('0x55')]({'where':{'id':_0xd4d2ea[_0xd8b2('0x58')]['id']}})[_0xd8b2('0x22')](handleEntityNotFound(_0x11dc8d,null))[_0xd8b2('0x22')](saveUpdates(_0xd4d2ea[_0xd8b2('0x57')],null))['then'](respondWithResult(_0x11dc8d,null))[_0xd8b2('0x52')](handleError(_0x11dc8d,null));};exports[_0xd8b2('0x23')]=function(_0x439e45,_0x318c20){return db[_0xd8b2('0x29')][_0xd8b2('0x55')]({'where':{'id':_0x439e45[_0xd8b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x318c20,null))[_0xd8b2('0x22')](removeEntity(_0x318c20,null))[_0xd8b2('0x52')](handleError(_0x318c20,null));};exports['describe']=function(_0x497ff9,_0x47ef81){return db[_0xd8b2('0x29')]['describe']()['then'](respondWithResult(_0x47ef81,null))[_0xd8b2('0x52')](handleError(_0x47ef81,null));};exports[_0xd8b2('0x59')]=function(_0x8d690b,_0x5f3802,_0x3f1755){return db['SmsMessage'][_0xd8b2('0x55')]({'where':{'id':_0x8d690b['params']['id']}})['then'](handleEntityNotFound(_0x5f3802,null))[_0xd8b2('0x22')](function(_0x28d2d9){if(_0x28d2d9){return _0x28d2d9[_0xd8b2('0x59')](_0x8d690b['body'][_0xd8b2('0x5a')],_[_0xd8b2('0x5b')](_0x8d690b['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5f3802,null))[_0xd8b2('0x52')](handleError(_0x5f3802,null));};exports[_0xd8b2('0x5c')]=function(_0x4d3120,_0x4c53e7,_0x1864d7){var _0x2f7ae3={'raw':![],'where':{}};var _0x29e833={};var _0x2844db={'count':0x0,'rows':[]};return db[_0xd8b2('0x29')][_0xd8b2('0x5d')]({'where':{'id':_0x4d3120[_0xd8b2('0x58')]['id']}})[_0xd8b2('0x22')](handleEntityNotFound(_0x4c53e7,null))['then'](function(_0x14a7d0){if(_0x14a7d0){_0x29e833[_0xd8b2('0x2b')]=_[_0xd8b2('0x2c')](db[_0xd8b2('0x43')][_0xd8b2('0x2a')]);_0x29e833[_0xd8b2('0x2d')]=_[_0xd8b2('0x2c')](_0x4d3120['query']);_0x29e833[_0xd8b2('0x2e')]=_['intersection'](_0x29e833['model'],_0x29e833[_0xd8b2('0x2d')]);_0x2f7ae3['attributes']=_[_0xd8b2('0x2f')](_0x29e833[_0xd8b2('0x2b')],qs[_0xd8b2('0x30')](_0x4d3120[_0xd8b2('0x2d')]['fields']));_0x2f7ae3[_0xd8b2('0x31')]=_0x2f7ae3[_0xd8b2('0x31')][_0xd8b2('0x32')]?_0x2f7ae3['attributes']:_0x29e833['model'];if(!_0x4d3120[_0xd8b2('0x2d')]['hasOwnProperty'](_0xd8b2('0x34'))){_0x2f7ae3['limit']=qs[_0xd8b2('0x1e')](_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x1e')]);_0x2f7ae3[_0xd8b2('0x1d')]=qs['offset'](_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x1d')]);}_0x2f7ae3[_0xd8b2('0x5e')]=qs[_0xd8b2('0x35')](_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x35')]);_0x2f7ae3[_0xd8b2('0x37')]=qs[_0xd8b2('0x2e')](_[_0xd8b2('0x5f')](_0x4d3120[_0xd8b2('0x2d')],_0x29e833[_0xd8b2('0x2e')]));_0x2f7ae3['where'][_0xd8b2('0x60')]=_0x14a7d0['id'];if(_0x4d3120['query']['filter']){_0x2f7ae3[_0xd8b2('0x37')]=_[_0xd8b2('0x38')](_0x2f7ae3['where'],{'$or':_[_0xd8b2('0x39')](_0x2f7ae3[_0xd8b2('0x31')],function(_0x410d52){var _0x569d61={};_0x569d61[_0x410d52]={'$like':'%'+_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x36')]+'%'};return _0x569d61;})});}if(_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x61')]){var _0x1bbdc3=_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x61')][_0xd8b2('0x62')](',');var _0x2382ab={};_0x2382ab[_0x1bbdc3[0x0]]={'$gte':moment(_0x1bbdc3[0x1])['format'](_0xd8b2('0x63'))};_0x2f7ae3[_0xd8b2('0x37')]=_[_0xd8b2('0x38')](_0x2f7ae3[_0xd8b2('0x37')],_0x2382ab);}_0x2f7ae3=_[_0xd8b2('0x38')]({},_0x2f7ae3,_0x4d3120[_0xd8b2('0x3e')]);return db['SmsMessage'][_0xd8b2('0x1c')]({'where':_0x2f7ae3[_0xd8b2('0x37')]})[_0xd8b2('0x22')](function(_0x412131){_0x2844db[_0xd8b2('0x1c')]=_0x412131;if(_0x4d3120[_0xd8b2('0x2d')][_0xd8b2('0x54')]){_0x2f7ae3[_0xd8b2('0x3f')]=[{'all':!![]}];}return db[_0xd8b2('0x43')]['findAll'](_0x2f7ae3);})[_0xd8b2('0x22')](function(_0x3022f5){_0x2844db[_0xd8b2('0x51')]=_0x3022f5;return _0x2844db;});}})[_0xd8b2('0x22')](respondWithFilteredResult(_0x4c53e7,_0x2f7ae3))['catch'](handleError(_0x4c53e7,null));};exports[_0xd8b2('0x64')]=function(_0x321ea7,_0x969d08,_0x1f2aae){return db[_0xd8b2('0x29')][_0xd8b2('0x55')]({'where':{'id':_0x321ea7[_0xd8b2('0x58')]['id']}})[_0xd8b2('0x22')](handleEntityNotFound(_0x969d08,null))[_0xd8b2('0x22')](function(_0x577471){if(_0x577471){return _0x577471[_0xd8b2('0x65')](_0x321ea7[_0xd8b2('0x57')]['ids'],_['omit'](_0x321ea7['body'],[_0xd8b2('0x5a'),'id'])||{})[_0xd8b2('0x66')](function(){return db[_0xd8b2('0x41')][_0xd8b2('0x67')]({'attributes':['id',_0xd8b2('0x27'),_0xd8b2('0x4f')],'where':{'id':_0x321ea7[_0xd8b2('0x57')][_0xd8b2('0x5a')]}});})[_0xd8b2('0x22')](function(_0x16135f){socket[_0xd8b2('0x68')](_0xd8b2('0x69'),{'id':Number(_0x321ea7['params']['id']),'tags':_0x16135f||[]});return{'id':Number(_0x321ea7[_0xd8b2('0x58')]['id']),'tags':_0x16135f||[]};});}})[_0xd8b2('0x22')](respondWithResult(_0x969d08,null))[_0xd8b2('0x52')](handleError(_0x969d08,null));};exports[_0xd8b2('0x6a')]=function(_0x192781,_0x5d4960,_0x2bb62a){var _0x277034;return db['SmsInteraction'][_0xd8b2('0x55')]({'where':{'id':_0x192781[_0xd8b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x5d4960,null))[_0xd8b2('0x22')](function(_0x3fae45){if(_0x3fae45){return _0x3fae45[_0xd8b2('0x6a')](_0x192781[_0xd8b2('0x2d')][_0xd8b2('0x5a')]);}})['then'](respondWithStatusCode(_0x5d4960,null))[_0xd8b2('0x52')](handleError(_0x5d4960,null));};exports[_0xd8b2('0x6b')]=function(_0x220eb7,_0x53d7b4){var _0x2ed8f3=moment()[_0xd8b2('0x6c')]()[_0xd8b2('0x6d')]();var _0x1b06da=path[_0xd8b2('0x6e')](config[_0xd8b2('0x6f')],_0xd8b2('0x70'),_0xd8b2('0x71'),_0xd8b2('0x72'));var _0x23a9b4=path[_0xd8b2('0x6e')](config['root'],_0xd8b2('0x70'),_0xd8b2('0x71'),'attachments');var _0x11ce73=path[_0xd8b2('0x6e')](_0x1b06da,_0x2ed8f3);var _0x543bc5=util[_0xd8b2('0x73')]('interaction-%s.zip',_0x2ed8f3);var _0x5b7673=path[_0xd8b2('0x6e')](_0x1b06da,_0x543bc5);var _0x234634=![];return db[_0xd8b2('0x29')]['find']({'where':{'id':_0x220eb7['params']['id']},'include':[{'model':db[_0xd8b2('0x43')],'as':_0xd8b2('0x44'),'attributes':['id',_0xd8b2('0x57')],'include':[{'model':db['User'],'as':'User','attributes':['id',_0xd8b2('0x48')],'raw':!![]},{'model':db[_0xd8b2('0x49')],'as':_0xd8b2('0x74'),'attributes':['id','firstName'],'raw':!![]}]}]})[_0xd8b2('0x22')](handleEntityNotFound(_0x53d7b4,null))[_0xd8b2('0x22')](function(_0x5b1a6b){if(_0x5b1a6b){_0x234634=!![];var _0x1c41f4='';var _0x2aa007={'format':_0xd8b2('0x75'),'border':_0xd8b2('0x76')};fs[_0xd8b2('0x77')](_0x11ce73);_0x1c41f4+=util['format']('

Sms\x20Interaction:\x20#%d

',_0x5b1a6b['id']);_0x1c41f4+=util[_0xd8b2('0x73')](_0xd8b2('0x78'),moment()[_0xd8b2('0x73')](_0xd8b2('0x79'))[_0xd8b2('0x6d')]());_0x1c41f4+=_0xd8b2('0x7a');for(var _0x4d6ff9=0x0;_0x4d6ff9<_0x5b1a6b[_0xd8b2('0x44')]['length'];_0x4d6ff9++){var _0x44704c=_0x5b1a6b['Messages'][_0x4d6ff9];_0x1c41f4+=_0xd8b2('0x7b');_0x1c41f4+=util[_0xd8b2('0x73')]('%s:\x20%s

',_0x44704c['User']?_0x44704c[_0xd8b2('0x47')][_0xd8b2('0x48')]:_0x44704c[_0xd8b2('0x74')][_0xd8b2('0x7c')],_0x44704c[_0xd8b2('0x57')]);_0x1c41f4+=_0xd8b2('0x7d');}return new BPromise(function(_0x13af4f,_0x18a531){pdf['create'](_0x1c41f4,_0x2aa007)['toFile'](path[_0xd8b2('0x6e')](_0x11ce73,_0xd8b2('0x7e')+_0x2ed8f3+'.pdf'),function(_0x13084a,_0x5e84b0){if(_0x13084a)return _0x18a531(_0x13084a);_0x13af4f(_0x5e84b0);});});}})[_0xd8b2('0x22')](function(){if(_0x234634){return new BPromise(function(_0x1effd0,_0x53feaa){zipdir(_0x11ce73,{'saveTo':_0x5b7673},function(_0x212dc8,_0x25721e){if(_0x212dc8)return _0x53feaa(_0x212dc8);return _0x1effd0(_0x25721e);});});}})[_0xd8b2('0x22')](function(){if(_0x234634){return new BPromise(function(_0x447666,_0x4aa53e){rimraf(_0x11ce73,function(_0x4a41c9){if(_0x4a41c9)_0x4aa53e(_0x4a41c9);return _0x447666();});});}})[_0xd8b2('0x22')](function(){if(_0x234634){return _0x53d7b4[_0xd8b2('0x6b')](_0x5b7673,_0x543bc5,function(_0x1e1ee8){if(_0x1e1ee8){console[_0xd8b2('0x7f')](_0xd8b2('0x80'),_0x1e1ee8);}else{fs[_0xd8b2('0x81')](_0x5b7673);}});}else{return _0x53d7b4[_0xd8b2('0x24')](0xc8);}})[_0xd8b2('0x52')](handleError(_0x53d7b4,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 659b3df..994b94a 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 _0x22ea=['events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','emit','exports'];(function(_0x6c4e3f,_0x30308a){var _0x27c01e=function(_0x3efc59){while(--_0x3efc59){_0x6c4e3f['push'](_0x6c4e3f['shift']());}};_0x27c01e(++_0x30308a);}(_0x22ea,0x156));var _0xa22e=function(_0x3f2b6a,_0x5bd074){_0x3f2b6a=_0x3f2b6a-0x0;var _0x34f708=_0x22ea[_0x3f2b6a];return _0x34f708;};'use strict';var EventEmitter=require(_0xa22e('0x0'));var SmsInteraction=require(_0xa22e('0x1'))['db'][_0xa22e('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xa22e('0x3')](0x0);var events={'afterCreate':_0xa22e('0x4'),'afterUpdate':_0xa22e('0x5'),'afterDestroy':_0xa22e('0x6')};function emitEvent(_0x5eeb08){return function(_0x2a3d32,_0x397ca0,_0x5e7b12){SmsInteractionEvents[_0xa22e('0x7')](_0x5eeb08+':'+_0x2a3d32['id'],_0x2a3d32);SmsInteractionEvents['emit'](_0x5eeb08,_0x2a3d32);_0x5e7b12(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xa22e('0x8')]=SmsInteractionEvents; \ No newline at end of file +var _0x3723=['hasOwnProperty','exports','events','SmsInteraction','remove','emit'];(function(_0x583282,_0x4bb95e){var _0x533f8f=function(_0x21281b){while(--_0x21281b){_0x583282['push'](_0x583282['shift']());}};_0x533f8f(++_0x4bb95e);}(_0x3723,0x164));var _0x3372=function(_0x58dee3,_0x4bc1c6){_0x58dee3=_0x58dee3-0x0;var _0xc44f1b=_0x3723[_0x58dee3];return _0xc44f1b;};'use strict';var EventEmitter=require(_0x3372('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x3372('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3372('0x2')};function emitEvent(_0x35de85){return function(_0x3208f3,_0x38f246,_0x2c39ab){SmsInteractionEvents[_0x3372('0x3')](_0x35de85+':'+_0x3208f3['id'],_0x3208f3);SmsInteractionEvents[_0x3372('0x3')](_0x35de85,_0x3208f3);_0x2c39ab(null);};}for(var e in events){if(events[_0x3372('0x4')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x3372('0x5')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 25dce27..6cdb5e2 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 _0x47b9=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define','SmsInteraction','sms_interactions'];(function(_0xe1d125,_0x2f5628){var _0x42093e=function(_0x51d801){while(--_0x51d801){_0xe1d125['push'](_0xe1d125['shift']());}};_0x42093e(++_0x2f5628);}(_0x47b9,0x1b5));var _0x947b=function(_0x558e45,_0x4f5e4f){_0x558e45=_0x558e45-0x0;var _0x3e9075=_0x47b9[_0x558e45];return _0x3e9075;};'use strict';var _=require(_0x947b('0x0'));var util=require(_0x947b('0x1'));var logger=require(_0x947b('0x2'))(_0x947b('0x3'));var moment=require(_0x947b('0x4'));var BPromise=require(_0x947b('0x5'));var rp=require(_0x947b('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x947b('0x7')]=function(_0x1f97ea,_0x3b068e){return _0x1f97ea[_0x947b('0x8')](_0x947b('0x9'),attributes,{'tableName':_0x947b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xbfb0e9,_0x125d6f,_0x32e667){if(_0xbfb0e9[_0x947b('0xb')](_0x947b('0xc'))){_0xbfb0e9[_0x947b('0xd')]=moment()[_0x947b('0xe')](_0x947b('0xf'));}_0x32e667(null,_0xbfb0e9);}}});}; \ No newline at end of file +var _0x743c=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','exports','define','SmsInteraction','sms_interactions'];(function(_0x3f2262,_0x445ffa){var _0x293f32=function(_0x2b0e64){while(--_0x2b0e64){_0x3f2262['push'](_0x3f2262['shift']());}};_0x293f32(++_0x445ffa);}(_0x743c,0x17e));var _0xc743=function(_0x26bfb0,_0x5b0ffc){_0x26bfb0=_0x26bfb0-0x0;var _0x4454b3=_0x743c[_0x26bfb0];return _0x4454b3;};'use strict';var _=require(_0xc743('0x0'));var util=require(_0xc743('0x1'));var logger=require(_0xc743('0x2'))('api');var moment=require(_0xc743('0x3'));var BPromise=require(_0xc743('0x4'));var rp=require(_0xc743('0x5'));var attributes=require('./smsInteraction.attributes');module[_0xc743('0x6')]=function(_0x466c86,_0x978bd6){return _0x466c86[_0xc743('0x7')](_0xc743('0x8'),attributes,{'tableName':_0xc743('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33ca42,_0xdb7ff,_0x513436){if(_0x33ca42[_0xc743('0xa')]('closed')){_0x33ca42[_0xc743('0xb')]=moment()[_0xc743('0xc')](_0xc743('0xd'));}_0x513436(null,_0x33ca42);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index c723a1d..71f9ec8 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 _0xd937=['message','info','request\x20sent','result','catch','UpdateSmsInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToSmsInteraction','SmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','then','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e82ff,_0x3cbf4b){var _0x495205=function(_0x21bc88){while(--_0x21bc88){_0x4e82ff['push'](_0x4e82ff['shift']());}};_0x495205(++_0x3cbf4b);}(_0xd937,0x199));var _0x7d93=function(_0x5a5040,_0x18c69b){_0x5a5040=_0x5a5040-0x0;var _0x2ba7b1=_0xd937[_0x5a5040];return _0x2ba7b1;};'use strict';var _=require(_0x7d93('0x0'));var util=require(_0x7d93('0x1'));var moment=require('moment');var BPromise=require(_0x7d93('0x2'));var rs=require(_0x7d93('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d93('0x4'))['db'];var utils=require(_0x7d93('0x5'));var logger=require(_0x7d93('0x6'))(_0x7d93('0x7'));var config=require(_0x7d93('0x8'));var jayson=require(_0x7d93('0x9'));var client=jayson[_0x7d93('0xa')]['http']({'port':0x232a});config[_0x7d93('0xb')]=_[_0x7d93('0xc')](config[_0x7d93('0xb')],{'host':_0x7d93('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d93('0xb')]));require('./smsInteraction.socket')[_0x7d93('0xe')](socket);function respondWithRpcPromise(_0x56928b,_0x1494fc,_0x477ee9){return new BPromise(function(_0x2af70e,_0x3a6307){return client['request'](_0x56928b,_0x477ee9)[_0x7d93('0xf')](function(_0x2d9085){logger['info'](_0x7d93('0x10'),_0x1494fc,'request\x20sent');logger['debug'](_0x7d93('0x11'),_0x1494fc,'request\x20sent',JSON[_0x7d93('0x12')](_0x2d9085));if(_0x2d9085[_0x7d93('0x13')]){if(_0x2d9085['error'][_0x7d93('0x14')]===0x1f4){logger[_0x7d93('0x13')](_0x7d93('0x10'),_0x1494fc,_0x2d9085[_0x7d93('0x13')][_0x7d93('0x15')]);return _0x3a6307(_0x2d9085['error'][_0x7d93('0x15')]);}logger[_0x7d93('0x13')](_0x7d93('0x10'),_0x1494fc,_0x2d9085['error'][_0x7d93('0x15')]);return _0x2af70e(_0x2d9085[_0x7d93('0x13')][_0x7d93('0x15')]);}else{logger[_0x7d93('0x16')](_0x7d93('0x10'),_0x1494fc,_0x7d93('0x17'));_0x2af70e(_0x2d9085[_0x7d93('0x18')][_0x7d93('0x15')]);}})[_0x7d93('0x19')](function(_0x18cfaf){logger[_0x7d93('0x13')](_0x7d93('0x10'),_0x1494fc,_0x18cfaf);_0x3a6307(_0x18cfaf);});});}exports[_0x7d93('0x1a')]=function(_0x5ba41b){var _0x4ddc82=this;return new Promise(function(_0x4b22b7,_0x5d98f8){return db['SmsInteraction'][_0x7d93('0x1b')](_0x5ba41b[_0x7d93('0x1c')],{'raw':_0x5ba41b[_0x7d93('0x1d')]?_0x5ba41b[_0x7d93('0x1d')][_0x7d93('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ba41b['options']?_0x5ba41b['options'][_0x7d93('0x1f')]||null:null,'attributes':_0x5ba41b[_0x7d93('0x1d')]?_0x5ba41b['options'][_0x7d93('0x20')]||null:null,'limit':_0x5ba41b[_0x7d93('0x1d')]?_0x5ba41b['options'][_0x7d93('0x21')]||null:null})[_0x7d93('0xf')](function(_0x2a8244){logger[_0x7d93('0x16')](_0x7d93('0x1a'),_0x5ba41b);logger[_0x7d93('0x22')]('UpdateSmsInteraction',_0x5ba41b,JSON['stringify'](_0x2a8244));_0x4b22b7(_0x2a8244);})[_0x7d93('0x19')](function(_0x4e135e){logger[_0x7d93('0x13')](_0x7d93('0x1a'),_0x4e135e[_0x7d93('0x15')],_0x5ba41b);_0x5d98f8(_0x4ddc82[_0x7d93('0x13')](0x1f4,_0x4e135e[_0x7d93('0x15')]));});});};exports[_0x7d93('0x23')]=function(_0x4594bd){return new Promise(function(_0x202d5e,_0x4e2be7){return db[_0x7d93('0x24')][_0x7d93('0x25')]({'where':_0x4594bd[_0x7d93('0x1d')]?_0x4594bd[_0x7d93('0x1d')][_0x7d93('0x1f')]||null:null})[_0x7d93('0xf')](function(_0x248d02){if(_0x248d02){return _0x248d02[_0x7d93('0x26')](_0x4594bd['body'][_0x7d93('0x27')],_[_0x7d93('0x28')](_0x4594bd[_0x7d93('0x1c')],[_0x7d93('0x27'),'id'])||{});}})[_0x7d93('0x29')](function(_0x287a50){logger[_0x7d93('0x16')](_0x7d93('0x2a'),_0x4594bd);logger[_0x7d93('0x22')]('AddTags',_0x4594bd,JSON['stringify'](_0x287a50));_0x202d5e(_0x287a50);})[_0x7d93('0x19')](function(_0x57acb3){logger[_0x7d93('0x13')](_0x7d93('0x2a'),_0x57acb3[_0x7d93('0x15')],_0x4594bd);_0x4e2be7(_this[_0x7d93('0x13')](0x1f4,_0x57acb3[_0x7d93('0x15')]));});});}; \ No newline at end of file +var _0x056c=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateSmsInteraction','update','body','raw','options','where','attributes','limit','then','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x056c,0x15f));var _0xc056=function(_0x12f6ba,_0xdad761){_0x12f6ba=_0x12f6ba-0x0;var _0x4252f7=_0x056c[_0x12f6ba];return _0x4252f7;};'use strict';var _=require(_0xc056('0x0'));var util=require(_0xc056('0x1'));var moment=require(_0xc056('0x2'));var BPromise=require('bluebird');var rs=require(_0xc056('0x3'));var fs=require('fs');var Redis=require(_0xc056('0x4'));var db=require(_0xc056('0x5'))['db'];var utils=require(_0xc056('0x6'));var logger=require(_0xc056('0x7'))(_0xc056('0x8'));var config=require(_0xc056('0x9'));var jayson=require(_0xc056('0xa'));var client=jayson[_0xc056('0xb')][_0xc056('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc056('0xd')],{'host':_0xc056('0xe'),'port':0x18eb});var socket=require(_0xc056('0xf'))(new Redis(config[_0xc056('0xd')]));require('./smsInteraction.socket')[_0xc056('0x10')](socket);function respondWithRpcPromise(_0x52c553,_0x521591,_0x3b7022){return new BPromise(function(_0x275b35,_0x29b17b){return client[_0xc056('0x11')](_0x52c553,_0x3b7022)['then'](function(_0x2949a7){logger[_0xc056('0x12')](_0xc056('0x13'),_0x521591,_0xc056('0x14'));logger[_0xc056('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x521591,_0xc056('0x14'),JSON[_0xc056('0x16')](_0x2949a7));if(_0x2949a7[_0xc056('0x17')]){if(_0x2949a7[_0xc056('0x17')][_0xc056('0x18')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x521591,_0x2949a7[_0xc056('0x17')][_0xc056('0x19')]);return _0x29b17b(_0x2949a7[_0xc056('0x17')][_0xc056('0x19')]);}logger['error'](_0xc056('0x13'),_0x521591,_0x2949a7[_0xc056('0x17')][_0xc056('0x19')]);return _0x275b35(_0x2949a7[_0xc056('0x17')][_0xc056('0x19')]);}else{logger[_0xc056('0x12')](_0xc056('0x13'),_0x521591,_0xc056('0x14'));_0x275b35(_0x2949a7[_0xc056('0x1a')][_0xc056('0x19')]);}})[_0xc056('0x1b')](function(_0x4b4386){logger['error'](_0xc056('0x13'),_0x521591,_0x4b4386);_0x29b17b(_0x4b4386);});});}exports[_0xc056('0x1c')]=function(_0x3c4def){var _0x3994a5=this;return new Promise(function(_0xee459f,_0x28628c){return db['SmsInteraction'][_0xc056('0x1d')](_0x3c4def[_0xc056('0x1e')],{'raw':_0x3c4def['options']?_0x3c4def['options'][_0xc056('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c4def[_0xc056('0x20')]?_0x3c4def['options'][_0xc056('0x21')]||null:null,'attributes':_0x3c4def[_0xc056('0x20')]?_0x3c4def['options'][_0xc056('0x22')]||null:null,'limit':_0x3c4def[_0xc056('0x20')]?_0x3c4def[_0xc056('0x20')][_0xc056('0x23')]||null:null})[_0xc056('0x24')](function(_0x28d8db){logger[_0xc056('0x12')]('UpdateSmsInteraction',_0x3c4def);logger[_0xc056('0x15')]('UpdateSmsInteraction',_0x3c4def,JSON[_0xc056('0x16')](_0x28d8db));_0xee459f(_0x28d8db);})['catch'](function(_0x4d0d18){logger[_0xc056('0x17')]('UpdateSmsInteraction',_0x4d0d18[_0xc056('0x19')],_0x3c4def);_0x28628c(_0x3994a5['error'](0x1f4,_0x4d0d18[_0xc056('0x19')]));});});};exports[_0xc056('0x25')]=function(_0x4f43e9){return new Promise(function(_0x5b1b75,_0x56d33e){return db['SmsInteraction'][_0xc056('0x26')]({'where':_0x4f43e9['options']?_0x4f43e9[_0xc056('0x20')][_0xc056('0x21')]||null:null})['then'](function(_0x4635f0){if(_0x4635f0){return _0x4635f0[_0xc056('0x27')](_0x4f43e9[_0xc056('0x1e')][_0xc056('0x28')],_[_0xc056('0x29')](_0x4f43e9[_0xc056('0x1e')],[_0xc056('0x28'),'id'])||{});}})[_0xc056('0x2a')](function(_0x225752){logger['info'](_0xc056('0x2b'),_0x4f43e9);logger[_0xc056('0x15')](_0xc056('0x2b'),_0x4f43e9,JSON[_0xc056('0x16')](_0x225752));_0x5b1b75(_0x225752);})[_0xc056('0x1b')](function(_0x6b5ce3){logger[_0xc056('0x17')]('AddTags',_0x6b5ce3[_0xc056('0x19')],_0x4f43e9);_0x56d33e(_this['error'](0x1f4,_0x6b5ce3['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 23b1903..49b5f97 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 _0xdbca=['./smsInteraction.events','remove','update','emit','register','length','smsInteraction:'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdbca,0x150));var _0xadbc=function(_0x467e9e,_0x4a6888){_0x467e9e=_0x467e9e-0x0;var _0x10376a=_0xdbca[_0x467e9e];return _0x10376a;};'use strict';var SmsInteractionEvents=require(_0xadbc('0x0'));var events=['save',_0xadbc('0x1'),_0xadbc('0x2')];function createListener(_0x3e3568,_0x103c40){return function(_0x139099){_0x103c40[_0xadbc('0x3')](_0x3e3568,_0x139099);};}function removeListener(_0x581d88,_0x2cc611){return function(){SmsInteractionEvents['removeListener'](_0x581d88,_0x2cc611);};}exports[_0xadbc('0x4')]=function(_0x303756){for(var _0x360b5b=0x0,_0x2b6300=events[_0xadbc('0x5')];_0x360b5b<_0x2b6300;_0x360b5b++){var _0x39ad6b=events[_0x360b5b];var _0xf8de82=createListener(_0xadbc('0x6')+_0x39ad6b,_0x303756);SmsInteractionEvents['on'](_0x39ad6b,_0xf8de82);}}; \ No newline at end of file +var _0xe83a=['remove','removeListener','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x2ce051,_0x281cb8){var _0x11ec30=function(_0x5cd305){while(--_0x5cd305){_0x2ce051['push'](_0x2ce051['shift']());}};_0x11ec30(++_0x281cb8);}(_0xe83a,0x19d));var _0xae83=function(_0x2d518,_0x61c0e9){_0x2d518=_0x2d518-0x0;var _0xdc2ee7=_0xe83a[_0x2d518];return _0xdc2ee7;};'use strict';var SmsInteractionEvents=require(_0xae83('0x0'));var events=['save',_0xae83('0x1'),'update'];function createListener(_0x579302,_0xcfbedd){return function(_0x49d814){_0xcfbedd['emit'](_0x579302,_0x49d814);};}function removeListener(_0x2f7aff,_0x3f912c){return function(){SmsInteractionEvents[_0xae83('0x2')](_0x2f7aff,_0x3f912c);};}exports[_0xae83('0x3')]=function(_0x1b6998){for(var _0x263c9e=0x0,_0x26f383=events[_0xae83('0x4')];_0x263c9e<_0x26f383;_0x263c9e++){var _0x27f469=events[_0x263c9e];var _0x543ebe=createListener(_0xae83('0x5')+_0x27f469,_0x1b6998);SmsInteractionEvents['on'](_0x27f469,_0x543ebe);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 83058f5..8f4bd69 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 _0x98fa=['/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index'];(function(_0x1d6688,_0x1e887d){var _0xb94e97=function(_0x3658cd){while(--_0x3658cd){_0x1d6688['push'](_0x1d6688['shift']());}};_0xb94e97(++_0x1e887d);}(_0x98fa,0x148));var _0xa98f=function(_0x437536,_0x923c6e){_0x437536=_0x437536-0x0;var _0x518a23=_0x98fa[_0x437536];return _0x518a23;};'use strict';var multer=require(_0xa98f('0x0'));var util=require(_0xa98f('0x1'));var path=require(_0xa98f('0x2'));var timeout=require(_0xa98f('0x3'));var express=require(_0xa98f('0x4'));var router=express[_0xa98f('0x5')]();var auth=require(_0xa98f('0x6'));var interaction=require(_0xa98f('0x7'));var config=require(_0xa98f('0x8'));var controller=require(_0xa98f('0x9'));router[_0xa98f('0xa')]('/',auth[_0xa98f('0xb')](),controller[_0xa98f('0xc')]);router[_0xa98f('0xa')](_0xa98f('0xd'),auth['isAuthenticated'](),controller[_0xa98f('0xe')]);router[_0xa98f('0xa')](_0xa98f('0xf'),auth[_0xa98f('0xb')](),controller[_0xa98f('0x10')]);router[_0xa98f('0x11')]('/',auth['isAuthenticated'](),interaction[_0xa98f('0x12')](_0xa98f('0x13'),_0xa98f('0x14')),controller[_0xa98f('0x15')]);router[_0xa98f('0x11')](_0xa98f('0x16'),controller[_0xa98f('0x17')]);router[_0xa98f('0x18')]('/:id',auth[_0xa98f('0xb')](),controller['update']);router[_0xa98f('0x18')](_0xa98f('0x19'),auth[_0xa98f('0xb')](),controller[_0xa98f('0x1a')]);router[_0xa98f('0x18')](_0xa98f('0x1b'),auth['isAuthenticated'](),controller[_0xa98f('0x1c')]);router['delete'](_0xa98f('0xf'),auth[_0xa98f('0xb')](),controller[_0xa98f('0x1d')]);module[_0xa98f('0x1e')]=router; \ No newline at end of file +var _0x3cb4=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','sms','smsmessage:create','create','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3cd91d,_0x163516){var _0x3b4fab=function(_0x1b3319){while(--_0x1b3319){_0x3cd91d['push'](_0x3cd91d['shift']());}};_0x3b4fab(++_0x163516);}(_0x3cb4,0x1f1));var _0x43cb=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x3cb4[_0x1d9aa0];return _0x226868;};'use strict';var multer=require('multer');var util=require(_0x43cb('0x0'));var path=require(_0x43cb('0x1'));var timeout=require(_0x43cb('0x2'));var express=require(_0x43cb('0x3'));var router=express[_0x43cb('0x4')]();var auth=require(_0x43cb('0x5'));var interaction=require(_0x43cb('0x6'));var config=require(_0x43cb('0x7'));var controller=require('./smsMessage.controller');router[_0x43cb('0x8')]('/',auth[_0x43cb('0x9')](),controller[_0x43cb('0xa')]);router['get'](_0x43cb('0xb'),auth[_0x43cb('0x9')](),controller[_0x43cb('0xc')]);router['get'](_0x43cb('0xd'),auth[_0x43cb('0x9')](),controller[_0x43cb('0xe')]);router[_0x43cb('0xf')]('/',auth[_0x43cb('0x9')](),interaction['tracked'](_0x43cb('0x10'),_0x43cb('0x11')),controller[_0x43cb('0x12')]);router['post']('/:id/status',controller[_0x43cb('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x43cb('0x14')](_0x43cb('0x15'),auth[_0x43cb('0x9')](),controller[_0x43cb('0x16')]);router[_0x43cb('0x14')](_0x43cb('0x17'),auth[_0x43cb('0x9')](),controller[_0x43cb('0x18')]);router[_0x43cb('0x19')](_0x43cb('0xd'),auth[_0x43cb('0x9')](),controller[_0x43cb('0x1a')]);module[_0x43cb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 7f1f58f..6b745a6 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 _0x535f=['exports','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x4f4cf6,_0x6bad5b){var _0x5eadca=function(_0x3945f0){while(--_0x3945f0){_0x4f4cf6['push'](_0x4f4cf6['shift']());}};_0x5eadca(++_0x6bad5b);}(_0x535f,0x111));var _0xf535=function(_0xda85ab,_0x36ca19){_0xda85ab=_0xda85ab-0x0;var _0x61c4bd=_0x535f[_0xda85ab];return _0x61c4bd;};'use strict';var Sequelize=require('sequelize');module[_0xf535('0x0')]={'body':{'type':Sequelize[_0xf535('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf535('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf535('0x3')]('in',_0xf535('0x4')),'defaultValue':_0xf535('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xf535('0x5')]},'readAt':{'type':Sequelize[_0xf535('0x6')]},'secret':{'type':Sequelize[_0xf535('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x34f2=['STRING','DATE','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0x34f2,0x15a));var _0x234f=function(_0x3112dd,_0x1e5535){_0x3112dd=_0x3112dd-0x0;var _0x1fe776=_0x34f2[_0x3112dd];return _0x1fe776;};'use strict';var Sequelize=require(_0x234f('0x0'));module[_0x234f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x234f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x234f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x234f('0x4')]('in',_0x234f('0x5')),'defaultValue':_0x234f('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x234f('0x6')](0xbe)},'phone':{'type':Sequelize[_0x234f('0x6')]},'readAt':{'type':Sequelize[_0x234f('0x7')]},'secret':{'type':Sequelize[_0x234f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index ddd7a58..a3c2879 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 _0x5fab=['count','offset','limit','set','Content-Range','apply','reject','save','end','name','index','SmsMessage','filters','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','length','find','create','body','update','destroy','describe','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','sms-interactions','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','type','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','MessageUUID','indexOf','sent','delivered','Status','plivio','results','groupName','DELIVERED','infobip','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json'];(function(_0x4fa3d2,_0x1bb8db){var _0x1ea3fd=function(_0x4d832e){while(--_0x4d832e){_0x4fa3d2['push'](_0x4fa3d2['shift']());}};_0x1ea3fd(++_0x1bb8db);}(_0x5fab,0x177));var _0xb5fa=function(_0x2f0b82,_0xa07e26){_0x2f0b82=_0x2f0b82-0x0;var _0x5d6fb1=_0x5fab[_0x2f0b82];return _0x5d6fb1;};'use strict';var pdf=require(_0xb5fa('0x0'));var emlformat=require(_0xb5fa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb5fa('0x2'));var jsonpatch=require(_0xb5fa('0x3'));var rp=require(_0xb5fa('0x4'));var moment=require(_0xb5fa('0x5'));var BPromise=require(_0xb5fa('0x6'));var Mustache=require(_0xb5fa('0x7'));var util=require(_0xb5fa('0x8'));var path=require(_0xb5fa('0x9'));var sox=require(_0xb5fa('0xa'));var csv=require(_0xb5fa('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xb'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xb5fa('0x11'));var qs=require(_0xb5fa('0x12'));var logger=require(_0xb5fa('0x13'))(_0xb5fa('0x14'));var utils=require(_0xb5fa('0x15'));var config=require(_0xb5fa('0x16'));var db=require(_0xb5fa('0x17'))['db'];config[_0xb5fa('0x18')]=_[_0xb5fa('0x19')](config['redis'],{'host':_0xb5fa('0x1a'),'port':0x18eb});var socket=require(_0xb5fa('0x1b'))(new Redis(config['redis']));require(_0xb5fa('0x1c'))['register'](socket);var jayson=require(_0xb5fa('0x1d'));var client=jayson[_0xb5fa('0x1e')][_0xb5fa('0x1f')]({'port':0x232c});var client9002=jayson[_0xb5fa('0x1e')][_0xb5fa('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5371cf,_0x567f31,_0x38e964,_0x587043){return new BPromise(function(_0x31f252,_0x27c8f7){var _0x56fe10=_0x587043||client;return _0x56fe10['request'](_0x5371cf,_0x38e964)[_0xb5fa('0x20')](function(_0x1f7f05){logger[_0xb5fa('0x21')](_0xb5fa('0x22'),_0x567f31,_0xb5fa('0x23'));logger[_0xb5fa('0x24')](_0xb5fa('0x25'),_0x567f31,_0xb5fa('0x23'),JSON[_0xb5fa('0x26')](_0x1f7f05));if(_0x1f7f05[_0xb5fa('0x27')]){if(_0x1f7f05[_0xb5fa('0x27')][_0xb5fa('0x28')]===0x1f4){logger['error'](_0xb5fa('0x22'),_0x567f31,_0x1f7f05['error'][_0xb5fa('0x29')]);return _0x27c8f7(_0x1f7f05['error'][_0xb5fa('0x29')]);}logger[_0xb5fa('0x27')]('SmsMessage,\x20%s,\x20%s',_0x567f31,_0x1f7f05[_0xb5fa('0x27')][_0xb5fa('0x29')]);return _0x31f252(_0x1f7f05[_0xb5fa('0x27')]['message']);}else{logger[_0xb5fa('0x21')](_0xb5fa('0x22'),_0x567f31,_0xb5fa('0x23'));_0x31f252(_0x1f7f05['result'][_0xb5fa('0x29')]);}})['catch'](function(_0x106c4b){logger[_0xb5fa('0x27')](_0xb5fa('0x22'),_0x567f31,_0x106c4b);_0x27c8f7(_0x106c4b);});});}function respondWithStatusCode(_0x543edf,_0x2dbd22){_0x2dbd22=_0x2dbd22||0xcc;return function(_0x3f61cd){if(_0x3f61cd){return _0x543edf[_0xb5fa('0x2a')](_0x2dbd22);}return _0x543edf[_0xb5fa('0x2b')](_0x2dbd22)['end']();};}function respondWithResult(_0x4ec294,_0x5bdf11){_0x5bdf11=_0x5bdf11||0xc8;return function(_0x5a1c39){if(_0x5a1c39){return _0x4ec294[_0xb5fa('0x2b')](_0x5bdf11)[_0xb5fa('0x2c')](_0x5a1c39);}};}function respondWithFilteredResult(_0x12c0d4,_0x2bdf50){return function(_0x534884){if(_0x534884){var _0x3506a4=_0x534884[_0xb5fa('0x2d')],_0x358549=_0x2bdf50[_0xb5fa('0x2e')],_0x353314=_0x2bdf50[_0xb5fa('0x2e')]+_0x2bdf50[_0xb5fa('0x2f')],_0x409af9;if(_0x353314>=_0x3506a4){_0x353314=_0x3506a4;_0x409af9=0xc8;}else{_0x409af9=0xce;}_0x12c0d4[_0xb5fa('0x2b')](_0x409af9);return _0x12c0d4[_0xb5fa('0x30')](_0xb5fa('0x31'),_0x358549+'-'+_0x353314+'/'+_0x3506a4)[_0xb5fa('0x2c')](_0x534884);}return null;};}function patchUpdates(_0x3fd1fb){return function(_0x21fc7e){try{jsonpatch[_0xb5fa('0x32')](_0x21fc7e,_0x3fd1fb,!![]);}catch(_0x291938){return BPromise[_0xb5fa('0x33')](_0x291938);}return _0x21fc7e[_0xb5fa('0x34')]();};}function saveUpdates(_0x25fc7c,_0x4cba5a){return function(_0x2cc6cb){if(_0x2cc6cb){return _0x2cc6cb['update'](_0x25fc7c)['then'](function(_0x558708){return _0x558708;});}return null;};}function removeEntity(_0x1e6ba0,_0x502d57){return function(_0x3bb4de){if(_0x3bb4de){return _0x3bb4de['destroy']()['then'](function(){_0x1e6ba0[_0xb5fa('0x2b')](0xcc)[_0xb5fa('0x35')]();});}};}function handleEntityNotFound(_0x4a4bff,_0x59f41d){return function(_0x3d73c2){if(!_0x3d73c2){_0x4a4bff[_0xb5fa('0x2a')](0x194);}return _0x3d73c2;};}function handleError(_0x252421,_0x560b53){_0x560b53=_0x560b53||0x1f4;return function(_0xc9adee){logger[_0xb5fa('0x27')](_0xc9adee['stack']);if(_0xc9adee[_0xb5fa('0x36')]){delete _0xc9adee[_0xb5fa('0x36')];}_0x252421[_0xb5fa('0x2b')](_0x560b53)['send'](_0xc9adee);};}exports[_0xb5fa('0x37')]=function(_0x2c950e,_0x24ef11){var _0x55bdb7={},_0x117694={},_0x1c818f={'count':0x0,'rows':[]};var _0x1a4697=db[_0xb5fa('0x38')]['rawAttributes'];_0x117694['model']=_['keys'](_0x1a4697);_0x117694['query']=_['keys'](_0x2c950e['query']);_0x117694[_0xb5fa('0x39')]=_['intersection'](_0x117694[_0xb5fa('0x3a')],_0x117694[_0xb5fa('0x3b')]);_0x55bdb7[_0xb5fa('0x3c')]=_[_0xb5fa('0x3d')](_0x117694[_0xb5fa('0x3a')],qs[_0xb5fa('0x3e')](_0x2c950e['query']['fields']));_0x55bdb7['attributes']=_0x55bdb7[_0xb5fa('0x3c')]['length']?_0x55bdb7[_0xb5fa('0x3c')]:_0x117694['model'];if(!_0x2c950e['query'][_0xb5fa('0x3f')](_0xb5fa('0x40'))){_0x55bdb7[_0xb5fa('0x2f')]=qs[_0xb5fa('0x2f')](_0x2c950e[_0xb5fa('0x3b')][_0xb5fa('0x2f')]);_0x55bdb7[_0xb5fa('0x2e')]=qs[_0xb5fa('0x2e')](_0x2c950e[_0xb5fa('0x3b')][_0xb5fa('0x2e')]);}_0x55bdb7['order']=qs[_0xb5fa('0x41')](_0x2c950e['query'][_0xb5fa('0x41')]);_0x55bdb7[_0xb5fa('0x42')]=qs[_0xb5fa('0x39')](_[_0xb5fa('0x43')](_0x2c950e[_0xb5fa('0x3b')],_0x117694[_0xb5fa('0x39')]));if(_0x2c950e[_0xb5fa('0x3b')][_0xb5fa('0x44')]){_0x55bdb7['where']=_[_0xb5fa('0x45')](_0x55bdb7[_0xb5fa('0x42')],{'$or':_['map'](_0x1a4697,function(_0x293c19){if(_0x293c19['type'][_0xb5fa('0x46')]!==_0xb5fa('0x47')){var _0x50ae83={};_0x50ae83[_0x293c19['field']]={'$like':'%'+_0x2c950e[_0xb5fa('0x3b')][_0xb5fa('0x44')]+'%'};return _0x50ae83;}})});}_0x55bdb7=_[_0xb5fa('0x45')]({},_0x55bdb7,_0x2c950e[_0xb5fa('0x48')]);var _0x430f46={'where':_0x55bdb7[_0xb5fa('0x42')]};return db[_0xb5fa('0x38')][_0xb5fa('0x2d')](_0x430f46)['then'](function(_0x13bf04){_0x1c818f[_0xb5fa('0x2d')]=_0x13bf04;if(_0x2c950e['query'][_0xb5fa('0x49')]){_0x55bdb7[_0xb5fa('0x4a')]=[{'all':!![]}];}return db[_0xb5fa('0x38')][_0xb5fa('0x4b')](_0x55bdb7);})[_0xb5fa('0x20')](function(_0x27d900){_0x1c818f[_0xb5fa('0x4c')]=_0x27d900;return _0x1c818f;})[_0xb5fa('0x20')](respondWithFilteredResult(_0x24ef11,_0x55bdb7))[_0xb5fa('0x4d')](handleError(_0x24ef11,null));};exports[_0xb5fa('0x4e')]=function(_0xfe091,_0x2bafe4){var _0x6ae261={'raw':!![],'where':{'id':_0xfe091[_0xb5fa('0x4f')]['id']}},_0x23be4c={};_0x23be4c[_0xb5fa('0x3a')]=_['keys'](db['SmsMessage'][_0xb5fa('0x50')]);_0x23be4c['query']=_[_0xb5fa('0x51')](_0xfe091[_0xb5fa('0x3b')]);_0x23be4c['filters']=_[_0xb5fa('0x3d')](_0x23be4c[_0xb5fa('0x3a')],_0x23be4c[_0xb5fa('0x3b')]);_0x6ae261[_0xb5fa('0x3c')]=_[_0xb5fa('0x3d')](_0x23be4c[_0xb5fa('0x3a')],qs['fields'](_0xfe091[_0xb5fa('0x3b')]['fields']));_0x6ae261[_0xb5fa('0x3c')]=_0x6ae261[_0xb5fa('0x3c')][_0xb5fa('0x52')]?_0x6ae261['attributes']:_0x23be4c[_0xb5fa('0x3a')];if(_0xfe091[_0xb5fa('0x3b')]['includeAll']){_0x6ae261['include']=[{'all':!![]}];}_0x6ae261=_[_0xb5fa('0x45')]({},_0x6ae261,_0xfe091[_0xb5fa('0x48')]);return db[_0xb5fa('0x38')][_0xb5fa('0x53')](_0x6ae261)[_0xb5fa('0x20')](handleEntityNotFound(_0x2bafe4,null))[_0xb5fa('0x20')](respondWithResult(_0x2bafe4,null))[_0xb5fa('0x4d')](handleError(_0x2bafe4,null));};exports[_0xb5fa('0x54')]=function(_0x1c1f1b,_0x1578e6){return db[_0xb5fa('0x38')][_0xb5fa('0x54')](_0x1c1f1b[_0xb5fa('0x55')],{})[_0xb5fa('0x20')](respondWithResult(_0x1578e6,0xc9))[_0xb5fa('0x4d')](handleError(_0x1578e6,null));};exports[_0xb5fa('0x56')]=function(_0x10830a,_0x24acea){if(_0x10830a['body']['id']){delete _0x10830a[_0xb5fa('0x55')]['id'];}return db[_0xb5fa('0x38')][_0xb5fa('0x53')]({'where':{'id':_0x10830a[_0xb5fa('0x4f')]['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0x24acea,null))[_0xb5fa('0x20')](saveUpdates(_0x10830a[_0xb5fa('0x55')],null))[_0xb5fa('0x20')](respondWithResult(_0x24acea,null))[_0xb5fa('0x4d')](handleError(_0x24acea,null));};exports[_0xb5fa('0x57')]=function(_0x4ea97d,_0x5750d0){return db[_0xb5fa('0x38')][_0xb5fa('0x53')]({'where':{'id':_0x4ea97d[_0xb5fa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5750d0,null))[_0xb5fa('0x20')](removeEntity(_0x5750d0,null))[_0xb5fa('0x4d')](handleError(_0x5750d0,null));};exports[_0xb5fa('0x58')]=function(_0x2e855c,_0x31ab22){return db[_0xb5fa('0x38')][_0xb5fa('0x58')]()['then'](respondWithResult(_0x31ab22,null))[_0xb5fa('0x4d')](handleError(_0x31ab22,null));};var interaction_log=require(_0xb5fa('0x13'))('sms-interactions');exports[_0xb5fa('0x59')]=function(_0x26bc03,_0x540295,_0xd94224){var _0x3ae802={'channel':_0xb5fa('0x5a')};if(_0x26bc03[_0xb5fa('0x55')]['id']){delete _0x26bc03[_0xb5fa('0x55')]['id'];}_0x26bc03[_0xb5fa('0x55')][_0xb5fa('0x5b')]=!![];_0x26bc03[_0xb5fa('0x55')][_0xb5fa('0x5c')]=moment()[_0xb5fa('0x5d')](_0xb5fa('0x5e'));_0x26bc03[_0xb5fa('0x55')][_0xb5fa('0x5f')]=_0x26bc03[_0xb5fa('0x55')][_0xb5fa('0x5f')]||_0x26bc03[_0xb5fa('0x60')]['id'];return db[_0xb5fa('0x38')][_0xb5fa('0x53')]({'where':{'id':_0x26bc03[_0xb5fa('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0xb5fa('0x61')],'as':_0xb5fa('0x62')}]})[_0xb5fa('0x20')](handleEntityNotFound(_0x540295,null))['then'](saveUpdates(_0x26bc03[_0xb5fa('0x55')],null))[_0xb5fa('0x20')](function(_0x43692b){if(_0x43692b){_0x3ae802['message']=_0x43692b[_0xb5fa('0x63')]({'plain':!![]});return db[_0xb5fa('0x64')]['find']({'where':{'id':_0x43692b[_0xb5fa('0x65')]}});}return null;})[_0xb5fa('0x20')](handleEntityNotFound(_0x540295,null))[_0xb5fa('0x20')](function(_0x571bb9){if(_0x571bb9){return _0x571bb9['update']({'UserId':_0x26bc03[_0xb5fa('0x55')][_0xb5fa('0x5f')],'read1stAt':_[_0xb5fa('0x66')](_0x571bb9['read1stAt'])?moment()[_0xb5fa('0x5d')](_0xb5fa('0x5e')):undefined});}return null;})[_0xb5fa('0x20')](function(_0x12b0a2){if(_0x12b0a2){_0x3ae802['interaction']=_0x12b0a2['get']({'plain':!![]});interaction_log['info'](_0xb5fa('0x67'),_0x26bc03[_0xb5fa('0x60')]['id'],_0x26bc03[_0xb5fa('0x60')]['name'],_0x26bc03[_0xb5fa('0x60')][_0xb5fa('0x68')],_0x3ae802[_0xb5fa('0x69')]['id'],_0x26bc03[_0xb5fa('0x55')]?JSON[_0xb5fa('0x26')](_0x26bc03[_0xb5fa('0x55')]):_0xb5fa('0x6a'));return respondWithRpcPromise(_0xb5fa('0x6b'),_0xb5fa('0x6c'),_0x3ae802);}return null;})[_0xb5fa('0x20')](function(_0x3a1db9){if(_0x3a1db9){if(_0x26bc03[_0xb5fa('0x55')][_0xb5fa('0x6d')]){_0x3ae802[_0xb5fa('0x29')][_0xb5fa('0x6e')]=util['format'](_0xb5fa('0x6f'),_0x26bc03['user'][_0xb5fa('0x36')]);_0x3ae802[_0xb5fa('0x29')][_0xb5fa('0x70')]=_0x3ae802[_0xb5fa('0x70')];_0x3ae802[_0xb5fa('0x29')]['event']=_0xb5fa('0x59');return respondWithRpcPromise('EventManager',_0xb5fa('0x71'),{'event':_0xb5fa('0x72'),'message':_0x3ae802[_0xb5fa('0x29')]},client9002)[_0xb5fa('0x20')](function(){return _0x3ae802;});}return _0x3ae802;}return null;})['then'](respondWithResult(_0x540295,null))['catch'](handleError(_0x540295,null));};var interaction_log=require('../../config/logger')(_0xb5fa('0x73'));exports[_0xb5fa('0x33')]=function(_0x421dff,_0x32e329,_0x14bba6){var _0x2f867e={'agent':{},'channel':'sms'};if(_0x421dff[_0xb5fa('0x55')]['id']){delete _0x421dff['body']['id'];}_0x421dff['body'][_0xb5fa('0x5f')]=_0x421dff['body']['UserId']||_0x421dff['user']['id'];_0x2f867e[_0xb5fa('0x74')]['id']=_0x421dff['body'][_0xb5fa('0x5f')];return db[_0xb5fa('0x38')][_0xb5fa('0x53')]({'where':{'id':_0x421dff['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x32e329,null))[_0xb5fa('0x20')](function(_0x2abe24){if(_0x2abe24){_0x2f867e['message']=_0x2abe24[_0xb5fa('0x63')]({'plain':!![]});return db[_0xb5fa('0x64')][_0xb5fa('0x53')]({'where':{'id':_0x2abe24[_0xb5fa('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x32e329,null))[_0xb5fa('0x20')](function(_0x32a7a9){if(_0x32a7a9){_0x2f867e[_0xb5fa('0x69')]=_0x32a7a9[_0xb5fa('0x63')]({'plain':!![]});interaction_log[_0xb5fa('0x21')](_0xb5fa('0x75'),_0x421dff[_0xb5fa('0x60')]['id'],_0x421dff['user'][_0xb5fa('0x36')],_0x421dff['user'][_0xb5fa('0x68')],_0x2f867e[_0xb5fa('0x69')]['id'],_0x421dff['body']?JSON[_0xb5fa('0x26')](_0x421dff[_0xb5fa('0x55')]):_0xb5fa('0x6a'));return respondWithRpcPromise(_0xb5fa('0x76'),_0xb5fa('0x77'),_0x2f867e);}return null;})[_0xb5fa('0x20')](function(_0xcd2a27){if(_0xcd2a27){_0xcd2a27[_0xb5fa('0x29')]['interface']=util[_0xb5fa('0x5d')](_0xb5fa('0x6f'),_0x421dff[_0xb5fa('0x60')][_0xb5fa('0x36')]);_0xcd2a27['message']['channel']=_0x2f867e['channel'];_0xcd2a27['message'][_0xb5fa('0x78')]=_0xb5fa('0x33');respondWithRpcPromise(_0xb5fa('0x71'),_0xb5fa('0x71'),{'event':'rejectmessage','message':_0xcd2a27['message']},client9002);return _0x2f867e;}return null;})[_0xb5fa('0x20')](respondWithResult(_0x32e329,null))['catch'](handleError(_0x32e329,null));};exports[_0xb5fa('0x2b')]=function(_0x35df3c,_0x318001,_0xfbd3ee){if(_0x35df3c['body']['id']){delete _0x35df3c[_0xb5fa('0x55')]['id'];}var _0x5c6b09;return db[_0xb5fa('0x38')][_0xb5fa('0x53')]({'where':{'id':_0x35df3c['params']['id']}})['then'](handleEntityNotFound(_0x318001,null))[_0xb5fa('0x20')](function(_0x3150ac){if(_0x3150ac){_0x5c6b09=_0x3150ac;return db[_0xb5fa('0x79')][_0xb5fa('0x53')]({'where':{'id':_0x3150ac[_0xb5fa('0x7a')]}});}})[_0xb5fa('0x20')](handleEntityNotFound(_0x318001,null))[_0xb5fa('0x20')](function(_0x25b278){if(_0x25b278){logger[_0xb5fa('0x24')](_0xb5fa('0x25'),_0xb5fa('0x2b'),_0xb5fa('0x7b'),_0x25b278[_0xb5fa('0x7c')],util['inspect'](_0x35df3c['body'],{'showHidden':![],'depth':null}));switch(_0x25b278[_0xb5fa('0x7c')]){case'twilio':if(_0x35df3c[_0xb5fa('0x55')][_0xb5fa('0x7d')]&&_0x35df3c['body'][_0xb5fa('0x7d')]===_0x5c6b09[_0xb5fa('0x7e')]){return _0x5c6b09['update']({'read':!![]});}else{logger[_0xb5fa('0x27')](_0xb5fa('0x7f'),'status',_0xb5fa('0x80'),util[_0xb5fa('0x81')](_0x35df3c[_0xb5fa('0x55')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x35df3c['body'][_0xb5fa('0x82')]&&_0x35df3c[_0xb5fa('0x55')][_0xb5fa('0x82')]===_0x5c6b09[_0xb5fa('0x7e')]&&_[_0xb5fa('0x83')]([_0xb5fa('0x84'),_0xb5fa('0x85')],_0x35df3c[_0xb5fa('0x55')][_0xb5fa('0x86')])>=0x0){return _0x5c6b09[_0xb5fa('0x56')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb5fa('0x2b'),_0xb5fa('0x87'),util[_0xb5fa('0x81')](_0x35df3c[_0xb5fa('0x55')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2c93c7=_0x35df3c[_0xb5fa('0x55')][_0xb5fa('0x88')][0x0];if(_0x2c93c7['status'][_0xb5fa('0x89')]===_0xb5fa('0x8a')){return _0x5c6b09[_0xb5fa('0x56')]({'read':!![]});}else{logger[_0xb5fa('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb5fa('0x2b'),_0xb5fa('0x8b'),util[_0xb5fa('0x81')](_0x35df3c[_0xb5fa('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x5c6b09;}})[_0xb5fa('0x20')](respondWithResult(_0x318001,null))[_0xb5fa('0x4d')](handleError(_0x318001,null));}; \ No newline at end of file +var _0x2542=['sendStatus','stack','name','send','index','SmsMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','create','body','destroy','find','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','SmsInteraction','read1stAt','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','channel','EventManager','acceptmessage','agent','SmsInteractionId','interaction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','event','SmsAccount','SmsAccountId','debug','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','plivio','results','groupName','DELIVERED','infobip','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','update'];(function(_0xbb629c,_0x36b5fe){var _0x27e55b=function(_0x7187f6){while(--_0x7187f6){_0xbb629c['push'](_0xbb629c['shift']());}};_0x27e55b(++_0x36b5fe);}(_0x2542,0x169));var _0x2254=function(_0xc105fa,_0x198665){_0xc105fa=_0xc105fa-0x0;var _0x1ed6e5=_0x2542[_0xc105fa];return _0x1ed6e5;};'use strict';var pdf=require(_0x2254('0x0'));var emlformat=require(_0x2254('0x1'));var rimraf=require(_0x2254('0x2'));var zipdir=require(_0x2254('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2254('0x4'));var moment=require('moment');var BPromise=require(_0x2254('0x5'));var Mustache=require(_0x2254('0x6'));var util=require(_0x2254('0x7'));var path=require(_0x2254('0x8'));var sox=require(_0x2254('0x9'));var csv=require('to-csv');var ejs=require(_0x2254('0xa'));var fs=require('fs');var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x10'));var querystring=require(_0x2254('0x11'));var Papa=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var hardwareService=require(_0x2254('0x14'));var Redis=require('ioredis');var qs=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require(_0x2254('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x2254('0x19')]=_[_0x2254('0x1a')](config[_0x2254('0x19')],{'host':_0x2254('0x1b'),'port':0x18eb});var socket=require(_0x2254('0x1c'))(new Redis(config[_0x2254('0x19')]));require('./smsMessage.socket')[_0x2254('0x1d')](socket);var jayson=require(_0x2254('0x1e'));var client=jayson['client'][_0x2254('0x1f')]({'port':0x232c});var client9002=jayson[_0x2254('0x20')][_0x2254('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x145272,_0x26285a,_0xbc5548,_0x50f137){return new BPromise(function(_0x18baf4,_0x57247a){var _0x327d6d=_0x50f137||client;return _0x327d6d[_0x2254('0x21')](_0x145272,_0xbc5548)[_0x2254('0x22')](function(_0x25f8b2){logger[_0x2254('0x23')](_0x2254('0x24'),_0x26285a,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x26285a,_0x2254('0x25'),JSON[_0x2254('0x26')](_0x25f8b2));if(_0x25f8b2[_0x2254('0x27')]){if(_0x25f8b2[_0x2254('0x27')][_0x2254('0x28')]===0x1f4){logger[_0x2254('0x27')]('SmsMessage,\x20%s,\x20%s',_0x26285a,_0x25f8b2[_0x2254('0x27')][_0x2254('0x29')]);return _0x57247a(_0x25f8b2[_0x2254('0x27')]['message']);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x26285a,_0x25f8b2[_0x2254('0x27')][_0x2254('0x29')]);return _0x18baf4(_0x25f8b2[_0x2254('0x27')]['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x26285a,'request\x20sent');_0x18baf4(_0x25f8b2['result']['message']);}})[_0x2254('0x2a')](function(_0x9d6ccf){logger[_0x2254('0x27')](_0x2254('0x24'),_0x26285a,_0x9d6ccf);_0x57247a(_0x9d6ccf);});});}function respondWithStatusCode(_0x13522d,_0x1349c9){_0x1349c9=_0x1349c9||0xcc;return function(_0x51b578){if(_0x51b578){return _0x13522d['sendStatus'](_0x1349c9);}return _0x13522d[_0x2254('0x2b')](_0x1349c9)['end']();};}function respondWithResult(_0x35608a,_0x141dc5){_0x141dc5=_0x141dc5||0xc8;return function(_0x31a543){if(_0x31a543){return _0x35608a[_0x2254('0x2b')](_0x141dc5)[_0x2254('0x2c')](_0x31a543);}};}function respondWithFilteredResult(_0x482688,_0x1a8a0d){return function(_0x2a789b){if(_0x2a789b){var _0x21285d=_0x2a789b[_0x2254('0x2d')],_0x37af8b=_0x1a8a0d[_0x2254('0x2e')],_0x13366a=_0x1a8a0d[_0x2254('0x2e')]+_0x1a8a0d[_0x2254('0x2f')],_0x377c41;if(_0x13366a>=_0x21285d){_0x13366a=_0x21285d;_0x377c41=0xc8;}else{_0x377c41=0xce;}_0x482688[_0x2254('0x2b')](_0x377c41);return _0x482688[_0x2254('0x30')](_0x2254('0x31'),_0x37af8b+'-'+_0x13366a+'/'+_0x21285d)[_0x2254('0x2c')](_0x2a789b);}return null;};}function patchUpdates(_0x4577f4){return function(_0x1b16c8){try{jsonpatch[_0x2254('0x32')](_0x1b16c8,_0x4577f4,!![]);}catch(_0x291894){return BPromise[_0x2254('0x33')](_0x291894);}return _0x1b16c8['save']();};}function saveUpdates(_0xe29526,_0xa39b89){return function(_0x765e8e){if(_0x765e8e){return _0x765e8e[_0x2254('0x34')](_0xe29526)[_0x2254('0x22')](function(_0x1d275b){return _0x1d275b;});}return null;};}function removeEntity(_0x2cfc9c,_0x3ed00e){return function(_0x5b84ce){if(_0x5b84ce){return _0x5b84ce['destroy']()[_0x2254('0x22')](function(){_0x2cfc9c[_0x2254('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x240d4e,_0x135e7c){return function(_0x21df8c){if(!_0x21df8c){_0x240d4e[_0x2254('0x35')](0x194);}return _0x21df8c;};}function handleError(_0x538e7b,_0x4a2df0){_0x4a2df0=_0x4a2df0||0x1f4;return function(_0x20409d){logger['error'](_0x20409d[_0x2254('0x36')]);if(_0x20409d[_0x2254('0x37')]){delete _0x20409d[_0x2254('0x37')];}_0x538e7b[_0x2254('0x2b')](_0x4a2df0)[_0x2254('0x38')](_0x20409d);};}exports[_0x2254('0x39')]=function(_0x198b82,_0x51f235){var _0x3234d4={},_0x192e9f={},_0x32d2ea={'count':0x0,'rows':[]};var _0x275e58=db[_0x2254('0x3a')][_0x2254('0x3b')];_0x192e9f[_0x2254('0x3c')]=_[_0x2254('0x3d')](_0x275e58);_0x192e9f[_0x2254('0x3e')]=_[_0x2254('0x3d')](_0x198b82['query']);_0x192e9f[_0x2254('0x3f')]=_[_0x2254('0x40')](_0x192e9f[_0x2254('0x3c')],_0x192e9f[_0x2254('0x3e')]);_0x3234d4['attributes']=_[_0x2254('0x40')](_0x192e9f[_0x2254('0x3c')],qs[_0x2254('0x41')](_0x198b82[_0x2254('0x3e')][_0x2254('0x41')]));_0x3234d4[_0x2254('0x42')]=_0x3234d4[_0x2254('0x42')][_0x2254('0x43')]?_0x3234d4['attributes']:_0x192e9f[_0x2254('0x3c')];if(!_0x198b82['query'][_0x2254('0x44')](_0x2254('0x45'))){_0x3234d4[_0x2254('0x2f')]=qs[_0x2254('0x2f')](_0x198b82[_0x2254('0x3e')][_0x2254('0x2f')]);_0x3234d4[_0x2254('0x2e')]=qs['offset'](_0x198b82[_0x2254('0x3e')][_0x2254('0x2e')]);}_0x3234d4[_0x2254('0x46')]=qs[_0x2254('0x47')](_0x198b82[_0x2254('0x3e')]['sort']);_0x3234d4[_0x2254('0x48')]=qs[_0x2254('0x3f')](_[_0x2254('0x49')](_0x198b82[_0x2254('0x3e')],_0x192e9f[_0x2254('0x3f')]));if(_0x198b82['query'][_0x2254('0x4a')]){_0x3234d4['where']=_[_0x2254('0x4b')](_0x3234d4[_0x2254('0x48')],{'$or':_[_0x2254('0x4c')](_0x275e58,function(_0x31c31e){if(_0x31c31e[_0x2254('0x4d')][_0x2254('0x4e')]!==_0x2254('0x4f')){var _0x132ef2={};_0x132ef2[_0x31c31e[_0x2254('0x50')]]={'$like':'%'+_0x198b82[_0x2254('0x3e')][_0x2254('0x4a')]+'%'};return _0x132ef2;}})});}_0x3234d4=_[_0x2254('0x4b')]({},_0x3234d4,_0x198b82[_0x2254('0x51')]);var _0x4a2e6d={'where':_0x3234d4[_0x2254('0x48')]};return db[_0x2254('0x3a')][_0x2254('0x2d')](_0x4a2e6d)['then'](function(_0x94f5be){_0x32d2ea[_0x2254('0x2d')]=_0x94f5be;if(_0x198b82[_0x2254('0x3e')][_0x2254('0x52')]){_0x3234d4[_0x2254('0x53')]=[{'all':!![]}];}return db[_0x2254('0x3a')][_0x2254('0x54')](_0x3234d4);})[_0x2254('0x22')](function(_0x27eb3b){_0x32d2ea['rows']=_0x27eb3b;return _0x32d2ea;})[_0x2254('0x22')](respondWithFilteredResult(_0x51f235,_0x3234d4))[_0x2254('0x2a')](handleError(_0x51f235,null));};exports[_0x2254('0x55')]=function(_0x32515f,_0xbbc059){var _0x1a203e={'raw':!![],'where':{'id':_0x32515f[_0x2254('0x56')]['id']}},_0x3396c2={};_0x3396c2[_0x2254('0x3c')]=_[_0x2254('0x3d')](db['SmsMessage'][_0x2254('0x3b')]);_0x3396c2[_0x2254('0x3e')]=_['keys'](_0x32515f[_0x2254('0x3e')]);_0x3396c2[_0x2254('0x3f')]=_[_0x2254('0x40')](_0x3396c2[_0x2254('0x3c')],_0x3396c2['query']);_0x1a203e[_0x2254('0x42')]=_[_0x2254('0x40')](_0x3396c2['model'],qs[_0x2254('0x41')](_0x32515f[_0x2254('0x3e')][_0x2254('0x41')]));_0x1a203e[_0x2254('0x42')]=_0x1a203e['attributes'][_0x2254('0x43')]?_0x1a203e[_0x2254('0x42')]:_0x3396c2[_0x2254('0x3c')];if(_0x32515f['query']['includeAll']){_0x1a203e[_0x2254('0x53')]=[{'all':!![]}];}_0x1a203e=_[_0x2254('0x4b')]({},_0x1a203e,_0x32515f['options']);return db[_0x2254('0x3a')]['find'](_0x1a203e)['then'](handleEntityNotFound(_0xbbc059,null))[_0x2254('0x22')](respondWithResult(_0xbbc059,null))[_0x2254('0x2a')](handleError(_0xbbc059,null));};exports[_0x2254('0x57')]=function(_0x2bfec4,_0x3c6f6c){return db['SmsMessage']['create'](_0x2bfec4[_0x2254('0x58')],{})['then'](respondWithResult(_0x3c6f6c,0xc9))[_0x2254('0x2a')](handleError(_0x3c6f6c,null));};exports[_0x2254('0x34')]=function(_0x20bcc8,_0x2fe9a7){if(_0x20bcc8['body']['id']){delete _0x20bcc8[_0x2254('0x58')]['id'];}return db[_0x2254('0x3a')]['find']({'where':{'id':_0x20bcc8['params']['id']}})[_0x2254('0x22')](handleEntityNotFound(_0x2fe9a7,null))['then'](saveUpdates(_0x20bcc8[_0x2254('0x58')],null))[_0x2254('0x22')](respondWithResult(_0x2fe9a7,null))[_0x2254('0x2a')](handleError(_0x2fe9a7,null));};exports[_0x2254('0x59')]=function(_0x301a12,_0x53f65c){return db['SmsMessage'][_0x2254('0x5a')]({'where':{'id':_0x301a12['params']['id']}})[_0x2254('0x22')](handleEntityNotFound(_0x53f65c,null))['then'](removeEntity(_0x53f65c,null))['catch'](handleError(_0x53f65c,null));};exports['describe']=function(_0x2c0063,_0x448773){return db[_0x2254('0x3a')][_0x2254('0x5b')]()[_0x2254('0x22')](respondWithResult(_0x448773,null))[_0x2254('0x2a')](handleError(_0x448773,null));};var interaction_log=require(_0x2254('0x16'))(_0x2254('0x5c'));exports[_0x2254('0x5d')]=function(_0x40aa48,_0x2e68b5,_0x44cfd9){var _0x41c97d={'channel':_0x2254('0x5e')};if(_0x40aa48[_0x2254('0x58')]['id']){delete _0x40aa48[_0x2254('0x58')]['id'];}_0x40aa48[_0x2254('0x58')][_0x2254('0x5f')]=!![];_0x40aa48[_0x2254('0x58')]['readAt']=moment()[_0x2254('0x60')](_0x2254('0x61'));_0x40aa48[_0x2254('0x58')][_0x2254('0x62')]=_0x40aa48['body']['UserId']||_0x40aa48[_0x2254('0x63')]['id'];return db[_0x2254('0x3a')][_0x2254('0x5a')]({'where':{'id':_0x40aa48[_0x2254('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x2254('0x64')],'as':'Contact'}]})[_0x2254('0x22')](handleEntityNotFound(_0x2e68b5,null))[_0x2254('0x22')](saveUpdates(_0x40aa48[_0x2254('0x58')],null))['then'](function(_0x5ada4c){if(_0x5ada4c){_0x41c97d[_0x2254('0x29')]=_0x5ada4c['get']({'plain':!![]});return db[_0x2254('0x65')][_0x2254('0x5a')]({'where':{'id':_0x5ada4c['SmsInteractionId']}});}return null;})[_0x2254('0x22')](handleEntityNotFound(_0x2e68b5,null))[_0x2254('0x22')](function(_0x4d30a5){if(_0x4d30a5){return _0x4d30a5[_0x2254('0x34')]({'UserId':_0x40aa48[_0x2254('0x58')]['UserId'],'read1stAt':_['isNil'](_0x4d30a5[_0x2254('0x66')])?moment()[_0x2254('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x48406e){if(_0x48406e){_0x41c97d['interaction']=_0x48406e[_0x2254('0x67')]({'plain':!![]});interaction_log['info'](_0x2254('0x68'),_0x40aa48[_0x2254('0x63')]['id'],_0x40aa48[_0x2254('0x63')][_0x2254('0x37')],_0x40aa48['user'][_0x2254('0x69')],_0x41c97d['interaction']['id'],_0x40aa48[_0x2254('0x58')]?JSON[_0x2254('0x26')](_0x40aa48['body']):_0x2254('0x6a'));return respondWithRpcPromise(_0x2254('0x6b'),'acceptMessage',_0x41c97d);}return null;})[_0x2254('0x22')](function(_0x3b3b20){if(_0x3b3b20){if(_0x40aa48[_0x2254('0x58')][_0x2254('0x6c')]){_0x41c97d['message'][_0x2254('0x6d')]=util[_0x2254('0x60')]('SIP/%s',_0x40aa48[_0x2254('0x63')][_0x2254('0x37')]);_0x41c97d['message'][_0x2254('0x6e')]=_0x41c97d['channel'];_0x41c97d[_0x2254('0x29')]['event']=_0x2254('0x5d');return respondWithRpcPromise(_0x2254('0x6f'),'EventManager',{'event':_0x2254('0x70'),'message':_0x41c97d['message']},client9002)[_0x2254('0x22')](function(){return _0x41c97d;});}return _0x41c97d;}return null;})[_0x2254('0x22')](respondWithResult(_0x2e68b5,null))[_0x2254('0x2a')](handleError(_0x2e68b5,null));};var interaction_log=require('../../config/logger')(_0x2254('0x5c'));exports['reject']=function(_0x30966,_0x33f29b,_0x4d4891){var _0x58d475={'agent':{},'channel':_0x2254('0x5e')};if(_0x30966[_0x2254('0x58')]['id']){delete _0x30966[_0x2254('0x58')]['id'];}_0x30966[_0x2254('0x58')]['UserId']=_0x30966[_0x2254('0x58')][_0x2254('0x62')]||_0x30966[_0x2254('0x63')]['id'];_0x58d475[_0x2254('0x71')]['id']=_0x30966['body'][_0x2254('0x62')];return db[_0x2254('0x3a')]['find']({'where':{'id':_0x30966[_0x2254('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x33f29b,null))[_0x2254('0x22')](function(_0x5bb742){if(_0x5bb742){_0x58d475['message']=_0x5bb742['get']({'plain':!![]});return db[_0x2254('0x65')]['find']({'where':{'id':_0x5bb742[_0x2254('0x72')]}});}return null;})[_0x2254('0x22')](handleEntityNotFound(_0x33f29b,null))['then'](function(_0x180e4f){if(_0x180e4f){_0x58d475[_0x2254('0x73')]=_0x180e4f[_0x2254('0x67')]({'plain':!![]});interaction_log[_0x2254('0x23')](_0x2254('0x74'),_0x30966[_0x2254('0x63')]['id'],_0x30966['user']['name'],_0x30966[_0x2254('0x63')][_0x2254('0x69')],_0x58d475[_0x2254('0x73')]['id'],_0x30966[_0x2254('0x58')]?JSON[_0x2254('0x26')](_0x30966[_0x2254('0x58')]):_0x2254('0x6a'));return respondWithRpcPromise(_0x2254('0x75'),_0x2254('0x76'),_0x58d475);}return null;})[_0x2254('0x22')](function(_0x4ddf37){if(_0x4ddf37){_0x4ddf37[_0x2254('0x29')][_0x2254('0x6d')]=util['format'](_0x2254('0x77'),_0x30966['user'][_0x2254('0x37')]);_0x4ddf37[_0x2254('0x29')]['channel']=_0x58d475[_0x2254('0x6e')];_0x4ddf37['message'][_0x2254('0x78')]=_0x2254('0x33');respondWithRpcPromise(_0x2254('0x6f'),_0x2254('0x6f'),{'event':'rejectmessage','message':_0x4ddf37[_0x2254('0x29')]},client9002);return _0x58d475;}return null;})[_0x2254('0x22')](respondWithResult(_0x33f29b,null))[_0x2254('0x2a')](handleError(_0x33f29b,null));};exports[_0x2254('0x2b')]=function(_0x59af45,_0x177f00,_0x480eeb){if(_0x59af45['body']['id']){delete _0x59af45[_0x2254('0x58')]['id'];}var _0x240c68;return db['SmsMessage']['find']({'where':{'id':_0x59af45[_0x2254('0x56')]['id']}})[_0x2254('0x22')](handleEntityNotFound(_0x177f00,null))[_0x2254('0x22')](function(_0x3058d9){if(_0x3058d9){_0x240c68=_0x3058d9;return db[_0x2254('0x79')][_0x2254('0x5a')]({'where':{'id':_0x3058d9[_0x2254('0x7a')]}});}})[_0x2254('0x22')](handleEntityNotFound(_0x177f00,null))[_0x2254('0x22')](function(_0x5df20f){if(_0x5df20f){logger[_0x2254('0x7b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2254('0x2b'),'received\x20delivery\x20report\x20from',_0x5df20f[_0x2254('0x4d')],util[_0x2254('0x7c')](_0x59af45[_0x2254('0x58')],{'showHidden':![],'depth':null}));switch(_0x5df20f['type']){case _0x2254('0x7d'):if(_0x59af45[_0x2254('0x58')][_0x2254('0x7e')]&&_0x59af45[_0x2254('0x58')][_0x2254('0x7e')]===_0x240c68[_0x2254('0x7f')]){return _0x240c68[_0x2254('0x34')]({'read':!![]});}else{logger[_0x2254('0x27')](_0x2254('0x80'),_0x2254('0x2b'),_0x2254('0x7d'),util[_0x2254('0x7c')](_0x59af45[_0x2254('0x58')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x59af45[_0x2254('0x58')]['MessageUUID']&&_0x59af45[_0x2254('0x58')][_0x2254('0x81')]===_0x240c68[_0x2254('0x7f')]&&_[_0x2254('0x82')]([_0x2254('0x83'),_0x2254('0x84')],_0x59af45[_0x2254('0x58')]['Status'])>=0x0){return _0x240c68[_0x2254('0x34')]({'read':!![]});}else{logger['error'](_0x2254('0x80'),'status',_0x2254('0x85'),util[_0x2254('0x7c')](_0x59af45[_0x2254('0x58')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x435bf7=_0x59af45[_0x2254('0x58')][_0x2254('0x86')][0x0];if(_0x435bf7[_0x2254('0x2b')][_0x2254('0x87')]===_0x2254('0x88')){return _0x240c68[_0x2254('0x34')]({'read':!![]});}else{logger[_0x2254('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x2254('0x89'),util['inspect'](_0x59af45[_0x2254('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x240c68;}})[_0x2254('0x22')](respondWithResult(_0x177f00,null))[_0x2254('0x2a')](handleError(_0x177f00,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 5c59239..5038d6e 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 _0xddf7=['update','remove','emit','hasOwnProperty','hook','exports','SmsMessage','save'];(function(_0x52a0ff,_0x332d9e){var _0x372994=function(_0x408e4a){while(--_0x408e4a){_0x52a0ff['push'](_0x52a0ff['shift']());}};_0x372994(++_0x332d9e);}(_0xddf7,0x7e));var _0x7ddf=function(_0x162c18,_0x40f488){_0x162c18=_0x162c18-0x0;var _0x3f22cc=_0xddf7[_0x162c18];return _0x3f22cc;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x7ddf('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7ddf('0x1'),'afterUpdate':_0x7ddf('0x2'),'afterDestroy':_0x7ddf('0x3')};function emitEvent(_0xdfb4d4){return function(_0x107244,_0x157da2,_0x58a406){SmsMessageEvents['emit'](_0xdfb4d4+':'+_0x107244['id'],_0x107244);SmsMessageEvents[_0x7ddf('0x4')](_0xdfb4d4,_0x107244);_0x58a406(null);};}for(var e in events){if(events[_0x7ddf('0x5')](e)){var event=events[e];SmsMessage[_0x7ddf('0x6')](e,emitEvent(event));}}module[_0x7ddf('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0xdd38=['emit','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0xdd38,0xab));var _0x8dd3=function(_0x34db21,_0x4256bb){_0x34db21=_0x34db21-0x0;var _0x5e7d82=_0xdd38[_0x34db21];return _0x5e7d82;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x8dd3('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8dd3('0x1')](0x0);var events={'afterCreate':_0x8dd3('0x2'),'afterUpdate':_0x8dd3('0x3'),'afterDestroy':_0x8dd3('0x4')};function emitEvent(_0x274605){return function(_0x391031,_0x2fa760,_0x27c277){SmsMessageEvents[_0x8dd3('0x5')](_0x274605+':'+_0x391031['id'],_0x391031);SmsMessageEvents[_0x8dd3('0x5')](_0x274605,_0x391031);_0x27c277(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x8dd3('0x6')](e,emitEvent(event));}}module[_0x8dd3('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index fb26ada..7cf722d 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 _0x7e0b=['read','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','format','%s:%s','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','csc','crypto','apiKey','sender','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','./smsMessage.attributes','exports','SmsMessage','messageId','get','direction','toLowerCase','out','secret','SmsInteraction','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','messages','body','phone','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','login?username=','&password=','GET','split','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport'];(function(_0x2b31ad,_0x4f9f32){var _0x2ea20c=function(_0x3acae7){while(--_0x3acae7){_0x2b31ad['push'](_0x2b31ad['shift']());}};_0x2ea20c(++_0x4f9f32);}(_0x7e0b,0x18f));var _0xb7e0=function(_0x17c256,_0x2ca9e4){_0x17c256=_0x17c256-0x0;var _0x594039=_0x7e0b[_0x17c256];return _0x594039;};'use strict';var _=require(_0xb7e0('0x0'));var util=require(_0xb7e0('0x1'));var logger=require(_0xb7e0('0x2'))(_0xb7e0('0x3'));var moment=require('moment');var BPromise=require(_0xb7e0('0x4'));var rp=require('request-promise');var attributes=require(_0xb7e0('0x5'));module[_0xb7e0('0x6')]=function(_0x48732f,_0xa3e222){return _0x48732f['define'](_0xb7e0('0x7'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xb7e0('0x8'),'fields':[_0xb7e0('0x8')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29235d,_0x227f62,_0x22f291){var _0x3ec08c=_0x48732f['models'];var _0x4e5dc6=_0x29235d[_0xb7e0('0x9')]({'plain':!![]});if(_0x4e5dc6[_0xb7e0('0xa')][_0xb7e0('0xb')]()==='in'||_0x4e5dc6[_0xb7e0('0xa')][_0xb7e0('0xb')]()===_0xb7e0('0xc')&&!_0x4e5dc6[_0xb7e0('0xd')]&&!_['isNil'](_0x4e5dc6['UserId'])){_0x3ec08c[_0xb7e0('0xe')]['findOne']({'where':{'id':_0x4e5dc6[_0xb7e0('0xf')]}})[_0xb7e0('0x10')](function(_0x2c3611){if(_0x2c3611){_0x2c3611[_0xb7e0('0x11')]({'lastMsgAt':_0x4e5dc6[_0xb7e0('0x12')],'lastMsgDirection':_0x4e5dc6[_0xb7e0('0xa')][_0xb7e0('0xb')](),'lastMsgBody':_0x4e5dc6['body']});}})[_0xb7e0('0x13')](function(_0x54b573){console[_0xb7e0('0x14')](_0x54b573);});}if(_0x4e5dc6[_0xb7e0('0xa')]===_0xb7e0('0xc')&&!_0x4e5dc6['secret']){var _0x6aafa;_0x3ec08c[_0xb7e0('0x15')]['find']({'where':{'id':_0x4e5dc6[_0xb7e0('0x16')]},'raw':!![]})['then'](function(_0x523551){_0x6aafa=_0x523551;if(_0x6aafa&&_0x6aafa[_0xb7e0('0x17')]){switch(_0x6aafa[_0xb7e0('0x17')]){case _0xb7e0('0x18'):var _0x567c2a=require(_0xb7e0('0x18'));if(_0x6aafa[_0xb7e0('0x19')]&&_0x6aafa[_0xb7e0('0x1a')]&&_0x6aafa['phone']){var _0x50a6f6=new _0x567c2a(_0x6aafa['accountSid'],_0x6aafa[_0xb7e0('0x1a')]);_0x50a6f6[_0xb7e0('0x1b')]['create']({'body':_0x4e5dc6[_0xb7e0('0x1c')],'to':_0x4e5dc6['phone'],'from':_0x6aafa[_0xb7e0('0x1d')],'statusCallback':_0x6aafa[_0xb7e0('0x1e')]+_0xb7e0('0x1f')+_0x4e5dc6['id']+_0xb7e0('0x20')+_0x6aafa[_0xb7e0('0x21')]})[_0xb7e0('0x10')](function(_0x227775){if(_0x227775[_0xb7e0('0x22')]){return _0x29235d['update']({'messageId':_0x227775['sid']});}})[_0xb7e0('0x13')](function(_0xdff07f){logger['error'](_0xb7e0('0x23'),_0xb7e0('0x24'),_0xb7e0('0x18'),util[_0xb7e0('0x25')](_0xdff07f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb7e0('0x23'),_0xb7e0('0x24'),_0xb7e0('0x18'),_0xb7e0('0x26'));}break;case _0xb7e0('0x27'):var _0x255fa3='https://api.skebby.it/API/v1.0/REST/';if(_0x6aafa[_0xb7e0('0x28')]&&_0x6aafa[_0xb7e0('0x29')]){var _0xf9cc23={'recipient':[_0x4e5dc6[_0xb7e0('0x1d')]],'message':_0x4e5dc6[_0xb7e0('0x1c')],'message_type':_0x6aafa[_0xb7e0('0x2a')]};var _0x3e8bf2={'url':_0x255fa3+_0xb7e0('0x2b')+_0x6aafa[_0xb7e0('0x28')]+_0xb7e0('0x2c')+_0x6aafa[_0xb7e0('0x29')],'method':_0xb7e0('0x2d')};rp(_0x3e8bf2)[_0xb7e0('0x10')](function(_0x33e3fa){var _0x3c52b0=_0x33e3fa[_0xb7e0('0x2e')](';');var _0x2b95e2={'user_key':_0x3c52b0[0x0],'session_key':_0x3c52b0[0x1]};_0x3e8bf2={'url':_0x255fa3+'sms','method':_0xb7e0('0x2f'),'headers':{'user_key':_0x2b95e2[_0xb7e0('0x30')],'Session_key':_0x2b95e2[_0xb7e0('0x31')]},'json':!![],'body':_0xf9cc23};return rp(_0x3e8bf2);})['then'](function(_0x52c267){if(_0x52c267[_0xb7e0('0x32')]>=0x1){var _0x25990e={'messageId':_0x52c267[_0xb7e0('0x33')]};if(_0x6aafa[_0xb7e0('0x2a')]!=='GP'||!_0x6aafa[_0xb7e0('0x34')]){_0x25990e[_0xb7e0('0x35')]=!![];}return _0x29235d['update'](_0x25990e);}else{return logger[_0xb7e0('0x14')](_0xb7e0('0x23'),_0xb7e0('0x24'),_0xb7e0('0x27'),util[_0xb7e0('0x25')](_0x52c267,{'showHidden':![],'depth':null}));}})[_0xb7e0('0x13')](function(_0x1eba40){return logger[_0xb7e0('0x14')](_0xb7e0('0x23'),'afterCreate',_0xb7e0('0x27'),util[_0xb7e0('0x25')](_0x1eba40,{'showHidden':![],'depth':null}));});}else{logger[_0xb7e0('0x14')](_0xb7e0('0x23'),_0xb7e0('0x24'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0xb7e0('0x36'):if(_0x6aafa['authToken']){var _0x23f9cc={'recipient':_0x4e5dc6[_0xb7e0('0x1d')],'message':_0x4e5dc6[_0xb7e0('0x1c')],'sender':_0x6aafa[_0xb7e0('0x37')]||_0x6aafa[_0xb7e0('0x1d')],'authorization':_0x6aafa[_0xb7e0('0x1a')]};var _0x227f62={'method':_0xb7e0('0x2f'),'uri':_0xb7e0('0x38'),'body':_0x23f9cc,'json':!![]};rp(_0x227f62)[_0xb7e0('0x10')](function(_0x51253a){var _0x1af45c={'messageId':_0x51253a[_0xb7e0('0x39')]};if(!_0x6aafa[_0xb7e0('0x34')]){_0x1af45c[_0xb7e0('0x35')]=!![];}return _0x29235d[_0xb7e0('0x11')](_0x1af45c);})[_0xb7e0('0x13')](function(_0x4da1a0){logger[_0xb7e0('0x14')](_0xb7e0('0x23'),_0xb7e0('0x24'),_0xb7e0('0x36'),util[_0xb7e0('0x25')](_0x4da1a0,{'showHidden':![],'depth':null}));});}else{logger[_0xb7e0('0x14')](_0xb7e0('0x23'),'afterCreate','connectel',_0xb7e0('0x3a'));}break;case _0xb7e0('0x3b'):if(_0x6aafa[_0xb7e0('0x28')]&&_0x6aafa[_0xb7e0('0x29')]){var _0x23f9cc={'messages':[{'source':_0xb7e0('0x3c'),'to':_0x4e5dc6[_0xb7e0('0x1d')],'body':_0x4e5dc6[_0xb7e0('0x1c')],'from':_0x6aafa[_0xb7e0('0x37')]||_0x6aafa[_0xb7e0('0x1d')]}]};var _0x5ca2cc=util['format']('%s:%s',_0x6aafa['username'],_0x6aafa['password']);var _0x227f62={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x23f9cc,'headers':{'Authorization':util['format'](_0xb7e0('0x3d'),new Buffer(_0x5ca2cc)['toString'](_0xb7e0('0x3e')))},'json':!![]};rp(_0x227f62)['then'](function(_0x532f2e){if(_0x532f2e['http_code']>=0xc8&&_0x532f2e[_0xb7e0('0x3f')]<=0xce){if(_0x532f2e[_0xb7e0('0x40')]&&_0x532f2e[_0xb7e0('0x40')][_0xb7e0('0x41')]>0x0){var _0x29b336=_[_0xb7e0('0x42')](_0x532f2e[_0xb7e0('0x40')]['messages']);var _0x49651b={'messageId':_0x29b336[_0xb7e0('0x43')]};if(!_0x6aafa[_0xb7e0('0x34')]){_0x49651b[_0xb7e0('0x35')]=!![];}return _0x29235d[_0xb7e0('0x11')](_0x49651b);}else{logger[_0xb7e0('0x14')](_0xb7e0('0x23'),'afterCreate',_0xb7e0('0x44'),util[_0xb7e0('0x25')](_0x532f2e,{'showHidden':![],'depth':null}));}}else{logger[_0xb7e0('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb7e0('0x24'),_0xb7e0('0x44'),util[_0xb7e0('0x25')](_0x532f2e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x24fff4){logger[_0xb7e0('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util[_0xb7e0('0x25')](_0x24fff4,{'showHidden':![],'depth':null}));});}else{logger[_0xb7e0('0x14')](_0xb7e0('0x23'),'afterCreate','clickSend',_0xb7e0('0x45'));}break;case _0xb7e0('0x46'):if(_0x6aafa['authId']&&_0x6aafa[_0xb7e0('0x1a')]){var _0x23f9cc={'dst':_0x4e5dc6[_0xb7e0('0x1d')],'text':_0x4e5dc6[_0xb7e0('0x1c')],'src':_0x6aafa['senderString']||_0x6aafa[_0xb7e0('0x1d')],'url':_0x6aafa[_0xb7e0('0x1e')]+_0xb7e0('0x1f')+_0x4e5dc6['id']+'/status?token='+_0x6aafa[_0xb7e0('0x21')]};var _0x5ca2cc=util[_0xb7e0('0x47')](_0xb7e0('0x48'),_0x6aafa[_0xb7e0('0x49')],_0x6aafa[_0xb7e0('0x1a')]);var _0x227f62={'method':_0xb7e0('0x2f'),'uri':util[_0xb7e0('0x47')](_0xb7e0('0x4a'),_0x6aafa[_0xb7e0('0x49')]),'body':_0x23f9cc,'headers':{'Authorization':util[_0xb7e0('0x47')](_0xb7e0('0x3d'),new Buffer(_0x5ca2cc)[_0xb7e0('0x4b')](_0xb7e0('0x3e')))},'json':!![]};rp(_0x227f62)['then'](function(_0x1f56c8){var _0x318d26={'messageId':_0x1f56c8[_0xb7e0('0x4c')][0x0]};return _0x29235d[_0xb7e0('0x11')](_0x318d26);})[_0xb7e0('0x13')](function(_0x1056fa){logger[_0xb7e0('0x14')](_0xb7e0('0x23'),'afterCreate',_0xb7e0('0x46'),util[_0xb7e0('0x25')](_0x1056fa,{'showHidden':![],'depth':null}));});}else{logger[_0xb7e0('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',_0xb7e0('0x4d'));}break;case _0xb7e0('0x4e'):if(_0x6aafa[_0xb7e0('0x28')]&&_0x6aafa['password']){if(_0x6aafa[_0xb7e0('0x4f')]){var _0xd65261={'method':_0xb7e0('0x2f'),'uri':_0x6aafa[_0xb7e0('0x4f')]+_0xb7e0('0x50'),'body':{'username':_0x6aafa['username'],'password':_0x6aafa[_0xb7e0('0x29')]},'json':!![]};return rp(_0xd65261)['then'](function(_0x2369df){var _0x320f0c={'method':'POST','uri':_0x6aafa['baseUrl']+_0xb7e0('0x51'),'body':{'messages':[{'from':_0x6aafa[_0xb7e0('0x1d')],'destinations':[{'to':_0x4e5dc6['phone']}],'text':_0x4e5dc6['body'],'notifyUrl':_0x6aafa['remote']+'/api/sms/messages/'+_0x4e5dc6['id']+_0xb7e0('0x20')+_0x6aafa[_0xb7e0('0x21')],'notifyContentType':_0xb7e0('0x52'),'callbackData':_0x6aafa[_0xb7e0('0x1d')]+';'+_0x4e5dc6['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x2369df['token']},'json':!![]};return rp(_0x320f0c)[_0xb7e0('0x10')](function(_0x4244ae){if(_0x4244ae[_0xb7e0('0x1b')]){var _0x40d0a8={'messageId':_0x4244ae[_0xb7e0('0x1b')][0x0][_0xb7e0('0x8')]};if(!_0x6aafa['deliveryReport']){_0x40d0a8[_0xb7e0('0x35')]=!![];}return _0x29235d[_0xb7e0('0x11')](_0x40d0a8);}else{return logger['error'](_0xb7e0('0x23'),_0xb7e0('0x24'),_0xb7e0('0x4e'),util[_0xb7e0('0x25')](_0x4244ae,{'showHidden':![],'depth':null}));}});})[_0xb7e0('0x13')](function(_0x468230){return logger['error'](_0xb7e0('0x23'),'afterCreate','infobip',util[_0xb7e0('0x25')](_0x468230,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb7e0('0x23'),_0xb7e0('0x24'),_0xb7e0('0x4e'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0xb7e0('0x23'),'afterCreate',_0xb7e0('0x4e'),_0xb7e0('0x45'));}case _0xb7e0('0x53'):var _0x487b5a=require(_0xb7e0('0x54'));if(_0x6aafa[_0xb7e0('0x55')]){var _0x2e023c={};_0x2e023c['login']=_0x6aafa['username'];_0x2e023c[_0xb7e0('0x1d')]=_0x4e5dc6[_0xb7e0('0x1d')];_0x2e023c[_0xb7e0('0x56')]=_0x6aafa[_0xb7e0('0x1d')];_0x2e023c['text']=_0x4e5dc6[_0xb7e0('0x1c')];_0x2e023c[_0xb7e0('0x57')]=+new Date();var _0x3462e9='';var _0x9d894e='';var _0x2b61f9=Object[_0xb7e0('0x58')](_0x2e023c);_0x2b61f9[_0xb7e0('0x59')]();for(var _0x4c85ff=0x0;_0x4c85ff<_0x2b61f9[_0xb7e0('0x5a')];_0x4c85ff++){if(_0x3462e9!=''){_0x3462e9+='&';}_0x3462e9+=_0x2b61f9[_0x4c85ff]+'='+encodeURIComponent(_0x2e023c[_0x2b61f9[_0x4c85ff]]);_0x9d894e+=_0x2e023c[_0x2b61f9[_0x4c85ff]];}_0x9d894e+=_0x6aafa[_0xb7e0('0x55')];_0x9d894e=_0x487b5a[_0xb7e0('0x5b')](_0xb7e0('0x5c'))[_0xb7e0('0x11')](_0x9d894e)[_0xb7e0('0x5d')](_0xb7e0('0x5e'));if(_0x3462e9!==''){_0x3462e9+='&';}_0x3462e9+=_0xb7e0('0x5f')+_0x9d894e;var _0x3e8bf2={'method':_0xb7e0('0x2d'),'uri':_0xb7e0('0x60')+_0x3462e9,'json':!![]};return rp(_0x3e8bf2)[_0xb7e0('0x10')](function(_0x560dd4){var _0x3c2887=Object[_0xb7e0('0x58')](_0x560dd4);if(_0x560dd4[_0x3c2887[0x0]][_0xb7e0('0x14')]&&parseInt(_0x560dd4[_0x3c2887[0x0]][_0xb7e0('0x14')])===0x0){var _0x48a707={'messageId':_0x560dd4[_0x3c2887[0x0]][_0xb7e0('0x61')]};if(!_0x6aafa['deliveryReport']){_0x48a707[_0xb7e0('0x35')]=!![];}return _0x29235d[_0xb7e0('0x11')](_0x48a707);}else{return logger[_0xb7e0('0x14')](_0xb7e0('0x23'),_0xb7e0('0x24'),_0xb7e0('0x53'),util[_0xb7e0('0x25')](_0x560dd4[_0xb7e0('0x14')],{'showHidden':![],'depth':null}));}})[_0xb7e0('0x13')](function(_0x2e6b6a){return logger[_0xb7e0('0x14')](_0xb7e0('0x23'),'afterCreate','csc',util['inspect'](_0x2e6b6a,{'showHidden':![],'depth':null}));});}else{logger[_0xb7e0('0x14')](_0xb7e0('0x23'),_0xb7e0('0x24'),_0xb7e0('0x53'),_0xb7e0('0x62'));}case _0xb7e0('0x63'):if(_0x6aafa['apiKey']){var _0x5e4503={'method':_0xb7e0('0x2f'),'uri':_0xb7e0('0x64'),'headers':{'Authorization':_0x6aafa[_0xb7e0('0x55')]},'body':{'content':_0x4e5dc6[_0xb7e0('0x1c')],'to':[_0x4e5dc6[_0xb7e0('0x1d')]],'from':_0x6aafa['phone'],'binary':![],'clientMessageId':_0xb7e0('0x65'),'charset':_0xb7e0('0x66')},'json':!![]};rp(_0x5e4503)['then'](function(_0x138e23){if(!_0x138e23[_0xb7e0('0x14')]){var _0x530b90={'messageId':_0x138e23[_0xb7e0('0x1b')][0x0][_0xb7e0('0x67')]};if(!_0x6aafa[_0xb7e0('0x34')]){_0x530b90['read']=!![];}return _0x29235d[_0xb7e0('0x11')](_0x530b90);}else{return logger['error'](_0xb7e0('0x23'),'afterCreate',_0xb7e0('0x63'),util[_0xb7e0('0x25')](_0x138e23[_0xb7e0('0x14')],{'showHidden':![],'depth':null}));}})[_0xb7e0('0x13')](function(_0x16f14e){return logger[_0xb7e0('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb7e0('0x24'),_0xb7e0('0x63'),util['inspect'](_0x16f14e,{'showHidden':![],'depth':null}));});}else{logger[_0xb7e0('0x14')](_0xb7e0('0x23'),_0xb7e0('0x24'),_0xb7e0('0x63'),'Missing\x20parameters:\x20apiKey');}break;case _0xb7e0('0x68'):if(_0x6aafa[_0xb7e0('0x55')]){var _0x2bebb6={};var _0x3e8bf2={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xb7e0('0x69')+_0x6aafa[_0xb7e0('0x55')],'Content-Type':_0xb7e0('0x52')},'body':{'from':_0x6aafa[_0xb7e0('0x1d')],'to':_0x4e5dc6['phone'],'text':_0x4e5dc6[_0xb7e0('0x1c')]},'json':!![]};return rp(_0x3e8bf2)[_0xb7e0('0x10')](function(_0x230df7){if(_0x230df7[_0xb7e0('0x6a')]==0xca){_0x2bebb6[_0xb7e0('0x6b')]=_0x230df7;var _0x572271={'method':_0xb7e0('0x2f'),'uri':_0xb7e0('0x6c'),'headers':{'Authorization':_0xb7e0('0x69')+_0x6aafa['apiKey'],'Content-Type':_0xb7e0('0x52')},'body':{'refid':_0x2bebb6[_0xb7e0('0x6b')]['refid']},'json':!![]};return rp(_0x572271)[_0xb7e0('0x10')](function(_0x372728){_0x2bebb6[_0xb7e0('0x6d')]=_0x372728;var _0x4a4d9b={'messageId':_0x2bebb6[_0xb7e0('0x6b')]['refid'],'read':!![]};return _0x29235d[_0xb7e0('0x11')](_0x4a4d9b);});}else{return logger[_0xb7e0('0x14')](_0xb7e0('0x23'),_0xb7e0('0x24'),'intelepeer',util[_0xb7e0('0x25')](_0x230df7,{'showHidden':![],'depth':null}));}})[_0xb7e0('0x13')](function(_0x584094){return logger['error'](_0xb7e0('0x23'),'afterCreate',_0xb7e0('0x68'),util[_0xb7e0('0x25')](_0x584094,{'showHidden':![],'depth':null}));});}else{return logger[_0xb7e0('0x14')](_0xb7e0('0x23'),_0xb7e0('0x24'),_0xb7e0('0x68'),_0xb7e0('0x6e'));}break;}}})[_0xb7e0('0x6f')](function(){_0x22f291();});}else{_0x22f291();}}},'charset':'utf8mb4','collate':_0xb7e0('0x70')});}; \ No newline at end of file +var _0xadee=['clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','data','queued_count','head','messages','message_id','deliveryReport','clickSend','plivo','senderString','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','login','sender','keys','length','apiKey','createHash','md5','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','finally','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','./smsMessage.attributes','exports','define','sms_messages','messageId','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','SmsInteractionId','createdAt','body','catch','out','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','create','remote','/status?token=','token','sid','update','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','login?username=','&password=','password','GET','split','sms','POST','user_key','session_key','inspect','Missing\x20parameters:\x20username,\x20password','https://smsapi.connectel.se/api/send/','requestid','read','connectel','Missing\x20parameters:\x20authToken'];(function(_0x5c8a0a,_0x284afe){var _0x4acb8c=function(_0x1d7a1a){while(--_0x1d7a1a){_0x5c8a0a['push'](_0x5c8a0a['shift']());}};_0x4acb8c(++_0x284afe);}(_0xadee,0x191));var _0xeade=function(_0xd7a5c0,_0x4da629){_0xd7a5c0=_0xd7a5c0-0x0;var _0x7ea7d=_0xadee[_0xd7a5c0];return _0x7ea7d;};'use strict';var _=require('lodash');var util=require(_0xeade('0x0'));var logger=require(_0xeade('0x1'))(_0xeade('0x2'));var moment=require(_0xeade('0x3'));var BPromise=require(_0xeade('0x4'));var rp=require(_0xeade('0x5'));var attributes=require(_0xeade('0x6'));module[_0xeade('0x7')]=function(_0x1919de,_0x517dcc){return _0x1919de[_0xeade('0x8')]('SmsMessage',attributes,{'tableName':_0xeade('0x9'),'paranoid':![],'indexes':[{'name':_0xeade('0xa'),'fields':['messageId']}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59e32e,_0x416080,_0x4dec69){var _0x11cf6b=_0x1919de[_0xeade('0xb')];var _0x2c5b3b=_0x59e32e[_0xeade('0xc')]({'plain':!![]});if(_0x2c5b3b[_0xeade('0xd')][_0xeade('0xe')]()==='in'||_0x2c5b3b[_0xeade('0xd')][_0xeade('0xe')]()==='out'&&!_0x2c5b3b[_0xeade('0xf')]&&!_[_0xeade('0x10')](_0x2c5b3b[_0xeade('0x11')])){_0x11cf6b[_0xeade('0x12')]['findOne']({'where':{'id':_0x2c5b3b[_0xeade('0x13')]}})['then'](function(_0x2398a3){if(_0x2398a3){_0x2398a3['update']({'lastMsgAt':_0x2c5b3b[_0xeade('0x14')],'lastMsgDirection':_0x2c5b3b['direction'][_0xeade('0xe')](),'lastMsgBody':_0x2c5b3b[_0xeade('0x15')]});}})[_0xeade('0x16')](function(_0x15c3d0){console['error'](_0x15c3d0);});}if(_0x2c5b3b[_0xeade('0xd')]===_0xeade('0x17')&&!_0x2c5b3b[_0xeade('0xf')]){var _0x5087ce;_0x11cf6b[_0xeade('0x18')][_0xeade('0x19')]({'where':{'id':_0x2c5b3b[_0xeade('0x1a')]},'raw':!![]})[_0xeade('0x1b')](function(_0x1b4776){_0x5087ce=_0x1b4776;if(_0x5087ce&&_0x5087ce[_0xeade('0x1c')]){switch(_0x5087ce['type']){case _0xeade('0x1d'):var _0xe018ac=require(_0xeade('0x1d'));if(_0x5087ce[_0xeade('0x1e')]&&_0x5087ce[_0xeade('0x1f')]&&_0x5087ce[_0xeade('0x20')]){var _0x533929=new _0xe018ac(_0x5087ce[_0xeade('0x1e')],_0x5087ce[_0xeade('0x1f')]);_0x533929['messages'][_0xeade('0x21')]({'body':_0x2c5b3b['body'],'to':_0x2c5b3b[_0xeade('0x20')],'from':_0x5087ce[_0xeade('0x20')],'statusCallback':_0x5087ce[_0xeade('0x22')]+'/api/sms/messages/'+_0x2c5b3b['id']+_0xeade('0x23')+_0x5087ce[_0xeade('0x24')]})[_0xeade('0x1b')](function(_0x4a974d){if(_0x4a974d[_0xeade('0x25')]){return _0x59e32e[_0xeade('0x26')]({'messageId':_0x4a974d[_0xeade('0x25')]});}})[_0xeade('0x16')](function(_0x40a98b){logger[_0xeade('0x27')](_0xeade('0x28'),_0xeade('0x29'),'twilio',util['inspect'](_0x40a98b,{'showHidden':![],'depth':null}));});}else{logger[_0xeade('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xeade('0x29'),_0xeade('0x1d'),_0xeade('0x2a'));}break;case _0xeade('0x2b'):var _0x44ba4f=_0xeade('0x2c');if(_0x5087ce[_0xeade('0x2d')]&&_0x5087ce['password']){var _0x19e025={'recipient':[_0x2c5b3b[_0xeade('0x20')]],'message':_0x2c5b3b[_0xeade('0x15')],'message_type':_0x5087ce[_0xeade('0x2e')]};var _0x94a5fe={'url':_0x44ba4f+_0xeade('0x2f')+_0x5087ce[_0xeade('0x2d')]+_0xeade('0x30')+_0x5087ce[_0xeade('0x31')],'method':_0xeade('0x32')};rp(_0x94a5fe)['then'](function(_0x55a0cf){var _0x362f10=_0x55a0cf[_0xeade('0x33')](';');var _0x32ed9d={'user_key':_0x362f10[0x0],'session_key':_0x362f10[0x1]};_0x94a5fe={'url':_0x44ba4f+_0xeade('0x34'),'method':_0xeade('0x35'),'headers':{'user_key':_0x32ed9d[_0xeade('0x36')],'Session_key':_0x32ed9d[_0xeade('0x37')]},'json':!![],'body':_0x19e025};return rp(_0x94a5fe);})[_0xeade('0x1b')](function(_0x3373f5){if(_0x3373f5['total_sent']>=0x1){var _0x11d805={'messageId':_0x3373f5['internal_order_id']};if(_0x5087ce[_0xeade('0x2e')]!=='GP'||!_0x5087ce['deliveryReport']){_0x11d805['read']=!![];}return _0x59e32e[_0xeade('0x26')](_0x11d805);}else{return logger[_0xeade('0x27')](_0xeade('0x28'),_0xeade('0x29'),_0xeade('0x2b'),util[_0xeade('0x38')](_0x3373f5,{'showHidden':![],'depth':null}));}})[_0xeade('0x16')](function(_0x18f614){return logger[_0xeade('0x27')](_0xeade('0x28'),_0xeade('0x29'),_0xeade('0x2b'),util['inspect'](_0x18f614,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xeade('0x28'),'afterCreate','skebby',_0xeade('0x39'));}break;case'connectel':if(_0x5087ce['authToken']){var _0x482a54={'recipient':_0x2c5b3b[_0xeade('0x20')],'message':_0x2c5b3b['body'],'sender':_0x5087ce['senderString']||_0x5087ce[_0xeade('0x20')],'authorization':_0x5087ce['authToken']};var _0x416080={'method':_0xeade('0x35'),'uri':_0xeade('0x3a'),'body':_0x482a54,'json':!![]};rp(_0x416080)[_0xeade('0x1b')](function(_0x5ae066){var _0x9be5a6={'messageId':_0x5ae066[_0xeade('0x3b')]};if(!_0x5087ce['deliveryReport']){_0x9be5a6[_0xeade('0x3c')]=!![];}return _0x59e32e[_0xeade('0x26')](_0x9be5a6);})[_0xeade('0x16')](function(_0x264b50){logger[_0xeade('0x27')](_0xeade('0x28'),_0xeade('0x29'),_0xeade('0x3d'),util[_0xeade('0x38')](_0x264b50,{'showHidden':![],'depth':null}));});}else{logger[_0xeade('0x27')](_0xeade('0x28'),_0xeade('0x29'),_0xeade('0x3d'),_0xeade('0x3e'));}break;case _0xeade('0x3f'):if(_0x5087ce[_0xeade('0x2d')]&&_0x5087ce[_0xeade('0x31')]){var _0x482a54={'messages':[{'source':_0xeade('0x40'),'to':_0x2c5b3b[_0xeade('0x20')],'body':_0x2c5b3b[_0xeade('0x15')],'from':_0x5087ce['senderString']||_0x5087ce['phone']}]};var _0x5a89ab=util[_0xeade('0x41')](_0xeade('0x42'),_0x5087ce[_0xeade('0x2d')],_0x5087ce[_0xeade('0x31')]);var _0x416080={'method':_0xeade('0x35'),'uri':_0xeade('0x43'),'body':_0x482a54,'headers':{'Authorization':util[_0xeade('0x41')](_0xeade('0x44'),new Buffer(_0x5a89ab)[_0xeade('0x45')](_0xeade('0x46')))},'json':!![]};rp(_0x416080)[_0xeade('0x1b')](function(_0x3c6999){if(_0x3c6999['http_code']>=0xc8&&_0x3c6999['http_code']<=0xce){if(_0x3c6999[_0xeade('0x47')]&&_0x3c6999[_0xeade('0x47')][_0xeade('0x48')]>0x0){var _0x31eba5=_[_0xeade('0x49')](_0x3c6999[_0xeade('0x47')][_0xeade('0x4a')]);var _0xa8be36={'messageId':_0x31eba5[_0xeade('0x4b')]};if(!_0x5087ce[_0xeade('0x4c')]){_0xa8be36[_0xeade('0x3c')]=!![];}return _0x59e32e['update'](_0xa8be36);}else{logger[_0xeade('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xeade('0x29'),_0xeade('0x4d'),util[_0xeade('0x38')](_0x3c6999,{'showHidden':![],'depth':null}));}}else{logger[_0xeade('0x27')](_0xeade('0x28'),_0xeade('0x29'),_0xeade('0x4d'),util[_0xeade('0x38')](_0x3c6999,{'showHidden':![],'depth':null}));}})[_0xeade('0x16')](function(_0x1de4ca){logger[_0xeade('0x27')](_0xeade('0x28'),'afterCreate',_0xeade('0x4d'),util[_0xeade('0x38')](_0x1de4ca,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xeade('0x28'),'afterCreate',_0xeade('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xeade('0x4e'):if(_0x5087ce['authId']&&_0x5087ce['authToken']){var _0x482a54={'dst':_0x2c5b3b[_0xeade('0x20')],'text':_0x2c5b3b[_0xeade('0x15')],'src':_0x5087ce[_0xeade('0x4f')]||_0x5087ce[_0xeade('0x20')],'url':_0x5087ce[_0xeade('0x22')]+'/api/sms/messages/'+_0x2c5b3b['id']+_0xeade('0x23')+_0x5087ce[_0xeade('0x24')]};var _0x5a89ab=util[_0xeade('0x41')](_0xeade('0x42'),_0x5087ce[_0xeade('0x50')],_0x5087ce[_0xeade('0x1f')]);var _0x416080={'method':_0xeade('0x35'),'uri':util[_0xeade('0x41')](_0xeade('0x51'),_0x5087ce[_0xeade('0x50')]),'body':_0x482a54,'headers':{'Authorization':util['format'](_0xeade('0x44'),new Buffer(_0x5a89ab)[_0xeade('0x45')](_0xeade('0x46')))},'json':!![]};rp(_0x416080)[_0xeade('0x1b')](function(_0xa40511){var _0x3a7928={'messageId':_0xa40511[_0xeade('0x52')][0x0]};return _0x59e32e['update'](_0x3a7928);})['catch'](function(_0x406917){logger['error'](_0xeade('0x28'),_0xeade('0x29'),_0xeade('0x4e'),util[_0xeade('0x38')](_0x406917,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xeade('0x29'),_0xeade('0x4e'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xeade('0x53'):if(_0x5087ce[_0xeade('0x2d')]&&_0x5087ce[_0xeade('0x31')]){if(_0x5087ce[_0xeade('0x54')]){var _0xf408db={'method':_0xeade('0x35'),'uri':_0x5087ce[_0xeade('0x54')]+_0xeade('0x55'),'body':{'username':_0x5087ce['username'],'password':_0x5087ce[_0xeade('0x31')]},'json':!![]};return rp(_0xf408db)[_0xeade('0x1b')](function(_0x2b88ee){var _0x2d48f2={'method':_0xeade('0x35'),'uri':_0x5087ce[_0xeade('0x54')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x5087ce['phone'],'destinations':[{'to':_0x2c5b3b['phone']}],'text':_0x2c5b3b[_0xeade('0x15')],'notifyUrl':_0x5087ce[_0xeade('0x22')]+'/api/sms/messages/'+_0x2c5b3b['id']+_0xeade('0x23')+_0x5087ce[_0xeade('0x24')],'notifyContentType':_0xeade('0x56'),'callbackData':_0x5087ce['phone']+';'+_0x2c5b3b[_0xeade('0x15')]}]},'headers':{'Authorization':_0xeade('0x57')+_0x2b88ee['token']},'json':!![]};return rp(_0x2d48f2)[_0xeade('0x1b')](function(_0x48d1a5){if(_0x48d1a5['messages']){var _0x81b83b={'messageId':_0x48d1a5[_0xeade('0x4a')][0x0][_0xeade('0xa')]};if(!_0x5087ce['deliveryReport']){_0x81b83b[_0xeade('0x3c')]=!![];}return _0x59e32e[_0xeade('0x26')](_0x81b83b);}else{return logger[_0xeade('0x27')](_0xeade('0x28'),'afterCreate','infobip',util[_0xeade('0x38')](_0x48d1a5,{'showHidden':![],'depth':null}));}});})[_0xeade('0x16')](function(_0x53be36){return logger[_0xeade('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xeade('0x53'),util['inspect'](_0x53be36,{'showHidden':![],'depth':null}));});}else{logger[_0xeade('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xeade('0x29'),_0xeade('0x53'),_0xeade('0x58'));}}else{logger[_0xeade('0x27')](_0xeade('0x28'),_0xeade('0x29'),_0xeade('0x53'),_0xeade('0x39'));}case _0xeade('0x59'):var _0x1eaa69=require('crypto');if(_0x5087ce['apiKey']){var _0x573826={};_0x573826[_0xeade('0x5a')]=_0x5087ce[_0xeade('0x2d')];_0x573826[_0xeade('0x20')]=_0x2c5b3b[_0xeade('0x20')];_0x573826[_0xeade('0x5b')]=_0x5087ce[_0xeade('0x20')];_0x573826['text']=_0x2c5b3b[_0xeade('0x15')];_0x573826['timestamp']=+new Date();var _0x393f7b='';var _0x5596f7='';var _0x5dbd55=Object[_0xeade('0x5c')](_0x573826);_0x5dbd55['sort']();for(var _0x455ffd=0x0;_0x455ffd<_0x5dbd55[_0xeade('0x5d')];_0x455ffd++){if(_0x393f7b!=''){_0x393f7b+='&';}_0x393f7b+=_0x5dbd55[_0x455ffd]+'='+encodeURIComponent(_0x573826[_0x5dbd55[_0x455ffd]]);_0x5596f7+=_0x573826[_0x5dbd55[_0x455ffd]];}_0x5596f7+=_0x5087ce[_0xeade('0x5e')];_0x5596f7=_0x1eaa69[_0xeade('0x5f')](_0xeade('0x60'))[_0xeade('0x26')](_0x5596f7)[_0xeade('0x61')](_0xeade('0x62'));if(_0x393f7b!==''){_0x393f7b+='&';}_0x393f7b+=_0xeade('0x63')+_0x5596f7;var _0x94a5fe={'method':_0xeade('0x32'),'uri':_0xeade('0x64')+_0x393f7b,'json':!![]};return rp(_0x94a5fe)[_0xeade('0x1b')](function(_0x1a52ff){var _0x305aa7=Object[_0xeade('0x5c')](_0x1a52ff);if(_0x1a52ff[_0x305aa7[0x0]]['error']&&parseInt(_0x1a52ff[_0x305aa7[0x0]][_0xeade('0x27')])===0x0){var _0x6ae453={'messageId':_0x1a52ff[_0x305aa7[0x0]][_0xeade('0x65')]};if(!_0x5087ce[_0xeade('0x4c')]){_0x6ae453['read']=!![];}return _0x59e32e[_0xeade('0x26')](_0x6ae453);}else{return logger[_0xeade('0x27')](_0xeade('0x28'),_0xeade('0x29'),'csc',util[_0xeade('0x38')](_0x1a52ff[_0xeade('0x27')],{'showHidden':![],'depth':null}));}})[_0xeade('0x16')](function(_0x2934c4){return logger['error'](_0xeade('0x28'),_0xeade('0x29'),'csc',util[_0xeade('0x38')](_0x2934c4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xeade('0x28'),_0xeade('0x29'),_0xeade('0x59'),'Missing\x20parameters:\x20apiKey');}case _0xeade('0x66'):if(_0x5087ce['apiKey']){var _0x5a6b3f={'method':'POST','uri':_0xeade('0x67'),'headers':{'Authorization':_0x5087ce[_0xeade('0x5e')]},'body':{'content':_0x2c5b3b[_0xeade('0x15')],'to':[_0x2c5b3b['phone']],'from':_0x5087ce[_0xeade('0x20')],'binary':![],'clientMessageId':'uuid','charset':_0xeade('0x68')},'json':!![]};rp(_0x5a6b3f)[_0xeade('0x1b')](function(_0xa0a680){if(!_0xa0a680[_0xeade('0x27')]){var _0x522f88={'messageId':_0xa0a680[_0xeade('0x4a')][0x0][_0xeade('0x69')]};if(!_0x5087ce[_0xeade('0x4c')]){_0x522f88[_0xeade('0x3c')]=!![];}return _0x59e32e[_0xeade('0x26')](_0x522f88);}else{return logger[_0xeade('0x27')](_0xeade('0x28'),'afterCreate',_0xeade('0x66'),util['inspect'](_0xa0a680[_0xeade('0x27')],{'showHidden':![],'depth':null}));}})[_0xeade('0x16')](function(_0x325c29){return logger[_0xeade('0x27')](_0xeade('0x28'),'afterCreate',_0xeade('0x66'),util['inspect'](_0x325c29,{'showHidden':![],'depth':null}));});}else{logger[_0xeade('0x27')](_0xeade('0x28'),_0xeade('0x29'),_0xeade('0x66'),'Missing\x20parameters:\x20apiKey');}break;case _0xeade('0x6a'):if(_0x5087ce[_0xeade('0x5e')]){var _0x184e11={};var _0x94a5fe={'method':'POST','uri':_0xeade('0x6b'),'headers':{'Authorization':_0xeade('0x6c')+_0x5087ce[_0xeade('0x5e')],'Content-Type':_0xeade('0x56')},'body':{'from':_0x5087ce[_0xeade('0x20')],'to':_0x2c5b3b[_0xeade('0x20')],'text':_0x2c5b3b[_0xeade('0x15')]},'json':!![]};return rp(_0x94a5fe)['then'](function(_0x480b65){if(_0x480b65[_0xeade('0x6d')]==0xca){_0x184e11[_0xeade('0x6e')]=_0x480b65;var _0x3edc14={'method':_0xeade('0x35'),'uri':_0xeade('0x6f'),'headers':{'Authorization':_0xeade('0x6c')+_0x5087ce[_0xeade('0x5e')],'Content-Type':'application/json'},'body':{'refid':_0x184e11['message']['refid']},'json':!![]};return rp(_0x3edc14)[_0xeade('0x1b')](function(_0x39ee56){_0x184e11[_0xeade('0x70')]=_0x39ee56;var _0x841077={'messageId':_0x184e11[_0xeade('0x6e')][_0xeade('0x71')],'read':!![]};return _0x59e32e[_0xeade('0x26')](_0x841077);});}else{return logger[_0xeade('0x27')](_0xeade('0x28'),_0xeade('0x29'),_0xeade('0x6a'),util[_0xeade('0x38')](_0x480b65,{'showHidden':![],'depth':null}));}})[_0xeade('0x16')](function(_0x4e562a){return logger[_0xeade('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xeade('0x6a'),util[_0xeade('0x38')](_0x4e562a,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xeade('0x28'),'afterCreate',_0xeade('0x6a'),'Token\x20not\x20received');}break;}}})[_0xeade('0x72')](function(){_0x4dec69();});}else{_0x4dec69();}}},'charset':_0xeade('0x73'),'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 d46ea56..c9e9c43 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 _0xc017=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','code','error','SmsMessage,\x20%s,\x20%s','message','info','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','stringify','lodash','util','bluebird','../../mysqldb'];(function(_0x185904,_0x2fbb34){var _0x3a24e1=function(_0x456ff8){while(--_0x456ff8){_0x185904['push'](_0x185904['shift']());}};_0x3a24e1(++_0x2fbb34);}(_0xc017,0x151));var _0x7c01=function(_0x10ca6f,_0x2906b6){_0x10ca6f=_0x10ca6f-0x0;var _0x4a284f=_0xc017[_0x10ca6f];return _0x4a284f;};'use strict';var _=require(_0x7c01('0x0'));var util=require(_0x7c01('0x1'));var moment=require('moment');var BPromise=require(_0x7c01('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c01('0x3'))['db'];var utils=require(_0x7c01('0x4'));var logger=require(_0x7c01('0x5'))('rpc');var config=require(_0x7c01('0x6'));var jayson=require(_0x7c01('0x7'));var client=jayson[_0x7c01('0x8')][_0x7c01('0x9')]({'port':0x232a});config[_0x7c01('0xa')]=_[_0x7c01('0xb')](config[_0x7c01('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c01('0xc'))(new Redis(config[_0x7c01('0xa')]));require(_0x7c01('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d6ac1,_0x3c63ee,_0x24811d){return new BPromise(function(_0x36beea,_0x373c1d){return client['request'](_0x5d6ac1,_0x24811d)[_0x7c01('0xe')](function(_0x54c32a){logger['info']('SmsMessage,\x20%s,\x20%s',_0x3c63ee,_0x7c01('0xf'));logger[_0x7c01('0x10')](_0x7c01('0x11'),_0x3c63ee,_0x7c01('0xf'),JSON['stringify'](_0x54c32a));if(_0x54c32a['error']){if(_0x54c32a['error'][_0x7c01('0x12')]===0x1f4){logger[_0x7c01('0x13')](_0x7c01('0x14'),_0x3c63ee,_0x54c32a['error'][_0x7c01('0x15')]);return _0x373c1d(_0x54c32a[_0x7c01('0x13')][_0x7c01('0x15')]);}logger[_0x7c01('0x13')](_0x7c01('0x14'),_0x3c63ee,_0x54c32a[_0x7c01('0x13')][_0x7c01('0x15')]);return _0x36beea(_0x54c32a['error'][_0x7c01('0x15')]);}else{logger[_0x7c01('0x16')](_0x7c01('0x14'),_0x3c63ee,_0x7c01('0xf'));_0x36beea(_0x54c32a[_0x7c01('0x17')]['message']);}})[_0x7c01('0x18')](function(_0x3d0839){logger[_0x7c01('0x13')](_0x7c01('0x14'),_0x3c63ee,_0x3d0839);_0x373c1d(_0x3d0839);});});}exports[_0x7c01('0x19')]=function(_0x2db142){var _0x9fd37=this;return new Promise(function(_0x423edc,_0x57dff8){return db[_0x7c01('0x1a')]['create'](_0x2db142[_0x7c01('0x1b')],{'raw':_0x2db142['options']?_0x2db142[_0x7c01('0x1c')][_0x7c01('0x1d')]===undefined?!![]:![]:!![]})[_0x7c01('0xe')](function(_0x3740fb){logger[_0x7c01('0x16')](_0x7c01('0x19'),_0x2db142);logger[_0x7c01('0x10')]('CreateSmsMessage',_0x2db142,JSON[_0x7c01('0x1e')](_0x3740fb));_0x423edc(_0x3740fb);})['catch'](function(_0x14407a){logger[_0x7c01('0x13')]('CreateSmsMessage',_0x14407a[_0x7c01('0x15')],_0x2db142);_0x57dff8(_0x9fd37['error'](0x1f4,_0x14407a['message']));});});}; \ No newline at end of file +var _0xf1b1=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./smsMessage.socket','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','body','options','CreateSmsMessage'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf1b1,0x78));var _0x1f1b=function(_0x229532,_0x1c0e67){_0x229532=_0x229532-0x0;var _0x598c8a=_0xf1b1[_0x229532];return _0x598c8a;};'use strict';var _=require('lodash');var util=require(_0x1f1b('0x0'));var moment=require(_0x1f1b('0x1'));var BPromise=require(_0x1f1b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f1b('0x3'))['db'];var utils=require(_0x1f1b('0x4'));var logger=require(_0x1f1b('0x5'))(_0x1f1b('0x6'));var config=require('../../config/environment');var jayson=require(_0x1f1b('0x7'));var client=jayson[_0x1f1b('0x8')][_0x1f1b('0x9')]({'port':0x232a});config[_0x1f1b('0xa')]=_[_0x1f1b('0xb')](config['redis'],{'host':_0x1f1b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f1b('0xa')]));require(_0x1f1b('0xd'))['register'](socket);function respondWithRpcPromise(_0x33f7fa,_0x1a9680,_0x3b55b7){return new BPromise(function(_0x57776a,_0x405419){return client[_0x1f1b('0xe')](_0x33f7fa,_0x3b55b7)[_0x1f1b('0xf')](function(_0x56a43b){logger[_0x1f1b('0x10')]('SmsMessage,\x20%s,\x20%s',_0x1a9680,_0x1f1b('0x11'));logger[_0x1f1b('0x12')](_0x1f1b('0x13'),_0x1a9680,'request\x20sent',JSON[_0x1f1b('0x14')](_0x56a43b));if(_0x56a43b[_0x1f1b('0x15')]){if(_0x56a43b[_0x1f1b('0x15')][_0x1f1b('0x16')]===0x1f4){logger[_0x1f1b('0x15')](_0x1f1b('0x17'),_0x1a9680,_0x56a43b[_0x1f1b('0x15')][_0x1f1b('0x18')]);return _0x405419(_0x56a43b[_0x1f1b('0x15')][_0x1f1b('0x18')]);}logger[_0x1f1b('0x15')]('SmsMessage,\x20%s,\x20%s',_0x1a9680,_0x56a43b[_0x1f1b('0x15')][_0x1f1b('0x18')]);return _0x57776a(_0x56a43b[_0x1f1b('0x15')][_0x1f1b('0x18')]);}else{logger[_0x1f1b('0x10')](_0x1f1b('0x17'),_0x1a9680,'request\x20sent');_0x57776a(_0x56a43b[_0x1f1b('0x19')]['message']);}})[_0x1f1b('0x1a')](function(_0xc7d5f5){logger[_0x1f1b('0x15')](_0x1f1b('0x17'),_0x1a9680,_0xc7d5f5);_0x405419(_0xc7d5f5);});});}exports['CreateSmsMessage']=function(_0x185457){var _0x499866=this;return new Promise(function(_0x564067,_0x5094c2){return db['SmsMessage']['create'](_0x185457[_0x1f1b('0x1b')],{'raw':_0x185457[_0x1f1b('0x1c')]?_0x185457[_0x1f1b('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x1f1b('0xf')](function(_0x1206ca){logger[_0x1f1b('0x10')]('CreateSmsMessage',_0x185457);logger['debug'](_0x1f1b('0x1d'),_0x185457,JSON[_0x1f1b('0x14')](_0x1206ca));_0x564067(_0x1206ca);})['catch'](function(_0xc7c7a1){logger[_0x1f1b('0x15')]('CreateSmsMessage',_0xc7c7a1[_0x1f1b('0x18')],_0x185457);_0x5094c2(_0x499866[_0x1f1b('0x15')](0x1f4,_0xc7c7a1[_0x1f1b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index e1af22d..4bf52c7 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 _0x577c=['register','length','./smsMessage.events','save','remove','emit','removeListener'];(function(_0x20604c,_0x5b0106){var _0x12f806=function(_0x49a882){while(--_0x49a882){_0x20604c['push'](_0x20604c['shift']());}};_0x12f806(++_0x5b0106);}(_0x577c,0x1f3));var _0xc577=function(_0x34abbf,_0x30d34b){_0x34abbf=_0x34abbf-0x0;var _0x121cc8=_0x577c[_0x34abbf];return _0x121cc8;};'use strict';var SmsMessageEvents=require(_0xc577('0x0'));var events=[_0xc577('0x1'),_0xc577('0x2'),'update'];function createListener(_0xbdfd49,_0x9ea21){return function(_0x4c7062){_0x9ea21[_0xc577('0x3')](_0xbdfd49,_0x4c7062);};}function removeListener(_0x123e7c,_0x95a78b){return function(){SmsMessageEvents[_0xc577('0x4')](_0x123e7c,_0x95a78b);};}exports[_0xc577('0x5')]=function(_0x43c564){for(var _0x5b965c=0x0,_0x8c1908=events[_0xc577('0x6')];_0x5b965c<_0x8c1908;_0x5b965c++){var _0xc5db7f=events[_0x5b965c];var _0x2b8a5b=createListener('smsMessage:'+_0xc5db7f,_0x43c564);SmsMessageEvents['on'](_0xc5db7f,_0x2b8a5b);}}; \ No newline at end of file +var _0xb4a3=['removeListener','register','smsMessage:','./smsMessage.events','remove','update','emit'];(function(_0x4c94f8,_0x1ad06a){var _0x30b78e=function(_0x21ad14){while(--_0x21ad14){_0x4c94f8['push'](_0x4c94f8['shift']());}};_0x30b78e(++_0x1ad06a);}(_0xb4a3,0xb2));var _0x3b4a=function(_0x509c83,_0x511882){_0x509c83=_0x509c83-0x0;var _0x534626=_0xb4a3[_0x509c83];return _0x534626;};'use strict';var SmsMessageEvents=require(_0x3b4a('0x0'));var events=['save',_0x3b4a('0x1'),_0x3b4a('0x2')];function createListener(_0x389eed,_0x1600e2){return function(_0xc5785a){_0x1600e2[_0x3b4a('0x3')](_0x389eed,_0xc5785a);};}function removeListener(_0x5734fe,_0x39eaf7){return function(){SmsMessageEvents[_0x3b4a('0x4')](_0x5734fe,_0x39eaf7);};}exports[_0x3b4a('0x5')]=function(_0x654db7){for(var _0x15ae06=0x0,_0x597340=events['length'];_0x15ae06<_0x597340;_0x15ae06++){var _0x5d37d0=events[_0x15ae06];var _0x1cbc1b=createListener(_0x3b4a('0x6')+_0x5d37d0,_0x654db7);SmsMessageEvents['on'](_0x5d37d0,_0x1cbc1b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 0cdf712..4d86583 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 _0x61c8=['update','delete','removeTeams','removeAgents','exports','util','express','Router','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','post','addTeams','put','/:id'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0x61c8,0x95));var _0x861c=function(_0x3d7a9f,_0x24e0f1){_0x3d7a9f=_0x3d7a9f-0x0;var _0x13f5f1=_0x61c8[_0x3d7a9f];return _0x13f5f1;};'use strict';var multer=require('multer');var util=require(_0x861c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x861c('0x1'));var router=express[_0x861c('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x861c('0x3'));var config=require(_0x861c('0x4'));var controller=require(_0x861c('0x5'));router[_0x861c('0x6')]('/',auth[_0x861c('0x7')](),controller['index']);router[_0x861c('0x6')](_0x861c('0x8'),auth[_0x861c('0x7')](),controller[_0x861c('0x9')]);router[_0x861c('0x6')]('/:id',auth[_0x861c('0x7')](),controller[_0x861c('0xa')]);router[_0x861c('0x6')](_0x861c('0xb'),auth[_0x861c('0x7')](),controller['getMembers']);router['get'](_0x861c('0xc'),auth[_0x861c('0x7')](),controller[_0x861c('0xd')]);router['get'](_0x861c('0xe'),auth[_0x861c('0x7')](),controller['getAgents']);router[_0x861c('0xf')]('/',auth[_0x861c('0x7')](),controller['create']);router[_0x861c('0xf')](_0x861c('0xc'),auth[_0x861c('0x7')](),controller[_0x861c('0x10')]);router['post']('/:id/users',auth[_0x861c('0x7')](),controller['addAgents']);router[_0x861c('0x11')](_0x861c('0x12'),auth[_0x861c('0x7')](),controller[_0x861c('0x13')]);router[_0x861c('0x14')](_0x861c('0x12'),auth[_0x861c('0x7')](),controller['destroy']);router['delete'](_0x861c('0xc'),auth[_0x861c('0x7')](),controller[_0x861c('0x15')]);router[_0x861c('0x14')](_0x861c('0xe'),auth[_0x861c('0x7')](),controller[_0x861c('0x16')]);module[_0x861c('0x17')]=router; \ No newline at end of file +var _0x90fe=['/:id/members','getMembers','/:id/teams','getTeams','post','addTeams','/:id/users','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','Router','../../components/auth/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3602b1,_0x4534a1){var _0x53ffee=function(_0x132679){while(--_0x132679){_0x3602b1['push'](_0x3602b1['shift']());}};_0x53ffee(++_0x4534a1);}(_0x90fe,0x112));var _0xe90f=function(_0x200147,_0x58a235){_0x200147=_0x200147-0x0;var _0x5cf8f4=_0x90fe[_0x200147];return _0x5cf8f4;};'use strict';var multer=require(_0xe90f('0x0'));var util=require(_0xe90f('0x1'));var path=require('path');var timeout=require(_0xe90f('0x2'));var express=require('express');var router=express[_0xe90f('0x3')]();var auth=require(_0xe90f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe90f('0x5'));router[_0xe90f('0x6')]('/',auth[_0xe90f('0x7')](),controller[_0xe90f('0x8')]);router[_0xe90f('0x6')](_0xe90f('0x9'),auth['isAuthenticated'](),controller[_0xe90f('0xa')]);router[_0xe90f('0x6')](_0xe90f('0xb'),auth[_0xe90f('0x7')](),controller['show']);router['get'](_0xe90f('0xc'),auth[_0xe90f('0x7')](),controller[_0xe90f('0xd')]);router[_0xe90f('0x6')](_0xe90f('0xe'),auth[_0xe90f('0x7')](),controller[_0xe90f('0xf')]);router[_0xe90f('0x6')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xe90f('0x7')](),controller['create']);router[_0xe90f('0x10')](_0xe90f('0xe'),auth['isAuthenticated'](),controller[_0xe90f('0x11')]);router[_0xe90f('0x10')](_0xe90f('0x12'),auth[_0xe90f('0x7')](),controller[_0xe90f('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe90f('0x14')]);router[_0xe90f('0x15')](_0xe90f('0xb'),auth['isAuthenticated'](),controller[_0xe90f('0x16')]);router[_0xe90f('0x15')](_0xe90f('0xe'),auth[_0xe90f('0x7')](),controller[_0xe90f('0x17')]);router[_0xe90f('0x15')](_0xe90f('0x12'),auth[_0xe90f('0x7')](),controller[_0xe90f('0x18')]);module[_0xe90f('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 d96ffd9..e2492c3 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 _0x139a=['beepall','sequelize','STRING','name','rrmemory'];(function(_0x183756,_0x52142b){var _0x562bc4=function(_0x533a38){while(--_0x533a38){_0x183756['push'](_0x183756['shift']());}};_0x562bc4(++_0x52142b);}(_0x139a,0xfb));var _0xa139=function(_0x4cb5f1,_0x48a863){_0x4cb5f1=_0x4cb5f1-0x0;var _0x28eab0=_0x139a[_0x4cb5f1];return _0x28eab0;};'use strict';var Sequelize=require(_0xa139('0x0'));module['exports']={'name':{'type':Sequelize[_0xa139('0x1')],'unique':_0xa139('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa139('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa139('0x3'),_0xa139('0x4'),'roundrobin')}}; \ No newline at end of file +var _0xf109=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','ENUM'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xf109,0xce));var _0x9f10=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xf109[_0x3070dc];return _0x431489;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'name':{'type':Sequelize[_0x9f10('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9f10('0x3')](_0x9f10('0x4'),_0x9f10('0x5'),_0x9f10('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 0ad0bd9..d960e61 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 _0xd493=['getTeams','Team','addTeams','ids','Agents','addAgents','penalty','removeTeams','omit','spread','userSmsQueue:save','removeAgents','isArray','emit','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','offset','json','reject','save','then','destroy','SmsQueues','UserProfileResource','end','error','stack','name','index','rawAttributes','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','field','SmsQueue','count','includeAll','include','findAll','rows','catch','show','params','model','options','find','create','get','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','nolimit','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt'];(function(_0x3ae042,_0x19f445){var _0xdd98f8=function(_0x3eee35){while(--_0x3eee35){_0x3ae042['push'](_0x3ae042['shift']());}};_0xdd98f8(++_0x19f445);}(_0xd493,0x171));var _0x3d49=function(_0x14ddab,_0x495c12){_0x14ddab=_0x14ddab-0x0;var _0x2a0253=_0xd493[_0x14ddab];return _0x2a0253;};'use strict';var pdf=require(_0x3d49('0x0'));var emlformat=require(_0x3d49('0x1'));var rimraf=require(_0x3d49('0x2'));var zipdir=require(_0x3d49('0x3'));var jsonpatch=require(_0x3d49('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d49('0x5'));var Mustache=require(_0x3d49('0x6'));var util=require(_0x3d49('0x7'));var path=require('path');var sox=require(_0x3d49('0x8'));var csv=require('to-csv');var ejs=require(_0x3d49('0x9'));var fs=require('fs');var _=require(_0x3d49('0xa'));var squel=require(_0x3d49('0xb'));var crypto=require(_0x3d49('0xc'));var jsforce=require(_0x3d49('0xd'));var deskjs=require(_0x3d49('0xe'));var toCsv=require(_0x3d49('0xf'));var querystring=require(_0x3d49('0x10'));var Papa=require(_0x3d49('0x11'));var authService=require(_0x3d49('0x12'));var hardwareService=require(_0x3d49('0x13'));var Redis=require(_0x3d49('0x14'));var qs=require(_0x3d49('0x15'));var logger=require('../../config/logger')(_0x3d49('0x16'));var utils=require(_0x3d49('0x17'));var config=require(_0x3d49('0x18'));var db=require(_0x3d49('0x19'))['db'];config[_0x3d49('0x1a')]=_[_0x3d49('0x1b')](config[_0x3d49('0x1a')],{'host':_0x3d49('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3d49('0x1d'))[_0x3d49('0x1e')](socket);function respondWithStatusCode(_0x421ca3,_0x41d71e){_0x41d71e=_0x41d71e||0xcc;return function(_0x1ea6f1){if(_0x1ea6f1){return _0x421ca3[_0x3d49('0x1f')](_0x41d71e);}return _0x421ca3[_0x3d49('0x20')](_0x41d71e)['end']();};}function respondWithResult(_0x151853,_0x133fdf){_0x133fdf=_0x133fdf||0xc8;return function(_0x3fd89e){if(_0x3fd89e){return _0x151853['status'](_0x133fdf)['json'](_0x3fd89e);}};}function respondWithFilteredResult(_0xc7aac,_0x5db7fd){return function(_0x2d6a41){if(_0x2d6a41){var _0x29e697=_0x2d6a41['count'],_0x2d3629=_0x5db7fd[_0x3d49('0x21')],_0x2fe8bb=_0x5db7fd[_0x3d49('0x21')]+_0x5db7fd['limit'],_0x3bef43;if(_0x2fe8bb>=_0x29e697){_0x2fe8bb=_0x29e697;_0x3bef43=0xc8;}else{_0x3bef43=0xce;}_0xc7aac[_0x3d49('0x20')](_0x3bef43);return _0xc7aac['set']('Content-Range',_0x2d3629+'-'+_0x2fe8bb+'/'+_0x29e697)[_0x3d49('0x22')](_0x2d6a41);}return null;};}function patchUpdates(_0x2c4873){return function(_0x9d01e2){try{jsonpatch['apply'](_0x9d01e2,_0x2c4873,!![]);}catch(_0x32ee9d){return BPromise[_0x3d49('0x23')](_0x32ee9d);}return _0x9d01e2[_0x3d49('0x24')]();};}function saveUpdates(_0x31aeac,_0x5cee12){return function(_0x4b9680){if(_0x4b9680){return _0x4b9680['update'](_0x31aeac)[_0x3d49('0x25')](function(_0x9ed34){return _0x9ed34;});}return null;};}function removeEntity(_0x2d523d,_0x31d935){return function(_0x170f66){if(_0x170f66){return _0x170f66[_0x3d49('0x26')]()[_0x3d49('0x25')](function(){var _0x358f8e=_0x170f66['get']({'plain':!![]});var _0x2f047e=_0x3d49('0x27');return db[_0x3d49('0x28')][_0x3d49('0x26')]({'where':{'type':_0x2f047e,'resourceId':_0x358f8e['id']}})[_0x3d49('0x25')](function(){return _0x170f66;});})[_0x3d49('0x25')](function(){_0x2d523d[_0x3d49('0x20')](0xcc)[_0x3d49('0x29')]();});}};}function handleEntityNotFound(_0x1c4939,_0x72124c){return function(_0x8de394){if(!_0x8de394){_0x1c4939[_0x3d49('0x1f')](0x194);}return _0x8de394;};}function handleError(_0x4ee4d5,_0x550508){_0x550508=_0x550508||0x1f4;return function(_0x2a8bdb){logger[_0x3d49('0x2a')](_0x2a8bdb[_0x3d49('0x2b')]);if(_0x2a8bdb[_0x3d49('0x2c')]){delete _0x2a8bdb[_0x3d49('0x2c')];}_0x4ee4d5[_0x3d49('0x20')](_0x550508)['send'](_0x2a8bdb);};}exports[_0x3d49('0x2d')]=function(_0x109593,_0x3a6e98){var _0x327bc1={},_0x48e4b3={},_0x696192={'count':0x0,'rows':[]};var _0x1ed591=db['SmsQueue'][_0x3d49('0x2e')];_0x48e4b3['model']=_[_0x3d49('0x2f')](_0x1ed591);_0x48e4b3[_0x3d49('0x30')]=_[_0x3d49('0x2f')](_0x109593[_0x3d49('0x30')]);_0x48e4b3['filters']=_[_0x3d49('0x31')](_0x48e4b3['model'],_0x48e4b3[_0x3d49('0x30')]);_0x327bc1['attributes']=_[_0x3d49('0x31')](_0x48e4b3['model'],qs[_0x3d49('0x32')](_0x109593[_0x3d49('0x30')][_0x3d49('0x32')]));_0x327bc1[_0x3d49('0x33')]=_0x327bc1[_0x3d49('0x33')][_0x3d49('0x34')]?_0x327bc1[_0x3d49('0x33')]:_0x48e4b3['model'];if(!_0x109593[_0x3d49('0x30')][_0x3d49('0x35')]('nolimit')){_0x327bc1['limit']=qs[_0x3d49('0x36')](_0x109593[_0x3d49('0x30')][_0x3d49('0x36')]);_0x327bc1[_0x3d49('0x21')]=qs[_0x3d49('0x21')](_0x109593['query'][_0x3d49('0x21')]);}_0x327bc1[_0x3d49('0x37')]=qs[_0x3d49('0x38')](_0x109593[_0x3d49('0x30')][_0x3d49('0x38')]);_0x327bc1[_0x3d49('0x39')]=qs['filters'](_[_0x3d49('0x3a')](_0x109593['query'],_0x48e4b3[_0x3d49('0x3b')]));if(_0x109593[_0x3d49('0x30')][_0x3d49('0x3c')]){_0x327bc1[_0x3d49('0x39')]=_[_0x3d49('0x3d')](_0x327bc1[_0x3d49('0x39')],{'$or':_[_0x3d49('0x3e')](_0x1ed591,function(_0x5dbbbd){if(_0x5dbbbd[_0x3d49('0x3f')][_0x3d49('0x40')]!==_0x3d49('0x41')){var _0x43bb14={};_0x43bb14[_0x5dbbbd[_0x3d49('0x42')]]={'$like':'%'+_0x109593['query']['filter']+'%'};return _0x43bb14;}})});}_0x327bc1=_[_0x3d49('0x3d')]({},_0x327bc1,_0x109593['options']);var _0x4f314c={'where':_0x327bc1[_0x3d49('0x39')]};return db[_0x3d49('0x43')]['count'](_0x4f314c)['then'](function(_0x3ce0bf){_0x696192[_0x3d49('0x44')]=_0x3ce0bf;if(_0x109593[_0x3d49('0x30')][_0x3d49('0x45')]){_0x327bc1[_0x3d49('0x46')]=[{'all':!![]}];}return db[_0x3d49('0x43')][_0x3d49('0x47')](_0x327bc1);})[_0x3d49('0x25')](function(_0x5d2262){_0x696192[_0x3d49('0x48')]=_0x5d2262;return _0x696192;})[_0x3d49('0x25')](respondWithFilteredResult(_0x3a6e98,_0x327bc1))[_0x3d49('0x49')](handleError(_0x3a6e98,null));};exports[_0x3d49('0x4a')]=function(_0x3dd579,_0x4423e1){var _0x8a1cc0={'raw':!![],'where':{'id':_0x3dd579[_0x3d49('0x4b')]['id']}},_0x549a83={};_0x549a83[_0x3d49('0x4c')]=_[_0x3d49('0x2f')](db[_0x3d49('0x43')]['rawAttributes']);_0x549a83[_0x3d49('0x30')]=_[_0x3d49('0x2f')](_0x3dd579['query']);_0x549a83[_0x3d49('0x3b')]=_[_0x3d49('0x31')](_0x549a83['model'],_0x549a83[_0x3d49('0x30')]);_0x8a1cc0[_0x3d49('0x33')]=_['intersection'](_0x549a83[_0x3d49('0x4c')],qs[_0x3d49('0x32')](_0x3dd579[_0x3d49('0x30')][_0x3d49('0x32')]));_0x8a1cc0['attributes']=_0x8a1cc0[_0x3d49('0x33')][_0x3d49('0x34')]?_0x8a1cc0[_0x3d49('0x33')]:_0x549a83['model'];if(_0x3dd579[_0x3d49('0x30')][_0x3d49('0x45')]){_0x8a1cc0[_0x3d49('0x46')]=[{'all':!![]}];}_0x8a1cc0=_['merge']({},_0x8a1cc0,_0x3dd579[_0x3d49('0x4d')]);return db['SmsQueue'][_0x3d49('0x4e')](_0x8a1cc0)['then'](handleEntityNotFound(_0x4423e1,null))[_0x3d49('0x25')](respondWithResult(_0x4423e1,null))[_0x3d49('0x49')](handleError(_0x4423e1,null));};exports[_0x3d49('0x4f')]=function(_0x4911cf,_0x4f5d3e){return db[_0x3d49('0x43')]['create'](_0x4911cf['body'],{})[_0x3d49('0x25')](function(_0x2d13fe){var _0x23c12b=_0x4911cf['user'][_0x3d49('0x50')]({'plain':!![]});if(!_0x23c12b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23c12b[_0x3d49('0x51')]===_0x3d49('0x52')){var _0x2d05ba=_0x2d13fe[_0x3d49('0x50')]({'plain':!![]});var _0x420b75=_0x3d49('0x27');return db[_0x3d49('0x53')][_0x3d49('0x4e')]({'where':{'name':_0x420b75,'userProfileId':_0x23c12b[_0x3d49('0x54')]},'raw':!![]})[_0x3d49('0x25')](function(_0x3e3904){if(_0x3e3904&&_0x3e3904[_0x3d49('0x55')]===0x0){return db[_0x3d49('0x28')][_0x3d49('0x4f')]({'name':_0x2d05ba[_0x3d49('0x2c')],'resourceId':_0x2d05ba['id'],'type':_0x3e3904[_0x3d49('0x2c')],'sectionId':_0x3e3904['id']},{})[_0x3d49('0x25')](function(){return _0x2d13fe;});}else{return _0x2d13fe;}})[_0x3d49('0x49')](function(_0x48c947){logger[_0x3d49('0x2a')](_0x3d49('0x56'),_0x48c947);throw _0x48c947;});}return _0x2d13fe;})[_0x3d49('0x25')](respondWithResult(_0x4f5d3e,0xc9))[_0x3d49('0x49')](handleError(_0x4f5d3e,null));};exports['update']=function(_0x1d549d,_0x3ea433){if(_0x1d549d['body']['id']){delete _0x1d549d['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x1d549d['params']['id']}})[_0x3d49('0x25')](handleEntityNotFound(_0x3ea433,null))['then'](saveUpdates(_0x1d549d[_0x3d49('0x57')],null))[_0x3d49('0x25')](respondWithResult(_0x3ea433,null))[_0x3d49('0x49')](handleError(_0x3ea433,null));};exports['destroy']=function(_0x1021ab,_0x54148b){return db[_0x3d49('0x43')]['find']({'where':{'id':_0x1021ab[_0x3d49('0x4b')]['id']}})[_0x3d49('0x25')](handleEntityNotFound(_0x54148b,null))[_0x3d49('0x25')](removeEntity(_0x54148b,null))[_0x3d49('0x49')](handleError(_0x54148b,null));};exports[_0x3d49('0x58')]=function(_0x2c6f2c,_0x347d0b){return db[_0x3d49('0x43')][_0x3d49('0x58')]()[_0x3d49('0x25')](respondWithResult(_0x347d0b,null))[_0x3d49('0x49')](handleError(_0x347d0b,null));};exports[_0x3d49('0x59')]=function(_0x330ce7,_0x2e0ca7,_0x5863e6){var _0x1581cf={'raw':!![],'where':{}},_0x42c806={},_0x81e1ff;return db[_0x3d49('0x43')][_0x3d49('0x5a')]({'where':{'id':_0x330ce7['params']['id']}})[_0x3d49('0x25')](handleEntityNotFound(_0x2e0ca7,null))[_0x3d49('0x25')](function(_0x29b86d){if(_0x29b86d){_0x81e1ff=_0x29b86d[_0x3d49('0x50')]({'plain':!![]});_0x42c806[_0x3d49('0x4c')]=_[_0x3d49('0x2f')](db['UserSmsQueue'][_0x3d49('0x2e')]);_0x42c806['query']=_[_0x3d49('0x2f')](_0x330ce7[_0x3d49('0x30')]);_0x42c806[_0x3d49('0x3b')]=_[_0x3d49('0x31')](_0x42c806[_0x3d49('0x4c')],_0x42c806[_0x3d49('0x30')]);_0x1581cf[_0x3d49('0x33')]=_[_0x3d49('0x31')](_0x42c806[_0x3d49('0x4c')],qs['fields'](_0x330ce7[_0x3d49('0x30')][_0x3d49('0x32')]));_0x1581cf[_0x3d49('0x33')]=_0x1581cf[_0x3d49('0x33')][_0x3d49('0x34')]?_0x1581cf[_0x3d49('0x33')]:_0x42c806[_0x3d49('0x4c')];if(!_0x330ce7[_0x3d49('0x30')][_0x3d49('0x35')](_0x3d49('0x5b'))){_0x1581cf[_0x3d49('0x36')]=qs['limit'](_0x330ce7['query'][_0x3d49('0x36')]);_0x1581cf[_0x3d49('0x21')]=qs[_0x3d49('0x21')](_0x330ce7[_0x3d49('0x30')]['offset']);}_0x1581cf[_0x3d49('0x37')]=qs['sort'](_0x330ce7[_0x3d49('0x30')][_0x3d49('0x38')]);_0x1581cf[_0x3d49('0x39')]=qs['filters'](_['pick'](_0x330ce7[_0x3d49('0x30')],_0x42c806[_0x3d49('0x3b')]));_0x1581cf['where'][_0x3d49('0x5c')]=_0x29b86d['id'];if(_0x330ce7[_0x3d49('0x30')][_0x3d49('0x3c')]){_0x1581cf[_0x3d49('0x39')]=_['merge'](_0x1581cf[_0x3d49('0x39')],{'$or':_[_0x3d49('0x3e')](_0x1581cf[_0x3d49('0x33')],function(_0x7373bc){var _0x213f7d={};_0x213f7d[_0x7373bc]={'$like':'%'+_0x330ce7[_0x3d49('0x30')][_0x3d49('0x3c')]+'%'};return _0x213f7d;})});}_0x1581cf=_[_0x3d49('0x3d')]({},_0x1581cf,_0x330ce7[_0x3d49('0x4d')]);return db['UserSmsQueue'][_0x3d49('0x47')](_0x1581cf);}})[_0x3d49('0x25')](function(_0x4a7785){if(_0x4a7785){return db[_0x3d49('0x5d')][_0x3d49('0x5e')]({'where':{'id':_['map'](_0x4a7785,_0x3d49('0x5f')),'role':_0x3d49('0x60')},'attributes':['id',_0x3d49('0x2c'),_0x3d49('0x61'),'updatedAt',_0x3d49('0x62')]});}})['then'](function(_0x1d7dd5){if(_0x1d7dd5){return{'count':_0x1d7dd5[_0x3d49('0x44')],'rows':_['map'](_0x1d7dd5[_0x3d49('0x48')],function(_0x4289be){return{'membername':_0x4289be[_0x3d49('0x2c')],'UserId':_0x4289be['id'],'queue_name':_0x81e1ff[_0x3d49('0x2c')],'SmsQueueId':_0x81e1ff['id'],'interface':util[_0x3d49('0x63')](_0x3d49('0x64'),_0x3d49('0x65'),_0x4289be[_0x3d49('0x2c')]),'penalty':0x0,'paused':_0x4289be[_0x3d49('0x61')],'createdAt':_0x4289be[_0x3d49('0x62')],'updatedAt':_0x4289be[_0x3d49('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3d49('0x25')](respondWithFilteredResult(_0x2e0ca7,_0x1581cf))[_0x3d49('0x49')](handleError(_0x2e0ca7,null));};exports[_0x3d49('0x67')]=function(_0x1425ca,_0x3b8e77,_0xabbfe8){var _0x53995f={};var _0x38d399={};var _0x296d85;var _0x355b42;return db[_0x3d49('0x43')][_0x3d49('0x5a')]({'where':{'id':_0x1425ca[_0x3d49('0x4b')]['id']}})[_0x3d49('0x25')](handleEntityNotFound(_0x3b8e77,null))[_0x3d49('0x25')](function(_0xb5fcb2){if(_0xb5fcb2){_0x296d85=_0xb5fcb2;_0x38d399[_0x3d49('0x4c')]=_[_0x3d49('0x2f')](db[_0x3d49('0x68')][_0x3d49('0x2e')]);_0x38d399[_0x3d49('0x30')]=_[_0x3d49('0x2f')](_0x1425ca[_0x3d49('0x30')]);_0x38d399['filters']=_[_0x3d49('0x31')](_0x38d399[_0x3d49('0x4c')],_0x38d399['query']);_0x53995f['attributes']=_[_0x3d49('0x31')](_0x38d399['model'],qs[_0x3d49('0x32')](_0x1425ca[_0x3d49('0x30')][_0x3d49('0x32')]));_0x53995f[_0x3d49('0x33')]=_0x53995f[_0x3d49('0x33')]['length']?_0x53995f[_0x3d49('0x33')]:_0x38d399[_0x3d49('0x4c')];_0x53995f[_0x3d49('0x37')]=qs[_0x3d49('0x38')](_0x1425ca[_0x3d49('0x30')][_0x3d49('0x38')]);_0x53995f[_0x3d49('0x39')]=qs[_0x3d49('0x3b')](_[_0x3d49('0x3a')](_0x1425ca['query'],_0x38d399[_0x3d49('0x3b')]));if(_0x1425ca[_0x3d49('0x30')][_0x3d49('0x3c')]){_0x53995f[_0x3d49('0x39')]=_[_0x3d49('0x3d')](_0x53995f[_0x3d49('0x39')],{'$or':_[_0x3d49('0x3e')](_0x53995f[_0x3d49('0x33')],function(_0x2f659f){var _0x5b7db7={};_0x5b7db7[_0x2f659f]={'$like':'%'+_0x1425ca[_0x3d49('0x30')][_0x3d49('0x3c')]+'%'};return _0x5b7db7;})});}_0x53995f=_[_0x3d49('0x3d')]({},_0x53995f,_0x1425ca[_0x3d49('0x4d')]);return _0x296d85[_0x3d49('0x67')](_0x53995f);}})[_0x3d49('0x25')](function(_0x3253b2){if(_0x3253b2){_0x355b42=_0x3253b2[_0x3d49('0x34')];if(!_0x1425ca[_0x3d49('0x30')]['hasOwnProperty']('nolimit')){_0x53995f[_0x3d49('0x36')]=qs['limit'](_0x1425ca[_0x3d49('0x30')][_0x3d49('0x36')]);_0x53995f['offset']=qs[_0x3d49('0x21')](_0x1425ca['query'][_0x3d49('0x21')]);}return _0x296d85[_0x3d49('0x67')](_0x53995f);}})['then'](function(_0x187e27){if(_0x187e27){return _0x187e27?{'count':_0x355b42,'rows':_0x187e27}:null;}})[_0x3d49('0x25')](respondWithResult(_0x3b8e77,null))[_0x3d49('0x49')](handleError(_0x3b8e77,null));};exports[_0x3d49('0x69')]=function(_0x3e3c52,_0x1f86ab,_0xb3edd6){var _0x591e0f=[];var _0x5667f4;return db[_0x3d49('0x68')][_0x3d49('0x47')]({'where':{'id':_0x3e3c52[_0x3d49('0x57')][_0x3d49('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x3d49('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](function(_0x2c125f){if(_0x2c125f){for(var _0x5a8458=0x0;_0x5a8458<_0x2c125f['length'];_0x5a8458+=0x1){for(var _0x33634b=0x0;_0x33634b<_0x2c125f[_0x5a8458]['Agents'][_0x3d49('0x34')];_0x33634b+=0x1){_0x591e0f=_['union'](_0x591e0f,[_0x2c125f[_0x5a8458][_0x3d49('0x6b')][_0x33634b]['id']]);}}return _0x591e0f;}})[_0x3d49('0x25')](function(_0x3a3695){if(_0x3a3695){return db[_0x3d49('0x43')][_0x3d49('0x4e')]({'where':{'id':_0x3e3c52['params']['id']}});}})[_0x3d49('0x25')](function(_0x263c87){if(_0x263c87){_0x5667f4=_0x263c87;return _0x5667f4[_0x3d49('0x6c')](_0x591e0f,{'penalty':_0x3e3c52[_0x3d49('0x57')][_0x3d49('0x6d')]});}})[_0x3d49('0x25')](function(_0x3ae41d){if(_0x3ae41d){return _0x5667f4['addTeams'](_0x3e3c52['body']['ids']);}})[_0x3d49('0x25')](handleEntityNotFound(_0x1f86ab,null))[_0x3d49('0x25')](respondWithStatusCode(_0x1f86ab,null))[_0x3d49('0x49')](handleError(_0x1f86ab,null));};exports[_0x3d49('0x6e')]=function(_0x50d5b6,_0x320954,_0x59d8ee){var _0x295539=[];var _0x4f2087;return db[_0x3d49('0x68')][_0x3d49('0x47')]({'where':{'id':_0x50d5b6[_0x3d49('0x30')][_0x3d49('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3d49('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x3d49('0x25')](function(_0x5a3355){if(_0x5a3355){for(var _0x25e5f0=0x0;_0x25e5f0<_0x5a3355[_0x3d49('0x34')];_0x25e5f0+=0x1){for(var _0x5d4d91=0x0;_0x5d4d91<_0x5a3355[_0x25e5f0][_0x3d49('0x6b')]['length'];_0x5d4d91+=0x1){_0x295539=_['union'](_0x295539,[_0x5a3355[_0x25e5f0]['Agents'][_0x5d4d91]['id']]);}}return _0x295539;}})[_0x3d49('0x25')](function(_0x1b42ad){if(_0x1b42ad){return db[_0x3d49('0x43')]['find']({'where':{'id':_0x50d5b6['params']['id']}});}})[_0x3d49('0x25')](function(_0x22d473){if(_0x22d473){_0x4f2087=_0x22d473;return _0x4f2087['removeAgents'](_0x295539);}})[_0x3d49('0x25')](function(_0x1c3c8){if(_0x4f2087){return _0x4f2087[_0x3d49('0x6e')](_0x50d5b6['query'][_0x3d49('0x6a')]);}})[_0x3d49('0x25')](handleEntityNotFound(_0x320954,null))[_0x3d49('0x25')](respondWithStatusCode(_0x320954,null))['catch'](handleError(_0x320954,null));};exports[_0x3d49('0x6c')]=function(_0x178171,_0x4caa2f,_0x8ba745){return db[_0x3d49('0x43')]['find']({'where':{'id':_0x178171[_0x3d49('0x4b')]['id']}})[_0x3d49('0x25')](handleEntityNotFound(_0x4caa2f,null))[_0x3d49('0x25')](function(_0x2015eb){if(_0x2015eb){return _0x2015eb[_0x3d49('0x6c')](_0x178171[_0x3d49('0x57')][_0x3d49('0x6a')],_[_0x3d49('0x6f')](_0x178171[_0x3d49('0x57')],['ids','id'])||{})[_0x3d49('0x70')](function(_0x178d96){for(var _0x240a8b=0x0;_0x240a8b<_0x178171['body'][_0x3d49('0x6a')]['length'];_0x240a8b+=0x1){socket['emit'](_0x3d49('0x71'),{'UserId':_0x178171[_0x3d49('0x57')][_0x3d49('0x6a')][_0x240a8b],'SmsQueueId':_0x178171['params']['id']});}return _0x178d96;});}})[_0x3d49('0x25')](respondWithResult(_0x4caa2f,null))[_0x3d49('0x49')](handleError(_0x4caa2f,null));};exports['removeAgents']=function(_0x864114,_0x47fe9a,_0x4be5c1){var _0x48210a;return db[_0x3d49('0x43')][_0x3d49('0x4e')]({'where':{'id':_0x864114[_0x3d49('0x4b')]['id']}})[_0x3d49('0x25')](handleEntityNotFound(_0x47fe9a,null))['then'](function(_0x1bbfb4){if(_0x1bbfb4){return _0x1bbfb4[_0x3d49('0x72')](_0x864114[_0x3d49('0x30')][_0x3d49('0x6a')])[_0x3d49('0x25')](function(_0x47453e){if(_[_0x3d49('0x73')](_0x864114[_0x3d49('0x30')]['ids'])){for(var _0x40701e=0x0;_0x40701e<_0x864114[_0x3d49('0x30')]['ids'][_0x3d49('0x34')];_0x40701e+=0x1){socket[_0x3d49('0x74')]('userSmsQueue:remove',{'UserId':_0x864114[_0x3d49('0x30')][_0x3d49('0x6a')][_0x40701e],'SmsQueueId':_0x864114[_0x3d49('0x4b')]['id']});}}else{socket[_0x3d49('0x74')]('userSmsQueue:remove',{'UserId':_0x864114[_0x3d49('0x30')][_0x3d49('0x6a')],'SmsQueueId':_0x864114['params']['id']});}});}})[_0x3d49('0x25')](respondWithStatusCode(_0x47fe9a,null))[_0x3d49('0x49')](handleError(_0x47fe9a,null));};exports['getAgents']=function(_0x58ce8b,_0x4173c9,_0x3ac749){var _0x304610={};var _0x1edf23={};var _0x4fd85d;var _0x4b8537;return db[_0x3d49('0x43')][_0x3d49('0x5a')]({'where':{'id':_0x58ce8b['params']['id']}})['then'](handleEntityNotFound(_0x4173c9,null))['then'](function(_0x1cc31c){if(_0x1cc31c){_0x4fd85d=_0x1cc31c;_0x1edf23[_0x3d49('0x4c')]=_[_0x3d49('0x2f')](db[_0x3d49('0x5d')]['rawAttributes']);_0x1edf23[_0x3d49('0x30')]=_[_0x3d49('0x2f')](_0x58ce8b[_0x3d49('0x30')]);_0x1edf23[_0x3d49('0x3b')]=_[_0x3d49('0x31')](_0x1edf23[_0x3d49('0x4c')],_0x1edf23[_0x3d49('0x30')]);_0x304610[_0x3d49('0x33')]=_[_0x3d49('0x31')](_0x1edf23[_0x3d49('0x4c')],qs[_0x3d49('0x32')](_0x58ce8b['query'][_0x3d49('0x32')]));_0x304610[_0x3d49('0x33')]=_0x304610[_0x3d49('0x33')]['length']?_0x304610[_0x3d49('0x33')]:_0x1edf23['model'];_0x304610['order']=qs[_0x3d49('0x38')](_0x58ce8b['query'][_0x3d49('0x38')]);_0x304610[_0x3d49('0x39')]=qs[_0x3d49('0x3b')](_[_0x3d49('0x3a')](_0x58ce8b['query'],_0x1edf23['filters']));if(_0x58ce8b[_0x3d49('0x30')]['filter']){_0x304610[_0x3d49('0x39')]=_[_0x3d49('0x3d')](_0x304610[_0x3d49('0x39')],{'$or':_[_0x3d49('0x3e')](_0x304610[_0x3d49('0x33')],function(_0x167f1f){var _0x2638a9={};_0x2638a9[_0x167f1f]={'$like':'%'+_0x58ce8b[_0x3d49('0x30')][_0x3d49('0x3c')]+'%'};return _0x2638a9;})});}_0x304610=_['merge']({},_0x304610,_0x58ce8b[_0x3d49('0x4d')]);return _0x4fd85d[_0x3d49('0x75')](_0x304610);}})[_0x3d49('0x25')](function(_0x68dfff){if(_0x68dfff){_0x4b8537=_0x68dfff[_0x3d49('0x34')];if(!_0x58ce8b[_0x3d49('0x30')][_0x3d49('0x35')](_0x3d49('0x5b'))){_0x304610['limit']=qs[_0x3d49('0x36')](_0x58ce8b[_0x3d49('0x30')][_0x3d49('0x36')]);_0x304610[_0x3d49('0x21')]=qs['offset'](_0x58ce8b['query'][_0x3d49('0x21')]);}return _0x4fd85d[_0x3d49('0x75')](_0x304610);}})['then'](function(_0x4b6f6c){if(_0x4b6f6c){return _0x4b6f6c?{'count':_0x4b8537,'rows':_0x4b6f6c}:null;}})[_0x3d49('0x25')](respondWithResult(_0x4173c9,null))[_0x3d49('0x49')](handleError(_0x4173c9,null));}; \ No newline at end of file +var _0x023a=['options','catch','create','body','user','role','SmsQueues','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserSmsQueue','sort','SmsQueueId','map','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','filter','addTeams','Team','ids','Agents','union','penalty','removeAgents','addAgents','omit','spread','userSmsQueue:save','isArray','emit','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','get','stack','name','send','SmsQueue','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','includeAll','include','rows','show','params','rawAttributes','intersection'];(function(_0x12e73c,_0x2cbe1d){var _0x4c41cb=function(_0x10283b){while(--_0x10283b){_0x12e73c['push'](_0x12e73c['shift']());}};_0x4c41cb(++_0x2cbe1d);}(_0x023a,0x113));var _0xa023=function(_0x11a5fb,_0x25c0db){_0x11a5fb=_0x11a5fb-0x0;var _0x275b73=_0x023a[_0x11a5fb];return _0x275b73;};'use strict';var pdf=require(_0xa023('0x0'));var emlformat=require(_0xa023('0x1'));var rimraf=require(_0xa023('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa023('0x3'));var rp=require(_0xa023('0x4'));var moment=require(_0xa023('0x5'));var BPromise=require(_0xa023('0x6'));var Mustache=require(_0xa023('0x7'));var util=require(_0xa023('0x8'));var path=require(_0xa023('0x9'));var sox=require(_0xa023('0xa'));var csv=require(_0xa023('0xb'));var ejs=require(_0xa023('0xc'));var fs=require('fs');var _=require(_0xa023('0xd'));var squel=require(_0xa023('0xe'));var crypto=require(_0xa023('0xf'));var jsforce=require(_0xa023('0x10'));var deskjs=require(_0xa023('0x11'));var toCsv=require('to-csv');var querystring=require(_0xa023('0x12'));var Papa=require('papaparse');var authService=require(_0xa023('0x13'));var hardwareService=require(_0xa023('0x14'));var Redis=require(_0xa023('0x15'));var qs=require(_0xa023('0x16'));var logger=require(_0xa023('0x17'))(_0xa023('0x18'));var utils=require(_0xa023('0x19'));var config=require(_0xa023('0x1a'));var db=require(_0xa023('0x1b'))['db'];config[_0xa023('0x1c')]=_[_0xa023('0x1d')](config['redis'],{'host':_0xa023('0x1e'),'port':0x18eb});var socket=require(_0xa023('0x1f'))(new Redis(config[_0xa023('0x1c')]));require(_0xa023('0x20'))['register'](socket);function respondWithStatusCode(_0x13892e,_0x1d1650){_0x1d1650=_0x1d1650||0xcc;return function(_0x5794fb){if(_0x5794fb){return _0x13892e['sendStatus'](_0x1d1650);}return _0x13892e[_0xa023('0x21')](_0x1d1650)[_0xa023('0x22')]();};}function respondWithResult(_0x1d943e,_0x1da3d0){_0x1da3d0=_0x1da3d0||0xc8;return function(_0x1b6ad6){if(_0x1b6ad6){return _0x1d943e[_0xa023('0x21')](_0x1da3d0)[_0xa023('0x23')](_0x1b6ad6);}};}function respondWithFilteredResult(_0x3de6e6,_0x48afb7){return function(_0x1b8add){if(_0x1b8add){var _0x5ad0ee=_0x1b8add[_0xa023('0x24')],_0x54687b=_0x48afb7[_0xa023('0x25')],_0x13da09=_0x48afb7[_0xa023('0x25')]+_0x48afb7[_0xa023('0x26')],_0x56ad7d;if(_0x13da09>=_0x5ad0ee){_0x13da09=_0x5ad0ee;_0x56ad7d=0xc8;}else{_0x56ad7d=0xce;}_0x3de6e6[_0xa023('0x21')](_0x56ad7d);return _0x3de6e6[_0xa023('0x27')]('Content-Range',_0x54687b+'-'+_0x13da09+'/'+_0x5ad0ee)[_0xa023('0x23')](_0x1b8add);}return null;};}function patchUpdates(_0x1e5426){return function(_0xea11ed){try{jsonpatch[_0xa023('0x28')](_0xea11ed,_0x1e5426,!![]);}catch(_0x1fc012){return BPromise[_0xa023('0x29')](_0x1fc012);}return _0xea11ed['save']();};}function saveUpdates(_0x433305,_0x3cdad6){return function(_0x1de5a4){if(_0x1de5a4){return _0x1de5a4[_0xa023('0x2a')](_0x433305)[_0xa023('0x2b')](function(_0x30c6e1){return _0x30c6e1;});}return null;};}function removeEntity(_0x5e0d6a,_0x31933e){return function(_0x5677c1){if(_0x5677c1){return _0x5677c1[_0xa023('0x2c')]()[_0xa023('0x2b')](function(){var _0x449075=_0x5677c1[_0xa023('0x2d')]({'plain':!![]});var _0x1686e9='SmsQueues';return db['UserProfileResource'][_0xa023('0x2c')]({'where':{'type':_0x1686e9,'resourceId':_0x449075['id']}})[_0xa023('0x2b')](function(){return _0x5677c1;});})[_0xa023('0x2b')](function(){_0x5e0d6a[_0xa023('0x21')](0xcc)[_0xa023('0x22')]();});}};}function handleEntityNotFound(_0x5023ed,_0x5e85cc){return function(_0x1a2095){if(!_0x1a2095){_0x5023ed['sendStatus'](0x194);}return _0x1a2095;};}function handleError(_0x59cb10,_0x2c9602){_0x2c9602=_0x2c9602||0x1f4;return function(_0x17b5af){logger['error'](_0x17b5af[_0xa023('0x2e')]);if(_0x17b5af['name']){delete _0x17b5af[_0xa023('0x2f')];}_0x59cb10[_0xa023('0x21')](_0x2c9602)[_0xa023('0x30')](_0x17b5af);};}exports['index']=function(_0xb416ce,_0x248def){var _0x1cde6c={},_0xa5c4ab={},_0x19cd50={'count':0x0,'rows':[]};var _0x5dedc0=db[_0xa023('0x31')]['rawAttributes'];_0xa5c4ab['model']=_['keys'](_0x5dedc0);_0xa5c4ab[_0xa023('0x32')]=_[_0xa023('0x33')](_0xb416ce[_0xa023('0x32')]);_0xa5c4ab[_0xa023('0x34')]=_['intersection'](_0xa5c4ab[_0xa023('0x35')],_0xa5c4ab[_0xa023('0x32')]);_0x1cde6c[_0xa023('0x36')]=_['intersection'](_0xa5c4ab[_0xa023('0x35')],qs[_0xa023('0x37')](_0xb416ce[_0xa023('0x32')][_0xa023('0x37')]));_0x1cde6c['attributes']=_0x1cde6c[_0xa023('0x36')][_0xa023('0x38')]?_0x1cde6c[_0xa023('0x36')]:_0xa5c4ab['model'];if(!_0xb416ce[_0xa023('0x32')][_0xa023('0x39')](_0xa023('0x3a'))){_0x1cde6c['limit']=qs['limit'](_0xb416ce[_0xa023('0x32')]['limit']);_0x1cde6c['offset']=qs['offset'](_0xb416ce['query'][_0xa023('0x25')]);}_0x1cde6c[_0xa023('0x3b')]=qs['sort'](_0xb416ce[_0xa023('0x32')]['sort']);_0x1cde6c[_0xa023('0x3c')]=qs[_0xa023('0x34')](_[_0xa023('0x3d')](_0xb416ce[_0xa023('0x32')],_0xa5c4ab[_0xa023('0x34')]));if(_0xb416ce[_0xa023('0x32')]['filter']){_0x1cde6c[_0xa023('0x3c')]=_['merge'](_0x1cde6c[_0xa023('0x3c')],{'$or':_['map'](_0x5dedc0,function(_0x40bed1){if(_0x40bed1['type']['key']!=='VIRTUAL'){var _0x355703={};_0x355703[_0x40bed1['field']]={'$like':'%'+_0xb416ce[_0xa023('0x32')]['filter']+'%'};return _0x355703;}})});}_0x1cde6c=_[_0xa023('0x3e')]({},_0x1cde6c,_0xb416ce['options']);var _0x125709={'where':_0x1cde6c[_0xa023('0x3c')]};return db[_0xa023('0x31')][_0xa023('0x24')](_0x125709)[_0xa023('0x2b')](function(_0x35ef47){_0x19cd50[_0xa023('0x24')]=_0x35ef47;if(_0xb416ce['query'][_0xa023('0x3f')]){_0x1cde6c[_0xa023('0x40')]=[{'all':!![]}];}return db[_0xa023('0x31')]['findAll'](_0x1cde6c);})[_0xa023('0x2b')](function(_0xce41ea){_0x19cd50[_0xa023('0x41')]=_0xce41ea;return _0x19cd50;})[_0xa023('0x2b')](respondWithFilteredResult(_0x248def,_0x1cde6c))['catch'](handleError(_0x248def,null));};exports[_0xa023('0x42')]=function(_0x59a141,_0x192756){var _0x166b99={'raw':!![],'where':{'id':_0x59a141[_0xa023('0x43')]['id']}},_0x3516fc={};_0x3516fc[_0xa023('0x35')]=_[_0xa023('0x33')](db[_0xa023('0x31')][_0xa023('0x44')]);_0x3516fc['query']=_[_0xa023('0x33')](_0x59a141[_0xa023('0x32')]);_0x3516fc[_0xa023('0x34')]=_[_0xa023('0x45')](_0x3516fc[_0xa023('0x35')],_0x3516fc['query']);_0x166b99[_0xa023('0x36')]=_[_0xa023('0x45')](_0x3516fc['model'],qs[_0xa023('0x37')](_0x59a141[_0xa023('0x32')][_0xa023('0x37')]));_0x166b99['attributes']=_0x166b99[_0xa023('0x36')][_0xa023('0x38')]?_0x166b99[_0xa023('0x36')]:_0x3516fc[_0xa023('0x35')];if(_0x59a141[_0xa023('0x32')][_0xa023('0x3f')]){_0x166b99['include']=[{'all':!![]}];}_0x166b99=_['merge']({},_0x166b99,_0x59a141[_0xa023('0x46')]);return db[_0xa023('0x31')]['find'](_0x166b99)[_0xa023('0x2b')](handleEntityNotFound(_0x192756,null))[_0xa023('0x2b')](respondWithResult(_0x192756,null))[_0xa023('0x47')](handleError(_0x192756,null));};exports[_0xa023('0x48')]=function(_0x442fb3,_0x470daf){return db[_0xa023('0x31')][_0xa023('0x48')](_0x442fb3[_0xa023('0x49')],{})[_0xa023('0x2b')](function(_0x1de879){var _0x319486=_0x442fb3[_0xa023('0x4a')][_0xa023('0x2d')]({'plain':!![]});if(!_0x319486)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x319486[_0xa023('0x4b')]===_0xa023('0x4a')){var _0x21bb15=_0x1de879[_0xa023('0x2d')]({'plain':!![]});var _0x446195=_0xa023('0x4c');return db['UserProfileSection'][_0xa023('0x4d')]({'where':{'name':_0x446195,'userProfileId':_0x319486[_0xa023('0x4e')]},'raw':!![]})[_0xa023('0x2b')](function(_0x26e2c9){if(_0x26e2c9&&_0x26e2c9[_0xa023('0x4f')]===0x0){return db['UserProfileResource'][_0xa023('0x48')]({'name':_0x21bb15[_0xa023('0x2f')],'resourceId':_0x21bb15['id'],'type':_0x26e2c9[_0xa023('0x2f')],'sectionId':_0x26e2c9['id']},{})['then'](function(){return _0x1de879;});}else{return _0x1de879;}})[_0xa023('0x47')](function(_0x37cff0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37cff0);throw _0x37cff0;});}return _0x1de879;})['then'](respondWithResult(_0x470daf,0xc9))['catch'](handleError(_0x470daf,null));};exports[_0xa023('0x2a')]=function(_0x11955c,_0x510c93){if(_0x11955c[_0xa023('0x49')]['id']){delete _0x11955c[_0xa023('0x49')]['id'];}return db[_0xa023('0x31')][_0xa023('0x4d')]({'where':{'id':_0x11955c[_0xa023('0x43')]['id']}})[_0xa023('0x2b')](handleEntityNotFound(_0x510c93,null))[_0xa023('0x2b')](saveUpdates(_0x11955c[_0xa023('0x49')],null))[_0xa023('0x2b')](respondWithResult(_0x510c93,null))['catch'](handleError(_0x510c93,null));};exports[_0xa023('0x2c')]=function(_0x1e3be1,_0x236136){return db[_0xa023('0x31')][_0xa023('0x4d')]({'where':{'id':_0x1e3be1[_0xa023('0x43')]['id']}})[_0xa023('0x2b')](handleEntityNotFound(_0x236136,null))['then'](removeEntity(_0x236136,null))[_0xa023('0x47')](handleError(_0x236136,null));};exports['describe']=function(_0x24fc57,_0x3b8f03){return db[_0xa023('0x31')][_0xa023('0x50')]()[_0xa023('0x2b')](respondWithResult(_0x3b8f03,null))[_0xa023('0x47')](handleError(_0x3b8f03,null));};exports[_0xa023('0x51')]=function(_0x504eaa,_0x2a9d3a,_0x4f08ae){var _0x307a9c={'raw':!![],'where':{}},_0x2c7f0c={},_0x281c46;return db[_0xa023('0x31')][_0xa023('0x52')]({'where':{'id':_0x504eaa['params']['id']}})['then'](handleEntityNotFound(_0x2a9d3a,null))[_0xa023('0x2b')](function(_0x157476){if(_0x157476){_0x281c46=_0x157476[_0xa023('0x2d')]({'plain':!![]});_0x2c7f0c[_0xa023('0x35')]=_['keys'](db[_0xa023('0x53')][_0xa023('0x44')]);_0x2c7f0c[_0xa023('0x32')]=_[_0xa023('0x33')](_0x504eaa[_0xa023('0x32')]);_0x2c7f0c['filters']=_[_0xa023('0x45')](_0x2c7f0c['model'],_0x2c7f0c[_0xa023('0x32')]);_0x307a9c[_0xa023('0x36')]=_[_0xa023('0x45')](_0x2c7f0c['model'],qs[_0xa023('0x37')](_0x504eaa[_0xa023('0x32')][_0xa023('0x37')]));_0x307a9c[_0xa023('0x36')]=_0x307a9c[_0xa023('0x36')][_0xa023('0x38')]?_0x307a9c[_0xa023('0x36')]:_0x2c7f0c[_0xa023('0x35')];if(!_0x504eaa['query'][_0xa023('0x39')](_0xa023('0x3a'))){_0x307a9c[_0xa023('0x26')]=qs[_0xa023('0x26')](_0x504eaa['query']['limit']);_0x307a9c['offset']=qs[_0xa023('0x25')](_0x504eaa[_0xa023('0x32')]['offset']);}_0x307a9c['order']=qs[_0xa023('0x54')](_0x504eaa['query']['sort']);_0x307a9c[_0xa023('0x3c')]=qs['filters'](_[_0xa023('0x3d')](_0x504eaa['query'],_0x2c7f0c[_0xa023('0x34')]));_0x307a9c['where'][_0xa023('0x55')]=_0x157476['id'];if(_0x504eaa[_0xa023('0x32')]['filter']){_0x307a9c[_0xa023('0x3c')]=_[_0xa023('0x3e')](_0x307a9c[_0xa023('0x3c')],{'$or':_[_0xa023('0x56')](_0x307a9c['attributes'],function(_0x3352b8){var _0x3fb2e7={};_0x3fb2e7[_0x3352b8]={'$like':'%'+_0x504eaa['query']['filter']+'%'};return _0x3fb2e7;})});}_0x307a9c=_[_0xa023('0x3e')]({},_0x307a9c,_0x504eaa[_0xa023('0x46')]);return db[_0xa023('0x53')][_0xa023('0x57')](_0x307a9c);}})[_0xa023('0x2b')](function(_0x802a08){if(_0x802a08){return db[_0xa023('0x58')][_0xa023('0x59')]({'where':{'id':_[_0xa023('0x56')](_0x802a08,_0xa023('0x5a')),'role':_0xa023('0x5b')},'attributes':['id','name',_0xa023('0x5c'),_0xa023('0x5d'),'createdAt']});}})[_0xa023('0x2b')](function(_0x2a711f){if(_0x2a711f){return{'count':_0x2a711f[_0xa023('0x24')],'rows':_[_0xa023('0x56')](_0x2a711f[_0xa023('0x41')],function(_0x5fb1e6){return{'membername':_0x5fb1e6['name'],'UserId':_0x5fb1e6['id'],'queue_name':_0x281c46[_0xa023('0x2f')],'SmsQueueId':_0x281c46['id'],'interface':util[_0xa023('0x5e')](_0xa023('0x5f'),_0xa023('0x60'),_0x5fb1e6['name']),'penalty':0x0,'paused':_0x5fb1e6[_0xa023('0x5c')],'createdAt':_0x5fb1e6[_0xa023('0x61')],'updatedAt':_0x5fb1e6[_0xa023('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa023('0x2b')](respondWithFilteredResult(_0x2a9d3a,_0x307a9c))[_0xa023('0x47')](handleError(_0x2a9d3a,null));};exports[_0xa023('0x62')]=function(_0xa52000,_0x2bf6be,_0x5b4b7b){var _0x542c5e={};var _0x4fff43={};var _0xadf8d3;var _0x940aa2;return db[_0xa023('0x31')]['findOne']({'where':{'id':_0xa52000[_0xa023('0x43')]['id']}})[_0xa023('0x2b')](handleEntityNotFound(_0x2bf6be,null))['then'](function(_0x4155d5){if(_0x4155d5){_0xadf8d3=_0x4155d5;_0x4fff43[_0xa023('0x35')]=_[_0xa023('0x33')](db['Team'][_0xa023('0x44')]);_0x4fff43[_0xa023('0x32')]=_['keys'](_0xa52000[_0xa023('0x32')]);_0x4fff43[_0xa023('0x34')]=_[_0xa023('0x45')](_0x4fff43[_0xa023('0x35')],_0x4fff43[_0xa023('0x32')]);_0x542c5e[_0xa023('0x36')]=_['intersection'](_0x4fff43[_0xa023('0x35')],qs[_0xa023('0x37')](_0xa52000[_0xa023('0x32')]['fields']));_0x542c5e[_0xa023('0x36')]=_0x542c5e['attributes'][_0xa023('0x38')]?_0x542c5e[_0xa023('0x36')]:_0x4fff43['model'];_0x542c5e[_0xa023('0x3b')]=qs['sort'](_0xa52000[_0xa023('0x32')][_0xa023('0x54')]);_0x542c5e[_0xa023('0x3c')]=qs[_0xa023('0x34')](_[_0xa023('0x3d')](_0xa52000[_0xa023('0x32')],_0x4fff43[_0xa023('0x34')]));if(_0xa52000['query'][_0xa023('0x63')]){_0x542c5e[_0xa023('0x3c')]=_[_0xa023('0x3e')](_0x542c5e[_0xa023('0x3c')],{'$or':_[_0xa023('0x56')](_0x542c5e['attributes'],function(_0x247119){var _0x194cd9={};_0x194cd9[_0x247119]={'$like':'%'+_0xa52000[_0xa023('0x32')][_0xa023('0x63')]+'%'};return _0x194cd9;})});}_0x542c5e=_[_0xa023('0x3e')]({},_0x542c5e,_0xa52000[_0xa023('0x46')]);return _0xadf8d3[_0xa023('0x62')](_0x542c5e);}})[_0xa023('0x2b')](function(_0x5b7638){if(_0x5b7638){_0x940aa2=_0x5b7638[_0xa023('0x38')];if(!_0xa52000['query'][_0xa023('0x39')]('nolimit')){_0x542c5e['limit']=qs[_0xa023('0x26')](_0xa52000['query']['limit']);_0x542c5e[_0xa023('0x25')]=qs[_0xa023('0x25')](_0xa52000[_0xa023('0x32')]['offset']);}return _0xadf8d3['getTeams'](_0x542c5e);}})[_0xa023('0x2b')](function(_0xa79584){if(_0xa79584){return _0xa79584?{'count':_0x940aa2,'rows':_0xa79584}:null;}})[_0xa023('0x2b')](respondWithResult(_0x2bf6be,null))['catch'](handleError(_0x2bf6be,null));};exports[_0xa023('0x64')]=function(_0x3261b7,_0x4e6497,_0x33bed6){var _0x430d81=[];var _0x56cb14;return db[_0xa023('0x65')][_0xa023('0x57')]({'where':{'id':_0x3261b7[_0xa023('0x49')][_0xa023('0x66')]},'attributes':['id'],'include':[{'model':db[_0xa023('0x58')],'as':_0xa023('0x67'),'attributes':['id'],'raw':!![]}]})[_0xa023('0x2b')](function(_0x4d9ac0){if(_0x4d9ac0){for(var _0x18c12e=0x0;_0x18c12e<_0x4d9ac0[_0xa023('0x38')];_0x18c12e+=0x1){for(var _0x1f9109=0x0;_0x1f9109<_0x4d9ac0[_0x18c12e][_0xa023('0x67')]['length'];_0x1f9109+=0x1){_0x430d81=_[_0xa023('0x68')](_0x430d81,[_0x4d9ac0[_0x18c12e]['Agents'][_0x1f9109]['id']]);}}return _0x430d81;}})[_0xa023('0x2b')](function(_0x5cd8a6){if(_0x5cd8a6){return db[_0xa023('0x31')][_0xa023('0x4d')]({'where':{'id':_0x3261b7[_0xa023('0x43')]['id']}});}})['then'](function(_0x4078a1){if(_0x4078a1){_0x56cb14=_0x4078a1;return _0x56cb14['addAgents'](_0x430d81,{'penalty':_0x3261b7['body'][_0xa023('0x69')]});}})[_0xa023('0x2b')](function(_0x1f2a8d){if(_0x1f2a8d){return _0x56cb14[_0xa023('0x64')](_0x3261b7['body'][_0xa023('0x66')]);}})[_0xa023('0x2b')](handleEntityNotFound(_0x4e6497,null))[_0xa023('0x2b')](respondWithStatusCode(_0x4e6497,null))[_0xa023('0x47')](handleError(_0x4e6497,null));};exports['removeTeams']=function(_0x30a661,_0x312aa0,_0x4ad624){var _0x236110=[];var _0x5501a8;return db['Team'][_0xa023('0x57')]({'where':{'id':_0x30a661[_0xa023('0x32')][_0xa023('0x66')]},'attributes':['id'],'include':[{'model':db[_0xa023('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa023('0x2b')](function(_0xddff38){if(_0xddff38){for(var _0x3d7a57=0x0;_0x3d7a57<_0xddff38[_0xa023('0x38')];_0x3d7a57+=0x1){for(var _0xae23d7=0x0;_0xae23d7<_0xddff38[_0x3d7a57][_0xa023('0x67')][_0xa023('0x38')];_0xae23d7+=0x1){_0x236110=_[_0xa023('0x68')](_0x236110,[_0xddff38[_0x3d7a57]['Agents'][_0xae23d7]['id']]);}}return _0x236110;}})[_0xa023('0x2b')](function(_0x391e07){if(_0x391e07){return db[_0xa023('0x31')][_0xa023('0x4d')]({'where':{'id':_0x30a661[_0xa023('0x43')]['id']}});}})[_0xa023('0x2b')](function(_0x77760b){if(_0x77760b){_0x5501a8=_0x77760b;return _0x5501a8[_0xa023('0x6a')](_0x236110);}})[_0xa023('0x2b')](function(_0x5ad739){if(_0x5501a8){return _0x5501a8['removeTeams'](_0x30a661['query'][_0xa023('0x66')]);}})[_0xa023('0x2b')](handleEntityNotFound(_0x312aa0,null))[_0xa023('0x2b')](respondWithStatusCode(_0x312aa0,null))['catch'](handleError(_0x312aa0,null));};exports[_0xa023('0x6b')]=function(_0x1b56d8,_0x2a0e49,_0x1f2dcf){return db['SmsQueue'][_0xa023('0x4d')]({'where':{'id':_0x1b56d8[_0xa023('0x43')]['id']}})[_0xa023('0x2b')](handleEntityNotFound(_0x2a0e49,null))['then'](function(_0x55d20a){if(_0x55d20a){return _0x55d20a['addAgents'](_0x1b56d8[_0xa023('0x49')][_0xa023('0x66')],_[_0xa023('0x6c')](_0x1b56d8['body'],[_0xa023('0x66'),'id'])||{})[_0xa023('0x6d')](function(_0x4c0d22){for(var _0x5b9237=0x0;_0x5b9237<_0x1b56d8[_0xa023('0x49')]['ids'][_0xa023('0x38')];_0x5b9237+=0x1){socket['emit'](_0xa023('0x6e'),{'UserId':_0x1b56d8[_0xa023('0x49')][_0xa023('0x66')][_0x5b9237],'SmsQueueId':_0x1b56d8[_0xa023('0x43')]['id']});}return _0x4c0d22;});}})[_0xa023('0x2b')](respondWithResult(_0x2a0e49,null))[_0xa023('0x47')](handleError(_0x2a0e49,null));};exports[_0xa023('0x6a')]=function(_0x31dc4e,_0x36fda2,_0x489024){var _0x2ae391;return db[_0xa023('0x31')][_0xa023('0x4d')]({'where':{'id':_0x31dc4e[_0xa023('0x43')]['id']}})['then'](handleEntityNotFound(_0x36fda2,null))[_0xa023('0x2b')](function(_0x4bb69e){if(_0x4bb69e){return _0x4bb69e[_0xa023('0x6a')](_0x31dc4e[_0xa023('0x32')][_0xa023('0x66')])[_0xa023('0x2b')](function(_0x558659){if(_[_0xa023('0x6f')](_0x31dc4e['query']['ids'])){for(var _0x1a5018=0x0;_0x1a5018<_0x31dc4e[_0xa023('0x32')][_0xa023('0x66')]['length'];_0x1a5018+=0x1){socket[_0xa023('0x70')](_0xa023('0x71'),{'UserId':_0x31dc4e[_0xa023('0x32')][_0xa023('0x66')][_0x1a5018],'SmsQueueId':_0x31dc4e[_0xa023('0x43')]['id']});}}else{socket[_0xa023('0x70')]('userSmsQueue:remove',{'UserId':_0x31dc4e[_0xa023('0x32')][_0xa023('0x66')],'SmsQueueId':_0x31dc4e['params']['id']});}});}})[_0xa023('0x2b')](respondWithStatusCode(_0x36fda2,null))[_0xa023('0x47')](handleError(_0x36fda2,null));};exports[_0xa023('0x72')]=function(_0x1cb3b0,_0x1afab0,_0x5d84ae){var _0x568fd0={};var _0x3ee383={};var _0x3b857e;var _0x3ca4cc;return db[_0xa023('0x31')][_0xa023('0x52')]({'where':{'id':_0x1cb3b0['params']['id']}})[_0xa023('0x2b')](handleEntityNotFound(_0x1afab0,null))[_0xa023('0x2b')](function(_0x399957){if(_0x399957){_0x3b857e=_0x399957;_0x3ee383[_0xa023('0x35')]=_[_0xa023('0x33')](db[_0xa023('0x58')]['rawAttributes']);_0x3ee383[_0xa023('0x32')]=_['keys'](_0x1cb3b0[_0xa023('0x32')]);_0x3ee383[_0xa023('0x34')]=_['intersection'](_0x3ee383['model'],_0x3ee383[_0xa023('0x32')]);_0x568fd0[_0xa023('0x36')]=_[_0xa023('0x45')](_0x3ee383[_0xa023('0x35')],qs[_0xa023('0x37')](_0x1cb3b0[_0xa023('0x32')][_0xa023('0x37')]));_0x568fd0[_0xa023('0x36')]=_0x568fd0[_0xa023('0x36')][_0xa023('0x38')]?_0x568fd0['attributes']:_0x3ee383[_0xa023('0x35')];_0x568fd0[_0xa023('0x3b')]=qs['sort'](_0x1cb3b0[_0xa023('0x32')][_0xa023('0x54')]);_0x568fd0[_0xa023('0x3c')]=qs[_0xa023('0x34')](_['pick'](_0x1cb3b0['query'],_0x3ee383['filters']));if(_0x1cb3b0['query'][_0xa023('0x63')]){_0x568fd0['where']=_['merge'](_0x568fd0[_0xa023('0x3c')],{'$or':_[_0xa023('0x56')](_0x568fd0['attributes'],function(_0x490cf6){var _0x134bc7={};_0x134bc7[_0x490cf6]={'$like':'%'+_0x1cb3b0[_0xa023('0x32')][_0xa023('0x63')]+'%'};return _0x134bc7;})});}_0x568fd0=_['merge']({},_0x568fd0,_0x1cb3b0[_0xa023('0x46')]);return _0x3b857e[_0xa023('0x72')](_0x568fd0);}})[_0xa023('0x2b')](function(_0x16c9b3){if(_0x16c9b3){_0x3ca4cc=_0x16c9b3['length'];if(!_0x1cb3b0[_0xa023('0x32')][_0xa023('0x39')]('nolimit')){_0x568fd0['limit']=qs[_0xa023('0x26')](_0x1cb3b0[_0xa023('0x32')]['limit']);_0x568fd0[_0xa023('0x25')]=qs[_0xa023('0x25')](_0x1cb3b0['query'][_0xa023('0x25')]);}return _0x3b857e[_0xa023('0x72')](_0x568fd0);}})['then'](function(_0x362346){if(_0x362346){return _0x362346?{'count':_0x3ca4cc,'rows':_0x362346}:null;}})[_0xa023('0x2b')](respondWithResult(_0x1afab0,null))['catch'](handleError(_0x1afab0,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 6703a60..8f40256 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 _0x8aa7=['hook','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','hasOwnProperty'];(function(_0x183653,_0x56cfdb){var _0x14d879=function(_0x430a3c){while(--_0x430a3c){_0x183653['push'](_0x183653['shift']());}};_0x14d879(++_0x56cfdb);}(_0x8aa7,0x1e1));var _0x78aa=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x8aa7[_0x1969a7];return _0x3d665f;};'use strict';var EventEmitter=require(_0x78aa('0x0'));var SmsQueue=require(_0x78aa('0x1'))['db'][_0x78aa('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x78aa('0x3')](0x0);var events={'afterCreate':_0x78aa('0x4'),'afterUpdate':_0x78aa('0x5'),'afterDestroy':'remove'};function emitEvent(_0x490714){return function(_0x321258,_0x5069a1,_0x12e85b){SmsQueueEvents['emit'](_0x490714+':'+_0x321258['id'],_0x321258);SmsQueueEvents['emit'](_0x490714,_0x321258);_0x12e85b(null);};}for(var e in events){if(events[_0x78aa('0x6')](e)){var event=events[e];SmsQueue[_0x78aa('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x3836=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','save','update'];(function(_0x3cf575,_0x125e3e){var _0x34493f=function(_0x19c727){while(--_0x19c727){_0x3cf575['push'](_0x3cf575['shift']());}};_0x34493f(++_0x125e3e);}(_0x3836,0x19a));var _0x6383=function(_0x4a06eb,_0x266116){_0x4a06eb=_0x4a06eb-0x0;var _0x220b75=_0x3836[_0x4a06eb];return _0x220b75;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x6383('0x0'))['db'][_0x6383('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6383('0x2'),'afterUpdate':_0x6383('0x3'),'afterDestroy':_0x6383('0x4')};function emitEvent(_0x294711){return function(_0x216a7a,_0xfbe4ab,_0x2c9abe){SmsQueueEvents[_0x6383('0x5')](_0x294711+':'+_0x216a7a['id'],_0x216a7a);SmsQueueEvents[_0x6383('0x5')](_0x294711,_0x216a7a);_0x2c9abe(null);};}for(var e in events){if(events[_0x6383('0x6')](e)){var event=events[e];SmsQueue[_0x6383('0x7')](e,emitEvent(event));}}module[_0x6383('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 41f2246..8bd9f29 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 _0x0f8f=['sms_queues','lodash','util','../../config/logger','api','moment','bluebird','exports','define','SmsQueue'];(function(_0x4f8312,_0x5a320e){var _0x52c550=function(_0x291602){while(--_0x291602){_0x4f8312['push'](_0x4f8312['shift']());}};_0x52c550(++_0x5a320e);}(_0x0f8f,0xa1));var _0xf0f8=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x0f8f[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0xf0f8('0x0'));var util=require(_0xf0f8('0x1'));var logger=require(_0xf0f8('0x2'))(_0xf0f8('0x3'));var moment=require(_0xf0f8('0x4'));var BPromise=require(_0xf0f8('0x5'));var rp=require('request-promise');var attributes=require('./smsQueue.attributes');module[_0xf0f8('0x6')]=function(_0x2ddc0b,_0x30acab){return _0x2ddc0b[_0xf0f8('0x7')](_0xf0f8('0x8'),attributes,{'tableName':_0xf0f8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0cf5=['./smsQueue.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0cf5,0x80));var _0x50cf=function(_0x20779c,_0x1a28c1){_0x20779c=_0x20779c-0x0;var _0x21b494=_0x0cf5[_0x20779c];return _0x21b494;};'use strict';var _=require(_0x50cf('0x0'));var util=require(_0x50cf('0x1'));var logger=require(_0x50cf('0x2'))(_0x50cf('0x3'));var moment=require(_0x50cf('0x4'));var BPromise=require(_0x50cf('0x5'));var rp=require(_0x50cf('0x6'));var attributes=require(_0x50cf('0x7'));module[_0x50cf('0x8')]=function(_0x37c3cd,_0x5bfa58){return _0x37c3cd['define']('SmsQueue',attributes,{'tableName':'sms_queues','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 5adc6e3..cd7b168 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 _0xa204=['find','then','ShowSmsQueue','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./smsQueue.socket','register','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','raw','where','attributes','map','include','model','GetSmsQueue'];(function(_0x474952,_0x7d9653){var _0x23fa58=function(_0x445ea5){while(--_0x445ea5){_0x474952['push'](_0x474952['shift']());}};_0x23fa58(++_0x7d9653);}(_0xa204,0xb7));var _0x4a20=function(_0x1129af,_0x35020b){_0x1129af=_0x1129af-0x0;var _0x3ff462=_0xa204[_0x1129af];return _0x3ff462;};'use strict';var _=require('lodash');var util=require(_0x4a20('0x0'));var moment=require(_0x4a20('0x1'));var BPromise=require(_0x4a20('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a20('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a20('0x4'));var logger=require(_0x4a20('0x5'))(_0x4a20('0x6'));var config=require(_0x4a20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a20('0x8')]['http']({'port':0x232a});config[_0x4a20('0x9')]=_[_0x4a20('0xa')](config[_0x4a20('0x9')],{'host':_0x4a20('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a20('0x9')]));require(_0x4a20('0xc'))[_0x4a20('0xd')](socket);function respondWithRpcPromise(_0xce002c,_0x5688d2,_0x532278){return new BPromise(function(_0xe1d594,_0x5cfa1c){return client['request'](_0xce002c,_0x532278)['then'](function(_0x29750b){logger[_0x4a20('0xe')](_0x4a20('0xf'),_0x5688d2,_0x4a20('0x10'));logger[_0x4a20('0x11')](_0x4a20('0x12'),_0x5688d2,_0x4a20('0x10'),JSON[_0x4a20('0x13')](_0x29750b));if(_0x29750b['error']){if(_0x29750b[_0x4a20('0x14')][_0x4a20('0x15')]===0x1f4){logger[_0x4a20('0x14')](_0x4a20('0xf'),_0x5688d2,_0x29750b[_0x4a20('0x14')][_0x4a20('0x16')]);return _0x5cfa1c(_0x29750b[_0x4a20('0x14')]['message']);}logger[_0x4a20('0x14')](_0x4a20('0xf'),_0x5688d2,_0x29750b[_0x4a20('0x14')][_0x4a20('0x16')]);return _0xe1d594(_0x29750b[_0x4a20('0x14')][_0x4a20('0x16')]);}else{logger[_0x4a20('0xe')](_0x4a20('0xf'),_0x5688d2,'request\x20sent');_0xe1d594(_0x29750b['result'][_0x4a20('0x16')]);}})[_0x4a20('0x17')](function(_0x266502){logger[_0x4a20('0x14')](_0x4a20('0xf'),_0x5688d2,_0x266502);_0x5cfa1c(_0x266502);});});}exports['GetSmsQueue']=function(_0x1de0ef){var _0x6b7bc4=this;return new Promise(function(_0x4ab940,_0x5ab38b){return db['SmsQueue'][_0x4a20('0x18')]({'raw':_0x1de0ef[_0x4a20('0x19')]?_0x1de0ef[_0x4a20('0x19')][_0x4a20('0x1a')]===undefined?!![]:![]:!![],'where':_0x1de0ef[_0x4a20('0x19')]?_0x1de0ef['options'][_0x4a20('0x1b')]||null:null,'attributes':_0x1de0ef[_0x4a20('0x19')]?_0x1de0ef[_0x4a20('0x19')][_0x4a20('0x1c')]||null:null,'limit':_0x1de0ef[_0x4a20('0x19')]?_0x1de0ef[_0x4a20('0x19')]['limit']||null:null,'include':_0x1de0ef['options']?_0x1de0ef[_0x4a20('0x19')]['include']?_[_0x4a20('0x1d')](_0x1de0ef[_0x4a20('0x19')][_0x4a20('0x1e')],function(_0x566007){return{'model':db[_0x566007[_0x4a20('0x1f')]],'as':_0x566007['as'],'attributes':_0x566007[_0x4a20('0x1c')],'include':_0x566007[_0x4a20('0x1e')]?_['map'](_0x566007[_0x4a20('0x1e')],function(_0x4083aa){return{'model':db[_0x4083aa[_0x4a20('0x1f')]],'as':_0x4083aa['as'],'attributes':_0x4083aa[_0x4a20('0x1c')],'include':_0x4083aa[_0x4a20('0x1e')]?_[_0x4a20('0x1d')](_0x4083aa['include'],function(_0x4754f8){return{'model':db[_0x4754f8[_0x4a20('0x1f')]],'as':_0x4754f8['as'],'attributes':_0x4754f8[_0x4a20('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f0aa6){logger[_0x4a20('0xe')]('GetSmsQueue',_0x1de0ef);logger[_0x4a20('0x11')](_0x4a20('0x20'),_0x1de0ef,JSON['stringify'](_0x1f0aa6));_0x4ab940(_0x1f0aa6);})['catch'](function(_0x2b08c9){logger[_0x4a20('0x14')](_0x4a20('0x20'),_0x2b08c9[_0x4a20('0x16')],_0x1de0ef);_0x5ab38b(_0x6b7bc4[_0x4a20('0x14')](0x1f4,_0x2b08c9[_0x4a20('0x16')]));});});};exports['ShowSmsQueue']=function(_0xa3a595){var _0x81ebb8=this;return new Promise(function(_0x4e5dca,_0x60d49a){return db['SmsQueue'][_0x4a20('0x21')]({'raw':_0xa3a595[_0x4a20('0x19')]?_0xa3a595[_0x4a20('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xa3a595[_0x4a20('0x19')]?_0xa3a595['options'][_0x4a20('0x1b')]||null:null,'attributes':_0xa3a595[_0x4a20('0x19')]?_0xa3a595[_0x4a20('0x19')][_0x4a20('0x1c')]||null:null,'include':_0xa3a595[_0x4a20('0x19')]?_0xa3a595[_0x4a20('0x19')][_0x4a20('0x1e')]?_['map'](_0xa3a595['options'][_0x4a20('0x1e')],function(_0x4eb416){return{'model':db[_0x4eb416['model']],'as':_0x4eb416['as'],'attributes':_0x4eb416[_0x4a20('0x1c')],'include':_0x4eb416[_0x4a20('0x1e')]?_['map'](_0x4eb416[_0x4a20('0x1e')],function(_0x34a90c){return{'model':db[_0x34a90c['model']],'as':_0x34a90c['as'],'attributes':_0x34a90c[_0x4a20('0x1c')],'include':_0x34a90c['include']?_[_0x4a20('0x1d')](_0x34a90c[_0x4a20('0x1e')],function(_0x5dc1c0){return{'model':db[_0x5dc1c0[_0x4a20('0x1f')]],'as':_0x5dc1c0['as'],'attributes':_0x5dc1c0[_0x4a20('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4a20('0x22')](function(_0x1651e5){logger[_0x4a20('0xe')]('ShowSmsQueue',_0xa3a595);logger['debug']('ShowSmsQueue',_0xa3a595,JSON[_0x4a20('0x13')](_0x1651e5));_0x4e5dca(_0x1651e5);})['catch'](function(_0x80a923){logger[_0x4a20('0x14')](_0x4a20('0x23'),_0x80a923[_0x4a20('0x16')],_0xa3a595);_0x60d49a(_0x81ebb8['error'](0x1f4,_0x80a923['message']));});});}; \ No newline at end of file +var _0xa459=['../../config/logger','client','redis','defaults','localhost','socket.io-emitter','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','findAll','options','raw','attributes','limit','include','map','model','then','ShowSmsQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5ac1a7,_0x3cc0d1){var _0x2385ca=function(_0x1ab3d4){while(--_0x1ab3d4){_0x5ac1a7['push'](_0x5ac1a7['shift']());}};_0x2385ca(++_0x3cc0d1);}(_0xa459,0x1d8));var _0x9a45=function(_0x203465,_0x2b85f3){_0x203465=_0x203465-0x0;var _0x2058e0=_0xa459[_0x203465];return _0x2058e0;};'use strict';var _=require(_0x9a45('0x0'));var util=require(_0x9a45('0x1'));var moment=require(_0x9a45('0x2'));var BPromise=require(_0x9a45('0x3'));var rs=require(_0x9a45('0x4'));var fs=require('fs');var Redis=require(_0x9a45('0x5'));var db=require(_0x9a45('0x6'))['db'];var utils=require(_0x9a45('0x7'));var logger=require(_0x9a45('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9a45('0x9')]['http']({'port':0x232a});config[_0x9a45('0xa')]=_[_0x9a45('0xb')](config[_0x9a45('0xa')],{'host':_0x9a45('0xc'),'port':0x18eb});var socket=require(_0x9a45('0xd'))(new Redis(config[_0x9a45('0xa')]));require('./smsQueue.socket')[_0x9a45('0xe')](socket);function respondWithRpcPromise(_0x54b37e,_0x4ce63d,_0x4edb6d){return new BPromise(function(_0x15d229,_0x30c4a4){return client[_0x9a45('0xf')](_0x54b37e,_0x4edb6d)['then'](function(_0x18be7d){logger[_0x9a45('0x10')](_0x9a45('0x11'),_0x4ce63d,_0x9a45('0x12'));logger[_0x9a45('0x13')](_0x9a45('0x14'),_0x4ce63d,_0x9a45('0x12'),JSON[_0x9a45('0x15')](_0x18be7d));if(_0x18be7d[_0x9a45('0x16')]){if(_0x18be7d['error'][_0x9a45('0x17')]===0x1f4){logger[_0x9a45('0x16')](_0x9a45('0x11'),_0x4ce63d,_0x18be7d['error'][_0x9a45('0x18')]);return _0x30c4a4(_0x18be7d['error'][_0x9a45('0x18')]);}logger['error'](_0x9a45('0x11'),_0x4ce63d,_0x18be7d[_0x9a45('0x16')][_0x9a45('0x18')]);return _0x15d229(_0x18be7d[_0x9a45('0x16')][_0x9a45('0x18')]);}else{logger[_0x9a45('0x10')]('SmsQueue,\x20%s,\x20%s',_0x4ce63d,_0x9a45('0x12'));_0x15d229(_0x18be7d[_0x9a45('0x19')][_0x9a45('0x18')]);}})[_0x9a45('0x1a')](function(_0x31ca24){logger['error'](_0x9a45('0x11'),_0x4ce63d,_0x31ca24);_0x30c4a4(_0x31ca24);});});}exports[_0x9a45('0x1b')]=function(_0x486809){var _0x56375e=this;return new Promise(function(_0x5913b9,_0x1c662f){return db['SmsQueue'][_0x9a45('0x1c')]({'raw':_0x486809[_0x9a45('0x1d')]?_0x486809[_0x9a45('0x1d')][_0x9a45('0x1e')]===undefined?!![]:![]:!![],'where':_0x486809['options']?_0x486809['options']['where']||null:null,'attributes':_0x486809['options']?_0x486809[_0x9a45('0x1d')][_0x9a45('0x1f')]||null:null,'limit':_0x486809[_0x9a45('0x1d')]?_0x486809[_0x9a45('0x1d')][_0x9a45('0x20')]||null:null,'include':_0x486809[_0x9a45('0x1d')]?_0x486809[_0x9a45('0x1d')][_0x9a45('0x21')]?_[_0x9a45('0x22')](_0x486809[_0x9a45('0x1d')][_0x9a45('0x21')],function(_0x350467){return{'model':db[_0x350467['model']],'as':_0x350467['as'],'attributes':_0x350467[_0x9a45('0x1f')],'include':_0x350467[_0x9a45('0x21')]?_['map'](_0x350467[_0x9a45('0x21')],function(_0x454998){return{'model':db[_0x454998['model']],'as':_0x454998['as'],'attributes':_0x454998[_0x9a45('0x1f')],'include':_0x454998['include']?_[_0x9a45('0x22')](_0x454998[_0x9a45('0x21')],function(_0x215727){return{'model':db[_0x215727[_0x9a45('0x23')]],'as':_0x215727['as'],'attributes':_0x215727[_0x9a45('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9a45('0x24')](function(_0x636b3a){logger['info'](_0x9a45('0x1b'),_0x486809);logger['debug'](_0x9a45('0x1b'),_0x486809,JSON[_0x9a45('0x15')](_0x636b3a));_0x5913b9(_0x636b3a);})[_0x9a45('0x1a')](function(_0x7366bc){logger[_0x9a45('0x16')](_0x9a45('0x1b'),_0x7366bc['message'],_0x486809);_0x1c662f(_0x56375e[_0x9a45('0x16')](0x1f4,_0x7366bc['message']));});});};exports[_0x9a45('0x25')]=function(_0x5e5024){var _0x10fa57=this;return new Promise(function(_0x6ca64c,_0xa1bae5){return db['SmsQueue'][_0x9a45('0x26')]({'raw':_0x5e5024['options']?_0x5e5024[_0x9a45('0x1d')][_0x9a45('0x1e')]===undefined?!![]:![]:!![],'where':_0x5e5024['options']?_0x5e5024['options'][_0x9a45('0x27')]||null:null,'attributes':_0x5e5024[_0x9a45('0x1d')]?_0x5e5024[_0x9a45('0x1d')][_0x9a45('0x1f')]||null:null,'include':_0x5e5024[_0x9a45('0x1d')]?_0x5e5024[_0x9a45('0x1d')]['include']?_[_0x9a45('0x22')](_0x5e5024[_0x9a45('0x1d')][_0x9a45('0x21')],function(_0x18edad){return{'model':db[_0x18edad['model']],'as':_0x18edad['as'],'attributes':_0x18edad[_0x9a45('0x1f')],'include':_0x18edad[_0x9a45('0x21')]?_[_0x9a45('0x22')](_0x18edad[_0x9a45('0x21')],function(_0x207e6b){return{'model':db[_0x207e6b[_0x9a45('0x23')]],'as':_0x207e6b['as'],'attributes':_0x207e6b['attributes'],'include':_0x207e6b[_0x9a45('0x21')]?_['map'](_0x207e6b['include'],function(_0x159c2e){return{'model':db[_0x159c2e[_0x9a45('0x23')]],'as':_0x159c2e['as'],'attributes':_0x159c2e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9a45('0x24')](function(_0x3e043e){logger['info'](_0x9a45('0x25'),_0x5e5024);logger[_0x9a45('0x13')](_0x9a45('0x25'),_0x5e5024,JSON['stringify'](_0x3e043e));_0x6ca64c(_0x3e043e);})[_0x9a45('0x1a')](function(_0x3e994b){logger[_0x9a45('0x16')]('ShowSmsQueue',_0x3e994b[_0x9a45('0x18')],_0x5e5024);_0xa1bae5(_0x10fa57[_0x9a45('0x16')](0x1f4,_0x3e994b[_0x9a45('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 95c72a6..235dd69 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 _0x1ad9=['removeListener','register','smsQueue:','./smsQueue.events','save','remove','update','emit'];(function(_0x8307e3,_0x48eb78){var _0x492db9=function(_0x1284f7){while(--_0x1284f7){_0x8307e3['push'](_0x8307e3['shift']());}};_0x492db9(++_0x48eb78);}(_0x1ad9,0xdb));var _0x91ad=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x1ad9[_0x8dc04d];return _0x2f5f28;};'use strict';var SmsQueueEvents=require(_0x91ad('0x0'));var events=[_0x91ad('0x1'),_0x91ad('0x2'),_0x91ad('0x3')];function createListener(_0x2755a7,_0x283e77){return function(_0x59d442){_0x283e77[_0x91ad('0x4')](_0x2755a7,_0x59d442);};}function removeListener(_0x10a839,_0x13f9b6){return function(){SmsQueueEvents[_0x91ad('0x5')](_0x10a839,_0x13f9b6);};}exports[_0x91ad('0x6')]=function(_0xc60e8e){for(var _0x1a5321=0x0,_0x321e20=events['length'];_0x1a5321<_0x321e20;_0x1a5321++){var _0x433f5c=events[_0x1a5321];var _0x27872c=createListener(_0x91ad('0x7')+_0x433f5c,_0xc60e8e);SmsQueueEvents['on'](_0x433f5c,_0x27872c);}}; \ No newline at end of file +var _0x9f5a=['update','emit','register','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x5f530f,_0x2418ef){var _0xbb64d9=function(_0x1ec9c2){while(--_0x1ec9c2){_0x5f530f['push'](_0x5f530f['shift']());}};_0xbb64d9(++_0x2418ef);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x5a1c5b,_0x2fb65e){_0x5a1c5b=_0x5a1c5b-0x0;var _0x1bfb1b=_0x9f5a[_0x5a1c5b];return _0x1bfb1b;};'use strict';var SmsQueueEvents=require(_0xa9f5('0x0'));var events=[_0xa9f5('0x1'),_0xa9f5('0x2'),_0xa9f5('0x3')];function createListener(_0x546306,_0x4268b0){return function(_0x45e3f5){_0x4268b0[_0xa9f5('0x4')](_0x546306,_0x45e3f5);};}function removeListener(_0x4eeedd,_0x20f51f){return function(){SmsQueueEvents['removeListener'](_0x4eeedd,_0x20f51f);};}exports[_0xa9f5('0x5')]=function(_0x219e89){for(var _0x49e337=0x0,_0x6c040d=events[_0xa9f5('0x6')];_0x49e337<_0x6c040d;_0x49e337++){var _0x3f644f=events[_0x49e337];var _0x1f6c78=createListener(_0xa9f5('0x7')+_0x3f644f,_0x219e89);SmsQueueEvents['on'](_0x3f644f,_0x1f6c78);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 1fc234e..c78b637 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 _0xab9f=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','create','put'];(function(_0xa5a6f2,_0x49375b){var _0x5d3a6f=function(_0x4f298e){while(--_0x4f298e){_0xa5a6f2['push'](_0xa5a6f2['shift']());}};_0x5d3a6f(++_0x49375b);}(_0xab9f,0x1bd));var _0xfab9=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0xab9f[_0x16db8b];return _0x5ba017;};'use strict';var multer=require(_0xfab9('0x0'));var util=require('util');var path=require(_0xfab9('0x1'));var timeout=require(_0xfab9('0x2'));var express=require(_0xfab9('0x3'));var router=express['Router']();var auth=require(_0xfab9('0x4'));var interaction=require(_0xfab9('0x5'));var config=require('../../config/environment');var controller=require(_0xfab9('0x6'));router['get']('/',auth[_0xfab9('0x7')](),controller['index']);router[_0xfab9('0x8')](_0xfab9('0x9'),auth[_0xfab9('0x7')](),controller[_0xfab9('0xa')]);router['get'](_0xfab9('0xb'),auth[_0xfab9('0x7')](),controller['show']);router['post']('/',auth[_0xfab9('0x7')](),controller[_0xfab9('0xc')]);router[_0xfab9('0xd')](_0xfab9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfab9('0xe')](_0xfab9('0xb'),auth[_0xfab9('0x7')](),controller[_0xfab9('0xf')]);module[_0xfab9('0x10')]=router; \ No newline at end of file +var _0x6011=['post','create','update','/:id','destroy','exports','Router','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x49e294,_0x4e624a){var _0x504f4c=function(_0x3eff8f){while(--_0x3eff8f){_0x49e294['push'](_0x49e294['shift']());}};_0x504f4c(++_0x4e624a);}(_0x6011,0x196));var _0x1601=function(_0x59d613,_0x5319c0){_0x59d613=_0x59d613-0x0;var _0x575e42=_0x6011[_0x59d613];return _0x575e42;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1601('0x0')]();var auth=require(_0x1601('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x1601('0x2'));var controller=require(_0x1601('0x3'));router[_0x1601('0x4')]('/',auth[_0x1601('0x5')](),controller[_0x1601('0x6')]);router[_0x1601('0x4')](_0x1601('0x7'),auth[_0x1601('0x5')](),controller[_0x1601('0x8')]);router[_0x1601('0x4')]('/:id',auth[_0x1601('0x5')](),controller[_0x1601('0x9')]);router[_0x1601('0xa')]('/',auth[_0x1601('0x5')](),controller[_0x1601('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1601('0xc')]);router['delete'](_0x1601('0xd'),auth[_0x1601('0x5')](),controller[_0x1601('0xe')]);module[_0x1601('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index b9edac5..dcbcb62 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 _0x59ec=['moment','STRING','DATE'];(function(_0x321329,_0x8cddcf){var _0x4dbb49=function(_0x4de4c7){while(--_0x4de4c7){_0x321329['push'](_0x321329['shift']());}};_0x4dbb49(++_0x8cddcf);}(_0x59ec,0x16b));var _0xc59e=function(_0x4f7b72,_0x4edaa6){_0x4f7b72=_0x4f7b72-0x0;var _0x274eaf=_0x59ec[_0x4f7b72];return _0x274eaf;};'use strict';var moment=require(_0xc59e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xc59e('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xc59e('0x1')]},'joinAt':{'type':Sequelize[_0xc59e('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc59e('0x1')]}}; \ No newline at end of file +var _0x9df5=['moment','exports','STRING','DATE'];(function(_0x5cdf3c,_0x233f63){var _0x515b20=function(_0x10ef8c){while(--_0x10ef8c){_0x5cdf3c['push'](_0x5cdf3c['shift']());}};_0x515b20(++_0x233f63);}(_0x9df5,0x120));var _0x59df=function(_0x5e97a3,_0x329e7f){_0x5e97a3=_0x5e97a3-0x0;var _0x18c8aa=_0x9df5[_0x5e97a3];return _0x18c8aa;};'use strict';var moment=require(_0x59df('0x0'));var Sequelize=require('sequelize');module[_0x59df('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x59df('0x2')]},'joinAt':{'type':Sequelize[_0x59df('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x59df('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x59df('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 5564b57..3dce95d 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 _0x12ec=['rows','catch','show','length','includeAll','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','SmsQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','map','key','VIRTUAL','field','filter','merge','options','where','include','findAll'];(function(_0x19c71e,_0x513c5b){var _0xf7df9b=function(_0x367349){while(--_0x367349){_0x19c71e['push'](_0x19c71e['shift']());}};_0xf7df9b(++_0x513c5b);}(_0x12ec,0x9a));var _0xc12e=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x12ec[_0x5d80de];return _0x1c7556;};'use strict';var pdf=require(_0xc12e('0x0'));var emlformat=require(_0xc12e('0x1'));var rimraf=require(_0xc12e('0x2'));var zipdir=require(_0xc12e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc12e('0x4'));var Mustache=require(_0xc12e('0x5'));var util=require('util');var path=require(_0xc12e('0x6'));var sox=require('sox');var csv=require(_0xc12e('0x7'));var ejs=require(_0xc12e('0x8'));var fs=require('fs');var _=require(_0xc12e('0x9'));var squel=require(_0xc12e('0xa'));var crypto=require('crypto');var jsforce=require(_0xc12e('0xb'));var deskjs=require(_0xc12e('0xc'));var toCsv=require(_0xc12e('0x7'));var querystring=require(_0xc12e('0xd'));var Papa=require(_0xc12e('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0xc12e('0xf'));var Redis=require(_0xc12e('0x10'));var qs=require(_0xc12e('0x11'));var logger=require('../../config/logger')(_0xc12e('0x12'));var utils=require('../../config/utils');var config=require(_0xc12e('0x13'));var db=require(_0xc12e('0x14'))['db'];function respondWithStatusCode(_0xa3d3fe,_0x26bbfa){_0x26bbfa=_0x26bbfa||0xcc;return function(_0x29d2ea){if(_0x29d2ea){return _0xa3d3fe[_0xc12e('0x15')](_0x26bbfa);}return _0xa3d3fe[_0xc12e('0x16')](_0x26bbfa)['end']();};}function respondWithResult(_0x5d61b2,_0x5b9c93){_0x5b9c93=_0x5b9c93||0xc8;return function(_0x3a0361){if(_0x3a0361){return _0x5d61b2[_0xc12e('0x16')](_0x5b9c93)['json'](_0x3a0361);}};}function respondWithFilteredResult(_0x24f44c,_0x349ff2){return function(_0xc58cc2){if(_0xc58cc2){var _0xf56f69=_0xc58cc2[_0xc12e('0x17')],_0x376a3d=_0x349ff2[_0xc12e('0x18')],_0x52d27b=_0x349ff2[_0xc12e('0x18')]+_0x349ff2['limit'],_0x576e98;if(_0x52d27b>=_0xf56f69){_0x52d27b=_0xf56f69;_0x576e98=0xc8;}else{_0x576e98=0xce;}_0x24f44c[_0xc12e('0x16')](_0x576e98);return _0x24f44c[_0xc12e('0x19')](_0xc12e('0x1a'),_0x376a3d+'-'+_0x52d27b+'/'+_0xf56f69)[_0xc12e('0x1b')](_0xc58cc2);}return null;};}function patchUpdates(_0x16ee26){return function(_0x4330fb){try{jsonpatch[_0xc12e('0x1c')](_0x4330fb,_0x16ee26,!![]);}catch(_0x5bc31f){return BPromise[_0xc12e('0x1d')](_0x5bc31f);}return _0x4330fb['save']();};}function saveUpdates(_0x53ad2b,_0x12f605){return function(_0x2bb276){if(_0x2bb276){return _0x2bb276[_0xc12e('0x1e')](_0x53ad2b)[_0xc12e('0x1f')](function(_0x2c4208){return _0x2c4208;});}return null;};}function removeEntity(_0xb809b3,_0x26fe75){return function(_0x3a62f0){if(_0x3a62f0){return _0x3a62f0[_0xc12e('0x20')]()['then'](function(){_0xb809b3[_0xc12e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x283e2d,_0x20d89b){return function(_0x5ac8da){if(!_0x5ac8da){_0x283e2d[_0xc12e('0x15')](0x194);}return _0x5ac8da;};}function handleError(_0x2f8e82,_0x2c695a){_0x2c695a=_0x2c695a||0x1f4;return function(_0xcc85af){logger[_0xc12e('0x21')](_0xcc85af['stack']);if(_0xcc85af[_0xc12e('0x22')]){delete _0xcc85af[_0xc12e('0x22')];}_0x2f8e82[_0xc12e('0x16')](_0x2c695a)[_0xc12e('0x23')](_0xcc85af);};}exports[_0xc12e('0x24')]=function(_0x1c02ee,_0x37ae03){var _0x1eb9ff={},_0x33de10={},_0x44904a={'count':0x0,'rows':[]};var _0x5394ff=db[_0xc12e('0x25')][_0xc12e('0x26')];_0x33de10[_0xc12e('0x27')]=_[_0xc12e('0x28')](_0x5394ff);_0x33de10[_0xc12e('0x29')]=_['keys'](_0x1c02ee['query']);_0x33de10[_0xc12e('0x2a')]=_[_0xc12e('0x2b')](_0x33de10['model'],_0x33de10[_0xc12e('0x29')]);_0x1eb9ff['attributes']=_[_0xc12e('0x2b')](_0x33de10[_0xc12e('0x27')],qs[_0xc12e('0x2c')](_0x1c02ee[_0xc12e('0x29')][_0xc12e('0x2c')]));_0x1eb9ff[_0xc12e('0x2d')]=_0x1eb9ff[_0xc12e('0x2d')]['length']?_0x1eb9ff['attributes']:_0x33de10[_0xc12e('0x27')];if(!_0x1c02ee[_0xc12e('0x29')][_0xc12e('0x2e')](_0xc12e('0x2f'))){_0x1eb9ff[_0xc12e('0x30')]=qs['limit'](_0x1c02ee[_0xc12e('0x29')][_0xc12e('0x30')]);_0x1eb9ff[_0xc12e('0x18')]=qs[_0xc12e('0x18')](_0x1c02ee[_0xc12e('0x29')]['offset']);}_0x1eb9ff[_0xc12e('0x31')]=qs[_0xc12e('0x32')](_0x1c02ee['query'][_0xc12e('0x32')]);_0x1eb9ff['where']=qs[_0xc12e('0x2a')](_[_0xc12e('0x33')](_0x1c02ee[_0xc12e('0x29')],_0x33de10[_0xc12e('0x2a')]));if(_0x1c02ee[_0xc12e('0x29')]['filter']){_0x1eb9ff['where']=_['merge'](_0x1eb9ff['where'],{'$or':_[_0xc12e('0x34')](_0x5394ff,function(_0x189078){if(_0x189078['type'][_0xc12e('0x35')]!==_0xc12e('0x36')){var _0x45b854={};_0x45b854[_0x189078[_0xc12e('0x37')]]={'$like':'%'+_0x1c02ee[_0xc12e('0x29')][_0xc12e('0x38')]+'%'};return _0x45b854;}})});}_0x1eb9ff=_[_0xc12e('0x39')]({},_0x1eb9ff,_0x1c02ee[_0xc12e('0x3a')]);var _0x28dd10={'where':_0x1eb9ff[_0xc12e('0x3b')]};return db[_0xc12e('0x25')]['count'](_0x28dd10)[_0xc12e('0x1f')](function(_0x29222c){_0x44904a[_0xc12e('0x17')]=_0x29222c;if(_0x1c02ee['query']['includeAll']){_0x1eb9ff[_0xc12e('0x3c')]=[{'all':!![]}];}return db[_0xc12e('0x25')][_0xc12e('0x3d')](_0x1eb9ff);})['then'](function(_0x536373){_0x44904a[_0xc12e('0x3e')]=_0x536373;return _0x44904a;})[_0xc12e('0x1f')](respondWithFilteredResult(_0x37ae03,_0x1eb9ff))[_0xc12e('0x3f')](handleError(_0x37ae03,null));};exports[_0xc12e('0x40')]=function(_0x44d430,_0x566557){var _0x172b77={'raw':!![],'where':{'id':_0x44d430['params']['id']}},_0x35703b={};_0x35703b[_0xc12e('0x27')]=_[_0xc12e('0x28')](db[_0xc12e('0x25')][_0xc12e('0x26')]);_0x35703b[_0xc12e('0x29')]=_['keys'](_0x44d430['query']);_0x35703b[_0xc12e('0x2a')]=_[_0xc12e('0x2b')](_0x35703b['model'],_0x35703b[_0xc12e('0x29')]);_0x172b77[_0xc12e('0x2d')]=_['intersection'](_0x35703b[_0xc12e('0x27')],qs[_0xc12e('0x2c')](_0x44d430[_0xc12e('0x29')]['fields']));_0x172b77['attributes']=_0x172b77['attributes'][_0xc12e('0x41')]?_0x172b77[_0xc12e('0x2d')]:_0x35703b['model'];if(_0x44d430[_0xc12e('0x29')][_0xc12e('0x42')]){_0x172b77[_0xc12e('0x3c')]=[{'all':!![]}];}_0x172b77=_[_0xc12e('0x39')]({},_0x172b77,_0x44d430[_0xc12e('0x3a')]);return db[_0xc12e('0x25')]['find'](_0x172b77)[_0xc12e('0x1f')](handleEntityNotFound(_0x566557,null))[_0xc12e('0x1f')](respondWithResult(_0x566557,null))[_0xc12e('0x3f')](handleError(_0x566557,null));};exports[_0xc12e('0x43')]=function(_0x81dde,_0x55d575){return db[_0xc12e('0x25')][_0xc12e('0x43')](_0x81dde[_0xc12e('0x44')],{})['then'](respondWithResult(_0x55d575,0xc9))['catch'](handleError(_0x55d575,null));};exports[_0xc12e('0x1e')]=function(_0x39dfaa,_0x539643){if(_0x39dfaa['body']['id']){delete _0x39dfaa[_0xc12e('0x44')]['id'];}return db[_0xc12e('0x25')][_0xc12e('0x45')]({'where':{'id':_0x39dfaa['params']['id']}})[_0xc12e('0x1f')](handleEntityNotFound(_0x539643,null))[_0xc12e('0x1f')](saveUpdates(_0x39dfaa['body'],null))['then'](respondWithResult(_0x539643,null))['catch'](handleError(_0x539643,null));};exports[_0xc12e('0x20')]=function(_0x1e9507,_0x5d144e){return db[_0xc12e('0x25')][_0xc12e('0x45')]({'where':{'id':_0x1e9507[_0xc12e('0x46')]['id']}})[_0xc12e('0x1f')](handleEntityNotFound(_0x5d144e,null))[_0xc12e('0x1f')](removeEntity(_0x5d144e,null))[_0xc12e('0x3f')](handleError(_0x5d144e,null));};exports[_0xc12e('0x47')]=function(_0x50cb68,_0x361b6b){return db[_0xc12e('0x25')][_0xc12e('0x47')]()[_0xc12e('0x1f')](respondWithResult(_0x361b6b,null))['catch'](handleError(_0x361b6b,null));}; \ No newline at end of file +var _0x19b8=['../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','reject','then','error','stack','name','send','index','SmsQueueReport','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','where','filters','filter','map','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','update','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x68c56,_0x411ca3){var _0x2ddb6e=function(_0x59f118){while(--_0x59f118){_0x68c56['push'](_0x68c56['shift']());}};_0x2ddb6e(++_0x411ca3);}(_0x19b8,0xc6));var _0x819b=function(_0x1de8df,_0x26f332){_0x1de8df=_0x1de8df-0x0;var _0x4c1022=_0x19b8[_0x1de8df];return _0x4c1022;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x819b('0x0'));var rimraf=require(_0x819b('0x1'));var zipdir=require(_0x819b('0x2'));var jsonpatch=require(_0x819b('0x3'));var rp=require(_0x819b('0x4'));var moment=require(_0x819b('0x5'));var BPromise=require(_0x819b('0x6'));var Mustache=require(_0x819b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x819b('0x8'));var csv=require(_0x819b('0x9'));var ejs=require(_0x819b('0xa'));var fs=require('fs');var _=require(_0x819b('0xb'));var squel=require(_0x819b('0xc'));var crypto=require(_0x819b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x819b('0xe'));var toCsv=require(_0x819b('0x9'));var querystring=require(_0x819b('0xf'));var Papa=require(_0x819b('0x10'));var authService=require(_0x819b('0x11'));var hardwareService=require(_0x819b('0x12'));var Redis=require(_0x819b('0x13'));var qs=require(_0x819b('0x14'));var logger=require(_0x819b('0x15'))(_0x819b('0x16'));var utils=require(_0x819b('0x17'));var config=require(_0x819b('0x18'));var db=require(_0x819b('0x19'))['db'];function respondWithStatusCode(_0x5709a7,_0x5d588e){_0x5d588e=_0x5d588e||0xcc;return function(_0x57e9ba){if(_0x57e9ba){return _0x5709a7[_0x819b('0x1a')](_0x5d588e);}return _0x5709a7[_0x819b('0x1b')](_0x5d588e)[_0x819b('0x1c')]();};}function respondWithResult(_0x4f9007,_0x431766){_0x431766=_0x431766||0xc8;return function(_0x550004){if(_0x550004){return _0x4f9007[_0x819b('0x1b')](_0x431766)[_0x819b('0x1d')](_0x550004);}};}function respondWithFilteredResult(_0x4cca76,_0x18eee3){return function(_0x533921){if(_0x533921){var _0x43dc78=_0x533921[_0x819b('0x1e')],_0x5a6900=_0x18eee3['offset'],_0x3f2a05=_0x18eee3['offset']+_0x18eee3[_0x819b('0x1f')],_0x36a7a4;if(_0x3f2a05>=_0x43dc78){_0x3f2a05=_0x43dc78;_0x36a7a4=0xc8;}else{_0x36a7a4=0xce;}_0x4cca76[_0x819b('0x1b')](_0x36a7a4);return _0x4cca76[_0x819b('0x20')](_0x819b('0x21'),_0x5a6900+'-'+_0x3f2a05+'/'+_0x43dc78)[_0x819b('0x1d')](_0x533921);}return null;};}function patchUpdates(_0x3972a6){return function(_0xd9d416){try{jsonpatch['apply'](_0xd9d416,_0x3972a6,!![]);}catch(_0x16f716){return BPromise[_0x819b('0x22')](_0x16f716);}return _0xd9d416['save']();};}function saveUpdates(_0x173261,_0x41fc2a){return function(_0x989f45){if(_0x989f45){return _0x989f45['update'](_0x173261)[_0x819b('0x23')](function(_0x3fea90){return _0x3fea90;});}return null;};}function removeEntity(_0xbc522c,_0x10ca32){return function(_0x561fad){if(_0x561fad){return _0x561fad['destroy']()[_0x819b('0x23')](function(){_0xbc522c[_0x819b('0x1b')](0xcc)[_0x819b('0x1c')]();});}};}function handleEntityNotFound(_0x1c2b8f,_0x5935c9){return function(_0x2f085b){if(!_0x2f085b){_0x1c2b8f[_0x819b('0x1a')](0x194);}return _0x2f085b;};}function handleError(_0x3e1141,_0x1d0d66){_0x1d0d66=_0x1d0d66||0x1f4;return function(_0x2d6c0a){logger[_0x819b('0x24')](_0x2d6c0a[_0x819b('0x25')]);if(_0x2d6c0a[_0x819b('0x26')]){delete _0x2d6c0a['name'];}_0x3e1141[_0x819b('0x1b')](_0x1d0d66)[_0x819b('0x27')](_0x2d6c0a);};}exports[_0x819b('0x28')]=function(_0x2d2762,_0x552643){var _0x161415={},_0x3b661a={},_0x597734={'count':0x0,'rows':[]};var _0x42e215=db[_0x819b('0x29')]['rawAttributes'];_0x3b661a[_0x819b('0x2a')]=_[_0x819b('0x2b')](_0x42e215);_0x3b661a['query']=_[_0x819b('0x2b')](_0x2d2762[_0x819b('0x2c')]);_0x3b661a['filters']=_[_0x819b('0x2d')](_0x3b661a[_0x819b('0x2a')],_0x3b661a[_0x819b('0x2c')]);_0x161415['attributes']=_[_0x819b('0x2d')](_0x3b661a['model'],qs['fields'](_0x2d2762['query'][_0x819b('0x2e')]));_0x161415[_0x819b('0x2f')]=_0x161415[_0x819b('0x2f')][_0x819b('0x30')]?_0x161415['attributes']:_0x3b661a['model'];if(!_0x2d2762[_0x819b('0x2c')][_0x819b('0x31')](_0x819b('0x32'))){_0x161415[_0x819b('0x1f')]=qs[_0x819b('0x1f')](_0x2d2762[_0x819b('0x2c')]['limit']);_0x161415[_0x819b('0x33')]=qs[_0x819b('0x33')](_0x2d2762[_0x819b('0x2c')][_0x819b('0x33')]);}_0x161415[_0x819b('0x34')]=qs['sort'](_0x2d2762[_0x819b('0x2c')]['sort']);_0x161415[_0x819b('0x35')]=qs[_0x819b('0x36')](_['pick'](_0x2d2762[_0x819b('0x2c')],_0x3b661a['filters']));if(_0x2d2762[_0x819b('0x2c')][_0x819b('0x37')]){_0x161415[_0x819b('0x35')]=_['merge'](_0x161415['where'],{'$or':_[_0x819b('0x38')](_0x42e215,function(_0x802fc){if(_0x802fc['type']['key']!==_0x819b('0x39')){var _0x512e04={};_0x512e04[_0x802fc[_0x819b('0x3a')]]={'$like':'%'+_0x2d2762[_0x819b('0x2c')][_0x819b('0x37')]+'%'};return _0x512e04;}})});}_0x161415=_[_0x819b('0x3b')]({},_0x161415,_0x2d2762[_0x819b('0x3c')]);var _0x45f764={'where':_0x161415['where']};return db[_0x819b('0x29')][_0x819b('0x1e')](_0x45f764)[_0x819b('0x23')](function(_0x4eb803){_0x597734[_0x819b('0x1e')]=_0x4eb803;if(_0x2d2762[_0x819b('0x2c')][_0x819b('0x3d')]){_0x161415[_0x819b('0x3e')]=[{'all':!![]}];}return db[_0x819b('0x29')]['findAll'](_0x161415);})[_0x819b('0x23')](function(_0x1103ac){_0x597734[_0x819b('0x3f')]=_0x1103ac;return _0x597734;})[_0x819b('0x23')](respondWithFilteredResult(_0x552643,_0x161415))[_0x819b('0x40')](handleError(_0x552643,null));};exports[_0x819b('0x41')]=function(_0x5934b5,_0x516293){var _0x371733={'raw':!![],'where':{'id':_0x5934b5['params']['id']}},_0x4a1396={};_0x4a1396[_0x819b('0x2a')]=_[_0x819b('0x2b')](db[_0x819b('0x29')][_0x819b('0x42')]);_0x4a1396[_0x819b('0x2c')]=_[_0x819b('0x2b')](_0x5934b5[_0x819b('0x2c')]);_0x4a1396[_0x819b('0x36')]=_[_0x819b('0x2d')](_0x4a1396[_0x819b('0x2a')],_0x4a1396['query']);_0x371733[_0x819b('0x2f')]=_[_0x819b('0x2d')](_0x4a1396[_0x819b('0x2a')],qs[_0x819b('0x2e')](_0x5934b5[_0x819b('0x2c')][_0x819b('0x2e')]));_0x371733[_0x819b('0x2f')]=_0x371733[_0x819b('0x2f')][_0x819b('0x30')]?_0x371733[_0x819b('0x2f')]:_0x4a1396[_0x819b('0x2a')];if(_0x5934b5[_0x819b('0x2c')][_0x819b('0x3d')]){_0x371733['include']=[{'all':!![]}];}_0x371733=_[_0x819b('0x3b')]({},_0x371733,_0x5934b5[_0x819b('0x3c')]);return db[_0x819b('0x29')][_0x819b('0x43')](_0x371733)[_0x819b('0x23')](handleEntityNotFound(_0x516293,null))[_0x819b('0x23')](respondWithResult(_0x516293,null))[_0x819b('0x40')](handleError(_0x516293,null));};exports[_0x819b('0x44')]=function(_0x4c933a,_0x1fa2bd){return db['SmsQueueReport'][_0x819b('0x44')](_0x4c933a[_0x819b('0x45')],{})[_0x819b('0x23')](respondWithResult(_0x1fa2bd,0xc9))['catch'](handleError(_0x1fa2bd,null));};exports[_0x819b('0x46')]=function(_0x46c4a1,_0xc95046){if(_0x46c4a1['body']['id']){delete _0x46c4a1[_0x819b('0x45')]['id'];}return db[_0x819b('0x29')][_0x819b('0x43')]({'where':{'id':_0x46c4a1['params']['id']}})[_0x819b('0x23')](handleEntityNotFound(_0xc95046,null))[_0x819b('0x23')](saveUpdates(_0x46c4a1[_0x819b('0x45')],null))[_0x819b('0x23')](respondWithResult(_0xc95046,null))[_0x819b('0x40')](handleError(_0xc95046,null));};exports[_0x819b('0x47')]=function(_0x248aae,_0x167dbd){return db[_0x819b('0x29')][_0x819b('0x43')]({'where':{'id':_0x248aae[_0x819b('0x48')]['id']}})[_0x819b('0x23')](handleEntityNotFound(_0x167dbd,null))['then'](removeEntity(_0x167dbd,null))['catch'](handleError(_0x167dbd,null));};exports[_0x819b('0x49')]=function(_0x4f1e44,_0x38d932){return db['SmsQueueReport'][_0x819b('0x49')]()['then'](respondWithResult(_0x38d932,null))[_0x819b('0x40')](handleError(_0x38d932,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 21a8110..832b90d 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 _0xd197=['request-promise','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xd197,0x1be));var _0x7d19=function(_0x34bdcf,_0x23bb7e){_0x34bdcf=_0x34bdcf-0x0;var _0x5bb77c=_0xd197[_0x34bdcf];return _0x5bb77c;};'use strict';var _=require(_0x7d19('0x0'));var util=require(_0x7d19('0x1'));var logger=require(_0x7d19('0x2'))(_0x7d19('0x3'));var moment=require('moment');var BPromise=require(_0x7d19('0x4'));var rp=require(_0x7d19('0x5'));var attributes=require(_0x7d19('0x6'));module[_0x7d19('0x7')]=function(_0x4516b5,_0x57bc3e){return _0x4516b5[_0x7d19('0x8')]('SmsQueueReport',attributes,{'tableName':_0x7d19('0x9'),'paranoid':![],'indexes':[{'name':_0x7d19('0xa'),'fields':[_0x7d19('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x294b=['SmsQueueReport','report_sms_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','./smsQueueReport.attributes','define'];(function(_0x1cbabe,_0x4fe2c7){var _0x58f471=function(_0x5a8680){while(--_0x5a8680){_0x1cbabe['push'](_0x1cbabe['shift']());}};_0x58f471(++_0x4fe2c7);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb294('0x0'));var util=require('util');var logger=require(_0xb294('0x1'))(_0xb294('0x2'));var moment=require(_0xb294('0x3'));var BPromise=require(_0xb294('0x4'));var rp=require(_0xb294('0x5'));var attributes=require(_0xb294('0x6'));module['exports']=function(_0x5c0237,_0xba5c68){return _0x5c0237[_0xb294('0x7')](_0xb294('0x8'),attributes,{'tableName':_0xb294('0x9'),'paranoid':![],'indexes':[{'name':_0xb294('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index df5c3a9..5283ce6 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 _0x1cd8=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','result','catch','SmsQueueReport','create','options','CreateSmsQueueReport','UpdateSmsQueueReport','update','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0x1cd8,0xa3));var _0x81cd=function(_0x5da440,_0x50fe36){_0x5da440=_0x5da440-0x0;var _0x231f3b=_0x1cd8[_0x5da440];return _0x231f3b;};'use strict';var _=require(_0x81cd('0x0'));var util=require('util');var moment=require(_0x81cd('0x1'));var BPromise=require(_0x81cd('0x2'));var rs=require(_0x81cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81cd('0x4'))['db'];var utils=require(_0x81cd('0x5'));var logger=require(_0x81cd('0x6'))('rpc');var config=require(_0x81cd('0x7'));var jayson=require(_0x81cd('0x8'));var client=jayson[_0x81cd('0x9')][_0x81cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b4fce,_0x4cc811,_0x13a879){return new BPromise(function(_0x171915,_0x420469){return client[_0x81cd('0xb')](_0x2b4fce,_0x13a879)[_0x81cd('0xc')](function(_0x273f8e){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x4cc811,_0x81cd('0xd'));logger[_0x81cd('0xe')](_0x81cd('0xf'),_0x4cc811,_0x81cd('0xd'),JSON[_0x81cd('0x10')](_0x273f8e));if(_0x273f8e[_0x81cd('0x11')]){if(_0x273f8e[_0x81cd('0x11')][_0x81cd('0x12')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x4cc811,_0x273f8e['error']['message']);return _0x420469(_0x273f8e['error']['message']);}logger[_0x81cd('0x11')](_0x81cd('0x13'),_0x4cc811,_0x273f8e[_0x81cd('0x11')][_0x81cd('0x14')]);return _0x171915(_0x273f8e[_0x81cd('0x11')]['message']);}else{logger[_0x81cd('0x15')](_0x81cd('0x13'),_0x4cc811,_0x81cd('0xd'));_0x171915(_0x273f8e[_0x81cd('0x16')][_0x81cd('0x14')]);}})[_0x81cd('0x17')](function(_0x4bc8ee){logger['error'](_0x81cd('0x13'),_0x4cc811,_0x4bc8ee);_0x420469(_0x4bc8ee);});});}exports['CreateSmsQueueReport']=function(_0x23a75b){var _0x42d782=this;return new Promise(function(_0xd7548b,_0x224e73){return db[_0x81cd('0x18')][_0x81cd('0x19')](_0x23a75b['body'],{'raw':_0x23a75b[_0x81cd('0x1a')]?_0x23a75b[_0x81cd('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x81cd('0xc')](function(_0x549dc7){logger[_0x81cd('0x15')](_0x81cd('0x1b'),_0x23a75b);logger['debug']('CreateSmsQueueReport',_0x23a75b,JSON['stringify'](_0x549dc7));_0xd7548b(_0x549dc7);})['catch'](function(_0x405c8e){logger['error']('CreateSmsQueueReport',_0x405c8e[_0x81cd('0x14')],_0x23a75b);_0x224e73(_0x42d782[_0x81cd('0x11')](0x1f4,_0x405c8e[_0x81cd('0x14')]));});});};exports[_0x81cd('0x1c')]=function(_0x1b9271){var _0x1255a6=this;return new Promise(function(_0x1c0ce7,_0x4d9175){return db[_0x81cd('0x18')][_0x81cd('0x1d')](_0x1b9271['body'],{'raw':_0x1b9271['options']?_0x1b9271[_0x81cd('0x1a')][_0x81cd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b9271[_0x81cd('0x1a')]?_0x1b9271[_0x81cd('0x1a')][_0x81cd('0x1f')]||null:null,'attributes':_0x1b9271[_0x81cd('0x1a')]?_0x1b9271[_0x81cd('0x1a')][_0x81cd('0x20')]||null:null,'limit':_0x1b9271[_0x81cd('0x1a')]?_0x1b9271[_0x81cd('0x1a')][_0x81cd('0x21')]||null:null})[_0x81cd('0xc')](function(_0xa40d71){logger[_0x81cd('0x15')](_0x81cd('0x1c'),_0x1b9271);logger[_0x81cd('0xe')](_0x81cd('0x1c'),_0x1b9271,JSON[_0x81cd('0x10')](_0xa40d71));_0x1c0ce7(_0xa40d71);})['catch'](function(_0x23c9ca){logger['error']('UpdateSmsQueueReport',_0x23c9ca['message'],_0x1b9271);_0x4d9175(_0x1255a6[_0x81cd('0x11')](0x1f4,_0x23c9ca[_0x81cd('0x14')]));});});}; \ No newline at end of file +var _0xddd0=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','stringify','body','where','attributes','limit','UpdateSmsQueueReport','lodash','util'];(function(_0x7d3ab1,_0x4131b5){var _0x5b5b0d=function(_0x41b197){while(--_0x41b197){_0x7d3ab1['push'](_0x7d3ab1['shift']());}};_0x5b5b0d(++_0x4131b5);}(_0xddd0,0x1b8));var _0x0ddd=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xddd0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0ddd('0x0'));var util=require(_0x0ddd('0x1'));var moment=require(_0x0ddd('0x2'));var BPromise=require(_0x0ddd('0x3'));var rs=require(_0x0ddd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ddd('0x5'))['db'];var utils=require(_0x0ddd('0x6'));var logger=require(_0x0ddd('0x7'))('rpc');var config=require(_0x0ddd('0x8'));var jayson=require(_0x0ddd('0x9'));var client=jayson['client'][_0x0ddd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52ea57,_0x11f4ed,_0x59bd66){return new BPromise(function(_0x29460b,_0x5e994c){return client[_0x0ddd('0xb')](_0x52ea57,_0x59bd66)[_0x0ddd('0xc')](function(_0x30ed50){logger[_0x0ddd('0xd')](_0x0ddd('0xe'),_0x11f4ed,_0x0ddd('0xf'));logger[_0x0ddd('0x10')](_0x0ddd('0x11'),_0x11f4ed,'request\x20sent',JSON['stringify'](_0x30ed50));if(_0x30ed50['error']){if(_0x30ed50['error'][_0x0ddd('0x12')]===0x1f4){logger[_0x0ddd('0x13')](_0x0ddd('0xe'),_0x11f4ed,_0x30ed50[_0x0ddd('0x13')][_0x0ddd('0x14')]);return _0x5e994c(_0x30ed50[_0x0ddd('0x13')][_0x0ddd('0x14')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x11f4ed,_0x30ed50[_0x0ddd('0x13')][_0x0ddd('0x14')]);return _0x29460b(_0x30ed50[_0x0ddd('0x13')][_0x0ddd('0x14')]);}else{logger[_0x0ddd('0xd')](_0x0ddd('0xe'),_0x11f4ed,_0x0ddd('0xf'));_0x29460b(_0x30ed50[_0x0ddd('0x15')][_0x0ddd('0x14')]);}})[_0x0ddd('0x16')](function(_0x1f874e){logger['error'](_0x0ddd('0xe'),_0x11f4ed,_0x1f874e);_0x5e994c(_0x1f874e);});});}exports[_0x0ddd('0x17')]=function(_0x3a5af7){var _0x405829=this;return new Promise(function(_0x2664ac,_0x20c6bc){return db[_0x0ddd('0x18')][_0x0ddd('0x19')](_0x3a5af7['body'],{'raw':_0x3a5af7[_0x0ddd('0x1a')]?_0x3a5af7[_0x0ddd('0x1a')][_0x0ddd('0x1b')]===undefined?!![]:![]:!![]})[_0x0ddd('0xc')](function(_0x5763ad){logger[_0x0ddd('0xd')](_0x0ddd('0x17'),_0x3a5af7);logger[_0x0ddd('0x10')](_0x0ddd('0x17'),_0x3a5af7,JSON[_0x0ddd('0x1c')](_0x5763ad));_0x2664ac(_0x5763ad);})[_0x0ddd('0x16')](function(_0x233cd5){logger[_0x0ddd('0x13')](_0x0ddd('0x17'),_0x233cd5[_0x0ddd('0x14')],_0x3a5af7);_0x20c6bc(_0x405829[_0x0ddd('0x13')](0x1f4,_0x233cd5[_0x0ddd('0x14')]));});});};exports['UpdateSmsQueueReport']=function(_0x3fe4d4){var _0x19dc2c=this;return new Promise(function(_0x6c9622,_0x4b09e3){return db['SmsQueueReport']['update'](_0x3fe4d4[_0x0ddd('0x1d')],{'raw':_0x3fe4d4[_0x0ddd('0x1a')]?_0x3fe4d4[_0x0ddd('0x1a')][_0x0ddd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fe4d4['options']?_0x3fe4d4[_0x0ddd('0x1a')][_0x0ddd('0x1e')]||null:null,'attributes':_0x3fe4d4[_0x0ddd('0x1a')]?_0x3fe4d4[_0x0ddd('0x1a')][_0x0ddd('0x1f')]||null:null,'limit':_0x3fe4d4[_0x0ddd('0x1a')]?_0x3fe4d4[_0x0ddd('0x1a')][_0x0ddd('0x20')]||null:null})[_0x0ddd('0xc')](function(_0x47658d){logger[_0x0ddd('0xd')](_0x0ddd('0x21'),_0x3fe4d4);logger[_0x0ddd('0x10')](_0x0ddd('0x21'),_0x3fe4d4,JSON[_0x0ddd('0x1c')](_0x47658d));_0x6c9622(_0x47658d);})['catch'](function(_0xd91154){logger['error'](_0x0ddd('0x21'),_0xd91154[_0x0ddd('0x14')],_0x3fe4d4);_0x4b09e3(_0x19dc2c[_0x0ddd('0x13')](0x1f4,_0xd91154['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 1f3dcb9..8c131d8 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 _0x7b2c=['post','create','delete','destroy','exports','util','express','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x7b2c,0x157));var _0xc7b2=function(_0x130d50,_0x3c9185){_0x130d50=_0x130d50-0x0;var _0xb589fd=_0x7b2c[_0x130d50];return _0xb589fd;};'use strict';var multer=require('multer');var util=require(_0xc7b2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc7b2('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0xc7b2('0x2')]('/',auth[_0xc7b2('0x3')](),controller['index']);router[_0xc7b2('0x2')](_0xc7b2('0x4'),auth[_0xc7b2('0x3')](),controller[_0xc7b2('0x5')]);router['get'](_0xc7b2('0x6'),auth[_0xc7b2('0x3')](),controller[_0xc7b2('0x7')]);router[_0xc7b2('0x8')]('/',auth[_0xc7b2('0x3')](),controller[_0xc7b2('0x9')]);router['put'](_0xc7b2('0x6'),auth['isAuthenticated'](),controller['update']);router[_0xc7b2('0xa')](_0xc7b2('0x6'),auth[_0xc7b2('0x3')](),controller[_0xc7b2('0xb')]);module[_0xc7b2('0xc')]=router; \ No newline at end of file +var _0x801a=['../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2ff28d,_0x5d4d8a){var _0x5efbd9=function(_0x1118fc){while(--_0x1118fc){_0x2ff28d['push'](_0x2ff28d['shift']());}};_0x5efbd9(++_0x5d4d8a);}(_0x801a,0x101));var _0xa801=function(_0x37fd5c,_0x3f6ee1){_0x37fd5c=_0x37fd5c-0x0;var _0x24db22=_0x801a[_0x37fd5c];return _0x24db22;};'use strict';var multer=require(_0xa801('0x0'));var util=require(_0xa801('0x1'));var path=require(_0xa801('0x2'));var timeout=require(_0xa801('0x3'));var express=require(_0xa801('0x4'));var router=express[_0xa801('0x5')]();var auth=require(_0xa801('0x6'));var interaction=require(_0xa801('0x7'));var config=require(_0xa801('0x8'));var controller=require(_0xa801('0x9'));router[_0xa801('0xa')]('/',auth[_0xa801('0xb')](),controller[_0xa801('0xc')]);router[_0xa801('0xa')](_0xa801('0xd'),auth[_0xa801('0xb')](),controller[_0xa801('0xe')]);router[_0xa801('0xa')](_0xa801('0xf'),auth[_0xa801('0xb')](),controller[_0xa801('0x10')]);router['post']('/',auth[_0xa801('0xb')](),controller[_0xa801('0x11')]);router[_0xa801('0x12')](_0xa801('0xf'),auth[_0xa801('0xb')](),controller[_0xa801('0x13')]);router[_0xa801('0x14')](_0xa801('0xf'),auth[_0xa801('0xb')](),controller['destroy']);module[_0xa801('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a56d36c..8f19911 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 _0x3372=['queue','DATE','NOW','moment','exports','STRING','ENUM','account','agent'];(function(_0x411559,_0x306f9c){var _0x40c534=function(_0x5d4f9f){while(--_0x5d4f9f){_0x411559['push'](_0x411559['shift']());}};_0x40c534(++_0x306f9c);}(_0x3372,0x78));var _0x2337=function(_0x37eb5d,_0x4c5458){_0x37eb5d=_0x37eb5d-0x0;var _0x15aead=_0x3372[_0x37eb5d];return _0x15aead;};'use strict';var moment=require(_0x2337('0x0'));var Sequelize=require('sequelize');module[_0x2337('0x1')]={'uniqueid':{'type':Sequelize[_0x2337('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2337('0x3')](_0x2337('0x4'),_0x2337('0x5'),_0x2337('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x2337('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x2337('0x8')]}}; \ No newline at end of file +var _0x4fcc=['queue','DATE','NOW','moment','sequelize','STRING','account','agent'];(function(_0x203dce,_0xd2eb8){var _0x37ee00=function(_0x274fec){while(--_0x274fec){_0x203dce['push'](_0x203dce['shift']());}};_0x37ee00(++_0xd2eb8);}(_0x4fcc,0xe3));var _0xc4fc=function(_0x465893,_0x282856){_0x465893=_0x465893-0x0;var _0xde14bc=_0x4fcc[_0x465893];return _0xde14bc;};'use strict';var moment=require(_0xc4fc('0x0'));var Sequelize=require(_0xc4fc('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xc4fc('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc4fc('0x3'),_0xc4fc('0x4'),_0xc4fc('0x5')),'allowNull':![],'defaultValue':_0xc4fc('0x5')},'transferredAt':{'type':Sequelize[_0xc4fc('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xc4fc('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index a015288..67792ea 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 _0xa30a=['order','sort','where','pick','filter','merge','map','type','key','field','options','include','rows','catch','params','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','SmsTransferReport','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa30a,0x1a6));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xaa30('0x0'));var emlformat=require(_0xaa30('0x1'));var rimraf=require(_0xaa30('0x2'));var zipdir=require(_0xaa30('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require('sox');var csv=require(_0xaa30('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa30('0xa'));var squel=require('squel');var crypto=require(_0xaa30('0xb'));var jsforce=require(_0xaa30('0xc'));var deskjs=require(_0xaa30('0xd'));var toCsv=require(_0xaa30('0x9'));var querystring=require(_0xaa30('0xe'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xaa30('0xf'));var qs=require(_0xaa30('0x10'));var logger=require(_0xaa30('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xaa30('0x12'))['db'];function respondWithStatusCode(_0x6329f6,_0x3d6da5){_0x3d6da5=_0x3d6da5||0xcc;return function(_0x5e11a3){if(_0x5e11a3){return _0x6329f6['sendStatus'](_0x3d6da5);}return _0x6329f6[_0xaa30('0x13')](_0x3d6da5)[_0xaa30('0x14')]();};}function respondWithResult(_0x5041f2,_0x6c8a1e){_0x6c8a1e=_0x6c8a1e||0xc8;return function(_0x549668){if(_0x549668){return _0x5041f2[_0xaa30('0x13')](_0x6c8a1e)[_0xaa30('0x15')](_0x549668);}};}function respondWithFilteredResult(_0x48b792,_0x4f1938){return function(_0x1e8982){if(_0x1e8982){var _0x5141a7=_0x1e8982[_0xaa30('0x16')],_0x22f45f=_0x4f1938[_0xaa30('0x17')],_0x2a9e56=_0x4f1938[_0xaa30('0x17')]+_0x4f1938[_0xaa30('0x18')],_0xac3fc;if(_0x2a9e56>=_0x5141a7){_0x2a9e56=_0x5141a7;_0xac3fc=0xc8;}else{_0xac3fc=0xce;}_0x48b792[_0xaa30('0x13')](_0xac3fc);return _0x48b792['set'](_0xaa30('0x19'),_0x22f45f+'-'+_0x2a9e56+'/'+_0x5141a7)['json'](_0x1e8982);}return null;};}function patchUpdates(_0x2c7b8a){return function(_0x257990){try{jsonpatch[_0xaa30('0x1a')](_0x257990,_0x2c7b8a,!![]);}catch(_0x528426){return BPromise[_0xaa30('0x1b')](_0x528426);}return _0x257990[_0xaa30('0x1c')]();};}function saveUpdates(_0x25c428,_0x46f1ca){return function(_0x5da014){if(_0x5da014){return _0x5da014['update'](_0x25c428)[_0xaa30('0x1d')](function(_0x2c41b4){return _0x2c41b4;});}return null;};}function removeEntity(_0x39d4b6,_0x437f06){return function(_0x126735){if(_0x126735){return _0x126735[_0xaa30('0x1e')]()['then'](function(){_0x39d4b6[_0xaa30('0x13')](0xcc)[_0xaa30('0x14')]();});}};}function handleEntityNotFound(_0x53a325,_0x32059f){return function(_0x462800){if(!_0x462800){_0x53a325['sendStatus'](0x194);}return _0x462800;};}function handleError(_0x5e3e1c,_0x466ec5){_0x466ec5=_0x466ec5||0x1f4;return function(_0x874a98){logger[_0xaa30('0x1f')](_0x874a98[_0xaa30('0x20')]);if(_0x874a98[_0xaa30('0x21')]){delete _0x874a98[_0xaa30('0x21')];}_0x5e3e1c['status'](_0x466ec5)[_0xaa30('0x22')](_0x874a98);};}exports[_0xaa30('0x23')]=function(_0x154f6e,_0x130389){var _0x6cb2fa={},_0x1d169f={},_0xabae24={'count':0x0,'rows':[]};var _0x56b9df=db[_0xaa30('0x24')]['rawAttributes'];_0x1d169f[_0xaa30('0x25')]=_[_0xaa30('0x26')](_0x56b9df);_0x1d169f['query']=_['keys'](_0x154f6e['query']);_0x1d169f[_0xaa30('0x27')]=_[_0xaa30('0x28')](_0x1d169f[_0xaa30('0x25')],_0x1d169f[_0xaa30('0x29')]);_0x6cb2fa['attributes']=_['intersection'](_0x1d169f[_0xaa30('0x25')],qs[_0xaa30('0x2a')](_0x154f6e[_0xaa30('0x29')][_0xaa30('0x2a')]));_0x6cb2fa[_0xaa30('0x2b')]=_0x6cb2fa[_0xaa30('0x2b')][_0xaa30('0x2c')]?_0x6cb2fa[_0xaa30('0x2b')]:_0x1d169f[_0xaa30('0x25')];if(!_0x154f6e[_0xaa30('0x29')][_0xaa30('0x2d')](_0xaa30('0x2e'))){_0x6cb2fa[_0xaa30('0x18')]=qs[_0xaa30('0x18')](_0x154f6e[_0xaa30('0x29')][_0xaa30('0x18')]);_0x6cb2fa[_0xaa30('0x17')]=qs['offset'](_0x154f6e['query'][_0xaa30('0x17')]);}_0x6cb2fa[_0xaa30('0x2f')]=qs[_0xaa30('0x30')](_0x154f6e[_0xaa30('0x29')]['sort']);_0x6cb2fa[_0xaa30('0x31')]=qs['filters'](_[_0xaa30('0x32')](_0x154f6e[_0xaa30('0x29')],_0x1d169f[_0xaa30('0x27')]));if(_0x154f6e['query'][_0xaa30('0x33')]){_0x6cb2fa[_0xaa30('0x31')]=_[_0xaa30('0x34')](_0x6cb2fa[_0xaa30('0x31')],{'$or':_[_0xaa30('0x35')](_0x56b9df,function(_0x53c35b){if(_0x53c35b[_0xaa30('0x36')][_0xaa30('0x37')]!=='VIRTUAL'){var _0x521ac8={};_0x521ac8[_0x53c35b[_0xaa30('0x38')]]={'$like':'%'+_0x154f6e[_0xaa30('0x29')][_0xaa30('0x33')]+'%'};return _0x521ac8;}})});}_0x6cb2fa=_[_0xaa30('0x34')]({},_0x6cb2fa,_0x154f6e[_0xaa30('0x39')]);var _0x25da1c={'where':_0x6cb2fa['where']};return db[_0xaa30('0x24')][_0xaa30('0x16')](_0x25da1c)['then'](function(_0x4948df){_0xabae24['count']=_0x4948df;if(_0x154f6e['query']['includeAll']){_0x6cb2fa[_0xaa30('0x3a')]=[{'all':!![]}];}return db[_0xaa30('0x24')]['findAll'](_0x6cb2fa);})[_0xaa30('0x1d')](function(_0x2798c3){_0xabae24[_0xaa30('0x3b')]=_0x2798c3;return _0xabae24;})[_0xaa30('0x1d')](respondWithFilteredResult(_0x130389,_0x6cb2fa))[_0xaa30('0x3c')](handleError(_0x130389,null));};exports['show']=function(_0x172fe6,_0x14962b){var _0x356212={'raw':!![],'where':{'id':_0x172fe6[_0xaa30('0x3d')]['id']}},_0x148771={};_0x148771[_0xaa30('0x25')]=_[_0xaa30('0x26')](db[_0xaa30('0x24')]['rawAttributes']);_0x148771['query']=_['keys'](_0x172fe6['query']);_0x148771[_0xaa30('0x27')]=_[_0xaa30('0x28')](_0x148771['model'],_0x148771[_0xaa30('0x29')]);_0x356212[_0xaa30('0x2b')]=_['intersection'](_0x148771['model'],qs[_0xaa30('0x2a')](_0x172fe6[_0xaa30('0x29')][_0xaa30('0x2a')]));_0x356212[_0xaa30('0x2b')]=_0x356212[_0xaa30('0x2b')]['length']?_0x356212[_0xaa30('0x2b')]:_0x148771[_0xaa30('0x25')];if(_0x172fe6['query'][_0xaa30('0x3e')]){_0x356212[_0xaa30('0x3a')]=[{'all':!![]}];}_0x356212=_['merge']({},_0x356212,_0x172fe6[_0xaa30('0x39')]);return db[_0xaa30('0x24')][_0xaa30('0x3f')](_0x356212)[_0xaa30('0x1d')](handleEntityNotFound(_0x14962b,null))['then'](respondWithResult(_0x14962b,null))[_0xaa30('0x3c')](handleError(_0x14962b,null));};exports[_0xaa30('0x40')]=function(_0x18ab26,_0x54f17f){return db[_0xaa30('0x24')][_0xaa30('0x40')](_0x18ab26['body'],{})[_0xaa30('0x1d')](respondWithResult(_0x54f17f,0xc9))[_0xaa30('0x3c')](handleError(_0x54f17f,null));};exports['update']=function(_0x10e737,_0x1acf66){if(_0x10e737['body']['id']){delete _0x10e737[_0xaa30('0x41')]['id'];}return db[_0xaa30('0x24')][_0xaa30('0x3f')]({'where':{'id':_0x10e737[_0xaa30('0x3d')]['id']}})[_0xaa30('0x1d')](handleEntityNotFound(_0x1acf66,null))['then'](saveUpdates(_0x10e737[_0xaa30('0x41')],null))[_0xaa30('0x1d')](respondWithResult(_0x1acf66,null))[_0xaa30('0x3c')](handleError(_0x1acf66,null));};exports[_0xaa30('0x1e')]=function(_0x1c79b8,_0x2cc8b4){return db['SmsTransferReport']['find']({'where':{'id':_0x1c79b8[_0xaa30('0x3d')]['id']}})[_0xaa30('0x1d')](handleEntityNotFound(_0x2cc8b4,null))[_0xaa30('0x1d')](removeEntity(_0x2cc8b4,null))[_0xaa30('0x3c')](handleError(_0x2cc8b4,null));};exports[_0xaa30('0x42')]=function(_0x1aef1b,_0x11ffdb){return db[_0xaa30('0x24')][_0xaa30('0x42')]()['then'](respondWithResult(_0x11ffdb,null))['catch'](handleError(_0x11ffdb,null));}; \ No newline at end of file +var _0x3d3d=['util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','status','json','count','offset','limit','set','apply','reject','save','update','then','sendStatus','stack','name','send','rawAttributes','keys','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','includeAll','include','SmsTransferReport','findAll','rows','catch','show','fields','find','create','body','destroy','describe','rimraf','request-promise','mustache'];(function(_0x542d50,_0x31725d){var _0x273f49=function(_0x4ae160){while(--_0x4ae160){_0x542d50['push'](_0x542d50['shift']());}};_0x273f49(++_0x31725d);}(_0x3d3d,0x13d));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd3d3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd3d3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd3d3('0x2'));var util=require(_0xd3d3('0x3'));var path=require('path');var sox=require(_0xd3d3('0x4'));var csv=require(_0xd3d3('0x5'));var ejs=require(_0xd3d3('0x6'));var fs=require('fs');var _=require(_0xd3d3('0x7'));var squel=require(_0xd3d3('0x8'));var crypto=require(_0xd3d3('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd3d3('0x5'));var querystring=require(_0xd3d3('0xa'));var Papa=require(_0xd3d3('0xb'));var authService=require('../../components/auth/service');var hardwareService=require(_0xd3d3('0xc'));var Redis=require(_0xd3d3('0xd'));var qs=require(_0xd3d3('0xe'));var logger=require(_0xd3d3('0xf'))('api');var utils=require(_0xd3d3('0x10'));var config=require(_0xd3d3('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2578ce,_0x10dd7d){_0x10dd7d=_0x10dd7d||0xcc;return function(_0x51aebe){if(_0x51aebe){return _0x2578ce['sendStatus'](_0x10dd7d);}return _0x2578ce[_0xd3d3('0x12')](_0x10dd7d)['end']();};}function respondWithResult(_0x580b5,_0xd3f968){_0xd3f968=_0xd3f968||0xc8;return function(_0x3a3cd8){if(_0x3a3cd8){return _0x580b5[_0xd3d3('0x12')](_0xd3f968)[_0xd3d3('0x13')](_0x3a3cd8);}};}function respondWithFilteredResult(_0x18d9b5,_0x48b830){return function(_0x83cb7c){if(_0x83cb7c){var _0xf5c4f8=_0x83cb7c[_0xd3d3('0x14')],_0x3dfe12=_0x48b830[_0xd3d3('0x15')],_0x94fc8c=_0x48b830[_0xd3d3('0x15')]+_0x48b830[_0xd3d3('0x16')],_0x4575d1;if(_0x94fc8c>=_0xf5c4f8){_0x94fc8c=_0xf5c4f8;_0x4575d1=0xc8;}else{_0x4575d1=0xce;}_0x18d9b5[_0xd3d3('0x12')](_0x4575d1);return _0x18d9b5[_0xd3d3('0x17')]('Content-Range',_0x3dfe12+'-'+_0x94fc8c+'/'+_0xf5c4f8)['json'](_0x83cb7c);}return null;};}function patchUpdates(_0x5676a2){return function(_0x2464a5){try{jsonpatch[_0xd3d3('0x18')](_0x2464a5,_0x5676a2,!![]);}catch(_0x538376){return BPromise[_0xd3d3('0x19')](_0x538376);}return _0x2464a5[_0xd3d3('0x1a')]();};}function saveUpdates(_0x3a57d6,_0x4d700e){return function(_0x3f5c89){if(_0x3f5c89){return _0x3f5c89[_0xd3d3('0x1b')](_0x3a57d6)[_0xd3d3('0x1c')](function(_0x1c637d){return _0x1c637d;});}return null;};}function removeEntity(_0x10d1e4,_0x118b3a){return function(_0x3a92b0){if(_0x3a92b0){return _0x3a92b0['destroy']()['then'](function(){_0x10d1e4[_0xd3d3('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ff437,_0x5e132e){return function(_0x26b64f){if(!_0x26b64f){_0x3ff437[_0xd3d3('0x1d')](0x194);}return _0x26b64f;};}function handleError(_0x1ce288,_0x316a4a){_0x316a4a=_0x316a4a||0x1f4;return function(_0x12b919){logger['error'](_0x12b919[_0xd3d3('0x1e')]);if(_0x12b919['name']){delete _0x12b919[_0xd3d3('0x1f')];}_0x1ce288['status'](_0x316a4a)[_0xd3d3('0x20')](_0x12b919);};}exports['index']=function(_0x37d37f,_0x3b4efb){var _0x333287={},_0x536afe={},_0x3b5d09={'count':0x0,'rows':[]};var _0x4c7008=db['SmsTransferReport'][_0xd3d3('0x21')];_0x536afe['model']=_[_0xd3d3('0x22')](_0x4c7008);_0x536afe['query']=_[_0xd3d3('0x22')](_0x37d37f[_0xd3d3('0x23')]);_0x536afe[_0xd3d3('0x24')]=_[_0xd3d3('0x25')](_0x536afe[_0xd3d3('0x26')],_0x536afe[_0xd3d3('0x23')]);_0x333287[_0xd3d3('0x27')]=_[_0xd3d3('0x25')](_0x536afe['model'],qs['fields'](_0x37d37f['query']['fields']));_0x333287[_0xd3d3('0x27')]=_0x333287[_0xd3d3('0x27')][_0xd3d3('0x28')]?_0x333287['attributes']:_0x536afe[_0xd3d3('0x26')];if(!_0x37d37f[_0xd3d3('0x23')]['hasOwnProperty'](_0xd3d3('0x29'))){_0x333287[_0xd3d3('0x16')]=qs['limit'](_0x37d37f[_0xd3d3('0x23')][_0xd3d3('0x16')]);_0x333287[_0xd3d3('0x15')]=qs['offset'](_0x37d37f[_0xd3d3('0x23')][_0xd3d3('0x15')]);}_0x333287[_0xd3d3('0x2a')]=qs[_0xd3d3('0x2b')](_0x37d37f[_0xd3d3('0x23')][_0xd3d3('0x2b')]);_0x333287[_0xd3d3('0x2c')]=qs[_0xd3d3('0x24')](_[_0xd3d3('0x2d')](_0x37d37f['query'],_0x536afe[_0xd3d3('0x24')]));if(_0x37d37f['query'][_0xd3d3('0x2e')]){_0x333287[_0xd3d3('0x2c')]=_[_0xd3d3('0x2f')](_0x333287['where'],{'$or':_['map'](_0x4c7008,function(_0x587fc1){if(_0x587fc1['type']['key']!==_0xd3d3('0x30')){var _0x4405ba={};_0x4405ba[_0x587fc1[_0xd3d3('0x31')]]={'$like':'%'+_0x37d37f[_0xd3d3('0x23')][_0xd3d3('0x2e')]+'%'};return _0x4405ba;}})});}_0x333287=_['merge']({},_0x333287,_0x37d37f[_0xd3d3('0x32')]);var _0x180d8c={'where':_0x333287[_0xd3d3('0x2c')]};return db['SmsTransferReport'][_0xd3d3('0x14')](_0x180d8c)[_0xd3d3('0x1c')](function(_0x146147){_0x3b5d09[_0xd3d3('0x14')]=_0x146147;if(_0x37d37f['query'][_0xd3d3('0x33')]){_0x333287[_0xd3d3('0x34')]=[{'all':!![]}];}return db[_0xd3d3('0x35')][_0xd3d3('0x36')](_0x333287);})['then'](function(_0x30cf7d){_0x3b5d09[_0xd3d3('0x37')]=_0x30cf7d;return _0x3b5d09;})[_0xd3d3('0x1c')](respondWithFilteredResult(_0x3b4efb,_0x333287))[_0xd3d3('0x38')](handleError(_0x3b4efb,null));};exports[_0xd3d3('0x39')]=function(_0x4a3650,_0x522b08){var _0x18c8b6={'raw':!![],'where':{'id':_0x4a3650['params']['id']}},_0x108032={};_0x108032['model']=_[_0xd3d3('0x22')](db[_0xd3d3('0x35')][_0xd3d3('0x21')]);_0x108032['query']=_[_0xd3d3('0x22')](_0x4a3650['query']);_0x108032[_0xd3d3('0x24')]=_[_0xd3d3('0x25')](_0x108032[_0xd3d3('0x26')],_0x108032[_0xd3d3('0x23')]);_0x18c8b6['attributes']=_[_0xd3d3('0x25')](_0x108032[_0xd3d3('0x26')],qs[_0xd3d3('0x3a')](_0x4a3650[_0xd3d3('0x23')][_0xd3d3('0x3a')]));_0x18c8b6['attributes']=_0x18c8b6[_0xd3d3('0x27')][_0xd3d3('0x28')]?_0x18c8b6[_0xd3d3('0x27')]:_0x108032['model'];if(_0x4a3650[_0xd3d3('0x23')][_0xd3d3('0x33')]){_0x18c8b6['include']=[{'all':!![]}];}_0x18c8b6=_['merge']({},_0x18c8b6,_0x4a3650[_0xd3d3('0x32')]);return db[_0xd3d3('0x35')][_0xd3d3('0x3b')](_0x18c8b6)[_0xd3d3('0x1c')](handleEntityNotFound(_0x522b08,null))['then'](respondWithResult(_0x522b08,null))[_0xd3d3('0x38')](handleError(_0x522b08,null));};exports['create']=function(_0x23e6c3,_0x168e11){return db['SmsTransferReport'][_0xd3d3('0x3c')](_0x23e6c3['body'],{})[_0xd3d3('0x1c')](respondWithResult(_0x168e11,0xc9))[_0xd3d3('0x38')](handleError(_0x168e11,null));};exports[_0xd3d3('0x1b')]=function(_0x35668d,_0x4f92e3){if(_0x35668d[_0xd3d3('0x3d')]['id']){delete _0x35668d[_0xd3d3('0x3d')]['id'];}return db[_0xd3d3('0x35')][_0xd3d3('0x3b')]({'where':{'id':_0x35668d['params']['id']}})[_0xd3d3('0x1c')](handleEntityNotFound(_0x4f92e3,null))[_0xd3d3('0x1c')](saveUpdates(_0x35668d[_0xd3d3('0x3d')],null))[_0xd3d3('0x1c')](respondWithResult(_0x4f92e3,null))[_0xd3d3('0x38')](handleError(_0x4f92e3,null));};exports[_0xd3d3('0x3e')]=function(_0x1a211b,_0x9a2511){return db[_0xd3d3('0x35')]['find']({'where':{'id':_0x1a211b['params']['id']}})[_0xd3d3('0x1c')](handleEntityNotFound(_0x9a2511,null))[_0xd3d3('0x1c')](removeEntity(_0x9a2511,null))[_0xd3d3('0x38')](handleError(_0x9a2511,null));};exports[_0xd3d3('0x3f')]=function(_0x4178a2,_0x323296){return db[_0xd3d3('0x35')]['describe']()[_0xd3d3('0x1c')](respondWithResult(_0x323296,null))[_0xd3d3('0x38')](handleError(_0x323296,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index b654a61..36b4592 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 _0x84ab=['api','moment','request-promise','./smsTransferReport.attributes','define','uniqueid','lodash','util','../../config/logger'];(function(_0x1c8e1c,_0x15d966){var _0x43abb3=function(_0x11fa2b){while(--_0x11fa2b){_0x1c8e1c['push'](_0x1c8e1c['shift']());}};_0x43abb3(++_0x15d966);}(_0x84ab,0x12f));var _0xb84a=function(_0x363b81,_0x81e6ca){_0x363b81=_0x363b81-0x0;var _0x1d92fb=_0x84ab[_0x363b81];return _0x1d92fb;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var attributes=require(_0xb84a('0x6'));module['exports']=function(_0x9d3a00,_0xe72ccd){return _0x9d3a00[_0xb84a('0x7')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb84a('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','./smsTransferReport.attributes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x4abbc3,_0x19e57d){_0x4abbc3=_0x4abbc3-0x0;var _0x14fbd8=_0x3e74[_0x4abbc3];return _0x14fbd8;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x43e7('0x4'));module['exports']=function(_0x128b0f,_0xe838b4){return _0x128b0f[_0x43e7('0x5')](_0x43e7('0x6'),attributes,{'tableName':_0x43e7('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x43e7('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index e18279c..a60d505 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 _0x3cae=['../../config/logger','rpc','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xfad1a7,_0x2e3b8d){var _0x571012=function(_0x33255d){while(--_0x33255d){_0xfad1a7['push'](_0xfad1a7['shift']());}};_0x571012(++_0x2e3b8d);}(_0x3cae,0x117));var _0xe3ca=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x3cae[_0x555b2f];return _0x81c0a6;};'use strict';var _=require(_0xe3ca('0x0'));var util=require(_0xe3ca('0x1'));var moment=require(_0xe3ca('0x2'));var BPromise=require(_0xe3ca('0x3'));var rs=require(_0xe3ca('0x4'));var fs=require('fs');var Redis=require(_0xe3ca('0x5'));var db=require(_0xe3ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3ca('0x7'))(_0xe3ca('0x8'));var config=require('../../config/environment');var jayson=require(_0xe3ca('0x9'));var client=jayson['client'][_0xe3ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7fafb4,_0x36d17a,_0x578178){return new BPromise(function(_0x2c4863,_0x100c20){return client[_0xe3ca('0xb')](_0x7fafb4,_0x578178)[_0xe3ca('0xc')](function(_0x1ae7bf){logger[_0xe3ca('0xd')](_0xe3ca('0xe'),_0x36d17a,'request\x20sent');logger[_0xe3ca('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x36d17a,_0xe3ca('0x10'),JSON[_0xe3ca('0x11')](_0x1ae7bf));if(_0x1ae7bf[_0xe3ca('0x12')]){if(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x13')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x36d17a,_0x1ae7bf[_0xe3ca('0x12')]['message']);return _0x100c20(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);}logger['error'](_0xe3ca('0xe'),_0x36d17a,_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);return _0x2c4863(_0x1ae7bf[_0xe3ca('0x12')][_0xe3ca('0x14')]);}else{logger[_0xe3ca('0xd')](_0xe3ca('0xe'),_0x36d17a,_0xe3ca('0x10'));_0x2c4863(_0x1ae7bf['result']['message']);}})[_0xe3ca('0x15')](function(_0x4296ae){logger[_0xe3ca('0x12')](_0xe3ca('0xe'),_0x36d17a,_0x4296ae);_0x100c20(_0x4296ae);});});} \ No newline at end of file +var _0x3d04=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','info'];(function(_0x50b523,_0x29e406){var _0x2c73bb=function(_0x4878e3){while(--_0x4878e3){_0x50b523['push'](_0x50b523['shift']());}};_0x2c73bb(++_0x29e406);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));var BPromise=require(_0x43d0('0x3'));var rs=require(_0x43d0('0x4'));var fs=require('fs');var Redis=require(_0x43d0('0x5'));var db=require(_0x43d0('0x6'))['db'];var utils=require(_0x43d0('0x7'));var logger=require('../../config/logger')(_0x43d0('0x8'));var config=require(_0x43d0('0x9'));var jayson=require(_0x43d0('0xa'));var client=jayson[_0x43d0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484271,_0x50919e,_0x5efb95){return new BPromise(function(_0x457550,_0x3344d3){return client[_0x43d0('0xc')](_0x484271,_0x5efb95)[_0x43d0('0xd')](function(_0x44a763){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x50919e,_0x43d0('0xe'),JSON[_0x43d0('0xf')](_0x44a763));if(_0x44a763[_0x43d0('0x10')]){if(_0x44a763[_0x43d0('0x10')]['code']===0x1f4){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x44a763['error'][_0x43d0('0x12')]);return _0x3344d3(_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);}logger['error'](_0x43d0('0x11'),_0x50919e,_0x44a763[_0x43d0('0x10')][_0x43d0('0x12')]);return _0x457550(_0x44a763['error'][_0x43d0('0x12')]);}else{logger[_0x43d0('0x13')](_0x43d0('0x11'),_0x50919e,_0x43d0('0xe'));_0x457550(_0x44a763[_0x43d0('0x14')]['message']);}})['catch'](function(_0x1e91a7){logger[_0x43d0('0x10')](_0x43d0('0x11'),_0x50919e,_0x1e91a7);_0x3344d3(_0x1e91a7);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index fb52c4f..ef16715 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 _0x553c=['connect-timeout','express','./sound.controller','get','isAuthenticated','/:id','/:id/download','download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','create','put','delete','exports','multer','util','path'];(function(_0x3603d2,_0xbafd77){var _0x1093e0=function(_0x5076e9){while(--_0x5076e9){_0x3603d2['push'](_0x3603d2['shift']());}};_0x1093e0(++_0xbafd77);}(_0x553c,0x177));var _0xc553=function(_0x295c57,_0x7e41d9){_0x295c57=_0x295c57-0x0;var _0x1979c8=_0x553c[_0x295c57];return _0x1979c8;};'use strict';var multer=require(_0xc553('0x0'));var util=require(_0xc553('0x1'));var path=require(_0xc553('0x2'));var timeout=require(_0xc553('0x3'));var express=require(_0xc553('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc553('0x5'));router[_0xc553('0x6')]('/',auth[_0xc553('0x7')](),controller['index']);router[_0xc553('0x6')](_0xc553('0x8'),auth[_0xc553('0x7')](),controller['show']);router[_0xc553('0x6')](_0xc553('0x9'),auth[_0xc553('0x7')](),controller[_0xc553('0xa')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x8fc159,_0x4449e0,_0x1abd64){_0x1abd64(null,path[_0xc553('0xb')](config[_0xc553('0xc')],_0xc553('0xd')));},'filename':function(_0x14af6a,_0x2b0dd8,_0x54323f){_0x2b0dd8[_0xc553('0xe')]=_0x2b0dd8[_0xc553('0xe')][_0xc553('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x54323f(null,util[_0xc553('0x10')](_0xc553('0x11'),path[_0xc553('0x12')](_0x2b0dd8[_0xc553('0xe')],path[_0xc553('0x13')](_0x2b0dd8[_0xc553('0xe')])),Date[_0xc553('0x14')](),path['extname'](_0x2b0dd8['originalname'])));}})});router['post']('/',upload[_0xc553('0x15')](_0xc553('0x16')),controller[_0xc553('0x17')]);router[_0xc553('0x18')]('/:id',auth[_0xc553('0x7')](),controller['update']);router['delete'](_0xc553('0x8'),auth[_0xc553('0x7')](),controller[_0xc553('0x19')]);module[_0xc553('0x1a')]=router; \ No newline at end of file +var _0x2cad=['exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','download','diskStorage','server/files/sounds/original/','originalname','%s-%s%s','basename','now','extname','post','create','put','update'];(function(_0x5d4ebe,_0x184bf1){var _0x2a05f2=function(_0x459862){while(--_0x459862){_0x5d4ebe['push'](_0x5d4ebe['shift']());}};_0x2a05f2(++_0x184bf1);}(_0x2cad,0xe7));var _0xd2ca=function(_0x54239d,_0x42b732){_0x54239d=_0x54239d-0x0;var _0xfe773b=_0x2cad[_0x54239d];return _0xfe773b;};'use strict';var multer=require(_0xd2ca('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd2ca('0x1'));var express=require(_0xd2ca('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd2ca('0x3'));var config=require(_0xd2ca('0x4'));var controller=require(_0xd2ca('0x5'));router[_0xd2ca('0x6')]('/',auth[_0xd2ca('0x7')](),controller['index']);router[_0xd2ca('0x6')](_0xd2ca('0x8'),auth['isAuthenticated'](),controller[_0xd2ca('0x9')]);router['get']('/:id/download',auth[_0xd2ca('0x7')](),controller[_0xd2ca('0xa')]);var upload=multer({'storage':multer[_0xd2ca('0xb')]({'destination':function(_0x155151,_0xfbbd1,_0x365c){_0x365c(null,path['join'](config['root'],_0xd2ca('0xc')));},'filename':function(_0x26d5fe,_0x521c07,_0x331149){_0x521c07[_0xd2ca('0xd')]=_0x521c07[_0xd2ca('0xd')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x331149(null,util['format'](_0xd2ca('0xe'),path[_0xd2ca('0xf')](_0x521c07['originalname'],path['extname'](_0x521c07['originalname'])),Date[_0xd2ca('0x10')](),path[_0xd2ca('0x11')](_0x521c07[_0xd2ca('0xd')])));}})});router[_0xd2ca('0x12')]('/',upload['single']('file'),controller[_0xd2ca('0x13')]);router[_0xd2ca('0x14')](_0xd2ca('0x8'),auth[_0xd2ca('0x7')](),controller[_0xd2ca('0x15')]);router['delete'](_0xd2ca('0x8'),auth[_0xd2ca('0x7')](),controller['delete']);module[_0xd2ca('0x16')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 6ae8472..2ee13d5 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 _0x4e5e=['STRING','name','BIGINT','INTEGER','FLOAT','sequelize','exports'];(function(_0x48c139,_0x29423e){var _0x5a50dd=function(_0x596bc6){while(--_0x596bc6){_0x48c139['push'](_0x48c139['shift']());}};_0x5a50dd(++_0x29423e);}(_0x4e5e,0x9f));var _0xe4e5=function(_0x19b187,_0x522a4a){_0x19b187=_0x19b187-0x0;var _0x5d88bc=_0x4e5e[_0x19b187];return _0x5d88bc;};'use strict';var Sequelize=require(_0xe4e5('0x0'));module[_0xe4e5('0x1')]={'name':{'type':Sequelize[_0xe4e5('0x2')],'unique':_0xe4e5('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe4e5('0x2')]},'display_name':{'type':Sequelize[_0xe4e5('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xe4e5('0x2')]},'original_format':{'type':Sequelize[_0xe4e5('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xe4e5('0x4')]},'original_channelCount':{'type':Sequelize[_0xe4e5('0x5')]},'original_bitRate':{'type':Sequelize[_0xe4e5('0x4')]},'original_sampleRate':{'type':Sequelize[_0xe4e5('0x5')]},'converted_format':{'type':Sequelize[_0xe4e5('0x2')]},'converted_duration':{'type':Sequelize[_0xe4e5('0x6')]},'converted_sampleCount':{'type':Sequelize[_0xe4e5('0x4')]},'converted_channelCount':{'type':Sequelize[_0xe4e5('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xe4e5('0x5')]}}; \ No newline at end of file +var _0x68de=['BIGINT','INTEGER','FLOAT','sequelize','exports','STRING'];(function(_0x1c74f4,_0x3bb2bc){var _0x18b62a=function(_0x5482e9){while(--_0x5482e9){_0x1c74f4['push'](_0x1c74f4['shift']());}};_0x18b62a(++_0x3bb2bc);}(_0x68de,0x1e9));var _0xe68d=function(_0x1fc4e2,_0x493c3b){_0x1fc4e2=_0x1fc4e2-0x0;var _0x2ba184=_0x68de[_0x1fc4e2];return _0x2ba184;};'use strict';var Sequelize=require(_0xe68d('0x0'));module[_0xe68d('0x1')]={'name':{'type':Sequelize[_0xe68d('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xe68d('0x2')]},'display_name':{'type':Sequelize[_0xe68d('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xe68d('0x2')]},'original_format':{'type':Sequelize[_0xe68d('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xe68d('0x3')]},'original_channelCount':{'type':Sequelize[_0xe68d('0x4')]},'original_bitRate':{'type':Sequelize[_0xe68d('0x3')]},'original_sampleRate':{'type':Sequelize[_0xe68d('0x4')]},'converted_format':{'type':Sequelize[_0xe68d('0x2')]},'converted_duration':{'type':Sequelize[_0xe68d('0x5')]},'converted_sampleCount':{'type':Sequelize[_0xe68d('0x3')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xe68d('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xe68d('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index a790f60..da8f8d3 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 _0x4819=['sendStatus','stack','name','send','Sound','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','VIRTUAL','field','options','include','findAll','rows','show','params','includeAll','merge','find','catch','download','converted_format','join','root','server/files/sounds/converted','save_name','Sequelize','format','%s.%s','create','basename','filename','extname','file','originalname','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','transcode','error','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_channelCount','channelCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource'];(function(_0x3c2b09,_0x488869){var _0x1a2058=function(_0x208cb1){while(--_0x208cb1){_0x3c2b09['push'](_0x3c2b09['shift']());}};_0x1a2058(++_0x488869);}(_0x4819,0xcd));var _0x9481=function(_0x4cee82,_0x208e67){_0x4cee82=_0x4cee82-0x0;var _0x200c1d=_0x4819[_0x4cee82];return _0x200c1d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9481('0x0'));var rimraf=require(_0x9481('0x1'));var zipdir=require(_0x9481('0x2'));var jsonpatch=require(_0x9481('0x3'));var rp=require(_0x9481('0x4'));var moment=require(_0x9481('0x5'));var BPromise=require(_0x9481('0x6'));var Mustache=require(_0x9481('0x7'));var util=require(_0x9481('0x8'));var path=require(_0x9481('0x9'));var sox=require('sox');var csv=require(_0x9481('0xa'));var ejs=require('ejs');var fs=require('fs');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('0xa'));var querystring=require('querystring');var Papa=require(_0x9481('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x9481('0x10'));var Redis=require('ioredis');var qs=require(_0x9481('0x11'));var logger=require(_0x9481('0x12'))(_0x9481('0x13'));var utils=require(_0x9481('0x14'));var config=require(_0x9481('0x15'));var db=require(_0x9481('0x16'))['db'];function respondWithStatusCode(_0xa38c93,_0xe410c3){_0xe410c3=_0xe410c3||0xcc;return function(_0xed8e9){if(_0xed8e9){return _0xa38c93['sendStatus'](_0xe410c3);}return _0xa38c93['status'](_0xe410c3)[_0x9481('0x17')]();};}function respondWithResult(_0x150276,_0x2f0032){_0x2f0032=_0x2f0032||0xc8;return function(_0x28fcb6){if(_0x28fcb6){return _0x150276[_0x9481('0x18')](_0x2f0032)[_0x9481('0x19')](_0x28fcb6);}};}function respondWithFilteredResult(_0x3fb97f,_0x495b30){return function(_0x4220f1){if(_0x4220f1){var _0x7a7ee=_0x4220f1[_0x9481('0x1a')],_0x5b1fe6=_0x495b30[_0x9481('0x1b')],_0x2266d5=_0x495b30[_0x9481('0x1b')]+_0x495b30[_0x9481('0x1c')],_0x518150;if(_0x2266d5>=_0x7a7ee){_0x2266d5=_0x7a7ee;_0x518150=0xc8;}else{_0x518150=0xce;}_0x3fb97f['status'](_0x518150);return _0x3fb97f['set'](_0x9481('0x1d'),_0x5b1fe6+'-'+_0x2266d5+'/'+_0x7a7ee)['json'](_0x4220f1);}return null;};}function patchUpdates(_0x4d0da7){return function(_0x26671c){try{jsonpatch[_0x9481('0x1e')](_0x26671c,_0x4d0da7,!![]);}catch(_0x18c6f5){return BPromise[_0x9481('0x1f')](_0x18c6f5);}return _0x26671c[_0x9481('0x20')]();};}function saveUpdates(_0x3dc33f,_0x55a1bd){return function(_0x2cf1aa){if(_0x2cf1aa){return _0x2cf1aa[_0x9481('0x21')](_0x3dc33f)[_0x9481('0x22')](function(_0x615e02){return _0x615e02;});}return null;};}function removeEntity(_0xb5cd2c,_0x56da97){return function(_0x215dd7){if(_0x215dd7){return _0x215dd7[_0x9481('0x23')]()['then'](function(){var _0x2bcf37=_0x215dd7[_0x9481('0x24')]({'plain':!![]});var _0x352b3a=_0x9481('0x25');return db[_0x9481('0x26')]['destroy']({'where':{'type':_0x352b3a,'resourceId':_0x2bcf37['id']}})[_0x9481('0x22')](function(){return _0x215dd7;});})[_0x9481('0x22')](function(){_0xb5cd2c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b0c3,_0x299e28){return function(_0x550fce){if(!_0x550fce){_0x12b0c3[_0x9481('0x27')](0x194);}return _0x550fce;};}function handleError(_0x20ff9a,_0xeff0a5){_0xeff0a5=_0xeff0a5||0x1f4;return function(_0x28ae1b){logger['error'](_0x28ae1b[_0x9481('0x28')]);if(_0x28ae1b[_0x9481('0x29')]){delete _0x28ae1b[_0x9481('0x29')];}_0x20ff9a['status'](_0xeff0a5)[_0x9481('0x2a')](_0x28ae1b);};}exports['index']=function(_0x2e1eff,_0xe153ab){var _0x22ab26={},_0x13ef93={},_0x2e5e63={'count':0x0,'rows':[]};var _0x53560d=db[_0x9481('0x2b')][_0x9481('0x2c')];_0x13ef93[_0x9481('0x2d')]=_['keys'](_0x53560d);_0x13ef93['query']=_[_0x9481('0x2e')](_0x2e1eff[_0x9481('0x2f')]);_0x13ef93[_0x9481('0x30')]=_[_0x9481('0x31')](_0x13ef93['model'],_0x13ef93['query']);_0x22ab26['attributes']=_[_0x9481('0x31')](_0x13ef93['model'],qs[_0x9481('0x32')](_0x2e1eff['query'][_0x9481('0x32')]));_0x22ab26[_0x9481('0x33')]=_0x22ab26[_0x9481('0x33')][_0x9481('0x34')]?_0x22ab26[_0x9481('0x33')]:_0x13ef93['model'];if(!_0x2e1eff[_0x9481('0x2f')][_0x9481('0x35')](_0x9481('0x36'))){_0x22ab26['limit']=qs[_0x9481('0x1c')](_0x2e1eff[_0x9481('0x2f')][_0x9481('0x1c')]);_0x22ab26[_0x9481('0x1b')]=qs[_0x9481('0x1b')](_0x2e1eff[_0x9481('0x2f')]['offset']);}_0x22ab26[_0x9481('0x37')]=qs['sort'](_0x2e1eff[_0x9481('0x2f')][_0x9481('0x38')]);_0x22ab26[_0x9481('0x39')]=qs[_0x9481('0x30')](_[_0x9481('0x3a')](_0x2e1eff[_0x9481('0x2f')],_0x13ef93['filters']));if(_0x2e1eff[_0x9481('0x2f')][_0x9481('0x3b')]){_0x22ab26['where']=_['merge'](_0x22ab26[_0x9481('0x39')],{'$or':_['map'](_0x53560d,function(_0x224b88){if(_0x224b88[_0x9481('0x3c')][_0x9481('0x3d')]!==_0x9481('0x3e')){var _0x50667a={};_0x50667a[_0x224b88[_0x9481('0x3f')]]={'$like':'%'+_0x2e1eff['query'][_0x9481('0x3b')]+'%'};return _0x50667a;}})});}_0x22ab26=_['merge']({},_0x22ab26,_0x2e1eff[_0x9481('0x40')]);var _0x4d6a13={'where':_0x22ab26[_0x9481('0x39')]};return db[_0x9481('0x2b')][_0x9481('0x1a')](_0x4d6a13)[_0x9481('0x22')](function(_0x97dc3e){_0x2e5e63[_0x9481('0x1a')]=_0x97dc3e;if(_0x2e1eff[_0x9481('0x2f')]['includeAll']){_0x22ab26[_0x9481('0x41')]=[{'all':!![]}];}return db[_0x9481('0x2b')][_0x9481('0x42')](_0x22ab26);})[_0x9481('0x22')](function(_0x3f1b6f){_0x2e5e63[_0x9481('0x43')]=_0x3f1b6f;return _0x2e5e63;})[_0x9481('0x22')](respondWithFilteredResult(_0xe153ab,_0x22ab26))['catch'](handleError(_0xe153ab,null));};exports[_0x9481('0x44')]=function(_0x1872ff,_0x4b6fe0){var _0x704e81={'raw':!![],'where':{'id':_0x1872ff[_0x9481('0x45')]['id']}},_0x1a699e={};_0x1a699e[_0x9481('0x2d')]=_[_0x9481('0x2e')](db['Sound'][_0x9481('0x2c')]);_0x1a699e['query']=_[_0x9481('0x2e')](_0x1872ff[_0x9481('0x2f')]);_0x1a699e['filters']=_['intersection'](_0x1a699e[_0x9481('0x2d')],_0x1a699e[_0x9481('0x2f')]);_0x704e81[_0x9481('0x33')]=_['intersection'](_0x1a699e[_0x9481('0x2d')],qs[_0x9481('0x32')](_0x1872ff['query']['fields']));_0x704e81[_0x9481('0x33')]=_0x704e81['attributes'][_0x9481('0x34')]?_0x704e81[_0x9481('0x33')]:_0x1a699e[_0x9481('0x2d')];if(_0x1872ff[_0x9481('0x2f')][_0x9481('0x46')]){_0x704e81['include']=[{'all':!![]}];}_0x704e81=_[_0x9481('0x47')]({},_0x704e81,_0x1872ff[_0x9481('0x40')]);return db['Sound'][_0x9481('0x48')](_0x704e81)[_0x9481('0x22')](handleEntityNotFound(_0x4b6fe0,null))[_0x9481('0x22')](respondWithResult(_0x4b6fe0,null))[_0x9481('0x49')](handleError(_0x4b6fe0,null));};exports[_0x9481('0x4a')]=function(_0x3929a8,_0x3a1bee,_0x2b8b00){return db[_0x9481('0x2b')]['find']({'where':{'id':_0x3929a8[_0x9481('0x45')]['id']},'attributes':['name','save_name',_0x9481('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x3a1bee,null))[_0x9481('0x22')](function(_0xd02fd7){if(_0xd02fd7){if(!fs['existsSync'](path[_0x9481('0x4c')](config[_0x9481('0x4d')],_0x9481('0x4e'),_0xd02fd7[_0x9481('0x4f')]+'.'+_0xd02fd7[_0x9481('0x4b')]))){throw new db[(_0x9481('0x50'))]['ValidationError']('Sound\x20not\x20found');}return _0x3a1bee[_0x9481('0x4a')](path[_0x9481('0x4c')](config[_0x9481('0x4d')],_0x9481('0x4e'),util[_0x9481('0x51')](_0x9481('0x52'),_0xd02fd7[_0x9481('0x4f')],_0xd02fd7[_0x9481('0x4b')])),util['format'](_0x9481('0x52'),_0xd02fd7[_0x9481('0x29')],_0xd02fd7[_0x9481('0x4b')]));}return null;})[_0x9481('0x49')](handleError(_0x3a1bee,null));};exports[_0x9481('0x53')]=function(_0x5ee59e,_0x4c3048,_0x5d6424){var _0x3bd7df={'name':path[_0x9481('0x54')](_0x5ee59e['file']['originalname'],path['extname'](_0x5ee59e['file']['originalname'])),'save_name':path['basename'](_0x5ee59e['file'][_0x9481('0x55')],path[_0x9481('0x56')](_0x5ee59e['file'][_0x9481('0x55')])),'original_format':path['extname'](_0x5ee59e[_0x9481('0x57')][_0x9481('0x58')])[_0x9481('0x59')](0x1),'converted_format':_0x9481('0x5a')};var _0x1385fe=path[_0x9481('0x4c')](config[_0x9481('0x4d')],'server/files/sounds/original',_0x5ee59e[_0x9481('0x57')][_0x9481('0x55')]);var _0x4dc5cc=path[_0x9481('0x4c')](config[_0x9481('0x4d')],_0x9481('0x4e'),util[_0x9481('0x51')](_0x9481('0x52'),path['basename'](_0x5ee59e[_0x9481('0x57')][_0x9481('0x55')],path[_0x9481('0x56')](_0x5ee59e[_0x9481('0x57')][_0x9481('0x55')])),_0x3bd7df[_0x9481('0x4b')]));logger[_0x9481('0x5b')](_0x9481('0x5c'),_0x1385fe);logger[_0x9481('0x5b')]('Sound\x20upload\x20destination:\x20%s',_0x4dc5cc);try{fs['chmodSync'](_0x1385fe,parseInt('0777',0x8));var _0x3240df=sox[_0x9481('0x5d')](_0x1385fe,_0x4dc5cc,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3240df['on'](_0x9481('0x5e'),function(_0x45aede){fs[_0x9481('0x5f')](_0x1385fe);_0x4c3048[_0x9481('0x18')](0x1f4)[_0x9481('0x2a')](_0x45aede);});_0x3240df['on'](_0x9481('0x60'),function(_0x589b16){_0x3bd7df['original_duration']=isNaN(_0x589b16[_0x9481('0x61')])?null:_0x589b16[_0x9481('0x61')]*0x3e8;_0x3bd7df[_0x9481('0x62')]=isNaN(_0x589b16[_0x9481('0x63')])?null:_0x589b16[_0x9481('0x63')];_0x3bd7df[_0x9481('0x64')]=isNaN(_0x589b16['channelCount'])?null:_0x589b16['channelCount'];_0x3bd7df[_0x9481('0x65')]=isNaN(_0x589b16['bitRate'])?null:_0x589b16[_0x9481('0x66')];_0x3bd7df['original_sampleRate']=isNaN(_0x589b16[_0x9481('0x67')])?null:_0x589b16[_0x9481('0x67')];});_0x3240df['on'](_0x9481('0x68'),function(_0x492464){_0x3bd7df[_0x9481('0x69')]=isNaN(_0x492464[_0x9481('0x61')])?null:_0x492464['duration']*0x3e8;_0x3bd7df['converted_sampleCount']=isNaN(_0x492464['sampleCount'])?null:_0x492464['sampleCount'];_0x3bd7df[_0x9481('0x6a')]=isNaN(_0x492464['channelCount'])?null:_0x492464[_0x9481('0x6b')];_0x3bd7df[_0x9481('0x6c')]=isNaN(_0x492464[_0x9481('0x66')])?null:_0x492464['bitRate'];_0x3bd7df[_0x9481('0x6d')]=isNaN(_0x492464['sampleRate'])?null:_0x492464[_0x9481('0x67')];});_0x3240df['on'](_0x9481('0x17'),function(){fs[_0x9481('0x6e')](_0x4dc5cc,parseInt('0777',0x8));return db[_0x9481('0x2b')][_0x9481('0x53')](_0x3bd7df)['then'](function(_0x321972){var _0x1070e5={'role':_0x5ee59e[_0x9481('0x6f')][_0x9481('0x70')],'userProfileId':_0x5ee59e[_0x9481('0x6f')][_0x9481('0x71')]};if(!_0x1070e5)throw new Error(_0x9481('0x72'));if(_0x1070e5[_0x9481('0x70')]===_0x9481('0x73')){var _0x12abc6=_0x321972[_0x9481('0x24')]({'plain':!![]});return db[_0x9481('0x74')][_0x9481('0x48')]({'where':{'name':_0x9481('0x25'),'userProfileId':_0x1070e5[_0x9481('0x71')]},'raw':!![]})[_0x9481('0x22')](function(_0x2b2ad1){if(_0x2b2ad1&&_0x2b2ad1['autoAssociation']===0x0){return db[_0x9481('0x26')]['create']({'name':_0x12abc6['name'],'resourceId':_0x12abc6['id'],'type':_0x2b2ad1[_0x9481('0x29')],'sectionId':_0x2b2ad1['id']},{})['then'](function(){return _0x321972;});}else{return _0x321972;}})['catch'](function(_0x52b7af){logger[_0x9481('0x5e')](_0x9481('0x75'),_0x52b7af);throw _0x52b7af;});}return _0x321972;})[_0x9481('0x22')](respondWithResult(_0x4c3048,null))[_0x9481('0x49')](handleError(_0x4c3048,null));});_0x3240df['start']();}catch(_0xa83176){_0x4c3048[_0x9481('0x18')](0x1f4)[_0x9481('0x2a')](_0xa83176);}};exports[_0x9481('0x21')]=function(_0x54323e,_0x4b4e4c,_0x178373){return db[_0x9481('0x2b')][_0x9481('0x48')]({'where':{'id':_0x54323e[_0x9481('0x45')]['id']}})[_0x9481('0x22')](handleEntityNotFound(_0x4b4e4c,null))['then'](saveUpdates(_[_0x9481('0x3a')](_0x54323e[_0x9481('0x6f')],[_0x9481('0x29'),_0x9481('0x76')]),null))[_0x9481('0x22')](respondWithResult(_0x4b4e4c,null))[_0x9481('0x49')](handleError(_0x4b4e4c,null));};exports[_0x9481('0x77')]=function(_0x42a6d2,_0x14fbe2,_0x304570){return db[_0x9481('0x2b')][_0x9481('0x48')]({'where':{'id':_0x42a6d2[_0x9481('0x45')]['id']}})[_0x9481('0x22')](function(_0x2b5c90){if(_0x2b5c90){return _0x2b5c90['destroy']();}})[_0x9481('0x22')](function(_0x10c298){var _0x3f51c5=path[_0x9481('0x4c')](config[_0x9481('0x4d')],_0x9481('0x78'),util[_0x9481('0x51')]('%s.%s',_0x10c298[_0x9481('0x4f')],_0x10c298[_0x9481('0x79')]));var _0x4e7d5a=path['join'](config[_0x9481('0x4d')],'server/files/sounds/converted',util['format'](_0x9481('0x52'),_0x10c298['save_name'],_0x10c298[_0x9481('0x4b')]));fs[_0x9481('0x5f')](_0x3f51c5);fs[_0x9481('0x5f')](_0x4e7d5a);return _0x10c298;})[_0x9481('0x22')](function(_0x47b767){if(_0x47b767){return _0x14fbe2[_0x9481('0x18')](0xcc)['end']();}})[_0x9481('0x22')](handleEntityNotFound(_0x14fbe2,null))[_0x9481('0x49')](handleError(_0x14fbe2,null));}; \ No newline at end of file +var _0x4888=['%s.%s','create','basename','file','originalname','extname','substring','wav','filename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','src','original_duration','duration','original_sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','body','userProfileId','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','params','pick','description','server/files/sounds/original','unlinkSync','end','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','offset','limit','status','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','name','send','index','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','field','options','Sound','count','include','findAll','rows','show','rawAttributes','includeAll','catch','download','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','format'];(function(_0x1bea14,_0xcd49c3){var _0xe4a504=function(_0x1cdfc5){while(--_0x1cdfc5){_0x1bea14['push'](_0x1bea14['shift']());}};_0xe4a504(++_0xcd49c3);}(_0x4888,0x198));var _0x8488=function(_0x350a01,_0x5ed763){_0x350a01=_0x350a01-0x0;var _0xc17c6b=_0x4888[_0x350a01];return _0xc17c6b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8488('0x0'));var rimraf=require(_0x8488('0x1'));var zipdir=require(_0x8488('0x2'));var jsonpatch=require(_0x8488('0x3'));var rp=require(_0x8488('0x4'));var moment=require(_0x8488('0x5'));var BPromise=require(_0x8488('0x6'));var Mustache=require('mustache');var util=require(_0x8488('0x7'));var path=require(_0x8488('0x8'));var sox=require(_0x8488('0x9'));var csv=require(_0x8488('0xa'));var ejs=require(_0x8488('0xb'));var fs=require('fs');var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0xa'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var authService=require(_0x8488('0xe'));var hardwareService=require(_0x8488('0xf'));var Redis=require(_0x8488('0x10'));var qs=require(_0x8488('0x11'));var logger=require('../../config/logger')(_0x8488('0x12'));var utils=require(_0x8488('0x13'));var config=require(_0x8488('0x14'));var db=require(_0x8488('0x15'))['db'];function respondWithStatusCode(_0x47146a,_0x50ea94){_0x50ea94=_0x50ea94||0xcc;return function(_0x14462e){if(_0x14462e){return _0x47146a[_0x8488('0x16')](_0x50ea94);}return _0x47146a['status'](_0x50ea94)['end']();};}function respondWithResult(_0x150b52,_0x496dd1){_0x496dd1=_0x496dd1||0xc8;return function(_0x214083){if(_0x214083){return _0x150b52['status'](_0x496dd1)['json'](_0x214083);}};}function respondWithFilteredResult(_0x24d0a0,_0x3635da){return function(_0x5700b){if(_0x5700b){var _0x2bcb7c=_0x5700b['count'],_0x3b3cfa=_0x3635da[_0x8488('0x17')],_0x8d3b3d=_0x3635da[_0x8488('0x17')]+_0x3635da[_0x8488('0x18')],_0x165139;if(_0x8d3b3d>=_0x2bcb7c){_0x8d3b3d=_0x2bcb7c;_0x165139=0xc8;}else{_0x165139=0xce;}_0x24d0a0[_0x8488('0x19')](_0x165139);return _0x24d0a0[_0x8488('0x1a')](_0x8488('0x1b'),_0x3b3cfa+'-'+_0x8d3b3d+'/'+_0x2bcb7c)[_0x8488('0x1c')](_0x5700b);}return null;};}function patchUpdates(_0x27c62a){return function(_0x514c31){try{jsonpatch[_0x8488('0x1d')](_0x514c31,_0x27c62a,!![]);}catch(_0x10bfd6){return BPromise[_0x8488('0x1e')](_0x10bfd6);}return _0x514c31[_0x8488('0x1f')]();};}function saveUpdates(_0x554ec6,_0x4a1b45){return function(_0x340d6b){if(_0x340d6b){return _0x340d6b[_0x8488('0x20')](_0x554ec6)[_0x8488('0x21')](function(_0x3c9fc2){return _0x3c9fc2;});}return null;};}function removeEntity(_0x892236,_0x1bef99){return function(_0x43b672){if(_0x43b672){return _0x43b672[_0x8488('0x22')]()[_0x8488('0x21')](function(){var _0x5123d0=_0x43b672[_0x8488('0x23')]({'plain':!![]});var _0x4e07e1=_0x8488('0x24');return db[_0x8488('0x25')][_0x8488('0x22')]({'where':{'type':_0x4e07e1,'resourceId':_0x5123d0['id']}})['then'](function(){return _0x43b672;});})['then'](function(){_0x892236['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x16')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x26')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x27')]){delete _0x6ebee0[_0x8488('0x27')];}_0x2f350a[_0x8488('0x19')](_0x2b3c97)[_0x8488('0x28')](_0x6ebee0);};}exports[_0x8488('0x29')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=db['Sound']['rawAttributes'];_0x368f9c['model']=_[_0x8488('0x2a')](_0x888b24);_0x368f9c[_0x8488('0x2b')]=_[_0x8488('0x2a')](_0x27f5cf[_0x8488('0x2b')]);_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2b')]);_0x296b6c[_0x8488('0x2e')]=_[_0x8488('0x2d')](_0x368f9c[_0x8488('0x2f')],qs[_0x8488('0x30')](_0x27f5cf['query'][_0x8488('0x30')]));_0x296b6c[_0x8488('0x2e')]=_0x296b6c['attributes'][_0x8488('0x31')]?_0x296b6c[_0x8488('0x2e')]:_0x368f9c[_0x8488('0x2f')];if(!_0x27f5cf[_0x8488('0x2b')][_0x8488('0x32')]('nolimit')){_0x296b6c[_0x8488('0x18')]=qs[_0x8488('0x18')](_0x27f5cf[_0x8488('0x2b')]['limit']);_0x296b6c[_0x8488('0x17')]=qs['offset'](_0x27f5cf[_0x8488('0x2b')][_0x8488('0x17')]);}_0x296b6c[_0x8488('0x33')]=qs[_0x8488('0x34')](_0x27f5cf['query'][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2c')](_['pick'](_0x27f5cf[_0x8488('0x2b')],_0x368f9c[_0x8488('0x2c')]));if(_0x27f5cf[_0x8488('0x2b')][_0x8488('0x36')]){_0x296b6c[_0x8488('0x35')]=_[_0x8488('0x37')](_0x296b6c[_0x8488('0x35')],{'$or':_[_0x8488('0x38')](_0x888b24,function(_0x1a8235){if(_0x1a8235[_0x8488('0x39')][_0x8488('0x3a')]!=='VIRTUAL'){var _0x55a279={};_0x55a279[_0x1a8235[_0x8488('0x3b')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2b')][_0x8488('0x36')]+'%'};return _0x55a279;}})});}_0x296b6c=_[_0x8488('0x37')]({},_0x296b6c,_0x27f5cf[_0x8488('0x3c')]);var _0x910460={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3d')][_0x8488('0x3e')](_0x910460)['then'](function(_0xf5a0a0){_0x1d9317[_0x8488('0x3e')]=_0xf5a0a0;if(_0x27f5cf[_0x8488('0x2b')]['includeAll']){_0x296b6c[_0x8488('0x3f')]=[{'all':!![]}];}return db[_0x8488('0x3d')][_0x8488('0x40')](_0x296b6c);})[_0x8488('0x21')](function(_0x44d5f2){_0x1d9317[_0x8488('0x41')]=_0x44d5f2;return _0x1d9317;})[_0x8488('0x21')](respondWithFilteredResult(_0x2c15ff,_0x296b6c))['catch'](handleError(_0x2c15ff,null));};exports[_0x8488('0x42')]=function(_0x1c33a1,_0x891cff){var _0x4fdb23={'raw':!![],'where':{'id':_0x1c33a1['params']['id']}},_0x3649ae={};_0x3649ae[_0x8488('0x2f')]=_[_0x8488('0x2a')](db['Sound'][_0x8488('0x43')]);_0x3649ae[_0x8488('0x2b')]=_[_0x8488('0x2a')](_0x1c33a1[_0x8488('0x2b')]);_0x3649ae[_0x8488('0x2c')]=_['intersection'](_0x3649ae[_0x8488('0x2f')],_0x3649ae['query']);_0x4fdb23[_0x8488('0x2e')]=_[_0x8488('0x2d')](_0x3649ae[_0x8488('0x2f')],qs[_0x8488('0x30')](_0x1c33a1[_0x8488('0x2b')][_0x8488('0x30')]));_0x4fdb23[_0x8488('0x2e')]=_0x4fdb23[_0x8488('0x2e')][_0x8488('0x31')]?_0x4fdb23[_0x8488('0x2e')]:_0x3649ae[_0x8488('0x2f')];if(_0x1c33a1[_0x8488('0x2b')][_0x8488('0x44')]){_0x4fdb23[_0x8488('0x3f')]=[{'all':!![]}];}_0x4fdb23=_[_0x8488('0x37')]({},_0x4fdb23,_0x1c33a1[_0x8488('0x3c')]);return db[_0x8488('0x3d')]['find'](_0x4fdb23)[_0x8488('0x21')](handleEntityNotFound(_0x891cff,null))[_0x8488('0x21')](respondWithResult(_0x891cff,null))[_0x8488('0x45')](handleError(_0x891cff,null));};exports[_0x8488('0x46')]=function(_0x5067fa,_0x44e74f,_0x1cd80d){return db[_0x8488('0x3d')][_0x8488('0x47')]({'where':{'id':_0x5067fa['params']['id']},'attributes':[_0x8488('0x27'),_0x8488('0x48'),_0x8488('0x49')],'raw':!![]})[_0x8488('0x21')](handleEntityNotFound(_0x44e74f,null))[_0x8488('0x21')](function(_0x1157db){if(_0x1157db){if(!fs[_0x8488('0x4a')](path[_0x8488('0x4b')](config[_0x8488('0x4c')],_0x8488('0x4d'),_0x1157db[_0x8488('0x48')]+'.'+_0x1157db[_0x8488('0x49')]))){throw new db[(_0x8488('0x4e'))]['ValidationError']('Sound\x20not\x20found');}return _0x44e74f[_0x8488('0x46')](path[_0x8488('0x4b')](config[_0x8488('0x4c')],_0x8488('0x4d'),util[_0x8488('0x4f')](_0x8488('0x50'),_0x1157db[_0x8488('0x48')],_0x1157db[_0x8488('0x49')])),util[_0x8488('0x4f')]('%s.%s',_0x1157db[_0x8488('0x27')],_0x1157db[_0x8488('0x49')]));}return null;})['catch'](handleError(_0x44e74f,null));};exports[_0x8488('0x51')]=function(_0x313e00,_0x186747,_0x1ff9c5){var _0x4f80fb={'name':path[_0x8488('0x52')](_0x313e00[_0x8488('0x53')][_0x8488('0x54')],path['extname'](_0x313e00[_0x8488('0x53')][_0x8488('0x54')])),'save_name':path[_0x8488('0x52')](_0x313e00[_0x8488('0x53')]['filename'],path[_0x8488('0x55')](_0x313e00['file']['filename'])),'original_format':path[_0x8488('0x55')](_0x313e00['file'][_0x8488('0x54')])[_0x8488('0x56')](0x1),'converted_format':_0x8488('0x57')};var _0x85eb4d=path[_0x8488('0x4b')](config[_0x8488('0x4c')],'server/files/sounds/original',_0x313e00[_0x8488('0x53')][_0x8488('0x58')]);var _0x21765b=path[_0x8488('0x4b')](config[_0x8488('0x4c')],'server/files/sounds/converted',util[_0x8488('0x4f')]('%s.%s',path[_0x8488('0x52')](_0x313e00[_0x8488('0x53')]['filename'],path[_0x8488('0x55')](_0x313e00[_0x8488('0x53')][_0x8488('0x58')])),_0x4f80fb[_0x8488('0x49')]));logger[_0x8488('0x59')](_0x8488('0x5a'),_0x85eb4d);logger['info'](_0x8488('0x5b'),_0x21765b);try{fs['chmodSync'](_0x85eb4d,parseInt(_0x8488('0x5c'),0x8));var _0x3fa6e2=sox[_0x8488('0x5d')](_0x85eb4d,_0x21765b,{'sampleRate':0x1f40,'format':_0x8488('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3fa6e2['on'](_0x8488('0x26'),function(_0x2725bf){fs['unlinkSync'](_0x85eb4d);_0x186747[_0x8488('0x19')](0x1f4)['send'](_0x2725bf);});_0x3fa6e2['on'](_0x8488('0x5e'),function(_0x24b8d3){_0x4f80fb[_0x8488('0x5f')]=isNaN(_0x24b8d3[_0x8488('0x60')])?null:_0x24b8d3[_0x8488('0x60')]*0x3e8;_0x4f80fb[_0x8488('0x61')]=isNaN(_0x24b8d3['sampleCount'])?null:_0x24b8d3['sampleCount'];_0x4f80fb['original_channelCount']=isNaN(_0x24b8d3[_0x8488('0x62')])?null:_0x24b8d3[_0x8488('0x62')];_0x4f80fb[_0x8488('0x63')]=isNaN(_0x24b8d3[_0x8488('0x64')])?null:_0x24b8d3[_0x8488('0x64')];_0x4f80fb[_0x8488('0x65')]=isNaN(_0x24b8d3[_0x8488('0x66')])?null:_0x24b8d3[_0x8488('0x66')];});_0x3fa6e2['on'](_0x8488('0x67'),function(_0xa90a65){_0x4f80fb['converted_duration']=isNaN(_0xa90a65[_0x8488('0x60')])?null:_0xa90a65[_0x8488('0x60')]*0x3e8;_0x4f80fb[_0x8488('0x68')]=isNaN(_0xa90a65['sampleCount'])?null:_0xa90a65['sampleCount'];_0x4f80fb[_0x8488('0x69')]=isNaN(_0xa90a65[_0x8488('0x62')])?null:_0xa90a65[_0x8488('0x62')];_0x4f80fb[_0x8488('0x6a')]=isNaN(_0xa90a65['bitRate'])?null:_0xa90a65['bitRate'];_0x4f80fb[_0x8488('0x6b')]=isNaN(_0xa90a65[_0x8488('0x66')])?null:_0xa90a65[_0x8488('0x66')];});_0x3fa6e2['on']('end',function(){fs[_0x8488('0x6c')](_0x21765b,parseInt(_0x8488('0x5c'),0x8));return db[_0x8488('0x3d')][_0x8488('0x51')](_0x4f80fb)[_0x8488('0x21')](function(_0x5e41e5){var _0x37ceeb={'role':_0x313e00[_0x8488('0x6d')]['role'],'userProfileId':_0x313e00[_0x8488('0x6d')][_0x8488('0x6e')]};if(!_0x37ceeb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37ceeb[_0x8488('0x6f')]===_0x8488('0x70')){var _0x212c3b=_0x5e41e5[_0x8488('0x23')]({'plain':!![]});return db[_0x8488('0x71')][_0x8488('0x47')]({'where':{'name':_0x8488('0x24'),'userProfileId':_0x37ceeb['userProfileId']},'raw':!![]})[_0x8488('0x21')](function(_0x3b7aa8){if(_0x3b7aa8&&_0x3b7aa8['autoAssociation']===0x0){return db['UserProfileResource'][_0x8488('0x51')]({'name':_0x212c3b[_0x8488('0x27')],'resourceId':_0x212c3b['id'],'type':_0x3b7aa8[_0x8488('0x27')],'sectionId':_0x3b7aa8['id']},{})['then'](function(){return _0x5e41e5;});}else{return _0x5e41e5;}})[_0x8488('0x45')](function(_0x852e08){logger['error'](_0x8488('0x72'),_0x852e08);throw _0x852e08;});}return _0x5e41e5;})['then'](respondWithResult(_0x186747,null))[_0x8488('0x45')](handleError(_0x186747,null));});_0x3fa6e2[_0x8488('0x73')]();}catch(_0x44a50b){_0x186747['status'](0x1f4)[_0x8488('0x28')](_0x44a50b);}};exports[_0x8488('0x20')]=function(_0x57955d,_0x4b48ad,_0xe3a51d){return db[_0x8488('0x3d')][_0x8488('0x47')]({'where':{'id':_0x57955d[_0x8488('0x74')]['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x4b48ad,null))[_0x8488('0x21')](saveUpdates(_[_0x8488('0x75')](_0x57955d[_0x8488('0x6d')],[_0x8488('0x27'),_0x8488('0x76')]),null))['then'](respondWithResult(_0x4b48ad,null))[_0x8488('0x45')](handleError(_0x4b48ad,null));};exports['delete']=function(_0x3dff4f,_0x250e9c,_0xa8c980){return db[_0x8488('0x3d')]['find']({'where':{'id':_0x3dff4f[_0x8488('0x74')]['id']}})[_0x8488('0x21')](function(_0x5a48d4){if(_0x5a48d4){return _0x5a48d4[_0x8488('0x22')]();}})['then'](function(_0x26241b){var _0x15b919=path[_0x8488('0x4b')](config[_0x8488('0x4c')],_0x8488('0x77'),util[_0x8488('0x4f')](_0x8488('0x50'),_0x26241b[_0x8488('0x48')],_0x26241b['original_format']));var _0x1ce726=path['join'](config['root'],_0x8488('0x4d'),util[_0x8488('0x4f')](_0x8488('0x50'),_0x26241b['save_name'],_0x26241b['converted_format']));fs[_0x8488('0x78')](_0x15b919);fs[_0x8488('0x78')](_0x1ce726);return _0x26241b;})['then'](function(_0x1acaf7){if(_0x1acaf7){return _0x250e9c[_0x8488('0x19')](0xcc)[_0x8488('0x79')]();}})[_0x8488('0x21')](handleEntityNotFound(_0x250e9c,null))[_0x8488('0x45')](handleError(_0x250e9c,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index b5936fe..92715fa 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 _0x6065=['Sound','tools_sounds','util','../../config/logger','moment','request-promise','./sound.attributes','exports'];(function(_0x4d3272,_0x494ec9){var _0x254122=function(_0x31a82e){while(--_0x31a82e){_0x4d3272['push'](_0x4d3272['shift']());}};_0x254122(++_0x494ec9);}(_0x6065,0x1da));var _0x5606=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0x6065[_0xcfc44];return _0x307a25;};'use strict';var _=require('lodash');var util=require(_0x5606('0x0'));var logger=require(_0x5606('0x1'))('api');var moment=require(_0x5606('0x2'));var BPromise=require('bluebird');var rp=require(_0x5606('0x3'));var attributes=require(_0x5606('0x4'));module[_0x5606('0x5')]=function(_0x3ace23,_0xc59130){return _0x3ace23['define'](_0x5606('0x6'),attributes,{'tableName':_0x5606('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25dd=['bluebird','request-promise','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','api'];(function(_0x58f089,_0x25e87e){var _0xca6c91=function(_0xbc0265){while(--_0xbc0265){_0x58f089['push'](_0x58f089['shift']());}};_0xca6c91(++_0x25e87e);}(_0x25dd,0x75));var _0xd25d=function(_0x8142c5,_0x3656a6){_0x8142c5=_0x8142c5-0x0;var _0x324e4c=_0x25dd[_0x8142c5];return _0x324e4c;};'use strict';var _=require(_0xd25d('0x0'));var util=require(_0xd25d('0x1'));var logger=require(_0xd25d('0x2'))(_0xd25d('0x3'));var moment=require('moment');var BPromise=require(_0xd25d('0x4'));var rp=require(_0xd25d('0x5'));var attributes=require(_0xd25d('0x6'));module[_0xd25d('0x7')]=function(_0x2bd9cb,_0x1ee89a){return _0x2bd9cb[_0xd25d('0x8')](_0xd25d('0x9'),attributes,{'tableName':_0xd25d('0xa'),'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 873a2c4..87dd817 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 _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x578a67,_0x231790){var _0x7c140=function(_0x1ec3c2){while(--_0x1ec3c2){_0x578a67['push'](_0x578a67['shift']());}};_0x7c140(++_0x231790);}(_0xb10b,0x12a));var _0xbb10=function(_0x124c75,_0x332013){_0x124c75=_0x124c75-0x0;var _0x5c5471=_0xb10b[_0x124c75];return _0x5c5471;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xa9e0=['then','stringify','ShowSound','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Sound','find','options','raw','where','attributes','include','model','map'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['ShowSound']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['include']?_['map'](_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')],function(_0x38e7c4){return{'model':db[_0x38e7c4[_0x0a9e('0x1b')]],'as':_0x38e7c4['as'],'attributes':_0x38e7c4['attributes'],'include':_0x38e7c4[_0x0a9e('0x1a')]?_[_0x0a9e('0x1c')](_0x38e7c4[_0x0a9e('0x1a')],function(_0x4d00e6){return{'model':db[_0x4d00e6[_0x0a9e('0x1b')]],'as':_0x4d00e6['as'],'attributes':_0x4d00e6[_0x0a9e('0x19')],'include':_0x4d00e6[_0x0a9e('0x1a')]?_['map'](_0x4d00e6['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x1b')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x1d')](function(_0x526cf3){logger[_0x0a9e('0xa')]('ShowSound',_0x459eb1);logger[_0x0a9e('0xd')]('ShowSound',_0x459eb1,JSON[_0x0a9e('0x1e')](_0x526cf3));_0x106033(_0x526cf3);})[_0x0a9e('0x13')](function(_0x25fba9){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x25fba9[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x25fba9[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index d94bedb..00fd26c 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 _0x13f6=['delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','create','put','/:id','update'];(function(_0x7461f4,_0x3697fd){var _0x547e13=function(_0x2b6b55){while(--_0x2b6b55){_0x7461f4['push'](_0x7461f4['shift']());}};_0x547e13(++_0x3697fd);}(_0x13f6,0x124));var _0x613f=function(_0x50f857,_0x3a49d1){_0x50f857=_0x50f857-0x0;var _0x105edb=_0x13f6[_0x50f857];return _0x105edb;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var auth=require(_0x613f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x613f('0x5'));var controller=require(_0x613f('0x6'));router[_0x613f('0x7')]('/',auth['isAuthenticated'](),controller[_0x613f('0x8')]);router[_0x613f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x613f('0x9')](),controller[_0x613f('0xa')]);router[_0x613f('0xb')](_0x613f('0xc'),auth['isAuthenticated'](),controller[_0x613f('0xd')]);router[_0x613f('0xe')](_0x613f('0xc'),auth['isAuthenticated'](),controller[_0x613f('0xf')]);module[_0x613f('0x10')]=router; \ No newline at end of file +var _0xf925=['exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','put','update','destroy'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0xf925,0xb7));var _0x5f92=function(_0x308de4,_0x55b6e2){_0x308de4=_0x308de4-0x0;var _0x5e569f=_0xf925[_0x308de4];return _0x5e569f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5f92('0x0'));var express=require(_0x5f92('0x1'));var router=express[_0x5f92('0x2')]();var auth=require(_0x5f92('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5f92('0x4'));var controller=require(_0x5f92('0x5'));router[_0x5f92('0x6')]('/',auth[_0x5f92('0x7')](),controller[_0x5f92('0x8')]);router[_0x5f92('0x6')](_0x5f92('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5f92('0x7')](),controller['create']);router[_0x5f92('0xa')](_0x5f92('0x9'),auth['isAuthenticated'](),controller[_0x5f92('0xb')]);router['delete'](_0x5f92('0x9'),auth[_0x5f92('0x7')](),controller[_0x5f92('0xc')]);module[_0x5f92('0xd')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index c57f10e..f12b1b3 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 _0x2f44=['medium','ENUM','out','sequelize','exports','STRING'];(function(_0x263520,_0x271c36){var _0x4b27a1=function(_0x14c025){while(--_0x14c025){_0x263520['push'](_0x263520['shift']());}};_0x4b27a1(++_0x271c36);}(_0x2f44,0x177));var _0x42f4=function(_0x146915,_0x32dda1){_0x146915=_0x146915-0x0;var _0x1a463a=_0x2f44[_0x146915];return _0x1a463a;};'use strict';var Sequelize=require(_0x42f4('0x0'));module[_0x42f4('0x1')]={'uniqueid':{'type':Sequelize[_0x42f4('0x2')]},'body':{'type':Sequelize['TEXT'](_0x42f4('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x42f4('0x4')]('in',_0x42f4('0x5')),'defaultValue':_0x42f4('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x52bc=['STRING','TEXT','ENUM','out','sequelize'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x52bc,0x1c6));var _0xc52b=function(_0x533153,_0xd5931){_0x533153=_0x533153-0x0;var _0x29fae2=_0x52bc[_0x533153];return _0x29fae2;};'use strict';var Sequelize=require(_0xc52b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc52b('0x1')]},'body':{'type':Sequelize[_0xc52b('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xc52b('0x3')]('in',_0xc52b('0x4')),'defaultValue':_0xc52b('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 2559dfa..f93aba3 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 _0xc1c6=['to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','SquareMessage','rawAttributes','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','key','field','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path'];(function(_0x2b266e,_0x4efb0f){var _0x39b25b=function(_0x320a1b){while(--_0x320a1b){_0x2b266e['push'](_0x2b266e['shift']());}};_0x39b25b(++_0x4efb0f);}(_0xc1c6,0xca));var _0x6c1c=function(_0x362745,_0x4e608e){_0x362745=_0x362745-0x0;var _0x5c8e19=_0xc1c6[_0x362745];return _0x5c8e19;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require(_0x6c1c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require(_0x6c1c('0x7'));var sox=require('sox');var csv=require(_0x6c1c('0x8'));var ejs=require(_0x6c1c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6c1c('0xa'));var crypto=require(_0x6c1c('0xb'));var jsforce=require(_0x6c1c('0xc'));var deskjs=require(_0x6c1c('0xd'));var toCsv=require(_0x6c1c('0x8'));var querystring=require(_0x6c1c('0xe'));var Papa=require(_0x6c1c('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x6c1c('0x10'));var Redis=require(_0x6c1c('0x11'));var qs=require(_0x6c1c('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6c1c('0x13'));var config=require(_0x6c1c('0x14'));var db=require(_0x6c1c('0x15'))['db'];function respondWithStatusCode(_0x4f8c1d,_0x3c81c5){_0x3c81c5=_0x3c81c5||0xcc;return function(_0x46f532){if(_0x46f532){return _0x4f8c1d[_0x6c1c('0x16')](_0x3c81c5);}return _0x4f8c1d[_0x6c1c('0x17')](_0x3c81c5)[_0x6c1c('0x18')]();};}function respondWithResult(_0x49cef5,_0x5174d8){_0x5174d8=_0x5174d8||0xc8;return function(_0x51eb4d){if(_0x51eb4d){return _0x49cef5[_0x6c1c('0x17')](_0x5174d8)[_0x6c1c('0x19')](_0x51eb4d);}};}function respondWithFilteredResult(_0x470271,_0x41a76d){return function(_0x312529){if(_0x312529){var _0xc1add5=_0x312529[_0x6c1c('0x1a')],_0x8ffd0e=_0x41a76d[_0x6c1c('0x1b')],_0x45c972=_0x41a76d[_0x6c1c('0x1b')]+_0x41a76d[_0x6c1c('0x1c')],_0x5bec73;if(_0x45c972>=_0xc1add5){_0x45c972=_0xc1add5;_0x5bec73=0xc8;}else{_0x5bec73=0xce;}_0x470271[_0x6c1c('0x17')](_0x5bec73);return _0x470271[_0x6c1c('0x1d')](_0x6c1c('0x1e'),_0x8ffd0e+'-'+_0x45c972+'/'+_0xc1add5)['json'](_0x312529);}return null;};}function patchUpdates(_0x37968d){return function(_0xba4b96){try{jsonpatch[_0x6c1c('0x1f')](_0xba4b96,_0x37968d,!![]);}catch(_0x11c8fe){return BPromise[_0x6c1c('0x20')](_0x11c8fe);}return _0xba4b96[_0x6c1c('0x21')]();};}function saveUpdates(_0x260597,_0x4c3839){return function(_0x2b51c9){if(_0x2b51c9){return _0x2b51c9[_0x6c1c('0x22')](_0x260597)[_0x6c1c('0x23')](function(_0x3c1dda){return _0x3c1dda;});}return null;};}function removeEntity(_0x5e7ae5,_0x24d68c){return function(_0x51887e){if(_0x51887e){return _0x51887e[_0x6c1c('0x24')]()['then'](function(){_0x5e7ae5[_0x6c1c('0x17')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x23a96a,_0x14d9ab){return function(_0xf6bfe3){if(!_0xf6bfe3){_0x23a96a[_0x6c1c('0x16')](0x194);}return _0xf6bfe3;};}function handleError(_0x4dd5ad,_0x510134){_0x510134=_0x510134||0x1f4;return function(_0x31e141){logger['error'](_0x31e141[_0x6c1c('0x25')]);if(_0x31e141[_0x6c1c('0x26')]){delete _0x31e141[_0x6c1c('0x26')];}_0x4dd5ad['status'](_0x510134)['send'](_0x31e141);};}exports[_0x6c1c('0x27')]=function(_0x361b26,_0x1c5e2b){var _0x5550d7={},_0x24d6b5={},_0x176a50={'count':0x0,'rows':[]};var _0x48db6d=db[_0x6c1c('0x28')][_0x6c1c('0x29')];_0x24d6b5[_0x6c1c('0x2a')]=_['keys'](_0x48db6d);_0x24d6b5['query']=_[_0x6c1c('0x2b')](_0x361b26[_0x6c1c('0x2c')]);_0x24d6b5[_0x6c1c('0x2d')]=_['intersection'](_0x24d6b5['model'],_0x24d6b5[_0x6c1c('0x2c')]);_0x5550d7[_0x6c1c('0x2e')]=_[_0x6c1c('0x2f')](_0x24d6b5[_0x6c1c('0x2a')],qs['fields'](_0x361b26['query']['fields']));_0x5550d7[_0x6c1c('0x2e')]=_0x5550d7['attributes'][_0x6c1c('0x30')]?_0x5550d7[_0x6c1c('0x2e')]:_0x24d6b5[_0x6c1c('0x2a')];if(!_0x361b26[_0x6c1c('0x2c')][_0x6c1c('0x31')]('nolimit')){_0x5550d7[_0x6c1c('0x1c')]=qs['limit'](_0x361b26[_0x6c1c('0x2c')][_0x6c1c('0x1c')]);_0x5550d7[_0x6c1c('0x1b')]=qs['offset'](_0x361b26[_0x6c1c('0x2c')]['offset']);}_0x5550d7[_0x6c1c('0x32')]=qs['sort'](_0x361b26[_0x6c1c('0x2c')][_0x6c1c('0x33')]);_0x5550d7['where']=qs[_0x6c1c('0x2d')](_[_0x6c1c('0x34')](_0x361b26[_0x6c1c('0x2c')],_0x24d6b5[_0x6c1c('0x2d')]));if(_0x361b26[_0x6c1c('0x2c')][_0x6c1c('0x35')]){_0x5550d7[_0x6c1c('0x36')]=_[_0x6c1c('0x37')](_0x5550d7[_0x6c1c('0x36')],{'$or':_[_0x6c1c('0x38')](_0x48db6d,function(_0x326ddc){if(_0x326ddc[_0x6c1c('0x39')][_0x6c1c('0x3a')]!=='VIRTUAL'){var _0x1b79bc={};_0x1b79bc[_0x326ddc[_0x6c1c('0x3b')]]={'$like':'%'+_0x361b26[_0x6c1c('0x2c')][_0x6c1c('0x35')]+'%'};return _0x1b79bc;}})});}_0x5550d7=_[_0x6c1c('0x37')]({},_0x5550d7,_0x361b26[_0x6c1c('0x3c')]);var _0x1492e2={'where':_0x5550d7[_0x6c1c('0x36')]};return db['SquareMessage'][_0x6c1c('0x1a')](_0x1492e2)[_0x6c1c('0x23')](function(_0x405d88){_0x176a50['count']=_0x405d88;if(_0x361b26[_0x6c1c('0x2c')][_0x6c1c('0x3d')]){_0x5550d7[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x5550d7);})[_0x6c1c('0x23')](function(_0x342a41){_0x176a50[_0x6c1c('0x3f')]=_0x342a41;return _0x176a50;})[_0x6c1c('0x23')](respondWithFilteredResult(_0x1c5e2b,_0x5550d7))[_0x6c1c('0x40')](handleError(_0x1c5e2b,null));};exports[_0x6c1c('0x41')]=function(_0x46f948,_0x4b923d){var _0x687b92={'raw':!![],'where':{'id':_0x46f948[_0x6c1c('0x42')]['id']}},_0x29c2f3={};_0x29c2f3[_0x6c1c('0x2a')]=_[_0x6c1c('0x2b')](db[_0x6c1c('0x28')][_0x6c1c('0x29')]);_0x29c2f3['query']=_[_0x6c1c('0x2b')](_0x46f948[_0x6c1c('0x2c')]);_0x29c2f3[_0x6c1c('0x2d')]=_[_0x6c1c('0x2f')](_0x29c2f3[_0x6c1c('0x2a')],_0x29c2f3[_0x6c1c('0x2c')]);_0x687b92['attributes']=_['intersection'](_0x29c2f3[_0x6c1c('0x2a')],qs['fields'](_0x46f948['query']['fields']));_0x687b92[_0x6c1c('0x2e')]=_0x687b92[_0x6c1c('0x2e')]['length']?_0x687b92[_0x6c1c('0x2e')]:_0x29c2f3[_0x6c1c('0x2a')];if(_0x46f948[_0x6c1c('0x2c')]['includeAll']){_0x687b92[_0x6c1c('0x3e')]=[{'all':!![]}];}_0x687b92=_[_0x6c1c('0x37')]({},_0x687b92,_0x46f948[_0x6c1c('0x3c')]);return db[_0x6c1c('0x28')][_0x6c1c('0x43')](_0x687b92)[_0x6c1c('0x23')](handleEntityNotFound(_0x4b923d,null))[_0x6c1c('0x23')](respondWithResult(_0x4b923d,null))[_0x6c1c('0x40')](handleError(_0x4b923d,null));};exports[_0x6c1c('0x44')]=function(_0x15cc09,_0x394cac){return db['SquareMessage'][_0x6c1c('0x44')](_0x15cc09['body'],{})['then'](respondWithResult(_0x394cac,0xc9))['catch'](handleError(_0x394cac,null));};exports[_0x6c1c('0x22')]=function(_0x75f8d5,_0x3e8bda){if(_0x75f8d5[_0x6c1c('0x45')]['id']){delete _0x75f8d5[_0x6c1c('0x45')]['id'];}return db['SquareMessage'][_0x6c1c('0x43')]({'where':{'id':_0x75f8d5[_0x6c1c('0x42')]['id']}})[_0x6c1c('0x23')](handleEntityNotFound(_0x3e8bda,null))[_0x6c1c('0x23')](saveUpdates(_0x75f8d5[_0x6c1c('0x45')],null))[_0x6c1c('0x23')](respondWithResult(_0x3e8bda,null))['catch'](handleError(_0x3e8bda,null));};exports[_0x6c1c('0x24')]=function(_0x57c454,_0x24eec0){return db[_0x6c1c('0x28')]['find']({'where':{'id':_0x57c454[_0x6c1c('0x42')]['id']}})[_0x6c1c('0x23')](handleEntityNotFound(_0x24eec0,null))['then'](removeEntity(_0x24eec0,null))[_0x6c1c('0x40')](handleError(_0x24eec0,null));}; \ No newline at end of file +var _0xfca3=['keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','key','field','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','find','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SquareMessage','rawAttributes','model'];(function(_0x4385ba,_0x21bb05){var _0xf089b1=function(_0x1cbad3){while(--_0x1cbad3){_0x4385ba['push'](_0x4385ba['shift']());}};_0xf089b1(++_0x21bb05);}(_0xfca3,0xfa));var _0x3fca=function(_0x14258e,_0x4d120d){_0x14258e=_0x14258e-0x0;var _0x197a2c=_0xfca3[_0x14258e];return _0x197a2c;};'use strict';var pdf=require(_0x3fca('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3fca('0x1'));var jsonpatch=require(_0x3fca('0x2'));var rp=require(_0x3fca('0x3'));var moment=require(_0x3fca('0x4'));var BPromise=require(_0x3fca('0x5'));var Mustache=require(_0x3fca('0x6'));var util=require('util');var path=require(_0x3fca('0x7'));var sox=require(_0x3fca('0x8'));var csv=require(_0x3fca('0x9'));var ejs=require(_0x3fca('0xa'));var fs=require('fs');var _=require(_0x3fca('0xb'));var squel=require(_0x3fca('0xc'));var crypto=require(_0x3fca('0xd'));var jsforce=require(_0x3fca('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3fca('0x9'));var querystring=require(_0x3fca('0xf'));var Papa=require('papaparse');var authService=require(_0x3fca('0x10'));var hardwareService=require(_0x3fca('0x11'));var Redis=require(_0x3fca('0x12'));var qs=require(_0x3fca('0x13'));var logger=require('../../config/logger')(_0x3fca('0x14'));var utils=require(_0x3fca('0x15'));var config=require(_0x3fca('0x16'));var db=require(_0x3fca('0x17'))['db'];function respondWithStatusCode(_0x205a89,_0x2606a2){_0x2606a2=_0x2606a2||0xcc;return function(_0x3fcac7){if(_0x3fcac7){return _0x205a89[_0x3fca('0x18')](_0x2606a2);}return _0x205a89[_0x3fca('0x19')](_0x2606a2)[_0x3fca('0x1a')]();};}function respondWithResult(_0x193fc8,_0x377cd7){_0x377cd7=_0x377cd7||0xc8;return function(_0x3f9267){if(_0x3f9267){return _0x193fc8[_0x3fca('0x19')](_0x377cd7)[_0x3fca('0x1b')](_0x3f9267);}};}function respondWithFilteredResult(_0x436d65,_0x5afe27){return function(_0x40022b){if(_0x40022b){var _0x317757=_0x40022b[_0x3fca('0x1c')],_0x5190a3=_0x5afe27[_0x3fca('0x1d')],_0x5ef82c=_0x5afe27['offset']+_0x5afe27[_0x3fca('0x1e')],_0x399d0e;if(_0x5ef82c>=_0x317757){_0x5ef82c=_0x317757;_0x399d0e=0xc8;}else{_0x399d0e=0xce;}_0x436d65[_0x3fca('0x19')](_0x399d0e);return _0x436d65[_0x3fca('0x1f')](_0x3fca('0x20'),_0x5190a3+'-'+_0x5ef82c+'/'+_0x317757)[_0x3fca('0x1b')](_0x40022b);}return null;};}function patchUpdates(_0x53a469){return function(_0x382cb6){try{jsonpatch['apply'](_0x382cb6,_0x53a469,!![]);}catch(_0x478096){return BPromise[_0x3fca('0x21')](_0x478096);}return _0x382cb6[_0x3fca('0x22')]();};}function saveUpdates(_0x5e6cf6,_0x1ae153){return function(_0x28cd18){if(_0x28cd18){return _0x28cd18[_0x3fca('0x23')](_0x5e6cf6)[_0x3fca('0x24')](function(_0x3c7170){return _0x3c7170;});}return null;};}function removeEntity(_0x4802ab,_0x5af02a){return function(_0x150efb){if(_0x150efb){return _0x150efb[_0x3fca('0x25')]()[_0x3fca('0x24')](function(){_0x4802ab[_0x3fca('0x19')](0xcc)[_0x3fca('0x1a')]();});}};}function handleEntityNotFound(_0x3ebe0b,_0x4a2a13){return function(_0x133bb7){if(!_0x133bb7){_0x3ebe0b[_0x3fca('0x18')](0x194);}return _0x133bb7;};}function handleError(_0x3af8b9,_0x4c229c){_0x4c229c=_0x4c229c||0x1f4;return function(_0x4e93f5){logger[_0x3fca('0x26')](_0x4e93f5[_0x3fca('0x27')]);if(_0x4e93f5['name']){delete _0x4e93f5[_0x3fca('0x28')];}_0x3af8b9[_0x3fca('0x19')](_0x4c229c)[_0x3fca('0x29')](_0x4e93f5);};}exports[_0x3fca('0x2a')]=function(_0x5c8a40,_0x4d2bec){var _0x494291={},_0x4fe3cc={},_0x5f51ac={'count':0x0,'rows':[]};var _0x5f0850=db[_0x3fca('0x2b')][_0x3fca('0x2c')];_0x4fe3cc[_0x3fca('0x2d')]=_[_0x3fca('0x2e')](_0x5f0850);_0x4fe3cc[_0x3fca('0x2f')]=_[_0x3fca('0x2e')](_0x5c8a40[_0x3fca('0x2f')]);_0x4fe3cc[_0x3fca('0x30')]=_[_0x3fca('0x31')](_0x4fe3cc[_0x3fca('0x2d')],_0x4fe3cc[_0x3fca('0x2f')]);_0x494291[_0x3fca('0x32')]=_[_0x3fca('0x31')](_0x4fe3cc[_0x3fca('0x2d')],qs[_0x3fca('0x33')](_0x5c8a40['query'][_0x3fca('0x33')]));_0x494291['attributes']=_0x494291[_0x3fca('0x32')]['length']?_0x494291[_0x3fca('0x32')]:_0x4fe3cc[_0x3fca('0x2d')];if(!_0x5c8a40[_0x3fca('0x2f')][_0x3fca('0x34')](_0x3fca('0x35'))){_0x494291['limit']=qs['limit'](_0x5c8a40[_0x3fca('0x2f')]['limit']);_0x494291[_0x3fca('0x1d')]=qs['offset'](_0x5c8a40[_0x3fca('0x2f')][_0x3fca('0x1d')]);}_0x494291['order']=qs[_0x3fca('0x36')](_0x5c8a40[_0x3fca('0x2f')]['sort']);_0x494291[_0x3fca('0x37')]=qs[_0x3fca('0x30')](_[_0x3fca('0x38')](_0x5c8a40['query'],_0x4fe3cc[_0x3fca('0x30')]));if(_0x5c8a40[_0x3fca('0x2f')][_0x3fca('0x39')]){_0x494291[_0x3fca('0x37')]=_[_0x3fca('0x3a')](_0x494291['where'],{'$or':_['map'](_0x5f0850,function(_0x42c78d){if(_0x42c78d[_0x3fca('0x3b')][_0x3fca('0x3c')]!=='VIRTUAL'){var _0x4a59fb={};_0x4a59fb[_0x42c78d[_0x3fca('0x3d')]]={'$like':'%'+_0x5c8a40[_0x3fca('0x2f')][_0x3fca('0x39')]+'%'};return _0x4a59fb;}})});}_0x494291=_['merge']({},_0x494291,_0x5c8a40['options']);var _0x215865={'where':_0x494291[_0x3fca('0x37')]};return db[_0x3fca('0x2b')]['count'](_0x215865)['then'](function(_0x456fa6){_0x5f51ac['count']=_0x456fa6;if(_0x5c8a40[_0x3fca('0x2f')][_0x3fca('0x3e')]){_0x494291[_0x3fca('0x3f')]=[{'all':!![]}];}return db[_0x3fca('0x2b')][_0x3fca('0x40')](_0x494291);})[_0x3fca('0x24')](function(_0x3c312c){_0x5f51ac[_0x3fca('0x41')]=_0x3c312c;return _0x5f51ac;})[_0x3fca('0x24')](respondWithFilteredResult(_0x4d2bec,_0x494291))[_0x3fca('0x42')](handleError(_0x4d2bec,null));};exports[_0x3fca('0x43')]=function(_0x58592d,_0x1fadbc){var _0x3e559d={'raw':!![],'where':{'id':_0x58592d[_0x3fca('0x44')]['id']}},_0x1e1ca6={};_0x1e1ca6[_0x3fca('0x2d')]=_['keys'](db[_0x3fca('0x2b')]['rawAttributes']);_0x1e1ca6[_0x3fca('0x2f')]=_[_0x3fca('0x2e')](_0x58592d[_0x3fca('0x2f')]);_0x1e1ca6[_0x3fca('0x30')]=_[_0x3fca('0x31')](_0x1e1ca6[_0x3fca('0x2d')],_0x1e1ca6[_0x3fca('0x2f')]);_0x3e559d['attributes']=_[_0x3fca('0x31')](_0x1e1ca6['model'],qs[_0x3fca('0x33')](_0x58592d[_0x3fca('0x2f')][_0x3fca('0x33')]));_0x3e559d[_0x3fca('0x32')]=_0x3e559d[_0x3fca('0x32')][_0x3fca('0x45')]?_0x3e559d[_0x3fca('0x32')]:_0x1e1ca6[_0x3fca('0x2d')];if(_0x58592d[_0x3fca('0x2f')][_0x3fca('0x3e')]){_0x3e559d[_0x3fca('0x3f')]=[{'all':!![]}];}_0x3e559d=_[_0x3fca('0x3a')]({},_0x3e559d,_0x58592d[_0x3fca('0x46')]);return db[_0x3fca('0x2b')]['find'](_0x3e559d)['then'](handleEntityNotFound(_0x1fadbc,null))['then'](respondWithResult(_0x1fadbc,null))[_0x3fca('0x42')](handleError(_0x1fadbc,null));};exports[_0x3fca('0x47')]=function(_0x393dbc,_0x1d4c3e){return db[_0x3fca('0x2b')][_0x3fca('0x47')](_0x393dbc['body'],{})[_0x3fca('0x24')](respondWithResult(_0x1d4c3e,0xc9))['catch'](handleError(_0x1d4c3e,null));};exports[_0x3fca('0x23')]=function(_0x3d9cae,_0x9fcf27){if(_0x3d9cae[_0x3fca('0x48')]['id']){delete _0x3d9cae[_0x3fca('0x48')]['id'];}return db[_0x3fca('0x2b')][_0x3fca('0x49')]({'where':{'id':_0x3d9cae[_0x3fca('0x44')]['id']}})[_0x3fca('0x24')](handleEntityNotFound(_0x9fcf27,null))[_0x3fca('0x24')](saveUpdates(_0x3d9cae[_0x3fca('0x48')],null))[_0x3fca('0x24')](respondWithResult(_0x9fcf27,null))['catch'](handleError(_0x9fcf27,null));};exports['destroy']=function(_0x12f55e,_0x21cd6c){return db['SquareMessage'][_0x3fca('0x49')]({'where':{'id':_0x12f55e[_0x3fca('0x44')]['id']}})['then'](handleEntityNotFound(_0x21cd6c,null))['then'](removeEntity(_0x21cd6c,null))[_0x3fca('0x42')](handleError(_0x21cd6c,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 2cad461..1ff985f 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 _0xd12d=['./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','moment','bluebird'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0xd12d,0x1d1));var _0xdd12=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd12d[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xdd12('0x0'));var util=require(_0xdd12('0x1'));var logger=require(_0xdd12('0x2'))('api');var moment=require(_0xdd12('0x3'));var BPromise=require(_0xdd12('0x4'));var rp=require('request-promise');var attributes=require(_0xdd12('0x5'));module[_0xdd12('0x6')]=function(_0x7cf64e,_0x5546fd){return _0x7cf64e[_0xdd12('0x7')](_0xdd12('0x8'),attributes,{'tableName':_0xdd12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5510=['square_messages','lodash','util','../../config/logger','moment','bluebird','request-promise','./squareMessage.attributes','exports','define'];(function(_0x4b589e,_0xf4c47f){var _0x56a904=function(_0x5f44ce){while(--_0x5f44ce){_0x4b589e['push'](_0x4b589e['shift']());}};_0x56a904(++_0xf4c47f);}(_0x5510,0x169));var _0x0551=function(_0x311e77,_0x49a459){_0x311e77=_0x311e77-0x0;var _0x559c54=_0x5510[_0x311e77];return _0x559c54;};'use strict';var _=require(_0x0551('0x0'));var util=require(_0x0551('0x1'));var logger=require(_0x0551('0x2'))('api');var moment=require(_0x0551('0x3'));var BPromise=require(_0x0551('0x4'));var rp=require(_0x0551('0x5'));var attributes=require(_0x0551('0x6'));module[_0x0551('0x7')]=function(_0x1e62f3,_0x173034){return _0x1e62f3[_0x0551('0x8')]('SquareMessage',attributes,{'tableName':_0x0551('0x9'),'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 25d19b0..1290da3 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 _0xebd7=['stringify','error','code','message','result','catch','SquareMessage','create','body','options','raw','then','CreateSquareMessage','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5a7020,_0x2ceab7){var _0x1d92db=function(_0x242679){while(--_0x242679){_0x5a7020['push'](_0x5a7020['shift']());}};_0x1d92db(++_0x2ceab7);}(_0xebd7,0x179));var _0x7ebd=function(_0x5e0eeb,_0x524979){_0x5e0eeb=_0x5e0eeb-0x0;var _0x186f28=_0xebd7[_0x5e0eeb];return _0x186f28;};'use strict';var _=require('lodash');var util=require(_0x7ebd('0x0'));var moment=require(_0x7ebd('0x1'));var BPromise=require('bluebird');var rs=require(_0x7ebd('0x2'));var fs=require('fs');var Redis=require(_0x7ebd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ebd('0x4'));var logger=require('../../config/logger')(_0x7ebd('0x5'));var config=require(_0x7ebd('0x6'));var jayson=require(_0x7ebd('0x7'));var client=jayson[_0x7ebd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19b5e6,_0x47f5de,_0x278ffc){return new BPromise(function(_0xf1a4f9,_0x3389a0){return client[_0x7ebd('0x9')](_0x19b5e6,_0x278ffc)['then'](function(_0x5f4602){logger[_0x7ebd('0xa')](_0x7ebd('0xb'),_0x47f5de,_0x7ebd('0xc'));logger[_0x7ebd('0xd')](_0x7ebd('0xe'),_0x47f5de,_0x7ebd('0xc'),JSON[_0x7ebd('0xf')](_0x5f4602));if(_0x5f4602[_0x7ebd('0x10')]){if(_0x5f4602[_0x7ebd('0x10')][_0x7ebd('0x11')]===0x1f4){logger['error'](_0x7ebd('0xb'),_0x47f5de,_0x5f4602['error'][_0x7ebd('0x12')]);return _0x3389a0(_0x5f4602[_0x7ebd('0x10')][_0x7ebd('0x12')]);}logger[_0x7ebd('0x10')]('SquareMessage,\x20%s,\x20%s',_0x47f5de,_0x5f4602['error'][_0x7ebd('0x12')]);return _0xf1a4f9(_0x5f4602[_0x7ebd('0x10')][_0x7ebd('0x12')]);}else{logger[_0x7ebd('0xa')](_0x7ebd('0xb'),_0x47f5de,_0x7ebd('0xc'));_0xf1a4f9(_0x5f4602[_0x7ebd('0x13')][_0x7ebd('0x12')]);}})[_0x7ebd('0x14')](function(_0xc82204){logger[_0x7ebd('0x10')](_0x7ebd('0xb'),_0x47f5de,_0xc82204);_0x3389a0(_0xc82204);});});}exports['CreateSquareMessage']=function(_0x3e2f94){var _0x55578a=this;return new Promise(function(_0x1221a1,_0xf57746){return db[_0x7ebd('0x15')][_0x7ebd('0x16')](_0x3e2f94[_0x7ebd('0x17')],{'raw':_0x3e2f94['options']?_0x3e2f94[_0x7ebd('0x18')][_0x7ebd('0x19')]===undefined?!![]:![]:!![]})[_0x7ebd('0x1a')](function(_0x1ce2af){logger[_0x7ebd('0xa')]('CreateSquareMessage',_0x3e2f94);logger[_0x7ebd('0xd')](_0x7ebd('0x1b'),_0x3e2f94,JSON[_0x7ebd('0xf')](_0x1ce2af));_0x1221a1(_0x1ce2af);})[_0x7ebd('0x14')](function(_0x444a5b){logger[_0x7ebd('0x10')](_0x7ebd('0x1b'),_0x444a5b[_0x7ebd('0x12')],_0x3e2f94);_0xf57746(_0x55578a[_0x7ebd('0x10')](0x1f4,_0x444a5b[_0x7ebd('0x12')]));});});}; \ No newline at end of file +var _0x88bc=['jayson/promise','client','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','SquareMessage','create','body','options','then','CreateSquareMessage','catch','util','moment','randomstring','../../config/logger','../../config/environment'];(function(_0x276bc4,_0x16b498){var _0x15e569=function(_0x37e1a3){while(--_0x37e1a3){_0x276bc4['push'](_0x276bc4['shift']());}};_0x15e569(++_0x16b498);}(_0x88bc,0x133));var _0xc88b=function(_0x2bb3f6,_0x25fde0){_0x2bb3f6=_0x2bb3f6-0x0;var _0x62b339=_0x88bc[_0x2bb3f6];return _0x62b339;};'use strict';var _=require('lodash');var util=require(_0xc88b('0x0'));var moment=require(_0xc88b('0x1'));var BPromise=require('bluebird');var rs=require(_0xc88b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc88b('0x3'))('rpc');var config=require(_0xc88b('0x4'));var jayson=require(_0xc88b('0x5'));var client=jayson[_0xc88b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38d83f,_0x2ef1e7,_0x11fb0e){return new BPromise(function(_0x173992,_0x2d01dc){return client[_0xc88b('0x7')](_0x38d83f,_0x11fb0e)['then'](function(_0x2f9864){logger[_0xc88b('0x8')](_0xc88b('0x9'),_0x2ef1e7,_0xc88b('0xa'));logger[_0xc88b('0xb')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x2ef1e7,_0xc88b('0xa'),JSON[_0xc88b('0xc')](_0x2f9864));if(_0x2f9864['error']){if(_0x2f9864[_0xc88b('0xd')][_0xc88b('0xe')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x2ef1e7,_0x2f9864['error'][_0xc88b('0xf')]);return _0x2d01dc(_0x2f9864[_0xc88b('0xd')][_0xc88b('0xf')]);}logger[_0xc88b('0xd')]('SquareMessage,\x20%s,\x20%s',_0x2ef1e7,_0x2f9864[_0xc88b('0xd')][_0xc88b('0xf')]);return _0x173992(_0x2f9864[_0xc88b('0xd')]['message']);}else{logger[_0xc88b('0x8')](_0xc88b('0x9'),_0x2ef1e7,'request\x20sent');_0x173992(_0x2f9864[_0xc88b('0x10')]['message']);}})['catch'](function(_0x3333e0){logger['error'](_0xc88b('0x9'),_0x2ef1e7,_0x3333e0);_0x2d01dc(_0x3333e0);});});}exports['CreateSquareMessage']=function(_0x40f265){var _0x4224e1=this;return new Promise(function(_0x58a6c1,_0x58ae6a){return db[_0xc88b('0x11')][_0xc88b('0x12')](_0x40f265[_0xc88b('0x13')],{'raw':_0x40f265[_0xc88b('0x14')]?_0x40f265[_0xc88b('0x14')]['raw']===undefined?!![]:![]:!![]})[_0xc88b('0x15')](function(_0x6a7d0a){logger['info'](_0xc88b('0x16'),_0x40f265);logger[_0xc88b('0xb')](_0xc88b('0x16'),_0x40f265,JSON[_0xc88b('0xc')](_0x6a7d0a));_0x58a6c1(_0x6a7d0a);})[_0xc88b('0x17')](function(_0x4985b6){logger[_0xc88b('0xd')]('CreateSquareMessage',_0x4985b6[_0xc88b('0xf')],_0x40f265);_0x58ae6a(_0x4224e1[_0xc88b('0xd')](0x1f4,_0x4985b6[_0xc88b('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 1ab8687..6d2d36f 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 _0x36f1=['post','put','/:id','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','15s','test'];(function(_0x5ce785,_0x2e2a8f){var _0x20b62c=function(_0x487d9a){while(--_0x487d9a){_0x5ce785['push'](_0x5ce785['shift']());}};_0x20b62c(++_0x2e2a8f);}(_0x36f1,0xb0));var _0x136f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36f1[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x136f('0x0'));var util=require('util');var path=require(_0x136f('0x1'));var timeout=require('connect-timeout');var express=require(_0x136f('0x2'));var router=express[_0x136f('0x3')]();var auth=require(_0x136f('0x4'));var interaction=require(_0x136f('0x5'));var config=require(_0x136f('0x6'));var controller=require(_0x136f('0x7'));router[_0x136f('0x8')]('/',auth[_0x136f('0x9')](),controller[_0x136f('0xa')]);router[_0x136f('0x8')]('/:id',auth[_0x136f('0x9')](),controller[_0x136f('0xb')]);router[_0x136f('0x8')]('/:id/test',auth[_0x136f('0x9')](),timeout(_0x136f('0xc')),controller[_0x136f('0xd')]);router[_0x136f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x136f('0xf')](_0x136f('0x10'),auth[_0x136f('0x9')](),controller['update']);router['delete'](_0x136f('0x10'),auth[_0x136f('0x9')](),controller[_0x136f('0x11')]);module[_0x136f('0x12')]=router; \ No newline at end of file +var _0xc423=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x11659b,_0x4fc63b){var _0x13bf28=function(_0x149bca){while(--_0x149bca){_0x11659b['push'](_0x11659b['shift']());}};_0x13bf28(++_0x4fc63b);}(_0xc423,0x159));var _0x3c42=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xc423[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x3c42('0x0'));var util=require(_0x3c42('0x1'));var path=require(_0x3c42('0x2'));var timeout=require(_0x3c42('0x3'));var express=require(_0x3c42('0x4'));var router=express['Router']();var auth=require(_0x3c42('0x5'));var interaction=require(_0x3c42('0x6'));var config=require(_0x3c42('0x7'));var controller=require('./squareOdbc.controller');router[_0x3c42('0x8')]('/',auth[_0x3c42('0x9')](),controller[_0x3c42('0xa')]);router[_0x3c42('0x8')](_0x3c42('0xb'),auth[_0x3c42('0x9')](),controller[_0x3c42('0xc')]);router[_0x3c42('0x8')]('/:id/test',auth[_0x3c42('0x9')](),timeout('15s'),controller['test']);router[_0x3c42('0xd')]('/',auth[_0x3c42('0x9')](),controller[_0x3c42('0xe')]);router[_0x3c42('0xf')](_0x3c42('0xb'),auth[_0x3c42('0x9')](),controller[_0x3c42('0x10')]);router[_0x3c42('0x11')]('/:id',auth[_0x3c42('0x9')](),controller[_0x3c42('0x12')]);module[_0x3c42('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 8457075..7a14211 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 _0x32f2=['STRING','sequelize'];(function(_0x44bcfe,_0x7c13fa){var _0x16aeff=function(_0x3c8d65){while(--_0x3c8d65){_0x44bcfe['push'](_0x44bcfe['shift']());}};_0x16aeff(++_0x7c13fa);}(_0x32f2,0x18f));var _0x232f=function(_0x1e6f54,_0x249627){_0x1e6f54=_0x1e6f54-0x0;var _0xf8ee2e=_0x32f2[_0x1e6f54];return _0xf8ee2e;};'use strict';var Sequelize=require(_0x232f('0x0'));module['exports']={'name':{'type':Sequelize[_0x232f('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x232f('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4401=['STRING'];(function(_0x4cfc1d,_0x2c0927){var _0x1c01a0=function(_0x264a74){while(--_0x264a74){_0x4cfc1d['push'](_0x4cfc1d['shift']());}};_0x1c01a0(++_0x2c0927);}(_0x4401,0x15a));var _0x1440=function(_0x56eaaf,_0x427350){_0x56eaaf=_0x56eaaf-0x0;var _0x51b93e=_0x4401[_0x56eaaf];return _0x51b93e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1440('0x0')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x1440('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index b5773c8..aa9ed06 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 _0x9160=['filter','merge','map','key','VIRTUAL','field','options','SquareOdbc','includeAll','findAll','rows','show','params','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','ODBC','end','sendStatus','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick'];(function(_0x162ca5,_0x7828f1){var _0x99f676=function(_0x1be0e9){while(--_0x1be0e9){_0x162ca5['push'](_0x162ca5['shift']());}};_0x99f676(++_0x7828f1);}(_0x9160,0x1b0));var _0x0916=function(_0x13bf06,_0x5a0b10){_0x13bf06=_0x13bf06-0x0;var _0x53d376=_0x9160[_0x13bf06];return _0x53d376;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0916('0x0'));var rimraf=require(_0x0916('0x1'));var zipdir=require(_0x0916('0x2'));var jsonpatch=require(_0x0916('0x3'));var rp=require(_0x0916('0x4'));var moment=require(_0x0916('0x5'));var BPromise=require(_0x0916('0x6'));var Mustache=require(_0x0916('0x7'));var util=require('util');var path=require(_0x0916('0x8'));var sox=require(_0x0916('0x9'));var csv=require(_0x0916('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0916('0xb'));var squel=require(_0x0916('0xc'));var crypto=require('crypto');var jsforce=require(_0x0916('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0916('0xe'));var Papa=require(_0x0916('0xf'));var authService=require(_0x0916('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x0916('0x11'));var qs=require(_0x0916('0x12'));var logger=require(_0x0916('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x0916('0x14'));var db=require(_0x0916('0x15'))['db'];function respondWithStatusCode(_0x2a8970,_0x1f0c2f){_0x1f0c2f=_0x1f0c2f||0xcc;return function(_0x3188f6){if(_0x3188f6){return _0x2a8970['sendStatus'](_0x1f0c2f);}return _0x2a8970[_0x0916('0x16')](_0x1f0c2f)['end']();};}function respondWithResult(_0x13475f,_0x245c2d){_0x245c2d=_0x245c2d||0xc8;return function(_0x564db0){if(_0x564db0){return _0x13475f['status'](_0x245c2d)['json'](_0x564db0);}};}function respondWithFilteredResult(_0x24ea7c,_0x54edb4){return function(_0x255ec8){if(_0x255ec8){var _0x24c997=_0x255ec8[_0x0916('0x17')],_0x57bee4=_0x54edb4['offset'],_0x19dd6f=_0x54edb4[_0x0916('0x18')]+_0x54edb4[_0x0916('0x19')],_0x263744;if(_0x19dd6f>=_0x24c997){_0x19dd6f=_0x24c997;_0x263744=0xc8;}else{_0x263744=0xce;}_0x24ea7c[_0x0916('0x16')](_0x263744);return _0x24ea7c[_0x0916('0x1a')](_0x0916('0x1b'),_0x57bee4+'-'+_0x19dd6f+'/'+_0x24c997)['json'](_0x255ec8);}return null;};}function patchUpdates(_0x1c938a){return function(_0xa844e0){try{jsonpatch['apply'](_0xa844e0,_0x1c938a,!![]);}catch(_0x1e267f){return BPromise[_0x0916('0x1c')](_0x1e267f);}return _0xa844e0[_0x0916('0x1d')]();};}function saveUpdates(_0x71f43a,_0x4a56a6){return function(_0x246727){if(_0x246727){return _0x246727[_0x0916('0x1e')](_0x71f43a)[_0x0916('0x1f')](function(_0x60d2a8){return _0x60d2a8;});}return null;};}function removeEntity(_0x5408df,_0x2e5ff8){return function(_0x38c81b){if(_0x38c81b){return _0x38c81b[_0x0916('0x20')]()[_0x0916('0x1f')](function(){var _0x430efc=_0x38c81b[_0x0916('0x21')]({'plain':!![]});var _0x1e6a68=_0x0916('0x22');return db['UserProfileResource'][_0x0916('0x20')]({'where':{'type':_0x1e6a68,'resourceId':_0x430efc['id']}})[_0x0916('0x1f')](function(){return _0x38c81b;});})[_0x0916('0x1f')](function(){_0x5408df[_0x0916('0x16')](0xcc)[_0x0916('0x23')]();});}};}function handleEntityNotFound(_0x5a6d17,_0x5d640f){return function(_0x2c05d8){if(!_0x2c05d8){_0x5a6d17[_0x0916('0x24')](0x194);}return _0x2c05d8;};}function handleError(_0x13f12d,_0x36490b){_0x36490b=_0x36490b||0x1f4;return function(_0x3b48ff){logger[_0x0916('0x25')](_0x3b48ff[_0x0916('0x26')]);if(_0x3b48ff[_0x0916('0x27')]){delete _0x3b48ff['name'];}_0x13f12d[_0x0916('0x16')](_0x36490b)[_0x0916('0x28')](_0x3b48ff);};}exports['index']=function(_0x5c31f7,_0x4ffaaf){var _0x3b7d63={},_0xae6540={},_0x5470ff={'count':0x0,'rows':[]};var _0x237554=db['SquareOdbc'][_0x0916('0x29')];_0xae6540[_0x0916('0x2a')]=_[_0x0916('0x2b')](_0x237554);_0xae6540[_0x0916('0x2c')]=_['keys'](_0x5c31f7[_0x0916('0x2c')]);_0xae6540[_0x0916('0x2d')]=_[_0x0916('0x2e')](_0xae6540[_0x0916('0x2a')],_0xae6540['query']);_0x3b7d63[_0x0916('0x2f')]=_[_0x0916('0x2e')](_0xae6540[_0x0916('0x2a')],qs[_0x0916('0x30')](_0x5c31f7[_0x0916('0x2c')][_0x0916('0x30')]));_0x3b7d63[_0x0916('0x2f')]=_0x3b7d63[_0x0916('0x2f')][_0x0916('0x31')]?_0x3b7d63[_0x0916('0x2f')]:_0xae6540[_0x0916('0x2a')];if(!_0x5c31f7[_0x0916('0x2c')][_0x0916('0x32')]('nolimit')){_0x3b7d63[_0x0916('0x19')]=qs[_0x0916('0x19')](_0x5c31f7[_0x0916('0x2c')]['limit']);_0x3b7d63[_0x0916('0x18')]=qs[_0x0916('0x18')](_0x5c31f7['query'][_0x0916('0x18')]);}_0x3b7d63['order']=qs[_0x0916('0x33')](_0x5c31f7[_0x0916('0x2c')][_0x0916('0x33')]);_0x3b7d63[_0x0916('0x34')]=qs[_0x0916('0x2d')](_[_0x0916('0x35')](_0x5c31f7[_0x0916('0x2c')],_0xae6540[_0x0916('0x2d')]));if(_0x5c31f7[_0x0916('0x2c')][_0x0916('0x36')]){_0x3b7d63['where']=_[_0x0916('0x37')](_0x3b7d63[_0x0916('0x34')],{'$or':_[_0x0916('0x38')](_0x237554,function(_0xf996e7){if(_0xf996e7['type'][_0x0916('0x39')]!==_0x0916('0x3a')){var _0xb30b99={};_0xb30b99[_0xf996e7[_0x0916('0x3b')]]={'$like':'%'+_0x5c31f7['query']['filter']+'%'};return _0xb30b99;}})});}_0x3b7d63=_['merge']({},_0x3b7d63,_0x5c31f7[_0x0916('0x3c')]);var _0x52b42e={'where':_0x3b7d63[_0x0916('0x34')]};return db[_0x0916('0x3d')]['count'](_0x52b42e)[_0x0916('0x1f')](function(_0x43cd8c){_0x5470ff['count']=_0x43cd8c;if(_0x5c31f7[_0x0916('0x2c')][_0x0916('0x3e')]){_0x3b7d63['include']=[{'all':!![]}];}return db[_0x0916('0x3d')][_0x0916('0x3f')](_0x3b7d63);})['then'](function(_0x52b8a7){_0x5470ff[_0x0916('0x40')]=_0x52b8a7;return _0x5470ff;})['then'](respondWithFilteredResult(_0x4ffaaf,_0x3b7d63))['catch'](handleError(_0x4ffaaf,null));};exports[_0x0916('0x41')]=function(_0x3862ca,_0x24f220){var _0x461ad7={'raw':!![],'where':{'id':_0x3862ca[_0x0916('0x42')]['id']}},_0x211860={};_0x211860[_0x0916('0x2a')]=_[_0x0916('0x2b')](db['SquareOdbc'][_0x0916('0x29')]);_0x211860[_0x0916('0x2c')]=_[_0x0916('0x2b')](_0x3862ca[_0x0916('0x2c')]);_0x211860[_0x0916('0x2d')]=_[_0x0916('0x2e')](_0x211860[_0x0916('0x2a')],_0x211860[_0x0916('0x2c')]);_0x461ad7[_0x0916('0x2f')]=_[_0x0916('0x2e')](_0x211860['model'],qs[_0x0916('0x30')](_0x3862ca[_0x0916('0x2c')]['fields']));_0x461ad7['attributes']=_0x461ad7['attributes'][_0x0916('0x31')]?_0x461ad7['attributes']:_0x211860[_0x0916('0x2a')];if(_0x3862ca[_0x0916('0x2c')][_0x0916('0x3e')]){_0x461ad7[_0x0916('0x43')]=[{'all':!![]}];}_0x461ad7=_[_0x0916('0x37')]({},_0x461ad7,_0x3862ca['options']);return db[_0x0916('0x3d')]['find'](_0x461ad7)[_0x0916('0x1f')](handleEntityNotFound(_0x24f220,null))['then'](respondWithResult(_0x24f220,null))[_0x0916('0x44')](handleError(_0x24f220,null));};exports['create']=function(_0x5f6a28,_0x468cb4){return db[_0x0916('0x3d')][_0x0916('0x45')](_0x5f6a28[_0x0916('0x46')],{})[_0x0916('0x1f')](function(_0x498afd){var _0x318f75=_0x5f6a28[_0x0916('0x47')][_0x0916('0x21')]({'plain':!![]});if(!_0x318f75)throw new Error(_0x0916('0x48'));if(_0x318f75['role']===_0x0916('0x47')){var _0x13379d=_0x498afd[_0x0916('0x21')]({'plain':!![]});var _0x2b1312=_0x0916('0x22');return db[_0x0916('0x49')][_0x0916('0x4a')]({'where':{'name':_0x2b1312,'userProfileId':_0x318f75['userProfileId']},'raw':!![]})[_0x0916('0x1f')](function(_0x55e716){if(_0x55e716&&_0x55e716[_0x0916('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x13379d[_0x0916('0x27')],'resourceId':_0x13379d['id'],'type':_0x55e716[_0x0916('0x27')],'sectionId':_0x55e716['id']},{})[_0x0916('0x1f')](function(){return _0x498afd;});}else{return _0x498afd;}})[_0x0916('0x44')](function(_0x2f4e6d){logger[_0x0916('0x25')](_0x0916('0x4c'),_0x2f4e6d);throw _0x2f4e6d;});}return _0x498afd;})[_0x0916('0x1f')](respondWithResult(_0x468cb4,0xc9))['catch'](handleError(_0x468cb4,null));};exports[_0x0916('0x1e')]=function(_0x759f1b,_0x56ca8e){if(_0x759f1b[_0x0916('0x46')]['id']){delete _0x759f1b[_0x0916('0x46')]['id'];}return db[_0x0916('0x3d')][_0x0916('0x4a')]({'where':{'id':_0x759f1b['params']['id']}})['then'](handleEntityNotFound(_0x56ca8e,null))[_0x0916('0x1f')](saveUpdates(_0x759f1b[_0x0916('0x46')],null))['then'](respondWithResult(_0x56ca8e,null))[_0x0916('0x44')](handleError(_0x56ca8e,null));};exports[_0x0916('0x20')]=function(_0x3c987b,_0x1a24e7){return db['SquareOdbc'][_0x0916('0x4a')]({'where':{'id':_0x3c987b[_0x0916('0x42')]['id']}})[_0x0916('0x1f')](handleEntityNotFound(_0x1a24e7,null))[_0x0916('0x1f')](removeEntity(_0x1a24e7,null))[_0x0916('0x44')](handleError(_0x1a24e7,null));};exports['test']=function(_0x246416,_0x26b72b,_0x4ff177){var _0x1beb7a;return db[_0x0916('0x3d')]['find']({'where':{'id':_0x246416['params']['id']},'attributes':['id',_0x0916('0x4d')]})['then'](handleEntityNotFound(_0x26b72b,null))['then'](function(_0x1b61f5){if(_0x1b61f5){var _0x228f52=require(_0x0916('0x4e'))();_0x228f52[_0x0916('0x4f')](_0x1b61f5[_0x0916('0x4d')]);_0x228f52[_0x0916('0x50')]();return _0x1b61f5;}})[_0x0916('0x1f')](respondWithResult(_0x26b72b,null))[_0x0916('0x44')](handleError(_0x26b72b,null));}; \ No newline at end of file +var _0x0df6=['type','key','VIRTUAL','field','options','SquareOdbc','findAll','catch','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','update','destroy','params','test','odbc','dsn','closeSync','html-pdf','eml-format','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','ODBC','UserProfileResource','error','stack','name','index','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map'];(function(_0x2fb568,_0x40b782){var _0x45d550=function(_0x354e1a){while(--_0x354e1a){_0x2fb568['push'](_0x2fb568['shift']());}};_0x45d550(++_0x40b782);}(_0x0df6,0x10d));var _0x60df=function(_0x59442f,_0x1fc5cb){_0x59442f=_0x59442f-0x0;var _0x34425e=_0x0df6[_0x59442f];return _0x34425e;};'use strict';var pdf=require(_0x60df('0x0'));var emlformat=require(_0x60df('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x60df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x60df('0x3'));var moment=require(_0x60df('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x60df('0x5'));var path=require(_0x60df('0x6'));var sox=require('sox');var csv=require(_0x60df('0x7'));var ejs=require(_0x60df('0x8'));var fs=require('fs');var _=require(_0x60df('0x9'));var squel=require(_0x60df('0xa'));var crypto=require('crypto');var jsforce=require(_0x60df('0xb'));var deskjs=require(_0x60df('0xc'));var toCsv=require(_0x60df('0x7'));var querystring=require(_0x60df('0xd'));var Papa=require(_0x60df('0xe'));var authService=require(_0x60df('0xf'));var hardwareService=require(_0x60df('0x10'));var Redis=require(_0x60df('0x11'));var qs=require(_0x60df('0x12'));var logger=require(_0x60df('0x13'))(_0x60df('0x14'));var utils=require(_0x60df('0x15'));var config=require('../../config/environment');var db=require(_0x60df('0x16'))['db'];function respondWithStatusCode(_0x4fb46f,_0x79e20c){_0x79e20c=_0x79e20c||0xcc;return function(_0x273bd4){if(_0x273bd4){return _0x4fb46f[_0x60df('0x17')](_0x79e20c);}return _0x4fb46f[_0x60df('0x18')](_0x79e20c)[_0x60df('0x19')]();};}function respondWithResult(_0x44ce98,_0x314ce4){_0x314ce4=_0x314ce4||0xc8;return function(_0x383315){if(_0x383315){return _0x44ce98[_0x60df('0x18')](_0x314ce4)[_0x60df('0x1a')](_0x383315);}};}function respondWithFilteredResult(_0x2e6812,_0x303a06){return function(_0x3a02df){if(_0x3a02df){var _0x3710da=_0x3a02df[_0x60df('0x1b')],_0x4f9f01=_0x303a06[_0x60df('0x1c')],_0x3c5f06=_0x303a06[_0x60df('0x1c')]+_0x303a06[_0x60df('0x1d')],_0x1e42e4;if(_0x3c5f06>=_0x3710da){_0x3c5f06=_0x3710da;_0x1e42e4=0xc8;}else{_0x1e42e4=0xce;}_0x2e6812[_0x60df('0x18')](_0x1e42e4);return _0x2e6812[_0x60df('0x1e')](_0x60df('0x1f'),_0x4f9f01+'-'+_0x3c5f06+'/'+_0x3710da)[_0x60df('0x1a')](_0x3a02df);}return null;};}function patchUpdates(_0x517516){return function(_0x38af97){try{jsonpatch[_0x60df('0x20')](_0x38af97,_0x517516,!![]);}catch(_0x42023b){return BPromise[_0x60df('0x21')](_0x42023b);}return _0x38af97[_0x60df('0x22')]();};}function saveUpdates(_0x2d7d3a,_0x3802d8){return function(_0xc30790){if(_0xc30790){return _0xc30790['update'](_0x2d7d3a)[_0x60df('0x23')](function(_0x599be5){return _0x599be5;});}return null;};}function removeEntity(_0x178755,_0x4ed027){return function(_0x471fc8){if(_0x471fc8){return _0x471fc8['destroy']()[_0x60df('0x23')](function(){var _0x503c49=_0x471fc8[_0x60df('0x24')]({'plain':!![]});var _0x3fd941=_0x60df('0x25');return db[_0x60df('0x26')]['destroy']({'where':{'type':_0x3fd941,'resourceId':_0x503c49['id']}})['then'](function(){return _0x471fc8;});})[_0x60df('0x23')](function(){_0x178755[_0x60df('0x18')](0xcc)[_0x60df('0x19')]();});}};}function handleEntityNotFound(_0x341024,_0x46c96f){return function(_0x4a86fa){if(!_0x4a86fa){_0x341024[_0x60df('0x17')](0x194);}return _0x4a86fa;};}function handleError(_0x536a92,_0x5bb311){_0x5bb311=_0x5bb311||0x1f4;return function(_0x44fd2b){logger[_0x60df('0x27')](_0x44fd2b[_0x60df('0x28')]);if(_0x44fd2b[_0x60df('0x29')]){delete _0x44fd2b['name'];}_0x536a92[_0x60df('0x18')](_0x5bb311)['send'](_0x44fd2b);};}exports[_0x60df('0x2a')]=function(_0x5081e0,_0x200cb6){var _0x1cfcfd={},_0x1d248e={},_0x3389e6={'count':0x0,'rows':[]};var _0x2dc223=db['SquareOdbc'][_0x60df('0x2b')];_0x1d248e['model']=_[_0x60df('0x2c')](_0x2dc223);_0x1d248e[_0x60df('0x2d')]=_['keys'](_0x5081e0[_0x60df('0x2d')]);_0x1d248e[_0x60df('0x2e')]=_['intersection'](_0x1d248e[_0x60df('0x2f')],_0x1d248e[_0x60df('0x2d')]);_0x1cfcfd[_0x60df('0x30')]=_[_0x60df('0x31')](_0x1d248e['model'],qs[_0x60df('0x32')](_0x5081e0['query'][_0x60df('0x32')]));_0x1cfcfd[_0x60df('0x30')]=_0x1cfcfd[_0x60df('0x30')][_0x60df('0x33')]?_0x1cfcfd[_0x60df('0x30')]:_0x1d248e[_0x60df('0x2f')];if(!_0x5081e0[_0x60df('0x2d')][_0x60df('0x34')](_0x60df('0x35'))){_0x1cfcfd[_0x60df('0x1d')]=qs[_0x60df('0x1d')](_0x5081e0[_0x60df('0x2d')][_0x60df('0x1d')]);_0x1cfcfd['offset']=qs[_0x60df('0x1c')](_0x5081e0[_0x60df('0x2d')][_0x60df('0x1c')]);}_0x1cfcfd['order']=qs['sort'](_0x5081e0[_0x60df('0x2d')][_0x60df('0x36')]);_0x1cfcfd[_0x60df('0x37')]=qs[_0x60df('0x2e')](_['pick'](_0x5081e0[_0x60df('0x2d')],_0x1d248e[_0x60df('0x2e')]));if(_0x5081e0[_0x60df('0x2d')][_0x60df('0x38')]){_0x1cfcfd['where']=_[_0x60df('0x39')](_0x1cfcfd[_0x60df('0x37')],{'$or':_[_0x60df('0x3a')](_0x2dc223,function(_0x2d7114){if(_0x2d7114[_0x60df('0x3b')][_0x60df('0x3c')]!==_0x60df('0x3d')){var _0x25feff={};_0x25feff[_0x2d7114[_0x60df('0x3e')]]={'$like':'%'+_0x5081e0[_0x60df('0x2d')][_0x60df('0x38')]+'%'};return _0x25feff;}})});}_0x1cfcfd=_[_0x60df('0x39')]({},_0x1cfcfd,_0x5081e0[_0x60df('0x3f')]);var _0x3136fc={'where':_0x1cfcfd[_0x60df('0x37')]};return db[_0x60df('0x40')]['count'](_0x3136fc)[_0x60df('0x23')](function(_0x31daf9){_0x3389e6['count']=_0x31daf9;if(_0x5081e0[_0x60df('0x2d')]['includeAll']){_0x1cfcfd['include']=[{'all':!![]}];}return db[_0x60df('0x40')][_0x60df('0x41')](_0x1cfcfd);})[_0x60df('0x23')](function(_0x22e52a){_0x3389e6['rows']=_0x22e52a;return _0x3389e6;})[_0x60df('0x23')](respondWithFilteredResult(_0x200cb6,_0x1cfcfd))[_0x60df('0x42')](handleError(_0x200cb6,null));};exports[_0x60df('0x43')]=function(_0x31a3ae,_0x3b4de2){var _0x231da4={'raw':!![],'where':{'id':_0x31a3ae['params']['id']}},_0x546b42={};_0x546b42[_0x60df('0x2f')]=_[_0x60df('0x2c')](db[_0x60df('0x40')][_0x60df('0x2b')]);_0x546b42['query']=_[_0x60df('0x2c')](_0x31a3ae[_0x60df('0x2d')]);_0x546b42['filters']=_[_0x60df('0x31')](_0x546b42['model'],_0x546b42[_0x60df('0x2d')]);_0x231da4[_0x60df('0x30')]=_[_0x60df('0x31')](_0x546b42[_0x60df('0x2f')],qs[_0x60df('0x32')](_0x31a3ae[_0x60df('0x2d')][_0x60df('0x32')]));_0x231da4[_0x60df('0x30')]=_0x231da4[_0x60df('0x30')][_0x60df('0x33')]?_0x231da4['attributes']:_0x546b42['model'];if(_0x31a3ae[_0x60df('0x2d')][_0x60df('0x44')]){_0x231da4['include']=[{'all':!![]}];}_0x231da4=_['merge']({},_0x231da4,_0x31a3ae[_0x60df('0x3f')]);return db['SquareOdbc'][_0x60df('0x45')](_0x231da4)[_0x60df('0x23')](handleEntityNotFound(_0x3b4de2,null))[_0x60df('0x23')](respondWithResult(_0x3b4de2,null))[_0x60df('0x42')](handleError(_0x3b4de2,null));};exports[_0x60df('0x46')]=function(_0x1813bb,_0x5cee0c){return db[_0x60df('0x40')]['create'](_0x1813bb[_0x60df('0x47')],{})[_0x60df('0x23')](function(_0x258afd){var _0x478354=_0x1813bb['user'][_0x60df('0x24')]({'plain':!![]});if(!_0x478354)throw new Error(_0x60df('0x48'));if(_0x478354['role']==='user'){var _0xba3757=_0x258afd[_0x60df('0x24')]({'plain':!![]});var _0x160e0b='ODBC';return db[_0x60df('0x49')][_0x60df('0x45')]({'where':{'name':_0x160e0b,'userProfileId':_0x478354['userProfileId']},'raw':!![]})[_0x60df('0x23')](function(_0x22bfc9){if(_0x22bfc9&&_0x22bfc9[_0x60df('0x4a')]===0x0){return db[_0x60df('0x26')][_0x60df('0x46')]({'name':_0xba3757[_0x60df('0x29')],'resourceId':_0xba3757['id'],'type':_0x22bfc9[_0x60df('0x29')],'sectionId':_0x22bfc9['id']},{})[_0x60df('0x23')](function(){return _0x258afd;});}else{return _0x258afd;}})[_0x60df('0x42')](function(_0x441934){logger[_0x60df('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x441934);throw _0x441934;});}return _0x258afd;})['then'](respondWithResult(_0x5cee0c,0xc9))['catch'](handleError(_0x5cee0c,null));};exports[_0x60df('0x4b')]=function(_0x13c24f,_0x4a0e94){if(_0x13c24f[_0x60df('0x47')]['id']){delete _0x13c24f[_0x60df('0x47')]['id'];}return db[_0x60df('0x40')][_0x60df('0x45')]({'where':{'id':_0x13c24f['params']['id']}})[_0x60df('0x23')](handleEntityNotFound(_0x4a0e94,null))[_0x60df('0x23')](saveUpdates(_0x13c24f[_0x60df('0x47')],null))[_0x60df('0x23')](respondWithResult(_0x4a0e94,null))[_0x60df('0x42')](handleError(_0x4a0e94,null));};exports[_0x60df('0x4c')]=function(_0x50e43b,_0x516f50){return db[_0x60df('0x40')][_0x60df('0x45')]({'where':{'id':_0x50e43b[_0x60df('0x4d')]['id']}})['then'](handleEntityNotFound(_0x516f50,null))['then'](removeEntity(_0x516f50,null))['catch'](handleError(_0x516f50,null));};exports[_0x60df('0x4e')]=function(_0x44c2b1,_0x1ab148,_0x37e34a){var _0x2865c3;return db['SquareOdbc']['find']({'where':{'id':_0x44c2b1[_0x60df('0x4d')]['id']},'attributes':['id','dsn']})[_0x60df('0x23')](handleEntityNotFound(_0x1ab148,null))['then'](function(_0x53e2cd){if(_0x53e2cd){var _0x3c815d=require(_0x60df('0x4f'))();_0x3c815d['openSync'](_0x53e2cd[_0x60df('0x50')]);_0x3c815d[_0x60df('0x51')]();return _0x53e2cd;}})[_0x60df('0x23')](respondWithResult(_0x1ab148,null))[_0x60df('0x42')](handleError(_0x1ab148,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 394778f..54e1c1e 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 _0xb58b=['SquareOdbc','util','../../config/logger','api','bluebird','request-promise','exports','define'];(function(_0x37bc62,_0x3d2fb2){var _0x15d029=function(_0x51b276){while(--_0x51b276){_0x37bc62['push'](_0x37bc62['shift']());}};_0x15d029(++_0x3d2fb2);}(_0xb58b,0x1f1));var _0xbb58=function(_0x490662,_0x1611bd){_0x490662=_0x490662-0x0;var _0x5b2ffc=_0xb58b[_0x490662];return _0x5b2ffc;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var logger=require(_0xbb58('0x1'))(_0xbb58('0x2'));var moment=require('moment');var BPromise=require(_0xbb58('0x3'));var rp=require(_0xbb58('0x4'));var attributes=require('./squareOdbc.attributes');module[_0xbb58('0x5')]=function(_0x546510,_0x2edb10){return _0x546510[_0xbb58('0x6')](_0xbb58('0x7'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2ea=['SquareOdbc','lodash','util','../../config/logger','api','moment','request-promise','./squareOdbc.attributes','exports','define'];(function(_0x280faf,_0x31bd74){var _0x59e18d=function(_0x308642){while(--_0x308642){_0x280faf['push'](_0x280faf['shift']());}};_0x59e18d(++_0x31bd74);}(_0xd2ea,0x15f));var _0xad2e=function(_0x586515,_0x268e59){_0x586515=_0x586515-0x0;var _0x68091f=_0xd2ea[_0x586515];return _0x68091f;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var attributes=require(_0xad2e('0x6'));module[_0xad2e('0x7')]=function(_0x3e0741,_0x2afdc4){return _0x3e0741[_0xad2e('0x8')](_0xad2e('0x9'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 83719cf..5661a79 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 _0x33a1=['code','message','result','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include','model','map','debug','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x15fe46,_0x40dc50){var _0x4b7827=function(_0xd49db8){while(--_0xd49db8){_0x15fe46['push'](_0x15fe46['shift']());}};_0x4b7827(++_0x40dc50);}(_0x33a1,0x1c0));var _0x133a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x133a('0x0'));var moment=require(_0x133a('0x1'));var BPromise=require(_0x133a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x133a('0x3'))['db'];var utils=require(_0x133a('0x4'));var logger=require(_0x133a('0x5'))(_0x133a('0x6'));var config=require(_0x133a('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5da4f1,_0x5248ef,_0x457b1a){return new BPromise(function(_0x4bc467,_0x5e58f9){return client[_0x133a('0x8')](_0x5da4f1,_0x457b1a)[_0x133a('0x9')](function(_0x8b2896){logger[_0x133a('0xa')](_0x133a('0xb'),_0x5248ef,_0x133a('0xc'));logger['debug'](_0x133a('0xd'),_0x5248ef,_0x133a('0xc'),JSON[_0x133a('0xe')](_0x8b2896));if(_0x8b2896['error']){if(_0x8b2896[_0x133a('0xf')][_0x133a('0x10')]===0x1f4){logger[_0x133a('0xf')](_0x133a('0xb'),_0x5248ef,_0x8b2896['error'][_0x133a('0x11')]);return _0x5e58f9(_0x8b2896[_0x133a('0xf')][_0x133a('0x11')]);}logger[_0x133a('0xf')](_0x133a('0xb'),_0x5248ef,_0x8b2896[_0x133a('0xf')][_0x133a('0x11')]);return _0x4bc467(_0x8b2896[_0x133a('0xf')]['message']);}else{logger[_0x133a('0xa')]('SquareOdbc,\x20%s,\x20%s',_0x5248ef,'request\x20sent');_0x4bc467(_0x8b2896[_0x133a('0x12')]['message']);}})['catch'](function(_0x3c1f4e){logger[_0x133a('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x5248ef,_0x3c1f4e);_0x5e58f9(_0x3c1f4e);});});}exports[_0x133a('0x13')]=function(_0x18c6a7){var _0x404167=this;return new Promise(function(_0x3061d0,_0x51fb47){return db[_0x133a('0x14')]['find']({'raw':_0x18c6a7[_0x133a('0x15')]?_0x18c6a7['options'][_0x133a('0x16')]===undefined?!![]:![]:!![],'where':_0x18c6a7[_0x133a('0x15')]?_0x18c6a7[_0x133a('0x15')][_0x133a('0x17')]||null:null,'attributes':_0x18c6a7[_0x133a('0x15')]?_0x18c6a7[_0x133a('0x15')][_0x133a('0x18')]||null:null,'include':_0x18c6a7[_0x133a('0x15')]?_0x18c6a7['options']['include']?_['map'](_0x18c6a7[_0x133a('0x15')][_0x133a('0x19')],function(_0x74e67d){return{'model':db[_0x74e67d[_0x133a('0x1a')]],'as':_0x74e67d['as'],'attributes':_0x74e67d[_0x133a('0x18')],'include':_0x74e67d['include']?_['map'](_0x74e67d[_0x133a('0x19')],function(_0x15ec0f){return{'model':db[_0x15ec0f[_0x133a('0x1a')]],'as':_0x15ec0f['as'],'attributes':_0x15ec0f[_0x133a('0x18')],'include':_0x15ec0f[_0x133a('0x19')]?_[_0x133a('0x1b')](_0x15ec0f[_0x133a('0x19')],function(_0x54923f){return{'model':db[_0x54923f[_0x133a('0x1a')]],'as':_0x54923f['as'],'attributes':_0x54923f[_0x133a('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fcb99){logger[_0x133a('0xa')](_0x133a('0x13'),_0x18c6a7);logger[_0x133a('0x1c')]('ShowSquareOdbc',_0x18c6a7,JSON[_0x133a('0xe')](_0x1fcb99));_0x3061d0(_0x1fcb99);})['catch'](function(_0xb621be){logger[_0x133a('0xf')](_0x133a('0x13'),_0xb621be[_0x133a('0x11')],_0x18c6a7);_0x51fb47(_0x404167[_0x133a('0xf')](0x1f4,_0xb621be[_0x133a('0x11')]));});});}; \ No newline at end of file +var _0x013a=['error','code','message','catch','ShowSquareOdbc','find','options','raw','where','include','model','attributes','map','then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x013a,0x176));var _0xa013=function(_0x26e105,_0x821a88){_0x26e105=_0x26e105-0x0;var _0x534f19=_0x013a[_0x26e105];return _0x534f19;};'use strict';var _=require(_0xa013('0x0'));var util=require('util');var moment=require(_0xa013('0x1'));var BPromise=require('bluebird');var rs=require(_0xa013('0x2'));var fs=require('fs');var Redis=require(_0xa013('0x3'));var db=require(_0xa013('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa013('0x5'))(_0xa013('0x6'));var config=require(_0xa013('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa013('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x386b72,_0x57eb0c,_0x2631e6){return new BPromise(function(_0x3375b7,_0x12a9cc){return client[_0xa013('0x9')](_0x386b72,_0x2631e6)['then'](function(_0x23e793){logger[_0xa013('0xa')](_0xa013('0xb'),_0x57eb0c,_0xa013('0xc'));logger[_0xa013('0xd')](_0xa013('0xe'),_0x57eb0c,_0xa013('0xc'),JSON[_0xa013('0xf')](_0x23e793));if(_0x23e793['error']){if(_0x23e793[_0xa013('0x10')][_0xa013('0x11')]===0x1f4){logger[_0xa013('0x10')](_0xa013('0xb'),_0x57eb0c,_0x23e793[_0xa013('0x10')][_0xa013('0x12')]);return _0x12a9cc(_0x23e793['error']['message']);}logger[_0xa013('0x10')](_0xa013('0xb'),_0x57eb0c,_0x23e793[_0xa013('0x10')][_0xa013('0x12')]);return _0x3375b7(_0x23e793[_0xa013('0x10')][_0xa013('0x12')]);}else{logger[_0xa013('0xa')](_0xa013('0xb'),_0x57eb0c,_0xa013('0xc'));_0x3375b7(_0x23e793['result'][_0xa013('0x12')]);}})[_0xa013('0x13')](function(_0x4533a1){logger[_0xa013('0x10')](_0xa013('0xb'),_0x57eb0c,_0x4533a1);_0x12a9cc(_0x4533a1);});});}exports[_0xa013('0x14')]=function(_0x2c4d1b){var _0x130e3a=this;return new Promise(function(_0x4f9004,_0x4c14b0){return db['SquareOdbc'][_0xa013('0x15')]({'raw':_0x2c4d1b['options']?_0x2c4d1b[_0xa013('0x16')][_0xa013('0x17')]===undefined?!![]:![]:!![],'where':_0x2c4d1b['options']?_0x2c4d1b[_0xa013('0x16')][_0xa013('0x18')]||null:null,'attributes':_0x2c4d1b[_0xa013('0x16')]?_0x2c4d1b[_0xa013('0x16')]['attributes']||null:null,'include':_0x2c4d1b[_0xa013('0x16')]?_0x2c4d1b['options'][_0xa013('0x19')]?_['map'](_0x2c4d1b[_0xa013('0x16')][_0xa013('0x19')],function(_0x465bd2){return{'model':db[_0x465bd2[_0xa013('0x1a')]],'as':_0x465bd2['as'],'attributes':_0x465bd2[_0xa013('0x1b')],'include':_0x465bd2[_0xa013('0x19')]?_['map'](_0x465bd2[_0xa013('0x19')],function(_0x314c68){return{'model':db[_0x314c68['model']],'as':_0x314c68['as'],'attributes':_0x314c68[_0xa013('0x1b')],'include':_0x314c68[_0xa013('0x19')]?_[_0xa013('0x1c')](_0x314c68['include'],function(_0x5a165b){return{'model':db[_0x5a165b['model']],'as':_0x5a165b['as'],'attributes':_0x5a165b[_0xa013('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa013('0x1d')](function(_0x3aa141){logger['info']('ShowSquareOdbc',_0x2c4d1b);logger['debug']('ShowSquareOdbc',_0x2c4d1b,JSON['stringify'](_0x3aa141));_0x4f9004(_0x3aa141);})[_0xa013('0x13')](function(_0x38c3e7){logger['error'](_0xa013('0x14'),_0x38c3e7[_0xa013('0x12')],_0x2c4d1b);_0x4c14b0(_0x130e3a[_0xa013('0x10')](0x1f4,_0x38c3e7[_0xa013('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index b016ac2..babfc7c 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 _0xdab3=['/:id/users','post','create','addUsers','/:id','update','delete','removeUsers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0xdab3,0x127));var _0x3dab=function(_0xfdb12b,_0x49971a){_0xfdb12b=_0xfdb12b-0x0;var _0x557354=_0xdab3[_0xfdb12b];return _0x557354;};'use strict';var multer=require(_0x3dab('0x0'));var util=require(_0x3dab('0x1'));var path=require(_0x3dab('0x2'));var timeout=require(_0x3dab('0x3'));var express=require(_0x3dab('0x4'));var router=express[_0x3dab('0x5')]();var auth=require(_0x3dab('0x6'));var interaction=require(_0x3dab('0x7'));var config=require(_0x3dab('0x8'));var controller=require('./squareProject.controller');router['get']('/',auth[_0x3dab('0x9')](),controller[_0x3dab('0xa')]);router[_0x3dab('0xb')]('/:id',auth[_0x3dab('0x9')](),controller[_0x3dab('0xc')]);router[_0x3dab('0xb')](_0x3dab('0xd'),auth['isAuthenticated'](),controller['getUsers']);router[_0x3dab('0xe')]('/',auth[_0x3dab('0x9')](),controller[_0x3dab('0xf')]);router[_0x3dab('0xe')](_0x3dab('0xd'),auth['isAuthenticated'](),controller[_0x3dab('0x10')]);router['put'](_0x3dab('0x11'),auth[_0x3dab('0x9')](),controller[_0x3dab('0x12')]);router[_0x3dab('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3dab('0x13')](_0x3dab('0xd'),auth[_0x3dab('0x9')](),controller[_0x3dab('0x14')]);module[_0x3dab('0x15')]=router; \ No newline at end of file +var _0x46f9=['post','create','/:id/users','put','delete','removeUsers','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','getUsers'];(function(_0x1a97cb,_0x3e174c){var _0x4ab190=function(_0x824a75){while(--_0x824a75){_0x1a97cb['push'](_0x1a97cb['shift']());}};_0x4ab190(++_0x3e174c);}(_0x46f9,0x12d));var _0x946f=function(_0x5169a0,_0x40095f){_0x5169a0=_0x5169a0-0x0;var _0x45dc84=_0x46f9[_0x5169a0];return _0x45dc84;};'use strict';var multer=require(_0x946f('0x0'));var util=require(_0x946f('0x1'));var path=require(_0x946f('0x2'));var timeout=require('connect-timeout');var express=require(_0x946f('0x3'));var router=express[_0x946f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x946f('0x5'));var config=require(_0x946f('0x6'));var controller=require(_0x946f('0x7'));router[_0x946f('0x8')]('/',auth[_0x946f('0x9')](),controller[_0x946f('0xa')]);router[_0x946f('0x8')](_0x946f('0xb'),auth[_0x946f('0x9')](),controller[_0x946f('0xc')]);router[_0x946f('0x8')]('/:id/users',auth[_0x946f('0x9')](),controller[_0x946f('0xd')]);router[_0x946f('0xe')]('/',auth[_0x946f('0x9')](),controller[_0x946f('0xf')]);router[_0x946f('0xe')](_0x946f('0x10'),auth[_0x946f('0x9')](),controller['addUsers']);router[_0x946f('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x946f('0xb'),auth[_0x946f('0x9')](),controller['destroy']);router[_0x946f('0x12')](_0x946f('0x10'),auth[_0x946f('0x9')](),controller[_0x946f('0x13')]);module[_0x946f('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 28c8326..7aa622b 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 _0x2eb2=['TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production','exports','STRING','name'];(function(_0x421da9,_0x288dca){var _0x222d27=function(_0x527656){while(--_0x527656){_0x421da9['push'](_0x421da9['shift']());}};_0x222d27(++_0x288dca);}(_0x2eb2,0x19f));var _0x22eb=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x2eb2[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'unique':_0x22eb('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'notes':{'type':Sequelize[_0x22eb('0x3')]},'preproduction':{'type':Sequelize[_0x22eb('0x4')]('long'),'get':function(){if(this[_0x22eb('0x5')]('preproduction')){return this['getDataValue'](_0x22eb('0x6'))[_0x22eb('0x7')](_0x22eb('0x8'));}}},'production':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x9')),'get':function(){if(this[_0x22eb('0x5')](_0x22eb('0xa'))){return this[_0x22eb('0x5')](_0x22eb('0xa'))[_0x22eb('0x7')](_0x22eb('0x8'));}}}}; \ No newline at end of file +var _0xbba1=['name','STRING','long','getDataValue','utf8','BLOB','production','sequelize'];(function(_0x20540e,_0x2617f8){var _0x477ca4=function(_0x4ff673){while(--_0x4ff673){_0x20540e['push'](_0x20540e['shift']());}};_0x477ca4(++_0x2617f8);}(_0xbba1,0x17f));var _0x1bba=function(_0x168e8a,_0xe8205d){_0x168e8a=_0x168e8a-0x0;var _0x4549ed=_0xbba1[_0x168e8a];return _0x4549ed;};'use strict';var Sequelize=require(_0x1bba('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1bba('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x1bba('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0x1bba('0x3')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x1bba('0x4')]('preproduction')['toString'](_0x1bba('0x5'));}}},'production':{'type':Sequelize[_0x1bba('0x6')](_0x1bba('0x3')),'get':function(){if(this[_0x1bba('0x4')](_0x1bba('0x7'))){return this[_0x1bba('0x4')]('production')['toString'](_0x1bba('0x5'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 7728dd3..3a85602 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 _0x7a54=['bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','end','error','stack','name','index','SquareProject','rawAttributes','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','params','addUsers','ids','removeUsers','isArray','findOne','User','filter','map','getUsers','hasOwnProperty','html-pdf','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x250391,_0x2a3f1a){var _0x3f9197=function(_0x1b4932){while(--_0x1b4932){_0x250391['push'](_0x250391['shift']());}};_0x3f9197(++_0x2a3f1a);}(_0x7a54,0x106));var _0x47a5=function(_0x5ce094,_0x72dbcc){_0x5ce094=_0x5ce094-0x0;var _0x551a23=_0x7a54[_0x5ce094];return _0x551a23;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x47a5('0xe'));var hardwareService=require(_0x47a5('0xf'));var Redis=require('ioredis');var qs=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);function respondWithStatusCode(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xcc;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x19')](_0x139f25);}return _0x711793[_0x47a5('0x1a')](_0x139f25)['end']();};}function respondWithResult(_0x362359,_0x11faf5){_0x11faf5=_0x11faf5||0xc8;return function(_0x3b001e){if(_0x3b001e){return _0x362359[_0x47a5('0x1a')](_0x11faf5)[_0x47a5('0x1b')](_0x3b001e);}};}function respondWithFilteredResult(_0x574af6,_0x549de3){return function(_0x138bc0){if(_0x138bc0){var _0x4b966e=_0x138bc0[_0x47a5('0x1c')],_0x5247fd=_0x549de3[_0x47a5('0x1d')],_0x423a81=_0x549de3[_0x47a5('0x1d')]+_0x549de3[_0x47a5('0x1e')],_0xaf70a6;if(_0x423a81>=_0x4b966e){_0x423a81=_0x4b966e;_0xaf70a6=0xc8;}else{_0xaf70a6=0xce;}_0x574af6[_0x47a5('0x1a')](_0xaf70a6);return _0x574af6[_0x47a5('0x1f')](_0x47a5('0x20'),_0x5247fd+'-'+_0x423a81+'/'+_0x4b966e)['json'](_0x138bc0);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x21')](_0x2b0360);}return _0xf160ba[_0x47a5('0x22')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x23')](_0x4c5910)[_0x47a5('0x24')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x25')]()[_0x47a5('0x24')](function(){var _0x4437f1=_0x513981[_0x47a5('0x26')]({'plain':!![]});var _0x3abd6a='SquareProjects';return db['UserProfileResource'][_0x47a5('0x25')]({'where':{'type':_0x3abd6a,'resourceId':_0x4437f1['id']}})['then'](function(){return _0x513981;});})[_0x47a5('0x24')](function(){_0xe2dea9['status'](0xcc)[_0x47a5('0x27')]();});}};}function handleEntityNotFound(_0x378208,_0x36ad34){return function(_0x1dac65){if(!_0x1dac65){_0x378208[_0x47a5('0x19')](0x194);}return _0x1dac65;};}function handleError(_0x3ba0b7,_0x24b162){_0x24b162=_0x24b162||0x1f4;return function(_0x136b14){logger[_0x47a5('0x28')](_0x136b14[_0x47a5('0x29')]);if(_0x136b14[_0x47a5('0x2a')]){delete _0x136b14[_0x47a5('0x2a')];}_0x3ba0b7[_0x47a5('0x1a')](_0x24b162)['send'](_0x136b14);};}exports[_0x47a5('0x2b')]=function(_0x51833b,_0x2ef875){var _0x9ac908={},_0x16901f={},_0x4d6b57={'count':0x0,'rows':[]};var _0x256650=db[_0x47a5('0x2c')][_0x47a5('0x2d')];_0x16901f[_0x47a5('0x2e')]=_['keys'](_0x256650);_0x16901f['query']=_[_0x47a5('0x2f')](_0x51833b[_0x47a5('0x30')]);_0x16901f['filters']=_['intersection'](_0x16901f[_0x47a5('0x2e')],_0x16901f[_0x47a5('0x30')]);_0x9ac908['attributes']=_[_0x47a5('0x31')](_0x16901f['model'],qs[_0x47a5('0x32')](_0x51833b[_0x47a5('0x30')]['fields']));_0x9ac908['attributes']=_0x9ac908[_0x47a5('0x33')]['length']?_0x9ac908[_0x47a5('0x33')]:_0x16901f[_0x47a5('0x2e')];if(!_0x51833b[_0x47a5('0x30')]['hasOwnProperty'](_0x47a5('0x34'))){_0x9ac908['limit']=qs['limit'](_0x51833b[_0x47a5('0x30')]['limit']);_0x9ac908[_0x47a5('0x1d')]=qs['offset'](_0x51833b[_0x47a5('0x30')][_0x47a5('0x1d')]);}_0x9ac908[_0x47a5('0x35')]=qs[_0x47a5('0x36')](_0x51833b[_0x47a5('0x30')][_0x47a5('0x36')]);_0x9ac908[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x51833b['query'],_0x16901f[_0x47a5('0x38')]));if(_0x51833b[_0x47a5('0x30')]['filter']){_0x9ac908[_0x47a5('0x37')]=_[_0x47a5('0x3a')](_0x9ac908[_0x47a5('0x37')],{'$or':_['map'](_0x256650,function(_0x101f70){if(_0x101f70[_0x47a5('0x3b')]['key']!==_0x47a5('0x3c')){var _0x19218a={};_0x19218a[_0x101f70['field']]={'$like':'%'+_0x51833b['query']['filter']+'%'};return _0x19218a;}})});}_0x9ac908=_[_0x47a5('0x3a')]({},_0x9ac908,_0x51833b['options']);var _0x9b5eaf={'where':_0x9ac908[_0x47a5('0x37')]};return db[_0x47a5('0x2c')][_0x47a5('0x1c')](_0x9b5eaf)[_0x47a5('0x24')](function(_0xcb5243){_0x4d6b57[_0x47a5('0x1c')]=_0xcb5243;if(_0x51833b[_0x47a5('0x30')][_0x47a5('0x3d')]){_0x9ac908[_0x47a5('0x3e')]=[{'all':!![]}];}return db[_0x47a5('0x2c')][_0x47a5('0x3f')](_0x9ac908);})[_0x47a5('0x24')](function(_0x56dbbd){_0x4d6b57[_0x47a5('0x40')]=_0x56dbbd;return _0x4d6b57;})[_0x47a5('0x24')](respondWithFilteredResult(_0x2ef875,_0x9ac908))[_0x47a5('0x41')](handleError(_0x2ef875,null));};exports[_0x47a5('0x42')]=function(_0x586f4f,_0x7de536){var _0x528ef3={'raw':![],'where':{'id':_0x586f4f['params']['id']}},_0x47c7a2={};_0x47c7a2['model']=_[_0x47a5('0x2f')](db['SquareProject'][_0x47a5('0x2d')]);_0x47c7a2[_0x47a5('0x30')]=_[_0x47a5('0x2f')](_0x586f4f['query']);_0x47c7a2[_0x47a5('0x38')]=_[_0x47a5('0x31')](_0x47c7a2['model'],_0x47c7a2['query']);_0x528ef3[_0x47a5('0x33')]=_['intersection'](_0x47c7a2[_0x47a5('0x2e')],qs[_0x47a5('0x32')](_0x586f4f[_0x47a5('0x30')][_0x47a5('0x32')]));_0x528ef3[_0x47a5('0x33')]=_0x528ef3[_0x47a5('0x33')][_0x47a5('0x43')]?_0x528ef3[_0x47a5('0x33')]:_0x47c7a2[_0x47a5('0x2e')];if(_0x586f4f[_0x47a5('0x30')][_0x47a5('0x3d')]){_0x528ef3[_0x47a5('0x3e')]=[{'all':!![]}];}_0x528ef3=_[_0x47a5('0x3a')]({},_0x528ef3,_0x586f4f[_0x47a5('0x44')]);return db[_0x47a5('0x2c')][_0x47a5('0x45')](_0x528ef3)['then'](handleEntityNotFound(_0x7de536,null))[_0x47a5('0x24')](respondWithResult(_0x7de536,null))[_0x47a5('0x41')](handleError(_0x7de536,null));};exports['create']=function(_0x52b3a8,_0x3d0a88){return db['SquareProject'][_0x47a5('0x46')](_0x52b3a8[_0x47a5('0x47')],{})['then'](function(_0x4f62d3){var _0x3d85cc=_0x52b3a8['user'][_0x47a5('0x26')]({'plain':!![]});if(!_0x3d85cc)throw new Error(_0x47a5('0x48'));if(_0x3d85cc[_0x47a5('0x49')]===_0x47a5('0x4a')){var _0x44fe8a=_0x4f62d3[_0x47a5('0x26')]({'plain':!![]});var _0x238ebb='SquareProjects';return db['UserProfileSection'][_0x47a5('0x45')]({'where':{'name':_0x238ebb,'userProfileId':_0x3d85cc[_0x47a5('0x4b')]},'raw':!![]})[_0x47a5('0x24')](function(_0x9ea93e){if(_0x9ea93e&&_0x9ea93e[_0x47a5('0x4c')]===0x0){return db[_0x47a5('0x4d')][_0x47a5('0x46')]({'name':_0x44fe8a['name'],'resourceId':_0x44fe8a['id'],'type':_0x9ea93e[_0x47a5('0x2a')],'sectionId':_0x9ea93e['id']},{})[_0x47a5('0x24')](function(){return _0x4f62d3;});}else{return _0x4f62d3;}})[_0x47a5('0x41')](function(_0x5c3c75){logger[_0x47a5('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c3c75);throw _0x5c3c75;});}return _0x4f62d3;})[_0x47a5('0x24')](respondWithResult(_0x3d0a88,0xc9))[_0x47a5('0x41')](handleError(_0x3d0a88,null));};exports[_0x47a5('0x23')]=function(_0xf03bd5,_0x588551){if(_0xf03bd5[_0x47a5('0x47')]['id']){delete _0xf03bd5[_0x47a5('0x47')]['id'];}return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0xf03bd5[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x588551,null))[_0x47a5('0x24')](saveUpdates(_0xf03bd5['body'],null))[_0x47a5('0x24')](respondWithResult(_0x588551,null))[_0x47a5('0x41')](handleError(_0x588551,null));};exports[_0x47a5('0x25')]=function(_0x8da9fb,_0x3329aa){return db[_0x47a5('0x2c')]['find']({'where':{'id':_0x8da9fb[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x3329aa,null))[_0x47a5('0x24')](removeEntity(_0x3329aa,null))['catch'](handleError(_0x3329aa,null));};exports[_0x47a5('0x4f')]=function(_0x3c78b7,_0x183b3c,_0x5d8d4a){return db['SquareProject'][_0x47a5('0x45')]({'where':{'id':_0x3c78b7[_0x47a5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x183b3c,null))['then'](function(_0x6d6b2b){if(_0x6d6b2b){return _0x6d6b2b['addUsers'](_0x3c78b7[_0x47a5('0x47')]['ids'],_['omit'](_0x3c78b7[_0x47a5('0x47')],[_0x47a5('0x50'),'id'])||{});}})['then'](respondWithResult(_0x183b3c,null))[_0x47a5('0x41')](handleError(_0x183b3c,null));};exports[_0x47a5('0x51')]=function(_0x4b706a,_0x5b6127,_0x16b4fd){var _0x30d482;return db[_0x47a5('0x2c')][_0x47a5('0x45')]({'where':{'id':_0x4b706a['params']['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x5b6127,null))[_0x47a5('0x24')](function(_0x1af800){if(_0x1af800){return _0x1af800['removeUsers'](_0x4b706a[_0x47a5('0x30')]['ids'])[_0x47a5('0x24')](function(_0x470da6){if(_[_0x47a5('0x52')](_0x4b706a[_0x47a5('0x30')][_0x47a5('0x50')])){for(var _0x4966af=0x0;_0x4966af<_0x4b706a[_0x47a5('0x30')]['ids']['length'];_0x4966af+=0x1){socket['emit']('userSquareProject:remove',{'UserId':_0x4b706a[_0x47a5('0x30')][_0x47a5('0x50')][_0x4966af],'SquareProjectId':_0x4b706a[_0x47a5('0x4e')]['id']});}}else{socket['emit']('userSquareProject:remove',{'UserId':_0x4b706a[_0x47a5('0x30')][_0x47a5('0x50')],'SquareProjectId':_0x4b706a[_0x47a5('0x4e')]['id']});}});}})[_0x47a5('0x24')](respondWithStatusCode(_0x5b6127,null))[_0x47a5('0x41')](handleError(_0x5b6127,null));};exports['getUsers']=function(_0x3474b7,_0x519e9e,_0x22c886){var _0x274d31={};var _0x4d545f={};var _0x32b4de;var _0x345104;return db[_0x47a5('0x2c')][_0x47a5('0x53')]({'where':{'id':_0x3474b7[_0x47a5('0x4e')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x519e9e,null))[_0x47a5('0x24')](function(_0x3ac38c){if(_0x3ac38c){_0x32b4de=_0x3ac38c;_0x4d545f['model']=_[_0x47a5('0x2f')](db[_0x47a5('0x54')][_0x47a5('0x2d')]);_0x4d545f[_0x47a5('0x30')]=_[_0x47a5('0x2f')](_0x3474b7['query']);_0x4d545f[_0x47a5('0x38')]=_[_0x47a5('0x31')](_0x4d545f[_0x47a5('0x2e')],_0x4d545f[_0x47a5('0x30')]);_0x274d31[_0x47a5('0x33')]=_[_0x47a5('0x31')](_0x4d545f[_0x47a5('0x2e')],qs[_0x47a5('0x32')](_0x3474b7[_0x47a5('0x30')][_0x47a5('0x32')]));_0x274d31[_0x47a5('0x33')]=_0x274d31[_0x47a5('0x33')][_0x47a5('0x43')]?_0x274d31[_0x47a5('0x33')]:_0x4d545f[_0x47a5('0x2e')];_0x274d31['order']=qs[_0x47a5('0x36')](_0x3474b7[_0x47a5('0x30')][_0x47a5('0x36')]);_0x274d31['where']=qs[_0x47a5('0x38')](_[_0x47a5('0x39')](_0x3474b7[_0x47a5('0x30')],_0x4d545f[_0x47a5('0x38')]));if(_0x3474b7['query'][_0x47a5('0x55')]){_0x274d31['where']=_[_0x47a5('0x3a')](_0x274d31['where'],{'$or':_[_0x47a5('0x56')](_0x274d31['attributes'],function(_0x7c1190){var _0x2f27c3={};_0x2f27c3[_0x7c1190]={'$like':'%'+_0x3474b7[_0x47a5('0x30')]['filter']+'%'};return _0x2f27c3;})});}_0x274d31=_['merge']({},_0x274d31,_0x3474b7['options']);return _0x32b4de[_0x47a5('0x57')](_0x274d31);}})[_0x47a5('0x24')](function(_0xe3c0a7){if(_0xe3c0a7){_0x345104=_0xe3c0a7[_0x47a5('0x43')];if(!_0x3474b7['query'][_0x47a5('0x58')](_0x47a5('0x34'))){_0x274d31[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x3474b7[_0x47a5('0x30')][_0x47a5('0x1e')]);_0x274d31[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x3474b7[_0x47a5('0x30')][_0x47a5('0x1d')]);}return _0x32b4de[_0x47a5('0x57')](_0x274d31);}})[_0x47a5('0x24')](function(_0x49d3dc){if(_0x49d3dc){return _0x49d3dc?{'count':_0x345104,'rows':_0x49d3dc}:null;}})[_0x47a5('0x24')](respondWithResult(_0x519e9e,null))['catch'](handleError(_0x519e9e,null));}; \ No newline at end of file +var _0x5f66=['limit','order','sort','filter','where','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','destroy','then','SquareProjects','UserProfileResource','name','send','index','SquareProject','keys','query','filters','intersection','attributes','fields','length','model','nolimit'];(function(_0x349b6a,_0x496705){var _0x21097c=function(_0x2aaded){while(--_0x2aaded){_0x349b6a['push'](_0x349b6a['shift']());}};_0x21097c(++_0x496705);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x65f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65f6('0x1'));var jsonpatch=require(_0x65f6('0x2'));var rp=require(_0x65f6('0x3'));var moment=require(_0x65f6('0x4'));var BPromise=require(_0x65f6('0x5'));var Mustache=require('mustache');var util=require(_0x65f6('0x6'));var path=require('path');var sox=require(_0x65f6('0x7'));var csv=require(_0x65f6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x8'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var authService=require('../../components/auth/service');var hardwareService=require(_0x65f6('0xe'));var Redis=require(_0x65f6('0xf'));var qs=require(_0x65f6('0x10'));var logger=require(_0x65f6('0x11'))('api');var utils=require(_0x65f6('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x65f6('0x13')]=_['defaults'](config[_0x65f6('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x65f6('0x14'))(new Redis(config[_0x65f6('0x13')]));require(_0x65f6('0x15'))[_0x65f6('0x16')](socket);function respondWithStatusCode(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xcc;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x17')](_0x1d29fd);}return _0x369f96[_0x65f6('0x18')](_0x1d29fd)[_0x65f6('0x19')]();};}function respondWithResult(_0x59154e,_0x19b9ff){_0x19b9ff=_0x19b9ff||0xc8;return function(_0x49a913){if(_0x49a913){return _0x59154e['status'](_0x19b9ff)[_0x65f6('0x1a')](_0x49a913);}};}function respondWithFilteredResult(_0x5c69f8,_0x37330d){return function(_0x1c955c){if(_0x1c955c){var _0x1b1cbb=_0x1c955c['count'],_0x1f974c=_0x37330d['offset'],_0xc8660c=_0x37330d[_0x65f6('0x1b')]+_0x37330d['limit'],_0x18380e;if(_0xc8660c>=_0x1b1cbb){_0xc8660c=_0x1b1cbb;_0x18380e=0xc8;}else{_0x18380e=0xce;}_0x5c69f8['status'](_0x18380e);return _0x5c69f8['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0xc8660c+'/'+_0x1b1cbb)[_0x65f6('0x1a')](_0x1c955c);}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(){var _0x2774a1=_0x1eeaaa['get']({'plain':!![]});var _0x9d7bb0=_0x65f6('0x22');return db[_0x65f6('0x23')]['destroy']({'where':{'type':_0x9d7bb0,'resourceId':_0x2774a1['id']}})['then'](function(){return _0x1eeaaa;});})['then'](function(){_0xd173f4[_0x65f6('0x18')](0xcc)[_0x65f6('0x19')]();});}};}function handleEntityNotFound(_0x4b2292,_0x296cd9){return function(_0x28f710){if(!_0x28f710){_0x4b2292['sendStatus'](0x194);}return _0x28f710;};}function handleError(_0x325cb4,_0x2bff2b){_0x2bff2b=_0x2bff2b||0x1f4;return function(_0x28d0df){logger['error'](_0x28d0df['stack']);if(_0x28d0df['name']){delete _0x28d0df[_0x65f6('0x24')];}_0x325cb4[_0x65f6('0x18')](_0x2bff2b)[_0x65f6('0x25')](_0x28d0df);};}exports[_0x65f6('0x26')]=function(_0x518cac,_0x14a387){var _0x144e55={},_0x4ace4c={},_0x4ea23d={'count':0x0,'rows':[]};var _0x154cbd=db[_0x65f6('0x27')]['rawAttributes'];_0x4ace4c['model']=_[_0x65f6('0x28')](_0x154cbd);_0x4ace4c[_0x65f6('0x29')]=_[_0x65f6('0x28')](_0x518cac[_0x65f6('0x29')]);_0x4ace4c[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](_0x4ace4c['model'],_0x4ace4c[_0x65f6('0x29')]);_0x144e55[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x4ace4c['model'],qs[_0x65f6('0x2d')](_0x518cac[_0x65f6('0x29')][_0x65f6('0x2d')]));_0x144e55[_0x65f6('0x2c')]=_0x144e55[_0x65f6('0x2c')][_0x65f6('0x2e')]?_0x144e55['attributes']:_0x4ace4c[_0x65f6('0x2f')];if(!_0x518cac[_0x65f6('0x29')]['hasOwnProperty'](_0x65f6('0x30'))){_0x144e55['limit']=qs[_0x65f6('0x31')](_0x518cac['query'][_0x65f6('0x31')]);_0x144e55[_0x65f6('0x1b')]=qs['offset'](_0x518cac[_0x65f6('0x29')][_0x65f6('0x1b')]);}_0x144e55[_0x65f6('0x32')]=qs['sort'](_0x518cac['query'][_0x65f6('0x33')]);_0x144e55['where']=qs[_0x65f6('0x2a')](_['pick'](_0x518cac[_0x65f6('0x29')],_0x4ace4c[_0x65f6('0x2a')]));if(_0x518cac['query'][_0x65f6('0x34')]){_0x144e55['where']=_['merge'](_0x144e55[_0x65f6('0x35')],{'$or':_[_0x65f6('0x36')](_0x154cbd,function(_0x413956){if(_0x413956[_0x65f6('0x37')][_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x1a55da={};_0x1a55da[_0x413956[_0x65f6('0x3a')]]={'$like':'%'+_0x518cac['query'][_0x65f6('0x34')]+'%'};return _0x1a55da;}})});}_0x144e55=_['merge']({},_0x144e55,_0x518cac[_0x65f6('0x3b')]);var _0xa4394a={'where':_0x144e55[_0x65f6('0x35')]};return db[_0x65f6('0x27')]['count'](_0xa4394a)[_0x65f6('0x21')](function(_0x1d6421){_0x4ea23d[_0x65f6('0x3c')]=_0x1d6421;if(_0x518cac[_0x65f6('0x29')][_0x65f6('0x3d')]){_0x144e55[_0x65f6('0x3e')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3f')](_0x144e55);})[_0x65f6('0x21')](function(_0x5d8e48){_0x4ea23d[_0x65f6('0x40')]=_0x5d8e48;return _0x4ea23d;})[_0x65f6('0x21')](respondWithFilteredResult(_0x14a387,_0x144e55))[_0x65f6('0x41')](handleError(_0x14a387,null));};exports[_0x65f6('0x42')]=function(_0x83e2d9,_0x1ac040){var _0xe0b72d={'raw':![],'where':{'id':_0x83e2d9[_0x65f6('0x43')]['id']}},_0x2e91e8={};_0x2e91e8[_0x65f6('0x2f')]=_[_0x65f6('0x28')](db[_0x65f6('0x27')][_0x65f6('0x44')]);_0x2e91e8[_0x65f6('0x29')]=_[_0x65f6('0x28')](_0x83e2d9[_0x65f6('0x29')]);_0x2e91e8['filters']=_[_0x65f6('0x2b')](_0x2e91e8[_0x65f6('0x2f')],_0x2e91e8[_0x65f6('0x29')]);_0xe0b72d[_0x65f6('0x2c')]=_['intersection'](_0x2e91e8[_0x65f6('0x2f')],qs[_0x65f6('0x2d')](_0x83e2d9[_0x65f6('0x29')]['fields']));_0xe0b72d[_0x65f6('0x2c')]=_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2e')]?_0xe0b72d[_0x65f6('0x2c')]:_0x2e91e8['model'];if(_0x83e2d9[_0x65f6('0x29')]['includeAll']){_0xe0b72d[_0x65f6('0x3e')]=[{'all':!![]}];}_0xe0b72d=_[_0x65f6('0x45')]({},_0xe0b72d,_0x83e2d9['options']);return db[_0x65f6('0x27')]['find'](_0xe0b72d)[_0x65f6('0x21')](handleEntityNotFound(_0x1ac040,null))[_0x65f6('0x21')](respondWithResult(_0x1ac040,null))[_0x65f6('0x41')](handleError(_0x1ac040,null));};exports[_0x65f6('0x46')]=function(_0x3ec18f,_0x3837b2){return db['SquareProject']['create'](_0x3ec18f[_0x65f6('0x47')],{})[_0x65f6('0x21')](function(_0x3b647a){var _0x1e9e29=_0x3ec18f[_0x65f6('0x48')][_0x65f6('0x49')]({'plain':!![]});if(!_0x1e9e29)throw new Error(_0x65f6('0x4a'));if(_0x1e9e29[_0x65f6('0x4b')]===_0x65f6('0x48')){var _0x517a47=_0x3b647a[_0x65f6('0x49')]({'plain':!![]});var _0x8ecdca=_0x65f6('0x22');return db['UserProfileSection'][_0x65f6('0x4c')]({'where':{'name':_0x8ecdca,'userProfileId':_0x1e9e29[_0x65f6('0x4d')]},'raw':!![]})['then'](function(_0x22d745){if(_0x22d745&&_0x22d745[_0x65f6('0x4e')]===0x0){return db['UserProfileResource'][_0x65f6('0x46')]({'name':_0x517a47['name'],'resourceId':_0x517a47['id'],'type':_0x22d745[_0x65f6('0x24')],'sectionId':_0x22d745['id']},{})[_0x65f6('0x21')](function(){return _0x3b647a;});}else{return _0x3b647a;}})[_0x65f6('0x41')](function(_0x4b9f0a){logger[_0x65f6('0x4f')](_0x65f6('0x50'),_0x4b9f0a);throw _0x4b9f0a;});}return _0x3b647a;})['then'](respondWithResult(_0x3837b2,0xc9))[_0x65f6('0x41')](handleError(_0x3837b2,null));};exports[_0x65f6('0x51')]=function(_0x48a2ed,_0x34d6a9){if(_0x48a2ed[_0x65f6('0x47')]['id']){delete _0x48a2ed[_0x65f6('0x47')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x4c')]({'where':{'id':_0x48a2ed[_0x65f6('0x43')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x34d6a9,null))[_0x65f6('0x21')](saveUpdates(_0x48a2ed['body'],null))['then'](respondWithResult(_0x34d6a9,null))['catch'](handleError(_0x34d6a9,null));};exports[_0x65f6('0x20')]=function(_0x2091f1,_0x111a8a){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x2091f1[_0x65f6('0x43')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x111a8a,null))[_0x65f6('0x21')](removeEntity(_0x111a8a,null))['catch'](handleError(_0x111a8a,null));};exports[_0x65f6('0x52')]=function(_0x2eb08f,_0x289f8f,_0x4e289e){return db['SquareProject'][_0x65f6('0x4c')]({'where':{'id':_0x2eb08f[_0x65f6('0x43')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x289f8f,null))[_0x65f6('0x21')](function(_0x2a76b3){if(_0x2a76b3){return _0x2a76b3[_0x65f6('0x52')](_0x2eb08f[_0x65f6('0x47')][_0x65f6('0x53')],_[_0x65f6('0x54')](_0x2eb08f[_0x65f6('0x47')],[_0x65f6('0x53'),'id'])||{});}})[_0x65f6('0x21')](respondWithResult(_0x289f8f,null))[_0x65f6('0x41')](handleError(_0x289f8f,null));};exports[_0x65f6('0x55')]=function(_0x5ba9c6,_0x47610a,_0x37d527){var _0x42a805;return db['SquareProject'][_0x65f6('0x4c')]({'where':{'id':_0x5ba9c6[_0x65f6('0x43')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x47610a,null))[_0x65f6('0x21')](function(_0x4ef333){if(_0x4ef333){return _0x4ef333[_0x65f6('0x55')](_0x5ba9c6[_0x65f6('0x29')][_0x65f6('0x53')])[_0x65f6('0x21')](function(_0x553ff0){if(_[_0x65f6('0x56')](_0x5ba9c6[_0x65f6('0x29')]['ids'])){for(var _0x28682b=0x0;_0x28682b<_0x5ba9c6[_0x65f6('0x29')][_0x65f6('0x53')]['length'];_0x28682b+=0x1){socket[_0x65f6('0x57')](_0x65f6('0x58'),{'UserId':_0x5ba9c6[_0x65f6('0x29')][_0x65f6('0x53')][_0x28682b],'SquareProjectId':_0x5ba9c6[_0x65f6('0x43')]['id']});}}else{socket[_0x65f6('0x57')]('userSquareProject:remove',{'UserId':_0x5ba9c6['query']['ids'],'SquareProjectId':_0x5ba9c6[_0x65f6('0x43')]['id']});}});}})[_0x65f6('0x21')](respondWithStatusCode(_0x47610a,null))[_0x65f6('0x41')](handleError(_0x47610a,null));};exports[_0x65f6('0x59')]=function(_0xab6f0,_0x304cf9,_0x4c5cd2){var _0xfbfebc={};var _0x1d1532={};var _0x54b569;var _0x225aeb;return db[_0x65f6('0x27')][_0x65f6('0x5a')]({'where':{'id':_0xab6f0['params']['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x304cf9,null))[_0x65f6('0x21')](function(_0x4e83dc){if(_0x4e83dc){_0x54b569=_0x4e83dc;_0x1d1532[_0x65f6('0x2f')]=_[_0x65f6('0x28')](db[_0x65f6('0x5b')][_0x65f6('0x44')]);_0x1d1532[_0x65f6('0x29')]=_[_0x65f6('0x28')](_0xab6f0[_0x65f6('0x29')]);_0x1d1532['filters']=_['intersection'](_0x1d1532[_0x65f6('0x2f')],_0x1d1532[_0x65f6('0x29')]);_0xfbfebc['attributes']=_[_0x65f6('0x2b')](_0x1d1532['model'],qs[_0x65f6('0x2d')](_0xab6f0['query'][_0x65f6('0x2d')]));_0xfbfebc[_0x65f6('0x2c')]=_0xfbfebc[_0x65f6('0x2c')][_0x65f6('0x2e')]?_0xfbfebc[_0x65f6('0x2c')]:_0x1d1532[_0x65f6('0x2f')];_0xfbfebc[_0x65f6('0x32')]=qs[_0x65f6('0x33')](_0xab6f0[_0x65f6('0x29')]['sort']);_0xfbfebc['where']=qs[_0x65f6('0x2a')](_[_0x65f6('0x5c')](_0xab6f0[_0x65f6('0x29')],_0x1d1532['filters']));if(_0xab6f0['query'][_0x65f6('0x34')]){_0xfbfebc[_0x65f6('0x35')]=_[_0x65f6('0x45')](_0xfbfebc[_0x65f6('0x35')],{'$or':_[_0x65f6('0x36')](_0xfbfebc[_0x65f6('0x2c')],function(_0x522d32){var _0x4f42ae={};_0x4f42ae[_0x522d32]={'$like':'%'+_0xab6f0[_0x65f6('0x29')][_0x65f6('0x34')]+'%'};return _0x4f42ae;})});}_0xfbfebc=_['merge']({},_0xfbfebc,_0xab6f0[_0x65f6('0x3b')]);return _0x54b569['getUsers'](_0xfbfebc);}})[_0x65f6('0x21')](function(_0x3e17d2){if(_0x3e17d2){_0x225aeb=_0x3e17d2[_0x65f6('0x2e')];if(!_0xab6f0[_0x65f6('0x29')]['hasOwnProperty'](_0x65f6('0x30'))){_0xfbfebc[_0x65f6('0x31')]=qs[_0x65f6('0x31')](_0xab6f0['query']['limit']);_0xfbfebc[_0x65f6('0x1b')]=qs['offset'](_0xab6f0[_0x65f6('0x29')][_0x65f6('0x1b')]);}return _0x54b569[_0x65f6('0x59')](_0xfbfebc);}})[_0x65f6('0x21')](function(_0x512776){if(_0x512776){return _0x512776?{'count':_0x225aeb,'rows':_0x512776}:null;}})['then'](respondWithResult(_0x304cf9,null))['catch'](handleError(_0x304cf9,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index e0aa185..874b646 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 _0xad22=['SquareProject','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x146562,_0x8c4377){var _0x3ce33d=function(_0x4c5135){while(--_0x4c5135){_0x146562['push'](_0x146562['shift']());}};_0x3ce33d(++_0x8c4377);}(_0xad22,0x90));var _0x2ad2=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0xad22[_0x2ec2bf];return _0x2c279c;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0x2ad2('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2ad2('0x1'),'afterUpdate':_0x2ad2('0x2'),'afterDestroy':_0x2ad2('0x3')};function emitEvent(_0x21c697){return function(_0x48b4db,_0x490fa3,_0x53f1dc){SquareProjectEvents[_0x2ad2('0x4')](_0x21c697+':'+_0x48b4db['id'],_0x48b4db);SquareProjectEvents['emit'](_0x21c697,_0x48b4db);_0x53f1dc(null);};}for(var e in events){if(events[_0x2ad2('0x5')](e)){var event=events[e];SquareProject[_0x2ad2('0x6')](e,emitEvent(event));}}module[_0x2ad2('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x7d69=['events','../../mysqldb','setMaxListeners','remove','emit','hook'];(function(_0x1e58a7,_0x1f2206){var _0x11ff56=function(_0x3774f7){while(--_0x3774f7){_0x1e58a7['push'](_0x1e58a7['shift']());}};_0x11ff56(++_0x1f2206);}(_0x7d69,0xf0));var _0x97d6=function(_0x2380cd,_0x2969e6){_0x2380cd=_0x2380cd-0x0;var _0x23470f=_0x7d69[_0x2380cd];return _0x23470f;};'use strict';var EventEmitter=require(_0x97d6('0x0'));var SquareProject=require(_0x97d6('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x97d6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x97d6('0x3')};function emitEvent(_0x4bb5a4){return function(_0x4bc066,_0x5494e3,_0x3a2389){SquareProjectEvents['emit'](_0x4bb5a4+':'+_0x4bc066['id'],_0x4bc066);SquareProjectEvents[_0x97d6('0x4')](_0x4bb5a4,_0x4bc066);_0x3a2389(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x97d6('0x5')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 4ee2f53..2ee8f79 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 _0x8175=['exports','define','SquareProject','square_projects','lodash','util','moment','bluebird','request-promise','./squareProject.attributes'];(function(_0x580919,_0x2c3ea5){var _0x227c03=function(_0x2bb30d){while(--_0x2bb30d){_0x580919['push'](_0x580919['shift']());}};_0x227c03(++_0x2c3ea5);}(_0x8175,0x1d0));var _0x5817=function(_0x211087,_0x354fdd){_0x211087=_0x211087-0x0;var _0x2a581f=_0x8175[_0x211087];return _0x2a581f;};'use strict';var _=require(_0x5817('0x0'));var util=require(_0x5817('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5817('0x2'));var BPromise=require(_0x5817('0x3'));var rp=require(_0x5817('0x4'));var attributes=require(_0x5817('0x5'));module[_0x5817('0x6')]=function(_0x4cc4c5,_0x681e87){return _0x4cc4c5[_0x5817('0x7')](_0x5817('0x8'),attributes,{'tableName':_0x5817('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe252=['lodash','util','../../config/logger','api','bluebird','request-promise','./squareProject.attributes','exports','square_projects'];(function(_0x247df0,_0x17953b){var _0x1c36ee=function(_0x399691){while(--_0x399691){_0x247df0['push'](_0x247df0['shift']());}};_0x1c36ee(++_0x17953b);}(_0xe252,0x18c));var _0x2e25=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xe252[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x2e25('0x0'));var util=require(_0x2e25('0x1'));var logger=require(_0x2e25('0x2'))(_0x2e25('0x3'));var moment=require('moment');var BPromise=require(_0x2e25('0x4'));var rp=require(_0x2e25('0x5'));var attributes=require(_0x2e25('0x6'));module[_0x2e25('0x7')]=function(_0xfd2176,_0x2dc3f7){return _0xfd2176['define']('SquareProject',attributes,{'tableName':_0x2e25('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 40b86cf..749507a 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 _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4068f8,_0x567ed2){var _0x1aac2d=function(_0x47762f){while(--_0x47762f){_0x4068f8['push'](_0x4068f8['shift']());}};_0x1aac2d(++_0x567ed2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x26e4f2,_0x3b5185){var _0x2d3311=function(_0x5a21fa){while(--_0x5a21fa){_0x26e4f2['push'](_0x26e4f2['shift']());}};_0x2d3311(++_0x3b5185);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 04273ed..bfe8344 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 _0x342e=['removeListener','register','./squareProject.events','save','remove'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0x342e,0xde));var _0xe342=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0x342e[_0x3ab353];return _0x1e2285;};'use strict';var SquareProjectEvents=require(_0xe342('0x0'));var events=[_0xe342('0x1'),_0xe342('0x2'),'update'];function createListener(_0x5d2113,_0x15d20f){return function(_0x4070d1){_0x15d20f['emit'](_0x5d2113,_0x4070d1);};}function removeListener(_0x509778,_0x349dc1){return function(){SquareProjectEvents[_0xe342('0x3')](_0x509778,_0x349dc1);};}exports[_0xe342('0x4')]=function(_0x590e9){for(var _0x164e21=0x0,_0x5e643a=events['length'];_0x164e21<_0x5e643a;_0x164e21++){var _0x3457ac=events[_0x164e21];var _0x36bb18=createListener('squareProject:'+_0x3457ac,_0x590e9);SquareProjectEvents['on'](_0x3457ac,_0x36bb18);}}; \ No newline at end of file +var _0xbec5=['emit','removeListener','register','length','squareProject:','./squareProject.events','save','update'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xbec5,0xe5));var _0x5bec=function(_0x2ad008,_0x45c253){_0x2ad008=_0x2ad008-0x0;var _0x4538cf=_0xbec5[_0x2ad008];return _0x4538cf;};'use strict';var SquareProjectEvents=require(_0x5bec('0x0'));var events=[_0x5bec('0x1'),'remove',_0x5bec('0x2')];function createListener(_0x38c81a,_0x276b9e){return function(_0x3859a1){_0x276b9e[_0x5bec('0x3')](_0x38c81a,_0x3859a1);};}function removeListener(_0x4ee982,_0x1f8933){return function(){SquareProjectEvents[_0x5bec('0x4')](_0x4ee982,_0x1f8933);};}exports[_0x5bec('0x5')]=function(_0x4aaac6){for(var _0x3ed67a=0x0,_0x28a427=events[_0x5bec('0x6')];_0x3ed67a<_0x28a427;_0x3ed67a++){var _0x406e65=events[_0x3ed67a];var _0x43d96e=createListener(_0x5bec('0x7')+_0x406e65,_0x4aaac6);SquareProjectEvents['on'](_0x406e65,_0x43d96e);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 7dd8af9..473cd9f 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 _0xd488=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/download','download','post','create','put','delete','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x11ca5a,_0x375585){var _0x247f6b=function(_0x5e624b){while(--_0x5e624b){_0x11ca5a['push'](_0x11ca5a['shift']());}};_0x247f6b(++_0x375585);}(_0xd488,0xe1));var _0x8d48=function(_0x52eb16,_0x89c3d8){_0x52eb16=_0x52eb16-0x0;var _0x382d3f=_0xd488[_0x52eb16];return _0x382d3f;};'use strict';var multer=require(_0x8d48('0x0'));var util=require('util');var path=require(_0x8d48('0x1'));var timeout=require(_0x8d48('0x2'));var express=require(_0x8d48('0x3'));var router=express['Router']();var auth=require(_0x8d48('0x4'));var interaction=require(_0x8d48('0x5'));var config=require(_0x8d48('0x6'));var controller=require('./squareRecording.controller');router[_0x8d48('0x7')]('/',auth[_0x8d48('0x8')](),controller['index']);router['get']('/:id',auth[_0x8d48('0x8')](),controller[_0x8d48('0x9')]);router[_0x8d48('0x7')](_0x8d48('0xa'),auth[_0x8d48('0x8')](),controller[_0x8d48('0xb')]);router[_0x8d48('0xc')]('/',auth[_0x8d48('0x8')](),controller[_0x8d48('0xd')]);router[_0x8d48('0xe')]('/:id',auth[_0x8d48('0x8')](),controller['update']);router[_0x8d48('0xf')](_0x8d48('0x10'),auth['isAuthenticated'](),controller[_0x8d48('0x11')]);module[_0x8d48('0x12')]=router; \ No newline at end of file +var _0x5908=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','isAuthenticated','index','get','/:id','show','/:id/download','post','create','update','delete','destroy','multer'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x5908,0x84));var _0x8590=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x5908[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0x8590('0x0'));var util=require(_0x8590('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8590('0x2'));var router=express[_0x8590('0x3')]();var auth=require(_0x8590('0x4'));var interaction=require(_0x8590('0x5'));var config=require(_0x8590('0x6'));var controller=require(_0x8590('0x7'));router['get']('/',auth[_0x8590('0x8')](),controller[_0x8590('0x9')]);router[_0x8590('0xa')](_0x8590('0xb'),auth[_0x8590('0x8')](),controller[_0x8590('0xc')]);router[_0x8590('0xa')](_0x8590('0xd'),auth[_0x8590('0x8')](),controller['download']);router[_0x8590('0xe')]('/',auth[_0x8590('0x8')](),controller[_0x8590('0xf')]);router['put'](_0x8590('0xb'),auth[_0x8590('0x8')](),controller[_0x8590('0x10')]);router[_0x8590('0x11')](_0x8590('0xb'),auth[_0x8590('0x8')](),controller[_0x8590('0x12')]);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 862f233..6b4ee04 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 _0x2adb=['exports','STRING','sequelize'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x2adb,0x9e));var _0xb2ad=function(_0x1f8f48,_0x3b9679){_0x1f8f48=_0x1f8f48-0x0;var _0x154c85=_0x2adb[_0x1f8f48];return _0x154c85;};'use strict';var Sequelize=require(_0xb2ad('0x0'));module[_0xb2ad('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb2ad('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb2ad('0x2')]},'extension':{'type':Sequelize[_0xb2ad('0x2')]},'priority':{'type':Sequelize[_0xb2ad('0x2')]},'accountcode':{'type':Sequelize[_0xb2ad('0x2')]},'dnid':{'type':Sequelize[_0xb2ad('0x2')]},'projectName':{'type':Sequelize[_0xb2ad('0x2')]},'saveName':{'type':Sequelize[_0xb2ad('0x2')]},'filename':{'type':Sequelize[_0xb2ad('0x2')]},'savePath':{'type':Sequelize[_0xb2ad('0x2')]}}; \ No newline at end of file +var _0xc328=['exports','STRING'];(function(_0xf2efae,_0x307737){var _0x241311=function(_0x5ba928){while(--_0x5ba928){_0xf2efae['push'](_0xf2efae['shift']());}};_0x241311(++_0x307737);}(_0xc328,0x170));var _0x8c32=function(_0x5d0a9e,_0xc78b27){_0x5d0a9e=_0x5d0a9e-0x0;var _0x5cb880=_0xc328[_0x5d0a9e];return _0x5cb880;};'use strict';var Sequelize=require('sequelize');module[_0x8c32('0x0')]={'uniqueid':{'type':Sequelize[_0x8c32('0x1')]},'callerid':{'type':Sequelize[_0x8c32('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8c32('0x1')]},'extension':{'type':Sequelize[_0x8c32('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8c32('0x1')]},'dnid':{'type':Sequelize[_0x8c32('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x8c32('0x1')]},'filename':{'type':Sequelize[_0x8c32('0x1')]},'savePath':{'type':Sequelize[_0x8c32('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index e95dad3..e8464ab 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 _0x9f9b=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','map','type','VIRTUAL','field','merge','includeAll','include','findAll','then','catch','show','params','options','create','body','find','download','../../components/encryptor','uniqueid','savePath','filename','format','value','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','stack','name','index','SquareRecording','rawAttributes'];(function(_0x581c74,_0x98e9e2){var _0x2ed19e=function(_0x5a67cb){while(--_0x5a67cb){_0x581c74['push'](_0x581c74['shift']());}};_0x2ed19e(++_0x98e9e2);}(_0x9f9b,0xdb));var _0xb9f9=function(_0x2fb37d,_0x5ac84d){_0x2fb37d=_0x2fb37d-0x0;var _0x287bd9=_0x9f9b[_0x2fb37d];return _0x287bd9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9f9('0x0'));var rimraf=require(_0xb9f9('0x1'));var zipdir=require(_0xb9f9('0x2'));var jsonpatch=require(_0xb9f9('0x3'));var rp=require(_0xb9f9('0x4'));var moment=require('moment');var BPromise=require(_0xb9f9('0x5'));var Mustache=require(_0xb9f9('0x6'));var util=require(_0xb9f9('0x7'));var path=require(_0xb9f9('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb9f9('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb9f9('0xa'));var crypto=require(_0xb9f9('0xb'));var jsforce=require(_0xb9f9('0xc'));var deskjs=require(_0xb9f9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb9f9('0xe'));var Papa=require(_0xb9f9('0xf'));var authService=require(_0xb9f9('0x10'));var hardwareService=require(_0xb9f9('0x11'));var Redis=require(_0xb9f9('0x12'));var qs=require(_0xb9f9('0x13'));var logger=require(_0xb9f9('0x14'))(_0xb9f9('0x15'));var utils=require(_0xb9f9('0x16'));var config=require(_0xb9f9('0x17'));var db=require(_0xb9f9('0x18'))['db'];function respondWithStatusCode(_0x382500,_0x69b6a6){_0x69b6a6=_0x69b6a6||0xcc;return function(_0x31cf84){if(_0x31cf84){return _0x382500[_0xb9f9('0x19')](_0x69b6a6);}return _0x382500[_0xb9f9('0x1a')](_0x69b6a6)[_0xb9f9('0x1b')]();};}function respondWithResult(_0x53a064,_0x37b57c){_0x37b57c=_0x37b57c||0xc8;return function(_0x4c9159){if(_0x4c9159){return _0x53a064[_0xb9f9('0x1a')](_0x37b57c)[_0xb9f9('0x1c')](_0x4c9159);}};}function respondWithFilteredResult(_0x285fbb,_0x2d2982){return function(_0x53842d){if(_0x53842d){var _0x503a3e=_0x53842d[_0xb9f9('0x1d')],_0x1ab48f=_0x2d2982[_0xb9f9('0x1e')],_0x1a2a33=_0x2d2982['offset']+_0x2d2982[_0xb9f9('0x1f')],_0x184be7;if(_0x1a2a33>=_0x503a3e){_0x1a2a33=_0x503a3e;_0x184be7=0xc8;}else{_0x184be7=0xce;}_0x285fbb['status'](_0x184be7);return _0x285fbb[_0xb9f9('0x20')](_0xb9f9('0x21'),_0x1ab48f+'-'+_0x1a2a33+'/'+_0x503a3e)[_0xb9f9('0x1c')](_0x53842d);}return null;};}function patchUpdates(_0x13d530){return function(_0x5e2765){try{jsonpatch[_0xb9f9('0x22')](_0x5e2765,_0x13d530,!![]);}catch(_0x404b6c){return BPromise[_0xb9f9('0x23')](_0x404b6c);}return _0x5e2765[_0xb9f9('0x24')]();};}function saveUpdates(_0xdaf88f,_0x167959){return function(_0x4482f9){if(_0x4482f9){return _0x4482f9['update'](_0xdaf88f)['then'](function(_0x44b25c){return _0x44b25c;});}return null;};}function removeEntity(_0x31119b,_0x1359a1){return function(_0x58acf1){if(_0x58acf1){return _0x58acf1['destroy']()['then'](function(){_0x31119b[_0xb9f9('0x1a')](0xcc)[_0xb9f9('0x1b')]();});}};}function handleEntityNotFound(_0xf29d14,_0x53c239){return function(_0x511a5e){if(!_0x511a5e){_0xf29d14[_0xb9f9('0x19')](0x194);}return _0x511a5e;};}function handleError(_0x475a11,_0x4dd050){_0x4dd050=_0x4dd050||0x1f4;return function(_0x4b464a){logger['error'](_0x4b464a[_0xb9f9('0x25')]);if(_0x4b464a[_0xb9f9('0x26')]){delete _0x4b464a['name'];}_0x475a11[_0xb9f9('0x1a')](_0x4dd050)['send'](_0x4b464a);};}exports[_0xb9f9('0x27')]=function(_0x35edf,_0x2bb021){var _0x3ea06d={},_0x24ff1c={},_0x1ee625={'count':0x0,'rows':[]};var _0x3cfd16=db[_0xb9f9('0x28')][_0xb9f9('0x29')];_0x24ff1c[_0xb9f9('0x2a')]=_[_0xb9f9('0x2b')](_0x3cfd16);_0x24ff1c[_0xb9f9('0x2c')]=_[_0xb9f9('0x2b')](_0x35edf[_0xb9f9('0x2c')]);_0x24ff1c[_0xb9f9('0x2d')]=_[_0xb9f9('0x2e')](_0x24ff1c['model'],_0x24ff1c[_0xb9f9('0x2c')]);_0x3ea06d[_0xb9f9('0x2f')]=_[_0xb9f9('0x2e')](_0x24ff1c[_0xb9f9('0x2a')],qs[_0xb9f9('0x30')](_0x35edf['query']['fields']));_0x3ea06d[_0xb9f9('0x2f')]=_0x3ea06d[_0xb9f9('0x2f')][_0xb9f9('0x31')]?_0x3ea06d['attributes']:_0x24ff1c['model'];if(!_0x35edf['query'][_0xb9f9('0x32')](_0xb9f9('0x33'))){_0x3ea06d[_0xb9f9('0x1f')]=qs[_0xb9f9('0x1f')](_0x35edf[_0xb9f9('0x2c')][_0xb9f9('0x1f')]);_0x3ea06d['offset']=qs[_0xb9f9('0x1e')](_0x35edf[_0xb9f9('0x2c')]['offset']);}_0x3ea06d[_0xb9f9('0x34')]=qs['sort'](_0x35edf[_0xb9f9('0x2c')]['sort']);_0x3ea06d[_0xb9f9('0x35')]=qs[_0xb9f9('0x2d')](_[_0xb9f9('0x36')](_0x35edf['query'],_0x24ff1c[_0xb9f9('0x2d')]));if(_0x35edf[_0xb9f9('0x2c')][_0xb9f9('0x37')]){_0x3ea06d[_0xb9f9('0x35')]=_['merge'](_0x3ea06d[_0xb9f9('0x35')],{'$or':_[_0xb9f9('0x38')](_0x3cfd16,function(_0x13c8e7){if(_0x13c8e7[_0xb9f9('0x39')]['key']!==_0xb9f9('0x3a')){var _0xa9cfa2={};_0xa9cfa2[_0x13c8e7[_0xb9f9('0x3b')]]={'$like':'%'+_0x35edf[_0xb9f9('0x2c')][_0xb9f9('0x37')]+'%'};return _0xa9cfa2;}})});}_0x3ea06d=_[_0xb9f9('0x3c')]({},_0x3ea06d,_0x35edf['options']);var _0x5d6f3d={'where':_0x3ea06d[_0xb9f9('0x35')]};return db[_0xb9f9('0x28')][_0xb9f9('0x1d')](_0x5d6f3d)['then'](function(_0x8d4b2f){_0x1ee625['count']=_0x8d4b2f;if(_0x35edf[_0xb9f9('0x2c')][_0xb9f9('0x3d')]){_0x3ea06d[_0xb9f9('0x3e')]=[{'all':!![]}];}return db[_0xb9f9('0x28')][_0xb9f9('0x3f')](_0x3ea06d);})[_0xb9f9('0x40')](function(_0x2e1150){_0x1ee625['rows']=_0x2e1150;return _0x1ee625;})[_0xb9f9('0x40')](respondWithFilteredResult(_0x2bb021,_0x3ea06d))[_0xb9f9('0x41')](handleError(_0x2bb021,null));};exports[_0xb9f9('0x42')]=function(_0x428c26,_0x3a5c07){var _0x5517f3={'raw':!![],'where':{'id':_0x428c26[_0xb9f9('0x43')]['id']}},_0x499f1a={};_0x499f1a[_0xb9f9('0x2a')]=_['keys'](db[_0xb9f9('0x28')][_0xb9f9('0x29')]);_0x499f1a[_0xb9f9('0x2c')]=_[_0xb9f9('0x2b')](_0x428c26[_0xb9f9('0x2c')]);_0x499f1a[_0xb9f9('0x2d')]=_[_0xb9f9('0x2e')](_0x499f1a[_0xb9f9('0x2a')],_0x499f1a[_0xb9f9('0x2c')]);_0x5517f3[_0xb9f9('0x2f')]=_[_0xb9f9('0x2e')](_0x499f1a[_0xb9f9('0x2a')],qs[_0xb9f9('0x30')](_0x428c26[_0xb9f9('0x2c')][_0xb9f9('0x30')]));_0x5517f3['attributes']=_0x5517f3[_0xb9f9('0x2f')][_0xb9f9('0x31')]?_0x5517f3[_0xb9f9('0x2f')]:_0x499f1a['model'];if(_0x428c26['query'][_0xb9f9('0x3d')]){_0x5517f3[_0xb9f9('0x3e')]=[{'all':!![]}];}_0x5517f3=_['merge']({},_0x5517f3,_0x428c26[_0xb9f9('0x44')]);return db['SquareRecording']['find'](_0x5517f3)[_0xb9f9('0x40')](handleEntityNotFound(_0x3a5c07,null))['then'](respondWithResult(_0x3a5c07,null))[_0xb9f9('0x41')](handleError(_0x3a5c07,null));};exports['create']=function(_0x577ec1,_0x4d163d){return db[_0xb9f9('0x28')][_0xb9f9('0x45')](_0x577ec1['body'],{})[_0xb9f9('0x40')](respondWithResult(_0x4d163d,0xc9))[_0xb9f9('0x41')](handleError(_0x4d163d,null));};exports['update']=function(_0x27efd4,_0x190caf){if(_0x27efd4[_0xb9f9('0x46')]['id']){delete _0x27efd4[_0xb9f9('0x46')]['id'];}return db[_0xb9f9('0x28')][_0xb9f9('0x47')]({'where':{'id':_0x27efd4[_0xb9f9('0x43')]['id']}})[_0xb9f9('0x40')](handleEntityNotFound(_0x190caf,null))[_0xb9f9('0x40')](saveUpdates(_0x27efd4[_0xb9f9('0x46')],null))[_0xb9f9('0x40')](respondWithResult(_0x190caf,null))[_0xb9f9('0x41')](handleError(_0x190caf,null));};exports['destroy']=function(_0x1fbc4e,_0x45ffe8){return db[_0xb9f9('0x28')][_0xb9f9('0x47')]({'where':{'id':_0x1fbc4e[_0xb9f9('0x43')]['id']}})[_0xb9f9('0x40')](handleEntityNotFound(_0x45ffe8,null))['then'](removeEntity(_0x45ffe8,null))[_0xb9f9('0x41')](handleError(_0x45ffe8,null));};exports[_0xb9f9('0x48')]=function(_0x1120d4,_0x57d083,_0x5439a1){var _0x251966=require(_0xb9f9('0x49'));var _0x5a3eaa=![];var _0x13c486={};if(_0x1120d4[_0xb9f9('0x2c')]['type']&&_0x1120d4[_0xb9f9('0x2c')][_0xb9f9('0x39')]===_0xb9f9('0x4a')){_0x13c486['uniqueid']=_0x1120d4[_0xb9f9('0x43')]['id'];}else{_0x13c486['id']=_0x1120d4[_0xb9f9('0x43')]['id'];}return db[_0xb9f9('0x28')][_0xb9f9('0x47')]({'where':_0x13c486,'attributes':['id',_0xb9f9('0x4b'),_0xb9f9('0x4c')],'raw':!![]})[_0xb9f9('0x40')](handleEntityNotFound(_0x57d083,null))[_0xb9f9('0x40')](function(_0x1f4a43){if(_0x1f4a43){var _0x3450db=util[_0xb9f9('0x4d')]('%s.cypher',_0x1f4a43[_0xb9f9('0x4e')]);if(fs[_0xb9f9('0x4f')](_0x3450db)){_0x5a3eaa=!![];return _0x251966[_0xb9f9('0x50')](_0x3450db,_0x1f4a43[_0xb9f9('0x4b')],config[_0xb9f9('0x51')][_0xb9f9('0x52')])['then'](function(){return _0x1f4a43;});}return _0x1f4a43;}})[_0xb9f9('0x40')](function(_0x4a89ad){if(_0x4a89ad){if(!fs[_0xb9f9('0x4f')](_0x4a89ad[_0xb9f9('0x4b')])){throw new db['Sequelize'][(_0xb9f9('0x53'))](_0xb9f9('0x54'));}if(_0x4a89ad['filename']){return _0x57d083[_0xb9f9('0x48')](_0x4a89ad['savePath'],_0x4a89ad['filename']+path[_0xb9f9('0x55')](_0x4a89ad[_0xb9f9('0x4b')]),function(){if(_0x5a3eaa){fs[_0xb9f9('0x56')](_0x4a89ad[_0xb9f9('0x4b')]);}});}else{return _0x57d083[_0xb9f9('0x48')](_0x4a89ad[_0xb9f9('0x4b')],function(_0x3cbe12){if(_0x5a3eaa){fs[_0xb9f9('0x56')](_0x4a89ad['savePath']);}});}}})['catch'](handleError(_0x57d083,null));}; \ No newline at end of file +var _0x1cc9=['../../config/environment','../../mysqldb','end','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','SquareRecording','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','show','params','find','create','body','catch','download','uniqueid','savePath','filename','format','%s.cypher','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','papaparse','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x1cc9,0x1f1));var _0x91cc=function(_0x2313e8,_0x332e97){_0x2313e8=_0x2313e8-0x0;var _0x482a35=_0x1cc9[_0x2313e8];return _0x482a35;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x91cc('0x0'));var rimraf=require(_0x91cc('0x1'));var zipdir=require(_0x91cc('0x2'));var jsonpatch=require(_0x91cc('0x3'));var rp=require(_0x91cc('0x4'));var moment=require(_0x91cc('0x5'));var BPromise=require(_0x91cc('0x6'));var Mustache=require(_0x91cc('0x7'));var util=require(_0x91cc('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x91cc('0x9'));var ejs=require(_0x91cc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x91cc('0xb'));var crypto=require(_0x91cc('0xc'));var jsforce=require(_0x91cc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x91cc('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0x91cc('0xf'));var Redis=require('ioredis');var qs=require(_0x91cc('0x10'));var logger=require('../../config/logger')(_0x91cc('0x11'));var utils=require(_0x91cc('0x12'));var config=require(_0x91cc('0x13'));var db=require(_0x91cc('0x14'))['db'];function respondWithStatusCode(_0x17ebf7,_0x5c3b8a){_0x5c3b8a=_0x5c3b8a||0xcc;return function(_0x1756c2){if(_0x1756c2){return _0x17ebf7['sendStatus'](_0x5c3b8a);}return _0x17ebf7['status'](_0x5c3b8a)[_0x91cc('0x15')]();};}function respondWithResult(_0x451241,_0x5319a0){_0x5319a0=_0x5319a0||0xc8;return function(_0x1eddc0){if(_0x1eddc0){return _0x451241[_0x91cc('0x16')](_0x5319a0)[_0x91cc('0x17')](_0x1eddc0);}};}function respondWithFilteredResult(_0x583e22,_0x2ba656){return function(_0x529982){if(_0x529982){var _0x46ea3e=_0x529982[_0x91cc('0x18')],_0x1e23c0=_0x2ba656['offset'],_0x5becf9=_0x2ba656['offset']+_0x2ba656[_0x91cc('0x19')],_0x1b24a7;if(_0x5becf9>=_0x46ea3e){_0x5becf9=_0x46ea3e;_0x1b24a7=0xc8;}else{_0x1b24a7=0xce;}_0x583e22[_0x91cc('0x16')](_0x1b24a7);return _0x583e22[_0x91cc('0x1a')](_0x91cc('0x1b'),_0x1e23c0+'-'+_0x5becf9+'/'+_0x46ea3e)[_0x91cc('0x17')](_0x529982);}return null;};}function patchUpdates(_0x5c1091){return function(_0x2e8dec){try{jsonpatch[_0x91cc('0x1c')](_0x2e8dec,_0x5c1091,!![]);}catch(_0x55cb31){return BPromise[_0x91cc('0x1d')](_0x55cb31);}return _0x2e8dec[_0x91cc('0x1e')]();};}function saveUpdates(_0xf8e911,_0xcce020){return function(_0x3edb0a){if(_0x3edb0a){return _0x3edb0a[_0x91cc('0x1f')](_0xf8e911)[_0x91cc('0x20')](function(_0x39d5c4){return _0x39d5c4;});}return null;};}function removeEntity(_0x55b8c9,_0x4fa38c){return function(_0xc6ad78){if(_0xc6ad78){return _0xc6ad78[_0x91cc('0x21')]()[_0x91cc('0x20')](function(){_0x55b8c9[_0x91cc('0x16')](0xcc)[_0x91cc('0x15')]();});}};}function handleEntityNotFound(_0xd9f311,_0x1a48ca){return function(_0x36461f){if(!_0x36461f){_0xd9f311['sendStatus'](0x194);}return _0x36461f;};}function handleError(_0x2a5538,_0xd122e7){_0xd122e7=_0xd122e7||0x1f4;return function(_0x4c17f0){logger[_0x91cc('0x22')](_0x4c17f0['stack']);if(_0x4c17f0['name']){delete _0x4c17f0['name'];}_0x2a5538[_0x91cc('0x16')](_0xd122e7)[_0x91cc('0x23')](_0x4c17f0);};}exports[_0x91cc('0x24')]=function(_0x356c4e,_0x35ebed){var _0x4e5852={},_0x227253={},_0x57993e={'count':0x0,'rows':[]};var _0x29a985=db[_0x91cc('0x25')][_0x91cc('0x26')];_0x227253[_0x91cc('0x27')]=_[_0x91cc('0x28')](_0x29a985);_0x227253['query']=_[_0x91cc('0x28')](_0x356c4e[_0x91cc('0x29')]);_0x227253[_0x91cc('0x2a')]=_[_0x91cc('0x2b')](_0x227253[_0x91cc('0x27')],_0x227253[_0x91cc('0x29')]);_0x4e5852[_0x91cc('0x2c')]=_[_0x91cc('0x2b')](_0x227253[_0x91cc('0x27')],qs[_0x91cc('0x2d')](_0x356c4e[_0x91cc('0x29')][_0x91cc('0x2d')]));_0x4e5852['attributes']=_0x4e5852[_0x91cc('0x2c')][_0x91cc('0x2e')]?_0x4e5852[_0x91cc('0x2c')]:_0x227253[_0x91cc('0x27')];if(!_0x356c4e[_0x91cc('0x29')][_0x91cc('0x2f')](_0x91cc('0x30'))){_0x4e5852[_0x91cc('0x19')]=qs[_0x91cc('0x19')](_0x356c4e[_0x91cc('0x29')]['limit']);_0x4e5852[_0x91cc('0x31')]=qs[_0x91cc('0x31')](_0x356c4e[_0x91cc('0x29')][_0x91cc('0x31')]);}_0x4e5852['order']=qs['sort'](_0x356c4e[_0x91cc('0x29')][_0x91cc('0x32')]);_0x4e5852['where']=qs['filters'](_[_0x91cc('0x33')](_0x356c4e[_0x91cc('0x29')],_0x227253[_0x91cc('0x2a')]));if(_0x356c4e[_0x91cc('0x29')][_0x91cc('0x34')]){_0x4e5852[_0x91cc('0x35')]=_['merge'](_0x4e5852[_0x91cc('0x35')],{'$or':_[_0x91cc('0x36')](_0x29a985,function(_0x2ef6cd){if(_0x2ef6cd[_0x91cc('0x37')][_0x91cc('0x38')]!==_0x91cc('0x39')){var _0x2559ea={};_0x2559ea[_0x2ef6cd[_0x91cc('0x3a')]]={'$like':'%'+_0x356c4e['query'][_0x91cc('0x34')]+'%'};return _0x2559ea;}})});}_0x4e5852=_[_0x91cc('0x3b')]({},_0x4e5852,_0x356c4e[_0x91cc('0x3c')]);var _0x32d596={'where':_0x4e5852[_0x91cc('0x35')]};return db['SquareRecording'][_0x91cc('0x18')](_0x32d596)[_0x91cc('0x20')](function(_0x28da25){_0x57993e[_0x91cc('0x18')]=_0x28da25;if(_0x356c4e['query'][_0x91cc('0x3d')]){_0x4e5852[_0x91cc('0x3e')]=[{'all':!![]}];}return db[_0x91cc('0x25')][_0x91cc('0x3f')](_0x4e5852);})[_0x91cc('0x20')](function(_0x4d105e){_0x57993e['rows']=_0x4d105e;return _0x57993e;})[_0x91cc('0x20')](respondWithFilteredResult(_0x35ebed,_0x4e5852))['catch'](handleError(_0x35ebed,null));};exports[_0x91cc('0x40')]=function(_0x535030,_0x230101){var _0x315a94={'raw':!![],'where':{'id':_0x535030[_0x91cc('0x41')]['id']}},_0x5d0598={};_0x5d0598['model']=_[_0x91cc('0x28')](db[_0x91cc('0x25')][_0x91cc('0x26')]);_0x5d0598[_0x91cc('0x29')]=_[_0x91cc('0x28')](_0x535030[_0x91cc('0x29')]);_0x5d0598[_0x91cc('0x2a')]=_['intersection'](_0x5d0598[_0x91cc('0x27')],_0x5d0598[_0x91cc('0x29')]);_0x315a94['attributes']=_['intersection'](_0x5d0598[_0x91cc('0x27')],qs['fields'](_0x535030[_0x91cc('0x29')][_0x91cc('0x2d')]));_0x315a94[_0x91cc('0x2c')]=_0x315a94['attributes'][_0x91cc('0x2e')]?_0x315a94[_0x91cc('0x2c')]:_0x5d0598['model'];if(_0x535030[_0x91cc('0x29')][_0x91cc('0x3d')]){_0x315a94[_0x91cc('0x3e')]=[{'all':!![]}];}_0x315a94=_[_0x91cc('0x3b')]({},_0x315a94,_0x535030[_0x91cc('0x3c')]);return db[_0x91cc('0x25')][_0x91cc('0x42')](_0x315a94)[_0x91cc('0x20')](handleEntityNotFound(_0x230101,null))[_0x91cc('0x20')](respondWithResult(_0x230101,null))['catch'](handleError(_0x230101,null));};exports[_0x91cc('0x43')]=function(_0x25324e,_0x2293b6){return db[_0x91cc('0x25')]['create'](_0x25324e[_0x91cc('0x44')],{})['then'](respondWithResult(_0x2293b6,0xc9))[_0x91cc('0x45')](handleError(_0x2293b6,null));};exports[_0x91cc('0x1f')]=function(_0x32a9f,_0x5c5474){if(_0x32a9f[_0x91cc('0x44')]['id']){delete _0x32a9f[_0x91cc('0x44')]['id'];}return db[_0x91cc('0x25')][_0x91cc('0x42')]({'where':{'id':_0x32a9f[_0x91cc('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c5474,null))[_0x91cc('0x20')](saveUpdates(_0x32a9f[_0x91cc('0x44')],null))['then'](respondWithResult(_0x5c5474,null))[_0x91cc('0x45')](handleError(_0x5c5474,null));};exports['destroy']=function(_0x302fed,_0x3f5565){return db[_0x91cc('0x25')][_0x91cc('0x42')]({'where':{'id':_0x302fed['params']['id']}})[_0x91cc('0x20')](handleEntityNotFound(_0x3f5565,null))['then'](removeEntity(_0x3f5565,null))['catch'](handleError(_0x3f5565,null));};exports[_0x91cc('0x46')]=function(_0x58d2eb,_0x451d9a,_0x27bf03){var _0x47b4c9=require('../../components/encryptor');var _0x29ece5=![];var _0x2912a6={};if(_0x58d2eb[_0x91cc('0x29')][_0x91cc('0x37')]&&_0x58d2eb[_0x91cc('0x29')][_0x91cc('0x37')]===_0x91cc('0x47')){_0x2912a6[_0x91cc('0x47')]=_0x58d2eb['params']['id'];}else{_0x2912a6['id']=_0x58d2eb[_0x91cc('0x41')]['id'];}return db[_0x91cc('0x25')][_0x91cc('0x42')]({'where':_0x2912a6,'attributes':['id',_0x91cc('0x48'),_0x91cc('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x451d9a,null))['then'](function(_0x29e091){if(_0x29e091){var _0x325a72=util[_0x91cc('0x4a')](_0x91cc('0x4b'),_0x29e091[_0x91cc('0x4c')]);if(fs[_0x91cc('0x4d')](_0x325a72)){_0x29ece5=!![];return _0x47b4c9[_0x91cc('0x4e')](_0x325a72,_0x29e091[_0x91cc('0x48')],config[_0x91cc('0x4f')][_0x91cc('0x50')])['then'](function(){return _0x29e091;});}return _0x29e091;}})[_0x91cc('0x20')](function(_0x31e780){if(_0x31e780){if(!fs[_0x91cc('0x4d')](_0x31e780[_0x91cc('0x48')])){throw new db[(_0x91cc('0x51'))][(_0x91cc('0x52'))](_0x91cc('0x53'));}if(_0x31e780['filename']){return _0x451d9a[_0x91cc('0x46')](_0x31e780['savePath'],_0x31e780[_0x91cc('0x49')]+path[_0x91cc('0x54')](_0x31e780['savePath']),function(){if(_0x29ece5){fs[_0x91cc('0x55')](_0x31e780[_0x91cc('0x48')]);}});}else{return _0x451d9a[_0x91cc('0x46')](_0x31e780[_0x91cc('0x48')],function(_0x84321a){if(_0x29ece5){fs[_0x91cc('0x55')](_0x31e780[_0x91cc('0x48')]);}});}}})[_0x91cc('0x45')](handleError(_0x451d9a,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index acedb7c..3c4cdc3 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 _0x078c=['./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3ae53c,_0x1f4f95){var _0x5bb784=function(_0x2108b6){while(--_0x2108b6){_0x3ae53c['push'](_0x3ae53c['shift']());}};_0x5bb784(++_0x1f4f95);}(_0x078c,0x19f));var _0xc078=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0x078c[_0x35b7d4];return _0x4e8cee;};'use strict';var _=require(_0xc078('0x0'));var util=require('util');var logger=require(_0xc078('0x1'))(_0xc078('0x2'));var moment=require('moment');var BPromise=require(_0xc078('0x3'));var rp=require(_0xc078('0x4'));var attributes=require(_0xc078('0x5'));module[_0xc078('0x6')]=function(_0x56bf2e,_0x44652d){return _0x56bf2e[_0xc078('0x7')](_0xc078('0x8'),attributes,{'tableName':_0xc078('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x536e=['./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0x536e,0x155));var _0xe536=function(_0x256c49,_0x53f00a){_0x256c49=_0x256c49-0x0;var _0x280282=_0x536e[_0x256c49];return _0x280282;};'use strict';var _=require(_0xe536('0x0'));var util=require(_0xe536('0x1'));var logger=require(_0xe536('0x2'))(_0xe536('0x3'));var moment=require(_0xe536('0x4'));var BPromise=require(_0xe536('0x5'));var rp=require(_0xe536('0x6'));var attributes=require(_0xe536('0x7'));module[_0xe536('0x8')]=function(_0x409e01,_0x18d460){return _0x409e01[_0xe536('0x9')](_0xe536('0xa'),attributes,{'tableName':_0xe536('0xb'),'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 b180d74..81574af 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 _0xbeda=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareRecording','create','body','options','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x54faff,_0x9a3b5e){var _0x5a784c=function(_0x3d1147){while(--_0x3d1147){_0x54faff['push'](_0x54faff['shift']());}};_0x5a784c(++_0x9a3b5e);}(_0xbeda,0x1f1));var _0xabed=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xbeda[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0xabed('0x0'));var util=require(_0xabed('0x1'));var moment=require(_0xabed('0x2'));var BPromise=require('bluebird');var rs=require(_0xabed('0x3'));var fs=require('fs');var Redis=require(_0xabed('0x4'));var db=require(_0xabed('0x5'))['db'];var utils=require(_0xabed('0x6'));var logger=require(_0xabed('0x7'))(_0xabed('0x8'));var config=require('../../config/environment');var jayson=require(_0xabed('0x9'));var client=jayson[_0xabed('0xa')][_0xabed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2945bf,_0x257c1a,_0x5d3917){return new BPromise(function(_0x5cfa03,_0x1ff321){return client[_0xabed('0xc')](_0x2945bf,_0x5d3917)[_0xabed('0xd')](function(_0x26ca6c){logger[_0xabed('0xe')](_0xabed('0xf'),_0x257c1a,_0xabed('0x10'));logger[_0xabed('0x11')](_0xabed('0x12'),_0x257c1a,_0xabed('0x10'),JSON['stringify'](_0x26ca6c));if(_0x26ca6c[_0xabed('0x13')]){if(_0x26ca6c[_0xabed('0x13')][_0xabed('0x14')]===0x1f4){logger[_0xabed('0x13')](_0xabed('0xf'),_0x257c1a,_0x26ca6c[_0xabed('0x13')][_0xabed('0x15')]);return _0x1ff321(_0x26ca6c[_0xabed('0x13')]['message']);}logger[_0xabed('0x13')](_0xabed('0xf'),_0x257c1a,_0x26ca6c[_0xabed('0x13')][_0xabed('0x15')]);return _0x5cfa03(_0x26ca6c['error'][_0xabed('0x15')]);}else{logger[_0xabed('0xe')](_0xabed('0xf'),_0x257c1a,_0xabed('0x10'));_0x5cfa03(_0x26ca6c['result']['message']);}})[_0xabed('0x16')](function(_0x447ced){logger[_0xabed('0x13')](_0xabed('0xf'),_0x257c1a,_0x447ced);_0x1ff321(_0x447ced);});});}exports[_0xabed('0x17')]=function(_0x442bd3){var _0x190e30=this;return new Promise(function(_0x2c93df,_0xd310f2){return db['SquareRecording'][_0xabed('0x18')](_0x442bd3[_0xabed('0x19')],{'raw':_0x442bd3[_0xabed('0x1a')]?_0x442bd3[_0xabed('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xabed('0xd')](function(_0x59c283){logger[_0xabed('0xe')](_0xabed('0x17'),_0x442bd3);logger[_0xabed('0x11')](_0xabed('0x17'),_0x442bd3,JSON[_0xabed('0x1b')](_0x59c283));_0x2c93df(_0x59c283);})[_0xabed('0x16')](function(_0xdeaa18){logger[_0xabed('0x13')](_0xabed('0x17'),_0xdeaa18[_0xabed('0x15')],_0x442bd3);_0xd310f2(_0x190e30[_0xabed('0x13')](0x1f4,_0xdeaa18['message']));});});}; \ No newline at end of file +var _0xc559=['raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreateSquareRecording','options'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xc559,0x86));var _0x9c55=function(_0x4ce42b,_0x5a17d7){_0x4ce42b=_0x4ce42b-0x0;var _0x298b6a=_0xc559[_0x4ce42b];return _0x298b6a;};'use strict';var _=require(_0x9c55('0x0'));var util=require(_0x9c55('0x1'));var moment=require(_0x9c55('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c55('0x3'));var fs=require('fs');var Redis=require(_0x9c55('0x4'));var db=require(_0x9c55('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9c55('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9c55('0x7')][_0x9c55('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46bcdf,_0x1aae8a,_0x5ec90d){return new BPromise(function(_0x3ed51d,_0x104703){return client[_0x9c55('0x9')](_0x46bcdf,_0x5ec90d)['then'](function(_0x14297d){logger[_0x9c55('0xa')](_0x9c55('0xb'),_0x1aae8a,_0x9c55('0xc'));logger[_0x9c55('0xd')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x1aae8a,_0x9c55('0xc'),JSON[_0x9c55('0xe')](_0x14297d));if(_0x14297d[_0x9c55('0xf')]){if(_0x14297d['error']['code']===0x1f4){logger[_0x9c55('0xf')]('SquareRecording,\x20%s,\x20%s',_0x1aae8a,_0x14297d[_0x9c55('0xf')]['message']);return _0x104703(_0x14297d['error'][_0x9c55('0x10')]);}logger[_0x9c55('0xf')](_0x9c55('0xb'),_0x1aae8a,_0x14297d['error']['message']);return _0x3ed51d(_0x14297d['error'][_0x9c55('0x10')]);}else{logger['info'](_0x9c55('0xb'),_0x1aae8a,_0x9c55('0xc'));_0x3ed51d(_0x14297d['result'][_0x9c55('0x10')]);}})[_0x9c55('0x11')](function(_0x17bbcd){logger[_0x9c55('0xf')]('SquareRecording,\x20%s,\x20%s',_0x1aae8a,_0x17bbcd);_0x104703(_0x17bbcd);});});}exports[_0x9c55('0x12')]=function(_0x3f649c){var _0x1767d3=this;return new Promise(function(_0x5f1be6,_0x1005c2){return db['SquareRecording']['create'](_0x3f649c['body'],{'raw':_0x3f649c[_0x9c55('0x13')]?_0x3f649c['options'][_0x9c55('0x14')]===undefined?!![]:![]:!![]})[_0x9c55('0x15')](function(_0x2c426e){logger[_0x9c55('0xa')](_0x9c55('0x12'),_0x3f649c);logger['debug']('CreateSquareRecording',_0x3f649c,JSON[_0x9c55('0xe')](_0x2c426e));_0x5f1be6(_0x2c426e);})[_0x9c55('0x11')](function(_0x27e3f0){logger['error']('CreateSquareRecording',_0x27e3f0[_0x9c55('0x10')],_0x3f649c);_0x1005c2(_0x1767d3[_0x9c55('0xf')](0x1f4,_0x27e3f0[_0x9c55('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b7239bf..e2e7724 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 _0xc912=['isAuthenticated','index','/describe','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./squareReport.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc912,0x190));var _0x2c91=function(_0xbee74b,_0x5f1253){_0xbee74b=_0xbee74b-0x0;var _0x19032b=_0xc912[_0xbee74b];return _0x19032b;};'use strict';var multer=require(_0x2c91('0x0'));var util=require(_0x2c91('0x1'));var path=require(_0x2c91('0x2'));var timeout=require(_0x2c91('0x3'));var express=require('express');var router=express[_0x2c91('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2c91('0x5'));var config=require('../../config/environment');var controller=require(_0x2c91('0x6'));router[_0x2c91('0x7')]('/',auth[_0x2c91('0x8')](),controller[_0x2c91('0x9')]);router[_0x2c91('0x7')](_0x2c91('0xa'),auth[_0x2c91('0x8')](),controller['describe']);router['get']('/:id',auth[_0x2c91('0x8')](),controller[_0x2c91('0xb')]);router[_0x2c91('0xc')]('/',auth[_0x2c91('0x8')](),controller[_0x2c91('0xd')]);router['put']('/:id',auth[_0x2c91('0x8')](),controller[_0x2c91('0xe')]);router['delete']('/:id',auth[_0x2c91('0x8')](),controller[_0x2c91('0xf')]);module[_0x2c91('0x10')]=router; \ No newline at end of file +var _0xe3e9=['../../components/auth/service','../../components/interaction/service','./squareReport.controller','get','isAuthenticated','index','/:id','show','create','put','update','multer','util','path','connect-timeout','express','Router'];(function(_0x53a7af,_0x1408a5){var _0x3cc7f6=function(_0x4bf101){while(--_0x4bf101){_0x53a7af['push'](_0x53a7af['shift']());}};_0x3cc7f6(++_0x1408a5);}(_0xe3e9,0x1d6));var _0x9e3e=function(_0x2e6f42,_0x259924){_0x2e6f42=_0x2e6f42-0x0;var _0x594fb9=_0xe3e9[_0x2e6f42];return _0x594fb9;};'use strict';var multer=require(_0x9e3e('0x0'));var util=require(_0x9e3e('0x1'));var path=require(_0x9e3e('0x2'));var timeout=require(_0x9e3e('0x3'));var express=require(_0x9e3e('0x4'));var router=express[_0x9e3e('0x5')]();var auth=require(_0x9e3e('0x6'));var interaction=require(_0x9e3e('0x7'));var config=require('../../config/environment');var controller=require(_0x9e3e('0x8'));router[_0x9e3e('0x9')]('/',auth[_0x9e3e('0xa')](),controller[_0x9e3e('0xb')]);router[_0x9e3e('0x9')]('/describe',auth[_0x9e3e('0xa')](),controller['describe']);router[_0x9e3e('0x9')](_0x9e3e('0xc'),auth[_0x9e3e('0xa')](),controller[_0x9e3e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9e3e('0xe')]);router[_0x9e3e('0xf')](_0x9e3e('0xc'),auth['isAuthenticated'](),controller[_0x9e3e('0x10')]);router['delete'](_0x9e3e('0xc'),auth[_0x9e3e('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 02c1341..11c0b75 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 _0xd6ce=['STRING','sequelize','exports'];(function(_0x5ac2dc,_0x4d5676){var _0x1913ab=function(_0x5ce83a){while(--_0x5ce83a){_0x5ac2dc['push'](_0x5ac2dc['shift']());}};_0x1913ab(++_0x4d5676);}(_0xd6ce,0x127));var _0xed6c=function(_0x114b80,_0x553f86){_0x114b80=_0x114b80-0x0;var _0x4ef82e=_0xd6ce[_0x114b80];return _0x4ef82e;};'use strict';var Sequelize=require(_0xed6c('0x0'));module[_0xed6c('0x1')]={'network':{'type':Sequelize[_0xed6c('0x2')]},'network_script':{'type':Sequelize[_0xed6c('0x2')]},'request':{'type':Sequelize[_0xed6c('0x2')]},'channel':{'type':Sequelize[_0xed6c('0x2')]},'language':{'type':Sequelize[_0xed6c('0x2')]},'type':{'type':Sequelize[_0xed6c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xed6c('0x2')]},'calleridname':{'type':Sequelize[_0xed6c('0x2')]},'callingpres':{'type':Sequelize[_0xed6c('0x2')]},'callingani2':{'type':Sequelize[_0xed6c('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xed6c('0x2')]},'rdnis':{'type':Sequelize[_0xed6c('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xed6c('0x2')]},'enhanced':{'type':Sequelize[_0xed6c('0x2')]},'accountcode':{'type':Sequelize[_0xed6c('0x2')]},'threadid':{'type':Sequelize[_0xed6c('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9f94=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x195a12,_0x558d3c){var _0x5aaf55=function(_0x2fc58b){while(--_0x2fc58b){_0x195a12['push'](_0x195a12['shift']());}};_0x5aaf55(++_0x558d3c);}(_0x9f94,0x1e7));var _0x49f9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9f94[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x49f9('0x0'));module[_0x49f9('0x1')]={'network':{'type':Sequelize[_0x49f9('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x49f9('0x2')]},'language':{'type':Sequelize[_0x49f9('0x2')]},'type':{'type':Sequelize[_0x49f9('0x2')]},'uniqueid':{'type':Sequelize[_0x49f9('0x2')]},'version':{'type':Sequelize[_0x49f9('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x49f9('0x2')]},'callingpres':{'type':Sequelize[_0x49f9('0x2')]},'callingani2':{'type':Sequelize[_0x49f9('0x2')]},'callington':{'type':Sequelize[_0x49f9('0x2')]},'callingtns':{'type':Sequelize[_0x49f9('0x2')]},'dnid':{'type':Sequelize[_0x49f9('0x2')]},'rdnis':{'type':Sequelize[_0x49f9('0x2')]},'context':{'type':Sequelize[_0x49f9('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x49f9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x49f9('0x2')]},'project_name':{'type':Sequelize[_0x49f9('0x2')]},'joinAt':{'type':Sequelize[_0x49f9('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x49f9('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 df5c138..39b24b2 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 _0x3f91=['options','count','includeAll','include','rows','catch','show','create','body','update','params','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','reject','then','destroy','end','error','stack','name','send','SquareReport','rawAttributes','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','map','type','field','filter','merge'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x3f91,0x99));var _0x13f9=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x3f91[_0x3d42d8];return _0x27fc41;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x13f9('0x0'));var zipdir=require(_0x13f9('0x1'));var jsonpatch=require(_0x13f9('0x2'));var rp=require('request-promise');var moment=require(_0x13f9('0x3'));var BPromise=require(_0x13f9('0x4'));var Mustache=require(_0x13f9('0x5'));var util=require(_0x13f9('0x6'));var path=require(_0x13f9('0x7'));var sox=require(_0x13f9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x13f9('0x9'));var squel=require(_0x13f9('0xa'));var crypto=require(_0x13f9('0xb'));var jsforce=require(_0x13f9('0xc'));var deskjs=require(_0x13f9('0xd'));var toCsv=require(_0x13f9('0xe'));var querystring=require(_0x13f9('0xf'));var Papa=require(_0x13f9('0x10'));var authService=require(_0x13f9('0x11'));var hardwareService=require(_0x13f9('0x12'));var Redis=require('ioredis');var qs=require(_0x13f9('0x13'));var logger=require(_0x13f9('0x14'))(_0x13f9('0x15'));var utils=require('../../config/utils');var config=require(_0x13f9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11fbfa,_0x5b6d44){_0x5b6d44=_0x5b6d44||0xcc;return function(_0x43cad3){if(_0x43cad3){return _0x11fbfa[_0x13f9('0x17')](_0x5b6d44);}return _0x11fbfa[_0x13f9('0x18')](_0x5b6d44)['end']();};}function respondWithResult(_0x409bc7,_0x1df23d){_0x1df23d=_0x1df23d||0xc8;return function(_0x469942){if(_0x469942){return _0x409bc7[_0x13f9('0x18')](_0x1df23d)[_0x13f9('0x19')](_0x469942);}};}function respondWithFilteredResult(_0x5e0c6e,_0x594b1e){return function(_0x410b57){if(_0x410b57){var _0x103e32=_0x410b57['count'],_0x2cc4cf=_0x594b1e[_0x13f9('0x1a')],_0x3783c5=_0x594b1e[_0x13f9('0x1a')]+_0x594b1e[_0x13f9('0x1b')],_0x5cbb51;if(_0x3783c5>=_0x103e32){_0x3783c5=_0x103e32;_0x5cbb51=0xc8;}else{_0x5cbb51=0xce;}_0x5e0c6e[_0x13f9('0x18')](_0x5cbb51);return _0x5e0c6e[_0x13f9('0x1c')](_0x13f9('0x1d'),_0x2cc4cf+'-'+_0x3783c5+'/'+_0x103e32)[_0x13f9('0x19')](_0x410b57);}return null;};}function patchUpdates(_0xa33c5){return function(_0x5c2da2){try{jsonpatch['apply'](_0x5c2da2,_0xa33c5,!![]);}catch(_0x11d1d2){return BPromise[_0x13f9('0x1e')](_0x11d1d2);}return _0x5c2da2['save']();};}function saveUpdates(_0x15ecc3,_0x3f5226){return function(_0xf06a13){if(_0xf06a13){return _0xf06a13['update'](_0x15ecc3)[_0x13f9('0x1f')](function(_0x572b64){return _0x572b64;});}return null;};}function removeEntity(_0x2e4c8b,_0x3d48d4){return function(_0x5ae7ab){if(_0x5ae7ab){return _0x5ae7ab[_0x13f9('0x20')]()['then'](function(){_0x2e4c8b[_0x13f9('0x18')](0xcc)[_0x13f9('0x21')]();});}};}function handleEntityNotFound(_0x4bafb6,_0x4f9204){return function(_0x33e514){if(!_0x33e514){_0x4bafb6['sendStatus'](0x194);}return _0x33e514;};}function handleError(_0x275b14,_0x26682e){_0x26682e=_0x26682e||0x1f4;return function(_0x382e6f){logger[_0x13f9('0x22')](_0x382e6f[_0x13f9('0x23')]);if(_0x382e6f[_0x13f9('0x24')]){delete _0x382e6f[_0x13f9('0x24')];}_0x275b14[_0x13f9('0x18')](_0x26682e)[_0x13f9('0x25')](_0x382e6f);};}exports['index']=function(_0x560ffe,_0x3ce583){var _0x76700f={},_0x256ffd={},_0x4107d5={'count':0x0,'rows':[]};var _0x3595e2=db[_0x13f9('0x26')][_0x13f9('0x27')];_0x256ffd[_0x13f9('0x28')]=_['keys'](_0x3595e2);_0x256ffd[_0x13f9('0x29')]=_[_0x13f9('0x2a')](_0x560ffe[_0x13f9('0x29')]);_0x256ffd['filters']=_[_0x13f9('0x2b')](_0x256ffd[_0x13f9('0x28')],_0x256ffd['query']);_0x76700f['attributes']=_['intersection'](_0x256ffd[_0x13f9('0x28')],qs[_0x13f9('0x2c')](_0x560ffe[_0x13f9('0x29')][_0x13f9('0x2c')]));_0x76700f[_0x13f9('0x2d')]=_0x76700f[_0x13f9('0x2d')][_0x13f9('0x2e')]?_0x76700f[_0x13f9('0x2d')]:_0x256ffd[_0x13f9('0x28')];if(!_0x560ffe[_0x13f9('0x29')]['hasOwnProperty'](_0x13f9('0x2f'))){_0x76700f[_0x13f9('0x1b')]=qs[_0x13f9('0x1b')](_0x560ffe[_0x13f9('0x29')][_0x13f9('0x1b')]);_0x76700f[_0x13f9('0x1a')]=qs[_0x13f9('0x1a')](_0x560ffe[_0x13f9('0x29')][_0x13f9('0x1a')]);}_0x76700f[_0x13f9('0x30')]=qs['sort'](_0x560ffe[_0x13f9('0x29')][_0x13f9('0x31')]);_0x76700f[_0x13f9('0x32')]=qs['filters'](_['pick'](_0x560ffe[_0x13f9('0x29')],_0x256ffd[_0x13f9('0x33')]));if(_0x560ffe['query']['filter']){_0x76700f[_0x13f9('0x32')]=_['merge'](_0x76700f['where'],{'$or':_[_0x13f9('0x34')](_0x3595e2,function(_0x151785){if(_0x151785[_0x13f9('0x35')]['key']!=='VIRTUAL'){var _0x24ca1e={};_0x24ca1e[_0x151785[_0x13f9('0x36')]]={'$like':'%'+_0x560ffe[_0x13f9('0x29')][_0x13f9('0x37')]+'%'};return _0x24ca1e;}})});}_0x76700f=_[_0x13f9('0x38')]({},_0x76700f,_0x560ffe[_0x13f9('0x39')]);var _0x4b5a1a={'where':_0x76700f[_0x13f9('0x32')]};return db['SquareReport'][_0x13f9('0x3a')](_0x4b5a1a)['then'](function(_0x4221c7){_0x4107d5[_0x13f9('0x3a')]=_0x4221c7;if(_0x560ffe[_0x13f9('0x29')][_0x13f9('0x3b')]){_0x76700f[_0x13f9('0x3c')]=[{'all':!![]}];}return db[_0x13f9('0x26')]['findAll'](_0x76700f);})['then'](function(_0x895fc3){_0x4107d5[_0x13f9('0x3d')]=_0x895fc3;return _0x4107d5;})[_0x13f9('0x1f')](respondWithFilteredResult(_0x3ce583,_0x76700f))[_0x13f9('0x3e')](handleError(_0x3ce583,null));};exports[_0x13f9('0x3f')]=function(_0x1299a8,_0x5b1aba){var _0x29a09e={'raw':!![],'where':{'id':_0x1299a8['params']['id']}},_0x1901e6={};_0x1901e6[_0x13f9('0x28')]=_[_0x13f9('0x2a')](db[_0x13f9('0x26')][_0x13f9('0x27')]);_0x1901e6[_0x13f9('0x29')]=_[_0x13f9('0x2a')](_0x1299a8[_0x13f9('0x29')]);_0x1901e6[_0x13f9('0x33')]=_[_0x13f9('0x2b')](_0x1901e6[_0x13f9('0x28')],_0x1901e6[_0x13f9('0x29')]);_0x29a09e['attributes']=_[_0x13f9('0x2b')](_0x1901e6[_0x13f9('0x28')],qs[_0x13f9('0x2c')](_0x1299a8[_0x13f9('0x29')][_0x13f9('0x2c')]));_0x29a09e['attributes']=_0x29a09e[_0x13f9('0x2d')][_0x13f9('0x2e')]?_0x29a09e[_0x13f9('0x2d')]:_0x1901e6[_0x13f9('0x28')];if(_0x1299a8['query']['includeAll']){_0x29a09e[_0x13f9('0x3c')]=[{'all':!![]}];}_0x29a09e=_[_0x13f9('0x38')]({},_0x29a09e,_0x1299a8['options']);return db[_0x13f9('0x26')]['find'](_0x29a09e)[_0x13f9('0x1f')](handleEntityNotFound(_0x5b1aba,null))[_0x13f9('0x1f')](respondWithResult(_0x5b1aba,null))[_0x13f9('0x3e')](handleError(_0x5b1aba,null));};exports[_0x13f9('0x40')]=function(_0x589a6e,_0xe60447){return db[_0x13f9('0x26')][_0x13f9('0x40')](_0x589a6e[_0x13f9('0x41')],{})[_0x13f9('0x1f')](respondWithResult(_0xe60447,0xc9))[_0x13f9('0x3e')](handleError(_0xe60447,null));};exports[_0x13f9('0x42')]=function(_0x560a6b,_0x3a84a9){if(_0x560a6b[_0x13f9('0x41')]['id']){delete _0x560a6b[_0x13f9('0x41')]['id'];}return db[_0x13f9('0x26')]['find']({'where':{'id':_0x560a6b[_0x13f9('0x43')]['id']}})[_0x13f9('0x1f')](handleEntityNotFound(_0x3a84a9,null))[_0x13f9('0x1f')](saveUpdates(_0x560a6b[_0x13f9('0x41')],null))[_0x13f9('0x1f')](respondWithResult(_0x3a84a9,null))[_0x13f9('0x3e')](handleError(_0x3a84a9,null));};exports[_0x13f9('0x20')]=function(_0x605ffb,_0x7a6cc4){return db[_0x13f9('0x26')][_0x13f9('0x44')]({'where':{'id':_0x605ffb[_0x13f9('0x43')]['id']}})[_0x13f9('0x1f')](handleEntityNotFound(_0x7a6cc4,null))[_0x13f9('0x1f')](removeEntity(_0x7a6cc4,null))[_0x13f9('0x3e')](handleError(_0x7a6cc4,null));};exports[_0x13f9('0x45')]=function(_0x235077,_0x32ac77){return db['SquareReport'][_0x13f9('0x45')]()[_0x13f9('0x1f')](respondWithResult(_0x32ac77,null))[_0x13f9('0x3e')](handleError(_0x32ac77,null));}; \ No newline at end of file +var _0x708f=['describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','querystring','papaparse','../../config/license/hardware','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','key','VIRTUAL','field','options','SquareReport','include','findAll','catch','show','params','find','create','body','destroy'];(function(_0x41ace0,_0x24d81b){var _0x59a1e7=function(_0x4b419d){while(--_0x4b419d){_0x41ace0['push'](_0x41ace0['shift']());}};_0x59a1e7(++_0x24d81b);}(_0x708f,0x1e4));var _0xf708=function(_0x5be3e8,_0x2c5c15){_0x5be3e8=_0x5be3e8-0x0;var _0x55f67d=_0x708f[_0x5be3e8];return _0x55f67d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf708('0x0'));var rimraf=require(_0xf708('0x1'));var zipdir=require(_0xf708('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf708('0x3'));var moment=require(_0xf708('0x4'));var BPromise=require(_0xf708('0x5'));var Mustache=require(_0xf708('0x6'));var util=require('util');var path=require(_0xf708('0x7'));var sox=require('sox');var csv=require(_0xf708('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf708('0x9'));var jsforce=require(_0xf708('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf708('0x8'));var querystring=require(_0xf708('0xb'));var Papa=require(_0xf708('0xc'));var authService=require('../../components/auth/service');var hardwareService=require(_0xf708('0xd'));var Redis=require('ioredis');var qs=require(_0xf708('0xe'));var logger=require('../../config/logger')(_0xf708('0xf'));var utils=require(_0xf708('0x10'));var config=require(_0xf708('0x11'));var db=require(_0xf708('0x12'))['db'];function respondWithStatusCode(_0x45455b,_0x376e26){_0x376e26=_0x376e26||0xcc;return function(_0x500762){if(_0x500762){return _0x45455b['sendStatus'](_0x376e26);}return _0x45455b[_0xf708('0x13')](_0x376e26)['end']();};}function respondWithResult(_0x22b6fc,_0x29bf75){_0x29bf75=_0x29bf75||0xc8;return function(_0x1dae84){if(_0x1dae84){return _0x22b6fc[_0xf708('0x13')](_0x29bf75)[_0xf708('0x14')](_0x1dae84);}};}function respondWithFilteredResult(_0x364320,_0x14bfef){return function(_0x583fe6){if(_0x583fe6){var _0x5c9843=_0x583fe6[_0xf708('0x15')],_0x29a345=_0x14bfef['offset'],_0x1b9a64=_0x14bfef[_0xf708('0x16')]+_0x14bfef[_0xf708('0x17')],_0x472af1;if(_0x1b9a64>=_0x5c9843){_0x1b9a64=_0x5c9843;_0x472af1=0xc8;}else{_0x472af1=0xce;}_0x364320[_0xf708('0x13')](_0x472af1);return _0x364320[_0xf708('0x18')](_0xf708('0x19'),_0x29a345+'-'+_0x1b9a64+'/'+_0x5c9843)[_0xf708('0x14')](_0x583fe6);}return null;};}function patchUpdates(_0x97b859){return function(_0x4c5b28){try{jsonpatch[_0xf708('0x1a')](_0x4c5b28,_0x97b859,!![]);}catch(_0x316192){return BPromise[_0xf708('0x1b')](_0x316192);}return _0x4c5b28[_0xf708('0x1c')]();};}function saveUpdates(_0xdf0fd8,_0x1ded99){return function(_0x4f2ac1){if(_0x4f2ac1){return _0x4f2ac1[_0xf708('0x1d')](_0xdf0fd8)[_0xf708('0x1e')](function(_0x22d06d){return _0x22d06d;});}return null;};}function removeEntity(_0x58ae34,_0x19ac78){return function(_0x1609d0){if(_0x1609d0){return _0x1609d0['destroy']()[_0xf708('0x1e')](function(){_0x58ae34[_0xf708('0x13')](0xcc)[_0xf708('0x1f')]();});}};}function handleEntityNotFound(_0x41db96,_0x21233f){return function(_0x2b4e54){if(!_0x2b4e54){_0x41db96[_0xf708('0x20')](0x194);}return _0x2b4e54;};}function handleError(_0x3bac43,_0x1e00c3){_0x1e00c3=_0x1e00c3||0x1f4;return function(_0x11b26c){logger[_0xf708('0x21')](_0x11b26c[_0xf708('0x22')]);if(_0x11b26c['name']){delete _0x11b26c[_0xf708('0x23')];}_0x3bac43[_0xf708('0x13')](_0x1e00c3)[_0xf708('0x24')](_0x11b26c);};}exports[_0xf708('0x25')]=function(_0x52aa58,_0xfe840a){var _0x508911={},_0x19b768={},_0x8f3586={'count':0x0,'rows':[]};var _0x60ae4=db['SquareReport'][_0xf708('0x26')];_0x19b768[_0xf708('0x27')]=_[_0xf708('0x28')](_0x60ae4);_0x19b768[_0xf708('0x29')]=_['keys'](_0x52aa58[_0xf708('0x29')]);_0x19b768[_0xf708('0x2a')]=_[_0xf708('0x2b')](_0x19b768['model'],_0x19b768[_0xf708('0x29')]);_0x508911[_0xf708('0x2c')]=_[_0xf708('0x2b')](_0x19b768[_0xf708('0x27')],qs[_0xf708('0x2d')](_0x52aa58[_0xf708('0x29')][_0xf708('0x2d')]));_0x508911['attributes']=_0x508911[_0xf708('0x2c')][_0xf708('0x2e')]?_0x508911[_0xf708('0x2c')]:_0x19b768[_0xf708('0x27')];if(!_0x52aa58[_0xf708('0x29')][_0xf708('0x2f')](_0xf708('0x30'))){_0x508911[_0xf708('0x17')]=qs['limit'](_0x52aa58[_0xf708('0x29')][_0xf708('0x17')]);_0x508911[_0xf708('0x16')]=qs[_0xf708('0x16')](_0x52aa58['query']['offset']);}_0x508911[_0xf708('0x31')]=qs[_0xf708('0x32')](_0x52aa58[_0xf708('0x29')][_0xf708('0x32')]);_0x508911[_0xf708('0x33')]=qs[_0xf708('0x2a')](_[_0xf708('0x34')](_0x52aa58[_0xf708('0x29')],_0x19b768[_0xf708('0x2a')]));if(_0x52aa58['query'][_0xf708('0x35')]){_0x508911[_0xf708('0x33')]=_['merge'](_0x508911[_0xf708('0x33')],{'$or':_['map'](_0x60ae4,function(_0x1c2511){if(_0x1c2511['type'][_0xf708('0x36')]!==_0xf708('0x37')){var _0x25a457={};_0x25a457[_0x1c2511[_0xf708('0x38')]]={'$like':'%'+_0x52aa58[_0xf708('0x29')]['filter']+'%'};return _0x25a457;}})});}_0x508911=_['merge']({},_0x508911,_0x52aa58[_0xf708('0x39')]);var _0x23ec21={'where':_0x508911['where']};return db[_0xf708('0x3a')]['count'](_0x23ec21)['then'](function(_0x51d4d9){_0x8f3586[_0xf708('0x15')]=_0x51d4d9;if(_0x52aa58['query']['includeAll']){_0x508911[_0xf708('0x3b')]=[{'all':!![]}];}return db['SquareReport'][_0xf708('0x3c')](_0x508911);})[_0xf708('0x1e')](function(_0x2e7a67){_0x8f3586['rows']=_0x2e7a67;return _0x8f3586;})[_0xf708('0x1e')](respondWithFilteredResult(_0xfe840a,_0x508911))[_0xf708('0x3d')](handleError(_0xfe840a,null));};exports[_0xf708('0x3e')]=function(_0x63c064,_0x163d0e){var _0x3c7fae={'raw':!![],'where':{'id':_0x63c064[_0xf708('0x3f')]['id']}},_0x5e197b={};_0x5e197b['model']=_[_0xf708('0x28')](db[_0xf708('0x3a')][_0xf708('0x26')]);_0x5e197b[_0xf708('0x29')]=_[_0xf708('0x28')](_0x63c064['query']);_0x5e197b[_0xf708('0x2a')]=_[_0xf708('0x2b')](_0x5e197b['model'],_0x5e197b[_0xf708('0x29')]);_0x3c7fae[_0xf708('0x2c')]=_[_0xf708('0x2b')](_0x5e197b[_0xf708('0x27')],qs[_0xf708('0x2d')](_0x63c064['query'][_0xf708('0x2d')]));_0x3c7fae['attributes']=_0x3c7fae[_0xf708('0x2c')][_0xf708('0x2e')]?_0x3c7fae[_0xf708('0x2c')]:_0x5e197b['model'];if(_0x63c064[_0xf708('0x29')]['includeAll']){_0x3c7fae[_0xf708('0x3b')]=[{'all':!![]}];}_0x3c7fae=_['merge']({},_0x3c7fae,_0x63c064[_0xf708('0x39')]);return db[_0xf708('0x3a')][_0xf708('0x40')](_0x3c7fae)[_0xf708('0x1e')](handleEntityNotFound(_0x163d0e,null))[_0xf708('0x1e')](respondWithResult(_0x163d0e,null))[_0xf708('0x3d')](handleError(_0x163d0e,null));};exports[_0xf708('0x41')]=function(_0x5af83c,_0x5920e4){return db[_0xf708('0x3a')][_0xf708('0x41')](_0x5af83c['body'],{})[_0xf708('0x1e')](respondWithResult(_0x5920e4,0xc9))[_0xf708('0x3d')](handleError(_0x5920e4,null));};exports[_0xf708('0x1d')]=function(_0x5f1c6d,_0x4bf20c){if(_0x5f1c6d[_0xf708('0x42')]['id']){delete _0x5f1c6d[_0xf708('0x42')]['id'];}return db[_0xf708('0x3a')][_0xf708('0x40')]({'where':{'id':_0x5f1c6d[_0xf708('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4bf20c,null))[_0xf708('0x1e')](saveUpdates(_0x5f1c6d[_0xf708('0x42')],null))['then'](respondWithResult(_0x4bf20c,null))['catch'](handleError(_0x4bf20c,null));};exports[_0xf708('0x43')]=function(_0x43b3f8,_0x69ed64){return db[_0xf708('0x3a')][_0xf708('0x40')]({'where':{'id':_0x43b3f8[_0xf708('0x3f')]['id']}})[_0xf708('0x1e')](handleEntityNotFound(_0x69ed64,null))[_0xf708('0x1e')](removeEntity(_0x69ed64,null))[_0xf708('0x3d')](handleError(_0x69ed64,null));};exports[_0xf708('0x44')]=function(_0x539746,_0x1797eb){return db[_0xf708('0x3a')][_0xf708('0x44')]()[_0xf708('0x1e')](respondWithResult(_0x1797eb,null))['catch'](handleError(_0x1797eb,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 2839e72..1c4b90e 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 _0x278d=['bluebird','request-promise','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','moment'];(function(_0x5ac2d9,_0x364a4f){var _0x16c6c2=function(_0x528236){while(--_0x528236){_0x5ac2d9['push'](_0x5ac2d9['shift']());}};_0x16c6c2(++_0x364a4f);}(_0x278d,0xa1));var _0xd278=function(_0x97eb75,_0x17c7c5){_0x97eb75=_0x97eb75-0x0;var _0x5bb240=_0x278d[_0x97eb75];return _0x5bb240;};'use strict';var _=require(_0xd278('0x0'));var util=require(_0xd278('0x1'));var logger=require(_0xd278('0x2'))('api');var moment=require(_0xd278('0x3'));var BPromise=require(_0xd278('0x4'));var rp=require(_0xd278('0x5'));var attributes=require(_0xd278('0x6'));module[_0xd278('0x7')]=function(_0x7bee6e,_0x36f472){return _0x7bee6e[_0xd278('0x8')](_0xd278('0x9'),attributes,{'tableName':_0xd278('0xa'),'paranoid':![],'indexes':[{'name':_0xd278('0xb'),'fields':[_0xd278('0xc'),_0xd278('0xd')]},{'name':_0xd278('0xe'),'fields':[_0xd278('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba24=['uid_pname','project_name','leaveAt','lodash','util','api','moment','request-promise','exports','define','SquareReport'];(function(_0xb91507,_0x1a4296){var _0x1f1136=function(_0x561bc8){while(--_0x561bc8){_0xb91507['push'](_0xb91507['shift']());}};_0x1f1136(++_0x1a4296);}(_0xba24,0x1e7));var _0x4ba2=function(_0x539a80,_0x1bec78){_0x539a80=_0x539a80-0x0;var _0x5bd651=_0xba24[_0x539a80];return _0x5bd651;};'use strict';var _=require(_0x4ba2('0x0'));var util=require(_0x4ba2('0x1'));var logger=require('../../config/logger')(_0x4ba2('0x2'));var moment=require(_0x4ba2('0x3'));var BPromise=require('bluebird');var rp=require(_0x4ba2('0x4'));var attributes=require('./squareReport.attributes');module[_0x4ba2('0x5')]=function(_0x3eb4f7,_0x21fa83){return _0x3eb4f7[_0x4ba2('0x6')](_0x4ba2('0x7'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x4ba2('0x8'),'fields':['uniqueid',_0x4ba2('0x9')]},{'name':_0x4ba2('0xa'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index a90340e..2eb0116 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 _0x3e04=['update','raw','UpdateSquareReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareReport','SquareReport','create','body','options'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x3e04,0x14d));var _0x43e0=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0x3e04[_0x18abd2];return _0x1dcad6;};'use strict';var _=require('lodash');var util=require(_0x43e0('0x0'));var moment=require(_0x43e0('0x1'));var BPromise=require(_0x43e0('0x2'));var rs=require(_0x43e0('0x3'));var fs=require('fs');var Redis=require(_0x43e0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x43e0('0x5'));var logger=require(_0x43e0('0x6'))(_0x43e0('0x7'));var config=require(_0x43e0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x43e0('0x9')][_0x43e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e60d6,_0x1b90b8,_0x1474de){return new BPromise(function(_0x26a309,_0x1fe302){return client['request'](_0x1e60d6,_0x1474de)[_0x43e0('0xb')](function(_0x256e8e){logger['info'](_0x43e0('0xc'),_0x1b90b8,_0x43e0('0xd'));logger[_0x43e0('0xe')](_0x43e0('0xf'),_0x1b90b8,'request\x20sent',JSON[_0x43e0('0x10')](_0x256e8e));if(_0x256e8e['error']){if(_0x256e8e[_0x43e0('0x11')][_0x43e0('0x12')]===0x1f4){logger['error'](_0x43e0('0xc'),_0x1b90b8,_0x256e8e[_0x43e0('0x11')][_0x43e0('0x13')]);return _0x1fe302(_0x256e8e[_0x43e0('0x11')][_0x43e0('0x13')]);}logger[_0x43e0('0x11')]('SquareReport,\x20%s,\x20%s',_0x1b90b8,_0x256e8e[_0x43e0('0x11')]['message']);return _0x26a309(_0x256e8e[_0x43e0('0x11')][_0x43e0('0x13')]);}else{logger[_0x43e0('0x14')](_0x43e0('0xc'),_0x1b90b8,'request\x20sent');_0x26a309(_0x256e8e['result'][_0x43e0('0x13')]);}})[_0x43e0('0x15')](function(_0x5a5dec){logger[_0x43e0('0x11')](_0x43e0('0xc'),_0x1b90b8,_0x5a5dec);_0x1fe302(_0x5a5dec);});});}exports[_0x43e0('0x16')]=function(_0x5c2ff5){var _0xbd08e8=this;return new Promise(function(_0x3359af,_0x3b75a2){return db[_0x43e0('0x17')][_0x43e0('0x18')](_0x5c2ff5[_0x43e0('0x19')],{'raw':_0x5c2ff5[_0x43e0('0x1a')]?_0x5c2ff5['options']['raw']===undefined?!![]:![]:!![]})[_0x43e0('0xb')](function(_0x27bce5){logger[_0x43e0('0x14')](_0x43e0('0x16'),_0x5c2ff5);logger[_0x43e0('0xe')](_0x43e0('0x16'),_0x5c2ff5,JSON['stringify'](_0x27bce5));_0x3359af(_0x27bce5);})[_0x43e0('0x15')](function(_0x17df8f){logger[_0x43e0('0x11')](_0x43e0('0x16'),_0x17df8f[_0x43e0('0x13')],_0x5c2ff5);_0x3b75a2(_0xbd08e8[_0x43e0('0x11')](0x1f4,_0x17df8f[_0x43e0('0x13')]));});});};exports['UpdateSquareReport']=function(_0x3f92cc){var _0x470679=this;return new Promise(function(_0x1645cb,_0x298c9b){return db[_0x43e0('0x17')][_0x43e0('0x1b')](_0x3f92cc[_0x43e0('0x19')],{'raw':_0x3f92cc[_0x43e0('0x1a')]?_0x3f92cc[_0x43e0('0x1a')][_0x43e0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f92cc[_0x43e0('0x1a')]?_0x3f92cc[_0x43e0('0x1a')]['where']||null:null,'attributes':_0x3f92cc['options']?_0x3f92cc[_0x43e0('0x1a')]['attributes']||null:null,'limit':_0x3f92cc[_0x43e0('0x1a')]?_0x3f92cc[_0x43e0('0x1a')]['limit']||null:null})[_0x43e0('0xb')](function(_0x29a886){logger[_0x43e0('0x14')](_0x43e0('0x1d'),_0x3f92cc);logger[_0x43e0('0xe')](_0x43e0('0x1d'),_0x3f92cc,JSON[_0x43e0('0x10')](_0x29a886));_0x1645cb(_0x29a886);})['catch'](function(_0x27f150){logger['error'](_0x43e0('0x1d'),_0x27f150[_0x43e0('0x13')],_0x3f92cc);_0x298c9b(_0x470679[_0x43e0('0x11')](0x1f4,_0x27f150['message']));});});}; \ No newline at end of file +var _0x980c=['limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','SquareReport','body','options','debug','CreateSquareReport','stringify','UpdateSquareReport','update','where','attributes'];(function(_0x2a8da9,_0x30abe4){var _0x585c44=function(_0x5d5fdc){while(--_0x5d5fdc){_0x2a8da9['push'](_0x2a8da9['shift']());}};_0x585c44(++_0x30abe4);}(_0x980c,0x161));var _0xc980=function(_0x5072c1,_0x2ca6d9){_0x5072c1=_0x5072c1-0x0;var _0x29f86d=_0x980c[_0x5072c1];return _0x29f86d;};'use strict';var _=require(_0xc980('0x0'));var util=require(_0xc980('0x1'));var moment=require(_0xc980('0x2'));var BPromise=require('bluebird');var rs=require(_0xc980('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc980('0x4'))['db'];var utils=require(_0xc980('0x5'));var logger=require(_0xc980('0x6'))(_0xc980('0x7'));var config=require(_0xc980('0x8'));var jayson=require(_0xc980('0x9'));var client=jayson['client'][_0xc980('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30f661,_0x7fdfe1,_0x108377){return new BPromise(function(_0x57fe28,_0x3903de){return client[_0xc980('0xb')](_0x30f661,_0x108377)[_0xc980('0xc')](function(_0x3e72fa){logger[_0xc980('0xd')](_0xc980('0xe'),_0x7fdfe1,_0xc980('0xf'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x7fdfe1,_0xc980('0xf'),JSON['stringify'](_0x3e72fa));if(_0x3e72fa[_0xc980('0x10')]){if(_0x3e72fa['error'][_0xc980('0x11')]===0x1f4){logger['error'](_0xc980('0xe'),_0x7fdfe1,_0x3e72fa[_0xc980('0x10')][_0xc980('0x12')]);return _0x3903de(_0x3e72fa[_0xc980('0x10')][_0xc980('0x12')]);}logger[_0xc980('0x10')](_0xc980('0xe'),_0x7fdfe1,_0x3e72fa['error']['message']);return _0x57fe28(_0x3e72fa[_0xc980('0x10')]['message']);}else{logger['info'](_0xc980('0xe'),_0x7fdfe1,_0xc980('0xf'));_0x57fe28(_0x3e72fa[_0xc980('0x13')][_0xc980('0x12')]);}})[_0xc980('0x14')](function(_0x25de6e){logger[_0xc980('0x10')](_0xc980('0xe'),_0x7fdfe1,_0x25de6e);_0x3903de(_0x25de6e);});});}exports['CreateSquareReport']=function(_0x4bea99){var _0x37a023=this;return new Promise(function(_0x1c28bb,_0x235b91){return db[_0xc980('0x15')]['create'](_0x4bea99[_0xc980('0x16')],{'raw':_0x4bea99[_0xc980('0x17')]?_0x4bea99[_0xc980('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xc980('0xc')](function(_0x166b17){logger[_0xc980('0xd')]('CreateSquareReport',_0x4bea99);logger[_0xc980('0x18')](_0xc980('0x19'),_0x4bea99,JSON[_0xc980('0x1a')](_0x166b17));_0x1c28bb(_0x166b17);})['catch'](function(_0x2f6ff7){logger[_0xc980('0x10')](_0xc980('0x19'),_0x2f6ff7[_0xc980('0x12')],_0x4bea99);_0x235b91(_0x37a023[_0xc980('0x10')](0x1f4,_0x2f6ff7[_0xc980('0x12')]));});});};exports[_0xc980('0x1b')]=function(_0x3dbac7){var _0x10b7b6=this;return new Promise(function(_0x36e2a1,_0x249a89){return db[_0xc980('0x15')][_0xc980('0x1c')](_0x3dbac7[_0xc980('0x16')],{'raw':_0x3dbac7[_0xc980('0x17')]?_0x3dbac7['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dbac7[_0xc980('0x17')]?_0x3dbac7['options'][_0xc980('0x1d')]||null:null,'attributes':_0x3dbac7['options']?_0x3dbac7[_0xc980('0x17')][_0xc980('0x1e')]||null:null,'limit':_0x3dbac7['options']?_0x3dbac7['options'][_0xc980('0x1f')]||null:null})[_0xc980('0xc')](function(_0xa12643){logger['info'](_0xc980('0x1b'),_0x3dbac7);logger[_0xc980('0x18')]('UpdateSquareReport',_0x3dbac7,JSON['stringify'](_0xa12643));_0x36e2a1(_0xa12643);})[_0xc980('0x14')](function(_0x2c2deb){logger[_0xc980('0x10')]('UpdateSquareReport',_0x2c2deb[_0xc980('0x12')],_0x3dbac7);_0x249a89(_0x10b7b6['error'](0x1f4,_0x2c2deb[_0xc980('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 675e4ef..864cd86 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 _0xa6a1=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x113986,_0x301ca9){var _0x5eafb7=function(_0x5b4f5f){while(--_0x5b4f5f){_0x113986['push'](_0x113986['shift']());}};_0x5eafb7(++_0x301ca9);}(_0xa6a1,0x116));var _0x1a6a=function(_0x49a04e,_0x3589d5){_0x49a04e=_0x49a04e-0x0;var _0x346946=_0xa6a1[_0x49a04e];return _0x346946;};'use strict';var multer=require(_0x1a6a('0x0'));var util=require(_0x1a6a('0x1'));var path=require(_0x1a6a('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a6a('0x3'));var router=express[_0x1a6a('0x4')]();var auth=require(_0x1a6a('0x5'));var interaction=require(_0x1a6a('0x6'));var config=require(_0x1a6a('0x7'));var controller=require('./squareReportDetail.controller');router[_0x1a6a('0x8')]('/',auth[_0x1a6a('0x9')](),controller['index']);router['get'](_0x1a6a('0xa'),auth[_0x1a6a('0x9')](),controller[_0x1a6a('0xb')]);router['get'](_0x1a6a('0xc'),auth[_0x1a6a('0x9')](),controller[_0x1a6a('0xd')]);router[_0x1a6a('0xe')]('/',auth[_0x1a6a('0x9')](),controller[_0x1a6a('0xf')]);router[_0x1a6a('0x10')](_0x1a6a('0xc'),auth[_0x1a6a('0x9')](),controller[_0x1a6a('0x11')]);router[_0x1a6a('0x12')]('/:id',auth[_0x1a6a('0x9')](),controller[_0x1a6a('0x13')]);module[_0x1a6a('0x14')]=router; \ No newline at end of file +var _0xc677=['create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','post'];(function(_0x244d90,_0x5e96e6){var _0x29ae09=function(_0x15cc62){while(--_0x15cc62){_0x244d90['push'](_0x244d90['shift']());}};_0x29ae09(++_0x5e96e6);}(_0xc677,0x16f));var _0x7c67=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc677[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x7c67('0x0'));var path=require(_0x7c67('0x1'));var timeout=require(_0x7c67('0x2'));var express=require('express');var router=express[_0x7c67('0x3')]();var auth=require(_0x7c67('0x4'));var interaction=require(_0x7c67('0x5'));var config=require(_0x7c67('0x6'));var controller=require('./squareReportDetail.controller');router[_0x7c67('0x7')]('/',auth[_0x7c67('0x8')](),controller[_0x7c67('0x9')]);router[_0x7c67('0x7')]('/describe',auth[_0x7c67('0x8')](),controller[_0x7c67('0xa')]);router[_0x7c67('0x7')]('/:id',auth[_0x7c67('0x8')](),controller[_0x7c67('0xb')]);router[_0x7c67('0xc')]('/',auth[_0x7c67('0x8')](),controller[_0x7c67('0xd')]);router[_0x7c67('0xe')](_0x7c67('0xf'),auth[_0x7c67('0x8')](),controller[_0x7c67('0x10')]);router[_0x7c67('0x11')](_0x7c67('0xf'),auth[_0x7c67('0x8')](),controller[_0x7c67('0x12')]);module[_0x7c67('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 75d81d6..74615a2 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 _0x628d=['exports','STRING'];(function(_0x1d4953,_0x499808){var _0x1fab36=function(_0x458b32){while(--_0x458b32){_0x1d4953['push'](_0x1d4953['shift']());}};_0x1fab36(++_0x499808);}(_0x628d,0x92));var _0xd628=function(_0x455f1b,_0x43ffa6){_0x455f1b=_0x455f1b-0x0;var _0x4b812e=_0x628d[_0x455f1b];return _0x4b812e;};'use strict';var Sequelize=require('sequelize');module[_0xd628('0x0')]={'uniqueid':{'type':Sequelize[_0xd628('0x1')]},'node':{'type':Sequelize[_0xd628('0x1')]},'application':{'type':Sequelize[_0xd628('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xd628('0x1')]},'callerid':{'type':Sequelize[_0xd628('0x1')]}}; \ No newline at end of file +var _0x8f67=['STRING','exports'];(function(_0x2f1b2f,_0x1190fd){var _0x1ebb14=function(_0x493116){while(--_0x493116){_0x2f1b2f['push'](_0x2f1b2f['shift']());}};_0x1ebb14(++_0x1190fd);}(_0x8f67,0x1bf));var _0x78f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f67[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x78f6('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x78f6('0x1')]},'application':{'type':Sequelize[_0x78f6('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x78f6('0x1')]},'callerid':{'type':Sequelize[_0x78f6('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index d43bdc5..7cc67e9 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 _0x359d=['order','sort','filter','merge','where','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','SquareDetailsReport','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x280fc2,_0x41fcc1){var _0x391580=function(_0x57abf9){while(--_0x57abf9){_0x280fc2['push'](_0x280fc2['shift']());}};_0x391580(++_0x41fcc1);}(_0x359d,0xeb));var _0xd359=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0x359d[_0x17882c];return _0x355a59;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd359('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd359('0x1'));var jsonpatch=require(_0xd359('0x2'));var rp=require(_0xd359('0x3'));var moment=require(_0xd359('0x4'));var BPromise=require(_0xd359('0x5'));var Mustache=require(_0xd359('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd359('0x7'));var csv=require(_0xd359('0x8'));var ejs=require(_0xd359('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd359('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd359('0xb'));var authService=require(_0xd359('0xc'));var hardwareService=require(_0xd359('0xd'));var Redis=require(_0xd359('0xe'));var qs=require(_0xd359('0xf'));var logger=require(_0xd359('0x10'))('api');var utils=require(_0xd359('0x11'));var config=require(_0xd359('0x12'));var db=require(_0xd359('0x13'))['db'];function respondWithStatusCode(_0x28366e,_0x5a96cb){_0x5a96cb=_0x5a96cb||0xcc;return function(_0x1e28a2){if(_0x1e28a2){return _0x28366e[_0xd359('0x14')](_0x5a96cb);}return _0x28366e[_0xd359('0x15')](_0x5a96cb)[_0xd359('0x16')]();};}function respondWithResult(_0x1ce121,_0x5d0a93){_0x5d0a93=_0x5d0a93||0xc8;return function(_0x4f0ad7){if(_0x4f0ad7){return _0x1ce121[_0xd359('0x15')](_0x5d0a93)[_0xd359('0x17')](_0x4f0ad7);}};}function respondWithFilteredResult(_0xc42452,_0x514e50){return function(_0x421c57){if(_0x421c57){var _0x167c96=_0x421c57[_0xd359('0x18')],_0x569f55=_0x514e50[_0xd359('0x19')],_0x2a9be3=_0x514e50[_0xd359('0x19')]+_0x514e50['limit'],_0x1cac40;if(_0x2a9be3>=_0x167c96){_0x2a9be3=_0x167c96;_0x1cac40=0xc8;}else{_0x1cac40=0xce;}_0xc42452[_0xd359('0x15')](_0x1cac40);return _0xc42452[_0xd359('0x1a')](_0xd359('0x1b'),_0x569f55+'-'+_0x2a9be3+'/'+_0x167c96)[_0xd359('0x17')](_0x421c57);}return null;};}function patchUpdates(_0x1460d6){return function(_0x3b423f){try{jsonpatch[_0xd359('0x1c')](_0x3b423f,_0x1460d6,!![]);}catch(_0xfcd037){return BPromise[_0xd359('0x1d')](_0xfcd037);}return _0x3b423f['save']();};}function saveUpdates(_0x23a20a,_0x15c1ab){return function(_0xc63d0e){if(_0xc63d0e){return _0xc63d0e[_0xd359('0x1e')](_0x23a20a)[_0xd359('0x1f')](function(_0x30ba70){return _0x30ba70;});}return null;};}function removeEntity(_0xc022e2,_0x173bf2){return function(_0x5a759e){if(_0x5a759e){return _0x5a759e[_0xd359('0x20')]()[_0xd359('0x1f')](function(){_0xc022e2[_0xd359('0x15')](0xcc)[_0xd359('0x16')]();});}};}function handleEntityNotFound(_0xb3ca93,_0x3af272){return function(_0x5d073d){if(!_0x5d073d){_0xb3ca93[_0xd359('0x14')](0x194);}return _0x5d073d;};}function handleError(_0x46695a,_0x1341ec){_0x1341ec=_0x1341ec||0x1f4;return function(_0x5989bd){logger[_0xd359('0x21')](_0x5989bd[_0xd359('0x22')]);if(_0x5989bd[_0xd359('0x23')]){delete _0x5989bd[_0xd359('0x23')];}_0x46695a[_0xd359('0x15')](_0x1341ec)['send'](_0x5989bd);};}exports[_0xd359('0x24')]=function(_0x33845c,_0xac7f74){var _0x132b24={},_0x1aea71={},_0xd756e7={'count':0x0,'rows':[]};var _0x6894c9=db[_0xd359('0x25')]['rawAttributes'];_0x1aea71[_0xd359('0x26')]=_[_0xd359('0x27')](_0x6894c9);_0x1aea71[_0xd359('0x28')]=_['keys'](_0x33845c[_0xd359('0x28')]);_0x1aea71[_0xd359('0x29')]=_['intersection'](_0x1aea71[_0xd359('0x26')],_0x1aea71[_0xd359('0x28')]);_0x132b24[_0xd359('0x2a')]=_[_0xd359('0x2b')](_0x1aea71[_0xd359('0x26')],qs['fields'](_0x33845c[_0xd359('0x28')][_0xd359('0x2c')]));_0x132b24[_0xd359('0x2a')]=_0x132b24['attributes'][_0xd359('0x2d')]?_0x132b24['attributes']:_0x1aea71['model'];if(!_0x33845c[_0xd359('0x28')][_0xd359('0x2e')](_0xd359('0x2f'))){_0x132b24[_0xd359('0x30')]=qs[_0xd359('0x30')](_0x33845c['query'][_0xd359('0x30')]);_0x132b24['offset']=qs[_0xd359('0x19')](_0x33845c[_0xd359('0x28')][_0xd359('0x19')]);}_0x132b24[_0xd359('0x31')]=qs[_0xd359('0x32')](_0x33845c[_0xd359('0x28')]['sort']);_0x132b24['where']=qs[_0xd359('0x29')](_['pick'](_0x33845c[_0xd359('0x28')],_0x1aea71[_0xd359('0x29')]));if(_0x33845c[_0xd359('0x28')][_0xd359('0x33')]){_0x132b24['where']=_[_0xd359('0x34')](_0x132b24[_0xd359('0x35')],{'$or':_[_0xd359('0x36')](_0x6894c9,function(_0x2b91b0){if(_0x2b91b0[_0xd359('0x37')][_0xd359('0x38')]!==_0xd359('0x39')){var _0x1e909a={};_0x1e909a[_0x2b91b0[_0xd359('0x3a')]]={'$like':'%'+_0x33845c[_0xd359('0x28')][_0xd359('0x33')]+'%'};return _0x1e909a;}})});}_0x132b24=_[_0xd359('0x34')]({},_0x132b24,_0x33845c[_0xd359('0x3b')]);var _0x72b62b={'where':_0x132b24[_0xd359('0x35')]};return db[_0xd359('0x25')][_0xd359('0x18')](_0x72b62b)[_0xd359('0x1f')](function(_0x24463d){_0xd756e7[_0xd359('0x18')]=_0x24463d;if(_0x33845c[_0xd359('0x28')]['includeAll']){_0x132b24[_0xd359('0x3c')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0xd359('0x3d')](_0x132b24);})['then'](function(_0x446d88){_0xd756e7[_0xd359('0x3e')]=_0x446d88;return _0xd756e7;})[_0xd359('0x1f')](respondWithFilteredResult(_0xac7f74,_0x132b24))[_0xd359('0x3f')](handleError(_0xac7f74,null));};exports[_0xd359('0x40')]=function(_0x483839,_0xf407cf){var _0x1e1df8={'raw':!![],'where':{'id':_0x483839[_0xd359('0x41')]['id']}},_0x2f6835={};_0x2f6835[_0xd359('0x26')]=_['keys'](db[_0xd359('0x25')]['rawAttributes']);_0x2f6835[_0xd359('0x28')]=_[_0xd359('0x27')](_0x483839[_0xd359('0x28')]);_0x2f6835[_0xd359('0x29')]=_[_0xd359('0x2b')](_0x2f6835['model'],_0x2f6835['query']);_0x1e1df8[_0xd359('0x2a')]=_['intersection'](_0x2f6835[_0xd359('0x26')],qs[_0xd359('0x2c')](_0x483839[_0xd359('0x28')][_0xd359('0x2c')]));_0x1e1df8['attributes']=_0x1e1df8[_0xd359('0x2a')][_0xd359('0x2d')]?_0x1e1df8[_0xd359('0x2a')]:_0x2f6835['model'];if(_0x483839['query'][_0xd359('0x42')]){_0x1e1df8[_0xd359('0x3c')]=[{'all':!![]}];}_0x1e1df8=_[_0xd359('0x34')]({},_0x1e1df8,_0x483839['options']);return db[_0xd359('0x25')]['find'](_0x1e1df8)['then'](handleEntityNotFound(_0xf407cf,null))[_0xd359('0x1f')](respondWithResult(_0xf407cf,null))['catch'](handleError(_0xf407cf,null));};exports[_0xd359('0x43')]=function(_0x4c98ce,_0x46023a){return db[_0xd359('0x25')][_0xd359('0x43')](_0x4c98ce[_0xd359('0x44')],{})['then'](respondWithResult(_0x46023a,0xc9))['catch'](handleError(_0x46023a,null));};exports[_0xd359('0x1e')]=function(_0x136901,_0x30c912){if(_0x136901[_0xd359('0x44')]['id']){delete _0x136901['body']['id'];}return db[_0xd359('0x25')][_0xd359('0x45')]({'where':{'id':_0x136901[_0xd359('0x41')]['id']}})[_0xd359('0x1f')](handleEntityNotFound(_0x30c912,null))[_0xd359('0x1f')](saveUpdates(_0x136901[_0xd359('0x44')],null))[_0xd359('0x1f')](respondWithResult(_0x30c912,null))[_0xd359('0x3f')](handleError(_0x30c912,null));};exports[_0xd359('0x20')]=function(_0xf47467,_0x3464af){return db['SquareDetailsReport'][_0xd359('0x45')]({'where':{'id':_0xf47467['params']['id']}})['then'](handleEntityNotFound(_0x3464af,null))['then'](removeEntity(_0x3464af,null))[_0xd359('0x3f')](handleError(_0x3464af,null));};exports[_0xd359('0x46')]=function(_0x189300,_0x1a1a6f){return db[_0xd359('0x25')][_0xd359('0x46')]()[_0xd359('0x1f')](respondWithResult(_0x1a1a6f,null))[_0xd359('0x3f')](handleError(_0x1a1a6f,null));}; \ No newline at end of file +var _0xb4c2=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','SquareDetailsReport','rawAttributes'];(function(_0x2689fe,_0x1299df){var _0x323f30=function(_0x1fe61a){while(--_0x1fe61a){_0x2689fe['push'](_0x2689fe['shift']());}};_0x323f30(++_0x1299df);}(_0xb4c2,0x19c));var _0x2b4c=function(_0xb053da,_0x36f6d6){_0xb053da=_0xb053da-0x0;var _0x31d38d=_0xb4c2[_0xb053da];return _0x31d38d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2b4c('0x0'));var rimraf=require(_0x2b4c('0x1'));var zipdir=require(_0x2b4c('0x2'));var jsonpatch=require(_0x2b4c('0x3'));var rp=require(_0x2b4c('0x4'));var moment=require(_0x2b4c('0x5'));var BPromise=require(_0x2b4c('0x6'));var Mustache=require(_0x2b4c('0x7'));var util=require(_0x2b4c('0x8'));var path=require(_0x2b4c('0x9'));var sox=require(_0x2b4c('0xa'));var csv=require('to-csv');var ejs=require(_0x2b4c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2b4c('0xc'));var crypto=require('crypto');var jsforce=require(_0x2b4c('0xd'));var deskjs=require(_0x2b4c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2b4c('0xf'));var Papa=require(_0x2b4c('0x10'));var authService=require(_0x2b4c('0x11'));var hardwareService=require(_0x2b4c('0x12'));var Redis=require('ioredis');var qs=require(_0x2b4c('0x13'));var logger=require(_0x2b4c('0x14'))(_0x2b4c('0x15'));var utils=require(_0x2b4c('0x16'));var config=require(_0x2b4c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3313c6,_0x3f7cf2){_0x3f7cf2=_0x3f7cf2||0xcc;return function(_0x2650d0){if(_0x2650d0){return _0x3313c6[_0x2b4c('0x18')](_0x3f7cf2);}return _0x3313c6[_0x2b4c('0x19')](_0x3f7cf2)[_0x2b4c('0x1a')]();};}function respondWithResult(_0x432d1a,_0x2edd1b){_0x2edd1b=_0x2edd1b||0xc8;return function(_0x323ebe){if(_0x323ebe){return _0x432d1a[_0x2b4c('0x19')](_0x2edd1b)['json'](_0x323ebe);}};}function respondWithFilteredResult(_0x2b3ca8,_0x26dec6){return function(_0x38c517){if(_0x38c517){var _0x2f6fd5=_0x38c517['count'],_0x1e9508=_0x26dec6[_0x2b4c('0x1b')],_0x7fcee9=_0x26dec6[_0x2b4c('0x1b')]+_0x26dec6[_0x2b4c('0x1c')],_0x20fa31;if(_0x7fcee9>=_0x2f6fd5){_0x7fcee9=_0x2f6fd5;_0x20fa31=0xc8;}else{_0x20fa31=0xce;}_0x2b3ca8[_0x2b4c('0x19')](_0x20fa31);return _0x2b3ca8[_0x2b4c('0x1d')](_0x2b4c('0x1e'),_0x1e9508+'-'+_0x7fcee9+'/'+_0x2f6fd5)[_0x2b4c('0x1f')](_0x38c517);}return null;};}function patchUpdates(_0xf729c){return function(_0x1cd5a9){try{jsonpatch[_0x2b4c('0x20')](_0x1cd5a9,_0xf729c,!![]);}catch(_0x33fe96){return BPromise[_0x2b4c('0x21')](_0x33fe96);}return _0x1cd5a9[_0x2b4c('0x22')]();};}function saveUpdates(_0x1a154b,_0x42abec){return function(_0xb251){if(_0xb251){return _0xb251[_0x2b4c('0x23')](_0x1a154b)[_0x2b4c('0x24')](function(_0x16bbbc){return _0x16bbbc;});}return null;};}function removeEntity(_0x4472b4,_0x53781b){return function(_0x830d7c){if(_0x830d7c){return _0x830d7c[_0x2b4c('0x25')]()[_0x2b4c('0x24')](function(){_0x4472b4[_0x2b4c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e3a06,_0x417a85){return function(_0x5c437e){if(!_0x5c437e){_0x2e3a06[_0x2b4c('0x18')](0x194);}return _0x5c437e;};}function handleError(_0x586c55,_0x37f603){_0x37f603=_0x37f603||0x1f4;return function(_0x4aaac4){logger[_0x2b4c('0x26')](_0x4aaac4['stack']);if(_0x4aaac4['name']){delete _0x4aaac4[_0x2b4c('0x27')];}_0x586c55['status'](_0x37f603)[_0x2b4c('0x28')](_0x4aaac4);};}exports[_0x2b4c('0x29')]=function(_0x40b940,_0x1fe775){var _0x2286f1={},_0x4091ed={},_0x2a1db3={'count':0x0,'rows':[]};var _0x5ea19f=db[_0x2b4c('0x2a')][_0x2b4c('0x2b')];_0x4091ed[_0x2b4c('0x2c')]=_[_0x2b4c('0x2d')](_0x5ea19f);_0x4091ed[_0x2b4c('0x2e')]=_[_0x2b4c('0x2d')](_0x40b940[_0x2b4c('0x2e')]);_0x4091ed[_0x2b4c('0x2f')]=_[_0x2b4c('0x30')](_0x4091ed[_0x2b4c('0x2c')],_0x4091ed[_0x2b4c('0x2e')]);_0x2286f1[_0x2b4c('0x31')]=_[_0x2b4c('0x30')](_0x4091ed[_0x2b4c('0x2c')],qs['fields'](_0x40b940['query'][_0x2b4c('0x32')]));_0x2286f1[_0x2b4c('0x31')]=_0x2286f1['attributes'][_0x2b4c('0x33')]?_0x2286f1[_0x2b4c('0x31')]:_0x4091ed['model'];if(!_0x40b940['query'][_0x2b4c('0x34')](_0x2b4c('0x35'))){_0x2286f1[_0x2b4c('0x1c')]=qs[_0x2b4c('0x1c')](_0x40b940['query'][_0x2b4c('0x1c')]);_0x2286f1[_0x2b4c('0x1b')]=qs[_0x2b4c('0x1b')](_0x40b940[_0x2b4c('0x2e')][_0x2b4c('0x1b')]);}_0x2286f1[_0x2b4c('0x36')]=qs[_0x2b4c('0x37')](_0x40b940['query'][_0x2b4c('0x37')]);_0x2286f1[_0x2b4c('0x38')]=qs['filters'](_[_0x2b4c('0x39')](_0x40b940[_0x2b4c('0x2e')],_0x4091ed[_0x2b4c('0x2f')]));if(_0x40b940['query'][_0x2b4c('0x3a')]){_0x2286f1[_0x2b4c('0x38')]=_[_0x2b4c('0x3b')](_0x2286f1[_0x2b4c('0x38')],{'$or':_[_0x2b4c('0x3c')](_0x5ea19f,function(_0x234294){if(_0x234294[_0x2b4c('0x3d')][_0x2b4c('0x3e')]!==_0x2b4c('0x3f')){var _0x20e4f3={};_0x20e4f3[_0x234294[_0x2b4c('0x40')]]={'$like':'%'+_0x40b940[_0x2b4c('0x2e')]['filter']+'%'};return _0x20e4f3;}})});}_0x2286f1=_[_0x2b4c('0x3b')]({},_0x2286f1,_0x40b940[_0x2b4c('0x41')]);var _0x3826a7={'where':_0x2286f1[_0x2b4c('0x38')]};return db[_0x2b4c('0x2a')][_0x2b4c('0x42')](_0x3826a7)[_0x2b4c('0x24')](function(_0x1e917f){_0x2a1db3[_0x2b4c('0x42')]=_0x1e917f;if(_0x40b940['query']['includeAll']){_0x2286f1[_0x2b4c('0x43')]=[{'all':!![]}];}return db[_0x2b4c('0x2a')]['findAll'](_0x2286f1);})[_0x2b4c('0x24')](function(_0x51bb5f){_0x2a1db3[_0x2b4c('0x44')]=_0x51bb5f;return _0x2a1db3;})[_0x2b4c('0x24')](respondWithFilteredResult(_0x1fe775,_0x2286f1))[_0x2b4c('0x45')](handleError(_0x1fe775,null));};exports[_0x2b4c('0x46')]=function(_0x3f638f,_0x1a0e7a){var _0x5b4fa0={'raw':!![],'where':{'id':_0x3f638f[_0x2b4c('0x47')]['id']}},_0x397a24={};_0x397a24[_0x2b4c('0x2c')]=_[_0x2b4c('0x2d')](db['SquareDetailsReport'][_0x2b4c('0x2b')]);_0x397a24[_0x2b4c('0x2e')]=_['keys'](_0x3f638f['query']);_0x397a24['filters']=_['intersection'](_0x397a24[_0x2b4c('0x2c')],_0x397a24[_0x2b4c('0x2e')]);_0x5b4fa0[_0x2b4c('0x31')]=_['intersection'](_0x397a24[_0x2b4c('0x2c')],qs[_0x2b4c('0x32')](_0x3f638f[_0x2b4c('0x2e')]['fields']));_0x5b4fa0['attributes']=_0x5b4fa0[_0x2b4c('0x31')][_0x2b4c('0x33')]?_0x5b4fa0[_0x2b4c('0x31')]:_0x397a24[_0x2b4c('0x2c')];if(_0x3f638f[_0x2b4c('0x2e')]['includeAll']){_0x5b4fa0['include']=[{'all':!![]}];}_0x5b4fa0=_[_0x2b4c('0x3b')]({},_0x5b4fa0,_0x3f638f[_0x2b4c('0x41')]);return db[_0x2b4c('0x2a')][_0x2b4c('0x48')](_0x5b4fa0)[_0x2b4c('0x24')](handleEntityNotFound(_0x1a0e7a,null))[_0x2b4c('0x24')](respondWithResult(_0x1a0e7a,null))['catch'](handleError(_0x1a0e7a,null));};exports[_0x2b4c('0x49')]=function(_0xf77e07,_0xa03b0){return db[_0x2b4c('0x2a')][_0x2b4c('0x49')](_0xf77e07[_0x2b4c('0x4a')],{})[_0x2b4c('0x24')](respondWithResult(_0xa03b0,0xc9))[_0x2b4c('0x45')](handleError(_0xa03b0,null));};exports[_0x2b4c('0x23')]=function(_0x101108,_0x27eb40){if(_0x101108[_0x2b4c('0x4a')]['id']){delete _0x101108['body']['id'];}return db[_0x2b4c('0x2a')]['find']({'where':{'id':_0x101108['params']['id']}})[_0x2b4c('0x24')](handleEntityNotFound(_0x27eb40,null))[_0x2b4c('0x24')](saveUpdates(_0x101108['body'],null))[_0x2b4c('0x24')](respondWithResult(_0x27eb40,null))['catch'](handleError(_0x27eb40,null));};exports['destroy']=function(_0x38f932,_0x3d23a4){return db['SquareDetailsReport']['find']({'where':{'id':_0x38f932['params']['id']}})[_0x2b4c('0x24')](handleEntityNotFound(_0x3d23a4,null))['then'](removeEntity(_0x3d23a4,null))[_0x2b4c('0x45')](handleError(_0x3d23a4,null));};exports[_0x2b4c('0x4b')]=function(_0x428a92,_0x53d26e){return db[_0x2b4c('0x2a')]['describe']()[_0x2b4c('0x24')](respondWithResult(_0x53d26e,null))[_0x2b4c('0x45')](handleError(_0x53d26e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 1f922a4..8fd377e 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 _0x6ecd=['api','moment','bluebird','./squareReportDetail.attributes','exports','define','report_square_details','lodash','util'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x6ecd,0x11e));var _0xd6ec=function(_0x19bfdd,_0x4a9c95){_0x19bfdd=_0x19bfdd-0x0;var _0x4a424b=_0x6ecd[_0x19bfdd];return _0x4a424b;};'use strict';var _=require(_0xd6ec('0x0'));var util=require(_0xd6ec('0x1'));var logger=require('../../config/logger')(_0xd6ec('0x2'));var moment=require(_0xd6ec('0x3'));var BPromise=require(_0xd6ec('0x4'));var rp=require('request-promise');var attributes=require(_0xd6ec('0x5'));module[_0xd6ec('0x6')]=function(_0x5cdb03,_0x2fe129){return _0x5cdb03[_0xd6ec('0x7')]('SquareDetailsReport',attributes,{'tableName':_0xd6ec('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfc8=['request-promise','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','moment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xdfc8,0x11e));var _0x8dfc=function(_0x38cb7d,_0x1a7ec6){_0x38cb7d=_0x38cb7d-0x0;var _0x1d76eb=_0xdfc8[_0x38cb7d];return _0x1d76eb;};'use strict';var _=require(_0x8dfc('0x0'));var util=require(_0x8dfc('0x1'));var logger=require(_0x8dfc('0x2'))('api');var moment=require(_0x8dfc('0x3'));var BPromise=require('bluebird');var rp=require(_0x8dfc('0x4'));var attributes=require(_0x8dfc('0x5'));module[_0x8dfc('0x6')]=function(_0x1aebc0,_0x3df91f){return _0x1aebc0[_0x8dfc('0x7')](_0x8dfc('0x8'),attributes,{'tableName':_0x8dfc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index e9b7215..15477b1 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 _0x0bde=['options','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','body'];(function(_0x3a2cbd,_0x27ff94){var _0x4f0d52=function(_0x5b996f){while(--_0x5b996f){_0x3a2cbd['push'](_0x3a2cbd['shift']());}};_0x4f0d52(++_0x27ff94);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe0bd('0x0'));var util=require('util');var moment=require(_0xe0bd('0x1'));var BPromise=require(_0xe0bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];var utils=require(_0xe0bd('0x5'));var logger=require('../../config/logger')(_0xe0bd('0x6'));var config=require(_0xe0bd('0x7'));var jayson=require(_0xe0bd('0x8'));var client=jayson[_0xe0bd('0x9')][_0xe0bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c8892,_0x29faee,_0x1b75c1){return new BPromise(function(_0xf790d6,_0x54d27f){return client[_0xe0bd('0xb')](_0x1c8892,_0x1b75c1)[_0xe0bd('0xc')](function(_0x12a5f1){logger['info'](_0xe0bd('0xd'),_0x29faee,_0xe0bd('0xe'));logger['debug'](_0xe0bd('0xf'),_0x29faee,'request\x20sent',JSON[_0xe0bd('0x10')](_0x12a5f1));if(_0x12a5f1[_0xe0bd('0x11')]){if(_0x12a5f1[_0xe0bd('0x11')][_0xe0bd('0x12')]===0x1f4){logger[_0xe0bd('0x11')](_0xe0bd('0xd'),_0x29faee,_0x12a5f1[_0xe0bd('0x11')]['message']);return _0x54d27f(_0x12a5f1[_0xe0bd('0x11')][_0xe0bd('0x13')]);}logger[_0xe0bd('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x29faee,_0x12a5f1[_0xe0bd('0x11')]['message']);return _0xf790d6(_0x12a5f1[_0xe0bd('0x11')][_0xe0bd('0x13')]);}else{logger[_0xe0bd('0x14')](_0xe0bd('0xd'),_0x29faee,_0xe0bd('0xe'));_0xf790d6(_0x12a5f1[_0xe0bd('0x15')][_0xe0bd('0x13')]);}})[_0xe0bd('0x16')](function(_0x4ea791){logger['error'](_0xe0bd('0xd'),_0x29faee,_0x4ea791);_0x54d27f(_0x4ea791);});});}exports[_0xe0bd('0x17')]=function(_0x1c4533){var _0x100b8f=this;return new Promise(function(_0xa6be32,_0x2a015c){return db['SquareDetailsReport']['create'](_0x1c4533[_0xe0bd('0x18')],{'raw':_0x1c4533[_0xe0bd('0x19')]?_0x1c4533[_0xe0bd('0x19')][_0xe0bd('0x1a')]===undefined?!![]:![]:!![]})[_0xe0bd('0xc')](function(_0x154480){logger[_0xe0bd('0x14')]('CreateSquareDetailsReport',_0x1c4533);logger['debug'](_0xe0bd('0x17'),_0x1c4533,JSON[_0xe0bd('0x10')](_0x154480));_0xa6be32(_0x154480);})[_0xe0bd('0x16')](function(_0xdcb789){logger[_0xe0bd('0x11')]('CreateSquareDetailsReport',_0xdcb789[_0xe0bd('0x13')],_0x1c4533);_0x2a015c(_0x100b8f['error'](0x1f4,_0xdcb789[_0xe0bd('0x13')]));});});}; \ No newline at end of file +var _0x2e65=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','create','options','raw','CreateSquareDetailsReport','debug','lodash','util','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2e65,0x193));var _0x52e6=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x2e65[_0x484c03];return _0x294127;};'use strict';var _=require(_0x52e6('0x0'));var util=require(_0x52e6('0x1'));var moment=require(_0x52e6('0x2'));var BPromise=require(_0x52e6('0x3'));var rs=require(_0x52e6('0x4'));var fs=require('fs');var Redis=require(_0x52e6('0x5'));var db=require(_0x52e6('0x6'))['db'];var utils=require(_0x52e6('0x7'));var logger=require('../../config/logger')(_0x52e6('0x8'));var config=require(_0x52e6('0x9'));var jayson=require(_0x52e6('0xa'));var client=jayson[_0x52e6('0xb')][_0x52e6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x116651,_0x15e4af,_0x1401a3){return new BPromise(function(_0x27f270,_0x2ab17e){return client['request'](_0x116651,_0x1401a3)[_0x52e6('0xd')](function(_0x1db169){logger['info'](_0x52e6('0xe'),_0x15e4af,'request\x20sent');logger['debug'](_0x52e6('0xf'),_0x15e4af,_0x52e6('0x10'),JSON[_0x52e6('0x11')](_0x1db169));if(_0x1db169[_0x52e6('0x12')]){if(_0x1db169[_0x52e6('0x12')][_0x52e6('0x13')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x15e4af,_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);return _0x2ab17e(_0x1db169['error'][_0x52e6('0x14')]);}logger[_0x52e6('0x12')](_0x52e6('0xe'),_0x15e4af,_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);return _0x27f270(_0x1db169[_0x52e6('0x12')][_0x52e6('0x14')]);}else{logger[_0x52e6('0x15')](_0x52e6('0xe'),_0x15e4af,_0x52e6('0x10'));_0x27f270(_0x1db169[_0x52e6('0x16')][_0x52e6('0x14')]);}})[_0x52e6('0x17')](function(_0x5c275c){logger['error'](_0x52e6('0xe'),_0x15e4af,_0x5c275c);_0x2ab17e(_0x5c275c);});});}exports['CreateSquareDetailsReport']=function(_0x5363d9){var _0x3a3a47=this;return new Promise(function(_0x3997ed,_0x3631e6){return db['SquareDetailsReport'][_0x52e6('0x18')](_0x5363d9['body'],{'raw':_0x5363d9[_0x52e6('0x19')]?_0x5363d9[_0x52e6('0x19')][_0x52e6('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xf2df3){logger['info'](_0x52e6('0x1b'),_0x5363d9);logger[_0x52e6('0x1c')](_0x52e6('0x1b'),_0x5363d9,JSON['stringify'](_0xf2df3));_0x3997ed(_0xf2df3);})[_0x52e6('0x17')](function(_0x994901){logger['error']('CreateSquareDetailsReport',_0x994901['message'],_0x5363d9);_0x3631e6(_0x3a3a47[_0x52e6('0x12')](0x1f4,_0x994901['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 1bb15c3..c3c0a18 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 _0x833c=['express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','exports'];(function(_0x16e1a0,_0x1f97e4){var _0x4635d8=function(_0x5b0454){while(--_0x5b0454){_0x16e1a0['push'](_0x16e1a0['shift']());}};_0x4635d8(++_0x1f97e4);}(_0x833c,0x140));var _0xc833=function(_0x21a1c1,_0xaf74bb){_0x21a1c1=_0x21a1c1-0x0;var _0x588c65=_0x833c[_0x21a1c1];return _0x588c65;};'use strict';var express=require(_0xc833('0x0'));var router=express[_0xc833('0x1')]();var auth=require(_0xc833('0x2'));var controller=require(_0xc833('0x3'));router[_0xc833('0x4')]('/',auth[_0xc833('0x5')](),controller[_0xc833('0x6')]);router[_0xc833('0x4')]('/process/:pid/kill',auth[_0xc833('0x5')](),controller['killProcess']);module[_0xc833('0x7')]=router; \ No newline at end of file +var _0x2823=['get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','../../components/auth/service','./system.controller'];(function(_0x3ef8f7,_0x35359a){var _0x3b097e=function(_0x189c92){while(--_0x189c92){_0x3ef8f7['push'](_0x3ef8f7['shift']());}};_0x3b097e(++_0x35359a);}(_0x2823,0x195));var _0x3282=function(_0x1081eb,_0x2a3a46){_0x1081eb=_0x1081eb-0x0;var _0x24148b=_0x2823[_0x1081eb];return _0x24148b;};'use strict';var express=require(_0x3282('0x0'));var router=express['Router']();var auth=require(_0x3282('0x1'));var controller=require(_0x3282('0x2'));router[_0x3282('0x3')]('/',auth[_0x3282('0x4')](),controller['index']);router[_0x3282('0x3')](_0x3282('0x5'),auth[_0x3282('0x4')](),controller[_0x3282('0x6')]);module[_0x3282('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index b8ba766..c70ca80 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 _0xd81a=['status','send','index','getAllData','then','json','catch','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','format','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name'];(function(_0x50dab7,_0x34e5bc){var _0x2268cc=function(_0xd0d624){while(--_0xd0d624){_0x50dab7['push'](_0x50dab7['shift']());}};_0x2268cc(++_0x34e5bc);}(_0xd81a,0x1ee));var _0xad81=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xd81a[_0x5ddb1c];return _0x354adc;};'use strict';var info=require(_0xad81('0x0'));var exec=require(_0xad81('0x1'))[_0xad81('0x2')];var logger=require(_0xad81('0x3'))('api');var util=require('util');var BPromise=require(_0xad81('0x4'));var _=require(_0xad81('0x5'));function handleError(_0x3f8fb7,_0x2f469c,_0xca5387){_0x2f469c=_0x2f469c||0x1f4;return function(_0x495c89){logger[_0xad81('0x6')](_0xad81('0x7'),_0xca5387,_0x2f469c,util[_0xad81('0x8')](_0x495c89,{'showHidden':![],'depth':null}));delete _0x495c89[_0xad81('0x9')];_0x3f8fb7[_0xad81('0xa')](_0x2f469c)[_0xad81('0xb')](_0x495c89);};}exports[_0xad81('0xc')]=function(_0x190cd5,_0x1e42a7){return info[_0xad81('0xd')]()[_0xad81('0xe')](function(_0x384c12){return _0x1e42a7[_0xad81('0xa')](0xc8)[_0xad81('0xf')](_0x384c12);})[_0xad81('0x10')](function(_0x8a8eb6){return _0x1e42a7['status'](0x1f4)['json'](_0x8a8eb6);});};exports['killProcess']=function(_0x1a7d73,_0x36785c){var _0x409fd0=['components/import/cm'];return new BPromise(function(_0x1e1d0e,_0x2f60b7){return exec(util['format'](_0xad81('0x11'),_0x1a7d73[_0xad81('0x12')][_0xad81('0x13')]),function(_0x351a2c,_0x2cc8e4,_0x3f4bd1){if(_0x351a2c){return _0x2f60b7(_0x351a2c);}return _0x1e1d0e(_0x2cc8e4);});})['then'](function(_0x500b95){var _0xe97f8c=![];var _0x3e4f0a=_0x500b95[_0xad81('0x14')](/\n/);for(var _0x3ad214=0x0,_0x46257f=_0x409fd0[_0xad81('0x15')];_0x3ad214<_0x46257f,_0xe97f8c===![];_0x3ad214+=0x1){if(_0x500b95[_0xad81('0x16')](_0x409fd0[_0x3ad214])>=0x0){_0xe97f8c=!![];}}if(!_0xe97f8c){throw new Error(util[_0xad81('0x17')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1a7d73['params'][_0xad81('0x13')]));}process[_0xad81('0x18')](_0x1a7d73[_0xad81('0x12')][_0xad81('0x13')],_0xad81('0x19'));return _0x36785c[_0xad81('0xa')](0xc8)[_0xad81('0xf')]({'message':util[_0xad81('0x17')](_0xad81('0x1a'),_0x1a7d73[_0xad81('0x12')][_0xad81('0x13')])});})[_0xad81('0x10')](handleError(_0x36785c,null,_0xad81('0x1b')));}; \ No newline at end of file +var _0x85ed=['params','pid','kill','SIGINT','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','exec','../../config/logger','api','util','bluebird','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData','then','status','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x1f8ec0,_0x933b58){var _0x5f4c0e=function(_0x23a18f){while(--_0x23a18f){_0x1f8ec0['push'](_0x1f8ec0['shift']());}};_0x5f4c0e(++_0x933b58);}(_0x85ed,0x7b));var _0xd85e=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x85ed[_0x265aa2];return _0x447a3a;};'use strict';var info=require(_0xd85e('0x0'));var exec=require('child_process')[_0xd85e('0x1')];var logger=require(_0xd85e('0x2'))(_0xd85e('0x3'));var util=require(_0xd85e('0x4'));var BPromise=require(_0xd85e('0x5'));var _=require('lodash');function handleError(_0xaa30d0,_0x2922c3,_0x26ba69){_0x2922c3=_0x2922c3||0x1f4;return function(_0x5b0b4a){logger['error'](_0xd85e('0x6'),_0x26ba69,_0x2922c3,util[_0xd85e('0x7')](_0x5b0b4a,{'showHidden':![],'depth':null}));delete _0x5b0b4a[_0xd85e('0x8')];_0xaa30d0['status'](_0x2922c3)[_0xd85e('0x9')](_0x5b0b4a);};}exports[_0xd85e('0xa')]=function(_0x12e78f,_0x4dbbd4){return info[_0xd85e('0xb')]()[_0xd85e('0xc')](function(_0x262af4){return _0x4dbbd4['status'](0xc8)['json'](_0x262af4);})['catch'](function(_0x2208b5){return _0x4dbbd4[_0xd85e('0xd')](0x1f4)['json'](_0x2208b5);});};exports[_0xd85e('0xe')]=function(_0x1996a0,_0x246be2){var _0xe610f4=[_0xd85e('0xf')];return new BPromise(function(_0x5a12ab,_0x91d8e){return exec(util[_0xd85e('0x10')](_0xd85e('0x11'),_0x1996a0['params']['pid']),function(_0x134b2f,_0xc5ba92,_0x4c8e83){if(_0x134b2f){return _0x91d8e(_0x134b2f);}return _0x5a12ab(_0xc5ba92);});})[_0xd85e('0xc')](function(_0x4df41c){var _0x31de42=![];var _0x32f57b=_0x4df41c[_0xd85e('0x12')](/\n/);for(var _0x42a565=0x0,_0x298862=_0xe610f4[_0xd85e('0x13')];_0x42a565<_0x298862,_0x31de42===![];_0x42a565+=0x1){if(_0x4df41c[_0xd85e('0x14')](_0xe610f4[_0x42a565])>=0x0){_0x31de42=!![];}}if(!_0x31de42){throw new Error(util[_0xd85e('0x10')](_0xd85e('0x15'),_0x1996a0[_0xd85e('0x16')][_0xd85e('0x17')]));}process[_0xd85e('0x18')](_0x1996a0[_0xd85e('0x16')][_0xd85e('0x17')],_0xd85e('0x19'));return _0x246be2['status'](0xc8)[_0xd85e('0x1a')]({'message':util[_0xd85e('0x10')](_0xd85e('0x1b'),_0x1996a0[_0xd85e('0x16')][_0xd85e('0x17')])});})[_0xd85e('0x1c')](handleError(_0x246be2,null,_0xd85e('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index d4d44df..810704c 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 _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdb28,0x106));var _0x8db2=function(_0x4407e0,_0x45ecdf){_0x4407e0=_0x4407e0-0x0;var _0xd4cd85=_0xdb28[_0x4407e0];return _0xd4cd85;};'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 auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')]('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xd')]);router[_0x8db2('0xe')](_0x8db2('0xf'),auth['isAuthenticated'](),controller[_0x8db2('0x10')]);router[_0x8db2('0x11')](_0x8db2('0xf'),auth['isAuthenticated'](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router; \ No newline at end of file +var _0xda2d=['delete','destroy','exports','util','path','connect-timeout','express','Router','./tag.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x4a9f58,_0x20cb36){var _0x556240=function(_0x4b9f35){while(--_0x4b9f35){_0x4a9f58['push'](_0x4a9f58['shift']());}};_0x556240(++_0x20cb36);}(_0xda2d,0x102));var _0xdda2=function(_0x3977f7,_0x49f186){_0x3977f7=_0x3977f7-0x0;var _0x2791f7=_0xda2d[_0x3977f7];return _0x2791f7;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdda2('0x5'));router[_0xdda2('0x6')]('/',auth[_0xdda2('0x7')](),controller[_0xdda2('0x8')]);router[_0xdda2('0x6')](_0xdda2('0x9'),auth[_0xdda2('0x7')](),controller[_0xdda2('0xa')]);router[_0xdda2('0xb')]('/',auth[_0xdda2('0x7')](),controller['create']);router[_0xdda2('0xc')](_0xdda2('0x9'),auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0x9'),auth[_0xdda2('0x7')](),controller[_0xdda2('0xf')]);module[_0xdda2('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index f0812ae..fb5b00d 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 _0xcff7=['STRING','exports','name'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xcff7,0x127));var _0x7cff=function(_0x3cdf6c,_0x23efda){_0x3cdf6c=_0x3cdf6c-0x0;var _0x195a27=_0xcff7[_0x3cdf6c];return _0x195a27;};'use strict';var Sequelize=require('sequelize');module[_0x7cff('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7cff('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x7cff('0x2')]}}; \ No newline at end of file +var _0x1e35=['#0091EA','sequelize','STRING','name'];(function(_0x6786bd,_0x2e8f72){var _0x187ad2=function(_0x2cf899){while(--_0x2cf899){_0x6786bd['push'](_0x6786bd['shift']());}};_0x187ad2(++_0x2e8f72);}(_0x1e35,0x161));var _0x51e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e35[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x51e3('0x0'));module['exports']={'name':{'type':Sequelize[_0x51e3('0x1')],'unique':_0x51e3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x51e3('0x1')],'defaultValue':_0x51e3('0x3')},'description':{'type':Sequelize[_0x51e3('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 3ccee70..70ef602 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 _0x781d=['role','user','UserProfileSection','userProfileId','autoAssociation','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','Tags','UserProfileResource','destroy','error','name','send','index','Tag','rawAttributes','query','keys','model','attributes','fields','hasOwnProperty','order','sort','filters','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','includeAll','findAll','show','params','intersection','include','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x45135c,_0x3b2508){var _0x3999f5=function(_0x1c41f4){while(--_0x1c41f4){_0x45135c['push'](_0x45135c['shift']());}};_0x3999f5(++_0x3b2508);}(_0x781d,0x14a));var _0xd781=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x781d[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0xd781('0x0'));var emlformat=require(_0xd781('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd781('0x2'));var rp=require(_0xd781('0x3'));var moment=require(_0xd781('0x4'));var BPromise=require(_0xd781('0x5'));var Mustache=require(_0xd781('0x6'));var util=require(_0xd781('0x7'));var path=require(_0xd781('0x8'));var sox=require(_0xd781('0x9'));var csv=require(_0xd781('0xa'));var ejs=require(_0xd781('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var authService=require(_0xd781('0x11'));var hardwareService=require(_0xd781('0x12'));var Redis=require('ioredis');var qs=require(_0xd781('0x13'));var logger=require(_0xd781('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd781('0x15'));var db=require(_0xd781('0x16'))['db'];function respondWithStatusCode(_0x36f086,_0x17a929){_0x17a929=_0x17a929||0xcc;return function(_0xbea78b){if(_0xbea78b){return _0x36f086[_0xd781('0x17')](_0x17a929);}return _0x36f086[_0xd781('0x18')](_0x17a929)[_0xd781('0x19')]();};}function respondWithResult(_0xb895a1,_0x12b1b2){_0x12b1b2=_0x12b1b2||0xc8;return function(_0xd454e7){if(_0xd454e7){return _0xb895a1['status'](_0x12b1b2)[_0xd781('0x1a')](_0xd454e7);}};}function respondWithFilteredResult(_0x115e00,_0x498674){return function(_0x3a1f48){if(_0x3a1f48){var _0x48bffc=_0x3a1f48[_0xd781('0x1b')],_0x294e5a=_0x498674[_0xd781('0x1c')],_0x22d787=_0x498674[_0xd781('0x1c')]+_0x498674[_0xd781('0x1d')],_0x9f25f7;if(_0x22d787>=_0x48bffc){_0x22d787=_0x48bffc;_0x9f25f7=0xc8;}else{_0x9f25f7=0xce;}_0x115e00['status'](_0x9f25f7);return _0x115e00[_0xd781('0x1e')](_0xd781('0x1f'),_0x294e5a+'-'+_0x22d787+'/'+_0x48bffc)[_0xd781('0x1a')](_0x3a1f48);}return null;};}function patchUpdates(_0x2f1273){return function(_0x3bf805){try{jsonpatch[_0xd781('0x20')](_0x3bf805,_0x2f1273,!![]);}catch(_0x260aa8){return BPromise[_0xd781('0x21')](_0x260aa8);}return _0x3bf805['save']();};}function saveUpdates(_0x32e15e,_0x3e8a37){return function(_0x1036d3){if(_0x1036d3){return _0x1036d3[_0xd781('0x22')](_0x32e15e)[_0xd781('0x23')](function(_0x274665){return _0x274665;});}return null;};}function removeEntity(_0x1adcbd,_0x5dd1f0){return function(_0xe0c65f){if(_0xe0c65f){return _0xe0c65f['destroy']()['then'](function(){var _0x187a5a=_0xe0c65f['get']({'plain':!![]});var _0x175ba6=_0xd781('0x24');return db[_0xd781('0x25')][_0xd781('0x26')]({'where':{'type':_0x175ba6,'resourceId':_0x187a5a['id']}})[_0xd781('0x23')](function(){return _0xe0c65f;});})[_0xd781('0x23')](function(){_0x1adcbd[_0xd781('0x18')](0xcc)[_0xd781('0x19')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x17')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=db[_0xd781('0x2b')][_0xd781('0x2c')];_0x5b0464['model']=_['keys'](_0x4a3bd3);_0x5b0464[_0xd781('0x2d')]=_[_0xd781('0x2e')](_0x5c3848[_0xd781('0x2d')]);_0x5b0464['filters']=_['intersection'](_0x5b0464[_0xd781('0x2f')],_0x5b0464[_0xd781('0x2d')]);_0x43cc74[_0xd781('0x30')]=_['intersection'](_0x5b0464['model'],qs[_0xd781('0x31')](_0x5c3848[_0xd781('0x2d')]['fields']));_0x43cc74[_0xd781('0x30')]=_0x43cc74[_0xd781('0x30')]['length']?_0x43cc74[_0xd781('0x30')]:_0x5b0464[_0xd781('0x2f')];if(!_0x5c3848[_0xd781('0x2d')][_0xd781('0x32')]('nolimit')){_0x43cc74[_0xd781('0x1d')]=qs[_0xd781('0x1d')](_0x5c3848[_0xd781('0x2d')][_0xd781('0x1d')]);_0x43cc74['offset']=qs[_0xd781('0x1c')](_0x5c3848[_0xd781('0x2d')]['offset']);}_0x43cc74[_0xd781('0x33')]=qs['sort'](_0x5c3848[_0xd781('0x2d')][_0xd781('0x34')]);_0x43cc74['where']=qs[_0xd781('0x35')](_[_0xd781('0x36')](_0x5c3848['query'],_0x5b0464[_0xd781('0x35')]));if(_0x5c3848['query'][_0xd781('0x37')]){_0x43cc74[_0xd781('0x38')]=_['merge'](_0x43cc74[_0xd781('0x38')],{'$or':_[_0xd781('0x39')](_0x4a3bd3,function(_0x5651de){if(_0x5651de[_0xd781('0x3a')][_0xd781('0x3b')]!==_0xd781('0x3c')){var _0x58f763={};_0x58f763[_0x5651de[_0xd781('0x3d')]]={'$like':'%'+_0x5c3848[_0xd781('0x2d')][_0xd781('0x37')]+'%'};return _0x58f763;}})});}_0x43cc74=_[_0xd781('0x3e')]({},_0x43cc74,_0x5c3848[_0xd781('0x3f')]);var _0x282d30={'where':_0x43cc74[_0xd781('0x38')]};return db[_0xd781('0x2b')][_0xd781('0x1b')](_0x282d30)['then'](function(_0x2a60d6){_0x296a0b['count']=_0x2a60d6;if(_0x5c3848[_0xd781('0x2d')][_0xd781('0x40')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2b')][_0xd781('0x41')](_0x43cc74);})[_0xd781('0x23')](function(_0x402c9c){_0x296a0b['rows']=_0x402c9c;return _0x296a0b;})[_0xd781('0x23')](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))['catch'](handleError(_0x5b6b9d,null));};exports[_0xd781('0x42')]=function(_0xcdaacf,_0x5e3f9a){var _0x5ee0a3={'raw':!![],'where':{'id':_0xcdaacf[_0xd781('0x43')]['id']}},_0x1fb267={};_0x1fb267[_0xd781('0x2f')]=_[_0xd781('0x2e')](db['Tag'][_0xd781('0x2c')]);_0x1fb267[_0xd781('0x2d')]=_['keys'](_0xcdaacf['query']);_0x1fb267[_0xd781('0x35')]=_[_0xd781('0x44')](_0x1fb267[_0xd781('0x2f')],_0x1fb267['query']);_0x5ee0a3['attributes']=_[_0xd781('0x44')](_0x1fb267[_0xd781('0x2f')],qs[_0xd781('0x31')](_0xcdaacf[_0xd781('0x2d')][_0xd781('0x31')]));_0x5ee0a3[_0xd781('0x30')]=_0x5ee0a3['attributes']['length']?_0x5ee0a3[_0xd781('0x30')]:_0x1fb267[_0xd781('0x2f')];if(_0xcdaacf[_0xd781('0x2d')][_0xd781('0x40')]){_0x5ee0a3[_0xd781('0x45')]=[{'all':!![]}];}_0x5ee0a3=_['merge']({},_0x5ee0a3,_0xcdaacf[_0xd781('0x3f')]);return db[_0xd781('0x2b')][_0xd781('0x46')](_0x5ee0a3)['then'](handleEntityNotFound(_0x5e3f9a,null))[_0xd781('0x23')](respondWithResult(_0x5e3f9a,null))[_0xd781('0x47')](handleError(_0x5e3f9a,null));};exports[_0xd781('0x48')]=function(_0x5a0cdd,_0xda7824){return db[_0xd781('0x2b')]['create'](_0x5a0cdd['body'],{})[_0xd781('0x23')](function(_0x16d16e){var _0x1efb2a=_0x5a0cdd['user'][_0xd781('0x49')]({'plain':!![]});if(!_0x1efb2a)throw new Error(_0xd781('0x4a'));if(_0x1efb2a[_0xd781('0x4b')]===_0xd781('0x4c')){var _0x336d30=_0x16d16e[_0xd781('0x49')]({'plain':!![]});var _0x5e591a='Tags';return db[_0xd781('0x4d')][_0xd781('0x46')]({'where':{'name':_0x5e591a,'userProfileId':_0x1efb2a[_0xd781('0x4e')]},'raw':!![]})['then'](function(_0x1cdff5){if(_0x1cdff5&&_0x1cdff5[_0xd781('0x4f')]===0x0){return db['UserProfileResource'][_0xd781('0x48')]({'name':_0x336d30[_0xd781('0x28')],'resourceId':_0x336d30['id'],'type':_0x1cdff5[_0xd781('0x28')],'sectionId':_0x1cdff5['id']},{})[_0xd781('0x23')](function(){return _0x16d16e;});}else{return _0x16d16e;}})[_0xd781('0x47')](function(_0x599915){logger[_0xd781('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x599915);throw _0x599915;});}return _0x16d16e;})[_0xd781('0x23')](respondWithResult(_0xda7824,0xc9))['catch'](handleError(_0xda7824,null));};exports[_0xd781('0x22')]=function(_0x17a46e,_0x4f9e37){if(_0x17a46e[_0xd781('0x50')]['id']){delete _0x17a46e['body']['id'];}return db['Tag']['find']({'where':{'id':_0x17a46e[_0xd781('0x43')]['id']}})[_0xd781('0x23')](handleEntityNotFound(_0x4f9e37,null))['then'](saveUpdates(_0x17a46e[_0xd781('0x50')],null))['then'](respondWithResult(_0x4f9e37,null))[_0xd781('0x47')](handleError(_0x4f9e37,null));};exports[_0xd781('0x26')]=function(_0x39d47d,_0x19a6c2){return db['Tag'][_0xd781('0x46')]({'where':{'id':_0x39d47d['params']['id']}})[_0xd781('0x23')](handleEntityNotFound(_0x19a6c2,null))['then'](removeEntity(_0x19a6c2,null))[_0xd781('0x47')](handleError(_0x19a6c2,null));}; \ No newline at end of file +var _0x5204=['../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','Tags','UserProfileResource','error','stack','name','send','Tag','rawAttributes','keys','filters','model','intersection','fields','attributes','length','query','hasOwnProperty','order','where','filter','merge','map','key','VIRTUAL','includeAll','rows','catch','show','include','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service'];(function(_0x55d688,_0x2d850d){var _0x5d2637=function(_0x3e6759){while(--_0x3e6759){_0x55d688['push'](_0x55d688['shift']());}};_0x5d2637(++_0x2d850d);}(_0x5204,0xdf));var _0x4520=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x5204[_0x576170];return _0x397c70;};'use strict';var pdf=require(_0x4520('0x0'));var emlformat=require(_0x4520('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4520('0x2'));var jsonpatch=require(_0x4520('0x3'));var rp=require(_0x4520('0x4'));var moment=require(_0x4520('0x5'));var BPromise=require(_0x4520('0x6'));var Mustache=require('mustache');var util=require(_0x4520('0x7'));var path=require('path');var sox=require(_0x4520('0x8'));var csv=require(_0x4520('0x9'));var ejs=require(_0x4520('0xa'));var fs=require('fs');var _=require(_0x4520('0xb'));var squel=require(_0x4520('0xc'));var crypto=require(_0x4520('0xd'));var jsforce=require(_0x4520('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4520('0x9'));var querystring=require('querystring');var Papa=require(_0x4520('0xf'));var authService=require(_0x4520('0x10'));var hardwareService=require(_0x4520('0x11'));var Redis=require(_0x4520('0x12'));var qs=require(_0x4520('0x13'));var logger=require(_0x4520('0x14'))(_0x4520('0x15'));var utils=require(_0x4520('0x16'));var config=require(_0x4520('0x17'));var db=require(_0x4520('0x18'))['db'];function respondWithStatusCode(_0x3754b3,_0x394072){_0x394072=_0x394072||0xcc;return function(_0x3c7a5d){if(_0x3c7a5d){return _0x3754b3[_0x4520('0x19')](_0x394072);}return _0x3754b3[_0x4520('0x1a')](_0x394072)[_0x4520('0x1b')]();};}function respondWithResult(_0x16737b,_0x4677d7){_0x4677d7=_0x4677d7||0xc8;return function(_0x426836){if(_0x426836){return _0x16737b[_0x4520('0x1a')](_0x4677d7)[_0x4520('0x1c')](_0x426836);}};}function respondWithFilteredResult(_0x48b3e7,_0x3e53e5){return function(_0x20de6b){if(_0x20de6b){var _0x1ab841=_0x20de6b[_0x4520('0x1d')],_0x15a31f=_0x3e53e5[_0x4520('0x1e')],_0x32d8aa=_0x3e53e5[_0x4520('0x1e')]+_0x3e53e5[_0x4520('0x1f')],_0x51d85f;if(_0x32d8aa>=_0x1ab841){_0x32d8aa=_0x1ab841;_0x51d85f=0xc8;}else{_0x51d85f=0xce;}_0x48b3e7[_0x4520('0x1a')](_0x51d85f);return _0x48b3e7[_0x4520('0x20')](_0x4520('0x21'),_0x15a31f+'-'+_0x32d8aa+'/'+_0x1ab841)[_0x4520('0x1c')](_0x20de6b);}return null;};}function patchUpdates(_0x3791b6){return function(_0x11eaea){try{jsonpatch[_0x4520('0x22')](_0x11eaea,_0x3791b6,!![]);}catch(_0x460521){return BPromise['reject'](_0x460521);}return _0x11eaea[_0x4520('0x23')]();};}function saveUpdates(_0x52ca8c,_0x5ceff6){return function(_0x4c46c5){if(_0x4c46c5){return _0x4c46c5[_0x4520('0x24')](_0x52ca8c)['then'](function(_0x39e196){return _0x39e196;});}return null;};}function removeEntity(_0x270dc2,_0x428d36){return function(_0x534b15){if(_0x534b15){return _0x534b15[_0x4520('0x25')]()[_0x4520('0x26')](function(){var _0x3b2ede=_0x534b15['get']({'plain':!![]});var _0x198c34=_0x4520('0x27');return db[_0x4520('0x28')][_0x4520('0x25')]({'where':{'type':_0x198c34,'resourceId':_0x3b2ede['id']}})[_0x4520('0x26')](function(){return _0x534b15;});})['then'](function(){_0x270dc2[_0x4520('0x1a')](0xcc)[_0x4520('0x1b')]();});}};}function handleEntityNotFound(_0x3532aa,_0x3e2906){return function(_0x57306b){if(!_0x57306b){_0x3532aa[_0x4520('0x19')](0x194);}return _0x57306b;};}function handleError(_0x4602a4,_0x92168b){_0x92168b=_0x92168b||0x1f4;return function(_0x21e1f3){logger[_0x4520('0x29')](_0x21e1f3[_0x4520('0x2a')]);if(_0x21e1f3[_0x4520('0x2b')]){delete _0x21e1f3[_0x4520('0x2b')];}_0x4602a4[_0x4520('0x1a')](_0x92168b)[_0x4520('0x2c')](_0x21e1f3);};}exports['index']=function(_0x222dbd,_0x5c1a0b){var _0x7ce8d2={},_0x14778a={},_0x43b4a2={'count':0x0,'rows':[]};var _0x157293=db[_0x4520('0x2d')][_0x4520('0x2e')];_0x14778a['model']=_[_0x4520('0x2f')](_0x157293);_0x14778a['query']=_[_0x4520('0x2f')](_0x222dbd['query']);_0x14778a[_0x4520('0x30')]=_['intersection'](_0x14778a[_0x4520('0x31')],_0x14778a['query']);_0x7ce8d2['attributes']=_[_0x4520('0x32')](_0x14778a[_0x4520('0x31')],qs[_0x4520('0x33')](_0x222dbd['query'][_0x4520('0x33')]));_0x7ce8d2[_0x4520('0x34')]=_0x7ce8d2[_0x4520('0x34')][_0x4520('0x35')]?_0x7ce8d2['attributes']:_0x14778a['model'];if(!_0x222dbd[_0x4520('0x36')][_0x4520('0x37')]('nolimit')){_0x7ce8d2[_0x4520('0x1f')]=qs[_0x4520('0x1f')](_0x222dbd[_0x4520('0x36')][_0x4520('0x1f')]);_0x7ce8d2[_0x4520('0x1e')]=qs[_0x4520('0x1e')](_0x222dbd['query'][_0x4520('0x1e')]);}_0x7ce8d2[_0x4520('0x38')]=qs['sort'](_0x222dbd[_0x4520('0x36')]['sort']);_0x7ce8d2[_0x4520('0x39')]=qs[_0x4520('0x30')](_['pick'](_0x222dbd['query'],_0x14778a['filters']));if(_0x222dbd[_0x4520('0x36')][_0x4520('0x3a')]){_0x7ce8d2[_0x4520('0x39')]=_[_0x4520('0x3b')](_0x7ce8d2[_0x4520('0x39')],{'$or':_[_0x4520('0x3c')](_0x157293,function(_0x3bfc83){if(_0x3bfc83['type'][_0x4520('0x3d')]!==_0x4520('0x3e')){var _0x2f2fab={};_0x2f2fab[_0x3bfc83['field']]={'$like':'%'+_0x222dbd[_0x4520('0x36')][_0x4520('0x3a')]+'%'};return _0x2f2fab;}})});}_0x7ce8d2=_['merge']({},_0x7ce8d2,_0x222dbd['options']);var _0x1c4fd2={'where':_0x7ce8d2[_0x4520('0x39')]};return db[_0x4520('0x2d')][_0x4520('0x1d')](_0x1c4fd2)[_0x4520('0x26')](function(_0x5ca832){_0x43b4a2['count']=_0x5ca832;if(_0x222dbd['query'][_0x4520('0x3f')]){_0x7ce8d2['include']=[{'all':!![]}];}return db[_0x4520('0x2d')]['findAll'](_0x7ce8d2);})['then'](function(_0x2ff616){_0x43b4a2[_0x4520('0x40')]=_0x2ff616;return _0x43b4a2;})[_0x4520('0x26')](respondWithFilteredResult(_0x5c1a0b,_0x7ce8d2))[_0x4520('0x41')](handleError(_0x5c1a0b,null));};exports[_0x4520('0x42')]=function(_0x59d646,_0x1675e6){var _0x26efb0={'raw':!![],'where':{'id':_0x59d646['params']['id']}},_0x4a39d4={};_0x4a39d4[_0x4520('0x31')]=_[_0x4520('0x2f')](db['Tag'][_0x4520('0x2e')]);_0x4a39d4[_0x4520('0x36')]=_[_0x4520('0x2f')](_0x59d646[_0x4520('0x36')]);_0x4a39d4['filters']=_[_0x4520('0x32')](_0x4a39d4[_0x4520('0x31')],_0x4a39d4[_0x4520('0x36')]);_0x26efb0[_0x4520('0x34')]=_[_0x4520('0x32')](_0x4a39d4[_0x4520('0x31')],qs[_0x4520('0x33')](_0x59d646[_0x4520('0x36')][_0x4520('0x33')]));_0x26efb0[_0x4520('0x34')]=_0x26efb0[_0x4520('0x34')][_0x4520('0x35')]?_0x26efb0[_0x4520('0x34')]:_0x4a39d4[_0x4520('0x31')];if(_0x59d646[_0x4520('0x36')][_0x4520('0x3f')]){_0x26efb0[_0x4520('0x43')]=[{'all':!![]}];}_0x26efb0=_['merge']({},_0x26efb0,_0x59d646[_0x4520('0x44')]);return db[_0x4520('0x2d')]['find'](_0x26efb0)['then'](handleEntityNotFound(_0x1675e6,null))['then'](respondWithResult(_0x1675e6,null))['catch'](handleError(_0x1675e6,null));};exports[_0x4520('0x45')]=function(_0x5b96f8,_0x2f16f4){return db[_0x4520('0x2d')][_0x4520('0x45')](_0x5b96f8[_0x4520('0x46')],{})[_0x4520('0x26')](function(_0x5e3eef){var _0x2b89be=_0x5b96f8[_0x4520('0x47')][_0x4520('0x48')]({'plain':!![]});if(!_0x2b89be)throw new Error(_0x4520('0x49'));if(_0x2b89be[_0x4520('0x4a')]===_0x4520('0x47')){var _0x737ba4=_0x5e3eef[_0x4520('0x48')]({'plain':!![]});var _0x17e353=_0x4520('0x27');return db[_0x4520('0x4b')][_0x4520('0x4c')]({'where':{'name':_0x17e353,'userProfileId':_0x2b89be['userProfileId']},'raw':!![]})['then'](function(_0x2f14c1){if(_0x2f14c1&&_0x2f14c1[_0x4520('0x4d')]===0x0){return db[_0x4520('0x28')]['create']({'name':_0x737ba4[_0x4520('0x2b')],'resourceId':_0x737ba4['id'],'type':_0x2f14c1[_0x4520('0x2b')],'sectionId':_0x2f14c1['id']},{})[_0x4520('0x26')](function(){return _0x5e3eef;});}else{return _0x5e3eef;}})['catch'](function(_0x2a976a){logger[_0x4520('0x29')](_0x4520('0x4e'),_0x2a976a);throw _0x2a976a;});}return _0x5e3eef;})['then'](respondWithResult(_0x2f16f4,0xc9))['catch'](handleError(_0x2f16f4,null));};exports[_0x4520('0x24')]=function(_0x24a6a4,_0x24269e){if(_0x24a6a4[_0x4520('0x46')]['id']){delete _0x24a6a4[_0x4520('0x46')]['id'];}return db[_0x4520('0x2d')][_0x4520('0x4c')]({'where':{'id':_0x24a6a4[_0x4520('0x4f')]['id']}})['then'](handleEntityNotFound(_0x24269e,null))[_0x4520('0x26')](saveUpdates(_0x24a6a4[_0x4520('0x46')],null))[_0x4520('0x26')](respondWithResult(_0x24269e,null))[_0x4520('0x41')](handleError(_0x24269e,null));};exports[_0x4520('0x25')]=function(_0x253011,_0x2b09a1){return db[_0x4520('0x2d')][_0x4520('0x4c')]({'where':{'id':_0x253011[_0x4520('0x4f')]['id']}})[_0x4520('0x26')](handleEntityNotFound(_0x2b09a1,null))[_0x4520('0x26')](removeEntity(_0x2b09a1,null))[_0x4520('0x41')](handleError(_0x2b09a1,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 0e6ec46..abd06db 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 _0x1ec8=['Tag','tools_tags','lodash','util','api','moment','request-promise','define'];(function(_0x83cc7b,_0x337a6b){var _0x77e5ab=function(_0xe70954){while(--_0xe70954){_0x83cc7b['push'](_0x83cc7b['shift']());}};_0x77e5ab(++_0x337a6b);}(_0x1ec8,0x82));var _0x81ec=function(_0x46da94,_0x39e384){_0x46da94=_0x46da94-0x0;var _0x508c80=_0x1ec8[_0x46da94];return _0x508c80;};'use strict';var _=require(_0x81ec('0x0'));var util=require(_0x81ec('0x1'));var logger=require('../../config/logger')(_0x81ec('0x2'));var moment=require(_0x81ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x81ec('0x4'));var attributes=require('./tag.attributes');module['exports']=function(_0x554544,_0x5081d0){return _0x554544[_0x81ec('0x5')](_0x81ec('0x6'),attributes,{'tableName':_0x81ec('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe043=['bluebird','define','tools_tags','lodash','util','api'];(function(_0x4d18b5,_0x2727bb){var _0x501863=function(_0x38da40){while(--_0x38da40){_0x4d18b5['push'](_0x4d18b5['shift']());}};_0x501863(++_0x2727bb);}(_0xe043,0x1d1));var _0x3e04=function(_0x5361fc,_0x20af8e){_0x5361fc=_0x5361fc-0x0;var _0x8e396c=_0xe043[_0x5361fc];return _0x8e396c;};'use strict';var _=require(_0x3e04('0x0'));var util=require(_0x3e04('0x1'));var logger=require('../../config/logger')(_0x3e04('0x2'));var moment=require('moment');var BPromise=require(_0x3e04('0x3'));var rp=require('request-promise');var attributes=require('./tag.attributes');module['exports']=function(_0x397fff,_0x51f2db){return _0x397fff[_0x3e04('0x4')]('Tag',attributes,{'tableName':_0x3e04('0x5'),'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 d9ac353..c3eef6f 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 _0x343d=['stringify','code','error','message','result','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x4aba66,_0x1d803d){var _0x3d7ebe=function(_0x37e689){while(--_0x37e689){_0x4aba66['push'](_0x4aba66['shift']());}};_0x3d7ebe(++_0x1d803d);}(_0x343d,0x7d));var _0xd343=function(_0x3e3064,_0x3dd6f5){_0x3e3064=_0x3e3064-0x0;var _0x4547e1=_0x343d[_0x3e3064];return _0x4547e1;};'use strict';var _=require(_0xd343('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd343('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd343('0x2'))['db'];var utils=require(_0xd343('0x3'));var logger=require(_0xd343('0x4'))(_0xd343('0x5'));var config=require(_0xd343('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd343('0x7')][_0xd343('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5012ff,_0x12f810,_0x225fb7){return new BPromise(function(_0x57a567,_0x5517f3){return client['request'](_0x5012ff,_0x225fb7)[_0xd343('0x9')](function(_0xfee5e7){logger[_0xd343('0xa')](_0xd343('0xb'),_0x12f810,_0xd343('0xc'));logger[_0xd343('0xd')](_0xd343('0xe'),_0x12f810,'request\x20sent',JSON[_0xd343('0xf')](_0xfee5e7));if(_0xfee5e7['error']){if(_0xfee5e7['error'][_0xd343('0x10')]===0x1f4){logger['error'](_0xd343('0xb'),_0x12f810,_0xfee5e7[_0xd343('0x11')][_0xd343('0x12')]);return _0x5517f3(_0xfee5e7[_0xd343('0x11')]['message']);}logger[_0xd343('0x11')](_0xd343('0xb'),_0x12f810,_0xfee5e7['error']['message']);return _0x57a567(_0xfee5e7[_0xd343('0x11')][_0xd343('0x12')]);}else{logger[_0xd343('0xa')](_0xd343('0xb'),_0x12f810,'request\x20sent');_0x57a567(_0xfee5e7[_0xd343('0x13')][_0xd343('0x12')]);}})['catch'](function(_0xd01142){logger['error'](_0xd343('0xb'),_0x12f810,_0xd01142);_0x5517f3(_0xd01142);});});} \ No newline at end of file +var _0x72da=['info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0xc368af,_0x1a5b71){var _0x1dcbc6=function(_0x4f648f){while(--_0x4f648f){_0xc368af['push'](_0xc368af['shift']());}};_0x1dcbc6(++_0x1a5b71);}(_0x72da,0xca));var _0xa72d=function(_0x2d1cf4,_0x2ea9ee){_0x2d1cf4=_0x2d1cf4-0x0;var _0x554a7c=_0x72da[_0x2d1cf4];return _0x554a7c;};'use strict';var _=require(_0xa72d('0x0'));var util=require(_0xa72d('0x1'));var moment=require(_0xa72d('0x2'));var BPromise=require('bluebird');var rs=require(_0xa72d('0x3'));var fs=require('fs');var Redis=require(_0xa72d('0x4'));var db=require(_0xa72d('0x5'))['db'];var utils=require(_0xa72d('0x6'));var logger=require(_0xa72d('0x7'))(_0xa72d('0x8'));var config=require(_0xa72d('0x9'));var jayson=require(_0xa72d('0xa'));var client=jayson[_0xa72d('0xb')][_0xa72d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2028c3,_0x508098,_0x18b326){return new BPromise(function(_0x4a5118,_0x572f3f){return client['request'](_0x2028c3,_0x18b326)[_0xa72d('0xd')](function(_0x49f9c7){logger[_0xa72d('0xe')](_0xa72d('0xf'),_0x508098,_0xa72d('0x10'));logger[_0xa72d('0x11')](_0xa72d('0x12'),_0x508098,'request\x20sent',JSON['stringify'](_0x49f9c7));if(_0x49f9c7[_0xa72d('0x13')]){if(_0x49f9c7['error'][_0xa72d('0x14')]===0x1f4){logger['error'](_0xa72d('0xf'),_0x508098,_0x49f9c7['error'][_0xa72d('0x15')]);return _0x572f3f(_0x49f9c7[_0xa72d('0x13')][_0xa72d('0x15')]);}logger[_0xa72d('0x13')]('Tag,\x20%s,\x20%s',_0x508098,_0x49f9c7[_0xa72d('0x13')][_0xa72d('0x15')]);return _0x4a5118(_0x49f9c7[_0xa72d('0x13')][_0xa72d('0x15')]);}else{logger[_0xa72d('0xe')](_0xa72d('0xf'),_0x508098,'request\x20sent');_0x4a5118(_0x49f9c7[_0xa72d('0x16')]['message']);}})[_0xa72d('0x17')](function(_0x5350a5){logger[_0xa72d('0x13')](_0xa72d('0xf'),_0x508098,_0x5350a5);_0x572f3f(_0x5350a5);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 155a254..df38f61 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 _0xd040=['post','addAgents','put','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','/:id','/:id/queues','/:id/users','getAgents'];(function(_0x1200e9,_0x1a23a4){var _0x2c1ac4=function(_0x1e87e4){while(--_0x1e87e4){_0x1200e9['push'](_0x1200e9['shift']());}};_0x2c1ac4(++_0x1a23a4);}(_0xd040,0x1bd));var _0x0d04=function(_0x1ba4c1,_0x3f409f){_0x1ba4c1=_0x1ba4c1-0x0;var _0x42304c=_0xd040[_0x1ba4c1];return _0x42304c;};'use strict';var multer=require(_0x0d04('0x0'));var util=require('util');var path=require(_0x0d04('0x1'));var timeout=require(_0x0d04('0x2'));var express=require(_0x0d04('0x3'));var router=express[_0x0d04('0x4')]();var auth=require(_0x0d04('0x5'));var interaction=require(_0x0d04('0x6'));var config=require(_0x0d04('0x7'));var controller=require(_0x0d04('0x8'));router[_0x0d04('0x9')]('/',auth[_0x0d04('0xa')](),controller['index']);router[_0x0d04('0x9')](_0x0d04('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0d04('0x9')](_0x0d04('0xc'),auth[_0x0d04('0xa')](),controller['getQueues']);router[_0x0d04('0x9')](_0x0d04('0xd'),auth[_0x0d04('0xa')](),controller[_0x0d04('0xe')]);router[_0x0d04('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0d04('0xa')](),controller['addQueues']);router[_0x0d04('0xf')]('/:id/users',auth[_0x0d04('0xa')](),controller[_0x0d04('0x10')]);router[_0x0d04('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0d04('0x12')]);router[_0x0d04('0x13')](_0x0d04('0xb'),auth[_0x0d04('0xa')](),controller[_0x0d04('0x14')]);router[_0x0d04('0x13')](_0x0d04('0xc'),auth[_0x0d04('0xa')](),controller['removeQueues']);router[_0x0d04('0x13')](_0x0d04('0xd'),auth[_0x0d04('0xa')](),controller[_0x0d04('0x15')]);module[_0x0d04('0x16')]=router; \ No newline at end of file +var _0x9919=['exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','isAuthenticated','index','get','show','/:id/queues','getQueues','/:id/users','getAgents','post','addQueues','addAgents','put','update','destroy','delete','removeQueues','removeAgents'];(function(_0x15781b,_0x308bc5){var _0xc4492a=function(_0xe2b083){while(--_0xe2b083){_0x15781b['push'](_0x15781b['shift']());}};_0xc4492a(++_0x308bc5);}(_0x9919,0x114));var _0x9991=function(_0x50a448,_0x3d1a4d){_0x50a448=_0x50a448-0x0;var _0x5da8c6=_0x9919[_0x50a448];return _0x5da8c6;};'use strict';var multer=require(_0x9991('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9991('0x1'));var express=require('express');var router=express[_0x9991('0x2')]();var auth=require(_0x9991('0x3'));var interaction=require(_0x9991('0x4'));var config=require(_0x9991('0x5'));var controller=require(_0x9991('0x6'));router['get']('/',auth[_0x9991('0x7')](),controller[_0x9991('0x8')]);router[_0x9991('0x9')]('/:id',auth[_0x9991('0x7')](),controller[_0x9991('0xa')]);router['get'](_0x9991('0xb'),auth['isAuthenticated'](),controller[_0x9991('0xc')]);router['get'](_0x9991('0xd'),auth['isAuthenticated'](),controller[_0x9991('0xe')]);router[_0x9991('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9991('0xf')](_0x9991('0xb'),auth[_0x9991('0x7')](),controller[_0x9991('0x10')]);router[_0x9991('0xf')](_0x9991('0xd'),auth[_0x9991('0x7')](),controller[_0x9991('0x11')]);router[_0x9991('0x12')]('/:id',auth[_0x9991('0x7')](),controller[_0x9991('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9991('0x14')]);router[_0x9991('0x15')](_0x9991('0xb'),auth[_0x9991('0x7')](),controller[_0x9991('0x16')]);router[_0x9991('0x15')](_0x9991('0xd'),auth[_0x9991('0x7')](),controller[_0x9991('0x17')]);module[_0x9991('0x18')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 76c5415..99230a9 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 _0x8d97=['name','STRING','sequelize','exports'];(function(_0x5241f2,_0x3fd970){var _0x8555e6=function(_0x38dfae){while(--_0x38dfae){_0x5241f2['push'](_0x5241f2['shift']());}};_0x8555e6(++_0x3fd970);}(_0x8d97,0x12e));var _0x78d9=function(_0x48817d,_0x12a7cf){_0x48817d=_0x48817d-0x0;var _0x3ffdae=_0x8d97[_0x48817d];return _0x3ffdae;};'use strict';var Sequelize=require(_0x78d9('0x0'));module[_0x78d9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x78d9('0x2')},'description':{'type':Sequelize[_0x78d9('0x3')]}}; \ No newline at end of file +var _0xa3e2=['sequelize','exports','STRING','name'];(function(_0x540d50,_0x3b2fb4){var _0x4cc2a2=function(_0x4f4dbe){while(--_0x4f4dbe){_0x540d50['push'](_0x540d50['shift']());}};_0x4cc2a2(++_0x3b2fb4);}(_0xa3e2,0xd0));var _0x2a3e=function(_0x3d7fb5,_0x16eb5c){_0x3d7fb5=_0x3d7fb5-0x0;var _0x3a9642=_0xa3e2[_0x3d7fb5];return _0x3a9642;};'use strict';var Sequelize=require(_0x2a3e('0x0'));module[_0x2a3e('0x1')]={'name':{'type':Sequelize[_0x2a3e('0x2')],'allowNull':![],'unique':_0x2a3e('0x3')},'description':{'type':Sequelize[_0x2a3e('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 7fd33a9..64a9d63 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 _0xa9e0=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','findOne','add','ids','removeQueues','remove','voice','chat','mail','sms','fax','openchannel','each','addAgents','User','findAll','loginInPause','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','removeAgents','isArray','emit','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){return BPromise['each']([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x40fc56){return _0x361b21[_0x0a9e('0x25')+_[_0x0a9e('0x55')](_0x40fc56)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x40fc56===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]});}})[_0x0a9e('0x23')](function(_0x53a6a1){if(_0x40fc56===_0x0a9e('0x60')){return BPromise[_0x0a9e('0x66')](_0x53a6a1,function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){var _0x9044fe;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x81d748,null))[_0x0a9e('0x23')](function(_0x5955f1){if(_0x5955f1){return BPromise[_0x0a9e('0x66')]([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),'sms',_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x1d4877){return _0x5955f1['get'+_[_0x0a9e('0x55')](_0x1d4877)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x255e49){return BPromise[_0x0a9e('0x66')](_0x255e49,function(_0x32b9bd){return _0x32b9bd[_0x0a9e('0x74')](_0x4dc6b3['query'][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_0x1d4877==='voice'){return db[_0x0a9e('0x6c')][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x32b9bd['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids']}});}});});})[_0x0a9e('0x23')](function(){return _0x5955f1;});})['then'](function(){return _0x5955f1;});}})[_0x0a9e('0x23')](function(_0x2b5148){if(_0x2b5148){return _0x2b5148[_0x0a9e('0x74')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(_0x16a039){if(_[_0x0a9e('0x75')](_0x4dc6b3['query'][_0x0a9e('0x5d')])){for(var _0x31d25a=0x0;_0x31d25a<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x31d25a+=0x1){socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x31d25a],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids'],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x78')]=function(_0xb0599a,_0x5d9ddb,_0x3afc8c){var _0x1756c7={};var _0x5ce99d={};var _0x23b447;var _0x5e725e;return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0xb0599a[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5d9ddb,null))['then'](function(_0x3ceba6){if(_0x3ceba6){_0x23b447=_0x3ceba6;_0x5ce99d['model']=_[_0x0a9e('0x2d')](db[_0x0a9e('0x68')]['rawAttributes']);_0x5ce99d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0xb0599a[_0x0a9e('0x2e')]);_0x5ce99d['filters']=_['intersection'](_0x5ce99d[_0x0a9e('0x2c')],_0x5ce99d[_0x0a9e('0x2e')]);_0x1756c7[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5ce99d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x1756c7[_0x0a9e('0x30')]=_0x1756c7['attributes'][_0x0a9e('0x32')]?_0x1756c7['attributes']:_0x5ce99d[_0x0a9e('0x2c')];_0x1756c7[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x1756c7['where']=qs[_0x0a9e('0x36')](_[_0x0a9e('0x58')](_0xb0599a[_0x0a9e('0x2e')],_0x5ce99d[_0x0a9e('0x36')]));if(_0xb0599a[_0x0a9e('0x2e')]['filter']){_0x1756c7['where']=_[_0x0a9e('0x38')](_0x1756c7['where'],{'$or':_[_0x0a9e('0x3a')](_0x1756c7[_0x0a9e('0x30')],function(_0x4672e1){var _0x16313e={};_0x16313e[_0x4672e1]={'$like':'%'+_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x16313e;})});}_0x1756c7=_['merge']({},_0x1756c7,_0xb0599a['options']);return _0x23b447[_0x0a9e('0x78')](_0x1756c7);}})['then'](function(_0x2469d1){if(_0x2469d1){_0x5e725e=_0x2469d1['length'];if(!_0xb0599a[_0x0a9e('0x2e')]['hasOwnProperty']('nolimit')){_0x1756c7[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0xb0599a['query'][_0x0a9e('0x1d')]);_0x1756c7[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x23b447['getAgents'](_0x1756c7);}})['then'](function(_0x16449b){if(_0x16449b){return _0x16449b?{'count':_0x5e725e,'rows':_0x16449b}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x5d9ddb,null))[_0x0a9e('0x42')](handleError(_0x5d9ddb,null));}; \ No newline at end of file +var _0xa9e0=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','findOne','add','ids','removeQueues','remove','voice','chat','mail','sms','fax','openchannel','each','addAgents','User','findAll','loginInPause','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','omit','spread','userTeam:save','removeAgents','isArray','emit','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','Team','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./team.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='Teams';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['Team'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')](_0x562fb4[_0x0a9e('0x47')],{})[_0x0a9e('0x23')](function(_0x37be73){var _0x45bf7f=_0x562fb4['user'][_0x0a9e('0x25')]({'plain':!![]});if(!_0x45bf7f)throw new Error(_0x0a9e('0x48'));if(_0x45bf7f[_0x0a9e('0x49')]===_0x0a9e('0x4a')){var _0x409789=_0x37be73[_0x0a9e('0x25')]({'plain':!![]});var _0x6054ee=_0x0a9e('0x4b');return db[_0x0a9e('0x4c')]['find']({'where':{'name':_0x6054ee,'userProfileId':_0x45bf7f[_0x0a9e('0x4d')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x4f7240){if(_0x4f7240&&_0x4f7240['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x46')]({'name':_0x409789[_0x0a9e('0x28')],'resourceId':_0x409789['id'],'type':_0x4f7240[_0x0a9e('0x28')],'sectionId':_0x4f7240['id']},{})[_0x0a9e('0x23')](function(){return _0x37be73;});}else{return _0x37be73;}})[_0x0a9e('0x42')](function(_0x30decb){logger[_0x0a9e('0x26')](_0x0a9e('0x4e'),_0x30decb);throw _0x30decb;});}return _0x37be73;})['then'](respondWithResult(_0x14bec2,0xc9))['catch'](handleError(_0x14bec2,null));};exports['update']=function(_0x39d77d,_0x204173){if(_0x39d77d[_0x0a9e('0x47')]['id']){delete _0x39d77d['body']['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x39d77d['params']['id']}})['then'](handleEntityNotFound(_0x204173,null))[_0x0a9e('0x23')](saveUpdates(_0x39d77d['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x204173,null))['catch'](handleError(_0x204173,null));};exports[_0x0a9e('0x24')]=function(_0x3c20b2,_0x439340){return db['Team'][_0x0a9e('0x45')]({'where':{'id':_0x3c20b2[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x439340,null))['then'](removeEntity(_0x439340,null))[_0x0a9e('0x42')](handleError(_0x439340,null));};exports[_0x0a9e('0x4f')]=function(_0x49c095,_0x145931,_0x5ce9ac){return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x49c095[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](function(_0x5df0ad){if(!_0x49c095[_0x0a9e('0x2e')]['channel']||!utils[_0x0a9e('0x50')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}var _0xd10662={};var _0x28d814={};_0x28d814['model']=_[_0x0a9e('0x2d')](db[_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+_0x0a9e('0x57')]['rawAttributes']);_0x28d814[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x49c095['query']);_0x28d814[_0x0a9e('0x36')]=_['intersection'](_0x28d814[_0x0a9e('0x2c')],_0x28d814['query']);_0xd10662['attributes']=_['intersection'](_0x28d814[_0x0a9e('0x2c')],qs['fields'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0xd10662[_0x0a9e('0x30')]=_0xd10662[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0xd10662[_0x0a9e('0x30')]:_0x28d814['model'];_0xd10662[_0x0a9e('0x1d')]=qs['limit'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0xd10662[_0x0a9e('0x1c')]=qs['offset'](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);_0xd10662[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x49c095['query'][_0x0a9e('0x35')]);_0xd10662[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x58')](_0x49c095[_0x0a9e('0x2e')],_0x28d814[_0x0a9e('0x36')]));_0xd10662=_[_0x0a9e('0x38')]({},_0xd10662,_0x49c095[_0x0a9e('0x3e')]);return _0x5df0ad['get'+_[_0x0a9e('0x55')](_0x49c095[_0x0a9e('0x2e')][_0x0a9e('0x51')]['toLowerCase']())+_0x0a9e('0x59')](_0xd10662);})['then'](respondWithResult(_0x145931,null))['catch'](handleError(_0x145931,null));};exports[_0x0a9e('0x5a')]=function(_0x4556c5,_0x9375fb,_0x19c995){return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0x4556c5[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x2d7205){if(_0x2d7205){if(!_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')])){throw new db[(_0x0a9e('0x52'))][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x2d7205[_0x0a9e('0x5c')+_['capitalize'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x51')][_0x0a9e('0x56')]())+'Queues'](_0x4556c5[_0x0a9e('0x47')][_0x0a9e('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x9375fb,null))[_0x0a9e('0x42')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x5e')]=function(_0x427946,_0x13b5c0,_0x4a43a8){return db['Team']['findOne']({'where':{'id':_0x427946[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](function(_0x1104ad){if(_0x1104ad){if(!_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')]||!utils[_0x0a9e('0x50')](_0x427946[_0x0a9e('0x2e')][_0x0a9e('0x51')])){throw new db['Sequelize'][(_0x0a9e('0x53'))](_0x0a9e('0x54'));}return _0x1104ad[_0x0a9e('0x5f')+_['capitalize'](_0x427946[_0x0a9e('0x2e')]['channel'][_0x0a9e('0x56')]())+_0x0a9e('0x59')](_0x427946['query'][_0x0a9e('0x5d')]);}return null;})[_0x0a9e('0x23')](handleEntityNotFound(_0x13b5c0,null))[_0x0a9e('0x23')](respondWithStatusCode(_0x13b5c0,null))[_0x0a9e('0x42')](handleError(_0x13b5c0,null));};exports['addAgents']=function(_0x1d442c,_0x2e9552,_0x371533){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x1d442c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2e9552,null))[_0x0a9e('0x23')](function(_0x361b21){if(_0x361b21){return BPromise['each']([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x40fc56){return _0x361b21[_0x0a9e('0x25')+_[_0x0a9e('0x55')](_0x40fc56)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x25744a){return BPromise[_0x0a9e('0x66')](_0x25744a,function(_0x5b35db){return _0x5b35db[_0x0a9e('0x67')](_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')])['then'](function(){if(_0x40fc56===_0x0a9e('0x60')){return db[_0x0a9e('0x68')][_0x0a9e('0x69')]({'where':{'id':_0x1d442c[_0x0a9e('0x47')]['ids']},'attributes':['id','name',_0x0a9e('0x6a'),_0x0a9e('0x6b'),'interface'],'raw':!![]});}})[_0x0a9e('0x23')](function(_0x53a6a1){if(_0x40fc56===_0x0a9e('0x60')){return BPromise[_0x0a9e('0x66')](_0x53a6a1,function(_0x5637a1){return db[_0x0a9e('0x6c')][_0x0a9e('0x6d')]({'membername':_0x5637a1[_0x0a9e('0x28')],'UserId':_0x5637a1['id'],'queue_name':_0x5b35db[_0x0a9e('0x28')],'VoiceQueueId':_0x5b35db['id'],'interface':_[_0x0a9e('0x6e')](_0x5637a1[_0x0a9e('0x6f')])?util[_0x0a9e('0x70')]('SIP/%s',_0x5637a1[_0x0a9e('0x28')]):_0x5637a1[_0x0a9e('0x6f')],'paused':_0x5637a1[_0x0a9e('0x6b')]||![],'penalty':0x0});});}});});})[_0x0a9e('0x23')](function(){return _0x361b21;});})['then'](function(){return _0x361b21;});}})[_0x0a9e('0x23')](function(_0xf0db1){if(_0xf0db1){return _0xf0db1['addAgents'](_0x1d442c[_0x0a9e('0x47')]['ids'],_[_0x0a9e('0x71')](_0x1d442c[_0x0a9e('0x47')],[_0x0a9e('0x5d'),'id'])||{})[_0x0a9e('0x72')](function(_0x5af453){for(var _0x51ccd7=0x0;_0x51ccd7<_0x1d442c[_0x0a9e('0x47')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x51ccd7+=0x1){socket['emit'](_0x0a9e('0x73'),{'UserId':_0x1d442c[_0x0a9e('0x47')]['ids'][_0x51ccd7],'TeamId':_0x1d442c['params']['id']});}return _0x5af453;});}})[_0x0a9e('0x23')](respondWithResult(_0x2e9552,null))['catch'](handleError(_0x2e9552,null));};exports['removeAgents']=function(_0x4dc6b3,_0x81d748,_0xf3601c){var _0x9044fe;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4dc6b3[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x81d748,null))[_0x0a9e('0x23')](function(_0x5955f1){if(_0x5955f1){return BPromise[_0x0a9e('0x66')]([_0x0a9e('0x60'),_0x0a9e('0x61'),_0x0a9e('0x62'),'sms',_0x0a9e('0x64'),_0x0a9e('0x65')],function(_0x1d4877){return _0x5955f1['get'+_[_0x0a9e('0x55')](_0x1d4877)+_0x0a9e('0x59')]({'attributes':['id',_0x0a9e('0x28')]})[_0x0a9e('0x23')](function(_0x255e49){return BPromise[_0x0a9e('0x66')](_0x255e49,function(_0x32b9bd){return _0x32b9bd[_0x0a9e('0x74')](_0x4dc6b3['query'][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(){if(_0x1d4877==='voice'){return db[_0x0a9e('0x6c')][_0x0a9e('0x24')]({'where':{'VoiceQueueId':_0x32b9bd['id'],'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids']}});}});});})[_0x0a9e('0x23')](function(){return _0x5955f1;});})['then'](function(){return _0x5955f1;});}})[_0x0a9e('0x23')](function(_0x2b5148){if(_0x2b5148){return _0x2b5148[_0x0a9e('0x74')](_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')])[_0x0a9e('0x23')](function(_0x16a039){if(_[_0x0a9e('0x75')](_0x4dc6b3['query'][_0x0a9e('0x5d')])){for(var _0x31d25a=0x0;_0x31d25a<_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x0a9e('0x32')];_0x31d25a+=0x1){socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')][_0x0a9e('0x5d')][_0x31d25a],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x76')](_0x0a9e('0x77'),{'UserId':_0x4dc6b3[_0x0a9e('0x2e')]['ids'],'TeamId':_0x4dc6b3[_0x0a9e('0x44')]['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x81d748,null))[_0x0a9e('0x42')](handleError(_0x81d748,null));};exports[_0x0a9e('0x78')]=function(_0xb0599a,_0x5d9ddb,_0x3afc8c){var _0x1756c7={};var _0x5ce99d={};var _0x23b447;var _0x5e725e;return db[_0x0a9e('0x2a')][_0x0a9e('0x5b')]({'where':{'id':_0xb0599a[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5d9ddb,null))['then'](function(_0x3ceba6){if(_0x3ceba6){_0x23b447=_0x3ceba6;_0x5ce99d['model']=_[_0x0a9e('0x2d')](db[_0x0a9e('0x68')]['rawAttributes']);_0x5ce99d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0xb0599a[_0x0a9e('0x2e')]);_0x5ce99d['filters']=_['intersection'](_0x5ce99d[_0x0a9e('0x2c')],_0x5ce99d[_0x0a9e('0x2e')]);_0x1756c7[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5ce99d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x1756c7[_0x0a9e('0x30')]=_0x1756c7['attributes'][_0x0a9e('0x32')]?_0x1756c7['attributes']:_0x5ce99d[_0x0a9e('0x2c')];_0x1756c7[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x35')]);_0x1756c7['where']=qs[_0x0a9e('0x36')](_[_0x0a9e('0x58')](_0xb0599a[_0x0a9e('0x2e')],_0x5ce99d[_0x0a9e('0x36')]));if(_0xb0599a[_0x0a9e('0x2e')]['filter']){_0x1756c7['where']=_[_0x0a9e('0x38')](_0x1756c7['where'],{'$or':_[_0x0a9e('0x3a')](_0x1756c7[_0x0a9e('0x30')],function(_0x4672e1){var _0x16313e={};_0x16313e[_0x4672e1]={'$like':'%'+_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x16313e;})});}_0x1756c7=_['merge']({},_0x1756c7,_0xb0599a['options']);return _0x23b447[_0x0a9e('0x78')](_0x1756c7);}})['then'](function(_0x2469d1){if(_0x2469d1){_0x5e725e=_0x2469d1['length'];if(!_0xb0599a[_0x0a9e('0x2e')]['hasOwnProperty']('nolimit')){_0x1756c7[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0xb0599a['query'][_0x0a9e('0x1d')]);_0x1756c7[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0xb0599a[_0x0a9e('0x2e')][_0x0a9e('0x1c')]);}return _0x23b447['getAgents'](_0x1756c7);}})['then'](function(_0x16449b){if(_0x16449b){return _0x16449b?{'count':_0x5e725e,'rows':_0x16449b}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x5d9ddb,null))[_0x0a9e('0x42')](handleError(_0x5d9ddb,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 5ec2cd8..1f89a64 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 _0x536d=['hasOwnProperty','hook','../../mysqldb','Team','save','update','remove','emit'];(function(_0x4d6b6c,_0x85cd9){var _0x5bfdc9=function(_0x317b4f){while(--_0x317b4f){_0x4d6b6c['push'](_0x4d6b6c['shift']());}};_0x5bfdc9(++_0x85cd9);}(_0x536d,0x192));var _0xd536=function(_0x514689,_0x4edc26){_0x514689=_0x514689-0x0;var _0x404dbe=_0x536d[_0x514689];return _0x404dbe;};'use strict';var EventEmitter=require('events');var Team=require(_0xd536('0x0'))['db'][_0xd536('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd536('0x2'),'afterUpdate':_0xd536('0x3'),'afterDestroy':_0xd536('0x4')};function emitEvent(_0xf1362d){return function(_0x45dafc,_0x3eb12e,_0x422ed0){TeamEvents[_0xd536('0x5')](_0xf1362d+':'+_0x45dafc['id'],_0x45dafc);TeamEvents[_0xd536('0x5')](_0xf1362d,_0x45dafc);_0x422ed0(null);};}for(var e in events){if(events[_0xd536('0x6')](e)){var event=events[e];Team[_0xd536('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x3727=['exports','events','../../mysqldb','Team','save','remove','emit','hasOwnProperty'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x3727,0x171));var _0x7372=function(_0x401f53,_0x4cbf09){_0x401f53=_0x401f53-0x0;var _0x268aed=_0x3727[_0x401f53];return _0x268aed;};'use strict';var EventEmitter=require(_0x7372('0x0'));var Team=require(_0x7372('0x1'))['db'][_0x7372('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7372('0x3'),'afterUpdate':'update','afterDestroy':_0x7372('0x4')};function emitEvent(_0x381bf1){return function(_0x44ce52,_0x195b4a,_0x33f261){TeamEvents[_0x7372('0x5')](_0x381bf1+':'+_0x44ce52['id'],_0x44ce52);TeamEvents['emit'](_0x381bf1,_0x44ce52);_0x33f261(null);};}for(var e in events){if(events[_0x7372('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x7372('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index e2dd3bc..8110146 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 _0x55ca=['bluebird','request-promise','exports','define','Team','teams','lodash','util'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x55ca,0x126));var _0xa55c=function(_0x240860,_0x20c04d){_0x240860=_0x240860-0x0;var _0x40e288=_0x55ca[_0x240860];return _0x40e288;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var attributes=require('./team.attributes');module[_0xa55c('0x4')]=function(_0x2db02a,_0xcb02e3){return _0x2db02a[_0xa55c('0x5')](_0xa55c('0x6'),attributes,{'tableName':_0xa55c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['./team.attributes','exports','Team','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x4a9b37,_0x17955a){var _0x300e31=function(_0x55b471){while(--_0x55b471){_0x4a9b37['push'](_0x4a9b37['shift']());}};_0x300e31(++_0x17955a);}(_0x70e0,0x17b));var _0x070e=function(_0x3e0dca,_0x3e0a11){_0x3e0dca=_0x3e0dca-0x0;var _0x2c72b7=_0x70e0[_0x3e0dca];return _0x2c72b7;};'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 attributes=require(_0x070e('0x5'));module[_0x070e('0x6')]=function(_0x5c90fc,_0x7bce9b){return _0x5c90fc['define'](_0x070e('0x7'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 90ce03c..0f89440 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 _0x7ad6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util'];(function(_0x3069a7,_0xf5fb26){var _0xc2cf7d=function(_0x2063b8){while(--_0x2063b8){_0x3069a7['push'](_0x3069a7['shift']());}};_0xc2cf7d(++_0xf5fb26);}(_0x7ad6,0x1c0));var _0x67ad=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7ad6[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x67ad('0x0'));var util=require(_0x67ad('0x1'));var moment=require('moment');var BPromise=require(_0x67ad('0x2'));var rs=require(_0x67ad('0x3'));var fs=require('fs');var Redis=require(_0x67ad('0x4'));var db=require(_0x67ad('0x5'))['db'];var utils=require(_0x67ad('0x6'));var logger=require(_0x67ad('0x7'))(_0x67ad('0x8'));var config=require('../../config/environment');var jayson=require(_0x67ad('0x9'));var client=jayson[_0x67ad('0xa')][_0x67ad('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x67ad('0xc')],{'host':_0x67ad('0xd'),'port':0x18eb});var socket=require(_0x67ad('0xe'))(new Redis(config[_0x67ad('0xc')]));require(_0x67ad('0xf'))[_0x67ad('0x10')](socket);function respondWithRpcPromise(_0x5aa047,_0x3452a7,_0x368767){return new BPromise(function(_0x1c504c,_0x5064c6){return client[_0x67ad('0x11')](_0x5aa047,_0x368767)['then'](function(_0x4fb811){logger[_0x67ad('0x12')](_0x67ad('0x13'),_0x3452a7,'request\x20sent');logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x3452a7,_0x67ad('0x14'),JSON[_0x67ad('0x15')](_0x4fb811));if(_0x4fb811[_0x67ad('0x16')]){if(_0x4fb811[_0x67ad('0x16')]['code']===0x1f4){logger[_0x67ad('0x16')]('Team,\x20%s,\x20%s',_0x3452a7,_0x4fb811[_0x67ad('0x16')][_0x67ad('0x17')]);return _0x5064c6(_0x4fb811[_0x67ad('0x16')]['message']);}logger['error'](_0x67ad('0x13'),_0x3452a7,_0x4fb811[_0x67ad('0x16')]['message']);return _0x1c504c(_0x4fb811[_0x67ad('0x16')][_0x67ad('0x17')]);}else{logger[_0x67ad('0x12')]('Team,\x20%s,\x20%s',_0x3452a7,'request\x20sent');_0x1c504c(_0x4fb811['result'][_0x67ad('0x17')]);}})[_0x67ad('0x18')](function(_0x15fb1a){logger[_0x67ad('0x16')]('Team,\x20%s,\x20%s',_0x3452a7,_0x15fb1a);_0x5064c6(_0x15fb1a);});});} \ No newline at end of file +var _0xf1b1=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error','code','Team,\x20%s,\x20%s','message','randomstring'];(function(_0x4270d3,_0x4c1c82){var _0x5492b3=function(_0x412a1e){while(--_0x412a1e){_0x4270d3['push'](_0x4270d3['shift']());}};_0x5492b3(++_0x4c1c82);}(_0xf1b1,0xd1));var _0x1f1b=function(_0xe59443,_0x1c7fbc){_0xe59443=_0xe59443-0x0;var _0x155142=_0xf1b1[_0xe59443];return _0x155142;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1f1b('0x0'));var fs=require('fs');var Redis=require(_0x1f1b('0x1'));var db=require(_0x1f1b('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f1b('0x3'));var config=require(_0x1f1b('0x4'));var jayson=require(_0x1f1b('0x5'));var client=jayson[_0x1f1b('0x6')]['http']({'port':0x232a});config[_0x1f1b('0x7')]=_[_0x1f1b('0x8')](config[_0x1f1b('0x7')],{'host':_0x1f1b('0x9'),'port':0x18eb});var socket=require(_0x1f1b('0xa'))(new Redis(config[_0x1f1b('0x7')]));require('./team.socket')[_0x1f1b('0xb')](socket);function respondWithRpcPromise(_0x5b89a9,_0x3ec70e,_0xc96c9c){return new BPromise(function(_0x9d0f1,_0x372c0e){return client[_0x1f1b('0xc')](_0x5b89a9,_0xc96c9c)[_0x1f1b('0xd')](function(_0xa9bbc6){logger[_0x1f1b('0xe')]('Team,\x20%s,\x20%s',_0x3ec70e,_0x1f1b('0xf'));logger['debug'](_0x1f1b('0x10'),_0x3ec70e,_0x1f1b('0xf'),JSON['stringify'](_0xa9bbc6));if(_0xa9bbc6['error']){if(_0xa9bbc6[_0x1f1b('0x11')][_0x1f1b('0x12')]===0x1f4){logger[_0x1f1b('0x11')](_0x1f1b('0x13'),_0x3ec70e,_0xa9bbc6[_0x1f1b('0x11')][_0x1f1b('0x14')]);return _0x372c0e(_0xa9bbc6[_0x1f1b('0x11')][_0x1f1b('0x14')]);}logger['error'](_0x1f1b('0x13'),_0x3ec70e,_0xa9bbc6[_0x1f1b('0x11')][_0x1f1b('0x14')]);return _0x9d0f1(_0xa9bbc6['error'][_0x1f1b('0x14')]);}else{logger[_0x1f1b('0xe')](_0x1f1b('0x13'),_0x3ec70e,_0x1f1b('0xf'));_0x9d0f1(_0xa9bbc6['result']['message']);}})['catch'](function(_0x551b5e){logger[_0x1f1b('0x11')]('Team,\x20%s,\x20%s',_0x3ec70e,_0x551b5e);_0x372c0e(_0x551b5e);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index b09d5b5..ef2641d 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 _0x0736=['length','team:','./team.events','save','remove','update','emit','register'];(function(_0xf25bb7,_0x57d9ef){var _0x44e8c8=function(_0x2e07d7){while(--_0x2e07d7){_0xf25bb7['push'](_0xf25bb7['shift']());}};_0x44e8c8(++_0x57d9ef);}(_0x0736,0xc2));var _0x6073=function(_0x14e394,_0x4afb12){_0x14e394=_0x14e394-0x0;var _0x1e0af1=_0x0736[_0x14e394];return _0x1e0af1;};'use strict';var TeamEvents=require(_0x6073('0x0'));var events=[_0x6073('0x1'),_0x6073('0x2'),_0x6073('0x3')];function createListener(_0x459ba5,_0x5e1c65){return function(_0x181942){_0x5e1c65[_0x6073('0x4')](_0x459ba5,_0x181942);};}function removeListener(_0x597fc4,_0x41e9ad){return function(){TeamEvents['removeListener'](_0x597fc4,_0x41e9ad);};}exports[_0x6073('0x5')]=function(_0x5439e0){for(var _0x6b6c98=0x0,_0x36b679=events[_0x6073('0x6')];_0x6b6c98<_0x36b679;_0x6b6c98++){var _0x487615=events[_0x6b6c98];var _0x5aed8c=createListener(_0x6073('0x7')+_0x487615,_0x5439e0);TeamEvents['on'](_0x487615,_0x5aed8c);}}; \ No newline at end of file +var _0xc5d1=['team:','./team.events','save','update','removeListener','register','length'];(function(_0x45793c,_0x55a600){var _0x4173f3=function(_0x3d6237){while(--_0x3d6237){_0x45793c['push'](_0x45793c['shift']());}};_0x4173f3(++_0x55a600);}(_0xc5d1,0xb7));var _0x1c5d=function(_0x2b72ef,_0x574981){_0x2b72ef=_0x2b72ef-0x0;var _0x56a161=_0xc5d1[_0x2b72ef];return _0x56a161;};'use strict';var TeamEvents=require(_0x1c5d('0x0'));var events=[_0x1c5d('0x1'),'remove',_0x1c5d('0x2')];function createListener(_0x32a3f4,_0x28f7eb){return function(_0x4497cf){_0x28f7eb['emit'](_0x32a3f4,_0x4497cf);};}function removeListener(_0x458902,_0xb1822d){return function(){TeamEvents[_0x1c5d('0x3')](_0x458902,_0xb1822d);};}exports[_0x1c5d('0x4')]=function(_0x196a66){for(var _0x4f3600=0x0,_0x5073f5=events[_0x1c5d('0x5')];_0x4f3600<_0x5073f5;_0x4f3600++){var _0x20a4c9=events[_0x4f3600];var _0x3cc9cc=createListener(_0x1c5d('0x6')+_0x20a4c9,_0x196a66);TeamEvents['on'](_0x20a4c9,_0x3cc9cc);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 4747c00..f5338e7 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 _0x362d=['destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','index','/:id','isAuthenticated','show','put','update'];(function(_0x5e9e76,_0x3cb685){var _0x2bc580=function(_0x5a2bd3){while(--_0x5a2bd3){_0x5e9e76['push'](_0x5e9e76['shift']());}};_0x2bc580(++_0x3cb685);}(_0x362d,0x92));var _0xd362=function(_0x19688f,_0x1161ea){_0x19688f=_0x19688f-0x0;var _0x96e101=_0x362d[_0x19688f];return _0x96e101;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd362('0x0'));var timeout=require('connect-timeout');var express=require(_0xd362('0x1'));var router=express[_0xd362('0x2')]();var auth=require(_0xd362('0x3'));var interaction=require(_0xd362('0x4'));var config=require(_0xd362('0x5'));var controller=require(_0xd362('0x6'));router[_0xd362('0x7')]('/',auth['isAuthenticated'](),controller[_0xd362('0x8')]);router[_0xd362('0x7')](_0xd362('0x9'),auth[_0xd362('0xa')](),controller[_0xd362('0xb')]);router['post']('/',auth[_0xd362('0xa')](),controller['create']);router[_0xd362('0xc')]('/:id',auth[_0xd362('0xa')](),controller[_0xd362('0xd')]);router['delete'](_0xd362('0x9'),auth[_0xd362('0xa')](),controller[_0xd362('0xe')]);module[_0xd362('0xf')]=router; \ No newline at end of file +var _0x4a85=['show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id'];(function(_0x232dd2,_0x28c2dc){var _0x37d1a1=function(_0x354610){while(--_0x354610){_0x232dd2['push'](_0x232dd2['shift']());}};_0x37d1a1(++_0x28c2dc);}(_0x4a85,0xc5));var _0x54a8=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x4a85[_0x525c7b];return _0x27b33e;};'use strict';var multer=require(_0x54a8('0x0'));var util=require(_0x54a8('0x1'));var path=require(_0x54a8('0x2'));var timeout=require(_0x54a8('0x3'));var express=require(_0x54a8('0x4'));var router=express['Router']();var auth=require(_0x54a8('0x5'));var interaction=require(_0x54a8('0x6'));var config=require(_0x54a8('0x7'));var controller=require(_0x54a8('0x8'));router[_0x54a8('0x9')]('/',auth[_0x54a8('0xa')](),controller['index']);router[_0x54a8('0x9')](_0x54a8('0xb'),auth[_0x54a8('0xa')](),controller[_0x54a8('0xc')]);router[_0x54a8('0xd')]('/',auth[_0x54a8('0xa')](),controller[_0x54a8('0xe')]);router[_0x54a8('0xf')]('/:id',auth[_0x54a8('0xa')](),controller[_0x54a8('0x10')]);router[_0x54a8('0x11')]('/:id',auth[_0x54a8('0xa')](),controller[_0x54a8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index c4d916d..0ec9d83 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 _0x86c3=['TEXT','sequelize','exports','STRING'];(function(_0x2faa65,_0x50c1be){var _0x55fd34=function(_0x1c294f){while(--_0x1c294f){_0x2faa65['push'](_0x2faa65['shift']());}};_0x55fd34(++_0x50c1be);}(_0x86c3,0xc1));var _0x386c=function(_0x348a7f,_0x4068a6){_0x348a7f=_0x348a7f-0x0;var _0x18578e=_0x86c3[_0x348a7f];return _0x18578e;};'use strict';var Sequelize=require(_0x386c('0x0'));module[_0x386c('0x1')]={'name':{'type':Sequelize[_0x386c('0x2')]},'description':{'type':Sequelize[_0x386c('0x2')]},'html':{'type':Sequelize[_0x386c('0x3')]}}; \ No newline at end of file +var _0x952a=['STRING','TEXT','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x952a,0x80));var _0xa952=function(_0x47f1fc,_0x4c5308){_0x47f1fc=_0x47f1fc-0x0;var _0x237a3a=_0x952a[_0x47f1fc];return _0x237a3a;};'use strict';var Sequelize=require('sequelize');module[_0xa952('0x0')]={'name':{'type':Sequelize[_0xa952('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xa952('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index c8de3da..74bc9f6 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 _0xf337=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','options','includeAll','include','findAll','show','params','rawAttributes','create','body','user','get','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','set','Content-Range','json','apply','reject','save','destroy','then','Templates','UserProfileResource','end','sendStatus','error','stack','name','send','index','Template'];(function(_0x5efdb7,_0x4f001a){var _0x48cf75=function(_0x4a54a9){while(--_0x4a54a9){_0x5efdb7['push'](_0x5efdb7['shift']());}};_0x48cf75(++_0x4f001a);}(_0xf337,0x124));var _0x7f33=function(_0x3da4e8,_0x49ee30){_0x3da4e8=_0x3da4e8-0x0;var _0x2cf51b=_0xf337[_0x3da4e8];return _0x2cf51b;};'use strict';var pdf=require(_0x7f33('0x0'));var emlformat=require(_0x7f33('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7f33('0x2'));var jsonpatch=require(_0x7f33('0x3'));var rp=require(_0x7f33('0x4'));var moment=require(_0x7f33('0x5'));var BPromise=require(_0x7f33('0x6'));var Mustache=require('mustache');var util=require(_0x7f33('0x7'));var path=require(_0x7f33('0x8'));var sox=require(_0x7f33('0x9'));var csv=require(_0x7f33('0xa'));var ejs=require(_0x7f33('0xb'));var fs=require('fs');var _=require(_0x7f33('0xc'));var squel=require(_0x7f33('0xd'));var crypto=require(_0x7f33('0xe'));var jsforce=require(_0x7f33('0xf'));var deskjs=require(_0x7f33('0x10'));var toCsv=require(_0x7f33('0xa'));var querystring=require(_0x7f33('0x11'));var Papa=require(_0x7f33('0x12'));var authService=require(_0x7f33('0x13'));var hardwareService=require(_0x7f33('0x14'));var Redis=require(_0x7f33('0x15'));var qs=require(_0x7f33('0x16'));var logger=require('../../config/logger')(_0x7f33('0x17'));var utils=require(_0x7f33('0x18'));var config=require(_0x7f33('0x19'));var db=require(_0x7f33('0x1a'))['db'];function respondWithStatusCode(_0x4abe78,_0x39a90e){_0x39a90e=_0x39a90e||0xcc;return function(_0x20ee99){if(_0x20ee99){return _0x4abe78['sendStatus'](_0x39a90e);}return _0x4abe78[_0x7f33('0x1b')](_0x39a90e)['end']();};}function respondWithResult(_0x4a7136,_0xa6d2b3){_0xa6d2b3=_0xa6d2b3||0xc8;return function(_0x1d976e){if(_0x1d976e){return _0x4a7136[_0x7f33('0x1b')](_0xa6d2b3)['json'](_0x1d976e);}};}function respondWithFilteredResult(_0x93a1b0,_0x1c7f35){return function(_0x1b2a76){if(_0x1b2a76){var _0x423d81=_0x1b2a76[_0x7f33('0x1c')],_0x271bad=_0x1c7f35[_0x7f33('0x1d')],_0x2bca2a=_0x1c7f35[_0x7f33('0x1d')]+_0x1c7f35['limit'],_0x364aa9;if(_0x2bca2a>=_0x423d81){_0x2bca2a=_0x423d81;_0x364aa9=0xc8;}else{_0x364aa9=0xce;}_0x93a1b0['status'](_0x364aa9);return _0x93a1b0[_0x7f33('0x1e')](_0x7f33('0x1f'),_0x271bad+'-'+_0x2bca2a+'/'+_0x423d81)[_0x7f33('0x20')](_0x1b2a76);}return null;};}function patchUpdates(_0x365332){return function(_0x4e9d4b){try{jsonpatch[_0x7f33('0x21')](_0x4e9d4b,_0x365332,!![]);}catch(_0x70da1b){return BPromise[_0x7f33('0x22')](_0x70da1b);}return _0x4e9d4b[_0x7f33('0x23')]();};}function saveUpdates(_0x3efbb7,_0x1ceab1){return function(_0x444e12){if(_0x444e12){return _0x444e12['update'](_0x3efbb7)['then'](function(_0x2ec7cd){return _0x2ec7cd;});}return null;};}function removeEntity(_0x113bd8,_0x141d59){return function(_0x4e5c19){if(_0x4e5c19){return _0x4e5c19[_0x7f33('0x24')]()[_0x7f33('0x25')](function(){var _0x4e3689=_0x4e5c19['get']({'plain':!![]});var _0x1e1b96=_0x7f33('0x26');return db[_0x7f33('0x27')][_0x7f33('0x24')]({'where':{'type':_0x1e1b96,'resourceId':_0x4e3689['id']}})['then'](function(){return _0x4e5c19;});})['then'](function(){_0x113bd8[_0x7f33('0x1b')](0xcc)[_0x7f33('0x28')]();});}};}function handleEntityNotFound(_0x2e14b8,_0x57ecd0){return function(_0x166c16){if(!_0x166c16){_0x2e14b8[_0x7f33('0x29')](0x194);}return _0x166c16;};}function handleError(_0x7a0f9f,_0x74e310){_0x74e310=_0x74e310||0x1f4;return function(_0x1c3915){logger[_0x7f33('0x2a')](_0x1c3915[_0x7f33('0x2b')]);if(_0x1c3915[_0x7f33('0x2c')]){delete _0x1c3915['name'];}_0x7a0f9f[_0x7f33('0x1b')](_0x74e310)[_0x7f33('0x2d')](_0x1c3915);};}exports[_0x7f33('0x2e')]=function(_0x436fa9,_0x9a064f){var _0x5885ab={},_0x36cafa={},_0x10f85f={'count':0x0,'rows':[]};var _0x58a907=db[_0x7f33('0x2f')]['rawAttributes'];_0x36cafa[_0x7f33('0x30')]=_[_0x7f33('0x31')](_0x58a907);_0x36cafa[_0x7f33('0x32')]=_['keys'](_0x436fa9['query']);_0x36cafa[_0x7f33('0x33')]=_[_0x7f33('0x34')](_0x36cafa['model'],_0x36cafa[_0x7f33('0x32')]);_0x5885ab[_0x7f33('0x35')]=_[_0x7f33('0x34')](_0x36cafa[_0x7f33('0x30')],qs[_0x7f33('0x36')](_0x436fa9['query'][_0x7f33('0x36')]));_0x5885ab[_0x7f33('0x35')]=_0x5885ab['attributes'][_0x7f33('0x37')]?_0x5885ab[_0x7f33('0x35')]:_0x36cafa[_0x7f33('0x30')];if(!_0x436fa9['query'][_0x7f33('0x38')](_0x7f33('0x39'))){_0x5885ab['limit']=qs[_0x7f33('0x3a')](_0x436fa9['query'][_0x7f33('0x3a')]);_0x5885ab[_0x7f33('0x1d')]=qs[_0x7f33('0x1d')](_0x436fa9[_0x7f33('0x32')][_0x7f33('0x1d')]);}_0x5885ab[_0x7f33('0x3b')]=qs[_0x7f33('0x3c')](_0x436fa9[_0x7f33('0x32')][_0x7f33('0x3c')]);_0x5885ab[_0x7f33('0x3d')]=qs[_0x7f33('0x33')](_[_0x7f33('0x3e')](_0x436fa9[_0x7f33('0x32')],_0x36cafa[_0x7f33('0x33')]));if(_0x436fa9[_0x7f33('0x32')]['filter']){_0x5885ab['where']=_[_0x7f33('0x3f')](_0x5885ab['where'],{'$or':_[_0x7f33('0x40')](_0x58a907,function(_0x1221fe){if(_0x1221fe[_0x7f33('0x41')]['key']!==_0x7f33('0x42')){var _0x270ada={};_0x270ada[_0x1221fe[_0x7f33('0x43')]]={'$like':'%'+_0x436fa9[_0x7f33('0x32')][_0x7f33('0x44')]+'%'};return _0x270ada;}})});}_0x5885ab=_[_0x7f33('0x3f')]({},_0x5885ab,_0x436fa9[_0x7f33('0x45')]);var _0x5b5ba0={'where':_0x5885ab['where']};return db[_0x7f33('0x2f')]['count'](_0x5b5ba0)['then'](function(_0x2d07fd){_0x10f85f[_0x7f33('0x1c')]=_0x2d07fd;if(_0x436fa9[_0x7f33('0x32')][_0x7f33('0x46')]){_0x5885ab[_0x7f33('0x47')]=[{'all':!![]}];}return db[_0x7f33('0x2f')][_0x7f33('0x48')](_0x5885ab);})['then'](function(_0xd8d7e9){_0x10f85f['rows']=_0xd8d7e9;return _0x10f85f;})[_0x7f33('0x25')](respondWithFilteredResult(_0x9a064f,_0x5885ab))['catch'](handleError(_0x9a064f,null));};exports[_0x7f33('0x49')]=function(_0x416cf1,_0x17bf5e){var _0x21081c={'raw':!![],'where':{'id':_0x416cf1[_0x7f33('0x4a')]['id']}},_0x32e1dd={};_0x32e1dd[_0x7f33('0x30')]=_[_0x7f33('0x31')](db[_0x7f33('0x2f')][_0x7f33('0x4b')]);_0x32e1dd[_0x7f33('0x32')]=_[_0x7f33('0x31')](_0x416cf1[_0x7f33('0x32')]);_0x32e1dd[_0x7f33('0x33')]=_[_0x7f33('0x34')](_0x32e1dd['model'],_0x32e1dd[_0x7f33('0x32')]);_0x21081c['attributes']=_[_0x7f33('0x34')](_0x32e1dd[_0x7f33('0x30')],qs[_0x7f33('0x36')](_0x416cf1['query'][_0x7f33('0x36')]));_0x21081c[_0x7f33('0x35')]=_0x21081c[_0x7f33('0x35')]['length']?_0x21081c[_0x7f33('0x35')]:_0x32e1dd[_0x7f33('0x30')];if(_0x416cf1[_0x7f33('0x32')]['includeAll']){_0x21081c[_0x7f33('0x47')]=[{'all':!![]}];}_0x21081c=_['merge']({},_0x21081c,_0x416cf1['options']);return db[_0x7f33('0x2f')]['find'](_0x21081c)[_0x7f33('0x25')](handleEntityNotFound(_0x17bf5e,null))[_0x7f33('0x25')](respondWithResult(_0x17bf5e,null))['catch'](handleError(_0x17bf5e,null));};exports[_0x7f33('0x4c')]=function(_0x5025fb,_0x9de3de){return db[_0x7f33('0x2f')][_0x7f33('0x4c')](_0x5025fb[_0x7f33('0x4d')],{})['then'](function(_0x407b9d){var _0x5a95ed=_0x5025fb[_0x7f33('0x4e')][_0x7f33('0x4f')]({'plain':!![]});if(!_0x5a95ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a95ed['role']==='user'){var _0x2abe9a=_0x407b9d[_0x7f33('0x4f')]({'plain':!![]});var _0x4ecdb9=_0x7f33('0x26');return db['UserProfileSection'][_0x7f33('0x50')]({'where':{'name':_0x4ecdb9,'userProfileId':_0x5a95ed[_0x7f33('0x51')]},'raw':!![]})['then'](function(_0x15bad9){if(_0x15bad9&&_0x15bad9[_0x7f33('0x52')]===0x0){return db['UserProfileResource'][_0x7f33('0x4c')]({'name':_0x2abe9a[_0x7f33('0x2c')],'resourceId':_0x2abe9a['id'],'type':_0x15bad9[_0x7f33('0x2c')],'sectionId':_0x15bad9['id']},{})[_0x7f33('0x25')](function(){return _0x407b9d;});}else{return _0x407b9d;}})[_0x7f33('0x53')](function(_0x34d055){logger['error'](_0x7f33('0x54'),_0x34d055);throw _0x34d055;});}return _0x407b9d;})[_0x7f33('0x25')](respondWithResult(_0x9de3de,0xc9))[_0x7f33('0x53')](handleError(_0x9de3de,null));};exports['update']=function(_0x55c584,_0x9426e0){if(_0x55c584['body']['id']){delete _0x55c584['body']['id'];}return db[_0x7f33('0x2f')][_0x7f33('0x50')]({'where':{'id':_0x55c584[_0x7f33('0x4a')]['id']}})[_0x7f33('0x25')](handleEntityNotFound(_0x9426e0,null))['then'](saveUpdates(_0x55c584[_0x7f33('0x4d')],null))[_0x7f33('0x25')](respondWithResult(_0x9426e0,null))[_0x7f33('0x53')](handleError(_0x9426e0,null));};exports['destroy']=function(_0x7e43ae,_0x11b456){return db[_0x7f33('0x2f')][_0x7f33('0x50')]({'where':{'id':_0x7e43ae[_0x7f33('0x4a')]['id']}})[_0x7f33('0x25')](handleEntityNotFound(_0x11b456,null))[_0x7f33('0x25')](removeEntity(_0x11b456,null))[_0x7f33('0x53')](handleError(_0x11b456,null));}; \ No newline at end of file +var _0x530b=['fields','length','hasOwnProperty','order','sort','where','filter','merge','key','VIRTUAL','field','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','get','Templates','UserProfileResource','error','name','send','index','Template','rawAttributes','keys','query','filters','intersection','model','attributes'];(function(_0x25e7ee,_0x4d8966){var _0x1251f2=function(_0x165472){while(--_0x165472){_0x25e7ee['push'](_0x25e7ee['shift']());}};_0x1251f2(++_0x4d8966);}(_0x530b,0x6c));var _0xb530=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0x530b[_0x2468b5];return _0x1056e4;};'use strict';var pdf=require(_0xb530('0x0'));var emlformat=require(_0xb530('0x1'));var rimraf=require(_0xb530('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb530('0x3'));var rp=require(_0xb530('0x4'));var moment=require(_0xb530('0x5'));var BPromise=require(_0xb530('0x6'));var Mustache=require('mustache');var util=require(_0xb530('0x7'));var path=require(_0xb530('0x8'));var sox=require(_0xb530('0x9'));var csv=require(_0xb530('0xa'));var ejs=require(_0xb530('0xb'));var fs=require('fs');var _=require(_0xb530('0xc'));var squel=require(_0xb530('0xd'));var crypto=require(_0xb530('0xe'));var jsforce=require(_0xb530('0xf'));var deskjs=require(_0xb530('0x10'));var toCsv=require(_0xb530('0xa'));var querystring=require(_0xb530('0x11'));var Papa=require(_0xb530('0x12'));var authService=require(_0xb530('0x13'));var hardwareService=require(_0xb530('0x14'));var Redis=require(_0xb530('0x15'));var qs=require(_0xb530('0x16'));var logger=require(_0xb530('0x17'))('api');var utils=require(_0xb530('0x18'));var config=require(_0xb530('0x19'));var db=require(_0xb530('0x1a'))['db'];function respondWithStatusCode(_0x2a548c,_0x57ecca){_0x57ecca=_0x57ecca||0xcc;return function(_0x2941e8){if(_0x2941e8){return _0x2a548c[_0xb530('0x1b')](_0x57ecca);}return _0x2a548c[_0xb530('0x1c')](_0x57ecca)[_0xb530('0x1d')]();};}function respondWithResult(_0x58e6da,_0x38578f){_0x38578f=_0x38578f||0xc8;return function(_0x584b32){if(_0x584b32){return _0x58e6da['status'](_0x38578f)[_0xb530('0x1e')](_0x584b32);}};}function respondWithFilteredResult(_0x2b9848,_0x19eb4d){return function(_0x5a090b){if(_0x5a090b){var _0xaae74a=_0x5a090b[_0xb530('0x1f')],_0x2114df=_0x19eb4d['offset'],_0x98bb79=_0x19eb4d[_0xb530('0x20')]+_0x19eb4d[_0xb530('0x21')],_0x11f5d1;if(_0x98bb79>=_0xaae74a){_0x98bb79=_0xaae74a;_0x11f5d1=0xc8;}else{_0x11f5d1=0xce;}_0x2b9848[_0xb530('0x1c')](_0x11f5d1);return _0x2b9848[_0xb530('0x22')](_0xb530('0x23'),_0x2114df+'-'+_0x98bb79+'/'+_0xaae74a)[_0xb530('0x1e')](_0x5a090b);}return null;};}function patchUpdates(_0x49832c){return function(_0x2803a9){try{jsonpatch[_0xb530('0x24')](_0x2803a9,_0x49832c,!![]);}catch(_0x3b4330){return BPromise['reject'](_0x3b4330);}return _0x2803a9[_0xb530('0x25')]();};}function saveUpdates(_0x2f522b,_0x5dd477){return function(_0x1a7576){if(_0x1a7576){return _0x1a7576[_0xb530('0x26')](_0x2f522b)['then'](function(_0x43a974){return _0x43a974;});}return null;};}function removeEntity(_0x3bed53,_0x3e5f77){return function(_0x49d218){if(_0x49d218){return _0x49d218[_0xb530('0x27')]()[_0xb530('0x28')](function(){var _0x30aae0=_0x49d218[_0xb530('0x29')]({'plain':!![]});var _0x10da82=_0xb530('0x2a');return db[_0xb530('0x2b')][_0xb530('0x27')]({'where':{'type':_0x10da82,'resourceId':_0x30aae0['id']}})[_0xb530('0x28')](function(){return _0x49d218;});})[_0xb530('0x28')](function(){_0x3bed53[_0xb530('0x1c')](0xcc)[_0xb530('0x1d')]();});}};}function handleEntityNotFound(_0x11692a,_0x4741ad){return function(_0x45ace2){if(!_0x45ace2){_0x11692a['sendStatus'](0x194);}return _0x45ace2;};}function handleError(_0x5ed9a4,_0x4f9105){_0x4f9105=_0x4f9105||0x1f4;return function(_0x3a1e86){logger[_0xb530('0x2c')](_0x3a1e86['stack']);if(_0x3a1e86[_0xb530('0x2d')]){delete _0x3a1e86[_0xb530('0x2d')];}_0x5ed9a4[_0xb530('0x1c')](_0x4f9105)[_0xb530('0x2e')](_0x3a1e86);};}exports[_0xb530('0x2f')]=function(_0x5b01fe,_0x5f10fb){var _0x56e8ff={},_0xf19764={},_0x524448={'count':0x0,'rows':[]};var _0x431ccf=db[_0xb530('0x30')][_0xb530('0x31')];_0xf19764['model']=_[_0xb530('0x32')](_0x431ccf);_0xf19764['query']=_[_0xb530('0x32')](_0x5b01fe[_0xb530('0x33')]);_0xf19764[_0xb530('0x34')]=_[_0xb530('0x35')](_0xf19764[_0xb530('0x36')],_0xf19764[_0xb530('0x33')]);_0x56e8ff[_0xb530('0x37')]=_[_0xb530('0x35')](_0xf19764['model'],qs[_0xb530('0x38')](_0x5b01fe[_0xb530('0x33')]['fields']));_0x56e8ff[_0xb530('0x37')]=_0x56e8ff[_0xb530('0x37')][_0xb530('0x39')]?_0x56e8ff[_0xb530('0x37')]:_0xf19764[_0xb530('0x36')];if(!_0x5b01fe[_0xb530('0x33')][_0xb530('0x3a')]('nolimit')){_0x56e8ff[_0xb530('0x21')]=qs[_0xb530('0x21')](_0x5b01fe[_0xb530('0x33')][_0xb530('0x21')]);_0x56e8ff[_0xb530('0x20')]=qs['offset'](_0x5b01fe['query'][_0xb530('0x20')]);}_0x56e8ff[_0xb530('0x3b')]=qs[_0xb530('0x3c')](_0x5b01fe[_0xb530('0x33')][_0xb530('0x3c')]);_0x56e8ff[_0xb530('0x3d')]=qs[_0xb530('0x34')](_['pick'](_0x5b01fe['query'],_0xf19764[_0xb530('0x34')]));if(_0x5b01fe[_0xb530('0x33')][_0xb530('0x3e')]){_0x56e8ff[_0xb530('0x3d')]=_[_0xb530('0x3f')](_0x56e8ff[_0xb530('0x3d')],{'$or':_['map'](_0x431ccf,function(_0x1386b1){if(_0x1386b1['type'][_0xb530('0x40')]!==_0xb530('0x41')){var _0x4bcaaa={};_0x4bcaaa[_0x1386b1[_0xb530('0x42')]]={'$like':'%'+_0x5b01fe[_0xb530('0x33')][_0xb530('0x3e')]+'%'};return _0x4bcaaa;}})});}_0x56e8ff=_[_0xb530('0x3f')]({},_0x56e8ff,_0x5b01fe[_0xb530('0x43')]);var _0x5930b3={'where':_0x56e8ff[_0xb530('0x3d')]};return db[_0xb530('0x30')][_0xb530('0x1f')](_0x5930b3)[_0xb530('0x28')](function(_0x353ae5){_0x524448[_0xb530('0x1f')]=_0x353ae5;if(_0x5b01fe[_0xb530('0x33')]['includeAll']){_0x56e8ff[_0xb530('0x44')]=[{'all':!![]}];}return db[_0xb530('0x30')][_0xb530('0x45')](_0x56e8ff);})['then'](function(_0x4eb92c){_0x524448[_0xb530('0x46')]=_0x4eb92c;return _0x524448;})[_0xb530('0x28')](respondWithFilteredResult(_0x5f10fb,_0x56e8ff))[_0xb530('0x47')](handleError(_0x5f10fb,null));};exports['show']=function(_0x459106,_0x1bc6ad){var _0x55f42e={'raw':!![],'where':{'id':_0x459106['params']['id']}},_0x16321c={};_0x16321c[_0xb530('0x36')]=_[_0xb530('0x32')](db[_0xb530('0x30')][_0xb530('0x31')]);_0x16321c[_0xb530('0x33')]=_[_0xb530('0x32')](_0x459106[_0xb530('0x33')]);_0x16321c[_0xb530('0x34')]=_['intersection'](_0x16321c[_0xb530('0x36')],_0x16321c[_0xb530('0x33')]);_0x55f42e[_0xb530('0x37')]=_['intersection'](_0x16321c[_0xb530('0x36')],qs[_0xb530('0x38')](_0x459106[_0xb530('0x33')][_0xb530('0x38')]));_0x55f42e[_0xb530('0x37')]=_0x55f42e[_0xb530('0x37')][_0xb530('0x39')]?_0x55f42e[_0xb530('0x37')]:_0x16321c[_0xb530('0x36')];if(_0x459106[_0xb530('0x33')][_0xb530('0x48')]){_0x55f42e[_0xb530('0x44')]=[{'all':!![]}];}_0x55f42e=_['merge']({},_0x55f42e,_0x459106[_0xb530('0x43')]);return db[_0xb530('0x30')][_0xb530('0x49')](_0x55f42e)['then'](handleEntityNotFound(_0x1bc6ad,null))[_0xb530('0x28')](respondWithResult(_0x1bc6ad,null))['catch'](handleError(_0x1bc6ad,null));};exports[_0xb530('0x4a')]=function(_0x2a1197,_0x374212){return db[_0xb530('0x30')][_0xb530('0x4a')](_0x2a1197[_0xb530('0x4b')],{})['then'](function(_0x1a09bb){var _0x16eaa9=_0x2a1197[_0xb530('0x4c')][_0xb530('0x29')]({'plain':!![]});if(!_0x16eaa9)throw new Error(_0xb530('0x4d'));if(_0x16eaa9[_0xb530('0x4e')]===_0xb530('0x4c')){var _0x1017cd=_0x1a09bb['get']({'plain':!![]});var _0x5b7fae=_0xb530('0x2a');return db[_0xb530('0x4f')][_0xb530('0x49')]({'where':{'name':_0x5b7fae,'userProfileId':_0x16eaa9['userProfileId']},'raw':!![]})['then'](function(_0xb71234){if(_0xb71234&&_0xb71234['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1017cd['name'],'resourceId':_0x1017cd['id'],'type':_0xb71234[_0xb530('0x2d')],'sectionId':_0xb71234['id']},{})[_0xb530('0x28')](function(){return _0x1a09bb;});}else{return _0x1a09bb;}})[_0xb530('0x47')](function(_0x5a3613){logger[_0xb530('0x2c')](_0xb530('0x50'),_0x5a3613);throw _0x5a3613;});}return _0x1a09bb;})[_0xb530('0x28')](respondWithResult(_0x374212,0xc9))[_0xb530('0x47')](handleError(_0x374212,null));};exports['update']=function(_0x44f5a0,_0x545f62){if(_0x44f5a0[_0xb530('0x4b')]['id']){delete _0x44f5a0[_0xb530('0x4b')]['id'];}return db[_0xb530('0x30')][_0xb530('0x49')]({'where':{'id':_0x44f5a0[_0xb530('0x51')]['id']}})['then'](handleEntityNotFound(_0x545f62,null))[_0xb530('0x28')](saveUpdates(_0x44f5a0[_0xb530('0x4b')],null))[_0xb530('0x28')](respondWithResult(_0x545f62,null))[_0xb530('0x47')](handleError(_0x545f62,null));};exports[_0xb530('0x27')]=function(_0x50d4be,_0x30c3d8){return db[_0xb530('0x30')]['find']({'where':{'id':_0x50d4be[_0xb530('0x51')]['id']}})[_0xb530('0x28')](handleEntityNotFound(_0x30c3d8,null))[_0xb530('0x28')](removeEntity(_0x30c3d8,null))[_0xb530('0x47')](handleError(_0x30c3d8,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index db7dd05..19ac517 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 _0x5195=['define','Template','tools_templates','lodash','util','api','bluebird','./template.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5195,0x150));var _0x5519=function(_0x134c9b,_0x2b4738){_0x134c9b=_0x134c9b-0x0;var _0x33f38e=_0x5195[_0x134c9b];return _0x33f38e;};'use strict';var _=require(_0x5519('0x0'));var util=require(_0x5519('0x1'));var logger=require('../../config/logger')(_0x5519('0x2'));var moment=require('moment');var BPromise=require(_0x5519('0x3'));var rp=require('request-promise');var attributes=require(_0x5519('0x4'));module[_0x5519('0x5')]=function(_0xe22b8d,_0x369731){return _0xe22b8d[_0x5519('0x6')](_0x5519('0x7'),attributes,{'tableName':_0x5519('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x051c=['util','../../config/logger','api','moment','bluebird','request-promise','./template.attributes','exports','define','Template','tools_templates','lodash'];(function(_0x58f885,_0x107562){var _0x3537b5=function(_0x35a9b8){while(--_0x35a9b8){_0x58f885['push'](_0x58f885['shift']());}};_0x3537b5(++_0x107562);}(_0x051c,0x143));var _0xc051=function(_0x5642f2,_0x58e370){_0x5642f2=_0x5642f2-0x0;var _0x313940=_0x051c[_0x5642f2];return _0x313940;};'use strict';var _=require(_0xc051('0x0'));var util=require(_0xc051('0x1'));var logger=require(_0xc051('0x2'))(_0xc051('0x3'));var moment=require(_0xc051('0x4'));var BPromise=require(_0xc051('0x5'));var rp=require(_0xc051('0x6'));var attributes=require(_0xc051('0x7'));module[_0xc051('0x8')]=function(_0x13330c,_0x514bbe){return _0x13330c[_0xc051('0x9')](_0xc051('0xa'),attributes,{'tableName':_0xc051('0xb'),'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 b1afd89..191a015 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 _0x0c5e=['Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','model','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x0c5e,0x101));var _0xe0c5=function(_0x33e4a7,_0x2e80a2){_0x33e4a7=_0x33e4a7-0x0;var _0x598620=_0x0c5e[_0x33e4a7];return _0x598620;};'use strict';var _=require(_0xe0c5('0x0'));var util=require(_0xe0c5('0x1'));var moment=require(_0xe0c5('0x2'));var BPromise=require(_0xe0c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0c5('0x4'));var db=require(_0xe0c5('0x5'))['db'];var utils=require(_0xe0c5('0x6'));var logger=require('../../config/logger')(_0xe0c5('0x7'));var config=require(_0xe0c5('0x8'));var jayson=require(_0xe0c5('0x9'));var client=jayson[_0xe0c5('0xa')][_0xe0c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4356fe,_0xfa9fd4,_0x2c85c6){return new BPromise(function(_0x45793d,_0x2cd746){return client[_0xe0c5('0xc')](_0x4356fe,_0x2c85c6)[_0xe0c5('0xd')](function(_0x436d91){logger[_0xe0c5('0xe')]('Template,\x20%s,\x20%s',_0xfa9fd4,'request\x20sent');logger['debug'](_0xe0c5('0xf'),_0xfa9fd4,_0xe0c5('0x10'),JSON[_0xe0c5('0x11')](_0x436d91));if(_0x436d91[_0xe0c5('0x12')]){if(_0x436d91[_0xe0c5('0x12')][_0xe0c5('0x13')]===0x1f4){logger[_0xe0c5('0x12')](_0xe0c5('0x14'),_0xfa9fd4,_0x436d91[_0xe0c5('0x12')][_0xe0c5('0x15')]);return _0x2cd746(_0x436d91['error'][_0xe0c5('0x15')]);}logger['error'](_0xe0c5('0x14'),_0xfa9fd4,_0x436d91['error'][_0xe0c5('0x15')]);return _0x45793d(_0x436d91[_0xe0c5('0x12')][_0xe0c5('0x15')]);}else{logger['info'](_0xe0c5('0x14'),_0xfa9fd4,_0xe0c5('0x10'));_0x45793d(_0x436d91[_0xe0c5('0x16')]['message']);}})[_0xe0c5('0x17')](function(_0x2f82e8){logger[_0xe0c5('0x12')](_0xe0c5('0x14'),_0xfa9fd4,_0x2f82e8);_0x2cd746(_0x2f82e8);});});}exports[_0xe0c5('0x18')]=function(_0x62ffb0){var _0xb34dd=this;return new Promise(function(_0x384fcf,_0x37b27e){return db['Template'][_0xe0c5('0x19')]({'raw':_0x62ffb0[_0xe0c5('0x1a')]?_0x62ffb0[_0xe0c5('0x1a')][_0xe0c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x62ffb0[_0xe0c5('0x1a')]?_0x62ffb0[_0xe0c5('0x1a')][_0xe0c5('0x1c')]||null:null,'attributes':_0x62ffb0['options']?_0x62ffb0[_0xe0c5('0x1a')][_0xe0c5('0x1d')]||null:null,'limit':_0x62ffb0['options']?_0x62ffb0[_0xe0c5('0x1a')][_0xe0c5('0x1e')]||null:null,'include':_0x62ffb0[_0xe0c5('0x1a')]?_0x62ffb0['options'][_0xe0c5('0x1f')]?_['map'](_0x62ffb0[_0xe0c5('0x1a')][_0xe0c5('0x1f')],function(_0xd171aa){return{'model':db[_0xd171aa['model']],'as':_0xd171aa['as'],'attributes':_0xd171aa[_0xe0c5('0x1d')],'include':_0xd171aa[_0xe0c5('0x1f')]?_['map'](_0xd171aa[_0xe0c5('0x1f')],function(_0x3b50f9){return{'model':db[_0x3b50f9['model']],'as':_0x3b50f9['as'],'attributes':_0x3b50f9[_0xe0c5('0x1d')],'include':_0x3b50f9['include']?_['map'](_0x3b50f9['include'],function(_0x20ca2a){return{'model':db[_0x20ca2a[_0xe0c5('0x20')]],'as':_0x20ca2a['as'],'attributes':_0x20ca2a[_0xe0c5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe0c5('0xd')](function(_0x2a8378){logger['info'](_0xe0c5('0x18'),_0x62ffb0);logger[_0xe0c5('0x21')](_0xe0c5('0x18'),_0x62ffb0,JSON[_0xe0c5('0x11')](_0x2a8378));_0x384fcf(_0x2a8378);})[_0xe0c5('0x17')](function(_0x24ae8d){logger[_0xe0c5('0x12')](_0xe0c5('0x18'),_0x24ae8d[_0xe0c5('0x15')],_0x62ffb0);_0x37b27e(_0xb34dd[_0xe0c5('0x12')](0x1f4,_0x24ae8d['message']));});});}; \ No newline at end of file +var _0x9f1f=['message','result','catch','GetTemplate','Template','findAll','options','attributes','map','include','model','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','code','error','Template,\x20%s,\x20%s'];(function(_0x2c4dca,_0x125190){var _0x24b6fc=function(_0x3f936d){while(--_0x3f936d){_0x2c4dca['push'](_0x2c4dca['shift']());}};_0x24b6fc(++_0x125190);}(_0x9f1f,0x8b));var _0xf9f1=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x9f1f[_0x4ae829];return _0x256b31;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf9f1('0x0'));var BPromise=require(_0xf9f1('0x1'));var rs=require(_0xf9f1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9f1('0x3'))['db'];var utils=require(_0xf9f1('0x4'));var logger=require(_0xf9f1('0x5'))(_0xf9f1('0x6'));var config=require(_0xf9f1('0x7'));var jayson=require(_0xf9f1('0x8'));var client=jayson[_0xf9f1('0x9')][_0xf9f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30d3ef,_0x2a1533,_0x4da454){return new BPromise(function(_0x20283f,_0xcea20){return client[_0xf9f1('0xb')](_0x30d3ef,_0x4da454)[_0xf9f1('0xc')](function(_0x2c265a){logger[_0xf9f1('0xd')]('Template,\x20%s,\x20%s',_0x2a1533,_0xf9f1('0xe'));logger[_0xf9f1('0xf')](_0xf9f1('0x10'),_0x2a1533,'request\x20sent',JSON[_0xf9f1('0x11')](_0x2c265a));if(_0x2c265a['error']){if(_0x2c265a['error'][_0xf9f1('0x12')]===0x1f4){logger[_0xf9f1('0x13')](_0xf9f1('0x14'),_0x2a1533,_0x2c265a[_0xf9f1('0x13')][_0xf9f1('0x15')]);return _0xcea20(_0x2c265a[_0xf9f1('0x13')][_0xf9f1('0x15')]);}logger['error']('Template,\x20%s,\x20%s',_0x2a1533,_0x2c265a[_0xf9f1('0x13')][_0xf9f1('0x15')]);return _0x20283f(_0x2c265a[_0xf9f1('0x13')][_0xf9f1('0x15')]);}else{logger[_0xf9f1('0xd')](_0xf9f1('0x14'),_0x2a1533,_0xf9f1('0xe'));_0x20283f(_0x2c265a[_0xf9f1('0x16')]['message']);}})[_0xf9f1('0x17')](function(_0xfe425b){logger[_0xf9f1('0x13')](_0xf9f1('0x14'),_0x2a1533,_0xfe425b);_0xcea20(_0xfe425b);});});}exports[_0xf9f1('0x18')]=function(_0x42dc59){var _0x128475=this;return new Promise(function(_0x40821a,_0x77790f){return db[_0xf9f1('0x19')][_0xf9f1('0x1a')]({'raw':_0x42dc59[_0xf9f1('0x1b')]?_0x42dc59[_0xf9f1('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x42dc59[_0xf9f1('0x1b')]?_0x42dc59['options']['where']||null:null,'attributes':_0x42dc59[_0xf9f1('0x1b')]?_0x42dc59[_0xf9f1('0x1b')][_0xf9f1('0x1c')]||null:null,'limit':_0x42dc59['options']?_0x42dc59[_0xf9f1('0x1b')]['limit']||null:null,'include':_0x42dc59[_0xf9f1('0x1b')]?_0x42dc59[_0xf9f1('0x1b')]['include']?_[_0xf9f1('0x1d')](_0x42dc59[_0xf9f1('0x1b')][_0xf9f1('0x1e')],function(_0x335fe3){return{'model':db[_0x335fe3['model']],'as':_0x335fe3['as'],'attributes':_0x335fe3[_0xf9f1('0x1c')],'include':_0x335fe3[_0xf9f1('0x1e')]?_['map'](_0x335fe3['include'],function(_0x1afcb7){return{'model':db[_0x1afcb7[_0xf9f1('0x1f')]],'as':_0x1afcb7['as'],'attributes':_0x1afcb7[_0xf9f1('0x1c')],'include':_0x1afcb7[_0xf9f1('0x1e')]?_[_0xf9f1('0x1d')](_0x1afcb7[_0xf9f1('0x1e')],function(_0x45da6b){return{'model':db[_0x45da6b[_0xf9f1('0x1f')]],'as':_0x45da6b['as'],'attributes':_0x45da6b['attributes']};}):[]};}):[]};}):[]:[]})[_0xf9f1('0xc')](function(_0x58c643){logger[_0xf9f1('0xd')](_0xf9f1('0x18'),_0x42dc59);logger['debug'](_0xf9f1('0x18'),_0x42dc59,JSON['stringify'](_0x58c643));_0x40821a(_0x58c643);})['catch'](function(_0xb854c9){logger['error'](_0xf9f1('0x18'),_0xb854c9[_0xf9f1('0x15')],_0x42dc59);_0x77790f(_0x128475[_0xf9f1('0x13')](0x1f4,_0xb854c9[_0xf9f1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 0038fd9..08e2037 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 _0x3dba=['/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAnyCondition','addAction','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x54f9d0,_0x36bf5d){var _0x3b486a=function(_0x23fa19){while(--_0x23fa19){_0x54f9d0['push'](_0x54f9d0['shift']());}};_0x3b486a(++_0x36bf5d);}(_0x3dba,0xc6));var _0xa3db=function(_0x33f4bc,_0x375ed2){_0x33f4bc=_0x33f4bc-0x0;var _0x565bdd=_0x3dba[_0x33f4bc];return _0x565bdd;};'use strict';var multer=require(_0xa3db('0x0'));var util=require(_0xa3db('0x1'));var path=require(_0xa3db('0x2'));var timeout=require('connect-timeout');var express=require(_0xa3db('0x3'));var router=express[_0xa3db('0x4')]();var auth=require(_0xa3db('0x5'));var interaction=require(_0xa3db('0x6'));var config=require(_0xa3db('0x7'));var controller=require('./trigger.controller');router[_0xa3db('0x8')]('/',auth[_0xa3db('0x9')](),controller['index']);router[_0xa3db('0x8')](_0xa3db('0xa'),auth['isAuthenticated'](),controller[_0xa3db('0xb')]);router[_0xa3db('0x8')]('/:id/all_conditions',auth[_0xa3db('0x9')](),controller[_0xa3db('0xc')]);router['get'](_0xa3db('0xd'),auth['isAuthenticated'](),controller[_0xa3db('0xe')]);router[_0xa3db('0x8')](_0xa3db('0xf'),auth[_0xa3db('0x9')](),controller[_0xa3db('0x10')]);router[_0xa3db('0x11')]('/',auth['isAuthenticated'](),controller[_0xa3db('0x12')]);router['post'](_0xa3db('0x13'),auth['isAuthenticated'](),controller['addAllCondition']);router[_0xa3db('0x11')](_0xa3db('0xd'),auth[_0xa3db('0x9')](),controller[_0xa3db('0x14')]);router['post'](_0xa3db('0xf'),auth['isAuthenticated'](),controller[_0xa3db('0x15')]);router[_0xa3db('0x16')](_0xa3db('0xa'),auth[_0xa3db('0x9')](),controller[_0xa3db('0x17')]);router[_0xa3db('0x18')](_0xa3db('0xa'),auth[_0xa3db('0x9')](),controller['destroy']);module[_0xa3db('0x19')]=router; \ No newline at end of file +var _0xdb04=['connect-timeout','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','get','/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','update','destroy','exports','multer','util','path'];(function(_0x29759e,_0x30c9e4){var _0x2bd9f1=function(_0x58effb){while(--_0x58effb){_0x29759e['push'](_0x29759e['shift']());}};_0x2bd9f1(++_0x30c9e4);}(_0xdb04,0x1bf));var _0x4db0=function(_0x4460bf,_0x2079ec){_0x4460bf=_0x4460bf-0x0;var _0x5ad007=_0xdb04[_0x4460bf];return _0x5ad007;};'use strict';var multer=require(_0x4db0('0x0'));var util=require(_0x4db0('0x1'));var path=require(_0x4db0('0x2'));var timeout=require(_0x4db0('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x4db0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4db0('0x5'));var controller=require(_0x4db0('0x6'));router['get']('/',auth[_0x4db0('0x7')](),controller['index']);router['get'](_0x4db0('0x8'),auth[_0x4db0('0x7')](),controller[_0x4db0('0x9')]);router['get'](_0x4db0('0xa'),auth[_0x4db0('0x7')](),controller[_0x4db0('0xb')]);router[_0x4db0('0xc')](_0x4db0('0xd'),auth[_0x4db0('0x7')](),controller['getAnyConditions']);router[_0x4db0('0xc')](_0x4db0('0xe'),auth[_0x4db0('0x7')](),controller[_0x4db0('0xf')]);router[_0x4db0('0x10')]('/',auth[_0x4db0('0x7')](),controller[_0x4db0('0x11')]);router[_0x4db0('0x10')](_0x4db0('0xa'),auth[_0x4db0('0x7')](),controller[_0x4db0('0x12')]);router[_0x4db0('0x10')]('/:id/any_conditions',auth[_0x4db0('0x7')](),controller[_0x4db0('0x13')]);router['post'](_0x4db0('0xe'),auth[_0x4db0('0x7')](),controller[_0x4db0('0x14')]);router[_0x4db0('0x15')](_0x4db0('0x8'),auth[_0x4db0('0x7')](),controller[_0x4db0('0x16')]);router['delete']('/:id',auth[_0x4db0('0x7')](),controller[_0x4db0('0x17')]);module[_0x4db0('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index cc238dc..a626a9a 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 _0x927d=['STRING','sequelize','exports'];(function(_0x511c6c,_0x1366f0){var _0x59d285=function(_0x424a35){while(--_0x424a35){_0x511c6c['push'](_0x511c6c['shift']());}};_0x59d285(++_0x1366f0);}(_0x927d,0x8e));var _0xd927=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x927d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd927('0x0'));module[_0xd927('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd927('0x2')]},'description':{'type':Sequelize[_0xd927('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x86ae=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3b837b,_0x2740b9){var _0x6d3ed0=function(_0x100bc3){while(--_0x100bc3){_0x3b837b['push'](_0x3b837b['shift']());}};_0x6d3ed0(++_0x2740b9);}(_0x86ae,0xdb));var _0xe86a=function(_0x41c724,_0x7f4144){_0x41c724=_0x41c724-0x0;var _0x369522=_0x86ae[_0x41c724];return _0x369522;};'use strict';var Sequelize=require(_0xe86a('0x0'));module[_0xe86a('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe86a('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xe86a('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 dda000f..f99e203 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 _0x277d=['end','json','count','offset','limit','status','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','Trigger','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','findAll','rows','catch','show','params','includeAll','include','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','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','map','getAnyConditions','addAction','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x3bae28,_0x5ca4f5){var _0xb431b=function(_0x1ef970){while(--_0x1ef970){_0x3bae28['push'](_0x3bae28['shift']());}};_0xb431b(++_0x5ca4f5);}(_0x277d,0xa8));var _0xd277=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x277d[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0xd277('0x0'));var emlformat=require(_0xd277('0x1'));var rimraf=require(_0xd277('0x2'));var zipdir=require(_0xd277('0x3'));var jsonpatch=require(_0xd277('0x4'));var rp=require(_0xd277('0x5'));var moment=require(_0xd277('0x6'));var BPromise=require(_0xd277('0x7'));var Mustache=require(_0xd277('0x8'));var util=require(_0xd277('0x9'));var path=require(_0xd277('0xa'));var sox=require(_0xd277('0xb'));var csv=require(_0xd277('0xc'));var ejs=require(_0xd277('0xd'));var fs=require('fs');var _=require(_0xd277('0xe'));var squel=require(_0xd277('0xf'));var crypto=require(_0xd277('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd277('0x11'));var toCsv=require(_0xd277('0xc'));var querystring=require(_0xd277('0x12'));var Papa=require(_0xd277('0x13'));var authService=require(_0xd277('0x14'));var hardwareService=require(_0xd277('0x15'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xd277('0x16'))(_0xd277('0x17'));var utils=require(_0xd277('0x18'));var config=require(_0xd277('0x19'));var db=require(_0xd277('0x1a'))['db'];function respondWithStatusCode(_0x492d38,_0x1bdcdc){_0x1bdcdc=_0x1bdcdc||0xcc;return function(_0xe7f970){if(_0xe7f970){return _0x492d38[_0xd277('0x1b')](_0x1bdcdc);}return _0x492d38['status'](_0x1bdcdc)[_0xd277('0x1c')]();};}function respondWithResult(_0x28f884,_0x497820){_0x497820=_0x497820||0xc8;return function(_0x3f235c){if(_0x3f235c){return _0x28f884['status'](_0x497820)[_0xd277('0x1d')](_0x3f235c);}};}function respondWithFilteredResult(_0x1f9fa0,_0x5bd717){return function(_0x21c6bd){if(_0x21c6bd){var _0x25d81c=_0x21c6bd[_0xd277('0x1e')],_0x206313=_0x5bd717['offset'],_0x1607dd=_0x5bd717[_0xd277('0x1f')]+_0x5bd717[_0xd277('0x20')],_0x427577;if(_0x1607dd>=_0x25d81c){_0x1607dd=_0x25d81c;_0x427577=0xc8;}else{_0x427577=0xce;}_0x1f9fa0[_0xd277('0x21')](_0x427577);return _0x1f9fa0['set'](_0xd277('0x22'),_0x206313+'-'+_0x1607dd+'/'+_0x25d81c)['json'](_0x21c6bd);}return null;};}function patchUpdates(_0x167457){return function(_0x4999a8){try{jsonpatch[_0xd277('0x23')](_0x4999a8,_0x167457,!![]);}catch(_0x4f26cf){return BPromise[_0xd277('0x24')](_0x4f26cf);}return _0x4999a8[_0xd277('0x25')]();};}function saveUpdates(_0x38c6b2,_0x5063c5){return function(_0x22a41a){if(_0x22a41a){return _0x22a41a['update'](_0x38c6b2)[_0xd277('0x26')](function(_0x4edd7f){return _0x4edd7f;});}return null;};}function removeEntity(_0x5e6782,_0x12472c){return function(_0x1576a0){if(_0x1576a0){return _0x1576a0[_0xd277('0x27')]()[_0xd277('0x26')](function(){var _0x2d2242=_0x1576a0[_0xd277('0x28')]({'plain':!![]});var _0x4d5bbf='Triggers';return db[_0xd277('0x29')][_0xd277('0x27')]({'where':{'type':_0x4d5bbf,'resourceId':_0x2d2242['id']}})[_0xd277('0x26')](function(){return _0x1576a0;});})[_0xd277('0x26')](function(){_0x5e6782[_0xd277('0x21')](0xcc)[_0xd277('0x1c')]();});}};}function handleEntityNotFound(_0x3972be,_0x55a920){return function(_0x33721a){if(!_0x33721a){_0x3972be[_0xd277('0x1b')](0x194);}return _0x33721a;};}function handleError(_0x1c2dd7,_0x1b2152){_0x1b2152=_0x1b2152||0x1f4;return function(_0x32035a){logger[_0xd277('0x2a')](_0x32035a[_0xd277('0x2b')]);if(_0x32035a['name']){delete _0x32035a[_0xd277('0x2c')];}_0x1c2dd7[_0xd277('0x21')](_0x1b2152)['send'](_0x32035a);};}exports[_0xd277('0x2d')]=function(_0x808910,_0x481ce0){var _0x37e81e={},_0xa6d8d8={},_0x4fe650={'count':0x0,'rows':[]};var _0x533a61=db[_0xd277('0x2e')][_0xd277('0x2f')];_0xa6d8d8[_0xd277('0x30')]=_[_0xd277('0x31')](_0x533a61);_0xa6d8d8[_0xd277('0x32')]=_['keys'](_0x808910[_0xd277('0x32')]);_0xa6d8d8[_0xd277('0x33')]=_[_0xd277('0x34')](_0xa6d8d8[_0xd277('0x30')],_0xa6d8d8[_0xd277('0x32')]);_0x37e81e[_0xd277('0x35')]=_[_0xd277('0x34')](_0xa6d8d8['model'],qs['fields'](_0x808910[_0xd277('0x32')][_0xd277('0x36')]));_0x37e81e[_0xd277('0x35')]=_0x37e81e[_0xd277('0x35')][_0xd277('0x37')]?_0x37e81e[_0xd277('0x35')]:_0xa6d8d8[_0xd277('0x30')];if(!_0x808910[_0xd277('0x32')][_0xd277('0x38')](_0xd277('0x39'))){_0x37e81e[_0xd277('0x20')]=qs[_0xd277('0x20')](_0x808910['query'][_0xd277('0x20')]);_0x37e81e['offset']=qs['offset'](_0x808910[_0xd277('0x32')][_0xd277('0x1f')]);}_0x37e81e[_0xd277('0x3a')]=qs[_0xd277('0x3b')](_0x808910[_0xd277('0x32')][_0xd277('0x3b')]);_0x37e81e[_0xd277('0x3c')]=qs[_0xd277('0x33')](_[_0xd277('0x3d')](_0x808910['query'],_0xa6d8d8[_0xd277('0x33')]));if(_0x808910['query'][_0xd277('0x3e')]){_0x37e81e[_0xd277('0x3c')]=_[_0xd277('0x3f')](_0x37e81e[_0xd277('0x3c')],{'$or':_['map'](_0x533a61,function(_0x3075a8){if(_0x3075a8[_0xd277('0x40')][_0xd277('0x41')]!==_0xd277('0x42')){var _0x22477d={};_0x22477d[_0x3075a8[_0xd277('0x43')]]={'$like':'%'+_0x808910[_0xd277('0x32')][_0xd277('0x3e')]+'%'};return _0x22477d;}})});}_0x37e81e=_[_0xd277('0x3f')]({},_0x37e81e,_0x808910[_0xd277('0x44')]);var _0x5a6162={'where':_0x37e81e['where']};return db[_0xd277('0x2e')][_0xd277('0x1e')](_0x5a6162)[_0xd277('0x26')](function(_0x1f1924){_0x4fe650[_0xd277('0x1e')]=_0x1f1924;if(_0x808910[_0xd277('0x32')]['includeAll']){_0x37e81e['include']=[{'all':!![]}];}return db['Trigger'][_0xd277('0x45')](_0x37e81e);})[_0xd277('0x26')](function(_0x15165c){_0x4fe650[_0xd277('0x46')]=_0x15165c;return _0x4fe650;})[_0xd277('0x26')](respondWithFilteredResult(_0x481ce0,_0x37e81e))[_0xd277('0x47')](handleError(_0x481ce0,null));};exports[_0xd277('0x48')]=function(_0x3e1463,_0x965fa7){var _0x12ecec={'raw':![],'where':{'id':_0x3e1463[_0xd277('0x49')]['id']}},_0x12ece0={};_0x12ece0[_0xd277('0x30')]=_['keys'](db[_0xd277('0x2e')][_0xd277('0x2f')]);_0x12ece0[_0xd277('0x32')]=_[_0xd277('0x31')](_0x3e1463[_0xd277('0x32')]);_0x12ece0[_0xd277('0x33')]=_[_0xd277('0x34')](_0x12ece0[_0xd277('0x30')],_0x12ece0[_0xd277('0x32')]);_0x12ecec[_0xd277('0x35')]=_[_0xd277('0x34')](_0x12ece0[_0xd277('0x30')],qs[_0xd277('0x36')](_0x3e1463['query']['fields']));_0x12ecec['attributes']=_0x12ecec['attributes'][_0xd277('0x37')]?_0x12ecec[_0xd277('0x35')]:_0x12ece0[_0xd277('0x30')];if(_0x3e1463[_0xd277('0x32')][_0xd277('0x4a')]){_0x12ecec[_0xd277('0x4b')]=[{'all':!![]}];}_0x12ecec=_['merge']({},_0x12ecec,_0x3e1463[_0xd277('0x44')]);return db['Trigger'][_0xd277('0x4c')](_0x12ecec)[_0xd277('0x26')](handleEntityNotFound(_0x965fa7,null))[_0xd277('0x26')](respondWithResult(_0x965fa7,null))['catch'](handleError(_0x965fa7,null));};exports[_0xd277('0x4d')]=function(_0x139c7b,_0x38e4c5){return db[_0xd277('0x2e')][_0xd277('0x4d')](_0x139c7b[_0xd277('0x4e')],{})[_0xd277('0x26')](function(_0x262d42){var _0x51903b=_0x139c7b[_0xd277('0x4f')][_0xd277('0x28')]({'plain':!![]});if(!_0x51903b)throw new Error(_0xd277('0x50'));if(_0x51903b[_0xd277('0x51')]===_0xd277('0x4f')){var _0x38467d=_0x262d42['get']({'plain':!![]});var _0x123dac='Triggers';return db[_0xd277('0x52')][_0xd277('0x4c')]({'where':{'name':_0x123dac,'userProfileId':_0x51903b[_0xd277('0x53')]},'raw':!![]})[_0xd277('0x26')](function(_0x22a131){if(_0x22a131&&_0x22a131[_0xd277('0x54')]===0x0){return db['UserProfileResource'][_0xd277('0x4d')]({'name':_0x38467d['name'],'resourceId':_0x38467d['id'],'type':_0x22a131[_0xd277('0x2c')],'sectionId':_0x22a131['id']},{})[_0xd277('0x26')](function(){return _0x262d42;});}else{return _0x262d42;}})['catch'](function(_0x2853b0){logger[_0xd277('0x2a')](_0xd277('0x55'),_0x2853b0);throw _0x2853b0;});}return _0x262d42;})[_0xd277('0x26')](respondWithResult(_0x38e4c5,0xc9))['catch'](handleError(_0x38e4c5,null));};exports[_0xd277('0x56')]=function(_0x43243c,_0x307ea6){if(_0x43243c[_0xd277('0x4e')]['id']){delete _0x43243c['body']['id'];}return db[_0xd277('0x2e')][_0xd277('0x4c')]({'where':{'id':_0x43243c[_0xd277('0x49')]['id']}})[_0xd277('0x26')](handleEntityNotFound(_0x307ea6,null))[_0xd277('0x26')](saveUpdates(_0x43243c['body'],null))[_0xd277('0x26')](respondWithResult(_0x307ea6,null))['catch'](handleError(_0x307ea6,null));};exports[_0xd277('0x27')]=function(_0x372c24,_0x2e0caf){return db[_0xd277('0x2e')][_0xd277('0x4c')]({'where':{'id':_0x372c24['params']['id']}})[_0xd277('0x26')](handleEntityNotFound(_0x2e0caf,null))[_0xd277('0x26')](removeEntity(_0x2e0caf,null))[_0xd277('0x47')](handleError(_0x2e0caf,null));};exports[_0xd277('0x57')]=function(_0x2f02af,_0x2378db,_0x458a03){if(_0x2f02af[_0xd277('0x4e')]['id']){delete _0x2f02af[_0xd277('0x4e')]['id'];}return db['Trigger'][_0xd277('0x4c')]({'where':{'id':_0x2f02af[_0xd277('0x49')]['id']}})['then'](handleEntityNotFound(_0x2378db,null))[_0xd277('0x26')](function(_0x456bab){if(_0x456bab){_0x2f02af[_0xd277('0x4e')][_0xd277('0x58')]=_0x456bab['id'];return db[_0xd277('0x59')][_0xd277('0x4d')](_0x2f02af['body']);}})[_0xd277('0x26')](respondWithResult(_0x2378db,null))[_0xd277('0x47')](handleError(_0x2378db,null));};exports[_0xd277('0x5a')]=function(_0x3221c0,_0xd2f8db,_0x51ac13){if(_0x3221c0[_0xd277('0x4e')]['id']){delete _0x3221c0[_0xd277('0x4e')]['id'];}return db[_0xd277('0x2e')][_0xd277('0x4c')]({'where':{'id':_0x3221c0[_0xd277('0x49')]['id']}})['then'](handleEntityNotFound(_0xd2f8db,null))[_0xd277('0x26')](function(_0xb252d4){if(_0xb252d4){_0x3221c0[_0xd277('0x4e')][_0xd277('0x5b')]=_0xb252d4['id'];return db[_0xd277('0x59')][_0xd277('0x4d')](_0x3221c0[_0xd277('0x4e')]);}})[_0xd277('0x26')](respondWithResult(_0xd2f8db,null))[_0xd277('0x47')](handleError(_0xd2f8db,null));};exports[_0xd277('0x5c')]=function(_0x4e1a1f,_0x5c81bc,_0x2ad81f){var _0x436eb4={};var _0x1e3296={};var _0x32039a;var _0x45520a;return db[_0xd277('0x2e')]['findOne']({'where':{'id':_0x4e1a1f['params']['id']}})[_0xd277('0x26')](handleEntityNotFound(_0x5c81bc,null))[_0xd277('0x26')](function(_0xb9e7df){if(_0xb9e7df){_0x32039a=_0xb9e7df;_0x1e3296[_0xd277('0x30')]=_['keys'](db['Condition']['rawAttributes']);_0x1e3296[_0xd277('0x32')]=_[_0xd277('0x31')](_0x4e1a1f[_0xd277('0x32')]);_0x1e3296['filters']=_['intersection'](_0x1e3296[_0xd277('0x30')],_0x1e3296[_0xd277('0x32')]);_0x436eb4[_0xd277('0x35')]=_['intersection'](_0x1e3296['model'],qs[_0xd277('0x36')](_0x4e1a1f[_0xd277('0x32')][_0xd277('0x36')]));_0x436eb4[_0xd277('0x35')]=_0x436eb4[_0xd277('0x35')][_0xd277('0x37')]?_0x436eb4['attributes']:_0x1e3296[_0xd277('0x30')];_0x436eb4[_0xd277('0x3a')]=qs[_0xd277('0x3b')](_0x4e1a1f[_0xd277('0x32')]['sort']);_0x436eb4['where']=qs[_0xd277('0x33')](_[_0xd277('0x3d')](_0x4e1a1f[_0xd277('0x32')],_0x1e3296[_0xd277('0x33')]));if(_0x4e1a1f[_0xd277('0x32')][_0xd277('0x3e')]){_0x436eb4['where']=_[_0xd277('0x3f')](_0x436eb4['where'],{'$or':_[_0xd277('0x5d')](_0x436eb4[_0xd277('0x35')],function(_0x4be33b){var _0x13f59e={};_0x13f59e[_0x4be33b]={'$like':'%'+_0x4e1a1f[_0xd277('0x32')][_0xd277('0x3e')]+'%'};return _0x13f59e;})});}_0x436eb4=_[_0xd277('0x3f')]({},_0x436eb4,_0x4e1a1f[_0xd277('0x44')]);return _0x32039a[_0xd277('0x5c')](_0x436eb4);}})[_0xd277('0x26')](function(_0x3e616c){if(_0x3e616c){_0x45520a=_0x3e616c[_0xd277('0x37')];if(!_0x4e1a1f[_0xd277('0x32')][_0xd277('0x38')](_0xd277('0x39'))){_0x436eb4[_0xd277('0x20')]=qs[_0xd277('0x20')](_0x4e1a1f[_0xd277('0x32')][_0xd277('0x20')]);_0x436eb4[_0xd277('0x1f')]=qs[_0xd277('0x1f')](_0x4e1a1f[_0xd277('0x32')][_0xd277('0x1f')]);}return _0x32039a[_0xd277('0x5c')](_0x436eb4);}})['then'](function(_0xd7a3dc){if(_0xd7a3dc){return _0xd7a3dc?{'count':_0x45520a,'rows':_0xd7a3dc}:null;}})[_0xd277('0x26')](respondWithResult(_0x5c81bc,null))[_0xd277('0x47')](handleError(_0x5c81bc,null));};exports[_0xd277('0x5e')]=function(_0xfbc497,_0x447304,_0xfcd762){var _0x206d30={};var _0x363dfa={};var _0x336dea;var _0x2e55df;return db[_0xd277('0x2e')]['findOne']({'where':{'id':_0xfbc497[_0xd277('0x49')]['id']}})['then'](handleEntityNotFound(_0x447304,null))[_0xd277('0x26')](function(_0x4d9932){if(_0x4d9932){_0x336dea=_0x4d9932;_0x363dfa[_0xd277('0x30')]=_[_0xd277('0x31')](db[_0xd277('0x59')][_0xd277('0x2f')]);_0x363dfa[_0xd277('0x32')]=_['keys'](_0xfbc497[_0xd277('0x32')]);_0x363dfa['filters']=_[_0xd277('0x34')](_0x363dfa['model'],_0x363dfa['query']);_0x206d30['attributes']=_[_0xd277('0x34')](_0x363dfa[_0xd277('0x30')],qs[_0xd277('0x36')](_0xfbc497[_0xd277('0x32')][_0xd277('0x36')]));_0x206d30[_0xd277('0x35')]=_0x206d30[_0xd277('0x35')]['length']?_0x206d30[_0xd277('0x35')]:_0x363dfa[_0xd277('0x30')];_0x206d30[_0xd277('0x3a')]=qs[_0xd277('0x3b')](_0xfbc497[_0xd277('0x32')]['sort']);_0x206d30[_0xd277('0x3c')]=qs['filters'](_['pick'](_0xfbc497[_0xd277('0x32')],_0x363dfa[_0xd277('0x33')]));if(_0xfbc497[_0xd277('0x32')][_0xd277('0x3e')]){_0x206d30[_0xd277('0x3c')]=_[_0xd277('0x3f')](_0x206d30[_0xd277('0x3c')],{'$or':_[_0xd277('0x5d')](_0x206d30['attributes'],function(_0x331e09){var _0x69b665={};_0x69b665[_0x331e09]={'$like':'%'+_0xfbc497[_0xd277('0x32')][_0xd277('0x3e')]+'%'};return _0x69b665;})});}_0x206d30=_['merge']({},_0x206d30,_0xfbc497[_0xd277('0x44')]);return _0x336dea[_0xd277('0x5e')](_0x206d30);}})['then'](function(_0x4b165c){if(_0x4b165c){_0x2e55df=_0x4b165c[_0xd277('0x37')];if(!_0xfbc497[_0xd277('0x32')][_0xd277('0x38')](_0xd277('0x39'))){_0x206d30[_0xd277('0x20')]=qs[_0xd277('0x20')](_0xfbc497['query']['limit']);_0x206d30[_0xd277('0x1f')]=qs['offset'](_0xfbc497[_0xd277('0x32')][_0xd277('0x1f')]);}return _0x336dea[_0xd277('0x5e')](_0x206d30);}})[_0xd277('0x26')](function(_0x2d15d2){if(_0x2d15d2){return _0x2d15d2?{'count':_0x2e55df,'rows':_0x2d15d2}:null;}})['then'](respondWithResult(_0x447304,null))['catch'](handleError(_0x447304,null));};exports[_0xd277('0x5f')]=function(_0x1260ca,_0x5aac15,_0x5976d6){if(_0x1260ca[_0xd277('0x4e')]['id']){delete _0x1260ca[_0xd277('0x4e')]['id'];}return db['Trigger'][_0xd277('0x4c')]({'where':{'id':_0x1260ca[_0xd277('0x49')]['id']}})[_0xd277('0x26')](handleEntityNotFound(_0x5aac15,null))[_0xd277('0x26')](function(_0x298582){if(_0x298582){_0x1260ca['body']['TriggerId']=_0x298582['id'];return db[_0xd277('0x60')][_0xd277('0x4d')](_0x1260ca[_0xd277('0x4e')]);}})[_0xd277('0x26')](respondWithResult(_0x5aac15,null))[_0xd277('0x47')](handleError(_0x5aac15,null));};exports[_0xd277('0x61')]=function(_0x520ead,_0x5a0327,_0x4ea150){var _0x31df6c={};var _0x59094e={};var _0x80be91;var _0x382b83;return db[_0xd277('0x2e')]['findOne']({'where':{'id':_0x520ead[_0xd277('0x49')]['id']}})[_0xd277('0x26')](handleEntityNotFound(_0x5a0327,null))[_0xd277('0x26')](function(_0x49b4e4){if(_0x49b4e4){_0x80be91=_0x49b4e4;_0x59094e[_0xd277('0x30')]=_['keys'](db['Action'][_0xd277('0x2f')]);_0x59094e['query']=_[_0xd277('0x31')](_0x520ead[_0xd277('0x32')]);_0x59094e[_0xd277('0x33')]=_[_0xd277('0x34')](_0x59094e[_0xd277('0x30')],_0x59094e[_0xd277('0x32')]);_0x31df6c[_0xd277('0x35')]=_[_0xd277('0x34')](_0x59094e[_0xd277('0x30')],qs[_0xd277('0x36')](_0x520ead[_0xd277('0x32')][_0xd277('0x36')]));_0x31df6c[_0xd277('0x35')]=_0x31df6c[_0xd277('0x35')][_0xd277('0x37')]?_0x31df6c[_0xd277('0x35')]:_0x59094e[_0xd277('0x30')];_0x31df6c['order']=qs['sort'](_0x520ead['query']['sort']);_0x31df6c['where']=qs[_0xd277('0x33')](_[_0xd277('0x3d')](_0x520ead[_0xd277('0x32')],_0x59094e['filters']));if(_0x520ead[_0xd277('0x32')][_0xd277('0x3e')]){_0x31df6c[_0xd277('0x3c')]=_[_0xd277('0x3f')](_0x31df6c[_0xd277('0x3c')],{'$or':_[_0xd277('0x5d')](_0x31df6c[_0xd277('0x35')],function(_0x309851){var _0x557c31={};_0x557c31[_0x309851]={'$like':'%'+_0x520ead[_0xd277('0x32')][_0xd277('0x3e')]+'%'};return _0x557c31;})});}_0x31df6c=_[_0xd277('0x3f')]({},_0x31df6c,_0x520ead[_0xd277('0x44')]);return _0x80be91[_0xd277('0x61')](_0x31df6c);}})[_0xd277('0x26')](function(_0x1e0ff1){if(_0x1e0ff1){_0x382b83=_0x1e0ff1[_0xd277('0x37')];if(!_0x520ead[_0xd277('0x32')][_0xd277('0x38')](_0xd277('0x39'))){_0x31df6c[_0xd277('0x20')]=qs['limit'](_0x520ead[_0xd277('0x32')][_0xd277('0x20')]);_0x31df6c[_0xd277('0x1f')]=qs[_0xd277('0x1f')](_0x520ead[_0xd277('0x32')]['offset']);}return _0x80be91[_0xd277('0x61')](_0x31df6c);}})[_0xd277('0x26')](function(_0x38fdc3){if(_0x38fdc3){return _0x38fdc3?{'count':_0x382b83,'rows':_0x38fdc3}:null;}})[_0xd277('0x26')](respondWithResult(_0x5a0327,null))[_0xd277('0x47')](handleError(_0x5a0327,null));}; \ No newline at end of file +var _0x800c=['bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','length','options','find','Trigger','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','map','getAllConditions','getAnyConditions','findOne','TriggerId','getActions','html-pdf','rimraf','request-promise','moment'];(function(_0x122df5,_0x29caeb){var _0x4f5339=function(_0x12aafb){while(--_0x12aafb){_0x122df5['push'](_0x122df5['shift']());}};_0x4f5339(++_0x29caeb);}(_0x800c,0xb0));var _0xc800=function(_0x1ba855,_0x2b0cde){_0x1ba855=_0x1ba855-0x0;var _0x2424de=_0x800c[_0x1ba855];return _0x2424de;};'use strict';var pdf=require(_0xc800('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc800('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc800('0x2'));var moment=require(_0xc800('0x3'));var BPromise=require(_0xc800('0x4'));var Mustache=require('mustache');var util=require(_0xc800('0x5'));var path=require(_0xc800('0x6'));var sox=require(_0xc800('0x7'));var csv=require(_0xc800('0x8'));var ejs=require(_0xc800('0x9'));var fs=require('fs');var _=require(_0xc800('0xa'));var squel=require(_0xc800('0xb'));var crypto=require(_0xc800('0xc'));var jsforce=require(_0xc800('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc800('0x8'));var querystring=require(_0xc800('0xe'));var Papa=require(_0xc800('0xf'));var authService=require(_0xc800('0x10'));var hardwareService=require(_0xc800('0x11'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xc800('0x12'))(_0xc800('0x13'));var utils=require(_0xc800('0x14'));var config=require('../../config/environment');var db=require(_0xc800('0x15'))['db'];function respondWithStatusCode(_0x2d1fd1,_0x50e8bc){_0x50e8bc=_0x50e8bc||0xcc;return function(_0x521c6b){if(_0x521c6b){return _0x2d1fd1[_0xc800('0x16')](_0x50e8bc);}return _0x2d1fd1[_0xc800('0x17')](_0x50e8bc)[_0xc800('0x18')]();};}function respondWithResult(_0x3efb22,_0x37b970){_0x37b970=_0x37b970||0xc8;return function(_0x46b34a){if(_0x46b34a){return _0x3efb22[_0xc800('0x17')](_0x37b970)[_0xc800('0x19')](_0x46b34a);}};}function respondWithFilteredResult(_0x4ac947,_0xbdf5a4){return function(_0x5c0897){if(_0x5c0897){var _0x2b12eb=_0x5c0897[_0xc800('0x1a')],_0x46c021=_0xbdf5a4[_0xc800('0x1b')],_0xb5fdd1=_0xbdf5a4['offset']+_0xbdf5a4[_0xc800('0x1c')],_0x75627f;if(_0xb5fdd1>=_0x2b12eb){_0xb5fdd1=_0x2b12eb;_0x75627f=0xc8;}else{_0x75627f=0xce;}_0x4ac947[_0xc800('0x17')](_0x75627f);return _0x4ac947[_0xc800('0x1d')](_0xc800('0x1e'),_0x46c021+'-'+_0xb5fdd1+'/'+_0x2b12eb)['json'](_0x5c0897);}return null;};}function patchUpdates(_0x1f9263){return function(_0xe96078){try{jsonpatch[_0xc800('0x1f')](_0xe96078,_0x1f9263,!![]);}catch(_0x52d79d){return BPromise[_0xc800('0x20')](_0x52d79d);}return _0xe96078[_0xc800('0x21')]();};}function saveUpdates(_0x4a53a4,_0x323dbc){return function(_0x1b179){if(_0x1b179){return _0x1b179[_0xc800('0x22')](_0x4a53a4)[_0xc800('0x23')](function(_0x433b47){return _0x433b47;});}return null;};}function removeEntity(_0x34eee7,_0x1acf31){return function(_0x4861b2){if(_0x4861b2){return _0x4861b2[_0xc800('0x24')]()['then'](function(){var _0x21c70e=_0x4861b2[_0xc800('0x25')]({'plain':!![]});var _0x55feba=_0xc800('0x26');return db[_0xc800('0x27')][_0xc800('0x24')]({'where':{'type':_0x55feba,'resourceId':_0x21c70e['id']}})[_0xc800('0x23')](function(){return _0x4861b2;});})['then'](function(){_0x34eee7[_0xc800('0x17')](0xcc)[_0xc800('0x18')]();});}};}function handleEntityNotFound(_0x12a41c,_0x1abe9f){return function(_0x2e4523){if(!_0x2e4523){_0x12a41c[_0xc800('0x16')](0x194);}return _0x2e4523;};}function handleError(_0x4afc37,_0x4a9d72){_0x4a9d72=_0x4a9d72||0x1f4;return function(_0x2edf5b){logger[_0xc800('0x28')](_0x2edf5b[_0xc800('0x29')]);if(_0x2edf5b[_0xc800('0x2a')]){delete _0x2edf5b[_0xc800('0x2a')];}_0x4afc37[_0xc800('0x17')](_0x4a9d72)[_0xc800('0x2b')](_0x2edf5b);};}exports[_0xc800('0x2c')]=function(_0x4bc834,_0x418abd){var _0x539c3c={},_0x422438={},_0x3d3f09={'count':0x0,'rows':[]};var _0xcd78b7=db['Trigger'][_0xc800('0x2d')];_0x422438[_0xc800('0x2e')]=_[_0xc800('0x2f')](_0xcd78b7);_0x422438[_0xc800('0x30')]=_[_0xc800('0x2f')](_0x4bc834['query']);_0x422438[_0xc800('0x31')]=_[_0xc800('0x32')](_0x422438[_0xc800('0x2e')],_0x422438[_0xc800('0x30')]);_0x539c3c[_0xc800('0x33')]=_[_0xc800('0x32')](_0x422438['model'],qs[_0xc800('0x34')](_0x4bc834[_0xc800('0x30')]['fields']));_0x539c3c[_0xc800('0x33')]=_0x539c3c[_0xc800('0x33')]['length']?_0x539c3c[_0xc800('0x33')]:_0x422438[_0xc800('0x2e')];if(!_0x4bc834['query'][_0xc800('0x35')](_0xc800('0x36'))){_0x539c3c[_0xc800('0x1c')]=qs['limit'](_0x4bc834[_0xc800('0x30')][_0xc800('0x1c')]);_0x539c3c[_0xc800('0x1b')]=qs['offset'](_0x4bc834[_0xc800('0x30')][_0xc800('0x1b')]);}_0x539c3c[_0xc800('0x37')]=qs[_0xc800('0x38')](_0x4bc834['query'][_0xc800('0x38')]);_0x539c3c[_0xc800('0x39')]=qs[_0xc800('0x31')](_['pick'](_0x4bc834['query'],_0x422438[_0xc800('0x31')]));if(_0x4bc834[_0xc800('0x30')][_0xc800('0x3a')]){_0x539c3c[_0xc800('0x39')]=_[_0xc800('0x3b')](_0x539c3c[_0xc800('0x39')],{'$or':_['map'](_0xcd78b7,function(_0x3ded5a){if(_0x3ded5a[_0xc800('0x3c')]['key']!==_0xc800('0x3d')){var _0x5a9555={};_0x5a9555[_0x3ded5a[_0xc800('0x3e')]]={'$like':'%'+_0x4bc834['query']['filter']+'%'};return _0x5a9555;}})});}_0x539c3c=_['merge']({},_0x539c3c,_0x4bc834['options']);var _0x2cd4fb={'where':_0x539c3c[_0xc800('0x39')]};return db['Trigger'][_0xc800('0x1a')](_0x2cd4fb)[_0xc800('0x23')](function(_0x619d3c){_0x3d3f09[_0xc800('0x1a')]=_0x619d3c;if(_0x4bc834[_0xc800('0x30')][_0xc800('0x3f')]){_0x539c3c[_0xc800('0x40')]=[{'all':!![]}];}return db['Trigger'][_0xc800('0x41')](_0x539c3c);})[_0xc800('0x23')](function(_0x88006f){_0x3d3f09[_0xc800('0x42')]=_0x88006f;return _0x3d3f09;})['then'](respondWithFilteredResult(_0x418abd,_0x539c3c))[_0xc800('0x43')](handleError(_0x418abd,null));};exports[_0xc800('0x44')]=function(_0x54fc78,_0x147ce2){var _0x473825={'raw':![],'where':{'id':_0x54fc78[_0xc800('0x45')]['id']}},_0x50ba16={};_0x50ba16['model']=_[_0xc800('0x2f')](db['Trigger'][_0xc800('0x2d')]);_0x50ba16[_0xc800('0x30')]=_[_0xc800('0x2f')](_0x54fc78['query']);_0x50ba16[_0xc800('0x31')]=_[_0xc800('0x32')](_0x50ba16[_0xc800('0x2e')],_0x50ba16[_0xc800('0x30')]);_0x473825[_0xc800('0x33')]=_[_0xc800('0x32')](_0x50ba16[_0xc800('0x2e')],qs[_0xc800('0x34')](_0x54fc78[_0xc800('0x30')]['fields']));_0x473825[_0xc800('0x33')]=_0x473825[_0xc800('0x33')][_0xc800('0x46')]?_0x473825[_0xc800('0x33')]:_0x50ba16[_0xc800('0x2e')];if(_0x54fc78[_0xc800('0x30')][_0xc800('0x3f')]){_0x473825[_0xc800('0x40')]=[{'all':!![]}];}_0x473825=_['merge']({},_0x473825,_0x54fc78[_0xc800('0x47')]);return db['Trigger'][_0xc800('0x48')](_0x473825)['then'](handleEntityNotFound(_0x147ce2,null))[_0xc800('0x23')](respondWithResult(_0x147ce2,null))[_0xc800('0x43')](handleError(_0x147ce2,null));};exports['create']=function(_0x3be765,_0x1d5528){return db[_0xc800('0x49')]['create'](_0x3be765[_0xc800('0x4a')],{})[_0xc800('0x23')](function(_0x3caa75){var _0x30d657=_0x3be765[_0xc800('0x4b')][_0xc800('0x25')]({'plain':!![]});if(!_0x30d657)throw new Error(_0xc800('0x4c'));if(_0x30d657['role']===_0xc800('0x4b')){var _0x4d0163=_0x3caa75[_0xc800('0x25')]({'plain':!![]});var _0x51aaef=_0xc800('0x26');return db['UserProfileSection'][_0xc800('0x48')]({'where':{'name':_0x51aaef,'userProfileId':_0x30d657[_0xc800('0x4d')]},'raw':!![]})[_0xc800('0x23')](function(_0x4b57ab){if(_0x4b57ab&&_0x4b57ab['autoAssociation']===0x0){return db[_0xc800('0x27')][_0xc800('0x4e')]({'name':_0x4d0163[_0xc800('0x2a')],'resourceId':_0x4d0163['id'],'type':_0x4b57ab['name'],'sectionId':_0x4b57ab['id']},{})[_0xc800('0x23')](function(){return _0x3caa75;});}else{return _0x3caa75;}})[_0xc800('0x43')](function(_0x17c4f6){logger[_0xc800('0x28')](_0xc800('0x4f'),_0x17c4f6);throw _0x17c4f6;});}return _0x3caa75;})['then'](respondWithResult(_0x1d5528,0xc9))[_0xc800('0x43')](handleError(_0x1d5528,null));};exports[_0xc800('0x22')]=function(_0x57c8d,_0x4d1a11){if(_0x57c8d[_0xc800('0x4a')]['id']){delete _0x57c8d[_0xc800('0x4a')]['id'];}return db[_0xc800('0x49')][_0xc800('0x48')]({'where':{'id':_0x57c8d[_0xc800('0x45')]['id']}})['then'](handleEntityNotFound(_0x4d1a11,null))[_0xc800('0x23')](saveUpdates(_0x57c8d[_0xc800('0x4a')],null))['then'](respondWithResult(_0x4d1a11,null))[_0xc800('0x43')](handleError(_0x4d1a11,null));};exports['destroy']=function(_0x47048d,_0x8482ce){return db[_0xc800('0x49')]['find']({'where':{'id':_0x47048d[_0xc800('0x45')]['id']}})[_0xc800('0x23')](handleEntityNotFound(_0x8482ce,null))[_0xc800('0x23')](removeEntity(_0x8482ce,null))[_0xc800('0x43')](handleError(_0x8482ce,null));};exports[_0xc800('0x50')]=function(_0x25fa98,_0x380453,_0x26834f){if(_0x25fa98[_0xc800('0x4a')]['id']){delete _0x25fa98['body']['id'];}return db[_0xc800('0x49')][_0xc800('0x48')]({'where':{'id':_0x25fa98['params']['id']}})[_0xc800('0x23')](handleEntityNotFound(_0x380453,null))[_0xc800('0x23')](function(_0x4e1917){if(_0x4e1917){_0x25fa98[_0xc800('0x4a')][_0xc800('0x51')]=_0x4e1917['id'];return db[_0xc800('0x52')][_0xc800('0x4e')](_0x25fa98['body']);}})[_0xc800('0x23')](respondWithResult(_0x380453,null))[_0xc800('0x43')](handleError(_0x380453,null));};exports['addAnyCondition']=function(_0x45f60d,_0x5b9a2b,_0x28880d){if(_0x45f60d[_0xc800('0x4a')]['id']){delete _0x45f60d[_0xc800('0x4a')]['id'];}return db[_0xc800('0x49')]['find']({'where':{'id':_0x45f60d[_0xc800('0x45')]['id']}})[_0xc800('0x23')](handleEntityNotFound(_0x5b9a2b,null))[_0xc800('0x23')](function(_0x185545){if(_0x185545){_0x45f60d[_0xc800('0x4a')][_0xc800('0x53')]=_0x185545['id'];return db[_0xc800('0x52')][_0xc800('0x4e')](_0x45f60d[_0xc800('0x4a')]);}})['then'](respondWithResult(_0x5b9a2b,null))[_0xc800('0x43')](handleError(_0x5b9a2b,null));};exports['getAllConditions']=function(_0x1cd96b,_0x2ce58e,_0x1983b5){var _0x48cc92={};var _0x25b365={};var _0x16df22;var _0x523b0b;return db[_0xc800('0x49')]['findOne']({'where':{'id':_0x1cd96b[_0xc800('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ce58e,null))[_0xc800('0x23')](function(_0x451269){if(_0x451269){_0x16df22=_0x451269;_0x25b365[_0xc800('0x2e')]=_['keys'](db[_0xc800('0x52')]['rawAttributes']);_0x25b365[_0xc800('0x30')]=_[_0xc800('0x2f')](_0x1cd96b[_0xc800('0x30')]);_0x25b365[_0xc800('0x31')]=_['intersection'](_0x25b365[_0xc800('0x2e')],_0x25b365['query']);_0x48cc92[_0xc800('0x33')]=_[_0xc800('0x32')](_0x25b365['model'],qs['fields'](_0x1cd96b[_0xc800('0x30')][_0xc800('0x34')]));_0x48cc92['attributes']=_0x48cc92[_0xc800('0x33')][_0xc800('0x46')]?_0x48cc92['attributes']:_0x25b365[_0xc800('0x2e')];_0x48cc92[_0xc800('0x37')]=qs['sort'](_0x1cd96b[_0xc800('0x30')]['sort']);_0x48cc92[_0xc800('0x39')]=qs[_0xc800('0x31')](_['pick'](_0x1cd96b['query'],_0x25b365[_0xc800('0x31')]));if(_0x1cd96b[_0xc800('0x30')]['filter']){_0x48cc92['where']=_[_0xc800('0x3b')](_0x48cc92[_0xc800('0x39')],{'$or':_[_0xc800('0x54')](_0x48cc92[_0xc800('0x33')],function(_0x4a0551){var _0x49a3d7={};_0x49a3d7[_0x4a0551]={'$like':'%'+_0x1cd96b[_0xc800('0x30')][_0xc800('0x3a')]+'%'};return _0x49a3d7;})});}_0x48cc92=_[_0xc800('0x3b')]({},_0x48cc92,_0x1cd96b['options']);return _0x16df22[_0xc800('0x55')](_0x48cc92);}})[_0xc800('0x23')](function(_0xdbfbd5){if(_0xdbfbd5){_0x523b0b=_0xdbfbd5[_0xc800('0x46')];if(!_0x1cd96b[_0xc800('0x30')][_0xc800('0x35')](_0xc800('0x36'))){_0x48cc92[_0xc800('0x1c')]=qs[_0xc800('0x1c')](_0x1cd96b[_0xc800('0x30')][_0xc800('0x1c')]);_0x48cc92['offset']=qs[_0xc800('0x1b')](_0x1cd96b[_0xc800('0x30')][_0xc800('0x1b')]);}return _0x16df22[_0xc800('0x55')](_0x48cc92);}})['then'](function(_0x5d9be5){if(_0x5d9be5){return _0x5d9be5?{'count':_0x523b0b,'rows':_0x5d9be5}:null;}})['then'](respondWithResult(_0x2ce58e,null))[_0xc800('0x43')](handleError(_0x2ce58e,null));};exports[_0xc800('0x56')]=function(_0x45cc56,_0x7d5d7c,_0x4020a3){var _0x56ffff={};var _0xf19aaf={};var _0x276ab8;var _0x5bd4a0;return db[_0xc800('0x49')][_0xc800('0x57')]({'where':{'id':_0x45cc56[_0xc800('0x45')]['id']}})[_0xc800('0x23')](handleEntityNotFound(_0x7d5d7c,null))['then'](function(_0x101de7){if(_0x101de7){_0x276ab8=_0x101de7;_0xf19aaf['model']=_[_0xc800('0x2f')](db[_0xc800('0x52')]['rawAttributes']);_0xf19aaf[_0xc800('0x30')]=_[_0xc800('0x2f')](_0x45cc56['query']);_0xf19aaf[_0xc800('0x31')]=_[_0xc800('0x32')](_0xf19aaf[_0xc800('0x2e')],_0xf19aaf[_0xc800('0x30')]);_0x56ffff[_0xc800('0x33')]=_[_0xc800('0x32')](_0xf19aaf['model'],qs['fields'](_0x45cc56[_0xc800('0x30')][_0xc800('0x34')]));_0x56ffff['attributes']=_0x56ffff['attributes'][_0xc800('0x46')]?_0x56ffff[_0xc800('0x33')]:_0xf19aaf[_0xc800('0x2e')];_0x56ffff[_0xc800('0x37')]=qs['sort'](_0x45cc56[_0xc800('0x30')][_0xc800('0x38')]);_0x56ffff['where']=qs[_0xc800('0x31')](_['pick'](_0x45cc56[_0xc800('0x30')],_0xf19aaf[_0xc800('0x31')]));if(_0x45cc56[_0xc800('0x30')][_0xc800('0x3a')]){_0x56ffff[_0xc800('0x39')]=_['merge'](_0x56ffff['where'],{'$or':_[_0xc800('0x54')](_0x56ffff['attributes'],function(_0x809777){var _0x4f0c86={};_0x4f0c86[_0x809777]={'$like':'%'+_0x45cc56[_0xc800('0x30')]['filter']+'%'};return _0x4f0c86;})});}_0x56ffff=_[_0xc800('0x3b')]({},_0x56ffff,_0x45cc56[_0xc800('0x47')]);return _0x276ab8[_0xc800('0x56')](_0x56ffff);}})[_0xc800('0x23')](function(_0x56216b){if(_0x56216b){_0x5bd4a0=_0x56216b[_0xc800('0x46')];if(!_0x45cc56['query']['hasOwnProperty'](_0xc800('0x36'))){_0x56ffff['limit']=qs[_0xc800('0x1c')](_0x45cc56[_0xc800('0x30')][_0xc800('0x1c')]);_0x56ffff['offset']=qs[_0xc800('0x1b')](_0x45cc56[_0xc800('0x30')][_0xc800('0x1b')]);}return _0x276ab8['getAnyConditions'](_0x56ffff);}})[_0xc800('0x23')](function(_0x1aa85c){if(_0x1aa85c){return _0x1aa85c?{'count':_0x5bd4a0,'rows':_0x1aa85c}:null;}})[_0xc800('0x23')](respondWithResult(_0x7d5d7c,null))[_0xc800('0x43')](handleError(_0x7d5d7c,null));};exports['addAction']=function(_0x56d062,_0x3f0cbb,_0x1cbff7){if(_0x56d062[_0xc800('0x4a')]['id']){delete _0x56d062[_0xc800('0x4a')]['id'];}return db['Trigger'][_0xc800('0x48')]({'where':{'id':_0x56d062[_0xc800('0x45')]['id']}})[_0xc800('0x23')](handleEntityNotFound(_0x3f0cbb,null))[_0xc800('0x23')](function(_0x2d8451){if(_0x2d8451){_0x56d062[_0xc800('0x4a')][_0xc800('0x58')]=_0x2d8451['id'];return db['Action'][_0xc800('0x4e')](_0x56d062[_0xc800('0x4a')]);}})['then'](respondWithResult(_0x3f0cbb,null))[_0xc800('0x43')](handleError(_0x3f0cbb,null));};exports[_0xc800('0x59')]=function(_0x35a206,_0x37aadc,_0x354529){var _0x42b525={};var _0x6a9de5={};var _0x3f147b;var _0x2e3838;return db[_0xc800('0x49')][_0xc800('0x57')]({'where':{'id':_0x35a206['params']['id']}})[_0xc800('0x23')](handleEntityNotFound(_0x37aadc,null))[_0xc800('0x23')](function(_0x256409){if(_0x256409){_0x3f147b=_0x256409;_0x6a9de5[_0xc800('0x2e')]=_[_0xc800('0x2f')](db['Action']['rawAttributes']);_0x6a9de5[_0xc800('0x30')]=_['keys'](_0x35a206[_0xc800('0x30')]);_0x6a9de5[_0xc800('0x31')]=_[_0xc800('0x32')](_0x6a9de5['model'],_0x6a9de5[_0xc800('0x30')]);_0x42b525['attributes']=_[_0xc800('0x32')](_0x6a9de5['model'],qs[_0xc800('0x34')](_0x35a206['query']['fields']));_0x42b525['attributes']=_0x42b525[_0xc800('0x33')][_0xc800('0x46')]?_0x42b525[_0xc800('0x33')]:_0x6a9de5[_0xc800('0x2e')];_0x42b525[_0xc800('0x37')]=qs[_0xc800('0x38')](_0x35a206[_0xc800('0x30')][_0xc800('0x38')]);_0x42b525['where']=qs['filters'](_['pick'](_0x35a206[_0xc800('0x30')],_0x6a9de5[_0xc800('0x31')]));if(_0x35a206[_0xc800('0x30')][_0xc800('0x3a')]){_0x42b525[_0xc800('0x39')]=_[_0xc800('0x3b')](_0x42b525['where'],{'$or':_[_0xc800('0x54')](_0x42b525[_0xc800('0x33')],function(_0x3ac0da){var _0x5e6b66={};_0x5e6b66[_0x3ac0da]={'$like':'%'+_0x35a206[_0xc800('0x30')][_0xc800('0x3a')]+'%'};return _0x5e6b66;})});}_0x42b525=_[_0xc800('0x3b')]({},_0x42b525,_0x35a206[_0xc800('0x47')]);return _0x3f147b[_0xc800('0x59')](_0x42b525);}})['then'](function(_0x9c4451){if(_0x9c4451){_0x2e3838=_0x9c4451[_0xc800('0x46')];if(!_0x35a206[_0xc800('0x30')]['hasOwnProperty']('nolimit')){_0x42b525[_0xc800('0x1c')]=qs['limit'](_0x35a206[_0xc800('0x30')][_0xc800('0x1c')]);_0x42b525[_0xc800('0x1b')]=qs[_0xc800('0x1b')](_0x35a206[_0xc800('0x30')]['offset']);}return _0x3f147b[_0xc800('0x59')](_0x42b525);}})['then'](function(_0x2a76dc){if(_0x2a76dc){return _0x2a76dc?{'count':_0x2e3838,'rows':_0x2a76dc}:null;}})[_0xc800('0x23')](respondWithResult(_0x37aadc,null))[_0xc800('0x43')](handleError(_0x37aadc,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index d9ab163..5613430 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 _0xa97c=['lodash','util','../../config/logger','api','bluebird','request-promise','./trigger.attributes','exports','tools_triggers'];(function(_0x45c90a,_0x3a7025){var _0x212288=function(_0x57e33c){while(--_0x57e33c){_0x45c90a['push'](_0x45c90a['shift']());}};_0x212288(++_0x3a7025);}(_0xa97c,0xfc));var _0xca97=function(_0x1dd601,_0x3802b1){_0x1dd601=_0x1dd601-0x0;var _0xc75d4c=_0xa97c[_0x1dd601];return _0xc75d4c;};'use strict';var _=require(_0xca97('0x0'));var util=require(_0xca97('0x1'));var logger=require(_0xca97('0x2'))(_0xca97('0x3'));var moment=require('moment');var BPromise=require(_0xca97('0x4'));var rp=require(_0xca97('0x5'));var attributes=require(_0xca97('0x6'));module[_0xca97('0x7')]=function(_0x5ad3bd,_0x26fe65){return _0x5ad3bd['define']('Trigger',attributes,{'tableName':_0xca97('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2755=['../../config/logger','api','bluebird','request-promise','Trigger','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2755,0xc9));var _0x5275=function(_0x467f16,_0x437cc3){_0x467f16=_0x467f16-0x0;var _0x28338b=_0x2755[_0x467f16];return _0x28338b;};'use strict';var _=require(_0x5275('0x0'));var util=require(_0x5275('0x1'));var logger=require(_0x5275('0x2'))(_0x5275('0x3'));var moment=require('moment');var BPromise=require(_0x5275('0x4'));var rp=require(_0x5275('0x5'));var attributes=require('./trigger.attributes');module['exports']=function(_0x9638f6,_0x550c12){return _0x9638f6['define'](_0x5275('0x6'),attributes,{'tableName':'tools_triggers','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 303ac6d..8baa2df 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 _0x60c7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','info','result','catch','GetTrigger','Trigger','findAll','options','raw','where','include','map','attributes','model','ShowTrigger','find','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2606e1,_0x4ef472){var _0x171451=function(_0x4595ee){while(--_0x4595ee){_0x2606e1['push'](_0x2606e1['shift']());}};_0x171451(++_0x4ef472);}(_0x60c7,0x1aa));var _0x760c=function(_0x3af50e,_0x4e283f){_0x3af50e=_0x3af50e-0x0;var _0x58c1df=_0x60c7[_0x3af50e];return _0x58c1df;};'use strict';var _=require(_0x760c('0x0'));var util=require(_0x760c('0x1'));var moment=require(_0x760c('0x2'));var BPromise=require(_0x760c('0x3'));var rs=require(_0x760c('0x4'));var fs=require('fs');var Redis=require(_0x760c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x760c('0x6'))(_0x760c('0x7'));var config=require(_0x760c('0x8'));var jayson=require(_0x760c('0x9'));var client=jayson[_0x760c('0xa')][_0x760c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20815b,_0xc98f04,_0x4299b7){return new BPromise(function(_0x27086f,_0x146344){return client[_0x760c('0xc')](_0x20815b,_0x4299b7)['then'](function(_0x19000b){logger['info']('Trigger,\x20%s,\x20%s',_0xc98f04,_0x760c('0xd'));logger['debug'](_0x760c('0xe'),_0xc98f04,_0x760c('0xd'),JSON[_0x760c('0xf')](_0x19000b));if(_0x19000b['error']){if(_0x19000b[_0x760c('0x10')][_0x760c('0x11')]===0x1f4){logger[_0x760c('0x10')](_0x760c('0x12'),_0xc98f04,_0x19000b['error'][_0x760c('0x13')]);return _0x146344(_0x19000b[_0x760c('0x10')][_0x760c('0x13')]);}logger[_0x760c('0x10')](_0x760c('0x12'),_0xc98f04,_0x19000b[_0x760c('0x10')][_0x760c('0x13')]);return _0x27086f(_0x19000b['error'][_0x760c('0x13')]);}else{logger[_0x760c('0x14')](_0x760c('0x12'),_0xc98f04,'request\x20sent');_0x27086f(_0x19000b[_0x760c('0x15')][_0x760c('0x13')]);}})[_0x760c('0x16')](function(_0x5c2c47){logger[_0x760c('0x10')](_0x760c('0x12'),_0xc98f04,_0x5c2c47);_0x146344(_0x5c2c47);});});}exports[_0x760c('0x17')]=function(_0x3acb16){var _0x6f9069=this;return new Promise(function(_0x938f8e,_0xf68797){return db[_0x760c('0x18')][_0x760c('0x19')]({'raw':_0x3acb16[_0x760c('0x1a')]?_0x3acb16[_0x760c('0x1a')][_0x760c('0x1b')]===undefined?!![]:![]:!![],'where':_0x3acb16[_0x760c('0x1a')]?_0x3acb16[_0x760c('0x1a')][_0x760c('0x1c')]||null:null,'attributes':_0x3acb16[_0x760c('0x1a')]?_0x3acb16[_0x760c('0x1a')]['attributes']||null:null,'limit':_0x3acb16['options']?_0x3acb16[_0x760c('0x1a')]['limit']||null:null,'include':_0x3acb16['options']?_0x3acb16[_0x760c('0x1a')][_0x760c('0x1d')]?_[_0x760c('0x1e')](_0x3acb16[_0x760c('0x1a')]['include'],function(_0x78a475){return{'model':db[_0x78a475['model']],'as':_0x78a475['as'],'attributes':_0x78a475[_0x760c('0x1f')],'include':_0x78a475[_0x760c('0x1d')]?_[_0x760c('0x1e')](_0x78a475[_0x760c('0x1d')],function(_0x5410a4){return{'model':db[_0x5410a4['model']],'as':_0x5410a4['as'],'attributes':_0x5410a4['attributes'],'include':_0x5410a4['include']?_['map'](_0x5410a4[_0x760c('0x1d')],function(_0x37c834){return{'model':db[_0x37c834[_0x760c('0x20')]],'as':_0x37c834['as'],'attributes':_0x37c834[_0x760c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x617fd8){logger['info'](_0x760c('0x17'),_0x3acb16);logger['debug']('GetTrigger',_0x3acb16,JSON[_0x760c('0xf')](_0x617fd8));_0x938f8e(_0x617fd8);})[_0x760c('0x16')](function(_0x345e00){logger[_0x760c('0x10')](_0x760c('0x17'),_0x345e00[_0x760c('0x13')],_0x3acb16);_0xf68797(_0x6f9069[_0x760c('0x10')](0x1f4,_0x345e00[_0x760c('0x13')]));});});};exports[_0x760c('0x21')]=function(_0x4beb19){var _0x4e899c=this;return new Promise(function(_0x5777bc,_0x25f223){return db['Trigger'][_0x760c('0x22')]({'raw':_0x4beb19[_0x760c('0x1a')]?_0x4beb19[_0x760c('0x1a')][_0x760c('0x1b')]===undefined?!![]:![]:!![],'where':_0x4beb19[_0x760c('0x1a')]?_0x4beb19[_0x760c('0x1a')]['where']||null:null,'attributes':_0x4beb19[_0x760c('0x1a')]?_0x4beb19['options']['attributes']||null:null,'include':_0x4beb19[_0x760c('0x1a')]?_0x4beb19[_0x760c('0x1a')]['include']?_[_0x760c('0x1e')](_0x4beb19['options']['include'],function(_0x1b4bbb){return{'model':db[_0x1b4bbb[_0x760c('0x20')]],'as':_0x1b4bbb['as'],'attributes':_0x1b4bbb[_0x760c('0x1f')],'include':_0x1b4bbb[_0x760c('0x1d')]?_[_0x760c('0x1e')](_0x1b4bbb['include'],function(_0x56ce10){return{'model':db[_0x56ce10[_0x760c('0x20')]],'as':_0x56ce10['as'],'attributes':_0x56ce10[_0x760c('0x1f')],'include':_0x56ce10[_0x760c('0x1d')]?_[_0x760c('0x1e')](_0x56ce10[_0x760c('0x1d')],function(_0x549307){return{'model':db[_0x549307['model']],'as':_0x549307['as'],'attributes':_0x549307[_0x760c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5132fe){logger[_0x760c('0x14')](_0x760c('0x21'),_0x4beb19);logger[_0x760c('0x23')](_0x760c('0x21'),_0x4beb19,JSON[_0x760c('0xf')](_0x5132fe));_0x5777bc(_0x5132fe);})['catch'](function(_0xd88cb9){logger[_0x760c('0x10')](_0x760c('0x21'),_0xd88cb9[_0x760c('0x13')],_0x4beb19);_0x25f223(_0x4e899c[_0x760c('0x10')](0x1f4,_0xd88cb9[_0x760c('0x13')]));});});}; \ No newline at end of file +var _0x6b64=['options','where','attributes','limit','map','include','model','stringify','catch','ShowTrigger','find','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','GetTrigger','Trigger','findAll'];(function(_0x1db8f9,_0x5e8df7){var _0x25bd8b=function(_0x357b43){while(--_0x357b43){_0x1db8f9['push'](_0x1db8f9['shift']());}};_0x25bd8b(++_0x5e8df7);}(_0x6b64,0x12c));var _0x46b6=function(_0x8e9386,_0x3cc60f){_0x8e9386=_0x8e9386-0x0;var _0x4abf26=_0x6b64[_0x8e9386];return _0x4abf26;};'use strict';var _=require(_0x46b6('0x0'));var util=require(_0x46b6('0x1'));var moment=require(_0x46b6('0x2'));var BPromise=require('bluebird');var rs=require(_0x46b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46b6('0x4'))['db'];var utils=require(_0x46b6('0x5'));var logger=require(_0x46b6('0x6'))(_0x46b6('0x7'));var config=require(_0x46b6('0x8'));var jayson=require(_0x46b6('0x9'));var client=jayson[_0x46b6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a6e68,_0x48d410,_0x5668fd){return new BPromise(function(_0x560a05,_0x3a5366){return client['request'](_0x2a6e68,_0x5668fd)[_0x46b6('0xb')](function(_0x345cef){logger[_0x46b6('0xc')](_0x46b6('0xd'),_0x48d410,_0x46b6('0xe'));logger[_0x46b6('0xf')](_0x46b6('0x10'),_0x48d410,'request\x20sent',JSON['stringify'](_0x345cef));if(_0x345cef[_0x46b6('0x11')]){if(_0x345cef['error'][_0x46b6('0x12')]===0x1f4){logger[_0x46b6('0x11')]('Trigger,\x20%s,\x20%s',_0x48d410,_0x345cef[_0x46b6('0x11')]['message']);return _0x3a5366(_0x345cef['error'][_0x46b6('0x13')]);}logger[_0x46b6('0x11')](_0x46b6('0xd'),_0x48d410,_0x345cef['error'][_0x46b6('0x13')]);return _0x560a05(_0x345cef[_0x46b6('0x11')][_0x46b6('0x13')]);}else{logger['info']('Trigger,\x20%s,\x20%s',_0x48d410,_0x46b6('0xe'));_0x560a05(_0x345cef[_0x46b6('0x14')][_0x46b6('0x13')]);}})['catch'](function(_0x2030bc){logger[_0x46b6('0x11')]('Trigger,\x20%s,\x20%s',_0x48d410,_0x2030bc);_0x3a5366(_0x2030bc);});});}exports[_0x46b6('0x15')]=function(_0x42ce40){var _0x5ce805=this;return new Promise(function(_0x57474d,_0x4f569c){return db[_0x46b6('0x16')][_0x46b6('0x17')]({'raw':_0x42ce40[_0x46b6('0x18')]?_0x42ce40[_0x46b6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x42ce40[_0x46b6('0x18')]?_0x42ce40[_0x46b6('0x18')][_0x46b6('0x19')]||null:null,'attributes':_0x42ce40[_0x46b6('0x18')]?_0x42ce40['options'][_0x46b6('0x1a')]||null:null,'limit':_0x42ce40[_0x46b6('0x18')]?_0x42ce40[_0x46b6('0x18')][_0x46b6('0x1b')]||null:null,'include':_0x42ce40[_0x46b6('0x18')]?_0x42ce40['options']['include']?_[_0x46b6('0x1c')](_0x42ce40[_0x46b6('0x18')][_0x46b6('0x1d')],function(_0x52e94d){return{'model':db[_0x52e94d[_0x46b6('0x1e')]],'as':_0x52e94d['as'],'attributes':_0x52e94d[_0x46b6('0x1a')],'include':_0x52e94d[_0x46b6('0x1d')]?_[_0x46b6('0x1c')](_0x52e94d[_0x46b6('0x1d')],function(_0x352956){return{'model':db[_0x352956[_0x46b6('0x1e')]],'as':_0x352956['as'],'attributes':_0x352956[_0x46b6('0x1a')],'include':_0x352956['include']?_[_0x46b6('0x1c')](_0x352956[_0x46b6('0x1d')],function(_0x2c60f1){return{'model':db[_0x2c60f1[_0x46b6('0x1e')]],'as':_0x2c60f1['as'],'attributes':_0x2c60f1[_0x46b6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x46b6('0xb')](function(_0x3b609c){logger[_0x46b6('0xc')](_0x46b6('0x15'),_0x42ce40);logger[_0x46b6('0xf')](_0x46b6('0x15'),_0x42ce40,JSON[_0x46b6('0x1f')](_0x3b609c));_0x57474d(_0x3b609c);})[_0x46b6('0x20')](function(_0x138b10){logger[_0x46b6('0x11')](_0x46b6('0x15'),_0x138b10[_0x46b6('0x13')],_0x42ce40);_0x4f569c(_0x5ce805[_0x46b6('0x11')](0x1f4,_0x138b10[_0x46b6('0x13')]));});});};exports[_0x46b6('0x21')]=function(_0x326324){var _0x5380d8=this;return new Promise(function(_0x45b646,_0x8a9e4){return db[_0x46b6('0x16')][_0x46b6('0x22')]({'raw':_0x326324[_0x46b6('0x18')]?_0x326324[_0x46b6('0x18')][_0x46b6('0x23')]===undefined?!![]:![]:!![],'where':_0x326324[_0x46b6('0x18')]?_0x326324['options'][_0x46b6('0x19')]||null:null,'attributes':_0x326324[_0x46b6('0x18')]?_0x326324[_0x46b6('0x18')][_0x46b6('0x1a')]||null:null,'include':_0x326324[_0x46b6('0x18')]?_0x326324[_0x46b6('0x18')]['include']?_[_0x46b6('0x1c')](_0x326324['options'][_0x46b6('0x1d')],function(_0xde679f){return{'model':db[_0xde679f['model']],'as':_0xde679f['as'],'attributes':_0xde679f[_0x46b6('0x1a')],'include':_0xde679f[_0x46b6('0x1d')]?_[_0x46b6('0x1c')](_0xde679f['include'],function(_0x3fdf65){return{'model':db[_0x3fdf65['model']],'as':_0x3fdf65['as'],'attributes':_0x3fdf65[_0x46b6('0x1a')],'include':_0x3fdf65[_0x46b6('0x1d')]?_[_0x46b6('0x1c')](_0x3fdf65['include'],function(_0x95f20d){return{'model':db[_0x95f20d[_0x46b6('0x1e')]],'as':_0x95f20d['as'],'attributes':_0x95f20d[_0x46b6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x46b6('0xb')](function(_0x53d7af){logger[_0x46b6('0xc')](_0x46b6('0x21'),_0x326324);logger[_0x46b6('0xf')](_0x46b6('0x21'),_0x326324,JSON['stringify'](_0x53d7af));_0x45b646(_0x53d7af);})[_0x46b6('0x20')](function(_0x38d76d){logger[_0x46b6('0x11')](_0x46b6('0x21'),_0x38d76d[_0x46b6('0x13')],_0x326324);_0x8a9e4(_0x5380d8[_0x46b6('0x11')](0x1f4,_0x38d76d[_0x46b6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index deea2c9..8065537 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 _0x43df=['../../config/environment','./trunk.controller','index','get','/:id','isAuthenticated','show','post','/:id/clone','clone','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x511383,_0x419494){var _0x5287ab=function(_0x4f9aa0){while(--_0x4f9aa0){_0x511383['push'](_0x511383['shift']());}};_0x5287ab(++_0x419494);}(_0x43df,0x7e));var _0xf43d=function(_0x50f2c4,_0x21f22d){_0x50f2c4=_0x50f2c4-0x0;var _0x4fc5a6=_0x43df[_0x50f2c4];return _0x4fc5a6;};'use strict';var multer=require(_0xf43d('0x0'));var util=require(_0xf43d('0x1'));var path=require(_0xf43d('0x2'));var timeout=require(_0xf43d('0x3'));var express=require('express');var router=express[_0xf43d('0x4')]();var auth=require(_0xf43d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf43d('0x6'));var controller=require(_0xf43d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf43d('0x8')]);router[_0xf43d('0x9')](_0xf43d('0xa'),auth[_0xf43d('0xb')](),controller[_0xf43d('0xc')]);router[_0xf43d('0xd')](_0xf43d('0xe'),auth[_0xf43d('0xb')](),controller[_0xf43d('0xf')]);router[_0xf43d('0xd')]('/',auth[_0xf43d('0xb')](),controller[_0xf43d('0x10')]);router[_0xf43d('0x11')](_0xf43d('0xa'),auth[_0xf43d('0xb')](),controller[_0xf43d('0x12')]);router[_0xf43d('0x13')](_0xf43d('0xa'),auth[_0xf43d('0xb')](),controller[_0xf43d('0x14')]);module[_0xf43d('0x15')]=router; \ No newline at end of file +var _0x2b7f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/clone','clone','post','/:id','update','destroy','exports','multer','path','Router'];(function(_0x155bbf,_0x1bca34){var _0x1cb0ac=function(_0x101c7c){while(--_0x101c7c){_0x155bbf['push'](_0x155bbf['shift']());}};_0x1cb0ac(++_0x1bca34);}(_0x2b7f,0x8d));var _0xf2b7=function(_0x1be240,_0x23e0f0){_0x1be240=_0x1be240-0x0;var _0x37361d=_0x2b7f[_0x1be240];return _0x37361d;};'use strict';var multer=require(_0xf2b7('0x0'));var util=require('util');var path=require(_0xf2b7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf2b7('0x2')]();var auth=require(_0xf2b7('0x3'));var interaction=require(_0xf2b7('0x4'));var config=require(_0xf2b7('0x5'));var controller=require('./trunk.controller');router[_0xf2b7('0x6')]('/',auth[_0xf2b7('0x7')](),controller[_0xf2b7('0x8')]);router[_0xf2b7('0x6')]('/:id',auth[_0xf2b7('0x7')](),controller['show']);router['post'](_0xf2b7('0x9'),auth[_0xf2b7('0x7')](),controller[_0xf2b7('0xa')]);router[_0xf2b7('0xb')]('/',auth[_0xf2b7('0x7')](),controller['create']);router['put'](_0xf2b7('0xc'),auth[_0xf2b7('0x7')](),controller[_0xf2b7('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf2b7('0xe')]);module[_0xf2b7('0xf')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 38a78c9..3cd61c6 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 _0xb10b=['udp','setDataValue','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','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','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','uas','fingerprint','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x3f57cb,_0x1e4d4f){var _0xae77ec=function(_0x136bf4){while(--_0x136bf4){_0x3f57cb['push'](_0x3f57cb['shift']());}};_0xae77ec(++_0x1e4d4f);}(_0xb10b,0x12a));var _0xbb10=function(_0x5bf019,_0x375a83){_0x5bf019=_0x5bf019-0x0;var _0x42497e=_0xb10b[_0x5bf019];return _0x42497e;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbb10('0x3')]('friend',_0xbb10('0x4'),_0xbb10('0x5')),'allowNull':![],'defaultValue':_0xbb10('0x6')},'context':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x7')},'callingpres':{'type':Sequelize[_0xbb10('0x3')]('ALLOWED_NOT_SCREENED',_0xbb10('0x8'),_0xbb10('0x9'),'ALLOWED',_0xbb10('0xa'),_0xbb10('0xb'),_0xbb10('0xc'),_0xbb10('0xd'))},'deny':{'type':Sequelize[_0xbb10('0x1')]},'permit':{'type':Sequelize[_0xbb10('0x1')]},'secret':{'type':Sequelize[_0xbb10('0x1')]},'md5secret':{'type':Sequelize[_0xbb10('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0xe'),'set':function(_0x118a74){this[_0xbb10('0xf')]('transport',_0x118a74?_0x118a74[_0xbb10('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xbb10('0x11'))?this[_0xbb10('0x12')](_0xbb10('0x11'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x14')},'dtmfmode':{'type':Sequelize[_0xbb10('0x3')]('rfc2833',_0xbb10('0x15'),_0xbb10('0x16'),_0xbb10('0x17'),_0xbb10('0x18')),'defaultValue':_0xbb10('0x19')},'directmedia':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbb10('0x1')]},'directmediadeny':{'type':Sequelize[_0xbb10('0x1')]},'nat':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x1e'),'set':function(_0x1682a4){this[_0xbb10('0xf')](_0xbb10('0x1f'),_0x1682a4?_0x1682a4[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')]('nat')?this[_0xbb10('0x12')](_0xbb10('0x1f'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x20')},'callgroup':{'type':Sequelize[_0xbb10('0x1')]},'namedcallgroup':{'type':Sequelize[_0xbb10('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xbb10('0x1')]},'language':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x21')},'allow':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x22'),'set':function(_0x317da4){this[_0xbb10('0xf')](_0xbb10('0x23'),_0x317da4?_0x317da4[_0xbb10('0x10')](';'):_0xbb10('0x22'));},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x23'))?this[_0xbb10('0x12')](_0xbb10('0x23'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'insecure':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x24'),'set':function(_0x4e25ff){this[_0xbb10('0xf')](_0xbb10('0x25'),_0x4e25ff?_0x4e25ff[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x25'))?this[_0xbb10('0x12')](_0xbb10('0x25'))['split'](','):null;},'comment':_0xbb10('0x26')},'trustrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xbb10('0x28')](0xb)},'setvar':{'type':Sequelize[_0xbb10('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xbb10('0x1')]},'callcounter':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':_0xbb10('0x1a')},'busylevel':{'type':Sequelize[_0xbb10('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xbb10('0x1')]},'template':{'type':Sequelize[_0xbb10('0x1')]},'videosupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xbb10('0x1')]},'session_timers':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2a'),_0xbb10('0x2b'),'originate')},'session_expires':{'type':Sequelize[_0xbb10('0x28')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xbb10('0x2c'),_0xbb10('0x2d')),'defaultValue':_0xbb10('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xbb10('0x1')]},'regexten':{'type':Sequelize[_0xbb10('0x1')]},'fromdomain':{'type':Sequelize[_0xbb10('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xbb10('0x28')](0x5)},'qualify':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xbb10('0x1')]},'defaultuser':{'type':Sequelize[_0xbb10('0x1')]},'rtptimeout':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbb10('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbb10('0x1')]},'callbackextension':{'type':Sequelize[_0xbb10('0x1')]},'timert1':{'type':Sequelize[_0xbb10('0x28')](0xb)},'timerb':{'type':Sequelize[_0xbb10('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xbb10('0x1')]},'contactdeny':{'type':Sequelize[_0xbb10('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xbb10('0x1')]},'use_q850_reason':{'type':Sequelize[_0xbb10('0x1')]},'maxforwards':{'type':Sequelize[_0xbb10('0x28')](0xb)},'encryption':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xbb10('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0xbb10('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xbb10('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2f'),'passive',_0xbb10('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbb10('0x1')]},'usereqphone':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbb10('0x1')]},'recordofffeature':{'type':Sequelize[_0xbb10('0x1')]},'call_limit':{'type':Sequelize[_0xbb10('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xbb10('0x1')]},'mohinterpret':{'type':Sequelize[_0xbb10('0x1')]},'mohsuggest':{'type':Sequelize[_0xbb10('0x1')]},'parkinglot':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize[_0xbb10('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x31')},'canreinvite':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbb10('0x1')]},'otherFields':{'type':Sequelize[_0xbb10('0x1')]},'active':{'type':Sequelize[_0xbb10('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xb10b=['udp','setDataValue','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','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','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','uas','fingerprint','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x6751f1,_0x24c3b2){var _0x1fc135=function(_0xc51e36){while(--_0xc51e36){_0x6751f1['push'](_0x6751f1['shift']());}};_0x1fc135(++_0x24c3b2);}(_0xb10b,0x12a));var _0xbb10=function(_0x580f33,_0x4d524d){_0x580f33=_0x580f33-0x0;var _0x4f9e76=_0xb10b[_0x580f33];return _0x4f9e76;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbb10('0x3')]('friend',_0xbb10('0x4'),_0xbb10('0x5')),'allowNull':![],'defaultValue':_0xbb10('0x6')},'context':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x7')},'callingpres':{'type':Sequelize[_0xbb10('0x3')]('ALLOWED_NOT_SCREENED',_0xbb10('0x8'),_0xbb10('0x9'),'ALLOWED',_0xbb10('0xa'),_0xbb10('0xb'),_0xbb10('0xc'),_0xbb10('0xd'))},'deny':{'type':Sequelize[_0xbb10('0x1')]},'permit':{'type':Sequelize[_0xbb10('0x1')]},'secret':{'type':Sequelize[_0xbb10('0x1')]},'md5secret':{'type':Sequelize[_0xbb10('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0xe'),'set':function(_0x118a74){this[_0xbb10('0xf')]('transport',_0x118a74?_0x118a74[_0xbb10('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xbb10('0x11'))?this[_0xbb10('0x12')](_0xbb10('0x11'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x14')},'dtmfmode':{'type':Sequelize[_0xbb10('0x3')]('rfc2833',_0xbb10('0x15'),_0xbb10('0x16'),_0xbb10('0x17'),_0xbb10('0x18')),'defaultValue':_0xbb10('0x19')},'directmedia':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbb10('0x1')]},'directmediadeny':{'type':Sequelize[_0xbb10('0x1')]},'nat':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x1e'),'set':function(_0x1682a4){this[_0xbb10('0xf')](_0xbb10('0x1f'),_0x1682a4?_0x1682a4[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')]('nat')?this[_0xbb10('0x12')](_0xbb10('0x1f'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x20')},'callgroup':{'type':Sequelize[_0xbb10('0x1')]},'namedcallgroup':{'type':Sequelize[_0xbb10('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xbb10('0x1')]},'language':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x21')},'allow':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x22'),'set':function(_0x317da4){this[_0xbb10('0xf')](_0xbb10('0x23'),_0x317da4?_0x317da4[_0xbb10('0x10')](';'):_0xbb10('0x22'));},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x23'))?this[_0xbb10('0x12')](_0xbb10('0x23'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'insecure':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x24'),'set':function(_0x4e25ff){this[_0xbb10('0xf')](_0xbb10('0x25'),_0x4e25ff?_0x4e25ff[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x25'))?this[_0xbb10('0x12')](_0xbb10('0x25'))['split'](','):null;},'comment':_0xbb10('0x26')},'trustrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xbb10('0x28')](0xb)},'setvar':{'type':Sequelize[_0xbb10('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xbb10('0x1')]},'callcounter':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':_0xbb10('0x1a')},'busylevel':{'type':Sequelize[_0xbb10('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xbb10('0x1')]},'template':{'type':Sequelize[_0xbb10('0x1')]},'videosupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xbb10('0x1')]},'session_timers':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2a'),_0xbb10('0x2b'),'originate')},'session_expires':{'type':Sequelize[_0xbb10('0x28')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xbb10('0x2c'),_0xbb10('0x2d')),'defaultValue':_0xbb10('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xbb10('0x1')]},'regexten':{'type':Sequelize[_0xbb10('0x1')]},'fromdomain':{'type':Sequelize[_0xbb10('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xbb10('0x28')](0x5)},'qualify':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xbb10('0x1')]},'defaultuser':{'type':Sequelize[_0xbb10('0x1')]},'rtptimeout':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbb10('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbb10('0x1')]},'callbackextension':{'type':Sequelize[_0xbb10('0x1')]},'timert1':{'type':Sequelize[_0xbb10('0x28')](0xb)},'timerb':{'type':Sequelize[_0xbb10('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xbb10('0x1')]},'contactdeny':{'type':Sequelize[_0xbb10('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xbb10('0x1')]},'use_q850_reason':{'type':Sequelize[_0xbb10('0x1')]},'maxforwards':{'type':Sequelize[_0xbb10('0x28')](0xb)},'encryption':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xbb10('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0xbb10('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xbb10('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2f'),'passive',_0xbb10('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbb10('0x1')]},'usereqphone':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbb10('0x1')]},'recordofffeature':{'type':Sequelize[_0xbb10('0x1')]},'call_limit':{'type':Sequelize[_0xbb10('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xbb10('0x1')]},'mohinterpret':{'type':Sequelize[_0xbb10('0x1')]},'mohsuggest':{'type':Sequelize[_0xbb10('0x1')]},'parkinglot':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize[_0xbb10('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x31')},'canreinvite':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbb10('0x1')]},'otherFields':{'type':Sequelize[_0xbb10('0x1')]},'active':{'type':Sequelize[_0xbb10('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbb10('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 40c79d3..789fef9 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 _0xfb03=['error','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','save','destroy','get','Trunks','stack','name','Trunk','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','map','type','key','field','options','findAll','show','params','include','find','clone','omit','createdAt','updatedAt','body','create','user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','server/files/templates/trunk.ejs','utf8','join','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','update','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','server/files/templates/registry.ejs','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5ba455,_0x325184){var _0x2597e9=function(_0x1d2ba1){while(--_0x1d2ba1){_0x5ba455['push'](_0x5ba455['shift']());}};_0x2597e9(++_0x325184);}(_0xfb03,0xac));var _0x3fb0=function(_0x322545,_0x5a88e3){_0x322545=_0x322545-0x0;var _0x2d35d9=_0xfb03[_0x322545];return _0x2d35d9;};'use strict';var pdf=require(_0x3fb0('0x0'));var emlformat=require(_0x3fb0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3fb0('0x2'));var jsonpatch=require(_0x3fb0('0x3'));var rp=require('request-promise');var moment=require(_0x3fb0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3fb0('0x5'));var util=require(_0x3fb0('0x6'));var path=require('path');var sox=require(_0x3fb0('0x7'));var csv=require(_0x3fb0('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3fb0('0x9'));var squel=require(_0x3fb0('0xa'));var crypto=require('crypto');var jsforce=require(_0x3fb0('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3fb0('0xc'));var Papa=require(_0x3fb0('0xd'));var authService=require('../../components/auth/service');var hardwareService=require(_0x3fb0('0xe'));var Redis=require(_0x3fb0('0xf'));var qs=require(_0x3fb0('0x10'));var logger=require(_0x3fb0('0x11'))(_0x3fb0('0x12'));var utils=require(_0x3fb0('0x13'));var config=require(_0x3fb0('0x14'));var db=require(_0x3fb0('0x15'))['db'];var jayson=require(_0x3fb0('0x16'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2531f7,_0x18c3fd,_0x5c86cd,_0x97ee16){return new BPromise(function(_0x4de99b,_0x3b0a42){var _0x9e3feb=_0x97ee16||client;return _0x9e3feb['request'](_0x2531f7,_0x5c86cd)[_0x3fb0('0x17')](function(_0x242a84){logger[_0x3fb0('0x18')]('Trunk,\x20%s,\x20%s',_0x18c3fd,_0x3fb0('0x19'));logger['debug'](_0x3fb0('0x1a'),_0x18c3fd,_0x3fb0('0x19'),JSON[_0x3fb0('0x1b')](_0x242a84));if(_0x242a84[_0x3fb0('0x1c')]){if(_0x242a84[_0x3fb0('0x1c')]['code']===0x1f4){logger[_0x3fb0('0x1c')]('Trunk,\x20%s,\x20%s',_0x18c3fd,_0x242a84['error'][_0x3fb0('0x1d')]);return _0x3b0a42(_0x242a84['error']['message']);}logger[_0x3fb0('0x1c')](_0x3fb0('0x1e'),_0x18c3fd,_0x242a84['error'][_0x3fb0('0x1d')]);return _0x4de99b(_0x242a84[_0x3fb0('0x1c')][_0x3fb0('0x1d')]);}else{logger['info'](_0x3fb0('0x1e'),_0x18c3fd,_0x3fb0('0x19'));_0x4de99b(_0x242a84[_0x3fb0('0x1f')][_0x3fb0('0x1d')]);}})[_0x3fb0('0x20')](function(_0xfe8d2e){logger[_0x3fb0('0x1c')](_0x3fb0('0x1e'),_0x18c3fd,_0xfe8d2e);_0x3b0a42(_0xfe8d2e);});});}function respondWithStatusCode(_0x24b266,_0x41d068){_0x41d068=_0x41d068||0xcc;return function(_0x3a4a3e){if(_0x3a4a3e){return _0x24b266[_0x3fb0('0x21')](_0x41d068);}return _0x24b266[_0x3fb0('0x22')](_0x41d068)[_0x3fb0('0x23')]();};}function respondWithResult(_0x46fb31,_0x690ae){_0x690ae=_0x690ae||0xc8;return function(_0x457a6e){if(_0x457a6e){return _0x46fb31[_0x3fb0('0x22')](_0x690ae)['json'](_0x457a6e);}};}function respondWithFilteredResult(_0x14967f,_0x21a8b2){return function(_0x18ba5a){if(_0x18ba5a){var _0x93ea63=_0x18ba5a[_0x3fb0('0x24')],_0x455e25=_0x21a8b2[_0x3fb0('0x25')],_0x43f8de=_0x21a8b2[_0x3fb0('0x25')]+_0x21a8b2[_0x3fb0('0x26')],_0x222f90;if(_0x43f8de>=_0x93ea63){_0x43f8de=_0x93ea63;_0x222f90=0xc8;}else{_0x222f90=0xce;}_0x14967f[_0x3fb0('0x22')](_0x222f90);return _0x14967f['set'](_0x3fb0('0x27'),_0x455e25+'-'+_0x43f8de+'/'+_0x93ea63)[_0x3fb0('0x28')](_0x18ba5a);}return null;};}function patchUpdates(_0x18d926){return function(_0x55efab){try{jsonpatch['apply'](_0x55efab,_0x18d926,!![]);}catch(_0x45a083){return BPromise[_0x3fb0('0x29')](_0x45a083);}return _0x55efab[_0x3fb0('0x2a')]();};}function saveUpdates(_0x112fcd,_0x50198d){return function(_0x3eaacb){if(_0x3eaacb){return _0x3eaacb['update'](_0x112fcd)[_0x3fb0('0x17')](function(_0x1db071){return _0x1db071;});}return null;};}function removeEntity(_0x2ecc6f,_0x9168a){return function(_0x431f53){if(_0x431f53){return _0x431f53[_0x3fb0('0x2b')]()[_0x3fb0('0x17')](function(){var _0xba52b3=_0x431f53[_0x3fb0('0x2c')]({'plain':!![]});var _0x1adb1a=_0x3fb0('0x2d');return db['UserProfileResource'][_0x3fb0('0x2b')]({'where':{'type':_0x1adb1a,'resourceId':_0xba52b3['id']}})['then'](function(){return _0x431f53;});})[_0x3fb0('0x17')](function(){_0x2ecc6f[_0x3fb0('0x22')](0xcc)[_0x3fb0('0x23')]();});}};}function handleEntityNotFound(_0x27de90,_0x31e2da){return function(_0x157d8c){if(!_0x157d8c){_0x27de90[_0x3fb0('0x21')](0x194);}return _0x157d8c;};}function handleError(_0x2202f9,_0x410289){_0x410289=_0x410289||0x1f4;return function(_0x9bc04a){logger[_0x3fb0('0x1c')](_0x9bc04a[_0x3fb0('0x2e')]);if(_0x9bc04a[_0x3fb0('0x2f')]){delete _0x9bc04a[_0x3fb0('0x2f')];}_0x2202f9[_0x3fb0('0x22')](_0x410289)['send'](_0x9bc04a);};}exports['index']=function(_0x3998af,_0x63d612){var _0x6a73b3={},_0x3fdc21={},_0x9f233c={'count':0x0,'rows':[]};var _0x739259=db[_0x3fb0('0x30')][_0x3fb0('0x31')];_0x3fdc21[_0x3fb0('0x32')]=_[_0x3fb0('0x33')](_0x739259);_0x3fdc21[_0x3fb0('0x34')]=_[_0x3fb0('0x33')](_0x3998af[_0x3fb0('0x34')]);_0x3fdc21['filters']=_[_0x3fb0('0x35')](_0x3fdc21[_0x3fb0('0x32')],_0x3fdc21['query']);_0x6a73b3['attributes']=_['intersection'](_0x3fdc21[_0x3fb0('0x32')],qs[_0x3fb0('0x36')](_0x3998af['query'][_0x3fb0('0x36')]));_0x6a73b3[_0x3fb0('0x37')]=_0x6a73b3['attributes'][_0x3fb0('0x38')]?_0x6a73b3[_0x3fb0('0x37')]:_0x3fdc21['model'];if(!_0x3998af[_0x3fb0('0x34')][_0x3fb0('0x39')](_0x3fb0('0x3a'))){_0x6a73b3[_0x3fb0('0x26')]=qs['limit'](_0x3998af[_0x3fb0('0x34')]['limit']);_0x6a73b3[_0x3fb0('0x25')]=qs[_0x3fb0('0x25')](_0x3998af[_0x3fb0('0x34')]['offset']);}_0x6a73b3['order']=qs[_0x3fb0('0x3b')](_0x3998af[_0x3fb0('0x34')][_0x3fb0('0x3b')]);_0x6a73b3[_0x3fb0('0x3c')]=qs[_0x3fb0('0x3d')](_['pick'](_0x3998af[_0x3fb0('0x34')],_0x3fdc21[_0x3fb0('0x3d')]));if(_0x3998af[_0x3fb0('0x34')]['filter']){_0x6a73b3[_0x3fb0('0x3c')]=_[_0x3fb0('0x3e')](_0x6a73b3[_0x3fb0('0x3c')],{'$or':_[_0x3fb0('0x3f')](_0x739259,function(_0x22a70a){if(_0x22a70a[_0x3fb0('0x40')][_0x3fb0('0x41')]!=='VIRTUAL'){var _0x423dc1={};_0x423dc1[_0x22a70a[_0x3fb0('0x42')]]={'$like':'%'+_0x3998af[_0x3fb0('0x34')]['filter']+'%'};return _0x423dc1;}})});}_0x6a73b3=_[_0x3fb0('0x3e')]({},_0x6a73b3,_0x3998af[_0x3fb0('0x43')]);var _0x1a4dc8={'where':_0x6a73b3['where']};return db[_0x3fb0('0x30')][_0x3fb0('0x24')](_0x1a4dc8)[_0x3fb0('0x17')](function(_0x90dccf){_0x9f233c[_0x3fb0('0x24')]=_0x90dccf;if(_0x3998af[_0x3fb0('0x34')]['includeAll']){_0x6a73b3['include']=[{'all':!![]}];}return db[_0x3fb0('0x30')][_0x3fb0('0x44')](_0x6a73b3);})['then'](function(_0x3baf09){_0x9f233c['rows']=_0x3baf09;return _0x9f233c;})[_0x3fb0('0x17')](respondWithFilteredResult(_0x63d612,_0x6a73b3))[_0x3fb0('0x20')](handleError(_0x63d612,null));};exports[_0x3fb0('0x45')]=function(_0x31ad11,_0x577c54){var _0x44671a={'raw':![],'where':{'id':_0x31ad11[_0x3fb0('0x46')]['id']}},_0x89c997={};_0x89c997[_0x3fb0('0x32')]=_[_0x3fb0('0x33')](db[_0x3fb0('0x30')]['rawAttributes']);_0x89c997[_0x3fb0('0x34')]=_[_0x3fb0('0x33')](_0x31ad11[_0x3fb0('0x34')]);_0x89c997['filters']=_[_0x3fb0('0x35')](_0x89c997[_0x3fb0('0x32')],_0x89c997[_0x3fb0('0x34')]);_0x44671a[_0x3fb0('0x37')]=_[_0x3fb0('0x35')](_0x89c997['model'],qs['fields'](_0x31ad11['query'][_0x3fb0('0x36')]));_0x44671a[_0x3fb0('0x37')]=_0x44671a[_0x3fb0('0x37')][_0x3fb0('0x38')]?_0x44671a[_0x3fb0('0x37')]:_0x89c997[_0x3fb0('0x32')];if(_0x31ad11['query']['includeAll']){_0x44671a[_0x3fb0('0x47')]=[{'all':!![]}];}_0x44671a=_[_0x3fb0('0x3e')]({},_0x44671a,_0x31ad11['options']);return db[_0x3fb0('0x30')][_0x3fb0('0x48')](_0x44671a)['then'](handleEntityNotFound(_0x577c54,null))[_0x3fb0('0x17')](respondWithResult(_0x577c54,null))[_0x3fb0('0x20')](handleError(_0x577c54,null));};exports[_0x3fb0('0x49')]=function(_0x5c2a38,_0x23c1f1){var _0x1e5f4a={'raw':![],'where':{'id':_0x5c2a38[_0x3fb0('0x46')]['id']}},_0x429e8a={};_0x429e8a['model']=_['keys'](db[_0x3fb0('0x30')][_0x3fb0('0x31')]);_0x1e5f4a[_0x3fb0('0x37')]=_[_0x3fb0('0x35')](_0x429e8a[_0x3fb0('0x32')],qs[_0x3fb0('0x36')](_0x5c2a38[_0x3fb0('0x34')][_0x3fb0('0x36')]));_0x1e5f4a['attributes']=_0x1e5f4a[_0x3fb0('0x37')][_0x3fb0('0x38')]?_0x1e5f4a[_0x3fb0('0x37')]:_0x429e8a[_0x3fb0('0x32')];if(_0x5c2a38[_0x3fb0('0x34')]['includeAll']){_0x1e5f4a[_0x3fb0('0x47')]=[{'all':!![]}];}_0x1e5f4a=_['merge']({},_0x1e5f4a,_0x5c2a38[_0x3fb0('0x43')]);return db[_0x3fb0('0x30')]['find'](_0x1e5f4a)[_0x3fb0('0x17')](handleEntityNotFound(_0x23c1f1,null))[_0x3fb0('0x17')](function(_0xe97f79){if(_0xe97f79){var _0xefc26d=_0xe97f79[_0x3fb0('0x2c')]({'plain':!![]});_0xefc26d=qs[_0x3fb0('0x4a')](_0xefc26d,['id',_0x3fb0('0x4b'),_0x3fb0('0x4c')]);_0x5c2a38[_0x3fb0('0x4d')]=_['omit'](_0x5c2a38[_0x3fb0('0x4d')],['id',_0x3fb0('0x4b'),_0x3fb0('0x4c')]);return db[_0x3fb0('0x30')][_0x3fb0('0x4e')](_['merge'](_0xefc26d,_0x5c2a38['body']),{'include':_0x5c2a38[_0x3fb0('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0x3fb0('0x17')](function(_0x262e6a){var _0x4fe7e2=_0x5c2a38[_0x3fb0('0x4f')]['get']({'plain':!![]});if(!_0x4fe7e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fe7e2[_0x3fb0('0x50')]===_0x3fb0('0x4f')){var _0x197e05=_0x262e6a[_0x3fb0('0x2c')]({'plain':!![]});var _0x4dd24d=_0x3fb0('0x2d');return db['UserProfileSection'][_0x3fb0('0x48')]({'where':{'name':_0x4dd24d,'userProfileId':_0x4fe7e2['userProfileId']},'raw':!![]})[_0x3fb0('0x17')](function(_0x16691f){if(_0x16691f&&_0x16691f[_0x3fb0('0x51')]===0x0){return db[_0x3fb0('0x52')][_0x3fb0('0x4e')]({'name':_0x197e05[_0x3fb0('0x2f')],'resourceId':_0x197e05['id'],'type':_0x16691f[_0x3fb0('0x2f')],'sectionId':_0x16691f['id']},{})['then'](function(){return _0x262e6a;});}else{return _0x262e6a;}})[_0x3fb0('0x20')](function(_0x1fd05a){logger[_0x3fb0('0x1c')](_0x3fb0('0x53'),_0x1fd05a);throw _0x1fd05a;});}return _0x262e6a;});}})['then'](respondWithResult(_0x23c1f1,0xc9))['catch'](handleError(_0x23c1f1,null));};exports[_0x3fb0('0x4e')]=function(_0x37f057,_0x2a51c6,_0x1ceb02){var _0xc490aa;return db[_0x3fb0('0x30')][_0x3fb0('0x4e')](_0x37f057[_0x3fb0('0x4d')],{'raw':!![]})[_0x3fb0('0x17')](function(_0x3f730f){_0xc490aa=_0x3f730f;return db[_0x3fb0('0x30')][_0x3fb0('0x44')]({'raw':!![]});})['then'](function(_0x3a1867){var _0x2cc969=fs[_0x3fb0('0x54')](path['join'](config[_0x3fb0('0x55')],_0x3fb0('0x56')),_0x3fb0('0x57'));var _0x1701da=fs['readFileSync'](path[_0x3fb0('0x58')](config['root'],'server/files/templates/registry.ejs'),_0x3fb0('0x57'));var _0x3bc3ad=ejs[_0x3fb0('0x59')](_0x2cc969,{'trunks':_0x3a1867||[]});fs[_0x3fb0('0x5a')](_0x3fb0('0x5b'),_0x3bc3ad);if(_0xc490aa['registry']){var _0x363d69=ejs[_0x3fb0('0x59')](_0x1701da,{'trunks':_0x3a1867||[]});fs[_0x3fb0('0x5a')]('/etc/asterisk/sip_xcally_registers.conf',_0x363d69);}})[_0x3fb0('0x17')](function(){return respondWithRpcPromise(_0x3fb0('0x5c'),_0x3fb0('0x4e'),{'module':'chan_sip.so'});})['then'](function(){var _0x515f70=_0x37f057[_0x3fb0('0x4f')]['get']({'plain':!![]});if(!_0x515f70)throw new Error(_0x3fb0('0x5d'));if(_0x515f70[_0x3fb0('0x50')]===_0x3fb0('0x4f')){var _0x204e45=_0xc490aa[_0x3fb0('0x2c')]({'plain':!![]});return db[_0x3fb0('0x5e')][_0x3fb0('0x48')]({'where':{'name':_0x3fb0('0x2d'),'userProfileId':_0x515f70[_0x3fb0('0x5f')]},'raw':!![]})['then'](function(_0x520a6d){if(_0x520a6d&&_0x520a6d[_0x3fb0('0x51')]===0x0){return db[_0x3fb0('0x52')][_0x3fb0('0x4e')]({'name':_0x204e45[_0x3fb0('0x2f')],'resourceId':_0x204e45['id'],'type':_0x520a6d['name'],'sectionId':_0x520a6d['id']},{})[_0x3fb0('0x17')](function(){return _0xc490aa;});}else{return _0xc490aa;}})[_0x3fb0('0x20')](function(_0x473d9e){logger[_0x3fb0('0x1c')](_0x3fb0('0x53'),_0x473d9e);throw _0x473d9e;});}return _0xc490aa;})[_0x3fb0('0x17')](respondWithResult(_0x2a51c6,0xc9))[_0x3fb0('0x20')](handleError(_0x2a51c6,null));};exports[_0x3fb0('0x60')]=function(_0x360089,_0x434259,_0x31f03e){var _0x229248;return db[_0x3fb0('0x30')][_0x3fb0('0x48')]({'where':{'id':_0x360089[_0x3fb0('0x46')]['id']}})[_0x3fb0('0x17')](handleEntityNotFound(_0x434259,null))[_0x3fb0('0x17')](saveUpdates(_0x360089['body'],null))[_0x3fb0('0x17')](function(_0x49dd75){if(_0x49dd75){_0x229248=_0x49dd75;return db['Trunk'][_0x3fb0('0x44')]({'raw':!![]});}})[_0x3fb0('0x17')](function(_0x2cfa95){if(_0x2cfa95){var _0x4e50a2=fs['readFileSync'](path['join'](config[_0x3fb0('0x55')],_0x3fb0('0x56')),_0x3fb0('0x57'));var _0x17f068=fs[_0x3fb0('0x54')](path[_0x3fb0('0x58')](config[_0x3fb0('0x55')],'server/files/templates/registry.ejs'),_0x3fb0('0x57'));var _0x330a99=ejs[_0x3fb0('0x59')](_0x4e50a2,{'trunks':_0x2cfa95||[]});fs[_0x3fb0('0x5a')](_0x3fb0('0x5b'),_0x330a99);var _0x5c46bd=ejs['render'](_0x17f068,{'trunks':_0x2cfa95||[]});fs[_0x3fb0('0x5a')](_0x3fb0('0x61'),_0x5c46bd);return respondWithRpcPromise(_0x3fb0('0x5c'),_0x3fb0('0x60'),{'module':_0x3fb0('0x62')});}return null;})['then'](function(_0x1dee07){if(_0x1dee07){return _0x229248;}})['then'](respondWithResult(_0x434259,null))['catch'](handleError(_0x434259,null));};exports[_0x3fb0('0x2b')]=function(_0x11d1fe,_0x53c555,_0x2c182f){var _0x3a6492;return db[_0x3fb0('0x30')][_0x3fb0('0x48')]({'where':{'id':_0x11d1fe[_0x3fb0('0x46')]['id']}})[_0x3fb0('0x17')](handleEntityNotFound(_0x53c555,null))[_0x3fb0('0x17')](removeEntity(_0x53c555,null))[_0x3fb0('0x17')](function(){return db[_0x3fb0('0x30')][_0x3fb0('0x44')]({'raw':!![]});})[_0x3fb0('0x17')](function(_0x4248f6){var _0x1dca7b=fs[_0x3fb0('0x54')](path[_0x3fb0('0x58')](config[_0x3fb0('0x55')],_0x3fb0('0x56')),_0x3fb0('0x57'));var _0xa24764=fs[_0x3fb0('0x54')](path['join'](config[_0x3fb0('0x55')],_0x3fb0('0x63')),'utf8');var _0x1f3f9d=ejs[_0x3fb0('0x59')](_0x1dca7b,{'trunks':_0x4248f6});var _0x37eaed=ejs[_0x3fb0('0x59')](_0xa24764,{'trunks':_0x4248f6});fs[_0x3fb0('0x5a')](_0x3fb0('0x5b'),_0x1f3f9d);fs[_0x3fb0('0x5a')](_0x3fb0('0x61'),_0x37eaed);return respondWithRpcPromise(_0x3fb0('0x5c'),_0x3fb0('0x2b'),{'module':_0x3fb0('0x62')});})['catch'](handleError(_0x53c555,null));}; \ No newline at end of file +var _0xa5ef=['index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','count','includeAll','include','Trunk','rows','show','params','length','find','clone','get','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','autoAssociation','create','server/files/templates/trunk.ejs','readFileSync','join','root','server/files/templates/registry.ejs','utf8','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','/etc/asterisk/sip_xcally_trunks.conf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','request','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','name'];(function(_0x43dd40,_0x431145){var _0x200de4=function(_0x2d485b){while(--_0x2d485b){_0x43dd40['push'](_0x43dd40['shift']());}};_0x200de4(++_0x431145);}(_0xa5ef,0x120));var _0xfa5e=function(_0x4ead23,_0x537fec){_0x4ead23=_0x4ead23-0x0;var _0x36bcae=_0xa5ef[_0x4ead23];return _0x36bcae;};'use strict';var pdf=require(_0xfa5e('0x0'));var emlformat=require(_0xfa5e('0x1'));var rimraf=require(_0xfa5e('0x2'));var zipdir=require(_0xfa5e('0x3'));var jsonpatch=require(_0xfa5e('0x4'));var rp=require('request-promise');var moment=require(_0xfa5e('0x5'));var BPromise=require(_0xfa5e('0x6'));var Mustache=require(_0xfa5e('0x7'));var util=require(_0xfa5e('0x8'));var path=require('path');var sox=require(_0xfa5e('0x9'));var csv=require(_0xfa5e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfa5e('0xb'));var squel=require(_0xfa5e('0xc'));var crypto=require(_0xfa5e('0xd'));var jsforce=require(_0xfa5e('0xe'));var deskjs=require(_0xfa5e('0xf'));var toCsv=require(_0xfa5e('0xa'));var querystring=require(_0xfa5e('0x10'));var Papa=require(_0xfa5e('0x11'));var authService=require(_0xfa5e('0x12'));var hardwareService=require(_0xfa5e('0x13'));var Redis=require(_0xfa5e('0x14'));var qs=require(_0xfa5e('0x15'));var logger=require(_0xfa5e('0x16'))(_0xfa5e('0x17'));var utils=require(_0xfa5e('0x18'));var config=require(_0xfa5e('0x19'));var db=require(_0xfa5e('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xfa5e('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x447478,_0x51b77c,_0x124715,_0x15e6bb){return new BPromise(function(_0x3e4fbe,_0x315cf2){var _0x49e0df=_0x15e6bb||client;return _0x49e0df[_0xfa5e('0x1c')](_0x447478,_0x124715)['then'](function(_0x201c8c){logger[_0xfa5e('0x1d')](_0xfa5e('0x1e'),_0x51b77c,_0xfa5e('0x1f'));logger['debug'](_0xfa5e('0x20'),_0x51b77c,_0xfa5e('0x1f'),JSON[_0xfa5e('0x21')](_0x201c8c));if(_0x201c8c['error']){if(_0x201c8c[_0xfa5e('0x22')][_0xfa5e('0x23')]===0x1f4){logger[_0xfa5e('0x22')](_0xfa5e('0x1e'),_0x51b77c,_0x201c8c[_0xfa5e('0x22')][_0xfa5e('0x24')]);return _0x315cf2(_0x201c8c[_0xfa5e('0x22')][_0xfa5e('0x24')]);}logger[_0xfa5e('0x22')](_0xfa5e('0x1e'),_0x51b77c,_0x201c8c[_0xfa5e('0x22')][_0xfa5e('0x24')]);return _0x3e4fbe(_0x201c8c[_0xfa5e('0x22')][_0xfa5e('0x24')]);}else{logger[_0xfa5e('0x1d')](_0xfa5e('0x1e'),_0x51b77c,_0xfa5e('0x1f'));_0x3e4fbe(_0x201c8c['result']['message']);}})[_0xfa5e('0x25')](function(_0x4dc1c0){logger[_0xfa5e('0x22')](_0xfa5e('0x1e'),_0x51b77c,_0x4dc1c0);_0x315cf2(_0x4dc1c0);});});}function respondWithStatusCode(_0x239f3d,_0x4b2d58){_0x4b2d58=_0x4b2d58||0xcc;return function(_0x3849ae){if(_0x3849ae){return _0x239f3d[_0xfa5e('0x26')](_0x4b2d58);}return _0x239f3d[_0xfa5e('0x27')](_0x4b2d58)[_0xfa5e('0x28')]();};}function respondWithResult(_0x2c731a,_0x3f5f2f){_0x3f5f2f=_0x3f5f2f||0xc8;return function(_0xba016e){if(_0xba016e){return _0x2c731a[_0xfa5e('0x27')](_0x3f5f2f)[_0xfa5e('0x29')](_0xba016e);}};}function respondWithFilteredResult(_0x2dd825,_0x40ebcb){return function(_0x23685c){if(_0x23685c){var _0x40c2be=_0x23685c['count'],_0xfb55d5=_0x40ebcb[_0xfa5e('0x2a')],_0x515329=_0x40ebcb['offset']+_0x40ebcb[_0xfa5e('0x2b')],_0x10827a;if(_0x515329>=_0x40c2be){_0x515329=_0x40c2be;_0x10827a=0xc8;}else{_0x10827a=0xce;}_0x2dd825[_0xfa5e('0x27')](_0x10827a);return _0x2dd825[_0xfa5e('0x2c')](_0xfa5e('0x2d'),_0xfb55d5+'-'+_0x515329+'/'+_0x40c2be)[_0xfa5e('0x29')](_0x23685c);}return null;};}function patchUpdates(_0x5d07ac){return function(_0x2dcd79){try{jsonpatch[_0xfa5e('0x2e')](_0x2dcd79,_0x5d07ac,!![]);}catch(_0x129244){return BPromise[_0xfa5e('0x2f')](_0x129244);}return _0x2dcd79[_0xfa5e('0x30')]();};}function saveUpdates(_0x418817,_0x581bdc){return function(_0x1f63bf){if(_0x1f63bf){return _0x1f63bf[_0xfa5e('0x31')](_0x418817)[_0xfa5e('0x32')](function(_0x2900e1){return _0x2900e1;});}return null;};}function removeEntity(_0x3cdcd9,_0xb1e573){return function(_0xb4c5a0){if(_0xb4c5a0){return _0xb4c5a0[_0xfa5e('0x33')]()[_0xfa5e('0x32')](function(){var _0x36b410=_0xb4c5a0['get']({'plain':!![]});var _0x7eaf79='Trunks';return db[_0xfa5e('0x34')][_0xfa5e('0x33')]({'where':{'type':_0x7eaf79,'resourceId':_0x36b410['id']}})[_0xfa5e('0x32')](function(){return _0xb4c5a0;});})[_0xfa5e('0x32')](function(){_0x3cdcd9[_0xfa5e('0x27')](0xcc)[_0xfa5e('0x28')]();});}};}function handleEntityNotFound(_0x4619e1,_0xdba6b6){return function(_0x2436c5){if(!_0x2436c5){_0x4619e1[_0xfa5e('0x26')](0x194);}return _0x2436c5;};}function handleError(_0x4944a1,_0x4c7178){_0x4c7178=_0x4c7178||0x1f4;return function(_0x31c0da){logger[_0xfa5e('0x22')](_0x31c0da['stack']);if(_0x31c0da[_0xfa5e('0x35')]){delete _0x31c0da[_0xfa5e('0x35')];}_0x4944a1['status'](_0x4c7178)['send'](_0x31c0da);};}exports[_0xfa5e('0x36')]=function(_0x440814,_0x1b28b3){var _0x3cb3e6={},_0x133ca8={},_0x539c8f={'count':0x0,'rows':[]};var _0x59f800=db['Trunk'][_0xfa5e('0x37')];_0x133ca8[_0xfa5e('0x38')]=_[_0xfa5e('0x39')](_0x59f800);_0x133ca8[_0xfa5e('0x3a')]=_[_0xfa5e('0x39')](_0x440814[_0xfa5e('0x3a')]);_0x133ca8[_0xfa5e('0x3b')]=_[_0xfa5e('0x3c')](_0x133ca8[_0xfa5e('0x38')],_0x133ca8[_0xfa5e('0x3a')]);_0x3cb3e6[_0xfa5e('0x3d')]=_['intersection'](_0x133ca8[_0xfa5e('0x38')],qs[_0xfa5e('0x3e')](_0x440814[_0xfa5e('0x3a')]['fields']));_0x3cb3e6[_0xfa5e('0x3d')]=_0x3cb3e6[_0xfa5e('0x3d')]['length']?_0x3cb3e6[_0xfa5e('0x3d')]:_0x133ca8['model'];if(!_0x440814['query'][_0xfa5e('0x3f')](_0xfa5e('0x40'))){_0x3cb3e6[_0xfa5e('0x2b')]=qs[_0xfa5e('0x2b')](_0x440814[_0xfa5e('0x3a')][_0xfa5e('0x2b')]);_0x3cb3e6[_0xfa5e('0x2a')]=qs[_0xfa5e('0x2a')](_0x440814['query'][_0xfa5e('0x2a')]);}_0x3cb3e6[_0xfa5e('0x41')]=qs[_0xfa5e('0x42')](_0x440814[_0xfa5e('0x3a')][_0xfa5e('0x42')]);_0x3cb3e6[_0xfa5e('0x43')]=qs[_0xfa5e('0x3b')](_[_0xfa5e('0x44')](_0x440814[_0xfa5e('0x3a')],_0x133ca8[_0xfa5e('0x3b')]));if(_0x440814[_0xfa5e('0x3a')][_0xfa5e('0x45')]){_0x3cb3e6[_0xfa5e('0x43')]=_[_0xfa5e('0x46')](_0x3cb3e6['where'],{'$or':_[_0xfa5e('0x47')](_0x59f800,function(_0x3e524a){if(_0x3e524a[_0xfa5e('0x48')][_0xfa5e('0x49')]!=='VIRTUAL'){var _0x31d996={};_0x31d996[_0x3e524a[_0xfa5e('0x4a')]]={'$like':'%'+_0x440814[_0xfa5e('0x3a')][_0xfa5e('0x45')]+'%'};return _0x31d996;}})});}_0x3cb3e6=_[_0xfa5e('0x46')]({},_0x3cb3e6,_0x440814[_0xfa5e('0x4b')]);var _0x5433cc={'where':_0x3cb3e6['where']};return db['Trunk'][_0xfa5e('0x4c')](_0x5433cc)[_0xfa5e('0x32')](function(_0x49736b){_0x539c8f[_0xfa5e('0x4c')]=_0x49736b;if(_0x440814['query'][_0xfa5e('0x4d')]){_0x3cb3e6[_0xfa5e('0x4e')]=[{'all':!![]}];}return db[_0xfa5e('0x4f')]['findAll'](_0x3cb3e6);})['then'](function(_0x3f3796){_0x539c8f[_0xfa5e('0x50')]=_0x3f3796;return _0x539c8f;})[_0xfa5e('0x32')](respondWithFilteredResult(_0x1b28b3,_0x3cb3e6))['catch'](handleError(_0x1b28b3,null));};exports[_0xfa5e('0x51')]=function(_0x10f462,_0x577ac4){var _0x1feb9b={'raw':![],'where':{'id':_0x10f462[_0xfa5e('0x52')]['id']}},_0x1e0c74={};_0x1e0c74['model']=_[_0xfa5e('0x39')](db['Trunk'][_0xfa5e('0x37')]);_0x1e0c74[_0xfa5e('0x3a')]=_['keys'](_0x10f462['query']);_0x1e0c74[_0xfa5e('0x3b')]=_[_0xfa5e('0x3c')](_0x1e0c74[_0xfa5e('0x38')],_0x1e0c74[_0xfa5e('0x3a')]);_0x1feb9b[_0xfa5e('0x3d')]=_[_0xfa5e('0x3c')](_0x1e0c74[_0xfa5e('0x38')],qs[_0xfa5e('0x3e')](_0x10f462['query'][_0xfa5e('0x3e')]));_0x1feb9b[_0xfa5e('0x3d')]=_0x1feb9b[_0xfa5e('0x3d')][_0xfa5e('0x53')]?_0x1feb9b['attributes']:_0x1e0c74[_0xfa5e('0x38')];if(_0x10f462[_0xfa5e('0x3a')][_0xfa5e('0x4d')]){_0x1feb9b['include']=[{'all':!![]}];}_0x1feb9b=_[_0xfa5e('0x46')]({},_0x1feb9b,_0x10f462['options']);return db[_0xfa5e('0x4f')][_0xfa5e('0x54')](_0x1feb9b)[_0xfa5e('0x32')](handleEntityNotFound(_0x577ac4,null))[_0xfa5e('0x32')](respondWithResult(_0x577ac4,null))[_0xfa5e('0x25')](handleError(_0x577ac4,null));};exports[_0xfa5e('0x55')]=function(_0x289c8d,_0x4e165e){var _0x3ca3a0={'raw':![],'where':{'id':_0x289c8d[_0xfa5e('0x52')]['id']}},_0x2a642d={};_0x2a642d[_0xfa5e('0x38')]=_[_0xfa5e('0x39')](db[_0xfa5e('0x4f')]['rawAttributes']);_0x3ca3a0[_0xfa5e('0x3d')]=_[_0xfa5e('0x3c')](_0x2a642d[_0xfa5e('0x38')],qs['fields'](_0x289c8d['query'][_0xfa5e('0x3e')]));_0x3ca3a0['attributes']=_0x3ca3a0[_0xfa5e('0x3d')][_0xfa5e('0x53')]?_0x3ca3a0['attributes']:_0x2a642d[_0xfa5e('0x38')];if(_0x289c8d[_0xfa5e('0x3a')][_0xfa5e('0x4d')]){_0x3ca3a0[_0xfa5e('0x4e')]=[{'all':!![]}];}_0x3ca3a0=_['merge']({},_0x3ca3a0,_0x289c8d[_0xfa5e('0x4b')]);return db[_0xfa5e('0x4f')][_0xfa5e('0x54')](_0x3ca3a0)['then'](handleEntityNotFound(_0x4e165e,null))[_0xfa5e('0x32')](function(_0x5a14b1){if(_0x5a14b1){var _0x535714=_0x5a14b1[_0xfa5e('0x56')]({'plain':!![]});_0x535714=qs[_0xfa5e('0x57')](_0x535714,['id',_0xfa5e('0x58'),_0xfa5e('0x59')]);_0x289c8d[_0xfa5e('0x5a')]=_[_0xfa5e('0x57')](_0x289c8d[_0xfa5e('0x5a')],['id',_0xfa5e('0x58'),_0xfa5e('0x59')]);return db[_0xfa5e('0x4f')]['create'](_[_0xfa5e('0x46')](_0x535714,_0x289c8d[_0xfa5e('0x5a')]),{'include':_0x289c8d['query'][_0xfa5e('0x4d')]?[{'all':!![]}]:undefined})[_0xfa5e('0x32')](function(_0x1dd16b){var _0x3592c8=_0x289c8d[_0xfa5e('0x5b')][_0xfa5e('0x56')]({'plain':!![]});if(!_0x3592c8)throw new Error(_0xfa5e('0x5c'));if(_0x3592c8[_0xfa5e('0x5d')]===_0xfa5e('0x5b')){var _0x365463=_0x1dd16b[_0xfa5e('0x56')]({'plain':!![]});var _0x14a1cc=_0xfa5e('0x5e');return db[_0xfa5e('0x5f')][_0xfa5e('0x54')]({'where':{'name':_0x14a1cc,'userProfileId':_0x3592c8['userProfileId']},'raw':!![]})['then'](function(_0x2964cb){if(_0x2964cb&&_0x2964cb[_0xfa5e('0x60')]===0x0){return db[_0xfa5e('0x34')][_0xfa5e('0x61')]({'name':_0x365463[_0xfa5e('0x35')],'resourceId':_0x365463['id'],'type':_0x2964cb['name'],'sectionId':_0x2964cb['id']},{})[_0xfa5e('0x32')](function(){return _0x1dd16b;});}else{return _0x1dd16b;}})[_0xfa5e('0x25')](function(_0xd9759e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd9759e);throw _0xd9759e;});}return _0x1dd16b;});}})[_0xfa5e('0x32')](respondWithResult(_0x4e165e,0xc9))[_0xfa5e('0x25')](handleError(_0x4e165e,null));};exports[_0xfa5e('0x61')]=function(_0x4e154f,_0x605c0b,_0x19981c){var _0x1deed1;return db[_0xfa5e('0x4f')][_0xfa5e('0x61')](_0x4e154f['body'],{'raw':!![]})[_0xfa5e('0x32')](function(_0x391295){_0x1deed1=_0x391295;return db['Trunk']['findAll']({'raw':!![]});})[_0xfa5e('0x32')](function(_0x289948){var _0x3f8b37=fs['readFileSync'](path['join'](config['root'],_0xfa5e('0x62')),'utf8');var _0x395813=fs[_0xfa5e('0x63')](path[_0xfa5e('0x64')](config[_0xfa5e('0x65')],_0xfa5e('0x66')),_0xfa5e('0x67'));var _0x147d98=ejs[_0xfa5e('0x68')](_0x3f8b37,{'trunks':_0x289948||[]});fs[_0xfa5e('0x69')]('/etc/asterisk/sip_xcally_trunks.conf',_0x147d98);if(_0x1deed1[_0xfa5e('0x6a')]){var _0x271908=ejs[_0xfa5e('0x68')](_0x395813,{'trunks':_0x289948||[]});fs[_0xfa5e('0x69')](_0xfa5e('0x6b'),_0x271908);}})[_0xfa5e('0x32')](function(){return respondWithRpcPromise(_0xfa5e('0x6c'),_0xfa5e('0x61'),{'module':_0xfa5e('0x6d')});})[_0xfa5e('0x32')](function(){var _0x35587e=_0x4e154f[_0xfa5e('0x5b')][_0xfa5e('0x56')]({'plain':!![]});if(!_0x35587e)throw new Error(_0xfa5e('0x5c'));if(_0x35587e['role']===_0xfa5e('0x5b')){var _0x362e43=_0x1deed1[_0xfa5e('0x56')]({'plain':!![]});return db[_0xfa5e('0x5f')]['find']({'where':{'name':_0xfa5e('0x5e'),'userProfileId':_0x35587e[_0xfa5e('0x6e')]},'raw':!![]})[_0xfa5e('0x32')](function(_0x5555d8){if(_0x5555d8&&_0x5555d8['autoAssociation']===0x0){return db[_0xfa5e('0x34')][_0xfa5e('0x61')]({'name':_0x362e43[_0xfa5e('0x35')],'resourceId':_0x362e43['id'],'type':_0x5555d8[_0xfa5e('0x35')],'sectionId':_0x5555d8['id']},{})[_0xfa5e('0x32')](function(){return _0x1deed1;});}else{return _0x1deed1;}})[_0xfa5e('0x25')](function(_0x2ca578){logger[_0xfa5e('0x22')](_0xfa5e('0x6f'),_0x2ca578);throw _0x2ca578;});}return _0x1deed1;})[_0xfa5e('0x32')](respondWithResult(_0x605c0b,0xc9))[_0xfa5e('0x25')](handleError(_0x605c0b,null));};exports['update']=function(_0x1f1980,_0x307b6c,_0x3a75fe){var _0x245223;return db['Trunk'][_0xfa5e('0x54')]({'where':{'id':_0x1f1980['params']['id']}})[_0xfa5e('0x32')](handleEntityNotFound(_0x307b6c,null))[_0xfa5e('0x32')](saveUpdates(_0x1f1980[_0xfa5e('0x5a')],null))['then'](function(_0xa9f43c){if(_0xa9f43c){_0x245223=_0xa9f43c;return db[_0xfa5e('0x4f')][_0xfa5e('0x70')]({'raw':!![]});}})[_0xfa5e('0x32')](function(_0xec89e3){if(_0xec89e3){var _0x127f8d=fs[_0xfa5e('0x63')](path['join'](config['root'],_0xfa5e('0x62')),'utf8');var _0xd5ffcf=fs['readFileSync'](path[_0xfa5e('0x64')](config['root'],_0xfa5e('0x66')),_0xfa5e('0x67'));var _0x35fcf8=ejs[_0xfa5e('0x68')](_0x127f8d,{'trunks':_0xec89e3||[]});fs[_0xfa5e('0x69')](_0xfa5e('0x71'),_0x35fcf8);var _0x3c76b6=ejs['render'](_0xd5ffcf,{'trunks':_0xec89e3||[]});fs[_0xfa5e('0x69')](_0xfa5e('0x6b'),_0x3c76b6);return respondWithRpcPromise(_0xfa5e('0x6c'),_0xfa5e('0x31'),{'module':_0xfa5e('0x6d')});}return null;})['then'](function(_0x462cb9){if(_0x462cb9){return _0x245223;}})['then'](respondWithResult(_0x307b6c,null))[_0xfa5e('0x25')](handleError(_0x307b6c,null));};exports[_0xfa5e('0x33')]=function(_0x2e1e3e,_0x31a542,_0x16f3fa){var _0x206ae8;return db[_0xfa5e('0x4f')][_0xfa5e('0x54')]({'where':{'id':_0x2e1e3e['params']['id']}})['then'](handleEntityNotFound(_0x31a542,null))[_0xfa5e('0x32')](removeEntity(_0x31a542,null))[_0xfa5e('0x32')](function(){return db[_0xfa5e('0x4f')]['findAll']({'raw':!![]});})[_0xfa5e('0x32')](function(_0x4eda86){var _0x428e82=fs[_0xfa5e('0x63')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0xfa5e('0x67'));var _0x1013aa=fs[_0xfa5e('0x63')](path[_0xfa5e('0x64')](config[_0xfa5e('0x65')],_0xfa5e('0x66')),_0xfa5e('0x67'));var _0x4076a5=ejs[_0xfa5e('0x68')](_0x428e82,{'trunks':_0x4eda86});var _0x364f59=ejs[_0xfa5e('0x68')](_0x1013aa,{'trunks':_0x4eda86});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x4076a5);fs[_0xfa5e('0x69')](_0xfa5e('0x6b'),_0x364f59);return respondWithRpcPromise(_0xfa5e('0x6c'),_0xfa5e('0x33'),{'module':_0xfa5e('0x6d')});})[_0xfa5e('0x25')](handleError(_0x31a542,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index a569c1a..035a2db 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 _0xadc6=['define','Trunk','tools_trunks','lodash','../../config/logger','moment','bluebird','./trunk.attributes','exports'];(function(_0x22be6d,_0x90876b){var _0x1985e1=function(_0x4a8921){while(--_0x4a8921){_0x22be6d['push'](_0x22be6d['shift']());}};_0x1985e1(++_0x90876b);}(_0xadc6,0x1c5));var _0x6adc=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xadc6[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x6adc('0x0'));var util=require('util');var logger=require(_0x6adc('0x1'))('api');var moment=require(_0x6adc('0x2'));var BPromise=require(_0x6adc('0x3'));var rp=require('request-promise');var attributes=require(_0x6adc('0x4'));module[_0x6adc('0x5')]=function(_0x5e8213,_0x13fee5){return _0x5e8213[_0x6adc('0x6')](_0x6adc('0x7'),attributes,{'tableName':_0x6adc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56d5=['define','Trunk','tools_trunks','lodash','util','../../config/logger','api','bluebird','request-promise','exports'];(function(_0x5f25d2,_0x29f4b1){var _0x3e121d=function(_0x29ef80){while(--_0x29ef80){_0x5f25d2['push'](_0x5f25d2['shift']());}};_0x3e121d(++_0x29f4b1);}(_0x56d5,0x143));var _0x556d=function(_0x3888bb,_0x344e69){_0x3888bb=_0x3888bb-0x0;var _0x50a9bb=_0x56d5[_0x3888bb];return _0x50a9bb;};'use strict';var _=require(_0x556d('0x0'));var util=require(_0x556d('0x1'));var logger=require(_0x556d('0x2'))(_0x556d('0x3'));var moment=require('moment');var BPromise=require(_0x556d('0x4'));var rp=require(_0x556d('0x5'));var attributes=require('./trunk.attributes');module[_0x556d('0x6')]=function(_0x48eb86,_0x4b6de8){return _0x48eb86[_0x556d('0x7')](_0x556d('0x8'),attributes,{'tableName':_0x556d('0x9'),'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 019d347..18eb6ff 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 _0x9f18=['attributes','limit','include','map','model','then','catch','Trunk','find','where','ShowTrunk','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetTrunk','findAll','options'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0x9f18,0xe3));var _0x89f1=function(_0x10dc64,_0x11bb29){_0x10dc64=_0x10dc64-0x0;var _0x9cf98d=_0x9f18[_0x10dc64];return _0x9cf98d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x89f1('0x0'));var BPromise=require(_0x89f1('0x1'));var rs=require(_0x89f1('0x2'));var fs=require('fs');var Redis=require(_0x89f1('0x3'));var db=require(_0x89f1('0x4'))['db'];var utils=require(_0x89f1('0x5'));var logger=require(_0x89f1('0x6'))(_0x89f1('0x7'));var config=require(_0x89f1('0x8'));var jayson=require(_0x89f1('0x9'));var client=jayson['client'][_0x89f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e7cfd,_0x5a773b,_0x3431e8){return new BPromise(function(_0xe94ee2,_0xcb5c81){return client[_0x89f1('0xb')](_0x4e7cfd,_0x3431e8)['then'](function(_0x4ecb0b){logger['info'](_0x89f1('0xc'),_0x5a773b,'request\x20sent');logger[_0x89f1('0xd')](_0x89f1('0xe'),_0x5a773b,_0x89f1('0xf'),JSON[_0x89f1('0x10')](_0x4ecb0b));if(_0x4ecb0b[_0x89f1('0x11')]){if(_0x4ecb0b['error'][_0x89f1('0x12')]===0x1f4){logger['error'](_0x89f1('0xc'),_0x5a773b,_0x4ecb0b[_0x89f1('0x11')]['message']);return _0xcb5c81(_0x4ecb0b[_0x89f1('0x11')][_0x89f1('0x13')]);}logger[_0x89f1('0x11')](_0x89f1('0xc'),_0x5a773b,_0x4ecb0b[_0x89f1('0x11')][_0x89f1('0x13')]);return _0xe94ee2(_0x4ecb0b[_0x89f1('0x11')][_0x89f1('0x13')]);}else{logger[_0x89f1('0x14')](_0x89f1('0xc'),_0x5a773b,_0x89f1('0xf'));_0xe94ee2(_0x4ecb0b[_0x89f1('0x15')][_0x89f1('0x13')]);}})['catch'](function(_0x406546){logger[_0x89f1('0x11')](_0x89f1('0xc'),_0x5a773b,_0x406546);_0xcb5c81(_0x406546);});});}exports[_0x89f1('0x16')]=function(_0x2237b8){var _0x4703ae=this;return new Promise(function(_0x11af36,_0x112e71){return db['Trunk'][_0x89f1('0x17')]({'raw':_0x2237b8[_0x89f1('0x18')]?_0x2237b8['options']['raw']===undefined?!![]:![]:!![],'where':_0x2237b8[_0x89f1('0x18')]?_0x2237b8['options']['where']||null:null,'attributes':_0x2237b8[_0x89f1('0x18')]?_0x2237b8[_0x89f1('0x18')][_0x89f1('0x19')]||null:null,'limit':_0x2237b8['options']?_0x2237b8[_0x89f1('0x18')][_0x89f1('0x1a')]||null:null,'include':_0x2237b8[_0x89f1('0x18')]?_0x2237b8['options'][_0x89f1('0x1b')]?_[_0x89f1('0x1c')](_0x2237b8['options'][_0x89f1('0x1b')],function(_0x3353ea){return{'model':db[_0x3353ea['model']],'as':_0x3353ea['as'],'attributes':_0x3353ea[_0x89f1('0x19')],'include':_0x3353ea[_0x89f1('0x1b')]?_[_0x89f1('0x1c')](_0x3353ea['include'],function(_0x52c221){return{'model':db[_0x52c221[_0x89f1('0x1d')]],'as':_0x52c221['as'],'attributes':_0x52c221[_0x89f1('0x19')],'include':_0x52c221[_0x89f1('0x1b')]?_[_0x89f1('0x1c')](_0x52c221[_0x89f1('0x1b')],function(_0x3d0451){return{'model':db[_0x3d0451[_0x89f1('0x1d')]],'as':_0x3d0451['as'],'attributes':_0x3d0451[_0x89f1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x89f1('0x1e')](function(_0x105226){logger['info'](_0x89f1('0x16'),_0x2237b8);logger[_0x89f1('0xd')](_0x89f1('0x16'),_0x2237b8,JSON['stringify'](_0x105226));_0x11af36(_0x105226);})[_0x89f1('0x1f')](function(_0xbab6d6){logger[_0x89f1('0x11')](_0x89f1('0x16'),_0xbab6d6['message'],_0x2237b8);_0x112e71(_0x4703ae['error'](0x1f4,_0xbab6d6['message']));});});};exports['ShowTrunk']=function(_0xe985ab){var _0x5b33bf=this;return new Promise(function(_0x42771c,_0x4a2a86){return db[_0x89f1('0x20')][_0x89f1('0x21')]({'raw':_0xe985ab[_0x89f1('0x18')]?_0xe985ab[_0x89f1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xe985ab[_0x89f1('0x18')]?_0xe985ab[_0x89f1('0x18')][_0x89f1('0x22')]||null:null,'attributes':_0xe985ab[_0x89f1('0x18')]?_0xe985ab[_0x89f1('0x18')][_0x89f1('0x19')]||null:null,'include':_0xe985ab['options']?_0xe985ab['options'][_0x89f1('0x1b')]?_[_0x89f1('0x1c')](_0xe985ab['options'][_0x89f1('0x1b')],function(_0x1b1a9c){return{'model':db[_0x1b1a9c['model']],'as':_0x1b1a9c['as'],'attributes':_0x1b1a9c[_0x89f1('0x19')],'include':_0x1b1a9c[_0x89f1('0x1b')]?_[_0x89f1('0x1c')](_0x1b1a9c['include'],function(_0x511013){return{'model':db[_0x511013[_0x89f1('0x1d')]],'as':_0x511013['as'],'attributes':_0x511013[_0x89f1('0x19')],'include':_0x511013[_0x89f1('0x1b')]?_['map'](_0x511013[_0x89f1('0x1b')],function(_0x3da269){return{'model':db[_0x3da269[_0x89f1('0x1d')]],'as':_0x3da269['as'],'attributes':_0x3da269['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a8085){logger[_0x89f1('0x14')](_0x89f1('0x23'),_0xe985ab);logger['debug'](_0x89f1('0x23'),_0xe985ab,JSON[_0x89f1('0x10')](_0x4a8085));_0x42771c(_0x4a8085);})[_0x89f1('0x1f')](function(_0x22c567){logger[_0x89f1('0x11')]('ShowTrunk',_0x22c567[_0x89f1('0x13')],_0xe985ab);_0x4a2a86(_0x5b33bf[_0x89f1('0x11')](0x1f4,_0x22c567[_0x89f1('0x13')]));});});}; \ No newline at end of file +var _0xed0c=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTrunk','Trunk','options','raw','attributes','limit','include','map','model','stringify','ShowTrunk','find','where'];(function(_0x3ccbd1,_0xd55375){var _0xcdaf73=function(_0x202b20){while(--_0x202b20){_0x3ccbd1['push'](_0x3ccbd1['shift']());}};_0xcdaf73(++_0xd55375);}(_0xed0c,0x108));var _0xced0=function(_0x5ea68e,_0x2e54be){_0x5ea68e=_0x5ea68e-0x0;var _0x194357=_0xed0c[_0x5ea68e];return _0x194357;};'use strict';var _=require('lodash');var util=require(_0xced0('0x0'));var moment=require('moment');var BPromise=require(_0xced0('0x1'));var rs=require(_0xced0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xced0('0x3'))['db'];var utils=require(_0xced0('0x4'));var logger=require(_0xced0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xced0('0x6'));var client=jayson[_0xced0('0x7')][_0xced0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcea344,_0x193c78,_0x4714fe){return new BPromise(function(_0x5edc2c,_0x5c2d25){return client[_0xced0('0x9')](_0xcea344,_0x4714fe)[_0xced0('0xa')](function(_0x3c8f6c){logger[_0xced0('0xb')](_0xced0('0xc'),_0x193c78,_0xced0('0xd'));logger[_0xced0('0xe')](_0xced0('0xf'),_0x193c78,_0xced0('0xd'),JSON['stringify'](_0x3c8f6c));if(_0x3c8f6c[_0xced0('0x10')]){if(_0x3c8f6c[_0xced0('0x10')][_0xced0('0x11')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x193c78,_0x3c8f6c[_0xced0('0x10')]['message']);return _0x5c2d25(_0x3c8f6c[_0xced0('0x10')]['message']);}logger[_0xced0('0x10')](_0xced0('0xc'),_0x193c78,_0x3c8f6c['error'][_0xced0('0x12')]);return _0x5edc2c(_0x3c8f6c[_0xced0('0x10')]['message']);}else{logger[_0xced0('0xb')]('Trunk,\x20%s,\x20%s',_0x193c78,_0xced0('0xd'));_0x5edc2c(_0x3c8f6c['result'][_0xced0('0x12')]);}})[_0xced0('0x13')](function(_0x2b6f01){logger[_0xced0('0x10')](_0xced0('0xc'),_0x193c78,_0x2b6f01);_0x5c2d25(_0x2b6f01);});});}exports[_0xced0('0x14')]=function(_0x27bc41){var _0xbdb140=this;return new Promise(function(_0x43afd0,_0x14b3ee){return db[_0xced0('0x15')]['findAll']({'raw':_0x27bc41[_0xced0('0x16')]?_0x27bc41['options'][_0xced0('0x17')]===undefined?!![]:![]:!![],'where':_0x27bc41[_0xced0('0x16')]?_0x27bc41[_0xced0('0x16')]['where']||null:null,'attributes':_0x27bc41['options']?_0x27bc41[_0xced0('0x16')][_0xced0('0x18')]||null:null,'limit':_0x27bc41[_0xced0('0x16')]?_0x27bc41['options'][_0xced0('0x19')]||null:null,'include':_0x27bc41['options']?_0x27bc41[_0xced0('0x16')][_0xced0('0x1a')]?_[_0xced0('0x1b')](_0x27bc41['options']['include'],function(_0x470bf2){return{'model':db[_0x470bf2[_0xced0('0x1c')]],'as':_0x470bf2['as'],'attributes':_0x470bf2[_0xced0('0x18')],'include':_0x470bf2[_0xced0('0x1a')]?_['map'](_0x470bf2[_0xced0('0x1a')],function(_0x41af22){return{'model':db[_0x41af22[_0xced0('0x1c')]],'as':_0x41af22['as'],'attributes':_0x41af22[_0xced0('0x18')],'include':_0x41af22[_0xced0('0x1a')]?_['map'](_0x41af22[_0xced0('0x1a')],function(_0x3a1452){return{'model':db[_0x3a1452[_0xced0('0x1c')]],'as':_0x3a1452['as'],'attributes':_0x3a1452[_0xced0('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11d6ca){logger[_0xced0('0xb')]('GetTrunk',_0x27bc41);logger['debug'](_0xced0('0x14'),_0x27bc41,JSON[_0xced0('0x1d')](_0x11d6ca));_0x43afd0(_0x11d6ca);})[_0xced0('0x13')](function(_0x35adaf){logger[_0xced0('0x10')]('GetTrunk',_0x35adaf[_0xced0('0x12')],_0x27bc41);_0x14b3ee(_0xbdb140[_0xced0('0x10')](0x1f4,_0x35adaf['message']));});});};exports[_0xced0('0x1e')]=function(_0x2d67d5){var _0x2634a9=this;return new Promise(function(_0x505c24,_0x11b429){return db[_0xced0('0x15')][_0xced0('0x1f')]({'raw':_0x2d67d5[_0xced0('0x16')]?_0x2d67d5['options'][_0xced0('0x17')]===undefined?!![]:![]:!![],'where':_0x2d67d5[_0xced0('0x16')]?_0x2d67d5[_0xced0('0x16')][_0xced0('0x20')]||null:null,'attributes':_0x2d67d5[_0xced0('0x16')]?_0x2d67d5[_0xced0('0x16')][_0xced0('0x18')]||null:null,'include':_0x2d67d5[_0xced0('0x16')]?_0x2d67d5['options']['include']?_[_0xced0('0x1b')](_0x2d67d5[_0xced0('0x16')][_0xced0('0x1a')],function(_0x4f45b1){return{'model':db[_0x4f45b1[_0xced0('0x1c')]],'as':_0x4f45b1['as'],'attributes':_0x4f45b1[_0xced0('0x18')],'include':_0x4f45b1[_0xced0('0x1a')]?_['map'](_0x4f45b1[_0xced0('0x1a')],function(_0x119c51){return{'model':db[_0x119c51[_0xced0('0x1c')]],'as':_0x119c51['as'],'attributes':_0x119c51['attributes'],'include':_0x119c51[_0xced0('0x1a')]?_[_0xced0('0x1b')](_0x119c51[_0xced0('0x1a')],function(_0x526d66){return{'model':db[_0x526d66[_0xced0('0x1c')]],'as':_0x526d66['as'],'attributes':_0x526d66[_0xced0('0x18')]};}):[]};}):[]};}):[]:[]})[_0xced0('0xa')](function(_0x329f98){logger['info'](_0xced0('0x1e'),_0x2d67d5);logger[_0xced0('0xe')](_0xced0('0x1e'),_0x2d67d5,JSON[_0xced0('0x1d')](_0x329f98));_0x505c24(_0x329f98);})[_0xced0('0x13')](function(_0x22fa13){logger[_0xced0('0x10')]('ShowTrunk',_0x22fa13[_0xced0('0x12')],_0x2d67d5);_0x11b429(_0x2634a9[_0xced0('0x10')](0x1f4,_0x22fa13[_0xced0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index bf41b97..6e85217 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 _0x877a=['multer','util','path','connect-timeout','express','../../components/interaction/service','./user.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/avatar','getContacts','/:id/queues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','/:id/teams','getLists','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/chat_websites','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','/:id/contacts','addContacts','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/square_projects','addSquareProjects','createApiKey','put','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports'];(function(_0x41bd08,_0x5bdb1a){var _0x1744cf=function(_0x2d9ffb){while(--_0x2d9ffb){_0x41bd08['push'](_0x41bd08['shift']());}};_0x1744cf(++_0x5bdb1a);}(_0x877a,0xc6));var _0xa877=function(_0x8da8f9,_0x5b5abf){_0x8da8f9=_0x8da8f9-0x0;var _0x293ccc=_0x877a[_0x8da8f9];return _0x293ccc;};'use strict';var multer=require(_0xa877('0x0'));var util=require(_0xa877('0x1'));var path=require(_0xa877('0x2'));var timeout=require(_0xa877('0x3'));var express=require(_0xa877('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa877('0x5'));var config=require('../../config/environment');var controller=require(_0xa877('0x6'));router[_0xa877('0x7')]('/',auth['isAuthenticated'](),controller[_0xa877('0x8')]);router[_0xa877('0x7')](_0xa877('0x9'),auth[_0xa877('0xa')](),controller[_0xa877('0xb')]);router[_0xa877('0x7')](_0xa877('0xc'),auth[_0xa877('0xa')](),controller['show']);router[_0xa877('0x7')](_0xa877('0xd'),controller['getAvatar']);router['get']('/:id/contacts',auth[_0xa877('0xa')](),controller[_0xa877('0xe')]);router[_0xa877('0x7')](_0xa877('0xf'),auth[_0xa877('0xa')](),controller['getQueues']);router['get']('/:id/queues_rt',auth[_0xa877('0xa')](),controller[_0xa877('0x10')]);router[_0xa877('0x7')](_0xa877('0x11'),auth[_0xa877('0xa')](),controller[_0xa877('0x12')]);router[_0xa877('0x7')](_0xa877('0x13'),auth['isAuthenticated'](),controller[_0xa877('0x14')]);router[_0xa877('0x7')]('/:id/chat/interactions',auth[_0xa877('0xa')](),controller[_0xa877('0x15')]);router[_0xa877('0x7')](_0xa877('0x16'),auth[_0xa877('0xa')](),controller['getOpenchannelInteractions']);router[_0xa877('0x7')](_0xa877('0x17'),auth['isAuthenticated'](),controller[_0xa877('0x18')]);router[_0xa877('0x7')](_0xa877('0x19'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0xa877('0x7')](_0xa877('0x1a'),auth[_0xa877('0xa')](),controller['getFaxInteractions']);router[_0xa877('0x7')](_0xa877('0x1b'),auth[_0xa877('0xa')](),controller['getTeams']);router[_0xa877('0x7')]('/:id/lists',auth[_0xa877('0xa')](),controller[_0xa877('0x1c')]);router[_0xa877('0x7')]('/:id/agents',auth['isAuthenticated'](),controller['getAgents']);router[_0xa877('0x7')](_0xa877('0x1d'),auth[_0xa877('0xa')](),controller['getVoicePrefixes']);router[_0xa877('0x7')](_0xa877('0x1e'),auth[_0xa877('0xa')](),controller[_0xa877('0x1f')]);router['get'](_0xa877('0x20'),auth[_0xa877('0xa')](),controller[_0xa877('0x21')]);router[_0xa877('0x7')](_0xa877('0x22'),auth[_0xa877('0xa')](),controller['getOpenchannelAccounts']);router[_0xa877('0x7')]('/:id/sms_accounts',auth[_0xa877('0xa')](),controller['getSmsAccounts']);router[_0xa877('0x7')](_0xa877('0x23'),auth[_0xa877('0xa')](),controller['getChatWebsites']);router[_0xa877('0x7')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xa877('0x24')]);router['get'](_0xa877('0x25'),auth[_0xa877('0xa')](),controller[_0xa877('0x26')]);router[_0xa877('0x7')](_0xa877('0x27'),auth['isAuthenticated'](),controller[_0xa877('0x28')]);router[_0xa877('0x29')](_0xa877('0x2a'),auth[_0xa877('0xa')](),controller[_0xa877('0x2b')]);router[_0xa877('0x29')](_0xa877('0x2c'),auth['isAuthenticated'](),controller[_0xa877('0x2d')]);router[_0xa877('0x29')]('/',auth[_0xa877('0xa')](),controller['create']);router[_0xa877('0x29')](_0xa877('0xf'),auth[_0xa877('0xa')](),controller[_0xa877('0x2e')]);var upload=multer({'storage':multer[_0xa877('0x2f')]({'destination':function(_0x197094,_0x184cbf,_0x517ea0){_0x517ea0(null,path[_0xa877('0x30')](config[_0xa877('0x31')],_0xa877('0x32')));},'filename':function(_0x515c3e,_0x38a7ef,_0x4b86ba){_0x4b86ba(null,util[_0xa877('0x33')](_0xa877('0x34'),Date[_0xa877('0x35')](),_0x38a7ef[_0xa877('0x36')]));}})});router['post'](_0xa877('0xd'),upload[_0xa877('0x37')](_0xa877('0x38')),controller[_0xa877('0x39')]);router[_0xa877('0x29')](_0xa877('0x3a'),auth['isAuthenticated'](),controller[_0xa877('0x3b')]);router[_0xa877('0x29')](_0xa877('0x3c'),auth[_0xa877('0xa')](),controller['logout']);router[_0xa877('0x29')](_0xa877('0x3d'),auth['isAuthenticated'](),controller[_0xa877('0x3e')]);router[_0xa877('0x29')](_0xa877('0x3f'),auth[_0xa877('0xa')](),controller[_0xa877('0x40')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0xa877('0x29')]('/:id/chat_interactions',auth[_0xa877('0xa')](),controller[_0xa877('0x41')]);router['post'](_0xa877('0x42'),auth[_0xa877('0xa')](),controller['addMailInteractions']);router['post'](_0xa877('0x43'),auth[_0xa877('0xa')](),controller[_0xa877('0x44')]);router[_0xa877('0x29')](_0xa877('0x45'),auth[_0xa877('0xa')](),controller[_0xa877('0x46')]);router[_0xa877('0x29')](_0xa877('0x47'),auth[_0xa877('0xa')](),controller['addOpenchannelInteractions']);router[_0xa877('0x29')]('/:id/fax_accounts',auth[_0xa877('0xa')](),controller[_0xa877('0x48')]);router[_0xa877('0x29')]('/:id/mail_accounts',auth[_0xa877('0xa')](),controller[_0xa877('0x49')]);router[_0xa877('0x29')](_0xa877('0x22'),auth[_0xa877('0xa')](),controller[_0xa877('0x4a')]);router[_0xa877('0x29')](_0xa877('0x4b'),auth[_0xa877('0xa')](),controller[_0xa877('0x4c')]);router[_0xa877('0x29')](_0xa877('0x23'),auth[_0xa877('0xa')](),controller['addChatWebsites']);router[_0xa877('0x29')](_0xa877('0x4d'),auth[_0xa877('0xa')](),controller[_0xa877('0x4e')]);router[_0xa877('0x29')](_0xa877('0x27'),auth[_0xa877('0xa')](),controller[_0xa877('0x4f')]);router[_0xa877('0x50')](_0xa877('0xc'),auth[_0xa877('0xa')](),controller['update']);router[_0xa877('0x50')]('/:id/password',auth['isAuthenticated'](),controller[_0xa877('0x51')]);router[_0xa877('0x52')](_0xa877('0xf'),auth['isAuthenticated'](),controller[_0xa877('0x53')]);router[_0xa877('0x52')](_0xa877('0x1b'),auth[_0xa877('0xa')](),controller[_0xa877('0x54')]);router[_0xa877('0x52')](_0xa877('0xc'),auth[_0xa877('0xa')](),controller[_0xa877('0x55')]);router[_0xa877('0x52')](_0xa877('0x56'),auth[_0xa877('0xa')](),controller[_0xa877('0x57')]);router[_0xa877('0x52')]('/:id/mail_interactions',auth[_0xa877('0xa')](),controller[_0xa877('0x58')]);router[_0xa877('0x52')](_0xa877('0x43'),auth['isAuthenticated'](),controller[_0xa877('0x59')]);router[_0xa877('0x52')]('/:id/sms_interactions',auth[_0xa877('0xa')](),controller[_0xa877('0x5a')]);router['delete'](_0xa877('0x47'),auth['isAuthenticated'](),controller[_0xa877('0x5b')]);router['delete'](_0xa877('0x1e'),auth[_0xa877('0xa')](),controller[_0xa877('0x5c')]);router[_0xa877('0x52')](_0xa877('0x20'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0xa877('0x52')](_0xa877('0x22'),auth['isAuthenticated'](),controller[_0xa877('0x5d')]);router[_0xa877('0x52')](_0xa877('0x4b'),auth[_0xa877('0xa')](),controller[_0xa877('0x5e')]);router[_0xa877('0x52')](_0xa877('0x23'),auth['isAuthenticated'](),controller[_0xa877('0x5f')]);router[_0xa877('0x52')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xa877('0x60')]);router[_0xa877('0x52')](_0xa877('0x27'),auth['isAuthenticated'](),controller[_0xa877('0x61')]);module[_0xa877('0x62')]=router; \ No newline at end of file +var _0x40be=['getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','addContacts','create','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','/:id/unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/fax_accounts','/:id/mail_accounts','addMailAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/square_projects','addSquareProjects','createApiKey','put','/:id','update','/:id/password','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id/avatar','getAvatar','/:id/contacts','getQueues','/:id/queues_rt'];(function(_0x33711e,_0x57999f){var _0x5816e3=function(_0x209f5e){while(--_0x209f5e){_0x33711e['push'](_0x33711e['shift']());}};_0x5816e3(++_0x57999f);}(_0x40be,0x127));var _0xe40b=function(_0xffa3cf,_0x3d17fd){_0xffa3cf=_0xffa3cf-0x0;var _0x2e4a2f=_0x40be[_0xffa3cf];return _0x2e4a2f;};'use strict';var multer=require(_0xe40b('0x0'));var util=require(_0xe40b('0x1'));var path=require('path');var timeout=require(_0xe40b('0x2'));var express=require(_0xe40b('0x3'));var router=express[_0xe40b('0x4')]();var auth=require(_0xe40b('0x5'));var interaction=require(_0xe40b('0x6'));var config=require('../../config/environment');var controller=require('./user.controller');router['get']('/',auth[_0xe40b('0x7')](),controller[_0xe40b('0x8')]);router['get'](_0xe40b('0x9'),auth['isAuthenticated'](),controller[_0xe40b('0xa')]);router[_0xe40b('0xb')]('/:id',auth[_0xe40b('0x7')](),controller['show']);router[_0xe40b('0xb')](_0xe40b('0xc'),controller[_0xe40b('0xd')]);router[_0xe40b('0xb')](_0xe40b('0xe'),auth[_0xe40b('0x7')](),controller['getContacts']);router[_0xe40b('0xb')]('/:id/queues',auth['isAuthenticated'](),controller[_0xe40b('0xf')]);router['get'](_0xe40b('0x10'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x11')]);router[_0xe40b('0xb')]('/:id/groups',auth[_0xe40b('0x7')](),controller[_0xe40b('0x12')]);router[_0xe40b('0xb')](_0xe40b('0x13'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x14')]);router[_0xe40b('0xb')](_0xe40b('0x15'),auth['isAuthenticated'](),controller['getChatInteractions']);router['get']('/:id/openchannel/interactions',auth[_0xe40b('0x7')](),controller['getOpenchannelInteractions']);router[_0xe40b('0xb')](_0xe40b('0x16'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x17')]);router['get'](_0xe40b('0x18'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x19')]);router[_0xe40b('0xb')](_0xe40b('0x1a'),auth[_0xe40b('0x7')](),controller['getFaxInteractions']);router[_0xe40b('0xb')]('/:id/teams',auth[_0xe40b('0x7')](),controller[_0xe40b('0x1b')]);router[_0xe40b('0xb')](_0xe40b('0x1c'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x1d')]);router[_0xe40b('0xb')]('/:id/agents',auth[_0xe40b('0x7')](),controller[_0xe40b('0x1e')]);router[_0xe40b('0xb')](_0xe40b('0x1f'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x20')]);router[_0xe40b('0xb')]('/:id/fax_accounts',auth[_0xe40b('0x7')](),controller[_0xe40b('0x21')]);router[_0xe40b('0xb')]('/:id/mail_accounts',auth[_0xe40b('0x7')](),controller[_0xe40b('0x22')]);router[_0xe40b('0xb')](_0xe40b('0x23'),auth[_0xe40b('0x7')](),controller['getOpenchannelAccounts']);router[_0xe40b('0xb')](_0xe40b('0x24'),auth['isAuthenticated'](),controller[_0xe40b('0x25')]);router[_0xe40b('0xb')]('/:id/chat_websites',auth[_0xe40b('0x7')](),controller[_0xe40b('0x26')]);router['get']('/:id/square_projects',auth[_0xe40b('0x7')](),controller[_0xe40b('0x27')]);router[_0xe40b('0xb')]('/:id/scheduled_calls',auth[_0xe40b('0x7')](),controller[_0xe40b('0x28')]);router[_0xe40b('0xb')](_0xe40b('0x29'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x2a')]);router[_0xe40b('0x2b')](_0xe40b('0x2c'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x2d')]);router[_0xe40b('0x2b')]('/:id/contacts',auth[_0xe40b('0x7')](),controller[_0xe40b('0x2e')]);router[_0xe40b('0x2b')]('/',auth['isAuthenticated'](),controller[_0xe40b('0x2f')]);router['post'](_0xe40b('0x30'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x31')]);var upload=multer({'storage':multer[_0xe40b('0x32')]({'destination':function(_0x1d3091,_0x31e02f,_0xffc0e4){_0xffc0e4(null,path[_0xe40b('0x33')](config[_0xe40b('0x34')],_0xe40b('0x35')));},'filename':function(_0x33de82,_0x465c38,_0x401ef8){_0x401ef8(null,util['format'](_0xe40b('0x36'),Date[_0xe40b('0x37')](),_0x465c38[_0xe40b('0x38')]));}})});router[_0xe40b('0x2b')]('/:id/avatar',upload[_0xe40b('0x39')](_0xe40b('0x3a')),controller[_0xe40b('0x3b')]);router['post'](_0xe40b('0x3c'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x3d')]);router[_0xe40b('0x2b')](_0xe40b('0x3e'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x3f')]);router[_0xe40b('0x2b')](_0xe40b('0x40'),auth[_0xe40b('0x7')](),controller['pause']);router[_0xe40b('0x2b')](_0xe40b('0x41'),auth['isAuthenticated'](),controller['unpause']);router[_0xe40b('0x2b')](_0xe40b('0x42'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x43')]);router[_0xe40b('0x2b')](_0xe40b('0x44'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x45')]);router[_0xe40b('0x2b')](_0xe40b('0x46'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x47')]);router[_0xe40b('0x2b')](_0xe40b('0x48'),auth[_0xe40b('0x7')](),controller['addFaxInteractions']);router['post'](_0xe40b('0x49'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x4a')]);router[_0xe40b('0x2b')](_0xe40b('0x4b'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x4c')]);router[_0xe40b('0x2b')](_0xe40b('0x4d'),auth['isAuthenticated'](),controller['addFaxAccounts']);router['post'](_0xe40b('0x4e'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x4f')]);router[_0xe40b('0x2b')](_0xe40b('0x23'),auth[_0xe40b('0x7')](),controller['addOpenchannelAccounts']);router['post'](_0xe40b('0x24'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x50')]);router[_0xe40b('0x2b')](_0xe40b('0x51'),auth['isAuthenticated'](),controller[_0xe40b('0x52')]);router['post'](_0xe40b('0x53'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x54')]);router[_0xe40b('0x2b')](_0xe40b('0x29'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x55')]);router[_0xe40b('0x56')](_0xe40b('0x57'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x58')]);router[_0xe40b('0x56')](_0xe40b('0x59'),auth['isAuthenticated'](),controller[_0xe40b('0x5a')]);router[_0xe40b('0x5b')]('/:id/queues',auth['isAuthenticated'](),controller[_0xe40b('0x5c')]);router['delete'](_0xe40b('0x42'),auth['isAuthenticated'](),controller[_0xe40b('0x5d')]);router[_0xe40b('0x5b')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xe40b('0x5b')](_0xe40b('0x44'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x5e')]);router[_0xe40b('0x5b')]('/:id/mail_interactions',auth[_0xe40b('0x7')](),controller[_0xe40b('0x5f')]);router[_0xe40b('0x5b')](_0xe40b('0x48'),auth[_0xe40b('0x7')](),controller['removeFaxInteractions']);router[_0xe40b('0x5b')](_0xe40b('0x49'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x60')]);router[_0xe40b('0x5b')](_0xe40b('0x4b'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router['delete']('/:id/fax_accounts',auth[_0xe40b('0x7')](),controller[_0xe40b('0x61')]);router['delete'](_0xe40b('0x4e'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x62')]);router[_0xe40b('0x5b')](_0xe40b('0x23'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x63')]);router[_0xe40b('0x5b')](_0xe40b('0x24'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x64')]);router[_0xe40b('0x5b')](_0xe40b('0x51'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x65')]);router[_0xe40b('0x5b')](_0xe40b('0x53'),auth[_0xe40b('0x7')](),controller['removeSquareProjects']);router[_0xe40b('0x5b')](_0xe40b('0x29'),auth[_0xe40b('0x7')](),controller[_0xe40b('0x66')]);module[_0xe40b('0x67')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 217d1ca..7a4549e 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 _0x4683=['internal','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','dynamic','friend','user','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','outgoing','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','insecure','never','always','accept','refuse','uac','uas','fingerprint','certificate','passive','actpass','nonat','get','encryption','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','icesupport','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','sequelize','util','exports','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','agent','telephone','local'];(function(_0x2544f1,_0xb653af){var _0x3cab4f=function(_0x5e535c){while(--_0x5e535c){_0x2544f1['push'](_0x2544f1['shift']());}};_0x3cab4f(++_0xb653af);}(_0x4683,0x12c));var _0x3468=function(_0x190aed,_0x64da8c){_0x190aed=_0x190aed-0x0;var _0x36d1fe=_0x4683[_0x190aed];return _0x36d1fe;};'use strict';var Sequelize=require(_0x3468('0x0'));var moment=require('moment');var util=require(_0x3468('0x1'));var _=require('lodash');module[_0x3468('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x192f38){this[_0x3468('0x3')](_0x3468('0x4'),_0x192f38);this[_0x3468('0x3')](_0x3468('0x5'),_0x192f38);},'comment':_0x3468('0x6')},'fullname':{'type':Sequelize[_0x3468('0x7')],'allowNull':![],'set':function(_0x5f1042){this[_0x3468('0x3')](_0x3468('0x8'),_0x5f1042);this[_0x3468('0x3')](_0x3468('0x9'),util[_0x3468('0xa')](_0x3468('0xb'),_0x5f1042,this[_0x3468('0xc')]('internal')));}},'alias':{'type':Sequelize[_0x3468('0x7')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3468('0xd'),'validate':{'isEmail':!![]},'set':function(_0x52a65d){if(_0x52a65d){this[_0x3468('0x3')](_0x3468('0xd'),_0x52a65d[_0x3468('0xe')]());}}},'role':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x10'),'user',_0x3468('0x11'),_0x3468('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x3468('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x3468('0x7')],'defaultValue':_0x3468('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x3468('0x14'),'set':function(_0x3c7e33){this['setDataValue'](_0x3468('0x14'),_0x3c7e33);this['setDataValue'](_0x3468('0x15'),_0x3c7e33);this['setDataValue'](_0x3468('0x9'),util[_0x3468('0xa')](_0x3468('0xb'),this[_0x3468('0xc')](_0x3468('0x8')),_0x3c7e33));}},'salt':{'type':Sequelize[_0x3468('0x7')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x3468('0x7')]},'address':{'type':Sequelize[_0x3468('0x7')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x3468('0x7')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x3468('0x7')]},'online':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x3468('0x7')],'defaultValue':_0x3468('0x17')},'lastPauseAt':{'type':Sequelize[_0x3468('0x18')]},'chatCapacity':{'type':Sequelize[_0x3468('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x3468('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x3468('0x19')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x3468('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x3468('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x3468('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x3468('0x19')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x3468('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3468('0x1a')},'ipaddr':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'port':{'type':Sequelize[_0x3468('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x3468('0x1b'),_0x3468('0x1c'),'peer'),'allowNull':!![],'defaultValue':_0x3468('0x1b')},'context':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![],'defaultValue':_0x3468('0x1d')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x3468('0x1e'),_0x3468('0x1f'),_0x3468('0x20'),_0x3468('0x21'),_0x3468('0x22'),'PROHIB_FAILED_SCREEN',_0x3468('0x23')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'transport':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![],'defaultValue':_0x3468('0x24'),'set':function(_0x536a22){this[_0x3468('0x3')](_0x3468('0x25'),_0x536a22?_0x536a22['join'](','):null);},'get':function(){return this['getDataValue'](_0x3468('0x25'))?this['getDataValue']('transport')[_0x3468('0x26')](','):null;},'comment':_0x3468('0x27')},'dtmfmode':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x28'),_0x3468('0x29'),_0x3468('0x2a'),_0x3468('0x2b'),'auto'),'allowNull':!![],'defaultValue':_0x3468('0x28')},'directmedia':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no','nonat','update',_0x3468('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'nat':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![],'defaultValue':_0x3468('0x2e'),'set':function(_0x18dd57){this['setDataValue']('nat',_0x18dd57?_0x18dd57[_0x3468('0x2f')](','):null);},'get':function(){return this[_0x3468('0xc')](_0x3468('0x30'))?this['getDataValue']('nat')[_0x3468('0x26')](','):null;},'comment':_0x3468('0x31')},'callgroup':{'type':Sequelize[_0x3468('0x7')]},'namedcallgroup':{'type':Sequelize[_0x3468('0x7')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x3468('0x7')]},'language':{'type':Sequelize[_0x3468('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3468('0x7')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3468('0x32')},'allow':{'type':Sequelize[_0x3468('0x7')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x33c282){this[_0x3468('0x3')](_0x3468('0x33'),_0x33c282?_0x33c282[_0x3468('0x2f')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x3468('0x33'))?this[_0x3468('0xc')](_0x3468('0x33'))[_0x3468('0x26')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x3468('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![],'set':function(_0x2d65da){this[_0x3468('0x3')](_0x3468('0x34'),_0x2d65da?_0x2d65da[_0x3468('0x2f')](','):null);},'get':function(){return this['getDataValue'](_0x3468('0x34'))?this[_0x3468('0xc')](_0x3468('0x34'))[_0x3468('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no',_0x3468('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x3468('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x3468('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'template':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no',_0x3468('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x37'),_0x3468('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x3468('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x3468('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0x3468('0x2c')},'keepalive':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x3468('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x3468('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x3468('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x3468('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x3468('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x3468('0xf')]('yes','no',_0x3468('0x3b'),_0x3468('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x3468('0xf')]('active',_0x3468('0x3d'),_0x3468('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x3468('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no',_0x3468('0x3f'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x3468('0x7')]},'resetPasswordExpires':{'type':Sequelize[_0x3468('0x18')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x243584){this['setDataValue']('showWebBar',_0x243584);var _0x248ea7=this[_0x3468('0x40')]({'plain':!![]});switch(_0x243584){case 0x0:case 0x1:var _0x3e2be6=_0x248ea7[_0x3468('0x25')]?_['isArray'](_0x248ea7[_0x3468('0x25')])?_0x248ea7[_0x3468('0x25')][_0x3468('0x2f')]():_0x248ea7[_0x3468('0x25')]:_0x3468('0x24');if(_0x3e2be6==='wss'){_0x3e2be6=_0x3468('0x24');}this[_0x3468('0x3')](_0x3468('0x25'),_0x3e2be6);this[_0x3468('0x3')](_0x3468('0x41'),'no');this[_0x3468('0x3')]('avpf',null);this[_0x3468('0x3')](_0x3468('0x42'),null);this[_0x3468('0x3')]('icesupport',null);this[_0x3468('0x3')](_0x3468('0x43'),null);this[_0x3468('0x3')](_0x3468('0x44'),null);this[_0x3468('0x3')](_0x3468('0x45'),null);this[_0x3468('0x3')](_0x3468('0x46'),null);this[_0x3468('0x3')](_0x3468('0x47'),null);this[_0x3468('0x3')](_0x3468('0x48'),'no');break;case 0x2:this[_0x3468('0x3')](_0x3468('0x25'),_0x3468('0x49'));this[_0x3468('0x3')](_0x3468('0x41'),_0x3468('0x2c'));this[_0x3468('0x3')]('avpf','yes');this[_0x3468('0x3')](_0x3468('0x42'),_0x3468('0x2c'));this[_0x3468('0x3')](_0x3468('0x4a'),_0x3468('0x2c'));this['setDataValue'](_0x3468('0x43'),_0x3468('0x2c'));this[_0x3468('0x3')](_0x3468('0x44'),'no');this['setDataValue'](_0x3468('0x45'),'actpass');this['setDataValue'](_0x3468('0x46'),_0x248ea7[_0x3468('0x46')]||_0x3468('0x4b'));this[_0x3468('0x3')](_0x3468('0x47'),_0x248ea7['dtlsprivatekey']||_0x3468('0x4c'));this['setDataValue'](_0x3468('0x48'),_0x3468('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0x3468('0x4d')],'set':function(_0x13047d){this[_0x3468('0x3')]('permissions',_0x13047d?_0x13047d[_0x3468('0x2f')](','):[]);},'get':function(){return this[_0x3468('0xc')](_0x3468('0x4e'))?_[_0x3468('0x4f')](this['getDataValue'](_0x3468('0x4e'))[_0x3468('0x26')](','),function(_0x46a0ac){return parseInt(_0x46a0ac,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x3468('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x3468('0x7')]},'phoneBarBusyNumber':{'type':Sequelize[_0x3468('0x7')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x3468('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x3468('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x3468('0x7')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x3468('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x3468('0xf')](_0x3468('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x3468('0x7')]},'passwordResetAt':{'type':Sequelize[_0x3468('0x18')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x3468('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x3468('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x3468('0x7')],'allowNull':!![]}}; \ No newline at end of file +var _0x71f7=['showWebBar','get','isArray','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','wss','dtlscertfile','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','map','sequelize','moment','lodash','exports','STRING','name','defaultuser','The\x20name\x20of\x20the\x20user','setDataValue','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','user','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','peer','friend','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','join','ulaw;alaw;gsm','insecure','never','\x22\x22\x20<>','accept','refuse','originate','uac','fingerprint','certificate','passive','actpass','update,nonat'];(function(_0x5eb62e,_0x270e30){var _0x2de598=function(_0x5259aa){while(--_0x5259aa){_0x5eb62e['push'](_0x5eb62e['shift']());}};_0x2de598(++_0x270e30);}(_0x71f7,0x1a7));var _0x771f=function(_0xc9d432,_0x5c4186){_0xc9d432=_0xc9d432-0x0;var _0x1c142a=_0x71f7[_0xc9d432];return _0x1c142a;};'use strict';var Sequelize=require(_0x771f('0x0'));var moment=require(_0x771f('0x1'));var util=require('util');var _=require(_0x771f('0x2'));module[_0x771f('0x3')]={'name':{'type':Sequelize[_0x771f('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4ad3c1){this['setDataValue'](_0x771f('0x5'),_0x4ad3c1);this['setDataValue'](_0x771f('0x6'),_0x4ad3c1);},'comment':_0x771f('0x7')},'fullname':{'type':Sequelize[_0x771f('0x4')],'allowNull':![],'set':function(_0x453c40){this[_0x771f('0x8')](_0x771f('0x9'),_0x453c40);this[_0x771f('0x8')](_0x771f('0xa'),util[_0x771f('0xb')](_0x771f('0xc'),_0x453c40,this[_0x771f('0xd')](_0x771f('0xe'))));}},'alias':{'type':Sequelize[_0x771f('0x4')]},'email':{'type':Sequelize[_0x771f('0x4')],'allowNull':![],'unique':_0x771f('0xf'),'validate':{'isEmail':!![]},'set':function(_0x3a49ae){if(_0x3a49ae){this[_0x771f('0x8')]('email',_0x3a49ae['toLowerCase']());}}},'role':{'type':Sequelize[_0x771f('0x10')]('admin',_0x771f('0x11'),_0x771f('0x12'),_0x771f('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x771f('0x4')],'defaultValue':_0x771f('0x14')},'internal':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':![],'unique':_0x771f('0xe'),'set':function(_0xa16baa){this[_0x771f('0x8')](_0x771f('0xe'),_0xa16baa);this[_0x771f('0x8')](_0x771f('0x16'),_0xa16baa);this[_0x771f('0x8')]('callerid',util[_0x771f('0xb')](_0x771f('0xc'),this[_0x771f('0xd')](_0x771f('0x9')),_0xa16baa));}},'salt':{'type':Sequelize[_0x771f('0x4')]},'phone':{'type':Sequelize[_0x771f('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x771f('0x4')]},'zipcode':{'type':Sequelize[_0x771f('0x4')]},'userpic':{'type':Sequelize[_0x771f('0x4')]},'city':{'type':Sequelize[_0x771f('0x4')]},'country':{'type':Sequelize[_0x771f('0x4')]},'online':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x771f('0x18')]},'voicePause':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x771f('0x4')],'defaultValue':_0x771f('0x19')},'lastPauseAt':{'type':Sequelize[_0x771f('0x18')]},'chatCapacity':{'type':Sequelize[_0x771f('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x771f('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x771f('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x771f('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x771f('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x771f('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x771f('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x771f('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x771f('0x1a')},'ipaddr':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x771f('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x771f('0x10')]('friend',_0x771f('0x11'),_0x771f('0x1b')),'allowNull':!![],'defaultValue':_0x771f('0x1c')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x1d'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x771f('0x1e'),'PROHIB_NOT_SCREENED',_0x771f('0x1f'),'PROHIB_FAILED_SCREEN',_0x771f('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3cf9e1){this[_0x771f('0x8')]('transport',_0x3cf9e1?_0x3cf9e1['join'](','):null);},'get':function(){return this[_0x771f('0xd')]('transport')?this[_0x771f('0xd')](_0x771f('0x21'))[_0x771f('0x22')](','):null;},'comment':_0x771f('0x23')},'dtmfmode':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x24'),_0x771f('0x25'),_0x771f('0x26'),_0x771f('0x27'),_0x771f('0x28')),'allowNull':!![],'defaultValue':_0x771f('0x24')},'directmedia':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no',_0x771f('0x2a'),_0x771f('0x2b'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![],'defaultValue':_0x771f('0x2c'),'set':function(_0x53455f){this[_0x771f('0x8')]('nat',_0x53455f?_0x53455f['join'](','):null);},'get':function(){return this['getDataValue'](_0x771f('0x2d'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0x771f('0x2e')},'callgroup':{'type':Sequelize[_0x771f('0x4')]},'namedcallgroup':{'type':Sequelize[_0x771f('0x4')]},'pickupgroup':{'type':Sequelize[_0x771f('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x771f('0x4')]},'language':{'type':Sequelize[_0x771f('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x771f('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x771f('0x2f')},'allow':{'type':Sequelize[_0x771f('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xfc22bb){this[_0x771f('0x8')](_0x771f('0x30'),_0xfc22bb?_0xfc22bb[_0x771f('0x31')](';'):_0x771f('0x32'));},'get':function(){return this['getDataValue'](_0x771f('0x30'))?this['getDataValue'](_0x771f('0x30'))[_0x771f('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![],'set':function(_0x2cf8d9){this[_0x771f('0x8')](_0x771f('0x33'),_0x2cf8d9?_0x2cf8d9['join'](','):null);},'get':function(){return this[_0x771f('0xd')](_0x771f('0x33'))?this['getDataValue'](_0x771f('0x33'))[_0x771f('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x771f('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no',_0x771f('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x771f('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![],'defaultValue':_0x771f('0x35')},'amaflags':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![],'defaultValue':_0x771f('0x29')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x771f('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x771f('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x771f('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x771f('0x36'),_0x771f('0x37'),_0x771f('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x39'),'uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x771f('0x10')]('yes','no'),'allowNull':!![],'defaultValue':_0x771f('0x29')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x771f('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x771f('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x771f('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no',_0x771f('0x3a'),_0x771f('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x771f('0x10')]('active',_0x771f('0x3c'),_0x771f('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x771f('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x771f('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no',_0x771f('0x2a'),_0x771f('0x2b'),_0x771f('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x771f('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4967ef){this[_0x771f('0x8')](_0x771f('0x3f'),_0x4967ef);var _0x340095=this[_0x771f('0x40')]({'plain':!![]});switch(_0x4967ef){case 0x0:case 0x1:var _0x27fb01=_0x340095['transport']?_[_0x771f('0x41')](_0x340095[_0x771f('0x21')])?_0x340095[_0x771f('0x21')]['join']():_0x340095[_0x771f('0x21')]:_0x771f('0x42');if(_0x27fb01==='wss'){_0x27fb01=_0x771f('0x42');}this[_0x771f('0x8')]('transport',_0x27fb01);this[_0x771f('0x8')](_0x771f('0x43'),'no');this[_0x771f('0x8')](_0x771f('0x44'),null);this[_0x771f('0x8')](_0x771f('0x45'),null);this[_0x771f('0x8')](_0x771f('0x46'),null);this[_0x771f('0x8')](_0x771f('0x47'),null);this[_0x771f('0x8')](_0x771f('0x48'),null);this[_0x771f('0x8')](_0x771f('0x49'),null);this['setDataValue']('dtlscertfile',null);this[_0x771f('0x8')](_0x771f('0x4a'),null);this[_0x771f('0x8')]('rtcp_mux','no');break;case 0x2:this['setDataValue']('transport',_0x771f('0x4b'));this['setDataValue'](_0x771f('0x43'),'yes');this[_0x771f('0x8')](_0x771f('0x44'),_0x771f('0x29'));this[_0x771f('0x8')]('force_avp',_0x771f('0x29'));this[_0x771f('0x8')](_0x771f('0x46'),_0x771f('0x29'));this['setDataValue'](_0x771f('0x47'),_0x771f('0x29'));this[_0x771f('0x8')](_0x771f('0x48'),'no');this[_0x771f('0x8')](_0x771f('0x49'),_0x771f('0x3d'));this[_0x771f('0x8')](_0x771f('0x4c'),_0x340095[_0x771f('0x4c')]||_0x771f('0x4d'));this[_0x771f('0x8')](_0x771f('0x4a'),_0x340095['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0x771f('0x8')](_0x771f('0x4e'),_0x771f('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x51d89b){this[_0x771f('0x8')](_0x771f('0x4f'),_0x51d89b?_0x51d89b[_0x771f('0x31')](','):[]);},'get':function(){return this[_0x771f('0xd')](_0x771f('0x4f'))?_[_0x771f('0x50')](this[_0x771f('0xd')](_0x771f('0x4f'))[_0x771f('0x22')](','),function(_0x80197e){return parseInt(_0x80197e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x771f('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x771f('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x771f('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x771f('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x771f('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x771f('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x771f('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x771f('0x10')](_0x771f('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x771f('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x771f('0x4')]},'passwordResetAt':{'type':Sequelize[_0x771f('0x18')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x771f('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x771f('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x771f('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 8638b33..9ad32ad 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 _0xf046=['code','message','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','get','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','includes','role','find','destroy','stack','name','send','index','User','rawAttributes','model','differenceBy','keys','salt','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','sequelize','lower','col','field','options','includeAll','include','findAll','show','params','password','body','update','describe','addContacts','ids','omit','agent\x20role','admin','../../config/license/util','getLicense','users','format','count\x20%s:\x20%s','create','internal','findById','max','isNil','SELECT','from','voicemail','mailbox','VoiceMail','email','102','103','110','104','107','108','100','111','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','loginInPause','voicePause','interface','isValidChannel','channel','Unknown\x20channel','penalty','spread','capitalize','toLowerCase','emit','Queue:save','VoiceQueue','voice','push','SIP/%s','UserVoiceQueueRt','removeQueues','remove','QueueId','addAvatar','userpic','file','filename','getAvatar','root','download','existsSync','join','server/files/images/','getContacts','CmContact','order','List','Tag','Tags','tag','getQueues','findOne','Queue','Queues','Unknown\x20role','getVoiceQueuesRt','pick','getGroups','getRecordings','VoiceRecording','UserId','rows','getChatInteractions','ChatInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','bulkCreate','concat','LOGININPAUSE','logout','pause','QueuePause','updateAttributes','PAUSE','DEFAULT\x20PAUSE','type','mailPause','chatPause','faxPause','openchannelPause','smsPause','lastPauseAt','unpause','chat','fax','sms','openchannel','%s%s','Pause','manual','getTeams','Team','removeTeams','getLists','CmList','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','CmHopper','firstName','lastName','Contact','dialActive','getApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','generateApiKey','apiKeyNonce','removeApiKey','API\x20key\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./user.socket','register','jayson/promise','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x14d635,_0x1c104d){var _0x4e6ee3=function(_0x5695ba){while(--_0x5695ba){_0x14d635['push'](_0x14d635['shift']());}};_0x4e6ee3(++_0x1c104d);}(_0xf046,0x11f));var _0x6f04=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0xf046[_0x23e6bb];return _0x1e3b4c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6f04('0x0'));var rimraf=require(_0x6f04('0x1'));var zipdir=require(_0x6f04('0x2'));var jsonpatch=require(_0x6f04('0x3'));var rp=require(_0x6f04('0x4'));var moment=require(_0x6f04('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6f04('0x6'));var util=require('util');var path=require(_0x6f04('0x7'));var sox=require(_0x6f04('0x8'));var csv=require(_0x6f04('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6f04('0xa'));var squel=require(_0x6f04('0xb'));var crypto=require(_0x6f04('0xc'));var jsforce=require(_0x6f04('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6f04('0x9'));var querystring=require('querystring');var Papa=require(_0x6f04('0xe'));var authService=require(_0x6f04('0xf'));var hardwareService=require(_0x6f04('0x10'));var Redis=require(_0x6f04('0x11'));var qs=require(_0x6f04('0x12'));var logger=require(_0x6f04('0x13'))(_0x6f04('0x14'));var utils=require(_0x6f04('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x6f04('0x16')]=_['defaults'](config['redis'],{'host':_0x6f04('0x17'),'port':0x18eb});var socket=require(_0x6f04('0x18'))(new Redis(config['redis']));require(_0x6f04('0x19'))[_0x6f04('0x1a')](socket);var jayson=require(_0x6f04('0x1b'));var client=jayson[_0x6f04('0x1c')][_0x6f04('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4ce808,_0xec7423,_0x16308e,_0xfcf528){return new BPromise(function(_0x5854ce,_0x3ff270){var _0x2a4220=_0xfcf528||client;return _0x2a4220[_0x6f04('0x1e')](_0x4ce808,_0x16308e)[_0x6f04('0x1f')](function(_0x45cdd1){logger[_0x6f04('0x20')](_0x6f04('0x21'),_0xec7423,_0x6f04('0x22'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0xec7423,_0x6f04('0x22'),JSON[_0x6f04('0x23')](_0x45cdd1));if(_0x45cdd1[_0x6f04('0x24')]){if(_0x45cdd1[_0x6f04('0x24')][_0x6f04('0x25')]===0x1f4){logger[_0x6f04('0x24')](_0x6f04('0x21'),_0xec7423,_0x45cdd1[_0x6f04('0x24')][_0x6f04('0x26')]);return _0x3ff270(_0x45cdd1['error'][_0x6f04('0x26')]);}logger[_0x6f04('0x24')](_0x6f04('0x21'),_0xec7423,_0x45cdd1[_0x6f04('0x24')]['message']);return _0x5854ce(_0x45cdd1[_0x6f04('0x24')]['message']);}else{logger[_0x6f04('0x20')](_0x6f04('0x21'),_0xec7423,_0x6f04('0x22'));_0x5854ce(_0x45cdd1['result'][_0x6f04('0x26')]);}})[_0x6f04('0x27')](function(_0xc221dd){logger[_0x6f04('0x24')](_0x6f04('0x21'),_0xec7423,_0xc221dd);_0x3ff270(_0xc221dd);});});}function respondWithStatusCode(_0x3cdd4f,_0x3ce618){_0x3ce618=_0x3ce618||0xcc;return function(_0x4067ec){if(_0x4067ec){return _0x3cdd4f[_0x6f04('0x28')](_0x3ce618);}return _0x3cdd4f[_0x6f04('0x29')](_0x3ce618)[_0x6f04('0x2a')]();};}function respondWithResult(_0x3cb6fd,_0x14aada){_0x14aada=_0x14aada||0xc8;return function(_0x1cb83a){if(_0x1cb83a){return _0x3cb6fd[_0x6f04('0x29')](_0x14aada)[_0x6f04('0x2b')](_0x1cb83a);}};}function respondWithFilteredResult(_0x3232ce,_0x4a9dd2){return function(_0x255d59){if(_0x255d59){var _0x278bd0=_0x255d59[_0x6f04('0x2c')],_0x231150=_0x4a9dd2[_0x6f04('0x2d')],_0x2d2c97=_0x4a9dd2[_0x6f04('0x2d')]+_0x4a9dd2['limit'],_0x513f20;if(_0x2d2c97>=_0x278bd0){_0x2d2c97=_0x278bd0;_0x513f20=0xc8;}else{_0x513f20=0xce;}_0x3232ce[_0x6f04('0x29')](_0x513f20);return _0x3232ce[_0x6f04('0x2e')](_0x6f04('0x2f'),_0x231150+'-'+_0x2d2c97+'/'+_0x278bd0)[_0x6f04('0x2b')](_0x255d59);}return null;};}function patchUpdates(_0x568927){return function(_0x1a5518){try{jsonpatch[_0x6f04('0x30')](_0x1a5518,_0x568927,!![]);}catch(_0x2c0627){return BPromise[_0x6f04('0x31')](_0x2c0627);}return _0x1a5518['save']();};}function saveUpdates(_0x54d0f2,_0x3c6829){return function(_0x1c63ce){if(_0x1c63ce){return _0x1c63ce['update'](_0x54d0f2)[_0x6f04('0x1f')](function(_0x475591){return _0x475591;});}return null;};}function removeEntity(_0x3c0eed,_0x415cdf){return function(_0x57ffc0){if(_0x57ffc0){return _0x57ffc0['destroy']()[_0x6f04('0x1f')](function(){var _0x4e703d=_0x57ffc0[_0x6f04('0x32')]({'plain':!![]});var _0x5c340a=[{'name':'Users','value':_0x6f04('0x33'),'ignore':!![]},{'name':_0x6f04('0x34'),'value':_0x6f04('0x35'),'ignore':![]},{'name':_0x6f04('0x36'),'value':_0x6f04('0x37'),'ignore':![]}];var _0x1351e9=_(_0x5c340a)[_0x6f04('0x38')](_0x6f04('0x39'))[_0x6f04('0x3a')](_0x6f04('0x3b'))[_0x6f04('0x3b')]();if(_[_0x6f04('0x3c')](_0x1351e9,_0x4e703d[_0x6f04('0x3d')])){return;}var _0x36f85b=_[_0x6f04('0x3e')](_0x5c340a,[_0x6f04('0x3b'),_0x4e703d[_0x6f04('0x3d')]])['name'];return db['UserProfileResource'][_0x6f04('0x3f')]({'where':{'type':_0x36f85b,'resourceId':_0x4e703d['id']}})[_0x6f04('0x1f')](function(){return _0x57ffc0;});})[_0x6f04('0x1f')](function(){_0x3c0eed[_0x6f04('0x29')](0xcc)[_0x6f04('0x2a')]();});}};}function handleEntityNotFound(_0x423432,_0x5701f5){return function(_0x362dd7){if(!_0x362dd7){_0x423432[_0x6f04('0x28')](0x194);}return _0x362dd7;};}function handleError(_0x30aba5,_0x255faa){_0x255faa=_0x255faa||0x1f4;return function(_0xe5320c){logger[_0x6f04('0x24')](_0xe5320c[_0x6f04('0x40')]);if(_0xe5320c[_0x6f04('0x41')]){delete _0xe5320c[_0x6f04('0x41')];}_0x30aba5['status'](_0x255faa)[_0x6f04('0x42')](_0xe5320c);};}exports[_0x6f04('0x43')]=function(_0x3046b1,_0x28414a){var _0x1482c4={},_0xef91bf={},_0x51320b={'count':0x0,'rows':[]};var _0x1d0f36=db[_0x6f04('0x44')][_0x6f04('0x45')];_0xef91bf[_0x6f04('0x46')]=_[_0x6f04('0x47')](_[_0x6f04('0x48')](_0x1d0f36),['password',_0x6f04('0x49')]);_0xef91bf[_0x6f04('0x4a')]=_['keys'](_0x3046b1[_0x6f04('0x4a')]);_0xef91bf[_0x6f04('0x4b')]=_[_0x6f04('0x4c')](_0xef91bf[_0x6f04('0x46')],_0xef91bf[_0x6f04('0x4a')]);_0x1482c4[_0x6f04('0x4d')]=_[_0x6f04('0x4c')](_0xef91bf[_0x6f04('0x46')],qs[_0x6f04('0x4e')](_0x3046b1[_0x6f04('0x4a')][_0x6f04('0x4e')]));_0x1482c4['attributes']=_0x1482c4[_0x6f04('0x4d')][_0x6f04('0x4f')]?_0x1482c4[_0x6f04('0x4d')]:_0xef91bf[_0x6f04('0x46')];if(!_0x3046b1[_0x6f04('0x4a')][_0x6f04('0x50')](_0x6f04('0x51'))){_0x1482c4['limit']=qs[_0x6f04('0x52')](_0x3046b1['query'][_0x6f04('0x52')]);_0x1482c4['offset']=qs[_0x6f04('0x2d')](_0x3046b1[_0x6f04('0x4a')][_0x6f04('0x2d')]);}_0x1482c4['order']=qs['sort'](_0x3046b1[_0x6f04('0x4a')][_0x6f04('0x53')]);_0x1482c4['where']=qs[_0x6f04('0x4b')](_['pick'](_0x3046b1[_0x6f04('0x4a')],_0xef91bf['filters']));if(_0x3046b1[_0x6f04('0x4a')]['filter']){_0x1482c4[_0x6f04('0x54')]=_[_0x6f04('0x55')](_0x1482c4[_0x6f04('0x54')],{'$or':_['map'](_0x1d0f36,function(_0x5804bd){return db['sequelize']['where'](db[_0x6f04('0x56')]['fn'](_0x6f04('0x57'),db[_0x6f04('0x56')][_0x6f04('0x58')](_0x5804bd[_0x6f04('0x59')])),{'$like':db[_0x6f04('0x56')]['fn']('lower','%'+_0x3046b1[_0x6f04('0x4a')][_0x6f04('0x38')]+'%')});})});}_0x1482c4=_['merge']({},_0x1482c4,_0x3046b1[_0x6f04('0x5a')]);var _0x49e75a={'where':_0x1482c4[_0x6f04('0x54')]};return db[_0x6f04('0x44')]['count'](_0x49e75a)[_0x6f04('0x1f')](function(_0x1a51d2){_0x51320b[_0x6f04('0x2c')]=_0x1a51d2;if(_0x3046b1[_0x6f04('0x4a')][_0x6f04('0x5b')]){_0x1482c4[_0x6f04('0x5c')]=[{'all':!![]}];}return db[_0x6f04('0x44')][_0x6f04('0x5d')](_0x1482c4);})[_0x6f04('0x1f')](function(_0x28bbdd){_0x51320b['rows']=_0x28bbdd;return _0x51320b;})['then'](respondWithFilteredResult(_0x28414a,_0x1482c4))[_0x6f04('0x27')](handleError(_0x28414a,null));};exports[_0x6f04('0x5e')]=function(_0x32cde2,_0xffde55){var _0x114327={'raw':![],'where':{'id':_0x32cde2[_0x6f04('0x5f')]['id']}},_0x43cef5={};_0x43cef5[_0x6f04('0x46')]=_[_0x6f04('0x47')](_[_0x6f04('0x48')](db[_0x6f04('0x44')][_0x6f04('0x45')]),[_0x6f04('0x60'),_0x6f04('0x49')]);_0x43cef5['query']=_[_0x6f04('0x48')](_0x32cde2['query']);_0x43cef5['filters']=_[_0x6f04('0x4c')](_0x43cef5[_0x6f04('0x46')],_0x43cef5[_0x6f04('0x4a')]);_0x114327[_0x6f04('0x4d')]=_[_0x6f04('0x4c')](_0x43cef5[_0x6f04('0x46')],qs[_0x6f04('0x4e')](_0x32cde2[_0x6f04('0x4a')]['fields']));_0x114327['attributes']=_0x114327[_0x6f04('0x4d')]['length']?_0x114327['attributes']:_0x43cef5[_0x6f04('0x46')];if(_0x32cde2[_0x6f04('0x4a')]['includeAll']){_0x114327['include']=[{'all':!![]}];}_0x114327=_[_0x6f04('0x55')]({},_0x114327,_0x32cde2[_0x6f04('0x5a')]);return db['User'][_0x6f04('0x3e')](_0x114327)[_0x6f04('0x1f')](handleEntityNotFound(_0xffde55,null))[_0x6f04('0x1f')](respondWithResult(_0xffde55,null))[_0x6f04('0x27')](handleError(_0xffde55,null));};exports['bulkCreate']=function(_0x3f1449,_0x5d3415){return db[_0x6f04('0x44')]['bulkCreate'](_0x3f1449[_0x6f04('0x61')],{'raw':![],'individualHooks':!![]})[_0x6f04('0x1f')](respondWithResult(_0x5d3415,0xc9))[_0x6f04('0x27')](handleError(_0x5d3415,null));};exports[_0x6f04('0x62')]=function(_0x2fe59c,_0x7c80d){if(_0x2fe59c[_0x6f04('0x61')]['id']){delete _0x2fe59c[_0x6f04('0x61')]['id'];}return db[_0x6f04('0x44')][_0x6f04('0x3e')]({'where':{'id':_0x2fe59c['params']['id']}})[_0x6f04('0x1f')](handleEntityNotFound(_0x7c80d,null))['then'](saveUpdates(_0x2fe59c[_0x6f04('0x61')],null))[_0x6f04('0x1f')](respondWithResult(_0x7c80d,null))[_0x6f04('0x27')](handleError(_0x7c80d,null));};exports['describe']=function(_0x17c93d,_0x25cbc7){return db[_0x6f04('0x44')][_0x6f04('0x63')]()[_0x6f04('0x1f')](respondWithResult(_0x25cbc7,null))[_0x6f04('0x27')](handleError(_0x25cbc7,null));};exports[_0x6f04('0x64')]=function(_0x1497b9,_0x5a03fb,_0x8f8745){return db[_0x6f04('0x44')]['find']({'where':{'id':_0x1497b9[_0x6f04('0x5f')]['id']}})[_0x6f04('0x1f')](handleEntityNotFound(_0x5a03fb,null))['then'](function(_0x451b2f){if(_0x451b2f){return _0x451b2f[_0x6f04('0x64')](_0x1497b9[_0x6f04('0x61')][_0x6f04('0x65')],_[_0x6f04('0x66')](_0x1497b9['body'],[_0x6f04('0x65'),'id'])||{});}})[_0x6f04('0x1f')](respondWithResult(_0x5a03fb,null))['catch'](handleError(_0x5a03fb,null));};var getLicense=function(_0x36c2d4){return new BPromise(function(_0x497790,_0x246924){var _0x1ad59a=0x0;_0x36c2d4[_0x6f04('0x61')][_0x6f04('0x3d')]==='agent'&&_0x497790(_0x6f04('0x67'));return db[_0x6f04('0x44')][_0x6f04('0x2c')]({'where':{'$or':[{'role':_0x36c2d4['body'][_0x6f04('0x3d')]==='telephone'?'telephone':[_0x6f04('0x68'),_0x6f04('0x33')]}]}})[_0x6f04('0x1f')](function(_0x5d5bbb){_0x1ad59a=_0x5d5bbb;return require(_0x6f04('0x69'))[_0x6f04('0x6a')]();})[_0x6f04('0x1f')](function(_0x32e879){var _0x5a67eb=_0x36c2d4[_0x6f04('0x61')][_0x6f04('0x3d')]===_0x6f04('0x37')?'telephones':_0x6f04('0x6b');if(!_['isNil'](_0x32e879[_0x5a67eb])&&_0x1ad59a>=_0x32e879[_0x5a67eb]){return _0x246924({'message':'License\x20limit\x20reached'});}return _0x497790(util[_0x6f04('0x6c')](_0x6f04('0x6d'),_0x5a67eb,_0x1ad59a));})[_0x6f04('0x27')](function(_0x4851a1){return _0x246924(_0x4851a1);});});};exports[_0x6f04('0x6e')]=function(_0x890f30,_0x3db271){return getLicense(_0x890f30)[_0x6f04('0x1f')](function(_0x2649e7){if(!_0x890f30['body'][_0x6f04('0x6f')]){var _0x5a66ae;return db['Setting'][_0x6f04('0x70')](0x1)['then'](function(_0x538c53){_0x5a66ae=_0x538c53['min_internal'];return db[_0x6f04('0x44')][_0x6f04('0x71')](_0x6f04('0x6f'));})[_0x6f04('0x1f')](function(_0x312156){if(_[_0x6f04('0x72')](_0x312156)){if(_0x5a66ae){_0x890f30['body'][_0x6f04('0x6f')]=_0x5a66ae;}else{_0x890f30[_0x6f04('0x61')][_0x6f04('0x6f')]=0x1;}}else{if(_['isNil'](_0x5a66ae)||_0x5a66ae==_0x312156){_0x890f30[_0x6f04('0x61')][_0x6f04('0x6f')]=_0x312156+0x1;}else if(_0x5a66ae>_0x312156){_0x890f30[_0x6f04('0x61')][_0x6f04('0x6f')]=_0x5a66ae;}else{return db[_0x6f04('0x56')]['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[_0x6f04('0x56')]['QueryTypes'][_0x6f04('0x73')]})[_0x6f04('0x1f')](function(_0x4beab0){if(_0x4beab0&&_0x4beab0['length']){for(var _0x453bc6=0x0,_0x242276=_0x4beab0[_0x6f04('0x4f')];_0x453bc6<_0x242276&&_[_0x6f04('0x72')](_0x890f30['body']['internal']);_0x453bc6++){if(_0x5a66ae<=_0x4beab0[_0x453bc6][_0x6f04('0x74')]){_0x890f30['body'][_0x6f04('0x6f')]=_0x4beab0[_0x453bc6]['from'];}else if(_0x5a66ae>_0x4beab0[_0x453bc6][_0x6f04('0x74')]&&_0x5a66ae<=_0x4beab0[_0x453bc6]['to']){_0x890f30['body'][_0x6f04('0x6f')]=_0x5a66ae;}}}if(_[_0x6f04('0x72')](_0x890f30[_0x6f04('0x61')][_0x6f04('0x6f')])){_0x890f30[_0x6f04('0x61')]['internal']=_0x312156+0x1;}});}}});}})['then'](function(){if(_0x890f30[_0x6f04('0x61')][_0x6f04('0x75')]){_0x890f30[_0x6f04('0x61')][_0x6f04('0x76')]=_0x890f30[_0x6f04('0x61')]['internal'];_0x890f30[_0x6f04('0x61')][_0x6f04('0x77')]={'mailbox':_0x890f30['body']['internal'],'password':_0x890f30[_0x6f04('0x61')][_0x6f04('0x60')],'fullname':_0x890f30[_0x6f04('0x61')]['fullname'],'email':_0x890f30[_0x6f04('0x61')][_0x6f04('0x78')]};}if(_0x890f30[_0x6f04('0x61')]&&_0x890f30['body'][_0x6f04('0x3d')]===_0x6f04('0x35')){_0x890f30[_0x6f04('0x61')]['permissions']=['101',_0x6f04('0x79'),_0x6f04('0x7a'),_0x6f04('0x7b'),_0x6f04('0x7c'),'105','106',_0x6f04('0x7d'),_0x6f04('0x7e'),'109',_0x6f04('0x7f'),_0x6f04('0x80')];}return db['User'][_0x6f04('0x6e')](_0x890f30[_0x6f04('0x61')],{'include':[{'model':db[_0x6f04('0x77')],'as':_0x6f04('0x77')}]});})['then'](function(_0x1f365c){if(_0x890f30['body'][_0x6f04('0x3d')]==='user')return _0x1f365c;var _0x35438d=_0x890f30[_0x6f04('0x33')][_0x6f04('0x32')]({'plain':!![]});if(!_0x35438d)throw new Error(_0x6f04('0x81'));if(_0x35438d[_0x6f04('0x3d')]===_0x6f04('0x33')){var _0x4ea8f9=_0x1f365c[_0x6f04('0x32')]({'plain':!![]});var _0x4425c5=[{'name':_0x6f04('0x34'),'value':'agent'},{'name':_0x6f04('0x36'),'value':'telephone'}];var _0x2e9b57=_['find'](_0x4425c5,[_0x6f04('0x3b'),_0x4ea8f9[_0x6f04('0x3d')]])[_0x6f04('0x41')];return db[_0x6f04('0x82')][_0x6f04('0x3e')]({'where':{'name':_0x2e9b57,'userProfileId':_0x35438d[_0x6f04('0x83')]},'raw':!![]})['then'](function(_0x189f85){if(_0x189f85&&_0x189f85[_0x6f04('0x84')]===0x0){return db[_0x6f04('0x85')][_0x6f04('0x6e')]({'name':_0x4ea8f9[_0x6f04('0x41')],'resourceId':_0x4ea8f9['id'],'type':_0x189f85[_0x6f04('0x41')],'sectionId':_0x189f85['id']},{})[_0x6f04('0x1f')](function(){return _0x1f365c;});}else{return _0x1f365c;}})[_0x6f04('0x27')](function(_0x1ad49a){logger[_0x6f04('0x24')](_0x6f04('0x86'),_0x1ad49a);throw _0x1ad49a;});}return _0x1f365c;})[_0x6f04('0x1f')](respondWithResult(_0x3db271,0xc9))[_0x6f04('0x27')](handleError(_0x3db271,null));};exports[_0x6f04('0x87')]=function(_0x48fdc9,_0x3e7e81,_0xa23bd9){if(_0x48fdc9[_0x6f04('0x61')]['id']){delete _0x48fdc9[_0x6f04('0x61')]['id'];}return db[_0x6f04('0x44')][_0x6f04('0x3e')]({'where':{'id':_0x48fdc9[_0x6f04('0x5f')]['id']}})['then'](function(_0x3d73cf){if(_0x3d73cf){if(_0x3d73cf['id']==_0x48fdc9[_0x6f04('0x33')]['id']){if(!_0x48fdc9[_0x6f04('0x61')][_0x6f04('0x88')]||!_0x48fdc9[_0x6f04('0x61')][_0x6f04('0x89')]){throw new db[(_0x6f04('0x8a'))]['ValidationError'](_0x6f04('0x8b'));}if(!_0x3d73cf[_0x6f04('0x8c')](_0x48fdc9[_0x6f04('0x61')][_0x6f04('0x88')])){throw new db[(_0x6f04('0x8a'))][(_0x6f04('0x8d'))]('Wrong\x20credentials');}if(_0x48fdc9[_0x6f04('0x61')]['oldPassword']==_0x48fdc9['body'][_0x6f04('0x89')]){throw new db[(_0x6f04('0x8a'))]['ValidationError'](_0x6f04('0x8e'));}return _0x3d73cf;}else if(_0x48fdc9['user'][_0x6f04('0x3d')]=='admin'){if(!_0x48fdc9[_0x6f04('0x61')][_0x6f04('0x89')]){throw new db[(_0x6f04('0x8a'))][(_0x6f04('0x8d'))](_0x6f04('0x8f'));}return _0x3d73cf;}else if(_0x48fdc9[_0x6f04('0x33')][_0x6f04('0x3d')]==_0x6f04('0x33')){if(!_0x48fdc9['body'][_0x6f04('0x89')]){throw new db[(_0x6f04('0x8a'))][(_0x6f04('0x8d'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x3d73cf[_0x6f04('0x3d')]!=_0x6f04('0x35')){throw new db['Sequelize']['ValidationError'](_0x6f04('0x90'));}return _0x3d73cf;}else{throw new db[(_0x6f04('0x8a'))][(_0x6f04('0x8d'))](_0x6f04('0x90'));}}return null;})[_0x6f04('0x1f')](handleEntityNotFound(_0x3e7e81,null))['then'](saveUpdates({'password':_0x48fdc9[_0x6f04('0x61')][_0x6f04('0x89')],'passwordResetAt':_0x48fdc9[_0x6f04('0x33')]['id']==_0x48fdc9[_0x6f04('0x5f')]['id']?moment():null},null))[_0x6f04('0x1f')](respondWithResult(_0x3e7e81,null))[_0x6f04('0x27')](handleError(_0x3e7e81,null));};exports['addQueues']=function(_0x3fc73b,_0x3e1715,_0x3af964){var _0x14ec50;return db[_0x6f04('0x44')][_0x6f04('0x3e')]({'where':{'id':_0x3fc73b[_0x6f04('0x5f')]['id']},'attributes':['id','name',_0x6f04('0x3d'),_0x6f04('0x91'),_0x6f04('0x92'),_0x6f04('0x93')]})['then'](handleEntityNotFound(_0x3e1715,null))[_0x6f04('0x1f')](function(_0x54f98){if(_0x54f98){_0x14ec50=_0x54f98;if(!utils[_0x6f04('0x94')](_0x3fc73b[_0x6f04('0x61')][_0x6f04('0x95')])){throw new db[(_0x6f04('0x8a'))]['ValidationError'](_0x6f04('0x96'));}return _0x54f98['add'+_['capitalize'](_0x3fc73b[_0x6f04('0x61')][_0x6f04('0x95')]['toLowerCase']())+'Queues'](_0x3fc73b[_0x6f04('0x61')][_0x6f04('0x65')],{'penalty':_0x3fc73b[_0x6f04('0x61')][_0x6f04('0x97')]||0x0});}})[_0x6f04('0x98')](function(_0x4b7bb9){for(var _0x7bc69e=0x0;_0x7bc69e<_0x3fc73b[_0x6f04('0x61')][_0x6f04('0x65')][_0x6f04('0x4f')];_0x7bc69e+=0x1){var _0x2bfc4f={'UserId':_0x3fc73b[_0x6f04('0x5f')]['id']};_0x2bfc4f[_[_0x6f04('0x99')](_0x3fc73b[_0x6f04('0x61')][_0x6f04('0x95')][_0x6f04('0x9a')]())+'QueueId']=_0x3fc73b['body'][_0x6f04('0x65')][_0x7bc69e];socket[_0x6f04('0x9b')](_0x6f04('0x33')+_[_0x6f04('0x99')](_0x3fc73b[_0x6f04('0x61')][_0x6f04('0x95')][_0x6f04('0x9a')]())+_0x6f04('0x9c'),_0x2bfc4f);}return _0x4b7bb9;})[_0x6f04('0x1f')](function(){if(_0x3fc73b[_0x6f04('0x61')][_0x6f04('0x95')]==='voice'){return db[_0x6f04('0x9d')][_0x6f04('0x5d')]({'where':{'id':_0x3fc73b[_0x6f04('0x61')][_0x6f04('0x65')]||[]},'raw':!![],'attributes':['id',_0x6f04('0x41')]});}})['then'](function(_0x451658){var _0x1712eb=[];if(_0x3fc73b[_0x6f04('0x61')]['channel']===_0x6f04('0x9e')&&_0x14ec50[_0x6f04('0x3d')]===_0x6f04('0x35')){for(var _0x23abd6=0x0;_0x23abd6<_0x451658[_0x6f04('0x4f')];_0x23abd6+=0x1){_0x1712eb[_0x6f04('0x9f')]({'membername':_0x14ec50[_0x6f04('0x41')],'UserId':_0x14ec50['id'],'queue_name':_0x451658[_0x23abd6][_0x6f04('0x41')],'VoiceQueueId':_0x451658[_0x23abd6]['id'],'interface':_[_0x6f04('0x72')](_0x14ec50[_0x6f04('0x93')])?util[_0x6f04('0x6c')](_0x6f04('0xa0'),_0x14ec50[_0x6f04('0x41')]):_0x14ec50[_0x6f04('0x93')],'paused':_0x14ec50['voicePause']||![],'penalty':_0x3fc73b['body'][_0x6f04('0x97')]||0x0});}return BPromise['each'](_0x1712eb,function(_0x4c1c7a){return db[_0x6f04('0xa1')]['upsert'](_0x4c1c7a);});}return _0x14ec50;})[_0x6f04('0x1f')](respondWithStatusCode(_0x3e1715,null))[_0x6f04('0x27')](handleError(_0x3e1715,null));};exports[_0x6f04('0xa2')]=function(_0x58e21c,_0x5c4b5a,_0xf2fba5){var _0x5ebbf0;return db[_0x6f04('0x44')][_0x6f04('0x3e')]({'where':{'id':_0x58e21c[_0x6f04('0x5f')]['id']},'attributes':['id',_0x6f04('0x41'),'role']})[_0x6f04('0x1f')](handleEntityNotFound(_0x5c4b5a,null))[_0x6f04('0x1f')](function(_0x1899fe){if(_0x1899fe){_0x5ebbf0=_0x1899fe;if(!_0x58e21c[_0x6f04('0x4a')]['channel']||!utils['isValidChannel'](_0x58e21c[_0x6f04('0x4a')][_0x6f04('0x95')])){throw new db[(_0x6f04('0x8a'))][(_0x6f04('0x8d'))]('Unknown\x20channel');}return _0x1899fe[_0x6f04('0xa3')+_[_0x6f04('0x99')](_0x58e21c['query'][_0x6f04('0x95')]['toLowerCase']())+'Queues'](_0x58e21c[_0x6f04('0x4a')][_0x6f04('0x65')]);}})[_0x6f04('0x1f')](function(_0x4e4c8f){for(var _0x3ab9f4=0x0;_0x3ab9f4<_0x58e21c[_0x6f04('0x4a')][_0x6f04('0x65')]['length'];_0x3ab9f4+=0x1){var _0x4e356e={'UserId':_0x58e21c['params']['id']};_0x4e356e[_[_0x6f04('0x99')](_0x58e21c[_0x6f04('0x4a')]['channel']['toLowerCase']())+_0x6f04('0xa4')]=_0x58e21c[_0x6f04('0x4a')][_0x6f04('0x65')][_0x3ab9f4];socket['emit'](_0x6f04('0x33')+_[_0x6f04('0x99')](_0x58e21c[_0x6f04('0x4a')][_0x6f04('0x95')][_0x6f04('0x9a')]())+'Queue:remove',_0x4e356e);}return _0x4e4c8f;})[_0x6f04('0x1f')](function(){if(_0x58e21c[_0x6f04('0x4a')]['channel']===_0x6f04('0x9e')){return db[_0x6f04('0xa1')]['destroy']({'where':{'UserId':_0x58e21c[_0x6f04('0x5f')]['id'],'VoiceQueueId':_0x58e21c[_0x6f04('0x4a')][_0x6f04('0x65')]},'individualHooks':!![]})[_0x6f04('0x1f')](function(){return _0x5ebbf0;});}return _0x5ebbf0;})[_0x6f04('0x1f')](respondWithStatusCode(_0x5c4b5a,null))[_0x6f04('0x27')](handleError(_0x5c4b5a,null));};exports[_0x6f04('0xa5')]=function(_0x20bdf7,_0x6f6f04,_0x25b966){_0x20bdf7[_0x6f04('0x61')][_0x6f04('0xa6')]=_0x20bdf7[_0x6f04('0xa7')][_0x6f04('0xa8')];return db[_0x6f04('0x44')]['find']({'where':{'id':_0x20bdf7['params']['id']}})[_0x6f04('0x1f')](handleEntityNotFound(_0x6f6f04,null))[_0x6f04('0x1f')](saveUpdates(_0x20bdf7[_0x6f04('0x61')],null))[_0x6f04('0x1f')](respondWithResult(_0x6f6f04,null))['catch'](handleError(_0x6f6f04,null));};exports[_0x6f04('0xa9')]=function(_0x1f196f,_0x22969d,_0x2c719b){var _0x57615e=path['join'](config[_0x6f04('0xaa')],'server/files/images/logos/default_profile.png');return db[_0x6f04('0x44')][_0x6f04('0x3e')]({'where':{'id':_0x1f196f[_0x6f04('0x5f')]['id']},'attributes':['id',_0x6f04('0xa6')],'raw':!![]})[_0x6f04('0x1f')](handleEntityNotFound(_0x22969d,null))[_0x6f04('0x1f')](function(_0x38092a){if(_0x38092a){if(_[_0x6f04('0x72')](_0x38092a[_0x6f04('0xa6')])){return _0x22969d[_0x6f04('0xab')](_0x57615e);}else{if(!fs[_0x6f04('0xac')](path[_0x6f04('0xad')](config[_0x6f04('0xaa')],'server/files/images/',_0x38092a[_0x6f04('0xa6')]))){return _0x22969d[_0x6f04('0xab')](_0x57615e);}return _0x22969d[_0x6f04('0xab')](path['join'](config[_0x6f04('0xaa')],_0x6f04('0xae'),_0x38092a['userpic']));}}})[_0x6f04('0x27')](handleError(_0x22969d,null));};exports[_0x6f04('0xaf')]=function(_0x53f336,_0x29ed19,_0x4db708){var _0x297fe1={};var _0x5a5cb1={};var _0x595b72;var _0x5771c2;return db[_0x6f04('0x44')]['findOne']({'where':{'id':_0x53f336[_0x6f04('0x5f')]['id']}})[_0x6f04('0x1f')](handleEntityNotFound(_0x29ed19,null))['then'](function(_0x29845a){if(_0x29845a){_0x595b72=_0x29845a;_0x5a5cb1[_0x6f04('0x46')]=_[_0x6f04('0x48')](db[_0x6f04('0xb0')][_0x6f04('0x45')]);_0x5a5cb1[_0x6f04('0x4a')]=_[_0x6f04('0x48')](_0x53f336[_0x6f04('0x4a')]);_0x5a5cb1['filters']=_[_0x6f04('0x4c')](_0x5a5cb1['model'],_0x5a5cb1['query']);_0x297fe1['attributes']=_[_0x6f04('0x4c')](_0x5a5cb1[_0x6f04('0x46')],qs[_0x6f04('0x4e')](_0x53f336[_0x6f04('0x4a')][_0x6f04('0x4e')]));_0x297fe1['attributes']=_0x297fe1['attributes'][_0x6f04('0x4f')]?_0x297fe1[_0x6f04('0x4d')]:_0x5a5cb1[_0x6f04('0x46')];_0x297fe1[_0x6f04('0xb1')]=qs['sort'](_0x53f336['query'][_0x6f04('0x53')]);_0x297fe1[_0x6f04('0x54')]=qs[_0x6f04('0x4b')](_['pick'](_0x53f336[_0x6f04('0x4a')],_0x5a5cb1[_0x6f04('0x4b')]));if(_0x53f336['query']['filter']){_0x297fe1[_0x6f04('0x54')]=_['merge'](_0x297fe1[_0x6f04('0x54')],{'$or':_[_0x6f04('0x3a')](_0x297fe1['attributes'],function(_0x2d2271){var _0x4f713c={};_0x4f713c[_0x2d2271]={'$like':'%'+_0x53f336[_0x6f04('0x4a')][_0x6f04('0x38')]+'%'};return _0x4f713c;})});}_0x297fe1=_[_0x6f04('0x55')]({},_0x297fe1,_0x53f336[_0x6f04('0x5a')]);return _0x595b72['getContacts'](_0x297fe1);}})[_0x6f04('0x1f')](function(_0x48b848){if(_0x48b848){_0x5771c2=_0x48b848[_0x6f04('0x4f')];if(_0x53f336[_0x6f04('0x4a')][_0x6f04('0x50')](_0x6f04('0x5b'))){_0x297fe1[_0x6f04('0x5c')]=[{'model':db['CmList'],'as':_0x6f04('0xb2'),'required':![]},{'model':db[_0x6f04('0xb3')],'as':_0x6f04('0xb4'),'attributes':['id','name','color'],'where':_0x53f336['query'][_0x6f04('0xb5')]?{'id':_0x53f336[_0x6f04('0x4a')]['tag']}:undefined,'required':_0x53f336[_0x6f04('0x4a')]['tag']?!![]:![]}];}if(!_0x53f336[_0x6f04('0x4a')]['hasOwnProperty']('nolimit')){_0x297fe1[_0x6f04('0x52')]=qs['limit'](_0x53f336['query'][_0x6f04('0x52')]);_0x297fe1[_0x6f04('0x2d')]=qs[_0x6f04('0x2d')](_0x53f336['query'][_0x6f04('0x2d')]);}return _0x595b72[_0x6f04('0xaf')](_0x297fe1);}})['then'](function(_0xe4d704){if(_0xe4d704){return _0xe4d704?{'count':_0x5771c2,'rows':_0xe4d704}:null;}})[_0x6f04('0x1f')](respondWithResult(_0x29ed19,null))[_0x6f04('0x27')](handleError(_0x29ed19,null));};exports[_0x6f04('0xb6')]=function(_0x2807f2,_0x5661f5,_0x251771){var _0x4dfb25;var _0x2eacf1;var _0x4a2b68={};var _0x19c7c5;return db['User'][_0x6f04('0xb7')]({'where':{'id':_0x2807f2[_0x6f04('0x5f')]['id']},'attributes':['id',_0x6f04('0x41'),'role']})[_0x6f04('0x1f')](handleEntityNotFound(_0x5661f5,null))['then'](function(_0x258999){if(!utils[_0x6f04('0x94')](_0x2807f2[_0x6f04('0x4a')]['channel'])){throw new db[(_0x6f04('0x8a'))][(_0x6f04('0x8d'))](_0x6f04('0x96'));}_0x4dfb25=_0x258999;var _0x1714ad={};_0x1714ad[_0x6f04('0x46')]=_[_0x6f04('0x48')](db[_[_0x6f04('0x99')](_0x2807f2[_0x6f04('0x4a')][_0x6f04('0x95')])+_0x6f04('0xb8')][_0x6f04('0x45')]);_0x1714ad[_0x6f04('0x4a')]=_[_0x6f04('0x48')](_0x2807f2[_0x6f04('0x4a')]);_0x1714ad[_0x6f04('0x4b')]=_['intersection'](_0x1714ad[_0x6f04('0x46')],_0x1714ad[_0x6f04('0x4a')]);_0x4a2b68[_0x6f04('0x4d')]=_[_0x6f04('0x4c')](_0x1714ad['model'],qs[_0x6f04('0x4e')](_0x2807f2['query']['fields']));_0x4a2b68[_0x6f04('0x4d')]=_0x4a2b68[_0x6f04('0x4d')][_0x6f04('0x4f')]?_0x4a2b68['attributes']:_0x1714ad['model'];_0x4a2b68['order']=qs[_0x6f04('0x53')](_0x2807f2['query'][_0x6f04('0x53')]);_0x4a2b68[_0x6f04('0x54')]=qs[_0x6f04('0x4b')](_['pick'](_0x2807f2[_0x6f04('0x4a')],_0x1714ad[_0x6f04('0x4b')]));if(_0x2807f2[_0x6f04('0x4a')][_0x6f04('0x38')]){_0x4a2b68[_0x6f04('0x54')]=_[_0x6f04('0x55')](_0x4a2b68[_0x6f04('0x54')],{'$or':_[_0x6f04('0x3a')](_0x4a2b68[_0x6f04('0x4d')],function(_0x49c6dd){var _0x2b5e36={};_0x2b5e36[_0x49c6dd]={'$like':'%'+_0x2807f2[_0x6f04('0x4a')][_0x6f04('0x38')]+'%'};return _0x2b5e36;})});}_0x4a2b68=_[_0x6f04('0x55')]({},_0x4a2b68,_0x2807f2[_0x6f04('0x5a')]);switch(_0x4dfb25[_0x6f04('0x3d')]){case'admin':return db[_['capitalize'](_0x2807f2[_0x6f04('0x4a')]['channel'])+_0x6f04('0xb8')]['findAll'](_0x4a2b68);case'user':case _0x6f04('0x35'):return _0x4dfb25[_0x6f04('0x32')+_[_0x6f04('0x99')](_0x2807f2['query']['channel'])+_0x6f04('0xb9')](_0x4a2b68);default:throw new db[(_0x6f04('0x8a'))][(_0x6f04('0x8d'))](_0x6f04('0xba'));}})[_0x6f04('0x1f')](function(_0x270519){_0x19c7c5=_0x270519[_0x6f04('0x4f')];if(!_0x2807f2[_0x6f04('0x4a')][_0x6f04('0x50')](_0x6f04('0x51'))){_0x4a2b68[_0x6f04('0x52')]=qs[_0x6f04('0x52')](_0x2807f2[_0x6f04('0x4a')][_0x6f04('0x52')]);_0x4a2b68['offset']=qs[_0x6f04('0x2d')](_0x2807f2['query'][_0x6f04('0x2d')]);}switch(_0x4dfb25['role']){case _0x6f04('0x68'):return db[_[_0x6f04('0x99')](_0x2807f2[_0x6f04('0x4a')][_0x6f04('0x95')])+_0x6f04('0xb8')][_0x6f04('0x5d')](_0x4a2b68);case _0x6f04('0x33'):case _0x6f04('0x35'):return _0x4dfb25[_0x6f04('0x32')+_['capitalize'](_0x2807f2[_0x6f04('0x4a')][_0x6f04('0x95')])+_0x6f04('0xb9')](_0x4a2b68);}})['then'](function(_0x7856c2){return{'count':_0x19c7c5,'rows':_0x7856c2};})[_0x6f04('0x1f')](respondWithResult(_0x5661f5,null))['catch'](handleError(_0x5661f5,null));};exports[_0x6f04('0xbb')]=function(_0x58c5fb,_0x1ad76a,_0x253349){var _0x3c977a={};var _0x2ff1ec={};var _0x8954a4;var _0x1f7562;return db[_0x6f04('0x44')][_0x6f04('0xb7')]({'where':{'id':_0x58c5fb[_0x6f04('0x5f')]['id']}})[_0x6f04('0x1f')](handleEntityNotFound(_0x1ad76a,null))['then'](function(_0x15b0b5){if(_0x15b0b5){_0x8954a4=_0x15b0b5;_0x2ff1ec[_0x6f04('0x46')]=_[_0x6f04('0x48')](db[_0x6f04('0xa1')][_0x6f04('0x45')]);_0x2ff1ec[_0x6f04('0x4a')]=_[_0x6f04('0x48')](_0x58c5fb[_0x6f04('0x4a')]);_0x2ff1ec['filters']=_[_0x6f04('0x4c')](_0x2ff1ec[_0x6f04('0x46')],_0x2ff1ec['query']);_0x3c977a[_0x6f04('0x4d')]=_[_0x6f04('0x4c')](_0x2ff1ec[_0x6f04('0x46')],qs['fields'](_0x58c5fb[_0x6f04('0x4a')]['fields']));_0x3c977a[_0x6f04('0x4d')]=_0x3c977a[_0x6f04('0x4d')][_0x6f04('0x4f')]?_0x3c977a[_0x6f04('0x4d')]:_0x2ff1ec[_0x6f04('0x46')];_0x3c977a[_0x6f04('0xb1')]=qs[_0x6f04('0x53')](_0x58c5fb['query'][_0x6f04('0x53')]);_0x3c977a['where']=qs['filters'](_[_0x6f04('0xbc')](_0x58c5fb[_0x6f04('0x4a')],_0x2ff1ec[_0x6f04('0x4b')]));if(_0x58c5fb[_0x6f04('0x4a')]['filter']){_0x3c977a[_0x6f04('0x54')]=_[_0x6f04('0x55')](_0x3c977a['where'],{'$or':_['map'](_0x3c977a['attributes'],function(_0x818e64){var _0x15fc2c={};_0x15fc2c[_0x818e64]={'$like':'%'+_0x58c5fb[_0x6f04('0x4a')][_0x6f04('0x38')]+'%'};return _0x15fc2c;})});}_0x3c977a=_[_0x6f04('0x55')]({},_0x3c977a,_0x58c5fb[_0x6f04('0x5a')]);return _0x8954a4[_0x6f04('0xbb')](_0x3c977a);}})[_0x6f04('0x1f')](function(_0x168653){if(_0x168653){_0x1f7562=_0x168653[_0x6f04('0x4f')];if(!_0x58c5fb['query']['hasOwnProperty'](_0x6f04('0x51'))){_0x3c977a[_0x6f04('0x52')]=qs[_0x6f04('0x52')](_0x58c5fb[_0x6f04('0x4a')][_0x6f04('0x52')]);_0x3c977a[_0x6f04('0x2d')]=qs[_0x6f04('0x2d')](_0x58c5fb[_0x6f04('0x4a')][_0x6f04('0x2d')]);}return _0x8954a4[_0x6f04('0xbb')](_0x3c977a);}})[_0x6f04('0x1f')](function(_0x11789e){if(_0x11789e){return _0x11789e?{'count':_0x1f7562,'rows':_0x11789e}:null;}})[_0x6f04('0x1f')](respondWithResult(_0x1ad76a,null))[_0x6f04('0x27')](handleError(_0x1ad76a,null));};exports['getGroups']=function(_0x1d0dcd,_0x205c52,_0x3be338){var _0x5a0bf4={};var _0x345484={};var _0x3d5d71;var _0x535daa;return db[_0x6f04('0x44')][_0x6f04('0xb7')]({'where':{'id':_0x1d0dcd[_0x6f04('0x5f')]['id']}})[_0x6f04('0x1f')](handleEntityNotFound(_0x205c52,null))[_0x6f04('0x1f')](function(_0x50ae79){if(_0x50ae79){_0x3d5d71=_0x50ae79;_0x345484[_0x6f04('0x46')]=_[_0x6f04('0x48')](db['ChatGroup'][_0x6f04('0x45')]);_0x345484[_0x6f04('0x4a')]=_[_0x6f04('0x48')](_0x1d0dcd[_0x6f04('0x4a')]);_0x345484[_0x6f04('0x4b')]=_[_0x6f04('0x4c')](_0x345484['model'],_0x345484[_0x6f04('0x4a')]);_0x5a0bf4['attributes']=_[_0x6f04('0x4c')](_0x345484[_0x6f04('0x46')],qs[_0x6f04('0x4e')](_0x1d0dcd[_0x6f04('0x4a')][_0x6f04('0x4e')]));_0x5a0bf4[_0x6f04('0x4d')]=_0x5a0bf4[_0x6f04('0x4d')][_0x6f04('0x4f')]?_0x5a0bf4['attributes']:_0x345484[_0x6f04('0x46')];_0x5a0bf4['order']=qs['sort'](_0x1d0dcd[_0x6f04('0x4a')][_0x6f04('0x53')]);_0x5a0bf4[_0x6f04('0x54')]=qs['filters'](_[_0x6f04('0xbc')](_0x1d0dcd[_0x6f04('0x4a')],_0x345484[_0x6f04('0x4b')]));if(_0x1d0dcd[_0x6f04('0x4a')][_0x6f04('0x38')]){_0x5a0bf4[_0x6f04('0x54')]=_[_0x6f04('0x55')](_0x5a0bf4['where'],{'$or':_['map'](_0x5a0bf4[_0x6f04('0x4d')],function(_0x59866a){var _0x4535e7={};_0x4535e7[_0x59866a]={'$like':'%'+_0x1d0dcd[_0x6f04('0x4a')][_0x6f04('0x38')]+'%'};return _0x4535e7;})});}_0x5a0bf4=_[_0x6f04('0x55')]({},_0x5a0bf4,_0x1d0dcd['options']);return _0x3d5d71[_0x6f04('0xbd')](_0x5a0bf4);}})[_0x6f04('0x1f')](function(_0x9fd1cf){if(_0x9fd1cf){_0x535daa=_0x9fd1cf[_0x6f04('0x4f')];if(!_0x1d0dcd['query'][_0x6f04('0x50')](_0x6f04('0x51'))){_0x5a0bf4[_0x6f04('0x52')]=qs[_0x6f04('0x52')](_0x1d0dcd[_0x6f04('0x4a')][_0x6f04('0x52')]);_0x5a0bf4[_0x6f04('0x2d')]=qs[_0x6f04('0x2d')](_0x1d0dcd[_0x6f04('0x4a')]['offset']);}return _0x3d5d71['getGroups'](_0x5a0bf4);}})[_0x6f04('0x1f')](function(_0x3a6fe8){if(_0x3a6fe8){return _0x3a6fe8?{'count':_0x535daa,'rows':_0x3a6fe8}:null;}})[_0x6f04('0x1f')](respondWithResult(_0x205c52,null))[_0x6f04('0x27')](handleError(_0x205c52,null));};exports[_0x6f04('0xbe')]=function(_0x38fb8a,_0x3ac439,_0x14fbb9){var _0xe5e128={'raw':!![],'where':{}};var _0x57a1d6={};var _0x13de51={'count':0x0,'rows':[]};return db[_0x6f04('0x44')]['findOne']({'where':{'id':_0x38fb8a['params']['id']}})[_0x6f04('0x1f')](handleEntityNotFound(_0x3ac439,null))[_0x6f04('0x1f')](function(_0xdfacff){if(_0xdfacff){_0x57a1d6['model']=_[_0x6f04('0x48')](db[_0x6f04('0xbf')]['rawAttributes']);_0x57a1d6[_0x6f04('0x4a')]=_['keys'](_0x38fb8a[_0x6f04('0x4a')]);_0x57a1d6[_0x6f04('0x4b')]=_[_0x6f04('0x4c')](_0x57a1d6['model'],_0x57a1d6['query']);_0xe5e128['attributes']=_[_0x6f04('0x4c')](_0x57a1d6[_0x6f04('0x46')],qs['fields'](_0x38fb8a['query'][_0x6f04('0x4e')]));_0xe5e128['attributes']=_0xe5e128['attributes'][_0x6f04('0x4f')]?_0xe5e128[_0x6f04('0x4d')]:_0x57a1d6['model'];if(!_0x38fb8a[_0x6f04('0x4a')][_0x6f04('0x50')](_0x6f04('0x51'))){_0xe5e128[_0x6f04('0x52')]=qs[_0x6f04('0x52')](_0x38fb8a[_0x6f04('0x4a')][_0x6f04('0x52')]);_0xe5e128[_0x6f04('0x2d')]=qs[_0x6f04('0x2d')](_0x38fb8a[_0x6f04('0x4a')]['offset']);}_0xe5e128['order']=qs[_0x6f04('0x53')](_0x38fb8a[_0x6f04('0x4a')][_0x6f04('0x53')]);_0xe5e128[_0x6f04('0x54')]=qs[_0x6f04('0x4b')](_['pick'](_0x38fb8a[_0x6f04('0x4a')],_0x57a1d6['filters']));_0xe5e128[_0x6f04('0x54')][_0x6f04('0xc0')]=_0xdfacff['id'];if(_0x38fb8a['query'][_0x6f04('0x38')]){_0xe5e128[_0x6f04('0x54')]=_['merge'](_0xe5e128[_0x6f04('0x54')],{'$or':_[_0x6f04('0x3a')](_0xe5e128[_0x6f04('0x4d')],function(_0x36067e){var _0x3c4dab={};_0x3c4dab[_0x36067e]={'$like':'%'+_0x38fb8a[_0x6f04('0x4a')][_0x6f04('0x38')]+'%'};return _0x3c4dab;})});}_0xe5e128=_[_0x6f04('0x55')]({},_0xe5e128,_0x38fb8a[_0x6f04('0x5a')]);return db[_0x6f04('0xbf')][_0x6f04('0x2c')]({'where':_0xe5e128[_0x6f04('0x54')]})[_0x6f04('0x1f')](function(_0x28d2c3){_0x13de51[_0x6f04('0x2c')]=_0x28d2c3;if(_0x38fb8a[_0x6f04('0x4a')][_0x6f04('0x5b')]){_0xe5e128['include']=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0xe5e128);})['then'](function(_0x1b0b4f){_0x13de51[_0x6f04('0xc1')]=_0x1b0b4f;return _0x13de51;});}})['then'](respondWithFilteredResult(_0x3ac439,_0xe5e128))[_0x6f04('0x27')](handleError(_0x3ac439,null));};exports[_0x6f04('0xc2')]=function(_0x82a345,_0x2e28a4,_0x2abb1a){var _0x4a5621={};var _0x5e17d6={};var _0x47e786;var _0x5a7e40;return db['User'][_0x6f04('0xb7')]({'where':{'id':_0x82a345[_0x6f04('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2e28a4,null))[_0x6f04('0x1f')](function(_0x19d32c){if(_0x19d32c){_0x47e786=_0x19d32c;_0x5e17d6[_0x6f04('0x46')]=_['keys'](db[_0x6f04('0xc3')][_0x6f04('0x45')]);_0x5e17d6[_0x6f04('0x4a')]=_['keys'](_0x82a345[_0x6f04('0x4a')]);_0x5e17d6[_0x6f04('0x4b')]=_[_0x6f04('0x4c')](_0x5e17d6[_0x6f04('0x46')],_0x5e17d6[_0x6f04('0x4a')]);_0x4a5621[_0x6f04('0x4d')]=_[_0x6f04('0x4c')](_0x5e17d6[_0x6f04('0x46')],qs['fields'](_0x82a345[_0x6f04('0x4a')][_0x6f04('0x4e')]));_0x4a5621[_0x6f04('0x4d')]=_0x4a5621[_0x6f04('0x4d')][_0x6f04('0x4f')]?_0x4a5621[_0x6f04('0x4d')]:_0x5e17d6[_0x6f04('0x46')];_0x4a5621[_0x6f04('0xb1')]=qs['sort'](_0x82a345[_0x6f04('0x4a')]['sort']);_0x4a5621[_0x6f04('0x54')]=qs[_0x6f04('0x4b')](_[_0x6f04('0xbc')](_0x82a345[_0x6f04('0x4a')],_0x5e17d6[_0x6f04('0x4b')]));if(_0x82a345[_0x6f04('0x4a')][_0x6f04('0x38')]){_0x4a5621[_0x6f04('0x54')]=_[_0x6f04('0x55')](_0x4a5621['where'],{'$or':_[_0x6f04('0x3a')](_0x4a5621[_0x6f04('0x4d')],function(_0x38237d){var _0x3ba066={};_0x3ba066[_0x38237d]={'$like':'%'+_0x82a345[_0x6f04('0x4a')][_0x6f04('0x38')]+'%'};return _0x3ba066;})});}_0x4a5621=_[_0x6f04('0x55')]({},_0x4a5621,_0x82a345['options']);return _0x47e786[_0x6f04('0xc2')](_0x4a5621);}})[_0x6f04('0x1f')](function(_0x1ba7e4){if(_0x1ba7e4){_0x5a7e40=_0x1ba7e4['length'];if(!_0x82a345[_0x6f04('0x4a')][_0x6f04('0x50')](_0x6f04('0x51'))){_0x4a5621['limit']=qs[_0x6f04('0x52')](_0x82a345[_0x6f04('0x4a')][_0x6f04('0x52')]);_0x4a5621[_0x6f04('0x2d')]=qs[_0x6f04('0x2d')](_0x82a345[_0x6f04('0x4a')][_0x6f04('0x2d')]);}return _0x47e786[_0x6f04('0xc2')](_0x4a5621);}})['then'](function(_0x21f735){if(_0x21f735){return _0x21f735?{'count':_0x5a7e40,'rows':_0x21f735}:null;}})[_0x6f04('0x1f')](respondWithResult(_0x2e28a4,null))[_0x6f04('0x27')](handleError(_0x2e28a4,null));};exports[_0x6f04('0xc4')]=function(_0x2a2f8e,_0x18f9d2,_0x3bc007){var _0x4f0bf6={};var _0x67b692={};var _0x812e1c;var _0x5e0a5d;return db[_0x6f04('0x44')]['findOne']({'where':{'id':_0x2a2f8e[_0x6f04('0x5f')]['id']}})['then'](handleEntityNotFound(_0x18f9d2,null))[_0x6f04('0x1f')](function(_0x146eb3){if(_0x146eb3){_0x812e1c=_0x146eb3;_0x67b692['model']=_['keys'](db['OpenchannelInteraction'][_0x6f04('0x45')]);_0x67b692[_0x6f04('0x4a')]=_['keys'](_0x2a2f8e['query']);_0x67b692[_0x6f04('0x4b')]=_[_0x6f04('0x4c')](_0x67b692[_0x6f04('0x46')],_0x67b692['query']);_0x4f0bf6['attributes']=_[_0x6f04('0x4c')](_0x67b692['model'],qs[_0x6f04('0x4e')](_0x2a2f8e[_0x6f04('0x4a')]['fields']));_0x4f0bf6[_0x6f04('0x4d')]=_0x4f0bf6[_0x6f04('0x4d')][_0x6f04('0x4f')]?_0x4f0bf6[_0x6f04('0x4d')]:_0x67b692[_0x6f04('0x46')];_0x4f0bf6['order']=qs['sort'](_0x2a2f8e[_0x6f04('0x4a')][_0x6f04('0x53')]);_0x4f0bf6[_0x6f04('0x54')]=qs['filters'](_[_0x6f04('0xbc')](_0x2a2f8e[_0x6f04('0x4a')],_0x67b692[_0x6f04('0x4b')]));if(_0x2a2f8e[_0x6f04('0x4a')]['filter']){_0x4f0bf6['where']=_[_0x6f04('0x55')](_0x4f0bf6[_0x6f04('0x54')],{'$or':_[_0x6f04('0x3a')](_0x4f0bf6[_0x6f04('0x4d')],function(_0x263ddd){var _0x2013b6={};_0x2013b6[_0x263ddd]={'$like':'%'+_0x2a2f8e[_0x6f04('0x4a')][_0x6f04('0x38')]+'%'};return _0x2013b6;})});}_0x4f0bf6=_[_0x6f04('0x55')]({},_0x4f0bf6,_0x2a2f8e[_0x6f04('0x5a')]);return _0x812e1c[_0x6f04('0xc4')](_0x4f0bf6);}})[_0x6f04('0x1f')](function(_0x1263f0){if(_0x1263f0){_0x5e0a5d=_0x1263f0[_0x6f04('0x4f')];if(!_0x2a2f8e[_0x6f04('0x4a')][_0x6f04('0x50')](_0x6f04('0x51'))){_0x4f0bf6['limit']=qs[_0x6f04('0x52')](_0x2a2f8e[_0x6f04('0x4a')][_0x6f04('0x52')]);_0x4f0bf6[_0x6f04('0x2d')]=qs[_0x6f04('0x2d')](_0x2a2f8e[_0x6f04('0x4a')]['offset']);}return _0x812e1c[_0x6f04('0xc4')](_0x4f0bf6);}})[_0x6f04('0x1f')](function(_0x9cfc01){if(_0x9cfc01){return _0x9cfc01?{'count':_0x5e0a5d,'rows':_0x9cfc01}:null;}})[_0x6f04('0x1f')](respondWithResult(_0x18f9d2,null))[_0x6f04('0x27')](handleError(_0x18f9d2,null));};exports['getMailInteractions']=function(_0x285bb0,_0x245668,_0x41d972){var _0x37544d={'raw':!![],'where':{}};var _0x2ef438={};var _0x48e35f={'count':0x0,'rows':[]};return db[_0x6f04('0x44')][_0x6f04('0xb7')]({'where':{'id':_0x285bb0[_0x6f04('0x5f')]['id']}})['then'](handleEntityNotFound(_0x245668,null))[_0x6f04('0x1f')](function(_0x2bafc5){if(_0x2bafc5){_0x2ef438[_0x6f04('0x46')]=_[_0x6f04('0x48')](db[_0x6f04('0xc5')][_0x6f04('0x45')]);_0x2ef438[_0x6f04('0x4a')]=_[_0x6f04('0x48')](_0x285bb0[_0x6f04('0x4a')]);_0x2ef438[_0x6f04('0x4b')]=_[_0x6f04('0x4c')](_0x2ef438['model'],_0x2ef438['query']);_0x37544d[_0x6f04('0x4d')]=_[_0x6f04('0x4c')](_0x2ef438[_0x6f04('0x46')],qs[_0x6f04('0x4e')](_0x285bb0[_0x6f04('0x4a')][_0x6f04('0x4e')]));_0x37544d[_0x6f04('0x4d')]=_0x37544d[_0x6f04('0x4d')][_0x6f04('0x4f')]?_0x37544d['attributes']:_0x2ef438[_0x6f04('0x46')];if(!_0x285bb0['query']['hasOwnProperty']('nolimit')){_0x37544d[_0x6f04('0x52')]=qs['limit'](_0x285bb0[_0x6f04('0x4a')][_0x6f04('0x52')]);_0x37544d[_0x6f04('0x2d')]=qs['offset'](_0x285bb0[_0x6f04('0x4a')][_0x6f04('0x2d')]);}_0x37544d[_0x6f04('0xb1')]=qs[_0x6f04('0x53')](_0x285bb0[_0x6f04('0x4a')]['sort']);_0x37544d[_0x6f04('0x54')]=qs[_0x6f04('0x4b')](_[_0x6f04('0xbc')](_0x285bb0[_0x6f04('0x4a')],_0x2ef438[_0x6f04('0x4b')]));_0x37544d[_0x6f04('0x54')][_0x6f04('0xc0')]=_0x2bafc5['id'];if(_0x285bb0[_0x6f04('0x4a')][_0x6f04('0x38')]){_0x37544d[_0x6f04('0x54')]=_['merge'](_0x37544d['where'],{'$or':_[_0x6f04('0x3a')](_0x37544d[_0x6f04('0x4d')],function(_0x2ccf92){var _0x4e2cdd={};_0x4e2cdd[_0x2ccf92]={'$like':'%'+_0x285bb0['query'][_0x6f04('0x38')]+'%'};return _0x4e2cdd;})});}_0x37544d=_[_0x6f04('0x55')]({},_0x37544d,_0x285bb0['options']);return db['MailInteraction'][_0x6f04('0x2c')]({'where':_0x37544d['where']})[_0x6f04('0x1f')](function(_0x4e65cc){_0x48e35f[_0x6f04('0x2c')]=_0x4e65cc;if(_0x285bb0[_0x6f04('0x4a')]['includeAll']){_0x37544d['include']=[{'all':!![]}];}return db[_0x6f04('0xc5')][_0x6f04('0x5d')](_0x37544d);})[_0x6f04('0x1f')](function(_0x35a260){_0x48e35f['rows']=_0x35a260;return _0x48e35f;});}})[_0x6f04('0x1f')](respondWithFilteredResult(_0x245668,_0x37544d))[_0x6f04('0x27')](handleError(_0x245668,null));};exports[_0x6f04('0xc6')]=function(_0x52883b,_0x1e735a,_0x1e5224){var _0x5ae361={};var _0x45c8f6={};var _0x3a929c;var _0x2c436c;return db[_0x6f04('0x44')][_0x6f04('0xb7')]({'where':{'id':_0x52883b[_0x6f04('0x5f')]['id']}})[_0x6f04('0x1f')](handleEntityNotFound(_0x1e735a,null))[_0x6f04('0x1f')](function(_0x4822d4){if(_0x4822d4){_0x3a929c=_0x4822d4;_0x45c8f6['model']=_[_0x6f04('0x48')](db[_0x6f04('0xc7')][_0x6f04('0x45')]);_0x45c8f6[_0x6f04('0x4a')]=_['keys'](_0x52883b[_0x6f04('0x4a')]);_0x45c8f6['filters']=_[_0x6f04('0x4c')](_0x45c8f6[_0x6f04('0x46')],_0x45c8f6[_0x6f04('0x4a')]);_0x5ae361[_0x6f04('0x4d')]=_['intersection'](_0x45c8f6[_0x6f04('0x46')],qs[_0x6f04('0x4e')](_0x52883b[_0x6f04('0x4a')][_0x6f04('0x4e')]));_0x5ae361['attributes']=_0x5ae361[_0x6f04('0x4d')]['length']?_0x5ae361[_0x6f04('0x4d')]:_0x45c8f6[_0x6f04('0x46')];_0x5ae361[_0x6f04('0xb1')]=qs[_0x6f04('0x53')](_0x52883b['query']['sort']);_0x5ae361[_0x6f04('0x54')]=qs[_0x6f04('0x4b')](_['pick'](_0x52883b[_0x6f04('0x4a')],_0x45c8f6[_0x6f04('0x4b')]));if(_0x52883b[_0x6f04('0x4a')][_0x6f04('0x38')]){_0x5ae361[_0x6f04('0x54')]=_['merge'](_0x5ae361[_0x6f04('0x54')],{'$or':_[_0x6f04('0x3a')](_0x5ae361['attributes'],function(_0x53df43){var _0x4ff7a9={};_0x4ff7a9[_0x53df43]={'$like':'%'+_0x52883b[_0x6f04('0x4a')][_0x6f04('0x38')]+'%'};return _0x4ff7a9;})});}_0x5ae361=_[_0x6f04('0x55')]({},_0x5ae361,_0x52883b['options']);return _0x3a929c['getSmsInteractions'](_0x5ae361);}})[_0x6f04('0x1f')](function(_0x124b3e){if(_0x124b3e){_0x2c436c=_0x124b3e[_0x6f04('0x4f')];if(!_0x52883b[_0x6f04('0x4a')][_0x6f04('0x50')](_0x6f04('0x51'))){_0x5ae361[_0x6f04('0x52')]=qs[_0x6f04('0x52')](_0x52883b[_0x6f04('0x4a')][_0x6f04('0x52')]);_0x5ae361['offset']=qs['offset'](_0x52883b[_0x6f04('0x4a')]['offset']);}return _0x3a929c[_0x6f04('0xc6')](_0x5ae361);}})[_0x6f04('0x1f')](function(_0x1b3f74){if(_0x1b3f74){return _0x1b3f74?{'count':_0x2c436c,'rows':_0x1b3f74}:null;}})[_0x6f04('0x1f')](respondWithResult(_0x1e735a,null))[_0x6f04('0x27')](handleError(_0x1e735a,null));};exports[_0x6f04('0xc8')]=function(_0x13c62b,_0x1f9d3a,_0x5277fc){var _0x37b9dc={};var _0x2b1f77={};var _0x175287;var _0x1c0185;return db[_0x6f04('0x44')][_0x6f04('0xb7')]({'where':{'id':_0x13c62b[_0x6f04('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1f9d3a,null))[_0x6f04('0x1f')](function(_0xba5237){if(_0xba5237){_0x175287=_0xba5237;_0x2b1f77[_0x6f04('0x46')]=_['keys'](db[_0x6f04('0xc9')]['rawAttributes']);_0x2b1f77[_0x6f04('0x4a')]=_[_0x6f04('0x48')](_0x13c62b[_0x6f04('0x4a')]);_0x2b1f77['filters']=_[_0x6f04('0x4c')](_0x2b1f77[_0x6f04('0x46')],_0x2b1f77['query']);_0x37b9dc[_0x6f04('0x4d')]=_['intersection'](_0x2b1f77[_0x6f04('0x46')],qs['fields'](_0x13c62b[_0x6f04('0x4a')][_0x6f04('0x4e')]));_0x37b9dc[_0x6f04('0x4d')]=_0x37b9dc['attributes'][_0x6f04('0x4f')]?_0x37b9dc[_0x6f04('0x4d')]:_0x2b1f77[_0x6f04('0x46')];_0x37b9dc[_0x6f04('0xb1')]=qs['sort'](_0x13c62b[_0x6f04('0x4a')]['sort']);_0x37b9dc[_0x6f04('0x54')]=qs['filters'](_[_0x6f04('0xbc')](_0x13c62b[_0x6f04('0x4a')],_0x2b1f77[_0x6f04('0x4b')]));if(_0x13c62b[_0x6f04('0x4a')][_0x6f04('0x38')]){_0x37b9dc[_0x6f04('0x54')]=_[_0x6f04('0x55')](_0x37b9dc[_0x6f04('0x54')],{'$or':_['map'](_0x37b9dc['attributes'],function(_0x13958d){var _0x38c442={};_0x38c442[_0x13958d]={'$like':'%'+_0x13c62b[_0x6f04('0x4a')][_0x6f04('0x38')]+'%'};return _0x38c442;})});}_0x37b9dc=_['merge']({},_0x37b9dc,_0x13c62b['options']);return _0x175287[_0x6f04('0xc8')](_0x37b9dc);}})[_0x6f04('0x1f')](function(_0x2f61ea){if(_0x2f61ea){_0x1c0185=_0x2f61ea[_0x6f04('0x4f')];if(!_0x13c62b[_0x6f04('0x4a')][_0x6f04('0x50')]('nolimit')){_0x37b9dc[_0x6f04('0x52')]=qs['limit'](_0x13c62b['query'][_0x6f04('0x52')]);_0x37b9dc[_0x6f04('0x2d')]=qs['offset'](_0x13c62b[_0x6f04('0x4a')]['offset']);}return _0x175287['getFaxInteractions'](_0x37b9dc);}})[_0x6f04('0x1f')](function(_0x552058){if(_0x552058){return _0x552058?{'count':_0x1c0185,'rows':_0x552058}:null;}})[_0x6f04('0x1f')](respondWithResult(_0x1f9d3a,null))['catch'](handleError(_0x1f9d3a,null));};exports[_0x6f04('0xca')]=function(_0xfbdd6,_0x2eb89f,_0x5b5577){var _0x3e714b;var _0x57fdfd;var _0x167d8f;return db[_0x6f04('0x44')]['find']({'where':{'id':_0xfbdd6['params']['id'],'role':_0x6f04('0x35')},'attributes':['id',_0x6f04('0x41'),_0x6f04('0xcb'),_0x6f04('0xcc'),_0x6f04('0x3d'),_0x6f04('0x6f'),_0x6f04('0x91')]})[_0x6f04('0x1f')](handleEntityNotFound(_0x2eb89f,null))[_0x6f04('0x1f')](function(_0x3d17b2){if(_0x3d17b2){_0x3e714b=_0x3d17b2;if(_0xfbdd6[_0x6f04('0x61')]['interface']){_0x167d8f=util[_0x6f04('0x6c')](_0x6f04('0xcd'),_0x3e714b[_0xfbdd6[_0x6f04('0x61')][_0x6f04('0x93')]]);}else if(_0xfbdd6['body'][_0x6f04('0xce')]){_0x167d8f=util['format'](_0x6f04('0xa0'),_0xfbdd6[_0x6f04('0x61')][_0x6f04('0xce')]);}else{_0x167d8f=util[_0x6f04('0x6c')](_0x6f04('0xa0'),_0x3e714b[_0x6f04('0x41')]);}socket['to'](util['format']('user:%s',_0x3e714b['name']))[_0x6f04('0x9b')](_0x6f04('0xcf'),{'ip':_0xfbdd6[_0x6f04('0xd0')]['x-forwarded-for']||_0xfbdd6[_0x6f04('0xd1')][_0x6f04('0xd2')]||_0xfbdd6['socket']['remoteAddress']||_0xfbdd6[_0x6f04('0xd1')][_0x6f04('0xd3')]['remoteAddress']});return db[_0x6f04('0xa1')][_0x6f04('0x3f')]({'where':{'membername':_0x3e714b[_0x6f04('0x41')]},'individualHooks':!![]});}})[_0x6f04('0x1f')](function(_0x1d6946){if(_0x3e714b){return _0x3e714b[_0x6f04('0xd4')]({'raw':!![]});}})[_0x6f04('0x1f')](function(_0x2afb68){var _0x421986=[];if(_0x2afb68){_0x57fdfd=_0x2afb68;if(_0x57fdfd[_0x6f04('0x4f')]){for(var _0x2f7c5f=0x0;_0x2f7c5f<_0x57fdfd['length'];_0x2f7c5f++){_0x421986['push']({'membername':_0x3e714b[_0x6f04('0x41')],'UserId':_0x3e714b['id'],'queue_name':_0x57fdfd[_0x2f7c5f][_0x6f04('0x41')],'VoiceQueueId':_0x57fdfd[_0x2f7c5f]['id'],'interface':_0x167d8f,'paused':_0x3e714b[_0x6f04('0x91')]||![],'penalty':_0x57fdfd[_0x2f7c5f][_0x6f04('0xd5')]||0x0});}return BPromise['each'](_0x421986,function(_0xc226e2){return db['UserVoiceQueueRt'][_0x6f04('0xd6')](_0xc226e2);});}}})[_0x6f04('0x1f')](function(){return db[_0x6f04('0xd7')]['findAll']({'where':{'membername':_0x3e714b['name'],'exitAt':null}});})[_0x6f04('0x1f')](function(_0x28c90e){var _0x19ea5d=[];_0x28c90e[_0x6f04('0xd8')](function(_0x1af3d2){_0x19ea5d[_0x6f04('0x9f')](_0x1af3d2[_0x6f04('0x62')]({'exitAt':moment()[_0x6f04('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x19ea5d);})[_0x6f04('0x1f')](function(){var _0x3f6f74=[];var _0x280a8a=[];var _0x395426=utils[_0x6f04('0xd9')]();var _0x36ae49={'membername':_0x3e714b['name'],'interface':_0x167d8f,'enterAt':moment()[_0x6f04('0x6c')](_0x6f04('0xda')),'role':_0x3e714b[_0x6f04('0x3d')],'internal':_0x3e714b['internal']};_0x395426[_0x6f04('0xd8')](function(_0x414271){_0x3f6f74[_0x6f04('0x9f')](_[_0x6f04('0x55')]({'channel':_0x414271,'type':_0x6f04('0xdb'),'data1':_0xfbdd6[_0x6f04('0x61')][_0x6f04('0xdc')],'data2':_0x167d8f},_0x36ae49));if(_0x3e714b[_0x6f04('0x91')]){_0x280a8a[_0x6f04('0x9f')](_['merge']({'channel':_0x414271,'type':'PAUSE','data1':'LOGININPAUSE'},_0x36ae49));}});return db[_0x6f04('0xd7')][_0x6f04('0xdd')](_0x3f6f74[_0x6f04('0xde')](_0x280a8a),{'individualHooks':!![]});})[_0x6f04('0x1f')](function(){return _0x3e714b[_0x6f04('0x62')]({'online':!![],'lastLoginAt':moment()[_0x6f04('0x6c')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3e714b[_0x6f04('0x91')]||![],'mailPause':_0x3e714b['loginInPause']||![],'chatPause':_0x3e714b[_0x6f04('0x91')]||![],'faxPause':_0x3e714b[_0x6f04('0x91')]||![],'smsPause':_0x3e714b[_0x6f04('0x91')]||![],'openchannelPause':_0x3e714b['loginInPause']||![],'pauseType':_0x3e714b[_0x6f04('0x91')]?_0x6f04('0xdf'):null,'interface':_0x167d8f,'lastPauseAt':moment()['format'](_0x6f04('0xda'))});})[_0x6f04('0x1f')](respondWithResult(_0x2eb89f,null))[_0x6f04('0x27')](handleError(_0x2eb89f,null));};exports[_0x6f04('0xe0')]=function(_0x4a52f3,_0x5bacb8,_0x29c14b){var _0xa336d6;return db['User'][_0x6f04('0x3e')]({'where':{'id':_0x4a52f3['params']['id'],'role':_0x6f04('0x35')},'attributes':['id',_0x6f04('0x41'),_0x6f04('0x3d')]})[_0x6f04('0x1f')](handleEntityNotFound(_0x5bacb8,null))[_0x6f04('0x1f')](function(_0x400113){if(_0x400113){_0xa336d6=_0x400113;return db[_0x6f04('0xa1')]['destroy']({'where':{'membername':_0xa336d6[_0x6f04('0x41')]},'individualHooks':!![]});}})[_0x6f04('0x1f')](function(){return db[_0x6f04('0xd7')][_0x6f04('0x5d')]({'where':{'membername':_0xa336d6[_0x6f04('0x41')],'exitAt':null}});})[_0x6f04('0x1f')](function(_0x2ec705){var _0x1ba61f=[];_0x2ec705[_0x6f04('0xd8')](function(_0x2d5cf7){_0x1ba61f['push'](_0x2d5cf7[_0x6f04('0x62')]({'exitAt':moment()[_0x6f04('0x6c')](_0x6f04('0xda'))}));});return BPromise['all'](_0x1ba61f);})[_0x6f04('0x1f')](function(){return _0xa336d6['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x6f04('0x1f')](respondWithResult(_0x5bacb8,null))['catch'](handleError(_0x5bacb8,null));};exports[_0x6f04('0xe1')]=function(_0x32aa3d,_0x424c6b,_0x26672b){var _0x5c76d0;return db['UserVoiceQueueRt'][_0x6f04('0x62')]({'paused':0x1},{'where':{'UserId':_0x32aa3d[_0x6f04('0x5f')]['id']},'individualHooks':!![]})[_0x6f04('0x1f')](function(){return db[_0x6f04('0x44')]['find']({'where':{'id':_0x32aa3d[_0x6f04('0x5f')]['id'],'role':_0x6f04('0x35')},'attributes':['id',_0x6f04('0x41'),_0x6f04('0x3d'),_0x6f04('0x6f'),_0x6f04('0x93')]});})[_0x6f04('0x1f')](handleEntityNotFound(_0x424c6b,null))[_0x6f04('0x1f')](function(_0x1d5176){if(_0x1d5176){_0x5c76d0=_0x1d5176;return respondWithRpcPromise(_0x6f04('0xe2'),'pause',{'id':_0x5c76d0['id'],'name':_0x5c76d0[_0x6f04('0x41')],'pause':!![]});}})[_0x6f04('0x1f')](function(){if(_0x5c76d0){return db[_0x6f04('0xd7')][_0x6f04('0x5d')]({'where':{'membername':_0x5c76d0['name'],'type':'PAUSE','exitAt':null}});}})[_0x6f04('0x1f')](function(_0x106219){if(_0x106219[_0x6f04('0x4f')]){var _0x4f0035=moment()[_0x6f04('0x6c')](_0x6f04('0xda'));for(var _0x3880fd=0x0,_0xc33273=_0x106219[_0x6f04('0x4f')];_0x3880fd<_0xc33273;_0x3880fd++){_0x106219[_0x3880fd][_0x6f04('0xe3')]({'exitAt':_0x4f0035});}}})[_0x6f04('0x1f')](function(){var _0x2a1b1f=[];var _0x4fb811=utils[_0x6f04('0xd9')]();_0x4fb811[_0x6f04('0xd8')](function(_0x2081f6){_0x2a1b1f['push']({'channel':_0x2081f6,'membername':_0x5c76d0[_0x6f04('0x41')],'interface':_['isNil'](_0x5c76d0[_0x6f04('0x93')])?util[_0x6f04('0x6c')](_0x6f04('0xa0'),_0x5c76d0[_0x6f04('0x41')]):_0x5c76d0[_0x6f04('0x93')],'type':_0x6f04('0xe4'),'enterAt':moment()['format'](_0x6f04('0xda')),'data1':_0x32aa3d[_0x6f04('0x61')]['type']||_0x6f04('0xe5'),'role':_0x5c76d0['role'],'internal':_0x5c76d0[_0x6f04('0x6f')]});});return db[_0x6f04('0xd7')]['bulkCreate'](_0x2a1b1f,{'individualHooks':!![]});})[_0x6f04('0x1f')](function(){return _0x5c76d0[_0x6f04('0x62')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x32aa3d[_0x6f04('0x61')][_0x6f04('0xe6')]||_0x6f04('0xe5'),'lastPauseAt':moment()[_0x6f04('0x6c')](_0x6f04('0xda'))});})[_0x6f04('0x1f')](respondWithResult(_0x424c6b,null))['catch'](handleError(_0x424c6b,null));};exports['unpause']=function(_0x52893e,_0x22d69c,_0x48932c){var _0x11a1a5;return db[_0x6f04('0x44')][_0x6f04('0x3e')]({'where':{'id':_0x52893e[_0x6f04('0x5f')]['id']},'attributes':['id','name','role',_0x6f04('0x92'),_0x6f04('0xe7'),_0x6f04('0xe8'),_0x6f04('0xe9'),_0x6f04('0xea'),_0x6f04('0xeb'),'pauseType',_0x6f04('0xec')]})[_0x6f04('0x1f')](handleEntityNotFound(_0x22d69c,null))[_0x6f04('0x1f')](function(_0x5c96e0){if(_0x5c96e0){_0x11a1a5=_0x5c96e0;if(_0x52893e[_0x6f04('0x61')]['channel']&&!utils['isValidChannel'](_0x52893e[_0x6f04('0x61')][_0x6f04('0x95')])){throw new db[(_0x6f04('0x8a'))][(_0x6f04('0x8d'))]('Unknown\x20channel');}switch(_0x52893e[_0x6f04('0x61')]['channel']){case _0x6f04('0x9e'):return respondWithRpcPromise(_0x6f04('0xe2'),_0x6f04('0xed'),{'id':_0x11a1a5['id'],'name':_0x11a1a5[_0x6f04('0x41')],'pause':![]})['then'](function(){return db[_0x6f04('0xa1')]['update']({'paused':0x0},{'where':{'UserId':_0x11a1a5['id']},'individualHooks':!![]});})[_0x6f04('0x1f')](function(){return db[_0x6f04('0xd7')][_0x6f04('0x3e')]({'where':{'channel':_0x52893e['body'][_0x6f04('0x95')],'membername':_0x11a1a5[_0x6f04('0x41')],'type':_0x6f04('0xe4'),'exitAt':null}});})[_0x6f04('0x1f')](function(_0x23f05e){if(_0x23f05e){return _0x23f05e[_0x6f04('0x62')]({'exitAt':moment()['format'](_0x6f04('0xda')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x6f04('0x1f')](function(){return _0x11a1a5[_0x6f04('0x62')]({'voicePause':![]});});case'mail':case _0x6f04('0xee'):case _0x6f04('0xef'):case _0x6f04('0xf0'):case _0x6f04('0xf1'):return db[_0x6f04('0xd7')][_0x6f04('0x3e')]({'where':{'channel':_0x52893e[_0x6f04('0x61')][_0x6f04('0x95')],'membername':_0x11a1a5[_0x6f04('0x41')],'type':'PAUSE','exitAt':null}})['then'](function(_0x308cb7){if(_0x308cb7){return _0x308cb7['update']({'exitAt':moment()[_0x6f04('0x6c')](_0x6f04('0xda')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){var _0x449552={};_[_0x6f04('0x2e')](_0x449552,util[_0x6f04('0x6c')](_0x6f04('0xf2'),_0x52893e[_0x6f04('0x61')][_0x6f04('0x95')],_0x6f04('0xf3')),![]);return _0x11a1a5[_0x6f04('0x62')](_0x449552);});default:return respondWithRpcPromise(_0x6f04('0xe2'),_0x6f04('0xed'),{'id':_0x11a1a5['id'],'name':_0x11a1a5[_0x6f04('0x41')],'pause':![]})[_0x6f04('0x1f')](function(){return db[_0x6f04('0xa1')]['update']({'paused':0x0},{'where':{'UserId':_0x11a1a5['id']}});})[_0x6f04('0x1f')](function(){return db[_0x6f04('0xd7')][_0x6f04('0x5d')]({'where':{'membername':_0x11a1a5[_0x6f04('0x41')],'type':_0x6f04('0xe4'),'exitAt':null}});})[_0x6f04('0x1f')](function(_0x49da3e){var _0x10a4db=[];_0x49da3e[_0x6f04('0xd8')](function(_0x226d05){_0x10a4db['push'](_0x226d05[_0x6f04('0x62')]({'exitAt':moment()[_0x6f04('0x6c')](_0x6f04('0xda')),'data2':_0x6f04('0xf4')}));});return BPromise['all'](_0x10a4db);})[_0x6f04('0x1f')](function(){return _0x11a1a5['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x6f04('0x1f')](respondWithResult(_0x22d69c,null))[_0x6f04('0x27')](handleError(_0x22d69c,null));};exports[_0x6f04('0xf5')]=function(_0x1f0419,_0x3e7d4e,_0x1b3644){var _0x1b0611={};var _0x3d6fea={};var _0x3a45af;var _0x1ccd3c;return db['User'][_0x6f04('0xb7')]({'where':{'id':_0x1f0419[_0x6f04('0x5f')]['id']}})[_0x6f04('0x1f')](handleEntityNotFound(_0x3e7d4e,null))[_0x6f04('0x1f')](function(_0x1ad846){if(_0x1ad846){_0x3a45af=_0x1ad846;_0x3d6fea[_0x6f04('0x46')]=_[_0x6f04('0x48')](db[_0x6f04('0xf6')]['rawAttributes']);_0x3d6fea[_0x6f04('0x4a')]=_[_0x6f04('0x48')](_0x1f0419[_0x6f04('0x4a')]);_0x3d6fea[_0x6f04('0x4b')]=_['intersection'](_0x3d6fea[_0x6f04('0x46')],_0x3d6fea['query']);_0x1b0611[_0x6f04('0x4d')]=_[_0x6f04('0x4c')](_0x3d6fea[_0x6f04('0x46')],qs[_0x6f04('0x4e')](_0x1f0419[_0x6f04('0x4a')][_0x6f04('0x4e')]));_0x1b0611[_0x6f04('0x4d')]=_0x1b0611[_0x6f04('0x4d')][_0x6f04('0x4f')]?_0x1b0611['attributes']:_0x3d6fea[_0x6f04('0x46')];_0x1b0611[_0x6f04('0xb1')]=qs[_0x6f04('0x53')](_0x1f0419[_0x6f04('0x4a')][_0x6f04('0x53')]);_0x1b0611[_0x6f04('0x54')]=qs['filters'](_['pick'](_0x1f0419[_0x6f04('0x4a')],_0x3d6fea['filters']));if(_0x1f0419[_0x6f04('0x4a')][_0x6f04('0x38')]){_0x1b0611[_0x6f04('0x54')]=_['merge'](_0x1b0611['where'],{'$or':_[_0x6f04('0x3a')](_0x1b0611[_0x6f04('0x4d')],function(_0x3cb79e){var _0x5d2fc9={};_0x5d2fc9[_0x3cb79e]={'$like':'%'+_0x1f0419[_0x6f04('0x4a')]['filter']+'%'};return _0x5d2fc9;})});}_0x1b0611=_[_0x6f04('0x55')]({},_0x1b0611,_0x1f0419['options']);return _0x3a45af[_0x6f04('0xf5')](_0x1b0611);}})['then'](function(_0x4ca873){if(_0x4ca873){_0x1ccd3c=_0x4ca873[_0x6f04('0x4f')];if(!_0x1f0419[_0x6f04('0x4a')][_0x6f04('0x50')](_0x6f04('0x51'))){_0x1b0611[_0x6f04('0x52')]=qs[_0x6f04('0x52')](_0x1f0419[_0x6f04('0x4a')][_0x6f04('0x52')]);_0x1b0611['offset']=qs['offset'](_0x1f0419[_0x6f04('0x4a')][_0x6f04('0x2d')]);}return _0x3a45af[_0x6f04('0xf5')](_0x1b0611);}})['then'](function(_0x434896){if(_0x434896){return _0x434896?{'count':_0x1ccd3c,'rows':_0x434896}:null;}})['then'](respondWithResult(_0x3e7d4e,null))[_0x6f04('0x27')](handleError(_0x3e7d4e,null));};exports['addTeams']=function(_0x6d6b90,_0x3dbb02,_0x4eea31){return db[_0x6f04('0x44')][_0x6f04('0x3e')]({'where':{'id':_0x6d6b90[_0x6f04('0x5f')]['id']}})[_0x6f04('0x1f')](handleEntityNotFound(_0x3dbb02,null))[_0x6f04('0x1f')](function(_0x5e9d11){if(_0x5e9d11){return _0x5e9d11['addTeams'](_0x6d6b90[_0x6f04('0x61')][_0x6f04('0x65')],_[_0x6f04('0x66')](_0x6d6b90[_0x6f04('0x61')],['ids','id'])||{});}})[_0x6f04('0x1f')](respondWithResult(_0x3dbb02,null))[_0x6f04('0x27')](handleError(_0x3dbb02,null));};exports[_0x6f04('0xf7')]=function(_0x520afc,_0x5b2b3d,_0x5116b6){var _0x2bdbae;return db['User'][_0x6f04('0x3e')]({'where':{'id':_0x520afc[_0x6f04('0x5f')]['id']}})[_0x6f04('0x1f')](handleEntityNotFound(_0x5b2b3d,null))[_0x6f04('0x1f')](function(_0x1f0647){if(_0x1f0647){return _0x1f0647[_0x6f04('0xf7')](_0x520afc[_0x6f04('0x4a')][_0x6f04('0x65')]);}})['then'](respondWithStatusCode(_0x5b2b3d,null))[_0x6f04('0x27')](handleError(_0x5b2b3d,null));};exports[_0x6f04('0xf8')]=function(_0x2646aa,_0x2415a8,_0x4a5b31){var _0x20584b={};var _0x1a3a5d={};var _0x54a094;var _0x287f0f;return db[_0x6f04('0x44')][_0x6f04('0xb7')]({'where':{'id':_0x2646aa[_0x6f04('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2415a8,null))[_0x6f04('0x1f')](function(_0x33ff15){if(_0x33ff15){_0x54a094=_0x33ff15;_0x1a3a5d[_0x6f04('0x46')]=_['keys'](db[_0x6f04('0xf9')]['rawAttributes']);_0x1a3a5d[_0x6f04('0x4a')]=_[_0x6f04('0x48')](_0x2646aa[_0x6f04('0x4a')]);_0x1a3a5d[_0x6f04('0x4b')]=_[_0x6f04('0x4c')](_0x1a3a5d[_0x6f04('0x46')],_0x1a3a5d[_0x6f04('0x4a')]);_0x20584b[_0x6f04('0x4d')]=_['intersection'](_0x1a3a5d[_0x6f04('0x46')],qs[_0x6f04('0x4e')](_0x2646aa[_0x6f04('0x4a')]['fields']));_0x20584b[_0x6f04('0x4d')]=_0x20584b['attributes']['length']?_0x20584b['attributes']:_0x1a3a5d[_0x6f04('0x46')];_0x20584b['order']=qs[_0x6f04('0x53')](_0x2646aa[_0x6f04('0x4a')]['sort']);_0x20584b['where']=qs[_0x6f04('0x4b')](_[_0x6f04('0xbc')](_0x2646aa[_0x6f04('0x4a')],_0x1a3a5d[_0x6f04('0x4b')]));if(_0x2646aa['query']['filter']){_0x20584b['where']=_['merge'](_0x20584b[_0x6f04('0x54')],{'$or':_['map'](_0x20584b['attributes'],function(_0x56dd03){var _0x5ab91a={};_0x5ab91a[_0x56dd03]={'$like':'%'+_0x2646aa[_0x6f04('0x4a')]['filter']+'%'};return _0x5ab91a;})});}_0x20584b=_[_0x6f04('0x55')]({},_0x20584b,_0x2646aa[_0x6f04('0x5a')]);return _0x54a094[_0x6f04('0xf8')](_0x20584b);}})[_0x6f04('0x1f')](function(_0x3c449b){if(_0x3c449b){_0x287f0f=_0x3c449b[_0x6f04('0x4f')];if(!_0x2646aa[_0x6f04('0x4a')][_0x6f04('0x50')](_0x6f04('0x51'))){_0x20584b[_0x6f04('0x52')]=qs[_0x6f04('0x52')](_0x2646aa[_0x6f04('0x4a')][_0x6f04('0x52')]);_0x20584b[_0x6f04('0x2d')]=qs[_0x6f04('0x2d')](_0x2646aa['query'][_0x6f04('0x2d')]);}return _0x54a094[_0x6f04('0xf8')](_0x20584b);}})['then'](function(_0x5a63bc){if(_0x5a63bc){return _0x5a63bc?{'count':_0x287f0f,'rows':_0x5a63bc}:null;}})[_0x6f04('0x1f')](respondWithResult(_0x2415a8,null))[_0x6f04('0x27')](handleError(_0x2415a8,null));};exports['getAgents']=function(_0x423b9f,_0xd256c9,_0x2c1804){var _0x2cfcc4={};var _0xd325f9={};var _0x37d9ce;var _0x20ec79;return db['User']['findOne']({'where':{'id':_0x423b9f[_0x6f04('0x5f')]['id']}})['then'](handleEntityNotFound(_0xd256c9,null))[_0x6f04('0x1f')](function(_0x1fe622){if(_0x1fe622){_0x37d9ce=_0x1fe622;_0xd325f9[_0x6f04('0x46')]=_[_0x6f04('0x48')](db['User'][_0x6f04('0x45')]);_0xd325f9['query']=_[_0x6f04('0x48')](_0x423b9f[_0x6f04('0x4a')]);_0xd325f9['filters']=_['intersection'](_0xd325f9['model'],_0xd325f9['query']);_0x2cfcc4['attributes']=_[_0x6f04('0x4c')](_0xd325f9[_0x6f04('0x46')],qs[_0x6f04('0x4e')](_0x423b9f[_0x6f04('0x4a')][_0x6f04('0x4e')]));_0x2cfcc4[_0x6f04('0x4d')]=_0x2cfcc4[_0x6f04('0x4d')][_0x6f04('0x4f')]?_0x2cfcc4[_0x6f04('0x4d')]:_0xd325f9[_0x6f04('0x46')];_0x2cfcc4[_0x6f04('0xb1')]=qs[_0x6f04('0x53')](_0x423b9f['query'][_0x6f04('0x53')]);_0x2cfcc4[_0x6f04('0x54')]=qs[_0x6f04('0x4b')](_[_0x6f04('0xbc')](_0x423b9f['query'],_0xd325f9[_0x6f04('0x4b')]));if(_0x423b9f[_0x6f04('0x4a')][_0x6f04('0x38')]){_0x2cfcc4[_0x6f04('0x54')]=_[_0x6f04('0x55')](_0x2cfcc4['where'],{'$or':_[_0x6f04('0x3a')](_0x2cfcc4[_0x6f04('0x4d')],function(_0x5c6769){var _0x2adc9b={};_0x2adc9b[_0x5c6769]={'$like':'%'+_0x423b9f['query'][_0x6f04('0x38')]+'%'};return _0x2adc9b;})});}_0x2cfcc4[_0x6f04('0x46')]=db['User'];_0x2cfcc4['as']=_0x6f04('0x34');_0x2cfcc4=_[_0x6f04('0x55')]({},_0x2cfcc4,_0x423b9f['options']);return _0x37d9ce[_0x6f04('0xd4')]({'include':[_0x2cfcc4]});}})['then'](function(_0x494ec4){if(_0x494ec4){var _0x492b3e={},_0x4e7183=[],_0xce8953=0x0;for(var _0x30f6c4=0x0;_0x30f6c4<_0x494ec4[_0x6f04('0x4f')];_0x30f6c4+=0x1){for(var _0x2b966a=0x0,_0x2ae92b;_0x2b966a<_0x494ec4[_0x30f6c4][_0x6f04('0x34')][_0x6f04('0x4f')];_0x2b966a+=0x1){_0x2ae92b=_0x494ec4[_0x30f6c4][_0x6f04('0x34')][_0x2b966a][_0x6f04('0x32')]({'plain':!![]});_0x492b3e[_0x2ae92b['id']]=_0x2ae92b;}}_0x492b3e=_[_0x6f04('0xfa')](_0x492b3e);for(var _0x6dfe5e=qs[_0x6f04('0x2d')](_0x423b9f[_0x6f04('0x4a')][_0x6f04('0x2d')]);_0x6dfe5e<_0x492b3e[_0x6f04('0x4f')]&&_0x4e7183[_0x6f04('0x4f')]=_0x53ade7){_0xba780d=_0x53ade7;_0x12754e=0xc8;}else{_0x12754e=0xce;}_0x14ffbf[_0x19ce('0x2b')](_0x12754e);return _0x14ffbf[_0x19ce('0x31')](_0x19ce('0x32'),_0x4377da+'-'+_0xba780d+'/'+_0x53ade7)[_0x19ce('0x2d')](_0x5cd656);}return null;};}function patchUpdates(_0x5989b2){return function(_0xfe09ae){try{jsonpatch['apply'](_0xfe09ae,_0x5989b2,!![]);}catch(_0x140472){return BPromise[_0x19ce('0x33')](_0x140472);}return _0xfe09ae[_0x19ce('0x34')]();};}function saveUpdates(_0x4e64d2,_0x4411ac){return function(_0x51d250){if(_0x51d250){return _0x51d250[_0x19ce('0x35')](_0x4e64d2)[_0x19ce('0x20')](function(_0x3607ae){return _0x3607ae;});}return null;};}function removeEntity(_0x170f15,_0x3221f0){return function(_0x46eb0d){if(_0x46eb0d){return _0x46eb0d['destroy']()[_0x19ce('0x20')](function(){var _0x3be781=_0x46eb0d['get']({'plain':!![]});var _0x2f6b2f=[{'name':_0x19ce('0x36'),'value':_0x19ce('0x37'),'ignore':!![]},{'name':_0x19ce('0x38'),'value':'agent','ignore':![]},{'name':_0x19ce('0x39'),'value':'telephone','ignore':![]}];var _0x39c640=_(_0x2f6b2f)['filter'](_0x19ce('0x3a'))[_0x19ce('0x3b')](_0x19ce('0x3c'))[_0x19ce('0x3c')]();if(_[_0x19ce('0x3d')](_0x39c640,_0x3be781['role'])){return;}var _0x2b3b52=_[_0x19ce('0x3e')](_0x2f6b2f,[_0x19ce('0x3c'),_0x3be781[_0x19ce('0x3f')]])['name'];return db[_0x19ce('0x40')][_0x19ce('0x41')]({'where':{'type':_0x2b3b52,'resourceId':_0x3be781['id']}})['then'](function(){return _0x46eb0d;});})[_0x19ce('0x20')](function(){_0x170f15[_0x19ce('0x2b')](0xcc)[_0x19ce('0x2c')]();});}};}function handleEntityNotFound(_0x4b32fb,_0x452f6f){return function(_0x49fda4){if(!_0x49fda4){_0x4b32fb[_0x19ce('0x42')](0x194);}return _0x49fda4;};}function handleError(_0x3ea3c8,_0x3c89c6){_0x3c89c6=_0x3c89c6||0x1f4;return function(_0x411d51){logger[_0x19ce('0x26')](_0x411d51['stack']);if(_0x411d51['name']){delete _0x411d51['name'];}_0x3ea3c8[_0x19ce('0x2b')](_0x3c89c6)[_0x19ce('0x43')](_0x411d51);};}exports[_0x19ce('0x44')]=function(_0x2c8f99,_0x207e2d){var _0x215356={},_0x2dca70={},_0xb4a6d9={'count':0x0,'rows':[]};var _0x301006=db['User']['rawAttributes'];_0x2dca70['model']=_[_0x19ce('0x45')](_[_0x19ce('0x46')](_0x301006),[_0x19ce('0x47'),_0x19ce('0x48')]);_0x2dca70[_0x19ce('0x49')]=_[_0x19ce('0x46')](_0x2c8f99[_0x19ce('0x49')]);_0x2dca70[_0x19ce('0x4a')]=_['intersection'](_0x2dca70[_0x19ce('0x4b')],_0x2dca70[_0x19ce('0x49')]);_0x215356[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0x2dca70[_0x19ce('0x4b')],qs[_0x19ce('0x4e')](_0x2c8f99[_0x19ce('0x49')][_0x19ce('0x4e')]));_0x215356[_0x19ce('0x4c')]=_0x215356[_0x19ce('0x4c')][_0x19ce('0x4f')]?_0x215356[_0x19ce('0x4c')]:_0x2dca70['model'];if(!_0x2c8f99[_0x19ce('0x49')][_0x19ce('0x50')]('nolimit')){_0x215356[_0x19ce('0x30')]=qs[_0x19ce('0x30')](_0x2c8f99[_0x19ce('0x49')][_0x19ce('0x30')]);_0x215356[_0x19ce('0x2f')]=qs[_0x19ce('0x2f')](_0x2c8f99[_0x19ce('0x49')][_0x19ce('0x2f')]);}_0x215356[_0x19ce('0x51')]=qs['sort'](_0x2c8f99[_0x19ce('0x49')][_0x19ce('0x52')]);_0x215356[_0x19ce('0x53')]=qs[_0x19ce('0x4a')](_['pick'](_0x2c8f99[_0x19ce('0x49')],_0x2dca70[_0x19ce('0x4a')]));if(_0x2c8f99[_0x19ce('0x49')][_0x19ce('0x54')]){_0x215356[_0x19ce('0x53')]=_[_0x19ce('0x55')](_0x215356['where'],{'$or':_[_0x19ce('0x3b')](_0x301006,function(_0x3d35e9){return db['sequelize'][_0x19ce('0x53')](db['sequelize']['fn']('lower',db[_0x19ce('0x56')][_0x19ce('0x57')](_0x3d35e9[_0x19ce('0x58')])),{'$like':db[_0x19ce('0x56')]['fn']('lower','%'+_0x2c8f99['query']['filter']+'%')});})});}_0x215356=_['merge']({},_0x215356,_0x2c8f99['options']);var _0x376a3b={'where':_0x215356[_0x19ce('0x53')]};return db[_0x19ce('0x59')]['count'](_0x376a3b)[_0x19ce('0x20')](function(_0x376aff){_0xb4a6d9[_0x19ce('0x2e')]=_0x376aff;if(_0x2c8f99['query'][_0x19ce('0x5a')]){_0x215356['include']=[{'all':!![]}];}return db[_0x19ce('0x59')][_0x19ce('0x5b')](_0x215356);})[_0x19ce('0x20')](function(_0x25520f){_0xb4a6d9[_0x19ce('0x5c')]=_0x25520f;return _0xb4a6d9;})[_0x19ce('0x20')](respondWithFilteredResult(_0x207e2d,_0x215356))[_0x19ce('0x5d')](handleError(_0x207e2d,null));};exports[_0x19ce('0x5e')]=function(_0x458d33,_0x5072b9){var _0x32f9c0={'raw':![],'where':{'id':_0x458d33[_0x19ce('0x5f')]['id']}},_0x526550={};_0x526550[_0x19ce('0x4b')]=_[_0x19ce('0x45')](_[_0x19ce('0x46')](db[_0x19ce('0x59')]['rawAttributes']),[_0x19ce('0x47'),_0x19ce('0x48')]);_0x526550[_0x19ce('0x49')]=_[_0x19ce('0x46')](_0x458d33[_0x19ce('0x49')]);_0x526550[_0x19ce('0x4a')]=_['intersection'](_0x526550['model'],_0x526550[_0x19ce('0x49')]);_0x32f9c0[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0x526550[_0x19ce('0x4b')],qs[_0x19ce('0x4e')](_0x458d33[_0x19ce('0x49')][_0x19ce('0x4e')]));_0x32f9c0['attributes']=_0x32f9c0['attributes'][_0x19ce('0x4f')]?_0x32f9c0[_0x19ce('0x4c')]:_0x526550[_0x19ce('0x4b')];if(_0x458d33[_0x19ce('0x49')][_0x19ce('0x5a')]){_0x32f9c0['include']=[{'all':!![]}];}_0x32f9c0=_[_0x19ce('0x55')]({},_0x32f9c0,_0x458d33[_0x19ce('0x60')]);return db[_0x19ce('0x59')][_0x19ce('0x3e')](_0x32f9c0)[_0x19ce('0x20')](handleEntityNotFound(_0x5072b9,null))['then'](respondWithResult(_0x5072b9,null))['catch'](handleError(_0x5072b9,null));};exports['bulkCreate']=function(_0x518bb2,_0x45650f){return db[_0x19ce('0x59')][_0x19ce('0x61')](_0x518bb2[_0x19ce('0x62')],{'raw':![],'individualHooks':!![]})[_0x19ce('0x20')](respondWithResult(_0x45650f,0xc9))[_0x19ce('0x5d')](handleError(_0x45650f,null));};exports[_0x19ce('0x35')]=function(_0x1ab9c9,_0x356144){if(_0x1ab9c9['body']['id']){delete _0x1ab9c9[_0x19ce('0x62')]['id'];}return db[_0x19ce('0x59')][_0x19ce('0x3e')]({'where':{'id':_0x1ab9c9[_0x19ce('0x5f')]['id']}})['then'](handleEntityNotFound(_0x356144,null))[_0x19ce('0x20')](saveUpdates(_0x1ab9c9['body'],null))[_0x19ce('0x20')](respondWithResult(_0x356144,null))[_0x19ce('0x5d')](handleError(_0x356144,null));};exports[_0x19ce('0x63')]=function(_0x168710,_0x3c3465){return db[_0x19ce('0x59')][_0x19ce('0x63')]()[_0x19ce('0x20')](respondWithResult(_0x3c3465,null))[_0x19ce('0x5d')](handleError(_0x3c3465,null));};exports[_0x19ce('0x64')]=function(_0x4c2945,_0x40d6df,_0x2c5bd9){return db[_0x19ce('0x59')][_0x19ce('0x3e')]({'where':{'id':_0x4c2945[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x40d6df,null))[_0x19ce('0x20')](function(_0x13feac){if(_0x13feac){return _0x13feac[_0x19ce('0x64')](_0x4c2945[_0x19ce('0x62')][_0x19ce('0x65')],_[_0x19ce('0x66')](_0x4c2945[_0x19ce('0x62')],['ids','id'])||{});}})[_0x19ce('0x20')](respondWithResult(_0x40d6df,null))[_0x19ce('0x5d')](handleError(_0x40d6df,null));};var getLicense=function(_0x322e8d){return new BPromise(function(_0x5c97a9,_0x540162){var _0x2116fa=0x0;_0x322e8d['body'][_0x19ce('0x3f')]===_0x19ce('0x67')&&_0x5c97a9(_0x19ce('0x68'));return db[_0x19ce('0x59')][_0x19ce('0x2e')]({'where':{'$or':[{'role':_0x322e8d[_0x19ce('0x62')]['role']==='telephone'?'telephone':[_0x19ce('0x69'),_0x19ce('0x37')]}]}})[_0x19ce('0x20')](function(_0x3627c6){_0x2116fa=_0x3627c6;return require('../../config/license/util')[_0x19ce('0x6a')]();})[_0x19ce('0x20')](function(_0x352a5f){var _0x47db57=_0x322e8d[_0x19ce('0x62')]['role']===_0x19ce('0x6b')?'telephones':_0x19ce('0x6c');if(!_[_0x19ce('0x6d')](_0x352a5f[_0x47db57])&&_0x2116fa>=_0x352a5f[_0x47db57]){return _0x540162({'message':_0x19ce('0x6e')});}return _0x5c97a9(util[_0x19ce('0x6f')](_0x19ce('0x70'),_0x47db57,_0x2116fa));})[_0x19ce('0x5d')](function(_0x10bc68){return _0x540162(_0x10bc68);});});};exports['create']=function(_0x3664e0,_0x41fd47){return getLicense(_0x3664e0)[_0x19ce('0x20')](function(_0x4fc0a9){if(!_0x3664e0['body'][_0x19ce('0x71')]){var _0x181669;return db[_0x19ce('0x72')][_0x19ce('0x73')](0x1)[_0x19ce('0x20')](function(_0x39c72d){_0x181669=_0x39c72d[_0x19ce('0x74')];return db['User'][_0x19ce('0x75')]('internal');})[_0x19ce('0x20')](function(_0xefc516){if(_['isNil'](_0xefc516)){if(_0x181669){_0x3664e0['body'][_0x19ce('0x71')]=_0x181669;}else{_0x3664e0[_0x19ce('0x62')][_0x19ce('0x71')]=0x1;}}else{if(_[_0x19ce('0x6d')](_0x181669)||_0x181669==_0xefc516){_0x3664e0[_0x19ce('0x62')]['internal']=_0xefc516+0x1;}else if(_0x181669>_0xefc516){_0x3664e0['body'][_0x19ce('0x71')]=_0x181669;}else{return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x19ce('0x56')][_0x19ce('0x76')][_0x19ce('0x77')]})[_0x19ce('0x20')](function(_0x4b27f5){if(_0x4b27f5&&_0x4b27f5[_0x19ce('0x4f')]){for(var _0x3dad06=0x0,_0xf54ada=_0x4b27f5[_0x19ce('0x4f')];_0x3dad06<_0xf54ada&&_[_0x19ce('0x6d')](_0x3664e0['body'][_0x19ce('0x71')]);_0x3dad06++){if(_0x181669<=_0x4b27f5[_0x3dad06][_0x19ce('0x78')]){_0x3664e0['body']['internal']=_0x4b27f5[_0x3dad06][_0x19ce('0x78')];}else if(_0x181669>_0x4b27f5[_0x3dad06][_0x19ce('0x78')]&&_0x181669<=_0x4b27f5[_0x3dad06]['to']){_0x3664e0[_0x19ce('0x62')][_0x19ce('0x71')]=_0x181669;}}}if(_['isNil'](_0x3664e0[_0x19ce('0x62')][_0x19ce('0x71')])){_0x3664e0[_0x19ce('0x62')]['internal']=_0xefc516+0x1;}});}}});}})[_0x19ce('0x20')](function(){if(_0x3664e0['body'][_0x19ce('0x79')]){_0x3664e0[_0x19ce('0x62')][_0x19ce('0x7a')]=_0x3664e0[_0x19ce('0x62')][_0x19ce('0x71')];_0x3664e0[_0x19ce('0x62')]['VoiceMail']={'mailbox':_0x3664e0[_0x19ce('0x62')][_0x19ce('0x71')],'password':_0x3664e0[_0x19ce('0x62')]['password'],'fullname':_0x3664e0['body'][_0x19ce('0x7b')],'email':_0x3664e0[_0x19ce('0x62')][_0x19ce('0x7c')]};}if(_0x3664e0[_0x19ce('0x62')]&&_0x3664e0['body'][_0x19ce('0x3f')]===_0x19ce('0x67')){_0x3664e0[_0x19ce('0x62')]['permissions']=[_0x19ce('0x7d'),_0x19ce('0x7e'),_0x19ce('0x7f'),_0x19ce('0x80'),_0x19ce('0x81'),'105',_0x19ce('0x82'),_0x19ce('0x83'),_0x19ce('0x84'),_0x19ce('0x85'),'100',_0x19ce('0x86')];}return db[_0x19ce('0x59')][_0x19ce('0x87')](_0x3664e0[_0x19ce('0x62')],{'include':[{'model':db[_0x19ce('0x88')],'as':_0x19ce('0x88')}]});})[_0x19ce('0x20')](function(_0x268f55){if(_0x3664e0[_0x19ce('0x62')][_0x19ce('0x3f')]===_0x19ce('0x37'))return _0x268f55;var _0x502ed3=_0x3664e0[_0x19ce('0x37')][_0x19ce('0x89')]({'plain':!![]});if(!_0x502ed3)throw new Error(_0x19ce('0x8a'));if(_0x502ed3[_0x19ce('0x3f')]==='user'){var _0x3e6ed1=_0x268f55[_0x19ce('0x89')]({'plain':!![]});var _0x5549e7=[{'name':_0x19ce('0x38'),'value':_0x19ce('0x67')},{'name':'Telephones','value':_0x19ce('0x6b')}];var _0x383138=_['find'](_0x5549e7,[_0x19ce('0x3c'),_0x3e6ed1[_0x19ce('0x3f')]])[_0x19ce('0x8b')];return db['UserProfileSection'][_0x19ce('0x3e')]({'where':{'name':_0x383138,'userProfileId':_0x502ed3[_0x19ce('0x8c')]},'raw':!![]})[_0x19ce('0x20')](function(_0x103f85){if(_0x103f85&&_0x103f85['autoAssociation']===0x0){return db[_0x19ce('0x40')][_0x19ce('0x87')]({'name':_0x3e6ed1[_0x19ce('0x8b')],'resourceId':_0x3e6ed1['id'],'type':_0x103f85['name'],'sectionId':_0x103f85['id']},{})[_0x19ce('0x20')](function(){return _0x268f55;});}else{return _0x268f55;}})['catch'](function(_0x1ac4b1){logger[_0x19ce('0x26')](_0x19ce('0x8d'),_0x1ac4b1);throw _0x1ac4b1;});}return _0x268f55;})['then'](respondWithResult(_0x41fd47,0xc9))['catch'](handleError(_0x41fd47,null));};exports[_0x19ce('0x8e')]=function(_0x3358b3,_0x5e417a,_0x4403d1){if(_0x3358b3[_0x19ce('0x62')]['id']){delete _0x3358b3[_0x19ce('0x62')]['id'];}return db[_0x19ce('0x59')][_0x19ce('0x3e')]({'where':{'id':_0x3358b3[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](function(_0x54d9dc){if(_0x54d9dc){if(_0x54d9dc['id']==_0x3358b3['user']['id']){if(!_0x3358b3['body'][_0x19ce('0x8f')]||!_0x3358b3[_0x19ce('0x62')][_0x19ce('0x90')]){throw new db['Sequelize'][(_0x19ce('0x91'))](_0x19ce('0x92'));}if(!_0x54d9dc['authenticate'](_0x3358b3[_0x19ce('0x62')][_0x19ce('0x8f')])){throw new db[(_0x19ce('0x93'))][(_0x19ce('0x91'))](_0x19ce('0x94'));}if(_0x3358b3[_0x19ce('0x62')]['oldPassword']==_0x3358b3[_0x19ce('0x62')][_0x19ce('0x90')]){throw new db['Sequelize'][(_0x19ce('0x91'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x54d9dc;}else if(_0x3358b3[_0x19ce('0x37')][_0x19ce('0x3f')]==_0x19ce('0x69')){if(!_0x3358b3[_0x19ce('0x62')][_0x19ce('0x90')]){throw new db[(_0x19ce('0x93'))][(_0x19ce('0x91'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x54d9dc;}else if(_0x3358b3[_0x19ce('0x37')][_0x19ce('0x3f')]==_0x19ce('0x37')){if(!_0x3358b3[_0x19ce('0x62')][_0x19ce('0x90')]){throw new db[(_0x19ce('0x93'))][(_0x19ce('0x91'))](_0x19ce('0x95'));}if(_0x54d9dc[_0x19ce('0x3f')]!=_0x19ce('0x67')){throw new db[(_0x19ce('0x93'))]['ValidationError']('Unauthorized');}return _0x54d9dc;}else{throw new db[(_0x19ce('0x93'))][(_0x19ce('0x91'))](_0x19ce('0x96'));}}return null;})[_0x19ce('0x20')](handleEntityNotFound(_0x5e417a,null))[_0x19ce('0x20')](saveUpdates({'password':_0x3358b3[_0x19ce('0x62')][_0x19ce('0x90')],'passwordResetAt':_0x3358b3['user']['id']==_0x3358b3[_0x19ce('0x5f')]['id']?moment():null},null))[_0x19ce('0x20')](respondWithResult(_0x5e417a,null))['catch'](handleError(_0x5e417a,null));};exports[_0x19ce('0x97')]=function(_0x46eb68,_0x39e2f4,_0x261107){var _0x29a768;return db[_0x19ce('0x59')][_0x19ce('0x3e')]({'where':{'id':_0x46eb68[_0x19ce('0x5f')]['id']},'attributes':['id',_0x19ce('0x8b'),'role',_0x19ce('0x98'),_0x19ce('0x99'),_0x19ce('0x9a')]})['then'](handleEntityNotFound(_0x39e2f4,null))['then'](function(_0x318e51){if(_0x318e51){_0x29a768=_0x318e51;if(!utils['isValidChannel'](_0x46eb68['body'][_0x19ce('0x9b')])){throw new db['Sequelize'][(_0x19ce('0x91'))](_0x19ce('0x9c'));}return _0x318e51['add'+_['capitalize'](_0x46eb68[_0x19ce('0x62')][_0x19ce('0x9b')][_0x19ce('0x9d')]())+_0x19ce('0x9e')](_0x46eb68[_0x19ce('0x62')][_0x19ce('0x65')],{'penalty':_0x46eb68[_0x19ce('0x62')][_0x19ce('0x9f')]||0x0});}})[_0x19ce('0xa0')](function(_0x541e34){for(var _0x141f04=0x0;_0x141f04<_0x46eb68[_0x19ce('0x62')][_0x19ce('0x65')][_0x19ce('0x4f')];_0x141f04+=0x1){var _0x5e28a8={'UserId':_0x46eb68[_0x19ce('0x5f')]['id']};_0x5e28a8[_['capitalize'](_0x46eb68[_0x19ce('0x62')][_0x19ce('0x9b')]['toLowerCase']())+'QueueId']=_0x46eb68[_0x19ce('0x62')][_0x19ce('0x65')][_0x141f04];socket[_0x19ce('0xa1')](_0x19ce('0x37')+_['capitalize'](_0x46eb68['body'][_0x19ce('0x9b')][_0x19ce('0x9d')]())+'Queue:save',_0x5e28a8);}return _0x541e34;})[_0x19ce('0x20')](function(){if(_0x46eb68['body'][_0x19ce('0x9b')]===_0x19ce('0xa2')){return db[_0x19ce('0xa3')][_0x19ce('0x5b')]({'where':{'id':_0x46eb68[_0x19ce('0x62')]['ids']||[]},'raw':!![],'attributes':['id',_0x19ce('0x8b')]});}})['then'](function(_0x3a36d7){var _0x516ea1=[];if(_0x46eb68[_0x19ce('0x62')][_0x19ce('0x9b')]==='voice'&&_0x29a768['role']==='agent'){for(var _0xa32f1f=0x0;_0xa32f1f<_0x3a36d7[_0x19ce('0x4f')];_0xa32f1f+=0x1){_0x516ea1['push']({'membername':_0x29a768[_0x19ce('0x8b')],'UserId':_0x29a768['id'],'queue_name':_0x3a36d7[_0xa32f1f][_0x19ce('0x8b')],'VoiceQueueId':_0x3a36d7[_0xa32f1f]['id'],'interface':_[_0x19ce('0x6d')](_0x29a768[_0x19ce('0x9a')])?util[_0x19ce('0x6f')](_0x19ce('0xa4'),_0x29a768[_0x19ce('0x8b')]):_0x29a768[_0x19ce('0x9a')],'paused':_0x29a768['voicePause']||![],'penalty':_0x46eb68['body'][_0x19ce('0x9f')]||0x0});}return BPromise['each'](_0x516ea1,function(_0x5d15b8){return db[_0x19ce('0xa5')][_0x19ce('0xa6')](_0x5d15b8);});}return _0x29a768;})[_0x19ce('0x20')](respondWithStatusCode(_0x39e2f4,null))[_0x19ce('0x5d')](handleError(_0x39e2f4,null));};exports[_0x19ce('0xa7')]=function(_0x10ae86,_0x99011e,_0x55eb9d){var _0x12cd69;return db[_0x19ce('0x59')][_0x19ce('0x3e')]({'where':{'id':_0x10ae86[_0x19ce('0x5f')]['id']},'attributes':['id',_0x19ce('0x8b'),_0x19ce('0x3f')]})['then'](handleEntityNotFound(_0x99011e,null))[_0x19ce('0x20')](function(_0x1ca6de){if(_0x1ca6de){_0x12cd69=_0x1ca6de;if(!_0x10ae86[_0x19ce('0x49')][_0x19ce('0x9b')]||!utils['isValidChannel'](_0x10ae86['query'][_0x19ce('0x9b')])){throw new db['Sequelize'][(_0x19ce('0x91'))](_0x19ce('0x9c'));}return _0x1ca6de['remove'+_[_0x19ce('0xa8')](_0x10ae86['query']['channel']['toLowerCase']())+_0x19ce('0x9e')](_0x10ae86['query'][_0x19ce('0x65')]);}})[_0x19ce('0x20')](function(_0xa706a0){for(var _0x1a796b=0x0;_0x1a796b<_0x10ae86[_0x19ce('0x49')][_0x19ce('0x65')][_0x19ce('0x4f')];_0x1a796b+=0x1){var _0xad4b87={'UserId':_0x10ae86['params']['id']};_0xad4b87[_[_0x19ce('0xa8')](_0x10ae86[_0x19ce('0x49')]['channel'][_0x19ce('0x9d')]())+_0x19ce('0xa9')]=_0x10ae86[_0x19ce('0x49')][_0x19ce('0x65')][_0x1a796b];socket[_0x19ce('0xa1')](_0x19ce('0x37')+_['capitalize'](_0x10ae86[_0x19ce('0x49')][_0x19ce('0x9b')][_0x19ce('0x9d')]())+_0x19ce('0xaa'),_0xad4b87);}return _0xa706a0;})[_0x19ce('0x20')](function(){if(_0x10ae86['query'][_0x19ce('0x9b')]===_0x19ce('0xa2')){return db[_0x19ce('0xa5')][_0x19ce('0x41')]({'where':{'UserId':_0x10ae86[_0x19ce('0x5f')]['id'],'VoiceQueueId':_0x10ae86[_0x19ce('0x49')][_0x19ce('0x65')]},'individualHooks':!![]})[_0x19ce('0x20')](function(){return _0x12cd69;});}return _0x12cd69;})['then'](respondWithStatusCode(_0x99011e,null))[_0x19ce('0x5d')](handleError(_0x99011e,null));};exports[_0x19ce('0xab')]=function(_0x5926af,_0x38b8ca,_0x1020fa){_0x5926af['body']['userpic']=_0x5926af[_0x19ce('0xac')][_0x19ce('0xad')];return db[_0x19ce('0x59')][_0x19ce('0x3e')]({'where':{'id':_0x5926af[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x38b8ca,null))[_0x19ce('0x20')](saveUpdates(_0x5926af[_0x19ce('0x62')],null))[_0x19ce('0x20')](respondWithResult(_0x38b8ca,null))[_0x19ce('0x5d')](handleError(_0x38b8ca,null));};exports['getAvatar']=function(_0x26ca78,_0xf33db4,_0x5ec593){var _0xd1f7f6=path[_0x19ce('0xae')](config['root'],_0x19ce('0xaf'));return db[_0x19ce('0x59')]['find']({'where':{'id':_0x26ca78['params']['id']},'attributes':['id',_0x19ce('0xb0')],'raw':!![]})['then'](handleEntityNotFound(_0xf33db4,null))['then'](function(_0xc73650){if(_0xc73650){if(_['isNil'](_0xc73650[_0x19ce('0xb0')])){return _0xf33db4['download'](_0xd1f7f6);}else{if(!fs[_0x19ce('0xb1')](path['join'](config[_0x19ce('0xb2')],_0x19ce('0xb3'),_0xc73650[_0x19ce('0xb0')]))){return _0xf33db4[_0x19ce('0xb4')](_0xd1f7f6);}return _0xf33db4[_0x19ce('0xb4')](path[_0x19ce('0xae')](config['root'],_0x19ce('0xb3'),_0xc73650[_0x19ce('0xb0')]));}}})[_0x19ce('0x5d')](handleError(_0xf33db4,null));};exports['getContacts']=function(_0x595b40,_0x3828f4,_0xb31ab4){var _0x4fd58d={};var _0x3daeab={};var _0x14be03;var _0xa106ac;return db[_0x19ce('0x59')][_0x19ce('0xb5')]({'where':{'id':_0x595b40[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x3828f4,null))[_0x19ce('0x20')](function(_0x1b2484){if(_0x1b2484){_0x14be03=_0x1b2484;_0x3daeab[_0x19ce('0x4b')]=_[_0x19ce('0x46')](db[_0x19ce('0xb6')][_0x19ce('0xb7')]);_0x3daeab[_0x19ce('0x49')]=_[_0x19ce('0x46')](_0x595b40[_0x19ce('0x49')]);_0x3daeab[_0x19ce('0x4a')]=_[_0x19ce('0x4d')](_0x3daeab[_0x19ce('0x4b')],_0x3daeab['query']);_0x4fd58d['attributes']=_['intersection'](_0x3daeab[_0x19ce('0x4b')],qs['fields'](_0x595b40['query']['fields']));_0x4fd58d[_0x19ce('0x4c')]=_0x4fd58d['attributes'][_0x19ce('0x4f')]?_0x4fd58d['attributes']:_0x3daeab[_0x19ce('0x4b')];_0x4fd58d[_0x19ce('0x51')]=qs['sort'](_0x595b40[_0x19ce('0x49')][_0x19ce('0x52')]);_0x4fd58d[_0x19ce('0x53')]=qs[_0x19ce('0x4a')](_['pick'](_0x595b40[_0x19ce('0x49')],_0x3daeab[_0x19ce('0x4a')]));if(_0x595b40[_0x19ce('0x49')][_0x19ce('0x54')]){_0x4fd58d['where']=_[_0x19ce('0x55')](_0x4fd58d['where'],{'$or':_['map'](_0x4fd58d[_0x19ce('0x4c')],function(_0xc59518){var _0x1e1957={};_0x1e1957[_0xc59518]={'$like':'%'+_0x595b40[_0x19ce('0x49')]['filter']+'%'};return _0x1e1957;})});}_0x4fd58d=_[_0x19ce('0x55')]({},_0x4fd58d,_0x595b40['options']);return _0x14be03[_0x19ce('0xb8')](_0x4fd58d);}})[_0x19ce('0x20')](function(_0x430e35){if(_0x430e35){_0xa106ac=_0x430e35[_0x19ce('0x4f')];if(_0x595b40[_0x19ce('0x49')]['hasOwnProperty'](_0x19ce('0x5a'))){_0x4fd58d[_0x19ce('0xb9')]=[{'model':db['CmList'],'as':_0x19ce('0xba'),'required':![]},{'model':db['Tag'],'as':_0x19ce('0xbb'),'attributes':['id',_0x19ce('0x8b'),'color'],'where':_0x595b40[_0x19ce('0x49')][_0x19ce('0xbc')]?{'id':_0x595b40['query'][_0x19ce('0xbc')]}:undefined,'required':_0x595b40[_0x19ce('0x49')][_0x19ce('0xbc')]?!![]:![]}];}if(!_0x595b40[_0x19ce('0x49')][_0x19ce('0x50')](_0x19ce('0xbd'))){_0x4fd58d[_0x19ce('0x30')]=qs[_0x19ce('0x30')](_0x595b40[_0x19ce('0x49')][_0x19ce('0x30')]);_0x4fd58d['offset']=qs[_0x19ce('0x2f')](_0x595b40[_0x19ce('0x49')][_0x19ce('0x2f')]);}return _0x14be03[_0x19ce('0xb8')](_0x4fd58d);}})[_0x19ce('0x20')](function(_0x140091){if(_0x140091){return _0x140091?{'count':_0xa106ac,'rows':_0x140091}:null;}})['then'](respondWithResult(_0x3828f4,null))[_0x19ce('0x5d')](handleError(_0x3828f4,null));};exports[_0x19ce('0xbe')]=function(_0x384b9e,_0x5e8b0a,_0x584dea){var _0x55b564;var _0x528db3;var _0x1445c3={};var _0x44b4c8;return db['User'][_0x19ce('0xb5')]({'where':{'id':_0x384b9e[_0x19ce('0x5f')]['id']},'attributes':['id',_0x19ce('0x8b'),_0x19ce('0x3f')]})[_0x19ce('0x20')](handleEntityNotFound(_0x5e8b0a,null))[_0x19ce('0x20')](function(_0x49fea9){if(!utils[_0x19ce('0xbf')](_0x384b9e[_0x19ce('0x49')][_0x19ce('0x9b')])){throw new db[(_0x19ce('0x93'))][(_0x19ce('0x91'))](_0x19ce('0x9c'));}_0x55b564=_0x49fea9;var _0x5e6a4f={};_0x5e6a4f[_0x19ce('0x4b')]=_[_0x19ce('0x46')](db[_[_0x19ce('0xa8')](_0x384b9e[_0x19ce('0x49')][_0x19ce('0x9b')])+_0x19ce('0xc0')][_0x19ce('0xb7')]);_0x5e6a4f[_0x19ce('0x49')]=_[_0x19ce('0x46')](_0x384b9e[_0x19ce('0x49')]);_0x5e6a4f[_0x19ce('0x4a')]=_[_0x19ce('0x4d')](_0x5e6a4f[_0x19ce('0x4b')],_0x5e6a4f['query']);_0x1445c3[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0x5e6a4f[_0x19ce('0x4b')],qs[_0x19ce('0x4e')](_0x384b9e[_0x19ce('0x49')][_0x19ce('0x4e')]));_0x1445c3[_0x19ce('0x4c')]=_0x1445c3[_0x19ce('0x4c')][_0x19ce('0x4f')]?_0x1445c3['attributes']:_0x5e6a4f[_0x19ce('0x4b')];_0x1445c3[_0x19ce('0x51')]=qs[_0x19ce('0x52')](_0x384b9e['query']['sort']);_0x1445c3[_0x19ce('0x53')]=qs[_0x19ce('0x4a')](_[_0x19ce('0xc1')](_0x384b9e[_0x19ce('0x49')],_0x5e6a4f[_0x19ce('0x4a')]));if(_0x384b9e[_0x19ce('0x49')]['filter']){_0x1445c3[_0x19ce('0x53')]=_[_0x19ce('0x55')](_0x1445c3[_0x19ce('0x53')],{'$or':_[_0x19ce('0x3b')](_0x1445c3[_0x19ce('0x4c')],function(_0xf32c50){var _0xae5ed4={};_0xae5ed4[_0xf32c50]={'$like':'%'+_0x384b9e[_0x19ce('0x49')]['filter']+'%'};return _0xae5ed4;})});}_0x1445c3=_['merge']({},_0x1445c3,_0x384b9e[_0x19ce('0x60')]);switch(_0x55b564[_0x19ce('0x3f')]){case'admin':return db[_['capitalize'](_0x384b9e['query'][_0x19ce('0x9b')])+_0x19ce('0xc0')][_0x19ce('0x5b')](_0x1445c3);case _0x19ce('0x37'):case'agent':return _0x55b564[_0x19ce('0x89')+_[_0x19ce('0xa8')](_0x384b9e[_0x19ce('0x49')][_0x19ce('0x9b')])+_0x19ce('0x9e')](_0x1445c3);default:throw new db[(_0x19ce('0x93'))][(_0x19ce('0x91'))](_0x19ce('0xc2'));}})[_0x19ce('0x20')](function(_0x42cc6f){_0x44b4c8=_0x42cc6f['length'];if(!_0x384b9e[_0x19ce('0x49')][_0x19ce('0x50')]('nolimit')){_0x1445c3['limit']=qs['limit'](_0x384b9e[_0x19ce('0x49')]['limit']);_0x1445c3[_0x19ce('0x2f')]=qs[_0x19ce('0x2f')](_0x384b9e[_0x19ce('0x49')]['offset']);}switch(_0x55b564[_0x19ce('0x3f')]){case _0x19ce('0x69'):return db[_[_0x19ce('0xa8')](_0x384b9e[_0x19ce('0x49')]['channel'])+'Queue'][_0x19ce('0x5b')](_0x1445c3);case'user':case _0x19ce('0x67'):return _0x55b564[_0x19ce('0x89')+_[_0x19ce('0xa8')](_0x384b9e[_0x19ce('0x49')][_0x19ce('0x9b')])+_0x19ce('0x9e')](_0x1445c3);}})[_0x19ce('0x20')](function(_0x8b47c8){return{'count':_0x44b4c8,'rows':_0x8b47c8};})[_0x19ce('0x20')](respondWithResult(_0x5e8b0a,null))[_0x19ce('0x5d')](handleError(_0x5e8b0a,null));};exports['getVoiceQueuesRt']=function(_0x69fa9e,_0x9896b3,_0x253208){var _0x2f8285={};var _0x9b7b12={};var _0x4ca889;var _0x4b636e;return db[_0x19ce('0x59')]['findOne']({'where':{'id':_0x69fa9e['params']['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x9896b3,null))[_0x19ce('0x20')](function(_0x37ceed){if(_0x37ceed){_0x4ca889=_0x37ceed;_0x9b7b12[_0x19ce('0x4b')]=_['keys'](db['UserVoiceQueueRt'][_0x19ce('0xb7')]);_0x9b7b12[_0x19ce('0x49')]=_['keys'](_0x69fa9e[_0x19ce('0x49')]);_0x9b7b12[_0x19ce('0x4a')]=_[_0x19ce('0x4d')](_0x9b7b12[_0x19ce('0x4b')],_0x9b7b12[_0x19ce('0x49')]);_0x2f8285[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0x9b7b12['model'],qs[_0x19ce('0x4e')](_0x69fa9e['query'][_0x19ce('0x4e')]));_0x2f8285[_0x19ce('0x4c')]=_0x2f8285['attributes'][_0x19ce('0x4f')]?_0x2f8285[_0x19ce('0x4c')]:_0x9b7b12[_0x19ce('0x4b')];_0x2f8285['order']=qs[_0x19ce('0x52')](_0x69fa9e[_0x19ce('0x49')]['sort']);_0x2f8285[_0x19ce('0x53')]=qs[_0x19ce('0x4a')](_[_0x19ce('0xc1')](_0x69fa9e[_0x19ce('0x49')],_0x9b7b12[_0x19ce('0x4a')]));if(_0x69fa9e[_0x19ce('0x49')][_0x19ce('0x54')]){_0x2f8285[_0x19ce('0x53')]=_[_0x19ce('0x55')](_0x2f8285[_0x19ce('0x53')],{'$or':_[_0x19ce('0x3b')](_0x2f8285[_0x19ce('0x4c')],function(_0x5129b1){var _0x4182ac={};_0x4182ac[_0x5129b1]={'$like':'%'+_0x69fa9e['query']['filter']+'%'};return _0x4182ac;})});}_0x2f8285=_[_0x19ce('0x55')]({},_0x2f8285,_0x69fa9e[_0x19ce('0x60')]);return _0x4ca889[_0x19ce('0xc3')](_0x2f8285);}})[_0x19ce('0x20')](function(_0x43e126){if(_0x43e126){_0x4b636e=_0x43e126[_0x19ce('0x4f')];if(!_0x69fa9e['query'][_0x19ce('0x50')](_0x19ce('0xbd'))){_0x2f8285[_0x19ce('0x30')]=qs[_0x19ce('0x30')](_0x69fa9e[_0x19ce('0x49')][_0x19ce('0x30')]);_0x2f8285[_0x19ce('0x2f')]=qs[_0x19ce('0x2f')](_0x69fa9e[_0x19ce('0x49')][_0x19ce('0x2f')]);}return _0x4ca889['getVoiceQueuesRt'](_0x2f8285);}})[_0x19ce('0x20')](function(_0x28bc2f){if(_0x28bc2f){return _0x28bc2f?{'count':_0x4b636e,'rows':_0x28bc2f}:null;}})['then'](respondWithResult(_0x9896b3,null))[_0x19ce('0x5d')](handleError(_0x9896b3,null));};exports[_0x19ce('0xc4')]=function(_0x21a7cc,_0x300c7c,_0x3e4e1a){var _0x586705={};var _0x4a7853={};var _0x552ec1;var _0x5b05da;return db[_0x19ce('0x59')]['findOne']({'where':{'id':_0x21a7cc[_0x19ce('0x5f')]['id']}})['then'](handleEntityNotFound(_0x300c7c,null))[_0x19ce('0x20')](function(_0x21a76a){if(_0x21a76a){_0x552ec1=_0x21a76a;_0x4a7853[_0x19ce('0x4b')]=_[_0x19ce('0x46')](db['ChatGroup'][_0x19ce('0xb7')]);_0x4a7853[_0x19ce('0x49')]=_[_0x19ce('0x46')](_0x21a7cc[_0x19ce('0x49')]);_0x4a7853[_0x19ce('0x4a')]=_['intersection'](_0x4a7853[_0x19ce('0x4b')],_0x4a7853['query']);_0x586705['attributes']=_[_0x19ce('0x4d')](_0x4a7853[_0x19ce('0x4b')],qs[_0x19ce('0x4e')](_0x21a7cc['query'][_0x19ce('0x4e')]));_0x586705[_0x19ce('0x4c')]=_0x586705[_0x19ce('0x4c')][_0x19ce('0x4f')]?_0x586705[_0x19ce('0x4c')]:_0x4a7853['model'];_0x586705['order']=qs[_0x19ce('0x52')](_0x21a7cc['query'][_0x19ce('0x52')]);_0x586705[_0x19ce('0x53')]=qs[_0x19ce('0x4a')](_[_0x19ce('0xc1')](_0x21a7cc['query'],_0x4a7853['filters']));if(_0x21a7cc['query'][_0x19ce('0x54')]){_0x586705[_0x19ce('0x53')]=_[_0x19ce('0x55')](_0x586705[_0x19ce('0x53')],{'$or':_[_0x19ce('0x3b')](_0x586705[_0x19ce('0x4c')],function(_0x46f19b){var _0x1c4746={};_0x1c4746[_0x46f19b]={'$like':'%'+_0x21a7cc[_0x19ce('0x49')]['filter']+'%'};return _0x1c4746;})});}_0x586705=_[_0x19ce('0x55')]({},_0x586705,_0x21a7cc['options']);return _0x552ec1[_0x19ce('0xc4')](_0x586705);}})[_0x19ce('0x20')](function(_0x58aad6){if(_0x58aad6){_0x5b05da=_0x58aad6[_0x19ce('0x4f')];if(!_0x21a7cc[_0x19ce('0x49')][_0x19ce('0x50')](_0x19ce('0xbd'))){_0x586705[_0x19ce('0x30')]=qs[_0x19ce('0x30')](_0x21a7cc['query'][_0x19ce('0x30')]);_0x586705[_0x19ce('0x2f')]=qs[_0x19ce('0x2f')](_0x21a7cc[_0x19ce('0x49')][_0x19ce('0x2f')]);}return _0x552ec1['getGroups'](_0x586705);}})['then'](function(_0x4eb4e4){if(_0x4eb4e4){return _0x4eb4e4?{'count':_0x5b05da,'rows':_0x4eb4e4}:null;}})[_0x19ce('0x20')](respondWithResult(_0x300c7c,null))[_0x19ce('0x5d')](handleError(_0x300c7c,null));};exports[_0x19ce('0xc5')]=function(_0x4813cd,_0x2869f8,_0x27daa5){var _0xcf31f1={'raw':!![],'where':{}};var _0x1e02ff={};var _0x52d658={'count':0x0,'rows':[]};return db['User'][_0x19ce('0xb5')]({'where':{'id':_0x4813cd[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x2869f8,null))[_0x19ce('0x20')](function(_0x3feea8){if(_0x3feea8){_0x1e02ff['model']=_[_0x19ce('0x46')](db[_0x19ce('0xc6')][_0x19ce('0xb7')]);_0x1e02ff[_0x19ce('0x49')]=_[_0x19ce('0x46')](_0x4813cd[_0x19ce('0x49')]);_0x1e02ff[_0x19ce('0x4a')]=_[_0x19ce('0x4d')](_0x1e02ff[_0x19ce('0x4b')],_0x1e02ff[_0x19ce('0x49')]);_0xcf31f1[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0x1e02ff[_0x19ce('0x4b')],qs['fields'](_0x4813cd[_0x19ce('0x49')]['fields']));_0xcf31f1[_0x19ce('0x4c')]=_0xcf31f1[_0x19ce('0x4c')][_0x19ce('0x4f')]?_0xcf31f1[_0x19ce('0x4c')]:_0x1e02ff[_0x19ce('0x4b')];if(!_0x4813cd[_0x19ce('0x49')][_0x19ce('0x50')](_0x19ce('0xbd'))){_0xcf31f1['limit']=qs[_0x19ce('0x30')](_0x4813cd[_0x19ce('0x49')][_0x19ce('0x30')]);_0xcf31f1['offset']=qs['offset'](_0x4813cd['query']['offset']);}_0xcf31f1[_0x19ce('0x51')]=qs[_0x19ce('0x52')](_0x4813cd[_0x19ce('0x49')][_0x19ce('0x52')]);_0xcf31f1['where']=qs[_0x19ce('0x4a')](_[_0x19ce('0xc1')](_0x4813cd[_0x19ce('0x49')],_0x1e02ff[_0x19ce('0x4a')]));_0xcf31f1[_0x19ce('0x53')][_0x19ce('0xc7')]=_0x3feea8['id'];if(_0x4813cd[_0x19ce('0x49')][_0x19ce('0x54')]){_0xcf31f1['where']=_[_0x19ce('0x55')](_0xcf31f1[_0x19ce('0x53')],{'$or':_[_0x19ce('0x3b')](_0xcf31f1[_0x19ce('0x4c')],function(_0x2cfb22){var _0x4ab0e7={};_0x4ab0e7[_0x2cfb22]={'$like':'%'+_0x4813cd[_0x19ce('0x49')][_0x19ce('0x54')]+'%'};return _0x4ab0e7;})});}_0xcf31f1=_['merge']({},_0xcf31f1,_0x4813cd[_0x19ce('0x60')]);return db['VoiceRecording']['count']({'where':_0xcf31f1[_0x19ce('0x53')]})[_0x19ce('0x20')](function(_0x41b649){_0x52d658[_0x19ce('0x2e')]=_0x41b649;if(_0x4813cd['query'][_0x19ce('0x5a')]){_0xcf31f1['include']=[{'all':!![]}];}return db[_0x19ce('0xc6')][_0x19ce('0x5b')](_0xcf31f1);})[_0x19ce('0x20')](function(_0x56bade){_0x52d658[_0x19ce('0x5c')]=_0x56bade;return _0x52d658;});}})[_0x19ce('0x20')](respondWithFilteredResult(_0x2869f8,_0xcf31f1))[_0x19ce('0x5d')](handleError(_0x2869f8,null));};exports[_0x19ce('0xc8')]=function(_0x1084e2,_0x289383,_0x34f913){var _0x1b08c8={};var _0xb506e6={};var _0x540992;var _0x5f1837;return db[_0x19ce('0x59')][_0x19ce('0xb5')]({'where':{'id':_0x1084e2[_0x19ce('0x5f')]['id']}})['then'](handleEntityNotFound(_0x289383,null))['then'](function(_0x75361){if(_0x75361){_0x540992=_0x75361;_0xb506e6[_0x19ce('0x4b')]=_[_0x19ce('0x46')](db['ChatInteraction'][_0x19ce('0xb7')]);_0xb506e6[_0x19ce('0x49')]=_['keys'](_0x1084e2['query']);_0xb506e6[_0x19ce('0x4a')]=_[_0x19ce('0x4d')](_0xb506e6[_0x19ce('0x4b')],_0xb506e6['query']);_0x1b08c8[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0xb506e6['model'],qs[_0x19ce('0x4e')](_0x1084e2[_0x19ce('0x49')][_0x19ce('0x4e')]));_0x1b08c8[_0x19ce('0x4c')]=_0x1b08c8[_0x19ce('0x4c')][_0x19ce('0x4f')]?_0x1b08c8[_0x19ce('0x4c')]:_0xb506e6[_0x19ce('0x4b')];_0x1b08c8[_0x19ce('0x51')]=qs[_0x19ce('0x52')](_0x1084e2[_0x19ce('0x49')]['sort']);_0x1b08c8['where']=qs[_0x19ce('0x4a')](_[_0x19ce('0xc1')](_0x1084e2[_0x19ce('0x49')],_0xb506e6[_0x19ce('0x4a')]));if(_0x1084e2[_0x19ce('0x49')]['filter']){_0x1b08c8[_0x19ce('0x53')]=_[_0x19ce('0x55')](_0x1b08c8[_0x19ce('0x53')],{'$or':_[_0x19ce('0x3b')](_0x1b08c8[_0x19ce('0x4c')],function(_0x25dffc){var _0x59fd5e={};_0x59fd5e[_0x25dffc]={'$like':'%'+_0x1084e2[_0x19ce('0x49')][_0x19ce('0x54')]+'%'};return _0x59fd5e;})});}_0x1b08c8=_[_0x19ce('0x55')]({},_0x1b08c8,_0x1084e2[_0x19ce('0x60')]);return _0x540992[_0x19ce('0xc8')](_0x1b08c8);}})['then'](function(_0x2d636b){if(_0x2d636b){_0x5f1837=_0x2d636b['length'];if(!_0x1084e2['query'][_0x19ce('0x50')](_0x19ce('0xbd'))){_0x1b08c8[_0x19ce('0x30')]=qs[_0x19ce('0x30')](_0x1084e2[_0x19ce('0x49')][_0x19ce('0x30')]);_0x1b08c8[_0x19ce('0x2f')]=qs[_0x19ce('0x2f')](_0x1084e2['query'][_0x19ce('0x2f')]);}return _0x540992[_0x19ce('0xc8')](_0x1b08c8);}})[_0x19ce('0x20')](function(_0x4a4048){if(_0x4a4048){return _0x4a4048?{'count':_0x5f1837,'rows':_0x4a4048}:null;}})['then'](respondWithResult(_0x289383,null))[_0x19ce('0x5d')](handleError(_0x289383,null));};exports[_0x19ce('0xc9')]=function(_0x24cc29,_0x5dd79b,_0x40ca8b){var _0x168274={};var _0x1abdd3={};var _0x1e8f80;var _0x12a608;return db[_0x19ce('0x59')]['findOne']({'where':{'id':_0x24cc29[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x5dd79b,null))[_0x19ce('0x20')](function(_0x51b598){if(_0x51b598){_0x1e8f80=_0x51b598;_0x1abdd3[_0x19ce('0x4b')]=_[_0x19ce('0x46')](db[_0x19ce('0xca')][_0x19ce('0xb7')]);_0x1abdd3[_0x19ce('0x49')]=_['keys'](_0x24cc29[_0x19ce('0x49')]);_0x1abdd3['filters']=_[_0x19ce('0x4d')](_0x1abdd3['model'],_0x1abdd3[_0x19ce('0x49')]);_0x168274[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0x1abdd3[_0x19ce('0x4b')],qs['fields'](_0x24cc29[_0x19ce('0x49')][_0x19ce('0x4e')]));_0x168274[_0x19ce('0x4c')]=_0x168274['attributes']['length']?_0x168274['attributes']:_0x1abdd3[_0x19ce('0x4b')];_0x168274['order']=qs[_0x19ce('0x52')](_0x24cc29[_0x19ce('0x49')][_0x19ce('0x52')]);_0x168274['where']=qs[_0x19ce('0x4a')](_[_0x19ce('0xc1')](_0x24cc29[_0x19ce('0x49')],_0x1abdd3[_0x19ce('0x4a')]));if(_0x24cc29[_0x19ce('0x49')][_0x19ce('0x54')]){_0x168274[_0x19ce('0x53')]=_[_0x19ce('0x55')](_0x168274[_0x19ce('0x53')],{'$or':_[_0x19ce('0x3b')](_0x168274['attributes'],function(_0x58b801){var _0x31d1b9={};_0x31d1b9[_0x58b801]={'$like':'%'+_0x24cc29[_0x19ce('0x49')][_0x19ce('0x54')]+'%'};return _0x31d1b9;})});}_0x168274=_['merge']({},_0x168274,_0x24cc29[_0x19ce('0x60')]);return _0x1e8f80[_0x19ce('0xc9')](_0x168274);}})[_0x19ce('0x20')](function(_0x5a3c16){if(_0x5a3c16){_0x12a608=_0x5a3c16[_0x19ce('0x4f')];if(!_0x24cc29[_0x19ce('0x49')][_0x19ce('0x50')](_0x19ce('0xbd'))){_0x168274[_0x19ce('0x30')]=qs[_0x19ce('0x30')](_0x24cc29['query'][_0x19ce('0x30')]);_0x168274[_0x19ce('0x2f')]=qs['offset'](_0x24cc29['query'][_0x19ce('0x2f')]);}return _0x1e8f80['getOpenchannelInteractions'](_0x168274);}})[_0x19ce('0x20')](function(_0x4a1ec7){if(_0x4a1ec7){return _0x4a1ec7?{'count':_0x12a608,'rows':_0x4a1ec7}:null;}})['then'](respondWithResult(_0x5dd79b,null))[_0x19ce('0x5d')](handleError(_0x5dd79b,null));};exports[_0x19ce('0xcb')]=function(_0xd02576,_0x162ec1,_0x35c147){var _0xce36bb={'raw':!![],'where':{}};var _0x263529={};var _0x576618={'count':0x0,'rows':[]};return db[_0x19ce('0x59')]['findOne']({'where':{'id':_0xd02576['params']['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x162ec1,null))[_0x19ce('0x20')](function(_0x1f073f){if(_0x1f073f){_0x263529[_0x19ce('0x4b')]=_[_0x19ce('0x46')](db[_0x19ce('0xcc')][_0x19ce('0xb7')]);_0x263529[_0x19ce('0x49')]=_[_0x19ce('0x46')](_0xd02576[_0x19ce('0x49')]);_0x263529[_0x19ce('0x4a')]=_[_0x19ce('0x4d')](_0x263529[_0x19ce('0x4b')],_0x263529[_0x19ce('0x49')]);_0xce36bb[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0x263529[_0x19ce('0x4b')],qs['fields'](_0xd02576[_0x19ce('0x49')]['fields']));_0xce36bb[_0x19ce('0x4c')]=_0xce36bb[_0x19ce('0x4c')][_0x19ce('0x4f')]?_0xce36bb['attributes']:_0x263529['model'];if(!_0xd02576['query'][_0x19ce('0x50')](_0x19ce('0xbd'))){_0xce36bb['limit']=qs[_0x19ce('0x30')](_0xd02576['query'][_0x19ce('0x30')]);_0xce36bb['offset']=qs[_0x19ce('0x2f')](_0xd02576[_0x19ce('0x49')][_0x19ce('0x2f')]);}_0xce36bb[_0x19ce('0x51')]=qs[_0x19ce('0x52')](_0xd02576['query'][_0x19ce('0x52')]);_0xce36bb[_0x19ce('0x53')]=qs[_0x19ce('0x4a')](_[_0x19ce('0xc1')](_0xd02576[_0x19ce('0x49')],_0x263529['filters']));_0xce36bb['where']['UserId']=_0x1f073f['id'];if(_0xd02576[_0x19ce('0x49')][_0x19ce('0x54')]){_0xce36bb[_0x19ce('0x53')]=_['merge'](_0xce36bb[_0x19ce('0x53')],{'$or':_[_0x19ce('0x3b')](_0xce36bb[_0x19ce('0x4c')],function(_0x3ab969){var _0x10aaa7={};_0x10aaa7[_0x3ab969]={'$like':'%'+_0xd02576[_0x19ce('0x49')]['filter']+'%'};return _0x10aaa7;})});}_0xce36bb=_[_0x19ce('0x55')]({},_0xce36bb,_0xd02576[_0x19ce('0x60')]);return db[_0x19ce('0xcc')][_0x19ce('0x2e')]({'where':_0xce36bb[_0x19ce('0x53')]})['then'](function(_0xc12e2b){_0x576618[_0x19ce('0x2e')]=_0xc12e2b;if(_0xd02576['query'][_0x19ce('0x5a')]){_0xce36bb['include']=[{'all':!![]}];}return db[_0x19ce('0xcc')]['findAll'](_0xce36bb);})['then'](function(_0xea60c6){_0x576618[_0x19ce('0x5c')]=_0xea60c6;return _0x576618;});}})['then'](respondWithFilteredResult(_0x162ec1,_0xce36bb))[_0x19ce('0x5d')](handleError(_0x162ec1,null));};exports[_0x19ce('0xcd')]=function(_0x1c4b7b,_0x363069,_0x5620d7){var _0x2c2fb8={};var _0x139781={};var _0x50fa3c;var _0x52042a;return db[_0x19ce('0x59')][_0x19ce('0xb5')]({'where':{'id':_0x1c4b7b[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x363069,null))[_0x19ce('0x20')](function(_0x5b518c){if(_0x5b518c){_0x50fa3c=_0x5b518c;_0x139781['model']=_[_0x19ce('0x46')](db[_0x19ce('0xce')][_0x19ce('0xb7')]);_0x139781['query']=_[_0x19ce('0x46')](_0x1c4b7b[_0x19ce('0x49')]);_0x139781['filters']=_[_0x19ce('0x4d')](_0x139781[_0x19ce('0x4b')],_0x139781['query']);_0x2c2fb8[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0x139781['model'],qs[_0x19ce('0x4e')](_0x1c4b7b[_0x19ce('0x49')][_0x19ce('0x4e')]));_0x2c2fb8['attributes']=_0x2c2fb8[_0x19ce('0x4c')][_0x19ce('0x4f')]?_0x2c2fb8[_0x19ce('0x4c')]:_0x139781['model'];_0x2c2fb8[_0x19ce('0x51')]=qs[_0x19ce('0x52')](_0x1c4b7b['query'][_0x19ce('0x52')]);_0x2c2fb8[_0x19ce('0x53')]=qs[_0x19ce('0x4a')](_[_0x19ce('0xc1')](_0x1c4b7b[_0x19ce('0x49')],_0x139781['filters']));if(_0x1c4b7b['query'][_0x19ce('0x54')]){_0x2c2fb8[_0x19ce('0x53')]=_[_0x19ce('0x55')](_0x2c2fb8['where'],{'$or':_[_0x19ce('0x3b')](_0x2c2fb8[_0x19ce('0x4c')],function(_0x43eb11){var _0x5dca14={};_0x5dca14[_0x43eb11]={'$like':'%'+_0x1c4b7b[_0x19ce('0x49')]['filter']+'%'};return _0x5dca14;})});}_0x2c2fb8=_[_0x19ce('0x55')]({},_0x2c2fb8,_0x1c4b7b[_0x19ce('0x60')]);return _0x50fa3c[_0x19ce('0xcd')](_0x2c2fb8);}})['then'](function(_0x58c746){if(_0x58c746){_0x52042a=_0x58c746[_0x19ce('0x4f')];if(!_0x1c4b7b[_0x19ce('0x49')][_0x19ce('0x50')](_0x19ce('0xbd'))){_0x2c2fb8[_0x19ce('0x30')]=qs[_0x19ce('0x30')](_0x1c4b7b[_0x19ce('0x49')][_0x19ce('0x30')]);_0x2c2fb8[_0x19ce('0x2f')]=qs[_0x19ce('0x2f')](_0x1c4b7b['query'][_0x19ce('0x2f')]);}return _0x50fa3c['getSmsInteractions'](_0x2c2fb8);}})['then'](function(_0x2c5f18){if(_0x2c5f18){return _0x2c5f18?{'count':_0x52042a,'rows':_0x2c5f18}:null;}})[_0x19ce('0x20')](respondWithResult(_0x363069,null))['catch'](handleError(_0x363069,null));};exports['getFaxInteractions']=function(_0x1b1855,_0x42d26c,_0x53fb2e){var _0x692d24={};var _0x242349={};var _0x36e441;var _0x5cfdae;return db[_0x19ce('0x59')]['findOne']({'where':{'id':_0x1b1855[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x42d26c,null))[_0x19ce('0x20')](function(_0x46d791){if(_0x46d791){_0x36e441=_0x46d791;_0x242349[_0x19ce('0x4b')]=_['keys'](db['FaxInteraction'][_0x19ce('0xb7')]);_0x242349[_0x19ce('0x49')]=_['keys'](_0x1b1855[_0x19ce('0x49')]);_0x242349['filters']=_[_0x19ce('0x4d')](_0x242349['model'],_0x242349[_0x19ce('0x49')]);_0x692d24[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0x242349[_0x19ce('0x4b')],qs['fields'](_0x1b1855['query'][_0x19ce('0x4e')]));_0x692d24[_0x19ce('0x4c')]=_0x692d24['attributes'][_0x19ce('0x4f')]?_0x692d24[_0x19ce('0x4c')]:_0x242349[_0x19ce('0x4b')];_0x692d24[_0x19ce('0x51')]=qs[_0x19ce('0x52')](_0x1b1855[_0x19ce('0x49')][_0x19ce('0x52')]);_0x692d24[_0x19ce('0x53')]=qs[_0x19ce('0x4a')](_[_0x19ce('0xc1')](_0x1b1855[_0x19ce('0x49')],_0x242349[_0x19ce('0x4a')]));if(_0x1b1855[_0x19ce('0x49')][_0x19ce('0x54')]){_0x692d24['where']=_[_0x19ce('0x55')](_0x692d24[_0x19ce('0x53')],{'$or':_[_0x19ce('0x3b')](_0x692d24['attributes'],function(_0x5641f3){var _0xa17527={};_0xa17527[_0x5641f3]={'$like':'%'+_0x1b1855['query'][_0x19ce('0x54')]+'%'};return _0xa17527;})});}_0x692d24=_[_0x19ce('0x55')]({},_0x692d24,_0x1b1855[_0x19ce('0x60')]);return _0x36e441[_0x19ce('0xcf')](_0x692d24);}})[_0x19ce('0x20')](function(_0x289bb0){if(_0x289bb0){_0x5cfdae=_0x289bb0[_0x19ce('0x4f')];if(!_0x1b1855[_0x19ce('0x49')][_0x19ce('0x50')](_0x19ce('0xbd'))){_0x692d24['limit']=qs[_0x19ce('0x30')](_0x1b1855[_0x19ce('0x49')][_0x19ce('0x30')]);_0x692d24[_0x19ce('0x2f')]=qs['offset'](_0x1b1855[_0x19ce('0x49')][_0x19ce('0x2f')]);}return _0x36e441[_0x19ce('0xcf')](_0x692d24);}})[_0x19ce('0x20')](function(_0x30eede){if(_0x30eede){return _0x30eede?{'count':_0x5cfdae,'rows':_0x30eede}:null;}})['then'](respondWithResult(_0x42d26c,null))[_0x19ce('0x5d')](handleError(_0x42d26c,null));};exports[_0x19ce('0xd0')]=function(_0x51cdf9,_0x3d08b6,_0x1e8905){var _0x59b79a;var _0x53266a;var _0x13d68a;return db[_0x19ce('0x59')][_0x19ce('0x3e')]({'where':{'id':_0x51cdf9['params']['id'],'role':'agent'},'attributes':['id',_0x19ce('0x8b'),'phone','mobile',_0x19ce('0x3f'),_0x19ce('0x71'),_0x19ce('0x98')]})[_0x19ce('0x20')](handleEntityNotFound(_0x3d08b6,null))['then'](function(_0x15e2c3){if(_0x15e2c3){_0x59b79a=_0x15e2c3;if(_0x51cdf9['body']['interface']){_0x13d68a=util['format'](_0x19ce('0xd1'),_0x59b79a[_0x51cdf9[_0x19ce('0x62')][_0x19ce('0x9a')]]);}else if(_0x51cdf9['body']['intrf']){_0x13d68a=util['format'](_0x19ce('0xa4'),_0x51cdf9[_0x19ce('0x62')][_0x19ce('0xd2')]);}else{_0x13d68a=util[_0x19ce('0x6f')](_0x19ce('0xa4'),_0x59b79a['name']);}socket['to'](util[_0x19ce('0x6f')](_0x19ce('0xd3'),_0x59b79a[_0x19ce('0x8b')]))['emit'](_0x19ce('0xd4'),{'ip':_0x51cdf9[_0x19ce('0xd5')][_0x19ce('0xd6')]||_0x51cdf9[_0x19ce('0xd7')]['remoteAddress']||_0x51cdf9[_0x19ce('0xd8')][_0x19ce('0xd9')]||_0x51cdf9[_0x19ce('0xd7')][_0x19ce('0xd8')]['remoteAddress']});return db[_0x19ce('0xa5')][_0x19ce('0x41')]({'where':{'membername':_0x59b79a[_0x19ce('0x8b')]},'individualHooks':!![]});}})[_0x19ce('0x20')](function(_0x147bb4){if(_0x59b79a){return _0x59b79a['getVoiceQueues']({'raw':!![]});}})[_0x19ce('0x20')](function(_0x386bba){var _0x182b1c=[];if(_0x386bba){_0x53266a=_0x386bba;if(_0x53266a['length']){for(var _0x54563b=0x0;_0x54563b<_0x53266a['length'];_0x54563b++){_0x182b1c['push']({'membername':_0x59b79a[_0x19ce('0x8b')],'UserId':_0x59b79a['id'],'queue_name':_0x53266a[_0x54563b][_0x19ce('0x8b')],'VoiceQueueId':_0x53266a[_0x54563b]['id'],'interface':_0x13d68a,'paused':_0x59b79a[_0x19ce('0x98')]||![],'penalty':_0x53266a[_0x54563b][_0x19ce('0xda')]||0x0});}return BPromise['each'](_0x182b1c,function(_0x1e7a3b){return db[_0x19ce('0xa5')][_0x19ce('0xa6')](_0x1e7a3b);});}}})['then'](function(){return db[_0x19ce('0xdb')]['findAll']({'where':{'membername':_0x59b79a[_0x19ce('0x8b')],'exitAt':null}});})['then'](function(_0x46fec5){var _0x321f25=[];_0x46fec5[_0x19ce('0xdc')](function(_0x12cc67){_0x321f25[_0x19ce('0xdd')](_0x12cc67[_0x19ce('0x35')]({'exitAt':moment()[_0x19ce('0x6f')](_0x19ce('0xde'))}));});return BPromise['all'](_0x321f25);})[_0x19ce('0x20')](function(){var _0x32d9a9=[];var _0x3eab19=[];var _0x22093e=utils[_0x19ce('0xdf')]();var _0x381dc1={'membername':_0x59b79a[_0x19ce('0x8b')],'interface':_0x13d68a,'enterAt':moment()[_0x19ce('0x6f')](_0x19ce('0xde')),'role':_0x59b79a[_0x19ce('0x3f')],'internal':_0x59b79a[_0x19ce('0x71')]};_0x22093e[_0x19ce('0xdc')](function(_0x4db8c5){_0x32d9a9[_0x19ce('0xdd')](_['merge']({'channel':_0x4db8c5,'type':_0x19ce('0xe0'),'data1':_0x51cdf9[_0x19ce('0x62')][_0x19ce('0xe1')],'data2':_0x13d68a},_0x381dc1));if(_0x59b79a[_0x19ce('0x98')]){_0x3eab19[_0x19ce('0xdd')](_['merge']({'channel':_0x4db8c5,'type':'PAUSE','data1':_0x19ce('0xe2')},_0x381dc1));}});return db[_0x19ce('0xdb')][_0x19ce('0x61')](_0x32d9a9[_0x19ce('0xe3')](_0x3eab19),{'individualHooks':!![]});})[_0x19ce('0x20')](function(){return _0x59b79a[_0x19ce('0x35')]({'online':!![],'lastLoginAt':moment()['format'](_0x19ce('0xde')),'voicePause':_0x59b79a['loginInPause']||![],'mailPause':_0x59b79a[_0x19ce('0x98')]||![],'chatPause':_0x59b79a[_0x19ce('0x98')]||![],'faxPause':_0x59b79a['loginInPause']||![],'smsPause':_0x59b79a[_0x19ce('0x98')]||![],'openchannelPause':_0x59b79a['loginInPause']||![],'pauseType':_0x59b79a['loginInPause']?_0x19ce('0xe2'):null,'interface':_0x13d68a,'lastPauseAt':moment()[_0x19ce('0x6f')](_0x19ce('0xde'))});})[_0x19ce('0x20')](respondWithResult(_0x3d08b6,null))['catch'](handleError(_0x3d08b6,null));};exports[_0x19ce('0xe4')]=function(_0xe4f0e5,_0x25a604,_0x4851de){var _0x15f127;return db['User'][_0x19ce('0x3e')]({'where':{'id':_0xe4f0e5[_0x19ce('0x5f')]['id'],'role':_0x19ce('0x67')},'attributes':['id','name',_0x19ce('0x3f')]})[_0x19ce('0x20')](handleEntityNotFound(_0x25a604,null))['then'](function(_0x38d21b){if(_0x38d21b){_0x15f127=_0x38d21b;return db[_0x19ce('0xa5')][_0x19ce('0x41')]({'where':{'membername':_0x15f127[_0x19ce('0x8b')]},'individualHooks':!![]});}})[_0x19ce('0x20')](function(){return db[_0x19ce('0xdb')]['findAll']({'where':{'membername':_0x15f127[_0x19ce('0x8b')],'exitAt':null}});})['then'](function(_0x32b980){var _0x4e429d=[];_0x32b980['forEach'](function(_0x2b2b43){_0x4e429d[_0x19ce('0xdd')](_0x2b2b43['update']({'exitAt':moment()[_0x19ce('0x6f')](_0x19ce('0xde'))}));});return BPromise[_0x19ce('0xe5')](_0x4e429d);})['then'](function(){return _0x15f127[_0x19ce('0x35')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x19ce('0x20')](respondWithResult(_0x25a604,null))[_0x19ce('0x5d')](handleError(_0x25a604,null));};exports[_0x19ce('0xe6')]=function(_0x15d61b,_0x2c9b7f,_0x726026){var _0x42fd01;return db[_0x19ce('0xa5')][_0x19ce('0x35')]({'paused':0x1},{'where':{'UserId':_0x15d61b[_0x19ce('0x5f')]['id']},'individualHooks':!![]})[_0x19ce('0x20')](function(){return db['User'][_0x19ce('0x3e')]({'where':{'id':_0x15d61b[_0x19ce('0x5f')]['id'],'role':_0x19ce('0x67')},'attributes':['id','name',_0x19ce('0x3f'),_0x19ce('0x71'),'interface']});})[_0x19ce('0x20')](handleEntityNotFound(_0x2c9b7f,null))[_0x19ce('0x20')](function(_0x4bb1b5){if(_0x4bb1b5){_0x42fd01=_0x4bb1b5;return respondWithRpcPromise(_0x19ce('0xe7'),_0x19ce('0xe6'),{'id':_0x42fd01['id'],'name':_0x42fd01['name'],'pause':!![]});}})[_0x19ce('0x20')](function(){if(_0x42fd01){return db['MemberReport'][_0x19ce('0x5b')]({'where':{'membername':_0x42fd01[_0x19ce('0x8b')],'type':_0x19ce('0xe8'),'exitAt':null}});}})[_0x19ce('0x20')](function(_0x49cb4c){if(_0x49cb4c['length']){var _0x529009=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5d4f67=0x0,_0x312a63=_0x49cb4c['length'];_0x5d4f67<_0x312a63;_0x5d4f67++){_0x49cb4c[_0x5d4f67][_0x19ce('0xe9')]({'exitAt':_0x529009});}}})[_0x19ce('0x20')](function(){var _0x31864a=[];var _0x43e37b=utils[_0x19ce('0xdf')]();_0x43e37b['forEach'](function(_0x56f98e){_0x31864a['push']({'channel':_0x56f98e,'membername':_0x42fd01[_0x19ce('0x8b')],'interface':_[_0x19ce('0x6d')](_0x42fd01[_0x19ce('0x9a')])?util[_0x19ce('0x6f')](_0x19ce('0xa4'),_0x42fd01['name']):_0x42fd01[_0x19ce('0x9a')],'type':_0x19ce('0xe8'),'enterAt':moment()[_0x19ce('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x15d61b[_0x19ce('0x62')][_0x19ce('0xea')]||'DEFAULT\x20PAUSE','role':_0x42fd01['role'],'internal':_0x42fd01[_0x19ce('0x71')]});});return db[_0x19ce('0xdb')][_0x19ce('0x61')](_0x31864a,{'individualHooks':!![]});})['then'](function(){return _0x42fd01['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x15d61b['body'][_0x19ce('0xea')]||_0x19ce('0xeb'),'lastPauseAt':moment()[_0x19ce('0x6f')](_0x19ce('0xde'))});})[_0x19ce('0x20')](respondWithResult(_0x2c9b7f,null))[_0x19ce('0x5d')](handleError(_0x2c9b7f,null));};exports['unpause']=function(_0x5ed424,_0x5dc155,_0x37bbee){var _0x585ab6;return db[_0x19ce('0x59')][_0x19ce('0x3e')]({'where':{'id':_0x5ed424[_0x19ce('0x5f')]['id']},'attributes':['id',_0x19ce('0x8b'),_0x19ce('0x3f'),_0x19ce('0x99'),'mailPause',_0x19ce('0xec'),_0x19ce('0xed'),_0x19ce('0xee'),_0x19ce('0xef'),_0x19ce('0xf0'),_0x19ce('0xf1')]})['then'](handleEntityNotFound(_0x5dc155,null))[_0x19ce('0x20')](function(_0x23e77b){if(_0x23e77b){_0x585ab6=_0x23e77b;if(_0x5ed424['body']['channel']&&!utils[_0x19ce('0xbf')](_0x5ed424[_0x19ce('0x62')]['channel'])){throw new db[(_0x19ce('0x93'))][(_0x19ce('0x91'))](_0x19ce('0x9c'));}switch(_0x5ed424[_0x19ce('0x62')][_0x19ce('0x9b')]){case'voice':return respondWithRpcPromise('QueuePause',_0x19ce('0xf2'),{'id':_0x585ab6['id'],'name':_0x585ab6['name'],'pause':![]})['then'](function(){return db[_0x19ce('0xa5')][_0x19ce('0x35')]({'paused':0x0},{'where':{'UserId':_0x585ab6['id']},'individualHooks':!![]});})[_0x19ce('0x20')](function(){return db[_0x19ce('0xdb')]['find']({'where':{'channel':_0x5ed424[_0x19ce('0x62')][_0x19ce('0x9b')],'membername':_0x585ab6['name'],'type':'PAUSE','exitAt':null}});})[_0x19ce('0x20')](function(_0x8e7eb7){if(_0x8e7eb7){return _0x8e7eb7[_0x19ce('0x35')]({'exitAt':moment()[_0x19ce('0x6f')](_0x19ce('0xde')),'data2':_0x19ce('0xf3')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x585ab6[_0x19ce('0x35')]({'voicePause':![]});});case'mail':case _0x19ce('0xf4'):case _0x19ce('0xf5'):case _0x19ce('0xf6'):case _0x19ce('0xf7'):return db[_0x19ce('0xdb')][_0x19ce('0x3e')]({'where':{'channel':_0x5ed424[_0x19ce('0x62')][_0x19ce('0x9b')],'membername':_0x585ab6['name'],'type':'PAUSE','exitAt':null}})[_0x19ce('0x20')](function(_0x1e26a0){if(_0x1e26a0){return _0x1e26a0[_0x19ce('0x35')]({'exitAt':moment()[_0x19ce('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x19ce('0xf3')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x150d5b={};_[_0x19ce('0x31')](_0x150d5b,util[_0x19ce('0x6f')](_0x19ce('0xf8'),_0x5ed424[_0x19ce('0x62')][_0x19ce('0x9b')],'Pause'),![]);return _0x585ab6[_0x19ce('0x35')](_0x150d5b);});default:return respondWithRpcPromise(_0x19ce('0xe7'),_0x19ce('0xf2'),{'id':_0x585ab6['id'],'name':_0x585ab6[_0x19ce('0x8b')],'pause':![]})['then'](function(){return db[_0x19ce('0xa5')][_0x19ce('0x35')]({'paused':0x0},{'where':{'UserId':_0x585ab6['id']}});})[_0x19ce('0x20')](function(){return db[_0x19ce('0xdb')][_0x19ce('0x5b')]({'where':{'membername':_0x585ab6[_0x19ce('0x8b')],'type':_0x19ce('0xe8'),'exitAt':null}});})[_0x19ce('0x20')](function(_0x4f5890){var _0x3d59bd=[];_0x4f5890[_0x19ce('0xdc')](function(_0x393fed){_0x3d59bd['push'](_0x393fed[_0x19ce('0x35')]({'exitAt':moment()[_0x19ce('0x6f')](_0x19ce('0xde')),'data2':_0x19ce('0xf3')}));});return BPromise['all'](_0x3d59bd);})['then'](function(){return _0x585ab6['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x19ce('0x20')](respondWithResult(_0x5dc155,null))[_0x19ce('0x5d')](handleError(_0x5dc155,null));};exports[_0x19ce('0xf9')]=function(_0x4e925d,_0x5a4d71,_0x2a34a0){var _0x24b2bd={};var _0x2e171a={};var _0x4e54d8;var _0x33b8d4;return db[_0x19ce('0x59')]['findOne']({'where':{'id':_0x4e925d[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x5a4d71,null))[_0x19ce('0x20')](function(_0x3a67e8){if(_0x3a67e8){_0x4e54d8=_0x3a67e8;_0x2e171a[_0x19ce('0x4b')]=_['keys'](db[_0x19ce('0xfa')]['rawAttributes']);_0x2e171a[_0x19ce('0x49')]=_[_0x19ce('0x46')](_0x4e925d[_0x19ce('0x49')]);_0x2e171a['filters']=_[_0x19ce('0x4d')](_0x2e171a['model'],_0x2e171a[_0x19ce('0x49')]);_0x24b2bd[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0x2e171a[_0x19ce('0x4b')],qs[_0x19ce('0x4e')](_0x4e925d['query'][_0x19ce('0x4e')]));_0x24b2bd[_0x19ce('0x4c')]=_0x24b2bd['attributes'][_0x19ce('0x4f')]?_0x24b2bd['attributes']:_0x2e171a['model'];_0x24b2bd[_0x19ce('0x51')]=qs['sort'](_0x4e925d[_0x19ce('0x49')]['sort']);_0x24b2bd['where']=qs[_0x19ce('0x4a')](_[_0x19ce('0xc1')](_0x4e925d[_0x19ce('0x49')],_0x2e171a['filters']));if(_0x4e925d[_0x19ce('0x49')]['filter']){_0x24b2bd['where']=_[_0x19ce('0x55')](_0x24b2bd[_0x19ce('0x53')],{'$or':_['map'](_0x24b2bd[_0x19ce('0x4c')],function(_0x2d9686){var _0x4db47e={};_0x4db47e[_0x2d9686]={'$like':'%'+_0x4e925d[_0x19ce('0x49')][_0x19ce('0x54')]+'%'};return _0x4db47e;})});}_0x24b2bd=_['merge']({},_0x24b2bd,_0x4e925d[_0x19ce('0x60')]);return _0x4e54d8[_0x19ce('0xf9')](_0x24b2bd);}})[_0x19ce('0x20')](function(_0x18eab3){if(_0x18eab3){_0x33b8d4=_0x18eab3[_0x19ce('0x4f')];if(!_0x4e925d[_0x19ce('0x49')][_0x19ce('0x50')]('nolimit')){_0x24b2bd[_0x19ce('0x30')]=qs[_0x19ce('0x30')](_0x4e925d[_0x19ce('0x49')][_0x19ce('0x30')]);_0x24b2bd[_0x19ce('0x2f')]=qs[_0x19ce('0x2f')](_0x4e925d['query'][_0x19ce('0x2f')]);}return _0x4e54d8[_0x19ce('0xf9')](_0x24b2bd);}})[_0x19ce('0x20')](function(_0xf7f278){if(_0xf7f278){return _0xf7f278?{'count':_0x33b8d4,'rows':_0xf7f278}:null;}})[_0x19ce('0x20')](respondWithResult(_0x5a4d71,null))['catch'](handleError(_0x5a4d71,null));};exports[_0x19ce('0xfb')]=function(_0xb5eeb4,_0x30d0e1,_0x330f50){return db['User'][_0x19ce('0x3e')]({'where':{'id':_0xb5eeb4['params']['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x30d0e1,null))[_0x19ce('0x20')](function(_0xcf5999){if(_0xcf5999){return _0xcf5999['addTeams'](_0xb5eeb4[_0x19ce('0x62')]['ids'],_[_0x19ce('0x66')](_0xb5eeb4[_0x19ce('0x62')],[_0x19ce('0x65'),'id'])||{});}})['then'](respondWithResult(_0x30d0e1,null))['catch'](handleError(_0x30d0e1,null));};exports[_0x19ce('0xfc')]=function(_0x56e9d6,_0x325317,_0x550214){var _0x498fa6;return db[_0x19ce('0x59')]['find']({'where':{'id':_0x56e9d6[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x325317,null))[_0x19ce('0x20')](function(_0x6f392c){if(_0x6f392c){return _0x6f392c['removeTeams'](_0x56e9d6[_0x19ce('0x49')][_0x19ce('0x65')]);}})[_0x19ce('0x20')](respondWithStatusCode(_0x325317,null))[_0x19ce('0x5d')](handleError(_0x325317,null));};exports['getLists']=function(_0x29b9c2,_0x285508,_0x8f86c){var _0x1566d1={};var _0x47312d={};var _0x550d39;var _0x4762ca;return db[_0x19ce('0x59')][_0x19ce('0xb5')]({'where':{'id':_0x29b9c2[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x285508,null))[_0x19ce('0x20')](function(_0x4ad873){if(_0x4ad873){_0x550d39=_0x4ad873;_0x47312d[_0x19ce('0x4b')]=_[_0x19ce('0x46')](db[_0x19ce('0xfd')]['rawAttributes']);_0x47312d[_0x19ce('0x49')]=_['keys'](_0x29b9c2[_0x19ce('0x49')]);_0x47312d[_0x19ce('0x4a')]=_[_0x19ce('0x4d')](_0x47312d[_0x19ce('0x4b')],_0x47312d[_0x19ce('0x49')]);_0x1566d1[_0x19ce('0x4c')]=_['intersection'](_0x47312d[_0x19ce('0x4b')],qs[_0x19ce('0x4e')](_0x29b9c2[_0x19ce('0x49')][_0x19ce('0x4e')]));_0x1566d1[_0x19ce('0x4c')]=_0x1566d1[_0x19ce('0x4c')][_0x19ce('0x4f')]?_0x1566d1['attributes']:_0x47312d[_0x19ce('0x4b')];_0x1566d1['order']=qs[_0x19ce('0x52')](_0x29b9c2[_0x19ce('0x49')]['sort']);_0x1566d1[_0x19ce('0x53')]=qs[_0x19ce('0x4a')](_[_0x19ce('0xc1')](_0x29b9c2[_0x19ce('0x49')],_0x47312d[_0x19ce('0x4a')]));if(_0x29b9c2[_0x19ce('0x49')][_0x19ce('0x54')]){_0x1566d1[_0x19ce('0x53')]=_[_0x19ce('0x55')](_0x1566d1[_0x19ce('0x53')],{'$or':_['map'](_0x1566d1['attributes'],function(_0x2e1122){var _0x15d188={};_0x15d188[_0x2e1122]={'$like':'%'+_0x29b9c2[_0x19ce('0x49')][_0x19ce('0x54')]+'%'};return _0x15d188;})});}_0x1566d1=_[_0x19ce('0x55')]({},_0x1566d1,_0x29b9c2[_0x19ce('0x60')]);return _0x550d39['getLists'](_0x1566d1);}})[_0x19ce('0x20')](function(_0x945c29){if(_0x945c29){_0x4762ca=_0x945c29[_0x19ce('0x4f')];if(!_0x29b9c2[_0x19ce('0x49')][_0x19ce('0x50')](_0x19ce('0xbd'))){_0x1566d1[_0x19ce('0x30')]=qs[_0x19ce('0x30')](_0x29b9c2['query'][_0x19ce('0x30')]);_0x1566d1['offset']=qs[_0x19ce('0x2f')](_0x29b9c2[_0x19ce('0x49')][_0x19ce('0x2f')]);}return _0x550d39[_0x19ce('0xfe')](_0x1566d1);}})[_0x19ce('0x20')](function(_0x254418){if(_0x254418){return _0x254418?{'count':_0x4762ca,'rows':_0x254418}:null;}})[_0x19ce('0x20')](respondWithResult(_0x285508,null))[_0x19ce('0x5d')](handleError(_0x285508,null));};exports[_0x19ce('0xff')]=function(_0x5257f6,_0x597bda,_0x6be346){var _0x95e92e={};var _0x495cba={};var _0x38bb8c;var _0x3cb665;return db['User'][_0x19ce('0xb5')]({'where':{'id':_0x5257f6[_0x19ce('0x5f')]['id']}})[_0x19ce('0x20')](handleEntityNotFound(_0x597bda,null))['then'](function(_0x37b4a5){if(_0x37b4a5){_0x38bb8c=_0x37b4a5;_0x495cba[_0x19ce('0x4b')]=_[_0x19ce('0x46')](db[_0x19ce('0x59')][_0x19ce('0xb7')]);_0x495cba[_0x19ce('0x49')]=_[_0x19ce('0x46')](_0x5257f6[_0x19ce('0x49')]);_0x495cba[_0x19ce('0x4a')]=_[_0x19ce('0x4d')](_0x495cba[_0x19ce('0x4b')],_0x495cba[_0x19ce('0x49')]);_0x95e92e[_0x19ce('0x4c')]=_[_0x19ce('0x4d')](_0x495cba[_0x19ce('0x4b')],qs[_0x19ce('0x4e')](_0x5257f6[_0x19ce('0x49')][_0x19ce('0x4e')]));_0x95e92e[_0x19ce('0x4c')]=_0x95e92e[_0x19ce('0x4c')]['length']?_0x95e92e[_0x19ce('0x4c')]:_0x495cba[_0x19ce('0x4b')];_0x95e92e[_0x19ce('0x51')]=qs[_0x19ce('0x52')](_0x5257f6[_0x19ce('0x49')][_0x19ce('0x52')]);_0x95e92e[_0x19ce('0x53')]=qs['filters'](_[_0x19ce('0xc1')](_0x5257f6[_0x19ce('0x49')],_0x495cba[_0x19ce('0x4a')]));if(_0x5257f6['query'][_0x19ce('0x54')]){_0x95e92e[_0x19ce('0x53')]=_['merge'](_0x95e92e[_0x19ce('0x53')],{'$or':_[_0x19ce('0x3b')](_0x95e92e[_0x19ce('0x4c')],function(_0x56c732){var _0x74f9d4={};_0x74f9d4[_0x56c732]={'$like':'%'+_0x5257f6[_0x19ce('0x49')][_0x19ce('0x54')]+'%'};return _0x74f9d4;})});}_0x95e92e[_0x19ce('0x4b')]=db[_0x19ce('0x59')];_0x95e92e['as']='Agents';_0x95e92e=_[_0x19ce('0x55')]({},_0x95e92e,_0x5257f6[_0x19ce('0x60')]);return _0x38bb8c['getVoiceQueues']({'include':[_0x95e92e]});}})[_0x19ce('0x20')](function(_0x121d22){if(_0x121d22){var _0x2dfa53={},_0x4b9d58=[],_0x24d0d9=0x0;for(var _0x5010a0=0x0;_0x5010a0<_0x121d22['length'];_0x5010a0+=0x1){for(var _0x4da339=0x0,_0x79a63f;_0x4da339<_0x121d22[_0x5010a0]['Agents'][_0x19ce('0x4f')];_0x4da339+=0x1){_0x79a63f=_0x121d22[_0x5010a0][_0x19ce('0x38')][_0x4da339]['get']({'plain':!![]});_0x2dfa53[_0x79a63f['id']]=_0x79a63f;}}_0x2dfa53=_['values'](_0x2dfa53);for(var _0x55d23f=qs['offset'](_0x5257f6[_0x19ce('0x49')]['offset']);_0x55d23f<_0x2dfa53[_0x19ce('0x4f')]&&_0x4b9d58['length']=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file +var _0xb10b=['destroy','length','LoginUser','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','User','options','where','attributes','limit','include','map','model','ShowUser','find','raw','PauseUser','name','role','interface','UserVoiceQueueRt','MemberReport','findAll','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','type','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','update','system','chat','fax','sms','openchannel','set','Pause','all','LogoutUser'];(function(_0xecebcc,_0x398e19){var _0x1c4649=function(_0x3a915b){while(--_0x3a915b){_0xecebcc['push'](_0xecebcc['shift']());}};_0x1c4649(++_0x398e19);}(_0xb10b,0x12a));var _0xbb10=function(_0x196995,_0x2575dd){_0x196995=_0x196995-0x0;var _0x1ff73a=_0xb10b[_0x196995];return _0x1ff73a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['findAll']({'raw':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x19f48d['options']?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'limit':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x22')]||null:null,'include':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x19f48d['options']['include'],function(_0x4fb5e0){return{'model':db[_0x4fb5e0[_0xbb10('0x25')]],'as':_0x4fb5e0['as'],'attributes':_0x4fb5e0[_0xbb10('0x21')],'include':_0x4fb5e0[_0xbb10('0x23')]?_['map'](_0x4fb5e0[_0xbb10('0x23')],function(_0x24d586){return{'model':db[_0x24d586[_0xbb10('0x25')]],'as':_0x24d586['as'],'attributes':_0x24d586[_0xbb10('0x21')],'include':_0x24d586[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x24d586[_0xbb10('0x23')],function(_0x4aabb9){return{'model':db[_0x4aabb9[_0xbb10('0x25')]],'as':_0x4aabb9['as'],'attributes':_0x4aabb9[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x2e0249){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger['debug'](_0xbb10('0x1d'),_0x19f48d,JSON['stringify'](_0x2e0249));_0x109908(_0x2e0249);})[_0xbb10('0x1c')](function(_0x56f2da){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x56f2da[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x56f2da['message']));});});};exports[_0xbb10('0x26')]=function(_0x34f65e){var _0x4f590d=this;return new Promise(function(_0x359ad4,_0x37dde7){return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'raw':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x28')]===undefined?!![]:![]:!![],'where':_0x34f65e['options']?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'include':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x34f65e['options'][_0xbb10('0x23')],function(_0x150107){return{'model':db[_0x150107[_0xbb10('0x25')]],'as':_0x150107['as'],'attributes':_0x150107[_0xbb10('0x21')],'include':_0x150107['include']?_[_0xbb10('0x24')](_0x150107['include'],function(_0x4e2754){return{'model':db[_0x4e2754[_0xbb10('0x25')]],'as':_0x4e2754['as'],'attributes':_0x4e2754[_0xbb10('0x21')],'include':_0x4e2754[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x4e2754[_0xbb10('0x23')],function(_0x29d11a){return{'model':db[_0x29d11a['model']],'as':_0x29d11a['as'],'attributes':_0x29d11a[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x52de31){logger['info']('ShowUser',_0x34f65e);logger[_0xbb10('0x14')](_0xbb10('0x26'),_0x34f65e,JSON[_0xbb10('0x16')](_0x52de31));_0x359ad4(_0x52de31);})['catch'](function(_0x3c0cd7){logger[_0xbb10('0x17')](_0xbb10('0x26'),_0x3c0cd7['message'],_0x34f65e);_0x37dde7(_0x4f590d[_0xbb10('0x17')](0x1f4,_0x3c0cd7[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x29')]=function(_0x446f49){var _0x4f1cdd=this;return new Promise(function(_0xd238e9,_0x110eb5){var _0x5835fd;return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'where':_0x446f49[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'internal',_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x3e7b4c){if(_0x3e7b4c){_0x5835fd=_0x3e7b4c;return db[_0xbb10('0x2d')]['update']({'paused':0x1},{'where':{'UserId':_0x5835fd['id']},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0x5835fd){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5835fd[_0xbb10('0x2a')],'type':'PAUSE','exitAt':null}});}})[_0xbb10('0x11')](function(_0x202c60){if(_0x5835fd){if(_0x202c60&&_0x202c60['length']){var _0x5d9a4f=moment()[_0xbb10('0x30')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x318984=0x0,_0x180933=_0x202c60['length'];_0x318984<_0x180933;_0x318984++){_0x202c60[_0x318984][_0xbb10('0x31')]({'exitAt':_0x5d9a4f});}}}})[_0xbb10('0x11')](function(){if(_0x5835fd){var _0x474e99=[];var _0x5cf4f8=utils[_0xbb10('0x32')]();_0x5cf4f8[_0xbb10('0x33')](function(_0x3b9fdf){_0x474e99[_0xbb10('0x34')]({'channel':_0x3b9fdf,'membername':_0x5835fd[_0xbb10('0x2a')],'interface':_[_0xbb10('0x35')](_0x5835fd[_0xbb10('0x2c')])?util[_0xbb10('0x30')](_0xbb10('0x36'),_0x5835fd[_0xbb10('0x2a')]):_0x5835fd[_0xbb10('0x2c')],'type':_0xbb10('0x37'),'enterAt':moment()['format'](_0xbb10('0x38')),'data1':_0x446f49[_0xbb10('0x39')]['type']||_0xbb10('0x3a'),'role':_0x5835fd[_0xbb10('0x2b')],'internal':_0x5835fd[_0xbb10('0x3b')],'uniqueid':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3c')]||null});});return db[_0xbb10('0x2e')][_0xbb10('0x3d')](_0x474e99,{'individualHooks':!![]});}})['then'](function(){if(_0x5835fd){return _0x5835fd['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3e')]||_0xbb10('0x3a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xbb10('0x11')](function(_0x34cf4e){_0xd238e9(_0x34cf4e);})[_0xbb10('0x1c')](function(_0xf820fe){_0x110eb5(_0x4f1cdd[_0xbb10('0x17')](0x1f4,_0xf820fe[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x3f')]=function(_0x460788){var _0x2626d8=this;return new Promise(function(_0x3d7e7e,_0x550111){var _0x5eafac;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x460788[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x358e7e){if(_0x358e7e){_0x5eafac=_0x358e7e;if(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]&&!utils[_0xbb10('0x42')](_0x460788[_0xbb10('0x39')][_0xbb10('0x41')])){throw new Error(_0xbb10('0x43'));}switch(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]){case'voice':return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})[_0xbb10('0x11')](function(){return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788[_0xbb10('0x39')][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x180400){if(_0x180400){return _0x180400[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});}return null;})[_0xbb10('0x11')](function(){return _0x5eafac[_0xbb10('0x44')]({'voicePause':![]});});case'mail':case _0xbb10('0x46'):case _0xbb10('0x47'):case _0xbb10('0x48'):case _0xbb10('0x49'):return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788['body'][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}})[_0xbb10('0x11')](function(_0x432728){return _0x432728[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});})[_0xbb10('0x11')](function(){var _0x2eb05a={};_[_0xbb10('0x4a')](_0x2eb05a,util[_0xbb10('0x30')]('%s%s',_0x460788['body'][_0xbb10('0x41')],_0xbb10('0x4b')),![]);return _0x5eafac[_0xbb10('0x44')](_0x2eb05a);});default:return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})['then'](function(){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x3e9753){var _0x45c0dc=[];_0x3e9753['forEach'](function(_0x117e84){_0x45c0dc[_0xbb10('0x34')](_0x117e84['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0x45')}));});return BPromise[_0xbb10('0x4c')](_0x45c0dc);})[_0xbb10('0x11')](function(){return _0x5eafac['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x5846d1){_0x3d7e7e(_0x5846d1);})[_0xbb10('0x1c')](function(_0x249b33){_0x550111(_0x2626d8[_0xbb10('0x17')](0x1f4,_0x249b33['message']));});});};exports[_0xbb10('0x4d')]=function(_0x13131c){var _0x5a6538=this;return new Promise(function(_0x4a560c,_0x27d7b9){var _0x308896;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x13131c['options'][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x5202d7){if(_0x5202d7){_0x308896=_0x5202d7;return db[_0xbb10('0x2d')][_0xbb10('0x4e')]({'where':{'membername':_0x308896[_0xbb10('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x308896){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x308896[_0xbb10('0x2a')],'exitAt':null}});}})[_0xbb10('0x11')](function(_0x5e4a6e){if(_0x308896){if(_0x5e4a6e&&_0x5e4a6e[_0xbb10('0x4f')]){var _0x258e55=[];_0x5e4a6e[_0xbb10('0x33')](function(_0x2d0f4b){_0x258e55['push'](_0x2d0f4b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x258e55);}}})[_0xbb10('0x11')](function(){if(_0x308896){return _0x308896[_0xbb10('0x44')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbb10('0x11')](function(_0x4a30c5){_0x4a560c(_0x4a30c5);})['catch'](function(_0x5acd5e){_0x27d7b9(_0x5a6538[_0xbb10('0x17')](0x1f4,_0x5acd5e[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x50')]=function(_0x5c9afc){var _0x5cd089=this;return new Promise(function(_0x46f462,_0x1b11c0){var _0xd9e743;var _0x3a9677;var _0x260e06;var _0x1ad2ed;return db['User'][_0xbb10('0x40')]({'where':_0x5c9afc[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'mobile','phone','internal',_0xbb10('0x51'),_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x21459e){if(_0x21459e){_0xd9e743=_0x21459e;_0x1ad2ed=_0x5c9afc[_0xbb10('0x39')][_0xbb10('0x2c')]?_0x5c9afc['body'][_0xbb10('0x2c')]:util['format']('SIP/%s',_0xd9e743['name']);return db[_0xbb10('0x1e')][_0xbb10('0x52')]({'where':{'role':_0xbb10('0x53'),'online':!![],'id':{'$ne':_0xd9e743['id']}}});}})[_0xbb10('0x11')](function(_0x5ce94f){if(_0x5ce94f){_0x260e06=_0x5ce94f;return require(_0xbb10('0x54'))['getLicense']();}})['then'](function(_0x165fe9){if(_0x165fe9&&_0x165fe9[_0xbb10('0x55')]&&_0x260e06>=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 872a1ca..29ca0c6 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 _0xe963=['emit','removeListener','register','user:','./user.events','save','update'];(function(_0x420628,_0x370576){var _0x103f69=function(_0x4d1828){while(--_0x4d1828){_0x420628['push'](_0x420628['shift']());}};_0x103f69(++_0x370576);}(_0xe963,0x115));var _0x3e96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe963[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require(_0x3e96('0x0'));var events=[_0x3e96('0x1'),'remove',_0x3e96('0x2')];function createListener(_0x3ece7a,_0x1a0476){return function(_0x592968){_0x1a0476[_0x3e96('0x3')](_0x3ece7a,_0x592968);};}function removeListener(_0x3cf1d0,_0x17b765){return function(){UserEvents[_0x3e96('0x4')](_0x3cf1d0,_0x17b765);};}exports[_0x3e96('0x5')]=function(_0x48f280){for(var _0x38f316=0x0,_0x1b1094=events['length'];_0x38f316<_0x1b1094;_0x38f316++){var _0x21899e=events[_0x38f316];var _0x3c9070=createListener(_0x3e96('0x6')+_0x21899e,_0x48f280);UserEvents['on'](_0x21899e,_0x3c9070);}}; \ No newline at end of file +var _0x5d40=['./user.events','save','remove','update','emit','removeListener','register','length','user:'];(function(_0x1bfef2,_0x3faad1){var _0x208388=function(_0xd0e511){while(--_0xd0e511){_0x1bfef2['push'](_0x1bfef2['shift']());}};_0x208388(++_0x3faad1);}(_0x5d40,0x1a7));var _0x05d4=function(_0x1456c0,_0x500ab1){_0x1456c0=_0x1456c0-0x0;var _0x11ff0a=_0x5d40[_0x1456c0];return _0x11ff0a;};'use strict';var UserEvents=require(_0x05d4('0x0'));var events=[_0x05d4('0x1'),_0x05d4('0x2'),_0x05d4('0x3')];function createListener(_0x3b31ff,_0x47ae1d){return function(_0x13217d){_0x47ae1d[_0x05d4('0x4')](_0x3b31ff,_0x13217d);};}function removeListener(_0x5bf500,_0x44ed43){return function(){UserEvents[_0x05d4('0x5')](_0x5bf500,_0x44ed43);};}exports[_0x05d4('0x6')]=function(_0x78815d){for(var _0x224cd7=0x0,_0x187531=events[_0x05d4('0x7')];_0x224cd7<_0x187531;_0x224cd7++){var _0x4dc88b=events[_0x224cd7];var _0x589d23=createListener(_0x05d4('0x8')+_0x4dc88b,_0x78815d);UserEvents['on'](_0x4dc88b,_0x589d23);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 31d80e0..b8134b1 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 _0xcf98=['exports','util','path','connect-timeout','express','Router','../../config/environment'];(function(_0x4b1624,_0x486ff0){var _0x598a2f=function(_0x3c853b){while(--_0x3c853b){_0x4b1624['push'](_0x4b1624['shift']());}};_0x598a2f(++_0x486ff0);}(_0xcf98,0x8d));var _0x8cf9=function(_0x4917c6,_0x56e238){_0x4917c6=_0x4917c6-0x0;var _0x334d73=_0xcf98[_0x4917c6];return _0x334d73;};'use strict';var multer=require('multer');var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var timeout=require(_0x8cf9('0x2'));var express=require(_0x8cf9('0x3'));var router=express[_0x8cf9('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8cf9('0x5'));module[_0x8cf9('0x6')]=router; \ No newline at end of file +var _0x3f27=['express','../../components/auth/service','../../components/interaction/service','multer','util','path','connect-timeout'];(function(_0x425755,_0x16e311){var _0x38c60b=function(_0x22a7fa){while(--_0x22a7fa){_0x425755['push'](_0x425755['shift']());}};_0x38c60b(++_0x16e311);}(_0x3f27,0x1f4));var _0x73f2=function(_0xd35e75,_0x2eceb1){_0xd35e75=_0xd35e75-0x0;var _0x419031=_0x3f27[_0xd35e75];return _0x419031;};'use strict';var multer=require(_0x73f2('0x0'));var util=require(_0x73f2('0x1'));var path=require(_0x73f2('0x2'));var timeout=require(_0x73f2('0x3'));var express=require(_0x73f2('0x4'));var router=express['Router']();var auth=require(_0x73f2('0x5'));var interaction=require(_0x73f2('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 018bbb6..8a1cb7a 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 _0xae8e=['sequelize','exports','INTEGER'];(function(_0x5b576e,_0x33c203){var _0x1b65f4=function(_0x38b894){while(--_0x38b894){_0x5b576e['push'](_0x5b576e['shift']());}};_0x1b65f4(++_0x33c203);}(_0xae8e,0x1aa));var _0xeae8=function(_0x321a3c,_0x50c22d){_0x321a3c=_0x321a3c-0x0;var _0x18554f=_0xae8e[_0x321a3c];return _0x18554f;};'use strict';var Sequelize=require(_0xeae8('0x0'));module[_0xeae8('0x1')]={'penalty':{'type':Sequelize[_0xeae8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9b84=['sequelize','INTEGER'];(function(_0x1a352b,_0x3142dc){var _0xe79c3c=function(_0x28ab08){while(--_0x28ab08){_0x1a352b['push'](_0x1a352b['shift']());}};_0xe79c3c(++_0x3142dc);}(_0x9b84,0x130));var _0x49b8=function(_0x10d0f0,_0x1eba3d){_0x10d0f0=_0x10d0f0-0x0;var _0x93e308=_0x9b84[_0x10d0f0];return _0x93e308;};'use strict';var Sequelize=require(_0x49b8('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x49b8('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 86e6269..f01256b 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 _0xaa5e=['./userChatQueue.attributes','define','UserChatQueue','lodash','util','api','moment','bluebird','request-promise'];(function(_0x134deb,_0x2190ef){var _0x284fb0=function(_0x24e996){while(--_0x24e996){_0x134deb['push'](_0x134deb['shift']());}};_0x284fb0(++_0x2190ef);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x40d2fd,_0xcf8e11){_0x40d2fd=_0x40d2fd-0x0;var _0x1a38ab=_0xaa5e[_0x40d2fd];return _0x1a38ab;};'use strict';var _=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var logger=require('../../config/logger')(_0xeaa5('0x2'));var moment=require(_0xeaa5('0x3'));var BPromise=require(_0xeaa5('0x4'));var rp=require(_0xeaa5('0x5'));var attributes=require(_0xeaa5('0x6'));module['exports']=function(_0x2c111f,_0xd64e9f){return _0x2c111f[_0xeaa5('0x7')](_0xeaa5('0x8'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x056b=['define','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','./userChatQueue.attributes','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x056b,0xb6));var _0xb056=function(_0x3e8f67,_0x2d9c93){_0x3e8f67=_0x3e8f67-0x0;var _0x34ba1f=_0x056b[_0x3e8f67];return _0x34ba1f;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var logger=require(_0xb056('0x1'))(_0xb056('0x2'));var moment=require(_0xb056('0x3'));var BPromise=require(_0xb056('0x4'));var rp=require(_0xb056('0x5'));var attributes=require(_0xb056('0x6'));module[_0xb056('0x7')]=function(_0x343d88,_0x2ff09d){return _0x343d88[_0xb056('0x8')]('UserChatQueue',attributes,{'tableName':_0xb056('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 c4228ef..670ba99 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 _0x8558=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8558,0x103));var _0x8855=function(_0x5d3cc9,_0x368024){_0x5d3cc9=_0x5d3cc9-0x0;var _0x579c7b=_0x8558[_0x5d3cc9];return _0x579c7b;};'use strict';var _=require('lodash');var util=require(_0x8855('0x0'));var moment=require(_0x8855('0x1'));var BPromise=require(_0x8855('0x2'));var rs=require(_0x8855('0x3'));var fs=require('fs');var Redis=require(_0x8855('0x4'));var db=require(_0x8855('0x5'))['db'];var utils=require(_0x8855('0x6'));var logger=require('../../config/logger')(_0x8855('0x7'));var config=require('../../config/environment');var jayson=require(_0x8855('0x8'));var client=jayson['client'][_0x8855('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2039d5,_0x24041c,_0x175e9c){return new BPromise(function(_0x2811d7,_0xef1e1){return client[_0x8855('0xa')](_0x2039d5,_0x175e9c)['then'](function(_0x325a35){logger[_0x8855('0xb')](_0x8855('0xc'),_0x24041c,_0x8855('0xd'));logger[_0x8855('0xe')](_0x8855('0xf'),_0x24041c,_0x8855('0xd'),JSON[_0x8855('0x10')](_0x325a35));if(_0x325a35['error']){if(_0x325a35[_0x8855('0x11')][_0x8855('0x12')]===0x1f4){logger['error'](_0x8855('0xc'),_0x24041c,_0x325a35[_0x8855('0x11')]['message']);return _0xef1e1(_0x325a35[_0x8855('0x11')][_0x8855('0x13')]);}logger[_0x8855('0x11')](_0x8855('0xc'),_0x24041c,_0x325a35['error'][_0x8855('0x13')]);return _0x2811d7(_0x325a35['error'][_0x8855('0x13')]);}else{logger['info'](_0x8855('0xc'),_0x24041c,_0x8855('0xd'));_0x2811d7(_0x325a35[_0x8855('0x14')][_0x8855('0x13')]);}})['catch'](function(_0x3b8975){logger['error'](_0x8855('0xc'),_0x24041c,_0x3b8975);_0xef1e1(_0x3b8975);});});} \ No newline at end of file +var _0x938a=['jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x938a,0x1f2));var _0xa938=function(_0xbd17dd,_0x4af886){_0xbd17dd=_0xbd17dd-0x0;var _0x5458ba=_0x938a[_0xbd17dd];return _0x5458ba;};'use strict';var _=require(_0xa938('0x0'));var util=require(_0xa938('0x1'));var moment=require(_0xa938('0x2'));var BPromise=require(_0xa938('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa938('0x4'))['db'];var utils=require(_0xa938('0x5'));var logger=require(_0xa938('0x6'))('rpc');var config=require(_0xa938('0x7'));var jayson=require(_0xa938('0x8'));var client=jayson['client'][_0xa938('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22b3bc,_0x5ead46,_0x56ad1d){return new BPromise(function(_0x570280,_0x1de832){return client[_0xa938('0xa')](_0x22b3bc,_0x56ad1d)[_0xa938('0xb')](function(_0x5c6366){logger[_0xa938('0xc')](_0xa938('0xd'),_0x5ead46,_0xa938('0xe'));logger[_0xa938('0xf')](_0xa938('0x10'),_0x5ead46,'request\x20sent',JSON[_0xa938('0x11')](_0x5c6366));if(_0x5c6366[_0xa938('0x12')]){if(_0x5c6366[_0xa938('0x12')]['code']===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x5ead46,_0x5c6366['error']['message']);return _0x1de832(_0x5c6366[_0xa938('0x12')][_0xa938('0x13')]);}logger['error'](_0xa938('0xd'),_0x5ead46,_0x5c6366[_0xa938('0x12')][_0xa938('0x13')]);return _0x570280(_0x5c6366['error'][_0xa938('0x13')]);}else{logger[_0xa938('0xc')](_0xa938('0xd'),_0x5ead46,_0xa938('0xe'));_0x570280(_0x5c6366[_0xa938('0x14')]['message']);}})[_0xa938('0x15')](function(_0x7c29b3){logger[_0xa938('0x12')](_0xa938('0xd'),_0x5ead46,_0x7c29b3);_0x1de832(_0x7c29b3);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 5d1e85d..5805be8 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 _0xa6bb=['path','connect-timeout','express','Router','../../config/environment','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6bb,0x12c));var _0xba6b=function(_0x3419cb,_0x2e9163){_0x3419cb=_0x3419cb-0x0;var _0x281bde=_0xa6bb[_0x3419cb];return _0x281bde;};'use strict';var multer=require('multer');var util=require(_0xba6b('0x0'));var path=require(_0xba6b('0x1'));var timeout=require(_0xba6b('0x2'));var express=require(_0xba6b('0x3'));var router=express[_0xba6b('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xba6b('0x5'));module[_0xba6b('0x6')]=router; \ No newline at end of file +var _0x90b5=['connect-timeout','express','Router','../../config/environment','exports','multer','path'];(function(_0x2a5a5a,_0x5a4047){var _0x2d6dc6=function(_0x4975a5){while(--_0x4975a5){_0x2a5a5a['push'](_0x2a5a5a['shift']());}};_0x2d6dc6(++_0x5a4047);}(_0x90b5,0x139));var _0x590b=function(_0x511d07,_0x278654){_0x511d07=_0x511d07-0x0;var _0x4cbcd0=_0x90b5[_0x511d07];return _0x4cbcd0;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x590b('0x5'));module[_0x590b('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index b6bfb04..093d327 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 _0x7d9c=['sequelize','exports','INTEGER','STRING'];(function(_0x5d44af,_0x400b3a){var _0x5e8bae=function(_0x827197){while(--_0x827197){_0x5d44af['push'](_0x5d44af['shift']());}};_0x5e8bae(++_0x400b3a);}(_0x7d9c,0x114));var _0xc7d9=function(_0x7fc27e,_0x230c61){_0x7fc27e=_0x7fc27e-0x0;var _0x4c955d=_0x7d9c[_0x7fc27e];return _0x4c955d;};'use strict';var Sequelize=require(_0xc7d9('0x0'));module[_0xc7d9('0x1')]={'penalty':{'type':Sequelize[_0xc7d9('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc7d9('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xc7d9('0x3')]}}; \ No newline at end of file +var _0xf412=['exports','sequelize'];(function(_0x585234,_0x3ae470){var _0x28b8a7=function(_0x9081e1){while(--_0x9081e1){_0x585234['push'](_0x585234['shift']());}};_0x28b8a7(++_0x3ae470);}(_0xf412,0x121));var _0x2f41=function(_0x1602fb,_0x20b6b3){_0x1602fb=_0x1602fb-0x0;var _0x461831=_0xf412[_0x1602fb];return _0x461831;};'use strict';var Sequelize=require(_0x2f41('0x0'));module[_0x2f41('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 9c35581..6f1a402 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 _0xaba6=['request-promise','./userFaxQueue.attributes','lodash','util'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xaba6,0xe2));var _0x6aba=function(_0x54e350,_0x110bb2){_0x54e350=_0x54e350-0x0;var _0x252979=_0xaba6[_0x54e350];return _0x252979;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6aba('0x2'));var attributes=require(_0x6aba('0x3'));module['exports']=function(_0x1e32a1,_0x1757c8){return _0x1e32a1['define']('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ba7=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5e7cab,_0x30de4c){var _0x591e62=function(_0xea316e){while(--_0xea316e){_0x5e7cab['push'](_0x5e7cab['shift']());}};_0x591e62(++_0x30de4c);}(_0x0ba7,0x16d));var _0x70ba=function(_0x3c5758,_0x483b11){_0x3c5758=_0x3c5758-0x0;var _0x437611=_0x0ba7[_0x3c5758];return _0x437611;};'use strict';var _=require(_0x70ba('0x0'));var util=require('util');var logger=require(_0x70ba('0x1'))(_0x70ba('0x2'));var moment=require(_0x70ba('0x3'));var BPromise=require(_0x70ba('0x4'));var rp=require('request-promise');var attributes=require(_0x70ba('0x5'));module[_0x70ba('0x6')]=function(_0x3cb2e3,_0x336082){return _0x3cb2e3[_0x70ba('0x7')](_0x70ba('0x8'),attributes,{'tableName':_0x70ba('0x9'),'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 8415aa1..a3f1a79 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 _0xd97f=['stringify','error','code','message','UserFaxQueue,\x20%s,\x20%s','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd97f,0x1f4));var _0xfd97=function(_0x4e7d2a,_0x2eac00){_0x4e7d2a=_0x4e7d2a-0x0;var _0xb27873=_0xd97f[_0x4e7d2a];return _0xb27873;};'use strict';var _=require('lodash');var util=require(_0xfd97('0x0'));var moment=require(_0xfd97('0x1'));var BPromise=require(_0xfd97('0x2'));var rs=require(_0xfd97('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd97('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd97('0x5'))('rpc');var config=require(_0xfd97('0x6'));var jayson=require(_0xfd97('0x7'));var client=jayson[_0xfd97('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c063f,_0x51f69d,_0x3012f9){return new BPromise(function(_0x4cf2e5,_0x35563a){return client[_0xfd97('0x9')](_0x1c063f,_0x3012f9)['then'](function(_0x2fe47b){logger[_0xfd97('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x51f69d,_0xfd97('0xb'));logger['debug'](_0xfd97('0xc'),_0x51f69d,_0xfd97('0xb'),JSON[_0xfd97('0xd')](_0x2fe47b));if(_0x2fe47b[_0xfd97('0xe')]){if(_0x2fe47b['error'][_0xfd97('0xf')]===0x1f4){logger[_0xfd97('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x51f69d,_0x2fe47b[_0xfd97('0xe')][_0xfd97('0x10')]);return _0x35563a(_0x2fe47b[_0xfd97('0xe')][_0xfd97('0x10')]);}logger[_0xfd97('0xe')](_0xfd97('0x11'),_0x51f69d,_0x2fe47b[_0xfd97('0xe')][_0xfd97('0x10')]);return _0x4cf2e5(_0x2fe47b[_0xfd97('0xe')][_0xfd97('0x10')]);}else{logger['info'](_0xfd97('0x11'),_0x51f69d,'request\x20sent');_0x4cf2e5(_0x2fe47b['result']['message']);}})[_0xfd97('0x12')](function(_0xf617f2){logger[_0xfd97('0xe')](_0xfd97('0x11'),_0x51f69d,_0xf617f2);_0x35563a(_0xf617f2);});});} \ No newline at end of file +var _0x1827=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x33694f,_0x2f2e93){var _0x1d05d1=function(_0x45ec2b){while(--_0x45ec2b){_0x33694f['push'](_0x33694f['shift']());}};_0x1d05d1(++_0x2f2e93);}(_0x1827,0x7e));var _0x7182=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x1827[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x7182('0x0'));var util=require(_0x7182('0x1'));var moment=require(_0x7182('0x2'));var BPromise=require(_0x7182('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7182('0x4'));var db=require(_0x7182('0x5'))['db'];var utils=require(_0x7182('0x6'));var logger=require(_0x7182('0x7'))(_0x7182('0x8'));var config=require(_0x7182('0x9'));var jayson=require(_0x7182('0xa'));var client=jayson[_0x7182('0xb')][_0x7182('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14f828,_0xf070dd,_0x5cb773){return new BPromise(function(_0x8c2f1d,_0xb96658){return client[_0x7182('0xd')](_0x14f828,_0x5cb773)[_0x7182('0xe')](function(_0x45cb79){logger[_0x7182('0xf')](_0x7182('0x10'),_0xf070dd,_0x7182('0x11'));logger['debug'](_0x7182('0x12'),_0xf070dd,'request\x20sent',JSON[_0x7182('0x13')](_0x45cb79));if(_0x45cb79[_0x7182('0x14')]){if(_0x45cb79[_0x7182('0x14')][_0x7182('0x15')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0xf070dd,_0x45cb79[_0x7182('0x14')][_0x7182('0x16')]);return _0xb96658(_0x45cb79[_0x7182('0x14')][_0x7182('0x16')]);}logger['error'](_0x7182('0x10'),_0xf070dd,_0x45cb79['error'][_0x7182('0x16')]);return _0x8c2f1d(_0x45cb79['error'][_0x7182('0x16')]);}else{logger[_0x7182('0xf')](_0x7182('0x10'),_0xf070dd,'request\x20sent');_0x8c2f1d(_0x45cb79[_0x7182('0x17')][_0x7182('0x16')]);}})[_0x7182('0x18')](function(_0x1ae5e2){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0xf070dd,_0x1ae5e2);_0xb96658(_0x1ae5e2);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 2f86ba7..c237f10 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 _0x53ec=['../../components/interaction/service','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x53ec,0x192));var _0xc53e=function(_0x1ba4d1,_0x54fd0e){_0x1ba4d1=_0x1ba4d1-0x0;var _0x29a4a5=_0x53ec[_0x1ba4d1];return _0x29a4a5;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc53e('0x6'));var config=require('../../config/environment');module[_0xc53e('0x7')]=router; \ No newline at end of file +var _0x84e7=['../../components/interaction/service','../../config/environment','exports','util','path','express','Router'];(function(_0x44d85d,_0x477ae2){var _0x55f365=function(_0x84b597){while(--_0x84b597){_0x44d85d['push'](_0x44d85d['shift']());}};_0x55f365(++_0x477ae2);}(_0x84e7,0x122));var _0x784e=function(_0x31e9af,_0x279e49){_0x31e9af=_0x31e9af-0x0;var _0x3fb7df=_0x84e7[_0x31e9af];return _0x3fb7df;};'use strict';var multer=require('multer');var util=require(_0x784e('0x0'));var path=require(_0x784e('0x1'));var timeout=require('connect-timeout');var express=require(_0x784e('0x2'));var router=express[_0x784e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x784e('0x4'));var config=require(_0x784e('0x5'));module[_0x784e('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index e731dea..e9e6ea9 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 _0x237e=['sequelize'];(function(_0x2b6d46,_0x11867e){var _0x555bdb=function(_0x11122d){while(--_0x11122d){_0x2b6d46['push'](_0x2b6d46['shift']());}};_0x555bdb(++_0x11867e);}(_0x237e,0x12d));var _0xe237=function(_0xb7db85,_0x4ec90f){_0xb7db85=_0xb7db85-0x0;var _0x5d5a45=_0x237e[_0xb7db85];return _0x5d5a45;};'use strict';var Sequelize=require(_0xe237('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xdd58=['exports','sequelize'];(function(_0x250c78,_0x25b838){var _0x44f07a=function(_0x599b41){while(--_0x599b41){_0x250c78['push'](_0x250c78['shift']());}};_0x44f07a(++_0x25b838);}(_0xdd58,0xeb));var _0x8dd5=function(_0x131b5a,_0x37de2d){_0x131b5a=_0x131b5a-0x0;var _0x2558c3=_0xdd58[_0x131b5a];return _0x2558c3;};'use strict';var Sequelize=require(_0x8dd5('0x0'));module[_0x8dd5('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 c9b09c2..7830e3a 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 _0x4813=['exports','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','bluebird','request-promise'];(function(_0xd02a40,_0x617030){var _0x4f48c2=function(_0x42e992){while(--_0x42e992){_0xd02a40['push'](_0xd02a40['shift']());}};_0x4f48c2(++_0x617030);}(_0x4813,0xdc));var _0x3481=function(_0x503e7d,_0x34b3a1){_0x503e7d=_0x503e7d-0x0;var _0x2be561=_0x4813[_0x503e7d];return _0x2be561;};'use strict';var _=require(_0x3481('0x0'));var util=require('util');var logger=require(_0x3481('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3481('0x2'));var rp=require(_0x3481('0x3'));var attributes=require('./userMailQueue.attributes');module[_0x3481('0x4')]=function(_0x2d6ed3,_0x4573fa){return _0x2d6ed3[_0x3481('0x5')](_0x3481('0x6'),attributes,{'tableName':_0x3481('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6efe=['lodash','util','../../config/logger','api','moment','./userMailQueue.attributes','exports','define','user_has_mail_queues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6efe,0xc6));var _0xe6ef=function(_0x64a90e,_0x4d8dff){_0x64a90e=_0x64a90e-0x0;var _0x354519=_0x6efe[_0x64a90e];return _0x354519;};'use strict';var _=require(_0xe6ef('0x0'));var util=require(_0xe6ef('0x1'));var logger=require(_0xe6ef('0x2'))(_0xe6ef('0x3'));var moment=require(_0xe6ef('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xe6ef('0x5'));module[_0xe6ef('0x6')]=function(_0x340687,_0x40c086){return _0x340687[_0xe6ef('0x7')]('UserMailQueue',attributes,{'tableName':_0xe6ef('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 2912cce..21266b7 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 _0x4e3e=['UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x591cfd,_0x501204){var _0x4d0100=function(_0xb9ff0c){while(--_0xb9ff0c){_0x591cfd['push'](_0x591cfd['shift']());}};_0x4d0100(++_0x501204);}(_0x4e3e,0x112));var _0xe4e3=function(_0x58561e,_0x17a31c){_0x58561e=_0x58561e-0x0;var _0x2e9443=_0x4e3e[_0x58561e];return _0x2e9443;};'use strict';var _=require(_0xe4e3('0x0'));var util=require(_0xe4e3('0x1'));var moment=require(_0xe4e3('0x2'));var BPromise=require(_0xe4e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe4e3('0x4'));var logger=require(_0xe4e3('0x5'))(_0xe4e3('0x6'));var config=require('../../config/environment');var jayson=require(_0xe4e3('0x7'));var client=jayson[_0xe4e3('0x8')][_0xe4e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30bbd2,_0x13b6c1,_0x878940){return new BPromise(function(_0x5a63f7,_0xbd9b34){return client[_0xe4e3('0xa')](_0x30bbd2,_0x878940)[_0xe4e3('0xb')](function(_0x58ff6){logger['info'](_0xe4e3('0xc'),_0x13b6c1,_0xe4e3('0xd'));logger['debug'](_0xe4e3('0xe'),_0x13b6c1,_0xe4e3('0xd'),JSON[_0xe4e3('0xf')](_0x58ff6));if(_0x58ff6[_0xe4e3('0x10')]){if(_0x58ff6[_0xe4e3('0x10')][_0xe4e3('0x11')]===0x1f4){logger[_0xe4e3('0x10')](_0xe4e3('0xc'),_0x13b6c1,_0x58ff6[_0xe4e3('0x10')][_0xe4e3('0x12')]);return _0xbd9b34(_0x58ff6['error'][_0xe4e3('0x12')]);}logger[_0xe4e3('0x10')](_0xe4e3('0xc'),_0x13b6c1,_0x58ff6[_0xe4e3('0x10')][_0xe4e3('0x12')]);return _0x5a63f7(_0x58ff6['error'][_0xe4e3('0x12')]);}else{logger[_0xe4e3('0x13')](_0xe4e3('0xc'),_0x13b6c1,'request\x20sent');_0x5a63f7(_0x58ff6[_0xe4e3('0x14')][_0xe4e3('0x12')]);}})[_0xe4e3('0x15')](function(_0x38d5c2){logger[_0xe4e3('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x13b6c1,_0x38d5c2);_0xbd9b34(_0x38d5c2);});});} \ No newline at end of file +var _0xe39c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','ioredis'];(function(_0x531777,_0x3aafa8){var _0x1799f6=function(_0xfd5a24){while(--_0xfd5a24){_0x531777['push'](_0x531777['shift']());}};_0x1799f6(++_0x3aafa8);}(_0xe39c,0x111));var _0xce39=function(_0xec3b33,_0x5cdf24){_0xec3b33=_0xec3b33-0x0;var _0xdb039d=_0xe39c[_0xec3b33];return _0xdb039d;};'use strict';var _=require(_0xce39('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xce39('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce39('0x2'));var db=require(_0xce39('0x3'))['db'];var utils=require(_0xce39('0x4'));var logger=require(_0xce39('0x5'))(_0xce39('0x6'));var config=require(_0xce39('0x7'));var jayson=require(_0xce39('0x8'));var client=jayson['client'][_0xce39('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f0754,_0x2f7e6f,_0x3df73a){return new BPromise(function(_0x453fcd,_0x46618a){return client[_0xce39('0xa')](_0x4f0754,_0x3df73a)[_0xce39('0xb')](function(_0x26b616){logger[_0xce39('0xc')](_0xce39('0xd'),_0x2f7e6f,_0xce39('0xe'));logger[_0xce39('0xf')](_0xce39('0x10'),_0x2f7e6f,_0xce39('0xe'),JSON[_0xce39('0x11')](_0x26b616));if(_0x26b616[_0xce39('0x12')]){if(_0x26b616['error'][_0xce39('0x13')]===0x1f4){logger[_0xce39('0x12')](_0xce39('0xd'),_0x2f7e6f,_0x26b616['error']['message']);return _0x46618a(_0x26b616[_0xce39('0x12')]['message']);}logger[_0xce39('0x12')](_0xce39('0xd'),_0x2f7e6f,_0x26b616['error'][_0xce39('0x14')]);return _0x453fcd(_0x26b616[_0xce39('0x12')][_0xce39('0x14')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x2f7e6f,'request\x20sent');_0x453fcd(_0x26b616[_0xce39('0x15')][_0xce39('0x14')]);}})[_0xce39('0x16')](function(_0x5dc1d0){logger[_0xce39('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x2f7e6f,_0x5dc1d0);_0x46618a(_0x5dc1d0);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 7b4f5ee..36456d5 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 _0x9c63=['express','../../components/auth/service','../../components/interaction/service','multer','util','path','connect-timeout'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9c63,0x1a7));var _0x39c6=function(_0x4ca479,_0x20feb3){_0x4ca479=_0x4ca479-0x0;var _0x2841d2=_0x9c63[_0x4ca479];return _0x2841d2;};'use strict';var multer=require(_0x39c6('0x0'));var util=require(_0x39c6('0x1'));var path=require(_0x39c6('0x2'));var timeout=require(_0x39c6('0x3'));var express=require(_0x39c6('0x4'));var router=express['Router']();var auth=require(_0x39c6('0x5'));var interaction=require(_0x39c6('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x1228=['../../config/environment','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x4da4ea,_0x2875d3){var _0x3cc102=function(_0x5549c2){while(--_0x5549c2){_0x4da4ea['push'](_0x4da4ea['shift']());}};_0x3cc102(++_0x2875d3);}(_0x1228,0x12f));var _0x8122=function(_0x25a471,_0x33cb10){_0x25a471=_0x25a471-0x0;var _0x2e59a0=_0x1228[_0x25a471];return _0x2e59a0;};'use strict';var multer=require(_0x8122('0x0'));var util=require('util');var path=require(_0x8122('0x1'));var timeout=require('connect-timeout');var express=require(_0x8122('0x2'));var router=express[_0x8122('0x3')]();var auth=require(_0x8122('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8122('0x5'));module[_0x8122('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index abb156d..19705b6 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 _0x51f8=['INTEGER','exports'];(function(_0x3d4fc1,_0x5dfdd6){var _0x4ba8c8=function(_0x43910e){while(--_0x43910e){_0x3d4fc1['push'](_0x3d4fc1['shift']());}};_0x4ba8c8(++_0x5dfdd6);}(_0x51f8,0x12b));var _0x851f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x51f8[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x851f('0x0')]={'penalty':{'type':Sequelize[_0x851f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcd78=['exports'];(function(_0x54c4cd,_0x35dd7e){var _0x437330=function(_0x3e7761){while(--_0x3e7761){_0x54c4cd['push'](_0x54c4cd['shift']());}};_0x437330(++_0x35dd7e);}(_0xcd78,0x199));var _0x8cd7=function(_0x42b634,_0x121dcd){_0x42b634=_0x42b634-0x0;var _0x132e73=_0xcd78[_0x42b634];return _0x132e73;};'use strict';var Sequelize=require('sequelize');module[_0x8cd7('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 8fb97a7..9bdc487 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 _0xb7e7=['user_has_openchannel_queues','lodash','../../config/logger','moment','request-promise','exports'];(function(_0x37355b,_0x5c3fe0){var _0x279e65=function(_0x542330){while(--_0x542330){_0x37355b['push'](_0x37355b['shift']());}};_0x279e65(++_0x5c3fe0);}(_0xb7e7,0x121));var _0x7b7e=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb7e7[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x7b7e('0x4')]=function(_0x118577,_0x1d9384){return _0x118577['define']('UserOpenchannelQueue',attributes,{'tableName':_0x7b7e('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8f8=['moment','bluebird','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0xc8f8,0xf7));var _0x8c8f=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xc8f8[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x8c8f('0x0'));var util=require('util');var logger=require(_0x8c8f('0x1'))(_0x8c8f('0x2'));var moment=require(_0x8c8f('0x3'));var BPromise=require(_0x8c8f('0x4'));var rp=require('request-promise');var attributes=require(_0x8c8f('0x5'));module[_0x8c8f('0x6')]=function(_0x459bee,_0x1907d3){return _0x459bee[_0x8c8f('0x7')](_0x8c8f('0x8'),attributes,{'tableName':_0x8c8f('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 572e802..89d18b6 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 _0x608a=['http','request','then','info','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x608a,0xf2));var _0xa608=function(_0x36e421,_0x2815c7){_0x36e421=_0x36e421-0x0;var _0x4d7148=_0x608a[_0x36e421];return _0x4d7148;};'use strict';var _=require(_0xa608('0x0'));var util=require(_0xa608('0x1'));var moment=require(_0xa608('0x2'));var BPromise=require(_0xa608('0x3'));var rs=require(_0xa608('0x4'));var fs=require('fs');var Redis=require(_0xa608('0x5'));var db=require(_0xa608('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa608('0x7'))(_0xa608('0x8'));var config=require(_0xa608('0x9'));var jayson=require(_0xa608('0xa'));var client=jayson['client'][_0xa608('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e6ab9,_0x115830,_0x2dfef7){return new BPromise(function(_0x4ec0a0,_0x223eb4){return client[_0xa608('0xc')](_0x5e6ab9,_0x2dfef7)[_0xa608('0xd')](function(_0x212b9c){logger[_0xa608('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x115830,_0xa608('0xf'));logger['debug'](_0xa608('0x10'),_0x115830,'request\x20sent',JSON['stringify'](_0x212b9c));if(_0x212b9c[_0xa608('0x11')]){if(_0x212b9c[_0xa608('0x11')][_0xa608('0x12')]===0x1f4){logger['error'](_0xa608('0x13'),_0x115830,_0x212b9c[_0xa608('0x11')][_0xa608('0x14')]);return _0x223eb4(_0x212b9c[_0xa608('0x11')][_0xa608('0x14')]);}logger[_0xa608('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x115830,_0x212b9c[_0xa608('0x11')][_0xa608('0x14')]);return _0x4ec0a0(_0x212b9c[_0xa608('0x11')][_0xa608('0x14')]);}else{logger[_0xa608('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x115830,_0xa608('0xf'));_0x4ec0a0(_0x212b9c[_0xa608('0x15')][_0xa608('0x14')]);}})[_0xa608('0x16')](function(_0xe439e3){logger[_0xa608('0x11')](_0xa608('0x13'),_0x115830,_0xe439e3);_0x223eb4(_0xe439e3);});});} \ No newline at end of file +var _0x009a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util'];(function(_0x23b936,_0x3ba0b5){var _0x8ee3ff=function(_0x3707d3){while(--_0x3707d3){_0x23b936['push'](_0x23b936['shift']());}};_0x8ee3ff(++_0x3ba0b5);}(_0x009a,0x67));var _0xa009=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x009a[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0xa009('0x0'));var util=require(_0xa009('0x1'));var moment=require(_0xa009('0x2'));var BPromise=require(_0xa009('0x3'));var rs=require(_0xa009('0x4'));var fs=require('fs');var Redis=require(_0xa009('0x5'));var db=require(_0xa009('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa009('0x7'))(_0xa009('0x8'));var config=require(_0xa009('0x9'));var jayson=require(_0xa009('0xa'));var client=jayson[_0xa009('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50becd,_0x4cfae2,_0x2e3b00){return new BPromise(function(_0xa002dd,_0x56e880){return client['request'](_0x50becd,_0x2e3b00)[_0xa009('0xc')](function(_0xaf34bb){logger[_0xa009('0xd')](_0xa009('0xe'),_0x4cfae2,'request\x20sent');logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4cfae2,_0xa009('0xf'),JSON['stringify'](_0xaf34bb));if(_0xaf34bb[_0xa009('0x10')]){if(_0xaf34bb[_0xa009('0x10')][_0xa009('0x11')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x4cfae2,_0xaf34bb[_0xa009('0x10')][_0xa009('0x12')]);return _0x56e880(_0xaf34bb[_0xa009('0x10')]['message']);}logger[_0xa009('0x10')](_0xa009('0xe'),_0x4cfae2,_0xaf34bb[_0xa009('0x10')][_0xa009('0x12')]);return _0xa002dd(_0xaf34bb[_0xa009('0x10')][_0xa009('0x12')]);}else{logger[_0xa009('0xd')](_0xa009('0xe'),_0x4cfae2,_0xa009('0xf'));_0xa002dd(_0xaf34bb[_0xa009('0x13')][_0xa009('0x12')]);}})[_0xa009('0x14')](function(_0x1bec16){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x4cfae2,_0x1bec16);_0x56e880(_0x1bec16);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 8dac1b3..04c9de5 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 _0x4264=['clone','/:id/sections','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./userProfile.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/resources','getResources','post','create','/:id/clone'];(function(_0x21946b,_0x165c02){var _0xa7f04=function(_0x3fb5a9){while(--_0x3fb5a9){_0x21946b['push'](_0x21946b['shift']());}};_0xa7f04(++_0x165c02);}(_0x4264,0x91));var _0x4426=function(_0x3e1348,_0x5486f8){_0x3e1348=_0x3e1348-0x0;var _0x57b7d4=_0x4264[_0x3e1348];return _0x57b7d4;};'use strict';var multer=require('multer');var util=require(_0x4426('0x0'));var path=require(_0x4426('0x1'));var timeout=require(_0x4426('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x4426('0x3'));var interaction=require(_0x4426('0x4'));var config=require('../../config/environment');var controller=require(_0x4426('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x4426('0x6')]);router[_0x4426('0x7')](_0x4426('0x8'),auth[_0x4426('0x9')](),controller['describe']);router[_0x4426('0x7')](_0x4426('0xa'),auth[_0x4426('0x9')](),controller[_0x4426('0xb')]);router[_0x4426('0x7')](_0x4426('0xc'),auth['isAuthenticated'](),controller[_0x4426('0xd')]);router[_0x4426('0xe')]('/',auth[_0x4426('0x9')](),controller[_0x4426('0xf')]);router[_0x4426('0xe')](_0x4426('0x10'),auth[_0x4426('0x9')](),controller[_0x4426('0x11')]);router['post'](_0x4426('0x12'),auth[_0x4426('0x9')](),controller[_0x4426('0x13')]);router[_0x4426('0xe')](_0x4426('0xc'),auth[_0x4426('0x9')](),controller[_0x4426('0x14')]);router[_0x4426('0x15')](_0x4426('0xa'),auth['isAuthenticated'](),controller[_0x4426('0x16')]);router[_0x4426('0x17')]('/:id',auth[_0x4426('0x9')](),controller[_0x4426('0x18')]);router[_0x4426('0x17')](_0x4426('0x12'),auth['isAuthenticated'](),controller[_0x4426('0x19')]);router[_0x4426('0x17')](_0x4426('0xc'),auth[_0x4426('0x9')](),controller[_0x4426('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x6fbc=['create','/:id/clone','/:id/sections','addSections','addResources','put','update','delete','removeSections','removeResources','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','/describe','describe','/:id','/:id/resources','isAuthenticated','getResources','post'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x6fbc,0x185));var _0xc6fb=function(_0x14b7a5,_0xadfaf){_0x14b7a5=_0x14b7a5-0x0;var _0x1894c3=_0x6fbc[_0x14b7a5];return _0x1894c3;};'use strict';var multer=require(_0xc6fb('0x0'));var util=require(_0xc6fb('0x1'));var path=require(_0xc6fb('0x2'));var timeout=require('connect-timeout');var express=require(_0xc6fb('0x3'));var router=express[_0xc6fb('0x4')]();var auth=require(_0xc6fb('0x5'));var interaction=require(_0xc6fb('0x6'));var config=require('../../config/environment');var controller=require(_0xc6fb('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc6fb('0x8')](_0xc6fb('0x9'),auth['isAuthenticated'](),controller[_0xc6fb('0xa')]);router[_0xc6fb('0x8')](_0xc6fb('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc6fb('0x8')](_0xc6fb('0xc'),auth[_0xc6fb('0xd')](),controller[_0xc6fb('0xe')]);router[_0xc6fb('0xf')]('/',auth[_0xc6fb('0xd')](),controller[_0xc6fb('0x10')]);router[_0xc6fb('0xf')](_0xc6fb('0x11'),auth[_0xc6fb('0xd')](),controller['clone']);router['post'](_0xc6fb('0x12'),auth['isAuthenticated'](),controller[_0xc6fb('0x13')]);router['post'](_0xc6fb('0xc'),auth[_0xc6fb('0xd')](),controller[_0xc6fb('0x14')]);router[_0xc6fb('0x15')]('/:id',auth[_0xc6fb('0xd')](),controller[_0xc6fb('0x16')]);router[_0xc6fb('0x17')](_0xc6fb('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xc6fb('0x17')](_0xc6fb('0x12'),auth[_0xc6fb('0xd')](),controller[_0xc6fb('0x18')]);router['delete'](_0xc6fb('0xc'),auth['isAuthenticated'](),controller[_0xc6fb('0x19')]);module[_0xc6fb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index ac8ac74..47e71b7 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 _0x8a95=['split','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x8a95,0x12a));var _0x58a9=function(_0x1863fb,_0x37f99c){_0x1863fb=_0x1863fb-0x0;var _0x12da5d=_0x8a95[_0x1863fb];return _0x12da5d;};'use strict';var Sequelize=require(_0x58a9('0x0'));module[_0x58a9('0x1')]={'name':{'type':Sequelize[_0x58a9('0x2')],'allowNull':![],'unique':_0x58a9('0x3')},'crudPermissions':{'type':Sequelize[_0x58a9('0x2')],'set':function(_0x210dfc){this[_0x58a9('0x4')](_0x58a9('0x5'),_0x210dfc?_0x210dfc[_0x58a9('0x6')](''):[]);},'get':function(){return this[_0x58a9('0x7')]('crudPermissions')?this[_0x58a9('0x7')]('crudPermissions')[_0x58a9('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x58a9('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xd34b=['STRING','name','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports'];(function(_0x5f0fe8,_0x510201){var _0x50ab1f=function(_0x93b371){while(--_0x93b371){_0x5f0fe8['push'](_0x5f0fe8['shift']());}};_0x50ab1f(++_0x510201);}(_0xd34b,0x1e4));var _0xbd34=function(_0x28a804,_0x5df867){_0x28a804=_0x28a804-0x0;var _0x1b19c2=_0xd34b[_0x28a804];return _0x1b19c2;};'use strict';var Sequelize=require(_0xbd34('0x0'));module[_0xbd34('0x1')]={'name':{'type':Sequelize[_0xbd34('0x2')],'allowNull':![],'unique':_0xbd34('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3edde6){this[_0xbd34('0x4')](_0xbd34('0x5'),_0x3edde6?_0x3edde6[_0xbd34('0x6')](''):[]);},'get':function(){return this[_0xbd34('0x7')](_0xbd34('0x5'))?this[_0xbd34('0x7')](_0xbd34('0x5'))[_0xbd34('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xbd34('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 3148e1d..ec18f75 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 _0xafbb=['voicequeues','queuecampaigns','users','agents','admin','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','Pause','scheduler','Schedule','Sound','templates','Template','Trigger','Trunk','variables','Variable','plugins','Plugin','metrics','AnalyticMetric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./userProfile.socket','register','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','index','UserProfile','rawAttributes','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','length','create','body','clone','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','describe','addSections','push','ids','addResources','bulkCreate','removeResources','getResources','section','undefined','Sequelize','mergeResources','childModel','ValidationError','Invalid\x20section\x20\x27','parentSections','findOne','all','ignore','isEmpty','union','field','resourceIds','foreignKey','resourceFields','forEach','reportType','default','reportId','DefaultReports','CustomReports','CmContact','Tag','Tags','color','tag','value','resourceId','toLowerCase','SquareProject','odbc','SquareOdbc','SquareRecording','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','membername','agent','Telephones','User','telephone','queue','QueueCampaigns','VoiceQueue','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailSubstatus','OpenchannelQueue','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','teams'];(function(_0x506002,_0x17ad62){var _0x5a020c=function(_0xf907bc){while(--_0xf907bc){_0x506002['push'](_0x506002['shift']());}};_0x5a020c(++_0x17ad62);}(_0xafbb,0x1db));var _0xbafb=function(_0x3034d7,_0xbfbe87){_0x3034d7=_0x3034d7-0x0;var _0x5a3065=_0xafbb[_0x3034d7];return _0x5a3065;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbafb('0x0'));var rimraf=require(_0xbafb('0x1'));var zipdir=require(_0xbafb('0x2'));var jsonpatch=require(_0xbafb('0x3'));var rp=require(_0xbafb('0x4'));var moment=require(_0xbafb('0x5'));var BPromise=require(_0xbafb('0x6'));var Mustache=require(_0xbafb('0x7'));var util=require(_0xbafb('0x8'));var path=require(_0xbafb('0x9'));var sox=require(_0xbafb('0xa'));var csv=require('to-csv');var ejs=require(_0xbafb('0xb'));var fs=require('fs');var _=require(_0xbafb('0xc'));var squel=require(_0xbafb('0xd'));var crypto=require(_0xbafb('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbafb('0xf'));var toCsv=require(_0xbafb('0x10'));var querystring=require(_0xbafb('0x11'));var Papa=require(_0xbafb('0x12'));var authService=require(_0xbafb('0x13'));var hardwareService=require(_0xbafb('0x14'));var Redis=require('ioredis');var qs=require(_0xbafb('0x15'));var logger=require(_0xbafb('0x16'))(_0xbafb('0x17'));var utils=require(_0xbafb('0x18'));var config=require(_0xbafb('0x19'));var db=require('../../mysqldb')['db'];config[_0xbafb('0x1a')]=_[_0xbafb('0x1b')](config['redis'],{'host':_0xbafb('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbafb('0x1a')]));require(_0xbafb('0x1d'))[_0xbafb('0x1e')](socket);function respondWithStatusCode(_0x43c268,_0x2eb3f8){_0x2eb3f8=_0x2eb3f8||0xcc;return function(_0x35ae8e){if(_0x35ae8e){return _0x43c268[_0xbafb('0x1f')](_0x2eb3f8);}return _0x43c268[_0xbafb('0x20')](_0x2eb3f8)['end']();};}function respondWithResult(_0x6b2e06,_0x1115a1){_0x1115a1=_0x1115a1||0xc8;return function(_0xd8359f){if(_0xd8359f){return _0x6b2e06[_0xbafb('0x20')](_0x1115a1)[_0xbafb('0x21')](_0xd8359f);}};}function respondWithFilteredResult(_0x52fea0,_0x3c095c){return function(_0x59b4b1){if(_0x59b4b1){var _0x485cfa=_0x59b4b1[_0xbafb('0x22')],_0x3ef084=_0x3c095c['offset'],_0x7d34f=_0x3c095c[_0xbafb('0x23')]+_0x3c095c[_0xbafb('0x24')],_0x3c2a8c;if(_0x7d34f>=_0x485cfa){_0x7d34f=_0x485cfa;_0x3c2a8c=0xc8;}else{_0x3c2a8c=0xce;}_0x52fea0['status'](_0x3c2a8c);return _0x52fea0[_0xbafb('0x25')]('Content-Range',_0x3ef084+'-'+_0x7d34f+'/'+_0x485cfa)[_0xbafb('0x21')](_0x59b4b1);}return null;};}function patchUpdates(_0x575bd4){return function(_0x37405d){try{jsonpatch[_0xbafb('0x26')](_0x37405d,_0x575bd4,!![]);}catch(_0xa99cbf){return BPromise[_0xbafb('0x27')](_0xa99cbf);}return _0x37405d[_0xbafb('0x28')]();};}function saveUpdates(_0x165bfb,_0x563dc0){return function(_0xc5c5ad){if(_0xc5c5ad){return _0xc5c5ad[_0xbafb('0x29')](_0x165bfb)[_0xbafb('0x2a')](function(_0x4320c0){return _0x4320c0;});}return null;};}function removeEntity(_0xe5ff2d,_0x235a60){return function(_0xdb72e4){if(_0xdb72e4){return _0xdb72e4[_0xbafb('0x2b')]()[_0xbafb('0x2a')](function(){_0xe5ff2d[_0xbafb('0x20')](0xcc)[_0xbafb('0x2c')]();});}};}function handleEntityNotFound(_0x1feebb,_0x393a31){return function(_0x569ac4){if(!_0x569ac4){_0x1feebb[_0xbafb('0x1f')](0x194);}return _0x569ac4;};}function handleError(_0xcd2137,_0x4cf2c0){_0x4cf2c0=_0x4cf2c0||0x1f4;return function(_0x22d3a8){logger[_0xbafb('0x2d')](_0x22d3a8[_0xbafb('0x2e')]);if(_0x22d3a8['name']){delete _0x22d3a8[_0xbafb('0x2f')];}_0xcd2137[_0xbafb('0x20')](_0x4cf2c0)['send'](_0x22d3a8);};}exports[_0xbafb('0x30')]=function(_0x39897b,_0x474bc3){var _0x24984c={},_0x1a9326={},_0xe0e4a0={'count':0x0,'rows':[]};var _0x232358=db[_0xbafb('0x31')][_0xbafb('0x32')];_0x1a9326['model']=_['keys'](_0x232358);_0x1a9326[_0xbafb('0x33')]=_['keys'](_0x39897b[_0xbafb('0x33')]);_0x1a9326[_0xbafb('0x34')]=_[_0xbafb('0x35')](_0x1a9326[_0xbafb('0x36')],_0x1a9326[_0xbafb('0x33')]);_0x24984c[_0xbafb('0x37')]=_[_0xbafb('0x35')](_0x1a9326['model'],qs['fields'](_0x39897b['query'][_0xbafb('0x38')]));_0x24984c['attributes']=_0x24984c['attributes']['length']?_0x24984c[_0xbafb('0x37')]:_0x1a9326[_0xbafb('0x36')];if(!_0x39897b[_0xbafb('0x33')][_0xbafb('0x39')](_0xbafb('0x3a'))){_0x24984c[_0xbafb('0x24')]=qs[_0xbafb('0x24')](_0x39897b[_0xbafb('0x33')][_0xbafb('0x24')]);_0x24984c[_0xbafb('0x23')]=qs[_0xbafb('0x23')](_0x39897b[_0xbafb('0x33')]['offset']);}_0x24984c[_0xbafb('0x3b')]=qs[_0xbafb('0x3c')](_0x39897b[_0xbafb('0x33')][_0xbafb('0x3c')]);_0x24984c[_0xbafb('0x3d')]=qs[_0xbafb('0x34')](_[_0xbafb('0x3e')](_0x39897b[_0xbafb('0x33')],_0x1a9326[_0xbafb('0x34')]));if(_0x39897b[_0xbafb('0x33')][_0xbafb('0x3f')]){_0x24984c['where']=_[_0xbafb('0x40')](_0x24984c[_0xbafb('0x3d')],{'$or':_[_0xbafb('0x41')](_0x232358,function(_0x13f496){if(_0x13f496[_0xbafb('0x42')][_0xbafb('0x43')]!==_0xbafb('0x44')){var _0x40b883={};_0x40b883[_0x13f496['field']]={'$like':'%'+_0x39897b[_0xbafb('0x33')]['filter']+'%'};return _0x40b883;}})});}_0x24984c=_[_0xbafb('0x40')]({},_0x24984c,_0x39897b[_0xbafb('0x45')]);var _0x5385aa={'where':_0x24984c[_0xbafb('0x3d')]};return db[_0xbafb('0x31')][_0xbafb('0x22')](_0x5385aa)[_0xbafb('0x2a')](function(_0x490902){_0xe0e4a0[_0xbafb('0x22')]=_0x490902;if(_0x39897b[_0xbafb('0x33')][_0xbafb('0x46')]){_0x24984c[_0xbafb('0x47')]=[{'all':!![]}];}return db[_0xbafb('0x31')][_0xbafb('0x48')](_0x24984c);})[_0xbafb('0x2a')](function(_0x1e579){_0xe0e4a0[_0xbafb('0x49')]=_0x1e579;return _0xe0e4a0;})[_0xbafb('0x2a')](respondWithFilteredResult(_0x474bc3,_0x24984c))[_0xbafb('0x4a')](handleError(_0x474bc3,null));};exports['show']=function(_0x32f740,_0x2a7fde){var _0x17af60={'raw':![],'where':{'id':_0x32f740[_0xbafb('0x4b')]['id']}},_0x3e5d28={};_0x3e5d28['model']=_[_0xbafb('0x4c')](db['UserProfile'][_0xbafb('0x32')]);_0x3e5d28[_0xbafb('0x33')]=_[_0xbafb('0x4c')](_0x32f740['query']);_0x3e5d28[_0xbafb('0x34')]=_[_0xbafb('0x35')](_0x3e5d28[_0xbafb('0x36')],_0x3e5d28[_0xbafb('0x33')]);_0x17af60[_0xbafb('0x37')]=_[_0xbafb('0x35')](_0x3e5d28[_0xbafb('0x36')],qs[_0xbafb('0x38')](_0x32f740[_0xbafb('0x33')]['fields']));_0x17af60[_0xbafb('0x37')]=_0x17af60['attributes'][_0xbafb('0x4d')]?_0x17af60['attributes']:_0x3e5d28[_0xbafb('0x36')];if(_0x32f740[_0xbafb('0x33')][_0xbafb('0x46')]){_0x17af60[_0xbafb('0x47')]=[{'all':!![]}];}_0x17af60=_[_0xbafb('0x40')]({},_0x17af60,_0x32f740['options']);return db[_0xbafb('0x31')]['find'](_0x17af60)[_0xbafb('0x2a')](handleEntityNotFound(_0x2a7fde,null))[_0xbafb('0x2a')](respondWithResult(_0x2a7fde,null))['catch'](handleError(_0x2a7fde,null));};exports[_0xbafb('0x4e')]=function(_0x2d1b7b,_0x5f467d){return db[_0xbafb('0x31')]['create'](_0x2d1b7b[_0xbafb('0x4f')],{})[_0xbafb('0x2a')](respondWithResult(_0x5f467d,0xc9))[_0xbafb('0x4a')](handleError(_0x5f467d,null));};exports[_0xbafb('0x50')]=function(_0x1f1992,_0x14185b){var _0x18efd4={'raw':![],'where':{'id':_0x1f1992[_0xbafb('0x4b')]['id']}},_0x28460b={};_0x28460b['model']=_['keys'](db[_0xbafb('0x31')][_0xbafb('0x32')]);_0x18efd4['attributes']=_[_0xbafb('0x35')](_0x28460b['model'],qs[_0xbafb('0x38')](_0x1f1992[_0xbafb('0x33')][_0xbafb('0x38')]));_0x18efd4[_0xbafb('0x37')]=_0x18efd4['attributes'][_0xbafb('0x4d')]?_0x18efd4['attributes']:_0x28460b[_0xbafb('0x36')];if(_0x1f1992[_0xbafb('0x33')][_0xbafb('0x46')]){_0x18efd4[_0xbafb('0x47')]=[{'all':!![]}];}_0x18efd4=_[_0xbafb('0x40')]({},_0x18efd4,_0x1f1992[_0xbafb('0x45')]);return db[_0xbafb('0x31')][_0xbafb('0x51')](_0x18efd4)[_0xbafb('0x2a')](handleEntityNotFound(_0x14185b,null))[_0xbafb('0x2a')](function(_0x4c1000){if(_0x4c1000){var _0x2b594e=_0x4c1000[_0xbafb('0x52')]({'plain':!![]});_0x2b594e=qs[_0xbafb('0x53')](_0x2b594e,['id',_0xbafb('0x54'),_0xbafb('0x55'),_0xbafb('0x56')]);_0x1f1992['body']=_[_0xbafb('0x53')](_0x1f1992[_0xbafb('0x4f')],['id',_0xbafb('0x54'),_0xbafb('0x55')]);return db[_0xbafb('0x57')][_0xbafb('0x58')](function(_0x376f79){return db[_0xbafb('0x31')][_0xbafb('0x4e')](_[_0xbafb('0x40')](_0x2b594e,_0x1f1992['body']),{'include':_0x1f1992[_0xbafb('0x33')][_0xbafb('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x376f79})[_0xbafb('0x2a')](function(_0x257421){var _0x4999ab=_0x257421[_0xbafb('0x52')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x1f1992['params']['id']},'raw':!![]})['then'](function(_0x5cd4b5){if(_0x5cd4b5){return BPromise['each'](_0x5cd4b5,function(_0x3820c8){return new BPromise(function(_0x4aae1b,_0x1c0ccd){if(_0x3820c8[_0xbafb('0x59')]===null||_0x3820c8['autoAssociation']===0x1)_0x4aae1b(null);return db['UserProfileResource'][_0xbafb('0x48')]({'where':{'sectionId':_0x3820c8['id']},'raw':!![]})[_0xbafb('0x2a')](function(_0x9331ef){var _0x4ed36f=_[_0xbafb('0x41')](_0x9331ef,function(_0x53ea9d){return qs[_0xbafb('0x53')](_0x53ea9d,['id',_0xbafb('0x54'),_0xbafb('0x55'),_0xbafb('0x5a')]);});_0x4aae1b(_0x4ed36f);})[_0xbafb('0x4a')](function(_0x22cd67){_0x1c0ccd(_0x22cd67);});})[_0xbafb('0x2a')](function(_0x15cae3){var _0x56b015=qs[_0xbafb('0x53')](_0x3820c8,['id','createdAt',_0xbafb('0x55')]);_0x56b015[_0xbafb('0x5b')]=_0x4999ab['id'];if(_0x15cae3)_0x56b015[_0xbafb('0x5c')]=_0x15cae3;return _0x56b015;})[_0xbafb('0x2a')](function(_0x120080){return db[_0xbafb('0x5d')]['create'](_0x120080,{'include':[{'model':db[_0xbafb('0x5e')],'as':'Resources'}],'raw':!![],'transaction':_0x376f79});});})[_0xbafb('0x2a')](function(){return _0x4999ab;});}});});});}})[_0xbafb('0x2a')](respondWithResult(_0x14185b,0xc9))[_0xbafb('0x4a')](handleError(_0x14185b,null));};exports[_0xbafb('0x29')]=function(_0x35280f,_0x1b21ba){if(_0x35280f['body']['id']){delete _0x35280f['body']['id'];}return db['UserProfile']['find']({'where':{'id':_0x35280f[_0xbafb('0x4b')]['id']}})[_0xbafb('0x2a')](handleEntityNotFound(_0x1b21ba,null))[_0xbafb('0x2a')](saveUpdates(_0x35280f['body'],null))[_0xbafb('0x2a')](respondWithResult(_0x1b21ba,null))[_0xbafb('0x4a')](handleError(_0x1b21ba,null));};exports[_0xbafb('0x2b')]=function(_0x1c55a2,_0x4687aa){return db[_0xbafb('0x31')]['find']({'where':{'id':_0x1c55a2[_0xbafb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4687aa,null))[_0xbafb('0x2a')](removeEntity(_0x4687aa,null))['catch'](handleError(_0x4687aa,null));};exports[_0xbafb('0x5f')]=function(_0x17d6b5,_0x43df32){return db[_0xbafb('0x31')]['describe']()[_0xbafb('0x2a')](respondWithResult(_0x43df32,null))[_0xbafb('0x4a')](handleError(_0x43df32,null));};exports[_0xbafb('0x60')]=function(_0x4f0460,_0x43aff5){var _0xff206d=_0x4f0460['body'];return db['UserProfile'][_0xbafb('0x51')]({'where':{'id':_0x4f0460['params']['id']}})[_0xbafb('0x2a')](handleEntityNotFound(_0x43aff5,null))[_0xbafb('0x2a')](function(_0x3d6c2b){if(_0x3d6c2b){return db[_0xbafb('0x57')][_0xbafb('0x58')](function(_0x21372e){return db[_0xbafb('0x5d')][_0xbafb('0x2b')]({'where':{'userProfileId':_0x4f0460['params']['id'],'sectionId':_[_0xbafb('0x41')](_0xff206d,function(_0x22fcea){return _0x22fcea[_0xbafb('0x5a')];})},'transaction':_0x21372e})['then'](function(){var _0x2d9d49=_['map'](_0xff206d,function(_0x414dc9){_0x414dc9['userProfileId']=_0x4f0460['params']['id'];return _0x414dc9;});var _0x559588=[];return BPromise['each'](_0x2d9d49,function(_0x44cbf5){return db[_0xbafb('0x5d')]['create'](_0x44cbf5,{'include':[{'model':db[_0xbafb('0x5e')],'as':_0xbafb('0x5c')}],'raw':!![],'transaction':_0x21372e})[_0xbafb('0x2a')](function(_0x2bca5e){_0x559588[_0xbafb('0x61')](_0x2bca5e[_0xbafb('0x52')]({'plain':!![]}));});})[_0xbafb('0x2a')](function(){return _0x559588;});});});}})[_0xbafb('0x2a')](function(_0x202c2a){return _0x202c2a;})[_0xbafb('0x2a')](respondWithResult(_0x43aff5,null))[_0xbafb('0x4a')](handleError(_0x43aff5,null));};exports['removeSections']=function(_0x4b3662,_0x193e7c){var _0x2e9dd1;return db[_0xbafb('0x31')][_0xbafb('0x51')]({'where':{'id':_0x4b3662[_0xbafb('0x4b')]['id']},'attributes':['id',_0xbafb('0x2f')]})[_0xbafb('0x2a')](handleEntityNotFound(_0x193e7c,null))['then'](function(_0x4a9c0f){if(_0x4a9c0f){_0x2e9dd1=_0x4a9c0f;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x4b3662[_0xbafb('0x4b')]['id'],'sectionId':_0x4b3662['query'][_0xbafb('0x62')]}});}})[_0xbafb('0x2a')](function(){return _0x2e9dd1;})[_0xbafb('0x2a')](respondWithStatusCode(_0x193e7c,null))[_0xbafb('0x4a')](handleError(_0x193e7c,null));};exports[_0xbafb('0x63')]=function(_0x2cc761,_0x50bf58){return db['UserProfile'][_0xbafb('0x51')]({'where':{'id':_0x2cc761[_0xbafb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x50bf58,null))[_0xbafb('0x2a')](function(_0x52633e){if(_0x52633e){return db[_0xbafb('0x57')][_0xbafb('0x58')](function(_0x52b807){return db[_0xbafb('0x5d')]['findAll']({'where':{'userProfileId':_0x2cc761['params']['id']},'attributes':['id'],'raw':!![]})[_0xbafb('0x2a')](function(_0x45f224){if(_0x45f224){return db[_0xbafb('0x5d')]['destroy']({'where':{'userProfileId':_0x2cc761['params']['id'],'id':_[_0xbafb('0x41')](_0x45f224,function(_0x4e58ae){return _0x4e58ae['id'];})},'transaction':_0x52b807});}})[_0xbafb('0x2a')](function(_0x2d9c35){var _0x502f03=_[_0xbafb('0x41')](_0x2cc761[_0xbafb('0x4f')],function(_0x4ad692){_0x4ad692['userProfileId']=_0x2cc761['params']['id'];return _0x4ad692;});return db[_0xbafb('0x5d')][_0xbafb('0x64')](_0x502f03,{'raw':!![],'transaction':_0x52b807});})[_0xbafb('0x2a')](function(_0x407c5d){var _0x14c013=_[_0xbafb('0x3f')](_[_0xbafb('0x41')](_0x407c5d,function(_0x3f32c2){return _0x3f32c2['get']({'plain':!![]});}),{'includeAll':![]});if(_0x14c013){return db[_0xbafb('0x5d')][_0xbafb('0x48')]({'where':{'userProfileId':_0x2cc761[_0xbafb('0x4b')]['id'],'sectionId':_[_0xbafb('0x41')](_0x14c013,function(_0x46f464){return _0x46f464['sectionId'];})},'attributes':['id',_0xbafb('0x5a')],'raw':!![]})[_0xbafb('0x2a')](function(_0x57a235){var _0x5ac0b9=_[_0xbafb('0x41')](_0x2cc761[_0xbafb('0x4f')],function(_0x45b410){_0x45b410[_0xbafb('0x5b')]=_0x2cc761[_0xbafb('0x4b')]['id'];return _0x45b410;});return db[_0xbafb('0x5e')][_0xbafb('0x64')](_0x5ac0b9,{'raw':!![],'transaction':_0x52b807});});}})[_0xbafb('0x4a')](handleError(_0x50bf58,null));});}})[_0xbafb('0x2a')](function(_0x36fa0a){var _0xb71727=_[_0xbafb('0x41')](_0x36fa0a,function(_0x1959b7){return _0x1959b7[_0xbafb('0x52')]({'plain':!![]});});})['then'](respondWithResult(_0x50bf58,null))[_0xbafb('0x4a')](handleError(_0x50bf58,null));};exports[_0xbafb('0x65')]=function(_0x5c39d0,_0x439e81,_0x22d0c8){var _0x2aecc4;return db['UserProfile'][_0xbafb('0x51')]({'where':{'id':_0x5c39d0[_0xbafb('0x4b')]['id']}})[_0xbafb('0x2a')](handleEntityNotFound(_0x439e81,null))[_0xbafb('0x2a')](function(_0x481928){if(_0x481928){return _0x481928[_0xbafb('0x65')](_0x5c39d0[_0xbafb('0x33')][_0xbafb('0x62')]);}})[_0xbafb('0x2a')](respondWithStatusCode(_0x439e81,null))['catch'](handleError(_0x439e81,null));};exports[_0xbafb('0x66')]=function(_0x10ebaf,_0x2915c2){var _0x5547e3={'raw':![],'where':{}};var _0x1eb52e={};var _0x34aade={'count':0x0,'rows':[]};var _0x12b009=_0x10ebaf[_0xbafb('0x33')][_0xbafb('0x67')];if(typeof _0x12b009===_0xbafb('0x68')){throw new db[(_0xbafb('0x69'))]['ValidationError']('Unknown\x20section');}var _0x332994=_0x10ebaf[_0xbafb('0x33')][_0xbafb('0x6a')]||![];var _0x3f3d3d=getQueryModels(_0x12b009,_0x332994);if(typeof _0x3f3d3d[_0xbafb('0x6b')]===_0xbafb('0x68')){throw new db[(_0xbafb('0x69'))][(_0xbafb('0x6c'))](_0xbafb('0x6d')+_0x12b009+'\x27');}var _0x49b3b4=[];if(!_['isEmpty'](_0x3f3d3d[_0xbafb('0x6e')])){_0x49b3b4=_0x3f3d3d[_0xbafb('0x6e')];}else{_0x49b3b4=[{'name':_0x12b009}];}return db[_0xbafb('0x31')][_0xbafb('0x6f')]({'where':{'id':_0x10ebaf[_0xbafb('0x4b')]['id']}})[_0xbafb('0x2a')](handleEntityNotFound(_0x2915c2,null))[_0xbafb('0x2a')](function(_0x441c60){if(_0x441c60){var _0x14250c=[];for(var _0x2e61d2=0x0;_0x2e61d2<_0x49b3b4[_0xbafb('0x4d')];_0x2e61d2++){_0x14250c[_0xbafb('0x61')](db[_0xbafb('0x5d')][_0xbafb('0x6f')]({'where':{'userProfileId':_0x441c60['id'],'name':_0x49b3b4[_0x2e61d2]['name']},'raw':!![]}));}return BPromise[_0xbafb('0x70')](_0x14250c);}})[_0xbafb('0x2a')](function(_0x156342){var _0x1604f9=_['filter'](_0x156342,function(_0x2d9991){return _0x2d9991?_0x2d9991:undefined;});var _0x4c736a=_['filter'](_0x49b3b4,[_0xbafb('0x71'),!![]]);var _0x41f7fb=_[_0xbafb('0x72')](_0x1604f9)&&_[_0xbafb('0x72')](_0x4c736a)?null:_[_0xbafb('0x73')](_0x4c736a,_0x1604f9);if(_0x41f7fb){var _0x33e8fc=[];for(var _0x168b9c=0x0;_0x168b9c<_0x41f7fb['length'];_0x168b9c++){var _0x2d5e34=_[_0xbafb('0x51')](_0x49b3b4,function(_0x5ec3c0){return _0x41f7fb[_0x168b9c]?_0x5ec3c0['name']===_0x41f7fb[_0x168b9c][_0xbafb('0x2f')]:null;});if(_0x2d5e34){if(_0x41f7fb[_0x168b9c][_0xbafb('0x71')]){_0x33e8fc[_0xbafb('0x61')](getAllResources(_0x3f3d3d['childModel'],_0x41f7fb[_0x168b9c]));}else{if(!_0x41f7fb[_0x168b9c][_0xbafb('0x59')]){_0x33e8fc[_0xbafb('0x61')](getAllowedResources(_0x2d5e34,_0x41f7fb[_0x168b9c]));}else{if(_0x2d5e34[_0xbafb('0x36')]){_0x33e8fc['push'](getAllFilteredResources(_0x2d5e34,_0x41f7fb[_0x168b9c]));}}}}}return BPromise[_0xbafb('0x70')](_0x33e8fc);}else{return null;}})['then'](function(_0x52a114){var _0x5389a3=_0x52a114;var _0x433335=null;if(_0x5389a3){_0x433335=_0x5389a3[_0xbafb('0x4d')]===0x1?_0x5389a3[0x0]:null;}if(_0x433335||_0x5389a3){var _0x22023c=db[_0x3f3d3d[_0xbafb('0x6b')]]['rawAttributes'];_0x1eb52e['model']=_[_0xbafb('0x4c')](_0x22023c);_0x1eb52e[_0xbafb('0x33')]=_[_0xbafb('0x4c')](_0x10ebaf['query']);_0x1eb52e['filters']=_[_0xbafb('0x35')](_0x1eb52e[_0xbafb('0x36')],_0x1eb52e[_0xbafb('0x33')]);_0x5547e3[_0xbafb('0x37')]=_[_0xbafb('0x35')](_0x1eb52e[_0xbafb('0x36')],qs[_0xbafb('0x38')](_0x10ebaf[_0xbafb('0x33')]['fields']));_0x5547e3[_0xbafb('0x37')]=_0x5547e3[_0xbafb('0x37')][_0xbafb('0x4d')]?_0x5547e3[_0xbafb('0x37')]:_0x1eb52e[_0xbafb('0x36')];if(!_0x10ebaf[_0xbafb('0x33')][_0xbafb('0x39')]('nolimit')){_0x5547e3[_0xbafb('0x24')]=qs[_0xbafb('0x24')](_0x10ebaf[_0xbafb('0x33')][_0xbafb('0x24')]);_0x5547e3[_0xbafb('0x23')]=qs[_0xbafb('0x23')](_0x10ebaf[_0xbafb('0x33')]['offset']);}_0x5547e3[_0xbafb('0x3b')]=qs[_0xbafb('0x3c')](_0x10ebaf['query'][_0xbafb('0x3c')]);_0x5547e3[_0xbafb('0x3d')]=qs[_0xbafb('0x34')](_['pick'](_0x10ebaf[_0xbafb('0x33')],_0x1eb52e[_0xbafb('0x34')]));var _0x4741f9=[];if(_0x433335){var _0x3ca43d=_[_0xbafb('0x51')](_0x49b3b4,[_0xbafb('0x2f'),_0x433335[_0xbafb('0x2f')]]);if(_0x3ca43d[_0xbafb('0x74')]){var _0x1b40e4={};_0x1b40e4[_0x3ca43d['foreignKey']]=_0x433335['resourceFields'];_0x4741f9[_0xbafb('0x61')](_0x1b40e4);}else{_0x5547e3[_0xbafb('0x3d')]['id']=_0x433335[_0xbafb('0x75')];}}else{var _0x4741f9=[];for(var _0x381450=0x0;_0x381450<_0x5389a3[_0xbafb('0x4d')];_0x381450++){var _0x3ca43d=_['find'](_0x49b3b4,[_0xbafb('0x2f'),_0x5389a3[_0x381450]['name']]);if(_0x3ca43d[_0xbafb('0x74')]){var _0x1b40e4={};if(_0x3ca43d[_0xbafb('0x74')]==='id'){_0x1b40e4[_0x3ca43d[_0xbafb('0x76')]]=_0x5389a3[_0x381450][_0xbafb('0x75')];}else{_0x1b40e4[_0x3ca43d['foreignKey']]=_0x5389a3[_0x381450][_0xbafb('0x77')];}_0x4741f9['push'](_0x1b40e4);}else{if(!_0x5547e3['where']['id'])_0x5547e3[_0xbafb('0x3d')]['id']=[];_0x5389a3[_0x381450]['resourceIds']['forEach'](function(_0x252d72){_0x5547e3[_0xbafb('0x3d')]['id'][_0xbafb('0x61')](_0x252d72);});}}}if(!_[_0xbafb('0x72')](_0x4741f9)){_0x5547e3['where']=_[_0xbafb('0x40')](_0x5547e3[_0xbafb('0x3d')],{'$or':_0x4741f9});}if(_0x10ebaf[_0xbafb('0x33')]['filter']){_0x5547e3[_0xbafb('0x3d')]=_[_0xbafb('0x40')](_0x5547e3[_0xbafb('0x3d')],{'$or':_[_0xbafb('0x41')](_0x22023c,function(_0x3c6779){if(_0x3c6779[_0xbafb('0x42')][_0xbafb('0x43')]!=='VIRTUAL'){var _0x94001a={};_0x94001a[_0x3c6779[_0xbafb('0x74')]]={'$like':'%'+_0x10ebaf[_0xbafb('0x33')]['filter']+'%'};return _0x94001a;}})});}_0x5547e3=_[_0xbafb('0x40')]({},_0x5547e3,_0x10ebaf['options']);if(_0x433335&&!_0x433335['autoAssociation']&&_0x3f3d3d['childModel']==='AnalyticExtractedReport'){if(_0x10ebaf['query']['includeAll']){_0x5547e3[_0xbafb('0x47')]=[{'all':!![]}];}return db[_0x3f3d3d[_0xbafb('0x6b')]][_0xbafb('0x48')](_0x5547e3)[_0xbafb('0x2a')](function(_0x4c9dd){var _0x41c2f6=[];_0x4c9dd[_0xbafb('0x78')](function(_0x279cdd){var _0x41ac3f;switch(_0x279cdd[_0xbafb('0x79')]){case _0xbafb('0x7a'):_0x41ac3f=_[_0xbafb('0x51')](_0x433335[_0xbafb('0x75')],function(_0x4837a2){return _0x4837a2['id']===_0x279cdd[_0xbafb('0x7b')]&&_0x4837a2['type']===_0xbafb('0x7c');});break;case'custom':_0x41ac3f=_['find'](_0x433335[_0xbafb('0x75')],function(_0x22c6f5){return _0x22c6f5['id']===_0x279cdd['reportId']&&_0x22c6f5[_0xbafb('0x42')]===_0xbafb('0x7d');});break;}if(_0x41ac3f)_0x41c2f6[_0xbafb('0x61')](_0x279cdd);});_0x34aade['count']=_0x41c2f6[_0xbafb('0x4d')];_0x34aade['rows']=_0x41c2f6;return _0x34aade;});}else{return db[_0x3f3d3d[_0xbafb('0x6b')]][_0xbafb('0x22')]({'where':_0x5547e3[_0xbafb('0x3d')]})[_0xbafb('0x2a')](function(_0x474165){_0x34aade[_0xbafb('0x22')]=_0x474165;if(_0x10ebaf[_0xbafb('0x33')]['includeAll']){if(_0x3f3d3d[_0xbafb('0x6b')]===_0xbafb('0x7e')){_0x5547e3[_0xbafb('0x47')]=[{'model':db[_0xbafb('0x7f')],'as':_0xbafb('0x80'),'attributes':['id',_0xbafb('0x2f'),_0xbafb('0x81')],'required':_0x10ebaf[_0xbafb('0x33')]['tag']?!![]:![]},{'model':db[_0xbafb('0x7f')],'as':'ThroughTags','attributes':['id',_0xbafb('0x2f'),_0xbafb('0x81')],'through':_0x10ebaf[_0xbafb('0x33')][_0xbafb('0x82')]?{'attributes':[],'where':{'TagId':_0x10ebaf[_0xbafb('0x33')][_0xbafb('0x82')]||undefined}}:{},'required':_0x10ebaf[_0xbafb('0x33')][_0xbafb('0x82')]?!![]:![]}];}else{_0x5547e3[_0xbafb('0x47')]=[{'all':!![]}];}}return db[_0x3f3d3d[_0xbafb('0x6b')]][_0xbafb('0x48')](_0x5547e3);})[_0xbafb('0x2a')](function(_0x5ed74a){_0x34aade[_0xbafb('0x49')]=_0x5ed74a;return _0x34aade;});}}else{return _0x34aade;}})[_0xbafb('0x2a')](respondWithFilteredResult(_0x2915c2,_0x5547e3))[_0xbafb('0x4a')](handleError(_0x2915c2,null));};function getAllResources(_0x462d26,_0x3d03dd){return new BPromise(function(_0x17afbb,_0x5aeec2){if(_0x3d03dd){var _0x466afb=_0x3d03dd[_0xbafb('0x3f')]?{[_0x3d03dd['filter']['field']]:_0x3d03dd[_0xbafb('0x3f')][_0xbafb('0x83')]}:undefined;return db[_0x462d26][_0xbafb('0x48')]({'where':_0x466afb,'raw':!![]})[_0xbafb('0x2a')](function(_0x4080fa){_0x3d03dd[_0xbafb('0x75')]=_['map'](_0x4080fa,'id');_0x17afbb(_0x3d03dd);})['catch'](function(_0x2d16e4){_0x5aeec2(_0x2d16e4);});}else{_0x17afbb(null);}});}function getAllFilteredResources(_0x407ae2,_0x5dcf0a){return new BPromise(function(_0x4be0d0,_0x269111){var _0x27ed16=_0x407ae2['filter']?{[_0x407ae2[_0xbafb('0x3f')][_0xbafb('0x74')]]:_0x407ae2['filter'][_0xbafb('0x83')]}:undefined;return db[_0x407ae2['model']][_0xbafb('0x48')]({'where':_0x27ed16,'raw':!![]})[_0xbafb('0x2a')](function(_0x75769a){_0x5dcf0a[_0xbafb('0x77')]=_['map'](_0x75769a,function(_0x4970d2){return _0x4970d2[_0xbafb('0x2f')];});_0x4be0d0(_0x5dcf0a);})['catch'](function(_0x38dc08){_0x269111(_0x38dc08);});});}function getAllowedResources(_0x48a9ba,_0x2a341d){return new BPromise(function(_0x6758bf,_0x442b80){if(_0x2a341d){return db[_0xbafb('0x5e')][_0xbafb('0x48')]({'where':{'sectionId':_0x2a341d['id']},'raw':!![]})['then'](function(_0x3a1934){if(_0x48a9ba[_0xbafb('0x74')]&&_0x48a9ba['field']!=='id'){_0x2a341d[_0xbafb('0x77')]=_[_0xbafb('0x41')](_0x3a1934,function(_0x46dcde){return _0x46dcde[_0x48a9ba[_0xbafb('0x74')]];});}else{if(_0x48a9ba['childModel']==='AnalyticExtractedReport'){_0x2a341d[_0xbafb('0x75')]=_['map'](_0x3a1934,function(_0x35f7a0){return{'id':_0x35f7a0[_0xbafb('0x84')],'type':_0x35f7a0[_0xbafb('0x42')]};});}else{_0x2a341d[_0xbafb('0x75')]=_['map'](_0x3a1934,function(_0xb2901e){return _0xb2901e[_0xbafb('0x84')];});}}_0x6758bf(_0x2a341d);})['catch'](function(_0x3fbfe7){_0x442b80(_0x3fbfe7);});}else{_0x6758bf(null);}});}function getQueryModels(_0x7f526a,_0x23b035){var _0x4a3b69=_0x7f526a[_0xbafb('0x85')]();var _0x20ecc9={'childModel':undefined,'parentSections':[]};switch(_0x4a3b69){case'squareprojects':_0x20ecc9['childModel']=_0xbafb('0x86');break;case _0xbafb('0x87'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0x88');break;case'squarerecordings':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0x89');_0x20ecc9[_0xbafb('0x6e')]=[{'name':'SquareProjects','field':'name','foreignKey':'projectName'}];break;case _0xbafb('0x8a'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0x8b');break;case _0xbafb('0x8c'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0x7e');_0x20ecc9['parentSections']=[{'name':_0xbafb('0x8d'),'field':'id','foreignKey':_0xbafb('0x8e')}];break;case _0xbafb('0x8f'):_0x20ecc9['childModel']=_0xbafb('0x90');break;case _0xbafb('0x91'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0x92');break;case'globalcustomfields':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0x93');break;case _0xbafb('0x94'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0x95');break;case _0xbafb('0x96'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0x97');break;case'faxqueues':_0x20ecc9['childModel']=_0xbafb('0x98');break;case'faxaccounts':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0x99');break;case _0xbafb('0x9a'):case'internalroutes':case _0xbafb('0x9b'):_0x20ecc9['childModel']=_0xbafb('0x9c');break;case'contexts':_0x20ecc9['childModel']=_0xbafb('0x9d');break;case'voicemails':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0x9e');break;case _0xbafb('0x9f'):_0x20ecc9['childModel']=_0xbafb('0xa0');_0x20ecc9[_0xbafb('0x6e')]=[{'name':'Agents','field':'name','foreignKey':_0xbafb('0xa1'),'model':'User','filter':{'field':'role','value':[_0xbafb('0xa2')]}},{'name':_0xbafb('0xa3'),'field':_0xbafb('0x2f'),'foreignKey':_0xbafb('0xa1'),'model':_0xbafb('0xa4'),'filter':{'field':'role','value':[_0xbafb('0xa5')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0xbafb('0xa6'),'model':'VoiceQueue','filter':{'field':_0xbafb('0x42'),'value':['inbound']}},{'name':_0xbafb('0xa7'),'field':_0xbafb('0x2f'),'foreignKey':_0xbafb('0xa6'),'model':_0xbafb('0xa8'),'filter':{'field':_0xbafb('0x42'),'value':['outbound']}}];break;case _0xbafb('0xa9'):_0x20ecc9[_0xbafb('0x6b')]='VoiceMusicOnHold';break;case _0xbafb('0xaa'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xab');break;case _0xbafb('0xac'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xad');break;case _0xbafb('0xae'):_0x20ecc9['childModel']='Campaign';break;case _0xbafb('0xaf'):_0x20ecc9['childModel']=_0xbafb('0xb0');break;case _0xbafb('0xb1'):_0x20ecc9[_0xbafb('0x6b')]='MailAccount';break;case'mailsubstatuses':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xb2');break;case'openchannelqueues':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xb3');break;case'openchannelaccounts':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xb4');break;case'smsqueues':_0x20ecc9['childModel']=_0xbafb('0xb5');break;case _0xbafb('0xb6'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xb7');break;case _0xbafb('0xb8'):_0x20ecc9[_0xbafb('0x6b')]='Team';break;case _0xbafb('0xb9'):case _0xbafb('0xba'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xa8');if(_0x23b035){_0x20ecc9[_0xbafb('0x6e')]=[{'name':'VoiceQueues'},{'name':_0xbafb('0xa7')}];}break;case _0xbafb('0xbb'):case _0xbafb('0xbc'):case'telephones':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xa4');if(_0x23b035){_0x20ecc9[_0xbafb('0x6e')]=[{'name':'Users','filter':{'field':'role','value':[_0xbafb('0xbd'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0xbafb('0xa3')}];}break;case'zendeskaccounts':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xbe');break;case _0xbafb('0xbf'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xc0');break;case _0xbafb('0xc1'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xc2');break;case _0xbafb('0xc3'):_0x20ecc9[_0xbafb('0x6b')]='SugarcrmAccount';break;case _0xbafb('0xc4'):_0x20ecc9['childModel']='DeskAccount';break;case _0xbafb('0xc5'):_0x20ecc9[_0xbafb('0x6b')]='ZohoAccount';break;case _0xbafb('0xc6'):_0x20ecc9[_0xbafb('0x6b')]='User';break;case _0xbafb('0xc7'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xc8');break;case _0xbafb('0xc9'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xca');break;case _0xbafb('0xcb'):_0x20ecc9[_0xbafb('0x6b')]='Dashboard';break;case _0xbafb('0xcc'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xcd');break;case'pauses':_0x20ecc9['childModel']=_0xbafb('0xce');break;case _0xbafb('0xcf'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xd0');break;case'sounds':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xd1');break;case'tags':_0x20ecc9[_0xbafb('0x6b')]='Tag';break;case _0xbafb('0xd2'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xd3');break;case'triggers':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xd4');break;case'trunks':_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xd5');break;case _0xbafb('0xd6'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xd7');break;case _0xbafb('0xd8'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xd9');break;case'extractedreports':_0x20ecc9[_0xbafb('0x6b')]='AnalyticExtractedReport';_0x20ecc9[_0xbafb('0x6e')]=[{'name':'Reports','field':'id','foreignKey':_0xbafb('0x7b')}];break;case _0xbafb('0xda'):_0x20ecc9[_0xbafb('0x6b')]=_0xbafb('0xdb');break;default:return _0x20ecc9;}return _0x20ecc9;} \ No newline at end of file +var _0x5f23=['ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','all','ignore','union','hasOwnProperty','sort','field','foreignKey','resourceFields','resourceIds','AnalyticExtractedReport','forEach','reportType','default','reportId','custom','CustomReports','Tag','color','tag','value','resourceId','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','inboundroutes','internalroutes','outboundroutes','VoiceContext','voicemails','VoiceRecording','membername','User','Telephones','role','telephone','VoiceQueues','queue','inbound','VoiceQueue','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','SmsQueue','smsaccounts','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','templates','triggers','Trigger','Trunk','variables','Variable','extractedreports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','count','offset','limit','set','reject','save','then','destroy','error','stack','name','send','UserProfile','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','create','body','clone','find','get','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','each','autoAssociation','UserProfileResource','map','userProfileId','Resources','UserProfileSection','describe','addSections','sectionId','push','bulkCreate','removeResources','ids','getResources','section','undefined','Sequelize'];(function(_0x32974e,_0x42f66d){var _0x5c1a3a=function(_0x4a8b57){while(--_0x4a8b57){_0x32974e['push'](_0x32974e['shift']());}};_0x5c1a3a(++_0x42f66d);}(_0x5f23,0x7c));var _0x35f2=function(_0x245128,_0x1ec766){_0x245128=_0x245128-0x0;var _0x55096b=_0x5f23[_0x245128];return _0x55096b;};'use strict';var pdf=require(_0x35f2('0x0'));var emlformat=require(_0x35f2('0x1'));var rimraf=require(_0x35f2('0x2'));var zipdir=require(_0x35f2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35f2('0x4'));var moment=require('moment');var BPromise=require(_0x35f2('0x5'));var Mustache=require(_0x35f2('0x6'));var util=require(_0x35f2('0x7'));var path=require(_0x35f2('0x8'));var sox=require(_0x35f2('0x9'));var csv=require(_0x35f2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x35f2('0xb'));var squel=require('squel');var crypto=require(_0x35f2('0xc'));var jsforce=require(_0x35f2('0xd'));var deskjs=require(_0x35f2('0xe'));var toCsv=require(_0x35f2('0xa'));var querystring=require('querystring');var Papa=require(_0x35f2('0xf'));var authService=require(_0x35f2('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x35f2('0x11'));var logger=require(_0x35f2('0x12'))('api');var utils=require(_0x35f2('0x13'));var config=require(_0x35f2('0x14'));var db=require('../../mysqldb')['db'];config[_0x35f2('0x15')]=_['defaults'](config[_0x35f2('0x15')],{'host':_0x35f2('0x16'),'port':0x18eb});var socket=require(_0x35f2('0x17'))(new Redis(config[_0x35f2('0x15')]));require(_0x35f2('0x18'))[_0x35f2('0x19')](socket);function respondWithStatusCode(_0x568604,_0x24e569){_0x24e569=_0x24e569||0xcc;return function(_0x13cd4c){if(_0x13cd4c){return _0x568604[_0x35f2('0x1a')](_0x24e569);}return _0x568604['status'](_0x24e569)['end']();};}function respondWithResult(_0x362894,_0x166b74){_0x166b74=_0x166b74||0xc8;return function(_0x1d13a8){if(_0x1d13a8){return _0x362894[_0x35f2('0x1b')](_0x166b74)[_0x35f2('0x1c')](_0x1d13a8);}};}function respondWithFilteredResult(_0x28b7c0,_0xbf78bb){return function(_0x1d912a){if(_0x1d912a){var _0x30756d=_0x1d912a[_0x35f2('0x1d')],_0x276d81=_0xbf78bb['offset'],_0x4c6ddc=_0xbf78bb[_0x35f2('0x1e')]+_0xbf78bb[_0x35f2('0x1f')],_0x5dc716;if(_0x4c6ddc>=_0x30756d){_0x4c6ddc=_0x30756d;_0x5dc716=0xc8;}else{_0x5dc716=0xce;}_0x28b7c0[_0x35f2('0x1b')](_0x5dc716);return _0x28b7c0[_0x35f2('0x20')]('Content-Range',_0x276d81+'-'+_0x4c6ddc+'/'+_0x30756d)[_0x35f2('0x1c')](_0x1d912a);}return null;};}function patchUpdates(_0x2b4db9){return function(_0xda5209){try{jsonpatch['apply'](_0xda5209,_0x2b4db9,!![]);}catch(_0x5a1e53){return BPromise[_0x35f2('0x21')](_0x5a1e53);}return _0xda5209[_0x35f2('0x22')]();};}function saveUpdates(_0x3838c0,_0x7ffa5c){return function(_0x4a79e7){if(_0x4a79e7){return _0x4a79e7['update'](_0x3838c0)[_0x35f2('0x23')](function(_0x5db024){return _0x5db024;});}return null;};}function removeEntity(_0x41ef77,_0x3c0cc6){return function(_0x39e3ac){if(_0x39e3ac){return _0x39e3ac[_0x35f2('0x24')]()[_0x35f2('0x23')](function(){_0x41ef77[_0x35f2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x93abce,_0x1646a6){return function(_0x3a6eba){if(!_0x3a6eba){_0x93abce['sendStatus'](0x194);}return _0x3a6eba;};}function handleError(_0x11b00c,_0x42f32b){_0x42f32b=_0x42f32b||0x1f4;return function(_0x40424f){logger[_0x35f2('0x25')](_0x40424f[_0x35f2('0x26')]);if(_0x40424f[_0x35f2('0x27')]){delete _0x40424f[_0x35f2('0x27')];}_0x11b00c[_0x35f2('0x1b')](_0x42f32b)[_0x35f2('0x28')](_0x40424f);};}exports['index']=function(_0x33e28d,_0x223ac6){var _0x17bbc8={},_0x29eff6={},_0x522753={'count':0x0,'rows':[]};var _0x3d0d47=db[_0x35f2('0x29')][_0x35f2('0x2a')];_0x29eff6[_0x35f2('0x2b')]=_['keys'](_0x3d0d47);_0x29eff6['query']=_[_0x35f2('0x2c')](_0x33e28d[_0x35f2('0x2d')]);_0x29eff6[_0x35f2('0x2e')]=_[_0x35f2('0x2f')](_0x29eff6[_0x35f2('0x2b')],_0x29eff6['query']);_0x17bbc8['attributes']=_['intersection'](_0x29eff6['model'],qs['fields'](_0x33e28d[_0x35f2('0x2d')][_0x35f2('0x30')]));_0x17bbc8[_0x35f2('0x31')]=_0x17bbc8[_0x35f2('0x31')][_0x35f2('0x32')]?_0x17bbc8[_0x35f2('0x31')]:_0x29eff6[_0x35f2('0x2b')];if(!_0x33e28d['query']['hasOwnProperty'](_0x35f2('0x33'))){_0x17bbc8[_0x35f2('0x1f')]=qs[_0x35f2('0x1f')](_0x33e28d['query']['limit']);_0x17bbc8[_0x35f2('0x1e')]=qs['offset'](_0x33e28d[_0x35f2('0x2d')][_0x35f2('0x1e')]);}_0x17bbc8[_0x35f2('0x34')]=qs['sort'](_0x33e28d['query']['sort']);_0x17bbc8[_0x35f2('0x35')]=qs[_0x35f2('0x2e')](_[_0x35f2('0x36')](_0x33e28d['query'],_0x29eff6[_0x35f2('0x2e')]));if(_0x33e28d[_0x35f2('0x2d')]['filter']){_0x17bbc8[_0x35f2('0x35')]=_[_0x35f2('0x37')](_0x17bbc8[_0x35f2('0x35')],{'$or':_['map'](_0x3d0d47,function(_0x4dcd6b){if(_0x4dcd6b[_0x35f2('0x38')][_0x35f2('0x39')]!==_0x35f2('0x3a')){var _0x41eb9d={};_0x41eb9d[_0x4dcd6b['field']]={'$like':'%'+_0x33e28d[_0x35f2('0x2d')][_0x35f2('0x3b')]+'%'};return _0x41eb9d;}})});}_0x17bbc8=_['merge']({},_0x17bbc8,_0x33e28d[_0x35f2('0x3c')]);var _0x36cd2e={'where':_0x17bbc8['where']};return db[_0x35f2('0x29')][_0x35f2('0x1d')](_0x36cd2e)['then'](function(_0x2f6364){_0x522753[_0x35f2('0x1d')]=_0x2f6364;if(_0x33e28d[_0x35f2('0x2d')][_0x35f2('0x3d')]){_0x17bbc8['include']=[{'all':!![]}];}return db[_0x35f2('0x29')][_0x35f2('0x3e')](_0x17bbc8);})[_0x35f2('0x23')](function(_0x5d7e6d){_0x522753[_0x35f2('0x3f')]=_0x5d7e6d;return _0x522753;})['then'](respondWithFilteredResult(_0x223ac6,_0x17bbc8))[_0x35f2('0x40')](handleError(_0x223ac6,null));};exports['show']=function(_0x4cdfbe,_0x1e556){var _0xc80eb0={'raw':![],'where':{'id':_0x4cdfbe[_0x35f2('0x41')]['id']}},_0x5a7b39={};_0x5a7b39['model']=_[_0x35f2('0x2c')](db[_0x35f2('0x29')][_0x35f2('0x2a')]);_0x5a7b39['query']=_[_0x35f2('0x2c')](_0x4cdfbe['query']);_0x5a7b39['filters']=_['intersection'](_0x5a7b39[_0x35f2('0x2b')],_0x5a7b39[_0x35f2('0x2d')]);_0xc80eb0[_0x35f2('0x31')]=_[_0x35f2('0x2f')](_0x5a7b39[_0x35f2('0x2b')],qs[_0x35f2('0x30')](_0x4cdfbe['query'][_0x35f2('0x30')]));_0xc80eb0[_0x35f2('0x31')]=_0xc80eb0[_0x35f2('0x31')][_0x35f2('0x32')]?_0xc80eb0[_0x35f2('0x31')]:_0x5a7b39[_0x35f2('0x2b')];if(_0x4cdfbe[_0x35f2('0x2d')][_0x35f2('0x3d')]){_0xc80eb0[_0x35f2('0x42')]=[{'all':!![]}];}_0xc80eb0=_[_0x35f2('0x37')]({},_0xc80eb0,_0x4cdfbe[_0x35f2('0x3c')]);return db[_0x35f2('0x29')]['find'](_0xc80eb0)[_0x35f2('0x23')](handleEntityNotFound(_0x1e556,null))[_0x35f2('0x23')](respondWithResult(_0x1e556,null))[_0x35f2('0x40')](handleError(_0x1e556,null));};exports[_0x35f2('0x43')]=function(_0x1eb4b2,_0x31ed25){return db[_0x35f2('0x29')][_0x35f2('0x43')](_0x1eb4b2[_0x35f2('0x44')],{})[_0x35f2('0x23')](respondWithResult(_0x31ed25,0xc9))[_0x35f2('0x40')](handleError(_0x31ed25,null));};exports[_0x35f2('0x45')]=function(_0x15724b,_0x28da3c){var _0x2bbb87={'raw':![],'where':{'id':_0x15724b[_0x35f2('0x41')]['id']}},_0x54a2fb={};_0x54a2fb[_0x35f2('0x2b')]=_['keys'](db[_0x35f2('0x29')][_0x35f2('0x2a')]);_0x2bbb87[_0x35f2('0x31')]=_[_0x35f2('0x2f')](_0x54a2fb[_0x35f2('0x2b')],qs[_0x35f2('0x30')](_0x15724b[_0x35f2('0x2d')][_0x35f2('0x30')]));_0x2bbb87[_0x35f2('0x31')]=_0x2bbb87[_0x35f2('0x31')][_0x35f2('0x32')]?_0x2bbb87[_0x35f2('0x31')]:_0x54a2fb[_0x35f2('0x2b')];if(_0x15724b[_0x35f2('0x2d')][_0x35f2('0x3d')]){_0x2bbb87[_0x35f2('0x42')]=[{'all':!![]}];}_0x2bbb87=_[_0x35f2('0x37')]({},_0x2bbb87,_0x15724b[_0x35f2('0x3c')]);return db[_0x35f2('0x29')][_0x35f2('0x46')](_0x2bbb87)[_0x35f2('0x23')](handleEntityNotFound(_0x28da3c,null))[_0x35f2('0x23')](function(_0xffad9a){if(_0xffad9a){var _0x4f024f=_0xffad9a[_0x35f2('0x47')]({'plain':!![]});_0x4f024f=qs['omit'](_0x4f024f,['id',_0x35f2('0x48'),_0x35f2('0x49'),_0x35f2('0x4a')]);_0x15724b[_0x35f2('0x44')]=_[_0x35f2('0x4b')](_0x15724b['body'],['id',_0x35f2('0x48'),_0x35f2('0x49')]);return db[_0x35f2('0x4c')][_0x35f2('0x4d')](function(_0x4beb5e){return db['UserProfile'][_0x35f2('0x43')](_[_0x35f2('0x37')](_0x4f024f,_0x15724b[_0x35f2('0x44')]),{'include':_0x15724b[_0x35f2('0x2d')][_0x35f2('0x3d')]?[{'all':!![]}]:undefined,'transaction':_0x4beb5e})[_0x35f2('0x23')](function(_0x550237){var _0x59fa5b=_0x550237[_0x35f2('0x47')]({'plain':!![]});return db['UserProfileSection'][_0x35f2('0x3e')]({'where':{'userProfileId':_0x15724b[_0x35f2('0x41')]['id']},'raw':!![]})[_0x35f2('0x23')](function(_0x1837c5){if(_0x1837c5){return BPromise[_0x35f2('0x4e')](_0x1837c5,function(_0xc50738){return new BPromise(function(_0x26e8e4,_0x5348b8){if(_0xc50738[_0x35f2('0x4f')]===null||_0xc50738[_0x35f2('0x4f')]===0x1)_0x26e8e4(null);return db[_0x35f2('0x50')][_0x35f2('0x3e')]({'where':{'sectionId':_0xc50738['id']},'raw':!![]})['then'](function(_0x155e8a){var _0x514101=_[_0x35f2('0x51')](_0x155e8a,function(_0x3ee3ff){return qs[_0x35f2('0x4b')](_0x3ee3ff,['id','createdAt',_0x35f2('0x49'),'sectionId']);});_0x26e8e4(_0x514101);})[_0x35f2('0x40')](function(_0x19baf7){_0x5348b8(_0x19baf7);});})[_0x35f2('0x23')](function(_0x3c9d7e){var _0x1d1653=qs[_0x35f2('0x4b')](_0xc50738,['id','createdAt',_0x35f2('0x49')]);_0x1d1653[_0x35f2('0x52')]=_0x59fa5b['id'];if(_0x3c9d7e)_0x1d1653[_0x35f2('0x53')]=_0x3c9d7e;return _0x1d1653;})[_0x35f2('0x23')](function(_0x5ea8b3){return db[_0x35f2('0x54')]['create'](_0x5ea8b3,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x4beb5e});});})['then'](function(){return _0x59fa5b;});}});});});}})['then'](respondWithResult(_0x28da3c,0xc9))['catch'](handleError(_0x28da3c,null));};exports['update']=function(_0x3f5c8f,_0x853dd3){if(_0x3f5c8f['body']['id']){delete _0x3f5c8f[_0x35f2('0x44')]['id'];}return db[_0x35f2('0x29')][_0x35f2('0x46')]({'where':{'id':_0x3f5c8f[_0x35f2('0x41')]['id']}})[_0x35f2('0x23')](handleEntityNotFound(_0x853dd3,null))['then'](saveUpdates(_0x3f5c8f[_0x35f2('0x44')],null))['then'](respondWithResult(_0x853dd3,null))[_0x35f2('0x40')](handleError(_0x853dd3,null));};exports['destroy']=function(_0x57f266,_0xabfa0){return db['UserProfile']['find']({'where':{'id':_0x57f266['params']['id']}})['then'](handleEntityNotFound(_0xabfa0,null))[_0x35f2('0x23')](removeEntity(_0xabfa0,null))[_0x35f2('0x40')](handleError(_0xabfa0,null));};exports['describe']=function(_0xb5b959,_0x2f6275){return db[_0x35f2('0x29')][_0x35f2('0x55')]()[_0x35f2('0x23')](respondWithResult(_0x2f6275,null))['catch'](handleError(_0x2f6275,null));};exports[_0x35f2('0x56')]=function(_0x2ca332,_0xabe883){var _0x48dbc6=_0x2ca332['body'];return db['UserProfile'][_0x35f2('0x46')]({'where':{'id':_0x2ca332[_0x35f2('0x41')]['id']}})['then'](handleEntityNotFound(_0xabe883,null))[_0x35f2('0x23')](function(_0x4ef1e4){if(_0x4ef1e4){return db[_0x35f2('0x4c')][_0x35f2('0x4d')](function(_0x579820){return db[_0x35f2('0x54')][_0x35f2('0x24')]({'where':{'userProfileId':_0x2ca332[_0x35f2('0x41')]['id'],'sectionId':_[_0x35f2('0x51')](_0x48dbc6,function(_0x48d31e){return _0x48d31e[_0x35f2('0x57')];})},'transaction':_0x579820})['then'](function(){var _0x3f5447=_[_0x35f2('0x51')](_0x48dbc6,function(_0x499f58){_0x499f58['userProfileId']=_0x2ca332[_0x35f2('0x41')]['id'];return _0x499f58;});var _0x1ec17d=[];return BPromise['each'](_0x3f5447,function(_0x3c5c97){return db[_0x35f2('0x54')][_0x35f2('0x43')](_0x3c5c97,{'include':[{'model':db['UserProfileResource'],'as':_0x35f2('0x53')}],'raw':!![],'transaction':_0x579820})[_0x35f2('0x23')](function(_0x5cc47e){_0x1ec17d[_0x35f2('0x58')](_0x5cc47e[_0x35f2('0x47')]({'plain':!![]}));});})[_0x35f2('0x23')](function(){return _0x1ec17d;});});});}})[_0x35f2('0x23')](function(_0xab7f5b){return _0xab7f5b;})[_0x35f2('0x23')](respondWithResult(_0xabe883,null))[_0x35f2('0x40')](handleError(_0xabe883,null));};exports['removeSections']=function(_0x4c27bb,_0x5b06b8){var _0x4e22f5;return db[_0x35f2('0x29')]['find']({'where':{'id':_0x4c27bb['params']['id']},'attributes':['id','name']})[_0x35f2('0x23')](handleEntityNotFound(_0x5b06b8,null))[_0x35f2('0x23')](function(_0x381fb4){if(_0x381fb4){_0x4e22f5=_0x381fb4;return db['UserProfileSection'][_0x35f2('0x24')]({'where':{'userProfileId':_0x4c27bb['params']['id'],'sectionId':_0x4c27bb[_0x35f2('0x2d')]['ids']}});}})['then'](function(){return _0x4e22f5;})['then'](respondWithStatusCode(_0x5b06b8,null))[_0x35f2('0x40')](handleError(_0x5b06b8,null));};exports['addResources']=function(_0x51f3a8,_0x3ca396){return db[_0x35f2('0x29')]['find']({'where':{'id':_0x51f3a8[_0x35f2('0x41')]['id']}})[_0x35f2('0x23')](handleEntityNotFound(_0x3ca396,null))[_0x35f2('0x23')](function(_0x5e5737){if(_0x5e5737){return db[_0x35f2('0x4c')][_0x35f2('0x4d')](function(_0xe0be0b){return db[_0x35f2('0x54')][_0x35f2('0x3e')]({'where':{'userProfileId':_0x51f3a8[_0x35f2('0x41')]['id']},'attributes':['id'],'raw':!![]})[_0x35f2('0x23')](function(_0x25cff8){if(_0x25cff8){return db[_0x35f2('0x54')][_0x35f2('0x24')]({'where':{'userProfileId':_0x51f3a8['params']['id'],'id':_[_0x35f2('0x51')](_0x25cff8,function(_0x5b59c4){return _0x5b59c4['id'];})},'transaction':_0xe0be0b});}})['then'](function(_0x2fe29d){var _0x21a893=_[_0x35f2('0x51')](_0x51f3a8[_0x35f2('0x44')],function(_0x392566){_0x392566['userProfileId']=_0x51f3a8[_0x35f2('0x41')]['id'];return _0x392566;});return db[_0x35f2('0x54')][_0x35f2('0x59')](_0x21a893,{'raw':!![],'transaction':_0xe0be0b});})[_0x35f2('0x23')](function(_0x1b640d){var _0x22b21f=_[_0x35f2('0x3b')](_['map'](_0x1b640d,function(_0x508fa7){return _0x508fa7[_0x35f2('0x47')]({'plain':!![]});}),{'includeAll':![]});if(_0x22b21f){return db[_0x35f2('0x54')][_0x35f2('0x3e')]({'where':{'userProfileId':_0x51f3a8[_0x35f2('0x41')]['id'],'sectionId':_[_0x35f2('0x51')](_0x22b21f,function(_0x17ea02){return _0x17ea02[_0x35f2('0x57')];})},'attributes':['id',_0x35f2('0x57')],'raw':!![]})[_0x35f2('0x23')](function(_0x5103aa){var _0x4f645c=_[_0x35f2('0x51')](_0x51f3a8[_0x35f2('0x44')],function(_0x5c1990){_0x5c1990[_0x35f2('0x52')]=_0x51f3a8[_0x35f2('0x41')]['id'];return _0x5c1990;});return db['UserProfileResource'][_0x35f2('0x59')](_0x4f645c,{'raw':!![],'transaction':_0xe0be0b});});}})['catch'](handleError(_0x3ca396,null));});}})['then'](function(_0x2bcce5){var _0x142eec=_[_0x35f2('0x51')](_0x2bcce5,function(_0x5cbb59){return _0x5cbb59['get']({'plain':!![]});});})['then'](respondWithResult(_0x3ca396,null))['catch'](handleError(_0x3ca396,null));};exports[_0x35f2('0x5a')]=function(_0x44e3b5,_0x4416f9,_0xc76505){var _0x5d1961;return db[_0x35f2('0x29')][_0x35f2('0x46')]({'where':{'id':_0x44e3b5['params']['id']}})[_0x35f2('0x23')](handleEntityNotFound(_0x4416f9,null))[_0x35f2('0x23')](function(_0x54a406){if(_0x54a406){return _0x54a406[_0x35f2('0x5a')](_0x44e3b5['query'][_0x35f2('0x5b')]);}})[_0x35f2('0x23')](respondWithStatusCode(_0x4416f9,null))['catch'](handleError(_0x4416f9,null));};exports[_0x35f2('0x5c')]=function(_0x5aa07b,_0x2d9168){var _0x3eab19={'raw':![],'where':{}};var _0x3d4869={};var _0x2eaaec={'count':0x0,'rows':[]};var _0x170166=_0x5aa07b[_0x35f2('0x2d')][_0x35f2('0x5d')];if(typeof _0x170166===_0x35f2('0x5e')){throw new db[(_0x35f2('0x5f'))][(_0x35f2('0x60'))](_0x35f2('0x61'));}var _0x2308c6=_0x5aa07b[_0x35f2('0x2d')][_0x35f2('0x62')]||![];var _0x29ebe8=getQueryModels(_0x170166,_0x2308c6);if(typeof _0x29ebe8[_0x35f2('0x63')]===_0x35f2('0x5e')){throw new db[(_0x35f2('0x5f'))][(_0x35f2('0x60'))](_0x35f2('0x64')+_0x170166+'\x27');}var _0x123775=[];if(!_[_0x35f2('0x65')](_0x29ebe8[_0x35f2('0x66')])){_0x123775=_0x29ebe8[_0x35f2('0x66')];}else{_0x123775=[{'name':_0x170166}];}return db['UserProfile'][_0x35f2('0x67')]({'where':{'id':_0x5aa07b[_0x35f2('0x41')]['id']}})[_0x35f2('0x23')](handleEntityNotFound(_0x2d9168,null))[_0x35f2('0x23')](function(_0x4595c4){if(_0x4595c4){var _0x41551a=[];for(var _0x3f8cf1=0x0;_0x3f8cf1<_0x123775['length'];_0x3f8cf1++){_0x41551a['push'](db['UserProfileSection'][_0x35f2('0x67')]({'where':{'userProfileId':_0x4595c4['id'],'name':_0x123775[_0x3f8cf1]['name']},'raw':!![]}));}return BPromise[_0x35f2('0x68')](_0x41551a);}})[_0x35f2('0x23')](function(_0x2159f9){var _0x15708e=_[_0x35f2('0x3b')](_0x2159f9,function(_0x2100af){return _0x2100af?_0x2100af:undefined;});var _0x202933=_['filter'](_0x123775,[_0x35f2('0x69'),!![]]);var _0x58e2ea=_[_0x35f2('0x65')](_0x15708e)&&_[_0x35f2('0x65')](_0x202933)?null:_[_0x35f2('0x6a')](_0x202933,_0x15708e);if(_0x58e2ea){var _0x45a2d3=[];for(var _0x1ea5e2=0x0;_0x1ea5e2<_0x58e2ea['length'];_0x1ea5e2++){var _0x35df39=_['find'](_0x123775,function(_0x282f01){return _0x58e2ea[_0x1ea5e2]?_0x282f01['name']===_0x58e2ea[_0x1ea5e2][_0x35f2('0x27')]:null;});if(_0x35df39){if(_0x58e2ea[_0x1ea5e2][_0x35f2('0x69')]){_0x45a2d3['push'](getAllResources(_0x29ebe8['childModel'],_0x58e2ea[_0x1ea5e2]));}else{if(!_0x58e2ea[_0x1ea5e2][_0x35f2('0x4f')]){_0x45a2d3[_0x35f2('0x58')](getAllowedResources(_0x35df39,_0x58e2ea[_0x1ea5e2]));}else{if(_0x35df39[_0x35f2('0x2b')]){_0x45a2d3[_0x35f2('0x58')](getAllFilteredResources(_0x35df39,_0x58e2ea[_0x1ea5e2]));}}}}}return BPromise['all'](_0x45a2d3);}else{return null;}})[_0x35f2('0x23')](function(_0x3f45b6){var _0x62d5ca=_0x3f45b6;var _0x236ac3=null;if(_0x62d5ca){_0x236ac3=_0x62d5ca[_0x35f2('0x32')]===0x1?_0x62d5ca[0x0]:null;}if(_0x236ac3||_0x62d5ca){var _0x456978=db[_0x29ebe8[_0x35f2('0x63')]][_0x35f2('0x2a')];_0x3d4869[_0x35f2('0x2b')]=_[_0x35f2('0x2c')](_0x456978);_0x3d4869['query']=_[_0x35f2('0x2c')](_0x5aa07b[_0x35f2('0x2d')]);_0x3d4869['filters']=_[_0x35f2('0x2f')](_0x3d4869[_0x35f2('0x2b')],_0x3d4869[_0x35f2('0x2d')]);_0x3eab19['attributes']=_[_0x35f2('0x2f')](_0x3d4869[_0x35f2('0x2b')],qs[_0x35f2('0x30')](_0x5aa07b[_0x35f2('0x2d')][_0x35f2('0x30')]));_0x3eab19[_0x35f2('0x31')]=_0x3eab19[_0x35f2('0x31')][_0x35f2('0x32')]?_0x3eab19[_0x35f2('0x31')]:_0x3d4869[_0x35f2('0x2b')];if(!_0x5aa07b[_0x35f2('0x2d')][_0x35f2('0x6b')]('nolimit')){_0x3eab19[_0x35f2('0x1f')]=qs[_0x35f2('0x1f')](_0x5aa07b[_0x35f2('0x2d')][_0x35f2('0x1f')]);_0x3eab19[_0x35f2('0x1e')]=qs['offset'](_0x5aa07b['query']['offset']);}_0x3eab19[_0x35f2('0x34')]=qs[_0x35f2('0x6c')](_0x5aa07b[_0x35f2('0x2d')][_0x35f2('0x6c')]);_0x3eab19[_0x35f2('0x35')]=qs[_0x35f2('0x2e')](_[_0x35f2('0x36')](_0x5aa07b[_0x35f2('0x2d')],_0x3d4869[_0x35f2('0x2e')]));var _0x530d3b=[];if(_0x236ac3){var _0x278a24=_[_0x35f2('0x46')](_0x123775,[_0x35f2('0x27'),_0x236ac3[_0x35f2('0x27')]]);if(_0x278a24[_0x35f2('0x6d')]){var _0x41aaaf={};_0x41aaaf[_0x278a24[_0x35f2('0x6e')]]=_0x236ac3[_0x35f2('0x6f')];_0x530d3b[_0x35f2('0x58')](_0x41aaaf);}else{_0x3eab19[_0x35f2('0x35')]['id']=_0x236ac3[_0x35f2('0x70')];}}else{var _0x530d3b=[];for(var _0x4b9a7f=0x0;_0x4b9a7f<_0x62d5ca[_0x35f2('0x32')];_0x4b9a7f++){var _0x278a24=_['find'](_0x123775,[_0x35f2('0x27'),_0x62d5ca[_0x4b9a7f][_0x35f2('0x27')]]);if(_0x278a24['field']){var _0x41aaaf={};if(_0x278a24[_0x35f2('0x6d')]==='id'){_0x41aaaf[_0x278a24[_0x35f2('0x6e')]]=_0x62d5ca[_0x4b9a7f][_0x35f2('0x70')];}else{_0x41aaaf[_0x278a24['foreignKey']]=_0x62d5ca[_0x4b9a7f][_0x35f2('0x6f')];}_0x530d3b['push'](_0x41aaaf);}else{if(!_0x3eab19[_0x35f2('0x35')]['id'])_0x3eab19['where']['id']=[];_0x62d5ca[_0x4b9a7f]['resourceIds']['forEach'](function(_0x3d0ce0){_0x3eab19[_0x35f2('0x35')]['id'][_0x35f2('0x58')](_0x3d0ce0);});}}}if(!_[_0x35f2('0x65')](_0x530d3b)){_0x3eab19['where']=_[_0x35f2('0x37')](_0x3eab19['where'],{'$or':_0x530d3b});}if(_0x5aa07b[_0x35f2('0x2d')]['filter']){_0x3eab19[_0x35f2('0x35')]=_[_0x35f2('0x37')](_0x3eab19[_0x35f2('0x35')],{'$or':_[_0x35f2('0x51')](_0x456978,function(_0x2f38ec){if(_0x2f38ec[_0x35f2('0x38')]['key']!=='VIRTUAL'){var _0x31f690={};_0x31f690[_0x2f38ec[_0x35f2('0x6d')]]={'$like':'%'+_0x5aa07b[_0x35f2('0x2d')][_0x35f2('0x3b')]+'%'};return _0x31f690;}})});}_0x3eab19=_['merge']({},_0x3eab19,_0x5aa07b[_0x35f2('0x3c')]);if(_0x236ac3&&!_0x236ac3[_0x35f2('0x4f')]&&_0x29ebe8['childModel']===_0x35f2('0x71')){if(_0x5aa07b['query'][_0x35f2('0x3d')]){_0x3eab19[_0x35f2('0x42')]=[{'all':!![]}];}return db[_0x29ebe8['childModel']]['findAll'](_0x3eab19)[_0x35f2('0x23')](function(_0xe1a526){var _0x3bf296=[];_0xe1a526[_0x35f2('0x72')](function(_0x638b9f){var _0x4d647e;switch(_0x638b9f[_0x35f2('0x73')]){case _0x35f2('0x74'):_0x4d647e=_[_0x35f2('0x46')](_0x236ac3[_0x35f2('0x70')],function(_0x501c62){return _0x501c62['id']===_0x638b9f[_0x35f2('0x75')]&&_0x501c62[_0x35f2('0x38')]==='DefaultReports';});break;case _0x35f2('0x76'):_0x4d647e=_[_0x35f2('0x46')](_0x236ac3[_0x35f2('0x70')],function(_0xd47af4){return _0xd47af4['id']===_0x638b9f[_0x35f2('0x75')]&&_0xd47af4['type']===_0x35f2('0x77');});break;}if(_0x4d647e)_0x3bf296['push'](_0x638b9f);});_0x2eaaec[_0x35f2('0x1d')]=_0x3bf296[_0x35f2('0x32')];_0x2eaaec[_0x35f2('0x3f')]=_0x3bf296;return _0x2eaaec;});}else{return db[_0x29ebe8[_0x35f2('0x63')]][_0x35f2('0x1d')]({'where':_0x3eab19['where']})[_0x35f2('0x23')](function(_0x55006e){_0x2eaaec[_0x35f2('0x1d')]=_0x55006e;if(_0x5aa07b['query'][_0x35f2('0x3d')]){if(_0x29ebe8['childModel']==='CmContact'){_0x3eab19[_0x35f2('0x42')]=[{'model':db[_0x35f2('0x78')],'as':'Tags','attributes':['id',_0x35f2('0x27'),_0x35f2('0x79')],'required':_0x5aa07b['query']['tag']?!![]:![]},{'model':db[_0x35f2('0x78')],'as':'ThroughTags','attributes':['id',_0x35f2('0x27'),_0x35f2('0x79')],'through':_0x5aa07b[_0x35f2('0x2d')][_0x35f2('0x7a')]?{'attributes':[],'where':{'TagId':_0x5aa07b[_0x35f2('0x2d')][_0x35f2('0x7a')]||undefined}}:{},'required':_0x5aa07b['query'][_0x35f2('0x7a')]?!![]:![]}];}else{_0x3eab19['include']=[{'all':!![]}];}}return db[_0x29ebe8[_0x35f2('0x63')]][_0x35f2('0x3e')](_0x3eab19);})['then'](function(_0x46ed1a){_0x2eaaec[_0x35f2('0x3f')]=_0x46ed1a;return _0x2eaaec;});}}else{return _0x2eaaec;}})['then'](respondWithFilteredResult(_0x2d9168,_0x3eab19))[_0x35f2('0x40')](handleError(_0x2d9168,null));};function getAllResources(_0x483e95,_0x16d350){return new BPromise(function(_0x5ef93e,_0x564322){if(_0x16d350){var _0x1305b6=_0x16d350[_0x35f2('0x3b')]?{[_0x16d350[_0x35f2('0x3b')][_0x35f2('0x6d')]]:_0x16d350[_0x35f2('0x3b')][_0x35f2('0x7b')]}:undefined;return db[_0x483e95]['findAll']({'where':_0x1305b6,'raw':!![]})['then'](function(_0x479852){_0x16d350[_0x35f2('0x70')]=_[_0x35f2('0x51')](_0x479852,'id');_0x5ef93e(_0x16d350);})[_0x35f2('0x40')](function(_0x2fa72d){_0x564322(_0x2fa72d);});}else{_0x5ef93e(null);}});}function getAllFilteredResources(_0x206e85,_0x15ce5c){return new BPromise(function(_0x27d0a3,_0x2f470b){var _0x3e9bb2=_0x206e85[_0x35f2('0x3b')]?{[_0x206e85[_0x35f2('0x3b')][_0x35f2('0x6d')]]:_0x206e85['filter'][_0x35f2('0x7b')]}:undefined;return db[_0x206e85['model']][_0x35f2('0x3e')]({'where':_0x3e9bb2,'raw':!![]})[_0x35f2('0x23')](function(_0x774747){_0x15ce5c[_0x35f2('0x6f')]=_[_0x35f2('0x51')](_0x774747,function(_0x3368cf){return _0x3368cf[_0x35f2('0x27')];});_0x27d0a3(_0x15ce5c);})[_0x35f2('0x40')](function(_0x3a7717){_0x2f470b(_0x3a7717);});});}function getAllowedResources(_0x495459,_0x33f7cf){return new BPromise(function(_0x28b8ee,_0x5aa221){if(_0x33f7cf){return db['UserProfileResource'][_0x35f2('0x3e')]({'where':{'sectionId':_0x33f7cf['id']},'raw':!![]})[_0x35f2('0x23')](function(_0x3a87ee){if(_0x495459[_0x35f2('0x6d')]&&_0x495459[_0x35f2('0x6d')]!=='id'){_0x33f7cf['resourceFields']=_['map'](_0x3a87ee,function(_0x3d2f5b){return _0x3d2f5b[_0x495459[_0x35f2('0x6d')]];});}else{if(_0x495459[_0x35f2('0x63')]===_0x35f2('0x71')){_0x33f7cf[_0x35f2('0x70')]=_[_0x35f2('0x51')](_0x3a87ee,function(_0x54fb0b){return{'id':_0x54fb0b[_0x35f2('0x7c')],'type':_0x54fb0b[_0x35f2('0x38')]};});}else{_0x33f7cf['resourceIds']=_[_0x35f2('0x51')](_0x3a87ee,function(_0x146fb4){return _0x146fb4[_0x35f2('0x7c')];});}}_0x28b8ee(_0x33f7cf);})['catch'](function(_0xeb1c12){_0x5aa221(_0xeb1c12);});}else{_0x28b8ee(null);}});}function getQueryModels(_0x49c2c9,_0x5df876){var _0x13e80a=_0x49c2c9[_0x35f2('0x7d')]();var _0x334f93={'childModel':undefined,'parentSections':[]};switch(_0x13e80a){case _0x35f2('0x7e'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0x7f');break;case _0x35f2('0x80'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0x81');break;case'squarerecordings':_0x334f93[_0x35f2('0x63')]=_0x35f2('0x82');_0x334f93[_0x35f2('0x66')]=[{'name':_0x35f2('0x83'),'field':_0x35f2('0x27'),'foreignKey':_0x35f2('0x84')}];break;case _0x35f2('0x85'):_0x334f93[_0x35f2('0x63')]='JscriptyProject';break;case'contacts':_0x334f93['childModel']='CmContact';_0x334f93['parentSections']=[{'name':_0x35f2('0x86'),'field':'id','foreignKey':_0x35f2('0x87')}];break;case _0x35f2('0x88'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0x89');break;case'companies':_0x334f93[_0x35f2('0x63')]=_0x35f2('0x8a');break;case _0x35f2('0x8b'):_0x334f93[_0x35f2('0x63')]='CmCustomField';break;case _0x35f2('0x8c'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0x8d');break;case _0x35f2('0x8e'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0x8f');break;case'faxqueues':_0x334f93['childModel']=_0x35f2('0x90');break;case'faxaccounts':_0x334f93[_0x35f2('0x63')]='FaxAccount';break;case _0x35f2('0x91'):case _0x35f2('0x92'):case _0x35f2('0x93'):_0x334f93[_0x35f2('0x63')]='VoiceExtension';break;case'contexts':_0x334f93[_0x35f2('0x63')]=_0x35f2('0x94');break;case _0x35f2('0x95'):_0x334f93[_0x35f2('0x63')]='VoiceMail';break;case'voicerecordings':_0x334f93['childModel']=_0x35f2('0x96');_0x334f93[_0x35f2('0x66')]=[{'name':'Agents','field':'name','foreignKey':_0x35f2('0x97'),'model':_0x35f2('0x98'),'filter':{'field':'role','value':['agent']}},{'name':_0x35f2('0x99'),'field':_0x35f2('0x27'),'foreignKey':'membername','model':'User','filter':{'field':_0x35f2('0x9a'),'value':[_0x35f2('0x9b')]}},{'name':_0x35f2('0x9c'),'field':_0x35f2('0x27'),'foreignKey':_0x35f2('0x9d'),'model':'VoiceQueue','filter':{'field':_0x35f2('0x38'),'value':[_0x35f2('0x9e')]}},{'name':'QueueCampaigns','field':_0x35f2('0x27'),'foreignKey':'queue','model':_0x35f2('0x9f'),'filter':{'field':_0x35f2('0x38'),'value':['outbound']}}];break;case _0x35f2('0xa0'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xa1');break;case _0x35f2('0xa2'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xa3');break;case _0x35f2('0xa4'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xa5');break;case _0x35f2('0xa6'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xa7');break;case _0x35f2('0xa8'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xa9');break;case _0x35f2('0xaa'):_0x334f93['childModel']='MailAccount';break;case _0x35f2('0xab'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xac');break;case'openchannelqueues':_0x334f93['childModel']=_0x35f2('0xad');break;case'openchannelaccounts':_0x334f93[_0x35f2('0x63')]=_0x35f2('0xae');break;case'smsqueues':_0x334f93[_0x35f2('0x63')]=_0x35f2('0xaf');break;case _0x35f2('0xb0'):_0x334f93[_0x35f2('0x63')]='SmsAccount';break;case _0x35f2('0xb1'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xb2');break;case _0x35f2('0xb3'):case _0x35f2('0xb4'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0x9f');if(_0x5df876){_0x334f93['parentSections']=[{'name':_0x35f2('0x9c')},{'name':_0x35f2('0xb5')}];}break;case _0x35f2('0xb6'):case _0x35f2('0xb7'):case _0x35f2('0xb8'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0x98');if(_0x5df876){_0x334f93[_0x35f2('0x66')]=[{'name':_0x35f2('0xb9'),'filter':{'field':_0x35f2('0x9a'),'value':[_0x35f2('0xba'),_0x35f2('0xbb')]},'ignore':!![]},{'name':_0x35f2('0xbc')},{'name':'Telephones'}];}break;case _0x35f2('0xbd'):_0x334f93['childModel']='ZendeskAccount';break;case _0x35f2('0xbe'):_0x334f93[_0x35f2('0x63')]='SalesforceAccount';break;case _0x35f2('0xbf'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xc0');break;case _0x35f2('0xc1'):_0x334f93['childModel']=_0x35f2('0xc2');break;case _0x35f2('0xc3'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xc4');break;case'zohoaccounts':_0x334f93[_0x35f2('0x63')]=_0x35f2('0xc5');break;case _0x35f2('0xc6'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0x98');break;case _0x35f2('0xc7'):_0x334f93[_0x35f2('0x63')]='CannedAnswer';break;case'dispositions':_0x334f93[_0x35f2('0x63')]=_0x35f2('0xc8');break;case _0x35f2('0xc9'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xca');break;case _0x35f2('0xcb'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xcc');break;case _0x35f2('0xcd'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xce');break;case'scheduler':_0x334f93[_0x35f2('0x63')]=_0x35f2('0xcf');break;case _0x35f2('0xd0'):_0x334f93['childModel']=_0x35f2('0xd1');break;case _0x35f2('0xd2'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0x78');break;case _0x35f2('0xd3'):_0x334f93[_0x35f2('0x63')]='Template';break;case _0x35f2('0xd4'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xd5');break;case'trunks':_0x334f93[_0x35f2('0x63')]=_0x35f2('0xd6');break;case _0x35f2('0xd7'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xd8');break;case'plugins':_0x334f93[_0x35f2('0x63')]='Plugin';break;case _0x35f2('0xd9'):_0x334f93[_0x35f2('0x63')]='AnalyticExtractedReport';_0x334f93[_0x35f2('0x66')]=[{'name':'Reports','field':'id','foreignKey':_0x35f2('0x75')}];break;case _0x35f2('0xda'):_0x334f93[_0x35f2('0x63')]=_0x35f2('0xdb');break;default:return _0x334f93;}return _0x334f93;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index a76dfbf..068e978 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 _0x4e86=['hasOwnProperty','hook','exports','events','UserProfile','setMaxListeners','update','emit'];(function(_0x4146b0,_0x2383ce){var _0x3decf1=function(_0x57f419){while(--_0x57f419){_0x4146b0['push'](_0x4146b0['shift']());}};_0x3decf1(++_0x2383ce);}(_0x4e86,0xf3));var _0x64e8=function(_0x27403a,_0x3cfa40){_0x27403a=_0x27403a-0x0;var _0x1de9eb=_0x4e86[_0x27403a];return _0x1de9eb;};'use strict';var EventEmitter=require(_0x64e8('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x64e8('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x64e8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x64e8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5908d1){return function(_0x9c9ff,_0x585536,_0x3b8da9){UserProfileEvents[_0x64e8('0x4')](_0x5908d1+':'+_0x9c9ff['id'],_0x9c9ff);UserProfileEvents[_0x64e8('0x4')](_0x5908d1,_0x9c9ff);_0x3b8da9(null);};}for(var e in events){if(events[_0x64e8('0x5')](e)){var event=events[e];UserProfile[_0x64e8('0x6')](e,emitEvent(event));}}module[_0x64e8('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x1107=['events','../../mysqldb','UserProfile','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x466bc5,_0x3a0f2a){var _0x138952=function(_0x392fa2){while(--_0x392fa2){_0x466bc5['push'](_0x466bc5['shift']());}};_0x138952(++_0x3a0f2a);}(_0x1107,0xd8));var _0x7110=function(_0x1937c8,_0x5a1f28){_0x1937c8=_0x1937c8-0x0;var _0x48bedf=_0x1107[_0x1937c8];return _0x48bedf;};'use strict';var EventEmitter=require(_0x7110('0x0'));var UserProfile=require(_0x7110('0x1'))['db'][_0x7110('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7110('0x3'),'afterDestroy':_0x7110('0x4')};function emitEvent(_0x5a5e14){return function(_0x250d85,_0x422095,_0x436cc3){UserProfileEvents[_0x7110('0x5')](_0x5a5e14+':'+_0x250d85['id'],_0x250d85);UserProfileEvents[_0x7110('0x5')](_0x5a5e14,_0x250d85);_0x436cc3(null);};}for(var e in events){if(events[_0x7110('0x6')](e)){var event=events[e];UserProfile[_0x7110('0x7')](e,emitEvent(event));}}module[_0x7110('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index a89c7e9..4e0007d 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 _0x40e4=['lodash','util','api','moment','./userProfile.attributes','exports','define','UserProfile','user_profiles'];(function(_0x447f6d,_0x36fc29){var _0x56a9b8=function(_0x16444e){while(--_0x16444e){_0x447f6d['push'](_0x447f6d['shift']());}};_0x56a9b8(++_0x36fc29);}(_0x40e4,0xa2));var _0x440e=function(_0x381bff,_0x19d01f){_0x381bff=_0x381bff-0x0;var _0x201ab1=_0x40e4[_0x381bff];return _0x201ab1;};'use strict';var _=require(_0x440e('0x0'));var util=require(_0x440e('0x1'));var logger=require('../../config/logger')(_0x440e('0x2'));var moment=require(_0x440e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x440e('0x4'));module[_0x440e('0x5')]=function(_0x329fb5,_0x41c4a1){return _0x329fb5[_0x440e('0x6')](_0x440e('0x7'),attributes,{'tableName':_0x440e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20d5=['UserProfile','user_profiles','util','../../config/logger','api','moment','./userProfile.attributes'];(function(_0x3c0fc3,_0x154205){var _0x465bf0=function(_0x56bfb2){while(--_0x56bfb2){_0x3c0fc3['push'](_0x3c0fc3['shift']());}};_0x465bf0(++_0x154205);}(_0x20d5,0x175));var _0x520d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x520d('0x0'));var logger=require(_0x520d('0x1'))(_0x520d('0x2'));var moment=require(_0x520d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x520d('0x4'));module['exports']=function(_0x2499c7,_0x523857){return _0x2499c7['define'](_0x520d('0x5'),attributes,{'tableName':_0x520d('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 4613e17..dc92fe6 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 _0x1461=['result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','UserProfile,\x20%s,\x20%s','message'];(function(_0x11c556,_0xb0e143){var _0x14839c=function(_0x199aa3){while(--_0x199aa3){_0x11c556['push'](_0x11c556['shift']());}};_0x14839c(++_0xb0e143);}(_0x1461,0xb8));var _0x1146=function(_0x31a180,_0x3924b9){_0x31a180=_0x31a180-0x0;var _0x4b0502=_0x1461[_0x31a180];return _0x4b0502;};'use strict';var _=require('lodash');var util=require(_0x1146('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1146('0x1'));var fs=require('fs');var Redis=require(_0x1146('0x2'));var db=require(_0x1146('0x3'))['db'];var utils=require(_0x1146('0x4'));var logger=require('../../config/logger')(_0x1146('0x5'));var config=require(_0x1146('0x6'));var jayson=require(_0x1146('0x7'));var client=jayson[_0x1146('0x8')][_0x1146('0x9')]({'port':0x232a});config[_0x1146('0xa')]=_['defaults'](config['redis'],{'host':_0x1146('0xb'),'port':0x18eb});var socket=require(_0x1146('0xc'))(new Redis(config['redis']));require(_0x1146('0xd'))[_0x1146('0xe')](socket);function respondWithRpcPromise(_0xc0fdf2,_0x4e6a57,_0x128906){return new BPromise(function(_0x3a3f87,_0x186c04){return client[_0x1146('0xf')](_0xc0fdf2,_0x128906)['then'](function(_0x3a5e14){logger[_0x1146('0x10')]('UserProfile,\x20%s,\x20%s',_0x4e6a57,_0x1146('0x11'));logger[_0x1146('0x12')](_0x1146('0x13'),_0x4e6a57,_0x1146('0x11'),JSON['stringify'](_0x3a5e14));if(_0x3a5e14['error']){if(_0x3a5e14[_0x1146('0x14')][_0x1146('0x15')]===0x1f4){logger[_0x1146('0x14')](_0x1146('0x16'),_0x4e6a57,_0x3a5e14[_0x1146('0x14')][_0x1146('0x17')]);return _0x186c04(_0x3a5e14[_0x1146('0x14')][_0x1146('0x17')]);}logger[_0x1146('0x14')](_0x1146('0x16'),_0x4e6a57,_0x3a5e14[_0x1146('0x14')][_0x1146('0x17')]);return _0x3a3f87(_0x3a5e14['error'][_0x1146('0x17')]);}else{logger['info'](_0x1146('0x16'),_0x4e6a57,'request\x20sent');_0x3a3f87(_0x3a5e14[_0x1146('0x18')][_0x1146('0x17')]);}})[_0x1146('0x19')](function(_0x2e41f0){logger[_0x1146('0x14')](_0x1146('0x16'),_0x4e6a57,_0x2e41f0);_0x186c04(_0x2e41f0);});});} \ No newline at end of file +var _0x70a6=['error','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5ba6e2,_0x48e57b){var _0x51c376=function(_0x176a3c){while(--_0x176a3c){_0x5ba6e2['push'](_0x5ba6e2['shift']());}};_0x51c376(++_0x48e57b);}(_0x70a6,0x12d));var _0x670a=function(_0x4dfbdd,_0x571043){_0x4dfbdd=_0x4dfbdd-0x0;var _0xc6ecb5=_0x70a6[_0x4dfbdd];return _0xc6ecb5;};'use strict';var _=require(_0x670a('0x0'));var util=require('util');var moment=require(_0x670a('0x1'));var BPromise=require('bluebird');var rs=require(_0x670a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x670a('0x3'))['db'];var utils=require(_0x670a('0x4'));var logger=require('../../config/logger')(_0x670a('0x5'));var config=require(_0x670a('0x6'));var jayson=require(_0x670a('0x7'));var client=jayson[_0x670a('0x8')][_0x670a('0x9')]({'port':0x232a});config[_0x670a('0xa')]=_[_0x670a('0xb')](config[_0x670a('0xa')],{'host':_0x670a('0xc'),'port':0x18eb});var socket=require(_0x670a('0xd'))(new Redis(config[_0x670a('0xa')]));require(_0x670a('0xe'))[_0x670a('0xf')](socket);function respondWithRpcPromise(_0x132c30,_0x51016c,_0x237b1d){return new BPromise(function(_0x44b83f,_0x7d0aa){return client[_0x670a('0x10')](_0x132c30,_0x237b1d)[_0x670a('0x11')](function(_0x2eb7ea){logger[_0x670a('0x12')](_0x670a('0x13'),_0x51016c,_0x670a('0x14'));logger['debug'](_0x670a('0x15'),_0x51016c,_0x670a('0x14'),JSON[_0x670a('0x16')](_0x2eb7ea));if(_0x2eb7ea[_0x670a('0x17')]){if(_0x2eb7ea[_0x670a('0x17')]['code']===0x1f4){logger['error'](_0x670a('0x13'),_0x51016c,_0x2eb7ea['error'][_0x670a('0x18')]);return _0x7d0aa(_0x2eb7ea[_0x670a('0x17')][_0x670a('0x18')]);}logger[_0x670a('0x17')]('UserProfile,\x20%s,\x20%s',_0x51016c,_0x2eb7ea[_0x670a('0x17')][_0x670a('0x18')]);return _0x44b83f(_0x2eb7ea[_0x670a('0x17')][_0x670a('0x18')]);}else{logger[_0x670a('0x12')](_0x670a('0x13'),_0x51016c,'request\x20sent');_0x44b83f(_0x2eb7ea[_0x670a('0x19')][_0x670a('0x18')]);}})[_0x670a('0x1a')](function(_0x1a091f){logger[_0x670a('0x17')](_0x670a('0x13'),_0x51016c,_0x1a091f);_0x7d0aa(_0x1a091f);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 01b1130..d18e26a 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 _0x4006=['save','remove','update','emit','length'];(function(_0x2ecb9c,_0x2e7aab){var _0x24cbb0=function(_0x59deb3){while(--_0x59deb3){_0x2ecb9c['push'](_0x2ecb9c['shift']());}};_0x24cbb0(++_0x2e7aab);}(_0x4006,0x1c7));var _0x6400=function(_0x5228ba,_0x2c2006){_0x5228ba=_0x5228ba-0x0;var _0x282e5c=_0x4006[_0x5228ba];return _0x282e5c;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x6400('0x0'),_0x6400('0x1'),_0x6400('0x2')];function createListener(_0x8fd587,_0x5c8ece){return function(_0x4b7a00){_0x5c8ece[_0x6400('0x3')](_0x8fd587,_0x4b7a00);};}function removeListener(_0x4b0418,_0xd858df){return function(){UserProfileEvents['removeListener'](_0x4b0418,_0xd858df);};}exports['register']=function(_0x2dbd03){for(var _0x599e6f=0x0,_0x32c0db=events[_0x6400('0x4')];_0x599e6f<_0x32c0db;_0x599e6f++){var _0x2bf4f8=events[_0x599e6f];var _0x250dba=createListener('userProfile:'+_0x2bf4f8,_0x2dbd03);UserProfileEvents['on'](_0x2bf4f8,_0x250dba);}}; \ No newline at end of file +var _0xb7b6=['register','length','userProfile:','./userProfile.events','save','emit'];(function(_0x306380,_0x5a4599){var _0x4eeebf=function(_0x5c6a04){while(--_0x5c6a04){_0x306380['push'](_0x306380['shift']());}};_0x4eeebf(++_0x5a4599);}(_0xb7b6,0x15f));var _0x6b7b=function(_0xcda1e5,_0x244d5c){_0xcda1e5=_0xcda1e5-0x0;var _0x4c0471=_0xb7b6[_0xcda1e5];return _0x4c0471;};'use strict';var UserProfileEvents=require(_0x6b7b('0x0'));var events=[_0x6b7b('0x1'),'remove','update'];function createListener(_0x41f2f7,_0x104737){return function(_0x4de582){_0x104737[_0x6b7b('0x2')](_0x41f2f7,_0x4de582);};}function removeListener(_0x2f4878,_0x50a8d6){return function(){UserProfileEvents['removeListener'](_0x2f4878,_0x50a8d6);};}exports[_0x6b7b('0x3')]=function(_0x43e9ed){for(var _0x3cce80=0x0,_0xff519e=events[_0x6b7b('0x4')];_0x3cce80<_0xff519e;_0x3cce80++){var _0x483b9c=events[_0x3cce80];var _0x49a6c8=createListener(_0x6b7b('0x5')+_0x483b9c,_0x43e9ed);UserProfileEvents['on'](_0x483b9c,_0x49a6c8);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index d9c2ca1..34797b6 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 _0xd0e4=['get','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller'];(function(_0x37da21,_0x11a0eb){var _0x18865e=function(_0x49c773){while(--_0x49c773){_0x37da21['push'](_0x37da21['shift']());}};_0x18865e(++_0x11a0eb);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0x459240,_0x4c7c29){_0x459240=_0x459240-0x0;var _0x2b9388=_0xd0e4[_0x459240];return _0x2b9388;};'use strict';var multer=require(_0x4d0e('0x0'));var util=require(_0x4d0e('0x1'));var path=require(_0x4d0e('0x2'));var timeout=require(_0x4d0e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x4d0e('0x4'));var interaction=require(_0x4d0e('0x5'));var config=require(_0x4d0e('0x6'));var controller=require(_0x4d0e('0x7'));router[_0x4d0e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4d0e('0x9'),auth[_0x4d0e('0xa')](),controller['describe']);router[_0x4d0e('0x8')](_0x4d0e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4d0e('0xc')]('/',auth['isAuthenticated'](),controller[_0x4d0e('0xd')]);router[_0x4d0e('0xe')](_0x4d0e('0xb'),auth['isAuthenticated'](),controller[_0x4d0e('0xf')]);router[_0x4d0e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4d0e('0x11')]);module[_0x4d0e('0x12')]=router; \ No newline at end of file +var _0x2f68=['./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x2f68,0x12b));var _0x82f6=function(_0x2468e2,_0x2b4602){_0x2468e2=_0x2468e2-0x0;var _0x2d0112=_0x2f68[_0x2468e2];return _0x2d0112;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express[_0x82f6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var controller=require(_0x82f6('0x7'));router[_0x82f6('0x8')]('/',auth[_0x82f6('0x9')](),controller['index']);router['get'](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0xb')]);router[_0x82f6('0x8')](_0x82f6('0xc'),auth['isAuthenticated'](),controller[_0x82f6('0xd')]);router[_0x82f6('0xe')]('/',auth[_0x82f6('0x9')](),controller[_0x82f6('0xf')]);router['put'](_0x82f6('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x82f6('0x10')]('/:id',auth[_0x82f6('0x9')](),controller[_0x82f6('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index e6a5e83..040b46c 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 _0x7244=['exports','STRING','INTEGER','sequelize'];(function(_0x36f8e3,_0x12d3c4){var _0x253d49=function(_0x5d45e6){while(--_0x5d45e6){_0x36f8e3['push'](_0x36f8e3['shift']());}};_0x253d49(++_0x12d3c4);}(_0x7244,0x10b));var _0x4724=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7244[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x4724('0x0'));module[_0x4724('0x1')]={'name':{'type':Sequelize[_0x4724('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4724('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4724('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xbe3f=['exports','STRING','INTEGER','sequelize'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xbe3f,0x7f));var _0xfbe3=function(_0x4a0733,_0x4aa51a){_0x4a0733=_0x4a0733-0x0;var _0x674a51=_0xbe3f[_0x4a0733];return _0x674a51;};'use strict';var Sequelize=require(_0xfbe3('0x0'));module[_0xfbe3('0x1')]={'name':{'type':Sequelize[_0xfbe3('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xfbe3('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xfbe3('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index e69ce2c..273d7a0 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 _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','UserProfileResource','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x4ac213,_0x1fdf33){var _0x26e218=function(_0x5b253b){while(--_0x5b253b){_0x4ac213['push'](_0x4ac213['shift']());}};_0x26e218(++_0x1fdf33);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['UserProfileResource'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['UserProfileResource'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file +var _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','UserProfileResource','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x41ddc2,_0x54ccf6){var _0x50e71e=function(_0x2f1fb3){while(--_0x2f1fb3){_0x41ddc2['push'](_0x41ddc2['shift']());}};_0x50e71e(++_0x54ccf6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['UserProfileResource'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['UserProfileResource'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index cc0abf8..e0c0515 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 _0x6cc2=['./userProfileResource.attributes','exports','define','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','api','moment'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x6cc2,0xf8));var _0x26cc=function(_0x3b5234,_0x140249){_0x3b5234=_0x3b5234-0x0;var _0x27f1cc=_0x6cc2[_0x3b5234];return _0x27f1cc;};'use strict';var _=require(_0x26cc('0x0'));var util=require(_0x26cc('0x1'));var logger=require(_0x26cc('0x2'))(_0x26cc('0x3'));var moment=require(_0x26cc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x26cc('0x5'));module[_0x26cc('0x6')]=function(_0x268e12,_0x49c37e){return _0x268e12[_0x26cc('0x7')]('UserProfileResource',attributes,{'tableName':_0x26cc('0x8'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x26cc('0x9'),_0x26cc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x336c=['user_profile_has_resources','compositeIndex','sectionId','util','../../config/logger','api','moment','request-promise','./userProfileResource.attributes','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x336c,0x16e));var _0xc336=function(_0x146cbc,_0x52bfff){_0x146cbc=_0x146cbc-0x0;var _0x4512bd=_0x336c[_0x146cbc];return _0x4512bd;};'use strict';var _=require('lodash');var util=require(_0xc336('0x0'));var logger=require(_0xc336('0x1'))(_0xc336('0x2'));var moment=require(_0xc336('0x3'));var BPromise=require('bluebird');var rp=require(_0xc336('0x4'));var attributes=require(_0xc336('0x5'));module[_0xc336('0x6')]=function(_0x7f6b70,_0x933e9){return _0x7f6b70[_0xc336('0x7')]('UserProfileResource',attributes,{'tableName':_0xc336('0x8'),'paranoid':![],'indexes':[{'name':_0xc336('0x9'),'fields':['resourceId',_0xc336('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 7354374..308d98a 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 _0x9fd4=['http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x5a6436,_0x34fa31){var _0x412bf6=function(_0x1f4140){while(--_0x1f4140){_0x5a6436['push'](_0x5a6436['shift']());}};_0x412bf6(++_0x34fa31);}(_0x9fd4,0x16c));var _0x49fd=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x9fd4[_0x3aaf0a];return _0x33e6bc;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var moment=require(_0x49fd('0x2'));var BPromise=require(_0x49fd('0x3'));var rs=require(_0x49fd('0x4'));var fs=require('fs');var Redis=require(_0x49fd('0x5'));var db=require(_0x49fd('0x6'))['db'];var utils=require(_0x49fd('0x7'));var logger=require(_0x49fd('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x49fd('0x9'));var client=jayson[_0x49fd('0xa')][_0x49fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9353cd,_0x48b999,_0x14bb94){return new BPromise(function(_0x461ac1,_0x36f605){return client[_0x49fd('0xc')](_0x9353cd,_0x14bb94)[_0x49fd('0xd')](function(_0x4a1c47){logger[_0x49fd('0xe')](_0x49fd('0xf'),_0x48b999,_0x49fd('0x10'));logger[_0x49fd('0x11')](_0x49fd('0x12'),_0x48b999,_0x49fd('0x10'),JSON[_0x49fd('0x13')](_0x4a1c47));if(_0x4a1c47['error']){if(_0x4a1c47[_0x49fd('0x14')][_0x49fd('0x15')]===0x1f4){logger[_0x49fd('0x14')](_0x49fd('0xf'),_0x48b999,_0x4a1c47[_0x49fd('0x14')][_0x49fd('0x16')]);return _0x36f605(_0x4a1c47[_0x49fd('0x14')][_0x49fd('0x16')]);}logger[_0x49fd('0x14')](_0x49fd('0xf'),_0x48b999,_0x4a1c47[_0x49fd('0x14')][_0x49fd('0x16')]);return _0x461ac1(_0x4a1c47[_0x49fd('0x14')][_0x49fd('0x16')]);}else{logger[_0x49fd('0xe')](_0x49fd('0xf'),_0x48b999,_0x49fd('0x10'));_0x461ac1(_0x4a1c47[_0x49fd('0x17')][_0x49fd('0x16')]);}})[_0x49fd('0x18')](function(_0x14c34f){logger[_0x49fd('0x14')](_0x49fd('0xf'),_0x48b999,_0x14c34f);_0x36f605(_0x14c34f);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5676fc,_0x1507e4){var _0x13999b=function(_0x11395a){while(--_0x11395a){_0x5676fc['push'](_0x5676fc['shift']());}};_0x13999b(++_0x1507e4);}(_0xadb5,0xad));var _0x5adb=function(_0x157c9f,_0x182354){_0x157c9f=_0x157c9f-0x0;var _0x4fbf97=_0xadb5[_0x157c9f];return _0x4fbf97;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 2807f5a..3f41207 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 _0xf6cc=['express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','describe','get','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xf6cc,0x6f));var _0xcf6c=function(_0x26b437,_0x5397c8){_0x26b437=_0x26b437-0x0;var _0x67b7e7=_0xf6cc[_0x26b437];return _0x67b7e7;};'use strict';var multer=require(_0xcf6c('0x0'));var util=require('util');var path=require(_0xcf6c('0x1'));var timeout=require(_0xcf6c('0x2'));var express=require(_0xcf6c('0x3'));var router=express[_0xcf6c('0x4')]();var auth=require(_0xcf6c('0x5'));var interaction=require(_0xcf6c('0x6'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router['get']('/',auth[_0xcf6c('0x7')](),controller[_0xcf6c('0x8')]);router['get']('/describe',auth[_0xcf6c('0x7')](),controller[_0xcf6c('0x9')]);router[_0xcf6c('0xa')]('/:id',auth[_0xcf6c('0x7')](),controller['show']);router[_0xcf6c('0xb')]('/',auth[_0xcf6c('0x7')](),controller[_0xcf6c('0xc')]);router[_0xcf6c('0xd')](_0xcf6c('0xe'),auth[_0xcf6c('0x7')](),controller[_0xcf6c('0xf')]);router[_0xcf6c('0x10')]('/:id',auth[_0xcf6c('0x7')](),controller[_0xcf6c('0x11')]);module[_0xcf6c('0x12')]=router; \ No newline at end of file +var _0xedfa=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x265022,_0xade8cc){var _0x45aac1=function(_0x2f688f){while(--_0x2f688f){_0x265022['push'](_0x265022['shift']());}};_0x45aac1(++_0xade8cc);}(_0xedfa,0x1b4));var _0xaedf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xedfa[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xaedf('0x0'));var path=require(_0xaedf('0x1'));var timeout=require(_0xaedf('0x2'));var express=require(_0xaedf('0x3'));var router=express[_0xaedf('0x4')]();var auth=require(_0xaedf('0x5'));var interaction=require(_0xaedf('0x6'));var config=require(_0xaedf('0x7'));var controller=require(_0xaedf('0x8'));router[_0xaedf('0x9')]('/',auth['isAuthenticated'](),controller[_0xaedf('0xa')]);router[_0xaedf('0x9')](_0xaedf('0xb'),auth[_0xaedf('0xc')](),controller['describe']);router[_0xaedf('0x9')](_0xaedf('0xd'),auth[_0xaedf('0xc')](),controller[_0xaedf('0xe')]);router[_0xaedf('0xf')]('/',auth['isAuthenticated'](),controller[_0xaedf('0x10')]);router[_0xaedf('0x11')](_0xaedf('0xd'),auth[_0xaedf('0xc')](),controller['update']);router[_0xaedf('0x12')](_0xaedf('0xd'),auth[_0xaedf('0xc')](),controller[_0xaedf('0x13')]);module[_0xaedf('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 11c9772..7733f88 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 _0x008c=['getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0x008c,0x188));var _0xc008=function(_0x572644,_0x543d79){_0x572644=_0x572644-0x0;var _0x17efa9=_0x008c[_0x572644];return _0x17efa9;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xc008('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc008('0x2')],'set':function(_0x10b33c){this[_0xc008('0x5')](_0xc008('0x6'),_0x10b33c?_0x10b33c[_0xc008('0x7')](''):[]);},'get':function(){return this[_0xc008('0x8')](_0xc008('0x6'))?this[_0xc008('0x8')]('crudPermissions')[_0xc008('0x9')](''):[];}}}; \ No newline at end of file +var _0xedd9=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue'];(function(_0x403a76,_0x202c00){var _0x2259c1=function(_0x3f1044){while(--_0x3f1044){_0x403a76['push'](_0x403a76['shift']());}};_0x2259c1(++_0x202c00);}(_0xedd9,0xfc));var _0x9edd=function(_0x2aa921,_0x3f0b6e){_0x2aa921=_0x2aa921-0x0;var _0x1e3f79=_0xedd9[_0x2aa921];return _0x1e3f79;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9edd('0x1')],'set':function(_0x36b53f){this['setDataValue'](_0x9edd('0x4'),_0x36b53f?_0x36b53f[_0x9edd('0x5')](''):[]);},'get':function(){return this[_0x9edd('0x6')](_0x9edd('0x4'))?this['getDataValue'](_0x9edd('0x4'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index d41bac6..e6d1e13 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 _0x57c6=['../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','UserProfileSection','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x16efd8,_0x5f25fc){var _0x1dcdd9=function(_0x57e59b){while(--_0x57e59b){_0x16efd8['push'](_0x16efd8['shift']());}};_0x1dcdd9(++_0x5f25fc);}(_0x57c6,0xd6));var _0x657c=function(_0x52ad5f,_0x16d1a3){_0x52ad5f=_0x52ad5f-0x0;var _0xb217a2=_0x57c6[_0x52ad5f];return _0xb217a2;};'use strict';var pdf=require(_0x657c('0x0'));var emlformat=require(_0x657c('0x1'));var rimraf=require(_0x657c('0x2'));var zipdir=require(_0x657c('0x3'));var jsonpatch=require(_0x657c('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x657c('0x5'));var util=require(_0x657c('0x6'));var path=require(_0x657c('0x7'));var sox=require(_0x657c('0x8'));var csv=require(_0x657c('0x9'));var ejs=require(_0x657c('0xa'));var fs=require('fs');var _=require(_0x657c('0xb'));var squel=require('squel');var crypto=require(_0x657c('0xc'));var jsforce=require(_0x657c('0xd'));var deskjs=require(_0x657c('0xe'));var toCsv=require(_0x657c('0x9'));var querystring=require(_0x657c('0xf'));var Papa=require(_0x657c('0x10'));var authService=require(_0x657c('0x11'));var hardwareService=require(_0x657c('0x12'));var Redis=require(_0x657c('0x13'));var qs=require(_0x657c('0x14'));var logger=require(_0x657c('0x15'))(_0x657c('0x16'));var utils=require(_0x657c('0x17'));var config=require(_0x657c('0x18'));var db=require(_0x657c('0x19'))['db'];function respondWithStatusCode(_0x17ce9a,_0x193226){_0x193226=_0x193226||0xcc;return function(_0xef6600){if(_0xef6600){return _0x17ce9a[_0x657c('0x1a')](_0x193226);}return _0x17ce9a[_0x657c('0x1b')](_0x193226)[_0x657c('0x1c')]();};}function respondWithResult(_0x271887,_0x435734){_0x435734=_0x435734||0xc8;return function(_0x47326e){if(_0x47326e){return _0x271887['status'](_0x435734)['json'](_0x47326e);}};}function respondWithFilteredResult(_0x241af1,_0x5d9d6d){return function(_0x56afdd){if(_0x56afdd){var _0x24ea31=_0x56afdd[_0x657c('0x1d')],_0x52b26b=_0x5d9d6d[_0x657c('0x1e')],_0x8a1429=_0x5d9d6d[_0x657c('0x1e')]+_0x5d9d6d['limit'],_0x122499;if(_0x8a1429>=_0x24ea31){_0x8a1429=_0x24ea31;_0x122499=0xc8;}else{_0x122499=0xce;}_0x241af1[_0x657c('0x1b')](_0x122499);return _0x241af1[_0x657c('0x1f')](_0x657c('0x20'),_0x52b26b+'-'+_0x8a1429+'/'+_0x24ea31)['json'](_0x56afdd);}return null;};}function patchUpdates(_0x479bc1){return function(_0x3a079b){try{jsonpatch[_0x657c('0x21')](_0x3a079b,_0x479bc1,!![]);}catch(_0x59afcd){return BPromise[_0x657c('0x22')](_0x59afcd);}return _0x3a079b[_0x657c('0x23')]();};}function saveUpdates(_0x118d72,_0x5cae40){return function(_0x67ec53){if(_0x67ec53){return _0x67ec53['update'](_0x118d72)[_0x657c('0x24')](function(_0x14642e){return _0x14642e;});}return null;};}function removeEntity(_0x14f230,_0x446f2a){return function(_0x11b98f){if(_0x11b98f){return _0x11b98f['destroy']()[_0x657c('0x24')](function(){_0x14f230[_0x657c('0x1b')](0xcc)[_0x657c('0x1c')]();});}};}function handleEntityNotFound(_0x1bb484,_0x486cf7){return function(_0x33ec14){if(!_0x33ec14){_0x1bb484['sendStatus'](0x194);}return _0x33ec14;};}function handleError(_0x4abd31,_0x274fcb){_0x274fcb=_0x274fcb||0x1f4;return function(_0x3420dd){logger[_0x657c('0x25')](_0x3420dd[_0x657c('0x26')]);if(_0x3420dd[_0x657c('0x27')]){delete _0x3420dd['name'];}_0x4abd31[_0x657c('0x1b')](_0x274fcb)[_0x657c('0x28')](_0x3420dd);};}exports[_0x657c('0x29')]=function(_0x18763e,_0x57ab3d){var _0x34d3b5={},_0x3c8fd6={},_0xd4bd30={'count':0x0,'rows':[]};var _0x29bf0a=db[_0x657c('0x2a')][_0x657c('0x2b')];_0x3c8fd6[_0x657c('0x2c')]=_[_0x657c('0x2d')](_0x29bf0a);_0x3c8fd6[_0x657c('0x2e')]=_['keys'](_0x18763e[_0x657c('0x2e')]);_0x3c8fd6['filters']=_[_0x657c('0x2f')](_0x3c8fd6['model'],_0x3c8fd6[_0x657c('0x2e')]);_0x34d3b5[_0x657c('0x30')]=_[_0x657c('0x2f')](_0x3c8fd6[_0x657c('0x2c')],qs[_0x657c('0x31')](_0x18763e[_0x657c('0x2e')]['fields']));_0x34d3b5[_0x657c('0x30')]=_0x34d3b5[_0x657c('0x30')]['length']?_0x34d3b5[_0x657c('0x30')]:_0x3c8fd6[_0x657c('0x2c')];if(!_0x18763e['query'][_0x657c('0x32')](_0x657c('0x33'))){_0x34d3b5[_0x657c('0x34')]=qs[_0x657c('0x34')](_0x18763e[_0x657c('0x2e')]['limit']);_0x34d3b5['offset']=qs[_0x657c('0x1e')](_0x18763e[_0x657c('0x2e')][_0x657c('0x1e')]);}_0x34d3b5['order']=qs[_0x657c('0x35')](_0x18763e[_0x657c('0x2e')][_0x657c('0x35')]);_0x34d3b5[_0x657c('0x36')]=qs[_0x657c('0x37')](_[_0x657c('0x38')](_0x18763e[_0x657c('0x2e')],_0x3c8fd6['filters']));if(_0x18763e['query']['filter']){_0x34d3b5[_0x657c('0x36')]=_[_0x657c('0x39')](_0x34d3b5[_0x657c('0x36')],{'$or':_[_0x657c('0x3a')](_0x29bf0a,function(_0x13a002){if(_0x13a002[_0x657c('0x3b')]['key']!==_0x657c('0x3c')){var _0x261313={};_0x261313[_0x13a002[_0x657c('0x3d')]]={'$like':'%'+_0x18763e[_0x657c('0x2e')]['filter']+'%'};return _0x261313;}})});}_0x34d3b5=_[_0x657c('0x39')]({},_0x34d3b5,_0x18763e[_0x657c('0x3e')]);var _0x1fa9e1={'where':_0x34d3b5['where']};return db[_0x657c('0x2a')][_0x657c('0x1d')](_0x1fa9e1)['then'](function(_0x5a32e6){_0xd4bd30[_0x657c('0x1d')]=_0x5a32e6;if(_0x18763e[_0x657c('0x2e')][_0x657c('0x3f')]){_0x34d3b5[_0x657c('0x40')]=[{'all':!![]}];}return db[_0x657c('0x2a')][_0x657c('0x41')](_0x34d3b5);})[_0x657c('0x24')](function(_0x387927){_0xd4bd30[_0x657c('0x42')]=_0x387927;return _0xd4bd30;})[_0x657c('0x24')](respondWithFilteredResult(_0x57ab3d,_0x34d3b5))[_0x657c('0x43')](handleError(_0x57ab3d,null));};exports[_0x657c('0x44')]=function(_0x1f7af1,_0x291f03){var _0x46132d={'raw':![],'where':{'id':_0x1f7af1[_0x657c('0x45')]['id']}},_0x3217f0={};_0x3217f0[_0x657c('0x2c')]=_['keys'](db[_0x657c('0x2a')][_0x657c('0x2b')]);_0x3217f0[_0x657c('0x2e')]=_[_0x657c('0x2d')](_0x1f7af1['query']);_0x3217f0[_0x657c('0x37')]=_['intersection'](_0x3217f0[_0x657c('0x2c')],_0x3217f0[_0x657c('0x2e')]);_0x46132d[_0x657c('0x30')]=_['intersection'](_0x3217f0['model'],qs['fields'](_0x1f7af1[_0x657c('0x2e')][_0x657c('0x31')]));_0x46132d[_0x657c('0x30')]=_0x46132d['attributes'][_0x657c('0x46')]?_0x46132d['attributes']:_0x3217f0[_0x657c('0x2c')];if(_0x1f7af1['query'][_0x657c('0x3f')]){_0x46132d[_0x657c('0x40')]=[{'all':!![]}];}_0x46132d=_[_0x657c('0x39')]({},_0x46132d,_0x1f7af1[_0x657c('0x3e')]);return db[_0x657c('0x2a')][_0x657c('0x47')](_0x46132d)[_0x657c('0x24')](handleEntityNotFound(_0x291f03,null))[_0x657c('0x24')](respondWithResult(_0x291f03,null))['catch'](handleError(_0x291f03,null));};exports[_0x657c('0x48')]=function(_0x370f72,_0x44e16e){return db[_0x657c('0x2a')][_0x657c('0x48')](_0x370f72[_0x657c('0x49')],{})[_0x657c('0x24')](respondWithResult(_0x44e16e,0xc9))[_0x657c('0x43')](handleError(_0x44e16e,null));};exports[_0x657c('0x4a')]=function(_0x3afc36,_0x137f23){if(_0x3afc36['body']['id']){delete _0x3afc36[_0x657c('0x49')]['id'];}return db['UserProfileSection'][_0x657c('0x47')]({'where':{'id':_0x3afc36['params']['id']}})[_0x657c('0x24')](handleEntityNotFound(_0x137f23,null))[_0x657c('0x24')](saveUpdates(_0x3afc36[_0x657c('0x49')],null))[_0x657c('0x24')](respondWithResult(_0x137f23,null))[_0x657c('0x43')](handleError(_0x137f23,null));};exports[_0x657c('0x4b')]=function(_0x35c930,_0x5d1601){return db['UserProfileSection'][_0x657c('0x47')]({'where':{'id':_0x35c930['params']['id']}})[_0x657c('0x24')](handleEntityNotFound(_0x5d1601,null))[_0x657c('0x24')](removeEntity(_0x5d1601,null))[_0x657c('0x43')](handleError(_0x5d1601,null));};exports[_0x657c('0x4c')]=function(_0x53932d,_0x23981d){return db[_0x657c('0x2a')][_0x657c('0x4c')]()[_0x657c('0x24')](respondWithResult(_0x23981d,null))[_0x657c('0x43')](handleError(_0x23981d,null));}; \ No newline at end of file +var _0xdcb9=['../../mysqldb','status','json','count','offset','set','Content-Range','reject','update','then','end','sendStatus','name','send','index','UserProfileSection','rawAttributes','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','map','type','key','field','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdcb9,0x78));var _0x9dcb=function(_0xbb45d3,_0x2e3623){_0xbb45d3=_0xbb45d3-0x0;var _0x48eca0=_0xdcb9[_0xbb45d3];return _0x48eca0;};'use strict';var pdf=require(_0x9dcb('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9dcb('0x1'));var jsonpatch=require(_0x9dcb('0x2'));var rp=require(_0x9dcb('0x3'));var moment=require(_0x9dcb('0x4'));var BPromise=require(_0x9dcb('0x5'));var Mustache=require(_0x9dcb('0x6'));var util=require('util');var path=require(_0x9dcb('0x7'));var sox=require(_0x9dcb('0x8'));var csv=require(_0x9dcb('0x9'));var ejs=require(_0x9dcb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9dcb('0xb'));var crypto=require(_0x9dcb('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9dcb('0x9'));var querystring=require('querystring');var Papa=require(_0x9dcb('0xd'));var authService=require(_0x9dcb('0xe'));var hardwareService=require(_0x9dcb('0xf'));var Redis=require(_0x9dcb('0x10'));var qs=require(_0x9dcb('0x11'));var logger=require(_0x9dcb('0x12'))('api');var utils=require(_0x9dcb('0x13'));var config=require('../../config/environment');var db=require(_0x9dcb('0x14'))['db'];function respondWithStatusCode(_0x483280,_0xd47ae7){_0xd47ae7=_0xd47ae7||0xcc;return function(_0x28ebaa){if(_0x28ebaa){return _0x483280['sendStatus'](_0xd47ae7);}return _0x483280[_0x9dcb('0x15')](_0xd47ae7)['end']();};}function respondWithResult(_0x1b6dad,_0x373460){_0x373460=_0x373460||0xc8;return function(_0x548305){if(_0x548305){return _0x1b6dad[_0x9dcb('0x15')](_0x373460)[_0x9dcb('0x16')](_0x548305);}};}function respondWithFilteredResult(_0x16cd6a,_0xed0644){return function(_0x421442){if(_0x421442){var _0x41eefb=_0x421442[_0x9dcb('0x17')],_0x4c1f64=_0xed0644[_0x9dcb('0x18')],_0xa5a19d=_0xed0644['offset']+_0xed0644['limit'],_0x50ddb;if(_0xa5a19d>=_0x41eefb){_0xa5a19d=_0x41eefb;_0x50ddb=0xc8;}else{_0x50ddb=0xce;}_0x16cd6a[_0x9dcb('0x15')](_0x50ddb);return _0x16cd6a[_0x9dcb('0x19')](_0x9dcb('0x1a'),_0x4c1f64+'-'+_0xa5a19d+'/'+_0x41eefb)[_0x9dcb('0x16')](_0x421442);}return null;};}function patchUpdates(_0x2487cd){return function(_0x5cef16){try{jsonpatch['apply'](_0x5cef16,_0x2487cd,!![]);}catch(_0x562607){return BPromise[_0x9dcb('0x1b')](_0x562607);}return _0x5cef16['save']();};}function saveUpdates(_0x2e7ac2,_0xd8228c){return function(_0x203ad7){if(_0x203ad7){return _0x203ad7[_0x9dcb('0x1c')](_0x2e7ac2)[_0x9dcb('0x1d')](function(_0x4a7ccd){return _0x4a7ccd;});}return null;};}function removeEntity(_0xda7541,_0x2899ab){return function(_0x5c0a16){if(_0x5c0a16){return _0x5c0a16['destroy']()[_0x9dcb('0x1d')](function(){_0xda7541[_0x9dcb('0x15')](0xcc)[_0x9dcb('0x1e')]();});}};}function handleEntityNotFound(_0x279bd5,_0x4b075b){return function(_0x447f8d){if(!_0x447f8d){_0x279bd5[_0x9dcb('0x1f')](0x194);}return _0x447f8d;};}function handleError(_0x300e1a,_0x241f6c){_0x241f6c=_0x241f6c||0x1f4;return function(_0x24f388){logger['error'](_0x24f388['stack']);if(_0x24f388['name']){delete _0x24f388[_0x9dcb('0x20')];}_0x300e1a['status'](_0x241f6c)[_0x9dcb('0x21')](_0x24f388);};}exports[_0x9dcb('0x22')]=function(_0x331ca6,_0x22a002){var _0x258c73={},_0x4a909b={},_0x47a0ff={'count':0x0,'rows':[]};var _0x41d8e3=db[_0x9dcb('0x23')][_0x9dcb('0x24')];_0x4a909b[_0x9dcb('0x25')]=_[_0x9dcb('0x26')](_0x41d8e3);_0x4a909b['query']=_[_0x9dcb('0x26')](_0x331ca6['query']);_0x4a909b['filters']=_[_0x9dcb('0x27')](_0x4a909b[_0x9dcb('0x25')],_0x4a909b[_0x9dcb('0x28')]);_0x258c73[_0x9dcb('0x29')]=_['intersection'](_0x4a909b['model'],qs[_0x9dcb('0x2a')](_0x331ca6['query'][_0x9dcb('0x2a')]));_0x258c73[_0x9dcb('0x29')]=_0x258c73[_0x9dcb('0x29')][_0x9dcb('0x2b')]?_0x258c73[_0x9dcb('0x29')]:_0x4a909b[_0x9dcb('0x25')];if(!_0x331ca6['query'][_0x9dcb('0x2c')](_0x9dcb('0x2d'))){_0x258c73[_0x9dcb('0x2e')]=qs[_0x9dcb('0x2e')](_0x331ca6[_0x9dcb('0x28')][_0x9dcb('0x2e')]);_0x258c73[_0x9dcb('0x18')]=qs['offset'](_0x331ca6[_0x9dcb('0x28')][_0x9dcb('0x18')]);}_0x258c73['order']=qs['sort'](_0x331ca6[_0x9dcb('0x28')][_0x9dcb('0x2f')]);_0x258c73[_0x9dcb('0x30')]=qs[_0x9dcb('0x31')](_[_0x9dcb('0x32')](_0x331ca6[_0x9dcb('0x28')],_0x4a909b[_0x9dcb('0x31')]));if(_0x331ca6[_0x9dcb('0x28')][_0x9dcb('0x33')]){_0x258c73[_0x9dcb('0x30')]=_[_0x9dcb('0x34')](_0x258c73[_0x9dcb('0x30')],{'$or':_[_0x9dcb('0x35')](_0x41d8e3,function(_0x386fe8){if(_0x386fe8[_0x9dcb('0x36')][_0x9dcb('0x37')]!=='VIRTUAL'){var _0x261d1d={};_0x261d1d[_0x386fe8[_0x9dcb('0x38')]]={'$like':'%'+_0x331ca6[_0x9dcb('0x28')]['filter']+'%'};return _0x261d1d;}})});}_0x258c73=_[_0x9dcb('0x34')]({},_0x258c73,_0x331ca6['options']);var _0x653098={'where':_0x258c73[_0x9dcb('0x30')]};return db[_0x9dcb('0x23')]['count'](_0x653098)['then'](function(_0x2f8d92){_0x47a0ff['count']=_0x2f8d92;if(_0x331ca6[_0x9dcb('0x28')][_0x9dcb('0x39')]){_0x258c73[_0x9dcb('0x3a')]=[{'all':!![]}];}return db[_0x9dcb('0x23')][_0x9dcb('0x3b')](_0x258c73);})[_0x9dcb('0x1d')](function(_0x1d5f9b){_0x47a0ff[_0x9dcb('0x3c')]=_0x1d5f9b;return _0x47a0ff;})['then'](respondWithFilteredResult(_0x22a002,_0x258c73))[_0x9dcb('0x3d')](handleError(_0x22a002,null));};exports[_0x9dcb('0x3e')]=function(_0xf430d4,_0x168dc8){var _0x5e6d87={'raw':![],'where':{'id':_0xf430d4[_0x9dcb('0x3f')]['id']}},_0x28625b={};_0x28625b[_0x9dcb('0x25')]=_[_0x9dcb('0x26')](db[_0x9dcb('0x23')]['rawAttributes']);_0x28625b[_0x9dcb('0x28')]=_[_0x9dcb('0x26')](_0xf430d4[_0x9dcb('0x28')]);_0x28625b['filters']=_['intersection'](_0x28625b['model'],_0x28625b[_0x9dcb('0x28')]);_0x5e6d87[_0x9dcb('0x29')]=_[_0x9dcb('0x27')](_0x28625b[_0x9dcb('0x25')],qs[_0x9dcb('0x2a')](_0xf430d4[_0x9dcb('0x28')][_0x9dcb('0x2a')]));_0x5e6d87['attributes']=_0x5e6d87[_0x9dcb('0x29')][_0x9dcb('0x2b')]?_0x5e6d87[_0x9dcb('0x29')]:_0x28625b[_0x9dcb('0x25')];if(_0xf430d4['query']['includeAll']){_0x5e6d87['include']=[{'all':!![]}];}_0x5e6d87=_['merge']({},_0x5e6d87,_0xf430d4[_0x9dcb('0x40')]);return db[_0x9dcb('0x23')][_0x9dcb('0x41')](_0x5e6d87)[_0x9dcb('0x1d')](handleEntityNotFound(_0x168dc8,null))[_0x9dcb('0x1d')](respondWithResult(_0x168dc8,null))['catch'](handleError(_0x168dc8,null));};exports[_0x9dcb('0x42')]=function(_0x3cc126,_0x3f5592){return db[_0x9dcb('0x23')]['create'](_0x3cc126[_0x9dcb('0x43')],{})[_0x9dcb('0x1d')](respondWithResult(_0x3f5592,0xc9))[_0x9dcb('0x3d')](handleError(_0x3f5592,null));};exports[_0x9dcb('0x1c')]=function(_0x26fd0d,_0x58b53b){if(_0x26fd0d['body']['id']){delete _0x26fd0d[_0x9dcb('0x43')]['id'];}return db['UserProfileSection'][_0x9dcb('0x41')]({'where':{'id':_0x26fd0d['params']['id']}})[_0x9dcb('0x1d')](handleEntityNotFound(_0x58b53b,null))[_0x9dcb('0x1d')](saveUpdates(_0x26fd0d['body'],null))['then'](respondWithResult(_0x58b53b,null))[_0x9dcb('0x3d')](handleError(_0x58b53b,null));};exports[_0x9dcb('0x44')]=function(_0x256559,_0x4f4587){return db['UserProfileSection'][_0x9dcb('0x41')]({'where':{'id':_0x256559[_0x9dcb('0x3f')]['id']}})[_0x9dcb('0x1d')](handleEntityNotFound(_0x4f4587,null))[_0x9dcb('0x1d')](removeEntity(_0x4f4587,null))[_0x9dcb('0x3d')](handleError(_0x4f4587,null));};exports['describe']=function(_0x22a85b,_0x151960){return db[_0x9dcb('0x23')][_0x9dcb('0x45')]()[_0x9dcb('0x1d')](respondWithResult(_0x151960,null))[_0x9dcb('0x3d')](handleError(_0x151960,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 4b7ead3..71ac9d1 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 _0xc431=['api','bluebird','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger'];(function(_0x42c876,_0xbc454b){var _0x3d46ef=function(_0x298f17){while(--_0x298f17){_0x42c876['push'](_0x42c876['shift']());}};_0x3d46ef(++_0xbc454b);}(_0xc431,0x15c));var _0x1c43=function(_0x23bac9,_0x58b493){_0x23bac9=_0x23bac9-0x0;var _0x4e5166=_0xc431[_0x23bac9];return _0x4e5166;};'use strict';var _=require(_0x1c43('0x0'));var util=require(_0x1c43('0x1'));var logger=require(_0x1c43('0x2'))(_0x1c43('0x3'));var moment=require('moment');var BPromise=require(_0x1c43('0x4'));var rp=require('request-promise');var attributes=require(_0x1c43('0x5'));module[_0x1c43('0x6')]=function(_0x2e94f3,_0x57b72a){return _0x2e94f3[_0x1c43('0x7')](_0x1c43('0x8'),attributes,{'tableName':_0x1c43('0x9'),'paranoid':![],'indexes':[{'name':_0x1c43('0xa'),'fields':[_0x1c43('0xb'),_0x1c43('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x114b=['./userProfileSection.attributes','define','UserProfileSection','sectionId','userProfileId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x585ee9,_0x182d24){var _0x33f2d7=function(_0x31698d){while(--_0x31698d){_0x585ee9['push'](_0x585ee9['shift']());}};_0x33f2d7(++_0x182d24);}(_0x114b,0x1e9));var _0xb114=function(_0x9bbba3,_0xe45690){_0x9bbba3=_0x9bbba3-0x0;var _0x26cde9=_0x114b[_0x9bbba3];return _0x26cde9;};'use strict';var _=require('lodash');var util=require(_0xb114('0x0'));var logger=require(_0xb114('0x1'))(_0xb114('0x2'));var moment=require(_0xb114('0x3'));var BPromise=require(_0xb114('0x4'));var rp=require(_0xb114('0x5'));var attributes=require(_0xb114('0x6'));module['exports']=function(_0x2807fd,_0x237b56){return _0x2807fd[_0xb114('0x7')](_0xb114('0x8'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xb114('0x9'),_0xb114('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index b98121a..2cccecc 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 _0xa620=['then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','client','request'];(function(_0x3c2947,_0x473f08){var _0x360ab3=function(_0x59c37f){while(--_0x59c37f){_0x3c2947['push'](_0x3c2947['shift']());}};_0x360ab3(++_0x473f08);}(_0xa620,0x138));var _0x0a62=function(_0x3e618a,_0x135251){_0x3e618a=_0x3e618a-0x0;var _0x1f3d61=_0xa620[_0x3e618a];return _0x1f3d61;};'use strict';var _=require('lodash');var util=require(_0x0a62('0x0'));var moment=require(_0x0a62('0x1'));var BPromise=require(_0x0a62('0x2'));var rs=require(_0x0a62('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0a62('0x4'))('rpc');var config=require(_0x0a62('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0a62('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a0416,_0x30a098,_0x5967e5){return new BPromise(function(_0x38016c,_0x20c5c6){return client[_0x0a62('0x7')](_0x1a0416,_0x5967e5)[_0x0a62('0x8')](function(_0x4ce572){logger[_0x0a62('0x9')](_0x0a62('0xa'),_0x30a098,'request\x20sent');logger[_0x0a62('0xb')](_0x0a62('0xc'),_0x30a098,_0x0a62('0xd'),JSON[_0x0a62('0xe')](_0x4ce572));if(_0x4ce572['error']){if(_0x4ce572[_0x0a62('0xf')][_0x0a62('0x10')]===0x1f4){logger['error'](_0x0a62('0xa'),_0x30a098,_0x4ce572['error'][_0x0a62('0x11')]);return _0x20c5c6(_0x4ce572[_0x0a62('0xf')]['message']);}logger[_0x0a62('0xf')](_0x0a62('0xa'),_0x30a098,_0x4ce572[_0x0a62('0xf')]['message']);return _0x38016c(_0x4ce572[_0x0a62('0xf')][_0x0a62('0x11')]);}else{logger[_0x0a62('0x9')](_0x0a62('0xa'),_0x30a098,_0x0a62('0xd'));_0x38016c(_0x4ce572[_0x0a62('0x12')][_0x0a62('0x11')]);}})[_0x0a62('0x13')](function(_0x2c0a40){logger['error'](_0x0a62('0xa'),_0x30a098,_0x2c0a40);_0x20c5c6(_0x2c0a40);});});} \ No newline at end of file +var _0xe81f=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x46f9e2,_0x36bf13){var _0x535f3c=function(_0x40d749){while(--_0x40d749){_0x46f9e2['push'](_0x46f9e2['shift']());}};_0x535f3c(++_0x36bf13);}(_0xe81f,0x1f4));var _0xfe81=function(_0x1c3e6a,_0x50907c){_0x1c3e6a=_0x1c3e6a-0x0;var _0x22b96b=_0xe81f[_0x1c3e6a];return _0x22b96b;};'use strict';var _=require(_0xfe81('0x0'));var util=require(_0xfe81('0x1'));var moment=require('moment');var BPromise=require(_0xfe81('0x2'));var rs=require(_0xfe81('0x3'));var fs=require('fs');var Redis=require(_0xfe81('0x4'));var db=require(_0xfe81('0x5'))['db'];var utils=require(_0xfe81('0x6'));var logger=require(_0xfe81('0x7'))(_0xfe81('0x8'));var config=require(_0xfe81('0x9'));var jayson=require(_0xfe81('0xa'));var client=jayson[_0xfe81('0xb')][_0xfe81('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x385b65,_0x3cb083,_0x363dda){return new BPromise(function(_0x4473f8,_0x2a4bca){return client[_0xfe81('0xd')](_0x385b65,_0x363dda)[_0xfe81('0xe')](function(_0x205a0f){logger[_0xfe81('0xf')](_0xfe81('0x10'),_0x3cb083,_0xfe81('0x11'));logger[_0xfe81('0x12')](_0xfe81('0x13'),_0x3cb083,'request\x20sent',JSON[_0xfe81('0x14')](_0x205a0f));if(_0x205a0f[_0xfe81('0x15')]){if(_0x205a0f[_0xfe81('0x15')][_0xfe81('0x16')]===0x1f4){logger[_0xfe81('0x15')](_0xfe81('0x10'),_0x3cb083,_0x205a0f['error']['message']);return _0x2a4bca(_0x205a0f[_0xfe81('0x15')][_0xfe81('0x17')]);}logger[_0xfe81('0x15')](_0xfe81('0x10'),_0x3cb083,_0x205a0f['error'][_0xfe81('0x17')]);return _0x4473f8(_0x205a0f[_0xfe81('0x15')][_0xfe81('0x17')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x3cb083,_0xfe81('0x11'));_0x4473f8(_0x205a0f[_0xfe81('0x18')][_0xfe81('0x17')]);}})[_0xfe81('0x19')](function(_0x5e65f3){logger[_0xfe81('0x15')](_0xfe81('0x10'),_0x3cb083,_0x5e65f3);_0x2a4bca(_0x5e65f3);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index cfc79bf..43a75c8 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 _0xb422=['../../config/environment','connect-timeout','../../components/auth/service'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xb422,0x85));var _0x2b42=function(_0x544f46,_0x168b65){_0x544f46=_0x544f46-0x0;var _0x21e7f2=_0xb422[_0x544f46];return _0x21e7f2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2b42('0x0'));var express=require('express');var router=express['Router']();var auth=require(_0x2b42('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x2b42('0x2'));module['exports']=router; \ No newline at end of file +var _0x1574=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1574,0x148));var _0x4157=function(_0x268da7,_0x228ba8){_0x268da7=_0x268da7-0x0;var _0x43a9c6=_0x1574[_0x268da7];return _0x43a9c6;};'use strict';var multer=require(_0x4157('0x0'));var util=require(_0x4157('0x1'));var path=require(_0x4157('0x2'));var timeout=require(_0x4157('0x3'));var express=require('express');var router=express[_0x4157('0x4')]();var auth=require(_0x4157('0x5'));var interaction=require(_0x4157('0x6'));var config=require(_0x4157('0x7'));module[_0x4157('0x8')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 8bcb27d..b161968 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 _0xce81=['INTEGER','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xce81,0x18a));var _0x1ce8=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xce81[_0x1573ea];return _0x51c0e2;};'use strict';var Sequelize=require(_0x1ce8('0x0'));module[_0x1ce8('0x1')]={'penalty':{'type':Sequelize[_0x1ce8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9f37=['INTEGER'];(function(_0x62c665,_0x23b3b0){var _0x4b15e3=function(_0x55be45){while(--_0x55be45){_0x62c665['push'](_0x62c665['shift']());}};_0x4b15e3(++_0x23b3b0);}(_0x9f37,0x1b7));var _0x79f3=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x9f37[_0x411017];return _0x2adeea;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x79f3('0x0')],'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 7c6381c..ae6d79c 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 _0x6921=['util','../../config/logger','api','request-promise','./userSmsQueue.attributes','exports','define','lodash'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x6921,0xdf));var _0x1692=function(_0x39a0c7,_0x28d28f){_0x39a0c7=_0x39a0c7-0x0;var _0x424d5d=_0x6921[_0x39a0c7];return _0x424d5d;};'use strict';var _=require(_0x1692('0x0'));var util=require(_0x1692('0x1'));var logger=require(_0x1692('0x2'))(_0x1692('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1692('0x4'));var attributes=require(_0x1692('0x5'));module[_0x1692('0x6')]=function(_0x161b57,_0x47a1ae){return _0x161b57[_0x1692('0x7')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a3b=['request-promise','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3167b1,_0x5ad266){var _0x362152=function(_0xc49d4a){while(--_0xc49d4a){_0x3167b1['push'](_0x3167b1['shift']());}};_0x362152(++_0x5ad266);}(_0x6a3b,0xd6));var _0xb6a3=function(_0x3446fd,_0x59c617){_0x3446fd=_0x3446fd-0x0;var _0x5d33f0=_0x6a3b[_0x3446fd];return _0x5d33f0;};'use strict';var _=require(_0xb6a3('0x0'));var util=require(_0xb6a3('0x1'));var logger=require(_0xb6a3('0x2'))(_0xb6a3('0x3'));var moment=require(_0xb6a3('0x4'));var BPromise=require(_0xb6a3('0x5'));var rp=require(_0xb6a3('0x6'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x2d9d87,_0x8b1c34){return _0x2d9d87[_0xb6a3('0x7')](_0xb6a3('0x8'),attributes,{'tableName':_0xb6a3('0x9'),'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 489d4ae..fb71f28 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 _0x340a=['UserSmsQueue,\x20%s,\x20%s','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x17ce66,_0x2e0036){var _0x3e5595=function(_0x39fce8){while(--_0x39fce8){_0x17ce66['push'](_0x17ce66['shift']());}};_0x3e5595(++_0x2e0036);}(_0x340a,0xc0));var _0xa340=function(_0x2e5ac0,_0x3a669b){_0x2e5ac0=_0x2e5ac0-0x0;var _0x1a33bc=_0x340a[_0x2e5ac0];return _0x1a33bc;};'use strict';var _=require('lodash');var util=require(_0xa340('0x0'));var moment=require(_0xa340('0x1'));var BPromise=require(_0xa340('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa340('0x3'))['db'];var utils=require(_0xa340('0x4'));var logger=require(_0xa340('0x5'))('rpc');var config=require(_0xa340('0x6'));var jayson=require(_0xa340('0x7'));var client=jayson[_0xa340('0x8')][_0xa340('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21b34e,_0x58f4c8,_0x56207d){return new BPromise(function(_0x3224c0,_0x4808f6){return client['request'](_0x21b34e,_0x56207d)['then'](function(_0x3c5e36){logger[_0xa340('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x58f4c8,_0xa340('0xb'));logger[_0xa340('0xc')](_0xa340('0xd'),_0x58f4c8,_0xa340('0xb'),JSON[_0xa340('0xe')](_0x3c5e36));if(_0x3c5e36[_0xa340('0xf')]){if(_0x3c5e36[_0xa340('0xf')][_0xa340('0x10')]===0x1f4){logger[_0xa340('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x58f4c8,_0x3c5e36[_0xa340('0xf')][_0xa340('0x11')]);return _0x4808f6(_0x3c5e36['error'][_0xa340('0x11')]);}logger[_0xa340('0xf')](_0xa340('0x12'),_0x58f4c8,_0x3c5e36[_0xa340('0xf')][_0xa340('0x11')]);return _0x3224c0(_0x3c5e36['error'][_0xa340('0x11')]);}else{logger[_0xa340('0xa')](_0xa340('0x12'),_0x58f4c8,_0xa340('0xb'));_0x3224c0(_0x3c5e36[_0xa340('0x13')][_0xa340('0x11')]);}})[_0xa340('0x14')](function(_0x55091a){logger[_0xa340('0xf')](_0xa340('0x12'),_0x58f4c8,_0x55091a);_0x4808f6(_0x55091a);});});} \ No newline at end of file +var _0xef24=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xef24,0x1a2));var _0x4ef2=function(_0xae7ed5,_0x5457d0){_0xae7ed5=_0xae7ed5-0x0;var _0x46cf4f=_0xef24[_0xae7ed5];return _0x46cf4f;};'use strict';var _=require(_0x4ef2('0x0'));var util=require('util');var moment=require(_0x4ef2('0x1'));var BPromise=require(_0x4ef2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ef2('0x3'));var db=require(_0x4ef2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4ef2('0x5'));var jayson=require(_0x4ef2('0x6'));var client=jayson[_0x4ef2('0x7')][_0x4ef2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a8ca2,_0x1b7cb9,_0x247ab8){return new BPromise(function(_0x2fcc71,_0xb9bb4f){return client[_0x4ef2('0x9')](_0x1a8ca2,_0x247ab8)['then'](function(_0x18cba1){logger[_0x4ef2('0xa')](_0x4ef2('0xb'),_0x1b7cb9,_0x4ef2('0xc'));logger['debug'](_0x4ef2('0xd'),_0x1b7cb9,_0x4ef2('0xc'),JSON[_0x4ef2('0xe')](_0x18cba1));if(_0x18cba1[_0x4ef2('0xf')]){if(_0x18cba1[_0x4ef2('0xf')][_0x4ef2('0x10')]===0x1f4){logger[_0x4ef2('0xf')](_0x4ef2('0xb'),_0x1b7cb9,_0x18cba1[_0x4ef2('0xf')][_0x4ef2('0x11')]);return _0xb9bb4f(_0x18cba1[_0x4ef2('0xf')][_0x4ef2('0x11')]);}logger[_0x4ef2('0xf')](_0x4ef2('0xb'),_0x1b7cb9,_0x18cba1[_0x4ef2('0xf')][_0x4ef2('0x11')]);return _0x2fcc71(_0x18cba1[_0x4ef2('0xf')][_0x4ef2('0x11')]);}else{logger[_0x4ef2('0xa')](_0x4ef2('0xb'),_0x1b7cb9,'request\x20sent');_0x2fcc71(_0x18cba1[_0x4ef2('0x12')][_0x4ef2('0x11')]);}})['catch'](function(_0x47e173){logger[_0x4ef2('0xf')](_0x4ef2('0xb'),_0x1b7cb9,_0x47e173);_0xb9bb4f(_0x47e173);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 7021b1f..493551a 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 _0x83d0=['../../components/interaction/service','multer','util','path','connect-timeout','express','Router'];(function(_0x35dba8,_0x768ca4){var _0x2e6b85=function(_0x6ede21){while(--_0x6ede21){_0x35dba8['push'](_0x35dba8['shift']());}};_0x2e6b85(++_0x768ca4);}(_0x83d0,0xb7));var _0x083d=function(_0x1fd376,_0x4eded5){_0x1fd376=_0x1fd376-0x0;var _0x387b95=_0x83d0[_0x1fd376];return _0x387b95;};'use strict';var multer=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var path=require(_0x083d('0x2'));var timeout=require(_0x083d('0x3'));var express=require(_0x083d('0x4'));var router=express[_0x083d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x083d('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x7e02=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7e02,0x71));var _0x27e0=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0x7e02[_0x6287b6];return _0x5d6be4;};'use strict';var multer=require(_0x27e0('0x0'));var util=require(_0x27e0('0x1'));var path=require(_0x27e0('0x2'));var timeout=require(_0x27e0('0x3'));var express=require(_0x27e0('0x4'));var router=express[_0x27e0('0x5')]();var auth=require(_0x27e0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x27e0('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 35c25d5..8a2c9c9 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 _0x08ce=['sequelize','exports','INTEGER'];(function(_0x6d23a8,_0x1c53c6){var _0x44af18=function(_0x1ac79b){while(--_0x1ac79b){_0x6d23a8['push'](_0x6d23a8['shift']());}};_0x44af18(++_0x1c53c6);}(_0x08ce,0x105));var _0xe08c=function(_0x18e869,_0x1bb08e){_0x18e869=_0x18e869-0x0;var _0x59160f=_0x08ce[_0x18e869];return _0x59160f;};'use strict';var Sequelize=require(_0xe08c('0x0'));module[_0xe08c('0x1')]={'penalty':{'type':Sequelize[_0xe08c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x202a=['INTEGER','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x202a,0x165));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xa202('0x0')]={'penalty':{'type':Sequelize[_0xa202('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index b2a3e69..1e4ca5c 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 _0x5c10=['exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','./userVoiceQueue.attributes'];(function(_0x75142c,_0x4f353a){var _0x3d3c57=function(_0x323aa3){while(--_0x323aa3){_0x75142c['push'](_0x75142c['shift']());}};_0x3d3c57(++_0x4f353a);}(_0x5c10,0x143));var _0x05c1=function(_0x1b3c74,_0x4229c7){_0x1b3c74=_0x1b3c74-0x0;var _0x495ca5=_0x5c10[_0x1b3c74];return _0x495ca5;};'use strict';var _=require(_0x05c1('0x0'));var util=require(_0x05c1('0x1'));var logger=require(_0x05c1('0x2'))('api');var moment=require(_0x05c1('0x3'));var BPromise=require(_0x05c1('0x4'));var rp=require(_0x05c1('0x5'));var attributes=require(_0x05c1('0x6'));module[_0x05c1('0x7')]=function(_0x5e8ae4,_0x141d5c){return _0x5e8ae4[_0x05c1('0x8')](_0x05c1('0x9'),attributes,{'tableName':_0x05c1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3da9=['UserVoiceQueue','lodash','util','../../config/logger','api','moment','request-promise','./userVoiceQueue.attributes','define'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x3da9,0x145));var _0x93da=function(_0x3319f1,_0x5d82be){_0x3319f1=_0x3319f1-0x0;var _0x428dbc=_0x3da9[_0x3319f1];return _0x428dbc;};'use strict';var _=require(_0x93da('0x0'));var util=require(_0x93da('0x1'));var logger=require(_0x93da('0x2'))(_0x93da('0x3'));var moment=require(_0x93da('0x4'));var BPromise=require('bluebird');var rp=require(_0x93da('0x5'));var attributes=require(_0x93da('0x6'));module['exports']=function(_0x166470,_0x1533c4){return _0x166470[_0x93da('0x7')](_0x93da('0x8'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index e9ebaa1..7288444 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 _0x80a8=['request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x4f2eaa,_0xdbef3c){var _0x508cdb=function(_0x5d193e){while(--_0x5d193e){_0x4f2eaa['push'](_0x4f2eaa['shift']());}};_0x508cdb(++_0xdbef3c);}(_0x80a8,0x11b));var _0x880a=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x80a8[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0x880a('0x0'));var util=require(_0x880a('0x1'));var moment=require(_0x880a('0x2'));var BPromise=require(_0x880a('0x3'));var rs=require(_0x880a('0x4'));var fs=require('fs');var Redis=require(_0x880a('0x5'));var db=require(_0x880a('0x6'))['db'];var utils=require(_0x880a('0x7'));var logger=require(_0x880a('0x8'))(_0x880a('0x9'));var config=require(_0x880a('0xa'));var jayson=require(_0x880a('0xb'));var client=jayson[_0x880a('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43c72c,_0x5b00d9,_0x214536){return new BPromise(function(_0x252c90,_0x27377d){return client[_0x880a('0xd')](_0x43c72c,_0x214536)[_0x880a('0xe')](function(_0x5367ea){logger[_0x880a('0xf')](_0x880a('0x10'),_0x5b00d9,_0x880a('0x11'));logger[_0x880a('0x12')](_0x880a('0x13'),_0x5b00d9,_0x880a('0x11'),JSON['stringify'](_0x5367ea));if(_0x5367ea[_0x880a('0x14')]){if(_0x5367ea[_0x880a('0x14')][_0x880a('0x15')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x5b00d9,_0x5367ea[_0x880a('0x14')][_0x880a('0x16')]);return _0x27377d(_0x5367ea[_0x880a('0x14')]['message']);}logger[_0x880a('0x14')](_0x880a('0x10'),_0x5b00d9,_0x5367ea[_0x880a('0x14')]['message']);return _0x252c90(_0x5367ea[_0x880a('0x14')]['message']);}else{logger[_0x880a('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x5b00d9,_0x880a('0x11'));_0x252c90(_0x5367ea[_0x880a('0x17')]['message']);}})[_0x880a('0x18')](function(_0x197f14){logger[_0x880a('0x14')](_0x880a('0x10'),_0x5b00d9,_0x197f14);_0x27377d(_0x197f14);});});} \ No newline at end of file +var _0x9f03=['request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x3f0a35,_0x3d9b75){var _0x530d70=function(_0x36acad){while(--_0x36acad){_0x3f0a35['push'](_0x3f0a35['shift']());}};_0x530d70(++_0x3d9b75);}(_0x9f03,0xbf));var _0x39f0=function(_0x582a3c,_0x1c0bea){_0x582a3c=_0x582a3c-0x0;var _0x385e5e=_0x9f03[_0x582a3c];return _0x385e5e;};'use strict';var _=require(_0x39f0('0x0'));var util=require('util');var moment=require(_0x39f0('0x1'));var BPromise=require(_0x39f0('0x2'));var rs=require(_0x39f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39f0('0x4'))['db'];var utils=require(_0x39f0('0x5'));var logger=require(_0x39f0('0x6'))(_0x39f0('0x7'));var config=require(_0x39f0('0x8'));var jayson=require(_0x39f0('0x9'));var client=jayson[_0x39f0('0xa')][_0x39f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x225903,_0x563947,_0xd458ca){return new BPromise(function(_0xa77dd1,_0xa2a133){return client[_0x39f0('0xc')](_0x225903,_0xd458ca)[_0x39f0('0xd')](function(_0x54c91e){logger[_0x39f0('0xe')](_0x39f0('0xf'),_0x563947,_0x39f0('0x10'));logger[_0x39f0('0x11')](_0x39f0('0x12'),_0x563947,_0x39f0('0x10'),JSON[_0x39f0('0x13')](_0x54c91e));if(_0x54c91e[_0x39f0('0x14')]){if(_0x54c91e[_0x39f0('0x14')]['code']===0x1f4){logger[_0x39f0('0x14')](_0x39f0('0xf'),_0x563947,_0x54c91e[_0x39f0('0x14')][_0x39f0('0x15')]);return _0xa2a133(_0x54c91e['error']['message']);}logger[_0x39f0('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x563947,_0x54c91e[_0x39f0('0x14')][_0x39f0('0x15')]);return _0xa77dd1(_0x54c91e[_0x39f0('0x14')][_0x39f0('0x15')]);}else{logger['info'](_0x39f0('0xf'),_0x563947,'request\x20sent');_0xa77dd1(_0x54c91e[_0x39f0('0x16')][_0x39f0('0x15')]);}})['catch'](function(_0x330b1c){logger['error'](_0x39f0('0xf'),_0x563947,_0x330b1c);_0xa2a133(_0x330b1c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 5b0aece..64fe53c 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 _0xb145=['../../components/auth/service','../../components/interaction/service','../../config/environment','util','path','connect-timeout','express','Router'];(function(_0x318dda,_0x1aa800){var _0x3f97ca=function(_0x1dc61a){while(--_0x1dc61a){_0x318dda['push'](_0x318dda['shift']());}};_0x3f97ca(++_0x1aa800);}(_0xb145,0xa3));var _0x5b14=function(_0x1c1c7f,_0x1e4a00){_0x1c1c7f=_0x1c1c7f-0x0;var _0x3ebe14=_0xb145[_0x1c1c7f];return _0x3ebe14;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var auth=require(_0x5b14('0x5'));var interaction=require(_0x5b14('0x6'));var config=require(_0x5b14('0x7'));module['exports']=router; \ No newline at end of file +var _0xaa3f=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x3256c6,_0x3166f8){_0x3256c6=_0x3256c6-0x0;var _0x19ae14=_0xaa3f[_0x3256c6];return _0x19ae14;};'use strict';var multer=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var path=require(_0xfaa3('0x2'));var timeout=require(_0xfaa3('0x3'));var express=require(_0xfaa3('0x4'));var router=express[_0xfaa3('0x5')]();var auth=require(_0xfaa3('0x6'));var interaction=require(_0xfaa3('0x7'));var config=require(_0xfaa3('0x8'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 3dee772..969ace3 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 _0xc999=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x56765c,_0x675809){var _0x5cf38f=function(_0x3fe761){while(--_0x3fe761){_0x56765c['push'](_0x56765c['shift']());}};_0x5cf38f(++_0x675809);}(_0xc999,0x103));var _0x9c99=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xc999[_0xca1f0e];return _0x35e4ef;};'use strict';var Sequelize=require(_0x9c99('0x0'));module[_0x9c99('0x1')]={'uniqueid':{'type':Sequelize[_0x9c99('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9c99('0x3')},'membername':{'type':Sequelize[_0x9c99('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x9c99('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9c99('0x4')],'allowNull':![],'unique':_0x9c99('0x5'),'comment':_0x9c99('0x3')},'VoiceQueueId':{'type':Sequelize[_0x9c99('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x9c99('0x3')},'penalty':{'type':Sequelize[_0x9c99('0x2')](0xb),'defaultValue':0x0,'comment':_0x9c99('0x3')},'paused':{'type':Sequelize[_0x9c99('0x2')](0xb),'defaultValue':0x0,'comment':_0x9c99('0x3')}}; \ No newline at end of file +var _0x1fd5=['STRING','queue_interface','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x55fa03,_0xcb96c2){var _0x2cd7cd=function(_0x56611f){while(--_0x56611f){_0x55fa03['push'](_0x55fa03['shift']());}};_0x2cd7cd(++_0xcb96c2);}(_0x1fd5,0x179));var _0x51fd=function(_0x2e3100,_0xdcd421){_0x2e3100=_0x2e3100-0x0;var _0x25eac2=_0x1fd5[_0x2e3100];return _0x25eac2;};'use strict';var Sequelize=require('sequelize');module[_0x51fd('0x0')]={'uniqueid':{'type':Sequelize[_0x51fd('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x51fd('0x2')},'membername':{'type':Sequelize[_0x51fd('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x51fd('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x51fd('0x3')],'allowNull':![],'unique':_0x51fd('0x4'),'comment':_0x51fd('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x51fd('0x3')],'allowNull':![],'unique':_0x51fd('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x51fd('0x2')},'paused':{'type':Sequelize[_0x51fd('0x1')](0xb),'defaultValue':0x0,'comment':_0x51fd('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index e6f85fe..5d0fcee 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 _0xa47b=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0xa47b,0x79));var _0xba47=function(_0x173797,_0x205260){_0x173797=_0x173797-0x0;var _0x59484a=_0xa47b[_0x173797];return _0x59484a;};'use strict';var EventEmitter=require(_0xba47('0x0'));var UserVoiceQueueRt=require(_0xba47('0x1'))['db'][_0xba47('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xba47('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xba47('0x4')};function emitEvent(_0x46491b){return function(_0x46c604,_0x2b2a15,_0x1f6cfc){UserVoiceQueueRtEvents['emit'](_0x46491b+':'+_0x46c604['id'],_0x46c604);UserVoiceQueueRtEvents[_0xba47('0x5')](_0x46491b,_0x46c604);_0x1f6cfc(null);};}for(var e in events){if(events[_0xba47('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xba47('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x8810=['hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x17f567,_0x243a98){var _0x4285d2=function(_0x25815c){while(--_0x25815c){_0x17f567['push'](_0x17f567['shift']());}};_0x4285d2(++_0x243a98);}(_0x8810,0x1e1));var _0x0881=function(_0x514823,_0x63587e){_0x514823=_0x514823-0x0;var _0x5da323=_0x8810[_0x514823];return _0x5da323;};'use strict';var EventEmitter=require(_0x0881('0x0'));var UserVoiceQueueRt=require(_0x0881('0x1'))['db'][_0x0881('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0881('0x3')](0x0);var events={'afterCreate':_0x0881('0x4'),'afterUpdate':_0x0881('0x5'),'afterDestroy':_0x0881('0x6')};function emitEvent(_0x290ddd){return function(_0x5c780e,_0x304674,_0x56f9fb){UserVoiceQueueRtEvents[_0x0881('0x7')](_0x290ddd+':'+_0x5c780e['id'],_0x5c780e);UserVoiceQueueRtEvents[_0x0881('0x7')](_0x290ddd,_0x5c780e);_0x56f9fb(null);};}for(var e in events){if(events[_0x0881('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x0881('0x9')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 85653c5..50725d7 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 _0x2b1f=['user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','request-promise','./userVoiceQueueRt.attributes'];(function(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0x2b1f,0x149));var _0xf2b1=function(_0x37da6b,_0x26e1e9){_0x37da6b=_0x37da6b-0x0;var _0x2ecb3e=_0x2b1f[_0x37da6b];return _0x2ecb3e;};'use strict';var _=require(_0xf2b1('0x0'));var util=require(_0xf2b1('0x1'));var logger=require(_0xf2b1('0x2'))('api');var moment=require(_0xf2b1('0x3'));var BPromise=require(_0xf2b1('0x4'));var rp=require(_0xf2b1('0x5'));var attributes=require(_0xf2b1('0x6'));module['exports']=function(_0x2b1698,_0x33e8c9){return _0x2b1698['define']('UserVoiceQueueRt',attributes,{'tableName':_0xf2b1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x768f=['../../config/logger','api','moment','request-promise','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util'];(function(_0x241c3d,_0x170a14){var _0xec39ac=function(_0x317c8c){while(--_0x317c8c){_0x241c3d['push'](_0x241c3d['shift']());}};_0xec39ac(++_0x170a14);}(_0x768f,0xa8));var _0xf768=function(_0x5c0179,_0x428dc4){_0x5c0179=_0x5c0179-0x0;var _0xc86ba=_0x768f[_0x5c0179];return _0xc86ba;};'use strict';var _=require(_0xf768('0x0'));var util=require(_0xf768('0x1'));var logger=require(_0xf768('0x2'))(_0xf768('0x3'));var moment=require(_0xf768('0x4'));var BPromise=require('bluebird');var rp=require(_0xf768('0x5'));var attributes=require(_0xf768('0x6'));module['exports']=function(_0x46f74c,_0x523b4e){return _0x46f74c[_0xf768('0x7')](_0xf768('0x8'),attributes,{'tableName':_0xf768('0x9'),'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 e803328..a5f8db9 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 _0xd404=['defaults','localhost','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','outboundQueuePauses','debug','stringify','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis'];(function(_0x55eb99,_0x33717e){var _0x25148b=function(_0x372298){while(--_0x372298){_0x55eb99['push'](_0x55eb99['shift']());}};_0x25148b(++_0x33717e);}(_0xd404,0x1e0));var _0x4d40=function(_0x37d2da,_0x1a2e14){_0x37d2da=_0x37d2da-0x0;var _0x1ccf53=_0xd404[_0x37d2da];return _0x1ccf53;};'use strict';var _=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var moment=require(_0x4d40('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d40('0x3'));var db=require(_0x4d40('0x4'))['db'];var utils=require(_0x4d40('0x5'));var logger=require('../../config/logger')(_0x4d40('0x6'));var config=require(_0x4d40('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4d40('0x8')]({'port':0x232a});config[_0x4d40('0x9')]=_[_0x4d40('0xa')](config[_0x4d40('0x9')],{'host':_0x4d40('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d40('0x9')]));require(_0x4d40('0xc'))['register'](socket);function respondWithRpcPromise(_0x1a40bc,_0x278f9f,_0x23ab56){return new BPromise(function(_0x47adb7,_0x34291e){return client[_0x4d40('0xd')](_0x1a40bc,_0x23ab56)[_0x4d40('0xe')](function(_0x376f7c){logger['info'](_0x4d40('0xf'),_0x278f9f,_0x4d40('0x10'));logger['debug'](_0x4d40('0x11'),_0x278f9f,_0x4d40('0x10'),JSON['stringify'](_0x376f7c));if(_0x376f7c['error']){if(_0x376f7c[_0x4d40('0x12')][_0x4d40('0x13')]===0x1f4){logger[_0x4d40('0x12')](_0x4d40('0xf'),_0x278f9f,_0x376f7c[_0x4d40('0x12')]['message']);return _0x34291e(_0x376f7c[_0x4d40('0x12')][_0x4d40('0x14')]);}logger['error'](_0x4d40('0xf'),_0x278f9f,_0x376f7c[_0x4d40('0x12')][_0x4d40('0x14')]);return _0x47adb7(_0x376f7c[_0x4d40('0x12')][_0x4d40('0x14')]);}else{logger[_0x4d40('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x278f9f,'request\x20sent');_0x47adb7(_0x376f7c[_0x4d40('0x16')][_0x4d40('0x14')]);}})['catch'](function(_0x6f4c4f){logger[_0x4d40('0x12')](_0x4d40('0xf'),_0x278f9f,_0x6f4c4f);_0x34291e(_0x6f4c4f);});});}exports[_0x4d40('0x17')]=function(_0x1d7370){var _0x593a41=this;return new Promise(function(_0x4724b0,_0x1da967){return db[_0x4d40('0x18')][_0x4d40('0x19')]({'raw':_0x1d7370[_0x4d40('0x1a')]?_0x1d7370['options'][_0x4d40('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d7370['options']?_0x1d7370['options'][_0x4d40('0x1c')]||null:null,'attributes':[[db[_0x4d40('0x1d')]['fn'](_0x4d40('0x1e'),db[_0x4d40('0x1d')]['fn']('IF',db['sequelize']['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x4d40('0x1f')]]})[_0x4d40('0xe')](function(_0x57d218){logger['info'](_0x4d40('0x17'),_0x1d7370);logger[_0x4d40('0x20')](_0x4d40('0x17'),_0x1d7370,JSON[_0x4d40('0x21')](_0x57d218));_0x4724b0(_0x57d218);})[_0x4d40('0x22')](function(_0x37a943){logger[_0x4d40('0x12')](_0x4d40('0x17'),_0x37a943[_0x4d40('0x14')],_0x1d7370);_0x1da967(_0x593a41[_0x4d40('0x12')](0x1f4,_0x37a943[_0x4d40('0x14')]));});});}; \ No newline at end of file +var _0xba1c=['UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVoiceQueueRtPauses'];(function(_0x255618,_0x3ce12a){var _0x3f6712=function(_0x1ab5ef){while(--_0x1ab5ef){_0x255618['push'](_0x255618['shift']());}};_0x3f6712(++_0x3ce12a);}(_0xba1c,0x1d1));var _0xcba1=function(_0x369f15,_0x1e9977){_0x369f15=_0x369f15-0x0;var _0x44294e=_0xba1c[_0x369f15];return _0x44294e;};'use strict';var _=require(_0xcba1('0x0'));var util=require('util');var moment=require(_0xcba1('0x1'));var BPromise=require(_0xcba1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcba1('0x3'));var db=require(_0xcba1('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcba1('0x5'));var config=require(_0xcba1('0x6'));var jayson=require(_0xcba1('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xcba1('0x8')](config[_0xcba1('0x9')],{'host':_0xcba1('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcba1('0x9')]));require(_0xcba1('0xb'))[_0xcba1('0xc')](socket);function respondWithRpcPromise(_0x364e48,_0x2a150e,_0x49740e){return new BPromise(function(_0x573c32,_0x1ca8a7){return client[_0xcba1('0xd')](_0x364e48,_0x49740e)[_0xcba1('0xe')](function(_0x583b5d){logger[_0xcba1('0xf')](_0xcba1('0x10'),_0x2a150e,_0xcba1('0x11'));logger[_0xcba1('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x2a150e,_0xcba1('0x11'),JSON[_0xcba1('0x13')](_0x583b5d));if(_0x583b5d[_0xcba1('0x14')]){if(_0x583b5d['error'][_0xcba1('0x15')]===0x1f4){logger[_0xcba1('0x14')](_0xcba1('0x10'),_0x2a150e,_0x583b5d[_0xcba1('0x14')][_0xcba1('0x16')]);return _0x1ca8a7(_0x583b5d[_0xcba1('0x14')][_0xcba1('0x16')]);}logger[_0xcba1('0x14')](_0xcba1('0x10'),_0x2a150e,_0x583b5d[_0xcba1('0x14')][_0xcba1('0x16')]);return _0x573c32(_0x583b5d[_0xcba1('0x14')][_0xcba1('0x16')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2a150e,_0xcba1('0x11'));_0x573c32(_0x583b5d['result'][_0xcba1('0x16')]);}})[_0xcba1('0x17')](function(_0x54c844){logger[_0xcba1('0x14')](_0xcba1('0x10'),_0x2a150e,_0x54c844);_0x1ca8a7(_0x54c844);});});}exports[_0xcba1('0x18')]=function(_0x1d9b1c){var _0x402edb=this;return new Promise(function(_0x5d0188,_0x55e06a){return db[_0xcba1('0x19')][_0xcba1('0x1a')]({'raw':_0x1d9b1c[_0xcba1('0x1b')]?_0x1d9b1c[_0xcba1('0x1b')][_0xcba1('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d9b1c[_0xcba1('0x1b')]?_0x1d9b1c['options'][_0xcba1('0x1d')]||null:null,'attributes':[[db[_0xcba1('0x1e')]['fn'](_0xcba1('0x1f'),db[_0xcba1('0x1e')]['fn']('IF',db[_0xcba1('0x1e')][_0xcba1('0x20')](_0xcba1('0x21')))),_0xcba1('0x22')]]})[_0xcba1('0xe')](function(_0x2c7664){logger[_0xcba1('0xf')](_0xcba1('0x18'),_0x1d9b1c);logger[_0xcba1('0x12')](_0xcba1('0x18'),_0x1d9b1c,JSON[_0xcba1('0x13')](_0x2c7664));_0x5d0188(_0x2c7664);})[_0xcba1('0x17')](function(_0x413c2b){logger[_0xcba1('0x14')](_0xcba1('0x18'),_0x413c2b[_0xcba1('0x16')],_0x1d9b1c);_0x55e06a(_0x402edb[_0xcba1('0x14')](0x1f4,_0x413c2b['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index b56f21e..d772223 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 _0x8d0e=['save','remove','update','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0xcf807,_0x4c736b){var _0x2ef9e9=function(_0x33ed42){while(--_0x33ed42){_0xcf807['push'](_0xcf807['shift']());}};_0x2ef9e9(++_0x4c736b);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x8f39d7,_0x2ccfea){_0x8f39d7=_0x8f39d7-0x0;var _0x2c3fad=_0x8d0e[_0x8f39d7];return _0x2c3fad;};'use strict';var UserVoiceQueueRtEvents=require(_0xe8d0('0x0'));var events=[_0xe8d0('0x1'),_0xe8d0('0x2'),_0xe8d0('0x3')];function createListener(_0x2eae0c,_0x3584ab){return function(_0x15521e){_0x3584ab[_0xe8d0('0x4')](_0x2eae0c,_0x15521e);};}function removeListener(_0x32cee9,_0x579cb9){return function(){UserVoiceQueueRtEvents[_0xe8d0('0x5')](_0x32cee9,_0x579cb9);};}exports['register']=function(_0x560dab){for(var _0x2e2985=0x0,_0x92483d=events[_0xe8d0('0x6')];_0x2e2985<_0x92483d;_0x2e2985++){var _0xcc03d0=events[_0x2e2985];var _0x2b6dce=createListener(_0xe8d0('0x7')+_0xcc03d0,_0x560dab);UserVoiceQueueRtEvents['on'](_0xcc03d0,_0x2b6dce);}}; \ No newline at end of file +var _0x98a8=['save','remove','update','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x44bd67,_0x153169){var _0xd83149=function(_0x558f26){while(--_0x558f26){_0x44bd67['push'](_0x44bd67['shift']());}};_0xd83149(++_0x153169);}(_0x98a8,0x12c));var _0x898a=function(_0x2e8fbf,_0x1c8e78){_0x2e8fbf=_0x2e8fbf-0x0;var _0x4889d6=_0x98a8[_0x2e8fbf];return _0x4889d6;};'use strict';var UserVoiceQueueRtEvents=require(_0x898a('0x0'));var events=[_0x898a('0x1'),_0x898a('0x2'),_0x898a('0x3')];function createListener(_0x213c5d,_0x226db7){return function(_0x69c61f){_0x226db7['emit'](_0x213c5d,_0x69c61f);};}function removeListener(_0x2bb3e2,_0xf84a19){return function(){UserVoiceQueueRtEvents[_0x898a('0x4')](_0x2bb3e2,_0xf84a19);};}exports[_0x898a('0x5')]=function(_0x3e7ddd){for(var _0x5d7e59=0x0,_0x3aadc2=events['length'];_0x5d7e59<_0x3aadc2;_0x5d7e59++){var _0xfa8c50=events[_0x5d7e59];var _0x4fbce5=createListener(_0x898a('0x6')+_0xfa8c50,_0x3e7ddd);UserVoiceQueueRtEvents['on'](_0xfa8c50,_0x4fbce5);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 3bbd6de..4579380 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 _0x4522=['destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete'];(function(_0x1be9ce,_0x27443d){var _0x164439=function(_0x2e779a){while(--_0x2e779a){_0x1be9ce['push'](_0x1be9ce['shift']());}};_0x164439(++_0x27443d);}(_0x4522,0x1a0));var _0x2452=function(_0x407e61,_0x4624ce){_0x407e61=_0x407e61-0x0;var _0x32a8f9=_0x4522[_0x407e61];return _0x32a8f9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var auth=require(_0x2452('0x3'));var interaction=require(_0x2452('0x4'));var config=require(_0x2452('0x5'));var controller=require(_0x2452('0x6'));router[_0x2452('0x7')]('/',auth[_0x2452('0x8')](),controller[_0x2452('0x9')]);router[_0x2452('0x7')](_0x2452('0xa'),auth[_0x2452('0x8')](),controller[_0x2452('0xb')]);router[_0x2452('0xc')]('/',auth[_0x2452('0x8')](),controller[_0x2452('0xd')]);router[_0x2452('0xe')](_0x2452('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2452('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2452('0x10')]);module[_0x2452('0x11')]=router; \ No newline at end of file +var _0xa75b=['multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','update','delete','destroy','exports'];(function(_0x507340,_0x5264e6){var _0x58d4d9=function(_0x5f1765){while(--_0x5f1765){_0x507340['push'](_0x507340['shift']());}};_0x58d4d9(++_0x5264e6);}(_0xa75b,0x170));var _0xba75=function(_0x157b8c,_0x351bfd){_0x157b8c=_0x157b8c-0x0;var _0x108134=_0xa75b[_0x157b8c];return _0x108134;};'use strict';var multer=require(_0xba75('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba75('0x1'));var express=require(_0xba75('0x2'));var router=express[_0xba75('0x3')]();var auth=require(_0xba75('0x4'));var interaction=require(_0xba75('0x5'));var config=require(_0xba75('0x6'));var controller=require(_0xba75('0x7'));router[_0xba75('0x8')]('/',auth[_0xba75('0x9')](),controller[_0xba75('0xa')]);router[_0xba75('0x8')](_0xba75('0xb'),auth[_0xba75('0x9')](),controller['show']);router['post']('/',auth[_0xba75('0x9')](),controller['create']);router['put'](_0xba75('0xb'),auth['isAuthenticated'](),controller[_0xba75('0xc')]);router[_0xba75('0xd')](_0xba75('0xb'),auth[_0xba75('0x9')](),controller[_0xba75('0xe')]);module[_0xba75('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 ac30156..fa8fa8e 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 _0x8a26=['name','sequelize','exports'];(function(_0x2191f2,_0x167882){var _0x42b830=function(_0x1492ef){while(--_0x1492ef){_0x2191f2['push'](_0x2191f2['shift']());}};_0x42b830(++_0x167882);}(_0x8a26,0x1a8));var _0x68a2=function(_0xee4fb0,_0x4beb91){_0xee4fb0=_0xee4fb0-0x0;var _0x237fdb=_0x8a26[_0xee4fb0];return _0x237fdb;};'use strict';var Sequelize=require(_0x68a2('0x0'));module[_0x68a2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x68a2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 4c5a281..b9082f8 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 _0x9aa4=['body','params','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Variables','UserProfileResource','sendStatus','error','stack','name','index','rawAttributes','model','keys','query','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','key','field','merge','options','Variable','rows','show','intersection','includeAll','include','catch','create','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x13154d,_0x16f571){var _0x2c1760=function(_0x1c0b14){while(--_0x1c0b14){_0x13154d['push'](_0x13154d['shift']());}};_0x2c1760(++_0x16f571);}(_0x9aa4,0xe9));var _0x49aa=function(_0x3d3b79,_0x2ab57e){_0x3d3b79=_0x3d3b79-0x0;var _0x239d9b=_0x9aa4[_0x3d3b79];return _0x239d9b;};'use strict';var pdf=require(_0x49aa('0x0'));var emlformat=require(_0x49aa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x49aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x49aa('0x3'));var moment=require(_0x49aa('0x4'));var BPromise=require(_0x49aa('0x5'));var Mustache=require('mustache');var util=require(_0x49aa('0x6'));var path=require(_0x49aa('0x7'));var sox=require('sox');var csv=require(_0x49aa('0x8'));var ejs=require(_0x49aa('0x9'));var fs=require('fs');var _=require(_0x49aa('0xa'));var squel=require(_0x49aa('0xb'));var crypto=require(_0x49aa('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x49aa('0xd'));var toCsv=require(_0x49aa('0x8'));var querystring=require('querystring');var Papa=require(_0x49aa('0xe'));var authService=require('../../components/auth/service');var hardwareService=require(_0x49aa('0xf'));var Redis=require(_0x49aa('0x10'));var qs=require(_0x49aa('0x11'));var logger=require('../../config/logger')(_0x49aa('0x12'));var utils=require(_0x49aa('0x13'));var config=require(_0x49aa('0x14'));var db=require(_0x49aa('0x15'))['db'];function respondWithStatusCode(_0xc5dcca,_0x12f340){_0x12f340=_0x12f340||0xcc;return function(_0x54705c){if(_0x54705c){return _0xc5dcca['sendStatus'](_0x12f340);}return _0xc5dcca[_0x49aa('0x16')](_0x12f340)[_0x49aa('0x17')]();};}function respondWithResult(_0x55b594,_0x52b30a){_0x52b30a=_0x52b30a||0xc8;return function(_0x4fe0da){if(_0x4fe0da){return _0x55b594[_0x49aa('0x16')](_0x52b30a)[_0x49aa('0x18')](_0x4fe0da);}};}function respondWithFilteredResult(_0x466a87,_0x462a3c){return function(_0xf193b4){if(_0xf193b4){var _0x154df7=_0xf193b4[_0x49aa('0x19')],_0x2c396b=_0x462a3c['offset'],_0x472c3e=_0x462a3c[_0x49aa('0x1a')]+_0x462a3c[_0x49aa('0x1b')],_0x43abbc;if(_0x472c3e>=_0x154df7){_0x472c3e=_0x154df7;_0x43abbc=0xc8;}else{_0x43abbc=0xce;}_0x466a87[_0x49aa('0x16')](_0x43abbc);return _0x466a87[_0x49aa('0x1c')](_0x49aa('0x1d'),_0x2c396b+'-'+_0x472c3e+'/'+_0x154df7)[_0x49aa('0x18')](_0xf193b4);}return null;};}function patchUpdates(_0x33ef5b){return function(_0x34c443){try{jsonpatch['apply'](_0x34c443,_0x33ef5b,!![]);}catch(_0x22490b){return BPromise[_0x49aa('0x1e')](_0x22490b);}return _0x34c443[_0x49aa('0x1f')]();};}function saveUpdates(_0x41396d,_0x2c0db6){return function(_0x4c89ee){if(_0x4c89ee){return _0x4c89ee[_0x49aa('0x20')](_0x41396d)[_0x49aa('0x21')](function(_0x2fd620){return _0x2fd620;});}return null;};}function removeEntity(_0x4f5099,_0x52ef62){return function(_0x4fa445){if(_0x4fa445){return _0x4fa445[_0x49aa('0x22')]()['then'](function(){var _0x2180a6=_0x4fa445[_0x49aa('0x23')]({'plain':!![]});var _0x1c5454=_0x49aa('0x24');return db[_0x49aa('0x25')][_0x49aa('0x22')]({'where':{'type':_0x1c5454,'resourceId':_0x2180a6['id']}})[_0x49aa('0x21')](function(){return _0x4fa445;});})['then'](function(){_0x4f5099[_0x49aa('0x16')](0xcc)[_0x49aa('0x17')]();});}};}function handleEntityNotFound(_0x5af57d,_0x36924b){return function(_0x974e5d){if(!_0x974e5d){_0x5af57d[_0x49aa('0x26')](0x194);}return _0x974e5d;};}function handleError(_0x23a9b4,_0x428db9){_0x428db9=_0x428db9||0x1f4;return function(_0x57c0d4){logger[_0x49aa('0x27')](_0x57c0d4[_0x49aa('0x28')]);if(_0x57c0d4[_0x49aa('0x29')]){delete _0x57c0d4[_0x49aa('0x29')];}_0x23a9b4['status'](_0x428db9)['send'](_0x57c0d4);};}exports[_0x49aa('0x2a')]=function(_0x3f64ca,_0x4020fd){var _0x4e8e86={},_0x4b0041={},_0x29a09d={'count':0x0,'rows':[]};var _0xc10b51=db['Variable'][_0x49aa('0x2b')];_0x4b0041[_0x49aa('0x2c')]=_[_0x49aa('0x2d')](_0xc10b51);_0x4b0041[_0x49aa('0x2e')]=_['keys'](_0x3f64ca[_0x49aa('0x2e')]);_0x4b0041['filters']=_['intersection'](_0x4b0041[_0x49aa('0x2c')],_0x4b0041[_0x49aa('0x2e')]);_0x4e8e86[_0x49aa('0x2f')]=_['intersection'](_0x4b0041[_0x49aa('0x2c')],qs[_0x49aa('0x30')](_0x3f64ca[_0x49aa('0x2e')]['fields']));_0x4e8e86[_0x49aa('0x2f')]=_0x4e8e86['attributes'][_0x49aa('0x31')]?_0x4e8e86[_0x49aa('0x2f')]:_0x4b0041[_0x49aa('0x2c')];if(!_0x3f64ca[_0x49aa('0x2e')]['hasOwnProperty'](_0x49aa('0x32'))){_0x4e8e86[_0x49aa('0x1b')]=qs[_0x49aa('0x1b')](_0x3f64ca['query']['limit']);_0x4e8e86[_0x49aa('0x1a')]=qs['offset'](_0x3f64ca['query'][_0x49aa('0x1a')]);}_0x4e8e86[_0x49aa('0x33')]=qs[_0x49aa('0x34')](_0x3f64ca[_0x49aa('0x2e')][_0x49aa('0x34')]);_0x4e8e86[_0x49aa('0x35')]=qs['filters'](_[_0x49aa('0x36')](_0x3f64ca[_0x49aa('0x2e')],_0x4b0041[_0x49aa('0x37')]));if(_0x3f64ca['query'][_0x49aa('0x38')]){_0x4e8e86[_0x49aa('0x35')]=_['merge'](_0x4e8e86[_0x49aa('0x35')],{'$or':_['map'](_0xc10b51,function(_0x46f30c){if(_0x46f30c['type'][_0x49aa('0x39')]!=='VIRTUAL'){var _0x121316={};_0x121316[_0x46f30c[_0x49aa('0x3a')]]={'$like':'%'+_0x3f64ca[_0x49aa('0x2e')][_0x49aa('0x38')]+'%'};return _0x121316;}})});}_0x4e8e86=_[_0x49aa('0x3b')]({},_0x4e8e86,_0x3f64ca[_0x49aa('0x3c')]);var _0x2bdb2b={'where':_0x4e8e86[_0x49aa('0x35')]};return db[_0x49aa('0x3d')][_0x49aa('0x19')](_0x2bdb2b)[_0x49aa('0x21')](function(_0x1338ef){_0x29a09d['count']=_0x1338ef;if(_0x3f64ca[_0x49aa('0x2e')]['includeAll']){_0x4e8e86['include']=[{'all':!![]}];}return db[_0x49aa('0x3d')]['findAll'](_0x4e8e86);})['then'](function(_0x29b420){_0x29a09d[_0x49aa('0x3e')]=_0x29b420;return _0x29a09d;})[_0x49aa('0x21')](respondWithFilteredResult(_0x4020fd,_0x4e8e86))['catch'](handleError(_0x4020fd,null));};exports[_0x49aa('0x3f')]=function(_0xe6bf41,_0x560c23){var _0x14c3c2={'raw':!![],'where':{'id':_0xe6bf41['params']['id']}},_0x5be958={};_0x5be958[_0x49aa('0x2c')]=_[_0x49aa('0x2d')](db[_0x49aa('0x3d')][_0x49aa('0x2b')]);_0x5be958['query']=_['keys'](_0xe6bf41[_0x49aa('0x2e')]);_0x5be958[_0x49aa('0x37')]=_[_0x49aa('0x40')](_0x5be958[_0x49aa('0x2c')],_0x5be958[_0x49aa('0x2e')]);_0x14c3c2[_0x49aa('0x2f')]=_[_0x49aa('0x40')](_0x5be958[_0x49aa('0x2c')],qs[_0x49aa('0x30')](_0xe6bf41[_0x49aa('0x2e')]['fields']));_0x14c3c2[_0x49aa('0x2f')]=_0x14c3c2[_0x49aa('0x2f')][_0x49aa('0x31')]?_0x14c3c2['attributes']:_0x5be958[_0x49aa('0x2c')];if(_0xe6bf41['query'][_0x49aa('0x41')]){_0x14c3c2[_0x49aa('0x42')]=[{'all':!![]}];}_0x14c3c2=_['merge']({},_0x14c3c2,_0xe6bf41[_0x49aa('0x3c')]);return db['Variable']['find'](_0x14c3c2)[_0x49aa('0x21')](handleEntityNotFound(_0x560c23,null))['then'](respondWithResult(_0x560c23,null))[_0x49aa('0x43')](handleError(_0x560c23,null));};exports[_0x49aa('0x44')]=function(_0x4d13c0,_0x565f92){return db['Variable'][_0x49aa('0x44')](_0x4d13c0['body'],{})[_0x49aa('0x21')](function(_0x4e4f46){var _0x354c30=_0x4d13c0[_0x49aa('0x45')][_0x49aa('0x23')]({'plain':!![]});if(!_0x354c30)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x354c30[_0x49aa('0x46')]==='user'){var _0x43a6f8=_0x4e4f46[_0x49aa('0x23')]({'plain':!![]});var _0x50439d=_0x49aa('0x24');return db['UserProfileSection'][_0x49aa('0x47')]({'where':{'name':_0x50439d,'userProfileId':_0x354c30[_0x49aa('0x48')]},'raw':!![]})[_0x49aa('0x21')](function(_0x222688){if(_0x222688&&_0x222688[_0x49aa('0x49')]===0x0){return db[_0x49aa('0x25')]['create']({'name':_0x43a6f8[_0x49aa('0x29')],'resourceId':_0x43a6f8['id'],'type':_0x222688[_0x49aa('0x29')],'sectionId':_0x222688['id']},{})[_0x49aa('0x21')](function(){return _0x4e4f46;});}else{return _0x4e4f46;}})[_0x49aa('0x43')](function(_0x4577b7){logger[_0x49aa('0x27')](_0x49aa('0x4a'),_0x4577b7);throw _0x4577b7;});}return _0x4e4f46;})[_0x49aa('0x21')](respondWithResult(_0x565f92,0xc9))[_0x49aa('0x43')](handleError(_0x565f92,null));};exports['update']=function(_0x1506ed,_0x2c996e){if(_0x1506ed[_0x49aa('0x4b')]['id']){delete _0x1506ed[_0x49aa('0x4b')]['id'];}return db[_0x49aa('0x3d')][_0x49aa('0x47')]({'where':{'id':_0x1506ed[_0x49aa('0x4c')]['id']}})[_0x49aa('0x21')](handleEntityNotFound(_0x2c996e,null))['then'](saveUpdates(_0x1506ed[_0x49aa('0x4b')],null))[_0x49aa('0x21')](respondWithResult(_0x2c996e,null))[_0x49aa('0x43')](handleError(_0x2c996e,null));};exports[_0x49aa('0x22')]=function(_0x26a0c0,_0x36470a){return db[_0x49aa('0x3d')]['find']({'where':{'id':_0x26a0c0[_0x49aa('0x4c')]['id']}})[_0x49aa('0x21')](handleEntityNotFound(_0x36470a,null))['then'](removeEntity(_0x36470a,null))[_0x49aa('0x43')](handleError(_0x36470a,null));}; \ No newline at end of file +var _0x736f=['html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','Variables','UserProfileResource','error','stack','send','Variable','rawAttributes','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','key','field','include','findAll','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params'];(function(_0x14ba16,_0x46c542){var _0x496957=function(_0x5e2348){while(--_0x5e2348){_0x14ba16['push'](_0x14ba16['shift']());}};_0x496957(++_0x46c542);}(_0x736f,0x138));var _0xf736=function(_0x30772a,_0x341edc){_0x30772a=_0x30772a-0x0;var _0x1fda7c=_0x736f[_0x30772a];return _0x1fda7c;};'use strict';var pdf=require(_0xf736('0x0'));var emlformat=require(_0xf736('0x1'));var rimraf=require(_0xf736('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf736('0x3'));var rp=require(_0xf736('0x4'));var moment=require(_0xf736('0x5'));var BPromise=require(_0xf736('0x6'));var Mustache=require(_0xf736('0x7'));var util=require('util');var path=require(_0xf736('0x8'));var sox=require(_0xf736('0x9'));var csv=require(_0xf736('0xa'));var ejs=require(_0xf736('0xb'));var fs=require('fs');var _=require(_0xf736('0xc'));var squel=require(_0xf736('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf736('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf736('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0xf736('0x10'));var Redis=require(_0xf736('0x11'));var qs=require(_0xf736('0x12'));var logger=require(_0xf736('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf736('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x119113,_0x248ba6){_0x248ba6=_0x248ba6||0xcc;return function(_0x391351){if(_0x391351){return _0x119113[_0xf736('0x15')](_0x248ba6);}return _0x119113[_0xf736('0x16')](_0x248ba6)[_0xf736('0x17')]();};}function respondWithResult(_0x546422,_0x97c473){_0x97c473=_0x97c473||0xc8;return function(_0x467e6f){if(_0x467e6f){return _0x546422[_0xf736('0x16')](_0x97c473)[_0xf736('0x18')](_0x467e6f);}};}function respondWithFilteredResult(_0x340d36,_0x2418ce){return function(_0x2abf6f){if(_0x2abf6f){var _0x237f66=_0x2abf6f[_0xf736('0x19')],_0x7fcf84=_0x2418ce[_0xf736('0x1a')],_0x520875=_0x2418ce['offset']+_0x2418ce[_0xf736('0x1b')],_0x22148d;if(_0x520875>=_0x237f66){_0x520875=_0x237f66;_0x22148d=0xc8;}else{_0x22148d=0xce;}_0x340d36[_0xf736('0x16')](_0x22148d);return _0x340d36[_0xf736('0x1c')]('Content-Range',_0x7fcf84+'-'+_0x520875+'/'+_0x237f66)[_0xf736('0x18')](_0x2abf6f);}return null;};}function patchUpdates(_0x5e8baf){return function(_0x4fc5a3){try{jsonpatch[_0xf736('0x1d')](_0x4fc5a3,_0x5e8baf,!![]);}catch(_0x4bace0){return BPromise[_0xf736('0x1e')](_0x4bace0);}return _0x4fc5a3[_0xf736('0x1f')]();};}function saveUpdates(_0x599f4e,_0x1137b0){return function(_0x498d86){if(_0x498d86){return _0x498d86['update'](_0x599f4e)[_0xf736('0x20')](function(_0x916039){return _0x916039;});}return null;};}function removeEntity(_0x45d496,_0xf89825){return function(_0x107797){if(_0x107797){return _0x107797[_0xf736('0x21')]()[_0xf736('0x20')](function(){var _0x367a8b=_0x107797['get']({'plain':!![]});var _0x51c719=_0xf736('0x22');return db[_0xf736('0x23')]['destroy']({'where':{'type':_0x51c719,'resourceId':_0x367a8b['id']}})['then'](function(){return _0x107797;});})['then'](function(){_0x45d496[_0xf736('0x16')](0xcc)[_0xf736('0x17')]();});}};}function handleEntityNotFound(_0x135ed5,_0x5dbfbe){return function(_0x2526b3){if(!_0x2526b3){_0x135ed5[_0xf736('0x15')](0x194);}return _0x2526b3;};}function handleError(_0x2876d3,_0x57af8a){_0x57af8a=_0x57af8a||0x1f4;return function(_0xc58a10){logger[_0xf736('0x24')](_0xc58a10[_0xf736('0x25')]);if(_0xc58a10['name']){delete _0xc58a10['name'];}_0x2876d3[_0xf736('0x16')](_0x57af8a)[_0xf736('0x26')](_0xc58a10);};}exports['index']=function(_0x5a6c20,_0x614f42){var _0x587be6={},_0x22c724={},_0x5bf46c={'count':0x0,'rows':[]};var _0xde203e=db[_0xf736('0x27')][_0xf736('0x28')];_0x22c724[_0xf736('0x29')]=_['keys'](_0xde203e);_0x22c724[_0xf736('0x2a')]=_[_0xf736('0x2b')](_0x5a6c20[_0xf736('0x2a')]);_0x22c724['filters']=_['intersection'](_0x22c724[_0xf736('0x29')],_0x22c724['query']);_0x587be6[_0xf736('0x2c')]=_[_0xf736('0x2d')](_0x22c724[_0xf736('0x29')],qs[_0xf736('0x2e')](_0x5a6c20[_0xf736('0x2a')][_0xf736('0x2e')]));_0x587be6[_0xf736('0x2c')]=_0x587be6['attributes'][_0xf736('0x2f')]?_0x587be6[_0xf736('0x2c')]:_0x22c724['model'];if(!_0x5a6c20[_0xf736('0x2a')][_0xf736('0x30')](_0xf736('0x31'))){_0x587be6[_0xf736('0x1b')]=qs[_0xf736('0x1b')](_0x5a6c20[_0xf736('0x2a')][_0xf736('0x1b')]);_0x587be6[_0xf736('0x1a')]=qs[_0xf736('0x1a')](_0x5a6c20[_0xf736('0x2a')]['offset']);}_0x587be6[_0xf736('0x32')]=qs['sort'](_0x5a6c20[_0xf736('0x2a')][_0xf736('0x33')]);_0x587be6['where']=qs[_0xf736('0x34')](_[_0xf736('0x35')](_0x5a6c20['query'],_0x22c724[_0xf736('0x34')]));if(_0x5a6c20[_0xf736('0x2a')][_0xf736('0x36')]){_0x587be6[_0xf736('0x37')]=_[_0xf736('0x38')](_0x587be6[_0xf736('0x37')],{'$or':_['map'](_0xde203e,function(_0x2d2f73){if(_0x2d2f73[_0xf736('0x39')][_0xf736('0x3a')]!=='VIRTUAL'){var _0x23056a={};_0x23056a[_0x2d2f73[_0xf736('0x3b')]]={'$like':'%'+_0x5a6c20[_0xf736('0x2a')][_0xf736('0x36')]+'%'};return _0x23056a;}})});}_0x587be6=_[_0xf736('0x38')]({},_0x587be6,_0x5a6c20['options']);var _0x4f6a00={'where':_0x587be6[_0xf736('0x37')]};return db[_0xf736('0x27')][_0xf736('0x19')](_0x4f6a00)[_0xf736('0x20')](function(_0x5d5da6){_0x5bf46c['count']=_0x5d5da6;if(_0x5a6c20['query']['includeAll']){_0x587be6[_0xf736('0x3c')]=[{'all':!![]}];}return db[_0xf736('0x27')][_0xf736('0x3d')](_0x587be6);})[_0xf736('0x20')](function(_0x483d9e){_0x5bf46c[_0xf736('0x3e')]=_0x483d9e;return _0x5bf46c;})[_0xf736('0x20')](respondWithFilteredResult(_0x614f42,_0x587be6))[_0xf736('0x3f')](handleError(_0x614f42,null));};exports[_0xf736('0x40')]=function(_0x28ea58,_0x134aa8){var _0x276bad={'raw':!![],'where':{'id':_0x28ea58['params']['id']}},_0x2e6e7e={};_0x2e6e7e[_0xf736('0x29')]=_[_0xf736('0x2b')](db['Variable'][_0xf736('0x28')]);_0x2e6e7e[_0xf736('0x2a')]=_[_0xf736('0x2b')](_0x28ea58[_0xf736('0x2a')]);_0x2e6e7e[_0xf736('0x34')]=_[_0xf736('0x2d')](_0x2e6e7e[_0xf736('0x29')],_0x2e6e7e[_0xf736('0x2a')]);_0x276bad[_0xf736('0x2c')]=_[_0xf736('0x2d')](_0x2e6e7e[_0xf736('0x29')],qs[_0xf736('0x2e')](_0x28ea58['query'][_0xf736('0x2e')]));_0x276bad[_0xf736('0x2c')]=_0x276bad['attributes']['length']?_0x276bad[_0xf736('0x2c')]:_0x2e6e7e[_0xf736('0x29')];if(_0x28ea58[_0xf736('0x2a')]['includeAll']){_0x276bad[_0xf736('0x3c')]=[{'all':!![]}];}_0x276bad=_[_0xf736('0x38')]({},_0x276bad,_0x28ea58[_0xf736('0x41')]);return db[_0xf736('0x27')][_0xf736('0x42')](_0x276bad)['then'](handleEntityNotFound(_0x134aa8,null))[_0xf736('0x20')](respondWithResult(_0x134aa8,null))[_0xf736('0x3f')](handleError(_0x134aa8,null));};exports[_0xf736('0x43')]=function(_0x34797c,_0x2b7ef3){return db[_0xf736('0x27')]['create'](_0x34797c[_0xf736('0x44')],{})[_0xf736('0x20')](function(_0x5b0247){var _0x3dac5=_0x34797c[_0xf736('0x45')]['get']({'plain':!![]});if(!_0x3dac5)throw new Error(_0xf736('0x46'));if(_0x3dac5[_0xf736('0x47')]===_0xf736('0x45')){var _0x4bfceb=_0x5b0247[_0xf736('0x48')]({'plain':!![]});var _0x280a12=_0xf736('0x22');return db['UserProfileSection'][_0xf736('0x42')]({'where':{'name':_0x280a12,'userProfileId':_0x3dac5['userProfileId']},'raw':!![]})[_0xf736('0x20')](function(_0x8b7f14){if(_0x8b7f14&&_0x8b7f14[_0xf736('0x49')]===0x0){return db[_0xf736('0x23')][_0xf736('0x43')]({'name':_0x4bfceb['name'],'resourceId':_0x4bfceb['id'],'type':_0x8b7f14[_0xf736('0x4a')],'sectionId':_0x8b7f14['id']},{})[_0xf736('0x20')](function(){return _0x5b0247;});}else{return _0x5b0247;}})[_0xf736('0x3f')](function(_0x438f92){logger[_0xf736('0x24')](_0xf736('0x4b'),_0x438f92);throw _0x438f92;});}return _0x5b0247;})['then'](respondWithResult(_0x2b7ef3,0xc9))['catch'](handleError(_0x2b7ef3,null));};exports[_0xf736('0x4c')]=function(_0x2f2f2f,_0xb35a22){if(_0x2f2f2f[_0xf736('0x44')]['id']){delete _0x2f2f2f[_0xf736('0x44')]['id'];}return db[_0xf736('0x27')][_0xf736('0x42')]({'where':{'id':_0x2f2f2f[_0xf736('0x4d')]['id']}})[_0xf736('0x20')](handleEntityNotFound(_0xb35a22,null))[_0xf736('0x20')](saveUpdates(_0x2f2f2f[_0xf736('0x44')],null))[_0xf736('0x20')](respondWithResult(_0xb35a22,null))[_0xf736('0x3f')](handleError(_0xb35a22,null));};exports[_0xf736('0x21')]=function(_0x321e89,_0x45b4ef){return db[_0xf736('0x27')][_0xf736('0x42')]({'where':{'id':_0x321e89['params']['id']}})[_0xf736('0x20')](handleEntityNotFound(_0x45b4ef,null))['then'](removeEntity(_0x45b4ef,null))[_0xf736('0x3f')](handleError(_0x45b4ef,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 8723a02..f228193 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 _0x326f=['define','Variable','lodash','api','moment','bluebird','request-promise','./variable.attributes','exports'];(function(_0x47af34,_0x3fd784){var _0x4e2de9=function(_0x3c6ef2){while(--_0x3c6ef2){_0x47af34['push'](_0x47af34['shift']());}};_0x4e2de9(++_0x3fd784);}(_0x326f,0xd1));var _0xf326=function(_0x3f122c,_0x3d7234){_0x3f122c=_0x3f122c-0x0;var _0x41c794=_0x326f[_0x3f122c];return _0x41c794;};'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 attributes=require(_0xf326('0x5'));module[_0xf326('0x6')]=function(_0x9445c6,_0xf1c243){return _0x9445c6[_0xf326('0x7')](_0xf326('0x8'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['tools_variables','lodash','util','../../config/logger','moment','bluebird','./variable.attributes','exports','define'];(function(_0xb77d35,_0x291854){var _0x5389a8=function(_0x52b4d2){while(--_0x52b4d2){_0xb77d35['push'](_0xb77d35['shift']());}};_0x5389a8(++_0x291854);}(_0x7a54,0x106));var _0x47a5=function(_0x3c2550,_0x4a1430){_0x3c2550=_0x3c2550-0x0;var _0x48ed15=_0x7a54[_0x3c2550];return _0x48ed15;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('Variable',attributes,{'tableName':_0x47a5('0x8'),'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 488c79a..25cf26c 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 _0x6b47=['message','result','catch','ShowVariable','Variable','options','raw','attributes','include','map','model','then','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x31d421,_0x40171f){var _0x27df20=function(_0x15f208){while(--_0x15f208){_0x31d421['push'](_0x31d421['shift']());}};_0x27df20(++_0x40171f);}(_0x6b47,0xba));var _0x76b4=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0x6b47[_0x2aefb6];return _0x202772;};'use strict';var _=require(_0x76b4('0x0'));var util=require('util');var moment=require(_0x76b4('0x1'));var BPromise=require(_0x76b4('0x2'));var rs=require(_0x76b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x76b4('0x4'))(_0x76b4('0x5'));var config=require(_0x76b4('0x6'));var jayson=require(_0x76b4('0x7'));var client=jayson[_0x76b4('0x8')][_0x76b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c2d14,_0x301b6d,_0x1f94d5){return new BPromise(function(_0x1fc20f,_0x3c90b8){return client[_0x76b4('0xa')](_0x2c2d14,_0x1f94d5)['then'](function(_0x12b556){logger[_0x76b4('0xb')](_0x76b4('0xc'),_0x301b6d,_0x76b4('0xd'));logger['debug'](_0x76b4('0xe'),_0x301b6d,_0x76b4('0xd'),JSON['stringify'](_0x12b556));if(_0x12b556[_0x76b4('0xf')]){if(_0x12b556['error'][_0x76b4('0x10')]===0x1f4){logger[_0x76b4('0xf')](_0x76b4('0xc'),_0x301b6d,_0x12b556[_0x76b4('0xf')][_0x76b4('0x11')]);return _0x3c90b8(_0x12b556[_0x76b4('0xf')][_0x76b4('0x11')]);}logger[_0x76b4('0xf')](_0x76b4('0xc'),_0x301b6d,_0x12b556[_0x76b4('0xf')][_0x76b4('0x11')]);return _0x1fc20f(_0x12b556['error'][_0x76b4('0x11')]);}else{logger[_0x76b4('0xb')]('Variable,\x20%s,\x20%s',_0x301b6d,_0x76b4('0xd'));_0x1fc20f(_0x12b556[_0x76b4('0x12')][_0x76b4('0x11')]);}})[_0x76b4('0x13')](function(_0x435a5e){logger[_0x76b4('0xf')]('Variable,\x20%s,\x20%s',_0x301b6d,_0x435a5e);_0x3c90b8(_0x435a5e);});});}exports[_0x76b4('0x14')]=function(_0x3a9bf8){var _0x452c41=this;return new Promise(function(_0x35f620,_0x5e7157){return db[_0x76b4('0x15')]['find']({'raw':_0x3a9bf8[_0x76b4('0x16')]?_0x3a9bf8[_0x76b4('0x16')][_0x76b4('0x17')]===undefined?!![]:![]:!![],'where':_0x3a9bf8[_0x76b4('0x16')]?_0x3a9bf8[_0x76b4('0x16')]['where']||null:null,'attributes':_0x3a9bf8[_0x76b4('0x16')]?_0x3a9bf8[_0x76b4('0x16')][_0x76b4('0x18')]||null:null,'include':_0x3a9bf8[_0x76b4('0x16')]?_0x3a9bf8[_0x76b4('0x16')][_0x76b4('0x19')]?_[_0x76b4('0x1a')](_0x3a9bf8[_0x76b4('0x16')]['include'],function(_0x4adce3){return{'model':db[_0x4adce3[_0x76b4('0x1b')]],'as':_0x4adce3['as'],'attributes':_0x4adce3[_0x76b4('0x18')],'include':_0x4adce3['include']?_[_0x76b4('0x1a')](_0x4adce3[_0x76b4('0x19')],function(_0x24e9fc){return{'model':db[_0x24e9fc[_0x76b4('0x1b')]],'as':_0x24e9fc['as'],'attributes':_0x24e9fc[_0x76b4('0x18')],'include':_0x24e9fc[_0x76b4('0x19')]?_[_0x76b4('0x1a')](_0x24e9fc[_0x76b4('0x19')],function(_0x3c1389){return{'model':db[_0x3c1389[_0x76b4('0x1b')]],'as':_0x3c1389['as'],'attributes':_0x3c1389['attributes']};}):[]};}):[]};}):[]:[]})[_0x76b4('0x1c')](function(_0x18177d){logger[_0x76b4('0xb')](_0x76b4('0x14'),_0x3a9bf8);logger['debug']('ShowVariable',_0x3a9bf8,JSON['stringify'](_0x18177d));_0x35f620(_0x18177d);})[_0x76b4('0x13')](function(_0x5b0843){logger['error']('ShowVariable',_0x5b0843[_0x76b4('0x11')],_0x3a9bf8);_0x5e7157(_0x452c41['error'](0x1f4,_0x5b0843[_0x76b4('0x11')]));});});}; \ No newline at end of file +var _0xf453=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','options','raw','where','map','include','model','attributes','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2bb724,_0x23ba4e){var _0x1abc8f=function(_0x5e3448){while(--_0x5e3448){_0x2bb724['push'](_0x2bb724['shift']());}};_0x1abc8f(++_0x23ba4e);}(_0xf453,0x15b));var _0x3f45=function(_0x2d5f53,_0x3854a8){_0x2d5f53=_0x2d5f53-0x0;var _0x37ef2f=_0xf453[_0x2d5f53];return _0x37ef2f;};'use strict';var _=require('lodash');var util=require(_0x3f45('0x0'));var moment=require(_0x3f45('0x1'));var BPromise=require(_0x3f45('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f45('0x3'));var db=require(_0x3f45('0x4'))['db'];var utils=require(_0x3f45('0x5'));var logger=require(_0x3f45('0x6'))('rpc');var config=require(_0x3f45('0x7'));var jayson=require(_0x3f45('0x8'));var client=jayson['client'][_0x3f45('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20a48a,_0x814719,_0x26cf07){return new BPromise(function(_0x2f0790,_0x55e0bf){return client[_0x3f45('0xa')](_0x20a48a,_0x26cf07)[_0x3f45('0xb')](function(_0x15d812){logger['info'](_0x3f45('0xc'),_0x814719,_0x3f45('0xd'));logger[_0x3f45('0xe')](_0x3f45('0xf'),_0x814719,'request\x20sent',JSON[_0x3f45('0x10')](_0x15d812));if(_0x15d812[_0x3f45('0x11')]){if(_0x15d812['error'][_0x3f45('0x12')]===0x1f4){logger[_0x3f45('0x11')]('Variable,\x20%s,\x20%s',_0x814719,_0x15d812[_0x3f45('0x11')][_0x3f45('0x13')]);return _0x55e0bf(_0x15d812[_0x3f45('0x11')][_0x3f45('0x13')]);}logger[_0x3f45('0x11')](_0x3f45('0xc'),_0x814719,_0x15d812[_0x3f45('0x11')][_0x3f45('0x13')]);return _0x2f0790(_0x15d812['error'][_0x3f45('0x13')]);}else{logger[_0x3f45('0x14')](_0x3f45('0xc'),_0x814719,_0x3f45('0xd'));_0x2f0790(_0x15d812[_0x3f45('0x15')][_0x3f45('0x13')]);}})[_0x3f45('0x16')](function(_0x5320e7){logger['error'](_0x3f45('0xc'),_0x814719,_0x5320e7);_0x55e0bf(_0x5320e7);});});}exports[_0x3f45('0x17')]=function(_0xf7bd6a){var _0x41e31b=this;return new Promise(function(_0x100a68,_0x365fc4){return db[_0x3f45('0x18')]['find']({'raw':_0xf7bd6a['options']?_0xf7bd6a[_0x3f45('0x19')][_0x3f45('0x1a')]===undefined?!![]:![]:!![],'where':_0xf7bd6a[_0x3f45('0x19')]?_0xf7bd6a[_0x3f45('0x19')][_0x3f45('0x1b')]||null:null,'attributes':_0xf7bd6a[_0x3f45('0x19')]?_0xf7bd6a[_0x3f45('0x19')]['attributes']||null:null,'include':_0xf7bd6a[_0x3f45('0x19')]?_0xf7bd6a[_0x3f45('0x19')]['include']?_[_0x3f45('0x1c')](_0xf7bd6a[_0x3f45('0x19')][_0x3f45('0x1d')],function(_0x36e138){return{'model':db[_0x36e138[_0x3f45('0x1e')]],'as':_0x36e138['as'],'attributes':_0x36e138['attributes'],'include':_0x36e138['include']?_[_0x3f45('0x1c')](_0x36e138[_0x3f45('0x1d')],function(_0x1f63c7){return{'model':db[_0x1f63c7[_0x3f45('0x1e')]],'as':_0x1f63c7['as'],'attributes':_0x1f63c7[_0x3f45('0x1f')],'include':_0x1f63c7[_0x3f45('0x1d')]?_[_0x3f45('0x1c')](_0x1f63c7[_0x3f45('0x1d')],function(_0x142cd9){return{'model':db[_0x142cd9[_0x3f45('0x1e')]],'as':_0x142cd9['as'],'attributes':_0x142cd9[_0x3f45('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3f45('0xb')](function(_0xac2f88){logger[_0x3f45('0x14')](_0x3f45('0x17'),_0xf7bd6a);logger[_0x3f45('0xe')](_0x3f45('0x17'),_0xf7bd6a,JSON[_0x3f45('0x10')](_0xac2f88));_0x100a68(_0xac2f88);})[_0x3f45('0x16')](function(_0x43cab0){logger[_0x3f45('0x11')]('ShowVariable',_0x43cab0[_0x3f45('0x13')],_0xf7bd6a);_0x365fc4(_0x41e31b[_0x3f45('0x11')](0x1f4,_0x43cab0['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 5042ff1..e1b7122 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 _0xae4a=['isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch'];(function(_0x38ffb0,_0x36bc33){var _0x469acf=function(_0x464c65){while(--_0x464c65){_0x38ffb0['push'](_0x38ffb0['shift']());}};_0x469acf(++_0x36bc33);}(_0xae4a,0x70));var _0xaae4=function(_0xd448bc,_0x3d10bb){_0xd448bc=_0xd448bc-0x0;var _0x3a54e9=_0xae4a[_0xd448bc];return _0x3a54e9;};'use strict';var express=require(_0xaae4('0x0'));var router=express[_0xaae4('0x1')]();var auth=require(_0xaae4('0x2'));var controller=require(_0xaae4('0x3'));router[_0xaae4('0x4')]('/',controller[_0xaae4('0x5')]);router[_0xaae4('0x4')](_0xaae4('0x6'),auth[_0xaae4('0x7')](),auth[_0xaae4('0x8')](),controller[_0xaae4('0x9')]);router[_0xaae4('0x4')](_0xaae4('0xa'),auth[_0xaae4('0x7')](),auth[_0xaae4('0x8')](),controller[_0xaae4('0xb')]);router[_0xaae4('0x4')](_0xaae4('0xc'),auth['isAuthenticated'](),auth[_0xaae4('0x8')](),controller[_0xaae4('0xd')]);router[_0xaae4('0x4')]('/restart',auth[_0xaae4('0x7')](),controller['restart']);router[_0xaae4('0x4')](_0xaae4('0xe'),controller[_0xaae4('0xf')]);module[_0xaae4('0x10')]=router; \ No newline at end of file +var _0x8cfa=['/restart','restart','migrations','exports','express','Router','../../components/auth/service','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x8cfa,0x17a));var _0xa8cf=function(_0x5d25ac,_0x3f57f5){_0x5d25ac=_0x5d25ac-0x0;var _0x1c7b34=_0x8cfa[_0x5d25ac];return _0x1c7b34;};'use strict';var express=require(_0xa8cf('0x0'));var router=express[_0xa8cf('0x1')]();var auth=require(_0xa8cf('0x2'));var controller=require('./version.controller');router[_0xa8cf('0x3')]('/',controller[_0xa8cf('0x4')]);router[_0xa8cf('0x3')](_0xa8cf('0x5'),auth[_0xa8cf('0x6')](),auth[_0xa8cf('0x7')](),controller[_0xa8cf('0x8')]);router['get'](_0xa8cf('0x9'),auth[_0xa8cf('0x6')](),auth[_0xa8cf('0x7')](),controller[_0xa8cf('0xa')]);router['get'](_0xa8cf('0xb'),auth['isAuthenticated'](),auth[_0xa8cf('0x7')](),controller[_0xa8cf('0xc')]);router[_0xa8cf('0x3')](_0xa8cf('0xd'),auth[_0xa8cf('0x6')](),controller[_0xa8cf('0xe')]);router[_0xa8cf('0x3')]('/migrations',controller[_0xa8cf('0xf')]);module[_0xa8cf('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 91b1fbe..ef48d0f 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 _0xa9e0=['master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','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.','root','server','exports','.js','catch','umzug','path','pkginfo','exec','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','version','latest','fetch','tags','status','json','origin'];(function(_0x388c73,_0x339d94){var _0x551b36=function(_0x3f9f59){while(--_0x3f9f59){_0x388c73['push'](_0x388c73['shift']());}};_0x551b36(++_0x339d94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var Umzug=require(_0x0a9e('0x0'));var path=require(_0x0a9e('0x1'));var pkginfo=require(_0x0a9e('0x2'))(module,'version');var exec=require('child_process')[_0x0a9e('0x3')];var db=require('../../mysqldb')['db'];var config=require(_0x0a9e('0x4'));var pm2=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var git=require(_0x0a9e('0x8'))(config['root']);exports[_0x0a9e('0x9')]=function(_0x441e3a,_0x2cc193){var _0x5f41ea={'current':module['exports'][_0x0a9e('0xa')],'phonebar':0x2};if(_0x441e3a['query']&&_0x441e3a['query'][_0x0a9e('0xb')]){return git[_0x0a9e('0xc')]()[_0x0a9e('0xd')](function(_0x3ab53f,_0xfeb75b){_0x5f41ea[_0x0a9e('0xb')]=(_0x3ab53f?module['exports']['version']:_0xfeb75b['latest'])||'2.0.0';return _0x2cc193[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')](_0x5f41ea);});}else{return _0x2cc193[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')](_0x5f41ea);}};exports[_0x0a9e('0xc')]=function(_0x69aeb7,_0x5db4b0){return git[_0x0a9e('0xc')]([_0x0a9e('0x10'),_0x0a9e('0x11')],function(_0x281129){if(_0x281129){logger[_0x0a9e('0x12')](_0x281129);return _0x5db4b0[_0x0a9e('0xe')](0x1f4)['json'](_0x281129);}logger[_0x0a9e('0x13')]('git\x20fetch');return _0x5db4b0[_0x0a9e('0xe')](0xc8)['json']({'output':_0x0a9e('0x14')});});};exports[_0x0a9e('0x15')]=function(_0x48f32d,_0x225616){return git['reset']([_0x0a9e('0x16'),_0x0a9e('0x17')],function(_0x106033){if(_0x106033){logger[_0x0a9e('0x12')](_0x106033);return _0x225616[_0x0a9e('0xe')](0x1f4)[_0x0a9e('0xf')](_0x106033);}logger[_0x0a9e('0x13')](_0x0a9e('0x18'));return _0x225616[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')]({'output':_0x0a9e('0x19')});});};exports[_0x0a9e('0x1a')]=function(_0x4bb1e3,_0x2c3407){exec(_0x0a9e('0x1b'),function(_0x53682f,_0x20f109,_0x5a09ef){logger['info'](_0x20f109);logger[_0x0a9e('0x13')](_0x5a09ef);if(_0x53682f){logger[_0x0a9e('0x12')](_0x53682f);return _0x2c3407[_0x0a9e('0xe')](0x1f4)[_0x0a9e('0xf')](_0x53682f);}return _0x2c3407['status'](0xc8)[_0x0a9e('0xf')]({'output':_0x20f109});});};exports[_0x0a9e('0x1c')]=function(_0x3b45bc,_0x4d00e6){return pm2[_0x0a9e('0x1c')](_0x0a9e('0x1d'))[_0x0a9e('0x1e')](function(_0x5ea472){logger['info'](_0x0a9e('0x1f'),_0x5ea472);return _0x4d00e6[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')]({'output':_0x0a9e('0x20')});})['catch'](function(_0x384319){logger['error'](_0x384319);return _0x4d00e6[_0x0a9e('0xe')](0x1f4)['json'](_0x384319);});};exports[_0x0a9e('0x21')]=function(_0x34dc65,_0x25fba9){var _0x14433c=new Umzug({'storage':_0x0a9e('0x22'),'storageOptions':{'model':db[_0x0a9e('0x23')],'modelName':_0x0a9e('0x23'),'columnName':_0x0a9e('0xa')},'migrations':{'params':[db['sequelize'][_0x0a9e('0x24')](),db[_0x0a9e('0x22')][_0x0a9e('0x25')],function(){throw new Error(_0x0a9e('0x26'));}],'path':path['join'](config[_0x0a9e('0x27')],_0x0a9e('0x28'),_0x0a9e('0x21')),'pattern':/\.js$/}});_0x14433c['up']({'from':module[_0x0a9e('0x29')][_0x0a9e('0xa')]+_0x0a9e('0x2a')})[_0x0a9e('0x1e')](function(){return _0x25fba9[_0x0a9e('0xe')](0xc8)[_0x0a9e('0xf')]({'output':'Database\x20Migration\x20Completed!'});})[_0x0a9e('0x2b')](function(_0x5d1e0e){return _0x25fba9[_0x0a9e('0xe')](0x1f4)[_0x0a9e('0xf')](_0x5d1e0e);});}; \ No newline at end of file +var _0x9957=['status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','.js','Database\x20Migration\x20Completed!','umzug','path','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags'];(function(_0x3ecee2,_0x1b289b){var _0x4f6236=function(_0x1990c4){while(--_0x1990c4){_0x3ecee2['push'](_0x3ecee2['shift']());}};_0x4f6236(++_0x1b289b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Umzug=require(_0x7995('0x0'));var path=require(_0x7995('0x1'));var pkginfo=require(_0x7995('0x2'))(module,_0x7995('0x3'));var exec=require('child_process')[_0x7995('0x4')];var db=require(_0x7995('0x5'))['db'];var config=require(_0x7995('0x6'));var pm2=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var git=require(_0x7995('0x9'))(config[_0x7995('0xa')]);exports[_0x7995('0xb')]=function(_0xbda126,_0x326741){var _0x4996ca={'current':module[_0x7995('0xc')][_0x7995('0x3')],'phonebar':0x2};if(_0xbda126['query']&&_0xbda126[_0x7995('0xd')][_0x7995('0xe')]){return git[_0x7995('0xf')]()[_0x7995('0x10')](function(_0x3c1d19,_0x1e400a){_0x4996ca[_0x7995('0xe')]=(_0x3c1d19?module['exports'][_0x7995('0x3')]:_0x1e400a[_0x7995('0xe')])||'2.0.0';return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);});}else{return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);}};exports[_0x7995('0xf')]=function(_0x23999f,_0x2bbe7a){return git['fetch'](['origin',_0x7995('0x13')],function(_0x2233dd){if(_0x2233dd){logger[_0x7995('0x14')](_0x2233dd);return _0x2bbe7a[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x2233dd);}logger[_0x7995('0x15')](_0x7995('0x16'));return _0x2bbe7a[_0x7995('0x11')](0xc8)['json']({'output':_0x7995('0x17')});});};exports['reset']=function(_0x2f832e,_0x37f297){return git[_0x7995('0x18')]([_0x7995('0x19'),_0x7995('0x1a')],function(_0x37a7d4){if(_0x37a7d4){logger['error'](_0x37a7d4);return _0x37f297['status'](0x1f4)[_0x7995('0x12')](_0x37a7d4);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x37f297[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x7995('0x1b')]=function(_0x51f276,_0x4b1a8e){exec(_0x7995('0x1c'),function(_0x327b1f,_0x350fd9,_0x1a8568){logger[_0x7995('0x15')](_0x350fd9);logger[_0x7995('0x15')](_0x1a8568);if(_0x327b1f){logger['error'](_0x327b1f);return _0x4b1a8e[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x350fd9});});};exports[_0x7995('0x1d')]=function(_0x13bc35,_0x475351){return pm2[_0x7995('0x1d')]('motion2')[_0x7995('0x1e')](function(_0x34e70c){logger[_0x7995('0x15')](_0x7995('0x1f'),_0x34e70c);return _0x475351[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x7995('0x20')](function(_0x5911c3){logger[_0x7995('0x14')](_0x5911c3);return _0x475351[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x5911c3);});};exports[_0x7995('0x21')]=function(_0x11c1eb,_0x4b6f99){var _0x9b2a15=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x7995('0x22')],'modelName':_0x7995('0x22'),'columnName':_0x7995('0x3')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0x7995('0x23')],function(){throw new Error(_0x7995('0x24'));}],'path':path[_0x7995('0x25')](config[_0x7995('0xa')],_0x7995('0x26'),_0x7995('0x21')),'pattern':/\.js$/}});_0x9b2a15['up']({'from':module['exports']['version']+_0x7995('0x27')})['then'](function(){return _0x4b6f99[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x7995('0x28')});})[_0x7995('0x20')](function(_0x1f7d27){return _0x4b6f99['status'](0x1f4)[_0x7995('0x12')](_0x1f7d27);});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 2d710d8..6045d09 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 _0x430c=['exports','multer','connect-timeout','express','Router','get','isAuthenticated','describe','/:id','show','post','create','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x430c,0x1a1));var _0xc430=function(_0x324e86,_0x81b1cb){_0x324e86=_0x324e86-0x0;var _0x592846=_0x430c[_0x324e86];return _0x592846;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0xc430('0x4')]('/',auth[_0xc430('0x5')](),controller['index']);router[_0xc430('0x4')]('/describe',auth[_0xc430('0x5')](),controller[_0xc430('0x6')]);router[_0xc430('0x4')](_0xc430('0x7'),auth[_0xc430('0x5')](),controller[_0xc430('0x8')]);router[_0xc430('0x9')]('/',auth[_0xc430('0x5')](),controller[_0xc430('0xa')]);router['put'](_0xc430('0x7'),auth[_0xc430('0x5')](),controller['update']);router[_0xc430('0xb')]('/:id',auth[_0xc430('0x5')](),controller['destroy']);module[_0xc430('0xc')]=router; \ No newline at end of file +var _0x66fa=['index','get','/describe','isAuthenticated','describe','/:id','show','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x28fa51,_0x5c7882){var _0x584a35=function(_0x31635d){while(--_0x31635d){_0x28fa51['push'](_0x28fa51['shift']());}};_0x584a35(++_0x5c7882);}(_0x66fa,0x117));var _0xa66f=function(_0x5b7700,_0x198d02){_0x5b7700=_0x5b7700-0x0;var _0x454ee5=_0x66fa[_0x5b7700];return _0x454ee5;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var auth=require(_0xa66f('0x5'));var interaction=require(_0xa66f('0x6'));var config=require(_0xa66f('0x7'));var controller=require(_0xa66f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa66f('0x9')]);router[_0xa66f('0xa')](_0xa66f('0xb'),auth[_0xa66f('0xc')](),controller[_0xa66f('0xd')]);router['get'](_0xa66f('0xe'),auth['isAuthenticated'](),controller[_0xa66f('0xf')]);router['post']('/',auth[_0xa66f('0xc')](),controller['create']);router['put']('/:id',auth[_0xa66f('0xc')](),controller[_0xa66f('0x10')]);router['delete'](_0xa66f('0xe'),auth['isAuthenticated'](),controller[_0xa66f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 2abcaf4..5c936a1 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 _0x77ba=['BOOLEAN','INTEGER','sequelize','exports','STRING','DATE'];(function(_0x3d8ac3,_0x9453d3){var _0x55e491=function(_0x1f6524){while(--_0x1f6524){_0x3d8ac3['push'](_0x3d8ac3['shift']());}};_0x55e491(++_0x9453d3);}(_0x77ba,0x128));var _0xa77b=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0x77ba[_0x10852d];return _0x13a8d6;};'use strict';var Sequelize=require(_0xa77b('0x0'));module[_0xa77b('0x1')]={'type':{'type':Sequelize[_0xa77b('0x2')]},'uniqueid':{'type':Sequelize[_0xa77b('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa77b('0x2')]},'queue':{'type':Sequelize[_0xa77b('0x2')]},'interface':{'type':Sequelize[_0xa77b('0x2')]},'membername':{'type':Sequelize[_0xa77b('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa77b('0x3')]},'agentconnectAt':{'type':Sequelize[_0xa77b('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xa77b('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xa77b('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xa77b('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xa77b('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xa77b('0x5')]},'agentacw':{'type':Sequelize[_0xa77b('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa77b('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xa77b('0x2')]},'channel':{'type':Sequelize[_0xa77b('0x2')]},'channelstate':{'type':Sequelize[_0xa77b('0x5')]},'channelstatedesc':{'type':Sequelize[_0xa77b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa77b('0x2')]},'accountcode':{'type':Sequelize[_0xa77b('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa77b('0x2')]},'priority':{'type':Sequelize[_0xa77b('0x2')]},'destchannel':{'type':Sequelize[_0xa77b('0x2')]},'destchannelstate':{'type':Sequelize[_0xa77b('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0xa77b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa77b('0x2')]},'destcalleridname':{'type':Sequelize[_0xa77b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xa77b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xa77b('0x2')]},'destlanguage':{'type':Sequelize[_0xa77b('0x2')]},'destaccountcode':{'type':Sequelize[_0xa77b('0x2')]},'destcontext':{'type':Sequelize[_0xa77b('0x2')]},'destexten':{'type':Sequelize[_0xa77b('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xa77b('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xa77b('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xa77b('0x2')]}}; \ No newline at end of file +var _0xd85b=['STRING','DATE','INTEGER','BOOLEAN','exports'];(function(_0x34ff58,_0x4c50d0){var _0xe12a5b=function(_0x2f4b40){while(--_0x2f4b40){_0x34ff58['push'](_0x34ff58['shift']());}};_0xe12a5b(++_0x4c50d0);}(_0xd85b,0x1b7));var _0xbd85=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd85b[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0xbd85('0x0')]={'type':{'type':Sequelize[_0xbd85('0x1')]},'uniqueid':{'type':Sequelize[_0xbd85('0x1')]},'calleridnum':{'type':Sequelize[_0xbd85('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xbd85('0x1')]},'membername':{'type':Sequelize[_0xbd85('0x1')]},'agentcalledAt':{'type':Sequelize[_0xbd85('0x2')]},'agentconnectAt':{'type':Sequelize[_0xbd85('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xbd85('0x2')]},'agentdumpAt':{'type':Sequelize[_0xbd85('0x2')]},'holdtime':{'type':Sequelize[_0xbd85('0x3')]},'agentcomplete':{'type':Sequelize[_0xbd85('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xbd85('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xbd85('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xbd85('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbd85('0x3')]},'reason':{'type':Sequelize[_0xbd85('0x1')]},'lastevent':{'type':Sequelize[_0xbd85('0x1')]},'channel':{'type':Sequelize[_0xbd85('0x1')]},'channelstate':{'type':Sequelize[_0xbd85('0x3')]},'channelstatedesc':{'type':Sequelize[_0xbd85('0x1')]},'connectedlinenum':{'type':Sequelize[_0xbd85('0x1')]},'connectedlinename':{'type':Sequelize[_0xbd85('0x1')]},'language':{'type':Sequelize[_0xbd85('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xbd85('0x1')]},'exten':{'type':Sequelize[_0xbd85('0x1')]},'priority':{'type':Sequelize[_0xbd85('0x1')]},'destchannel':{'type':Sequelize[_0xbd85('0x1')]},'destchannelstate':{'type':Sequelize[_0xbd85('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xbd85('0x1')]},'destcalleridname':{'type':Sequelize[_0xbd85('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xbd85('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xbd85('0x1')]},'destlanguage':{'type':Sequelize[_0xbd85('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xbd85('0x1')]},'destexten':{'type':Sequelize[_0xbd85('0x1')]},'destpriority':{'type':Sequelize[_0xbd85('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xbd85('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xbd85('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 2f4bf33..db5b1b0 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 _0x3eca=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','status','sendStatus','error','stack','name','send','index','VoiceAgentReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','update','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4d4fae,_0x205a98){var _0x564e25=function(_0x3b9d1e){while(--_0x3b9d1e){_0x4d4fae['push'](_0x4d4fae['shift']());}};_0x564e25(++_0x205a98);}(_0x3eca,0x17e));var _0xa3ec=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x3eca[_0x261b8a];return _0x3455e8;};'use strict';var pdf=require(_0xa3ec('0x0'));var emlformat=require(_0xa3ec('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa3ec('0x2'));var jsonpatch=require(_0xa3ec('0x3'));var rp=require(_0xa3ec('0x4'));var moment=require(_0xa3ec('0x5'));var BPromise=require(_0xa3ec('0x6'));var Mustache=require(_0xa3ec('0x7'));var util=require(_0xa3ec('0x8'));var path=require(_0xa3ec('0x9'));var sox=require(_0xa3ec('0xa'));var csv=require(_0xa3ec('0xb'));var ejs=require(_0xa3ec('0xc'));var fs=require('fs');var _=require(_0xa3ec('0xd'));var squel=require(_0xa3ec('0xe'));var crypto=require(_0xa3ec('0xf'));var jsforce=require(_0xa3ec('0x10'));var deskjs=require(_0xa3ec('0x11'));var toCsv=require(_0xa3ec('0xb'));var querystring=require(_0xa3ec('0x12'));var Papa=require(_0xa3ec('0x13'));var authService=require(_0xa3ec('0x14'));var hardwareService=require(_0xa3ec('0x15'));var Redis=require(_0xa3ec('0x16'));var qs=require(_0xa3ec('0x17'));var logger=require('../../config/logger')(_0xa3ec('0x18'));var utils=require('../../config/utils');var config=require(_0xa3ec('0x19'));var db=require(_0xa3ec('0x1a'))['db'];function respondWithStatusCode(_0x4f7e6f,_0x32f864){_0x32f864=_0x32f864||0xcc;return function(_0x27185c){if(_0x27185c){return _0x4f7e6f['sendStatus'](_0x32f864);}return _0x4f7e6f['status'](_0x32f864)[_0xa3ec('0x1b')]();};}function respondWithResult(_0x3a7b26,_0x409ec2){_0x409ec2=_0x409ec2||0xc8;return function(_0x52a4b5){if(_0x52a4b5){return _0x3a7b26['status'](_0x409ec2)[_0xa3ec('0x1c')](_0x52a4b5);}};}function respondWithFilteredResult(_0x2cc228,_0x165a57){return function(_0x5c28ed){if(_0x5c28ed){var _0x569ed3=_0x5c28ed[_0xa3ec('0x1d')],_0x548dfc=_0x165a57[_0xa3ec('0x1e')],_0x55bfd3=_0x165a57['offset']+_0x165a57[_0xa3ec('0x1f')],_0x51b57f;if(_0x55bfd3>=_0x569ed3){_0x55bfd3=_0x569ed3;_0x51b57f=0xc8;}else{_0x51b57f=0xce;}_0x2cc228['status'](_0x51b57f);return _0x2cc228['set'](_0xa3ec('0x20'),_0x548dfc+'-'+_0x55bfd3+'/'+_0x569ed3)[_0xa3ec('0x1c')](_0x5c28ed);}return null;};}function patchUpdates(_0x32e874){return function(_0x13a34d){try{jsonpatch[_0xa3ec('0x21')](_0x13a34d,_0x32e874,!![]);}catch(_0x1f501f){return BPromise[_0xa3ec('0x22')](_0x1f501f);}return _0x13a34d[_0xa3ec('0x23')]();};}function saveUpdates(_0x27676e,_0x122233){return function(_0xdd7e73){if(_0xdd7e73){return _0xdd7e73['update'](_0x27676e)[_0xa3ec('0x24')](function(_0x4c5fde){return _0x4c5fde;});}return null;};}function removeEntity(_0x3aa223,_0x58fe50){return function(_0x5816cb){if(_0x5816cb){return _0x5816cb[_0xa3ec('0x25')]()[_0xa3ec('0x24')](function(){_0x3aa223[_0xa3ec('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f6815,_0x3f1925){return function(_0x35d359){if(!_0x35d359){_0x1f6815[_0xa3ec('0x27')](0x194);}return _0x35d359;};}function handleError(_0x23e52f,_0x23190a){_0x23190a=_0x23190a||0x1f4;return function(_0x56713c){logger[_0xa3ec('0x28')](_0x56713c[_0xa3ec('0x29')]);if(_0x56713c[_0xa3ec('0x2a')]){delete _0x56713c[_0xa3ec('0x2a')];}_0x23e52f[_0xa3ec('0x26')](_0x23190a)[_0xa3ec('0x2b')](_0x56713c);};}exports[_0xa3ec('0x2c')]=function(_0x44754b,_0x830e3){var _0x5bbaa9={},_0x39c57e={},_0x2ece09={'count':0x0,'rows':[]};var _0x4d294c=db[_0xa3ec('0x2d')][_0xa3ec('0x2e')];_0x39c57e[_0xa3ec('0x2f')]=_[_0xa3ec('0x30')](_0x4d294c);_0x39c57e[_0xa3ec('0x31')]=_[_0xa3ec('0x30')](_0x44754b[_0xa3ec('0x31')]);_0x39c57e[_0xa3ec('0x32')]=_[_0xa3ec('0x33')](_0x39c57e[_0xa3ec('0x2f')],_0x39c57e[_0xa3ec('0x31')]);_0x5bbaa9[_0xa3ec('0x34')]=_[_0xa3ec('0x33')](_0x39c57e['model'],qs[_0xa3ec('0x35')](_0x44754b[_0xa3ec('0x31')][_0xa3ec('0x35')]));_0x5bbaa9[_0xa3ec('0x34')]=_0x5bbaa9[_0xa3ec('0x34')][_0xa3ec('0x36')]?_0x5bbaa9['attributes']:_0x39c57e[_0xa3ec('0x2f')];if(!_0x44754b['query'][_0xa3ec('0x37')](_0xa3ec('0x38'))){_0x5bbaa9[_0xa3ec('0x1f')]=qs[_0xa3ec('0x1f')](_0x44754b[_0xa3ec('0x31')][_0xa3ec('0x1f')]);_0x5bbaa9[_0xa3ec('0x1e')]=qs[_0xa3ec('0x1e')](_0x44754b[_0xa3ec('0x31')][_0xa3ec('0x1e')]);}_0x5bbaa9[_0xa3ec('0x39')]=qs['sort'](_0x44754b[_0xa3ec('0x31')][_0xa3ec('0x3a')]);_0x5bbaa9[_0xa3ec('0x3b')]=qs[_0xa3ec('0x32')](_['pick'](_0x44754b[_0xa3ec('0x31')],_0x39c57e[_0xa3ec('0x32')]));if(_0x44754b[_0xa3ec('0x31')][_0xa3ec('0x3c')]){_0x5bbaa9['where']=_['merge'](_0x5bbaa9[_0xa3ec('0x3b')],{'$or':_[_0xa3ec('0x3d')](_0x4d294c,function(_0xbf48b1){if(_0xbf48b1[_0xa3ec('0x3e')][_0xa3ec('0x3f')]!==_0xa3ec('0x40')){var _0xf69284={};_0xf69284[_0xbf48b1['field']]={'$like':'%'+_0x44754b[_0xa3ec('0x31')]['filter']+'%'};return _0xf69284;}})});}_0x5bbaa9=_[_0xa3ec('0x41')]({},_0x5bbaa9,_0x44754b[_0xa3ec('0x42')]);var _0x18675a={'where':_0x5bbaa9[_0xa3ec('0x3b')]};return db[_0xa3ec('0x2d')]['count'](_0x18675a)[_0xa3ec('0x24')](function(_0x380eb1){_0x2ece09['count']=_0x380eb1;if(_0x44754b[_0xa3ec('0x31')][_0xa3ec('0x43')]){_0x5bbaa9[_0xa3ec('0x44')]=[{'all':!![]}];}return db[_0xa3ec('0x2d')]['findAll'](_0x5bbaa9);})[_0xa3ec('0x24')](function(_0x4260ce){_0x2ece09[_0xa3ec('0x45')]=_0x4260ce;return _0x2ece09;})[_0xa3ec('0x24')](respondWithFilteredResult(_0x830e3,_0x5bbaa9))[_0xa3ec('0x46')](handleError(_0x830e3,null));};exports[_0xa3ec('0x47')]=function(_0x33d2ce,_0x33e284){var _0x3e7ab4={'raw':![],'where':{'id':_0x33d2ce[_0xa3ec('0x48')]['id']}},_0x5de850={};_0x5de850[_0xa3ec('0x2f')]=_[_0xa3ec('0x30')](db[_0xa3ec('0x2d')]['rawAttributes']);_0x5de850[_0xa3ec('0x31')]=_[_0xa3ec('0x30')](_0x33d2ce[_0xa3ec('0x31')]);_0x5de850[_0xa3ec('0x32')]=_['intersection'](_0x5de850[_0xa3ec('0x2f')],_0x5de850[_0xa3ec('0x31')]);_0x3e7ab4[_0xa3ec('0x34')]=_['intersection'](_0x5de850['model'],qs['fields'](_0x33d2ce[_0xa3ec('0x31')][_0xa3ec('0x35')]));_0x3e7ab4['attributes']=_0x3e7ab4[_0xa3ec('0x34')][_0xa3ec('0x36')]?_0x3e7ab4[_0xa3ec('0x34')]:_0x5de850['model'];if(_0x33d2ce[_0xa3ec('0x31')][_0xa3ec('0x43')]){_0x3e7ab4[_0xa3ec('0x44')]=[{'all':!![]}];}_0x3e7ab4=_['merge']({},_0x3e7ab4,_0x33d2ce[_0xa3ec('0x42')]);return db[_0xa3ec('0x2d')][_0xa3ec('0x49')](_0x3e7ab4)[_0xa3ec('0x24')](handleEntityNotFound(_0x33e284,null))[_0xa3ec('0x24')](respondWithResult(_0x33e284,null))[_0xa3ec('0x46')](handleError(_0x33e284,null));};exports['create']=function(_0x25b416,_0x53fc14){return db[_0xa3ec('0x2d')][_0xa3ec('0x4a')](_0x25b416[_0xa3ec('0x4b')],{})[_0xa3ec('0x24')](respondWithResult(_0x53fc14,0xc9))[_0xa3ec('0x46')](handleError(_0x53fc14,null));};exports[_0xa3ec('0x4c')]=function(_0x40aa16,_0x368e81){if(_0x40aa16[_0xa3ec('0x4b')]['id']){delete _0x40aa16[_0xa3ec('0x4b')]['id'];}return db[_0xa3ec('0x2d')][_0xa3ec('0x49')]({'where':{'id':_0x40aa16[_0xa3ec('0x48')]['id']}})[_0xa3ec('0x24')](handleEntityNotFound(_0x368e81,null))[_0xa3ec('0x24')](saveUpdates(_0x40aa16[_0xa3ec('0x4b')],null))[_0xa3ec('0x24')](respondWithResult(_0x368e81,null))[_0xa3ec('0x46')](handleError(_0x368e81,null));};exports[_0xa3ec('0x25')]=function(_0x12b617,_0x3c2c35){return db[_0xa3ec('0x2d')][_0xa3ec('0x49')]({'where':{'id':_0x12b617[_0xa3ec('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c2c35,null))[_0xa3ec('0x24')](removeEntity(_0x3c2c35,null))[_0xa3ec('0x46')](handleError(_0x3c2c35,null));};exports[_0xa3ec('0x4d')]=function(_0x289c7c,_0x34e486){return db[_0xa3ec('0x2d')][_0xa3ec('0x4d')]()['then'](respondWithResult(_0x34e486,null))[_0xa3ec('0x46')](handleError(_0x34e486,null));}; \ No newline at end of file +var _0x4c58=['params','rawAttributes','fields','catch','create','update','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','limit','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','where','merge','type','key','field','filter','options','VoiceAgentReport','includeAll','include','findAll','rows'];(function(_0xf9431c,_0x4754b5){var _0x53fc33=function(_0x50ac6c){while(--_0x50ac6c){_0xf9431c['push'](_0xf9431c['shift']());}};_0x53fc33(++_0x4754b5);}(_0x4c58,0xed));var _0x84c5=function(_0x3c1e2e,_0x383e30){_0x3c1e2e=_0x3c1e2e-0x0;var _0x3dbe7c=_0x4c58[_0x3c1e2e];return _0x3dbe7c;};'use strict';var pdf=require(_0x84c5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x84c5('0x1'));var zipdir=require(_0x84c5('0x2'));var jsonpatch=require(_0x84c5('0x3'));var rp=require(_0x84c5('0x4'));var moment=require(_0x84c5('0x5'));var BPromise=require(_0x84c5('0x6'));var Mustache=require(_0x84c5('0x7'));var util=require('util');var path=require(_0x84c5('0x8'));var sox=require(_0x84c5('0x9'));var csv=require(_0x84c5('0xa'));var ejs=require(_0x84c5('0xb'));var fs=require('fs');var _=require(_0x84c5('0xc'));var squel=require(_0x84c5('0xd'));var crypto=require(_0x84c5('0xe'));var jsforce=require(_0x84c5('0xf'));var deskjs=require(_0x84c5('0x10'));var toCsv=require(_0x84c5('0xa'));var querystring=require(_0x84c5('0x11'));var Papa=require(_0x84c5('0x12'));var authService=require(_0x84c5('0x13'));var hardwareService=require(_0x84c5('0x14'));var Redis=require(_0x84c5('0x15'));var qs=require('../../components/parsers/qs');var logger=require(_0x84c5('0x16'))(_0x84c5('0x17'));var utils=require(_0x84c5('0x18'));var config=require('../../config/environment');var db=require(_0x84c5('0x19'))['db'];function respondWithStatusCode(_0x36f613,_0x295013){_0x295013=_0x295013||0xcc;return function(_0x56cbfc){if(_0x56cbfc){return _0x36f613['sendStatus'](_0x295013);}return _0x36f613[_0x84c5('0x1a')](_0x295013)[_0x84c5('0x1b')]();};}function respondWithResult(_0x4f9f8d,_0x4398b7){_0x4398b7=_0x4398b7||0xc8;return function(_0x2eb1af){if(_0x2eb1af){return _0x4f9f8d[_0x84c5('0x1a')](_0x4398b7)[_0x84c5('0x1c')](_0x2eb1af);}};}function respondWithFilteredResult(_0x1df6d5,_0x3cc823){return function(_0x20983c){if(_0x20983c){var _0x4eb5ed=_0x20983c[_0x84c5('0x1d')],_0x26a45c=_0x3cc823['offset'],_0xc72976=_0x3cc823['offset']+_0x3cc823[_0x84c5('0x1e')],_0x24232f;if(_0xc72976>=_0x4eb5ed){_0xc72976=_0x4eb5ed;_0x24232f=0xc8;}else{_0x24232f=0xce;}_0x1df6d5[_0x84c5('0x1a')](_0x24232f);return _0x1df6d5['set']('Content-Range',_0x26a45c+'-'+_0xc72976+'/'+_0x4eb5ed)[_0x84c5('0x1c')](_0x20983c);}return null;};}function patchUpdates(_0x4bc27a){return function(_0x46f19e){try{jsonpatch[_0x84c5('0x1f')](_0x46f19e,_0x4bc27a,!![]);}catch(_0x2fbc39){return BPromise[_0x84c5('0x20')](_0x2fbc39);}return _0x46f19e[_0x84c5('0x21')]();};}function saveUpdates(_0x1ce70b,_0x38c45e){return function(_0x386f46){if(_0x386f46){return _0x386f46['update'](_0x1ce70b)[_0x84c5('0x22')](function(_0x1a87b5){return _0x1a87b5;});}return null;};}function removeEntity(_0x57b702,_0xf1e692){return function(_0x55a2a7){if(_0x55a2a7){return _0x55a2a7[_0x84c5('0x23')]()['then'](function(){_0x57b702[_0x84c5('0x1a')](0xcc)[_0x84c5('0x1b')]();});}};}function handleEntityNotFound(_0x888bce,_0xa3bf12){return function(_0x3d0c5e){if(!_0x3d0c5e){_0x888bce[_0x84c5('0x24')](0x194);}return _0x3d0c5e;};}function handleError(_0x5944ef,_0x40c01e){_0x40c01e=_0x40c01e||0x1f4;return function(_0x2211ac){logger[_0x84c5('0x25')](_0x2211ac[_0x84c5('0x26')]);if(_0x2211ac[_0x84c5('0x27')]){delete _0x2211ac[_0x84c5('0x27')];}_0x5944ef[_0x84c5('0x1a')](_0x40c01e)[_0x84c5('0x28')](_0x2211ac);};}exports[_0x84c5('0x29')]=function(_0x159913,_0x5d5686){var _0x4deb9c={},_0xe42a5b={},_0x46e2e6={'count':0x0,'rows':[]};var _0x3f1746=db['VoiceAgentReport']['rawAttributes'];_0xe42a5b['model']=_['keys'](_0x3f1746);_0xe42a5b[_0x84c5('0x2a')]=_[_0x84c5('0x2b')](_0x159913[_0x84c5('0x2a')]);_0xe42a5b[_0x84c5('0x2c')]=_[_0x84c5('0x2d')](_0xe42a5b[_0x84c5('0x2e')],_0xe42a5b[_0x84c5('0x2a')]);_0x4deb9c[_0x84c5('0x2f')]=_[_0x84c5('0x2d')](_0xe42a5b[_0x84c5('0x2e')],qs['fields'](_0x159913[_0x84c5('0x2a')]['fields']));_0x4deb9c[_0x84c5('0x2f')]=_0x4deb9c[_0x84c5('0x2f')][_0x84c5('0x30')]?_0x4deb9c[_0x84c5('0x2f')]:_0xe42a5b[_0x84c5('0x2e')];if(!_0x159913[_0x84c5('0x2a')][_0x84c5('0x31')](_0x84c5('0x32'))){_0x4deb9c['limit']=qs['limit'](_0x159913[_0x84c5('0x2a')]['limit']);_0x4deb9c[_0x84c5('0x33')]=qs[_0x84c5('0x33')](_0x159913[_0x84c5('0x2a')][_0x84c5('0x33')]);}_0x4deb9c[_0x84c5('0x34')]=qs[_0x84c5('0x35')](_0x159913[_0x84c5('0x2a')]['sort']);_0x4deb9c['where']=qs[_0x84c5('0x2c')](_[_0x84c5('0x36')](_0x159913[_0x84c5('0x2a')],_0xe42a5b[_0x84c5('0x2c')]));if(_0x159913[_0x84c5('0x2a')]['filter']){_0x4deb9c[_0x84c5('0x37')]=_[_0x84c5('0x38')](_0x4deb9c[_0x84c5('0x37')],{'$or':_['map'](_0x3f1746,function(_0x262845){if(_0x262845[_0x84c5('0x39')][_0x84c5('0x3a')]!=='VIRTUAL'){var _0x4c64ea={};_0x4c64ea[_0x262845[_0x84c5('0x3b')]]={'$like':'%'+_0x159913[_0x84c5('0x2a')][_0x84c5('0x3c')]+'%'};return _0x4c64ea;}})});}_0x4deb9c=_[_0x84c5('0x38')]({},_0x4deb9c,_0x159913[_0x84c5('0x3d')]);var _0x19e5b2={'where':_0x4deb9c['where']};return db[_0x84c5('0x3e')][_0x84c5('0x1d')](_0x19e5b2)[_0x84c5('0x22')](function(_0x1381d4){_0x46e2e6['count']=_0x1381d4;if(_0x159913[_0x84c5('0x2a')][_0x84c5('0x3f')]){_0x4deb9c[_0x84c5('0x40')]=[{'all':!![]}];}return db[_0x84c5('0x3e')][_0x84c5('0x41')](_0x4deb9c);})['then'](function(_0xe707eb){_0x46e2e6[_0x84c5('0x42')]=_0xe707eb;return _0x46e2e6;})[_0x84c5('0x22')](respondWithFilteredResult(_0x5d5686,_0x4deb9c))['catch'](handleError(_0x5d5686,null));};exports['show']=function(_0x3f31a0,_0x3ddb1e){var _0x3237c1={'raw':![],'where':{'id':_0x3f31a0[_0x84c5('0x43')]['id']}},_0x183407={};_0x183407[_0x84c5('0x2e')]=_[_0x84c5('0x2b')](db['VoiceAgentReport'][_0x84c5('0x44')]);_0x183407[_0x84c5('0x2a')]=_[_0x84c5('0x2b')](_0x3f31a0[_0x84c5('0x2a')]);_0x183407[_0x84c5('0x2c')]=_[_0x84c5('0x2d')](_0x183407[_0x84c5('0x2e')],_0x183407[_0x84c5('0x2a')]);_0x3237c1['attributes']=_[_0x84c5('0x2d')](_0x183407[_0x84c5('0x2e')],qs['fields'](_0x3f31a0[_0x84c5('0x2a')][_0x84c5('0x45')]));_0x3237c1[_0x84c5('0x2f')]=_0x3237c1[_0x84c5('0x2f')][_0x84c5('0x30')]?_0x3237c1['attributes']:_0x183407[_0x84c5('0x2e')];if(_0x3f31a0[_0x84c5('0x2a')]['includeAll']){_0x3237c1[_0x84c5('0x40')]=[{'all':!![]}];}_0x3237c1=_[_0x84c5('0x38')]({},_0x3237c1,_0x3f31a0['options']);return db[_0x84c5('0x3e')]['find'](_0x3237c1)['then'](handleEntityNotFound(_0x3ddb1e,null))[_0x84c5('0x22')](respondWithResult(_0x3ddb1e,null))[_0x84c5('0x46')](handleError(_0x3ddb1e,null));};exports[_0x84c5('0x47')]=function(_0x1dc9d0,_0x4e28d9){return db[_0x84c5('0x3e')]['create'](_0x1dc9d0['body'],{})[_0x84c5('0x22')](respondWithResult(_0x4e28d9,0xc9))['catch'](handleError(_0x4e28d9,null));};exports[_0x84c5('0x48')]=function(_0x2a3382,_0x11f61c){if(_0x2a3382['body']['id']){delete _0x2a3382[_0x84c5('0x49')]['id'];}return db[_0x84c5('0x3e')][_0x84c5('0x4a')]({'where':{'id':_0x2a3382[_0x84c5('0x43')]['id']}})['then'](handleEntityNotFound(_0x11f61c,null))[_0x84c5('0x22')](saveUpdates(_0x2a3382[_0x84c5('0x49')],null))[_0x84c5('0x22')](respondWithResult(_0x11f61c,null))[_0x84c5('0x46')](handleError(_0x11f61c,null));};exports[_0x84c5('0x23')]=function(_0x55d15,_0x4859d6){return db[_0x84c5('0x3e')][_0x84c5('0x4a')]({'where':{'id':_0x55d15['params']['id']}})['then'](handleEntityNotFound(_0x4859d6,null))[_0x84c5('0x22')](removeEntity(_0x4859d6,null))[_0x84c5('0x46')](handleError(_0x4859d6,null));};exports[_0x84c5('0x4b')]=function(_0x3834c9,_0x45c83a){return db[_0x84c5('0x3e')][_0x84c5('0x4b')]()[_0x84c5('0x22')](respondWithResult(_0x45c83a,null))[_0x84c5('0x46')](handleError(_0x45c83a,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 8278f60..1c69c15 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 _0x931b=['VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','request-promise','./voiceAgentReport.attributes','exports'];(function(_0x285507,_0x4011db){var _0x5f13e9=function(_0x4afdc8){while(--_0x4afdc8){_0x285507['push'](_0x285507['shift']());}};_0x5f13e9(++_0x4011db);}(_0x931b,0x184));var _0xb931=function(_0x89384d,_0xd90fa5){_0x89384d=_0x89384d-0x0;var _0x1f6121=_0x931b[_0x89384d];return _0x1f6121;};'use strict';var _=require(_0xb931('0x0'));var util=require(_0xb931('0x1'));var logger=require(_0xb931('0x2'))(_0xb931('0x3'));var moment=require(_0xb931('0x4'));var BPromise=require('bluebird');var rp=require(_0xb931('0x5'));var attributes=require(_0xb931('0x6'));module[_0xb931('0x7')]=function(_0x29d8f2,_0x3a557b){return _0x29d8f2['define'](_0xb931('0x8'),attributes,{'tableName':_0xb931('0x9'),'paranoid':![],'indexes':[{'fields':[_0xb931('0xa'),_0xb931('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e57=['bluebird','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','lodash','../../config/logger','api','moment'];(function(_0x4fbf4a,_0x41f6ca){var _0x4bd230=function(_0x595f1f){while(--_0x595f1f){_0x4fbf4a['push'](_0x4fbf4a['shift']());}};_0x4bd230(++_0x41f6ca);}(_0x4e57,0x1be));var _0x74e5=function(_0x1c7643,_0x5c15a5){_0x1c7643=_0x1c7643-0x0;var _0x2868de=_0x4e57[_0x1c7643];return _0x2868de;};'use strict';var _=require(_0x74e5('0x0'));var util=require('util');var logger=require(_0x74e5('0x1'))(_0x74e5('0x2'));var moment=require(_0x74e5('0x3'));var BPromise=require(_0x74e5('0x4'));var rp=require('request-promise');var attributes=require(_0x74e5('0x5'));module[_0x74e5('0x6')]=function(_0x15ee80,_0x3b6756){return _0x15ee80['define'](_0x74e5('0x7'),attributes,{'tableName':_0x74e5('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index eb06161..e5dfb8b 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceAgentReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','then','lodash','util'];(function(_0x1d203a,_0x23ef7f){var _0x5710b2=function(_0x5c53cf){while(--_0x5c53cf){_0x1d203a['push'](_0x1d203a['shift']());}};_0x5710b2(++_0x23ef7f);}(_0x7a54,0x106));var _0x47a5=function(_0x49ba43,_0x46ccc6){_0x49ba43=_0x49ba43-0x0;var _0x1c3a58=_0x7a54[_0x49ba43];return _0x1c3a58;};'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')]('VoiceAgentReport,\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['CreateVoiceAgentReport']=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')]('CreateVoiceAgentReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x4e7490,_0x4b26ae){var _0x3622d0=function(_0x40a2bb){while(--_0x40a2bb){_0x4e7490['push'](_0x4e7490['shift']());}};_0x3622d0(++_0x4b26ae);}(_0x814b,0x1a2));var _0xb814=function(_0x4a4a43,_0x115ccf){_0x4a4a43=_0x4a4a43-0x0;var _0x5893a6=_0x814b[_0x4a4a43];return _0x5893a6;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 8e2e8f2..609f5a9 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 _0xa33f=['Router','../../components/auth/service','./voiceCallReport.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','update','delete','multer','util','path','connect-timeout'];(function(_0x32f193,_0x59d48a){var _0x4cf048=function(_0x2909b2){while(--_0x2909b2){_0x32f193['push'](_0x32f193['shift']());}};_0x4cf048(++_0x59d48a);}(_0xa33f,0x1e9));var _0xfa33=function(_0x3b7e11,_0xc636a5){_0x3b7e11=_0x3b7e11-0x0;var _0x370b94=_0xa33f[_0x3b7e11];return _0x370b94;};'use strict';var multer=require(_0xfa33('0x0'));var util=require(_0xfa33('0x1'));var path=require(_0xfa33('0x2'));var timeout=require(_0xfa33('0x3'));var express=require('express');var router=express[_0xfa33('0x4')]();var auth=require(_0xfa33('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfa33('0x6'));router['get']('/',auth[_0xfa33('0x7')](),controller[_0xfa33('0x8')]);router[_0xfa33('0x9')](_0xfa33('0xa'),auth['isAuthenticated'](),controller[_0xfa33('0xb')]);router[_0xfa33('0x9')](_0xfa33('0xc'),auth[_0xfa33('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xfa33('0xd')]);router[_0xfa33('0xe')](_0xfa33('0xc'),auth[_0xfa33('0x7')](),controller[_0xfa33('0xf')]);router[_0xfa33('0x10')](_0xfa33('0xc'),auth[_0xfa33('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x85bb=['/describe','isAuthenticated','describe','/:id','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x17b137,_0x4efcbb){var _0x4ab287=function(_0x4c83fe){while(--_0x4c83fe){_0x17b137['push'](_0x17b137['shift']());}};_0x4ab287(++_0x4efcbb);}(_0x85bb,0x77));var _0xb85b=function(_0x1f0515,_0x237038){_0x1f0515=_0x1f0515-0x0;var _0x4c6710=_0x85bb[_0x1f0515];return _0x4c6710;};'use strict';var multer=require(_0xb85b('0x0'));var util=require(_0xb85b('0x1'));var path=require(_0xb85b('0x2'));var timeout=require(_0xb85b('0x3'));var express=require(_0xb85b('0x4'));var router=express[_0xb85b('0x5')]();var auth=require(_0xb85b('0x6'));var interaction=require(_0xb85b('0x7'));var config=require('../../config/environment');var controller=require('./voiceCallReport.controller');router[_0xb85b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb85b('0x8')](_0xb85b('0x9'),auth[_0xb85b('0xa')](),controller[_0xb85b('0xb')]);router['get'](_0xb85b('0xc'),auth[_0xb85b('0xa')](),controller['show']);router['post']('/',auth[_0xb85b('0xa')](),controller['create']);router[_0xb85b('0xd')](_0xb85b('0xc'),auth[_0xb85b('0xa')](),controller[_0xb85b('0xe')]);router['delete'](_0xb85b('0xc'),auth[_0xb85b('0xa')](),controller[_0xb85b('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 202d3ac..3c8a572 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 _0xd8bb=['internal','outbound','outbound-fax','dialer','TEXT','DATE','INTEGER','exports','STRING','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8bb,0x9d));var _0xbd8b=function(_0x302180,_0x11db9f){_0x302180=_0x302180-0x0;var _0x27ef2b=_0xd8bb[_0x302180];return _0x27ef2b;};'use strict';var Sequelize=require('sequelize');module[_0xbd8b('0x0')]={'uniqueid':{'type':Sequelize[_0xbd8b('0x1')]},'type':{'type':Sequelize[_0xbd8b('0x2')]('inbound',_0xbd8b('0x3'),_0xbd8b('0x4'),'inbound-fax',_0xbd8b('0x5'),_0xbd8b('0x6'))},'tag':{'type':Sequelize[_0xbd8b('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xbd8b('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xbd8b('0x1')]},'callerid':{'type':Sequelize[_0xbd8b('0x1')]},'channel':{'type':Sequelize[_0xbd8b('0x1')]},'destinationchannel':{'type':Sequelize[_0xbd8b('0x1')]},'lastapplication':{'type':Sequelize[_0xbd8b('0x1')]},'lastdata':{'type':Sequelize[_0xbd8b('0x7')]},'starttime':{'type':Sequelize[_0xbd8b('0x8')]},'answertime':{'type':Sequelize[_0xbd8b('0x8')]},'endtime':{'type':Sequelize[_0xbd8b('0x8')]},'duration':{'type':Sequelize[_0xbd8b('0x9')]},'billableseconds':{'type':Sequelize[_0xbd8b('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbd8b('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xbd8b('0x1')]},'userDisposition':{'type':Sequelize[_0xbd8b('0x1')]},'note':{'type':Sequelize[_0xbd8b('0x1')]},'prefix':{'type':Sequelize[_0xbd8b('0x1')]},'routeid':{'type':Sequelize[_0xbd8b('0x9')]}}; \ No newline at end of file +var _0x97fd=['inbound-fax','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound'];(function(_0x514034,_0x819743){var _0x56277a=function(_0x3bda33){while(--_0x3bda33){_0x514034['push'](_0x514034['shift']());}};_0x56277a(++_0x819743);}(_0x97fd,0x1c7));var _0xd97f=function(_0xe98907,_0x278953){_0xe98907=_0xe98907-0x0;var _0x77e49=_0x97fd[_0xe98907];return _0x77e49;};'use strict';var Sequelize=require(_0xd97f('0x0'));module[_0xd97f('0x1')]={'uniqueid':{'type':Sequelize[_0xd97f('0x2')]},'type':{'type':Sequelize[_0xd97f('0x3')](_0xd97f('0x4'),_0xd97f('0x5'),_0xd97f('0x6'),_0xd97f('0x7'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0xd97f('0x2')]},'accountcode':{'type':Sequelize[_0xd97f('0x2')]},'source':{'type':Sequelize[_0xd97f('0x2')]},'destination':{'type':Sequelize[_0xd97f('0x2')]},'destinationcontext':{'type':Sequelize[_0xd97f('0x2')]},'callerid':{'type':Sequelize[_0xd97f('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xd97f('0x2')]},'lastapplication':{'type':Sequelize[_0xd97f('0x2')]},'lastdata':{'type':Sequelize[_0xd97f('0x8')]},'starttime':{'type':Sequelize[_0xd97f('0x9')]},'answertime':{'type':Sequelize[_0xd97f('0x9')]},'endtime':{'type':Sequelize[_0xd97f('0x9')]},'duration':{'type':Sequelize[_0xd97f('0xa')]},'billableseconds':{'type':Sequelize[_0xd97f('0xa')]},'mohtime':{'type':Sequelize[_0xd97f('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd97f('0x2')]},'amaflags':{'type':Sequelize[_0xd97f('0x2')]},'userfield':{'type':Sequelize[_0xd97f('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd97f('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xd97f('0xa')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index dc099fd..38b9a4d 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 _0x2382=['pick','merge','key','VIRTUAL','field','filter','options','fullname','alias','User','findAll','rows','catch','params','rawAttributes','length','includeAll','include','find','create','describe','body','uniqueid','user','html-pdf','zip-dir','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','VoiceCallReport','model','keys','query','intersection','attributes','fields','nolimit','limit','order','sort','where','filters'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2382,0x1c2));var _0x2238=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x2382[_0x38eb23];return _0x48506a;};'use strict';var pdf=require(_0x2238('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2238('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2238('0x2'));var BPromise=require(_0x2238('0x3'));var Mustache=require(_0x2238('0x4'));var util=require('util');var path=require(_0x2238('0x5'));var sox=require(_0x2238('0x6'));var csv=require('to-csv');var ejs=require(_0x2238('0x7'));var fs=require('fs');var _=require(_0x2238('0x8'));var squel=require('squel');var crypto=require(_0x2238('0x9'));var jsforce=require(_0x2238('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2238('0xb'));var Papa=require(_0x2238('0xc'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require(_0x2238('0xd'));var logger=require(_0x2238('0xe'))(_0x2238('0xf'));var utils=require(_0x2238('0x10'));var config=require(_0x2238('0x11'));var db=require(_0x2238('0x12'))['db'];function respondWithStatusCode(_0x1e9624,_0x34b64a){_0x34b64a=_0x34b64a||0xcc;return function(_0x258961){if(_0x258961){return _0x1e9624['sendStatus'](_0x34b64a);}return _0x1e9624[_0x2238('0x13')](_0x34b64a)['end']();};}function respondWithResult(_0x49ec4e,_0x20b00a){_0x20b00a=_0x20b00a||0xc8;return function(_0x5b2d18){if(_0x5b2d18){return _0x49ec4e[_0x2238('0x13')](_0x20b00a)['json'](_0x5b2d18);}};}function respondWithFilteredResult(_0x6234f2,_0x2afcc5){return function(_0x258a04){if(_0x258a04){var _0xe54ee9=_0x258a04[_0x2238('0x14')],_0x592523=_0x2afcc5[_0x2238('0x15')],_0x26396d=_0x2afcc5['offset']+_0x2afcc5['limit'],_0x23aa28;if(_0x26396d>=_0xe54ee9){_0x26396d=_0xe54ee9;_0x23aa28=0xc8;}else{_0x23aa28=0xce;}_0x6234f2[_0x2238('0x13')](_0x23aa28);return _0x6234f2['set']('Content-Range',_0x592523+'-'+_0x26396d+'/'+_0xe54ee9)['json'](_0x258a04);}return null;};}function patchUpdates(_0x2476dd){return function(_0x48f0b0){try{jsonpatch[_0x2238('0x16')](_0x48f0b0,_0x2476dd,!![]);}catch(_0x3f1a70){return BPromise[_0x2238('0x17')](_0x3f1a70);}return _0x48f0b0[_0x2238('0x18')]();};}function saveUpdates(_0x186e3c,_0x141f3b){return function(_0x1c6c01){if(_0x1c6c01){return _0x1c6c01[_0x2238('0x19')](_0x186e3c)[_0x2238('0x1a')](function(_0x484055){return _0x484055;});}return null;};}function removeEntity(_0x4bfadb,_0x35c3dd){return function(_0x1c2fa1){if(_0x1c2fa1){return _0x1c2fa1[_0x2238('0x1b')]()[_0x2238('0x1a')](function(){_0x4bfadb[_0x2238('0x13')](0xcc)[_0x2238('0x1c')]();});}};}function handleEntityNotFound(_0x345cf1,_0x40076a){return function(_0x474545){if(!_0x474545){_0x345cf1[_0x2238('0x1d')](0x194);}return _0x474545;};}function handleError(_0x3e32ab,_0x35046b){_0x35046b=_0x35046b||0x1f4;return function(_0x2a325a){logger['error'](_0x2a325a[_0x2238('0x1e')]);if(_0x2a325a[_0x2238('0x1f')]){delete _0x2a325a['name'];}_0x3e32ab[_0x2238('0x13')](_0x35046b)[_0x2238('0x20')](_0x2a325a);};}exports[_0x2238('0x21')]=function(_0x570a23,_0x2c6b9f){var _0x558d29={},_0xb5c049={},_0x1c86e2={'count':0x0,'rows':[]};var _0x5bde17=db[_0x2238('0x22')]['rawAttributes'];_0xb5c049[_0x2238('0x23')]=_[_0x2238('0x24')](_0x5bde17);_0xb5c049[_0x2238('0x25')]=_[_0x2238('0x24')](_0x570a23[_0x2238('0x25')]);_0xb5c049['filters']=_[_0x2238('0x26')](_0xb5c049[_0x2238('0x23')],_0xb5c049['query']);_0x558d29[_0x2238('0x27')]=_[_0x2238('0x26')](_0xb5c049[_0x2238('0x23')],qs[_0x2238('0x28')](_0x570a23[_0x2238('0x25')][_0x2238('0x28')]));_0x558d29[_0x2238('0x27')]=_0x558d29['attributes']['length']?_0x558d29[_0x2238('0x27')]:_0xb5c049[_0x2238('0x23')];if(!_0x570a23[_0x2238('0x25')]['hasOwnProperty'](_0x2238('0x29'))){_0x558d29[_0x2238('0x2a')]=qs[_0x2238('0x2a')](_0x570a23['query'][_0x2238('0x2a')]);_0x558d29['offset']=qs[_0x2238('0x15')](_0x570a23[_0x2238('0x25')][_0x2238('0x15')]);}_0x558d29[_0x2238('0x2b')]=qs[_0x2238('0x2c')](_0x570a23[_0x2238('0x25')]['sort']);_0x558d29[_0x2238('0x2d')]=qs[_0x2238('0x2e')](_[_0x2238('0x2f')](_0x570a23[_0x2238('0x25')],_0xb5c049['filters']));if(_0x570a23[_0x2238('0x25')]['filter']){_0x558d29['where']=_[_0x2238('0x30')](_0x558d29[_0x2238('0x2d')],{'$or':_['map'](_0x5bde17,function(_0x344e11){if(_0x344e11['type'][_0x2238('0x31')]!==_0x2238('0x32')){var _0x38f42e={};_0x38f42e[_0x344e11[_0x2238('0x33')]]={'$like':'%'+_0x570a23['query'][_0x2238('0x34')]+'%'};return _0x38f42e;}})});}_0x558d29=_[_0x2238('0x30')]({},_0x558d29,_0x570a23[_0x2238('0x35')]);var _0x384267={'where':_0x558d29[_0x2238('0x2d')]};return db[_0x2238('0x22')]['count'](_0x384267)[_0x2238('0x1a')](function(_0xcc59d3){_0x1c86e2[_0x2238('0x14')]=_0xcc59d3;if(_0x570a23[_0x2238('0x25')]['includeAll']){_0x558d29['include']=[{'attributes':['id',_0x2238('0x1f'),_0x2238('0x36'),_0x2238('0x37')],'model':db[_0x2238('0x38')],'as':_0x2238('0x38')}];}return db[_0x2238('0x22')][_0x2238('0x39')](_0x558d29);})[_0x2238('0x1a')](function(_0x4baab4){_0x1c86e2[_0x2238('0x3a')]=_0x4baab4;return _0x1c86e2;})[_0x2238('0x1a')](respondWithFilteredResult(_0x2c6b9f,_0x558d29))[_0x2238('0x3b')](handleError(_0x2c6b9f,null));};exports['show']=function(_0x4fb3c9,_0x27a5d2){var _0x4c2f76={'raw':!![],'where':{'id':_0x4fb3c9[_0x2238('0x3c')]['id']}},_0x350735={};_0x350735[_0x2238('0x23')]=_['keys'](db[_0x2238('0x22')][_0x2238('0x3d')]);_0x350735[_0x2238('0x25')]=_['keys'](_0x4fb3c9[_0x2238('0x25')]);_0x350735['filters']=_[_0x2238('0x26')](_0x350735['model'],_0x350735[_0x2238('0x25')]);_0x4c2f76['attributes']=_[_0x2238('0x26')](_0x350735[_0x2238('0x23')],qs[_0x2238('0x28')](_0x4fb3c9[_0x2238('0x25')][_0x2238('0x28')]));_0x4c2f76['attributes']=_0x4c2f76[_0x2238('0x27')][_0x2238('0x3e')]?_0x4c2f76[_0x2238('0x27')]:_0x350735[_0x2238('0x23')];if(_0x4fb3c9[_0x2238('0x25')][_0x2238('0x3f')]){_0x4c2f76[_0x2238('0x40')]=[{'all':!![]}];}_0x4c2f76=_[_0x2238('0x30')]({},_0x4c2f76,_0x4fb3c9['options']);return db[_0x2238('0x22')][_0x2238('0x41')](_0x4c2f76)[_0x2238('0x1a')](handleEntityNotFound(_0x27a5d2,null))[_0x2238('0x1a')](respondWithResult(_0x27a5d2,null))['catch'](handleError(_0x27a5d2,null));};exports['create']=function(_0x1f33a8,_0x3d247a){return db[_0x2238('0x22')][_0x2238('0x42')](_0x1f33a8['body'],{})[_0x2238('0x1a')](respondWithResult(_0x3d247a,0xc9))[_0x2238('0x3b')](handleError(_0x3d247a,null));};exports[_0x2238('0x1b')]=function(_0x3eef6d,_0x49397a){return db[_0x2238('0x22')][_0x2238('0x41')]({'where':{'id':_0x3eef6d['params']['id']}})[_0x2238('0x1a')](handleEntityNotFound(_0x49397a,null))[_0x2238('0x1a')](removeEntity(_0x49397a,null))[_0x2238('0x3b')](handleError(_0x49397a,null));};exports['describe']=function(_0x5b51de,_0x2f92fa){return db[_0x2238('0x22')][_0x2238('0x43')]()[_0x2238('0x1a')](respondWithResult(_0x2f92fa,null))[_0x2238('0x3b')](handleError(_0x2f92fa,null));};exports[_0x2238('0x19')]=function(_0x3f7f83,_0xfc63fd){if(_0x3f7f83['body']['uniqueid']){delete _0x3f7f83[_0x2238('0x44')][_0x2238('0x45')];}return db[_0x2238('0x22')][_0x2238('0x41')]({'where':{'uniqueid':_0x3f7f83[_0x2238('0x3c')]['id'],'UserId':{'$or':[null,_0x3f7f83[_0x2238('0x46')]['id']]}}})[_0x2238('0x1a')](handleEntityNotFound(_0xfc63fd,null))[_0x2238('0x1a')](saveUpdates(_0x3f7f83[_0x2238('0x44')],null))['then'](respondWithResult(_0xfc63fd,null))[_0x2238('0x3b')](handleError(_0xfc63fd,null));}; \ No newline at end of file +var _0x92c1=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','apply','update','then','end','error','stack','name','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','VoiceCallReport','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','find','create','body','destroy','describe','uniqueid','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xf6b14c,_0x4f0868){var _0x2001a6=function(_0x28b3f4){while(--_0x28b3f4){_0xf6b14c['push'](_0xf6b14c['shift']());}};_0x2001a6(++_0x4f0868);}(_0x92c1,0xe7));var _0x192c=function(_0x1d9efb,_0x8f7c19){_0x1d9efb=_0x1d9efb-0x0;var _0x5469fa=_0x92c1[_0x1d9efb];return _0x5469fa;};'use strict';var pdf=require(_0x192c('0x0'));var emlformat=require(_0x192c('0x1'));var rimraf=require(_0x192c('0x2'));var zipdir=require(_0x192c('0x3'));var jsonpatch=require(_0x192c('0x4'));var rp=require(_0x192c('0x5'));var moment=require(_0x192c('0x6'));var BPromise=require(_0x192c('0x7'));var Mustache=require(_0x192c('0x8'));var util=require(_0x192c('0x9'));var path=require(_0x192c('0xa'));var sox=require(_0x192c('0xb'));var csv=require(_0x192c('0xc'));var ejs=require(_0x192c('0xd'));var fs=require('fs');var _=require(_0x192c('0xe'));var squel=require(_0x192c('0xf'));var crypto=require(_0x192c('0x10'));var jsforce=require(_0x192c('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x192c('0xc'));var querystring=require(_0x192c('0x12'));var Papa=require('papaparse');var authService=require(_0x192c('0x13'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x192c('0x14'));var qs=require(_0x192c('0x15'));var logger=require(_0x192c('0x16'))(_0x192c('0x17'));var utils=require('../../config/utils');var config=require(_0x192c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf18e3d,_0x562fab){_0x562fab=_0x562fab||0xcc;return function(_0x50780f){if(_0x50780f){return _0xf18e3d[_0x192c('0x19')](_0x562fab);}return _0xf18e3d[_0x192c('0x1a')](_0x562fab)['end']();};}function respondWithResult(_0x164914,_0x1d4edb){_0x1d4edb=_0x1d4edb||0xc8;return function(_0x28cd2d){if(_0x28cd2d){return _0x164914[_0x192c('0x1a')](_0x1d4edb)[_0x192c('0x1b')](_0x28cd2d);}};}function respondWithFilteredResult(_0xf81624,_0x37fd73){return function(_0x5493a3){if(_0x5493a3){var _0x1bbb6b=_0x5493a3['count'],_0x55044c=_0x37fd73[_0x192c('0x1c')],_0x1fb733=_0x37fd73[_0x192c('0x1c')]+_0x37fd73[_0x192c('0x1d')],_0x4d8fc7;if(_0x1fb733>=_0x1bbb6b){_0x1fb733=_0x1bbb6b;_0x4d8fc7=0xc8;}else{_0x4d8fc7=0xce;}_0xf81624['status'](_0x4d8fc7);return _0xf81624[_0x192c('0x1e')](_0x192c('0x1f'),_0x55044c+'-'+_0x1fb733+'/'+_0x1bbb6b)[_0x192c('0x1b')](_0x5493a3);}return null;};}function patchUpdates(_0x12e99a){return function(_0x42d9a4){try{jsonpatch[_0x192c('0x20')](_0x42d9a4,_0x12e99a,!![]);}catch(_0x29dd79){return BPromise['reject'](_0x29dd79);}return _0x42d9a4['save']();};}function saveUpdates(_0x2677c3,_0x462235){return function(_0x30cec2){if(_0x30cec2){return _0x30cec2[_0x192c('0x21')](_0x2677c3)[_0x192c('0x22')](function(_0x9f2320){return _0x9f2320;});}return null;};}function removeEntity(_0x27240d,_0x1ae5c9){return function(_0x39649c){if(_0x39649c){return _0x39649c['destroy']()[_0x192c('0x22')](function(){_0x27240d['status'](0xcc)[_0x192c('0x23')]();});}};}function handleEntityNotFound(_0x125829,_0x35d549){return function(_0xa36786){if(!_0xa36786){_0x125829[_0x192c('0x19')](0x194);}return _0xa36786;};}function handleError(_0x26cd66,_0x2156cc){_0x2156cc=_0x2156cc||0x1f4;return function(_0x137447){logger[_0x192c('0x24')](_0x137447[_0x192c('0x25')]);if(_0x137447[_0x192c('0x26')]){delete _0x137447[_0x192c('0x26')];}_0x26cd66[_0x192c('0x1a')](_0x2156cc)['send'](_0x137447);};}exports[_0x192c('0x27')]=function(_0x428f78,_0x2ab2f6){var _0x3191b6={},_0x129d83={},_0x44faf3={'count':0x0,'rows':[]};var _0x55e5d9=db['VoiceCallReport'][_0x192c('0x28')];_0x129d83['model']=_[_0x192c('0x29')](_0x55e5d9);_0x129d83[_0x192c('0x2a')]=_[_0x192c('0x29')](_0x428f78[_0x192c('0x2a')]);_0x129d83[_0x192c('0x2b')]=_[_0x192c('0x2c')](_0x129d83[_0x192c('0x2d')],_0x129d83[_0x192c('0x2a')]);_0x3191b6[_0x192c('0x2e')]=_[_0x192c('0x2c')](_0x129d83[_0x192c('0x2d')],qs[_0x192c('0x2f')](_0x428f78[_0x192c('0x2a')][_0x192c('0x2f')]));_0x3191b6[_0x192c('0x2e')]=_0x3191b6['attributes'][_0x192c('0x30')]?_0x3191b6[_0x192c('0x2e')]:_0x129d83[_0x192c('0x2d')];if(!_0x428f78[_0x192c('0x2a')][_0x192c('0x31')](_0x192c('0x32'))){_0x3191b6[_0x192c('0x1d')]=qs[_0x192c('0x1d')](_0x428f78[_0x192c('0x2a')][_0x192c('0x1d')]);_0x3191b6[_0x192c('0x1c')]=qs[_0x192c('0x1c')](_0x428f78['query'][_0x192c('0x1c')]);}_0x3191b6[_0x192c('0x33')]=qs['sort'](_0x428f78[_0x192c('0x2a')][_0x192c('0x34')]);_0x3191b6[_0x192c('0x35')]=qs[_0x192c('0x2b')](_[_0x192c('0x36')](_0x428f78['query'],_0x129d83[_0x192c('0x2b')]));if(_0x428f78[_0x192c('0x2a')][_0x192c('0x37')]){_0x3191b6['where']=_[_0x192c('0x38')](_0x3191b6[_0x192c('0x35')],{'$or':_[_0x192c('0x39')](_0x55e5d9,function(_0x419c28){if(_0x419c28[_0x192c('0x3a')][_0x192c('0x3b')]!==_0x192c('0x3c')){var _0x369e17={};_0x369e17[_0x419c28['field']]={'$like':'%'+_0x428f78[_0x192c('0x2a')][_0x192c('0x37')]+'%'};return _0x369e17;}})});}_0x3191b6=_[_0x192c('0x38')]({},_0x3191b6,_0x428f78[_0x192c('0x3d')]);var _0x41e3fc={'where':_0x3191b6['where']};return db[_0x192c('0x3e')]['count'](_0x41e3fc)[_0x192c('0x22')](function(_0x51696e){_0x44faf3['count']=_0x51696e;if(_0x428f78['query'][_0x192c('0x3f')]){_0x3191b6[_0x192c('0x40')]=[{'attributes':['id','name',_0x192c('0x41'),_0x192c('0x42')],'model':db[_0x192c('0x43')],'as':_0x192c('0x43')}];}return db[_0x192c('0x3e')][_0x192c('0x44')](_0x3191b6);})[_0x192c('0x22')](function(_0x26fb32){_0x44faf3[_0x192c('0x45')]=_0x26fb32;return _0x44faf3;})['then'](respondWithFilteredResult(_0x2ab2f6,_0x3191b6))[_0x192c('0x46')](handleError(_0x2ab2f6,null));};exports[_0x192c('0x47')]=function(_0x1d30f4,_0x3ceab6){var _0x58ae20={'raw':!![],'where':{'id':_0x1d30f4[_0x192c('0x48')]['id']}},_0x22a906={};_0x22a906[_0x192c('0x2d')]=_[_0x192c('0x29')](db[_0x192c('0x3e')][_0x192c('0x28')]);_0x22a906[_0x192c('0x2a')]=_[_0x192c('0x29')](_0x1d30f4[_0x192c('0x2a')]);_0x22a906[_0x192c('0x2b')]=_[_0x192c('0x2c')](_0x22a906[_0x192c('0x2d')],_0x22a906['query']);_0x58ae20['attributes']=_['intersection'](_0x22a906['model'],qs[_0x192c('0x2f')](_0x1d30f4[_0x192c('0x2a')][_0x192c('0x2f')]));_0x58ae20[_0x192c('0x2e')]=_0x58ae20['attributes'][_0x192c('0x30')]?_0x58ae20[_0x192c('0x2e')]:_0x22a906[_0x192c('0x2d')];if(_0x1d30f4['query'][_0x192c('0x3f')]){_0x58ae20['include']=[{'all':!![]}];}_0x58ae20=_[_0x192c('0x38')]({},_0x58ae20,_0x1d30f4[_0x192c('0x3d')]);return db['VoiceCallReport'][_0x192c('0x49')](_0x58ae20)[_0x192c('0x22')](handleEntityNotFound(_0x3ceab6,null))['then'](respondWithResult(_0x3ceab6,null))['catch'](handleError(_0x3ceab6,null));};exports['create']=function(_0x4ee008,_0x29873c){return db[_0x192c('0x3e')][_0x192c('0x4a')](_0x4ee008[_0x192c('0x4b')],{})['then'](respondWithResult(_0x29873c,0xc9))['catch'](handleError(_0x29873c,null));};exports[_0x192c('0x4c')]=function(_0x15512d,_0x2ac342){return db[_0x192c('0x3e')][_0x192c('0x49')]({'where':{'id':_0x15512d[_0x192c('0x48')]['id']}})[_0x192c('0x22')](handleEntityNotFound(_0x2ac342,null))['then'](removeEntity(_0x2ac342,null))['catch'](handleError(_0x2ac342,null));};exports[_0x192c('0x4d')]=function(_0x2d53bb,_0x33fc5e){return db['VoiceCallReport']['describe']()[_0x192c('0x22')](respondWithResult(_0x33fc5e,null))[_0x192c('0x46')](handleError(_0x33fc5e,null));};exports[_0x192c('0x21')]=function(_0x58c821,_0x1b21dd){if(_0x58c821[_0x192c('0x4b')][_0x192c('0x4e')]){delete _0x58c821[_0x192c('0x4b')][_0x192c('0x4e')];}return db[_0x192c('0x3e')]['find']({'where':{'uniqueid':_0x58c821[_0x192c('0x48')]['id'],'UserId':{'$or':[null,_0x58c821['user']['id']]}}})[_0x192c('0x22')](handleEntityNotFound(_0x1b21dd,null))[_0x192c('0x22')](saveUpdates(_0x58c821[_0x192c('0x4b')],null))[_0x192c('0x22')](respondWithResult(_0x1b21dd,null))[_0x192c('0x46')](handleError(_0x1b21dd,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index d610b63..83b9df5 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 _0x4214=['moment','bluebird','./voiceCallReport.attributes','exports','report_call','lodash','util','api'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0x4214,0x185));var _0x4421=function(_0x49fa01,_0x37f0bd){_0x49fa01=_0x49fa01-0x0;var _0x1362ca=_0x4214[_0x49fa01];return _0x1362ca;};'use strict';var _=require(_0x4421('0x0'));var util=require(_0x4421('0x1'));var logger=require('../../config/logger')(_0x4421('0x2'));var moment=require(_0x4421('0x3'));var BPromise=require(_0x4421('0x4'));var rp=require('request-promise');var attributes=require(_0x4421('0x5'));module[_0x4421('0x6')]=function(_0x174b16,_0x27dfcf){return _0x174b16['define']('VoiceCallReport',attributes,{'tableName':_0x4421('0x7'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc29f=['request-promise','./voiceCallReport.attributes','define','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x1b9b54,_0x947689){var _0x45df2b=function(_0x2cdc49){while(--_0x2cdc49){_0x1b9b54['push'](_0x1b9b54['shift']());}};_0x45df2b(++_0x947689);}(_0xc29f,0x1ec));var _0xfc29=function(_0x1fbd98,_0x4d1767){_0x1fbd98=_0x1fbd98-0x0;var _0x1bd1cd=_0xc29f[_0x1fbd98];return _0x1bd1cd;};'use strict';var _=require(_0xfc29('0x0'));var util=require(_0xfc29('0x1'));var logger=require(_0xfc29('0x2'))('api');var moment=require(_0xfc29('0x3'));var BPromise=require('bluebird');var rp=require(_0xfc29('0x4'));var attributes=require(_0xfc29('0x5'));module['exports']=function(_0xc30885,_0x352ec4){return _0xc30885[_0xfc29('0x6')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xfc29('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 83dd458..dee9fee 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 _0x2172=['message','result','GetVoiceCallReport','options','raw','where','limit','include','model','map','attributes','catch','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x14f5c3,_0x1e3047){var _0x2ea070=function(_0x1c8cd4){while(--_0x1c8cd4){_0x14f5c3['push'](_0x14f5c3['shift']());}};_0x2ea070(++_0x1e3047);}(_0x2172,0x1cd));var _0x2217=function(_0x1fcd5d,_0xdfd563){_0x1fcd5d=_0x1fcd5d-0x0;var _0x304e1c=_0x2172[_0x1fcd5d];return _0x304e1c;};'use strict';var _=require(_0x2217('0x0'));var util=require(_0x2217('0x1'));var moment=require('moment');var BPromise=require(_0x2217('0x2'));var rs=require(_0x2217('0x3'));var fs=require('fs');var Redis=require(_0x2217('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2217('0x5'));var logger=require(_0x2217('0x6'))(_0x2217('0x7'));var config=require('../../config/environment');var jayson=require(_0x2217('0x8'));var client=jayson[_0x2217('0x9')][_0x2217('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59740f,_0x1aab6d,_0x14f0f0){return new BPromise(function(_0x1aa6a9,_0x5738a9){return client['request'](_0x59740f,_0x14f0f0)[_0x2217('0xb')](function(_0xfaa43a){logger[_0x2217('0xc')](_0x2217('0xd'),_0x1aab6d,_0x2217('0xe'));logger[_0x2217('0xf')](_0x2217('0x10'),_0x1aab6d,_0x2217('0xe'),JSON[_0x2217('0x11')](_0xfaa43a));if(_0xfaa43a[_0x2217('0x12')]){if(_0xfaa43a[_0x2217('0x12')][_0x2217('0x13')]===0x1f4){logger[_0x2217('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x1aab6d,_0xfaa43a[_0x2217('0x12')][_0x2217('0x14')]);return _0x5738a9(_0xfaa43a[_0x2217('0x12')]['message']);}logger[_0x2217('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x1aab6d,_0xfaa43a[_0x2217('0x12')][_0x2217('0x14')]);return _0x1aa6a9(_0xfaa43a[_0x2217('0x12')][_0x2217('0x14')]);}else{logger[_0x2217('0xc')](_0x2217('0xd'),_0x1aab6d,'request\x20sent');_0x1aa6a9(_0xfaa43a[_0x2217('0x15')]['message']);}})['catch'](function(_0x23fb10){logger[_0x2217('0x12')](_0x2217('0xd'),_0x1aab6d,_0x23fb10);_0x5738a9(_0x23fb10);});});}exports[_0x2217('0x16')]=function(_0x12cd73){var _0x28c889=this;return new Promise(function(_0x50b777,_0x5dc21d){return db['VoiceCallReport']['findAll']({'raw':_0x12cd73[_0x2217('0x17')]?_0x12cd73[_0x2217('0x17')][_0x2217('0x18')]===undefined?!![]:![]:!![],'where':_0x12cd73['options']?_0x12cd73[_0x2217('0x17')][_0x2217('0x19')]||null:null,'attributes':_0x12cd73[_0x2217('0x17')]?_0x12cd73[_0x2217('0x17')]['attributes']||null:null,'limit':_0x12cd73[_0x2217('0x17')]?_0x12cd73[_0x2217('0x17')][_0x2217('0x1a')]||null:null,'include':_0x12cd73[_0x2217('0x17')]?_0x12cd73[_0x2217('0x17')]['include']?_['map'](_0x12cd73[_0x2217('0x17')][_0x2217('0x1b')],function(_0x1da242){return{'model':db[_0x1da242[_0x2217('0x1c')]],'as':_0x1da242['as'],'attributes':_0x1da242['attributes'],'include':_0x1da242['include']?_[_0x2217('0x1d')](_0x1da242[_0x2217('0x1b')],function(_0x107cd7){return{'model':db[_0x107cd7[_0x2217('0x1c')]],'as':_0x107cd7['as'],'attributes':_0x107cd7[_0x2217('0x1e')],'include':_0x107cd7[_0x2217('0x1b')]?_[_0x2217('0x1d')](_0x107cd7[_0x2217('0x1b')],function(_0x333cb3){return{'model':db[_0x333cb3[_0x2217('0x1c')]],'as':_0x333cb3['as'],'attributes':_0x333cb3[_0x2217('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2217('0xb')](function(_0x813224){logger[_0x2217('0xc')]('GetVoiceCallReport',_0x12cd73);logger[_0x2217('0xf')]('GetVoiceCallReport',_0x12cd73,JSON['stringify'](_0x813224));_0x50b777(_0x813224);})[_0x2217('0x1f')](function(_0x723b5b){logger[_0x2217('0x12')]('GetVoiceCallReport',_0x723b5b[_0x2217('0x14')],_0x12cd73);_0x5dc21d(_0x28c889['error'](0x1f4,_0x723b5b[_0x2217('0x14')]));});});};exports[_0x2217('0x20')]=function(_0x10986d){var _0x185e20=this;return new Promise(function(_0x2dfe21,_0x2f7166){return db[_0x2217('0x21')][_0x2217('0x22')](_0x10986d[_0x2217('0x23')],{'raw':_0x10986d[_0x2217('0x17')]?_0x10986d[_0x2217('0x17')][_0x2217('0x18')]===undefined?!![]:![]:!![]})[_0x2217('0xb')](function(_0x522fca){logger[_0x2217('0xc')](_0x2217('0x20'),_0x10986d);logger[_0x2217('0xf')](_0x2217('0x20'),_0x10986d,JSON[_0x2217('0x11')](_0x522fca));_0x2dfe21(_0x522fca);})[_0x2217('0x1f')](function(_0x4318cb){logger[_0x2217('0x12')](_0x2217('0x20'),_0x4318cb[_0x2217('0x14')],_0x10986d);_0x2f7166(_0x185e20[_0x2217('0x12')](0x1f4,_0x4318cb[_0x2217('0x14')]));});});};exports[_0x2217('0x24')]=function(_0x241426){var _0x1fd95d=this;return new Promise(function(_0x1ba3be,_0x16856f){return db[_0x2217('0x21')]['update'](_0x241426[_0x2217('0x23')],{'raw':_0x241426[_0x2217('0x17')]?_0x241426['options'][_0x2217('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x241426[_0x2217('0x17')]?_0x241426[_0x2217('0x17')][_0x2217('0x19')]||null:null,'attributes':_0x241426[_0x2217('0x17')]?_0x241426['options'][_0x2217('0x1e')]||null:null,'limit':_0x241426[_0x2217('0x17')]?_0x241426[_0x2217('0x17')][_0x2217('0x1a')]||null:null})['then'](function(_0x533e98){logger[_0x2217('0xc')]('UpdateVoiceCallReport',_0x241426);logger[_0x2217('0xf')](_0x2217('0x24'),_0x241426,JSON[_0x2217('0x11')](_0x533e98));_0x1ba3be(_0x533e98);})[_0x2217('0x1f')](function(_0x367132){logger[_0x2217('0x12')](_0x2217('0x24'),_0x367132[_0x2217('0x14')],_0x241426);_0x16856f(_0x1fd95d[_0x2217('0x12')](0x1f4,_0x367132[_0x2217('0x14')]));});});}; \ No newline at end of file +var _0x6f6a=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceCallReport','findAll','options','raw','attributes','include','model','map','stringify','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','VoiceCallReport','update','limit','then','lodash'];(function(_0x534d12,_0x16be86){var _0x5762d7=function(_0x370f4b){while(--_0x370f4b){_0x534d12['push'](_0x534d12['shift']());}};_0x5762d7(++_0x16be86);}(_0x6f6a,0x185));var _0xa6f6=function(_0x20443e,_0x5e751f){_0x20443e=_0x20443e-0x0;var _0x32f9a2=_0x6f6a[_0x20443e];return _0x32f9a2;};'use strict';var _=require(_0xa6f6('0x0'));var util=require(_0xa6f6('0x1'));var moment=require('moment');var BPromise=require(_0xa6f6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f6('0x3'));var db=require(_0xa6f6('0x4'))['db'];var utils=require(_0xa6f6('0x5'));var logger=require(_0xa6f6('0x6'))('rpc');var config=require(_0xa6f6('0x7'));var jayson=require(_0xa6f6('0x8'));var client=jayson[_0xa6f6('0x9')][_0xa6f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfc9bde,_0x297607,_0x35836d){return new BPromise(function(_0x1c3b57,_0x14f9ae){return client[_0xa6f6('0xb')](_0xfc9bde,_0x35836d)['then'](function(_0x3f7483){logger[_0xa6f6('0xc')](_0xa6f6('0xd'),_0x297607,'request\x20sent');logger[_0xa6f6('0xe')](_0xa6f6('0xf'),_0x297607,_0xa6f6('0x10'),JSON['stringify'](_0x3f7483));if(_0x3f7483[_0xa6f6('0x11')]){if(_0x3f7483['error'][_0xa6f6('0x12')]===0x1f4){logger[_0xa6f6('0x11')](_0xa6f6('0xd'),_0x297607,_0x3f7483[_0xa6f6('0x11')]['message']);return _0x14f9ae(_0x3f7483[_0xa6f6('0x11')][_0xa6f6('0x13')]);}logger[_0xa6f6('0x11')](_0xa6f6('0xd'),_0x297607,_0x3f7483['error']['message']);return _0x1c3b57(_0x3f7483[_0xa6f6('0x11')]['message']);}else{logger['info'](_0xa6f6('0xd'),_0x297607,_0xa6f6('0x10'));_0x1c3b57(_0x3f7483[_0xa6f6('0x14')][_0xa6f6('0x13')]);}})[_0xa6f6('0x15')](function(_0x2c9c6e){logger[_0xa6f6('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x297607,_0x2c9c6e);_0x14f9ae(_0x2c9c6e);});});}exports[_0xa6f6('0x16')]=function(_0x1e5752){var _0x572140=this;return new Promise(function(_0x314eb0,_0x368417){return db['VoiceCallReport'][_0xa6f6('0x17')]({'raw':_0x1e5752[_0xa6f6('0x18')]?_0x1e5752['options'][_0xa6f6('0x19')]===undefined?!![]:![]:!![],'where':_0x1e5752[_0xa6f6('0x18')]?_0x1e5752[_0xa6f6('0x18')]['where']||null:null,'attributes':_0x1e5752[_0xa6f6('0x18')]?_0x1e5752[_0xa6f6('0x18')][_0xa6f6('0x1a')]||null:null,'limit':_0x1e5752[_0xa6f6('0x18')]?_0x1e5752[_0xa6f6('0x18')]['limit']||null:null,'include':_0x1e5752[_0xa6f6('0x18')]?_0x1e5752[_0xa6f6('0x18')][_0xa6f6('0x1b')]?_['map'](_0x1e5752[_0xa6f6('0x18')][_0xa6f6('0x1b')],function(_0x4960ea){return{'model':db[_0x4960ea[_0xa6f6('0x1c')]],'as':_0x4960ea['as'],'attributes':_0x4960ea[_0xa6f6('0x1a')],'include':_0x4960ea[_0xa6f6('0x1b')]?_[_0xa6f6('0x1d')](_0x4960ea[_0xa6f6('0x1b')],function(_0x52582d){return{'model':db[_0x52582d[_0xa6f6('0x1c')]],'as':_0x52582d['as'],'attributes':_0x52582d[_0xa6f6('0x1a')],'include':_0x52582d[_0xa6f6('0x1b')]?_[_0xa6f6('0x1d')](_0x52582d[_0xa6f6('0x1b')],function(_0x4592f2){return{'model':db[_0x4592f2[_0xa6f6('0x1c')]],'as':_0x4592f2['as'],'attributes':_0x4592f2[_0xa6f6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa182e5){logger['info'](_0xa6f6('0x16'),_0x1e5752);logger[_0xa6f6('0xe')]('GetVoiceCallReport',_0x1e5752,JSON[_0xa6f6('0x1e')](_0xa182e5));_0x314eb0(_0xa182e5);})['catch'](function(_0x201d0d){logger[_0xa6f6('0x11')]('GetVoiceCallReport',_0x201d0d[_0xa6f6('0x13')],_0x1e5752);_0x368417(_0x572140[_0xa6f6('0x11')](0x1f4,_0x201d0d['message']));});});};exports['CreateVoiceCallReport']=function(_0x5a8974){var _0x1f5b6c=this;return new Promise(function(_0xbf5ac2,_0x55071c){return db['VoiceCallReport'][_0xa6f6('0x1f')](_0x5a8974[_0xa6f6('0x20')],{'raw':_0x5a8974['options']?_0x5a8974['options'][_0xa6f6('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3ed4ac){logger['info'](_0xa6f6('0x21'),_0x5a8974);logger[_0xa6f6('0xe')](_0xa6f6('0x21'),_0x5a8974,JSON['stringify'](_0x3ed4ac));_0xbf5ac2(_0x3ed4ac);})[_0xa6f6('0x15')](function(_0x155018){logger['error'](_0xa6f6('0x21'),_0x155018[_0xa6f6('0x13')],_0x5a8974);_0x55071c(_0x1f5b6c['error'](0x1f4,_0x155018[_0xa6f6('0x13')]));});});};exports[_0xa6f6('0x22')]=function(_0x4479d1){var _0x5288ad=this;return new Promise(function(_0x427ec5,_0x36a675){return db[_0xa6f6('0x23')][_0xa6f6('0x24')](_0x4479d1['body'],{'raw':_0x4479d1[_0xa6f6('0x18')]?_0x4479d1[_0xa6f6('0x18')][_0xa6f6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4479d1[_0xa6f6('0x18')]?_0x4479d1[_0xa6f6('0x18')]['where']||null:null,'attributes':_0x4479d1[_0xa6f6('0x18')]?_0x4479d1['options'][_0xa6f6('0x1a')]||null:null,'limit':_0x4479d1[_0xa6f6('0x18')]?_0x4479d1[_0xa6f6('0x18')][_0xa6f6('0x25')]||null:null})[_0xa6f6('0x26')](function(_0x4729fa){logger[_0xa6f6('0xc')](_0xa6f6('0x22'),_0x4479d1);logger[_0xa6f6('0xe')](_0xa6f6('0x22'),_0x4479d1,JSON[_0xa6f6('0x1e')](_0x4729fa));_0x427ec5(_0x4729fa);})[_0xa6f6('0x15')](function(_0xb41e3b){logger['error'](_0xa6f6('0x22'),_0xb41e3b[_0xa6f6('0x13')],_0x4479d1);_0x36a675(_0x5288ad['error'](0x1f4,_0xb41e3b[_0xa6f6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1f9d804..c18db34 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 _0x655e=['isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get'];(function(_0x39af4f,_0x3d3355){var _0x185b34=function(_0x1f28ae){while(--_0x1f28ae){_0x39af4f['push'](_0x39af4f['shift']());}};_0x185b34(++_0x3d3355);}(_0x655e,0x14e));var _0xe655=function(_0x9fa43a,_0x1e9d23){_0x9fa43a=_0x9fa43a-0x0;var _0x17d7ee=_0x655e[_0x9fa43a];return _0x17d7ee;};'use strict';var multer=require(_0xe655('0x0'));var util=require(_0xe655('0x1'));var path=require('path');var timeout=require(_0xe655('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe655('0x3'));var interaction=require(_0xe655('0x4'));var config=require(_0xe655('0x5'));var controller=require(_0xe655('0x6'));router[_0xe655('0x7')]('/',auth[_0xe655('0x8')](),controller[_0xe655('0x9')]);router[_0xe655('0x7')](_0xe655('0xa'),auth[_0xe655('0x8')](),controller[_0xe655('0xb')]);router[_0xe655('0xc')]('/',auth[_0xe655('0x8')](),controller[_0xe655('0xd')]);router[_0xe655('0xe')](_0xe655('0xa'),auth[_0xe655('0x8')](),controller[_0xe655('0xf')]);router[_0xe655('0x10')]('/:id',auth[_0xe655('0x8')](),controller['destroy']);module[_0xe655('0x11')]=router; \ No newline at end of file +var _0x70d7=['/:id','show','post','create','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index'];(function(_0x3900b3,_0x309482){var _0x4e601a=function(_0x9599b7){while(--_0x9599b7){_0x3900b3['push'](_0x3900b3['shift']());}};_0x4e601a(++_0x309482);}(_0x70d7,0xd4));var _0x770d=function(_0x58d217,_0x5acb1a){_0x58d217=_0x58d217-0x0;var _0x2774ac=_0x70d7[_0x58d217];return _0x2774ac;};'use strict';var multer=require(_0x770d('0x0'));var util=require(_0x770d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x770d('0x2'));var router=express[_0x770d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x770d('0x4'));var config=require('../../config/environment');var controller=require(_0x770d('0x5'));router[_0x770d('0x6')]('/',auth[_0x770d('0x7')](),controller[_0x770d('0x8')]);router[_0x770d('0x6')](_0x770d('0x9'),auth['isAuthenticated'](),controller[_0x770d('0xa')]);router[_0x770d('0xb')]('/',auth[_0x770d('0x7')](),controller[_0x770d('0xc')]);router['put'](_0x770d('0x9'),auth[_0x770d('0x7')](),controller[_0x770d('0xd')]);router[_0x770d('0xe')](_0x770d('0x9'),auth['isAuthenticated'](),controller[_0x770d('0xf')]);module[_0x770d('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 732919e..bf0ab95 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 _0x9d04=['join','getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue','options'];(function(_0x1f94bb,_0xb09159){var _0x39a8db=function(_0x4dfa82){while(--_0x4dfa82){_0x1f94bb['push'](_0x1f94bb['shift']());}};_0x39a8db(++_0xb09159);}(_0x9d04,0xaf));var _0x49d0=function(_0x50b1c5,_0x1cf2a9){_0x50b1c5=_0x50b1c5-0x0;var _0x344f99=_0x9d04[_0x50b1c5];return _0x344f99;};'use strict';var Sequelize=require('sequelize');module[_0x49d0('0x0')]={'name':{'type':Sequelize[_0x49d0('0x1')]},'prefix':{'type':Sequelize[_0x49d0('0x1')],'unique':_0x49d0('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x49d0('0x1')],'set':function(_0x461fd1){this[_0x49d0('0x3')](_0x49d0('0x4'),_0x461fd1?_0x461fd1[_0x49d0('0x5')](''):[]);},'get':function(){return this[_0x49d0('0x6')](_0x49d0('0x4'))?this['getDataValue'](_0x49d0('0x4'))[_0x49d0('0x7')](''):[];}},'auth':{'type':Sequelize[_0x49d0('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x49d0('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x49d0('0x1')]},'description':{'type':Sequelize[_0x49d0('0x1')]}}; \ No newline at end of file +var _0xa5bf=['options','join','getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa5bf,0x113));var _0xfa5b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xa5bf[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require('sequelize');module[_0xfa5b('0x0')]={'name':{'type':Sequelize[_0xfa5b('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xfa5b('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xfa5b('0x1')],'set':function(_0xb175e4){this[_0xfa5b('0x3')](_0xfa5b('0x4'),_0xb175e4?_0xb175e4[_0xfa5b('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xfa5b('0x4'))?this[_0xfa5b('0x6')](_0xfa5b('0x4'))[_0xfa5b('0x7')](''):[];}},'auth':{'type':Sequelize[_0xfa5b('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xfa5b('0x1')]},'record':{'type':Sequelize[_0xfa5b('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xfa5b('0x1')]},'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 9885d88..508e20c 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 _0x9351=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','VoiceChanSpy','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','includeAll','findAll','catch','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x169d1b,_0x40c8a2){var _0x41ac94=function(_0x3df465){while(--_0x3df465){_0x169d1b['push'](_0x169d1b['shift']());}};_0x41ac94(++_0x40c8a2);}(_0x9351,0x98));var _0x1935=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9351[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1935('0x0'));var zipdir=require(_0x1935('0x1'));var jsonpatch=require(_0x1935('0x2'));var rp=require(_0x1935('0x3'));var moment=require('moment');var BPromise=require(_0x1935('0x4'));var Mustache=require(_0x1935('0x5'));var util=require(_0x1935('0x6'));var path=require(_0x1935('0x7'));var sox=require(_0x1935('0x8'));var csv=require(_0x1935('0x9'));var ejs=require(_0x1935('0xa'));var fs=require('fs');var _=require(_0x1935('0xb'));var squel=require(_0x1935('0xc'));var crypto=require(_0x1935('0xd'));var jsforce=require(_0x1935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1935('0x9'));var querystring=require('querystring');var Papa=require(_0x1935('0xf'));var authService=require(_0x1935('0x10'));var hardwareService=require('../../config/license/hardware');var Redis=require(_0x1935('0x11'));var qs=require(_0x1935('0x12'));var logger=require(_0x1935('0x13'))(_0x1935('0x14'));var utils=require(_0x1935('0x15'));var config=require(_0x1935('0x16'));var db=require(_0x1935('0x17'))['db'];function respondWithStatusCode(_0x43f55a,_0x308428){_0x308428=_0x308428||0xcc;return function(_0x3fcaaa){if(_0x3fcaaa){return _0x43f55a[_0x1935('0x18')](_0x308428);}return _0x43f55a[_0x1935('0x19')](_0x308428)[_0x1935('0x1a')]();};}function respondWithResult(_0x12a552,_0x42473d){_0x42473d=_0x42473d||0xc8;return function(_0x4f9096){if(_0x4f9096){return _0x12a552[_0x1935('0x19')](_0x42473d)[_0x1935('0x1b')](_0x4f9096);}};}function respondWithFilteredResult(_0x2ad3a6,_0xcde811){return function(_0x2b4bbd){if(_0x2b4bbd){var _0x3acb4f=_0x2b4bbd[_0x1935('0x1c')],_0x5ac326=_0xcde811[_0x1935('0x1d')],_0x146252=_0xcde811[_0x1935('0x1d')]+_0xcde811[_0x1935('0x1e')],_0x7788f9;if(_0x146252>=_0x3acb4f){_0x146252=_0x3acb4f;_0x7788f9=0xc8;}else{_0x7788f9=0xce;}_0x2ad3a6[_0x1935('0x19')](_0x7788f9);return _0x2ad3a6[_0x1935('0x1f')](_0x1935('0x20'),_0x5ac326+'-'+_0x146252+'/'+_0x3acb4f)['json'](_0x2b4bbd);}return null;};}function patchUpdates(_0x55ca2e){return function(_0x1e0a80){try{jsonpatch[_0x1935('0x21')](_0x1e0a80,_0x55ca2e,!![]);}catch(_0xf2ca88){return BPromise[_0x1935('0x22')](_0xf2ca88);}return _0x1e0a80[_0x1935('0x23')]();};}function saveUpdates(_0x2145f9,_0x3bc513){return function(_0x1ad731){if(_0x1ad731){return _0x1ad731[_0x1935('0x24')](_0x2145f9)['then'](function(_0x17e915){return _0x17e915;});}return null;};}function removeEntity(_0x532414,_0x31addf){return function(_0x5eebcf){if(_0x5eebcf){return _0x5eebcf[_0x1935('0x25')]()[_0x1935('0x26')](function(){var _0x3aee1c=_0x5eebcf[_0x1935('0x27')]({'plain':!![]});var _0x5579b8='ChanSpies';return db[_0x1935('0x28')]['destroy']({'where':{'type':_0x5579b8,'resourceId':_0x3aee1c['id']}})[_0x1935('0x26')](function(){return _0x5eebcf;});})['then'](function(){_0x532414[_0x1935('0x19')](0xcc)[_0x1935('0x1a')]();});}};}function handleEntityNotFound(_0xaeb999,_0x3e9637){return function(_0x5fdc6e){if(!_0x5fdc6e){_0xaeb999[_0x1935('0x18')](0x194);}return _0x5fdc6e;};}function handleError(_0x55a21a,_0x1fee72){_0x1fee72=_0x1fee72||0x1f4;return function(_0x3b9cfb){logger['error'](_0x3b9cfb[_0x1935('0x29')]);if(_0x3b9cfb[_0x1935('0x2a')]){delete _0x3b9cfb[_0x1935('0x2a')];}_0x55a21a['status'](_0x1fee72)[_0x1935('0x2b')](_0x3b9cfb);};}exports[_0x1935('0x2c')]=function(_0x41dd0c,_0x50c068){var _0x5eb9d9={},_0x570272={},_0xdfbd00={'count':0x0,'rows':[]};var _0x349360=db[_0x1935('0x2d')][_0x1935('0x2e')];_0x570272[_0x1935('0x2f')]=_[_0x1935('0x30')](_0x349360);_0x570272[_0x1935('0x31')]=_[_0x1935('0x30')](_0x41dd0c['query']);_0x570272[_0x1935('0x32')]=_[_0x1935('0x33')](_0x570272[_0x1935('0x2f')],_0x570272['query']);_0x5eb9d9[_0x1935('0x34')]=_[_0x1935('0x33')](_0x570272[_0x1935('0x2f')],qs['fields'](_0x41dd0c[_0x1935('0x31')][_0x1935('0x35')]));_0x5eb9d9['attributes']=_0x5eb9d9[_0x1935('0x34')][_0x1935('0x36')]?_0x5eb9d9[_0x1935('0x34')]:_0x570272[_0x1935('0x2f')];if(!_0x41dd0c[_0x1935('0x31')]['hasOwnProperty']('nolimit')){_0x5eb9d9[_0x1935('0x1e')]=qs[_0x1935('0x1e')](_0x41dd0c[_0x1935('0x31')][_0x1935('0x1e')]);_0x5eb9d9['offset']=qs['offset'](_0x41dd0c[_0x1935('0x31')][_0x1935('0x1d')]);}_0x5eb9d9[_0x1935('0x37')]=qs['sort'](_0x41dd0c[_0x1935('0x31')][_0x1935('0x38')]);_0x5eb9d9[_0x1935('0x39')]=qs['filters'](_[_0x1935('0x3a')](_0x41dd0c[_0x1935('0x31')],_0x570272[_0x1935('0x32')]));if(_0x41dd0c[_0x1935('0x31')][_0x1935('0x3b')]){_0x5eb9d9[_0x1935('0x39')]=_[_0x1935('0x3c')](_0x5eb9d9[_0x1935('0x39')],{'$or':_[_0x1935('0x3d')](_0x349360,function(_0x5c27b3){if(_0x5c27b3['type'][_0x1935('0x3e')]!==_0x1935('0x3f')){var _0x2127a2={};_0x2127a2[_0x5c27b3[_0x1935('0x40')]]={'$like':'%'+_0x41dd0c[_0x1935('0x31')][_0x1935('0x3b')]+'%'};return _0x2127a2;}})});}_0x5eb9d9=_[_0x1935('0x3c')]({},_0x5eb9d9,_0x41dd0c['options']);var _0x13b15b={'where':_0x5eb9d9[_0x1935('0x39')]};return db[_0x1935('0x2d')]['count'](_0x13b15b)[_0x1935('0x26')](function(_0x48edd2){_0xdfbd00[_0x1935('0x1c')]=_0x48edd2;if(_0x41dd0c[_0x1935('0x31')][_0x1935('0x41')]){_0x5eb9d9['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x1935('0x42')](_0x5eb9d9);})[_0x1935('0x26')](function(_0x156844){_0xdfbd00['rows']=_0x156844;return _0xdfbd00;})['then'](respondWithFilteredResult(_0x50c068,_0x5eb9d9))[_0x1935('0x43')](handleError(_0x50c068,null));};exports['show']=function(_0x1a39ac,_0x3832f3){var _0x3242f9={'raw':![],'where':{'id':_0x1a39ac[_0x1935('0x44')]['id']}},_0x127851={};_0x127851[_0x1935('0x2f')]=_[_0x1935('0x30')](db[_0x1935('0x2d')]['rawAttributes']);_0x127851[_0x1935('0x31')]=_[_0x1935('0x30')](_0x1a39ac[_0x1935('0x31')]);_0x127851[_0x1935('0x32')]=_[_0x1935('0x33')](_0x127851['model'],_0x127851['query']);_0x3242f9['attributes']=_[_0x1935('0x33')](_0x127851['model'],qs[_0x1935('0x35')](_0x1a39ac[_0x1935('0x31')][_0x1935('0x35')]));_0x3242f9[_0x1935('0x34')]=_0x3242f9['attributes']['length']?_0x3242f9[_0x1935('0x34')]:_0x127851[_0x1935('0x2f')];if(_0x1a39ac[_0x1935('0x31')][_0x1935('0x41')]){_0x3242f9[_0x1935('0x45')]=[{'all':!![]}];}_0x3242f9=_[_0x1935('0x3c')]({},_0x3242f9,_0x1a39ac[_0x1935('0x46')]);return db[_0x1935('0x2d')][_0x1935('0x47')](_0x3242f9)['then'](handleEntityNotFound(_0x3832f3,null))[_0x1935('0x26')](respondWithResult(_0x3832f3,null))['catch'](handleError(_0x3832f3,null));};exports[_0x1935('0x48')]=function(_0x56fb8a,_0x4089a0){return db['VoiceChanSpy'][_0x1935('0x48')](_0x56fb8a[_0x1935('0x49')],{})['then'](function(_0x241ea9){var _0x5edb43=_0x56fb8a[_0x1935('0x4a')][_0x1935('0x27')]({'plain':!![]});if(!_0x5edb43)throw new Error(_0x1935('0x4b'));if(_0x5edb43[_0x1935('0x4c')]===_0x1935('0x4a')){var _0x59b5ac=_0x241ea9['get']({'plain':!![]});var _0x31150d='ChanSpies';return db['UserProfileSection'][_0x1935('0x47')]({'where':{'name':_0x31150d,'userProfileId':_0x5edb43['userProfileId']},'raw':!![]})['then'](function(_0x575b2b){if(_0x575b2b&&_0x575b2b[_0x1935('0x4d')]===0x0){return db[_0x1935('0x28')][_0x1935('0x48')]({'name':_0x59b5ac[_0x1935('0x2a')],'resourceId':_0x59b5ac['id'],'type':_0x575b2b[_0x1935('0x2a')],'sectionId':_0x575b2b['id']},{})[_0x1935('0x26')](function(){return _0x241ea9;});}else{return _0x241ea9;}})[_0x1935('0x43')](function(_0x5257c6){logger[_0x1935('0x4e')](_0x1935('0x4f'),_0x5257c6);throw _0x5257c6;});}return _0x241ea9;})[_0x1935('0x26')](respondWithResult(_0x4089a0,0xc9))['catch'](handleError(_0x4089a0,null));};exports[_0x1935('0x24')]=function(_0x2a4594,_0xf680db){if(_0x2a4594['body']['id']){delete _0x2a4594[_0x1935('0x49')]['id'];}return db[_0x1935('0x2d')][_0x1935('0x47')]({'where':{'id':_0x2a4594[_0x1935('0x44')]['id']}})['then'](handleEntityNotFound(_0xf680db,null))[_0x1935('0x26')](saveUpdates(_0x2a4594[_0x1935('0x49')],null))['then'](respondWithResult(_0xf680db,null))[_0x1935('0x43')](handleError(_0xf680db,null));};exports[_0x1935('0x25')]=function(_0x832f16,_0x518eb5){return db[_0x1935('0x2d')][_0x1935('0x47')]({'where':{'id':_0x832f16[_0x1935('0x44')]['id']}})[_0x1935('0x26')](handleEntityNotFound(_0x518eb5,null))[_0x1935('0x26')](removeEntity(_0x518eb5,null))[_0x1935('0x43')](handleError(_0x518eb5,null));}; \ No newline at end of file +var _0x46cb=['offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','VoiceChanSpy','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count'];(function(_0x4f86e3,_0x484bf5){var _0x57bfdc=function(_0x485513){while(--_0x485513){_0x4f86e3['push'](_0x4f86e3['shift']());}};_0x57bfdc(++_0x484bf5);}(_0x46cb,0xd6));var _0xb46c=function(_0x54a9e3,_0x4a3813){_0x54a9e3=_0x54a9e3-0x0;var _0x247cce=_0x46cb[_0x54a9e3];return _0x247cce;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb46c('0x0'));var jsonpatch=require(_0xb46c('0x1'));var rp=require(_0xb46c('0x2'));var moment=require(_0xb46c('0x3'));var BPromise=require(_0xb46c('0x4'));var Mustache=require(_0xb46c('0x5'));var util=require(_0xb46c('0x6'));var path=require(_0xb46c('0x7'));var sox=require(_0xb46c('0x8'));var csv=require(_0xb46c('0x9'));var ejs=require(_0xb46c('0xa'));var fs=require('fs');var _=require(_0xb46c('0xb'));var squel=require(_0xb46c('0xc'));var crypto=require(_0xb46c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb46c('0xe'));var toCsv=require(_0xb46c('0x9'));var querystring=require(_0xb46c('0xf'));var Papa=require(_0xb46c('0x10'));var authService=require(_0xb46c('0x11'));var hardwareService=require('../../config/license/hardware');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xb46c('0x12'))(_0xb46c('0x13'));var utils=require(_0xb46c('0x14'));var config=require(_0xb46c('0x15'));var db=require(_0xb46c('0x16'))['db'];function respondWithStatusCode(_0x22bb44,_0x51efb1){_0x51efb1=_0x51efb1||0xcc;return function(_0xabb820){if(_0xabb820){return _0x22bb44['sendStatus'](_0x51efb1);}return _0x22bb44[_0xb46c('0x17')](_0x51efb1)[_0xb46c('0x18')]();};}function respondWithResult(_0x5603b1,_0x87cd7f){_0x87cd7f=_0x87cd7f||0xc8;return function(_0x59c2db){if(_0x59c2db){return _0x5603b1[_0xb46c('0x17')](_0x87cd7f)['json'](_0x59c2db);}};}function respondWithFilteredResult(_0xbed789,_0x28f93e){return function(_0x4ee554){if(_0x4ee554){var _0x3455d7=_0x4ee554[_0xb46c('0x19')],_0x3d0381=_0x28f93e[_0xb46c('0x1a')],_0x4134d4=_0x28f93e[_0xb46c('0x1a')]+_0x28f93e[_0xb46c('0x1b')],_0x41d8ab;if(_0x4134d4>=_0x3455d7){_0x4134d4=_0x3455d7;_0x41d8ab=0xc8;}else{_0x41d8ab=0xce;}_0xbed789['status'](_0x41d8ab);return _0xbed789[_0xb46c('0x1c')](_0xb46c('0x1d'),_0x3d0381+'-'+_0x4134d4+'/'+_0x3455d7)[_0xb46c('0x1e')](_0x4ee554);}return null;};}function patchUpdates(_0x236d7b){return function(_0x5c1220){try{jsonpatch[_0xb46c('0x1f')](_0x5c1220,_0x236d7b,!![]);}catch(_0x5e54c1){return BPromise[_0xb46c('0x20')](_0x5e54c1);}return _0x5c1220[_0xb46c('0x21')]();};}function saveUpdates(_0x15ad0e,_0x4b9cff){return function(_0x926c7c){if(_0x926c7c){return _0x926c7c[_0xb46c('0x22')](_0x15ad0e)['then'](function(_0x5bc8f8){return _0x5bc8f8;});}return null;};}function removeEntity(_0x2f79a4,_0x4d0391){return function(_0x56125d){if(_0x56125d){return _0x56125d[_0xb46c('0x23')]()[_0xb46c('0x24')](function(){var _0x400ba0=_0x56125d[_0xb46c('0x25')]({'plain':!![]});var _0x493054='ChanSpies';return db[_0xb46c('0x26')][_0xb46c('0x23')]({'where':{'type':_0x493054,'resourceId':_0x400ba0['id']}})[_0xb46c('0x24')](function(){return _0x56125d;});})[_0xb46c('0x24')](function(){_0x2f79a4[_0xb46c('0x17')](0xcc)[_0xb46c('0x18')]();});}};}function handleEntityNotFound(_0x204c10,_0x1530c4){return function(_0x4e7403){if(!_0x4e7403){_0x204c10[_0xb46c('0x27')](0x194);}return _0x4e7403;};}function handleError(_0x9cddfc,_0x1fb1ac){_0x1fb1ac=_0x1fb1ac||0x1f4;return function(_0x11821a){logger[_0xb46c('0x28')](_0x11821a[_0xb46c('0x29')]);if(_0x11821a[_0xb46c('0x2a')]){delete _0x11821a[_0xb46c('0x2a')];}_0x9cddfc['status'](_0x1fb1ac)['send'](_0x11821a);};}exports['index']=function(_0x3e276b,_0x648b3b){var _0x596778={},_0x4270d2={},_0x497ad7={'count':0x0,'rows':[]};var _0x5350ea=db[_0xb46c('0x2b')][_0xb46c('0x2c')];_0x4270d2['model']=_[_0xb46c('0x2d')](_0x5350ea);_0x4270d2[_0xb46c('0x2e')]=_['keys'](_0x3e276b[_0xb46c('0x2e')]);_0x4270d2['filters']=_[_0xb46c('0x2f')](_0x4270d2[_0xb46c('0x30')],_0x4270d2[_0xb46c('0x2e')]);_0x596778['attributes']=_['intersection'](_0x4270d2[_0xb46c('0x30')],qs[_0xb46c('0x31')](_0x3e276b[_0xb46c('0x2e')]['fields']));_0x596778[_0xb46c('0x32')]=_0x596778[_0xb46c('0x32')][_0xb46c('0x33')]?_0x596778[_0xb46c('0x32')]:_0x4270d2[_0xb46c('0x30')];if(!_0x3e276b[_0xb46c('0x2e')][_0xb46c('0x34')](_0xb46c('0x35'))){_0x596778['limit']=qs[_0xb46c('0x1b')](_0x3e276b[_0xb46c('0x2e')][_0xb46c('0x1b')]);_0x596778[_0xb46c('0x1a')]=qs[_0xb46c('0x1a')](_0x3e276b[_0xb46c('0x2e')][_0xb46c('0x1a')]);}_0x596778['order']=qs[_0xb46c('0x36')](_0x3e276b[_0xb46c('0x2e')][_0xb46c('0x36')]);_0x596778['where']=qs[_0xb46c('0x37')](_['pick'](_0x3e276b[_0xb46c('0x2e')],_0x4270d2[_0xb46c('0x37')]));if(_0x3e276b[_0xb46c('0x2e')][_0xb46c('0x38')]){_0x596778[_0xb46c('0x39')]=_[_0xb46c('0x3a')](_0x596778[_0xb46c('0x39')],{'$or':_[_0xb46c('0x3b')](_0x5350ea,function(_0xd5a868){if(_0xd5a868[_0xb46c('0x3c')]['key']!==_0xb46c('0x3d')){var _0x29f9d9={};_0x29f9d9[_0xd5a868[_0xb46c('0x3e')]]={'$like':'%'+_0x3e276b['query'][_0xb46c('0x38')]+'%'};return _0x29f9d9;}})});}_0x596778=_[_0xb46c('0x3a')]({},_0x596778,_0x3e276b[_0xb46c('0x3f')]);var _0x40403f={'where':_0x596778['where']};return db[_0xb46c('0x2b')]['count'](_0x40403f)[_0xb46c('0x24')](function(_0xd8602c){_0x497ad7[_0xb46c('0x19')]=_0xd8602c;if(_0x3e276b[_0xb46c('0x2e')][_0xb46c('0x40')]){_0x596778[_0xb46c('0x41')]=[{'all':!![]}];}return db[_0xb46c('0x2b')]['findAll'](_0x596778);})[_0xb46c('0x24')](function(_0x119482){_0x497ad7[_0xb46c('0x42')]=_0x119482;return _0x497ad7;})[_0xb46c('0x24')](respondWithFilteredResult(_0x648b3b,_0x596778))[_0xb46c('0x43')](handleError(_0x648b3b,null));};exports[_0xb46c('0x44')]=function(_0x3756b8,_0x3ac99e){var _0xaae99a={'raw':![],'where':{'id':_0x3756b8[_0xb46c('0x45')]['id']}},_0x19bc27={};_0x19bc27[_0xb46c('0x30')]=_['keys'](db['VoiceChanSpy'][_0xb46c('0x2c')]);_0x19bc27[_0xb46c('0x2e')]=_[_0xb46c('0x2d')](_0x3756b8[_0xb46c('0x2e')]);_0x19bc27['filters']=_[_0xb46c('0x2f')](_0x19bc27[_0xb46c('0x30')],_0x19bc27[_0xb46c('0x2e')]);_0xaae99a[_0xb46c('0x32')]=_[_0xb46c('0x2f')](_0x19bc27['model'],qs[_0xb46c('0x31')](_0x3756b8[_0xb46c('0x2e')]['fields']));_0xaae99a[_0xb46c('0x32')]=_0xaae99a[_0xb46c('0x32')][_0xb46c('0x33')]?_0xaae99a[_0xb46c('0x32')]:_0x19bc27[_0xb46c('0x30')];if(_0x3756b8[_0xb46c('0x2e')][_0xb46c('0x40')]){_0xaae99a[_0xb46c('0x41')]=[{'all':!![]}];}_0xaae99a=_[_0xb46c('0x3a')]({},_0xaae99a,_0x3756b8[_0xb46c('0x3f')]);return db[_0xb46c('0x2b')][_0xb46c('0x46')](_0xaae99a)[_0xb46c('0x24')](handleEntityNotFound(_0x3ac99e,null))[_0xb46c('0x24')](respondWithResult(_0x3ac99e,null))[_0xb46c('0x43')](handleError(_0x3ac99e,null));};exports[_0xb46c('0x47')]=function(_0x26c9b0,_0x48690e){return db['VoiceChanSpy'][_0xb46c('0x47')](_0x26c9b0[_0xb46c('0x48')],{})[_0xb46c('0x24')](function(_0x1ba637){var _0x55b3fb=_0x26c9b0[_0xb46c('0x49')]['get']({'plain':!![]});if(!_0x55b3fb)throw new Error(_0xb46c('0x4a'));if(_0x55b3fb[_0xb46c('0x4b')]===_0xb46c('0x49')){var _0x19c883=_0x1ba637[_0xb46c('0x25')]({'plain':!![]});var _0x5a1358=_0xb46c('0x4c');return db[_0xb46c('0x4d')][_0xb46c('0x46')]({'where':{'name':_0x5a1358,'userProfileId':_0x55b3fb['userProfileId']},'raw':!![]})[_0xb46c('0x24')](function(_0x374e77){if(_0x374e77&&_0x374e77[_0xb46c('0x4e')]===0x0){return db['UserProfileResource'][_0xb46c('0x47')]({'name':_0x19c883[_0xb46c('0x2a')],'resourceId':_0x19c883['id'],'type':_0x374e77[_0xb46c('0x2a')],'sectionId':_0x374e77['id']},{})[_0xb46c('0x24')](function(){return _0x1ba637;});}else{return _0x1ba637;}})['catch'](function(_0x4df6e1){logger[_0xb46c('0x28')](_0xb46c('0x4f'),_0x4df6e1);throw _0x4df6e1;});}return _0x1ba637;})['then'](respondWithResult(_0x48690e,0xc9))[_0xb46c('0x43')](handleError(_0x48690e,null));};exports[_0xb46c('0x22')]=function(_0xac7cdd,_0x1ce0ae){if(_0xac7cdd[_0xb46c('0x48')]['id']){delete _0xac7cdd[_0xb46c('0x48')]['id'];}return db[_0xb46c('0x2b')][_0xb46c('0x46')]({'where':{'id':_0xac7cdd[_0xb46c('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ce0ae,null))[_0xb46c('0x24')](saveUpdates(_0xac7cdd[_0xb46c('0x48')],null))['then'](respondWithResult(_0x1ce0ae,null))[_0xb46c('0x43')](handleError(_0x1ce0ae,null));};exports[_0xb46c('0x23')]=function(_0x5ab649,_0x54fec8){return db[_0xb46c('0x2b')]['find']({'where':{'id':_0x5ab649[_0xb46c('0x45')]['id']}})[_0xb46c('0x24')](handleEntityNotFound(_0x54fec8,null))[_0xb46c('0x24')](removeEntity(_0x54fec8,null))[_0xb46c('0x43')](handleError(_0x54fec8,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 949bd33..ca6f16c 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 _0xb3a8=['chanspy','recordingFormat','auth','Authenticate','password','ChanSpy','name','options','join','record','StopMixMonitor','internal','concat','User','findAll','agent','then','catch','exports','models','define','voice_chanspy','length','bulkCreate','destroy','VoiceExtension','lodash','util','../../config/logger','api','./voiceChanSpy.attributes','system','format','%s%s','prefix','push','merge','Set','CDR(type)=%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb3a8,0x1a0));var _0x8b3a=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xb3a8[_0x243217];return _0x478029;};'use strict';var _=require(_0x8b3a('0x0'));var util=require(_0x8b3a('0x1'));var BPromise=require('bluebird');var logger=require(_0x8b3a('0x2'))(_0x8b3a('0x3'));var attributes=require(_0x8b3a('0x4'));var getUserApplications=function(_0x5bfbec,_0x4faecb,_0x11eaf0){var _0x17ee49=0x1;var _0x5eb79d=[];var _0x1b4b81={'context':'from-sip','type':_0x8b3a('0x5'),'isApp':![]};var _0x1baf76={'exten':util[_0x8b3a('0x6')](_0x8b3a('0x7'),_0x5bfbec[_0x8b3a('0x8')],_0x11eaf0),'ChanSpyId':_0x5bfbec['id'],'UserId':_0x4faecb['id']};_0x5eb79d[_0x8b3a('0x9')](_[_0x8b3a('0xa')]({'app':_0x8b3a('0xb'),'appdata':util[_0x8b3a('0x6')](_0x8b3a('0xc'),_0x8b3a('0xd')),'priority':_0x17ee49++},_0x1b4b81,_0x1baf76));if(_0x5bfbec['record']){_0x5eb79d[_0x8b3a('0x9')](_['merge']({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,ab',_0x5bfbec[_0x8b3a('0xe')]),'priority':_0x17ee49++},_0x1b4b81,_0x1baf76));}if(_0x5bfbec[_0x8b3a('0xf')]){_0x5eb79d[_0x8b3a('0x9')](_[_0x8b3a('0xa')]({'app':_0x8b3a('0x10'),'appdata':_0x5bfbec[_0x8b3a('0x11')],'priority':_0x17ee49++},_0x1b4b81,_0x1baf76));}_0x5eb79d[_0x8b3a('0x9')](_['merge']({'app':_0x8b3a('0x12'),'appdata':util[_0x8b3a('0x6')]('SIP/%s,%s',_0x4faecb[_0x8b3a('0x13')],_0x5bfbec[_0x8b3a('0x14')]?_0x5bfbec['options'][_0x8b3a('0x15')](''):''),'priority':_0x17ee49++},_0x1b4b81,_0x1baf76));if(_0x5bfbec[_0x8b3a('0x16')]){_0x5eb79d[_0x8b3a('0x9')](_[_0x8b3a('0xa')]({'app':_0x8b3a('0x17'),'priority':_0x17ee49++},_0x1b4b81,_0x1baf76));}return _0x5eb79d;};var getChanSpyApplications=function(_0x15089d,_0x1ec664){var _0x483a77=[];for(var _0x3aceb8=0x0,_0x3fedb6=0x1;_0x3aceb8<_0x1ec664['length'];_0x3aceb8++,_0x3fedb6=0x1){var _0x4d63b3=getUserApplications(_0x15089d,_0x1ec664[_0x3aceb8],_0x1ec664[_0x3aceb8][_0x8b3a('0x18')]);var _0x366d0f=getUserApplications(_0x15089d,_0x1ec664[_0x3aceb8],_0x1ec664[_0x3aceb8][_0x8b3a('0x13')]);_0x483a77=_0x483a77[_0x8b3a('0x19')](_0x4d63b3,_0x366d0f);}return _0x483a77;};var getChanSpyPromise=function(_0x441102,_0x5aa54f){return new BPromise(function(_0x192356,_0x4a1e72){return _0x441102[_0x8b3a('0x1a')][_0x8b3a('0x1b')]({'attributes':['id',_0x8b3a('0x13'),_0x8b3a('0x18')],'where':{'role':_0x8b3a('0x1c'),'chanspy':!![]},'raw':!![]})[_0x8b3a('0x1d')](function(_0x172a35){if(_0x172a35){return _0x192356(getChanSpyApplications(_0x5aa54f,_0x172a35));}return _0x192356([]);})[_0x8b3a('0x1e')](function(_0xe55fa5){_0x4a1e72(_0xe55fa5);});});};module[_0x8b3a('0x1f')]=function(_0xcef4a5,_0x582576){var _0x27e3db=_0xcef4a5[_0x8b3a('0x20')];return _0xcef4a5[_0x8b3a('0x21')]('VoiceChanSpy',attributes,{'tableName':_0x8b3a('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x38bdea,_0x47284d,_0x4ccdc7){return getChanSpyPromise(_0x27e3db,_0x38bdea)['then'](function(_0x52c645){if(_0x52c645&&_0x52c645[_0x8b3a('0x23')]){return _0x27e3db['VoiceExtension'][_0x8b3a('0x24')](_0x52c645);}})['then'](function(){_0x4ccdc7();})[_0x8b3a('0x1e')](function(_0x3464c7){_0x4ccdc7(_0x3464c7);});},'afterUpdate':function(_0x404ef6,_0x21316a,_0x1be4aa){return _0x27e3db['VoiceExtension'][_0x8b3a('0x25')]({'where':{'ChanSpyId':_0x404ef6['id']}})[_0x8b3a('0x1d')](function(){return getChanSpyPromise(_0x27e3db,_0x404ef6);})['then'](function(_0x3349c1){if(_0x3349c1&&_0x3349c1[_0x8b3a('0x23')]){return _0x27e3db[_0x8b3a('0x26')][_0x8b3a('0x24')](_0x3349c1);}})['then'](function(){_0x1be4aa();})[_0x8b3a('0x1e')](function(_0x2aa422){_0x1be4aa(_0x2aa422);});},'afterDestroy':function(_0x1671be,_0x334935,_0x4620f1){return _0x27e3db[_0x8b3a('0x26')][_0x8b3a('0x25')]({'where':{'ChanSpyId':_0x1671be['id']}})[_0x8b3a('0x1d')](function(){_0x4620f1();})[_0x8b3a('0x1e')](function(_0x1b25c9){_0x4620f1(_0x1b25c9);});}}});}; \ No newline at end of file +var _0xc36e=['recordingFormat','auth','SIP/%s,%s','name','options','StopMixMonitor','length','internal','concat','findAll','agent','exports','define','voice_chanspy','then','bulkCreate','catch','VoiceExtension','destroy','util','../../config/logger','api','./voiceChanSpy.attributes','format','%s%s','prefix','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0xc36e,0x79));var _0xec36=function(_0x22a8c4,_0x51c09a){_0x22a8c4=_0x22a8c4-0x0;var _0x104c6d=_0xc36e[_0x22a8c4];return _0x104c6d;};'use strict';var _=require('lodash');var util=require(_0xec36('0x0'));var BPromise=require('bluebird');var logger=require(_0xec36('0x1'))(_0xec36('0x2'));var attributes=require(_0xec36('0x3'));var getUserApplications=function(_0x1d2bed,_0x448fe3,_0x86293e){var _0x502d5f=0x1;var _0x276319=[];var _0xb3de6={'context':'from-sip','type':'system','isApp':![]};var _0xa8c6d8={'exten':util[_0xec36('0x4')](_0xec36('0x5'),_0x1d2bed[_0xec36('0x6')],_0x86293e),'ChanSpyId':_0x1d2bed['id'],'UserId':_0x448fe3['id']};_0x276319[_0xec36('0x7')](_[_0xec36('0x8')]({'app':_0xec36('0x9'),'appdata':util[_0xec36('0x4')](_0xec36('0xa'),_0xec36('0xb')),'priority':_0x502d5f++},_0xb3de6,_0xa8c6d8));if(_0x1d2bed[_0xec36('0xc')]){_0x276319['push'](_[_0xec36('0x8')]({'app':_0xec36('0xd'),'appdata':util[_0xec36('0x4')](_0xec36('0xe'),_0x1d2bed[_0xec36('0xf')]),'priority':_0x502d5f++},_0xb3de6,_0xa8c6d8));}if(_0x1d2bed[_0xec36('0x10')]){_0x276319['push'](_['merge']({'app':'Authenticate','appdata':_0x1d2bed['password'],'priority':_0x502d5f++},_0xb3de6,_0xa8c6d8));}_0x276319['push'](_['merge']({'app':'ChanSpy','appdata':util[_0xec36('0x4')](_0xec36('0x11'),_0x448fe3[_0xec36('0x12')],_0x1d2bed['options']?_0x1d2bed[_0xec36('0x13')]['join'](''):''),'priority':_0x502d5f++},_0xb3de6,_0xa8c6d8));if(_0x1d2bed[_0xec36('0xc')]){_0x276319[_0xec36('0x7')](_[_0xec36('0x8')]({'app':_0xec36('0x14'),'priority':_0x502d5f++},_0xb3de6,_0xa8c6d8));}return _0x276319;};var getChanSpyApplications=function(_0x569320,_0x150b25){var _0x2b9103=[];for(var _0x5a42d9=0x0,_0x1fb059=0x1;_0x5a42d9<_0x150b25[_0xec36('0x15')];_0x5a42d9++,_0x1fb059=0x1){var _0x5bcd60=getUserApplications(_0x569320,_0x150b25[_0x5a42d9],_0x150b25[_0x5a42d9][_0xec36('0x16')]);var _0x8315f4=getUserApplications(_0x569320,_0x150b25[_0x5a42d9],_0x150b25[_0x5a42d9][_0xec36('0x12')]);_0x2b9103=_0x2b9103[_0xec36('0x17')](_0x5bcd60,_0x8315f4);}return _0x2b9103;};var getChanSpyPromise=function(_0x204455,_0x4bdb11){return new BPromise(function(_0x5613ad,_0x53d77f){return _0x204455['User'][_0xec36('0x18')]({'attributes':['id',_0xec36('0x12'),'internal'],'where':{'role':_0xec36('0x19'),'chanspy':!![]},'raw':!![]})['then'](function(_0x31f17a){if(_0x31f17a){return _0x5613ad(getChanSpyApplications(_0x4bdb11,_0x31f17a));}return _0x5613ad([]);})['catch'](function(_0x292ba8){_0x53d77f(_0x292ba8);});});};module[_0xec36('0x1a')]=function(_0x2706a3,_0x4b9a3b){var _0xd635f5=_0x2706a3['models'];return _0x2706a3[_0xec36('0x1b')]('VoiceChanSpy',attributes,{'tableName':_0xec36('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x41208f,_0x16b8c5,_0x4dd753){return getChanSpyPromise(_0xd635f5,_0x41208f)[_0xec36('0x1d')](function(_0x2c2b14){if(_0x2c2b14&&_0x2c2b14['length']){return _0xd635f5['VoiceExtension'][_0xec36('0x1e')](_0x2c2b14);}})[_0xec36('0x1d')](function(){_0x4dd753();})[_0xec36('0x1f')](function(_0x5e76e9){_0x4dd753(_0x5e76e9);});},'afterUpdate':function(_0x1701eb,_0x2bbf95,_0x1586f4){return _0xd635f5[_0xec36('0x20')][_0xec36('0x21')]({'where':{'ChanSpyId':_0x1701eb['id']}})[_0xec36('0x1d')](function(){return getChanSpyPromise(_0xd635f5,_0x1701eb);})[_0xec36('0x1d')](function(_0x2fd630){if(_0x2fd630&&_0x2fd630['length']){return _0xd635f5[_0xec36('0x20')]['bulkCreate'](_0x2fd630);}})[_0xec36('0x1d')](function(){_0x1586f4();})['catch'](function(_0x12b78b){_0x1586f4(_0x12b78b);});},'afterDestroy':function(_0x1b85f7,_0x1a2bd4,_0x16ab39){return _0xd635f5[_0xec36('0x20')][_0xec36('0x21')]({'where':{'ChanSpyId':_0x1b85f7['id']}})['then'](function(){_0x16ab39();})[_0xec36('0x1f')](function(_0x1c59f3){_0x16ab39(_0x1c59f3);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 30cd9c1..571b0e1 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 _0x2d70=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5d5177,_0x24d3c8){var _0x195c11=function(_0x5e4f32){while(--_0x5e4f32){_0x5d5177['push'](_0x5d5177['shift']());}};_0x195c11(++_0x24d3c8);}(_0x2d70,0xd2));var _0x02d7=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x2d70[_0x4d7f3f];return _0x5d67cc;};'use strict';var _=require(_0x02d7('0x0'));var util=require('util');var moment=require(_0x02d7('0x1'));var BPromise=require(_0x02d7('0x2'));var rs=require(_0x02d7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02d7('0x4'))['db'];var utils=require(_0x02d7('0x5'));var logger=require(_0x02d7('0x6'))(_0x02d7('0x7'));var config=require(_0x02d7('0x8'));var jayson=require(_0x02d7('0x9'));var client=jayson[_0x02d7('0xa')][_0x02d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25cb04,_0x452704,_0x2bbbe6){return new BPromise(function(_0x3fb1ff,_0x1577d6){return client['request'](_0x25cb04,_0x2bbbe6)[_0x02d7('0xc')](function(_0x20edb3){logger[_0x02d7('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x452704,_0x02d7('0xe'));logger[_0x02d7('0xf')](_0x02d7('0x10'),_0x452704,_0x02d7('0xe'),JSON[_0x02d7('0x11')](_0x20edb3));if(_0x20edb3[_0x02d7('0x12')]){if(_0x20edb3[_0x02d7('0x12')][_0x02d7('0x13')]===0x1f4){logger[_0x02d7('0x12')](_0x02d7('0x14'),_0x452704,_0x20edb3[_0x02d7('0x12')][_0x02d7('0x15')]);return _0x1577d6(_0x20edb3[_0x02d7('0x12')][_0x02d7('0x15')]);}logger['error'](_0x02d7('0x14'),_0x452704,_0x20edb3[_0x02d7('0x12')][_0x02d7('0x15')]);return _0x3fb1ff(_0x20edb3[_0x02d7('0x12')]['message']);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x452704,_0x02d7('0xe'));_0x3fb1ff(_0x20edb3[_0x02d7('0x16')][_0x02d7('0x15')]);}})[_0x02d7('0x17')](function(_0x49f212){logger[_0x02d7('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x452704,_0x49f212);_0x1577d6(_0x49f212);});});} \ No newline at end of file +var _0x7560=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','error','message','VoiceChanSpy,\x20%s,\x20%s','result'];(function(_0x40940e,_0x947f50){var _0x2a4e54=function(_0x5d4ee4){while(--_0x5d4ee4){_0x40940e['push'](_0x40940e['shift']());}};_0x2a4e54(++_0x947f50);}(_0x7560,0x1ee));var _0x0756=function(_0x174a2d,_0x44cf92){_0x174a2d=_0x174a2d-0x0;var _0x3a58c3=_0x7560[_0x174a2d];return _0x3a58c3;};'use strict';var _=require('lodash');var util=require(_0x0756('0x0'));var moment=require(_0x0756('0x1'));var BPromise=require('bluebird');var rs=require(_0x0756('0x2'));var fs=require('fs');var Redis=require(_0x0756('0x3'));var db=require(_0x0756('0x4'))['db'];var utils=require(_0x0756('0x5'));var logger=require(_0x0756('0x6'))(_0x0756('0x7'));var config=require(_0x0756('0x8'));var jayson=require(_0x0756('0x9'));var client=jayson[_0x0756('0xa')][_0x0756('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x118ae1,_0x2afcb2,_0x716b53){return new BPromise(function(_0xa7002e,_0x5d90cf){return client['request'](_0x118ae1,_0x716b53)[_0x0756('0xc')](function(_0x691384){logger[_0x0756('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x2afcb2,'request\x20sent');logger[_0x0756('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x2afcb2,'request\x20sent',JSON['stringify'](_0x691384));if(_0x691384[_0x0756('0xf')]){if(_0x691384[_0x0756('0xf')]['code']===0x1f4){logger[_0x0756('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x2afcb2,_0x691384['error'][_0x0756('0x10')]);return _0x5d90cf(_0x691384[_0x0756('0xf')]['message']);}logger[_0x0756('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x2afcb2,_0x691384[_0x0756('0xf')][_0x0756('0x10')]);return _0xa7002e(_0x691384['error'][_0x0756('0x10')]);}else{logger[_0x0756('0xd')](_0x0756('0x11'),_0x2afcb2,'request\x20sent');_0xa7002e(_0x691384[_0x0756('0x12')][_0x0756('0x10')]);}})['catch'](function(_0x4b0c39){logger[_0x0756('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x2afcb2,_0x4b0c39);_0x5d90cf(_0x4b0c39);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 9288f2e..201223f 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 _0xea5b=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','Router'];(function(_0xcfc88f,_0x239d01){var _0x20cfc0=function(_0x329197){while(--_0x329197){_0xcfc88f['push'](_0xcfc88f['shift']());}};_0x20cfc0(++_0x239d01);}(_0xea5b,0x152));var _0xbea5=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xea5b[_0x4a53d];return _0x27410e;};'use strict';var multer=require(_0xbea5('0x0'));var util=require(_0xbea5('0x1'));var path=require(_0xbea5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbea5('0x3')]();var auth=require(_0xbea5('0x4'));var interaction=require(_0xbea5('0x5'));var config=require(_0xbea5('0x6'));var controller=require('./voiceContext.controller');router[_0xbea5('0x7')]('/',auth['isAuthenticated'](),controller[_0xbea5('0x8')]);router[_0xbea5('0x7')](_0xbea5('0x9'),auth[_0xbea5('0xa')](),controller[_0xbea5('0xb')]);router[_0xbea5('0xc')]('/',auth[_0xbea5('0xa')](),controller[_0xbea5('0xd')]);router[_0xbea5('0xe')](_0xbea5('0x9'),auth[_0xbea5('0xa')](),controller[_0xbea5('0xf')]);router['delete']('/:id',auth[_0xbea5('0xa')](),controller[_0xbea5('0x10')]);module[_0xbea5('0x11')]=router; \ No newline at end of file +var _0x38b2=['show','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2a24de,_0x21fcbc){var _0x32b38e=function(_0x189aa3){while(--_0x189aa3){_0x2a24de['push'](_0x2a24de['shift']());}};_0x32b38e(++_0x21fcbc);}(_0x38b2,0xf6));var _0x238b=function(_0x16261a,_0x402c3e){_0x16261a=_0x16261a-0x0;var _0x46a224=_0x38b2[_0x16261a];return _0x46a224;};'use strict';var multer=require(_0x238b('0x0'));var util=require(_0x238b('0x1'));var path=require(_0x238b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x238b('0x3')]();var auth=require(_0x238b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x238b('0x5'));var controller=require('./voiceContext.controller');router[_0x238b('0x6')]('/',auth[_0x238b('0x7')](),controller[_0x238b('0x8')]);router[_0x238b('0x6')]('/:id',auth[_0x238b('0x7')](),controller[_0x238b('0x9')]);router['post']('/',auth[_0x238b('0x7')](),controller[_0x238b('0xa')]);router[_0x238b('0xb')](_0x238b('0xc'),auth[_0x238b('0x7')](),controller[_0x238b('0xd')]);router[_0x238b('0xe')]('/:id',auth[_0x238b('0x7')](),controller[_0x238b('0xf')]);module[_0x238b('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index dad08f5..8ce6b53 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 _0xae0a=['BOOLEAN','sequelize','STRING','name'];(function(_0x3ec0a2,_0x4b57e8){var _0x2c0345=function(_0x3c0a31){while(--_0x3c0a31){_0x3ec0a2['push'](_0x3ec0a2['shift']());}};_0x2c0345(++_0x4b57e8);}(_0xae0a,0x9d));var _0xaae0=function(_0x544b8f,_0x2d3356){_0x544b8f=_0x544b8f-0x0;var _0x77e823=_0xae0a[_0x544b8f];return _0x77e823;};'use strict';var Sequelize=require(_0xaae0('0x0'));module['exports']={'name':{'type':Sequelize[_0xaae0('0x1')],'unique':_0xaae0('0x2')},'description':{'type':Sequelize[_0xaae0('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xaae0('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb0ab=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x469097,_0xeb5ae8){var _0x3fb175=function(_0x15c93f){while(--_0x15c93f){_0x469097['push'](_0x469097['shift']());}};_0x3fb175(++_0xeb5ae8);}(_0xb0ab,0xe7));var _0xbb0a=function(_0x58da09,_0x2cf391){_0x58da09=_0x58da09-0x0;var _0x34c085=_0xb0ab[_0x58da09];return _0x34c085;};'use strict';var Sequelize=require(_0xbb0a('0x0'));module[_0xbb0a('0x1')]={'name':{'type':Sequelize[_0xbb0a('0x2')],'unique':_0xbb0a('0x3')},'description':{'type':Sequelize[_0xbb0a('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xbb0a('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index c14b417..19c8e87 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 _0xf808=['filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','catch','show','includeAll','find','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','/etc/asterisk/extensions_xcally_contexts.conf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','api','../../config/utils','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','VoiceContext','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick'];(function(_0x51d4ee,_0xdead36){var _0x2939b0=function(_0x1d7bf6){while(--_0x1d7bf6){_0x51d4ee['push'](_0x51d4ee['shift']());}};_0x2939b0(++_0xdead36);}(_0xf808,0x83));var _0x8f80=function(_0x5da2c2,_0x40b239){_0x5da2c2=_0x5da2c2-0x0;var _0x284ac5=_0xf808[_0x5da2c2];return _0x284ac5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8f80('0x0'));var zipdir=require(_0x8f80('0x1'));var jsonpatch=require(_0x8f80('0x2'));var rp=require('request-promise');var moment=require(_0x8f80('0x3'));var BPromise=require(_0x8f80('0x4'));var Mustache=require(_0x8f80('0x5'));var util=require(_0x8f80('0x6'));var path=require('path');var sox=require(_0x8f80('0x7'));var csv=require('to-csv');var ejs=require(_0x8f80('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8f80('0x9'));var crypto=require(_0x8f80('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8f80('0xb'));var toCsv=require(_0x8f80('0xc'));var querystring=require(_0x8f80('0xd'));var Papa=require(_0x8f80('0xe'));var authService=require(_0x8f80('0xf'));var hardwareService=require(_0x8f80('0x10'));var Redis=require(_0x8f80('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x8f80('0x12'))(_0x8f80('0x13'));var utils=require(_0x8f80('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x8f80('0x15'));var client=jayson[_0x8f80('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34e442,_0x335bb8,_0x34096d,_0x127c89){return new BPromise(function(_0xa95119,_0xb69cc){var _0x13c06a=_0x127c89||client;return _0x13c06a['request'](_0x34e442,_0x34096d)[_0x8f80('0x17')](function(_0x263601){logger[_0x8f80('0x18')](_0x8f80('0x19'),_0x335bb8,_0x8f80('0x1a'));logger[_0x8f80('0x1b')](_0x8f80('0x1c'),_0x335bb8,'request\x20sent',JSON[_0x8f80('0x1d')](_0x263601));if(_0x263601['error']){if(_0x263601[_0x8f80('0x1e')][_0x8f80('0x1f')]===0x1f4){logger[_0x8f80('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x335bb8,_0x263601[_0x8f80('0x1e')][_0x8f80('0x20')]);return _0xb69cc(_0x263601[_0x8f80('0x1e')][_0x8f80('0x20')]);}logger[_0x8f80('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x335bb8,_0x263601['error'][_0x8f80('0x20')]);return _0xa95119(_0x263601[_0x8f80('0x1e')][_0x8f80('0x20')]);}else{logger['info'](_0x8f80('0x19'),_0x335bb8,_0x8f80('0x1a'));_0xa95119(_0x263601[_0x8f80('0x21')]['message']);}})['catch'](function(_0x347e21){logger[_0x8f80('0x1e')](_0x8f80('0x19'),_0x335bb8,_0x347e21);_0xb69cc(_0x347e21);});});}function respondWithStatusCode(_0x4030df,_0x286f64){_0x286f64=_0x286f64||0xcc;return function(_0x1ce6ef){if(_0x1ce6ef){return _0x4030df[_0x8f80('0x22')](_0x286f64);}return _0x4030df[_0x8f80('0x23')](_0x286f64)[_0x8f80('0x24')]();};}function respondWithResult(_0x2b9680,_0x52344f){_0x52344f=_0x52344f||0xc8;return function(_0x254038){if(_0x254038){return _0x2b9680[_0x8f80('0x23')](_0x52344f)[_0x8f80('0x25')](_0x254038);}};}function respondWithFilteredResult(_0x23a7bd,_0x1a2c5c){return function(_0x30409e){if(_0x30409e){var _0xafeae=_0x30409e[_0x8f80('0x26')],_0x3421f9=_0x1a2c5c[_0x8f80('0x27')],_0x44f007=_0x1a2c5c['offset']+_0x1a2c5c[_0x8f80('0x28')],_0x123b3b;if(_0x44f007>=_0xafeae){_0x44f007=_0xafeae;_0x123b3b=0xc8;}else{_0x123b3b=0xce;}_0x23a7bd[_0x8f80('0x23')](_0x123b3b);return _0x23a7bd[_0x8f80('0x29')](_0x8f80('0x2a'),_0x3421f9+'-'+_0x44f007+'/'+_0xafeae)[_0x8f80('0x25')](_0x30409e);}return null;};}function patchUpdates(_0x41521f){return function(_0x3c1ac2){try{jsonpatch[_0x8f80('0x2b')](_0x3c1ac2,_0x41521f,!![]);}catch(_0x340a28){return BPromise[_0x8f80('0x2c')](_0x340a28);}return _0x3c1ac2[_0x8f80('0x2d')]();};}function saveUpdates(_0x527281,_0x4dcf7d){return function(_0x323a45){if(_0x323a45){return _0x323a45[_0x8f80('0x2e')](_0x527281)['then'](function(_0x3a9a67){return _0x3a9a67;});}return null;};}function removeEntity(_0x8c3300,_0x3d5232){return function(_0x7571fc){if(_0x7571fc){return _0x7571fc[_0x8f80('0x2f')]()[_0x8f80('0x17')](function(){var _0x14bf23=_0x7571fc[_0x8f80('0x30')]({'plain':!![]});var _0x49d12e=_0x8f80('0x31');return db[_0x8f80('0x32')][_0x8f80('0x2f')]({'where':{'type':_0x49d12e,'resourceId':_0x14bf23['id']}})[_0x8f80('0x17')](function(){return _0x7571fc;});})['then'](function(){_0x8c3300[_0x8f80('0x23')](0xcc)[_0x8f80('0x24')]();});}};}function handleEntityNotFound(_0x1d9399,_0x46b514){return function(_0x2c26c5){if(!_0x2c26c5){_0x1d9399[_0x8f80('0x22')](0x194);}return _0x2c26c5;};}function handleError(_0x59f14d,_0x2ea707){_0x2ea707=_0x2ea707||0x1f4;return function(_0x4c8f1a){logger[_0x8f80('0x1e')](_0x4c8f1a[_0x8f80('0x33')]);if(_0x4c8f1a[_0x8f80('0x34')]){delete _0x4c8f1a[_0x8f80('0x34')];}_0x59f14d[_0x8f80('0x23')](_0x2ea707)[_0x8f80('0x35')](_0x4c8f1a);};}exports[_0x8f80('0x36')]=function(_0x435e12,_0x718fd9){var _0x9ed20f={},_0x1999c4={},_0x5480ce={'count':0x0,'rows':[]};var _0x3b7480=db[_0x8f80('0x37')][_0x8f80('0x38')];_0x1999c4[_0x8f80('0x39')]=_[_0x8f80('0x3a')](_0x3b7480);_0x1999c4['query']=_['keys'](_0x435e12[_0x8f80('0x3b')]);_0x1999c4[_0x8f80('0x3c')]=_[_0x8f80('0x3d')](_0x1999c4['model'],_0x1999c4[_0x8f80('0x3b')]);_0x9ed20f[_0x8f80('0x3e')]=_[_0x8f80('0x3d')](_0x1999c4['model'],qs['fields'](_0x435e12['query'][_0x8f80('0x3f')]));_0x9ed20f[_0x8f80('0x3e')]=_0x9ed20f[_0x8f80('0x3e')][_0x8f80('0x40')]?_0x9ed20f[_0x8f80('0x3e')]:_0x1999c4['model'];if(!_0x435e12[_0x8f80('0x3b')]['hasOwnProperty'](_0x8f80('0x41'))){_0x9ed20f['limit']=qs[_0x8f80('0x28')](_0x435e12[_0x8f80('0x3b')][_0x8f80('0x28')]);_0x9ed20f[_0x8f80('0x27')]=qs['offset'](_0x435e12[_0x8f80('0x3b')]['offset']);}_0x9ed20f['order']=qs[_0x8f80('0x42')](_0x435e12[_0x8f80('0x3b')][_0x8f80('0x42')]);_0x9ed20f[_0x8f80('0x43')]=qs[_0x8f80('0x3c')](_[_0x8f80('0x44')](_0x435e12[_0x8f80('0x3b')],_0x1999c4['filters']));if(_0x435e12[_0x8f80('0x3b')][_0x8f80('0x45')]){_0x9ed20f[_0x8f80('0x43')]=_[_0x8f80('0x46')](_0x9ed20f[_0x8f80('0x43')],{'$or':_[_0x8f80('0x47')](_0x3b7480,function(_0x44362c){if(_0x44362c[_0x8f80('0x48')][_0x8f80('0x49')]!==_0x8f80('0x4a')){var _0x381e64={};_0x381e64[_0x44362c[_0x8f80('0x4b')]]={'$like':'%'+_0x435e12['query']['filter']+'%'};return _0x381e64;}})});}_0x9ed20f=_[_0x8f80('0x46')]({},_0x9ed20f,_0x435e12[_0x8f80('0x4c')]);var _0x251bd2={'where':_0x9ed20f[_0x8f80('0x43')]};return db[_0x8f80('0x37')]['count'](_0x251bd2)[_0x8f80('0x17')](function(_0x106a84){_0x5480ce[_0x8f80('0x26')]=_0x106a84;if(_0x435e12['query']['includeAll']){_0x9ed20f[_0x8f80('0x4d')]=[{'all':!![]}];}return db[_0x8f80('0x37')][_0x8f80('0x4e')](_0x9ed20f);})[_0x8f80('0x17')](function(_0x32488d){_0x5480ce['rows']=_0x32488d;return _0x5480ce;})[_0x8f80('0x17')](respondWithFilteredResult(_0x718fd9,_0x9ed20f))[_0x8f80('0x4f')](handleError(_0x718fd9,null));};exports[_0x8f80('0x50')]=function(_0x5f470f,_0x1827e4){var _0x2481ee={'raw':![],'where':{'id':_0x5f470f['params']['id']}},_0x57e2b0={};_0x57e2b0[_0x8f80('0x39')]=_[_0x8f80('0x3a')](db[_0x8f80('0x37')]['rawAttributes']);_0x57e2b0[_0x8f80('0x3b')]=_[_0x8f80('0x3a')](_0x5f470f[_0x8f80('0x3b')]);_0x57e2b0[_0x8f80('0x3c')]=_[_0x8f80('0x3d')](_0x57e2b0[_0x8f80('0x39')],_0x57e2b0[_0x8f80('0x3b')]);_0x2481ee['attributes']=_['intersection'](_0x57e2b0[_0x8f80('0x39')],qs[_0x8f80('0x3f')](_0x5f470f['query'][_0x8f80('0x3f')]));_0x2481ee[_0x8f80('0x3e')]=_0x2481ee[_0x8f80('0x3e')]['length']?_0x2481ee['attributes']:_0x57e2b0[_0x8f80('0x39')];if(_0x5f470f[_0x8f80('0x3b')][_0x8f80('0x51')]){_0x2481ee[_0x8f80('0x4d')]=[{'all':!![]}];}_0x2481ee=_[_0x8f80('0x46')]({},_0x2481ee,_0x5f470f[_0x8f80('0x4c')]);return db[_0x8f80('0x37')][_0x8f80('0x52')](_0x2481ee)['then'](handleEntityNotFound(_0x1827e4,null))[_0x8f80('0x17')](respondWithResult(_0x1827e4,null))['catch'](handleError(_0x1827e4,null));};exports['create']=function(_0x112c31,_0x14533c,_0x3b6570){var _0xb821cc;return db['VoiceContext'][_0x8f80('0x53')](_0x112c31['body'],{'raw':!![]})[_0x8f80('0x17')](function(_0x89fa3b){_0xb821cc=_0x89fa3b;return db[_0x8f80('0x37')][_0x8f80('0x4e')]({'raw':!![]});})[_0x8f80('0x17')](function(_0x3cbb98){var _0x3c2acc=fs[_0x8f80('0x54')](path[_0x8f80('0x55')](config[_0x8f80('0x56')],_0x8f80('0x57')),_0x8f80('0x58'));var _0x350086=ejs[_0x8f80('0x59')](_0x3c2acc,{'contexts':_0x3cbb98||[]});fs[_0x8f80('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x350086);})[_0x8f80('0x17')](function(){return respondWithRpcPromise(_0x8f80('0x5b'),_0x8f80('0x53'),{'module':_0x8f80('0x5c')});})[_0x8f80('0x17')](function(){var _0x2a6adc=_0x112c31['user'][_0x8f80('0x30')]({'plain':!![]});if(!_0x2a6adc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a6adc['role']===_0x8f80('0x5d')){var _0x5f538b=_0xb821cc[_0x8f80('0x30')]({'plain':!![]});return db[_0x8f80('0x5e')][_0x8f80('0x52')]({'where':{'name':_0x8f80('0x31'),'userProfileId':_0x2a6adc[_0x8f80('0x5f')]},'raw':!![]})[_0x8f80('0x17')](function(_0x5e0380){if(_0x5e0380&&_0x5e0380['autoAssociation']===0x0){return db[_0x8f80('0x32')][_0x8f80('0x53')]({'name':_0x5f538b[_0x8f80('0x34')],'resourceId':_0x5f538b['id'],'type':_0x5e0380[_0x8f80('0x34')],'sectionId':_0x5e0380['id']},{})[_0x8f80('0x17')](function(){return _0xb821cc;});}else{return _0xb821cc;}})[_0x8f80('0x4f')](function(_0x5a0b95){logger['error'](_0x8f80('0x60'),_0x5a0b95);throw _0x5a0b95;});}return _0xb821cc;})['then'](respondWithResult(_0x14533c,0xc9))[_0x8f80('0x4f')](handleError(_0x14533c,null));};exports[_0x8f80('0x2e')]=function(_0x2ac252,_0x4e08b6,_0x59c1db){var _0x59100d;return db[_0x8f80('0x37')]['find']({'where':{'id':_0x2ac252[_0x8f80('0x61')]['id']}})[_0x8f80('0x17')](handleEntityNotFound(_0x4e08b6,null))[_0x8f80('0x17')](saveUpdates(_0x2ac252[_0x8f80('0x62')],null))['then'](function(_0x32b6b9){if(_0x32b6b9){_0x59100d=_0x32b6b9;return db[_0x8f80('0x37')][_0x8f80('0x4e')]({'raw':!![]});}})[_0x8f80('0x17')](function(_0x491a81){var _0x373635=fs[_0x8f80('0x54')](path['join'](config[_0x8f80('0x56')],_0x8f80('0x57')),_0x8f80('0x58'));var _0x20ee56=ejs[_0x8f80('0x59')](_0x373635,{'contexts':_0x491a81||[]});fs[_0x8f80('0x5a')](_0x8f80('0x63'),_0x20ee56);})[_0x8f80('0x17')](function(){return respondWithRpcPromise(_0x8f80('0x5b'),_0x8f80('0x2e'),{'module':_0x8f80('0x5c')});})[_0x8f80('0x17')](function(){return _0x59100d;})[_0x8f80('0x17')](respondWithResult(_0x4e08b6,null))['catch'](handleError(_0x4e08b6,null));};exports[_0x8f80('0x2f')]=function(_0x3c3802,_0x5b4ebc,_0x4c146d){var _0x3ecfc8;return db['VoiceContext']['find']({'where':{'id':_0x3c3802['params']['id']}})[_0x8f80('0x17')](handleEntityNotFound(_0x5b4ebc,null))[_0x8f80('0x17')](removeEntity(_0x5b4ebc,null))[_0x8f80('0x17')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x8f80('0x17')](function(_0x25527e){var _0x13f05b=fs[_0x8f80('0x54')](path[_0x8f80('0x55')](config[_0x8f80('0x56')],_0x8f80('0x57')),'utf8');var _0x498b60=ejs['render'](_0x13f05b,{'contexts':_0x25527e});fs[_0x8f80('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x498b60);return respondWithRpcPromise(_0x8f80('0x5b'),'destroy',{'module':_0x8f80('0x5c')});})[_0x8f80('0x4f')](handleError(_0x5b4ebc,null));}; \ No newline at end of file +var _0x33c6=['intersection','fields','length','nolimit','limit','order','sort','pick','filter','merge','where','type','VIRTUAL','field','count','includeAll','include','rows','show','params','options','create','findAll','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','root','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','save','then','destroy','get','Contexts','UserProfileResource','stack','name','send','VoiceContext','rawAttributes','model','keys','filters','query','attributes'];(function(_0x5daca2,_0xfb01a8){var _0x5cc0d9=function(_0x4ea2e7){while(--_0x4ea2e7){_0x5daca2['push'](_0x5daca2['shift']());}};_0x5cc0d9(++_0xfb01a8);}(_0x33c6,0x15d));var _0x633c=function(_0x1cfaa4,_0x7a5798){_0x1cfaa4=_0x1cfaa4-0x0;var _0x471363=_0x33c6[_0x1cfaa4];return _0x471363;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x633c('0x0'));var rimraf=require(_0x633c('0x1'));var zipdir=require(_0x633c('0x2'));var jsonpatch=require(_0x633c('0x3'));var rp=require('request-promise');var moment=require(_0x633c('0x4'));var BPromise=require(_0x633c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x633c('0x6'));var csv=require(_0x633c('0x7'));var ejs=require(_0x633c('0x8'));var fs=require('fs');var _=require(_0x633c('0x9'));var squel=require(_0x633c('0xa'));var crypto=require(_0x633c('0xb'));var jsforce=require(_0x633c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x633c('0x7'));var querystring=require(_0x633c('0xd'));var Papa=require(_0x633c('0xe'));var authService=require(_0x633c('0xf'));var hardwareService=require(_0x633c('0x10'));var Redis=require(_0x633c('0x11'));var qs=require(_0x633c('0x12'));var logger=require(_0x633c('0x13'))(_0x633c('0x14'));var utils=require(_0x633c('0x15'));var config=require(_0x633c('0x16'));var db=require(_0x633c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x633c('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24f7eb,_0x2786fe,_0xf7bebc,_0x1cad07){return new BPromise(function(_0x34c46a,_0x2851df){var _0x562963=_0x1cad07||client;return _0x562963[_0x633c('0x19')](_0x24f7eb,_0xf7bebc)['then'](function(_0x35d8fe){logger[_0x633c('0x1a')](_0x633c('0x1b'),_0x2786fe,_0x633c('0x1c'));logger['debug'](_0x633c('0x1d'),_0x2786fe,_0x633c('0x1c'),JSON[_0x633c('0x1e')](_0x35d8fe));if(_0x35d8fe[_0x633c('0x1f')]){if(_0x35d8fe['error'][_0x633c('0x20')]===0x1f4){logger[_0x633c('0x1f')](_0x633c('0x1b'),_0x2786fe,_0x35d8fe[_0x633c('0x1f')][_0x633c('0x21')]);return _0x2851df(_0x35d8fe[_0x633c('0x1f')][_0x633c('0x21')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x2786fe,_0x35d8fe[_0x633c('0x1f')][_0x633c('0x21')]);return _0x34c46a(_0x35d8fe[_0x633c('0x1f')][_0x633c('0x21')]);}else{logger['info'](_0x633c('0x1b'),_0x2786fe,_0x633c('0x1c'));_0x34c46a(_0x35d8fe['result']['message']);}})[_0x633c('0x22')](function(_0x3c262f){logger[_0x633c('0x1f')](_0x633c('0x1b'),_0x2786fe,_0x3c262f);_0x2851df(_0x3c262f);});});}function respondWithStatusCode(_0x35fd89,_0x1c7c67){_0x1c7c67=_0x1c7c67||0xcc;return function(_0x5e7e8d){if(_0x5e7e8d){return _0x35fd89[_0x633c('0x23')](_0x1c7c67);}return _0x35fd89[_0x633c('0x24')](_0x1c7c67)[_0x633c('0x25')]();};}function respondWithResult(_0x21cced,_0x2530d0){_0x2530d0=_0x2530d0||0xc8;return function(_0x73240c){if(_0x73240c){return _0x21cced['status'](_0x2530d0)[_0x633c('0x26')](_0x73240c);}};}function respondWithFilteredResult(_0x25e3a0,_0x106d0d){return function(_0x3d1358){if(_0x3d1358){var _0x1bfa8e=_0x3d1358['count'],_0x1430b4=_0x106d0d[_0x633c('0x27')],_0x2a6cf2=_0x106d0d['offset']+_0x106d0d['limit'],_0x2a77fb;if(_0x2a6cf2>=_0x1bfa8e){_0x2a6cf2=_0x1bfa8e;_0x2a77fb=0xc8;}else{_0x2a77fb=0xce;}_0x25e3a0[_0x633c('0x24')](_0x2a77fb);return _0x25e3a0[_0x633c('0x28')](_0x633c('0x29'),_0x1430b4+'-'+_0x2a6cf2+'/'+_0x1bfa8e)[_0x633c('0x26')](_0x3d1358);}return null;};}function patchUpdates(_0xc07f39){return function(_0x4ddfdb){try{jsonpatch[_0x633c('0x2a')](_0x4ddfdb,_0xc07f39,!![]);}catch(_0x48a8f7){return BPromise['reject'](_0x48a8f7);}return _0x4ddfdb[_0x633c('0x2b')]();};}function saveUpdates(_0x468ab3,_0x23d296){return function(_0x2f9488){if(_0x2f9488){return _0x2f9488['update'](_0x468ab3)[_0x633c('0x2c')](function(_0x3f30b0){return _0x3f30b0;});}return null;};}function removeEntity(_0x203a8b,_0x1a6625){return function(_0x108b96){if(_0x108b96){return _0x108b96[_0x633c('0x2d')]()[_0x633c('0x2c')](function(){var _0x283d94=_0x108b96[_0x633c('0x2e')]({'plain':!![]});var _0x31bd38=_0x633c('0x2f');return db[_0x633c('0x30')][_0x633c('0x2d')]({'where':{'type':_0x31bd38,'resourceId':_0x283d94['id']}})['then'](function(){return _0x108b96;});})[_0x633c('0x2c')](function(){_0x203a8b['status'](0xcc)[_0x633c('0x25')]();});}};}function handleEntityNotFound(_0x546adc,_0x23c822){return function(_0x523f01){if(!_0x523f01){_0x546adc[_0x633c('0x23')](0x194);}return _0x523f01;};}function handleError(_0x472dfe,_0x990ffb){_0x990ffb=_0x990ffb||0x1f4;return function(_0x4c9e04){logger[_0x633c('0x1f')](_0x4c9e04[_0x633c('0x31')]);if(_0x4c9e04[_0x633c('0x32')]){delete _0x4c9e04['name'];}_0x472dfe[_0x633c('0x24')](_0x990ffb)[_0x633c('0x33')](_0x4c9e04);};}exports['index']=function(_0xc5fbf7,_0x272c93){var _0x35b588={},_0x2a964c={},_0x2c5e99={'count':0x0,'rows':[]};var _0x1239a9=db[_0x633c('0x34')][_0x633c('0x35')];_0x2a964c[_0x633c('0x36')]=_[_0x633c('0x37')](_0x1239a9);_0x2a964c['query']=_['keys'](_0xc5fbf7['query']);_0x2a964c[_0x633c('0x38')]=_['intersection'](_0x2a964c[_0x633c('0x36')],_0x2a964c[_0x633c('0x39')]);_0x35b588[_0x633c('0x3a')]=_[_0x633c('0x3b')](_0x2a964c[_0x633c('0x36')],qs[_0x633c('0x3c')](_0xc5fbf7[_0x633c('0x39')][_0x633c('0x3c')]));_0x35b588[_0x633c('0x3a')]=_0x35b588[_0x633c('0x3a')][_0x633c('0x3d')]?_0x35b588['attributes']:_0x2a964c['model'];if(!_0xc5fbf7[_0x633c('0x39')]['hasOwnProperty'](_0x633c('0x3e'))){_0x35b588['limit']=qs[_0x633c('0x3f')](_0xc5fbf7[_0x633c('0x39')][_0x633c('0x3f')]);_0x35b588[_0x633c('0x27')]=qs[_0x633c('0x27')](_0xc5fbf7[_0x633c('0x39')][_0x633c('0x27')]);}_0x35b588[_0x633c('0x40')]=qs[_0x633c('0x41')](_0xc5fbf7[_0x633c('0x39')][_0x633c('0x41')]);_0x35b588['where']=qs[_0x633c('0x38')](_[_0x633c('0x42')](_0xc5fbf7[_0x633c('0x39')],_0x2a964c[_0x633c('0x38')]));if(_0xc5fbf7[_0x633c('0x39')][_0x633c('0x43')]){_0x35b588['where']=_[_0x633c('0x44')](_0x35b588[_0x633c('0x45')],{'$or':_['map'](_0x1239a9,function(_0x4c8612){if(_0x4c8612[_0x633c('0x46')]['key']!==_0x633c('0x47')){var _0x4c8072={};_0x4c8072[_0x4c8612[_0x633c('0x48')]]={'$like':'%'+_0xc5fbf7[_0x633c('0x39')][_0x633c('0x43')]+'%'};return _0x4c8072;}})});}_0x35b588=_[_0x633c('0x44')]({},_0x35b588,_0xc5fbf7['options']);var _0x214d41={'where':_0x35b588['where']};return db[_0x633c('0x34')][_0x633c('0x49')](_0x214d41)[_0x633c('0x2c')](function(_0xfba447){_0x2c5e99[_0x633c('0x49')]=_0xfba447;if(_0xc5fbf7[_0x633c('0x39')][_0x633c('0x4a')]){_0x35b588[_0x633c('0x4b')]=[{'all':!![]}];}return db[_0x633c('0x34')]['findAll'](_0x35b588);})[_0x633c('0x2c')](function(_0x1c2421){_0x2c5e99[_0x633c('0x4c')]=_0x1c2421;return _0x2c5e99;})['then'](respondWithFilteredResult(_0x272c93,_0x35b588))[_0x633c('0x22')](handleError(_0x272c93,null));};exports[_0x633c('0x4d')]=function(_0x2eb26d,_0x234b1a){var _0x7251ae={'raw':![],'where':{'id':_0x2eb26d[_0x633c('0x4e')]['id']}},_0x496830={};_0x496830[_0x633c('0x36')]=_[_0x633c('0x37')](db['VoiceContext']['rawAttributes']);_0x496830['query']=_[_0x633c('0x37')](_0x2eb26d[_0x633c('0x39')]);_0x496830['filters']=_['intersection'](_0x496830[_0x633c('0x36')],_0x496830[_0x633c('0x39')]);_0x7251ae[_0x633c('0x3a')]=_[_0x633c('0x3b')](_0x496830[_0x633c('0x36')],qs[_0x633c('0x3c')](_0x2eb26d[_0x633c('0x39')][_0x633c('0x3c')]));_0x7251ae[_0x633c('0x3a')]=_0x7251ae['attributes']['length']?_0x7251ae[_0x633c('0x3a')]:_0x496830[_0x633c('0x36')];if(_0x2eb26d[_0x633c('0x39')][_0x633c('0x4a')]){_0x7251ae[_0x633c('0x4b')]=[{'all':!![]}];}_0x7251ae=_['merge']({},_0x7251ae,_0x2eb26d[_0x633c('0x4f')]);return db['VoiceContext']['find'](_0x7251ae)[_0x633c('0x2c')](handleEntityNotFound(_0x234b1a,null))[_0x633c('0x2c')](respondWithResult(_0x234b1a,null))['catch'](handleError(_0x234b1a,null));};exports['create']=function(_0x3f7a61,_0x302617,_0x5ced56){var _0x2ec1ea;return db[_0x633c('0x34')][_0x633c('0x50')](_0x3f7a61['body'],{'raw':!![]})[_0x633c('0x2c')](function(_0x465d6e){_0x2ec1ea=_0x465d6e;return db[_0x633c('0x34')][_0x633c('0x51')]({'raw':!![]});})[_0x633c('0x2c')](function(_0x4dce29){var _0x2ecfec=fs[_0x633c('0x52')](path[_0x633c('0x53')](config['root'],_0x633c('0x54')),_0x633c('0x55'));var _0x2b51c1=ejs[_0x633c('0x56')](_0x2ecfec,{'contexts':_0x4dce29||[]});fs[_0x633c('0x57')](_0x633c('0x58'),_0x2b51c1);})[_0x633c('0x2c')](function(){return respondWithRpcPromise(_0x633c('0x59'),'create',{'module':_0x633c('0x5a')});})[_0x633c('0x2c')](function(){var _0x41ebc4=_0x3f7a61['user'][_0x633c('0x2e')]({'plain':!![]});if(!_0x41ebc4)throw new Error(_0x633c('0x5b'));if(_0x41ebc4[_0x633c('0x5c')]===_0x633c('0x5d')){var _0xa31a6a=_0x2ec1ea[_0x633c('0x2e')]({'plain':!![]});return db[_0x633c('0x5e')][_0x633c('0x5f')]({'where':{'name':_0x633c('0x2f'),'userProfileId':_0x41ebc4[_0x633c('0x60')]},'raw':!![]})[_0x633c('0x2c')](function(_0x4b931b){if(_0x4b931b&&_0x4b931b[_0x633c('0x61')]===0x0){return db[_0x633c('0x30')][_0x633c('0x50')]({'name':_0xa31a6a[_0x633c('0x32')],'resourceId':_0xa31a6a['id'],'type':_0x4b931b[_0x633c('0x32')],'sectionId':_0x4b931b['id']},{})[_0x633c('0x2c')](function(){return _0x2ec1ea;});}else{return _0x2ec1ea;}})[_0x633c('0x22')](function(_0x1d0fef){logger['error'](_0x633c('0x62'),_0x1d0fef);throw _0x1d0fef;});}return _0x2ec1ea;})[_0x633c('0x2c')](respondWithResult(_0x302617,0xc9))[_0x633c('0x22')](handleError(_0x302617,null));};exports[_0x633c('0x63')]=function(_0x221352,_0x5f4ddc,_0x114a85){var _0x4c50c3;return db[_0x633c('0x34')][_0x633c('0x5f')]({'where':{'id':_0x221352[_0x633c('0x4e')]['id']}})[_0x633c('0x2c')](handleEntityNotFound(_0x5f4ddc,null))[_0x633c('0x2c')](saveUpdates(_0x221352[_0x633c('0x64')],null))[_0x633c('0x2c')](function(_0x157770){if(_0x157770){_0x4c50c3=_0x157770;return db['VoiceContext']['findAll']({'raw':!![]});}})['then'](function(_0x1af506){var _0x3e23bb=fs[_0x633c('0x52')](path[_0x633c('0x53')](config[_0x633c('0x65')],_0x633c('0x54')),_0x633c('0x55'));var _0x3f91fa=ejs[_0x633c('0x56')](_0x3e23bb,{'contexts':_0x1af506||[]});fs['writeFileSync'](_0x633c('0x58'),_0x3f91fa);})[_0x633c('0x2c')](function(){return respondWithRpcPromise(_0x633c('0x59'),_0x633c('0x63'),{'module':_0x633c('0x5a')});})[_0x633c('0x2c')](function(){return _0x4c50c3;})[_0x633c('0x2c')](respondWithResult(_0x5f4ddc,null))[_0x633c('0x22')](handleError(_0x5f4ddc,null));};exports[_0x633c('0x2d')]=function(_0x563798,_0x1e43ea,_0x35f434){var _0x1c86a9;return db[_0x633c('0x34')][_0x633c('0x5f')]({'where':{'id':_0x563798[_0x633c('0x4e')]['id']}})[_0x633c('0x2c')](handleEntityNotFound(_0x1e43ea,null))[_0x633c('0x2c')](removeEntity(_0x1e43ea,null))[_0x633c('0x2c')](function(){return db[_0x633c('0x34')][_0x633c('0x51')]({'raw':!![]});})[_0x633c('0x2c')](function(_0x22e56f){var _0x30021a=fs['readFileSync'](path['join'](config[_0x633c('0x65')],_0x633c('0x54')),'utf8');var _0x4131e2=ejs['render'](_0x30021a,{'contexts':_0x22e56f});fs[_0x633c('0x57')](_0x633c('0x58'),_0x4131e2);return respondWithRpcPromise(_0x633c('0x59'),_0x633c('0x2d'),{'module':_0x633c('0x5a')});})['catch'](handleError(_0x1e43ea,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 3816505..a5130ee 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 _0x9ec7=['util','../../config/logger','api','bluebird','request-promise','./voiceContext.attributes','exports','define'];(function(_0x2b7901,_0x57b9a4){var _0x21f893=function(_0x2a3274){while(--_0x2a3274){_0x2b7901['push'](_0x2b7901['shift']());}};_0x21f893(++_0x57b9a4);}(_0x9ec7,0xa0));var _0x79ec=function(_0x15df31,_0x57107c){_0x15df31=_0x15df31-0x0;var _0x5a463d=_0x9ec7[_0x15df31];return _0x5a463d;};'use strict';var _=require('lodash');var util=require(_0x79ec('0x0'));var logger=require(_0x79ec('0x1'))(_0x79ec('0x2'));var moment=require('moment');var BPromise=require(_0x79ec('0x3'));var rp=require(_0x79ec('0x4'));var attributes=require(_0x79ec('0x5'));module[_0x79ec('0x6')]=function(_0xd2b053,_0x177df6){return _0xd2b053[_0x79ec('0x7')]('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa206=['exports','define','voice_contexts','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1fe391,_0x3cbb76){var _0x1c4c7e=function(_0x140a4e){while(--_0x140a4e){_0x1fe391['push'](_0x1fe391['shift']());}};_0x1c4c7e(++_0x3cbb76);}(_0xa206,0x12b));var _0x6a20=function(_0x42877f,_0x381333){_0x42877f=_0x42877f-0x0;var _0x34c596=_0xa206[_0x42877f];return _0x34c596;};'use strict';var _=require('lodash');var util=require(_0x6a20('0x0'));var logger=require(_0x6a20('0x1'))('api');var moment=require(_0x6a20('0x2'));var BPromise=require(_0x6a20('0x3'));var rp=require(_0x6a20('0x4'));var attributes=require('./voiceContext.attributes');module[_0x6a20('0x5')]=function(_0x533376,_0x5b3c9b){return _0x533376[_0x6a20('0x6')]('VoiceContext',attributes,{'tableName':_0x6a20('0x7'),'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 9113b52..ee89eb3 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 _0x46cd=['client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x29851d,_0xbee999){var _0x10a007=function(_0x319bce){while(--_0x319bce){_0x29851d['push'](_0x29851d['shift']());}};_0x10a007(++_0xbee999);}(_0x46cd,0x9d));var _0xd46c=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x46cd[_0x344a3f];return _0x264712;};'use strict';var _=require(_0xd46c('0x0'));var util=require(_0xd46c('0x1'));var moment=require(_0xd46c('0x2'));var BPromise=require(_0xd46c('0x3'));var rs=require(_0xd46c('0x4'));var fs=require('fs');var Redis=require(_0xd46c('0x5'));var db=require(_0xd46c('0x6'))['db'];var utils=require(_0xd46c('0x7'));var logger=require(_0xd46c('0x8'))(_0xd46c('0x9'));var config=require(_0xd46c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xd46c('0xb')][_0xd46c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d6ac3,_0x17b91f,_0x427201){return new BPromise(function(_0x3c853d,_0x4f85a){return client['request'](_0x4d6ac3,_0x427201)[_0xd46c('0xd')](function(_0x42a7e8){logger[_0xd46c('0xe')](_0xd46c('0xf'),_0x17b91f,_0xd46c('0x10'));logger[_0xd46c('0x11')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x17b91f,_0xd46c('0x10'),JSON[_0xd46c('0x12')](_0x42a7e8));if(_0x42a7e8[_0xd46c('0x13')]){if(_0x42a7e8['error'][_0xd46c('0x14')]===0x1f4){logger[_0xd46c('0x13')](_0xd46c('0xf'),_0x17b91f,_0x42a7e8[_0xd46c('0x13')][_0xd46c('0x15')]);return _0x4f85a(_0x42a7e8['error'][_0xd46c('0x15')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x17b91f,_0x42a7e8[_0xd46c('0x13')][_0xd46c('0x15')]);return _0x3c853d(_0x42a7e8['error'][_0xd46c('0x15')]);}else{logger[_0xd46c('0xe')](_0xd46c('0xf'),_0x17b91f,_0xd46c('0x10'));_0x3c853d(_0x42a7e8[_0xd46c('0x16')][_0xd46c('0x15')]);}})[_0xd46c('0x17')](function(_0x359a82){logger[_0xd46c('0x13')](_0xd46c('0xf'),_0x17b91f,_0x359a82);_0x4f85a(_0x359a82);});});} \ No newline at end of file +var _0x984c=['info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x207811,_0x3420a6){var _0x170d56=function(_0x4340b7){while(--_0x4340b7){_0x207811['push'](_0x207811['shift']());}};_0x170d56(++_0x3420a6);}(_0x984c,0xab));var _0xc984=function(_0x497ab3,_0xb89638){_0x497ab3=_0x497ab3-0x0;var _0xe8fd5f=_0x984c[_0x497ab3];return _0xe8fd5f;};'use strict';var _=require(_0xc984('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc984('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc984('0x2'))(_0xc984('0x3'));var config=require(_0xc984('0x4'));var jayson=require(_0xc984('0x5'));var client=jayson[_0xc984('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3270ad,_0x197626,_0x4b86c2){return new BPromise(function(_0x57613a,_0x231a39){return client[_0xc984('0x7')](_0x3270ad,_0x4b86c2)[_0xc984('0x8')](function(_0xf5131d){logger[_0xc984('0x9')](_0xc984('0xa'),_0x197626,_0xc984('0xb'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x197626,_0xc984('0xb'),JSON[_0xc984('0xc')](_0xf5131d));if(_0xf5131d[_0xc984('0xd')]){if(_0xf5131d[_0xc984('0xd')][_0xc984('0xe')]===0x1f4){logger[_0xc984('0xd')](_0xc984('0xa'),_0x197626,_0xf5131d['error'][_0xc984('0xf')]);return _0x231a39(_0xf5131d[_0xc984('0xd')]['message']);}logger[_0xc984('0xd')](_0xc984('0xa'),_0x197626,_0xf5131d[_0xc984('0xd')]['message']);return _0x57613a(_0xf5131d[_0xc984('0xd')][_0xc984('0xf')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x197626,'request\x20sent');_0x57613a(_0xf5131d[_0xc984('0x10')][_0xc984('0xf')]);}})[_0xc984('0x11')](function(_0x482697){logger[_0xc984('0xd')](_0xc984('0xa'),_0x197626,_0x482697);_0x231a39(_0x482697);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index ab877bb..74da7b9 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 _0x4ffc=['destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','create'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x4ffc,0x1de));var _0xc4ff=function(_0xb26a90,_0x35cc71){_0xb26a90=_0xb26a90-0x0;var _0x147751=_0x4ffc[_0xb26a90];return _0x147751;};'use strict';var multer=require(_0xc4ff('0x0'));var util=require(_0xc4ff('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc4ff('0x2'));var router=express[_0xc4ff('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc4ff('0x4'));var config=require(_0xc4ff('0x5'));var controller=require(_0xc4ff('0x6'));router['get']('/',auth[_0xc4ff('0x7')](),controller[_0xc4ff('0x8')]);router['get'](_0xc4ff('0x9'),auth[_0xc4ff('0x7')](),controller[_0xc4ff('0xa')]);router[_0xc4ff('0xb')](_0xc4ff('0xc'),auth[_0xc4ff('0x7')](),controller[_0xc4ff('0xd')]);router['post']('/',auth[_0xc4ff('0x7')](),controller[_0xc4ff('0xe')]);router['put']('/:id',auth[_0xc4ff('0x7')](),controller['update']);router['delete'](_0xc4ff('0xc'),auth[_0xc4ff('0x7')](),controller[_0xc4ff('0xf')]);module[_0xc4ff('0x10')]=router; \ No newline at end of file +var _0xef82=['create','put','update','delete','destroy','exports','multer','util','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','index','get','isAuthenticated','describe','/:id','post'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0xef82,0x1e2));var _0x2ef8=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xef82[_0x411017];return _0x2adeea;};'use strict';var multer=require(_0x2ef8('0x0'));var util=require(_0x2ef8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2ef8('0x2'));var config=require(_0x2ef8('0x3'));var controller=require(_0x2ef8('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x2ef8('0x5')]);router[_0x2ef8('0x6')]('/describe',auth[_0x2ef8('0x7')](),controller[_0x2ef8('0x8')]);router[_0x2ef8('0x6')](_0x2ef8('0x9'),auth[_0x2ef8('0x7')](),controller['show']);router[_0x2ef8('0xa')]('/',auth[_0x2ef8('0x7')](),controller[_0x2ef8('0xb')]);router[_0x2ef8('0xc')](_0x2ef8('0x9'),auth[_0x2ef8('0x7')](),controller[_0x2ef8('0xd')]);router[_0x2ef8('0xe')](_0x2ef8('0x9'),auth[_0x2ef8('0x7')](),controller[_0x2ef8('0xf')]);module[_0x2ef8('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 95c1083..58a3d0f 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 _0x8cb5=['called,connect,complete','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0x8cb5,0x19f));var _0x58cb=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8cb5[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x58cb('0x0'));module[_0x58cb('0x1')]={'privilege':{'type':Sequelize[_0x58cb('0x2')]},'channel':{'type':Sequelize[_0x58cb('0x2')]},'channelstate':{'type':Sequelize[_0x58cb('0x3')]},'channelstatedesc':{'type':Sequelize[_0x58cb('0x2')]},'calleridnum':{'type':Sequelize[_0x58cb('0x2')]},'calleridname':{'type':Sequelize[_0x58cb('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x58cb('0x2')]},'language':{'type':Sequelize[_0x58cb('0x2')]},'accountcode':{'type':Sequelize[_0x58cb('0x2')]},'context':{'type':Sequelize[_0x58cb('0x2')]},'exten':{'type':Sequelize[_0x58cb('0x2')]},'priority':{'type':Sequelize[_0x58cb('0x3')]},'uniqueid':{'type':Sequelize[_0x58cb('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x58cb('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x58cb('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x58cb('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x58cb('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x58cb('0x2')]},'destlanguage':{'type':Sequelize[_0x58cb('0x2')]},'destaccountcode':{'type':Sequelize[_0x58cb('0x2')]},'destcontext':{'type':Sequelize[_0x58cb('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x58cb('0x3')]},'destuniqueid':{'type':Sequelize[_0x58cb('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x58cb('0x2')]},'dialstatus':{'type':Sequelize[_0x58cb('0x2')]},'starttime':{'type':Sequelize[_0x58cb('0x4')]},'answertime':{'type':Sequelize[_0x58cb('0x4')]},'endtime':{'type':Sequelize[_0x58cb('0x4')]},'lastevent':{'type':Sequelize[_0x58cb('0x2')],'comment':_0x58cb('0x5')},'routeId':{'type':Sequelize[_0x58cb('0x3')]},'duration':{'type':Sequelize[_0x58cb('0x3')]},'holdtime':{'type':Sequelize[_0x58cb('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7089=['sequelize','STRING','INTEGER','DATE'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7089,0xd8));var _0x9708=function(_0x46c529,_0x528177){_0x46c529=_0x46c529-0x0;var _0x1db0a4=_0x7089[_0x46c529];return _0x1db0a4;};'use strict';var Sequelize=require(_0x9708('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x9708('0x1')]},'channel':{'type':Sequelize[_0x9708('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9708('0x1')]},'calleridnum':{'type':Sequelize[_0x9708('0x1')]},'calleridname':{'type':Sequelize[_0x9708('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9708('0x1')]},'language':{'type':Sequelize[_0x9708('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9708('0x1')]},'exten':{'type':Sequelize[_0x9708('0x1')]},'priority':{'type':Sequelize[_0x9708('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x9708('0x1')]},'destchannel':{'type':Sequelize[_0x9708('0x1')]},'destchannelstate':{'type':Sequelize[_0x9708('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9708('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x9708('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x9708('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9708('0x1')]},'destexten':{'type':Sequelize[_0x9708('0x1')]},'destpriority':{'type':Sequelize[_0x9708('0x2')]},'destuniqueid':{'type':Sequelize[_0x9708('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x9708('0x1')]},'starttime':{'type':Sequelize[_0x9708('0x3')]},'answertime':{'type':Sequelize[_0x9708('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x9708('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x9708('0x2')]},'duration':{'type':Sequelize[_0x9708('0x2')]},'holdtime':{'type':Sequelize[_0x9708('0x2')]},'billableseconds':{'type':Sequelize[_0x9708('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index f8379fa..86fbd80 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 _0x9a27=['destroy','sendStatus','name','send','index','VoiceDialReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','findAll','catch','show','params','length','include','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','Content-Range','json','save','then'];(function(_0x2fd540,_0x2cdc12){var _0x105ae0=function(_0x465184){while(--_0x465184){_0x2fd540['push'](_0x2fd540['shift']());}};_0x105ae0(++_0x2cdc12);}(_0x9a27,0xfa));var _0x79a2=function(_0x5e367c,_0x273a44){_0x5e367c=_0x5e367c-0x0;var _0xe99baf=_0x9a27[_0x5e367c];return _0xe99baf;};'use strict';var pdf=require(_0x79a2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x79a2('0x1'));var zipdir=require(_0x79a2('0x2'));var jsonpatch=require(_0x79a2('0x3'));var rp=require('request-promise');var moment=require(_0x79a2('0x4'));var BPromise=require(_0x79a2('0x5'));var Mustache=require('mustache');var util=require(_0x79a2('0x6'));var path=require(_0x79a2('0x7'));var sox=require('sox');var csv=require(_0x79a2('0x8'));var ejs=require(_0x79a2('0x9'));var fs=require('fs');var _=require(_0x79a2('0xa'));var squel=require(_0x79a2('0xb'));var crypto=require(_0x79a2('0xc'));var jsforce=require(_0x79a2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x79a2('0x8'));var querystring=require(_0x79a2('0xe'));var Papa=require(_0x79a2('0xf'));var authService=require(_0x79a2('0x10'));var hardwareService=require(_0x79a2('0x11'));var Redis=require(_0x79a2('0x12'));var qs=require(_0x79a2('0x13'));var logger=require(_0x79a2('0x14'))(_0x79a2('0x15'));var utils=require(_0x79a2('0x16'));var config=require(_0x79a2('0x17'));var db=require(_0x79a2('0x18'))['db'];function respondWithStatusCode(_0x51c727,_0x2f16e6){_0x2f16e6=_0x2f16e6||0xcc;return function(_0x4aead3){if(_0x4aead3){return _0x51c727['sendStatus'](_0x2f16e6);}return _0x51c727[_0x79a2('0x19')](_0x2f16e6)[_0x79a2('0x1a')]();};}function respondWithResult(_0x29e09a,_0x383e1c){_0x383e1c=_0x383e1c||0xc8;return function(_0x266b40){if(_0x266b40){return _0x29e09a[_0x79a2('0x19')](_0x383e1c)['json'](_0x266b40);}};}function respondWithFilteredResult(_0xea36a8,_0x330d6f){return function(_0x1a05eb){if(_0x1a05eb){var _0x5d0e93=_0x1a05eb[_0x79a2('0x1b')],_0xed7982=_0x330d6f[_0x79a2('0x1c')],_0x1c1c6a=_0x330d6f[_0x79a2('0x1c')]+_0x330d6f[_0x79a2('0x1d')],_0x1fd71c;if(_0x1c1c6a>=_0x5d0e93){_0x1c1c6a=_0x5d0e93;_0x1fd71c=0xc8;}else{_0x1fd71c=0xce;}_0xea36a8[_0x79a2('0x19')](_0x1fd71c);return _0xea36a8['set'](_0x79a2('0x1e'),_0xed7982+'-'+_0x1c1c6a+'/'+_0x5d0e93)[_0x79a2('0x1f')](_0x1a05eb);}return null;};}function patchUpdates(_0x128a2b){return function(_0x4bbdd0){try{jsonpatch['apply'](_0x4bbdd0,_0x128a2b,!![]);}catch(_0x479604){return BPromise['reject'](_0x479604);}return _0x4bbdd0[_0x79a2('0x20')]();};}function saveUpdates(_0x1ba8b5,_0x13fdc8){return function(_0x50b79f){if(_0x50b79f){return _0x50b79f['update'](_0x1ba8b5)[_0x79a2('0x21')](function(_0x474c1a){return _0x474c1a;});}return null;};}function removeEntity(_0x3db145,_0xa7e9b8){return function(_0x5afdf0){if(_0x5afdf0){return _0x5afdf0[_0x79a2('0x22')]()[_0x79a2('0x21')](function(){_0x3db145[_0x79a2('0x19')](0xcc)[_0x79a2('0x1a')]();});}};}function handleEntityNotFound(_0x49238b,_0x510066){return function(_0x6f638e){if(!_0x6f638e){_0x49238b[_0x79a2('0x23')](0x194);}return _0x6f638e;};}function handleError(_0x4201cf,_0x39a54e){_0x39a54e=_0x39a54e||0x1f4;return function(_0x1a18c5){logger['error'](_0x1a18c5['stack']);if(_0x1a18c5[_0x79a2('0x24')]){delete _0x1a18c5[_0x79a2('0x24')];}_0x4201cf[_0x79a2('0x19')](_0x39a54e)[_0x79a2('0x25')](_0x1a18c5);};}exports[_0x79a2('0x26')]=function(_0xfa917e,_0x1e3345){var _0x22aad5={},_0x235dbc={},_0x267dfd={'count':0x0,'rows':[]};var _0x3dc247=db[_0x79a2('0x27')][_0x79a2('0x28')];_0x235dbc[_0x79a2('0x29')]=_[_0x79a2('0x2a')](_0x3dc247);_0x235dbc[_0x79a2('0x2b')]=_['keys'](_0xfa917e['query']);_0x235dbc[_0x79a2('0x2c')]=_['intersection'](_0x235dbc['model'],_0x235dbc[_0x79a2('0x2b')]);_0x22aad5[_0x79a2('0x2d')]=_[_0x79a2('0x2e')](_0x235dbc[_0x79a2('0x29')],qs[_0x79a2('0x2f')](_0xfa917e['query'][_0x79a2('0x2f')]));_0x22aad5[_0x79a2('0x2d')]=_0x22aad5['attributes']['length']?_0x22aad5[_0x79a2('0x2d')]:_0x235dbc['model'];if(!_0xfa917e[_0x79a2('0x2b')]['hasOwnProperty'](_0x79a2('0x30'))){_0x22aad5[_0x79a2('0x1d')]=qs[_0x79a2('0x1d')](_0xfa917e[_0x79a2('0x2b')][_0x79a2('0x1d')]);_0x22aad5[_0x79a2('0x1c')]=qs['offset'](_0xfa917e[_0x79a2('0x2b')][_0x79a2('0x1c')]);}_0x22aad5[_0x79a2('0x31')]=qs[_0x79a2('0x32')](_0xfa917e[_0x79a2('0x2b')]['sort']);_0x22aad5[_0x79a2('0x33')]=qs['filters'](_[_0x79a2('0x34')](_0xfa917e[_0x79a2('0x2b')],_0x235dbc[_0x79a2('0x2c')]));if(_0xfa917e[_0x79a2('0x2b')][_0x79a2('0x35')]){_0x22aad5[_0x79a2('0x33')]=_[_0x79a2('0x36')](_0x22aad5[_0x79a2('0x33')],{'$or':_[_0x79a2('0x37')](_0x3dc247,function(_0x174d22){if(_0x174d22[_0x79a2('0x38')]['key']!==_0x79a2('0x39')){var _0x42b9be={};_0x42b9be[_0x174d22['field']]={'$like':'%'+_0xfa917e[_0x79a2('0x2b')][_0x79a2('0x35')]+'%'};return _0x42b9be;}})});}_0x22aad5=_[_0x79a2('0x36')]({},_0x22aad5,_0xfa917e[_0x79a2('0x3a')]);var _0xf852f={'where':_0x22aad5[_0x79a2('0x33')]};return db[_0x79a2('0x27')][_0x79a2('0x1b')](_0xf852f)['then'](function(_0x1ef507){_0x267dfd[_0x79a2('0x1b')]=_0x1ef507;if(_0xfa917e[_0x79a2('0x2b')][_0x79a2('0x3b')]){_0x22aad5['include']=[{'all':!![]}];}return db[_0x79a2('0x27')][_0x79a2('0x3c')](_0x22aad5);})[_0x79a2('0x21')](function(_0x174b0e){_0x267dfd['rows']=_0x174b0e;return _0x267dfd;})[_0x79a2('0x21')](respondWithFilteredResult(_0x1e3345,_0x22aad5))[_0x79a2('0x3d')](handleError(_0x1e3345,null));};exports[_0x79a2('0x3e')]=function(_0x50f481,_0x2f5e19){var _0x1b41ca={'raw':!![],'where':{'id':_0x50f481[_0x79a2('0x3f')]['id']}},_0xfe7ca9={};_0xfe7ca9[_0x79a2('0x29')]=_[_0x79a2('0x2a')](db[_0x79a2('0x27')][_0x79a2('0x28')]);_0xfe7ca9[_0x79a2('0x2b')]=_[_0x79a2('0x2a')](_0x50f481[_0x79a2('0x2b')]);_0xfe7ca9['filters']=_['intersection'](_0xfe7ca9[_0x79a2('0x29')],_0xfe7ca9['query']);_0x1b41ca[_0x79a2('0x2d')]=_[_0x79a2('0x2e')](_0xfe7ca9[_0x79a2('0x29')],qs[_0x79a2('0x2f')](_0x50f481['query'][_0x79a2('0x2f')]));_0x1b41ca[_0x79a2('0x2d')]=_0x1b41ca[_0x79a2('0x2d')][_0x79a2('0x40')]?_0x1b41ca['attributes']:_0xfe7ca9[_0x79a2('0x29')];if(_0x50f481[_0x79a2('0x2b')][_0x79a2('0x3b')]){_0x1b41ca[_0x79a2('0x41')]=[{'all':!![]}];}_0x1b41ca=_['merge']({},_0x1b41ca,_0x50f481[_0x79a2('0x3a')]);return db[_0x79a2('0x27')][_0x79a2('0x42')](_0x1b41ca)[_0x79a2('0x21')](handleEntityNotFound(_0x2f5e19,null))[_0x79a2('0x21')](respondWithResult(_0x2f5e19,null))['catch'](handleError(_0x2f5e19,null));};exports[_0x79a2('0x43')]=function(_0x4c0fd3,_0x37574e){return db[_0x79a2('0x27')][_0x79a2('0x43')](_0x4c0fd3[_0x79a2('0x44')],{})['then'](respondWithResult(_0x37574e,0xc9))[_0x79a2('0x3d')](handleError(_0x37574e,null));};exports[_0x79a2('0x45')]=function(_0x5a9924,_0xf75040){if(_0x5a9924['body']['id']){delete _0x5a9924[_0x79a2('0x44')]['id'];}return db[_0x79a2('0x27')]['find']({'where':{'id':_0x5a9924['params']['id']}})[_0x79a2('0x21')](handleEntityNotFound(_0xf75040,null))[_0x79a2('0x21')](saveUpdates(_0x5a9924['body'],null))[_0x79a2('0x21')](respondWithResult(_0xf75040,null))[_0x79a2('0x3d')](handleError(_0xf75040,null));};exports['destroy']=function(_0x1eb468,_0x16262a){return db[_0x79a2('0x27')]['find']({'where':{'id':_0x1eb468[_0x79a2('0x3f')]['id']}})[_0x79a2('0x21')](handleEntityNotFound(_0x16262a,null))[_0x79a2('0x21')](removeEntity(_0x16262a,null))['catch'](handleError(_0x16262a,null));};exports['describe']=function(_0x4e64cd,_0x5ee1f8){return db['VoiceDialReport'][_0x79a2('0x46')]()[_0x79a2('0x21')](respondWithResult(_0x5ee1f8,null))[_0x79a2('0x3d')](handleError(_0x5ee1f8,null));}; \ No newline at end of file +var _0xfb22=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','options','includeAll','include','VoiceDialReport','findAll','rows','show','params','find','create','catch','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','destroy','end','error','stack','name','index','model','keys','query','filters','intersection'];(function(_0x5d3b1c,_0x3b4a74){var _0x4dc4dd=function(_0x404f8f){while(--_0x404f8f){_0x5d3b1c['push'](_0x5d3b1c['shift']());}};_0x4dc4dd(++_0x3b4a74);}(_0xfb22,0x1b2));var _0x2fb2=function(_0x1bb0b8,_0x24add2){_0x1bb0b8=_0x1bb0b8-0x0;var _0x22fc67=_0xfb22[_0x1bb0b8];return _0x22fc67;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2fb2('0x0'));var rimraf=require(_0x2fb2('0x1'));var zipdir=require(_0x2fb2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2fb2('0x3'));var moment=require(_0x2fb2('0x4'));var BPromise=require(_0x2fb2('0x5'));var Mustache=require(_0x2fb2('0x6'));var util=require('util');var path=require(_0x2fb2('0x7'));var sox=require('sox');var csv=require(_0x2fb2('0x8'));var ejs=require(_0x2fb2('0x9'));var fs=require('fs');var _=require(_0x2fb2('0xa'));var squel=require(_0x2fb2('0xb'));var crypto=require(_0x2fb2('0xc'));var jsforce=require(_0x2fb2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2fb2('0x8'));var querystring=require(_0x2fb2('0xe'));var Papa=require(_0x2fb2('0xf'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x2fb2('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x2fb2('0x11'))('api');var utils=require(_0x2fb2('0x12'));var config=require(_0x2fb2('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x488aab,_0x3eb321){_0x3eb321=_0x3eb321||0xcc;return function(_0x4c97ee){if(_0x4c97ee){return _0x488aab[_0x2fb2('0x14')](_0x3eb321);}return _0x488aab[_0x2fb2('0x15')](_0x3eb321)['end']();};}function respondWithResult(_0x3818c3,_0x447a98){_0x447a98=_0x447a98||0xc8;return function(_0x2a33dd){if(_0x2a33dd){return _0x3818c3[_0x2fb2('0x15')](_0x447a98)[_0x2fb2('0x16')](_0x2a33dd);}};}function respondWithFilteredResult(_0x1c8c89,_0x1441c6){return function(_0xf0c119){if(_0xf0c119){var _0x3c73cb=_0xf0c119[_0x2fb2('0x17')],_0xaabc1b=_0x1441c6['offset'],_0x4b25e2=_0x1441c6[_0x2fb2('0x18')]+_0x1441c6[_0x2fb2('0x19')],_0x4e7592;if(_0x4b25e2>=_0x3c73cb){_0x4b25e2=_0x3c73cb;_0x4e7592=0xc8;}else{_0x4e7592=0xce;}_0x1c8c89['status'](_0x4e7592);return _0x1c8c89[_0x2fb2('0x1a')]('Content-Range',_0xaabc1b+'-'+_0x4b25e2+'/'+_0x3c73cb)[_0x2fb2('0x16')](_0xf0c119);}return null;};}function patchUpdates(_0x2a44fe){return function(_0x18eaa4){try{jsonpatch[_0x2fb2('0x1b')](_0x18eaa4,_0x2a44fe,!![]);}catch(_0x43879c){return BPromise[_0x2fb2('0x1c')](_0x43879c);}return _0x18eaa4['save']();};}function saveUpdates(_0x50c827,_0x133d4e){return function(_0x23aeee){if(_0x23aeee){return _0x23aeee[_0x2fb2('0x1d')](_0x50c827)[_0x2fb2('0x1e')](function(_0x170eda){return _0x170eda;});}return null;};}function removeEntity(_0x19bd27,_0x558c94){return function(_0x5e44b4){if(_0x5e44b4){return _0x5e44b4[_0x2fb2('0x1f')]()['then'](function(){_0x19bd27[_0x2fb2('0x15')](0xcc)[_0x2fb2('0x20')]();});}};}function handleEntityNotFound(_0x2e9263,_0x3b2ecf){return function(_0x46ba81){if(!_0x46ba81){_0x2e9263[_0x2fb2('0x14')](0x194);}return _0x46ba81;};}function handleError(_0x7e22a0,_0x2799c0){_0x2799c0=_0x2799c0||0x1f4;return function(_0x1a8ad6){logger[_0x2fb2('0x21')](_0x1a8ad6[_0x2fb2('0x22')]);if(_0x1a8ad6[_0x2fb2('0x23')]){delete _0x1a8ad6[_0x2fb2('0x23')];}_0x7e22a0[_0x2fb2('0x15')](_0x2799c0)['send'](_0x1a8ad6);};}exports[_0x2fb2('0x24')]=function(_0xc6db97,_0x51ce80){var _0xeb65e8={},_0x2ad167={},_0x51f999={'count':0x0,'rows':[]};var _0x10d744=db['VoiceDialReport']['rawAttributes'];_0x2ad167[_0x2fb2('0x25')]=_[_0x2fb2('0x26')](_0x10d744);_0x2ad167[_0x2fb2('0x27')]=_['keys'](_0xc6db97['query']);_0x2ad167[_0x2fb2('0x28')]=_[_0x2fb2('0x29')](_0x2ad167[_0x2fb2('0x25')],_0x2ad167[_0x2fb2('0x27')]);_0xeb65e8[_0x2fb2('0x2a')]=_[_0x2fb2('0x29')](_0x2ad167['model'],qs[_0x2fb2('0x2b')](_0xc6db97[_0x2fb2('0x27')][_0x2fb2('0x2b')]));_0xeb65e8[_0x2fb2('0x2a')]=_0xeb65e8[_0x2fb2('0x2a')]['length']?_0xeb65e8[_0x2fb2('0x2a')]:_0x2ad167['model'];if(!_0xc6db97[_0x2fb2('0x27')][_0x2fb2('0x2c')](_0x2fb2('0x2d'))){_0xeb65e8[_0x2fb2('0x19')]=qs[_0x2fb2('0x19')](_0xc6db97['query'][_0x2fb2('0x19')]);_0xeb65e8[_0x2fb2('0x18')]=qs[_0x2fb2('0x18')](_0xc6db97['query']['offset']);}_0xeb65e8[_0x2fb2('0x2e')]=qs[_0x2fb2('0x2f')](_0xc6db97[_0x2fb2('0x27')][_0x2fb2('0x2f')]);_0xeb65e8[_0x2fb2('0x30')]=qs[_0x2fb2('0x28')](_[_0x2fb2('0x31')](_0xc6db97[_0x2fb2('0x27')],_0x2ad167[_0x2fb2('0x28')]));if(_0xc6db97[_0x2fb2('0x27')][_0x2fb2('0x32')]){_0xeb65e8[_0x2fb2('0x30')]=_[_0x2fb2('0x33')](_0xeb65e8[_0x2fb2('0x30')],{'$or':_[_0x2fb2('0x34')](_0x10d744,function(_0x4a07ac){if(_0x4a07ac[_0x2fb2('0x35')][_0x2fb2('0x36')]!=='VIRTUAL'){var _0xeeeca1={};_0xeeeca1[_0x4a07ac['field']]={'$like':'%'+_0xc6db97[_0x2fb2('0x27')][_0x2fb2('0x32')]+'%'};return _0xeeeca1;}})});}_0xeb65e8=_[_0x2fb2('0x33')]({},_0xeb65e8,_0xc6db97[_0x2fb2('0x37')]);var _0x27b356={'where':_0xeb65e8['where']};return db['VoiceDialReport'][_0x2fb2('0x17')](_0x27b356)[_0x2fb2('0x1e')](function(_0x2b9015){_0x51f999[_0x2fb2('0x17')]=_0x2b9015;if(_0xc6db97['query'][_0x2fb2('0x38')]){_0xeb65e8[_0x2fb2('0x39')]=[{'all':!![]}];}return db[_0x2fb2('0x3a')][_0x2fb2('0x3b')](_0xeb65e8);})[_0x2fb2('0x1e')](function(_0x493f11){_0x51f999[_0x2fb2('0x3c')]=_0x493f11;return _0x51f999;})['then'](respondWithFilteredResult(_0x51ce80,_0xeb65e8))['catch'](handleError(_0x51ce80,null));};exports[_0x2fb2('0x3d')]=function(_0x3ea428,_0x9c7a76){var _0x1ee24d={'raw':!![],'where':{'id':_0x3ea428[_0x2fb2('0x3e')]['id']}},_0x464ff7={};_0x464ff7[_0x2fb2('0x25')]=_[_0x2fb2('0x26')](db['VoiceDialReport']['rawAttributes']);_0x464ff7[_0x2fb2('0x27')]=_['keys'](_0x3ea428['query']);_0x464ff7[_0x2fb2('0x28')]=_[_0x2fb2('0x29')](_0x464ff7[_0x2fb2('0x25')],_0x464ff7[_0x2fb2('0x27')]);_0x1ee24d[_0x2fb2('0x2a')]=_['intersection'](_0x464ff7[_0x2fb2('0x25')],qs[_0x2fb2('0x2b')](_0x3ea428[_0x2fb2('0x27')][_0x2fb2('0x2b')]));_0x1ee24d['attributes']=_0x1ee24d[_0x2fb2('0x2a')]['length']?_0x1ee24d['attributes']:_0x464ff7[_0x2fb2('0x25')];if(_0x3ea428[_0x2fb2('0x27')][_0x2fb2('0x38')]){_0x1ee24d[_0x2fb2('0x39')]=[{'all':!![]}];}_0x1ee24d=_[_0x2fb2('0x33')]({},_0x1ee24d,_0x3ea428[_0x2fb2('0x37')]);return db[_0x2fb2('0x3a')][_0x2fb2('0x3f')](_0x1ee24d)['then'](handleEntityNotFound(_0x9c7a76,null))[_0x2fb2('0x1e')](respondWithResult(_0x9c7a76,null))['catch'](handleError(_0x9c7a76,null));};exports[_0x2fb2('0x40')]=function(_0x30bf51,_0x4b76ab){return db[_0x2fb2('0x3a')][_0x2fb2('0x40')](_0x30bf51['body'],{})[_0x2fb2('0x1e')](respondWithResult(_0x4b76ab,0xc9))[_0x2fb2('0x41')](handleError(_0x4b76ab,null));};exports[_0x2fb2('0x1d')]=function(_0x2d395d,_0x3e57f3){if(_0x2d395d['body']['id']){delete _0x2d395d[_0x2fb2('0x42')]['id'];}return db[_0x2fb2('0x3a')][_0x2fb2('0x3f')]({'where':{'id':_0x2d395d[_0x2fb2('0x3e')]['id']}})[_0x2fb2('0x1e')](handleEntityNotFound(_0x3e57f3,null))[_0x2fb2('0x1e')](saveUpdates(_0x2d395d[_0x2fb2('0x42')],null))[_0x2fb2('0x1e')](respondWithResult(_0x3e57f3,null))[_0x2fb2('0x41')](handleError(_0x3e57f3,null));};exports[_0x2fb2('0x1f')]=function(_0x436ef2,_0x2d128c){return db['VoiceDialReport'][_0x2fb2('0x3f')]({'where':{'id':_0x436ef2[_0x2fb2('0x3e')]['id']}})[_0x2fb2('0x1e')](handleEntityNotFound(_0x2d128c,null))[_0x2fb2('0x1e')](removeEntity(_0x2d128c,null))[_0x2fb2('0x41')](handleError(_0x2d128c,null));};exports[_0x2fb2('0x43')]=function(_0x589406,_0x12a947){return db[_0x2fb2('0x3a')][_0x2fb2('0x43')]()[_0x2fb2('0x1e')](respondWithResult(_0x12a947,null))['catch'](handleError(_0x12a947,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 2b8b7fd..50c2139 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 _0x76f2=['./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xf27bea,_0x8566d0){var _0x28c32b=function(_0x3ccc27){while(--_0x3ccc27){_0xf27bea['push'](_0xf27bea['shift']());}};_0x28c32b(++_0x8566d0);}(_0x76f2,0x125));var _0x276f=function(_0x1c1d0a,_0x4c11cc){_0x1c1d0a=_0x1c1d0a-0x0;var _0x8733d8=_0x76f2[_0x1c1d0a];return _0x8733d8;};'use strict';var _=require(_0x276f('0x0'));var util=require(_0x276f('0x1'));var logger=require(_0x276f('0x2'))(_0x276f('0x3'));var moment=require(_0x276f('0x4'));var BPromise=require(_0x276f('0x5'));var rp=require(_0x276f('0x6'));var attributes=require(_0x276f('0x7'));module[_0x276f('0x8')]=function(_0xb8fc27,_0x533ae2){return _0xb8fc27['define'](_0x276f('0x9'),attributes,{'tableName':_0x276f('0xa'),'paranoid':![],'indexes':[{'fields':[_0x276f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x42ea=['exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x9b4cda,_0x206ec1){var _0x1ac6c5=function(_0x4ba0a3){while(--_0x4ba0a3){_0x9b4cda['push'](_0x9b4cda['shift']());}};_0x1ac6c5(++_0x206ec1);}(_0x42ea,0x1de));var _0xa42e=function(_0x49b379,_0x293993){_0x49b379=_0x49b379-0x0;var _0x4cd09b=_0x42ea[_0x49b379];return _0x4cd09b;};'use strict';var _=require(_0xa42e('0x0'));var util=require(_0xa42e('0x1'));var logger=require(_0xa42e('0x2'))('api');var moment=require(_0xa42e('0x3'));var BPromise=require(_0xa42e('0x4'));var rp=require(_0xa42e('0x5'));var attributes=require('./voiceDialReport.attributes');module[_0xa42e('0x6')]=function(_0xe55f2b,_0x2d5aa7){return _0xe55f2b[_0xa42e('0x7')](_0xa42e('0x8'),attributes,{'tableName':_0xa42e('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa42e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index c810388..0bcc0f5 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 _0xfb3f=['body','options','raw','UpdateVoiceDialReport','update','where','attributes','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateVoiceDialReport','VoiceDialReport'];(function(_0x4e18b5,_0x57bd7e){var _0x53533a=function(_0x2c4919){while(--_0x2c4919){_0x4e18b5['push'](_0x4e18b5['shift']());}};_0x53533a(++_0x57bd7e);}(_0xfb3f,0xd9));var _0xffb3=function(_0x4abb9b,_0xeeaa49){_0x4abb9b=_0x4abb9b-0x0;var _0x4c377c=_0xfb3f[_0x4abb9b];return _0x4c377c;};'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']('VoiceDialReport,\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')]['create'](_0x167ed7[_0xffb3('0x17')],{'raw':_0x167ed7[_0xffb3('0x18')]?_0x167ed7['options'][_0xffb3('0x19')]===undefined?!![]:![]:!![]})[_0xffb3('0xb')](function(_0x223ad5){logger[_0xffb3('0x13')](_0xffb3('0x15'),_0x167ed7);logger[_0xffb3('0xe')](_0xffb3('0x15'),_0x167ed7,JSON['stringify'](_0x223ad5));_0x3b35de(_0x223ad5);})[_0xffb3('0x14')](function(_0xe4c60e){logger['error'](_0xffb3('0x15'),_0xe4c60e['message'],_0x167ed7);_0x30f403(_0x57d096['error'](0x1f4,_0xe4c60e[_0xffb3('0x12')]));});});};exports[_0xffb3('0x1a')]=function(_0x22bbea){var _0x3bc410=this;return new Promise(function(_0x1c4ded,_0x146708){return db['VoiceDialReport'][_0xffb3('0x1b')](_0x22bbea['body'],{'raw':_0x22bbea[_0xffb3('0x18')]?_0x22bbea[_0xffb3('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22bbea[_0xffb3('0x18')]?_0x22bbea['options'][_0xffb3('0x1c')]||null:null,'attributes':_0x22bbea[_0xffb3('0x18')]?_0x22bbea[_0xffb3('0x18')][_0xffb3('0x1d')]||null:null,'limit':_0x22bbea['options']?_0x22bbea['options']['limit']||null:null})['then'](function(_0xe3d338){logger['info'](_0xffb3('0x1a'),_0x22bbea);logger[_0xffb3('0xe')](_0xffb3('0x1a'),_0x22bbea,JSON[_0xffb3('0x10')](_0xe3d338));_0x1c4ded(_0xe3d338);})['catch'](function(_0x282f46){logger[_0xffb3('0x11')]('UpdateVoiceDialReport',_0x282f46[_0xffb3('0x12')],_0x22bbea);_0x146708(_0x3bc410[_0xffb3('0x11')](0x1f4,_0x282f46[_0xffb3('0x12')]));});});}; \ No newline at end of file +var _0x8128=['message','VoiceDialReport','create','options','raw','then','CreateVoiceDialReport','catch','UpdateVoiceDialReport','update','body','where','attributes','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x42e8f3,_0x5c8dba){var _0x47feab=function(_0x35fbf7){while(--_0x35fbf7){_0x42e8f3['push'](_0x42e8f3['shift']());}};_0x47feab(++_0x5c8dba);}(_0x8128,0x1b1));var _0x8812=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x8128[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x8812('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8812('0x1'));var rs=require(_0x8812('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8812('0x3'));var logger=require(_0x8812('0x4'))(_0x8812('0x5'));var config=require('../../config/environment');var jayson=require(_0x8812('0x6'));var client=jayson[_0x8812('0x7')][_0x8812('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16bafa,_0x480d1f,_0xfdd696){return new BPromise(function(_0x3d030b,_0x4e5012){return client['request'](_0x16bafa,_0xfdd696)['then'](function(_0x2bc882){logger[_0x8812('0x9')](_0x8812('0xa'),_0x480d1f,_0x8812('0xb'));logger[_0x8812('0xc')](_0x8812('0xd'),_0x480d1f,_0x8812('0xb'),JSON[_0x8812('0xe')](_0x2bc882));if(_0x2bc882[_0x8812('0xf')]){if(_0x2bc882['error'][_0x8812('0x10')]===0x1f4){logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')][_0x8812('0x11')]);return _0x4e5012(_0x2bc882[_0x8812('0xf')]['message']);}logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')]['message']);return _0x3d030b(_0x2bc882['error'][_0x8812('0x11')]);}else{logger[_0x8812('0x9')]('VoiceDialReport,\x20%s,\x20%s',_0x480d1f,'request\x20sent');_0x3d030b(_0x2bc882['result']['message']);}})['catch'](function(_0xa2a8cc){logger['error'](_0x8812('0xa'),_0x480d1f,_0xa2a8cc);_0x4e5012(_0xa2a8cc);});});}exports['CreateVoiceDialReport']=function(_0x447f9b){var _0x38a8ad=this;return new Promise(function(_0x4ae563,_0x23c224){return db[_0x8812('0x12')][_0x8812('0x13')](_0x447f9b['body'],{'raw':_0x447f9b['options']?_0x447f9b[_0x8812('0x14')][_0x8812('0x15')]===undefined?!![]:![]:!![]})[_0x8812('0x16')](function(_0x38a2df){logger[_0x8812('0x9')](_0x8812('0x17'),_0x447f9b);logger['debug'](_0x8812('0x17'),_0x447f9b,JSON[_0x8812('0xe')](_0x38a2df));_0x4ae563(_0x38a2df);})[_0x8812('0x18')](function(_0x5e2280){logger[_0x8812('0xf')](_0x8812('0x17'),_0x5e2280['message'],_0x447f9b);_0x23c224(_0x38a8ad[_0x8812('0xf')](0x1f4,_0x5e2280['message']));});});};exports[_0x8812('0x19')]=function(_0x16e486){var _0x8871d0=this;return new Promise(function(_0x50fb13,_0x22fb2d){return db[_0x8812('0x12')][_0x8812('0x1a')](_0x16e486[_0x8812('0x1b')],{'raw':_0x16e486['options']?_0x16e486[_0x8812('0x14')][_0x8812('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16e486[_0x8812('0x14')]?_0x16e486[_0x8812('0x14')][_0x8812('0x1c')]||null:null,'attributes':_0x16e486[_0x8812('0x14')]?_0x16e486[_0x8812('0x14')][_0x8812('0x1d')]||null:null,'limit':_0x16e486[_0x8812('0x14')]?_0x16e486[_0x8812('0x14')]['limit']||null:null})['then'](function(_0x584bcf){logger['info'](_0x8812('0x19'),_0x16e486);logger[_0x8812('0xc')](_0x8812('0x19'),_0x16e486,JSON[_0x8812('0xe')](_0x584bcf));_0x50fb13(_0x584bcf);})[_0x8812('0x18')](function(_0x54bec0){logger[_0x8812('0xf')](_0x8812('0x19'),_0x54bec0[_0x8812('0x11')],_0x16e486);_0x22fb2d(_0x8871d0[_0x8812('0xf')](0x1f4,_0x54bec0['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 614eb57..24fa8ef 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 _0x1131=['get','index','/:id','post','isAuthenticated','create','/:id/applications','addApplications','update','delete','destroy','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller'];(function(_0x32ebf2,_0x596f5d){var _0x5d798d=function(_0x2b038d){while(--_0x2b038d){_0x32ebf2['push'](_0x32ebf2['shift']());}};_0x5d798d(++_0x596f5d);}(_0x1131,0x71));var _0x1113=function(_0x524f89,_0x1db152){_0x524f89=_0x524f89-0x0;var _0x46535d=_0x1131[_0x524f89];return _0x46535d;};'use strict';var multer=require('multer');var util=require(_0x1113('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1113('0x1')]();var auth=require(_0x1113('0x2'));var interaction=require(_0x1113('0x3'));var config=require(_0x1113('0x4'));var controller=require(_0x1113('0x5'));router[_0x1113('0x6')]('/',auth['isAuthenticated'](),controller[_0x1113('0x7')]);router['get'](_0x1113('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x1113('0x9')]('/',auth[_0x1113('0xa')](),controller[_0x1113('0xb')]);router[_0x1113('0x9')](_0x1113('0xc'),auth[_0x1113('0xa')](),controller[_0x1113('0xd')]);router['put']('/:id',auth[_0x1113('0xa')](),controller[_0x1113('0xe')]);router[_0x1113('0xf')]('/:id',auth[_0x1113('0xa')](),controller[_0x1113('0x10')]);module['exports']=router; \ No newline at end of file +var _0x8227=['update','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','/:id/applications','addApplications','put'];(function(_0x581880,_0x25f90b){var _0x32f28c=function(_0x198268){while(--_0x198268){_0x581880['push'](_0x581880['shift']());}};_0x32f28c(++_0x25f90b);}(_0x8227,0x146));var _0x7822=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8227[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x7822('0x0'));var path=require('path');var timeout=require(_0x7822('0x1'));var express=require(_0x7822('0x2'));var router=express[_0x7822('0x3')]();var auth=require(_0x7822('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7822('0x5'));var controller=require(_0x7822('0x6'));router[_0x7822('0x7')]('/',auth[_0x7822('0x8')](),controller[_0x7822('0x9')]);router[_0x7822('0x7')](_0x7822('0xa'),auth[_0x7822('0x8')](),controller['show']);router[_0x7822('0xb')]('/',auth['isAuthenticated'](),controller[_0x7822('0xc')]);router[_0x7822('0xb')](_0x7822('0xd'),auth[_0x7822('0x8')](),controller[_0x7822('0xe')]);router[_0x7822('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7822('0x10')]);router['delete'](_0x7822('0xa'),auth[_0x7822('0x8')](),controller[_0x7822('0x11')]);module[_0x7822('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index ed62f25..d937350 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 _0x9348=['compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax','system','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x9348,0x10d));var _0x8934=function(_0x42383e,_0x1dbac2){_0x42383e=_0x42383e-0x0;var _0x5e4c8f=_0x9348[_0x42383e];return _0x5e4c8f;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'context':{'type':Sequelize[_0x8934('0x2')],'allowNull':![],'unique':_0x8934('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x8934('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x8934('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x8934('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x8934('0x2')],'allowNull':![],'defaultValue':_0x8934('0x4')},'appdata':{'type':Sequelize[_0x8934('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x8934('0x5')](_0x8934('0x6'),_0x8934('0x7'),'internal',_0x8934('0x8'),_0x8934('0x9'),_0x8934('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x8934('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x8934('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x8934('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x8934('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x8934('0xb')]},'recordingFormat':{'type':Sequelize[_0x8934('0x2')],'defaultValue':_0x8934('0xd')},'answer':{'type':Sequelize[_0x8934('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x8934('0xe')],'get':function(_0x4a999c){return this[_0x8934('0xf')](_0x8934('0x10'));}}}; \ No newline at end of file +var _0xec56=['VIRTUAL','getDataValue','exten','sequelize','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN'];(function(_0xe52228,_0xd04430){var _0x13d4c3=function(_0x5e5f42){while(--_0x5e5f42){_0xe52228['push'](_0xe52228['shift']());}};_0x13d4c3(++_0xd04430);}(_0xec56,0x1bd));var _0x6ec5=function(_0xf2c137,_0x51cc73){_0xf2c137=_0xf2c137-0x0;var _0x4c3f75=_0xec56[_0xf2c137];return _0x4c3f75;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6ec5('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6ec5('0x2')],'allowNull':![],'unique':_0x6ec5('0x1')},'priority':{'type':Sequelize[_0x6ec5('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x6ec5('0x1')},'tag':{'type':Sequelize[_0x6ec5('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6ec5('0x2')],'allowNull':![],'defaultValue':_0x6ec5('0x3')},'appdata':{'type':Sequelize[_0x6ec5('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6ec5('0x4')](_0x6ec5('0x5'),_0x6ec5('0x6'),_0x6ec5('0x7'),_0x6ec5('0x8'),_0x6ec5('0x9'),_0x6ec5('0xa'),_0x6ec5('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x6ec5('0x2')]},'interval':{'type':Sequelize[_0x6ec5('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x6ec5('0xc')]},'isApp':{'type':Sequelize[_0x6ec5('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x6ec5('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x6ec5('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x6ec5('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6ec5('0xc')]},'recordingFormat':{'type':Sequelize[_0x6ec5('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x6ec5('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x6ec5('0xe')],'get':function(_0x2b1f61){return this[_0x6ec5('0xf')](_0x6ec5('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 3c5a8da..5c32f33 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 _0x9589=['offset','set','apply','reject','save','update','then','destroy','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','find','name','UserProfileResource','end','error','stack','send','VoiceExtension','rawAttributes','query','keys','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','pick','filter','where','merge','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','params','options','create','body','startsWith','exten','concat','user','role','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','VoiceExtensionId','bulkCreate','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json'];(function(_0x780ad8,_0x5213ee){var _0x4b0e01=function(_0x155457){while(--_0x155457){_0x780ad8['push'](_0x780ad8['shift']());}};_0x4b0e01(++_0x5213ee);}(_0x9589,0xbc));var _0x9958=function(_0x374b05,_0x123fbf){_0x374b05=_0x374b05-0x0;var _0x4bdf00=_0x9589[_0x374b05];return _0x4bdf00;};'use strict';var pdf=require(_0x9958('0x0'));var emlformat=require(_0x9958('0x1'));var rimraf=require(_0x9958('0x2'));var zipdir=require(_0x9958('0x3'));var jsonpatch=require(_0x9958('0x4'));var rp=require('request-promise');var moment=require(_0x9958('0x5'));var BPromise=require(_0x9958('0x6'));var Mustache=require(_0x9958('0x7'));var util=require('util');var path=require(_0x9958('0x8'));var sox=require(_0x9958('0x9'));var csv=require(_0x9958('0xa'));var ejs=require(_0x9958('0xb'));var fs=require('fs');var _=require(_0x9958('0xc'));var squel=require(_0x9958('0xd'));var crypto=require('crypto');var jsforce=require(_0x9958('0xe'));var deskjs=require(_0x9958('0xf'));var toCsv=require(_0x9958('0xa'));var querystring=require(_0x9958('0x10'));var Papa=require(_0x9958('0x11'));var authService=require(_0x9958('0x12'));var hardwareService=require(_0x9958('0x13'));var Redis=require(_0x9958('0x14'));var qs=require(_0x9958('0x15'));var logger=require(_0x9958('0x16'))(_0x9958('0x17'));var utils=require(_0x9958('0x18'));var config=require(_0x9958('0x19'));var db=require(_0x9958('0x1a'))['db'];config[_0x9958('0x1b')]=_[_0x9958('0x1c')](config[_0x9958('0x1b')],{'host':_0x9958('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9958('0x1b')]));require('./voiceExtension.socket')[_0x9958('0x1e')](socket);function respondWithStatusCode(_0x5c903e,_0xe749a1){_0xe749a1=_0xe749a1||0xcc;return function(_0x3d34bc){if(_0x3d34bc){return _0x5c903e[_0x9958('0x1f')](_0xe749a1);}return _0x5c903e[_0x9958('0x20')](_0xe749a1)['end']();};}function respondWithResult(_0xe3e42d,_0x234b39){_0x234b39=_0x234b39||0xc8;return function(_0x5caedb){if(_0x5caedb){return _0xe3e42d['status'](_0x234b39)[_0x9958('0x21')](_0x5caedb);}};}function respondWithFilteredResult(_0x4a27cf,_0x6e7ad4){return function(_0x124929){if(_0x124929){var _0x3c0b8b=_0x124929['count'],_0x33b903=_0x6e7ad4['offset'],_0x1cd821=_0x6e7ad4[_0x9958('0x22')]+_0x6e7ad4['limit'],_0x3d6cb2;if(_0x1cd821>=_0x3c0b8b){_0x1cd821=_0x3c0b8b;_0x3d6cb2=0xc8;}else{_0x3d6cb2=0xce;}_0x4a27cf['status'](_0x3d6cb2);return _0x4a27cf[_0x9958('0x23')]('Content-Range',_0x33b903+'-'+_0x1cd821+'/'+_0x3c0b8b)['json'](_0x124929);}return null;};}function patchUpdates(_0x4278da){return function(_0x36affc){try{jsonpatch[_0x9958('0x24')](_0x36affc,_0x4278da,!![]);}catch(_0x4c8fd2){return BPromise[_0x9958('0x25')](_0x4c8fd2);}return _0x36affc[_0x9958('0x26')]();};}function saveUpdates(_0xb6be59,_0x31130c){return function(_0x65d7e1){if(_0x65d7e1){return _0x65d7e1[_0x9958('0x27')](_0xb6be59)[_0x9958('0x28')](function(_0x9b6fc2){return _0x9b6fc2;});}return null;};}function removeEntity(_0x1a5dde,_0x2aabad){return function(_0x3bb58a){if(_0x3bb58a){return _0x3bb58a[_0x9958('0x29')]()[_0x9958('0x28')](function(){var _0x5f1e2e=_0x3bb58a[_0x9958('0x2a')]({'plain':!![]});var _0x25993b=[{'name':_0x9958('0x2b'),'value':'inbound','ignore':![]},{'name':_0x9958('0x2c'),'value':_0x9958('0x2d'),'ignore':![]},{'name':_0x9958('0x2e'),'value':_0x9958('0x2f'),'ignore':![]}];var _0x640cc7=_(_0x25993b)['filter'](_0x9958('0x30'))[_0x9958('0x31')](_0x9958('0x32'))['value']();if(_[_0x9958('0x33')](_0x640cc7,_0x5f1e2e[_0x9958('0x34')])){return;}var _0x398097=_[_0x9958('0x35')](_0x25993b,[_0x9958('0x32'),_0x5f1e2e['type']])[_0x9958('0x36')];return db[_0x9958('0x37')][_0x9958('0x29')]({'where':{'type':_0x398097,'resourceId':_0x5f1e2e['id']}})[_0x9958('0x28')](function(){return _0x3bb58a;});})[_0x9958('0x28')](function(){_0x1a5dde['status'](0xcc)[_0x9958('0x38')]();});}};}function handleEntityNotFound(_0x551abf,_0x234a67){return function(_0x133d84){if(!_0x133d84){_0x551abf['sendStatus'](0x194);}return _0x133d84;};}function handleError(_0x2fb388,_0x3301e6){_0x3301e6=_0x3301e6||0x1f4;return function(_0x8628da){logger[_0x9958('0x39')](_0x8628da[_0x9958('0x3a')]);if(_0x8628da[_0x9958('0x36')]){delete _0x8628da[_0x9958('0x36')];}_0x2fb388[_0x9958('0x20')](_0x3301e6)[_0x9958('0x3b')](_0x8628da);};}exports['index']=function(_0x28a143,_0x52a306){var _0x443bab={},_0x159b5c={},_0x185d07={'count':0x0,'rows':[]};var _0x51dc44=db[_0x9958('0x3c')][_0x9958('0x3d')];_0x159b5c['model']=_['keys'](_0x51dc44);_0x159b5c[_0x9958('0x3e')]=_[_0x9958('0x3f')](_0x28a143['query']);_0x159b5c[_0x9958('0x40')]=_[_0x9958('0x41')](_0x159b5c[_0x9958('0x42')],_0x159b5c[_0x9958('0x3e')]);_0x443bab[_0x9958('0x43')]=_[_0x9958('0x41')](_0x159b5c['model'],qs[_0x9958('0x44')](_0x28a143[_0x9958('0x3e')][_0x9958('0x44')]));_0x443bab[_0x9958('0x43')]=_0x443bab[_0x9958('0x43')]['length']?_0x443bab['attributes']:_0x159b5c['model'];if(!_0x28a143['query']['hasOwnProperty'](_0x9958('0x45'))){_0x443bab[_0x9958('0x46')]=qs[_0x9958('0x46')](_0x28a143[_0x9958('0x3e')][_0x9958('0x46')]);_0x443bab[_0x9958('0x22')]=qs[_0x9958('0x22')](_0x28a143['query'][_0x9958('0x22')]);}_0x443bab[_0x9958('0x47')]=qs[_0x9958('0x48')](_0x28a143[_0x9958('0x3e')]['sort']);_0x443bab['where']=qs[_0x9958('0x40')](_[_0x9958('0x49')](_0x28a143[_0x9958('0x3e')],_0x159b5c[_0x9958('0x40')]));if(_0x28a143[_0x9958('0x3e')][_0x9958('0x4a')]){_0x443bab[_0x9958('0x4b')]=_[_0x9958('0x4c')](_0x443bab[_0x9958('0x4b')],{'$or':_['map'](_0x51dc44,function(_0x919197){if(_0x919197[_0x9958('0x34')][_0x9958('0x4d')]!==_0x9958('0x4e')){var _0x25998c={};_0x25998c[_0x919197[_0x9958('0x4f')]]={'$like':'%'+_0x28a143['query'][_0x9958('0x4a')]+'%'};return _0x25998c;}})});}_0x443bab=_['merge']({},_0x443bab,_0x28a143['options']);var _0x2e21f6={'where':_0x443bab[_0x9958('0x4b')]};return db[_0x9958('0x3c')][_0x9958('0x50')](_0x2e21f6)[_0x9958('0x28')](function(_0x39beee){_0x185d07[_0x9958('0x50')]=_0x39beee;if(_0x28a143[_0x9958('0x3e')][_0x9958('0x51')]){_0x443bab[_0x9958('0x52')]=[{'all':!![]}];}return db[_0x9958('0x3c')][_0x9958('0x53')](_0x443bab);})[_0x9958('0x28')](function(_0x320510){_0x185d07[_0x9958('0x54')]=_0x320510;return _0x185d07;})['then'](respondWithFilteredResult(_0x52a306,_0x443bab))[_0x9958('0x55')](handleError(_0x52a306,null));};exports[_0x9958('0x56')]=function(_0x3bdeaa,_0x1d0c2d){var _0x4059f1={'raw':![],'where':{'id':_0x3bdeaa[_0x9958('0x57')]['id']}},_0x3eae63={};_0x3eae63[_0x9958('0x42')]=_[_0x9958('0x3f')](db[_0x9958('0x3c')]['rawAttributes']);_0x3eae63[_0x9958('0x3e')]=_[_0x9958('0x3f')](_0x3bdeaa[_0x9958('0x3e')]);_0x3eae63[_0x9958('0x40')]=_['intersection'](_0x3eae63[_0x9958('0x42')],_0x3eae63[_0x9958('0x3e')]);_0x4059f1['attributes']=_['intersection'](_0x3eae63['model'],qs['fields'](_0x3bdeaa[_0x9958('0x3e')]['fields']));_0x4059f1[_0x9958('0x43')]=_0x4059f1[_0x9958('0x43')]['length']?_0x4059f1[_0x9958('0x43')]:_0x3eae63[_0x9958('0x42')];if(_0x3bdeaa[_0x9958('0x3e')][_0x9958('0x51')]){_0x4059f1[_0x9958('0x52')]=[{'all':!![]}];}_0x4059f1=_[_0x9958('0x4c')]({},_0x4059f1,_0x3bdeaa[_0x9958('0x58')]);return db[_0x9958('0x3c')][_0x9958('0x35')](_0x4059f1)[_0x9958('0x28')](handleEntityNotFound(_0x1d0c2d,null))['then'](respondWithResult(_0x1d0c2d,null))[_0x9958('0x55')](handleError(_0x1d0c2d,null));};exports[_0x9958('0x29')]=function(_0x2634e6,_0xfbf634){return db[_0x9958('0x3c')][_0x9958('0x35')]({'where':{'id':_0x2634e6[_0x9958('0x57')]['id']}})[_0x9958('0x28')](handleEntityNotFound(_0xfbf634,null))[_0x9958('0x28')](removeEntity(_0xfbf634,null))[_0x9958('0x55')](handleError(_0xfbf634,null));};exports[_0x9958('0x59')]=function(_0x11167c,_0x45f597){if(_0x11167c[_0x9958('0x5a')][_0x9958('0x34')]===_0x9958('0x2d')&&!_[_0x9958('0x5b')](_0x11167c[_0x9958('0x5a')][_0x9958('0x5c')],'_')){_0x11167c[_0x9958('0x5a')][_0x9958('0x5c')]='_'[_0x9958('0x5d')](_0x11167c[_0x9958('0x5a')]['exten']);}return db[_0x9958('0x3c')][_0x9958('0x59')](_0x11167c[_0x9958('0x5a')],{'raw':![]})['then'](function(_0x206699){var _0x50c597=_0x11167c[_0x9958('0x5e')][_0x9958('0x2a')]({'plain':!![]});if(!_0x50c597)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50c597[_0x9958('0x5f')]===_0x9958('0x5e')){var _0x9f9a06=_0x206699[_0x9958('0x2a')]({'plain':!![]});var _0x250653=[{'name':_0x9958('0x2b'),'value':_0x9958('0x60')},{'name':'OutboundRoutes','value':_0x9958('0x2d')},{'name':_0x9958('0x2e'),'value':_0x9958('0x2f')}];var _0x252cca=_['find'](_0x250653,[_0x9958('0x32'),_0x9f9a06['type']])['name'];return db[_0x9958('0x61')][_0x9958('0x35')]({'where':{'name':_0x252cca,'userProfileId':_0x50c597[_0x9958('0x62')]},'raw':!![]})['then'](function(_0x29de50){if(_0x29de50&&_0x29de50[_0x9958('0x63')]===0x0){return db[_0x9958('0x37')]['create']({'name':_0x9f9a06[_0x9958('0x36')],'resourceId':_0x9f9a06['id'],'type':_0x29de50[_0x9958('0x36')],'sectionId':_0x29de50['id']},{})[_0x9958('0x28')](function(){return _0x206699;});}else{return _0x206699;}})[_0x9958('0x55')](function(_0x9ec0aa){logger[_0x9958('0x39')](_0x9958('0x64'),_0x9ec0aa);throw _0x9ec0aa;});}return _0x206699;})[_0x9958('0x28')](respondWithResult(_0x45f597,0xc9))[_0x9958('0x55')](handleError(_0x45f597,null));};exports[_0x9958('0x27')]=function(_0x5d507c,_0x4e70f2){if(_0x5d507c[_0x9958('0x5a')]['id']){delete _0x5d507c['body']['id'];}return db['VoiceExtension'][_0x9958('0x35')]({'where':{'id':_0x5d507c[_0x9958('0x57')]['id']}})[_0x9958('0x28')](handleEntityNotFound(_0x4e70f2,null))[_0x9958('0x28')](function(_0x150c55){if(_0x150c55){return db['VoiceExtension'][_0x9958('0x27')](_[_0x9958('0x49')](_0x5d507c[_0x9958('0x5a')],[_0x9958('0x5c'),_0x9958('0x65'),'description',_0x9958('0x66'),_0x9958('0x67'),_0x9958('0x68')]),{'where':{'context':_0x150c55[_0x9958('0x65')],'exten':_0x150c55['exten']},'individualHooks':!![]})[_0x9958('0x28')](function(_0x16bb4b){return _0x16bb4b;});}return null;})['then'](respondWithStatusCode(_0x4e70f2,null))[_0x9958('0x55')](handleError(_0x4e70f2,null));};exports[_0x9958('0x69')]=function(_0xe96b11,_0x279c3,_0x4ec994){return db[_0x9958('0x3c')][_0x9958('0x6a')]({'where':{'id':_0xe96b11['params']['id']}})[_0x9958('0x28')](handleEntityNotFound(_0x279c3,null))[_0x9958('0x28')](function(_0x18edbf){if(_0x18edbf){return db[_0x9958('0x6b')]['transaction'](function(_0x12ab6b){return db[_0x9958('0x3c')][_0x9958('0x29')]({'where':{'VoiceExtensionId':_0xe96b11[_0x9958('0x57')]['id']},'transaction':_0x12ab6b})[_0x9958('0x28')](function(_0xd2e9b5){var _0x6a2ee4=_['map'](_0xe96b11[_0x9958('0x5a')],function(_0x3c5938){_0x3c5938[_0x9958('0x6c')]=_0xe96b11[_0x9958('0x57')]['id'];return _0x3c5938;});return db[_0x9958('0x3c')][_0x9958('0x6d')](_0x6a2ee4,{'transaction':_0x12ab6b});});})[_0x9958('0x28')](function(){return db[_0x9958('0x3c')][_0x9958('0x6e')]({'where':{'isApp':!![],'VoiceExtensionId':_0xe96b11['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x9958('0x28')](respondWithResult(_0x279c3,null))['catch'](handleError(_0x279c3,null));}; \ No newline at end of file +var _0x8c46=['Content-Range','reject','save','update','destroy','then','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','type','find','name','UserProfileResource','end','error','stack','send','index','rawAttributes','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','VIRTUAL','field','merge','options','VoiceExtension','includeAll','include','findAll','catch','show','params','create','body','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','InternalRoutes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','mandatoryDisposition','addApplications','findOne','sequelize','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','count','offset','limit','set'];(function(_0x17358f,_0x29c302){var _0x12861c=function(_0x4d3475){while(--_0x4d3475){_0x17358f['push'](_0x17358f['shift']());}};_0x12861c(++_0x29c302);}(_0x8c46,0x171));var _0x68c4=function(_0x11f82b,_0x255da7){_0x11f82b=_0x11f82b-0x0;var _0xf6dada=_0x8c46[_0x11f82b];return _0xf6dada;};'use strict';var pdf=require(_0x68c4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x68c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x68c4('0x2'));var BPromise=require(_0x68c4('0x3'));var Mustache=require(_0x68c4('0x4'));var util=require(_0x68c4('0x5'));var path=require(_0x68c4('0x6'));var sox=require(_0x68c4('0x7'));var csv=require(_0x68c4('0x8'));var ejs=require(_0x68c4('0x9'));var fs=require('fs');var _=require(_0x68c4('0xa'));var squel=require(_0x68c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x68c4('0xc'));var deskjs=require(_0x68c4('0xd'));var toCsv=require(_0x68c4('0x8'));var querystring=require('querystring');var Papa=require(_0x68c4('0xe'));var authService=require(_0x68c4('0xf'));var hardwareService=require(_0x68c4('0x10'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x68c4('0x11'))(_0x68c4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x68c4('0x13'))['db'];config[_0x68c4('0x14')]=_[_0x68c4('0x15')](config['redis'],{'host':_0x68c4('0x16'),'port':0x18eb});var socket=require(_0x68c4('0x17'))(new Redis(config[_0x68c4('0x14')]));require('./voiceExtension.socket')[_0x68c4('0x18')](socket);function respondWithStatusCode(_0x14919c,_0x5e1341){_0x5e1341=_0x5e1341||0xcc;return function(_0x52f031){if(_0x52f031){return _0x14919c[_0x68c4('0x19')](_0x5e1341);}return _0x14919c[_0x68c4('0x1a')](_0x5e1341)['end']();};}function respondWithResult(_0xc25f7b,_0x4ea2a4){_0x4ea2a4=_0x4ea2a4||0xc8;return function(_0x1a7045){if(_0x1a7045){return _0xc25f7b['status'](_0x4ea2a4)['json'](_0x1a7045);}};}function respondWithFilteredResult(_0xc2ea2f,_0x5cb05f){return function(_0x4f4797){if(_0x4f4797){var _0x2d6c1b=_0x4f4797[_0x68c4('0x1b')],_0x1d757c=_0x5cb05f[_0x68c4('0x1c')],_0x38ac38=_0x5cb05f[_0x68c4('0x1c')]+_0x5cb05f[_0x68c4('0x1d')],_0x33c5c5;if(_0x38ac38>=_0x2d6c1b){_0x38ac38=_0x2d6c1b;_0x33c5c5=0xc8;}else{_0x33c5c5=0xce;}_0xc2ea2f[_0x68c4('0x1a')](_0x33c5c5);return _0xc2ea2f[_0x68c4('0x1e')](_0x68c4('0x1f'),_0x1d757c+'-'+_0x38ac38+'/'+_0x2d6c1b)['json'](_0x4f4797);}return null;};}function patchUpdates(_0x398a71){return function(_0x4edf9f){try{jsonpatch['apply'](_0x4edf9f,_0x398a71,!![]);}catch(_0x34d3a6){return BPromise[_0x68c4('0x20')](_0x34d3a6);}return _0x4edf9f[_0x68c4('0x21')]();};}function saveUpdates(_0x42f0bc,_0x5b8135){return function(_0x35e865){if(_0x35e865){return _0x35e865[_0x68c4('0x22')](_0x42f0bc)['then'](function(_0x201742){return _0x201742;});}return null;};}function removeEntity(_0x392ccf,_0x45f9be){return function(_0x10278e){if(_0x10278e){return _0x10278e[_0x68c4('0x23')]()[_0x68c4('0x24')](function(){var _0x37e9a9=_0x10278e['get']({'plain':!![]});var _0x2ff4a5=[{'name':'InboundRoutes','value':_0x68c4('0x25'),'ignore':![]},{'name':_0x68c4('0x26'),'value':_0x68c4('0x27'),'ignore':![]},{'name':'InternalRoutes','value':_0x68c4('0x28'),'ignore':![]}];var _0x126064=_(_0x2ff4a5)[_0x68c4('0x29')](_0x68c4('0x2a'))[_0x68c4('0x2b')](_0x68c4('0x2c'))[_0x68c4('0x2c')]();if(_['includes'](_0x126064,_0x37e9a9[_0x68c4('0x2d')])){return;}var _0x4b4634=_[_0x68c4('0x2e')](_0x2ff4a5,[_0x68c4('0x2c'),_0x37e9a9['type']])[_0x68c4('0x2f')];return db[_0x68c4('0x30')]['destroy']({'where':{'type':_0x4b4634,'resourceId':_0x37e9a9['id']}})[_0x68c4('0x24')](function(){return _0x10278e;});})[_0x68c4('0x24')](function(){_0x392ccf[_0x68c4('0x1a')](0xcc)[_0x68c4('0x31')]();});}};}function handleEntityNotFound(_0x233cea,_0x586dec){return function(_0x255433){if(!_0x255433){_0x233cea[_0x68c4('0x19')](0x194);}return _0x255433;};}function handleError(_0x3a7297,_0x1514d7){_0x1514d7=_0x1514d7||0x1f4;return function(_0x19bc4a){logger[_0x68c4('0x32')](_0x19bc4a[_0x68c4('0x33')]);if(_0x19bc4a[_0x68c4('0x2f')]){delete _0x19bc4a[_0x68c4('0x2f')];}_0x3a7297[_0x68c4('0x1a')](_0x1514d7)[_0x68c4('0x34')](_0x19bc4a);};}exports[_0x68c4('0x35')]=function(_0x4837b4,_0x1299fc){var _0x194217={},_0x25eeea={},_0x1be9ed={'count':0x0,'rows':[]};var _0x352db9=db['VoiceExtension'][_0x68c4('0x36')];_0x25eeea['model']=_['keys'](_0x352db9);_0x25eeea['query']=_[_0x68c4('0x37')](_0x4837b4[_0x68c4('0x38')]);_0x25eeea[_0x68c4('0x39')]=_[_0x68c4('0x3a')](_0x25eeea['model'],_0x25eeea[_0x68c4('0x38')]);_0x194217[_0x68c4('0x3b')]=_[_0x68c4('0x3a')](_0x25eeea['model'],qs[_0x68c4('0x3c')](_0x4837b4[_0x68c4('0x38')][_0x68c4('0x3c')]));_0x194217[_0x68c4('0x3b')]=_0x194217[_0x68c4('0x3b')][_0x68c4('0x3d')]?_0x194217[_0x68c4('0x3b')]:_0x25eeea[_0x68c4('0x3e')];if(!_0x4837b4[_0x68c4('0x38')][_0x68c4('0x3f')]('nolimit')){_0x194217['limit']=qs[_0x68c4('0x1d')](_0x4837b4[_0x68c4('0x38')][_0x68c4('0x1d')]);_0x194217[_0x68c4('0x1c')]=qs[_0x68c4('0x1c')](_0x4837b4[_0x68c4('0x38')][_0x68c4('0x1c')]);}_0x194217[_0x68c4('0x40')]=qs[_0x68c4('0x41')](_0x4837b4[_0x68c4('0x38')][_0x68c4('0x41')]);_0x194217[_0x68c4('0x42')]=qs[_0x68c4('0x39')](_['pick'](_0x4837b4['query'],_0x25eeea[_0x68c4('0x39')]));if(_0x4837b4[_0x68c4('0x38')][_0x68c4('0x29')]){_0x194217[_0x68c4('0x42')]=_['merge'](_0x194217[_0x68c4('0x42')],{'$or':_[_0x68c4('0x2b')](_0x352db9,function(_0x4d555c){if(_0x4d555c['type']['key']!==_0x68c4('0x43')){var _0x565962={};_0x565962[_0x4d555c[_0x68c4('0x44')]]={'$like':'%'+_0x4837b4['query'][_0x68c4('0x29')]+'%'};return _0x565962;}})});}_0x194217=_[_0x68c4('0x45')]({},_0x194217,_0x4837b4[_0x68c4('0x46')]);var _0xefe68d={'where':_0x194217['where']};return db[_0x68c4('0x47')][_0x68c4('0x1b')](_0xefe68d)[_0x68c4('0x24')](function(_0x10cf85){_0x1be9ed['count']=_0x10cf85;if(_0x4837b4[_0x68c4('0x38')][_0x68c4('0x48')]){_0x194217[_0x68c4('0x49')]=[{'all':!![]}];}return db[_0x68c4('0x47')][_0x68c4('0x4a')](_0x194217);})['then'](function(_0x58f3b6){_0x1be9ed['rows']=_0x58f3b6;return _0x1be9ed;})[_0x68c4('0x24')](respondWithFilteredResult(_0x1299fc,_0x194217))[_0x68c4('0x4b')](handleError(_0x1299fc,null));};exports[_0x68c4('0x4c')]=function(_0x7c3235,_0x5e8438){var _0x2255fa={'raw':![],'where':{'id':_0x7c3235[_0x68c4('0x4d')]['id']}},_0x2169af={};_0x2169af[_0x68c4('0x3e')]=_[_0x68c4('0x37')](db[_0x68c4('0x47')][_0x68c4('0x36')]);_0x2169af[_0x68c4('0x38')]=_[_0x68c4('0x37')](_0x7c3235[_0x68c4('0x38')]);_0x2169af[_0x68c4('0x39')]=_['intersection'](_0x2169af[_0x68c4('0x3e')],_0x2169af['query']);_0x2255fa[_0x68c4('0x3b')]=_[_0x68c4('0x3a')](_0x2169af[_0x68c4('0x3e')],qs[_0x68c4('0x3c')](_0x7c3235['query'][_0x68c4('0x3c')]));_0x2255fa['attributes']=_0x2255fa[_0x68c4('0x3b')][_0x68c4('0x3d')]?_0x2255fa['attributes']:_0x2169af[_0x68c4('0x3e')];if(_0x7c3235[_0x68c4('0x38')][_0x68c4('0x48')]){_0x2255fa[_0x68c4('0x49')]=[{'all':!![]}];}_0x2255fa=_[_0x68c4('0x45')]({},_0x2255fa,_0x7c3235[_0x68c4('0x46')]);return db['VoiceExtension'][_0x68c4('0x2e')](_0x2255fa)[_0x68c4('0x24')](handleEntityNotFound(_0x5e8438,null))[_0x68c4('0x24')](respondWithResult(_0x5e8438,null))[_0x68c4('0x4b')](handleError(_0x5e8438,null));};exports['destroy']=function(_0x40ecf6,_0x19aec2){return db[_0x68c4('0x47')][_0x68c4('0x2e')]({'where':{'id':_0x40ecf6[_0x68c4('0x4d')]['id']}})[_0x68c4('0x24')](handleEntityNotFound(_0x19aec2,null))['then'](removeEntity(_0x19aec2,null))[_0x68c4('0x4b')](handleError(_0x19aec2,null));};exports[_0x68c4('0x4e')]=function(_0x3db854,_0x51db14){if(_0x3db854[_0x68c4('0x4f')][_0x68c4('0x2d')]==='outbound'&&!_['startsWith'](_0x3db854[_0x68c4('0x4f')][_0x68c4('0x50')],'_')){_0x3db854[_0x68c4('0x4f')][_0x68c4('0x50')]='_'[_0x68c4('0x51')](_0x3db854[_0x68c4('0x4f')][_0x68c4('0x50')]);}return db[_0x68c4('0x47')]['create'](_0x3db854[_0x68c4('0x4f')],{'raw':![]})['then'](function(_0x59157e){var _0x4e1352=_0x3db854[_0x68c4('0x52')][_0x68c4('0x53')]({'plain':!![]});if(!_0x4e1352)throw new Error(_0x68c4('0x54'));if(_0x4e1352['role']===_0x68c4('0x52')){var _0x441371=_0x59157e['get']({'plain':!![]});var _0x35faf1=[{'name':'InboundRoutes','value':_0x68c4('0x25')},{'name':'OutboundRoutes','value':_0x68c4('0x27')},{'name':_0x68c4('0x55'),'value':'internal'}];var _0x1303fc=_[_0x68c4('0x2e')](_0x35faf1,['value',_0x441371[_0x68c4('0x2d')]])[_0x68c4('0x2f')];return db['UserProfileSection'][_0x68c4('0x2e')]({'where':{'name':_0x1303fc,'userProfileId':_0x4e1352[_0x68c4('0x56')]},'raw':!![]})[_0x68c4('0x24')](function(_0x37f711){if(_0x37f711&&_0x37f711[_0x68c4('0x57')]===0x0){return db[_0x68c4('0x30')][_0x68c4('0x4e')]({'name':_0x441371[_0x68c4('0x2f')],'resourceId':_0x441371['id'],'type':_0x37f711[_0x68c4('0x2f')],'sectionId':_0x37f711['id']},{})['then'](function(){return _0x59157e;});}else{return _0x59157e;}})[_0x68c4('0x4b')](function(_0x43b734){logger[_0x68c4('0x32')](_0x68c4('0x58'),_0x43b734);throw _0x43b734;});}return _0x59157e;})[_0x68c4('0x24')](respondWithResult(_0x51db14,0xc9))[_0x68c4('0x4b')](handleError(_0x51db14,null));};exports[_0x68c4('0x22')]=function(_0x4a50f4,_0x576902){if(_0x4a50f4[_0x68c4('0x4f')]['id']){delete _0x4a50f4[_0x68c4('0x4f')]['id'];}return db['VoiceExtension'][_0x68c4('0x2e')]({'where':{'id':_0x4a50f4[_0x68c4('0x4d')]['id']}})[_0x68c4('0x24')](handleEntityNotFound(_0x576902,null))[_0x68c4('0x24')](function(_0x334fff){if(_0x334fff){return db[_0x68c4('0x47')]['update'](_[_0x68c4('0x59')](_0x4a50f4[_0x68c4('0x4f')],[_0x68c4('0x50'),_0x68c4('0x5a'),_0x68c4('0x5b'),'recordingFormat','cutdigits',_0x68c4('0x5c')]),{'where':{'context':_0x334fff[_0x68c4('0x5a')],'exten':_0x334fff[_0x68c4('0x50')]},'individualHooks':!![]})[_0x68c4('0x24')](function(_0x294681){return _0x294681;});}return null;})['then'](respondWithStatusCode(_0x576902,null))[_0x68c4('0x4b')](handleError(_0x576902,null));};exports[_0x68c4('0x5d')]=function(_0x18e3bf,_0x231e7f,_0x3d098a){return db[_0x68c4('0x47')][_0x68c4('0x5e')]({'where':{'id':_0x18e3bf[_0x68c4('0x4d')]['id']}})[_0x68c4('0x24')](handleEntityNotFound(_0x231e7f,null))[_0x68c4('0x24')](function(_0x50ada0){if(_0x50ada0){return db[_0x68c4('0x5f')]['transaction'](function(_0x284f5a){return db[_0x68c4('0x47')][_0x68c4('0x23')]({'where':{'VoiceExtensionId':_0x18e3bf['params']['id']},'transaction':_0x284f5a})[_0x68c4('0x24')](function(_0x4fa64d){var _0xd7bbe0=_[_0x68c4('0x2b')](_0x18e3bf[_0x68c4('0x4f')],function(_0x37260e){_0x37260e[_0x68c4('0x60')]=_0x18e3bf['params']['id'];return _0x37260e;});return db[_0x68c4('0x47')][_0x68c4('0x61')](_0xd7bbe0,{'transaction':_0x284f5a});});})[_0x68c4('0x24')](function(){return db[_0x68c4('0x47')][_0x68c4('0x62')]({'where':{'isApp':!![],'VoiceExtensionId':_0x18e3bf['params']['id']},'order':_0x68c4('0x63')});});}})[_0x68c4('0x24')](respondWithResult(_0x231e7f,null))[_0x68c4('0x4b')](handleError(_0x231e7f,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index a798647..e9a9c81 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 _0x0dd2=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x0dd2,0xd6));var _0x20dd=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0x0dd2[_0x309d93];return _0x2dd61d;};'use strict';var EventEmitter=require(_0x20dd('0x0'));var VoiceExtension=require(_0x20dd('0x1'))['db'][_0x20dd('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x20dd('0x3')](0x0);var events={'afterCreate':_0x20dd('0x4'),'afterUpdate':'update','afterDestroy':_0x20dd('0x5')};function emitEvent(_0x3c860a){return function(_0x21e2dc,_0x342f7c,_0x14bec6){VoiceExtensionEvents[_0x20dd('0x6')](_0x3c860a+':'+_0x21e2dc['id'],_0x21e2dc);VoiceExtensionEvents[_0x20dd('0x6')](_0x3c860a,_0x21e2dc);_0x14bec6(null);};}for(var e in events){if(events[_0x20dd('0x7')](e)){var event=events[e];VoiceExtension[_0x20dd('0x8')](e,emitEvent(event));}}module[_0x20dd('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x947c=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x2499dc,_0x237995){var _0x47f07=function(_0x9a1853){while(--_0x9a1853){_0x2499dc['push'](_0x2499dc['shift']());}};_0x47f07(++_0x237995);}(_0x947c,0x122));var _0xc947=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0x947c[_0x593564];return _0x211a89;};'use strict';var EventEmitter=require(_0xc947('0x0'));var VoiceExtension=require(_0xc947('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc947('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc947('0x3'),'afterDestroy':_0xc947('0x4')};function emitEvent(_0xde5229){return function(_0x536fe7,_0x5217ef,_0x3f059b){VoiceExtensionEvents['emit'](_0xde5229+':'+_0x536fe7['id'],_0x536fe7);VoiceExtensionEvents[_0xc947('0x5')](_0xde5229,_0x536fe7);_0x3f059b(null);};}for(var e in events){if(events[_0xc947('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xc947('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f8cc5d4..97eb684 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 _0x59bb=['lodash','../../config/logger','api','bluebird','request-promise','VoiceExtension','voice_extensions'];(function(_0x36176e,_0x3719b7){var _0xbe79bc=function(_0x2eea8f){while(--_0x2eea8f){_0x36176e['push'](_0x36176e['shift']());}};_0xbe79bc(++_0x3719b7);}(_0x59bb,0x15e));var _0xb59b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x59bb[_0x432682];return _0x463d05;};'use strict';var _=require(_0xb59b('0x0'));var util=require('util');var logger=require(_0xb59b('0x1'))(_0xb59b('0x2'));var moment=require('moment');var BPromise=require(_0xb59b('0x3'));var rp=require(_0xb59b('0x4'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x5e7615,_0x2be26b){return _0x5e7615['define'](_0xb59b('0x5'),attributes,{'tableName':_0xb59b('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0987=['../../config/logger','api','moment','bluebird','request-promise','./voiceExtension.attributes','exports','lodash','util'];(function(_0x4a5ca0,_0x593563){var _0x4845bf=function(_0x7bd197){while(--_0x7bd197){_0x4a5ca0['push'](_0x4a5ca0['shift']());}};_0x4845bf(++_0x593563);}(_0x0987,0x16f));var _0x7098=function(_0x4bcd05,_0x5f5d0c){_0x4bcd05=_0x4bcd05-0x0;var _0x5886f9=_0x0987[_0x4bcd05];return _0x5886f9;};'use strict';var _=require(_0x7098('0x0'));var util=require(_0x7098('0x1'));var logger=require(_0x7098('0x2'))(_0x7098('0x3'));var moment=require(_0x7098('0x4'));var BPromise=require(_0x7098('0x5'));var rp=require(_0x7098('0x6'));var attributes=require(_0x7098('0x7'));module[_0x7098('0x8')]=function(_0x59cb08,_0x499731){return _0x59cb08['define']('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 1c12bf1..0b693d4 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 _0x4483=['message','request\x20sent','GetVoiceExtension','VoiceExtension','findAll','options','where','limit','map','include','model','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','register','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','VoiceExtension,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4483,0x1a3));var _0x3448=function(_0x554ebf,_0x146523){_0x554ebf=_0x554ebf-0x0;var _0x2d6e94=_0x4483[_0x554ebf];return _0x2d6e94;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});config[_0x3448('0xc')]=_[_0x3448('0xd')](config[_0x3448('0xc')],{'host':_0x3448('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3448('0xf'))[_0x3448('0x10')](socket);function respondWithRpcPromise(_0xc36409,_0x6f82ca,_0x3f4364){return new BPromise(function(_0x1e645a,_0x2bdf02){return client[_0x3448('0x11')](_0xc36409,_0x3f4364)[_0x3448('0x12')](function(_0x35bb7b){logger[_0x3448('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x6f82ca,'request\x20sent');logger[_0x3448('0x14')](_0x3448('0x15'),_0x6f82ca,'request\x20sent',JSON[_0x3448('0x16')](_0x35bb7b));if(_0x35bb7b[_0x3448('0x17')]){if(_0x35bb7b[_0x3448('0x17')]['code']===0x1f4){logger[_0x3448('0x17')](_0x3448('0x18'),_0x6f82ca,_0x35bb7b['error'][_0x3448('0x19')]);return _0x2bdf02(_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);}logger['error'](_0x3448('0x18'),_0x6f82ca,_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);return _0x1e645a(_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);}else{logger[_0x3448('0x13')](_0x3448('0x18'),_0x6f82ca,_0x3448('0x1a'));_0x1e645a(_0x35bb7b['result'][_0x3448('0x19')]);}})['catch'](function(_0x48f94a){logger['error'](_0x3448('0x18'),_0x6f82ca,_0x48f94a);_0x2bdf02(_0x48f94a);});});}exports[_0x3448('0x1b')]=function(_0xda4040){var _0x5b5e26=this;return new Promise(function(_0x3df082,_0x392c8d){return db[_0x3448('0x1c')][_0x3448('0x1d')]({'raw':_0xda4040[_0x3448('0x1e')]?_0xda4040[_0x3448('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xda4040['options']?_0xda4040['options'][_0x3448('0x1f')]||null:null,'attributes':_0xda4040[_0x3448('0x1e')]?_0xda4040['options']['attributes']||null:null,'limit':_0xda4040[_0x3448('0x1e')]?_0xda4040[_0x3448('0x1e')][_0x3448('0x20')]||null:null,'include':_0xda4040[_0x3448('0x1e')]?_0xda4040[_0x3448('0x1e')]['include']?_[_0x3448('0x21')](_0xda4040[_0x3448('0x1e')][_0x3448('0x22')],function(_0x2088de){return{'model':db[_0x2088de[_0x3448('0x23')]],'as':_0x2088de['as'],'attributes':_0x2088de['attributes'],'include':_0x2088de[_0x3448('0x22')]?_[_0x3448('0x21')](_0x2088de['include'],function(_0x19a479){return{'model':db[_0x19a479[_0x3448('0x23')]],'as':_0x19a479['as'],'attributes':_0x19a479[_0x3448('0x24')],'include':_0x19a479[_0x3448('0x22')]?_[_0x3448('0x21')](_0x19a479[_0x3448('0x22')],function(_0x31be64){return{'model':db[_0x31be64[_0x3448('0x23')]],'as':_0x31be64['as'],'attributes':_0x31be64['attributes']};}):[]};}):[]};}):[]:[]})[_0x3448('0x12')](function(_0x450704){logger[_0x3448('0x13')]('GetVoiceExtension',_0xda4040);logger[_0x3448('0x14')]('GetVoiceExtension',_0xda4040,JSON['stringify'](_0x450704));_0x3df082(_0x450704);})['catch'](function(_0x52fb48){logger[_0x3448('0x17')]('GetVoiceExtension',_0x52fb48['message'],_0xda4040);_0x392c8d(_0x5b5e26[_0x3448('0x17')](0x1f4,_0x52fb48[_0x3448('0x19')]));});});}; \ No newline at end of file +var _0xe706=['model','then','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','include','map'];(function(_0x1bb141,_0x26d21a){var _0x4c1e5c=function(_0x323b69){while(--_0x323b69){_0x1bb141['push'](_0x1bb141['shift']());}};_0x4c1e5c(++_0x26d21a);}(_0xe706,0xa3));var _0x6e70=function(_0x53fb63,_0x2497b0){_0x53fb63=_0x53fb63-0x0;var _0x3fd488=_0xe706[_0x53fb63];return _0x3fd488;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});config[_0x6e70('0xd')]=_[_0x6e70('0xe')](config[_0x6e70('0xd')],{'host':_0x6e70('0xf'),'port':0x18eb});var socket=require(_0x6e70('0x10'))(new Redis(config[_0x6e70('0xd')]));require(_0x6e70('0x11'))[_0x6e70('0x12')](socket);function respondWithRpcPromise(_0x100eb7,_0x463853,_0x743eb5){return new BPromise(function(_0x3f474a,_0x37b3e0){return client[_0x6e70('0x13')](_0x100eb7,_0x743eb5)['then'](function(_0x47f6b2){logger[_0x6e70('0x14')](_0x6e70('0x15'),_0x463853,_0x6e70('0x16'));logger[_0x6e70('0x17')](_0x6e70('0x18'),_0x463853,_0x6e70('0x16'),JSON[_0x6e70('0x19')](_0x47f6b2));if(_0x47f6b2[_0x6e70('0x1a')]){if(_0x47f6b2['error']['code']===0x1f4){logger['error'](_0x6e70('0x15'),_0x463853,_0x47f6b2['error']['message']);return _0x37b3e0(_0x47f6b2[_0x6e70('0x1a')][_0x6e70('0x1b')]);}logger['error'](_0x6e70('0x15'),_0x463853,_0x47f6b2['error'][_0x6e70('0x1b')]);return _0x3f474a(_0x47f6b2[_0x6e70('0x1a')]['message']);}else{logger['info'](_0x6e70('0x15'),_0x463853,'request\x20sent');_0x3f474a(_0x47f6b2[_0x6e70('0x1c')][_0x6e70('0x1b')]);}})['catch'](function(_0x497d61){logger[_0x6e70('0x1a')](_0x6e70('0x15'),_0x463853,_0x497d61);_0x37b3e0(_0x497d61);});});}exports[_0x6e70('0x1d')]=function(_0x3a9978){var _0x3af484=this;return new Promise(function(_0xcdf9f2,_0x1b2453){return db[_0x6e70('0x1e')][_0x6e70('0x1f')]({'raw':_0x3a9978[_0x6e70('0x20')]?_0x3a9978['options'][_0x6e70('0x21')]===undefined?!![]:![]:!![],'where':_0x3a9978[_0x6e70('0x20')]?_0x3a9978[_0x6e70('0x20')]['where']||null:null,'attributes':_0x3a9978[_0x6e70('0x20')]?_0x3a9978[_0x6e70('0x20')][_0x6e70('0x22')]||null:null,'limit':_0x3a9978['options']?_0x3a9978[_0x6e70('0x20')]['limit']||null:null,'include':_0x3a9978['options']?_0x3a9978['options'][_0x6e70('0x23')]?_[_0x6e70('0x24')](_0x3a9978['options'][_0x6e70('0x23')],function(_0x1196ed){return{'model':db[_0x1196ed['model']],'as':_0x1196ed['as'],'attributes':_0x1196ed[_0x6e70('0x22')],'include':_0x1196ed[_0x6e70('0x23')]?_[_0x6e70('0x24')](_0x1196ed['include'],function(_0x54a5fe){return{'model':db[_0x54a5fe[_0x6e70('0x25')]],'as':_0x54a5fe['as'],'attributes':_0x54a5fe[_0x6e70('0x22')],'include':_0x54a5fe[_0x6e70('0x23')]?_[_0x6e70('0x24')](_0x54a5fe[_0x6e70('0x23')],function(_0x5d772a){return{'model':db[_0x5d772a[_0x6e70('0x25')]],'as':_0x5d772a['as'],'attributes':_0x5d772a[_0x6e70('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0x26')](function(_0x2864a0){logger[_0x6e70('0x14')](_0x6e70('0x1d'),_0x3a9978);logger[_0x6e70('0x17')](_0x6e70('0x1d'),_0x3a9978,JSON[_0x6e70('0x19')](_0x2864a0));_0xcdf9f2(_0x2864a0);})[_0x6e70('0x27')](function(_0x4b1229){logger[_0x6e70('0x1a')]('GetVoiceExtension',_0x4b1229[_0x6e70('0x1b')],_0x3a9978);_0x1b2453(_0x3af484['error'](0x1f4,_0x4b1229[_0x6e70('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 7bc3854..97b1350 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 _0xbeb6=['voiceExtension:','./voiceExtension.events','save','remove','update','removeListener','register','length'];(function(_0x443e08,_0x22aa15){var _0x1b163b=function(_0x2e0078){while(--_0x2e0078){_0x443e08['push'](_0x443e08['shift']());}};_0x1b163b(++_0x22aa15);}(_0xbeb6,0x191));var _0x6beb=function(_0x43d581,_0x116f78){_0x43d581=_0x43d581-0x0;var _0x2f6346=_0xbeb6[_0x43d581];return _0x2f6346;};'use strict';var VoiceExtensionEvents=require(_0x6beb('0x0'));var events=[_0x6beb('0x1'),_0x6beb('0x2'),_0x6beb('0x3')];function createListener(_0x3feef4,_0x274564){return function(_0x329d0a){_0x274564['emit'](_0x3feef4,_0x329d0a);};}function removeListener(_0x3de91e,_0x14e282){return function(){VoiceExtensionEvents[_0x6beb('0x4')](_0x3de91e,_0x14e282);};}exports[_0x6beb('0x5')]=function(_0xff250b){for(var _0x4d8aa4=0x0,_0x4b83d0=events[_0x6beb('0x6')];_0x4d8aa4<_0x4b83d0;_0x4d8aa4++){var _0x257905=events[_0x4d8aa4];var _0x12cda4=createListener(_0x6beb('0x7')+_0x257905,_0xff250b);VoiceExtensionEvents['on'](_0x257905,_0x12cda4);}}; \ No newline at end of file +var _0x0d33=['remove','update','emit','register','voiceExtension:','./voiceExtension.events','save'];(function(_0x567d5f,_0x370ded){var _0x2bd089=function(_0x31342a){while(--_0x31342a){_0x567d5f['push'](_0x567d5f['shift']());}};_0x2bd089(++_0x370ded);}(_0x0d33,0x147));var _0x30d3=function(_0x4f25f5,_0x191e39){_0x4f25f5=_0x4f25f5-0x0;var _0x5e64d5=_0x0d33[_0x4f25f5];return _0x5e64d5;};'use strict';var VoiceExtensionEvents=require(_0x30d3('0x0'));var events=[_0x30d3('0x1'),_0x30d3('0x2'),_0x30d3('0x3')];function createListener(_0xb4dee3,_0x3eb06b){return function(_0x3d3130){_0x3eb06b[_0x30d3('0x4')](_0xb4dee3,_0x3d3130);};}function removeListener(_0x3e04ec,_0x295fc0){return function(){VoiceExtensionEvents['removeListener'](_0x3e04ec,_0x295fc0);};}exports[_0x30d3('0x5')]=function(_0x468636){for(var _0x4a8d89=0x0,_0x3c7983=events['length'];_0x4a8d89<_0x3c7983;_0x4a8d89++){var _0x27933e=events[_0x4a8d89];var _0x1bbe67=createListener(_0x30d3('0x6')+_0x27933e,_0x468636);VoiceExtensionEvents['on'](_0x27933e,_0x1bbe67);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 61eb173..d84c71b 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 _0xac65=['put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','getMessages','create'];(function(_0x54ab62,_0x58e021){var _0x2d71b8=function(_0x464463){while(--_0x464463){_0x54ab62['push'](_0x54ab62['shift']());}};_0x2d71b8(++_0x58e021);}(_0xac65,0x154));var _0x5ac6=function(_0x1aa64a,_0x259741){_0x1aa64a=_0x1aa64a-0x0;var _0x49402b=_0xac65[_0x1aa64a];return _0x49402b;};'use strict';var multer=require(_0x5ac6('0x0'));var util=require('util');var path=require(_0x5ac6('0x1'));var timeout=require(_0x5ac6('0x2'));var express=require(_0x5ac6('0x3'));var router=express[_0x5ac6('0x4')]();var auth=require(_0x5ac6('0x5'));var interaction=require(_0x5ac6('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x5ac6('0x7')]('/',auth[_0x5ac6('0x8')](),controller['index']);router[_0x5ac6('0x7')](_0x5ac6('0x9'),auth[_0x5ac6('0x8')](),controller['show']);router[_0x5ac6('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x5ac6('0xa')]);router['post']('/',auth[_0x5ac6('0x8')](),controller[_0x5ac6('0xb')]);router[_0x5ac6('0xc')]('/:id',auth[_0x5ac6('0x8')](),controller[_0x5ac6('0xd')]);router[_0x5ac6('0xe')]('/:id',auth[_0x5ac6('0x8')](),controller['destroy']);module[_0x5ac6('0xf')]=router; \ No newline at end of file +var _0x3068=['destroy','exports','path','express','../../components/interaction/service','get','isAuthenticated','/:id','/:id/messages','getMessages','create','put','update','delete'];(function(_0x40e557,_0x2822e9){var _0xbdd0e6=function(_0x28fbcd){while(--_0x28fbcd){_0x40e557['push'](_0x40e557['shift']());}};_0xbdd0e6(++_0x2822e9);}(_0x3068,0x1c2));var _0x8306=function(_0x381458,_0x481509){_0x381458=_0x381458-0x0;var _0x2b58fb=_0x3068[_0x381458];return _0x2b58fb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8306('0x0'));var timeout=require('connect-timeout');var express=require(_0x8306('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8306('0x2'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x8306('0x3')]('/',auth[_0x8306('0x4')](),controller['index']);router[_0x8306('0x3')](_0x8306('0x5'),auth[_0x8306('0x4')](),controller['show']);router['get'](_0x8306('0x6'),auth[_0x8306('0x4')](),controller[_0x8306('0x7')]);router['post']('/',auth[_0x8306('0x4')](),controller[_0x8306('0x8')]);router[_0x8306('0x9')](_0x8306('0x5'),auth[_0x8306('0x4')](),controller[_0x8306('0xa')]);router[_0x8306('0xb')](_0x8306('0x5'),auth[_0x8306('0x4')](),controller[_0x8306('0xc')]);module[_0x8306('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index f699dee..c0ffc9d 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 _0x67bc=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','from-voicemail','STRING','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x541fb3,_0x189ce6){var _0x3517a8=function(_0x977c09){while(--_0x977c09){_0x541fb3['push'](_0x541fb3['shift']());}};_0x3517a8(++_0x189ce6);}(_0x67bc,0x19e));var _0xc67b=function(_0x45b1ba,_0x5a6a21){_0x45b1ba=_0x45b1ba-0x0;var _0x145ddb=_0x67bc[_0x45b1ba];return _0x145ddb;};'use strict';var Sequelize=require(_0xc67b('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0xc67b('0x1'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xc67b('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xc67b('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc67b('0x2')],'validate':{'isEmail':!![]},'set':function(_0x70e058){this[_0xc67b('0x3')](_0xc67b('0x4'),typeof _0x70e058===_0xc67b('0x5')&&_0x70e058['trim']()?_0x70e058[_0xc67b('0x6')]():null);}},'pager':{'type':Sequelize[_0xc67b('0x2')]},'tz':{'type':Sequelize[_0xc67b('0x2')],'defaultValue':_0xc67b('0x7')},'attach':{'type':Sequelize[_0xc67b('0x8')](_0xc67b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xc67b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xc67b('0x2')]},'callback':{'type':Sequelize[_0xc67b('0x2')]},'review':{'type':Sequelize[_0xc67b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc67b('0x8')](_0xc67b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc67b('0x8')](_0xc67b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xc67b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xc67b('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xc67b('0x8')](_0xc67b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xc67b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xc67b('0x9'),'no'),'defaultValue':_0xc67b('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xc67b('0x8')](_0xc67b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xc67b('0x8')](_0xc67b('0x9'),'no'),'defaultValue':_0xc67b('0x9'),'allowNull':![]},'stamp':{'type':_0xc67b('0xb')},'emailsubject':{'type':Sequelize[_0xc67b('0x2')]},'emailbody':{'type':Sequelize[_0xc67b('0x2')]},'maxsecs':{'type':Sequelize[_0xc67b('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xc67b('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xc67b('0xd')],'get':function(){return this[_0xc67b('0xe')](_0xc67b('0xf'))+'\x20-\x20'+this[_0xc67b('0xe')](_0xc67b('0x10'));}}}; \ No newline at end of file +var _0x84c7=['yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x84c7,0x171));var _0x784c=function(_0x50a784,_0xc34cec){_0x50a784=_0x50a784-0x0;var _0x5f4331=_0x84c7[_0x50a784];return _0x5f4331;};'use strict';var Sequelize=require(_0x784c('0x0'));module[_0x784c('0x1')]={'customer_id':{'type':Sequelize[_0x784c('0x2')]},'context':{'type':Sequelize[_0x784c('0x2')],'defaultValue':_0x784c('0x3'),'unique':_0x784c('0x4')},'mailbox':{'type':Sequelize[_0x784c('0x2')],'defaultValue':'','allowNull':![],'unique':_0x784c('0x4')},'password':{'type':Sequelize[_0x784c('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x5d4eda){this[_0x784c('0x5')](_0x784c('0x6'),typeof _0x5d4eda===_0x784c('0x7')&&_0x5d4eda['trim']()?_0x5d4eda[_0x784c('0x8')]():null);}},'pager':{'type':Sequelize[_0x784c('0x2')]},'tz':{'type':Sequelize[_0x784c('0x2')],'defaultValue':_0x784c('0x9')},'attach':{'type':Sequelize[_0x784c('0xa')](_0x784c('0xb'),'no'),'defaultValue':_0x784c('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x784c('0xa')](_0x784c('0xb'),'no'),'defaultValue':_0x784c('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x784c('0x2')]},'callback':{'type':Sequelize[_0x784c('0x2')]},'review':{'type':Sequelize[_0x784c('0xa')](_0x784c('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x784c('0xa')](_0x784c('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x784c('0xa')](_0x784c('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x784c('0xa')](_0x784c('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x784c('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x784c('0xa')](_0x784c('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x784c('0xa')](_0x784c('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x784c('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x784c('0xa')](_0x784c('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x784c('0xa')](_0x784c('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x784c('0xb'),'no'),'defaultValue':_0x784c('0xb'),'allowNull':![]},'stamp':{'type':_0x784c('0xd')},'emailsubject':{'type':Sequelize[_0x784c('0x2')]},'emailbody':{'type':Sequelize[_0x784c('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x784c('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x784c('0xf')](_0x784c('0x10'))+_0x784c('0x11')+this[_0x784c('0xf')](_0x784c('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index eecc54b..6beeb7c 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 _0xfe72=['intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','length','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','VoiceMailMessage','mailbox','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','json','apply','save','update','then','destroy','get','Voicemails','UserProfileResource','stack','name','send','index','VoiceMail','rawAttributes','keys','query','filters'];(function(_0x5df2fc,_0x1cbb00){var _0x45ad73=function(_0x3f1d9d){while(--_0x3f1d9d){_0x5df2fc['push'](_0x5df2fc['shift']());}};_0x45ad73(++_0x1cbb00);}(_0xfe72,0x181));var _0x2fe7=function(_0x1ffa65,_0x4a5bb0){_0x1ffa65=_0x1ffa65-0x0;var _0x4c2d15=_0xfe72[_0x1ffa65];return _0x4c2d15;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2fe7('0x0'));var jsonpatch=require(_0x2fe7('0x1'));var rp=require(_0x2fe7('0x2'));var moment=require(_0x2fe7('0x3'));var BPromise=require(_0x2fe7('0x4'));var Mustache=require(_0x2fe7('0x5'));var util=require(_0x2fe7('0x6'));var path=require(_0x2fe7('0x7'));var sox=require(_0x2fe7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2fe7('0x9'));var squel=require(_0x2fe7('0xa'));var crypto=require(_0x2fe7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2fe7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2fe7('0xd'));var Papa=require(_0x2fe7('0xe'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0x2fe7('0xf'));var qs=require(_0x2fe7('0x10'));var logger=require('../../config/logger')(_0x2fe7('0x11'));var utils=require(_0x2fe7('0x12'));var config=require(_0x2fe7('0x13'));var db=require(_0x2fe7('0x14'))['db'];function respondWithStatusCode(_0xfc8326,_0x586b33){_0x586b33=_0x586b33||0xcc;return function(_0x58321e){if(_0x58321e){return _0xfc8326[_0x2fe7('0x15')](_0x586b33);}return _0xfc8326[_0x2fe7('0x16')](_0x586b33)[_0x2fe7('0x17')]();};}function respondWithResult(_0x5bc4e5,_0x11a6ce){_0x11a6ce=_0x11a6ce||0xc8;return function(_0x221b0e){if(_0x221b0e){return _0x5bc4e5[_0x2fe7('0x16')](_0x11a6ce)['json'](_0x221b0e);}};}function respondWithFilteredResult(_0x273a32,_0x4ac387){return function(_0x4582d5){if(_0x4582d5){var _0x2b7613=_0x4582d5[_0x2fe7('0x18')],_0x1f71df=_0x4ac387['offset'],_0x4fd353=_0x4ac387[_0x2fe7('0x19')]+_0x4ac387['limit'],_0x22bb03;if(_0x4fd353>=_0x2b7613){_0x4fd353=_0x2b7613;_0x22bb03=0xc8;}else{_0x22bb03=0xce;}_0x273a32[_0x2fe7('0x16')](_0x22bb03);return _0x273a32[_0x2fe7('0x1a')]('Content-Range',_0x1f71df+'-'+_0x4fd353+'/'+_0x2b7613)[_0x2fe7('0x1b')](_0x4582d5);}return null;};}function patchUpdates(_0x49de9b){return function(_0x2c4624){try{jsonpatch[_0x2fe7('0x1c')](_0x2c4624,_0x49de9b,!![]);}catch(_0x33a1a2){return BPromise['reject'](_0x33a1a2);}return _0x2c4624[_0x2fe7('0x1d')]();};}function saveUpdates(_0x24b32c,_0x4a4e1a){return function(_0x4bef69){if(_0x4bef69){return _0x4bef69[_0x2fe7('0x1e')](_0x24b32c)[_0x2fe7('0x1f')](function(_0x236212){return _0x236212;});}return null;};}function removeEntity(_0x497286,_0x129b12){return function(_0x3782ae){if(_0x3782ae){return _0x3782ae[_0x2fe7('0x20')]()['then'](function(){var _0x26ef05=_0x3782ae[_0x2fe7('0x21')]({'plain':!![]});var _0x163a74=_0x2fe7('0x22');return db[_0x2fe7('0x23')][_0x2fe7('0x20')]({'where':{'type':_0x163a74,'resourceId':_0x26ef05['id']}})[_0x2fe7('0x1f')](function(){return _0x3782ae;});})['then'](function(){_0x497286[_0x2fe7('0x16')](0xcc)[_0x2fe7('0x17')]();});}};}function handleEntityNotFound(_0x34bd60,_0x3dd756){return function(_0x2f8ba1){if(!_0x2f8ba1){_0x34bd60[_0x2fe7('0x15')](0x194);}return _0x2f8ba1;};}function handleError(_0x39aac9,_0x86f690){_0x86f690=_0x86f690||0x1f4;return function(_0x17db3e){logger['error'](_0x17db3e[_0x2fe7('0x24')]);if(_0x17db3e[_0x2fe7('0x25')]){delete _0x17db3e[_0x2fe7('0x25')];}_0x39aac9['status'](_0x86f690)[_0x2fe7('0x26')](_0x17db3e);};}exports[_0x2fe7('0x27')]=function(_0x2e9743,_0x2e58aa){var _0x1293f2={},_0xdc6403={},_0x291f5f={'count':0x0,'rows':[]};var _0x584bf9=db[_0x2fe7('0x28')][_0x2fe7('0x29')];_0xdc6403['model']=_[_0x2fe7('0x2a')](_0x584bf9);_0xdc6403[_0x2fe7('0x2b')]=_[_0x2fe7('0x2a')](_0x2e9743[_0x2fe7('0x2b')]);_0xdc6403[_0x2fe7('0x2c')]=_[_0x2fe7('0x2d')](_0xdc6403[_0x2fe7('0x2e')],_0xdc6403[_0x2fe7('0x2b')]);_0x1293f2[_0x2fe7('0x2f')]=_[_0x2fe7('0x2d')](_0xdc6403[_0x2fe7('0x2e')],qs['fields'](_0x2e9743[_0x2fe7('0x2b')][_0x2fe7('0x30')]));_0x1293f2[_0x2fe7('0x2f')]=_0x1293f2[_0x2fe7('0x2f')]['length']?_0x1293f2[_0x2fe7('0x2f')]:_0xdc6403['model'];if(!_0x2e9743[_0x2fe7('0x2b')][_0x2fe7('0x31')](_0x2fe7('0x32'))){_0x1293f2[_0x2fe7('0x33')]=qs[_0x2fe7('0x33')](_0x2e9743[_0x2fe7('0x2b')][_0x2fe7('0x33')]);_0x1293f2[_0x2fe7('0x19')]=qs[_0x2fe7('0x19')](_0x2e9743[_0x2fe7('0x2b')]['offset']);}_0x1293f2[_0x2fe7('0x34')]=qs[_0x2fe7('0x35')](_0x2e9743[_0x2fe7('0x2b')][_0x2fe7('0x35')]);_0x1293f2[_0x2fe7('0x36')]=qs['filters'](_[_0x2fe7('0x37')](_0x2e9743['query'],_0xdc6403[_0x2fe7('0x2c')]));if(_0x2e9743[_0x2fe7('0x2b')][_0x2fe7('0x38')]){_0x1293f2[_0x2fe7('0x36')]=_[_0x2fe7('0x39')](_0x1293f2[_0x2fe7('0x36')],{'$or':_[_0x2fe7('0x3a')](_0x584bf9,function(_0x38cb62){if(_0x38cb62[_0x2fe7('0x3b')][_0x2fe7('0x3c')]!==_0x2fe7('0x3d')){var _0x54e65d={};_0x54e65d[_0x38cb62[_0x2fe7('0x3e')]]={'$like':'%'+_0x2e9743[_0x2fe7('0x2b')][_0x2fe7('0x38')]+'%'};return _0x54e65d;}})});}_0x1293f2=_[_0x2fe7('0x39')]({},_0x1293f2,_0x2e9743[_0x2fe7('0x3f')]);var _0x1c183c={'where':_0x1293f2[_0x2fe7('0x36')]};return db[_0x2fe7('0x28')][_0x2fe7('0x18')](_0x1c183c)[_0x2fe7('0x1f')](function(_0x5716a6){_0x291f5f[_0x2fe7('0x18')]=_0x5716a6;if(_0x2e9743[_0x2fe7('0x2b')]['includeAll']){_0x1293f2[_0x2fe7('0x40')]=[{'all':!![]}];}return db[_0x2fe7('0x28')][_0x2fe7('0x41')](_0x1293f2);})[_0x2fe7('0x1f')](function(_0x2a5bfd){_0x291f5f[_0x2fe7('0x42')]=_0x2a5bfd;return _0x291f5f;})[_0x2fe7('0x1f')](respondWithFilteredResult(_0x2e58aa,_0x1293f2))[_0x2fe7('0x43')](handleError(_0x2e58aa,null));};exports[_0x2fe7('0x44')]=function(_0x116321,_0x3c20ee){var _0x1d78c9={'raw':!![],'where':{'id':_0x116321[_0x2fe7('0x45')]['id']}},_0x5beed8={};_0x5beed8[_0x2fe7('0x2e')]=_['keys'](db[_0x2fe7('0x28')][_0x2fe7('0x29')]);_0x5beed8[_0x2fe7('0x2b')]=_[_0x2fe7('0x2a')](_0x116321['query']);_0x5beed8[_0x2fe7('0x2c')]=_[_0x2fe7('0x2d')](_0x5beed8[_0x2fe7('0x2e')],_0x5beed8[_0x2fe7('0x2b')]);_0x1d78c9[_0x2fe7('0x2f')]=_['intersection'](_0x5beed8[_0x2fe7('0x2e')],qs[_0x2fe7('0x30')](_0x116321[_0x2fe7('0x2b')][_0x2fe7('0x30')]));_0x1d78c9[_0x2fe7('0x2f')]=_0x1d78c9[_0x2fe7('0x2f')][_0x2fe7('0x46')]?_0x1d78c9[_0x2fe7('0x2f')]:_0x5beed8['model'];if(_0x116321[_0x2fe7('0x2b')][_0x2fe7('0x47')]){_0x1d78c9['include']=[{'all':!![]}];}_0x1d78c9=_[_0x2fe7('0x39')]({},_0x1d78c9,_0x116321['options']);return db[_0x2fe7('0x28')][_0x2fe7('0x48')](_0x1d78c9)[_0x2fe7('0x1f')](handleEntityNotFound(_0x3c20ee,null))[_0x2fe7('0x1f')](respondWithResult(_0x3c20ee,null))[_0x2fe7('0x43')](handleError(_0x3c20ee,null));};exports['create']=function(_0x33b959,_0x33d86c){return db[_0x2fe7('0x28')]['create'](_0x33b959[_0x2fe7('0x49')],{})[_0x2fe7('0x1f')](function(_0x1518ad){var _0x3c5103=_0x33b959[_0x2fe7('0x4a')]['get']({'plain':!![]});if(!_0x3c5103)throw new Error(_0x2fe7('0x4b'));if(_0x3c5103[_0x2fe7('0x4c')]==='user'){var _0x5c3c12=_0x1518ad[_0x2fe7('0x21')]({'plain':!![]});var _0x39f0f6=_0x2fe7('0x22');return db[_0x2fe7('0x4d')][_0x2fe7('0x48')]({'where':{'name':_0x39f0f6,'userProfileId':_0x3c5103[_0x2fe7('0x4e')]},'raw':!![]})['then'](function(_0x262120){if(_0x262120&&_0x262120[_0x2fe7('0x4f')]===0x0){return db[_0x2fe7('0x23')][_0x2fe7('0x50')]({'name':_0x5c3c12['name'],'resourceId':_0x5c3c12['id'],'type':_0x262120[_0x2fe7('0x25')],'sectionId':_0x262120['id']},{})['then'](function(){return _0x1518ad;});}else{return _0x1518ad;}})[_0x2fe7('0x43')](function(_0x38812b){logger['error'](_0x2fe7('0x51'),_0x38812b);throw _0x38812b;});}return _0x1518ad;})[_0x2fe7('0x1f')](respondWithResult(_0x33d86c,0xc9))[_0x2fe7('0x43')](handleError(_0x33d86c,null));};exports[_0x2fe7('0x1e')]=function(_0x4841f0,_0x5bfc78){if(_0x4841f0[_0x2fe7('0x49')]['id']){delete _0x4841f0[_0x2fe7('0x49')]['id'];}return db[_0x2fe7('0x28')][_0x2fe7('0x48')]({'where':{'id':_0x4841f0[_0x2fe7('0x45')]['id']}})[_0x2fe7('0x1f')](handleEntityNotFound(_0x5bfc78,null))[_0x2fe7('0x1f')](saveUpdates(_0x4841f0[_0x2fe7('0x49')],null))['then'](respondWithResult(_0x5bfc78,null))[_0x2fe7('0x43')](handleError(_0x5bfc78,null));};exports['destroy']=function(_0x55dd90,_0x4c248a){return db[_0x2fe7('0x28')][_0x2fe7('0x48')]({'where':{'id':_0x55dd90[_0x2fe7('0x45')]['id']}})[_0x2fe7('0x1f')](handleEntityNotFound(_0x4c248a,null))['then'](removeEntity(_0x4c248a,null))[_0x2fe7('0x43')](handleError(_0x4c248a,null));};exports[_0x2fe7('0x52')]=function(_0x5a5f54,_0x440eba,_0x347559){return db[_0x2fe7('0x28')]['findOne']({'where':{'id':_0x5a5f54[_0x2fe7('0x45')]['id']}})['then'](handleEntityNotFound(_0x440eba,null))[_0x2fe7('0x1f')](function(_0x105880){var _0x1f23c5;var _0x150079={},_0x5bc64b={};_0x5bc64b[_0x2fe7('0x2e')]=_[_0x2fe7('0x2a')](db[_0x2fe7('0x53')][_0x2fe7('0x29')]);_0x5bc64b[_0x2fe7('0x2b')]=_[_0x2fe7('0x2a')](_0x5a5f54[_0x2fe7('0x2b')]);_0x5bc64b[_0x2fe7('0x2c')]=_[_0x2fe7('0x2d')](_0x5bc64b[_0x2fe7('0x2e')],_0x5bc64b[_0x2fe7('0x2b')]);_0x150079['attributes']=_[_0x2fe7('0x2d')](_0x5bc64b[_0x2fe7('0x2e')],qs[_0x2fe7('0x30')](_0x5a5f54[_0x2fe7('0x2b')][_0x2fe7('0x30')]));_0x150079[_0x2fe7('0x2f')]=_0x150079[_0x2fe7('0x2f')]['length']?_0x150079['attributes']:_0x5bc64b[_0x2fe7('0x2e')];if(!_0x5a5f54[_0x2fe7('0x2b')][_0x2fe7('0x31')](_0x2fe7('0x32'))){_0x150079[_0x2fe7('0x33')]=qs[_0x2fe7('0x33')](_0x5a5f54[_0x2fe7('0x2b')][_0x2fe7('0x33')]);_0x150079[_0x2fe7('0x19')]=qs[_0x2fe7('0x19')](_0x5a5f54[_0x2fe7('0x2b')][_0x2fe7('0x19')]);}_0x150079[_0x2fe7('0x34')]=qs['sort'](_0x5a5f54[_0x2fe7('0x2b')]['sort']);_0x150079[_0x2fe7('0x36')]=qs[_0x2fe7('0x2c')](_[_0x2fe7('0x37')](_0x5a5f54[_0x2fe7('0x2b')],_0x5bc64b[_0x2fe7('0x2c')]));if(_0x5a5f54[_0x2fe7('0x2b')]['filter']){_0x150079[_0x2fe7('0x36')]=_[_0x2fe7('0x39')](_0x150079['where'],{'$or':_['map'](_0x150079[_0x2fe7('0x2f')],function(_0x4e8665){var _0x5d033c={};_0x5d033c[_0x4e8665]={'$like':'%'+_0x5a5f54['query'][_0x2fe7('0x38')]+'%'};return _0x5d033c;})});}_0x150079[_0x2fe7('0x36')]=_[_0x2fe7('0x39')](_0x150079[_0x2fe7('0x36')],{'mailboxuser':_0x105880[_0x2fe7('0x54')]});_0x150079=_[_0x2fe7('0x39')]({},_0x150079,_0x5a5f54['options']);return db['VoiceMailMessage'][_0x2fe7('0x55')](_0x150079)[_0x2fe7('0x1f')](respondWithFilteredResult(_0x440eba,_0x150079));})[_0x2fe7('0x43')](handleError(_0x440eba,null));}; \ No newline at end of file +var _0xc3b0=['papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','get','Voicemails','error','stack','name','send','VoiceMail','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','find','getMessages','findOne','VoiceMailMessage','order','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring'];(function(_0x20ad6c,_0x1d11a8){var _0x4a818c=function(_0x1ddc77){while(--_0x1ddc77){_0x20ad6c['push'](_0x20ad6c['shift']());}};_0x4a818c(++_0x1d11a8);}(_0xc3b0,0x19d));var _0x0c3b=function(_0x1b9957,_0x2dd44e){_0x1b9957=_0x1b9957-0x0;var _0x38f172=_0xc3b0[_0x1b9957];return _0x38f172;};'use strict';var pdf=require(_0x0c3b('0x0'));var emlformat=require(_0x0c3b('0x1'));var rimraf=require(_0x0c3b('0x2'));var zipdir=require(_0x0c3b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c3b('0x4'));var moment=require(_0x0c3b('0x5'));var BPromise=require(_0x0c3b('0x6'));var Mustache=require(_0x0c3b('0x7'));var util=require(_0x0c3b('0x8'));var path=require(_0x0c3b('0x9'));var sox=require(_0x0c3b('0xa'));var csv=require(_0x0c3b('0xb'));var ejs=require(_0x0c3b('0xc'));var fs=require('fs');var _=require(_0x0c3b('0xd'));var squel=require(_0x0c3b('0xe'));var crypto=require(_0x0c3b('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0c3b('0x10'));var Papa=require(_0x0c3b('0x11'));var authService=require(_0x0c3b('0x12'));var hardwareService=require(_0x0c3b('0x13'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x0c3b('0x14'))('api');var utils=require(_0x0c3b('0x15'));var config=require('../../config/environment');var db=require(_0x0c3b('0x16'))['db'];function respondWithStatusCode(_0x12333d,_0x9dbd90){_0x9dbd90=_0x9dbd90||0xcc;return function(_0x574e76){if(_0x574e76){return _0x12333d[_0x0c3b('0x17')](_0x9dbd90);}return _0x12333d[_0x0c3b('0x18')](_0x9dbd90)[_0x0c3b('0x19')]();};}function respondWithResult(_0xc2102c,_0x24ab35){_0x24ab35=_0x24ab35||0xc8;return function(_0x2a5953){if(_0x2a5953){return _0xc2102c[_0x0c3b('0x18')](_0x24ab35)[_0x0c3b('0x1a')](_0x2a5953);}};}function respondWithFilteredResult(_0x38315d,_0x14b1ce){return function(_0x245d3f){if(_0x245d3f){var _0x162f60=_0x245d3f[_0x0c3b('0x1b')],_0x57d215=_0x14b1ce['offset'],_0x11cc83=_0x14b1ce[_0x0c3b('0x1c')]+_0x14b1ce[_0x0c3b('0x1d')],_0x3833b6;if(_0x11cc83>=_0x162f60){_0x11cc83=_0x162f60;_0x3833b6=0xc8;}else{_0x3833b6=0xce;}_0x38315d[_0x0c3b('0x18')](_0x3833b6);return _0x38315d[_0x0c3b('0x1e')](_0x0c3b('0x1f'),_0x57d215+'-'+_0x11cc83+'/'+_0x162f60)[_0x0c3b('0x1a')](_0x245d3f);}return null;};}function patchUpdates(_0x2d96c4){return function(_0x463333){try{jsonpatch[_0x0c3b('0x20')](_0x463333,_0x2d96c4,!![]);}catch(_0x4198f0){return BPromise['reject'](_0x4198f0);}return _0x463333[_0x0c3b('0x21')]();};}function saveUpdates(_0x56eb3e,_0x1e70d4){return function(_0x3093e2){if(_0x3093e2){return _0x3093e2['update'](_0x56eb3e)[_0x0c3b('0x22')](function(_0x45e901){return _0x45e901;});}return null;};}function removeEntity(_0x3edcde,_0x5269d3){return function(_0x2c25b1){if(_0x2c25b1){return _0x2c25b1['destroy']()[_0x0c3b('0x22')](function(){var _0x15f9db=_0x2c25b1[_0x0c3b('0x23')]({'plain':!![]});var _0xc0cd4b=_0x0c3b('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0xc0cd4b,'resourceId':_0x15f9db['id']}})[_0x0c3b('0x22')](function(){return _0x2c25b1;});})[_0x0c3b('0x22')](function(){_0x3edcde[_0x0c3b('0x18')](0xcc)[_0x0c3b('0x19')]();});}};}function handleEntityNotFound(_0x4134bf,_0x70f0f4){return function(_0x4b288d){if(!_0x4b288d){_0x4134bf['sendStatus'](0x194);}return _0x4b288d;};}function handleError(_0x436f9e,_0x4994cb){_0x4994cb=_0x4994cb||0x1f4;return function(_0x4a35f2){logger[_0x0c3b('0x25')](_0x4a35f2[_0x0c3b('0x26')]);if(_0x4a35f2[_0x0c3b('0x27')]){delete _0x4a35f2['name'];}_0x436f9e['status'](_0x4994cb)[_0x0c3b('0x28')](_0x4a35f2);};}exports['index']=function(_0x2b523b,_0x348c8c){var _0x1595dd={},_0x21c49b={},_0x111869={'count':0x0,'rows':[]};var _0x299157=db[_0x0c3b('0x29')][_0x0c3b('0x2a')];_0x21c49b[_0x0c3b('0x2b')]=_['keys'](_0x299157);_0x21c49b['query']=_[_0x0c3b('0x2c')](_0x2b523b[_0x0c3b('0x2d')]);_0x21c49b[_0x0c3b('0x2e')]=_[_0x0c3b('0x2f')](_0x21c49b[_0x0c3b('0x2b')],_0x21c49b[_0x0c3b('0x2d')]);_0x1595dd[_0x0c3b('0x30')]=_[_0x0c3b('0x2f')](_0x21c49b[_0x0c3b('0x2b')],qs[_0x0c3b('0x31')](_0x2b523b[_0x0c3b('0x2d')][_0x0c3b('0x31')]));_0x1595dd[_0x0c3b('0x30')]=_0x1595dd[_0x0c3b('0x30')][_0x0c3b('0x32')]?_0x1595dd[_0x0c3b('0x30')]:_0x21c49b[_0x0c3b('0x2b')];if(!_0x2b523b['query'][_0x0c3b('0x33')](_0x0c3b('0x34'))){_0x1595dd['limit']=qs[_0x0c3b('0x1d')](_0x2b523b[_0x0c3b('0x2d')][_0x0c3b('0x1d')]);_0x1595dd[_0x0c3b('0x1c')]=qs[_0x0c3b('0x1c')](_0x2b523b[_0x0c3b('0x2d')]['offset']);}_0x1595dd['order']=qs[_0x0c3b('0x35')](_0x2b523b[_0x0c3b('0x2d')][_0x0c3b('0x35')]);_0x1595dd[_0x0c3b('0x36')]=qs[_0x0c3b('0x2e')](_[_0x0c3b('0x37')](_0x2b523b[_0x0c3b('0x2d')],_0x21c49b['filters']));if(_0x2b523b[_0x0c3b('0x2d')][_0x0c3b('0x38')]){_0x1595dd[_0x0c3b('0x36')]=_[_0x0c3b('0x39')](_0x1595dd[_0x0c3b('0x36')],{'$or':_[_0x0c3b('0x3a')](_0x299157,function(_0x1f965c){if(_0x1f965c['type'][_0x0c3b('0x3b')]!==_0x0c3b('0x3c')){var _0x1cd5ee={};_0x1cd5ee[_0x1f965c[_0x0c3b('0x3d')]]={'$like':'%'+_0x2b523b[_0x0c3b('0x2d')]['filter']+'%'};return _0x1cd5ee;}})});}_0x1595dd=_[_0x0c3b('0x39')]({},_0x1595dd,_0x2b523b[_0x0c3b('0x3e')]);var _0x5cce5b={'where':_0x1595dd[_0x0c3b('0x36')]};return db[_0x0c3b('0x29')][_0x0c3b('0x1b')](_0x5cce5b)[_0x0c3b('0x22')](function(_0x31e99f){_0x111869['count']=_0x31e99f;if(_0x2b523b[_0x0c3b('0x2d')][_0x0c3b('0x3f')]){_0x1595dd[_0x0c3b('0x40')]=[{'all':!![]}];}return db[_0x0c3b('0x29')][_0x0c3b('0x41')](_0x1595dd);})[_0x0c3b('0x22')](function(_0x26e07c){_0x111869['rows']=_0x26e07c;return _0x111869;})[_0x0c3b('0x22')](respondWithFilteredResult(_0x348c8c,_0x1595dd))[_0x0c3b('0x42')](handleError(_0x348c8c,null));};exports[_0x0c3b('0x43')]=function(_0x1c76e6,_0x3a43f8){var _0x538af2={'raw':!![],'where':{'id':_0x1c76e6[_0x0c3b('0x44')]['id']}},_0x39409a={};_0x39409a[_0x0c3b('0x2b')]=_[_0x0c3b('0x2c')](db[_0x0c3b('0x29')]['rawAttributes']);_0x39409a[_0x0c3b('0x2d')]=_[_0x0c3b('0x2c')](_0x1c76e6['query']);_0x39409a['filters']=_[_0x0c3b('0x2f')](_0x39409a[_0x0c3b('0x2b')],_0x39409a[_0x0c3b('0x2d')]);_0x538af2[_0x0c3b('0x30')]=_[_0x0c3b('0x2f')](_0x39409a[_0x0c3b('0x2b')],qs[_0x0c3b('0x31')](_0x1c76e6[_0x0c3b('0x2d')][_0x0c3b('0x31')]));_0x538af2['attributes']=_0x538af2[_0x0c3b('0x30')][_0x0c3b('0x32')]?_0x538af2['attributes']:_0x39409a[_0x0c3b('0x2b')];if(_0x1c76e6[_0x0c3b('0x2d')][_0x0c3b('0x3f')]){_0x538af2[_0x0c3b('0x40')]=[{'all':!![]}];}_0x538af2=_[_0x0c3b('0x39')]({},_0x538af2,_0x1c76e6[_0x0c3b('0x3e')]);return db['VoiceMail']['find'](_0x538af2)['then'](handleEntityNotFound(_0x3a43f8,null))[_0x0c3b('0x22')](respondWithResult(_0x3a43f8,null))[_0x0c3b('0x42')](handleError(_0x3a43f8,null));};exports['create']=function(_0x16cfc0,_0x56b1d3){return db[_0x0c3b('0x29')][_0x0c3b('0x45')](_0x16cfc0[_0x0c3b('0x46')],{})['then'](function(_0x38566d){var _0x4dcbdb=_0x16cfc0[_0x0c3b('0x47')][_0x0c3b('0x23')]({'plain':!![]});if(!_0x4dcbdb)throw new Error(_0x0c3b('0x48'));if(_0x4dcbdb[_0x0c3b('0x49')]==='user'){var _0x27677e=_0x38566d['get']({'plain':!![]});var _0x461f2d=_0x0c3b('0x24');return db[_0x0c3b('0x4a')]['find']({'where':{'name':_0x461f2d,'userProfileId':_0x4dcbdb[_0x0c3b('0x4b')]},'raw':!![]})[_0x0c3b('0x22')](function(_0x34073c){if(_0x34073c&&_0x34073c['autoAssociation']===0x0){return db[_0x0c3b('0x4c')]['create']({'name':_0x27677e[_0x0c3b('0x27')],'resourceId':_0x27677e['id'],'type':_0x34073c[_0x0c3b('0x27')],'sectionId':_0x34073c['id']},{})[_0x0c3b('0x22')](function(){return _0x38566d;});}else{return _0x38566d;}})['catch'](function(_0x457ae7){logger['error'](_0x0c3b('0x4d'),_0x457ae7);throw _0x457ae7;});}return _0x38566d;})[_0x0c3b('0x22')](respondWithResult(_0x56b1d3,0xc9))[_0x0c3b('0x42')](handleError(_0x56b1d3,null));};exports[_0x0c3b('0x4e')]=function(_0x40a1c9,_0x56e752){if(_0x40a1c9[_0x0c3b('0x46')]['id']){delete _0x40a1c9[_0x0c3b('0x46')]['id'];}return db[_0x0c3b('0x29')]['find']({'where':{'id':_0x40a1c9[_0x0c3b('0x44')]['id']}})[_0x0c3b('0x22')](handleEntityNotFound(_0x56e752,null))['then'](saveUpdates(_0x40a1c9[_0x0c3b('0x46')],null))[_0x0c3b('0x22')](respondWithResult(_0x56e752,null))[_0x0c3b('0x42')](handleError(_0x56e752,null));};exports[_0x0c3b('0x4f')]=function(_0xc3ded,_0x16825a){return db[_0x0c3b('0x29')][_0x0c3b('0x50')]({'where':{'id':_0xc3ded[_0x0c3b('0x44')]['id']}})['then'](handleEntityNotFound(_0x16825a,null))['then'](removeEntity(_0x16825a,null))[_0x0c3b('0x42')](handleError(_0x16825a,null));};exports[_0x0c3b('0x51')]=function(_0xed4c55,_0x3d8468,_0x3b0e36){return db[_0x0c3b('0x29')][_0x0c3b('0x52')]({'where':{'id':_0xed4c55['params']['id']}})['then'](handleEntityNotFound(_0x3d8468,null))[_0x0c3b('0x22')](function(_0x3af044){var _0x52dbdb;var _0x12d233={},_0x3a32b9={};_0x3a32b9[_0x0c3b('0x2b')]=_[_0x0c3b('0x2c')](db[_0x0c3b('0x53')][_0x0c3b('0x2a')]);_0x3a32b9[_0x0c3b('0x2d')]=_['keys'](_0xed4c55['query']);_0x3a32b9[_0x0c3b('0x2e')]=_[_0x0c3b('0x2f')](_0x3a32b9[_0x0c3b('0x2b')],_0x3a32b9[_0x0c3b('0x2d')]);_0x12d233['attributes']=_[_0x0c3b('0x2f')](_0x3a32b9[_0x0c3b('0x2b')],qs['fields'](_0xed4c55[_0x0c3b('0x2d')][_0x0c3b('0x31')]));_0x12d233['attributes']=_0x12d233[_0x0c3b('0x30')][_0x0c3b('0x32')]?_0x12d233['attributes']:_0x3a32b9[_0x0c3b('0x2b')];if(!_0xed4c55[_0x0c3b('0x2d')][_0x0c3b('0x33')](_0x0c3b('0x34'))){_0x12d233[_0x0c3b('0x1d')]=qs['limit'](_0xed4c55[_0x0c3b('0x2d')][_0x0c3b('0x1d')]);_0x12d233[_0x0c3b('0x1c')]=qs[_0x0c3b('0x1c')](_0xed4c55[_0x0c3b('0x2d')][_0x0c3b('0x1c')]);}_0x12d233[_0x0c3b('0x54')]=qs[_0x0c3b('0x35')](_0xed4c55['query'][_0x0c3b('0x35')]);_0x12d233[_0x0c3b('0x36')]=qs[_0x0c3b('0x2e')](_[_0x0c3b('0x37')](_0xed4c55[_0x0c3b('0x2d')],_0x3a32b9[_0x0c3b('0x2e')]));if(_0xed4c55['query']['filter']){_0x12d233[_0x0c3b('0x36')]=_['merge'](_0x12d233['where'],{'$or':_[_0x0c3b('0x3a')](_0x12d233[_0x0c3b('0x30')],function(_0x4923ce){var _0x883911={};_0x883911[_0x4923ce]={'$like':'%'+_0xed4c55[_0x0c3b('0x2d')][_0x0c3b('0x38')]+'%'};return _0x883911;})});}_0x12d233[_0x0c3b('0x36')]=_[_0x0c3b('0x39')](_0x12d233[_0x0c3b('0x36')],{'mailboxuser':_0x3af044['mailbox']});_0x12d233=_[_0x0c3b('0x39')]({},_0x12d233,_0xed4c55[_0x0c3b('0x3e')]);return db[_0x0c3b('0x53')][_0x0c3b('0x55')](_0x12d233)['then'](respondWithFilteredResult(_0x3d8468,_0x12d233));})['catch'](handleError(_0x3d8468,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 0dc9d8b..ddef908 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 _0x8a53=['mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','request-promise','exports','define','voice_voicemail'];(function(_0xe299f1,_0xb36771){var _0x5ea8f4=function(_0x126f15){while(--_0x126f15){_0xe299f1['push'](_0xe299f1['shift']());}};_0x5ea8f4(++_0xb36771);}(_0x8a53,0x117));var _0x38a5=function(_0x31f4ba,_0x1ef8ba){_0x31f4ba=_0x31f4ba-0x0;var _0x414943=_0x8a53[_0x31f4ba];return _0x414943;};'use strict';var _=require(_0x38a5('0x0'));var util=require(_0x38a5('0x1'));var logger=require(_0x38a5('0x2'))(_0x38a5('0x3'));var moment=require(_0x38a5('0x4'));var BPromise=require('bluebird');var rp=require(_0x38a5('0x5'));var attributes=require('./voiceMail.attributes');module[_0x38a5('0x6')]=function(_0x367771,_0x355063){return _0x367771[_0x38a5('0x7')]('VoiceMail',attributes,{'tableName':_0x38a5('0x8'),'paranoid':![],'indexes':[{'name':_0x38a5('0x9'),'fields':[_0x38a5('0xa'),_0x38a5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x38a5=['mailbox','context','lodash','util','../../config/logger','api','bluebird','request-promise','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail'];(function(_0x3f8545,_0x392bb4){var _0x3785be=function(_0x29f62a){while(--_0x29f62a){_0x3f8545['push'](_0x3f8545['shift']());}};_0x3785be(++_0x392bb4);}(_0x38a5,0x188));var _0x538a=function(_0x2a7b76,_0x4f6b5f){_0x2a7b76=_0x2a7b76-0x0;var _0x3f12f9=_0x38a5[_0x2a7b76];return _0x3f12f9;};'use strict';var _=require(_0x538a('0x0'));var util=require(_0x538a('0x1'));var logger=require(_0x538a('0x2'))(_0x538a('0x3'));var moment=require('moment');var BPromise=require(_0x538a('0x4'));var rp=require(_0x538a('0x5'));var attributes=require(_0x538a('0x6'));module[_0x538a('0x7')]=function(_0x1b71a9,_0x4597d7){return _0x1b71a9[_0x538a('0x8')](_0x538a('0x9'),attributes,{'tableName':_0x538a('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x538a('0xb'),_0x538a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 4619182..e69b02f 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 _0x16f9=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','VoiceMail,\x20%s,\x20%s','message','request\x20sent','catch','util','moment','bluebird'];(function(_0x156578,_0x180b06){var _0x3d4cee=function(_0x5e0c58){while(--_0x5e0c58){_0x156578['push'](_0x156578['shift']());}};_0x3d4cee(++_0x180b06);}(_0x16f9,0x89));var _0x916f=function(_0x4baa4f,_0x9b3d37){_0x4baa4f=_0x4baa4f-0x0;var _0x8a206d=_0x16f9[_0x4baa4f];return _0x8a206d;};'use strict';var _=require('lodash');var util=require(_0x916f('0x0'));var moment=require(_0x916f('0x1'));var BPromise=require(_0x916f('0x2'));var rs=require(_0x916f('0x3'));var fs=require('fs');var Redis=require(_0x916f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x916f('0x5'))(_0x916f('0x6'));var config=require(_0x916f('0x7'));var jayson=require(_0x916f('0x8'));var client=jayson[_0x916f('0x9')][_0x916f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x229005,_0x41e359,_0x3fede6){return new BPromise(function(_0x5e7072,_0x229224){return client[_0x916f('0xb')](_0x229005,_0x3fede6)[_0x916f('0xc')](function(_0x37b95b){logger['info']('VoiceMail,\x20%s,\x20%s',_0x41e359,'request\x20sent');logger['debug'](_0x916f('0xd'),_0x41e359,'request\x20sent',JSON['stringify'](_0x37b95b));if(_0x37b95b[_0x916f('0xe')]){if(_0x37b95b[_0x916f('0xe')][_0x916f('0xf')]===0x1f4){logger[_0x916f('0xe')](_0x916f('0x10'),_0x41e359,_0x37b95b['error'][_0x916f('0x11')]);return _0x229224(_0x37b95b['error'][_0x916f('0x11')]);}logger[_0x916f('0xe')](_0x916f('0x10'),_0x41e359,_0x37b95b['error'][_0x916f('0x11')]);return _0x5e7072(_0x37b95b['error'][_0x916f('0x11')]);}else{logger['info'](_0x916f('0x10'),_0x41e359,_0x916f('0x12'));_0x5e7072(_0x37b95b['result'][_0x916f('0x11')]);}})[_0x916f('0x13')](function(_0x44c083){logger['error'](_0x916f('0x10'),_0x41e359,_0x44c083);_0x229224(_0x44c083);});});} \ No newline at end of file +var _0x1f75=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x4a20d8,_0x270adf){var _0x3e675a=function(_0x3caaea){while(--_0x3caaea){_0x4a20d8['push'](_0x4a20d8['shift']());}};_0x3e675a(++_0x270adf);}(_0x1f75,0x12a));var _0x51f7=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x1f75[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x51f7('0x0'));var util=require('util');var moment=require(_0x51f7('0x1'));var BPromise=require(_0x51f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51f7('0x3'));var db=require(_0x51f7('0x4'))['db'];var utils=require(_0x51f7('0x5'));var logger=require(_0x51f7('0x6'))(_0x51f7('0x7'));var config=require(_0x51f7('0x8'));var jayson=require(_0x51f7('0x9'));var client=jayson[_0x51f7('0xa')][_0x51f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x357bd7,_0x2b8ebd,_0x2c1d40){return new BPromise(function(_0x4f68c0,_0x49d2d0){return client['request'](_0x357bd7,_0x2c1d40)['then'](function(_0x3d59d0){logger[_0x51f7('0xc')](_0x51f7('0xd'),_0x2b8ebd,'request\x20sent');logger['debug'](_0x51f7('0xe'),_0x2b8ebd,_0x51f7('0xf'),JSON['stringify'](_0x3d59d0));if(_0x3d59d0[_0x51f7('0x10')]){if(_0x3d59d0[_0x51f7('0x10')][_0x51f7('0x11')]===0x1f4){logger[_0x51f7('0x10')](_0x51f7('0xd'),_0x2b8ebd,_0x3d59d0[_0x51f7('0x10')][_0x51f7('0x12')]);return _0x49d2d0(_0x3d59d0[_0x51f7('0x10')][_0x51f7('0x12')]);}logger[_0x51f7('0x10')](_0x51f7('0xd'),_0x2b8ebd,_0x3d59d0['error'][_0x51f7('0x12')]);return _0x4f68c0(_0x3d59d0['error'][_0x51f7('0x12')]);}else{logger[_0x51f7('0xc')](_0x51f7('0xd'),_0x2b8ebd,'request\x20sent');_0x4f68c0(_0x3d59d0[_0x51f7('0x13')][_0x51f7('0x12')]);}})[_0x51f7('0x14')](function(_0x511ca4){logger[_0x51f7('0x10')](_0x51f7('0xd'),_0x2b8ebd,_0x511ca4);_0x49d2d0(_0x511ca4);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index fc58b3d..a3d0ff6 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 _0xaf37=['/:id/download','download','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show'];(function(_0x40b0b9,_0x59cd60){var _0x28e0e2=function(_0x2b75c6){while(--_0x2b75c6){_0x40b0b9['push'](_0x40b0b9['shift']());}};_0x28e0e2(++_0x59cd60);}(_0xaf37,0xa1));var _0x7af3=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0xaf37[_0x1ed116];return _0x574066;};'use strict';var multer=require('multer');var util=require(_0x7af3('0x0'));var path=require(_0x7af3('0x1'));var timeout=require(_0x7af3('0x2'));var express=require('express');var router=express[_0x7af3('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7af3('0x4'));var config=require('../../config/environment');var controller=require(_0x7af3('0x5'));router[_0x7af3('0x6')]('/',auth[_0x7af3('0x7')](),controller['index']);router[_0x7af3('0x6')](_0x7af3('0x8'),auth[_0x7af3('0x7')](),controller[_0x7af3('0x9')]);router[_0x7af3('0x6')](_0x7af3('0xa'),auth[_0x7af3('0x7')](),controller[_0x7af3('0xb')]);router[_0x7af3('0xc')]('/',auth[_0x7af3('0x7')](),controller[_0x7af3('0xd')]);router[_0x7af3('0xe')](_0x7af3('0x8'),auth[_0x7af3('0x7')](),controller[_0x7af3('0xf')]);router[_0x7af3('0x10')](_0x7af3('0x8'),auth['isAuthenticated'](),controller[_0x7af3('0x11')]);module[_0x7af3('0x12')]=router; \ No newline at end of file +var _0x68cd=['create','put','update','delete','/:id','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','show','get','/:id/download','download','post'];(function(_0x330d36,_0x35dd8f){var _0x15204d=function(_0x46ab91){while(--_0x46ab91){_0x330d36['push'](_0x330d36['shift']());}};_0x15204d(++_0x35dd8f);}(_0x68cd,0xa5));var _0xd68c=function(_0x55841f,_0x487812){_0x55841f=_0x55841f-0x0;var _0x4c5ccf=_0x68cd[_0x55841f];return _0x4c5ccf;};'use strict';var multer=require(_0xd68c('0x0'));var util=require(_0xd68c('0x1'));var path=require(_0xd68c('0x2'));var timeout=require(_0xd68c('0x3'));var express=require(_0xd68c('0x4'));var router=express['Router']();var auth=require(_0xd68c('0x5'));var interaction=require(_0xd68c('0x6'));var config=require(_0xd68c('0x7'));var controller=require(_0xd68c('0x8'));router['get']('/',auth[_0xd68c('0x9')](),controller['index']);router['get']('/:id',auth[_0xd68c('0x9')](),controller[_0xd68c('0xa')]);router[_0xd68c('0xb')](_0xd68c('0xc'),auth['isAuthenticated'](),controller[_0xd68c('0xd')]);router[_0xd68c('0xe')]('/',auth[_0xd68c('0x9')](),controller[_0xd68c('0xf')]);router[_0xd68c('0x10')]('/:id',auth[_0xd68c('0x9')](),controller[_0xd68c('0x11')]);router[_0xd68c('0x12')](_0xd68c('0x13'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 9f62d9b..bc58a3a 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 _0xdf7e=['STRING','BLOB','TIMESTAMP','sequelize','exports','getDataValue','INTEGER'];(function(_0x24612b,_0x2cb525){var _0xee7085=function(_0x13cc71){while(--_0x13cc71){_0x24612b['push'](_0x24612b['shift']());}};_0xee7085(++_0x2cb525);}(_0xdf7e,0x11b));var _0xedf7=function(_0x2c08e8,_0x17bb57){_0x2c08e8=_0x2c08e8-0x0;var _0x320ad6=_0xdf7e[_0x2c08e8];return _0x320ad6;};'use strict';var Sequelize=require(_0xedf7('0x0'));module[_0xedf7('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x574c67){return this[_0xedf7('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xedf7('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xedf7('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xedf7('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xedf7('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xedf7('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xedf7('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xedf7('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xedf7('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xedf7('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xedf7('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xedf7('0x4')],'defaultValue':''},'stamp':{'type':_0xedf7('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0x4a83=['BLOB','long','TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x52dfb0,_0x5b61cd){var _0x481e61=function(_0xb7d92e){while(--_0xb7d92e){_0x52dfb0['push'](_0x52dfb0['shift']());}};_0x481e61(++_0x5b61cd);}(_0x4a83,0x1cb));var _0x34a8=function(_0x4742d8,_0xa5a9a2){_0x4742d8=_0x4742d8-0x0;var _0x16a904=_0x4a83[_0x4742d8];return _0x16a904;};'use strict';var Sequelize=require('sequelize');module[_0x34a8('0x0')]={'name':{'type':Sequelize[_0x34a8('0x1')],'get':function(_0x41b64d){return this[_0x34a8('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x34a8('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x34a8('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x34a8('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x34a8('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x34a8('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x34a8('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x34a8('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x34a8('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x34a8('0x5')](_0x34a8('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x34a8('0x4')],'defaultValue':''},'stamp':{'type':_0x34a8('0x7'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index cea7d99..da84360 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 _0x47c5=['pick','merge','map','type','VIRTUAL','field','includeAll','include','findAll','catch','show','params','options','find','create','body','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','VoiceMailMessage','rawAttributes','model','differenceBy','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where'];(function(_0x358b89,_0x564336){var _0x12c6cf=function(_0x222500){while(--_0x222500){_0x358b89['push'](_0x358b89['shift']());}};_0x12c6cf(++_0x564336);}(_0x47c5,0x165));var _0x547c=function(_0x34574a,_0x413644){_0x34574a=_0x34574a-0x0;var _0x5dff3f=_0x47c5[_0x34574a];return _0x5dff3f;};'use strict';var pdf=require(_0x547c('0x0'));var emlformat=require(_0x547c('0x1'));var rimraf=require(_0x547c('0x2'));var zipdir=require(_0x547c('0x3'));var jsonpatch=require(_0x547c('0x4'));var rp=require(_0x547c('0x5'));var moment=require('moment');var BPromise=require(_0x547c('0x6'));var Mustache=require(_0x547c('0x7'));var util=require('util');var path=require(_0x547c('0x8'));var sox=require(_0x547c('0x9'));var csv=require('to-csv');var ejs=require(_0x547c('0xa'));var fs=require('fs');var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x10'));var querystring=require(_0x547c('0x11'));var Papa=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var hardwareService=require(_0x547c('0x14'));var Redis=require(_0x547c('0x15'));var qs=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require(_0x547c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13a103,_0x39dce7){_0x39dce7=_0x39dce7||0xcc;return function(_0x5eea67){if(_0x5eea67){return _0x13a103[_0x547c('0x1b')](_0x39dce7);}return _0x13a103[_0x547c('0x1c')](_0x39dce7)[_0x547c('0x1d')]();};}function respondWithResult(_0x5016e9,_0x392a35){_0x392a35=_0x392a35||0xc8;return function(_0x150317){if(_0x150317){return _0x5016e9[_0x547c('0x1c')](_0x392a35)[_0x547c('0x1e')](_0x150317);}};}function respondWithFilteredResult(_0x255aa6,_0x161991){return function(_0x240243){if(_0x240243){var _0x103455=_0x240243[_0x547c('0x1f')],_0x39f316=_0x161991[_0x547c('0x20')],_0x23644b=_0x161991[_0x547c('0x20')]+_0x161991['limit'],_0x2d5331;if(_0x23644b>=_0x103455){_0x23644b=_0x103455;_0x2d5331=0xc8;}else{_0x2d5331=0xce;}_0x255aa6['status'](_0x2d5331);return _0x255aa6[_0x547c('0x21')](_0x547c('0x22'),_0x39f316+'-'+_0x23644b+'/'+_0x103455)[_0x547c('0x1e')](_0x240243);}return null;};}function patchUpdates(_0x4a8901){return function(_0x248aca){try{jsonpatch[_0x547c('0x23')](_0x248aca,_0x4a8901,!![]);}catch(_0x1ddbd3){return BPromise['reject'](_0x1ddbd3);}return _0x248aca[_0x547c('0x24')]();};}function saveUpdates(_0x41149f,_0x496c38){return function(_0x5453f9){if(_0x5453f9){return _0x5453f9[_0x547c('0x25')](_0x41149f)[_0x547c('0x26')](function(_0x4f20c1){return _0x4f20c1;});}return null;};}function removeEntity(_0x11e709,_0x16a3a6){return function(_0x592e46){if(_0x592e46){return _0x592e46[_0x547c('0x27')]()[_0x547c('0x26')](function(){_0x11e709[_0x547c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a55a0,_0x361c5c){return function(_0x470694){if(!_0x470694){_0x3a55a0[_0x547c('0x1b')](0x194);}return _0x470694;};}function handleError(_0x1f3581,_0x2663bc){_0x2663bc=_0x2663bc||0x1f4;return function(_0x2ab2cc){logger[_0x547c('0x28')](_0x2ab2cc['stack']);if(_0x2ab2cc[_0x547c('0x29')]){delete _0x2ab2cc['name'];}_0x1f3581['status'](_0x2663bc)['send'](_0x2ab2cc);};}exports['index']=function(_0x2c725d,_0x4c5256){var _0x93985c={},_0x5729b0={},_0x3ea493={'count':0x0,'rows':[]};var _0x486216=db[_0x547c('0x2a')][_0x547c('0x2b')];_0x5729b0[_0x547c('0x2c')]=_[_0x547c('0x2d')](_[_0x547c('0x2e')](_0x486216),['name']);_0x5729b0['query']=_[_0x547c('0x2e')](_0x2c725d['query']);_0x5729b0[_0x547c('0x2f')]=_[_0x547c('0x30')](_0x5729b0[_0x547c('0x2c')],_0x5729b0[_0x547c('0x31')]);_0x93985c[_0x547c('0x32')]=_[_0x547c('0x30')](_0x5729b0[_0x547c('0x2c')],qs['fields'](_0x2c725d['query'][_0x547c('0x33')]));_0x93985c[_0x547c('0x32')]=_0x93985c[_0x547c('0x32')][_0x547c('0x34')]?_0x93985c[_0x547c('0x32')]:_0x5729b0[_0x547c('0x2c')];if(!_0x2c725d[_0x547c('0x31')][_0x547c('0x35')](_0x547c('0x36'))){_0x93985c[_0x547c('0x37')]=qs[_0x547c('0x37')](_0x2c725d[_0x547c('0x31')][_0x547c('0x37')]);_0x93985c[_0x547c('0x20')]=qs['offset'](_0x2c725d[_0x547c('0x31')]['offset']);}_0x93985c['order']=qs['sort'](_0x2c725d[_0x547c('0x31')][_0x547c('0x38')]);_0x93985c[_0x547c('0x39')]=qs[_0x547c('0x2f')](_[_0x547c('0x3a')](_0x2c725d[_0x547c('0x31')],_0x5729b0['filters']));if(_0x2c725d['query']['filter']){_0x93985c[_0x547c('0x39')]=_[_0x547c('0x3b')](_0x93985c[_0x547c('0x39')],{'$or':_[_0x547c('0x3c')](_0x486216,function(_0xe0352c){if(_0xe0352c[_0x547c('0x3d')]['key']!==_0x547c('0x3e')){var _0x4e2e52={};_0x4e2e52[_0xe0352c[_0x547c('0x3f')]]={'$like':'%'+_0x2c725d[_0x547c('0x31')]['filter']+'%'};return _0x4e2e52;}})});}_0x93985c=_[_0x547c('0x3b')]({},_0x93985c,_0x2c725d['options']);var _0x511103={'where':_0x93985c[_0x547c('0x39')]};return db[_0x547c('0x2a')][_0x547c('0x1f')](_0x511103)[_0x547c('0x26')](function(_0x4c36b9){_0x3ea493['count']=_0x4c36b9;if(_0x2c725d[_0x547c('0x31')][_0x547c('0x40')]){_0x93985c[_0x547c('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x547c('0x42')](_0x93985c);})[_0x547c('0x26')](function(_0x4746ee){_0x3ea493['rows']=_0x4746ee;return _0x3ea493;})[_0x547c('0x26')](respondWithFilteredResult(_0x4c5256,_0x93985c))[_0x547c('0x43')](handleError(_0x4c5256,null));};exports[_0x547c('0x44')]=function(_0x59ae8a,_0x26e8d2){var _0xc28dc0={'raw':!![],'where':{'id':_0x59ae8a[_0x547c('0x45')]['id']}},_0x4906ae={};_0x4906ae[_0x547c('0x2c')]=_[_0x547c('0x2e')](db['VoiceMailMessage'][_0x547c('0x2b')]);_0x4906ae['query']=_[_0x547c('0x2e')](_0x59ae8a['query']);_0x4906ae[_0x547c('0x2f')]=_[_0x547c('0x30')](_0x4906ae[_0x547c('0x2c')],_0x4906ae[_0x547c('0x31')]);_0xc28dc0[_0x547c('0x32')]=_[_0x547c('0x30')](_0x4906ae['model'],qs['fields'](_0x59ae8a[_0x547c('0x31')][_0x547c('0x33')]));_0xc28dc0[_0x547c('0x32')]=_0xc28dc0['attributes'][_0x547c('0x34')]?_0xc28dc0[_0x547c('0x32')]:_0x4906ae[_0x547c('0x2c')];if(_0x59ae8a[_0x547c('0x31')][_0x547c('0x40')]){_0xc28dc0[_0x547c('0x41')]=[{'all':!![]}];}_0xc28dc0=_['merge']({},_0xc28dc0,_0x59ae8a[_0x547c('0x46')]);return db[_0x547c('0x2a')][_0x547c('0x47')](_0xc28dc0)['then'](handleEntityNotFound(_0x26e8d2,null))[_0x547c('0x26')](respondWithResult(_0x26e8d2,null))[_0x547c('0x43')](handleError(_0x26e8d2,null));};exports[_0x547c('0x48')]=function(_0x3167d0,_0x5f40eb){return db[_0x547c('0x2a')]['create'](_0x3167d0[_0x547c('0x49')],{})['then'](respondWithResult(_0x5f40eb,0xc9))[_0x547c('0x43')](handleError(_0x5f40eb,null));};exports[_0x547c('0x25')]=function(_0x5e8511,_0x124541){if(_0x5e8511[_0x547c('0x49')]['id']){delete _0x5e8511[_0x547c('0x49')]['id'];}return db[_0x547c('0x2a')]['find']({'where':{'id':_0x5e8511[_0x547c('0x45')]['id']}})['then'](handleEntityNotFound(_0x124541,null))['then'](saveUpdates(_0x5e8511[_0x547c('0x49')],null))[_0x547c('0x26')](respondWithResult(_0x124541,null))[_0x547c('0x43')](handleError(_0x124541,null));};exports[_0x547c('0x27')]=function(_0x1daaf4,_0x22cfd3){return db[_0x547c('0x2a')][_0x547c('0x47')]({'where':{'id':_0x1daaf4[_0x547c('0x45')]['id']}})[_0x547c('0x26')](handleEntityNotFound(_0x22cfd3,null))[_0x547c('0x26')](removeEntity(_0x22cfd3,null))[_0x547c('0x43')](handleError(_0x22cfd3,null));};exports['download']=function(_0x4a0f42,_0x3af4f0,_0x21ea26){return db['VoiceMailMessage'][_0x547c('0x47')]({'where':{'id':_0x4a0f42[_0x547c('0x45')]['id']},'attributes':['id',_0x547c('0x4a'),_0x547c('0x4b')]})[_0x547c('0x26')](handleEntityNotFound(_0x3af4f0,null))[_0x547c('0x26')](function(_0x4d4cf9){if(_0x4d4cf9){if(!_0x4d4cf9[_0x547c('0x4a')]){throw new db['Sequelize'][(_0x547c('0x4c'))](_0x547c('0x4d'));}var _0x1bdaf0={'Content-Type':'audio/wav','Content-Disposition':_0x547c('0x4e')};if(_0x4d4cf9['msg_id']){_0x1bdaf0[_0x547c('0x4f')]=_0x547c('0x50')+_0x4d4cf9['msg_id']+_0x547c('0x51');}_0x3af4f0[_0x547c('0x21')](_0x1bdaf0);return _0x3af4f0[_0x547c('0x52')](new Buffer(_0x4d4cf9[_0x547c('0x4a')]));}})[_0x547c('0x43')](handleError(_0x3af4f0,null));}; \ No newline at end of file +var _0x5f2f=['keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','map','key','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','msg_id','attachment;\x20filename=\x22','.wav\x22','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','VoiceMailMessage','rawAttributes'];(function(_0x259cd1,_0x3460a1){var _0x1b5f6f=function(_0x2c3431){while(--_0x2c3431){_0x259cd1['push'](_0x259cd1['shift']());}};_0x1b5f6f(++_0x3460a1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x300d13,_0x412659){_0x300d13=_0x300d13-0x0;var _0x39541d=_0x5f2f[_0x300d13];return _0x39541d;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var authService=require(_0xf5f2('0x11'));var hardwareService=require(_0xf5f2('0x12'));var Redis=require('ioredis');var qs=require(_0xf5f2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf5f2('0x14'));var config=require(_0xf5f2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x336f6b,_0x14b51f){_0x14b51f=_0x14b51f||0xcc;return function(_0x331482){if(_0x331482){return _0x336f6b[_0xf5f2('0x16')](_0x14b51f);}return _0x336f6b[_0xf5f2('0x17')](_0x14b51f)[_0xf5f2('0x18')]();};}function respondWithResult(_0x5c01b8,_0x5850f4){_0x5850f4=_0x5850f4||0xc8;return function(_0xea612c){if(_0xea612c){return _0x5c01b8[_0xf5f2('0x17')](_0x5850f4)[_0xf5f2('0x19')](_0xea612c);}};}function respondWithFilteredResult(_0x422b55,_0x4d97fc){return function(_0xafe430){if(_0xafe430){var _0x286197=_0xafe430[_0xf5f2('0x1a')],_0x17d656=_0x4d97fc[_0xf5f2('0x1b')],_0x1b6dd2=_0x4d97fc[_0xf5f2('0x1b')]+_0x4d97fc[_0xf5f2('0x1c')],_0x23e23a;if(_0x1b6dd2>=_0x286197){_0x1b6dd2=_0x286197;_0x23e23a=0xc8;}else{_0x23e23a=0xce;}_0x422b55[_0xf5f2('0x17')](_0x23e23a);return _0x422b55[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x17d656+'-'+_0x1b6dd2+'/'+_0x286197)[_0xf5f2('0x19')](_0xafe430);}return null;};}function patchUpdates(_0x3ee69){return function(_0x3cf5ea){try{jsonpatch[_0xf5f2('0x1f')](_0x3cf5ea,_0x3ee69,!![]);}catch(_0x1bf655){return BPromise['reject'](_0x1bf655);}return _0x3cf5ea[_0xf5f2('0x20')]();};}function saveUpdates(_0x47101e,_0x49dac2){return function(_0x47acfc){if(_0x47acfc){return _0x47acfc[_0xf5f2('0x21')](_0x47101e)[_0xf5f2('0x22')](function(_0x4ae323){return _0x4ae323;});}return null;};}function removeEntity(_0x45b74f,_0x170042){return function(_0x39e44a){if(_0x39e44a){return _0x39e44a[_0xf5f2('0x23')]()[_0xf5f2('0x22')](function(){_0x45b74f['status'](0xcc)[_0xf5f2('0x18')]();});}};}function handleEntityNotFound(_0x4669a6,_0x4e8bda){return function(_0x2833fe){if(!_0x2833fe){_0x4669a6[_0xf5f2('0x16')](0x194);}return _0x2833fe;};}function handleError(_0x5bdf4a,_0x529f07){_0x529f07=_0x529f07||0x1f4;return function(_0x5f1124){logger[_0xf5f2('0x24')](_0x5f1124[_0xf5f2('0x25')]);if(_0x5f1124[_0xf5f2('0x26')]){delete _0x5f1124[_0xf5f2('0x26')];}_0x5bdf4a[_0xf5f2('0x17')](_0x529f07)[_0xf5f2('0x27')](_0x5f1124);};}exports[_0xf5f2('0x28')]=function(_0x294414,_0x4ab014){var _0xaa2602={},_0x102449={},_0x375ca8={'count':0x0,'rows':[]};var _0x31bfcb=db[_0xf5f2('0x29')][_0xf5f2('0x2a')];_0x102449['model']=_['differenceBy'](_[_0xf5f2('0x2b')](_0x31bfcb),[_0xf5f2('0x26')]);_0x102449[_0xf5f2('0x2c')]=_['keys'](_0x294414['query']);_0x102449[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x102449[_0xf5f2('0x2f')],_0x102449[_0xf5f2('0x2c')]);_0xaa2602[_0xf5f2('0x30')]=_['intersection'](_0x102449['model'],qs[_0xf5f2('0x31')](_0x294414['query'][_0xf5f2('0x31')]));_0xaa2602['attributes']=_0xaa2602[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0xaa2602[_0xf5f2('0x30')]:_0x102449[_0xf5f2('0x2f')];if(!_0x294414[_0xf5f2('0x2c')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0xaa2602[_0xf5f2('0x1c')]=qs['limit'](_0x294414[_0xf5f2('0x2c')][_0xf5f2('0x1c')]);_0xaa2602[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x294414[_0xf5f2('0x2c')][_0xf5f2('0x1b')]);}_0xaa2602[_0xf5f2('0x35')]=qs['sort'](_0x294414[_0xf5f2('0x2c')][_0xf5f2('0x36')]);_0xaa2602['where']=qs[_0xf5f2('0x2d')](_['pick'](_0x294414[_0xf5f2('0x2c')],_0x102449[_0xf5f2('0x2d')]));if(_0x294414[_0xf5f2('0x2c')][_0xf5f2('0x37')]){_0xaa2602['where']=_['merge'](_0xaa2602[_0xf5f2('0x38')],{'$or':_[_0xf5f2('0x39')](_0x31bfcb,function(_0x20eb74){if(_0x20eb74['type'][_0xf5f2('0x3a')]!=='VIRTUAL'){var _0x9da533={};_0x9da533[_0x20eb74['field']]={'$like':'%'+_0x294414[_0xf5f2('0x2c')][_0xf5f2('0x37')]+'%'};return _0x9da533;}})});}_0xaa2602=_['merge']({},_0xaa2602,_0x294414[_0xf5f2('0x3b')]);var _0x46eb22={'where':_0xaa2602[_0xf5f2('0x38')]};return db[_0xf5f2('0x29')]['count'](_0x46eb22)['then'](function(_0x3d328f){_0x375ca8[_0xf5f2('0x1a')]=_0x3d328f;if(_0x294414[_0xf5f2('0x2c')][_0xf5f2('0x3c')]){_0xaa2602[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0xaa2602);})['then'](function(_0x110fe5){_0x375ca8[_0xf5f2('0x3f')]=_0x110fe5;return _0x375ca8;})['then'](respondWithFilteredResult(_0x4ab014,_0xaa2602))[_0xf5f2('0x40')](handleError(_0x4ab014,null));};exports[_0xf5f2('0x41')]=function(_0x71b0e7,_0x85b6d0){var _0xd10701={'raw':!![],'where':{'id':_0x71b0e7[_0xf5f2('0x42')]['id']}},_0x3b6372={};_0x3b6372[_0xf5f2('0x2f')]=_['keys'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x3b6372[_0xf5f2('0x2c')]=_['keys'](_0x71b0e7['query']);_0x3b6372['filters']=_[_0xf5f2('0x2e')](_0x3b6372[_0xf5f2('0x2f')],_0x3b6372['query']);_0xd10701[_0xf5f2('0x30')]=_[_0xf5f2('0x2e')](_0x3b6372[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x71b0e7[_0xf5f2('0x2c')][_0xf5f2('0x31')]));_0xd10701[_0xf5f2('0x30')]=_0xd10701[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0xd10701[_0xf5f2('0x30')]:_0x3b6372[_0xf5f2('0x2f')];if(_0x71b0e7[_0xf5f2('0x2c')][_0xf5f2('0x3c')]){_0xd10701[_0xf5f2('0x3d')]=[{'all':!![]}];}_0xd10701=_['merge']({},_0xd10701,_0x71b0e7[_0xf5f2('0x3b')]);return db['VoiceMailMessage'][_0xf5f2('0x43')](_0xd10701)[_0xf5f2('0x22')](handleEntityNotFound(_0x85b6d0,null))[_0xf5f2('0x22')](respondWithResult(_0x85b6d0,null))[_0xf5f2('0x40')](handleError(_0x85b6d0,null));};exports[_0xf5f2('0x44')]=function(_0x3721c4,_0x55a633){return db[_0xf5f2('0x29')][_0xf5f2('0x44')](_0x3721c4[_0xf5f2('0x45')],{})[_0xf5f2('0x22')](respondWithResult(_0x55a633,0xc9))[_0xf5f2('0x40')](handleError(_0x55a633,null));};exports[_0xf5f2('0x21')]=function(_0xf638ff,_0x297f07){if(_0xf638ff['body']['id']){delete _0xf638ff[_0xf5f2('0x45')]['id'];}return db[_0xf5f2('0x29')][_0xf5f2('0x43')]({'where':{'id':_0xf638ff['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x297f07,null))[_0xf5f2('0x22')](saveUpdates(_0xf638ff[_0xf5f2('0x45')],null))['then'](respondWithResult(_0x297f07,null))['catch'](handleError(_0x297f07,null));};exports[_0xf5f2('0x23')]=function(_0x27c472,_0x5db519){return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x27c472[_0xf5f2('0x42')]['id']}})['then'](handleEntityNotFound(_0x5db519,null))[_0xf5f2('0x22')](removeEntity(_0x5db519,null))['catch'](handleError(_0x5db519,null));};exports[_0xf5f2('0x46')]=function(_0xb8ea3a,_0xbb658c,_0x11a083){return db['VoiceMailMessage'][_0xf5f2('0x43')]({'where':{'id':_0xb8ea3a[_0xf5f2('0x42')]['id']},'attributes':['id','recording','msg_id']})[_0xf5f2('0x22')](handleEntityNotFound(_0xbb658c,null))[_0xf5f2('0x22')](function(_0x57782c){if(_0x57782c){if(!_0x57782c[_0xf5f2('0x47')]){throw new db[(_0xf5f2('0x48'))][(_0xf5f2('0x49'))](_0xf5f2('0x4a'));}var _0x5d0db0={'Content-Type':'audio/wav','Content-Disposition':_0xf5f2('0x4b')};if(_0x57782c[_0xf5f2('0x4c')]){_0x5d0db0['Content-Disposition']=_0xf5f2('0x4d')+_0x57782c[_0xf5f2('0x4c')]+_0xf5f2('0x4e');}_0xbb658c[_0xf5f2('0x1d')](_0x5d0db0);return _0xbb658c[_0xf5f2('0x27')](new Buffer(_0x57782c[_0xf5f2('0x47')]));}})[_0xf5f2('0x40')](handleError(_0xbb658c,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 655a8ff..2bc5021 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 _0xf6d0=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','exports'];(function(_0x31240d,_0x2c3464){var _0x118f42=function(_0x1c17e7){while(--_0x1c17e7){_0x31240d['push'](_0x31240d['shift']());}};_0x118f42(++_0x2c3464);}(_0xf6d0,0x108));var _0x0f6d=function(_0x39ac53,_0xaee8fa){_0x39ac53=_0x39ac53-0x0;var _0x971416=_0xf6d0[_0x39ac53];return _0x971416;};'use strict';var _=require(_0x0f6d('0x0'));var util=require(_0x0f6d('0x1'));var logger=require(_0x0f6d('0x2'))(_0x0f6d('0x3'));var moment=require('moment');var BPromise=require(_0x0f6d('0x4'));var rp=require('request-promise');var attributes=require('./voiceMailMessage.attributes');module[_0x0f6d('0x5')]=function(_0x454583,_0x430888){return _0x454583['define'](_0x0f6d('0x6'),attributes,{'tableName':_0x0f6d('0x7'),'paranoid':![],'indexes':[{'name':_0x0f6d('0x8'),'fields':[_0x0f6d('0x8')]}],'timestamps':![]});}; \ No newline at end of file +var _0xaf19=['moment','request-promise','define','VoiceMailMessage','dir','lodash','util','../../config/logger'];(function(_0x290add,_0x5d7c8e){var _0x1d5817=function(_0x3f888a){while(--_0x3f888a){_0x290add['push'](_0x290add['shift']());}};_0x1d5817(++_0x5d7c8e);}(_0xaf19,0xdd));var _0x9af1=function(_0x9adc9,_0x3cf69e){_0x9adc9=_0x9adc9-0x0;var _0x3c5637=_0xaf19[_0x9adc9];return _0x3c5637;};'use strict';var _=require(_0x9af1('0x0'));var util=require(_0x9af1('0x1'));var logger=require(_0x9af1('0x2'))('api');var moment=require(_0x9af1('0x3'));var BPromise=require('bluebird');var rp=require(_0x9af1('0x4'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x12677a,_0x56548c){return _0x12677a[_0x9af1('0x5')](_0x9af1('0x6'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x9af1('0x7'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index aea74e6..4539563 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 _0xdcf6=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x200827,_0x4af951){var _0x120047=function(_0x4431de){while(--_0x4431de){_0x200827['push'](_0x200827['shift']());}};_0x120047(++_0x4af951);}(_0xdcf6,0x1a3));var _0x6dcf=function(_0x574fc1,_0x9079d){_0x574fc1=_0x574fc1-0x0;var _0x422848=_0xdcf6[_0x574fc1];return _0x422848;};'use strict';var _=require('lodash');var util=require(_0x6dcf('0x0'));var moment=require(_0x6dcf('0x1'));var BPromise=require(_0x6dcf('0x2'));var rs=require(_0x6dcf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6dcf('0x4'))('rpc');var config=require(_0x6dcf('0x5'));var jayson=require(_0x6dcf('0x6'));var client=jayson[_0x6dcf('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1924ac,_0xe35bd4,_0x39383b){return new BPromise(function(_0x302b77,_0x5e8296){return client['request'](_0x1924ac,_0x39383b)[_0x6dcf('0x8')](function(_0x1ecbc9){logger[_0x6dcf('0x9')](_0x6dcf('0xa'),_0xe35bd4,_0x6dcf('0xb'));logger[_0x6dcf('0xc')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0xe35bd4,_0x6dcf('0xb'),JSON[_0x6dcf('0xd')](_0x1ecbc9));if(_0x1ecbc9[_0x6dcf('0xe')]){if(_0x1ecbc9[_0x6dcf('0xe')][_0x6dcf('0xf')]===0x1f4){logger[_0x6dcf('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0xe35bd4,_0x1ecbc9[_0x6dcf('0xe')]['message']);return _0x5e8296(_0x1ecbc9[_0x6dcf('0xe')][_0x6dcf('0x10')]);}logger[_0x6dcf('0xe')](_0x6dcf('0xa'),_0xe35bd4,_0x1ecbc9[_0x6dcf('0xe')][_0x6dcf('0x10')]);return _0x302b77(_0x1ecbc9['error'][_0x6dcf('0x10')]);}else{logger[_0x6dcf('0x9')]('VoiceMailMessage,\x20%s,\x20%s',_0xe35bd4,_0x6dcf('0xb'));_0x302b77(_0x1ecbc9['result']['message']);}})[_0x6dcf('0x11')](function(_0x38207f){logger[_0x6dcf('0xe')](_0x6dcf('0xa'),_0xe35bd4,_0x38207f);_0x5e8296(_0x38207f);});});} \ No newline at end of file +var _0x3e26=['stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','info','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','request\x20sent'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3e26,0x8c));var _0x63e2=function(_0x3e4af3,_0x5e6681){_0x3e4af3=_0x3e4af3-0x0;var _0x190c6e=_0x3e26[_0x3e4af3];return _0x190c6e;};'use strict';var _=require(_0x63e2('0x0'));var util=require(_0x63e2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x63e2('0x2'));var fs=require('fs');var Redis=require(_0x63e2('0x3'));var db=require(_0x63e2('0x4'))['db'];var utils=require(_0x63e2('0x5'));var logger=require('../../config/logger')(_0x63e2('0x6'));var config=require(_0x63e2('0x7'));var jayson=require(_0x63e2('0x8'));var client=jayson[_0x63e2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cbef1,_0x3db9f3,_0x4588e0){return new BPromise(function(_0x2faa6a,_0x9e25b0){return client['request'](_0x1cbef1,_0x4588e0)[_0x63e2('0xa')](function(_0x54037e){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x3db9f3,_0x63e2('0xb'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x3db9f3,_0x63e2('0xb'),JSON[_0x63e2('0xc')](_0x54037e));if(_0x54037e['error']){if(_0x54037e[_0x63e2('0xd')][_0x63e2('0xe')]===0x1f4){logger['error'](_0x63e2('0xf'),_0x3db9f3,_0x54037e[_0x63e2('0xd')]['message']);return _0x9e25b0(_0x54037e[_0x63e2('0xd')][_0x63e2('0x10')]);}logger[_0x63e2('0xd')](_0x63e2('0xf'),_0x3db9f3,_0x54037e[_0x63e2('0xd')][_0x63e2('0x10')]);return _0x2faa6a(_0x54037e[_0x63e2('0xd')][_0x63e2('0x10')]);}else{logger[_0x63e2('0x11')](_0x63e2('0xf'),_0x3db9f3,_0x63e2('0xb'));_0x2faa6a(_0x54037e[_0x63e2('0x12')]['message']);}})['catch'](function(_0x3f8193){logger[_0x63e2('0xd')](_0x63e2('0xf'),_0x3db9f3,_0x3f8193);_0x9e25b0(_0x3f8193);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 84cbc15..73ed291 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 _0x4c6d=['removeSound','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/sounds','post','create','addSound','put','destroy','delete','/:id/sounds/:id2'];(function(_0x29d4b5,_0x1913e2){var _0x3fbb01=function(_0x8b0a41){while(--_0x8b0a41){_0x29d4b5['push'](_0x29d4b5['shift']());}};_0x3fbb01(++_0x1913e2);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x43969f,_0x700f8d){_0x43969f=_0x43969f-0x0;var _0x53ee2d=_0x4c6d[_0x43969f];return _0x53ee2d;};'use strict';var multer=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var path=require(_0xd4c6('0x2'));var timeout=require(_0xd4c6('0x3'));var express=require(_0xd4c6('0x4'));var router=express['Router']();var auth=require(_0xd4c6('0x5'));var interaction=require(_0xd4c6('0x6'));var config=require(_0xd4c6('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0xd4c6('0x8')]('/',auth[_0xd4c6('0x9')](),controller['index']);router[_0xd4c6('0x8')](_0xd4c6('0xa'),auth[_0xd4c6('0x9')](),controller['show']);router[_0xd4c6('0x8')](_0xd4c6('0xb'),auth[_0xd4c6('0x9')](),controller['getSounds']);router[_0xd4c6('0xc')]('/',auth[_0xd4c6('0x9')](),controller[_0xd4c6('0xd')]);router['post'](_0xd4c6('0xb'),auth[_0xd4c6('0x9')](),controller[_0xd4c6('0xe')]);router[_0xd4c6('0xf')](_0xd4c6('0xa'),auth[_0xd4c6('0x9')](),controller['update']);router['delete'](_0xd4c6('0xa'),auth['isAuthenticated'](),controller[_0xd4c6('0x10')]);router[_0xd4c6('0x11')](_0xd4c6('0x12'),auth[_0xd4c6('0x9')](),controller[_0xd4c6('0x13')]);module[_0xd4c6('0x14')]=router; \ No newline at end of file +var _0xa8a8=['../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','post','addSound','put','update','delete','removeSound','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x4c7fc8,_0x113186){var _0x467c13=function(_0x318b6c){while(--_0x318b6c){_0x4c7fc8['push'](_0x4c7fc8['shift']());}};_0x467c13(++_0x113186);}(_0xa8a8,0xec));var _0x8a8a=function(_0x17585b,_0x5942e2){_0x17585b=_0x17585b-0x0;var _0x401587=_0xa8a8[_0x17585b];return _0x401587;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var auth=require(_0x8a8a('0x5'));var interaction=require(_0x8a8a('0x6'));var config=require(_0x8a8a('0x7'));var controller=require(_0x8a8a('0x8'));router[_0x8a8a('0x9')]('/',auth[_0x8a8a('0xa')](),controller[_0x8a8a('0xb')]);router[_0x8a8a('0x9')](_0x8a8a('0xc'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0xd')]);router[_0x8a8a('0x9')](_0x8a8a('0xe'),auth[_0x8a8a('0xa')](),controller['getSounds']);router['post']('/',auth[_0x8a8a('0xa')](),controller['create']);router[_0x8a8a('0xf')](_0x8a8a('0xe'),auth['isAuthenticated'](),controller[_0x8a8a('0x10')]);router[_0x8a8a('0x11')](_0x8a8a('0xc'),auth['isAuthenticated'](),controller[_0x8a8a('0x12')]);router[_0x8a8a('0x13')](_0x8a8a('0xc'),auth[_0x8a8a('0xa')](),controller['destroy']);router[_0x8a8a('0x13')]('/:id/sounds/:id2',auth[_0x8a8a('0xa')](),controller[_0x8a8a('0x14')]);module[_0x8a8a('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 26025a9..1255a45 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 _0x8694=['STRING','ENUM','files','quietmp3nb','quietmp3','mp3','TIMESTAMP','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8694,0x1a7));var _0x4869=function(_0x1488cd,_0x25a893){_0x1488cd=_0x1488cd-0x0;var _0x63fa13=_0x8694[_0x1488cd];return _0x63fa13;};'use strict';var Sequelize=require('sequelize');module[_0x4869('0x0')]={'name':{'type':Sequelize[_0x4869('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x4869('0x2')]('custom',_0x4869('0x3'),'mp3nb',_0x4869('0x4'),_0x4869('0x5'),_0x4869('0x6')),'allowNull':!![],'defaultValue':_0x4869('0x3')},'directory':{'type':Sequelize[_0x4869('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x4869('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4869('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4869('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x4869('0x1')],'allowNull':!![]},'stamp':{'type':_0x4869('0x7')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3568=['ENUM','files','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x39a6ca,_0x10c9f0){var _0x752c2f=function(_0x3f6ed1){while(--_0x3f6ed1){_0x39a6ca['push'](_0x39a6ca['shift']());}};_0x752c2f(++_0x10c9f0);}(_0x3568,0x193));var _0x8356=function(_0x30770e,_0x46549b){_0x30770e=_0x30770e-0x0;var _0x523bd9=_0x3568[_0x30770e];return _0x523bd9;};'use strict';var Sequelize=require(_0x8356('0x0'));module[_0x8356('0x1')]={'name':{'type':Sequelize[_0x8356('0x2')],'allowNull':![],'unique':_0x8356('0x3')},'mode':{'type':Sequelize[_0x8356('0x4')]('custom',_0x8356('0x5'),'mp3nb',_0x8356('0x6'),_0x8356('0x7'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x8356('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8356('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8356('0x2')],'allowNull':!![],'defaultValue':_0x8356('0x8')},'format':{'type':Sequelize[_0x8356('0x2')],'allowNull':!![]},'stamp':{'type':_0x8356('0x9')},'defaultEntry':{'type':Sequelize[_0x8356('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 cbb7bbe..d0aa455 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 _0x3de9=['map','key','VIRTUAL','options','VoiceMusicOnHold','includeAll','findAll','rows','catch','params','rawAttributes','include','find','update','body','create','sequelize','mode','files','directory','join','root','server/files/moh','name','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','%s.%s','extname','converted_format','symlinkSync','removeSound','format','getSounds','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','save','get','MusicOnHolds','destroy','then','sendStatus','stack','send','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3de9,0x110));var _0x93de=function(_0x307a4b,_0x4c63e9){_0x307a4b=_0x307a4b-0x0;var _0x160964=_0x3de9[_0x307a4b];return _0x160964;};'use strict';var pdf=require(_0x93de('0x0'));var emlformat=require(_0x93de('0x1'));var rimraf=require(_0x93de('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93de('0x3'));var rp=require(_0x93de('0x4'));var moment=require(_0x93de('0x5'));var BPromise=require(_0x93de('0x6'));var Mustache=require(_0x93de('0x7'));var util=require(_0x93de('0x8'));var path=require(_0x93de('0x9'));var sox=require('sox');var csv=require(_0x93de('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x93de('0xb'));var squel=require(_0x93de('0xc'));var crypto=require(_0x93de('0xd'));var jsforce=require(_0x93de('0xe'));var deskjs=require(_0x93de('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var authService=require(_0x93de('0x10'));var hardwareService=require(_0x93de('0x11'));var Redis=require(_0x93de('0x12'));var qs=require(_0x93de('0x13'));var logger=require(_0x93de('0x14'))(_0x93de('0x15'));var utils=require(_0x93de('0x16'));var config=require(_0x93de('0x17'));var db=require(_0x93de('0x18'))['db'];function respondWithStatusCode(_0x47fca3,_0x16e161){_0x16e161=_0x16e161||0xcc;return function(_0x5a9235){if(_0x5a9235){return _0x47fca3['sendStatus'](_0x16e161);}return _0x47fca3[_0x93de('0x19')](_0x16e161)[_0x93de('0x1a')]();};}function respondWithResult(_0x1ac381,_0x26c8c4){_0x26c8c4=_0x26c8c4||0xc8;return function(_0x1aa1ee){if(_0x1aa1ee){return _0x1ac381[_0x93de('0x19')](_0x26c8c4)[_0x93de('0x1b')](_0x1aa1ee);}};}function respondWithFilteredResult(_0x381d41,_0x12cfa7){return function(_0x49bb89){if(_0x49bb89){var _0x3fc23a=_0x49bb89[_0x93de('0x1c')],_0x5284cb=_0x12cfa7[_0x93de('0x1d')],_0x49e5fb=_0x12cfa7['offset']+_0x12cfa7[_0x93de('0x1e')],_0x39a6be;if(_0x49e5fb>=_0x3fc23a){_0x49e5fb=_0x3fc23a;_0x39a6be=0xc8;}else{_0x39a6be=0xce;}_0x381d41[_0x93de('0x19')](_0x39a6be);return _0x381d41[_0x93de('0x1f')](_0x93de('0x20'),_0x5284cb+'-'+_0x49e5fb+'/'+_0x3fc23a)['json'](_0x49bb89);}return null;};}function patchUpdates(_0x351f28){return function(_0xd56f7c){try{jsonpatch['apply'](_0xd56f7c,_0x351f28,!![]);}catch(_0x21626b){return BPromise['reject'](_0x21626b);}return _0xd56f7c[_0x93de('0x21')]();};}function saveUpdates(_0x40a64d,_0x3898ad){return function(_0x4ff2ad){if(_0x4ff2ad){return _0x4ff2ad['update'](_0x40a64d)['then'](function(_0x55ecba){return _0x55ecba;});}return null;};}function removeEntity(_0x4f2cea,_0x21da04){return function(_0x35ca43){if(_0x35ca43){return _0x35ca43['destroy']()['then'](function(){var _0x374fec=_0x35ca43[_0x93de('0x22')]({'plain':!![]});var _0x35e906=_0x93de('0x23');return db['UserProfileResource'][_0x93de('0x24')]({'where':{'type':_0x35e906,'resourceId':_0x374fec['id']}})[_0x93de('0x25')](function(){return _0x35ca43;});})[_0x93de('0x25')](function(){_0x4f2cea[_0x93de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43c562,_0x5ca2fe){return function(_0x242f3c){if(!_0x242f3c){_0x43c562[_0x93de('0x26')](0x194);}return _0x242f3c;};}function handleError(_0x17d801,_0x1ec9ac){_0x1ec9ac=_0x1ec9ac||0x1f4;return function(_0x5e2053){logger['error'](_0x5e2053[_0x93de('0x27')]);if(_0x5e2053['name']){delete _0x5e2053['name'];}_0x17d801[_0x93de('0x19')](_0x1ec9ac)[_0x93de('0x28')](_0x5e2053);};}exports[_0x93de('0x29')]=function(_0x347618,_0x4efb35){var _0x17e74d={},_0x9c4da7={},_0xa141b1={'count':0x0,'rows':[]};var _0x3625b6=db['VoiceMusicOnHold']['rawAttributes'];_0x9c4da7[_0x93de('0x2a')]=_[_0x93de('0x2b')](_0x3625b6);_0x9c4da7[_0x93de('0x2c')]=_[_0x93de('0x2b')](_0x347618[_0x93de('0x2c')]);_0x9c4da7[_0x93de('0x2d')]=_[_0x93de('0x2e')](_0x9c4da7['model'],_0x9c4da7[_0x93de('0x2c')]);_0x17e74d['attributes']=_['intersection'](_0x9c4da7[_0x93de('0x2a')],qs[_0x93de('0x2f')](_0x347618[_0x93de('0x2c')][_0x93de('0x2f')]));_0x17e74d[_0x93de('0x30')]=_0x17e74d[_0x93de('0x30')][_0x93de('0x31')]?_0x17e74d[_0x93de('0x30')]:_0x9c4da7[_0x93de('0x2a')];if(!_0x347618['query'][_0x93de('0x32')](_0x93de('0x33'))){_0x17e74d[_0x93de('0x1e')]=qs[_0x93de('0x1e')](_0x347618[_0x93de('0x2c')][_0x93de('0x1e')]);_0x17e74d[_0x93de('0x1d')]=qs['offset'](_0x347618['query'][_0x93de('0x1d')]);}_0x17e74d[_0x93de('0x34')]=qs[_0x93de('0x35')](_0x347618[_0x93de('0x2c')][_0x93de('0x35')]);_0x17e74d[_0x93de('0x36')]=qs[_0x93de('0x2d')](_[_0x93de('0x37')](_0x347618[_0x93de('0x2c')],_0x9c4da7[_0x93de('0x2d')]));if(_0x347618[_0x93de('0x2c')][_0x93de('0x38')]){_0x17e74d['where']=_[_0x93de('0x39')](_0x17e74d[_0x93de('0x36')],{'$or':_[_0x93de('0x3a')](_0x3625b6,function(_0x4b0d1c){if(_0x4b0d1c['type'][_0x93de('0x3b')]!==_0x93de('0x3c')){var _0x386559={};_0x386559[_0x4b0d1c['field']]={'$like':'%'+_0x347618[_0x93de('0x2c')][_0x93de('0x38')]+'%'};return _0x386559;}})});}_0x17e74d=_[_0x93de('0x39')]({},_0x17e74d,_0x347618[_0x93de('0x3d')]);var _0x3eab9e={'where':_0x17e74d[_0x93de('0x36')]};return db[_0x93de('0x3e')]['count'](_0x3eab9e)[_0x93de('0x25')](function(_0x45d64b){_0xa141b1[_0x93de('0x1c')]=_0x45d64b;if(_0x347618[_0x93de('0x2c')][_0x93de('0x3f')]){_0x17e74d['include']=[{'all':!![]}];}return db[_0x93de('0x3e')][_0x93de('0x40')](_0x17e74d);})[_0x93de('0x25')](function(_0xa463ef){_0xa141b1[_0x93de('0x41')]=_0xa463ef;return _0xa141b1;})['then'](respondWithFilteredResult(_0x4efb35,_0x17e74d))[_0x93de('0x42')](handleError(_0x4efb35,null));};exports['show']=function(_0xbb331,_0x196931){var _0x43262f={'raw':![],'where':{'id':_0xbb331[_0x93de('0x43')]['id']}},_0x185699={};_0x185699[_0x93de('0x2a')]=_[_0x93de('0x2b')](db[_0x93de('0x3e')][_0x93de('0x44')]);_0x185699['query']=_['keys'](_0xbb331[_0x93de('0x2c')]);_0x185699[_0x93de('0x2d')]=_[_0x93de('0x2e')](_0x185699[_0x93de('0x2a')],_0x185699['query']);_0x43262f[_0x93de('0x30')]=_[_0x93de('0x2e')](_0x185699[_0x93de('0x2a')],qs[_0x93de('0x2f')](_0xbb331[_0x93de('0x2c')][_0x93de('0x2f')]));_0x43262f['attributes']=_0x43262f[_0x93de('0x30')][_0x93de('0x31')]?_0x43262f[_0x93de('0x30')]:_0x185699[_0x93de('0x2a')];if(_0xbb331[_0x93de('0x2c')][_0x93de('0x3f')]){_0x43262f[_0x93de('0x45')]=[{'all':!![]}];}_0x43262f=_[_0x93de('0x39')]({},_0x43262f,_0xbb331[_0x93de('0x3d')]);return db['VoiceMusicOnHold'][_0x93de('0x46')](_0x43262f)['then'](handleEntityNotFound(_0x196931,null))[_0x93de('0x25')](respondWithResult(_0x196931,null))['catch'](handleError(_0x196931,null));};exports[_0x93de('0x47')]=function(_0x4a4e46,_0x3a0963){if(_0x4a4e46[_0x93de('0x48')]['id']){delete _0x4a4e46['body']['id'];}return db[_0x93de('0x3e')][_0x93de('0x46')]({'where':{'id':_0x4a4e46[_0x93de('0x43')]['id']}})[_0x93de('0x25')](handleEntityNotFound(_0x3a0963,null))['then'](saveUpdates(_0x4a4e46['body'],null))[_0x93de('0x25')](respondWithResult(_0x3a0963,null))[_0x93de('0x42')](handleError(_0x3a0963,null));};exports[_0x93de('0x49')]=function(_0x1cd560,_0x50afd8,_0x25d6be){return db[_0x93de('0x4a')]['transaction'](function(_0x517421){if(_0x1cd560['body'][_0x93de('0x4b')]===_0x93de('0x4c')){_0x1cd560[_0x93de('0x48')][_0x93de('0x4d')]=path[_0x93de('0x4e')](config[_0x93de('0x4f')],_0x93de('0x50'),_0x1cd560[_0x93de('0x48')][_0x93de('0x51')]);}return db[_0x93de('0x3e')][_0x93de('0x49')](_0x1cd560[_0x93de('0x48')],{'transaction':_0x517421})[_0x93de('0x25')](function(_0x1232fa){if(_0x1cd560[_0x93de('0x48')]['mode']===_0x93de('0x4c')){fs['mkdirSync'](_0x1232fa[_0x93de('0x4d')],parseInt('0777',0x8));}var _0x4dffce=_0x1cd560[_0x93de('0x52')][_0x93de('0x22')]({'plain':!![]});if(!_0x4dffce)throw new Error(_0x93de('0x53'));if(_0x4dffce[_0x93de('0x54')]===_0x93de('0x52')){var _0x12b1fa=_0x1232fa[_0x93de('0x22')]({'plain':!![]});return db[_0x93de('0x55')]['find']({'where':{'name':_0x93de('0x23'),'userProfileId':_0x4dffce['userProfileId']},'raw':!![]})[_0x93de('0x25')](function(_0xcfb17b){if(_0xcfb17b&&_0xcfb17b[_0x93de('0x56')]===0x0){return db[_0x93de('0x57')][_0x93de('0x49')]({'name':_0x12b1fa[_0x93de('0x51')],'resourceId':_0x12b1fa['id'],'type':_0xcfb17b['name'],'sectionId':_0xcfb17b['id']},{})['then'](function(){return _0x1232fa;});}else{return _0x1232fa;}})['catch'](function(_0x237a07){logger[_0x93de('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x237a07);});}return _0x1232fa;});})[_0x93de('0x25')](respondWithResult(_0x50afd8,0xc9))[_0x93de('0x42')](handleError(_0x50afd8,null));};exports['destroy']=function(_0x41dd34,_0x2f2071,_0x354fd8){var _0xe1c30f;return db[_0x93de('0x3e')]['find']({'where':{'id':_0x41dd34[_0x93de('0x43')]['id']}})[_0x93de('0x25')](function(_0x131791){if(_0x131791){return db[_0x93de('0x4a')][_0x93de('0x59')](function(_0x17a8a7){return _0x131791[_0x93de('0x24')]({'transaction':_0x17a8a7,'raw':!![]})[_0x93de('0x25')](function(_0x4f4a09){if(_0x4f4a09[_0x93de('0x4d')]){fs[_0x93de('0x5a')](_0x4f4a09[_0x93de('0x4d')])[_0x93de('0x5b')](function(_0x571293){fs[_0x93de('0x5c')](path['join'](_0x4f4a09[_0x93de('0x4d')],_0x571293));});fs[_0x93de('0x5d')](_0x4f4a09['directory']);}return _0x4f4a09;});})[_0x93de('0x42')](function(_0x13773a){throw new db[(_0x93de('0x5e'))][(_0x93de('0x5f'))](_0x13773a[_0x93de('0x60')]);});}})[_0x93de('0x25')](handleEntityNotFound(_0x2f2071,null))['then'](removeEntity(_0x2f2071,null))['catch'](handleError(_0x2f2071,null));};exports[_0x93de('0x61')]=function(_0x34c4a5,_0x68c7ef,_0x5de87e){return db[_0x93de('0x4a')][_0x93de('0x59')](function(_0x333ab0){var _0x20fe08;return db[_0x93de('0x3e')][_0x93de('0x46')]({'where':{'id':_0x34c4a5[_0x93de('0x43')]['id']}})[_0x93de('0x25')](function(_0x309d4d){if(_0x309d4d){_0x20fe08=_0x309d4d;return _0x309d4d[_0x93de('0x61')](_0x34c4a5[_0x93de('0x48')]['id'],{'transaction':_0x333ab0});}})[_0x93de('0x25')](function(_0x40cf98){if(_0x40cf98){return db[_0x93de('0x62')][_0x93de('0x63')]({'where':{'id':_0x34c4a5[_0x93de('0x48')]['id']},'attributes':['id','name',_0x93de('0x64'),'converted_format',_0x93de('0x65')],'raw':!![]});}})[_0x93de('0x25')](function(_0x33c35f){if(_0x33c35f){var _0x49c43a=path['join'](config['root'],_0x93de('0x66'),util['format'](_0x93de('0x67'),path['basename'](_0x33c35f['save_name'],path[_0x93de('0x68')](_0x33c35f[_0x93de('0x64')])),_0x33c35f[_0x93de('0x69')]));var _0x5628f7=path[_0x93de('0x4e')](config[_0x93de('0x4f')],_0x93de('0x50'),_0x20fe08[_0x93de('0x51')],util['format'](_0x93de('0x67'),_0x33c35f['name'],_0x33c35f[_0x93de('0x69')]));fs[_0x93de('0x6a')](_0x49c43a,_0x5628f7);return _0x33c35f;}})[_0x93de('0x42')](function(_0x6c37aa){throw new db['Sequelize']['ValidationError'](_0x6c37aa[_0x93de('0x60')]);});})[_0x93de('0x25')](handleEntityNotFound(_0x68c7ef,null))[_0x93de('0x25')](respondWithResult(_0x68c7ef,0xc9))[_0x93de('0x42')](handleError(_0x68c7ef,null));};exports[_0x93de('0x6b')]=function(_0x41a332,_0x423fe9,_0x430615){return db[_0x93de('0x4a')]['transaction'](function(_0x5fefdf){var _0x536d58;return db[_0x93de('0x3e')][_0x93de('0x63')]({'where':{'id':_0x41a332[_0x93de('0x43')]['id']}})[_0x93de('0x25')](handleEntityNotFound(_0x423fe9,null))[_0x93de('0x25')](function(_0x41ac1c){if(_0x41ac1c){_0x536d58=_0x41ac1c;return _0x41ac1c[_0x93de('0x6b')](_0x41a332[_0x93de('0x43')]['id2']);}})[_0x93de('0x25')](function(_0x489c0d){if(_0x489c0d){return db[_0x93de('0x62')][_0x93de('0x63')]({'where':{'id':_0x41a332[_0x93de('0x43')]['id2']},'attributes':['id',_0x93de('0x51'),'save_name','converted_format',_0x93de('0x65')],'raw':!![]});}})[_0x93de('0x25')](function(_0x4be4a7){if(_0x4be4a7){fs[_0x93de('0x5c')](path[_0x93de('0x4e')](_0x536d58[_0x93de('0x4d')],util[_0x93de('0x6c')](_0x93de('0x67'),_0x4be4a7[_0x93de('0x51')],_0x4be4a7[_0x93de('0x69')])));return _0x4be4a7;}})['catch'](function(_0x6d697){throw new db[(_0x93de('0x5e'))]['ValidationError'](_0x6d697[_0x93de('0x60')]);});})['then'](handleEntityNotFound(_0x423fe9,null))[_0x93de('0x25')](respondWithStatusCode(_0x423fe9,0xcc))[_0x93de('0x42')](handleError(_0x423fe9,null));};exports[_0x93de('0x6d')]=function(_0x17bf41,_0x3992c9,_0x4881fd){var _0x82bb52={};var _0x140793={};var _0x20e57b;var _0x46a0f3;return db[_0x93de('0x3e')][_0x93de('0x63')]({'where':{'id':_0x17bf41[_0x93de('0x43')]['id']}})['then'](handleEntityNotFound(_0x3992c9,null))[_0x93de('0x25')](function(_0x203859){if(_0x203859){_0x20e57b=_0x203859;_0x140793['model']=_[_0x93de('0x2b')](db[_0x93de('0x62')]['rawAttributes']);_0x140793[_0x93de('0x2c')]=_[_0x93de('0x2b')](_0x17bf41[_0x93de('0x2c')]);_0x140793['filters']=_[_0x93de('0x2e')](_0x140793['model'],_0x140793['query']);_0x82bb52[_0x93de('0x30')]=_[_0x93de('0x2e')](_0x140793[_0x93de('0x2a')],qs['fields'](_0x17bf41[_0x93de('0x2c')][_0x93de('0x2f')]));_0x82bb52[_0x93de('0x30')]=_0x82bb52[_0x93de('0x30')][_0x93de('0x31')]?_0x82bb52[_0x93de('0x30')]:_0x140793[_0x93de('0x2a')];_0x82bb52['order']=qs['sort'](_0x17bf41[_0x93de('0x2c')]['sort']);_0x82bb52[_0x93de('0x36')]=qs[_0x93de('0x2d')](_[_0x93de('0x37')](_0x17bf41[_0x93de('0x2c')],_0x140793[_0x93de('0x2d')]));if(_0x17bf41[_0x93de('0x2c')]['filter']){_0x82bb52[_0x93de('0x36')]=_['merge'](_0x82bb52[_0x93de('0x36')],{'$or':_[_0x93de('0x3a')](_0x82bb52[_0x93de('0x30')],function(_0x4c180c){var _0x1fbfd8={};_0x1fbfd8[_0x4c180c]={'$like':'%'+_0x17bf41[_0x93de('0x2c')][_0x93de('0x38')]+'%'};return _0x1fbfd8;})});}_0x82bb52=_[_0x93de('0x39')]({},_0x82bb52,_0x17bf41[_0x93de('0x3d')]);return _0x20e57b['getSounds'](_0x82bb52);}})[_0x93de('0x25')](function(_0x3236c1){if(_0x3236c1){_0x46a0f3=_0x3236c1[_0x93de('0x31')];if(!_0x17bf41[_0x93de('0x2c')][_0x93de('0x32')]('nolimit')){_0x82bb52[_0x93de('0x1e')]=qs[_0x93de('0x1e')](_0x17bf41[_0x93de('0x2c')][_0x93de('0x1e')]);_0x82bb52[_0x93de('0x1d')]=qs[_0x93de('0x1d')](_0x17bf41['query']['offset']);}return _0x20e57b['getSounds'](_0x82bb52);}})[_0x93de('0x25')](function(_0x1dd2c2){if(_0x1dd2c2){return _0x1dd2c2?{'count':_0x46a0f3,'rows':_0x1dd2c2}:null;}})[_0x93de('0x25')](respondWithResult(_0x3992c9,null))[_0x93de('0x42')](handleError(_0x3992c9,null));}; \ No newline at end of file +var _0x1601=['unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','join','root','format','%s.%s','basename','extname','server/files/moh','symlinkSync','removeSound','id2','getSounds','rawAttributes','pick','html-pdf','eml-format','request-promise','bluebird','mustache','util','path','to-csv','lodash','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','send','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','key','VIRTUAL','field','options','VoiceMusicOnHold','count','include','findAll','includeAll','merge','find','catch','params','body','create','sequelize','transaction','mode','files','directory','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1601,0xf2));var _0x1160=function(_0x1d1b15,_0x5ef518){_0x1d1b15=_0x1d1b15-0x0;var _0x1801d3=_0x1601[_0x1d1b15];return _0x1801d3;};'use strict';var pdf=require(_0x1160('0x0'));var emlformat=require(_0x1160('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1160('0x2'));var moment=require('moment');var BPromise=require(_0x1160('0x3'));var Mustache=require(_0x1160('0x4'));var util=require(_0x1160('0x5'));var path=require(_0x1160('0x6'));var sox=require('sox');var csv=require(_0x1160('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1160('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1160('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x1160('0x7'));var querystring=require('querystring');var Papa=require(_0x1160('0xa'));var authService=require(_0x1160('0xb'));var hardwareService=require(_0x1160('0xc'));var Redis=require(_0x1160('0xd'));var qs=require(_0x1160('0xe'));var logger=require(_0x1160('0xf'))(_0x1160('0x10'));var utils=require(_0x1160('0x11'));var config=require('../../config/environment');var db=require(_0x1160('0x12'))['db'];function respondWithStatusCode(_0x2edfd3,_0x4bfc74){_0x4bfc74=_0x4bfc74||0xcc;return function(_0x2706aa){if(_0x2706aa){return _0x2edfd3['sendStatus'](_0x4bfc74);}return _0x2edfd3[_0x1160('0x13')](_0x4bfc74)[_0x1160('0x14')]();};}function respondWithResult(_0x2912ee,_0x332aa2){_0x332aa2=_0x332aa2||0xc8;return function(_0x30a109){if(_0x30a109){return _0x2912ee[_0x1160('0x13')](_0x332aa2)[_0x1160('0x15')](_0x30a109);}};}function respondWithFilteredResult(_0x386470,_0x3a0a0b){return function(_0x146cfd){if(_0x146cfd){var _0x5e95af=_0x146cfd['count'],_0x77208c=_0x3a0a0b['offset'],_0x26103f=_0x3a0a0b[_0x1160('0x16')]+_0x3a0a0b[_0x1160('0x17')],_0x234cdc;if(_0x26103f>=_0x5e95af){_0x26103f=_0x5e95af;_0x234cdc=0xc8;}else{_0x234cdc=0xce;}_0x386470[_0x1160('0x13')](_0x234cdc);return _0x386470['set'](_0x1160('0x18'),_0x77208c+'-'+_0x26103f+'/'+_0x5e95af)[_0x1160('0x15')](_0x146cfd);}return null;};}function patchUpdates(_0x40cc9d){return function(_0x87a5e2){try{jsonpatch[_0x1160('0x19')](_0x87a5e2,_0x40cc9d,!![]);}catch(_0x35c6e0){return BPromise[_0x1160('0x1a')](_0x35c6e0);}return _0x87a5e2[_0x1160('0x1b')]();};}function saveUpdates(_0x255abe,_0x14be71){return function(_0x5384fb){if(_0x5384fb){return _0x5384fb[_0x1160('0x1c')](_0x255abe)[_0x1160('0x1d')](function(_0x1d12d4){return _0x1d12d4;});}return null;};}function removeEntity(_0x8590a3,_0x5016a6){return function(_0x51cdd3){if(_0x51cdd3){return _0x51cdd3[_0x1160('0x1e')]()[_0x1160('0x1d')](function(){var _0x3e7799=_0x51cdd3[_0x1160('0x1f')]({'plain':!![]});var _0x1055d1=_0x1160('0x20');return db[_0x1160('0x21')]['destroy']({'where':{'type':_0x1055d1,'resourceId':_0x3e7799['id']}})[_0x1160('0x1d')](function(){return _0x51cdd3;});})[_0x1160('0x1d')](function(){_0x8590a3['status'](0xcc)[_0x1160('0x14')]();});}};}function handleEntityNotFound(_0x461198,_0x2b1790){return function(_0x49e813){if(!_0x49e813){_0x461198[_0x1160('0x22')](0x194);}return _0x49e813;};}function handleError(_0x52b2f0,_0x4c62cd){_0x4c62cd=_0x4c62cd||0x1f4;return function(_0x1b9161){logger[_0x1160('0x23')](_0x1b9161[_0x1160('0x24')]);if(_0x1b9161[_0x1160('0x25')]){delete _0x1b9161[_0x1160('0x25')];}_0x52b2f0[_0x1160('0x13')](_0x4c62cd)[_0x1160('0x26')](_0x1b9161);};}exports['index']=function(_0x296409,_0x370614){var _0x497268={},_0x1741e3={},_0x3a01e9={'count':0x0,'rows':[]};var _0x16a22c=db['VoiceMusicOnHold']['rawAttributes'];_0x1741e3[_0x1160('0x27')]=_[_0x1160('0x28')](_0x16a22c);_0x1741e3['query']=_[_0x1160('0x28')](_0x296409['query']);_0x1741e3[_0x1160('0x29')]=_[_0x1160('0x2a')](_0x1741e3[_0x1160('0x27')],_0x1741e3[_0x1160('0x2b')]);_0x497268[_0x1160('0x2c')]=_[_0x1160('0x2a')](_0x1741e3[_0x1160('0x27')],qs[_0x1160('0x2d')](_0x296409['query']['fields']));_0x497268[_0x1160('0x2c')]=_0x497268[_0x1160('0x2c')][_0x1160('0x2e')]?_0x497268['attributes']:_0x1741e3[_0x1160('0x27')];if(!_0x296409[_0x1160('0x2b')][_0x1160('0x2f')](_0x1160('0x30'))){_0x497268[_0x1160('0x17')]=qs[_0x1160('0x17')](_0x296409[_0x1160('0x2b')][_0x1160('0x17')]);_0x497268[_0x1160('0x16')]=qs[_0x1160('0x16')](_0x296409[_0x1160('0x2b')]['offset']);}_0x497268[_0x1160('0x31')]=qs[_0x1160('0x32')](_0x296409[_0x1160('0x2b')]['sort']);_0x497268[_0x1160('0x33')]=qs[_0x1160('0x29')](_['pick'](_0x296409[_0x1160('0x2b')],_0x1741e3['filters']));if(_0x296409[_0x1160('0x2b')][_0x1160('0x34')]){_0x497268['where']=_['merge'](_0x497268[_0x1160('0x33')],{'$or':_[_0x1160('0x35')](_0x16a22c,function(_0xd4af22){if(_0xd4af22['type'][_0x1160('0x36')]!==_0x1160('0x37')){var _0x25041b={};_0x25041b[_0xd4af22[_0x1160('0x38')]]={'$like':'%'+_0x296409[_0x1160('0x2b')][_0x1160('0x34')]+'%'};return _0x25041b;}})});}_0x497268=_['merge']({},_0x497268,_0x296409[_0x1160('0x39')]);var _0x53b0cc={'where':_0x497268['where']};return db[_0x1160('0x3a')][_0x1160('0x3b')](_0x53b0cc)['then'](function(_0x50b4dc){_0x3a01e9[_0x1160('0x3b')]=_0x50b4dc;if(_0x296409[_0x1160('0x2b')]['includeAll']){_0x497268[_0x1160('0x3c')]=[{'all':!![]}];}return db[_0x1160('0x3a')][_0x1160('0x3d')](_0x497268);})['then'](function(_0x3a3c33){_0x3a01e9['rows']=_0x3a3c33;return _0x3a01e9;})['then'](respondWithFilteredResult(_0x370614,_0x497268))['catch'](handleError(_0x370614,null));};exports['show']=function(_0x431c03,_0x1adf44){var _0x206d62={'raw':![],'where':{'id':_0x431c03['params']['id']}},_0x11dd30={};_0x11dd30[_0x1160('0x27')]=_[_0x1160('0x28')](db[_0x1160('0x3a')]['rawAttributes']);_0x11dd30[_0x1160('0x2b')]=_[_0x1160('0x28')](_0x431c03[_0x1160('0x2b')]);_0x11dd30['filters']=_[_0x1160('0x2a')](_0x11dd30[_0x1160('0x27')],_0x11dd30[_0x1160('0x2b')]);_0x206d62[_0x1160('0x2c')]=_[_0x1160('0x2a')](_0x11dd30[_0x1160('0x27')],qs[_0x1160('0x2d')](_0x431c03['query'][_0x1160('0x2d')]));_0x206d62['attributes']=_0x206d62[_0x1160('0x2c')][_0x1160('0x2e')]?_0x206d62['attributes']:_0x11dd30[_0x1160('0x27')];if(_0x431c03['query'][_0x1160('0x3e')]){_0x206d62[_0x1160('0x3c')]=[{'all':!![]}];}_0x206d62=_[_0x1160('0x3f')]({},_0x206d62,_0x431c03[_0x1160('0x39')]);return db[_0x1160('0x3a')][_0x1160('0x40')](_0x206d62)[_0x1160('0x1d')](handleEntityNotFound(_0x1adf44,null))[_0x1160('0x1d')](respondWithResult(_0x1adf44,null))[_0x1160('0x41')](handleError(_0x1adf44,null));};exports[_0x1160('0x1c')]=function(_0x25e394,_0x180b3b){if(_0x25e394['body']['id']){delete _0x25e394['body']['id'];}return db[_0x1160('0x3a')][_0x1160('0x40')]({'where':{'id':_0x25e394[_0x1160('0x42')]['id']}})[_0x1160('0x1d')](handleEntityNotFound(_0x180b3b,null))[_0x1160('0x1d')](saveUpdates(_0x25e394[_0x1160('0x43')],null))[_0x1160('0x1d')](respondWithResult(_0x180b3b,null))[_0x1160('0x41')](handleError(_0x180b3b,null));};exports[_0x1160('0x44')]=function(_0x3cfab9,_0x55959a,_0xc8b040){return db[_0x1160('0x45')][_0x1160('0x46')](function(_0x553db6){if(_0x3cfab9[_0x1160('0x43')][_0x1160('0x47')]===_0x1160('0x48')){_0x3cfab9[_0x1160('0x43')][_0x1160('0x49')]=path['join'](config['root'],'server/files/moh',_0x3cfab9[_0x1160('0x43')][_0x1160('0x25')]);}return db[_0x1160('0x3a')][_0x1160('0x44')](_0x3cfab9[_0x1160('0x43')],{'transaction':_0x553db6})['then'](function(_0x2a3df6){if(_0x3cfab9[_0x1160('0x43')][_0x1160('0x47')]===_0x1160('0x48')){fs[_0x1160('0x4a')](_0x2a3df6[_0x1160('0x49')],parseInt(_0x1160('0x4b'),0x8));}var _0x35a740=_0x3cfab9[_0x1160('0x4c')][_0x1160('0x1f')]({'plain':!![]});if(!_0x35a740)throw new Error(_0x1160('0x4d'));if(_0x35a740[_0x1160('0x4e')]===_0x1160('0x4c')){var _0x2f13fd=_0x2a3df6[_0x1160('0x1f')]({'plain':!![]});return db[_0x1160('0x4f')][_0x1160('0x40')]({'where':{'name':_0x1160('0x20'),'userProfileId':_0x35a740[_0x1160('0x50')]},'raw':!![]})[_0x1160('0x1d')](function(_0x5a8ee9){if(_0x5a8ee9&&_0x5a8ee9[_0x1160('0x51')]===0x0){return db[_0x1160('0x21')]['create']({'name':_0x2f13fd['name'],'resourceId':_0x2f13fd['id'],'type':_0x5a8ee9[_0x1160('0x25')],'sectionId':_0x5a8ee9['id']},{})[_0x1160('0x1d')](function(){return _0x2a3df6;});}else{return _0x2a3df6;}})['catch'](function(_0x1026dd){logger[_0x1160('0x23')](_0x1160('0x52'),_0x1026dd);});}return _0x2a3df6;});})[_0x1160('0x1d')](respondWithResult(_0x55959a,0xc9))['catch'](handleError(_0x55959a,null));};exports[_0x1160('0x1e')]=function(_0x1bf6ed,_0x2b84f8,_0x3a4505){var _0x5b331f;return db[_0x1160('0x3a')][_0x1160('0x40')]({'where':{'id':_0x1bf6ed['params']['id']}})['then'](function(_0x2ef1c4){if(_0x2ef1c4){return db['sequelize'][_0x1160('0x46')](function(_0x4f2cfa){return _0x2ef1c4[_0x1160('0x1e')]({'transaction':_0x4f2cfa,'raw':!![]})[_0x1160('0x1d')](function(_0x2e79e1){if(_0x2e79e1[_0x1160('0x49')]){fs[_0x1160('0x53')](_0x2e79e1[_0x1160('0x49')])[_0x1160('0x54')](function(_0x3506a3){fs[_0x1160('0x55')](path['join'](_0x2e79e1[_0x1160('0x49')],_0x3506a3));});fs[_0x1160('0x56')](_0x2e79e1[_0x1160('0x49')]);}return _0x2e79e1;});})[_0x1160('0x41')](function(_0x30254a){throw new db[(_0x1160('0x57'))][(_0x1160('0x58'))](_0x30254a[_0x1160('0x59')]);});}})[_0x1160('0x1d')](handleEntityNotFound(_0x2b84f8,null))['then'](removeEntity(_0x2b84f8,null))[_0x1160('0x41')](handleError(_0x2b84f8,null));};exports['addSound']=function(_0x475739,_0x4e9b17,_0x3e2800){return db['sequelize'][_0x1160('0x46')](function(_0x2c0c14){var _0x4130b4;return db[_0x1160('0x3a')][_0x1160('0x40')]({'where':{'id':_0x475739['params']['id']}})['then'](function(_0x1f1671){if(_0x1f1671){_0x4130b4=_0x1f1671;return _0x1f1671[_0x1160('0x5a')](_0x475739[_0x1160('0x43')]['id'],{'transaction':_0x2c0c14});}})[_0x1160('0x1d')](function(_0x2f1858){if(_0x2f1858){return db[_0x1160('0x5b')][_0x1160('0x5c')]({'where':{'id':_0x475739[_0x1160('0x43')]['id']},'attributes':['id',_0x1160('0x25'),_0x1160('0x5d'),_0x1160('0x5e'),_0x1160('0x5f')],'raw':!![]});}})[_0x1160('0x1d')](function(_0x41cd94){if(_0x41cd94){var _0x2b01fb=path[_0x1160('0x60')](config[_0x1160('0x61')],'server/files/sounds/converted',util[_0x1160('0x62')](_0x1160('0x63'),path[_0x1160('0x64')](_0x41cd94[_0x1160('0x5d')],path[_0x1160('0x65')](_0x41cd94[_0x1160('0x5d')])),_0x41cd94['converted_format']));var _0x1e79bf=path[_0x1160('0x60')](config[_0x1160('0x61')],_0x1160('0x66'),_0x4130b4[_0x1160('0x25')],util[_0x1160('0x62')](_0x1160('0x63'),_0x41cd94[_0x1160('0x25')],_0x41cd94['converted_format']));fs[_0x1160('0x67')](_0x2b01fb,_0x1e79bf);return _0x41cd94;}})[_0x1160('0x41')](function(_0xe01766){throw new db['Sequelize'][(_0x1160('0x58'))](_0xe01766[_0x1160('0x59')]);});})['then'](handleEntityNotFound(_0x4e9b17,null))[_0x1160('0x1d')](respondWithResult(_0x4e9b17,0xc9))[_0x1160('0x41')](handleError(_0x4e9b17,null));};exports[_0x1160('0x68')]=function(_0x4136b7,_0x1282b7,_0x21558d){return db[_0x1160('0x45')][_0x1160('0x46')](function(_0x268b65){var _0x4bec14;return db['VoiceMusicOnHold'][_0x1160('0x5c')]({'where':{'id':_0x4136b7[_0x1160('0x42')]['id']}})['then'](handleEntityNotFound(_0x1282b7,null))[_0x1160('0x1d')](function(_0xb45219){if(_0xb45219){_0x4bec14=_0xb45219;return _0xb45219[_0x1160('0x68')](_0x4136b7[_0x1160('0x42')][_0x1160('0x69')]);}})[_0x1160('0x1d')](function(_0x4806e2){if(_0x4806e2){return db[_0x1160('0x5b')][_0x1160('0x5c')]({'where':{'id':_0x4136b7[_0x1160('0x42')]['id2']},'attributes':['id',_0x1160('0x25'),_0x1160('0x5d'),_0x1160('0x5e'),_0x1160('0x5f')],'raw':!![]});}})['then'](function(_0x5f34d5){if(_0x5f34d5){fs[_0x1160('0x55')](path['join'](_0x4bec14['directory'],util['format'](_0x1160('0x63'),_0x5f34d5[_0x1160('0x25')],_0x5f34d5[_0x1160('0x5e')])));return _0x5f34d5;}})[_0x1160('0x41')](function(_0x32296c){throw new db[(_0x1160('0x57'))][(_0x1160('0x58'))](_0x32296c['message']);});})[_0x1160('0x1d')](handleEntityNotFound(_0x1282b7,null))[_0x1160('0x1d')](respondWithStatusCode(_0x1282b7,0xcc))[_0x1160('0x41')](handleError(_0x1282b7,null));};exports[_0x1160('0x6a')]=function(_0x5bdc9b,_0x26019c,_0x58b031){var _0x5d6f84={};var _0x54df8d={};var _0x5a3b8b;var _0x3d2afa;return db[_0x1160('0x3a')][_0x1160('0x5c')]({'where':{'id':_0x5bdc9b[_0x1160('0x42')]['id']}})['then'](handleEntityNotFound(_0x26019c,null))['then'](function(_0x33b73f){if(_0x33b73f){_0x5a3b8b=_0x33b73f;_0x54df8d[_0x1160('0x27')]=_['keys'](db['Sound'][_0x1160('0x6b')]);_0x54df8d[_0x1160('0x2b')]=_['keys'](_0x5bdc9b[_0x1160('0x2b')]);_0x54df8d['filters']=_[_0x1160('0x2a')](_0x54df8d[_0x1160('0x27')],_0x54df8d[_0x1160('0x2b')]);_0x5d6f84[_0x1160('0x2c')]=_['intersection'](_0x54df8d[_0x1160('0x27')],qs[_0x1160('0x2d')](_0x5bdc9b['query'][_0x1160('0x2d')]));_0x5d6f84[_0x1160('0x2c')]=_0x5d6f84[_0x1160('0x2c')][_0x1160('0x2e')]?_0x5d6f84[_0x1160('0x2c')]:_0x54df8d['model'];_0x5d6f84[_0x1160('0x31')]=qs[_0x1160('0x32')](_0x5bdc9b[_0x1160('0x2b')][_0x1160('0x32')]);_0x5d6f84['where']=qs['filters'](_[_0x1160('0x6c')](_0x5bdc9b['query'],_0x54df8d[_0x1160('0x29')]));if(_0x5bdc9b[_0x1160('0x2b')][_0x1160('0x34')]){_0x5d6f84[_0x1160('0x33')]=_[_0x1160('0x3f')](_0x5d6f84['where'],{'$or':_[_0x1160('0x35')](_0x5d6f84[_0x1160('0x2c')],function(_0x417d8d){var _0x320592={};_0x320592[_0x417d8d]={'$like':'%'+_0x5bdc9b['query'][_0x1160('0x34')]+'%'};return _0x320592;})});}_0x5d6f84=_[_0x1160('0x3f')]({},_0x5d6f84,_0x5bdc9b['options']);return _0x5a3b8b[_0x1160('0x6a')](_0x5d6f84);}})[_0x1160('0x1d')](function(_0x207e93){if(_0x207e93){_0x3d2afa=_0x207e93['length'];if(!_0x5bdc9b[_0x1160('0x2b')][_0x1160('0x2f')](_0x1160('0x30'))){_0x5d6f84[_0x1160('0x17')]=qs[_0x1160('0x17')](_0x5bdc9b['query']['limit']);_0x5d6f84[_0x1160('0x16')]=qs[_0x1160('0x16')](_0x5bdc9b[_0x1160('0x2b')]['offset']);}return _0x5a3b8b[_0x1160('0x6a')](_0x5d6f84);}})[_0x1160('0x1d')](function(_0x5b6b16){if(_0x5b6b16){return _0x5b6b16?{'count':_0x3d2afa,'rows':_0x5b6b16}:null;}})['then'](respondWithResult(_0x26019c,null))[_0x1160('0x41')](handleError(_0x26019c,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 3eafe0d..cab5f49 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 _0x5dcf=['moment','bluebird','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','api'];(function(_0x3ae24a,_0x7d32f9){var _0x18690f=function(_0x2c2389){while(--_0x2c2389){_0x3ae24a['push'](_0x3ae24a['shift']());}};_0x18690f(++_0x7d32f9);}(_0x5dcf,0x7f));var _0xf5dc=function(_0x49b7c7,_0x5e523b){_0x49b7c7=_0x49b7c7-0x0;var _0x5d67c4=_0x5dcf[_0x49b7c7];return _0x5d67c4;};'use strict';var _=require(_0xf5dc('0x0'));var util=require(_0xf5dc('0x1'));var logger=require('../../config/logger')(_0xf5dc('0x2'));var moment=require(_0xf5dc('0x3'));var BPromise=require(_0xf5dc('0x4'));var rp=require('request-promise');var attributes=require(_0xf5dc('0x5'));module[_0xf5dc('0x6')]=function(_0xd3feee,_0x46b1fc){return _0xd3feee[_0xf5dc('0x7')](_0xf5dc('0x8'),attributes,{'tableName':_0xf5dc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bba=['./voiceMusicOnHold.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4ead5a,_0x3dd471){var _0x5ca6af=function(_0x406688){while(--_0x406688){_0x4ead5a['push'](_0x4ead5a['shift']());}};_0x5ca6af(++_0x3dd471);}(_0x6bba,0x133));var _0xa6bb=function(_0x363dbc,_0x3a4dcb){_0x363dbc=_0x363dbc-0x0;var _0x53c1c0=_0x6bba[_0x363dbc];return _0x53c1c0;};'use strict';var _=require(_0xa6bb('0x0'));var util=require(_0xa6bb('0x1'));var logger=require(_0xa6bb('0x2'))('api');var moment=require(_0xa6bb('0x3'));var BPromise=require(_0xa6bb('0x4'));var rp=require('request-promise');var attributes=require(_0xa6bb('0x5'));module[_0xa6bb('0x6')]=function(_0x29802b,_0x7a6ba0){return _0x29802b[_0xa6bb('0x7')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index c9fe9ed..b76ae97 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 _0x7e8e=['debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s'];(function(_0x19887e,_0x2a6f8a){var _0x45bf3c=function(_0x3f2f94){while(--_0x3f2f94){_0x19887e['push'](_0x19887e['shift']());}};_0x45bf3c(++_0x2a6f8a);}(_0x7e8e,0x91));var _0xe7e8=function(_0x91964a,_0x2dc2f6){_0x91964a=_0x91964a-0x0;var _0x4490b1=_0x7e8e[_0x91964a];return _0x4490b1;};'use strict';var _=require(_0xe7e8('0x0'));var util=require(_0xe7e8('0x1'));var moment=require(_0xe7e8('0x2'));var BPromise=require(_0xe7e8('0x3'));var rs=require(_0xe7e8('0x4'));var fs=require('fs');var Redis=require(_0xe7e8('0x5'));var db=require(_0xe7e8('0x6'))['db'];var utils=require(_0xe7e8('0x7'));var logger=require(_0xe7e8('0x8'))(_0xe7e8('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe7e8('0xa')][_0xe7e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d86f2,_0x27ab3b,_0x2b5d17){return new BPromise(function(_0x28a2de,_0x398855){return client[_0xe7e8('0xc')](_0x5d86f2,_0x2b5d17)[_0xe7e8('0xd')](function(_0x9305d7){logger[_0xe7e8('0xe')](_0xe7e8('0xf'),_0x27ab3b,'request\x20sent');logger[_0xe7e8('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x27ab3b,_0xe7e8('0x11'),JSON[_0xe7e8('0x12')](_0x9305d7));if(_0x9305d7['error']){if(_0x9305d7[_0xe7e8('0x13')]['code']===0x1f4){logger[_0xe7e8('0x13')](_0xe7e8('0xf'),_0x27ab3b,_0x9305d7[_0xe7e8('0x13')][_0xe7e8('0x14')]);return _0x398855(_0x9305d7['error'][_0xe7e8('0x14')]);}logger[_0xe7e8('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x27ab3b,_0x9305d7[_0xe7e8('0x13')][_0xe7e8('0x14')]);return _0x28a2de(_0x9305d7[_0xe7e8('0x13')][_0xe7e8('0x14')]);}else{logger['info'](_0xe7e8('0xf'),_0x27ab3b,_0xe7e8('0x11'));_0x28a2de(_0x9305d7[_0xe7e8('0x15')][_0xe7e8('0x14')]);}})[_0xe7e8('0x16')](function(_0x27539b){logger[_0xe7e8('0x13')](_0xe7e8('0xf'),_0x27ab3b,_0x27539b);_0x398855(_0x27539b);});});} \ No newline at end of file +var _0x79d0=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceMusicOnHold,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','moment'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x79d0,0xb3));var _0x079d=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x79d0[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x079d('0x0'));var BPromise=require('bluebird');var rs=require(_0x079d('0x1'));var fs=require('fs');var Redis=require(_0x079d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x079d('0x3'))(_0x079d('0x4'));var config=require('../../config/environment');var jayson=require(_0x079d('0x5'));var client=jayson[_0x079d('0x6')][_0x079d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x593f9b,_0x272b09,_0x80af45){return new BPromise(function(_0x369758,_0x473555){return client[_0x079d('0x8')](_0x593f9b,_0x80af45)[_0x079d('0x9')](function(_0x227a65){logger['info'](_0x079d('0xa'),_0x272b09,'request\x20sent');logger[_0x079d('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x272b09,'request\x20sent',JSON['stringify'](_0x227a65));if(_0x227a65['error']){if(_0x227a65[_0x079d('0xc')][_0x079d('0xd')]===0x1f4){logger[_0x079d('0xc')](_0x079d('0xa'),_0x272b09,_0x227a65[_0x079d('0xc')][_0x079d('0xe')]);return _0x473555(_0x227a65[_0x079d('0xc')][_0x079d('0xe')]);}logger[_0x079d('0xc')](_0x079d('0xa'),_0x272b09,_0x227a65[_0x079d('0xc')][_0x079d('0xe')]);return _0x369758(_0x227a65[_0x079d('0xc')][_0x079d('0xe')]);}else{logger[_0x079d('0xf')](_0x079d('0xa'),_0x272b09,_0x079d('0x10'));_0x369758(_0x227a65[_0x079d('0x11')]['message']);}})['catch'](function(_0x3cc28e){logger[_0x079d('0xc')](_0x079d('0xa'),_0x272b09,_0x3cc28e);_0x473555(_0x3cc28e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index ef03e2a..bce0562 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 _0x07c3=['/:id','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show','/:id/users','getAgents','post','create','addAgents'];(function(_0x53ac5b,_0x167b14){var _0x5f3ab2=function(_0x1c7798){while(--_0x1c7798){_0x53ac5b['push'](_0x53ac5b['shift']());}};_0x5f3ab2(++_0x167b14);}(_0x07c3,0x14b));var _0x307c=function(_0x48c4ef,_0x319d44){_0x48c4ef=_0x48c4ef-0x0;var _0x435715=_0x07c3[_0x48c4ef];return _0x435715;};'use strict';var multer=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var path=require(_0x307c('0x2'));var timeout=require(_0x307c('0x3'));var express=require(_0x307c('0x4'));var router=express['Router']();var auth=require(_0x307c('0x5'));var interaction=require(_0x307c('0x6'));var config=require('../../config/environment');var controller=require(_0x307c('0x7'));router[_0x307c('0x8')]('/',auth[_0x307c('0x9')](),controller[_0x307c('0xa')]);router[_0x307c('0x8')](_0x307c('0xb'),auth[_0x307c('0x9')](),controller[_0x307c('0xc')]);router[_0x307c('0x8')]('/:id',auth[_0x307c('0x9')](),controller[_0x307c('0xd')]);router[_0x307c('0x8')](_0x307c('0xe'),auth[_0x307c('0x9')](),controller[_0x307c('0xf')]);router[_0x307c('0x10')]('/',auth[_0x307c('0x9')](),controller[_0x307c('0x11')]);router['post'](_0x307c('0xe'),auth[_0x307c('0x9')](),controller[_0x307c('0x12')]);router['put'](_0x307c('0x13'),auth[_0x307c('0x9')](),controller[_0x307c('0x14')]);router[_0x307c('0x15')]('/:id',auth[_0x307c('0x9')](),controller[_0x307c('0x16')]);router[_0x307c('0x15')](_0x307c('0xe'),auth[_0x307c('0x9')](),controller[_0x307c('0x17')]);module[_0x307c('0x18')]=router; \ No newline at end of file +var _0x1575=['get','isAuthenticated','/describe','describe','/:id','show','/:id/users','getAgents','create','post','addAgents','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0xc36d01,_0x3bf1a6){var _0xecb231=function(_0x2fb301){while(--_0x2fb301){_0xc36d01['push'](_0xc36d01['shift']());}};_0xecb231(++_0x3bf1a6);}(_0x1575,0x190));var _0x5157=function(_0x4d180c,_0x45c68e){_0x4d180c=_0x4d180c-0x0;var _0x49b57e=_0x1575[_0x4d180c];return _0x49b57e;};'use strict';var multer=require(_0x5157('0x0'));var util=require(_0x5157('0x1'));var path=require(_0x5157('0x2'));var timeout=require(_0x5157('0x3'));var express=require(_0x5157('0x4'));var router=express[_0x5157('0x5')]();var auth=require(_0x5157('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5157('0x7'));var controller=require('./voicePrefix.controller');router[_0x5157('0x8')]('/',auth[_0x5157('0x9')](),controller['index']);router[_0x5157('0x8')](_0x5157('0xa'),auth[_0x5157('0x9')](),controller[_0x5157('0xb')]);router[_0x5157('0x8')](_0x5157('0xc'),auth[_0x5157('0x9')](),controller[_0x5157('0xd')]);router['get'](_0x5157('0xe'),auth[_0x5157('0x9')](),controller[_0x5157('0xf')]);router['post']('/',auth[_0x5157('0x9')](),controller[_0x5157('0x10')]);router[_0x5157('0x11')](_0x5157('0xe'),auth[_0x5157('0x9')](),controller[_0x5157('0x12')]);router['put'](_0x5157('0xc'),auth[_0x5157('0x9')](),controller[_0x5157('0x13')]);router[_0x5157('0x14')](_0x5157('0xc'),auth[_0x5157('0x9')](),controller[_0x5157('0x15')]);router[_0x5157('0x14')](_0x5157('0xe'),auth[_0x5157('0x9')](),controller[_0x5157('0x16')]);module[_0x5157('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 772591f..6db8c86 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 _0xf818=['STRING','name','system-','getDataValue'];(function(_0x3a441a,_0x43eb56){var _0x3128a2=function(_0x5d5a17){while(--_0x5d5a17){_0x3a441a['push'](_0x3a441a['shift']());}};_0x3128a2(++_0x43eb56);}(_0xf818,0xd8));var _0x8f81=function(_0x92b9fa,_0x3fcf8){_0x92b9fa=_0x92b9fa-0x0;var _0x440d62=_0xf818[_0x92b9fa];return _0x440d62;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8f81('0x0')],'allowNull':![],'unique':_0x8f81('0x1')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x2c9318){return _0x8f81('0x2')+this[_0x8f81('0x3')](_0x8f81('0x1'))+'-';}},'description':{'type':Sequelize[_0x8f81('0x0')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x121b=['sequelize','exports','name','getDataValue','STRING','INTEGER'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0x121b,0x150));var _0xb121=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x121b[_0xbc346f];return _0x9f9260;};'use strict';var Sequelize=require(_0xb121('0x0'));module[_0xb121('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb121('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x71e49c){return'system-'+this[_0xb121('0x3')](_0xb121('0x2'))+'-';}},'description':{'type':Sequelize[_0xb121('0x4')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xb121('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 3533854..8e269a7 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 _0xa9e0=['includeAll','include','rows','catch','show','params','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoicePrefixes','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','nolimit','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','VoicePrefix','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options'];(function(_0x29bd5a,_0x3d28a4){var _0x1454b6=function(_0xeb37ea){while(--_0xeb37ea){_0x29bd5a['push'](_0x29bd5a['shift']());}};_0x1454b6(++_0x3d28a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voicePrefix.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='VoicePrefixes';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['VoicePrefix'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x24')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x562fb4[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x14bec2,null))[_0x0a9e('0x23')](removeEntity(_0x14bec2,null))[_0x0a9e('0x42')](handleError(_0x14bec2,null));};exports['describe']=function(_0x13f44d,_0x1bde3c){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')]()[_0x0a9e('0x23')](respondWithResult(_0x1bde3c,null))[_0x0a9e('0x42')](handleError(_0x1bde3c,null));};exports[_0x0a9e('0x47')]=function(_0x19383e,_0x34febd){var _0x58a5c2;return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x4f7240){return db['VoicePrefix']['create'](_0x19383e[_0x0a9e('0x4a')],{'transaction':_0x4f7240})[_0x0a9e('0x23')](function(_0x37edaa){_0x58a5c2=_0x37edaa[_0x0a9e('0x25')]({'plain':!![]});return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x58a5c2[_0x0a9e('0x4c')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x5d38ae){return createVoicePrefixExtensions(_0x58a5c2,_0x5d38ae,_0x4f7240);});});})['then'](function(){var _0x53975a=_0x19383e[_0x0a9e('0x4d')][_0x0a9e('0x25')]({'plain':!![]});if(!_0x53975a)throw new Error(_0x0a9e('0x4e'));if(_0x53975a['role']===_0x0a9e('0x4d')){var _0x161aa7=_0x58a5c2;return db['UserProfileSection']['find']({'where':{'name':_0x0a9e('0x4f'),'userProfileId':_0x53975a['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x4c3845){if(_0x4c3845&&_0x4c3845[_0x0a9e('0x50')]===0x0){return db[_0x0a9e('0x51')][_0x0a9e('0x47')]({'name':_0x161aa7['name'],'resourceId':_0x161aa7['id'],'type':_0x4c3845[_0x0a9e('0x28')],'sectionId':_0x4c3845['id']},{})[_0x0a9e('0x23')](function(){return _0x58a5c2;});}else{return _0x58a5c2;}})['catch'](function(_0x50f687){logger[_0x0a9e('0x26')](_0x0a9e('0x52'),_0x50f687);throw _0x50f687;});}return _0x58a5c2;})['then'](respondWithResult(_0x34febd,null))[_0x0a9e('0x42')](handleError(_0x34febd,null));};function Extension(_0x5ce9ac,_0x211ef9,_0x523cd2,_0xe22ccc){this['context']='from-sip';this['exten']=_0x5ce9ac;this[_0x0a9e('0x53')]=_0x523cd2;this['type']=_0x0a9e('0x54');this[_0x0a9e('0x55')]=_0x0a9e('0x56');this[_0x0a9e('0x57')]=_0x211ef9;this[_0x0a9e('0x58')]=_0xe22ccc;}function createVoicePrefixExtensions(_0x272738,_0xd10662,_0x28d814){return new BPromise(function(_0x4e67ab,_0x1c693e){var _0x121cef=new Extension(formatPrefixName(_0x272738[_0x0a9e('0x59')]),0x1,_0x0a9e('0x5a'),_0x0a9e('0x5b'));_0x121cef[_0x0a9e('0x5c')]=_0x272738['id'];return db['VoiceExtension'][_0x0a9e('0x47')](_0x121cef,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x5239ef){var _0x3649cc=_0x5239ef['get']({'plain':!![]});var _0x20c668=_['map'](addVoicePrefixExtensions(_0x272738,_0xd10662),function(_0x4b3c1a){_0x4b3c1a['VoiceExtensionId']=_0x3649cc['id'];_0x4b3c1a[_0x0a9e('0x5c')]=_0x272738['id'];return _0x4b3c1a;});return db['VoiceExtension'][_0x0a9e('0x5d')](_0x20c668,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x261adb){if(!_0x261adb){return _0x1c693e(_0x0a9e('0x5e'));}else{return _0x4e67ab(_0x261adb);}})[_0x0a9e('0x42')](function(_0x26d7db){return _0x1c693e(_0x26d7db);});});;});};function addVoicePrefixExtensions(_0x49eed0,_0x1627a7){var _0x5854cc=[];var _0xca4ade=formatPrefixName(_0x49eed0[_0x0a9e('0x59')]);_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x2,'Set',_0x0a9e('0x60')+_0x49eed0[_0x0a9e('0x28')]));if(_0x49eed0[_0x0a9e('0x61')]){_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x3,'Set',_0x0a9e('0x62')+_0x49eed0[_0x0a9e('0x61')]));}else{_0x5854cc['push'](new Extension(_0xca4ade,0x3,_0x0a9e('0x5a'),_0x0a9e('0x63')));}_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x4,_0x0a9e('0x64'),_0x1627a7[_0x0a9e('0x65')]+','+'${EXTEN:'+(0x8+_0x49eed0[_0x0a9e('0x28')][_0x0a9e('0x32')])+'}'+','+0x1));return _0x5854cc;}function formatPrefixName(_0x281c7d){var _0x47bb43='_';for(var _0x3528b7=0x0;_0x3528b7<_0x281c7d['length'];_0x3528b7++){if(_0x281c7d['charAt'](_0x3528b7)=='-'){_0x47bb43+=_0x281c7d[_0x0a9e('0x66')](_0x3528b7);}else{_0x47bb43+='['+_0x281c7d[_0x0a9e('0x66')](_0x3528b7)+']';}}_0x47bb43+='.';return _0x47bb43;}exports[_0x0a9e('0x22')]=function(_0x19c995,_0x186f39,_0xc8c264){var _0x387489=_0x19c995[_0x0a9e('0x4a')];_0x387489[_0x0a9e('0x59')]=_0x0a9e('0x67')+_0x387489[_0x0a9e('0x28')]+'-';return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x2b8192){return db[_0x0a9e('0x2a')][_0x0a9e('0x22')](_0x387489,{'where':{'id':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')]['destroy']({'where':{'VoicePrefixId':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x387489['VoiceExtensionId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x30944e){return createVoicePrefixExtensions(_0x387489,_0x30944e,_0x2b8192);});});});})['then'](function(){return db[_0x0a9e('0x2a')][_0x0a9e('0x68')](_0x387489['id']);})[_0x0a9e('0x23')](respondWithResult(_0x186f39,null))[_0x0a9e('0x42')](handleError(_0x186f39,null));};exports[_0x0a9e('0x69')]=function(_0x4a43a8,_0x50cdce,_0x4a2438){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4a43a8[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x50cdce,null))[_0x0a9e('0x23')](function(_0x380ab3){if(_0x380ab3){return _0x380ab3[_0x0a9e('0x69')](_0x4a43a8[_0x0a9e('0x4a')]['ids'],_[_0x0a9e('0x6a')](_0x4a43a8[_0x0a9e('0x4a')],[_0x0a9e('0x6b'),'id'])||{})['spread'](function(_0x2bdc44){for(var _0x583b2e=0x0;_0x583b2e<_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')]['length'];_0x583b2e+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x6d'),{'UserId':_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')][_0x583b2e],'VoicePrefixId':_0x4a43a8['params']['id']});}return _0x2bdc44;});}})[_0x0a9e('0x23')](respondWithResult(_0x50cdce,null))[_0x0a9e('0x42')](handleError(_0x50cdce,null));};exports[_0x0a9e('0x6e')]=function(_0x278ab4,_0x5b7fc3,_0x109ccb){var _0x3d91db;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x278ab4['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5b7fc3,null))[_0x0a9e('0x23')](function(_0x30a4c7){if(_0x30a4c7){return _0x30a4c7[_0x0a9e('0x6e')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])[_0x0a9e('0x23')](function(_0x3df0e3){if(_[_0x0a9e('0x6f')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])){for(var _0x1f10ef=0x0;_0x1f10ef<_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')]['length'];_0x1f10ef+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'][_0x1f10ef],'VoicePrefixId':_0x278ab4[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'],'VoicePrefixId':_0x278ab4['params']['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x5b7fc3,null))[_0x0a9e('0x42')](handleError(_0x5b7fc3,null));};exports['getAgents']=function(_0x45108c,_0x53a6a1,_0x260f4b){var _0x8ebf02={};var _0x5637a1={};var _0x28a942;var _0x41cf12;return db[_0x0a9e('0x2a')][_0x0a9e('0x71')]({'where':{'id':_0x45108c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x53a6a1,null))[_0x0a9e('0x23')](function(_0x482ca2){if(_0x482ca2){_0x28a942=_0x482ca2;_0x5637a1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x72')][_0x0a9e('0x2b')]);_0x5637a1['query']=_[_0x0a9e('0x2d')](_0x45108c[_0x0a9e('0x2e')]);_0x5637a1['filters']=_[_0x0a9e('0x2f')](_0x5637a1['model'],_0x5637a1[_0x0a9e('0x2e')]);_0x8ebf02[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5637a1[_0x0a9e('0x2c')],qs['fields'](_0x45108c['query'][_0x0a9e('0x31')]));_0x8ebf02[_0x0a9e('0x30')]=_0x8ebf02[_0x0a9e('0x30')]['length']?_0x8ebf02[_0x0a9e('0x30')]:_0x5637a1[_0x0a9e('0x2c')];_0x8ebf02['order']=qs['sort'](_0x45108c[_0x0a9e('0x2e')]['sort']);_0x8ebf02['where']=qs['filters'](_[_0x0a9e('0x73')](_0x45108c[_0x0a9e('0x2e')],_0x5637a1[_0x0a9e('0x36')]));if(_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x8ebf02[_0x0a9e('0x39')]=_['merge'](_0x8ebf02[_0x0a9e('0x39')],{'$or':_['map'](_0x8ebf02[_0x0a9e('0x30')],function(_0x2aabab){var _0x18ad56={};_0x18ad56[_0x2aabab]={'$like':'%'+_0x45108c[_0x0a9e('0x2e')]['filter']+'%'};return _0x18ad56;})});}_0x8ebf02=_[_0x0a9e('0x38')]({},_0x8ebf02,_0x45108c[_0x0a9e('0x3e')]);return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})['then'](function(_0xb6e411){if(_0xb6e411){_0x41cf12=_0xb6e411[_0x0a9e('0x32')];if(!_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x33')](_0x0a9e('0x75'))){_0x8ebf02[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x45108c[_0x0a9e('0x2e')]['limit']);_0x8ebf02[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x45108c['query'][_0x0a9e('0x1c')]);}return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})[_0x0a9e('0x23')](function(_0x5a26c8){if(_0x5a26c8){return _0x5a26c8?{'count':_0x41cf12,'rows':_0x5a26c8}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x53a6a1,null))['catch'](handleError(_0x53a6a1,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','include','rows','catch','show','params','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoicePrefixes','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','nolimit','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','index','VoicePrefix','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','map','type','key','VIRTUAL','options'];(function(_0x319410,_0x1ac2aa){var _0x591735=function(_0x54a44b){while(--_0x54a44b){_0x319410['push'](_0x319410['shift']());}};_0x591735(++_0x1ac2aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var authService=require(_0x0a9e('0xe'));var hardwareService=require(_0x0a9e('0xf'));var Redis=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voicePrefix.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x370d86=_0x2fb0e4[_0x0a9e('0x25')]({'plain':!![]});var _0x16b1ca='VoicePrefixes';return db['UserProfileResource'][_0x0a9e('0x24')]({'where':{'type':_0x16b1ca,'resourceId':_0x370d86['id']}})[_0x0a9e('0x23')](function(){return _0x2fb0e4;});})[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x384319,_0x479bc4){return function(_0x45a1e7){if(!_0x45a1e7){_0x384319['sendStatus'](0x194);}return _0x45a1e7;};}function handleError(_0x1dc186,_0x34dc65){_0x34dc65=_0x34dc65||0x1f4;return function(_0x25fba9){logger[_0x0a9e('0x26')](_0x25fba9[_0x0a9e('0x27')]);if(_0x25fba9[_0x0a9e('0x28')]){delete _0x25fba9[_0x0a9e('0x28')];}_0x1dc186[_0x0a9e('0x19')](_0x34dc65)['send'](_0x25fba9);};}exports[_0x0a9e('0x29')]=function(_0x468813,_0x2b1f27){var _0x2ec755={},_0x5c877d={},_0x15b200={'count':0x0,'rows':[]};var _0x40e7a3=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x5c877d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x40e7a3);_0x5c877d[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x468813[_0x0a9e('0x2e')]);_0x5c877d['filters']=_[_0x0a9e('0x2f')](_0x5c877d['model'],_0x5c877d[_0x0a9e('0x2e')]);_0x2ec755[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5c877d[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x468813['query'][_0x0a9e('0x31')]));_0x2ec755[_0x0a9e('0x30')]=_0x2ec755[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x2ec755[_0x0a9e('0x30')]:_0x5c877d[_0x0a9e('0x2c')];if(!_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x33')]('nolimit')){_0x2ec755[_0x0a9e('0x1d')]=qs['limit'](_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x1d')]);_0x2ec755[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x468813['query'][_0x0a9e('0x1c')]);}_0x2ec755[_0x0a9e('0x34')]=qs[_0x0a9e('0x35')](_0x468813[_0x0a9e('0x2e')]['sort']);_0x2ec755['where']=qs[_0x0a9e('0x36')](_['pick'](_0x468813[_0x0a9e('0x2e')],_0x5c877d[_0x0a9e('0x36')]));if(_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x2ec755['where']=_[_0x0a9e('0x38')](_0x2ec755[_0x0a9e('0x39')],{'$or':_[_0x0a9e('0x3a')](_0x40e7a3,function(_0x533942){if(_0x533942[_0x0a9e('0x3b')][_0x0a9e('0x3c')]!==_0x0a9e('0x3d')){var _0x4c1c0e={};_0x4c1c0e[_0x533942['field']]={'$like':'%'+_0x468813[_0x0a9e('0x2e')][_0x0a9e('0x37')]+'%'};return _0x4c1c0e;}})});}_0x2ec755=_['merge']({},_0x2ec755,_0x468813[_0x0a9e('0x3e')]);var _0x419125={'where':_0x2ec755[_0x0a9e('0x39')]};return db[_0x0a9e('0x2a')]['count'](_0x419125)['then'](function(_0x15e37d){_0x15b200[_0x0a9e('0x1b')]=_0x15e37d;if(_0x468813['query'][_0x0a9e('0x3f')]){_0x2ec755[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')]['findAll'](_0x2ec755);})[_0x0a9e('0x23')](function(_0x2cfea9){_0x15b200[_0x0a9e('0x41')]=_0x2cfea9;return _0x15b200;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2b1f27,_0x2ec755))[_0x0a9e('0x42')](handleError(_0x2b1f27,null));};exports[_0x0a9e('0x43')]=function(_0x2881b3,_0x45a9b8){var _0x23b089={'raw':![],'where':{'id':_0x2881b3[_0x0a9e('0x44')]['id']}},_0x3da2cd={};_0x3da2cd[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x3da2cd['query']=_['keys'](_0x2881b3[_0x0a9e('0x2e')]);_0x3da2cd[_0x0a9e('0x36')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],_0x3da2cd[_0x0a9e('0x2e')]);_0x23b089[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x3da2cd[_0x0a9e('0x2c')],qs[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x31')]));_0x23b089[_0x0a9e('0x30')]=_0x23b089['attributes'][_0x0a9e('0x32')]?_0x23b089[_0x0a9e('0x30')]:_0x3da2cd[_0x0a9e('0x2c')];if(_0x2881b3[_0x0a9e('0x2e')][_0x0a9e('0x3f')]){_0x23b089[_0x0a9e('0x40')]=[{'all':!![]}];}_0x23b089=_[_0x0a9e('0x38')]({},_0x23b089,_0x2881b3[_0x0a9e('0x3e')]);return db['VoicePrefix'][_0x0a9e('0x45')](_0x23b089)['then'](handleEntityNotFound(_0x45a9b8,null))[_0x0a9e('0x23')](respondWithResult(_0x45a9b8,null))[_0x0a9e('0x42')](handleError(_0x45a9b8,null));};exports[_0x0a9e('0x24')]=function(_0x562fb4,_0x14bec2){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x562fb4[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x14bec2,null))[_0x0a9e('0x23')](removeEntity(_0x14bec2,null))[_0x0a9e('0x42')](handleError(_0x14bec2,null));};exports['describe']=function(_0x13f44d,_0x1bde3c){return db[_0x0a9e('0x2a')][_0x0a9e('0x46')]()[_0x0a9e('0x23')](respondWithResult(_0x1bde3c,null))[_0x0a9e('0x42')](handleError(_0x1bde3c,null));};exports[_0x0a9e('0x47')]=function(_0x19383e,_0x34febd){var _0x58a5c2;return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x4f7240){return db['VoicePrefix']['create'](_0x19383e[_0x0a9e('0x4a')],{'transaction':_0x4f7240})[_0x0a9e('0x23')](function(_0x37edaa){_0x58a5c2=_0x37edaa[_0x0a9e('0x25')]({'plain':!![]});return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x58a5c2[_0x0a9e('0x4c')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x5d38ae){return createVoicePrefixExtensions(_0x58a5c2,_0x5d38ae,_0x4f7240);});});})['then'](function(){var _0x53975a=_0x19383e[_0x0a9e('0x4d')][_0x0a9e('0x25')]({'plain':!![]});if(!_0x53975a)throw new Error(_0x0a9e('0x4e'));if(_0x53975a['role']===_0x0a9e('0x4d')){var _0x161aa7=_0x58a5c2;return db['UserProfileSection']['find']({'where':{'name':_0x0a9e('0x4f'),'userProfileId':_0x53975a['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x4c3845){if(_0x4c3845&&_0x4c3845[_0x0a9e('0x50')]===0x0){return db[_0x0a9e('0x51')][_0x0a9e('0x47')]({'name':_0x161aa7['name'],'resourceId':_0x161aa7['id'],'type':_0x4c3845[_0x0a9e('0x28')],'sectionId':_0x4c3845['id']},{})[_0x0a9e('0x23')](function(){return _0x58a5c2;});}else{return _0x58a5c2;}})['catch'](function(_0x50f687){logger[_0x0a9e('0x26')](_0x0a9e('0x52'),_0x50f687);throw _0x50f687;});}return _0x58a5c2;})['then'](respondWithResult(_0x34febd,null))[_0x0a9e('0x42')](handleError(_0x34febd,null));};function Extension(_0x5ce9ac,_0x211ef9,_0x523cd2,_0xe22ccc){this['context']='from-sip';this['exten']=_0x5ce9ac;this[_0x0a9e('0x53')]=_0x523cd2;this['type']=_0x0a9e('0x54');this[_0x0a9e('0x55')]=_0x0a9e('0x56');this[_0x0a9e('0x57')]=_0x211ef9;this[_0x0a9e('0x58')]=_0xe22ccc;}function createVoicePrefixExtensions(_0x272738,_0xd10662,_0x28d814){return new BPromise(function(_0x4e67ab,_0x1c693e){var _0x121cef=new Extension(formatPrefixName(_0x272738[_0x0a9e('0x59')]),0x1,_0x0a9e('0x5a'),_0x0a9e('0x5b'));_0x121cef[_0x0a9e('0x5c')]=_0x272738['id'];return db['VoiceExtension'][_0x0a9e('0x47')](_0x121cef,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x5239ef){var _0x3649cc=_0x5239ef['get']({'plain':!![]});var _0x20c668=_['map'](addVoicePrefixExtensions(_0x272738,_0xd10662),function(_0x4b3c1a){_0x4b3c1a['VoiceExtensionId']=_0x3649cc['id'];_0x4b3c1a[_0x0a9e('0x5c')]=_0x272738['id'];return _0x4b3c1a;});return db['VoiceExtension'][_0x0a9e('0x5d')](_0x20c668,{'transaction':_0x28d814})[_0x0a9e('0x23')](function(_0x261adb){if(!_0x261adb){return _0x1c693e(_0x0a9e('0x5e'));}else{return _0x4e67ab(_0x261adb);}})[_0x0a9e('0x42')](function(_0x26d7db){return _0x1c693e(_0x26d7db);});});;});};function addVoicePrefixExtensions(_0x49eed0,_0x1627a7){var _0x5854cc=[];var _0xca4ade=formatPrefixName(_0x49eed0[_0x0a9e('0x59')]);_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x2,'Set',_0x0a9e('0x60')+_0x49eed0[_0x0a9e('0x28')]));if(_0x49eed0[_0x0a9e('0x61')]){_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x3,'Set',_0x0a9e('0x62')+_0x49eed0[_0x0a9e('0x61')]));}else{_0x5854cc['push'](new Extension(_0xca4ade,0x3,_0x0a9e('0x5a'),_0x0a9e('0x63')));}_0x5854cc[_0x0a9e('0x5f')](new Extension(_0xca4ade,0x4,_0x0a9e('0x64'),_0x1627a7[_0x0a9e('0x65')]+','+'${EXTEN:'+(0x8+_0x49eed0[_0x0a9e('0x28')][_0x0a9e('0x32')])+'}'+','+0x1));return _0x5854cc;}function formatPrefixName(_0x281c7d){var _0x47bb43='_';for(var _0x3528b7=0x0;_0x3528b7<_0x281c7d['length'];_0x3528b7++){if(_0x281c7d['charAt'](_0x3528b7)=='-'){_0x47bb43+=_0x281c7d[_0x0a9e('0x66')](_0x3528b7);}else{_0x47bb43+='['+_0x281c7d[_0x0a9e('0x66')](_0x3528b7)+']';}}_0x47bb43+='.';return _0x47bb43;}exports[_0x0a9e('0x22')]=function(_0x19c995,_0x186f39,_0xc8c264){var _0x387489=_0x19c995[_0x0a9e('0x4a')];_0x387489[_0x0a9e('0x59')]=_0x0a9e('0x67')+_0x387489[_0x0a9e('0x28')]+'-';return db[_0x0a9e('0x48')][_0x0a9e('0x49')](function(_0x2b8192){return db[_0x0a9e('0x2a')][_0x0a9e('0x22')](_0x387489,{'where':{'id':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')]['destroy']({'where':{'VoicePrefixId':_0x387489['id']},'transaction':_0x2b8192})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x4b')][_0x0a9e('0x45')]({'where':{'id':_0x387489['VoiceExtensionId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x30944e){return createVoicePrefixExtensions(_0x387489,_0x30944e,_0x2b8192);});});});})['then'](function(){return db[_0x0a9e('0x2a')][_0x0a9e('0x68')](_0x387489['id']);})[_0x0a9e('0x23')](respondWithResult(_0x186f39,null))[_0x0a9e('0x42')](handleError(_0x186f39,null));};exports[_0x0a9e('0x69')]=function(_0x4a43a8,_0x50cdce,_0x4a2438){return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x4a43a8[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x50cdce,null))[_0x0a9e('0x23')](function(_0x380ab3){if(_0x380ab3){return _0x380ab3[_0x0a9e('0x69')](_0x4a43a8[_0x0a9e('0x4a')]['ids'],_[_0x0a9e('0x6a')](_0x4a43a8[_0x0a9e('0x4a')],[_0x0a9e('0x6b'),'id'])||{})['spread'](function(_0x2bdc44){for(var _0x583b2e=0x0;_0x583b2e<_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')]['length'];_0x583b2e+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x6d'),{'UserId':_0x4a43a8[_0x0a9e('0x4a')][_0x0a9e('0x6b')][_0x583b2e],'VoicePrefixId':_0x4a43a8['params']['id']});}return _0x2bdc44;});}})[_0x0a9e('0x23')](respondWithResult(_0x50cdce,null))[_0x0a9e('0x42')](handleError(_0x50cdce,null));};exports[_0x0a9e('0x6e')]=function(_0x278ab4,_0x5b7fc3,_0x109ccb){var _0x3d91db;return db[_0x0a9e('0x2a')][_0x0a9e('0x45')]({'where':{'id':_0x278ab4['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x5b7fc3,null))[_0x0a9e('0x23')](function(_0x30a4c7){if(_0x30a4c7){return _0x30a4c7[_0x0a9e('0x6e')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])[_0x0a9e('0x23')](function(_0x3df0e3){if(_[_0x0a9e('0x6f')](_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')])){for(var _0x1f10ef=0x0;_0x1f10ef<_0x278ab4[_0x0a9e('0x2e')][_0x0a9e('0x6b')]['length'];_0x1f10ef+=0x1){socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'][_0x1f10ef],'VoicePrefixId':_0x278ab4[_0x0a9e('0x44')]['id']});}}else{socket[_0x0a9e('0x6c')](_0x0a9e('0x70'),{'UserId':_0x278ab4[_0x0a9e('0x2e')]['ids'],'VoicePrefixId':_0x278ab4['params']['id']});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x5b7fc3,null))[_0x0a9e('0x42')](handleError(_0x5b7fc3,null));};exports['getAgents']=function(_0x45108c,_0x53a6a1,_0x260f4b){var _0x8ebf02={};var _0x5637a1={};var _0x28a942;var _0x41cf12;return db[_0x0a9e('0x2a')][_0x0a9e('0x71')]({'where':{'id':_0x45108c[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x53a6a1,null))[_0x0a9e('0x23')](function(_0x482ca2){if(_0x482ca2){_0x28a942=_0x482ca2;_0x5637a1[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x72')][_0x0a9e('0x2b')]);_0x5637a1['query']=_[_0x0a9e('0x2d')](_0x45108c[_0x0a9e('0x2e')]);_0x5637a1['filters']=_[_0x0a9e('0x2f')](_0x5637a1['model'],_0x5637a1[_0x0a9e('0x2e')]);_0x8ebf02[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x5637a1[_0x0a9e('0x2c')],qs['fields'](_0x45108c['query'][_0x0a9e('0x31')]));_0x8ebf02[_0x0a9e('0x30')]=_0x8ebf02[_0x0a9e('0x30')]['length']?_0x8ebf02[_0x0a9e('0x30')]:_0x5637a1[_0x0a9e('0x2c')];_0x8ebf02['order']=qs['sort'](_0x45108c[_0x0a9e('0x2e')]['sort']);_0x8ebf02['where']=qs['filters'](_[_0x0a9e('0x73')](_0x45108c[_0x0a9e('0x2e')],_0x5637a1[_0x0a9e('0x36')]));if(_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x37')]){_0x8ebf02[_0x0a9e('0x39')]=_['merge'](_0x8ebf02[_0x0a9e('0x39')],{'$or':_['map'](_0x8ebf02[_0x0a9e('0x30')],function(_0x2aabab){var _0x18ad56={};_0x18ad56[_0x2aabab]={'$like':'%'+_0x45108c[_0x0a9e('0x2e')]['filter']+'%'};return _0x18ad56;})});}_0x8ebf02=_[_0x0a9e('0x38')]({},_0x8ebf02,_0x45108c[_0x0a9e('0x3e')]);return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})['then'](function(_0xb6e411){if(_0xb6e411){_0x41cf12=_0xb6e411[_0x0a9e('0x32')];if(!_0x45108c[_0x0a9e('0x2e')][_0x0a9e('0x33')](_0x0a9e('0x75'))){_0x8ebf02[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x45108c[_0x0a9e('0x2e')]['limit']);_0x8ebf02[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x45108c['query'][_0x0a9e('0x1c')]);}return _0x28a942[_0x0a9e('0x74')](_0x8ebf02);}})[_0x0a9e('0x23')](function(_0x5a26c8){if(_0x5a26c8){return _0x5a26c8?{'count':_0x41cf12,'rows':_0x5a26c8}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x53a6a1,null))['catch'](handleError(_0x53a6a1,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 42f7ee8..694740e 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 _0x5178=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3d85fe,_0x250ea9){var _0x2fde48=function(_0x4207c6){while(--_0x4207c6){_0x3d85fe['push'](_0x3d85fe['shift']());}};_0x2fde48(++_0x250ea9);}(_0x5178,0x171));var _0x8517=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x5178[_0x2d7f0e];return _0x110b07;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x8517('0x0'))['db'][_0x8517('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8517('0x2')](0x0);var events={'afterCreate':_0x8517('0x3'),'afterUpdate':_0x8517('0x4'),'afterDestroy':'remove'};function emitEvent(_0x483381){return function(_0x3ed6a5,_0x221184,_0x4ccd73){VoicePrefixEvents[_0x8517('0x5')](_0x483381+':'+_0x3ed6a5['id'],_0x3ed6a5);VoicePrefixEvents['emit'](_0x483381,_0x3ed6a5);_0x4ccd73(null);};}for(var e in events){if(events[_0x8517('0x6')](e)){var event=events[e];VoicePrefix[_0x8517('0x7')](e,emitEvent(event));}}module[_0x8517('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x7bae=['VoicePrefix','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x3de796,_0x52f1b0){var _0x5cb503=function(_0x561387){while(--_0x561387){_0x3de796['push'](_0x3de796['shift']());}};_0x5cb503(++_0x52f1b0);}(_0x7bae,0x13b));var _0xe7ba=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x7bae[_0x22f8ab];return _0x2a70e5;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0xe7ba('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe7ba('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe7ba('0x2'),'afterDestroy':'remove'};function emitEvent(_0x120efa){return function(_0x10908b,_0x166acb,_0x2276df){VoicePrefixEvents[_0xe7ba('0x3')](_0x120efa+':'+_0x10908b['id'],_0x10908b);VoicePrefixEvents[_0xe7ba('0x3')](_0x120efa,_0x10908b);_0x2276df(null);};}for(var e in events){if(events[_0xe7ba('0x4')](e)){var event=events[e];VoicePrefix[_0xe7ba('0x5')](e,emitEvent(event));}}module[_0xe7ba('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index f280692..f46f8b6 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 _0xa92e=['voice_prefixes','lodash','../../config/logger','api','moment','bluebird','request-promise','./voicePrefix.attributes','exports','define','VoicePrefix'];(function(_0x505997,_0x140aa4){var _0x3c261e=function(_0x30182d){while(--_0x30182d){_0x505997['push'](_0x505997['shift']());}};_0x3c261e(++_0x140aa4);}(_0xa92e,0x1e5));var _0xea92=function(_0x9175b4,_0x46e548){_0x9175b4=_0x9175b4-0x0;var _0x59e7fa=_0xa92e[_0x9175b4];return _0x59e7fa;};'use strict';var _=require(_0xea92('0x0'));var util=require('util');var logger=require(_0xea92('0x1'))(_0xea92('0x2'));var moment=require(_0xea92('0x3'));var BPromise=require(_0xea92('0x4'));var rp=require(_0xea92('0x5'));var attributes=require(_0xea92('0x6'));module[_0xea92('0x7')]=function(_0x2178d9,_0x5dad06){return _0x2178d9[_0xea92('0x8')](_0xea92('0x9'),attributes,{'tableName':_0xea92('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cfd=['VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','request-promise','./voicePrefix.attributes','exports','define'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1cfd,0x1db));var _0xd1cf=function(_0xa3a14e,_0x55b52a){_0xa3a14e=_0xa3a14e-0x0;var _0x3c626f=_0x1cfd[_0xa3a14e];return _0x3c626f;};'use strict';var _=require(_0xd1cf('0x0'));var util=require(_0xd1cf('0x1'));var logger=require(_0xd1cf('0x2'))(_0xd1cf('0x3'));var moment=require(_0xd1cf('0x4'));var BPromise=require('bluebird');var rp=require(_0xd1cf('0x5'));var attributes=require(_0xd1cf('0x6'));module[_0xd1cf('0x7')]=function(_0x517dac,_0x4c1c99){return _0x517dac[_0xd1cf('0x8')](_0xd1cf('0x9'),attributes,{'tableName':_0xd1cf('0xa'),'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 50512b9..7fe4dac 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 _0xed8d=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','defaults','redis','socket.io-emitter','register','request','then','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','VoicePrefix,\x20%s,\x20%s','result','catch'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xed8d,0x150));var _0xded8=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0xed8d[_0x4fa0ea];return _0x51d027;};'use strict';var _=require(_0xded8('0x0'));var util=require(_0xded8('0x1'));var moment=require('moment');var BPromise=require(_0xded8('0x2'));var rs=require(_0xded8('0x3'));var fs=require('fs');var Redis=require(_0xded8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xded8('0x5'));var logger=require(_0xded8('0x6'))('rpc');var config=require(_0xded8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xded8('0x8')]['http']({'port':0x232a});config['redis']=_[_0xded8('0x9')](config[_0xded8('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xded8('0xb'))(new Redis(config[_0xded8('0xa')]));require('./voicePrefix.socket')[_0xded8('0xc')](socket);function respondWithRpcPromise(_0x32b3ef,_0x17a0d3,_0xbda90b){return new BPromise(function(_0x165d6c,_0xec0585){return client[_0xded8('0xd')](_0x32b3ef,_0xbda90b)[_0xded8('0xe')](function(_0x1e4a71){logger[_0xded8('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x17a0d3,_0xded8('0x10'));logger['debug'](_0xded8('0x11'),_0x17a0d3,_0xded8('0x10'),JSON['stringify'](_0x1e4a71));if(_0x1e4a71[_0xded8('0x12')]){if(_0x1e4a71[_0xded8('0x12')][_0xded8('0x13')]===0x1f4){logger[_0xded8('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x17a0d3,_0x1e4a71[_0xded8('0x12')][_0xded8('0x14')]);return _0xec0585(_0x1e4a71[_0xded8('0x12')][_0xded8('0x14')]);}logger[_0xded8('0x12')](_0xded8('0x15'),_0x17a0d3,_0x1e4a71[_0xded8('0x12')]['message']);return _0x165d6c(_0x1e4a71[_0xded8('0x12')]['message']);}else{logger[_0xded8('0xf')](_0xded8('0x15'),_0x17a0d3,_0xded8('0x10'));_0x165d6c(_0x1e4a71[_0xded8('0x16')][_0xded8('0x14')]);}})[_0xded8('0x17')](function(_0x2f71d2){logger['error'](_0xded8('0x15'),_0x17a0d3,_0x2f71d2);_0xec0585(_0x2f71d2);});});} \ No newline at end of file +var _0x0e9d=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','VoicePrefix,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','lodash','util','moment','bluebird','randomstring'];(function(_0x16453c,_0x1d8264){var _0x4fe84e=function(_0x354936){while(--_0x354936){_0x16453c['push'](_0x16453c['shift']());}};_0x4fe84e(++_0x1d8264);}(_0x0e9d,0xf5));var _0xd0e9=function(_0x2ed4d9,_0x164143){_0x2ed4d9=_0x2ed4d9-0x0;var _0x90dd52=_0x0e9d[_0x2ed4d9];return _0x90dd52;};'use strict';var _=require(_0xd0e9('0x0'));var util=require(_0xd0e9('0x1'));var moment=require(_0xd0e9('0x2'));var BPromise=require(_0xd0e9('0x3'));var rs=require(_0xd0e9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0e9('0x5'))['db'];var utils=require(_0xd0e9('0x6'));var logger=require(_0xd0e9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd0e9('0x8'));var client=jayson[_0xd0e9('0x9')]['http']({'port':0x232a});config[_0xd0e9('0xa')]=_[_0xd0e9('0xb')](config[_0xd0e9('0xa')],{'host':_0xd0e9('0xc'),'port':0x18eb});var socket=require(_0xd0e9('0xd'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xd0e9('0xe')](socket);function respondWithRpcPromise(_0x4baa06,_0x4eb91d,_0x2ac6c9){return new BPromise(function(_0x50ae28,_0x4f1f7e){return client[_0xd0e9('0xf')](_0x4baa06,_0x2ac6c9)['then'](function(_0x615dd5){logger['info'](_0xd0e9('0x10'),_0x4eb91d,'request\x20sent');logger[_0xd0e9('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x4eb91d,'request\x20sent',JSON[_0xd0e9('0x12')](_0x615dd5));if(_0x615dd5[_0xd0e9('0x13')]){if(_0x615dd5[_0xd0e9('0x13')][_0xd0e9('0x14')]===0x1f4){logger[_0xd0e9('0x13')](_0xd0e9('0x10'),_0x4eb91d,_0x615dd5[_0xd0e9('0x13')][_0xd0e9('0x15')]);return _0x4f1f7e(_0x615dd5[_0xd0e9('0x13')][_0xd0e9('0x15')]);}logger[_0xd0e9('0x13')](_0xd0e9('0x10'),_0x4eb91d,_0x615dd5[_0xd0e9('0x13')][_0xd0e9('0x15')]);return _0x50ae28(_0x615dd5[_0xd0e9('0x13')]['message']);}else{logger[_0xd0e9('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x4eb91d,_0xd0e9('0x17'));_0x50ae28(_0x615dd5[_0xd0e9('0x18')][_0xd0e9('0x15')]);}})['catch'](function(_0x435bc2){logger['error'](_0xd0e9('0x10'),_0x4eb91d,_0x435bc2);_0x4f1f7e(_0x435bc2);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index bc34881..c7eab8a 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 _0x9a4c=['update','emit','removeListener','register','length','./voicePrefix.events','save','remove'];(function(_0x4dcfbb,_0x170c85){var _0x1d02cd=function(_0x12918e){while(--_0x12918e){_0x4dcfbb['push'](_0x4dcfbb['shift']());}};_0x1d02cd(++_0x170c85);}(_0x9a4c,0x1c5));var _0xc9a4=function(_0x55406d,_0x116f1e){_0x55406d=_0x55406d-0x0;var _0x5a8275=_0x9a4c[_0x55406d];return _0x5a8275;};'use strict';var VoicePrefixEvents=require(_0xc9a4('0x0'));var events=[_0xc9a4('0x1'),_0xc9a4('0x2'),_0xc9a4('0x3')];function createListener(_0x4342d5,_0x3460ab){return function(_0x807e79){_0x3460ab[_0xc9a4('0x4')](_0x4342d5,_0x807e79);};}function removeListener(_0x116a87,_0xff5a68){return function(){VoicePrefixEvents[_0xc9a4('0x5')](_0x116a87,_0xff5a68);};}exports[_0xc9a4('0x6')]=function(_0x27b943){for(var _0xc0127c=0x0,_0x8883a3=events[_0xc9a4('0x7')];_0xc0127c<_0x8883a3;_0xc0127c++){var _0x2ccac8=events[_0xc0127c];var _0x5f0643=createListener('voicePrefix:'+_0x2ccac8,_0x27b943);VoicePrefixEvents['on'](_0x2ccac8,_0x5f0643);}}; \ No newline at end of file +var _0xcb29=['length','voicePrefix:','save','update','removeListener'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xcb29,0xfc));var _0x9cb2=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xcb29[_0x4b2863];return _0x567d67;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x9cb2('0x0'),'remove',_0x9cb2('0x1')];function createListener(_0x426d59,_0xfcdbbd){return function(_0x5adbe4){_0xfcdbbd['emit'](_0x426d59,_0x5adbe4);};}function removeListener(_0x1e67e4,_0x3b18c9){return function(){VoicePrefixEvents[_0x9cb2('0x2')](_0x1e67e4,_0x3b18c9);};}exports['register']=function(_0x3bee82){for(var _0x1ffec3=0x0,_0xaa15ad=events[_0x9cb2('0x3')];_0x1ffec3<_0xaa15ad;_0x1ffec3++){var _0x1f1a7c=events[_0x1ffec3];var _0x29ec1f=createListener(_0x9cb2('0x4')+_0x1f1a7c,_0x3bee82);VoicePrefixEvents['on'](_0x1f1a7c,_0x29ec1f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index bdd06f2..7fb8d53 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 _0x702d=['delete','destroy','removeTeams','removeAgents','/:id/lists','removeLists','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','get','/:id','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getTeams','/:id/users','getAgents','/:id/members','getLists','/:id/blacklists','getBlackLists','create','/:id/clone','clone','post','/:id/teams','addTeams','addAgents','put'];(function(_0x51696a,_0x8fb5f2){var _0x14a1b5=function(_0x3743a2){while(--_0x3743a2){_0x51696a['push'](_0x51696a['shift']());}};_0x14a1b5(++_0x8fb5f2);}(_0x702d,0x147));var _0xd702=function(_0x3c0f2d,_0x5633a4){_0x3c0f2d=_0x3c0f2d-0x0;var _0x328278=_0x702d[_0x3c0f2d];return _0x328278;};'use strict';var multer=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var path=require(_0xd702('0x2'));var timeout=require(_0xd702('0x3'));var express=require(_0xd702('0x4'));var router=express['Router']();var auth=require(_0xd702('0x5'));var interaction=require(_0xd702('0x6'));var config=require(_0xd702('0x7'));var controller=require(_0xd702('0x8'));router['get']('/',auth[_0xd702('0x9')](),controller['index']);router[_0xd702('0xa')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller['show']);router[_0xd702('0xa')]('/:id/hoppers',auth[_0xd702('0x9')](),controller[_0xd702('0xc')]);router[_0xd702('0xa')](_0xd702('0xd'),auth[_0xd702('0x9')](),controller[_0xd702('0xe')]);router[_0xd702('0xa')](_0xd702('0xf'),auth[_0xd702('0x9')](),controller[_0xd702('0x10')]);router['get']('/:id/hopper_black',auth[_0xd702('0x9')](),controller[_0xd702('0x11')]);router[_0xd702('0xa')]('/:id/teams',auth[_0xd702('0x9')](),controller[_0xd702('0x12')]);router[_0xd702('0xa')](_0xd702('0x13'),auth[_0xd702('0x9')](),controller[_0xd702('0x14')]);router['get'](_0xd702('0x15'),auth[_0xd702('0x9')](),controller['getMembers']);router[_0xd702('0xa')]('/:id/lists',auth[_0xd702('0x9')](),controller[_0xd702('0x16')]);router['get'](_0xd702('0x17'),auth[_0xd702('0x9')](),controller[_0xd702('0x18')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd702('0x19')]);router['post'](_0xd702('0x1a'),auth[_0xd702('0x9')](),controller[_0xd702('0x1b')]);router[_0xd702('0x1c')](_0xd702('0x1d'),auth[_0xd702('0x9')](),controller[_0xd702('0x1e')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xd702('0x1f')]);router[_0xd702('0x1c')]('/:id/lists',auth[_0xd702('0x9')](),controller['addLists']);router[_0xd702('0x1c')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router[_0xd702('0x20')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller['update']);router[_0xd702('0x21')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller[_0xd702('0x22')]);router[_0xd702('0x21')](_0xd702('0x1d'),auth[_0xd702('0x9')](),controller[_0xd702('0x23')]);router[_0xd702('0x21')]('/:id/users',auth[_0xd702('0x9')](),controller[_0xd702('0x24')]);router[_0xd702('0x21')](_0xd702('0x25'),auth[_0xd702('0x9')](),controller[_0xd702('0x26')]);router[_0xd702('0x21')](_0xd702('0x17'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xd702('0x27')]=router; \ No newline at end of file +var _0xe14d=['index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addAgents','addLists','addBlackLists','put','/:id','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated'];(function(_0x5b686e,_0xae191d){var _0x3ddba2=function(_0x161c3b){while(--_0x161c3b){_0x5b686e['push'](_0x5b686e['shift']());}};_0x3ddba2(++_0xae191d);}(_0xe14d,0x1ee));var _0xde14=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xe14d[_0x33032e];return _0x13316b;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var auth=require(_0xde14('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde14('0x6'));var controller=require(_0xde14('0x7'));router[_0xde14('0x8')]('/',auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router[_0xde14('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xde14('0xb')]);router[_0xde14('0x8')](_0xde14('0xc'),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router[_0xde14('0x8')](_0xde14('0xe'),auth[_0xde14('0x9')](),controller['getHopperHistories']);router[_0xde14('0x8')](_0xde14('0xf'),auth[_0xde14('0x9')](),controller[_0xde14('0x10')]);router[_0xde14('0x8')](_0xde14('0x11'),auth[_0xde14('0x9')](),controller[_0xde14('0x12')]);router[_0xde14('0x8')](_0xde14('0x13'),auth[_0xde14('0x9')](),controller[_0xde14('0x14')]);router[_0xde14('0x8')](_0xde14('0x15'),auth[_0xde14('0x9')](),controller['getAgents']);router['get'](_0xde14('0x16'),auth[_0xde14('0x9')](),controller[_0xde14('0x17')]);router['get'](_0xde14('0x18'),auth[_0xde14('0x9')](),controller[_0xde14('0x19')]);router[_0xde14('0x8')](_0xde14('0x1a'),auth[_0xde14('0x9')](),controller[_0xde14('0x1b')]);router[_0xde14('0x1c')]('/',auth[_0xde14('0x9')](),controller[_0xde14('0x1d')]);router['post'](_0xde14('0x1e'),auth[_0xde14('0x9')](),controller[_0xde14('0x1f')]);router[_0xde14('0x1c')]('/:id/teams',auth[_0xde14('0x9')](),controller['addTeams']);router[_0xde14('0x1c')]('/:id/users',auth[_0xde14('0x9')](),controller[_0xde14('0x20')]);router[_0xde14('0x1c')](_0xde14('0x18'),auth[_0xde14('0x9')](),controller[_0xde14('0x21')]);router[_0xde14('0x1c')](_0xde14('0x1a'),auth[_0xde14('0x9')](),controller[_0xde14('0x22')]);router[_0xde14('0x23')](_0xde14('0x24'),auth[_0xde14('0x9')](),controller['update']);router[_0xde14('0x25')](_0xde14('0x24'),auth[_0xde14('0x9')](),controller[_0xde14('0x26')]);router[_0xde14('0x25')](_0xde14('0x13'),auth[_0xde14('0x9')](),controller[_0xde14('0x27')]);router[_0xde14('0x25')](_0xde14('0x15'),auth['isAuthenticated'](),controller[_0xde14('0x28')]);router[_0xde14('0x25')](_0xde14('0x18'),auth[_0xde14('0x9')](),controller['removeLists']);router[_0xde14('0x25')](_0xde14('0x1a'),auth[_0xde14('0x9')](),controller['removeBlackLists']);module[_0xde14('0x29')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index e073f98..605c43b 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 _0x4b86=['rrordered','ringall','setDataValue','strategy','getDataValue','dialMethod','booked','roundrobin','predictive','power','INTEGER','ENUM','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','outbound','inbound','default','fewestcalls','random','rrmemory','linear','wrandom'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0x4b86,0xd6));var _0x64b8=function(_0x3cb872,_0x4b26e2){_0x3cb872=_0x3cb872-0x0;var _0x288d59=_0x4b86[_0x3cb872];return _0x288d59;};'use strict';var Sequelize=require(_0x64b8('0x0'));module[_0x64b8('0x1')]={'name':{'type':Sequelize[_0x64b8('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x64b8('0x3')),'allowNull':![],'defaultValue':_0x64b8('0x4')},'musiconhold':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':_0x64b8('0x5')},'announce':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall','leastrecent',_0x64b8('0x6'),_0x64b8('0x7'),_0x64b8('0x8'),_0x64b8('0x9'),_0x64b8('0xa'),_0x64b8('0xb')),'allowNull':![],'defaultValue':_0x64b8('0xc'),'set':function(_0x462ef7){this[_0x64b8('0xd')](_0x64b8('0xe'),_0x462ef7?_0x462ef7:_0x64b8('0x8'));},'get':function(){var _0x329018=this[_0x64b8('0xf')]('type');var _0x2027d0=this['getDataValue'](_0x64b8('0x10'));var _0x52df08=this[_0x64b8('0xf')]('strategy');if(_0x329018===_0x64b8('0x4')){return _0x52df08;}if(_0x2027d0===_0x64b8('0x11')&&_0x52df08==='rrmemory'||_0x2027d0===_0x64b8('0x11')&&_0x52df08===_0x64b8('0x12')){return _0x52df08;}if(_0x2027d0==='progressive'||_0x2027d0===_0x64b8('0x13')||_0x2027d0===_0x64b8('0x14')){return _0x52df08;}return null;}},'servicelevel':{'type':Sequelize[_0x64b8('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x64b8('0x15')](0xb)},'timeout':{'type':Sequelize[_0x64b8('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x64b8('0x2')]},'weight':{'type':Sequelize[_0x64b8('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x64b8('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x64b8('0x16')](_0x64b8('0x17'),'no'),'defaultValue':_0x64b8('0x17')},'autopause':{'type':Sequelize[_0x64b8('0x16')](_0x64b8('0x17'),'no',_0x64b8('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x64b8('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x64b8('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x64b8('0x16')](_0x64b8('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x64b8('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x64b8('0x16')](_0x64b8('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x64b8('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x64b8('0x16')](_0x64b8('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x64b8('0x16')](_0x64b8('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x64b8('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x64b8('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x64b8('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x64b8('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x64b8('0x16')]('yes','no'),'defaultValue':_0x64b8('0x17')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x64b8('0x17'),'no',_0x64b8('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x64b8('0x16')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x64b8('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x64b8('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x64b8('0x2')]},'queue_quantity1':{'type':Sequelize[_0x64b8('0x2')]},'queue_quantity2':{'type':Sequelize[_0x64b8('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x64b8('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x2ddcb8){this['setDataValue'](_0x64b8('0x1a'),_0x2ddcb8?_0x2ddcb8[_0x64b8('0x1b')](','):[]);},'get':function(){return this[_0x64b8('0xf')]('periodic_announce')?this['getDataValue'](_0x64b8('0x1a'))[_0x64b8('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':_0x64b8('0x17'),'set':function(_0x5514fa){this['setDataValue'](_0x64b8('0x1d'),_0x5514fa?_0x5514fa[_0x64b8('0x1b')](','):[]);},'get':function(){return this[_0x64b8('0xf')](_0x64b8('0x1d'))?this[_0x64b8('0xf')](_0x64b8('0x1d'))[_0x64b8('0x1c')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':'no','set':function(_0x5d049a){this[_0x64b8('0xd')]('leavewhenempty',_0x5d049a?_0x5d049a[_0x64b8('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0x64b8('0x1e'))?this[_0x64b8('0xf')]('leavewhenempty')[_0x64b8('0x1c')](','):[];}},'reportholdtime':{'type':Sequelize[_0x64b8('0x16')](_0x64b8('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x64b8('0x16')](_0x64b8('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x64b8('0x16')](_0x64b8('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x64b8('0x2')]},'description':{'type':Sequelize[_0x64b8('0x2')]},'acw':{'type':Sequelize[_0x64b8('0x1f')],'defaultValue':0x0,'set':function(_0x3a5aa7){this[_0x64b8('0xd')](_0x64b8('0x20'),_0x3a5aa7);if(_0x3a5aa7){if(this['getDataValue']('wrapuptime')<0x2){this[_0x64b8('0xd')](_0x64b8('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x64b8('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x64b8('0x1f')],'defaultValue':0x0,'comment':_0x64b8('0x22')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x64b8('0x23'),_0x64b8('0x14'),_0x64b8('0x13'),_0x64b8('0x11')),'defaultValue':'progressive','comment':_0x64b8('0x24')},'dialLimitChannel':{'type':Sequelize[_0x64b8('0x15')](0x4)[_0x64b8('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x64b8('0x26')},'dialLimitQueue':{'type':Sequelize[_0x64b8('0x15')](0x4)[_0x64b8('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x64b8('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x64b8('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x64b8('0x16')]('agentBusyFactor',_0x64b8('0x29')),'defaultValue':_0x64b8('0x29'),'comment':_0x64b8('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x64b8('0x2b')](0x2)[_0x64b8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x64b8('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x64b8('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x64b8('0x15')](0x3)[_0x64b8('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64b8('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':_0x64b8('0x2e'),'comment':_0x64b8('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x64b8('0x15')](0x3)[_0x64b8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64b8('0x30')},'dialQueueProject':{'type':Sequelize[_0x64b8('0x2')],'comment':_0x64b8('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x64b8('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64b8('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x64b8('0x15')](0x5)[_0x64b8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64b8('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x64b8('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64b8('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x64b8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64b8('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x64b8('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x64b8('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x64b8('0x15')](0x5)[_0x64b8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64b8('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x64b8('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x64b8('0x38')},'dialTimezone':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x64b8('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x64b8('0x16')](_0x64b8('0x39'),_0x64b8('0x3a'),_0x64b8('0x3b')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x64b8('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x64b8('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x64b8('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x64b8('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x64b8('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x64b8('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x64b8('0x15')](0x9)[_0x64b8('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x64b8('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x64b8('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x64b8('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x64b8('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x64b8('0x15')](0x9)[_0x64b8('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x64b8('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x64b8('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x64b8('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x64b8('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x64b8('0x42')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x64b8('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x64b8('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x64b8('0x1f')],'defaultValue':0x0,'comment':_0x64b8('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x64b8('0x16')](_0x64b8('0x45'),_0x64b8('0x46')),'defaultValue':_0x64b8('0x45')},'dialQueueProject2':{'type':Sequelize[_0x64b8('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x64b8('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x64b8('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x64b8('0x15')](0x3)[_0x64b8('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x64b8('0x47')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x64b8('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x64b8('0x48'),'set':function(_0x3c6dd7){if(!_0x3c6dd7)this['setDataValue'](_0x64b8('0x49'),null);this[_0x64b8('0xd')](_0x64b8('0x4a'),_0x3c6dd7);}}}; \ No newline at end of file +var _0x0fd4=['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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','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\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','strategy','getDataValue','type','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','Dial\x20Method.','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x4be9fe,_0x244d8a){var _0x43a255=function(_0x2409f8){while(--_0x2409f8){_0x4be9fe['push'](_0x4be9fe['shift']());}};_0x43a255(++_0x244d8a);}(_0x0fd4,0xb0));var _0x40fd=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x0fd4[_0x58db4e];return _0x40139a;};'use strict';var Sequelize=require(_0x40fd('0x0'));module[_0x40fd('0x1')]={'name':{'type':Sequelize[_0x40fd('0x2')],'allowNull':![],'unique':_0x40fd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x40fd('0x4')](_0x40fd('0x5'),_0x40fd('0x6')),'allowNull':![],'defaultValue':_0x40fd('0x5')},'musiconhold':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':_0x40fd('0x7')},'announce':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x40fd('0x4')]('rr',_0x40fd('0x8'),'leastrecent',_0x40fd('0x9'),_0x40fd('0xa'),_0x40fd('0xb'),_0x40fd('0xc'),_0x40fd('0xd'),'rrordered'),'allowNull':![],'defaultValue':_0x40fd('0x8'),'set':function(_0x2733a8){this[_0x40fd('0xe')](_0x40fd('0xf'),_0x2733a8?_0x2733a8:'rrmemory');},'get':function(){var _0xb01272=this[_0x40fd('0x10')](_0x40fd('0x11'));var _0x1a23ca=this['getDataValue']('dialMethod');var _0x22a305=this[_0x40fd('0x10')](_0x40fd('0xf'));if(_0xb01272==='inbound'){return _0x22a305;}if(_0x1a23ca===_0x40fd('0x12')&&_0x22a305===_0x40fd('0xb')||_0x1a23ca===_0x40fd('0x12')&&_0x22a305===_0x40fd('0x13')){return _0x22a305;}if(_0x1a23ca===_0x40fd('0x14')||_0x1a23ca===_0x40fd('0x15')||_0x1a23ca===_0x40fd('0x16')){return _0x22a305;}return null;}},'servicelevel':{'type':Sequelize[_0x40fd('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x40fd('0x17')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x40fd('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x40fd('0x2')]},'weight':{'type':Sequelize[_0x40fd('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x40fd('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x40fd('0x18'),'no'),'defaultValue':_0x40fd('0x18')},'autopause':{'type':Sequelize[_0x40fd('0x4')](_0x40fd('0x18'),'no',_0x40fd('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x40fd('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x40fd('0x4')](_0x40fd('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x40fd('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x40fd('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x40fd('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x40fd('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x40fd('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x40fd('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x40fd('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x40fd('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x40fd('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x40fd('0x4')](_0x40fd('0x18'),'no'),'defaultValue':_0x40fd('0x18')},'announce_holdtime':{'type':Sequelize[_0x40fd('0x4')](_0x40fd('0x18'),'no',_0x40fd('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x40fd('0x4')](_0x40fd('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x40fd('0x2')]},'queue_youarenext':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x40fd('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x40fd('0x2')]},'queue_quantity1':{'type':Sequelize[_0x40fd('0x2')]},'queue_quantity2':{'type':Sequelize[_0x40fd('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x40fd('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x40fd('0x1b')],'set':function(_0x3c8d06){this[_0x40fd('0xe')](_0x40fd('0x1c'),_0x3c8d06?_0x3c8d06['join'](','):[]);},'get':function(){return this[_0x40fd('0x10')]('periodic_announce')?this['getDataValue']('periodic_announce')[_0x40fd('0x1d')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x40fd('0x18'),'set':function(_0x883e29){this[_0x40fd('0xe')](_0x40fd('0x1e'),_0x883e29?_0x883e29[_0x40fd('0x1f')](','):[]);},'get':function(){return this[_0x40fd('0x10')](_0x40fd('0x1e'))?this[_0x40fd('0x10')](_0x40fd('0x1e'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':'no','set':function(_0x41b4c1){this['setDataValue'](_0x40fd('0x20'),_0x41b4c1?_0x41b4c1[_0x40fd('0x1f')](','):[]);},'get':function(){return this[_0x40fd('0x10')](_0x40fd('0x20'))?this[_0x40fd('0x10')](_0x40fd('0x20'))['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0x40fd('0x4')](_0x40fd('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x40fd('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x40fd('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x40fd('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x40fd('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x40fd('0x21')],'defaultValue':0x0,'set':function(_0x590989){this['setDataValue'](_0x40fd('0x22'),_0x590989);if(_0x590989){if(this[_0x40fd('0x10')](_0x40fd('0x23'))<0x2){this['setDataValue'](_0x40fd('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x40fd('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x40fd('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0x40fd('0x24'),_0x40fd('0x14'),_0x40fd('0x16'),'predictive','booked'),'defaultValue':_0x40fd('0x14'),'comment':_0x40fd('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x40fd('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x40fd('0x17')](0x4)[_0x40fd('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x40fd('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x40fd('0x4')](_0x40fd('0x28'),_0x40fd('0x29')),'defaultValue':_0x40fd('0x29'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x40fd('0x2a')](0x2)[_0x40fd('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x40fd('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x40fd('0x17')](0x3)[_0x40fd('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x40fd('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x40fd('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x40fd('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x40fd('0x17')](0x3)[_0x40fd('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x40fd('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x40fd('0x17')](0x3)[_0x40fd('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x40fd('0x2e')},'dialQueueProject':{'type':Sequelize[_0x40fd('0x2')],'comment':_0x40fd('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x40fd('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x40fd('0x17')](0x5)[_0x40fd('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x40fd('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x40fd('0x17')](0x3)[_0x40fd('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x40fd('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x40fd('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x40fd('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x40fd('0x17')](0x3)[_0x40fd('0x26')],'defaultValue':0x3,'comment':_0x40fd('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x40fd('0x17')](0x5)[_0x40fd('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x40fd('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x40fd('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x40fd('0x35')},'dialTimezone':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x40fd('0x36')},'dialPrefix':{'type':Sequelize[_0x40fd('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never','onlyIfOpen'),'defaultValue':_0x40fd('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x40fd('0x38')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x40fd('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x40fd('0x17')](0x9)[_0x40fd('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x40fd('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x40fd('0x17')](0x9)[_0x40fd('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x40fd('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x40fd('0x17')](0x9)[_0x40fd('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x40fd('0x3b')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x40fd('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x40fd('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x40fd('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x40fd('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x40fd('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x40fd('0x17')](0x5)[_0x40fd('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x40fd('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x40fd('0x17')](0x9)[_0x40fd('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x40fd('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x40fd('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x40fd('0x21')],'defaultValue':0x0,'comment':_0x40fd('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x40fd('0x4')](_0x40fd('0x42'),_0x40fd('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x40fd('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x40fd('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x40fd('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x40fd('0x44')},'dialCutDigit':{'type':Sequelize[_0x40fd('0x17')](0x3)[_0x40fd('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x40fd('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x40fd('0x17')],'allowNull':!![],'comment':_0x40fd('0x46')},'mandatoryDisposition':{'type':Sequelize[_0x40fd('0x21')],'defaultValue':![],'comment':_0x40fd('0x47'),'set':function(_0x31f26d){if(!_0x31f26d)this[_0x40fd('0xe')](_0x40fd('0x48'),null);this[_0x40fd('0xe')](_0x40fd('0x49'),_0x31f26d);}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 64f481e..a666465 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 _0xdead=['cm_hopper','fromQuery','scheduledAt','ContactId','select','phone','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','calleridnum','phone\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','onlyIfOpen','into','ListId','sequelize','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../config/logger','../../config/utils','../../config/environment','defaults','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','inbound','QueueCampaigns','ignore','map','value','includes','find','type','name','UserProfileResource','VoiceQueue','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','params','getHoppers','findOne','CmHopper','nolimit','order','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','ids','Agents','addAgents','penalty','addTeams','removeTeams','union','removeAgents','emit','userVoiceQueue:save','User','loginInPause','push','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','all','isArray','userVoiceQueue:remove','realtime','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert'];(function(_0x4ba331,_0x29a86d){var _0x9b4d37=function(_0x9a5c56){while(--_0x9a5c56){_0x4ba331['push'](_0x4ba331['shift']());}};_0x9b4d37(++_0x29a86d);}(_0xdead,0x163));var _0xddea=function(_0x346f02,_0xd302cd){_0x346f02=_0x346f02-0x0;var _0x580e7c=_0xdead[_0x346f02];return _0x580e7c;};'use strict';var pdf=require(_0xddea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xddea('0x1'));var zipdir=require(_0xddea('0x2'));var jsonpatch=require(_0xddea('0x3'));var rp=require(_0xddea('0x4'));var moment=require(_0xddea('0x5'));var BPromise=require(_0xddea('0x6'));var Mustache=require(_0xddea('0x7'));var util=require(_0xddea('0x8'));var path=require(_0xddea('0x9'));var sox=require(_0xddea('0xa'));var csv=require(_0xddea('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xddea('0xc'));var squel=require(_0xddea('0xd'));var crypto=require(_0xddea('0xe'));var jsforce=require(_0xddea('0xf'));var deskjs=require(_0xddea('0x10'));var toCsv=require(_0xddea('0xb'));var querystring=require('querystring');var Papa=require(_0xddea('0x11'));var authService=require(_0xddea('0x12'));var hardwareService=require(_0xddea('0x13'));var Redis=require(_0xddea('0x14'));var qs=require('../../components/parsers/qs');var logger=require(_0xddea('0x15'))('api');var utils=require(_0xddea('0x16'));var config=require(_0xddea('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xddea('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xddea('0x19'))(new Redis(config['redis']));require(_0xddea('0x1a'))['register'](socket);function respondWithStatusCode(_0x211586,_0x2756db){_0x2756db=_0x2756db||0xcc;return function(_0x4c0c20){if(_0x4c0c20){return _0x211586[_0xddea('0x1b')](_0x2756db);}return _0x211586[_0xddea('0x1c')](_0x2756db)[_0xddea('0x1d')]();};}function respondWithResult(_0x2bd9c3,_0x547a7b){_0x547a7b=_0x547a7b||0xc8;return function(_0x4644a2){if(_0x4644a2){return _0x2bd9c3['status'](_0x547a7b)[_0xddea('0x1e')](_0x4644a2);}};}function respondWithFilteredResult(_0x8db8d6,_0x2d645e){return function(_0x5a0c0e){if(_0x5a0c0e){var _0xb9addc=_0x5a0c0e[_0xddea('0x1f')],_0xb78e6b=_0x2d645e[_0xddea('0x20')],_0x24a291=_0x2d645e[_0xddea('0x20')]+_0x2d645e[_0xddea('0x21')],_0x1f89f7;if(_0x24a291>=_0xb9addc){_0x24a291=_0xb9addc;_0x1f89f7=0xc8;}else{_0x1f89f7=0xce;}_0x8db8d6[_0xddea('0x1c')](_0x1f89f7);return _0x8db8d6[_0xddea('0x22')](_0xddea('0x23'),_0xb78e6b+'-'+_0x24a291+'/'+_0xb9addc)[_0xddea('0x1e')](_0x5a0c0e);}return null;};}function patchUpdates(_0x41f567){return function(_0x270399){try{jsonpatch[_0xddea('0x24')](_0x270399,_0x41f567,!![]);}catch(_0x3c326b){return BPromise[_0xddea('0x25')](_0x3c326b);}return _0x270399['save']();};}function saveUpdates(_0x3554f8,_0x2fa3c8){return function(_0xcb4969){if(_0xcb4969){return _0xcb4969[_0xddea('0x26')](_0x3554f8)['then'](function(_0x5d27ca){return _0x5d27ca;});}return null;};}function removeEntity(_0x351b66,_0x221e97){return function(_0x4df1ef){if(_0x4df1ef){return _0x4df1ef[_0xddea('0x27')]()[_0xddea('0x28')](function(){var _0x19e7fb=_0x4df1ef[_0xddea('0x29')]({'plain':!![]});var _0x3ff62f=[{'name':'VoiceQueues','value':_0xddea('0x2a'),'ignore':![]},{'name':_0xddea('0x2b'),'value':'outbound','ignore':![]}];var _0x18f296=_(_0x3ff62f)['filter'](_0xddea('0x2c'))[_0xddea('0x2d')](_0xddea('0x2e'))[_0xddea('0x2e')]();if(_[_0xddea('0x2f')](_0x18f296,_0x19e7fb['type'])){return;}var _0x54fcfc=_[_0xddea('0x30')](_0x3ff62f,['value',_0x19e7fb[_0xddea('0x31')]])[_0xddea('0x32')];return db[_0xddea('0x33')]['destroy']({'where':{'type':_0x54fcfc,'resourceId':_0x19e7fb['id']}})[_0xddea('0x28')](function(){return _0x4df1ef;});})[_0xddea('0x28')](function(){_0x351b66[_0xddea('0x1c')](0xcc)[_0xddea('0x1d')]();});}};}function handleEntityNotFound(_0x43cdd7,_0x137479){return function(_0x2ba68d){if(!_0x2ba68d){_0x43cdd7[_0xddea('0x1b')](0x194);}return _0x2ba68d;};}function handleError(_0x56423c,_0x59c812){_0x59c812=_0x59c812||0x1f4;return function(_0x23f48d){logger['error'](_0x23f48d['stack']);if(_0x23f48d[_0xddea('0x32')]){delete _0x23f48d[_0xddea('0x32')];}_0x56423c[_0xddea('0x1c')](_0x59c812)['send'](_0x23f48d);};}exports['index']=function(_0x8bb2b0,_0x947560){var _0x2a05c3={},_0x2a87d2={},_0xd5c18e={'count':0x0,'rows':[]};var _0x550cd1=db[_0xddea('0x34')]['rawAttributes'];_0x2a87d2[_0xddea('0x35')]=_[_0xddea('0x36')](_0x550cd1);_0x2a87d2[_0xddea('0x37')]=_[_0xddea('0x36')](_0x8bb2b0[_0xddea('0x37')]);_0x2a87d2[_0xddea('0x38')]=_[_0xddea('0x39')](_0x2a87d2[_0xddea('0x35')],_0x2a87d2['query']);_0x2a05c3[_0xddea('0x3a')]=_[_0xddea('0x39')](_0x2a87d2[_0xddea('0x35')],qs[_0xddea('0x3b')](_0x8bb2b0[_0xddea('0x37')][_0xddea('0x3b')]));_0x2a05c3[_0xddea('0x3a')]=_0x2a05c3[_0xddea('0x3a')][_0xddea('0x3c')]?_0x2a05c3['attributes']:_0x2a87d2[_0xddea('0x35')];if(!_0x8bb2b0[_0xddea('0x37')][_0xddea('0x3d')]('nolimit')){_0x2a05c3[_0xddea('0x21')]=qs[_0xddea('0x21')](_0x8bb2b0[_0xddea('0x37')][_0xddea('0x21')]);_0x2a05c3[_0xddea('0x20')]=qs['offset'](_0x8bb2b0['query'][_0xddea('0x20')]);}_0x2a05c3['order']=qs[_0xddea('0x3e')](_0x8bb2b0['query']['sort']);_0x2a05c3[_0xddea('0x3f')]=qs[_0xddea('0x38')](_[_0xddea('0x40')](_0x8bb2b0[_0xddea('0x37')],_0x2a87d2[_0xddea('0x38')]));if(_0x8bb2b0[_0xddea('0x37')][_0xddea('0x41')]){_0x2a05c3['where']=_[_0xddea('0x42')](_0x2a05c3[_0xddea('0x3f')],{'$or':_[_0xddea('0x2d')](_0x550cd1,function(_0x46132c){if(_0x46132c[_0xddea('0x31')][_0xddea('0x43')]!==_0xddea('0x44')){var _0x3fa48e={};_0x3fa48e[_0x46132c[_0xddea('0x45')]]={'$like':'%'+_0x8bb2b0[_0xddea('0x37')][_0xddea('0x41')]+'%'};return _0x3fa48e;}})});}_0x2a05c3=_[_0xddea('0x42')]({},_0x2a05c3,_0x8bb2b0[_0xddea('0x46')]);var _0x9b90dc={'where':_0x2a05c3['where']};return db[_0xddea('0x34')][_0xddea('0x1f')](_0x9b90dc)['then'](function(_0x3f95c7){_0xd5c18e[_0xddea('0x1f')]=_0x3f95c7;if(_0x8bb2b0[_0xddea('0x37')][_0xddea('0x47')]){_0x2a05c3[_0xddea('0x48')]=[{'all':!![]}];}return db[_0xddea('0x34')][_0xddea('0x49')](_0x2a05c3);})[_0xddea('0x28')](function(_0x11db3f){_0xd5c18e[_0xddea('0x4a')]=_0x11db3f;return _0xd5c18e;})[_0xddea('0x28')](respondWithFilteredResult(_0x947560,_0x2a05c3))[_0xddea('0x4b')](handleError(_0x947560,null));};exports['show']=function(_0x47e613,_0x8928a7){var _0x377423={'raw':![],'where':{'id':_0x47e613['params']['id']}},_0x289f83={};_0x289f83['model']=_[_0xddea('0x36')](db[_0xddea('0x34')][_0xddea('0x4c')]);_0x289f83[_0xddea('0x37')]=_[_0xddea('0x36')](_0x47e613[_0xddea('0x37')]);_0x289f83[_0xddea('0x38')]=_[_0xddea('0x39')](_0x289f83[_0xddea('0x35')],_0x289f83[_0xddea('0x37')]);_0x377423[_0xddea('0x3a')]=_[_0xddea('0x39')](_0x289f83[_0xddea('0x35')],qs['fields'](_0x47e613[_0xddea('0x37')]['fields']));_0x377423[_0xddea('0x3a')]=_0x377423[_0xddea('0x3a')]['length']?_0x377423[_0xddea('0x3a')]:_0x289f83[_0xddea('0x35')];if(_0x47e613[_0xddea('0x37')][_0xddea('0x47')]){_0x377423[_0xddea('0x48')]=[{'all':!![]}];}_0x377423=_[_0xddea('0x42')]({},_0x377423,_0x47e613[_0xddea('0x46')]);return db[_0xddea('0x34')][_0xddea('0x30')](_0x377423)[_0xddea('0x28')](handleEntityNotFound(_0x8928a7,null))[_0xddea('0x28')](respondWithResult(_0x8928a7,null))[_0xddea('0x4b')](handleError(_0x8928a7,null));};exports[_0xddea('0x4d')]=function(_0x43f58c,_0x36a690){return db['VoiceQueue'][_0xddea('0x4d')](_0x43f58c[_0xddea('0x4e')],{})['then'](function(_0x1bd16f){var _0x28e77d=_0x43f58c[_0xddea('0x4f')][_0xddea('0x29')]({'plain':!![]});if(!_0x28e77d)throw new Error(_0xddea('0x50'));if(_0x28e77d['role']===_0xddea('0x4f')){var _0x8f02a5=_0x1bd16f[_0xddea('0x29')]({'plain':!![]});var _0x37286c=[{'name':_0xddea('0x51'),'value':_0xddea('0x2a')},{'name':_0xddea('0x2b'),'value':_0xddea('0x52')}];var _0x5ad6f3=_[_0xddea('0x30')](_0x37286c,[_0xddea('0x2e'),_0x8f02a5[_0xddea('0x31')]])[_0xddea('0x32')];return db[_0xddea('0x53')][_0xddea('0x30')]({'where':{'name':_0x5ad6f3,'userProfileId':_0x28e77d[_0xddea('0x54')]},'raw':!![]})[_0xddea('0x28')](function(_0x2fd5bd){if(_0x2fd5bd&&_0x2fd5bd[_0xddea('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x8f02a5[_0xddea('0x32')],'resourceId':_0x8f02a5['id'],'type':_0x2fd5bd['name'],'sectionId':_0x2fd5bd['id']},{})['then'](function(){return _0x1bd16f;});}else{return _0x1bd16f;}})[_0xddea('0x4b')](function(_0x82976c){logger['error'](_0xddea('0x56'),_0x82976c);throw _0x82976c;});}return _0x1bd16f;})['then'](respondWithResult(_0x36a690,0xc9))[_0xddea('0x4b')](handleError(_0x36a690,null));};exports[_0xddea('0x57')]=function(_0x554330,_0x15105c){var _0x5391f3={'raw':![],'where':{'id':_0x554330['params']['id']}},_0x5c202f={};_0x5c202f[_0xddea('0x35')]=_[_0xddea('0x36')](db[_0xddea('0x34')][_0xddea('0x4c')]);_0x5391f3[_0xddea('0x3a')]=_['intersection'](_0x5c202f[_0xddea('0x35')],qs[_0xddea('0x3b')](_0x554330[_0xddea('0x37')]['fields']));_0x5391f3[_0xddea('0x3a')]=_0x5391f3[_0xddea('0x3a')]['length']?_0x5391f3[_0xddea('0x3a')]:_0x5c202f[_0xddea('0x35')];if(_0x554330['query'][_0xddea('0x47')]){_0x5391f3[_0xddea('0x48')]=[{'all':!![]}];}_0x5391f3=_['merge']({},_0x5391f3,_0x554330[_0xddea('0x46')]);return db['VoiceQueue'][_0xddea('0x30')](_0x5391f3)[_0xddea('0x28')](handleEntityNotFound(_0x15105c,null))[_0xddea('0x28')](function(_0x401a11){if(_0x401a11){var _0x48413c=_0x401a11[_0xddea('0x29')]({'plain':!![]});_0x48413c=qs[_0xddea('0x58')](_0x48413c,['id',_0xddea('0x59'),_0xddea('0x5a')]);_0x554330[_0xddea('0x4e')]=_[_0xddea('0x58')](_0x554330[_0xddea('0x4e')],['id','createdAt',_0xddea('0x5a')]);return db[_0xddea('0x34')][_0xddea('0x4d')](_[_0xddea('0x42')](_0x48413c,_0x554330['body']),{'include':_0x554330[_0xddea('0x37')][_0xddea('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x3d7524){var _0x383870=_0x554330[_0xddea('0x4f')][_0xddea('0x29')]({'plain':!![]});if(!_0x383870)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x383870[_0xddea('0x5b')]===_0xddea('0x4f')){var _0x8a4e61=_0x3d7524[_0xddea('0x29')]({'plain':!![]});var _0x58655b=[{'name':'VoiceQueues','value':_0xddea('0x2a')},{'name':_0xddea('0x2b'),'value':_0xddea('0x52')}];var _0x56c60c=_[_0xddea('0x30')](_0x58655b,['value',_0x8a4e61[_0xddea('0x31')]])[_0xddea('0x32')];return db[_0xddea('0x53')][_0xddea('0x30')]({'where':{'name':_0x56c60c,'userProfileId':_0x383870[_0xddea('0x54')]},'raw':!![]})[_0xddea('0x28')](function(_0x236753){if(_0x236753&&_0x236753[_0xddea('0x55')]===0x0){return db['UserProfileResource'][_0xddea('0x4d')]({'name':_0x8a4e61[_0xddea('0x32')],'resourceId':_0x8a4e61['id'],'type':_0x236753[_0xddea('0x32')],'sectionId':_0x236753['id']},{})[_0xddea('0x28')](function(){return _0x3d7524;});}else{return _0x3d7524;}})[_0xddea('0x4b')](function(_0x2bbd49){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bbd49);throw _0x2bbd49;});}return _0x3d7524;});}})[_0xddea('0x28')](respondWithResult(_0x15105c,0xc9))['catch'](handleError(_0x15105c,null));};exports[_0xddea('0x26')]=function(_0x4dd594,_0x3094e2){if(_0x4dd594[_0xddea('0x4e')]['id']){delete _0x4dd594['body']['id'];}return db['VoiceQueue'][_0xddea('0x30')]({'where':{'id':_0x4dd594[_0xddea('0x5c')]['id']}})[_0xddea('0x28')](handleEntityNotFound(_0x3094e2,null))['then'](saveUpdates(_0x4dd594[_0xddea('0x4e')],null))['then'](respondWithResult(_0x3094e2,null))[_0xddea('0x4b')](handleError(_0x3094e2,null));};exports['destroy']=function(_0x156be5,_0x284dbb){return db[_0xddea('0x34')]['find']({'where':{'id':_0x156be5['params']['id']}})['then'](handleEntityNotFound(_0x284dbb,null))[_0xddea('0x28')](removeEntity(_0x284dbb,null))[_0xddea('0x4b')](handleError(_0x284dbb,null));};exports[_0xddea('0x5d')]=function(_0x161719,_0x25302e,_0x3eb735){var _0x228def={'raw':![],'where':{}};var _0x2a5ae9={};var _0x5da19c={'count':0x0,'rows':[]};return db[_0xddea('0x34')][_0xddea('0x5e')]({'where':{'id':_0x161719[_0xddea('0x5c')]['id']}})[_0xddea('0x28')](handleEntityNotFound(_0x25302e,null))[_0xddea('0x28')](function(_0x59965e){if(_0x59965e){_0x2a5ae9[_0xddea('0x35')]=_[_0xddea('0x36')](db[_0xddea('0x5f')][_0xddea('0x4c')]);_0x2a5ae9[_0xddea('0x37')]=_[_0xddea('0x36')](_0x161719[_0xddea('0x37')]);_0x2a5ae9['filters']=_[_0xddea('0x39')](_0x2a5ae9[_0xddea('0x35')],_0x2a5ae9[_0xddea('0x37')]);_0x228def[_0xddea('0x3a')]=_[_0xddea('0x39')](_0x2a5ae9['model'],qs[_0xddea('0x3b')](_0x161719[_0xddea('0x37')][_0xddea('0x3b')]));_0x228def['attributes']=_0x228def[_0xddea('0x3a')]['length']?_0x228def[_0xddea('0x3a')]:_0x2a5ae9['model'];if(!_0x161719[_0xddea('0x37')][_0xddea('0x3d')](_0xddea('0x60'))){_0x228def[_0xddea('0x21')]=qs[_0xddea('0x21')](_0x161719[_0xddea('0x37')][_0xddea('0x21')]);_0x228def[_0xddea('0x20')]=qs[_0xddea('0x20')](_0x161719[_0xddea('0x37')][_0xddea('0x20')]);}_0x228def[_0xddea('0x61')]=qs[_0xddea('0x3e')](_0x161719[_0xddea('0x37')][_0xddea('0x3e')]);_0x228def[_0xddea('0x3f')]=qs[_0xddea('0x38')](_[_0xddea('0x40')](_0x161719[_0xddea('0x37')],_0x2a5ae9['filters']));_0x228def[_0xddea('0x3f')]['VoiceQueueId']=_0x59965e['id'];if(_0x161719[_0xddea('0x37')][_0xddea('0x41')]){_0x228def['where']=_[_0xddea('0x42')](_0x228def[_0xddea('0x3f')],{'$or':_[_0xddea('0x2d')](_0x228def[_0xddea('0x3a')],function(_0x42a088){var _0x1c2822={};_0x1c2822[_0x42a088]={'$like':'%'+_0x161719[_0xddea('0x37')]['filter']+'%'};return _0x1c2822;})});}_0x228def=_[_0xddea('0x42')]({},_0x228def,_0x161719[_0xddea('0x46')]);return db[_0xddea('0x5f')][_0xddea('0x1f')]({'where':_0x228def[_0xddea('0x3f')]})[_0xddea('0x28')](function(_0x15f387){_0x5da19c['count']=_0x15f387;if(_0x161719[_0xddea('0x37')][_0xddea('0x47')]){_0x228def[_0xddea('0x48')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x228def);})['then'](function(_0x3882e5){_0x5da19c['rows']=_0x3882e5;return _0x5da19c;});}})[_0xddea('0x28')](respondWithFilteredResult(_0x25302e,_0x228def))['catch'](handleError(_0x25302e,null));};exports[_0xddea('0x62')]=function(_0x304f54,_0x28bb38,_0xd2fd15){var _0x1dfd34={'raw':!![],'where':{}};var _0x4c3488={};var _0xe59fd3={'count':0x0,'rows':[]};return db[_0xddea('0x34')][_0xddea('0x5e')]({'where':{'id':_0x304f54['params']['id']}})[_0xddea('0x28')](handleEntityNotFound(_0x28bb38,null))[_0xddea('0x28')](function(_0x1df65b){if(_0x1df65b){_0x4c3488[_0xddea('0x35')]=_['keys'](db[_0xddea('0x63')][_0xddea('0x4c')]);_0x4c3488[_0xddea('0x37')]=_['keys'](_0x304f54[_0xddea('0x37')]);_0x4c3488[_0xddea('0x38')]=_[_0xddea('0x39')](_0x4c3488[_0xddea('0x35')],_0x4c3488['query']);_0x1dfd34[_0xddea('0x3a')]=_[_0xddea('0x39')](_0x4c3488[_0xddea('0x35')],qs['fields'](_0x304f54[_0xddea('0x37')][_0xddea('0x3b')]));_0x1dfd34[_0xddea('0x3a')]=_0x1dfd34[_0xddea('0x3a')][_0xddea('0x3c')]?_0x1dfd34[_0xddea('0x3a')]:_0x4c3488[_0xddea('0x35')];if(!_0x304f54[_0xddea('0x37')][_0xddea('0x3d')]('nolimit')){_0x1dfd34['limit']=qs['limit'](_0x304f54[_0xddea('0x37')][_0xddea('0x21')]);_0x1dfd34[_0xddea('0x20')]=qs[_0xddea('0x20')](_0x304f54['query'][_0xddea('0x20')]);}_0x1dfd34['order']=qs['sort'](_0x304f54[_0xddea('0x37')][_0xddea('0x3e')]);_0x1dfd34[_0xddea('0x3f')]=qs[_0xddea('0x38')](_[_0xddea('0x40')](_0x304f54[_0xddea('0x37')],_0x4c3488['filters']));_0x1dfd34[_0xddea('0x3f')][_0xddea('0x64')]=_0x1df65b['id'];if(_0x304f54[_0xddea('0x37')][_0xddea('0x41')]){_0x1dfd34[_0xddea('0x3f')]=_[_0xddea('0x42')](_0x1dfd34[_0xddea('0x3f')],{'$or':_['map'](_0x1dfd34['attributes'],function(_0x22a2cf){var _0x2d1d87={};_0x2d1d87[_0x22a2cf]={'$like':'%'+_0x304f54[_0xddea('0x37')][_0xddea('0x41')]+'%'};return _0x2d1d87;})});}_0x1dfd34=_[_0xddea('0x42')]({},_0x1dfd34,_0x304f54['options']);return db[_0xddea('0x63')][_0xddea('0x1f')]({'where':_0x1dfd34[_0xddea('0x3f')]})[_0xddea('0x28')](function(_0x1ad129){_0xe59fd3['count']=_0x1ad129;if(_0x304f54['query'][_0xddea('0x47')]){_0x1dfd34[_0xddea('0x48')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1dfd34);})[_0xddea('0x28')](function(_0x49c337){_0xe59fd3[_0xddea('0x4a')]=_0x49c337;return _0xe59fd3;});}})[_0xddea('0x28')](respondWithFilteredResult(_0x28bb38,_0x1dfd34))[_0xddea('0x4b')](handleError(_0x28bb38,null));};exports[_0xddea('0x65')]=function(_0x298aac,_0x2b70b1,_0x29a54a){var _0x23b3aa={'raw':!![],'where':{}};var _0x241019={};var _0x4df041={'count':0x0,'rows':[]};return db[_0xddea('0x34')][_0xddea('0x5e')]({'where':{'id':_0x298aac[_0xddea('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2b70b1,null))[_0xddea('0x28')](function(_0x183ce3){if(_0x183ce3){_0x241019[_0xddea('0x35')]=_[_0xddea('0x36')](db['CmHopperFinal']['rawAttributes']);_0x241019[_0xddea('0x37')]=_[_0xddea('0x36')](_0x298aac[_0xddea('0x37')]);_0x241019[_0xddea('0x38')]=_[_0xddea('0x39')](_0x241019[_0xddea('0x35')],_0x241019['query']);_0x23b3aa[_0xddea('0x3a')]=_[_0xddea('0x39')](_0x241019[_0xddea('0x35')],qs[_0xddea('0x3b')](_0x298aac[_0xddea('0x37')]['fields']));_0x23b3aa[_0xddea('0x3a')]=_0x23b3aa['attributes']['length']?_0x23b3aa[_0xddea('0x3a')]:_0x241019[_0xddea('0x35')];if(!_0x298aac[_0xddea('0x37')][_0xddea('0x3d')](_0xddea('0x60'))){_0x23b3aa[_0xddea('0x21')]=qs[_0xddea('0x21')](_0x298aac[_0xddea('0x37')][_0xddea('0x21')]);_0x23b3aa['offset']=qs[_0xddea('0x20')](_0x298aac[_0xddea('0x37')][_0xddea('0x20')]);}_0x23b3aa['order']=qs[_0xddea('0x3e')](_0x298aac[_0xddea('0x37')]['sort']);_0x23b3aa[_0xddea('0x3f')]=qs[_0xddea('0x38')](_[_0xddea('0x40')](_0x298aac[_0xddea('0x37')],_0x241019[_0xddea('0x38')]));_0x23b3aa[_0xddea('0x3f')][_0xddea('0x64')]=_0x183ce3['id'];if(_0x298aac[_0xddea('0x37')]['filter']){_0x23b3aa[_0xddea('0x3f')]=_[_0xddea('0x42')](_0x23b3aa[_0xddea('0x3f')],{'$or':_[_0xddea('0x2d')](_0x23b3aa['attributes'],function(_0x2e6f5c){var _0x145b0c={};_0x145b0c[_0x2e6f5c]={'$like':'%'+_0x298aac['query']['filter']+'%'};return _0x145b0c;})});}_0x23b3aa=_[_0xddea('0x42')]({},_0x23b3aa,_0x298aac[_0xddea('0x46')]);return db['CmHopperFinal'][_0xddea('0x1f')]({'where':_0x23b3aa['where']})[_0xddea('0x28')](function(_0x3b9540){_0x4df041[_0xddea('0x1f')]=_0x3b9540;if(_0x298aac[_0xddea('0x37')]['includeAll']){_0x23b3aa[_0xddea('0x48')]=[{'all':!![]}];}return db[_0xddea('0x66')][_0xddea('0x49')](_0x23b3aa);})[_0xddea('0x28')](function(_0x4c23cf){_0x4df041[_0xddea('0x4a')]=_0x4c23cf;return _0x4df041;});}})[_0xddea('0x28')](respondWithFilteredResult(_0x2b70b1,_0x23b3aa))[_0xddea('0x4b')](handleError(_0x2b70b1,null));};exports[_0xddea('0x67')]=function(_0x8c492,_0x57ce24,_0x820450){var _0x26a332={'raw':!![],'where':{}};var _0x65560a={};var _0x1a546d={'count':0x0,'rows':[]};return db[_0xddea('0x34')]['findOne']({'where':{'id':_0x8c492[_0xddea('0x5c')]['id']}})['then'](handleEntityNotFound(_0x57ce24,null))['then'](function(_0x466dbf){if(_0x466dbf){_0x65560a[_0xddea('0x35')]=_[_0xddea('0x36')](db[_0xddea('0x68')][_0xddea('0x4c')]);_0x65560a[_0xddea('0x37')]=_[_0xddea('0x36')](_0x8c492[_0xddea('0x37')]);_0x65560a['filters']=_[_0xddea('0x39')](_0x65560a[_0xddea('0x35')],_0x65560a[_0xddea('0x37')]);_0x26a332['attributes']=_['intersection'](_0x65560a['model'],qs[_0xddea('0x3b')](_0x8c492[_0xddea('0x37')][_0xddea('0x3b')]));_0x26a332[_0xddea('0x3a')]=_0x26a332[_0xddea('0x3a')][_0xddea('0x3c')]?_0x26a332[_0xddea('0x3a')]:_0x65560a['model'];if(!_0x8c492[_0xddea('0x37')]['hasOwnProperty'](_0xddea('0x60'))){_0x26a332[_0xddea('0x21')]=qs[_0xddea('0x21')](_0x8c492[_0xddea('0x37')][_0xddea('0x21')]);_0x26a332[_0xddea('0x20')]=qs[_0xddea('0x20')](_0x8c492['query'][_0xddea('0x20')]);}_0x26a332[_0xddea('0x61')]=qs['sort'](_0x8c492['query'][_0xddea('0x3e')]);_0x26a332[_0xddea('0x3f')]=qs[_0xddea('0x38')](_[_0xddea('0x40')](_0x8c492[_0xddea('0x37')],_0x65560a[_0xddea('0x38')]));_0x26a332[_0xddea('0x3f')][_0xddea('0x64')]=_0x466dbf['id'];if(_0x8c492[_0xddea('0x37')]['filter']){_0x26a332[_0xddea('0x3f')]=_[_0xddea('0x42')](_0x26a332['where'],{'$or':_['map'](_0x26a332['attributes'],function(_0x396c67){var _0x245845={};_0x245845[_0x396c67]={'$like':'%'+_0x8c492[_0xddea('0x37')][_0xddea('0x41')]+'%'};return _0x245845;})});}_0x26a332=_[_0xddea('0x42')]({},_0x26a332,_0x8c492[_0xddea('0x46')]);return db['CmHopperBlack'][_0xddea('0x1f')]({'where':_0x26a332['where']})[_0xddea('0x28')](function(_0x22885b){_0x1a546d[_0xddea('0x1f')]=_0x22885b;if(_0x8c492[_0xddea('0x37')][_0xddea('0x47')]){_0x26a332[_0xddea('0x48')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x26a332);})[_0xddea('0x28')](function(_0x53f0b1){_0x1a546d[_0xddea('0x4a')]=_0x53f0b1;return _0x1a546d;});}})[_0xddea('0x28')](respondWithFilteredResult(_0x57ce24,_0x26a332))['catch'](handleError(_0x57ce24,null));};exports[_0xddea('0x69')]=function(_0x51e8dc,_0x5410e3,_0x3950e7){var _0x244f91={};var _0x3498c4={};var _0x112073;var _0x55c485;return db['VoiceQueue'][_0xddea('0x5e')]({'where':{'id':_0x51e8dc['params']['id']}})[_0xddea('0x28')](handleEntityNotFound(_0x5410e3,null))[_0xddea('0x28')](function(_0x32f840){if(_0x32f840){_0x112073=_0x32f840;_0x3498c4[_0xddea('0x35')]=_[_0xddea('0x36')](db[_0xddea('0x6a')][_0xddea('0x4c')]);_0x3498c4[_0xddea('0x37')]=_[_0xddea('0x36')](_0x51e8dc[_0xddea('0x37')]);_0x3498c4[_0xddea('0x38')]=_[_0xddea('0x39')](_0x3498c4['model'],_0x3498c4[_0xddea('0x37')]);_0x244f91['attributes']=_['intersection'](_0x3498c4['model'],qs[_0xddea('0x3b')](_0x51e8dc[_0xddea('0x37')][_0xddea('0x3b')]));_0x244f91[_0xddea('0x3a')]=_0x244f91[_0xddea('0x3a')][_0xddea('0x3c')]?_0x244f91[_0xddea('0x3a')]:_0x3498c4[_0xddea('0x35')];_0x244f91[_0xddea('0x61')]=qs['sort'](_0x51e8dc[_0xddea('0x37')][_0xddea('0x3e')]);_0x244f91[_0xddea('0x3f')]=qs[_0xddea('0x38')](_[_0xddea('0x40')](_0x51e8dc[_0xddea('0x37')],_0x3498c4[_0xddea('0x38')]));if(_0x51e8dc[_0xddea('0x37')][_0xddea('0x41')]){_0x244f91[_0xddea('0x3f')]=_[_0xddea('0x42')](_0x244f91[_0xddea('0x3f')],{'$or':_[_0xddea('0x2d')](_0x244f91['attributes'],function(_0x1b9d13){var _0xcce20e={};_0xcce20e[_0x1b9d13]={'$like':'%'+_0x51e8dc['query'][_0xddea('0x41')]+'%'};return _0xcce20e;})});}_0x244f91=_[_0xddea('0x42')]({},_0x244f91,_0x51e8dc[_0xddea('0x46')]);return _0x112073['getTeams'](_0x244f91);}})[_0xddea('0x28')](function(_0x37b79){if(_0x37b79){_0x55c485=_0x37b79[_0xddea('0x3c')];if(!_0x51e8dc[_0xddea('0x37')][_0xddea('0x3d')](_0xddea('0x60'))){_0x244f91[_0xddea('0x21')]=qs['limit'](_0x51e8dc[_0xddea('0x37')]['limit']);_0x244f91[_0xddea('0x20')]=qs[_0xddea('0x20')](_0x51e8dc[_0xddea('0x37')][_0xddea('0x20')]);}return _0x112073['getTeams'](_0x244f91);}})['then'](function(_0x21e820){if(_0x21e820){return _0x21e820?{'count':_0x55c485,'rows':_0x21e820}:null;}})['then'](respondWithResult(_0x5410e3,null))[_0xddea('0x4b')](handleError(_0x5410e3,null));};exports['addTeams']=function(_0x67155b,_0x26a28a,_0x40834f){var _0x99a26=[];var _0x3bf1e1;return db[_0xddea('0x6a')][_0xddea('0x49')]({'where':{'id':_0x67155b[_0xddea('0x4e')][_0xddea('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xddea('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xddea('0x28')](function(_0x661d60){if(_0x661d60){for(var _0x46e9fd=0x0;_0x46e9fd<_0x661d60['length'];_0x46e9fd+=0x1){for(var _0x3bf356=0x0;_0x3bf356<_0x661d60[_0x46e9fd][_0xddea('0x6c')]['length'];_0x3bf356+=0x1){_0x99a26=_['union'](_0x99a26,[_0x661d60[_0x46e9fd]['Agents'][_0x3bf356]['id']]);}}return _0x99a26;}})[_0xddea('0x28')](function(_0x2733b1){if(_0x2733b1){return db['VoiceQueue'][_0xddea('0x30')]({'where':{'id':_0x67155b[_0xddea('0x5c')]['id']}});}})[_0xddea('0x28')](function(_0x569dd3){if(_0x569dd3){_0x3bf1e1=_0x569dd3;return _0x3bf1e1[_0xddea('0x6d')](_0x99a26,{'penalty':_0x67155b['body'][_0xddea('0x6e')]});}})[_0xddea('0x28')](function(_0x2963e8){if(_0x2963e8){return _0x3bf1e1[_0xddea('0x6f')](_0x67155b['body']['ids']);}})['then'](handleEntityNotFound(_0x26a28a,null))[_0xddea('0x28')](respondWithStatusCode(_0x26a28a,null))['catch'](handleError(_0x26a28a,null));};exports[_0xddea('0x70')]=function(_0x1101b7,_0x17549e,_0x1ef02){var _0xceea98=[];var _0x4f465a;return db[_0xddea('0x6a')][_0xddea('0x49')]({'where':{'id':_0x1101b7[_0xddea('0x37')][_0xddea('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xddea('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x53b108){if(_0x53b108){for(var _0x45b1f4=0x0;_0x45b1f4<_0x53b108['length'];_0x45b1f4+=0x1){for(var _0x584de3=0x0;_0x584de3<_0x53b108[_0x45b1f4][_0xddea('0x6c')][_0xddea('0x3c')];_0x584de3+=0x1){_0xceea98=_[_0xddea('0x71')](_0xceea98,[_0x53b108[_0x45b1f4][_0xddea('0x6c')][_0x584de3]['id']]);}}return _0xceea98;}})[_0xddea('0x28')](function(_0x9a0935){if(_0x9a0935){return db['VoiceQueue'][_0xddea('0x30')]({'where':{'id':_0x1101b7[_0xddea('0x5c')]['id']}});}})['then'](function(_0x1328ee){if(_0x1328ee){_0x4f465a=_0x1328ee;return _0x4f465a[_0xddea('0x72')](_0xceea98);}})['then'](function(_0xe6250c){if(_0x4f465a){return _0x4f465a[_0xddea('0x70')](_0x1101b7['query'][_0xddea('0x6b')]);}})[_0xddea('0x28')](handleEntityNotFound(_0x17549e,null))[_0xddea('0x28')](respondWithStatusCode(_0x17549e,null))[_0xddea('0x4b')](handleError(_0x17549e,null));};exports[_0xddea('0x6d')]=function(_0x49bdbb,_0x5b00c4,_0xf37200){var _0x36e0f6,_0x7f3a89;return db['VoiceQueue']['find']({'where':{'id':_0x49bdbb[_0xddea('0x5c')]['id']}})[_0xddea('0x28')](handleEntityNotFound(_0x5b00c4,null))[_0xddea('0x28')](function(_0xe8aec){if(_0xe8aec){_0x7f3a89=_0xe8aec;return _0xe8aec[_0xddea('0x6d')](_0x49bdbb[_0xddea('0x4e')]['ids'],_[_0xddea('0x58')](_0x49bdbb[_0xddea('0x4e')],[_0xddea('0x6b'),'id'])||{})['spread'](function(_0x308a94){for(var _0x414db7=0x0;_0x414db7<_0x49bdbb[_0xddea('0x4e')]['ids'][_0xddea('0x3c')];_0x414db7+=0x1){socket[_0xddea('0x73')](_0xddea('0x74'),{'UserId':_0x49bdbb[_0xddea('0x4e')]['ids'][_0x414db7],'VoiceQueueId':_0x49bdbb[_0xddea('0x5c')]['id']});}return _0x308a94;});}})[_0xddea('0x28')](function(_0x4fa276){_0x36e0f6=_0x4fa276||[];if(_0x7f3a89){return db[_0xddea('0x75')][_0xddea('0x49')]({'where':{'id':_0x49bdbb[_0xddea('0x4e')][_0xddea('0x6b')]},'attributes':['id',_0xddea('0x32'),_0xddea('0x76'),'voicePause','interface'],'raw':!![]});}})[_0xddea('0x28')](function(_0x39a320){if(_0x39a320&&_0x39a320[_0xddea('0x3c')]){var _0x577fe4=[];for(var _0x31833e=0x0;_0x31833e<_0x39a320[_0xddea('0x3c')];_0x31833e++){_0x577fe4[_0xddea('0x77')](db[_0xddea('0x78')][_0xddea('0x79')]({'membername':_0x39a320[_0x31833e][_0xddea('0x32')],'UserId':_0x39a320[_0x31833e]['id'],'queue_name':_0x7f3a89[_0xddea('0x32')],'VoiceQueueId':_0x7f3a89['id'],'interface':_[_0xddea('0x7a')](_0x39a320[_0x31833e]['interface'])?util[_0xddea('0x7b')](_0xddea('0x7c'),_0x39a320[_0x31833e][_0xddea('0x32')]):_0x39a320[_0x31833e]['interface'],'paused':_0x39a320[_0x31833e][_0xddea('0x7d')]||![],'penalty':_0x49bdbb[_0xddea('0x4e')][_0xddea('0x6e')]||0x0}));}return BPromise[_0xddea('0x7e')](_0x577fe4);}})['then'](function(_0x28deb0){return _0x36e0f6;})[_0xddea('0x28')](respondWithResult(_0x5b00c4,null))['catch'](handleError(_0x5b00c4,null));};exports[_0xddea('0x72')]=function(_0xdc89fb,_0x1a7fe2,_0x2ee050){var _0xb7397a;return db['VoiceQueue'][_0xddea('0x30')]({'where':{'id':_0xdc89fb['params']['id']}})[_0xddea('0x28')](handleEntityNotFound(_0x1a7fe2,null))[_0xddea('0x28')](function(_0x4d26fa){if(_0x4d26fa){return _0x4d26fa[_0xddea('0x72')](_0xdc89fb[_0xddea('0x37')][_0xddea('0x6b')])['then'](function(_0x4bd438){if(_[_0xddea('0x7f')](_0xdc89fb[_0xddea('0x37')][_0xddea('0x6b')])){for(var _0xa080e0=0x0;_0xa080e0<_0xdc89fb[_0xddea('0x37')][_0xddea('0x6b')][_0xddea('0x3c')];_0xa080e0+=0x1){socket['emit'](_0xddea('0x80'),{'UserId':_0xdc89fb['query']['ids'][_0xa080e0],'VoiceQueueId':_0xdc89fb[_0xddea('0x5c')]['id']});}}else{socket[_0xddea('0x73')](_0xddea('0x80'),{'UserId':_0xdc89fb[_0xddea('0x37')]['ids'],'VoiceQueueId':_0xdc89fb[_0xddea('0x5c')]['id']});}});}})[_0xddea('0x28')](function(_0xaae4b){if(_0xdc89fb['query'][_0xddea('0x81')]){_0xb7397a=_0xaae4b;return db['UserVoiceQueueRt'][_0xddea('0x27')]({'where':{'VoiceQueueId':_0xdc89fb[_0xddea('0x5c')]['id'],'UserId':_0xdc89fb['query'][_0xddea('0x6b')]}})[_0xddea('0x28')](function(){return _0xb7397a;});}})[_0xddea('0x28')](respondWithStatusCode(_0x1a7fe2,null))[_0xddea('0x4b')](handleError(_0x1a7fe2,null));};exports[_0xddea('0x82')]=function(_0x231ac9,_0x4a3f3d,_0x306fdb){var _0x4d966b={};var _0x3e8a96={};var _0x5ba554;var _0x157692;return db[_0xddea('0x34')][_0xddea('0x5e')]({'where':{'id':_0x231ac9[_0xddea('0x5c')]['id']}})[_0xddea('0x28')](handleEntityNotFound(_0x4a3f3d,null))[_0xddea('0x28')](function(_0x305594){if(_0x305594){_0x5ba554=_0x305594;_0x3e8a96[_0xddea('0x35')]=_[_0xddea('0x36')](db[_0xddea('0x75')][_0xddea('0x4c')]);_0x3e8a96[_0xddea('0x37')]=_[_0xddea('0x36')](_0x231ac9[_0xddea('0x37')]);_0x3e8a96[_0xddea('0x38')]=_['intersection'](_0x3e8a96['model'],_0x3e8a96['query']);_0x4d966b[_0xddea('0x3a')]=_[_0xddea('0x39')](_0x3e8a96['model'],qs[_0xddea('0x3b')](_0x231ac9[_0xddea('0x37')][_0xddea('0x3b')]));_0x4d966b[_0xddea('0x3a')]=_0x4d966b[_0xddea('0x3a')][_0xddea('0x3c')]?_0x4d966b[_0xddea('0x3a')]:_0x3e8a96[_0xddea('0x35')];_0x4d966b['order']=qs[_0xddea('0x3e')](_0x231ac9['query'][_0xddea('0x3e')]);_0x4d966b[_0xddea('0x3f')]=qs['filters'](_['pick'](_0x231ac9[_0xddea('0x37')],_0x3e8a96[_0xddea('0x38')]));if(_0x231ac9[_0xddea('0x37')][_0xddea('0x41')]){_0x4d966b[_0xddea('0x3f')]=_['merge'](_0x4d966b[_0xddea('0x3f')],{'$or':_[_0xddea('0x2d')](_0x4d966b[_0xddea('0x3a')],function(_0x3298da){var _0x209d9d={};_0x209d9d[_0x3298da]={'$like':'%'+_0x231ac9[_0xddea('0x37')]['filter']+'%'};return _0x209d9d;})});}_0x4d966b=_['merge']({},_0x4d966b,_0x231ac9[_0xddea('0x46')]);return _0x5ba554[_0xddea('0x82')](_0x4d966b);}})[_0xddea('0x28')](function(_0x1e8a2b){if(_0x1e8a2b){_0x157692=_0x1e8a2b[_0xddea('0x3c')];if(!_0x231ac9[_0xddea('0x37')][_0xddea('0x3d')]('nolimit')){_0x4d966b[_0xddea('0x21')]=qs[_0xddea('0x21')](_0x231ac9[_0xddea('0x37')][_0xddea('0x21')]);_0x4d966b[_0xddea('0x20')]=qs['offset'](_0x231ac9['query'][_0xddea('0x20')]);}return _0x5ba554[_0xddea('0x82')](_0x4d966b);}})['then'](function(_0x270adb){if(_0x270adb){return _0x270adb?{'count':_0x157692,'rows':_0x270adb}:null;}})[_0xddea('0x28')](respondWithResult(_0x4a3f3d,null))['catch'](handleError(_0x4a3f3d,null));};exports['getMembers']=function(_0x11f883,_0x4b5630,_0x58cb81){var _0xb2e29f={};var _0x5749c1={};var _0x9154cf;var _0x47196c;return db['VoiceQueue'][_0xddea('0x5e')]({'where':{'id':_0x11f883['params']['id']}})['then'](handleEntityNotFound(_0x4b5630,null))['then'](function(_0x5d7f33){if(_0x5d7f33){_0x9154cf=_0x5d7f33;_0x5749c1[_0xddea('0x35')]=_[_0xddea('0x36')](db[_0xddea('0x78')][_0xddea('0x4c')]);_0x5749c1[_0xddea('0x37')]=_[_0xddea('0x36')](_0x11f883['query']);_0x5749c1[_0xddea('0x38')]=_['intersection'](_0x5749c1['model'],_0x5749c1[_0xddea('0x37')]);_0xb2e29f['attributes']=_[_0xddea('0x39')](_0x5749c1[_0xddea('0x35')],qs[_0xddea('0x3b')](_0x11f883['query'][_0xddea('0x3b')]));_0xb2e29f[_0xddea('0x3a')]=_0xb2e29f[_0xddea('0x3a')][_0xddea('0x3c')]?_0xb2e29f[_0xddea('0x3a')]:_0x5749c1[_0xddea('0x35')];_0xb2e29f['order']=qs['sort'](_0x11f883[_0xddea('0x37')]['sort']);_0xb2e29f['where']=qs[_0xddea('0x38')](_[_0xddea('0x40')](_0x11f883[_0xddea('0x37')],_0x5749c1[_0xddea('0x38')]));if(_0x11f883[_0xddea('0x37')][_0xddea('0x41')]){_0xb2e29f['where']=_[_0xddea('0x42')](_0xb2e29f[_0xddea('0x3f')],{'$or':_[_0xddea('0x2d')](_0xb2e29f[_0xddea('0x3a')],function(_0x3af28b){var _0xec5c99={};_0xec5c99[_0x3af28b]={'$like':'%'+_0x11f883[_0xddea('0x37')][_0xddea('0x41')]+'%'};return _0xec5c99;})});}_0xb2e29f=_[_0xddea('0x42')]({},_0xb2e29f,_0x11f883[_0xddea('0x46')]);return _0x9154cf[_0xddea('0x83')](_0xb2e29f);}})[_0xddea('0x28')](function(_0x3079d2){if(_0x3079d2){_0x47196c=_0x3079d2[_0xddea('0x3c')];if(!_0x11f883[_0xddea('0x37')][_0xddea('0x3d')](_0xddea('0x60'))){_0xb2e29f['limit']=qs[_0xddea('0x21')](_0x11f883[_0xddea('0x37')][_0xddea('0x21')]);_0xb2e29f[_0xddea('0x20')]=qs['offset'](_0x11f883[_0xddea('0x37')][_0xddea('0x20')]);}return _0x9154cf['getMembers'](_0xb2e29f);}})[_0xddea('0x28')](function(_0x126ddf){return _0x126ddf?{'count':_0x47196c,'rows':_0x126ddf}:null;})[_0xddea('0x28')](respondWithResult(_0x4b5630,null))['catch'](handleError(_0x4b5630,null));};exports[_0xddea('0x84')]=function(_0x3c4b1b,_0x4dc3b7,_0x129c9b){var _0x511721={};var _0x27fa00={};var _0x36f8ab;var _0x2b2ff1;return db[_0xddea('0x34')][_0xddea('0x5e')]({'where':{'id':_0x3c4b1b[_0xddea('0x5c')]['id']}})[_0xddea('0x28')](handleEntityNotFound(_0x4dc3b7,null))[_0xddea('0x28')](function(_0x2e91dd){if(_0x2e91dd){_0x36f8ab=_0x2e91dd;_0x27fa00['model']=_[_0xddea('0x36')](db['CmList'][_0xddea('0x4c')]);_0x27fa00[_0xddea('0x37')]=_[_0xddea('0x36')](_0x3c4b1b['query']);_0x27fa00[_0xddea('0x38')]=_['intersection'](_0x27fa00[_0xddea('0x35')],_0x27fa00[_0xddea('0x37')]);_0x511721[_0xddea('0x3a')]=_[_0xddea('0x39')](_0x27fa00[_0xddea('0x35')],qs[_0xddea('0x3b')](_0x3c4b1b[_0xddea('0x37')]['fields']));_0x511721[_0xddea('0x3a')]=_0x511721[_0xddea('0x3a')][_0xddea('0x3c')]?_0x511721[_0xddea('0x3a')]:_0x27fa00[_0xddea('0x35')];_0x511721[_0xddea('0x61')]=qs[_0xddea('0x3e')](_0x3c4b1b[_0xddea('0x37')][_0xddea('0x3e')]);_0x511721[_0xddea('0x3f')]=qs[_0xddea('0x38')](_[_0xddea('0x40')](_0x3c4b1b[_0xddea('0x37')],_0x27fa00[_0xddea('0x38')]));if(_0x3c4b1b[_0xddea('0x37')][_0xddea('0x41')]){_0x511721[_0xddea('0x3f')]=_['merge'](_0x511721[_0xddea('0x3f')],{'$or':_[_0xddea('0x2d')](_0x511721['attributes'],function(_0x563ef8){var _0x72e295={};_0x72e295[_0x563ef8]={'$like':'%'+_0x3c4b1b[_0xddea('0x37')][_0xddea('0x41')]+'%'};return _0x72e295;})});}_0x511721=_[_0xddea('0x42')]({},_0x511721,_0x3c4b1b[_0xddea('0x46')]);return _0x36f8ab[_0xddea('0x84')](_0x511721);}})[_0xddea('0x28')](function(_0x3f953d){if(_0x3f953d){_0x2b2ff1=_0x3f953d['length'];if(!_0x3c4b1b[_0xddea('0x37')][_0xddea('0x3d')](_0xddea('0x60'))){_0x511721['limit']=qs['limit'](_0x3c4b1b['query'][_0xddea('0x21')]);_0x511721['offset']=qs['offset'](_0x3c4b1b['query'][_0xddea('0x20')]);}return _0x36f8ab[_0xddea('0x84')](_0x511721);}})[_0xddea('0x28')](function(_0x33704c){if(_0x33704c){return _0x33704c?{'count':_0x2b2ff1,'rows':_0x33704c}:null;}})[_0xddea('0x28')](respondWithResult(_0x4dc3b7,null))['catch'](handleError(_0x4dc3b7,null));};exports[_0xddea('0x85')]=function(_0x17507c,_0x4707bf,_0x131098){var _0x4adfcc,_0x703ac0;return db['VoiceQueue'][_0xddea('0x30')]({'where':{'id':_0x17507c[_0xddea('0x5c')]['id']}})[_0xddea('0x28')](handleEntityNotFound(_0x4707bf,null))[_0xddea('0x28')](function(_0x21abda){if(_0x21abda){_0x703ac0=_0x21abda;return _0x21abda[_0xddea('0x85')](_0x17507c['body'][_0xddea('0x6b')],_[_0xddea('0x58')](_0x17507c['body'],['ids','id'])||{});}return null;})['spread'](function(_0x3a456f){var _0x3d21a6;_0x4adfcc=_0x3a456f||[];var _0x115e58=[];if(_0x3a456f){for(var _0x4a2669=0x0;_0x4a2669<_0x3a456f[_0xddea('0x3c')];_0x4a2669+=0x1){var _0x5ae742=_0x3a456f[_0x4a2669]['get']({'plain':!![]});_0x703ac0[_0xddea('0x86')]=_0x17507c['body'][_0xddea('0x86')]?_0x17507c[_0xddea('0x4e')][_0xddea('0x86')]:_0x703ac0[_0xddea('0x86')];switch(_0x703ac0[_0xddea('0x86')]){case _0xddea('0x87'):_0x3d21a6=squel[_0xddea('0x88')]()['into'](_0xddea('0x89'))[_0xddea('0x8a')](['phone',_0xddea('0x8b'),_0xddea('0x8c'),'ListId','VoiceQueueId',_0xddea('0x59'),_0xddea('0x5a')],squel[_0xddea('0x8d')]()[_0xddea('0x45')]('phone',_0xddea('0x8e'))['field'](_0xddea('0x8f'),'scheduledAt')[_0xddea('0x45')]('id',_0xddea('0x8c'))[_0xddea('0x45')](_0x5ae742['CmListId'][_0xddea('0x90')](),'ListId')[_0xddea('0x45')](_0x17507c[_0xddea('0x5c')]['id'][_0xddea('0x90')](),_0xddea('0x64'))['field'](_0xddea('0x8f'),'createdAt')['field'](_0xddea('0x8f'),'updatedAt')[_0xddea('0x91')](_0xddea('0x92'))[_0xddea('0x3f')](_0xddea('0x93'))[_0xddea('0x3f')](_0xddea('0x94'),_0x5ae742[_0xddea('0x95')][_0xddea('0x90')]())[_0xddea('0x3f')](_0xddea('0x96'))[_0xddea('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xddea('0x8d')]()['field'](_0xddea('0x97'))['from']('cm_hopper_final')[_0xddea('0x3f')]('VoiceQueueId\x20=\x20?',_0x17507c[_0xddea('0x5c')]['id'][_0xddea('0x90')]()))['where'](_0xddea('0x98'),squel[_0xddea('0x8d')]()['field']('phone')[_0xddea('0x91')]('cm_hopper')['where'](_0xddea('0x99'),_0x17507c['params']['id'][_0xddea('0x90')]())))[_0xddea('0x90')]();break;case _0xddea('0x9a'):_0x3d21a6=squel[_0xddea('0x88')]()[_0xddea('0x9b')](_0xddea('0x89'))[_0xddea('0x8a')]([_0xddea('0x8e'),_0xddea('0x8b'),'ContactId',_0xddea('0x9c'),'VoiceQueueId',_0xddea('0x59'),_0xddea('0x5a')],squel[_0xddea('0x8d')]()['field'](_0xddea('0x8e'),'phone')[_0xddea('0x45')](_0xddea('0x8f'),_0xddea('0x8b'))[_0xddea('0x45')]('id','ContactId')[_0xddea('0x45')](_0x5ae742[_0xddea('0x95')][_0xddea('0x90')](),'ListId')[_0xddea('0x45')](_0x17507c['params']['id'][_0xddea('0x90')](),_0xddea('0x64'))[_0xddea('0x45')]('NOW()',_0xddea('0x59'))[_0xddea('0x45')](_0xddea('0x8f'),_0xddea('0x5a'))[_0xddea('0x91')](_0xddea('0x92'))[_0xddea('0x3f')](_0xddea('0x93'))['where'](_0xddea('0x94'),_0x5ae742['CmListId'][_0xddea('0x90')]())[_0xddea('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xddea('0x3f')](_0xddea('0x98'),squel[_0xddea('0x8d')]()[_0xddea('0x45')](_0xddea('0x8e'))['from'](_0xddea('0x89'))[_0xddea('0x3f')](_0xddea('0x99'),_0x17507c[_0xddea('0x5c')]['id'][_0xddea('0x90')]())))[_0xddea('0x90')]();break;default:_0x3d21a6=squel[_0xddea('0x88')]()[_0xddea('0x9b')]('cm_hopper')[_0xddea('0x8a')]([_0xddea('0x8e'),'scheduledAt',_0xddea('0x8c'),_0xddea('0x9c'),'VoiceQueueId',_0xddea('0x59'),_0xddea('0x5a')],squel[_0xddea('0x8d')]()[_0xddea('0x45')]('phone',_0xddea('0x8e'))[_0xddea('0x45')](_0xddea('0x8f'),_0xddea('0x8b'))[_0xddea('0x45')]('id',_0xddea('0x8c'))[_0xddea('0x45')](_0x5ae742[_0xddea('0x95')]['toString'](),'ListId')[_0xddea('0x45')](_0x17507c[_0xddea('0x5c')]['id'][_0xddea('0x90')](),'VoiceQueueId')[_0xddea('0x45')]('NOW()',_0xddea('0x59'))[_0xddea('0x45')](_0xddea('0x8f'),'updatedAt')[_0xddea('0x91')](_0xddea('0x92'))[_0xddea('0x3f')]('deletedAt\x20IS\x20NULL')[_0xddea('0x3f')](_0xddea('0x94'),_0x5ae742[_0xddea('0x95')][_0xddea('0x90')]())[_0xddea('0x3f')](_0xddea('0x96')))[_0xddea('0x90')]();}_0x115e58[_0xddea('0x77')](db[_0xddea('0x9d')][_0xddea('0x37')](_0x3d21a6));}return BPromise[_0xddea('0x7e')](_0x115e58);}})[_0xddea('0x28')](function(){return _0x4adfcc;})[_0xddea('0x28')](respondWithResult(_0x4707bf,null))['catch'](handleError(_0x4707bf,null));};exports[_0xddea('0x9e')]=function(_0x29cefa,_0x592f21,_0x59d8ff){var _0xa73453;return db[_0xddea('0x34')]['find']({'where':{'id':_0x29cefa[_0xddea('0x5c')]['id']}})[_0xddea('0x28')](handleEntityNotFound(_0x592f21,null))[_0xddea('0x28')](function(_0xdb25e4){if(_0xdb25e4){return _0xdb25e4[_0xddea('0x9e')](_0x29cefa[_0xddea('0x37')][_0xddea('0x6b')]);}})[_0xddea('0x28')](function(_0x50cd19){if(_0x50cd19){_0xa73453=_0x50cd19;return db[_0xddea('0x5f')]['destroy']({'where':{'ListId':_0x29cefa[_0xddea('0x37')][_0xddea('0x6b')],'VoiceQueueId':_0x29cefa[_0xddea('0x5c')]['id']}})[_0xddea('0x28')](function(){return _0xa73453;});}})[_0xddea('0x28')](respondWithStatusCode(_0x592f21,null))[_0xddea('0x4b')](handleError(_0x592f21,null));};exports['getBlackLists']=function(_0x565512,_0x352717,_0x3e2c46){var _0x5ce438={};var _0xe09604={};var _0x4a3a85;var _0x5bba21;return db[_0xddea('0x34')]['findOne']({'where':{'id':_0x565512[_0xddea('0x5c')]['id']}})['then'](handleEntityNotFound(_0x352717,null))[_0xddea('0x28')](function(_0x3bf397){if(_0x3bf397){_0x4a3a85=_0x3bf397;_0xe09604[_0xddea('0x35')]=_[_0xddea('0x36')](db[_0xddea('0x9f')][_0xddea('0x4c')]);_0xe09604[_0xddea('0x37')]=_[_0xddea('0x36')](_0x565512[_0xddea('0x37')]);_0xe09604[_0xddea('0x38')]=_[_0xddea('0x39')](_0xe09604[_0xddea('0x35')],_0xe09604[_0xddea('0x37')]);_0x5ce438[_0xddea('0x3a')]=_[_0xddea('0x39')](_0xe09604[_0xddea('0x35')],qs[_0xddea('0x3b')](_0x565512[_0xddea('0x37')][_0xddea('0x3b')]));_0x5ce438[_0xddea('0x3a')]=_0x5ce438[_0xddea('0x3a')][_0xddea('0x3c')]?_0x5ce438[_0xddea('0x3a')]:_0xe09604[_0xddea('0x35')];_0x5ce438[_0xddea('0x61')]=qs[_0xddea('0x3e')](_0x565512[_0xddea('0x37')][_0xddea('0x3e')]);_0x5ce438[_0xddea('0x3f')]=qs['filters'](_[_0xddea('0x40')](_0x565512[_0xddea('0x37')],_0xe09604['filters']));if(_0x565512[_0xddea('0x37')][_0xddea('0x41')]){_0x5ce438['where']=_[_0xddea('0x42')](_0x5ce438['where'],{'$or':_[_0xddea('0x2d')](_0x5ce438['attributes'],function(_0x2f63a2){var _0x4a2bbe={};_0x4a2bbe[_0x2f63a2]={'$like':'%'+_0x565512[_0xddea('0x37')]['filter']+'%'};return _0x4a2bbe;})});}_0x5ce438=_[_0xddea('0x42')]({},_0x5ce438,_0x565512[_0xddea('0x46')]);return _0x4a3a85[_0xddea('0xa0')](_0x5ce438);}})[_0xddea('0x28')](function(_0x41b8b8){if(_0x41b8b8){_0x5bba21=_0x41b8b8[_0xddea('0x3c')];if(!_0x565512[_0xddea('0x37')][_0xddea('0x3d')](_0xddea('0x60'))){_0x5ce438[_0xddea('0x21')]=qs['limit'](_0x565512['query'][_0xddea('0x21')]);_0x5ce438['offset']=qs['offset'](_0x565512[_0xddea('0x37')][_0xddea('0x20')]);}return _0x4a3a85['getBlackLists'](_0x5ce438);}})[_0xddea('0x28')](function(_0xe689f8){if(_0xe689f8){return _0xe689f8?{'count':_0x5bba21,'rows':_0xe689f8}:null;}})[_0xddea('0x28')](respondWithResult(_0x352717,null))[_0xddea('0x4b')](handleError(_0x352717,null));};exports[_0xddea('0xa1')]=function(_0x738698,_0x2cbc94,_0x27e093){var _0x1eac39,_0x14dbc1;return db[_0xddea('0x34')][_0xddea('0x30')]({'where':{'id':_0x738698[_0xddea('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2cbc94,null))[_0xddea('0x28')](function(_0x21ad41){if(_0x21ad41){_0x14dbc1=_0x21ad41;return _0x21ad41[_0xddea('0xa1')](_0x738698[_0xddea('0x4e')][_0xddea('0x6b')],_[_0xddea('0x58')](_0x738698[_0xddea('0x4e')],[_0xddea('0x6b'),'id'])||{});}return null;})['spread'](function(_0x426d13){var _0x9bdfdb;_0x1eac39=_0x426d13||[];var _0xa2e9e3=[];if(_0x426d13){for(var _0x230adc=0x0;_0x230adc<_0x426d13[_0xddea('0x3c')];_0x230adc+=0x1){var _0x537557=_0x426d13[_0x230adc][_0xddea('0x29')]({'plain':!![]});_0x9bdfdb=squel[_0xddea('0x88')]()['into'](_0xddea('0xa2'))[_0xddea('0x8a')]([_0xddea('0x8e'),_0xddea('0x8c'),_0xddea('0x9c'),_0xddea('0x64'),_0xddea('0x59'),_0xddea('0x5a')],squel['select']()['field']('phone',_0xddea('0x8e'))[_0xddea('0x45')]('id','ContactId')[_0xddea('0x45')](_0x537557[_0xddea('0x95')][_0xddea('0x90')](),_0xddea('0x9c'))[_0xddea('0x45')](_0x738698['params']['id'][_0xddea('0x90')](),'VoiceQueueId')[_0xddea('0x45')](_0xddea('0x8f'),_0xddea('0x59'))['field'](_0xddea('0x8f'),_0xddea('0x5a'))['from'](_0xddea('0x92'))[_0xddea('0x3f')](_0xddea('0x93'))[_0xddea('0x3f')](_0xddea('0x94'),_0x537557[_0xddea('0x95')]['toString']())['where'](_0xddea('0x96')))[_0xddea('0x90')]();_0xa2e9e3[_0xddea('0x77')](db[_0xddea('0x9d')]['query'](_0x9bdfdb));}return BPromise[_0xddea('0x7e')](_0xa2e9e3);}})[_0xddea('0x28')](function(){return _0x1eac39;})[_0xddea('0x28')](respondWithResult(_0x2cbc94,null))[_0xddea('0x4b')](handleError(_0x2cbc94,null));};exports['removeBlackLists']=function(_0x2a25d1,_0x535824,_0x14bac8){var _0x36572b;return db[_0xddea('0x34')][_0xddea('0x30')]({'where':{'id':_0x2a25d1[_0xddea('0x5c')]['id']}})[_0xddea('0x28')](handleEntityNotFound(_0x535824,null))['then'](function(_0x444fb1){if(_0x444fb1){return _0x444fb1[_0xddea('0xa3')](_0x2a25d1['query']['ids']);}})['then'](function(_0x4ca9f9){if(_0x4ca9f9){_0x36572b=_0x4ca9f9;return db[_0xddea('0x68')][_0xddea('0x27')]({'where':{'ListId':_0x2a25d1[_0xddea('0x37')][_0xddea('0x6b')],'VoiceQueueId':_0x2a25d1[_0xddea('0x5c')]['id']}})['then'](function(){return _0x36572b;});}})[_0xddea('0x28')](respondWithStatusCode(_0x535824,null))[_0xddea('0x4b')](handleError(_0x535824,null));}; \ No newline at end of file +var _0xa079=['pick','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','order','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','ids','User','Agents','union','addAgents','penalty','removeTeams','removeAgents','spread','userVoiceQueue:save','loginInPause','interface','push','UserVoiceQueueRt','isNil','format','isArray','realtime','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','onlyIfOpen','ListId','deletedAt\x20IS\x20NULL','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','count','limit','apply','reject','save','update','then','get','VoiceQueues','QueueCampaigns','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','send','index','VoiceQueue','rawAttributes','model','keys','filters','attributes','intersection','fields','length','query','hasOwnProperty','nolimit','offset','sort','where','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','create','body','user','inbound','outbound','userProfileId','autoAssociation','params','updatedAt','omit','createdAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne'];(function(_0x45effc,_0x446a75){var _0xf385ef=function(_0x117d44){while(--_0x117d44){_0x45effc['push'](_0x45effc['shift']());}};_0xf385ef(++_0x446a75);}(_0xa079,0xd9));var _0x9a07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa079[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9a07('0x0'));var rimraf=require(_0x9a07('0x1'));var zipdir=require(_0x9a07('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a07('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9a07('0x4'));var util=require('util');var path=require(_0x9a07('0x5'));var sox=require(_0x9a07('0x6'));var csv=require(_0x9a07('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9a07('0x8'));var squel=require('squel');var crypto=require(_0x9a07('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9a07('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9a07('0xb'));var authService=require(_0x9a07('0xc'));var hardwareService=require(_0x9a07('0xd'));var Redis=require(_0x9a07('0xe'));var qs=require(_0x9a07('0xf'));var logger=require(_0x9a07('0x10'))(_0x9a07('0x11'));var utils=require(_0x9a07('0x12'));var config=require(_0x9a07('0x13'));var db=require(_0x9a07('0x14'))['db'];config[_0x9a07('0x15')]=_['defaults'](config[_0x9a07('0x15')],{'host':_0x9a07('0x16'),'port':0x18eb});var socket=require(_0x9a07('0x17'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x2eff52,_0x115ff7){_0x115ff7=_0x115ff7||0xcc;return function(_0x269be6){if(_0x269be6){return _0x2eff52[_0x9a07('0x18')](_0x115ff7);}return _0x2eff52[_0x9a07('0x19')](_0x115ff7)[_0x9a07('0x1a')]();};}function respondWithResult(_0xc24e5,_0x4d1e4c){_0x4d1e4c=_0x4d1e4c||0xc8;return function(_0x524154){if(_0x524154){return _0xc24e5[_0x9a07('0x19')](_0x4d1e4c)[_0x9a07('0x1b')](_0x524154);}};}function respondWithFilteredResult(_0x26a024,_0x4234c6){return function(_0xe7d8bf){if(_0xe7d8bf){var _0x595681=_0xe7d8bf[_0x9a07('0x1c')],_0x2a0ae0=_0x4234c6['offset'],_0x58d2ba=_0x4234c6['offset']+_0x4234c6[_0x9a07('0x1d')],_0x8d3e88;if(_0x58d2ba>=_0x595681){_0x58d2ba=_0x595681;_0x8d3e88=0xc8;}else{_0x8d3e88=0xce;}_0x26a024[_0x9a07('0x19')](_0x8d3e88);return _0x26a024['set']('Content-Range',_0x2a0ae0+'-'+_0x58d2ba+'/'+_0x595681)[_0x9a07('0x1b')](_0xe7d8bf);}return null;};}function patchUpdates(_0x3e54d0){return function(_0x324cbe){try{jsonpatch[_0x9a07('0x1e')](_0x324cbe,_0x3e54d0,!![]);}catch(_0x39a3e6){return BPromise[_0x9a07('0x1f')](_0x39a3e6);}return _0x324cbe[_0x9a07('0x20')]();};}function saveUpdates(_0x4ac9b8,_0x21e8a1){return function(_0x524dc1){if(_0x524dc1){return _0x524dc1[_0x9a07('0x21')](_0x4ac9b8)[_0x9a07('0x22')](function(_0x5624b0){return _0x5624b0;});}return null;};}function removeEntity(_0x2203c9,_0x703a5e){return function(_0x153e45){if(_0x153e45){return _0x153e45['destroy']()[_0x9a07('0x22')](function(){var _0x234183=_0x153e45[_0x9a07('0x23')]({'plain':!![]});var _0x5c46ea=[{'name':_0x9a07('0x24'),'value':'inbound','ignore':![]},{'name':_0x9a07('0x25'),'value':'outbound','ignore':![]}];var _0x371493=_(_0x5c46ea)[_0x9a07('0x26')](_0x9a07('0x27'))[_0x9a07('0x28')](_0x9a07('0x29'))['value']();if(_[_0x9a07('0x2a')](_0x371493,_0x234183[_0x9a07('0x2b')])){return;}var _0x26ce99=_[_0x9a07('0x2c')](_0x5c46ea,['value',_0x234183[_0x9a07('0x2b')]])[_0x9a07('0x2d')];return db[_0x9a07('0x2e')][_0x9a07('0x2f')]({'where':{'type':_0x26ce99,'resourceId':_0x234183['id']}})[_0x9a07('0x22')](function(){return _0x153e45;});})[_0x9a07('0x22')](function(){_0x2203c9['status'](0xcc)[_0x9a07('0x1a')]();});}};}function handleEntityNotFound(_0x518aa8,_0x2f5b9e){return function(_0x2a041d){if(!_0x2a041d){_0x518aa8[_0x9a07('0x18')](0x194);}return _0x2a041d;};}function handleError(_0x4517a7,_0x18f4ab){_0x18f4ab=_0x18f4ab||0x1f4;return function(_0x373573){logger[_0x9a07('0x30')](_0x373573['stack']);if(_0x373573['name']){delete _0x373573[_0x9a07('0x2d')];}_0x4517a7[_0x9a07('0x19')](_0x18f4ab)[_0x9a07('0x31')](_0x373573);};}exports[_0x9a07('0x32')]=function(_0x59cc6b,_0x444465){var _0x4dadeb={},_0x364762={},_0x56d879={'count':0x0,'rows':[]};var _0xe2678d=db[_0x9a07('0x33')][_0x9a07('0x34')];_0x364762[_0x9a07('0x35')]=_[_0x9a07('0x36')](_0xe2678d);_0x364762['query']=_['keys'](_0x59cc6b['query']);_0x364762[_0x9a07('0x37')]=_['intersection'](_0x364762[_0x9a07('0x35')],_0x364762['query']);_0x4dadeb[_0x9a07('0x38')]=_[_0x9a07('0x39')](_0x364762[_0x9a07('0x35')],qs[_0x9a07('0x3a')](_0x59cc6b['query'][_0x9a07('0x3a')]));_0x4dadeb[_0x9a07('0x38')]=_0x4dadeb[_0x9a07('0x38')][_0x9a07('0x3b')]?_0x4dadeb[_0x9a07('0x38')]:_0x364762[_0x9a07('0x35')];if(!_0x59cc6b[_0x9a07('0x3c')][_0x9a07('0x3d')](_0x9a07('0x3e'))){_0x4dadeb[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x59cc6b[_0x9a07('0x3c')][_0x9a07('0x1d')]);_0x4dadeb[_0x9a07('0x3f')]=qs['offset'](_0x59cc6b[_0x9a07('0x3c')]['offset']);}_0x4dadeb['order']=qs['sort'](_0x59cc6b[_0x9a07('0x3c')][_0x9a07('0x40')]);_0x4dadeb[_0x9a07('0x41')]=qs['filters'](_['pick'](_0x59cc6b[_0x9a07('0x3c')],_0x364762[_0x9a07('0x37')]));if(_0x59cc6b[_0x9a07('0x3c')][_0x9a07('0x26')]){_0x4dadeb[_0x9a07('0x41')]=_[_0x9a07('0x42')](_0x4dadeb[_0x9a07('0x41')],{'$or':_[_0x9a07('0x28')](_0xe2678d,function(_0x4d16e6){if(_0x4d16e6['type'][_0x9a07('0x43')]!==_0x9a07('0x44')){var _0x367054={};_0x367054[_0x4d16e6[_0x9a07('0x45')]]={'$like':'%'+_0x59cc6b[_0x9a07('0x3c')][_0x9a07('0x26')]+'%'};return _0x367054;}})});}_0x4dadeb=_['merge']({},_0x4dadeb,_0x59cc6b[_0x9a07('0x46')]);var _0x37f4e1={'where':_0x4dadeb['where']};return db[_0x9a07('0x33')]['count'](_0x37f4e1)['then'](function(_0x5e3dfd){_0x56d879[_0x9a07('0x1c')]=_0x5e3dfd;if(_0x59cc6b[_0x9a07('0x3c')][_0x9a07('0x47')]){_0x4dadeb[_0x9a07('0x48')]=[{'all':!![]}];}return db[_0x9a07('0x33')][_0x9a07('0x49')](_0x4dadeb);})[_0x9a07('0x22')](function(_0x46d5d0){_0x56d879[_0x9a07('0x4a')]=_0x46d5d0;return _0x56d879;})[_0x9a07('0x22')](respondWithFilteredResult(_0x444465,_0x4dadeb))[_0x9a07('0x4b')](handleError(_0x444465,null));};exports['show']=function(_0x3e8b62,_0x3671ba){var _0x4f770d={'raw':![],'where':{'id':_0x3e8b62['params']['id']}},_0x52671c={};_0x52671c[_0x9a07('0x35')]=_['keys'](db['VoiceQueue'][_0x9a07('0x34')]);_0x52671c[_0x9a07('0x3c')]=_['keys'](_0x3e8b62[_0x9a07('0x3c')]);_0x52671c[_0x9a07('0x37')]=_[_0x9a07('0x39')](_0x52671c[_0x9a07('0x35')],_0x52671c['query']);_0x4f770d[_0x9a07('0x38')]=_[_0x9a07('0x39')](_0x52671c[_0x9a07('0x35')],qs[_0x9a07('0x3a')](_0x3e8b62[_0x9a07('0x3c')][_0x9a07('0x3a')]));_0x4f770d['attributes']=_0x4f770d[_0x9a07('0x38')][_0x9a07('0x3b')]?_0x4f770d[_0x9a07('0x38')]:_0x52671c[_0x9a07('0x35')];if(_0x3e8b62[_0x9a07('0x3c')][_0x9a07('0x47')]){_0x4f770d[_0x9a07('0x48')]=[{'all':!![]}];}_0x4f770d=_[_0x9a07('0x42')]({},_0x4f770d,_0x3e8b62[_0x9a07('0x46')]);return db['VoiceQueue'][_0x9a07('0x2c')](_0x4f770d)[_0x9a07('0x22')](handleEntityNotFound(_0x3671ba,null))[_0x9a07('0x22')](respondWithResult(_0x3671ba,null))[_0x9a07('0x4b')](handleError(_0x3671ba,null));};exports[_0x9a07('0x4c')]=function(_0x42932b,_0x2c303c){return db[_0x9a07('0x33')][_0x9a07('0x4c')](_0x42932b[_0x9a07('0x4d')],{})[_0x9a07('0x22')](function(_0x34db77){var _0x31da4f=_0x42932b[_0x9a07('0x4e')][_0x9a07('0x23')]({'plain':!![]});if(!_0x31da4f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31da4f['role']===_0x9a07('0x4e')){var _0x586b63=_0x34db77['get']({'plain':!![]});var _0x4c2920=[{'name':_0x9a07('0x24'),'value':_0x9a07('0x4f')},{'name':_0x9a07('0x25'),'value':_0x9a07('0x50')}];var _0x14949d=_[_0x9a07('0x2c')](_0x4c2920,[_0x9a07('0x29'),_0x586b63[_0x9a07('0x2b')]])[_0x9a07('0x2d')];return db['UserProfileSection'][_0x9a07('0x2c')]({'where':{'name':_0x14949d,'userProfileId':_0x31da4f[_0x9a07('0x51')]},'raw':!![]})[_0x9a07('0x22')](function(_0x642e49){if(_0x642e49&&_0x642e49[_0x9a07('0x52')]===0x0){return db[_0x9a07('0x2e')][_0x9a07('0x4c')]({'name':_0x586b63[_0x9a07('0x2d')],'resourceId':_0x586b63['id'],'type':_0x642e49[_0x9a07('0x2d')],'sectionId':_0x642e49['id']},{})[_0x9a07('0x22')](function(){return _0x34db77;});}else{return _0x34db77;}})[_0x9a07('0x4b')](function(_0x2436c9){logger[_0x9a07('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2436c9);throw _0x2436c9;});}return _0x34db77;})[_0x9a07('0x22')](respondWithResult(_0x2c303c,0xc9))[_0x9a07('0x4b')](handleError(_0x2c303c,null));};exports['clone']=function(_0x3bdf33,_0x4c773e){var _0x28750f={'raw':![],'where':{'id':_0x3bdf33[_0x9a07('0x53')]['id']}},_0x3b427f={};_0x3b427f[_0x9a07('0x35')]=_['keys'](db['VoiceQueue']['rawAttributes']);_0x28750f[_0x9a07('0x38')]=_[_0x9a07('0x39')](_0x3b427f[_0x9a07('0x35')],qs[_0x9a07('0x3a')](_0x3bdf33[_0x9a07('0x3c')]['fields']));_0x28750f['attributes']=_0x28750f['attributes'][_0x9a07('0x3b')]?_0x28750f[_0x9a07('0x38')]:_0x3b427f['model'];if(_0x3bdf33[_0x9a07('0x3c')]['includeAll']){_0x28750f[_0x9a07('0x48')]=[{'all':!![]}];}_0x28750f=_[_0x9a07('0x42')]({},_0x28750f,_0x3bdf33[_0x9a07('0x46')]);return db[_0x9a07('0x33')][_0x9a07('0x2c')](_0x28750f)[_0x9a07('0x22')](handleEntityNotFound(_0x4c773e,null))[_0x9a07('0x22')](function(_0x150175){if(_0x150175){var _0x1cacc8=_0x150175['get']({'plain':!![]});_0x1cacc8=qs['omit'](_0x1cacc8,['id','createdAt',_0x9a07('0x54')]);_0x3bdf33[_0x9a07('0x4d')]=_[_0x9a07('0x55')](_0x3bdf33[_0x9a07('0x4d')],['id',_0x9a07('0x56'),_0x9a07('0x54')]);return db[_0x9a07('0x33')][_0x9a07('0x4c')](_[_0x9a07('0x42')](_0x1cacc8,_0x3bdf33['body']),{'include':_0x3bdf33['query'][_0x9a07('0x47')]?[{'all':!![]}]:undefined})[_0x9a07('0x22')](function(_0x2c05fc){var _0x4665e1=_0x3bdf33['user'][_0x9a07('0x23')]({'plain':!![]});if(!_0x4665e1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4665e1[_0x9a07('0x57')]==='user'){var _0x1a5fdc=_0x2c05fc[_0x9a07('0x23')]({'plain':!![]});var _0xb27ae2=[{'name':_0x9a07('0x24'),'value':'inbound'},{'name':_0x9a07('0x25'),'value':'outbound'}];var _0x335e16=_[_0x9a07('0x2c')](_0xb27ae2,['value',_0x1a5fdc['type']])[_0x9a07('0x2d')];return db['UserProfileSection'][_0x9a07('0x2c')]({'where':{'name':_0x335e16,'userProfileId':_0x4665e1[_0x9a07('0x51')]},'raw':!![]})[_0x9a07('0x22')](function(_0x2e3e01){if(_0x2e3e01&&_0x2e3e01['autoAssociation']===0x0){return db[_0x9a07('0x2e')][_0x9a07('0x4c')]({'name':_0x1a5fdc['name'],'resourceId':_0x1a5fdc['id'],'type':_0x2e3e01[_0x9a07('0x2d')],'sectionId':_0x2e3e01['id']},{})['then'](function(){return _0x2c05fc;});}else{return _0x2c05fc;}})['catch'](function(_0x2d8f32){logger[_0x9a07('0x30')](_0x9a07('0x58'),_0x2d8f32);throw _0x2d8f32;});}return _0x2c05fc;});}})[_0x9a07('0x22')](respondWithResult(_0x4c773e,0xc9))[_0x9a07('0x4b')](handleError(_0x4c773e,null));};exports['update']=function(_0x499d58,_0x51cdb9){if(_0x499d58[_0x9a07('0x4d')]['id']){delete _0x499d58[_0x9a07('0x4d')]['id'];}return db[_0x9a07('0x33')]['find']({'where':{'id':_0x499d58['params']['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x51cdb9,null))[_0x9a07('0x22')](saveUpdates(_0x499d58[_0x9a07('0x4d')],null))[_0x9a07('0x22')](respondWithResult(_0x51cdb9,null))['catch'](handleError(_0x51cdb9,null));};exports[_0x9a07('0x2f')]=function(_0x48327e,_0xf55cd1){return db[_0x9a07('0x33')][_0x9a07('0x2c')]({'where':{'id':_0x48327e[_0x9a07('0x53')]['id']}})['then'](handleEntityNotFound(_0xf55cd1,null))[_0x9a07('0x22')](removeEntity(_0xf55cd1,null))[_0x9a07('0x4b')](handleError(_0xf55cd1,null));};exports[_0x9a07('0x59')]=function(_0xa9eb70,_0x4eb6b4,_0x1f5d38){var _0x52aa7b={'raw':![],'where':{}};var _0xfcb54e={};var _0x262e43={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x9a07('0x5a')]({'where':{'id':_0xa9eb70[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x4eb6b4,null))['then'](function(_0xbefb6e){if(_0xbefb6e){_0xfcb54e[_0x9a07('0x35')]=_[_0x9a07('0x36')](db['CmHopper'][_0x9a07('0x34')]);_0xfcb54e['query']=_['keys'](_0xa9eb70[_0x9a07('0x3c')]);_0xfcb54e[_0x9a07('0x37')]=_['intersection'](_0xfcb54e[_0x9a07('0x35')],_0xfcb54e[_0x9a07('0x3c')]);_0x52aa7b[_0x9a07('0x38')]=_['intersection'](_0xfcb54e[_0x9a07('0x35')],qs['fields'](_0xa9eb70[_0x9a07('0x3c')][_0x9a07('0x3a')]));_0x52aa7b['attributes']=_0x52aa7b[_0x9a07('0x38')][_0x9a07('0x3b')]?_0x52aa7b['attributes']:_0xfcb54e[_0x9a07('0x35')];if(!_0xa9eb70[_0x9a07('0x3c')][_0x9a07('0x3d')]('nolimit')){_0x52aa7b[_0x9a07('0x1d')]=qs['limit'](_0xa9eb70[_0x9a07('0x3c')]['limit']);_0x52aa7b['offset']=qs[_0x9a07('0x3f')](_0xa9eb70[_0x9a07('0x3c')][_0x9a07('0x3f')]);}_0x52aa7b['order']=qs[_0x9a07('0x40')](_0xa9eb70[_0x9a07('0x3c')][_0x9a07('0x40')]);_0x52aa7b[_0x9a07('0x41')]=qs[_0x9a07('0x37')](_[_0x9a07('0x5b')](_0xa9eb70[_0x9a07('0x3c')],_0xfcb54e[_0x9a07('0x37')]));_0x52aa7b[_0x9a07('0x41')][_0x9a07('0x5c')]=_0xbefb6e['id'];if(_0xa9eb70[_0x9a07('0x3c')][_0x9a07('0x26')]){_0x52aa7b[_0x9a07('0x41')]=_['merge'](_0x52aa7b[_0x9a07('0x41')],{'$or':_[_0x9a07('0x28')](_0x52aa7b[_0x9a07('0x38')],function(_0x1c91f3){var _0x23dc7f={};_0x23dc7f[_0x1c91f3]={'$like':'%'+_0xa9eb70[_0x9a07('0x3c')]['filter']+'%'};return _0x23dc7f;})});}_0x52aa7b=_[_0x9a07('0x42')]({},_0x52aa7b,_0xa9eb70[_0x9a07('0x46')]);return db[_0x9a07('0x5d')][_0x9a07('0x1c')]({'where':_0x52aa7b[_0x9a07('0x41')]})[_0x9a07('0x22')](function(_0x427371){_0x262e43[_0x9a07('0x1c')]=_0x427371;if(_0xa9eb70[_0x9a07('0x3c')][_0x9a07('0x47')]){_0x52aa7b[_0x9a07('0x48')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x52aa7b);})['then'](function(_0x2839cd){_0x262e43['rows']=_0x2839cd;return _0x262e43;});}})['then'](respondWithFilteredResult(_0x4eb6b4,_0x52aa7b))['catch'](handleError(_0x4eb6b4,null));};exports[_0x9a07('0x5e')]=function(_0x383fbd,_0x4d2e2c,_0x3ecab9){var _0x2da69d={'raw':!![],'where':{}};var _0x5d2d9c={};var _0x4ec354={'count':0x0,'rows':[]};return db[_0x9a07('0x33')][_0x9a07('0x5a')]({'where':{'id':_0x383fbd[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x4d2e2c,null))[_0x9a07('0x22')](function(_0x24f2d1){if(_0x24f2d1){_0x5d2d9c[_0x9a07('0x35')]=_[_0x9a07('0x36')](db[_0x9a07('0x5f')][_0x9a07('0x34')]);_0x5d2d9c[_0x9a07('0x3c')]=_['keys'](_0x383fbd['query']);_0x5d2d9c['filters']=_[_0x9a07('0x39')](_0x5d2d9c[_0x9a07('0x35')],_0x5d2d9c[_0x9a07('0x3c')]);_0x2da69d[_0x9a07('0x38')]=_[_0x9a07('0x39')](_0x5d2d9c[_0x9a07('0x35')],qs[_0x9a07('0x3a')](_0x383fbd[_0x9a07('0x3c')][_0x9a07('0x3a')]));_0x2da69d[_0x9a07('0x38')]=_0x2da69d[_0x9a07('0x38')][_0x9a07('0x3b')]?_0x2da69d[_0x9a07('0x38')]:_0x5d2d9c[_0x9a07('0x35')];if(!_0x383fbd[_0x9a07('0x3c')][_0x9a07('0x3d')](_0x9a07('0x3e'))){_0x2da69d['limit']=qs[_0x9a07('0x1d')](_0x383fbd[_0x9a07('0x3c')][_0x9a07('0x1d')]);_0x2da69d[_0x9a07('0x3f')]=qs[_0x9a07('0x3f')](_0x383fbd['query']['offset']);}_0x2da69d['order']=qs['sort'](_0x383fbd['query'][_0x9a07('0x40')]);_0x2da69d[_0x9a07('0x41')]=qs['filters'](_[_0x9a07('0x5b')](_0x383fbd['query'],_0x5d2d9c[_0x9a07('0x37')]));_0x2da69d['where'][_0x9a07('0x5c')]=_0x24f2d1['id'];if(_0x383fbd[_0x9a07('0x3c')][_0x9a07('0x26')]){_0x2da69d[_0x9a07('0x41')]=_[_0x9a07('0x42')](_0x2da69d[_0x9a07('0x41')],{'$or':_['map'](_0x2da69d[_0x9a07('0x38')],function(_0x27dd72){var _0x4590bf={};_0x4590bf[_0x27dd72]={'$like':'%'+_0x383fbd['query'][_0x9a07('0x26')]+'%'};return _0x4590bf;})});}_0x2da69d=_[_0x9a07('0x42')]({},_0x2da69d,_0x383fbd[_0x9a07('0x46')]);return db[_0x9a07('0x5f')][_0x9a07('0x1c')]({'where':_0x2da69d[_0x9a07('0x41')]})[_0x9a07('0x22')](function(_0x3d0aa6){_0x4ec354['count']=_0x3d0aa6;if(_0x383fbd['query']['includeAll']){_0x2da69d[_0x9a07('0x48')]=[{'all':!![]}];}return db[_0x9a07('0x5f')][_0x9a07('0x49')](_0x2da69d);})[_0x9a07('0x22')](function(_0x16d7db){_0x4ec354[_0x9a07('0x4a')]=_0x16d7db;return _0x4ec354;});}})[_0x9a07('0x22')](respondWithFilteredResult(_0x4d2e2c,_0x2da69d))['catch'](handleError(_0x4d2e2c,null));};exports[_0x9a07('0x60')]=function(_0x3a9474,_0xed6079,_0x3ca8e2){var _0x5a6146={'raw':!![],'where':{}};var _0x4dac12={};var _0x5b98bd={'count':0x0,'rows':[]};return db[_0x9a07('0x33')][_0x9a07('0x5a')]({'where':{'id':_0x3a9474[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0xed6079,null))[_0x9a07('0x22')](function(_0x282e2f){if(_0x282e2f){_0x4dac12[_0x9a07('0x35')]=_[_0x9a07('0x36')](db['CmHopperFinal']['rawAttributes']);_0x4dac12[_0x9a07('0x3c')]=_['keys'](_0x3a9474[_0x9a07('0x3c')]);_0x4dac12['filters']=_[_0x9a07('0x39')](_0x4dac12['model'],_0x4dac12[_0x9a07('0x3c')]);_0x5a6146[_0x9a07('0x38')]=_[_0x9a07('0x39')](_0x4dac12[_0x9a07('0x35')],qs[_0x9a07('0x3a')](_0x3a9474[_0x9a07('0x3c')]['fields']));_0x5a6146[_0x9a07('0x38')]=_0x5a6146[_0x9a07('0x38')]['length']?_0x5a6146['attributes']:_0x4dac12['model'];if(!_0x3a9474[_0x9a07('0x3c')][_0x9a07('0x3d')](_0x9a07('0x3e'))){_0x5a6146[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x3a9474[_0x9a07('0x3c')][_0x9a07('0x1d')]);_0x5a6146[_0x9a07('0x3f')]=qs[_0x9a07('0x3f')](_0x3a9474[_0x9a07('0x3c')][_0x9a07('0x3f')]);}_0x5a6146[_0x9a07('0x61')]=qs[_0x9a07('0x40')](_0x3a9474[_0x9a07('0x3c')]['sort']);_0x5a6146[_0x9a07('0x41')]=qs[_0x9a07('0x37')](_[_0x9a07('0x5b')](_0x3a9474[_0x9a07('0x3c')],_0x4dac12[_0x9a07('0x37')]));_0x5a6146[_0x9a07('0x41')]['VoiceQueueId']=_0x282e2f['id'];if(_0x3a9474['query'][_0x9a07('0x26')]){_0x5a6146[_0x9a07('0x41')]=_[_0x9a07('0x42')](_0x5a6146[_0x9a07('0x41')],{'$or':_[_0x9a07('0x28')](_0x5a6146[_0x9a07('0x38')],function(_0x3b4fe3){var _0x5c61f6={};_0x5c61f6[_0x3b4fe3]={'$like':'%'+_0x3a9474[_0x9a07('0x3c')][_0x9a07('0x26')]+'%'};return _0x5c61f6;})});}_0x5a6146=_[_0x9a07('0x42')]({},_0x5a6146,_0x3a9474[_0x9a07('0x46')]);return db['CmHopperFinal'][_0x9a07('0x1c')]({'where':_0x5a6146[_0x9a07('0x41')]})['then'](function(_0x37b15c){_0x5b98bd[_0x9a07('0x1c')]=_0x37b15c;if(_0x3a9474[_0x9a07('0x3c')][_0x9a07('0x47')]){_0x5a6146[_0x9a07('0x48')]=[{'all':!![]}];}return db[_0x9a07('0x62')][_0x9a07('0x49')](_0x5a6146);})[_0x9a07('0x22')](function(_0x1fb3be){_0x5b98bd['rows']=_0x1fb3be;return _0x5b98bd;});}})['then'](respondWithFilteredResult(_0xed6079,_0x5a6146))[_0x9a07('0x4b')](handleError(_0xed6079,null));};exports[_0x9a07('0x63')]=function(_0x43ceec,_0x2b842d,_0x33449d){var _0x2414ea={'raw':!![],'where':{}};var _0x470625={};var _0x5488d7={'count':0x0,'rows':[]};return db[_0x9a07('0x33')][_0x9a07('0x5a')]({'where':{'id':_0x43ceec[_0x9a07('0x53')]['id']}})['then'](handleEntityNotFound(_0x2b842d,null))['then'](function(_0x42dca2){if(_0x42dca2){_0x470625[_0x9a07('0x35')]=_[_0x9a07('0x36')](db[_0x9a07('0x64')][_0x9a07('0x34')]);_0x470625['query']=_[_0x9a07('0x36')](_0x43ceec['query']);_0x470625[_0x9a07('0x37')]=_[_0x9a07('0x39')](_0x470625[_0x9a07('0x35')],_0x470625['query']);_0x2414ea[_0x9a07('0x38')]=_[_0x9a07('0x39')](_0x470625[_0x9a07('0x35')],qs[_0x9a07('0x3a')](_0x43ceec[_0x9a07('0x3c')]['fields']));_0x2414ea[_0x9a07('0x38')]=_0x2414ea[_0x9a07('0x38')][_0x9a07('0x3b')]?_0x2414ea[_0x9a07('0x38')]:_0x470625[_0x9a07('0x35')];if(!_0x43ceec[_0x9a07('0x3c')][_0x9a07('0x3d')](_0x9a07('0x3e'))){_0x2414ea[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x43ceec[_0x9a07('0x3c')][_0x9a07('0x1d')]);_0x2414ea[_0x9a07('0x3f')]=qs['offset'](_0x43ceec[_0x9a07('0x3c')]['offset']);}_0x2414ea[_0x9a07('0x61')]=qs[_0x9a07('0x40')](_0x43ceec['query'][_0x9a07('0x40')]);_0x2414ea[_0x9a07('0x41')]=qs[_0x9a07('0x37')](_[_0x9a07('0x5b')](_0x43ceec['query'],_0x470625[_0x9a07('0x37')]));_0x2414ea[_0x9a07('0x41')][_0x9a07('0x5c')]=_0x42dca2['id'];if(_0x43ceec[_0x9a07('0x3c')][_0x9a07('0x26')]){_0x2414ea[_0x9a07('0x41')]=_[_0x9a07('0x42')](_0x2414ea[_0x9a07('0x41')],{'$or':_['map'](_0x2414ea[_0x9a07('0x38')],function(_0x4bfb18){var _0x5bc4b9={};_0x5bc4b9[_0x4bfb18]={'$like':'%'+_0x43ceec[_0x9a07('0x3c')][_0x9a07('0x26')]+'%'};return _0x5bc4b9;})});}_0x2414ea=_[_0x9a07('0x42')]({},_0x2414ea,_0x43ceec[_0x9a07('0x46')]);return db['CmHopperBlack'][_0x9a07('0x1c')]({'where':_0x2414ea[_0x9a07('0x41')]})[_0x9a07('0x22')](function(_0x25c0bd){_0x5488d7['count']=_0x25c0bd;if(_0x43ceec[_0x9a07('0x3c')][_0x9a07('0x47')]){_0x2414ea[_0x9a07('0x48')]=[{'all':!![]}];}return db[_0x9a07('0x64')][_0x9a07('0x49')](_0x2414ea);})[_0x9a07('0x22')](function(_0x2ec3be){_0x5488d7[_0x9a07('0x4a')]=_0x2ec3be;return _0x5488d7;});}})[_0x9a07('0x22')](respondWithFilteredResult(_0x2b842d,_0x2414ea))[_0x9a07('0x4b')](handleError(_0x2b842d,null));};exports[_0x9a07('0x65')]=function(_0x1e9480,_0x35b956,_0x520add){var _0x244384={};var _0x45ac9a={};var _0x114375;var _0xeea07b;return db[_0x9a07('0x33')]['findOne']({'where':{'id':_0x1e9480[_0x9a07('0x53')]['id']}})['then'](handleEntityNotFound(_0x35b956,null))[_0x9a07('0x22')](function(_0x8e966f){if(_0x8e966f){_0x114375=_0x8e966f;_0x45ac9a[_0x9a07('0x35')]=_['keys'](db[_0x9a07('0x66')][_0x9a07('0x34')]);_0x45ac9a[_0x9a07('0x3c')]=_[_0x9a07('0x36')](_0x1e9480[_0x9a07('0x3c')]);_0x45ac9a[_0x9a07('0x37')]=_[_0x9a07('0x39')](_0x45ac9a['model'],_0x45ac9a['query']);_0x244384['attributes']=_[_0x9a07('0x39')](_0x45ac9a['model'],qs[_0x9a07('0x3a')](_0x1e9480[_0x9a07('0x3c')][_0x9a07('0x3a')]));_0x244384[_0x9a07('0x38')]=_0x244384['attributes'][_0x9a07('0x3b')]?_0x244384[_0x9a07('0x38')]:_0x45ac9a[_0x9a07('0x35')];_0x244384[_0x9a07('0x61')]=qs['sort'](_0x1e9480[_0x9a07('0x3c')][_0x9a07('0x40')]);_0x244384['where']=qs[_0x9a07('0x37')](_[_0x9a07('0x5b')](_0x1e9480['query'],_0x45ac9a['filters']));if(_0x1e9480[_0x9a07('0x3c')]['filter']){_0x244384['where']=_[_0x9a07('0x42')](_0x244384['where'],{'$or':_[_0x9a07('0x28')](_0x244384[_0x9a07('0x38')],function(_0xf58583){var _0x4d7edc={};_0x4d7edc[_0xf58583]={'$like':'%'+_0x1e9480[_0x9a07('0x3c')]['filter']+'%'};return _0x4d7edc;})});}_0x244384=_[_0x9a07('0x42')]({},_0x244384,_0x1e9480[_0x9a07('0x46')]);return _0x114375[_0x9a07('0x65')](_0x244384);}})[_0x9a07('0x22')](function(_0x3b5997){if(_0x3b5997){_0xeea07b=_0x3b5997['length'];if(!_0x1e9480[_0x9a07('0x3c')][_0x9a07('0x3d')](_0x9a07('0x3e'))){_0x244384[_0x9a07('0x1d')]=qs['limit'](_0x1e9480[_0x9a07('0x3c')][_0x9a07('0x1d')]);_0x244384[_0x9a07('0x3f')]=qs[_0x9a07('0x3f')](_0x1e9480['query'][_0x9a07('0x3f')]);}return _0x114375[_0x9a07('0x65')](_0x244384);}})[_0x9a07('0x22')](function(_0x3bf8cd){if(_0x3bf8cd){return _0x3bf8cd?{'count':_0xeea07b,'rows':_0x3bf8cd}:null;}})[_0x9a07('0x22')](respondWithResult(_0x35b956,null))[_0x9a07('0x4b')](handleError(_0x35b956,null));};exports['addTeams']=function(_0x279a19,_0x2a0d94,_0x1b922b){var _0x2d690f=[];var _0x30a05b;return db['Team'][_0x9a07('0x49')]({'where':{'id':_0x279a19[_0x9a07('0x4d')][_0x9a07('0x67')]},'attributes':['id'],'include':[{'model':db[_0x9a07('0x68')],'as':_0x9a07('0x69'),'attributes':['id'],'raw':!![]}]})[_0x9a07('0x22')](function(_0x403108){if(_0x403108){for(var _0x5932bb=0x0;_0x5932bb<_0x403108[_0x9a07('0x3b')];_0x5932bb+=0x1){for(var _0x527a2e=0x0;_0x527a2e<_0x403108[_0x5932bb][_0x9a07('0x69')][_0x9a07('0x3b')];_0x527a2e+=0x1){_0x2d690f=_[_0x9a07('0x6a')](_0x2d690f,[_0x403108[_0x5932bb]['Agents'][_0x527a2e]['id']]);}}return _0x2d690f;}})[_0x9a07('0x22')](function(_0x530f0f){if(_0x530f0f){return db[_0x9a07('0x33')][_0x9a07('0x2c')]({'where':{'id':_0x279a19['params']['id']}});}})[_0x9a07('0x22')](function(_0x22f65a){if(_0x22f65a){_0x30a05b=_0x22f65a;return _0x30a05b[_0x9a07('0x6b')](_0x2d690f,{'penalty':_0x279a19['body'][_0x9a07('0x6c')]});}})[_0x9a07('0x22')](function(_0x5559ea){if(_0x5559ea){return _0x30a05b['addTeams'](_0x279a19[_0x9a07('0x4d')][_0x9a07('0x67')]);}})[_0x9a07('0x22')](handleEntityNotFound(_0x2a0d94,null))[_0x9a07('0x22')](respondWithStatusCode(_0x2a0d94,null))[_0x9a07('0x4b')](handleError(_0x2a0d94,null));};exports[_0x9a07('0x6d')]=function(_0x191d61,_0x16fe1f,_0x542e04){var _0x330d30=[];var _0x31363b;return db[_0x9a07('0x66')][_0x9a07('0x49')]({'where':{'id':_0x191d61[_0x9a07('0x3c')][_0x9a07('0x67')]},'attributes':['id'],'include':[{'model':db[_0x9a07('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](function(_0xe5669d){if(_0xe5669d){for(var _0x469fe8=0x0;_0x469fe8<_0xe5669d[_0x9a07('0x3b')];_0x469fe8+=0x1){for(var _0x15600c=0x0;_0x15600c<_0xe5669d[_0x469fe8][_0x9a07('0x69')]['length'];_0x15600c+=0x1){_0x330d30=_[_0x9a07('0x6a')](_0x330d30,[_0xe5669d[_0x469fe8][_0x9a07('0x69')][_0x15600c]['id']]);}}return _0x330d30;}})[_0x9a07('0x22')](function(_0x334857){if(_0x334857){return db['VoiceQueue'][_0x9a07('0x2c')]({'where':{'id':_0x191d61[_0x9a07('0x53')]['id']}});}})[_0x9a07('0x22')](function(_0x169e88){if(_0x169e88){_0x31363b=_0x169e88;return _0x31363b[_0x9a07('0x6e')](_0x330d30);}})['then'](function(_0x117324){if(_0x31363b){return _0x31363b[_0x9a07('0x6d')](_0x191d61[_0x9a07('0x3c')][_0x9a07('0x67')]);}})[_0x9a07('0x22')](handleEntityNotFound(_0x16fe1f,null))[_0x9a07('0x22')](respondWithStatusCode(_0x16fe1f,null))[_0x9a07('0x4b')](handleError(_0x16fe1f,null));};exports['addAgents']=function(_0x2020f0,_0x169410,_0x233c34){var _0x4532c0,_0x43e768;return db[_0x9a07('0x33')]['find']({'where':{'id':_0x2020f0['params']['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x169410,null))[_0x9a07('0x22')](function(_0x57843e){if(_0x57843e){_0x43e768=_0x57843e;return _0x57843e['addAgents'](_0x2020f0[_0x9a07('0x4d')]['ids'],_['omit'](_0x2020f0[_0x9a07('0x4d')],['ids','id'])||{})[_0x9a07('0x6f')](function(_0x255775){for(var _0x2a9eb5=0x0;_0x2a9eb5<_0x2020f0[_0x9a07('0x4d')][_0x9a07('0x67')]['length'];_0x2a9eb5+=0x1){socket['emit'](_0x9a07('0x70'),{'UserId':_0x2020f0[_0x9a07('0x4d')][_0x9a07('0x67')][_0x2a9eb5],'VoiceQueueId':_0x2020f0['params']['id']});}return _0x255775;});}})[_0x9a07('0x22')](function(_0x37ee67){_0x4532c0=_0x37ee67||[];if(_0x43e768){return db[_0x9a07('0x68')][_0x9a07('0x49')]({'where':{'id':_0x2020f0[_0x9a07('0x4d')][_0x9a07('0x67')]},'attributes':['id','name',_0x9a07('0x71'),'voicePause',_0x9a07('0x72')],'raw':!![]});}})[_0x9a07('0x22')](function(_0x206086){if(_0x206086&&_0x206086[_0x9a07('0x3b')]){var _0x46d1b0=[];for(var _0x3fd763=0x0;_0x3fd763<_0x206086[_0x9a07('0x3b')];_0x3fd763++){_0x46d1b0[_0x9a07('0x73')](db[_0x9a07('0x74')]['upsert']({'membername':_0x206086[_0x3fd763][_0x9a07('0x2d')],'UserId':_0x206086[_0x3fd763]['id'],'queue_name':_0x43e768['name'],'VoiceQueueId':_0x43e768['id'],'interface':_[_0x9a07('0x75')](_0x206086[_0x3fd763][_0x9a07('0x72')])?util[_0x9a07('0x76')]('SIP/%s',_0x206086[_0x3fd763][_0x9a07('0x2d')]):_0x206086[_0x3fd763]['interface'],'paused':_0x206086[_0x3fd763]['voicePause']||![],'penalty':_0x2020f0[_0x9a07('0x4d')][_0x9a07('0x6c')]||0x0}));}return BPromise['all'](_0x46d1b0);}})[_0x9a07('0x22')](function(_0x46c2d8){return _0x4532c0;})[_0x9a07('0x22')](respondWithResult(_0x169410,null))['catch'](handleError(_0x169410,null));};exports['removeAgents']=function(_0x2c491d,_0x599e47,_0x5dd34f){var _0x165610;return db['VoiceQueue'][_0x9a07('0x2c')]({'where':{'id':_0x2c491d[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x599e47,null))[_0x9a07('0x22')](function(_0x29482a){if(_0x29482a){return _0x29482a[_0x9a07('0x6e')](_0x2c491d[_0x9a07('0x3c')][_0x9a07('0x67')])[_0x9a07('0x22')](function(_0x559b3a){if(_[_0x9a07('0x77')](_0x2c491d[_0x9a07('0x3c')][_0x9a07('0x67')])){for(var _0x9ce22f=0x0;_0x9ce22f<_0x2c491d[_0x9a07('0x3c')][_0x9a07('0x67')][_0x9a07('0x3b')];_0x9ce22f+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':_0x2c491d['query']['ids'][_0x9ce22f],'VoiceQueueId':_0x2c491d['params']['id']});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':_0x2c491d[_0x9a07('0x3c')][_0x9a07('0x67')],'VoiceQueueId':_0x2c491d[_0x9a07('0x53')]['id']});}});}})['then'](function(_0x284bfe){if(_0x2c491d[_0x9a07('0x3c')][_0x9a07('0x78')]){_0x165610=_0x284bfe;return db[_0x9a07('0x74')][_0x9a07('0x2f')]({'where':{'VoiceQueueId':_0x2c491d[_0x9a07('0x53')]['id'],'UserId':_0x2c491d['query'][_0x9a07('0x67')]}})[_0x9a07('0x22')](function(){return _0x165610;});}})[_0x9a07('0x22')](respondWithStatusCode(_0x599e47,null))[_0x9a07('0x4b')](handleError(_0x599e47,null));};exports[_0x9a07('0x79')]=function(_0x2b07f2,_0x141104,_0x56e227){var _0xfe677c={};var _0x8e6919={};var _0x366c1c;var _0x490c4;return db['VoiceQueue'][_0x9a07('0x5a')]({'where':{'id':_0x2b07f2[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x141104,null))['then'](function(_0x3f7a3a){if(_0x3f7a3a){_0x366c1c=_0x3f7a3a;_0x8e6919['model']=_[_0x9a07('0x36')](db[_0x9a07('0x68')]['rawAttributes']);_0x8e6919[_0x9a07('0x3c')]=_['keys'](_0x2b07f2[_0x9a07('0x3c')]);_0x8e6919['filters']=_[_0x9a07('0x39')](_0x8e6919[_0x9a07('0x35')],_0x8e6919[_0x9a07('0x3c')]);_0xfe677c[_0x9a07('0x38')]=_['intersection'](_0x8e6919[_0x9a07('0x35')],qs['fields'](_0x2b07f2[_0x9a07('0x3c')][_0x9a07('0x3a')]));_0xfe677c[_0x9a07('0x38')]=_0xfe677c['attributes'][_0x9a07('0x3b')]?_0xfe677c['attributes']:_0x8e6919[_0x9a07('0x35')];_0xfe677c['order']=qs['sort'](_0x2b07f2[_0x9a07('0x3c')]['sort']);_0xfe677c[_0x9a07('0x41')]=qs[_0x9a07('0x37')](_['pick'](_0x2b07f2[_0x9a07('0x3c')],_0x8e6919['filters']));if(_0x2b07f2['query'][_0x9a07('0x26')]){_0xfe677c['where']=_[_0x9a07('0x42')](_0xfe677c[_0x9a07('0x41')],{'$or':_[_0x9a07('0x28')](_0xfe677c[_0x9a07('0x38')],function(_0x4a8a7e){var _0x28db23={};_0x28db23[_0x4a8a7e]={'$like':'%'+_0x2b07f2[_0x9a07('0x3c')]['filter']+'%'};return _0x28db23;})});}_0xfe677c=_[_0x9a07('0x42')]({},_0xfe677c,_0x2b07f2[_0x9a07('0x46')]);return _0x366c1c[_0x9a07('0x79')](_0xfe677c);}})[_0x9a07('0x22')](function(_0xdfd3f8){if(_0xdfd3f8){_0x490c4=_0xdfd3f8[_0x9a07('0x3b')];if(!_0x2b07f2['query']['hasOwnProperty'](_0x9a07('0x3e'))){_0xfe677c[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x2b07f2[_0x9a07('0x3c')]['limit']);_0xfe677c['offset']=qs[_0x9a07('0x3f')](_0x2b07f2['query'][_0x9a07('0x3f')]);}return _0x366c1c['getAgents'](_0xfe677c);}})[_0x9a07('0x22')](function(_0x229ab4){if(_0x229ab4){return _0x229ab4?{'count':_0x490c4,'rows':_0x229ab4}:null;}})[_0x9a07('0x22')](respondWithResult(_0x141104,null))[_0x9a07('0x4b')](handleError(_0x141104,null));};exports['getMembers']=function(_0x3e200b,_0x5da221,_0x26d8bd){var _0x437686={};var _0x3915ec={};var _0x15831f;var _0x865a83;return db[_0x9a07('0x33')][_0x9a07('0x5a')]({'where':{'id':_0x3e200b[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x5da221,null))[_0x9a07('0x22')](function(_0x5f27ba){if(_0x5f27ba){_0x15831f=_0x5f27ba;_0x3915ec['model']=_['keys'](db[_0x9a07('0x74')][_0x9a07('0x34')]);_0x3915ec[_0x9a07('0x3c')]=_[_0x9a07('0x36')](_0x3e200b['query']);_0x3915ec[_0x9a07('0x37')]=_[_0x9a07('0x39')](_0x3915ec['model'],_0x3915ec[_0x9a07('0x3c')]);_0x437686['attributes']=_[_0x9a07('0x39')](_0x3915ec['model'],qs[_0x9a07('0x3a')](_0x3e200b[_0x9a07('0x3c')][_0x9a07('0x3a')]));_0x437686[_0x9a07('0x38')]=_0x437686[_0x9a07('0x38')]['length']?_0x437686[_0x9a07('0x38')]:_0x3915ec[_0x9a07('0x35')];_0x437686[_0x9a07('0x61')]=qs[_0x9a07('0x40')](_0x3e200b[_0x9a07('0x3c')]['sort']);_0x437686[_0x9a07('0x41')]=qs[_0x9a07('0x37')](_[_0x9a07('0x5b')](_0x3e200b['query'],_0x3915ec[_0x9a07('0x37')]));if(_0x3e200b['query'][_0x9a07('0x26')]){_0x437686[_0x9a07('0x41')]=_[_0x9a07('0x42')](_0x437686['where'],{'$or':_[_0x9a07('0x28')](_0x437686[_0x9a07('0x38')],function(_0x784be4){var _0x53af6f={};_0x53af6f[_0x784be4]={'$like':'%'+_0x3e200b[_0x9a07('0x3c')][_0x9a07('0x26')]+'%'};return _0x53af6f;})});}_0x437686=_[_0x9a07('0x42')]({},_0x437686,_0x3e200b['options']);return _0x15831f[_0x9a07('0x7a')](_0x437686);}})[_0x9a07('0x22')](function(_0x270e6d){if(_0x270e6d){_0x865a83=_0x270e6d[_0x9a07('0x3b')];if(!_0x3e200b[_0x9a07('0x3c')][_0x9a07('0x3d')](_0x9a07('0x3e'))){_0x437686[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x3e200b['query'][_0x9a07('0x1d')]);_0x437686[_0x9a07('0x3f')]=qs[_0x9a07('0x3f')](_0x3e200b[_0x9a07('0x3c')][_0x9a07('0x3f')]);}return _0x15831f[_0x9a07('0x7a')](_0x437686);}})['then'](function(_0x29b05e){return _0x29b05e?{'count':_0x865a83,'rows':_0x29b05e}:null;})[_0x9a07('0x22')](respondWithResult(_0x5da221,null))[_0x9a07('0x4b')](handleError(_0x5da221,null));};exports[_0x9a07('0x7b')]=function(_0x3075f6,_0x3a30b6,_0x1069e6){var _0x16f249={};var _0x4dc0c4={};var _0x1794db;var _0x151180;return db[_0x9a07('0x33')]['findOne']({'where':{'id':_0x3075f6[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x3a30b6,null))[_0x9a07('0x22')](function(_0x39675c){if(_0x39675c){_0x1794db=_0x39675c;_0x4dc0c4[_0x9a07('0x35')]=_[_0x9a07('0x36')](db[_0x9a07('0x7c')]['rawAttributes']);_0x4dc0c4[_0x9a07('0x3c')]=_[_0x9a07('0x36')](_0x3075f6[_0x9a07('0x3c')]);_0x4dc0c4['filters']=_['intersection'](_0x4dc0c4[_0x9a07('0x35')],_0x4dc0c4[_0x9a07('0x3c')]);_0x16f249['attributes']=_[_0x9a07('0x39')](_0x4dc0c4[_0x9a07('0x35')],qs[_0x9a07('0x3a')](_0x3075f6['query'][_0x9a07('0x3a')]));_0x16f249[_0x9a07('0x38')]=_0x16f249[_0x9a07('0x38')]['length']?_0x16f249[_0x9a07('0x38')]:_0x4dc0c4[_0x9a07('0x35')];_0x16f249['order']=qs['sort'](_0x3075f6['query'][_0x9a07('0x40')]);_0x16f249[_0x9a07('0x41')]=qs['filters'](_['pick'](_0x3075f6[_0x9a07('0x3c')],_0x4dc0c4[_0x9a07('0x37')]));if(_0x3075f6[_0x9a07('0x3c')]['filter']){_0x16f249['where']=_['merge'](_0x16f249[_0x9a07('0x41')],{'$or':_[_0x9a07('0x28')](_0x16f249[_0x9a07('0x38')],function(_0x556d61){var _0x43f118={};_0x43f118[_0x556d61]={'$like':'%'+_0x3075f6[_0x9a07('0x3c')]['filter']+'%'};return _0x43f118;})});}_0x16f249=_[_0x9a07('0x42')]({},_0x16f249,_0x3075f6[_0x9a07('0x46')]);return _0x1794db[_0x9a07('0x7b')](_0x16f249);}})[_0x9a07('0x22')](function(_0x5449f6){if(_0x5449f6){_0x151180=_0x5449f6[_0x9a07('0x3b')];if(!_0x3075f6[_0x9a07('0x3c')]['hasOwnProperty']('nolimit')){_0x16f249[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x3075f6[_0x9a07('0x3c')]['limit']);_0x16f249[_0x9a07('0x3f')]=qs[_0x9a07('0x3f')](_0x3075f6[_0x9a07('0x3c')][_0x9a07('0x3f')]);}return _0x1794db[_0x9a07('0x7b')](_0x16f249);}})['then'](function(_0x50b2f0){if(_0x50b2f0){return _0x50b2f0?{'count':_0x151180,'rows':_0x50b2f0}:null;}})['then'](respondWithResult(_0x3a30b6,null))[_0x9a07('0x4b')](handleError(_0x3a30b6,null));};exports['addLists']=function(_0x29f4a4,_0x4ac00f,_0x3815d0){var _0x4b82c2,_0x264d75;return db['VoiceQueue'][_0x9a07('0x2c')]({'where':{'id':_0x29f4a4[_0x9a07('0x53')]['id']}})['then'](handleEntityNotFound(_0x4ac00f,null))[_0x9a07('0x22')](function(_0x1e11ba){if(_0x1e11ba){_0x264d75=_0x1e11ba;return _0x1e11ba[_0x9a07('0x7d')](_0x29f4a4[_0x9a07('0x4d')][_0x9a07('0x67')],_[_0x9a07('0x55')](_0x29f4a4[_0x9a07('0x4d')],['ids','id'])||{});}return null;})[_0x9a07('0x6f')](function(_0x31d94f){var _0x569c17;_0x4b82c2=_0x31d94f||[];var _0x20dc36=[];if(_0x31d94f){for(var _0x34057a=0x0;_0x34057a<_0x31d94f[_0x9a07('0x3b')];_0x34057a+=0x1){var _0x256929=_0x31d94f[_0x34057a]['get']({'plain':!![]});_0x264d75[_0x9a07('0x7e')]=_0x29f4a4['body'][_0x9a07('0x7e')]?_0x29f4a4[_0x9a07('0x4d')][_0x9a07('0x7e')]:_0x264d75[_0x9a07('0x7e')];switch(_0x264d75['dialCheckDuplicateType']){case'always':_0x569c17=squel[_0x9a07('0x7f')]()[_0x9a07('0x80')](_0x9a07('0x81'))[_0x9a07('0x82')]([_0x9a07('0x83'),_0x9a07('0x84'),_0x9a07('0x85'),'ListId',_0x9a07('0x5c'),_0x9a07('0x56'),'updatedAt'],squel['select']()[_0x9a07('0x45')](_0x9a07('0x83'),_0x9a07('0x83'))[_0x9a07('0x45')](_0x9a07('0x86'),_0x9a07('0x84'))[_0x9a07('0x45')]('id',_0x9a07('0x85'))[_0x9a07('0x45')](_0x256929[_0x9a07('0x87')][_0x9a07('0x88')](),'ListId')['field'](_0x29f4a4[_0x9a07('0x53')]['id'][_0x9a07('0x88')](),_0x9a07('0x5c'))[_0x9a07('0x45')](_0x9a07('0x86'),_0x9a07('0x56'))[_0x9a07('0x45')](_0x9a07('0x86'),_0x9a07('0x54'))[_0x9a07('0x89')](_0x9a07('0x8a'))['where']('deletedAt\x20IS\x20NULL')[_0x9a07('0x41')](_0x9a07('0x8b'),_0x256929[_0x9a07('0x87')][_0x9a07('0x88')]())[_0x9a07('0x41')](_0x9a07('0x8c'))[_0x9a07('0x41')](_0x9a07('0x8d'),squel['select']()['field']('calleridnum')[_0x9a07('0x89')]('cm_hopper_final')[_0x9a07('0x41')]('VoiceQueueId\x20=\x20?',_0x29f4a4['params']['id'][_0x9a07('0x88')]()))['where'](_0x9a07('0x8d'),squel[_0x9a07('0x8e')]()['field'](_0x9a07('0x83'))[_0x9a07('0x89')]('cm_hopper')[_0x9a07('0x41')](_0x9a07('0x8f'),_0x29f4a4['params']['id'][_0x9a07('0x88')]())))[_0x9a07('0x88')]();break;case _0x9a07('0x90'):_0x569c17=squel[_0x9a07('0x7f')]()[_0x9a07('0x80')](_0x9a07('0x81'))[_0x9a07('0x82')](['phone','scheduledAt',_0x9a07('0x85'),_0x9a07('0x91'),_0x9a07('0x5c'),_0x9a07('0x56'),_0x9a07('0x54')],squel[_0x9a07('0x8e')]()[_0x9a07('0x45')](_0x9a07('0x83'),'phone')[_0x9a07('0x45')](_0x9a07('0x86'),_0x9a07('0x84'))[_0x9a07('0x45')]('id',_0x9a07('0x85'))['field'](_0x256929[_0x9a07('0x87')][_0x9a07('0x88')](),'ListId')['field'](_0x29f4a4[_0x9a07('0x53')]['id']['toString'](),'VoiceQueueId')[_0x9a07('0x45')]('NOW()',_0x9a07('0x56'))[_0x9a07('0x45')]('NOW()',_0x9a07('0x54'))[_0x9a07('0x89')]('cm_contacts')[_0x9a07('0x41')]('deletedAt\x20IS\x20NULL')[_0x9a07('0x41')](_0x9a07('0x8b'),_0x256929[_0x9a07('0x87')][_0x9a07('0x88')]())[_0x9a07('0x41')](_0x9a07('0x8c'))[_0x9a07('0x41')](_0x9a07('0x8d'),squel[_0x9a07('0x8e')]()['field'](_0x9a07('0x83'))[_0x9a07('0x89')](_0x9a07('0x81'))[_0x9a07('0x41')](_0x9a07('0x8f'),_0x29f4a4[_0x9a07('0x53')]['id'][_0x9a07('0x88')]())))[_0x9a07('0x88')]();break;default:_0x569c17=squel[_0x9a07('0x7f')]()[_0x9a07('0x80')](_0x9a07('0x81'))[_0x9a07('0x82')]([_0x9a07('0x83'),'scheduledAt','ContactId','ListId',_0x9a07('0x5c'),_0x9a07('0x56'),'updatedAt'],squel['select']()[_0x9a07('0x45')](_0x9a07('0x83'),_0x9a07('0x83'))['field'](_0x9a07('0x86'),_0x9a07('0x84'))[_0x9a07('0x45')]('id',_0x9a07('0x85'))['field'](_0x256929[_0x9a07('0x87')][_0x9a07('0x88')](),_0x9a07('0x91'))[_0x9a07('0x45')](_0x29f4a4[_0x9a07('0x53')]['id'][_0x9a07('0x88')](),_0x9a07('0x5c'))[_0x9a07('0x45')](_0x9a07('0x86'),_0x9a07('0x56'))[_0x9a07('0x45')](_0x9a07('0x86'),_0x9a07('0x54'))['from'](_0x9a07('0x8a'))[_0x9a07('0x41')](_0x9a07('0x92'))[_0x9a07('0x41')]('ListId\x20=\x20?',_0x256929['CmListId']['toString']())[_0x9a07('0x41')](_0x9a07('0x8c')))[_0x9a07('0x88')]();}_0x20dc36[_0x9a07('0x73')](db[_0x9a07('0x93')]['query'](_0x569c17));}return BPromise[_0x9a07('0x94')](_0x20dc36);}})[_0x9a07('0x22')](function(){return _0x4b82c2;})[_0x9a07('0x22')](respondWithResult(_0x4ac00f,null))[_0x9a07('0x4b')](handleError(_0x4ac00f,null));};exports[_0x9a07('0x95')]=function(_0x103283,_0x518ce0,_0x2fe47c){var _0x276a76;return db[_0x9a07('0x33')][_0x9a07('0x2c')]({'where':{'id':_0x103283[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x518ce0,null))[_0x9a07('0x22')](function(_0x43e229){if(_0x43e229){return _0x43e229[_0x9a07('0x95')](_0x103283[_0x9a07('0x3c')][_0x9a07('0x67')]);}})['then'](function(_0x16d678){if(_0x16d678){_0x276a76=_0x16d678;return db['CmHopper'][_0x9a07('0x2f')]({'where':{'ListId':_0x103283[_0x9a07('0x3c')]['ids'],'VoiceQueueId':_0x103283[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](function(){return _0x276a76;});}})['then'](respondWithStatusCode(_0x518ce0,null))[_0x9a07('0x4b')](handleError(_0x518ce0,null));};exports[_0x9a07('0x96')]=function(_0x304df4,_0x4da75e,_0x33fd8f){var _0xed5dad={};var _0x1a0d2c={};var _0x1080aa;var _0x30b635;return db['VoiceQueue']['findOne']({'where':{'id':_0x304df4[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x4da75e,null))[_0x9a07('0x22')](function(_0x5e1766){if(_0x5e1766){_0x1080aa=_0x5e1766;_0x1a0d2c['model']=_[_0x9a07('0x36')](db['CmList'][_0x9a07('0x34')]);_0x1a0d2c[_0x9a07('0x3c')]=_[_0x9a07('0x36')](_0x304df4['query']);_0x1a0d2c[_0x9a07('0x37')]=_[_0x9a07('0x39')](_0x1a0d2c[_0x9a07('0x35')],_0x1a0d2c[_0x9a07('0x3c')]);_0xed5dad[_0x9a07('0x38')]=_[_0x9a07('0x39')](_0x1a0d2c[_0x9a07('0x35')],qs[_0x9a07('0x3a')](_0x304df4[_0x9a07('0x3c')][_0x9a07('0x3a')]));_0xed5dad[_0x9a07('0x38')]=_0xed5dad[_0x9a07('0x38')][_0x9a07('0x3b')]?_0xed5dad[_0x9a07('0x38')]:_0x1a0d2c['model'];_0xed5dad[_0x9a07('0x61')]=qs['sort'](_0x304df4[_0x9a07('0x3c')][_0x9a07('0x40')]);_0xed5dad['where']=qs[_0x9a07('0x37')](_[_0x9a07('0x5b')](_0x304df4[_0x9a07('0x3c')],_0x1a0d2c[_0x9a07('0x37')]));if(_0x304df4[_0x9a07('0x3c')][_0x9a07('0x26')]){_0xed5dad[_0x9a07('0x41')]=_[_0x9a07('0x42')](_0xed5dad['where'],{'$or':_[_0x9a07('0x28')](_0xed5dad['attributes'],function(_0x53786d){var _0x15607c={};_0x15607c[_0x53786d]={'$like':'%'+_0x304df4['query']['filter']+'%'};return _0x15607c;})});}_0xed5dad=_['merge']({},_0xed5dad,_0x304df4[_0x9a07('0x46')]);return _0x1080aa[_0x9a07('0x96')](_0xed5dad);}})[_0x9a07('0x22')](function(_0x3f7b8f){if(_0x3f7b8f){_0x30b635=_0x3f7b8f[_0x9a07('0x3b')];if(!_0x304df4[_0x9a07('0x3c')]['hasOwnProperty'](_0x9a07('0x3e'))){_0xed5dad[_0x9a07('0x1d')]=qs[_0x9a07('0x1d')](_0x304df4[_0x9a07('0x3c')][_0x9a07('0x1d')]);_0xed5dad['offset']=qs[_0x9a07('0x3f')](_0x304df4[_0x9a07('0x3c')][_0x9a07('0x3f')]);}return _0x1080aa[_0x9a07('0x96')](_0xed5dad);}})['then'](function(_0x40e7d8){if(_0x40e7d8){return _0x40e7d8?{'count':_0x30b635,'rows':_0x40e7d8}:null;}})[_0x9a07('0x22')](respondWithResult(_0x4da75e,null))[_0x9a07('0x4b')](handleError(_0x4da75e,null));};exports[_0x9a07('0x97')]=function(_0x684f51,_0x5de47d,_0x204ea7){var _0x13ba0a,_0x4e6663;return db['VoiceQueue'][_0x9a07('0x2c')]({'where':{'id':_0x684f51[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x5de47d,null))[_0x9a07('0x22')](function(_0x43829c){if(_0x43829c){_0x4e6663=_0x43829c;return _0x43829c['addBlackLists'](_0x684f51[_0x9a07('0x4d')][_0x9a07('0x67')],_[_0x9a07('0x55')](_0x684f51['body'],[_0x9a07('0x67'),'id'])||{});}return null;})[_0x9a07('0x6f')](function(_0x3ee09a){var _0x35174d;_0x13ba0a=_0x3ee09a||[];var _0x52b832=[];if(_0x3ee09a){for(var _0x1e668a=0x0;_0x1e668a<_0x3ee09a[_0x9a07('0x3b')];_0x1e668a+=0x1){var _0x440f4f=_0x3ee09a[_0x1e668a][_0x9a07('0x23')]({'plain':!![]});_0x35174d=squel['insert']()['into'](_0x9a07('0x98'))[_0x9a07('0x82')]([_0x9a07('0x83'),_0x9a07('0x85'),_0x9a07('0x91'),_0x9a07('0x5c'),'createdAt',_0x9a07('0x54')],squel['select']()[_0x9a07('0x45')](_0x9a07('0x83'),'phone')['field']('id','ContactId')[_0x9a07('0x45')](_0x440f4f[_0x9a07('0x87')][_0x9a07('0x88')](),'ListId')[_0x9a07('0x45')](_0x684f51[_0x9a07('0x53')]['id'][_0x9a07('0x88')](),_0x9a07('0x5c'))[_0x9a07('0x45')](_0x9a07('0x86'),_0x9a07('0x56'))[_0x9a07('0x45')](_0x9a07('0x86'),'updatedAt')[_0x9a07('0x89')](_0x9a07('0x8a'))[_0x9a07('0x41')](_0x9a07('0x92'))[_0x9a07('0x41')]('ListId\x20=\x20?',_0x440f4f[_0x9a07('0x87')][_0x9a07('0x88')]())[_0x9a07('0x41')](_0x9a07('0x8c')))[_0x9a07('0x88')]();_0x52b832[_0x9a07('0x73')](db[_0x9a07('0x93')][_0x9a07('0x3c')](_0x35174d));}return BPromise['all'](_0x52b832);}})[_0x9a07('0x22')](function(){return _0x13ba0a;})[_0x9a07('0x22')](respondWithResult(_0x5de47d,null))['catch'](handleError(_0x5de47d,null));};exports['removeBlackLists']=function(_0xdedb36,_0x46a636,_0x13091d){var _0x1fa3ef;return db[_0x9a07('0x33')]['find']({'where':{'id':_0xdedb36['params']['id']}})[_0x9a07('0x22')](handleEntityNotFound(_0x46a636,null))[_0x9a07('0x22')](function(_0x108f6c){if(_0x108f6c){return _0x108f6c[_0x9a07('0x99')](_0xdedb36[_0x9a07('0x3c')][_0x9a07('0x67')]);}})['then'](function(_0x31db55){if(_0x31db55){_0x1fa3ef=_0x31db55;return db[_0x9a07('0x64')]['destroy']({'where':{'ListId':_0xdedb36[_0x9a07('0x3c')][_0x9a07('0x67')],'VoiceQueueId':_0xdedb36[_0x9a07('0x53')]['id']}})[_0x9a07('0x22')](function(){return _0x1fa3ef;});}})[_0x9a07('0x22')](respondWithStatusCode(_0x46a636,null))[_0x9a07('0x4b')](handleError(_0x46a636,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index a606e0a..60ea3cf 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 _0x3aaf=['exports','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x420dc3,_0x21bca6){var _0x52dfc7=function(_0x1d9974){while(--_0x1d9974){_0x420dc3['push'](_0x420dc3['shift']());}};_0x52dfc7(++_0x21bca6);}(_0x3aaf,0xbf));var _0xf3aa=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x3aaf[_0xa1e3e3];return _0xc980e9;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xf3aa('0x0'))['db'][_0xf3aa('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf3aa('0x2')](0x0);var events={'afterCreate':_0xf3aa('0x3'),'afterUpdate':_0xf3aa('0x4'),'afterDestroy':_0xf3aa('0x5')};function emitEvent(_0x38ede4){return function(_0x7b3847,_0x22e0e5,_0x207f4d){VoiceQueueEvents[_0xf3aa('0x6')](_0x38ede4+':'+_0x7b3847['id'],_0x7b3847);VoiceQueueEvents[_0xf3aa('0x6')](_0x38ede4,_0x7b3847);_0x207f4d(null);};}for(var e in events){if(events[_0xf3aa('0x7')](e)){var event=events[e];VoiceQueue[_0xf3aa('0x8')](e,emitEvent(event));}}module[_0xf3aa('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xb09d=['setMaxListeners','save','update','remove','hook','../../mysqldb','VoiceQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb09d,0x171));var _0xdb09=function(_0x18a249,_0x1c7915){_0x18a249=_0x18a249-0x0;var _0x31aec8=_0xb09d[_0x18a249];return _0x31aec8;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xdb09('0x0'))['db'][_0xdb09('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xdb09('0x2')](0x0);var events={'afterCreate':_0xdb09('0x3'),'afterUpdate':_0xdb09('0x4'),'afterDestroy':_0xdb09('0x5')};function emitEvent(_0x4c69ea){return function(_0xce79db,_0x71b1d6,_0x538222){VoiceQueueEvents['emit'](_0x4c69ea+':'+_0xce79db['id'],_0xce79db);VoiceQueueEvents['emit'](_0x4c69ea,_0xce79db);_0x538222(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xdb09('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 46cc9dc..fcf38b2 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 _0x5809=['./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','util','../../config/logger','bluebird','request-promise'];(function(_0x2848a8,_0x3be2ae){var _0xbc896c=function(_0x33fff9){while(--_0x33fff9){_0x2848a8['push'](_0x2848a8['shift']());}};_0xbc896c(++_0x3be2ae);}(_0x5809,0x125));var _0x9580=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5809[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x9580('0x0'));var logger=require(_0x9580('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9580('0x2'));var rp=require(_0x9580('0x3'));var attributes=require(_0x9580('0x4'));module[_0x9580('0x5')]=function(_0x51f901,_0x130e70){return _0x51f901[_0x9580('0x6')](_0x9580('0x7'),attributes,{'tableName':_0x9580('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x976b=['./voiceQueue.attributes','exports','VoiceQueue','voice_queues','lodash','util','../../config/logger','moment','request-promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x976b,0xca));var _0xb976=function(_0x14459c,_0x3906ef){_0x14459c=_0x14459c-0x0;var _0x328aac=_0x976b[_0x14459c];return _0x328aac;};'use strict';var _=require(_0xb976('0x0'));var util=require(_0xb976('0x1'));var logger=require(_0xb976('0x2'))('api');var moment=require(_0xb976('0x3'));var BPromise=require('bluebird');var rp=require(_0xb976('0x4'));var attributes=require(_0xb976('0x5'));module[_0xb976('0x6')]=function(_0x53467c,_0x1930f9){return _0x53467c['define'](_0xb976('0x7'),attributes,{'tableName':_0xb976('0x8'),'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 d9875d0..a87e111 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 _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x18e09b,_0x3be1a5){var _0x59f2fb=function(_0x3bf8b9){while(--_0x3bf8b9){_0x18e09b['push'](_0x18e09b['shift']());}};_0x59f2fb(++_0x3be1a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file +var _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x34175c,_0x5f350f){var _0x215d09=function(_0x4eb0cb){while(--_0x4eb0cb){_0x34175c['push'](_0x34175c['shift']());}};_0x215d09(++_0x5f350f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 13c49f4..82d2b1e 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 _0x3596=['removeListener','register','length','./voiceQueue.events','update'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x3596,0xee));var _0x6359=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x3596[_0x50007c];return _0x5c1ec7;};'use strict';var VoiceQueueEvents=require(_0x6359('0x0'));var events=['save','remove',_0x6359('0x1')];function createListener(_0x5470c4,_0x2f4986){return function(_0x647d73){_0x2f4986['emit'](_0x5470c4,_0x647d73);};}function removeListener(_0x808228,_0x19ebba){return function(){VoiceQueueEvents[_0x6359('0x2')](_0x808228,_0x19ebba);};}exports[_0x6359('0x3')]=function(_0x17c388){for(var _0xcc5a70=0x0,_0x5077b8=events[_0x6359('0x4')];_0xcc5a70<_0x5077b8;_0xcc5a70++){var _0x2d1d9c=events[_0xcc5a70];var _0x3f75e3=createListener('voiceQueue:'+_0x2d1d9c,_0x17c388);VoiceQueueEvents['on'](_0x2d1d9c,_0x3f75e3);}}; \ No newline at end of file +var _0xcb32=['save','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0xe10991,_0x5c9688){var _0x230f9d=function(_0x34419a){while(--_0x34419a){_0xe10991['push'](_0xe10991['shift']());}};_0x230f9d(++_0x5c9688);}(_0xcb32,0x10f));var _0x2cb3=function(_0x4f3147,_0x13f9da){_0x4f3147=_0x4f3147-0x0;var _0x1d4007=_0xcb32[_0x4f3147];return _0x1d4007;};'use strict';var VoiceQueueEvents=require(_0x2cb3('0x0'));var events=[_0x2cb3('0x1'),'remove',_0x2cb3('0x2')];function createListener(_0x5986b4,_0x594cc5){return function(_0x3f5321){_0x594cc5[_0x2cb3('0x3')](_0x5986b4,_0x3f5321);};}function removeListener(_0x248956,_0x417bcc){return function(){VoiceQueueEvents[_0x2cb3('0x4')](_0x248956,_0x417bcc);};}exports[_0x2cb3('0x5')]=function(_0x48e8de){for(var _0x16da1d=0x0,_0x1ed0b6=events[_0x2cb3('0x6')];_0x16da1d<_0x1ed0b6;_0x16da1d++){var _0x172241=events[_0x16da1d];var _0x3ee02d=createListener(_0x2cb3('0x7')+_0x172241,_0x48e8de);VoiceQueueEvents['on'](_0x172241,_0x3ee02d);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index b939df3..4155ed8 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 _0xef3e=['/describe','getVoiceQueuesReport','/:id','show','post','create','put','util','path','connect-timeout','Router','../../config/environment','get','isAuthenticated'];(function(_0x18e8db,_0x4807ec){var _0x73464c=function(_0x2d5846){while(--_0x2d5846){_0x18e8db['push'](_0x18e8db['shift']());}};_0x73464c(++_0x4807ec);}(_0xef3e,0x103));var _0xeef3=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xef3e[_0x15c421];return _0x5e5ed5;};'use strict';var multer=require('multer');var util=require(_0xeef3('0x0'));var path=require(_0xeef3('0x1'));var timeout=require(_0xeef3('0x2'));var express=require('express');var router=express[_0xeef3('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeef3('0x4'));var controller=require('./voiceQueueReport.controller');router[_0xeef3('0x5')]('/',auth[_0xeef3('0x6')](),controller['index']);router[_0xeef3('0x5')](_0xeef3('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0xeef3('0x5')]('/index',auth['isAuthenticated'](),controller[_0xeef3('0x8')]);router[_0xeef3('0x5')](_0xeef3('0x9'),auth[_0xeef3('0x6')](),controller[_0xeef3('0xa')]);router[_0xeef3('0xb')]('/',auth['isAuthenticated'](),controller[_0xeef3('0xc')]);router[_0xeef3('0xd')](_0xeef3('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xeef3('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcde1=['getVoiceQueuesReport','/:id','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/index'];(function(_0xeae377,_0x140681){var _0x709060=function(_0x19fcee){while(--_0x19fcee){_0xeae377['push'](_0xeae377['shift']());}};_0x709060(++_0x140681);}(_0xcde1,0xfa));var _0x1cde=function(_0x1bc22b,_0x45f3bd){_0x1bc22b=_0x1bc22b-0x0;var _0x634926=_0xcde1[_0x1bc22b];return _0x634926;};'use strict';var multer=require(_0x1cde('0x0'));var util=require(_0x1cde('0x1'));var path=require(_0x1cde('0x2'));var timeout=require('connect-timeout');var express=require(_0x1cde('0x3'));var router=express[_0x1cde('0x4')]();var auth=require(_0x1cde('0x5'));var interaction=require(_0x1cde('0x6'));var config=require(_0x1cde('0x7'));var controller=require('./voiceQueueReport.controller');router[_0x1cde('0x8')]('/',auth[_0x1cde('0x9')](),controller[_0x1cde('0xa')]);router[_0x1cde('0x8')](_0x1cde('0xb'),auth[_0x1cde('0x9')](),controller[_0x1cde('0xc')]);router[_0x1cde('0x8')](_0x1cde('0xd'),auth['isAuthenticated'](),controller[_0x1cde('0xe')]);router['get'](_0x1cde('0xf'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x1cde('0x9')](),controller[_0x1cde('0x10')]);router[_0x1cde('0x11')]('/:id',auth[_0x1cde('0x9')](),controller[_0x1cde('0x12')]);router[_0x1cde('0x13')](_0x1cde('0xf'),auth[_0x1cde('0x9')](),controller[_0x1cde('0x14')]);module[_0x1cde('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 904372d..6c9d017 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 _0x0af2=['setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x0af2,0x1d3));var _0x20af=function(_0x47880b,_0x32260c){_0x47880b=_0x47880b-0x0;var _0x36e9cf=_0x0af2[_0x47880b];return _0x36e9cf;};'use strict';var Sequelize=require(_0x20af('0x0'));var moment=require(_0x20af('0x1'));module[_0x20af('0x2')]={'type':{'type':Sequelize[_0x20af('0x3')]},'uniqueid':{'type':Sequelize[_0x20af('0x3')]},'calleridnum':{'type':Sequelize[_0x20af('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x20af('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x20af('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x20af('0x4')],'set':function(_0x217374){var _0x2fb172=moment(_0x217374);var _0x26b7a3=moment(this['getDataValue'](_0x20af('0x5')))['format'](_0x20af('0x6'));var _0x49918b=_0x2fb172[_0x20af('0x7')](_0x26b7a3,_0x20af('0x8'));this[_0x20af('0x9')](_0x20af('0xa'),_0x217374);this[_0x20af('0x9')](_0x20af('0xb'),_0x49918b||null);}},'position':{'type':Sequelize[_0x20af('0xc')]},'count':{'type':Sequelize[_0x20af('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x20af('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x20af('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x20af('0x4')]},'queuecallerexit':{'type':Sequelize[_0x20af('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x20af('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x20af('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x20af('0x3')]},'connectedlinenum':{'type':Sequelize[_0x20af('0x3')]},'connectedlinename':{'type':Sequelize[_0x20af('0x3')]},'accountcode':{'type':Sequelize[_0x20af('0x3')]},'context':{'type':Sequelize[_0x20af('0x3')]},'exten':{'type':Sequelize[_0x20af('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x20af('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x20af('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x20af('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x20af('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x20af('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6814=['queuecallerjoinAt','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE'];(function(_0x36cc9d,_0x536ae6){var _0x21e305=function(_0x54c706){while(--_0x54c706){_0x36cc9d['push'](_0x36cc9d['shift']());}};_0x21e305(++_0x536ae6);}(_0x6814,0x1f0));var _0x4681=function(_0x2393e0,_0x44ea81){_0x2393e0=_0x2393e0-0x0;var _0x2282e4=_0x6814[_0x2393e0];return _0x2282e4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4681('0x0'));module[_0x4681('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4681('0x2')]},'calleridnum':{'type':Sequelize[_0x4681('0x2')]},'calleridname':{'type':Sequelize[_0x4681('0x2')]},'queue':{'type':Sequelize[_0x4681('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x4681('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x4681('0x3')],'set':function(_0x494e0e){var _0x3f384d=moment(_0x494e0e);var _0x8198e1=moment(this['getDataValue'](_0x4681('0x4')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x477981=_0x3f384d['diff'](_0x8198e1,'seconds');this[_0x4681('0x5')]('queuecallerleaveAt',_0x494e0e);this[_0x4681('0x5')]('holdtime',_0x477981||null);}},'position':{'type':Sequelize[_0x4681('0x6')]},'count':{'type':Sequelize[_0x4681('0x6')]},'queuecallerabandon':{'type':Sequelize[_0x4681('0x7')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x4681('0x3')]},'queuecallerexit':{'type':Sequelize[_0x4681('0x7')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x4681('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x4681('0x8')},'originalposition':{'type':Sequelize[_0x4681('0x6')]},'channel':{'type':Sequelize[_0x4681('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4681('0x2')]},'context':{'type':Sequelize[_0x4681('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x4681('0x6')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4681('0x7')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x4681('0x2')]},'transfer':{'type':Sequelize[_0x4681('0x7')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4681('0x2')],'comment':_0x4681('0x9')},'transferexten':{'type':Sequelize[_0x4681('0x2')]},'transferuniqueid':{'type':Sequelize[_0x4681('0x2')]},'disposition':{'type':Sequelize[_0x4681('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x4681('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 2f78f26..58fede7 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 _0x0720=['json','count','offset','limit','set','Content-Range','reject','save','destroy','then','error','stack','name','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','VoiceQueueReport','includeAll','include','findAll','rows','params','find','catch','create','body','update','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end'];(function(_0x11a2dd,_0x5bf4bc){var _0x4bc0e2=function(_0x54f2a7){while(--_0x54f2a7){_0x11a2dd['push'](_0x11a2dd['shift']());}};_0x4bc0e2(++_0x5bf4bc);}(_0x0720,0x80));var _0x0072=function(_0x2a8fa6,_0x548872){_0x2a8fa6=_0x2a8fa6-0x0;var _0x40162b=_0x0720[_0x2a8fa6];return _0x40162b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0072('0x0'));var zipdir=require(_0x0072('0x1'));var jsonpatch=require(_0x0072('0x2'));var rp=require('request-promise');var moment=require(_0x0072('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0072('0x4'));var util=require(_0x0072('0x5'));var path=require(_0x0072('0x6'));var sox=require(_0x0072('0x7'));var csv=require(_0x0072('0x8'));var ejs=require(_0x0072('0x9'));var fs=require('fs');var _=require(_0x0072('0xa'));var squel=require(_0x0072('0xb'));var crypto=require(_0x0072('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0072('0xd'));var toCsv=require(_0x0072('0x8'));var querystring=require(_0x0072('0xe'));var Papa=require(_0x0072('0xf'));var authService=require('../../components/auth/service');var hardwareService=require(_0x0072('0x10'));var Redis=require(_0x0072('0x11'));var qs=require(_0x0072('0x12'));var logger=require(_0x0072('0x13'))(_0x0072('0x14'));var utils=require(_0x0072('0x15'));var config=require(_0x0072('0x16'));var db=require(_0x0072('0x17'))['db'];config[_0x0072('0x18')]=_[_0x0072('0x19')](config[_0x0072('0x18')],{'host':_0x0072('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0072('0x18')]));require(_0x0072('0x1b'))[_0x0072('0x1c')](socket);function respondWithStatusCode(_0x2bae21,_0x4ada16){_0x4ada16=_0x4ada16||0xcc;return function(_0x23dd63){if(_0x23dd63){return _0x2bae21[_0x0072('0x1d')](_0x4ada16);}return _0x2bae21[_0x0072('0x1e')](_0x4ada16)[_0x0072('0x1f')]();};}function respondWithResult(_0x13e66b,_0x71880d){_0x71880d=_0x71880d||0xc8;return function(_0x40e6d5){if(_0x40e6d5){return _0x13e66b['status'](_0x71880d)[_0x0072('0x20')](_0x40e6d5);}};}function respondWithFilteredResult(_0x56bd92,_0x5077f0){return function(_0x30143c){if(_0x30143c){var _0x2cbe2e=_0x30143c[_0x0072('0x21')],_0x47b1cc=_0x5077f0['offset'],_0x85e5da=_0x5077f0[_0x0072('0x22')]+_0x5077f0[_0x0072('0x23')],_0x1d1ad8;if(_0x85e5da>=_0x2cbe2e){_0x85e5da=_0x2cbe2e;_0x1d1ad8=0xc8;}else{_0x1d1ad8=0xce;}_0x56bd92['status'](_0x1d1ad8);return _0x56bd92[_0x0072('0x24')](_0x0072('0x25'),_0x47b1cc+'-'+_0x85e5da+'/'+_0x2cbe2e)[_0x0072('0x20')](_0x30143c);}return null;};}function patchUpdates(_0x3e47bc){return function(_0x1e6d23){try{jsonpatch['apply'](_0x1e6d23,_0x3e47bc,!![]);}catch(_0x5e8dcb){return BPromise[_0x0072('0x26')](_0x5e8dcb);}return _0x1e6d23[_0x0072('0x27')]();};}function saveUpdates(_0x552635,_0x1654ec){return function(_0x3178e2){if(_0x3178e2){return _0x3178e2['update'](_0x552635)['then'](function(_0x3be83f){return _0x3be83f;});}return null;};}function removeEntity(_0x7c5439,_0x183fef){return function(_0x2cc0f1){if(_0x2cc0f1){return _0x2cc0f1[_0x0072('0x28')]()[_0x0072('0x29')](function(){_0x7c5439[_0x0072('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x433f68,_0x535ba9){return function(_0x31feed){if(!_0x31feed){_0x433f68[_0x0072('0x1d')](0x194);}return _0x31feed;};}function handleError(_0x33f690,_0x33bcc8){_0x33bcc8=_0x33bcc8||0x1f4;return function(_0x4b89be){logger[_0x0072('0x2a')](_0x4b89be[_0x0072('0x2b')]);if(_0x4b89be['name']){delete _0x4b89be[_0x0072('0x2c')];}_0x33f690['status'](_0x33bcc8)['send'](_0x4b89be);};}exports['index']=function(_0x506e8d,_0x12d3b4){var _0x1ecb5f={},_0xe61265={},_0x26894c={'count':0x0,'rows':[]};var _0x171522=db['VoiceQueueReport'][_0x0072('0x2d')];_0xe61265['model']=_[_0x0072('0x2e')](_0x171522);_0xe61265[_0x0072('0x2f')]=_[_0x0072('0x2e')](_0x506e8d['query']);_0xe61265[_0x0072('0x30')]=_[_0x0072('0x31')](_0xe61265[_0x0072('0x32')],_0xe61265[_0x0072('0x2f')]);_0x1ecb5f[_0x0072('0x33')]=_[_0x0072('0x31')](_0xe61265['model'],qs[_0x0072('0x34')](_0x506e8d[_0x0072('0x2f')][_0x0072('0x34')]));_0x1ecb5f[_0x0072('0x33')]=_0x1ecb5f['attributes'][_0x0072('0x35')]?_0x1ecb5f['attributes']:_0xe61265[_0x0072('0x32')];if(!_0x506e8d[_0x0072('0x2f')][_0x0072('0x36')](_0x0072('0x37'))){_0x1ecb5f[_0x0072('0x23')]=qs['limit'](_0x506e8d['query'][_0x0072('0x23')]);_0x1ecb5f['offset']=qs[_0x0072('0x22')](_0x506e8d['query'][_0x0072('0x22')]);}_0x1ecb5f[_0x0072('0x38')]=qs[_0x0072('0x39')](_0x506e8d[_0x0072('0x2f')][_0x0072('0x39')]);_0x1ecb5f[_0x0072('0x3a')]=qs['filters'](_['pick'](_0x506e8d[_0x0072('0x2f')],_0xe61265[_0x0072('0x30')]));if(_0x506e8d[_0x0072('0x2f')][_0x0072('0x3b')]){_0x1ecb5f[_0x0072('0x3a')]=_['merge'](_0x1ecb5f['where'],{'$or':_[_0x0072('0x3c')](_0x171522,function(_0x55f3cb){if(_0x55f3cb[_0x0072('0x3d')][_0x0072('0x3e')]!==_0x0072('0x3f')){var _0x432102={};_0x432102[_0x55f3cb[_0x0072('0x40')]]={'$like':'%'+_0x506e8d[_0x0072('0x2f')][_0x0072('0x3b')]+'%'};return _0x432102;}})});}_0x1ecb5f=_[_0x0072('0x41')]({},_0x1ecb5f,_0x506e8d[_0x0072('0x42')]);var _0x59b147={'where':_0x1ecb5f['where']};return db[_0x0072('0x43')][_0x0072('0x21')](_0x59b147)['then'](function(_0x27a135){_0x26894c[_0x0072('0x21')]=_0x27a135;if(_0x506e8d['query'][_0x0072('0x44')]){_0x1ecb5f[_0x0072('0x45')]=[{'all':!![]}];}return db[_0x0072('0x43')][_0x0072('0x46')](_0x1ecb5f);})[_0x0072('0x29')](function(_0x3f540c){_0x26894c[_0x0072('0x47')]=_0x3f540c;return _0x26894c;})[_0x0072('0x29')](respondWithFilteredResult(_0x12d3b4,_0x1ecb5f))['catch'](handleError(_0x12d3b4,null));};exports['show']=function(_0x182f80,_0x26a393){var _0x155c0e={'raw':![],'where':{'id':_0x182f80[_0x0072('0x48')]['id']}},_0x5a95e5={};_0x5a95e5[_0x0072('0x32')]=_[_0x0072('0x2e')](db[_0x0072('0x43')][_0x0072('0x2d')]);_0x5a95e5[_0x0072('0x2f')]=_[_0x0072('0x2e')](_0x182f80['query']);_0x5a95e5[_0x0072('0x30')]=_[_0x0072('0x31')](_0x5a95e5[_0x0072('0x32')],_0x5a95e5[_0x0072('0x2f')]);_0x155c0e[_0x0072('0x33')]=_[_0x0072('0x31')](_0x5a95e5[_0x0072('0x32')],qs['fields'](_0x182f80[_0x0072('0x2f')][_0x0072('0x34')]));_0x155c0e[_0x0072('0x33')]=_0x155c0e[_0x0072('0x33')][_0x0072('0x35')]?_0x155c0e[_0x0072('0x33')]:_0x5a95e5[_0x0072('0x32')];if(_0x182f80[_0x0072('0x2f')][_0x0072('0x44')]){_0x155c0e[_0x0072('0x45')]=[{'all':!![]}];}_0x155c0e=_[_0x0072('0x41')]({},_0x155c0e,_0x182f80[_0x0072('0x42')]);return db['VoiceQueueReport'][_0x0072('0x49')](_0x155c0e)['then'](handleEntityNotFound(_0x26a393,null))[_0x0072('0x29')](respondWithResult(_0x26a393,null))[_0x0072('0x4a')](handleError(_0x26a393,null));};exports[_0x0072('0x4b')]=function(_0x1f2363,_0x372fdf){return db['VoiceQueueReport']['create'](_0x1f2363[_0x0072('0x4c')],{})['then'](respondWithResult(_0x372fdf,0xc9))[_0x0072('0x4a')](handleError(_0x372fdf,null));};exports[_0x0072('0x4d')]=function(_0x585fcd,_0x46dc0c){if(_0x585fcd[_0x0072('0x4c')]['id']){delete _0x585fcd[_0x0072('0x4c')]['id'];}return db[_0x0072('0x43')][_0x0072('0x49')]({'where':{'id':_0x585fcd[_0x0072('0x48')]['id']}})[_0x0072('0x29')](handleEntityNotFound(_0x46dc0c,null))[_0x0072('0x29')](saveUpdates(_0x585fcd[_0x0072('0x4c')],null))[_0x0072('0x29')](respondWithResult(_0x46dc0c,null))[_0x0072('0x4a')](handleError(_0x46dc0c,null));};exports[_0x0072('0x28')]=function(_0x1b71a6,_0x6c4be4){return db[_0x0072('0x43')][_0x0072('0x49')]({'where':{'id':_0x1b71a6[_0x0072('0x48')]['id']}})[_0x0072('0x29')](handleEntityNotFound(_0x6c4be4,null))['then'](removeEntity(_0x6c4be4,null))[_0x0072('0x4a')](handleError(_0x6c4be4,null));};exports[_0x0072('0x4e')]=function(_0x4ea952,_0x55710c){return db[_0x0072('0x43')][_0x0072('0x4e')]()[_0x0072('0x29')](respondWithResult(_0x55710c,null))[_0x0072('0x4a')](handleError(_0x55710c,null));};exports[_0x0072('0x4f')]=function(_0xd9571e,_0x2457fa){var _0x37fa46={},_0x30e22a={},_0x1d4043={'count':0x0,'rows':[]};_0x30e22a[_0x0072('0x32')]=_['keys'](db[_0x0072('0x43')][_0x0072('0x2d')]);_0x30e22a['query']=_[_0x0072('0x2e')](_0xd9571e[_0x0072('0x2f')]);_0x30e22a[_0x0072('0x30')]=_['intersection'](_0x30e22a[_0x0072('0x32')],_0x30e22a[_0x0072('0x2f')]);_0x37fa46[_0x0072('0x33')]=_[_0x0072('0x31')](_0x30e22a['model'],qs[_0x0072('0x34')](_0xd9571e[_0x0072('0x2f')][_0x0072('0x34')]));_0x37fa46[_0x0072('0x33')]=_0x37fa46[_0x0072('0x33')][_0x0072('0x35')]?_0x37fa46[_0x0072('0x33')]:_0x30e22a[_0x0072('0x32')];if(!_0xd9571e[_0x0072('0x2f')]['hasOwnProperty'](_0x0072('0x37'))){_0x37fa46[_0x0072('0x23')]=qs[_0x0072('0x23')](_0xd9571e[_0x0072('0x2f')][_0x0072('0x23')]);_0x37fa46['offset']=qs[_0x0072('0x22')](_0xd9571e[_0x0072('0x2f')]['offset']);}_0x37fa46[_0x0072('0x38')]=qs[_0x0072('0x39')](_0xd9571e[_0x0072('0x2f')]['sort']);_0x37fa46[_0x0072('0x3a')]=qs[_0x0072('0x30')](_['pick'](_0xd9571e[_0x0072('0x2f')],_0x30e22a[_0x0072('0x30')]));if(_0xd9571e[_0x0072('0x2f')][_0x0072('0x3b')]){_0x37fa46[_0x0072('0x3a')]=_['merge'](_0x37fa46[_0x0072('0x3a')],{'$or':_[_0x0072('0x3c')](_0x37fa46[_0x0072('0x33')],function(_0x105bc1){var _0x5d9fb8={};_0x5d9fb8[_0x105bc1]={'$like':'%'+_0xd9571e[_0x0072('0x2f')][_0x0072('0x3b')]+'%'};return _0x5d9fb8;})});}_0x37fa46=_[_0x0072('0x41')]({},_0x37fa46,_0xd9571e[_0x0072('0x42')]);var _0x5ad640={'where':_0x37fa46[_0x0072('0x3a')]};return db['VoiceQueueReport'][_0x0072('0x21')](_0x5ad640)[_0x0072('0x29')](function(_0x58797d){_0x1d4043[_0x0072('0x21')]=_0x58797d;if(_0xd9571e[_0x0072('0x2f')]['includeAll']){_0x37fa46[_0x0072('0x45')]=[{'all':!![]}];}return db[_0x0072('0x43')]['findAll'](_0x37fa46);})[_0x0072('0x29')](function(_0x5d1fae){_0x1d4043[_0x0072('0x47')]=_0x5d1fae;return _0x1d4043;})[_0x0072('0x29')](respondWithFilteredResult(_0x2457fa,_0x37fa46,_0x0072('0x4f')))[_0x0072('0x4a')](handleError(_0x2457fa,null,_0x0072('0x4f')));}; \ No newline at end of file +var _0x8128=['findAll','rows','params','rawAttributes','includeAll','catch','create','body','find','describe','hasOwnProperty','order','getVoiceQueuesReport','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','VoiceQueueReport','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','count','include'];(function(_0xb688f4,_0x3c3956){var _0x5ed03f=function(_0x2ddce3){while(--_0x2ddce3){_0xb688f4['push'](_0xb688f4['shift']());}};_0x5ed03f(++_0x3c3956);}(_0x8128,0x165));var _0x8812=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x8128[_0x4f9b18];return _0x29f20c;};'use strict';var pdf=require(_0x8812('0x0'));var emlformat=require(_0x8812('0x1'));var rimraf=require(_0x8812('0x2'));var zipdir=require(_0x8812('0x3'));var jsonpatch=require(_0x8812('0x4'));var rp=require(_0x8812('0x5'));var moment=require(_0x8812('0x6'));var BPromise=require(_0x8812('0x7'));var Mustache=require(_0x8812('0x8'));var util=require(_0x8812('0x9'));var path=require(_0x8812('0xa'));var sox=require(_0x8812('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8812('0xc'));var squel=require(_0x8812('0xd'));var crypto=require(_0x8812('0xe'));var jsforce=require(_0x8812('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8812('0x10'));var querystring=require(_0x8812('0x11'));var Papa=require(_0x8812('0x12'));var authService=require(_0x8812('0x13'));var hardwareService=require(_0x8812('0x14'));var Redis=require(_0x8812('0x15'));var qs=require(_0x8812('0x16'));var logger=require('../../config/logger')(_0x8812('0x17'));var utils=require(_0x8812('0x18'));var config=require(_0x8812('0x19'));var db=require(_0x8812('0x1a'))['db'];config[_0x8812('0x1b')]=_[_0x8812('0x1c')](config[_0x8812('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x8812('0x1d'))(new Redis(config[_0x8812('0x1b')]));require(_0x8812('0x1e'))[_0x8812('0x1f')](socket);function respondWithStatusCode(_0x6e52af,_0x3f935c){_0x3f935c=_0x3f935c||0xcc;return function(_0x4adeac){if(_0x4adeac){return _0x6e52af[_0x8812('0x20')](_0x3f935c);}return _0x6e52af[_0x8812('0x21')](_0x3f935c)['end']();};}function respondWithResult(_0x42c746,_0x3f3466){_0x3f3466=_0x3f3466||0xc8;return function(_0x4115ed){if(_0x4115ed){return _0x42c746['status'](_0x3f3466)[_0x8812('0x22')](_0x4115ed);}};}function respondWithFilteredResult(_0x3d8ac6,_0x4f7f4b){return function(_0xf348ee){if(_0xf348ee){var _0x88a8ca=_0xf348ee['count'],_0x129c0a=_0x4f7f4b[_0x8812('0x23')],_0x456c2d=_0x4f7f4b['offset']+_0x4f7f4b[_0x8812('0x24')],_0x48df40;if(_0x456c2d>=_0x88a8ca){_0x456c2d=_0x88a8ca;_0x48df40=0xc8;}else{_0x48df40=0xce;}_0x3d8ac6[_0x8812('0x21')](_0x48df40);return _0x3d8ac6[_0x8812('0x25')]('Content-Range',_0x129c0a+'-'+_0x456c2d+'/'+_0x88a8ca)[_0x8812('0x22')](_0xf348ee);}return null;};}function patchUpdates(_0x7ce498){return function(_0x450832){try{jsonpatch[_0x8812('0x26')](_0x450832,_0x7ce498,!![]);}catch(_0x32e4b9){return BPromise[_0x8812('0x27')](_0x32e4b9);}return _0x450832[_0x8812('0x28')]();};}function saveUpdates(_0xa6b17e,_0x53bddd){return function(_0x3c9212){if(_0x3c9212){return _0x3c9212[_0x8812('0x29')](_0xa6b17e)[_0x8812('0x2a')](function(_0x359ba6){return _0x359ba6;});}return null;};}function removeEntity(_0x23b19b,_0x30fe31){return function(_0x19b067){if(_0x19b067){return _0x19b067[_0x8812('0x2b')]()[_0x8812('0x2a')](function(){_0x23b19b['status'](0xcc)[_0x8812('0x2c')]();});}};}function handleEntityNotFound(_0x875ced,_0x36eadc){return function(_0x3ae887){if(!_0x3ae887){_0x875ced[_0x8812('0x20')](0x194);}return _0x3ae887;};}function handleError(_0x40b239,_0x8d9f96){_0x8d9f96=_0x8d9f96||0x1f4;return function(_0x2e1a3c){logger[_0x8812('0x2d')](_0x2e1a3c[_0x8812('0x2e')]);if(_0x2e1a3c[_0x8812('0x2f')]){delete _0x2e1a3c[_0x8812('0x2f')];}_0x40b239[_0x8812('0x21')](_0x8d9f96)[_0x8812('0x30')](_0x2e1a3c);};}exports[_0x8812('0x31')]=function(_0x1dca1f,_0xa34015){var _0x8f66a8={},_0x145618={},_0x170385={'count':0x0,'rows':[]};var _0x18c293=db[_0x8812('0x32')]['rawAttributes'];_0x145618[_0x8812('0x33')]=_[_0x8812('0x34')](_0x18c293);_0x145618['query']=_[_0x8812('0x34')](_0x1dca1f[_0x8812('0x35')]);_0x145618[_0x8812('0x36')]=_[_0x8812('0x37')](_0x145618[_0x8812('0x33')],_0x145618['query']);_0x8f66a8['attributes']=_[_0x8812('0x37')](_0x145618['model'],qs['fields'](_0x1dca1f[_0x8812('0x35')][_0x8812('0x38')]));_0x8f66a8[_0x8812('0x39')]=_0x8f66a8['attributes'][_0x8812('0x3a')]?_0x8f66a8[_0x8812('0x39')]:_0x145618['model'];if(!_0x1dca1f[_0x8812('0x35')]['hasOwnProperty'](_0x8812('0x3b'))){_0x8f66a8['limit']=qs[_0x8812('0x24')](_0x1dca1f[_0x8812('0x35')][_0x8812('0x24')]);_0x8f66a8[_0x8812('0x23')]=qs[_0x8812('0x23')](_0x1dca1f[_0x8812('0x35')][_0x8812('0x23')]);}_0x8f66a8['order']=qs[_0x8812('0x3c')](_0x1dca1f[_0x8812('0x35')][_0x8812('0x3c')]);_0x8f66a8[_0x8812('0x3d')]=qs[_0x8812('0x36')](_[_0x8812('0x3e')](_0x1dca1f[_0x8812('0x35')],_0x145618[_0x8812('0x36')]));if(_0x1dca1f[_0x8812('0x35')]['filter']){_0x8f66a8[_0x8812('0x3d')]=_[_0x8812('0x3f')](_0x8f66a8[_0x8812('0x3d')],{'$or':_[_0x8812('0x40')](_0x18c293,function(_0x118c01){if(_0x118c01[_0x8812('0x41')][_0x8812('0x42')]!==_0x8812('0x43')){var _0x5a675d={};_0x5a675d[_0x118c01[_0x8812('0x44')]]={'$like':'%'+_0x1dca1f[_0x8812('0x35')][_0x8812('0x45')]+'%'};return _0x5a675d;}})});}_0x8f66a8=_['merge']({},_0x8f66a8,_0x1dca1f[_0x8812('0x46')]);var _0x36bbe0={'where':_0x8f66a8[_0x8812('0x3d')]};return db[_0x8812('0x32')][_0x8812('0x47')](_0x36bbe0)[_0x8812('0x2a')](function(_0x572b87){_0x170385[_0x8812('0x47')]=_0x572b87;if(_0x1dca1f[_0x8812('0x35')]['includeAll']){_0x8f66a8[_0x8812('0x48')]=[{'all':!![]}];}return db[_0x8812('0x32')][_0x8812('0x49')](_0x8f66a8);})[_0x8812('0x2a')](function(_0x6d5efc){_0x170385[_0x8812('0x4a')]=_0x6d5efc;return _0x170385;})['then'](respondWithFilteredResult(_0xa34015,_0x8f66a8))['catch'](handleError(_0xa34015,null));};exports['show']=function(_0x2268fe,_0x2b1ed0){var _0x40b1d1={'raw':![],'where':{'id':_0x2268fe[_0x8812('0x4b')]['id']}},_0x2a9205={};_0x2a9205['model']=_[_0x8812('0x34')](db[_0x8812('0x32')][_0x8812('0x4c')]);_0x2a9205[_0x8812('0x35')]=_[_0x8812('0x34')](_0x2268fe['query']);_0x2a9205[_0x8812('0x36')]=_[_0x8812('0x37')](_0x2a9205[_0x8812('0x33')],_0x2a9205['query']);_0x40b1d1[_0x8812('0x39')]=_[_0x8812('0x37')](_0x2a9205[_0x8812('0x33')],qs[_0x8812('0x38')](_0x2268fe[_0x8812('0x35')][_0x8812('0x38')]));_0x40b1d1['attributes']=_0x40b1d1[_0x8812('0x39')]['length']?_0x40b1d1[_0x8812('0x39')]:_0x2a9205['model'];if(_0x2268fe[_0x8812('0x35')][_0x8812('0x4d')]){_0x40b1d1[_0x8812('0x48')]=[{'all':!![]}];}_0x40b1d1=_[_0x8812('0x3f')]({},_0x40b1d1,_0x2268fe[_0x8812('0x46')]);return db[_0x8812('0x32')]['find'](_0x40b1d1)[_0x8812('0x2a')](handleEntityNotFound(_0x2b1ed0,null))['then'](respondWithResult(_0x2b1ed0,null))[_0x8812('0x4e')](handleError(_0x2b1ed0,null));};exports[_0x8812('0x4f')]=function(_0x389ccd,_0x37d7d6){return db[_0x8812('0x32')][_0x8812('0x4f')](_0x389ccd[_0x8812('0x50')],{})[_0x8812('0x2a')](respondWithResult(_0x37d7d6,0xc9))['catch'](handleError(_0x37d7d6,null));};exports[_0x8812('0x29')]=function(_0x30dc72,_0x4b2852){if(_0x30dc72[_0x8812('0x50')]['id']){delete _0x30dc72['body']['id'];}return db[_0x8812('0x32')][_0x8812('0x51')]({'where':{'id':_0x30dc72[_0x8812('0x4b')]['id']}})[_0x8812('0x2a')](handleEntityNotFound(_0x4b2852,null))['then'](saveUpdates(_0x30dc72[_0x8812('0x50')],null))[_0x8812('0x2a')](respondWithResult(_0x4b2852,null))[_0x8812('0x4e')](handleError(_0x4b2852,null));};exports[_0x8812('0x2b')]=function(_0x219c17,_0x4ab6c7){return db[_0x8812('0x32')][_0x8812('0x51')]({'where':{'id':_0x219c17[_0x8812('0x4b')]['id']}})[_0x8812('0x2a')](handleEntityNotFound(_0x4ab6c7,null))[_0x8812('0x2a')](removeEntity(_0x4ab6c7,null))['catch'](handleError(_0x4ab6c7,null));};exports[_0x8812('0x52')]=function(_0x5085ca,_0x192cee){return db[_0x8812('0x32')][_0x8812('0x52')]()[_0x8812('0x2a')](respondWithResult(_0x192cee,null))[_0x8812('0x4e')](handleError(_0x192cee,null));};exports['getVoiceQueuesReport']=function(_0x40910c,_0x313ef3){var _0x3f768c={},_0x11bd88={},_0x47ab65={'count':0x0,'rows':[]};_0x11bd88[_0x8812('0x33')]=_[_0x8812('0x34')](db[_0x8812('0x32')]['rawAttributes']);_0x11bd88[_0x8812('0x35')]=_[_0x8812('0x34')](_0x40910c[_0x8812('0x35')]);_0x11bd88[_0x8812('0x36')]=_[_0x8812('0x37')](_0x11bd88[_0x8812('0x33')],_0x11bd88[_0x8812('0x35')]);_0x3f768c[_0x8812('0x39')]=_[_0x8812('0x37')](_0x11bd88[_0x8812('0x33')],qs[_0x8812('0x38')](_0x40910c[_0x8812('0x35')][_0x8812('0x38')]));_0x3f768c[_0x8812('0x39')]=_0x3f768c[_0x8812('0x39')][_0x8812('0x3a')]?_0x3f768c[_0x8812('0x39')]:_0x11bd88[_0x8812('0x33')];if(!_0x40910c[_0x8812('0x35')][_0x8812('0x53')](_0x8812('0x3b'))){_0x3f768c[_0x8812('0x24')]=qs[_0x8812('0x24')](_0x40910c[_0x8812('0x35')][_0x8812('0x24')]);_0x3f768c['offset']=qs[_0x8812('0x23')](_0x40910c[_0x8812('0x35')][_0x8812('0x23')]);}_0x3f768c[_0x8812('0x54')]=qs[_0x8812('0x3c')](_0x40910c[_0x8812('0x35')][_0x8812('0x3c')]);_0x3f768c['where']=qs[_0x8812('0x36')](_[_0x8812('0x3e')](_0x40910c[_0x8812('0x35')],_0x11bd88[_0x8812('0x36')]));if(_0x40910c[_0x8812('0x35')][_0x8812('0x45')]){_0x3f768c[_0x8812('0x3d')]=_[_0x8812('0x3f')](_0x3f768c[_0x8812('0x3d')],{'$or':_[_0x8812('0x40')](_0x3f768c[_0x8812('0x39')],function(_0xb514e9){var _0x42a648={};_0x42a648[_0xb514e9]={'$like':'%'+_0x40910c[_0x8812('0x35')][_0x8812('0x45')]+'%'};return _0x42a648;})});}_0x3f768c=_['merge']({},_0x3f768c,_0x40910c[_0x8812('0x46')]);var _0x31b5ae={'where':_0x3f768c['where']};return db[_0x8812('0x32')][_0x8812('0x47')](_0x31b5ae)[_0x8812('0x2a')](function(_0x370919){_0x47ab65[_0x8812('0x47')]=_0x370919;if(_0x40910c[_0x8812('0x35')]['includeAll']){_0x3f768c[_0x8812('0x48')]=[{'all':!![]}];}return db[_0x8812('0x32')][_0x8812('0x49')](_0x3f768c);})[_0x8812('0x2a')](function(_0x1ee33b){_0x47ab65[_0x8812('0x4a')]=_0x1ee33b;return _0x47ab65;})[_0x8812('0x2a')](respondWithFilteredResult(_0x313ef3,_0x3f768c,_0x8812('0x55')))[_0x8812('0x4e')](handleError(_0x313ef3,null,_0x8812('0x55')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 2c66f3e..1ec1674 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 _0x9496=['hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x38debb,_0x57e1cd){var _0x2afcbe=function(_0x526e19){while(--_0x526e19){_0x38debb['push'](_0x38debb['shift']());}};_0x2afcbe(++_0x57e1cd);}(_0x9496,0xe8));var _0x6949=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x9496[_0x11005e];return _0x29338f;};'use strict';var EventEmitter=require(_0x6949('0x0'));var VoiceQueueReport=require(_0x6949('0x1'))['db'][_0x6949('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6949('0x3')](0x0);var events={'afterCreate':_0x6949('0x4'),'afterUpdate':_0x6949('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3b5b30){return function(_0x283d3a,_0xfcbc33,_0xb29f58){VoiceQueueReportEvents['emit'](_0x3b5b30+':'+_0x283d3a['id'],_0x283d3a);VoiceQueueReportEvents[_0x6949('0x6')](_0x3b5b30,_0x283d3a);_0xb29f58(null);};}for(var e in events){if(events[_0x6949('0x7')](e)){var event=events[e];VoiceQueueReport[_0x6949('0x8')](e,emitEvent(event));}}module[_0x6949('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x18e6=['hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0x2e94d3,_0x5a2d32){var _0x32e202=function(_0x57625b){while(--_0x57625b){_0x2e94d3['push'](_0x2e94d3['shift']());}};_0x32e202(++_0x5a2d32);}(_0x18e6,0x66));var _0x618e=function(_0x1fe265,_0x1e11d9){_0x1fe265=_0x1fe265-0x0;var _0x5d0baf=_0x18e6[_0x1fe265];return _0x5d0baf;};'use strict';var EventEmitter=require(_0x618e('0x0'));var VoiceQueueReport=require(_0x618e('0x1'))['db'][_0x618e('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x618e('0x3')](0x0);var events={'afterCreate':_0x618e('0x4'),'afterUpdate':_0x618e('0x5'),'afterDestroy':_0x618e('0x6')};function emitEvent(_0x569925){return function(_0x30de9a,_0x131a6e,_0x23fa6f){VoiceQueueReportEvents[_0x618e('0x7')](_0x569925+':'+_0x30de9a['id'],_0x30de9a);VoiceQueueReportEvents[_0x618e('0x7')](_0x569925,_0x30de9a);_0x23fa6f(null);};}for(var e in events){if(events[_0x618e('0x8')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x618e('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index a84b877..699f15f 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 _0x484e=['request-promise','./voiceQueueReport.attributes','exports','VoiceQueueReport','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x3c098f,_0x54df80){var _0x40d28=function(_0x17b77e){while(--_0x17b77e){_0x3c098f['push'](_0x3c098f['shift']());}};_0x40d28(++_0x54df80);}(_0x484e,0xc3));var _0xe484=function(_0x34b87c,_0x583aff){_0x34b87c=_0x34b87c-0x0;var _0x201cc5=_0x484e[_0x34b87c];return _0x201cc5;};'use strict';var _=require(_0xe484('0x0'));var util=require(_0xe484('0x1'));var logger=require('../../config/logger')(_0xe484('0x2'));var moment=require(_0xe484('0x3'));var BPromise=require(_0xe484('0x4'));var rp=require(_0xe484('0x5'));var attributes=require(_0xe484('0x6'));module[_0xe484('0x7')]=function(_0x109ce0,_0x351eee){return _0x109ce0['define'](_0xe484('0x8'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xe484('0x9')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d2a=['exports','define','VoiceQueueReport','uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird','request-promise','./voiceQueueReport.attributes'];(function(_0x2af75e,_0x12570b){var _0x169494=function(_0x413b92){while(--_0x413b92){_0x2af75e['push'](_0x2af75e['shift']());}};_0x169494(++_0x12570b);}(_0x3d2a,0xc5));var _0xa3d2=function(_0x362882,_0x3012cf){_0x362882=_0x362882-0x0;var _0x4632c9=_0x3d2a[_0x362882];return _0x4632c9;};'use strict';var _=require('lodash');var util=require(_0xa3d2('0x0'));var logger=require(_0xa3d2('0x1'))(_0xa3d2('0x2'));var moment=require(_0xa3d2('0x3'));var BPromise=require(_0xa3d2('0x4'));var rp=require(_0xa3d2('0x5'));var attributes=require(_0xa3d2('0x6'));module[_0xa3d2('0x7')]=function(_0x41e8ec,_0x6347fc){return _0x41e8ec[_0xa3d2('0x8')](_0xa3d2('0x9'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xa3d2('0xa')]},{'fields':[_0xa3d2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index bb730ca..ce99560 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 _0x6a66=['../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','./voiceQueueReport.socket','register','then','request\x20sent','debug','error','code','message','VoiceQueueReport,\x20%s,\x20%s','info','result','catch','VoiceQueueReport','findAll','raw','options','where','attributes','limit','include','map','model','GetVoiceQueueReport','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','stringify','moment','bluebird','randomstring','../../mysqldb'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x6a66,0xa0));var _0x66a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a66[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x66a6('0x0'));var BPromise=require(_0x66a6('0x1'));var rs=require(_0x66a6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66a6('0x3'))['db'];var utils=require(_0x66a6('0x4'));var logger=require(_0x66a6('0x5'))(_0x66a6('0x6'));var config=require(_0x66a6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x66a6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x66a6('0x9')](config[_0x66a6('0xa')],{'host':_0x66a6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66a6('0xa')]));require(_0x66a6('0xc'))[_0x66a6('0xd')](socket);function respondWithRpcPromise(_0x468db6,_0x1f54a9,_0x3b32cf){return new BPromise(function(_0x18e52d,_0x43af9e){return client['request'](_0x468db6,_0x3b32cf)[_0x66a6('0xe')](function(_0x43a0c6){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x1f54a9,_0x66a6('0xf'));logger[_0x66a6('0x10')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1f54a9,_0x66a6('0xf'),JSON['stringify'](_0x43a0c6));if(_0x43a0c6[_0x66a6('0x11')]){if(_0x43a0c6['error'][_0x66a6('0x12')]===0x1f4){logger[_0x66a6('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x1f54a9,_0x43a0c6['error'][_0x66a6('0x13')]);return _0x43af9e(_0x43a0c6[_0x66a6('0x11')]['message']);}logger[_0x66a6('0x11')](_0x66a6('0x14'),_0x1f54a9,_0x43a0c6['error'][_0x66a6('0x13')]);return _0x18e52d(_0x43a0c6[_0x66a6('0x11')][_0x66a6('0x13')]);}else{logger[_0x66a6('0x15')](_0x66a6('0x14'),_0x1f54a9,'request\x20sent');_0x18e52d(_0x43a0c6[_0x66a6('0x16')][_0x66a6('0x13')]);}})[_0x66a6('0x17')](function(_0x83486c){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x1f54a9,_0x83486c);_0x43af9e(_0x83486c);});});}exports['GetVoiceQueueReport']=function(_0x2f28ed){var _0x35ef8e=this;return new Promise(function(_0x4de152,_0x2b25ef){return db[_0x66a6('0x18')][_0x66a6('0x19')]({'raw':_0x2f28ed['options']?_0x2f28ed['options'][_0x66a6('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f28ed[_0x66a6('0x1b')]?_0x2f28ed[_0x66a6('0x1b')][_0x66a6('0x1c')]||null:null,'attributes':_0x2f28ed['options']?_0x2f28ed[_0x66a6('0x1b')][_0x66a6('0x1d')]||null:null,'limit':_0x2f28ed[_0x66a6('0x1b')]?_0x2f28ed[_0x66a6('0x1b')][_0x66a6('0x1e')]||null:null,'include':_0x2f28ed[_0x66a6('0x1b')]?_0x2f28ed['options'][_0x66a6('0x1f')]?_[_0x66a6('0x20')](_0x2f28ed[_0x66a6('0x1b')][_0x66a6('0x1f')],function(_0x2dbf44){return{'model':db[_0x2dbf44[_0x66a6('0x21')]],'as':_0x2dbf44['as'],'attributes':_0x2dbf44[_0x66a6('0x1d')],'include':_0x2dbf44[_0x66a6('0x1f')]?_['map'](_0x2dbf44['include'],function(_0x2110cd){return{'model':db[_0x2110cd[_0x66a6('0x21')]],'as':_0x2110cd['as'],'attributes':_0x2110cd[_0x66a6('0x1d')],'include':_0x2110cd[_0x66a6('0x1f')]?_['map'](_0x2110cd[_0x66a6('0x1f')],function(_0x3eacf7){return{'model':db[_0x3eacf7[_0x66a6('0x21')]],'as':_0x3eacf7['as'],'attributes':_0x3eacf7['attributes']};}):[]};}):[]};}):[]:[]})[_0x66a6('0xe')](function(_0x13c87c){logger[_0x66a6('0x15')](_0x66a6('0x22'),_0x2f28ed);logger[_0x66a6('0x10')](_0x66a6('0x22'),_0x2f28ed,JSON['stringify'](_0x13c87c));_0x4de152(_0x13c87c);})[_0x66a6('0x17')](function(_0x5cd586){logger['error'](_0x66a6('0x22'),_0x5cd586[_0x66a6('0x13')],_0x2f28ed);_0x2b25ef(_0x35ef8e[_0x66a6('0x11')](0x1f4,_0x5cd586[_0x66a6('0x13')]));});});};exports['CreateVoiceQueueReport']=function(_0xe7ed5e){var _0x2dbe55=this;return new Promise(function(_0x4bc6a8,_0x36b8f0){return db[_0x66a6('0x18')][_0x66a6('0x23')](_0xe7ed5e[_0x66a6('0x24')],{'raw':_0xe7ed5e[_0x66a6('0x1b')]?_0xe7ed5e['options']['raw']===undefined?!![]:![]:!![]})[_0x66a6('0xe')](function(_0x948087){logger[_0x66a6('0x15')](_0x66a6('0x25'),_0xe7ed5e);logger['debug'](_0x66a6('0x25'),_0xe7ed5e,JSON['stringify'](_0x948087));_0x4bc6a8(_0x948087);})[_0x66a6('0x17')](function(_0xaefabc){logger[_0x66a6('0x11')](_0x66a6('0x25'),_0xaefabc[_0x66a6('0x13')],_0xe7ed5e);_0x36b8f0(_0x2dbe55[_0x66a6('0x11')](0x1f4,_0xaefabc[_0x66a6('0x13')]));});});};exports[_0x66a6('0x26')]=function(_0x46fd85){var _0x3769f5=this;return new Promise(function(_0x27ef25,_0x3977c2){return db[_0x66a6('0x18')][_0x66a6('0x27')](_0x46fd85['body'],{'raw':_0x46fd85[_0x66a6('0x1b')]?_0x46fd85[_0x66a6('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46fd85[_0x66a6('0x1b')]?_0x46fd85[_0x66a6('0x1b')]['where']||null:null,'attributes':_0x46fd85[_0x66a6('0x1b')]?_0x46fd85['options']['attributes']||null:null,'limit':_0x46fd85[_0x66a6('0x1b')]?_0x46fd85['options'][_0x66a6('0x1e')]||null:null})[_0x66a6('0xe')](function(_0x20722d){logger[_0x66a6('0x15')](_0x66a6('0x26'),_0x46fd85);logger['debug'](_0x66a6('0x26'),_0x46fd85,JSON[_0x66a6('0x28')](_0x20722d));_0x27ef25(_0x20722d);})['catch'](function(_0x2ef0f3){logger[_0x66a6('0x11')]('UpdateVoiceQueueReport',_0x2ef0f3[_0x66a6('0x13')],_0x46fd85);_0x3977c2(_0x3769f5['error'](0x1f4,_0x2ef0f3[_0x66a6('0x13')]));});});}; \ No newline at end of file +var _0x81a7=['lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','defaults','redis','register','request','then','info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','findAll','raw','options','where','attributes','limit','include','map','model','debug','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update'];(function(_0x4ec13d,_0x358a8f){var _0x3c3fa7=function(_0x2615f6){while(--_0x2615f6){_0x4ec13d['push'](_0x4ec13d['shift']());}};_0x3c3fa7(++_0x358a8f);}(_0x81a7,0x168));var _0x781a=function(_0x1c9cef,_0x51f7c7){_0x1c9cef=_0x1c9cef-0x0;var _0x5dba03=_0x81a7[_0x1c9cef];return _0x5dba03;};'use strict';var _=require(_0x781a('0x0'));var util=require(_0x781a('0x1'));var moment=require(_0x781a('0x2'));var BPromise=require('bluebird');var rs=require(_0x781a('0x3'));var fs=require('fs');var Redis=require(_0x781a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x781a('0x5'))(_0x781a('0x6'));var config=require('../../config/environment');var jayson=require(_0x781a('0x7'));var client=jayson['client'][_0x781a('0x8')]({'port':0x232a});config['redis']=_[_0x781a('0x9')](config[_0x781a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x781a('0xb')](socket);function respondWithRpcPromise(_0x5bd7fa,_0x37628d,_0x23c2c2){return new BPromise(function(_0x5e17a9,_0x58744c){return client[_0x781a('0xc')](_0x5bd7fa,_0x23c2c2)[_0x781a('0xd')](function(_0x36a6af){logger[_0x781a('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x37628d,_0x781a('0xf'));logger['debug'](_0x781a('0x10'),_0x37628d,_0x781a('0xf'),JSON[_0x781a('0x11')](_0x36a6af));if(_0x36a6af[_0x781a('0x12')]){if(_0x36a6af[_0x781a('0x12')][_0x781a('0x13')]===0x1f4){logger[_0x781a('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x37628d,_0x36a6af[_0x781a('0x12')][_0x781a('0x14')]);return _0x58744c(_0x36a6af[_0x781a('0x12')][_0x781a('0x14')]);}logger[_0x781a('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x37628d,_0x36a6af[_0x781a('0x12')][_0x781a('0x14')]);return _0x5e17a9(_0x36a6af[_0x781a('0x12')][_0x781a('0x14')]);}else{logger[_0x781a('0xe')]('VoiceQueueReport,\x20%s,\x20%s',_0x37628d,_0x781a('0xf'));_0x5e17a9(_0x36a6af[_0x781a('0x15')][_0x781a('0x14')]);}})[_0x781a('0x16')](function(_0x48bae8){logger[_0x781a('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x37628d,_0x48bae8);_0x58744c(_0x48bae8);});});}exports[_0x781a('0x17')]=function(_0x2c73af){var _0xaa74cb=this;return new Promise(function(_0x598030,_0x1d916c){return db['VoiceQueueReport'][_0x781a('0x18')]({'raw':_0x2c73af['options']?_0x2c73af['options'][_0x781a('0x19')]===undefined?!![]:![]:!![],'where':_0x2c73af[_0x781a('0x1a')]?_0x2c73af[_0x781a('0x1a')][_0x781a('0x1b')]||null:null,'attributes':_0x2c73af[_0x781a('0x1a')]?_0x2c73af['options'][_0x781a('0x1c')]||null:null,'limit':_0x2c73af[_0x781a('0x1a')]?_0x2c73af[_0x781a('0x1a')][_0x781a('0x1d')]||null:null,'include':_0x2c73af[_0x781a('0x1a')]?_0x2c73af[_0x781a('0x1a')][_0x781a('0x1e')]?_[_0x781a('0x1f')](_0x2c73af[_0x781a('0x1a')][_0x781a('0x1e')],function(_0x45e038){return{'model':db[_0x45e038[_0x781a('0x20')]],'as':_0x45e038['as'],'attributes':_0x45e038[_0x781a('0x1c')],'include':_0x45e038[_0x781a('0x1e')]?_['map'](_0x45e038['include'],function(_0x12c083){return{'model':db[_0x12c083[_0x781a('0x20')]],'as':_0x12c083['as'],'attributes':_0x12c083[_0x781a('0x1c')],'include':_0x12c083[_0x781a('0x1e')]?_[_0x781a('0x1f')](_0x12c083[_0x781a('0x1e')],function(_0x2fbc93){return{'model':db[_0x2fbc93[_0x781a('0x20')]],'as':_0x2fbc93['as'],'attributes':_0x2fbc93['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x20ce6f){logger[_0x781a('0xe')]('GetVoiceQueueReport',_0x2c73af);logger[_0x781a('0x21')]('GetVoiceQueueReport',_0x2c73af,JSON[_0x781a('0x11')](_0x20ce6f));_0x598030(_0x20ce6f);})[_0x781a('0x16')](function(_0x141e30){logger['error'](_0x781a('0x17'),_0x141e30[_0x781a('0x14')],_0x2c73af);_0x1d916c(_0xaa74cb[_0x781a('0x12')](0x1f4,_0x141e30['message']));});});};exports[_0x781a('0x22')]=function(_0x4efe13){var _0x49d27c=this;return new Promise(function(_0x20f07b,_0x41e5a6){return db[_0x781a('0x23')][_0x781a('0x24')](_0x4efe13[_0x781a('0x25')],{'raw':_0x4efe13[_0x781a('0x1a')]?_0x4efe13[_0x781a('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x781a('0xd')](function(_0x1d7ff1){logger[_0x781a('0xe')](_0x781a('0x22'),_0x4efe13);logger[_0x781a('0x21')](_0x781a('0x22'),_0x4efe13,JSON[_0x781a('0x11')](_0x1d7ff1));_0x20f07b(_0x1d7ff1);})[_0x781a('0x16')](function(_0x19bf97){logger[_0x781a('0x12')](_0x781a('0x22'),_0x19bf97[_0x781a('0x14')],_0x4efe13);_0x41e5a6(_0x49d27c[_0x781a('0x12')](0x1f4,_0x19bf97[_0x781a('0x14')]));});});};exports[_0x781a('0x26')]=function(_0x6ee5d9){var _0x37364d=this;return new Promise(function(_0x25a27a,_0x418cd2){return db[_0x781a('0x23')][_0x781a('0x27')](_0x6ee5d9['body'],{'raw':_0x6ee5d9['options']?_0x6ee5d9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6ee5d9[_0x781a('0x1a')]?_0x6ee5d9[_0x781a('0x1a')][_0x781a('0x1b')]||null:null,'attributes':_0x6ee5d9[_0x781a('0x1a')]?_0x6ee5d9[_0x781a('0x1a')]['attributes']||null:null,'limit':_0x6ee5d9['options']?_0x6ee5d9[_0x781a('0x1a')][_0x781a('0x1d')]||null:null})['then'](function(_0x103267){logger[_0x781a('0xe')](_0x781a('0x26'),_0x6ee5d9);logger[_0x781a('0x21')]('UpdateVoiceQueueReport',_0x6ee5d9,JSON[_0x781a('0x11')](_0x103267));_0x25a27a(_0x103267);})[_0x781a('0x16')](function(_0x2f7b27){logger[_0x781a('0x12')](_0x781a('0x26'),_0x2f7b27[_0x781a('0x14')],_0x6ee5d9);_0x418cd2(_0x37364d[_0x781a('0x12')](0x1f4,_0x2f7b27['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 05e4e5a..aa06e4c 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 _0x7c74=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0x7c74,0x79));var _0x47c7=function(_0xe51920,_0x4a1092){_0xe51920=_0xe51920-0x0;var _0x4e4c70=_0x7c74[_0xe51920];return _0x4e4c70;};'use strict';var VoiceQueueReportEvents=require(_0x47c7('0x0'));var events=[_0x47c7('0x1'),_0x47c7('0x2'),_0x47c7('0x3')];function createListener(_0x1fbf76,_0x1e6f9d){return function(_0x349467){_0x1e6f9d[_0x47c7('0x4')](_0x1fbf76,_0x349467);};}function removeListener(_0x3e1376,_0x68be71){return function(){VoiceQueueReportEvents[_0x47c7('0x5')](_0x3e1376,_0x68be71);};}exports[_0x47c7('0x6')]=function(_0x2108b6){for(var _0x2b3d08=0x0,_0x1a9dc6=events[_0x47c7('0x7')];_0x2b3d08<_0x1a9dc6;_0x2b3d08++){var _0x3aff01=events[_0x2b3d08];var _0x38d14a=createListener(_0x47c7('0x8')+_0x3aff01,_0x2108b6);VoiceQueueReportEvents['on'](_0x3aff01,_0x38d14a);}}; \ No newline at end of file +var _0x2ba6=['register','length','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2ba6,0x1ea));var _0x62ba=function(_0x46d0d8,_0x36c439){_0x46d0d8=_0x46d0d8-0x0;var _0x4ebb3b=_0x2ba6[_0x46d0d8];return _0x4ebb3b;};'use strict';var VoiceQueueReportEvents=require(_0x62ba('0x0'));var events=[_0x62ba('0x1'),_0x62ba('0x2'),_0x62ba('0x3')];function createListener(_0x44c939,_0x49a26c){return function(_0xf21fcc){_0x49a26c[_0x62ba('0x4')](_0x44c939,_0xf21fcc);};}function removeListener(_0x19316d,_0x362f2c){return function(){VoiceQueueReportEvents[_0x62ba('0x5')](_0x19316d,_0x362f2c);};}exports[_0x62ba('0x6')]=function(_0x57d9f9){for(var _0x304c4b=0x0,_0x24c78a=events[_0x62ba('0x7')];_0x304c4b<_0x24c78a;_0x304c4b++){var _0x4c1b10=events[_0x304c4b];var _0xa8dec7=createListener('voiceQueueReport:'+_0x4c1b10,_0x57d9f9);VoiceQueueReportEvents['on'](_0x4c1b10,_0xa8dec7);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c042562..cbf1004 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 _0x598a=['express','../../components/auth/service','get','isAuthenticated','index','/:id','post','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x10d43f,_0x581a49){var _0x32fe4d=function(_0x268f78){while(--_0x268f78){_0x10d43f['push'](_0x10d43f['shift']());}};_0x32fe4d(++_0x581a49);}(_0x598a,0xfb));var _0xa598=function(_0x4a174e,_0x2a42f7){_0x4a174e=_0x4a174e-0x0;var _0x388df2=_0x598a[_0x4a174e];return _0x388df2;};'use strict';var multer=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var path=require(_0xa598('0x2'));var timeout=require(_0xa598('0x3'));var express=require(_0xa598('0x4'));var router=express['Router']();var auth=require(_0xa598('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0xa598('0x6')]('/',auth[_0xa598('0x7')](),controller[_0xa598('0x8')]);router[_0xa598('0x6')](_0xa598('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xa598('0xa')]('/',auth[_0xa598('0x7')](),controller[_0xa598('0xb')]);router[_0xa598('0xc')](_0xa598('0x9'),auth[_0xa598('0x7')](),controller['update']);router['delete'](_0xa598('0x9'),auth[_0xa598('0x7')](),controller[_0xa598('0xd')]);module[_0xa598('0xe')]=router; \ No newline at end of file +var _0xe062=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x80f51a,_0x32e95e){var _0x327148=function(_0x16f788){while(--_0x16f788){_0x80f51a['push'](_0x80f51a['shift']());}};_0x327148(++_0x32e95e);}(_0xe062,0x1b8));var _0x2e06=function(_0x4ed59a,_0x9dd1af){_0x4ed59a=_0x4ed59a-0x0;var _0x485566=_0xe062[_0x4ed59a];return _0x485566;};'use strict';var multer=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2e06('0x2'));var router=express[_0x2e06('0x3')]();var auth=require(_0x2e06('0x4'));var interaction=require(_0x2e06('0x5'));var config=require(_0x2e06('0x6'));var controller=require(_0x2e06('0x7'));router[_0x2e06('0x8')]('/',auth[_0x2e06('0x9')](),controller[_0x2e06('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2e06('0xb')]('/',auth[_0x2e06('0x9')](),controller['create']);router['put'](_0x2e06('0xc'),auth[_0x2e06('0x9')](),controller[_0x2e06('0xd')]);router[_0x2e06('0xe')](_0x2e06('0xc'),auth[_0x2e06('0x9')](),controller[_0x2e06('0xf')]);module[_0x2e06('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index e79ef9c..fea9d93 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 _0x84ab=['exports','STRING','format','sequelize','moment'];(function(_0xeead8a,_0x3d2400){var _0x24742c=function(_0x1e357a){while(--_0x1e357a){_0xeead8a['push'](_0xeead8a['shift']());}};_0x24742c(++_0x3d2400);}(_0x84ab,0x12f));var _0xb84a=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x84ab[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0xb84a('0x0'));var moment=require(_0xb84a('0x1'));module[_0xb84a('0x2')]={'time':{'type':Sequelize[_0xb84a('0x3')]},'callid':{'type':Sequelize[_0xb84a('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb84a('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb84a('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb84a('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb84a('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb84a('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xb84a('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0xeec6=['sequelize','moment','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x33edb1,_0x3877ba){var _0x2a1678=function(_0x2a9285){while(--_0x2a9285){_0x33edb1['push'](_0x33edb1['shift']());}};_0x2a1678(++_0x3877ba);}(_0xeec6,0x1c2));var _0x6eec=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0xeec6[_0x56e4e7];return _0x383618;};'use strict';var Sequelize=require(_0x6eec('0x0'));var moment=require(_0x6eec('0x1'));module[_0x6eec('0x2')]={'time':{'type':Sequelize[_0x6eec('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x6eec('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x6eec('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x6eec('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x6eec('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x6eec('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x6eec('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x6eec('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x6eec('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x6eec('0x4')](_0x6eec('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 57579d6..42cddc7 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 _0xb551=['VIRTUAL','merge','options','then','include','catch','show','params','includeAll','find','create','body','update','html-pdf','eml-format','rimraf','moment','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','sendStatus','error','name','send','index','VoiceQueuesLog','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key'];(function(_0x19d1f1,_0x15098b){var _0x394fcc=function(_0x355340){while(--_0x355340){_0x19d1f1['push'](_0x19d1f1['shift']());}};_0x394fcc(++_0x15098b);}(_0xb551,0x11d));var _0x1b55=function(_0x453d44,_0x4ca44d){_0x453d44=_0x453d44-0x0;var _0x5cef60=_0xb551[_0x453d44];return _0x5cef60;};'use strict';var pdf=require(_0x1b55('0x0'));var emlformat=require(_0x1b55('0x1'));var rimraf=require(_0x1b55('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b55('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1b55('0x4'));var sox=require(_0x1b55('0x5'));var csv=require(_0x1b55('0x6'));var ejs=require(_0x1b55('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1b55('0x8'));var jsforce=require(_0x1b55('0x9'));var deskjs=require(_0x1b55('0xa'));var toCsv=require('to-csv');var querystring=require(_0x1b55('0xb'));var Papa=require('papaparse');var authService=require(_0x1b55('0xc'));var hardwareService=require(_0x1b55('0xd'));var Redis=require(_0x1b55('0xe'));var qs=require(_0x1b55('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x1b55('0x10'));var config=require(_0x1b55('0x11'));var db=require(_0x1b55('0x12'))['db'];function respondWithStatusCode(_0x3487f8,_0x497e4e){_0x497e4e=_0x497e4e||0xcc;return function(_0x3452bc){if(_0x3452bc){return _0x3487f8['sendStatus'](_0x497e4e);}return _0x3487f8[_0x1b55('0x13')](_0x497e4e)[_0x1b55('0x14')]();};}function respondWithResult(_0x1a021e,_0x30bc1a){_0x30bc1a=_0x30bc1a||0xc8;return function(_0x155715){if(_0x155715){return _0x1a021e[_0x1b55('0x13')](_0x30bc1a)[_0x1b55('0x15')](_0x155715);}};}function respondWithFilteredResult(_0x1c5249,_0x39e362){return function(_0x303ef3){if(_0x303ef3){var _0x4a15fe=_0x303ef3[_0x1b55('0x16')],_0x474f7c=_0x39e362[_0x1b55('0x17')],_0x1a933b=_0x39e362[_0x1b55('0x17')]+_0x39e362[_0x1b55('0x18')],_0x321267;if(_0x1a933b>=_0x4a15fe){_0x1a933b=_0x4a15fe;_0x321267=0xc8;}else{_0x321267=0xce;}_0x1c5249[_0x1b55('0x13')](_0x321267);return _0x1c5249[_0x1b55('0x19')](_0x1b55('0x1a'),_0x474f7c+'-'+_0x1a933b+'/'+_0x4a15fe)[_0x1b55('0x15')](_0x303ef3);}return null;};}function patchUpdates(_0x20b30d){return function(_0x1f971e){try{jsonpatch[_0x1b55('0x1b')](_0x1f971e,_0x20b30d,!![]);}catch(_0x1598a1){return BPromise[_0x1b55('0x1c')](_0x1598a1);}return _0x1f971e[_0x1b55('0x1d')]();};}function saveUpdates(_0x5ed709,_0x1b4246){return function(_0x38609b){if(_0x38609b){return _0x38609b['update'](_0x5ed709)['then'](function(_0x58e737){return _0x58e737;});}return null;};}function removeEntity(_0x2ecbe1,_0x438606){return function(_0x1da749){if(_0x1da749){return _0x1da749[_0x1b55('0x1e')]()['then'](function(){_0x2ecbe1[_0x1b55('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a4495,_0x19c8af){return function(_0x2cd805){if(!_0x2cd805){_0x3a4495[_0x1b55('0x1f')](0x194);}return _0x2cd805;};}function handleError(_0x3fca69,_0x5906e9){_0x5906e9=_0x5906e9||0x1f4;return function(_0x1ea63d){logger[_0x1b55('0x20')](_0x1ea63d['stack']);if(_0x1ea63d[_0x1b55('0x21')]){delete _0x1ea63d[_0x1b55('0x21')];}_0x3fca69[_0x1b55('0x13')](_0x5906e9)[_0x1b55('0x22')](_0x1ea63d);};}exports[_0x1b55('0x23')]=function(_0x5e88aa,_0x1cd9bf){var _0x24fd9c={},_0x1741b9={},_0x504b9d={'count':0x0,'rows':[]};var _0xc38841=db[_0x1b55('0x24')][_0x1b55('0x25')];_0x1741b9[_0x1b55('0x26')]=_['keys'](_0xc38841);_0x1741b9[_0x1b55('0x27')]=_[_0x1b55('0x28')](_0x5e88aa[_0x1b55('0x27')]);_0x1741b9[_0x1b55('0x29')]=_[_0x1b55('0x2a')](_0x1741b9[_0x1b55('0x26')],_0x1741b9[_0x1b55('0x27')]);_0x24fd9c['attributes']=_[_0x1b55('0x2a')](_0x1741b9['model'],qs['fields'](_0x5e88aa[_0x1b55('0x27')][_0x1b55('0x2b')]));_0x24fd9c['attributes']=_0x24fd9c[_0x1b55('0x2c')]['length']?_0x24fd9c['attributes']:_0x1741b9[_0x1b55('0x26')];if(!_0x5e88aa[_0x1b55('0x27')][_0x1b55('0x2d')](_0x1b55('0x2e'))){_0x24fd9c['limit']=qs[_0x1b55('0x18')](_0x5e88aa['query'][_0x1b55('0x18')]);_0x24fd9c['offset']=qs['offset'](_0x5e88aa[_0x1b55('0x27')][_0x1b55('0x17')]);}_0x24fd9c[_0x1b55('0x2f')]=qs[_0x1b55('0x30')](_0x5e88aa[_0x1b55('0x27')]['sort']);_0x24fd9c[_0x1b55('0x31')]=qs[_0x1b55('0x29')](_[_0x1b55('0x32')](_0x5e88aa[_0x1b55('0x27')],_0x1741b9[_0x1b55('0x29')]));if(_0x5e88aa[_0x1b55('0x27')][_0x1b55('0x33')]){_0x24fd9c['where']=_['merge'](_0x24fd9c[_0x1b55('0x31')],{'$or':_[_0x1b55('0x34')](_0xc38841,function(_0x185c8f){if(_0x185c8f[_0x1b55('0x35')][_0x1b55('0x36')]!==_0x1b55('0x37')){var _0x4eebfb={};_0x4eebfb[_0x185c8f['field']]={'$like':'%'+_0x5e88aa[_0x1b55('0x27')][_0x1b55('0x33')]+'%'};return _0x4eebfb;}})});}_0x24fd9c=_[_0x1b55('0x38')]({},_0x24fd9c,_0x5e88aa[_0x1b55('0x39')]);var _0x146527={'where':_0x24fd9c[_0x1b55('0x31')]};return db['VoiceQueuesLog'][_0x1b55('0x16')](_0x146527)[_0x1b55('0x3a')](function(_0x4525ff){_0x504b9d[_0x1b55('0x16')]=_0x4525ff;if(_0x5e88aa[_0x1b55('0x27')]['includeAll']){_0x24fd9c[_0x1b55('0x3b')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x24fd9c);})[_0x1b55('0x3a')](function(_0x39a4c0){_0x504b9d['rows']=_0x39a4c0;return _0x504b9d;})[_0x1b55('0x3a')](respondWithFilteredResult(_0x1cd9bf,_0x24fd9c))[_0x1b55('0x3c')](handleError(_0x1cd9bf,null));};exports[_0x1b55('0x3d')]=function(_0x318365,_0x125a6c){var _0x514c79={'raw':!![],'where':{'id':_0x318365[_0x1b55('0x3e')]['id']}},_0xec53df={};_0xec53df[_0x1b55('0x26')]=_[_0x1b55('0x28')](db[_0x1b55('0x24')][_0x1b55('0x25')]);_0xec53df['query']=_[_0x1b55('0x28')](_0x318365[_0x1b55('0x27')]);_0xec53df[_0x1b55('0x29')]=_[_0x1b55('0x2a')](_0xec53df[_0x1b55('0x26')],_0xec53df['query']);_0x514c79['attributes']=_[_0x1b55('0x2a')](_0xec53df['model'],qs[_0x1b55('0x2b')](_0x318365[_0x1b55('0x27')][_0x1b55('0x2b')]));_0x514c79[_0x1b55('0x2c')]=_0x514c79[_0x1b55('0x2c')]['length']?_0x514c79[_0x1b55('0x2c')]:_0xec53df[_0x1b55('0x26')];if(_0x318365['query'][_0x1b55('0x3f')]){_0x514c79[_0x1b55('0x3b')]=[{'all':!![]}];}_0x514c79=_[_0x1b55('0x38')]({},_0x514c79,_0x318365['options']);return db['VoiceQueuesLog'][_0x1b55('0x40')](_0x514c79)[_0x1b55('0x3a')](handleEntityNotFound(_0x125a6c,null))[_0x1b55('0x3a')](respondWithResult(_0x125a6c,null))[_0x1b55('0x3c')](handleError(_0x125a6c,null));};exports[_0x1b55('0x41')]=function(_0x5a45ae,_0x5942a3){return db[_0x1b55('0x24')][_0x1b55('0x41')](_0x5a45ae[_0x1b55('0x42')],{})[_0x1b55('0x3a')](respondWithResult(_0x5942a3,0xc9))[_0x1b55('0x3c')](handleError(_0x5942a3,null));};exports[_0x1b55('0x43')]=function(_0x269f7f,_0x1f7965){if(_0x269f7f[_0x1b55('0x42')]['id']){delete _0x269f7f[_0x1b55('0x42')]['id'];}return db[_0x1b55('0x24')]['find']({'where':{'id':_0x269f7f[_0x1b55('0x3e')]['id']}})[_0x1b55('0x3a')](handleEntityNotFound(_0x1f7965,null))[_0x1b55('0x3a')](saveUpdates(_0x269f7f[_0x1b55('0x42')],null))['then'](respondWithResult(_0x1f7965,null))['catch'](handleError(_0x1f7965,null));};exports[_0x1b55('0x1e')]=function(_0x21740b,_0x29693c){return db[_0x1b55('0x24')][_0x1b55('0x40')]({'where':{'id':_0x21740b[_0x1b55('0x3e')]['id']}})[_0x1b55('0x3a')](handleEntityNotFound(_0x29693c,null))[_0x1b55('0x3a')](removeEntity(_0x29693c,null))[_0x1b55('0x3c')](handleError(_0x29693c,null));}; \ No newline at end of file +var _0xed89=['find','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','offset','set','json','apply','reject','save','update','destroy','then','stack','name','send','index','VoiceQueuesLog','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','limit','order','sort','filter','merge','where','map','type','key','VIRTUAL','field','options','count','includeAll','rows','catch','show','params','include','create'];(function(_0x3ca92f,_0x579ab8){var _0x2b5288=function(_0x16d655){while(--_0x16d655){_0x3ca92f['push'](_0x3ca92f['shift']());}};_0x2b5288(++_0x579ab8);}(_0xed89,0x8f));var _0x9ed8=function(_0x3e37b1,_0x2baf5d){_0x3e37b1=_0x3e37b1-0x0;var _0x2fe97e=_0xed89[_0x3e37b1];return _0x2fe97e;};'use strict';var pdf=require(_0x9ed8('0x0'));var emlformat=require(_0x9ed8('0x1'));var rimraf=require(_0x9ed8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9ed8('0x3'));var moment=require(_0x9ed8('0x4'));var BPromise=require(_0x9ed8('0x5'));var Mustache=require(_0x9ed8('0x6'));var util=require(_0x9ed8('0x7'));var path=require(_0x9ed8('0x8'));var sox=require(_0x9ed8('0x9'));var csv=require(_0x9ed8('0xa'));var ejs=require(_0x9ed8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9ed8('0xc'));var crypto=require(_0x9ed8('0xd'));var jsforce=require(_0x9ed8('0xe'));var deskjs=require(_0x9ed8('0xf'));var toCsv=require(_0x9ed8('0xa'));var querystring=require(_0x9ed8('0x10'));var Papa=require(_0x9ed8('0x11'));var authService=require(_0x9ed8('0x12'));var hardwareService=require(_0x9ed8('0x13'));var Redis=require('ioredis');var qs=require(_0x9ed8('0x14'));var logger=require(_0x9ed8('0x15'))('api');var utils=require(_0x9ed8('0x16'));var config=require(_0x9ed8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x545dc1,_0xf9b8ce){_0xf9b8ce=_0xf9b8ce||0xcc;return function(_0x465a34){if(_0x465a34){return _0x545dc1[_0x9ed8('0x18')](_0xf9b8ce);}return _0x545dc1['status'](_0xf9b8ce)[_0x9ed8('0x19')]();};}function respondWithResult(_0x2c424b,_0x3def5f){_0x3def5f=_0x3def5f||0xc8;return function(_0x4528f0){if(_0x4528f0){return _0x2c424b[_0x9ed8('0x1a')](_0x3def5f)['json'](_0x4528f0);}};}function respondWithFilteredResult(_0x451c11,_0x4dbdd4){return function(_0x171b0a){if(_0x171b0a){var _0x3b9630=_0x171b0a['count'],_0x158eac=_0x4dbdd4[_0x9ed8('0x1b')],_0x5dd4d1=_0x4dbdd4[_0x9ed8('0x1b')]+_0x4dbdd4['limit'],_0x27252a;if(_0x5dd4d1>=_0x3b9630){_0x5dd4d1=_0x3b9630;_0x27252a=0xc8;}else{_0x27252a=0xce;}_0x451c11[_0x9ed8('0x1a')](_0x27252a);return _0x451c11[_0x9ed8('0x1c')]('Content-Range',_0x158eac+'-'+_0x5dd4d1+'/'+_0x3b9630)[_0x9ed8('0x1d')](_0x171b0a);}return null;};}function patchUpdates(_0x3bfcb3){return function(_0x605857){try{jsonpatch[_0x9ed8('0x1e')](_0x605857,_0x3bfcb3,!![]);}catch(_0x14776d){return BPromise[_0x9ed8('0x1f')](_0x14776d);}return _0x605857[_0x9ed8('0x20')]();};}function saveUpdates(_0x317dca,_0x393e44){return function(_0x4c885b){if(_0x4c885b){return _0x4c885b[_0x9ed8('0x21')](_0x317dca)['then'](function(_0x1ba76b){return _0x1ba76b;});}return null;};}function removeEntity(_0x18129f,_0x1f59ea){return function(_0x20a95a){if(_0x20a95a){return _0x20a95a[_0x9ed8('0x22')]()[_0x9ed8('0x23')](function(){_0x18129f[_0x9ed8('0x1a')](0xcc)[_0x9ed8('0x19')]();});}};}function handleEntityNotFound(_0xdc0eb5,_0x310d76){return function(_0x365b4b){if(!_0x365b4b){_0xdc0eb5[_0x9ed8('0x18')](0x194);}return _0x365b4b;};}function handleError(_0x5c5cfb,_0x2ad7d9){_0x2ad7d9=_0x2ad7d9||0x1f4;return function(_0x2c7318){logger['error'](_0x2c7318[_0x9ed8('0x24')]);if(_0x2c7318[_0x9ed8('0x25')]){delete _0x2c7318[_0x9ed8('0x25')];}_0x5c5cfb['status'](_0x2ad7d9)[_0x9ed8('0x26')](_0x2c7318);};}exports[_0x9ed8('0x27')]=function(_0x4b314b,_0x33166e){var _0x40efd1={},_0x50835e={},_0xb30efe={'count':0x0,'rows':[]};var _0x1f2a25=db[_0x9ed8('0x28')][_0x9ed8('0x29')];_0x50835e[_0x9ed8('0x2a')]=_[_0x9ed8('0x2b')](_0x1f2a25);_0x50835e['query']=_[_0x9ed8('0x2b')](_0x4b314b['query']);_0x50835e[_0x9ed8('0x2c')]=_[_0x9ed8('0x2d')](_0x50835e['model'],_0x50835e[_0x9ed8('0x2e')]);_0x40efd1[_0x9ed8('0x2f')]=_[_0x9ed8('0x2d')](_0x50835e[_0x9ed8('0x2a')],qs[_0x9ed8('0x30')](_0x4b314b['query']['fields']));_0x40efd1[_0x9ed8('0x2f')]=_0x40efd1[_0x9ed8('0x2f')][_0x9ed8('0x31')]?_0x40efd1[_0x9ed8('0x2f')]:_0x50835e[_0x9ed8('0x2a')];if(!_0x4b314b[_0x9ed8('0x2e')]['hasOwnProperty']('nolimit')){_0x40efd1[_0x9ed8('0x32')]=qs['limit'](_0x4b314b['query'][_0x9ed8('0x32')]);_0x40efd1['offset']=qs['offset'](_0x4b314b[_0x9ed8('0x2e')][_0x9ed8('0x1b')]);}_0x40efd1[_0x9ed8('0x33')]=qs['sort'](_0x4b314b['query'][_0x9ed8('0x34')]);_0x40efd1['where']=qs[_0x9ed8('0x2c')](_['pick'](_0x4b314b['query'],_0x50835e[_0x9ed8('0x2c')]));if(_0x4b314b[_0x9ed8('0x2e')][_0x9ed8('0x35')]){_0x40efd1['where']=_[_0x9ed8('0x36')](_0x40efd1[_0x9ed8('0x37')],{'$or':_[_0x9ed8('0x38')](_0x1f2a25,function(_0x17393b){if(_0x17393b[_0x9ed8('0x39')][_0x9ed8('0x3a')]!==_0x9ed8('0x3b')){var _0x53dba4={};_0x53dba4[_0x17393b[_0x9ed8('0x3c')]]={'$like':'%'+_0x4b314b[_0x9ed8('0x2e')]['filter']+'%'};return _0x53dba4;}})});}_0x40efd1=_[_0x9ed8('0x36')]({},_0x40efd1,_0x4b314b[_0x9ed8('0x3d')]);var _0x3d9cbc={'where':_0x40efd1['where']};return db['VoiceQueuesLog']['count'](_0x3d9cbc)[_0x9ed8('0x23')](function(_0x58e079){_0xb30efe[_0x9ed8('0x3e')]=_0x58e079;if(_0x4b314b[_0x9ed8('0x2e')][_0x9ed8('0x3f')]){_0x40efd1['include']=[{'all':!![]}];}return db[_0x9ed8('0x28')]['findAll'](_0x40efd1);})[_0x9ed8('0x23')](function(_0x37b937){_0xb30efe[_0x9ed8('0x40')]=_0x37b937;return _0xb30efe;})[_0x9ed8('0x23')](respondWithFilteredResult(_0x33166e,_0x40efd1))[_0x9ed8('0x41')](handleError(_0x33166e,null));};exports[_0x9ed8('0x42')]=function(_0x3361f5,_0x320488){var _0x5926e0={'raw':!![],'where':{'id':_0x3361f5[_0x9ed8('0x43')]['id']}},_0x3a420b={};_0x3a420b[_0x9ed8('0x2a')]=_[_0x9ed8('0x2b')](db[_0x9ed8('0x28')][_0x9ed8('0x29')]);_0x3a420b[_0x9ed8('0x2e')]=_[_0x9ed8('0x2b')](_0x3361f5[_0x9ed8('0x2e')]);_0x3a420b[_0x9ed8('0x2c')]=_['intersection'](_0x3a420b[_0x9ed8('0x2a')],_0x3a420b['query']);_0x5926e0[_0x9ed8('0x2f')]=_[_0x9ed8('0x2d')](_0x3a420b['model'],qs['fields'](_0x3361f5[_0x9ed8('0x2e')][_0x9ed8('0x30')]));_0x5926e0[_0x9ed8('0x2f')]=_0x5926e0['attributes'][_0x9ed8('0x31')]?_0x5926e0[_0x9ed8('0x2f')]:_0x3a420b['model'];if(_0x3361f5[_0x9ed8('0x2e')]['includeAll']){_0x5926e0[_0x9ed8('0x44')]=[{'all':!![]}];}_0x5926e0=_[_0x9ed8('0x36')]({},_0x5926e0,_0x3361f5['options']);return db['VoiceQueuesLog']['find'](_0x5926e0)[_0x9ed8('0x23')](handleEntityNotFound(_0x320488,null))['then'](respondWithResult(_0x320488,null))[_0x9ed8('0x41')](handleError(_0x320488,null));};exports[_0x9ed8('0x45')]=function(_0x8a9405,_0x4e3402){return db[_0x9ed8('0x28')][_0x9ed8('0x45')](_0x8a9405['body'],{})[_0x9ed8('0x23')](respondWithResult(_0x4e3402,0xc9))[_0x9ed8('0x41')](handleError(_0x4e3402,null));};exports[_0x9ed8('0x21')]=function(_0x1a648b,_0x4973cb){if(_0x1a648b['body']['id']){delete _0x1a648b['body']['id'];}return db['VoiceQueuesLog'][_0x9ed8('0x46')]({'where':{'id':_0x1a648b[_0x9ed8('0x43')]['id']}})[_0x9ed8('0x23')](handleEntityNotFound(_0x4973cb,null))[_0x9ed8('0x23')](saveUpdates(_0x1a648b['body'],null))[_0x9ed8('0x23')](respondWithResult(_0x4973cb,null))[_0x9ed8('0x41')](handleError(_0x4973cb,null));};exports[_0x9ed8('0x22')]=function(_0x414a85,_0x48c0b0){return db[_0x9ed8('0x28')][_0x9ed8('0x46')]({'where':{'id':_0x414a85[_0x9ed8('0x43')]['id']}})[_0x9ed8('0x23')](handleEntityNotFound(_0x48c0b0,null))[_0x9ed8('0x23')](removeEntity(_0x48c0b0,null))[_0x9ed8('0x41')](handleError(_0x48c0b0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 53503ea..22853cc 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 _0xacbd=['exports','voice_queues_log','lodash','../../config/logger','api','moment','bluebird','./voiceQueuesLog.attributes'];(function(_0x4c6ef4,_0x223aae){var _0x58e545=function(_0x18eb26){while(--_0x18eb26){_0x4c6ef4['push'](_0x4c6ef4['shift']());}};_0x58e545(++_0x223aae);}(_0xacbd,0x8a));var _0xdacb=function(_0x1f2525,_0x413e78){_0x1f2525=_0x1f2525-0x0;var _0x385f34=_0xacbd[_0x1f2525];return _0x385f34;};'use strict';var _=require(_0xdacb('0x0'));var util=require('util');var logger=require(_0xdacb('0x1'))(_0xdacb('0x2'));var moment=require(_0xdacb('0x3'));var BPromise=require(_0xdacb('0x4'));var rp=require('request-promise');var attributes=require(_0xdacb('0x5'));module[_0xdacb('0x6')]=function(_0x9dd8ef,_0x3123a7){return _0x9dd8ef['define']('VoiceQueuesLog',attributes,{'tableName':_0xdacb('0x7'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x6f2d=['exports','define','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./voiceQueuesLog.attributes'];(function(_0x56b0a4,_0x732c39){var _0x389fd3=function(_0x9232d7){while(--_0x9232d7){_0x56b0a4['push'](_0x56b0a4['shift']());}};_0x389fd3(++_0x732c39);}(_0x6f2d,0x116));var _0xd6f2=function(_0x4167c1,_0x812612){_0x4167c1=_0x4167c1-0x0;var _0x358512=_0x6f2d[_0x4167c1];return _0x358512;};'use strict';var _=require(_0xd6f2('0x0'));var util=require(_0xd6f2('0x1'));var logger=require(_0xd6f2('0x2'))(_0xd6f2('0x3'));var moment=require(_0xd6f2('0x4'));var BPromise=require(_0xd6f2('0x5'));var rp=require(_0xd6f2('0x6'));var attributes=require(_0xd6f2('0x7'));module[_0xd6f2('0x8')]=function(_0x35203e,_0x3f6f3f){return _0x35203e[_0xd6f2('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0xd6f2('0xa'),'paranoid':![],'indexes':[{'name':_0xd6f2('0xb'),'fields':[_0xd6f2('0xc'),'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 456d927..5288546 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 _0x3c1a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','lodash','util'];(function(_0xc9f8f8,_0x9087c){var _0x12865d=function(_0x27108b){while(--_0x27108b){_0xc9f8f8['push'](_0xc9f8f8['shift']());}};_0x12865d(++_0x9087c);}(_0x3c1a,0xda));var _0xa3c1=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0x3c1a[_0x2ff762];return _0x158b02;};'use strict';var _=require(_0xa3c1('0x0'));var util=require(_0xa3c1('0x1'));var moment=require(_0xa3c1('0x2'));var BPromise=require(_0xa3c1('0x3'));var rs=require(_0xa3c1('0x4'));var fs=require('fs');var Redis=require(_0xa3c1('0x5'));var db=require(_0xa3c1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa3c1('0x7'))('rpc');var config=require(_0xa3c1('0x8'));var jayson=require(_0xa3c1('0x9'));var client=jayson[_0xa3c1('0xa')][_0xa3c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x546253,_0x549d7d,_0x3a42ed){return new BPromise(function(_0x1aa471,_0x3a4718){return client[_0xa3c1('0xc')](_0x546253,_0x3a42ed)[_0xa3c1('0xd')](function(_0x4fac66){logger[_0xa3c1('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x549d7d,'request\x20sent');logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x549d7d,_0xa3c1('0xf'),JSON[_0xa3c1('0x10')](_0x4fac66));if(_0x4fac66[_0xa3c1('0x11')]){if(_0x4fac66[_0xa3c1('0x11')][_0xa3c1('0x12')]===0x1f4){logger[_0xa3c1('0x11')](_0xa3c1('0x13'),_0x549d7d,_0x4fac66['error'][_0xa3c1('0x14')]);return _0x3a4718(_0x4fac66[_0xa3c1('0x11')][_0xa3c1('0x14')]);}logger[_0xa3c1('0x11')](_0xa3c1('0x13'),_0x549d7d,_0x4fac66[_0xa3c1('0x11')][_0xa3c1('0x14')]);return _0x1aa471(_0x4fac66['error'][_0xa3c1('0x14')]);}else{logger[_0xa3c1('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x549d7d,_0xa3c1('0xf'));_0x1aa471(_0x4fac66[_0xa3c1('0x15')]['message']);}})['catch'](function(_0x37d3a6){logger['error'](_0xa3c1('0x13'),_0x549d7d,_0x37d3a6);_0x3a4718(_0x37d3a6);});});} \ No newline at end of file +var _0x9679=['../../config/logger','rpc','../../config/environment','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x554e55,_0x3144f6){var _0x276f14=function(_0x26f9ce){while(--_0x26f9ce){_0x554e55['push'](_0x554e55['shift']());}};_0x276f14(++_0x3144f6);}(_0x9679,0x15f));var _0x9967=function(_0x2afc02,_0x103f5c){_0x2afc02=_0x2afc02-0x0;var _0x3571c9=_0x9679[_0x2afc02];return _0x3571c9;};'use strict';var _=require(_0x9967('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9967('0x1'));var rs=require(_0x9967('0x2'));var fs=require('fs');var Redis=require(_0x9967('0x3'));var db=require(_0x9967('0x4'))['db'];var utils=require(_0x9967('0x5'));var logger=require(_0x9967('0x6'))(_0x9967('0x7'));var config=require(_0x9967('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc3f972,_0x37b5d2,_0x4e5ed5){return new BPromise(function(_0x425d2a,_0x47c431){return client[_0x9967('0x9')](_0xc3f972,_0x4e5ed5)[_0x9967('0xa')](function(_0x2bdbae){logger[_0x9967('0xb')](_0x9967('0xc'),_0x37b5d2,_0x9967('0xd'));logger[_0x9967('0xe')](_0x9967('0xf'),_0x37b5d2,_0x9967('0xd'),JSON[_0x9967('0x10')](_0x2bdbae));if(_0x2bdbae[_0x9967('0x11')]){if(_0x2bdbae[_0x9967('0x11')][_0x9967('0x12')]===0x1f4){logger['error'](_0x9967('0xc'),_0x37b5d2,_0x2bdbae['error']['message']);return _0x47c431(_0x2bdbae[_0x9967('0x11')][_0x9967('0x13')]);}logger[_0x9967('0x11')](_0x9967('0xc'),_0x37b5d2,_0x2bdbae[_0x9967('0x11')][_0x9967('0x13')]);return _0x425d2a(_0x2bdbae['error'][_0x9967('0x13')]);}else{logger[_0x9967('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x37b5d2,'request\x20sent');_0x425d2a(_0x2bdbae['result']['message']);}})[_0x9967('0x14')](function(_0x3ee5e8){logger[_0x9967('0x11')](_0x9967('0xc'),_0x37b5d2,_0x3ee5e8);_0x47c431(_0x3ee5e8);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 77ce06f..375a02d 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 _0xf290=['destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','put','update','delete'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf290,0xde));var _0x0f29=function(_0x2998db,_0x3424f1){_0x2998db=_0x2998db-0x0;var _0x115fea=_0xf290[_0x2998db];return _0x115fea;};'use strict';var multer=require('multer');var util=require(_0x0f29('0x0'));var path=require('path');var timeout=require(_0x0f29('0x1'));var express=require('express');var router=express[_0x0f29('0x2')]();var auth=require(_0x0f29('0x3'));var interaction=require(_0x0f29('0x4'));var config=require(_0x0f29('0x5'));var controller=require(_0x0f29('0x6'));router['get']('/',auth[_0x0f29('0x7')](),controller['index']);router[_0x0f29('0x8')](_0x0f29('0x9'),auth[_0x0f29('0x7')](),controller[_0x0f29('0xa')]);router[_0x0f29('0x8')](_0x0f29('0xb'),auth[_0x0f29('0x7')](),controller[_0x0f29('0xc')]);router[_0x0f29('0x8')](_0x0f29('0xd'),auth[_0x0f29('0x7')](),controller[_0x0f29('0xe')]);router[_0x0f29('0x8')](_0x0f29('0xf'),controller[_0x0f29('0x10')]);router['post']('/',auth[_0x0f29('0x7')](),controller['create']);router[_0x0f29('0x11')](_0x0f29('0xb'),auth[_0x0f29('0x7')](),controller[_0x0f29('0x12')]);router[_0x0f29('0x13')](_0x0f29('0xb'),auth['isAuthenticated'](),controller[_0x0f29('0x14')]);module[_0x0f29('0x15')]=router; \ No newline at end of file +var _0xa37e=['/:id/download','download','downloads','post','put','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0xa37e,0x97));var _0xea37=function(_0xc7294,_0x4b7997){_0xc7294=_0xc7294-0x0;var _0x13912b=_0xa37e[_0xc7294];return _0x13912b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea37('0x0'));var timeout=require(_0xea37('0x1'));var express=require(_0xea37('0x2'));var router=express[_0xea37('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xea37('0x4'));var config=require('../../config/environment');var controller=require(_0xea37('0x5'));router[_0xea37('0x6')]('/',auth[_0xea37('0x7')](),controller['index']);router['get'](_0xea37('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xea37('0x6')](_0xea37('0x9'),auth[_0xea37('0x7')](),controller[_0xea37('0xa')]);router['get'](_0xea37('0xb'),auth[_0xea37('0x7')](),controller[_0xea37('0xc')]);router['get']('/:id/downloads',controller[_0xea37('0xd')]);router[_0xea37('0xe')]('/',auth[_0xea37('0x7')](),controller['create']);router[_0xea37('0xf')](_0xea37('0x9'),auth[_0xea37('0x7')](),controller['update']);router[_0xea37('0x10')](_0xea37('0x9'),auth['isAuthenticated'](),controller[_0xea37('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 8e799c3..7462184 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 _0xb47d=['exports','VIRTUAL','getDataValue','value','STRING','channel','setDataValue','membername','split','INTEGER','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','DATE','sequelize'];(function(_0x1768b9,_0x3a9940){var _0x3b488a=function(_0x51c004){while(--_0x51c004){_0x1768b9['push'](_0x1768b9['shift']());}};_0x3b488a(++_0x3a9940);}(_0xb47d,0x1ef));var _0xdb47=function(_0x52156c,_0x4ad1a2){_0x52156c=_0x52156c-0x0;var _0x382890=_0xb47d[_0x52156c];return _0x382890;};'use strict';var Sequelize=require(_0xdb47('0x0'));var moment=require('moment');var path=require('path');module[_0xdb47('0x1')]={'format':{'type':Sequelize[_0xdb47('0x2')],'get':function(){return this[_0xdb47('0x3')](_0xdb47('0x4'))?path['extname'](this[_0xdb47('0x3')](_0xdb47('0x4'))):undefined;}},'uniqueid':{'type':Sequelize[_0xdb47('0x5')]},'channel':{'type':Sequelize[_0xdb47('0x5')],'set':function(_0x41a939){if(_0x41a939){this['setDataValue'](_0xdb47('0x6'),_0x41a939);this[_0xdb47('0x7')](_0xdb47('0x8'),_0x41a939[_0xdb47('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xdb47('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdb47('0x5')]},'connectedlinenum':{'type':Sequelize[_0xdb47('0x5')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdb47('0x5')]},'context':{'type':Sequelize[_0xdb47('0x5')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xdb47('0x5')]},'type':{'type':Sequelize[_0xdb47('0x5')]},'rating':{'type':Sequelize[_0xdb47('0xa')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xdb47('0x5')]},'userDisposition':{'type':Sequelize[_0xdb47('0x5')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdb47('0x3')](_0xdb47('0xb')))[_0xdb47('0xc')](_0xdb47('0xd'))[_0xdb47('0xe')]();}},'updatedAt':{'type':Sequelize[_0xdb47('0xf')],'get':function(){return moment(this[_0xdb47('0x3')]('updatedAt'))['format'](_0xdb47('0xd'))[_0xdb47('0xe')]();}}}; \ No newline at end of file +var _0xd5fe=['format','updatedAt','MM-DD-YYYY\x20HH:mm','toString','sequelize','path','exports','VIRTUAL','getDataValue','extname','value','STRING','setDataValue','channel','membername','INTEGER','DATE','createdAt'];(function(_0xfd9b19,_0x21d75f){var _0x514918=function(_0x52e212){while(--_0x52e212){_0xfd9b19['push'](_0xfd9b19['shift']());}};_0x514918(++_0x21d75f);}(_0xd5fe,0x100));var _0xed5f=function(_0x2e1906,_0xa281e9){_0x2e1906=_0x2e1906-0x0;var _0x3ea10e=_0xd5fe[_0x2e1906];return _0x3ea10e;};'use strict';var Sequelize=require(_0xed5f('0x0'));var moment=require('moment');var path=require(_0xed5f('0x1'));module[_0xed5f('0x2')]={'format':{'type':Sequelize[_0xed5f('0x3')],'get':function(){return this[_0xed5f('0x4')]('value')?path[_0xed5f('0x5')](this[_0xed5f('0x4')](_0xed5f('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0xed5f('0x7')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x4d6c17){if(_0x4d6c17){this[_0xed5f('0x8')](_0xed5f('0x9'),_0x4d6c17);this[_0xed5f('0x8')](_0xed5f('0xa'),_0x4d6c17['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xed5f('0x7')]},'calleridnum':{'type':Sequelize[_0xed5f('0x7')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xed5f('0x7')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xed5f('0x7')]},'context':{'type':Sequelize[_0xed5f('0x7')]},'exten':{'type':Sequelize[_0xed5f('0x7')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xed5f('0x7')]},'rating':{'type':Sequelize[_0xed5f('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xed5f('0x7')]},'userDisposition':{'type':Sequelize[_0xed5f('0x7')]},'createdAt':{'type':Sequelize[_0xed5f('0xc')],'get':function(){return moment(this[_0xed5f('0x4')](_0xed5f('0xd')))[_0xed5f('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xed5f('0x4')](_0xed5f('0xf')))[_0xed5f('0xe')](_0xed5f('0x10'))[_0xed5f('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index c1ebe57..5e730fe 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 _0xe51b=['unlink','downloads','sequelize','MD5','col','token','uniqueid','$and','push','%s.cypher','decryptFile','ValidationError','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','set','Content-Range','json','apply','save','then','destroy','stack','name','send','index','VoiceRecording','rawAttributes','keys','format','query','filters','model','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','count','include','findAll','catch','show','intersection','includeAll','find','body','params','describe','download','../../components/encryptor','value','existsSync','secrets','Sequelize','VoiceRecording\x20not\x20found','filename','extname'];(function(_0x56dbbc,_0xcfd730){var _0x4617b4=function(_0x279507){while(--_0x279507){_0x56dbbc['push'](_0x56dbbc['shift']());}};_0x4617b4(++_0xcfd730);}(_0xe51b,0xce));var _0xbe51=function(_0x727e40,_0x55c539){_0x727e40=_0x727e40-0x0;var _0x734039=_0xe51b[_0x727e40];return _0x734039;};'use strict';var pdf=require(_0xbe51('0x0'));var emlformat=require(_0xbe51('0x1'));var rimraf=require(_0xbe51('0x2'));var zipdir=require(_0xbe51('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe51('0x4'));var moment=require(_0xbe51('0x5'));var BPromise=require(_0xbe51('0x6'));var Mustache=require(_0xbe51('0x7'));var util=require(_0xbe51('0x8'));var path=require(_0xbe51('0x9'));var sox=require(_0xbe51('0xa'));var csv=require(_0xbe51('0xb'));var ejs=require(_0xbe51('0xc'));var fs=require('fs');var _=require(_0xbe51('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbe51('0xe'));var deskjs=require(_0xbe51('0xf'));var toCsv=require(_0xbe51('0xb'));var querystring=require(_0xbe51('0x10'));var Papa=require(_0xbe51('0x11'));var authService=require(_0xbe51('0x12'));var hardwareService=require(_0xbe51('0x13'));var Redis=require(_0xbe51('0x14'));var qs=require(_0xbe51('0x15'));var logger=require(_0xbe51('0x16'))(_0xbe51('0x17'));var utils=require(_0xbe51('0x18'));var config=require(_0xbe51('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dcb29,_0x58bd42){_0x58bd42=_0x58bd42||0xcc;return function(_0x143678){if(_0x143678){return _0x3dcb29[_0xbe51('0x1a')](_0x58bd42);}return _0x3dcb29[_0xbe51('0x1b')](_0x58bd42)[_0xbe51('0x1c')]();};}function respondWithResult(_0x70a1ff,_0x291173){_0x291173=_0x291173||0xc8;return function(_0x3da15e){if(_0x3da15e){return _0x70a1ff[_0xbe51('0x1b')](_0x291173)['json'](_0x3da15e);}};}function respondWithFilteredResult(_0x11a37d,_0x3e0d9c){return function(_0x2aa8c7){if(_0x2aa8c7){var _0x11b9aa=_0x2aa8c7['count'],_0x4746c2=_0x3e0d9c[_0xbe51('0x1d')],_0x4dd4bc=_0x3e0d9c[_0xbe51('0x1d')]+_0x3e0d9c['limit'],_0xa958db;if(_0x4dd4bc>=_0x11b9aa){_0x4dd4bc=_0x11b9aa;_0xa958db=0xc8;}else{_0xa958db=0xce;}_0x11a37d[_0xbe51('0x1b')](_0xa958db);return _0x11a37d[_0xbe51('0x1e')](_0xbe51('0x1f'),_0x4746c2+'-'+_0x4dd4bc+'/'+_0x11b9aa)[_0xbe51('0x20')](_0x2aa8c7);}return null;};}function patchUpdates(_0x255aa1){return function(_0x5c5167){try{jsonpatch[_0xbe51('0x21')](_0x5c5167,_0x255aa1,!![]);}catch(_0x5d4631){return BPromise['reject'](_0x5d4631);}return _0x5c5167[_0xbe51('0x22')]();};}function saveUpdates(_0x33d759,_0x4fe005){return function(_0x5332ae){if(_0x5332ae){return _0x5332ae['update'](_0x33d759)[_0xbe51('0x23')](function(_0x529779){return _0x529779;});}return null;};}function removeEntity(_0x44d36e,_0x9c3b2a){return function(_0x1fced9){if(_0x1fced9){return _0x1fced9[_0xbe51('0x24')]()[_0xbe51('0x23')](function(){_0x44d36e[_0xbe51('0x1b')](0xcc)[_0xbe51('0x1c')]();});}};}function handleEntityNotFound(_0x32a52c,_0x350721){return function(_0x247b3f){if(!_0x247b3f){_0x32a52c[_0xbe51('0x1a')](0x194);}return _0x247b3f;};}function handleError(_0x1f0d5a,_0x3c7c6e){_0x3c7c6e=_0x3c7c6e||0x1f4;return function(_0x52594d){logger['error'](_0x52594d[_0xbe51('0x25')]);if(_0x52594d['name']){delete _0x52594d[_0xbe51('0x26')];}_0x1f0d5a['status'](_0x3c7c6e)[_0xbe51('0x27')](_0x52594d);};}exports[_0xbe51('0x28')]=function(_0x4c93d8,_0xe2c26){var _0x35cca9={},_0x73e7d9={},_0x5af11e={'count':0x0,'rows':[]};var _0x24a49e=db[_0xbe51('0x29')][_0xbe51('0x2a')];_0x73e7d9['model']=_['differenceBy'](_[_0xbe51('0x2b')](_0x24a49e),[_0xbe51('0x2c')]);_0x73e7d9['query']=_[_0xbe51('0x2b')](_0x4c93d8[_0xbe51('0x2d')]);_0x73e7d9[_0xbe51('0x2e')]=_['intersection'](_0x73e7d9['model'],_0x73e7d9[_0xbe51('0x2d')]);_0x35cca9['attributes']=_['intersection'](_0x73e7d9[_0xbe51('0x2f')],qs[_0xbe51('0x30')](_0x4c93d8[_0xbe51('0x2d')]['fields']));_0x35cca9[_0xbe51('0x31')]=_0x35cca9[_0xbe51('0x31')][_0xbe51('0x32')]?_0x35cca9[_0xbe51('0x31')]:_0x73e7d9[_0xbe51('0x2f')];if(!_0x4c93d8['query']['hasOwnProperty'](_0xbe51('0x33'))){_0x35cca9[_0xbe51('0x34')]=qs[_0xbe51('0x34')](_0x4c93d8[_0xbe51('0x2d')][_0xbe51('0x34')]);_0x35cca9[_0xbe51('0x1d')]=qs[_0xbe51('0x1d')](_0x4c93d8[_0xbe51('0x2d')][_0xbe51('0x1d')]);}_0x35cca9[_0xbe51('0x35')]=qs[_0xbe51('0x36')](_0x4c93d8[_0xbe51('0x2d')][_0xbe51('0x36')]);_0x35cca9[_0xbe51('0x37')]=qs[_0xbe51('0x2e')](_[_0xbe51('0x38')](_0x4c93d8[_0xbe51('0x2d')],_0x73e7d9[_0xbe51('0x2e')]));if(_0x4c93d8['query'][_0xbe51('0x39')]){_0x35cca9['where']=_['merge'](_0x35cca9['where'],{'$or':_[_0xbe51('0x3a')](_0x24a49e,function(_0x157b8a){if(_0x157b8a[_0xbe51('0x3b')][_0xbe51('0x3c')]!==_0xbe51('0x3d')){var _0x18525f={};_0x18525f[_0x157b8a[_0xbe51('0x3e')]]={'$like':'%'+_0x4c93d8[_0xbe51('0x2d')][_0xbe51('0x39')]+'%'};return _0x18525f;}})});}_0x35cca9=_[_0xbe51('0x3f')]({},_0x35cca9,_0x4c93d8[_0xbe51('0x40')]);var _0x2e7bf8={'where':_0x35cca9['where']};return db[_0xbe51('0x29')][_0xbe51('0x41')](_0x2e7bf8)[_0xbe51('0x23')](function(_0x35ffc1){_0x5af11e['count']=_0x35ffc1;if(_0x4c93d8[_0xbe51('0x2d')]['includeAll']){_0x35cca9[_0xbe51('0x42')]=[{'all':!![]}];}return db[_0xbe51('0x29')][_0xbe51('0x43')](_0x35cca9);})['then'](function(_0x1eac6c){_0x5af11e['rows']=_0x1eac6c;return _0x5af11e;})['then'](respondWithFilteredResult(_0xe2c26,_0x35cca9))[_0xbe51('0x44')](handleError(_0xe2c26,null));};exports[_0xbe51('0x45')]=function(_0x36ecb6,_0x39ab7e){var _0x4bb3f8={'raw':![],'where':{'id':_0x36ecb6['params']['id']}},_0x2d0e35={};_0x2d0e35[_0xbe51('0x2f')]=_[_0xbe51('0x2b')](db[_0xbe51('0x29')]['rawAttributes']);_0x2d0e35['query']=_[_0xbe51('0x2b')](_0x36ecb6[_0xbe51('0x2d')]);_0x2d0e35['filters']=_['intersection'](_0x2d0e35[_0xbe51('0x2f')],_0x2d0e35['query']);_0x4bb3f8[_0xbe51('0x31')]=_[_0xbe51('0x46')](_0x2d0e35[_0xbe51('0x2f')],qs[_0xbe51('0x30')](_0x36ecb6['query'][_0xbe51('0x30')]));_0x4bb3f8['attributes']=_0x4bb3f8[_0xbe51('0x31')][_0xbe51('0x32')]?_0x4bb3f8[_0xbe51('0x31')]:_0x2d0e35[_0xbe51('0x2f')];if(_0x36ecb6[_0xbe51('0x2d')][_0xbe51('0x47')]){_0x4bb3f8[_0xbe51('0x42')]=[{'all':!![]}];}_0x4bb3f8=_[_0xbe51('0x3f')]({},_0x4bb3f8,_0x36ecb6[_0xbe51('0x40')]);return db[_0xbe51('0x29')][_0xbe51('0x48')](_0x4bb3f8)[_0xbe51('0x23')](handleEntityNotFound(_0x39ab7e,null))[_0xbe51('0x23')](respondWithResult(_0x39ab7e,null))[_0xbe51('0x44')](handleError(_0x39ab7e,null));};exports['create']=function(_0x3321a1,_0x1b05e7){return db[_0xbe51('0x29')]['create'](_0x3321a1['body'],{})[_0xbe51('0x23')](respondWithResult(_0x1b05e7,0xc9))[_0xbe51('0x44')](handleError(_0x1b05e7,null));};exports['update']=function(_0x458cff,_0x5bcacd){if(_0x458cff[_0xbe51('0x49')]['id']){delete _0x458cff[_0xbe51('0x49')]['id'];}return db[_0xbe51('0x29')][_0xbe51('0x48')]({'where':{'id':_0x458cff[_0xbe51('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bcacd,null))[_0xbe51('0x23')](saveUpdates(_0x458cff[_0xbe51('0x49')],null))['then'](respondWithResult(_0x5bcacd,null))[_0xbe51('0x44')](handleError(_0x5bcacd,null));};exports[_0xbe51('0x24')]=function(_0x32a7af,_0x136762){return db[_0xbe51('0x29')][_0xbe51('0x48')]({'where':{'id':_0x32a7af[_0xbe51('0x4a')]['id']}})['then'](handleEntityNotFound(_0x136762,null))[_0xbe51('0x23')](removeEntity(_0x136762,null))[_0xbe51('0x44')](handleError(_0x136762,null));};exports[_0xbe51('0x4b')]=function(_0x27644d,_0x160799){return db[_0xbe51('0x29')][_0xbe51('0x4b')]()[_0xbe51('0x23')](respondWithResult(_0x160799,null))[_0xbe51('0x44')](handleError(_0x160799,null));};exports[_0xbe51('0x4c')]=function(_0x1d776d,_0x73bd78,_0x2b4490){var _0x556b27=require(_0xbe51('0x4d'));var _0x56eced=![];var _0x2bcb6b={};if(_0x1d776d['query'][_0xbe51('0x3b')]&&_0x1d776d[_0xbe51('0x2d')][_0xbe51('0x3b')]==='uniqueid'){_0x2bcb6b['uniqueid']=_0x1d776d['params']['id'];}else{_0x2bcb6b['id']=_0x1d776d[_0xbe51('0x4a')]['id'];}return db[_0xbe51('0x29')]['find']({'where':_0x2bcb6b,'attributes':['id','value'],'raw':!![]})[_0xbe51('0x23')](handleEntityNotFound(_0x73bd78,null))[_0xbe51('0x23')](function(_0x169332){if(_0x169332){var _0x58e083=util[_0xbe51('0x2c')]('%s.cypher',_0x169332[_0xbe51('0x4e')]);if(fs[_0xbe51('0x4f')](_0x58e083)){_0x56eced=!![];return _0x556b27['decryptFile'](_0x58e083,_0x169332[_0xbe51('0x4e')],config[_0xbe51('0x50')]['recording'])[_0xbe51('0x23')](function(){return _0x169332;});}return _0x169332;}})[_0xbe51('0x23')](function(_0x499002){if(_0x499002){if(!fs[_0xbe51('0x4f')](_0x499002[_0xbe51('0x4e')])){throw new db[(_0xbe51('0x51'))]['ValidationError'](_0xbe51('0x52'));}if(_0x499002[_0xbe51('0x53')]){return _0x73bd78[_0xbe51('0x4c')](_0x499002['value'],_0x499002['filename']+path[_0xbe51('0x54')](_0x499002[_0xbe51('0x4e')]),function(){if(_0x56eced){fs['unlink'](_0x499002[_0xbe51('0x4e')]);}});}else{return _0x73bd78[_0xbe51('0x4c')](_0x499002[_0xbe51('0x4e')],function(_0x294b94){if(_0x56eced){fs[_0xbe51('0x55')](_0x499002['value']);}});}}})['catch'](handleError(_0x73bd78,null));};exports[_0xbe51('0x56')]=function(_0x116bb2,_0x554c67,_0x30ead7){var _0x528750=require(_0xbe51('0x4d'));var _0x154f37=![];var _0x34631d={'$and':[db['sequelize']['where'](db[_0xbe51('0x57')]['fn'](_0xbe51('0x58'),db[_0xbe51('0x57')][_0xbe51('0x59')]('uniqueid')),_0x116bb2[_0xbe51('0x2d')][_0xbe51('0x5a')])]};if(_0x116bb2[_0xbe51('0x2d')]['type']&&_0x116bb2[_0xbe51('0x2d')][_0xbe51('0x3b')]===_0xbe51('0x5b')){_0x34631d[_0xbe51('0x5c')][_0xbe51('0x5d')]({'uniqueid':_0x116bb2['params']['id']});}else{_0x34631d[_0xbe51('0x5c')][_0xbe51('0x5d')]({'id':_0x116bb2[_0xbe51('0x4a')]['id']});}return db[_0xbe51('0x29')]['find']({'where':_0x34631d,'attributes':['id',_0xbe51('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x554c67,null))[_0xbe51('0x23')](function(_0x16c821){if(_0x16c821){var _0x11280d=util[_0xbe51('0x2c')](_0xbe51('0x5e'),_0x16c821['value']);if(fs[_0xbe51('0x4f')](_0x11280d)){_0x154f37=!![];return _0x528750[_0xbe51('0x5f')](_0x11280d,_0x16c821[_0xbe51('0x4e')],config[_0xbe51('0x50')]['recording'])[_0xbe51('0x23')](function(){return _0x16c821;});}return _0x16c821;}})[_0xbe51('0x23')](function(_0x3e03ac){if(_0x3e03ac){if(!fs[_0xbe51('0x4f')](_0x3e03ac['value'])){throw new db[(_0xbe51('0x51'))][(_0xbe51('0x60'))](_0xbe51('0x52'));}if(_0x3e03ac[_0xbe51('0x53')]){return _0x554c67['download'](_0x3e03ac[_0xbe51('0x4e')],_0x3e03ac[_0xbe51('0x53')]+path['extname'](_0x3e03ac[_0xbe51('0x4e')]),function(){if(_0x154f37){fs[_0xbe51('0x55')](_0x3e03ac['value']);}});}else{return _0x554c67[_0xbe51('0x4c')](_0x3e03ac[_0xbe51('0x4e')],function(_0x4a7ebe){if(_0x154f37){fs[_0xbe51('0x55')](_0x3e03ac['value']);}});}}})[_0xbe51('0x44')](handleError(_0x554c67,null));}; \ No newline at end of file +var _0x5e53=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','type','key','VIRTUAL','field','count','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','describe','download','uniqueid','decryptFile','value','recording','existsSync','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','downloads','../../components/encryptor','sequelize','col','push','$and','format','%s.cypher','secrets','ValidationError','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','reject','save','update','then','error','stack','name','send','VoiceRecording','model','differenceBy','keys','query'];(function(_0x13c406,_0x128275){var _0x2b9fd8=function(_0x425b61){while(--_0x425b61){_0x13c406['push'](_0x13c406['shift']());}};_0x2b9fd8(++_0x128275);}(_0x5e53,0x91));var _0x35e5=function(_0x30eab7,_0xdc0a49){_0x30eab7=_0x30eab7-0x0;var _0x306830=_0x5e53[_0x30eab7];return _0x306830;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x35e5('0x0'));var rimraf=require(_0x35e5('0x1'));var zipdir=require(_0x35e5('0x2'));var jsonpatch=require(_0x35e5('0x3'));var rp=require(_0x35e5('0x4'));var moment=require(_0x35e5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x35e5('0x6'));var util=require(_0x35e5('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x35e5('0x8'));var ejs=require(_0x35e5('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x35e5('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x35e5('0xb'));var toCsv=require(_0x35e5('0x8'));var querystring=require(_0x35e5('0xc'));var Papa=require(_0x35e5('0xd'));var authService=require(_0x35e5('0xe'));var hardwareService=require(_0x35e5('0xf'));var Redis=require(_0x35e5('0x10'));var qs=require(_0x35e5('0x11'));var logger=require(_0x35e5('0x12'))(_0x35e5('0x13'));var utils=require(_0x35e5('0x14'));var config=require(_0x35e5('0x15'));var db=require(_0x35e5('0x16'))['db'];function respondWithStatusCode(_0x2c9752,_0x277e32){_0x277e32=_0x277e32||0xcc;return function(_0x1ab12a){if(_0x1ab12a){return _0x2c9752[_0x35e5('0x17')](_0x277e32);}return _0x2c9752['status'](_0x277e32)[_0x35e5('0x18')]();};}function respondWithResult(_0x56e381,_0x275492){_0x275492=_0x275492||0xc8;return function(_0x5e149){if(_0x5e149){return _0x56e381[_0x35e5('0x19')](_0x275492)[_0x35e5('0x1a')](_0x5e149);}};}function respondWithFilteredResult(_0x3ce0be,_0x252c47){return function(_0x331c68){if(_0x331c68){var _0x3606cc=_0x331c68['count'],_0x4d70a9=_0x252c47[_0x35e5('0x1b')],_0x24a8dc=_0x252c47[_0x35e5('0x1b')]+_0x252c47[_0x35e5('0x1c')],_0x20fbfc;if(_0x24a8dc>=_0x3606cc){_0x24a8dc=_0x3606cc;_0x20fbfc=0xc8;}else{_0x20fbfc=0xce;}_0x3ce0be[_0x35e5('0x19')](_0x20fbfc);return _0x3ce0be['set'](_0x35e5('0x1d'),_0x4d70a9+'-'+_0x24a8dc+'/'+_0x3606cc)[_0x35e5('0x1a')](_0x331c68);}return null;};}function patchUpdates(_0x1e4b56){return function(_0x3cf6e1){try{jsonpatch['apply'](_0x3cf6e1,_0x1e4b56,!![]);}catch(_0x80baa6){return BPromise[_0x35e5('0x1e')](_0x80baa6);}return _0x3cf6e1[_0x35e5('0x1f')]();};}function saveUpdates(_0x2171a6,_0x245ac9){return function(_0x17eaee){if(_0x17eaee){return _0x17eaee[_0x35e5('0x20')](_0x2171a6)[_0x35e5('0x21')](function(_0x250e20){return _0x250e20;});}return null;};}function removeEntity(_0x53bf2f,_0x4d6622){return function(_0x28879c){if(_0x28879c){return _0x28879c['destroy']()[_0x35e5('0x21')](function(){_0x53bf2f[_0x35e5('0x19')](0xcc)[_0x35e5('0x18')]();});}};}function handleEntityNotFound(_0x1451e6,_0x33f9d8){return function(_0x38bc76){if(!_0x38bc76){_0x1451e6[_0x35e5('0x17')](0x194);}return _0x38bc76;};}function handleError(_0x2878d8,_0x341614){_0x341614=_0x341614||0x1f4;return function(_0x5f2d79){logger[_0x35e5('0x22')](_0x5f2d79[_0x35e5('0x23')]);if(_0x5f2d79['name']){delete _0x5f2d79[_0x35e5('0x24')];}_0x2878d8[_0x35e5('0x19')](_0x341614)[_0x35e5('0x25')](_0x5f2d79);};}exports['index']=function(_0x472238,_0x4825ef){var _0x2fad84={},_0x285f5a={},_0x2b47a7={'count':0x0,'rows':[]};var _0x6de230=db[_0x35e5('0x26')]['rawAttributes'];_0x285f5a[_0x35e5('0x27')]=_[_0x35e5('0x28')](_[_0x35e5('0x29')](_0x6de230),['format']);_0x285f5a[_0x35e5('0x2a')]=_[_0x35e5('0x29')](_0x472238[_0x35e5('0x2a')]);_0x285f5a[_0x35e5('0x2b')]=_[_0x35e5('0x2c')](_0x285f5a[_0x35e5('0x27')],_0x285f5a[_0x35e5('0x2a')]);_0x2fad84[_0x35e5('0x2d')]=_[_0x35e5('0x2c')](_0x285f5a[_0x35e5('0x27')],qs[_0x35e5('0x2e')](_0x472238[_0x35e5('0x2a')][_0x35e5('0x2e')]));_0x2fad84[_0x35e5('0x2d')]=_0x2fad84[_0x35e5('0x2d')][_0x35e5('0x2f')]?_0x2fad84['attributes']:_0x285f5a[_0x35e5('0x27')];if(!_0x472238[_0x35e5('0x2a')][_0x35e5('0x30')](_0x35e5('0x31'))){_0x2fad84[_0x35e5('0x1c')]=qs[_0x35e5('0x1c')](_0x472238[_0x35e5('0x2a')]['limit']);_0x2fad84[_0x35e5('0x1b')]=qs['offset'](_0x472238[_0x35e5('0x2a')]['offset']);}_0x2fad84[_0x35e5('0x32')]=qs['sort'](_0x472238[_0x35e5('0x2a')]['sort']);_0x2fad84[_0x35e5('0x33')]=qs[_0x35e5('0x2b')](_[_0x35e5('0x34')](_0x472238['query'],_0x285f5a[_0x35e5('0x2b')]));if(_0x472238[_0x35e5('0x2a')][_0x35e5('0x35')]){_0x2fad84['where']=_[_0x35e5('0x36')](_0x2fad84[_0x35e5('0x33')],{'$or':_[_0x35e5('0x37')](_0x6de230,function(_0x425222){if(_0x425222[_0x35e5('0x38')][_0x35e5('0x39')]!==_0x35e5('0x3a')){var _0x157f14={};_0x157f14[_0x425222[_0x35e5('0x3b')]]={'$like':'%'+_0x472238[_0x35e5('0x2a')]['filter']+'%'};return _0x157f14;}})});}_0x2fad84=_['merge']({},_0x2fad84,_0x472238['options']);var _0x5623db={'where':_0x2fad84[_0x35e5('0x33')]};return db[_0x35e5('0x26')][_0x35e5('0x3c')](_0x5623db)[_0x35e5('0x21')](function(_0x3d921a){_0x2b47a7[_0x35e5('0x3c')]=_0x3d921a;if(_0x472238[_0x35e5('0x2a')]['includeAll']){_0x2fad84[_0x35e5('0x3d')]=[{'all':!![]}];}return db[_0x35e5('0x26')][_0x35e5('0x3e')](_0x2fad84);})[_0x35e5('0x21')](function(_0x4acaf7){_0x2b47a7[_0x35e5('0x3f')]=_0x4acaf7;return _0x2b47a7;})['then'](respondWithFilteredResult(_0x4825ef,_0x2fad84))[_0x35e5('0x40')](handleError(_0x4825ef,null));};exports[_0x35e5('0x41')]=function(_0x4719d8,_0x334c0d){var _0x10aa9c={'raw':![],'where':{'id':_0x4719d8['params']['id']}},_0xb38d7b={};_0xb38d7b[_0x35e5('0x27')]=_[_0x35e5('0x29')](db[_0x35e5('0x26')][_0x35e5('0x42')]);_0xb38d7b[_0x35e5('0x2a')]=_[_0x35e5('0x29')](_0x4719d8['query']);_0xb38d7b[_0x35e5('0x2b')]=_[_0x35e5('0x2c')](_0xb38d7b[_0x35e5('0x27')],_0xb38d7b[_0x35e5('0x2a')]);_0x10aa9c[_0x35e5('0x2d')]=_['intersection'](_0xb38d7b[_0x35e5('0x27')],qs[_0x35e5('0x2e')](_0x4719d8[_0x35e5('0x2a')]['fields']));_0x10aa9c[_0x35e5('0x2d')]=_0x10aa9c['attributes']['length']?_0x10aa9c[_0x35e5('0x2d')]:_0xb38d7b[_0x35e5('0x27')];if(_0x4719d8[_0x35e5('0x2a')]['includeAll']){_0x10aa9c[_0x35e5('0x3d')]=[{'all':!![]}];}_0x10aa9c=_['merge']({},_0x10aa9c,_0x4719d8[_0x35e5('0x43')]);return db[_0x35e5('0x26')][_0x35e5('0x44')](_0x10aa9c)[_0x35e5('0x21')](handleEntityNotFound(_0x334c0d,null))[_0x35e5('0x21')](respondWithResult(_0x334c0d,null))[_0x35e5('0x40')](handleError(_0x334c0d,null));};exports['create']=function(_0x5f198b,_0x267324){return db[_0x35e5('0x26')][_0x35e5('0x45')](_0x5f198b['body'],{})['then'](respondWithResult(_0x267324,0xc9))['catch'](handleError(_0x267324,null));};exports[_0x35e5('0x20')]=function(_0x5df0d9,_0xa17bc3){if(_0x5df0d9[_0x35e5('0x46')]['id']){delete _0x5df0d9['body']['id'];}return db[_0x35e5('0x26')][_0x35e5('0x44')]({'where':{'id':_0x5df0d9[_0x35e5('0x47')]['id']}})[_0x35e5('0x21')](handleEntityNotFound(_0xa17bc3,null))[_0x35e5('0x21')](saveUpdates(_0x5df0d9['body'],null))[_0x35e5('0x21')](respondWithResult(_0xa17bc3,null))['catch'](handleError(_0xa17bc3,null));};exports['destroy']=function(_0x178686,_0x58cadf){return db[_0x35e5('0x26')][_0x35e5('0x44')]({'where':{'id':_0x178686['params']['id']}})[_0x35e5('0x21')](handleEntityNotFound(_0x58cadf,null))['then'](removeEntity(_0x58cadf,null))[_0x35e5('0x40')](handleError(_0x58cadf,null));};exports[_0x35e5('0x48')]=function(_0x32412a,_0x54d66f){return db['VoiceRecording']['describe']()['then'](respondWithResult(_0x54d66f,null))['catch'](handleError(_0x54d66f,null));};exports[_0x35e5('0x49')]=function(_0x1671e2,_0x2fbbf4,_0x5c925a){var _0x48a0f7=require('../../components/encryptor');var _0x31dd29=![];var _0x31b50a={};if(_0x1671e2[_0x35e5('0x2a')]['type']&&_0x1671e2[_0x35e5('0x2a')]['type']==='uniqueid'){_0x31b50a[_0x35e5('0x4a')]=_0x1671e2[_0x35e5('0x47')]['id'];}else{_0x31b50a['id']=_0x1671e2[_0x35e5('0x47')]['id'];}return db[_0x35e5('0x26')][_0x35e5('0x44')]({'where':_0x31b50a,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x2fbbf4,null))['then'](function(_0x21bfe7){if(_0x21bfe7){var _0x49e40e=util['format']('%s.cypher',_0x21bfe7['value']);if(fs['existsSync'](_0x49e40e)){_0x31dd29=!![];return _0x48a0f7[_0x35e5('0x4b')](_0x49e40e,_0x21bfe7[_0x35e5('0x4c')],config['secrets'][_0x35e5('0x4d')])[_0x35e5('0x21')](function(){return _0x21bfe7;});}return _0x21bfe7;}})[_0x35e5('0x21')](function(_0x1592a8){if(_0x1592a8){if(!fs[_0x35e5('0x4e')](_0x1592a8['value'])){throw new db[(_0x35e5('0x4f'))]['ValidationError'](_0x35e5('0x50'));}if(_0x1592a8[_0x35e5('0x51')]){return _0x2fbbf4['download'](_0x1592a8[_0x35e5('0x4c')],_0x1592a8['filename']+path[_0x35e5('0x52')](_0x1592a8[_0x35e5('0x4c')]),function(){if(_0x31dd29){fs[_0x35e5('0x53')](_0x1592a8['value']);}});}else{return _0x2fbbf4['download'](_0x1592a8['value'],function(_0x205440){if(_0x31dd29){fs[_0x35e5('0x53')](_0x1592a8['value']);}});}}})[_0x35e5('0x40')](handleError(_0x2fbbf4,null));};exports[_0x35e5('0x54')]=function(_0x384273,_0x42e3d4,_0x3edd08){var _0x3d1072=require(_0x35e5('0x55'));var _0xb8338=![];var _0xa1708a={'$and':[db['sequelize'][_0x35e5('0x33')](db[_0x35e5('0x56')]['fn']('MD5',db[_0x35e5('0x56')][_0x35e5('0x57')](_0x35e5('0x4a'))),_0x384273[_0x35e5('0x2a')]['token'])]};if(_0x384273['query'][_0x35e5('0x38')]&&_0x384273[_0x35e5('0x2a')]['type']==='uniqueid'){_0xa1708a['$and'][_0x35e5('0x58')]({'uniqueid':_0x384273[_0x35e5('0x47')]['id']});}else{_0xa1708a[_0x35e5('0x59')][_0x35e5('0x58')]({'id':_0x384273[_0x35e5('0x47')]['id']});}return db['VoiceRecording'][_0x35e5('0x44')]({'where':_0xa1708a,'attributes':['id',_0x35e5('0x4c')],'raw':!![]})[_0x35e5('0x21')](handleEntityNotFound(_0x42e3d4,null))[_0x35e5('0x21')](function(_0x2619ec){if(_0x2619ec){var _0x28cd1e=util[_0x35e5('0x5a')](_0x35e5('0x5b'),_0x2619ec['value']);if(fs['existsSync'](_0x28cd1e)){_0xb8338=!![];return _0x3d1072[_0x35e5('0x4b')](_0x28cd1e,_0x2619ec[_0x35e5('0x4c')],config[_0x35e5('0x5c')]['recording'])[_0x35e5('0x21')](function(){return _0x2619ec;});}return _0x2619ec;}})[_0x35e5('0x21')](function(_0x3cdd69){if(_0x3cdd69){if(!fs[_0x35e5('0x4e')](_0x3cdd69[_0x35e5('0x4c')])){throw new db['Sequelize'][(_0x35e5('0x5d'))](_0x35e5('0x50'));}if(_0x3cdd69[_0x35e5('0x51')]){return _0x42e3d4[_0x35e5('0x49')](_0x3cdd69[_0x35e5('0x4c')],_0x3cdd69[_0x35e5('0x51')]+path[_0x35e5('0x52')](_0x3cdd69[_0x35e5('0x4c')]),function(){if(_0xb8338){fs[_0x35e5('0x53')](_0x3cdd69[_0x35e5('0x4c')]);}});}else{return _0x42e3d4[_0x35e5('0x49')](_0x3cdd69[_0x35e5('0x4c')],function(_0x504847){if(_0xb8338){fs[_0x35e5('0x53')](_0x3cdd69[_0x35e5('0x4c')]);}});}}})['catch'](handleError(_0x42e3d4,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 7c1a513..7907aec 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 _0xd655=['request-promise','./voiceRecording.attributes','define','VoiceRecording','util','../../config/logger','moment'];(function(_0xa60b4f,_0x5613a0){var _0x4f4e83=function(_0x586e26){while(--_0x586e26){_0xa60b4f['push'](_0xa60b4f['shift']());}};_0x4f4e83(++_0x5613a0);}(_0xd655,0x100));var _0x5d65=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xd655[_0x101e7b];return _0x4995c0;};'use strict';var _=require('lodash');var util=require(_0x5d65('0x0'));var logger=require(_0x5d65('0x1'))('api');var moment=require(_0x5d65('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d65('0x3'));var attributes=require(_0x5d65('0x4'));module['exports']=function(_0x50df7b,_0x27beef){return _0x50df7b[_0x5d65('0x5')](_0x5d65('0x6'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0774=['VoiceRecording','voice_recordings','uniqueid','lodash','util','api','moment','bluebird','request-promise','./voiceRecording.attributes','exports','define'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0774,0x15f));var _0x4077=function(_0xa3e76a,_0x424feb){_0xa3e76a=_0xa3e76a-0x0;var _0x519095=_0x0774[_0xa3e76a];return _0x519095;};'use strict';var _=require(_0x4077('0x0'));var util=require(_0x4077('0x1'));var logger=require('../../config/logger')(_0x4077('0x2'));var moment=require(_0x4077('0x3'));var BPromise=require(_0x4077('0x4'));var rp=require(_0x4077('0x5'));var attributes=require(_0x4077('0x6'));module[_0x4077('0x7')]=function(_0x1179c3,_0xad3795){return _0x1179c3[_0x4077('0x8')](_0x4077('0x9'),attributes,{'tableName':_0x4077('0xa'),'paranoid':![],'indexes':[{'name':_0x4077('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 805572f..6b1eacd 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 _0x906f=['request','then','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','catch','UpdateVoiceRecording','update','options','raw','where','attributes','limit','info','debug','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','body','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2bcf54,_0x35d098){var _0x42f877=function(_0x41d12c){while(--_0x41d12c){_0x2bcf54['push'](_0x2bcf54['shift']());}};_0x42f877(++_0x35d098);}(_0x906f,0xa1));var _0xf906=function(_0x43ea05,_0x24f1e3){_0x43ea05=_0x43ea05-0x0;var _0x31cac2=_0x906f[_0x43ea05];return _0x31cac2;};'use strict';var _=require(_0xf906('0x0'));var util=require(_0xf906('0x1'));var moment=require(_0xf906('0x2'));var BPromise=require(_0xf906('0x3'));var rs=require(_0xf906('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf906('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf906('0x6'))(_0xf906('0x7'));var config=require(_0xf906('0x8'));var jayson=require(_0xf906('0x9'));var client=jayson[_0xf906('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f9881,_0xda0b26,_0x2fb506){return new BPromise(function(_0x2a6e1d,_0x3b998b){return client[_0xf906('0xb')](_0x1f9881,_0x2fb506)[_0xf906('0xc')](function(_0x2cc51d){logger['info']('VoiceRecording,\x20%s,\x20%s',_0xda0b26,_0xf906('0xd'));logger['debug'](_0xf906('0xe'),_0xda0b26,_0xf906('0xd'),JSON[_0xf906('0xf')](_0x2cc51d));if(_0x2cc51d[_0xf906('0x10')]){if(_0x2cc51d[_0xf906('0x10')][_0xf906('0x11')]===0x1f4){logger[_0xf906('0x10')](_0xf906('0x12'),_0xda0b26,_0x2cc51d[_0xf906('0x10')][_0xf906('0x13')]);return _0x3b998b(_0x2cc51d[_0xf906('0x10')][_0xf906('0x13')]);}logger[_0xf906('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xda0b26,_0x2cc51d[_0xf906('0x10')][_0xf906('0x13')]);return _0x2a6e1d(_0x2cc51d[_0xf906('0x10')][_0xf906('0x13')]);}else{logger['info'](_0xf906('0x12'),_0xda0b26,'request\x20sent');_0x2a6e1d(_0x2cc51d['result'][_0xf906('0x13')]);}})[_0xf906('0x14')](function(_0x4a2677){logger[_0xf906('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xda0b26,_0x4a2677);_0x3b998b(_0x4a2677);});});}exports[_0xf906('0x15')]=function(_0x273003){var _0x2b72b8=this;return new Promise(function(_0x8bf602,_0x12a5ba){return db['VoiceRecording'][_0xf906('0x16')](_0x273003['body'],{'raw':_0x273003[_0xf906('0x17')]?_0x273003[_0xf906('0x17')][_0xf906('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x273003[_0xf906('0x17')]?_0x273003[_0xf906('0x17')][_0xf906('0x19')]||null:null,'attributes':_0x273003['options']?_0x273003['options'][_0xf906('0x1a')]||null:null,'limit':_0x273003['options']?_0x273003[_0xf906('0x17')][_0xf906('0x1b')]||null:null})[_0xf906('0xc')](function(_0xe415ce){logger[_0xf906('0x1c')](_0xf906('0x15'),_0x273003);logger[_0xf906('0x1d')]('UpdateVoiceRecording',_0x273003,JSON[_0xf906('0xf')](_0xe415ce));_0x8bf602(_0xe415ce);})['catch'](function(_0xd6aead){logger[_0xf906('0x10')](_0xf906('0x15'),_0xd6aead[_0xf906('0x13')],_0x273003);_0x12a5ba(_0x2b72b8[_0xf906('0x10')](0x1f4,_0xd6aead[_0xf906('0x13')]));});});};exports[_0xf906('0x1e')]=function(_0x5504ad){var _0x1d4509=this;return new Promise(function(_0x138ea5,_0x59a848){var _0x1291e1=require('../../components/encryptor');var _0x54e521;return db[_0xf906('0x1f')][_0xf906('0x20')]({'attributes':['id',_0xf906('0x21')],'where':{'id':0x1},'raw':!![]})[_0xf906('0xc')](function(_0x46341e){_0x54e521=_0x46341e;return db['VoiceRecording']['create'](_0x5504ad[_0xf906('0x22')]);})[_0xf906('0xc')](function(_0x4d7108){if(_0x54e521[_0xf906('0x21')]&&fs[_0xf906('0x23')](_0x4d7108[_0xf906('0x24')])){var _0x3f39d0=util[_0xf906('0x25')](_0xf906('0x26'),_0x4d7108[_0xf906('0x24')]);return _0x1291e1[_0xf906('0x27')](_0x4d7108[_0xf906('0x24')],_0x3f39d0,config[_0xf906('0x28')][_0xf906('0x29')])[_0xf906('0xc')](function(){fs['unlink'](_0x4d7108[_0xf906('0x24')]);logger[_0xf906('0x1c')](_0xf906('0x2a'));return _0x4d7108;});}return _0x4d7108;})[_0xf906('0xc')](function(_0x1f495a){logger[_0xf906('0x1c')](_0xf906('0x1e'),_0x5504ad);logger[_0xf906('0x1d')]('CreateVoiceRecording',_0x5504ad,JSON['stringify'](_0x1f495a));_0x138ea5(_0x1f495a);})[_0xf906('0x14')](function(_0x2654cd){logger['error'](_0xf906('0x1e'),_0x2654cd[_0xf906('0x13')],_0x5504ad);_0x59a848(_0x1d4509[_0xf906('0x10')](0x1f4,_0x2654cd[_0xf906('0x13')]));});});}; \ No newline at end of file +var _0x02fb=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','VoiceRecording','update','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','then','body','existsSync','value','format','%s.cypher','encryptFile','secrets','unlink','lodash','util'];(function(_0x2a8631,_0x474172){var _0xd24315=function(_0x4acaa7){while(--_0x4acaa7){_0x2a8631['push'](_0x2a8631['shift']());}};_0xd24315(++_0x474172);}(_0x02fb,0x1b6));var _0xb02f=function(_0x31be14,_0x519b23){_0x31be14=_0x31be14-0x0;var _0x4c8726=_0x02fb[_0x31be14];return _0x4c8726;};'use strict';var _=require(_0xb02f('0x0'));var util=require(_0xb02f('0x1'));var moment=require(_0xb02f('0x2'));var BPromise=require(_0xb02f('0x3'));var rs=require(_0xb02f('0x4'));var fs=require('fs');var Redis=require(_0xb02f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb02f('0x6'));var logger=require(_0xb02f('0x7'))('rpc');var config=require(_0xb02f('0x8'));var jayson=require(_0xb02f('0x9'));var client=jayson[_0xb02f('0xa')][_0xb02f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38b740,_0xd229c6,_0x501f28){return new BPromise(function(_0x2f40da,_0x5af82f){return client[_0xb02f('0xc')](_0x38b740,_0x501f28)['then'](function(_0x2874d4){logger[_0xb02f('0xd')]('VoiceRecording,\x20%s,\x20%s',_0xd229c6,'request\x20sent');logger[_0xb02f('0xe')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0xd229c6,'request\x20sent',JSON[_0xb02f('0xf')](_0x2874d4));if(_0x2874d4[_0xb02f('0x10')]){if(_0x2874d4[_0xb02f('0x10')][_0xb02f('0x11')]===0x1f4){logger[_0xb02f('0x10')](_0xb02f('0x12'),_0xd229c6,_0x2874d4[_0xb02f('0x10')][_0xb02f('0x13')]);return _0x5af82f(_0x2874d4['error'][_0xb02f('0x13')]);}logger[_0xb02f('0x10')](_0xb02f('0x12'),_0xd229c6,_0x2874d4[_0xb02f('0x10')][_0xb02f('0x13')]);return _0x2f40da(_0x2874d4[_0xb02f('0x10')][_0xb02f('0x13')]);}else{logger['info'](_0xb02f('0x12'),_0xd229c6,'request\x20sent');_0x2f40da(_0x2874d4[_0xb02f('0x14')]['message']);}})[_0xb02f('0x15')](function(_0xf7043d){logger[_0xb02f('0x10')](_0xb02f('0x12'),_0xd229c6,_0xf7043d);_0x5af82f(_0xf7043d);});});}exports['UpdateVoiceRecording']=function(_0x5e4823){var _0x18ae64=this;return new Promise(function(_0xfeef1a,_0x4a411a){return db[_0xb02f('0x16')][_0xb02f('0x17')](_0x5e4823['body'],{'raw':_0x5e4823[_0xb02f('0x18')]?_0x5e4823[_0xb02f('0x18')][_0xb02f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e4823[_0xb02f('0x18')]?_0x5e4823[_0xb02f('0x18')][_0xb02f('0x1a')]||null:null,'attributes':_0x5e4823[_0xb02f('0x18')]?_0x5e4823[_0xb02f('0x18')][_0xb02f('0x1b')]||null:null,'limit':_0x5e4823[_0xb02f('0x18')]?_0x5e4823[_0xb02f('0x18')][_0xb02f('0x1c')]||null:null})['then'](function(_0x5c879d){logger[_0xb02f('0xd')](_0xb02f('0x1d'),_0x5e4823);logger[_0xb02f('0xe')]('UpdateVoiceRecording',_0x5e4823,JSON[_0xb02f('0xf')](_0x5c879d));_0xfeef1a(_0x5c879d);})['catch'](function(_0x428ef9){logger[_0xb02f('0x10')](_0xb02f('0x1d'),_0x428ef9[_0xb02f('0x13')],_0x5e4823);_0x4a411a(_0x18ae64['error'](0x1f4,_0x428ef9[_0xb02f('0x13')]));});});};exports[_0xb02f('0x1e')]=function(_0xfc9f88){var _0x1f94dc=this;return new Promise(function(_0x3dac1,_0x4af3d7){var _0x53ec17=require(_0xb02f('0x1f'));var _0x32cd80;return db[_0xb02f('0x20')][_0xb02f('0x21')]({'attributes':['id',_0xb02f('0x22')],'where':{'id':0x1},'raw':!![]})[_0xb02f('0x23')](function(_0x5acb8e){_0x32cd80=_0x5acb8e;return db['VoiceRecording']['create'](_0xfc9f88[_0xb02f('0x24')]);})[_0xb02f('0x23')](function(_0x92d3bd){if(_0x32cd80['callRecordingEncryption']&&fs[_0xb02f('0x25')](_0x92d3bd[_0xb02f('0x26')])){var _0x146cd4=util[_0xb02f('0x27')](_0xb02f('0x28'),_0x92d3bd[_0xb02f('0x26')]);return _0x53ec17[_0xb02f('0x29')](_0x92d3bd['value'],_0x146cd4,config[_0xb02f('0x2a')]['recording'])[_0xb02f('0x23')](function(){fs[_0xb02f('0x2b')](_0x92d3bd[_0xb02f('0x26')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x92d3bd;});}return _0x92d3bd;})['then'](function(_0x27fd6a){logger[_0xb02f('0xd')]('CreateVoiceRecording',_0xfc9f88);logger[_0xb02f('0xe')](_0xb02f('0x1e'),_0xfc9f88,JSON[_0xb02f('0xf')](_0x27fd6a));_0x3dac1(_0x27fd6a);})['catch'](function(_0x51b2d2){logger[_0xb02f('0x10')]('CreateVoiceRecording',_0x51b2d2[_0xb02f('0x13')],_0xfc9f88);_0x4af3d7(_0x1f94dc[_0xb02f('0x10')](0x1f4,_0x51b2d2[_0xb02f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 2ea00ff..3c6849c 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 _0x61a7=['../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','show','post','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5b8572,_0x693050){var _0x74b65a=function(_0x468b07){while(--_0x468b07){_0x5b8572['push'](_0x5b8572['shift']());}};_0x74b65a(++_0x693050);}(_0x61a7,0xbf));var _0x761a=function(_0x1ad17d,_0x23b10c){_0x1ad17d=_0x1ad17d-0x0;var _0x2e4ceb=_0x61a7[_0x1ad17d];return _0x2e4ceb;};'use strict';var multer=require(_0x761a('0x0'));var util=require(_0x761a('0x1'));var path=require(_0x761a('0x2'));var timeout=require('connect-timeout');var express=require(_0x761a('0x3'));var router=express[_0x761a('0x4')]();var auth=require(_0x761a('0x5'));var interaction=require(_0x761a('0x6'));var config=require(_0x761a('0x7'));var controller=require(_0x761a('0x8'));router[_0x761a('0x9')]('/',auth[_0x761a('0xa')](),controller[_0x761a('0xb')]);router[_0x761a('0x9')](_0x761a('0xc'),auth[_0x761a('0xa')](),controller[_0x761a('0xd')]);router[_0x761a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x761a('0xc'),auth[_0x761a('0xa')](),controller[_0x761a('0xf')]);router['delete'](_0x761a('0xc'),auth[_0x761a('0xa')](),controller[_0x761a('0x10')]);module[_0x761a('0x11')]=router; \ No newline at end of file +var _0x9701=['Router','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2ace95,_0x186b37){var _0x35ecfa=function(_0x26ce5a){while(--_0x26ce5a){_0x2ace95['push'](_0x2ace95['shift']());}};_0x35ecfa(++_0x186b37);}(_0x9701,0x95));var _0x1970=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9701[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x1970('0x0'));var util=require(_0x1970('0x1'));var path=require(_0x1970('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1970('0x3')]();var auth=require(_0x1970('0x4'));var interaction=require(_0x1970('0x5'));var config=require('../../config/environment');var controller=require(_0x1970('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1970('0x7')]);router[_0x1970('0x8')](_0x1970('0x9'),auth[_0x1970('0xa')](),controller[_0x1970('0xb')]);router[_0x1970('0xc')]('/',auth[_0x1970('0xa')](),controller[_0x1970('0xd')]);router[_0x1970('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1970('0xf')]);router[_0x1970('0x10')]('/:id',auth[_0x1970('0xa')](),controller[_0x1970('0x11')]);module[_0x1970('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index c0d9a30..ace67fb 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 _0xb6e7=['STRING','Yes','sequelize','exports','ENUM','blind','attended'];(function(_0x47014e,_0x197853){var _0x529d52=function(_0x144e4c){while(--_0x144e4c){_0x47014e['push'](_0x47014e['shift']());}};_0x529d52(++_0x197853);}(_0xb6e7,0x175));var _0x7b6e=function(_0x38339a,_0x5d5da3){_0x38339a=_0x38339a-0x0;var _0xb0ee4=_0xb6e7[_0x38339a];return _0xb0ee4;};'use strict';var Sequelize=require(_0x7b6e('0x0'));var moment=require('moment');module[_0x7b6e('0x1')]={'type':{'type':Sequelize[_0x7b6e('0x2')](_0x7b6e('0x3'),_0x7b6e('0x4'))},'result':{'type':Sequelize[_0x7b6e('0x5')]},'transfererchannel':{'type':Sequelize[_0x7b6e('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x7b6e('0x5')]},'transferercalleridname':{'type':Sequelize[_0x7b6e('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x7b6e('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x7b6e('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x7b6e('0x5')]},'transferercontext':{'type':Sequelize[_0x7b6e('0x5')]},'transfererexten':{'type':Sequelize[_0x7b6e('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x7b6e('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x7b6e('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x7b6e('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x7b6e('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x7b6e('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x7b6e('0x5')]},'transfereeexten':{'type':Sequelize[_0x7b6e('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x7b6e('0x5')]},'isexternal':{'type':Sequelize[_0x7b6e('0x2')](_0x7b6e('0x6'),'No')},'context':{'type':Sequelize[_0x7b6e('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x40cf=['attended','STRING','sequelize','moment','ENUM'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x40cf,0x1f1));var _0xf40c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40cf[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf40c('0x0'));var moment=require(_0xf40c('0x1'));module['exports']={'type':{'type':Sequelize[_0xf40c('0x2')]('blind',_0xf40c('0x3'))},'result':{'type':Sequelize[_0xf40c('0x4')]},'transfererchannel':{'type':Sequelize[_0xf40c('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xf40c('0x4')]},'transferercalleridname':{'type':Sequelize[_0xf40c('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xf40c('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xf40c('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xf40c('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xf40c('0x4')]},'transfereechannel':{'type':Sequelize[_0xf40c('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xf40c('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xf40c('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xf40c('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xf40c('0x4')]},'transfereecontext':{'type':Sequelize[_0xf40c('0x4')]},'transfereeexten':{'type':Sequelize[_0xf40c('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xf40c('0x4')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xf40c('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index fd54e2c..f779532 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 _0x6d3c=['show','params','options','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','VoiceTransferReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','key','field','merge','count','includeAll','include','rows','catch'];(function(_0x426aab,_0x16aa92){var _0xa8d845=function(_0x2e6277){while(--_0x2e6277){_0x426aab['push'](_0x426aab['shift']());}};_0xa8d845(++_0x16aa92);}(_0x6d3c,0x1c9));var _0xc6d3=function(_0xa4baad,_0x3617b3){_0xa4baad=_0xa4baad-0x0;var _0x4f9acd=_0x6d3c[_0xa4baad];return _0x4f9acd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc6d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6d3('0x1'));var jsonpatch=require(_0xc6d3('0x2'));var rp=require(_0xc6d3('0x3'));var moment=require(_0xc6d3('0x4'));var BPromise=require(_0xc6d3('0x5'));var Mustache=require(_0xc6d3('0x6'));var util=require(_0xc6d3('0x7'));var path=require(_0xc6d3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc6d3('0x9'));var fs=require('fs');var _=require(_0xc6d3('0xa'));var squel=require('squel');var crypto=require(_0xc6d3('0xb'));var jsforce=require(_0xc6d3('0xc'));var deskjs=require(_0xc6d3('0xd'));var toCsv=require(_0xc6d3('0xe'));var querystring=require(_0xc6d3('0xf'));var Papa=require('papaparse');var authService=require(_0xc6d3('0x10'));var hardwareService=require(_0xc6d3('0x11'));var Redis=require(_0xc6d3('0x12'));var qs=require(_0xc6d3('0x13'));var logger=require(_0xc6d3('0x14'))(_0xc6d3('0x15'));var utils=require(_0xc6d3('0x16'));var config=require(_0xc6d3('0x17'));var db=require(_0xc6d3('0x18'))['db'];function respondWithStatusCode(_0x9f31de,_0x4ab33a){_0x4ab33a=_0x4ab33a||0xcc;return function(_0x52d90b){if(_0x52d90b){return _0x9f31de[_0xc6d3('0x19')](_0x4ab33a);}return _0x9f31de[_0xc6d3('0x1a')](_0x4ab33a)[_0xc6d3('0x1b')]();};}function respondWithResult(_0x5833a9,_0x225e7c){_0x225e7c=_0x225e7c||0xc8;return function(_0x301b51){if(_0x301b51){return _0x5833a9[_0xc6d3('0x1a')](_0x225e7c)[_0xc6d3('0x1c')](_0x301b51);}};}function respondWithFilteredResult(_0x18887f,_0x550f1b){return function(_0x384c80){if(_0x384c80){var _0x39fe14=_0x384c80['count'],_0x5d8906=_0x550f1b['offset'],_0x309b97=_0x550f1b[_0xc6d3('0x1d')]+_0x550f1b['limit'],_0x592a09;if(_0x309b97>=_0x39fe14){_0x309b97=_0x39fe14;_0x592a09=0xc8;}else{_0x592a09=0xce;}_0x18887f[_0xc6d3('0x1a')](_0x592a09);return _0x18887f[_0xc6d3('0x1e')](_0xc6d3('0x1f'),_0x5d8906+'-'+_0x309b97+'/'+_0x39fe14)[_0xc6d3('0x1c')](_0x384c80);}return null;};}function patchUpdates(_0x5b19e9){return function(_0x17245f){try{jsonpatch[_0xc6d3('0x20')](_0x17245f,_0x5b19e9,!![]);}catch(_0x4915a5){return BPromise[_0xc6d3('0x21')](_0x4915a5);}return _0x17245f[_0xc6d3('0x22')]();};}function saveUpdates(_0x461585,_0x3c5c12){return function(_0x15571f){if(_0x15571f){return _0x15571f[_0xc6d3('0x23')](_0x461585)[_0xc6d3('0x24')](function(_0x39cec2){return _0x39cec2;});}return null;};}function removeEntity(_0x2143fe,_0x512848){return function(_0x35e253){if(_0x35e253){return _0x35e253['destroy']()[_0xc6d3('0x24')](function(){_0x2143fe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d76d4,_0x13092c){return function(_0x27ef9f){if(!_0x27ef9f){_0x3d76d4[_0xc6d3('0x19')](0x194);}return _0x27ef9f;};}function handleError(_0x8a7334,_0x128248){_0x128248=_0x128248||0x1f4;return function(_0x42e421){logger[_0xc6d3('0x25')](_0x42e421[_0xc6d3('0x26')]);if(_0x42e421[_0xc6d3('0x27')]){delete _0x42e421['name'];}_0x8a7334[_0xc6d3('0x1a')](_0x128248)[_0xc6d3('0x28')](_0x42e421);};}exports[_0xc6d3('0x29')]=function(_0x4eaa2c,_0x1e9fee){var _0x350d07={},_0x1c0f6f={},_0x48e96d={'count':0x0,'rows':[]};var _0x3ab80f=db[_0xc6d3('0x2a')][_0xc6d3('0x2b')];_0x1c0f6f['model']=_[_0xc6d3('0x2c')](_0x3ab80f);_0x1c0f6f[_0xc6d3('0x2d')]=_[_0xc6d3('0x2c')](_0x4eaa2c['query']);_0x1c0f6f[_0xc6d3('0x2e')]=_[_0xc6d3('0x2f')](_0x1c0f6f[_0xc6d3('0x30')],_0x1c0f6f[_0xc6d3('0x2d')]);_0x350d07[_0xc6d3('0x31')]=_[_0xc6d3('0x2f')](_0x1c0f6f['model'],qs[_0xc6d3('0x32')](_0x4eaa2c[_0xc6d3('0x2d')][_0xc6d3('0x32')]));_0x350d07['attributes']=_0x350d07['attributes'][_0xc6d3('0x33')]?_0x350d07[_0xc6d3('0x31')]:_0x1c0f6f['model'];if(!_0x4eaa2c['query'][_0xc6d3('0x34')](_0xc6d3('0x35'))){_0x350d07[_0xc6d3('0x36')]=qs[_0xc6d3('0x36')](_0x4eaa2c[_0xc6d3('0x2d')][_0xc6d3('0x36')]);_0x350d07[_0xc6d3('0x1d')]=qs['offset'](_0x4eaa2c[_0xc6d3('0x2d')][_0xc6d3('0x1d')]);}_0x350d07[_0xc6d3('0x37')]=qs[_0xc6d3('0x38')](_0x4eaa2c[_0xc6d3('0x2d')][_0xc6d3('0x38')]);_0x350d07[_0xc6d3('0x39')]=qs['filters'](_[_0xc6d3('0x3a')](_0x4eaa2c[_0xc6d3('0x2d')],_0x1c0f6f[_0xc6d3('0x2e')]));if(_0x4eaa2c[_0xc6d3('0x2d')]['filter']){_0x350d07[_0xc6d3('0x39')]=_['merge'](_0x350d07[_0xc6d3('0x39')],{'$or':_[_0xc6d3('0x3b')](_0x3ab80f,function(_0x48c9db){if(_0x48c9db['type'][_0xc6d3('0x3c')]!=='VIRTUAL'){var _0x315abd={};_0x315abd[_0x48c9db[_0xc6d3('0x3d')]]={'$like':'%'+_0x4eaa2c[_0xc6d3('0x2d')]['filter']+'%'};return _0x315abd;}})});}_0x350d07=_[_0xc6d3('0x3e')]({},_0x350d07,_0x4eaa2c['options']);var _0x3d70ac={'where':_0x350d07[_0xc6d3('0x39')]};return db['VoiceTransferReport'][_0xc6d3('0x3f')](_0x3d70ac)['then'](function(_0x20f69e){_0x48e96d['count']=_0x20f69e;if(_0x4eaa2c[_0xc6d3('0x2d')][_0xc6d3('0x40')]){_0x350d07[_0xc6d3('0x41')]=[{'all':!![]}];}return db[_0xc6d3('0x2a')]['findAll'](_0x350d07);})['then'](function(_0x291b3e){_0x48e96d[_0xc6d3('0x42')]=_0x291b3e;return _0x48e96d;})[_0xc6d3('0x24')](respondWithFilteredResult(_0x1e9fee,_0x350d07))[_0xc6d3('0x43')](handleError(_0x1e9fee,null));};exports[_0xc6d3('0x44')]=function(_0x392d51,_0x5d9698){var _0x3ce9be={'raw':!![],'where':{'id':_0x392d51[_0xc6d3('0x45')]['id']}},_0x2d5df3={};_0x2d5df3['model']=_[_0xc6d3('0x2c')](db['VoiceTransferReport'][_0xc6d3('0x2b')]);_0x2d5df3['query']=_[_0xc6d3('0x2c')](_0x392d51[_0xc6d3('0x2d')]);_0x2d5df3['filters']=_['intersection'](_0x2d5df3[_0xc6d3('0x30')],_0x2d5df3[_0xc6d3('0x2d')]);_0x3ce9be[_0xc6d3('0x31')]=_[_0xc6d3('0x2f')](_0x2d5df3['model'],qs[_0xc6d3('0x32')](_0x392d51[_0xc6d3('0x2d')]['fields']));_0x3ce9be[_0xc6d3('0x31')]=_0x3ce9be[_0xc6d3('0x31')][_0xc6d3('0x33')]?_0x3ce9be['attributes']:_0x2d5df3[_0xc6d3('0x30')];if(_0x392d51[_0xc6d3('0x2d')]['includeAll']){_0x3ce9be[_0xc6d3('0x41')]=[{'all':!![]}];}_0x3ce9be=_['merge']({},_0x3ce9be,_0x392d51[_0xc6d3('0x46')]);return db['VoiceTransferReport'][_0xc6d3('0x47')](_0x3ce9be)[_0xc6d3('0x24')](handleEntityNotFound(_0x5d9698,null))[_0xc6d3('0x24')](respondWithResult(_0x5d9698,null))[_0xc6d3('0x43')](handleError(_0x5d9698,null));};exports['create']=function(_0x38f52e,_0x34b247){return db[_0xc6d3('0x2a')][_0xc6d3('0x48')](_0x38f52e[_0xc6d3('0x49')],{})[_0xc6d3('0x24')](respondWithResult(_0x34b247,0xc9))[_0xc6d3('0x43')](handleError(_0x34b247,null));};exports[_0xc6d3('0x23')]=function(_0x47db21,_0x3710c4){if(_0x47db21[_0xc6d3('0x49')]['id']){delete _0x47db21[_0xc6d3('0x49')]['id'];}return db[_0xc6d3('0x2a')][_0xc6d3('0x47')]({'where':{'id':_0x47db21['params']['id']}})[_0xc6d3('0x24')](handleEntityNotFound(_0x3710c4,null))[_0xc6d3('0x24')](saveUpdates(_0x47db21[_0xc6d3('0x49')],null))[_0xc6d3('0x24')](respondWithResult(_0x3710c4,null))['catch'](handleError(_0x3710c4,null));};exports[_0xc6d3('0x4a')]=function(_0x328755,_0x24203d){return db[_0xc6d3('0x2a')]['find']({'where':{'id':_0x328755[_0xc6d3('0x45')]['id']}})['then'](handleEntityNotFound(_0x24203d,null))[_0xc6d3('0x24')](removeEntity(_0x24203d,null))[_0xc6d3('0x43')](handleError(_0x24203d,null));}; \ No newline at end of file +var _0xf2fe=['../../config/utils','../../mysqldb','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','index','VoiceTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','map','key','VIRTUAL','field','filter','merge','options','count','includeAll','include','findAll','rows','show','params','catch','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xf2fe,0xc3));var _0xef2f=function(_0x461115,_0x45aad6){_0x461115=_0x461115-0x0;var _0x35d2aa=_0xf2fe[_0x461115];return _0x35d2aa;};'use strict';var pdf=require(_0xef2f('0x0'));var emlformat=require(_0xef2f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xef2f('0x2'));var jsonpatch=require(_0xef2f('0x3'));var rp=require(_0xef2f('0x4'));var moment=require('moment');var BPromise=require(_0xef2f('0x5'));var Mustache=require(_0xef2f('0x6'));var util=require(_0xef2f('0x7'));var path=require(_0xef2f('0x8'));var sox=require('sox');var csv=require(_0xef2f('0x9'));var ejs=require(_0xef2f('0xa'));var fs=require('fs');var _=require(_0xef2f('0xb'));var squel=require(_0xef2f('0xc'));var crypto=require(_0xef2f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xef2f('0xe'));var toCsv=require(_0xef2f('0x9'));var querystring=require(_0xef2f('0xf'));var Papa=require(_0xef2f('0x10'));var authService=require('../../components/auth/service');var hardwareService=require('../../config/license/hardware');var Redis=require(_0xef2f('0x11'));var qs=require(_0xef2f('0x12'));var logger=require(_0xef2f('0x13'))(_0xef2f('0x14'));var utils=require(_0xef2f('0x15'));var config=require('../../config/environment');var db=require(_0xef2f('0x16'))['db'];function respondWithStatusCode(_0x2a38f8,_0x385a95){_0x385a95=_0x385a95||0xcc;return function(_0x2f2f28){if(_0x2f2f28){return _0x2a38f8['sendStatus'](_0x385a95);}return _0x2a38f8[_0xef2f('0x17')](_0x385a95)[_0xef2f('0x18')]();};}function respondWithResult(_0x50640f,_0x104827){_0x104827=_0x104827||0xc8;return function(_0x32dda1){if(_0x32dda1){return _0x50640f[_0xef2f('0x17')](_0x104827)[_0xef2f('0x19')](_0x32dda1);}};}function respondWithFilteredResult(_0x962d41,_0x5e9008){return function(_0xf5d2bd){if(_0xf5d2bd){var _0x1e4f50=_0xf5d2bd['count'],_0x53e947=_0x5e9008['offset'],_0x575bdc=_0x5e9008[_0xef2f('0x1a')]+_0x5e9008[_0xef2f('0x1b')],_0x1e5602;if(_0x575bdc>=_0x1e4f50){_0x575bdc=_0x1e4f50;_0x1e5602=0xc8;}else{_0x1e5602=0xce;}_0x962d41['status'](_0x1e5602);return _0x962d41[_0xef2f('0x1c')](_0xef2f('0x1d'),_0x53e947+'-'+_0x575bdc+'/'+_0x1e4f50)[_0xef2f('0x19')](_0xf5d2bd);}return null;};}function patchUpdates(_0x3c7f4c){return function(_0x2520ab){try{jsonpatch['apply'](_0x2520ab,_0x3c7f4c,!![]);}catch(_0x4705ca){return BPromise[_0xef2f('0x1e')](_0x4705ca);}return _0x2520ab[_0xef2f('0x1f')]();};}function saveUpdates(_0x567c53,_0x4ce661){return function(_0x5ba7b3){if(_0x5ba7b3){return _0x5ba7b3[_0xef2f('0x20')](_0x567c53)[_0xef2f('0x21')](function(_0x117566){return _0x117566;});}return null;};}function removeEntity(_0x124c73,_0x3ffa87){return function(_0x13930e){if(_0x13930e){return _0x13930e[_0xef2f('0x22')]()[_0xef2f('0x21')](function(){_0x124c73[_0xef2f('0x17')](0xcc)[_0xef2f('0x18')]();});}};}function handleEntityNotFound(_0x38fdd2,_0x253181){return function(_0x1a645f){if(!_0x1a645f){_0x38fdd2[_0xef2f('0x23')](0x194);}return _0x1a645f;};}function handleError(_0x29e74e,_0x21ff72){_0x21ff72=_0x21ff72||0x1f4;return function(_0x19149c){logger['error'](_0x19149c[_0xef2f('0x24')]);if(_0x19149c[_0xef2f('0x25')]){delete _0x19149c[_0xef2f('0x25')];}_0x29e74e[_0xef2f('0x17')](_0x21ff72)['send'](_0x19149c);};}exports[_0xef2f('0x26')]=function(_0x3d9701,_0x599d75){var _0x2acc7b={},_0x26e3ad={},_0x5524be={'count':0x0,'rows':[]};var _0x77469f=db[_0xef2f('0x27')][_0xef2f('0x28')];_0x26e3ad[_0xef2f('0x29')]=_[_0xef2f('0x2a')](_0x77469f);_0x26e3ad[_0xef2f('0x2b')]=_['keys'](_0x3d9701[_0xef2f('0x2b')]);_0x26e3ad[_0xef2f('0x2c')]=_[_0xef2f('0x2d')](_0x26e3ad[_0xef2f('0x29')],_0x26e3ad['query']);_0x2acc7b[_0xef2f('0x2e')]=_['intersection'](_0x26e3ad[_0xef2f('0x29')],qs['fields'](_0x3d9701[_0xef2f('0x2b')][_0xef2f('0x2f')]));_0x2acc7b[_0xef2f('0x2e')]=_0x2acc7b[_0xef2f('0x2e')][_0xef2f('0x30')]?_0x2acc7b[_0xef2f('0x2e')]:_0x26e3ad[_0xef2f('0x29')];if(!_0x3d9701['query']['hasOwnProperty'](_0xef2f('0x31'))){_0x2acc7b['limit']=qs[_0xef2f('0x1b')](_0x3d9701['query'][_0xef2f('0x1b')]);_0x2acc7b['offset']=qs[_0xef2f('0x1a')](_0x3d9701[_0xef2f('0x2b')][_0xef2f('0x1a')]);}_0x2acc7b[_0xef2f('0x32')]=qs['sort'](_0x3d9701['query'][_0xef2f('0x33')]);_0x2acc7b[_0xef2f('0x34')]=qs[_0xef2f('0x2c')](_[_0xef2f('0x35')](_0x3d9701[_0xef2f('0x2b')],_0x26e3ad['filters']));if(_0x3d9701[_0xef2f('0x2b')]['filter']){_0x2acc7b[_0xef2f('0x34')]=_['merge'](_0x2acc7b[_0xef2f('0x34')],{'$or':_[_0xef2f('0x36')](_0x77469f,function(_0x49a3fe){if(_0x49a3fe['type'][_0xef2f('0x37')]!==_0xef2f('0x38')){var _0x2f3bd3={};_0x2f3bd3[_0x49a3fe[_0xef2f('0x39')]]={'$like':'%'+_0x3d9701[_0xef2f('0x2b')][_0xef2f('0x3a')]+'%'};return _0x2f3bd3;}})});}_0x2acc7b=_[_0xef2f('0x3b')]({},_0x2acc7b,_0x3d9701[_0xef2f('0x3c')]);var _0xa893f6={'where':_0x2acc7b[_0xef2f('0x34')]};return db['VoiceTransferReport'][_0xef2f('0x3d')](_0xa893f6)[_0xef2f('0x21')](function(_0x562b15){_0x5524be['count']=_0x562b15;if(_0x3d9701[_0xef2f('0x2b')][_0xef2f('0x3e')]){_0x2acc7b[_0xef2f('0x3f')]=[{'all':!![]}];}return db[_0xef2f('0x27')][_0xef2f('0x40')](_0x2acc7b);})['then'](function(_0x6b7fed){_0x5524be[_0xef2f('0x41')]=_0x6b7fed;return _0x5524be;})[_0xef2f('0x21')](respondWithFilteredResult(_0x599d75,_0x2acc7b))['catch'](handleError(_0x599d75,null));};exports[_0xef2f('0x42')]=function(_0x308949,_0x4c6124){var _0x353be8={'raw':!![],'where':{'id':_0x308949[_0xef2f('0x43')]['id']}},_0x44f408={};_0x44f408['model']=_[_0xef2f('0x2a')](db['VoiceTransferReport'][_0xef2f('0x28')]);_0x44f408['query']=_[_0xef2f('0x2a')](_0x308949[_0xef2f('0x2b')]);_0x44f408[_0xef2f('0x2c')]=_[_0xef2f('0x2d')](_0x44f408[_0xef2f('0x29')],_0x44f408[_0xef2f('0x2b')]);_0x353be8[_0xef2f('0x2e')]=_['intersection'](_0x44f408[_0xef2f('0x29')],qs[_0xef2f('0x2f')](_0x308949[_0xef2f('0x2b')][_0xef2f('0x2f')]));_0x353be8[_0xef2f('0x2e')]=_0x353be8[_0xef2f('0x2e')]['length']?_0x353be8[_0xef2f('0x2e')]:_0x44f408[_0xef2f('0x29')];if(_0x308949[_0xef2f('0x2b')][_0xef2f('0x3e')]){_0x353be8[_0xef2f('0x3f')]=[{'all':!![]}];}_0x353be8=_[_0xef2f('0x3b')]({},_0x353be8,_0x308949['options']);return db['VoiceTransferReport']['find'](_0x353be8)[_0xef2f('0x21')](handleEntityNotFound(_0x4c6124,null))['then'](respondWithResult(_0x4c6124,null))[_0xef2f('0x44')](handleError(_0x4c6124,null));};exports[_0xef2f('0x45')]=function(_0x2c67d4,_0x4254a1){return db[_0xef2f('0x27')]['create'](_0x2c67d4['body'],{})[_0xef2f('0x21')](respondWithResult(_0x4254a1,0xc9))[_0xef2f('0x44')](handleError(_0x4254a1,null));};exports[_0xef2f('0x20')]=function(_0x1e881e,_0x2dab89){if(_0x1e881e[_0xef2f('0x46')]['id']){delete _0x1e881e['body']['id'];}return db[_0xef2f('0x27')][_0xef2f('0x47')]({'where':{'id':_0x1e881e[_0xef2f('0x43')]['id']}})['then'](handleEntityNotFound(_0x2dab89,null))[_0xef2f('0x21')](saveUpdates(_0x1e881e[_0xef2f('0x46')],null))[_0xef2f('0x21')](respondWithResult(_0x2dab89,null))['catch'](handleError(_0x2dab89,null));};exports[_0xef2f('0x22')]=function(_0x5eb51c,_0x28bbc5){return db[_0xef2f('0x27')]['find']({'where':{'id':_0x5eb51c[_0xef2f('0x43')]['id']}})[_0xef2f('0x21')](handleEntityNotFound(_0x28bbc5,null))[_0xef2f('0x21')](removeEntity(_0x28bbc5,null))['catch'](handleError(_0x28bbc5,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 3c249ca..b9a7398 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 _0x880d=['util','../../config/logger','api','moment','request-promise','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash'];(function(_0x45f06a,_0x2d6e27){var _0x381af5=function(_0x500942){while(--_0x500942){_0x45f06a['push'](_0x45f06a['shift']());}};_0x381af5(++_0x2d6e27);}(_0x880d,0xef));var _0xd880=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0x880d[_0x5e6cb8];return _0x3faeb3;};'use strict';var _=require(_0xd880('0x0'));var util=require(_0xd880('0x1'));var logger=require(_0xd880('0x2'))(_0xd880('0x3'));var moment=require(_0xd880('0x4'));var BPromise=require('bluebird');var rp=require(_0xd880('0x5'));var attributes=require(_0xd880('0x6'));module[_0xd880('0x7')]=function(_0x203310,_0x3e27cd){return _0x203310[_0xd880('0x8')](_0xd880('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38d5=['util','api','moment','request-promise','./voiceTransferReport.attributes','define','report_call_transfer','lodash'];(function(_0x4e2545,_0x4e16c4){var _0x1a0f14=function(_0x3cd747){while(--_0x3cd747){_0x4e2545['push'](_0x4e2545['shift']());}};_0x1a0f14(++_0x4e16c4);}(_0x38d5,0xf7));var _0x538d=function(_0x1d0d5f,_0x27f548){_0x1d0d5f=_0x1d0d5f-0x0;var _0x2e0cf7=_0x38d5[_0x1d0d5f];return _0x2e0cf7;};'use strict';var _=require(_0x538d('0x0'));var util=require(_0x538d('0x1'));var logger=require('../../config/logger')(_0x538d('0x2'));var moment=require(_0x538d('0x3'));var BPromise=require('bluebird');var rp=require(_0x538d('0x4'));var attributes=require(_0x538d('0x5'));module['exports']=function(_0x55093c,_0x46f493){return _0x55093c[_0x538d('0x6')]('VoiceTransferReport',attributes,{'tableName':_0x538d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 97d34ae..d7bb6a5 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 _0x68c7=['CreateVoiceTransferReport','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','VoiceTransferReport','create','body','options','raw'];(function(_0x51d972,_0x1b8769){var _0x2b4a26=function(_0x5cfe82){while(--_0x5cfe82){_0x51d972['push'](_0x51d972['shift']());}};_0x2b4a26(++_0x1b8769);}(_0x68c7,0x152));var _0x768c=function(_0x8c2f4,_0x349dff){_0x8c2f4=_0x8c2f4-0x0;var _0x10b99c=_0x68c7[_0x8c2f4];return _0x10b99c;};'use strict';var _=require(_0x768c('0x0'));var util=require(_0x768c('0x1'));var moment=require(_0x768c('0x2'));var BPromise=require('bluebird');var rs=require(_0x768c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x768c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x768c('0x5'))(_0x768c('0x6'));var config=require(_0x768c('0x7'));var jayson=require(_0x768c('0x8'));var client=jayson[_0x768c('0x9')][_0x768c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bd26b,_0x35dda8,_0x3dade6){return new BPromise(function(_0x311046,_0x351765){return client['request'](_0x2bd26b,_0x3dade6)[_0x768c('0xb')](function(_0x301fd5){logger[_0x768c('0xc')](_0x768c('0xd'),_0x35dda8,_0x768c('0xe'));logger[_0x768c('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x35dda8,'request\x20sent',JSON['stringify'](_0x301fd5));if(_0x301fd5[_0x768c('0x10')]){if(_0x301fd5[_0x768c('0x10')][_0x768c('0x11')]===0x1f4){logger['error'](_0x768c('0xd'),_0x35dda8,_0x301fd5['error']['message']);return _0x351765(_0x301fd5['error']['message']);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x35dda8,_0x301fd5[_0x768c('0x10')][_0x768c('0x12')]);return _0x311046(_0x301fd5[_0x768c('0x10')][_0x768c('0x12')]);}else{logger['info'](_0x768c('0xd'),_0x35dda8,'request\x20sent');_0x311046(_0x301fd5[_0x768c('0x13')]['message']);}})[_0x768c('0x14')](function(_0x5eb5d5){logger['error'](_0x768c('0xd'),_0x35dda8,_0x5eb5d5);_0x351765(_0x5eb5d5);});});}exports['CreateVoiceTransferReport']=function(_0x24e101){var _0x1db046=this;return new Promise(function(_0x4d6b63,_0x575c13){return db[_0x768c('0x15')][_0x768c('0x16')](_0x24e101[_0x768c('0x17')],{'raw':_0x24e101[_0x768c('0x18')]?_0x24e101[_0x768c('0x18')][_0x768c('0x19')]===undefined?!![]:![]:!![]})[_0x768c('0xb')](function(_0x5af752){logger[_0x768c('0xc')](_0x768c('0x1a'),_0x24e101);logger['debug'](_0x768c('0x1a'),_0x24e101,JSON[_0x768c('0x1b')](_0x5af752));_0x4d6b63(_0x5af752);})['catch'](function(_0x5355a5){logger['error'](_0x768c('0x1a'),_0x5355a5[_0x768c('0x12')],_0x24e101);_0x575c13(_0x1db046[_0x768c('0x10')](0x1f4,_0x5355a5[_0x768c('0x12')]));});});}; \ No newline at end of file +var _0xc231=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceTransferReport','create','body','options'];(function(_0x2312df,_0x2ae526){var _0x4b2246=function(_0x42ab17){while(--_0x42ab17){_0x2312df['push'](_0x2312df['shift']());}};_0x4b2246(++_0x2ae526);}(_0xc231,0x106));var _0x1c23=function(_0x8816ac,_0x39c5fa){_0x8816ac=_0x8816ac-0x0;var _0x427c94=_0xc231[_0x8816ac];return _0x427c94;};'use strict';var _=require(_0x1c23('0x0'));var util=require(_0x1c23('0x1'));var moment=require('moment');var BPromise=require(_0x1c23('0x2'));var rs=require(_0x1c23('0x3'));var fs=require('fs');var Redis=require(_0x1c23('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c23('0x5'));var logger=require(_0x1c23('0x6'))(_0x1c23('0x7'));var config=require(_0x1c23('0x8'));var jayson=require(_0x1c23('0x9'));var client=jayson[_0x1c23('0xa')][_0x1c23('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4424f0,_0x13ae92,_0xb238f){return new BPromise(function(_0x33b883,_0x2ff20b){return client[_0x1c23('0xc')](_0x4424f0,_0xb238f)[_0x1c23('0xd')](function(_0x17bc43){logger[_0x1c23('0xe')](_0x1c23('0xf'),_0x13ae92,_0x1c23('0x10'));logger[_0x1c23('0x11')](_0x1c23('0x12'),_0x13ae92,_0x1c23('0x10'),JSON[_0x1c23('0x13')](_0x17bc43));if(_0x17bc43[_0x1c23('0x14')]){if(_0x17bc43[_0x1c23('0x14')][_0x1c23('0x15')]===0x1f4){logger[_0x1c23('0x14')](_0x1c23('0xf'),_0x13ae92,_0x17bc43[_0x1c23('0x14')][_0x1c23('0x16')]);return _0x2ff20b(_0x17bc43[_0x1c23('0x14')][_0x1c23('0x16')]);}logger[_0x1c23('0x14')](_0x1c23('0xf'),_0x13ae92,_0x17bc43['error'][_0x1c23('0x16')]);return _0x33b883(_0x17bc43[_0x1c23('0x14')]['message']);}else{logger[_0x1c23('0xe')](_0x1c23('0xf'),_0x13ae92,_0x1c23('0x10'));_0x33b883(_0x17bc43[_0x1c23('0x17')]['message']);}})['catch'](function(_0x36e64d){logger[_0x1c23('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x13ae92,_0x36e64d);_0x2ff20b(_0x36e64d);});});}exports[_0x1c23('0x18')]=function(_0x32ae97){var _0x3e27e6=this;return new Promise(function(_0x3fac94,_0x167f49){return db['VoiceTransferReport'][_0x1c23('0x19')](_0x32ae97[_0x1c23('0x1a')],{'raw':_0x32ae97[_0x1c23('0x1b')]?_0x32ae97[_0x1c23('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xf59379){logger[_0x1c23('0xe')](_0x1c23('0x18'),_0x32ae97);logger[_0x1c23('0x11')](_0x1c23('0x18'),_0x32ae97,JSON[_0x1c23('0x13')](_0xf59379));_0x3fac94(_0xf59379);})[_0x1c23('0x1c')](function(_0x2460b4){logger['error']('CreateVoiceTransferReport',_0x2460b4[_0x1c23('0x16')],_0x32ae97);_0x167f49(_0x3e27e6[_0x1c23('0x14')](0x1f4,_0x2460b4[_0x1c23('0x16')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 92180be..bde45d1 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe0b=['join','None','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/environment','app','./config/pm2/config','./config/schedule','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','online','Offline\x20apps:','status'];(function(_0x30cbff,_0x2bcf1c){var _0x308c80=function(_0x4086cc){while(--_0x4086cc){_0x30cbff['push'](_0x30cbff['shift']());}};_0x308c80(++_0x2bcf1c);}(_0xbe0b,0xe1));var _0xbbe0=function(_0xb99145,_0x25e720){_0xb99145=_0xb99145-0x0;var _0x3a44cc=_0xbe0b[_0xb99145];return _0x3a44cc;};'use strict';var _=require(_0xbbe0('0x0'));var mysqldb=require(_0xbbe0('0x1'));var rpc=require('./rpc');var config=require(_0xbbe0('0x2'));var logger=require('./config/logger')(_0xbbe0('0x3'));var pm2=require('./config/pm2');var pm2Config=require(_0xbbe0('0x4'));var schedule=require(_0xbbe0('0x5'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0xbbe0('0x6')][_0xbbe0('0x7')]()[_0xbbe0('0x8')](function(){return rpc[_0xbbe0('0x9')]();})[_0xbbe0('0x8')](function(_0x514791){logger[_0xbbe0('0xa')](_0x514791);return chat[_0xbbe0('0xb')]();})[_0xbbe0('0x8')](function(){return schedule[_0xbbe0('0xb')]();})[_0xbbe0('0x8')](function(_0x318d6b){logger['info'](_0x318d6b);return pm2[_0xbbe0('0xb')](pm2Config);})[_0xbbe0('0x8')](function(_0x410842){logger[_0xbbe0('0xa')](_0xbbe0('0xc'),_[_0xbbe0('0xd')](_[_0xbbe0('0xe')](_0x410842,{'status':_0xbbe0('0xf')}),'name')['join']());logger[_0xbbe0('0xa')](_0xbbe0('0x10'),_[_0xbbe0('0xd')](_[_0xbbe0('0xe')](_0x410842,function(_0x4eb80e){return _0x4eb80e[_0xbbe0('0x11')]!==_0xbbe0('0xf');}),'name')[_0xbbe0('0x12')]()||_0xbbe0('0x13'));config[_0xbbe0('0x14')]&&require(_0xbbe0('0x15'))['default']();require('./config/license')[_0xbbe0('0x16')]();})[_0xbbe0('0x17')](function(_0x4c11ba){logger[_0xbbe0('0x18')](_0xbbe0('0x19'),_0x4c11ba);process[_0xbbe0('0x1a')](0x1);});}main(); \ No newline at end of file +var _0xd97e=['then','listen','info','start','map','filter','online','name','Offline\x20apps:','status','join','seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','./config/pm2','./config/pm2/config','./config/schedule/chat','sequelize','sync'];(function(_0x39bc4a,_0x595147){var _0x436b0d=function(_0x44e6eb){while(--_0x44e6eb){_0x39bc4a['push'](_0x39bc4a['shift']());}};_0x436b0d(++_0x595147);}(_0xd97e,0x7a));var _0xed97=function(_0x54d40d,_0x220dfe){_0x54d40d=_0x54d40d-0x0;var _0x191ec5=_0xd97e[_0x54d40d];return _0x191ec5;};'use strict';var _=require('lodash');var mysqldb=require(_0xed97('0x0'));var rpc=require(_0xed97('0x1'));var config=require(_0xed97('0x2'));var logger=require('./config/logger')('app');var pm2=require(_0xed97('0x3'));var pm2Config=require(_0xed97('0x4'));var schedule=require('./config/schedule');var chat=require(_0xed97('0x5'));function main(){return mysqldb['db'][_0xed97('0x6')][_0xed97('0x7')]()[_0xed97('0x8')](function(){return rpc[_0xed97('0x9')]();})[_0xed97('0x8')](function(_0x410c69){logger[_0xed97('0xa')](_0x410c69);return chat[_0xed97('0xb')]();})[_0xed97('0x8')](function(){return schedule[_0xed97('0xb')]();})['then'](function(_0xee35ed){logger[_0xed97('0xa')](_0xee35ed);return pm2[_0xed97('0xb')](pm2Config);})[_0xed97('0x8')](function(_0x4c3023){logger[_0xed97('0xa')]('Online\x20apps:',_[_0xed97('0xc')](_[_0xed97('0xd')](_0x4c3023,{'status':_0xed97('0xe')}),_0xed97('0xf'))['join']());logger['info'](_0xed97('0x10'),_[_0xed97('0xc')](_[_0xed97('0xd')](_0x4c3023,function(_0x54ee0c){return _0x54ee0c[_0xed97('0x11')]!=='online';}),_0xed97('0xf'))[_0xed97('0x12')]()||'None');config[_0xed97('0x13')]&&require('./config/seedDB')[_0xed97('0x14')]();require(_0xed97('0x15'))[_0xed97('0x14')]();})[_0xed97('0x16')](function(_0x34f86f){logger[_0xed97('0x17')](_0xed97('0x18'),_0x34f86f);process[_0xed97('0x19')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 7a88b10..09dbdd9 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 _0x827a=['status','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','authorization','startsWith','find','pass','user','headers','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','isAuthenticated','../../config/license/util','update','Forbidden','canUpdate','sign','signToken','hasRole','userRoles','indexOf','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','motion.user','pick','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','toString','hex','floor','verify','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','../../mysqldb','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','ipaddr.js','secrets','session','role','fullname','name','internal','userpic','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControl','userProfileId','use','ChatInteraction','findOne','params','closed','then'];(function(_0x34e122,_0x2eafa6){var _0x50028d=function(_0x397d9a){while(--_0x397d9a){_0x34e122['push'](_0x34e122['shift']());}};_0x50028d(++_0x2eafa6);}(_0x827a,0x130));var _0xa827=function(_0x455e1a,_0x1bcce7){_0x455e1a=_0x455e1a-0x0;var _0xf13ed1=_0x827a[_0x455e1a];return _0xf13ed1;};'use strict';var db=require(_0xa827('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xa827('0x1'));var _=require(_0xa827('0x2'));var jwt=require(_0xa827('0x3'));var expressJwt=require(_0xa827('0x4'));var compose=require(_0xa827('0x5'));var basicAuth=require(_0xa827('0x6'));var crypto=require(_0xa827('0x7'));var ipaddr=require(_0xa827('0x8'));var validateJwt=expressJwt({'secret':config[_0xa827('0x9')][_0xa827('0xa')]});var userAttributes=['id',_0xa827('0xb'),_0xa827('0xc'),_0xa827('0xd'),_0xa827('0xe'),'email',_0xa827('0xf'),'permissions',_0xa827('0x10'),_0xa827('0x11'),_0xa827('0x12'),_0xa827('0x13'),_0xa827('0x14'),_0xa827('0x15'),_0xa827('0x16'),_0xa827('0x17'),'phoneBarRemoteControlPort',_0xa827('0x18'),'interface',_0xa827('0x19')];exports['isChatInteractionAuthorized']=function(){return isAuthenticated(!![])[_0xa827('0x1a')](function(_0x2affea,_0x426183,_0x30c64b){if(_0x2affea['user']){_0x30c64b();}else{return db[_0xa827('0x1b')][_0xa827('0x1c')]({'where':{'id':_0x2affea[_0xa827('0x1d')]['id']},'attributes':['id',_0xa827('0x1e'),'disposition'],'raw':!![]})[_0xa827('0x1f')](function(_0x2fbc83){if(_0x2fbc83&&_0x2fbc83['closed']){return _0x426183[_0xa827('0x20')](_0x2fbc83[_0xa827('0x21')]===_0xa827('0x22')?0x195:0x193)[_0xa827('0x23')]({'message':_0x2fbc83[_0xa827('0x21')]===_0xa827('0x22')?_0xa827('0x24'):_0xa827('0x25')});}else{_0x30c64b();}})[_0xa827('0x26')](function(_0x4eefb6){_0x30c64b(_0x4eefb6);});}});};function isAuthenticated(_0x4a7bcb){return compose()[_0xa827('0x1a')](function(_0x3b5a45,_0x4efa25,_0x1bb795){if(_0x3b5a45['headers'][_0xa827('0x27')]){if(_[_0xa827('0x28')](_0x3b5a45['headers'][_0xa827('0x27')],'Basic')){var _0x1000c9=basicAuth(_0x3b5a45);db['User'][_0xa827('0x29')]({'where':{'name':_0x1000c9[_0xa827('0xd')]}})[_0xa827('0x1f')](function(_0x147e58){if(!_0x147e58||!_0x147e58['authenticate'](_0x1000c9[_0xa827('0x2a')])){return _0x4efa25[_0xa827('0x20')](0x191)[_0xa827('0x23')]({'message':'Wrong\x20credentials.'});}_0x3b5a45[_0xa827('0x2b')]={'id':_0x147e58['id']};_0x1bb795();})[_0xa827('0x26')](function(_0x207c26){_0x1bb795(_0x207c26);});}else if(_['startsWith'](_0x3b5a45[_0xa827('0x2c')]['authorization'],_0xa827('0x2d'))){validateJwt(_0x3b5a45,_0x4efa25,_0x1bb795);}else{if(_0x4a7bcb){_0x1bb795();}else{return _0x4efa25['status'](0x193)['json']({'message':_0xa827('0x2e')});}}}else if(_0x3b5a45[_0xa827('0x2f')][_0xa827('0x30')]){try{var _0x42307c=jwt['verify'](_0x3b5a45[_0xa827('0x2f')][_0xa827('0x30')],config[_0xa827('0x9')][_0xa827('0xa')],{'audience':hardwareConf[_0xa827('0x31')](),'issuer':hardwareConf[_0xa827('0x31')]()});db[_0xa827('0x32')][_0xa827('0x29')]({'where':{'id':_0x42307c['sub']}})['then'](function(_0x17b80e){if(!_0x17b80e||!_[_0xa827('0x33')](_0x17b80e[_0xa827('0x34')],_0x42307c[_0xa827('0x35')])){return _0x4efa25[_0xa827('0x20')](0x193)[_0xa827('0x23')]({'message':_0xa827('0x36')});}_0x3b5a45[_0xa827('0x2b')]={'id':_0x17b80e['id']};_0x1bb795();})[_0xa827('0x26')](function(_0x28916b){_0x1bb795(_0x28916b);});}catch(_0x1f7a60){console[_0xa827('0x37')](_0x1f7a60);return _0x4efa25['status'](0x193)[_0xa827('0x23')]({'message':_0xa827('0x38')});}}else if(_0x4a7bcb){_0x1bb795();}else{return _0x4efa25[_0xa827('0x20')](0x193)[_0xa827('0x23')]({'message':_0xa827('0x2e')});}})['use'](function(_0x37e991,_0x453d53,_0x892d9e){if(_0x37e991['user']){db['User']['find']({'where':{'id':_0x37e991[_0xa827('0x2b')]['id']},'attributes':userAttributes})[_0xa827('0x1f')](function(_0x3ec607){if(!_0x3ec607){return _0x453d53[_0xa827('0x20')](0x194)[_0xa827('0x23')]({'message':_0xa827('0x39')});}_0x37e991[_0xa827('0x2b')]=_0x3ec607;_0x892d9e();})[_0xa827('0x26')](function(_0x19e1ea){_0x892d9e(_0x19e1ea);});}else if(_0x4a7bcb){_0x892d9e();}else{return _0x453d53[_0xa827('0x20')](0x194)[_0xa827('0x23')]({'message':'User\x20object\x20not\x20found.'});}});}exports[_0xa827('0x3a')]=isAuthenticated;function canUpdate(){return compose()[_0xa827('0x1a')](function(_0x355f3c,_0x912611,_0x1f9bc5){return require(_0xa827('0x3b'))['getLicense']()[_0xa827('0x1f')](function(_0x33ad43){if(_0x33ad43[_0xa827('0x3c')]){_0x1f9bc5();}else{return _0x912611[_0xa827('0x20')](0x193)['json']({'message':_0xa827('0x3d')});}})[_0xa827('0x26')](function(_0x48948f){_0x1f9bc5(_0x48948f);});});}exports[_0xa827('0x3e')]=canUpdate;function signToken(_0x41162f,_0x357b75){return jwt[_0xa827('0x3f')]({'id':_0x41162f,'role':_0x357b75},config['secrets'][_0xa827('0xa')],{'expiresIn':0x15180});}exports[_0xa827('0x40')]=signToken;exports[_0xa827('0x41')]=function(_0x11e7b4){if(!_0x11e7b4){throw new Error('Required\x20role\x20needs\x20to\x20be\x20set');}return compose()[_0xa827('0x1a')](isAuthenticated())['use'](function meetsRequirements(_0x5f0aa2,_0x144aee,_0x4a4626){if(config[_0xa827('0x42')][_0xa827('0x43')](_0x5f0aa2['user'][_0xa827('0xb')])>=config[_0xa827('0x42')][_0xa827('0x43')](_0x11e7b4)){return _0x4a4626();}else{return _0x144aee['status'](0x193)[_0xa827('0x23')]({'message':_0xa827('0x3d')});}});};exports[_0xa827('0x44')]=function(_0x5f256c,_0x5af44c){if(!_0x5f256c[_0xa827('0x2b')]){return _0x5af44c[_0xa827('0x20')](0x194)[_0xa827('0x23')]({'message':_0xa827('0x45')});}var _0xb02c07=signToken(_0x5f256c['user']['id'],_0x5f256c[_0xa827('0x2b')][_0xa827('0xb')]);_0x5af44c[_0xa827('0x46')](_0xa827('0x47'),_0xb02c07);_0x5af44c[_0xa827('0x46')](_0xa827('0x48'),JSON['stringify'](_[_0xa827('0x49')](_0x5f256c[_0xa827('0x2b')],userAttributes)));_0x5af44c['redirect'](_0xa827('0x4a'));};exports[_0xa827('0x4b')]=function(_0x43949b){if(_[_0xa827('0x4c')](_0x43949b[_0xa827('0x34')])||_[_0xa827('0x4c')](_0x43949b[_0xa827('0x4d')]))return null;else return createJwt(_0x43949b);};exports['generateApiKey']=function(_0x4cf481){_0x4cf481[_0xa827('0x34')]=crypto['randomBytes'](0x10)[_0xa827('0x4e')](_0xa827('0x4f'));_0x4cf481['apiKeyIat']=Math[_0xa827('0x50')](Date['now']()/0x3e8)['toString']();return createJwt(_0x4cf481);};exports['regenerateApiKey']=function(_0x4204e9,_0x1ba5c0){if(_0x4204e9[_0xa827('0x2f')]['apikey']){jwt[_0xa827('0x51')](_0x4204e9['query'][_0xa827('0x30')],config[_0xa827('0x9')]['session'],{'nonce':_0x1ba5c0[_0xa827('0x34')],'iat':_0x1ba5c0[_0xa827('0x4d')],'audience':hardwareConf[_0xa827('0x31')](),'issuer':hardwareConf[_0xa827('0x31')]()});return generateApiKey(_0x1ba5c0);}else{throw{'message':_0xa827('0x52')};}};function createJwt(_0x4364b6){return jwt['sign']({'iat':_0x4364b6[_0xa827('0x4d')],'nonce':_0x4364b6[_0xa827('0x34')]},config[_0xa827('0x9')][_0xa827('0xa')],{'algorithm':_0xa827('0x53'),'subject':_0x4364b6['id']['toString'](),'issuer':hardwareConf[_0xa827('0x31')](),'audience':hardwareConf[_0xa827('0x31')]()});} \ No newline at end of file +var _0x8fcd=['randomBytes','toString','hex','regenerateApiKey','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','basic-auth','crypto','ipaddr.js','secrets','session','role','internal','userpic','permissions','voicePause','chatPause','smsPause','showWebBar','phoneBarRemoteControlPort','userProfileId','isChatInteractionAuthorized','user','ChatInteraction','params','disposition','then','status','unmanaged','Unmanaged.','catch','use','headers','authorization','Basic','User','find','pass','json','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','apikey','verify','query','getUuid','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','Forbidden','canUpdate','sign','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','indexOf','userRoles','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','motion.user','pick','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey'];(function(_0x5a16f7,_0x15e545){var _0x5cb364=function(_0xfa7198){while(--_0xfa7198){_0x5a16f7['push'](_0x5a16f7['shift']());}};_0x5cb364(++_0x15e545);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x1a7809,_0x392d2b){_0x1a7809=_0x1a7809-0x0;var _0x10c780=_0x8fcd[_0x1a7809];return _0x10c780;};'use strict';var db=require(_0xd8fc('0x0'))['db'];var config=require(_0xd8fc('0x1'));var hardwareConf=require(_0xd8fc('0x2'));var _=require(_0xd8fc('0x3'));var jwt=require(_0xd8fc('0x4'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0xd8fc('0x5'));var crypto=require(_0xd8fc('0x6'));var ipaddr=require(_0xd8fc('0x7'));var validateJwt=expressJwt({'secret':config[_0xd8fc('0x8')][_0xd8fc('0x9')]});var userAttributes=['id',_0xd8fc('0xa'),'fullname','name',_0xd8fc('0xb'),'email',_0xd8fc('0xc'),_0xd8fc('0xd'),_0xd8fc('0xe'),_0xd8fc('0xf'),'mailPause','faxPause',_0xd8fc('0x10'),'openchannelPause','pauseType',_0xd8fc('0x11'),_0xd8fc('0x12'),'phoneBarRemoteControl','interface',_0xd8fc('0x13')];exports[_0xd8fc('0x14')]=function(){return isAuthenticated(!![])['use'](function(_0x3c41e9,_0x955550,_0x2b9d7e){if(_0x3c41e9[_0xd8fc('0x15')]){_0x2b9d7e();}else{return db[_0xd8fc('0x16')]['findOne']({'where':{'id':_0x3c41e9[_0xd8fc('0x17')]['id']},'attributes':['id','closed',_0xd8fc('0x18')],'raw':!![]})[_0xd8fc('0x19')](function(_0x3216bf){if(_0x3216bf&&_0x3216bf['closed']){return _0x955550[_0xd8fc('0x1a')](_0x3216bf[_0xd8fc('0x18')]==='unmanaged'?0x195:0x193)['json']({'message':_0x3216bf[_0xd8fc('0x18')]===_0xd8fc('0x1b')?_0xd8fc('0x1c'):'Forbidden.'});}else{_0x2b9d7e();}})[_0xd8fc('0x1d')](function(_0x1c744d){_0x2b9d7e(_0x1c744d);});}});};function isAuthenticated(_0x461f85){return compose()[_0xd8fc('0x1e')](function(_0x39fea5,_0x373654,_0x13a13d){if(_0x39fea5[_0xd8fc('0x1f')][_0xd8fc('0x20')]){if(_['startsWith'](_0x39fea5[_0xd8fc('0x1f')][_0xd8fc('0x20')],_0xd8fc('0x21'))){var _0x3f9d57=basicAuth(_0x39fea5);db[_0xd8fc('0x22')][_0xd8fc('0x23')]({'where':{'name':_0x3f9d57['name']}})[_0xd8fc('0x19')](function(_0x3f0196){if(!_0x3f0196||!_0x3f0196['authenticate'](_0x3f9d57[_0xd8fc('0x24')])){return _0x373654['status'](0x191)[_0xd8fc('0x25')]({'message':_0xd8fc('0x26')});}_0x39fea5['user']={'id':_0x3f0196['id']};_0x13a13d();})['catch'](function(_0x47ccff){_0x13a13d(_0x47ccff);});}else if(_[_0xd8fc('0x27')](_0x39fea5[_0xd8fc('0x1f')][_0xd8fc('0x20')],_0xd8fc('0x28'))){validateJwt(_0x39fea5,_0x373654,_0x13a13d);}else{if(_0x461f85){_0x13a13d();}else{return _0x373654['status'](0x193)[_0xd8fc('0x25')]({'message':_0xd8fc('0x29')});}}}else if(_0x39fea5['query'][_0xd8fc('0x2a')]){try{var _0x5e50c4=jwt[_0xd8fc('0x2b')](_0x39fea5[_0xd8fc('0x2c')][_0xd8fc('0x2a')],config[_0xd8fc('0x8')]['session'],{'audience':hardwareConf[_0xd8fc('0x2d')](),'issuer':hardwareConf['getUuid']()});db[_0xd8fc('0x22')][_0xd8fc('0x23')]({'where':{'id':_0x5e50c4['sub']}})['then'](function(_0x56a980){if(!_0x56a980||!_[_0xd8fc('0x2e')](_0x56a980[_0xd8fc('0x2f')],_0x5e50c4[_0xd8fc('0x30')])){return _0x373654[_0xd8fc('0x1a')](0x193)[_0xd8fc('0x25')]({'message':_0xd8fc('0x31')});}_0x39fea5[_0xd8fc('0x15')]={'id':_0x56a980['id']};_0x13a13d();})[_0xd8fc('0x1d')](function(_0x446609){_0x13a13d(_0x446609);});}catch(_0x5e2e11){console[_0xd8fc('0x32')](_0x5e2e11);return _0x373654[_0xd8fc('0x1a')](0x193)['json']({'message':_0xd8fc('0x33')});}}else if(_0x461f85){_0x13a13d();}else{return _0x373654[_0xd8fc('0x1a')](0x193)[_0xd8fc('0x25')]({'message':'Unknown\x20authorization\x20format'});}})[_0xd8fc('0x1e')](function(_0x180417,_0x175907,_0x59e131){if(_0x180417['user']){db['User'][_0xd8fc('0x23')]({'where':{'id':_0x180417[_0xd8fc('0x15')]['id']},'attributes':userAttributes})[_0xd8fc('0x19')](function(_0x1a40c2){if(!_0x1a40c2){return _0x175907[_0xd8fc('0x1a')](0x194)[_0xd8fc('0x25')]({'message':_0xd8fc('0x34')});}_0x180417[_0xd8fc('0x15')]=_0x1a40c2;_0x59e131();})[_0xd8fc('0x1d')](function(_0x4165d7){_0x59e131(_0x4165d7);});}else if(_0x461f85){_0x59e131();}else{return _0x175907['status'](0x194)[_0xd8fc('0x25')]({'message':'User\x20object\x20not\x20found.'});}});}exports[_0xd8fc('0x35')]=isAuthenticated;function canUpdate(){return compose()['use'](function(_0x500d5a,_0x4647fc,_0x429281){return require(_0xd8fc('0x36'))[_0xd8fc('0x37')]()[_0xd8fc('0x19')](function(_0x3aa3c7){if(_0x3aa3c7['update']){_0x429281();}else{return _0x4647fc[_0xd8fc('0x1a')](0x193)[_0xd8fc('0x25')]({'message':_0xd8fc('0x38')});}})['catch'](function(_0x1fae3e){_0x429281(_0x1fae3e);});});}exports[_0xd8fc('0x39')]=canUpdate;function signToken(_0x563a41,_0x4d39f6){return jwt[_0xd8fc('0x3a')]({'id':_0x563a41,'role':_0x4d39f6},config['secrets'][_0xd8fc('0x9')],{'expiresIn':0x15180});}exports['signToken']=signToken;exports[_0xd8fc('0x3b')]=function(_0x2cd726){if(!_0x2cd726){throw new Error(_0xd8fc('0x3c'));}return compose()['use'](isAuthenticated())[_0xd8fc('0x1e')](function meetsRequirements(_0x48622e,_0xbb9ee5,_0x16f411){if(config['userRoles'][_0xd8fc('0x3d')](_0x48622e[_0xd8fc('0x15')][_0xd8fc('0xa')])>=config[_0xd8fc('0x3e')]['indexOf'](_0x2cd726)){return _0x16f411();}else{return _0xbb9ee5[_0xd8fc('0x1a')](0x193)[_0xd8fc('0x25')]({'message':_0xd8fc('0x38')});}});};exports['setTokenCookie']=function(_0x5a153a,_0x4d8a1f){if(!_0x5a153a[_0xd8fc('0x15')]){return _0x4d8a1f[_0xd8fc('0x1a')](0x194)[_0xd8fc('0x25')]({'message':_0xd8fc('0x3f')});}var _0x5a79eb=signToken(_0x5a153a[_0xd8fc('0x15')]['id'],_0x5a153a[_0xd8fc('0x15')][_0xd8fc('0xa')]);_0x4d8a1f[_0xd8fc('0x40')](_0xd8fc('0x41'),_0x5a79eb);_0x4d8a1f[_0xd8fc('0x40')](_0xd8fc('0x42'),JSON['stringify'](_[_0xd8fc('0x43')](_0x5a153a[_0xd8fc('0x15')],userAttributes)));_0x4d8a1f['redirect'](_0xd8fc('0x44'));};exports[_0xd8fc('0x45')]=function(_0x2bdf1c){if(_[_0xd8fc('0x46')](_0x2bdf1c[_0xd8fc('0x2f')])||_[_0xd8fc('0x46')](_0x2bdf1c[_0xd8fc('0x47')]))return null;else return createJwt(_0x2bdf1c);};exports[_0xd8fc('0x48')]=function(_0xbecf42){_0xbecf42[_0xd8fc('0x2f')]=crypto[_0xd8fc('0x49')](0x10)[_0xd8fc('0x4a')](_0xd8fc('0x4b'));_0xbecf42[_0xd8fc('0x47')]=Math['floor'](Date['now']()/0x3e8)['toString']();return createJwt(_0xbecf42);};exports[_0xd8fc('0x4c')]=function(_0x1951cf,_0x6b462){if(_0x1951cf[_0xd8fc('0x2c')]['apikey']){jwt[_0xd8fc('0x2b')](_0x1951cf[_0xd8fc('0x2c')][_0xd8fc('0x2a')],config[_0xd8fc('0x8')][_0xd8fc('0x9')],{'nonce':_0x6b462[_0xd8fc('0x2f')],'iat':_0x6b462[_0xd8fc('0x47')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()});return generateApiKey(_0x6b462);}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function createJwt(_0x1522d5){return jwt[_0xd8fc('0x3a')]({'iat':_0x1522d5[_0xd8fc('0x47')],'nonce':_0x1522d5[_0xd8fc('0x2f')]},config[_0xd8fc('0x8')][_0xd8fc('0x9')],{'algorithm':_0xd8fc('0x4d'),'subject':_0x1522d5['id'][_0xd8fc('0x4a')](),'issuer':hardwareConf[_0xd8fc('0x2d')](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index d7cf36a..3481feb 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 _0xcb5a=['data','update','binary','write','final','end','close','decryptFile','createReadStream','createDecipher','unlink','bluebird','aes192','hasOwnProperty','encryptFile','createWriteStream'];(function(_0x2f62af,_0x3055be){var _0x256009=function(_0x2602f3){while(--_0x2602f3){_0x2f62af['push'](_0x2f62af['shift']());}};_0x256009(++_0x3055be);}(_0xcb5a,0x19b));var _0xacb5=function(_0x4c8fb2,_0x583b29){_0x4c8fb2=_0x4c8fb2-0x0;var _0x38b370=_0xcb5a[_0x4c8fb2];return _0x38b370;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xacb5('0x0'));var defaultOptions={'algorithm':_0xacb5('0x1')};function combineOptions(_0x3b57f6){var _0x5511db={};for(var _0x24fcbf in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x24fcbf)){_0x5511db[_0x24fcbf]=defaultOptions[_0x24fcbf];}}if(_0x3b57f6){for(var _0xacaec7 in _0x3b57f6){if(_0x3b57f6[_0xacb5('0x2')](_0xacaec7)){_0x5511db[_0xacaec7]=_0x3b57f6[_0xacaec7];}}}return _0x5511db;}exports[_0xacb5('0x3')]=function(_0x3ac560,_0x29a451,_0x2a24a6,_0x119604){return new BPromise(function(_0x31e1c0,_0xa39b2b){_0x119604=combineOptions(_0x119604);var _0xfa9d8d=new Buffer(_0x2a24a6);var _0x15c412=fs['createReadStream'](_0x3ac560);var _0x403369=fs[_0xacb5('0x4')](_0x29a451);var _0x1ffbd5=crypto['createCipher'](_0x119604['algorithm'],_0xfa9d8d);_0x15c412['on'](_0xacb5('0x5'),function(_0x239fc2){var _0x466ef0=new Buffer(_0x1ffbd5[_0xacb5('0x6')](_0x239fc2),_0xacb5('0x7'));_0x403369[_0xacb5('0x8')](_0x466ef0);});_0x15c412['on']('end',function(){try{var _0xe1706=new Buffer(_0x1ffbd5[_0xacb5('0x9')](_0xacb5('0x7')),_0xacb5('0x7'));_0x403369[_0xacb5('0x8')](_0xe1706);_0x403369[_0xacb5('0xa')]();_0x403369['on'](_0xacb5('0xb'),function(){return _0x31e1c0(_0x29a451);});}catch(_0x3cec10){fs['unlink'](_0x29a451);return _0xa39b2b(_0x3cec10);}});});};exports[_0xacb5('0xc')]=function(_0x5b8103,_0x3c92b0,_0x2258b5,_0x425a12){return new BPromise(function(_0x52efd2,_0x2517b7){_0x425a12=combineOptions(_0x425a12);var _0x2d48a6=new Buffer(_0x2258b5);var _0x464bd2=fs[_0xacb5('0xd')](_0x5b8103);var _0x3bfa01=fs[_0xacb5('0x4')](_0x3c92b0);var _0x577181=crypto[_0xacb5('0xe')](_0x425a12['algorithm'],_0x2d48a6);_0x464bd2['on'](_0xacb5('0x5'),function(_0x3f8dca){var _0x455f9b=new Buffer(_0x577181['update'](_0x3f8dca),_0xacb5('0x7'));_0x3bfa01[_0xacb5('0x8')](_0x455f9b);});_0x464bd2['on'](_0xacb5('0xa'),function(){try{var _0x3f9e21=new Buffer(_0x577181[_0xacb5('0x9')](_0xacb5('0x7')),_0xacb5('0x7'));_0x3bfa01[_0xacb5('0x8')](_0x3f9e21);_0x3bfa01[_0xacb5('0xa')]();_0x3bfa01['on'](_0xacb5('0xb'),function(){return _0x52efd2(_0x3c92b0);});}catch(_0x5e85ee){fs[_0xacb5('0xf')](_0x3c92b0);return _0x2517b7(_0x5e85ee);}});});}; \ No newline at end of file +var _0x9d5f=['crypto','bluebird','aes192','hasOwnProperty','createWriteStream','algorithm','data','update','binary','end','final','write','close','unlink','decryptFile','createDecipher'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x9d5f,0x1e0));var _0xf9d5=function(_0x270b7,_0x59878e){_0x270b7=_0x270b7-0x0;var _0x19e02d=_0x9d5f[_0x270b7];return _0x19e02d;};'use strict';var crypto=require(_0xf9d5('0x0'));var fs=require('fs');var BPromise=require(_0xf9d5('0x1'));var defaultOptions={'algorithm':_0xf9d5('0x2')};function combineOptions(_0x2379e2){var _0x3cef53={};for(var _0x331d2d in defaultOptions){if(defaultOptions[_0xf9d5('0x3')](_0x331d2d)){_0x3cef53[_0x331d2d]=defaultOptions[_0x331d2d];}}if(_0x2379e2){for(var _0xbb8593 in _0x2379e2){if(_0x2379e2[_0xf9d5('0x3')](_0xbb8593)){_0x3cef53[_0xbb8593]=_0x2379e2[_0xbb8593];}}}return _0x3cef53;}exports['encryptFile']=function(_0x2113c5,_0x3e357c,_0x588df9,_0x1d490a){return new BPromise(function(_0x5caff9,_0x3450c1){_0x1d490a=combineOptions(_0x1d490a);var _0x51d143=new Buffer(_0x588df9);var _0x484de5=fs['createReadStream'](_0x2113c5);var _0x5852d8=fs[_0xf9d5('0x4')](_0x3e357c);var _0x228dde=crypto['createCipher'](_0x1d490a[_0xf9d5('0x5')],_0x51d143);_0x484de5['on'](_0xf9d5('0x6'),function(_0x1efa67){var _0x2cfe7f=new Buffer(_0x228dde[_0xf9d5('0x7')](_0x1efa67),_0xf9d5('0x8'));_0x5852d8['write'](_0x2cfe7f);});_0x484de5['on'](_0xf9d5('0x9'),function(){try{var _0x6712e0=new Buffer(_0x228dde[_0xf9d5('0xa')]('binary'),'binary');_0x5852d8[_0xf9d5('0xb')](_0x6712e0);_0x5852d8[_0xf9d5('0x9')]();_0x5852d8['on'](_0xf9d5('0xc'),function(){return _0x5caff9(_0x3e357c);});}catch(_0x5ba5e1){fs[_0xf9d5('0xd')](_0x3e357c);return _0x3450c1(_0x5ba5e1);}});});};exports[_0xf9d5('0xe')]=function(_0x4b5388,_0x1e2f4a,_0x53abc6,_0x404ab4){return new BPromise(function(_0x185b92,_0x22f3e9){_0x404ab4=combineOptions(_0x404ab4);var _0x471e08=new Buffer(_0x53abc6);var _0x163254=fs['createReadStream'](_0x4b5388);var _0x131f12=fs[_0xf9d5('0x4')](_0x1e2f4a);var _0x2eb5ad=crypto[_0xf9d5('0xf')](_0x404ab4[_0xf9d5('0x5')],_0x471e08);_0x163254['on'](_0xf9d5('0x6'),function(_0x192a21){var _0x55120d=new Buffer(_0x2eb5ad[_0xf9d5('0x7')](_0x192a21),_0xf9d5('0x8'));_0x131f12[_0xf9d5('0xb')](_0x55120d);});_0x163254['on'](_0xf9d5('0x9'),function(){try{var _0x2cca03=new Buffer(_0x2eb5ad[_0xf9d5('0xa')](_0xf9d5('0x8')),_0xf9d5('0x8'));_0x131f12[_0xf9d5('0xb')](_0x2cca03);_0x131f12['end']();_0x131f12['on'](_0xf9d5('0xc'),function(){return _0x185b92(_0x1e2f4a);});}catch(_0x19d6be){fs[_0xf9d5('0xd')](_0x1e2f4a);return _0x22f3e9(_0x19d6be);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index f7b8ee5..a71c205 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 _0x76d3=['Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','to-csv','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','existsSync','join','mkdirSync','%s%d.%s','csv','writeFileSync','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed'];(function(_0x24bfa1,_0x34d179){var _0x3e81ba=function(_0x1b4cae){while(--_0x1b4cae){_0x24bfa1['push'](_0x24bfa1['shift']());}};_0x3e81ba(++_0x34d179);}(_0x76d3,0x16c));var _0x376d=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x76d3[_0x1ccdf7];return _0x52a0ae;};'use strict';var util=require(_0x376d('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0x376d('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x376d('0x2'));var rimraf=require('rimraf');var db=require(_0x376d('0x3'))['db'];var dbH=require('../../mysqldb')[_0x376d('0x4')];var logger=require(_0x376d('0x5'))(_0x376d('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x376d('0x7')][0x2]);var QUERY=process[_0x376d('0x7')][0x3];var PATH=process[_0x376d('0x7')][0x4];function analyticExtractedReport(_0x4f48a7,_0x1bde2f){var _0x1cd2e9={'status':_0x4f48a7};var _0x146ea6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1bde2f){_0x1cd2e9[_0x376d('0x8')]=_0x1bde2f;}return db[_0x376d('0x9')][_0x376d('0xa')](_0x1cd2e9,_0x146ea6);}function main(){var _0x4c4335=0x1388;var _0x397d1b;logger[_0x376d('0xb')](util[_0x376d('0xc')](_0x376d('0xd'),EXTRACTED_REPORT_ID,_0x376d('0xe')));return db[_0x376d('0xf')][_0x376d('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x376d('0x11'),'splitSizeCsv']})[_0x376d('0x12')](function(_0x526f8c){if(_0x526f8c){_0x397d1b=_0x526f8c;_0x4c4335=_0x397d1b[_0x376d('0x13')]||0x1388;}})['then'](function(){return dbH[_0x376d('0x14')][_0x376d('0x15')](util[_0x376d('0xc')](_0x376d('0x16'),QUERY),{'type':dbH[_0x376d('0x14')][_0x376d('0x17')][_0x376d('0x18')]});})[_0x376d('0x12')](function(_0x43017a){if(!_0x43017a[0x0][_0x376d('0x19')]){return analyticExtractedReport(_0x376d('0x1a'));}var _0x255a1a=[];var _0x56c98e=0x0;var _0x9217b5=!![];if(_0x43017a&&_0x43017a[_0x376d('0x1b')]){var _0xbe9513=_0x43017a[0x0][_0x376d('0x19')]%(_0x56c98e+_0x4c4335);if(_0x397d1b['split']){for(;_0x9217b5;_0x56c98e+=_0x4c4335,_0xbe9513=_0x43017a[0x0][_0x376d('0x19')]%(_0x56c98e+_0x4c4335)){if(_0xbe9513==0x0||_0xbe9513==_0x43017a[0x0][_0x376d('0x19')]){_0x9217b5=![];}_0x255a1a[_0x376d('0x1c')](dbH['sequelize'][_0x376d('0x15')](util['format'](_0x376d('0x1d'),QUERY,_0x4c4335,_0x56c98e),{'type':dbH['sequelize'][_0x376d('0x17')][_0x376d('0x18')]}));}}else{_0x255a1a[_0x376d('0x1c')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0x376d('0x17')][_0x376d('0x18')]}));}}var _0x4ea293=path['dirname'](PATH);var _0xb698e9=path[_0x376d('0x1e')](PATH,_0x376d('0x1f'));var _0x4a55a6=_0x397d1b['split']&&_0x255a1a[_0x376d('0x1b')]>0x1;var _0x2ff5c8=[];if(!fs[_0x376d('0x20')](path[_0x376d('0x21')](_0x4ea293,_0xb698e9))&&_0x4a55a6){fs[_0x376d('0x22')](path[_0x376d('0x21')](_0x4ea293,_0xb698e9));}return BPromise['each'](_0x255a1a,function(_0x4cfda4){_0x2ff5c8[_0x376d('0x1c')](_0x4cfda4);})['then'](function(){for(var _0x148136=0x0;_0x148136<_0x2ff5c8[_0x376d('0x1b')];_0x148136+=0x1){var _0x42f5b8;var _0x42ee2b=_0x2ff5c8[_0x148136];if(_0x4a55a6){_0x42f5b8=path[_0x376d('0x21')](_0x4ea293,_0xb698e9,util[_0x376d('0xc')](_0x376d('0x23'),_0xb698e9,_0x148136,_0x376d('0x24')));}else{_0x42f5b8=path['join'](_0x4ea293,util['format']('%s.%s',_0xb698e9,_0x376d('0x24')));}fs[_0x376d('0x25')](_0x42f5b8,csv(_0x42ee2b));}})[_0x376d('0x12')](function(){if(_0x4a55a6){zipdir(path['join'](_0x4ea293,_0xb698e9),{'saveTo':path['join'](_0x4ea293,util[_0x376d('0xc')](_0x376d('0x26'),_0xb698e9,_0x376d('0x27')))},function(_0x94b355,_0x30323e){});rimraf(path[_0x376d('0x21')](_0x4ea293,_0xb698e9),function(){});}})['then'](function(){logger[_0x376d('0xb')](util[_0x376d('0xc')](_0x376d('0x28'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x376d('0x29'),_0x4a55a6?util[_0x376d('0xc')](_0x376d('0x26'),_0xb698e9,_0x4a55a6?_0x376d('0x27'):_0x376d('0x24')):null);});})[_0x376d('0x2a')](function(_0x175b3d){logger['info'](util[_0x376d('0xc')](_0x376d('0x2b'),EXTRACTED_REPORT_ID,_0x376d('0xe')),util[_0x376d('0x2c')](_0x175b3d,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0xf65a=['Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','split','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed'];(function(_0x4a73fe,_0x2fa094){var _0x508271=function(_0x14effa){while(--_0x14effa){_0x4a73fe['push'](_0x4a73fe['shift']());}};_0x508271(++_0x2fa094);}(_0xf65a,0x8f));var _0xaf65=function(_0x4965cb,_0x2a7b67){_0x4965cb=_0x4965cb-0x0;var _0x306d90=_0xf65a[_0x4965cb];return _0x306d90;};'use strict';var util=require(_0xaf65('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0xaf65('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xaf65('0x2'));var db=require(_0xaf65('0x3'))['db'];var dbH=require('../../mysqldb')[_0xaf65('0x4')];var logger=require(_0xaf65('0x5'))(_0xaf65('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xaf65('0x7')][0x2]);var QUERY=process[_0xaf65('0x7')][0x3];var PATH=process[_0xaf65('0x7')][0x4];function analyticExtractedReport(_0xc6e9e8,_0x61d085){var _0x1a29ea={'status':_0xc6e9e8};var _0xbef6fb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x61d085){_0x1a29ea[_0xaf65('0x8')]=_0x61d085;}return db[_0xaf65('0x9')][_0xaf65('0xa')](_0x1a29ea,_0xbef6fb);}function main(){var _0x131451=0x1388;var _0x49ad45;logger[_0xaf65('0xb')](util[_0xaf65('0xc')](_0xaf65('0xd'),EXTRACTED_REPORT_ID,_0xaf65('0xe')));return db[_0xaf65('0xf')][_0xaf65('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xaf65('0x11')]})[_0xaf65('0x12')](function(_0x376241){if(_0x376241){_0x49ad45=_0x376241;_0x131451=_0x49ad45[_0xaf65('0x11')]||0x1388;}})[_0xaf65('0x12')](function(){return dbH[_0xaf65('0x13')][_0xaf65('0x14')](util[_0xaf65('0xc')](_0xaf65('0x15'),QUERY),{'type':dbH[_0xaf65('0x13')][_0xaf65('0x16')][_0xaf65('0x17')]});})[_0xaf65('0x12')](function(_0x4b9254){if(!_0x4b9254[0x0][_0xaf65('0x18')]){return analyticExtractedReport(_0xaf65('0x19'));}var _0x6c3c2f=[];var _0x3fd10a=0x0;var _0x185397=!![];if(_0x4b9254&&_0x4b9254[_0xaf65('0x1a')]){var _0x541749=_0x4b9254[0x0]['num']%(_0x3fd10a+_0x131451);if(_0x49ad45[_0xaf65('0x1b')]){for(;_0x185397;_0x3fd10a+=_0x131451,_0x541749=_0x4b9254[0x0][_0xaf65('0x18')]%(_0x3fd10a+_0x131451)){if(_0x541749==0x0||_0x541749==_0x4b9254[0x0][_0xaf65('0x18')]){_0x185397=![];}_0x6c3c2f[_0xaf65('0x1c')](dbH['sequelize']['query'](util['format'](_0xaf65('0x1d'),QUERY,_0x131451,_0x3fd10a),{'type':dbH[_0xaf65('0x13')][_0xaf65('0x16')][_0xaf65('0x17')]}));}}else{_0x6c3c2f[_0xaf65('0x1c')](dbH['sequelize'][_0xaf65('0x14')](QUERY,{'type':dbH[_0xaf65('0x13')][_0xaf65('0x16')][_0xaf65('0x17')]}));}}var _0x2a7105=path[_0xaf65('0x1e')](PATH);var _0x5419bf=path['basename'](PATH,_0xaf65('0x1f'));var _0x1feeca=_0x49ad45[_0xaf65('0x1b')]&&_0x6c3c2f[_0xaf65('0x1a')]>0x1;var _0x40bec8=[];if(!fs[_0xaf65('0x20')](path[_0xaf65('0x21')](_0x2a7105,_0x5419bf))&&_0x1feeca){fs[_0xaf65('0x22')](path[_0xaf65('0x21')](_0x2a7105,_0x5419bf));}return BPromise[_0xaf65('0x23')](_0x6c3c2f,function(_0x2a9d18){_0x40bec8[_0xaf65('0x1c')](_0x2a9d18);})[_0xaf65('0x12')](function(){for(var _0x2c89f5=0x0;_0x2c89f5<_0x40bec8[_0xaf65('0x1a')];_0x2c89f5+=0x1){var _0x5390a5;var _0x3da5a3=_0x40bec8[_0x2c89f5];if(_0x1feeca){_0x5390a5=path[_0xaf65('0x21')](_0x2a7105,_0x5419bf,util[_0xaf65('0xc')]('%s%d.%s',_0x5419bf,_0x2c89f5,_0xaf65('0x24')));}else{_0x5390a5=path[_0xaf65('0x21')](_0x2a7105,util[_0xaf65('0xc')](_0xaf65('0x25'),_0x5419bf,_0xaf65('0x24')));}fs[_0xaf65('0x26')](_0x5390a5,csv(_0x3da5a3));}})[_0xaf65('0x12')](function(){if(_0x1feeca){zipdir(path['join'](_0x2a7105,_0x5419bf),{'saveTo':path[_0xaf65('0x21')](_0x2a7105,util[_0xaf65('0xc')](_0xaf65('0x25'),_0x5419bf,_0xaf65('0x27')))},function(_0x4de679,_0x82fbe6){});rimraf(path[_0xaf65('0x21')](_0x2a7105,_0x5419bf),function(){});}})[_0xaf65('0x12')](function(){logger[_0xaf65('0xb')](util[_0xaf65('0xc')](_0xaf65('0x28'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xaf65('0x29'),_0x1feeca?util[_0xaf65('0xc')](_0xaf65('0x25'),_0x5419bf,_0x1feeca?_0xaf65('0x27'):_0xaf65('0x24')):null);});})[_0xaf65('0x2a')](function(_0x1f7f03){logger[_0xaf65('0xb')](util[_0xaf65('0xc')](_0xaf65('0x2b'),EXTRACTED_REPORT_ID,_0xaf65('0xe')),util[_0xaf65('0x2c')](_0x1f7f03,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xaf65('0x2d'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 783ee0e..9d54baa 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 _0x9009=['lodash','util','path','zip-dir','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','push','tableHeader','num','Empty','dirname','basename','Setting','splitSizePdf','then','length','split','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','landscape','header','black','body','hasOwnProperty','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','%s%d.%s','pdf','pipe','createWriteStream','error','err','end','%s.%s','zip','info','CSV','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed'];(function(_0x4cbe98,_0x576f7b){var _0x49c755=function(_0x1e0487){while(--_0x1e0487){_0x4cbe98['push'](_0x4cbe98['shift']());}};_0x49c755(++_0x576f7b);}(_0x9009,0x17a));var _0x9900=function(_0x55efb7,_0xd3f62e){_0x55efb7=_0x55efb7-0x0;var _0x2ba995=_0x9009[_0x55efb7];return _0x2ba995;};'use strict';var _=require(_0x9900('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0x9900('0x1'));var path=require(_0x9900('0x2'));var moment=require('moment');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x9900('0x3'));var rimraf=require('rimraf');var db=require(_0x9900('0x4'))['db'];var dbH=require(_0x9900('0x4'))[_0x9900('0x5')];var logger=require(_0x9900('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x9900('0x7')][0x2]);var QUERY=process[_0x9900('0x7')][0x3];var PATH=process[_0x9900('0x7')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x9900('0x8');var _extractedReport;function analyticExtractedReport(_0x14aeed,_0x3f849d){var _0x242e7f={'status':_0x14aeed};var _0x1c75f4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f849d){_0x242e7f['savename']=_0x3f849d;}return db[_0x9900('0x9')][_0x9900('0xa')](_0x242e7f,_0x1c75f4);}function getHeader(_0x2a9511){var _0xd5a035=[];for(var _0x37440a in _0x2a9511){if(_0x2a9511['hasOwnProperty'](_0x37440a)){_0xd5a035[_0x9900('0xb')]({'text':_0x37440a,'style':_0x9900('0xc')});}}return _0xd5a035;}function extractReport(_0x487528){var _0x32ed1b=0x1388;var _0x67d28a;if(!_0x487528[0x0][_0x9900('0xd')]){return analyticExtractedReport(_0x9900('0xe'));}var _0x3aff2d=[];var _0x3cef97=0x0;var _0x5917d2=!![];var _0x48f221=path[_0x9900('0xf')](PATH);var _0x3c4c70=path[_0x9900('0x10')](PATH,'.pdf');var _0x599149=![];var _0x1dc960=[];return db[_0x9900('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x9900('0x12')]})[_0x9900('0x13')](function(_0x125209){if(_0x125209){_0x67d28a=_0x125209;_0x32ed1b=_0x67d28a['splitSizePdf']||0x3e8;}})[_0x9900('0x13')](function(){if(_0x487528&&_0x487528[_0x9900('0x14')]){var _0x3a6f4a=_0x487528[0x0][_0x9900('0xd')]%(_0x3cef97+_0x32ed1b);if(_0x67d28a[_0x9900('0x15')]){for(;_0x5917d2;_0x3cef97+=_0x32ed1b,_0x3a6f4a=_0x487528[0x0][_0x9900('0xd')]%(_0x3cef97+_0x32ed1b)){if(_0x3a6f4a==0x0||_0x3a6f4a==_0x487528[0x0][_0x9900('0xd')]){_0x5917d2=![];}_0x3aff2d[_0x9900('0xb')](dbH[_0x9900('0x16')][_0x9900('0x17')](util[_0x9900('0x18')](_0x9900('0x19'),QUERY,_0x32ed1b,_0x3cef97),{'type':dbH[_0x9900('0x16')][_0x9900('0x1a')]['SELECT']}));}}else{_0x3aff2d[_0x9900('0xb')](dbH[_0x9900('0x16')][_0x9900('0x17')](QUERY,{'type':dbH[_0x9900('0x16')][_0x9900('0x1a')][_0x9900('0x1b')]}));}}_0x599149=_0x67d28a['split']&&_0x3aff2d[_0x9900('0x14')]>0x1;if(!fs[_0x9900('0x1c')](path[_0x9900('0x1d')](_0x48f221,_0x3c4c70))&&_0x599149){fs[_0x9900('0x1e')](path['join'](_0x48f221,_0x3c4c70));}return BPromise['each'](_0x3aff2d,function(_0x34e7d7){_0x1dc960[_0x9900('0xb')](_0x34e7d7);});})[_0x9900('0x13')](function(){return BPromise[_0x9900('0x1f')](_0x3aff2d,function(_0x8f52a4,_0x261171){var _0x20c1e6;var _0x39636d=util[_0x9900('0x18')](_0x9900('0x20'),NAME,_extractedReport[_0x9900('0x21')],moment(_extractedReport[_0x9900('0x22')])[_0x9900('0x18')](FORMAT),moment(_extractedReport['endDate'])[_0x9900('0x18')](FORMAT));var _0x4c37d5={'pageSize':'A4','pageOrientation':_0x9900('0x23'),'content':[{'text':_0x39636d,'style':_0x9900('0x24')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9900('0x25')}}};var _0x2ca8f8={'headerRows':0x1,'body':[]};_0x2ca8f8[_0x9900('0x26')]['push'](getHeader(_0x8f52a4[0x0]));var _0x395011;for(var _0x330608=0x0;_0x330608<_0x8f52a4['length'];_0x330608+=0x1){_0x395011=[];for(var _0x4620ab in _0x8f52a4[_0x330608]){if(_0x8f52a4[_0x330608][_0x9900('0x27')](_0x4620ab)){_0x395011[_0x9900('0xb')](_0x8f52a4[_0x330608][_0x4620ab]?_[_0x9900('0x28')](_0x8f52a4[_0x330608][_0x4620ab]):'');}}_0x2ca8f8[_0x9900('0x26')][_0x9900('0xb')](_0x395011);}_0x4c37d5[_0x9900('0x29')][_0x9900('0xb')]({'table':_0x2ca8f8});return new BPromise(function(_0x401b27,_0x76c074){var _0x1abb67=new PdfPrinter({'Roboto':{'normal':__dirname+_0x9900('0x2a'),'bold':__dirname+'/fonts/Roboto-Medium.ttf','italics':__dirname+_0x9900('0x2b'),'bolditalics':__dirname+_0x9900('0x2c')}});var _0x562cf7=_0x1abb67['createPdfKitDocument'](_0x4c37d5);if(_0x599149){_0x20c1e6=path[_0x9900('0x1d')](_0x48f221,_0x3c4c70,util['format'](_0x9900('0x2d'),_0x3c4c70,_0x261171,_0x9900('0x2e')));}else{_0x20c1e6=path[_0x9900('0x1d')](_0x48f221,util[_0x9900('0x18')]('%s.%s',_0x3c4c70,_0x9900('0x2e')));}var _0x11dfbb=_0x562cf7[_0x9900('0x2f')](fs[_0x9900('0x30')](_0x20c1e6));_0x11dfbb['on']('finish',function(){_0x401b27();});_0x11dfbb['on'](_0x9900('0x31'),function(_0x3e49bf){console['log'](_0x9900('0x32'),_0x3e49bf);_0x76c074(_0x3e49bf);});_0x562cf7[_0x9900('0x33')]();});});})[_0x9900('0x13')](function(){if(_0x599149){return new BPromise(function(_0x3bc84e,_0x455342){zipdir(path[_0x9900('0x1d')](_0x48f221,_0x3c4c70),{'saveTo':path[_0x9900('0x1d')](_0x48f221,util['format'](_0x9900('0x34'),_0x3c4c70,_0x9900('0x35')))},function(_0x417feb){if(_0x417feb){_0x455342(_0x417feb);}else{_0x3bc84e();}});});}})[_0x9900('0x13')](function(){if(_0x599149){rimraf(path['join'](_0x48f221,_0x3c4c70),function(){});}})['then'](function(){logger[_0x9900('0x36')](util[_0x9900('0x18')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x9900('0x37')));return analyticExtractedReport('Completed',_0x599149?util[_0x9900('0x18')](_0x9900('0x34'),_0x3c4c70,_0x599149?_0x9900('0x35'):'pdf'):null);});}function main(){logger['info'](util[_0x9900('0x18')](_0x9900('0x38'),EXTRACTED_REPORT_ID,_0x9900('0x39')));return db[_0x9900('0x9')][_0x9900('0x3a')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x2c4c8d){_extractedReport=_0x2c4c8d;return dbH[_0x9900('0x16')][_0x9900('0x17')](util[_0x9900('0x18')](_0x9900('0x3b'),QUERY),{'type':dbH[_0x9900('0x16')][_0x9900('0x1a')][_0x9900('0x1b')]});})[_0x9900('0x13')](extractReport)[_0x9900('0x3c')](function(_0x138b0a){logger['info'](util[_0x9900('0x18')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9900('0x39')),util[_0x9900('0x3d')](_0x138b0a,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x9900('0x3e'));});}main(); \ No newline at end of file +var _0xbdf4=['Empty','basename','.pdf','find','split','splitSizePdf','then','length','push','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','landscape','header','black','body','hasOwnProperty','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','%s%d.%s','pdf','%s.%s','pipe','createWriteStream','error','log','end','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','inspect','Failed','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','tableHeader','num'];(function(_0x40e7cf,_0x387cce){var _0x4ed4d7=function(_0x309ac6){while(--_0x309ac6){_0x40e7cf['push'](_0x40e7cf['shift']());}};_0x4ed4d7(++_0x387cce);}(_0xbdf4,0xf7));var _0x4bdf=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xbdf4[_0x231e16];return _0x570a7c;};'use strict';var _=require(_0x4bdf('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0x4bdf('0x1'));var path=require(_0x4bdf('0x2'));var moment=require(_0x4bdf('0x3'));var PdfPrinter=require(_0x4bdf('0x4'));var zipdir=require(_0x4bdf('0x5'));var rimraf=require(_0x4bdf('0x6'));var db=require(_0x4bdf('0x7'))['db'];var dbH=require(_0x4bdf('0x7'))[_0x4bdf('0x8')];var logger=require(_0x4bdf('0x9'))(_0x4bdf('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x4bdf('0xb')][0x2]);var QUERY=process[_0x4bdf('0xb')][0x3];var PATH=process[_0x4bdf('0xb')][0x4];var NAME=process[_0x4bdf('0xb')][0x5];var FORMAT=_0x4bdf('0xc');var _extractedReport;function analyticExtractedReport(_0x3d4ba5,_0x1526e9){var _0x45406c={'status':_0x3d4ba5};var _0x236eeb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1526e9){_0x45406c[_0x4bdf('0xd')]=_0x1526e9;}return db[_0x4bdf('0xe')]['update'](_0x45406c,_0x236eeb);}function getHeader(_0x2333e1){var _0x3a8ad4=[];for(var _0x451a98 in _0x2333e1){if(_0x2333e1['hasOwnProperty'](_0x451a98)){_0x3a8ad4['push']({'text':_0x451a98,'style':_0x4bdf('0xf')});}}return _0x3a8ad4;}function extractReport(_0x4906eb){var _0x12333a=0x1388;var _0x31aa34;if(!_0x4906eb[0x0][_0x4bdf('0x10')]){return analyticExtractedReport(_0x4bdf('0x11'));}var _0x5338cc=[];var _0x1f303f=0x0;var _0x39b3c7=!![];var _0x442f0e=path['dirname'](PATH);var _0x43cfb4=path[_0x4bdf('0x12')](PATH,_0x4bdf('0x13'));var _0x495a40=![];var _0xac5fbf=[];return db['Setting'][_0x4bdf('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4bdf('0x15'),_0x4bdf('0x16')]})[_0x4bdf('0x17')](function(_0x1544f0){if(_0x1544f0){_0x31aa34=_0x1544f0;_0x12333a=_0x31aa34[_0x4bdf('0x16')]||0x3e8;}})[_0x4bdf('0x17')](function(){if(_0x4906eb&&_0x4906eb[_0x4bdf('0x18')]){var _0x3f2562=_0x4906eb[0x0]['num']%(_0x1f303f+_0x12333a);if(_0x31aa34[_0x4bdf('0x15')]){for(;_0x39b3c7;_0x1f303f+=_0x12333a,_0x3f2562=_0x4906eb[0x0]['num']%(_0x1f303f+_0x12333a)){if(_0x3f2562==0x0||_0x3f2562==_0x4906eb[0x0][_0x4bdf('0x10')]){_0x39b3c7=![];}_0x5338cc[_0x4bdf('0x19')](dbH[_0x4bdf('0x1a')][_0x4bdf('0x1b')](util[_0x4bdf('0x1c')](_0x4bdf('0x1d'),QUERY,_0x12333a,_0x1f303f),{'type':dbH[_0x4bdf('0x1a')]['QueryTypes']['SELECT']}));}}else{_0x5338cc[_0x4bdf('0x19')](dbH['sequelize'][_0x4bdf('0x1b')](QUERY,{'type':dbH[_0x4bdf('0x1a')][_0x4bdf('0x1e')][_0x4bdf('0x1f')]}));}}_0x495a40=_0x31aa34[_0x4bdf('0x15')]&&_0x5338cc[_0x4bdf('0x18')]>0x1;if(!fs[_0x4bdf('0x20')](path[_0x4bdf('0x21')](_0x442f0e,_0x43cfb4))&&_0x495a40){fs[_0x4bdf('0x22')](path[_0x4bdf('0x21')](_0x442f0e,_0x43cfb4));}return BPromise['each'](_0x5338cc,function(_0x1f81fe){_0xac5fbf['push'](_0x1f81fe);});})['then'](function(){return BPromise[_0x4bdf('0x23')](_0x5338cc,function(_0x402e0a,_0x1997b5){var _0x363b1f;var _0x43dbef=util[_0x4bdf('0x1c')](_0x4bdf('0x24'),NAME,_extractedReport[_0x4bdf('0x25')],moment(_extractedReport[_0x4bdf('0x26')])[_0x4bdf('0x1c')](FORMAT),moment(_extractedReport['endDate'])[_0x4bdf('0x1c')](FORMAT));var _0x1e728b={'pageSize':'A4','pageOrientation':_0x4bdf('0x27'),'content':[{'text':_0x43dbef,'style':_0x4bdf('0x28')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x4bdf('0x29')}}};var _0x2f9876={'headerRows':0x1,'body':[]};_0x2f9876[_0x4bdf('0x2a')][_0x4bdf('0x19')](getHeader(_0x402e0a[0x0]));var _0x40a81d;for(var _0xfa68cb=0x0;_0xfa68cb<_0x402e0a['length'];_0xfa68cb+=0x1){_0x40a81d=[];for(var _0x527b9d in _0x402e0a[_0xfa68cb]){if(_0x402e0a[_0xfa68cb][_0x4bdf('0x2b')](_0x527b9d)){_0x40a81d[_0x4bdf('0x19')](_0x402e0a[_0xfa68cb][_0x527b9d]?_[_0x4bdf('0x2c')](_0x402e0a[_0xfa68cb][_0x527b9d]):'');}}_0x2f9876[_0x4bdf('0x2a')][_0x4bdf('0x19')](_0x40a81d);}_0x1e728b[_0x4bdf('0x2d')][_0x4bdf('0x19')]({'table':_0x2f9876});return new BPromise(function(_0x5cdfd9,_0x56493f){var _0x35bf5=new PdfPrinter({'Roboto':{'normal':__dirname+_0x4bdf('0x2e'),'bold':__dirname+_0x4bdf('0x2f'),'italics':__dirname+_0x4bdf('0x30'),'bolditalics':__dirname+'/fonts/Roboto-MediumItalic.ttf'}});var _0x13600c=_0x35bf5['createPdfKitDocument'](_0x1e728b);if(_0x495a40){_0x363b1f=path[_0x4bdf('0x21')](_0x442f0e,_0x43cfb4,util[_0x4bdf('0x1c')](_0x4bdf('0x31'),_0x43cfb4,_0x1997b5,_0x4bdf('0x32')));}else{_0x363b1f=path[_0x4bdf('0x21')](_0x442f0e,util[_0x4bdf('0x1c')](_0x4bdf('0x33'),_0x43cfb4,_0x4bdf('0x32')));}var _0x2d4eb5=_0x13600c[_0x4bdf('0x34')](fs[_0x4bdf('0x35')](_0x363b1f));_0x2d4eb5['on']('finish',function(){_0x5cdfd9();});_0x2d4eb5['on'](_0x4bdf('0x36'),function(_0x17edc6){console[_0x4bdf('0x37')]('err',_0x17edc6);_0x56493f(_0x17edc6);});_0x13600c[_0x4bdf('0x38')]();});});})[_0x4bdf('0x17')](function(){if(_0x495a40){return new BPromise(function(_0xce6b6b,_0x43b1c0){zipdir(path[_0x4bdf('0x21')](_0x442f0e,_0x43cfb4),{'saveTo':path[_0x4bdf('0x21')](_0x442f0e,util[_0x4bdf('0x1c')](_0x4bdf('0x33'),_0x43cfb4,'zip'))},function(_0x4f25d2){if(_0x4f25d2){_0x43b1c0(_0x4f25d2);}else{_0xce6b6b();}});});}})[_0x4bdf('0x17')](function(){if(_0x495a40){rimraf(path['join'](_0x442f0e,_0x43cfb4),function(){});}})['then'](function(){logger[_0x4bdf('0x39')](util[_0x4bdf('0x1c')](_0x4bdf('0x3a'),EXTRACTED_REPORT_ID,_0x4bdf('0x3b')));return analyticExtractedReport('Completed',_0x495a40?util[_0x4bdf('0x1c')](_0x4bdf('0x33'),_0x43cfb4,_0x495a40?'zip':_0x4bdf('0x32')):null);});}function main(){logger[_0x4bdf('0x39')](util[_0x4bdf('0x1c')](_0x4bdf('0x3c'),EXTRACTED_REPORT_ID,_0x4bdf('0x3d')));return db[_0x4bdf('0xe')][_0x4bdf('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x4bdf('0x17')](function(_0x2975b5){_extractedReport=_0x2975b5;return dbH[_0x4bdf('0x1a')][_0x4bdf('0x1b')](util[_0x4bdf('0x1c')](_0x4bdf('0x3f'),QUERY),{'type':dbH[_0x4bdf('0x1a')]['QueryTypes']['SELECT']});})[_0x4bdf('0x17')](extractReport)['catch'](function(_0x5de30f){logger[_0x4bdf('0x39')](util[_0x4bdf('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4bdf('0x3d')),util[_0x4bdf('0x40')](_0x5de30f,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x4bdf('0x41'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 362804f..8357afe 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 _0x9335=['AnalyticExtractedReport','info','format','XLSX','find','split','splitSizeXlsx','then','sequelize','SELECT','Empty','num','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x9335,0xfd));var _0x5933=function(_0x122fcd,_0x262313){_0x122fcd=_0x122fcd-0x0;var _0x14af0b=_0x9335[_0x122fcd];return _0x14af0b;};'use strict';var util=require(_0x5933('0x0'));var path=require(_0x5933('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x5933('0x2'));var BPromise=require(_0x5933('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x5933('0x4'));var db=require(_0x5933('0x5'))['db'];var dbH=require(_0x5933('0x5'))[_0x5933('0x6')];var logger=require(_0x5933('0x7'))(_0x5933('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x5933('0x9')][0x2]);var QUERY=process[_0x5933('0x9')][0x3];var PATH=process[_0x5933('0x9')][0x4];function analyticExtractedReport(_0xe9f528,_0x3422dd){var _0xec4421={'status':_0xe9f528};var _0x4862c3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3422dd){_0xec4421[_0x5933('0xa')]=_0x3422dd;}return db[_0x5933('0xb')]['update'](_0xec4421,_0x4862c3);}function main(){var _0x247c49=0x1388;var _0x31d380;logger[_0x5933('0xc')](util[_0x5933('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x5933('0xe')));return db['Setting'][_0x5933('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5933('0x10'),_0x5933('0x11')]})[_0x5933('0x12')](function(_0x51116c){if(_0x51116c){_0x31d380=_0x51116c;_0x247c49=_0x31d380[_0x5933('0x11')]||0x1388;}})[_0x5933('0x12')](function(){return dbH[_0x5933('0x13')]['query'](util[_0x5933('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x5933('0x13')]['QueryTypes'][_0x5933('0x14')]});})[_0x5933('0x12')](function(_0x11c61b){if(!_0x11c61b[0x0]['num']){return analyticExtractedReport(_0x5933('0x15'));}var _0x8844cb=[];var _0x38a4ed=0x0;var _0x34e803=!![];if(_0x31d380[_0x5933('0x10')]){if(_0x11c61b&&_0x11c61b['length']){var _0x44d00b=_0x11c61b[0x0][_0x5933('0x16')]%(_0x38a4ed+_0x247c49);for(;_0x34e803;_0x38a4ed+=_0x247c49,_0x44d00b=_0x11c61b[0x0][_0x5933('0x16')]%(_0x38a4ed+_0x247c49)){if(_0x44d00b==0x0||_0x44d00b==_0x11c61b[0x0][_0x5933('0x16')]){_0x34e803=![];}_0x8844cb[_0x5933('0x17')](dbH[_0x5933('0x13')][_0x5933('0x18')](util[_0x5933('0xd')](_0x5933('0x19'),QUERY,_0x247c49,_0x38a4ed),{'type':dbH[_0x5933('0x13')][_0x5933('0x1a')][_0x5933('0x14')]}));}}}else{_0x8844cb[_0x5933('0x17')](dbH[_0x5933('0x13')][_0x5933('0x18')](QUERY,{'type':dbH[_0x5933('0x13')][_0x5933('0x1a')][_0x5933('0x14')]}));}var _0x2307b9=path['dirname'](PATH);var _0x2809e6=path[_0x5933('0x1b')](PATH,_0x5933('0x1c'));var _0x3a1006=_0x31d380[_0x5933('0x10')]&&_0x8844cb['length']>0x1;var _0x38f474=[];if(!fs[_0x5933('0x1d')](path['join'](_0x2307b9,_0x2809e6))&&_0x3a1006){fs[_0x5933('0x1e')](path[_0x5933('0x1f')](_0x2307b9,_0x2809e6));}return BPromise[_0x5933('0x20')](_0x8844cb,function(_0x5e95a0){_0x38f474[_0x5933('0x17')](_0x5e95a0);})[_0x5933('0x12')](function(){for(var _0x5ad7f0=0x0;_0x5ad7f0<_0x38f474['length'];_0x5ad7f0+=0x1){var _0xb0e9ba;var _0x307b0d=_0x38f474[_0x5ad7f0];if(_0x3a1006){_0xb0e9ba=path[_0x5933('0x1f')](_0x2307b9,_0x2809e6,util[_0x5933('0xd')](_0x5933('0x21'),_0x2809e6,_0x5ad7f0,_0x5933('0x22')));}else{_0xb0e9ba=path[_0x5933('0x1f')](_0x2307b9,util[_0x5933('0xd')](_0x5933('0x23'),_0x2809e6,'xlsx'));}fs[_0x5933('0x24')](_0xb0e9ba,json2xls(_0x307b0d),_0x5933('0x25'));}})[_0x5933('0x12')](function(){if(_0x3a1006){zipdir(path[_0x5933('0x1f')](_0x2307b9,_0x2809e6),{'saveTo':path[_0x5933('0x1f')](_0x2307b9,util['format']('%s.%s',_0x2809e6,_0x5933('0x26')))},function(_0xfbaa26,_0x5849c8){});rimraf(path[_0x5933('0x1f')](_0x2307b9,_0x2809e6),function(){});}})[_0x5933('0x12')](function(){logger[_0x5933('0xc')](util[_0x5933('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x5933('0xe')));return analyticExtractedReport(_0x5933('0x27'),_0x3a1006?util['format'](_0x5933('0x23'),_0x2809e6,_0x3a1006?_0x5933('0x26'):_0x5933('0x22')):null);});})[_0x5933('0x28')](function(_0x200829){logger[_0x5933('0xc')](util[_0x5933('0xd')](_0x5933('0x29'),EXTRACTED_REPORT_ID,_0x5933('0xe')),util[_0x5933('0x2a')](_0x200829,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x5933('0x2b'));});}main(); \ No newline at end of file +var _0xd3e3=['SELECT','push','dirname','existsSync','mkdirSync','join','length','xlsx','%s.%s','writeFileSync','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','inspect','Failed','path','lodash','json2xls','zip-dir','rimraf','../../config/logger','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','Empty','split'];(function(_0x4af005,_0x1808a4){var _0x5b9e32=function(_0x5881bb){while(--_0x5881bb){_0x4af005['push'](_0x4af005['shift']());}};_0x5b9e32(++_0x1808a4);}(_0xd3e3,0x1c9));var _0x3d3e=function(_0x3b3179,_0xe4c588){_0x3b3179=_0x3b3179-0x0;var _0x381214=_0xd3e3[_0x3b3179];return _0x381214;};'use strict';var util=require('util');var path=require(_0x3d3e('0x0'));var _=require(_0x3d3e('0x1'));var fs=require('fs');var json2xls=require(_0x3d3e('0x2'));var BPromise=require('bluebird');var zipdir=require(_0x3d3e('0x3'));var rimraf=require(_0x3d3e('0x4'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x3d3e('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x3d3e('0x6')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x5c3936,_0x326d94){var _0x1b8407={'status':_0x5c3936};var _0x5df373={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x326d94){_0x1b8407[_0x3d3e('0x7')]=_0x326d94;}return db['AnalyticExtractedReport'][_0x3d3e('0x8')](_0x1b8407,_0x5df373);}function main(){var _0x1cf73f=0x1388;var _0x19bc65;logger[_0x3d3e('0x9')](util[_0x3d3e('0xa')](_0x3d3e('0xb'),EXTRACTED_REPORT_ID,_0x3d3e('0xc')));return db['Setting'][_0x3d3e('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x3d3e('0xe')]})[_0x3d3e('0xf')](function(_0x21feea){if(_0x21feea){_0x19bc65=_0x21feea;_0x1cf73f=_0x19bc65[_0x3d3e('0xe')]||0x1388;}})[_0x3d3e('0xf')](function(){return dbH['sequelize'][_0x3d3e('0x10')](util[_0x3d3e('0xa')](_0x3d3e('0x11'),QUERY),{'type':dbH[_0x3d3e('0x12')][_0x3d3e('0x13')]['SELECT']});})[_0x3d3e('0xf')](function(_0xe6f44a){if(!_0xe6f44a[0x0][_0x3d3e('0x14')]){return analyticExtractedReport(_0x3d3e('0x15'));}var _0x1c9c2=[];var _0x1cf3a3=0x0;var _0x2e4ecb=!![];if(_0x19bc65[_0x3d3e('0x16')]){if(_0xe6f44a&&_0xe6f44a['length']){var _0x362cc3=_0xe6f44a[0x0]['num']%(_0x1cf3a3+_0x1cf73f);for(;_0x2e4ecb;_0x1cf3a3+=_0x1cf73f,_0x362cc3=_0xe6f44a[0x0][_0x3d3e('0x14')]%(_0x1cf3a3+_0x1cf73f)){if(_0x362cc3==0x0||_0x362cc3==_0xe6f44a[0x0][_0x3d3e('0x14')]){_0x2e4ecb=![];}_0x1c9c2['push'](dbH[_0x3d3e('0x12')][_0x3d3e('0x10')](util[_0x3d3e('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1cf73f,_0x1cf3a3),{'type':dbH[_0x3d3e('0x12')]['QueryTypes'][_0x3d3e('0x17')]}));}}}else{_0x1c9c2[_0x3d3e('0x18')](dbH[_0x3d3e('0x12')][_0x3d3e('0x10')](QUERY,{'type':dbH['sequelize'][_0x3d3e('0x13')]['SELECT']}));}var _0x583f06=path[_0x3d3e('0x19')](PATH);var _0x5bfc4a=path['basename'](PATH,'.xlsx');var _0x3e3537=_0x19bc65[_0x3d3e('0x16')]&&_0x1c9c2['length']>0x1;var _0xe3c9da=[];if(!fs[_0x3d3e('0x1a')](path['join'](_0x583f06,_0x5bfc4a))&&_0x3e3537){fs[_0x3d3e('0x1b')](path[_0x3d3e('0x1c')](_0x583f06,_0x5bfc4a));}return BPromise['each'](_0x1c9c2,function(_0x3e44c6){_0xe3c9da[_0x3d3e('0x18')](_0x3e44c6);})[_0x3d3e('0xf')](function(){for(var _0x5b60f8=0x0;_0x5b60f8<_0xe3c9da[_0x3d3e('0x1d')];_0x5b60f8+=0x1){var _0x36e96a;var _0x2a5fe2=_0xe3c9da[_0x5b60f8];if(_0x3e3537){_0x36e96a=path['join'](_0x583f06,_0x5bfc4a,util[_0x3d3e('0xa')]('%s%d.%s',_0x5bfc4a,_0x5b60f8,_0x3d3e('0x1e')));}else{_0x36e96a=path['join'](_0x583f06,util['format'](_0x3d3e('0x1f'),_0x5bfc4a,_0x3d3e('0x1e')));}fs[_0x3d3e('0x20')](_0x36e96a,json2xls(_0x2a5fe2),_0x3d3e('0x21'));}})[_0x3d3e('0xf')](function(){if(_0x3e3537){zipdir(path[_0x3d3e('0x1c')](_0x583f06,_0x5bfc4a),{'saveTo':path[_0x3d3e('0x1c')](_0x583f06,util[_0x3d3e('0xa')](_0x3d3e('0x1f'),_0x5bfc4a,'zip'))},function(_0x21ce18,_0x5d3938){});rimraf(path[_0x3d3e('0x1c')](_0x583f06,_0x5bfc4a),function(){});}})['then'](function(){logger[_0x3d3e('0x9')](util[_0x3d3e('0xa')](_0x3d3e('0x22'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x3d3e('0x23'),_0x3e3537?util[_0x3d3e('0xa')](_0x3d3e('0x1f'),_0x5bfc4a,_0x3e3537?_0x3d3e('0x24'):_0x3d3e('0x1e')):null);});})[_0x3d3e('0x25')](function(_0xe41fb3){logger[_0x3d3e('0x9')](util[_0x3d3e('0xa')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3d3e('0xc')),util[_0x3d3e('0x26')](_0xe41fb3,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x3d3e('0x27'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index e00cfc5..90d0acc 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 _0x2d27=['GotoIfTime',',${EXTEN},','last','Hangup','transaction','destroy','bulkCreate','error','lodash','util','models','Interval','findAll','intervals','IntervalId','then','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','groupBy','queue','playback','hasOwnProperty','answer','progress','extensions','push','type','Set','format','VoiceExtensionId','length','interval','*,*,*,*','filter','tag','CDR(tag)=','context','priority','callerID','CALLERID(all)=','indexOf','app','toLowerCase','appType','custom','Answer','Progress','record','recordingFormat','MixMonitor','${UNIQUEID}.',',ab','splice'];(function(_0x264d86,_0x31ad90){var _0x1086c2=function(_0xe5bcf7){while(--_0xe5bcf7){_0x264d86['push'](_0x264d86['shift']());}};_0x1086c2(++_0x31ad90);}(_0x2d27,0x78));var _0x72d2=function(_0x49a0b9,_0x8201dd){_0x49a0b9=_0x49a0b9-0x0;var _0x457f3e=_0x2d27[_0x49a0b9];return _0x457f3e;};'use strict';var _=require(_0x72d2('0x0'));var util=require(_0x72d2('0x1'));function rewrite(_0x4972c7,_0x5688a1){var _0x25df9e=this;return _0x4972c7[_0x72d2('0x2')][_0x72d2('0x3')][_0x72d2('0x4')]({'raw':!![]})['then'](function(_0x133ff3){_0x25df9e[_0x72d2('0x5')]=_0x133ff3;return _0x4972c7[_0x72d2('0x2')]['VoiceExtension'][_0x72d2('0x4')]({'where':{'IntervalId':_0x5688a1[_0x72d2('0x6')]},'raw':!![]});})[_0x72d2('0x7')](function(_0x3969e2){return _0x4972c7[_0x72d2('0x2')][_0x72d2('0x8')][_0x72d2('0x4')]({'where':{'exten':{'$in':_[_0x72d2('0x9')](_[_0x72d2('0xa')](_0x3969e2,_0x72d2('0xb')))},'isApp':!![]},'order':[{'raw':_0x72d2('0xc')}],'raw':!![]});})[_0x72d2('0x7')](function(_0xcc1bdc){var _0x1027b7=_[_0x72d2('0xd')](_0xcc1bdc,_0x72d2('0xb'));var _0x7f1dfe=[_0x72d2('0xe'),_0x72d2('0xf')];var _0x49e127=[];var _0x7d2af5=[];for(var _0x2a1e7f in _0x1027b7){if(_0x1027b7[_0x72d2('0x10')](_0x2a1e7f)){_0x25df9e[_0x72d2('0x11')]=![];_0x25df9e[_0x72d2('0x12')]=![];_0x25df9e['priority']=0x2;_0x25df9e[_0x72d2('0x13')]=[];_0x25df9e[_0x72d2('0x13')][_0x72d2('0x14')]({'type':_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0x15')],'context':_0x1027b7[_0x2a1e7f][0x0]['context'],'exten':_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0xb')],'priority':_0x25df9e['priority']++,'app':_0x72d2('0x16'),'appdata':util[_0x72d2('0x17')]('CDR(type)=%s',_0x1027b7[_0x2a1e7f][0x0]['type']),'VoiceExtensionId':_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0x18')]});for(var _0x911b4e=0x0,_0x2dd06f=0x0;_0x911b4e<_0x1027b7[_0x2a1e7f][_0x72d2('0x19')];_0x911b4e+=0x1,_0x2dd06f=0x0){var _0x7f6fe0=_0x1027b7[_0x2a1e7f][_0x911b4e];var _0x555875=[];var _0x375ef2=[];delete _0x7f6fe0['id'];delete _0x7f6fe0['createdAt'];delete _0x7f6fe0['updatedAt'];var _0x440022=_0x7f6fe0[_0x72d2('0x1a')]!==_0x72d2('0x1b')?[_0x7f6fe0[_0x72d2('0x1a')]]:_0x7f6fe0[_0x72d2('0x6')]?_['map'](_[_0x72d2('0x1c')](_0x25df9e['intervals'],{'IntervalId':_0x7f6fe0['IntervalId']}),_0x72d2('0x1a')):[];if(_0x7f6fe0[_0x72d2('0x10')](_0x72d2('0x1d'))){if(_0x7f6fe0[_0x72d2('0x1d')]&&_0x7f6fe0['tag']!=='--'){_0x555875['push']({'type':_0x7f6fe0['type'],'app':_0x72d2('0x16'),'appdata':_0x72d2('0x1e')+_0x7f6fe0[_0x72d2('0x1d')],'context':_0x7f6fe0[_0x72d2('0x1f')],'exten':_0x7f6fe0[_0x72d2('0xb')],'priority':_0x440022['length']+_0x25df9e[_0x72d2('0x20')]+_0x2dd06f++,'VoiceExtensionId':_0x1027b7[_0x2a1e7f][0x0]['VoiceExtensionId']});}}if(_0x7f6fe0['hasOwnProperty']('callerID')){if(_0x7f6fe0[_0x72d2('0x21')]){_0x555875[_0x72d2('0x14')]({'type':_0x7f6fe0['type'],'app':_0x72d2('0x16'),'appdata':_0x72d2('0x22')+_0x7f6fe0[_0x72d2('0x21')],'context':_0x7f6fe0[_0x72d2('0x1f')],'exten':_0x7f6fe0[_0x72d2('0xb')],'priority':_0x440022['length']+_0x25df9e['priority']+_0x2dd06f++,'VoiceExtensionId':_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0x18')]});}}if(_0x7f6fe0[_0x72d2('0x10')]('answer')){if(_0x7f1dfe[_0x72d2('0x23')](_0x7f6fe0[_0x72d2('0x24')][_0x72d2('0x25')]())>=0x0&&_0x7f6fe0[_0x72d2('0x26')]!==_0x72d2('0x27')){if(!_0x25df9e['answer']&&_0x7f6fe0[_0x72d2('0x11')]){_0x25df9e[_0x72d2('0x11')]=!![];_0x555875['push']({'type':_0x7f6fe0[_0x72d2('0x15')],'app':_0x72d2('0x28'),'context':_0x7f6fe0[_0x72d2('0x1f')],'exten':_0x7f6fe0[_0x72d2('0xb')],'priority':_0x440022['length']+_0x25df9e['priority']+_0x2dd06f++,'VoiceExtensionId':_0x1027b7[_0x2a1e7f][0x0]['VoiceExtensionId']});}if(!_0x25df9e[_0x72d2('0x11')]&&!_0x25df9e[_0x72d2('0x12')]&&!_0x7f6fe0[_0x72d2('0x11')]){_0x25df9e[_0x72d2('0x12')]=!![];_0x555875[_0x72d2('0x14')]({'type':_0x7f6fe0[_0x72d2('0x15')],'app':_0x72d2('0x29'),'context':_0x7f6fe0[_0x72d2('0x1f')],'exten':_0x7f6fe0['exten'],'priority':_0x440022[_0x72d2('0x19')]+_0x25df9e[_0x72d2('0x20')]+_0x2dd06f++,'VoiceExtensionId':_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0x18')]});}}}if(_0x7f6fe0['hasOwnProperty'](_0x72d2('0x2a'))&&_0x7f6fe0[_0x72d2('0x10')](_0x72d2('0x2b'))){if(_0x7f6fe0['record']){_0x555875[_0x72d2('0x14')]({'type':_0x7f6fe0[_0x72d2('0x15')],'app':_0x72d2('0x2c'),'appdata':_0x72d2('0x2d')+_0x7f6fe0[_0x72d2('0x2b')]+_0x72d2('0x2e'),'context':_0x7f6fe0['context'],'exten':_0x7f6fe0[_0x72d2('0xb')],'priority':_0x440022[_0x72d2('0x19')]+_0x25df9e[_0x72d2('0x20')]+_0x2dd06f++,'VoiceExtensionId':_0x1027b7[_0x2a1e7f][0x0]['VoiceExtensionId']});}}if(_0x7f6fe0['hasOwnProperty']('record')&&_0x7f6fe0[_0x72d2('0x10')](_0x72d2('0x2b'))){if(_0x7f6fe0[_0x72d2('0x2a')]){_0x375ef2['push']({'type':_0x7f6fe0[_0x72d2('0x15')],'app':'StopMixMonitor','appdata':null,'context':_0x7f6fe0[_0x72d2('0x1f')],'exten':_0x7f6fe0[_0x72d2('0xb')],'priority':_0x440022[_0x72d2('0x19')]+_0x25df9e[_0x72d2('0x20')]+_0x2dd06f++ +0x1,'VoiceExtensionId':_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0x18')]});}}for(var _0x2ed77d=0x0;_0x2ed77d<_0x440022[_0x72d2('0x19')];_0x2ed77d+=0x1){var _0xe80859=_0x25df9e['priority']+_0x440022[_0x72d2('0x19')];var _0x3a1bd2=_0x2ed77d===_0x440022[_0x72d2('0x19')]-0x1?_0x25df9e[_0x72d2('0x20')]+_0x555875[_0x72d2('0x19')]+_0x375ef2['length']+0x2:_0x25df9e['priority']+_0x2ed77d+0x1;_0x555875[_0x72d2('0x2f')](_0x2ed77d,0x0,{'type':_0x7f6fe0[_0x72d2('0x15')],'app':_0x72d2('0x30'),'appdata':_0x440022[_0x2ed77d]+'?'+_0x7f6fe0[_0x72d2('0x1f')]+_0x72d2('0x31')+_0xe80859+':'+_0x7f6fe0[_0x72d2('0x1f')]+_0x72d2('0x31')+_0x3a1bd2,'exten':_0x7f6fe0[_0x72d2('0xb')],'context':_0x7f6fe0[_0x72d2('0x1f')],'priority':_0x25df9e[_0x72d2('0x20')]+_0x2ed77d,'VoiceExtensionId':_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0x18')]});}_0x7f6fe0[_0x72d2('0x20')]=_0x555875[_0x72d2('0x19')]?_[_0x72d2('0x32')](_0x555875)['priority']+0x1:_0x25df9e[_0x72d2('0x20')];_0x25df9e[_0x72d2('0x20')]=(_0x375ef2[_0x72d2('0x19')]?_['last'](_0x375ef2)[_0x72d2('0x20')]:_0x7f6fe0[_0x72d2('0x20')])+0x1;_0x25df9e[_0x72d2('0x13')]=_['concat'](_0x25df9e[_0x72d2('0x13')],_0x555875,[_0x7f6fe0],_0x375ef2);}_0x25df9e['extensions'][_0x72d2('0x14')]({'type':_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0x15')],'app':_0x72d2('0x33'),'exten':_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0xb')],'context':_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0x1f')],'priority':_0x25df9e[_0x72d2('0x20')],'VoiceExtensionId':_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0x18')]});_0x49e127[_0x72d2('0x14')](_0x1027b7[_0x2a1e7f][0x0][_0x72d2('0x18')]);_0x7d2af5=_['concat'](_0x7d2af5,_0x25df9e[_0x72d2('0x13')]);}}return _0x4972c7[_0x72d2('0x34')](function(_0x4296a1){return _0x4972c7[_0x72d2('0x2')][_0x72d2('0x8')][_0x72d2('0x35')]({'where':{'VoiceExtensionId':{'$in':_0x49e127}},'transaction':_0x4296a1})[_0x72d2('0x7')](function(_0x401e67){return _0x4972c7[_0x72d2('0x2')][_0x72d2('0x8')][_0x72d2('0x36')](_['sortBy'](_0x7d2af5,'priority'),{'transaction':_0x4296a1});});});})['catch'](function(_0x3c8e40){console[_0x72d2('0x37')](_0x3c8e40);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x226f=['sortBy','error','lodash','util','models','Interval','findAll','intervals','IntervalId','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','then','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','Set','format','CDR(type)=%s','type','context','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','VoiceExtensionId','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','interval','*,*,*,*','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)','indexOf','app','toLowerCase','appType','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','concat','Hangup','transaction','destroy'];(function(_0x56e4a3,_0x471885){var _0x318330=function(_0x5613cd){while(--_0x5613cd){_0x56e4a3['push'](_0x56e4a3['shift']());}};_0x318330(++_0x471885);}(_0x226f,0x11e));var _0xf226=function(_0x227383,_0x443562){_0x227383=_0x227383-0x0;var _0x2d3cbc=_0x226f[_0x227383];return _0x2d3cbc;};'use strict';var _=require(_0xf226('0x0'));var util=require(_0xf226('0x1'));function rewrite(_0x597b16,_0x3de09e){var _0x1a43f1=this;return _0x597b16[_0xf226('0x2')][_0xf226('0x3')][_0xf226('0x4')]({'raw':!![]})['then'](function(_0x13faf1){_0x1a43f1[_0xf226('0x5')]=_0x13faf1;return _0x597b16[_0xf226('0x2')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x3de09e[_0xf226('0x6')]},'raw':!![]});})['then'](function(_0x6aad9a){return _0x597b16[_0xf226('0x2')][_0xf226('0x7')]['findAll']({'where':{'exten':{'$in':_[_0xf226('0x8')](_[_0xf226('0x9')](_0x6aad9a,'exten'))}},'order':[{'raw':_0xf226('0xa')}],'raw':!![]});})[_0xf226('0xb')](function(_0x28ce97){var _0x2e2b88=_[_0xf226('0xc')](_0x28ce97,{'priority':'1'});var _0x3aeae2=_[_0xf226('0xc')](_0x28ce97,{'isApp':0x1});var _0x8c18b0=_[_0xf226('0xd')](_0x3aeae2,_0xf226('0xe'));var _0xaadf2=[_0xf226('0xf'),_0xf226('0x10')];var _0x2376d4=[];var _0x475381=[];for(var _0x58f783 in _0x8c18b0){if(_0x8c18b0[_0xf226('0x11')](_0x58f783)){_0x1a43f1[_0xf226('0x12')]=0x2;_0x1a43f1[_0xf226('0x13')]=[];_0x1a43f1[_0xf226('0x14')]=_[_0xf226('0x15')](_0x2e2b88,{'exten':_0x8c18b0[_0x58f783][0x0][_0xf226('0xe')]});_0x1a43f1[_0xf226('0x13')][_0xf226('0x16')]({'type':_0x8c18b0[_0x58f783][0x0]['type'],'app':_0xf226('0x17'),'appdata':util[_0xf226('0x18')](_0xf226('0x19'),_0x8c18b0[_0x58f783][0x0][_0xf226('0x1a')]),'context':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1b')],'exten':_0x8c18b0[_0x58f783][0x0][_0xf226('0xe')],'priority':_0x1a43f1[_0xf226('0x12')]++,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0]['VoiceExtensionId']});if(_0x8c18b0[_0x58f783][0x0][_0xf226('0x1a')]==='outbound'){if(_0x1a43f1[_0xf226('0x14')]){_0x1a43f1[_0xf226('0x13')][_0xf226('0x16')]({'type':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1a')],'app':_0xf226('0x17'),'appdata':_0xf226('0x1c')+(_0x1a43f1[_0xf226('0x14')][_0xf226('0x1d')]?_0xf226('0x1e')+_0x1a43f1[_0xf226('0x14')][_0xf226('0x1d')]+'}':_0xf226('0x1f')),'context':_0x8c18b0[_0x58f783][0x0]['context'],'exten':_0x8c18b0[_0x58f783][0x0]['exten'],'priority':_0x1a43f1[_0xf226('0x12')]++,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]});}_0x1a43f1[_0xf226('0x13')][_0xf226('0x16')]({'type':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1a')],'app':'Set','appdata':'CDR(routeid)='+_0x8c18b0[_0x58f783][0x0]['VoiceExtensionId'],'context':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1b')],'exten':_0x8c18b0[_0x58f783][0x0]['exten'],'priority':_0x1a43f1[_0xf226('0x12')]++,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]});var _0x5bbefd=_0x1a43f1[_0xf226('0x12')]++;_0x1a43f1[_0xf226('0x13')]['push']({'type':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1a')],'app':_0xf226('0x21'),'appdata':_0xf226('0x22')+(_0x5bbefd+0x2)+_0xf226('0x23')+(_0x5bbefd+0x1)+')','context':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1b')],'exten':_0x8c18b0[_0x58f783][0x0][_0xf226('0xe')],'priority':_0x5bbefd,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]});if(_0x1a43f1[_0xf226('0x14')]){_0x1a43f1[_0xf226('0x13')][_0xf226('0x16')]({'type':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1a')],'app':_0xf226('0x17'),'appdata':_0x1a43f1[_0xf226('0x14')][_0xf226('0x1d')]?_0xf226('0x24')+_0x1a43f1[_0xf226('0x14')]['cutdigits']+'}':_0xf226('0x25'),'context':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1b')],'exten':_0x8c18b0[_0x58f783][0x0][_0xf226('0xe')],'priority':_0x1a43f1['priority']++,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]});}_0x1a43f1[_0xf226('0x13')][_0xf226('0x16')]({'type':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1a')],'app':_0xf226('0x17'),'appdata':_0xf226('0x26')+_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')],'context':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1b')],'exten':_0x8c18b0[_0x58f783][0x0][_0xf226('0xe')],'priority':_0x1a43f1['priority']++,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]});if(_0x1a43f1['extension']&&_0x1a43f1[_0xf226('0x14')][_0xf226('0x11')]('recordingFormat')&&_0x1a43f1[_0xf226('0x14')][_0xf226('0x27')]!==_0xf226('0x28')){_0x1a43f1[_0xf226('0x13')]['push']({'type':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1a')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1b')],'exten':_0x8c18b0[_0x58f783][0x0][_0xf226('0xe')],'priority':_0x1a43f1['priority']++,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]});_0x1a43f1[_0xf226('0x13')][_0xf226('0x16')]({'type':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1a')],'app':_0xf226('0x17'),'appdata':_0xf226('0x29')+_0x1a43f1['extension'][_0xf226('0x27')]||_0xf226('0x2a'),'context':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1b')],'exten':_0x8c18b0[_0x58f783][0x0][_0xf226('0xe')],'priority':_0x1a43f1[_0xf226('0x12')]++,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]});}}_0x1a43f1[_0xf226('0x13')]['push']({'type':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1a')],'app':'Set','appdata':_0xf226('0x2b'),'context':_0x8c18b0[_0x58f783][0x0]['context'],'exten':_0x8c18b0[_0x58f783][0x0]['exten'],'priority':_0x1a43f1[_0xf226('0x12')]++,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]});_0x1a43f1[_0xf226('0x13')][_0xf226('0x16')]({'type':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1a')],'app':_0xf226('0x17'),'appdata':_0xf226('0x2c'),'context':_0x8c18b0[_0x58f783][0x0]['context'],'exten':_0x8c18b0[_0x58f783][0x0]['exten'],'priority':_0x1a43f1[_0xf226('0x12')]++,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]});_0x1a43f1[_0xf226('0x13')][_0xf226('0x16')]({'type':_0x8c18b0[_0x58f783][0x0]['type'],'app':_0xf226('0x17'),'appdata':_0xf226('0x2d'),'context':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1b')],'exten':_0x8c18b0[_0x58f783][0x0]['exten'],'priority':_0x1a43f1['priority']++,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0]['VoiceExtensionId']});for(var _0x3c3725=0x0,_0x970f2a=0x0;_0x3c3725<_0x8c18b0[_0x58f783][_0xf226('0x2e')];_0x3c3725+=0x1,_0x970f2a=0x0){var _0x4ebb82=_0x8c18b0[_0x58f783][_0x3c3725];if(_0x4ebb82[_0xf226('0x1a')]){_0x4ebb82[_0xf226('0x1a')]=_0x4ebb82[_0xf226('0x1a')]['toLowerCase']();}var _0x42217c=[];var _0x5a005e=[];delete _0x4ebb82['id'];delete _0x4ebb82[_0xf226('0x2f')];delete _0x4ebb82['updatedAt'];var _0xdc87e8=_0x4ebb82[_0xf226('0x30')]!==_0xf226('0x31')?[_0x4ebb82['interval']]:_0x4ebb82[_0xf226('0x6')]?_['map'](_[_0xf226('0xc')](_0x1a43f1['intervals'],{'IntervalId':_0x4ebb82[_0xf226('0x6')]}),_0xf226('0x30')):[];if(_0x4ebb82[_0xf226('0x11')]('tag')){if(_0x4ebb82[_0xf226('0x32')]&&_0x4ebb82[_0xf226('0x32')]!=='--'){_0x42217c[_0xf226('0x16')]({'type':_0x4ebb82[_0xf226('0x1a')],'app':_0xf226('0x17'),'appdata':_0xf226('0x33')+_0x4ebb82[_0xf226('0x32')],'context':_0x4ebb82[_0xf226('0x1b')],'exten':_0x4ebb82[_0xf226('0xe')],'priority':_0xdc87e8[_0xf226('0x2e')]+_0x1a43f1['priority']+_0x970f2a++,'VoiceExtensionId':_0x4ebb82[_0xf226('0x20')]});}}if(_0x4ebb82['type']==='outbound'&&_0x4ebb82[_0xf226('0x11')](_0xf226('0x34'))){if(_0x4ebb82[_0xf226('0x34')]){_0x42217c['push']({'type':_0x4ebb82[_0xf226('0x1a')],'app':_0xf226('0x21'),'appdata':_0xf226('0x35')+_0x4ebb82['callerID']+')','context':_0x4ebb82[_0xf226('0x1b')],'exten':_0x4ebb82[_0xf226('0xe')],'priority':_0xdc87e8[_0xf226('0x2e')]+_0x1a43f1[_0xf226('0x12')]+_0x970f2a++,'VoiceExtensionId':_0x4ebb82[_0xf226('0x20')]});}else{_0x42217c[_0xf226('0x16')]({'type':_0x4ebb82['type'],'app':'ExecIf','appdata':_0xf226('0x36'),'context':_0x4ebb82[_0xf226('0x1b')],'exten':_0x4ebb82[_0xf226('0xe')],'priority':_0xdc87e8['length']+_0x1a43f1[_0xf226('0x12')]+_0x970f2a++,'VoiceExtensionId':_0x4ebb82[_0xf226('0x20')]});}}if(_0x4ebb82[_0xf226('0x11')]('answer')){if(_0xaadf2[_0xf226('0x37')](_0x4ebb82[_0xf226('0x38')][_0xf226('0x39')]())>=0x0&&_0x4ebb82[_0xf226('0x3a')]!=='custom'){if(_0x4ebb82[_0xf226('0x3b')]){_0x42217c[_0xf226('0x16')]({'type':_0x4ebb82['type'],'app':_0xf226('0x21'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4ebb82[_0xf226('0x1b')],'exten':_0x4ebb82[_0xf226('0xe')],'priority':_0xdc87e8['length']+_0x1a43f1[_0xf226('0x12')]+_0x970f2a++,'VoiceExtensionId':_0x4ebb82[_0xf226('0x20')]});_0x42217c[_0xf226('0x16')]({'type':_0x4ebb82[_0xf226('0x1a')],'app':_0xf226('0x17'),'appdata':_0xf226('0x3c'),'context':_0x4ebb82[_0xf226('0x1b')],'exten':_0x4ebb82[_0xf226('0xe')],'priority':_0xdc87e8[_0xf226('0x2e')]+_0x1a43f1['priority']+_0x970f2a++,'VoiceExtensionId':_0x4ebb82[_0xf226('0x20')]});}else{_0x42217c['push']({'type':_0x4ebb82['type'],'app':_0xf226('0x21'),'appdata':_0xf226('0x3d'),'context':_0x4ebb82[_0xf226('0x1b')],'exten':_0x4ebb82[_0xf226('0xe')],'priority':_0xdc87e8[_0xf226('0x2e')]+_0x1a43f1[_0xf226('0x12')]+_0x970f2a++,'VoiceExtensionId':_0x4ebb82[_0xf226('0x20')]});_0x42217c['push']({'type':_0x4ebb82[_0xf226('0x1a')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x4ebb82[_0xf226('0x1b')],'exten':_0x4ebb82[_0xf226('0xe')],'priority':_0xdc87e8['length']+_0x1a43f1['priority']+_0x970f2a++,'VoiceExtensionId':_0x4ebb82[_0xf226('0x20')]});}}}for(var _0x2ec7c2=0x0;_0x2ec7c2<_0xdc87e8[_0xf226('0x2e')];_0x2ec7c2+=0x1){var _0x521d7d=_0x1a43f1[_0xf226('0x12')]+_0xdc87e8[_0xf226('0x2e')];var _0x215655=_0x2ec7c2===_0xdc87e8[_0xf226('0x2e')]-0x1?_0x1a43f1['priority']+_0x42217c[_0xf226('0x2e')]+_0x5a005e[_0xf226('0x2e')]+0x2:_0x1a43f1['priority']+_0x2ec7c2+0x1;_0x42217c[_0xf226('0x3e')](_0x2ec7c2,0x0,{'type':_0x4ebb82['type'],'app':_0xf226('0x3f'),'appdata':_0xdc87e8[_0x2ec7c2]+'?'+_0x4ebb82[_0xf226('0x1b')]+_0xf226('0x40')+_0x521d7d+':'+_0x4ebb82[_0xf226('0x1b')]+_0xf226('0x40')+_0x215655,'exten':_0x4ebb82[_0xf226('0xe')],'context':_0x4ebb82[_0xf226('0x1b')],'priority':_0x1a43f1[_0xf226('0x12')]+_0x2ec7c2,'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]});}_0x4ebb82[_0xf226('0x12')]=_0x42217c['length']?_['last'](_0x42217c)[_0xf226('0x12')]+0x1:_0x1a43f1['priority'];_0x1a43f1[_0xf226('0x12')]=(_0x5a005e[_0xf226('0x2e')]?_['last'](_0x5a005e)[_0xf226('0x12')]:_0x4ebb82[_0xf226('0x12')])+0x1;_0x1a43f1[_0xf226('0x13')]=_[_0xf226('0x41')](_0x1a43f1[_0xf226('0x13')],_0x42217c,[_0x4ebb82],_0x5a005e);}_0x1a43f1['extensions'][_0xf226('0x16')]({'type':_0x8c18b0[_0x58f783][0x0]['type'],'app':_0xf226('0x42'),'exten':_0x8c18b0[_0x58f783][0x0][_0xf226('0xe')],'context':_0x8c18b0[_0x58f783][0x0][_0xf226('0x1b')],'priority':_0x1a43f1[_0xf226('0x12')],'VoiceExtensionId':_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]});_0x2376d4['push'](_0x8c18b0[_0x58f783][0x0][_0xf226('0x20')]);_0x475381=_['concat'](_0x475381,_0x1a43f1[_0xf226('0x13')]);}}return _0x597b16[_0xf226('0x43')](function(_0x5b9496){return _0x597b16[_0xf226('0x2')]['VoiceExtension'][_0xf226('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x2376d4}},'transaction':_0x5b9496})[_0xf226('0xb')](function(_0x273ca0){return _0x597b16[_0xf226('0x2')]['VoiceExtension']['bulkCreate'](_[_0xf226('0x45')](_0x475381,_0xf226('0x12')),{'transaction':_0x5b9496});});});})['catch'](function(_0x4c3885){console[_0xf226('0x46')](_0x4c3885);});}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 00b9f45..7106512 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 _0xa664=['firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','fromQuery','ContactId','updatedAt','select','field','NOW()','scheduledAt','toString','createdAt','cm_contacts','where','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','\x20=\x20?','insert','id\x20IN\x20?','str','cm_hopper_final','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data'];(function(_0x39ddd4,_0x38ce35){var _0x3d642a=function(_0xa05ced){while(--_0xa05ced){_0x39ddd4['push'](_0x39ddd4['shift']());}};_0x3d642a(++_0x38ce35);}(_0xa664,0x134));var _0x4a66=function(_0x1c7c97,_0x1991b5){_0x1c7c97=_0x1c7c97-0x0;var _0x1e142a=_0xa664[_0x1c7c97];return _0x1e142a;};'use strict';var BPromise=require(_0x4a66('0x0'));var util=require(_0x4a66('0x1'));var _=require(_0x4a66('0x2'));var fs=require('fs');var squel=require(_0x4a66('0x3'));var Papa=require(_0x4a66('0x4'));var Redis=require(_0x4a66('0x5'));var db=require(_0x4a66('0x6'))['db'];var config=require(_0x4a66('0x7'));var logger=require('../../../config/logger')(_0x4a66('0x8'));config[_0x4a66('0x9')]=_[_0x4a66('0xa')](config[_0x4a66('0x9')],{'host':_0x4a66('0xb'),'port':0x18eb});var socket=require(_0x4a66('0xc'))(new Redis(config['redis']));require(_0x4a66('0xd'))['register'](socket);try{if(!process[_0x4a66('0xe')][0x2]||process['argv'][0x2]===_0x4a66('0xf')||process[_0x4a66('0xe')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x4a66('0xe')][0x2];if(!process[_0x4a66('0xe')][0x3]||process[_0x4a66('0xe')][0x3]===_0x4a66('0xf')||process[_0x4a66('0xe')][0x3]===_0x4a66('0x10')||!process[_0x4a66('0xe')][0x4]||process[_0x4a66('0xe')][0x4]===_0x4a66('0xf')||process['argv'][0x4]===_0x4a66('0x10')){throw new Error(_0x4a66('0x11'));}var FIELDS=_[_0x4a66('0x12')](process[_0x4a66('0xe')][0x3]['split'](','),process[_0x4a66('0xe')][0x4][_0x4a66('0x13')](','));if(!process[_0x4a66('0xe')][0x5]||process['argv'][0x5]===_0x4a66('0xf')||process[_0x4a66('0xe')][0x5]===_0x4a66('0x10')){throw new Error(_0x4a66('0x14'));}var LISTID=process[_0x4a66('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!=='undefined'&&process[_0x4a66('0xe')][0x6]!==_0x4a66('0x10')?process[_0x4a66('0xe')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x4a66('0xe')][0x7]!==_0x4a66('0xf')&&process[_0x4a66('0xe')][0x7]!==_0x4a66('0x10')?process['argv'][0x7]:null;if(!process[_0x4a66('0xe')][0x8]||process['argv'][0x8]==='undefined'||process[_0x4a66('0xe')][0x8]===_0x4a66('0x10')){throw new Error(_0x4a66('0x15'));}var SOCKET_TIMESTAMP=process[_0x4a66('0xe')][0x8];}catch(_0x4dad54){logger[_0x4a66('0x16')](_0x4dad54);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(_0x1a4b22,_0x429dca,_0x2e4972,_0x1d3360){var _0x486fb5={'message':_0x429dca};_0x486fb5[_0x1a4b22]=!![];if(_0x2e4972){_0x486fb5['contact']=_0x2e4972;}if(_0x1d3360){_0x486fb5[_0x4a66('0x17')]=_0x1d3360;}return _0x486fb5;}function isEmail(_0x198d8e){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))*$/[_0x4a66('0x18')](_0x198d8e);}function checkRow(_0x12df17,_0x48ad67,_0x4a9804){return new BPromise(function(_0x2e4696,_0x295058){if(_[_0x4a66('0x19')](_0x12df17)){return _0x295058(handleCheckRowError(_0x4a66('0x16'),_0x4a66('0x1a'),null,_0x4a9804));}if(_0x12df17[_0x4a66('0x1b')]&&_0x12df17[_0x4a66('0x1b')][_0x4a66('0x1c')]){var _0x2aaf2d=_[_0x4a66('0x1d')](_0x12df17[_0x4a66('0x1b')],_0x4a66('0x1e'))[_0x4a66('0x1f')](';');return _0x295058(handleCheckRowError(_0x4a66('0x16'),_0x2aaf2d,null,_0x4a9804));}var _0x566293={};for(var _0x21a1ba in FIELDS){if(FIELDS[_0x4a66('0x20')](_0x21a1ba)&&FIELDS[_0x21a1ba]){_0x566293[_0x21a1ba]=_0x12df17[_0x4a66('0x21')][0x0][FIELDS[_0x21a1ba]]||_0x12df17[_0x4a66('0x21')][0x0]['\ufeff'+FIELDS[_0x21a1ba]];}}if(!_0x566293[_0x4a66('0x22')]){return _0x295058(handleCheckRowError('error',_0x4a66('0x23'),null,_0x4a9804));}if(!_0x566293[_0x4a66('0x24')]){return _0x295058(handleCheckRowError(_0x4a66('0x16'),'phone\x20not\x20specified!',null,_0x4a9804));}if(_0x566293[_0x4a66('0x25')]){var _0x1a2726=moment(_0x566293['birthDate'],_0x4a66('0x26'));if(!_0x1a2726[_0x4a66('0x27')]()){return _0x295058(handleCheckRowError(_0x4a66('0x16'),_0x4a66('0x28'),null,_0x4a9804));}}if(_0x566293['email']){if(!isEmail(_0x566293[_0x4a66('0x29')])){return _0x295058(handleCheckRowError(_0x4a66('0x16'),_0x4a66('0x2a'),null,_0x4a9804));}}_0x566293[_0x4a66('0x2b')]=LISTID;_0x566293['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x4a66('0x1c')]&&_0x48ad67){var _0x4285b7={};for(var _0xafa159=0x0,_0x17578f=DUPLICATES[_0x4a66('0x1c')];_0xafa159<_0x17578f;_0xafa159+=0x1){_0x4285b7[DUPLICATES[_0xafa159]]=_0x566293[DUPLICATES[_0xafa159]];}var _0x3325dc=_[_0x4a66('0x2c')](_0x48ad67,_0x4285b7);if(_0x3325dc){return _0x295058(handleCheckRowError(_0x4a66('0x2d'),_0x4a66('0x2e'),_0x3325dc,_0x4a9804));}}return db[_0x4a66('0x2f')][_0x4a66('0x30')](_0x566293,{'raw':!![],'hooks':![],'fields':_[_0x4a66('0x31')](_0x566293)})[_0x4a66('0x32')](function(_0x54367f){if(DUPLICATES&&DUPLICATES[_0x4a66('0x1c')]&&_0x48ad67){_0x48ad67[_0x4a66('0x33')](_[_0x4a66('0x34')](_0x566293,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x54367f['id'];return _0x2e4696();})[_0x4a66('0x35')](function(_0x56a12e){return _0x295058(handleCheckRowError(_0x4a66('0x16'),_0x4a66('0x36')+(_0x56a12e[_0x4a66('0x1e')]||JSON[_0x4a66('0x37')](_0x56a12e)),null,_0x4a9804));});});}function checkHopper(){function _0x3da002(){return function(_0x10c53f){logger[_0x4a66('0x16')](_0x4a66('0x38'),_0x4a66('0x39'),util[_0x4a66('0x3a')](_0x10c53f,{'showHidden':![],'depth':null}));};}var _0x5e7ffe=function(_0x18fe71,_0x301c4b){var _0x71a011=squel['insert']()[_0x4a66('0x3b')]('cm_hopper')[_0x4a66('0x3c')](['phone','scheduledAt',_0x4a66('0x3d'),_0x4a66('0x2b'),_0x301c4b,'createdAt',_0x4a66('0x3e')],squel[_0x4a66('0x3f')]()[_0x4a66('0x40')](_0x4a66('0x24'),_0x4a66('0x24'))['field'](_0x4a66('0x41'),_0x4a66('0x42'))['field']('id',_0x4a66('0x3d'))[_0x4a66('0x40')](LISTID['toString'](),_0x4a66('0x2b'))['field'](_0x18fe71['id'][_0x4a66('0x43')](),_0x301c4b)[_0x4a66('0x40')]('NOW()',_0x4a66('0x44'))[_0x4a66('0x40')](_0x4a66('0x41'),_0x4a66('0x3e'))['from'](_0x4a66('0x45'))[_0x4a66('0x46')]('deletedAt\x20IS\x20NULL')[_0x4a66('0x46')](_0x4a66('0x47'),LISTID[_0x4a66('0x43')]())[_0x4a66('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0x4a66('0x46')](_0x4a66('0x48'),squel[_0x4a66('0x3f')]()['field']('phone')[_0x4a66('0x49')](_0x4a66('0x4a'))[_0x4a66('0x46')](_0x301c4b+_0x4a66('0x4b'),_0x18fe71['id']['toString']())))[_0x4a66('0x43')]();return _0x71a011;};var _0x2dffe2=function(_0x401879,_0x308a14){var _0x427f8a=squel[_0x4a66('0x4c')]()[_0x4a66('0x3b')](_0x4a66('0x4a'))[_0x4a66('0x3c')]([_0x4a66('0x24'),_0x4a66('0x42'),'ContactId',_0x4a66('0x2b'),_0x308a14,_0x4a66('0x44'),_0x4a66('0x3e')],squel['select']()[_0x4a66('0x40')](_0x4a66('0x24'),'phone')[_0x4a66('0x40')](_0x4a66('0x41'),_0x4a66('0x42'))[_0x4a66('0x40')]('id',_0x4a66('0x3d'))[_0x4a66('0x40')](LISTID[_0x4a66('0x43')](),_0x4a66('0x2b'))[_0x4a66('0x40')](_0x401879['id'][_0x4a66('0x43')](),_0x308a14)['field'](_0x4a66('0x41'),_0x4a66('0x44'))[_0x4a66('0x40')](_0x4a66('0x41'),_0x4a66('0x3e'))['from'](_0x4a66('0x45'))[_0x4a66('0x46')]('deletedAt\x20IS\x20NULL')[_0x4a66('0x46')](_0x4a66('0x47'),LISTID[_0x4a66('0x43')]())[_0x4a66('0x46')](_0x4a66('0x4d'),squel[_0x4a66('0x4e')](hopperContacts))[_0x4a66('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0x4a66('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4a66('0x3f')]()[_0x4a66('0x40')]('calleridnum')['from'](_0x4a66('0x4f'))[_0x4a66('0x46')](_0x308a14+_0x4a66('0x4b'),_0x401879['id']['toString']()))['where'](_0x4a66('0x48'),squel['select']()[_0x4a66('0x40')](_0x4a66('0x24'))['from']('cm_hopper')[_0x4a66('0x46')](_0x308a14+_0x4a66('0x4b'),_0x401879['id'][_0x4a66('0x43')]())))['toString']();return _0x427f8a;};function _0x2e41f6(_0x59238d,_0x1182cd){var _0x4c37c6=squel[_0x4a66('0x4c')]()[_0x4a66('0x3b')](_0x4a66('0x4a'))[_0x4a66('0x3c')](['phone',_0x4a66('0x42'),'ContactId',_0x4a66('0x2b'),_0x1182cd,_0x4a66('0x44'),_0x4a66('0x3e')],squel[_0x4a66('0x3f')]()['field'](_0x4a66('0x24'),_0x4a66('0x24'))[_0x4a66('0x40')](_0x4a66('0x41'),'scheduledAt')[_0x4a66('0x40')]('id',_0x4a66('0x3d'))[_0x4a66('0x40')](LISTID[_0x4a66('0x43')](),_0x4a66('0x2b'))[_0x4a66('0x40')](_0x59238d['id'][_0x4a66('0x43')](),_0x1182cd)[_0x4a66('0x40')]('NOW()',_0x4a66('0x44'))[_0x4a66('0x40')](_0x4a66('0x41'),_0x4a66('0x3e'))['from'](_0x4a66('0x45'))[_0x4a66('0x46')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0x4a66('0x43')]())[_0x4a66('0x46')](_0x4a66('0x4d'),squel[_0x4a66('0x4e')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x4c37c6;}function _0x12028e(_0x5a2386,_0x470bd1){var _0x157370=squel[_0x4a66('0x4c')]()[_0x4a66('0x3b')]('cm_hopper_black')[_0x4a66('0x3c')](['phone',_0x4a66('0x3d'),_0x4a66('0x2b'),_0x470bd1,_0x4a66('0x44'),_0x4a66('0x3e')],squel['select']()[_0x4a66('0x40')]('phone',_0x4a66('0x24'))[_0x4a66('0x40')]('id',_0x4a66('0x3d'))[_0x4a66('0x40')](LISTID['toString'](),_0x4a66('0x2b'))[_0x4a66('0x40')](_0x5a2386['id'][_0x4a66('0x43')](),_0x470bd1)[_0x4a66('0x40')](_0x4a66('0x41'),_0x4a66('0x44'))['field']('NOW()',_0x4a66('0x3e'))[_0x4a66('0x49')]('cm_contacts')[_0x4a66('0x46')](_0x4a66('0x50'))[_0x4a66('0x46')](_0x4a66('0x47'),LISTID[_0x4a66('0x43')]())[_0x4a66('0x46')](_0x4a66('0x4d'),squel['str'](hopperContacts))['where'](_0x4a66('0x51')))[_0x4a66('0x43')]();return _0x157370;}return db[_0x4a66('0x52')][_0x4a66('0x53')]({'where':{'type':_0x4a66('0x54')},'attributes':['id',_0x4a66('0x55')],'include':[{'model':db[_0x4a66('0x56')],'as':_0x4a66('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x3602e4){var _0x278696=[];if(_0x3602e4){var _0x353a17;for(var _0x39e55f=0x0,_0x523edc;_0x39e55f<_0x3602e4[_0x4a66('0x1c')];_0x39e55f+=0x1){_0x523edc=_0x3602e4[_0x39e55f][_0x4a66('0x58')]({'plain':!![]});switch(_0x523edc[_0x4a66('0x55')]){case _0x4a66('0x59'):_0x278696['push'](db['sequelize'][_0x4a66('0x5a')](_0x2dffe2(_0x523edc,_0x4a66('0x5b')))[_0x4a66('0x32')](function(){})[_0x4a66('0x35')](_0x3da002()));break;case _0x4a66('0x5c'):_0x278696[_0x4a66('0x33')](db[_0x4a66('0x5d')][_0x4a66('0x5a')](_0x5e7ffe(_0x523edc,_0x4a66('0x5b')))[_0x4a66('0x32')](function(){})[_0x4a66('0x35')](_0x3da002()));break;default:_0x278696[_0x4a66('0x33')](db[_0x4a66('0x5d')][_0x4a66('0x5a')](_0x2e41f6(_0x523edc,_0x4a66('0x5b')))['then'](function(){})[_0x4a66('0x35')](_0x3da002()));}}}return _0x278696;})[_0x4a66('0x5e')]()['then'](function(){return db[_0x4a66('0x52')][_0x4a66('0x53')]({'where':{'type':_0x4a66('0x54')},'attributes':['id'],'include':[{'model':db[_0x4a66('0x56')],'as':_0x4a66('0x5f'),'where':{'id':LISTID}}]})[_0x4a66('0x32')](function(_0xa3558c){var _0x17b63c=[];if(_0xa3558c){var _0x2f60df;for(var _0x35c176=0x0,_0x4e8859;_0x35c176<_0xa3558c[_0x4a66('0x1c')];_0x35c176+=0x1){_0x4e8859=_0xa3558c[_0x35c176][_0x4a66('0x58')]({'plain':!![]});_0x17b63c[_0x4a66('0x33')](db['sequelize']['query'](_0x12028e(_0x4e8859,_0x4a66('0x5b')))['then'](function(){})[_0x4a66('0x35')](_0x3da002()));}}return _0x17b63c;})[_0x4a66('0x5e')]();})[_0x4a66('0x32')](function(){return db['Campaign'][_0x4a66('0x53')]({'attributes':['id',_0x4a66('0x55')],'include':[{'model':db['CmList'],'as':_0x4a66('0x57'),'where':{'id':LISTID}}]})[_0x4a66('0x32')](function(_0x2a068b){var _0x5923b1=[];if(_0x2a068b){for(var _0x593120=0x0,_0x41f7f7;_0x593120<_0x2a068b[_0x4a66('0x1c')];_0x593120+=0x1){_0x41f7f7=_0x2a068b[_0x593120]['get']({'plain':!![]});switch(_0x41f7f7[_0x4a66('0x55')]){case'always':_0x5923b1[_0x4a66('0x33')](db[_0x4a66('0x5d')][_0x4a66('0x5a')](_0x2dffe2(_0x41f7f7,_0x4a66('0x60')))['then'](function(){})[_0x4a66('0x35')](_0x3da002()));break;case _0x4a66('0x5c'):_0x5923b1[_0x4a66('0x33')](db[_0x4a66('0x5d')]['query'](_0x5e7ffe(_0x41f7f7,_0x4a66('0x60')))[_0x4a66('0x32')](function(){})[_0x4a66('0x35')](_0x3da002()));break;default:_0x5923b1[_0x4a66('0x33')](db[_0x4a66('0x5d')][_0x4a66('0x5a')](_0x2e41f6(_0x41f7f7,_0x4a66('0x60')))[_0x4a66('0x32')](function(){})[_0x4a66('0x35')](_0x3da002()));}}}return _0x5923b1;})[_0x4a66('0x5e')]();})[_0x4a66('0x32')](function(){return db[_0x4a66('0x61')][_0x4a66('0x53')]({'attributes':['id'],'include':[{'model':db[_0x4a66('0x56')],'as':_0x4a66('0x5f'),'where':{'id':LISTID}}]})[_0x4a66('0x32')](function(_0x1fd98b){var _0x5d539d=[];if(_0x1fd98b){for(var _0x4261cc=0x0,_0x9e3a73;_0x4261cc<_0x1fd98b[_0x4a66('0x1c')];_0x4261cc+=0x1){_0x9e3a73=_0x1fd98b[_0x4261cc][_0x4a66('0x58')]({'plain':!![]});_0x5d539d[_0x4a66('0x33')](db[_0x4a66('0x5d')]['query'](_0x12028e(_0x9e3a73,'CampaignId'))[_0x4a66('0x32')](function(){})[_0x4a66('0x35')](_0x3da002()));}}return _0x5d539d;})[_0x4a66('0x5e')]();})[_0x4a66('0x35')](function(_0x3ffa25){logger['error'](_0x4a66('0x62'),_0x4a66('0x63'),_0x3ffa25[_0x4a66('0x1e')]);});}var processPromises=function(_0x60c597){return BPromise['all'](promises)[_0x4a66('0x32')](function(_0x45564b){})[_0x4a66('0x35')](function(_0x1d2dcd){logger[_0x4a66('0x16')](_0x4a66('0x64'),JSON['stringify'](_0x1d2dcd));})[_0x4a66('0x65')](function(){socket[_0x4a66('0x66')](_0x4a66('0x67')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x60c597){return _0x60c597['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x4a66('0x32')](function(){socket[_0x4a66('0x66')](_0x4a66('0x67')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x15e4c1){logger[_0x4a66('0x16')](_0x4a66('0x68'),JSON[_0x4a66('0x37')](_0x15e4c1));}finally{process[_0x4a66('0x69')](0x0);}});};process['on'](_0x4a66('0x6a'),function(){logger[_0x4a66('0x6b')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x4a66('0x6c')]()[_0x4a66('0x32')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x4a66('0x13')](',');return db[_0x4a66('0x2f')][_0x4a66('0x53')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x285253){var _0x13c034=fs[_0x4a66('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x4a66('0x6e')](_0x13c034,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1ca8b7,_0x200a4b){total+=0x1;var _0x4ec8d1=total;promises[_0x4a66('0x33')](checkRow(_0x1ca8b7,_0x285253,_0x4ec8d1)[_0x4a66('0x32')](function(){success+=0x1;})[_0x4a66('0x35')](function(_0xd860f9){if(_0xd860f9[_0x4a66('0x16')]){errors+=0x1;delete _0xd860f9[_0x4a66('0x16')];}else if(_0xd860f9[_0x4a66('0x2d')]){duplicates+=0x1;delete _0xd860f9[_0x4a66('0x2d')];}rows['push'](_0xd860f9);}));if(total%0xc8===0x0){_0x200a4b[_0x4a66('0x6f')]();return processPromises(_0x200a4b);}},'complete':function(){return processPromises()[_0x4a66('0x32')](function(){logger[_0x4a66('0x6b')](_0x4a66('0x70'));endCsv();});},'error':function(_0x3982b4,_0x283a4a){logger[_0x4a66('0x6b')](_0x4a66('0x71'),JSON[_0x4a66('0x37')](_0x3982b4));endCsv();}});})[_0x4a66('0x35')](function(_0x20d1d8){logger[_0x4a66('0x16')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x4a66('0x37')](_0x20d1d8));});}main(); \ No newline at end of file +var _0xecbe=['id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','then','get','always','push','sequelize','VoiceQueueId','onlyIfOpen','query','catch','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','contact:csv_','unlinkSync','exit','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','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!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','select','field','toString','NOW()','updatedAt','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','deletedAt\x20IS\x20NULL'];(function(_0x564215,_0x1effd0){var _0x181952=function(_0x2574d2){while(--_0x2574d2){_0x564215['push'](_0x564215['shift']());}};_0x181952(++_0x1effd0);}(_0xecbe,0x9e));var _0xeecb=function(_0x4a7b64,_0x16733c){_0x4a7b64=_0x4a7b64-0x0;var _0x500da6=_0xecbe[_0x4a7b64];return _0x500da6;};'use strict';var BPromise=require(_0xeecb('0x0'));var util=require(_0xeecb('0x1'));var _=require(_0xeecb('0x2'));var fs=require('fs');var squel=require(_0xeecb('0x3'));var Papa=require(_0xeecb('0x4'));var Redis=require(_0xeecb('0x5'));var db=require(_0xeecb('0x6'))['db'];var config=require(_0xeecb('0x7'));var logger=require(_0xeecb('0x8'))('api');config[_0xeecb('0x9')]=_[_0xeecb('0xa')](config[_0xeecb('0x9')],{'host':_0xeecb('0xb'),'port':0x18eb});var socket=require(_0xeecb('0xc'))(new Redis(config[_0xeecb('0x9')]));require(_0xeecb('0xd'))['register'](socket);try{if(!process[_0xeecb('0xe')][0x2]||process[_0xeecb('0xe')][0x2]===_0xeecb('0xf')||process['argv'][0x2]===_0xeecb('0x10')){throw new Error(_0xeecb('0x11'));}var FILEPATH=process['argv'][0x2];if(!process[_0xeecb('0xe')][0x3]||process[_0xeecb('0xe')][0x3]===_0xeecb('0xf')||process[_0xeecb('0xe')][0x3]===_0xeecb('0x10')||!process[_0xeecb('0xe')][0x4]||process[_0xeecb('0xe')][0x4]===_0xeecb('0xf')||process[_0xeecb('0xe')][0x4]==='null'){throw new Error(_0xeecb('0x12'));}var FIELDS=_[_0xeecb('0x13')](process['argv'][0x3][_0xeecb('0x14')](','),process[_0xeecb('0xe')][0x4][_0xeecb('0x14')](','));if(!process[_0xeecb('0xe')][0x5]||process['argv'][0x5]===_0xeecb('0xf')||process[_0xeecb('0xe')][0x5]===_0xeecb('0x10')){throw new Error(_0xeecb('0x15'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xeecb('0xe')][0x6]&&process[_0xeecb('0xe')][0x6]!==_0xeecb('0xf')&&process[_0xeecb('0xe')][0x6]!=='null'?process[_0xeecb('0xe')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xeecb('0xe')][0x7]!=='undefined'&&process[_0xeecb('0xe')][0x7]!=='null'?process[_0xeecb('0xe')][0x7]:null;if(!process[_0xeecb('0xe')][0x8]||process[_0xeecb('0xe')][0x8]==='undefined'||process[_0xeecb('0xe')][0x8]==='null'){throw new Error(_0xeecb('0x16'));}var SOCKET_TIMESTAMP=process[_0xeecb('0xe')][0x8];}catch(_0x2b0462){logger[_0xeecb('0x17')](_0x2b0462);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(_0x229383,_0x264d84,_0x36980c,_0x26bf20){var _0x4a5fda={'message':_0x264d84};_0x4a5fda[_0x229383]=!![];if(_0x36980c){_0x4a5fda['contact']=_0x36980c;}if(_0x26bf20){_0x4a5fda[_0xeecb('0x18')]=_0x26bf20;}return _0x4a5fda;}function isEmail(_0xb2ec4d){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))*$/[_0xeecb('0x19')](_0xb2ec4d);}function checkRow(_0x379d83,_0x57f921,_0x5b4284){return new BPromise(function(_0x433202,_0x165de8){if(_[_0xeecb('0x1a')](_0x379d83)){return _0x165de8(handleCheckRowError(_0xeecb('0x17'),_0xeecb('0x1b'),null,_0x5b4284));}if(_0x379d83[_0xeecb('0x1c')]&&_0x379d83[_0xeecb('0x1c')][_0xeecb('0x1d')]){var _0x4fb057=_[_0xeecb('0x1e')](_0x379d83[_0xeecb('0x1c')],'message')['join'](';');return _0x165de8(handleCheckRowError(_0xeecb('0x17'),_0x4fb057,null,_0x5b4284));}var _0x106cb3={};for(var _0x39fcbf in FIELDS){if(FIELDS[_0xeecb('0x1f')](_0x39fcbf)&&FIELDS[_0x39fcbf]){_0x106cb3[_0x39fcbf]=_0x379d83[_0xeecb('0x20')][0x0][FIELDS[_0x39fcbf]]||_0x379d83[_0xeecb('0x20')][0x0]['\ufeff'+FIELDS[_0x39fcbf]];}}if(!_0x106cb3[_0xeecb('0x21')]){return _0x165de8(handleCheckRowError(_0xeecb('0x17'),_0xeecb('0x22'),null,_0x5b4284));}if(!_0x106cb3[_0xeecb('0x23')]){return _0x165de8(handleCheckRowError('error',_0xeecb('0x24'),null,_0x5b4284));}if(_0x106cb3[_0xeecb('0x25')]){var _0x2c9e4b=moment(_0x106cb3[_0xeecb('0x25')],_0xeecb('0x26'));if(!_0x2c9e4b[_0xeecb('0x27')]()){return _0x165de8(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x5b4284));}}if(_0x106cb3[_0xeecb('0x28')]){if(!isEmail(_0x106cb3[_0xeecb('0x28')])){return _0x165de8(handleCheckRowError(_0xeecb('0x17'),_0xeecb('0x29'),null,_0x5b4284));}}_0x106cb3['ListId']=LISTID;_0x106cb3[_0xeecb('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xeecb('0x1d')]&&_0x57f921){var _0x3e458f={};for(var _0x251113=0x0,_0x4025c2=DUPLICATES[_0xeecb('0x1d')];_0x251113<_0x4025c2;_0x251113+=0x1){_0x3e458f[DUPLICATES[_0x251113]]=_0x106cb3[DUPLICATES[_0x251113]];}var _0x1953e9=_[_0xeecb('0x2b')](_0x57f921,_0x3e458f);if(_0x1953e9){return _0x165de8(handleCheckRowError(_0xeecb('0x2c'),_0xeecb('0x2d'),_0x1953e9,_0x5b4284));}}return db[_0xeecb('0x2e')]['create'](_0x106cb3,{'raw':!![],'hooks':![],'fields':_[_0xeecb('0x2f')](_0x106cb3)})['then'](function(_0x102caf){if(DUPLICATES&&DUPLICATES[_0xeecb('0x1d')]&&_0x57f921){_0x57f921['push'](_['pick'](_0x106cb3,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x102caf['id'];return _0x433202();})['catch'](function(_0x54fcc5){return _0x165de8(handleCheckRowError(_0xeecb('0x17'),_0xeecb('0x30')+(_0x54fcc5[_0xeecb('0x31')]||JSON[_0xeecb('0x32')](_0x54fcc5)),null,_0x5b4284));});});}function checkHopper(){function _0x1ca901(){return function(_0x23b9aa){logger[_0xeecb('0x17')](_0xeecb('0x33'),_0xeecb('0x34'),util['inspect'](_0x23b9aa,{'showHidden':![],'depth':null}));};}var _0x293f30=function(_0x29bd45,_0x14e0d6){var _0x577df1=squel[_0xeecb('0x35')]()['into'](_0xeecb('0x36'))[_0xeecb('0x37')](['phone',_0xeecb('0x38'),_0xeecb('0x39'),_0xeecb('0x3a'),_0x14e0d6,_0xeecb('0x3b'),'updatedAt'],squel[_0xeecb('0x3c')]()[_0xeecb('0x3d')](_0xeecb('0x23'),'phone')[_0xeecb('0x3d')]('NOW()',_0xeecb('0x38'))['field']('id','ContactId')['field'](LISTID[_0xeecb('0x3e')](),_0xeecb('0x3a'))[_0xeecb('0x3d')](_0x29bd45['id'][_0xeecb('0x3e')](),_0x14e0d6)['field']('NOW()','createdAt')[_0xeecb('0x3d')](_0xeecb('0x3f'),_0xeecb('0x40'))[_0xeecb('0x41')](_0xeecb('0x42'))[_0xeecb('0x43')]('deletedAt\x20IS\x20NULL')[_0xeecb('0x43')](_0xeecb('0x44'),LISTID[_0xeecb('0x3e')]())[_0xeecb('0x43')](_0xeecb('0x45'))[_0xeecb('0x43')](_0xeecb('0x46'),squel['select']()[_0xeecb('0x3d')](_0xeecb('0x23'))[_0xeecb('0x41')](_0xeecb('0x36'))['where'](_0x14e0d6+_0xeecb('0x47'),_0x29bd45['id'][_0xeecb('0x3e')]())))[_0xeecb('0x3e')]();return _0x577df1;};var _0x393131=function(_0x300486,_0x106b44){var _0x4220c0=squel[_0xeecb('0x35')]()[_0xeecb('0x48')](_0xeecb('0x36'))[_0xeecb('0x37')]([_0xeecb('0x23'),_0xeecb('0x38'),'ContactId',_0xeecb('0x3a'),_0x106b44,_0xeecb('0x3b'),'updatedAt'],squel['select']()['field'](_0xeecb('0x23'),_0xeecb('0x23'))[_0xeecb('0x3d')](_0xeecb('0x3f'),_0xeecb('0x38'))[_0xeecb('0x3d')]('id',_0xeecb('0x39'))[_0xeecb('0x3d')](LISTID[_0xeecb('0x3e')](),_0xeecb('0x3a'))[_0xeecb('0x3d')](_0x300486['id'][_0xeecb('0x3e')](),_0x106b44)['field'](_0xeecb('0x3f'),_0xeecb('0x3b'))[_0xeecb('0x3d')]('NOW()','updatedAt')['from'](_0xeecb('0x42'))[_0xeecb('0x43')](_0xeecb('0x49'))[_0xeecb('0x43')](_0xeecb('0x44'),LISTID[_0xeecb('0x3e')]())[_0xeecb('0x43')](_0xeecb('0x4a'),squel[_0xeecb('0x4b')](hopperContacts))[_0xeecb('0x43')](_0xeecb('0x45'))[_0xeecb('0x43')](_0xeecb('0x46'),squel['select']()[_0xeecb('0x3d')](_0xeecb('0x4c'))[_0xeecb('0x41')](_0xeecb('0x4d'))[_0xeecb('0x43')](_0x106b44+'\x20=\x20?',_0x300486['id'][_0xeecb('0x3e')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xeecb('0x3c')]()['field'](_0xeecb('0x23'))[_0xeecb('0x41')](_0xeecb('0x36'))['where'](_0x106b44+_0xeecb('0x47'),_0x300486['id'][_0xeecb('0x3e')]())))[_0xeecb('0x3e')]();return _0x4220c0;};function _0x4e4612(_0x1842b7,_0x3ffeb2){var _0x1e795a=squel[_0xeecb('0x35')]()['into']('cm_hopper')['fromQuery']([_0xeecb('0x23'),_0xeecb('0x38'),_0xeecb('0x39'),_0xeecb('0x3a'),_0x3ffeb2,_0xeecb('0x3b'),_0xeecb('0x40')],squel[_0xeecb('0x3c')]()['field'](_0xeecb('0x23'),_0xeecb('0x23'))[_0xeecb('0x3d')]('NOW()',_0xeecb('0x38'))[_0xeecb('0x3d')]('id',_0xeecb('0x39'))['field'](LISTID[_0xeecb('0x3e')](),_0xeecb('0x3a'))['field'](_0x1842b7['id']['toString'](),_0x3ffeb2)[_0xeecb('0x3d')](_0xeecb('0x3f'),_0xeecb('0x3b'))[_0xeecb('0x3d')](_0xeecb('0x3f'),'updatedAt')[_0xeecb('0x41')](_0xeecb('0x42'))['where'](_0xeecb('0x49'))[_0xeecb('0x43')]('ListId\x20=\x20?',LISTID[_0xeecb('0x3e')]())['where']('id\x20IN\x20?',squel[_0xeecb('0x4b')](hopperContacts))[_0xeecb('0x43')](_0xeecb('0x45')))['toString']();return _0x1e795a;}function _0x2de92e(_0x4d6e54,_0x17f8a3){var _0xd77a71=squel['insert']()[_0xeecb('0x48')](_0xeecb('0x4e'))[_0xeecb('0x37')](['phone',_0xeecb('0x39'),'ListId',_0x17f8a3,_0xeecb('0x3b'),_0xeecb('0x40')],squel['select']()[_0xeecb('0x3d')](_0xeecb('0x23'),_0xeecb('0x23'))['field']('id',_0xeecb('0x39'))[_0xeecb('0x3d')](LISTID[_0xeecb('0x3e')](),_0xeecb('0x3a'))['field'](_0x4d6e54['id']['toString'](),_0x17f8a3)[_0xeecb('0x3d')]('NOW()',_0xeecb('0x3b'))[_0xeecb('0x3d')](_0xeecb('0x3f'),_0xeecb('0x40'))[_0xeecb('0x41')](_0xeecb('0x42'))[_0xeecb('0x43')](_0xeecb('0x49'))['where'](_0xeecb('0x44'),LISTID[_0xeecb('0x3e')]())[_0xeecb('0x43')](_0xeecb('0x4a'),squel[_0xeecb('0x4b')](hopperContacts))[_0xeecb('0x43')](_0xeecb('0x45')))[_0xeecb('0x3e')]();return _0xd77a71;}return db[_0xeecb('0x4f')]['findAll']({'where':{'type':_0xeecb('0x50')},'attributes':['id',_0xeecb('0x51')],'include':[{'model':db[_0xeecb('0x52')],'as':_0xeecb('0x53'),'where':{'id':LISTID}}]})[_0xeecb('0x54')](function(_0x390964){var _0x74f9e1=[];if(_0x390964){var _0x65ff41;for(var _0x3ce5c9=0x0,_0x586453;_0x3ce5c9<_0x390964[_0xeecb('0x1d')];_0x3ce5c9+=0x1){_0x586453=_0x390964[_0x3ce5c9][_0xeecb('0x55')]({'plain':!![]});switch(_0x586453[_0xeecb('0x51')]){case _0xeecb('0x56'):_0x74f9e1[_0xeecb('0x57')](db[_0xeecb('0x58')]['query'](_0x393131(_0x586453,_0xeecb('0x59')))[_0xeecb('0x54')](function(){})['catch'](_0x1ca901()));break;case _0xeecb('0x5a'):_0x74f9e1[_0xeecb('0x57')](db['sequelize'][_0xeecb('0x5b')](_0x293f30(_0x586453,_0xeecb('0x59')))[_0xeecb('0x54')](function(){})['catch'](_0x1ca901()));break;default:_0x74f9e1[_0xeecb('0x57')](db[_0xeecb('0x58')][_0xeecb('0x5b')](_0x4e4612(_0x586453,'VoiceQueueId'))[_0xeecb('0x54')](function(){})[_0xeecb('0x5c')](_0x1ca901()));}}}return _0x74f9e1;})[_0xeecb('0x5d')]()[_0xeecb('0x54')](function(){return db[_0xeecb('0x4f')][_0xeecb('0x5e')]({'where':{'type':_0xeecb('0x50')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xeecb('0x5f'),'where':{'id':LISTID}}]})['then'](function(_0x26bf87){var _0x2e78e7=[];if(_0x26bf87){var _0x163309;for(var _0x323966=0x0,_0x481a6e;_0x323966<_0x26bf87[_0xeecb('0x1d')];_0x323966+=0x1){_0x481a6e=_0x26bf87[_0x323966][_0xeecb('0x55')]({'plain':!![]});_0x2e78e7[_0xeecb('0x57')](db[_0xeecb('0x58')][_0xeecb('0x5b')](_0x2de92e(_0x481a6e,_0xeecb('0x59')))['then'](function(){})[_0xeecb('0x5c')](_0x1ca901()));}}return _0x2e78e7;})[_0xeecb('0x5d')]();})[_0xeecb('0x54')](function(){return db[_0xeecb('0x60')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xeecb('0x52')],'as':_0xeecb('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x473746){var _0x1d19fd=[];if(_0x473746){for(var _0x1d3df8=0x0,_0x20bc9d;_0x1d3df8<_0x473746[_0xeecb('0x1d')];_0x1d3df8+=0x1){_0x20bc9d=_0x473746[_0x1d3df8][_0xeecb('0x55')]({'plain':!![]});switch(_0x20bc9d[_0xeecb('0x51')]){case'always':_0x1d19fd[_0xeecb('0x57')](db[_0xeecb('0x58')][_0xeecb('0x5b')](_0x393131(_0x20bc9d,_0xeecb('0x61')))[_0xeecb('0x54')](function(){})[_0xeecb('0x5c')](_0x1ca901()));break;case _0xeecb('0x5a'):_0x1d19fd[_0xeecb('0x57')](db[_0xeecb('0x58')][_0xeecb('0x5b')](_0x293f30(_0x20bc9d,_0xeecb('0x61')))['then'](function(){})[_0xeecb('0x5c')](_0x1ca901()));break;default:_0x1d19fd[_0xeecb('0x57')](db[_0xeecb('0x58')][_0xeecb('0x5b')](_0x4e4612(_0x20bc9d,_0xeecb('0x61')))[_0xeecb('0x54')](function(){})[_0xeecb('0x5c')](_0x1ca901()));}}}return _0x1d19fd;})[_0xeecb('0x5d')]();})['then'](function(){return db[_0xeecb('0x60')][_0xeecb('0x5e')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0xeecb('0x54')](function(_0x351e25){var _0x5a06a5=[];if(_0x351e25){for(var _0x384d51=0x0,_0xf054ff;_0x384d51<_0x351e25['length'];_0x384d51+=0x1){_0xf054ff=_0x351e25[_0x384d51][_0xeecb('0x55')]({'plain':!![]});_0x5a06a5[_0xeecb('0x57')](db['sequelize'][_0xeecb('0x5b')](_0x2de92e(_0xf054ff,_0xeecb('0x61')))[_0xeecb('0x54')](function(){})[_0xeecb('0x5c')](_0x1ca901()));}}return _0x5a06a5;})['all']();})[_0xeecb('0x5c')](function(_0x24b657){logger['error'](_0xeecb('0x62'),_0xeecb('0x63'),_0x24b657[_0xeecb('0x31')]);});}var processPromises=function(_0x5858e4){return BPromise[_0xeecb('0x5d')](promises)['then'](function(_0x4e058a){})[_0xeecb('0x5c')](function(_0x1174c8){logger['error'](_0xeecb('0x64'),JSON['stringify'](_0x1174c8));})[_0xeecb('0x65')](function(){socket[_0xeecb('0x66')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5858e4){return _0x5858e4[_0xeecb('0x67')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xeecb('0x54')](function(){socket[_0xeecb('0x66')](_0xeecb('0x68')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xeecb('0x69')](FILEPATH);}catch(_0x4d1d60){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xeecb('0x32')](_0x4d1d60));}finally{process[_0xeecb('0x6a')](0x0);}});};process['on']('SIGINT',function(){logger[_0xeecb('0x6b')](_0xeecb('0x6c'));endCsv();});function main(){return BPromise[_0xeecb('0x6d')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xeecb('0x14')](',');return db[_0xeecb('0x2e')][_0xeecb('0x5e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xeecb('0x54')](function(_0x3df894){var _0x115322=fs[_0xeecb('0x6e')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xeecb('0x6f')](_0x115322,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3b0464,_0x53ffc8){total+=0x1;var _0x29f8f8=total;promises[_0xeecb('0x57')](checkRow(_0x3b0464,_0x3df894,_0x29f8f8)[_0xeecb('0x54')](function(){success+=0x1;})['catch'](function(_0x3afcbc){if(_0x3afcbc['error']){errors+=0x1;delete _0x3afcbc[_0xeecb('0x17')];}else if(_0x3afcbc[_0xeecb('0x2c')]){duplicates+=0x1;delete _0x3afcbc[_0xeecb('0x2c')];}rows[_0xeecb('0x57')](_0x3afcbc);}));if(total%0xc8===0x0){_0x53ffc8[_0xeecb('0x70')]();return processPromises(_0x53ffc8);}},'complete':function(){return processPromises()[_0xeecb('0x54')](function(){logger[_0xeecb('0x6b')](_0xeecb('0x71'));endCsv();});},'error':function(_0x12d45f,_0x1149b1){logger[_0xeecb('0x6b')](_0xeecb('0x72'),JSON[_0xeecb('0x32')](_0x12d45f));endCsv();}});})['catch'](function(_0x2a480e){logger[_0xeecb('0x17')](_0xeecb('0x73'),JSON[_0xeecb('0x32')](_0x2a480e));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index c67278d..717c4c5 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 _0x6998=['phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','util','bluebird','squel','../../../mysqldb','../../../config/environment','import','defaults','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','join','.id\x20=\x20','where','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','fields','from','.CmListId\x20=\x20?','cm_hopper_black','\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','push','message','query','spread','catch','main','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','errors','trim','replace','isValid','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','each','then','finish','affectedRows','emit','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x6998,0x10d));var _0x8699=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0x6998[_0x36bf88];return _0x332914;};'use strict';var fs=require('fs');var path=require(_0x8699('0x0'));var _=require(_0x8699('0x1'));var Papa=require('papaparse');var util=require(_0x8699('0x2'));var BPromise=require(_0x8699('0x3'));var moment=require('moment');var squel=require(_0x8699('0x4'));var Redis=require('ioredis');var db=require(_0x8699('0x5'))['db'];var config=require(_0x8699('0x6'));var logger=require('../../../config/logger')(_0x8699('0x7'));config['redis']=_[_0x8699('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8699('0x9'))(new Redis(config[_0x8699('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x8699('0xb')](_0x8699('0xc'));function isEmail(_0x49fdab){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))*$/[_0x8699('0xd')](_0x49fdab);}function selectNotIn(_0x4b99a4,_0x2efe61,_0x181479,_0xbe1bed,_0x171c36){return squel[_0x8699('0xe')]()[_0x8699('0xf')](_0x8699('0x10'))['from'](_0xbe1bed)[_0x8699('0x11')](_0x2efe61,null,_0x2efe61+_0x8699('0x12')+_0xbe1bed+'.'+_0x181479)['where'](_0xbe1bed+'.'+_0x181479+'\x20=\x20'+_0x4b99a4+'.'+_0x181479)[_0x8699('0x13')](_0x2efe61+'.dialCheckDuplicateType\x20IN\x20('+_0x171c36[_0x8699('0x11')]()+')');}function insertCmHopper(_0xc825b3,_0x344ac9,_0x247e24,_0x1978a5,_0x1f7a3d){var _0x3721ee=[_0x8699('0x14'),_0x8699('0x15'),'cm_contacts.id','cm_contacts.ListId',_0x344ac9+'.'+_0x1978a5,_0x8699('0x16'),'cm_contacts.updatedAt',_0x8699('0x17'),_0x8699('0x18'),'\x22'+_0x1f7a3d+'\x22'];return squel[_0x8699('0x19')]()[_0x8699('0x1a')](_0x8699('0x1b'))[_0x8699('0x1c')](['phone',_0x8699('0x1d'),_0x8699('0x1e'),_0x8699('0x1f'),_0x1978a5,_0x8699('0x20'),_0x8699('0x21'),_0x8699('0x22'),_0x8699('0x23'),_0x8699('0x24')],squel[_0x8699('0xe')]()['fields'](_0x3721ee)['from'](_0x344ac9)[_0x8699('0x11')](_0x8699('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0x344ac9+_0x8699('0x26'))['join'](_0x247e24,null,_0x247e24+_0x8699('0x12')+_0x344ac9+'.'+_0x1978a5)[_0x8699('0x13')](_0x344ac9+'.CmListId\x20=\x20?',_0xc825b3)[_0x8699('0x13')](_0x8699('0x27'),NOW)['where'](_0x8699('0x28'),selectNotIn(_0x344ac9,_0x247e24,_0x1978a5,_0x8699('0x1b'),[_0x8699('0x29'),'\x22onlyIfOpen\x22']))[_0x8699('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x344ac9,_0x247e24,_0x1978a5,_0x8699('0x1b'),[_0x8699('0x29')])))[_0x8699('0x2a')]();}function insertCmHopperBlack(_0x35cc99,_0x3add29,_0x3d589e,_0x289bf6){var _0x3b7438=['cm_contacts.phone',_0x8699('0x2b'),_0x8699('0x2c'),_0x3add29+'.'+_0x289bf6,_0x8699('0x16'),_0x8699('0x2d')];return squel[_0x8699('0x19')]()[_0x8699('0x1a')]('cm_hopper_black')['fromQuery']([_0x8699('0x10'),'ContactId',_0x8699('0x1f'),_0x289bf6,_0x8699('0x20'),_0x8699('0x21')],squel[_0x8699('0xe')]()[_0x8699('0x2e')](_0x3b7438)[_0x8699('0x2f')](_0x3add29)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x3add29+_0x8699('0x26'))[_0x8699('0x11')](_0x3d589e,null,_0x3d589e+_0x8699('0x12')+_0x3add29+'.'+_0x289bf6)['where'](_0x3add29+_0x8699('0x30'),_0x35cc99)[_0x8699('0x13')](_0x8699('0x27'),NOW)[_0x8699('0x13')](_0x8699('0x28'),squel[_0x8699('0xe')]()[_0x8699('0xf')](_0x8699('0x10'))[_0x8699('0x2f')](_0x8699('0x31'))[_0x8699('0x13')]('ListId\x20=\x20?',_0x35cc99)['where'](_0x289bf6+_0x8699('0x32'),_0x3add29+'.'+_0x289bf6)))[_0x8699('0x2a')]();}function insertCmContact(_0x192971,_0x31baea,_0xde3af7,_0x323c36){var _0x2f47eb=_[_0x8699('0x33')](_[_0x8699('0x34')](_0x323c36),[_0x8699('0x1f'),'CompanyId',_0x8699('0x20'),_0x8699('0x21')]);return squel[_0x8699('0x19')]()[_0x8699('0x1a')](_0x8699('0x25'))[_0x8699('0x1c')](_0x2f47eb,squel[_0x8699('0xe')]()['fields'](_0x2f47eb)[_0x8699('0x2f')](_0x31baea)[_0x8699('0x13')]('('+_0xde3af7[_0x8699('0x11')](',')+_0x8699('0x35'),squel[_0x8699('0xe')]()[_0x8699('0x2e')](_0xde3af7)[_0x8699('0x2f')](_0x8699('0x25'))[_0x8699('0x13')]('ListId\x20=\x20?',_0x192971))[_0x8699('0x13')](_0x8699('0x36'),squel[_0x8699('0xe')]()[_0x8699('0xf')](_0x8699('0x37'),_0x8699('0x38'))[_0x8699('0x2f')](_0x31baea)[_0x8699('0x39')](_0xde3af7['join'](','))))[_0x8699('0x2a')]();}function handleStop(){logger[_0x8699('0x3a')](_0x8699('0x3b'));stopped=!![];}function handleUncaughtException(_0x4f5432){logger[_0x8699('0x3c')](_0x4f5432['message']);process[_0x8699('0x3d')](0x1);}function handleError(_0x506512,_0x536d1d){stats['errors'][_0x8699('0x3e')]({'name':_0x536d1d['code'],'message':_0x536d1d[_0x8699('0x3f')],'row':_0x506512});}function handleQuery(_0x44a1e6){logger['info'](_0x44a1e6);return db['sequelize'][_0x8699('0x40')](_0x44a1e6)[_0x8699('0x41')](function(_0x1014ef){results[_0x8699('0x3e')](_0x1014ef);})[_0x8699('0x42')](function(_0x57e92e){logger[_0x8699('0x3c')](_0x57e92e[_0x8699('0x3f')]);});}function main(_0x89ad22,_0x245558,_0x273933,_0x4759c5){logger[_0x8699('0x3a')](_0x8699('0x43'),_0x89ad22,JSON['stringify'](_0x245558));process[_0x8699('0x44')](_0x8699('0x45'));var _0x32d636=_0x245558[_0x8699('0x46')];var _0x2dfb36=_0x245558[_0x8699('0x47')];var _0x134dfc=path[_0x8699('0x11')](config[_0x8699('0x48')],_0x8699('0x49'),_0x2dfb36+_0x8699('0x4a'));var _0x563c77=_[_0x8699('0x34')](_0x32d636)[_0x8699('0x11')]();logger['info'](_0x8699('0x4b'),_0x563c77);fs[_0x8699('0x4c')](_0x134dfc,_0x563c77+'\x0a');Papa[_0x8699('0x4d')](fs[_0x8699('0x4e')](_0x89ad22),{'header':!![],'skipEmptyLines':!![],'step':function(_0xe2ae94,_0x32cbfc){try{for(var _0x5dc616=0x0,_0x43a16d=[];_0x5dc616<_0xe2ae94[_0x8699('0x4f')][_0x8699('0x50')];_0x5dc616++){stats[_0x8699('0x51')]+=0x1;if(_0xe2ae94[_0x8699('0x52')][_0x5dc616]){handleError(_0xe2ae94[_0x8699('0x4f')][_0x5dc616],_0xe2ae94['errors'][_0x5dc616]);}else{var _0x27ebbe=[];for(var _0xf4f367 in _0x32d636){if(_0x32d636['hasOwnProperty'](_0xf4f367)){if(_0xe2ae94[_0x8699('0x4f')][_0x5dc616][_0x32d636[_0xf4f367]]){var _0x4ec450=_[_0x8699('0x53')](_0xe2ae94[_0x8699('0x4f')][_0x5dc616][_0x32d636[_0xf4f367]][_0x8699('0x54')](/"/g,'\x27'));switch(_0xf4f367){case'scheduledat':var _0x3311cd=moment(_0x4ec450,_0x8699('0xc'),!![]);if(_0x3311cd[_0x8699('0x55')]()){_0x43a16d[_0x8699('0x3e')]('\x22'+_0x4ec450+'\x22');}else{_0x27ebbe[_0x8699('0x3e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x8699('0x22'):var _0x2c97c2=parseInt(_0x4ec450);_0x4ec450=_[_0x8699('0x56')](_0x2c97c2)||_0x2c97c2<0x0||_0x2c97c2>0x4?_0x4759c5?0x3:0x2:_0x2c97c2;_0x43a16d['push']('\x22'+_0x4ec450+'\x22');break;case _0x8699('0x23'):var _0xd1142d=parseInt(_0x4ec450);if(_[_0x8699('0x57')](_0xd1142d)&&_[_0x8699('0x58')](_0x273933,_0xd1142d)){_0x43a16d[_0x8699('0x3e')]('\x22'+_0xd1142d+'\x22');}else{_0x27ebbe['push'](_0x8699('0x59'));}break;case _0x8699('0x5a'):if(isEmail(_0x4ec450)){_0x43a16d[_0x8699('0x3e')]('\x22'+_0x4ec450+'\x22');}else{_0x27ebbe['push'](_0x8699('0x5b'));}break;case'dateOfBirth':var _0x370b5f=moment(_0x4ec450,'YYYY-MM-DD',!![]);if(_0x370b5f[_0x8699('0x55')]()){_0x43a16d[_0x8699('0x3e')]('\x22'+_0x4ec450+'\x22');}else{_0x27ebbe[_0x8699('0x3e')](_0x8699('0x5c'));}break;default:_0x43a16d[_0x8699('0x3e')]('\x22'+_0x4ec450+'\x22');}}else{switch(_0xf4f367){case'firstName':case _0x8699('0x10'):_0x27ebbe[_0x8699('0x3e')](_0xf4f367+'\x20not\x20specified');break;default:_0x43a16d[_0x8699('0x3e')]('\x22\x22');}}}}if(_0x27ebbe['length']){handleError(_0xe2ae94[_0x8699('0x4f')][_0x5dc616],{'code':_0x8699('0x5d'),'message':_0x27ebbe['join']()});}else{fs[_0x8699('0x5e')](_0x134dfc,_0x43a16d['join']()+'\x0a');}_0x43a16d=[];}if(!(stats[_0x8699('0x51')]%0xc8)){socket['emit'](_0x8699('0x5f')+_0x2dfb36,stats);stats[_0x8699('0x52')]=[];}}if(stopped){logger[_0x8699('0x3a')](_0x8699('0x60'));_0x32cbfc[_0x8699('0x61')]();}}catch(_0x521870){handleError(_0xe2ae94[_0x8699('0x4f')][_0x5dc616],{'code':_0x8699('0x62'),'message':_0x521870[_0x8699('0x3f')]});logger[_0x8699('0x3c')](_0x8699('0x63'),_0x521870[_0x8699('0x3f')]);}},'complete':function(){try{var _0xc2fd62=[];var _0x1bdb4f=_0x8699('0x25');if(_0x245558[_0x8699('0x64')]&&_0x245558[_0x8699('0x64')][_0x8699('0x50')]){_0x1bdb4f=_0x8699('0x65')+_0x2dfb36;_0xc2fd62['push']('CREATE\x20TABLE\x20'+_0x1bdb4f+'\x20LIKE\x20cm_contacts;');}var _0x1ea0ed=util[_0x8699('0xb')](_0x8699('0x66'),_0x134dfc,_0x1bdb4f,_0x563c77,_0x245558[_0x8699('0x1f')],_0x245558[_0x8699('0x67')]||null,NOW,NOW);if(_[_0x8699('0x68')](_0x32d636[_0x8699('0x1d')])){_0x1ea0ed+=_0x8699('0x69');}_0xc2fd62['push'](_0x1ea0ed);if(_0x245558['duplicates']&&_0x245558[_0x8699('0x64')]['length']){_0xc2fd62['push'](insertCmContact(_0x245558[_0x8699('0x1f')],_0x1bdb4f,_0x245558[_0x8699('0x64')],_0x32d636));_0xc2fd62[_0x8699('0x3e')](_0x8699('0x6a')+_0x1bdb4f+';');}_0xc2fd62['push'](insertCmHopper(_0x245558[_0x8699('0x1f')],_0x8699('0x6b'),'voice_queues',_0x8699('0x6c'),_0x4759c5));_0xc2fd62['push'](insertCmHopperBlack(_0x245558[_0x8699('0x1f')],_0x8699('0x6d'),_0x8699('0x6e'),_0x8699('0x6c')));_0xc2fd62['push'](insertCmHopper(_0x245558[_0x8699('0x1f')],_0x8699('0x6f'),_0x8699('0x70'),_0x8699('0x71'),_0x4759c5));_0xc2fd62[_0x8699('0x3e')](insertCmHopperBlack(_0x245558[_0x8699('0x1f')],'campaigns_has_cm_blacklists',_0x8699('0x70'),_0x8699('0x71')));BPromise[_0x8699('0x72')](_0xc2fd62,handleQuery)[_0x8699('0x73')](function(_0x30514c){stats[_0x8699('0x74')]=!![];stats[_0x8699('0x75')]=_0x245558[_0x8699('0x64')]&&_0x245558[_0x8699('0x64')][_0x8699('0x50')]?results[0x2][_0x8699('0x75')]:results[0x0][_0x8699('0x75')];socket[_0x8699('0x76')](_0x8699('0x5f')+_0x2dfb36,stats);fs['unlink'](_0x89ad22);fs['unlink'](_0x134dfc);process[_0x8699('0x3d')](0x0);})[_0x8699('0x42')](function(_0x159abd){logger[_0x8699('0x3c')](_0x159abd['message']);process[_0x8699('0x3d')](0x1);});}catch(_0x5c5a0f){logger[_0x8699('0x3c')]('complete',_0x5c5a0f[_0x8699('0x3f')]);process[_0x8699('0x3d')](0x1);}},'error':function(_0x3f2cbd,_0x33e8f5,_0x59ef6d,_0xe44d0d){throw new Error(_0xe44d0d);}});}function validate(){if(process[_0x8699('0x77')]&&process[_0x8699('0x77')][_0x8699('0x50')]<0x4){throw new Error(_0x8699('0x78'));}var _0x9c20f5=path[_0x8699('0x11')](config[_0x8699('0x48')],_0x8699('0x49'),process['argv'][0x2]);if(!fs[_0x8699('0x79')](_0x9c20f5)){throw new Error(_0x8699('0x7a'));}var _0x33d557={};try{_0x33d557=JSON[_0x8699('0x4d')](process[_0x8699('0x77')][0x3]);if(!_0x33d557['binding']){throw new Error(_0x8699('0x7b'));}if(!_0x33d557[_0x8699('0x46')][_0x8699('0x10')]){throw new Error(_0x8699('0x7c'));}if(!_0x33d557[_0x8699('0x46')][_0x8699('0x7d')]){throw new Error(_0x8699('0x7e'));}var _0x46db96=0x0;if(_0x33d557[_0x8699('0x46')]['UserId']){_0x46db96=0x1;}if(!_0x33d557[_0x8699('0x1f')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x572828){throw new Error(_0x8699('0x7f'));}var _0x389d8c=[];try{_0x389d8c=_[_0x8699('0x80')](JSON[_0x8699('0x4d')](process[_0x8699('0x77')][0x4]),'id');}catch(_0x421b56){logger['info'](_0x8699('0x81'));}main(_0x9c20f5,_0x33d557,_0x389d8c,_0x46db96);}validate();process['on'](_0x8699('0x82'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xe155=['then','affectedRows','contact:import:','unlink','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','field','from','join','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','toString','into','cm_hopper_black','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','stringify','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','SystemRow','appendFileSync','emit','Abort\x20parser','abort','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','campaigns','CampaignId','each'];(function(_0x1de7f8,_0x14250a){var _0x5cce8e=function(_0x3292eb){while(--_0x3292eb){_0x1de7f8['push'](_0x1de7f8['shift']());}};_0x5cce8e(++_0x14250a);}(_0xe155,0x8e));var _0x5e15=function(_0x558fea,_0x5f4475){_0x558fea=_0x558fea-0x0;var _0x126648=_0xe155[_0x558fea];return _0x126648;};'use strict';var fs=require('fs');var path=require(_0x5e15('0x0'));var _=require('lodash');var Papa=require(_0x5e15('0x1'));var util=require(_0x5e15('0x2'));var BPromise=require(_0x5e15('0x3'));var moment=require(_0x5e15('0x4'));var squel=require('squel');var Redis=require(_0x5e15('0x5'));var db=require(_0x5e15('0x6'))['db'];var config=require(_0x5e15('0x7'));var logger=require('../../../config/logger')(_0x5e15('0x8'));config[_0x5e15('0x9')]=_[_0x5e15('0xa')](config[_0x5e15('0x9')],{'host':_0x5e15('0xb'),'port':0x18eb});var socket=require(_0x5e15('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x5e15('0xd'));function isEmail(_0x44212c){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'](_0x44212c);}function selectNotIn(_0x5047c1,_0xfc0a07,_0x345242,_0x355567,_0x60d60e){return squel['select']()[_0x5e15('0xe')]('phone')[_0x5e15('0xf')](_0x355567)[_0x5e15('0x10')](_0xfc0a07,null,_0xfc0a07+'.id\x20=\x20'+_0x355567+'.'+_0x345242)['where'](_0x355567+'.'+_0x345242+'\x20=\x20'+_0x5047c1+'.'+_0x345242)[_0x5e15('0x11')](_0xfc0a07+_0x5e15('0x12')+_0x60d60e[_0x5e15('0x10')]()+')');}function insertCmHopper(_0x5306a9,_0x1c9850,_0x4c24d5,_0x3f6179,_0x5819a8){var _0x59c6b3=[_0x5e15('0x13'),_0x5e15('0x14'),'cm_contacts.id',_0x5e15('0x15'),_0x1c9850+'.'+_0x3f6179,_0x5e15('0x16'),_0x5e15('0x17'),_0x5e15('0x18'),_0x5e15('0x19'),'\x22'+_0x5819a8+'\x22'];return squel[_0x5e15('0x1a')]()['into']('cm_hopper')[_0x5e15('0x1b')]([_0x5e15('0x1c'),_0x5e15('0x1d'),_0x5e15('0x1e'),_0x5e15('0x1f'),_0x3f6179,_0x5e15('0x20'),_0x5e15('0x21'),_0x5e15('0x22'),_0x5e15('0x23'),_0x5e15('0x24')],squel[_0x5e15('0x25')]()[_0x5e15('0x26')](_0x59c6b3)[_0x5e15('0xf')](_0x1c9850)[_0x5e15('0x10')](_0x5e15('0x27'),null,_0x5e15('0x28')+_0x1c9850+'.CmListId')['join'](_0x4c24d5,null,_0x4c24d5+_0x5e15('0x29')+_0x1c9850+'.'+_0x3f6179)[_0x5e15('0x11')](_0x1c9850+_0x5e15('0x2a'),_0x5306a9)[_0x5e15('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5e15('0x11')](_0x5e15('0x2b'),selectNotIn(_0x1c9850,_0x4c24d5,_0x3f6179,_0x5e15('0x2c'),[_0x5e15('0x2d'),'\x22onlyIfOpen\x22']))[_0x5e15('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1c9850,_0x4c24d5,_0x3f6179,_0x5e15('0x2c'),[_0x5e15('0x2d')])))[_0x5e15('0x2e')]();}function insertCmHopperBlack(_0x1ad4e9,_0x1c11b8,_0x2cb21f,_0x52ce56){var _0x45c008=['cm_contacts.phone','cm_contacts.id',_0x5e15('0x15'),_0x1c11b8+'.'+_0x52ce56,_0x5e15('0x16'),_0x5e15('0x17')];return squel[_0x5e15('0x1a')]()[_0x5e15('0x2f')](_0x5e15('0x30'))[_0x5e15('0x1b')](['phone',_0x5e15('0x1e'),_0x5e15('0x1f'),_0x52ce56,_0x5e15('0x20'),_0x5e15('0x21')],squel[_0x5e15('0x25')]()[_0x5e15('0x26')](_0x45c008)[_0x5e15('0xf')](_0x1c11b8)['join'](_0x5e15('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x1c11b8+'.CmListId')['join'](_0x2cb21f,null,_0x2cb21f+_0x5e15('0x29')+_0x1c11b8+'.'+_0x52ce56)['where'](_0x1c11b8+_0x5e15('0x2a'),_0x1ad4e9)['where'](_0x5e15('0x31'),NOW)['where'](_0x5e15('0x2b'),squel[_0x5e15('0x25')]()[_0x5e15('0xe')]('phone')[_0x5e15('0xf')](_0x5e15('0x30'))['where'](_0x5e15('0x32'),_0x1ad4e9)[_0x5e15('0x11')](_0x52ce56+'\x20=\x20?',_0x1c11b8+'.'+_0x52ce56)))[_0x5e15('0x2e')]();}function insertCmContact(_0x3cb026,_0x320cca,_0x46c131,_0x40e755){var _0x12b2a5=_[_0x5e15('0x33')](_[_0x5e15('0x34')](_0x40e755),[_0x5e15('0x1f'),_0x5e15('0x35'),_0x5e15('0x20'),_0x5e15('0x21')]);return squel[_0x5e15('0x1a')]()[_0x5e15('0x2f')]('cm_contacts')[_0x5e15('0x1b')](_0x12b2a5,squel['select']()[_0x5e15('0x26')](_0x12b2a5)[_0x5e15('0xf')](_0x320cca)[_0x5e15('0x11')]('('+_0x46c131[_0x5e15('0x10')](',')+_0x5e15('0x36'),squel[_0x5e15('0x25')]()[_0x5e15('0x26')](_0x46c131)[_0x5e15('0xf')](_0x5e15('0x27'))[_0x5e15('0x11')](_0x5e15('0x32'),_0x3cb026))['where'](_0x5e15('0x37'),squel[_0x5e15('0x25')]()[_0x5e15('0xe')](_0x5e15('0x38'),_0x5e15('0x39'))[_0x5e15('0xf')](_0x320cca)['group'](_0x46c131[_0x5e15('0x10')](','))))[_0x5e15('0x2e')]();}function handleStop(){logger[_0x5e15('0x3a')](_0x5e15('0x3b'));stopped=!![];}function handleUncaughtException(_0x48fee0){logger[_0x5e15('0x3c')](_0x48fee0[_0x5e15('0x3d')]);process[_0x5e15('0x3e')](0x1);}function handleError(_0x1dabb6,_0x315e73){stats[_0x5e15('0x3f')][_0x5e15('0x40')]({'name':_0x315e73[_0x5e15('0x41')],'message':_0x315e73[_0x5e15('0x3d')],'row':_0x1dabb6});}function handleQuery(_0xe6a0a8){logger['info'](_0xe6a0a8);return db[_0x5e15('0x42')][_0x5e15('0x43')](_0xe6a0a8)[_0x5e15('0x44')](function(_0x34e796){results[_0x5e15('0x40')](_0x34e796);})[_0x5e15('0x45')](function(_0x46d5a0){logger[_0x5e15('0x3c')](_0x46d5a0['message']);});}function main(_0x7d8f4b,_0x217a28,_0x598e6b,_0x59f453){logger[_0x5e15('0x3a')]('main',_0x7d8f4b,JSON[_0x5e15('0x46')](_0x217a28));process['send'](_0x5e15('0x47'));var _0x4f94c6=_0x217a28[_0x5e15('0x48')];var _0x3fbdf1=_0x217a28[_0x5e15('0x49')];var _0x511e6a=path['join'](config[_0x5e15('0x4a')],_0x5e15('0x4b'),_0x3fbdf1+_0x5e15('0x4c'));var _0x1b9a7f=_[_0x5e15('0x34')](_0x4f94c6)['join']();logger[_0x5e15('0x3a')](_0x5e15('0x4d'),_0x1b9a7f);fs[_0x5e15('0x4e')](_0x511e6a,_0x1b9a7f+'\x0a');Papa[_0x5e15('0x4f')](fs[_0x5e15('0x50')](_0x7d8f4b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x190298,_0xea1b0d){try{for(var _0x1fd332=0x0,_0x29c9fb=[];_0x1fd332<_0x190298[_0x5e15('0x51')][_0x5e15('0x52')];_0x1fd332++){stats[_0x5e15('0x53')]+=0x1;if(_0x190298[_0x5e15('0x3f')][_0x1fd332]){handleError(_0x190298[_0x5e15('0x51')][_0x1fd332],_0x190298['errors'][_0x1fd332]);}else{var _0x41b8eb=[];for(var _0x5f15c5 in _0x4f94c6){if(_0x4f94c6[_0x5e15('0x54')](_0x5f15c5)){if(_0x190298[_0x5e15('0x51')][_0x1fd332][_0x4f94c6[_0x5f15c5]]){var _0xaa15c1=_['trim'](_0x190298['data'][_0x1fd332][_0x4f94c6[_0x5f15c5]][_0x5e15('0x55')](/"/g,'\x27'));switch(_0x5f15c5){case _0x5e15('0x1d'):var _0xb1b55c=moment(_0xaa15c1,_0x5e15('0xd'),!![]);if(_0xb1b55c[_0x5e15('0x56')]()){_0x29c9fb[_0x5e15('0x40')]('\x22'+_0xaa15c1+'\x22');}else{_0x41b8eb[_0x5e15('0x40')](_0x5e15('0x57'));}break;case _0x5e15('0x22'):var _0x3ce88f=parseInt(_0xaa15c1);_0xaa15c1=_['isNaN'](_0x3ce88f)||_0x3ce88f<0x0||_0x3ce88f>0x4?_0x59f453?0x3:0x2:_0x3ce88f;_0x29c9fb['push']('\x22'+_0xaa15c1+'\x22');break;case _0x5e15('0x23'):var _0x4264a0=parseInt(_0xaa15c1);if(_['isNumber'](_0x4264a0)&&_[_0x5e15('0x58')](_0x598e6b,_0x4264a0)){_0x29c9fb[_0x5e15('0x40')]('\x22'+_0x4264a0+'\x22');}else{_0x41b8eb[_0x5e15('0x40')](_0x5e15('0x59'));}break;case'email':if(isEmail(_0xaa15c1)){_0x29c9fb['push']('\x22'+_0xaa15c1+'\x22');}else{_0x41b8eb[_0x5e15('0x40')](_0x5e15('0x5a'));}break;case _0x5e15('0x5b'):var _0x5a67ce=moment(_0xaa15c1,_0x5e15('0x5c'),!![]);if(_0x5a67ce[_0x5e15('0x56')]()){_0x29c9fb[_0x5e15('0x40')]('\x22'+_0xaa15c1+'\x22');}else{_0x41b8eb[_0x5e15('0x40')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x29c9fb[_0x5e15('0x40')]('\x22'+_0xaa15c1+'\x22');}}else{switch(_0x5f15c5){case _0x5e15('0x5d'):case _0x5e15('0x1c'):_0x41b8eb[_0x5e15('0x40')](_0x5f15c5+'\x20not\x20specified');break;default:_0x29c9fb[_0x5e15('0x40')]('\x22\x22');}}}}if(_0x41b8eb[_0x5e15('0x52')]){handleError(_0x190298[_0x5e15('0x51')][_0x1fd332],{'code':_0x5e15('0x5e'),'message':_0x41b8eb[_0x5e15('0x10')]()});}else{fs[_0x5e15('0x5f')](_0x511e6a,_0x29c9fb[_0x5e15('0x10')]()+'\x0a');}_0x29c9fb=[];}if(!(stats[_0x5e15('0x53')]%0xc8)){socket[_0x5e15('0x60')]('contact:import:'+_0x3fbdf1,stats);stats[_0x5e15('0x3f')]=[];}}if(stopped){logger['info'](_0x5e15('0x61'));_0xea1b0d[_0x5e15('0x62')]();}}catch(_0x5e2140){handleError(_0x190298['data'][_0x1fd332],{'code':'SystemError','message':_0x5e2140[_0x5e15('0x3d')]});logger[_0x5e15('0x3c')](_0x5e15('0x63'),_0x5e2140[_0x5e15('0x3d')]);}},'complete':function(){try{var _0x40d5ca=[];var _0x38d6e8=_0x5e15('0x27');if(_0x217a28[_0x5e15('0x64')]&&_0x217a28['duplicates'][_0x5e15('0x52')]){_0x38d6e8='cm_contacts_'+_0x3fbdf1;_0x40d5ca['push'](_0x5e15('0x65')+_0x38d6e8+_0x5e15('0x66'));}var _0x59fa00=util[_0x5e15('0x67')]('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',_0x511e6a,_0x38d6e8,_0x1b9a7f,_0x217a28[_0x5e15('0x1f')],_0x217a28[_0x5e15('0x35')]||null,NOW,NOW);if(_[_0x5e15('0x68')](_0x4f94c6[_0x5e15('0x1d')])){_0x59fa00+=_0x5e15('0x69');}_0x40d5ca[_0x5e15('0x40')](_0x59fa00);if(_0x217a28[_0x5e15('0x64')]&&_0x217a28[_0x5e15('0x64')][_0x5e15('0x52')]){_0x40d5ca[_0x5e15('0x40')](insertCmContact(_0x217a28['ListId'],_0x38d6e8,_0x217a28['duplicates'],_0x4f94c6));_0x40d5ca['push'](_0x5e15('0x6a')+_0x38d6e8+';');}_0x40d5ca[_0x5e15('0x40')](insertCmHopper(_0x217a28[_0x5e15('0x1f')],'voice_queues_has_cm_lists',_0x5e15('0x6b'),_0x5e15('0x6c'),_0x59f453));_0x40d5ca[_0x5e15('0x40')](insertCmHopperBlack(_0x217a28[_0x5e15('0x1f')],'voice_queues_has_cm_blacklists','voice_queues','VoiceQueueId'));_0x40d5ca[_0x5e15('0x40')](insertCmHopper(_0x217a28[_0x5e15('0x1f')],'campaigns_has_cm_lists',_0x5e15('0x6d'),_0x5e15('0x6e'),_0x59f453));_0x40d5ca[_0x5e15('0x40')](insertCmHopperBlack(_0x217a28[_0x5e15('0x1f')],'campaigns_has_cm_blacklists',_0x5e15('0x6d'),'CampaignId'));BPromise[_0x5e15('0x6f')](_0x40d5ca,handleQuery)[_0x5e15('0x70')](function(_0x460ffe){stats['finish']=!![];stats[_0x5e15('0x71')]=_0x217a28[_0x5e15('0x64')]&&_0x217a28[_0x5e15('0x64')][_0x5e15('0x52')]?results[0x2][_0x5e15('0x71')]:results[0x0][_0x5e15('0x71')];socket[_0x5e15('0x60')](_0x5e15('0x72')+_0x3fbdf1,stats);fs[_0x5e15('0x73')](_0x7d8f4b);fs['unlink'](_0x511e6a);process[_0x5e15('0x3e')](0x0);})[_0x5e15('0x45')](function(_0x3a7d43){logger[_0x5e15('0x3c')](_0x3a7d43[_0x5e15('0x3d')]);process[_0x5e15('0x3e')](0x1);});}catch(_0x28e841){logger['error']('complete',_0x28e841[_0x5e15('0x3d')]);process[_0x5e15('0x3e')](0x1);}},'error':function(_0x43a34a,_0x368ea0,_0x4b57b4,_0x15241f){throw new Error(_0x15241f);}});}function validate(){if(process[_0x5e15('0x74')]&&process[_0x5e15('0x74')]['length']<0x4){throw new Error(_0x5e15('0x75'));}var _0x4b0a21=path[_0x5e15('0x10')](config[_0x5e15('0x4a')],_0x5e15('0x4b'),process[_0x5e15('0x74')][0x2]);if(!fs[_0x5e15('0x76')](_0x4b0a21)){throw new Error(_0x5e15('0x77'));}var _0x3898cb={};try{_0x3898cb=JSON[_0x5e15('0x4f')](process[_0x5e15('0x74')][0x3]);if(!_0x3898cb[_0x5e15('0x48')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x3898cb['binding'][_0x5e15('0x1c')]){throw new Error(_0x5e15('0x78'));}if(!_0x3898cb[_0x5e15('0x48')]['firstName']){throw new Error(_0x5e15('0x79'));}var _0x5653c6=0x0;if(_0x3898cb[_0x5e15('0x48')][_0x5e15('0x23')]){_0x5653c6=0x1;}if(!_0x3898cb[_0x5e15('0x1f')]){throw new Error(_0x5e15('0x7a'));}}catch(_0x1c59da){throw new Error(_0x5e15('0x7b'));}var _0x54d6e6=[];try{_0x54d6e6=_['map'](JSON[_0x5e15('0x4f')](process[_0x5e15('0x74')][0x4]),'id');}catch(_0x1e368f){logger['info'](_0x5e15('0x7c'));}main(_0x4b0a21,_0x3898cb,_0x54d6e6,_0x5653c6);}validate();process['on'](_0x5e15('0x7d'),handleStop);process['on'](_0x5e15('0x7e'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 6bb50ec..5c22982 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x153f=['starttime','Answer\x20Time','answertime','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','push','variable','queue','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Member\x20Name','membername'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x153f,0x15b));var _0xf153=function(_0x9ab1dd,_0x148e4a){_0x9ab1dd=_0x9ab1dd-0x0;var _0x3dd320=_0x153f[_0x9ab1dd];return _0x3dd320;};'use strict';exports[_0xf153('0x0')]=function(_0x3be790,_0xde7eae){var _0x44cea3=[{'type':_0xf153('0x1'),'content':_0xf153('0x2'),'variableName':null}];switch(_0x3be790[_0xf153('0x3')]()){case'voice':switch(_0xde7eae[_0xf153('0x3')]()){case'inbound':_0x44cea3[_0xf153('0x4')]({'type':_0xf153('0x5'),'content':'','variableName':_0xf153('0x6')});_0x44cea3[_0xf153('0x4')]({'type':_0xf153('0x5'),'content':'','variableName':'calleridnum'});break;case _0xf153('0x7'):_0x44cea3[_0xf153('0x4')]({'type':_0xf153('0x1'),'content':_0xf153('0x8'),'variableName':null});_0x44cea3[_0xf153('0x4')]({'type':_0xf153('0x5'),'content':'','variableName':_0xf153('0x9')});break;}}return _0x44cea3;};exports[_0xf153('0xa')]=function(_0x4f84b,_0xeaccb0){var _0x5c8ae9=[];switch(_0x4f84b[_0xf153('0x3')]()){case _0xf153('0xb'):switch(_0xeaccb0[_0xf153('0x3')]()){case'inbound':_0x5c8ae9=[{'type':_0xf153('0x1'),'content':_0xf153('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0xe'),'keyType':_0xf153('0x5'),'variableName':_0xf153('0xf')},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x10'),'keyType':_0xf153('0x5'),'variableName':'calleridname'},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x11'),'keyType':_0xf153('0x5'),'variableName':_0xf153('0x12')},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x13'),'keyType':_0xf153('0x5'),'variableName':_0xf153('0x6')},{'type':'keyValue','content':'','key':_0xf153('0x14'),'keyType':'variable','variableName':_0xf153('0x15')},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x16'),'keyType':_0xf153('0x5'),'variableName':'agentcalledAt'},{'type':_0xf153('0x1'),'content':_0xf153('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x18'),'keyType':_0xf153('0x5'),'variableName':_0xf153('0x19')},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x1a'),'keyType':_0xf153('0x5'),'variableName':_0xf153('0x9')},{'type':_0xf153('0x1'),'content':_0xf153('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xf153('0x1c'),'keyType':_0xf153('0x5'),'variableName':_0xf153('0x1d')},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x1e'),'keyType':_0xf153('0x5'),'variableName':_0xf153('0x1f')},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x20'),'keyType':_0xf153('0x5'),'variableName':_0xf153('0x21')},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x22'),'keyType':_0xf153('0x5'),'variableName':_0xf153('0x23')},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x24'),'keyType':_0xf153('0x5'),'variableName':_0xf153('0x25')}];break;case _0xf153('0x7'):_0x5c8ae9=[{'type':'string','content':_0xf153('0xc'),'variableName':null},{'type':_0xf153('0xd'),'content':'','key':'Called\x20Number','keyType':_0xf153('0x5'),'keyContent':'','variableName':_0xf153('0x9')},{'type':'keyValue','content':'','key':_0xf153('0x26'),'keyType':_0xf153('0x5'),'keyContent':'','variableName':_0xf153('0x27')},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x14'),'keyType':_0xf153('0x5'),'keyContent':'','variableName':_0xf153('0x15')},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x16'),'keyType':_0xf153('0x5'),'keyContent':'','variableName':_0xf153('0x28')},{'type':_0xf153('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xf153('0xd'),'content':'','key':_0xf153('0x29'),'keyType':_0xf153('0x5'),'keyContent':'','variableName':_0xf153('0x2a')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0xf153('0x5'),'keyContent':'','variableName':'endtime'}];break;}}return _0x5c8ae9;}; \ No newline at end of file +var _0x5636=['Hold\x20Time','holdtime','Talk\x20Time','Member\x20Name','membername','UniqueId','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Call\x20To','destexten','Queue','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','Agent\x20Complete','agentcompleteAt'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0x5636,0x102));var _0x6563=function(_0x5c939b,_0x10d0d0){_0x5c939b=_0x5c939b-0x0;var _0x495b9d=_0x5636[_0x5c939b];return _0x495b9d;};'use strict';exports[_0x6563('0x0')]=function(_0x8c30f6,_0x492943){var _0x4ab349=[{'type':'string','content':_0x6563('0x1'),'variableName':null}];switch(_0x8c30f6[_0x6563('0x2')]()){case _0x6563('0x3'):switch(_0x492943['toLowerCase']()){case _0x6563('0x4'):_0x4ab349[_0x6563('0x5')]({'type':_0x6563('0x6'),'content':'','variableName':_0x6563('0x7')});_0x4ab349[_0x6563('0x5')]({'type':_0x6563('0x6'),'content':'','variableName':_0x6563('0x8')});break;case _0x6563('0x9'):_0x4ab349[_0x6563('0x5')]({'type':_0x6563('0xa'),'content':_0x6563('0xb'),'variableName':null});_0x4ab349[_0x6563('0x5')]({'type':_0x6563('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x4ab349;};exports['getDescriptions']=function(_0x2946f3,_0x129fa3){var _0x490a56=[];switch(_0x2946f3['toLowerCase']()){case'voice':switch(_0x129fa3[_0x6563('0x2')]()){case _0x6563('0x4'):_0x490a56=[{'type':_0x6563('0xa'),'content':_0x6563('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x6563('0xd'),'content':'','key':_0x6563('0xe'),'keyType':_0x6563('0x6'),'variableName':_0x6563('0x8')},{'type':_0x6563('0xd'),'content':'','key':'Caller\x20Name','keyType':_0x6563('0x6'),'variableName':'calleridname'},{'type':_0x6563('0xd'),'content':'','key':_0x6563('0xf'),'keyType':_0x6563('0x6'),'variableName':_0x6563('0x10')},{'type':'keyValue','content':'','key':_0x6563('0x11'),'keyType':_0x6563('0x6'),'variableName':_0x6563('0x7')},{'type':_0x6563('0xd'),'content':'','key':'UniqueId','keyType':_0x6563('0x6'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':_0x6563('0x6'),'variableName':'agentcalledAt'},{'type':'string','content':_0x6563('0x12'),'key':null,'keyType':null,'variableName':null},{'type':_0x6563('0xd'),'content':'','key':_0x6563('0x13'),'keyType':_0x6563('0x6'),'variableName':_0x6563('0x14')},{'type':_0x6563('0xd'),'content':'','key':_0x6563('0x15'),'keyType':_0x6563('0x6'),'variableName':_0x6563('0x16')},{'type':'string','content':_0x6563('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x6563('0xd'),'content':'','key':_0x6563('0x18'),'keyType':'variable','variableName':_0x6563('0x19')},{'type':'keyValue','content':'','key':_0x6563('0x1a'),'keyType':_0x6563('0x6'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':_0x6563('0x1b'),'keyType':'variable','variableName':_0x6563('0x1c')},{'type':_0x6563('0xd'),'content':'','key':_0x6563('0x1d'),'keyType':'variable','variableName':_0x6563('0x1e')},{'type':'keyValue','content':'','key':_0x6563('0x1f'),'keyType':_0x6563('0x6'),'variableName':'talktime'}];break;case _0x6563('0x9'):_0x490a56=[{'type':_0x6563('0xa'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x6563('0xd'),'content':'','key':'Called\x20Number','keyType':_0x6563('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':_0x6563('0x20'),'keyType':_0x6563('0x6'),'keyContent':'','variableName':_0x6563('0x21')},{'type':_0x6563('0xd'),'content':'','key':_0x6563('0x22'),'keyType':'variable','keyContent':'','variableName':_0x6563('0x23')},{'type':'keyValue','content':'','key':'Date','keyType':_0x6563('0x6'),'keyContent':'','variableName':_0x6563('0x24')},{'type':_0x6563('0xa'),'content':_0x6563('0x17')},{'type':_0x6563('0xd'),'content':'','key':_0x6563('0x25'),'keyType':_0x6563('0x6'),'keyContent':'','variableName':_0x6563('0x26')},{'type':_0x6563('0xd'),'content':'','key':_0x6563('0x27'),'keyType':'variable','keyContent':'','variableName':_0x6563('0x28')}];break;}}return _0x490a56;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index a2e8d39..cb07bd2 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5998=['../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','InteractionId','upperFirst','unknown','toLowerCase','name','stringify','Interaction','findOne','update','then','info','catch','error','tracked','user','query','clone','body','html','phone','fax','mobile','lodash','../../mysqldb'];(function(_0x590704,_0x292187){var _0x31bae9=function(_0x28ee2c){while(--_0x28ee2c){_0x590704['push'](_0x590704['shift']());}};_0x31bae9(++_0x292187);}(_0x5998,0xac));var _0x8599=function(_0x803958,_0x400876){_0x803958=_0x803958-0x0;var _0x101af3=_0x5998[_0x803958];return _0x101af3;};'use strict';var _=require(_0x8599('0x0'));var db=require(_0x8599('0x1'))['db'];var loggers={'openchannel':require(_0x8599('0x2'))(_0x8599('0x3')),'mail':require(_0x8599('0x2'))(_0x8599('0x4')),'fax':require(_0x8599('0x2'))(_0x8599('0x5')),'sms':require(_0x8599('0x2'))('sms-interactions'),'chat':require(_0x8599('0x2'))(_0x8599('0x6'))};function getInteractionId(_0x795d9c,_0x22f89e,_0x572d42){if(_0x795d9c&&_0x795d9c[_['upperFirst'](_0x572d42)+_0x8599('0x7')]){return _0x795d9c[_[_0x8599('0x8')](_0x572d42)+'InteractionId'];}else if(_0x795d9c&&_0x795d9c['id']){return _0x795d9c['id'];}else if(_0x22f89e&&_0x22f89e['id']){return _0x22f89e['id'];}else{return _0x8599('0x9');}}function log(_0x5d9c96,_0x5eebd7,_0x2d146d,_0x54a315,_0x2b3ced,_0x2a7dc8){loggers[_0x2b3ced[_0x8599('0xa')]()][_0x5d9c96]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2a7dc8['toUpperCase'](),_0x5eebd7?_0x5eebd7['id']:null,_0x5eebd7?_0x5eebd7[_0x8599('0xb')]:null,_0x5eebd7?_0x5eebd7['role']:null,getInteractionId(_0x2d146d,_0x54a315,_0x2b3ced),_0x2d146d?JSON[_0x8599('0xc')](_0x2d146d):'null');}function updateUser(_0x27919e,_0x53f374,_0x3743bb,_0x209fcc,_0x2a5912){db[_[_0x8599('0x8')](_0x209fcc)+_0x8599('0xd')][_0x8599('0xe')]({'where':{'id':getInteractionId(_0x53f374,_0x3743bb,_0x209fcc)}})['then'](function(_0x35d947){if(_0x35d947){return _0x35d947[_0x8599('0xf')]({'UserId':_0x27919e?_0x27919e['id']:null});}})[_0x8599('0x10')](function(_0x19a63e){if(_0x19a63e){log(_0x8599('0x11'),_0x27919e,_0x53f374,_0x3743bb,_0x209fcc,_0x2a5912);}})[_0x8599('0x12')](function(){log(_0x8599('0x13'),_0x27919e,_0x53f374,_0x3743bb,_0x209fcc,_0x2a5912);});}exports[_0x8599('0x14')]=function(_0x15fe58,_0x3bac14){return function(_0x5e1096,_0x544ad4,_0x5e4790){var _0x46bc35=_0x5e1096[_0x8599('0x15')];var _0x45123b={};var _0x40ad99=_0x5e1096[_0x8599('0x16')];if(_0x45123b){_0x45123b=_[_0x8599('0x17')](_0x5e1096[_0x8599('0x18')]);_0x45123b=_['omit'](_0x45123b,['body',_0x8599('0x19'),_0x8599('0x1a'),_0x8599('0x1b'),_0x8599('0x1c')]);}updateUser(_0x46bc35,_0x45123b,_0x40ad99,_0x15fe58,_0x3bac14);_0x5e4790(null);};}; \ No newline at end of file +var _0x8262=['Interaction','findOne','then','update','info','tracked','user','query','clone','body','html','fax','mobile','../../mysqldb','openchannel-interactions','mail-interactions','../../config/logger','fax-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify'];(function(_0x33c663,_0x4416ed){var _0x4c6299=function(_0x4c1937){while(--_0x4c1937){_0x33c663['push'](_0x33c663['shift']());}};_0x4c6299(++_0x4416ed);}(_0x8262,0x1e1));var _0x2826=function(_0x1be05e,_0x2c0a17){_0x1be05e=_0x1be05e-0x0;var _0x28b463=_0x8262[_0x1be05e];return _0x28b463;};'use strict';var _=require('lodash');var db=require(_0x2826('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x2826('0x1')),'mail':require('../../config/logger')(_0x2826('0x2')),'fax':require(_0x2826('0x3'))(_0x2826('0x4')),'sms':require(_0x2826('0x3'))('sms-interactions'),'chat':require(_0x2826('0x3'))('chat-interactions')};function getInteractionId(_0x11abc9,_0x4ac118,_0x15f6ac){if(_0x11abc9&&_0x11abc9[_[_0x2826('0x5')](_0x15f6ac)+_0x2826('0x6')]){return _0x11abc9[_[_0x2826('0x5')](_0x15f6ac)+_0x2826('0x6')];}else if(_0x11abc9&&_0x11abc9['id']){return _0x11abc9['id'];}else if(_0x4ac118&&_0x4ac118['id']){return _0x4ac118['id'];}else{return _0x2826('0x7');}}function log(_0x836a74,_0x46f3ff,_0x268e8e,_0x3e493b,_0x3d8b4a,_0x54c77e){loggers[_0x3d8b4a['toLowerCase']()][_0x836a74](_0x2826('0x8'),_0x54c77e[_0x2826('0x9')](),_0x46f3ff?_0x46f3ff['id']:null,_0x46f3ff?_0x46f3ff[_0x2826('0xa')]:null,_0x46f3ff?_0x46f3ff[_0x2826('0xb')]:null,getInteractionId(_0x268e8e,_0x3e493b,_0x3d8b4a),_0x268e8e?JSON[_0x2826('0xc')](_0x268e8e):'null');}function updateUser(_0x32a187,_0x26d831,_0x4ad146,_0x119683,_0x21c8de){db[_[_0x2826('0x5')](_0x119683)+_0x2826('0xd')][_0x2826('0xe')]({'where':{'id':getInteractionId(_0x26d831,_0x4ad146,_0x119683)}})[_0x2826('0xf')](function(_0x5e9f5d){if(_0x5e9f5d){return _0x5e9f5d[_0x2826('0x10')]({'UserId':_0x32a187?_0x32a187['id']:null});}})[_0x2826('0xf')](function(_0x4bcbf4){if(_0x4bcbf4){log(_0x2826('0x11'),_0x32a187,_0x26d831,_0x4ad146,_0x119683,_0x21c8de);}})['catch'](function(){log('error',_0x32a187,_0x26d831,_0x4ad146,_0x119683,_0x21c8de);});}exports[_0x2826('0x12')]=function(_0x24183b,_0x5063f3){return function(_0x3d77a7,_0x4f36a3,_0xeeda5f){var _0x1e37a8=_0x3d77a7[_0x2826('0x13')];var _0x5b9012={};var _0x3ae357=_0x3d77a7[_0x2826('0x14')];if(_0x5b9012){_0x5b9012=_[_0x2826('0x15')](_0x3d77a7[_0x2826('0x16')]);_0x5b9012=_['omit'](_0x5b9012,[_0x2826('0x16'),_0x2826('0x17'),'phone',_0x2826('0x18'),_0x2826('0x19')]);}updateUser(_0x1e37a8,_0x5b9012,_0x3ae357,_0x24183b,_0x5063f3);_0xeeda5f(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 7973518..ad369bd 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 _0xdf89=['use','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','../../mysqldb','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','parse'];(function(_0x4c5f20,_0x3a2813){var _0x5220af=function(_0x5eff92){while(--_0x5eff92){_0x4c5f20['push'](_0x4c5f20['shift']());}};_0x5220af(++_0x3a2813);}(_0xdf89,0x19c));var _0x9df8=function(_0x646919,_0x198a98){_0x646919=_0x646919-0x0;var _0x26838b=_0xdf89[_0x646919];return _0x26838b;};'use strict';var crypto=require(_0x9df8('0x0'));var util=require(_0x9df8('0x1'));var compose=require('composable-middleware');var db=require(_0x9df8('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x28b04d,_0x1074a8){if(_0x28b04d&&_0x1074a8){if(_0x1074a8['data1']&&_0x1074a8[_0x9df8('0x3')]){var _0x633520=_0x1074a8[_0x9df8('0x4')];var _0x340b37=_0x1074a8['license'];var _0x410e16=_0x633520['split']('-')[0x4];var _0xe6bb35=_0x633520[_0x9df8('0x5')]('-')[0x0];var _0x101681=crypto[_0x9df8('0x6')](_0x9df8('0x7'),util[_0x9df8('0x8')](_0x9df8('0x9'),_0x410e16,_0x633520,_0xe6bb35));var _0x36defa=_0x101681['update'](_0x340b37,_0x9df8('0xa'),_0x9df8('0xb'));_0x36defa+=_0x101681['final'](_0x9df8('0xb'));var _0x431b17=JSON[_0x9df8('0xc')](_0x36defa);return _0x431b17['hasOwnProperty'](_0x28b04d)?_0x431b17[_0x28b04d]:null;}}return null;}function isLimit(_0x4752f5,_0x15d1ef,_0x5c244c,_0x32bb1d){var _0x3d7235=_0x15d1ef;return compose()[_0x9df8('0xd')](function(_0x5a7c88,_0x1a5622,_0x31d0b7){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0x9df8('0xe')](function(_0x12ea8a){var _0x167441=getValueFromLicense(_0x4752f5,_0x12ea8a);return _0x167441?_0x167441:_0x3d7235;})[_0x9df8('0xe')](function(_0x663331){_0x3d7235=_0x663331;return _0x5c244c[_0x9df8('0xf')](_0x32bb1d);})[_0x9df8('0xe')](function(_0x21d3d4){if(_0x21d3d4>=_0x3d7235){return _0x1a5622[_0x9df8('0x10')](0x193)[_0x9df8('0x11')]({'message':util[_0x9df8('0x8')](_0x9df8('0x12'),_0x4752f5)});}_0x31d0b7();})[_0x9df8('0x13')](function(_0x2d7162){_0x31d0b7(_0x2d7162);});});}function isUserLimit(){return isLimit(_0x9df8('0x14'),0x1,db[_0x9df8('0x15')],{'where':{'$or':[{'role':_0x9df8('0x16')},{'role':_0x9df8('0x17')}]}});}exports[_0x9df8('0x18')]=isUserLimit; \ No newline at end of file +var _0xb1dc=['then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne'];(function(_0x826429,_0x44cef8){var _0x4016a0=function(_0x5e9115){while(--_0x5e9115){_0x826429['push'](_0x826429['shift']());}};_0x4016a0(++_0x44cef8);}(_0xb1dc,0xb7));var _0xcb1d=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0xb1dc[_0x4a96ca];return _0x2aed48;};'use strict';var crypto=require(_0xcb1d('0x0'));var util=require(_0xcb1d('0x1'));var compose=require(_0xcb1d('0x2'));var db=require(_0xcb1d('0x3'))['db'];var config=require(_0xcb1d('0x4'));function getValueFromLicense(_0x4239d4,_0xc9b3fe){if(_0x4239d4&&_0xc9b3fe){if(_0xc9b3fe[_0xcb1d('0x5')]&&_0xc9b3fe[_0xcb1d('0x6')]){var _0x37f222=_0xc9b3fe[_0xcb1d('0x5')];var _0x88b451=_0xc9b3fe[_0xcb1d('0x6')];var _0x2dbb99=_0x37f222[_0xcb1d('0x7')]('-')[0x4];var _0x27beaf=_0x37f222[_0xcb1d('0x7')]('-')[0x0];var _0x566431=crypto[_0xcb1d('0x8')](_0xcb1d('0x9'),util[_0xcb1d('0xa')](_0xcb1d('0xb'),_0x2dbb99,_0x37f222,_0x27beaf));var _0x33a3c2=_0x566431[_0xcb1d('0xc')](_0x88b451,'base64',_0xcb1d('0xd'));_0x33a3c2+=_0x566431[_0xcb1d('0xe')](_0xcb1d('0xd'));var _0x5a3312=JSON[_0xcb1d('0xf')](_0x33a3c2);return _0x5a3312[_0xcb1d('0x10')](_0x4239d4)?_0x5a3312[_0x4239d4]:null;}}return null;}function isLimit(_0x56c611,_0x5007c5,_0x3b6611,_0x308216){var _0x513297=_0x5007c5;return compose()[_0xcb1d('0x11')](function(_0x3603c7,_0x132930,_0xc558d){return db[_0xcb1d('0x12')][_0xcb1d('0x13')]({'where':{'id':0x1},'raw':!![]})[_0xcb1d('0x14')](function(_0x350749){var _0x1e0376=getValueFromLicense(_0x56c611,_0x350749);return _0x1e0376?_0x1e0376:_0x513297;})['then'](function(_0x3388cf){_0x513297=_0x3388cf;return _0x3b6611['count'](_0x308216);})[_0xcb1d('0x14')](function(_0x260af8){if(_0x260af8>=_0x513297){return _0x132930[_0xcb1d('0x15')](0x193)[_0xcb1d('0x16')]({'message':util[_0xcb1d('0xa')](_0xcb1d('0x17'),_0x56c611)});}_0xc558d();})[_0xcb1d('0x18')](function(_0x1b4737){_0xc558d(_0x1b4737);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xcb1d('0x19')],{'where':{'$or':[{'role':_0xcb1d('0x1a')},{'role':_0xcb1d('0x1b')}]}});}exports[_0xcb1d('0x1c')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index df35041..cfa98a4 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 _0x6f7b=['filters','isEmpty','limit','offset','map','indexOf','priority','cast','col','substr','DESC','unsigned','ASC','omit','isArray','length','isString','unset','hasOwnProperty','lodash','sequelize','fields','split'];(function(_0x58efa6,_0x2c00bd){var _0x5d643c=function(_0x1d1ef2){while(--_0x1d1ef2){_0x58efa6['push'](_0x58efa6['shift']());}};_0x5d643c(++_0x2c00bd);}(_0x6f7b,0x6f));var _0xb6f7=function(_0x3aa8b9,_0x2588b6){_0x3aa8b9=_0x3aa8b9-0x0;var _0x313506=_0x6f7b[_0x3aa8b9];return _0x313506;};'use strict';var _=require(_0xb6f7('0x0'));var sequelize=require(_0xb6f7('0x1'));var LIMIT_VALUE=0xfa;exports[_0xb6f7('0x2')]=function(_0x367e74){var _0x2e2c3b=null;if(_0x367e74){_0x2e2c3b=_0x367e74[_0xb6f7('0x3')](',');}return _0x2e2c3b;};exports[_0xb6f7('0x4')]=function(_0x1fd5c3){var _0x11b43f={};if(!_[_0xb6f7('0x5')](_0x1fd5c3)){_0x11b43f={};_['forOwn'](_0x1fd5c3,function(_0x203dc7,_0x2fe894){try{_0x11b43f[_0x2fe894]=JSON['parse'](_0x203dc7);}catch(_0x5e6f61){_0x11b43f[_0x2fe894]=_0x203dc7['split'](',');}});}return _0x11b43f;};exports[_0xb6f7('0x6')]=function(_0x3c8568){_0x3c8568=parseInt(_0x3c8568,0xa);if(!_0x3c8568||_0x3c8568<0x0){_0x3c8568=LIMIT_VALUE;}return _0x3c8568;};exports[_0xb6f7('0x7')]=function(_0x4b2afd){_0x4b2afd=parseInt(_0x4b2afd,0xa);if(!_0x4b2afd||_0x4b2afd<0x0){_0x4b2afd=0x0;}return _0x4b2afd;};exports['sort']=function(_0x66b8d8){var _0x119304,_0x162abc=null;if(_0x66b8d8){_0x119304=_0x66b8d8[_0xb6f7('0x3')](',');_0x162abc=_[_0xb6f7('0x8')](_0x119304,function(_0x207617){if(_0x207617[_0xb6f7('0x9')]('-')===0x0){return[_0x207617===_0xb6f7('0xa')?sequelize[_0xb6f7('0xb')](sequelize[_0xb6f7('0xc')]('priority'),'unsigned'):_0x207617[_0xb6f7('0xd')](0x1),_0xb6f7('0xe')];}else{return[_0x207617===_0xb6f7('0xa')?sequelize['cast'](sequelize[_0xb6f7('0xc')](_0xb6f7('0xa')),_0xb6f7('0xf')):_0x207617,_0xb6f7('0x10')];}});}return _0x162abc;};exports[_0xb6f7('0x11')]=function(_0x2878d6,_0x139876){if(_[_0xb6f7('0x5')](_0x2878d6)){return _0x2878d6;}if(_[_0xb6f7('0x12')](_0x2878d6)){for(var _0x10c60f=0x0;_0x10c60f<_0x2878d6[_0xb6f7('0x13')];_0x10c60f+=0x1){_0x2878d6[_0x10c60f]=this[_0xb6f7('0x11')](_0x2878d6[_0x10c60f],_0x139876);}return _0x2878d6;}if(!_['isObject'](_0x2878d6)){return _0x2878d6;}if(_[_0xb6f7('0x14')](_0x139876)){_0x139876=[_0x139876];}if(!_[_0xb6f7('0x12')](_0x139876)){return _0x2878d6;}for(var _0x27be59=0x0;_0x27be59<_0x139876[_0xb6f7('0x13')];_0x27be59+=0x1){_[_0xb6f7('0x15')](_0x2878d6,_0x139876[_0x27be59]);}for(var _0x49feaa in _0x2878d6){if(_0x2878d6[_0xb6f7('0x16')](_0x49feaa)){_0x2878d6[_0x49feaa]=this['omit'](_0x2878d6[_0x49feaa],_0x139876);}}return _0x2878d6;}; \ No newline at end of file +var _0xc650=['sequelize','fields','split','isEmpty','parse','limit','offset','sort','indexOf','priority','cast','unsigned','col','ASC','omit','isArray','isObject','isString','length','hasOwnProperty','lodash'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0xc650,0x1e2));var _0x0c65=function(_0x1eacd7,_0x47b112){_0x1eacd7=_0x1eacd7-0x0;var _0xfbf2a8=_0xc650[_0x1eacd7];return _0xfbf2a8;};'use strict';var _=require(_0x0c65('0x0'));var sequelize=require(_0x0c65('0x1'));var LIMIT_VALUE=0xfa;exports[_0x0c65('0x2')]=function(_0x207ab1){var _0x40c0b5=null;if(_0x207ab1){_0x40c0b5=_0x207ab1[_0x0c65('0x3')](',');}return _0x40c0b5;};exports['filters']=function(_0xecb46e){var _0x5dcde6={};if(!_[_0x0c65('0x4')](_0xecb46e)){_0x5dcde6={};_['forOwn'](_0xecb46e,function(_0xabff93,_0x13c4ec){try{_0x5dcde6[_0x13c4ec]=JSON[_0x0c65('0x5')](_0xabff93);}catch(_0x485c47){_0x5dcde6[_0x13c4ec]=_0xabff93[_0x0c65('0x3')](',');}});}return _0x5dcde6;};exports[_0x0c65('0x6')]=function(_0x34ae03){_0x34ae03=parseInt(_0x34ae03,0xa);if(!_0x34ae03||_0x34ae03<0x0){_0x34ae03=LIMIT_VALUE;}return _0x34ae03;};exports[_0x0c65('0x7')]=function(_0x45554b){_0x45554b=parseInt(_0x45554b,0xa);if(!_0x45554b||_0x45554b<0x0){_0x45554b=0x0;}return _0x45554b;};exports[_0x0c65('0x8')]=function(_0x2448be){var _0x4b4d63,_0x17af2e=null;if(_0x2448be){_0x4b4d63=_0x2448be[_0x0c65('0x3')](',');_0x17af2e=_['map'](_0x4b4d63,function(_0x50ded1){if(_0x50ded1[_0x0c65('0x9')]('-')===0x0){return[_0x50ded1===_0x0c65('0xa')?sequelize[_0x0c65('0xb')](sequelize['col']('priority'),_0x0c65('0xc')):_0x50ded1['substr'](0x1),'DESC'];}else{return[_0x50ded1==='priority'?sequelize[_0x0c65('0xb')](sequelize[_0x0c65('0xd')](_0x0c65('0xa')),_0x0c65('0xc')):_0x50ded1,_0x0c65('0xe')];}});}return _0x17af2e;};exports[_0x0c65('0xf')]=function(_0x45344d,_0x86b3aa){if(_[_0x0c65('0x4')](_0x45344d)){return _0x45344d;}if(_[_0x0c65('0x10')](_0x45344d)){for(var _0x2a2759=0x0;_0x2a2759<_0x45344d['length'];_0x2a2759+=0x1){_0x45344d[_0x2a2759]=this[_0x0c65('0xf')](_0x45344d[_0x2a2759],_0x86b3aa);}return _0x45344d;}if(!_[_0x0c65('0x11')](_0x45344d)){return _0x45344d;}if(_[_0x0c65('0x12')](_0x86b3aa)){_0x86b3aa=[_0x86b3aa];}if(!_[_0x0c65('0x10')](_0x86b3aa)){return _0x45344d;}for(var _0x1d85b7=0x0;_0x1d85b7<_0x86b3aa[_0x0c65('0x13')];_0x1d85b7+=0x1){_['unset'](_0x45344d,_0x86b3aa[_0x1d85b7]);}for(var _0x51a9d0 in _0x45344d){if(_0x45344d[_0x0c65('0x14')](_0x51a9d0)){_0x45344d[_0x51a9d0]=this[_0x0c65('0xf')](_0x45344d[_0x51a9d0],_0x86b3aa);}}return _0x45344d;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 39d7cf8..17528e5 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['use','join','root','favicon.ico','set','appPath','development','test','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x3071('0x0'));var methodOverride=require(_0x3071('0x1'));var cookieParser=require(_0x3071('0x2'));var errorHandler=require(_0x3071('0x3'));var path=require(_0x3071('0x4'));var passport=require('passport');var cors=require(_0x3071('0x5'));var moment=require(_0x3071('0x6'));var config=require(_0x3071('0x7'));var db=require(_0x3071('0x8'))['db'];exports[_0x3071('0x9')]=function(_0x41cf76){var _0x1d3dd6=_0x41cf76[_0x3071('0xa')](_0x3071('0xb'));if(_0x1d3dd6===_0x3071('0xc')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'public',_0x3071('0x10'))));_0x41cf76[_0x3071('0x11')](_0x3071('0x12'),path[_0x3071('0xe')](config[_0x3071('0xf')],'public'));}if(_0x1d3dd6===_0x3071('0x13')||_0x1d3dd6===_0x3071('0x14')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'client','favicon.ico')));_0x41cf76[_0x3071('0x11')]('appPath',path[_0x3071('0xe')](config[_0x3071('0xf')],'client'));_0x41cf76[_0x3071('0xd')](errorHandler());}_0x41cf76['set'](_0x3071('0x15'),function(_0x45c93b,_0x1271d0){if(this[_0x45c93b]instanceof Date){_0x1271d0=this[_0x45c93b][_0x3071('0x16')]()[_0x3071('0x17')]('.')[0x0]+'Z';}return _0x1271d0;});_0x41cf76[_0x3071('0xd')](express[_0x3071('0x18')](_0x41cf76[_0x3071('0xa')](_0x3071('0x12'))));_0x41cf76[_0x3071('0x11')]('views',config[_0x3071('0xf')]+_0x3071('0x19'));_0x41cf76[_0x3071('0x1a')](_0x3071('0x1b'),require(_0x3071('0x1c'))[_0x3071('0x1d')]);_0x41cf76[_0x3071('0x11')](_0x3071('0x1e'),'html');_0x41cf76[_0x3071('0xd')](bodyParser[_0x3071('0x1f')]({'limit':_0x3071('0x20'),'extended':!![]}));_0x41cf76['use'](bodyParser[_0x3071('0x21')]({'limit':'50mb'}));_0x41cf76[_0x3071('0xd')](cors());_0x41cf76[_0x3071('0xd')](methodOverride());_0x41cf76[_0x3071('0xd')](cookieParser());_0x41cf76[_0x3071('0xd')](passport[_0x3071('0x22')]());}; \ No newline at end of file +var _0x70e0=['test','client','set','json\x20replacer','split','static','get','views','/server/views','engine','html','renderFile','view\x20engine','json','50mb','initialize','express','serve-favicon','body-parser','errorhandler','path','passport','cors','./environment','default','env','production','use','join','root','public','favicon.ico','development'];(function(_0x89ac2c,_0x2c9db8){var _0x561dbb=function(_0x1309f3){while(--_0x1309f3){_0x89ac2c['push'](_0x89ac2c['shift']());}};_0x561dbb(++_0x2c9db8);}(_0x70e0,0x17b));var _0x070e=function(_0x44e286,_0x3f0d03){_0x44e286=_0x44e286-0x0;var _0x5af15e=_0x70e0[_0x44e286];return _0x5af15e;};'use strict';var express=require(_0x070e('0x0'));var favicon=require(_0x070e('0x1'));var bodyParser=require(_0x070e('0x2'));var methodOverride=require('method-override');var cookieParser=require('cookie-parser');var errorHandler=require(_0x070e('0x3'));var path=require(_0x070e('0x4'));var passport=require(_0x070e('0x5'));var cors=require(_0x070e('0x6'));var moment=require('moment');var config=require(_0x070e('0x7'));var db=require('../mysqldb')['db'];exports[_0x070e('0x8')]=function(_0x4b041d){var _0x56e420=_0x4b041d['get'](_0x070e('0x9'));if(_0x56e420===_0x070e('0xa')){_0x4b041d[_0x070e('0xb')](favicon(path[_0x070e('0xc')](config[_0x070e('0xd')],_0x070e('0xe'),_0x070e('0xf'))));_0x4b041d['set']('appPath',path[_0x070e('0xc')](config[_0x070e('0xd')],_0x070e('0xe')));}if(_0x56e420===_0x070e('0x10')||_0x56e420===_0x070e('0x11')){_0x4b041d[_0x070e('0xb')](favicon(path[_0x070e('0xc')](config[_0x070e('0xd')],_0x070e('0x12'),_0x070e('0xf'))));_0x4b041d[_0x070e('0x13')]('appPath',path['join'](config[_0x070e('0xd')],'client'));_0x4b041d['use'](errorHandler());}_0x4b041d['set'](_0x070e('0x14'),function(_0x14c3fd,_0x51d14d){if(this[_0x14c3fd]instanceof Date){_0x51d14d=this[_0x14c3fd]['toISOString']()[_0x070e('0x15')]('.')[0x0]+'Z';}return _0x51d14d;});_0x4b041d[_0x070e('0xb')](express[_0x070e('0x16')](_0x4b041d[_0x070e('0x17')]('appPath')));_0x4b041d['set'](_0x070e('0x18'),config[_0x070e('0xd')]+_0x070e('0x19'));_0x4b041d[_0x070e('0x1a')](_0x070e('0x1b'),require('ejs')[_0x070e('0x1c')]);_0x4b041d[_0x070e('0x13')](_0x070e('0x1d'),_0x070e('0x1b'));_0x4b041d[_0x070e('0xb')](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x4b041d['use'](bodyParser[_0x070e('0x1e')]({'limit':_0x070e('0x1f')}));_0x4b041d[_0x070e('0xb')](cors());_0x4b041d['use'](methodOverride());_0x4b041d[_0x070e('0xb')](cookieParser());_0x4b041d['use'](passport[_0x070e('0x20')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 6f8a9e7..dc0cb6b 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 _0x3954=['utf8','replace','hostname','macAddress','substring','lodash','crypto','child_process','networkInterfaces','orderBy','keys','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','update','digest','hex','win32'];(function(_0x3450c0,_0xf186f9){var _0x38b0a9=function(_0x87f6bc){while(--_0x87f6bc){_0x3450c0['push'](_0x3450c0['shift']());}};_0x38b0a9(++_0xf186f9);}(_0x3954,0x16d));var _0x4395=function(_0x4bd103,_0x499f41){_0x4bd103=_0x4bd103-0x0;var _0x56705c=_0x3954[_0x4bd103];return _0x56705c;};'use strict';var _=require(_0x4395('0x0'));var os=require('os');var crypto=require(_0x4395('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x4395('0x2'))['execSync'];function getInterfaces(){var _0x3ded22=[];var _0x44a27e=os[_0x4395('0x3')]();var _0x287ff1=_[_0x4395('0x4')](_[_0x4395('0x5')](_0x44a27e));for(var _0x3ae91f=0x0;_0x3ae91f<_0x287ff1['length'];_0x3ae91f++){var _0x5463d5=_0x44a27e[_0x287ff1[_0x3ae91f]][_0x4395('0x6')](function(_0x312dee){return _0x312dee[_0x4395('0x7')]==='IPv4'&&_0x312dee[_0x4395('0x8')]===![];});_0x3ded22=_0x3ded22[_0x4395('0x9')](_0x5463d5);}return _0x3ded22;}function getFirstInterface(){var _0x368751=_[_0x4395('0xa')](getInterfaces());return{'macAddress':_0x368751&&_0x368751[_0x4395('0xb')]?_0x368751[_0x4395('0xb')]:_0x4395('0xc'),'ipAddress':_0x368751&&_0x368751[_0x4395('0xd')]?_0x368751[_0x4395('0xd')]:_0x4395('0xe')};}exports[_0x4395('0xf')]=getFirstInterface;function getCPUhash(){var _0x42d4ec=_[_0x4395('0x4')](os[_0x4395('0x10')]()[_0x4395('0x11')](function(_0x520bd9){return _0x520bd9[_0x4395('0x12')];}))[_0x4395('0x13')](':');return crypto[_0x4395('0x14')]('md5')[_0x4395('0x15')](_0x42d4ec)[_0x4395('0x16')](_0x4395('0x17'));}exports['getUuid']=function(){switch(os['platform']()){case _0x4395('0x18'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x4395('0x19')})[_0x4395('0x1a')]('\x0d\x0a','');default:var _0x322da3=getFirstInterface();var _0x4109d4=getCPUhash();var _0x4232d0=_0x4109d4+'|'+os[_0x4395('0x1b')]()+'|'+_0x322da3[_0x4395('0x1c')]+'|'+_0x322da3['ipAddress'];var _0x4f1d15=crypto['createHash']('md5')[_0x4395('0x15')](_0x4232d0)['digest'](_0x4395('0x17'));return _0x4f1d15[_0x4395('0x1d')](0x0,0x8)+'-'+_0x4f1d15[_0x4395('0x1d')](0x8,0xc)+'-'+_0x4f1d15[_0x4395('0x1d')](0xc,0x10)+'-'+_0x4f1d15['substring'](0x10,0x14)+'-'+_0x4f1d15['substring'](0x14);}}; \ No newline at end of file +var _0x71b8=['crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','family','concat','head','mac','127.0.0.1','getFirstInterface','cpus','join','update','digest','hex','getUuid','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','createHash','substring','lodash'];(function(_0xcd017e,_0x4cd701){var _0x5ba836=function(_0x1e33b5){while(--_0x1e33b5){_0xcd017e['push'](_0xcd017e['shift']());}};_0x5ba836(++_0x4cd701);}(_0x71b8,0x195));var _0x871b=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x71b8[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x871b('0x0'));var os=require('os');var crypto=require(_0x871b('0x1'));var machine=require(_0x871b('0x2'));var exec=require(_0x871b('0x3'))[_0x871b('0x4')];function getInterfaces(){var _0x2c2490=[];var _0x2fb3f8=os[_0x871b('0x5')]();var _0x593ba3=_[_0x871b('0x6')](_[_0x871b('0x7')](_0x2fb3f8));for(var _0x24d90b=0x0;_0x24d90b<_0x593ba3[_0x871b('0x8')];_0x24d90b++){var _0x215209=_0x2fb3f8[_0x593ba3[_0x24d90b]]['filter'](function(_0x1088ed){return _0x1088ed[_0x871b('0x9')]==='IPv4'&&_0x1088ed['internal']===![];});_0x2c2490=_0x2c2490[_0x871b('0xa')](_0x215209);}return _0x2c2490;}function getFirstInterface(){var _0x1ae462=_[_0x871b('0xb')](getInterfaces());return{'macAddress':_0x1ae462&&_0x1ae462[_0x871b('0xc')]?_0x1ae462[_0x871b('0xc')]:'00:00:00:00:00:00','ipAddress':_0x1ae462&&_0x1ae462['address']?_0x1ae462['address']:_0x871b('0xd')};}exports[_0x871b('0xe')]=getFirstInterface;function getCPUhash(){var _0x110149=_['orderBy'](os[_0x871b('0xf')]()['map'](function(_0x33ce33){return _0x33ce33['model'];}))[_0x871b('0x10')](':');return crypto['createHash']('md5')[_0x871b('0x11')](_0x110149)[_0x871b('0x12')](_0x871b('0x13'));}exports[_0x871b('0x14')]=function(){switch(os['platform']()){case _0x871b('0x15'):return exec(_0x871b('0x16'),{'encoding':_0x871b('0x17')})[_0x871b('0x18')]('\x0d\x0a','');default:var _0x3246f8=getFirstInterface();var _0x408621=getCPUhash();var _0x8f7c35=_0x408621+'|'+os[_0x871b('0x19')]()+'|'+_0x3246f8['macAddress']+'|'+_0x3246f8[_0x871b('0x1a')];var _0x567c8b=crypto[_0x871b('0x1b')]('md5')[_0x871b('0x11')](_0x8f7c35)['digest'](_0x871b('0x13'));return _0x567c8b['substring'](0x0,0x8)+'-'+_0x567c8b[_0x871b('0x1c')](0x8,0xc)+'-'+_0x567c8b[_0x871b('0x1c')](0xc,0x10)+'-'+_0x567c8b['substring'](0x10,0x14)+'-'+_0x567c8b[_0x871b('0x1c')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 6602a7a..4ee17d4 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 _0xb182=['application/json','request','utf8','parse','error','end','createCipher','aes-256-ctr','secrets','update','base64','session','||FIELD||VALUE||\x0a','User','admin','fullname','email','then','|reason|','|uuid|','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','catch','message','finally','getUuid','License','spread','util','crypto','bluebird','pkginfo','../../mysqldb','./hardware','license','../../api/jira/jira.controller','www.xcallymotion.com','format','/api/servers/%s/check?version=%s','exports','version','GET'];(function(_0x2d37b7,_0x3bf618){var _0x4dfbdb=function(_0x18fc40){while(--_0x18fc40){_0x2d37b7['push'](_0x2d37b7['shift']());}};_0x4dfbdb(++_0x3bf618);}(_0xb182,0x1e2));var _0x2b18=function(_0x4ec13d,_0x358a8f){_0x4ec13d=_0x4ec13d-0x0;var _0x3c3fa7=_0xb182[_0x4ec13d];return _0x3c3fa7;};'use strict';var util=require(_0x2b18('0x0'));var https=require('https');var crypto=require(_0x2b18('0x1'));var moment=require('moment');var BPromise=require(_0x2b18('0x2'));var pkginfo=require(_0x2b18('0x3'))(module,'version');var db=require(_0x2b18('0x4'))['db'];var config=require('../environment');var hardware=require(_0x2b18('0x5'));var logger=require('../logger')(_0x2b18('0x6'));var jira=require(_0x2b18('0x7'));var HOST=_0x2b18('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;function httpRequest(_0x3ada1c){return new BPromise(function(_0x252066,_0x357af6){var _0x19fd22={'host':HOST,'port':0x1bb,'path':util[_0x2b18('0x9')](_0x2b18('0xa'),_0x3ada1c,module[_0x2b18('0xb')][_0x2b18('0xc')]),'method':_0x2b18('0xd'),'timeout':0xea60,'headers':{'Content-Type':_0x2b18('0xe')}};var _0x1ada2e=https[_0x2b18('0xf')](_0x19fd22,function(_0x31248e){_0x31248e['setEncoding'](_0x2b18('0x10'));var _0xe36f35='';_0x31248e['on']('data',function(_0x25cd68){_0xe36f35+=_0x25cd68;});_0x31248e['on']('end',function(){try{_0x252066(JSON[_0x2b18('0x11')](_0xe36f35));}catch(_0x2158d7){_0x357af6(_0x2158d7);}});});_0x1ada2e['on'](_0x2b18('0x12'),_0x357af6);_0x1ada2e[_0x2b18('0x13')]();});}function encryptDate(_0x5bfcc2){var _0x5b6543=crypto[_0x2b18('0x14')](_0x2b18('0x15'),config[_0x2b18('0x16')]['session']);var _0x44be6a=_0x5b6543[_0x2b18('0x17')](_0x5bfcc2,_0x2b18('0x10'),_0x2b18('0x18'));_0x44be6a+=_0x5b6543['final'](_0x2b18('0x18'));return _0x44be6a;}function decryptDate(_0x30acea){var _0x517f72=crypto['createDecipher'](_0x2b18('0x15'),config[_0x2b18('0x16')][_0x2b18('0x19')]);var _0x14305a=_0x517f72[_0x2b18('0x17')](_0x30acea,_0x2b18('0x18'),_0x2b18('0x10'));_0x14305a+=_0x517f72['final'](_0x2b18('0x10'));return _0x14305a;}function sendJiraAlert(_0x59635f,_0x1afb1a,_0x500313){var _0x1e2e7b=_0x2b18('0x1a');return db[_0x2b18('0x1b')]['findOne']({'where':{'role':_0x2b18('0x1c')},'attributes':[_0x2b18('0x1d'),_0x2b18('0x1e')],'raw':!![]})[_0x2b18('0x1f')](function(_0x2cb00c){ADMIN=_0x2cb00c;_0x1e2e7b+=_0x2b18('0x20')+_0x500313+'|\x0a';_0x1e2e7b+=_0x2b18('0x21')+_0x59635f+'|\x0a';_0x1e2e7b+='|machineUuid|'+_0x1afb1a+'|\x0a';_0x1e2e7b+='|name|'+ADMIN['fullname']+'|\x0a';_0x1e2e7b+='|email|'+ADMIN[_0x2b18('0x1e')]+'|\x0a';return _0x1e2e7b;})[_0x2b18('0x1f')](function(_0x5b880e){var _0x2b0b36=hardware['getFirstInterface']()[_0x2b18('0x22')];return jira[_0x2b18('0x23')]({'key':_0x2b18('0x24'),'summary':_0x2b18('0x25'),'description':_0x5b880e,'issuetype':_0x2b18('0x26'),'oldToken':_0x59635f,'newToken':_0x1afb1a,'email':ADMIN[_0x2b18('0x1e')],'name':ADMIN[_0x2b18('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x2b0b36});});}function manageLicense(_0x1cbe37,_0x536f94){var _0x202b48=_0x536f94[_0x2b18('0x27')]({'plain':!![]});httpRequest(_0x1cbe37)[_0x2b18('0x1f')](function(_0x223c26){if(_0x223c26['active']){if(!_0x202b48[_0x2b18('0x6')]&&_0x202b48['license']!=_0x223c26[_0x2b18('0x6')]||_0x202b48[_0x2b18('0x6')]&&_0x202b48['data2']){logger[_0x2b18('0x28')](_0x2b18('0x29'));}if(_0x202b48[_0x2b18('0x6')]&&!_0x202b48[_0x2b18('0x2a')]&&_0x202b48[_0x2b18('0x6')]!=_0x223c26[_0x2b18('0x6')]){logger[_0x2b18('0x28')](_0x2b18('0x2b'));}if(_0x202b48['license']&&!_0x202b48['data2']&&_0x202b48[_0x2b18('0x6')]==_0x223c26[_0x2b18('0x6')]){return _0x536f94;}return _0x536f94[_0x2b18('0x17')]({'data1':_0x1cbe37,'data2':null,'license':_0x223c26[_0x2b18('0x6')]});}else{if(_0x223c26['license']||_0x202b48[_0x2b18('0x6')]){if(!_0x202b48['data2']){if(_0x202b48['data1']==_0x1cbe37){GRAY_PERIOD_REASON=_0x2b18('0x2c');logger[_0x2b18('0x28')](_0x2b18('0x2d'));}else{GRAY_PERIOD_REASON=_0x2b18('0x2e');logger[_0x2b18('0x28')](_0x2b18('0x2f'),_0x202b48[_0x2b18('0x30')],_0x1cbe37);}sendJiraAlert(_0x202b48[_0x2b18('0x30')],_0x223c26[_0x2b18('0x31')],GRAY_PERIOD_REASON);logger[_0x2b18('0x28')](_0x2b18('0x32'),GRAY_PERIOD_REASON[_0x2b18('0x33')](),moment()[_0x2b18('0x9')](_0x2b18('0x34')));return _0x536f94[_0x2b18('0x17')]({'data2':encryptDate(moment()[_0x2b18('0x9')](_0x2b18('0x34')))});}else{if(moment()[_0x2b18('0x35')](decryptDate(_0x202b48[_0x2b18('0x2a')]),_0x2b18('0x36'))>DAYS){logger[_0x2b18('0x28')](_0x2b18('0x37'),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x536f94[_0x2b18('0x17')]({'data1':_0x1cbe37,'data2':null,'license':null});}}}else{if(_0x202b48['data1']!=_0x1cbe37){logger['info'](_0x2b18('0x2f'),_0x202b48['data1'],_0x1cbe37);return _0x536f94[_0x2b18('0x17')]({'data1':_0x1cbe37,'data2':null,'license':null});}}}return _0x536f94;})[_0x2b18('0x1f')](function(_0x2e0afc){_0x536f94=_0x2e0afc;})[_0x2b18('0x38')](function(_0x6b17d0){logger['error'](_0x6b17d0[_0x2b18('0x39')]);})[_0x2b18('0x3a')](function(){setTimeout(function(){manageLicense(hardware[_0x2b18('0x3b')](),_0x536f94);},TIME);});}function defaultLicense(){var _0x504302=hardware[_0x2b18('0x3b')]();if(_0x504302){return db[_0x2b18('0x3c')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x504302}})[_0x2b18('0x3d')](function(_0x364730,_0x17b65f){logger[_0x2b18('0x28')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x504302);manageLicense(_0x504302,_0x364730);})[_0x2b18('0x38')](function(_0x1957c7){logger[_0x2b18('0x12')](_0x1957c7[_0x2b18('0x39')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x31bb=['|machineUuid|','|name|','|email|','getFirstInterface','ipAddress','Motion\x20License\x20Alert','Alert','active','data2','info','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','https','crypto','moment','bluebird','pkginfo','../environment','./hardware','../logger','license','../../api/jira/jira.controller','www.xcallymotion.com','format','/api/servers/%s/check?version=%s','exports','/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','application/json','request','setEncoding','utf8','data','end','parse','error','createCipher','aes-256-ctr','secrets','base64','final','update','||FIELD||VALUE||\x0a','User','findOne','fullname','email','then','|reason|'];(function(_0x25aead,_0x3b14bd){var _0x4a1493=function(_0x4f1564){while(--_0x4f1564){_0x25aead['push'](_0x25aead['shift']());}};_0x4a1493(++_0x3b14bd);}(_0x31bb,0x1e2));var _0xb31b=function(_0x2f31ca,_0x46b750){_0x2f31ca=_0x2f31ca-0x0;var _0x3224c9=_0x31bb[_0x2f31ca];return _0x3224c9;};'use strict';var util=require('util');var https=require(_0xb31b('0x0'));var crypto=require(_0xb31b('0x1'));var moment=require(_0xb31b('0x2'));var BPromise=require(_0xb31b('0x3'));var pkginfo=require(_0xb31b('0x4'))(module,'version');var db=require('../../mysqldb')['db'];var config=require(_0xb31b('0x5'));var hardware=require(_0xb31b('0x6'));var logger=require(_0xb31b('0x7'))(_0xb31b('0x8'));var jira=require(_0xb31b('0x9'));var HOST=_0xb31b('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x197b5b){return new BPromise(function(_0x3055a4,_0x47774f){var _0x35219c=util[_0xb31b('0xb')](_0xb31b('0xc'),_0x197b5b,module[_0xb31b('0xd')]['version']);if(oldToken){_0x35219c=util['format'](_0xb31b('0xe'),_0x197b5b,module[_0xb31b('0xd')][_0xb31b('0xf')],oldToken);}var _0x58e8bf={'host':HOST,'port':0x1bb,'path':util[_0xb31b('0xb')](_0xb31b('0xc'),_0x197b5b,module[_0xb31b('0xd')][_0xb31b('0xf')]),'method':_0xb31b('0x10'),'timeout':0xea60,'headers':{'Content-Type':_0xb31b('0x11')}};var _0x5eafc5=https[_0xb31b('0x12')](_0x58e8bf,function(_0x11a3c2){_0x11a3c2[_0xb31b('0x13')](_0xb31b('0x14'));var _0x1766ca='';_0x11a3c2['on'](_0xb31b('0x15'),function(_0x496386){_0x1766ca+=_0x496386;});_0x11a3c2['on'](_0xb31b('0x16'),function(){try{_0x3055a4(JSON[_0xb31b('0x17')](_0x1766ca));}catch(_0x4a6dae){_0x47774f(_0x4a6dae);}});});_0x5eafc5['on'](_0xb31b('0x18'),_0x47774f);_0x5eafc5[_0xb31b('0x16')]();});}function encryptDate(_0x6d7d48){var _0x4f32fb=crypto[_0xb31b('0x19')](_0xb31b('0x1a'),config[_0xb31b('0x1b')]['session']);var _0x4882e2=_0x4f32fb['update'](_0x6d7d48,_0xb31b('0x14'),_0xb31b('0x1c'));_0x4882e2+=_0x4f32fb[_0xb31b('0x1d')]('base64');return _0x4882e2;}function decryptDate(_0x1a53a2){var _0x18bae1=crypto['createDecipher'](_0xb31b('0x1a'),config[_0xb31b('0x1b')]['session']);var _0x4c76ca=_0x18bae1[_0xb31b('0x1e')](_0x1a53a2,_0xb31b('0x1c'),'utf8');_0x4c76ca+=_0x18bae1['final'](_0xb31b('0x14'));return _0x4c76ca;}function sendJiraAlert(_0x2ffe7f,_0x50459b,_0x30de1e){var _0x3b2355=_0xb31b('0x1f');return db[_0xb31b('0x20')][_0xb31b('0x21')]({'where':{'role':'admin'},'attributes':[_0xb31b('0x22'),_0xb31b('0x23')],'raw':!![]})[_0xb31b('0x24')](function(_0x2129dd){ADMIN=_0x2129dd;_0x3b2355+=_0xb31b('0x25')+_0x30de1e+'|\x0a';_0x3b2355+='|uuid|'+_0x2ffe7f+'|\x0a';_0x3b2355+=_0xb31b('0x26')+_0x50459b+'|\x0a';_0x3b2355+=_0xb31b('0x27')+ADMIN['fullname']+'|\x0a';_0x3b2355+=_0xb31b('0x28')+ADMIN[_0xb31b('0x23')]+'|\x0a';return _0x3b2355;})[_0xb31b('0x24')](function(_0x1ef692){var _0x4889d3=hardware[_0xb31b('0x29')]()[_0xb31b('0x2a')];return jira['openIssue']({'key':'MOTLICENSE','summary':_0xb31b('0x2b'),'description':_0x1ef692,'issuetype':_0xb31b('0x2c'),'oldToken':_0x2ffe7f,'newToken':_0x50459b,'email':ADMIN[_0xb31b('0x23')],'name':ADMIN[_0xb31b('0x22')],'reason':GRAY_PERIOD_REASON,'ip':_0x4889d3});});}function manageLicense(_0x3abb5f,_0x38e890){var _0x536ec3=_0x38e890['get']({'plain':!![]});httpRequest(_0x3abb5f)[_0xb31b('0x24')](function(_0x9a9d5e){if(oldToken){oldToken=undefined;}if(_0x9a9d5e[_0xb31b('0x2d')]){if(!_0x536ec3[_0xb31b('0x8')]&&_0x536ec3['license']!=_0x9a9d5e[_0xb31b('0x8')]||_0x536ec3[_0xb31b('0x8')]&&_0x536ec3[_0xb31b('0x2e')]){logger[_0xb31b('0x2f')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x536ec3[_0xb31b('0x8')]&&!_0x536ec3[_0xb31b('0x2e')]&&_0x536ec3[_0xb31b('0x8')]!=_0x9a9d5e[_0xb31b('0x8')]){logger[_0xb31b('0x2f')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x536ec3[_0xb31b('0x8')]&&!_0x536ec3[_0xb31b('0x2e')]&&_0x536ec3[_0xb31b('0x8')]==_0x9a9d5e[_0xb31b('0x8')]){return _0x38e890;}return _0x38e890[_0xb31b('0x1e')]({'data1':_0x3abb5f,'data2':null,'license':_0x9a9d5e['license']});}else{if(_0x9a9d5e[_0xb31b('0x8')]||_0x536ec3[_0xb31b('0x8')]){if(!_0x536ec3[_0xb31b('0x2e')]){if(_0x536ec3[_0xb31b('0x30')]==_0x3abb5f){GRAY_PERIOD_REASON=_0xb31b('0x31');logger[_0xb31b('0x2f')](_0xb31b('0x32'));}else{GRAY_PERIOD_REASON=_0xb31b('0x33');oldToken=_0x536ec3[_0xb31b('0x30')];logger[_0xb31b('0x2f')](_0xb31b('0x34'),_0x536ec3['data1'],_0x3abb5f);}sendJiraAlert(_0x536ec3['data1'],_0x9a9d5e[_0xb31b('0x35')],GRAY_PERIOD_REASON);logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xb31b('0x36')](),moment()[_0xb31b('0xb')](_0xb31b('0x37')));return _0x38e890['update']({'data2':encryptDate(moment()[_0xb31b('0xb')](_0xb31b('0x37')))});}else{if(moment()[_0xb31b('0x38')](decryptDate(_0x536ec3[_0xb31b('0x2e')]),'days')>DAYS){logger[_0xb31b('0x2f')]('DEMO\x20START\x20AT\x20%s',moment()[_0xb31b('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x38e890[_0xb31b('0x1e')]({'data1':_0x3abb5f,'data2':null,'license':null});}}}else{if(_0x536ec3[_0xb31b('0x30')]!=_0x3abb5f){logger[_0xb31b('0x2f')](_0xb31b('0x34'),_0x536ec3[_0xb31b('0x30')],_0x3abb5f);return _0x38e890['update']({'data1':_0x3abb5f,'data2':null,'license':null});}}}return _0x38e890;})[_0xb31b('0x24')](function(_0x32d3cd){_0x38e890=_0x32d3cd;})['catch'](function(_0x129fd5){logger[_0xb31b('0x18')](_0x129fd5[_0xb31b('0x39')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xb31b('0x3a')](),_0x38e890);},TIME);});}function defaultLicense(){var _0x51fb43=hardware[_0xb31b('0x3a')]();if(_0x51fb43){return db[_0xb31b('0x3b')][_0xb31b('0x3c')]({'where':{'id':0x1},'defaults':{'data1':_0x51fb43}})[_0xb31b('0x3d')](function(_0x53acba,_0x39b260){logger['info'](_0xb31b('0x3e'),_0x51fb43);manageLicense(_0x51fb43,_0x53acba);})[_0xb31b('0x3f')](function(_0x2b1eb3){logger['error'](_0x2b1eb3[_0xb31b('0x39')]);});}}exports[_0xb31b('0x40')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index a6d9b2a..8f357b3 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 _0x5df9=['data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','demo','session','final','gray','deadline','add','grayReason','uuid','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','message','Demo\x20license','getLicense','find','then','crypto','util','lodash','./hardware','../environment','license','isEmpty','License\x20key\x20value\x20not\x20found','data1'];(function(_0x3290a6,_0x42896a){var _0x438781=function(_0x14cf6b){while(--_0x14cf6b){_0x3290a6['push'](_0x3290a6['shift']());}};_0x438781(++_0x42896a);}(_0x5df9,0x144));var _0x95df=function(_0x743455,_0x8da135){_0x743455=_0x743455-0x0;var _0x1377db=_0x5df9[_0x743455];return _0x1377db;};'use strict';var crypto=require(_0x95df('0x0'));var util=require(_0x95df('0x1'));var _=require(_0x95df('0x2'));var moment=require('moment');var hardware=require(_0x95df('0x3'));var config=require(_0x95df('0x4'));var db=require('../../mysqldb')['db'];function checkLicense(_0x2bc7f6,_0x335e70){if(_0x2bc7f6){try{var _0x5de814=_0x335e70||_0x2bc7f6[_0x95df('0x5')];if(_[_0x95df('0x6')](_0x5de814)){throw new Error(_0x95df('0x7'));}var _0xd67ba1=_0x2bc7f6[_0x95df('0x8')];var _0x49af9e=_0x2bc7f6[_0x95df('0x9')];var _0x2a0b6b=_0xd67ba1[_0x95df('0xa')]('-')[0x4];var _0x43453b=_0xd67ba1[_0x95df('0xa')]('-')[0x0];var _0x5a63e8=crypto[_0x95df('0xb')](_0x95df('0xc'),util[_0x95df('0xd')](_0x95df('0xe'),_0x2a0b6b,_0xd67ba1,_0x43453b));var _0xd9aeb1=_0x5a63e8[_0x95df('0xf')](_0x5de814,_0x95df('0x10'),'utf8');_0xd9aeb1+=_0x5a63e8['final'](_0x95df('0x11'));var _0x1abd6c=JSON[_0x95df('0x12')](_0xd9aeb1);_0x1abd6c[_0x95df('0x13')]=![];_0x1abd6c['uuid']=_0xd67ba1;_0x1abd6c['machineUuid']=hardware['getUuid']();if(_0x49af9e){var _0xc71e85=crypto['createDecipher'](_0x95df('0xc'),config['secrets'][_0x95df('0x14')]);var _0x19219d=_0xc71e85[_0x95df('0xf')](_0x49af9e,_0x95df('0x10'),_0x95df('0x11'));_0x19219d+=_0xc71e85[_0x95df('0x15')](_0x95df('0x11'));_0x1abd6c[_0x95df('0x16')]=_0x19219d;_0x1abd6c[_0x95df('0x17')]=moment(_0x19219d)[_0x95df('0x18')](0x7,'days')[_0x95df('0xd')]();_0x1abd6c[_0x95df('0x19')]=_0x1abd6c[_0x95df('0x1a')]!=_0x1abd6c['machineUuid']?_0x95df('0x1b'):_0x95df('0x1c');}return _0x1abd6c;}catch(_0x59bff3){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x95df('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x95df('0x1e'),'uuid':_0x2bc7f6[_0x95df('0x8')],'machineUuid':hardware[_0x95df('0x1f')](),'message':_0x59bff3[_0x95df('0x20')],'virtual':0x0,'voice':!![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x95df('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x95df('0x21'),'uuid':_0x2bc7f6[_0x95df('0x8')],'machineUuid':hardware[_0x95df('0x1f')](),'virtual':0x0,'voice':!![],'preferred':![]};}exports[_0x95df('0x22')]=function(_0x39ea42){return db['License'][_0x95df('0x23')](_['defaults'](_0x39ea42,{'raw':!![],'where':{'id':0x1}}))[_0x95df('0x24')](function(_0x32a90a){return checkLicense(_0x32a90a,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file +var _0x4713=['utf8','final','parse','demo','uuid','machineUuid','getUuid','createDecipher','secrets','session','gray','deadline','days','format','changed','2027-01-01T00:00:00.000Z','Breaking\x20license','data1','Demo\x20license','getLicense','License','find','checkLicense','crypto','util','lodash','moment','./hardware','../environment','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','aes-256-ctr','%s:%s:%s','update','base64'];(function(_0x1da9bf,_0x10784f){var _0x4ddec7=function(_0x150f43){while(--_0x150f43){_0x1da9bf['push'](_0x1da9bf['shift']());}};_0x4ddec7(++_0x10784f);}(_0x4713,0x1b9));var _0x3471=function(_0x1909f9,_0x1795ef){_0x1909f9=_0x1909f9-0x0;var _0x4fc488=_0x4713[_0x1909f9];return _0x4fc488;};'use strict';var crypto=require(_0x3471('0x0'));var util=require(_0x3471('0x1'));var _=require(_0x3471('0x2'));var moment=require(_0x3471('0x3'));var hardware=require(_0x3471('0x4'));var config=require(_0x3471('0x5'));var db=require('../../mysqldb')['db'];function checkLicense(_0x33322a,_0x5809d2){if(_0x33322a){try{var _0x5cb368=_0x5809d2||_0x33322a[_0x3471('0x6')];if(_[_0x3471('0x7')](_0x5cb368)){throw new Error(_0x3471('0x8'));}var _0x2b82d7=_0x33322a['data1'];var _0x798446=_0x33322a[_0x3471('0x9')];var _0x52a33d=_0x2b82d7[_0x3471('0xa')]('-')[0x4];var _0x413ea5=_0x2b82d7[_0x3471('0xa')]('-')[0x0];var _0x426c96=crypto['createDecipher'](_0x3471('0xb'),util['format'](_0x3471('0xc'),_0x52a33d,_0x2b82d7,_0x413ea5));var _0x2f00cc=_0x426c96[_0x3471('0xd')](_0x5cb368,_0x3471('0xe'),_0x3471('0xf'));_0x2f00cc+=_0x426c96[_0x3471('0x10')](_0x3471('0xf'));var _0x2b21c1=JSON[_0x3471('0x11')](_0x2f00cc);_0x2b21c1[_0x3471('0x12')]=![];_0x2b21c1[_0x3471('0x13')]=_0x2b82d7;_0x2b21c1[_0x3471('0x14')]=hardware[_0x3471('0x15')]();if(_0x798446){var _0x230c57=crypto[_0x3471('0x16')](_0x3471('0xb'),config[_0x3471('0x17')][_0x3471('0x18')]);var _0x5c98cc=_0x230c57[_0x3471('0xd')](_0x798446,_0x3471('0xe'),_0x3471('0xf'));_0x5c98cc+=_0x230c57[_0x3471('0x10')](_0x3471('0xf'));_0x2b21c1[_0x3471('0x19')]=_0x5c98cc;_0x2b21c1[_0x3471('0x1a')]=moment(_0x5c98cc)['add'](0x7,_0x3471('0x1b'))[_0x3471('0x1c')]();_0x2b21c1['grayReason']=_0x2b21c1['uuid']!=_0x2b21c1[_0x3471('0x14')]?_0x3471('0x1d'):'disabled';}return _0x2b21c1;}catch(_0x271436){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3471('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3471('0x1f'),'uuid':_0x33322a[_0x3471('0x20')],'machineUuid':hardware[_0x3471('0x15')](),'message':_0x271436['message'],'virtual':0x0,'voice':!![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3471('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3471('0x21'),'uuid':_0x33322a[_0x3471('0x20')],'machineUuid':hardware[_0x3471('0x15')](),'virtual':0x0,'voice':!![],'preferred':![]};}exports[_0x3471('0x22')]=function(_0x4c58b0){return db[_0x3471('0x23')][_0x3471('0x24')](_['defaults'](_0x4c58b0,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5013f6){return checkLicense(_0x5013f6,null);});};exports[_0x3471('0x25')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index c557c2d..88447b5 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 _0xac65=['secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x585b22,_0xd64ae1){var _0xb5e53e=function(_0x1c06a2){while(--_0x1c06a2){_0x585b22['push'](_0x585b22['shift']());}};_0xb5e53e(++_0xd64ae1);}(_0xac65,0x11d));var _0x5ac6=function(_0x13b245,_0x5b6dda){_0x13b245=_0x13b245-0x0;var _0x497b61=_0xac65[_0x13b245];return _0x497b61;};'use strict';module[_0x5ac6('0x0')]={'DOMAIN':_0x5ac6('0x1'),'SESSION_SECRET':_0x5ac6('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x5ac6('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xf430=['exports','http://localhost:9000','myappanuglar-secret','secret'];(function(_0x33312a,_0x5ca69a){var _0x533db2=function(_0xf75383){while(--_0xf75383){_0x33312a['push'](_0x33312a['shift']());}};_0x533db2(++_0x5ca69a);}(_0xf430,0x1e4));var _0x0f43=function(_0x46e523,_0xe6fccb){_0x46e523=_0x46e523-0x0;var _0x5da0ee=_0xf430[_0x46e523];return _0x5da0ee;};'use strict';module[_0x0f43('0x0')]={'DOMAIN':_0x0f43('0x1'),'SESSION_SECRET':_0x0f43('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x0f43('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index f471f36..9f42fda 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4f3=['log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','message','exports','transports','File','%s-%s','error','info','Console','moment','util','path','INFO','join','/var'];(function(_0x209de9,_0x2d072a){var _0x198869=function(_0x8bf90f){while(--_0x8bf90f){_0x209de9['push'](_0x209de9['shift']());}};_0x198869(++_0x2d072a);}(_0xe4f3,0x126));var _0x3e4f=function(_0x8a7b34,_0x490ea6){_0x8a7b34=_0x8a7b34-0x0;var _0x4968dd=_0xe4f3[_0x8a7b34];return _0x4968dd;};'use strict';var moment=require(_0x3e4f('0x0'));var winston=require('winston');var util=require(_0x3e4f('0x1'));var path=require(_0x3e4f('0x2'));var debugLevel=_0x3e4f('0x3');function filename(_0x202f8c,_0x12bdb4){return path[_0x3e4f('0x4')](_0x3e4f('0x5'),_0x3e4f('0x6'),_0x3e4f('0x7'),util[_0x3e4f('0x8')](_0x3e4f('0x9'),_0x202f8c,_0x12bdb4));}function formatter(_0x55fd05,_0x5c279d){return util[_0x3e4f('0x8')](_0x3e4f('0xa'),moment()[_0x3e4f('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),_0x5c279d['level'][_0x3e4f('0xb')](),_0x55fd05,_0x5c279d[_0x3e4f('0xc')]);}module[_0x3e4f('0xd')]=function(_0xd96a84){return new winston['Logger']({'transports':[new winston[(_0x3e4f('0xe'))][(_0x3e4f('0xf'))]({'name':util[_0x3e4f('0x8')](_0x3e4f('0x10'),_0xd96a84,_0x3e4f('0x11')),'filename':filename(_0xd96a84,'error'),'level':_0x3e4f('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x391993){return formatter(_0xd96a84,_0x391993);}}),new winston[(_0x3e4f('0xe'))][(_0x3e4f('0xf'))]({'name':util[_0x3e4f('0x8')]('%s-%s',_0xd96a84,_0x3e4f('0x12')),'filename':filename(_0xd96a84,_0x3e4f('0x12')),'level':_0x3e4f('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x79216d){return formatter(_0xd96a84,_0x79216d);}}),new winston['transports'][(_0x3e4f('0x13'))]({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x1e0e5e){return formatter(_0xd96a84,_0x1e0e5e);}})]});}; \ No newline at end of file +var _0x7f24=['/var','log','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','Logger','transports','File','%s-%s','error','info','Console','env','moment','winston','util','path','INFO','join'];(function(_0x11cf32,_0x560d24){var _0x163a94=function(_0x6a41b8){while(--_0x6a41b8){_0x11cf32['push'](_0x11cf32['shift']());}};_0x163a94(++_0x560d24);}(_0x7f24,0x174));var _0x47f2=function(_0x5e2f7b,_0x226498){_0x5e2f7b=_0x5e2f7b-0x0;var _0x3c386e=_0x7f24[_0x5e2f7b];return _0x3c386e;};'use strict';var moment=require(_0x47f2('0x0'));var winston=require(_0x47f2('0x1'));var util=require(_0x47f2('0x2'));var path=require(_0x47f2('0x3'));var debugLevel=_0x47f2('0x4');function filename(_0x3e040e,_0x788c75){return path[_0x47f2('0x5')](_0x47f2('0x6'),_0x47f2('0x7'),'xcally',util[_0x47f2('0x8')](_0x47f2('0x9'),_0x3e040e,_0x788c75));}function formatter(_0x52d1af,_0x12aa91){return util[_0x47f2('0x8')](_0x47f2('0xa'),moment()[_0x47f2('0x8')](_0x47f2('0xb')),_0x12aa91[_0x47f2('0xc')]['toUpperCase'](),_0x52d1af,_0x12aa91['message']);}module['exports']=function(_0x3ef154){return new winston[(_0x47f2('0xd'))]({'transports':[new winston[(_0x47f2('0xe'))][(_0x47f2('0xf'))]({'name':util[_0x47f2('0x8')](_0x47f2('0x10'),_0x3ef154,_0x47f2('0x11')),'filename':filename(_0x3ef154,_0x47f2('0x11')),'level':_0x47f2('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1357fb){return formatter(_0x3ef154,_0x1357fb);}}),new winston['transports']['File']({'name':util[_0x47f2('0x8')](_0x47f2('0x10'),_0x3ef154,_0x47f2('0x12')),'filename':filename(_0x3ef154,_0x47f2('0x12')),'level':_0x47f2('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x58e1aa){return formatter(_0x3ef154,_0x58e1aa);}}),new winston[(_0x47f2('0xe'))][(_0x47f2('0x13'))]({'level':process[_0x47f2('0x14')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x2a098e){return formatter(_0x3ef154,_0x2a098e);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 313b56b..8cd0a40 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 _0xc475=['../../services/xdr/index.js','path','express','ami','../../services/ami/index.js','agi','join','../../services/agi/index.js','../../services/email/index.js','routing','xdr'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc475,0x114));var _0x5c47=function(_0x21f62d,_0x52e460){_0x21f62d=_0x21f62d-0x0;var _0x40face=_0xc475[_0x21f62d];return _0x40face;};'use strict';var path=require(_0x5c47('0x0'));var os=require('os');var config={'apps':[{'name':_0x5c47('0x1'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0x5c47('0x2'),'script':path['join'](__dirname,_0x5c47('0x3'))},{'name':_0x5c47('0x4'),'script':path[_0x5c47('0x5')](__dirname,_0x5c47('0x6'))},{'name':'email','script':path[_0x5c47('0x5')](__dirname,_0x5c47('0x7'))},{'name':_0x5c47('0x8'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0x5c47('0x9'),'script':path[_0x5c47('0x5')](__dirname,_0x5c47('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0x5400=['express','agi','join','../../services/email/index.js','../../services/routing/index.js','xdr','exports','path'];(function(_0x1c8764,_0xc5d481){var _0x4dcce4=function(_0xcf5cb4){while(--_0xcf5cb4){_0x1c8764['push'](_0x1c8764['shift']());}};_0x4dcce4(++_0xc5d481);}(_0x5400,0x15f));var _0x0540=function(_0xb4ce16,_0x2bd30c){_0xb4ce16=_0xb4ce16-0x0;var _0x14055c=_0x5400[_0xb4ce16];return _0x14055c;};'use strict';var path=require(_0x0540('0x0'));var os=require('os');var config={'apps':[{'name':_0x0540('0x1'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':'ami','script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x0540('0x2'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0x0540('0x3')](__dirname,_0x0540('0x4'))},{'name':'routing','script':path[_0x0540('0x3')](__dirname,_0x0540('0x5'))},{'name':_0x0540('0x6'),'script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0x0540('0x7')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index a0441ea..0f2f7f9 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 _0x55ca=['stop','restart','list','describe','delete','dump','pm2','bluebird','connect','start','then','disconnect'];(function(_0x5bf632,_0x5accaa){var _0x650ce5=function(_0x56b914){while(--_0x56b914){_0x5bf632['push'](_0x5bf632['shift']());}};_0x650ce5(++_0x5accaa);}(_0x55ca,0x126));var _0xa55c=function(_0x1a48a0,_0x3c95f5){_0x1a48a0=_0x1a48a0-0x0;var _0x269714=_0x55ca[_0x1a48a0];return _0x269714;};'use strict';var pm2=require(_0xa55c('0x0'));var BPromise=require(_0xa55c('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x5edc58,_0x49875a){return pm2[_0xa55c('0x2')](function(_0x267ea0){if(_0x267ea0){return _0x49875a(_0x267ea0);}return _0x5edc58('connected');});});};exports[_0xa55c('0x3')]=function(_0x2db02a){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x204951,_0x3c97c8){return pm2[_0xa55c('0x3')](_0x2db02a,function(_0x36b623,_0x4d0624){if(_0x36b623){return _0x3c97c8(_0x36b623);}pm2[_0xa55c('0x5')]();return _0x204951(_0x4d0624);});});});};exports[_0xa55c('0x6')]=function(_0x57e069){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x290d28,_0x52a3bc){return pm2['stop'](_0x57e069,function(_0x473d0e,_0x20c76a){if(_0x473d0e){return _0x52a3bc(_0x473d0e);}pm2[_0xa55c('0x5')]();return _0x290d28(_0x20c76a);});});});};exports[_0xa55c('0x7')]=function(_0x31646d){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x508342,_0x70c2de){return pm2[_0xa55c('0x7')](_0x31646d,function(_0x15eec8,_0x5d47ff){if(_0x15eec8){return _0x70c2de(_0x15eec8);}pm2['disconnect']();return _0x508342(_0x5d47ff);});});});};exports[_0xa55c('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5a3672,_0x59ea8d){return pm2[_0xa55c('0x8')](function(_0x3930e4,_0x462cd6){if(_0x3930e4){return _0x59ea8d(_0x3930e4);}pm2[_0xa55c('0x5')]();return _0x5a3672(_0x462cd6);});});});};exports[_0xa55c('0x9')]=function(_0x247e77){return connect()['then'](function(){return new BPromise(function(_0x3ccf65,_0x3dcf4f){return pm2[_0xa55c('0x9')](_0x247e77,function(_0x31e10d,_0x1c4cfd){if(_0x31e10d){return _0x3dcf4f(_0x31e10d);}pm2[_0xa55c('0x5')]();return _0x3ccf65(_0x1c4cfd);});});});};exports[_0xa55c('0xa')]=function(_0x2d09d8){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x4cee3c,_0x3d4c9e){return pm2[_0xa55c('0xa')](_0x2d09d8,function(_0x461284,_0x358b61){if(_0x461284){return _0x3d4c9e(_0x461284);}pm2[_0xa55c('0x5')]();return _0x4cee3c(_0x358b61);});});});};exports[_0xa55c('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5f5158,_0xd643cc){return pm2[_0xa55c('0xb')](function(_0xade4c4){if(_0xade4c4){return _0xd643cc(_0xade4c4);}return _0x5f5158('saved');});});});}; \ No newline at end of file +var _0x008c=['start','then','disconnect','stop','restart','list','describe','delete','pm2','bluebird','./config','connected'];(function(_0x369710,_0x504163){var _0x503eee=function(_0x56b2ab){while(--_0x56b2ab){_0x369710['push'](_0x369710['shift']());}};_0x503eee(++_0x504163);}(_0x008c,0x188));var _0xc008=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x008c[_0x51674a];return _0x13fca6;};'use strict';var pm2=require(_0xc008('0x0'));var BPromise=require(_0xc008('0x1'));var config=require(_0xc008('0x2'));function connect(){return new BPromise(function(_0xae17af,_0x1d119a){return pm2['connect'](function(_0x3641af){if(_0x3641af){return _0x1d119a(_0x3641af);}return _0xae17af(_0xc008('0x3'));});});};exports[_0xc008('0x4')]=function(_0x163bd9){return connect()[_0xc008('0x5')](function(){return new BPromise(function(_0x1679e0,_0x13aa7){return pm2[_0xc008('0x4')](_0x163bd9,function(_0x9c8cb2,_0x4af530){if(_0x9c8cb2){return _0x13aa7(_0x9c8cb2);}pm2[_0xc008('0x6')]();return _0x1679e0(_0x4af530);});});});};exports['stop']=function(_0x30be38){return connect()['then'](function(){return new BPromise(function(_0x52041f,_0x27830d){return pm2[_0xc008('0x7')](_0x30be38,function(_0x57c46d,_0x51ba7d){if(_0x57c46d){return _0x27830d(_0x57c46d);}pm2['disconnect']();return _0x52041f(_0x51ba7d);});});});};exports[_0xc008('0x8')]=function(_0xc881aa){return connect()['then'](function(){return new BPromise(function(_0xae2dab,_0x332fd4){return pm2[_0xc008('0x8')](_0xc881aa,function(_0x2a5b4e,_0x9ffa93){if(_0x2a5b4e){return _0x332fd4(_0x2a5b4e);}pm2[_0xc008('0x6')]();return _0xae2dab(_0x9ffa93);});});});};exports[_0xc008('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x560e28,_0x33f44c){return pm2['list'](function(_0x25e13f,_0x4584e1){if(_0x25e13f){return _0x33f44c(_0x25e13f);}pm2[_0xc008('0x6')]();return _0x560e28(_0x4584e1);});});});};exports[_0xc008('0xa')]=function(_0x3f0ecf){return connect()['then'](function(){return new BPromise(function(_0x5e894e,_0x4bd0f4){return pm2[_0xc008('0xa')](_0x3f0ecf,function(_0x15a6ad,_0x3cafe3){if(_0x15a6ad){return _0x4bd0f4(_0x15a6ad);}pm2[_0xc008('0x6')]();return _0x5e894e(_0x3cafe3);});});});};exports['delete']=function(_0x53b06e){return connect()['then'](function(){return new BPromise(function(_0x5c2668,_0x46042b){return pm2[_0xc008('0xb')](_0x53b06e,function(_0x501137,_0x813397){if(_0x501137){return _0x46042b(_0x501137);}pm2['disconnect']();return _0x5c2668(_0x813397);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x50261c,_0x5754a0){return pm2['dump'](function(_0x5560b1){if(_0x5560b1){return _0x5754a0(_0x5560b1);}return _0x50261c('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index acd5bdd..6115ca6 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 _0xdbe1=['subtract','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','chatInteraction:update','catch','error','start','lodash','ioredis','../../config/environment','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt'];(function(_0x28beaf,_0x122959){var _0x2df201=function(_0x583fd1){while(--_0x583fd1){_0x28beaf['push'](_0x28beaf['shift']());}};_0x2df201(++_0x122959);}(_0xdbe1,0x137));var _0x1dbe=function(_0x136e72,_0x42aa10){_0x136e72=_0x136e72-0x0;var _0x5a639b=_0xdbe1[_0x136e72];return _0x5a639b;};'use strict';var _=require(_0x1dbe('0x0'));var moment=require('moment');var Redis=require(_0x1dbe('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x1dbe('0x2'));config[_0x1dbe('0x3')]=_['defaults'](config[_0x1dbe('0x3')],{'host':_0x1dbe('0x4'),'port':0x18eb});var io=require(_0x1dbe('0x5'))(new Redis(config['redis']));function closeInteractions(){var _0x95292d=0x0;var _0x3c812b=[];return db[_0x1dbe('0x6')][_0x1dbe('0x7')]({'raw':!![],'attributes':['id',_0x1dbe('0x8')],'where':{'id':0x1}})[_0x1dbe('0x9')](function(_0x40ce7e){_0x95292d=_0x40ce7e[_0x1dbe('0x8')];if(_0x95292d){return db[_0x1dbe('0xa')][_0x1dbe('0xb')]({'raw':!![],'attributes':['id',_0x1dbe('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1dbe('0xd')](_0x40ce7e[_0x1dbe('0x8')],_0x1dbe('0xe'))}}});}else{return[];}})[_0x1dbe('0x9')](function(_0x380ff0){_0x3c812b=_0x380ff0;if(_0x95292d){return db['ChatInteraction'][_0x1dbe('0xf')]({'closeReason':_0x1dbe('0x10'),'disposition':_0x1dbe('0x11'),'closed':!![],'closedAt':moment()[_0x1dbe('0x12')](_0x1dbe('0x13'))},{'where':{'id':_[_0x1dbe('0x14')](_0x3c812b||[],'id')}});}})['then'](function(_0x46eab8){for(var _0x451167=0x0;_0x451167<_0x3c812b[_0x1dbe('0x15')];_0x451167++){io[_0x1dbe('0x16')](_0x1dbe('0x17'),{'id':_0x3c812b[_0x451167]['id'],'closed':!![]});}})[_0x1dbe('0x18')](function(_0x3e2a75){console[_0x1dbe('0x19')](_0x3e2a75);});}exports[_0x1dbe('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x8db0=['redis','Setting','chatTimeout','then','ChatInteraction','subtract','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','error','start','lodash','moment','../../mysqldb','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8db0,0x65));var _0x08db=function(_0x5c811c,_0x313b25){_0x5c811c=_0x5c811c-0x0;var _0x5df3af=_0x8db0[_0x5c811c];return _0x5df3af;};'use strict';var _=require(_0x08db('0x0'));var moment=require(_0x08db('0x1'));var Redis=require('ioredis');var db=require(_0x08db('0x2'))['db'];var config=require(_0x08db('0x3'));config[_0x08db('0x4')]=_['defaults'](config[_0x08db('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x218333=0x0;var _0x55af6b=[];return db[_0x08db('0x5')]['find']({'raw':!![],'attributes':['id',_0x08db('0x6')],'where':{'id':0x1}})[_0x08db('0x7')](function(_0x16bcc0){_0x218333=_0x16bcc0[_0x08db('0x6')];if(_0x218333){return db[_0x08db('0x8')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x08db('0x9')](_0x16bcc0[_0x08db('0x6')],_0x08db('0xa'))}}});}else{return[];}})[_0x08db('0x7')](function(_0x2e3dc1){_0x55af6b=_0x2e3dc1;if(_0x218333){return db[_0x08db('0x8')][_0x08db('0xb')]({'closeReason':_0x08db('0xc'),'disposition':_0x08db('0xd'),'closed':!![],'closedAt':moment()[_0x08db('0xe')](_0x08db('0xf'))},{'where':{'id':_[_0x08db('0x10')](_0x55af6b||[],'id')}});}})[_0x08db('0x7')](function(_0xabd571){for(var _0x16e377=0x0;_0x16e377<_0x55af6b[_0x08db('0x11')];_0x16e377++){io[_0x08db('0x12')]('chatInteraction:update',{'id':_0x55af6b[_0x16e377]['id'],'closed':!![]});}})['catch'](function(_0x541875){console[_0x08db('0x13')](_0x541875);});}exports[_0x08db('0x14')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 06572e9..e4fe516 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 _0xa3ce=['empty\x20file,\x20email\x20not\x20sent','request','error','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','length','exists','stop','deleteJob','delete\x20cron','my\x20id','run\x20job','cron','active','isBetween','startAt','endAt','add\x20cron','stop\x20cron','update','update\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','Smtp','service','host','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a'];(function(_0x1385dc,_0x2c7fd7){var _0x2f6469=function(_0x47ed8a){while(--_0x47ed8a){_0x1385dc['push'](_0x1385dc['shift']());}};_0x2f6469(++_0x2c7fd7);}(_0xa3ce,0xe4));var _0xea3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa3ce[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require(_0xea3c('0x0'));var path=require(_0xea3c('0x1'));var _=require(_0xea3c('0x2'));var moment=require(_0xea3c('0x3'));var CronJobManager=require(_0xea3c('0x4'));var jayson=require(_0xea3c('0x5'));var BPromise=require(_0xea3c('0x6'));var logger=require(_0xea3c('0x7'))('schedule');var db=require(_0xea3c('0x8'))['db'];var analyticCustomReportController=require(_0xea3c('0x9'));var analyticDefaultReportController=require(_0xea3c('0xa'));var client=jayson[_0xea3c('0xb')][_0xea3c('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3a494c,_0x4aea6e){return function(){logger[_0xea3c('0xd')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x3a494c[_0xea3c('0xe')]);var _0x1b4d24=!![];var _0x52dd26={'tls':{'rejectUnauthorized':![]}};if(_0x3a494c[_0xea3c('0xf')][_0xea3c('0x10')][_0xea3c('0x11')]){_0x52dd26[_0xea3c('0x11')]=_0x3a494c['MailAccount'][_0xea3c('0x10')][_0xea3c('0x11')];}else{_0x52dd26[_0xea3c('0x12')]=_0x3a494c[_0xea3c('0xf')][_0xea3c('0x10')]['host'];_0x52dd26['port']=_0x3a494c[_0xea3c('0xf')][_0xea3c('0x10')]['port'];_0x52dd26['secure']=_0x3a494c[_0xea3c('0xf')][_0xea3c('0x10')][_0xea3c('0x13')];}if(_0x3a494c[_0xea3c('0xf')]['Smtp'][_0xea3c('0x14')]){_0x52dd26[_0xea3c('0x15')]={'user':_0x3a494c['MailAccount'][_0xea3c('0x10')][_0xea3c('0x16')],'pass':_0x3a494c[_0xea3c('0xf')][_0xea3c('0x10')][_0xea3c('0x17')]};}var _0xa5842d={'account':_0x52dd26,'message':{'from':util[_0xea3c('0x18')](_0xea3c('0x19'),_0x3a494c[_0xea3c('0xf')][_0xea3c('0x1a')],_0x3a494c[_0xea3c('0xf')]['email']||_0x3a494c[_0xea3c('0xf')][_0xea3c('0x10')][_0xea3c('0x16')]),'to':_0x3a494c['email'],'cc':_0x3a494c['cc'],'bcc':_0x3a494c[_0xea3c('0x1b')],'subject':util[_0xea3c('0x18')]('Report\x20%s\x20last\x20%s\x20%s',_0x4aea6e[_0xea3c('0x1a')],_0x3a494c[_0xea3c('0x1c')],_0x3a494c[_0xea3c('0x1d')])}};var _0xb6847d=path[_0xea3c('0x1e')](__dirname,'../../files/reports');var _0x4d0aa2=_0x4aea6e[_0xea3c('0x1f')];var _0x331dc2=util[_0xea3c('0x18')](_0xea3c('0x20'),path[_0xea3c('0x21')](_0x4aea6e[_0xea3c('0x1f')],path[_0xea3c('0x22')](_0x4aea6e[_0xea3c('0x1f')])),_0xea3c('0x23'));var _0x3fc99c=path[_0xea3c('0x1e')](_0xb6847d,_0x4d0aa2);var _0x1d6f1f=path['join'](_0xb6847d,_0x331dc2);if(fs[_0xea3c('0x24')](_0x3fc99c)){_0x4aea6e[_0xea3c('0x25')]=_0xea3c('0x26');_0xa5842d[_0xea3c('0x27')][_0xea3c('0x28')]=[{'filename':_0x4d0aa2,'path':_0x3fc99c}];_0xa5842d[_0xea3c('0x27')][_0xea3c('0x29')]=util['format'](_0xea3c('0x2a'),JSON[_0xea3c('0x2b')](_0x4aea6e,null,0x2));}else if(fs[_0xea3c('0x24')](_0x1d6f1f)){_0x4aea6e[_0xea3c('0x25')]='Sent';_0xa5842d[_0xea3c('0x27')][_0xea3c('0x28')]=[{'filename':_0x331dc2,'path':_0x1d6f1f}];}else{_0xa5842d['message'][_0xea3c('0x29')]=_0xea3c('0x2c');if(!_0x3a494c['sendIfEmpty']){_0x1b4d24=![];logger[_0xea3c('0xd')](_0xea3c('0x2d'));}}if(_0x1b4d24){return client[_0xea3c('0x2e')]('SendMail',_0xa5842d)['then'](function(_0x48d416){if(_0x48d416['error']){return logger[_0xea3c('0x2f')](_0xea3c('0x30'),JSON[_0xea3c('0x2b')](_0x48d416));}return logger[_0xea3c('0xd')]('email\x20sent');})['catch'](function(_0x58955c){return logger[_0xea3c('0x2f')](_0xea3c('0x30'),JSON[_0xea3c('0x2b')](_0x58955c));});}};}function handleError(){return function(_0x562fc5){return logger[_0xea3c('0x2f')](JSON['stringify'](_0x562fc5));};}function handleResult(_0x38036f){return function(_0x5583b4){logger[_0xea3c('0xd')](_0xea3c('0x31'),JSON[_0xea3c('0x2b')](_0x5583b4));if(_0x38036f['MailAccount']&&_0x38036f[_0xea3c('0xf')][_0xea3c('0x10')]&&!_[_0xea3c('0x32')](_0x38036f[_0xea3c('0xe')])){setTimeout(handleSendEmail(_0x38036f,_0x5583b4),0x3c*0x3e8);}};}function handleJob(_0x3ec381){return function(){try{if(_[_0xea3c('0x32')](_0x3ec381['subtractNumber'])){return logger[_0xea3c('0xd')](_0xea3c('0x33'));}if(_[_0xea3c('0x32')](_0x3ec381[_0xea3c('0x1d')])){return logger[_0xea3c('0xd')](_0xea3c('0x34'));}var _0x307278={'startDate':moment()[_0xea3c('0x35')](_0x3ec381[_0xea3c('0x1c')],_0x3ec381['subtractUnit'])[_0xea3c('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xea3c('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xea3c('0x36'),'output':_0x3ec381[_0xea3c('0x37')],'name':_0x3ec381[_0xea3c('0x1a')]};if(!_[_0xea3c('0x32')](_0x3ec381[_0xea3c('0x38')])){logger['info'](_0xea3c('0x39'),_0x3ec381['DefaultReportId']);return analyticDefaultReportController[_0xea3c('0x3a')]({'id':_0x3ec381[_0xea3c('0x38')]},_0x307278)[_0xea3c('0x3b')](handleResult(_0x3ec381))[_0xea3c('0x3c')](handleError());}if(!_[_0xea3c('0x32')](_0x3ec381['CustomReportId'])){logger[_0xea3c('0xd')](_0xea3c('0x3d'),_0x3ec381[_0xea3c('0x3e')]);return analyticCustomReportController[_0xea3c('0x3a')]({'id':_0x3ec381[_0xea3c('0x3e')]},_0x307278)[_0xea3c('0x3b')](handleResult(_0x3ec381))[_0xea3c('0x3c')](handleError());}}catch(_0x46bd1d){logger[_0xea3c('0x2f')](JSON['stringify'](_0x46bd1d));}return logger[_0xea3c('0xd')](_0xea3c('0x3f'));};}function getJobs(_0x5bf587){var _0x2b5484={};if(_0x5bf587){_0x2b5484['id']=_0x5bf587;}return db[_0xea3c('0x40')][_0xea3c('0x41')]({'where':_0x2b5484,'include':[{'model':db[_0xea3c('0xf')],'attributes':['id',_0xea3c('0x1a'),_0xea3c('0xe')],'include':[{'model':db[_0xea3c('0x42')],'as':'Smtp'}]}]})[_0xea3c('0x3b')](function(_0x1f5da4){var _0x236fbe=_[_0xea3c('0x43')](manager[_0xea3c('0x44')]);var _0x45072a=_[_0xea3c('0x45')](_0x1f5da4,function(_0x480ae2){return _0x480ae2['id'][_0xea3c('0x46')]();});var _0x53086a=_[_0xea3c('0x47')](_0x1f5da4,function(_0x33d0c3){return _0x33d0c3['id']['toString']();});var _0xae3885=_0x5bf587?_0x45072a:_['difference'](_0x45072a,_0x236fbe);var _0x465c84=_['intersection'](_0x45072a,_0x236fbe);var _0x5d4378=_[_0xea3c('0x48')](_0x236fbe,_0x45072a);var _0x4e9d03;var _0x595fa7;for(_0x4e9d03=0x0;_0x4e9d03<_0x5d4378[_0xea3c('0x49')]&&!_0x5bf587;_0x4e9d03+=0x1){_0x595fa7=_0x5d4378[_0x4e9d03][_0xea3c('0x46')]();if(manager[_0xea3c('0x4a')](_0x595fa7)){manager[_0xea3c('0x4b')](_0x595fa7);manager[_0xea3c('0x4c')](_0x595fa7);logger[_0xea3c('0xd')](_0xea3c('0x4d'),_0x595fa7);}}logger[_0xea3c('0xd')]('toRun',JSON[_0xea3c('0x2b')](_0xae3885));for(_0x4e9d03=0x0;_0x4e9d03<_0xae3885[_0xea3c('0x49')];_0x4e9d03+=0x1){_0x595fa7=_0xae3885[_0x4e9d03][_0xea3c('0x46')]();logger[_0xea3c('0xd')]('index',_0x595fa7);if(_0x5bf587){logger[_0xea3c('0xd')](_0xea3c('0x4e'),_0x5bf587);logger[_0xea3c('0xd')](JSON[_0xea3c('0x2b')](_0x53086a[_0x595fa7]));BPromise['resolve']()[_0xea3c('0x3b')](handleJob(_0x53086a[_0x595fa7]));logger[_0xea3c('0xd')](_0xea3c('0x4f'),_0x53086a[_0x595fa7][_0xea3c('0x1a')],_0x53086a[_0x595fa7][_0xea3c('0x50')]);}else if(_0x53086a[_0x595fa7][_0xea3c('0x50')]&&_0x53086a[_0x595fa7][_0xea3c('0x51')]&&moment()[_0xea3c('0x52')](_0x53086a[_0x595fa7][_0xea3c('0x53')],_0x53086a[_0x595fa7][_0xea3c('0x54')])){manager['add'](_0x595fa7,_0x53086a[_0x595fa7][_0xea3c('0x50')],handleJob(_0x53086a[_0x595fa7]));manager['start'](_0x595fa7);logger[_0xea3c('0xd')](_0xea3c('0x55'),_0x53086a[_0x595fa7][_0xea3c('0x1a')],_0x53086a[_0x595fa7][_0xea3c('0x50')]);}else if(manager[_0xea3c('0x4a')](_0x595fa7)){manager[_0xea3c('0x4b')](_0x595fa7);manager['deleteJob'](_0x595fa7);logger[_0xea3c('0xd')](_0xea3c('0x56'),_0x53086a[_0x595fa7][_0xea3c('0x1a')],_0x53086a[_0x595fa7][_0xea3c('0x50')]);}}for(_0x4e9d03=0x0,_0x595fa7;_0x4e9d03<_0x465c84[_0xea3c('0x49')]&&!_0x5bf587;_0x4e9d03+=0x1){_0x595fa7=_0x465c84[_0x4e9d03][_0xea3c('0x46')]();if(manager[_0xea3c('0x4a')](_0x595fa7)){if(_0x53086a[_0x595fa7]['cron']&&_0x53086a[_0x595fa7][_0xea3c('0x51')]&&moment()[_0xea3c('0x52')](_0x53086a[_0x595fa7]['startAt'],_0x53086a[_0x595fa7][_0xea3c('0x54')])){manager[_0xea3c('0x57')](_0x595fa7,_0x53086a[_0x595fa7]['cron'],handleJob(_0x53086a[_0x595fa7]));logger[_0xea3c('0xd')](_0xea3c('0x58'),_0x53086a[_0x595fa7]['name'],_0x53086a[_0x595fa7]['cron']);}else{manager[_0xea3c('0x4b')](_0x595fa7);manager[_0xea3c('0x4c')](_0x595fa7);logger['info'](_0xea3c('0x56'),_0x53086a[_0x595fa7][_0xea3c('0x1a')],_0x53086a[_0x595fa7][_0xea3c('0x50')]);}}}})['catch'](function(_0x55ed91){logger[_0xea3c('0x2f')](JSON[_0xea3c('0x2b')](_0x55ed91));});}exports[_0xea3c('0x59')]=function(_0x4a322f){return getJobs(_0x4a322f);};exports[_0xea3c('0x5a')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xd2c5=['../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractUnit','join','../../files/reports','savename','%s.%s','basename','zip','existsSync','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','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','info','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','jobs','toString','difference','exists','stop','deleteJob','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger'];(function(_0x3fbd54,_0x36b3f5){var _0xcf1c8=function(_0x29b79c){while(--_0x29b79c){_0x3fbd54['push'](_0x3fbd54['shift']());}};_0xcf1c8(++_0x36b3f5);}(_0xd2c5,0x161));var _0x5d2c=function(_0x32fe9a,_0x394492){_0x32fe9a=_0x32fe9a-0x0;var _0x563f57=_0xd2c5[_0x32fe9a];return _0x563f57;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x5d2c('0x0'));var _=require(_0x5d2c('0x1'));var moment=require(_0x5d2c('0x2'));var CronJobManager=require(_0x5d2c('0x3'));var jayson=require(_0x5d2c('0x4'));var BPromise=require(_0x5d2c('0x5'));var logger=require(_0x5d2c('0x6'))('schedule');var db=require(_0x5d2c('0x7'))['db'];var analyticCustomReportController=require(_0x5d2c('0x8'));var analyticDefaultReportController=require(_0x5d2c('0x9'));var client=jayson[_0x5d2c('0xa')][_0x5d2c('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x26cc54,_0x4fe2fa){return function(){logger['info'](_0x5d2c('0xc'),_0x26cc54[_0x5d2c('0xd')]);var _0x4f9e08=!![];var _0x2cf139={'tls':{'rejectUnauthorized':![]}};if(_0x26cc54[_0x5d2c('0xe')][_0x5d2c('0xf')][_0x5d2c('0x10')]){_0x2cf139[_0x5d2c('0x10')]=_0x26cc54[_0x5d2c('0xe')][_0x5d2c('0xf')][_0x5d2c('0x10')];}else{_0x2cf139[_0x5d2c('0x11')]=_0x26cc54[_0x5d2c('0xe')][_0x5d2c('0xf')]['host'];_0x2cf139[_0x5d2c('0x12')]=_0x26cc54['MailAccount'][_0x5d2c('0xf')][_0x5d2c('0x12')];_0x2cf139[_0x5d2c('0x13')]=_0x26cc54[_0x5d2c('0xe')][_0x5d2c('0xf')][_0x5d2c('0x13')];}if(_0x26cc54[_0x5d2c('0xe')][_0x5d2c('0xf')]['authentication']){_0x2cf139[_0x5d2c('0x14')]={'user':_0x26cc54['MailAccount']['Smtp'][_0x5d2c('0x15')],'pass':_0x26cc54[_0x5d2c('0xe')]['Smtp'][_0x5d2c('0x16')]};}var _0x110e26={'account':_0x2cf139,'message':{'from':util[_0x5d2c('0x17')](_0x5d2c('0x18'),_0x26cc54[_0x5d2c('0xe')]['name'],_0x26cc54[_0x5d2c('0xe')]['email']||_0x26cc54['MailAccount'][_0x5d2c('0xf')]['user']),'to':_0x26cc54[_0x5d2c('0xd')],'cc':_0x26cc54['cc'],'bcc':_0x26cc54[_0x5d2c('0x19')],'subject':util[_0x5d2c('0x17')](_0x5d2c('0x1a'),_0x4fe2fa[_0x5d2c('0x1b')],_0x26cc54['subtractNumber'],_0x26cc54[_0x5d2c('0x1c')])}};var _0x7f6785=path[_0x5d2c('0x1d')](__dirname,_0x5d2c('0x1e'));var _0x269e0f=_0x4fe2fa[_0x5d2c('0x1f')];var _0x5380a9=util[_0x5d2c('0x17')](_0x5d2c('0x20'),path[_0x5d2c('0x21')](_0x4fe2fa[_0x5d2c('0x1f')],path['extname'](_0x4fe2fa[_0x5d2c('0x1f')])),_0x5d2c('0x22'));var _0x502ae0=path[_0x5d2c('0x1d')](_0x7f6785,_0x269e0f);var _0x27a882=path['join'](_0x7f6785,_0x5380a9);if(fs[_0x5d2c('0x23')](_0x502ae0)){_0x4fe2fa[_0x5d2c('0x24')]=_0x5d2c('0x25');_0x110e26['message'][_0x5d2c('0x26')]=[{'filename':_0x269e0f,'path':_0x502ae0}];_0x110e26[_0x5d2c('0x27')][_0x5d2c('0x28')]=util[_0x5d2c('0x17')](_0x5d2c('0x29'),JSON['stringify'](_0x4fe2fa,null,0x2));}else if(fs['existsSync'](_0x27a882)){_0x4fe2fa['status']=_0x5d2c('0x25');_0x110e26[_0x5d2c('0x27')][_0x5d2c('0x26')]=[{'filename':_0x5380a9,'path':_0x27a882}];}else{_0x110e26[_0x5d2c('0x27')][_0x5d2c('0x28')]=_0x5d2c('0x2a');if(!_0x26cc54[_0x5d2c('0x2b')]){_0x4f9e08=![];logger['info'](_0x5d2c('0x2c'));}}if(_0x4f9e08){return client[_0x5d2c('0x2d')](_0x5d2c('0x2e'),_0x110e26)[_0x5d2c('0x2f')](function(_0x59e699){if(_0x59e699[_0x5d2c('0x30')]){return logger['error'](_0x5d2c('0x31'),JSON[_0x5d2c('0x32')](_0x59e699));}return logger[_0x5d2c('0x33')]('email\x20sent');})[_0x5d2c('0x34')](function(_0x1c0876){return logger[_0x5d2c('0x30')]('error\x20mail',JSON['stringify'](_0x1c0876));});}};}function handleError(){return function(_0x17a756){return logger[_0x5d2c('0x30')](JSON[_0x5d2c('0x32')](_0x17a756));};}function handleResult(_0x107e9d){return function(_0x53d025){logger[_0x5d2c('0x33')](_0x5d2c('0x35'),JSON[_0x5d2c('0x32')](_0x53d025));if(_0x107e9d['MailAccount']&&_0x107e9d[_0x5d2c('0xe')][_0x5d2c('0xf')]&&!_['isNil'](_0x107e9d[_0x5d2c('0xd')])){setTimeout(handleSendEmail(_0x107e9d,_0x53d025),0x3c*0x3e8);}};}function handleJob(_0xcd4966){return function(){try{if(_[_0x5d2c('0x36')](_0xcd4966[_0x5d2c('0x37')])){return logger[_0x5d2c('0x33')](_0x5d2c('0x38'));}if(_[_0x5d2c('0x36')](_0xcd4966['subtractUnit'])){return logger[_0x5d2c('0x33')](_0x5d2c('0x39'));}var _0x1e7862={'startDate':moment()[_0x5d2c('0x3a')](_0xcd4966[_0x5d2c('0x37')],_0xcd4966[_0x5d2c('0x1c')])[_0x5d2c('0x17')](_0x5d2c('0x3b')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x5d2c('0x3c'),'output':_0xcd4966[_0x5d2c('0x3d')],'name':_0xcd4966[_0x5d2c('0x1b')]};if(!_[_0x5d2c('0x36')](_0xcd4966[_0x5d2c('0x3e')])){logger[_0x5d2c('0x33')](_0x5d2c('0x3f'),_0xcd4966[_0x5d2c('0x3e')]);return analyticDefaultReportController[_0x5d2c('0x40')]({'id':_0xcd4966[_0x5d2c('0x3e')]},_0x1e7862)[_0x5d2c('0x2f')](handleResult(_0xcd4966))[_0x5d2c('0x34')](handleError());}if(!_[_0x5d2c('0x36')](_0xcd4966[_0x5d2c('0x41')])){logger['info'](_0x5d2c('0x42'),_0xcd4966[_0x5d2c('0x41')]);return analyticCustomReportController[_0x5d2c('0x40')]({'id':_0xcd4966[_0x5d2c('0x41')]},_0x1e7862)[_0x5d2c('0x2f')](handleResult(_0xcd4966))[_0x5d2c('0x34')](handleError());}}catch(_0x3e553d){logger[_0x5d2c('0x30')](JSON[_0x5d2c('0x32')](_0x3e553d));}return logger[_0x5d2c('0x33')]('no\x20report\x20id');};}function getJobs(_0x339323){var _0x5abc6d={};if(_0x339323){_0x5abc6d['id']=_0x339323;}return db['Schedule']['findAll']({'where':_0x5abc6d,'include':[{'model':db['MailAccount'],'attributes':['id',_0x5d2c('0x1b'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x5d2c('0xf')}]}]})[_0x5d2c('0x2f')](function(_0x2216f0){var _0x4155fa=_['keys'](manager[_0x5d2c('0x43')]);var _0x333dcc=_['map'](_0x2216f0,function(_0x5123ed){return _0x5123ed['id'][_0x5d2c('0x44')]();});var _0x27593c=_['keyBy'](_0x2216f0,function(_0xdd3a54){return _0xdd3a54['id'][_0x5d2c('0x44')]();});var _0x1cecd4=_0x339323?_0x333dcc:_[_0x5d2c('0x45')](_0x333dcc,_0x4155fa);var _0x40a3c4=_['intersection'](_0x333dcc,_0x4155fa);var _0x573d03=_['difference'](_0x4155fa,_0x333dcc);var _0x321847;var _0x2892bc;for(_0x321847=0x0;_0x321847<_0x573d03['length']&&!_0x339323;_0x321847+=0x1){_0x2892bc=_0x573d03[_0x321847]['toString']();if(manager[_0x5d2c('0x46')](_0x2892bc)){manager[_0x5d2c('0x47')](_0x2892bc);manager[_0x5d2c('0x48')](_0x2892bc);logger['info']('delete\x20cron',_0x2892bc);}}logger['info'](_0x5d2c('0x49'),JSON['stringify'](_0x1cecd4));for(_0x321847=0x0;_0x321847<_0x1cecd4[_0x5d2c('0x4a')];_0x321847+=0x1){_0x2892bc=_0x1cecd4[_0x321847][_0x5d2c('0x44')]();logger[_0x5d2c('0x33')](_0x5d2c('0x4b'),_0x2892bc);if(_0x339323){logger['info'](_0x5d2c('0x4c'),_0x339323);logger['info'](JSON[_0x5d2c('0x32')](_0x27593c[_0x2892bc]));BPromise[_0x5d2c('0x4d')]()['then'](handleJob(_0x27593c[_0x2892bc]));logger[_0x5d2c('0x33')](_0x5d2c('0x4e'),_0x27593c[_0x2892bc][_0x5d2c('0x1b')],_0x27593c[_0x2892bc]['cron']);}else if(_0x27593c[_0x2892bc][_0x5d2c('0x4f')]&&_0x27593c[_0x2892bc][_0x5d2c('0x50')]&&moment()[_0x5d2c('0x51')](_0x27593c[_0x2892bc][_0x5d2c('0x52')],_0x27593c[_0x2892bc][_0x5d2c('0x53')])){manager[_0x5d2c('0x54')](_0x2892bc,_0x27593c[_0x2892bc]['cron'],handleJob(_0x27593c[_0x2892bc]));manager[_0x5d2c('0x55')](_0x2892bc);logger[_0x5d2c('0x33')](_0x5d2c('0x56'),_0x27593c[_0x2892bc][_0x5d2c('0x1b')],_0x27593c[_0x2892bc][_0x5d2c('0x4f')]);}else if(manager['exists'](_0x2892bc)){manager['stop'](_0x2892bc);manager[_0x5d2c('0x48')](_0x2892bc);logger[_0x5d2c('0x33')](_0x5d2c('0x57'),_0x27593c[_0x2892bc][_0x5d2c('0x1b')],_0x27593c[_0x2892bc]['cron']);}}for(_0x321847=0x0,_0x2892bc;_0x321847<_0x40a3c4[_0x5d2c('0x4a')]&&!_0x339323;_0x321847+=0x1){_0x2892bc=_0x40a3c4[_0x321847][_0x5d2c('0x44')]();if(manager['exists'](_0x2892bc)){if(_0x27593c[_0x2892bc]['cron']&&_0x27593c[_0x2892bc][_0x5d2c('0x50')]&&moment()[_0x5d2c('0x51')](_0x27593c[_0x2892bc]['startAt'],_0x27593c[_0x2892bc][_0x5d2c('0x53')])){manager[_0x5d2c('0x58')](_0x2892bc,_0x27593c[_0x2892bc][_0x5d2c('0x4f')],handleJob(_0x27593c[_0x2892bc]));logger[_0x5d2c('0x33')]('update\x20cron',_0x27593c[_0x2892bc][_0x5d2c('0x1b')],_0x27593c[_0x2892bc][_0x5d2c('0x4f')]);}else{manager[_0x5d2c('0x47')](_0x2892bc);manager[_0x5d2c('0x48')](_0x2892bc);logger[_0x5d2c('0x33')](_0x5d2c('0x57'),_0x27593c[_0x2892bc][_0x5d2c('0x1b')],_0x27593c[_0x2892bc][_0x5d2c('0x4f')]);}}}})[_0x5d2c('0x34')](function(_0x28a2ea){logger[_0x5d2c('0x30')](JSON[_0x5d2c('0x32')](_0x28a2ea));});}exports[_0x5d2c('0x59')]=function(_0x27e164){return getJobs(_0x27e164);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 7a58f9f..3bcb7ea 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5c5=['destroy','then','bulkCreate','log','finished\x20populating','CmHopper','contacts2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb5c5,0xc3));var _0x5b5c=function(_0x5a4f5d,_0x330d13){_0x5a4f5d=_0x5a4f5d-0x0;var _0x51b0f2=_0xb5c5[_0x5a4f5d];return _0x51b0f2;};'use strict';var util=require(_0x5b5c('0x0'));var db=require(_0x5b5c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5b5c('0x2')]({'id':i,'firstName':_0x5b5c('0x3')+i,'lastName':_0x5b5c('0x4')+i,'phone':0xf879fb460+i,'email':_0x5b5c('0x5')+i+_0x5b5c('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5b5c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5b5c('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x5b5c('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5b5c('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5b5c('0x4')+i,'phone':0xf879fb460+i,'email':_0x5b5c('0x5')+i+_0x5b5c('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5b5c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5b5c('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5b5c('0x7')](),'updatedAt':Date['now']()});}db[_0x5b5c('0x8')][_0x5b5c('0x9')]({'where':{}})[_0x5b5c('0xa')](function(){return db[_0x5b5c('0x8')][_0x5b5c('0xb')](contacts);})['then'](function(){console[_0x5b5c('0xc')](_0x5b5c('0xd'),'contacts1');return db[_0x5b5c('0xe')][_0x5b5c('0x9')]({'where':{}});})[_0x5b5c('0xa')](function(){return db[_0x5b5c('0xe')][_0x5b5c('0xb')](hopper);})[_0x5b5c('0xa')](function(){console['log'](_0x5b5c('0xd'),'hopper1');return db[_0x5b5c('0x8')][_0x5b5c('0xb')](contacts2);})[_0x5b5c('0xa')](function(){console[_0x5b5c('0xc')]('finished\x20populating',_0x5b5c('0xf'));return db[_0x5b5c('0xe')][_0x5b5c('0xb')](hopper2);})['then'](function(){console['log'](_0x5b5c('0xd'),'hopper2');})[_0x5b5c('0x10')](function(_0x2b143d){console[_0x5b5c('0xc')](_0x2b143d);}); \ No newline at end of file +var _0x9876=['now','innocenzo.biondo','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','hopper2','catch','push','Innocenzo','@xcally.com'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x9876,0xbd));var _0x6987=function(_0x2fa148,_0x2b4d3a){_0x2fa148=_0x2fa148-0x0;var _0x229450=_0x9876[_0x2fa148];return _0x229450;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6987('0x0')]({'id':i,'firstName':_0x6987('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6987('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6987('0x0')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6987('0x3')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6987('0x0')]({'id':i,'firstName':_0x6987('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x6987('0x4')+i+_0x6987('0x2')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x6987('0x3')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x6987('0x5')][_0x6987('0x6')]({'where':{}})[_0x6987('0x7')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x6987('0x7')](function(){console[_0x6987('0x8')](_0x6987('0x9'),_0x6987('0xa'));return db[_0x6987('0xb')]['destroy']({'where':{}});})['then'](function(){return db['CmHopper'][_0x6987('0xc')](hopper);})['then'](function(){console[_0x6987('0x8')](_0x6987('0x9'),_0x6987('0xd'));return db[_0x6987('0x5')]['bulkCreate'](contacts2);})[_0x6987('0x7')](function(){console[_0x6987('0x8')](_0x6987('0x9'),'contacts2');return db[_0x6987('0xb')][_0x6987('0xc')](hopper2);})[_0x6987('0x7')](function(){console[_0x6987('0x8')](_0x6987('0x9'),_0x6987('0xe'));})[_0x6987('0xf')](function(_0x542739){console[_0x6987('0x8')](_0x542739);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index cbac5e8..a33c1f2 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf979=['wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','%s%s','bulkCreate','then','log','add\x20user','catch','util','push','format','agent','%s%s@xcally.com','password','friend'];(function(_0x593b90,_0x391cd8){var _0xb3290b=function(_0x162222){while(--_0x162222){_0x593b90['push'](_0x593b90['shift']());}};_0xb3290b(++_0x391cd8);}(_0xf979,0xad));var _0x9f97=function(_0x31223d,_0x34a5e2){_0x31223d=_0x31223d-0x0;var _0x19a7ff=_0xf979[_0x31223d];return _0x19a7ff;};'use strict';var util=require(_0x9f97('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9f97('0x1')]({'name':util[_0x9f97('0x2')]('%s%s','agent',i),'fullname':util[_0x9f97('0x2')]('%s%s',_0x9f97('0x3'),i),'email':util[_0x9f97('0x2')](_0x9f97('0x4'),_0x9f97('0x3'),i),'role':'agent','password':_0x9f97('0x5'),'internal':0xfa0+i,'type':_0x9f97('0x6'),'transport':['udp','ws',_0x9f97('0x7')],'disallow':[_0x9f97('0x8')],'allow':[_0x9f97('0x9')],'defaultuser':util[_0x9f97('0x2')]('%s%s',_0x9f97('0x3'),i),'encryption':_0x9f97('0xa'),'avpf':_0x9f97('0xa'),'force_avp':'yes','icesupport':_0x9f97('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x9f97('0xb'),'dtlsprivatekey':_0x9f97('0xc'),'dtlssetup':'actpass','callerid':util['format'](_0x9f97('0xd'),util['format'](_0x9f97('0xe'),_0x9f97('0x3'),i),0xfa0+i)});}db['User'][_0x9f97('0xf')](users)[_0x9f97('0x10')](function(){console[_0x9f97('0x11')](_0x9f97('0x12'));})[_0x9f97('0x13')](function(_0x16093e){console[_0x9f97('0x11')](_0x16093e);}); \ No newline at end of file +var _0xf687=['actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xf687,0x10e));var _0x7f68=function(_0x2e71c4,_0x3be1f3){_0x2e71c4=_0x2e71c4-0x0;var _0x17443f=_0xf687[_0x2e71c4];return _0x17443f;};'use strict';var util=require(_0x7f68('0x0'));var db=require(_0x7f68('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7f68('0x2')]({'name':util[_0x7f68('0x3')](_0x7f68('0x4'),'agent',i),'fullname':util[_0x7f68('0x3')](_0x7f68('0x4'),_0x7f68('0x5'),i),'email':util[_0x7f68('0x3')](_0x7f68('0x6'),_0x7f68('0x5'),i),'role':_0x7f68('0x5'),'password':_0x7f68('0x7'),'internal':0xfa0+i,'type':_0x7f68('0x8'),'transport':[_0x7f68('0x9'),'ws',_0x7f68('0xa')],'disallow':[_0x7f68('0xb')],'allow':[_0x7f68('0xc')],'defaultuser':util[_0x7f68('0x3')](_0x7f68('0x4'),_0x7f68('0x5'),i),'encryption':_0x7f68('0xd'),'avpf':_0x7f68('0xd'),'force_avp':_0x7f68('0xd'),'icesupport':_0x7f68('0xd'),'dtlsenable':_0x7f68('0xd'),'dtlsverify':'no','dtlscertfile':_0x7f68('0xe'),'dtlsprivatekey':_0x7f68('0xf'),'dtlssetup':_0x7f68('0x10'),'callerid':util[_0x7f68('0x3')](_0x7f68('0x11'),util[_0x7f68('0x3')]('%s%s','agent',i),0xfa0+i)});}db[_0x7f68('0x12')][_0x7f68('0x13')](users)[_0x7f68('0x14')](function(){console[_0x7f68('0x15')]('add\x20user');})['catch'](function(_0x540a03){console[_0x7f68('0x15')](_0x540a03);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 73fc688..946c8bc 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3411=['FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','user','Trunks','voice:outbound','getVoiceQueues','getChatQueues','getFaxQueues','getOpenchannelQueues','voice','chat','mail','openchannel','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','map','removeMailInteractions','emit','user_has_mail_interactions:remove','removeSmsInteractions','OpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','default','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','address','disconnect','DISCONNECTED','lodash','util','bluebird','./environment','name','User','role','agent','telephone','type','UserProfileSection','findOne','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','then','where','Campaign','ivr','format','%s:queue:%s','Agents','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x3411,0x141));var _0x1341=function(_0x4e90d9,_0x29ea94){_0x4e90d9=_0x4e90d9-0x0;var _0x5d80c6=_0x3411[_0x4e90d9];return _0x5d80c6;};'use strict';var _=require(_0x1341('0x0'));var util=require(_0x1341('0x1'));var BPromise=require(_0x1341('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x1341('0x3'));var queryQueues={'attributes':['id',_0x1341('0x4')],'include':[{'as':'Agents','model':db[_0x1341('0x5')],'attributes':['id','name',_0x1341('0x6')],'raw':!![],'where':{'role':_0x1341('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1341('0x4')],'where':{'role':_0x1341('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x1341('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x1341('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x1d6f5b,_0x3ac9bb,_0x2282d7){return db[_0x1341('0xa')][_0x1341('0xb')]({'where':{'name':_0x1d6f5b,'userProfileId':_0x3ac9bb},'raw':!![]})['then'](function(_0x1465a6){if(_0x1465a6){if(_0x1465a6[_0x1341('0xc')]){switch(_0x1d6f5b){case'VoiceQueues':case _0x1341('0xd'):case _0x1341('0xe'):case _0x1341('0xf'):case _0x1341('0x10'):case _0x1341('0x11'):return db[_0x2282d7][_0x1341('0x12')](queryQueues);case _0x1341('0x13'):return db[_0x2282d7][_0x1341('0x12')](queryTelephones);case'Trunks':return db[_0x2282d7][_0x1341('0x12')](queryTrunks);case _0x1341('0x14'):return db[_0x2282d7][_0x1341('0x12')](queryCampaigns);}}else{return db[_0x1341('0x15')][_0x1341('0x12')]({'attributes':[_0x1341('0x16')],'where':{'sectionId':_0x1465a6['id']},'raw':!![]})[_0x1341('0x17')](function(_0xf1da88){if(_0xf1da88){var _0x20230c={'where':{'id':_['map'](_0xf1da88,_0x1341('0x16'))},'raw':!![]};switch(_0x2282d7){case _0x1341('0x5'):_0x20230c[_0x1341('0x18')][_0x1341('0x6')]=_0x1341('0x8');break;case _0x1341('0x19'):_0x20230c['where'][_0x1341('0x9')]=_0x1341('0x1a');break;}return db[_0x2282d7][_0x1341('0x12')](_0x20230c);}else{return[];}});}}else{return[];}})[_0x1341('0x17')](function(_0x13f1db){return _0x13f1db;});}function joinOrLeaveQueues(_0x45c6bd,_0x24b8c2,_0x128539,_0x535900){_0x45c6bd[_0x24b8c2](util[_0x1341('0x1b')](_0x1341('0x1c'),_0x128539,_0x535900[_0x1341('0x4')]));if(_0x535900[_0x1341('0x1d')]){for(var _0x4c2bf1=0x0;_0x4c2bf1<_0x535900[_0x1341('0x1d')][_0x1341('0x1e')];_0x4c2bf1+=0x1){_0x45c6bd[_0x24b8c2](util['format'](_0x1341('0x1f'),_0x535900[_0x1341('0x1d')][_0x4c2bf1]['name']));}}}function joinOrLeave(_0xb3a426,_0x3e7f46,_0x7812de){var _0x1c0782;if(_0xb3a426[_0x1341('0x20')][_0x1341('0x21')]['id']){db['User']['find']({'attributes':['id',_0x1341('0x4'),_0x1341('0x6'),_0x1341('0x22')],'where':{'id':_0xb3a426[_0x1341('0x20')][_0x1341('0x21')]['id']},'include':[{'model':db[_0x1341('0x23')],'as':_0x1341('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x1341('0x25')],'as':_0x1341('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x1341('0x27')],'as':_0x1341('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x1341('0x29')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1341('0x2a')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0x1341('0x17')](function(_0x13372a){if(_0x13372a){_0x1c0782=_0x13372a;_0xb3a426[_0x3e7f46](util[_0x1341('0x1b')](_0x1341('0x1f'),_0x13372a[_0x1341('0x4')]));var _0x16eded=[];switch(_0x13372a['role']){case _0x1341('0x2b'):_0xb3a426[_0x3e7f46](_0x1341('0x2c'));_0xb3a426[_0x3e7f46]('voice:outbound');if(queryQueues[_0x1341('0x2d')](_0x1341('0x2e'))){delete queryQueues[_0x1341('0x2e')];}_0x16eded[_0x1341('0x2f')](db[_0x1341('0x30')][_0x1341('0x12')](queryQueues));_0x16eded['push'](db[_0x1341('0x31')]['findAll'](queryQueues));_0x16eded[_0x1341('0x2f')](db[_0x1341('0x32')][_0x1341('0x12')](queryQueues));_0x16eded['push'](db[_0x1341('0x33')][_0x1341('0x12')](queryQueues));_0x16eded['push'](db['MailQueue'][_0x1341('0x12')](queryQueues));_0x16eded[_0x1341('0x2f')](db[_0x1341('0x34')][_0x1341('0x12')](queryQueues));_0x16eded[_0x1341('0x2f')](db['User'][_0x1341('0x12')](queryTelephones));_0x16eded['push'](db[_0x1341('0x35')][_0x1341('0x12')](queryTrunks));_0x16eded['push'](db['Campaign'][_0x1341('0x12')](queryCampaigns));_0x16eded[_0x1341('0x2f')](db[_0x1341('0x5')]['findAll'](queryAgents));break;case _0x1341('0x36'):_0xb3a426[_0x3e7f46](_0x1341('0x2c'));_0xb3a426[_0x3e7f46]('voice:outbound');_0x16eded[_0x1341('0x2f')](getAssociatedResources('VoiceQueues',_0x13372a['userProfileId'],_0x1341('0x30')));_0x16eded[_0x1341('0x2f')](getAssociatedResources(_0x1341('0xd'),_0x13372a[_0x1341('0x22')],'ChatQueue'));_0x16eded[_0x1341('0x2f')](getAssociatedResources('FaxQueues',_0x13372a[_0x1341('0x22')],'FaxQueue'));_0x16eded[_0x1341('0x2f')](getAssociatedResources(_0x1341('0xf'),_0x13372a[_0x1341('0x22')],'SmsQueue'));_0x16eded[_0x1341('0x2f')](getAssociatedResources(_0x1341('0x10'),_0x13372a['userProfileId'],'MailQueue'));_0x16eded[_0x1341('0x2f')](getAssociatedResources(_0x1341('0x11'),_0x13372a['userProfileId'],'OpenchannelQueue'));_0x16eded['push'](getAssociatedResources('Telephones',_0x13372a[_0x1341('0x22')],'User'));_0x16eded[_0x1341('0x2f')](getAssociatedResources(_0x1341('0x37'),_0x13372a['userProfileId'],_0x1341('0x35')));_0x16eded[_0x1341('0x2f')](getAssociatedResources('IvrCampaigns',_0x13372a[_0x1341('0x22')],'Campaign'));_0x16eded[_0x1341('0x2f')](db[_0x1341('0x5')][_0x1341('0x12')](queryAgents));break;case _0x1341('0x7'):_0xb3a426[_0x3e7f46]('voice:inbound');_0xb3a426[_0x3e7f46](_0x1341('0x38'));_0x16eded['push'](_0x13372a[_0x1341('0x39')]({'attributes':['id',_0x1341('0x4')]}));_0x16eded[_0x1341('0x2f')](_0x13372a[_0x1341('0x3a')]({'attributes':['id','name']}));_0x16eded[_0x1341('0x2f')](_0x13372a[_0x1341('0x3b')]({'attributes':['id',_0x1341('0x4')]}));_0x16eded['push'](_0x13372a['getSmsQueues']({'attributes':['id',_0x1341('0x4')]}));_0x16eded[_0x1341('0x2f')](_0x13372a['getMailQueues']({'attributes':['id','name']}));_0x16eded['push'](_0x13372a[_0x1341('0x3c')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x16eded);}})[_0x1341('0x17')](function(_0x2b656c){if(_0x2b656c&&_0x2b656c[_0x1341('0x1e')]){for(var _0xcb4990=0x0;_0xcb4990<_0x2b656c[_0x1341('0x1e')];_0xcb4990+=0x1){for(var _0x5f351a=0x0;_0x5f351a<_0x2b656c[_0xcb4990][_0x1341('0x1e')];_0x5f351a+=0x1){switch(_0xcb4990){case 0x0:joinOrLeaveQueues(_0xb3a426,_0x3e7f46,_0x1341('0x3d'),_0x2b656c[_0xcb4990][_0x5f351a]);break;case 0x1:joinOrLeaveQueues(_0xb3a426,_0x3e7f46,_0x1341('0x3e'),_0x2b656c[_0xcb4990][_0x5f351a]);break;case 0x2:joinOrLeaveQueues(_0xb3a426,_0x3e7f46,'fax',_0x2b656c[_0xcb4990][_0x5f351a]);break;case 0x3:joinOrLeaveQueues(_0xb3a426,_0x3e7f46,'sms',_0x2b656c[_0xcb4990][_0x5f351a]);break;case 0x4:joinOrLeaveQueues(_0xb3a426,_0x3e7f46,_0x1341('0x3f'),_0x2b656c[_0xcb4990][_0x5f351a]);break;case 0x5:joinOrLeaveQueues(_0xb3a426,_0x3e7f46,_0x1341('0x40'),_0x2b656c[_0xcb4990][_0x5f351a]);break;case 0x6:_0xb3a426[_0x3e7f46](util['format']('telephone:%s',_0x2b656c[_0xcb4990][_0x5f351a][_0x1341('0x4')]));break;case 0x7:_0xb3a426[_0x3e7f46](util[_0x1341('0x1b')](_0x1341('0x41'),_0x2b656c[_0xcb4990][_0x5f351a][_0x1341('0x4')]));break;case 0x8:_0xb3a426[_0x3e7f46](util[_0x1341('0x1b')](_0x1341('0x42'),_0x2b656c[_0xcb4990][_0x5f351a][_0x1341('0x9')],_0x2b656c[_0xcb4990][_0x5f351a][_0x1341('0x4')]));break;case 0x9:_0xb3a426[_0x3e7f46](util['format'](_0x1341('0x1f'),_0x2b656c[_0xcb4990][_0x5f351a]['name']));break;}}}}})[_0x1341('0x17')](function(){if(_0x3e7f46===_0x1341('0x43')){var _0x4de92f=_['map'](_0x1c0782[_0x1341('0x24')],'id');return _0x1c0782[_0x1341('0x44')](_0x4de92f)['then'](function(){for(var _0x33fb4b=0x0;_0x33fb4b<_0x4de92f[_0x1341('0x1e')];_0x33fb4b+=0x1){_0x7812de['emit'](_0x1341('0x45'),{'ChatInteractionId':Number(_0x4de92f[_0x33fb4b]),'UserId':Number(_0x1c0782['id'])});}});}})[_0x1341('0x17')](function(){if(_0x3e7f46===_0x1341('0x43')){var _0x18fec9=_[_0x1341('0x46')](_0x1c0782[_0x1341('0x26')],'id');return _0x1c0782[_0x1341('0x47')](_0x18fec9)[_0x1341('0x17')](function(){for(var _0x5da560=0x0;_0x5da560<_0x18fec9['length'];_0x5da560+=0x1){_0x7812de[_0x1341('0x48')](_0x1341('0x49'),{'MailInteractionId':Number(_0x18fec9[_0x5da560]),'UserId':Number(_0x1c0782['id'])});}});}})[_0x1341('0x17')](function(){if(_0x3e7f46===_0x1341('0x43')){var _0x4e52b9=_[_0x1341('0x46')](_0x1c0782[_0x1341('0x28')],'id');return _0x1c0782['removeFaxInteractions'](_0x4e52b9)['then'](function(){for(var _0x30bd04=0x0;_0x30bd04<_0x4e52b9['length'];_0x30bd04+=0x1){_0x7812de[_0x1341('0x48')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4e52b9[_0x30bd04]),'UserId':Number(_0x1c0782['id'])});}});}})[_0x1341('0x17')](function(){if(_0x3e7f46===_0x1341('0x43')){var _0x4477f4=_[_0x1341('0x46')](_0x1c0782['SmsInteractions'],'id');return _0x1c0782[_0x1341('0x4a')](_0x4477f4)[_0x1341('0x17')](function(){for(var _0x242a77=0x0;_0x242a77<_0x4477f4[_0x1341('0x1e')];_0x242a77+=0x1){_0x7812de[_0x1341('0x48')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x4477f4[_0x242a77]),'UserId':Number(_0x1c0782['id'])});}});}})[_0x1341('0x17')](function(){if(_0x3e7f46===_0x1341('0x43')){var _0x45bc1c=_[_0x1341('0x46')](_0x1c0782[_0x1341('0x4b')],'id');return _0x1c0782['removeOpenchannelInteractions'](_0x45bc1c)[_0x1341('0x17')](function(){for(var _0x116b5b=0x0;_0x116b5b<_0x45bc1c[_0x1341('0x1e')];_0x116b5b+=0x1){_0x7812de[_0x1341('0x48')](_0x1341('0x4c'),{'OpenchannelInteractionId':Number(_0x45bc1c[_0x116b5b]),'UserId':Number(_0x1c0782['id'])});}});}})[_0x1341('0x4d')](function(_0x124209){_0xb3a426[_0x1341('0x4e')](_0x124209);});}}function onDisconnect(_0x474f27,_0x3608b1){joinOrLeave(_0x474f27,_0x1341('0x43'),_0x3608b1);}function onConnect(_0x48f3c1){joinOrLeave(_0x48f3c1,'join');}exports[_0x1341('0x4f')]=function(_0x1031a1){_0x1031a1['on'](_0x1341('0x50'),function(_0x40156b){_0x40156b[_0x1341('0x51')](0x0);_0x40156b['address']=_0x40156b[_0x1341('0x52')]['connection'][_0x1341('0x53')]+':'+_0x40156b['request'][_0x1341('0x50')][_0x1341('0x54')];_0x40156b[_0x1341('0x55')]=new Date();_0x40156b[_0x1341('0x4e')]=function(_0x557740){console[_0x1341('0x4e')](_0x1341('0x56')+_0x40156b['nsp'][_0x1341('0x4')]+'['+_0x40156b[_0x1341('0x57')]+']',_0x557740);};_0x40156b['on'](_0x1341('0x58'),function(){onDisconnect(_0x40156b,_0x1031a1);_0x40156b['log'](_0x1341('0x59'));});onConnect(_0x40156b);_0x40156b[_0x1341('0x4e')]('CONNECTED');});}; \ No newline at end of file +var _0xf96b=['join','default','connection','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','name','User','role','agent','ivr','findOne','then','autoAssociation','FaxQueues','MailQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','type','format','Agents','length','user:%s','query','userProfileId','handshake','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','OpenchannelQueue','user','VoiceQueues','SmsQueues','SmsQueue','Telephones','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','voice','fax','openchannel','telephone:%s','campaign:%s:%s','leave','ChatInteractions','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','catch'];(function(_0x37e70c,_0x2095b8){var _0x432150=function(_0x146a24){while(--_0x146a24){_0x37e70c['push'](_0x37e70c['shift']());}};_0x432150(++_0x2095b8);}(_0xf96b,0xc4));var _0xbf96=function(_0x430058,_0x5dd37c){_0x430058=_0x430058-0x0;var _0x24eada=_0xf96b[_0x430058];return _0x24eada;};'use strict';var _=require(_0xbf96('0x0'));var util=require(_0xbf96('0x1'));var BPromise=require(_0xbf96('0x2'));var db=require(_0xbf96('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xbf96('0x4')],'include':[{'as':'Agents','model':db[_0xbf96('0x5')],'attributes':['id',_0xbf96('0x4'),_0xbf96('0x6')],'raw':!![],'where':{'role':_0xbf96('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xbf96('0x4')],'where':{'role':_0xbf96('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xbf96('0x4'),'type'],'where':{'type':_0xbf96('0x8')}};function getAssociatedResources(_0x14bdf3,_0x1f97c0,_0x5e2bfb){return db['UserProfileSection'][_0xbf96('0x9')]({'where':{'name':_0x14bdf3,'userProfileId':_0x1f97c0},'raw':!![]})[_0xbf96('0xa')](function(_0x2df3e6){if(_0x2df3e6){if(_0x2df3e6[_0xbf96('0xb')]){switch(_0x14bdf3){case'VoiceQueues':case'ChatQueues':case _0xbf96('0xc'):case'SmsQueues':case _0xbf96('0xd'):case _0xbf96('0xe'):return db[_0x5e2bfb][_0xbf96('0xf')](queryQueues);case'Telephones':return db[_0x5e2bfb][_0xbf96('0xf')](queryTelephones);case _0xbf96('0x10'):return db[_0x5e2bfb][_0xbf96('0xf')](queryTrunks);case _0xbf96('0x11'):return db[_0x5e2bfb][_0xbf96('0xf')](queryCampaigns);}}else{return db[_0xbf96('0x12')][_0xbf96('0xf')]({'attributes':[_0xbf96('0x13')],'where':{'sectionId':_0x2df3e6['id']},'raw':!![]})[_0xbf96('0xa')](function(_0x5a9819){if(_0x5a9819){var _0x441b90={'where':{'id':_[_0xbf96('0x14')](_0x5a9819,'resourceId')},'raw':!![]};switch(_0x5e2bfb){case _0xbf96('0x5'):_0x441b90[_0xbf96('0x15')][_0xbf96('0x6')]='telephone';break;case _0xbf96('0x16'):_0x441b90[_0xbf96('0x15')][_0xbf96('0x17')]='ivr';break;}return db[_0x5e2bfb][_0xbf96('0xf')](_0x441b90);}else{return[];}});}}else{return[];}})['then'](function(_0x2cb0fb){return _0x2cb0fb;});}function joinOrLeaveQueues(_0x2b887c,_0x51f665,_0x28f9f,_0x389aa8){_0x2b887c[_0x51f665](util[_0xbf96('0x18')]('%s:queue:%s',_0x28f9f,_0x389aa8['name']));if(_0x389aa8[_0xbf96('0x19')]){for(var _0x3d886a=0x0;_0x3d886a<_0x389aa8[_0xbf96('0x19')][_0xbf96('0x1a')];_0x3d886a+=0x1){_0x2b887c[_0x51f665](util[_0xbf96('0x18')](_0xbf96('0x1b'),_0x389aa8[_0xbf96('0x19')][_0x3d886a][_0xbf96('0x4')]));}}}function joinOrLeave(_0x26976d,_0x547c97,_0x1896b0){var _0x531b78;if(_0x26976d['handshake'][_0xbf96('0x1c')]['id']){db[_0xbf96('0x5')]['find']({'attributes':['id',_0xbf96('0x4'),_0xbf96('0x6'),_0xbf96('0x1d')],'where':{'id':_0x26976d[_0xbf96('0x1e')][_0xbf96('0x1c')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xbf96('0x1f')],'as':_0xbf96('0x20'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xbf96('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xbf96('0x22')],'as':_0xbf96('0x23'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xbf96('0x24'),'attributes':['id'],'raw':!![]}]})[_0xbf96('0xa')](function(_0x2625bf){if(_0x2625bf){_0x531b78=_0x2625bf;_0x26976d[_0x547c97](util['format'](_0xbf96('0x1b'),_0x2625bf['name']));var _0x3bc1e6=[];switch(_0x2625bf['role']){case _0xbf96('0x25'):_0x26976d[_0x547c97](_0xbf96('0x26'));_0x26976d[_0x547c97](_0xbf96('0x27'));if(queryQueues[_0xbf96('0x28')](_0xbf96('0x29'))){delete queryQueues[_0xbf96('0x29')];}_0x3bc1e6[_0xbf96('0x2a')](db[_0xbf96('0x2b')][_0xbf96('0xf')](queryQueues));_0x3bc1e6[_0xbf96('0x2a')](db[_0xbf96('0x2c')][_0xbf96('0xf')](queryQueues));_0x3bc1e6['push'](db[_0xbf96('0x2d')][_0xbf96('0xf')](queryQueues));_0x3bc1e6[_0xbf96('0x2a')](db['SmsQueue'][_0xbf96('0xf')](queryQueues));_0x3bc1e6[_0xbf96('0x2a')](db['MailQueue'][_0xbf96('0xf')](queryQueues));_0x3bc1e6['push'](db[_0xbf96('0x2e')]['findAll'](queryQueues));_0x3bc1e6[_0xbf96('0x2a')](db[_0xbf96('0x5')]['findAll'](queryTelephones));_0x3bc1e6[_0xbf96('0x2a')](db['Trunk'][_0xbf96('0xf')](queryTrunks));_0x3bc1e6[_0xbf96('0x2a')](db[_0xbf96('0x16')][_0xbf96('0xf')](queryCampaigns));_0x3bc1e6[_0xbf96('0x2a')](db['User'][_0xbf96('0xf')](queryAgents));break;case _0xbf96('0x2f'):_0x26976d[_0x547c97]('voice:inbound');_0x26976d[_0x547c97](_0xbf96('0x27'));_0x3bc1e6[_0xbf96('0x2a')](getAssociatedResources(_0xbf96('0x30'),_0x2625bf[_0xbf96('0x1d')],_0xbf96('0x2b')));_0x3bc1e6[_0xbf96('0x2a')](getAssociatedResources('ChatQueues',_0x2625bf[_0xbf96('0x1d')],_0xbf96('0x2c')));_0x3bc1e6[_0xbf96('0x2a')](getAssociatedResources(_0xbf96('0xc'),_0x2625bf[_0xbf96('0x1d')],_0xbf96('0x2d')));_0x3bc1e6[_0xbf96('0x2a')](getAssociatedResources(_0xbf96('0x31'),_0x2625bf[_0xbf96('0x1d')],_0xbf96('0x32')));_0x3bc1e6[_0xbf96('0x2a')](getAssociatedResources(_0xbf96('0xd'),_0x2625bf[_0xbf96('0x1d')],'MailQueue'));_0x3bc1e6[_0xbf96('0x2a')](getAssociatedResources(_0xbf96('0xe'),_0x2625bf[_0xbf96('0x1d')],'OpenchannelQueue'));_0x3bc1e6[_0xbf96('0x2a')](getAssociatedResources(_0xbf96('0x33'),_0x2625bf['userProfileId'],_0xbf96('0x5')));_0x3bc1e6[_0xbf96('0x2a')](getAssociatedResources(_0xbf96('0x10'),_0x2625bf[_0xbf96('0x1d')],_0xbf96('0x34')));_0x3bc1e6[_0xbf96('0x2a')](getAssociatedResources(_0xbf96('0x11'),_0x2625bf[_0xbf96('0x1d')],_0xbf96('0x16')));_0x3bc1e6[_0xbf96('0x2a')](db[_0xbf96('0x5')]['findAll'](queryAgents));break;case _0xbf96('0x7'):_0x26976d[_0x547c97]('voice:inbound');_0x26976d[_0x547c97](_0xbf96('0x27'));_0x3bc1e6[_0xbf96('0x2a')](_0x2625bf[_0xbf96('0x35')]({'attributes':['id',_0xbf96('0x4')]}));_0x3bc1e6[_0xbf96('0x2a')](_0x2625bf[_0xbf96('0x36')]({'attributes':['id',_0xbf96('0x4')]}));_0x3bc1e6[_0xbf96('0x2a')](_0x2625bf[_0xbf96('0x37')]({'attributes':['id',_0xbf96('0x4')]}));_0x3bc1e6[_0xbf96('0x2a')](_0x2625bf[_0xbf96('0x38')]({'attributes':['id',_0xbf96('0x4')]}));_0x3bc1e6['push'](_0x2625bf['getMailQueues']({'attributes':['id',_0xbf96('0x4')]}));_0x3bc1e6[_0xbf96('0x2a')](_0x2625bf[_0xbf96('0x39')]({'attributes':['id',_0xbf96('0x4')]}));break;}return BPromise[_0xbf96('0x3a')](_0x3bc1e6);}})[_0xbf96('0xa')](function(_0x99464e){if(_0x99464e&&_0x99464e['length']){for(var _0x42b8ad=0x0;_0x42b8ad<_0x99464e[_0xbf96('0x1a')];_0x42b8ad+=0x1){for(var _0x39179d=0x0;_0x39179d<_0x99464e[_0x42b8ad][_0xbf96('0x1a')];_0x39179d+=0x1){switch(_0x42b8ad){case 0x0:joinOrLeaveQueues(_0x26976d,_0x547c97,_0xbf96('0x3b'),_0x99464e[_0x42b8ad][_0x39179d]);break;case 0x1:joinOrLeaveQueues(_0x26976d,_0x547c97,'chat',_0x99464e[_0x42b8ad][_0x39179d]);break;case 0x2:joinOrLeaveQueues(_0x26976d,_0x547c97,_0xbf96('0x3c'),_0x99464e[_0x42b8ad][_0x39179d]);break;case 0x3:joinOrLeaveQueues(_0x26976d,_0x547c97,'sms',_0x99464e[_0x42b8ad][_0x39179d]);break;case 0x4:joinOrLeaveQueues(_0x26976d,_0x547c97,'mail',_0x99464e[_0x42b8ad][_0x39179d]);break;case 0x5:joinOrLeaveQueues(_0x26976d,_0x547c97,_0xbf96('0x3d'),_0x99464e[_0x42b8ad][_0x39179d]);break;case 0x6:_0x26976d[_0x547c97](util['format'](_0xbf96('0x3e'),_0x99464e[_0x42b8ad][_0x39179d][_0xbf96('0x4')]));break;case 0x7:_0x26976d[_0x547c97](util['format']('trunk:%s',_0x99464e[_0x42b8ad][_0x39179d][_0xbf96('0x4')]));break;case 0x8:_0x26976d[_0x547c97](util[_0xbf96('0x18')](_0xbf96('0x3f'),_0x99464e[_0x42b8ad][_0x39179d][_0xbf96('0x17')],_0x99464e[_0x42b8ad][_0x39179d][_0xbf96('0x4')]));break;case 0x9:_0x26976d[_0x547c97](util[_0xbf96('0x18')](_0xbf96('0x1b'),_0x99464e[_0x42b8ad][_0x39179d]['name']));break;}}}}})[_0xbf96('0xa')](function(){if(_0x547c97===_0xbf96('0x40')){var _0x51779f=_[_0xbf96('0x14')](_0x531b78[_0xbf96('0x41')],'id');return _0x531b78[_0xbf96('0x42')](_0x51779f)['then'](function(){for(var _0x246032=0x0;_0x246032<_0x51779f[_0xbf96('0x1a')];_0x246032+=0x1){_0x1896b0[_0xbf96('0x43')](_0xbf96('0x44'),{'ChatInteractionId':Number(_0x51779f[_0x246032]),'UserId':Number(_0x531b78['id'])});}});}})['then'](function(){if(_0x547c97===_0xbf96('0x40')){var _0x9e2655=_[_0xbf96('0x14')](_0x531b78[_0xbf96('0x20')],'id');return _0x531b78[_0xbf96('0x45')](_0x9e2655)[_0xbf96('0xa')](function(){for(var _0x6c6c7a=0x0;_0x6c6c7a<_0x9e2655[_0xbf96('0x1a')];_0x6c6c7a+=0x1){_0x1896b0[_0xbf96('0x43')](_0xbf96('0x46'),{'MailInteractionId':Number(_0x9e2655[_0x6c6c7a]),'UserId':Number(_0x531b78['id'])});}});}})[_0xbf96('0xa')](function(){if(_0x547c97===_0xbf96('0x40')){var _0x479c07=_[_0xbf96('0x14')](_0x531b78[_0xbf96('0x21')],'id');return _0x531b78[_0xbf96('0x47')](_0x479c07)[_0xbf96('0xa')](function(){for(var _0x398fe7=0x0;_0x398fe7<_0x479c07[_0xbf96('0x1a')];_0x398fe7+=0x1){_0x1896b0[_0xbf96('0x43')](_0xbf96('0x48'),{'FaxInteractionId':Number(_0x479c07[_0x398fe7]),'UserId':Number(_0x531b78['id'])});}});}})['then'](function(){if(_0x547c97===_0xbf96('0x40')){var _0x321e94=_['map'](_0x531b78[_0xbf96('0x23')],'id');return _0x531b78[_0xbf96('0x49')](_0x321e94)[_0xbf96('0xa')](function(){for(var _0x50a154=0x0;_0x50a154<_0x321e94['length'];_0x50a154+=0x1){_0x1896b0['emit'](_0xbf96('0x4a'),{'SmsInteractionId':Number(_0x321e94[_0x50a154]),'UserId':Number(_0x531b78['id'])});}});}})[_0xbf96('0xa')](function(){if(_0x547c97===_0xbf96('0x40')){var _0x49484a=_[_0xbf96('0x14')](_0x531b78[_0xbf96('0x24')],'id');return _0x531b78[_0xbf96('0x4b')](_0x49484a)[_0xbf96('0xa')](function(){for(var _0x212a9e=0x0;_0x212a9e<_0x49484a[_0xbf96('0x1a')];_0x212a9e+=0x1){_0x1896b0[_0xbf96('0x43')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x49484a[_0x212a9e]),'UserId':Number(_0x531b78['id'])});}});}})[_0xbf96('0x4c')](function(_0x5420f5){_0x26976d['log'](_0x5420f5);});}}function onDisconnect(_0x26d880,_0x53cec5){joinOrLeave(_0x26d880,_0xbf96('0x40'),_0x53cec5);}function onConnect(_0x3c3cca){joinOrLeave(_0x3c3cca,_0xbf96('0x4d'));}exports[_0xbf96('0x4e')]=function(_0x301309){_0x301309['on'](_0xbf96('0x4f'),function(_0x29ee6d){_0x29ee6d['setMaxListeners'](0x0);_0x29ee6d[_0xbf96('0x50')]=_0x29ee6d[_0xbf96('0x51')]['connection'][_0xbf96('0x52')]+':'+_0x29ee6d['request'][_0xbf96('0x4f')][_0xbf96('0x53')];_0x29ee6d[_0xbf96('0x54')]=new Date();_0x29ee6d[_0xbf96('0x55')]=function(_0x230046){console['log'](_0xbf96('0x56')+_0x29ee6d[_0xbf96('0x57')][_0xbf96('0x4')]+'['+_0x29ee6d[_0xbf96('0x50')]+']',_0x230046);};_0x29ee6d['on'](_0xbf96('0x58'),function(){onDisconnect(_0x29ee6d,_0x301309);_0x29ee6d[_0xbf96('0x55')](_0xbf96('0x59'));});onConnect(_0x29ee6d);_0x29ee6d[_0xbf96('0x55')](_0xbf96('0x5a'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index dfa124b..d83aef2 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 _0x90cd=['triggers','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Fax','FaxInteraction','Mail','MailInteraction','OpenchannelInteraction','Openchannel','closedinteraction','OpenchannelMessage','request','EventManager','then','info','error','code','catch','Trigger,\x20%s','get','event','direction','UserId','User','find','name','format','SIP/%s','channel','incomingmessage','outgoingmessage','opened','closed','interface','default','length','model','hook','callback','toLowerCase','jayson/promise','../logger'];(function(_0x31200f,_0x373233){var _0x5da056=function(_0x22e792){while(--_0x22e792){_0x31200f['push'](_0x31200f['shift']());}};_0x5da056(++_0x373233);}(_0x90cd,0xc6));var _0xd90c=function(_0x18e33b,_0x19af96){_0x18e33b=_0x18e33b-0x0;var _0xf2a750=_0x90cd[_0x18e33b];return _0xf2a750;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require(_0xd90c('0x0'));var logger=require(_0xd90c('0x1'))(_0xd90c('0x2'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xd90c('0x3'),'event':_0xd90c('0x4'),'condition':_0xd90c('0x5'),'callback':afterCreate},{'channel':_0xd90c('0x6'),'model':_0xd90c('0x3'),'event':_0xd90c('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd90c('0x6'),'model':_0xd90c('0x8'),'event':_0xd90c('0x4'),'condition':_0xd90c('0x9'),'callback':afterCreateMessage},{'channel':_0xd90c('0xa'),'model':_0xd90c('0xb'),'event':_0xd90c('0x4'),'condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':_0xd90c('0xb'),'event':_0xd90c('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd90c('0xa'),'model':_0xd90c('0xc'),'event':_0xd90c('0x4'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xd90c('0xd'),'model':_0xd90c('0xe'),'event':_0xd90c('0x4'),'condition':_0xd90c('0x5'),'callback':afterCreate},{'channel':_0xd90c('0xd'),'model':_0xd90c('0xe'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd90c('0xd'),'model':'FaxMessage','event':_0xd90c('0x4'),'condition':_0xd90c('0x9'),'callback':afterCreateMessage},{'channel':_0xd90c('0xf'),'model':'MailInteraction','event':_0xd90c('0x4'),'condition':_0xd90c('0x5'),'callback':afterCreate},{'channel':_0xd90c('0xf'),'model':_0xd90c('0x10'),'event':_0xd90c('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd90c('0xf'),'model':'MailMessage','event':_0xd90c('0x4'),'condition':_0xd90c('0x9'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xd90c('0x11'),'event':_0xd90c('0x4'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xd90c('0x12'),'model':'OpenchannelInteraction','event':_0xd90c('0x7'),'condition':_0xd90c('0x13'),'callback':afterUpdate},{'channel':_0xd90c('0x12'),'model':_0xd90c('0x14'),'event':'afterCreate','condition':_0xd90c('0x9'),'callback':afterCreateMessage}];function request(_0x1279bd){return client[_0xd90c('0x15')](_0xd90c('0x16'),_0x1279bd)[_0xd90c('0x17')](function(_0x5f0733){logger[_0xd90c('0x18')]('Trigger,\x20%s','EventManager',_0x5f0733);if(_0x5f0733['error']){if(_0x5f0733[_0xd90c('0x19')][_0xd90c('0x1a')]===0x1f4){logger['error']('Trigger,\x20%s',_0xd90c('0x16'),_0x5f0733[_0xd90c('0x19')]);}}})[_0xd90c('0x1b')](function(_0x1146a9){logger[_0xd90c('0x19')](_0xd90c('0x1c'),_0xd90c('0x16'),_0x1146a9);});}function afterCreateMessage(_0xc95d74,_0x4aa87f){return function(_0x48076c,_0x47ccc3){_0x48076c=_0x48076c[_0xd90c('0x1d')]({'plain':!![]});_0x48076c['channel']=_0xc95d74;_0x48076c[_0xd90c('0x1e')]=_0x48076c[_0xd90c('0x1f')];if(_0x48076c[_0xd90c('0x20')]){return db[_0xd90c('0x21')][_0xd90c('0x22')]({'where':{'id':_0x48076c['UserId']},'attributes':['id',_0xd90c('0x23')],'raw':!![]})['then'](function(_0x225f69){_0x48076c['interface']=util[_0xd90c('0x24')](_0xd90c('0x25'),_0x225f69[_0xd90c('0x23')]);_0x48076c[_0xd90c('0x26')]=_0xc95d74;return request({'event':_0xd90c('0x27'),'message':_0x48076c});})[_0xd90c('0x1b')](function(_0x4fddac){console[_0xd90c('0x19')](_0x4fddac);});}else{return request({'event':_0xd90c('0x28'),'message':_0x48076c});}};}function afterCreate(_0x3158a5,_0x4f48bf){return function(_0x1369b4,_0x3db1c6){_0x1369b4=_0x1369b4[_0xd90c('0x1d')]({'plain':!![]});_0x1369b4[_0xd90c('0x26')]=_0x3158a5;_0x1369b4[_0xd90c('0x1e')]=_0xd90c('0x29');return request({'event':_0x4f48bf,'message':_0x1369b4});};}function afterUpdate(_0x312801,_0x529bf2){return function(_0x4bad4c,_0xb8f3cf){if(_0x4bad4c['changed']('closed')&&_0x4bad4c['closed']){_0x4bad4c=_0x4bad4c['get']({'plain':!![]});_0x4bad4c[_0xd90c('0x26')]=_0x312801;_0x4bad4c['event']=_0xd90c('0x2a');if(_0x4bad4c['UserId']){return db[_0xd90c('0x21')][_0xd90c('0x22')]({'where':{'id':_0x4bad4c[_0xd90c('0x20')]},'attributes':['id',_0xd90c('0x23')],'raw':!![]})[_0xd90c('0x17')](function(_0x2401ec){_0x4bad4c[_0xd90c('0x2b')]=util['format'](_0xd90c('0x25'),_0x2401ec[_0xd90c('0x23')]);return request({'event':_0x529bf2,'message':_0x4bad4c});})[_0xd90c('0x1b')](function(_0x39d08e){console['error'](_0x39d08e);});}else{return request({'event':_0x529bf2,'message':_0x4bad4c});}}};}exports[_0xd90c('0x2c')]=function(){for(var _0x41845e=0x0;_0x41845e0x3){var _0x2f7744=/\((.+)\)/;var _0x5eac1d=_0xca0106['rx'][_0x9da3('0x19')](_0x2f7744);if(_0x5eac1d){_0xa0ae39=_0x5eac1d[0x1];}else{_0xa0ae39=null;}}else{_0xa0ae39=null;}_0xca0106['cb'](null,{'code':_0x2622e6,'result':_0x1f5ca3,'extra':_0xa0ae39});}});_0x42e586['on']('error',function(_0x37c870){_0x495b82[_0x9da3('0xa')](_0x9da3('0x1a'),new AGIError(_0x9da3('0x1b'),_0x37c870['code']));});_0x42e586['on'](_0x9da3('0x1c'),function(){_0x495b82[_0x9da3('0xa')](_0x9da3('0x1c'),new AGIError(_0x9da3('0x1d')));});_0x42e586['on'](_0x9da3('0x1e'),function(){_0x495b82['emit']('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x42e586['destroy']();});_0x42e586[_0x9da3('0x1f')](_0x38a550);this[_0x9da3('0x20')]=function(_0xb0d154,_0x25d1bb){var _0xb0d154=_0xb0d154||'',_0x25d1bb=typeof _0x25d1bb=='function'?_0x25d1bb:new Function();_0xca0106={'tx':_0xb0d154,'rx':'','cb':_0x25d1bb};_0x42e586['write'](_0xb0d154+'\x0a');},this[_0x9da3('0x1c')]=function(){_0x42e586[_0x9da3('0x21')]();};}util[_0x9da3('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x9da3('0x23')]['sendRequest']=function(_0x121b48){return this[_0x9da3('0x20')]['sync'](this,_0x121b48);};AGIChannel[_0x9da3('0x23')][_0x9da3('0x24')]=function(){return this[_0x9da3('0x25')](_0x9da3('0x26'));};AGIChannel[_0x9da3('0x23')][_0x9da3('0x27')]=function(_0x58b0a2,_0x3ea62e,_0x105a26){_0x58b0a2=_0x58b0a2===undefined?_0x9da3('0x28'):_0x58b0a2;_0x3ea62e=_0x3ea62e===undefined?'5':_0x3ea62e;_0x105a26=_0x105a26===undefined?'1':_0x105a26;return this[_0x9da3('0x25')](util[_0x9da3('0x29')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x58b0a2,_0x3ea62e*0x3e8,_0x105a26));};AGIChannel[_0x9da3('0x23')][_0x9da3('0x2a')]=function(_0xc37aa9){_0xc37aa9=_0xc37aa9||_0x9da3('0x2b');return this[_0x9da3('0x25')](util['format']('VERBOSE\x20\x22%s\x22',_0xc37aa9));};AGIChannel[_0x9da3('0x23')][_0x9da3('0x2c')]=function(_0x29df1e,_0x4c143e){if(_['isArray'](_0x4c143e)){return this[_0x9da3('0x25')](util[_0x9da3('0x29')](_0x9da3('0x2d'),_0x29df1e,_0x4c143e[_0x9da3('0x2e')](',')));}return this[_0x9da3('0x25')](util['format'](_0x9da3('0x2d'),_0x29df1e,_0x4c143e));};AGIChannel['prototype']['setContext']=function(_0x4f2146){return this[_0x9da3('0x25')](util[_0x9da3('0x29')](_0x9da3('0x2f'),_0x4f2146));};AGIChannel['prototype'][_0x9da3('0x30')]=function(_0x2adfe7){return this[_0x9da3('0x25')](util[_0x9da3('0x29')](_0x9da3('0x31'),_0x2adfe7));};AGIChannel[_0x9da3('0x23')][_0x9da3('0x32')]=function(_0x1a4ddc){return this[_0x9da3('0x25')](util['format']('SET\x20PRIORITY\x20%s',_0x1a4ddc));};AGIChannel['prototype'][_0x9da3('0xd')]=function(){return this['sendRequest'](_0x9da3('0x33'));};AGIChannel[_0x9da3('0x23')]['setVariable']=function(_0x4c9a2e,_0x1ce766){return this[_0x9da3('0x25')](util[_0x9da3('0x29')](_0x9da3('0x34'),_0x4c9a2e,_0x1ce766?_0x1ce766[_0x9da3('0x35')]()[_0x9da3('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x9da3('0x23')][_0x9da3('0x36')]=function(_0x164531,_0x12b296){return this[_0x9da3('0x25')](util[_0x9da3('0x29')](_0x9da3('0x37'),_0x164531,_0x12b296));};AGIChannel['prototype'][_0x9da3('0x38')]=function(_0x26632d,_0x266f83){return this[_0x9da3('0x25')](util[_0x9da3('0x29')](_0x9da3('0x39'),_0x26632d,_0x266f83));};AGIChannel['prototype'][_0x9da3('0x3a')]=function(_0x2d0cb1,_0x55ee90){return this[_0x9da3('0x25')](util[_0x9da3('0x29')](_0x9da3('0x3b'),_0x2d0cb1,_0x55ee90));};AGIChannel[_0x9da3('0x23')][_0x9da3('0x3c')]=function(_0x4786da,_0x5be9a5,_0x2edbae){_0x5be9a5=_0x5be9a5||this[_0x9da3('0x3d')];_0x2edbae=_0x2edbae||0x1;this[_0x9da3('0x3e')](_0x4786da);this[_0x9da3('0x30')](_0x5be9a5);this['setPriority'](_0x2edbae);return this[_0x9da3('0x2a')](util[_0x9da3('0x29')](_0x9da3('0x3f'),_0x4786da,_0x5be9a5,_0x2edbae));};AGIChannel[_0x9da3('0x23')]['getVariable']=function(_0x144cc1){return this[_0x9da3('0x25')](util[_0x9da3('0x29')]('GET\x20VARIABLE\x20\x22%s\x22',_0x144cc1));};AGIChannel['prototype'][_0x9da3('0x40')]=function(_0x2d3411,_0x2bbe12,_0x363392,_0x35cee6,_0x4deb31,_0x10ccad){_0x2bbe12=_0x2bbe12||'wav';_0x363392=_0x363392||'';_0x35cee6=_0x35cee6===undefined?-0x1:_0x35cee6==='-1'?-0x1:_0x35cee6*0x3e8;_0x4deb31=_0x4deb31===undefined?'':'s='+_0x4deb31;_0x10ccad=_0x10ccad?'BEEP':'';return this[_0x9da3('0x25')](util[_0x9da3('0x29')](_0x9da3('0x41'),_0x2d3411,_0x2bbe12,_0x363392,_0x35cee6,_0x10ccad,_0x4deb31));};AGIChannel[_0x9da3('0x23')][_0x9da3('0x42')]=function(_0x4ac422,_0x4c50b3){_0x4c50b3=_0x4c50b3||'';return this[_0x9da3('0x25')](util['format'](_0x9da3('0x43'),_0x4ac422,_0x4c50b3));};AGIChannel[_0x9da3('0x23')][_0x9da3('0x44')]=function(_0x2ed872){return this['exec'](_0x9da3('0x45'),_0x2ed872);};AGIChannel['prototype'][_0x9da3('0x46')]=function(_0x1751e6){return this['exec'](_0x9da3('0x47'),_0x1751e6);};AGIChannel[_0x9da3('0x23')][_0x9da3('0x1a')]=function(_0x41c8c8,_0x45aed3){this[_0x9da3('0x2a')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x41c8c8['id'],_0x41c8c8[_0x9da3('0x48')],_0x45aed3));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xd24d=['wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','exec','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','utf8','setTimeout','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','result=','substr','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','write','inherits','prototype','sendRequest','command','sync','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile'];(function(_0x3c77cb,_0x2da2c9){var _0xa4b122=function(_0x3405bb){while(--_0x3405bb){_0x3c77cb['push'](_0x3c77cb['shift']());}};_0xa4b122(++_0x2da2c9);}(_0xd24d,0xfa));var _0xdd24=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd24d[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xdd24('0x0'));var _=require(_0xdd24('0x1'));var EventEmitter=require(_0xdd24('0x2'))[_0xdd24('0x3')];var AGIReply=require(_0xdd24('0x4'));var AGIError=require(_0xdd24('0x5'));function AGIChannel(_0x3b526c){var _0x4fcba3=this,_0x3f9d98=new AGIReply(),_0x2ca4d7=![],_0x1815ae={};EventEmitter[_0xdd24('0x6')](_0x4fcba3);_0x3b526c['setEncoding'](_0xdd24('0x7'));_0x3b526c[_0xdd24('0x8')](0x8*0x3c*0x3c*0x3e8);_0x3f9d98['setEncoding'](_0xdd24('0x7'));_0x3f9d98['on']('headers',function(_0x560021){for(var _0x2fa020 in _0x560021){_0x4fcba3[_0x2fa020]=_0x560021[_0x2fa020];}_0x4fcba3[_0xdd24('0x9')](_0xdd24('0xa'));});_0x3f9d98['on'](_0xdd24('0xb'),function(_0x31df5d){if(_0x31df5d['toLowerCase']()==_0xdd24('0xc')){_0x4fcba3[_0xdd24('0x9')](_0xdd24('0xc'));return;}if(_0x31df5d[_0xdd24('0xd')](0x0,0xb)==_0xdd24('0xe')){_0x2ca4d7=!![];}if(_0x2ca4d7){_0x1815ae['rx']+=_0x31df5d+'\x0a';if(_0x31df5d[_0xdd24('0xf')](_0xdd24('0x10'))!=-0x1){_0x2ca4d7=![];}}else{_0x1815ae['rx']=_0x31df5d;}if(_0x2ca4d7){return;}if(typeof _0x1815ae['cb']==_0xdd24('0x11')){var _0xd5b01d=_0x1815ae['rx'][_0xdd24('0xd')](0x0,0x3),_0x12b4df=null,_0x20e9db=null;_0xd5b01d=parseInt(_0xd5b01d);if(isNaN(_0xd5b01d)){_0x1815ae['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xdd24('0x12')});return;}if(_0xd5b01d!=0xc8){_0x1815ae['cb'](null,{'code':_0xd5b01d,'result':-0x1,'extra':'KO'});return;}_0x12b4df=_0x1815ae['rx'][_0xdd24('0xd')](0x4)['replace'](_0xdd24('0x13'),'');if(_0x12b4df['indexOf']('\x20')!=-0x1){_0x12b4df=_0x12b4df[_0xdd24('0x14')](0x0,_0x12b4df[_0xdd24('0x15')]('\x20'));}if(_['startsWith'](_0x12b4df,'-1')){_0x12b4df=parseInt(_0x12b4df);}_0x20e9db=_0x1815ae['rx'][_0xdd24('0x16')]('\x20');if(_0x20e9db[_0xdd24('0x17')]==0x3){_0x20e9db=_0x20e9db[0x2][_0xdd24('0xd')](0x1,_0x20e9db[0x2]['length']-0x1);}else if(_0x20e9db[_0xdd24('0x17')]>0x3){var _0x1957e3=/\((.+)\)/;var _0x33a12f=_0x1815ae['rx'][_0xdd24('0x18')](_0x1957e3);if(_0x33a12f){_0x20e9db=_0x33a12f[0x1];}else{_0x20e9db=null;}}else{_0x20e9db=null;}_0x1815ae['cb'](null,{'code':_0xd5b01d,'result':_0x12b4df,'extra':_0x20e9db});}});_0x3b526c['on'](_0xdd24('0x19'),function(_0x16de43){_0x4fcba3['emit'](_0xdd24('0x19'),new AGIError(_0xdd24('0x1a'),_0x16de43[_0xdd24('0x1b')]));});_0x3b526c['on'](_0xdd24('0x1c'),function(){_0x4fcba3[_0xdd24('0x9')](_0xdd24('0x1c'),new AGIError(_0xdd24('0x1d')));});_0x3b526c['on']('timeout',function(){_0x4fcba3[_0xdd24('0x9')](_0xdd24('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x3b526c[_0xdd24('0x1f')]();});_0x3b526c['pipe'](_0x3f9d98);this['command']=function(_0x440938,_0x288f32){var _0x440938=_0x440938||'',_0x288f32=typeof _0x288f32==_0xdd24('0x11')?_0x288f32:new Function();_0x1815ae={'tx':_0x440938,'rx':'','cb':_0x288f32};_0x3b526c[_0xdd24('0x20')](_0x440938+'\x0a');},this[_0xdd24('0x1c')]=function(){_0x3b526c['destroy']();};}util[_0xdd24('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xdd24('0x22')][_0xdd24('0x23')]=function(_0x32a14c){return this[_0xdd24('0x24')][_0xdd24('0x25')](this,_0x32a14c);};AGIChannel['prototype'][_0xdd24('0x26')]=function(){return this[_0xdd24('0x23')](_0xdd24('0x27'));};AGIChannel[_0xdd24('0x22')]['getData']=function(_0x45b4b0,_0x8b6ea2,_0x1b1839){_0x45b4b0=_0x45b4b0===undefined?_0xdd24('0x28'):_0x45b4b0;_0x8b6ea2=_0x8b6ea2===undefined?'5':_0x8b6ea2;_0x1b1839=_0x1b1839===undefined?'1':_0x1b1839;return this[_0xdd24('0x23')](util[_0xdd24('0x29')](_0xdd24('0x2a'),_0x45b4b0,_0x8b6ea2*0x3e8,_0x1b1839));};AGIChannel[_0xdd24('0x22')]['noop']=function(_0x2f7f19){_0x2f7f19=_0x2f7f19||_0xdd24('0x2b');return this['sendRequest'](util[_0xdd24('0x29')]('VERBOSE\x20\x22%s\x22',_0x2f7f19));};AGIChannel[_0xdd24('0x22')]['exec']=function(_0x4cb220,_0x3243b4){if(_[_0xdd24('0x2c')](_0x3243b4)){return this['sendRequest'](util[_0xdd24('0x29')](_0xdd24('0x2d'),_0x4cb220,_0x3243b4[_0xdd24('0x2e')](',')));}return this[_0xdd24('0x23')](util[_0xdd24('0x29')](_0xdd24('0x2d'),_0x4cb220,_0x3243b4));};AGIChannel['prototype']['setContext']=function(_0x362e67){return this['sendRequest'](util['format'](_0xdd24('0x2f'),_0x362e67));};AGIChannel[_0xdd24('0x22')][_0xdd24('0x30')]=function(_0x5f4f20){return this[_0xdd24('0x23')](util[_0xdd24('0x29')]('SET\x20EXTENSION\x20%s',_0x5f4f20));};AGIChannel[_0xdd24('0x22')][_0xdd24('0x31')]=function(_0x178dac){return this[_0xdd24('0x23')](util['format'](_0xdd24('0x32'),_0x178dac));};AGIChannel[_0xdd24('0x22')][_0xdd24('0xc')]=function(){return this['sendRequest'](_0xdd24('0x33'));};AGIChannel[_0xdd24('0x22')]['setVariable']=function(_0x10e492,_0x7ed7b0){return this[_0xdd24('0x23')](util[_0xdd24('0x29')](_0xdd24('0x34'),_0x10e492,_0x7ed7b0?_0x7ed7b0[_0xdd24('0x35')]()[_0xdd24('0x36')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xdd24('0x22')][_0xdd24('0x37')]=function(_0x2b086b,_0x351d03){return this[_0xdd24('0x23')](util[_0xdd24('0x29')]('SAY\x20NUMBER\x20%s\x20%s',_0x2b086b,_0x351d03));};AGIChannel[_0xdd24('0x22')][_0xdd24('0x38')]=function(_0x37258d,_0x2a0e99){return this[_0xdd24('0x23')](util[_0xdd24('0x29')](_0xdd24('0x39'),_0x37258d,_0x2a0e99));};AGIChannel[_0xdd24('0x22')][_0xdd24('0x3a')]=function(_0x42b785,_0x5092e4){return this[_0xdd24('0x23')](util[_0xdd24('0x29')](_0xdd24('0x3b'),_0x42b785,_0x5092e4));};AGIChannel[_0xdd24('0x22')][_0xdd24('0x3c')]=function(_0x3e23ea,_0x1fe071,_0x33695a){_0x1fe071=_0x1fe071||this[_0xdd24('0x3d')];_0x33695a=_0x33695a||0x1;this['setContext'](_0x3e23ea);this['setExtension'](_0x1fe071);this['setPriority'](_0x33695a);return this['noop'](util[_0xdd24('0x29')](_0xdd24('0x3e'),_0x3e23ea,_0x1fe071,_0x33695a));};AGIChannel['prototype'][_0xdd24('0x3f')]=function(_0x96b70d){return this[_0xdd24('0x23')](util[_0xdd24('0x29')](_0xdd24('0x40'),_0x96b70d));};AGIChannel[_0xdd24('0x22')][_0xdd24('0x41')]=function(_0x37e23a,_0x2ba91a,_0x671ddc,_0x1f5ba9,_0x4e0b89,_0x34f0d4){_0x2ba91a=_0x2ba91a||_0xdd24('0x42');_0x671ddc=_0x671ddc||'';_0x1f5ba9=_0x1f5ba9===undefined?-0x1:_0x1f5ba9==='-1'?-0x1:_0x1f5ba9*0x3e8;_0x4e0b89=_0x4e0b89===undefined?'':'s='+_0x4e0b89;_0x34f0d4=_0x34f0d4?_0xdd24('0x43'):'';return this[_0xdd24('0x23')](util['format'](_0xdd24('0x44'),_0x37e23a,_0x2ba91a,_0x671ddc,_0x1f5ba9,_0x34f0d4,_0x4e0b89));};AGIChannel[_0xdd24('0x22')][_0xdd24('0x45')]=function(_0x44b8c6,_0x50ef75){_0x50ef75=_0x50ef75||'';return this[_0xdd24('0x23')](util[_0xdd24('0x29')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x44b8c6,_0x50ef75));};AGIChannel[_0xdd24('0x22')][_0xdd24('0x46')]=function(_0x3da853){return this['exec'](_0xdd24('0x47'),_0x3da853);};AGIChannel['prototype'][_0xdd24('0x48')]=function(_0x118365){return this[_0xdd24('0x49')](_0xdd24('0x4a'),_0x118365);};AGIChannel[_0xdd24('0x22')][_0xdd24('0x19')]=function(_0x50f543,_0x57c1df){this[_0xdd24('0x4b')](util[_0xdd24('0x29')](_0xdd24('0x4c'),_0x50f543['id'],_0x50f543[_0xdd24('0x4d')],_0x57c1df));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xdd24('0x4e')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 260617d..aa3490a 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 _0x1fad=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x1fad,0x12b));var _0xd1fa=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0x1fad[_0x57474e];return _0xfaae8c;};'use strict';var util=require(_0xd1fa('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xd1fa('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xd1fa('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xd1fa('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xd1fa('0x4'),'E_AGI_SOCKET_ERROR':_0xd1fa('0x5'),'E_AGI_SOCKET_CLOSE':_0xd1fa('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xd1fa('0x7'),'E_AGI_COMMAND_EMPTY':_0xd1fa('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd1fa('0x9'),'E_AGI_IVR_ENTRY':_0xd1fa('0xa')};function AGIError(_0x339dc8){var _0x339dc8=_0x339dc8||null,_0x56e29c=_0x56e29c||[],_0x2de76c=0x1,_0x1ab51d='';if(!error[_0x339dc8]){_0x339dc8='E_AGI_UNDEFINED';}_0x56e29c[_0xd1fa('0xb')](error[_0x339dc8]);while(arguments[_0x2de76c]){_0x56e29c[_0xd1fa('0xb')](arguments[_0x2de76c]);_0x2de76c++;}_0x1ab51d=util[_0xd1fa('0xc')][_0xd1fa('0xd')](util,_0x56e29c);this[_0xd1fa('0xe')]=_0x1ab51d;this['name']=_0x339dc8;}module[_0xd1fa('0xf')]=AGIError; \ No newline at end of file +var _0x964f=['Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0xd2430b,_0x51de6b){var _0x170127=function(_0x2ff344){while(--_0x2ff344){_0xd2430b['push'](_0xd2430b['shift']());}};_0x170127(++_0x51de6b);}(_0x964f,0x14d));var _0xf964=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x964f[_0x1cc8fe];return _0x230054;};'use strict';var util=require(_0xf964('0x0'));var error={'E_AGI_UNDEFINED':_0xf964('0x1'),'E_AGI_ARGUMENT_PORT':_0xf964('0x2'),'E_AGI_SERVER_ERROR':_0xf964('0x3'),'E_AGI_SERVER_CLOSE':_0xf964('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xf964('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xf964('0x6'),'E_AGI_SOCKET_ERROR':_0xf964('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xf964('0x8'),'E_AGI_COMMAND_EMPTY':_0xf964('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xf964('0xa'),'E_AGI_IVR_ENTRY':_0xf964('0xb')};function AGIError(_0x13bdbd){var _0x13bdbd=_0x13bdbd||null,_0x48d574=_0x48d574||[],_0x58ba5c=0x1,_0x4ed9ee='';if(!error[_0x13bdbd]){_0x13bdbd=_0xf964('0xc');}_0x48d574[_0xf964('0xd')](error[_0x13bdbd]);while(arguments[_0x58ba5c]){_0x48d574[_0xf964('0xd')](arguments[_0x58ba5c]);_0x58ba5c++;}_0x4ed9ee=util[_0xf964('0xe')][_0xf964('0xf')](util,_0x48d574);this['message']=_0x4ed9ee;this['name']=_0x13bdbd;}module[_0xf964('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 01216e9..76034e5 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 _0xab40=['menu','vswitch','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','getsecretdigits','vertices','edges','numberOfEdges','prototype','addEdge','size','relations','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','target','default'];(function(_0x13fa47,_0x59ee64){var _0x4f0c08=function(_0x136f1f){while(--_0x136f1f){_0x13fa47['push'](_0x13fa47['shift']());}};_0x4f0c08(++_0x59ee64);}(_0xab40,0xcd));var _0x0ab4=function(_0x46bb3c,_0x443dc4){_0x46bb3c=_0x46bb3c-0x0;var _0x27c6af=_0xab40[_0x46bb3c];return _0x27c6af;};'use strict';var _=require(_0x0ab4('0x0'));var logger=require(_0x0ab4('0x1'))('agi');var verticesWithRetry=['menu','getdigits',_0x0ab4('0x2')];var Graph=function(){this[_0x0ab4('0x3')]={};this[_0x0ab4('0x4')]={};this[_0x0ab4('0x5')]=0x0;};Graph[_0x0ab4('0x6')]['addVertex']=function(_0x5f01aa){this[_0x0ab4('0x3')][_0x5f01aa['id']]=_0x5f01aa;this['edges'][_0x5f01aa['id']]=[];};Graph[_0x0ab4('0x6')][_0x0ab4('0x7')]=function(_0x11e99f,_0x6d135d,_0x4cf8de){this['edges'][_0x11e99f]['push']({'target':_0x6d135d,'condition':_0x4cf8de});this[_0x0ab4('0x5')]+=0x1;};Graph[_0x0ab4('0x6')][_0x0ab4('0x8')]=function(){return _[_0x0ab4('0x8')](this[_0x0ab4('0x3')]);};Graph[_0x0ab4('0x6')][_0x0ab4('0x9')]=function(){return this[_0x0ab4('0x5')];};Graph['prototype']['getVertex']=function(_0x4602bf){return this['vertices'][_0x4602bf];};Graph[_0x0ab4('0x6')][_0x0ab4('0xa')]=function(_0x1e7555,_0x1e2b56){if(!this[_0x0ab4('0x3')][_0x1e7555]){return logger[_0x0ab4('0xb')](_0x0ab4('0xc'));}var _0x2cc644=_0x1e2b56(this[_0x0ab4('0x3')][_0x1e7555]);if(!_0x2cc644){return logger[_0x0ab4('0xb')](_0x0ab4('0xd'));}if(this[_0x0ab4('0x4')][_0x1e7555][_0x0ab4('0xe')]===0x0){return logger[_0x0ab4('0xb')](_0x0ab4('0xf'));}for(var _0x2403db=0x0,_0x283b15=[],_0x2bdda7=![];_0x2403db\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','callerid','evtHangup','toJson','mxGraphModel','hasOwnProperty','maxRetry','addVertex','omit','mxCell','length','target','source','value','getSquareProject','catch','createSquareReport','then','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','timeout','hangup','sync','production','start','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toString','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc'];(function(_0x592b21,_0x5ce37e){var _0x6c80de=function(_0x331b1e){while(--_0x331b1e){_0x592b21['push'](_0x592b21['shift']());}};_0x6c80de(++_0x5ce37e);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x5023ec,_0x4f99d5){_0x5023ec=_0x5023ec-0x0;var _0x5aa6ed=_0xfa2b[_0x5023ec];return _0x5aa6ed;};'use strict';var parser=require(_0xbfa2('0x0'));var _=require(_0xbfa2('0x1'));var syncho=require(_0xbfa2('0x2'));var util=require(_0xbfa2('0x3'));var moment=require(_0xbfa2('0x4'));var config=require(_0xbfa2('0x5'));var logger=require(_0xbfa2('0x6'))(_0xbfa2('0x7'));var utilLicense=require(_0xbfa2('0x8'));var rpc=require(_0xbfa2('0x9'));var mailRpc=require(_0xbfa2('0xa'));var Graph=require(_0xbfa2('0xb'));var Vertices=require(_0xbfa2('0xc'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xbfa2('0x7')]=_[_0xbfa2('0xd')](config[_0xbfa2('0x7')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x46a151){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x46a151);agiHandler(_0x46a151);}catch(_0x329e40){logger[_0xbfa2('0xe')](_0x329e40[_0xbfa2('0xf')]);}});});}function listeningHandler(){console[_0xbfa2('0x10')](_0xbfa2('0x11'),config[_0xbfa2('0x7')][_0xbfa2('0x12')]);logger[_0xbfa2('0x13')](util[_0xbfa2('0x14')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi'][_0xbfa2('0x12')]));}function errorHandler(_0x45ea77){if(_0x45ea77&&_0x45ea77[_0xbfa2('0x15')]&&_0x45ea77[_0xbfa2('0x16')]){logger[_0xbfa2('0xe')](util[_0xbfa2('0x14')]('[%s]\x20%s',_0x45ea77[_0xbfa2('0x15')],_0x45ea77[_0xbfa2('0x16')]));}else{logger[_0xbfa2('0xe')](util[_0xbfa2('0x14')](_0xbfa2('0x17'),_0x45ea77['stack']));}}function closeHandler(){logger[_0xbfa2('0x13')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xbfa2('0x18')],this['calleridname'],this['callerid'],this[_0xbfa2('0x19')],this[_0xbfa2('0x1a')]));try{createSquareReport(this);}catch(_0x54cdb2){logger[_0xbfa2('0xe')](_0x54cdb2[_0xbfa2('0xf')]);}}function timeoutHandler(){logger[_0xbfa2('0x13')](util[_0xbfa2('0x14')](_0xbfa2('0x1b'),this[_0xbfa2('0x18')],this[_0xbfa2('0x1c')],this['callerid'],this[_0xbfa2('0x19')],this[_0xbfa2('0x1a')]));}function hangupHandler(){logger[_0xbfa2('0x13')](util['format'](_0xbfa2('0x1d'),this[_0xbfa2('0x18')],this['calleridname'],this[_0xbfa2('0x1e')],this['dnid'],this['uniqueid']));this[_0xbfa2('0x1f')]=!![];}function getRoot(_0xdb059b){return parser[_0xbfa2('0x20')](_0xdb059b,{'object':!![]})[_0xbfa2('0x21')]['root'];}function addVertex(_0x5bb514,_0x599df2,_0x13db3e){_0x599df2['agicommand']=_0x13db3e;if(_0x599df2[_0xbfa2('0x22')]('retry')){_0x599df2[_0xbfa2('0x23')]=parseInt(_0x599df2['retry'],0xa);}_0x5bb514[_0xbfa2('0x24')](_[_0xbfa2('0x25')](_0x599df2,_0xbfa2('0x26')));}function initGraph(_0x38c5dc,_0x1e1c76){var _0x50d83a=new Graph();for(var _0x310d74 in _0x38c5dc){if(_0x38c5dc[_0xbfa2('0x22')](_0x310d74)){if(_['isArray'](_0x38c5dc[_0x310d74])){for(var _0x37ec27=0x0;_0x37ec27<_0x38c5dc[_0x310d74][_0xbfa2('0x27')];_0x37ec27+=0x1){addVertex(_0x50d83a,_0x38c5dc[_0x310d74][_0x37ec27],_0x310d74);}}else{addVertex(_0x50d83a,_0x38c5dc[_0x310d74],_0x310d74);}}}for(var _0x4ccdb5=0x0;_0x4ccdb5<_0x1e1c76[_0xbfa2('0x27')];_0x4ccdb5+=0x1){if(_0x1e1c76[_0x4ccdb5]['source']&&_0x1e1c76[_0x4ccdb5][_0xbfa2('0x28')]){_0x50d83a['addEdge'](_0x1e1c76[_0x4ccdb5][_0xbfa2('0x29')],_0x1e1c76[_0x4ccdb5][_0xbfa2('0x28')],_0x1e1c76[_0x4ccdb5][_0xbfa2('0x2a')]);}}return _0x50d83a;}function getSquareProject(_0x33e5af,_0x49d563){rpc[_0xbfa2('0x2b')](_0x33e5af)['then'](function(_0xb95429){_0x49d563(null,_0xb95429);})[_0xbfa2('0x2c')](function(_0x3860b4){_0x49d563(null,_0x3860b4);});}function createSquareReport(_0x5e3831,_0x1b8fe6){rpc[_0xbfa2('0x2d')](_0x5e3831)[_0xbfa2('0x2e')](function(_0x5db6ae){if(_0x1b8fe6){_0x1b8fe6(null,_0x5db6ae);}})['catch'](function(_0x5aa051){if(_0x1b8fe6){_0x1b8fe6(null,_0x5aa051);}});}function setChannelVariables(_0x2d5050){for(var _0x12069c in _0x2d5050){if(_0x2d5050['hasOwnProperty'](_0x12069c)){if(_0x12069c[_0xbfa2('0x2f')](_0xbfa2('0x30'))===0x0){_0x2d5050[_0x12069c[_0xbfa2('0x31')](0x4)]=_0x2d5050[_0x12069c];delete _0x2d5050[_0x12069c];}}}}function getLogFromObject(_0x206119){return util['inspect'](_0x206119,{'showHidden':![],'depth':null});}function agiHandler(_0x2d20fe){var _0x9523b7,_0x52161f,_0x63ed08,_0x1271d8,_0xad23ed;logger[_0xbfa2('0x32')](_0xbfa2('0x33'),JSON[_0xbfa2('0x34')](_0x2d20fe,null,0x2));logger[_0xbfa2('0x13')](util[_0xbfa2('0x14')](_0xbfa2('0x35'),_0x2d20fe['arg_1'],_0x2d20fe[_0xbfa2('0x1c')],_0x2d20fe['callerid'],_0x2d20fe[_0xbfa2('0x19')],_0x2d20fe['uniqueid']));_0x2d20fe['on'](_0xbfa2('0xe'),errorHandler);_0x2d20fe['on'](_0xbfa2('0x36'),closeHandler);_0x2d20fe['on'](_0xbfa2('0x37'),timeoutHandler);_0x2d20fe[_0xbfa2('0x1f')]=![];_0x2d20fe['on'](_0xbfa2('0x38'),hangupHandler);var _0x4fa12c=getSquareProject[_0xbfa2('0x39')](null,_0x2d20fe[_0xbfa2('0x18')]);if(_0x4fa12c){if(_0x4fa12c[_0xbfa2('0x3a')]){_0x9523b7=getRoot(_0x4fa12c[_0xbfa2('0x3a')]);if(_0x9523b7&&_0x9523b7[_0xbfa2('0x3b')]){logger['debug']('root',JSON[_0xbfa2('0x34')](_0x9523b7,null,0x2));_0x2d20fe[_0xbfa2('0x3c')]=moment()[_0xbfa2('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x52161f=initGraph(_['omit'](_0x9523b7,_0xbfa2('0x26')),_0x9523b7[_0xbfa2('0x26')]);_0x63ed08=new Vertices(_0x2d20fe,rpc,mailRpc);logger['info'](util['format'](_0xbfa2('0x3d'),_0x2d20fe[_0xbfa2('0x18')],_0x2d20fe['calleridname'],_0x2d20fe[_0xbfa2('0x1e')],_0x2d20fe[_0xbfa2('0x19')],_0x2d20fe[_0xbfa2('0x1a')]));_0x52161f[_0xbfa2('0x3e')](_0x9523b7[_0xbfa2('0x3b')]['id'],function(_0x1029eb){try{_0x1029eb=_0x63ed08[_0xbfa2('0x3f')](_0x1029eb);logger[_0xbfa2('0x32')](_0xbfa2('0x40'),JSON[_0xbfa2('0x34')](_0x1029eb,null,0x2));if(_0x1029eb[_0xbfa2('0x41')]===_0xbfa2('0x42')){logger[_0xbfa2('0x13')](_0xbfa2('0x43'));_0x2d20fe[_0xbfa2('0x44')]=_0x1029eb[_0xbfa2('0x44')]||_0x2d20fe[_0xbfa2('0x44')];_0x2d20fe['extension']=_0x1029eb[_0xbfa2('0x45')];_0x2d20fe[_0xbfa2('0x46')]=_0x1029eb[_0xbfa2('0x46')]?_0x1029eb[_0xbfa2('0x46')]-0x1:0x1;return null;}else if(_0x1029eb&&_0x63ed08[_0x1029eb[_0xbfa2('0x41')]]){_0xad23ed=_0x63ed08[_0x1029eb[_0xbfa2('0x41')]](_0x1029eb);logger['info'](_0xbfa2('0x47'),JSON['stringify'](_0xad23ed,null,0x2));if(_0xad23ed&&_0xad23ed[_0xbfa2('0x48')]===AGI_CODE_SUCCESS&&_0xad23ed[_0xbfa2('0x49')]!==AGI_RESULT_ERROR&&!_0x2d20fe['evtHangup']){logger[_0xbfa2('0x32')](_0xbfa2('0x47'),getLogFromObject(_0xad23ed));return _[_0xbfa2('0x4a')](_0xad23ed[_0xbfa2('0x49')])?null:_0xad23ed[_0xbfa2('0x49')]['toString']();}else{logger[_0xbfa2('0xe')](_0xbfa2('0x47'),getLogFromObject(_0xad23ed));return null;}}else{logger[_0xbfa2('0xe')](_0xbfa2('0x4b'));return null;}}catch(_0x2afaea){logger[_0xbfa2('0xe')](_0x2afaea[_0xbfa2('0xf')]);return null;}});if(_0x9523b7[_0xbfa2('0x4c')]){logger['info'](util[_0xbfa2('0x14')](_0xbfa2('0x4d'),_0x2d20fe['arg_1'],_0x2d20fe[_0xbfa2('0x1c')],_0x2d20fe[_0xbfa2('0x1e')],_0x2d20fe[_0xbfa2('0x19')],_0x2d20fe[_0xbfa2('0x1a')]));_0x52161f[_0xbfa2('0x3e')](_0x9523b7[_0xbfa2('0x4c')]['id'],function(_0x285da4){try{_0x285da4=_0x63ed08[_0xbfa2('0x3f')](_0x285da4);logger[_0xbfa2('0x32')]('vertex',JSON[_0xbfa2('0x34')](_0x285da4,null,0x2));if(_0x285da4&&_0x63ed08[_0x285da4[_0xbfa2('0x41')]]){_0xad23ed=_0x63ed08[_0x285da4[_0xbfa2('0x41')]](_0x285da4);if(_0xad23ed){logger['debug']('response',getLogFromObject(_0xad23ed));return _[_0xbfa2('0x4a')](_0xad23ed['result'])?null:_0xad23ed[_0xbfa2('0x49')][_0xbfa2('0x4e')]();}else{logger['error'](_0xbfa2('0x47'),getLogFromObject(_0xad23ed));return null;}}else{logger[_0xbfa2('0xe')](_0xbfa2('0x4b'));return null;}}catch(_0x5cd6b7){logger[_0xbfa2('0xe')](_0x5cd6b7['stack']);return null;}});}logger[_0xbfa2('0x13')](util[_0xbfa2('0x14')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2d20fe[_0xbfa2('0x18')],_0x2d20fe['calleridname'],_0x2d20fe[_0xbfa2('0x1e')],_0x2d20fe['dnid'],_0x2d20fe[_0xbfa2('0x1a')]));logger[_0xbfa2('0x13')](util[_0xbfa2('0x14')](_0xbfa2('0x4f'),_0x2d20fe[_0xbfa2('0x44')],_0x2d20fe['extension'],parseInt(_0x2d20fe['priority'],0xa)+0x1));_0x2d20fe['continueAt'](_0x2d20fe[_0xbfa2('0x44')],_0x2d20fe[_0xbfa2('0x45')],parseInt(_0x2d20fe[_0xbfa2('0x46')],0xa)+0x1);_0x2d20fe['close']();}}else{logger[_0xbfa2('0xe')](util[_0xbfa2('0x14')]('Project\x20%s\x20not\x20published',_0x2d20fe[_0xbfa2('0x18')]));_0x2d20fe[_0xbfa2('0x50')](_0x2d20fe['context'],_0x2d20fe[_0xbfa2('0x45')],parseInt(_0x2d20fe[_0xbfa2('0x46')],0xa)+0x1);_0x2d20fe['close']();}}else{logger['error'](util[_0xbfa2('0x14')]('Project\x20%s\x20not\x20found',_0x2d20fe[_0xbfa2('0x18')]));_0x2d20fe[_0xbfa2('0x50')](_0x2d20fe['context'],_0x2d20fe[_0xbfa2('0x45')],parseInt(_0x2d20fe[_0xbfa2('0x46')],0xa)+0x1);_0x2d20fe[_0xbfa2('0x36')]();}}function main(){var _0x44177e;return utilLicense[_0xbfa2('0x51')]()[_0xbfa2('0x2e')](function(_0x14c2b1){if(_0x14c2b1){if(_0x14c2b1[_0xbfa2('0x52')]){if(_0x14c2b1[_0xbfa2('0x53')]&&_0x14c2b1[_0xbfa2('0x53')]>0x0){logger[_0xbfa2('0x13')](util[_0xbfa2('0x14')](_0xbfa2('0x54'),_0x14c2b1[_0xbfa2('0x53')]));_0x44177e=_0x14c2b1['callysquare'];}else{logger[_0xbfa2('0x13')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xbfa2('0x13')](_0xbfa2('0x55'));_0x44177e=-0x1;}}})[_0xbfa2('0x2c')](function(_0x3885db){logger[_0xbfa2('0xe')](_0xbfa2('0x56'),_0x3885db[_0xbfa2('0xf')]);})[_0xbfa2('0x4c')](function(){var _0x41749d=require(_0xbfa2('0x57'))(config[_0xbfa2('0x7')]['port'],config[_0xbfa2('0x7')]['ip'],_0x44177e);_0x41749d['on'](_0xbfa2('0xe'),errorHandler);_0x41749d['on'](_0xbfa2('0x58'),listeningHandler);_0x41749d['on'](_0xbfa2('0x59'),connectionHandler);_0x41749d['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xde64=['voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','./server','port','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','agi','../../config/license/util','./graph','./vertices','127.0.0.1','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','stack','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','length','source','target','addEdge','getSquareProject','then','catch','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','isUndefined','toString','finally','vertex','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense'];(function(_0xb8b50b,_0x4c7ca4){var _0x327844=function(_0x1905dc){while(--_0x1905dc){_0xb8b50b['push'](_0xb8b50b['shift']());}};_0x327844(++_0x4c7ca4);}(_0xde64,0x17c));var _0x4de6=function(_0x3f3062,_0x16d3c5){_0x3f3062=_0x3f3062-0x0;var _0x4db213=_0xde64[_0x3f3062];return _0x4db213;};'use strict';var parser=require(_0x4de6('0x0'));var _=require(_0x4de6('0x1'));var syncho=require(_0x4de6('0x2'));var util=require(_0x4de6('0x3'));var moment=require(_0x4de6('0x4'));var config=require(_0x4de6('0x5'));var logger=require('../../config/logger')(_0x4de6('0x6'));var utilLicense=require(_0x4de6('0x7'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x4de6('0x8'));var Vertices=require(_0x4de6('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0x4de6('0x6')],{'ip':_0x4de6('0xa'),'port':0x11dd});function connectionHandler(_0x475fb9){process[_0x4de6('0xb')](function(){syncho(function(){try{setChannelVariables(_0x475fb9);agiHandler(_0x475fb9);}catch(_0x34f7a4){logger[_0x4de6('0xc')](_0x34f7a4['stack']);}});});}function listeningHandler(){console[_0x4de6('0xd')](_0x4de6('0xe'),config[_0x4de6('0x6')]['port']);logger[_0x4de6('0xf')](util[_0x4de6('0x10')](_0x4de6('0x11'),config[_0x4de6('0x6')]['ip'],config[_0x4de6('0x6')]['port']));}function errorHandler(_0x222272){if(_0x222272&&_0x222272[_0x4de6('0x12')]&&_0x222272[_0x4de6('0x13')]){logger['error'](util[_0x4de6('0x10')](_0x4de6('0x14'),_0x222272[_0x4de6('0x12')],_0x222272[_0x4de6('0x13')]));}else{logger['error'](util[_0x4de6('0x10')](_0x4de6('0x15'),_0x222272[_0x4de6('0x16')]));}}function closeHandler(){logger['info'](util[_0x4de6('0x10')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x4de6('0x17')],this[_0x4de6('0x18')],this[_0x4de6('0x19')],this[_0x4de6('0x1a')]));try{createSquareReport(this);}catch(_0x37975a){logger[_0x4de6('0xc')](_0x37975a[_0x4de6('0x16')]);}}function timeoutHandler(){logger['info'](util[_0x4de6('0x10')](_0x4de6('0x1b'),this[_0x4de6('0x1c')],this[_0x4de6('0x17')],this[_0x4de6('0x18')],this[_0x4de6('0x19')],this[_0x4de6('0x1a')]));}function hangupHandler(){logger[_0x4de6('0xf')](util[_0x4de6('0x10')](_0x4de6('0x1d'),this['arg_1'],this[_0x4de6('0x17')],this['callerid'],this[_0x4de6('0x19')],this[_0x4de6('0x1a')]));this[_0x4de6('0x1e')]=!![];}function getRoot(_0x5de99f){return parser[_0x4de6('0x1f')](_0x5de99f,{'object':!![]})['mxGraphModel'][_0x4de6('0x20')];}function addVertex(_0x385cae,_0x1a64e9,_0x5ddbab){_0x1a64e9[_0x4de6('0x21')]=_0x5ddbab;if(_0x1a64e9[_0x4de6('0x22')](_0x4de6('0x23'))){_0x1a64e9[_0x4de6('0x24')]=parseInt(_0x1a64e9[_0x4de6('0x23')],0xa);}_0x385cae[_0x4de6('0x25')](_[_0x4de6('0x26')](_0x1a64e9,'mxCell'));}function initGraph(_0x20eb9e,_0x69e2dd){var _0x426a15=new Graph();for(var _0x327215 in _0x20eb9e){if(_0x20eb9e[_0x4de6('0x22')](_0x327215)){if(_[_0x4de6('0x27')](_0x20eb9e[_0x327215])){for(var _0xa2b88c=0x0;_0xa2b88c<_0x20eb9e[_0x327215][_0x4de6('0x28')];_0xa2b88c+=0x1){addVertex(_0x426a15,_0x20eb9e[_0x327215][_0xa2b88c],_0x327215);}}else{addVertex(_0x426a15,_0x20eb9e[_0x327215],_0x327215);}}}for(var _0x28cf1e=0x0;_0x28cf1e<_0x69e2dd['length'];_0x28cf1e+=0x1){if(_0x69e2dd[_0x28cf1e][_0x4de6('0x29')]&&_0x69e2dd[_0x28cf1e][_0x4de6('0x2a')]){_0x426a15[_0x4de6('0x2b')](_0x69e2dd[_0x28cf1e][_0x4de6('0x29')],_0x69e2dd[_0x28cf1e][_0x4de6('0x2a')],_0x69e2dd[_0x28cf1e]['value']);}}return _0x426a15;}function getSquareProject(_0x2a6797,_0x4c6abd){rpc[_0x4de6('0x2c')](_0x2a6797)[_0x4de6('0x2d')](function(_0x1df7c0){_0x4c6abd(null,_0x1df7c0);})[_0x4de6('0x2e')](function(_0x592799){_0x4c6abd(null,_0x592799);});}function createSquareReport(_0x5593e8,_0x530e04){rpc['createSquareReport'](_0x5593e8)['then'](function(_0x46d57a){if(_0x530e04){_0x530e04(null,_0x46d57a);}})[_0x4de6('0x2e')](function(_0x4a5274){if(_0x530e04){_0x530e04(null,_0x4a5274);}});}function setChannelVariables(_0x3638f1){for(var _0x30357d in _0x3638f1){if(_0x3638f1[_0x4de6('0x22')](_0x30357d)){if(_0x30357d[_0x4de6('0x2f')](_0x4de6('0x30'))===0x0){_0x3638f1[_0x30357d[_0x4de6('0x31')](0x4)]=_0x3638f1[_0x30357d];delete _0x3638f1[_0x30357d];}}}}function getLogFromObject(_0x349cd3){return util[_0x4de6('0x32')](_0x349cd3,{'showHidden':![],'depth':null});}function agiHandler(_0x331378){var _0xcf091f,_0x19c43b,_0x50788a,_0x148124,_0x182400;logger[_0x4de6('0x33')](_0x4de6('0x34'),JSON[_0x4de6('0x35')](_0x331378,null,0x2));logger[_0x4de6('0xf')](util[_0x4de6('0x10')](_0x4de6('0x36'),_0x331378[_0x4de6('0x1c')],_0x331378[_0x4de6('0x17')],_0x331378[_0x4de6('0x18')],_0x331378[_0x4de6('0x19')],_0x331378[_0x4de6('0x1a')]));_0x331378['on'](_0x4de6('0xc'),errorHandler);_0x331378['on']('close',closeHandler);_0x331378['on'](_0x4de6('0x37'),timeoutHandler);_0x331378[_0x4de6('0x1e')]=![];_0x331378['on'](_0x4de6('0x38'),hangupHandler);var _0x3bf31f=getSquareProject['sync'](null,_0x331378[_0x4de6('0x1c')]);if(_0x3bf31f){if(_0x3bf31f[_0x4de6('0x39')]){_0xcf091f=getRoot(_0x3bf31f[_0x4de6('0x39')]);if(_0xcf091f&&_0xcf091f[_0x4de6('0x3a')]){logger['debug'](_0x4de6('0x20'),JSON['stringify'](_0xcf091f,null,0x2));_0x331378[_0x4de6('0x3b')]=moment()[_0x4de6('0x10')](_0x4de6('0x3c'));_0x19c43b=initGraph(_[_0x4de6('0x26')](_0xcf091f,_0x4de6('0x3d')),_0xcf091f[_0x4de6('0x3d')]);_0x50788a=new Vertices(_0x331378,rpc,mailRpc);logger[_0x4de6('0xf')](util[_0x4de6('0x10')](_0x4de6('0x3e'),_0x331378[_0x4de6('0x1c')],_0x331378[_0x4de6('0x17')],_0x331378[_0x4de6('0x18')],_0x331378['dnid'],_0x331378['uniqueid']));_0x19c43b[_0x4de6('0x3f')](_0xcf091f[_0x4de6('0x3a')]['id'],function(_0x114971){try{_0x114971=_0x50788a[_0x4de6('0x40')](_0x114971);logger['debug']('vertex',JSON[_0x4de6('0x35')](_0x114971,null,0x2));if(_0x114971['agicommand']===_0x4de6('0x41')){logger['info'](_0x4de6('0x42'));_0x331378['context']=_0x114971[_0x4de6('0x43')]||_0x331378[_0x4de6('0x43')];_0x331378[_0x4de6('0x44')]=_0x114971[_0x4de6('0x44')];_0x331378['priority']=_0x114971[_0x4de6('0x45')]?_0x114971[_0x4de6('0x45')]-0x1:0x1;return null;}else if(_0x114971&&_0x50788a[_0x114971['agicommand']]){_0x182400=_0x50788a[_0x114971['agicommand']](_0x114971);logger[_0x4de6('0xf')]('response',JSON[_0x4de6('0x35')](_0x182400,null,0x2));if(_0x182400&&_0x182400[_0x4de6('0x46')]===AGI_CODE_SUCCESS&&_0x182400[_0x4de6('0x47')]!==AGI_RESULT_ERROR&&!_0x331378[_0x4de6('0x1e')]){logger[_0x4de6('0x33')](_0x4de6('0x48'),getLogFromObject(_0x182400));return _[_0x4de6('0x49')](_0x182400[_0x4de6('0x47')])?null:_0x182400[_0x4de6('0x47')][_0x4de6('0x4a')]();}else{logger[_0x4de6('0xc')](_0x4de6('0x48'),getLogFromObject(_0x182400));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x584014){logger[_0x4de6('0xc')](_0x584014[_0x4de6('0x16')]);return null;}});if(_0xcf091f['finally']){logger['info'](util[_0x4de6('0x10')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x331378[_0x4de6('0x1c')],_0x331378[_0x4de6('0x17')],_0x331378['callerid'],_0x331378[_0x4de6('0x19')],_0x331378[_0x4de6('0x1a')]));_0x19c43b[_0x4de6('0x3f')](_0xcf091f[_0x4de6('0x4b')]['id'],function(_0x394e8d){try{_0x394e8d=_0x50788a['clear'](_0x394e8d);logger[_0x4de6('0x33')](_0x4de6('0x4c'),JSON[_0x4de6('0x35')](_0x394e8d,null,0x2));if(_0x394e8d&&_0x50788a[_0x394e8d[_0x4de6('0x21')]]){_0x182400=_0x50788a[_0x394e8d[_0x4de6('0x21')]](_0x394e8d);if(_0x182400){logger[_0x4de6('0x33')](_0x4de6('0x48'),getLogFromObject(_0x182400));return _[_0x4de6('0x49')](_0x182400[_0x4de6('0x47')])?null:_0x182400[_0x4de6('0x47')][_0x4de6('0x4a')]();}else{logger[_0x4de6('0xc')](_0x4de6('0x48'),getLogFromObject(_0x182400));return null;}}else{logger[_0x4de6('0xc')](_0x4de6('0x4d'));return null;}}catch(_0x12ce25){logger[_0x4de6('0xc')](_0x12ce25['stack']);return null;}});}logger['info'](util[_0x4de6('0x10')](_0x4de6('0x4e'),_0x331378['arg_1'],_0x331378[_0x4de6('0x17')],_0x331378[_0x4de6('0x18')],_0x331378[_0x4de6('0x19')],_0x331378[_0x4de6('0x1a')]));logger[_0x4de6('0xf')](util[_0x4de6('0x10')](_0x4de6('0x4f'),_0x331378['context'],_0x331378[_0x4de6('0x44')],parseInt(_0x331378['priority'],0xa)+0x1));_0x331378[_0x4de6('0x50')](_0x331378[_0x4de6('0x43')],_0x331378[_0x4de6('0x44')],parseInt(_0x331378[_0x4de6('0x45')],0xa)+0x1);_0x331378[_0x4de6('0x51')]();}}else{logger[_0x4de6('0xc')](util[_0x4de6('0x10')](_0x4de6('0x52'),_0x331378['arg_1']));_0x331378['continueAt'](_0x331378[_0x4de6('0x43')],_0x331378[_0x4de6('0x44')],parseInt(_0x331378[_0x4de6('0x45')],0xa)+0x1);_0x331378[_0x4de6('0x51')]();}}else{logger['error'](util[_0x4de6('0x10')](_0x4de6('0x53'),_0x331378[_0x4de6('0x1c')]));_0x331378['continueAt'](_0x331378[_0x4de6('0x43')],_0x331378['extension'],parseInt(_0x331378[_0x4de6('0x45')],0xa)+0x1);_0x331378[_0x4de6('0x51')]();}}function main(){var _0x58b970;return utilLicense[_0x4de6('0x54')]()[_0x4de6('0x2d')](function(_0x5bcd23){if(_0x5bcd23){if(_0x5bcd23[_0x4de6('0x55')]){if(_0x5bcd23[_0x4de6('0x56')]&&_0x5bcd23[_0x4de6('0x56')]>0x0){logger[_0x4de6('0xf')](util[_0x4de6('0x10')](_0x4de6('0x57'),_0x5bcd23[_0x4de6('0x56')]));_0x58b970=_0x5bcd23[_0x4de6('0x56')];}else{logger[_0x4de6('0xf')](_0x4de6('0x58'));}}else{logger[_0x4de6('0xf')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x58b970=-0x1;}}})[_0x4de6('0x2e')](function(_0x225bde){logger[_0x4de6('0xc')]('[LICENSE]',_0x225bde[_0x4de6('0x16')]);})[_0x4de6('0x4b')](function(){var _0x5a92cc=require(_0x4de6('0x59'))(config[_0x4de6('0x6')][_0x4de6('0x5a')],config[_0x4de6('0x6')]['ip'],_0x58b970);_0x5a92cc['on']('error',errorHandler);_0x5a92cc['on'](_0x4de6('0x5b'),listeningHandler);_0x5a92cc['on'](_0x4de6('0x5c'),connectionHandler);_0x5a92cc['on'](_0x4de6('0x51'),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 71e41bc..ca63cfb 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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x36c9ea,_0x55f802){var _0xc95b5=function(_0x50aac1){while(--_0x50aac1){_0x36c9ea['push'](_0x36c9ea['shift']());}};_0xc95b5(++_0x55f802);}(_0x814b,0x1a2));var _0xb814=function(_0x12ca7a,_0x3295bf){_0x12ca7a=_0x12ca7a-0x0;var _0x2249df=_0x814b[_0x12ca7a];return _0x2249df;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x1975d6,_0x415d74){var _0xe99a33=function(_0x507da3){while(--_0x507da3){_0x1975d6['push'](_0x1975d6['shift']());}};_0xe99a33(++_0x415d74);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 6e298a5..a0349b2 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0xf3c843,_0x8ff24e){var _0x3191c6=function(_0x2f1ef7){while(--_0x2f1ef7){_0xf3c843['push'](_0xf3c843['shift']());}};_0x3191c6(++_0x8ff24e);}(_0xb10b,0x12a));var _0xbb10=function(_0xa6180a,_0x508ff9){_0xa6180a=_0xa6180a-0x0;var _0x10f626=_0xb10b[_0xa6180a];return _0x10f626;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x40750d,_0x593094){var _0x42d026=function(_0x1168bb){while(--_0x1168bb){_0x40750d['push'](_0x40750d['shift']());}};_0x42d026(++_0x593094);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4b4df1,_0x5647ec){_0x4b4df1=_0x4b4df1-0x0;var _0xd79cb=_0x5f2f[_0x4b4df1];return _0xd79cb;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 53c712b..843f22a 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 _0x176a=['message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','getSquareProjectById','name','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getTrunkById','ShowTrunk','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','UnpauseUser','agentLogout','bluebird','jayson/promise','client','request','then','error'];(function(_0x47041d,_0x42153f){var _0x5022bd=function(_0x1dbb9a){while(--_0x1dbb9a){_0x47041d['push'](_0x47041d['shift']());}};_0x5022bd(++_0x42153f);}(_0x176a,0x8a));var _0xa176=function(_0x14940c,_0x45ab02){_0x14940c=_0x14940c-0x0;var _0x342912=_0x176a[_0x14940c];return _0x342912;};'use strict';var BPromise=require(_0xa176('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var jayson=require(_0xa176('0x1'));var client=jayson[_0xa176('0x2')]['http']({'port':0x2329});function request(_0x421675,_0x2b30c){return new BPromise(function(_0x8d094,_0x2654fd){return client[_0xa176('0x3')](_0x421675,_0x2b30c)[_0xa176('0x4')](function(_0xc86fbb){if(_0xc86fbb[_0xa176('0x5')]){return _0x2654fd(_0xc86fbb[_0xa176('0x5')][_0xa176('0x6')]);}else{return _0x8d094(_0xc86fbb[_0xa176('0x7')]);}})[_0xa176('0x8')](function(_0x46242f){return _0x2654fd(_0x46242f);});});}exports[_0xa176('0x9')]=function(_0x536bd8){return request(_0xa176('0xa'),{'options':{'raw':![],'where':{'name':_0x536bd8},'attributes':[_0xa176('0xb')]}});};exports[_0xa176('0xc')]=function(_0x20f01e){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x20f01e},'include':[{'model':_0xa176('0xd'),'as':_0xa176('0xe')}],'attributes':['id','name','email']}});};exports[_0xa176('0xf')]=function(_0xd3a21e){return request(_0xa176('0xa'),{'options':{'where':{'id':_0xd3a21e},'attributes':[_0xa176('0x10')]}});};exports['getVoiceQueueById']=function(_0x50d290){return request(_0xa176('0x11'),{'options':{'where':{'id':_0x50d290},'attributes':[_0xa176('0x10')]}});};exports[_0xa176('0x12')]=function(_0x36c0d7){return request('ShowVariable',{'options':{'where':{'id':_0x36c0d7},'attributes':['name']}});};exports[_0xa176('0x13')]=function(_0x134c72){return request(_0xa176('0x14'),{'options':{'where':{'id':_0x134c72},'attributes':[_0xa176('0x15')]}});};exports['getUserById']=function(_0x45e989){return request('ShowUser',{'options':{'where':{'id':_0x45e989},'attributes':[_0xa176('0x10')]}});};exports[_0xa176('0x16')]=function(_0x39a536){return request(_0xa176('0x17'),{'options':{'where':{'id':_0x39a536},'attributes':[_0xa176('0x10')]}});};exports['getSoundById']=function(_0x359934){return request('ShowSound',{'options':{'where':{'id':_0x359934},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x17abdc){return request(_0xa176('0x18'),{'options':{'raw':![],'where':{'id':_0x17abdc},'include':[{'model':_0xa176('0x19'),'as':'Intervals'}]}});};exports[_0xa176('0x1a')]=function(_0x115783){return request(_0xa176('0x1b'),{'options':{'where':{'id':_0x115783},'attributes':['id',_0xa176('0x10')]}});};exports['createSmsMessage']=function(_0x206868){return request(_0xa176('0x1c'),{'body':_0x206868});};exports[_0xa176('0x1d')]=function(_0x448e90){return request(_0xa176('0x1e'),{'body':_0x448e90});};exports['createSquareReport']=function(_0x4fa01d){return request(_0xa176('0x1f'),{'body':_['merge'](_0x4fa01d,{'project_name':_0x4fa01d[_0xa176('0x20')],'prev_project_name':_0x4fa01d[_0xa176('0x21')]||'','is_subproject':_0x4fa01d['arg_2']?!![]:![],'leaveAt':moment()[_0xa176('0x22')](_0xa176('0x23'))})});};exports['createSquareRecording']=function(_0x57ee1a){return request(_0xa176('0x24'),{'body':_0x57ee1a});};exports[_0xa176('0x25')]=function(_0x255188){return request('CreateSquareMessage',{'body':_0x255188});};exports[_0xa176('0x26')]=function(_0xd23a52){return request(_0xa176('0x27'),{'options':{'raw':![],'where':{'phone':_0xd23a52[_0xa176('0x28')],'ListId':_0xd23a52['ListId']}}})[_0xa176('0x4')](function(_0x3ca3c6){if(_0x3ca3c6){return _0x3ca3c6;}return request(_0xa176('0x29'),{'body':_0xd23a52});});};exports[_0xa176('0x2a')]=function(_0x57c55a){return request('ShowPause',{'options':{'where':{'id':_0x57c55a},'attributes':[_0xa176('0x10')]}});};exports[_0xa176('0x2b')]=function(_0x4988c0,_0x3d03cf){return request(_0xa176('0x2c'),{'body':{'interface':_0x3d03cf},'options':{'where':_0x4988c0}});};exports[_0xa176('0x2d')]=function(_0x392ea5,_0x5c8c0e,_0x30456f){return request('PauseUser',{'body':{'type':_0x5c8c0e,'uniqueid':_0x30456f},'options':{'where':_0x392ea5}});};exports['agentUnpause']=function(_0x4059fa){return request(_0xa176('0x2e'),{'body':{},'options':{'where':_0x4059fa}});};exports[_0xa176('0x2f')]=function(_0x5d07ff){return request('LogoutUser',{'body':{},'options':{'where':_0x5d07ff}});}; \ No newline at end of file +var _0xc692=['LogoutUser','bluebird','moment','lodash','client','http','request','message','result','catch','getSquareProject','production','MailServerOut','Smtp','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','ShowUser','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','then','getPauseById','agentLogin','agentPause','agentUnpause','agentLogout'];(function(_0x1a79ad,_0x28ed97){var _0x5ab211=function(_0x39cc8a){while(--_0x39cc8a){_0x1a79ad['push'](_0x1a79ad['shift']());}};_0x5ab211(++_0x28ed97);}(_0xc692,0x15f));var _0x2c69=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xc692[_0x550d12];return _0x12103d;};'use strict';var BPromise=require(_0x2c69('0x0'));var moment=require(_0x2c69('0x1'));var _=require(_0x2c69('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x2c69('0x3')][_0x2c69('0x4')]({'port':0x2329});function request(_0x3edb0f,_0xc5cd86){return new BPromise(function(_0x3c67e3,_0x319fc4){return client[_0x2c69('0x5')](_0x3edb0f,_0xc5cd86)['then'](function(_0x17a476){if(_0x17a476['error']){return _0x319fc4(_0x17a476['error'][_0x2c69('0x6')]);}else{return _0x3c67e3(_0x17a476[_0x2c69('0x7')]);}})[_0x2c69('0x8')](function(_0x12da5d){return _0x319fc4(_0x12da5d);});});}exports[_0x2c69('0x9')]=function(_0x131313){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x131313},'attributes':[_0x2c69('0xa')]}});};exports['getMailAccountById']=function(_0x3340d0){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x3340d0},'include':[{'model':_0x2c69('0xb'),'as':_0x2c69('0xc')}],'attributes':['id',_0x2c69('0xd'),_0x2c69('0xe')]}});};exports[_0x2c69('0xf')]=function(_0xa68f00){return request('ShowSquareProject',{'options':{'where':{'id':_0xa68f00},'attributes':[_0x2c69('0xd')]}});};exports['getVoiceQueueById']=function(_0x45b1f7){return request(_0x2c69('0x10'),{'options':{'where':{'id':_0x45b1f7},'attributes':[_0x2c69('0xd')]}});};exports[_0x2c69('0x11')]=function(_0x37a24d){return request(_0x2c69('0x12'),{'options':{'where':{'id':_0x37a24d},'attributes':['name']}});};exports[_0x2c69('0x13')]=function(_0x5f0f52){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x5f0f52},'attributes':[_0x2c69('0x14')]}});};exports['getUserById']=function(_0x11649b){return request(_0x2c69('0x15'),{'options':{'where':{'id':_0x11649b},'attributes':['name']}});};exports['getTrunkById']=function(_0x3bd4a3){return request(_0x2c69('0x16'),{'options':{'where':{'id':_0x3bd4a3},'attributes':[_0x2c69('0xd')]}});};exports['getSoundById']=function(_0x57fe09){return request(_0x2c69('0x17'),{'options':{'where':{'id':_0x57fe09},'attributes':[_0x2c69('0x18')]}});};exports[_0x2c69('0x19')]=function(_0x5a9d56){return request(_0x2c69('0x1a'),{'options':{'raw':![],'where':{'id':_0x5a9d56},'include':[{'model':'Interval','as':_0x2c69('0x1b')}]}});};exports[_0x2c69('0x1c')]=function(_0x1e83bf){return request(_0x2c69('0x1d'),{'options':{'where':{'id':_0x1e83bf},'attributes':['id','name']}});};exports[_0x2c69('0x1e')]=function(_0x2ec1cd){return request(_0x2c69('0x1f'),{'body':_0x2ec1cd});};exports['createSquareDetailsReport']=function(_0x415c4b){return request('CreateSquareDetailsReport',{'body':_0x415c4b});};exports['createSquareReport']=function(_0x1b73f2){return request(_0x2c69('0x20'),{'body':_[_0x2c69('0x21')](_0x1b73f2,{'project_name':_0x1b73f2['arg_1'],'prev_project_name':_0x1b73f2['arg_2']||'','is_subproject':_0x1b73f2[_0x2c69('0x22')]?!![]:![],'leaveAt':moment()[_0x2c69('0x23')](_0x2c69('0x24'))})});};exports[_0x2c69('0x25')]=function(_0x12dbca){return request(_0x2c69('0x26'),{'body':_0x12dbca});};exports[_0x2c69('0x27')]=function(_0x2a0569){return request(_0x2c69('0x28'),{'body':_0x2a0569});};exports['createCmContact']=function(_0x7dd85a){return request(_0x2c69('0x29'),{'options':{'raw':![],'where':{'phone':_0x7dd85a['phone'],'ListId':_0x7dd85a[_0x2c69('0x2a')]}}})[_0x2c69('0x2b')](function(_0x2238a9){if(_0x2238a9){return _0x2238a9;}return request('CreateCmContact',{'body':_0x7dd85a});});};exports[_0x2c69('0x2c')]=function(_0xfe88bf){return request('ShowPause',{'options':{'where':{'id':_0xfe88bf},'attributes':[_0x2c69('0xd')]}});};exports[_0x2c69('0x2d')]=function(_0x27150a,_0x24732c){return request('LoginUser',{'body':{'interface':_0x24732c},'options':{'where':_0x27150a}});};exports[_0x2c69('0x2e')]=function(_0x77babf,_0x47a853,_0x5c56a9){return request('PauseUser',{'body':{'type':_0x47a853,'uniqueid':_0x5c56a9},'options':{'where':_0x77babf}});};exports[_0x2c69('0x2f')]=function(_0x5cd649){return request('UnpauseUser',{'body':{},'options':{'where':_0x5cd649}});};exports[_0x2c69('0x30')]=function(_0x21f0bf){return request(_0x2c69('0x31'),{'body':{},'options':{'where':_0x21f0bf}});}; \ 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 d31e597..b0a7f4c 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 _0x7cce=['./lex','exports','./polly'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x7cce,0x119));var _0xe7cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cce[_0x3dd15e];return _0x231fd0;};var polly=require(_0xe7cc('0x0'));var lex=require(_0xe7cc('0x1'));module[_0xe7cc('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xbbe4=['exports'];(function(_0x2fa996,_0x26e244){var _0x302927=function(_0x4547a1){while(--_0x4547a1){_0x2fa996['push'](_0x2fa996['shift']());}};_0x302927(++_0x26e244);}(_0xbbe4,0xf9));var _0x4bbe=function(_0x310926,_0x226e01){_0x310926=_0x310926-0x0;var _0x205927=_0xbbe4[_0x310926];return _0x205927;};var polly=require('./polly');var lex=require('./lex');module[_0x4bbe('0x0')]={'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 ae65872..44c77ab 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. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x46441c,_0x3c645a,_0x48adc3,_0x270dda,_0x7191f2,_0x5709b7){return lex(_0x46441c,_0x3c645a,_0x48adc3,_0x270dda,_0x7191f2,_0x5709b7);}; \ No newline at end of file +var _0x851e=['./lib/api','exports'];(function(_0x3cdfd7,_0x43e395){var _0x24ca07=function(_0x1115ab){while(--_0x1115ab){_0x3cdfd7['push'](_0x3cdfd7['shift']());}};_0x24ca07(++_0x43e395);}(_0x851e,0x1e8));var _0xe851=function(_0xd98def,_0x19ebc7){_0xd98def=_0xd98def-0x0;var _0x55b182=_0x851e[_0xd98def];return _0x55b182;};'use strict';var lex=require(_0xe851('0x0'));module[_0xe851('0x1')]=function(_0x2bc74b,_0x536c19,_0x506932,_0x122708,_0x11f06b,_0x16b38a){return lex(_0x2bc74b,_0x536c19,_0x506932,_0x122708,_0x11f06b,_0x16b38a);}; \ 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 a5ba913..aee889e 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 _0x8ac3=['bluebird','aws-sdk','postText','slots','hasOwnProperty','exports','LexRuntime'];(function(_0x40822a,_0x582b60){var _0x357420=function(_0x6cee0b){while(--_0x6cee0b){_0x40822a['push'](_0x40822a['shift']());}};_0x357420(++_0x582b60);}(_0x8ac3,0x19d));var _0x38ac=function(_0x760936,_0x5f38be){_0x760936=_0x760936-0x0;var _0x19684d=_0x8ac3[_0x760936];return _0x19684d;};'use strict';var BPromise=require(_0x38ac('0x0'));var AWS=require(_0x38ac('0x1'));function lexResult(_0x2ed3c2,_0x47da2d){return new BPromise(function(_0x204d32,_0x5b5b8a){_0x2ed3c2[_0x38ac('0x2')](_0x47da2d,function(_0x1a6188,_0x5ec03f){if(_0x1a6188){_0x5b5b8a(_0x1a6188);}if(_0x5ec03f[_0x38ac('0x3')]){for(const _0x57ccd7 in _0x5ec03f[_0x38ac('0x3')]){if(_0x5ec03f['slots'][_0x38ac('0x4')](_0x57ccd7)){var _0x233f6=_0x5ec03f[_0x38ac('0x3')][_0x57ccd7];_0x5ec03f['slot_'+_0x57ccd7]=_0x233f6;}}}_0x204d32(_0x5ec03f);});});}module[_0x38ac('0x5')]=function(_0x396ad6,_0x55fe13,_0x376eb0,_0x5d3610,_0x1e9d6e,_0x4a1a1a){var _0x524855=new AWS[(_0x38ac('0x6'))]({'accessKeyId':_0x55fe13,'secretAccessKey':_0x376eb0,'region':_0x5d3610});var _0x3c5645={'botAlias':'$LATEST','botName':_0x4a1a1a,'inputText':_0x1e9d6e,'userId':_0x396ad6};return lexResult(_0x524855,_0x3c5645);}; \ No newline at end of file +var _0x683f=['LexRuntime','$LATEST','bluebird','slots','slot_','exports'];(function(_0x1b0b1b,_0x354de8){var _0x10c0e5=function(_0x103fa2){while(--_0x103fa2){_0x1b0b1b['push'](_0x1b0b1b['shift']());}};_0x10c0e5(++_0x354de8);}(_0x683f,0x1a0));var _0xf683=function(_0x5df033,_0x29458b){_0x5df033=_0x5df033-0x0;var _0x445829=_0x683f[_0x5df033];return _0x445829;};'use strict';var BPromise=require(_0xf683('0x0'));var AWS=require('aws-sdk');function lexResult(_0x5d76d1,_0x1541af){return new BPromise(function(_0x2e594d,_0x601e29){_0x5d76d1['postText'](_0x1541af,function(_0x416e9f,_0x2a8d86){if(_0x416e9f){_0x601e29(_0x416e9f);}if(_0x2a8d86[_0xf683('0x1')]){for(const _0x334ce0 in _0x2a8d86[_0xf683('0x1')]){if(_0x2a8d86[_0xf683('0x1')]['hasOwnProperty'](_0x334ce0)){var _0x172a47=_0x2a8d86[_0xf683('0x1')][_0x334ce0];_0x2a8d86[_0xf683('0x2')+_0x334ce0]=_0x172a47;}}}_0x2e594d(_0x2a8d86);});});}module[_0xf683('0x3')]=function(_0xe7c00a,_0x468d00,_0x8f7684,_0x8dd78a,_0x37ea6e,_0x397f08){var _0x545736=new AWS[(_0xf683('0x4'))]({'accessKeyId':_0x468d00,'secretAccessKey':_0x8f7684,'region':_0x8dd78a});var _0x32f699={'botAlias':_0xf683('0x5'),'botName':_0x397f08,'inputText':_0x37ea6e,'userId':_0xe7c00a};return lexResult(_0x545736,_0x32f699);}; \ 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 cf24663..15977bf 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 _0x966a=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x966a,0x66));var _0xa966=function(_0x42024a,_0x5f2cf3){_0x42024a=_0x42024a-0x0;var _0x4449aa=_0x966a[_0x42024a];return _0x4449aa;};'use strict';var polly=require('./lib/api');module[_0xa966('0x0')]=function(_0x92b523,_0x2d4bbb,_0x1deb8c,_0x1b9188,_0x59b137,_0x4eba74,_0x14c11c){return polly(_0x92b523,_0x2d4bbb,_0x1deb8c,_0x1b9188,_0x59b137,_0x4eba74,_0x14c11c);}; \ No newline at end of file +var _0x9a78=['exports'];(function(_0x208ab1,_0x29a991){var _0x3efab4=function(_0x4e0f88){while(--_0x4e0f88){_0x208ab1['push'](_0x208ab1['shift']());}};_0x3efab4(++_0x29a991);}(_0x9a78,0xc9));var _0x89a7=function(_0xfb8129,_0x4412a0){_0xfb8129=_0xfb8129-0x0;var _0x4e959d=_0x9a78[_0xfb8129];return _0x4e959d;};'use strict';var polly=require('./lib/api');module[_0x89a7('0x0')]=function(_0x49a43b,_0x4d74fa,_0x483dba,_0x1d19e1,_0xb3c239,_0x379587,_0x2f7eaa){return polly(_0x49a43b,_0x4d74fa,_0x483dba,_0x1d19e1,_0xb3c239,_0x379587,_0x2f7eaa);}; \ 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 aa0fa15..a1087a6 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 _0x16b3=['text','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0xee59d4,_0x4a6f0c){var _0x1f06b6=function(_0x4fd061){while(--_0x4fd061){_0xee59d4['push'](_0xee59d4['shift']());}};_0x1f06b6(++_0x4a6f0c);}(_0x16b3,0xe7));var _0x316b=function(_0x1da1ee,_0x4446f1){_0x1da1ee=_0x1da1ee-0x0;var _0x2f51bd=_0x16b3[_0x1da1ee];return _0x2f51bd;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x316b('0x0'));var rs=require(_0x316b('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x4a94b0,_0x4f6f55,_0x313618){return new BPromise(function(_0x38fcec,_0x4a470b){_0x4a94b0[_0x316b('0x2')](_0x4f6f55,function(_0x3f2ccd,_0x3d6ade){if(_0x3f2ccd){_0x4a470b(_0x3f2ccd);}else if(_0x3d6ade){if(_0x3d6ade[_0x316b('0x3')]instanceof Buffer){fs[_0x316b('0x4')](_0x313618,_0x3d6ade['AudioStream'],function(_0xca29be){if(_0xca29be){_0x4a470b(_0xca29be);}else{_0x38fcec();}});}else{_0x4a470b(new Error(_0x316b('0x5')));}}else{_0x4a470b(new Error(_0x316b('0x6')));}});});}module[_0x316b('0x7')]=function(_0x209f3d,_0x5349c9,_0x4c15a7,_0x1e65ae,_0x411ada,_0x2f9066,_0x26a7e2){var _0x302231=new AWS[(_0x316b('0x8'))]({'accessKeyId':_0x209f3d,'secretAccessKey':_0x5349c9,'region':_0x4c15a7});var _0x5a7f5c={'Text':_0x411ada,'TextType':_0x2f9066||_0x316b('0x9'),'OutputFormat':'mp3','VoiceId':_0x1e65ae};return pollyResult(_0x302231,_0x5a7f5c,_0x26a7e2);}; \ No newline at end of file +var _0x5c09=['path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3'];(function(_0x23536f,_0xd285fb){var _0xb4e018=function(_0x13d183){while(--_0x13d183){_0x23536f['push'](_0x23536f['shift']());}};_0xb4e018(++_0xd285fb);}(_0x5c09,0x10e));var _0x95c0=function(_0x6cd2c6,_0x4517fc){_0x6cd2c6=_0x6cd2c6-0x0;var _0x2901fc=_0x5c09[_0x6cd2c6];return _0x2901fc;};'use strict';var fs=require('fs');var path=require(_0x95c0('0x0'));var BPromise=require(_0x95c0('0x1'));var rs=require('randomstring');var AWS=require(_0x95c0('0x2'));function pollyResult(_0x31eba8,_0x695a5d,_0x376ecb){return new BPromise(function(_0x2431fb,_0x4489b3){_0x31eba8[_0x95c0('0x3')](_0x695a5d,function(_0x250e3d,_0x4749ca){if(_0x250e3d){_0x4489b3(_0x250e3d);}else if(_0x4749ca){if(_0x4749ca[_0x95c0('0x4')]instanceof Buffer){fs['writeFile'](_0x376ecb,_0x4749ca['AudioStream'],function(_0x3ef743){if(_0x3ef743){_0x4489b3(_0x3ef743);}else{_0x2431fb();}});}else{_0x4489b3(new Error(_0x95c0('0x5')));}}else{_0x4489b3(new Error(_0x95c0('0x6')));}});});}module['exports']=function(_0x36b2e8,_0x11dab0,_0x9bd9e0,_0x3d10e5,_0x2d003a,_0x4c265b,_0x3d5f48){var _0x3442cb=new AWS[(_0x95c0('0x7'))]({'accessKeyId':_0x36b2e8,'secretAccessKey':_0x11dab0,'region':_0x9bd9e0});var _0x279c48={'Text':_0x2d003a,'TextType':_0x4c265b||_0x95c0('0x8'),'OutputFormat':_0x95c0('0x9'),'VoiceId':_0x3d10e5};return pollyResult(_0x3442cb,_0x279c48,_0x3d5f48);}; \ 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 78aefd8..6ab0446 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 _0x1cc3=['exports','./lib/api'];(function(_0x392bd3,_0x563eef){var _0x2b53d8=function(_0x2b372c){while(--_0x2b372c){_0x392bd3['push'](_0x392bd3['shift']());}};_0x2b53d8(++_0x563eef);}(_0x1cc3,0x11b));var _0x31cc=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x1cc3[_0x13d07a];return _0x5ee0ee;};'use strict';var asr=require(_0x31cc('0x0'));module[_0x31cc('0x1')]=function(_0x50bc9e,_0x4e2234,_0x4dd659,_0xaa24b0){return asr(_0x50bc9e,_0x4e2234,_0x4dd659);}; \ No newline at end of file +var _0xc936=['exports'];(function(_0x41491c,_0x346546){var _0x34ecd1=function(_0x4f0881){while(--_0x4f0881){_0x41491c['push'](_0x41491c['shift']());}};_0x34ecd1(++_0x346546);}(_0xc936,0x153));var _0x6c93=function(_0x3b7fb9,_0x556210){_0x3b7fb9=_0x3b7fb9-0x0;var _0x4170e8=_0xc936[_0x3b7fb9];return _0x4170e8;};'use strict';var asr=require('./lib/api');module[_0x6c93('0x0')]=function(_0x5f5c85,_0x22379f,_0x1a6a08,_0x27723b){return asr(_0x5f5c85,_0x22379f,_0x1a6a08);}; \ 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 641fdbc..da0b7e9 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 _0x3203=['lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined'];(function(_0x413b13,_0x4a25de){var _0x1cad2e=function(_0x757303){while(--_0x757303){_0x413b13['push'](_0x413b13['shift']());}};_0x1cad2e(++_0x4a25de);}(_0x3203,0x93));var _0x3320=function(_0x3064a3,_0x20e71a){_0x3064a3=_0x3064a3-0x0;var _0x4319b6=_0x3203[_0x3064a3];return _0x4319b6;};'use strict';var url=require('url');var BPromise=require(_0x3320('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x3320('0x1')]=function(_0x1e2e56,_0x347cf7,_0x39b1b3){return new BPromise(function(_0x324ac9,_0x45bf5e){var _0xc0c967;if(typeof _0x1e2e56!==_0x3320('0x2')||_0x1e2e56[_0x3320('0x3')]===0x0){return _0x45bf5e(_0x3320('0x4'));}if(typeof _0x347cf7!==_0x3320('0x2')||_0x347cf7[_0x3320('0x3')]===0x0){return _0x45bf5e(_0x3320('0x5'));}if(typeof _0x39b1b3!==_0x3320('0x6')&&(typeof _0x39b1b3!==_0x3320('0x2')||_0x39b1b3[_0x3320('0x3')]===0x0)){return _0x45bf5e(_0x3320('0x7'));}try{_0xc0c967=fs['readFileSync'](_0x1e2e56)[_0x3320('0x8')](_0x3320('0x9'));}catch(_0x900669){return _0x45bf5e(_0x900669);}return _0x324ac9({'method':_0x3320('0xa'),'uri':host+_0x3320('0xb')+_0x347cf7,'body':{'config':{'encoding':_0x3320('0xc'),'sampleRateHertz':_0x3320('0xd'),'languageCode':_0x39b1b3},'audio':{'content':_0xc0c967}},'json':!![]});});}; \ No newline at end of file +var _0xbf1a=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','readFileSync','toString','base64','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string'];(function(_0x39c3cf,_0x5a49aa){var _0x381914=function(_0x31bac7){while(--_0x31bac7){_0x39c3cf['push'](_0x39c3cf['shift']());}};_0x381914(++_0x5a49aa);}(_0xbf1a,0x158));var _0xabf1=function(_0x237872,_0x3ff1d9){_0x237872=_0x237872-0x0;var _0x419817=_0xbf1a[_0x237872];return _0x419817;};'use strict';var url=require(_0xabf1('0x0'));var BPromise=require(_0xabf1('0x1'));var fs=require('fs');var host=_0xabf1('0x2');module['exports']=function(_0x26437f,_0x204611,_0x263487){return new BPromise(function(_0x47e1b6,_0x1cade1){var _0x2b29c1;if(typeof _0x26437f!==_0xabf1('0x3')||_0x26437f[_0xabf1('0x4')]===0x0){return _0x1cade1(_0xabf1('0x5'));}if(typeof _0x204611!==_0xabf1('0x3')||_0x204611[_0xabf1('0x4')]===0x0){return _0x1cade1(_0xabf1('0x6'));}if(typeof _0x263487!=='undefined'&&(typeof _0x263487!=='string'||_0x263487[_0xabf1('0x4')]===0x0)){return _0x1cade1('lang\x20should\x20be\x20a\x20string');}try{_0x2b29c1=fs[_0xabf1('0x7')](_0x26437f)[_0xabf1('0x8')](_0xabf1('0x9'));}catch(_0x11bb3d){return _0x1cade1(_0x11bb3d);}return _0x47e1b6({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x204611,'body':{'config':{'encoding':_0xabf1('0xa'),'sampleRateHertz':_0xabf1('0xb'),'languageCode':_0x263487},'audio':{'content':_0x2b29c1}},'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 5ef3cb5..81ae7fe 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 _0xedd9=['exports'];(function(_0x4e1e3d,_0x1becfb){var _0x30193c=function(_0x20664b){while(--_0x20664b){_0x4e1e3d['push'](_0x4e1e3d['shift']());}};_0x30193c(++_0x1becfb);}(_0xedd9,0xfc));var _0x9edd=function(_0x203f2a,_0x56bf4a){_0x203f2a=_0x203f2a-0x0;var _0x41bcd2=_0xedd9[_0x203f2a];return _0x41bcd2;};var asr=require('./asr');module[_0x9edd('0x0')]={'asr':asr}; \ No newline at end of file +var _0xedd9=['exports'];(function(_0x5a1ec2,_0x442062){var _0x1e086b=function(_0x53449f){while(--_0x53449f){_0x5a1ec2['push'](_0x5a1ec2['shift']());}};_0x1e086b(++_0x442062);}(_0xedd9,0xfc));var _0x9edd=function(_0x49f65b,_0x453206){_0x49f65b=_0x49f65b-0x0;var _0x2e7ad6=_0xedd9[_0x49f65b];return _0x2e7ad6;};var asr=require('./asr');module[_0x9edd('0x0')]={'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 4d90785..1152afb 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 _0xb10b=['url','parse','randomstring','sox','request-promise','util','querystring','moment','apiai-promise','md5','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','.wav','base64','then','readFileSync','toString','googleTTS','resolve','generate','.mp3','goggleTTS\x20path','split','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','catch','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','chmodSync','777','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','freeform=3','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https'];(function(_0x574ce3,_0x59eef4){var _0x3447a0=function(_0x27f8cb){while(--_0x27f8cb){_0x574ce3['push'](_0x574ce3['shift']());}};_0x3447a0(++_0x59eef4);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a2c03,_0x1f945a){_0x3a2c03=_0x3a2c03-0x0;var _0x4f6540=_0xb10b[_0x3a2c03];return _0x4f6540;};'use strict';var fs=require('fs');var path=require(_0xbb10('0x0'));var http=require('http');var https=require(_0xbb10('0x1'));var urlParse=require(_0xbb10('0x2'))[_0xbb10('0x3')];var BPromise=require('bluebird');var rs=require(_0xbb10('0x4'));var sox=require(_0xbb10('0x5'));var rp=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var querystring=require(_0xbb10('0x8'));var moment=require(_0xbb10('0x9'));var tts=require('google-tts-api');var apiai=require(_0xbb10('0xa'));var md5=require(_0xbb10('0xb'));var google=require('./google');var aws=require(_0xbb10('0xc'));var tilde=require(_0xbb10('0xd'));var sestek=require(_0xbb10('0xe'));var logger=require(_0xbb10('0xf'))(_0xbb10('0x10'));var ISPEECH_API=_0xbb10('0x11');function downloadFile(_0x229887,_0xa3adc8){return new BPromise(function(_0x5ab04a,_0x4e47f8){var _0x20bd61=urlParse(_0x229887);var _0x118a74=_0x20bd61[_0xbb10('0x12')]==='https:'?https:http;var _0x408248={'host':_0x20bd61['host'],'path':_0x20bd61[_0xbb10('0x0')],'headers':{'user-agent':_0xbb10('0x13')}};_0x118a74[_0xbb10('0x14')](_0x408248,function(_0x193a27){if(_0x193a27[_0xbb10('0x15')]!==0xc8){logger[_0xbb10('0x16')]('request\x20to\x20'+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')');_0x4e47f8(new Error(_0xbb10('0x19')+_0x229887+_0xbb10('0x17')+_0x193a27[_0xbb10('0x15')]+'\x20('+_0x193a27[_0xbb10('0x18')]+')'));return;}var _0x36b5e8=fs[_0xbb10('0x1a')](_0xa3adc8);_0x36b5e8['on'](_0xbb10('0x1b'),function(){logger['info'](_0xbb10('0x1c'));_0x36b5e8[_0xbb10('0x1d')](_0x5ab04a);});_0x36b5e8['on'](_0xbb10('0x16'),function(_0x42db98){fs[_0xbb10('0x1e')](_0xa3adc8);logger[_0xbb10('0x16')](_0xbb10('0x1f'),_0x42db98);_0x4e47f8(_0x42db98);});_0x193a27[_0xbb10('0x20')](_0x36b5e8);})['on'](_0xbb10('0x16'),function(_0xe1c665){logger['error'](_0xe1c665);_0x4e47f8(_0xe1c665);})[_0xbb10('0x21')]();});}function uploadFile(_0x19f48d){return new BPromise(function(_0x388fab,_0x109908){var _0xdf237d=urlParse(_0x19f48d);var _0x44e563=_0xdf237d['protocol']===_0xbb10('0x22')?https:http;var _0x12ef77={'host':_0xdf237d['host'],'path':_0xdf237d['path'],'headers':{'user-agent':_0xbb10('0x13')}};_0x44e563[_0xbb10('0x14')](_0x12ef77,function(_0x2e911d){if(_0x2e911d[_0xbb10('0x15')]!==0xc8){_0x109908(new Error(_0xbb10('0x19')+_0x19f48d+_0xbb10('0x17')+_0x2e911d[_0xbb10('0x15')]+'\x20('+_0x2e911d[_0xbb10('0x18')]+')'));return;}var _0x7f2377='';_0x2e911d['on'](_0xbb10('0x23'),function(_0x3ba6cd){_0x7f2377+=_0x3ba6cd;});_0x2e911d['on'](_0xbb10('0x21'),function(){_0x388fab(_0x7f2377);});})['on']('error',function(_0x4fedac){_0x109908(_0x4fedac);})['end']();});}function convertFile(_0xc93a04,_0x3c5ae7){return new BPromise(function(_0x2c89b9,_0x4e25ff){var _0x2fdde9=sox[_0xbb10('0x24')](_0xc93a04,_0x3c5ae7,{'sampleRate':0x1f40,'format':_0xbb10('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2fdde9['on'](_0xbb10('0x16'),function(_0x1acce9){logger[_0xbb10('0x16')](_0xbb10('0x26'),_0x1acce9);_0x4e25ff(_0x1acce9);});_0x2fdde9['on']('end',function(){logger[_0xbb10('0x27')](_0xbb10('0x28'));_0x2c89b9();});_0x2fdde9[_0xbb10('0x29')]();});}function base64Decode(_0x2e0249,_0x1d30aa){var _0x2ff4c1=path['resolve'](__dirname,_0xbb10('0x2a'),rs['generate'](0x4)+_0xbb10('0x2b'));fs['writeFileSync'](_0x2ff4c1,_0x2e0249,_0xbb10('0x2c'));return convertFile(_0x2ff4c1,_0x1d30aa)[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x2ff4c1);fs['chmodSync'](_0x1d30aa,'777');}catch(_0x4c3744){logger[_0xbb10('0x16')](_0x4c3744);}return _0x1d30aa['split']('.')[0x0];});}function base64Encode(_0x359ad4){var _0x37dde7=fs[_0xbb10('0x2e')](_0x359ad4);return new Buffer(_0x37dde7)[_0xbb10('0x2f')](_0xbb10('0x2c'));}exports[_0xbb10('0x30')]=function(_0xf85197,_0x4975f5){var _0x25acb3,_0x1da9c9;return tts(_0xf85197,_0x4975f5||'en',0x1)[_0xbb10('0x2d')](function(_0x8c1ce6){logger[_0xbb10('0x27')](_0x8c1ce6);_0x25acb3=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));return downloadFile(_0x8c1ce6,_0x25acb3);})['then'](function(){_0x1da9c9=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x25acb3,_0x1da9c9);})['then'](function(){try{fs[_0xbb10('0x1e')](_0x25acb3);fs['chmodSync'](_0x1da9c9,'777');}catch(_0x3eb3cc){logger[_0xbb10('0x16')](_0x3eb3cc);}logger[_0xbb10('0x27')](_0xbb10('0x34'),_0x1da9c9[_0xbb10('0x35')]('.')[0x0]);return _0x1da9c9[_0xbb10('0x35')]('.')[0x0];});};exports['googleASR']=function(_0x1e5bbd,_0x25d72f,_0x52de31){return google['asr'](_0x1e5bbd,_0x25d72f,_0x52de31)['then'](function(_0x31bee3){logger[_0xbb10('0x27')](_0x31bee3[_0xbb10('0x36')]);return rp(_0x31bee3);})['then'](function(_0x3c0cd7){var _0x3e8538='';var _0x4345f3=0x0;try{fs['unlink'](_0x1e5bbd);}catch(_0x17b6c5){logger[_0xbb10('0x16')](_0x17b6c5);}if(_0x3c0cd7&&_0x3c0cd7[_0xbb10('0x37')]){_0x3e8538=_0x3c0cd7[_0xbb10('0x37')]['map'](function(_0xd238e9){return _0xd238e9&&_0xd238e9[_0xbb10('0x38')][0x0]&&_0xd238e9['alternatives'][0x0][_0xbb10('0x39')]?_0xd238e9[_0xbb10('0x38')][0x0][_0xbb10('0x39')]:'';})[_0xbb10('0x3a')]('\x0a');_0x4345f3=_0x3c0cd7[_0xbb10('0x37')][_0xbb10('0x3b')](function(_0x5f3d67){return _0x5f3d67&&_0x5f3d67[_0xbb10('0x38')][0x0]&&_0x5f3d67[_0xbb10('0x38')][0x0][_0xbb10('0x3c')]?_0x5f3d67[_0xbb10('0x38')][0x0]['confidence']:0x0;})[_0xbb10('0x3a')]('\x0a');}logger[_0xbb10('0x27')](_0xbb10('0x3d'),_0x3e8538);logger[_0xbb10('0x27')]('googleASR\x20confidence',_0x4345f3);return{'transcript':_0x3e8538,'confidence':_0x4345f3};})[_0xbb10('0x3e')](function(_0x202c60){logger['error']('[%s]\x20%s:%s',_0x202c60[_0xbb10('0x15')],_0x202c60['name'],_0x202c60[_0xbb10('0x3f')]);});};exports[_0xbb10('0x40')]=function(_0x4c66d8,_0x366608,_0x1d82bf,_0x474e99){var _0x5cf4f8=apiai(_0x366608,{'language':_0x474e99||'en'});return _0x5cf4f8[_0xbb10('0x41')](_0x1d82bf,{'sessionId':md5(_0x4c66d8)})[_0xbb10('0x2d')](function(_0x3b9fdf){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x3b9fdf));return{'source':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x44')],'resolvedQuery':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x45')],'action':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x46')],'actionIncomplete':_0x3b9fdf[_0xbb10('0x43')]['actionIncomplete'],'speech':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x47')]['speech'],'score':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x48')],'statusCode':_0x3b9fdf[_0xbb10('0x49')][_0xbb10('0x4a')],'endConversation':_0x3b9fdf[_0xbb10('0x43')][_0xbb10('0x4b')][_0xbb10('0x4c')]||![],'isFallbackIntent':_0x3b9fdf['result']['metadata'][_0xbb10('0x4d')]};});};exports[_0xbb10('0x4e')]=function(_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3){return tilde[_0xbb10('0x4f')](_0x2b12bd,_0x57d2c0,_0x5f0c12,_0x3cd6f3)[_0xbb10('0x2d')](function(_0xf820fe){try{fs[_0xbb10('0x1e')](_0x2b12bd);}catch(_0x22b315){logger[_0xbb10('0x16')](_0x22b315);}logger[_0xbb10('0x27')](_0xbb10('0x50'),_0xf820fe[_0xbb10('0x39')]);logger['info']('Tilde\x20ASR\x20confidence',_0xf820fe[_0xbb10('0x3c')]);return _0xf820fe;});};exports[_0xbb10('0x51')]=function(_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870){var _0x1c0d8f=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2e6fd9;return aws[_0xbb10('0x52')](_0x36ab7d,_0xb014b0,_0x36aa7d,_0x440f9e,_0x358e7e,_0x445870,_0x1c0d8f)['then'](function(){_0x2e6fd9=path[_0xbb10('0x31')](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x1c0d8f,_0x2e6fd9);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x1c0d8f);fs[_0xbb10('0x53')](_0x2e6fd9,_0xbb10('0x54'));}catch(_0x2e3326){logger[_0xbb10('0x16')](_0x2e3326);}return _0x2e6fd9[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x55')]=function(_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc){return aws[_0xbb10('0x56')](_0x44a056,_0x1c2dce,_0x1d49e1,_0x3d7e17,_0x4475e1,_0x5de0cc)[_0xbb10('0x2d')](function(_0x1b83a9){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x1b83a9));return _0x1b83a9;});};exports[_0xbb10('0x57')]=function(_0x4bedd0,_0x120bda,_0x4731ce,_0x2909a1){var _0x14fed3=util[_0xbb10('0x58')](_0xbb10('0x59'),ISPEECH_API,_0x4bedd0,encodeURIComponent(_0x120bda),_0x4731ce,_0x2909a1);var _0x175872=path[_0xbb10('0x31')](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x33'));var _0x2a1ce1;return downloadFile(_0x14fed3,_0x175872)[_0xbb10('0x2d')](function(){_0x2a1ce1=path['resolve'](__dirname,'tmp',rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b'));return convertFile(_0x175872,_0x2a1ce1);})[_0xbb10('0x2d')](function(){try{fs[_0xbb10('0x1e')](_0x175872);fs['chmodSync'](_0x2a1ce1,'777');}catch(_0x79411e){logger[_0xbb10('0x16')](_0x79411e);}return _0x2a1ce1[_0xbb10('0x35')]('.')[0x0];});};exports[_0xbb10('0x5a')]=function(_0x412f13,_0x3e9753,_0x45c0dc,_0x4a5fb9){var _0x117e84=util[_0xbb10('0x58')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3e9753,_0x45c0dc,base64Encode(_0x412f13),_0x4a5fb9?util['format']('model=%s',encodeURIComponent(_0x4a5fb9)):_0xbb10('0x5b'));return uploadFile(_0x117e84)[_0xbb10('0x2d')](function(_0x155dc5){return querystring['parse'](_0x155dc5);});};exports['sestekNDA']=function(_0x5846d1,_0x3ebc5f){return sestek[_0xbb10('0x5c')](_0x5846d1,_0x3ebc5f)[_0xbb10('0x2d')](function(_0x4e9fbd){logger[_0xbb10('0x27')](JSON[_0xbb10('0x42')](_0x4e9fbd));var _0x5a6538={'speech':_0x4e9fbd['text'],'action':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x5e')]:undefined,'actiondata':_0x4e9fbd[_0xbb10('0x5d')]?_0x4e9fbd['channelData'][_0xbb10('0x5f')]:undefined};if(_0x4e9fbd[_0xbb10('0x5d')]&&_0x4e9fbd[_0xbb10('0x5d')]['AudioFromTts']){return base64Decode(_0x4e9fbd[_0xbb10('0x5d')][_0xbb10('0x60')][_0xbb10('0x61')],path['resolve'](__dirname,_0xbb10('0x2a'),rs[_0xbb10('0x32')](0x4)+_0xbb10('0x2b')))[_0xbb10('0x2d')](function(_0x5e4a6e){_0x5a6538[_0xbb10('0x62')]=_0x5e4a6e;return _0x5a6538;});}return _0x5a6538;});};exports[_0xbb10('0x63')]=function(){return __dirname;}; \ No newline at end of file +var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0xff041d,_0x40f7c4){var _0x3aaaf0=function(_0x10aa65){while(--_0x10aa65){_0xff041d['push'](_0xff041d['shift']());}};_0x3aaaf0(++_0x40f7c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=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 6895f87..a4e78bc 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 _0xbadf=['exports','./nda'];(function(_0x21c48,_0x49ac0a){var _0x1f2cea=function(_0x51a5eb){while(--_0x51a5eb){_0x21c48['push'](_0x21c48['shift']());}};_0x1f2cea(++_0x49ac0a);}(_0xbadf,0x17f));var _0xfbad=function(_0x382168,_0xe03b6a){_0x382168=_0x382168-0x0;var _0x3ecf7e=_0xbadf[_0x382168];return _0x3ecf7e;};var nda=require(_0xfbad('0x0'));module[_0xfbad('0x1')]={'nda':nda}; \ No newline at end of file +var _0xe3aa=['./nda'];(function(_0x7c0be6,_0x4be933){var _0x1fda14=function(_0x23a3bd){while(--_0x23a3bd){_0x7c0be6['push'](_0x7c0be6['shift']());}};_0x1fda14(++_0x4be933);}(_0xe3aa,0x1ca));var _0xae3a=function(_0x774554,_0x3e9015){_0x774554=_0x774554-0x0;var _0x3e3ed8=_0xe3aa[_0x774554];return _0x3e3ed8;};var nda=require(_0xae3a('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 437e680..84c4736 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 _0xbd05=['Nda','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','exports','ndauth_url','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type'];(function(_0x1db244,_0x84d945){var _0x5c34fb=function(_0x454c8f){while(--_0x454c8f){_0x1db244['push'](_0x1db244['shift']());}};_0x5c34fb(++_0x84d945);}(_0xbd05,0x1b0));var _0x5bd0=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0xbd05[_0x413727];return _0x5f46d7;};'use strict';var rp=require(_0x5bd0('0x0'));var url=require(_0x5bd0('0x1'));var logger=require(_0x5bd0('0x2'))(_0x5bd0('0x3'));module[_0x5bd0('0x4')]=function(_0x31e1c3,_0x1e5bce){var _0x7d9d72={'method':'POST','uri':url['resolve'](_0x1e5bce[_0x5bd0('0x5')],'/token'),'form':{'grant_type':_0x5bd0('0x6'),'username':_0x1e5bce['username'],'password':_0x1e5bce[_0x5bd0('0x6')]},'json':!![]};return rp(_0x7d9d72)['then'](function(_0x3ff8da){var _0x36d6a4={'method':'POST','uri':url['resolve'](_0x1e5bce[_0x5bd0('0x7')],_0x5bd0('0x8')),'body':{'type':_0x1e5bce[_0x5bd0('0x9')]||'message','channelId':_0x5bd0('0xa'),'conversation':{'id':_0x31e1c3['uniqueid']},'from':{'id':_0x31e1c3['callerid'],'name':_0x31e1c3['calleridname']},'recipient':{'id':_0x31e1c3[_0x5bd0('0xb')],'name':_0x31e1c3[_0x5bd0('0xc')]},'text':_0x1e5bce[_0x5bd0('0xd')],'channelData':{}},'headers':{'Authorization':_0x5bd0('0xe')+_0x3ff8da[_0x5bd0('0xf')]},'json':!![]};if(_0x1e5bce[_0x5bd0('0x10')]){_0x36d6a4[_0x5bd0('0x11')][_0x5bd0('0x12')][_0x5bd0('0x13')]=_0x1e5bce[_0x5bd0('0x10')];}if(_0x1e5bce['ndagenerate_audio']=='1'){_0x36d6a4[_0x5bd0('0x11')][_0x5bd0('0x12')][_0x5bd0('0x14')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5bd0('0x15')};}if(_0x1e5bce[_0x5bd0('0x16')]){_0x36d6a4[_0x5bd0('0x11')][_0x5bd0('0x12')]['CustomAction']=_0x1e5bce[_0x5bd0('0x16')];if(_0x1e5bce[_0x5bd0('0x17')]){_0x36d6a4[_0x5bd0('0x11')][_0x5bd0('0x12')][_0x5bd0('0x18')]=_0x1e5bce['custom_action_data'];}}logger[_0x5bd0('0x19')](JSON['stringify'](_0x36d6a4));return rp(_0x36d6a4);});}; \ No newline at end of file +var _0x0b58=['AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','agi','exports','POST','resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio'];(function(_0x4e98e6,_0x31edb7){var _0x4f644c=function(_0x4d5a7f){while(--_0x4d5a7f){_0x4e98e6['push'](_0x4e98e6['shift']());}};_0x4f644c(++_0x31edb7);}(_0x0b58,0x104));var _0x80b5=function(_0x1ec6b3,_0x4d613c){_0x1ec6b3=_0x1ec6b3-0x0;var _0x7f842c=_0x0b58[_0x1ec6b3];return _0x7f842c;};'use strict';var rp=require(_0x80b5('0x0'));var url=require(_0x80b5('0x1'));var logger=require('../../../../../config/logger')(_0x80b5('0x2'));module[_0x80b5('0x3')]=function(_0x3f392d,_0x30fd68){var _0xb584f9={'method':_0x80b5('0x4'),'uri':url[_0x80b5('0x5')](_0x30fd68[_0x80b5('0x6')],_0x80b5('0x7')),'form':{'grant_type':'password','username':_0x30fd68[_0x80b5('0x8')],'password':_0x30fd68[_0x80b5('0x9')]},'json':!![]};return rp(_0xb584f9)[_0x80b5('0xa')](function(_0x5573d1){var _0x5a530e={'method':'POST','uri':url[_0x80b5('0x5')](_0x30fd68[_0x80b5('0xb')],_0x80b5('0xc')),'body':{'type':_0x30fd68[_0x80b5('0xd')]||_0x80b5('0xe'),'channelId':'Nda','conversation':{'id':_0x3f392d[_0x80b5('0xf')]},'from':{'id':_0x3f392d[_0x80b5('0x10')],'name':_0x3f392d[_0x80b5('0x11')]},'recipient':{'id':_0x3f392d[_0x80b5('0x12')],'name':_0x3f392d[_0x80b5('0x13')]},'text':_0x30fd68[_0x80b5('0x14')],'channelData':{}},'headers':{'Authorization':_0x80b5('0x15')+_0x5573d1[_0x80b5('0x16')]},'json':!![]};if(_0x30fd68['project']){_0x5a530e[_0x80b5('0x17')][_0x80b5('0x18')][_0x80b5('0x19')]=_0x30fd68[_0x80b5('0x1a')];}if(_0x30fd68[_0x80b5('0x1b')]=='1'){_0x5a530e['body'][_0x80b5('0x18')][_0x80b5('0x1c')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x80b5('0x1d')};}if(_0x30fd68[_0x80b5('0x1e')]){_0x5a530e[_0x80b5('0x17')][_0x80b5('0x18')][_0x80b5('0x1f')]=_0x30fd68[_0x80b5('0x1e')];if(_0x30fd68[_0x80b5('0x20')]){_0x5a530e[_0x80b5('0x17')][_0x80b5('0x18')][_0x80b5('0x21')]=_0x30fd68[_0x80b5('0x20')];}}logger[_0x80b5('0x22')](JSON[_0x80b5('0x23')](_0x5a530e));return rp(_0x5a530e);});}; \ 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 39e6f67..ddc7c7f 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x538e=['exports'];(function(_0x11bde2,_0x557da6){var _0x20ac2a=function(_0x53fa39){while(--_0x53fa39){_0x11bde2['push'](_0x11bde2['shift']());}};_0x20ac2a(++_0x557da6);}(_0x538e,0x11f));var _0xe538=function(_0x3086fd,_0x5f57be){_0x3086fd=_0x3086fd-0x0;var _0x50e7b9=_0x538e[_0x3086fd];return _0x50e7b9;};'use strict';var asr=require('./lib/api');module[_0xe538('0x0')]=function(_0x1d3d92,_0x217b5d,_0x20019b,_0x2e308c){return asr(_0x1d3d92,_0x217b5d,_0x20019b,_0x2e308c);}; \ No newline at end of file +var _0xe5c4=['./lib/api'];(function(_0x407b19,_0x5d0076){var _0x13b391=function(_0x1c7ef3){while(--_0x1c7ef3){_0x407b19['push'](_0x407b19['shift']());}};_0x13b391(++_0x5d0076);}(_0xe5c4,0x186));var _0x4e5c=function(_0x5acc01,_0x198a80){_0x5acc01=_0x5acc01-0x0;var _0x1b50ba=_0xe5c4[_0x5acc01];return _0x1b50ba;};'use strict';var asr=require(_0x4e5c('0x0'));module['exports']=function(_0x51f708,_0x394243,_0x2e41b2,_0x367cc5){return asr(_0x51f708,_0x394243,_0x2e41b2,_0x367cc5);}; \ 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 24543cd..aa12921 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 _0xa58d=['crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','terminate','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','open','message','moment'];(function(_0x472c9e,_0x4e580b){var _0x29fb8b=function(_0x449fb2){while(--_0x449fb2){_0x472c9e['push'](_0x472c9e['shift']());}};_0x29fb8b(++_0x4e580b);}(_0xa58d,0x77));var _0xda58=function(_0x5b6bda,_0x14cfc4){_0x5b6bda=_0x5b6bda-0x0;var _0x3be214=_0xa58d[_0x5b6bda];return _0x3be214;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xda58('0x0'));var crypto=require(_0xda58('0x1'));var logger=require(_0xda58('0x2'))(_0xda58('0x3'));module[_0xda58('0x4')]=function(_0x55480e,_0x17b550,_0x2b09cb,_0x1b2d09){return new BPromise(function(_0x245f11,_0x41bcf1){logger[_0xda58('0x5')](_0xda58('0x6'),_0x1b2d09||_0xda58('0x7'));var _0x40d87b=new WebSocket(_0x1b2d09||_0xda58('0x7'),{'perMessageDeflate':![]});var _0x4ae2d4='';var _0xc886ac='0';var _0x55c89b='1';var _0x37f87f=_0xda58('0x8');function _0xfce7ce(_0x13e0f8){var _0x48b871=crypto['createHash'](_0xda58('0x9'));_0x48b871[_0xda58('0xa')](_0x13e0f8);return _0x48b871[_0xda58('0xb')](_0xda58('0xc'));}function _0x1c3cd9(){try{logger[_0xda58('0x5')](_0xda58('0xd'));var _0x1ea2ed=moment()[_0xda58('0xe')]();var _0x177c92=_0xfce7ce(_0x1ea2ed+_0x17b550+_0x2b09cb);_0x40d87b[_0xda58('0xf')](JSON[_0xda58('0x10')]({'appID':_0x17b550,'timestamp':_0x1ea2ed,'appKey':_0x177c92}));var _0x17948f=fs['createReadStream'](_0x55480e);_0x17948f['on'](_0xda58('0x11'),function(_0x2aae58){_0x40d87b[_0xda58('0xf')](_0x2aae58);});_0x17948f['on'](_0xda58('0x12'),function(){_0x40d87b[_0xda58('0xf')](_0xda58('0x13'));});}catch(_0x2c28c0){logger[_0xda58('0x14')](_0xda58('0x15'),JSON[_0xda58('0x10')](_0x2c28c0));_0x40d87b['terminate']();}}function _0x20726a(_0x13559d){try{if(_0x13559d){var _0x2485e4=JSON[_0xda58('0x16')](_0x13559d);switch(_0x2485e4[_0xda58('0x17')]){case 0x0:if(_0x2485e4[_0xda58('0x18')]){if(_0x2485e4[_0xda58('0x18')][_0xda58('0x19')]){logger[_0xda58('0x5')](_0xda58('0x1a'),JSON[_0xda58('0x10')](_0x2485e4[_0xda58('0x18')][_0xda58('0x1b')]));_0x4ae2d4=_0x2485e4[_0xda58('0x18')][_0xda58('0x1b')][0x0][_0xda58('0x1c')];_0xc886ac=_0x2485e4[_0xda58('0x18')][_0xda58('0x1b')][0x0][_0xda58('0x1d')];_0x55c89b='0';_0x37f87f=_0xda58('0x1e');_0x40d87b[_0xda58('0x1f')]();}}break;case 0x1:logger[_0xda58('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x55c89b='1';_0x37f87f=_0xda58('0x8');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x55c89b='2';_0x37f87f='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xda58('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x55c89b='9';_0x37f87f=_0xda58('0x20');break;case 0xa:logger[_0xda58('0x5')]('Authentication\x20failed.');_0x55c89b='10';_0x37f87f=_0xda58('0x21');break;case 0xb:logger[_0xda58('0x5')](_0xda58('0x22'));_0x55c89b='11';_0x37f87f=_0xda58('0x22');}}}catch(_0x13f318){logger[_0xda58('0x14')](_0xda58('0x23'),JSON[_0xda58('0x10')](_0x13f318));_0x40d87b[_0xda58('0x1f')]();}}function _0x590f19(){logger[_0xda58('0x5')](_0xda58('0x24'));_0x245f11({'transcript':_0x4ae2d4,'confidence':_0xc886ac,'status':_0x55c89b,'status_message':_0x37f87f});}function _0xa5b3d(_0x15d6a6){logger[_0xda58('0x14')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xda58('0x25')](_0x15d6a6)){logger['error'](_['isObject'](_0x15d6a6)?JSON[_0xda58('0x10')](_0x15d6a6):_0x15d6a6);}}_0x40d87b['on'](_0xda58('0x26'),_0x1c3cd9);_0x40d87b['on'](_0xda58('0x27'),_0x20726a);_0x40d87b['on'](_0xda58('0x12'),_0x590f19);_0x40d87b['on'](_0xda58('0x14'),_0xa5b3d);});}; \ No newline at end of file +var _0xf720=['isNil','open','message','bluebird','moment','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','digest','hex','unix','send','stringify','createReadStream','close','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket'];(function(_0x1d8323,_0x2393bf){var _0x4991d9=function(_0x4eb75d){while(--_0x4eb75d){_0x1d8323['push'](_0x1d8323['shift']());}};_0x4991d9(++_0x2393bf);}(_0xf720,0xc9));var _0x0f72=function(_0x2d5c5c,_0x3b9b16){_0x2d5c5c=_0x2d5c5c-0x0;var _0x4600fc=_0xf720[_0x2d5c5c];return _0x4600fc;};'use strict';var BPromise=require(_0x0f72('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x0f72('0x1'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')('agi');module['exports']=function(_0x28be3c,_0x1b873c,_0x59be41,_0x1763a6){return new BPromise(function(_0x5ea6e3,_0x37b980){logger[_0x0f72('0x2')](_0x0f72('0x3'),_0x1763a6||_0x0f72('0x4'));var _0x4b1b50=new WebSocket(_0x1763a6||_0x0f72('0x4'),{'perMessageDeflate':![]});var _0xe886de='';var _0x3156d5='0';var _0x58605e='1';var _0x41ea35=_0x0f72('0x5');function _0x12c580(_0x232f05){var _0x5945a8=crypto['createHash']('sha1');_0x5945a8['update'](_0x232f05);return _0x5945a8[_0x0f72('0x6')](_0x0f72('0x7'));}function _0x5c7677(){try{logger[_0x0f72('0x2')]('Open\x20Tilde\x20ASR\x20socket');var _0x3e0dca=moment()[_0x0f72('0x8')]();var _0x52538d=_0x12c580(_0x3e0dca+_0x1b873c+_0x59be41);_0x4b1b50[_0x0f72('0x9')](JSON[_0x0f72('0xa')]({'appID':_0x1b873c,'timestamp':_0x3e0dca,'appKey':_0x52538d}));var _0x39876e=fs[_0x0f72('0xb')](_0x28be3c);_0x39876e['on']('data',function(_0x56ea80){_0x4b1b50['send'](_0x56ea80);});_0x39876e['on'](_0x0f72('0xc'),function(){_0x4b1b50[_0x0f72('0x9')](_0x0f72('0xd'));});}catch(_0x16903e){logger[_0x0f72('0xe')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x16903e));_0x4b1b50[_0x0f72('0xf')]();}}function _0x59e0cc(_0x1cd752){try{if(_0x1cd752){var _0x4204cc=JSON[_0x0f72('0x10')](_0x1cd752);switch(_0x4204cc[_0x0f72('0x11')]){case 0x0:if(_0x4204cc[_0x0f72('0x12')]){if(_0x4204cc[_0x0f72('0x12')][_0x0f72('0x13')]){logger['info'](_0x0f72('0x14'),JSON['stringify'](_0x4204cc[_0x0f72('0x12')]['hypotheses']));_0xe886de=_0x4204cc[_0x0f72('0x12')][_0x0f72('0x15')][0x0]['transcript'];_0x3156d5=_0x4204cc[_0x0f72('0x12')][_0x0f72('0x15')][0x0][_0x0f72('0x16')];_0x58605e='0';_0x41ea35=_0x0f72('0x17');_0x4b1b50['terminate']();}}break;case 0x1:logger[_0x0f72('0x2')](_0x0f72('0x5'));_0x58605e='1';_0x41ea35=_0x0f72('0x5');break;case 0x2:logger[_0x0f72('0x2')](_0x0f72('0x18'));_0x58605e='2';_0x41ea35='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x0f72('0x2')](_0x0f72('0x19'));_0x58605e='9';_0x41ea35='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x0f72('0x2')](_0x0f72('0x1a'));_0x58605e='10';_0x41ea35=_0x0f72('0x1a');break;case 0xb:logger['info'](_0x0f72('0x1b'));_0x58605e='11';_0x41ea35=_0x0f72('0x1b');}}}catch(_0x1a7b65){logger[_0x0f72('0xe')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x0f72('0xa')](_0x1a7b65));_0x4b1b50['terminate']();}}function _0x2d074d(){logger[_0x0f72('0x2')](_0x0f72('0x1c'));_0x5ea6e3({'transcript':_0xe886de,'confidence':_0x3156d5,'status':_0x58605e,'status_message':_0x41ea35});}function _0x1fb4f6(_0x527071){logger[_0x0f72('0xe')](_0x0f72('0x1d'));if(!_[_0x0f72('0x1e')](_0x527071)){logger['error'](_['isObject'](_0x527071)?JSON[_0x0f72('0xa')](_0x527071):_0x527071);}}_0x4b1b50['on'](_0x0f72('0x1f'),_0x5c7677);_0x4b1b50['on'](_0x0f72('0x20'),_0x59e0cc);_0x4b1b50['on'](_0x0f72('0xc'),_0x2d074d);_0x4b1b50['on'](_0x0f72('0xe'),_0x1fb4f6);});}; \ 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 7d966c7..c1b8b15 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 _0xedd9=['exports'];(function(_0x3848cb,_0x54d31e){var _0x477a8a=function(_0x51a2d5){while(--_0x51a2d5){_0x3848cb['push'](_0x3848cb['shift']());}};_0x477a8a(++_0x54d31e);}(_0xedd9,0xfc));var _0x9edd=function(_0x9678e2,_0x391d32){_0x9678e2=_0x9678e2-0x0;var _0x43687c=_0xedd9[_0x9678e2];return _0x43687c;};var asr=require('./asr');module[_0x9edd('0x0')]={'asr':asr}; \ No newline at end of file +var _0xedd9=['exports'];(function(_0x5927ec,_0x221376){var _0x517ed2=function(_0x9429ff){while(--_0x9429ff){_0x5927ec['push'](_0x5927ec['shift']());}};_0x517ed2(++_0x221376);}(_0xedd9,0xfc));var _0x9edd=function(_0x1b1cfe,_0x5c2482){_0x1b1cfe=_0x1b1cfe-0x0;var _0x59c388=_0xedd9[_0x1b1cfe];return _0x59c388;};var asr=require('./asr');module[_0x9edd('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index cf546c2..df059d8 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 _0xe4b6=['connection','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','EventEmitter','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x3bbb66,_0x280aa2){var _0x872225=function(_0x1725e6){while(--_0x1725e6){_0x3bbb66['push'](_0x3bbb66['shift']());}};_0x872225(++_0x280aa2);}(_0xe4b6,0x1a8));var _0x6e4b=function(_0x14691c,_0xe1c878){_0x14691c=_0x14691c-0x0;var _0xbec98=_0xe4b6[_0x14691c];return _0xbec98;};'use strict';var util=require(_0x6e4b('0x0'));var net=require(_0x6e4b('0x1'));var EventEmitter=require(_0x6e4b('0x2'))[_0x6e4b('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x6e4b('0x4'));var AGIServer=function(_0x5d2a1d,_0x2c178e,_0x507de2){var _0x44fbf0=this,_0x5d2a1d=_0x5d2a1d||0x11dd,_0x2c178e=_0x2c178e||_0x6e4b('0x5'),_0x14205c=null,_0xe809c0=0x0;EventEmitter[_0x6e4b('0x6')](_0x44fbf0);function _0x262ca8(){if(!_0x5d2a1d){_0x44fbf0[_0x6e4b('0x7')](_0x6e4b('0x8'),new AGIError(_0x6e4b('0x9')));return![];}_0x14205c=net[_0x6e4b('0xa')]();_0x14205c[_0x6e4b('0xb')](_0x5d2a1d,_0x2c178e);_0x14205c['on'](_0x6e4b('0xc'),function(){_0x44fbf0[_0x6e4b('0x7')]('listening');});_0x14205c['on'](_0x6e4b('0xd'),function(_0x55ea5f){_0x14205c['getConnections'](function(_0x39f0cd,_0xcb796c){if(_0x39f0cd){_0x44fbf0[_0x6e4b('0x7')](_0x6e4b('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x39f0cd));}else if(_0x507de2&&_0x507de2<0x0){_0x44fbf0[_0x6e4b('0x7')](_0x6e4b('0x8'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x55ea5f[_0x6e4b('0xe')]();}else if(_0x507de2&&_0x507de2>0x0&&_0x507de2<_0xcb796c){_0xe809c0+=0x1;_0x44fbf0['emit'](_0x6e4b('0x8'),new AGIError(_0x6e4b('0xf'),_0xe809c0));_0x55ea5f[_0x6e4b('0xe')]();}else{var _0x1ab87f=new AGIChannel(_0x55ea5f);_0x1ab87f['on'](_0x6e4b('0x10'),function(){_0x44fbf0[_0x6e4b('0x7')](_0x6e4b('0xd'),_0x1ab87f);});}});});_0x14205c['on'](_0x6e4b('0x8'),function(_0x4d1c9a){_0x44fbf0['emit']('error',new AGIError(_0x6e4b('0x11'),_0x4d1c9a[_0x6e4b('0x12')]));});_0x14205c['on'](_0x6e4b('0x13'),function(){_0x44fbf0[_0x6e4b('0x7')](_0x6e4b('0x13'),new AGIError(_0x6e4b('0x14')));});}process['nextTick'](function(){_0x262ca8();});};util[_0x6e4b('0x15')](AGIServer,EventEmitter);module[_0x6e4b('0x16')]=function(_0x359623,_0x48b5b0,_0x42ce99){return new AGIServer(_0x359623,_0x48b5b0,_0x42ce99);}; \ No newline at end of file +var _0xc465=['./error','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','events','EventEmitter'];(function(_0x5671b3,_0x41db79){var _0x4eb8c9=function(_0x591874){while(--_0x591874){_0x5671b3['push'](_0x5671b3['shift']());}};_0x4eb8c9(++_0x41db79);}(_0xc465,0x100));var _0x5c46=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc465[_0x5c2e3e];return _0x53f64a;};'use strict';var util=require(_0x5c46('0x0'));var net=require(_0x5c46('0x1'));var EventEmitter=require(_0x5c46('0x2'))[_0x5c46('0x3')];var AGIError=require(_0x5c46('0x4'));var AGIChannel=require(_0x5c46('0x5'));var AGIServer=function(_0x190c4f,_0x2e454d,_0x2f16dc){var _0x49f870=this,_0x190c4f=_0x190c4f||0x11dd,_0x2e454d=_0x2e454d||_0x5c46('0x6'),_0x11fde5=null,_0x27ff86=0x0;EventEmitter[_0x5c46('0x7')](_0x49f870);function _0x1c9d27(){if(!_0x190c4f){_0x49f870[_0x5c46('0x8')]('error',new AGIError(_0x5c46('0x9')));return![];}_0x11fde5=net[_0x5c46('0xa')]();_0x11fde5[_0x5c46('0xb')](_0x190c4f,_0x2e454d);_0x11fde5['on'](_0x5c46('0xc'),function(){_0x49f870[_0x5c46('0x8')](_0x5c46('0xc'));});_0x11fde5['on'](_0x5c46('0xd'),function(_0x24c4c9){_0x11fde5[_0x5c46('0xe')](function(_0x1d220e,_0x1f456f){if(_0x1d220e){_0x49f870['emit'](_0x5c46('0xf'),new AGIError(_0x5c46('0x10'),_0x1d220e));}else if(_0x2f16dc&&_0x2f16dc<0x0){_0x49f870[_0x5c46('0x8')]('error',new AGIError(_0x5c46('0x11')));_0x24c4c9[_0x5c46('0x12')]();}else if(_0x2f16dc&&_0x2f16dc>0x0&&_0x2f16dc<_0x1f456f){_0x27ff86+=0x1;_0x49f870[_0x5c46('0x8')](_0x5c46('0xf'),new AGIError(_0x5c46('0x13'),_0x27ff86));_0x24c4c9['destroy']();}else{var _0x43ee09=new AGIChannel(_0x24c4c9);_0x43ee09['on'](_0x5c46('0x14'),function(){_0x49f870[_0x5c46('0x8')](_0x5c46('0xd'),_0x43ee09);});}});});_0x11fde5['on'](_0x5c46('0xf'),function(_0x46ea73){_0x49f870[_0x5c46('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x46ea73[_0x5c46('0x15')]));});_0x11fde5['on'](_0x5c46('0x16'),function(){_0x49f870[_0x5c46('0x8')]('close',new AGIError(_0x5c46('0x17')));});}process[_0x5c46('0x18')](function(){_0x1c9d27();});};util[_0x5c46('0x19')](AGIServer,EventEmitter);module['exports']=function(_0x2d6680,_0x150f8c,_0x3b1c9e){return new AGIServer(_0x2d6680,_0x150f8c,_0x3b1c9e);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 900455b..aefa2db 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 _0x1eff=['%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','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','email','user','subject','service','host','port','secure','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','answer','yes','Answer','subproject','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','path','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleTTS','google_tts_language','googleDialogflow','key','text','dialogflow_language','sestekNDA','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','en-US','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','clear','hasOwnProperty','isString','replaceAllVariables','split','length','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','sync','retry','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','add','delay','minutes','noop','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','debug','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','url','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','toString','stringify','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','googleasr','wav','%s/recordings/%s','%s.%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','appsecret','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','unlink','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','success','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x1eff,0x1d5));var _0xf1ef=function(_0x3387b5,_0x425d52){_0x3387b5=_0x3387b5-0x0;var _0xa98f9c=_0x1eff[_0x3387b5];return _0xa98f9c;};'use strict';var fs=require('fs');var path=require(_0xf1ef('0x0'));var util=require('util');var _=require(_0xf1ef('0x1'));var sh=require(_0xf1ef('0x2'));var odbc=require(_0xf1ef('0x3'))();var rs=require(_0xf1ef('0x4'));var moment=require(_0xf1ef('0x5'));var Mustache=require(_0xf1ef('0x6'));var logger=require(_0xf1ef('0x7'))(_0xf1ef('0x8'));var config=require(_0xf1ef('0x9'));var scripts=require('./scripts');var FILES_PATH=_0xf1ef('0xa');var verticesWithRetry=['menu',_0xf1ef('0xb'),_0xf1ef('0xc')];var AGIVertices=function(_0x326ce3,_0x1a8316,_0x34b680){this[_0xf1ef('0xd')]=_0x326ce3;this[_0xf1ef('0xe')]=_0x1a8316;this[_0xf1ef('0xf')]=_0x34b680;};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x11')]=function(_0x541877,_0x5bda66){this[_0xf1ef('0xe')][_0xf1ef('0x12')](_0x541877)[_0xf1ef('0x13')](function(_0x1fb212){_0x5bda66(null,_0x1fb212?_0x1fb212[_0xf1ef('0x14')]:![]);})['catch'](function(_0x96e19){_0x5bda66(_0x96e19);});};AGIVertices[_0xf1ef('0x10')]['getVoiceQueue']=function(_0x253e47,_0x5ca36e){this[_0xf1ef('0xe')]['getVoiceQueueById'](_0x253e47)[_0xf1ef('0x13')](function(_0x463d11){_0x5ca36e(null,_0x463d11?_0x463d11[_0xf1ef('0x14')]:![]);})[_0xf1ef('0x15')](function(_0x21fefd){_0x5ca36e(_0x21fefd);});};AGIVertices['prototype'][_0xf1ef('0x16')]=function(_0x49c6d6,_0x82560e){this['rpc'][_0xf1ef('0x17')](_0x49c6d6)['then'](function(_0x209ca5){_0x82560e(null,_0x209ca5?_0x209ca5[_0xf1ef('0x14')]:![]);})[_0xf1ef('0x15')](function(_0x16554d){_0x82560e(_0x16554d);});};AGIVertices['prototype'][_0xf1ef('0x18')]=function(_0x56e168,_0x38fbe5){this[_0xf1ef('0xe')][_0xf1ef('0x19')](_0x56e168)[_0xf1ef('0x13')](function(_0x4686c8){_0x38fbe5(null,_0x4686c8?_0x4686c8[_0xf1ef('0x1a')]:![]);})[_0xf1ef('0x15')](function(_0x3872a8){_0x38fbe5(_0x3872a8);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x1b')]=function(_0x2fb26c,_0x22eabf){this[_0xf1ef('0xe')][_0xf1ef('0x1c')](_0x2fb26c)[_0xf1ef('0x13')](function(_0x858dd0){_0x22eabf(null,_0x858dd0?_0x858dd0[_0xf1ef('0x14')]:![]);})[_0xf1ef('0x15')](function(_0x4c79a6){_0x22eabf(_0x4c79a6);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x1d')]=function(_0x40559e,_0x9716ee){this[_0xf1ef('0xe')][_0xf1ef('0x1e')](_0x40559e)[_0xf1ef('0x13')](function(_0x467f38){_0x9716ee(null,_0x467f38?_0x467f38[_0xf1ef('0x14')]:![]);})[_0xf1ef('0x15')](function(_0x190c95){_0x9716ee(_0x190c95);});};AGIVertices['prototype'][_0xf1ef('0x1f')]=function(_0x33e394,_0x56d660){var _0x3f3a63=this;this[_0xf1ef('0xe')][_0xf1ef('0x20')](_0x33e394)[_0xf1ef('0x13')](function(_0x19a9f6){_0x56d660(null,_0x19a9f6?_0x3f3a63['getSoundPath'](_0x19a9f6['save_name']):![]);})[_0xf1ef('0x15')](function(_0x2d8ea8){_0x56d660(_0x2d8ea8);});};AGIVertices[_0xf1ef('0x10')]['getMailAccount']=function(_0x582834,_0x44dbaf){this[_0xf1ef('0xe')][_0xf1ef('0x21')](_0x582834)[_0xf1ef('0x13')](function(_0x59814f){_0x44dbaf(null,_0x59814f?_0x59814f:![]);})[_0xf1ef('0x15')](function(_0x717bb){_0x44dbaf(_0x717bb);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x22')]=function(_0x50c4a5,_0x4f906e,_0x44120b){this[_0xf1ef('0xf')][_0xf1ef('0x22')](_0x50c4a5,_0x4f906e)[_0xf1ef('0x13')](function(){_0x44120b(null);})[_0xf1ef('0x15')](function(_0x16a629){_0x44120b(_0x16a629);});};AGIVertices['prototype'][_0xf1ef('0x23')]=function(_0x34dc94,_0x345798){this[_0xf1ef('0xe')][_0xf1ef('0x24')](_0x34dc94)['then'](function(_0x3b6da1){if(_0x3b6da1){if(_0x3b6da1[_0xf1ef('0x25')]){_0x345798(null,[_0x3b6da1['interval']]);}else{_0x345798(null,_[_0xf1ef('0x26')](_0x3b6da1[_0xf1ef('0x27')],_0xf1ef('0x28')));}}else{_0x345798(null,![]);}})[_0xf1ef('0x15')](function(_0x45bfc7){_0x345798(_0x45bfc7);});};AGIVertices['prototype'][_0xf1ef('0x29')]=function(_0x19ca73){return util[_0xf1ef('0x2a')](_0xf1ef('0x2b'),FILES_PATH,_0x19ca73);};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x2c')]=function(_0x38b083,_0x59ffac,_0x405c66){odbc['open'](_0x38b083,function(_0x36da6a){if(_0x36da6a){logger[_0xf1ef('0x2d')](_0xf1ef('0x2e'),_0x36da6a);_0x405c66(_0x36da6a);}else{logger[_0xf1ef('0x2f')]('ODBC\x20connection\x20successfully');odbc[_0xf1ef('0x30')](_0x59ffac,function(_0x479246,_0x1fe25b){if(_0x479246){logger[_0xf1ef('0x2f')](_0xf1ef('0x31'),_0x59ffac);_0x405c66(_0x479246);}else{logger[_0xf1ef('0x2f')](_0xf1ef('0x32'),_0x59ffac);odbc[_0xf1ef('0x33')](function(_0x5aaed4){if(_0x5aaed4){logger[_0xf1ef('0x2d')](_0xf1ef('0x34'),_0x5aaed4);}_0x405c66(null,_0x1fe25b);});}});}});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x35')]=function(_0x5c77e9,_0x2d6c89){this[_0xf1ef('0xe')][_0xf1ef('0x36')](_0x5c77e9)[_0xf1ef('0x13')](function(_0x4bdecb){_0x2d6c89(null,_0x4bdecb?_0x4bdecb:![]);})['catch'](function(_0x1495dd){_0x2d6c89(_0x1495dd);});};AGIVertices['prototype'][_0xf1ef('0x37')]=function(_0x18309b,_0x52a0a6){this[_0xf1ef('0xe')]['createSmsMessage'](_0x18309b)[_0xf1ef('0x13')](function(_0x3c4d32){_0x52a0a6(null,_0x3c4d32);})['catch'](function(_0x56c483){_0x52a0a6(_0x56c483);});};AGIVertices[_0xf1ef('0x10')]['createSquareDetailsReport']=function(_0x5cd165,_0x6aaae7,_0x4b37a3){this['rpc'][_0xf1ef('0x38')]({'uniqueid':this[_0xf1ef('0xd')][_0xf1ef('0x39')],'node':_0x5cd165[_0xf1ef('0x3a')],'application':_0x5cd165[_0xf1ef('0x3b')],'data':_0x6aaae7||null,'project_name':this[_0xf1ef('0xd')]['arg_1'],'callerid':this[_0xf1ef('0xd')][_0xf1ef('0x3c')]})['then'](function(_0x20815f){if(_0x4b37a3){_0x4b37a3(null,_0x20815f);}})[_0xf1ef('0x15')](function(_0x43ccb0){if(_0x4b37a3){_0x4b37a3(_0x43ccb0);}});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x3d')]=function(_0x4f36d7,_0x823c87,_0x2a1719,_0x3dd98a){this[_0xf1ef('0xe')][_0xf1ef('0x3d')]({'uniqueid':this[_0xf1ef('0xd')]['uniqueid'],'callerid':this[_0xf1ef('0xd')][_0xf1ef('0x3c')],'calleridname':this[_0xf1ef('0xd')][_0xf1ef('0x3e')],'context':this['channel'][_0xf1ef('0x3f')],'extension':this['channel']['extension'],'priority':this['channel'][_0xf1ef('0x40')],'accountcode':this[_0xf1ef('0xd')][_0xf1ef('0x41')],'dnid':this['channel'][_0xf1ef('0x42')],'projectName':this[_0xf1ef('0xd')][_0xf1ef('0x43')],'saveName':_0x823c87,'filename':_0x4f36d7[_0xf1ef('0x44')]||_0x823c87,'savePath':_0x2a1719})['then'](function(_0x1fca3a){_0x3dd98a(null,_0x1fca3a);})[_0xf1ef('0x15')](function(_0x47a2f5){_0x3dd98a(_0x47a2f5);});};AGIVertices['prototype'][_0xf1ef('0x45')]=function(_0x5489ed,_0x419291,_0x5b5a78){this[_0xf1ef('0xe')][_0xf1ef('0x45')]({'uniqueid':this[_0xf1ef('0xd')]['uniqueid'],'body':_0x5489ed,'direction':_0x419291})['then'](function(_0x1a5758){if(_0x5b5a78){_0x5b5a78(null,_0x1a5758);}})[_0xf1ef('0x15')](function(_0x2f43de){if(_0x5b5a78){_0x5b5a78(_0x2f43de);}});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x46')]=function(_0x4e8b3a,_0x4f3487){this[_0xf1ef('0xe')]['createCmContact']({'firstName':_[_0xf1ef('0x47')](_0x4e8b3a['name'])||_[_0xf1ef('0x48')](_0x4e8b3a[_0xf1ef('0x14')])?'callback_'+Math[_0xf1ef('0x49')]():_0x4e8b3a['name'],'lastName':_['isEmpty'](_0x4e8b3a['lastName'])||_[_0xf1ef('0x48')](_0x4e8b3a[_0xf1ef('0x4a')])?null:_0x4e8b3a[_0xf1ef('0x4a')],'phone':_0x4e8b3a[_0xf1ef('0x4b')],'ListId':_0x4e8b3a[_0xf1ef('0x4c')],'scheduledAt':_0x4e8b3a[_0xf1ef('0x4d')],'callbackUniqueid':this[_0xf1ef('0xd')]['uniqueid'],'tags':'callback','description':_0xf1ef('0x4e')+_0x4e8b3a[_0xf1ef('0x4d')]['toString'](),'priority':_0x4e8b3a[_0xf1ef('0x4f')]})[_0xf1ef('0x13')](function(_0x4a08a4){_0x4f3487(null,_0x4a08a4);})[_0xf1ef('0x15')](function(_0xfc4c77){_0x4f3487(_0xfc4c77);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x50')]=function(_0x4d5081,_0x498e6f){this[_0xf1ef('0xe')][_0xf1ef('0x51')](_0x4d5081)['then'](function(_0x7d0bfb){_0x498e6f(null,_0x7d0bfb?_0x7d0bfb[_0xf1ef('0x14')]:![]);})['catch'](function(_0x261336){_0x498e6f(_0x261336);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x52')]=function(_0x9e7655,_0x44de97,_0x263e46){var _0x5d2acc={'role':_0xf1ef('0x53')};_0x5d2acc[_0x9e7655]=this[_0xf1ef('0xd')][_0xf1ef('0x3c')];this['rpc'][_0xf1ef('0x52')](_0x5d2acc,_0x44de97,this[_0xf1ef('0xd')][_0xf1ef('0x39')])['then'](function(_0x321161){_0x263e46(null,_[_0xf1ef('0x48')](_0x321161)?![]:!![]);})[_0xf1ef('0x15')](function(_0x4f822e){logger[_0xf1ef('0x2d')](_0x4f822e);_0x263e46(null,![]);});};AGIVertices[_0xf1ef('0x10')]['agentUnpause']=function(_0x2a23dd,_0xc01ac4){var _0x171b34={'role':'agent'};_0x171b34[_0x2a23dd]=this[_0xf1ef('0xd')][_0xf1ef('0x3c')];this[_0xf1ef('0xe')][_0xf1ef('0x54')](_0x171b34)[_0xf1ef('0x13')](function(_0x487219){_0xc01ac4(null,_['isNil'](_0x487219)?![]:!![]);})[_0xf1ef('0x15')](function(_0x2bc0db){logger[_0xf1ef('0x2d')](_0x2bc0db);_0xc01ac4(null,![]);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x55')]=function(_0x67a25e,_0x1958d6){var _0x4c31e1={'role':_0xf1ef('0x53')};_0x4c31e1[_0x67a25e]=this[_0xf1ef('0xd')][_0xf1ef('0x3c')];this[_0xf1ef('0xe')][_0xf1ef('0x55')](_0x4c31e1)[_0xf1ef('0x13')](function(_0x337301){_0x1958d6(null,_[_0xf1ef('0x48')](_0x337301)?![]:!![]);})[_0xf1ef('0x15')](function(_0x5ce177){logger['error'](_0x5ce177);_0x1958d6(null,![]);});};AGIVertices['prototype'][_0xf1ef('0x56')]=function(_0x22706a,_0x5353e1){var _0x5ad438={'role':_0xf1ef('0x53')};_0x5ad438[_0x22706a]=this[_0xf1ef('0xd')][_0xf1ef('0x3c')];var _0x153467=_0x22706a!=_0xf1ef('0x57')?util[_0xf1ef('0x2a')](_0xf1ef('0x58'),_0xf1ef('0x59'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')]):undefined;this[_0xf1ef('0xe')]['agentLogin'](_0x5ad438,_0x153467)['then'](function(_0x2645e2){_0x5353e1(null,_[_0xf1ef('0x48')](_0x2645e2)?![]:!![]);})[_0xf1ef('0x15')](function(_0x2b9ed4){logger[_0xf1ef('0x2d')](_0x2b9ed4);_0x5353e1(null,![]);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x5a')]=function(_0x3a397c,_0x1764c9){sh[_0xf1ef('0x5b')](_[_0xf1ef('0x5c')](_0x3a397c),function(_0x1af7f2,_0x132680){var _0x54fdfe=_0x132680[_0xf1ef('0x5d')](/(\r\n|\n|\r)/gm,'');_0x1764c9(null,_0x54fdfe);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x5e')]=function(_0x31b706,_0x3a408e){scripts[_0xf1ef('0x5e')](_0x31b706['text'],_0x31b706[_0xf1ef('0x5f')]||'en',0x1)[_0xf1ef('0x13')](function(_0x363604){_0x3a408e(null,_0x363604);})['catch'](function(_0x5427f7){_0x3a408e(_0x5427f7);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x60')]=function(_0x39357b,_0x1677f3){scripts[_0xf1ef('0x60')](this[_0xf1ef('0xd')][_0xf1ef('0x39')],_0x39357b[_0xf1ef('0x61')],_0x39357b[_0xf1ef('0x62')],_0x39357b[_0xf1ef('0x63')]||'en')[_0xf1ef('0x13')](function(_0x1df06b){_0x1677f3(null,_0x1df06b);})[_0xf1ef('0x15')](function(_0xd5d4ba){_0x1677f3(_0xd5d4ba);});};AGIVertices['prototype'][_0xf1ef('0x64')]=function(_0x31f4d5,_0x217259){scripts[_0xf1ef('0x64')](this[_0xf1ef('0xd')],_0x31f4d5)[_0xf1ef('0x13')](function(_0x2979b5){_0x217259(null,_0x2979b5);})[_0xf1ef('0x15')](function(_0x5a39dc){_0x217259(_0x5a39dc);});};AGIVertices[_0xf1ef('0x10')]['ispeechTTS']=function(_0x1cfbe1,_0x53ee5b){scripts['ispeechTTS'](_0x1cfbe1[_0xf1ef('0x61')],_0x1cfbe1[_0xf1ef('0x62')],_0x1cfbe1[_0xf1ef('0x65')]||'en-US',_0x1cfbe1[_0xf1ef('0x66')])[_0xf1ef('0x13')](function(_0x3ef0a8){_0x53ee5b(null,_0x3ef0a8);})[_0xf1ef('0x15')](function(_0x19739c){_0x53ee5b(_0x19739c);});};AGIVertices['prototype'][_0xf1ef('0x67')]=function(_0xa2199b,_0x4c2199,_0x3dc8d7){scripts[_0xf1ef('0x67')](_0x4c2199,_0xa2199b[_0xf1ef('0x61')],_0xa2199b[_0xf1ef('0x68')]||_0xf1ef('0x69'),this['isConfigured'](_0xa2199b[_0xf1ef('0x6a')])?_0xa2199b[_0xf1ef('0x6a')]:undefined)[_0xf1ef('0x13')](function(_0x2ed236){_0x3dc8d7(null,_0x2ed236);})['catch'](function(_0x3b6151){_0x3dc8d7(_0x3b6151);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x6b')]=function(_0x5e2c13,_0x41bc3e){scripts[_0xf1ef('0x6b')](_0x5e2c13[_0xf1ef('0x6c')],_0x5e2c13[_0xf1ef('0x6d')],_0x5e2c13['aws_polly_region'],_0x5e2c13[_0xf1ef('0x6e')]||_0xf1ef('0x6f'),_0x5e2c13[_0xf1ef('0x62')],_0x5e2c13[_0xf1ef('0x70')]||_0xf1ef('0x62'))[_0xf1ef('0x13')](function(_0x151857){_0x41bc3e(null,_0x151857);})[_0xf1ef('0x15')](function(_0x16c02d){_0x41bc3e(_0x16c02d);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x71')]=function(_0x5d5fbd,_0x331b51){scripts[_0xf1ef('0x71')](this[_0xf1ef('0xd')][_0xf1ef('0x39')],_0x5d5fbd[_0xf1ef('0x6c')],_0x5d5fbd[_0xf1ef('0x6d')],_0x5d5fbd[_0xf1ef('0x72')],_0x5d5fbd[_0xf1ef('0x62')],_0x5d5fbd[_0xf1ef('0x73')])[_0xf1ef('0x13')](function(_0x2aaae1){_0x331b51(null,_0x2aaae1);})[_0xf1ef('0x15')](function(_0x1b9e69){_0x331b51(_0x1b9e69);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x74')]=function(_0x4f5a94,_0xa843d4,_0x127656){scripts[_0xf1ef('0x74')](_0xa843d4,_0x4f5a94['key'],_0x4f5a94[_0xf1ef('0x75')]||_0xf1ef('0x69'))[_0xf1ef('0x13')](function(_0x124f13){_0x127656(null,_0x124f13);})[_0xf1ef('0x15')](function(_0x32bb79){_0x127656(_0x32bb79);});};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x76')]=function(_0x1b0a94,_0x377228,_0x3be0d3){scripts[_0xf1ef('0x76')](_0x377228,_0x1b0a94['appid'],_0x1b0a94['appsecret'],_0x1b0a94['uri'])[_0xf1ef('0x13')](function(_0x512d78){_0x3be0d3(null,_0x512d78);})[_0xf1ef('0x15')](function(_0x4bb6eb){_0x3be0d3(_0x4bb6eb);});};AGIVertices['prototype'][_0xf1ef('0x77')]=function(_0x5aa695){var _0x5c9584=_['includes'](verticesWithRetry,_0x5aa695[_0xf1ef('0x3b')])?_0x5aa695:_['clone'](_0x5aa695);for(var _0x2c1805 in _0x5c9584){if(_0x5c9584[_0xf1ef('0x78')](_0x2c1805)){if(_0x5c9584[_0x2c1805]&&_[_0xf1ef('0x79')](_0x5c9584[_0x2c1805])){_0x5c9584[_0x2c1805]=this[_0xf1ef('0x7a')](_0x5c9584[_0x2c1805]);}}}return _0x5c9584;};AGIVertices['prototype'][_0xf1ef('0x7a')]=function(_0x41f695){var _0x2fcfb7=_0x41f695[_0xf1ef('0x7b')]('{');for(var _0x5dc4f8=0x1;_0x5dc4f8<_0x2fcfb7[_0xf1ef('0x7c')];_0x5dc4f8+=0x1){var _0xd57f7d=_0x2fcfb7[_0x5dc4f8][_0xf1ef('0x7b')]('}');if(_0xd57f7d['length']>0x1){_0x41f695=_0x41f695[_0xf1ef('0x7d')]('{'+_0xd57f7d[0x0]+'}',this[_0xf1ef('0xd')][_0xf1ef('0x11')](_0xd57f7d[0x0])[_0xf1ef('0x7e')]||_0xd57f7d[0x0]);}}if(_0x2fcfb7[_0xf1ef('0x7c')]===0x1){return _0x41f695['toString']();}return this['replaceAllVariables'](_0x41f695);};AGIVertices[_0xf1ef('0x10')]['getAndSetVariable']=function(_0x30ae5c,_0x1e319a){var _0x4c60f7=this[_0xf1ef('0xd')]['getVariable'](_0x30ae5c);if(_0x4c60f7[_0xf1ef('0x7f')]===-0x1){return _0x4c60f7;}logger['info'](util[_0xf1ef('0x2a')](_0xf1ef('0x80'),_0x1e319a,_0x4c60f7[_0xf1ef('0x7e')]));return this[_0xf1ef('0xd')][_0xf1ef('0x81')](_0x1e319a,_0x4c60f7[_0xf1ef('0x7e')]);};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x82')]=function(_0x376fb1){return _0x376fb1&&_0x376fb1!=='0'&&_0x376fb1!=='-1'&&_0x376fb1!=='';};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x83')]=function(_0x32be6f){this[_0xf1ef('0x38')][_0xf1ef('0x84')](this,_0x32be6f,'-');_0x32be6f[_0xf1ef('0x85')]=_0x32be6f[_0xf1ef('0x83')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x8')]=function(_0x3b223c){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x3b223c[_0xf1ef('0x3a')]));return this[_0xf1ef('0xd')][_0xf1ef('0x8')]([_0x3b223c[_0xf1ef('0x86')],_0x3b223c[_0xf1ef('0x87')]]);};AGIVertices[_0xf1ef('0x10')]['answer']=function(_0x1fe040){logger['info'](util[_0xf1ef('0x2a')](_0xf1ef('0x88'),_0x1fe040[_0xf1ef('0x3a')]));if(this[_0xf1ef('0x82')](_0x1fe040[_0xf1ef('0x89')])){logger[_0xf1ef('0x2f')](util['format'](_0xf1ef('0x8a'),_0x1fe040['timeout']));var _0xffe57b=this[_0xf1ef('0xd')]['wait'](_0x1fe040['timeout']);if(_0xffe57b[_0xf1ef('0x7f')]===-0x1){return _0xffe57b;}}return this[_0xf1ef('0xd')]['answer']();};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x8b')]=function(_0x5aece3){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x8c'),_0x5aece3[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x5aece3[_0xf1ef('0x4c')])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x5aece3,'no\x20list\x20selected');}_0x5aece3['scheduledAt']=moment();if(this[_0xf1ef('0x82')](_0x5aece3['delay'])){_0x5aece3['scheduledAt']=moment()[_0xf1ef('0x8d')](_0x5aece3[_0xf1ef('0x8e')],_0xf1ef('0x8f'));}if(!this['isConfigured'](_0x5aece3[_0xf1ef('0x4f')])){_0x5aece3[_0xf1ef('0x4f')]=0x2;}this[_0xf1ef('0x46')][_0xf1ef('0x84')](this,_0x5aece3);return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5aece3[_0xf1ef('0x4b')],_0x5aece3[_0xf1ef('0x4c')],_0x5aece3['scheduledAt']));};AGIVertices['prototype']['custom_app']=function(_0x66cbd3){logger[_0xf1ef('0x2f')](util['format'](_0xf1ef('0x91'),_0x66cbd3[_0xf1ef('0x3a')]));var _0x24014d=this[_0xf1ef('0xd')]['exec'](_0x66cbd3[_0xf1ef('0x92')],_0x66cbd3[_0xf1ef('0x93')]);if(_0x24014d[_0xf1ef('0x7f')]===-0x1){return _0x24014d;}return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x94'),_0x66cbd3[_0xf1ef('0x92')],_0x66cbd3[_0xf1ef('0x93')]));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x95')]=function(_0x16941e){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x96'),_0x16941e['label']));if(!this[_0xf1ef('0x82')](_0x16941e[_0xf1ef('0x62')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')]('no\x20text\x20configured');}var _0x34fb83='\x22'+_0x16941e[_0xf1ef('0x62')]+'\x22';if(this['isConfigured'](_0x16941e[_0xf1ef('0x93')])){_0x34fb83+=','+_0x16941e['options'];}var _0x209fcb=this[_0xf1ef('0xd')][_0xf1ef('0x5b')](_0xf1ef('0x97'),_0x34fb83);if(_0x209fcb[_0xf1ef('0x7f')]===-0x1){return _0x209fcb;}return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format'](_0xf1ef('0x98'),_0x34fb83));};AGIVertices[_0xf1ef('0x10')]['sestektts']=function(_0x4c348f){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x4c348f[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x4c348f[_0xf1ef('0x62')])){return this['channel'][_0xf1ef('0x90')](_0xf1ef('0x99'));}var _0x5f4ef2='\x22'+_0x4c348f['text']+'\x22';if(this[_0xf1ef('0x82')](_0x4c348f[_0xf1ef('0x93')])){_0x5f4ef2+=','+_0x4c348f[_0xf1ef('0x93')];}var _0x52724b=this['channel'][_0xf1ef('0x5b')]('MRCPSynth',_0x5f4ef2);if(_0x52724b['result']===-0x1){return _0x52724b;}return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5f4ef2));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x9a')]=function(_0x5e6399){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x9b'),_0x5e6399[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x5e6399[_0xf1ef('0x9c')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0x9d'));}var _0x355b5b=_0x5e6399[_0xf1ef('0x9c')];if(this[_0xf1ef('0x82')](_0x5e6399['options'])){_0x355b5b+=','+_0x5e6399[_0xf1ef('0x93')];}var _0x14ddc5=this['channel'][_0xf1ef('0x5b')](_0xf1ef('0x9e'),_0x355b5b);if(_0x14ddc5[_0xf1ef('0x7f')]===-0x1){return _0x14ddc5;}var _0x31cd5c=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xf1ef('0x9f'));if(_0x31cd5c[_0xf1ef('0x7f')]===-0x1){return _0x31cd5c;}var _0x2ac393=this[_0xf1ef('0xa0')](_0xf1ef('0xa1'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x2ac393[_0xf1ef('0x7f')]===-0x1){return _0x2ac393;}var _0x143f67=this[_0xf1ef('0xa0')](_0xf1ef('0xa2'),_0xf1ef('0xa3'));if(_0x143f67[_0xf1ef('0x7f')]===-0x1){return _0x143f67;}return this[_0xf1ef('0xd')]['noop'](util[_0xf1ef('0x2a')](_0xf1ef('0xa4'),_0x355b5b));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0xa5')]=function(_0x5012a6){logger[_0xf1ef('0x2f')](util['format'](_0xf1ef('0xa6'),_0x5012a6[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x5012a6[_0xf1ef('0x9c')])){return this['channel'][_0xf1ef('0x90')](_0xf1ef('0x9d'));}var _0xe4e364=_0x5012a6['grammar'];if(this[_0xf1ef('0x82')](_0x5012a6[_0xf1ef('0x93')])){_0xe4e364+=','+_0x5012a6['options'];}var _0xed698f=this[_0xf1ef('0xd')][_0xf1ef('0x5b')](_0xf1ef('0x9e'),_0xe4e364);if(_0xed698f['result']===-0x1){return _0xed698f;}var _0x3a3156=this[_0xf1ef('0xa0')](_0xf1ef('0xa7'),_0xf1ef('0xa8'));if(_0x3a3156[_0xf1ef('0x7f')]===-0x1){return _0x3a3156;}var _0x30869e=this[_0xf1ef('0xa0')]('RECOG_INPUT()',_0xf1ef('0xa9'));if(_0x30869e[_0xf1ef('0x7f')]===-0x1){return _0x30869e;}var _0x6d61e8=this[_0xf1ef('0xa0')]('RECOG_INSTANCE()',_0xf1ef('0xaa'));if(_0x6d61e8['result']===-0x1){return _0x6d61e8;}return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0xa4'),_0xe4e364));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0xab')]=function(_0x4eeab1){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x4eeab1['label']));if(!this[_0xf1ef('0x82')](_0x4eeab1[_0xf1ef('0xac')])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x4eeab1,_0xf1ef('0xad'));}var _0x10e30c=this[_0xf1ef('0x18')]['sync'](this,_0x4eeab1[_0xf1ef('0xac')]);if(!_0x10e30c){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x4eeab1,_0xf1ef('0xae'));}if(!this[_0xf1ef('0x82')](_0x4eeab1['query'])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x4eeab1,_0xf1ef('0xaf'));}var _0x495801=_0x4eeab1[_0xf1ef('0x30')][_0xf1ef('0x5d')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xf1ef('0x90')](util[_0xf1ef('0x2a')]('query:\x20%s',_0x495801));var _0x45efd9=this[_0xf1ef('0x2c')]['sync'](this,_0x10e30c,_0x495801);this['createSquareDetailsReport'][_0xf1ef('0x84')](this,_0x4eeab1,_0x495801);if(!this['isConfigured'](_0x4eeab1[_0xf1ef('0xb0')])){return this[_0xf1ef('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x30794c=this['getVariable'][_0xf1ef('0x84')](this,_0x4eeab1[_0xf1ef('0xb0')]);if(!_0x30794c){return this[_0xf1ef('0xd')]['error'](_0x4eeab1,_0xf1ef('0xb1'));}var _0x2417e9=this;_0x45efd9[_0xf1ef('0xb2')](function(_0x5708e8,_0x580929){Object[_0xf1ef('0xb3')](_0x5708e8)[_0xf1ef('0xb2')](function(_0x351815){_0x2417e9[_0xf1ef('0xd')][_0xf1ef('0x81')](util[_0xf1ef('0x2a')](_0xf1ef('0xb4'),_0x30794c,_0x580929,_0x351815),_0x5708e8[_0x351815]);});});this[_0xf1ef('0xd')]['setVariable'](util[_0xf1ef('0x2a')](_0xf1ef('0xb5'),_0x30794c),_0x45efd9[_0xf1ef('0x7c')]);return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format']('variable\x20%s\x20set',_0x30794c));};AGIVertices[_0xf1ef('0x10')]['dial']=function(_0x2bdcc0){logger[_0xf1ef('0xb6')](util[_0xf1ef('0x2a')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x2bdcc0['label']));if(!this[_0xf1ef('0x82')](_0x2bdcc0['sip_id'])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x2bdcc0,_0xf1ef('0xb7'));}var _0x794a16=this[_0xf1ef('0x1b')]['sync'](this,_0x2bdcc0[_0xf1ef('0xb8')]);if(!_0x794a16){return this['channel'][_0xf1ef('0x2d')](_0x2bdcc0,_0xf1ef('0xb9'));}var _0x37c5e7=this[_0xf1ef('0xd')][_0xf1ef('0x5b')](_0xf1ef('0xba'),[util[_0xf1ef('0x2a')](_0xf1ef('0xbb'),_0x794a16),_0x2bdcc0[_0xf1ef('0x89')],_0x2bdcc0[_0xf1ef('0xbc')],_0x2bdcc0[_0xf1ef('0xbd')]]);if(_0x37c5e7[_0xf1ef('0x7f')]===-0x1){return _0x37c5e7;}return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format'](_0xf1ef('0xbe'),_0xf1ef('0xba')));};AGIVertices['prototype']['dialogflow']=function(_0x325c0f){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0xbf'),_0x325c0f[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x325c0f[_0xf1ef('0x61')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0xc0'));}if(!this['isConfigured'](_0x325c0f[_0xf1ef('0x62')])){return this['channel'][_0xf1ef('0x90')](_0xf1ef('0x99'));}this[_0xf1ef('0xd')][_0xf1ef('0xc1')]=!![];this[_0xf1ef('0x38')](_0x325c0f);this[_0xf1ef('0x45')](_0x325c0f[_0xf1ef('0x62')],'in');this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x325c0f[_0xf1ef('0x62')]));var _0x550cb5=this[_0xf1ef('0x60')][_0xf1ef('0x84')](this,_0x325c0f);if(_0x550cb5){for(var _0x3a7c6d in _0x550cb5){if(_0x550cb5[_0xf1ef('0x78')](_0x3a7c6d)){this[_0xf1ef('0xd')][_0xf1ef('0x81')](util['format']('DIALOGFLOW_%s',_0x3a7c6d[_0xf1ef('0xc2')]()),_0x550cb5[_0x3a7c6d]);}}this[_0xf1ef('0x45')](_0x550cb5[_0xf1ef('0xc3')],_0xf1ef('0xc4'));return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0xc5'),_0x550cb5[_0xf1ef('0xc3')]));}return this['channel'][_0xf1ef('0x2d')](_0x325c0f,_0xf1ef('0xc6'));};AGIVertices[_0xf1ef('0x10')]['sesteknda']=function(_0x996f19){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0xc7'),_0x996f19[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x996f19[_0xf1ef('0xc8')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0xc9'));}if(!this[_0xf1ef('0x82')](_0x996f19[_0xf1ef('0xca')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0xcb'));}if(!this[_0xf1ef('0x82')](_0x996f19[_0xf1ef('0xcc')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x996f19[_0xf1ef('0xcd')])){return this[_0xf1ef('0xd')]['noop'](_0xf1ef('0x99'));}this['channel'][_0xf1ef('0xc1')]=!![];this['createSquareDetailsReport'](_0x996f19);this['createSquareMessage'](_0x996f19[_0xf1ef('0x62')],'in');this[_0xf1ef('0xd')]['noop'](util[_0xf1ef('0x2a')](_0xf1ef('0xce'),_0x996f19[_0xf1ef('0x62')]));var _0x1f4faf=this[_0xf1ef('0x64')][_0xf1ef('0x84')](this,_0x996f19);if(_0x1f4faf){for(var _0x52e6fd in _0x1f4faf){if(_0x1f4faf[_0xf1ef('0x78')](_0x52e6fd)){this[_0xf1ef('0xd')][_0xf1ef('0x81')](util['format']('SESTEK_NDA_%s',_0x52e6fd['toUpperCase']()),_0x1f4faf[_0x52e6fd]);}}this[_0xf1ef('0x45')](_0x1f4faf[_0xf1ef('0xc3')],_0xf1ef('0xc4'));if(_0x1f4faf[_0xf1ef('0xcf')]){this[_0xf1ef('0xd')]['noop'](util[_0xf1ef('0x2a')](_0xf1ef('0xd0'),_0x1f4faf[_0xf1ef('0xcf')]));var _0x2d3f32=this['channel'][_0xf1ef('0xd1')](_0x1f4faf[_0xf1ef('0xcf')]);try{fs['unlink'](_0x1f4faf['audiofile']+_0xf1ef('0xd2'));}catch(_0x81759){logger[_0xf1ef('0x2d')](_0x81759);}return _0x2d3f32;}else{return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0xd3'),_0x1f4faf[_0xf1ef('0xc3')]));}}return this[_0xf1ef('0xd')]['error'](_0x996f19,_0xf1ef('0xd4'));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0xd5')]=function(_0x3482c1){logger[_0xf1ef('0x2f')](util['format'](_0xf1ef('0xd6'),_0x3482c1[_0xf1ef('0x3a')]));return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0xd5'));};AGIVertices[_0xf1ef('0x10')]['ext_dial']=function(_0x265032){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x265032['label']));var _0x17ef06='';if(_0x265032[_0xf1ef('0xd7')]){if(!this[_0xf1ef('0x82')](_0x265032[_0xf1ef('0xd7')])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x265032,_0xf1ef('0xd8'));}else{var _0x1eb7bf=parseInt(_0x265032[_0xf1ef('0xd7')],0xa);if(isNaN(_0x1eb7bf)){_0x17ef06=_0x265032[_0xf1ef('0xd7')];}else{_0x17ef06=this['getTrunk'][_0xf1ef('0x84')](this,_0x265032[_0xf1ef('0xd7')]);if(!_0x17ef06){return this['channel'][_0xf1ef('0x2d')](_0x265032,_0xf1ef('0xd9'));}}}}else if(_0x265032[_0xf1ef('0xda')]){_0x17ef06=_0x265032['trunk_name'];}else{return this[_0xf1ef('0xd')]['error'](_0x265032,_0xf1ef('0xd8'));}var _0x517ca6=this[_0xf1ef('0xd')][_0xf1ef('0x5b')]('DIAL',[util[_0xf1ef('0x2a')](_0xf1ef('0xdb'),_0x17ef06,_0x265032[_0xf1ef('0x4b')]),_0x265032[_0xf1ef('0x89')],_0x265032[_0xf1ef('0xbc')],_0x265032[_0xf1ef('0xbd')]]);if(_0x517ca6[_0xf1ef('0x7f')]===-0x1){return _0x517ca6;}return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format'](_0xf1ef('0xbe'),_0xf1ef('0xba')));};AGIVertices[_0xf1ef('0x10')]['finally']=function(_0xfe28ed){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0xdc'),_0xfe28ed['label']));return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0xdd'));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0xb')]=function(_0x621054){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x621054[_0xf1ef('0x3a')]));if(_0x621054[_0xf1ef('0x85')]===0x0){return this[_0xf1ef('0x83')](_0x621054);}_0x621054[_0xf1ef('0x85')]-=0x1;if(!this[_0xf1ef('0x82')](_0x621054[_0xf1ef('0xde')])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x621054,'no\x20file\x20audio\x20selected');}var _0x48615c=this[_0xf1ef('0x1f')][_0xf1ef('0x84')](this,_0x621054[_0xf1ef('0xde')]);if(!_0x48615c){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x621054,_0xf1ef('0xdf'));}if(!this[_0xf1ef('0x82')](_0x621054['variable_id'])){return this['channel'][_0xf1ef('0x2d')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x505f3d=this['channel'][_0xf1ef('0xe0')](_0x48615c,_0x621054[_0xf1ef('0xe1')],_0x621054[_0xf1ef('0xe2')]);var _0x2dfdc6=_0x505f3d[_0xf1ef('0x7f')]?_0x505f3d[_0xf1ef('0x7f')][_0xf1ef('0xe3')]():'';logger['info']('test',JSON[_0xf1ef('0xe4')](_0x505f3d));if(_0x505f3d['result']===-0x1){this[_0xf1ef('0x38')][_0xf1ef('0x84')](this,_0x621054,_0x2dfdc6);return _0x505f3d;}else if(_0x505f3d[_0xf1ef('0x7e')]===_0xf1ef('0x89')){_0x505f3d[_0xf1ef('0x7f')]=_0x2dfdc6[_0xf1ef('0x7c')]>=parseInt(_0x621054[_0xf1ef('0xe5')])?'x':'i';}else{_0x505f3d[_0xf1ef('0x7f')]=_0x2dfdc6['length']>=parseInt(_0x621054[_0xf1ef('0xe5')])&&_0x2dfdc6[_0xf1ef('0x7c')]<=parseInt(_0x621054[_0xf1ef('0xe2')])?'x':'i';}var _0x1a14f4=this[_0xf1ef('0x11')][_0xf1ef('0x84')](this,_0x621054[_0xf1ef('0xb0')]);if(!_0x1a14f4){return this['channel'][_0xf1ef('0x2d')](_0x621054,_0xf1ef('0xb1'));}this[_0xf1ef('0xd')][_0xf1ef('0x81')](_0x1a14f4,_0x2dfdc6);if(this[_0xf1ef('0x82')](_0x621054[_0xf1ef('0xe6')])){var _0x2d3423=parseInt(_0x621054[_0xf1ef('0xe6')],0xa);var _0x384f2a=rs[_0xf1ef('0xe7')]({'charset':'*','length':_0x2d3423});var _0x2aedfe=_0x2dfdc6[_0xf1ef('0x7c')];if(_0x2aedfe>0x0){if(_0x2aedfe>_0x2d3423){this[_0xf1ef('0x38')][_0xf1ef('0x84')](this,_0x621054,_0x621054[_0xf1ef('0xe8')]==='first'?_0x384f2a+_0x2dfdc6[_0xf1ef('0xe9')](_0x2d3423):_0x2dfdc6['substr'](0x0,_0x2aedfe-_0x2d3423)+_0x384f2a);}else{this[_0xf1ef('0x38')][_0xf1ef('0x84')](this,_0x621054,rs[_0xf1ef('0xe7')]({'charset':'*','length':_0x2aedfe}));}}else{this[_0xf1ef('0x38')][_0xf1ef('0x84')](this,_0x621054,'');}}else{this[_0xf1ef('0x38')][_0xf1ef('0x84')](this,_0x621054,_0x2dfdc6);}return _0x505f3d;};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0xc')]=function(_0x983a72){logger[_0xf1ef('0x2f')](util['format'](_0xf1ef('0xea'),_0x983a72[_0xf1ef('0x3a')]));return this[_0xf1ef('0xb')](_0x983a72);};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0xeb')]=function(_0x56a64d){logger[_0xf1ef('0x2f')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x56a64d[_0xf1ef('0x3a')]));this[_0xf1ef('0x38')][_0xf1ef('0x84')](this,_0x56a64d,_0x56a64d['goalname']);return this[_0xf1ef('0xd')]['noop'](util[_0xf1ef('0x2a')](_0xf1ef('0xec'),_0x56a64d['goalname']));};AGIVertices['prototype']['awspolly']=function(_0x364176){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0xed'),_0x364176[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x364176[_0xf1ef('0x6c')])||!this[_0xf1ef('0x82')](_0x364176['aws_secret_access_key'])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xf1ef('0x82')](_0x364176['text'])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0x99'));}this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0xee'),_0x364176[_0xf1ef('0x62')]));var _0x291cc1=this[_0xf1ef('0x6b')][_0xf1ef('0x84')](this,_0x364176);if(_0x291cc1){this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')]('aws\x20Polly\x20%s\x20file\x20created',_0x291cc1));var _0x51fc80=this[_0xf1ef('0xd')][_0xf1ef('0xd1')](_0x291cc1);try{fs['unlink'](_0x291cc1+_0xf1ef('0xd2'));}catch(_0x39b905){logger['error'](_0x39b905);}return _0x51fc80;}return this[_0xf1ef('0xd')]['error'](_0x364176,_0xf1ef('0xef'));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0xf0')]=function(_0x7a6d86){logger[_0xf1ef('0x2f')](util['format'](_0xf1ef('0xf1'),_0x7a6d86[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x7a6d86['aws_access_key_id'])||!this[_0xf1ef('0x82')](_0x7a6d86['aws_secret_access_key'])){return this['channel'][_0xf1ef('0x90')](_0xf1ef('0xf2'));}if(!this[_0xf1ef('0x82')](_0x7a6d86[_0xf1ef('0x73')])){return this[_0xf1ef('0xd')]['noop'](_0xf1ef('0xf3'));}if(!this[_0xf1ef('0x82')](_0x7a6d86[_0xf1ef('0x62')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')]('no\x20text\x20configured');}this[_0xf1ef('0xd')][_0xf1ef('0xc1')]=!![];this[_0xf1ef('0x38')](_0x7a6d86);this[_0xf1ef('0x45')](_0x7a6d86[_0xf1ef('0x62')],'in');this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0xf4'),_0x7a6d86[_0xf1ef('0x62')]));var _0x14f6d1=this['awsLex']['sync'](this,_0x7a6d86);if(_0x14f6d1){for(var _0x2ae30c in _0x14f6d1){if(_0x14f6d1['hasOwnProperty'](_0x2ae30c)&&_['isString'](_0x14f6d1[_0x2ae30c])){this[_0xf1ef('0xd')][_0xf1ef('0x81')](util[_0xf1ef('0x2a')](_0xf1ef('0xf5'),_0x2ae30c[_0xf1ef('0xc2')]()),_0x14f6d1[_0x2ae30c]);}}if(_['isNil'](_0x14f6d1[_0xf1ef('0xf6')])){return this['channel'][_0xf1ef('0x90')](_0xf1ef('0xf7'));}else{this[_0xf1ef('0x45')](_0x14f6d1[_0xf1ef('0xf6')],_0xf1ef('0xc4'));return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')]('Amazon\x20Lex\x20Result\x20%s',_0x14f6d1['message']));}}return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x7a6d86,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0xf8')]=function(_0x2c7286){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x2c7286[_0xf1ef('0x3a')],_0x2c7286[_0xf1ef('0x89')]));if(!this[_0xf1ef('0x82')](_0x2c7286['key'])){return this['channel'][_0xf1ef('0x90')]('no\x20key\x20configured');}var _0x305799=_0xf1ef('0xf9');var _0x364777=util[_0xf1ef('0x2a')](_0xf1ef('0xfa'),FILES_PATH,rs['generate'](0x4));var _0x50e3a6=util[_0xf1ef('0x2a')](_0xf1ef('0xfb'),_0x364777,_0x305799);var _0x1c9adc=!![];if(_0x2c7286[_0xf1ef('0xfc')]===_0xf1ef('0xfd')){_0x1c9adc=![];}var _0x15b3a9=this['channel'][_0xf1ef('0xfe')](_0x364777,_0x305799,_0x2c7286[_0xf1ef('0xff')],_0x2c7286[_0xf1ef('0x89')],undefined,_0x1c9adc);if(_0x15b3a9['result']!==-0x1){this[_0xf1ef('0xd')]['noop'](util[_0xf1ef('0x2a')]('google\x20%s\x20file\x20created',_0x50e3a6));var _0x4ec6bc=this[_0xf1ef('0x74')]['sync'](this,_0x2c7286,_0x50e3a6);if(_0x4ec6bc){for(var _0x4331de in _0x4ec6bc){if(_0x4ec6bc[_0xf1ef('0x78')](_0x4331de)){this[_0xf1ef('0xd')]['setVariable'](util[_0xf1ef('0x2a')](_0xf1ef('0x100'),_0x4331de[_0xf1ef('0xc2')]()),_0x4ec6bc[_0x4331de]);}}return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x101'),JSON[_0xf1ef('0xe4')](_0x4ec6bc)));}}return _0x15b3a9;};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x102')]=function(_0x461985){logger['info'](util[_0xf1ef('0x2a')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x461985[_0xf1ef('0x3a')]));if(!this['isConfigured'](_0x461985['appid'])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0x103'));}if(!this[_0xf1ef('0x82')](_0x461985[_0xf1ef('0x104')])){return this['channel'][_0xf1ef('0x90')]('no\x20appsecret\x20configured');}var _0x2b2acd=_0xf1ef('0xf9');var _0x12cee8=util['format'](_0xf1ef('0xfa'),FILES_PATH,rs['generate'](0x4));var _0x559c11=util[_0xf1ef('0x2a')]('%s.%s',_0x12cee8,_0x2b2acd);var _0x2138cc=!![];if(_0x461985[_0xf1ef('0xfc')]==='NOBEEP'){_0x2138cc=![];}var _0x2c2c88=this['channel']['recordFile'](_0x12cee8,_0x2b2acd,_0x461985[_0xf1ef('0xff')],_0x461985[_0xf1ef('0x89')],undefined,_0x2138cc);if(_0x2c2c88['result']!==-0x1){this['channel'][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x105'),_0x559c11));var _0x10597d=this[_0xf1ef('0x76')][_0xf1ef('0x84')](this,_0x461985,_0x559c11);if(_0x10597d){for(var _0x5ac03c in _0x10597d){if(_0x10597d[_0xf1ef('0x78')](_0x5ac03c)){this[_0xf1ef('0xd')][_0xf1ef('0x81')](util['format'](_0xf1ef('0x106'),_0x5ac03c[_0xf1ef('0xc2')]()),_0x10597d[_0x5ac03c]);}}return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')]('TildeASR\x20Result\x20%s',JSON[_0xf1ef('0xe4')](_0x10597d)));}}return _0x2c2c88;};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x107')]=function(_0x5bcd74){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x108'),_0x5bcd74[_0xf1ef('0x3a')]));return this[_0xf1ef('0xd')][_0xf1ef('0x109')](_0x5bcd74['context'],_0x5bcd74[_0xf1ef('0x10a')],_0x5bcd74['priority']);};AGIVertices['prototype'][_0xf1ef('0x10b')]=function(_0x56d362){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x56d362[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x56d362[_0xf1ef('0x10c')])){return this['channel'][_0xf1ef('0x2d')](_0x56d362,'no\x20condition\x20configured');}try{var _0xa2af41=eval(_0x56d362[_0xf1ef('0x10c')])?_0xf1ef('0x10d'):_0xf1ef('0x10e');this['channel']['noop'](util[_0xf1ef('0x2a')]('EVAL\x20CONDITION\x20%s\x20%s',_0x56d362['condition'],_0xa2af41));return{'code':0xc8,'result':_0xa2af41};}catch(_0x3d15ac){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x10f')]=function(_0x230ce5){logger['info'](util[_0xf1ef('0x2a')](_0xf1ef('0x110'),_0x230ce5[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x230ce5['interval_id'])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x230ce5,_0xf1ef('0x111'));}var _0x41d465=this[_0xf1ef('0x23')][_0xf1ef('0x84')](this,_0x230ce5['interval_id']);if(!_0x41d465){return this['channel'][_0xf1ef('0x2d')](_0x230ce5,_0xf1ef('0x112'));}for(var _0x39ba91=0x0;_0x39ba91<_0x41d465[_0xf1ef('0x7c')];_0x39ba91+=0x1){var _0x6c87d2=this[_0xf1ef('0xd')]['getVariable'](util[_0xf1ef('0x2a')](_0xf1ef('0x113'),_0x41d465[_0x39ba91]));if(_0x6c87d2['result']===-0x1){return _0x6c87d2;}logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x114'),_0x41d465[_0x39ba91],_0x6c87d2[_0xf1ef('0x7e')]));if(_0x6c87d2[_0xf1ef('0x7e')]==='true'){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x114'),_0x41d465[_0x39ba91],'true'));this[_0xf1ef('0xd')]['noop'](util[_0xf1ef('0x2a')](_0xf1ef('0x114'),_0x41d465[_0x39ba91],_0xf1ef('0x10d')));return{'code':0xc8,'result':'true'};}else{logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x114'),_0x41d465[_0x39ba91],_0xf1ef('0x10e')));this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')]('IFTIME\x20%s\x20%s',_0x41d465[_0x39ba91],_0xf1ef('0x10e')));}}return{'code':0xc8,'result':_0xf1ef('0x10e')};};AGIVertices[_0xf1ef('0x10')]['hangup']=function(_0x54bd33){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x54bd33[_0xf1ef('0x3a')]));return this[_0xf1ef('0xd')][_0xf1ef('0x115')]();};AGIVertices['prototype'][_0xf1ef('0x116')]=function(_0x4c09d1){logger['info'](util['format'](_0xf1ef('0x117'),_0x4c09d1['label']));if(!this['isConfigured'](_0x4c09d1[_0xf1ef('0x61')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0xc0'));}var _0x4be99c=_0xf1ef('0xf9');var _0xb68e88=util[_0xf1ef('0x2a')](_0xf1ef('0xfa'),FILES_PATH,rs['generate'](0x4));var _0x17a584=util['format']('%s.%s',_0xb68e88,_0x4be99c);var _0x22db4d=!![];if(_0x4c09d1[_0xf1ef('0xfc')]===_0xf1ef('0xfd')){_0x22db4d=![];}var _0x59e5d9=this['channel'][_0xf1ef('0xfe')](_0xb68e88,_0x4be99c,_0x4c09d1[_0xf1ef('0xff')],_0x4c09d1['timeout'],undefined,_0x22db4d);if(_0x59e5d9['result']!==-0x1){this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x118'),_0x17a584));var _0x3be3ba=this['ispeechASR'][_0xf1ef('0x84')](this,_0x4c09d1,_0x17a584);if(_0x3be3ba){for(var _0x1c1b6f in _0x3be3ba){if(_0x3be3ba[_0xf1ef('0x78')](_0x1c1b6f)){this[_0xf1ef('0xd')][_0xf1ef('0x81')](util[_0xf1ef('0x2a')](_0xf1ef('0x119'),_0x1c1b6f[_0xf1ef('0xc2')]()),_0x3be3ba[_0x1c1b6f]);}}return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0xf1ef('0xe4')](_0x3be3ba)));}}return _0x59e5d9;};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x11a')]=function(_0x4c68a2){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x11b'),_0x4c68a2['label']));if(!this[_0xf1ef('0x82')](_0x4c68a2[_0xf1ef('0x61')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0xc0'));}if(!this[_0xf1ef('0x82')](_0x4c68a2[_0xf1ef('0x62')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')]('no\x20text\x20configured');}this['channel']['noop'](util[_0xf1ef('0x2a')](_0xf1ef('0x11c'),_0x4c68a2[_0xf1ef('0x62')]));var _0x8f58f4=this[_0xf1ef('0x11d')][_0xf1ef('0x84')](this,_0x4c68a2);if(_0x8f58f4){this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x118'),_0x8f58f4));var _0x37bb9b=this[_0xf1ef('0xd')]['streamFile'](_0x8f58f4,_0x4c68a2[_0xf1ef('0xff')]);try{fs[_0xf1ef('0x11e')](_0x8f58f4+'.wav');}catch(_0x5ee70d){logger[_0xf1ef('0x2d')](_0x5ee70d);}return _0x37bb9b;}return this[_0xf1ef('0xd')]['error'](_0x4c68a2,_0xf1ef('0x11f'));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x120')]=function(_0x34a008){logger['info'](util[_0xf1ef('0x2a')](_0xf1ef('0x121'),_0x34a008[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x34a008[_0xf1ef('0x122')])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x34a008,_0xf1ef('0x123'));}logger[_0xf1ef('0x2f')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x34a008[_0xf1ef('0x122')]));var _0x196a45=this[_0xf1ef('0x56')]['sync'](this,_0x34a008[_0xf1ef('0x122')]);if(_0x196a45){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x124'),this[_0xf1ef('0xd')]['callerid'],_0x34a008[_0xf1ef('0x122')]));this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format'](_0xf1ef('0x124'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x34a008[_0xf1ef('0x122')]));return{'code':0xc8,'result':'success'};}else{logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x125'),this['channel'][_0xf1ef('0x3c')],_0x34a008['findBy']));this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format'](_0xf1ef('0x125'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x34a008[_0xf1ef('0x122')]));return{'code':0xc8,'result':_0xf1ef('0x126')};}};AGIVertices['prototype'][_0xf1ef('0x127')]=function(_0x317151){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x128'),_0x317151[_0xf1ef('0x3a')]));if(!this['isConfigured'](_0x317151[_0xf1ef('0x122')])){return this['channel'][_0xf1ef('0x2d')](_0x317151,_0xf1ef('0x123'));}logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x129'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x317151[_0xf1ef('0x122')]));var _0x2f5124=this['agentLogout'][_0xf1ef('0x84')](this,_0x317151[_0xf1ef('0x122')]);if(_0x2f5124){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x124'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x317151[_0xf1ef('0x122')]));this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x124'),this['channel']['callerid'],_0x317151[_0xf1ef('0x122')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0xf1ef('0x125'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x317151[_0xf1ef('0x122')]));this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format'](_0xf1ef('0x125'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x317151[_0xf1ef('0x122')]));return{'code':0xc8,'result':_0xf1ef('0x126')};}};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x12a')]=function(_0x18e49a){logger['info'](util[_0xf1ef('0x2a')](_0xf1ef('0x12b'),_0x18e49a[_0xf1ef('0x3a')]));if(!this['isConfigured'](_0x18e49a[_0xf1ef('0x12c')])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x18e49a,_0xf1ef('0x12d'));}this['channel'][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x12e'),_0x18e49a[_0xf1ef('0x12c')]));var _0x26b147=eval(_0x18e49a[_0xf1ef('0x12c')]);if(!this['isConfigured'](_0x18e49a['variable_id'])){return this['channel'][_0xf1ef('0x90')](_0xf1ef('0x12f'));}var _0x360bcf=this[_0xf1ef('0x11')][_0xf1ef('0x84')](this,_0x18e49a[_0xf1ef('0xb0')]);if(!_0x360bcf){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x18e49a,_0xf1ef('0xb1'));}if(_[_0xf1ef('0x130')](_0x26b147)){var _0x514d0a=this;_0x26b147[_0xf1ef('0xb2')](function(_0x5e8f40,_0x3956f2){_0x514d0a[_0xf1ef('0xd')]['setVariable'](util[_0xf1ef('0x2a')](_0xf1ef('0x131'),_0x360bcf,_0x3956f2),_0x5e8f40);});return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x132'),_0x360bcf));}else{return this[_0xf1ef('0xd')][_0xf1ef('0x81')](_0x360bcf,_0x26b147);}};AGIVertices[_0xf1ef('0x10')]['menu']=function(_0x4d4acb){logger['info'](util[_0xf1ef('0x2a')](_0xf1ef('0x133'),_0x4d4acb[_0xf1ef('0x3a')]));if(_0x4d4acb[_0xf1ef('0x85')]===0x0){return this['maxRetry'](_0x4d4acb);}_0x4d4acb[_0xf1ef('0x85')]-=0x1;if(!this[_0xf1ef('0x82')](_0x4d4acb[_0xf1ef('0xde')])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x4d4acb,_0xf1ef('0x134'));}var _0x29ee93=this[_0xf1ef('0x1f')]['sync'](this,_0x4d4acb[_0xf1ef('0xde')]);if(!_0x29ee93){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x4d4acb,_0xf1ef('0xdf'));}var _0x20fa39=this['channel'][_0xf1ef('0xe0')](_0x29ee93,_0x4d4acb[_0xf1ef('0xe1')],_0x4d4acb[_0xf1ef('0x135')]);var _0x418631=_0x20fa39[_0xf1ef('0x7f')];if(_0x20fa39[_0xf1ef('0x7f')]===-0x1){this[_0xf1ef('0x38')]['sync'](this,_0x4d4acb,'-1');return _0x20fa39;}else if(_0x20fa39[_0xf1ef('0x7e')]===_0xf1ef('0x89')){_0x20fa39['result']=_0x20fa39[_0xf1ef('0x7f')][_0xf1ef('0x7c')]>0x0?_0x20fa39[_0xf1ef('0x7f')]:'t';}else if(_[_0xf1ef('0x47')](_0x20fa39[_0xf1ef('0x7f')])){_0x20fa39[_0xf1ef('0x7f')]='#';_0x418631='#';}if(!this[_0xf1ef('0x82')](_0x4d4acb[_0xf1ef('0xb0')])){this['channel'][_0xf1ef('0x90')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x381842=this['getVariable']['sync'](this,_0x4d4acb[_0xf1ef('0xb0')]);if(!_0x381842){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x4d4acb,_0xf1ef('0xb1'));}this['channel'][_0xf1ef('0x81')](_0x381842,_0x418631);}this['createSquareDetailsReport']['sync'](this,_0x4d4acb,_0x418631);return _0x20fa39;};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x90')]=function(_0x53845c){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x136'),_0x53845c[_0xf1ef('0x3a')]));return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0x53845c[_0xf1ef('0x137')]||_0x53845c[_0xf1ef('0x3a')]);};AGIVertices['prototype'][_0xf1ef('0x138')]=function(_0x37ca29){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x37ca29[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x37ca29[_0xf1ef('0x122')])){return this[_0xf1ef('0xd')]['error'](_0x37ca29,_0xf1ef('0x123'));}logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x129'),this['channel'][_0xf1ef('0x3c')],_0x37ca29[_0xf1ef('0x122')]));var _0x1551e8=this['getPause']['sync'](this,_0x37ca29['pause_id']);var _0x5461a3=this['agentPause'][_0xf1ef('0x84')](this,_0x37ca29[_0xf1ef('0x122')],_0x1551e8);if(_0x5461a3){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x124'),this[_0xf1ef('0xd')]['callerid'],_0x37ca29['findBy']));this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format'](_0xf1ef('0x124'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x37ca29[_0xf1ef('0x122')]));return{'code':0xc8,'result':_0xf1ef('0x139')};}else{logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x125'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x37ca29[_0xf1ef('0x122')]));this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x124'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x37ca29[_0xf1ef('0x122')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x13a')]=function(_0x4c0d06){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x13b'),_0x4c0d06['label']));if(!this[_0xf1ef('0x82')](_0x4c0d06[_0xf1ef('0xde')])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x4c0d06,_0xf1ef('0x134'));}var _0xb38138=this[_0xf1ef('0x1f')][_0xf1ef('0x84')](this,_0x4c0d06['file_id']);if(!_0xb38138){return this['channel']['error'](_0x4c0d06,_0xf1ef('0xdf'));}var _0x5491e6=this['channel'][_0xf1ef('0x5b')]('PLAYBACK',[_0xb38138,_0x4c0d06[_0xf1ef('0xbc')]]);if(_0x5491e6[_0xf1ef('0x7f')]===-0x1){return _0x5491e6;}return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format']('Executed\x20command\x20%s\x20%s','PLAYBACK',_0xb38138));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x13c')]=function(_0x634ecc){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x13d'),_0x634ecc[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x634ecc[_0xf1ef('0x13e')])){return this['channel'][_0xf1ef('0x2d')](_0x634ecc,_0xf1ef('0x13f'));}var _0xb4c007='';var _0x1c82d6=parseInt(_0x634ecc['queue_id'],0xa);if(isNaN(_0x1c82d6)){_0xb4c007=_0x634ecc[_0xf1ef('0x13e')];}else{_0xb4c007=this['getVoiceQueue'][_0xf1ef('0x84')](this,_0x634ecc[_0xf1ef('0x13e')]);if(!_0xb4c007){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x634ecc,_0xf1ef('0x140'));}}var _0x5d59fe='';if(this[_0xf1ef('0x82')](_0x634ecc[_0xf1ef('0xde')])){var _0x23b4ea=this[_0xf1ef('0x1f')]['sync'](this,_0x634ecc[_0xf1ef('0xde')]);if(_0x23b4ea){_0x5d59fe=_0x23b4ea;}}this['createSquareDetailsReport'][_0xf1ef('0x84')](this,_0x634ecc,_0xb4c007);if(_0x634ecc['opts'][_0xf1ef('0x141')]('x')<0x0){_0x634ecc['opts']+='x';}if(_0x634ecc[_0xf1ef('0xbc')][_0xf1ef('0x141')]('X')<0x0){_0x634ecc[_0xf1ef('0xbc')]+='X';}this[_0xf1ef('0xd')]['setVariable'](_0xf1ef('0x142'),_0xb4c007?_0xb4c007['toLowerCase']():'');var _0x226ee0=this[_0xf1ef('0xd')][_0xf1ef('0x5b')](_0xf1ef('0x143'),[_0xb4c007,_0x634ecc[_0xf1ef('0xbc')],_0x634ecc[_0xf1ef('0xbd')],_0x5d59fe,_0x634ecc[_0xf1ef('0x89')],_0x634ecc['agi'],_0x634ecc[_0xf1ef('0x144')],_0x634ecc[_0xf1ef('0x145')],'',_0x634ecc[_0xf1ef('0x146')]]);if(_0x226ee0[_0xf1ef('0x7f')]===-0x1){return _0x226ee0;}return this[_0xf1ef('0xd')]['noop'](util[_0xf1ef('0x2a')](_0xf1ef('0x94'),_0xf1ef('0x143'),_0xb4c007));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x147')]=function(_0x5219ec){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x148'),_0x5219ec[_0xf1ef('0x3a')]));var _0x5691f3=_0x5219ec[_0xf1ef('0x149')]||_0xf1ef('0xf9');var _0x178ebe=util[_0xf1ef('0x2a')](_0xf1ef('0x14a'),this[_0xf1ef('0xd')]['uniqueid'],rs[_0xf1ef('0xe7')](0x5));var _0x2cb32f=util[_0xf1ef('0x2a')](_0xf1ef('0x14b'),FILES_PATH,_0x178ebe,_0x5691f3);var _0x262940=util[_0xf1ef('0x2a')](_0xf1ef('0xfa'),FILES_PATH,_0x178ebe);this[_0xf1ef('0x3d')][_0xf1ef('0x84')](this,_0x5219ec,_0x178ebe,_0x2cb32f);this[_0xf1ef('0xd')][_0xf1ef('0x81')](_0xf1ef('0x14c'),_0x178ebe);logger[_0xf1ef('0x2f')](_0xf1ef('0x14d'),_0x262940,_0x5691f3,_0x5219ec['escape_digits'],_0x5219ec[_0xf1ef('0x89')]);return this[_0xf1ef('0xd')][_0xf1ef('0xfe')](_0x262940,_0x5691f3,_0x5219ec[_0xf1ef('0x14e')],_0x5219ec[_0xf1ef('0x89')],undefined,!![]);};AGIVertices['prototype'][_0xf1ef('0x14f')]=function(_0x5137b4){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x150'),_0x5137b4['label']));return this[_0xf1ef('0xd')][_0xf1ef('0x151')](_0x5137b4[_0xf1ef('0x152')][_0xf1ef('0x5d')](/\s+/g,''),_0x5137b4[_0xf1ef('0x14e')]);};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x153')]=function(_0x130467){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x154'),_0x130467[_0xf1ef('0x3a')]));return this[_0xf1ef('0xd')]['sayNumber'](_0x130467['number'][_0xf1ef('0x5d')](/\s+/g,''),_0x130467[_0xf1ef('0x14e')]);};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x155')]=function(_0x471cb3){logger[_0xf1ef('0x2f')](util['format'](_0xf1ef('0x156'),_0x471cb3[_0xf1ef('0x3a')]));return this[_0xf1ef('0xd')][_0xf1ef('0x157')](_0x471cb3[_0xf1ef('0x62')],_0x471cb3['escape_digits']);};AGIVertices['prototype'][_0xf1ef('0x158')]=function(_0x23bc05){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x159'),_0x23bc05['label']));if(!this[_0xf1ef('0x82')](_0x23bc05[_0xf1ef('0x15a')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')]('no\x20mail\x20account\x20configured');}var _0x181ad7=this['getMailAccount'][_0xf1ef('0x84')](this,_0x23bc05['account_id']);if(!_0x181ad7||!_0x181ad7[_0xf1ef('0x15b')]){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x23bc05,_0xf1ef('0x15c'));}var _0x4b393e={'from':util[_0xf1ef('0x2a')]('\x22%s\x22\x20<%s>',_0x181ad7['name'],_0x181ad7[_0xf1ef('0x15d')]||_0x181ad7[_0xf1ef('0x15b')][_0xf1ef('0x15e')]),'to':_0x23bc05['to']||'','cc':_0x23bc05['cc']||'','bcc':_0x23bc05['bcc']||'','subject':_0x23bc05[_0xf1ef('0x15f')],'html':_0x23bc05[_0xf1ef('0x62')],'text':_0x23bc05[_0xf1ef('0x62')]};var _0x4652d7={'tls':{'rejectUnauthorized':![]}};if(_0x181ad7[_0xf1ef('0x15b')][_0xf1ef('0x160')]){_0x4652d7[_0xf1ef('0x160')]=_0x181ad7['Smtp'][_0xf1ef('0x160')];}else{_0x4652d7[_0xf1ef('0x161')]=_0x181ad7['Smtp'][_0xf1ef('0x161')];_0x4652d7[_0xf1ef('0x162')]=_0x181ad7['Smtp'][_0xf1ef('0x162')];_0x4652d7[_0xf1ef('0x163')]=_0x181ad7['Smtp'][_0xf1ef('0x163')];}if(_0x181ad7[_0xf1ef('0x15b')]['authentication']){_0x4652d7[_0xf1ef('0x164')]={'user':_0x181ad7['Smtp'][_0xf1ef('0x15e')],'pass':_0x181ad7[_0xf1ef('0x15b')][_0xf1ef('0x165')]};}if(this[_0xf1ef('0x82')](_0x23bc05[_0xf1ef('0x166')])){}logger[_0xf1ef('0xb6')](_0xf1ef('0x167'),JSON[_0xf1ef('0xe4')](_0x4b393e));this[_0xf1ef('0x38')][_0xf1ef('0x84')](this,_0x23bc05,_0x23bc05[_0xf1ef('0x15a')]);this[_0xf1ef('0xd')]['noop'](util[_0xf1ef('0x2a')](_0xf1ef('0x168'),_0x181ad7[_0xf1ef('0x14')]));this['sendMailMessage'][_0xf1ef('0x84')](this,_0x4652d7,_0x4b393e);return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0x169'));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x16a')]=function(_0x1d5f24){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x16b'),_0x1d5f24[_0xf1ef('0x3a')]));return this[_0xf1ef('0xd')][_0xf1ef('0x90')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xf1ef('0x10')]['sendSMS']=function(_0x1b0af3){logger[_0xf1ef('0x2f')](util['format'](_0xf1ef('0x16c'),_0x1b0af3[_0xf1ef('0x3a')]));if(!this[_0xf1ef('0x82')](_0x1b0af3[_0xf1ef('0x16d')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0x16e'));}var _0x445df5=this[_0xf1ef('0x35')][_0xf1ef('0x84')](this,_0x1b0af3[_0xf1ef('0x16d')]);if(!_0x445df5){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x1b0af3,'no\x20sms\x20account\x20found');}var _0xeedcbc={'body':_0x1b0af3[_0xf1ef('0x16f')],'phone':_0x1b0af3['to']||'','SmsAccountId':_0x445df5['id']};logger[_0xf1ef('0xb6')](_0xf1ef('0x170'),JSON[_0xf1ef('0xe4')](_0xeedcbc));this[_0xf1ef('0x38')][_0xf1ef('0x84')](this,_0x1b0af3,_0x1b0af3[_0xf1ef('0x16d')]);this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x171'),_0x445df5['name']));this[_0xf1ef('0x37')]['sync'](this,_0xeedcbc);return this[_0xf1ef('0xd')][_0xf1ef('0x90')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x172')]=function(_0x331523){logger['info'](util[_0xf1ef('0x2a')](_0xf1ef('0x173'),_0x331523['label']));if(!this['isConfigured'](_0x331523[_0xf1ef('0xb0')])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x331523,'no\x20variable\x20selected');}var _0x3aa47e=this[_0xf1ef('0x11')][_0xf1ef('0x84')](this,_0x331523['variable_id']);if(!_0x3aa47e){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x331523,_0xf1ef('0xb1'));}return this[_0xf1ef('0xd')][_0xf1ef('0x81')](_0x3aa47e,_0x331523['variable_value']);};AGIVertices[_0xf1ef('0x10')]['start']=function(_0x33fd30){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x174'),_0x33fd30[_0xf1ef('0x3a')]));this['channel'][_0xf1ef('0x90')](_0xf1ef('0x175'));if(_0x33fd30[_0xf1ef('0x176')]===_0xf1ef('0x177')){this[_0xf1ef('0xd')]['noop'](_0xf1ef('0x178'));return this['channel']['answer']();}return this['channel'][_0xf1ef('0x90')]('Skipped\x20Answer');};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x179')]=function(_0x56b60f){logger[_0xf1ef('0x2f')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x56b60f['label']));if(!this[_0xf1ef('0x82')](_0x56b60f[_0xf1ef('0x17a')])){return this['channel'][_0xf1ef('0x2d')](_0x56b60f,_0xf1ef('0x17b'));}var _0x3d6ec8=this[_0xf1ef('0x16')][_0xf1ef('0x84')](this,_0x56b60f['project_id']);if(!this['isConfigured'](_0x3d6ec8)){return this[_0xf1ef('0xd')]['error'](_0x56b60f,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x56b60f[_0xf1ef('0x17a')]));}if(_0x3d6ec8===this['channel']['arg_1']){return this['channel'][_0xf1ef('0x2d')](_0x56b60f,_0xf1ef('0x17c'));}this[_0xf1ef('0x38')][_0xf1ef('0x84')](this,_0x56b60f,_0x3d6ec8);var _0x4f0504=this[_0xf1ef('0xd')]['exec'](_0xf1ef('0x17d'),util[_0xf1ef('0x2a')](_0xf1ef('0x17e'),config[_0xf1ef('0x8')][_0xf1ef('0x161')]||_0xf1ef('0x17f'),_0x3d6ec8,this['channel']['arg_1']));if(_0x4f0504[_0xf1ef('0x7f')]===-0x1){return _0x4f0504;}return this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x94'),'AGI',_0x3d6ec8));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x180')]=function(_0x359956){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x359956['label']));var _0x593ff3=this[_0xf1ef('0x5a')]['sync'](this,_0x359956['command']);this['createSquareDetailsReport'][_0xf1ef('0x84')](this,_0x359956,_0x359956['command']);if(this['isConfigured'](_0x359956[_0xf1ef('0xb0')])){var _0x884100=this[_0xf1ef('0x11')]['sync'](this,_0x359956['variable_id']);if(_0x884100){this[_0xf1ef('0xd')][_0xf1ef('0x81')](_0x884100,_0x593ff3);return this['channel']['noop'](util[_0xf1ef('0x2a')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x359956[_0xf1ef('0x86')],_0x884100));}}return this[_0xf1ef('0xd')]['noop'](util['format'](_0xf1ef('0x181'),_0x359956[_0xf1ef('0x86')]));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x182')]=function(_0x2d5206){logger[_0xf1ef('0x2f')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2d5206['label']));if(!this[_0xf1ef('0x82')](_0x2d5206[_0xf1ef('0x62')])){return this[_0xf1ef('0xd')][_0xf1ef('0x90')](_0xf1ef('0x99'));}this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x183'),_0x2d5206['text']));var _0x51913c=this[_0xf1ef('0x5e')][_0xf1ef('0x84')](this,_0x2d5206);if(_0x51913c){this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format'](_0xf1ef('0x184'),_0x51913c));var _0x30c448=this[_0xf1ef('0xd')][_0xf1ef('0xd1')](_0x51913c);try{fs[_0xf1ef('0x11e')](_0x51913c+_0xf1ef('0xd2'));}catch(_0x10ffbd){logger[_0xf1ef('0x2d')](_0x10ffbd);}return _0x30c448;}return this['channel'][_0xf1ef('0x2d')](_0x2d5206,_0xf1ef('0x185'));};AGIVertices['prototype'][_0xf1ef('0x186')]=function(_0x3196fc){logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x187'),_0x3196fc['label']));if(!this[_0xf1ef('0x82')](_0x3196fc['findBy'])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x3196fc,'no\x20find\x20by\x20configured');}logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x129'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x3196fc[_0xf1ef('0x122')]));var _0x3242c3=this[_0xf1ef('0x54')]['sync'](this,_0x3196fc[_0xf1ef('0x122')]);if(_0x3242c3){logger[_0xf1ef('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x3196fc[_0xf1ef('0x122')]));this[_0xf1ef('0xd')][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x124'),this[_0xf1ef('0xd')][_0xf1ef('0x3c')],_0x3196fc['findBy']));return{'code':0xc8,'result':_0xf1ef('0x139')};}else{logger[_0xf1ef('0x2f')](util[_0xf1ef('0x2a')](_0xf1ef('0x125'),this[_0xf1ef('0xd')]['callerid'],_0x3196fc[_0xf1ef('0x122')]));this[_0xf1ef('0xd')][_0xf1ef('0x90')](util['format'](_0xf1ef('0x125'),this['channel'][_0xf1ef('0x3c')],_0x3196fc[_0xf1ef('0x122')]));return{'code':0xc8,'result':_0xf1ef('0x126')};}};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x188')]=function(_0x367fda){logger[_0xf1ef('0x2f')](util['format'](_0xf1ef('0x189'),_0x367fda['label']));var _0xd65b4d=this[_0xf1ef('0xd')][_0xf1ef('0x5b')](_0xf1ef('0x18a'),[_0x367fda[_0xf1ef('0x18b')],_0x367fda[_0xf1ef('0x93')]]);if(_0xd65b4d[_0xf1ef('0x7f')]===-0x1){return _0xd65b4d;}return this['channel'][_0xf1ef('0x90')](util[_0xf1ef('0x2a')](_0xf1ef('0x94'),'VOICEMAIL',_0x367fda['mailbox']));};AGIVertices[_0xf1ef('0x10')][_0xf1ef('0x18c')]=function(_0x2b0be2){logger['info'](util['format'](_0xf1ef('0x18d'),_0x2b0be2['label']));if(!this[_0xf1ef('0x82')](_0x2b0be2[_0xf1ef('0xb0')])){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x2b0be2,_0xf1ef('0x18e'));}var _0x1cd62d=this[_0xf1ef('0x11')][_0xf1ef('0x84')](this,_0x2b0be2[_0xf1ef('0xb0')]);if(!_0x1cd62d){return this[_0xf1ef('0xd')][_0xf1ef('0x2d')](_0x2b0be2,_0xf1ef('0xb1'));}var _0x3536f3=this['channel']['getVariable'](_0x1cd62d);return{'code':0xc8,'result':_0x3536f3[_0xf1ef('0x7e')]?_0x3536f3[_0xf1ef('0x7e')]:'-'};};String['prototype']['replaceAll']=function(_0x3a9aef,_0x1d5b31){return this['split'](_0x3a9aef)[_0xf1ef('0x18f')](_0x1d5b31);};module['exports']=AGIVertices; \ No newline at end of file +var _0x6a21=['Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','vswitch','no\x20variable\x20selected','join','exports','path','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','calleridname','context','extension','priority','accountcode','createSquareMessage','createCmContact','random','lastName','phone','list_id','scheduledAt','callback','toString','getPause','getPauseById','agentPause','agent','callerid','isNil','error','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','clone','hasOwnProperty','replaceAllVariables','split','length','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','timeout','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','callback_priority','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','Executed\x20command\x20%s\x20%s','lumenvoxtts','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','sync','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','url','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','stringify','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s.%s','beep','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','isArray','%s[%s]','variable\x20%s[key]\x20set','file_id','getData','digit','isEmpty','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','PLAYBACK','queue','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','wav','%s_%s','%s/recordings/%s.%s','%s/recordings/%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Answer','Skipped\x20Answer','subproject'];(function(_0x3200df,_0x30b37f){var _0x2c13df=function(_0x4ddc0f){while(--_0x4ddc0f){_0x3200df['push'](_0x3200df['shift']());}};_0x2c13df(++_0x30b37f);}(_0x6a21,0x1ad));var _0x16a2=function(_0x5774c9,_0x2eb901){_0x5774c9=_0x5774c9-0x0;var _0x483a97=_0x6a21[_0x5774c9];return _0x483a97;};'use strict';var fs=require('fs');var path=require(_0x16a2('0x0'));var util=require('util');var _=require('lodash');var sh=require(_0x16a2('0x1'));var odbc=require(_0x16a2('0x2'))();var rs=require(_0x16a2('0x3'));var moment=require(_0x16a2('0x4'));var Mustache=require(_0x16a2('0x5'));var logger=require(_0x16a2('0x6'))(_0x16a2('0x7'));var config=require(_0x16a2('0x8'));var scripts=require(_0x16a2('0x9'));var FILES_PATH=_0x16a2('0xa');var verticesWithRetry=['menu',_0x16a2('0xb'),_0x16a2('0xc')];var AGIVertices=function(_0x343fd9,_0x15d2d5,_0xcd2771){this[_0x16a2('0xd')]=_0x343fd9;this[_0x16a2('0xe')]=_0x15d2d5;this[_0x16a2('0xf')]=_0xcd2771;};AGIVertices[_0x16a2('0x10')]['getVariable']=function(_0x583ff5,_0x447796){this[_0x16a2('0xe')][_0x16a2('0x11')](_0x583ff5)[_0x16a2('0x12')](function(_0x3839fe){_0x447796(null,_0x3839fe?_0x3839fe[_0x16a2('0x13')]:![]);})[_0x16a2('0x14')](function(_0x3051ec){_0x447796(_0x3051ec);});};AGIVertices[_0x16a2('0x10')]['getVoiceQueue']=function(_0x5b122c,_0x1f0974){this[_0x16a2('0xe')][_0x16a2('0x15')](_0x5b122c)[_0x16a2('0x12')](function(_0x44bdb0){_0x1f0974(null,_0x44bdb0?_0x44bdb0[_0x16a2('0x13')]:![]);})[_0x16a2('0x14')](function(_0x5d9b11){_0x1f0974(_0x5d9b11);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x16')]=function(_0x4d3574,_0x28e258){this[_0x16a2('0xe')][_0x16a2('0x17')](_0x4d3574)[_0x16a2('0x12')](function(_0x278cf3){_0x28e258(null,_0x278cf3?_0x278cf3[_0x16a2('0x13')]:![]);})['catch'](function(_0x2b0a4a){_0x28e258(_0x2b0a4a);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x18')]=function(_0x31c51d,_0x38fa2d){this['rpc'][_0x16a2('0x19')](_0x31c51d)['then'](function(_0x2d01bd){_0x38fa2d(null,_0x2d01bd?_0x2d01bd['dsn']:![]);})[_0x16a2('0x14')](function(_0x3b4673){_0x38fa2d(_0x3b4673);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x1a')]=function(_0x26a7d0,_0x2242ae){this[_0x16a2('0xe')][_0x16a2('0x1b')](_0x26a7d0)[_0x16a2('0x12')](function(_0xd28dd8){_0x2242ae(null,_0xd28dd8?_0xd28dd8[_0x16a2('0x13')]:![]);})[_0x16a2('0x14')](function(_0x373ca3){_0x2242ae(_0x373ca3);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x1c')]=function(_0xc03cd3,_0x3259ff){this[_0x16a2('0xe')][_0x16a2('0x1d')](_0xc03cd3)[_0x16a2('0x12')](function(_0x3405c2){_0x3259ff(null,_0x3405c2?_0x3405c2[_0x16a2('0x13')]:![]);})[_0x16a2('0x14')](function(_0x5a3bc8){_0x3259ff(_0x5a3bc8);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x1e')]=function(_0x548afa,_0x37c198){var _0x8d39a5=this;this[_0x16a2('0xe')][_0x16a2('0x1f')](_0x548afa)[_0x16a2('0x12')](function(_0x36ba3b){_0x37c198(null,_0x36ba3b?_0x8d39a5[_0x16a2('0x20')](_0x36ba3b[_0x16a2('0x21')]):![]);})[_0x16a2('0x14')](function(_0x3c2f66){_0x37c198(_0x3c2f66);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x22')]=function(_0xc0342e,_0x24803b){this[_0x16a2('0xe')][_0x16a2('0x23')](_0xc0342e)[_0x16a2('0x12')](function(_0x7802f){_0x24803b(null,_0x7802f?_0x7802f:![]);})[_0x16a2('0x14')](function(_0x7bbaa4){_0x24803b(_0x7bbaa4);});};AGIVertices[_0x16a2('0x10')]['sendMailMessage']=function(_0x3bbbab,_0x44afe5,_0x30740e){this[_0x16a2('0xf')][_0x16a2('0x24')](_0x3bbbab,_0x44afe5)[_0x16a2('0x12')](function(){_0x30740e(null);})[_0x16a2('0x14')](function(_0x45ea4e){_0x30740e(_0x45ea4e);});};AGIVertices['prototype'][_0x16a2('0x25')]=function(_0x275d25,_0x653648){this['rpc'][_0x16a2('0x26')](_0x275d25)[_0x16a2('0x12')](function(_0x28ac97){if(_0x28ac97){if(_0x28ac97[_0x16a2('0x27')]){_0x653648(null,[_0x28ac97['interval']]);}else{_0x653648(null,_[_0x16a2('0x28')](_0x28ac97[_0x16a2('0x29')],_0x16a2('0x2a')));}}else{_0x653648(null,![]);}})['catch'](function(_0xbbb05e){_0x653648(_0xbbb05e);});};AGIVertices['prototype'][_0x16a2('0x20')]=function(_0x870359){return util[_0x16a2('0x2b')](_0x16a2('0x2c'),FILES_PATH,_0x870359);};AGIVertices[_0x16a2('0x10')][_0x16a2('0x2d')]=function(_0x20df6e,_0x419ea7,_0x510dff){odbc[_0x16a2('0x2e')](_0x20df6e,function(_0x41c747){if(_0x41c747){logger['error'](_0x16a2('0x2f'),_0x41c747);_0x510dff(_0x41c747);}else{logger[_0x16a2('0x30')](_0x16a2('0x31'));odbc[_0x16a2('0x32')](_0x419ea7,function(_0x284222,_0x5a2796){if(_0x284222){logger[_0x16a2('0x30')]('Error\x20executing\x20query\x20%s',_0x419ea7);_0x510dff(_0x284222);}else{logger[_0x16a2('0x30')](_0x16a2('0x33'),_0x419ea7);odbc[_0x16a2('0x34')](function(_0x211392){if(_0x211392){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x211392);}_0x510dff(null,_0x5a2796);});}});}});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x35')]=function(_0x55bdd7,_0x148243){this[_0x16a2('0xe')][_0x16a2('0x36')](_0x55bdd7)['then'](function(_0x31a29d){_0x148243(null,_0x31a29d?_0x31a29d:![]);})[_0x16a2('0x14')](function(_0x3c2bd0){_0x148243(_0x3c2bd0);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x37')]=function(_0x467ddf,_0xec0d81){this[_0x16a2('0xe')][_0x16a2('0x37')](_0x467ddf)[_0x16a2('0x12')](function(_0x45087c){_0xec0d81(null,_0x45087c);})[_0x16a2('0x14')](function(_0x4664e0){_0xec0d81(_0x4664e0);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x38')]=function(_0x58054a,_0x3c9a51,_0x38ff55){this[_0x16a2('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x16a2('0xd')][_0x16a2('0x39')],'node':_0x58054a[_0x16a2('0x3a')],'application':_0x58054a[_0x16a2('0x3b')],'data':_0x3c9a51||null,'project_name':this['channel'][_0x16a2('0x3c')],'callerid':this['channel']['callerid']})[_0x16a2('0x12')](function(_0x5d8c74){if(_0x38ff55){_0x38ff55(null,_0x5d8c74);}})['catch'](function(_0x308721){if(_0x38ff55){_0x38ff55(_0x308721);}});};AGIVertices[_0x16a2('0x10')]['createSquareRecording']=function(_0x558a49,_0x48cb81,_0x1fadb0,_0x275a6e){this[_0x16a2('0xe')][_0x16a2('0x3d')]({'uniqueid':this['channel'][_0x16a2('0x39')],'callerid':this[_0x16a2('0xd')]['callerid'],'calleridname':this['channel'][_0x16a2('0x3e')],'context':this['channel'][_0x16a2('0x3f')],'extension':this[_0x16a2('0xd')][_0x16a2('0x40')],'priority':this[_0x16a2('0xd')][_0x16a2('0x41')],'accountcode':this[_0x16a2('0xd')][_0x16a2('0x42')],'dnid':this['channel']['dnid'],'projectName':this[_0x16a2('0xd')][_0x16a2('0x3c')],'saveName':_0x48cb81,'filename':_0x558a49['file']||_0x48cb81,'savePath':_0x1fadb0})[_0x16a2('0x12')](function(_0x8bf437){_0x275a6e(null,_0x8bf437);})[_0x16a2('0x14')](function(_0x2dfe0b){_0x275a6e(_0x2dfe0b);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x43')]=function(_0x5dee1e,_0x4fffda,_0xaceae5){this[_0x16a2('0xe')][_0x16a2('0x43')]({'uniqueid':this[_0x16a2('0xd')]['uniqueid'],'body':_0x5dee1e,'direction':_0x4fffda})[_0x16a2('0x12')](function(_0x10caa4){if(_0xaceae5){_0xaceae5(null,_0x10caa4);}})[_0x16a2('0x14')](function(_0x326f28){if(_0xaceae5){_0xaceae5(_0x326f28);}});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x44')]=function(_0x412300,_0x9323b0){this[_0x16a2('0xe')][_0x16a2('0x44')]({'firstName':_['isEmpty'](_0x412300[_0x16a2('0x13')])||_['isNil'](_0x412300[_0x16a2('0x13')])?'callback_'+Math[_0x16a2('0x45')]():_0x412300[_0x16a2('0x13')],'lastName':_['isEmpty'](_0x412300[_0x16a2('0x46')])||_['isNil'](_0x412300[_0x16a2('0x46')])?null:_0x412300[_0x16a2('0x46')],'phone':_0x412300[_0x16a2('0x47')],'ListId':_0x412300[_0x16a2('0x48')],'scheduledAt':_0x412300[_0x16a2('0x49')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x16a2('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x412300[_0x16a2('0x49')][_0x16a2('0x4b')](),'priority':_0x412300['callback_priority']})['then'](function(_0x12cd8f){_0x9323b0(null,_0x12cd8f);})[_0x16a2('0x14')](function(_0x175729){_0x9323b0(_0x175729);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x4c')]=function(_0xfd9b3,_0xa3c896){this[_0x16a2('0xe')][_0x16a2('0x4d')](_0xfd9b3)['then'](function(_0x4eaad0){_0xa3c896(null,_0x4eaad0?_0x4eaad0[_0x16a2('0x13')]:![]);})[_0x16a2('0x14')](function(_0x105db6){_0xa3c896(_0x105db6);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x4e')]=function(_0x1dac68,_0x40d15d,_0x21893b){var _0x2bf973={'role':_0x16a2('0x4f')};_0x2bf973[_0x1dac68]=this[_0x16a2('0xd')][_0x16a2('0x50')];this['rpc'][_0x16a2('0x4e')](_0x2bf973,_0x40d15d,this[_0x16a2('0xd')][_0x16a2('0x39')])['then'](function(_0x4d315d){_0x21893b(null,_[_0x16a2('0x51')](_0x4d315d)?![]:!![]);})['catch'](function(_0x1b8d6c){logger[_0x16a2('0x52')](_0x1b8d6c);_0x21893b(null,![]);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x53')]=function(_0x51bea7,_0x5e4065){var _0x391faf={'role':_0x16a2('0x4f')};_0x391faf[_0x51bea7]=this[_0x16a2('0xd')]['callerid'];this[_0x16a2('0xe')][_0x16a2('0x53')](_0x391faf)[_0x16a2('0x12')](function(_0x1b8305){_0x5e4065(null,_[_0x16a2('0x51')](_0x1b8305)?![]:!![]);})['catch'](function(_0x98da0f){logger[_0x16a2('0x52')](_0x98da0f);_0x5e4065(null,![]);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x54')]=function(_0x4776bf,_0x2014f6){var _0x3223ab={'role':_0x16a2('0x4f')};_0x3223ab[_0x4776bf]=this['channel'][_0x16a2('0x50')];this['rpc'][_0x16a2('0x54')](_0x3223ab)['then'](function(_0x462ea1){_0x2014f6(null,_['isNil'](_0x462ea1)?![]:!![]);})[_0x16a2('0x14')](function(_0xfa1bcb){logger[_0x16a2('0x52')](_0xfa1bcb);_0x2014f6(null,![]);});};AGIVertices['prototype'][_0x16a2('0x55')]=function(_0x7d701b,_0x36822b){var _0x495018={'role':_0x16a2('0x4f')};_0x495018[_0x7d701b]=this[_0x16a2('0xd')][_0x16a2('0x50')];var _0x1826c4=_0x7d701b!=_0x16a2('0x56')?util[_0x16a2('0x2b')](_0x16a2('0x57'),_0x16a2('0x58'),this[_0x16a2('0xd')][_0x16a2('0x50')]):undefined;this['rpc'][_0x16a2('0x55')](_0x495018,_0x1826c4)[_0x16a2('0x12')](function(_0x462f7f){_0x36822b(null,_[_0x16a2('0x51')](_0x462f7f)?![]:!![]);})[_0x16a2('0x14')](function(_0x3e0d14){logger[_0x16a2('0x52')](_0x3e0d14);_0x36822b(null,![]);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x59')]=function(_0x167605,_0x15978c){sh[_0x16a2('0x5a')](_[_0x16a2('0x5b')](_0x167605),function(_0x2b9e99,_0x2b7d44){var _0xefdc8e=_0x2b7d44[_0x16a2('0x5c')](/(\r\n|\n|\r)/gm,'');_0x15978c(null,_0xefdc8e);});};AGIVertices['prototype']['googleTTS']=function(_0xbdbc95,_0x2f84b5){scripts[_0x16a2('0x5d')](_0xbdbc95[_0x16a2('0x5e')],_0xbdbc95[_0x16a2('0x5f')]||'en',0x1)[_0x16a2('0x12')](function(_0x4ebd69){_0x2f84b5(null,_0x4ebd69);})[_0x16a2('0x14')](function(_0x485319){_0x2f84b5(_0x485319);});};AGIVertices['prototype'][_0x16a2('0x60')]=function(_0x255c72,_0x3c0c86){scripts[_0x16a2('0x60')](this[_0x16a2('0xd')][_0x16a2('0x39')],_0x255c72[_0x16a2('0x61')],_0x255c72[_0x16a2('0x5e')],_0x255c72[_0x16a2('0x62')]||'en')[_0x16a2('0x12')](function(_0xdd9404){_0x3c0c86(null,_0xdd9404);})[_0x16a2('0x14')](function(_0x402c90){_0x3c0c86(_0x402c90);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x63')]=function(_0x1d5c6f,_0xc381a8){scripts[_0x16a2('0x63')](this['channel'],_0x1d5c6f)[_0x16a2('0x12')](function(_0x1d448d){_0xc381a8(null,_0x1d448d);})[_0x16a2('0x14')](function(_0x2df65d){_0xc381a8(_0x2df65d);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x64')]=function(_0x3a19e1,_0x512496){scripts[_0x16a2('0x64')](_0x3a19e1[_0x16a2('0x61')],_0x3a19e1[_0x16a2('0x5e')],_0x3a19e1[_0x16a2('0x65')]||_0x16a2('0x66'),_0x3a19e1[_0x16a2('0x67')])[_0x16a2('0x12')](function(_0x657b74){_0x512496(null,_0x657b74);})[_0x16a2('0x14')](function(_0xf798b0){_0x512496(_0xf798b0);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x68')]=function(_0xb3520a,_0xb97a94,_0x35f7f9){scripts[_0x16a2('0x68')](_0xb97a94,_0xb3520a[_0x16a2('0x61')],_0xb3520a[_0x16a2('0x69')]||'en-US',this[_0x16a2('0x6a')](_0xb3520a['model'])?_0xb3520a[_0x16a2('0x6b')]:undefined)[_0x16a2('0x12')](function(_0x5dd009){_0x35f7f9(null,_0x5dd009);})[_0x16a2('0x14')](function(_0x40ba7e){_0x35f7f9(_0x40ba7e);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x6c')]=function(_0xf9d6a4,_0x5d700d){scripts['awsPolly'](_0xf9d6a4[_0x16a2('0x6d')],_0xf9d6a4[_0x16a2('0x6e')],_0xf9d6a4['aws_polly_region'],_0xf9d6a4[_0x16a2('0x6f')]||_0x16a2('0x70'),_0xf9d6a4[_0x16a2('0x5e')],_0xf9d6a4[_0x16a2('0x71')]||_0x16a2('0x5e'))[_0x16a2('0x12')](function(_0x5b77c2){_0x5d700d(null,_0x5b77c2);})[_0x16a2('0x14')](function(_0x53d456){_0x5d700d(_0x53d456);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x72')]=function(_0x3eb1e5,_0x3433ad){scripts[_0x16a2('0x72')](this[_0x16a2('0xd')][_0x16a2('0x39')],_0x3eb1e5[_0x16a2('0x6d')],_0x3eb1e5[_0x16a2('0x6e')],_0x3eb1e5[_0x16a2('0x73')],_0x3eb1e5[_0x16a2('0x5e')],_0x3eb1e5['aws_bot_name'])[_0x16a2('0x12')](function(_0x276c23){_0x3433ad(null,_0x276c23);})[_0x16a2('0x14')](function(_0x3a4477){_0x3433ad(_0x3a4477);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x74')]=function(_0x6a4065,_0x49913,_0x3acbc8){scripts[_0x16a2('0x74')](_0x49913,_0x6a4065[_0x16a2('0x61')],_0x6a4065[_0x16a2('0x75')]||_0x16a2('0x66'))[_0x16a2('0x12')](function(_0x464169){_0x3acbc8(null,_0x464169);})[_0x16a2('0x14')](function(_0x661f1c){_0x3acbc8(_0x661f1c);});};AGIVertices[_0x16a2('0x10')]['tildeASR']=function(_0x2292f,_0x25a165,_0xa5a890){scripts[_0x16a2('0x76')](_0x25a165,_0x2292f[_0x16a2('0x77')],_0x2292f[_0x16a2('0x78')],_0x2292f[_0x16a2('0x79')])[_0x16a2('0x12')](function(_0x18fdab){_0xa5a890(null,_0x18fdab);})[_0x16a2('0x14')](function(_0x2aeb3c){_0xa5a890(_0x2aeb3c);});};AGIVertices[_0x16a2('0x10')][_0x16a2('0x7a')]=function(_0x5c7815){var _0x5092d2=_[_0x16a2('0x7b')](verticesWithRetry,_0x5c7815[_0x16a2('0x3b')])?_0x5c7815:_[_0x16a2('0x7c')](_0x5c7815);for(var _0x3758a2 in _0x5092d2){if(_0x5092d2[_0x16a2('0x7d')](_0x3758a2)){if(_0x5092d2[_0x3758a2]&&_['isString'](_0x5092d2[_0x3758a2])){_0x5092d2[_0x3758a2]=this[_0x16a2('0x7e')](_0x5092d2[_0x3758a2]);}}}return _0x5092d2;};AGIVertices[_0x16a2('0x10')]['replaceAllVariables']=function(_0x580adb){var _0x4cb708=_0x580adb[_0x16a2('0x7f')]('{');for(var _0x3f73c1=0x1;_0x3f73c1<_0x4cb708[_0x16a2('0x80')];_0x3f73c1+=0x1){var _0x12bf7d=_0x4cb708[_0x3f73c1][_0x16a2('0x7f')]('}');if(_0x12bf7d[_0x16a2('0x80')]>0x1){_0x580adb=_0x580adb[_0x16a2('0x81')]('{'+_0x12bf7d[0x0]+'}',this['channel'][_0x16a2('0x82')](_0x12bf7d[0x0])[_0x16a2('0x83')]||_0x12bf7d[0x0]);}}if(_0x4cb708[_0x16a2('0x80')]===0x1){return _0x580adb[_0x16a2('0x4b')]();}return this[_0x16a2('0x7e')](_0x580adb);};AGIVertices['prototype'][_0x16a2('0x84')]=function(_0x2f3daf,_0x54b9b4){var _0x585814=this['channel'][_0x16a2('0x82')](_0x2f3daf);if(_0x585814[_0x16a2('0x85')]===-0x1){return _0x585814;}logger['info'](util[_0x16a2('0x2b')](_0x16a2('0x86'),_0x54b9b4,_0x585814['extra']));return this['channel']['setVariable'](_0x54b9b4,_0x585814['extra']);};AGIVertices[_0x16a2('0x10')][_0x16a2('0x6a')]=function(_0x33a090){return _0x33a090&&_0x33a090!=='0'&&_0x33a090!=='-1'&&_0x33a090!=='';};AGIVertices['prototype'][_0x16a2('0x87')]=function(_0x2c9678){this[_0x16a2('0x38')]['sync'](this,_0x2c9678,'-');_0x2c9678[_0x16a2('0x88')]=_0x2c9678[_0x16a2('0x87')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x16a2('0x7')]=function(_0x1249c0){logger['info'](util['format'](_0x16a2('0x89'),_0x1249c0['label']));return this['channel']['agi']([_0x1249c0[_0x16a2('0x8a')],_0x1249c0[_0x16a2('0x8b')]]);};AGIVertices['prototype'][_0x16a2('0x8c')]=function(_0x5483d9){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x5483d9[_0x16a2('0x3a')]));if(this[_0x16a2('0x6a')](_0x5483d9['timeout'])){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x8d'),_0x5483d9[_0x16a2('0x8e')]));var _0x5a577f=this[_0x16a2('0xd')][_0x16a2('0x8f')](_0x5483d9[_0x16a2('0x8e')]);if(_0x5a577f[_0x16a2('0x85')]===-0x1){return _0x5a577f;}}return this[_0x16a2('0xd')][_0x16a2('0x8c')]();};AGIVertices[_0x16a2('0x10')][_0x16a2('0x4a')]=function(_0x1f2d18){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x90'),_0x1f2d18['label']));if(!this[_0x16a2('0x6a')](_0x1f2d18['list_id'])){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x1f2d18,_0x16a2('0x91'));}_0x1f2d18['scheduledAt']=moment();if(this[_0x16a2('0x6a')](_0x1f2d18[_0x16a2('0x92')])){_0x1f2d18[_0x16a2('0x49')]=moment()[_0x16a2('0x93')](_0x1f2d18['delay'],_0x16a2('0x94'));}if(!this[_0x16a2('0x6a')](_0x1f2d18[_0x16a2('0x95')])){_0x1f2d18[_0x16a2('0x95')]=0x2;}this[_0x16a2('0x44')]['sync'](this,_0x1f2d18);return this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x97'),_0x1f2d18[_0x16a2('0x47')],_0x1f2d18[_0x16a2('0x48')],_0x1f2d18['scheduledAt']));};AGIVertices[_0x16a2('0x10')][_0x16a2('0x98')]=function(_0x355e94){logger['info'](util['format'](_0x16a2('0x99'),_0x355e94[_0x16a2('0x3a')]));var _0xdc897=this['channel'][_0x16a2('0x5a')](_0x355e94[_0x16a2('0x9a')],_0x355e94[_0x16a2('0x9b')]);if(_0xdc897['result']===-0x1){return _0xdc897;}return this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x9c'),_0x355e94['application'],_0x355e94[_0x16a2('0x9b')]));};AGIVertices[_0x16a2('0x10')][_0x16a2('0x9d')]=function(_0x4617b1){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x4617b1[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x4617b1[_0x16a2('0x5e')])){return this[_0x16a2('0xd')]['noop'](_0x16a2('0x9e'));}var _0x28a1ee='\x22'+_0x4617b1[_0x16a2('0x5e')]+'\x22';if(this['isConfigured'](_0x4617b1[_0x16a2('0x9b')])){_0x28a1ee+=','+_0x4617b1[_0x16a2('0x9b')];}var _0x371156=this[_0x16a2('0xd')][_0x16a2('0x5a')](_0x16a2('0x9f'),_0x28a1ee);if(_0x371156[_0x16a2('0x85')]===-0x1){return _0x371156;}return this['channel'][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0xa0'),_0x28a1ee));};AGIVertices[_0x16a2('0x10')]['sestektts']=function(_0x867971){logger['info'](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x867971['label']));if(!this[_0x16a2('0x6a')](_0x867971[_0x16a2('0x5e')])){return this['channel']['noop'](_0x16a2('0x9e'));}var _0x508170='\x22'+_0x867971['text']+'\x22';if(this[_0x16a2('0x6a')](_0x867971[_0x16a2('0x9b')])){_0x508170+=','+_0x867971[_0x16a2('0x9b')];}var _0x1304f9=this[_0x16a2('0xd')][_0x16a2('0x5a')](_0x16a2('0x9f'),_0x508170);if(_0x1304f9['result']===-0x1){return _0x1304f9;}return this[_0x16a2('0xd')]['noop'](util[_0x16a2('0x2b')](_0x16a2('0xa0'),_0x508170));};AGIVertices[_0x16a2('0x10')][_0x16a2('0xa1')]=function(_0x3ccfef){logger['info'](util['format'](_0x16a2('0xa2'),_0x3ccfef[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x3ccfef[_0x16a2('0xa3')])){return this[_0x16a2('0xd')][_0x16a2('0x96')](_0x16a2('0xa4'));}var _0x93bb02=_0x3ccfef['grammar'];if(this[_0x16a2('0x6a')](_0x3ccfef[_0x16a2('0x9b')])){_0x93bb02+=','+_0x3ccfef[_0x16a2('0x9b')];}var _0x5b2181=this[_0x16a2('0xd')][_0x16a2('0x5a')]('MRCPRecog',_0x93bb02);if(_0x5b2181[_0x16a2('0x85')]===-0x1){return _0x5b2181;}var _0x21fe90=this['getAndSetVariable'](_0x16a2('0xa5'),_0x16a2('0xa6'));if(_0x21fe90[_0x16a2('0x85')]===-0x1){return _0x21fe90;}var _0x2d3eb5=this[_0x16a2('0x84')]('RECOG_INPUT()',_0x16a2('0xa7'));if(_0x2d3eb5[_0x16a2('0x85')]===-0x1){return _0x2d3eb5;}var _0x2a608f=this[_0x16a2('0x84')](_0x16a2('0xa8'),'LUMENVOX_ASR_INSTANCE');if(_0x2a608f[_0x16a2('0x85')]===-0x1){return _0x2a608f;}return this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0xa9'),_0x93bb02));};AGIVertices['prototype'][_0x16a2('0xaa')]=function(_0x213cf7){logger['info'](util[_0x16a2('0x2b')](_0x16a2('0xab'),_0x213cf7[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x213cf7['grammar'])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x226ab1=_0x213cf7[_0x16a2('0xa3')];if(this[_0x16a2('0x6a')](_0x213cf7[_0x16a2('0x9b')])){_0x226ab1+=','+_0x213cf7[_0x16a2('0x9b')];}var _0x48283d=this['channel']['exec'](_0x16a2('0xac'),_0x226ab1);if(_0x48283d['result']===-0x1){return _0x48283d;}var _0x3a243f=this[_0x16a2('0x84')](_0x16a2('0xa5'),_0x16a2('0xad'));if(_0x3a243f['result']===-0x1){return _0x3a243f;}var _0x4aadd3=this[_0x16a2('0x84')](_0x16a2('0xae'),_0x16a2('0xaf'));if(_0x4aadd3[_0x16a2('0x85')]===-0x1){return _0x4aadd3;}var _0xf35e57=this[_0x16a2('0x84')](_0x16a2('0xa8'),_0x16a2('0xb0'));if(_0xf35e57['result']===-0x1){return _0xf35e57;}return this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x226ab1));};AGIVertices[_0x16a2('0x10')][_0x16a2('0xb1')]=function(_0x540a58){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0xb2'),_0x540a58[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x540a58['odbc_id'])){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x540a58,_0x16a2('0xb3'));}var _0x68ffa4=this[_0x16a2('0x18')][_0x16a2('0xb4')](this,_0x540a58[_0x16a2('0xb5')]);if(!_0x68ffa4){return this['channel'][_0x16a2('0x52')](_0x540a58,_0x16a2('0xb6'));}if(!this[_0x16a2('0x6a')](_0x540a58[_0x16a2('0x32')])){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x540a58,_0x16a2('0xb7'));}var _0xd49f37=_0x540a58['query'][_0x16a2('0x5c')](/(\r\n|\n|\r)/gm,'\x20');this[_0x16a2('0xd')][_0x16a2('0x96')](util['format']('query:\x20%s',_0xd49f37));var _0x2d0178=this[_0x16a2('0x2d')][_0x16a2('0xb4')](this,_0x68ffa4,_0xd49f37);this[_0x16a2('0x38')][_0x16a2('0xb4')](this,_0x540a58,_0xd49f37);if(!this[_0x16a2('0x6a')](_0x540a58['variable_id'])){return this['channel'][_0x16a2('0x96')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x382620=this[_0x16a2('0x82')][_0x16a2('0xb4')](this,_0x540a58[_0x16a2('0xb8')]);if(!_0x382620){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x540a58,_0x16a2('0xb9'));}var _0x1fafb6=this;_0x2d0178[_0x16a2('0xba')](function(_0x45b0a0,_0xf5e247){Object[_0x16a2('0xbb')](_0x45b0a0)['forEach'](function(_0x53ea8b){_0x1fafb6[_0x16a2('0xd')][_0x16a2('0xbc')](util['format'](_0x16a2('0xbd'),_0x382620,_0xf5e247,_0x53ea8b),_0x45b0a0[_0x53ea8b]);});});this['channel'][_0x16a2('0xbc')](util[_0x16a2('0x2b')](_0x16a2('0xbe'),_0x382620),_0x2d0178[_0x16a2('0x80')]);return this[_0x16a2('0xd')]['noop'](util['format']('variable\x20%s\x20set',_0x382620));};AGIVertices[_0x16a2('0x10')][_0x16a2('0xbf')]=function(_0x559855){logger[_0x16a2('0xc0')](util['format'](_0x16a2('0xc1'),_0x559855['label']));if(!this[_0x16a2('0x6a')](_0x559855[_0x16a2('0xc2')])){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x559855,'no\x20user\x20selected');}var _0x19a938=this[_0x16a2('0x1a')][_0x16a2('0xb4')](this,_0x559855[_0x16a2('0xc2')]);if(!_0x19a938){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x559855,_0x16a2('0xc3'));}var _0x2d500c=this['channel'][_0x16a2('0x5a')](_0x16a2('0xc4'),[util['format'](_0x16a2('0xc5'),_0x19a938),_0x559855[_0x16a2('0x8e')],_0x559855[_0x16a2('0xc6')],_0x559855[_0x16a2('0xc7')]]);if(_0x2d500c[_0x16a2('0x85')]===-0x1){return _0x2d500c;}return this['channel'][_0x16a2('0x96')](util['format'](_0x16a2('0xc8'),_0x16a2('0xc4')));};AGIVertices[_0x16a2('0x10')][_0x16a2('0xc9')]=function(_0x9463a4){logger['info'](util[_0x16a2('0x2b')](_0x16a2('0xca'),_0x9463a4['label']));if(!this[_0x16a2('0x6a')](_0x9463a4['key'])){return this['channel'][_0x16a2('0x96')]('no\x20key\x20configured');}if(!this[_0x16a2('0x6a')](_0x9463a4[_0x16a2('0x5e')])){return this[_0x16a2('0xd')]['noop'](_0x16a2('0x9e'));}this[_0x16a2('0xd')][_0x16a2('0xcb')]=!![];this[_0x16a2('0x38')](_0x9463a4);this['createSquareMessage'](_0x9463a4[_0x16a2('0x5e')],'in');this[_0x16a2('0xd')][_0x16a2('0x96')](util['format'](_0x16a2('0xcc'),_0x9463a4[_0x16a2('0x5e')]));var _0x727543=this['googleDialogflow'][_0x16a2('0xb4')](this,_0x9463a4);if(_0x727543){for(var _0x219a0d in _0x727543){if(_0x727543[_0x16a2('0x7d')](_0x219a0d)){this[_0x16a2('0xd')][_0x16a2('0xbc')](util['format'](_0x16a2('0xcd'),_0x219a0d[_0x16a2('0xce')]()),_0x727543[_0x219a0d]);}}this[_0x16a2('0x43')](_0x727543[_0x16a2('0xcf')],_0x16a2('0xd0'));return this[_0x16a2('0xd')]['noop'](util['format'](_0x16a2('0xd1'),_0x727543['speech']));}return this[_0x16a2('0xd')]['error'](_0x9463a4,_0x16a2('0xd2'));};AGIVertices[_0x16a2('0x10')][_0x16a2('0xd3')]=function(_0x1c8911){logger['info'](util[_0x16a2('0x2b')](_0x16a2('0xd4'),_0x1c8911[_0x16a2('0x3a')]));if(!this['isConfigured'](_0x1c8911[_0x16a2('0xd5')])){return this[_0x16a2('0xd')][_0x16a2('0x96')](_0x16a2('0xd6'));}if(!this[_0x16a2('0x6a')](_0x1c8911['username'])){return this['channel'][_0x16a2('0x96')]('no\x20username\x20configured');}if(!this[_0x16a2('0x6a')](_0x1c8911[_0x16a2('0xd7')])){return this[_0x16a2('0xd')][_0x16a2('0x96')](_0x16a2('0xd8'));}if(!this['isConfigured'](_0x1c8911[_0x16a2('0xd9')])){return this[_0x16a2('0xd')][_0x16a2('0x96')](_0x16a2('0x9e'));}this[_0x16a2('0xd')][_0x16a2('0xcb')]=!![];this[_0x16a2('0x38')](_0x1c8911);this[_0x16a2('0x43')](_0x1c8911[_0x16a2('0x5e')],'in');this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0xda'),_0x1c8911[_0x16a2('0x5e')]));var _0x5eaed1=this['sestekNDA'][_0x16a2('0xb4')](this,_0x1c8911);if(_0x5eaed1){for(var _0x583918 in _0x5eaed1){if(_0x5eaed1[_0x16a2('0x7d')](_0x583918)){this['channel'][_0x16a2('0xbc')](util['format'](_0x16a2('0xdb'),_0x583918['toUpperCase']()),_0x5eaed1[_0x583918]);}}this[_0x16a2('0x43')](_0x5eaed1[_0x16a2('0xcf')],_0x16a2('0xd0'));if(_0x5eaed1[_0x16a2('0xdc')]){this[_0x16a2('0xd')][_0x16a2('0x96')](util['format'](_0x16a2('0xdd'),_0x5eaed1[_0x16a2('0xdc')]));var _0x529f69=this[_0x16a2('0xd')][_0x16a2('0xde')](_0x5eaed1[_0x16a2('0xdc')]);try{fs[_0x16a2('0xdf')](_0x5eaed1[_0x16a2('0xdc')]+_0x16a2('0xe0'));}catch(_0x2d888b){logger[_0x16a2('0x52')](_0x2d888b);}return _0x529f69;}else{return this[_0x16a2('0xd')]['noop'](util[_0x16a2('0x2b')](_0x16a2('0xe1'),_0x5eaed1['speech']));}}return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x1c8911,_0x16a2('0xe2'));};AGIVertices[_0x16a2('0x10')][_0x16a2('0xe3')]=function(_0x40c424){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')]('Enter\x20in\x20END\x20(%s)\x20block',_0x40c424[_0x16a2('0x3a')]));return this['channel'][_0x16a2('0x96')]('end');};AGIVertices[_0x16a2('0x10')][_0x16a2('0xe4')]=function(_0x4d6e00){logger['info'](util['format'](_0x16a2('0xe5'),_0x4d6e00[_0x16a2('0x3a')]));var _0x1cd146='';if(_0x4d6e00[_0x16a2('0xe6')]){if(!this[_0x16a2('0x6a')](_0x4d6e00[_0x16a2('0xe6')])){return this['channel'][_0x16a2('0x52')](_0x4d6e00,'no\x20trunk\x20selected');}else{var _0xa9ef9a=parseInt(_0x4d6e00[_0x16a2('0xe6')],0xa);if(isNaN(_0xa9ef9a)){_0x1cd146=_0x4d6e00[_0x16a2('0xe6')];}else{_0x1cd146=this['getTrunk'][_0x16a2('0xb4')](this,_0x4d6e00[_0x16a2('0xe6')]);if(!_0x1cd146){return this['channel']['error'](_0x4d6e00,_0x16a2('0xe7'));}}}}else if(_0x4d6e00[_0x16a2('0xe8')]){_0x1cd146=_0x4d6e00[_0x16a2('0xe8')];}else{return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x4d6e00,_0x16a2('0xe9'));}var _0x525828=this['channel'][_0x16a2('0x5a')](_0x16a2('0xc4'),[util[_0x16a2('0x2b')]('SIP/%s/%s',_0x1cd146,_0x4d6e00[_0x16a2('0x47')]),_0x4d6e00[_0x16a2('0x8e')],_0x4d6e00[_0x16a2('0xc6')],_0x4d6e00[_0x16a2('0xc7')]]);if(_0x525828[_0x16a2('0x85')]===-0x1){return _0x525828;}return this[_0x16a2('0xd')][_0x16a2('0x96')](util['format'](_0x16a2('0xc8'),_0x16a2('0xc4')));};AGIVertices[_0x16a2('0x10')][_0x16a2('0xea')]=function(_0x4a29ff){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0xeb'),_0x4a29ff[_0x16a2('0x3a')]));return this['channel'][_0x16a2('0x96')](_0x16a2('0xea'));};AGIVertices[_0x16a2('0x10')]['getdigits']=function(_0x276154){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0xec'),_0x276154['label']));if(_0x276154[_0x16a2('0x88')]===0x0){return this['maxRetry'](_0x276154);}_0x276154[_0x16a2('0x88')]-=0x1;if(!this[_0x16a2('0x6a')](_0x276154['file_id'])){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x276154,_0x16a2('0xed'));}var _0x14937c=this['getSound'][_0x16a2('0xb4')](this,_0x276154['file_id']);if(!_0x14937c){return this['channel'][_0x16a2('0x52')](_0x276154,_0x16a2('0xee'));}if(!this[_0x16a2('0x6a')](_0x276154[_0x16a2('0xb8')])){return this[_0x16a2('0xd')][_0x16a2('0x52')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x58a81=this['channel']['getData'](_0x14937c,_0x276154[_0x16a2('0xef')],_0x276154[_0x16a2('0xf0')]);var _0x61fff3=_0x58a81[_0x16a2('0x85')]?_0x58a81[_0x16a2('0x85')][_0x16a2('0x4b')]():'';logger[_0x16a2('0x30')]('test',JSON[_0x16a2('0xf1')](_0x58a81));if(_0x58a81[_0x16a2('0x85')]===-0x1){this[_0x16a2('0x38')][_0x16a2('0xb4')](this,_0x276154,_0x61fff3);return _0x58a81;}else if(_0x58a81[_0x16a2('0x83')]===_0x16a2('0x8e')){_0x58a81[_0x16a2('0x85')]=_0x61fff3[_0x16a2('0x80')]>=parseInt(_0x276154[_0x16a2('0xf2')])?'x':'i';}else{_0x58a81[_0x16a2('0x85')]=_0x61fff3[_0x16a2('0x80')]>=parseInt(_0x276154[_0x16a2('0xf2')])&&_0x61fff3[_0x16a2('0x80')]<=parseInt(_0x276154[_0x16a2('0xf0')])?'x':'i';}var _0x50b3c2=this[_0x16a2('0x82')]['sync'](this,_0x276154[_0x16a2('0xb8')]);if(!_0x50b3c2){return this['channel'][_0x16a2('0x52')](_0x276154,_0x16a2('0xb9'));}this[_0x16a2('0xd')][_0x16a2('0xbc')](_0x50b3c2,_0x61fff3);if(this['isConfigured'](_0x276154[_0x16a2('0xf3')])){var _0x125914=parseInt(_0x276154[_0x16a2('0xf3')],0xa);var _0x41d743=rs[_0x16a2('0xf4')]({'charset':'*','length':_0x125914});var _0x37615e=_0x61fff3[_0x16a2('0x80')];if(_0x37615e>0x0){if(_0x37615e>_0x125914){this[_0x16a2('0x38')][_0x16a2('0xb4')](this,_0x276154,_0x276154['hiddendigitspos']===_0x16a2('0xf5')?_0x41d743+_0x61fff3['substr'](_0x125914):_0x61fff3[_0x16a2('0xf6')](0x0,_0x37615e-_0x125914)+_0x41d743);}else{this[_0x16a2('0x38')][_0x16a2('0xb4')](this,_0x276154,rs[_0x16a2('0xf4')]({'charset':'*','length':_0x37615e}));}}else{this[_0x16a2('0x38')][_0x16a2('0xb4')](this,_0x276154,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x276154,_0x61fff3);}return _0x58a81;};AGIVertices['prototype'][_0x16a2('0xc')]=function(_0x3c98e5){logger[_0x16a2('0x30')](util['format'](_0x16a2('0xf7'),_0x3c98e5[_0x16a2('0x3a')]));return this[_0x16a2('0xb')](_0x3c98e5);};AGIVertices[_0x16a2('0x10')][_0x16a2('0xf8')]=function(_0x11887f){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x11887f[_0x16a2('0x3a')]));this[_0x16a2('0x38')][_0x16a2('0xb4')](this,_0x11887f,_0x11887f['goalname']);return this['channel'][_0x16a2('0x96')](util['format'](_0x16a2('0xf9'),_0x11887f[_0x16a2('0xfa')]));};AGIVertices[_0x16a2('0x10')]['awspolly']=function(_0x16eb45){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0xfb'),_0x16eb45['label']));if(!this[_0x16a2('0x6a')](_0x16eb45[_0x16a2('0x6d')])||!this[_0x16a2('0x6a')](_0x16eb45[_0x16a2('0x6e')])){return this['channel'][_0x16a2('0x96')](_0x16a2('0xfc'));}if(!this[_0x16a2('0x6a')](_0x16eb45[_0x16a2('0x5e')])){return this[_0x16a2('0xd')][_0x16a2('0x96')]('no\x20text\x20configured');}this['channel']['noop'](util[_0x16a2('0x2b')](_0x16a2('0xfd'),_0x16eb45[_0x16a2('0x5e')]));var _0x5d15d0=this[_0x16a2('0x6c')][_0x16a2('0xb4')](this,_0x16eb45);if(_0x5d15d0){this[_0x16a2('0xd')]['noop'](util['format'](_0x16a2('0xfe'),_0x5d15d0));var _0x14fc70=this['channel']['streamFile'](_0x5d15d0);try{fs[_0x16a2('0xdf')](_0x5d15d0+_0x16a2('0xe0'));}catch(_0x24d6f8){logger[_0x16a2('0x52')](_0x24d6f8);}return _0x14fc70;}return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x16eb45,_0x16a2('0xff'));};AGIVertices['prototype'][_0x16a2('0x100')]=function(_0x16c657){logger['info'](util[_0x16a2('0x2b')](_0x16a2('0x101'),_0x16c657[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x16c657['aws_access_key_id'])||!this[_0x16a2('0x6a')](_0x16c657[_0x16a2('0x6e')])){return this[_0x16a2('0xd')][_0x16a2('0x96')](_0x16a2('0xfc'));}if(!this[_0x16a2('0x6a')](_0x16c657[_0x16a2('0x102')])){return this[_0x16a2('0xd')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x16a2('0x6a')](_0x16c657[_0x16a2('0x5e')])){return this['channel'][_0x16a2('0x96')](_0x16a2('0x9e'));}this[_0x16a2('0xd')][_0x16a2('0xcb')]=!![];this[_0x16a2('0x38')](_0x16c657);this['createSquareMessage'](_0x16c657[_0x16a2('0x5e')],'in');this[_0x16a2('0xd')]['noop'](util[_0x16a2('0x2b')](_0x16a2('0x103'),_0x16c657[_0x16a2('0x5e')]));var _0x35c9e7=this[_0x16a2('0x72')][_0x16a2('0xb4')](this,_0x16c657);if(_0x35c9e7){for(var _0x33c08e in _0x35c9e7){if(_0x35c9e7[_0x16a2('0x7d')](_0x33c08e)&&_['isString'](_0x35c9e7[_0x33c08e])){this['channel'][_0x16a2('0xbc')](util[_0x16a2('0x2b')](_0x16a2('0x104'),_0x33c08e['toUpperCase']()),_0x35c9e7[_0x33c08e]);}}if(_[_0x16a2('0x51')](_0x35c9e7[_0x16a2('0x105')])){return this['channel'][_0x16a2('0x96')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x16a2('0x43')](_0x35c9e7['message'],_0x16a2('0xd0'));return this['channel']['noop'](util[_0x16a2('0x2b')](_0x16a2('0x106'),_0x35c9e7[_0x16a2('0x105')]));}}return this['channel'][_0x16a2('0x52')](_0x16c657,_0x16a2('0x107'));};AGIVertices['prototype'][_0x16a2('0x108')]=function(_0xe9d37c){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x109'),_0xe9d37c['label'],_0xe9d37c[_0x16a2('0x8e')]));if(!this[_0x16a2('0x6a')](_0xe9d37c[_0x16a2('0x61')])){return this['channel'][_0x16a2('0x96')]('no\x20key\x20configured');}var _0x4e1cce='wav';var _0xa5f330=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x16a2('0xf4')](0x4));var _0x209d1d=util['format'](_0x16a2('0x10a'),_0xa5f330,_0x4e1cce);var _0x29fcc1=!![];if(_0xe9d37c[_0x16a2('0x10b')]==='NOBEEP'){_0x29fcc1=![];}var _0x17dd33=this['channel']['recordFile'](_0xa5f330,_0x4e1cce,_0xe9d37c[_0x16a2('0x10c')],_0xe9d37c[_0x16a2('0x8e')],undefined,_0x29fcc1);if(_0x17dd33[_0x16a2('0x85')]!==-0x1){this[_0x16a2('0xd')]['noop'](util[_0x16a2('0x2b')](_0x16a2('0x10d'),_0x209d1d));var _0x369870=this[_0x16a2('0x74')]['sync'](this,_0xe9d37c,_0x209d1d);if(_0x369870){for(var _0x21b2df in _0x369870){if(_0x369870['hasOwnProperty'](_0x21b2df)){this['channel'][_0x16a2('0xbc')](util['format'](_0x16a2('0x10e'),_0x21b2df[_0x16a2('0xce')]()),_0x369870[_0x21b2df]);}}return this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x10f'),JSON[_0x16a2('0xf1')](_0x369870)));}}return _0x17dd33;};AGIVertices[_0x16a2('0x10')][_0x16a2('0x110')]=function(_0x1f8cff){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x1f8cff[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x1f8cff[_0x16a2('0x77')])){return this[_0x16a2('0xd')]['noop'](_0x16a2('0x111'));}if(!this[_0x16a2('0x6a')](_0x1f8cff['appsecret'])){return this[_0x16a2('0xd')][_0x16a2('0x96')](_0x16a2('0x112'));}var _0x1029de='wav';var _0x3737bb=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x16a2('0xf4')](0x4));var _0x522cbb=util[_0x16a2('0x2b')](_0x16a2('0x10a'),_0x3737bb,_0x1029de);var _0x3c00f9=!![];if(_0x1f8cff['beep']==='NOBEEP'){_0x3c00f9=![];}var _0x124240=this[_0x16a2('0xd')][_0x16a2('0x113')](_0x3737bb,_0x1029de,_0x1f8cff[_0x16a2('0x10c')],_0x1f8cff['timeout'],undefined,_0x3c00f9);if(_0x124240[_0x16a2('0x85')]!==-0x1){this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x114'),_0x522cbb));var _0x56672c=this[_0x16a2('0x76')]['sync'](this,_0x1f8cff,_0x522cbb);if(_0x56672c){for(var _0x7e79bd in _0x56672c){if(_0x56672c[_0x16a2('0x7d')](_0x7e79bd)){this['channel'][_0x16a2('0xbc')](util[_0x16a2('0x2b')](_0x16a2('0x115'),_0x7e79bd[_0x16a2('0xce')]()),_0x56672c[_0x7e79bd]);}}return this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x116'),JSON['stringify'](_0x56672c)));}}return _0x124240;};AGIVertices[_0x16a2('0x10')][_0x16a2('0x117')]=function(_0x6884e9){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x118'),_0x6884e9[_0x16a2('0x3a')]));return this[_0x16a2('0xd')][_0x16a2('0x119')](_0x6884e9[_0x16a2('0x3f')],_0x6884e9[_0x16a2('0x40')],_0x6884e9['priority']);};AGIVertices[_0x16a2('0x10')][_0x16a2('0x11a')]=function(_0x5e3328){logger[_0x16a2('0x30')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x5e3328[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x5e3328[_0x16a2('0x11b')])){return this[_0x16a2('0xd')]['error'](_0x5e3328,_0x16a2('0x11c'));}try{var _0x3f125c=eval(_0x5e3328[_0x16a2('0x11b')])?_0x16a2('0x11d'):_0x16a2('0x11e');this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x11f'),_0x5e3328[_0x16a2('0x11b')],_0x3f125c));return{'code':0xc8,'result':_0x3f125c};}catch(_0x597426){return{'code':0xc8,'result':_0x16a2('0x11e')};}};AGIVertices[_0x16a2('0x10')]['gotoiftime']=function(_0x3f55d5){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x120'),_0x3f55d5[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x3f55d5[_0x16a2('0x121')])){return this['channel'][_0x16a2('0x52')](_0x3f55d5,'no\x20interval\x20configured');}var _0x4ab52f=this[_0x16a2('0x25')][_0x16a2('0xb4')](this,_0x3f55d5['interval_id']);if(!_0x4ab52f){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x3f55d5,_0x16a2('0x122'));}for(var _0x252464=0x0;_0x252464<_0x4ab52f[_0x16a2('0x80')];_0x252464+=0x1){var _0x401574=this[_0x16a2('0xd')][_0x16a2('0x82')](util['format'](_0x16a2('0x123'),_0x4ab52f[_0x252464]));if(_0x401574[_0x16a2('0x85')]===-0x1){return _0x401574;}logger[_0x16a2('0x30')](util['format']('IFTIME\x20%s\x20%s',_0x4ab52f[_0x252464],_0x401574[_0x16a2('0x83')]));if(_0x401574['extra']===_0x16a2('0x11d')){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x124'),_0x4ab52f[_0x252464],_0x16a2('0x11d')));this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x124'),_0x4ab52f[_0x252464],_0x16a2('0x11d')));return{'code':0xc8,'result':_0x16a2('0x11d')};}else{logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x124'),_0x4ab52f[_0x252464],_0x16a2('0x11e')));this['channel'][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x124'),_0x4ab52f[_0x252464],_0x16a2('0x11e')));}}return{'code':0xc8,'result':_0x16a2('0x11e')};};AGIVertices['prototype'][_0x16a2('0x125')]=function(_0x9ec1a4){logger['info'](util[_0x16a2('0x2b')](_0x16a2('0x126'),_0x9ec1a4[_0x16a2('0x3a')]));return this[_0x16a2('0xd')][_0x16a2('0x125')]();};AGIVertices[_0x16a2('0x10')][_0x16a2('0x127')]=function(_0x8cc2d1){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x128'),_0x8cc2d1[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x8cc2d1[_0x16a2('0x61')])){return this[_0x16a2('0xd')][_0x16a2('0x96')](_0x16a2('0x129'));}var _0xdb02e6='wav';var _0x5f5bae=util[_0x16a2('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0x16a2('0xf4')](0x4));var _0x2f56a7=util[_0x16a2('0x2b')]('%s.%s',_0x5f5bae,_0xdb02e6);var _0x1f4c3e=!![];if(_0x8cc2d1[_0x16a2('0x10b')]==='NOBEEP'){_0x1f4c3e=![];}var _0x2f9ce0=this[_0x16a2('0xd')][_0x16a2('0x113')](_0x5f5bae,_0xdb02e6,_0x8cc2d1[_0x16a2('0x10c')],_0x8cc2d1[_0x16a2('0x8e')],undefined,_0x1f4c3e);if(_0x2f9ce0[_0x16a2('0x85')]!==-0x1){this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x12a'),_0x2f56a7));var _0x2c3210=this[_0x16a2('0x68')]['sync'](this,_0x8cc2d1,_0x2f56a7);if(_0x2c3210){for(var _0xa687fd in _0x2c3210){if(_0x2c3210['hasOwnProperty'](_0xa687fd)){this[_0x16a2('0xd')][_0x16a2('0xbc')](util['format'](_0x16a2('0x12b'),_0xa687fd[_0x16a2('0xce')]()),_0x2c3210[_0xa687fd]);}}return this[_0x16a2('0xd')]['noop'](util[_0x16a2('0x2b')]('IspeechASR\x20Result\x20%s',JSON[_0x16a2('0xf1')](_0x2c3210)));}}return _0x2f9ce0;};AGIVertices[_0x16a2('0x10')]['ispeechtts']=function(_0x3ebcf6){logger[_0x16a2('0x30')](util['format'](_0x16a2('0x12c'),_0x3ebcf6[_0x16a2('0x3a')]));if(!this['isConfigured'](_0x3ebcf6[_0x16a2('0x61')])){return this[_0x16a2('0xd')]['noop']('no\x20key\x20configured');}if(!this[_0x16a2('0x6a')](_0x3ebcf6[_0x16a2('0x5e')])){return this['channel'][_0x16a2('0x96')]('no\x20text\x20configured');}this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')]('Trying\x20ispeech\x20TTS\x20%s',_0x3ebcf6[_0x16a2('0x5e')]));var _0x24b229=this[_0x16a2('0x64')][_0x16a2('0xb4')](this,_0x3ebcf6);if(_0x24b229){this['channel']['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x24b229));var _0x52ff72=this[_0x16a2('0xd')][_0x16a2('0xde')](_0x24b229,_0x3ebcf6['intKey']);try{fs[_0x16a2('0xdf')](_0x24b229+_0x16a2('0xe0'));}catch(_0xd665f2){logger[_0x16a2('0x52')](_0xd665f2);}return _0x52ff72;}return this['channel'][_0x16a2('0x52')](_0x3ebcf6,_0x16a2('0x12d'));};AGIVertices['prototype'][_0x16a2('0x12e')]=function(_0x25b821){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x25b821[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x25b821[_0x16a2('0x12f')])){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x25b821,_0x16a2('0x130'));}logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x131'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x25b821[_0x16a2('0x12f')]));var _0x40ce07=this[_0x16a2('0x55')]['sync'](this,_0x25b821['findBy']);if(_0x40ce07){logger[_0x16a2('0x30')](util['format'](_0x16a2('0x132'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x25b821['findBy']));this['channel'][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x132'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x25b821[_0x16a2('0x12f')]));return{'code':0xc8,'result':_0x16a2('0x133')};}else{logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x134'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x25b821[_0x16a2('0x12f')]));this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x134'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x25b821['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x16a2('0x10')]['logout']=function(_0x578a66){logger['info'](util['format'](_0x16a2('0x135'),_0x578a66['label']));if(!this[_0x16a2('0x6a')](_0x578a66[_0x16a2('0x12f')])){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x578a66,_0x16a2('0x130'));}logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x131'),this[_0x16a2('0xd')]['callerid'],_0x578a66['findBy']));var _0x5640ff=this[_0x16a2('0x54')][_0x16a2('0xb4')](this,_0x578a66[_0x16a2('0x12f')]);if(_0x5640ff){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x132'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x578a66[_0x16a2('0x12f')]));this['channel'][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x132'),this['channel'][_0x16a2('0x50')],_0x578a66[_0x16a2('0x12f')]));return{'code':0xc8,'result':'success'};}else{logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x134'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x578a66[_0x16a2('0x12f')]));this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x134'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x578a66['findBy']));return{'code':0xc8,'result':_0x16a2('0x136')};}};AGIVertices['prototype'][_0x16a2('0x137')]=function(_0xee1464){logger['info'](util[_0x16a2('0x2b')](_0x16a2('0x138'),_0xee1464[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0xee1464[_0x16a2('0x139')])){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0xee1464,_0x16a2('0x13a'));}this[_0x16a2('0xd')]['noop'](util[_0x16a2('0x2b')](_0x16a2('0x13b'),_0xee1464[_0x16a2('0x139')]));var _0x553161=eval(_0xee1464[_0x16a2('0x139')]);if(!this[_0x16a2('0x6a')](_0xee1464[_0x16a2('0xb8')])){return this[_0x16a2('0xd')][_0x16a2('0x96')](_0x16a2('0x13c'));}var _0x26f740=this[_0x16a2('0x82')][_0x16a2('0xb4')](this,_0xee1464['variable_id']);if(!_0x26f740){return this['channel'][_0x16a2('0x52')](_0xee1464,'no\x20variable\x20found');}if(_[_0x16a2('0x13d')](_0x553161)){var _0x416941=this;_0x553161['forEach'](function(_0x17c424,_0xae17a0){_0x416941[_0x16a2('0xd')][_0x16a2('0xbc')](util[_0x16a2('0x2b')](_0x16a2('0x13e'),_0x26f740,_0xae17a0),_0x17c424);});return this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x13f'),_0x26f740));}else{return this[_0x16a2('0xd')]['setVariable'](_0x26f740,_0x553161);}};AGIVertices[_0x16a2('0x10')]['menu']=function(_0x132d07){logger['info'](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x132d07[_0x16a2('0x3a')]));if(_0x132d07[_0x16a2('0x88')]===0x0){return this[_0x16a2('0x87')](_0x132d07);}_0x132d07['retry']-=0x1;if(!this[_0x16a2('0x6a')](_0x132d07[_0x16a2('0x140')])){return this[_0x16a2('0xd')]['error'](_0x132d07,'no\x20file\x20audio\x20selected');}var _0x528086=this[_0x16a2('0x1e')][_0x16a2('0xb4')](this,_0x132d07[_0x16a2('0x140')]);if(!_0x528086){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x132d07,_0x16a2('0xee'));}var _0x12e6cc=this['channel'][_0x16a2('0x141')](_0x528086,_0x132d07[_0x16a2('0xef')],_0x132d07[_0x16a2('0x142')]);var _0x3d6a8f=_0x12e6cc['result'];if(_0x12e6cc[_0x16a2('0x85')]===-0x1){this['createSquareDetailsReport'][_0x16a2('0xb4')](this,_0x132d07,'-1');return _0x12e6cc;}else if(_0x12e6cc['extra']===_0x16a2('0x8e')){_0x12e6cc[_0x16a2('0x85')]=_0x12e6cc[_0x16a2('0x85')][_0x16a2('0x80')]>0x0?_0x12e6cc['result']:'t';}else if(_[_0x16a2('0x143')](_0x12e6cc['result'])){_0x12e6cc['result']='#';_0x3d6a8f='#';}if(!this['isConfigured'](_0x132d07['variable_id'])){this[_0x16a2('0xd')][_0x16a2('0x96')](_0x16a2('0x13c'));}else{var _0xaf64c8=this[_0x16a2('0x82')]['sync'](this,_0x132d07[_0x16a2('0xb8')]);if(!_0xaf64c8){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x132d07,_0x16a2('0xb9'));}this[_0x16a2('0xd')][_0x16a2('0xbc')](_0xaf64c8,_0x3d6a8f);}this[_0x16a2('0x38')][_0x16a2('0xb4')](this,_0x132d07,_0x3d6a8f);return _0x12e6cc;};AGIVertices[_0x16a2('0x10')][_0x16a2('0x96')]=function(_0x54e4bf){logger['info'](util[_0x16a2('0x2b')](_0x16a2('0x144'),_0x54e4bf[_0x16a2('0x3a')]));return this[_0x16a2('0xd')][_0x16a2('0x96')](_0x54e4bf[_0x16a2('0x145')]||_0x54e4bf[_0x16a2('0x3a')]);};AGIVertices['prototype']['pause']=function(_0x10110d){logger[_0x16a2('0x30')](util['format'](_0x16a2('0x146'),_0x10110d[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x10110d[_0x16a2('0x12f')])){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x10110d,_0x16a2('0x130'));}logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x131'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x10110d[_0x16a2('0x12f')]));var _0x471173=this[_0x16a2('0x4c')][_0x16a2('0xb4')](this,_0x10110d['pause_id']);var _0x3762e6=this['agentPause'][_0x16a2('0xb4')](this,_0x10110d[_0x16a2('0x12f')],_0x471173);if(_0x3762e6){logger['info'](util[_0x16a2('0x2b')](_0x16a2('0x132'),this[_0x16a2('0xd')]['callerid'],_0x10110d[_0x16a2('0x12f')]));this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x132'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x10110d[_0x16a2('0x12f')]));return{'code':0xc8,'result':'success'};}else{logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x134'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x10110d[_0x16a2('0x12f')]));this[_0x16a2('0xd')]['noop'](util[_0x16a2('0x2b')](_0x16a2('0x132'),this[_0x16a2('0xd')]['callerid'],_0x10110d['findBy']));return{'code':0xc8,'result':_0x16a2('0x136')};}};AGIVertices[_0x16a2('0x10')][_0x16a2('0x147')]=function(_0x216de8){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x216de8[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x216de8[_0x16a2('0x140')])){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x216de8,'no\x20file\x20audio\x20selected');}var _0x5a7e5f=this[_0x16a2('0x1e')][_0x16a2('0xb4')](this,_0x216de8['file_id']);if(!_0x5a7e5f){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x216de8,_0x16a2('0xee'));}var _0x438d4b=this[_0x16a2('0xd')][_0x16a2('0x5a')]('PLAYBACK',[_0x5a7e5f,_0x216de8[_0x16a2('0xc6')]]);if(_0x438d4b[_0x16a2('0x85')]===-0x1){return _0x438d4b;}return this[_0x16a2('0xd')]['noop'](util[_0x16a2('0x2b')](_0x16a2('0x9c'),_0x16a2('0x148'),_0x5a7e5f));};AGIVertices[_0x16a2('0x10')][_0x16a2('0x149')]=function(_0x4ab2d1){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4ab2d1['label']));if(!this[_0x16a2('0x6a')](_0x4ab2d1[_0x16a2('0x14a')])){return this[_0x16a2('0xd')]['error'](_0x4ab2d1,'no\x20queue\x20selected');}var _0x3ff276='';var _0x204d40=parseInt(_0x4ab2d1[_0x16a2('0x14a')],0xa);if(isNaN(_0x204d40)){_0x3ff276=_0x4ab2d1[_0x16a2('0x14a')];}else{_0x3ff276=this[_0x16a2('0x14b')][_0x16a2('0xb4')](this,_0x4ab2d1['queue_id']);if(!_0x3ff276){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x4ab2d1,_0x16a2('0x14c'));}}var _0xb8bac3='';if(this[_0x16a2('0x6a')](_0x4ab2d1['file_id'])){var _0x4d14da=this[_0x16a2('0x1e')][_0x16a2('0xb4')](this,_0x4ab2d1[_0x16a2('0x140')]);if(_0x4d14da){_0xb8bac3=_0x4d14da;}}this[_0x16a2('0x38')][_0x16a2('0xb4')](this,_0x4ab2d1,_0x3ff276);if(_0x4ab2d1[_0x16a2('0xc6')][_0x16a2('0x14d')]('x')<0x0){_0x4ab2d1[_0x16a2('0xc6')]+='x';}if(_0x4ab2d1[_0x16a2('0xc6')][_0x16a2('0x14d')]('X')<0x0){_0x4ab2d1['opts']+='X';}this[_0x16a2('0xd')][_0x16a2('0xbc')](_0x16a2('0x14e'),_0x3ff276?_0x3ff276[_0x16a2('0x14f')]():'');var _0x4c2003=this[_0x16a2('0xd')]['exec'](_0x16a2('0x150'),[_0x3ff276,_0x4ab2d1[_0x16a2('0xc6')],_0x4ab2d1[_0x16a2('0xc7')],_0xb8bac3,_0x4ab2d1[_0x16a2('0x8e')],_0x4ab2d1[_0x16a2('0x7')],_0x4ab2d1['macro'],_0x4ab2d1[_0x16a2('0x151')],'',_0x4ab2d1[_0x16a2('0x152')]]);if(_0x4c2003[_0x16a2('0x85')]===-0x1){return _0x4c2003;}return this[_0x16a2('0xd')][_0x16a2('0x96')](util['format'](_0x16a2('0x9c'),_0x16a2('0x150'),_0x3ff276));};AGIVertices[_0x16a2('0x10')]['record']=function(_0x43eb9f){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x153'),_0x43eb9f[_0x16a2('0x3a')]));var _0x549c9f=_0x43eb9f[_0x16a2('0x154')]||_0x16a2('0x155');var _0x1e51af=util[_0x16a2('0x2b')](_0x16a2('0x156'),this[_0x16a2('0xd')][_0x16a2('0x39')],rs[_0x16a2('0xf4')](0x5));var _0x11800b=util['format'](_0x16a2('0x157'),FILES_PATH,_0x1e51af,_0x549c9f);var _0x251189=util[_0x16a2('0x2b')](_0x16a2('0x158'),FILES_PATH,_0x1e51af);this[_0x16a2('0x3d')][_0x16a2('0xb4')](this,_0x43eb9f,_0x1e51af,_0x11800b);this[_0x16a2('0xd')][_0x16a2('0xbc')]('RECORDING_SAVENAME',_0x1e51af);logger[_0x16a2('0x30')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x251189,_0x549c9f,_0x43eb9f[_0x16a2('0x159')],_0x43eb9f[_0x16a2('0x8e')]);return this['channel'][_0x16a2('0x113')](_0x251189,_0x549c9f,_0x43eb9f['escape_digits'],_0x43eb9f['timeout'],undefined,!![]);};AGIVertices[_0x16a2('0x10')][_0x16a2('0x15a')]=function(_0x3e90c8){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x15b'),_0x3e90c8['label']));return this['channel'][_0x16a2('0x15c')](_0x3e90c8[_0x16a2('0x15d')][_0x16a2('0x5c')](/\s+/g,''),_0x3e90c8[_0x16a2('0x159')]);};AGIVertices[_0x16a2('0x10')][_0x16a2('0x15e')]=function(_0x30d066){logger['info'](util['format'](_0x16a2('0x15f'),_0x30d066[_0x16a2('0x3a')]));return this[_0x16a2('0xd')][_0x16a2('0x160')](_0x30d066['number'][_0x16a2('0x5c')](/\s+/g,''),_0x30d066['escape_digits']);};AGIVertices['prototype'][_0x16a2('0x161')]=function(_0x1fe738){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x162'),_0x1fe738['label']));return this[_0x16a2('0xd')][_0x16a2('0x163')](_0x1fe738[_0x16a2('0x5e')],_0x1fe738[_0x16a2('0x159')]);};AGIVertices['prototype'][_0x16a2('0x164')]=function(_0x4fbe94){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x4fbe94[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x4fbe94[_0x16a2('0x165')])){return this[_0x16a2('0xd')][_0x16a2('0x96')]('no\x20mail\x20account\x20configured');}var _0x4a8742=this[_0x16a2('0x22')][_0x16a2('0xb4')](this,_0x4fbe94['account_id']);if(!_0x4a8742||!_0x4a8742['Smtp']){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x4fbe94,_0x16a2('0x166'));}var _0x33217b={'from':util['format'](_0x16a2('0x167'),_0x4a8742[_0x16a2('0x13')],_0x4a8742[_0x16a2('0x168')]||_0x4a8742[_0x16a2('0x169')][_0x16a2('0x16a')]),'to':_0x4fbe94['to']||'','cc':_0x4fbe94['cc']||'','bcc':_0x4fbe94[_0x16a2('0x16b')]||'','subject':_0x4fbe94[_0x16a2('0x16c')],'html':_0x4fbe94[_0x16a2('0x5e')],'text':_0x4fbe94[_0x16a2('0x5e')]};var _0x3171ed={'tls':{'rejectUnauthorized':![]}};if(_0x4a8742[_0x16a2('0x169')][_0x16a2('0x16d')]){_0x3171ed[_0x16a2('0x16d')]=_0x4a8742['Smtp'][_0x16a2('0x16d')];}else{_0x3171ed[_0x16a2('0x16e')]=_0x4a8742[_0x16a2('0x169')][_0x16a2('0x16e')];_0x3171ed[_0x16a2('0x16f')]=_0x4a8742[_0x16a2('0x169')][_0x16a2('0x16f')];_0x3171ed['secure']=_0x4a8742[_0x16a2('0x169')][_0x16a2('0x170')];}if(_0x4a8742[_0x16a2('0x169')][_0x16a2('0x171')]){_0x3171ed['auth']={'user':_0x4a8742['Smtp'][_0x16a2('0x16a')],'pass':_0x4a8742['Smtp'][_0x16a2('0x172')]};}if(this[_0x16a2('0x6a')](_0x4fbe94[_0x16a2('0x173')])){}logger[_0x16a2('0xc0')](_0x16a2('0x174'),JSON['stringify'](_0x33217b));this[_0x16a2('0x38')]['sync'](this,_0x4fbe94,_0x4fbe94[_0x16a2('0x165')]);this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x175'),_0x4a8742[_0x16a2('0x13')]));this[_0x16a2('0x24')]['sync'](this,_0x3171ed,_0x33217b);return this[_0x16a2('0xd')][_0x16a2('0x96')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x16a2('0x10')][_0x16a2('0x176')]=function(_0x23eed5){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x177'),_0x23eed5[_0x16a2('0x3a')]));return this[_0x16a2('0xd')][_0x16a2('0x96')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x16a2('0x10')]['sendSMS']=function(_0x2ec5d9){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2ec5d9[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x2ec5d9['sms_account_id'])){return this[_0x16a2('0xd')][_0x16a2('0x96')](_0x16a2('0x178'));}var _0x31ca22=this[_0x16a2('0x35')]['sync'](this,_0x2ec5d9[_0x16a2('0x179')]);if(!_0x31ca22){return this['channel']['error'](_0x2ec5d9,'no\x20sms\x20account\x20found');}var _0x14fd83={'body':_0x2ec5d9[_0x16a2('0x17a')],'phone':_0x2ec5d9['to']||'','SmsAccountId':_0x31ca22['id']};logger['debug'](_0x16a2('0x17b'),JSON['stringify'](_0x14fd83));this[_0x16a2('0x38')][_0x16a2('0xb4')](this,_0x2ec5d9,_0x2ec5d9['sms_account_id']);this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x31ca22[_0x16a2('0x13')]));this[_0x16a2('0x37')]['sync'](this,_0x14fd83);return this['channel'][_0x16a2('0x96')](_0x16a2('0x17c'));};AGIVertices['prototype']['set']=function(_0x3339a4){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x17d'),_0x3339a4[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x3339a4[_0x16a2('0xb8')])){return this['channel']['error'](_0x3339a4,'no\x20variable\x20selected');}var _0x8c1bfa=this['getVariable'][_0x16a2('0xb4')](this,_0x3339a4[_0x16a2('0xb8')]);if(!_0x8c1bfa){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x3339a4,'no\x20variable\x20found');}return this[_0x16a2('0xd')][_0x16a2('0xbc')](_0x8c1bfa,_0x3339a4[_0x16a2('0x17e')]);};AGIVertices['prototype'][_0x16a2('0x17f')]=function(_0x5e32ec){logger[_0x16a2('0x30')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x5e32ec[_0x16a2('0x3a')]));this[_0x16a2('0xd')][_0x16a2('0x96')]('START\x20CALLY\x20SQUARE');if(_0x5e32ec[_0x16a2('0x8c')]==='yes'){this['channel']['noop'](_0x16a2('0x180'));return this[_0x16a2('0xd')][_0x16a2('0x8c')]();}return this[_0x16a2('0xd')][_0x16a2('0x96')](_0x16a2('0x181'));};AGIVertices[_0x16a2('0x10')][_0x16a2('0x182')]=function(_0x282d06){logger[_0x16a2('0x30')](util['format'](_0x16a2('0x183'),_0x282d06['label']));if(!this['isConfigured'](_0x282d06[_0x16a2('0x184')])){return this['channel'][_0x16a2('0x52')](_0x282d06,_0x16a2('0x185'));}var _0x37243d=this[_0x16a2('0x16')][_0x16a2('0xb4')](this,_0x282d06[_0x16a2('0x184')]);if(!this['isConfigured'](_0x37243d)){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x282d06,util[_0x16a2('0x2b')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x282d06[_0x16a2('0x184')]));}if(_0x37243d===this['channel'][_0x16a2('0x3c')]){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x282d06,_0x16a2('0x186'));}this['createSquareDetailsReport'][_0x16a2('0xb4')](this,_0x282d06,_0x37243d);var _0x289b5a=this['channel'][_0x16a2('0x5a')](_0x16a2('0x187'),util[_0x16a2('0x2b')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x16a2('0x7')][_0x16a2('0x16e')]||_0x16a2('0x188'),_0x37243d,this[_0x16a2('0xd')][_0x16a2('0x3c')]));if(_0x289b5a[_0x16a2('0x85')]===-0x1){return _0x289b5a;}return this[_0x16a2('0xd')]['noop'](util[_0x16a2('0x2b')](_0x16a2('0x9c'),_0x16a2('0x187'),_0x37243d));};AGIVertices[_0x16a2('0x10')][_0x16a2('0x189')]=function(_0xb9105){logger['info'](util[_0x16a2('0x2b')](_0x16a2('0x18a'),_0xb9105['label']));var _0x3b6168=this[_0x16a2('0x59')][_0x16a2('0xb4')](this,_0xb9105[_0x16a2('0x8a')]);this[_0x16a2('0x38')][_0x16a2('0xb4')](this,_0xb9105,_0xb9105[_0x16a2('0x8a')]);if(this['isConfigured'](_0xb9105[_0x16a2('0xb8')])){var _0x4d6639=this['getVariable'][_0x16a2('0xb4')](this,_0xb9105['variable_id']);if(_0x4d6639){this['channel'][_0x16a2('0xbc')](_0x4d6639,_0x3b6168);return this[_0x16a2('0xd')][_0x16a2('0x96')](util['format'](_0x16a2('0x18b'),_0xb9105['command'],_0x4d6639));}}return this[_0x16a2('0xd')][_0x16a2('0x96')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0xb9105[_0x16a2('0x8a')]));};AGIVertices['prototype']['tts']=function(_0x2a944e){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x18c'),_0x2a944e[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x2a944e[_0x16a2('0x5e')])){return this[_0x16a2('0xd')][_0x16a2('0x96')]('no\x20text\x20configured');}this[_0x16a2('0xd')]['noop'](util[_0x16a2('0x2b')](_0x16a2('0x18d'),_0x2a944e[_0x16a2('0x5e')]));var _0x266f5e=this[_0x16a2('0x5d')][_0x16a2('0xb4')](this,_0x2a944e);if(_0x266f5e){this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x18e'),_0x266f5e));var _0xbb9cdf=this['channel'][_0x16a2('0xde')](_0x266f5e);try{fs[_0x16a2('0xdf')](_0x266f5e+_0x16a2('0xe0'));}catch(_0x4bf062){logger['error'](_0x4bf062);}return _0xbb9cdf;}return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x2a944e,_0x16a2('0x18f'));};AGIVertices[_0x16a2('0x10')]['unpause']=function(_0x619f29){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x190'),_0x619f29[_0x16a2('0x3a')]));if(!this[_0x16a2('0x6a')](_0x619f29[_0x16a2('0x12f')])){return this[_0x16a2('0xd')]['error'](_0x619f29,_0x16a2('0x130'));}logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x131'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x619f29[_0x16a2('0x12f')]));var _0x35b82a=this[_0x16a2('0x53')][_0x16a2('0xb4')](this,_0x619f29[_0x16a2('0x12f')]);if(_0x35b82a){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x132'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x619f29['findBy']));this['channel'][_0x16a2('0x96')](util[_0x16a2('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x16a2('0xd')][_0x16a2('0x50')],_0x619f29['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x16a2('0x30')](util['format'](_0x16a2('0x134'),this[_0x16a2('0xd')][_0x16a2('0x50')],_0x619f29[_0x16a2('0x12f')]));this[_0x16a2('0xd')]['noop'](util[_0x16a2('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x16a2('0x50')],_0x619f29[_0x16a2('0x12f')]));return{'code':0xc8,'result':_0x16a2('0x136')};}};AGIVertices[_0x16a2('0x10')][_0x16a2('0x191')]=function(_0x10762c){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')](_0x16a2('0x192'),_0x10762c[_0x16a2('0x3a')]));var _0x111071=this[_0x16a2('0xd')][_0x16a2('0x5a')](_0x16a2('0x193'),[_0x10762c['mailbox'],_0x10762c[_0x16a2('0x9b')]]);if(_0x111071[_0x16a2('0x85')]===-0x1){return _0x111071;}return this[_0x16a2('0xd')][_0x16a2('0x96')](util[_0x16a2('0x2b')](_0x16a2('0x9c'),_0x16a2('0x193'),_0x10762c['mailbox']));};AGIVertices['prototype'][_0x16a2('0x194')]=function(_0x2bd75c){logger[_0x16a2('0x30')](util[_0x16a2('0x2b')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x2bd75c[_0x16a2('0x3a')]));if(!this['isConfigured'](_0x2bd75c[_0x16a2('0xb8')])){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x2bd75c,_0x16a2('0x195'));}var _0x2f8a88=this['getVariable'][_0x16a2('0xb4')](this,_0x2bd75c[_0x16a2('0xb8')]);if(!_0x2f8a88){return this[_0x16a2('0xd')][_0x16a2('0x52')](_0x2bd75c,_0x16a2('0xb9'));}var _0x10fb8a=this[_0x16a2('0xd')][_0x16a2('0x82')](_0x2f8a88);return{'code':0xc8,'result':_0x10fb8a[_0x16a2('0x83')]?_0x10fb8a[_0x16a2('0x83')]:'-'};};String[_0x16a2('0x10')][_0x16a2('0x81')]=function(_0x52d7fc,_0x2381b8){return this['split'](_0x52d7fc)[_0x16a2('0x196')](_0x2381b8);};module[_0x16a2('0x197')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 63963c8..4573cec 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 _0x7fe3=['error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','acw','../rpc/user','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','savePause','acwTimeout','stopAcw','lastPauseAt','updateAcw','timer','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch'];(function(_0x4260f3,_0x4988d6){var _0x31b726=function(_0x5a5513){while(--_0x5a5513){_0x4260f3['push'](_0x4260f3['shift']());}};_0x31b726(++_0x4988d6);}(_0x7fe3,0x16e));var _0x37fe=function(_0x12e13b,_0x306a09){_0x12e13b=_0x12e13b-0x0;var _0x2ee92e=_0x7fe3[_0x12e13b];return _0x2ee92e;};'use strict';var util=require('util');var _=require(_0x37fe('0x0'));var moment=require(_0x37fe('0x1'));var ami=require(_0x37fe('0x2'));var logger=require('../../../config/logger')(_0x37fe('0x3'));var RpcUser=require(_0x37fe('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1ecfb0){this['voiceQueues']=_0x1ecfb0[_0x37fe('0x5')];this[_0x37fe('0x6')]=_0x1ecfb0[_0x37fe('0x6')];this['timers']=_0x1ecfb0[_0x37fe('0x7')];this[_0x37fe('0x8')]={};ami['on']('agentconnect',this[_0x37fe('0x9')][_0x37fe('0xa')](this));ami['on'](_0x37fe('0xb'),this[_0x37fe('0xc')][_0x37fe('0xa')](this));ami['on'](_0x37fe('0xd'),this[_0x37fe('0xe')]['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x37fe('0xf'),this[_0x37fe('0x10')]['bind'](this));ami['on'](_0x37fe('0x11'),this[_0x37fe('0x12')][_0x37fe('0xa')](this));ami['on'](_0x37fe('0x13'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x52d61e){var _0xad4528=moment()[_0x37fe('0x14')](0x0);var _0x160c2b=moment(_0x52d61e)[_0x37fe('0x14')](0x0);return _0xad4528['diff'](_0x160c2b,_0x37fe('0x15'));}Acw[_0x37fe('0x16')][_0x37fe('0x17')]=function(_0x1d7859){try{var _0x1e33cc=this;var _0x3812f0=this[_0x37fe('0x8')][_0x1d7859][_0x37fe('0x18')];var _0x496394=this[_0x37fe('0x8')][_0x1d7859][_0x37fe('0x19')];var _0x12629c=this['voiceQueues'][_0x496394];var _0x18b17e=![];var _0x1ca5f3=_0x37fe('0x1a');if(_0x12629c[_0x37fe('0x1b')]){if(_0x12629c['mandatoryDispositionPause'][_0x37fe('0x1c')]){_0x18b17e=!![];_0x1ca5f3=_0x12629c[_0x37fe('0x1d')][_0x37fe('0x1c')];}}ami[_0x37fe('0x1e')]({'action':'QueuePause','interface':_0x3812f0,'paused':!![],'reason':_0x1ca5f3})[_0x37fe('0x1f')](function(_0xeb3591){if(_0x1e33cc['agents'][_0x3812f0]){return RpcUser['getAgent'](_0x1e33cc[_0x37fe('0x6')][_0x3812f0]['id'])['then'](function(_0xbda4fd){if(_0xbda4fd&&!_0xbda4fd[_0x37fe('0x20')]){logger[_0x37fe('0x21')](_0x37fe('0x22'),_0x1d7859,_0x3812f0,_0x496394);return RpcUser[_0x37fe('0x23')](_0x1e33cc[_0x37fe('0x6')][_0x3812f0],_0x1ca5f3,_0x1d7859)[_0x37fe('0x1f')](function(_0x45a8b2){if(!_0x18b17e){_0x1e33cc[_0x37fe('0x7')][_0x3812f0]={};logger[_0x37fe('0x21')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1d7859,_0x1e33cc[_0x37fe('0x5')][_0x496394][_0x37fe('0x24')],_0x3812f0,_0x496394);_0x1e33cc[_0x37fe('0x7')][_0x3812f0]['timer']=setTimeout(_0x1e33cc[_0x37fe('0x25')][_0x37fe('0xa')](_0x1e33cc,_0x3812f0),_0x1e33cc[_0x37fe('0x5')][_0x496394][_0x37fe('0x24')]*0x3e8);_0x1e33cc[_0x37fe('0x7')][_0x3812f0][_0x37fe('0x26')]=_0x45a8b2[_0x37fe('0x26')];_0x1e33cc['timers'][_0x3812f0]['uniqueid']=_0x1d7859;_0x1e33cc[_0x37fe('0x7')][_0x3812f0]['queue']=_0x496394;_0x1e33cc[_0x37fe('0x7')][_0x3812f0][_0x37fe('0x27')]=function(){var _0x47e741=getDiff(_0x1e33cc[_0x37fe('0x7')][_0x3812f0][_0x37fe('0x26')]);clearTimeout(_0x1e33cc[_0x37fe('0x7')][_0x3812f0][_0x37fe('0x28')]);RpcVoiceAgentReport['update']({'acwtime':_0x47e741},_0x1e33cc[_0x37fe('0x7')][_0x3812f0][_0x37fe('0x29')],_0x3812f0)['then'](function(_0x34a9e1){logger[_0x37fe('0x21')](_0x37fe('0x2a'),_0x1d7859,_0x47e741,_0x34a9e1);})[_0x37fe('0x2b')](function(_0x2a263f){logger[_0x37fe('0x2c')](_0x37fe('0x2d'),_0x1d7859,_0x2a263f);});delete _0x1e33cc[_0x37fe('0x7')][_0x3812f0];};}});}else{logger[_0x37fe('0x21')](_0x37fe('0x2e'),_0x1d7859,_0x3812f0,_0x496394);}});}})[_0x37fe('0x2b')](function(_0xef0b16){logger[_0x37fe('0x2c')](_0x37fe('0x2f'),_0x1d7859,_0x1e33cc[_0x37fe('0x5')][_0x496394][_0x37fe('0x24')],_0x3812f0,_0x496394);})[_0x37fe('0x30')](function(){delete _0x1e33cc['channels'][_0x1d7859];});}catch(_0x504d42){logger[_0x37fe('0x2c')](_0x37fe('0x31'),_0x504d42['message']);}};Acw[_0x37fe('0x16')]['stopAcw']=function(_0x360ee3){try{var _0x528612=this;if(_0x528612['timers'][_0x360ee3]){var _0x485a40=_0x528612['timers'][_0x360ee3][_0x37fe('0x29')];var _0x4b3b0b=_0x528612['timers'][_0x360ee3][_0x37fe('0x19')];var _0x1bd57e=_0x528612[_0x37fe('0x5')][_0x4b3b0b]['acwTimeout'];logger[_0x37fe('0x21')]('[TIMER][STOP][AGENT:%s]',_0x360ee3);RpcUser[_0x37fe('0x32')](this[_0x37fe('0x6')][_0x360ee3]);RpcVoiceAgentReport[_0x37fe('0x33')]({'acwtime':_0x1bd57e,'agentacw':!![]},_0x485a40,_0x360ee3)[_0x37fe('0x1f')](function(_0x4c2369){logger['info'](_0x37fe('0x2a'),_0x485a40,_0x1bd57e,_0x4c2369);})[_0x37fe('0x2b')](function(_0x4900a2){logger[_0x37fe('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0x485a40,_0x4900a2);});}else{logger[_0x37fe('0x2c')](_0x37fe('0x34'),_0x360ee3);if(_0x528612[_0x37fe('0x7')]){logger['info'](_0x37fe('0x35'),JSON['stringify'](_0x528612[_0x37fe('0x7')]));}}}catch(_0x5d18a9){logger[_0x37fe('0x2c')](_0x37fe('0x36'),_0x5d18a9[_0x37fe('0x37')]);}};Acw[_0x37fe('0x16')][_0x37fe('0x9')]=function(_0x5f5b60){try{if(this[_0x37fe('0x5')][_0x5f5b60[_0x37fe('0x19')]]&&(this[_0x37fe('0x5')][_0x5f5b60['queue']]['acw']||this[_0x37fe('0x5')][_0x5f5b60[_0x37fe('0x19')]]['mandatoryDisposition'])){if(this['agents'][_0x5f5b60['interface']]){this[_0x37fe('0x8')][_0x5f5b60[_0x37fe('0x29')]]={'queue':_0x5f5b60['queue'],'interface':_0x5f5b60[_0x37fe('0x18')]};}}}catch(_0x3e631d){logger['error'](_0x37fe('0x38'),_0x3e631d['message']);}};Acw[_0x37fe('0x16')][_0x37fe('0x39')]=function(_0x4870be){try{if(this[_0x37fe('0x5')][_0x4870be[_0x37fe('0x19')]]&&(this[_0x37fe('0x5')][_0x4870be[_0x37fe('0x19')]][_0x37fe('0x3')]||this['voiceQueues'][_0x4870be[_0x37fe('0x19')]]['mandatoryDisposition'])){if(this['agents'][_0x4870be[_0x37fe('0x18')]]){this[_0x37fe('0x8')][_0x4870be[_0x37fe('0x29')]]={'queue':_0x4870be[_0x37fe('0x19')],'interface':_0x4870be[_0x37fe('0x18')]};}}}catch(_0x42f939){logger[_0x37fe('0x2c')](_0x37fe('0x3a'),_0x42f939[_0x37fe('0x37')]);}};Acw[_0x37fe('0x16')][_0x37fe('0xc')]=function(_0x20a9b7){try{if(this['channels'][_0x20a9b7['uniqueid']]&&_[_0x37fe('0x3b')](this[_0x37fe('0x8')][_0x20a9b7[_0x37fe('0x29')]][_0x37fe('0x3c')])){logger[_0x37fe('0x21')](_0x37fe('0x3d'),_0x20a9b7[_0x37fe('0x29')]);this[_0x37fe('0x17')](_0x20a9b7[_0x37fe('0x29')]);}else if(this['channels'][_0x20a9b7[_0x37fe('0x3e')]]&&_[_0x37fe('0x3b')](this[_0x37fe('0x8')][_0x20a9b7['linkedid']]['attended'])){logger['info']('[%s][HANGUP:LINKEDID]',_0x20a9b7[_0x37fe('0x3e')]);this[_0x37fe('0x17')](_0x20a9b7['linkedid']);}}catch(_0x15011c){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x15011c[_0x37fe('0x37')]);}};Acw[_0x37fe('0x16')][_0x37fe('0xe')]=function(_0x1e36c0){try{if(this['channels'][_0x1e36c0['uniqueid']]&&this['channels'][_0x1e36c0[_0x37fe('0x29')]]['attended']){logger[_0x37fe('0x21')](_0x37fe('0x3f'),_0x1e36c0[_0x37fe('0x29')]);this[_0x37fe('0x17')](_0x1e36c0[_0x37fe('0x29')]);}else if(this[_0x37fe('0x8')][_0x1e36c0[_0x37fe('0x3e')]]&&this[_0x37fe('0x8')][_0x1e36c0[_0x37fe('0x3e')]]['attended']){logger[_0x37fe('0x21')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1e36c0['linkedid']);this[_0x37fe('0x17')](_0x1e36c0[_0x37fe('0x3e')]);}}catch(_0x2cd9d2){logger['error'](_0x37fe('0x40'),_0x2cd9d2['message']);}};Acw[_0x37fe('0x16')][_0x37fe('0x10')]=function(_0x48f82e){try{if(!_['isNil'](this[_0x37fe('0x8')][_0x48f82e[_0x37fe('0x41')]])){this['startAcw'](_0x48f82e[_0x37fe('0x41')]);if(this[_0x37fe('0x8')][_0x48f82e[_0x37fe('0x42')]]){this[_0x37fe('0x8')][_0x48f82e[_0x37fe('0x42')]][_0x37fe('0x3c')]=!![];this[_0x37fe('0x8')][_0x48f82e[_0x37fe('0x43')]]=this[_0x37fe('0x8')][_0x48f82e[_0x37fe('0x42')]];delete this[_0x37fe('0x8')][_0x48f82e[_0x37fe('0x42')]];}}else if(!_[_0x37fe('0x44')](this[_0x37fe('0x8')][_0x48f82e[_0x37fe('0x43')]])){this[_0x37fe('0x17')](_0x48f82e[_0x37fe('0x43')]);if(this[_0x37fe('0x8')][_0x48f82e[_0x37fe('0x45')]]){this[_0x37fe('0x8')][_0x48f82e[_0x37fe('0x45')]]['attended']=!![];this[_0x37fe('0x8')][_0x48f82e['transfereeuniqueid']]=this[_0x37fe('0x8')][_0x48f82e[_0x37fe('0x45')]];delete this[_0x37fe('0x8')][_0x48f82e[_0x37fe('0x45')]];}}}catch(_0x3afbb2){logger[_0x37fe('0x2c')](_0x37fe('0x46'),_0x3afbb2[_0x37fe('0x37')]);}};Acw[_0x37fe('0x16')][_0x37fe('0x12')]=function(_0x3802d9){try{if(this[_0x37fe('0x8')][_0x3802d9[_0x37fe('0x47')]]){logger[_0x37fe('0x21')](_0x37fe('0x48'),JSON[_0x37fe('0x49')](_0x3802d9[_0x37fe('0x47')]));this[_0x37fe('0x17')](_0x3802d9[_0x37fe('0x47')]);}else if(this[_0x37fe('0x8')][_0x3802d9['transfererlinkedid']]){logger[_0x37fe('0x21')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x37fe('0x49')](_0x3802d9['transfererlinkedid']));this[_0x37fe('0x17')](_0x3802d9[_0x37fe('0x4a')]);}}catch(_0x38673b){logger[_0x37fe('0x2c')](_0x37fe('0x4b'),_0x38673b[_0x37fe('0x37')]);}};Acw[_0x37fe('0x16')][_0x37fe('0x4c')]=function(_0x345fe0){try{if(this[_0x37fe('0x5')][_0x345fe0[_0x37fe('0x19')]]&&this[_0x37fe('0x5')][_0x345fe0[_0x37fe('0x19')]][_0x37fe('0x4d')]==='all'){if(this[_0x37fe('0x6')][_0x345fe0[_0x37fe('0x18')]]){logger[_0x37fe('0x21')](_0x37fe('0x4e'),_0x345fe0[_0x37fe('0x29')],_0x345fe0[_0x37fe('0x18')],_0x345fe0[_0x37fe('0x19')]);return RpcUser[_0x37fe('0x23')](this[_0x37fe('0x6')][_0x345fe0[_0x37fe('0x18')]],_0x37fe('0x4f'),_0x345fe0['uniqueid']);}}}catch(_0x11e1ab){logger[_0x37fe('0x2c')](_0x37fe('0x50'),_0x11e1ab[_0x37fe('0x37')]);}};module[_0x37fe('0x51')]=Acw; \ No newline at end of file +var _0x96ea=['then','info','[%s][START][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','bind','hanguprequest','hangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause'];(function(_0x1eacc8,_0x2724ef){var _0x14a837=function(_0x32fbf9){while(--_0x32fbf9){_0x1eacc8['push'](_0x1eacc8['shift']());}};_0x14a837(++_0x2724ef);}(_0x96ea,0x12a));var _0xa96e=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x96ea[_0x3c4dad];return _0x1a4f49;};'use strict';var util=require(_0xa96e('0x0'));var _=require('lodash');var moment=require(_0xa96e('0x1'));var ami=require(_0xa96e('0x2'));var logger=require(_0xa96e('0x3'))('acw');var RpcUser=require(_0xa96e('0x4'));var RpcVoiceAgentReport=require(_0xa96e('0x5'));function Acw(_0x4d92a8){this[_0xa96e('0x6')]=_0x4d92a8['voiceQueues'];this[_0xa96e('0x7')]=_0x4d92a8[_0xa96e('0x7')];this['timers']=_0x4d92a8[_0xa96e('0x8')];this[_0xa96e('0x9')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xa96e('0xa')](this));ami['on'](_0xa96e('0xb'),this['syncHangupRequest'][_0xa96e('0xa')](this));ami['on'](_0xa96e('0xc'),this['syncHangup'][_0xa96e('0xa')](this));ami['on']('agentringnoanswer',this[_0xa96e('0xd')]['bind'](this));ami['on']('attendedtransfer',this[_0xa96e('0xe')][_0xa96e('0xa')](this));ami['on'](_0xa96e('0xf'),this[_0xa96e('0x10')][_0xa96e('0xa')](this));ami['on'](_0xa96e('0x11'),this[_0xa96e('0x12')][_0xa96e('0xa')](this));}function getDiff(_0x3e5984){var _0x45fcbf=moment()[_0xa96e('0x13')](0x0);var _0x3d252e=moment(_0x3e5984)[_0xa96e('0x13')](0x0);return _0x45fcbf[_0xa96e('0x14')](_0x3d252e,_0xa96e('0x15'));}Acw[_0xa96e('0x16')]['startAcw']=function(_0x71a0bd){try{var _0x14267a=this;var _0x49343c=this[_0xa96e('0x9')][_0x71a0bd]['interface'];var _0xb293e3=this[_0xa96e('0x9')][_0x71a0bd][_0xa96e('0x17')];var _0x20293f=this[_0xa96e('0x6')][_0xb293e3];var _0x4596b0=![];var _0x5b174b=_0xa96e('0x18');if(_0x20293f[_0xa96e('0x19')]){if(_0x20293f[_0xa96e('0x1a')][_0xa96e('0x1b')]){_0x4596b0=!![];_0x5b174b=_0x20293f['mandatoryDispositionPause'][_0xa96e('0x1b')];}}ami[_0xa96e('0x1c')]({'action':_0xa96e('0x1d'),'interface':_0x49343c,'paused':!![],'reason':_0x5b174b})['then'](function(_0x54ca0a){if(_0x14267a[_0xa96e('0x7')][_0x49343c]){return RpcUser['getAgent'](_0x14267a[_0xa96e('0x7')][_0x49343c]['id'])[_0xa96e('0x1e')](function(_0x2f460b){if(_0x2f460b&&!_0x2f460b['voicePause']){logger[_0xa96e('0x1f')](_0xa96e('0x20'),_0x71a0bd,_0x49343c,_0xb293e3);return RpcUser['savePause'](_0x14267a[_0xa96e('0x7')][_0x49343c],_0x5b174b,_0x71a0bd)['then'](function(_0x4caf1e){if(!_0x4596b0){_0x14267a['timers'][_0x49343c]={};logger[_0xa96e('0x1f')](_0xa96e('0x21'),_0x71a0bd,_0x14267a[_0xa96e('0x6')][_0xb293e3]['acwTimeout'],_0x49343c,_0xb293e3);_0x14267a[_0xa96e('0x8')][_0x49343c][_0xa96e('0x22')]=setTimeout(_0x14267a[_0xa96e('0x23')][_0xa96e('0xa')](_0x14267a,_0x49343c),_0x14267a['voiceQueues'][_0xb293e3][_0xa96e('0x24')]*0x3e8);_0x14267a[_0xa96e('0x8')][_0x49343c][_0xa96e('0x25')]=_0x4caf1e[_0xa96e('0x25')];_0x14267a['timers'][_0x49343c][_0xa96e('0x26')]=_0x71a0bd;_0x14267a['timers'][_0x49343c][_0xa96e('0x17')]=_0xb293e3;_0x14267a[_0xa96e('0x8')][_0x49343c][_0xa96e('0x27')]=function(){var _0x41a88d=getDiff(_0x14267a[_0xa96e('0x8')][_0x49343c][_0xa96e('0x25')]);clearTimeout(_0x14267a[_0xa96e('0x8')][_0x49343c][_0xa96e('0x22')]);RpcVoiceAgentReport[_0xa96e('0x28')]({'acwtime':_0x41a88d},_0x14267a[_0xa96e('0x8')][_0x49343c][_0xa96e('0x26')],_0x49343c)[_0xa96e('0x1e')](function(_0x33984a){logger[_0xa96e('0x1f')](_0xa96e('0x29'),_0x71a0bd,_0x41a88d,_0x33984a);})[_0xa96e('0x2a')](function(_0x5c6916){logger[_0xa96e('0x2b')](_0xa96e('0x2c'),_0x71a0bd,_0x5c6916);});delete _0x14267a[_0xa96e('0x8')][_0x49343c];};}});}else{logger['info'](_0xa96e('0x2d'),_0x71a0bd,_0x49343c,_0xb293e3);}});}})[_0xa96e('0x2a')](function(_0x3aa63a){logger[_0xa96e('0x2b')](_0xa96e('0x21'),_0x71a0bd,_0x14267a[_0xa96e('0x6')][_0xb293e3]['acwTimeout'],_0x49343c,_0xb293e3);})[_0xa96e('0x2e')](function(){delete _0x14267a[_0xa96e('0x9')][_0x71a0bd];});}catch(_0x2ee476){logger[_0xa96e('0x2b')]('[ACW][START]\x20%s',_0x2ee476[_0xa96e('0x2f')]);}};Acw[_0xa96e('0x16')][_0xa96e('0x23')]=function(_0x1c958c){try{var _0x2f94af=this;if(_0x2f94af[_0xa96e('0x8')][_0x1c958c]){var _0x3be993=_0x2f94af[_0xa96e('0x8')][_0x1c958c][_0xa96e('0x26')];var _0x2ec10e=_0x2f94af[_0xa96e('0x8')][_0x1c958c][_0xa96e('0x17')];var _0x18946d=_0x2f94af['voiceQueues'][_0x2ec10e][_0xa96e('0x24')];logger[_0xa96e('0x1f')](_0xa96e('0x30'),_0x1c958c);RpcUser[_0xa96e('0x31')](this[_0xa96e('0x7')][_0x1c958c]);RpcVoiceAgentReport['update']({'acwtime':_0x18946d,'agentacw':!![]},_0x3be993,_0x1c958c)[_0xa96e('0x1e')](function(_0x2e220e){logger[_0xa96e('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x3be993,_0x18946d,_0x2e220e);})[_0xa96e('0x2a')](function(_0x39167e){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x3be993,_0x39167e);});}else{logger[_0xa96e('0x2b')](_0xa96e('0x32'),_0x1c958c);if(_0x2f94af[_0xa96e('0x8')]){logger[_0xa96e('0x1f')](_0xa96e('0x33'),JSON[_0xa96e('0x34')](_0x2f94af[_0xa96e('0x8')]));}}}catch(_0x1582a8){logger[_0xa96e('0x2b')](_0xa96e('0x35'),_0x1582a8[_0xa96e('0x2f')]);}};Acw['prototype'][_0xa96e('0x36')]=function(_0x409c07){try{if(this[_0xa96e('0x6')][_0x409c07['queue']]&&(this[_0xa96e('0x6')][_0x409c07[_0xa96e('0x17')]]['acw']||this['voiceQueues'][_0x409c07[_0xa96e('0x17')]]['mandatoryDisposition'])){if(this[_0xa96e('0x7')][_0x409c07['interface']]){this[_0xa96e('0x9')][_0x409c07[_0xa96e('0x26')]]={'queue':_0x409c07[_0xa96e('0x17')],'interface':_0x409c07[_0xa96e('0x37')]};}}}catch(_0x56b6c5){logger[_0xa96e('0x2b')](_0xa96e('0x38'),_0x56b6c5['message']);}};Acw[_0xa96e('0x16')][_0xa96e('0x12')]=function(_0x5c4ff9){try{if(this[_0xa96e('0x6')][_0x5c4ff9[_0xa96e('0x17')]]&&(this['voiceQueues'][_0x5c4ff9[_0xa96e('0x17')]]['acw']||this[_0xa96e('0x6')][_0x5c4ff9['queue']][_0xa96e('0x19')])){if(this[_0xa96e('0x7')][_0x5c4ff9[_0xa96e('0x37')]]){this['channels'][_0x5c4ff9['uniqueid']]={'queue':_0x5c4ff9[_0xa96e('0x17')],'interface':_0x5c4ff9['interface']};}}}catch(_0x58f22b){logger[_0xa96e('0x2b')]('[ACW][syncAgentConnectPreview]\x20%s',_0x58f22b[_0xa96e('0x2f')]);}};Acw[_0xa96e('0x16')]['syncHangupRequest']=function(_0x2615f1){try{if(this[_0xa96e('0x9')][_0x2615f1['uniqueid']]&&_['isUndefined'](this[_0xa96e('0x9')][_0x2615f1[_0xa96e('0x26')]][_0xa96e('0x39')])){logger[_0xa96e('0x1f')](_0xa96e('0x3a'),_0x2615f1[_0xa96e('0x26')]);this[_0xa96e('0x3b')](_0x2615f1[_0xa96e('0x26')]);}else if(this[_0xa96e('0x9')][_0x2615f1[_0xa96e('0x3c')]]&&_[_0xa96e('0x3d')](this[_0xa96e('0x9')][_0x2615f1[_0xa96e('0x3c')]][_0xa96e('0x39')])){logger['info'](_0xa96e('0x3e'),_0x2615f1[_0xa96e('0x3c')]);this['startAcw'](_0x2615f1[_0xa96e('0x3c')]);}}catch(_0x395b78){logger[_0xa96e('0x2b')](_0xa96e('0x3f'),_0x395b78[_0xa96e('0x2f')]);}};Acw['prototype'][_0xa96e('0x40')]=function(_0xdba3ef){try{if(this[_0xa96e('0x9')][_0xdba3ef[_0xa96e('0x26')]]&&this[_0xa96e('0x9')][_0xdba3ef[_0xa96e('0x26')]]['attended']){logger[_0xa96e('0x1f')](_0xa96e('0x41'),_0xdba3ef[_0xa96e('0x26')]);this[_0xa96e('0x3b')](_0xdba3ef[_0xa96e('0x26')]);}else if(this[_0xa96e('0x9')][_0xdba3ef[_0xa96e('0x3c')]]&&this[_0xa96e('0x9')][_0xdba3ef[_0xa96e('0x3c')]][_0xa96e('0x39')]){logger[_0xa96e('0x1f')](_0xa96e('0x42'),_0xdba3ef[_0xa96e('0x3c')]);this[_0xa96e('0x3b')](_0xdba3ef[_0xa96e('0x3c')]);}}catch(_0x34909c){logger['error'](_0xa96e('0x43'),_0x34909c[_0xa96e('0x2f')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x1abdac){try{if(!_[_0xa96e('0x44')](this['channels'][_0x1abdac[_0xa96e('0x45')]])){this[_0xa96e('0x3b')](_0x1abdac[_0xa96e('0x45')]);if(this[_0xa96e('0x9')][_0x1abdac[_0xa96e('0x46')]]){this['channels'][_0x1abdac[_0xa96e('0x46')]][_0xa96e('0x39')]=!![];this[_0xa96e('0x9')][_0x1abdac['transfertargetuniqueid']]=this[_0xa96e('0x9')][_0x1abdac['secondtransfereruniqueid']];delete this[_0xa96e('0x9')][_0x1abdac[_0xa96e('0x46')]];}}else if(!_[_0xa96e('0x44')](this[_0xa96e('0x9')][_0x1abdac['transfertargetuniqueid']])){this['startAcw'](_0x1abdac['transfertargetuniqueid']);if(this['channels'][_0x1abdac[_0xa96e('0x47')]]){this[_0xa96e('0x9')][_0x1abdac[_0xa96e('0x47')]][_0xa96e('0x39')]=!![];this[_0xa96e('0x9')][_0x1abdac['transfereeuniqueid']]=this[_0xa96e('0x9')][_0x1abdac[_0xa96e('0x47')]];delete this[_0xa96e('0x9')][_0x1abdac[_0xa96e('0x47')]];}}}catch(_0x266705){logger[_0xa96e('0x2b')](_0xa96e('0x48'),_0x266705[_0xa96e('0x2f')]);}};Acw[_0xa96e('0x16')][_0xa96e('0x10')]=function(_0x3099bf){try{if(this[_0xa96e('0x9')][_0x3099bf[_0xa96e('0x49')]]){logger['info'](_0xa96e('0x4a'),JSON[_0xa96e('0x34')](_0x3099bf[_0xa96e('0x49')]));this[_0xa96e('0x3b')](_0x3099bf[_0xa96e('0x49')]);}else if(this[_0xa96e('0x9')][_0x3099bf[_0xa96e('0x4b')]]){logger[_0xa96e('0x1f')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xa96e('0x34')](_0x3099bf[_0xa96e('0x4b')]));this[_0xa96e('0x3b')](_0x3099bf[_0xa96e('0x4b')]);}}catch(_0x20bf6a){logger[_0xa96e('0x2b')](_0xa96e('0x4c'),_0x20bf6a[_0xa96e('0x2f')]);}};Acw[_0xa96e('0x16')][_0xa96e('0xd')]=function(_0x2b6b4e){try{if(this['voiceQueues'][_0x2b6b4e[_0xa96e('0x17')]]&&this[_0xa96e('0x6')][_0x2b6b4e[_0xa96e('0x17')]][_0xa96e('0x4d')]===_0xa96e('0x4e')){if(this[_0xa96e('0x7')][_0x2b6b4e[_0xa96e('0x37')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x2b6b4e[_0xa96e('0x26')],_0x2b6b4e['interface'],_0x2b6b4e[_0xa96e('0x17')]);return RpcUser[_0xa96e('0x4f')](this['agents'][_0x2b6b4e['interface']],_0xa96e('0x50'),_0x2b6b4e[_0xa96e('0x26')]);}}}catch(_0x199ee1){logger[_0xa96e('0x2b')](_0xa96e('0x51'),_0x199ee1[_0xa96e('0x2f')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index c675e0b..08bd8e1 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 _0x28b0=['info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','catch','asterisk-manager','moment','util','ami','../../config/environment','port','asterisk','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels'];(function(_0x3ee3aa,_0x5ca639){var _0x2a1a14=function(_0x5562bb){while(--_0x5562bb){_0x3ee3aa['push'](_0x3ee3aa['shift']());}};_0x2a1a14(++_0x5ca639);}(_0x28b0,0x10e));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require(_0x028b('0x0'));var BPromise=require('bluebird');var moment=require(_0x028b('0x1'));var util=require(_0x028b('0x2'));var _=require('lodash');var logger=require('../../config/logger')(_0x028b('0x3'));var config=require(_0x028b('0x4'));var ami=new Manager(config['asterisk'][_0x028b('0x5')],config[_0x028b('0x6')]['ip'],config[_0x028b('0x6')][_0x028b('0x7')],config[_0x028b('0x6')][_0x028b('0x8')],!![]);ami[_0x028b('0x9')]();ami[_0x028b('0xa')]=BPromise[_0x028b('0xb')](ami[_0x028b('0xc')]);function error(_0x1c2d03){logger[_0x028b('0xd')](util[_0x028b('0xe')](_0x028b('0xf'),config[_0x028b('0x6')][_0x028b('0x7')],config[_0x028b('0x6')]['ip'],config['asterisk']['port'],util[_0x028b('0x10')](_0x1c2d03,![],null)));}function close(){logger[_0x028b('0xd')](util[_0x028b('0xe')](_0x028b('0x11'),config['asterisk'][_0x028b('0x7')],config[_0x028b('0x6')]['ip'],config['asterisk'][_0x028b('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x028b('0xa')]({'action':_0x028b('0x12')});};};ami[_0x028b('0x13')]=function(){return function(){return ami[_0x028b('0xa')]({'action':_0x028b('0x14')});};};ami[_0x028b('0x15')]=function(){return function(){return ami[_0x028b('0xa')]({'action':_0x028b('0x16')});};};ami[_0x028b('0x17')]=function(){return function(){return ami[_0x028b('0xa')]({'action':_0x028b('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x028b('0xa')]({'action':_0x028b('0x19')});};};function connect(_0x4b4a98){logger[_0x028b('0x1a')](util[_0x028b('0xe')](_0x028b('0x1b'),config[_0x028b('0x6')][_0x028b('0x7')],config[_0x028b('0x6')]['ip'],config[_0x028b('0x6')][_0x028b('0x5')]));ami[_0x028b('0x1c')](_0x028b('0xd'),error);ami[_0x028b('0x1c')](_0x028b('0x1d'),close);}ami['on'](_0x028b('0x1e'),connect);ami['on'](_0x028b('0x1f'),function(_0x2d04ea){logger[_0x028b('0x1a')](util['format'](_0x028b('0x20'),config[_0x028b('0x6')][_0x028b('0x7')],config[_0x028b('0x6')]['ip'],config['asterisk'][_0x028b('0x5')],util[_0x028b('0x10')](_0x2d04ea,![],null)));});ami['on'](_0x028b('0x21'),function(_0x50a11a){logger[_0x028b('0x1a')](util[_0x028b('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x028b('0x6')][_0x028b('0x7')],config['asterisk']['ip'],config[_0x028b('0x6')][_0x028b('0x5')]));return BPromise[_0x028b('0x22')]()['then'](ami['actionSipShowRegistry']())[_0x028b('0x23')](ami[_0x028b('0x13')]())[_0x028b('0x23')](ami[_0x028b('0x15')]())[_0x028b('0x23')](ami[_0x028b('0x17')]())[_0x028b('0x23')](ami['actionCoreShowChannels']())[_0x028b('0x24')](function(_0x495970){console['log'](_0x495970);});});ami[_0x028b('0x1c')](_0x028b('0xd'),error);ami[_0x028b('0x1c')](_0x028b('0x1d'),close);module['exports']=ami; \ No newline at end of file +var _0xea56=['lodash','../../config/logger','../../config/environment','asterisk','port','password','Action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','asterisk-manager','bluebird','moment','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xea56,0x178));var _0x6ea5=function(_0x42b707,_0x22e9c4){_0x42b707=_0x42b707-0x0;var _0x343135=_0xea56[_0x42b707];return _0x343135;};'use strict';var Manager=require(_0x6ea5('0x0'));var BPromise=require(_0x6ea5('0x1'));var moment=require(_0x6ea5('0x2'));var util=require(_0x6ea5('0x3'));var _=require(_0x6ea5('0x4'));var logger=require(_0x6ea5('0x5'))('ami');var config=require(_0x6ea5('0x6'));var ami=new Manager(config[_0x6ea5('0x7')][_0x6ea5('0x8')],config['asterisk']['ip'],config[_0x6ea5('0x7')]['username'],config[_0x6ea5('0x7')][_0x6ea5('0x9')],!![]);ami['keepConnected']();ami[_0x6ea5('0xa')]=BPromise['promisify'](ami['action']);function error(_0x43c274){logger[_0x6ea5('0xb')](util[_0x6ea5('0xc')](_0x6ea5('0xd'),config['asterisk'][_0x6ea5('0xe')],config[_0x6ea5('0x7')]['ip'],config[_0x6ea5('0x7')][_0x6ea5('0x8')],util[_0x6ea5('0xf')](_0x43c274,![],null)));}function close(){logger[_0x6ea5('0xb')](util['format'](_0x6ea5('0x10'),config[_0x6ea5('0x7')][_0x6ea5('0xe')],config[_0x6ea5('0x7')]['ip'],config[_0x6ea5('0x7')][_0x6ea5('0x8')]));}ami[_0x6ea5('0x11')]=function(){return function(){return ami[_0x6ea5('0xa')]({'action':_0x6ea5('0x12')});};};ami[_0x6ea5('0x13')]=function(){return function(){return ami[_0x6ea5('0xa')]({'action':_0x6ea5('0x14')});};};ami[_0x6ea5('0x15')]=function(){return function(){return ami['Action']({'action':_0x6ea5('0x16')});};};ami[_0x6ea5('0x17')]=function(){return function(){return ami[_0x6ea5('0xa')]({'action':_0x6ea5('0x18')});};};ami[_0x6ea5('0x19')]=function(){return function(){return ami[_0x6ea5('0xa')]({'action':_0x6ea5('0x1a')});};};function connect(_0x2aea26){logger['info'](util['format'](_0x6ea5('0x1b'),config[_0x6ea5('0x7')][_0x6ea5('0xe')],config[_0x6ea5('0x7')]['ip'],config['asterisk']['port']));ami[_0x6ea5('0x1c')](_0x6ea5('0xb'),error);ami['once'](_0x6ea5('0x1d'),close);}ami['on']('connect',connect);ami['on'](_0x6ea5('0x1e'),function(_0x5185e3){logger[_0x6ea5('0x1f')](util['format'](_0x6ea5('0x20'),config[_0x6ea5('0x7')][_0x6ea5('0xe')],config[_0x6ea5('0x7')]['ip'],config[_0x6ea5('0x7')][_0x6ea5('0x8')],util[_0x6ea5('0xf')](_0x5185e3,![],null)));});ami['on'](_0x6ea5('0x21'),function(_0x3123a){logger[_0x6ea5('0x1f')](util[_0x6ea5('0xc')](_0x6ea5('0x22'),config[_0x6ea5('0x7')][_0x6ea5('0xe')],config[_0x6ea5('0x7')]['ip'],config[_0x6ea5('0x7')][_0x6ea5('0x8')]));return BPromise[_0x6ea5('0x23')]()[_0x6ea5('0x24')](ami[_0x6ea5('0x11')]())['then'](ami['actionDeviceStateList']())[_0x6ea5('0x24')](ami['actionSipPeerStatus']())[_0x6ea5('0x24')](ami['actionQueueSummary']())[_0x6ea5('0x24')](ami[_0x6ea5('0x19')]())[_0x6ea5('0x25')](function(_0x18f9df){console['log'](_0x18f9df);});});ami[_0x6ea5('0x1c')](_0x6ea5('0xb'),error);ami['once'](_0x6ea5('0x1d'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index b121b47..e007317 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 _0x1501=['Request','request','then','debug','rpc','memberReport','error','message','result','catch','exports','bluebird','client','http'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x1501,0x97));var _0x1150=function(_0x3535c6,_0xe0076d){_0x3535c6=_0x3535c6-0x0;var _0x3049c9=_0x1501[_0x3535c6];return _0x3049c9;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1150('0x0'));var logger=require('../../config/logger')('ami');var client=jayson[_0x1150('0x1')][_0x1150('0x2')]({'port':0x2329});client[_0x1150('0x3')]=function(_0x7a28cb,_0x5a2b22){return new BPromise(function(_0x431e8c,_0x59570e){return client[_0x1150('0x4')](_0x7a28cb,_0x5a2b22)[_0x1150('0x5')](function(_0x22629f){logger[_0x1150('0x6')](_0x1150('0x7'),_0x1150('0x8'),_0x7a28cb,_0x5a2b22,_0x22629f);if(_0x22629f[_0x1150('0x9')]){logger[_0x1150('0x9')](_0x1150('0x7'),_0x1150('0x8'),_0x7a28cb,_0x22629f['error']['message'],_0x5a2b22);return _0x59570e(_0x22629f[_0x1150('0x9')][_0x1150('0xa')]);}else{return _0x431e8c(_0x22629f[_0x1150('0xb')]);}})[_0x1150('0xc')](function(_0x1257d5){logger[_0x1150('0x9')](_0x1150('0x7'),_0x1150('0x8'),_0x7a28cb,_0x1257d5,_0x5a2b22);return _0x59570e(_0x1257d5);});});};module[_0x1150('0xd')]=client; \ No newline at end of file +var _0xb40f=['client','http','Request','request','then','debug','error','message','result','catch','memberReport','exports','jayson/promise','bluebird','../../config/logger','ami'];(function(_0x3402ef,_0x1381af){var _0xc97caf=function(_0xf4ea5f){while(--_0xf4ea5f){_0x3402ef['push'](_0x3402ef['shift']());}};_0xc97caf(++_0x1381af);}(_0xb40f,0x19c));var _0xfb40=function(_0xc753c8,_0x5627ff){_0xc753c8=_0xc753c8-0x0;var _0xd02f5c=_0xb40f[_0xc753c8];return _0xd02f5c;};'use strict';var jayson=require(_0xfb40('0x0'));var BPromise=require(_0xfb40('0x1'));var logger=require(_0xfb40('0x2'))(_0xfb40('0x3'));var client=jayson[_0xfb40('0x4')][_0xfb40('0x5')]({'port':0x2329});client[_0xfb40('0x6')]=function(_0x3f3c48,_0x32c800){return new BPromise(function(_0x433bf8,_0x37c48e){return client[_0xfb40('0x7')](_0x3f3c48,_0x32c800)[_0xfb40('0x8')](function(_0x46a66b){logger[_0xfb40('0x9')]('rpc','memberReport',_0x3f3c48,_0x32c800,_0x46a66b);if(_0x46a66b[_0xfb40('0xa')]){logger[_0xfb40('0xa')]('rpc','memberReport',_0x3f3c48,_0x46a66b['error'][_0xfb40('0xb')],_0x32c800);return _0x37c48e(_0x46a66b[_0xfb40('0xa')]['message']);}else{return _0x433bf8(_0x46a66b[_0xfb40('0xc')]);}})[_0xfb40('0xd')](function(_0x29a46b){logger[_0xfb40('0xa')]('rpc',_0xfb40('0xe'),_0x3f3c48,_0x29a46b,_0x32c800);return _0x37c48e(_0x29a46b);});});};module[_0xfb40('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 8d46823..5325c7d 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb248=['ContactId','ListId','VoiceQueueId','idHopper','ContactFirstName','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','moment','isNil','string','voiceQueue','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry'];(function(_0x17a86a,_0x3212ad){var _0x31e03f=function(_0x4294f1){while(--_0x4294f1){_0x17a86a['push'](_0x17a86a['shift']());}};_0x31e03f(++_0x3212ad);}(_0xb248,0xc6));var _0x8b24=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xb248[_0x279d37];return _0x530173;};'use strict';var util=require(_0x8b24('0x0'));var _=require('lodash');var moment=require(_0x8b24('0x1'));function checkNameSurname(_0x3099d3,_0x3c4dbd,_0x25eb0d){var _0x4eadf4='';if(!_[_0x8b24('0x2')](_0x3c4dbd)&&_0x8b24('0x3')===typeof _0x3c4dbd){_0x4eadf4+=_0x3c4dbd;}if(!_['isNil'](_0x25eb0d)&&_0x8b24('0x3')===typeof _0x25eb0d){_0x4eadf4+='\x20'+_0x25eb0d;}if(_0x4eadf4!==''){return _0x4eadf4;}return _0x3099d3;}function Action(_0x2b605d,_0x4cc3c4,_0x6da5b7){this[_0x8b24('0x4')]=_0x2b605d;this['uniqueid']=_0x6da5b7||undefined;this[_0x8b24('0x5')]=checkNameSurname(_0x4cc3c4['Contact'][_0x8b24('0x6')],_0x4cc3c4[_0x8b24('0x7')][_0x8b24('0x8')],_0x4cc3c4['Contact'][_0x8b24('0x9')]);this[_0x8b24('0xa')]=_0x4cc3c4[_0x8b24('0x7')][_0x8b24('0x6')];this[_0x8b24('0xb')]=_0x2b605d[_0x8b24('0x5')];this[_0x8b24('0xc')]=_0x4cc3c4[_0x8b24('0xc')]||![];this[_0x8b24('0xd')]=_0x2b605d[_0x8b24('0xd')];this[_0x8b24('0xe')]=_0x2b605d[_0x8b24('0xe')]||0x3;this[_0x8b24('0xf')]=_0x4cc3c4[_0x8b24('0xf')];this['countbusyretry']=_0x4cc3c4['countbusyretry'];this[_0x8b24('0x10')]=_0x4cc3c4[_0x8b24('0x10')];this[_0x8b24('0x11')]=_0x4cc3c4[_0x8b24('0x11')];this[_0x8b24('0x12')]=_0x4cc3c4[_0x8b24('0x12')];this[_0x8b24('0x13')]=_0x4cc3c4[_0x8b24('0x13')];this['UserId']=_0x4cc3c4['UserId'];this['VoiceQueueId']=_0x4cc3c4[_0x8b24('0x14')];this['CampaignId']=_0x4cc3c4['CampaignId'];this[_0x8b24('0x15')]=_0x4cc3c4['id'];this[_0x8b24('0x16')]=_0x4cc3c4['Contact'][_0x8b24('0x8')]||'';this['starttime']=moment()[_0x8b24('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8b24('0x18')]=_0x4cc3c4['callback'];this[_0x8b24('0x19')]=_0x4cc3c4[_0x8b24('0x19')];this[_0x8b24('0x1a')]=_0x4cc3c4[_0x8b24('0x1a')];this[_0x8b24('0x1b')]=_0x4cc3c4[_0x8b24('0x1b')];this[_0x8b24('0x1c')]='';this['originatecalleridname']='';}Action[_0x8b24('0x1d')][_0x8b24('0x1e')]=function(){return util['format'](_0x8b24('0x1f'),this[_0x8b24('0x5')],this[_0x8b24('0x4')][_0x8b24('0x20')]>0x0?this[_0x8b24('0xa')][_0x8b24('0x21')](this[_0x8b24('0x4')][_0x8b24('0x20')]):this[_0x8b24('0xa')]);};Action[_0x8b24('0x1d')][_0x8b24('0x22')]=function(){return this[_0x8b24('0xb')];};module[_0x8b24('0x23')]=Action; \ No newline at end of file +var _0x30c4=['util','lodash','moment','string','isNil','Contact','phone','firstName','number','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','voiceQueue','substring','getQueue','queue'];(function(_0xd6ddab,_0x3f700e){var _0x81549e=function(_0x405c71){while(--_0x405c71){_0xd6ddab['push'](_0xd6ddab['shift']());}};_0x81549e(++_0x3f700e);}(_0x30c4,0x1c8));var _0x430c=function(_0x5c43c8,_0x43be6f){_0x5c43c8=_0x5c43c8-0x0;var _0x5be097=_0x30c4[_0x5c43c8];return _0x5be097;};'use strict';var util=require(_0x430c('0x0'));var _=require(_0x430c('0x1'));var moment=require(_0x430c('0x2'));function checkNameSurname(_0x5360d1,_0x5e1e94,_0x437ccb){var _0x20f098='';if(!_['isNil'](_0x5e1e94)&&_0x430c('0x3')===typeof _0x5e1e94){_0x20f098+=_0x5e1e94;}if(!_[_0x430c('0x4')](_0x437ccb)&&_0x430c('0x3')===typeof _0x437ccb){_0x20f098+='\x20'+_0x437ccb;}if(_0x20f098!==''){return _0x20f098;}return _0x5360d1;}function Action(_0x4fde3e,_0x294f3c,_0x4ce74d){this['voiceQueue']=_0x4fde3e;this['uniqueid']=_0x4ce74d||undefined;this['name']=checkNameSurname(_0x294f3c[_0x430c('0x5')][_0x430c('0x6')],_0x294f3c[_0x430c('0x5')][_0x430c('0x7')],_0x294f3c[_0x430c('0x5')]['lastName']);this[_0x430c('0x8')]=_0x294f3c[_0x430c('0x5')][_0x430c('0x6')];this['queue']=_0x4fde3e[_0x430c('0x9')];this[_0x430c('0xa')]=_0x294f3c['active']||![];this[_0x430c('0xb')]=_0x4fde3e['type'];this[_0x430c('0xc')]=_0x4fde3e[_0x430c('0xc')]||0x3;this[_0x430c('0xd')]=_0x294f3c[_0x430c('0xd')];this['countbusyretry']=_0x294f3c[_0x430c('0xe')];this[_0x430c('0xf')]=_0x294f3c[_0x430c('0xf')];this[_0x430c('0x10')]=_0x294f3c['countnoanswerretry'];this[_0x430c('0x11')]=_0x294f3c[_0x430c('0x11')];this[_0x430c('0x12')]=_0x294f3c[_0x430c('0x12')];this[_0x430c('0x13')]=_0x294f3c['UserId'];this['VoiceQueueId']=_0x294f3c[_0x430c('0x14')];this[_0x430c('0x15')]=_0x294f3c[_0x430c('0x15')];this[_0x430c('0x16')]=_0x294f3c['id'];this[_0x430c('0x17')]=_0x294f3c[_0x430c('0x5')][_0x430c('0x7')]||'';this[_0x430c('0x18')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x430c('0x19')]=_0x294f3c[_0x430c('0x19')];this[_0x430c('0x1a')]=_0x294f3c[_0x430c('0x1a')];this[_0x430c('0x1b')]=_0x294f3c[_0x430c('0x1b')];this[_0x430c('0x1c')]=_0x294f3c[_0x430c('0x1c')];this[_0x430c('0x1d')]='';this[_0x430c('0x1e')]='';}Action[_0x430c('0x1f')]['getCaller']=function(){return util[_0x430c('0x20')](_0x430c('0x21'),this[_0x430c('0x9')],this[_0x430c('0x22')]['dialCutDigit']>0x0?this[_0x430c('0x8')][_0x430c('0x23')](this[_0x430c('0x22')]['dialCutDigit']):this[_0x430c('0x8')]);};Action[_0x430c('0x1f')][_0x430c('0x24')]=function(){return this[_0x430c('0x25')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 22b5e41..16d07c6 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ebe=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','Answer','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','answertime','talktime','callback','callbackuniqueid'];(function(_0x5b5f04,_0x82d4d7){var _0x5244d6=function(_0x2c1157){while(--_0x2c1157){_0x5b5f04['push'](_0x5b5f04['shift']());}};_0x5244d6(++_0x82d4d7);}(_0x1ebe,0xa2));var _0xe1eb=function(_0x5541a1,_0x1d6b25){_0x5541a1=_0x5541a1-0x0;var _0x5f41db=_0x1ebe[_0x5541a1];return _0x5f41db;};'use strict';var util=require(_0xe1eb('0x0'));var _=require(_0xe1eb('0x1'));var moment=require('moment');function getSeconds(_0x2e0907,_0x182119){var _0x452535=moment(_0x2e0907)[_0xe1eb('0x2')](0x0);var _0x629faa=moment(_0x182119)[_0xe1eb('0x2')](0x0);return _0x452535['diff'](_0x629faa,_0xe1eb('0x3'));}function AgentComplete(_0x4ec36d,_0x2e8c4f){this['state']=0x4;this['statedesc']=_0xe1eb('0x4');this[_0xe1eb('0x5')]=_0x4ec36d[_0xe1eb('0x5')];this['type']=_0x4ec36d['type'];this[_0xe1eb('0x6')]=_0x4ec36d[_0xe1eb('0x7')]===_0xe1eb('0x8')?_0xe1eb('0x9'):_0x4ec36d[_0xe1eb('0x7')];this[_0xe1eb('0xa')]=_0x4ec36d[_0xe1eb('0xa')];this[_0xe1eb('0xb')]=_0x4ec36d[_0xe1eb('0xb')];this[_0xe1eb('0xc')]=_0x4ec36d[_0xe1eb('0xc')];this[_0xe1eb('0xd')]=_0x4ec36d['countbusyretry']+_0x4ec36d[_0xe1eb('0xb')]+_0x4ec36d['countnoanswerretry'];this[_0xe1eb('0xe')]=_0x2e8c4f[_0xe1eb('0xe')];this[_0xe1eb('0xf')]=_0x4ec36d[_0xe1eb('0x10')];this[_0xe1eb('0x11')]=_0x4ec36d[_0xe1eb('0x12')];this[_0xe1eb('0x13')]=_0x4ec36d[_0xe1eb('0x13')];this['responsetime']=_0x4ec36d[_0xe1eb('0x14')];this['answertime']=_0x4ec36d['answertime'];this[_0xe1eb('0x15')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xe1eb('0x16')]=getSeconds(_0x4ec36d[_0xe1eb('0x14')],_0x4ec36d[_0xe1eb('0x13')]);this[_0xe1eb('0x17')]=getSeconds(_0x4ec36d[_0xe1eb('0x18')],_0x4ec36d[_0xe1eb('0x14')]);this[_0xe1eb('0x19')]=getSeconds(this[_0xe1eb('0x15')],_0x4ec36d[_0xe1eb('0x18')]);this[_0xe1eb('0x9')]=_0x2e8c4f[_0xe1eb('0x9')];this['membername']=_0x2e8c4f['membername'];this['reason']=_0x2e8c4f['reason'];this[_0xe1eb('0x1a')]=_0x4ec36d['callback'];this[_0xe1eb('0x1b')]=_0x4ec36d[_0xe1eb('0x1b')];this[_0xe1eb('0x1c')]=_0x4ec36d[_0xe1eb('0x1c')];this[_0xe1eb('0x1d')]=_0x4ec36d[_0xe1eb('0x1d')];this['ContactId']=_0x4ec36d[_0xe1eb('0x1e')];this['ListId']=_0x4ec36d[_0xe1eb('0x1f')];this[_0xe1eb('0x20')]=_0x4ec36d[_0xe1eb('0x20')];this[_0xe1eb('0x21')]=_0x4ec36d[_0xe1eb('0x21')];this[_0xe1eb('0x22')]=_0x4ec36d['CampaignId'];this[_0xe1eb('0x23')]=_0x4ec36d['originatecalleridnum']||'';this[_0xe1eb('0x24')]=_0x4ec36d[_0xe1eb('0x24')]||'';}module[_0xe1eb('0x25')]=AgentComplete; \ No newline at end of file +var _0x8540=['holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0xb1ef86,_0x3fce79){var _0xb46750=function(_0x179291){while(--_0x179291){_0xb1ef86['push'](_0xb1ef86['shift']());}};_0xb46750(++_0x3fce79);}(_0x8540,0x19e));var _0x0854=function(_0x2c69a1,_0x201903){_0x2c69a1=_0x2c69a1-0x0;var _0x24bb91=_0x8540[_0x2c69a1];return _0x24bb91;};'use strict';var util=require(_0x0854('0x0'));var _=require('lodash');var moment=require(_0x0854('0x1'));function getSeconds(_0x12646f,_0x1cda0e){var _0x5c571e=moment(_0x12646f)[_0x0854('0x2')](0x0);var _0x22b2f6=moment(_0x1cda0e)[_0x0854('0x2')](0x0);return _0x5c571e['diff'](_0x22b2f6,_0x0854('0x3'));}function AgentComplete(_0x48b946,_0x3ec403){this[_0x0854('0x4')]=0x4;this[_0x0854('0x5')]='Answer';this[_0x0854('0x6')]=_0x48b946[_0x0854('0x6')];this['type']=_0x48b946[_0x0854('0x7')];this[_0x0854('0x8')]=_0x48b946['type']===_0x0854('0x9')?_0x0854('0xa'):_0x48b946[_0x0854('0x7')];this[_0x0854('0xb')]=_0x48b946[_0x0854('0xb')];this['countcongestionretry']=_0x48b946['countcongestionretry'];this[_0x0854('0xc')]=_0x48b946['countnoanswerretry'];this[_0x0854('0xd')]=_0x48b946[_0x0854('0xb')]+_0x48b946[_0x0854('0xe')]+_0x48b946[_0x0854('0xc')];this[_0x0854('0xf')]=_0x3ec403[_0x0854('0xf')];this[_0x0854('0x10')]=_0x48b946[_0x0854('0x11')];this['calleridnum']=_0x48b946[_0x0854('0x12')];this[_0x0854('0x13')]=_0x48b946[_0x0854('0x13')];this[_0x0854('0x14')]=_0x48b946[_0x0854('0x14')];this[_0x0854('0x15')]=_0x48b946[_0x0854('0x15')];this[_0x0854('0x16')]=moment()[_0x0854('0x17')](_0x0854('0x18'));this[_0x0854('0x19')]=getSeconds(_0x48b946['responsetime'],_0x48b946[_0x0854('0x13')]);this[_0x0854('0x1a')]=getSeconds(_0x48b946[_0x0854('0x15')],_0x48b946[_0x0854('0x14')]);this[_0x0854('0x1b')]=getSeconds(this[_0x0854('0x16')],_0x48b946[_0x0854('0x15')]);this['queue']=_0x3ec403[_0x0854('0xa')];this['membername']=_0x3ec403['membername'];this[_0x0854('0x1c')]=_0x3ec403[_0x0854('0x1c')];this[_0x0854('0x1d')]=_0x48b946['callback'];this[_0x0854('0x1e')]=_0x48b946[_0x0854('0x1e')];this[_0x0854('0x1f')]=_0x48b946[_0x0854('0x1f')];this[_0x0854('0x20')]=_0x48b946[_0x0854('0x20')];this['ContactId']=_0x48b946[_0x0854('0x21')];this['ListId']=_0x48b946[_0x0854('0x22')];this[_0x0854('0x23')]=_0x48b946[_0x0854('0x23')];this[_0x0854('0x24')]=_0x48b946[_0x0854('0x24')];this[_0x0854('0x25')]=_0x48b946[_0x0854('0x25')];this[_0x0854('0x26')]=_0x48b946['originatecalleridnum']||'';this['originatecalleridname']=_0x48b946[_0x0854('0x27')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index baa7793..2e73203 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa456=['type','campaigntype','outbound','countbusyretry','countcongestionretry','countglobal','queue','calleridname','calleridnum','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat'];(function(_0x21cc6c,_0x4ef81c){var _0x4daa33=function(_0x3ac6d3){while(--_0x3ac6d3){_0x21cc6c['push'](_0x21cc6c['shift']());}};_0x4daa33(++_0x4ef81c);}(_0xa456,0x142));var _0x6a45=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xa456[_0x22b68a];return _0x1ac67a;};'use strict';var util=require(_0x6a45('0x0'));var _=require(_0x6a45('0x1'));var moment=require(_0x6a45('0x2'));function getSeconds(_0xd5464e,_0x587626){var _0x3bfbe6=moment(_0xd5464e)[_0x6a45('0x3')](0x0);var _0x3f7448=moment(_0x587626)['milliseconds'](0x0);return _0x3bfbe6[_0x6a45('0x4')](_0x3f7448,_0x6a45('0x5'));}function Final(_0x1e5882){this[_0x6a45('0x6')]=_0x1e5882['uniqueid'];this[_0x6a45('0x7')]=_0x1e5882[_0x6a45('0x7')];this[_0x6a45('0x8')]=_0x1e5882[_0x6a45('0x8')];this[_0x6a45('0x9')]=_0x1e5882['type']===_0x6a45('0xa')?'queue':_0x1e5882[_0x6a45('0x8')];this[_0x6a45('0xb')]=_0x1e5882[_0x6a45('0xb')];this[_0x6a45('0xc')]=_0x1e5882[_0x6a45('0xc')];this['countnoanswerretry']=_0x1e5882['countnoanswerretry'];this[_0x6a45('0xd')]=_0x1e5882[_0x6a45('0xb')]+_0x1e5882['countcongestionretry']+_0x1e5882['countnoanswerretry'];this['queue']=_0x1e5882[_0x6a45('0xe')];this[_0x6a45('0xf')]=_0x1e5882[_0x6a45('0xf')];this[_0x6a45('0x10')]=_0x1e5882[_0x6a45('0x10')];this['starttime']=_0x1e5882['starttime'];this[_0x6a45('0x11')]=_0x1e5882[_0x6a45('0x11')];this['endtime']=_0x1e5882[_0x6a45('0x11')];this[_0x6a45('0x12')]=_0x1e5882[_0x6a45('0x12')]||0x0;this[_0x6a45('0x13')]=_0x1e5882['holdtime']||0x0;this['talktime']=_0x1e5882['talktime']||0x0;this[_0x6a45('0x14')]=_0x1e5882[_0x6a45('0x14')];this[_0x6a45('0x15')]=_0x1e5882['callbackuniqueid'];this[_0x6a45('0x16')]=_0x1e5882[_0x6a45('0x16')];this[_0x6a45('0x17')]=_0x1e5882['recallme'];this['ContactId']=_0x1e5882['ContactId'];this[_0x6a45('0x18')]=_0x1e5882[_0x6a45('0x18')];this['UserId']=_0x1e5882[_0x6a45('0x19')];this[_0x6a45('0x1a')]=_0x1e5882['VoiceQueueId'];this[_0x6a45('0x1b')]=_0x1e5882[_0x6a45('0x1b')];this[_0x6a45('0x1c')]=_0x1e5882[_0x6a45('0x1c')]||'';this[_0x6a45('0x1d')]=_0x1e5882['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file +var _0x0295=['exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','campaigntype','outbound','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','queue','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x59b439,_0x14ae7b){var _0x521ea3=function(_0x5af627){while(--_0x5af627){_0x59b439['push'](_0x59b439['shift']());}};_0x521ea3(++_0x14ae7b);}(_0x0295,0x1f0));var _0x5029=function(_0x5b1f65,_0x1b5cb4){_0x5b1f65=_0x5b1f65-0x0;var _0x290cc6=_0x0295[_0x5b1f65];return _0x290cc6;};'use strict';var util=require(_0x5029('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x2dfab1,_0x4f552a){var _0x53c2e1=moment(_0x2dfab1)[_0x5029('0x1')](0x0);var _0x36335d=moment(_0x4f552a)[_0x5029('0x1')](0x0);return _0x53c2e1[_0x5029('0x2')](_0x36335d,_0x5029('0x3'));}function Final(_0x69a497){this[_0x5029('0x4')]=_0x69a497[_0x5029('0x4')];this[_0x5029('0x5')]=_0x69a497['scheduledat'];this['type']=_0x69a497['type'];this[_0x5029('0x6')]=_0x69a497['type']===_0x5029('0x7')?'queue':_0x69a497[_0x5029('0x8')];this['countbusyretry']=_0x69a497[_0x5029('0x9')];this[_0x5029('0xa')]=_0x69a497[_0x5029('0xa')];this['countnoanswerretry']=_0x69a497[_0x5029('0xb')];this[_0x5029('0xc')]=_0x69a497[_0x5029('0x9')]+_0x69a497['countcongestionretry']+_0x69a497[_0x5029('0xb')];this[_0x5029('0xd')]=_0x69a497['queue'];this['calleridname']=_0x69a497['calleridname'];this['calleridnum']=_0x69a497[_0x5029('0xe')];this[_0x5029('0xf')]=_0x69a497[_0x5029('0xf')];this[_0x5029('0x10')]=_0x69a497[_0x5029('0x10')];this[_0x5029('0x11')]=_0x69a497[_0x5029('0x10')];this[_0x5029('0x12')]=_0x69a497[_0x5029('0x12')]||0x0;this[_0x5029('0x13')]=_0x69a497[_0x5029('0x13')]||0x0;this[_0x5029('0x14')]=_0x69a497[_0x5029('0x14')]||0x0;this[_0x5029('0x15')]=_0x69a497[_0x5029('0x15')];this['callbackuniqueid']=_0x69a497[_0x5029('0x16')];this[_0x5029('0x17')]=_0x69a497[_0x5029('0x17')];this[_0x5029('0x18')]=_0x69a497[_0x5029('0x18')];this[_0x5029('0x19')]=_0x69a497[_0x5029('0x19')];this['ListId']=_0x69a497[_0x5029('0x1a')];this['UserId']=_0x69a497[_0x5029('0x1b')];this[_0x5029('0x1c')]=_0x69a497[_0x5029('0x1c')];this[_0x5029('0x1d')]=_0x69a497['CampaignId'];this['originatecalleridnum']=_0x69a497[_0x5029('0x1e')]||'';this['originatecalleridname']=_0x69a497[_0x5029('0x1f')]||'';}module[_0x5029('0x20')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 2b66c53..ea90122 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x4424a2,_0xccf230){var _0x75bbc1=function(_0x3c0375){while(--_0x3c0375){_0x4424a2['push'](_0x4424a2['shift']());}};_0x75bbc1(++_0xccf230);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file +var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x11c7d3,_0x47fe03){var _0x351767=function(_0x41d8d9){while(--_0x41d8d9){_0x11c7d3['push'](_0x11c7d3['shift']());}};_0x351767(++_0x47fe03);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 0c81f64..19e30ba 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fe3=['ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callbackuniqueid','callbackat','recallme'];(function(_0x5a0677,_0x568052){var _0x40ef2e=function(_0x101f88){while(--_0x101f88){_0x5a0677['push'](_0x5a0677['shift']());}};_0x40ef2e(++_0x568052);}(_0x0fe3,0xd3));var _0x30fe=function(_0xd740db,_0x4ec35a){_0xd740db=_0xd740db-0x0;var _0x10243d=_0x0fe3[_0xd740db];return _0x10243d;};'use strict';var util=require(_0x30fe('0x0'));var _=require(_0x30fe('0x1'));var moment=require(_0x30fe('0x2'));function getSeconds(_0x76a0fa,_0x4fa926){var _0xc64ef9=moment(_0x76a0fa)[_0x30fe('0x3')](0x0);var _0x53e44=moment(_0x4fa926)['milliseconds'](0x0);return _0xc64ef9[_0x30fe('0x4')](_0x53e44,_0x30fe('0x5'));}function History(_0x3ecabd){this['uniqueid']=_0x3ecabd[_0x30fe('0x6')];this[_0x30fe('0x7')]=_0x3ecabd[_0x30fe('0x7')]||undefined;this[_0x30fe('0x8')]=_0x3ecabd[_0x30fe('0x8')];this[_0x30fe('0x9')]=_0x3ecabd['type']===_0x30fe('0xa')?_0x30fe('0xb'):_0x3ecabd[_0x30fe('0x8')];this[_0x30fe('0xc')]=_0x3ecabd['countbusyretry'];this[_0x30fe('0xd')]=_0x3ecabd[_0x30fe('0xd')];this['countnoanswerretry']=_0x3ecabd[_0x30fe('0xe')];this['countglobal']=_0x3ecabd[_0x30fe('0xc')]+_0x3ecabd[_0x30fe('0xd')]+_0x3ecabd['countnoanswerretry'];this['queue']=_0x3ecabd[_0x30fe('0xb')];this[_0x30fe('0xf')]=_0x3ecabd[_0x30fe('0x10')];this[_0x30fe('0x11')]=_0x3ecabd[_0x30fe('0x12')];this[_0x30fe('0x13')]=_0x3ecabd[_0x30fe('0x13')];this[_0x30fe('0x14')]=_0x3ecabd[_0x30fe('0x14')];this[_0x30fe('0x15')]=_0x3ecabd[_0x30fe('0x14')];this[_0x30fe('0x16')]=getSeconds(_0x3ecabd[_0x30fe('0x14')],_0x3ecabd[_0x30fe('0x13')]);this['holdtime']=0x0;this[_0x30fe('0x17')]=0x0;this['callback']=_0x3ecabd['callback'];this[_0x30fe('0x18')]=_0x3ecabd['callbackuniqueid'];this[_0x30fe('0x19')]=_0x3ecabd['callbackat'];this[_0x30fe('0x1a')]=_0x3ecabd[_0x30fe('0x1a')];this[_0x30fe('0x1b')]=_0x3ecabd['ContactId'];this['ListId']=_0x3ecabd[_0x30fe('0x1c')];this[_0x30fe('0x1d')]=_0x3ecabd['UserId'];this['VoiceQueueId']=_0x3ecabd['VoiceQueueId'];this[_0x30fe('0x1e')]=_0x3ecabd[_0x30fe('0x1e')];this[_0x30fe('0x1f')]=_0x3ecabd[_0x30fe('0x1f')]||'';this[_0x30fe('0x20')]=_0x3ecabd[_0x30fe('0x20')]||'';}module[_0x30fe('0x21')]=History; \ No newline at end of file +var _0x8675=['countnoanswerretry','countglobal','calleridname','calleridnum','number','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','moment','milliseconds','seconds','uniqueid','type','campaigntype','queue','countbusyretry'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8675,0xcf));var _0x5867=function(_0x84293f,_0x1b4173){_0x84293f=_0x84293f-0x0;var _0x15a611=_0x8675[_0x84293f];return _0x15a611;};'use strict';var util=require(_0x5867('0x0'));var _=require('lodash');var moment=require(_0x5867('0x1'));function getSeconds(_0x5750a2,_0x1c49a7){var _0x395bb4=moment(_0x5750a2)[_0x5867('0x2')](0x0);var _0x21eadb=moment(_0x1c49a7)[_0x5867('0x2')](0x0);return _0x395bb4['diff'](_0x21eadb,_0x5867('0x3'));}function History(_0x5971c4){this[_0x5867('0x4')]=_0x5971c4[_0x5867('0x4')];this['scheduledat']=_0x5971c4['scheduledat']||undefined;this[_0x5867('0x5')]=_0x5971c4['type'];this[_0x5867('0x6')]=_0x5971c4['type']==='outbound'?_0x5867('0x7'):_0x5971c4[_0x5867('0x5')];this[_0x5867('0x8')]=_0x5971c4[_0x5867('0x8')];this['countcongestionretry']=_0x5971c4['countcongestionretry'];this[_0x5867('0x9')]=_0x5971c4[_0x5867('0x9')];this[_0x5867('0xa')]=_0x5971c4[_0x5867('0x8')]+_0x5971c4['countcongestionretry']+_0x5971c4[_0x5867('0x9')];this[_0x5867('0x7')]=_0x5971c4['queue'];this[_0x5867('0xb')]=_0x5971c4['name'];this[_0x5867('0xc')]=_0x5971c4[_0x5867('0xd')];this['starttime']=_0x5971c4[_0x5867('0xe')];this['responsetime']=_0x5971c4[_0x5867('0xf')];this['endtime']=_0x5971c4[_0x5867('0xf')];this[_0x5867('0x10')]=getSeconds(_0x5971c4[_0x5867('0xf')],_0x5971c4[_0x5867('0xe')]);this[_0x5867('0x11')]=0x0;this['talktime']=0x0;this['callback']=_0x5971c4[_0x5867('0x12')];this['callbackuniqueid']=_0x5971c4[_0x5867('0x13')];this[_0x5867('0x14')]=_0x5971c4['callbackat'];this['recallme']=_0x5971c4[_0x5867('0x15')];this['ContactId']=_0x5971c4['ContactId'];this[_0x5867('0x16')]=_0x5971c4['ListId'];this[_0x5867('0x17')]=_0x5971c4[_0x5867('0x17')];this[_0x5867('0x18')]=_0x5971c4[_0x5867('0x18')];this[_0x5867('0x19')]=_0x5971c4[_0x5867('0x19')];this[_0x5867('0x1a')]=_0x5971c4[_0x5867('0x1a')]||'';this['originatecalleridname']=_0x5971c4['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 3a38747..c25b215 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 _0x4213=['dialCutDigit','xcally-motion-dialer','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','callProgressDetecting','checkRetriveMax','countbusyretry','dialGlobalMaxRetry','countnoanswerretry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','countcongestionretry','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','outboundNoAnswerCallsDay','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','floor','[startMethodPredictive][StartProgressive][First]','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Date]','dialPredictiveInterval','erlangCalls','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][LowerLimitInterval]','Agent\x20free','agent\x20max\x20free\x20','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','[startMethodPredictive][StartPredictive][First]','getDataPredictive','startMethodPredictive','[averageHandleTime][ErlangB]\x20','[startMethodPredictive][StartPredictive][Repeat]','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','erlangCallToSecond','[handlePredictive]','[startMethodPredictive][milliseconds]\x20','Failure\x20','checkContactBlack','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','handleIvr','limitCalls','temp','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','ACTIVE','tryOriginatePredictive','[actionOriginatePredictive]\x20','\x20m\x20=\x20','\x20p\x20=\x20','\x20Amax\x20=\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','[busyFactor]','\x20interval\x20=\x20','\x20Ts\x20=\x20','m\x20=\x20','p\x20=\x20','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','loopCampaigns','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','diff','emit','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','callerid','voice_queue:save','ivr','format','campaign:ivr:%s','info','[checkGetDataPredictive][avgTalktime]','predictiveIntervalAvgHoldtime','[checkGetDataPredictive][avgHoldtime]','[checkGetDataPredictive][totalCalls]','[checkGetDataPredictive][objIsEmpty]','[checkGetDataPredictive][obj]','milliseconds','seconds','isUndefined','[freeVariablesPredictive]','startPredictive','handlePredictive','preview','string','\x22%s\x22\x20<%s>','error','inspect','length','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','prototype','clearZombieChannels','uniqueId','[uniqueid]','actions','[actions]','hasOwnProperty','isNil','status','channel','catch','No\x20such\x20channel','type','updateOriginated','queue','[Dialer][checkChannel]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','emptyContact','notFound','saveInDb','merge','pick','ContactId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','dialAMDActive','value','HangupInAMD','membername','[syncHangupInAMD]','MACHINE','Machine','amd','[syncMachine][createHistory]','[syncMachine]','HANGUP','AMD','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','dropreason','CALLEREXIT','syncQueueMember','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','ListId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','CampaignId','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','pow','replace','random','match','actionOriginate','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','trim','substring'];(function(_0x165793,_0x14e19d){var _0x389102=function(_0x58c30d){while(--_0x58c30d){_0x165793['push'](_0x165793['shift']());}};_0x389102(++_0x14e19d);}(_0x4213,0x77));var _0x3421=function(_0x5123de,_0xdd1de4){_0x5123de=_0x5123de-0x0;var _0x3e6cc8=_0x4213[_0x5123de];return _0x3e6cc8;};'use strict';var util=require(_0x3421('0x0'));var _=require(_0x3421('0x1'));var BPromise=require(_0x3421('0x2'));var uuid=require(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var rr=require('rr');var md5=require(_0x3421('0x5'));var Redis=require(_0x3421('0x6'));var config=require('../../../config/environment/');var logger=require(_0x3421('0x7'))('dialer');var loggerBooked=require(_0x3421('0x7'))(_0x3421('0x8'));var loggerPredictive=require(_0x3421('0x7'))(_0x3421('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0x3421('0xa'));var loggerSyncQueueSummary=require(_0x3421('0x7'))(_0x3421('0xb'));var ami=require(_0x3421('0xc'));config[_0x3421('0xd')]=_['defaults'](config[_0x3421('0xd')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3421('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x3421('0xe'));var cmHopperHistory=require(_0x3421('0xf'));var cmHopperBlack=require(_0x3421('0x10'));var voiceQueueRt=require(_0x3421('0x11'));var Action=require(_0x3421('0x12'));var History=require(_0x3421('0x13'));var Final=require(_0x3421('0x14'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x3421('0x15'));var Hangup=require(_0x3421('0x16'));var ipAgi=process[_0x3421('0x17')][_0x3421('0x18')]||_0x3421('0x19');var strategy={'rrmemory':_0x3421('0x1a'),'roundrobin':_0x3421('0x1b')};var Sequence=function(){};Sequence['prototype'][_0x3421('0x1c')]=function(_0x4b5f43){this[_0x3421('0x1d')]=this[_0x3421('0x1d')]?this['tail'][_0x3421('0x1e')](_0x4b5f43):_0x4b5f43();};function Dialer(_0x4c6f7b,_0x16bc8f){this[_0x3421('0x1f')]=new Sequence();this['preview']=_0x16bc8f;this[_0x3421('0x20')]=_0x4c6f7b[_0x3421('0x20')];this[_0x3421('0x21')]=_0x4c6f7b[_0x3421('0x21')];this[_0x3421('0x22')]=_0x4c6f7b[_0x3421('0x22')];this[_0x3421('0x23')]=_0x4c6f7b[_0x3421('0x23')];this[_0x3421('0x24')]=config[_0x3421('0x24')]||0x2;this[_0x3421('0x25')]={};this['actions']={};this[_0x3421('0x26')]={};this['uniqueId']={};this['optionPredictive']={};this['startPredictive']={};this[_0x3421('0x27')]={};this[_0x3421('0x28')]={};this[_0x3421('0x29')]={};this[_0x3421('0x2a')]={};ami['on'](_0x3421('0x2b'),this[_0x3421('0x2c')][_0x3421('0x2d')](this));ami['on'](_0x3421('0x2e'),this[_0x3421('0x2f')][_0x3421('0x2d')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));ami['on'](_0x3421('0x30'),this[_0x3421('0x31')][_0x3421('0x2d')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x3421('0x2d')](this));ami['on']('hangup',this[_0x3421('0x32')]['bind'](this));ami['on'](_0x3421('0x33'),this[_0x3421('0x34')][_0x3421('0x2d')](this));ami['on'](_0x3421('0x35'),this[_0x3421('0x36')]['bind'](this));ami['on'](_0x3421('0x37'),this['syncQueueMember']['bind'](this));ami['on'](_0x3421('0x38'),this['syncQueueStatusComplete']['bind'](this));this[_0x3421('0x39')]();this['loopClearZombieChannels']();}function isNotNull(_0x20abc7){return _0x20abc7!==null&&!_['isUndefined'](_0x20abc7);}function checkIsLoggedIn(_0xc7f9fb,_0xbe9f09){return function(){if(_0xbe9f09<=0x0){_0xc7f9fb['message']=_0x3421('0x3a');throw _0xc7f9fb[_0x3421('0x3b')]+_0x3421('0x3c');}};}function isActive(_0x4a0ac7){return _0x4a0ac7;}function checkIsActive(_0x3a89b6,_0x50d61b){return function(){if(!isActive(_0x50d61b)){_0x3a89b6[_0x3421('0x3d')]=_0x3421('0x3e');throw _0x3a89b6[_0x3421('0x3b')]+_0x3421('0x3f');}};}function checkInterval(_0x3875c6){return function(){if(!isNotNull(_0x3875c6[_0x3421('0x40')])){_0x3875c6[_0x3421('0x3d')]=_0x3421('0x41');throw _0x3875c6[_0x3421('0x3b')]+_0x3421('0x42');}if(!isNotNull(_0x3875c6['Interval']['Intervals'])){_0x3875c6[_0x3421('0x3d')]=_0x3421('0x41');throw _0x3875c6['name']+_0x3421('0x42');}if(!isNotNull(_[_0x3421('0x43')](_0x3875c6[_0x3421('0x40')][_0x3421('0x44')]))){_0x3875c6[_0x3421('0x3d')]='INTERVAL_IS_NULL';throw _0x3875c6[_0x3421('0x3b')]+_0x3421('0x42');}};}function msgResponse(_0x20c27c,_0x5df941,_0xb7a512){return{'action':_0x20c27c,'response':_0x5df941,'message':_0xb7a512};}function myreject(_0x4ba1b9){return function(_0x137e98){return _0x4ba1b9(msgResponse(_0x3421('0x45'),_0x3421('0x46'),JSON[_0x3421('0x47')](_0x137e98)));};}function getSeconds(_0xe3aa89,_0x38f23b){var _0x22f45e=moment(_0xe3aa89)['milliseconds'](0x0);var _0x550596=moment(_0x38f23b)['milliseconds'](0x0);return _0x22f45e[_0x3421('0x48')](_0x550596,'seconds');}function emit(_0x5a56b8,_0xbe9181,_0x4e76e0){io['to'](_0x5a56b8)[_0x3421('0x49')](_0xbe9181,_0x4e76e0);}function emitVoiceQueueSummary(_0x9b983f){if(_0x9b983f['type']===_0x3421('0x4a')){var _0x3121aa={'id':_0x9b983f['id'],'name':_0x9b983f[_0x3421('0x3b')],'strategy':_0x9b983f[_0x3421('0x4b')],'answered':_0x9b983f['answered'],'available':_0x9b983f[_0x3421('0x4c')],'loggedIn':_0x9b983f[_0x3421('0x4d')],'pTalking':_0x9b983f[_0x3421('0x4e')],'sumBillable':_0x9b983f[_0x3421('0x4f')],'sumDuration':_0x9b983f[_0x3421('0x50')],'sumHoldTime':_0x9b983f['sumHoldTime']||0x0,'talking':_0x9b983f[_0x3421('0x51')],'total':_0x9b983f[_0x3421('0x52')],'type':_0x9b983f['type'],'unmanaged':_0x9b983f[_0x3421('0x53')],'abandoned':_0x9b983f['abandoned'],'waiting':_0x9b983f['waiting'],'loggedInDb':_0x9b983f['loggedInDb'],'dialActive':_0x9b983f[_0x3421('0x54')],'dialMethod':_0x9b983f[_0x3421('0x55')],'dialOriginateCallerIdName':_0x9b983f[_0x3421('0x56')],'dialOriginateCallerIdNumber':_0x9b983f[_0x3421('0x57')],'dialOriginateTimeout':_0x9b983f[_0x3421('0x58')],'dialPrefix':_0x9b983f[_0x3421('0x59')],'outboundAnswerAgiCallsDay':_0x9b983f[_0x3421('0x5a')],'outboundAnswerCallsDay':_0x9b983f[_0x3421('0x5b')],'outboundBlacklistCallsDay':_0x9b983f[_0x3421('0x5c')],'outboundBusyCallsDay':_0x9b983f[_0x3421('0x5d')],'outboundCongestionCallsDay':_0x9b983f[_0x3421('0x5e')],'outboundDropCallsDayACS':_0x9b983f[_0x3421('0x5f')],'outboundDropCallsDayCallersExit':_0x9b983f[_0x3421('0x60')],'outboundDropCallsDayTimeout':_0x9b983f[_0x3421('0x61')],'outboundNoAnswerCallsDay':_0x9b983f['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x9b983f[_0x3421('0x62')],'outboundOriginateFailureCallsDay':_0x9b983f[_0x3421('0x63')],'outboundReCallsDay':_0x9b983f[_0x3421('0x64')],'outboundRejectCallsDay':_0x9b983f[_0x3421('0x65')],'outboundUnknownCallsDay':_0x9b983f['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x9b983f[_0x3421('0x66')],'predictiveIntervalAvgHoldtime':_0x9b983f['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x9b983f[_0x3421('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0x9b983f[_0x3421('0x68')],'predictiveIntervalDroppedCallsTimeout':_0x9b983f[_0x3421('0x69')],'predictiveIntervalErlangCalls':_0x9b983f[_0x3421('0x6a')],'predictiveIntervalErlangCallsDroppedCalls':_0x9b983f[_0x3421('0x6b')],'predictiveIntervalHitRate':_0x9b983f[_0x3421('0x6c')],'predictiveIntervalLowerLimit':_0x9b983f[_0x3421('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x9b983f[_0x3421('0x6e')],'predictiveIntervalPauses':_0x9b983f[_0x3421('0x6f')],'predictiveIntervalTotalCalls':_0x9b983f[_0x3421('0x70')],'message':_0x9b983f[_0x3421('0x3d')],'originated':_0x9b983f[_0x3421('0x71')]};if(_0x9b983f[_0x3421('0x72')]){_0x3121aa['Trunk']={'id':_0x9b983f[_0x3421('0x72')]['id'],'name':_0x9b983f['Trunk'][_0x3421('0x3b')],'active':_0x9b983f[_0x3421('0x72')][_0x3421('0x73')],'callerid':_0x9b983f[_0x3421('0x72')][_0x3421('0x74')]};}if(_0x9b983f[_0x3421('0x40')]){_0x3121aa[_0x3421('0x40')]={'id':_0x9b983f[_0x3421('0x40')]['id'],'name':_0x9b983f[_0x3421('0x40')][_0x3421('0x3b')]};}var _0x4c65b4=md5(JSON[_0x3421('0x47')](_0x3121aa));if(_0x9b983f[_0x3421('0x5')]!==_0x4c65b4){_0x9b983f[_0x3421('0x5')]=_0x4c65b4;emit(util['format']('voice:queue:%s',_0x3121aa[_0x3421('0x3b')]),_0x3421('0x75'),_0x3121aa);}}}function emitCampaignSummary(_0x16ac86){if(_0x16ac86['type']===_0x3421('0x76')){emit(util[_0x3421('0x77')](_0x3421('0x78'),_0x16ac86[_0x3421('0x3b')]),'campaign:save',_0x16ac86);}}function checkGetDataPredictive(_0x99523d){if(isNotNull(_0x99523d)){if(!_[_0x3421('0x43')](_0x99523d)){if(_0x99523d[_0x3421('0x70')]>0x0){if(!_['isUndefined'](_0x99523d['predictiveIntervalAvgTalktime'])&&_0x99523d['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x3421('0x79')](_0x3421('0x7a'),JSON['stringify'](_0x99523d));}if(!_['isUndefined'](_0x99523d[_0x3421('0x7b')])&&_0x99523d[_0x3421('0x7b')]>0x0){return!![];}else{loggerPredictive[_0x3421('0x79')](_0x3421('0x7c'),JSON[_0x3421('0x47')](_0x99523d));}}else{loggerPredictive['info'](_0x3421('0x7d'),JSON[_0x3421('0x47')](_0x99523d));}}else{loggerPredictive[_0x3421('0x79')](_0x3421('0x7e'),JSON['stringify'](_0x99523d));}}else{loggerPredictive[_0x3421('0x79')](_0x3421('0x7f'),JSON[_0x3421('0x47')](_0x99523d));}return![];}function mergeDataErlangB(_0x48a967){return function(_0x5f97d5){loggerPredictive['info']('[ErlangB]',JSON[_0x3421('0x47')](_0x5f97d5));_['merge'](_0x48a967,_0x5f97d5);};}function getDiff(_0x4e33a0){var _0x7e0c6c=moment()[_0x3421('0x80')](0x0);var _0x4cf96e=moment(_0x4e33a0)[_0x3421('0x80')](0x0);return _0x7e0c6c[_0x3421('0x48')](_0x4cf96e,_0x3421('0x81'));}function ifInterval(_0x3a398c,_0x1c73b9){if(_[_0x3421('0x82')](_0x1c73b9)){return![];}if(getDiff(_0x1c73b9)<_0x3a398c*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x4e1103){if(isNotNull(_0x4e1103)){if(!_[_0x3421('0x82')](_0x4e1103[_0x3421('0x27')])){_0x4e1103['startProgressive']=undefined;loggerPredictive[_0x3421('0x79')](_0x3421('0x83'),'startProgressive',_0x4e1103[_0x3421('0x3b')]);}if(!_[_0x3421('0x82')](_0x4e1103[_0x3421('0x84')])){_0x4e1103['startPredictive']=undefined;loggerPredictive[_0x3421('0x79')](_0x3421('0x83'),_0x3421('0x84'),_0x4e1103[_0x3421('0x3b')]);}if(!_[_0x3421('0x82')](_0x4e1103[_0x3421('0x85')])){clearInterval(_0x4e1103[_0x3421('0x85')]);_0x4e1103[_0x3421('0x85')]=undefined;loggerPredictive[_0x3421('0x79')](_0x3421('0x83'),_0x3421('0x85'),_0x4e1103[_0x3421('0x3b')]);}}}function erlangb(_0x5ac16a,_0x10be7c){if(_0x10be7c===0x0){return 0x0;}var _0x3a8883=0x1;for(var _0x4820d3=0x1;_0x4820d3<=_0x10be7c;_0x4820d3+=0x1){_0x3a8883=0x1+_0x3a8883*_0x4820d3/_0x5ac16a;}return 0x1/_0x3a8883;}function isVoiceQueueOutbound(_0x3f942c){return _0x3f942c===_0x3421('0x4a');}function isNotPreview(_0x3fce62){return _0x3fce62!==_0x3421('0x86');}function isCampaignIvr(_0x1813c9){return _0x1813c9===_0x3421('0x76');}function getCallerId(_0x32c9a7,_0x374a6a,_0x5d6488){if(!_[_0x3421('0x82')](_0x5d6488)&&'string'===typeof _0x5d6488&&!_[_0x3421('0x43')](_0x5d6488)){if(!_[_0x3421('0x82')](_0x374a6a)&&_0x3421('0x87')===typeof _0x374a6a&&!_[_0x3421('0x43')](_0x374a6a)){return util['format'](_0x3421('0x88'),_0x374a6a,_0x5d6488);}return util[_0x3421('0x77')](_0x3421('0x88'),_0x5d6488,_0x5d6488);}if(!_[_0x3421('0x82')](_0x32c9a7)&&_0x3421('0x87')===typeof _0x32c9a7&&!_[_0x3421('0x43')](_0x32c9a7)){return _0x32c9a7;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x8a35b5,_0x1d23f1){return function(_0x1e9971){freeVariablesPredictive(_0x1d23f1);emitVoiceQueueSummary(_0x1d23f1);emitCampaignSummary(_0x1d23f1);loggerSyncQueueSummary[_0x3421('0x89')](_0x8a35b5,util[_0x3421('0x8a')](_0x1e9971,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1ba5e1,_0x102119){return function(_0x3d7c9a){loggerPredictive['error'](_0x1ba5e1,JSON[_0x3421('0x47')](_0x3d7c9a));freeVariablesPredictive(_0x102119);};}function loggerCatch(_0x46717b){return function(_0x200958){logger[_0x3421('0x89')](_0x46717b,util[_0x3421('0x8a')](_0x200958,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4b6a98){return _0x4b6a98&&!_['isUndefined'](_0x4b6a98)&&_0x4b6a98[_0x3421('0x8b')]>0x0;}function decremetOriginate(_0x103d84){if(!_[_0x3421('0x82')](_0x103d84)&&_0x103d84!==null){if(_0x103d84['hasOwnProperty'](_0x3421('0x71'))){if(_0x103d84['originated']>0x0){_0x103d84[_0x3421('0x71')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x4fd786,_0x326b54,_0x2039b1){if(_0x326b54>_0x2039b1){for(var _0x2f64a4=0x0;_0x2f64a4<_0x326b54-_0x2039b1;_0x2f64a4+=0x1){decremetOriginate(_0x4fd786);}}}function loggerGetContactDialer(_0x994444,_0xa05828,_0x3ccb08){return function(_0x231067){checkContactLowerLimitOriginate(_0xa05828,_0x3ccb08,0x0);logger[_0x3421('0x89')](_0x994444,util[_0x3421('0x8a')](_0x231067,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x464226){return function(_0x5c7a78){if(isNotNull(_0x5c7a78)&&isNotNull(_0x5c7a78[0x0])){if(_0x5c7a78[0x0][_0x3421('0x8c')]>0x0){_0x464226['message']=_0x3421('0x8d');logger[_0x3421('0x79')](_0x3421('0x8e')+_0x464226[_0x3421('0x3b')],_0x5c7a78[0x0][_0x3421('0x8c')],_0x3421('0x8f'));}else{_0x464226[_0x3421('0x3d')]=_0x3421('0x90');logger[_0x3421('0x79')]('[getContactDialer2][Empty]'+_0x464226[_0x3421('0x3b')]);}}};}function notSendMessagesQueue(_0x14516b){if(_0x14516b[_0x3421('0x91')]){freeVariablesPredictive(_0x14516b);if(_0x14516b['originated']===0x0&&_0x14516b['talking']===0x0&&_0x14516b['waiting']===0x0&&(_0x14516b['pTalking']||0x0)===0x0){_0x14516b[_0x3421('0x91')]=![];_0x14516b['available']=0x0;_0x14516b[_0x3421('0x3d')]=_0x3421('0x3e');loggerSyncQueueSummary[_0x3421('0x89')](_0x3421('0x92'),_0x14516b['name'],_0x3421('0x93'));}else{_0x14516b[_0x3421('0x3d')]=_0x3421('0x94');loggerSyncQueueSummary[_0x3421('0x89')](_0x3421('0x92'),_0x14516b[_0x3421('0x3b')],'is\x20disactive');}emitVoiceQueueSummary(_0x14516b);}}function notSendMessagesCampaign(_0x234ab2){if(_0x234ab2[_0x3421('0x91')]){if(_0x234ab2[_0x3421('0x71')]===0x0){_0x234ab2[_0x3421('0x91')]=![];_0x234ab2[_0x3421('0x3d')]=_0x3421('0x3e');loggerSyncQueueSummary[_0x3421('0x89')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x234ab2['name'],_0x3421('0x93'));}else{_0x234ab2[_0x3421('0x3d')]=_0x3421('0x94');loggerSyncQueueSummary['error'](_0x3421('0x95'),_0x234ab2['name'],_0x3421('0x96'));}emitCampaignSummary(_0x234ab2);}}function createObjHistory(_0x5349d6,_0x402195,_0x2c0d90,_0x188929,_0x226e58){_0x5349d6[_0x3421('0x3d')]=_0x2c0d90;var _0x1c8863=new Action(_0x5349d6,_0x402195);var _0x202655=new History(_0x1c8863);_0x202655[_0x3421('0x97')]=_0x188929;_0x202655[_0x3421('0x98')]=_0x226e58;_0x202655[_0x3421('0x99')]=_0x1c8863[_0x3421('0x9a')];return _0x202655;}Dialer[_0x3421('0x9b')]['loopClearZombieChannels']=function(){var _0x321335=this;setInterval(function(){_0x321335[_0x3421('0x9c')](_0x321335[_0x3421('0x9d')],_0x3421('0x9e'));_0x321335[_0x3421('0x9c')](_0x321335[_0x3421('0x9f')],_0x3421('0xa0'));},0x32c8);};Dialer[_0x3421('0x9b')]['clearZombieChannels']=function(_0x4539e0,_0x507282){var _0x4d92ed=this;for(var _0x47c38d in _0x4539e0){if(_0x4539e0[_0x3421('0xa1')](_0x47c38d)){this[_0x3421('0x1f')][_0x3421('0x1c')](function(){if(!_[_0x3421('0xa2')](_0x4539e0[_0x47c38d])){return ami['Action']({'action':_0x3421('0xa3'),'channel':_0x4539e0[_0x47c38d][_0x3421('0xa4')]})[_0x3421('0xa5')](function(_0x1e2abf){if(_0x1e2abf[_0x3421('0x3d')]===_0x3421('0xa6')){setTimeout(function(){if(_0x4539e0[_0x47c38d]&&_0x4539e0[_0x47c38d][_0x3421('0xa7')]!==_0x3421('0x76')){_0x4d92ed[_0x3421('0xa8')](_0x4d92ed[_0x3421('0x20')][_0x4539e0[_0x47c38d][_0x3421('0xa9')]]);logger[_0x3421('0x89')](_0x3421('0xaa'),_0x507282,_0x47c38d,_0x4539e0[_0x47c38d][_0x3421('0xa9')]);delete _0x4539e0[_0x47c38d];}if(_0x4539e0[_0x47c38d]&&_0x4539e0[_0x47c38d][_0x3421('0xa7')]===_0x3421('0x76')){_0x4d92ed[_0x3421('0xa8')](_0x4d92ed['campaigns'][_0x4539e0[_0x47c38d]['queue']]);logger[_0x3421('0x89')]('[Dialer][checkChannel][ivr]',_0x507282,_0x47c38d,_0x4539e0[_0x47c38d][_0x3421('0xa9')]);delete _0x4539e0[_0x47c38d];}},0x2328);}});}});}}};Dialer[_0x3421('0x9b')]['countReScheduled']=function(_0x20e908){return BPromise[_0x3421('0xab')]()[_0x3421('0xac')](cmHopper[_0x3421('0xad')](_0x20e908))[_0x3421('0xa5')](loggerCatch(_0x3421('0xae')));};Dialer[_0x3421('0x9b')][_0x3421('0xaf')]=function(_0x22f76f){return BPromise[_0x3421('0xab')]()[_0x3421('0xac')](cmHopperBlack[_0x3421('0xaf')](_0x22f76f))[_0x3421('0xa5')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x3421('0x9b')]['checkIsBlackListIvr']=function(_0x14d3e0){return BPromise[_0x3421('0xab')]()['then'](cmHopperBlack[_0x3421('0xb0')](_0x14d3e0))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x3421('0x9b')][_0x3421('0xb1')]=function(_0x3e88fa){return BPromise['resolve']()[_0x3421('0xac')](cmHopperHistory[_0x3421('0xb2')](_0x3e88fa))[_0x3421('0xa5')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0x3421('0xb3')]=function(_0x79c393){return BPromise[_0x3421('0xab')]()[_0x3421('0xac')](cmHopper['rescheduleContact'](_0x79c393))[_0x3421('0xa5')](loggerCatch(_0x3421('0xb4')));};Dialer[_0x3421('0x9b')][_0x3421('0xb5')]=function(_0x307a4f,_0x2a9b12,_0x3e59e7,_0x3d6c3d){return BPromise['resolve']()[_0x3421('0xac')](cmHopper[_0x3421('0xb5')](_0x307a4f,_0x2a9b12,_0x3e59e7,_0x3d6c3d))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x3421('0x9b')][_0x3421('0xb6')]=function(_0x30c3d9,_0x1375cd,_0x35f118){return BPromise['resolve']()['then'](cmHopper[_0x3421('0xb6')](_0x30c3d9,_0x1375cd,_0x35f118))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x3421('0x9b')][_0x3421('0xb7')]=function(_0x3bf463){return BPromise[_0x3421('0xab')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x3bf463))[_0x3421('0xa5')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x3421('0xb8')]=function(_0x3fc2b6){return BPromise[_0x3421('0xab')]()['then'](cmHopper['moveContactManagedDialer'](_0x3fc2b6))['catch'](loggerCatch(_0x3421('0xb9')));};Dialer[_0x3421('0x9b')][_0x3421('0xba')]=function(_0x152282){return BPromise[_0x3421('0xab')]()[_0x3421('0xac')](cmHopperHistory[_0x3421('0xba')](_0x152282))['catch'](loggerCatch(_0x3421('0xbb')));};Dialer[_0x3421('0x9b')][_0x3421('0xa8')]=function(_0x24e418){if(!_[_0x3421('0x82')](_0x24e418)&&_0x24e418!==null){if(_0x24e418[_0x3421('0xa1')](_0x3421('0x71'))){if(_0x24e418[_0x3421('0x71')]>0x0){_0x24e418[_0x3421('0x71')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x3421('0x89')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x3421('0x9b')]['loggerHandler']=function(_0x16db2b,_0x3e015c){var _0x1decdf=this;return function(_0x264345){_0x1decdf[_0x3421('0xa8')](_0x3e015c);logger['error'](_0x16db2b,util['inspect'](_0x264345,{'showHidden':![],'depth':null}));};};Dialer[_0x3421('0x9b')][_0x3421('0xbc')]=function(_0x46c02e,_0x2198d2,_0x516dad){var _0xa399ed={'state':0x19,'statedesc':_0x3421('0xbd')};this[_0x3421('0xa8')](_0x2198d2);this[_0x3421('0xbe')](_[_0x3421('0xbf')](_0xa399ed,_[_0x3421('0xc0')](_0x516dad,[_0x3421('0xc1'),'ListId',_0x3421('0xc2'),_0x3421('0xc3'),'CampaignId'])),_0x3421('0xc4'),_0x3421('0xc5'));logger[_0x3421('0x89')](_0x46c02e);};Dialer['prototype'][_0x3421('0xc6')]=function(_0x1cc0d1){return _0x1cc0d1==='Success';};Dialer[_0x3421('0x9b')][_0x3421('0xc7')]=function(_0x281bfe){return!_[_0x3421('0x82')](_0x281bfe)&&_0x281bfe&&!_[_0x3421('0x82')](_0x281bfe[_0x3421('0x3b')])&&!_[_0x3421('0x82')](_0x281bfe[_0x3421('0x73')])&&_0x281bfe['active']&&(this[_0x3421('0x23')][util['format']('SIP/%s',_0x281bfe[_0x3421('0x3b')])][_0x3421('0xa3')]===_0x3421('0xc8')||this[_0x3421('0x23')][util['format'](_0x3421('0xc9'),_0x281bfe[_0x3421('0x3b')])][_0x3421('0xa3')]===_0x3421('0xca'));};Dialer[_0x3421('0x9b')][_0x3421('0xbe')]=function(_0xe3de53,_0x31814a,_0x18c232){this[_0x3421('0xba')](_0xe3de53)[_0x3421('0xa5')](loggerCatch(_0x31814a));this[_0x3421('0xb8')](_0xe3de53)[_0x3421('0xa5')](loggerCatch(_0x18c232));};Dialer[_0x3421('0x9b')][_0x3421('0x36')]=function(_0x1ddc33){var _0x15fff9=this[_0x3421('0x9d')][_0x1ddc33[_0x3421('0xcb')]];var _0x1adad8;if(!_[_0x3421('0xa2')](_0x1ddc33)&&!_['isNil'](_0x1ddc33['variable'])&&!_[_0x3421('0xa2')](_0x1ddc33[_0x3421('0xcc')][_0x3421('0xcd')])&&_0x1ddc33[_0x3421('0xce')]==='xcally-motion-dialer'&&_0x15fff9){if(_0x15fff9[_0x3421('0xa7')]!==_0x3421('0x76')&&this['voiceQueues'][_0x15fff9[_0x3421('0xa9')]][_0x3421('0xcf')]&&_0x1ddc33[_0x3421('0xd0')]==='HANGUP'){delete this[_0x3421('0x9d')][_0x1ddc33['uniqueid']];this[_0x3421('0xa8')](this[_0x3421('0x20')][_0x15fff9[_0x3421('0xa9')]]);this[_0x3421('0x20')][_0x15fff9[_0x3421('0xa9')]][_0x3421('0x5b')]+=0x1;this[_0x3421('0x20')][_0x15fff9['queue']][_0x3421('0x5a')]+=0x1;_0x1adad8=new Hangup(_0x15fff9,_0x1ddc33);_0x1adad8['state']=0x12;_0x1adad8['statedesc']=_0x3421('0xd1');_0x1adad8[_0x3421('0xd2')]='AMD';this[_0x3421('0xbe')](_0x1adad8,'[syncHangupInAMD][createHistory]',_0x3421('0xd3'));}if(_0x15fff9[_0x3421('0xa7')]!==_0x3421('0x76')&&this[_0x3421('0x20')][_0x15fff9[_0x3421('0xa9')]][_0x3421('0xcf')]&&_0x1ddc33[_0x3421('0xd0')]===_0x3421('0xd4')){delete this[_0x3421('0x9d')][_0x1ddc33[_0x3421('0xcb')]];this[_0x3421('0xa8')](this[_0x3421('0x20')][_0x15fff9['queue']]);this[_0x3421('0x20')][_0x15fff9['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x3421('0x20')][_0x15fff9[_0x3421('0xa9')]][_0x3421('0x5a')]+=0x1;_0x1adad8=new Hangup(_0x15fff9,_0x1ddc33);_0x1adad8[_0x3421('0x97')]=0x13;_0x1adad8['statedesc']=_0x3421('0xd5');_0x1adad8[_0x3421('0xd2')]='AMD';_0x1adad8[_0x3421('0xd6')]=!![];this['saveInDb'](_0x1adad8,_0x3421('0xd7'),_0x3421('0xd8'));}if(_0x15fff9[_0x3421('0xa7')]==='ivr'&&this[_0x3421('0x21')][_0x15fff9[_0x3421('0xa9')]][_0x3421('0xcf')]&&_0x1ddc33[_0x3421('0xd0')]===_0x3421('0xd9')){delete this[_0x3421('0x9d')][_0x1ddc33[_0x3421('0xcb')]];this[_0x3421('0xa8')](this['campaigns'][_0x15fff9[_0x3421('0xa9')]]);_0x1adad8=new Hangup(_0x15fff9,_0x1ddc33);_0x1adad8[_0x3421('0x97')]=0x12;_0x1adad8[_0x3421('0x98')]=_0x3421('0xd1');_0x1adad8[_0x3421('0xd2')]=_0x3421('0xda');this[_0x3421('0xbe')](_0x1adad8,'[syncHangupInAMDIvr][createHistory]',_0x3421('0xdb'));}if(_0x15fff9[_0x3421('0xa7')]==='ivr'&&this['campaigns'][_0x15fff9['queue']][_0x3421('0xcf')]&&_0x1ddc33[_0x3421('0xd0')]==='MACHINE'){delete this[_0x3421('0x9d')][_0x1ddc33[_0x3421('0xcb')]];this[_0x3421('0xa8')](this[_0x3421('0x21')][_0x15fff9[_0x3421('0xa9')]]);_0x1adad8=new Hangup(_0x15fff9,_0x1ddc33);_0x1adad8[_0x3421('0x97')]=0x13;_0x1adad8[_0x3421('0x98')]='Machine';_0x1adad8[_0x3421('0xd2')]=_0x3421('0xda');_0x1adad8[_0x3421('0xd6')]=!![];this[_0x3421('0xbe')](_0x1adad8,_0x3421('0xdc'),_0x3421('0xdd'));}}};Dialer['prototype'][_0x3421('0x32')]=function(_0x365550){var _0x48bb15=this[_0x3421('0x9d')][_0x365550[_0x3421('0xcb')]];var _0x25cc13=this;var _0xa359ab;if(_0x48bb15&&_0x48bb15[_0x3421('0xa7')]===_0x3421('0x76')){delete this[_0x3421('0x9d')][_0x365550[_0x3421('0xcb')]];this[_0x3421('0xa8')](this[_0x3421('0x21')][_0x48bb15['queue']]);this[_0x3421('0x21')][_0x48bb15[_0x3421('0xa9')]]['ivrAnswerCallsDay']+=0x1;_0xa359ab=new Hangup(_0x48bb15,_0x365550);this[_0x3421('0xba')](_0xa359ab)['catch'](loggerCatch(_0x3421('0xde')));this['moveContactManagedDialer'](_0xa359ab)['catch'](loggerCatch(_0x3421('0xdf')));}if(_0x48bb15&&_0x48bb15[_0x3421('0xa7')]!==_0x3421('0x76')&&isNotNull(this['voiceQueues'][_0x48bb15[_0x3421('0xa9')]][_0x3421('0xe0')])){delete this[_0x3421('0x9d')][_0x365550['uniqueid']];this[_0x3421('0xa8')](this[_0x3421('0x20')][_0x48bb15['queue']]);this['voiceQueues'][_0x48bb15[_0x3421('0xa9')]][_0x3421('0x5b')]+=0x1;this[_0x3421('0x20')][_0x48bb15[_0x3421('0xa9')]][_0x3421('0x5a')]+=0x1;_0xa359ab=new Hangup(_0x48bb15,_0x365550);_0xa359ab[_0x3421('0x97')]=0x10;_0xa359ab['statedesc']='AnswerAGI';_0xa359ab['membername']=_0x3421('0xe1');this[_0x3421('0xba')](_0xa359ab)[_0x3421('0xa5')](loggerCatch(_0x3421('0xde')));this[_0x3421('0xb8')](_0xa359ab)['catch'](loggerCatch(_0x3421('0xdf')));}if(_0x48bb15&&_0x48bb15[_0x3421('0xa7')]!==_0x3421('0x76')&&!isNotNull(this[_0x3421('0x20')][_0x48bb15[_0x3421('0xa9')]]['dialQueueProject'])){delete this[_0x3421('0x9d')][_0x365550['uniqueid']];this[_0x3421('0xa8')](this['voiceQueues'][_0x48bb15[_0x3421('0xa9')]]);this[_0x3421('0x20')][_0x48bb15[_0x3421('0xa9')]][_0x3421('0xe2')]+=0x1;_0xa359ab=new Hangup(_0x48bb15,_0x365550);_0xa359ab[_0x3421('0x97')]=0xc;_0xa359ab[_0x3421('0x98')]=_0x365550[_0x3421('0xe3')];_0xa359ab[_0x3421('0xd2')]='Unknow';this[_0x3421('0xba')](_0xa359ab)['catch'](loggerCatch(_0x3421('0xde')));this[_0x3421('0xb8')](_0xa359ab)[_0x3421('0xa5')](loggerCatch(_0x3421('0xdf')));}};Dialer[_0x3421('0x9b')]['syncAgentComplete']=function(_0x13f668){var _0x1540ba=this['uniqueId'][_0x13f668['uniqueid']];var _0x19dd3c=this;if(this[_0x3421('0x20')][_0x13f668['queue']]){if(_0x1540ba&&_0x1540ba['type']!==_0x3421('0x76')){delete this['uniqueId'][_0x13f668[_0x3421('0xcb')]];this[_0x3421('0x20')][_0x13f668['queue']]['outboundAnswerCallsDay']+=0x1;var _0x11e6ae=new AgentComplete(_0x1540ba,_0x13f668);if(_0x13f668[_0x3421('0xe4')]===_0x3421('0xe5')){_0x11e6ae[_0x3421('0xe6')]=this[_0x3421('0x20')][_0x13f668[_0x3421('0xa9')]][_0x3421('0xe7')]&&this[_0x3421('0x20')][_0x13f668['queue']][_0x3421('0xe8')]?moment()['format'](_0x3421('0xe9')):undefined;}this[_0x3421('0xba')](_0x11e6ae)[_0x3421('0xa5')](loggerCatch(_0x3421('0xea')));this[_0x3421('0xb8')](_0x11e6ae)[_0x3421('0xa5')](loggerCatch(_0x3421('0xeb')));}}};Dialer[_0x3421('0x9b')][_0x3421('0x2c')]=function(_0xd58b40){if(this[_0x3421('0x20')][_0xd58b40[_0x3421('0xa9')]]){if(this[_0x3421('0x9d')][_0xd58b40[_0x3421('0xcb')]]&&this['uniqueId'][_0xd58b40[_0x3421('0xcb')]]['type']!==_0x3421('0x76')){this['updateOriginated'](this['voiceQueues'][_0xd58b40[_0x3421('0xa9')]]);this[_0x3421('0x9d')][_0xd58b40[_0x3421('0xcb')]]['answertime']=moment()[_0x3421('0x77')](_0x3421('0xe9'));}}};Dialer[_0x3421('0x9b')][_0x3421('0xec')]=function(_0x25e394){this[_0x3421('0xba')](_0x25e394)[_0x3421('0xa5')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x25e394)['catch'](loggerCatch(_0x3421('0xed')));};Dialer[_0x3421('0x9b')][_0x3421('0x2f')]=function(_0x284cb1){var _0x109197=this[_0x3421('0x9d')][_0x284cb1[_0x3421('0xcb')]];var _0x2096b3=this;if(this[_0x3421('0x20')][_0x284cb1[_0x3421('0xa9')]]){if(_0x109197&&_0x109197[_0x3421('0xa7')]!==_0x3421('0x76')){delete this['uniqueId'][_0x284cb1['uniqueid']];this[_0x3421('0xa8')](this['voiceQueues'][_0x284cb1[_0x3421('0xa9')]]);_0x109197[_0x3421('0xee')]=moment()['format'](_0x3421('0xe9'));var _0x5a6f2f=new QueueCallerAbandon(_0x109197,_0x284cb1);if(getSeconds(_0x109197['droptime'],_0x109197[_0x3421('0xef')])>=_0x109197[_0x3421('0xf0')]){this[_0x3421('0x20')][_0x284cb1[_0x3421('0xa9')]][_0x3421('0x69')]+=0x1;this[_0x3421('0x20')][_0x284cb1[_0x3421('0xa9')]][_0x3421('0x61')]+=0x1;this[_0x3421('0x20')][_0x284cb1[_0x3421('0xa9')]][_0x3421('0x6b')]+=0x1;_0x5a6f2f[_0x3421('0x97')]=0xa;_0x5a6f2f[_0x3421('0x98')]='Drop';_0x5a6f2f[_0x3421('0xf1')]='TIMEOUT';_0x5a6f2f[_0x3421('0xe6')]=this[_0x3421('0x20')][_0x284cb1[_0x3421('0xa9')]][_0x3421('0xe7')]?moment()[_0x3421('0x77')](_0x3421('0xe9')):undefined;this[_0x3421('0xec')](_0x5a6f2f);}else{this['voiceQueues'][_0x284cb1['queue']][_0x3421('0x68')]+=0x1;this[_0x3421('0x20')][_0x284cb1[_0x3421('0xa9')]]['outboundDropCallsDayCallersExit']+=0x1;_0x5a6f2f[_0x3421('0x97')]=0xb;_0x5a6f2f[_0x3421('0x98')]='Abandoned';_0x5a6f2f[_0x3421('0xf1')]=_0x3421('0xf2');this[_0x3421('0xec')](_0x5a6f2f);}}}};Dialer['prototype'][_0x3421('0x34')]=function(_0x4340d0){if(this[_0x3421('0x9f')][_0x4340d0['uniqueid']]){this[_0x3421('0x9f')][_0x4340d0[_0x3421('0xcb')]][_0x3421('0xa4')]=_0x4340d0['channel'];}if(this[_0x3421('0x9d')][_0x4340d0['uniqueid']]){this[_0x3421('0x9d')][_0x4340d0[_0x3421('0xcb')]][_0x3421('0xa4')]=_0x4340d0[_0x3421('0xa4')];}};Dialer['prototype'][_0x3421('0xf3')]=function(_0x21b401){if(strategy[this['voiceQueues'][this[_0x3421('0x9f')][_0x21b401['actionid']][_0x3421('0xa9')]][_0x3421('0x4b')]]===_0x3421('0x1b')){if(this[_0x3421('0x9f')][_0x21b401[_0x3421('0xf4')]]&&_['isNil'](this[_0x3421('0x9f')][_0x21b401[_0x3421('0xf4')]][_0x3421('0xf5')])&&_0x21b401[_0x3421('0xa3')]==='1'&&_0x21b401[_0x3421('0xf6')]==='0'){if(this[_0x3421('0x22')][_0x21b401[_0x3421('0xf7')]]){if(!this[_0x3421('0x22')][_0x21b401[_0x3421('0xf7')]][_0x3421('0xf5')]){this[_0x3421('0x22')][_0x21b401[_0x3421('0xf7')]][_0x3421('0xf5')]=!![];this[_0x3421('0x9f')][_0x21b401[_0x3421('0xf4')]][_0x3421('0xf5')]=!![];this['actions'][_0x21b401[_0x3421('0xf4')]][_0x3421('0xf7')]=_0x21b401[_0x3421('0xf7')];}}}}else if((strategy[this[_0x3421('0x20')][this['actions'][_0x21b401['actionid']][_0x3421('0xa9')]][_0x3421('0x4b')]]||_0x3421('0x1a'))===_0x3421('0x1a')){if(this['actions'][_0x21b401[_0x3421('0xf4')]]){if(this[_0x3421('0x22')][_0x21b401['stateinterface']]){this[_0x3421('0x9f')][_0x21b401[_0x3421('0xf4')]][_0x3421('0xf7')]=_0x21b401[_0x3421('0xf7')];if(_[_0x3421('0xa2')](this[_0x3421('0x29')][this[_0x3421('0x9f')][_0x21b401[_0x3421('0xf4')]][_0x3421('0xa9')]])){this[_0x3421('0x29')][this[_0x3421('0x9f')][_0x21b401[_0x3421('0xf4')]]['queue']]=[];}this[_0x3421('0x29')][this[_0x3421('0x9f')][_0x21b401['actionid']][_0x3421('0xa9')]][_0x3421('0xf8')](_[_0x3421('0xbf')](_[_0x3421('0xc0')](this[_0x3421('0x9f')][_0x21b401[_0x3421('0xf4')]],[_0x3421('0xf9'),_0x3421('0xf7')]),{'status':_0x21b401[_0x3421('0xa3')],'paused':_0x21b401['paused']}));}}}};function unlockQueueStatus(_0x11d84b,_0x137f0a){setTimeout(function(){if(_[_0x3421('0x82')](_0x11d84b[_0x3421('0xfa')])){loggerBooked[_0x3421('0x89')](_0x3421('0xfb'),_0x137f0a);}_0x11d84b[_0x3421('0xfa')]=!![];loggerBooked[_0x3421('0x79')](_0x3421('0xfc'),_0x137f0a,JSON[_0x3421('0x47')](_[_0x3421('0xc0')](_0x11d84b,['name','queueStatusComplete'])));},0x1f3);}Dialer[_0x3421('0x9b')][_0x3421('0xfd')]=function(_0x1d23b6){var _0x313169=this;var _0x35daa1=_0x313169['voiceQueues'][_0x313169[_0x3421('0x9f')][_0x1d23b6[_0x3421('0xf4')]][_0x3421('0xa9')]];if(strategy[this[_0x3421('0x20')][this[_0x3421('0x9f')][_0x1d23b6['actionid']][_0x3421('0xa9')]][_0x3421('0x4b')]]===_0x3421('0x1b')){if(this['actions'][_0x1d23b6[_0x3421('0xf4')]]&&this['actions'][_0x1d23b6[_0x3421('0xf4')]][_0x3421('0xf7')]){this[_0x3421('0x86')][_0x3421('0xfe')](this['actions'][_0x1d23b6[_0x3421('0xf4')]]['idHopper'],this['actions'][_0x1d23b6[_0x3421('0xf4')]][_0x3421('0xf7')])[_0x3421('0xa5')](function(_0x59e9b8){logger[_0x3421('0x89')](_0x3421('0xff'),util[_0x3421('0x8a')](_0x59e9b8,{'showHidden':![],'depth':null}));})['finally'](function(){_0x313169[_0x3421('0xa8')](_0x313169[_0x3421('0x20')][_0x313169[_0x3421('0x9f')][_0x1d23b6[_0x3421('0xf4')]][_0x3421('0xa9')]]);_0x313169[_0x3421('0x22')][_0x313169['actions'][_0x1d23b6[_0x3421('0xf4')]][_0x3421('0xf7')]][_0x3421('0xf5')]=![];delete _0x313169[_0x3421('0x9f')][_0x1d23b6[_0x3421('0xf4')]];unlockQueueStatus(_0x35daa1);});}else{this[_0x3421('0xa8')](this[_0x3421('0x20')][this['actions'][_0x1d23b6['actionid']][_0x3421('0xa9')]]);this[_0x3421('0xb3')]({'active':![],'ContactId':this[_0x3421('0x9f')][_0x1d23b6['actionid']][_0x3421('0xc1')],'ListId':this[_0x3421('0x9f')][_0x1d23b6[_0x3421('0xf4')]][_0x3421('0x100')],'VoiceQueueId':this['actions'][_0x1d23b6[_0x3421('0xf4')]][_0x3421('0xc3')]||undefined,'CampaignId':this[_0x3421('0x9f')][_0x1d23b6[_0x3421('0xf4')]]['CampaignId']||undefined})[_0x3421('0xa5')](loggerCatch(_0x3421('0x101')));delete this['actions'][_0x1d23b6[_0x3421('0xf4')]];unlockQueueStatus(_0x35daa1);}}else if((strategy[this['voiceQueues'][this['actions'][_0x1d23b6[_0x3421('0xf4')]][_0x3421('0xa9')]]['strategy']]||_0x3421('0x1a'))==='rrmemory'){var _0x2cce48;if(this['actions'][_0x1d23b6[_0x3421('0xf4')]]&&!_['isEmpty'](this[_0x3421('0x29')][this[_0x3421('0x9f')][_0x1d23b6[_0x3421('0xf4')]][_0x3421('0xa9')]])){if(this[_0x3421('0x2a')][_0x313169[_0x3421('0x9f')][_0x1d23b6[_0x3421('0xf4')]][_0x3421('0xa9')]]){this['queueBookedRR'][_0x313169[_0x3421('0x9f')][_0x1d23b6['actionid']][_0x3421('0xa9')]]=this[_0x3421('0x2a')][this[_0x3421('0x9f')][_0x1d23b6[_0x3421('0xf4')]]['queue']]?this[_0x3421('0x2a')][this['actions'][_0x1d23b6[_0x3421('0xf4')]][_0x3421('0xa9')]]:this[_0x3421('0x29')][this[_0x3421('0x9f')][_0x1d23b6[_0x3421('0xf4')]]['queue']]?this[_0x3421('0x29')][this[_0x3421('0x9f')][_0x1d23b6[_0x3421('0xf4')]]['queue']][_0x3421('0x102')]||0x0:0x0;}this[_0x3421('0x29')][this['actions'][_0x1d23b6[_0x3421('0xf4')]]['queue']][_0x3421('0x102')]=this[_0x3421('0x2a')][this[_0x3421('0x9f')][_0x1d23b6[_0x3421('0xf4')]]['queue']];for(var _0x863517=0x0;_0x863517=0x0?!![]:![];})[_0x3421('0xa5')](myreject(_0x2afac6)));}}else{_0x3111ee[_0x3421('0xf8')](ami[_0x3421('0x119')]({'action':_0x3421('0x11a'),'command':util[_0x3421('0x77')](_0x3421('0x11b'),_0x563665,!_[_0x3421('0x82')](config[_0x3421('0x115')][_0xb6b721])?_0xb6b721:'')})['then'](function(_0x2a0dc0){return _0x2a0dc0['content'][_0x3421('0x11e')](_0x3421('0x11f'))>=0x0?!![]:![];})['catch'](myreject(_0x2afac6)));}BPromise[_0x3421('0x120')](_0x3111ee)[_0x3421('0xac')](function(_0x4702ce){var _0x11d1e5=_[_0x3421('0x121')](_0x4702ce);if(_0x11d1e5){return _0x6c613c(_0x11d1e5);}else{_0x29d809[_0x3421('0x3d')]=_0x1fd7b7?_0x3421('0x122'):'INTERVAL_IS_OVERTIME';return _0x2afac6(msgResponse(_0x3421('0x123'),_0x3421('0x113'),_0x3421('0x124')+_0x1fd7b7+'\x20'+_0x7d3d89+_0x3421('0x125')+util[_0x3421('0x8a')](_0x563665,{'showHidden':![],'depth':null})+_0x3421('0x126')+_0xb6b721));}})['catch'](function(_0x1d7840){return _0x2afac6(msgResponse(_0x3421('0x110'),'Failure',JSON[_0x3421('0x47')](_0x1d7840)));});});};Dialer[_0x3421('0x9b')][_0x3421('0x127')]=function(_0x205188){var _0x1b3357=this;return function(){switch(_0x205188[_0x3421('0x55')]){case _0x3421('0x128'):freeVariablesPredictive(_0x205188);_0x1b3357[_0x3421('0x129')](_0x205188,0x1);break;case _0x3421('0x12a'):freeVariablesPredictive(_0x205188);_0x1b3357[_0x3421('0x129')](_0x205188,_0x205188[_0x3421('0x12b')]);break;case _0x3421('0x9'):_0x1b3357['predictive'](_0x205188);break;case _0x3421('0x8'):freeVariablesPredictive(_0x205188);_0x1b3357[_0x3421('0x129')](_0x205188,0x1);break;default:freeVariablesPredictive(_0x205188);logger[_0x3421('0x89')](_0x3421('0x12c'),_0x205188[_0x3421('0x3b')],_0x3421('0x12d'));}};};Dialer[_0x3421('0x9b')][_0x3421('0x12e')]=function(_0x3a3980){var _0x57adb4=this;return function(){_0x57adb4['handleIvr'](_0x3a3980);};};Dialer[_0x3421('0x9b')]['syncQueueSummary']=function(_0x5447be){var _0x5797bb=this;if(isNotPreview(_0x5447be[_0x3421('0x55')])){if(isVoiceQueueOutbound(_0x5447be['type'])&&isActive(_0x5447be[_0x3421('0x54')])){_0x5447be[_0x3421('0x91')]=!![];BPromise[_0x3421('0xab')]()[_0x3421('0xac')](checkIsLoggedIn(_0x5447be,_0x5447be['loggedIn']))[_0x3421('0xac')](checkIsActive(_0x5447be,_0x5447be[_0x3421('0x54')]))[_0x3421('0xac')](checkInterval(_0x5447be))[_0x3421('0xac')](_0x5797bb[_0x3421('0x12f')](_0x5447be))['then'](_0x5797bb[_0x3421('0x10f')](_0x5447be[_0x3421('0x130')],_0x5447be['dialTimezone'],_0x5447be[_0x3421('0x3b')],_0x5447be))[_0x3421('0xac')](_0x5797bb[_0x3421('0x111')](_0x5447be[_0x3421('0x40')],_0x5447be[_0x3421('0x131')],_0x5447be[_0x3421('0x3b')],_0x5447be))['then'](_0x5797bb[_0x3421('0x127')](_0x5447be))[_0x3421('0xa5')](loggerCatchQueueSummary(_0x3421('0x132'),_0x5447be));}else{notSendMessagesQueue(_0x5447be);}}else{freeVariablesPredictive(_0x5447be);}};Dialer[_0x3421('0x9b')][_0x3421('0x133')]=function(){var _0x645d3f=this;var _0x1f354c;for(var _0x1312c0 in this[_0x3421('0x21')]){if(this[_0x3421('0x21')][_0x3421('0xa1')](_0x1312c0)){_0x1f354c=this[_0x3421('0x21')][_0x1312c0];if(isCampaignIvr(_0x1f354c[_0x3421('0xa7')])&&isActive(_0x1f354c[_0x3421('0x73')])){_0x1f354c[_0x3421('0x91')]=!![];BPromise[_0x3421('0xab')]()[_0x3421('0xac')](checkIsActive(_0x1f354c,_0x1f354c[_0x3421('0x73')]))[_0x3421('0xac')](checkInterval(_0x1f354c))[_0x3421('0xac')](_0x645d3f[_0x3421('0x12f')](_0x1f354c))[_0x3421('0xac')](_0x645d3f['checkIfTime'](_0x1f354c[_0x3421('0x130')],_0x1f354c[_0x3421('0x131')],_0x1f354c[_0x3421('0x3b')],_0x1f354c))['then'](_0x645d3f[_0x3421('0x111')](_0x1f354c[_0x3421('0x40')],_0x1f354c[_0x3421('0x131')],_0x1f354c[_0x3421('0x3b')],_0x1f354c))[_0x3421('0xac')](_0x645d3f[_0x3421('0x12e')](_0x1f354c))[_0x3421('0xa5')](loggerCatchQueueSummary('[syncCampaigns]',_0x1f354c));}else{notSendMessagesCampaign(_0x1f354c);}}}};function getCallerIdRandom(_0xf3954a,_0x4d1399){var _0x486921,_0x34816a,_0x490160;if(_0x4d1399<=0x0){_0x4d1399=0x1;}_0x486921=new RegExp('\x5cw{0,'+_0x4d1399+'}$');_0x34816a=Math[_0x3421('0x134')](0xa,_0x4d1399-0x1);_0x490160=Math[_0x3421('0x134')](0xa,_0x4d1399)-0x1;return util['format']('%s',_[_0x3421('0x135')](_0xf3954a,_0x486921,_[_0x3421('0x136')](_0x34816a,_0x490160)));}function extractCalleridName(_0x568356){var _0x5f4b12=_0x568356[_0x3421('0x137')](/"(.*?)"/);return _0x5f4b12?_0x5f4b12[0x1]:_0x568356;}function extractCalleridNumber(_0x341f4c){var _0x5d3a2e=_0x341f4c['match'](/<(.*?)>/);return _0x5d3a2e?_0x5d3a2e[0x1]:_0x341f4c;}Dialer[_0x3421('0x9b')][_0x3421('0x138')]=function(_0x4dcb14,_0x1b17ea){var _0x5a14e5=this;var _0x1251d0=uuid['v4']();this[_0x3421('0x9f')][_0x1251d0]=new Action(_0x4dcb14,_0x1b17ea,_0x1251d0);return new BPromise(function(_0x55716e,_0x37f4c3){if(_[_0x3421('0x82')](_0x4dcb14)&&'object'!==typeof _0x4dcb14){return _0x37f4c3(msgResponse('originate',_0x3421('0x113'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x1b17ea[_0x3421('0x139')][_0x3421('0x13a')])||_0x1b17ea[_0x3421('0x139')][_0x3421('0x13a')]===null){return _0x37f4c3(msgResponse(_0x3421('0x13b'),_0x3421('0x113'),_0x3421('0x13c')));}var _0xc6ab5a={'XMD-CALLERID':_0x5a14e5[_0x3421('0x9f')][_0x1251d0][_0x3421('0x13d')](),'XMD-AGI':_0x4dcb14[_0x3421('0xe0')]?util['format'](_0x3421('0x13e'),ipAgi,_0x4dcb14[_0x3421('0xe0')]):_0x3421('0x13f'),'XMD-AGIAFTER':_0x4dcb14[_0x3421('0xe7')]?util[_0x3421('0x77')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4dcb14[_0x3421('0xe7')]):'NONE','XMD-QUEUE':_0x4dcb14[_0x3421('0xa7')]===_0x3421('0x4a')?util['format'](_0x3421('0x140'),_0x4dcb14[_0x3421('0x3b')],_0x4dcb14[_0x3421('0x141')]||'',_0x4dcb14[_0x3421('0xe8')]?'c':'',_0x4dcb14[_0x3421('0xf0')]||0x3):'NONE','XMD-CONTACTID':_0x1b17ea[_0x3421('0xc1')],'XMD-CDRTYPE':_0x3421('0x142'),'CALLERID(all)':_0x5a14e5[_0x3421('0x9f')][_0x1251d0]['getCaller'](),'XMD-AMD':_0x4dcb14[_0x3421('0xcf')]?'ACTIVE':_0x3421('0x13f'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4dcb14['dialAMDActive']){_0xc6ab5a[_0x3421('0x143')]=_0x4dcb14['dialAMDInitialSilence']||0x9c4;_0xc6ab5a[_0x3421('0x144')]=_0x4dcb14[_0x3421('0x145')]||0x5dc;_0xc6ab5a[_0x3421('0x146')]=_0x4dcb14[_0x3421('0x147')]||0x320;_0xc6ab5a['XMD-AMDTOTALANALYSISTIME']=_0x4dcb14['dialAMDTotalAnalysisTime']||0x1388;_0xc6ab5a['XMD-AMDMINWORDLENGTH']=_0x4dcb14[_0x3421('0x148')]||0x64;_0xc6ab5a[_0x3421('0x149')]=_0x4dcb14[_0x3421('0x14a')]||0x32;_0xc6ab5a['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x4dcb14[_0x3421('0x14b')]||0x3;_0xc6ab5a[_0x3421('0x14c')]=_0x4dcb14[_0x3421('0x14d')]||0x100;_0xc6ab5a[_0x3421('0x14e')]=_0x4dcb14['dialAMDMaximumWordLength']||0x1388;}if(_0x4dcb14['type']===_0x3421('0x4a')){_0xc6ab5a['XMD-VOICEQUEUEID']=_0x1b17ea[_0x3421('0xc3')];}else{_0xc6ab5a['XMD-CAMPAIGNID']=_0x1b17ea['CampaignId'];}for(var _0x35adf5 in _0x1b17ea[_0x3421('0x139')]){if(_0x1b17ea[_0x3421('0x139')][_0x3421('0xa1')](_0x35adf5)){if(isNotNull(_0x1b17ea[_0x3421('0x139')][_0x35adf5])&&_0x35adf5!=='id'&&_0x35adf5!=='tags'&&_0x35adf5!==_0x3421('0x14f')&&_0x35adf5!=='updatedAt'){_0xc6ab5a[util['format'](_0x3421('0x150'),_0x3421('0x151'),_[_0x3421('0x152')](_0x35adf5))]=_0x1b17ea[_0x3421('0x139')][_0x35adf5];}}}var _0x36214b=_0x5a14e5[_0x3421('0xc7')](_0x4dcb14[_0x3421('0x72')])?getCallerId(_0x4dcb14['Trunk'][_0x3421('0x74')],_0x4dcb14[_0x3421('0x56')],_0x4dcb14[_0x3421('0x153')]>0x0?getCallerIdRandom(_0x4dcb14[_0x3421('0x57')],_0x4dcb14[_0x3421('0x153')]):_0x4dcb14[_0x3421('0x57')]):getCallerId(_[_0x3421('0xa2')](_0x4dcb14[_0x3421('0x10c')])?_0x4dcb14['Trunk'][_0x3421('0x74')]:_0x4dcb14['TrunkBackup']['callerid'],_0x4dcb14[_0x3421('0x56')],_0x4dcb14[_0x3421('0x153')]>0x0?getCallerIdRandom(_0x4dcb14[_0x3421('0x57')],_0x4dcb14[_0x3421('0x153')]):_0x4dcb14['dialOriginateCallerIdNumber']);if(_0x36214b){_0xc6ab5a['XMD-ORIGINATECALLERIDNAME']=_0x5a14e5[_0x3421('0x9f')][_0x1251d0][_0x3421('0x154')]=extractCalleridName(_0x36214b);_0xc6ab5a['XMD-ORIGINATECALLERIDNUM']=_0x5a14e5[_0x3421('0x9f')][_0x1251d0][_0x3421('0x155')]=extractCalleridNumber(_0x36214b);}return ami[_0x3421('0x119')]({'actionid':_0x1251d0,'action':_0x3421('0x13b'),'channel':_0x5a14e5[_0x3421('0xc7')](_0x4dcb14[_0x3421('0x72')])?util[_0x3421('0x77')]('SIP/%s/%s%s',_0x4dcb14['Trunk'][_0x3421('0x3b')],isNotNull(_0x4dcb14[_0x3421('0x59')])?_0x4dcb14['dialPrefix'][_0x3421('0x156')]()||'':'',_0x4dcb14['dialCutDigit']>0x0?_0x1b17ea['Contact']['phone'][_0x3421('0x157')](_0x4dcb14['dialCutDigit']):_0x1b17ea['Contact']['phone']):util[_0x3421('0x77')]('SIP/%s/%s%s',_['isNil'](_0x4dcb14[_0x3421('0x10c')])?_0x4dcb14[_0x3421('0x72')][_0x3421('0x3b')]:_0x4dcb14[_0x3421('0x10c')][_0x3421('0x3b')],isNotNull(_0x4dcb14[_0x3421('0x59')])?_0x4dcb14[_0x3421('0x59')][_0x3421('0x156')]()||'':'',_0x4dcb14['dialCutDigit']>0x0?_0x1b17ea['Contact'][_0x3421('0x13a')][_0x3421('0x157')](_0x4dcb14[_0x3421('0x158')]):_0x1b17ea[_0x3421('0x139')][_0x3421('0x13a')]),'callerid':_0x36214b,'Exten':_0x3421('0x159'),'Context':_0x3421('0x15a'),'Priority':'1','variable':_0xc6ab5a,'timeout':(_0x4dcb14[_0x3421('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1251d0})[_0x3421('0xac')](function(_0x16771e){return _0x55716e(_0x16771e);})[_0x3421('0xa5')](function(_0x4d11bd){_0x4dcb14[_0x3421('0x63')]+=0x1;var _0x43c27f=new History(_0x5a14e5[_0x3421('0x9f')][_0x1251d0]);logger[_0x3421('0x89')](util[_0x3421('0x77')](_0x3421('0x15b'),JSON['stringify'](_0x4d11bd)));_0x43c27f[_0x3421('0x97')]=0xe;_0x43c27f[_0x3421('0x98')]=_0x3421('0x15c');_0x43c27f[_0x3421('0x9a')]=moment()[_0x3421('0x77')](_0x3421('0xe9'));_0x43c27f[_0x3421('0x99')]=_0x43c27f['starttime'];_0x5a14e5[_0x3421('0xba')](_0x43c27f)[_0x3421('0xa5')](loggerCatch(_0x3421('0x15d')));_0x5a14e5[_0x3421('0xb8')](_0x43c27f)[_0x3421('0xa5')](loggerCatch(_0x3421('0x15d')))[_0x3421('0x1e')](function(){delete _0x5a14e5['actions'][_0x1251d0];return _0x37f4c3(msgResponse('originate','Error',_0x3421('0x15e')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x988783){var _0x422de7=this[_0x3421('0x9f')][_0x988783[_0x3421('0xf4')]];var _0x450fd5=this;if(_0x422de7){delete this['actions'][_0x988783['actionid']];_0x422de7[_0x3421('0xef')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4ef419=_0x422de7[_0x3421('0xa7')]===_0x3421('0x76')?this[_0x3421('0x21')][_0x422de7[_0x3421('0xa9')]]:this[_0x3421('0x20')][_0x422de7['getQueue']()];if(!this[_0x3421('0xc6')](_0x988783['response'])){this[_0x3421('0xa8')](_0x4ef419);return this[_0x3421('0x15f')](_0x422de7,_0x4ef419,_0x988783)[_0x3421('0xac')](function(_0x1ce1f2){})[_0x3421('0xa5')](loggerCatch('[callProgressDetecting]\x20'));}else{this['uniqueId'][_0x988783[_0x3421('0xcb')]]=_0x422de7;}}};Dialer['prototype'][_0x3421('0x160')]=function(_0x22d413,_0x1a9acc,_0x42941b){var _0x429524=new History(_0x1a9acc);if(_0x429524[_0x3421('0x161')]+_0x429524['countcongestionretry']+_0x429524['countnoanswerretry']>=_0x42941b[_0x3421('0x162')]-0x1){return!![];}switch(_0x22d413){case 0x3:if(_0x429524[_0x3421('0x163')]>=_0x42941b['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0x3421('0xb3')]({'active':![],'countnoanswerretry':_0x429524[_0x3421('0x163')]+=0x1,'scheduledat':moment()[_0x3421('0x164')](_0x42941b[_0x3421('0x165')],_0x3421('0x166'))['format'](_0x3421('0xe9')),'ContactId':_0x429524['ContactId'],'ListId':_0x429524[_0x3421('0x100')],'VoiceQueueId':_0x429524[_0x3421('0xc3')]||undefined,'CampaignId':_0x429524[_0x3421('0x108')]||undefined})[_0x3421('0xa5')](loggerCatch(_0x3421('0x167')));}break;case 0x5:if(_0x429524[_0x3421('0x161')]>=_0x42941b[_0x3421('0x168')]-0x1){return!![];}else{this[_0x3421('0xb3')]({'active':![],'countbusyretry':_0x429524[_0x3421('0x161')]+=0x1,'scheduledat':moment()[_0x3421('0x164')](_0x42941b[_0x3421('0x169')],_0x3421('0x166'))[_0x3421('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x429524[_0x3421('0xc1')],'ListId':_0x429524['ListId'],'VoiceQueueId':_0x429524[_0x3421('0xc3')]||undefined,'CampaignId':_0x429524[_0x3421('0x108')]||undefined})['catch'](loggerCatch(_0x3421('0x16a')));}break;case 0x8:if(_0x429524['countcongestionretry']>=_0x42941b[_0x3421('0x16b')]-0x1){return!![];}else{this[_0x3421('0xb3')]({'active':![],'countcongestionretry':_0x429524['countcongestionretry']+=0x1,'scheduledat':moment()[_0x3421('0x164')](_0x42941b[_0x3421('0x16c')],_0x3421('0x166'))[_0x3421('0x77')](_0x3421('0xe9')),'ContactId':_0x429524[_0x3421('0xc1')],'ListId':_0x429524[_0x3421('0x100')],'VoiceQueueId':_0x429524[_0x3421('0xc3')]||undefined,'CampaignId':_0x429524[_0x3421('0x108')]||undefined})[_0x3421('0xa5')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0x3421('0x9b')][_0x3421('0x15f')]=function(_0x501046,_0x44fef3,_0x3910df){var _0x2aab8c=this;var _0x1e0cb4=new History(_0x501046);return new BPromise(function(_0x398725,_0xde16d4){if(_[_0x3421('0x82')](_0x44fef3)&&_0x3421('0x16d')!==typeof _0x44fef3){return _0xde16d4(msgResponse(_0x3421('0x16e'),'Failure',_0x3421('0x16f')));}if(_[_0x3421('0x82')](_0x3910df)&&'object'!==typeof _0x3910df){return _0xde16d4(msgResponse(_0x3421('0x16e'),_0x3421('0x113'),_0x3421('0x170')));}switch(_0x3910df[_0x3421('0xe4')]){case'0':_0x44fef3[_0x3421('0x62')]+=0x1;_0x1e0cb4['state']=0x0;_0x1e0cb4[_0x3421('0x98')]=_0x3421('0x171');_0x2aab8c['createHistory'](_0x1e0cb4)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2aab8c[_0x3421('0x160')](0x0,_0x501046,_0x44fef3)){if(_0x1e0cb4[_0x3421('0x161')]+_0x1e0cb4[_0x3421('0x172')]+_0x1e0cb4[_0x3421('0x163')]>=_0x44fef3[_0x3421('0x162')]){_0x2aab8c[_0x3421('0x173')](_0x1e0cb4,_0x398725,_0xde16d4,_0x3421('0x174'));}else{_0x2aab8c[_0x3421('0x175')](_0x1e0cb4,_0x398725,_0xde16d4,_0x3421('0x174'));}}break;case'3':_0x44fef3[_0x3421('0x176')]+=0x1;_0x1e0cb4[_0x3421('0x97')]=0x3;_0x1e0cb4['statedesc']=_0x3421('0x177');_0x1e0cb4[_0x3421('0x163')]+=0x1;_0x1e0cb4[_0x3421('0x178')]+=0x1;_0x2aab8c[_0x3421('0xba')](_0x1e0cb4)['catch'](loggerCatch(_0x3421('0x179')));if(_0x2aab8c['checkRetriveMax'](0x3,_0x501046,_0x44fef3)){if(_0x1e0cb4[_0x3421('0x163')]>=_0x44fef3[_0x3421('0x17a')]){_0x2aab8c[_0x3421('0x175')](_0x1e0cb4,_0x398725,_0xde16d4,_0x3421('0x17b'));}else{_0x2aab8c[_0x3421('0x173')](_0x1e0cb4,_0x398725,_0xde16d4,_0x3421('0x17b'));}}break;case'5':_0x44fef3[_0x3421('0x5d')]+=0x1;_0x1e0cb4['state']=0x5;_0x1e0cb4['statedesc']='Busy';_0x1e0cb4[_0x3421('0x161')]+=0x1;_0x1e0cb4[_0x3421('0x178')]+=0x1;_0x2aab8c[_0x3421('0xba')](_0x1e0cb4)[_0x3421('0xa5')](loggerCatch(_0x3421('0x17c')));if(_0x2aab8c[_0x3421('0x160')](0x5,_0x501046,_0x44fef3)){if(_0x1e0cb4[_0x3421('0x161')]>=_0x44fef3[_0x3421('0x168')]){_0x2aab8c[_0x3421('0x175')](_0x1e0cb4,_0x398725,_0xde16d4,_0x3421('0x17d'));}else{_0x2aab8c[_0x3421('0x173')](_0x1e0cb4,_0x398725,_0xde16d4,_0x3421('0x17d'));}}break;case'8':_0x44fef3[_0x3421('0x5e')]+=0x1;_0x1e0cb4['state']=0x8;_0x1e0cb4[_0x3421('0x98')]=_0x3421('0x17e');_0x1e0cb4[_0x3421('0x172')]+=0x1;_0x1e0cb4[_0x3421('0x178')]+=0x1;_0x2aab8c[_0x3421('0xba')](_0x1e0cb4)[_0x3421('0xa5')](loggerCatch(_0x3421('0x17f')));if(_0x2aab8c['checkRetriveMax'](0x8,_0x501046,_0x44fef3)){if(_0x1e0cb4[_0x3421('0x172')]>=_0x44fef3[_0x3421('0x16b')]){_0x2aab8c[_0x3421('0x175')](_0x1e0cb4,_0x398725,_0xde16d4,_0x3421('0x180'));}else{_0x2aab8c[_0x3421('0x173')](_0x1e0cb4,_0x398725,_0xde16d4,_0x3421('0x180'));}}break;default:_0x44fef3[_0x3421('0xe2')]+=0x1;_0x1e0cb4[_0x3421('0x97')]=0xc;_0x1e0cb4[_0x3421('0x98')]=_0x3910df[_0x3421('0xe4')];_0x2aab8c[_0x3421('0xba')](_0x1e0cb4)[_0x3421('0xa5')](loggerCatch(_0x3421('0x181')));if(_0x2aab8c[_0x3421('0x160')](_0x3910df[_0x3421('0xe4')],_0x501046,_0x44fef3)){if(_0x1e0cb4[_0x3421('0x161')]+_0x1e0cb4[_0x3421('0x172')]+_0x1e0cb4[_0x3421('0x163')]>=_0x44fef3[_0x3421('0x162')]){_0x2aab8c[_0x3421('0x173')](_0x1e0cb4,_0x398725,_0xde16d4,_0x3910df[_0x3421('0xe4')]);}else{_0x2aab8c[_0x3421('0x175')](_0x1e0cb4,_0x398725,_0xde16d4,_0x3910df[_0x3421('0xe4')]);}}}});};Dialer[_0x3421('0x9b')][_0x3421('0x173')]=function(_0x15a93f,_0x5da9c6,_0x4745b9,_0xf3f293){var _0x28474a=new Final(_0x15a93f);_0x28474a['state']=0xf;_0x28474a[_0x3421('0x98')]='Global';this[_0x3421('0x175')](_0x28474a,_0x5da9c6,_0x4745b9,_0xf3f293);};Dialer[_0x3421('0x9b')][_0x3421('0x175')]=function(_0x5c5872,_0x45e665,_0x37c44d,_0x2ceb67){this[_0x3421('0xb8')](_0x5c5872)['then'](function(_0x1a8870){return _0x45e665(msgResponse('[callProgressDetecting]',_0x3421('0x182'),_0x2ceb67));})[_0x3421('0xa5')](function(_0x205ac9){return _0x37c44d(msgResponse('[moveContactManagedDialer][0]',_0x3421('0x113'),_0x3421('0x183')));});};Dialer[_0x3421('0x9b')][_0x3421('0x9')]=function(_0x52bb53){var _0x3f874f=this;var _0x2388de=_0x52bb53[_0x3421('0x184')]/0x64;var _0x1f053b=_0x52bb53[_0x3421('0x61')]/(_0x52bb53[_0x3421('0x61')]+_0x52bb53[_0x3421('0x5b')]);var _0x253c80=_0x52bb53['loggedIn']-_0x52bb53['predictiveIntervalPauses']-_0x52bb53['waiting']-_0x52bb53[_0x3421('0x71')]-_0x52bb53[_0x3421('0x51')];var _0x53bbe4=(_0x52bb53['loggedIn']-_0x52bb53[_0x3421('0x6f')])*_0x52bb53[_0x3421('0x6d')];var _0x46ea52=Math[_0x3421('0x185')](_0x52bb53['erlangCalls']*_0x52bb53['erlangAbandonmentRate']*_0x52bb53[_0x3421('0x6c')]*_0x52bb53[_0x3421('0x6e')]);if(_[_0x3421('0x82')](_0x52bb53['startProgressive'])){loggerPredictive[_0x3421('0x79')](_0x3421('0x186'));if(!_[_0x3421('0x82')](_0x52bb53[_0x3421('0x84')])){_0x52bb53[_0x3421('0x84')]=undefined;loggerPredictive[_0x3421('0x89')](_0x3421('0x187'),_0x3421('0x188'));}if(!_[_0x3421('0x82')](_0x52bb53[_0x3421('0x85')])){loggerPredictive[_0x3421('0x89')](_0x3421('0x187'),_0x3421('0x189'));clearInterval(_0x52bb53[_0x3421('0x85')]);_0x52bb53[_0x3421('0x85')]=undefined;}_0x52bb53[_0x3421('0x27')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3421('0x79')](_0x3421('0x18a'),_0x52bb53[_0x3421('0x27')],_0x52bb53[_0x3421('0x3b')]);this[_0x3421('0x129')](_0x52bb53,0x1);}else if(ifInterval(_0x52bb53[_0x3421('0x18b')],_0x52bb53[_0x3421('0x27')])){this[_0x3421('0x129')](_0x52bb53,0x1);loggerPredictiveCalls[_0x3421('0x79')]('[startMethodPredictive][StartProgressive][Loop]',_0x52bb53[_0x3421('0x27')],_0x52bb53['name']);_0x52bb53[_0x3421('0x18c')]=0x0;_0x52bb53[_0x3421('0x6b')]=0x0;}else if(_0x2388de<_0x1f053b&&_0x52bb53[_0x3421('0x18d')]===_0x3421('0x18e')){freeVariablesPredictive(_0x52bb53);loggerPredictive[_0x3421('0x79')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x3421('0x18f'),_0x1f053b,'startProgressive',_0x52bb53['name']);}else if(_0x253c80>_0x53bbe4){freeVariablesPredictive(_0x52bb53);loggerPredictive[_0x3421('0x79')](_0x3421('0x190'),_0x3421('0x191'),_0x253c80,_0x3421('0x192'),_0x53bbe4);}else if(_0x46ea52<_0x52bb53[_0x3421('0x6b')]&&_0x52bb53[_0x3421('0x18d')]===_0x3421('0x18e')){freeVariablesPredictive(_0x52bb53);loggerPredictive[_0x3421('0x79')](_0x3421('0x193'),'Max\x20Drop\x20',_0x46ea52,_0x3421('0x194'),_0x52bb53['predictiveIntervalErlangCallsDroppedCalls'],_0x3421('0x27'),_0x52bb53[_0x3421('0x3b')]);}else if(!ifInterval(_0x52bb53['dialPredictiveInterval'],_0x52bb53['startProgressive'])&&_[_0x3421('0x82')](_0x52bb53[_0x3421('0x84')])&&!_[_0x3421('0x82')](_0x52bb53['startProgressive'])){_0x52bb53['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3421('0x79')](_0x3421('0x195'),_0x52bb53[_0x3421('0x84')],_0x52bb53['name']);this['averageHandleTime'](_0x52bb53[_0x3421('0x18b')])['then'](this[_0x3421('0x196')](_0x52bb53))['then'](mergeDataErlangB(_0x52bb53))[_0x3421('0xac')](this[_0x3421('0x197')](_0x52bb53))[_0x3421('0xa5')](loggerCatchPredictive(_0x3421('0x198'),_0x52bb53));}else if(!ifInterval(_0x52bb53[_0x3421('0x18b')],_0x52bb53[_0x3421('0x84')])){_0x52bb53['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x52bb53[_0x3421('0x84')]=moment()[_0x3421('0x77')](_0x3421('0xe9'));loggerPredictive['info'](_0x3421('0x199'),_0x52bb53['startPredictive'],_0x52bb53[_0x3421('0x3b')]);clearInterval(_0x52bb53[_0x3421('0x85')]);_0x52bb53[_0x3421('0x85')]=undefined;this[_0x3421('0xb1')](_0x52bb53['dialPredictiveInterval'])[_0x3421('0xac')](this[_0x3421('0x196')](_0x52bb53))[_0x3421('0xac')](mergeDataErlangB(_0x52bb53))[_0x3421('0xac')](this[_0x3421('0x197')](_0x52bb53))['catch'](loggerCatchPredictive(_0x3421('0x198'),_0x52bb53));}};Dialer[_0x3421('0x9b')][_0x3421('0x196')]=function(_0x579154){var _0x236e8e=this;return function(_0x3296b7){return new BPromise(function(_0xd993f6,_0x1fd01f){_['merge'](_0x579154,_0x3296b7[0x0]);if(checkGetDataPredictive(_0x3296b7[0x0])){loggerPredictive[_0x3421('0x79')](JSON['stringify'](_0x3296b7[0x0]));if(_0x579154[_0x3421('0x18d')]===_0x3421('0x18e')){return _0x236e8e['getVoiceQueueRtPauses'](_0x579154['id'])[_0x3421('0xac')](function(_0x48b869){var _0x3f8deb=_0x579154[_0x3421('0x4d')]-_0x48b869[0x0]['outboundQueuePauses'];var _0x30e44b=_0x579154[_0x3421('0x18b')]*0x3c;var _0x13c475=_0x3296b7[0x0][_0x3421('0x67')]+_0x3296b7[0x0]['predictiveIntervalAvgHoldtime'];var _0x56a26f=(_0x3296b7[0x0][_0x3421('0x66')]+_0x3296b7[0x0][_0x3421('0x69')]+_0x3296b7[0x0][_0x3421('0x68')])/_0x3296b7[0x0]['predictiveIntervalTotalCalls'];var _0x373622=_0x579154[_0x3421('0x184')]/0x64;_0x579154[_0x3421('0x6f')]=_0x48b869[0x0][_0x3421('0x19a')]||0x0;_0x579154[_0x3421('0x6c')]=_0x56a26f>0x0?_0x56a26f:0x1;return _0x236e8e['abandonmentRate'](_0x3f8deb,_0x30e44b,_0x13c475,_0x56a26f,_0x373622);})['then'](function(_0x4c542f){return _0xd993f6(_0x4c542f);})[_0x3421('0xa5')](function(_0x2739f7){return _0x1fd01f(msgResponse(_0x3421('0x19b'),_0x3421('0x113'),JSON['stringify'](_0x2739f7)));});}if(_0x579154[_0x3421('0x18d')]===_0x3421('0x19c')){return _0x236e8e['getVoiceQueueRtPauses'](_0x579154['id'])['then'](function(_0x2bd1cc){var _0x35f1ea=_0x579154['loggedIn']-_0x2bd1cc[0x0]['outboundQueuePauses'];var _0x5b9eb9=_0x579154[_0x3421('0x18b')]*0x3c;var _0x15d9b8=_0x3296b7[0x0]['predictiveIntervalAvgTalktime']+_0x3296b7[0x0][_0x3421('0x7b')];var _0x57d6ee=(_0x3296b7[0x0][_0x3421('0x66')]+_0x3296b7[0x0][_0x3421('0x69')]+_0x3296b7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3296b7[0x0][_0x3421('0x70')];var _0x10cf35=_0x579154[_0x3421('0x184')]/0x64;_0x579154[_0x3421('0x6f')]=_0x2bd1cc[0x0][_0x3421('0x19a')]||0x0;_0x579154[_0x3421('0x6c')]=_0x57d6ee>0x0?_0x57d6ee:0x1;return _0x236e8e[_0x3421('0x19d')](_0x35f1ea,_0x5b9eb9,_0x15d9b8,_0x57d6ee,_0x10cf35);})['then'](function(_0x501a2b){return _0xd993f6(_0x501a2b);})['catch'](function(_0x333744){return _0x1fd01f(msgResponse('[CatchErlangB]',_0x3421('0x113'),JSON[_0x3421('0x47')](_0x333744)));});}}else{return _0x1fd01f(msgResponse(_0x3421('0x19e'),_0x3421('0x113'),_0x3421('0x19f')));}});};};Dialer[_0x3421('0x9b')][_0x3421('0x197')]=function(_0x57ebf0){var _0x2fe214=this;return function(){var _0x316661=0x0;var _0x561b42=Math[_0x3421('0x185')](_0x57ebf0[_0x3421('0x1a0')]*0x3e8);if(_0x561b42>0x0){_0x561b42=_0x561b42<0x64?0x64:_0x561b42;loggerPredictive[_0x3421('0x79')]('[startMethodPredictive]',_0x561b42);_0x57ebf0[_0x3421('0x85')]=setInterval(function(){_0x2fe214[_0x3421('0x85')](_0x57ebf0);loggerPredictiveCalls[_0x3421('0x79')](_0x3421('0x1a1'),_0x316661+=0x1);},_0x561b42);}else{loggerPredictive[_0x3421('0x79')](_0x3421('0x1a2'),_0x3421('0x1a3'),_0x561b42);}};};Dialer[_0x3421('0x9b')][_0x3421('0x1a4')]=function(_0x3179cd,_0x7e9d3d){var _0x63da7e=this;return function(_0x33a3b3){if(_['isEmpty'](_0x33a3b3)){if(_['isNil'](_0x7e9d3d['UserId'])||!_0x7e9d3d['recallme']){if(_0x3179cd[_0x3421('0x55')]==='booked'){_0x3179cd[_0x3421('0xfa')]=_['isUndefined'](_0x3179cd[_0x3421('0xfa')])?!![]:_0x3179cd[_0x3421('0xfa')];var _0x597132=uuid['v4']();_0x63da7e[_0x3421('0x9f')][_0x597132]=new Action(_0x3179cd,_0x7e9d3d,_0x597132);loggerBooked['info'](_0x3421('0x1a5'),_0x597132,'queueStatusComplete:\x20',JSON[_0x3421('0x47')](_0x3179cd[_0x3421('0xfa')]),_0x3421('0x1a6'),_0x3179cd[_0x3421('0x3b')]);if(_0x3179cd['queueStatusComplete']){_0x3179cd[_0x3421('0xfa')]=![];_0x63da7e[_0x3421('0x29')][_0x63da7e[_0x3421('0x9f')][_0x597132][_0x3421('0xa9')]]=[];ami[_0x3421('0x119')]({'actionid':_0x597132,'action':_0x3421('0x1a7'),'queue':_0x3179cd[_0x3421('0x3b')]})[_0x3421('0xa5')](function(_0x3137f5){_0x63da7e[_0x3421('0xa8')](_0x3179cd);_0x63da7e[_0x3421('0xb3')]({'active':![],'ContactId':_0x63da7e[_0x3421('0x9f')][_0x597132][_0x3421('0xc1')],'ListId':_0x63da7e[_0x3421('0x9f')][_0x597132][_0x3421('0x100')],'VoiceQueueId':_0x63da7e[_0x3421('0x9f')][_0x597132][_0x3421('0xc3')]||undefined,'CampaignId':_0x63da7e[_0x3421('0x9f')][_0x597132][_0x3421('0x108')]||undefined})['catch'](loggerCatch(_0x3421('0x1a8')));delete _0x63da7e[_0x3421('0x9f')][_0x597132];});}else{loggerBooked[_0x3421('0x79')](_0x3421('0x1a9'),JSON['stringify'](_0x3179cd[_0x3421('0xfa')]),_0x3421('0x1a6'),_0x3179cd['name']);_0x63da7e[_0x3421('0xa8')](_0x3179cd);_0x63da7e['rescheduleContact']({'active':![],'ContactId':_0x63da7e[_0x3421('0x9f')][_0x597132][_0x3421('0xc1')],'ListId':_0x63da7e[_0x3421('0x9f')][_0x597132]['ListId'],'VoiceQueueId':_0x63da7e[_0x3421('0x9f')][_0x597132][_0x3421('0xc3')]||undefined,'CampaignId':_0x63da7e[_0x3421('0x9f')][_0x597132][_0x3421('0x108')]||undefined})[_0x3421('0xa5')](loggerCatch(_0x3421('0x1a8')));delete _0x63da7e[_0x3421('0x9f')][_0x597132];}}else{return _0x63da7e[_0x3421('0x138')](_0x3179cd,_0x7e9d3d);}}else{if(getDiff(_0x7e9d3d[_0x3421('0x1aa')])<_0x3179cd[_0x3421('0x1ab')]*0x3c){_0x63da7e[_0x3421('0x86')]['run'](_0x7e9d3d['id'])[_0x3421('0x1e')](function(){_0x63da7e['updateOriginated'](_0x3179cd);});}else{_0x3179cd['outboundReCallsDay']+=0x1;_0x63da7e['updateOriginated'](_0x3179cd);if(_0x3179cd[_0x3421('0x1ac')]){_0x63da7e[_0x3421('0xb3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x7e9d3d[_0x3421('0xc1')],'ListId':_0x7e9d3d[_0x3421('0x100')],'VoiceQueueId':_0x7e9d3d[_0x3421('0xc3')]||undefined,'CampaignId':_0x7e9d3d[_0x3421('0x108')]||undefined})[_0x3421('0xa5')](loggerCatch(_0x3421('0x1ad')));_0x63da7e[_0x3421('0xba')](createObjHistory(_0x3179cd,_0x7e9d3d,'RECALLINQUEUE',0x17,_0x3421('0x1ae')))[_0x3421('0xa5')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x63da7e[_0x3421('0xbe')](createObjHistory(_0x3179cd,_0x7e9d3d,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0x3421('0x1af'),_0x3421('0x1b0'));}}}}else{_0x3179cd[_0x3421('0x5c')]+=0x1;_0x63da7e[_0x3421('0xbe')](createObjHistory(_0x3179cd,_0x7e9d3d,'BLACKLIST',0xd,_0x3421('0x1b1')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x3421('0x9b')][_0x3421('0x1b2')]=function(_0x38cf93){var _0x16c3f1=this;var _0x3e181d=[];var _0x503408=_0x38cf93[_0x3421('0x1b3')]-_0x38cf93[_0x3421('0x71')]-_0x38cf93[_0x3421('0x1b4')];emitCampaignSummary(_0x38cf93);if(_0x503408>0x0){if(_0x503408>this[_0x3421('0x24')]){_0x503408=this[_0x3421('0x24')];}_0x38cf93[_0x3421('0x1b4')]+=_0x503408;this['getContactDialerIvr'](_0x38cf93['id'],_0x503408,_0x38cf93['dialOrderByScheduledAt'])[_0x3421('0xac')](function(_0x2fe4f6){_0x38cf93[_0x3421('0x1b4')]-=_0x503408;_0x38cf93[_0x3421('0x1b4')]=_0x38cf93['temp']>0x0?_0x38cf93['temp']:0x0;if(!checkContactEmpty(_0x2fe4f6)){_0x38cf93['message']='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x3421('0x1b5')+_0x38cf93[_0x3421('0x3b')]);}else{_0x38cf93[_0x3421('0x71')]+=_0x2fe4f6[_0x3421('0x8b')];_0x38cf93['message']=_0x3421('0x1b6');for(var _0x37ea57=0x0;_0x37ea57<_0x2fe4f6[_0x3421('0x8b')];_0x37ea57+=0x1){_0x38cf93[_0x3421('0x1b7')]+=0x1;if(_[_0x3421('0xa2')](_0x2fe4f6[_0x37ea57])||_[_0x3421('0xa2')](_0x2fe4f6[_0x37ea57][_0x3421('0x139')])||_[_0x3421('0xa2')](_0x2fe4f6[_0x37ea57]['Contact'][_0x3421('0x13a')])){_0x16c3f1['emptyContact'](_0x3421('0x1b8'),_0x38cf93,_0x2fe4f6[_0x37ea57]);}else{_0x16c3f1[_0x3421('0xb0')](_[_0x3421('0xc0')](_0x2fe4f6[_0x37ea57],[_0x3421('0x108'),_0x3421('0x1b9')]))[_0x3421('0xac')](_0x16c3f1[_0x3421('0x1a4')](_0x38cf93,_0x2fe4f6[_0x37ea57]))[_0x3421('0xa5')](_0x16c3f1[_0x3421('0x1ba')](_0x3421('0x1bb'),_0x38cf93));}}}})[_0x3421('0xa5')](loggerGetContactDialer(_0x3421('0x1bc'),_0x38cf93,_0x503408));}};Dialer['prototype']['handlePower']=function(_0x5aa18c,_0x42162b){var _0x1476fe=this;var _0xb9615a=[];var _0x54a20d=_0x42162b>=0x1?_0x42162b:0x1;var _0x393a23=[];if(_0x5aa18c[_0x3421('0x55')]===_0x3421('0x8')){_0x54a20d=0x1;}var _0x5dd3ac=Math[_0x3421('0x185')](_0x5aa18c[_0x3421('0x4c')]*_0x54a20d)-_0x5aa18c[_0x3421('0x71')]-_0x5aa18c[_0x3421('0x1b4')];emitVoiceQueueSummary(_0x5aa18c);if(_0x5aa18c[_0x3421('0x1bd')]>0x0){var _0x320839=_0x5aa18c['dialLimitQueue']-_0x5aa18c[_0x3421('0x71')]-_0x5aa18c[_0x3421('0x51')]-_0x5aa18c[_0x3421('0x1b4')]-_0x5aa18c[_0x3421('0x4e')];if(_0x5dd3ac>_0x320839){_0x5dd3ac=_0x320839;}}if(_0x5dd3ac>0x0){if(_0x5aa18c[_0x3421('0x55')]===_0x3421('0x8')){_0x5dd3ac=0x1;}if(_0x5dd3ac>this[_0x3421('0x24')]){_0x5dd3ac=this['maxNumberOriginate'];}_0x5aa18c[_0x3421('0x1b4')]+=_0x5dd3ac;for(var _0x412bd2 in this['agents']){if(this[_0x3421('0x22')][_0x3421('0xa1')](_0x412bd2)){if(this[_0x3421('0x22')][_0x412bd2][_0x3421('0x97')]===_0x3421('0x1be')&&this['agents'][_0x412bd2]['status']===_0x3421('0xc8')){_0xb9615a['push'](this[_0x3421('0x22')][_0x412bd2]['id']);}}}this['getContactDialer'](_0x5aa18c['id'],_0xb9615a,_0x5dd3ac,_0x5aa18c[_0x3421('0x1bf')])[_0x3421('0xac')](function(_0x2980f2){_0x5aa18c[_0x3421('0x1b4')]-=_0x5dd3ac;_0x5aa18c[_0x3421('0x1b4')]=_0x5aa18c[_0x3421('0x1b4')]>0x0?_0x5aa18c[_0x3421('0x1b4')]:0x0;if(!checkContactEmpty(_0x2980f2)){_0x1476fe[_0x3421('0xad')](_0x5aa18c)[_0x3421('0xac')](sendMessageReschedule(_0x5aa18c))[_0x3421('0xa5')](loggerCatch(_0x3421('0xae')));}else{_0x5aa18c['originated']+=_0x2980f2[_0x3421('0x8b')];_0x5aa18c['message']=_0x5aa18c[_0x3421('0x55')]===_0x3421('0x8')?_0x3421('0x1c0'):_0x3421('0x1b6');for(var _0x218eab=0x0;_0x218eab<_0x2980f2[_0x3421('0x8b')];_0x218eab+=0x1){if(_[_0x3421('0xa2')](_0x2980f2[_0x218eab])||_[_0x3421('0xa2')](_0x2980f2[_0x218eab][_0x3421('0x139')])||_['isNil'](_0x2980f2[_0x218eab][_0x3421('0x139')][_0x3421('0x13a')])){_0x1476fe[_0x3421('0xbc')](_0x3421('0x1b8'),_0x5aa18c,_0x2980f2[_0x218eab]);}else{_0x1476fe[_0x3421('0xaf')](_['pick'](_0x2980f2[_0x218eab],[_0x3421('0xc3'),'Contact.phone']))[_0x3421('0xac')](_0x1476fe[_0x3421('0x1a4')](_0x5aa18c,_0x2980f2[_0x218eab]))[_0x3421('0xa5')](_0x1476fe[_0x3421('0x1ba')](_0x3421('0x1b8'),_0x5aa18c));}}}})[_0x3421('0xa5')](loggerGetContactDialer('[getContactDialer2]',_0x5aa18c,_0x5dd3ac));}};Dialer[_0x3421('0x9b')][_0x3421('0x85')]=function(_0x28b8c2){var _0x35e4b9=this;if(_0x28b8c2['dialLimitQueue']>0x0){var _0x305cb4=_0x28b8c2['dialLimitQueue']-_0x28b8c2['originated']-_0x28b8c2['talking'];if(_0x305cb4>0x0){this[_0x3421('0x1c1')](_0x28b8c2);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x3421('0x1c1')](_0x28b8c2);}};Dialer[_0x3421('0x9b')][_0x3421('0x1c1')]=function(_0x27acc8){var _0x3bde46=this;var _0x3e414d=[];_0x27acc8['originated']+=0x1;for(var _0x531e94 in this['agents']){if(this[_0x3421('0x22')]['hasOwnProperty'](_0x531e94)){if(this['agents'][_0x531e94]['state']===_0x3421('0x1be')&&this['agents'][_0x531e94][_0x3421('0xa3')]===_0x3421('0xc8')){_0x3e414d[_0x3421('0xf8')](this['agents'][_0x531e94]['id']);}}}this[_0x3421('0xb5')](_0x27acc8['id'],_0x3e414d,0x1,_0x27acc8[_0x3421('0x1bf')])[_0x3421('0xac')](function(_0x238fa4){if(!checkContactEmpty(_0x238fa4)){checkContactLowerLimitOriginate(_0x27acc8,0x1,0x0);_0x3bde46[_0x3421('0xad')](_0x27acc8)[_0x3421('0xac')](sendMessageReschedule(_0x27acc8))[_0x3421('0xa5')](loggerCatch('[countReScheduled]\x20'));}else{_0x27acc8[_0x3421('0x3d')]=_0x3421('0x1b6');if(_[_0x3421('0xa2')](_0x238fa4[0x0])||_[_0x3421('0xa2')](_0x238fa4[0x0][_0x3421('0x139')])||_[_0x3421('0xa2')](_0x238fa4[0x0][_0x3421('0x139')][_0x3421('0x13a')])){_0x3bde46[_0x3421('0xbc')](_0x3421('0x1b8'),_0x27acc8,_0x238fa4[0x0]);}else{_0x3bde46[_0x3421('0xaf')](_[_0x3421('0xc0')](_0x238fa4[0x0],[_0x3421('0xc3'),_0x3421('0x1b9')]))[_0x3421('0xac')](_0x3bde46[_0x3421('0x1a4')](_0x27acc8,_0x238fa4[0x0]))[_0x3421('0xa5')](_0x3bde46['loggerHandler'](_0x3421('0x1c2'),_0x27acc8));}}})[_0x3421('0xa5')](loggerGetContactDialer('[getContactDialerPredictive]',_0x27acc8,0x1));emitVoiceQueueSummary(_0x27acc8);};Dialer[_0x3421('0x9b')]['abandonmentRate']=function(_0x590745,_0x49a0d3,_0x56dcdb,_0x38abb9,_0x1b6103,_0x2e44df){loggerPredictive[_0x3421('0x79')]('[abandonmentRate]',_0x3421('0x1c3'),_0x590745,'\x20interval\x20=\x20',_0x49a0d3,'\x20Ts\x20=\x20',_0x56dcdb,_0x3421('0x1c4'),_0x38abb9,_0x3421('0x1c5'),_0x1b6103);return new BPromise(function(_0x4028e1,_0x4944cf){if(_0x590745<=0x0||isNaN(_0x590745)){return _0x4944cf(msgResponse(_0x3421('0x1c6'),'Error','m\x20=\x20'+_0x590745));}if(_0x56dcdb<=0x0||isNaN(_0x56dcdb)){return _0x4944cf(msgResponse('[abandonmentRate]',_0x3421('0x46'),_0x3421('0x1c7')+_0x56dcdb));}if(_0x38abb9<=0x0||isNaN(_0x38abb9)){return _0x4944cf(msgResponse(_0x3421('0x1c6'),'Error','p\x20=\x20'+_0x38abb9));}if(_0x49a0d3<=0x0||isNaN(_0x49a0d3)){return _0x4944cf(msgResponse(_0x3421('0x1c6'),'Error',_0x3421('0x1c8')+_0x49a0d3));}if(_0x1b6103<=0x0||isNaN(_0x1b6103)){return _0x4944cf(msgResponse(_0x3421('0x1c6'),_0x3421('0x46'),_0x3421('0x1c9')+_0x1b6103));}_0x2e44df=_0x2e44df||0x0;var _0x4592e6=0x1/_0x56dcdb;var _0x5dd047=0x0;var _0x429944=0x0;var _0xd26509=0x0;var _0x167a18=0x0;for(var _0x76591b=0x0;_0xd26509<_0x1b6103;_0x76591b+=0x1){_0x429944=_0x76591b/_0x49a0d3;_0x5dd047=(_0x38abb9*_0x429944+_0x2e44df)/_0x4592e6;_0xd26509=erlangb(_0x5dd047,_0x590745);_0x167a18=_0x5dd047/_0x590745*(0x1-erlangb(_0x5dd047,_0x590745));}return _0x4028e1({'erlangCalls':_0x76591b,'erlangCallToSecond':_0x49a0d3/_0x76591b,'erlangAbandonmentRate':_0xd26509,'erlangBusyFactor':_0x167a18});});};Dialer[_0x3421('0x9b')][_0x3421('0x19d')]=function(_0x27b977,_0x1fe950,_0x576714,_0x570d64,_0x42bf15,_0x4b3a99){loggerPredictive[_0x3421('0x79')](_0x3421('0x1ca'),_0x3421('0x1c3'),_0x27b977,_0x3421('0x1cb'),_0x1fe950,_0x3421('0x1cc'),_0x576714,_0x3421('0x1c4'),_0x570d64,'\x20Umin\x20=\x20',_0x42bf15);return new BPromise(function(_0x5bf696,_0x1d21b8){if(_0x27b977<=0x0||isNaN(_0x27b977)){return _0x1d21b8(msgResponse(_0x3421('0x1c6'),_0x3421('0x46'),_0x3421('0x1cd')+_0x27b977));}if(_0x576714<=0x0||isNaN(_0x576714)){return _0x1d21b8(msgResponse('[abandonmentRate]',_0x3421('0x46'),'Ts\x20=\x20'+_0x576714));}if(_0x570d64<=0x0||isNaN(_0x570d64)){return _0x1d21b8(msgResponse('[abandonmentRate]','Error',_0x3421('0x1ce')+_0x570d64));}if(_0x1fe950<=0x0||isNaN(_0x1fe950)){return _0x1d21b8(msgResponse(_0x3421('0x1c6'),'Error','interval\x20=\x20'+_0x1fe950));}if(_0x42bf15<=0x0||isNaN(_0x42bf15)){return _0x1d21b8(msgResponse(_0x3421('0x1c6'),_0x3421('0x46'),'Amax\x20=\x20'+_0x42bf15));}_0x4b3a99=_0x4b3a99||0x0;var _0x44e118=0x1/_0x576714;var _0x4e2feb=0x0;var _0x57ebbd=0x0;var _0x538e8a=0x0;var _0x18aca3=0x0;for(var _0x5ae846=0x0;_0x18aca3<_0x42bf15;_0x5ae846+=0x1){_0x57ebbd=_0x5ae846/_0x1fe950;_0x4e2feb=(_0x570d64*_0x57ebbd+_0x4b3a99)/_0x44e118;_0x538e8a=erlangb(_0x4e2feb,_0x27b977);_0x18aca3=_0x4e2feb/_0x27b977*(0x1-erlangb(_0x4e2feb,_0x27b977));}return _0x5bf696({'erlangCalls':_0x5ae846,'erlangCallToSecond':_0x1fe950/_0x5ae846,'erlangAbandonmentRate':_0x538e8a,'erlangBusyFactor':_0x18aca3});});};module['exports']=Dialer; \ No newline at end of file +var _0x8f4c=['reachable','SIP/%s','unmonitored','variable','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','membername','AMD','[syncHangupInAMD][createHistory]','MACHINE','Machine','amd','[syncMachine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncHangupIvr][createHistory]','AGI','[syncHangupIvr]','dialQueueProject','Unknow','reason','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','answertime','[syncAgentComplete][createHistory]','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','Drop','dropreason','TIMEOUT','queueCallerAbandonCreateState','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','actionid','locked','stateinterface','strategy','push','idHopper','queueStatusComplete','pick','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','paused','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','callerid','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','add','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','NoAnswer','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','countglobal','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','createStateFinal','reason\x205\x20busy','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','predictiveIntervalPauses','predictiveIntervalLowerLimit','floor','erlangCalls','erlangAbandonmentRate','[startMethodPredictive][StartProgressive][First]','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Date]','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][LowerLimitInterval]','Agent\x20free','agent\x20max\x20free\x20','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','[averageHandleTime][ErlangB]\x20','dialPredictiveInterval','[startMethodPredictive][StartPredictive][Repeat]','outboundQueuePauses','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[CatchErlangB]','[getDataPredictive]','check\x20failure','erlangCallToSecond','[startMethodPredictive]','[handlePredictive]','[startMethodPredictive][milliseconds]\x20','Failure\x20','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','[abandonmentRate]','\x20m\x20=\x20','\x20interval\x20=\x20','\x20Ts\x20=\x20','\x20p\x20=\x20','\x20Amax\x20=\x20','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','[busyFactor]','\x20Umin\x20=\x20','Ts\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','originated','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','predictiveIntervalTotalCalls','isUndefined','info','[checkGetDataPredictive][avgTalktime]','[checkGetDataPredictive][avgHoldtime]','[checkGetDataPredictive][totalCalls]','[checkGetDataPredictive][obj]','merge','seconds','[freeVariablesPredictive]','handlePredictive','preview','\x22%s\x22\x20<%s>','inspect','error','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[actions]','sequence','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable'];(function(_0x469f02,_0x880250){var _0x1a2a30=function(_0x514b5e){while(--_0x514b5e){_0x469f02['push'](_0x469f02['shift']());}};_0x1a2a30(++_0x880250);}(_0x8f4c,0x113));var _0xc8f4=function(_0x45c320,_0x53aad1){_0x45c320=_0x45c320-0x0;var _0x285e5c=_0x8f4c[_0x45c320];return _0x285e5c;};'use strict';var util=require(_0xc8f4('0x0'));var _=require(_0xc8f4('0x1'));var BPromise=require(_0xc8f4('0x2'));var uuid=require(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var rr=require('rr');var md5=require(_0xc8f4('0x5'));var Redis=require('ioredis');var config=require(_0xc8f4('0x6'));var logger=require(_0xc8f4('0x7'))(_0xc8f4('0x8'));var loggerBooked=require('../../../config/logger')(_0xc8f4('0x9'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0xc8f4('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xc8f4('0xb'));var ami=require(_0xc8f4('0xc'));config[_0xc8f4('0xd')]=_[_0xc8f4('0xe')](config[_0xc8f4('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0xc8f4('0xf'))(new Redis(config[_0xc8f4('0xd')]));var cmHopper=require(_0xc8f4('0x10'));var cmHopperFinal=require(_0xc8f4('0x11'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xc8f4('0x12'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xc8f4('0x13'));var History=require(_0xc8f4('0x14'));var Final=require(_0xc8f4('0x15'));var AgentComplete=require(_0xc8f4('0x16'));var QueueCallerAbandon=require(_0xc8f4('0x17'));var Hangup=require('./hangup');var ipAgi=process[_0xc8f4('0x18')][_0xc8f4('0x19')]||_0xc8f4('0x1a');var strategy={'rrmemory':_0xc8f4('0x1b'),'roundrobin':_0xc8f4('0x1c')};var Sequence=function(){};Sequence[_0xc8f4('0x1d')]['enqueue']=function(_0x2bce00){this[_0xc8f4('0x1e')]=this[_0xc8f4('0x1e')]?this[_0xc8f4('0x1e')][_0xc8f4('0x1f')](_0x2bce00):_0x2bce00();};function Dialer(_0x56a25d,_0xac45d5){this['sequence']=new Sequence();this['preview']=_0xac45d5;this[_0xc8f4('0x20')]=_0x56a25d[_0xc8f4('0x20')];this[_0xc8f4('0x21')]=_0x56a25d[_0xc8f4('0x21')];this[_0xc8f4('0x22')]=_0x56a25d[_0xc8f4('0x22')];this[_0xc8f4('0x23')]=_0x56a25d[_0xc8f4('0x23')];this[_0xc8f4('0x24')]=config[_0xc8f4('0x24')]||0x2;this[_0xc8f4('0x25')]={};this[_0xc8f4('0x26')]={};this[_0xc8f4('0x27')]={};this['uniqueId']={};this[_0xc8f4('0x28')]={};this[_0xc8f4('0x29')]={};this[_0xc8f4('0x2a')]={};this[_0xc8f4('0x2b')]={};this[_0xc8f4('0x2c')]={};this[_0xc8f4('0x2d')]={};ami['on'](_0xc8f4('0x2e'),this[_0xc8f4('0x2f')]['bind'](this));ami['on'](_0xc8f4('0x30'),this[_0xc8f4('0x31')][_0xc8f4('0x32')](this));ami['on'](_0xc8f4('0x33'),this['syncOriginateResponse'][_0xc8f4('0x32')](this));ami['on']('agentcomplete',this[_0xc8f4('0x34')]['bind'](this));ami['on'](_0xc8f4('0x35'),this[_0xc8f4('0xb')]['bind'](this));ami['on'](_0xc8f4('0x36'),this[_0xc8f4('0x37')][_0xc8f4('0x32')](this));ami['on'](_0xc8f4('0x38'),this['syncNewExten'][_0xc8f4('0x32')](this));ami['on'](_0xc8f4('0x39'),this['syncVarSet'][_0xc8f4('0x32')](this));ami['on'](_0xc8f4('0x3a'),this[_0xc8f4('0x3b')][_0xc8f4('0x32')](this));ami['on'](_0xc8f4('0x3c'),this[_0xc8f4('0x3d')]['bind'](this));this[_0xc8f4('0x3e')]();this[_0xc8f4('0x3f')]();}function isNotNull(_0x1ea3d9){return _0x1ea3d9!==null&&!_['isUndefined'](_0x1ea3d9);}function checkIsLoggedIn(_0xf4a556,_0x3a4b1b){return function(){if(_0x3a4b1b<=0x0){_0xf4a556['message']='AGENTS_NOT_LOGGED';throw _0xf4a556['name']+_0xc8f4('0x40');}};}function isActive(_0x323432){return _0x323432;}function checkIsActive(_0x2e9a2a,_0x28baa0){return function(){if(!isActive(_0x28baa0)){_0x2e9a2a[_0xc8f4('0x41')]=_0xc8f4('0x42');throw _0x2e9a2a[_0xc8f4('0x43')]+_0xc8f4('0x44');}};}function checkInterval(_0x4b4203){return function(){if(!isNotNull(_0x4b4203[_0xc8f4('0x45')])){_0x4b4203[_0xc8f4('0x41')]=_0xc8f4('0x46');throw _0x4b4203['name']+_0xc8f4('0x47');}if(!isNotNull(_0x4b4203[_0xc8f4('0x45')]['Intervals'])){_0x4b4203[_0xc8f4('0x41')]=_0xc8f4('0x46');throw _0x4b4203[_0xc8f4('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xc8f4('0x48')](_0x4b4203[_0xc8f4('0x45')][_0xc8f4('0x49')]))){_0x4b4203['message']=_0xc8f4('0x46');throw _0x4b4203[_0xc8f4('0x43')]+_0xc8f4('0x47');}};}function msgResponse(_0x1f8ef6,_0x215203,_0x44de68){return{'action':_0x1f8ef6,'response':_0x215203,'message':_0x44de68};}function myreject(_0xeacb80){return function(_0x287ece){return _0xeacb80(msgResponse(_0xc8f4('0x4a'),_0xc8f4('0x4b'),JSON[_0xc8f4('0x4c')](_0x287ece)));};}function getSeconds(_0x12402b,_0x255888){var _0x12e63b=moment(_0x12402b)[_0xc8f4('0x4d')](0x0);var _0x453640=moment(_0x255888)['milliseconds'](0x0);return _0x12e63b[_0xc8f4('0x4e')](_0x453640,'seconds');}function emit(_0x7d06d3,_0x51bfe6,_0x399e64){io['to'](_0x7d06d3)[_0xc8f4('0x4f')](_0x51bfe6,_0x399e64);}function emitVoiceQueueSummary(_0x7ef69a){if(_0x7ef69a[_0xc8f4('0x50')]===_0xc8f4('0x51')){var _0x724060={'id':_0x7ef69a['id'],'name':_0x7ef69a[_0xc8f4('0x43')],'strategy':_0x7ef69a['strategy'],'answered':_0x7ef69a[_0xc8f4('0x52')],'available':_0x7ef69a[_0xc8f4('0x53')],'loggedIn':_0x7ef69a[_0xc8f4('0x54')],'pTalking':_0x7ef69a[_0xc8f4('0x55')],'sumBillable':_0x7ef69a['sumBillable'],'sumDuration':_0x7ef69a[_0xc8f4('0x56')],'sumHoldTime':_0x7ef69a[_0xc8f4('0x57')]||0x0,'talking':_0x7ef69a[_0xc8f4('0x58')],'total':_0x7ef69a[_0xc8f4('0x59')],'type':_0x7ef69a[_0xc8f4('0x50')],'unmanaged':_0x7ef69a[_0xc8f4('0x5a')],'abandoned':_0x7ef69a[_0xc8f4('0x5b')],'waiting':_0x7ef69a[_0xc8f4('0x5c')],'loggedInDb':_0x7ef69a[_0xc8f4('0x5d')],'dialActive':_0x7ef69a[_0xc8f4('0x5e')],'dialMethod':_0x7ef69a[_0xc8f4('0x5f')],'dialOriginateCallerIdName':_0x7ef69a[_0xc8f4('0x60')],'dialOriginateCallerIdNumber':_0x7ef69a['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x7ef69a[_0xc8f4('0x61')],'dialPrefix':_0x7ef69a[_0xc8f4('0x62')],'outboundAnswerAgiCallsDay':_0x7ef69a[_0xc8f4('0x63')],'outboundAnswerCallsDay':_0x7ef69a[_0xc8f4('0x64')],'outboundBlacklistCallsDay':_0x7ef69a['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x7ef69a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x7ef69a[_0xc8f4('0x65')],'outboundDropCallsDayACS':_0x7ef69a[_0xc8f4('0x66')],'outboundDropCallsDayCallersExit':_0x7ef69a['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x7ef69a[_0xc8f4('0x67')],'outboundNoAnswerCallsDay':_0x7ef69a[_0xc8f4('0x68')],'outboundNoSuchCallsDay':_0x7ef69a['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x7ef69a['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x7ef69a[_0xc8f4('0x69')],'outboundRejectCallsDay':_0x7ef69a[_0xc8f4('0x6a')],'outboundUnknownCallsDay':_0x7ef69a[_0xc8f4('0x6b')],'predictiveIntervalAnsweredCalls':_0x7ef69a[_0xc8f4('0x6c')],'predictiveIntervalAvgHoldtime':_0x7ef69a[_0xc8f4('0x6d')],'predictiveIntervalAvgTalktime':_0x7ef69a[_0xc8f4('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x7ef69a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x7ef69a['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x7ef69a[_0xc8f4('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x7ef69a[_0xc8f4('0x70')],'predictiveIntervalHitRate':_0x7ef69a[_0xc8f4('0x71')],'predictiveIntervalLowerLimit':_0x7ef69a['predictiveIntervalLowerLimit'],'predictiveIntervalMultiplicativeFactor':_0x7ef69a['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x7ef69a['predictiveIntervalPauses'],'predictiveIntervalTotalCalls':_0x7ef69a['predictiveIntervalTotalCalls'],'message':_0x7ef69a['message'],'originated':_0x7ef69a[_0xc8f4('0x72')]};if(_0x7ef69a[_0xc8f4('0x73')]){_0x724060[_0xc8f4('0x73')]={'id':_0x7ef69a[_0xc8f4('0x73')]['id'],'name':_0x7ef69a[_0xc8f4('0x73')][_0xc8f4('0x43')],'active':_0x7ef69a['Trunk'][_0xc8f4('0x74')],'callerid':_0x7ef69a[_0xc8f4('0x73')]['callerid']};}if(_0x7ef69a['Interval']){_0x724060[_0xc8f4('0x45')]={'id':_0x7ef69a[_0xc8f4('0x45')]['id'],'name':_0x7ef69a[_0xc8f4('0x45')][_0xc8f4('0x43')]};}var _0x5ae9dc=md5(JSON['stringify'](_0x724060));if(_0x7ef69a[_0xc8f4('0x5')]!==_0x5ae9dc){_0x7ef69a[_0xc8f4('0x5')]=_0x5ae9dc;emit(util[_0xc8f4('0x75')](_0xc8f4('0x76'),_0x724060[_0xc8f4('0x43')]),_0xc8f4('0x77'),_0x724060);}}}function emitCampaignSummary(_0x542a9c){if(_0x542a9c['type']===_0xc8f4('0x78')){emit(util[_0xc8f4('0x75')](_0xc8f4('0x79'),_0x542a9c[_0xc8f4('0x43')]),_0xc8f4('0x7a'),_0x542a9c);}}function checkGetDataPredictive(_0x104a98){if(isNotNull(_0x104a98)){if(!_[_0xc8f4('0x48')](_0x104a98)){if(_0x104a98[_0xc8f4('0x7b')]>0x0){if(!_[_0xc8f4('0x7c')](_0x104a98['predictiveIntervalAvgTalktime'])&&_0x104a98['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x7e'),JSON[_0xc8f4('0x4c')](_0x104a98));}if(!_[_0xc8f4('0x7c')](_0x104a98[_0xc8f4('0x6d')])&&_0x104a98[_0xc8f4('0x6d')]>0x0){return!![];}else{loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x7f'),JSON[_0xc8f4('0x4c')](_0x104a98));}}else{loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x80'),JSON[_0xc8f4('0x4c')](_0x104a98));}}else{loggerPredictive[_0xc8f4('0x7d')]('[checkGetDataPredictive][objIsEmpty]',JSON[_0xc8f4('0x4c')](_0x104a98));}}else{loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x81'),JSON[_0xc8f4('0x4c')](_0x104a98));}return![];}function mergeDataErlangB(_0x481dd2){return function(_0xd6052d){loggerPredictive[_0xc8f4('0x7d')]('[ErlangB]',JSON['stringify'](_0xd6052d));_[_0xc8f4('0x82')](_0x481dd2,_0xd6052d);};}function getDiff(_0x5cc52d){var _0x1083c7=moment()[_0xc8f4('0x4d')](0x0);var _0x4685bb=moment(_0x5cc52d)[_0xc8f4('0x4d')](0x0);return _0x1083c7[_0xc8f4('0x4e')](_0x4685bb,_0xc8f4('0x83'));}function ifInterval(_0x2ff523,_0x1f7602){if(_[_0xc8f4('0x7c')](_0x1f7602)){return![];}if(getDiff(_0x1f7602)<_0x2ff523*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x305edb){if(isNotNull(_0x305edb)){if(!_[_0xc8f4('0x7c')](_0x305edb['startProgressive'])){_0x305edb[_0xc8f4('0x2a')]=undefined;loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x84'),_0xc8f4('0x2a'),_0x305edb['name']);}if(!_[_0xc8f4('0x7c')](_0x305edb['startPredictive'])){_0x305edb['startPredictive']=undefined;loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x84'),_0xc8f4('0x29'),_0x305edb[_0xc8f4('0x43')]);}if(!_[_0xc8f4('0x7c')](_0x305edb[_0xc8f4('0x85')])){clearInterval(_0x305edb['handlePredictive']);_0x305edb['handlePredictive']=undefined;loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x84'),_0xc8f4('0x85'),_0x305edb[_0xc8f4('0x43')]);}}}function erlangb(_0x25369e,_0x19a024){if(_0x19a024===0x0){return 0x0;}var _0x443148=0x1;for(var _0x55eb60=0x1;_0x55eb60<=_0x19a024;_0x55eb60+=0x1){_0x443148=0x1+_0x443148*_0x55eb60/_0x25369e;}return 0x1/_0x443148;}function isVoiceQueueOutbound(_0xaca3b9){return _0xaca3b9===_0xc8f4('0x51');}function isNotPreview(_0x4edf8e){return _0x4edf8e!==_0xc8f4('0x86');}function isCampaignIvr(_0x2da305){return _0x2da305===_0xc8f4('0x78');}function getCallerId(_0x5b8bf4,_0x368798,_0x3aa12d){if(!_[_0xc8f4('0x7c')](_0x3aa12d)&&'string'===typeof _0x3aa12d&&!_[_0xc8f4('0x48')](_0x3aa12d)){if(!_[_0xc8f4('0x7c')](_0x368798)&&'string'===typeof _0x368798&&!_['isEmpty'](_0x368798)){return util[_0xc8f4('0x75')]('\x22%s\x22\x20<%s>',_0x368798,_0x3aa12d);}return util[_0xc8f4('0x75')](_0xc8f4('0x87'),_0x3aa12d,_0x3aa12d);}if(!_['isUndefined'](_0x5b8bf4)&&'string'===typeof _0x5b8bf4&&!_['isEmpty'](_0x5b8bf4)){return _0x5b8bf4;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x4b619c,_0x4f66d1){return function(_0x32665c){freeVariablesPredictive(_0x4f66d1);emitVoiceQueueSummary(_0x4f66d1);emitCampaignSummary(_0x4f66d1);loggerSyncQueueSummary['error'](_0x4b619c,util[_0xc8f4('0x88')](_0x32665c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x357e45,_0x16a3cc){return function(_0x29231d){loggerPredictive['error'](_0x357e45,JSON[_0xc8f4('0x4c')](_0x29231d));freeVariablesPredictive(_0x16a3cc);};}function loggerCatch(_0x329c26){return function(_0x3ca2ca){logger[_0xc8f4('0x89')](_0x329c26,util['inspect'](_0x3ca2ca,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x435b04){return _0x435b04&&!_[_0xc8f4('0x7c')](_0x435b04)&&_0x435b04[_0xc8f4('0x8a')]>0x0;}function decremetOriginate(_0x3761cc){if(!_['isUndefined'](_0x3761cc)&&_0x3761cc!==null){if(_0x3761cc[_0xc8f4('0x8b')](_0xc8f4('0x72'))){if(_0x3761cc['originated']>0x0){_0x3761cc[_0xc8f4('0x72')]-=0x1;}else{logger[_0xc8f4('0x89')](_0xc8f4('0x8c'));}}}else{logger[_0xc8f4('0x89')](_0xc8f4('0x8d'));}}function checkContactLowerLimitOriginate(_0x239e4d,_0x5362c8,_0xc0422a){if(_0x5362c8>_0xc0422a){for(var _0x269766=0x0;_0x269766<_0x5362c8-_0xc0422a;_0x269766+=0x1){decremetOriginate(_0x239e4d);}}}function loggerGetContactDialer(_0x3d493c,_0x5e5117,_0x28db1f){return function(_0x2b6510){checkContactLowerLimitOriginate(_0x5e5117,_0x28db1f,0x0);logger[_0xc8f4('0x89')](_0x3d493c,util['inspect'](_0x2b6510,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x199873){return function(_0x38a486){if(isNotNull(_0x38a486)&&isNotNull(_0x38a486[0x0])){if(_0x38a486[0x0][_0xc8f4('0x8e')]>0x0){_0x199873[_0xc8f4('0x41')]='RESCHEDULED_CONTACTS';logger[_0xc8f4('0x7d')](_0xc8f4('0x8f')+_0x199873['name'],_0x38a486[0x0][_0xc8f4('0x8e')],_0xc8f4('0x90'));}else{_0x199873['message']=_0xc8f4('0x91');logger[_0xc8f4('0x7d')](_0xc8f4('0x92')+_0x199873[_0xc8f4('0x43')]);}}};}function notSendMessagesQueue(_0x7f903e){if(_0x7f903e[_0xc8f4('0x93')]){freeVariablesPredictive(_0x7f903e);if(_0x7f903e[_0xc8f4('0x72')]===0x0&&_0x7f903e[_0xc8f4('0x58')]===0x0&&_0x7f903e['waiting']===0x0&&(_0x7f903e[_0xc8f4('0x55')]||0x0)===0x0){_0x7f903e[_0xc8f4('0x93')]=![];_0x7f903e[_0xc8f4('0x53')]=0x0;_0x7f903e[_0xc8f4('0x41')]=_0xc8f4('0x42');loggerSyncQueueSummary['error'](_0xc8f4('0x94'),_0x7f903e['name'],_0xc8f4('0x95'));}else{_0x7f903e[_0xc8f4('0x41')]=_0xc8f4('0x96');loggerSyncQueueSummary[_0xc8f4('0x89')](_0xc8f4('0x94'),_0x7f903e[_0xc8f4('0x43')],_0xc8f4('0x97'));}emitVoiceQueueSummary(_0x7f903e);}}function notSendMessagesCampaign(_0x20871d){if(_0x20871d[_0xc8f4('0x93')]){if(_0x20871d[_0xc8f4('0x72')]===0x0){_0x20871d[_0xc8f4('0x93')]=![];_0x20871d['message']=_0xc8f4('0x42');loggerSyncQueueSummary[_0xc8f4('0x89')](_0xc8f4('0x98'),_0x20871d[_0xc8f4('0x43')],'is\x20not\x20active');}else{_0x20871d['message']=_0xc8f4('0x96');loggerSyncQueueSummary['error'](_0xc8f4('0x98'),_0x20871d['name'],_0xc8f4('0x97'));}emitCampaignSummary(_0x20871d);}}function createObjHistory(_0x4e973c,_0x54a995,_0x4a1cac,_0x5bc4a0,_0x5eab20){_0x4e973c['message']=_0x4a1cac;var _0x4595e8=new Action(_0x4e973c,_0x54a995);var _0x4819dd=new History(_0x4595e8);_0x4819dd[_0xc8f4('0x99')]=_0x5bc4a0;_0x4819dd[_0xc8f4('0x9a')]=_0x5eab20;_0x4819dd[_0xc8f4('0x9b')]=_0x4595e8[_0xc8f4('0x9c')];return _0x4819dd;}Dialer[_0xc8f4('0x1d')]['loopClearZombieChannels']=function(){var _0x181955=this;setInterval(function(){_0x181955[_0xc8f4('0x9d')](_0x181955[_0xc8f4('0x9e')],'[uniqueid]');_0x181955[_0xc8f4('0x9d')](_0x181955[_0xc8f4('0x26')],_0xc8f4('0x9f'));},0x32c8);};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x9d')]=function(_0x3b445b,_0x38e314){var _0x1401f1=this;for(var _0x4d7018 in _0x3b445b){if(_0x3b445b[_0xc8f4('0x8b')](_0x4d7018)){this[_0xc8f4('0xa0')][_0xc8f4('0xa1')](function(){if(!_[_0xc8f4('0xa2')](_0x3b445b[_0x4d7018])){return ami[_0xc8f4('0xa3')]({'action':_0xc8f4('0xa4'),'channel':_0x3b445b[_0x4d7018][_0xc8f4('0xa5')]})[_0xc8f4('0xa6')](function(_0x14abbe){if(_0x14abbe[_0xc8f4('0x41')]===_0xc8f4('0xa7')){setTimeout(function(){if(_0x3b445b[_0x4d7018]&&_0x3b445b[_0x4d7018]['type']!==_0xc8f4('0x78')){_0x1401f1[_0xc8f4('0xa8')](_0x1401f1['voiceQueues'][_0x3b445b[_0x4d7018][_0xc8f4('0xa9')]]);logger[_0xc8f4('0x89')]('[Dialer][checkChannel]',_0x38e314,_0x4d7018,_0x3b445b[_0x4d7018][_0xc8f4('0xa9')]);delete _0x3b445b[_0x4d7018];}if(_0x3b445b[_0x4d7018]&&_0x3b445b[_0x4d7018][_0xc8f4('0x50')]==='ivr'){_0x1401f1['updateOriginated'](_0x1401f1[_0xc8f4('0x21')][_0x3b445b[_0x4d7018][_0xc8f4('0xa9')]]);logger[_0xc8f4('0x89')]('[Dialer][checkChannel][ivr]',_0x38e314,_0x4d7018,_0x3b445b[_0x4d7018][_0xc8f4('0xa9')]);delete _0x3b445b[_0x4d7018];}},0x2328);}});}});}}};Dialer[_0xc8f4('0x1d')]['countReScheduled']=function(_0x506c2f){return BPromise[_0xc8f4('0xaa')]()[_0xc8f4('0xab')](cmHopper[_0xc8f4('0xac')](_0x506c2f))['catch'](loggerCatch(_0xc8f4('0xad')));};Dialer[_0xc8f4('0x1d')][_0xc8f4('0xae')]=function(_0x515d4f){return BPromise[_0xc8f4('0xaa')]()[_0xc8f4('0xab')](cmHopperBlack[_0xc8f4('0xae')](_0x515d4f))[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0xaf')));};Dialer[_0xc8f4('0x1d')][_0xc8f4('0xb0')]=function(_0x319538){return BPromise[_0xc8f4('0xaa')]()[_0xc8f4('0xab')](cmHopperBlack[_0xc8f4('0xb0')](_0x319538))['catch'](loggerCatch(_0xc8f4('0xb1')));};Dialer['prototype'][_0xc8f4('0xb2')]=function(_0x39896d){return BPromise[_0xc8f4('0xaa')]()[_0xc8f4('0xab')](cmHopperHistory[_0xc8f4('0xb3')](_0x39896d))[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0xb4')));};Dialer[_0xc8f4('0x1d')]['rescheduleContact']=function(_0x2c962e){return BPromise['resolve']()['then'](cmHopper[_0xc8f4('0xb5')](_0x2c962e))[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0xb6')));};Dialer['prototype']['getContactDialer']=function(_0x19c3c3,_0x308c50,_0x1f10d3,_0x4ee52c){return BPromise[_0xc8f4('0xaa')]()['then'](cmHopper[_0xc8f4('0xb7')](_0x19c3c3,_0x308c50,_0x1f10d3,_0x4ee52c))[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0xb8')));};Dialer[_0xc8f4('0x1d')][_0xc8f4('0xb9')]=function(_0x49c4b5,_0x19bf47,_0x4ee9ef){return BPromise[_0xc8f4('0xaa')]()[_0xc8f4('0xab')](cmHopper[_0xc8f4('0xb9')](_0x49c4b5,_0x19bf47,_0x4ee9ef))[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0xb8')));};Dialer[_0xc8f4('0x1d')][_0xc8f4('0xba')]=function(_0x202052){return BPromise[_0xc8f4('0xaa')]()[_0xc8f4('0xab')](voiceQueueRt[_0xc8f4('0xba')](_0x202052))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xc8f4('0x1d')][_0xc8f4('0xbb')]=function(_0x13a274){return BPromise[_0xc8f4('0xaa')]()[_0xc8f4('0xab')](cmHopper[_0xc8f4('0xbb')](_0x13a274))[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0xbc')));};Dialer[_0xc8f4('0x1d')][_0xc8f4('0xbd')]=function(_0x7e6407){return BPromise[_0xc8f4('0xaa')]()['then'](cmHopperHistory['createHistory'](_0x7e6407))[_0xc8f4('0xa6')](loggerCatch('[createHistory]\x20'));};Dialer['prototype'][_0xc8f4('0xa8')]=function(_0x4c525e){if(!_['isUndefined'](_0x4c525e)&&_0x4c525e!==null){if(_0x4c525e['hasOwnProperty']('originated')){if(_0x4c525e['originated']>0x0){_0x4c525e[_0xc8f4('0x72')]-=0x1;}else{logger[_0xc8f4('0x89')](_0xc8f4('0xbe'));}}}else{logger[_0xc8f4('0x89')](_0xc8f4('0xbf'));}};Dialer[_0xc8f4('0x1d')][_0xc8f4('0xc0')]=function(_0x21e214,_0x1425c7){var _0x170c74=this;return function(_0x317d96){_0x170c74[_0xc8f4('0xa8')](_0x1425c7);logger[_0xc8f4('0x89')](_0x21e214,util[_0xc8f4('0x88')](_0x317d96,{'showHidden':![],'depth':null}));};};Dialer[_0xc8f4('0x1d')][_0xc8f4('0xc1')]=function(_0x3a86b2,_0x20ea4d,_0xd8a37c){var _0x35c5e9={'state':0x19,'statedesc':_0xc8f4('0xc2')};this[_0xc8f4('0xa8')](_0x20ea4d);this[_0xc8f4('0xc3')](_['merge'](_0x35c5e9,_['pick'](_0xd8a37c,[_0xc8f4('0xc4'),_0xc8f4('0xc5'),_0xc8f4('0xc6'),_0xc8f4('0xc7'),_0xc8f4('0xc8')])),_0xc8f4('0xc9'),_0xc8f4('0xca'));logger[_0xc8f4('0x89')](_0x3a86b2);};Dialer[_0xc8f4('0x1d')][_0xc8f4('0xcb')]=function(_0x2a7482){return _0x2a7482===_0xc8f4('0xcc');};Dialer[_0xc8f4('0x1d')][_0xc8f4('0xcd')]=function(_0x47a48c){return!_[_0xc8f4('0x7c')](_0x47a48c)&&_0x47a48c&&!_[_0xc8f4('0x7c')](_0x47a48c[_0xc8f4('0x43')])&&!_[_0xc8f4('0x7c')](_0x47a48c[_0xc8f4('0x74')])&&_0x47a48c['active']&&(this[_0xc8f4('0x23')][util[_0xc8f4('0x75')]('SIP/%s',_0x47a48c['name'])][_0xc8f4('0xa4')]===_0xc8f4('0xce')||this[_0xc8f4('0x23')][util[_0xc8f4('0x75')](_0xc8f4('0xcf'),_0x47a48c['name'])]['status']===_0xc8f4('0xd0'));};Dialer[_0xc8f4('0x1d')]['saveInDb']=function(_0x3f195b,_0x3ac20c,_0x1efd14){this[_0xc8f4('0xbd')](_0x3f195b)[_0xc8f4('0xa6')](loggerCatch(_0x3ac20c));this[_0xc8f4('0xbb')](_0x3f195b)[_0xc8f4('0xa6')](loggerCatch(_0x1efd14));};Dialer[_0xc8f4('0x1d')]['syncVarSet']=function(_0x23177d){var _0xc24a8f=this[_0xc8f4('0x9e')][_0x23177d['uniqueid']];var _0x5f6dc6;if(!_['isNil'](_0x23177d)&&!_[_0xc8f4('0xa2')](_0x23177d[_0xc8f4('0xd1')])&&!_[_0xc8f4('0xa2')](_0x23177d['variable'][_0xc8f4('0xd2')])&&_0x23177d['exten']===_0xc8f4('0xd3')&&_0xc24a8f){if(_0xc24a8f[_0xc8f4('0x50')]!==_0xc8f4('0x78')&&this['voiceQueues'][_0xc24a8f[_0xc8f4('0xa9')]][_0xc8f4('0xd4')]&&_0x23177d[_0xc8f4('0xd5')]===_0xc8f4('0xd6')){delete this['uniqueId'][_0x23177d[_0xc8f4('0xd7')]];this['updateOriginated'](this[_0xc8f4('0x20')][_0xc24a8f['queue']]);this[_0xc8f4('0x20')][_0xc24a8f[_0xc8f4('0xa9')]]['outboundAnswerCallsDay']+=0x1;this[_0xc8f4('0x20')][_0xc24a8f[_0xc8f4('0xa9')]][_0xc8f4('0x63')]+=0x1;_0x5f6dc6=new Hangup(_0xc24a8f,_0x23177d);_0x5f6dc6[_0xc8f4('0x99')]=0x12;_0x5f6dc6[_0xc8f4('0x9a')]='HangupInAMD';_0x5f6dc6[_0xc8f4('0xd8')]=_0xc8f4('0xd9');this[_0xc8f4('0xc3')](_0x5f6dc6,_0xc8f4('0xda'),'[syncHangupInAMD]');}if(_0xc24a8f[_0xc8f4('0x50')]!==_0xc8f4('0x78')&&this[_0xc8f4('0x20')][_0xc24a8f[_0xc8f4('0xa9')]]['dialAMDActive']&&_0x23177d[_0xc8f4('0xd5')]===_0xc8f4('0xdb')){delete this[_0xc8f4('0x9e')][_0x23177d[_0xc8f4('0xd7')]];this[_0xc8f4('0xa8')](this[_0xc8f4('0x20')][_0xc24a8f['queue']]);this[_0xc8f4('0x20')][_0xc24a8f[_0xc8f4('0xa9')]]['outboundAnswerCallsDay']+=0x1;this[_0xc8f4('0x20')][_0xc24a8f[_0xc8f4('0xa9')]][_0xc8f4('0x63')]+=0x1;_0x5f6dc6=new Hangup(_0xc24a8f,_0x23177d);_0x5f6dc6[_0xc8f4('0x99')]=0x13;_0x5f6dc6['statedesc']=_0xc8f4('0xdc');_0x5f6dc6['membername']=_0xc8f4('0xd9');_0x5f6dc6[_0xc8f4('0xdd')]=!![];this[_0xc8f4('0xc3')](_0x5f6dc6,'[syncMachine][createHistory]',_0xc8f4('0xde'));}if(_0xc24a8f[_0xc8f4('0x50')]===_0xc8f4('0x78')&&this[_0xc8f4('0x21')][_0xc24a8f[_0xc8f4('0xa9')]][_0xc8f4('0xd4')]&&_0x23177d[_0xc8f4('0xd5')]==='HANGUP'){delete this[_0xc8f4('0x9e')][_0x23177d[_0xc8f4('0xd7')]];this[_0xc8f4('0xa8')](this[_0xc8f4('0x21')][_0xc24a8f[_0xc8f4('0xa9')]]);_0x5f6dc6=new Hangup(_0xc24a8f,_0x23177d);_0x5f6dc6[_0xc8f4('0x99')]=0x12;_0x5f6dc6[_0xc8f4('0x9a')]=_0xc8f4('0xdf');_0x5f6dc6[_0xc8f4('0xd8')]=_0xc8f4('0xd9');this[_0xc8f4('0xc3')](_0x5f6dc6,_0xc8f4('0xe0'),_0xc8f4('0xe1'));}if(_0xc24a8f[_0xc8f4('0x50')]===_0xc8f4('0x78')&&this[_0xc8f4('0x21')][_0xc24a8f[_0xc8f4('0xa9')]][_0xc8f4('0xd4')]&&_0x23177d[_0xc8f4('0xd5')]===_0xc8f4('0xdb')){delete this['uniqueId'][_0x23177d['uniqueid']];this[_0xc8f4('0xa8')](this['campaigns'][_0xc24a8f['queue']]);_0x5f6dc6=new Hangup(_0xc24a8f,_0x23177d);_0x5f6dc6[_0xc8f4('0x99')]=0x13;_0x5f6dc6[_0xc8f4('0x9a')]='Machine';_0x5f6dc6['membername']='AMD';_0x5f6dc6['amd']=!![];this[_0xc8f4('0xc3')](_0x5f6dc6,'[syncMachineIvr][createHistory]','[syncMachineIvr]');}}};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x37')]=function(_0x1ff85b){var _0x13c3f1=this[_0xc8f4('0x9e')][_0x1ff85b[_0xc8f4('0xd7')]];var _0x34a545=this;var _0x2a3828;if(_0x13c3f1&&_0x13c3f1[_0xc8f4('0x50')]===_0xc8f4('0x78')){delete this['uniqueId'][_0x1ff85b[_0xc8f4('0xd7')]];this[_0xc8f4('0xa8')](this[_0xc8f4('0x21')][_0x13c3f1[_0xc8f4('0xa9')]]);this[_0xc8f4('0x21')][_0x13c3f1['queue']]['ivrAnswerCallsDay']+=0x1;_0x2a3828=new Hangup(_0x13c3f1,_0x1ff85b);this[_0xc8f4('0xbd')](_0x2a3828)[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0xe2')));this[_0xc8f4('0xbb')](_0x2a3828)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x13c3f1&&_0x13c3f1[_0xc8f4('0x50')]!==_0xc8f4('0x78')&&isNotNull(this['voiceQueues'][_0x13c3f1[_0xc8f4('0xa9')]]['dialQueueProject'])){delete this[_0xc8f4('0x9e')][_0x1ff85b[_0xc8f4('0xd7')]];this[_0xc8f4('0xa8')](this['voiceQueues'][_0x13c3f1[_0xc8f4('0xa9')]]);this['voiceQueues'][_0x13c3f1['queue']][_0xc8f4('0x64')]+=0x1;this[_0xc8f4('0x20')][_0x13c3f1[_0xc8f4('0xa9')]][_0xc8f4('0x63')]+=0x1;_0x2a3828=new Hangup(_0x13c3f1,_0x1ff85b);_0x2a3828[_0xc8f4('0x99')]=0x10;_0x2a3828[_0xc8f4('0x9a')]='AnswerAGI';_0x2a3828[_0xc8f4('0xd8')]=_0xc8f4('0xe3');this[_0xc8f4('0xbd')](_0x2a3828)[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0xe2')));this['moveContactManagedDialer'](_0x2a3828)[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0xe4')));}if(_0x13c3f1&&_0x13c3f1[_0xc8f4('0x50')]!==_0xc8f4('0x78')&&!isNotNull(this[_0xc8f4('0x20')][_0x13c3f1[_0xc8f4('0xa9')]][_0xc8f4('0xe5')])){delete this[_0xc8f4('0x9e')][_0x1ff85b['uniqueid']];this[_0xc8f4('0xa8')](this[_0xc8f4('0x20')][_0x13c3f1[_0xc8f4('0xa9')]]);this[_0xc8f4('0x20')][_0x13c3f1[_0xc8f4('0xa9')]][_0xc8f4('0x6b')]+=0x1;_0x2a3828=new Hangup(_0x13c3f1,_0x1ff85b);_0x2a3828[_0xc8f4('0x99')]=0xc;_0x2a3828[_0xc8f4('0x9a')]=_0x1ff85b['cause-txt'];_0x2a3828['membername']=_0xc8f4('0xe6');this[_0xc8f4('0xbd')](_0x2a3828)[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0xe2')));this[_0xc8f4('0xbb')](_0x2a3828)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xc8f4('0x34')]=function(_0x1e3a93){var _0x7efe3e=this[_0xc8f4('0x9e')][_0x1e3a93[_0xc8f4('0xd7')]];var _0x1c8c7=this;if(this[_0xc8f4('0x20')][_0x1e3a93[_0xc8f4('0xa9')]]){if(_0x7efe3e&&_0x7efe3e[_0xc8f4('0x50')]!==_0xc8f4('0x78')){delete this[_0xc8f4('0x9e')][_0x1e3a93[_0xc8f4('0xd7')]];this['voiceQueues'][_0x1e3a93[_0xc8f4('0xa9')]][_0xc8f4('0x64')]+=0x1;var _0x5d6a4c=new AgentComplete(_0x7efe3e,_0x1e3a93);if(_0x1e3a93[_0xc8f4('0xe7')]==='agent'){_0x5d6a4c['agiafterat']=this[_0xc8f4('0x20')][_0x1e3a93['queue']][_0xc8f4('0xe8')]&&this['voiceQueues'][_0x1e3a93['queue']][_0xc8f4('0xe9')]?moment()[_0xc8f4('0x75')](_0xc8f4('0xea')):undefined;}this[_0xc8f4('0xbd')](_0x5d6a4c)[_0xc8f4('0xa6')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x5d6a4c)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x2f')]=function(_0x5dcf96){if(this['voiceQueues'][_0x5dcf96[_0xc8f4('0xa9')]]){if(this[_0xc8f4('0x9e')][_0x5dcf96[_0xc8f4('0xd7')]]&&this[_0xc8f4('0x9e')][_0x5dcf96[_0xc8f4('0xd7')]][_0xc8f4('0x50')]!=='ivr'){this[_0xc8f4('0xa8')](this[_0xc8f4('0x20')][_0x5dcf96['queue']]);this[_0xc8f4('0x9e')][_0x5dcf96[_0xc8f4('0xd7')]][_0xc8f4('0xeb')]=moment()[_0xc8f4('0x75')](_0xc8f4('0xea'));}}};Dialer[_0xc8f4('0x1d')]['queueCallerAbandonCreateState']=function(_0x4b5435){this[_0xc8f4('0xbd')](_0x4b5435)['catch'](loggerCatch(_0xc8f4('0xec')));this[_0xc8f4('0xbb')](_0x4b5435)[_0xc8f4('0xa6')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x31')]=function(_0x5aada1){var _0x5e8883=this[_0xc8f4('0x9e')][_0x5aada1[_0xc8f4('0xd7')]];var _0x415c70=this;if(this[_0xc8f4('0x20')][_0x5aada1['queue']]){if(_0x5e8883&&_0x5e8883[_0xc8f4('0x50')]!==_0xc8f4('0x78')){delete this[_0xc8f4('0x9e')][_0x5aada1[_0xc8f4('0xd7')]];this[_0xc8f4('0xa8')](this['voiceQueues'][_0x5aada1[_0xc8f4('0xa9')]]);_0x5e8883[_0xc8f4('0xed')]=moment()[_0xc8f4('0x75')](_0xc8f4('0xea'));var _0x2b2d2e=new QueueCallerAbandon(_0x5e8883,_0x5aada1);if(getSeconds(_0x5e8883[_0xc8f4('0xed')],_0x5e8883[_0xc8f4('0xee')])>=_0x5e8883[_0xc8f4('0xef')]){this[_0xc8f4('0x20')][_0x5aada1[_0xc8f4('0xa9')]][_0xc8f4('0xf0')]+=0x1;this[_0xc8f4('0x20')][_0x5aada1[_0xc8f4('0xa9')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xc8f4('0x20')][_0x5aada1[_0xc8f4('0xa9')]][_0xc8f4('0x70')]+=0x1;_0x2b2d2e[_0xc8f4('0x99')]=0xa;_0x2b2d2e[_0xc8f4('0x9a')]=_0xc8f4('0xf1');_0x2b2d2e[_0xc8f4('0xf2')]=_0xc8f4('0xf3');_0x2b2d2e['agiafterat']=this[_0xc8f4('0x20')][_0x5aada1[_0xc8f4('0xa9')]][_0xc8f4('0xe8')]?moment()[_0xc8f4('0x75')](_0xc8f4('0xea')):undefined;this[_0xc8f4('0xf4')](_0x2b2d2e);}else{this[_0xc8f4('0x20')][_0x5aada1[_0xc8f4('0xa9')]][_0xc8f4('0xf5')]+=0x1;this['voiceQueues'][_0x5aada1[_0xc8f4('0xa9')]][_0xc8f4('0xf6')]+=0x1;_0x2b2d2e[_0xc8f4('0x99')]=0xb;_0x2b2d2e[_0xc8f4('0x9a')]=_0xc8f4('0xf7');_0x2b2d2e['dropreason']=_0xc8f4('0xf8');this[_0xc8f4('0xf4')](_0x2b2d2e);}}}};Dialer['prototype']['syncNewExten']=function(_0x9960f9){if(this[_0xc8f4('0x26')][_0x9960f9['uniqueid']]){this[_0xc8f4('0x26')][_0x9960f9['uniqueid']][_0xc8f4('0xa5')]=_0x9960f9[_0xc8f4('0xa5')];}if(this['uniqueId'][_0x9960f9[_0xc8f4('0xd7')]]){this[_0xc8f4('0x9e')][_0x9960f9[_0xc8f4('0xd7')]][_0xc8f4('0xa5')]=_0x9960f9['channel'];}};Dialer[_0xc8f4('0x1d')]['syncQueueMember']=function(_0x1b5482){if(strategy[this[_0xc8f4('0x20')][this['actions'][_0x1b5482[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]]['strategy']]===_0xc8f4('0x1c')){if(this[_0xc8f4('0x26')][_0x1b5482[_0xc8f4('0xf9')]]&&_['isNil'](this['actions'][_0x1b5482[_0xc8f4('0xf9')]][_0xc8f4('0xfa')])&&_0x1b5482[_0xc8f4('0xa4')]==='1'&&_0x1b5482['paused']==='0'){if(this[_0xc8f4('0x22')][_0x1b5482[_0xc8f4('0xfb')]]){if(!this[_0xc8f4('0x22')][_0x1b5482[_0xc8f4('0xfb')]][_0xc8f4('0xfa')]){this[_0xc8f4('0x22')][_0x1b5482[_0xc8f4('0xfb')]][_0xc8f4('0xfa')]=!![];this[_0xc8f4('0x26')][_0x1b5482[_0xc8f4('0xf9')]][_0xc8f4('0xfa')]=!![];this['actions'][_0x1b5482[_0xc8f4('0xf9')]][_0xc8f4('0xfb')]=_0x1b5482[_0xc8f4('0xfb')];}}}}else if((strategy[this[_0xc8f4('0x20')][this[_0xc8f4('0x26')][_0x1b5482[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]][_0xc8f4('0xfc')]]||_0xc8f4('0x1b'))===_0xc8f4('0x1b')){if(this['actions'][_0x1b5482[_0xc8f4('0xf9')]]){if(this[_0xc8f4('0x22')][_0x1b5482[_0xc8f4('0xfb')]]){this[_0xc8f4('0x26')][_0x1b5482[_0xc8f4('0xf9')]]['stateinterface']=_0x1b5482[_0xc8f4('0xfb')];if(_['isNil'](this['queueBooked'][this['actions'][_0x1b5482[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]])){this[_0xc8f4('0x2c')][this[_0xc8f4('0x26')][_0x1b5482['actionid']]['queue']]=[];}this['queueBooked'][this[_0xc8f4('0x26')][_0x1b5482[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]][_0xc8f4('0xfd')](_[_0xc8f4('0x82')](_['pick'](this[_0xc8f4('0x26')][_0x1b5482['actionid']],[_0xc8f4('0xfe'),_0xc8f4('0xfb')]),{'status':_0x1b5482['status'],'paused':_0x1b5482['paused']}));}}}};function unlockQueueStatus(_0x168031,_0x5c58e0){setTimeout(function(){if(_['isUndefined'](_0x168031[_0xc8f4('0xff')])){loggerBooked[_0xc8f4('0x89')]('[unlockQueueStatus][undefined]',_0x5c58e0);}_0x168031[_0xc8f4('0xff')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x5c58e0,JSON[_0xc8f4('0x4c')](_[_0xc8f4('0x100')](_0x168031,['name','queueStatusComplete'])));},0x1f3);}Dialer[_0xc8f4('0x1d')][_0xc8f4('0x3d')]=function(_0x2349d1){var _0x11d3c6=this;var _0xe63aa2=_0x11d3c6[_0xc8f4('0x20')][_0x11d3c6['actions'][_0x2349d1[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]];if(strategy[this[_0xc8f4('0x20')][this['actions'][_0x2349d1[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]][_0xc8f4('0xfc')]]==='roundrobin'){if(this[_0xc8f4('0x26')][_0x2349d1['actionid']]&&this[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]]['stateinterface']){this[_0xc8f4('0x86')]['run'](this[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]]['idHopper'],this[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]]['stateinterface'])[_0xc8f4('0xa6')](function(_0x5ebcde){logger[_0xc8f4('0x89')](_0xc8f4('0x101'),util['inspect'](_0x5ebcde,{'showHidden':![],'depth':null}));})[_0xc8f4('0x1f')](function(){_0x11d3c6[_0xc8f4('0xa8')](_0x11d3c6['voiceQueues'][_0x11d3c6[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]]['queue']]);_0x11d3c6[_0xc8f4('0x22')][_0x11d3c6[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]][_0xc8f4('0xfb')]]['locked']=![];delete _0x11d3c6[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]];unlockQueueStatus(_0xe63aa2);});}else{this['updateOriginated'](this['voiceQueues'][this[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]]);this[_0xc8f4('0xb5')]({'active':![],'ContactId':this[_0xc8f4('0x26')][_0x2349d1['actionid']]['ContactId'],'ListId':this[_0xc8f4('0x26')][_0x2349d1['actionid']][_0xc8f4('0xc5')],'VoiceQueueId':this[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x2349d1[_0xc8f4('0xf9')]]['CampaignId']||undefined})[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0x102')));delete this['actions'][_0x2349d1[_0xc8f4('0xf9')]];unlockQueueStatus(_0xe63aa2);}}else if((strategy[this['voiceQueues'][this['actions'][_0x2349d1[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]][_0xc8f4('0xfc')]]||_0xc8f4('0x1b'))===_0xc8f4('0x1b')){var _0x22aeec;if(this[_0xc8f4('0x26')][_0x2349d1['actionid']]&&!_[_0xc8f4('0x48')](this[_0xc8f4('0x2c')][this[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]]['queue']])){if(this[_0xc8f4('0x2d')][_0x11d3c6[_0xc8f4('0x26')][_0x2349d1['actionid']]['queue']]){this[_0xc8f4('0x2d')][_0x11d3c6['actions'][_0x2349d1[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]]=this[_0xc8f4('0x2d')][this[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]]['queue']]?this[_0xc8f4('0x2d')][this[_0xc8f4('0x26')][_0x2349d1['actionid']][_0xc8f4('0xa9')]]:this[_0xc8f4('0x2c')][this[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]]?this[_0xc8f4('0x2c')][this[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]]['_rr']||0x0:0x0;}this[_0xc8f4('0x2c')][this[_0xc8f4('0x26')][_0x2349d1['actionid']][_0xc8f4('0xa9')]][_0xc8f4('0x103')]=this['queueBookedRR'][this[_0xc8f4('0x26')][_0x2349d1[_0xc8f4('0xf9')]][_0xc8f4('0xa9')]];for(var _0x487db9=0x0;_0x487db9=0x0?!![]:![];})['catch'](myreject(_0x53e7d0)));}}else{_0x177ad5[_0xc8f4('0xfd')](ami[_0xc8f4('0xa3')]({'action':_0xc8f4('0x11b'),'command':util[_0xc8f4('0x75')](_0xc8f4('0x11c'),_0x259671,!_[_0xc8f4('0x7c')](config[_0xc8f4('0x117')][_0x5ad745])?_0x5ad745:'')})[_0xc8f4('0xab')](function(_0xa539e3){return _0xa539e3[_0xc8f4('0x11e')][_0xc8f4('0x11f')](_0xc8f4('0x120'))>=0x0?!![]:![];})[_0xc8f4('0xa6')](myreject(_0x53e7d0)));}BPromise['all'](_0x177ad5)[_0xc8f4('0xab')](function(_0x52176f){var _0x31c948=_[_0xc8f4('0x121')](_0x52176f);if(_0x31c948){return _0x126315(_0x31c948);}else{_0x35a367[_0xc8f4('0x41')]=_0x5998e7?_0xc8f4('0x122'):'INTERVAL_IS_OVERTIME';return _0x53e7d0(msgResponse('[ifTime][promiseAll]',_0xc8f4('0x114'),'Global:\x20'+_0x5998e7+'\x20'+_0x3f74ef+_0xc8f4('0x123')+util['inspect'](_0x259671,{'showHidden':![],'depth':null})+_0xc8f4('0x124')+_0x5ad745));}})[_0xc8f4('0xa6')](function(_0x33cee9){return _0x53e7d0(msgResponse(_0xc8f4('0x112'),_0xc8f4('0x114'),JSON[_0xc8f4('0x4c')](_0x33cee9)));});});};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x125')]=function(_0x1a1fe8){var _0x1cf5ef=this;return function(){switch(_0x1a1fe8[_0xc8f4('0x5f')]){case _0xc8f4('0x126'):freeVariablesPredictive(_0x1a1fe8);_0x1cf5ef[_0xc8f4('0x127')](_0x1a1fe8,0x1);break;case _0xc8f4('0x128'):freeVariablesPredictive(_0x1a1fe8);_0x1cf5ef['handlePower'](_0x1a1fe8,_0x1a1fe8[_0xc8f4('0x129')]);break;case _0xc8f4('0x12a'):_0x1cf5ef[_0xc8f4('0x12a')](_0x1a1fe8);break;case'booked':freeVariablesPredictive(_0x1a1fe8);_0x1cf5ef[_0xc8f4('0x127')](_0x1a1fe8,0x1);break;default:freeVariablesPredictive(_0x1a1fe8);logger[_0xc8f4('0x89')](_0xc8f4('0x12b'),_0x1a1fe8[_0xc8f4('0x43')],_0xc8f4('0x12c'));}};};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x12d')]=function(_0x3e978e){var _0x1397d6=this;return function(){_0x1397d6[_0xc8f4('0x12e')](_0x3e978e);};};Dialer['prototype'][_0xc8f4('0xb')]=function(_0x251ab){var _0x4c9283=this;if(isNotPreview(_0x251ab[_0xc8f4('0x5f')])){if(isVoiceQueueOutbound(_0x251ab[_0xc8f4('0x50')])&&isActive(_0x251ab[_0xc8f4('0x5e')])){_0x251ab[_0xc8f4('0x93')]=!![];BPromise[_0xc8f4('0xaa')]()[_0xc8f4('0xab')](checkIsLoggedIn(_0x251ab,_0x251ab[_0xc8f4('0x54')]))[_0xc8f4('0xab')](checkIsActive(_0x251ab,_0x251ab[_0xc8f4('0x5e')]))[_0xc8f4('0xab')](checkInterval(_0x251ab))['then'](_0x4c9283['checkIsTrunkReachable'](_0x251ab))[_0xc8f4('0xab')](_0x4c9283[_0xc8f4('0x111')](_0x251ab[_0xc8f4('0x12f')],_0x251ab[_0xc8f4('0x130')],_0x251ab['name'],_0x251ab))[_0xc8f4('0xab')](_0x4c9283[_0xc8f4('0x113')](_0x251ab[_0xc8f4('0x45')],_0x251ab[_0xc8f4('0x130')],_0x251ab['name'],_0x251ab))['then'](_0x4c9283[_0xc8f4('0x125')](_0x251ab))[_0xc8f4('0xa6')](loggerCatchQueueSummary(_0xc8f4('0x131'),_0x251ab));}else{notSendMessagesQueue(_0x251ab);}}else{freeVariablesPredictive(_0x251ab);}};Dialer[_0xc8f4('0x1d')]['syncCampaigns']=function(){var _0x42ef15=this;var _0x5ee585;for(var _0x15af11 in this[_0xc8f4('0x21')]){if(this[_0xc8f4('0x21')][_0xc8f4('0x8b')](_0x15af11)){_0x5ee585=this['campaigns'][_0x15af11];if(isCampaignIvr(_0x5ee585[_0xc8f4('0x50')])&&isActive(_0x5ee585[_0xc8f4('0x74')])){_0x5ee585[_0xc8f4('0x93')]=!![];BPromise['resolve']()[_0xc8f4('0xab')](checkIsActive(_0x5ee585,_0x5ee585[_0xc8f4('0x74')]))[_0xc8f4('0xab')](checkInterval(_0x5ee585))[_0xc8f4('0xab')](_0x42ef15['checkIsTrunkReachable'](_0x5ee585))[_0xc8f4('0xab')](_0x42ef15[_0xc8f4('0x111')](_0x5ee585[_0xc8f4('0x12f')],_0x5ee585[_0xc8f4('0x130')],_0x5ee585['name'],_0x5ee585))['then'](_0x42ef15[_0xc8f4('0x113')](_0x5ee585[_0xc8f4('0x45')],_0x5ee585[_0xc8f4('0x130')],_0x5ee585[_0xc8f4('0x43')],_0x5ee585))[_0xc8f4('0xab')](_0x42ef15['launchHandleIvr'](_0x5ee585))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x5ee585));}else{notSendMessagesCampaign(_0x5ee585);}}}};function getCallerIdRandom(_0x22e09b,_0x1b08cb){var _0x14e8de,_0x136262,_0xf69595;if(_0x1b08cb<=0x0){_0x1b08cb=0x1;}_0x14e8de=new RegExp(_0xc8f4('0x132')+_0x1b08cb+'}$');_0x136262=Math[_0xc8f4('0x133')](0xa,_0x1b08cb-0x1);_0xf69595=Math[_0xc8f4('0x133')](0xa,_0x1b08cb)-0x1;return util['format']('%s',_['replace'](_0x22e09b,_0x14e8de,_[_0xc8f4('0x134')](_0x136262,_0xf69595)));}function extractCalleridName(_0x1e413e){var _0x1e935f=_0x1e413e['match'](/"(.*?)"/);return _0x1e935f?_0x1e935f[0x1]:_0x1e413e;}function extractCalleridNumber(_0x13b763){var _0x4e347c=_0x13b763[_0xc8f4('0x135')](/<(.*?)>/);return _0x4e347c?_0x4e347c[0x1]:_0x13b763;}Dialer[_0xc8f4('0x1d')][_0xc8f4('0x136')]=function(_0x3c4d9f,_0xecfeaf){var _0x3f8145=this;var _0x13819c=uuid['v4']();this[_0xc8f4('0x26')][_0x13819c]=new Action(_0x3c4d9f,_0xecfeaf,_0x13819c);return new BPromise(function(_0x2274fe,_0xd46e49){if(_[_0xc8f4('0x7c')](_0x3c4d9f)&&_0xc8f4('0x137')!==typeof _0x3c4d9f){return _0xd46e49(msgResponse(_0xc8f4('0x138'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0xc8f4('0x7c')](_0xecfeaf[_0xc8f4('0x139')]['phone'])||_0xecfeaf['Contact'][_0xc8f4('0x13a')]===null){return _0xd46e49(msgResponse(_0xc8f4('0x138'),_0xc8f4('0x114'),_0xc8f4('0x13b')));}var _0x2f15f5={'XMD-CALLERID':_0x3f8145[_0xc8f4('0x26')][_0x13819c]['getCaller'](),'XMD-AGI':_0x3c4d9f['dialQueueProject']?util[_0xc8f4('0x75')](_0xc8f4('0x13c'),ipAgi,_0x3c4d9f[_0xc8f4('0xe5')]):'NONE','XMD-AGIAFTER':_0x3c4d9f[_0xc8f4('0xe8')]?util['format'](_0xc8f4('0x13c'),ipAgi,_0x3c4d9f[_0xc8f4('0xe8')]):_0xc8f4('0x13d'),'XMD-QUEUE':_0x3c4d9f[_0xc8f4('0x50')]==='outbound'?util[_0xc8f4('0x75')]('\x22%s,%s%s,,,%s\x22',_0x3c4d9f['name'],_0x3c4d9f['dialQueueOptions']||'',_0x3c4d9f[_0xc8f4('0xe9')]?'c':'',_0x3c4d9f['dialQueueTimeout']||0x3):_0xc8f4('0x13d'),'XMD-CONTACTID':_0xecfeaf[_0xc8f4('0xc4')],'XMD-CDRTYPE':_0xc8f4('0x8'),'CALLERID(all)':_0x3f8145[_0xc8f4('0x26')][_0x13819c][_0xc8f4('0x13e')](),'XMD-AMD':_0x3c4d9f[_0xc8f4('0xd4')]?_0xc8f4('0x13f'):_0xc8f4('0x13d'),'XMD-DESTINATION':_0xc8f4('0xd3')};if(_0x3c4d9f[_0xc8f4('0xd4')]){_0x2f15f5[_0xc8f4('0x140')]=_0x3c4d9f['dialAMDInitialSilence']||0x9c4;_0x2f15f5[_0xc8f4('0x141')]=_0x3c4d9f[_0xc8f4('0x142')]||0x5dc;_0x2f15f5[_0xc8f4('0x143')]=_0x3c4d9f[_0xc8f4('0x144')]||0x320;_0x2f15f5[_0xc8f4('0x145')]=_0x3c4d9f[_0xc8f4('0x146')]||0x1388;_0x2f15f5[_0xc8f4('0x147')]=_0x3c4d9f[_0xc8f4('0x148')]||0x64;_0x2f15f5[_0xc8f4('0x149')]=_0x3c4d9f[_0xc8f4('0x14a')]||0x32;_0x2f15f5['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x3c4d9f[_0xc8f4('0x14b')]||0x3;_0x2f15f5[_0xc8f4('0x14c')]=_0x3c4d9f['dialAMDSilenceThreshold']||0x100;_0x2f15f5[_0xc8f4('0x14d')]=_0x3c4d9f[_0xc8f4('0x14e')]||0x1388;}if(_0x3c4d9f[_0xc8f4('0x50')]==='outbound'){_0x2f15f5[_0xc8f4('0x14f')]=_0xecfeaf[_0xc8f4('0xc7')];}else{_0x2f15f5[_0xc8f4('0x150')]=_0xecfeaf[_0xc8f4('0xc8')];}for(var _0x586801 in _0xecfeaf[_0xc8f4('0x139')]){if(_0xecfeaf[_0xc8f4('0x139')]['hasOwnProperty'](_0x586801)){if(isNotNull(_0xecfeaf[_0xc8f4('0x139')][_0x586801])&&_0x586801!=='id'&&_0x586801!==_0xc8f4('0x151')&&_0x586801!==_0xc8f4('0x152')&&_0x586801!==_0xc8f4('0x153')){_0x2f15f5[util['format'](_0xc8f4('0x154'),'XMD-',_[_0xc8f4('0x155')](_0x586801))]=_0xecfeaf[_0xc8f4('0x139')][_0x586801];}}}var _0xe51f2=_0x3f8145[_0xc8f4('0xcd')](_0x3c4d9f[_0xc8f4('0x73')])?getCallerId(_0x3c4d9f[_0xc8f4('0x73')]['callerid'],_0x3c4d9f['dialOriginateCallerIdName'],_0x3c4d9f[_0xc8f4('0x156')]>0x0?getCallerIdRandom(_0x3c4d9f[_0xc8f4('0x157')],_0x3c4d9f['dialRandomLastDigitCallerIdNumber']):_0x3c4d9f[_0xc8f4('0x157')]):getCallerId(_['isNil'](_0x3c4d9f[_0xc8f4('0x10f')])?_0x3c4d9f[_0xc8f4('0x73')][_0xc8f4('0x158')]:_0x3c4d9f[_0xc8f4('0x10f')][_0xc8f4('0x158')],_0x3c4d9f[_0xc8f4('0x60')],_0x3c4d9f[_0xc8f4('0x156')]>0x0?getCallerIdRandom(_0x3c4d9f[_0xc8f4('0x157')],_0x3c4d9f[_0xc8f4('0x156')]):_0x3c4d9f[_0xc8f4('0x157')]);if(_0xe51f2){_0x2f15f5['XMD-ORIGINATECALLERIDNAME']=_0x3f8145['actions'][_0x13819c][_0xc8f4('0x159')]=extractCalleridName(_0xe51f2);_0x2f15f5['XMD-ORIGINATECALLERIDNUM']=_0x3f8145['actions'][_0x13819c][_0xc8f4('0x15a')]=extractCalleridNumber(_0xe51f2);}return ami[_0xc8f4('0xa3')]({'actionid':_0x13819c,'action':_0xc8f4('0x138'),'channel':_0x3f8145['isTrunkReachable'](_0x3c4d9f[_0xc8f4('0x73')])?util[_0xc8f4('0x75')](_0xc8f4('0x15b'),_0x3c4d9f['Trunk'][_0xc8f4('0x43')],isNotNull(_0x3c4d9f['dialPrefix'])?_0x3c4d9f[_0xc8f4('0x62')][_0xc8f4('0x15c')]()||'':'',_0x3c4d9f[_0xc8f4('0x15d')]>0x0?_0xecfeaf[_0xc8f4('0x139')][_0xc8f4('0x13a')][_0xc8f4('0x15e')](_0x3c4d9f['dialCutDigit']):_0xecfeaf[_0xc8f4('0x139')][_0xc8f4('0x13a')]):util[_0xc8f4('0x75')](_0xc8f4('0x15b'),_[_0xc8f4('0xa2')](_0x3c4d9f['TrunkBackup'])?_0x3c4d9f[_0xc8f4('0x73')][_0xc8f4('0x43')]:_0x3c4d9f[_0xc8f4('0x10f')][_0xc8f4('0x43')],isNotNull(_0x3c4d9f[_0xc8f4('0x62')])?_0x3c4d9f[_0xc8f4('0x62')][_0xc8f4('0x15c')]()||'':'',_0x3c4d9f[_0xc8f4('0x15d')]>0x0?_0xecfeaf[_0xc8f4('0x139')][_0xc8f4('0x13a')][_0xc8f4('0x15e')](_0x3c4d9f[_0xc8f4('0x15d')]):_0xecfeaf['Contact'][_0xc8f4('0x13a')]),'callerid':_0xe51f2,'Exten':_0xc8f4('0xd3'),'Context':_0xc8f4('0x15f'),'Priority':'1','variable':_0x2f15f5,'timeout':(_0x3c4d9f['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x13819c})[_0xc8f4('0xab')](function(_0x5c3d1e){return _0x2274fe(_0x5c3d1e);})['catch'](function(_0x348cb2){_0x3c4d9f[_0xc8f4('0x160')]+=0x1;var _0x1f2c0f=new History(_0x3f8145[_0xc8f4('0x26')][_0x13819c]);logger[_0xc8f4('0x89')](util[_0xc8f4('0x75')](_0xc8f4('0x161'),JSON[_0xc8f4('0x4c')](_0x348cb2)));_0x1f2c0f[_0xc8f4('0x99')]=0xe;_0x1f2c0f['statedesc']='OriginateError';_0x1f2c0f['starttime']=moment()['format'](_0xc8f4('0xea'));_0x1f2c0f[_0xc8f4('0x9b')]=_0x1f2c0f[_0xc8f4('0x9c')];_0x3f8145[_0xc8f4('0xbd')](_0x1f2c0f)[_0xc8f4('0xa6')](loggerCatch('[originate][error]'));_0x3f8145[_0xc8f4('0xbb')](_0x1f2c0f)[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0x162')))[_0xc8f4('0x1f')](function(){delete _0x3f8145[_0xc8f4('0x26')][_0x13819c];return _0xd46e49(msgResponse(_0xc8f4('0x138'),_0xc8f4('0x4b'),_0xc8f4('0x163')));});});});};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x164')]=function(_0x3a1fb7){var _0x50591e=this[_0xc8f4('0x26')][_0x3a1fb7[_0xc8f4('0xf9')]];var _0x4007d9=this;if(_0x50591e){delete this[_0xc8f4('0x26')][_0x3a1fb7[_0xc8f4('0xf9')]];_0x50591e['responsetime']=moment()[_0xc8f4('0x75')](_0xc8f4('0xea'));var _0x38ce2f=_0x50591e['type']===_0xc8f4('0x78')?this[_0xc8f4('0x21')][_0x50591e[_0xc8f4('0xa9')]]:this[_0xc8f4('0x20')][_0x50591e[_0xc8f4('0x165')]()];if(!this[_0xc8f4('0xcb')](_0x3a1fb7[_0xc8f4('0x166')])){this[_0xc8f4('0xa8')](_0x38ce2f);return this[_0xc8f4('0x167')](_0x50591e,_0x38ce2f,_0x3a1fb7)[_0xc8f4('0xab')](function(_0x21b5b4){})[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0x168')));}else{this['uniqueId'][_0x3a1fb7[_0xc8f4('0xd7')]]=_0x50591e;}}};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x169')]=function(_0x3961a2,_0x22f93f,_0x5f46a7){var _0x3b2d18=new History(_0x22f93f);if(_0x3b2d18[_0xc8f4('0x16a')]+_0x3b2d18[_0xc8f4('0x16b')]+_0x3b2d18[_0xc8f4('0x16c')]>=_0x5f46a7[_0xc8f4('0x16d')]-0x1){return!![];}switch(_0x3961a2){case 0x3:if(_0x3b2d18[_0xc8f4('0x16c')]>=_0x5f46a7['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0xc8f4('0xb5')]({'active':![],'countnoanswerretry':_0x3b2d18['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x5f46a7[_0xc8f4('0x16e')],_0xc8f4('0x16f'))[_0xc8f4('0x75')](_0xc8f4('0xea')),'ContactId':_0x3b2d18['ContactId'],'ListId':_0x3b2d18['ListId'],'VoiceQueueId':_0x3b2d18['VoiceQueueId']||undefined,'CampaignId':_0x3b2d18[_0xc8f4('0xc8')]||undefined})[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0x170')));}break;case 0x5:if(_0x3b2d18[_0xc8f4('0x16a')]>=_0x5f46a7['dialBusyMaxRetry']-0x1){return!![];}else{this[_0xc8f4('0xb5')]({'active':![],'countbusyretry':_0x3b2d18['countbusyretry']+=0x1,'scheduledat':moment()[_0xc8f4('0x171')](_0x5f46a7[_0xc8f4('0x172')],_0xc8f4('0x16f'))['format'](_0xc8f4('0xea')),'ContactId':_0x3b2d18[_0xc8f4('0xc4')],'ListId':_0x3b2d18[_0xc8f4('0xc5')],'VoiceQueueId':_0x3b2d18['VoiceQueueId']||undefined,'CampaignId':_0x3b2d18[_0xc8f4('0xc8')]||undefined})[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0x173')));}break;case 0x8:if(_0x3b2d18[_0xc8f4('0x16b')]>=_0x5f46a7[_0xc8f4('0x174')]-0x1){return!![];}else{this[_0xc8f4('0xb5')]({'active':![],'countcongestionretry':_0x3b2d18[_0xc8f4('0x16b')]+=0x1,'scheduledat':moment()[_0xc8f4('0x171')](_0x5f46a7[_0xc8f4('0x175')],_0xc8f4('0x16f'))['format'](_0xc8f4('0xea')),'ContactId':_0x3b2d18['ContactId'],'ListId':_0x3b2d18[_0xc8f4('0xc5')],'VoiceQueueId':_0x3b2d18[_0xc8f4('0xc7')]||undefined,'CampaignId':_0x3b2d18[_0xc8f4('0xc8')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer['prototype'][_0xc8f4('0x167')]=function(_0x5aa99e,_0x3164dd,_0x311b94){var _0x4f5cfc=this;var _0x5735da=new History(_0x5aa99e);return new BPromise(function(_0x4e2e10,_0x153467){if(_[_0xc8f4('0x7c')](_0x3164dd)&&'object'!==typeof _0x3164dd){return _0x153467(msgResponse(_0xc8f4('0x176'),_0xc8f4('0x114'),_0xc8f4('0x177')));}if(_['isUndefined'](_0x311b94)&&'object'!==typeof _0x311b94){return _0x153467(msgResponse(_0xc8f4('0x176'),'Failure',_0xc8f4('0x178')));}switch(_0x311b94[_0xc8f4('0xe7')]){case'0':_0x3164dd['outboundNoSuchCallsDay']+=0x1;_0x5735da[_0xc8f4('0x99')]=0x0;_0x5735da[_0xc8f4('0x9a')]=_0xc8f4('0x179');_0x4f5cfc[_0xc8f4('0xbd')](_0x5735da)[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0x17a')));if(_0x4f5cfc[_0xc8f4('0x169')](0x0,_0x5aa99e,_0x3164dd)){if(_0x5735da[_0xc8f4('0x16a')]+_0x5735da['countcongestionretry']+_0x5735da[_0xc8f4('0x16c')]>=_0x3164dd[_0xc8f4('0x16d')]){_0x4f5cfc[_0xc8f4('0x17b')](_0x5735da,_0x4e2e10,_0x153467,'reason\x200\x20no\x20such\x20number....');}else{_0x4f5cfc['createStateFinal'](_0x5735da,_0x4e2e10,_0x153467,_0xc8f4('0x17c'));}}break;case'3':_0x3164dd[_0xc8f4('0x68')]+=0x1;_0x5735da[_0xc8f4('0x99')]=0x3;_0x5735da[_0xc8f4('0x9a')]=_0xc8f4('0x17d');_0x5735da[_0xc8f4('0x16c')]+=0x1;_0x5735da['countglobal']+=0x1;_0x4f5cfc['createHistory'](_0x5735da)[_0xc8f4('0xa6')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x4f5cfc[_0xc8f4('0x169')](0x3,_0x5aa99e,_0x3164dd)){if(_0x5735da[_0xc8f4('0x16c')]>=_0x3164dd[_0xc8f4('0x17e')]){_0x4f5cfc['createStateFinal'](_0x5735da,_0x4e2e10,_0x153467,_0xc8f4('0x17f'));}else{_0x4f5cfc[_0xc8f4('0x17b')](_0x5735da,_0x4e2e10,_0x153467,_0xc8f4('0x17f'));}}break;case'5':_0x3164dd[_0xc8f4('0x180')]+=0x1;_0x5735da[_0xc8f4('0x99')]=0x5;_0x5735da['statedesc']='Busy';_0x5735da[_0xc8f4('0x16a')]+=0x1;_0x5735da[_0xc8f4('0x181')]+=0x1;_0x4f5cfc[_0xc8f4('0xbd')](_0x5735da)[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0x182')));if(_0x4f5cfc[_0xc8f4('0x169')](0x5,_0x5aa99e,_0x3164dd)){if(_0x5735da[_0xc8f4('0x16a')]>=_0x3164dd[_0xc8f4('0x183')]){_0x4f5cfc[_0xc8f4('0x184')](_0x5735da,_0x4e2e10,_0x153467,_0xc8f4('0x185'));}else{_0x4f5cfc[_0xc8f4('0x17b')](_0x5735da,_0x4e2e10,_0x153467,_0xc8f4('0x185'));}}break;case'8':_0x3164dd['outboundCongestionCallsDay']+=0x1;_0x5735da[_0xc8f4('0x99')]=0x8;_0x5735da['statedesc']='Congestion';_0x5735da[_0xc8f4('0x16b')]+=0x1;_0x5735da['countglobal']+=0x1;_0x4f5cfc[_0xc8f4('0xbd')](_0x5735da)[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0x186')));if(_0x4f5cfc[_0xc8f4('0x169')](0x8,_0x5aa99e,_0x3164dd)){if(_0x5735da['countcongestionretry']>=_0x3164dd['dialCongestionMaxRetry']){_0x4f5cfc[_0xc8f4('0x184')](_0x5735da,_0x4e2e10,_0x153467,_0xc8f4('0x187'));}else{_0x4f5cfc[_0xc8f4('0x17b')](_0x5735da,_0x4e2e10,_0x153467,_0xc8f4('0x187'));}}break;default:_0x3164dd[_0xc8f4('0x6b')]+=0x1;_0x5735da['state']=0xc;_0x5735da[_0xc8f4('0x9a')]=_0x311b94[_0xc8f4('0xe7')];_0x4f5cfc['createHistory'](_0x5735da)['catch'](loggerCatch(_0xc8f4('0x188')));if(_0x4f5cfc[_0xc8f4('0x169')](_0x311b94[_0xc8f4('0xe7')],_0x5aa99e,_0x3164dd)){if(_0x5735da['countbusyretry']+_0x5735da[_0xc8f4('0x16b')]+_0x5735da[_0xc8f4('0x16c')]>=_0x3164dd[_0xc8f4('0x16d')]){_0x4f5cfc[_0xc8f4('0x17b')](_0x5735da,_0x4e2e10,_0x153467,_0x311b94[_0xc8f4('0xe7')]);}else{_0x4f5cfc[_0xc8f4('0x184')](_0x5735da,_0x4e2e10,_0x153467,_0x311b94[_0xc8f4('0xe7')]);}}}});};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x17b')]=function(_0x431238,_0xb96520,_0x5a6483,_0x203a6f){var _0x271fab=new Final(_0x431238);_0x271fab[_0xc8f4('0x99')]=0xf;_0x271fab[_0xc8f4('0x9a')]=_0xc8f4('0x189');this['createStateFinal'](_0x271fab,_0xb96520,_0x5a6483,_0x203a6f);};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x184')]=function(_0x464fd0,_0x4acd1b,_0x496a41,_0x55e61a){this[_0xc8f4('0xbb')](_0x464fd0)[_0xc8f4('0xab')](function(_0x32e24b){return _0x4acd1b(msgResponse(_0xc8f4('0x176'),_0xc8f4('0xcc'),_0x55e61a));})[_0xc8f4('0xa6')](function(_0x547f76){return _0x496a41(msgResponse('[moveContactManagedDialer][0]','Failure',_0xc8f4('0x18a')));});};Dialer[_0xc8f4('0x1d')]['predictive']=function(_0x5e8ff8){var _0x44b3ca=this;var _0x344acb=_0x5e8ff8['dialPredictiveOptimizationPercentage']/0x64;var _0xcd5b6=_0x5e8ff8[_0xc8f4('0x67')]/(_0x5e8ff8[_0xc8f4('0x67')]+_0x5e8ff8[_0xc8f4('0x64')]);var _0x395b2b=_0x5e8ff8['loggedIn']-_0x5e8ff8[_0xc8f4('0x18b')]-_0x5e8ff8['waiting']-_0x5e8ff8[_0xc8f4('0x72')]-_0x5e8ff8['talking'];var _0x42626a=(_0x5e8ff8[_0xc8f4('0x54')]-_0x5e8ff8[_0xc8f4('0x18b')])*_0x5e8ff8[_0xc8f4('0x18c')];var _0x4721be=Math[_0xc8f4('0x18d')](_0x5e8ff8[_0xc8f4('0x18e')]*_0x5e8ff8[_0xc8f4('0x18f')]*_0x5e8ff8['predictiveIntervalHitRate']*_0x5e8ff8['predictiveIntervalMultiplicativeFactor']);if(_[_0xc8f4('0x7c')](_0x5e8ff8[_0xc8f4('0x2a')])){loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x190'));if(!_['isUndefined'](_0x5e8ff8[_0xc8f4('0x29')])){_0x5e8ff8[_0xc8f4('0x29')]=undefined;loggerPredictive[_0xc8f4('0x89')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xc8f4('0x7c')](_0x5e8ff8[_0xc8f4('0x85')])){loggerPredictive[_0xc8f4('0x89')](_0xc8f4('0x191'),_0xc8f4('0x192'));clearInterval(_0x5e8ff8[_0xc8f4('0x85')]);_0x5e8ff8[_0xc8f4('0x85')]=undefined;}_0x5e8ff8[_0xc8f4('0x2a')]=moment()['format'](_0xc8f4('0xea'));loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x193'),_0x5e8ff8[_0xc8f4('0x2a')],_0x5e8ff8['name']);this[_0xc8f4('0x127')](_0x5e8ff8,0x1);}else if(ifInterval(_0x5e8ff8['dialPredictiveInterval'],_0x5e8ff8['startProgressive'])){this[_0xc8f4('0x127')](_0x5e8ff8,0x1);loggerPredictiveCalls['info'](_0xc8f4('0x194'),_0x5e8ff8['startProgressive'],_0x5e8ff8['name']);_0x5e8ff8['erlangCalls']=0x0;_0x5e8ff8['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x344acb<_0xcd5b6&&_0x5e8ff8[_0xc8f4('0x195')]===_0xc8f4('0x196')){freeVariablesPredictive(_0x5e8ff8);loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x197'),_0xc8f4('0x198'),_0xcd5b6,_0xc8f4('0x2a'),_0x5e8ff8[_0xc8f4('0x43')]);}else if(_0x395b2b>_0x42626a){freeVariablesPredictive(_0x5e8ff8);loggerPredictive['info'](_0xc8f4('0x199'),_0xc8f4('0x19a'),_0x395b2b,_0xc8f4('0x19b'),_0x42626a);}else if(_0x4721be<_0x5e8ff8['predictiveIntervalErlangCallsDroppedCalls']&&_0x5e8ff8[_0xc8f4('0x195')]===_0xc8f4('0x196')){freeVariablesPredictive(_0x5e8ff8);loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x19c'),_0xc8f4('0x19d'),_0x4721be,_0xc8f4('0x19e'),_0x5e8ff8[_0xc8f4('0x70')],'startProgressive',_0x5e8ff8[_0xc8f4('0x43')]);}else if(!ifInterval(_0x5e8ff8['dialPredictiveInterval'],_0x5e8ff8['startProgressive'])&&_['isUndefined'](_0x5e8ff8[_0xc8f4('0x29')])&&!_[_0xc8f4('0x7c')](_0x5e8ff8[_0xc8f4('0x2a')])){_0x5e8ff8[_0xc8f4('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info']('[startMethodPredictive][StartPredictive][First]',_0x5e8ff8['startPredictive'],_0x5e8ff8[_0xc8f4('0x43')]);this[_0xc8f4('0xb2')](_0x5e8ff8['dialPredictiveInterval'])[_0xc8f4('0xab')](this[_0xc8f4('0x19f')](_0x5e8ff8))[_0xc8f4('0xab')](mergeDataErlangB(_0x5e8ff8))[_0xc8f4('0xab')](this[_0xc8f4('0x1a0')](_0x5e8ff8))[_0xc8f4('0xa6')](loggerCatchPredictive(_0xc8f4('0x1a1'),_0x5e8ff8));}else if(!ifInterval(_0x5e8ff8[_0xc8f4('0x1a2')],_0x5e8ff8[_0xc8f4('0x29')])){_0x5e8ff8[_0xc8f4('0x70')]=0x0;_0x5e8ff8[_0xc8f4('0x29')]=moment()[_0xc8f4('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x1a3'),_0x5e8ff8[_0xc8f4('0x29')],_0x5e8ff8['name']);clearInterval(_0x5e8ff8[_0xc8f4('0x85')]);_0x5e8ff8[_0xc8f4('0x85')]=undefined;this['averageHandleTime'](_0x5e8ff8['dialPredictiveInterval'])['then'](this[_0xc8f4('0x19f')](_0x5e8ff8))[_0xc8f4('0xab')](mergeDataErlangB(_0x5e8ff8))['then'](this['startMethodPredictive'](_0x5e8ff8))[_0xc8f4('0xa6')](loggerCatchPredictive(_0xc8f4('0x1a1'),_0x5e8ff8));}};Dialer[_0xc8f4('0x1d')]['getDataPredictive']=function(_0xcc99e7){var _0x30178f=this;return function(_0x974cc5){return new BPromise(function(_0x1927de,_0x407a5f){_[_0xc8f4('0x82')](_0xcc99e7,_0x974cc5[0x0]);if(checkGetDataPredictive(_0x974cc5[0x0])){loggerPredictive[_0xc8f4('0x7d')](JSON[_0xc8f4('0x4c')](_0x974cc5[0x0]));if(_0xcc99e7[_0xc8f4('0x195')]===_0xc8f4('0x196')){return _0x30178f[_0xc8f4('0xba')](_0xcc99e7['id'])['then'](function(_0x1738aa){var _0x212c55=_0xcc99e7['loggedIn']-_0x1738aa[0x0][_0xc8f4('0x1a4')];var _0x55c9cc=_0xcc99e7[_0xc8f4('0x1a2')]*0x3c;var _0x146155=_0x974cc5[0x0]['predictiveIntervalAvgTalktime']+_0x974cc5[0x0][_0xc8f4('0x6d')];var _0x437fbb=(_0x974cc5[0x0]['predictiveIntervalAnsweredCalls']+_0x974cc5[0x0][_0xc8f4('0xf0')]+_0x974cc5[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x974cc5[0x0][_0xc8f4('0x7b')];var _0x3fa20a=_0xcc99e7[_0xc8f4('0x1a5')]/0x64;_0xcc99e7[_0xc8f4('0x18b')]=_0x1738aa[0x0][_0xc8f4('0x1a4')]||0x0;_0xcc99e7[_0xc8f4('0x71')]=_0x437fbb>0x0?_0x437fbb:0x1;return _0x30178f[_0xc8f4('0x1a6')](_0x212c55,_0x55c9cc,_0x146155,_0x437fbb,_0x3fa20a);})[_0xc8f4('0xab')](function(_0x4f5046){return _0x1927de(_0x4f5046);})[_0xc8f4('0xa6')](function(_0x24f9c1){return _0x407a5f(msgResponse('[CatchErlangB]',_0xc8f4('0x114'),JSON[_0xc8f4('0x4c')](_0x24f9c1)));});}if(_0xcc99e7['dialPredictiveOptimization']==='agentBusyFactor'){return _0x30178f[_0xc8f4('0xba')](_0xcc99e7['id'])['then'](function(_0x3d1c9d){var _0x17efcd=_0xcc99e7['loggedIn']-_0x3d1c9d[0x0][_0xc8f4('0x1a4')];var _0x57b943=_0xcc99e7[_0xc8f4('0x1a2')]*0x3c;var _0x378e6d=_0x974cc5[0x0]['predictiveIntervalAvgTalktime']+_0x974cc5[0x0]['predictiveIntervalAvgHoldtime'];var _0x2e0ff6=(_0x974cc5[0x0][_0xc8f4('0x6c')]+_0x974cc5[0x0][_0xc8f4('0xf0')]+_0x974cc5[0x0][_0xc8f4('0xf5')])/_0x974cc5[0x0][_0xc8f4('0x7b')];var _0x2c5d77=_0xcc99e7[_0xc8f4('0x1a5')]/0x64;_0xcc99e7[_0xc8f4('0x18b')]=_0x3d1c9d[0x0][_0xc8f4('0x1a4')]||0x0;_0xcc99e7[_0xc8f4('0x71')]=_0x2e0ff6>0x0?_0x2e0ff6:0x1;return _0x30178f[_0xc8f4('0x1a7')](_0x17efcd,_0x57b943,_0x378e6d,_0x2e0ff6,_0x2c5d77);})['then'](function(_0x5e63e7){return _0x1927de(_0x5e63e7);})[_0xc8f4('0xa6')](function(_0x44649c){return _0x407a5f(msgResponse(_0xc8f4('0x1a8'),'Failure',JSON[_0xc8f4('0x4c')](_0x44649c)));});}}else{return _0x407a5f(msgResponse(_0xc8f4('0x1a9'),_0xc8f4('0x114'),_0xc8f4('0x1aa')));}});};};Dialer[_0xc8f4('0x1d')]['startMethodPredictive']=function(_0x2bfa38){var _0x4e4840=this;return function(){var _0x359fe2=0x0;var _0xf8ef72=Math[_0xc8f4('0x18d')](_0x2bfa38[_0xc8f4('0x1ab')]*0x3e8);if(_0xf8ef72>0x0){_0xf8ef72=_0xf8ef72<0x64?0x64:_0xf8ef72;loggerPredictive['info'](_0xc8f4('0x1ac'),_0xf8ef72);_0x2bfa38['handlePredictive']=setInterval(function(){_0x4e4840[_0xc8f4('0x85')](_0x2bfa38);loggerPredictiveCalls['info'](_0xc8f4('0x1ad'),_0x359fe2+=0x1);},_0xf8ef72);}else{loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x1ae'),_0xc8f4('0x1af'),_0xf8ef72);}};};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x1b0')]=function(_0x284a0c,_0x4a18b0){var _0x5db566=this;return function(_0x3efadd){if(_[_0xc8f4('0x48')](_0x3efadd)){if(_[_0xc8f4('0xa2')](_0x4a18b0[_0xc8f4('0xc6')])||!_0x4a18b0[_0xc8f4('0x1b1')]){if(_0x284a0c[_0xc8f4('0x5f')]===_0xc8f4('0x9')){_0x284a0c[_0xc8f4('0xff')]=_['isUndefined'](_0x284a0c['queueStatusComplete'])?!![]:_0x284a0c[_0xc8f4('0xff')];var _0x839ff4=uuid['v4']();_0x5db566[_0xc8f4('0x26')][_0x839ff4]=new Action(_0x284a0c,_0x4a18b0,_0x839ff4);loggerBooked[_0xc8f4('0x7d')](_0xc8f4('0x1b2'),_0x839ff4,_0xc8f4('0x1b3'),JSON[_0xc8f4('0x4c')](_0x284a0c[_0xc8f4('0xff')]),'Queue:\x20',_0x284a0c[_0xc8f4('0x43')]);if(_0x284a0c[_0xc8f4('0xff')]){_0x284a0c[_0xc8f4('0xff')]=![];_0x5db566[_0xc8f4('0x2c')][_0x5db566[_0xc8f4('0x26')][_0x839ff4][_0xc8f4('0xa9')]]=[];ami[_0xc8f4('0xa3')]({'actionid':_0x839ff4,'action':'queuestatus','queue':_0x284a0c[_0xc8f4('0x43')]})[_0xc8f4('0xa6')](function(_0x3c1135){_0x5db566[_0xc8f4('0xa8')](_0x284a0c);_0x5db566[_0xc8f4('0xb5')]({'active':![],'ContactId':_0x5db566[_0xc8f4('0x26')][_0x839ff4][_0xc8f4('0xc4')],'ListId':_0x5db566[_0xc8f4('0x26')][_0x839ff4][_0xc8f4('0xc5')],'VoiceQueueId':_0x5db566[_0xc8f4('0x26')][_0x839ff4][_0xc8f4('0xc7')]||undefined,'CampaignId':_0x5db566[_0xc8f4('0x26')][_0x839ff4][_0xc8f4('0xc8')]||undefined})[_0xc8f4('0xa6')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5db566['actions'][_0x839ff4];});}else{loggerBooked['info'](_0xc8f4('0x1b4'),JSON['stringify'](_0x284a0c[_0xc8f4('0xff')]),_0xc8f4('0x1b5'),_0x284a0c[_0xc8f4('0x43')]);_0x5db566[_0xc8f4('0xa8')](_0x284a0c);_0x5db566[_0xc8f4('0xb5')]({'active':![],'ContactId':_0x5db566[_0xc8f4('0x26')][_0x839ff4][_0xc8f4('0xc4')],'ListId':_0x5db566[_0xc8f4('0x26')][_0x839ff4][_0xc8f4('0xc5')],'VoiceQueueId':_0x5db566[_0xc8f4('0x26')][_0x839ff4][_0xc8f4('0xc7')]||undefined,'CampaignId':_0x5db566[_0xc8f4('0x26')][_0x839ff4][_0xc8f4('0xc8')]||undefined})[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0x1b6')));delete _0x5db566[_0xc8f4('0x26')][_0x839ff4];}}else{return _0x5db566['actionOriginate'](_0x284a0c,_0x4a18b0);}}else{if(getDiff(_0x4a18b0[_0xc8f4('0x1b7')])<_0x284a0c['dialRecallMeTimeout']*0x3c){_0x5db566[_0xc8f4('0x86')][_0xc8f4('0x108')](_0x4a18b0['id'])[_0xc8f4('0x1f')](function(){_0x5db566[_0xc8f4('0xa8')](_0x284a0c);});}else{_0x284a0c[_0xc8f4('0x69')]+=0x1;_0x5db566[_0xc8f4('0xa8')](_0x284a0c);if(_0x284a0c[_0xc8f4('0x1b8')]){_0x5db566['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a18b0[_0xc8f4('0xc4')],'ListId':_0x4a18b0[_0xc8f4('0xc5')],'VoiceQueueId':_0x4a18b0[_0xc8f4('0xc7')]||undefined,'CampaignId':_0x4a18b0['CampaignId']||undefined})[_0xc8f4('0xa6')](loggerCatch(_0xc8f4('0x1b9')));_0x5db566[_0xc8f4('0xbd')](createObjHistory(_0x284a0c,_0x4a18b0,_0xc8f4('0x1ba'),0x17,_0xc8f4('0x1bb')))['catch'](loggerCatch(_0xc8f4('0x1bc')));}else{_0x5db566[_0xc8f4('0xc3')](createObjHistory(_0x284a0c,_0x4a18b0,_0xc8f4('0x1bd'),0x16,_0xc8f4('0x1be')),'[Originate][HistoryRecallClose][historyCatch]',_0xc8f4('0x1bf'));}}}}else{_0x284a0c['outboundBlacklistCallsDay']+=0x1;_0x5db566[_0xc8f4('0xc3')](createObjHistory(_0x284a0c,_0x4a18b0,'BLACKLIST',0xd,_0xc8f4('0x1c0')),_0xc8f4('0x1c1'),_0xc8f4('0x1c2'));throw'inBlackList';}};};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x12e')]=function(_0x15709d){var _0x443346=this;var _0x3237b5=[];var _0x28ce77=_0x15709d[_0xc8f4('0x1c3')]-_0x15709d[_0xc8f4('0x72')]-_0x15709d[_0xc8f4('0x1c4')];emitCampaignSummary(_0x15709d);if(_0x28ce77>0x0){if(_0x28ce77>this[_0xc8f4('0x24')]){_0x28ce77=this['maxNumberOriginate'];}_0x15709d[_0xc8f4('0x1c4')]+=_0x28ce77;this[_0xc8f4('0xb9')](_0x15709d['id'],_0x28ce77,_0x15709d[_0xc8f4('0x1c5')])['then'](function(_0x108631){_0x15709d['temp']-=_0x28ce77;_0x15709d['temp']=_0x15709d[_0xc8f4('0x1c4')]>0x0?_0x15709d[_0xc8f4('0x1c4')]:0x0;if(!checkContactEmpty(_0x108631)){_0x15709d['message']=_0xc8f4('0x91');logger['info'](_0xc8f4('0x1c6')+_0x15709d[_0xc8f4('0x43')]);}else{_0x15709d['originated']+=_0x108631['length'];_0x15709d['message']=_0xc8f4('0x1c7');for(var _0x4d981c=0x0;_0x4d981c<_0x108631[_0xc8f4('0x8a')];_0x4d981c+=0x1){_0x15709d[_0xc8f4('0x1c8')]+=0x1;if(_[_0xc8f4('0xa2')](_0x108631[_0x4d981c])||_[_0xc8f4('0xa2')](_0x108631[_0x4d981c][_0xc8f4('0x139')])||_[_0xc8f4('0xa2')](_0x108631[_0x4d981c][_0xc8f4('0x139')]['phone'])){_0x443346[_0xc8f4('0xc1')](_0xc8f4('0x1c9'),_0x15709d,_0x108631[_0x4d981c]);}else{_0x443346['checkIsBlackListIvr'](_[_0xc8f4('0x100')](_0x108631[_0x4d981c],[_0xc8f4('0xc8'),_0xc8f4('0x1ca')]))[_0xc8f4('0xab')](_0x443346[_0xc8f4('0x1b0')](_0x15709d,_0x108631[_0x4d981c]))['catch'](_0x443346[_0xc8f4('0xc0')](_0xc8f4('0x1cb'),_0x15709d));}}}})[_0xc8f4('0xa6')](loggerGetContactDialer(_0xc8f4('0x1cc'),_0x15709d,_0x28ce77));}};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x127')]=function(_0x59fa4b,_0x2c54f9){var _0x5da86a=this;var _0x5ddfa6=[];var _0xb8a278=_0x2c54f9>=0x1?_0x2c54f9:0x1;var _0x5a7e74=[];if(_0x59fa4b[_0xc8f4('0x5f')]===_0xc8f4('0x9')){_0xb8a278=0x1;}var _0x541d3e=Math[_0xc8f4('0x18d')](_0x59fa4b['available']*_0xb8a278)-_0x59fa4b[_0xc8f4('0x72')]-_0x59fa4b['temp'];emitVoiceQueueSummary(_0x59fa4b);if(_0x59fa4b[_0xc8f4('0x1cd')]>0x0){var _0x1e7f06=_0x59fa4b['dialLimitQueue']-_0x59fa4b[_0xc8f4('0x72')]-_0x59fa4b[_0xc8f4('0x58')]-_0x59fa4b[_0xc8f4('0x1c4')]-_0x59fa4b[_0xc8f4('0x55')];if(_0x541d3e>_0x1e7f06){_0x541d3e=_0x1e7f06;}}if(_0x541d3e>0x0){if(_0x59fa4b[_0xc8f4('0x5f')]===_0xc8f4('0x9')){_0x541d3e=0x1;}if(_0x541d3e>this['maxNumberOriginate']){_0x541d3e=this[_0xc8f4('0x24')];}_0x59fa4b[_0xc8f4('0x1c4')]+=_0x541d3e;for(var _0x3db3dd in this[_0xc8f4('0x22')]){if(this[_0xc8f4('0x22')][_0xc8f4('0x8b')](_0x3db3dd)){if(this[_0xc8f4('0x22')][_0x3db3dd][_0xc8f4('0x99')]===_0xc8f4('0x1ce')&&this[_0xc8f4('0x22')][_0x3db3dd][_0xc8f4('0xa4')]===_0xc8f4('0xce')){_0x5ddfa6[_0xc8f4('0xfd')](this[_0xc8f4('0x22')][_0x3db3dd]['id']);}}}this[_0xc8f4('0xb7')](_0x59fa4b['id'],_0x5ddfa6,_0x541d3e,_0x59fa4b[_0xc8f4('0x1c5')])[_0xc8f4('0xab')](function(_0x3ec044){_0x59fa4b[_0xc8f4('0x1c4')]-=_0x541d3e;_0x59fa4b[_0xc8f4('0x1c4')]=_0x59fa4b[_0xc8f4('0x1c4')]>0x0?_0x59fa4b[_0xc8f4('0x1c4')]:0x0;if(!checkContactEmpty(_0x3ec044)){_0x5da86a[_0xc8f4('0xac')](_0x59fa4b)[_0xc8f4('0xab')](sendMessageReschedule(_0x59fa4b))[_0xc8f4('0xa6')](loggerCatch('[countReScheduled]\x20'));}else{_0x59fa4b[_0xc8f4('0x72')]+=_0x3ec044[_0xc8f4('0x8a')];_0x59fa4b[_0xc8f4('0x41')]=_0x59fa4b[_0xc8f4('0x5f')]===_0xc8f4('0x9')?_0xc8f4('0x13f'):_0xc8f4('0x1c7');for(var _0x4d3519=0x0;_0x4d3519<_0x3ec044['length'];_0x4d3519+=0x1){if(_[_0xc8f4('0xa2')](_0x3ec044[_0x4d3519])||_[_0xc8f4('0xa2')](_0x3ec044[_0x4d3519][_0xc8f4('0x139')])||_[_0xc8f4('0xa2')](_0x3ec044[_0x4d3519][_0xc8f4('0x139')][_0xc8f4('0x13a')])){_0x5da86a[_0xc8f4('0xc1')]('[actionOriginate]\x20',_0x59fa4b,_0x3ec044[_0x4d3519]);}else{_0x5da86a[_0xc8f4('0xae')](_['pick'](_0x3ec044[_0x4d3519],[_0xc8f4('0xc7'),'Contact.phone']))[_0xc8f4('0xab')](_0x5da86a[_0xc8f4('0x1b0')](_0x59fa4b,_0x3ec044[_0x4d3519]))[_0xc8f4('0xa6')](_0x5da86a[_0xc8f4('0xc0')]('[actionOriginate]\x20',_0x59fa4b));}}}})[_0xc8f4('0xa6')](loggerGetContactDialer(_0xc8f4('0x1cf'),_0x59fa4b,_0x541d3e));}};Dialer[_0xc8f4('0x1d')]['handlePredictive']=function(_0x553a4a){var _0x5e9f41=this;if(_0x553a4a[_0xc8f4('0x1cd')]>0x0){var _0x3b376e=_0x553a4a['dialLimitQueue']-_0x553a4a[_0xc8f4('0x72')]-_0x553a4a['talking'];if(_0x3b376e>0x0){this[_0xc8f4('0x1d0')](_0x553a4a);}else{loggerPredictiveCalls[_0xc8f4('0x7d')]('[handlePredictive][limitChannel]');}}else{this[_0xc8f4('0x1d0')](_0x553a4a);}};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x1d0')]=function(_0x442fdb){var _0x5dc144=this;var _0x33a7a1=[];_0x442fdb[_0xc8f4('0x72')]+=0x1;for(var _0x3b388c in this[_0xc8f4('0x22')]){if(this[_0xc8f4('0x22')][_0xc8f4('0x8b')](_0x3b388c)){if(this[_0xc8f4('0x22')][_0x3b388c][_0xc8f4('0x99')]===_0xc8f4('0x1ce')&&this['agents'][_0x3b388c][_0xc8f4('0xa4')]===_0xc8f4('0xce')){_0x33a7a1[_0xc8f4('0xfd')](this[_0xc8f4('0x22')][_0x3b388c]['id']);}}}this[_0xc8f4('0xb7')](_0x442fdb['id'],_0x33a7a1,0x1,_0x442fdb[_0xc8f4('0x1c5')])[_0xc8f4('0xab')](function(_0x410fa3){if(!checkContactEmpty(_0x410fa3)){checkContactLowerLimitOriginate(_0x442fdb,0x1,0x0);_0x5dc144[_0xc8f4('0xac')](_0x442fdb)[_0xc8f4('0xab')](sendMessageReschedule(_0x442fdb))['catch'](loggerCatch(_0xc8f4('0xad')));}else{_0x442fdb[_0xc8f4('0x41')]=_0xc8f4('0x1c7');if(_[_0xc8f4('0xa2')](_0x410fa3[0x0])||_[_0xc8f4('0xa2')](_0x410fa3[0x0]['Contact'])||_[_0xc8f4('0xa2')](_0x410fa3[0x0][_0xc8f4('0x139')][_0xc8f4('0x13a')])){_0x5dc144[_0xc8f4('0xc1')](_0xc8f4('0x1c9'),_0x442fdb,_0x410fa3[0x0]);}else{_0x5dc144[_0xc8f4('0xae')](_[_0xc8f4('0x100')](_0x410fa3[0x0],[_0xc8f4('0xc7'),_0xc8f4('0x1ca')]))[_0xc8f4('0xab')](_0x5dc144[_0xc8f4('0x1b0')](_0x442fdb,_0x410fa3[0x0]))[_0xc8f4('0xa6')](_0x5dc144[_0xc8f4('0xc0')](_0xc8f4('0x1d1'),_0x442fdb));}}})[_0xc8f4('0xa6')](loggerGetContactDialer(_0xc8f4('0x1d2'),_0x442fdb,0x1));emitVoiceQueueSummary(_0x442fdb);};Dialer[_0xc8f4('0x1d')][_0xc8f4('0x1a6')]=function(_0x405f01,_0x2510e4,_0x65ff0,_0x29128e,_0x4c6780,_0x46adca){loggerPredictive['info'](_0xc8f4('0x1d3'),_0xc8f4('0x1d4'),_0x405f01,_0xc8f4('0x1d5'),_0x2510e4,_0xc8f4('0x1d6'),_0x65ff0,_0xc8f4('0x1d7'),_0x29128e,_0xc8f4('0x1d8'),_0x4c6780);return new BPromise(function(_0x53a1b8,_0x3832cd){if(_0x405f01<=0x0||isNaN(_0x405f01)){return _0x3832cd(msgResponse(_0xc8f4('0x1d3'),_0xc8f4('0x4b'),_0xc8f4('0x1d9')+_0x405f01));}if(_0x65ff0<=0x0||isNaN(_0x65ff0)){return _0x3832cd(msgResponse(_0xc8f4('0x1d3'),_0xc8f4('0x4b'),'Ts\x20=\x20'+_0x65ff0));}if(_0x29128e<=0x0||isNaN(_0x29128e)){return _0x3832cd(msgResponse('[abandonmentRate]',_0xc8f4('0x4b'),_0xc8f4('0x1da')+_0x29128e));}if(_0x2510e4<=0x0||isNaN(_0x2510e4)){return _0x3832cd(msgResponse(_0xc8f4('0x1d3'),_0xc8f4('0x4b'),_0xc8f4('0x1db')+_0x2510e4));}if(_0x4c6780<=0x0||isNaN(_0x4c6780)){return _0x3832cd(msgResponse(_0xc8f4('0x1d3'),_0xc8f4('0x4b'),_0xc8f4('0x1dc')+_0x4c6780));}_0x46adca=_0x46adca||0x0;var _0x431841=0x1/_0x65ff0;var _0x549648=0x0;var _0x4f7eb4=0x0;var _0xd2baf4=0x0;var _0x5a493e=0x0;for(var _0x185617=0x0;_0xd2baf4<_0x4c6780;_0x185617+=0x1){_0x4f7eb4=_0x185617/_0x2510e4;_0x549648=(_0x29128e*_0x4f7eb4+_0x46adca)/_0x431841;_0xd2baf4=erlangb(_0x549648,_0x405f01);_0x5a493e=_0x549648/_0x405f01*(0x1-erlangb(_0x549648,_0x405f01));}return _0x53a1b8({'erlangCalls':_0x185617,'erlangCallToSecond':_0x2510e4/_0x185617,'erlangAbandonmentRate':_0xd2baf4,'erlangBusyFactor':_0x5a493e});});};Dialer[_0xc8f4('0x1d')]['busyFactor']=function(_0x31c02e,_0x27fd0a,_0x38bce0,_0x9546b9,_0x1ab292,_0x2b5ae5){loggerPredictive[_0xc8f4('0x7d')](_0xc8f4('0x1dd'),_0xc8f4('0x1d4'),_0x31c02e,_0xc8f4('0x1d5'),_0x27fd0a,_0xc8f4('0x1d6'),_0x38bce0,'\x20p\x20=\x20',_0x9546b9,_0xc8f4('0x1de'),_0x1ab292);return new BPromise(function(_0x14fe51,_0x3fcb28){if(_0x31c02e<=0x0||isNaN(_0x31c02e)){return _0x3fcb28(msgResponse(_0xc8f4('0x1d3'),_0xc8f4('0x4b'),'m\x20=\x20'+_0x31c02e));}if(_0x38bce0<=0x0||isNaN(_0x38bce0)){return _0x3fcb28(msgResponse(_0xc8f4('0x1d3'),_0xc8f4('0x4b'),_0xc8f4('0x1df')+_0x38bce0));}if(_0x9546b9<=0x0||isNaN(_0x9546b9)){return _0x3fcb28(msgResponse('[abandonmentRate]',_0xc8f4('0x4b'),'p\x20=\x20'+_0x9546b9));}if(_0x27fd0a<=0x0||isNaN(_0x27fd0a)){return _0x3fcb28(msgResponse('[abandonmentRate]','Error',_0xc8f4('0x1db')+_0x27fd0a));}if(_0x1ab292<=0x0||isNaN(_0x1ab292)){return _0x3fcb28(msgResponse('[abandonmentRate]',_0xc8f4('0x4b'),_0xc8f4('0x1dc')+_0x1ab292));}_0x2b5ae5=_0x2b5ae5||0x0;var _0x1e329f=0x1/_0x38bce0;var _0x4173f6=0x0;var _0x572f94=0x0;var _0x36b043=0x0;var _0x6899a2=0x0;for(var _0x49f078=0x0;_0x6899a2<_0x1ab292;_0x49f078+=0x1){_0x572f94=_0x49f078/_0x27fd0a;_0x4173f6=(_0x9546b9*_0x572f94+_0x2b5ae5)/_0x1e329f;_0x36b043=erlangb(_0x4173f6,_0x31c02e);_0x6899a2=_0x4173f6/_0x31c02e*(0x1-erlangb(_0x4173f6,_0x31c02e));}return _0x14fe51({'erlangCalls':_0x49f078,'erlangCallToSecond':_0x27fd0a/_0x49f078,'erlangAbandonmentRate':_0x36b043,'erlangBusyFactor':_0x6899a2});});};module[_0xc8f4('0x1e0')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index a2fe0fa..f119ec5 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ac7=['countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','starttime','responsetime','droptime','endtime','holdtime','talktime','membername','connectedlinename','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x282cb5,_0x1a4718){var _0x457f70=function(_0x59e2c1){while(--_0x59e2c1){_0x282cb5['push'](_0x282cb5['shift']());}};_0x457f70(++_0x1a4718);}(_0x2ac7,0x1bd));var _0x72ac=function(_0x3af7ba,_0x374a2e){_0x3af7ba=_0x3af7ba-0x0;var _0x7991fc=_0x2ac7[_0x3af7ba];return _0x7991fc;};'use strict';var util=require('util');var _=require(_0x72ac('0x0'));var moment=require('moment');function getSeconds(_0x4997a0,_0x18f7b5){var _0x3cca1a=moment(_0x4997a0)[_0x72ac('0x1')](0x0);var _0x44d242=moment(_0x18f7b5)[_0x72ac('0x1')](0x0);return _0x3cca1a[_0x72ac('0x2')](_0x44d242,_0x72ac('0x3'));}function QueueCallerAbandon(_0xb88924,_0x501f4f){this[_0x72ac('0x4')]=_0xb88924['scheduledat'];this['type']=_0xb88924[_0x72ac('0x5')];this[_0x72ac('0x6')]=_0xb88924[_0x72ac('0x5')]===_0x72ac('0x7')?_0x72ac('0x8'):_0xb88924['type'];this[_0x72ac('0x9')]=_0xb88924[_0x72ac('0x9')];this[_0x72ac('0xa')]=_0xb88924[_0x72ac('0xa')];this[_0x72ac('0xb')]=_0xb88924[_0x72ac('0xb')];this[_0x72ac('0xc')]=_0xb88924[_0x72ac('0x9')]+_0xb88924['countcongestionretry']+_0xb88924[_0x72ac('0xb')];this[_0x72ac('0xd')]=_0x501f4f[_0x72ac('0xd')];this[_0x72ac('0xe')]=_0xb88924[_0x72ac('0xf')];this['calleridnum']=_0xb88924['number'];this['starttime']=_0xb88924[_0x72ac('0x10')];this[_0x72ac('0x11')]=_0xb88924[_0x72ac('0x11')];this[_0x72ac('0x12')]=_0xb88924[_0x72ac('0x12')];this[_0x72ac('0x13')]=this[_0x72ac('0x12')];this['ringtime']=getSeconds(_0xb88924[_0x72ac('0x11')],_0xb88924[_0x72ac('0x10')]);this[_0x72ac('0x14')]=getSeconds(this['droptime'],_0xb88924[_0x72ac('0x11')]);this[_0x72ac('0x15')]=0x0;this[_0x72ac('0x8')]=_0x501f4f[_0x72ac('0x8')];this[_0x72ac('0x16')]=_0x501f4f[_0x72ac('0x17')];this['reason']=_0x501f4f['reason'];this[_0x72ac('0x18')]=_0xb88924[_0x72ac('0x18')];this[_0x72ac('0x19')]=_0xb88924[_0x72ac('0x19')];this['callbackat']=_0xb88924[_0x72ac('0x1a')];this[_0x72ac('0x1b')]=_0xb88924['recallme'];this[_0x72ac('0x1c')]=_0xb88924[_0x72ac('0x1c')];this[_0x72ac('0x1d')]=_0xb88924[_0x72ac('0x1d')];this[_0x72ac('0x1e')]=_0xb88924[_0x72ac('0x1e')];this[_0x72ac('0x1f')]=_0xb88924['VoiceQueueId'];this['CampaignId']=_0xb88924['CampaignId'];this[_0x72ac('0x20')]=_0xb88924[_0x72ac('0x20')]||'';this['originatecalleridname']=_0xb88924[_0x72ac('0x21')]||'';}module[_0x72ac('0x22')]=QueueCallerAbandon; \ No newline at end of file +var _0x40ee=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename'];(function(_0x11bf1b,_0x50581b){var _0x387d1c=function(_0x54e22f){while(--_0x54e22f){_0x11bf1b['push'](_0x11bf1b['shift']());}};_0x387d1c(++_0x50581b);}(_0x40ee,0x1cf));var _0xe40e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x40ee[_0x297fd3];return _0x2af381;};'use strict';var util=require(_0xe40e('0x0'));var _=require(_0xe40e('0x1'));var moment=require(_0xe40e('0x2'));function getSeconds(_0x554b76,_0x1e5ffe){var _0x445a31=moment(_0x554b76)[_0xe40e('0x3')](0x0);var _0xe63dec=moment(_0x1e5ffe)[_0xe40e('0x3')](0x0);return _0x445a31[_0xe40e('0x4')](_0xe63dec,_0xe40e('0x5'));}function QueueCallerAbandon(_0x13c735,_0x3f1a60){this['scheduledat']=_0x13c735[_0xe40e('0x6')];this[_0xe40e('0x7')]=_0x13c735[_0xe40e('0x7')];this[_0xe40e('0x8')]=_0x13c735[_0xe40e('0x7')]===_0xe40e('0x9')?_0xe40e('0xa'):_0x13c735['type'];this[_0xe40e('0xb')]=_0x13c735[_0xe40e('0xb')];this[_0xe40e('0xc')]=_0x13c735[_0xe40e('0xc')];this['countnoanswerretry']=_0x13c735['countnoanswerretry'];this[_0xe40e('0xd')]=_0x13c735[_0xe40e('0xb')]+_0x13c735[_0xe40e('0xc')]+_0x13c735[_0xe40e('0xe')];this[_0xe40e('0xf')]=_0x3f1a60[_0xe40e('0xf')];this[_0xe40e('0x10')]=_0x13c735[_0xe40e('0x11')];this[_0xe40e('0x12')]=_0x13c735[_0xe40e('0x13')];this[_0xe40e('0x14')]=_0x13c735[_0xe40e('0x14')];this[_0xe40e('0x15')]=_0x13c735[_0xe40e('0x15')];this['droptime']=_0x13c735[_0xe40e('0x16')];this[_0xe40e('0x17')]=this[_0xe40e('0x16')];this[_0xe40e('0x18')]=getSeconds(_0x13c735[_0xe40e('0x15')],_0x13c735[_0xe40e('0x14')]);this[_0xe40e('0x19')]=getSeconds(this[_0xe40e('0x16')],_0x13c735['responsetime']);this[_0xe40e('0x1a')]=0x0;this[_0xe40e('0xa')]=_0x3f1a60[_0xe40e('0xa')];this[_0xe40e('0x1b')]=_0x3f1a60[_0xe40e('0x1c')];this[_0xe40e('0x1d')]=_0x3f1a60['reason'];this[_0xe40e('0x1e')]=_0x13c735['callback'];this[_0xe40e('0x1f')]=_0x13c735[_0xe40e('0x1f')];this['callbackat']=_0x13c735[_0xe40e('0x20')];this[_0xe40e('0x21')]=_0x13c735['recallme'];this[_0xe40e('0x22')]=_0x13c735[_0xe40e('0x22')];this[_0xe40e('0x23')]=_0x13c735['ListId'];this['UserId']=_0x13c735[_0xe40e('0x24')];this[_0xe40e('0x25')]=_0x13c735[_0xe40e('0x25')];this['CampaignId']=_0x13c735['CampaignId'];this[_0xe40e('0x26')]=_0x13c735[_0xe40e('0x26')]||'';this[_0xe40e('0x27')]=_0x13c735[_0xe40e('0x27')]||'';}module[_0xe40e('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 5cbf791..0514950 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 _0x9c8c=['headerinfo','path','AttachmentId','exports','lodash','moment','uniqueid','format','%s/%s/%s','tech','Trunk','name','localstationid'];(function(_0x47483e,_0x232441){var _0x85398e=function(_0x156250){while(--_0x156250){_0x47483e['push'](_0x47483e['shift']());}};_0x85398e(++_0x232441);}(_0x9c8c,0x13c));var _0xc9c8=function(_0x220832,_0x3188aa){_0x220832=_0x220832-0x0;var _0x3edb41=_0x9c8c[_0x220832];return _0x3edb41;};'use strict';var util=require('util');var _=require(_0xc9c8('0x0'));var moment=require(_0xc9c8('0x1'));function Action(_0xcbe88a,_0x3a03eb,_0x245220){this[_0xc9c8('0x2')]=_0xcbe88a||undefined;this['channel']=util[_0xc9c8('0x3')](_0xc9c8('0x4'),_0x3a03eb[_0xc9c8('0x5')],_0x3a03eb[_0xc9c8('0x6')][_0xc9c8('0x7')],_0x245220['fax']);this['localstationid']=_0x3a03eb[_0xc9c8('0x8')];this['headerinfo']=_0x3a03eb[_0xc9c8('0x9')];this[_0xc9c8('0xa')]=_0x245220[_0xc9c8('0xa')];this[_0xc9c8('0xb')]=_0x245220[_0xc9c8('0xb')];}module[_0xc9c8('0xc')]=Action; \ No newline at end of file +var _0xf385=['lodash','moment','uniqueid','channel','format','tech','Trunk','fax','localstationid','headerinfo','path','AttachmentId','exports'];(function(_0x7b870,_0xce8bf0){var _0x33fec8=function(_0x31a1fd){while(--_0x31a1fd){_0x7b870['push'](_0x7b870['shift']());}};_0x33fec8(++_0xce8bf0);}(_0xf385,0x1e1));var _0x5f38=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xf385[_0x376b45];return _0x2341b3;};'use strict';var util=require('util');var _=require(_0x5f38('0x0'));var moment=require(_0x5f38('0x1'));function Action(_0x373fe3,_0x3ce239,_0x5e64cf){this[_0x5f38('0x2')]=_0x373fe3||undefined;this[_0x5f38('0x3')]=util[_0x5f38('0x4')]('%s/%s/%s',_0x3ce239[_0x5f38('0x5')],_0x3ce239[_0x5f38('0x6')]['name'],_0x5e64cf[_0x5f38('0x7')]);this[_0x5f38('0x8')]=_0x3ce239['localstationid'];this[_0x5f38('0x9')]=_0x3ce239[_0x5f38('0x9')];this['path']=_0x5e64cf[_0x5f38('0xa')];this[_0x5f38('0xb')]=_0x5e64cf['AttachmentId'];}module[_0x5f38('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 2f931bc..e35ed10 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 _0xe952=['syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','remotestationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','update','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','util','lodash','uuid','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype'];(function(_0x272561,_0x25787e){var _0x147b21=function(_0x26e1af){while(--_0x26e1af){_0x272561['push'](_0x272561['shift']());}};_0x147b21(++_0x25787e);}(_0xe952,0x1bb));var _0x2e95=function(_0x43faaa,_0x350896){_0x43faaa=_0x43faaa-0x0;var _0x2d9815=_0xe952[_0x43faaa];return _0x2d9815;};'use strict';var util=require(_0x2e95('0x0'));var _=require(_0x2e95('0x1'));var BPromise=require('bluebird');var uuid=require(_0x2e95('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x2e95('0x3'));var gs=require(_0x2e95('0x4'));var logger=require(_0x2e95('0x5'))('fax');var ami=require(_0x2e95('0x6'));var rpcDb=require('./rpcDb');var Channel=require(_0x2e95('0x7'));var ut=require(_0x2e95('0x8'));var Action=require('./action');var faxAccount=require(_0x2e95('0x9'));var attachment=require(_0x2e95('0xa'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x294504){this['channels']={};this[_0x2e95('0xb')]=_0x294504[_0x2e95('0xb')];this[_0x2e95('0xc')]=_0x294504['trunks'];this[_0x2e95('0xd')]={};ami['on'](_0x2e95('0xe'),this['syncNewchannel'][_0x2e95('0xf')](this));ami['on'](_0x2e95('0x10'),this[_0x2e95('0x11')][_0x2e95('0xf')](this));ami['on'](_0x2e95('0x12'),this[_0x2e95('0x13')]['bind'](this));ami['on']('newexten',this[_0x2e95('0x14')]['bind'](this));ami['on'](_0x2e95('0x15'),this['syncFaxStatus']['bind'](this));ami['on'](_0x2e95('0x16'),this[_0x2e95('0x17')][_0x2e95('0xf')](this));ami['on'](_0x2e95('0x18'),this[_0x2e95('0x19')][_0x2e95('0xf')](this));ami['on'](_0x2e95('0x1a'),this[_0x2e95('0x1b')][_0x2e95('0xf')](this));}Fax[_0x2e95('0x1c')][_0x2e95('0x1d')]=function(_0x1cb0d9){if(_0x1cb0d9[_0x2e95('0x1e')]===_0x2e95('0x1f')){for(var _0x287bec in this[_0x2e95('0xb')]){if(this['faxAccounts'][_0x2e95('0x20')](_0x287bec)){if(_0x1cb0d9[_0x2e95('0x21')]===this['faxAccounts'][_0x287bec][_0x2e95('0x22')]){this[_0x2e95('0x23')][_0x1cb0d9['uniqueid']]={};this[_0x2e95('0x23')][_0x1cb0d9[_0x2e95('0x24')]]['channel']=_0x1cb0d9[_0x2e95('0x25')];this['channels'][_0x1cb0d9[_0x2e95('0x24')]]['id']=this[_0x2e95('0xb')][_0x287bec]['id'];this['channels'][_0x1cb0d9[_0x2e95('0x24')]][_0x2e95('0x26')]=this[_0x2e95('0xb')][_0x287bec][_0x2e95('0x26')];logger[_0x2e95('0x27')](_0x1cb0d9['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x1cb0d9[_0x2e95('0x24')]]){this[_0x2e95('0x23')][_0x1cb0d9[_0x2e95('0x24')]]={};this[_0x2e95('0x23')][_0x1cb0d9[_0x2e95('0x24')]]['channel']=_0x1cb0d9['channel'];logger[_0x2e95('0x27')](_0x1cb0d9[_0x2e95('0x24')],_0x2e95('0x28'));}};Fax[_0x2e95('0x1c')][_0x2e95('0x11')]=function(_0x51f32f){if(this['channels'][_0x51f32f[_0x2e95('0x24')]]){for(var _0x4510d4 in _0x51f32f['variable']){if(_0x51f32f[_0x2e95('0x29')][_0x2e95('0x20')](_0x4510d4)){this[_0x2e95('0x23')][_0x51f32f['uniqueid']][_0x4510d4]=_0x51f32f[_0x2e95('0x2a')];}}}};Fax[_0x2e95('0x1c')][_0x2e95('0x13')]=function(_0x23fc11){if(this[_0x2e95('0x23')][_0x23fc11[_0x2e95('0x24')]]){this[_0x2e95('0x23')][_0x23fc11[_0x2e95('0x24')]]['channelstate']=_0x23fc11[_0x2e95('0x2b')];this[_0x2e95('0x23')][_0x23fc11['uniqueid']][_0x2e95('0x2c')]=_0x23fc11[_0x2e95('0x2c')];}};Fax['prototype']['syncNewExten']=function(_0x4f0ca5){if(this['channels'][_0x4f0ca5[_0x2e95('0x24')]]){for(var _0x36aeba in _0x4f0ca5[_0x2e95('0x29')]){if(_0x4f0ca5[_0x2e95('0x29')]['hasOwnProperty'](_0x36aeba)){this[_0x2e95('0x23')][_0x4f0ca5[_0x2e95('0x24')]][_0x36aeba]=_0x4f0ca5[_0x2e95('0x2a')];}}}};Fax[_0x2e95('0x1c')][_0x2e95('0x2d')]=function(_0x1c6af5){if(this[_0x2e95('0x23')][_0x1c6af5[_0x2e95('0x24')]]){this[_0x2e95('0x23')][_0x1c6af5['uniqueid']][_0x2e95('0x2e')]=_0x1c6af5[_0x2e95('0x2e')];this[_0x2e95('0x23')][_0x1c6af5['uniqueid']][_0x2e95('0x2f')]=_0x1c6af5[_0x2e95('0x2f')];this[_0x2e95('0x23')][_0x1c6af5[_0x2e95('0x24')]]['localstationid']=_0x1c6af5[_0x2e95('0x22')];this[_0x2e95('0x23')][_0x1c6af5['uniqueid']][_0x2e95('0x30')]=_0x1c6af5[_0x2e95('0x30')];logger['info'](_0x1c6af5[_0x2e95('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0x2e95('0x1c')][_0x2e95('0x17')]=function(_0x268405){var _0xe1eb29=this;if(this['channels'][_0x268405[_0x2e95('0x24')]]){var _0x4e96de=this[_0x2e95('0x23')][_0x268405[_0x2e95('0x24')]]['id'];this[_0x2e95('0x23')][_0x268405['uniqueid']][_0x2e95('0x31')]=_0x268405[_0x2e95('0x31')];this[_0x2e95('0x23')][_0x268405[_0x2e95('0x24')]]['pagestransferred']=_0x268405['pagestransferred'];this['channels'][_0x268405[_0x2e95('0x24')]][_0x2e95('0x22')]=_0x268405['localstationid'];this['channels'][_0x268405[_0x2e95('0x24')]][_0x2e95('0x32')]=_0x268405[_0x2e95('0x32')];this[_0x2e95('0x23')][_0x268405['uniqueid']][_0x2e95('0x33')]=_0x268405[_0x2e95('0x33')];this[_0x2e95('0x23')][_0x268405[_0x2e95('0x24')]]['filename']=_0x268405['filename'];this[_0x2e95('0x23')][_0x268405[_0x2e95('0x24')]][_0x2e95('0x34')]=_0x268405[_0x2e95('0x34')];if(this['channels'][_0x268405['uniqueid']][_0x2e95('0x35')]>0x0){tiff2pdf(_0x268405['filename'],_0x2e95('0x36'),function(_0x3da558){logger[_0x2e95('0x27')](_0x268405[_0x2e95('0x24')],_0x2e95('0x37'),_0x3da558[_0x2e95('0x38')]);attachment[_0x2e95('0x39')]({'name':path[_0x2e95('0x3a')](_0x268405[_0x2e95('0x30')])[_0x2e95('0x26')],'basename':path[_0x2e95('0x3a')](_0x268405['filename'])[_0x2e95('0x26')]+_0x2e95('0x3b'),'type':_0x2e95('0x3c')})[_0x2e95('0x3d')](function(_0xa6608b){faxAccount['notify'](_0x4e96de,{'from':_0x268405['calleridnum'],'mapKey':'fax','body':path['parse'](_0x268405['filename'])[_0x2e95('0x26')]+_0x2e95('0x3b'),'AttachmentId':_0xa6608b['id']})[_0x2e95('0x3e')](function(_0x2aa721){logger[_0x2e95('0x3f')](_0x268405['uniqueid'],_0x2e95('0x40'),JSON[_0x2e95('0x41')](_0x2aa721));});})['catch'](function(_0x3723fd){logger[_0x2e95('0x3f')](_0x268405[_0x2e95('0x24')],_0x2e95('0x42'),JSON['stringify'](_0x3723fd));});});}logger[_0x2e95('0x27')](_0x268405[_0x2e95('0x24')],_0x2e95('0x42'));}};Fax[_0x2e95('0x1c')][_0x2e95('0x1b')]=function(_0x59a14c){if(this[_0x2e95('0xd')][_0x59a14c[_0x2e95('0x24')]]){_[_0x2e95('0x43')](this[_0x2e95('0x23')][_0x59a14c['uniqueid']],_[_0x2e95('0x44')](_0x59a14c,['response',_0x2e95('0x45')]));}};function updateStatus(_0x55555a){if(_0x55555a[_0x2e95('0x46')]){faxMessage['update'](_0x55555a[_0x2e95('0x46')],{'failMessage':_0x2e95('0x47')})['then'](function(_0x3c6208){ut[_0x2e95('0x48')](_0x2e95('0x49'),_0x3c6208);})[_0x2e95('0x3e')](function(_0x26139a){ut[_0x2e95('0x48')](_0x2e95('0x4a'),_0x26139a);});}else{ut[_0x2e95('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x2e95('0x1c')][_0x2e95('0x4b')]=function(_0x117677,_0x7d4228,_0xe6597c){var _0x2ad7de=this;var _0x4ffee7={};if(_0x7d4228){_0x4ffee7={'read':_0x7d4228};}else{_0x4ffee7={'failMessage':_0xe6597c};}if(this[_0x2e95('0xd')][_0x117677][_0x2e95('0x46')]){faxMessage[_0x2e95('0x4c')](this['actions'][_0x117677][_0x2e95('0x46')],_0x4ffee7)[_0x2e95('0x3d')](function(_0x5f2cb6){ut[_0x2e95('0x48')](_0x2e95('0x4d'),_0x5f2cb6);})[_0x2e95('0x3e')](function(_0x13068d){ut['logger']('[Fax][Message][NoUpdate1]',_0x13068d);})[_0x2e95('0x4e')](function(){delete _0x2ad7de[_0x2e95('0x23')][_0x117677];delete _0x2ad7de[_0x2e95('0xd')][_0x117677];});}else{ut[_0x2e95('0x48')](_0x2e95('0x4f'));delete this['channels'][_0x117677];delete this['actions'][_0x117677];}};Fax[_0x2e95('0x1c')]['syncHangup']=function(_0x2ccf51){var _0x273ce7=this;if(this[_0x2e95('0x23')][_0x2ccf51[_0x2e95('0x24')]]){if(this[_0x2e95('0xd')][_0x2ccf51[_0x2e95('0x24')]]){this[_0x2e95('0x23')][_0x2ccf51['uniqueid']]['id']=this[_0x2e95('0xd')][_0x2ccf51[_0x2e95('0x24')]]['id'];this[_0x2e95('0x23')][_0x2ccf51[_0x2e95('0x24')]][_0x2e95('0x26')]=this['actions'][_0x2ccf51[_0x2e95('0x24')]]['name'];}logger['info'](_0x2ccf51['uniqueid'],this[_0x2e95('0xd')][_0x2ccf51[_0x2e95('0x24')]]?'\x20hangup\x20sendFile\x20':_0x2e95('0x50'),JSON[_0x2e95('0x41')](this['channels'][_0x2ccf51['uniqueid']]));if(this[_0x2e95('0xd')][_0x2ccf51[_0x2e95('0x24')]]){if(this[_0x2e95('0x23')][_0x2ccf51['uniqueid']][_0x2e95('0x51')]>0x0&&this['channels'][_0x2ccf51[_0x2e95('0x24')]][_0x2e95('0x15')]===_0x2e95('0x52')){this['updateStatus'](_0x2ccf51['uniqueid'],!![]);}else{this[_0x2e95('0x4b')](_0x2ccf51[_0x2e95('0x24')],![],this[_0x2e95('0x23')][_0x2ccf51[_0x2e95('0x24')]][_0x2e95('0x53')]?_0x2e95('0x54')+this[_0x2e95('0x23')][_0x2ccf51[_0x2e95('0x24')]][_0x2e95('0x53')]:_0x2e95('0x55'));}}}};Fax[_0x2e95('0x1c')][_0x2e95('0x56')]=function(_0xccdf4){var _0x151993=this;return new BPromise(function(_0x338498,_0xa52848){_0x151993[_0x2e95('0x57')](_0xccdf4,_0x151993[_0x2e95('0xb')][_0xccdf4['FaxAccountId']])[_0x2e95('0x3d')](function(_0x510079){ut[_0x2e95('0x48')]('[Fax][execOriginate][success]',_0x510079);_0x338498(ut[_0x2e95('0x38')](_0x2e95('0x58')));})[_0x2e95('0x3e')](function(_0x156d5d){ut['logger'](_0x2e95('0x59'),_0x156d5d);updateStatus(_0xccdf4);_0xa52848(ut['message'](_0x2e95('0x5a')));});});};Fax[_0x2e95('0x1c')][_0x2e95('0x5b')]=function(_0x42d2f4){var _0xd31439=this;return new BPromise(function(_0x809fe3,_0x3721a8){var _0x1ed7ce=_0xd31439[_0x2e95('0x5c')](_0xd31439['faxAccounts'][_0x42d2f4[_0x2e95('0x5d')]][_0x2e95('0x5e')],_0x42d2f4);if(_0x1ed7ce[_0x2e95('0x5f')]){_0x809fe3(ut['message'](_0x2e95('0x60')));}else{_0x3721a8(ut[_0x2e95('0x38')](_0x1ed7ce['message']));}});};function originate(_0x303bb2,_0x28ab9e,_0x92b5ad){return new BPromise(function(_0x2da749,_0x2a7348){if(_0x92b5ad){var _0x50afb5=util[_0x2e95('0x61')]('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[_0x2e95('0x3a')](_0x303bb2[_0x2e95('0x62')])['name'],_0x303bb2[_0x2e95('0x62')]);gs[_0x2e95('0x63')](_0x50afb5)[_0x2e95('0x3d')](function(){_0x303bb2[_0x2e95('0x62')]=util['format'](_0x2e95('0x64'),path[_0x2e95('0x3a')](_0x303bb2[_0x2e95('0x62')])[_0x2e95('0x65')],path[_0x2e95('0x3a')](_0x303bb2[_0x2e95('0x62')])['name']);_0x28ab9e[_0x2e95('0x66')]=_0x303bb2['path'];ut[_0x2e95('0x48')](_0x2e95('0x67'),'');ami[_0x2e95('0x68')](ut['variablesAction'](_0x303bb2,_0x28ab9e))[_0x2e95('0x3d')](function(_0x1b9e87){_0x2da749(_0x1b9e87);})['catch'](function(_0x5db7d7){_0x2a7348(_0x5db7d7);});})[_0x2e95('0x3e')](function(_0x4ad7e1){_0x2a7348(_0x4ad7e1);});}else{ami['Action'](ut[_0x2e95('0x69')](_0x303bb2,_0x28ab9e))[_0x2e95('0x3d')](function(_0x57a6c5){_0x2da749(_0x57a6c5);})[_0x2e95('0x3e')](function(_0x2a9920){_0x2a7348(_0x2a9920);});}});}Fax[_0x2e95('0x1c')][_0x2e95('0x57')]=function(_0x2772a3,_0x57fa5f){var _0x35cc1d=this;return new BPromise(function(_0xa2242f,_0x4352f9){var _0x24c211=uuid['v4']();var _0x38cd02=ut[_0x2e95('0x6a')](_0x2772a3,_0x57fa5f);_0x35cc1d[_0x2e95('0xd')][_0x24c211]=new Action(_0x24c211,_0x57fa5f,_0x2772a3);var _0xad0518=_0x35cc1d[_0x2e95('0xd')][_0x24c211];if(path[_0x2e95('0x3a')](_0x2772a3[_0x2e95('0x62')])[_0x2e95('0x6b')]===_0x2e95('0x3b')){originate(_0xad0518,_0x38cd02,!![])[_0x2e95('0x3d')](function(_0x19425a){_0xa2242f(_0x19425a);})[_0x2e95('0x3e')](function(_0x41ebe2){_0x4352f9(_0x41ebe2);});}else{originate(_0xad0518,_0x38cd02,![])[_0x2e95('0x3d')](function(_0x3e3fe3){_0xa2242f(_0x3e3fe3);})[_0x2e95('0x3e')](function(_0x3fe1c7){_0x4352f9(_0x3fe1c7);});}});};Fax[_0x2e95('0x1c')][_0x2e95('0x6c')]=function(_0x1bb49a){return!_[_0x2e95('0x6d')](_0x1bb49a)&&!_['isNil'](_0x1bb49a['name'])&&!_[_0x2e95('0x6d')](_0x1bb49a[_0x2e95('0x6e')])&&_0x1bb49a[_0x2e95('0x6e')]&&!_[_0x2e95('0x6d')](this[_0x2e95('0xc')][util[_0x2e95('0x61')](_0x2e95('0x6f'),_0x1bb49a[_0x2e95('0x26')])])&&!_[_0x2e95('0x6d')](this[_0x2e95('0xc')][util[_0x2e95('0x61')](_0x2e95('0x6f'),_0x1bb49a[_0x2e95('0x26')])][_0x2e95('0x2f')])&&(this[_0x2e95('0xc')][util[_0x2e95('0x61')](_0x2e95('0x6f'),_0x1bb49a[_0x2e95('0x26')])][_0x2e95('0x2f')]==='reachable'||this[_0x2e95('0xc')][util[_0x2e95('0x61')]('SIP/%s',_0x1bb49a[_0x2e95('0x26')])][_0x2e95('0x2f')]===_0x2e95('0x70'));};Fax['prototype'][_0x2e95('0x5c')]=function(_0x13d73d,_0x53e7a1){if(!this[_0x2e95('0x6c')](_0x13d73d)){ut[_0x2e95('0x48')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x2e95('0x6d')](_0x13d73d)?'':_0x13d73d[_0x2e95('0x26')]+_0x2e95('0x71'));return{'isValid':![],'message':_0x2e95('0x72')};}if(_[_0x2e95('0x6d')](_0x53e7a1[_0x2e95('0x73')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x2e95('0x41')](_0x53e7a1));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x2e95('0x6d')](_0x53e7a1['path'])){ut['logger'](_0x2e95('0x74'),JSON[_0x2e95('0x41')](_0x53e7a1));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x2e95('0x75')};};module['exports']=Fax; \ No newline at end of file +var _0x8ab5=['finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','faxstatus','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkTrunk','FaxAccountId','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','ext','isTrunkReachable','isNil','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','syncNewExten','syncFaxStatus','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','name','info','\x20syncNewchannel\x20','channel','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','error','\x20receiveFax\x20','stringify','merge','pick','reason','AttachmentId','SENDING\x20FAILED\x20','logger','catch','[Fax][Message][Error][NoUpdate1]','updateStatus','update','then','[Fax][Message][NoUpdate1]'];(function(_0x20d057,_0x1f77a9){var _0x1694df=function(_0x436b50){while(--_0x436b50){_0x20d057['push'](_0x20d057['shift']());}};_0x1694df(++_0x1f77a9);}(_0x8ab5,0x98));var _0x58ab=function(_0x5c87b8,_0x7d5e66){_0x5c87b8=_0x5c87b8-0x0;var _0xe21122=_0x8ab5[_0x5c87b8];return _0xe21122;};'use strict';var util=require(_0x58ab('0x0'));var _=require(_0x58ab('0x1'));var BPromise=require(_0x58ab('0x2'));var uuid=require(_0x58ab('0x3'));var moment=require('moment');var path=require(_0x58ab('0x4'));var tiff2pdf=require(_0x58ab('0x5'));var gs=require(_0x58ab('0x6'));var logger=require(_0x58ab('0x7'))(_0x58ab('0x8'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x58ab('0x9'));var ut=require(_0x58ab('0xa'));var Action=require(_0x58ab('0xb'));var faxAccount=require(_0x58ab('0xc'));var attachment=require(_0x58ab('0xd'));var faxMessage=require(_0x58ab('0xe'));function Fax(_0x2e4f6e){this[_0x58ab('0xf')]={};this['faxAccounts']=_0x2e4f6e[_0x58ab('0x10')];this['trunks']=_0x2e4f6e[_0x58ab('0x11')];this[_0x58ab('0x12')]={};ami['on'](_0x58ab('0x13'),this[_0x58ab('0x14')][_0x58ab('0x15')](this));ami['on'](_0x58ab('0x16'),this[_0x58ab('0x17')][_0x58ab('0x15')](this));ami['on'](_0x58ab('0x18'),this['syncNewState'][_0x58ab('0x15')](this));ami['on'](_0x58ab('0x19'),this[_0x58ab('0x1a')][_0x58ab('0x15')](this));ami['on']('faxstatus',this[_0x58ab('0x1b')][_0x58ab('0x15')](this));ami['on']('receivefax',this[_0x58ab('0x1c')][_0x58ab('0x15')](this));ami['on'](_0x58ab('0x1d'),this[_0x58ab('0x1e')]['bind'](this));ami['on']('originateresponse',this[_0x58ab('0x1f')][_0x58ab('0x15')](this));}Fax[_0x58ab('0x20')][_0x58ab('0x14')]=function(_0x1f0573){if(_0x1f0573[_0x58ab('0x21')]===_0x58ab('0x22')){for(var _0x2fb286 in this[_0x58ab('0x10')]){if(this[_0x58ab('0x10')][_0x58ab('0x23')](_0x2fb286)){if(_0x1f0573[_0x58ab('0x24')]===this[_0x58ab('0x10')][_0x2fb286]['localstationid']){this['channels'][_0x1f0573[_0x58ab('0x25')]]={};this['channels'][_0x1f0573[_0x58ab('0x25')]]['channel']=_0x1f0573['channel'];this[_0x58ab('0xf')][_0x1f0573[_0x58ab('0x25')]]['id']=this[_0x58ab('0x10')][_0x2fb286]['id'];this[_0x58ab('0xf')][_0x1f0573[_0x58ab('0x25')]][_0x58ab('0x26')]=this[_0x58ab('0x10')][_0x2fb286][_0x58ab('0x26')];logger[_0x58ab('0x27')](_0x1f0573[_0x58ab('0x25')],_0x58ab('0x28'));}}}}if(this[_0x58ab('0x12')][_0x1f0573[_0x58ab('0x25')]]){this[_0x58ab('0xf')][_0x1f0573[_0x58ab('0x25')]]={};this['channels'][_0x1f0573[_0x58ab('0x25')]][_0x58ab('0x29')]=_0x1f0573[_0x58ab('0x29')];logger['info'](_0x1f0573['uniqueid'],_0x58ab('0x28'));}};Fax[_0x58ab('0x20')][_0x58ab('0x17')]=function(_0x14ac9a){if(this[_0x58ab('0xf')][_0x14ac9a[_0x58ab('0x25')]]){for(var _0x194bb7 in _0x14ac9a['variable']){if(_0x14ac9a[_0x58ab('0x2a')]['hasOwnProperty'](_0x194bb7)){this['channels'][_0x14ac9a[_0x58ab('0x25')]][_0x194bb7]=_0x14ac9a[_0x58ab('0x2b')];}}}};Fax[_0x58ab('0x20')][_0x58ab('0x2c')]=function(_0x242e30){if(this[_0x58ab('0xf')][_0x242e30[_0x58ab('0x25')]]){this[_0x58ab('0xf')][_0x242e30[_0x58ab('0x25')]][_0x58ab('0x2d')]=_0x242e30[_0x58ab('0x2d')];this[_0x58ab('0xf')][_0x242e30[_0x58ab('0x25')]][_0x58ab('0x2e')]=_0x242e30['channelstatedesc'];}};Fax[_0x58ab('0x20')]['syncNewExten']=function(_0x338ee0){if(this[_0x58ab('0xf')][_0x338ee0[_0x58ab('0x25')]]){for(var _0x379377 in _0x338ee0['variable']){if(_0x338ee0[_0x58ab('0x2a')][_0x58ab('0x23')](_0x379377)){this[_0x58ab('0xf')][_0x338ee0['uniqueid']][_0x379377]=_0x338ee0[_0x58ab('0x2b')];}}}};Fax[_0x58ab('0x20')][_0x58ab('0x1b')]=function(_0xfcba55){if(this[_0x58ab('0xf')][_0xfcba55[_0x58ab('0x25')]]){this[_0x58ab('0xf')][_0xfcba55['uniqueid']]['operation']=_0xfcba55[_0x58ab('0x2f')];this[_0x58ab('0xf')][_0xfcba55[_0x58ab('0x25')]][_0x58ab('0x30')]=_0xfcba55[_0x58ab('0x30')];this['channels'][_0xfcba55[_0x58ab('0x25')]][_0x58ab('0x31')]=_0xfcba55[_0x58ab('0x31')];this[_0x58ab('0xf')][_0xfcba55[_0x58ab('0x25')]][_0x58ab('0x32')]=_0xfcba55[_0x58ab('0x32')];logger[_0x58ab('0x27')](_0xfcba55['uniqueid'],_0x58ab('0x33'));}};Fax['prototype']['syncReceiveFax']=function(_0x5479e0){var _0x5a6adc=this;if(this[_0x58ab('0xf')][_0x5479e0[_0x58ab('0x25')]]){var _0x2c8cb4=this[_0x58ab('0xf')][_0x5479e0[_0x58ab('0x25')]]['id'];this[_0x58ab('0xf')][_0x5479e0[_0x58ab('0x25')]][_0x58ab('0x34')]=_0x5479e0[_0x58ab('0x34')];this[_0x58ab('0xf')][_0x5479e0[_0x58ab('0x25')]][_0x58ab('0x35')]=_0x5479e0[_0x58ab('0x35')];this[_0x58ab('0xf')][_0x5479e0[_0x58ab('0x25')]][_0x58ab('0x31')]=_0x5479e0[_0x58ab('0x31')];this[_0x58ab('0xf')][_0x5479e0['uniqueid']][_0x58ab('0x36')]=_0x5479e0[_0x58ab('0x36')];this[_0x58ab('0xf')][_0x5479e0[_0x58ab('0x25')]][_0x58ab('0x37')]=_0x5479e0[_0x58ab('0x37')];this[_0x58ab('0xf')][_0x5479e0[_0x58ab('0x25')]][_0x58ab('0x32')]=_0x5479e0['filename'];this[_0x58ab('0xf')][_0x5479e0[_0x58ab('0x25')]][_0x58ab('0x38')]=_0x5479e0[_0x58ab('0x38')];if(this[_0x58ab('0xf')][_0x5479e0[_0x58ab('0x25')]][_0x58ab('0x35')]>0x0){tiff2pdf(_0x5479e0[_0x58ab('0x32')],_0x58ab('0x39'),function(_0x3ce97d){logger[_0x58ab('0x27')](_0x5479e0[_0x58ab('0x25')],_0x58ab('0x3a'),_0x3ce97d[_0x58ab('0x3b')]);attachment[_0x58ab('0x3c')]({'name':path[_0x58ab('0x3d')](_0x5479e0[_0x58ab('0x32')])['name'],'basename':path['parse'](_0x5479e0[_0x58ab('0x32')])[_0x58ab('0x26')]+'.pdf','type':'application/pdf'})['then'](function(_0x512d90){faxAccount['notify'](_0x2c8cb4,{'from':_0x5479e0['calleridnum'],'mapKey':_0x58ab('0x8'),'body':path['parse'](_0x5479e0[_0x58ab('0x32')])[_0x58ab('0x26')]+_0x58ab('0x3e'),'AttachmentId':_0x512d90['id']})['catch'](function(_0x1c63f4){logger['error'](_0x5479e0[_0x58ab('0x25')],'\x20notify\x20',JSON['stringify'](_0x1c63f4));});})['catch'](function(_0x4f3712){logger[_0x58ab('0x3f')](_0x5479e0['uniqueid'],_0x58ab('0x40'),JSON[_0x58ab('0x41')](_0x4f3712));});});}logger['info'](_0x5479e0['uniqueid'],_0x58ab('0x40'));}};Fax[_0x58ab('0x20')]['syncOriginateResponse']=function(_0x36b963){if(this['actions'][_0x36b963[_0x58ab('0x25')]]){_[_0x58ab('0x42')](this[_0x58ab('0xf')][_0x36b963[_0x58ab('0x25')]],_[_0x58ab('0x43')](_0x36b963,['response',_0x58ab('0x44')]));}};function updateStatus(_0x83ece5){if(_0x83ece5['AttachmentId']){faxMessage['update'](_0x83ece5[_0x58ab('0x45')],{'failMessage':_0x58ab('0x46')})['then'](function(_0x57a2c2){ut[_0x58ab('0x47')]('[Fax][Message][Error][Updated]',_0x57a2c2);})[_0x58ab('0x48')](function(_0x42a808){ut['logger'](_0x58ab('0x49'),_0x42a808);});}else{ut[_0x58ab('0x47')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x58ab('0x20')][_0x58ab('0x4a')]=function(_0x33839d,_0x30e8fd,_0x499717){var _0x4f2196=this;var _0x6c0ef7={};if(_0x30e8fd){_0x6c0ef7={'read':_0x30e8fd};}else{_0x6c0ef7={'failMessage':_0x499717};}if(this[_0x58ab('0x12')][_0x33839d][_0x58ab('0x45')]){faxMessage[_0x58ab('0x4b')](this[_0x58ab('0x12')][_0x33839d]['AttachmentId'],_0x6c0ef7)[_0x58ab('0x4c')](function(_0x9c2a72){ut['logger']('[Fax][Message][Updated]',_0x9c2a72);})[_0x58ab('0x48')](function(_0x553670){ut[_0x58ab('0x47')](_0x58ab('0x4d'),_0x553670);})[_0x58ab('0x4e')](function(){delete _0x4f2196[_0x58ab('0xf')][_0x33839d];delete _0x4f2196[_0x58ab('0x12')][_0x33839d];});}else{ut[_0x58ab('0x47')](_0x58ab('0x4f'));delete this['channels'][_0x33839d];delete this[_0x58ab('0x12')][_0x33839d];}};Fax[_0x58ab('0x20')][_0x58ab('0x1e')]=function(_0x5b6745){var _0x57e632=this;if(this[_0x58ab('0xf')][_0x5b6745['uniqueid']]){if(this[_0x58ab('0x12')][_0x5b6745['uniqueid']]){this[_0x58ab('0xf')][_0x5b6745[_0x58ab('0x25')]]['id']=this['actions'][_0x5b6745[_0x58ab('0x25')]]['id'];this['channels'][_0x5b6745[_0x58ab('0x25')]][_0x58ab('0x26')]=this[_0x58ab('0x12')][_0x5b6745[_0x58ab('0x25')]]['name'];}logger[_0x58ab('0x27')](_0x5b6745['uniqueid'],this[_0x58ab('0x12')][_0x5b6745[_0x58ab('0x25')]]?_0x58ab('0x50'):'\x20hangup\x20faxRiceive\x20',JSON[_0x58ab('0x41')](this['channels'][_0x5b6745[_0x58ab('0x25')]]));if(this[_0x58ab('0x12')][_0x5b6745['uniqueid']]){if(this[_0x58ab('0xf')][_0x5b6745[_0x58ab('0x25')]][_0x58ab('0x51')]>0x0&&this[_0x58ab('0xf')][_0x5b6745[_0x58ab('0x25')]][_0x58ab('0x52')]===_0x58ab('0x53')){this[_0x58ab('0x4a')](_0x5b6745[_0x58ab('0x25')],!![]);}else{this[_0x58ab('0x4a')](_0x5b6745[_0x58ab('0x25')],![],this[_0x58ab('0xf')][_0x5b6745[_0x58ab('0x25')]]['faxstatusstring']?_0x58ab('0x54')+this[_0x58ab('0xf')][_0x5b6745['uniqueid']][_0x58ab('0x55')]:_0x58ab('0x56'));}}}};Fax[_0x58ab('0x20')]['send']=function(_0x2ff803){var _0x3d2155=this;return new BPromise(function(_0x48bd39,_0x1e238d){_0x3d2155[_0x58ab('0x57')](_0x2ff803,_0x3d2155[_0x58ab('0x10')][_0x2ff803['FaxAccountId']])['then'](function(_0x4875bc){ut['logger'](_0x58ab('0x58'),_0x4875bc);_0x48bd39(ut[_0x58ab('0x3b')](_0x58ab('0x59')));})[_0x58ab('0x48')](function(_0x16a412){ut[_0x58ab('0x47')](_0x58ab('0x5a'),_0x16a412);updateStatus(_0x2ff803);_0x1e238d(ut[_0x58ab('0x3b')]('Fax\x20failed'));});});};Fax[_0x58ab('0x20')]['checkAfterSend']=function(_0x36bdc4){var _0x3f1f6e=this;return new BPromise(function(_0x422f47,_0x1dd09c){var _0x460081=_0x3f1f6e[_0x58ab('0x5b')](_0x3f1f6e[_0x58ab('0x10')][_0x36bdc4[_0x58ab('0x5c')]][_0x58ab('0x5d')],_0x36bdc4);if(_0x460081['isValid']){_0x422f47(ut[_0x58ab('0x3b')]('Trunk\x20Reachable'));}else{_0x1dd09c(ut[_0x58ab('0x3b')](_0x460081[_0x58ab('0x3b')]));}});};function originate(_0x5781f7,_0x380ab5,_0x444cdb){return new BPromise(function(_0x13025e,_0xe69d07){if(_0x444cdb){var _0x5d1d6e=util[_0x58ab('0x5e')](_0x58ab('0x5f'),path[_0x58ab('0x3d')](_0x5781f7[_0x58ab('0x4')])['name'],_0x5781f7['path']);gs[_0x58ab('0x60')](_0x5d1d6e)['then'](function(){_0x5781f7[_0x58ab('0x4')]=util[_0x58ab('0x5e')](_0x58ab('0x61'),path[_0x58ab('0x3d')](_0x5781f7['path'])[_0x58ab('0x62')],path[_0x58ab('0x3d')](_0x5781f7[_0x58ab('0x4')])[_0x58ab('0x26')]);_0x380ab5[_0x58ab('0x63')]=_0x5781f7['path'];ut[_0x58ab('0x47')]('Convert\x20pdf\x20to\x20tif','');ami[_0x58ab('0x64')](ut[_0x58ab('0x65')](_0x5781f7,_0x380ab5))['then'](function(_0x6c4786){_0x13025e(_0x6c4786);})['catch'](function(_0x2d8992){_0xe69d07(_0x2d8992);});})[_0x58ab('0x48')](function(_0x11683d){_0xe69d07(_0x11683d);});}else{ami['Action'](ut['variablesAction'](_0x5781f7,_0x380ab5))[_0x58ab('0x4c')](function(_0x276816){_0x13025e(_0x276816);})[_0x58ab('0x48')](function(_0x1cf8bf){_0xe69d07(_0x1cf8bf);});}});}Fax[_0x58ab('0x20')][_0x58ab('0x57')]=function(_0x75a15b,_0x238494){var _0x220d1a=this;return new BPromise(function(_0x409081,_0x57bae6){var _0x549708=uuid['v4']();var _0x4fd56b=ut['addVariables'](_0x75a15b,_0x238494);_0x220d1a[_0x58ab('0x12')][_0x549708]=new Action(_0x549708,_0x238494,_0x75a15b);var _0x6335e7=_0x220d1a[_0x58ab('0x12')][_0x549708];if(path['parse'](_0x75a15b[_0x58ab('0x4')])[_0x58ab('0x66')]==='.pdf'){originate(_0x6335e7,_0x4fd56b,!![])['then'](function(_0x2e53ba){_0x409081(_0x2e53ba);})[_0x58ab('0x48')](function(_0x19c9b1){_0x57bae6(_0x19c9b1);});}else{originate(_0x6335e7,_0x4fd56b,![])[_0x58ab('0x4c')](function(_0x4a79db){_0x409081(_0x4a79db);})[_0x58ab('0x48')](function(_0x55eea6){_0x57bae6(_0x55eea6);});}});};Fax[_0x58ab('0x20')][_0x58ab('0x67')]=function(_0x29b2ee){return!_['isNil'](_0x29b2ee)&&!_[_0x58ab('0x68')](_0x29b2ee[_0x58ab('0x26')])&&!_[_0x58ab('0x68')](_0x29b2ee['active'])&&_0x29b2ee['active']&&!_[_0x58ab('0x68')](this[_0x58ab('0x11')][util[_0x58ab('0x5e')]('SIP/%s',_0x29b2ee[_0x58ab('0x26')])])&&!_[_0x58ab('0x68')](this[_0x58ab('0x11')][util[_0x58ab('0x5e')](_0x58ab('0x69'),_0x29b2ee[_0x58ab('0x26')])]['status'])&&(this[_0x58ab('0x11')][util[_0x58ab('0x5e')]('SIP/%s',_0x29b2ee['name'])][_0x58ab('0x30')]===_0x58ab('0x6a')||this[_0x58ab('0x11')][util[_0x58ab('0x5e')]('SIP/%s',_0x29b2ee[_0x58ab('0x26')])][_0x58ab('0x30')]===_0x58ab('0x6b'));};Fax[_0x58ab('0x20')][_0x58ab('0x5b')]=function(_0x4cee22,_0xec90cc){if(!this[_0x58ab('0x67')](_0x4cee22)){ut[_0x58ab('0x47')](_0x58ab('0x6c'),_['isNil'](_0x4cee22)?'':_0x4cee22['name']+_0x58ab('0x6d'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x58ab('0x68')](_0xec90cc[_0x58ab('0x8')])){ut[_0x58ab('0x47')](_0x58ab('0x6e'),JSON['stringify'](_0xec90cc));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x58ab('0x68')](_0xec90cc[_0x58ab('0x4')])){ut['logger'](_0x58ab('0x6f'),JSON['stringify'](_0xec90cc));return{'isValid':![],'message':_0x58ab('0x70')};}return{'isValid':!![],'message':_0x58ab('0x71')};};module[_0x58ab('0x72')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index f7baa3f..a919b95 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 _0x6841=['../../../config/logger','preview','../rpc/faxAccount','error','inspect','notify','then','[Notify]\x20','util','bluebird'];(function(_0x5965ac,_0x1e3fea){var _0x46deb2=function(_0x773024){while(--_0x773024){_0x5965ac['push'](_0x5965ac['shift']());}};_0x46deb2(++_0x1e3fea);}(_0x6841,0xc6));var _0x1684=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x6841[_0x6c993a];return _0x27f547;};'use strict';var util=require(_0x1684('0x0'));var BPromise=require(_0x1684('0x1'));var logger=require(_0x1684('0x2'))(_0x1684('0x3'));var _=require('lodash');var faxAccount=require(_0x1684('0x4'));function loggerCatch(_0x4015e0){return function(_0x287508){logger[_0x1684('0x5')](_0x4015e0,util[_0x1684('0x6')](_0x287508,{'showHidden':![],'depth':null}));};}exports[_0x1684('0x7')]=function(_0x4dec10,_0x3c013d){return BPromise['resolve']()[_0x1684('0x8')](faxAccount[_0x1684('0x7')](_0x4dec10,_0x3c013d))['catch'](loggerCatch(_0x1684('0x9')));}; \ No newline at end of file +var _0x9992=['[Notify]\x20','util','bluebird','preview','lodash','error','notify','resolve','then','catch'];(function(_0x2f8e2d,_0x4a80e7){var _0x599298=function(_0x18447a){while(--_0x18447a){_0x2f8e2d['push'](_0x2f8e2d['shift']());}};_0x599298(++_0x4a80e7);}(_0x9992,0x6f));var _0x2999=function(_0x133fe4,_0x1f473b){_0x133fe4=_0x133fe4-0x0;var _0x4c4017=_0x9992[_0x133fe4];return _0x4c4017;};'use strict';var util=require(_0x2999('0x0'));var BPromise=require(_0x2999('0x1'));var logger=require('../../../config/logger')(_0x2999('0x2'));var _=require(_0x2999('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x16426e){return function(_0x118471){logger[_0x2999('0x4')](_0x16426e,util['inspect'](_0x118471,{'showHidden':![],'depth':null}));};}exports[_0x2999('0x5')]=function(_0x58fc49,_0x3797ec){return BPromise[_0x2999('0x6')]()[_0x2999('0x7')](faxAccount[_0x2999('0x5')](_0x58fc49,_0x3797ec))[_0x2999('0x8')](loggerCatch(_0x2999('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index ccd934a..f114c9a 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 _0xbd40=['info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xbd40,0x13f));var _0x0bd4=function(_0x5a5d8f,_0x1c1da2){_0x5a5d8f=_0x5a5d8f-0x0;var _0x578667=_0xbd40[_0x5a5d8f];return _0x578667;};'use strict';var util=require(_0x0bd4('0x0'));var logger=require(_0x0bd4('0x1'))(_0x0bd4('0x2'));var BPromise=require(_0x0bd4('0x3'));var exec=require(_0x0bd4('0x4'))['exec'];exports['execute']=function(_0x366462){return new BPromise(function(_0xe616e0,_0x42c554){exec(_0x366462,function(_0x3c5440,_0x44be9c,_0x4652e9){logger[_0x0bd4('0x5')](_0x0bd4('0x6'),_0x44be9c);if(_0x3c5440){logger[_0x0bd4('0x5')]('Exec\x20gs',_0x0bd4('0x7'),util[_0x0bd4('0x8')](_0x3c5440,{'showHidden':![],'depth':null}),_0x44be9c,_0x4652e9);_0x42c554(_0x3c5440);}_0xe616e0(_0x44be9c);});});}; \ No newline at end of file +var _0x251e=['child_process','exec','execute','info','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x21cce9,_0x231204){var _0x503721=function(_0xd1c1e4){while(--_0xd1c1e4){_0x21cce9['push'](_0x21cce9['shift']());}};_0x503721(++_0x231204);}(_0x251e,0x18c));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xe251('0x0'));var logger=require(_0xe251('0x1'))(_0xe251('0x2'));var BPromise=require(_0xe251('0x3'));var exec=require(_0xe251('0x4'))[_0xe251('0x5')];exports[_0xe251('0x6')]=function(_0x11beb3){return new BPromise(function(_0x598fa1,_0x122436){exec(_0x11beb3,function(_0x56de64,_0x4b3f4b,_0x3d35d0){logger[_0xe251('0x7')]('Exec\x20gs',_0x4b3f4b);if(_0x56de64){logger[_0xe251('0x7')]('Exec\x20gs',_0xe251('0x8'),util[_0xe251('0x9')](_0x56de64,{'showHidden':![],'depth':null}),_0x4b3f4b,_0x3d35d0);_0x122436(_0x56de64);}_0x598fa1(_0x4b3f4b);});});}; \ 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 40250d7..5a7a08d 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 _0x12e2=['lodash','moment','../../../../config/logger','message','logger','info','addVariables','ecm','minrate','maxrate','modem','gateway','t38timeout','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','headerinfo','localstationid','util'];(function(_0x42fe9c,_0x8ea8df){var _0xe8737f=function(_0x14c22c){while(--_0x14c22c){_0x42fe9c['push'](_0x42fe9c['shift']());}};_0xe8737f(++_0x8ea8df);}(_0x12e2,0x18b));var _0x212e=function(_0x2508e6,_0x105bf0){_0x2508e6=_0x2508e6-0x0;var _0xde8808=_0x12e2[_0x2508e6];return _0xde8808;};'use strict';var util=require(_0x212e('0x0'));var _=require(_0x212e('0x1'));var moment=require(_0x212e('0x2'));var logger=require(_0x212e('0x3'))('fax');exports[_0x212e('0x4')]=function(_0x5f2ae1){return{'message':_0x5f2ae1};};exports[_0x212e('0x5')]=function(_0x5495f7,_0x54d2c6){logger[_0x212e('0x6')](_0x5495f7,util['inspect'](_0x54d2c6,{'showHidden':![],'depth':null}));};exports[_0x212e('0x7')]=function(_0x51ba15,_0x129352){var _0xe813a3={'XMF-ECM':_0x129352[_0x212e('0x8')],'XMF-HEADERINFO':_0x129352['headerinfo'],'XMF-MINRATE':_0x129352[_0x212e('0x9')],'XMF-MAXRATE':_0x129352[_0x212e('0xa')],'XMF-MODEM':util['format']('\x22%s\x22',_0x129352[_0x212e('0xb')]),'XMF-GATEWAY':_0x129352[_0x212e('0xc')],'XMF-FAXDETECT':_0x129352['faxdetect'],'XMF-T38TIMEOUT':_0x129352[_0x212e('0xd')],'XMF-LOCALSTATIONID':_0x129352['localstationid'],'XMF-PATH':_0x51ba15[_0x212e('0xe')]};return _0xe813a3;};exports[_0x212e('0xf')]=function(_0x35abee,_0x2792eb){return{'actionid':_0x35abee[_0x212e('0x10')],'action':'originate','channel':_0x35abee[_0x212e('0x11')],'Exten':_0x212e('0x12'),'Context':_0x212e('0x13'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x35abee[_0x212e('0x14')]?_0x35abee[_0x212e('0x14')]:'',_0x35abee[_0x212e('0x15')]),'variable':_0x2792eb,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x35abee[_0x212e('0x10')]};}; \ No newline at end of file +var _0xc8b4=['\x22%s\x22\x20<%s>','util','moment','../../../../config/logger','fax','message','info','inspect','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc8b4,0x187));var _0x4c8b=function(_0x39a1f6,_0x1e2874){_0x39a1f6=_0x39a1f6-0x0;var _0x22b6f9=_0xc8b4[_0x39a1f6];return _0x22b6f9;};'use strict';var util=require(_0x4c8b('0x0'));var _=require('lodash');var moment=require(_0x4c8b('0x1'));var logger=require(_0x4c8b('0x2'))(_0x4c8b('0x3'));exports[_0x4c8b('0x4')]=function(_0x308271){return{'message':_0x308271};};exports['logger']=function(_0x3235cb,_0x3b48b0){logger[_0x4c8b('0x5')](_0x3235cb,util[_0x4c8b('0x6')](_0x3b48b0,{'showHidden':![],'depth':null}));};exports[_0x4c8b('0x7')]=function(_0x4b1cfd,_0x30315d){var _0x2dd687={'XMF-ECM':_0x30315d[_0x4c8b('0x8')],'XMF-HEADERINFO':_0x30315d[_0x4c8b('0x9')],'XMF-MINRATE':_0x30315d[_0x4c8b('0xa')],'XMF-MAXRATE':_0x30315d['maxrate'],'XMF-MODEM':util[_0x4c8b('0xb')](_0x4c8b('0xc'),_0x30315d[_0x4c8b('0xd')]),'XMF-GATEWAY':_0x30315d[_0x4c8b('0xe')],'XMF-FAXDETECT':_0x30315d[_0x4c8b('0xf')],'XMF-T38TIMEOUT':_0x30315d[_0x4c8b('0x10')],'XMF-LOCALSTATIONID':_0x30315d[_0x4c8b('0x11')],'XMF-PATH':_0x4b1cfd[_0x4c8b('0x12')]};return _0x2dd687;};exports[_0x4c8b('0x13')]=function(_0x36cb79,_0x5eb84d){return{'actionid':_0x36cb79[_0x4c8b('0x14')],'action':_0x4c8b('0x15'),'channel':_0x36cb79[_0x4c8b('0x16')],'Exten':_0x4c8b('0x17'),'Context':_0x4c8b('0x18'),'Priority':'1','callerid':util['format'](_0x4c8b('0x19'),_0x36cb79[_0x4c8b('0x9')]?_0x36cb79[_0x4c8b('0x9')]:'',_0x36cb79[_0x4c8b('0x11')]),'variable':_0x5eb84d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x36cb79[_0x4c8b('0x14')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index c178eaa..09a147a 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 _0x8928=['getTriggers','getZendeskAccounts','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','listen','sync','log','bluebird','util','moment','./server','./trigger','./dialer','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8928,0x173));var _0x8892=function(_0x1483f1,_0x4242ea){_0x1483f1=_0x1483f1-0x0;var _0x2a2be9=_0x8928[_0x1483f1];return _0x2a2be9;};'use strict';var BPromise=require(_0x8892('0x0'));var util=require(_0x8892('0x1'));var moment=require(_0x8892('0x2'));var server=require(_0x8892('0x3'));var Realtime=require('./realtime');var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x8892('0x4'));var Dialer=require(_0x8892('0x5'));var Preview=require('./preview');var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0x8892('0x6'));var voiceQueueReport=require(_0x8892('0x7'));var voiceCallReport=require(_0x8892('0x8'));var trunk=require(_0x8892('0x9'));var trigger=require(_0x8892('0xa'));var template=require(_0x8892('0xb'));var cmHopperHistory=require(_0x8892('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x8892('0xd'));var faxAccount=require(_0x8892('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x8892('0xf'));var sugarcrm=require(_0x8892('0x10'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x8892('0x11'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x8892('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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8892('0x13')](_0x8892('0x14'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8892('0x13')](_0x8892('0x14'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8892('0x15')]()[_0x8892('0x16')](user[_0x8892('0x17')]())[_0x8892('0x16')](realtime[_0x8892('0x18')]())[_0x8892('0x16')](user[_0x8892('0x19')]())[_0x8892('0x16')](realtime['initTelephones']())[_0x8892('0x16')](trunk[_0x8892('0x1a')]())[_0x8892('0x16')](realtime[_0x8892('0x1b')]())[_0x8892('0x16')](voiceQueue['getVoiceQueues']())[_0x8892('0x16')](realtime['initVoiceQueues']())['then'](trigger[_0x8892('0x1c')]())['then'](realtime['initTriggers']())[_0x8892('0x16')](template['getTemplates']())[_0x8892('0x16')](realtime['initTemplates']())[_0x8892('0x16')](zendesk[_0x8892('0x1d')]())['then'](realtime[_0x8892('0x1e')]())[_0x8892('0x16')](salesforce['getSalesforceAccounts']())[_0x8892('0x16')](realtime['initSalesforceAccounts']())[_0x8892('0x16')](sugarcrm[_0x8892('0x1f')]())[_0x8892('0x16')](realtime[_0x8892('0x20')]())[_0x8892('0x16')](freshdesk[_0x8892('0x21')]())[_0x8892('0x16')](realtime['initFreshdeskAccounts']())[_0x8892('0x16')](desk[_0x8892('0x22')]())[_0x8892('0x16')](realtime[_0x8892('0x23')]())[_0x8892('0x16')](zoho[_0x8892('0x24')]())['then'](realtime[_0x8892('0x25')]())['then'](vtiger[_0x8892('0x26')]())[_0x8892('0x16')](realtime['initVtigerAccounts']())[_0x8892('0x16')](servicenow[_0x8892('0x27')]())[_0x8892('0x16')](realtime[_0x8892('0x28')]())[_0x8892('0x16')](dynamics365[_0x8892('0x29')]())[_0x8892('0x16')](realtime[_0x8892('0x2a')]())[_0x8892('0x16')](campaign[_0x8892('0x2b')]())[_0x8892('0x16')](realtime[_0x8892('0x2c')]())[_0x8892('0x16')](voiceExtension[_0x8892('0x2d')]())[_0x8892('0x16')](realtime[_0x8892('0x2e')]())['then'](faxAccount[_0x8892('0x2f')]())[_0x8892('0x16')](realtime[_0x8892('0x30')]())[_0x8892('0x16')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x8892('0x16')](voiceQueueReport['getVoiceQueueReports']())[_0x8892('0x16')](realtime[_0x8892('0x31')]())[_0x8892('0x16')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x8892('0x16')](realtime[_0x8892('0x32')]())[_0x8892('0x16')](cmHopperHistory[_0x8892('0x33')]())[_0x8892('0x16')](realtime[_0x8892('0x34')]())[_0x8892('0x16')](voiceCallReport['getVoiceCallReports']())[_0x8892('0x16')](realtime['initVoiceCallReports']())[_0x8892('0x16')](function(_0x1c5e0d){})[_0x8892('0x35')](function(_0x3534cd){console['log'](_0x3534cd);});}function main(){return server[_0x8892('0x36')](realtime,preview,fax)['then'](function(_0x450cb6){return initRealtime();})[_0x8892('0x16')](function(){return initParams();})[_0x8892('0x16')](function(){report[_0x8892('0x37')]();setInterval(initRealtime,0x1388);})[_0x8892('0x35')](function(_0xfef663){console[_0x8892('0x38')](_0xfef663);});}main(); \ No newline at end of file +var _0xb9e3=['./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/servicenow','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','moment'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0xb9e3,0x149));var _0x3b9e=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0xb9e3[_0x3dfeb9];return _0x412314;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require(_0x3b9e('0x0'));var server=require(_0x3b9e('0x1'));var Realtime=require(_0x3b9e('0x2'));var Report=require(_0x3b9e('0x3'));var Acw=require(_0x3b9e('0x4'));var Trigger=require('./trigger');var Dialer=require(_0x3b9e('0x5'));var Preview=require(_0x3b9e('0x6'));var Fax=require(_0x3b9e('0x7'));var user=require(_0x3b9e('0x8'));var voiceQueue=require(_0x3b9e('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x3b9e('0xa'));var trunk=require(_0x3b9e('0xb'));var trigger=require(_0x3b9e('0xc'));var template=require(_0x3b9e('0xd'));var cmHopperHistory=require(_0x3b9e('0xe'));var campaign=require(_0x3b9e('0xf'));var voiceExtension=require(_0x3b9e('0x10'));var faxAccount=require(_0x3b9e('0x11'));var zendesk=require(_0x3b9e('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x3b9e('0x13'));var freshdesk=require(_0x3b9e('0x14'));var desk=require(_0x3b9e('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var servicenow=require(_0x3b9e('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3b9e('0x17')](_0x3b9e('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3b9e('0x17')](_0x3b9e('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x3b9e('0x19')]()[_0x3b9e('0x1a')](user[_0x3b9e('0x1b')]())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x1c')]())[_0x3b9e('0x1a')](user['getTelephones']())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x1d')]())[_0x3b9e('0x1a')](trunk[_0x3b9e('0x1e')]())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x1f')]())['then'](voiceQueue['getVoiceQueues']())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x20')]())[_0x3b9e('0x1a')](trigger[_0x3b9e('0x21')]())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x22')]())[_0x3b9e('0x1a')](template[_0x3b9e('0x23')]())[_0x3b9e('0x1a')](realtime['initTemplates']())['then'](zendesk[_0x3b9e('0x24')]())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x25')]())[_0x3b9e('0x1a')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x3b9e('0x26')]())[_0x3b9e('0x1a')](sugarcrm[_0x3b9e('0x27')]())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x28')]())['then'](freshdesk[_0x3b9e('0x29')]())['then'](realtime[_0x3b9e('0x2a')]())[_0x3b9e('0x1a')](desk[_0x3b9e('0x2b')]())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x2c')]())[_0x3b9e('0x1a')](zoho['getZohoAccounts']())['then'](realtime[_0x3b9e('0x2d')]())['then'](vtiger[_0x3b9e('0x2e')]())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x2f')]())['then'](servicenow[_0x3b9e('0x30')]())['then'](realtime['initServicenowAccounts']())[_0x3b9e('0x1a')](dynamics365[_0x3b9e('0x31')]())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x32')]())['then'](campaign['getCampaigns']())['then'](realtime[_0x3b9e('0x33')]())['then'](voiceExtension[_0x3b9e('0x34')]())['then'](realtime[_0x3b9e('0x35')]())[_0x3b9e('0x1a')](faxAccount[_0x3b9e('0x36')]())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x37')]())[_0x3b9e('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x3b9e('0x19')]()[_0x3b9e('0x1a')](voiceQueueReport[_0x3b9e('0x38')]())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x39')]())[_0x3b9e('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x3a')]())[_0x3b9e('0x1a')](cmHopperHistory['getCampaignHopperHistory']())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x3b')]())[_0x3b9e('0x1a')](voiceCallReport[_0x3b9e('0x3c')]())[_0x3b9e('0x1a')](realtime[_0x3b9e('0x3d')]())[_0x3b9e('0x1a')](function(_0x24a2fa){})[_0x3b9e('0x3e')](function(_0x163b11){console[_0x3b9e('0x3f')](_0x163b11);});}function main(){return server[_0x3b9e('0x40')](realtime,preview,fax)[_0x3b9e('0x1a')](function(_0x59acd4){return initRealtime();})['then'](function(){return initParams();})[_0x3b9e('0x1a')](function(){report[_0x3b9e('0x41')]();setInterval(initRealtime,0x1388);})[_0x3b9e('0x3e')](function(_0x31b72b){console[_0x3b9e('0x3f')](_0x31b72b);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 4d0e3a0..0071c5b 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 _0x6b71=['voiceStatusTime','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','format','stringify','user:%s','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','stateTime','status','unknown','address','phone','interface','voiceStatus'];(function(_0x22f071,_0x188e15){var _0x554ae2=function(_0x5ce604){while(--_0x5ce604){_0x22f071['push'](_0x22f071['shift']());}};_0x554ae2(++_0x188e15);}(_0x6b71,0x1a6));var _0x16b7=function(_0x3fdab4,_0x41eca9){_0x3fdab4=_0x3fdab4-0x0;var _0x484516=_0x6b71[_0x3fdab4];return _0x484516;};'use strict';var _=require(_0x16b7('0x0'));var util=require(_0x16b7('0x1'));var moment=require(_0x16b7('0x2'));var md5=require(_0x16b7('0x3'));var Redis=require(_0x16b7('0x4'));var config=require(_0x16b7('0x5'));config[_0x16b7('0x6')]=_[_0x16b7('0x7')](config[_0x16b7('0x6')],{'host':_0x16b7('0x8'),'port':0x18eb});var io=require(_0x16b7('0x9'))(new Redis(config[_0x16b7('0x6')]));function Agent(_0x3b6116){this['id']=_0x3b6116['id']||0x0;this['name']=_0x3b6116[_0x16b7('0xa')]||'';this[_0x16b7('0xb')]=_0x3b6116[_0x16b7('0xb')]||'';this[_0x16b7('0xc')]=_0x3b6116['accountcode']||'';this[_0x16b7('0xd')]=_0x3b6116[_0x16b7('0xd')]||'';this[_0x16b7('0xe')]='unknown';this[_0x16b7('0xf')]=0x0;this[_0x16b7('0x10')]=_0x16b7('0x11');this[_0x16b7('0x12')]='';this[_0x16b7('0x13')]='';this['mobile']='';this[_0x16b7('0x14')]='';this['online']=_0x3b6116['online']||![];this[_0x16b7('0x15')]=_0x16b7('0x11');this[_0x16b7('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x16b7('0x17')]='';this[_0x16b7('0x18')]=![];this[_0x16b7('0x19')]=![];this[_0x16b7('0x3')]='';}Agent[_0x16b7('0x1a')][_0x16b7('0x1b')]=function(_0x446369){var _0x2c2c1b;if(_0x446369&&_0x446369['state']){_0x2c2c1b=_0x446369[_0x16b7('0xe')][_0x16b7('0x1c')]();switch(_0x2c2c1b){case _0x16b7('0x1d'):_0x2c2c1b=_0x16b7('0x1e');break;case'inuse':_0x2c2c1b=_0x16b7('0x1f');break;}}if(_0x2c2c1b&&this[_0x16b7('0x15')]!==_0x2c2c1b||_0x446369['statePause']){this[_0x16b7('0x16')]=_['toNumber'](moment()[_0x16b7('0x20')]('x'));}if(_0x2c2c1b){this['voiceStatus']=_0x2c2c1b;}var _0x4b6b14={'id':this['id'],'name':this[_0x16b7('0xa')],'email':this['email'],'accountcode':this[_0x16b7('0xc')],'fullname':this[_0x16b7('0xd')],'state':this['state'],'stateTime':this[_0x16b7('0xf')],'status':this[_0x16b7('0x10')],'address':this[_0x16b7('0x12')],'online':this['online'],'voiceStatus':this[_0x16b7('0x15')],'voiceStatusTime':this[_0x16b7('0x16')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x16b7('0x17')],'interface':this['interface'],'onhold':this[_0x16b7('0x18')]};var _0x46e2e6=md5(JSON[_0x16b7('0x21')](_0x4b6b14));if(this[_0x16b7('0x3')]!==_0x46e2e6){this['md5']=_0x46e2e6;io['to'](util[_0x16b7('0x20')](_0x16b7('0x22'),_0x4b6b14[_0x16b7('0xa')]))['emit'](_0x16b7('0x23'),_0x4b6b14);}};module[_0x16b7('0x24')]=Agent; \ No newline at end of file +var _0xa46d=['online','voiceStatusTime','voiceStatusQueue','onhold','local','prototype','state','not_inuse','idle','inuse','talking','voiceStatus','statePause','format','stateTime','voiceStatusCallerIdNumber','interface','stringify','user:%s','emit','user:save','exports','util','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','status','unknown','address','phone','mobile'];(function(_0x34bbd5,_0x3c810a){var _0x46244f=function(_0x5884b9){while(--_0x5884b9){_0x34bbd5['push'](_0x34bbd5['shift']());}};_0x46244f(++_0x3c810a);}(_0xa46d,0x1ce));var _0xda46=function(_0x5e1784,_0x53ab49){_0x5e1784=_0x5e1784-0x0;var _0x2dd18f=_0xa46d[_0x5e1784];return _0x2dd18f;};'use strict';var _=require('lodash');var util=require(_0xda46('0x0'));var moment=require(_0xda46('0x1'));var md5=require(_0xda46('0x2'));var Redis=require(_0xda46('0x3'));var config=require(_0xda46('0x4'));config['redis']=_[_0xda46('0x5')](config[_0xda46('0x6')],{'host':_0xda46('0x7'),'port':0x18eb});var io=require(_0xda46('0x8'))(new Redis(config[_0xda46('0x6')]));function Agent(_0x341ae9){this['id']=_0x341ae9['id']||0x0;this[_0xda46('0x9')]=_0x341ae9[_0xda46('0x9')]||'';this[_0xda46('0xa')]=_0x341ae9[_0xda46('0xa')]||'';this['accountcode']=_0x341ae9[_0xda46('0xb')]||'';this[_0xda46('0xc')]=_0x341ae9[_0xda46('0xc')]||'';this['state']='unknown';this['stateTime']=0x0;this[_0xda46('0xd')]=_0xda46('0xe');this[_0xda46('0xf')]='';this[_0xda46('0x10')]='';this[_0xda46('0x11')]='';this['interface']='';this['online']=_0x341ae9[_0xda46('0x12')]||![];this['voiceStatus']='unknown';this[_0xda46('0x13')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0xda46('0x14')]='';this[_0xda46('0x15')]=![];this[_0xda46('0x16')]=![];this[_0xda46('0x2')]='';}Agent[_0xda46('0x17')]['updateStatusRealtime']=function(_0x1ce979){var _0x1c9807;if(_0x1ce979&&_0x1ce979[_0xda46('0x18')]){_0x1c9807=_0x1ce979[_0xda46('0x18')]['toLowerCase']();switch(_0x1c9807){case _0xda46('0x19'):_0x1c9807=_0xda46('0x1a');break;case _0xda46('0x1b'):_0x1c9807=_0xda46('0x1c');break;}}if(_0x1c9807&&this[_0xda46('0x1d')]!==_0x1c9807||_0x1ce979[_0xda46('0x1e')]){this[_0xda46('0x13')]=_['toNumber'](moment()[_0xda46('0x1f')]('x'));}if(_0x1c9807){this['voiceStatus']=_0x1c9807;}var _0x18821b={'id':this['id'],'name':this[_0xda46('0x9')],'email':this[_0xda46('0xa')],'accountcode':this[_0xda46('0xb')],'fullname':this[_0xda46('0xc')],'state':this[_0xda46('0x18')],'stateTime':this[_0xda46('0x20')],'status':this['status'],'address':this[_0xda46('0xf')],'online':this[_0xda46('0x12')],'voiceStatus':this[_0xda46('0x1d')],'voiceStatusTime':this[_0xda46('0x13')],'voiceStatusCallerIdNumber':this[_0xda46('0x21')],'voiceStatusQueue':this[_0xda46('0x14')],'interface':this[_0xda46('0x22')],'onhold':this['onhold']};var _0x13e61b=md5(JSON[_0xda46('0x23')](_0x18821b));if(this[_0xda46('0x2')]!==_0x13e61b){this[_0xda46('0x2')]=_0x13e61b;io['to'](util[_0xda46('0x1f')](_0xda46('0x24'),_0x18821b['name']))[_0xda46('0x25')](_0xda46('0x26'),_0x18821b);}};module[_0xda46('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 03d95a3..9ba76fe 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 _0x39cb=['message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays'];(function(_0x1c8b47,_0x230d1e){var _0xe43fc2=function(_0x2daa76){while(--_0x2daa76){_0x1c8b47['push'](_0x1c8b47['shift']());}};_0xe43fc2(++_0x230d1e);}(_0x39cb,0x1bd));var _0xb39c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x39cb[_0x3ab51d];return _0x29a04e;};'use strict';function Campaign(_0x53ebb9){this['id']=_0x53ebb9['id']||0x0;this[_0xb39c('0x0')]=_0x53ebb9[_0xb39c('0x0')]||'';this['type']=_0x53ebb9[_0xb39c('0x1')]||_0xb39c('0x2');this['originated']=0x0;this[_0xb39c('0x3')]=0x0;this[_0xb39c('0x4')]=0x0;this[_0xb39c('0x5')]=0x0;this[_0xb39c('0x6')]='';this[_0xb39c('0x7')]=!![];this['active']=_0x53ebb9[_0xb39c('0x8')];this[_0xb39c('0x9')]=_0x53ebb9[_0xb39c('0x9')];this[_0xb39c('0xa')]=_0x53ebb9['dialTimezone']||null;this['dialGlobalInterval']=_0x53ebb9[_0xb39c('0xb')]?_0x53ebb9[_0xb39c('0xb')]:null;this[_0xb39c('0xc')]=_0x53ebb9[_0xb39c('0xc')];this['dialOriginateCallerIdNumber']=_0x53ebb9['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x53ebb9[_0xb39c('0xd')]||0x1e;this[_0xb39c('0xe')]=_0x53ebb9[_0xb39c('0xe')];this[_0xb39c('0xf')]=_0x53ebb9[_0xb39c('0xf')];this[_0xb39c('0x10')]=_0x53ebb9[_0xb39c('0x10')];this[_0xb39c('0x11')]=_0x53ebb9['dialBusyRetryFrequency'];this[_0xb39c('0x12')]=_0x53ebb9[_0xb39c('0x12')];this[_0xb39c('0x13')]=_0x53ebb9['dialNoAnswerRetryFrequency'];this[_0xb39c('0x14')]=_0x53ebb9[_0xb39c('0x14')];this[_0xb39c('0x15')]=_0x53ebb9[_0xb39c('0x15')]||_0xb39c('0x16');this[_0xb39c('0x17')]=_0x53ebb9[_0xb39c('0x17')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x53ebb9[_0xb39c('0x18')]||undefined;this[_0xb39c('0x19')]=_0x53ebb9[_0xb39c('0x19')]||undefined;this[_0xb39c('0x1a')]=_0x53ebb9[_0xb39c('0x1a')]?_0x53ebb9[_0xb39c('0x1a')]:undefined;this[_0xb39c('0x1b')]=_0x53ebb9[_0xb39c('0x1b')]?_0x53ebb9[_0xb39c('0x1b')]:undefined;this[_0xb39c('0x1c')]=_0x53ebb9['Interval']?_0x53ebb9[_0xb39c('0x1c')]:undefined;this[_0xb39c('0x1d')]=_0x53ebb9[_0xb39c('0x1d')]?_0x53ebb9[_0xb39c('0x1d')]:undefined;this['dialQueueProject']=_0x53ebb9[_0xb39c('0x1d')]?_0x53ebb9[_0xb39c('0x1d')]['name']:undefined;this[_0xb39c('0x1e')]=_0x53ebb9[_0xb39c('0x1e')]||![];this[_0xb39c('0x1f')]=_0x53ebb9['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x53ebb9[_0xb39c('0x20')];this[_0xb39c('0x21')]=_0x53ebb9[_0xb39c('0x21')];this['dialAMDTotalAnalysisTime']=_0x53ebb9[_0xb39c('0x22')];this[_0xb39c('0x23')]=_0x53ebb9[_0xb39c('0x23')];this[_0xb39c('0x24')]=_0x53ebb9[_0xb39c('0x24')];this['dialAMDMaximumNumberOfWords']=_0x53ebb9[_0xb39c('0x25')];this[_0xb39c('0x26')]=_0x53ebb9['dialAMDSilenceThreshold'];this[_0xb39c('0x27')]=_0x53ebb9[_0xb39c('0x27')];}module[_0xb39c('0x28')]=Campaign; \ No newline at end of file +var _0x235a=['Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x53a12f,_0x54ad64){var _0x45dd59=function(_0x436cc1){while(--_0x436cc1){_0x53a12f['push'](_0x53a12f['shift']());}};_0x45dd59(++_0x54ad64);}(_0x235a,0x1ef));var _0xa235=function(_0x488517,_0xa3e4c8){_0x488517=_0x488517-0x0;var _0x5d446c=_0x235a[_0x488517];return _0x5d446c;};'use strict';function Campaign(_0x1f3e74){this['id']=_0x1f3e74['id']||0x0;this[_0xa235('0x0')]=_0x1f3e74[_0xa235('0x0')]||'';this['type']=_0x1f3e74[_0xa235('0x1')]||'campaign';this[_0xa235('0x2')]=0x0;this[_0xa235('0x3')]=0x0;this[_0xa235('0x4')]=0x0;this[_0xa235('0x5')]=0x0;this[_0xa235('0x6')]='';this[_0xa235('0x7')]=!![];this[_0xa235('0x8')]=_0x1f3e74[_0xa235('0x8')];this['limitCalls']=_0x1f3e74[_0xa235('0x9')];this[_0xa235('0xa')]=_0x1f3e74[_0xa235('0xa')]||null;this[_0xa235('0xb')]=_0x1f3e74['dialGlobalInterval']?_0x1f3e74[_0xa235('0xb')]:null;this['dialOriginateCallerIdName']=_0x1f3e74['dialOriginateCallerIdName'];this[_0xa235('0xc')]=_0x1f3e74['dialOriginateCallerIdNumber'];this[_0xa235('0xd')]=_0x1f3e74['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x1f3e74['dialCongestionMaxRetry'];this[_0xa235('0xe')]=_0x1f3e74[_0xa235('0xe')];this[_0xa235('0xf')]=_0x1f3e74[_0xa235('0xf')];this['dialBusyRetryFrequency']=_0x1f3e74['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x1f3e74[_0xa235('0x10')];this[_0xa235('0x11')]=_0x1f3e74[_0xa235('0x11')];this[_0xa235('0x12')]=_0x1f3e74[_0xa235('0x12')];this[_0xa235('0x13')]=_0x1f3e74[_0xa235('0x13')]||_0xa235('0x14');this[_0xa235('0x15')]=_0x1f3e74['dialPrefix']||undefined;this[_0xa235('0x16')]=_0x1f3e74[_0xa235('0x16')]||undefined;this[_0xa235('0x17')]=_0x1f3e74[_0xa235('0x17')]||undefined;this[_0xa235('0x18')]=_0x1f3e74[_0xa235('0x18')]?_0x1f3e74['TrunkBackup']:undefined;this['Trunk']=_0x1f3e74[_0xa235('0x19')]?_0x1f3e74[_0xa235('0x19')]:undefined;this[_0xa235('0x1a')]=_0x1f3e74['Interval']?_0x1f3e74[_0xa235('0x1a')]:undefined;this[_0xa235('0x1b')]=_0x1f3e74[_0xa235('0x1b')]?_0x1f3e74[_0xa235('0x1b')]:undefined;this[_0xa235('0x1c')]=_0x1f3e74[_0xa235('0x1b')]?_0x1f3e74[_0xa235('0x1b')]['name']:undefined;this['dialAMDActive']=_0x1f3e74[_0xa235('0x1d')]||![];this[_0xa235('0x1e')]=_0x1f3e74[_0xa235('0x1e')];this[_0xa235('0x1f')]=_0x1f3e74[_0xa235('0x1f')];this[_0xa235('0x20')]=_0x1f3e74[_0xa235('0x20')];this[_0xa235('0x21')]=_0x1f3e74[_0xa235('0x21')];this[_0xa235('0x22')]=_0x1f3e74[_0xa235('0x22')];this[_0xa235('0x23')]=_0x1f3e74[_0xa235('0x23')];this[_0xa235('0x24')]=_0x1f3e74[_0xa235('0x24')];this[_0xa235('0x25')]=_0x1f3e74[_0xa235('0x25')];this[_0xa235('0x26')]=_0x1f3e74[_0xa235('0x26')];}module[_0xa235('0x27')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 0fd67d1..153ddfa 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 _0xa899=['monitors','transfercalleridnum','transferconnectedlinenum','starttime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','duration','billableseconds','type','disposition','monitor','monitorFilename','queue'];(function(_0x2b1203,_0xd88da){var _0x46a872=function(_0x1ef4ee){while(--_0x1ef4ee){_0x2b1203['push'](_0x2b1203['shift']());}};_0x46a872(++_0xd88da);}(_0xa899,0x155));var _0x9a89=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0xa899[_0x18546c];return _0x46ef43;};'use strict';function Channel(){this[_0x9a89('0x0')]=null;this[_0x9a89('0x1')]='';this[_0x9a89('0x2')]='';this['calleridnum']=0x0;this[_0x9a89('0x3')]='';this[_0x9a89('0x4')]=undefined;this[_0x9a89('0x5')]=undefined;this[_0x9a89('0x6')]=0x0;this[_0x9a89('0x7')]='';this[_0x9a89('0x8')]=0x0;this[_0x9a89('0x9')]=0x0;this[_0x9a89('0xa')]=0x0;this[_0x9a89('0xb')]=![];this[_0x9a89('0xc')]=null;this[_0x9a89('0xd')]=null;this[_0x9a89('0xe')]=![];this[_0x9a89('0xf')]=![];this['lastapplication']='';this['lastdata']='';this[_0x9a89('0x10')]=0x0;this[_0x9a89('0x11')]=0x0;this['holdtime']=0x0;this[_0x9a89('0x12')]=null;this['tag']=null;this[_0x9a89('0x13')]=null;this[_0x9a89('0x14')]=![];this[_0x9a89('0x15')]=null;this[_0x9a89('0x16')]=null;this[_0x9a89('0x17')]=[];this[_0x9a89('0x18')]=undefined;this[_0x9a89('0x19')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file +var _0xba38=['context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime','tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','channel','destinationchannel','calleridnum','connectedlinenum','accountcode'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xba38,0x190));var _0x8ba3=function(_0x444664,_0x6270e5){_0x444664=_0x444664-0x0;var _0xf7bbca=_0xba38[_0x444664];return _0xf7bbca;};'use strict';function Channel(){this['starttime']=null;this[_0x8ba3('0x0')]='';this[_0x8ba3('0x1')]='';this[_0x8ba3('0x2')]=0x0;this['calleridname']='';this[_0x8ba3('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x8ba3('0x4')]=0x0;this[_0x8ba3('0x5')]='';this[_0x8ba3('0x6')]=0x0;this[_0x8ba3('0x7')]=0x0;this[_0x8ba3('0x8')]=0x0;this[_0x8ba3('0x9')]=![];this[_0x8ba3('0xa')]=null;this[_0x8ba3('0xb')]=null;this[_0x8ba3('0xc')]=![];this[_0x8ba3('0xd')]=![];this[_0x8ba3('0xe')]='';this[_0x8ba3('0xf')]='';this['duration']=0x0;this[_0x8ba3('0x10')]=0x0;this[_0x8ba3('0x11')]=0x0;this['type']=null;this[_0x8ba3('0x12')]=null;this['disposition']=null;this[_0x8ba3('0x13')]=![];this[_0x8ba3('0x14')]=null;this[_0x8ba3('0x15')]=null;this[_0x8ba3('0x16')]=[];this[_0x8ba3('0x17')]=undefined;this[_0x8ba3('0x18')]=undefined;this[_0x8ba3('0x19')]=0x0;}module[_0x8ba3('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 75d593b..0ecd2cd 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 _0xa20a=['token','tokenSecret','type','serverUrl','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x23d47d,_0x5f470c){var _0x1c6e89=function(_0x545acb){while(--_0x545acb){_0x23d47d['push'](_0x23d47d['shift']());}};_0x1c6e89(++_0x5f470c);}(_0xa20a,0x1f1));var _0xaa20=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xa20a[_0x45d55e];return _0x29812a;};'use strict';function DeskAccount(_0x330771){this['id']=_0x330771['id']||0x0;this[_0xaa20('0x0')]=_0x330771[_0xaa20('0x0')]||'';this[_0xaa20('0x1')]=_0x330771['username']||'';this[_0xaa20('0x2')]=_0x330771[_0xaa20('0x2')]||'';this['authType']=_0x330771[_0xaa20('0x3')]||'';this['password']=_0x330771[_0xaa20('0x4')]||'';this['consumerKey']=_0x330771[_0xaa20('0x5')]||'';this['consumerSecret']=_0x330771[_0xaa20('0x6')]||'';this[_0xaa20('0x7')]=_0x330771[_0xaa20('0x7')]||'';this['tokenSecret']=_0x330771[_0xaa20('0x8')]||'';this[_0xaa20('0x9')]=_0x330771['type']||'';this[_0xaa20('0xa')]=_0x330771[_0xaa20('0xa')]||'';this['Configurations']=_0x330771['Configurations']||{};}module[_0xaa20('0xb')]=DeskAccount; \ No newline at end of file +var _0xd220=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x1bedd1,_0x2ceda3){var _0x31ea73=function(_0x4db185){while(--_0x4db185){_0x1bedd1['push'](_0x1bedd1['shift']());}};_0x31ea73(++_0x2ceda3);}(_0xd220,0x13a));var _0x0d22=function(_0x43ab6e,_0x2dc786){_0x43ab6e=_0x43ab6e-0x0;var _0x409371=_0xd220[_0x43ab6e];return _0x409371;};'use strict';function DeskAccount(_0x2a78ca){this['id']=_0x2a78ca['id']||0x0;this[_0x0d22('0x0')]=_0x2a78ca[_0x0d22('0x0')]||'';this[_0x0d22('0x1')]=_0x2a78ca['username']||'';this[_0x0d22('0x2')]=_0x2a78ca['remoteUri']||'';this[_0x0d22('0x3')]=_0x2a78ca[_0x0d22('0x3')]||'';this['password']=_0x2a78ca[_0x0d22('0x4')]||'';this[_0x0d22('0x5')]=_0x2a78ca[_0x0d22('0x5')]||'';this['consumerSecret']=_0x2a78ca[_0x0d22('0x6')]||'';this[_0x0d22('0x7')]=_0x2a78ca[_0x0d22('0x7')]||'';this[_0x0d22('0x8')]=_0x2a78ca[_0x0d22('0x8')]||'';this['type']=_0x2a78ca[_0x0d22('0x9')]||'';this[_0x0d22('0xa')]=_0x2a78ca[_0x0d22('0xa')]||'';this[_0x0d22('0xb')]=_0x2a78ca['Configurations']||{};}module[_0x0d22('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index cfd9368..7546933 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 _0x1033=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x10a9c6,_0x3ad310){var _0x2a430d=function(_0x55d735){while(--_0x55d735){_0x10a9c6['push'](_0x10a9c6['shift']());}};_0x2a430d(++_0x3ad310);}(_0x1033,0xce));var _0x3103=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x1033[_0x50a0c2];return _0x5ebadd;};'use strict';function Dynamics365Account(_0x297a37){this['id']=_0x297a37['id']||0x0;this[_0x3103('0x0')]=_0x297a37[_0x3103('0x0')]||'';this[_0x3103('0x1')]=_0x297a37[_0x3103('0x1')]||'';this[_0x3103('0x2')]=_0x297a37[_0x3103('0x2')]||'';this['remoteUri']=_0x297a37[_0x3103('0x3')]||'';this[_0x3103('0x4')]=_0x297a37['tenantId']||'';this['clientId']=_0x297a37[_0x3103('0x5')]||'';this['clientSecret']=_0x297a37[_0x3103('0x6')]||{};this[_0x3103('0x7')]=_0x297a37['serverUrl']||'';this[_0x3103('0x8')]=_0x297a37[_0x3103('0x8')]||{};}module[_0x3103('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x9011=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name','username'];(function(_0xeb679f,_0x2ff89d){var _0x1928d4=function(_0x55af35){while(--_0x55af35){_0xeb679f['push'](_0xeb679f['shift']());}};_0x1928d4(++_0x2ff89d);}(_0x9011,0x1d2));var _0x1901=function(_0x3d4ea6,_0x3ae422){_0x3d4ea6=_0x3d4ea6-0x0;var _0x1787b2=_0x9011[_0x3d4ea6];return _0x1787b2;};'use strict';function Dynamics365Account(_0x5a4a3c){this['id']=_0x5a4a3c['id']||0x0;this[_0x1901('0x0')]=_0x5a4a3c['name']||'';this[_0x1901('0x1')]=_0x5a4a3c[_0x1901('0x1')]||'';this['password']=_0x5a4a3c[_0x1901('0x2')]||'';this[_0x1901('0x3')]=_0x5a4a3c[_0x1901('0x3')]||'';this[_0x1901('0x4')]=_0x5a4a3c[_0x1901('0x4')]||'';this['clientId']=_0x5a4a3c[_0x1901('0x5')]||'';this['clientSecret']=_0x5a4a3c[_0x1901('0x6')]||{};this[_0x1901('0x7')]=_0x5a4a3c[_0x1901('0x7')]||'';this[_0x1901('0x8')]=_0x5a4a3c[_0x1901('0x8')]||{};}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 b3f456f..8d9c5e4 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 _0x91a7=['faxdetect','t38timeout','tech','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway'];(function(_0x272ef3,_0x56e43a){var _0x813bcd=function(_0x251aed){while(--_0x251aed){_0x272ef3['push'](_0x272ef3['shift']());}};_0x813bcd(++_0x56e43a);}(_0x91a7,0xe7));var _0x791a=function(_0x550aed,_0x1ba6cb){_0x550aed=_0x550aed-0x0;var _0x1c43a5=_0x91a7[_0x550aed];return _0x1c43a5;};'use strict';function FaxAccount(_0x27c92e){this['id']=_0x27c92e['id']||0x0;this[_0x791a('0x0')]=_0x27c92e[_0x791a('0x0')]||'';this[_0x791a('0x1')]=_0x27c92e['description'];this[_0x791a('0x2')]=_0x27c92e['ecm'];this[_0x791a('0x3')]=_0x27c92e['headerinfo'];this['localstationid']=_0x27c92e[_0x791a('0x4')];this[_0x791a('0x5')]=_0x27c92e['minrate']||0x960;this[_0x791a('0x6')]=_0x27c92e['maxrate']||0x3840;this[_0x791a('0x7')]=_0x27c92e[_0x791a('0x7')]||'v17,v27,v29';this[_0x791a('0x8')]=_0x27c92e[_0x791a('0x8')]||'no';this[_0x791a('0x9')]=_0x27c92e[_0x791a('0x9')]||'no';this[_0x791a('0xa')]=_0x27c92e['t38timeout']||0x1388;this[_0x791a('0xb')]=_0x27c92e[_0x791a('0xb')]||'SIP';this[_0x791a('0xc')]=_0x27c92e[_0x791a('0xc')]?_0x27c92e[_0x791a('0xc')]:undefined;this[_0x791a('0xd')]=_0x27c92e[_0x791a('0xd')];this[_0x791a('0xe')]=_0x27c92e['key'];}module['exports']=FaxAccount; \ No newline at end of file +var _0x0713=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';function FaxAccount(_0x4bf247){this['id']=_0x4bf247['id']||0x0;this['name']=_0x4bf247[_0x3071('0x0')]||'';this[_0x3071('0x1')]=_0x4bf247[_0x3071('0x1')];this[_0x3071('0x2')]=_0x4bf247[_0x3071('0x2')];this['headerinfo']=_0x4bf247[_0x3071('0x3')];this[_0x3071('0x4')]=_0x4bf247[_0x3071('0x4')];this[_0x3071('0x5')]=_0x4bf247[_0x3071('0x5')]||0x960;this[_0x3071('0x6')]=_0x4bf247[_0x3071('0x6')]||0x3840;this[_0x3071('0x7')]=_0x4bf247[_0x3071('0x7')]||_0x3071('0x8');this[_0x3071('0x9')]=_0x4bf247[_0x3071('0x9')]||'no';this[_0x3071('0xa')]=_0x4bf247['faxdetect']||'no';this[_0x3071('0xb')]=_0x4bf247[_0x3071('0xb')]||0x1388;this[_0x3071('0xc')]=_0x4bf247[_0x3071('0xc')]||_0x3071('0xd');this['Trunk']=_0x4bf247[_0x3071('0xe')]?_0x4bf247[_0x3071('0xe')]:undefined;this[_0x3071('0xf')]=_0x4bf247[_0x3071('0xf')];this[_0x3071('0x10')]=_0x4bf247['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 92508e1..889bdc2 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 _0xad04=['username','apiKey','token','serverUrl','Configurations','exports','name'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xad04,0x1b8));var _0x4ad0=function(_0x4275d1,_0x25b51b){_0x4275d1=_0x4275d1-0x0;var _0x20459d=_0xad04[_0x4275d1];return _0x20459d;};'use strict';function FreshdeskAccount(_0x722b9c){this['id']=_0x722b9c['id']||0x0;this[_0x4ad0('0x0')]=_0x722b9c[_0x4ad0('0x0')]||'';this[_0x4ad0('0x1')]=_0x722b9c[_0x4ad0('0x1')]||'';this[_0x4ad0('0x2')]=_0x722b9c[_0x4ad0('0x3')]||'';this['remoteUri']=_0x722b9c['remoteUri']||'';this[_0x4ad0('0x4')]=_0x722b9c[_0x4ad0('0x4')]||'';this[_0x4ad0('0x5')]=_0x722b9c[_0x4ad0('0x5')]||{};}module[_0x4ad0('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xe886=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x2917c2,_0x5732d9){var _0x2e7448=function(_0xf2778d){while(--_0xf2778d){_0x2917c2['push'](_0x2917c2['shift']());}};_0x2e7448(++_0x5732d9);}(_0xe886,0x19a));var _0x6e88=function(_0x3cfd57,_0x537cf5){_0x3cfd57=_0x3cfd57-0x0;var _0x527d26=_0xe886[_0x3cfd57];return _0x527d26;};'use strict';function FreshdeskAccount(_0x536c39){this['id']=_0x536c39['id']||0x0;this['name']=_0x536c39[_0x6e88('0x0')]||'';this[_0x6e88('0x1')]=_0x536c39[_0x6e88('0x1')]||'';this[_0x6e88('0x2')]=_0x536c39[_0x6e88('0x3')]||'';this['remoteUri']=_0x536c39[_0x6e88('0x4')]||'';this[_0x6e88('0x5')]=_0x536c39[_0x6e88('0x5')]||'';this[_0x6e88('0x6')]=_0x536c39[_0x6e88('0x6')]||{};}module[_0x6e88('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 17b8c53..1306496 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 _0xa1e0=['lastAssignedTo','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned'];(function(_0x3aa014,_0x57fdd3){var _0x76888a=function(_0x16f10c){while(--_0x16f10c){_0x3aa014['push'](_0x3aa014['shift']());}};_0x76888a(++_0x57fdd3);}(_0xa1e0,0xb2));var _0x0a1e=function(_0xc50f6e,_0x205d47){_0xc50f6e=_0xc50f6e-0x0;var _0xef9796=_0xa1e0[_0xc50f6e];return _0xef9796;};'use strict';function QueueReport(){this[_0x0a1e('0x0')]=_0x0a1e('0x1');this[_0x0a1e('0x2')]='';this[_0x0a1e('0x3')]='';this[_0x0a1e('0x4')]='';this['queue']='';this[_0x0a1e('0x5')]=null;this[_0x0a1e('0x6')]=null;this[_0x0a1e('0x7')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0x0a1e('0x8')]=null;this[_0x0a1e('0x9')]=![];this[_0x0a1e('0xa')]=null;this[_0x0a1e('0xb')]=![];this[_0x0a1e('0xc')]=null;this[_0x0a1e('0xd')]=0x1;this[_0x0a1e('0xe')]='';this[_0x0a1e('0xf')]='';this[_0x0a1e('0x10')]='';this[_0x0a1e('0x11')]='';this['context']='';this[_0x0a1e('0x12')]='';this[_0x0a1e('0x13')]='';this[_0x0a1e('0x14')]=0x0;this[_0x0a1e('0x15')]=![];this[_0x0a1e('0x16')]='';this['mohtime']=0x0;this[_0x0a1e('0x17')]={};}module[_0x0a1e('0x18')]=QueueReport; \ No newline at end of file +var _0xdce1=['queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','exten','priority','holdtime','lastAssignedTo','mohtime','variables','calleridname','queuecallerjoinAt','count'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xdce1,0x1d8));var _0x1dce=function(_0x6cf030,_0x16b281){_0x6cf030=_0x6cf030-0x0;var _0x4a84f6=_0xdce1[_0x6cf030];return _0x4a84f6;};'use strict';function QueueReport(){this['type']='inbound';this['uniqueid']='';this['calleridnum']='';this[_0x1dce('0x0')]='';this['queue']='';this[_0x1dce('0x1')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0x1dce('0x2')]=0x1;this[_0x1dce('0x3')]=![];this[_0x1dce('0x4')]=null;this[_0x1dce('0x5')]=![];this[_0x1dce('0x6')]=null;this[_0x1dce('0x7')]=![];this[_0x1dce('0x8')]=null;this[_0x1dce('0x9')]=0x1;this[_0x1dce('0xa')]='';this[_0x1dce('0xb')]='';this[_0x1dce('0xc')]='';this['accountcode']='';this['context']='';this[_0x1dce('0xd')]='';this[_0x1dce('0xe')]='';this[_0x1dce('0xf')]=0x0;this['assigned']=![];this[_0x1dce('0x10')]='';this[_0x1dce('0x11')]=0x0;this[_0x1dce('0x12')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 5e8f7a5..5d96573 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 _0x878e=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x29f9ec,_0x40e567){var _0x44d184=function(_0x1f152f){while(--_0x1f152f){_0x29f9ec['push'](_0x29f9ec['shift']());}};_0x44d184(++_0x40e567);}(_0x878e,0x117));var _0xe878=function(_0x3c8a36,_0x20ce65){_0x3c8a36=_0x3c8a36-0x0;var _0xf59d5b=_0x878e[_0x3c8a36];return _0xf59d5b;};'use strict';function SalesforceAccount(_0x111f14){this['id']=_0x111f14['id']||0x0;this[_0xe878('0x0')]=_0x111f14[_0xe878('0x0')]||'';this[_0xe878('0x1')]=_0x111f14[_0xe878('0x1')]||'';this['remoteUri']=_0x111f14[_0xe878('0x2')]||'';this[_0xe878('0x3')]=_0x111f14[_0xe878('0x3')]||'';this[_0xe878('0x4')]=_0x111f14[_0xe878('0x4')]||'';this[_0xe878('0x5')]=_0x111f14[_0xe878('0x5')]||'';this[_0xe878('0x6')]=_0x111f14[_0xe878('0x6')]||'';this['type']=_0x111f14[_0xe878('0x7')]||_0xe878('0x8');this[_0xe878('0x9')]=_0x111f14[_0xe878('0x9')]||'';this[_0xe878('0xa')]=_0x111f14[_0xe878('0xa')]||{};}module[_0xe878('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xa70d=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x4f48d5,_0x3714f2){var _0x72f210=function(_0x95328f){while(--_0x95328f){_0x4f48d5['push'](_0x4f48d5['shift']());}};_0x72f210(++_0x3714f2);}(_0xa70d,0x1a0));var _0xda70=function(_0x277390,_0xf5b9b8){_0x277390=_0x277390-0x0;var _0x4baf05=_0xa70d[_0x277390];return _0x4baf05;};'use strict';function SalesforceAccount(_0x198161){this['id']=_0x198161['id']||0x0;this[_0xda70('0x0')]=_0x198161[_0xda70('0x0')]||'';this[_0xda70('0x1')]=_0x198161[_0xda70('0x1')]||'';this['remoteUri']=_0x198161['remoteUri']||'';this[_0xda70('0x2')]=_0x198161['password']||'';this[_0xda70('0x3')]=_0x198161['clientId']||'';this['clientSecret']=_0x198161[_0xda70('0x4')]||'';this[_0xda70('0x5')]=_0x198161[_0xda70('0x5')]||'';this[_0xda70('0x6')]=_0x198161['type']||_0xda70('0x7');this[_0xda70('0x8')]=_0x198161[_0xda70('0x8')]||'';this['Configurations']=_0x198161[_0xda70('0x9')]||{};}module[_0xda70('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index cd5444d..8fa1ef9 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 _0x3140=['serverUrl','Configurations','name','password','remoteUri'];(function(_0x3933af,_0x2085c2){var _0x2d2391=function(_0x58a74c){while(--_0x58a74c){_0x3933af['push'](_0x3933af['shift']());}};_0x2d2391(++_0x2085c2);}(_0x3140,0xca));var _0x0314=function(_0x584b3f,_0x3b21a5){_0x584b3f=_0x584b3f-0x0;var _0x359088=_0x3140[_0x584b3f];return _0x359088;};'use strict';function ServicenowAccount(_0x4a2bcc){this['id']=_0x4a2bcc['id']||0x0;this[_0x0314('0x0')]=_0x4a2bcc['name']||'';this['username']=_0x4a2bcc['username']||'';this[_0x0314('0x1')]=_0x4a2bcc[_0x0314('0x1')]||'';this['remoteUri']=_0x4a2bcc[_0x0314('0x2')]||'';this['serverUrl']=_0x4a2bcc[_0x0314('0x3')]||'';this[_0x0314('0x4')]=_0x4a2bcc[_0x0314('0x4')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xe50b=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x27470c,_0x2f77ff){var _0x936be7=function(_0x1e12a0){while(--_0x1e12a0){_0x27470c['push'](_0x27470c['shift']());}};_0x936be7(++_0x2f77ff);}(_0xe50b,0x18d));var _0xbe50=function(_0x818dad,_0x27ed3f){_0x818dad=_0x818dad-0x0;var _0x2d0548=_0xe50b[_0x818dad];return _0x2d0548;};'use strict';function ServicenowAccount(_0x3667c4){this['id']=_0x3667c4['id']||0x0;this[_0xbe50('0x0')]=_0x3667c4[_0xbe50('0x0')]||'';this['username']=_0x3667c4[_0xbe50('0x1')]||'';this[_0xbe50('0x2')]=_0x3667c4[_0xbe50('0x2')]||'';this[_0xbe50('0x3')]=_0x3667c4[_0xbe50('0x3')]||'';this[_0xbe50('0x4')]=_0x3667c4['serverUrl']||'';this[_0xbe50('0x5')]=_0x3667c4[_0xbe50('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 a77ba8f..146a0bb 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 _0xeb3a=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0xd83f42,_0x54f7c2){var _0x9419d7=function(_0x20b9b8){while(--_0x20b9b8){_0xd83f42['push'](_0xd83f42['shift']());}};_0x9419d7(++_0x54f7c2);}(_0xeb3a,0xe0));var _0xaeb3=function(_0x4d1546,_0x4c593a){_0x4d1546=_0x4d1546-0x0;var _0x4b34a4=_0xeb3a[_0x4d1546];return _0x4b34a4;};'use strict';function SugarcrmAccount(_0x2abde4){this['id']=_0x2abde4['id']||0x0;this[_0xaeb3('0x0')]=_0x2abde4[_0xaeb3('0x0')]||'';this['username']=_0x2abde4[_0xaeb3('0x1')]||'';this[_0xaeb3('0x2')]=_0x2abde4[_0xaeb3('0x2')]||'';this[_0xaeb3('0x3')]=_0x2abde4[_0xaeb3('0x3')]||'';this[_0xaeb3('0x4')]=_0x2abde4[_0xaeb3('0x4')]||'';this['Configurations']=_0x2abde4[_0xaeb3('0x5')]||{};}module[_0xaeb3('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x0e3e=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x20c53b,_0x2b7e34){var _0x583ae9=function(_0x4391ff){while(--_0x4391ff){_0x20c53b['push'](_0x20c53b['shift']());}};_0x583ae9(++_0x2b7e34);}(_0x0e3e,0x1ed));var _0xe0e3=function(_0xcac47,_0x204f9f){_0xcac47=_0xcac47-0x0;var _0x2bf2fd=_0x0e3e[_0xcac47];return _0x2bf2fd;};'use strict';function SugarcrmAccount(_0xdc0d93){this['id']=_0xdc0d93['id']||0x0;this['name']=_0xdc0d93[_0xe0e3('0x0')]||'';this[_0xe0e3('0x1')]=_0xdc0d93[_0xe0e3('0x1')]||'';this[_0xe0e3('0x2')]=_0xdc0d93[_0xe0e3('0x2')]||'';this[_0xe0e3('0x3')]=_0xdc0d93[_0xe0e3('0x3')]||'';this[_0xe0e3('0x4')]=_0xdc0d93['serverUrl']||'';this[_0xe0e3('0x5')]=_0xdc0d93[_0xe0e3('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index b703f73..b8c78a7 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 _0xc848=['accountcode','state','stateTime','status','unknown','address','exports','name'];(function(_0x290f07,_0x1456f7){var _0x31c7f7=function(_0x2ff907){while(--_0x2ff907){_0x290f07['push'](_0x290f07['shift']());}};_0x31c7f7(++_0x1456f7);}(_0xc848,0xcf));var _0x8c84=function(_0x51e855,_0x4c93b9){_0x51e855=_0x51e855-0x0;var _0x4c38ec=_0xc848[_0x51e855];return _0x4c38ec;};'use strict';function Telephone(_0x33e72a){this['id']=_0x33e72a['id']||0x0;this['name']=_0x33e72a[_0x8c84('0x0')]||'';this[_0x8c84('0x1')]=_0x33e72a['accountcode']||'';this[_0x8c84('0x2')]='unknown';this[_0x8c84('0x3')]=0x0;this[_0x8c84('0x4')]=_0x8c84('0x5');this[_0x8c84('0x6')]='';}module[_0x8c84('0x7')]=Telephone; \ No newline at end of file +var _0x86ec=['accountcode','state','unknown','stateTime','status','address','name'];(function(_0xf8c0ed,_0x53dd46){var _0x47e807=function(_0x9d894){while(--_0x9d894){_0xf8c0ed['push'](_0xf8c0ed['shift']());}};_0x47e807(++_0x53dd46);}(_0x86ec,0x68));var _0xc86e=function(_0x522653,_0x5e1709){_0x522653=_0x522653-0x0;var _0x174ed9=_0x86ec[_0x522653];return _0x174ed9;};'use strict';function Telephone(_0x2fd147){this['id']=_0x2fd147['id']||0x0;this[_0xc86e('0x0')]=_0x2fd147[_0xc86e('0x0')]||'';this[_0xc86e('0x1')]=_0x2fd147[_0xc86e('0x1')]||'';this[_0xc86e('0x2')]=_0xc86e('0x3');this[_0xc86e('0x4')]=0x0;this[_0xc86e('0x5')]=_0xc86e('0x3');this[_0xc86e('0x6')]='';}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 8e17321..60feeb2 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 _0x5c12=['html','exports','name'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x5c12,0x188));var _0x25c1=function(_0x3181cc,_0x28447f){_0x3181cc=_0x3181cc-0x0;var _0x547a4a=_0x5c12[_0x3181cc];return _0x547a4a;};'use strict';function template(_0x2cb5ca){this['id']=_0x2cb5ca['id']||0x0;this[_0x25c1('0x0')]=_0x2cb5ca[_0x25c1('0x0')]||'';this['html']=_0x2cb5ca[_0x25c1('0x1')]||'';}module[_0x25c1('0x2')]=template; \ No newline at end of file +var _0x00bb=['name','html'];(function(_0x253476,_0x16b31a){var _0x134271=function(_0x20623c){while(--_0x20623c){_0x253476['push'](_0x253476['shift']());}};_0x134271(++_0x16b31a);}(_0x00bb,0x1d8));var _0xb00b=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x00bb[_0xae7c2f];return _0x5d7001;};'use strict';function template(_0x4b870b){this['id']=_0x4b870b['id']||0x0;this[_0xb00b('0x0')]=_0x4b870b[_0xb00b('0x0')]||'';this['html']=_0x4b870b[_0xb00b('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 677a595..8d1d0f2 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 _0x662b=['AnyConditions','Actions','exports','name','channel','voice','status','AllConditions'];(function(_0x2667c3,_0x5cbc3c){var _0x52274d=function(_0x2a247d){while(--_0x2a247d){_0x2667c3['push'](_0x2667c3['shift']());}};_0x52274d(++_0x5cbc3c);}(_0x662b,0xbb));var _0xb662=function(_0x15ba23,_0x37026b){_0x15ba23=_0x15ba23-0x0;var _0x1c7671=_0x662b[_0x15ba23];return _0x1c7671;};'use strict';function Trigger(_0x2aba79){this['id']=_0x2aba79['id']||0x0;this[_0xb662('0x0')]=_0x2aba79[_0xb662('0x0')]||'';this[_0xb662('0x1')]=_0x2aba79[_0xb662('0x1')]||_0xb662('0x2');this[_0xb662('0x3')]=_0x2aba79[_0xb662('0x3')]||![];this[_0xb662('0x4')]=_0x2aba79[_0xb662('0x4')]||[];this[_0xb662('0x5')]=_0x2aba79[_0xb662('0x5')]||[];this[_0xb662('0x6')]=_0x2aba79[_0xb662('0x6')]||[];}module[_0xb662('0x7')]=Trigger; \ No newline at end of file +var _0x327a=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x314978,_0x3ecd68){var _0x5741b5=function(_0x3bbdcd){while(--_0x3bbdcd){_0x314978['push'](_0x314978['shift']());}};_0x5741b5(++_0x3ecd68);}(_0x327a,0x130));var _0xa327=function(_0x12b8d2,_0xaffb16){_0x12b8d2=_0x12b8d2-0x0;var _0x59dae7=_0x327a[_0x12b8d2];return _0x59dae7;};'use strict';function Trigger(_0x237527){this['id']=_0x237527['id']||0x0;this[_0xa327('0x0')]=_0x237527[_0xa327('0x0')]||'';this[_0xa327('0x1')]=_0x237527['channel']||_0xa327('0x2');this['status']=_0x237527[_0xa327('0x3')]||![];this[_0xa327('0x4')]=_0x237527[_0xa327('0x4')]||[];this['AnyConditions']=_0x237527[_0xa327('0x5')]||[];this[_0xa327('0x6')]=_0x237527['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index f595a25..eef9292 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 _0x1a0c=['port','domain','domainport','refresh','stateRegistry','registrationtime','address','exports','active','name','state','stateTime','status','registry','indexOf','split','host'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x1a0c,0xb2));var _0xc1a0=function(_0x171ecf,_0x55e178){_0x171ecf=_0x171ecf-0x0;var _0x30ddcc=_0x1a0c[_0x171ecf];return _0x30ddcc;};'use strict';function Trunk(_0x32b28e){this['id']=_0x32b28e['id']||0x0;this['active']=_0x32b28e[_0xc1a0('0x0')]||![];this[_0xc1a0('0x1')]=_0x32b28e[_0xc1a0('0x1')]||'';this[_0xc1a0('0x2')]='unknown';this[_0xc1a0('0x3')]=0x0;this[_0xc1a0('0x4')]='unknown';this[_0xc1a0('0x5')]=_0x32b28e[_0xc1a0('0x5')]&&_0x32b28e[_0xc1a0('0x5')][_0xc1a0('0x6')](':')?_0x32b28e[_0xc1a0('0x5')][_0xc1a0('0x7')](':')[0x0]:'';this[_0xc1a0('0x8')]='';this[_0xc1a0('0x9')]='';this[_0xc1a0('0xa')]='';this[_0xc1a0('0xb')]='';this[_0xc1a0('0xc')]='';this[_0xc1a0('0xd')]='unknown';this[_0xc1a0('0xe')]='';this[_0xc1a0('0xf')]='';}module[_0xc1a0('0x10')]=Trunk; \ No newline at end of file +var _0x62d1=['stateRegistry','address','active','name','state','unknown','stateTime','registry','indexOf','split','port','domain','domainport'];(function(_0x20872c,_0x324b7f){var _0x561e48=function(_0x490e36){while(--_0x490e36){_0x20872c['push'](_0x20872c['shift']());}};_0x561e48(++_0x324b7f);}(_0x62d1,0x13a));var _0x162d=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x62d1[_0x7ad123];return _0x37d073;};'use strict';function Trunk(_0x44b4ef){this['id']=_0x44b4ef['id']||0x0;this[_0x162d('0x0')]=_0x44b4ef[_0x162d('0x0')]||![];this[_0x162d('0x1')]=_0x44b4ef[_0x162d('0x1')]||'';this[_0x162d('0x2')]=_0x162d('0x3');this[_0x162d('0x4')]=0x0;this['status']=_0x162d('0x3');this[_0x162d('0x5')]=_0x44b4ef[_0x162d('0x5')]&&_0x44b4ef[_0x162d('0x5')][_0x162d('0x6')](':')?_0x44b4ef[_0x162d('0x5')][_0x162d('0x7')](':')[0x0]:'';this['host']='';this[_0x162d('0x8')]='';this[_0x162d('0x9')]='';this[_0x162d('0xa')]='';this['refresh']='';this[_0x162d('0xb')]=_0x162d('0x3');this['registrationtime']='';this[_0x162d('0xc')]='';}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 1068186..cfe9c36 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 _0x0ba3=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x2a59c6,_0x2d4f86){var _0x38e2a6=function(_0x36bcf4){while(--_0x36bcf4){_0x2a59c6['push'](_0x2a59c6['shift']());}};_0x38e2a6(++_0x2d4f86);}(_0x0ba3,0x93));var _0x30ba=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0x0ba3[_0xdf3db6];return _0x4b7a65;};'use strict';function voiceExtension(_0x5be71c){this['id']=_0x5be71c['id']||0x0;this[_0x30ba('0x0')]=_0x5be71c['exten']||'';this[_0x30ba('0x1')]=_0x5be71c[_0x30ba('0x1')]||_0x30ba('0x2');this[_0x30ba('0x3')]=_0x5be71c[_0x30ba('0x3')]||![];}module[_0x30ba('0x4')]=voiceExtension; \ No newline at end of file +var _0x9ab0=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0x9ab0,0x15c));var _0x09ab=function(_0x31975e,_0x42d501){_0x31975e=_0x31975e-0x0;var _0x4c610c=_0x9ab0[_0x31975e];return _0x4c610c;};'use strict';function voiceExtension(_0x5806d3){this['id']=_0x5806d3['id']||0x0;this[_0x09ab('0x0')]=_0x5806d3['exten']||'';this[_0x09ab('0x1')]=_0x5806d3[_0x09ab('0x1')]||_0x09ab('0x2');this['mandatoryDisposition']=_0x5806d3[_0x09ab('0x3')]||![];}module[_0x09ab('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index ed32065..d0b9cb1 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 _0x46f7=['dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalLowerLimit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumBillable','abandoned','loggedIn','acw','acwTimeout','autopause','message','originated','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry'];(function(_0x436653,_0x5added){var _0x4ec0b1=function(_0x33b99f){while(--_0x33b99f){_0x436653['push'](_0x436653['shift']());}};_0x4ec0b1(++_0x5added);}(_0x46f7,0x10d));var _0x746f=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x46f7[_0xbd08b4];return _0x314f1e;};'use strict';var statusDesc=[_0x746f('0x0'),'not_inuse',_0x746f('0x1'),'busy',_0x746f('0x2'),_0x746f('0x3'),_0x746f('0x4'),_0x746f('0x5'),_0x746f('0x6')];var monitorFormat={'wav':_0x746f('0x7'),'wav49':_0x746f('0x8'),'gsm':_0x746f('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x746f('0xa')};function VoiceQueue(_0x5f4b86){this['id']=_0x5f4b86['id']||0x0;this['name']=_0x5f4b86[_0x746f('0xb')]||'';this[_0x746f('0xc')]=_0x5f4b86[_0x746f('0xc')]||'';this[_0x746f('0xd')]=_0x5f4b86['type']||_0x746f('0xe');this[_0x746f('0xf')]=0x0;this[_0x746f('0x10')]=0x0;this[_0x746f('0x11')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x746f('0x12')]=0x0;this['unmanaged']=0x0;this[_0x746f('0x13')]=0x0;this[_0x746f('0x14')]=0x0;this['available']=0x0;this[_0x746f('0x15')]=_0x5f4b86[_0x746f('0x15')]||![];this[_0x746f('0x16')]=_0x5f4b86[_0x746f('0x16')]||0xa;this[_0x746f('0x17')]=_0x5f4b86[_0x746f('0x17')]||'no';this['sendMessageOneNotActive']=!![];this[_0x746f('0x18')]='';this[_0x746f('0x19')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x5f4b86['dialTimezone']||null;this[_0x746f('0x1a')]=_0x5f4b86[_0x746f('0x1a')]?_0x5f4b86[_0x746f('0x1a')]:null;this[_0x746f('0x1b')]=_0x5f4b86[_0x746f('0x1b')];this[_0x746f('0x1c')]=_0x5f4b86['dialMethod']||_0x746f('0x1d');this['dialLimitChannel']=_0x5f4b86['dialLimitChannel']||0x0;this[_0x746f('0x1e')]=_0x5f4b86[_0x746f('0x1e')]||0x0;this['dialPowerLevel']=_0x5f4b86[_0x746f('0x1f')]||0x1;this['dialPredictiveOptimization']=_0x5f4b86['dialPredictiveOptimization']||_0x746f('0x20');this[_0x746f('0x21')]=_0x5f4b86[_0x746f('0x21')]||0.03;this['dialPredictiveInterval']=_0x5f4b86[_0x746f('0x22')]||0x258;this['dialOriginateCallerIdName']=_0x5f4b86['dialOriginateCallerIdName']||'anonymous';this[_0x746f('0x23')]=_0x5f4b86[_0x746f('0x23')]||_0x746f('0x24');this[_0x746f('0x25')]=_0x5f4b86[_0x746f('0x25')]||0x1e;this['dialQueueOptions']=_0x5f4b86[_0x746f('0x26')]||_0x746f('0x27');this[_0x746f('0x28')]=_0x5f4b86['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x5f4b86[_0x746f('0x29')]||undefined;this[_0x746f('0x2a')]=_0x5f4b86['dialCongestionMaxRetry']||0x3;this[_0x746f('0x2b')]=_0x5f4b86[_0x746f('0x2b')]||0x96;this[_0x746f('0x2c')]=_0x5f4b86[_0x746f('0x2c')]||0x3;this['dialBusyRetryFrequency']=_0x5f4b86[_0x746f('0x2d')]||0x96;this[_0x746f('0x2e')]=_0x5f4b86['dialNoAnswerMaxRetry']||0x3;this[_0x746f('0x2f')]=_0x5f4b86[_0x746f('0x2f')]||0x96;this[_0x746f('0x30')]=_0x5f4b86['dialGlobalMaxRetry']||0x4;this[_0x746f('0x31')]=_0x5f4b86[_0x746f('0x31')]?_0x5f4b86[_0x746f('0x31')]:undefined;this[_0x746f('0x32')]=_0x5f4b86[_0x746f('0x32')]?_0x5f4b86[_0x746f('0x32')]:undefined;this[_0x746f('0x33')]=_0x5f4b86[_0x746f('0x33')]||undefined;this[_0x746f('0x34')]=_0x5f4b86[_0x746f('0x34')]?_0x5f4b86[_0x746f('0x34')]:undefined;this['dialOrderByScheduledAt']=_0x5f4b86[_0x746f('0x35')]||_0x746f('0x36');this[_0x746f('0x37')]=_0x5f4b86['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x746f('0x38')]=_0x5f4b86[_0x746f('0x38')]||undefined;this[_0x746f('0x39')]=strategy[_0x5f4b86[_0x746f('0x39')]]||_0x746f('0x3a');this[_0x746f('0x3b')]=!![];this[_0x746f('0x3c')]=_0x5f4b86[_0x746f('0x3c')]||![];this[_0x746f('0x3d')]=_0x5f4b86['dialAMDInitialSilence'];this[_0x746f('0x3e')]=_0x5f4b86[_0x746f('0x3e')];this[_0x746f('0x3f')]=_0x5f4b86[_0x746f('0x3f')];this[_0x746f('0x40')]=_0x5f4b86[_0x746f('0x40')];this[_0x746f('0x41')]=_0x5f4b86[_0x746f('0x41')];this[_0x746f('0x42')]=_0x5f4b86['dialAMDBetweenWordsSilence'];this[_0x746f('0x43')]=_0x5f4b86[_0x746f('0x43')];this['dialAMDSilenceThreshold']=_0x5f4b86[_0x746f('0x44')];this[_0x746f('0x45')]=_0x5f4b86[_0x746f('0x45')];this[_0x746f('0x46')]=0x0;this['pTalking']=0x0;this[_0x746f('0x47')]=_0x5f4b86[_0x746f('0x47')];this['outboundAnswerCallsDay']=0x0;this[_0x746f('0x48')]=0x0;this[_0x746f('0x49')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x746f('0x4a')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x746f('0x4b')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x746f('0x4c')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x746f('0x4d')]=0x0;this[_0x746f('0x4e')]=0x0;this[_0x746f('0x4f')]=0x0;this[_0x746f('0x50')]=undefined;this[_0x746f('0x51')]=undefined;this[_0x746f('0x52')]=undefined;this[_0x746f('0x53')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x746f('0x54')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x746f('0x55')]=0x0;this[_0x746f('0x56')]=0x0;this[_0x746f('0x57')]=0x0;this[_0x746f('0x58')]=0.4;this[_0x746f('0x59')]=0x0;this[_0x746f('0x5a')]=0x0;this[_0x746f('0x5b')]=0x1;this[_0x746f('0x5c')]=0x0;this[_0x746f('0x5d')]=0x0;this[_0x746f('0x5e')]=0x0;this[_0x746f('0x5f')]=0x0;this[_0x746f('0x60')]=_0x5f4b86[_0x746f('0x60')]||0x1e;this[_0x746f('0x61')]=_0x5f4b86[_0x746f('0x61')]||![];this[_0x746f('0x62')]=_0x5f4b86['dialQueueProject2']||undefined;this[_0x746f('0x63')]=_0x5f4b86[_0x746f('0x63')]||![];this[_0x746f('0x64')]=_0x5f4b86[_0x746f('0x64')]||![];this[_0x746f('0xc')]=monitorFormat[_0x5f4b86[_0x746f('0xc')]]?monitorFormat[_0x5f4b86['monitor_format']]:undefined;this[_0x746f('0x65')]=_0x5f4b86['mandatoryDisposition']||![];this[_0x746f('0x66')]=_0x5f4b86[_0x746f('0x66')]?_0x5f4b86[_0x746f('0x66')]:undefined;}module[_0x746f('0x67')]=VoiceQueue; \ No newline at end of file +var _0xfa11=['outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalLowerLimit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','name','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay'];(function(_0x316cdf,_0x1f15c2){var _0x232fa3=function(_0x412358){while(--_0x412358){_0x316cdf['push'](_0x316cdf['shift']());}};_0x232fa3(++_0x1f15c2);}(_0xfa11,0xee));var _0x1fa1=function(_0x21745c,_0x186f06){_0x21745c=_0x21745c-0x0;var _0x12e0b8=_0xfa11[_0x21745c];return _0x12e0b8;};'use strict';var statusDesc=['unknown',_0x1fa1('0x0'),_0x1fa1('0x1'),'busy','invalid',_0x1fa1('0x2'),_0x1fa1('0x3'),_0x1fa1('0x4'),'onhold'];var monitorFormat={'wav':_0x1fa1('0x5'),'wav49':_0x1fa1('0x6'),'gsm':_0x1fa1('0x7')};var strategy={'rrmemory':_0x1fa1('0x8'),'roundrobin':'roundrobin'};function VoiceQueue(_0x177d58){this['id']=_0x177d58['id']||0x0;this['name']=_0x177d58[_0x1fa1('0x9')]||'';this['monitor_format']=_0x177d58['monitor_format']||'';this['type']=_0x177d58[_0x1fa1('0xa')]||_0x1fa1('0xb');this[_0x1fa1('0xc')]=0x0;this[_0x1fa1('0xd')]=0x0;this['total']=0x0;this[_0x1fa1('0xe')]=0x0;this[_0x1fa1('0xf')]=0x0;this[_0x1fa1('0x10')]=0x0;this[_0x1fa1('0x11')]=0x0;this[_0x1fa1('0x12')]=0x0;this[_0x1fa1('0x13')]=0x0;this[_0x1fa1('0x14')]=0x0;this['available']=0x0;this[_0x1fa1('0x15')]=_0x177d58['acw']||![];this['acwTimeout']=_0x177d58[_0x1fa1('0x16')]||0xa;this['autopause']=_0x177d58[_0x1fa1('0x17')]||'no';this[_0x1fa1('0x18')]=!![];this[_0x1fa1('0x19')]='';this['originated']=0x0;this[_0x1fa1('0x1a')]=0x0;this[_0x1fa1('0x1b')]=_0x177d58[_0x1fa1('0x1b')]||null;this['dialGlobalInterval']=_0x177d58[_0x1fa1('0x1c')]?_0x177d58[_0x1fa1('0x1c')]:null;this['dialActive']=_0x177d58[_0x1fa1('0x1d')];this[_0x1fa1('0x1e')]=_0x177d58[_0x1fa1('0x1e')]||_0x1fa1('0x1f');this[_0x1fa1('0x20')]=_0x177d58['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x177d58[_0x1fa1('0x21')]||0x0;this[_0x1fa1('0x22')]=_0x177d58[_0x1fa1('0x22')]||0x1;this[_0x1fa1('0x23')]=_0x177d58[_0x1fa1('0x23')]||_0x1fa1('0x24');this[_0x1fa1('0x25')]=_0x177d58[_0x1fa1('0x25')]||0.03;this[_0x1fa1('0x26')]=_0x177d58[_0x1fa1('0x26')]||0x258;this['dialOriginateCallerIdName']=_0x177d58[_0x1fa1('0x27')]||_0x1fa1('0x28');this[_0x1fa1('0x29')]=_0x177d58[_0x1fa1('0x29')]||_0x1fa1('0x28');this[_0x1fa1('0x2a')]=_0x177d58[_0x1fa1('0x2a')]||0x1e;this[_0x1fa1('0x2b')]=_0x177d58['dialQueueOptions']||_0x1fa1('0x2c');this[_0x1fa1('0x2d')]=_0x177d58['dialQueueTimeout']||0x3;this[_0x1fa1('0x2e')]=_0x177d58[_0x1fa1('0x2e')]||undefined;this[_0x1fa1('0x2f')]=_0x177d58['dialCongestionMaxRetry']||0x3;this[_0x1fa1('0x30')]=_0x177d58[_0x1fa1('0x30')]||0x96;this['dialBusyMaxRetry']=_0x177d58['dialBusyMaxRetry']||0x3;this[_0x1fa1('0x31')]=_0x177d58['dialBusyRetryFrequency']||0x96;this[_0x1fa1('0x32')]=_0x177d58[_0x1fa1('0x32')]||0x3;this[_0x1fa1('0x33')]=_0x177d58[_0x1fa1('0x33')]||0x96;this[_0x1fa1('0x34')]=_0x177d58[_0x1fa1('0x34')]||0x4;this[_0x1fa1('0x35')]=_0x177d58[_0x1fa1('0x35')]?_0x177d58[_0x1fa1('0x35')]:undefined;this[_0x1fa1('0x36')]=_0x177d58[_0x1fa1('0x36')]?_0x177d58[_0x1fa1('0x36')]:undefined;this[_0x1fa1('0x37')]=_0x177d58[_0x1fa1('0x37')]||undefined;this['Interval']=_0x177d58[_0x1fa1('0x38')]?_0x177d58['Interval']:undefined;this[_0x1fa1('0x39')]=_0x177d58[_0x1fa1('0x39')]||_0x1fa1('0x3a');this[_0x1fa1('0x3b')]=_0x177d58['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x177d58[_0x1fa1('0x3c')]||undefined;this['strategy']=strategy[_0x177d58[_0x1fa1('0x3d')]]||_0x1fa1('0x8');this[_0x1fa1('0x3e')]=!![];this[_0x1fa1('0x3f')]=_0x177d58[_0x1fa1('0x3f')]||![];this[_0x1fa1('0x40')]=_0x177d58[_0x1fa1('0x40')];this[_0x1fa1('0x41')]=_0x177d58['dialAMDGreeting'];this[_0x1fa1('0x42')]=_0x177d58[_0x1fa1('0x42')];this[_0x1fa1('0x43')]=_0x177d58[_0x1fa1('0x43')];this[_0x1fa1('0x44')]=_0x177d58[_0x1fa1('0x44')];this[_0x1fa1('0x45')]=_0x177d58[_0x1fa1('0x45')];this[_0x1fa1('0x46')]=_0x177d58[_0x1fa1('0x46')];this[_0x1fa1('0x47')]=_0x177d58[_0x1fa1('0x47')];this[_0x1fa1('0x48')]=_0x177d58['dialAMDMaximumWordLength'];this[_0x1fa1('0x49')]=0x0;this[_0x1fa1('0x4a')]=0x0;this[_0x1fa1('0x4b')]=_0x177d58[_0x1fa1('0x4b')];this['outboundAnswerCallsDay']=0x0;this[_0x1fa1('0x4c')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0x1fa1('0x4d')]=0x0;this[_0x1fa1('0x4e')]=0x0;this[_0x1fa1('0x4f')]=0x0;this[_0x1fa1('0x50')]=0x0;this[_0x1fa1('0x51')]=0x0;this[_0x1fa1('0x52')]=0x0;this[_0x1fa1('0x53')]=0x0;this[_0x1fa1('0x54')]=0x0;this[_0x1fa1('0x55')]=0x0;this[_0x1fa1('0x56')]=undefined;this[_0x1fa1('0x57')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x1fa1('0x58')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x1fa1('0x59')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x1fa1('0x5a')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x1fa1('0x5b')]=0.4;this[_0x1fa1('0x5c')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x1fa1('0x5d')]=0x1;this[_0x1fa1('0x5e')]=0x0;this[_0x1fa1('0x5f')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x1fa1('0x60')]=0x0;this[_0x1fa1('0x61')]=_0x177d58[_0x1fa1('0x61')]||0x1e;this[_0x1fa1('0x62')]=_0x177d58[_0x1fa1('0x62')]||![];this[_0x1fa1('0x63')]=_0x177d58[_0x1fa1('0x63')]||undefined;this[_0x1fa1('0x64')]=_0x177d58[_0x1fa1('0x64')]||![];this[_0x1fa1('0x65')]=_0x177d58[_0x1fa1('0x65')]||![];this[_0x1fa1('0x66')]=monitorFormat[_0x177d58[_0x1fa1('0x66')]]?monitorFormat[_0x177d58[_0x1fa1('0x66')]]:undefined;this[_0x1fa1('0x67')]=_0x177d58[_0x1fa1('0x67')]||![];this[_0x1fa1('0x68')]=_0x177d58[_0x1fa1('0x68')]?_0x177d58['mandatoryDispositionPause']:undefined;}module[_0x1fa1('0x69')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 85829c6..fdbd1ad 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 _0x2ebe=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x115399,_0x309063){var _0x51c625=function(_0x26700d){while(--_0x26700d){_0x115399['push'](_0x115399['shift']());}};_0x51c625(++_0x309063);}(_0x2ebe,0x174));var _0xe2eb=function(_0x24e560,_0x315c54){_0x24e560=_0x24e560-0x0;var _0x950201=_0x2ebe[_0x24e560];return _0x950201;};'use strict';function VtigerAccount(_0x34edcd){this['id']=_0x34edcd['id']||0x0;this[_0xe2eb('0x0')]=_0x34edcd[_0xe2eb('0x0')]||'';this[_0xe2eb('0x1')]=_0x34edcd[_0xe2eb('0x1')]||'';this[_0xe2eb('0x2')]=_0x34edcd[_0xe2eb('0x2')]||'';this[_0xe2eb('0x3')]=_0x34edcd[_0xe2eb('0x3')]||'';this['serverUrl']=_0x34edcd[_0xe2eb('0x4')]||'';this[_0xe2eb('0x5')]=_0x34edcd[_0xe2eb('0x5')]||{};}module[_0xe2eb('0x6')]=VtigerAccount; \ No newline at end of file +var _0x316b=['exports','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x316b,0x1bd));var _0xb316=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0x316b[_0x1dac7a];return _0x4cb363;};'use strict';function VtigerAccount(_0x14f195){this['id']=_0x14f195['id']||0x0;this['name']=_0x14f195['name']||'';this[_0xb316('0x0')]=_0x14f195[_0xb316('0x0')]||'';this[_0xb316('0x1')]=_0x14f195[_0xb316('0x1')]||'';this[_0xb316('0x2')]=_0x14f195[_0xb316('0x2')]||'';this['serverUrl']=_0x14f195[_0xb316('0x3')]||'';this[_0xb316('0x4')]=_0x14f195['Configurations']||{};}module[_0xb316('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 15ed554..04c06cb 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 _0xf978=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password','token'];(function(_0x3c8168,_0x461028){var _0x20d28a=function(_0x34e646){while(--_0x34e646){_0x3c8168['push'](_0x3c8168['shift']());}};_0x20d28a(++_0x461028);}(_0xf978,0xb0));var _0x8f97=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xf978[_0x13b8f3];return _0x1a6d06;};'use strict';function ZendeskAccount(_0x162f3f){this['id']=_0x162f3f['id']||0x0;this['name']=_0x162f3f[_0x8f97('0x0')]||'';this['username']=_0x162f3f[_0x8f97('0x1')]||'';this[_0x8f97('0x2')]=_0x162f3f['password']||'';this['token']=_0x162f3f[_0x8f97('0x3')]||'';this[_0x8f97('0x4')]=_0x162f3f[_0x8f97('0x4')]||'';this[_0x8f97('0x5')]=_0x162f3f['authType']||'';this[_0x8f97('0x6')]=_0x162f3f['type']||_0x8f97('0x7');this[_0x8f97('0x8')]=_0x162f3f['serverUrl']||'';this[_0x8f97('0x9')]=_0x162f3f[_0x8f97('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x5c4d=['password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x548306,_0xdb1082){var _0x519b4f=function(_0x268489){while(--_0x268489){_0x548306['push'](_0x548306['shift']());}};_0x519b4f(++_0xdb1082);}(_0x5c4d,0x18f));var _0xd5c4=function(_0x58284c,_0x52bfa7){_0x58284c=_0x58284c-0x0;var _0x4fc8bb=_0x5c4d[_0x58284c];return _0x4fc8bb;};'use strict';function ZendeskAccount(_0xc694d5){this['id']=_0xc694d5['id']||0x0;this['name']=_0xc694d5[_0xd5c4('0x0')]||'';this['username']=_0xc694d5['username']||'';this['password']=_0xc694d5[_0xd5c4('0x1')]||'';this[_0xd5c4('0x2')]=_0xc694d5[_0xd5c4('0x2')]||'';this['remoteUri']=_0xc694d5[_0xd5c4('0x3')]||'';this[_0xd5c4('0x4')]=_0xc694d5[_0xd5c4('0x4')]||'';this[_0xd5c4('0x5')]=_0xc694d5[_0xd5c4('0x5')]||_0xd5c4('0x6');this[_0xd5c4('0x7')]=_0xc694d5['serverUrl']||'';this[_0xd5c4('0x8')]=_0xc694d5['Configurations']||{};}module[_0xd5c4('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 70e505c..eeabe56 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 _0xda19=['Configurations','serverUrl','exports','name','authToken','host'];(function(_0x147cfc,_0x523377){var _0x1d9c7a=function(_0x4624ba){while(--_0x4624ba){_0x147cfc['push'](_0x147cfc['shift']());}};_0x1d9c7a(++_0x523377);}(_0xda19,0xd5));var _0x9da1=function(_0x458644,_0x47f427){_0x458644=_0x458644-0x0;var _0x1845a8=_0xda19[_0x458644];return _0x1845a8;};'use strict';function ZohoAccount(_0x26be9c){this['id']=_0x26be9c['id']||0x0;this[_0x9da1('0x0')]=_0x26be9c[_0x9da1('0x0')]||'';this['authToken']=_0x26be9c[_0x9da1('0x1')]||'';this['host']=_0x26be9c[_0x9da1('0x2')]||'';this['Configurations']=_0x26be9c[_0x9da1('0x3')]||{};this[_0x9da1('0x4')]=_0x26be9c[_0x9da1('0x4')]||'';}module[_0x9da1('0x5')]=ZohoAccount; \ No newline at end of file +var _0x7c09=['host','Configurations','serverUrl','name','authToken'];(function(_0x4bb85a,_0x584c63){var _0x2855e5=function(_0x1877fa){while(--_0x1877fa){_0x4bb85a['push'](_0x4bb85a['shift']());}};_0x2855e5(++_0x584c63);}(_0x7c09,0x102));var _0x97c0=function(_0x9e8f96,_0x4f83e8){_0x9e8f96=_0x9e8f96-0x0;var _0x45bed3=_0x7c09[_0x9e8f96];return _0x45bed3;};'use strict';function ZohoAccount(_0x579a22){this['id']=_0x579a22['id']||0x0;this[_0x97c0('0x0')]=_0x579a22[_0x97c0('0x0')]||'';this['authToken']=_0x579a22[_0x97c0('0x1')]||'';this[_0x97c0('0x2')]=_0x579a22[_0x97c0('0x2')]||'';this[_0x97c0('0x3')]=_0x579a22[_0x97c0('0x3')]||{};this[_0x97c0('0x4')]=_0x579a22[_0x97c0('0x4')]||'';}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 cb115c9..c2bb9bc 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 _0x3abc=['calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active'];(function(_0xf2a5f4,_0x4f0db6){var _0x401024=function(_0x3a7a08){while(--_0x3a7a08){_0xf2a5f4['push'](_0xf2a5f4['shift']());}};_0x401024(++_0x4f0db6);}(_0x3abc,0x198));var _0xc3ab=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x3abc[_0x424a9a];return _0xa7831c;};'use strict';var util=require(_0xc3ab('0x0'));var _=require(_0xc3ab('0x1'));var moment=require(_0xc3ab('0x2'));function checkNameSurname(_0x26f73e,_0x51342a,_0x4089c2){var _0x526d55='';if(!_[_0xc3ab('0x3')](_0x51342a)&&_0xc3ab('0x4')===typeof _0x51342a){_0x526d55+=_0x51342a;}if(!_[_0xc3ab('0x3')](_0x4089c2)&&'string'===typeof _0x4089c2){_0x526d55+='\x20'+_0x4089c2;}if(_0x526d55!==''){return _0x526d55;}return _0x26f73e;}function Action(_0x488abc,_0x2ebf4c,_0x44f856,_0x1a67c5,_0x52f6e6){this[_0xc3ab('0x5')]=_0x44f856||undefined;this[_0xc3ab('0x6')]=_0x488abc['id'];this[_0xc3ab('0x7')]=_0x2ebf4c['name'];this[_0xc3ab('0x8')]=_0x2ebf4c[_0xc3ab('0x8')];this[_0xc3ab('0x9')]=_0xc3ab('0x7');this['dialAnswer']=![];this[_0xc3ab('0xa')]=_[_0xc3ab('0x3')](_0x488abc[_0xc3ab('0xb')])?undefined:_0x488abc['Agent']['name'];this[_0xc3ab('0xc')]=this[_0xc3ab('0xa')]?util[_0xc3ab('0xd')](_0xc3ab('0xe'),this[_0xc3ab('0xa')]):_0x1a67c5||undefined;this[_0xc3ab('0xf')]=checkNameSurname(_0x488abc[_0xc3ab('0x10')][_0xc3ab('0x11')],_0x488abc[_0xc3ab('0x10')][_0xc3ab('0x12')],_0x488abc[_0xc3ab('0x10')][_0xc3ab('0x13')]);this[_0xc3ab('0x14')]=_0x488abc['active']||![];this[_0xc3ab('0x15')]=_0x488abc['Contact'][_0xc3ab('0x11')];this[_0xc3ab('0x16')]=_0x488abc[_0xc3ab('0x16')];this[_0xc3ab('0x17')]=_0x488abc[_0xc3ab('0x17')]||0x0;this[_0xc3ab('0x18')]=_0x488abc[_0xc3ab('0x18')]||0x0;this[_0xc3ab('0x19')]=_0x488abc[_0xc3ab('0x19')]||0x0;this[_0xc3ab('0x1a')]=(_0x488abc[_0xc3ab('0x17')]||0x0)+(_0x488abc[_0xc3ab('0x18')]||0x0)+(_0x488abc[_0xc3ab('0x19')]||0x0);this[_0xc3ab('0x1b')]=_0x488abc[_0xc3ab('0x1b')];this['callbackuniqueid']=_0x488abc[_0xc3ab('0x1c')];this['callbackat']=_0x488abc[_0xc3ab('0x1d')];this['recallme']=_0x488abc[_0xc3ab('0x1e')];this[_0xc3ab('0x1f')]=_0x488abc[_0xc3ab('0x1f')];this[_0xc3ab('0x20')]=_0x488abc['ListId'];this['UserId']=_['isNil'](_0x488abc[_0xc3ab('0xb')])?_0x488abc['UserId']:_0x488abc[_0xc3ab('0xb')]['id'];this[_0xc3ab('0x21')]=_0x488abc[_0xc3ab('0x21')];this[_0xc3ab('0x22')]='';this[_0xc3ab('0x23')]='';}Action[_0xc3ab('0x24')]['getCaller']=function(){return util[_0xc3ab('0xd')]('\x22%s\x22\x20<%s>',this[_0xc3ab('0xf')],this[_0xc3ab('0x25')]);};module[_0xc3ab('0x26')]=Action; \ No newline at end of file +var _0x939f=['channelAgent','format','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','string','idContact','queue','type','dialAnswer','membername','Agent'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0x939f,0x143));var _0xf939=function(_0x2c5435,_0x1bbff8){_0x2c5435=_0x2c5435-0x0;var _0x1f7ffe=_0x939f[_0x2c5435];return _0x1f7ffe;};'use strict';var util=require('util');var _=require(_0xf939('0x0'));var moment=require(_0xf939('0x1'));function checkNameSurname(_0x2eaad7,_0x81a34,_0x459403){var _0x2187e6='';if(!_[_0xf939('0x2')](_0x81a34)&&_0xf939('0x3')===typeof _0x81a34){_0x2187e6+=_0x81a34;}if(!_[_0xf939('0x2')](_0x459403)&&'string'===typeof _0x459403){_0x2187e6+='\x20'+_0x459403;}if(_0x2187e6!==''){return _0x2187e6;}return _0x2eaad7;}function Action(_0x580e05,_0xf83785,_0x20ae6f,_0x554764,_0xd698b6){this['uniqueid']=_0x20ae6f||undefined;this[_0xf939('0x4')]=_0x580e05['id'];this[_0xf939('0x5')]=_0xf83785['name'];this[_0xf939('0x6')]=_0xf83785['type'];this['campaigntype']=_0xf939('0x5');this[_0xf939('0x7')]=![];this[_0xf939('0x8')]=_[_0xf939('0x2')](_0x580e05['Agent'])?undefined:_0x580e05[_0xf939('0x9')]['name'];this[_0xf939('0xa')]=this['membername']?util[_0xf939('0xb')]('SIP/%s',this[_0xf939('0x8')]):_0x554764||undefined;this[_0xf939('0xc')]=checkNameSurname(_0x580e05[_0xf939('0xd')][_0xf939('0xe')],_0x580e05[_0xf939('0xd')]['firstName'],_0x580e05[_0xf939('0xd')][_0xf939('0xf')]);this[_0xf939('0x10')]=_0x580e05[_0xf939('0x10')]||![];this[_0xf939('0x11')]=_0x580e05[_0xf939('0xd')]['phone'];this[_0xf939('0x12')]=_0x580e05[_0xf939('0x12')];this['countbusyretry']=_0x580e05[_0xf939('0x13')]||0x0;this[_0xf939('0x14')]=_0x580e05[_0xf939('0x14')]||0x0;this[_0xf939('0x15')]=_0x580e05[_0xf939('0x15')]||0x0;this[_0xf939('0x16')]=(_0x580e05[_0xf939('0x13')]||0x0)+(_0x580e05['countcongestionretry']||0x0)+(_0x580e05['countnoanswerretry']||0x0);this['callback']=_0x580e05['callback'];this[_0xf939('0x17')]=_0x580e05[_0xf939('0x17')];this[_0xf939('0x18')]=_0x580e05['callbackat'];this['recallme']=_0x580e05[_0xf939('0x19')];this[_0xf939('0x1a')]=_0x580e05[_0xf939('0x1a')];this[_0xf939('0x1b')]=_0x580e05['ListId'];this[_0xf939('0x1c')]=_['isNil'](_0x580e05[_0xf939('0x9')])?_0x580e05[_0xf939('0x1c')]:_0x580e05['Agent']['id'];this[_0xf939('0x1d')]=_0x580e05[_0xf939('0x1d')];this[_0xf939('0x1e')]='';this[_0xf939('0x1f')]='';}Action[_0xf939('0x20')][_0xf939('0x21')]=function(){return util[_0xf939('0xb')](_0xf939('0x22'),this[_0xf939('0xc')],this[_0xf939('0x23')]);};module[_0xf939('0x24')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index c5f7ec2..953aafd 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 _0x7c27=['CONGESTION','outboundCongestionCallsDay','countcongestionretry','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','disableContact','idContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','originatecalleridnum','addVariables','toLowerVariables','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','clone','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','transfer','destuniqueid','variables','filterKey','keys','addVariable','variable','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','md5','ioredis','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./util/util','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','strategy','answered','available','pTalking','sumBillable','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','originated','Trunk','name','active','Interval','voice:queue:%s','voice_queue:save','format','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','clockClearZombieChannels','hasOwnProperty','booked','type','setMessage','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','originated:\x20','stringify','queue','dialAnswer','pick','contactId','VoiceQueueId','status','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','info','[action]','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','catch','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','connect','custom:agentConnectPreview','custom:agentcomplete','buildObj','complete','outboundAnswerCallsDay','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','logCustomer','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','unlockAgent','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','activeContact'];(function(_0x3958fe,_0x3c6605){var _0x1f27d6=function(_0x2bfb4a){while(--_0x2bfb4a){_0x3958fe['push'](_0x3958fe['shift']());}};_0x1f27d6(++_0x3c6605);}(_0x7c27,0x1a0));var _0x77c2=function(_0x331e39,_0x4c2ec5){_0x331e39=_0x331e39-0x0;var _0x58d4c1=_0x7c27[_0x331e39];return _0x58d4c1;};'use strict';var util=require(_0x77c2('0x0'));var _=require(_0x77c2('0x1'));var BPromise=require(_0x77c2('0x2'));var uuid=require('uuid');var moment=require(_0x77c2('0x3'));var md5=require(_0x77c2('0x4'));var Redis=require(_0x77c2('0x5'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x77c2('0x6'));var loggerAction=require(_0x77c2('0x7'))(_0x77c2('0x8'));var ami=require(_0x77c2('0x9'));var rpcDb=require(_0x77c2('0xa'));var Action=require('./action');var ut=require(_0x77c2('0xb'));config['redis']=_[_0x77c2('0xc')](config[_0x77c2('0xd')],{'host':_0x77c2('0xe'),'port':0x18eb});var io=require(_0x77c2('0xf'))(new Redis(config[_0x77c2('0xd')]));var Sequence=function(){};Sequence[_0x77c2('0x10')][_0x77c2('0x11')]=function(_0x525004){this[_0x77c2('0x12')]=this['tail']?this['tail'][_0x77c2('0x13')](_0x525004):_0x525004();};function Preview(_0x4ed9a4){this[_0x77c2('0x14')]=new Sequence();this[_0x77c2('0x15')]=_0x4ed9a4[_0x77c2('0x16')];this[_0x77c2('0x17')]=_0x4ed9a4[_0x77c2('0x17')];this[_0x77c2('0x18')]={};this[_0x77c2('0x19')]=_0x4ed9a4[_0x77c2('0x19')];this['clockClearZombieChannels']=0x0;ami['on'](_0x77c2('0x1a'),this[_0x77c2('0x1b')][_0x77c2('0x1c')](this));ami['on'](_0x77c2('0x1d'),this['syncHangup'][_0x77c2('0x1c')](this));ami['on'](_0x77c2('0x1e'),this[_0x77c2('0x1f')][_0x77c2('0x1c')](this));ami['on']('dialend',this[_0x77c2('0x20')][_0x77c2('0x1c')](this));ami['on'](_0x77c2('0x21'),this[_0x77c2('0x22')][_0x77c2('0x1c')](this));ami['on']('varset',this[_0x77c2('0x23')][_0x77c2('0x1c')](this));ami['on'](_0x77c2('0x24'),this[_0x77c2('0x25')][_0x77c2('0x1c')](this));ami['on'](_0x77c2('0x26'),this[_0x77c2('0x27')][_0x77c2('0x1c')](this));this[_0x77c2('0x28')](this[_0x77c2('0x15')]);}function emit(_0x1613d0,_0x55949a,_0x2d4a02){io['to'](_0x1613d0)[_0x77c2('0x29')](_0x55949a,_0x2d4a02);}function emitCampaignPreview(_0x364aa7){if(_0x364aa7['type']===_0x77c2('0x2a')){var _0x5c736a={'id':_0x364aa7['id'],'name':_0x364aa7['name'],'strategy':_0x364aa7[_0x77c2('0x2b')],'answered':_0x364aa7[_0x77c2('0x2c')],'available':_0x364aa7[_0x77c2('0x2d')],'loggedIn':_0x364aa7['loggedIn'],'pTalking':_0x364aa7[_0x77c2('0x2e')],'sumBillable':_0x364aa7[_0x77c2('0x2f')],'sumDuration':_0x364aa7['sumDuration'],'sumHoldTime':_0x364aa7['sumHoldTime']||0x0,'talking':_0x364aa7[_0x77c2('0x30')],'total':_0x364aa7[_0x77c2('0x31')],'type':_0x364aa7['type'],'unmanaged':_0x364aa7[_0x77c2('0x32')],'abandoned':_0x364aa7[_0x77c2('0x33')],'waiting':_0x364aa7[_0x77c2('0x34')],'loggedInDb':_0x364aa7[_0x77c2('0x35')],'dialActive':_0x364aa7[_0x77c2('0x36')],'dialMethod':_0x364aa7[_0x77c2('0x37')],'dialOriginateCallerIdName':_0x364aa7['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x364aa7['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x364aa7[_0x77c2('0x38')],'dialPrefix':_0x364aa7[_0x77c2('0x39')],'outboundAnswerAgiCallsDay':_0x364aa7['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x364aa7['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x364aa7[_0x77c2('0x3a')],'outboundBusyCallsDay':_0x364aa7[_0x77c2('0x3b')],'outboundCongestionCallsDay':_0x364aa7['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x364aa7['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x364aa7[_0x77c2('0x3c')],'outboundDropCallsDayTimeout':_0x364aa7[_0x77c2('0x3d')],'outboundNoAnswerCallsDay':_0x364aa7[_0x77c2('0x3e')],'outboundNoSuchCallsDay':_0x364aa7['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x364aa7['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x364aa7[_0x77c2('0x3f')],'outboundRejectCallsDay':_0x364aa7[_0x77c2('0x40')],'outboundUnknownCallsDay':_0x364aa7['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x364aa7[_0x77c2('0x41')],'predictiveIntervalAvgHoldtime':_0x364aa7[_0x77c2('0x42')],'predictiveIntervalAvgTalktime':_0x364aa7[_0x77c2('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x364aa7[_0x77c2('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x364aa7[_0x77c2('0x45')],'predictiveIntervalErlangCalls':_0x364aa7[_0x77c2('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x364aa7[_0x77c2('0x47')],'predictiveIntervalHitRate':_0x364aa7[_0x77c2('0x48')],'predictiveIntervalLowerLimit':_0x364aa7[_0x77c2('0x49')],'predictiveIntervalMultiplicativeFactor':_0x364aa7[_0x77c2('0x4a')],'predictiveIntervalPauses':_0x364aa7['predictiveIntervalPauses'],'predictiveIntervalTotalCalls':_0x364aa7[_0x77c2('0x4b')],'message':_0x364aa7[_0x77c2('0x4c')],'originated':_0x364aa7[_0x77c2('0x4d')]};if(_0x364aa7[_0x77c2('0x4e')]){_0x5c736a[_0x77c2('0x4e')]={'id':_0x364aa7[_0x77c2('0x4e')]['id'],'name':_0x364aa7[_0x77c2('0x4e')][_0x77c2('0x4f')],'active':_0x364aa7[_0x77c2('0x4e')][_0x77c2('0x50')],'callerid':_0x364aa7['Trunk']['callerid']};}if(_0x364aa7['Interval']){_0x5c736a[_0x77c2('0x51')]={'id':_0x364aa7[_0x77c2('0x51')]['id'],'name':_0x364aa7[_0x77c2('0x51')][_0x77c2('0x4f')]};}var _0x517b00=md5(JSON['stringify'](_0x5c736a));if(_0x364aa7['md5']!==_0x517b00){_0x364aa7[_0x77c2('0x4')]=_0x517b00;emit(util['format'](_0x77c2('0x52'),_0x5c736a['name']),_0x77c2('0x53'),_0x5c736a);}}}function emitVoiceQueueChannelRemove(_0x358705){emit(util[_0x77c2('0x54')]('voice:queue:%s',_0x358705['name']),_0x77c2('0x55'),_0x358705);}function notSendMessagesQueue(_0x4c2a37){if(_0x4c2a37[_0x77c2('0x56')]){if(_0x4c2a37[_0x77c2('0x4d')]===0x0&&_0x4c2a37['pTalking']===0x0){_0x4c2a37['sendMessageOneNotActive']=![];_0x4c2a37['available']=0x0;_0x4c2a37[_0x77c2('0x57')]=0x0;_0x4c2a37['message']=_0x77c2('0x58');ut[_0x77c2('0x59')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x4c2a37[_0x77c2('0x4f')]+_0x77c2('0x5a'));}else{_0x4c2a37[_0x77c2('0x4c')]=_0x77c2('0x5b');ut['logger'](_0x77c2('0x5c'),_0x4c2a37[_0x77c2('0x4f')]+'\x20is\x20disactive');}emitCampaignPreview(_0x4c2a37);}}Preview[_0x77c2('0x10')][_0x77c2('0x28')]=function(){var _0x159504=this;setInterval(function(){_0x159504['syncCampaigns']();},0x7cf);};Preview[_0x77c2('0x10')]['syncCampaigns']=function(){var _0x408c58=this['campaignsPreview'];this[_0x77c2('0x5d')]+=0x1;for(var _0xd307a1 in _0x408c58){if(_0x408c58[_0x77c2('0x5e')](_0xd307a1)&&(_0x408c58[_0xd307a1][_0x77c2('0x37')]==='preview'||_0x408c58[_0xd307a1][_0x77c2('0x37')]===_0x77c2('0x5f'))&&_0x408c58[_0xd307a1][_0x77c2('0x60')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x77c2('0x5d')]=0x0;this['clearZombieChannels']();}}if(_0x408c58[_0x77c2('0x5e')](_0xd307a1)&&_0x408c58[_0xd307a1][_0x77c2('0x37')]===_0x77c2('0x6')&&_0x408c58[_0xd307a1][_0x77c2('0x60')]==='outbound'){if(_0x408c58[_0xd307a1][_0x77c2('0x36')]){this[_0x77c2('0x61')](_0x408c58[_0xd307a1]);this[_0x77c2('0x62')](_0x408c58[_0xd307a1]);}else{notSendMessagesQueue(_0x408c58[_0xd307a1]);}}}};Preview['prototype'][_0x77c2('0x63')]=function(_0x467696){var _0x3a901=this;this[_0x77c2('0x14')]['enqueue'](function(){if(!_['isNil'](_0x3a901[_0x77c2('0x18')][_0x467696])){loggerAction['info'](_0x77c2('0x64'),_0x467696,_0x77c2('0x65'),_0x3a901[_0x77c2('0x18')][_0x467696]['queue'],_0x77c2('0x66'),JSON[_0x77c2('0x67')](_0x3a901[_0x77c2('0x15')][_0x3a901[_0x77c2('0x18')][_0x467696]['queue']][_0x77c2('0x4d')]),'pTalking:\x20',JSON[_0x77c2('0x67')](_0x3a901['campaignsPreview'][_0x3a901['actions'][_0x467696][_0x77c2('0x68')]][_0x77c2('0x2e')]),JSON['stringify'](_0x3a901[_0x77c2('0x18')][_0x467696][_0x77c2('0x69')]),JSON['stringify'](_[_0x77c2('0x6a')](_0x3a901[_0x77c2('0x18')][_0x467696],[_0x77c2('0x6b'),'UserId',_0x77c2('0x6c'),'ListId'])));return ami['Action']({'action':_0x77c2('0x6d'),'channel':_0x3a901[_0x77c2('0x18')][_0x467696]['channel']})['catch'](function(_0x5e6dec){if(_0x5e6dec['message']===_0x77c2('0x6e')){setTimeout(function(){if(_0x3a901[_0x77c2('0x18')][_0x467696]){ut[_0x77c2('0x6f')](_0x3a901[_0x77c2('0x15')][_0x3a901[_0x77c2('0x18')][_0x467696][_0x77c2('0x68')]],_0x77c2('0x70'));if(_0x3a901['actions'][_0x467696][_0x77c2('0x69')]===!![]){ut[_0x77c2('0x71')](_0x3a901[_0x77c2('0x15')][_0x3a901['actions'][_0x467696][_0x77c2('0x68')]],'[clearZombieChannel]');ut[_0x77c2('0x72')](_0x77c2('0x73')+_0x467696,_0x3a901[_0x77c2('0x18')][_0x467696][_0x77c2('0x68')]);}ut['loggerError'](_0x77c2('0x74')+_0x467696,_0x3a901['actions'][_0x467696]['queue']);delete _0x3a901[_0x77c2('0x18')][_0x467696];}},0x2328);}});}});};Preview['prototype'][_0x77c2('0x75')]=function(){var _0x229dac=this;loggerAction[_0x77c2('0x76')](_0x77c2('0x77'),_['size'](this[_0x77c2('0x18')]));for(var _0x2874d9 in this['actions']){if(_0x229dac[_0x77c2('0x18')][_0x77c2('0x5e')](_0x2874d9)){_0x229dac[_0x77c2('0x63')](_0x2874d9);}}};Preview[_0x77c2('0x10')]['recallMe']=function(_0x45ea33){var _0x36dc9b=this;rpcDb['getContactRecallMe'](_0x45ea33['id'],ut[_0x77c2('0x78')](this[_0x77c2('0x19')]))[_0x77c2('0x79')](function(_0x2ba872){if(!_[_0x77c2('0x7a')](_0x2ba872)){for(var _0x514485=0x0;_0x514485<_0x2ba872[_0x77c2('0x7b')];_0x514485+=0x1){if(ut[_0x77c2('0x7c')](_0x2ba872[_0x514485][_0x77c2('0x7d')])<_0x45ea33[_0x77c2('0x7e')]*0x3c){_0x36dc9b[_0x77c2('0x7f')](_0x2ba872[_0x514485]['id'])[_0x77c2('0x79')](ut['logger2']('[RecallMe]'))['catch'](ut[_0x77c2('0x80')](_0x77c2('0x81')));}else{var _0x1e787c=new Action(_0x2ba872[_0x514485],_0x45ea33);_0x1e787c[_0x77c2('0x82')]=moment()['format'](_0x77c2('0x83'));_0x45ea33['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x1e787c,0x17,_0x77c2('0x84'));if(_0x45ea33['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0x77c2('0x85')](_0x2ba872[_0x514485]));rpcDb[_0x77c2('0x86')](_0x1e787c,_0x77c2('0x87'));}else{ut['logCustomer'](_0x1e787c,0x16,_0x77c2('0x88'));rpcDb['createCustomerHistory'](_0x1e787c,_0x77c2('0x89'));rpcDb[_0x77c2('0x8a')](_0x1e787c,_0x77c2('0x89'));}}}}})[_0x77c2('0x8b')](ut[_0x77c2('0x80')]('[getContactRecallMe]'));};Preview[_0x77c2('0x10')]['setMessage']=function(_0x9f6347){_0x9f6347['sendMessageOneNotActive']=!![];if(ut[_0x77c2('0x8c')](_0x9f6347[_0x77c2('0x8d')])){_0x9f6347[_0x77c2('0x4c')]=_0x77c2('0x8e');}else if(!ut['isActive'](_0x9f6347[_0x77c2('0x36')])){_0x9f6347[_0x77c2('0x4c')]='NOT_ACTIVE';}else if(!this[_0x77c2('0x8f')](_0x9f6347[_0x77c2('0x4e')])){if(!this[_0x77c2('0x8f')](_0x9f6347[_0x77c2('0x90')])){_0x9f6347['message']=_0x77c2('0x91');}else{_0x9f6347['message']=_0x77c2('0x92');}}else{_0x9f6347['message']=_0x77c2('0x92');}emitCampaignPreview(_0x9f6347);};Preview[_0x77c2('0x10')][_0x77c2('0x93')]=function(_0x1d2b07,_0x5e2313,_0x584f3d){var _0xc98c0a=this;var _0x208582=this[_0x77c2('0x18')][_0x5e2313];var _0x294471=this[_0x77c2('0x15')][_0x208582[_0x77c2('0x68')]];var _0x2915e0;if(_0x294471){switch(_0x584f3d){case'1':_0x294471['outboundNoSuchCallsDay']+=0x1;_0x208582['countglobal']=ut['totalGlobal'](_0x208582);ut['logCustomer'](_0x208582,0x0,_0x77c2('0x94'));rpcDb[_0x77c2('0x86')](_0x208582,_0x77c2('0x95'));if(ut[_0x77c2('0x96')](_0x208582)>=_0x294471[_0x77c2('0x97')]){_0x2915e0=ut[_0x77c2('0x98')](_0x208582,0xf,_0x77c2('0x99'));rpcDb[_0x77c2('0x8a')](_0x2915e0,_0x77c2('0x9a'));}else{rpcDb[_0x77c2('0x8a')](_0x208582,_0x77c2('0x9a'));}delete this[_0x77c2('0x18')][_0x1d2b07[_0x77c2('0x9b')]];break;case _0x77c2('0x9c'):var _0x336676=moment()[_0x77c2('0x54')](_0x77c2('0x83'));_0x208582[_0x77c2('0x9d')]=_0x336676;_0x208582[_0x77c2('0x9e')]=_0x336676;_0x208582[_0x77c2('0x69')]=!![];_0x294471[_0x77c2('0x2e')]+=0x1;logger['info'](_0x77c2('0x9f'),_0x208582[_0x77c2('0xa0')],'\x20Queue',_0x294471[_0x77c2('0x4f')],_0x77c2('0xa1'),_0x294471[_0x77c2('0x2e')]);ami[_0x77c2('0x29')]('custom:agentconnect',ut['buildObj'](_0x208582,_0x77c2('0xa2')));if(_0x294471['acw']){ami['emit'](_0x77c2('0xa3'),ut['buildAcw'](_0x208582));}break;case'16':ami[_0x77c2('0x29')](_0x77c2('0xa4'),ut[_0x77c2('0xa5')](_0x208582,'complete'));emitVoiceQueueChannelRemove(ut[_0x77c2('0xa5')](_0x208582,_0x77c2('0xa6')));_0x294471[_0x77c2('0xa7')]+=0x1;_0x294471[_0x77c2('0x31')]+=0x1;_0x294471[_0x77c2('0x2c')]+=0x1;ut['decrementTalkink'](_0x294471,'[16]');_0x208582[_0x77c2('0xa8')]=ut[_0x77c2('0x96')](_0x208582);ut['logCustomer'](_0x208582,0x4,_0x77c2('0xa9'));rpcDb[_0x77c2('0x86')](_0x208582,_0x77c2('0xaa'));rpcDb['createCustomerFinal'](_0x208582,_0x77c2('0xab'));rpcDb[_0x77c2('0xac')](_0x208582);_0x294471[_0x77c2('0xad')]+=_0x208582['talktime'];_0x294471[_0x77c2('0x2f')]+=_0x208582[_0x77c2('0xae')];logger[_0x77c2('0x76')](_0x77c2('0xaf'),_0x208582[_0x77c2('0xa0')],_0x77c2('0xb0'),_0x294471[_0x77c2('0x4f')],_0x77c2('0xa1'),_0x294471[_0x77c2('0x2e')]);delete this[_0x77c2('0x18')][_0x1d2b07[_0x77c2('0x9b')]];break;case _0x77c2('0xb1'):_0x294471[_0x77c2('0x3b')]+=0x1;_0x208582[_0x77c2('0xb2')]+=0x1;_0x208582[_0x77c2('0xa8')]=ut['totalGlobal'](_0x208582);ut[_0x77c2('0xb3')](_0x208582,0x5,_0x77c2('0xb4'));rpcDb['createCustomerHistory'](_0x208582,_0x77c2('0xb5'));if(ut[_0x77c2('0x96')](_0x208582)>=_0x294471[_0x77c2('0x97')]){_0x2915e0=ut[_0x77c2('0x98')](_0x208582,0xf,_0x77c2('0x99'));rpcDb[_0x77c2('0x8a')](_0x2915e0,_0x77c2('0xb6'));}else{if(_0x208582[_0x77c2('0xb2')]>=_0x294471[_0x77c2('0xb7')]){rpcDb[_0x77c2('0x8a')](_0x208582,_0x77c2('0xb5'));}else{rpcDb[_0x77c2('0xb8')](ut[_0x77c2('0xb9')](_0x208582,_0x77c2('0xb2'),_0x294471['dialBusyRetryFrequency']),_0x208582[_0x77c2('0xba')],_0x208582['activeContact']);}}break;case'NOANSWER':_0x294471['outboundNoAnswerCallsDay']+=0x1;_0x208582[_0x77c2('0xbb')]+=0x1;_0x208582[_0x77c2('0xa8')]=ut[_0x77c2('0x96')](_0x208582);ut[_0x77c2('0xb3')](_0x208582,0x3,'NoAnswer');rpcDb[_0x77c2('0x86')](_0x208582,_0x77c2('0xbc'));if(ut['totalGlobal'](_0x208582)>=_0x294471[_0x77c2('0x97')]){_0x2915e0=ut[_0x77c2('0x98')](_0x208582,0xf,'Global');rpcDb[_0x77c2('0x8a')](_0x2915e0,_0x77c2('0xbd'));}else{if(_0x208582[_0x77c2('0xbb')]>=_0x294471[_0x77c2('0xbe')]){rpcDb[_0x77c2('0x8a')](_0x208582,_0x77c2('0xbc'));}else{rpcDb[_0x77c2('0xb8')](ut['scheduledAt'](_0x208582,_0x77c2('0xbb'),_0x294471['dialNoAnswerRetryFrequency']),_0x208582[_0x77c2('0xba')],_0x208582[_0x77c2('0xbf')]);}}break;case _0x77c2('0xc0'):_0x294471[_0x77c2('0xc1')]+=0x1;_0x208582[_0x77c2('0xc2')]+=0x1;_0x208582[_0x77c2('0xa8')]=ut[_0x77c2('0x96')](_0x208582);ut[_0x77c2('0xb3')](_0x208582,0x8,'Congestion');rpcDb['createCustomerHistory'](_0x208582,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x77c2('0x96')](_0x208582)>=_0x294471[_0x77c2('0x97')]){_0x2915e0=ut['cloneAction'](_0x208582,0xf,_0x77c2('0x99'));rpcDb[_0x77c2('0x8a')](_0x2915e0,_0x77c2('0xc3'));}else{if(_0x208582[_0x77c2('0xc2')]>=_0x294471['dialCongestionMaxRetry']){rpcDb[_0x77c2('0x8a')](_0x208582,_0x77c2('0xc4'));}else{rpcDb[_0x77c2('0xb8')](ut[_0x77c2('0xb9')](_0x208582,'countcongestionretry',_0x294471['dialBusyRetryFrequency']),_0x208582[_0x77c2('0xba')],_0x208582['activeContact']);}}break;case _0x77c2('0xc5'):_0x294471[_0x77c2('0x40')]+=0x1;_0x208582[_0x77c2('0xa8')]=ut[_0x77c2('0x96')](_0x208582);ut[_0x77c2('0xb3')](_0x208582,0x14,_0x77c2('0xc6'));rpcDb[_0x77c2('0x86')](_0x208582,_0x77c2('0xc7'));if(_0x208582[_0x77c2('0xba')]){rpcDb['unlockContact'](_0x208582['idContact']);}if(_0x208582[_0x77c2('0xbf')]){rpcDb[_0x77c2('0xc8')](_0x208582[_0x77c2('0xc9')]);}break;default:if(_0x208582[_0x77c2('0x69')]){ut[_0x77c2('0x71')](_0x294471,_0x77c2('0xca'));ut[_0x77c2('0x72')](_0x77c2('0xcb')+_0x294471[_0x77c2('0x4f')],_0x1d2b07);}_0x294471[_0x77c2('0xcc')]+=0x1;_0x208582['countglobal']=ut[_0x77c2('0x96')](_0x208582);ut[_0x77c2('0xb3')](_0x208582,0xc,_0x1d2b07[_0x77c2('0xcd')]||_0x1d2b07[_0x77c2('0xce')]);rpcDb['createCustomerHistory'](_0x208582,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x77c2('0x96')](_0x208582)>=_0x294471[_0x77c2('0x97')]){_0x2915e0=ut[_0x77c2('0x98')](_0x208582,0xf,_0x77c2('0x99'));rpcDb[_0x77c2('0x8a')](_0x2915e0,_0x77c2('0xcf'));}else{rpcDb[_0x77c2('0x8a')](_0x208582,_0x77c2('0xcf'));}delete this['actions'][_0x1d2b07[_0x77c2('0x9b')]];}if(!(_0x208582[_0x77c2('0x69')]&&_0x584f3d==='16')){ut['updateOriginated'](_0x294471,'[callProgressDetectingCustomer]');logger[_0x77c2('0x76')](_0x77c2('0xd0'),_0x208582[_0x77c2('0xa0')],'\x20Queue',_0x294471[_0x77c2('0x4f')],'originated:\x20',_0x294471[_0x77c2('0x4d')]);}if(_0x584f3d!=='ANSWER'){delete this['actions'][_0x1d2b07[_0x77c2('0x9b')]];delete this[_0x77c2('0x18')][_0x1d2b07[_0x77c2('0xd1')]];}}};Preview['prototype'][_0x77c2('0xd2')]=function(_0x1357da,_0x441137,_0x372606){if(_[_0x77c2('0xd3')](_0x441137)&&'object'!==typeof _0x441137){return;}if(_[_0x77c2('0xd3')](_0x372606)&&_0x77c2('0xd4')!==typeof _0x372606){return;}switch(_0x372606[_0x77c2('0xd5')]){case'0':ut[_0x77c2('0xd6')](_0x1357da,0x0,_0x77c2('0x94'));rpcDb[_0x77c2('0xd7')](_0x1357da,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x1357da,0x3,_0x77c2('0xd8'));rpcDb[_0x77c2('0xd7')](_0x1357da,_0x77c2('0xd9'));break;case'5':ut[_0x77c2('0xd6')](_0x1357da,0x5,_0x77c2('0xb4'));rpcDb[_0x77c2('0xd7')](_0x1357da,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x77c2('0xd6')](_0x1357da,0x8,'Congestion');rpcDb['createAgentHistory'](_0x1357da,_0x77c2('0xda'));break;case'22':ut[_0x77c2('0xd6')](_0x1357da,0x16,'AnswerAGI');rpcDb[_0x77c2('0xd7')](_0x1357da,_0x77c2('0xdb'));break;default:ut['logAgent'](_0x1357da,0xc,_0x372606[_0x77c2('0xd5')]);rpcDb[_0x77c2('0xd7')](_0x1357da,_0x77c2('0xda'));}ut[_0x77c2('0x6f')](_0x441137,_0x77c2('0xdc'));logger[_0x77c2('0x76')]('[originated][decrement][callProgressDetectingAgent]',_0x1357da[_0x77c2('0xa0')],'\x20Queue',_0x441137[_0x77c2('0x4f')],_0x77c2('0x66'),_0x441137[_0x77c2('0x4d')]);delete this[_0x77c2('0x18')][_0x1357da['uniqueid']];};Preview[_0x77c2('0x10')][_0x77c2('0xdd')]=function(_0x2a819c,_0x48b758,_0x53c3b5,_0x18b935,_0x57497a){var _0x3c54af=this;return new BPromise(function(_0x5714a8,_0x188b92){if(_['isNil'](_0x48b758)||_[_0x77c2('0x7a')](_0x48b758[_0x77c2('0xde')])||_['isNil'](_0x48b758['Contact'][_0x77c2('0xdf')])||_[_0x77c2('0x7a')](_0x48b758[_0x77c2('0x6c')])){_0x188b92(ut[_0x77c2('0x4c')](_0x77c2('0xe0'),_0x18b935,_0x57497a));return;}var _0x23c188=uuid['v4']();var _0x16edc8=_0x3c54af['campaignsPreview'][_0x48b758[_0x77c2('0x65')]['name']];var _0x350cf4=_0x53c3b5?_0x3c54af[_0x77c2('0x19')][_0x53c3b5]['id']:undefined;_0x3c54af[_0x77c2('0x18')][_0x23c188]=new Action(_0x48b758,_0x16edc8,_0x23c188,_0x53c3b5,_0x350cf4);var _0x3de8ac=_0x3c54af[_0x77c2('0x18')][_0x23c188];_0x3de8ac[_0x77c2('0xba')]=_0x18b935;_0x3de8ac[_0x77c2('0xbf')]=_0x57497a;_0x3de8ac[_0x77c2('0xe1')]=_0x53c3b5;if(_[_0x77c2('0xe2')](_0x2a819c)){_0x3c54af[_0x77c2('0xe3')](_0x3de8ac,_0x16edc8,_0x48b758,_0x53c3b5)[_0x77c2('0x79')](function(_0x4720c1){logger[_0x77c2('0x76')]('[Preview][execCall][success]',_0x77c2('0xe4')+_0x3de8ac['queue']+'\x20IdHopper:\x20'+_0x3de8ac['idContact'],JSON[_0x77c2('0x67')](_0x4720c1));ami[_0x77c2('0x29')](_0x77c2('0xe5'),ut[_0x77c2('0xa5')](_0x3de8ac,'called'));_0x5714a8(ut[_0x77c2('0x4c')](_0x77c2('0xe6')));})['catch'](function(_0x227204){ut[_0x77c2('0x59')](_0x77c2('0xe7'),_0x227204);_0x188b92(ut[_0x77c2('0x4c')](_0x77c2('0xe8'),_0x18b935,_0x57497a));});}else{_0x16edc8['outboundBlacklistCallsDay']+=0x1;ut[_0x77c2('0xe9')](_0x3de8ac);rpcDb[_0x77c2('0xea')](_0x3de8ac,'[Blacklist][error]');delete _0x3c54af[_0x77c2('0x18')][_0x23c188];_0x188b92(ut['message'](_0x77c2('0xeb'),_0x18b935,_0x57497a));}});};Preview['prototype'][_0x77c2('0x8f')]=function(_0x55cf9f){return!_[_0x77c2('0x7a')](_0x55cf9f)&&!_['isNil'](_0x55cf9f['name'])&&!_['isNil'](_0x55cf9f[_0x77c2('0x50')])&&_0x55cf9f[_0x77c2('0x50')]&&!_[_0x77c2('0x7a')](this[_0x77c2('0x17')][util[_0x77c2('0x54')](_0x77c2('0xec'),_0x55cf9f['name'])])&&!_[_0x77c2('0x7a')](this[_0x77c2('0x17')][util['format']('SIP/%s',_0x55cf9f[_0x77c2('0x4f')])]['status'])&&(this[_0x77c2('0x17')][util['format']('SIP/%s',_0x55cf9f[_0x77c2('0x4f')])][_0x77c2('0x6d')]==='reachable'||this[_0x77c2('0x17')][util[_0x77c2('0x54')](_0x77c2('0xec'),_0x55cf9f['name'])][_0x77c2('0x6d')]===_0x77c2('0xed'));};Preview[_0x77c2('0x10')][_0x77c2('0x7f')]=function(_0x58e98e,_0x3cbd20){var _0x2876b6=this;return new BPromise(function(_0x8f18fe,_0x34d377){_0x2876b6[_0x77c2('0xee')](_0x58e98e,_0x3cbd20)[_0x77c2('0x79')](function(_0x49ec23){_0x8f18fe(_['pick'](_0x49ec23,[_0x77c2('0x4c')]));})['catch'](function(_0x2ae676){if(_0x2ae676[_0x77c2('0xef')]){rpcDb['unlockContact'](_0x58e98e);}if(_0x2ae676['active']){rpcDb[_0x77c2('0xc8')](_0x58e98e);}_0x34d377(_[_0x77c2('0x6a')](_0x2ae676,[_0x77c2('0x4c')]));});});};Preview[_0x77c2('0x10')]['execRun']=function(_0x470647,_0x17f0f6){var _0x1731d8=this;return new BPromise(function(_0x19e981,_0x3ba6a8){var _0x5eaeb,_0x26eb5d;rpcDb[_0x77c2('0xf0')](_0x470647)[_0x77c2('0x79')](function(_0x6e2784){if(!_[_0x77c2('0x7a')](_0x6e2784[0x0])){_0x26eb5d=_0x6e2784[0x0][_0x77c2('0xf1')]?![]:!![];_0x5eaeb=_0x6e2784[0x0][_0x77c2('0xf1')]?!![]:![];_0x5eaeb=_0x17f0f6?!![]:_0x5eaeb;}var _0x1ac81f=_0x1731d8[_0x77c2('0xf2')](_0x6e2784);if(_0x1ac81f[_0x77c2('0xf3')]){rpcDb[_0x77c2('0xf4')](_['pick'](_0x6e2784[0x0],[_0x77c2('0x6c'),_0x77c2('0xf5')]))['then'](function(_0x529d7e){_0x1731d8['checkInBlack'](_0x529d7e,_0x6e2784[0x0],_0x17f0f6,_0x26eb5d,_0x5eaeb)[_0x77c2('0x79')](function(_0x20f64a){_0x19e981(_0x20f64a);})['catch'](function(_0x505c93){_0x3ba6a8(_0x505c93);});})[_0x77c2('0x8b')](function(_0x55b4d5){ut[_0x77c2('0x59')](_0x77c2('0xf6'),_0x55b4d5);_0x3ba6a8(ut[_0x77c2('0x4c')](_0x77c2('0xf7'),_0x26eb5d,_0x5eaeb));});}else{_0x3ba6a8(ut['message'](_0x1ac81f[_0x77c2('0x4c')],_0x26eb5d,_0x5eaeb));}})[_0x77c2('0x8b')](function(_0x5042d1){ut[_0x77c2('0x59')](_0x77c2('0xf8'),_0x5042d1);_0x3ba6a8(ut[_0x77c2('0x4c')](_0x77c2('0xf7'),![],!![]));});});};Preview[_0x77c2('0x10')][_0x77c2('0xf2')]=function(_0x2c7872){if(_[_0x77c2('0x7a')](_0x2c7872)||_[_0x77c2('0xe2')](_0x2c7872)||!_[_0x77c2('0x7a')](_0x2c7872[0x0][_0x77c2('0xf9')])&&_[_0x77c2('0x7a')](_0x2c7872[0x0][_0x77c2('0xf9')][_0x77c2('0x4f')])){ut[_0x77c2('0x59')](_0x77c2('0xfa'),_0x2c7872);return{'isValid':![],'message':_0x77c2('0xfb')};}var _0x105eeb=this[_0x77c2('0x15')][_0x2c7872[0x0][_0x77c2('0x65')]['name']];_0x105eeb['message']=_0x77c2('0x92');if(_[_0x77c2('0x7a')](_0x105eeb)){ut[_0x77c2('0x59')](_0x77c2('0xfc'),_0x105eeb);return{'isValid':![],'message':_0x77c2('0xfd')};}if(!this['isTrunkReachable'](_0x105eeb['Trunk'])){ut[_0x77c2('0x59')](_0x77c2('0xfe'),_0x77c2('0xff')+_0x105eeb['name']+_0x77c2('0x100'));if(!this['isTrunkReachable'](_0x105eeb['TrunkBackup'])){ut[_0x77c2('0x59')](_0x77c2('0xfe'),_0x105eeb[_0x77c2('0x4f')]+_0x77c2('0x101'));return{'isValid':![],'message':_0x77c2('0x102')};}}if(!ut[_0x77c2('0x103')](_0x105eeb[_0x77c2('0x36')])){ut[_0x77c2('0x59')](_0x77c2('0x104'),_0x105eeb[_0x77c2('0x4f')]+_0x77c2('0x105'));return{'isValid':![],'message':_0x77c2('0xff')+_0x105eeb['name']+_0x77c2('0x105')};}return{'isValid':!![],'message':_0x77c2('0x106')};};Preview[_0x77c2('0x10')][_0x77c2('0xe3')]=function(_0x731bc0,_0x32a4b8,_0x526ab6,_0x2f5c26){var _0x54a9ff=this;return new BPromise(function(_0x53f283,_0x270253){var _0x8f449e=_0x731bc0[_0x77c2('0xa0')];var _0x2d4843=_0x54a9ff[_0x77c2('0x8f')](_0x32a4b8['Trunk'])?util[_0x77c2('0x54')](_0x77c2('0x107'),_0x32a4b8[_0x77c2('0x4e')][_0x77c2('0x4f')],_[_0x77c2('0x7a')](_0x32a4b8[_0x77c2('0x39')])?'':_0x32a4b8[_0x77c2('0x39')][_0x77c2('0x108')]()||'',_0x32a4b8['dialCutDigit']>0x0?_0x526ab6[_0x77c2('0xde')]['phone']['substring'](_0x32a4b8[_0x77c2('0x109')]):_0x526ab6[_0x77c2('0xde')][_0x77c2('0xdf')]):util[_0x77c2('0x54')](_0x77c2('0x107'),_[_0x77c2('0x7a')](_0x32a4b8['TrunkBackup'])?_0x32a4b8['Trunk'][_0x77c2('0x4f')]:_0x32a4b8[_0x77c2('0x90')]['name'],_[_0x77c2('0x7a')](_0x32a4b8[_0x77c2('0x39')])?'':_0x32a4b8[_0x77c2('0x39')][_0x77c2('0x108')]()||'',_0x32a4b8[_0x77c2('0x109')]>0x0?_0x526ab6['Contact'][_0x77c2('0xdf')][_0x77c2('0x10a')](_0x32a4b8[_0x77c2('0x109')]):_0x526ab6[_0x77c2('0xde')][_0x77c2('0xdf')]);var _0x153190=_0x54a9ff[_0x77c2('0x8f')](_0x32a4b8[_0x77c2('0x4e')])?ut[_0x77c2('0x10b')](_0x32a4b8[_0x77c2('0x4e')][_0x77c2('0x10c')],_0x32a4b8['dialOriginateCallerIdName'],_0x32a4b8[_0x77c2('0x10d')]>0x0?ut[_0x77c2('0x10e')](_0x32a4b8[_0x77c2('0x10f')],_0x32a4b8[_0x77c2('0x10d')]):_0x32a4b8['dialOriginateCallerIdNumber']):ut[_0x77c2('0x10b')](_['isNil'](_0x32a4b8[_0x77c2('0x90')])?_0x32a4b8[_0x77c2('0x4e')][_0x77c2('0x10c')]:_0x32a4b8[_0x77c2('0x90')][_0x77c2('0x10c')],_0x32a4b8[_0x77c2('0x110')],_0x32a4b8[_0x77c2('0x10d')]>0x0?ut[_0x77c2('0x10e')](_0x32a4b8[_0x77c2('0x10f')],_0x32a4b8[_0x77c2('0x10d')]):_0x32a4b8[_0x77c2('0x10f')]);if(_0x153190){_0x731bc0['originatecalleridname']=ut['extractCalleridName'](_0x153190);_0x731bc0[_0x77c2('0x111')]=ut['extractCalleridNumber'](_0x153190);}var _0x3c0317=ut[_0x77c2('0x112')](_0x32a4b8,_0x526ab6,_0x2d4843,_0x153190,_0x8f449e,_0x731bc0);_['merge'](_0x731bc0,ut[_0x77c2('0x113')](_0x3c0317));_0x731bc0[_0x77c2('0x82')]=moment()[_0x77c2('0x54')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x77c2('0x114')](ut['variablesAction'](_0x731bc0,_0x32a4b8,_0x3c0317,_0x731bc0['activeContact'],_0x2f5c26))[_0x77c2('0x79')](function(_0x384b46){_0x32a4b8[_0x77c2('0x4d')]+=0x1;logger[_0x77c2('0x76')](_0x77c2('0x115'),_0x8f449e,'\x20Queue',_0x32a4b8[_0x77c2('0x4f')],_0x77c2('0x66'),_0x32a4b8['originated']);_0x53f283(_0x384b46);})[_0x77c2('0x8b')](function(_0x519eb0){ut[_0x77c2('0xd6')](_0x731bc0,0xe,_0x77c2('0x116'));rpcDb[_0x77c2('0xd7')](_0x731bc0,_0x77c2('0x117'));_0x270253(_0x519eb0);});});};Preview[_0x77c2('0x10')][_0x77c2('0x22')]=function(_0x5487f3){if(this[_0x77c2('0x18')][_0x5487f3[_0x77c2('0x9b')]]){this[_0x77c2('0x18')][_0x5487f3[_0x77c2('0x9b')]][_0x77c2('0x118')]=_0x5487f3[_0x77c2('0x118')];}};Preview[_0x77c2('0x10')][_0x77c2('0x1b')]=function(_0x131ba6){var _0x130ab0=this;var _0x4498b6=this['actions'][_0x131ba6[_0x77c2('0x119')]];if(_0x4498b6){if(_0x4498b6[_0x77c2('0xe1')]&&this[_0x77c2('0x19')][_0x4498b6[_0x77c2('0xe1')]]){ut[_0x77c2('0x11a')](_0x4498b6,this[_0x77c2('0x19')][_0x4498b6[_0x77c2('0xe1')]][_0x77c2('0x4f')],this[_0x77c2('0x19')][_0x4498b6[_0x77c2('0xe1')]]['id']);}var _0x493f5a=_[_0x77c2('0x11b')](_0x4498b6);_0x493f5a[_0x77c2('0x9d')]=moment()[_0x77c2('0x54')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4a4aed=_0x130ab0[_0x77c2('0x15')][_0x4498b6[_0x77c2('0x68')]];if(ut['isFailure'](_0x131ba6['response'])){if(_0x4498b6['unlockAgent']){rpcDb[_0x77c2('0x11c')](_0x4498b6['idContact']);}if(_0x4498b6[_0x77c2('0xbf')]){rpcDb[_0x77c2('0xc8')](_0x4498b6['idContact']);}ami[_0x77c2('0x29')](_0x77c2('0x11d'),ut['buildObj'](_0x4498b6,_0x77c2('0x11e')));this['callProgressDetectingAgent'](_0x493f5a,_0x4a4aed,_0x131ba6);}else{_0x4498b6[_0x77c2('0x82')]=moment()['format'](_0x77c2('0x83'));ut[_0x77c2('0xd6')](_0x493f5a,0x4,_0x77c2('0xa9'));rpcDb[_0x77c2('0xd7')](_0x493f5a,_0x77c2('0x11f'));}}};Preview[_0x77c2('0x10')]['syncHangup']=function(_0x56c620){var _0x3d0236=this;var _0x1b5334=this[_0x77c2('0x18')][_0x56c620[_0x77c2('0x9b')]];var _0x4402c4;if(_0x1b5334){_0x4402c4=this[_0x77c2('0x15')][_0x1b5334[_0x77c2('0x68')]];logger[_0x77c2('0x76')](_0x77c2('0x120'),_0x56c620['linkedid'],_0x77c2('0xb0'),_0x4402c4[_0x77c2('0x4f')],_0x77c2('0xa1'),_0x4402c4[_0x77c2('0x2e')]);}if(this[_0x77c2('0x18')][_0x56c620[_0x77c2('0x9b')]]&&_0x56c620[_0x77c2('0x9b')]!==_0x56c620[_0x77c2('0xa0')]){if(_0x56c620[_0x77c2('0x121')]==='16'&&this[_0x77c2('0x18')][_0x56c620['linkedid']][_0x77c2('0x69')]){this[_0x77c2('0x93')](_0x56c620,_0x56c620[_0x77c2('0x9b')],_0x56c620[_0x77c2('0x121')]);}else if(this[_0x77c2('0x18')][_0x56c620[_0x77c2('0x9b')]][_0x77c2('0x69')]){logger[_0x77c2('0x76')](_0x77c2('0x122'),_0x56c620[_0x77c2('0x9b')],_0x56c620[_0x77c2('0x121')],_0x77c2('0xb0'),_0x4402c4[_0x77c2('0x4f')],'pTalking:\x20',_0x4402c4[_0x77c2('0x2e')]);this[_0x77c2('0x93')](_0x56c620,_0x56c620[_0x77c2('0x9b')],_0x56c620[_0x77c2('0x121')]);}}else if(_0x1b5334&&_[_0x77c2('0x7a')](_0x1b5334[_0x77c2('0x123')])&&_0x4402c4['dialQueueProject']&&_0x56c620['linkedid']===_0x56c620[_0x77c2('0xa0')]&&_[_0x77c2('0x7a')](_0x56c620['reason'])&&_0x56c620['cause']==='16'&&_0x56c620['channelstate']==='6'&&_[_0x77c2('0xd3')](_0x1b5334[_0x77c2('0x124')])){if(_0x1b5334[_0x77c2('0xba')]){rpcDb[_0x77c2('0x11c')](_0x1b5334[_0x77c2('0xc9')]);}if(_0x1b5334['activeContact']){rpcDb[_0x77c2('0xc8')](_0x1b5334[_0x77c2('0xc9')]);}_0x56c620[_0x77c2('0xd5')]='22';this[_0x77c2('0xd2')](_0x1b5334,_0x4402c4,_0x56c620);}else if(_0x1b5334&&_0x1b5334[_0x77c2('0x124')]){if(_0x56c620[_0x77c2('0x121')]==='16'&&this[_0x77c2('0x18')][_0x56c620['linkedid']][_0x77c2('0x69')]){logger[_0x77c2('0x76')]('[syncHangup][talking][transfer]',_0x56c620[_0x77c2('0x9b')],_0x56c620['cause'],_0x77c2('0xb0'),_0x4402c4['name'],_0x77c2('0xa1'),_0x4402c4['pTalking']);this['callProgressDetectingCustomer'](_0x56c620,_0x56c620[_0x77c2('0x9b')],_0x56c620['cause']);}else if(this[_0x77c2('0x18')][_0x56c620[_0x77c2('0x9b')]]['dialAnswer']){logger[_0x77c2('0x76')]('[syncHangup][talking][cause]',_0x56c620[_0x77c2('0x9b')],_0x56c620[_0x77c2('0x121')],_0x77c2('0xb0'),_0x4402c4[_0x77c2('0x4f')],_0x77c2('0xa1'),_0x4402c4['pTalking']);this[_0x77c2('0x93')](_0x56c620,_0x56c620[_0x77c2('0x9b')],_0x56c620[_0x77c2('0x121')]);}}};Preview['prototype'][_0x77c2('0x20')]=function(_0xfaa721){if(this[_0x77c2('0x18')][_0xfaa721[_0x77c2('0xd1')]]&&_0xfaa721['destlinkedid']!==_0xfaa721[_0x77c2('0x125')]){this[_0x77c2('0x93')](_0xfaa721,_0xfaa721[_0x77c2('0xd1')],_0xfaa721[_0x77c2('0xce')]);}};Preview[_0x77c2('0x10')][_0x77c2('0x1f')]=function(_0x10156c){if(this[_0x77c2('0x18')][_0x10156c['linkedid']]&&_0x10156c[_0x77c2('0x9b')]!==_0x10156c[_0x77c2('0xa0')]&&!this[_0x77c2('0x18')][_0x10156c['linkedid']][_0x77c2('0x69')]){if(_0x10156c[_0x77c2('0x121')]==='1'){this[_0x77c2('0x93')](_0x10156c,_0x10156c[_0x77c2('0x9b')],_0x10156c[_0x77c2('0x121')]);}}};Preview['prototype']['addVariable']=function(_0x4f485f,_0x552527,_0x2a12ea){if(this['actions'][_0x4f485f]){if(_[_0x77c2('0x7a')](this[_0x77c2('0x18')][_0x4f485f]['variables'])){this['actions'][_0x4f485f][_0x77c2('0x126')]={};}this['actions'][_0x4f485f][_0x77c2('0x126')][_0x552527]=_0x2a12ea;}};Preview[_0x77c2('0x10')][_0x77c2('0x23')]=function(_0x2111ec){try{if(!_[_0x77c2('0x7a')](_0x2111ec)){if(ut[_0x77c2('0x127')](_[_0x77c2('0x128')](_0x2111ec['variable'])[0x0])){this[_0x77c2('0x129')](_0x2111ec[_0x77c2('0xa0')],_['keys'](_0x2111ec[_0x77c2('0x12a')])[0x0],_0x2111ec['value']);}}}catch(_0x59e722){logger['error'](_0x77c2('0x12b'),util[_0x77c2('0x12c')](_0x59e722,{'showHidden':![],'depth':null}));}};Preview[_0x77c2('0x10')][_0x77c2('0x25')]=function(_0x5248f1){if(_0x5248f1){if(this[_0x77c2('0x18')][_0x5248f1[_0x77c2('0x12d')]]){this[_0x77c2('0x18')][_0x5248f1['transfertargetlinkedid']][_0x77c2('0x124')]=!![];}}};Preview['prototype'][_0x77c2('0x27')]=function(_0x59cb03){if(_0x59cb03){if(this['actions'][_0x59cb03[_0x77c2('0x12e')]]){this['actions'][_0x59cb03[_0x77c2('0x12e')]]['transfer']=!![];}}};module[_0x77c2('0x12f')]=Preview; \ No newline at end of file +var _0xac84=['loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','Trunk','active','callerid','Interval','stringify','md5','format','voice_queue:save','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','message','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','originated','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','info','[action]','size','getContactRecallMe','agents','then','length','scheduledat','dialRecallMeTimeout','run','[RecallMe]','logger2','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[getContactRecallMe]','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','buildObj','complete','outboundAnswerCallsDay','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','linkedid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','activeContact','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logBusy]','Congestion','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','Call\x20failed','createHistory','[Blacklist][error]','SIP/%s','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','dialPrefix','dialCutDigit','SIP/%s/%s%s','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','clone','response','custom:agentringnoanswer','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','callProgressDetectingCustomer','destuniqueid','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xac84,0xfb));var _0x4ac8=function(_0x5150df,_0x19a3ec){_0x5150df=_0x5150df-0x0;var _0x14e718=_0xac84[_0x5150df];return _0x14e718;};'use strict';var util=require(_0x4ac8('0x0'));var _=require('lodash');var BPromise=require(_0x4ac8('0x1'));var uuid=require(_0x4ac8('0x2'));var moment=require(_0x4ac8('0x3'));var md5=require('md5');var Redis=require(_0x4ac8('0x4'));var config=require(_0x4ac8('0x5'));var logger=require(_0x4ac8('0x6'))(_0x4ac8('0x7'));var loggerAction=require(_0x4ac8('0x6'))(_0x4ac8('0x8'));var ami=require(_0x4ac8('0x9'));var rpcDb=require(_0x4ac8('0xa'));var Action=require(_0x4ac8('0xb'));var ut=require(_0x4ac8('0xc'));config[_0x4ac8('0xd')]=_['defaults'](config[_0x4ac8('0xd')],{'host':_0x4ac8('0xe'),'port':0x18eb});var io=require(_0x4ac8('0xf'))(new Redis(config[_0x4ac8('0xd')]));var Sequence=function(){};Sequence[_0x4ac8('0x10')][_0x4ac8('0x11')]=function(_0xba88ac){this[_0x4ac8('0x12')]=this[_0x4ac8('0x12')]?this[_0x4ac8('0x12')][_0x4ac8('0x13')](_0xba88ac):_0xba88ac();};function Preview(_0x4cdb76){this['sequence']=new Sequence();this[_0x4ac8('0x14')]=_0x4cdb76[_0x4ac8('0x15')];this[_0x4ac8('0x16')]=_0x4cdb76[_0x4ac8('0x16')];this[_0x4ac8('0x17')]={};this['agents']=_0x4cdb76['agents'];this[_0x4ac8('0x18')]=0x0;ami['on'](_0x4ac8('0x19'),this[_0x4ac8('0x1a')][_0x4ac8('0x1b')](this));ami['on'](_0x4ac8('0x1c'),this[_0x4ac8('0x1d')][_0x4ac8('0x1b')](this));ami['on']('hanguprequest',this[_0x4ac8('0x1e')][_0x4ac8('0x1b')](this));ami['on']('dialend',this[_0x4ac8('0x1f')][_0x4ac8('0x1b')](this));ami['on'](_0x4ac8('0x20'),this[_0x4ac8('0x21')]['bind'](this));ami['on'](_0x4ac8('0x22'),this['syncVarSet'][_0x4ac8('0x1b')](this));ami['on'](_0x4ac8('0x23'),this['syncAttendedTransfer'][_0x4ac8('0x1b')](this));ami['on'](_0x4ac8('0x24'),this[_0x4ac8('0x25')][_0x4ac8('0x1b')](this));this[_0x4ac8('0x26')](this[_0x4ac8('0x14')]);}function emit(_0x1c3724,_0x28756a,_0xe5a1b4){io['to'](_0x1c3724)[_0x4ac8('0x27')](_0x28756a,_0xe5a1b4);}function emitCampaignPreview(_0x32582a){if(_0x32582a[_0x4ac8('0x28')]==='outbound'){var _0xb6cf0={'id':_0x32582a['id'],'name':_0x32582a[_0x4ac8('0x29')],'strategy':_0x32582a[_0x4ac8('0x2a')],'answered':_0x32582a[_0x4ac8('0x2b')],'available':_0x32582a[_0x4ac8('0x2c')],'loggedIn':_0x32582a[_0x4ac8('0x2d')],'pTalking':_0x32582a['pTalking'],'sumBillable':_0x32582a[_0x4ac8('0x2e')],'sumDuration':_0x32582a[_0x4ac8('0x2f')],'sumHoldTime':_0x32582a[_0x4ac8('0x30')]||0x0,'talking':_0x32582a['talking'],'total':_0x32582a[_0x4ac8('0x31')],'type':_0x32582a['type'],'unmanaged':_0x32582a['unmanaged'],'abandoned':_0x32582a[_0x4ac8('0x32')],'waiting':_0x32582a[_0x4ac8('0x33')],'loggedInDb':_0x32582a[_0x4ac8('0x34')],'dialActive':_0x32582a['dialActive'],'dialMethod':_0x32582a[_0x4ac8('0x35')],'dialOriginateCallerIdName':_0x32582a[_0x4ac8('0x36')],'dialOriginateCallerIdNumber':_0x32582a[_0x4ac8('0x37')],'dialOriginateTimeout':_0x32582a[_0x4ac8('0x38')],'dialPrefix':_0x32582a['dialPrefix'],'outboundAnswerAgiCallsDay':_0x32582a[_0x4ac8('0x39')],'outboundAnswerCallsDay':_0x32582a['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x32582a[_0x4ac8('0x3a')],'outboundBusyCallsDay':_0x32582a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x32582a[_0x4ac8('0x3b')],'outboundDropCallsDayACS':_0x32582a[_0x4ac8('0x3c')],'outboundDropCallsDayCallersExit':_0x32582a[_0x4ac8('0x3d')],'outboundDropCallsDayTimeout':_0x32582a['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x32582a[_0x4ac8('0x3e')],'outboundNoSuchCallsDay':_0x32582a[_0x4ac8('0x3f')],'outboundOriginateFailureCallsDay':_0x32582a['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x32582a[_0x4ac8('0x40')],'outboundRejectCallsDay':_0x32582a[_0x4ac8('0x41')],'outboundUnknownCallsDay':_0x32582a[_0x4ac8('0x42')],'predictiveIntervalAnsweredCalls':_0x32582a[_0x4ac8('0x43')],'predictiveIntervalAvgHoldtime':_0x32582a[_0x4ac8('0x44')],'predictiveIntervalAvgTalktime':_0x32582a[_0x4ac8('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x32582a[_0x4ac8('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x32582a['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x32582a[_0x4ac8('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x32582a[_0x4ac8('0x48')],'predictiveIntervalHitRate':_0x32582a['predictiveIntervalHitRate'],'predictiveIntervalLowerLimit':_0x32582a['predictiveIntervalLowerLimit'],'predictiveIntervalMultiplicativeFactor':_0x32582a[_0x4ac8('0x49')],'predictiveIntervalPauses':_0x32582a[_0x4ac8('0x4a')],'predictiveIntervalTotalCalls':_0x32582a[_0x4ac8('0x4b')],'message':_0x32582a['message'],'originated':_0x32582a['originated']};if(_0x32582a['Trunk']){_0xb6cf0['Trunk']={'id':_0x32582a[_0x4ac8('0x4c')]['id'],'name':_0x32582a[_0x4ac8('0x4c')][_0x4ac8('0x29')],'active':_0x32582a[_0x4ac8('0x4c')][_0x4ac8('0x4d')],'callerid':_0x32582a[_0x4ac8('0x4c')][_0x4ac8('0x4e')]};}if(_0x32582a['Interval']){_0xb6cf0['Interval']={'id':_0x32582a['Interval']['id'],'name':_0x32582a[_0x4ac8('0x4f')][_0x4ac8('0x29')]};}var _0x5758fe=md5(JSON[_0x4ac8('0x50')](_0xb6cf0));if(_0x32582a['md5']!==_0x5758fe){_0x32582a[_0x4ac8('0x51')]=_0x5758fe;emit(util[_0x4ac8('0x52')]('voice:queue:%s',_0xb6cf0['name']),_0x4ac8('0x53'),_0xb6cf0);}}}function emitVoiceQueueChannelRemove(_0x407f72){emit(util['format'](_0x4ac8('0x54'),_0x407f72['name']),_0x4ac8('0x55'),_0x407f72);}function notSendMessagesQueue(_0x48bef5){if(_0x48bef5[_0x4ac8('0x56')]){if(_0x48bef5['originated']===0x0&&_0x48bef5[_0x4ac8('0x57')]===0x0){_0x48bef5[_0x4ac8('0x56')]=![];_0x48bef5['available']=0x0;_0x48bef5[_0x4ac8('0x58')]=0x0;_0x48bef5['message']=_0x4ac8('0x59');ut[_0x4ac8('0x5a')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x48bef5[_0x4ac8('0x29')]+_0x4ac8('0x5b'));}else{_0x48bef5[_0x4ac8('0x5c')]=_0x4ac8('0x5d');ut[_0x4ac8('0x5a')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x48bef5[_0x4ac8('0x29')]+_0x4ac8('0x5e'));}emitCampaignPreview(_0x48bef5);}}Preview[_0x4ac8('0x10')][_0x4ac8('0x26')]=function(){var _0x214a2a=this;setInterval(function(){_0x214a2a[_0x4ac8('0x5f')]();},0x7cf);};Preview[_0x4ac8('0x10')][_0x4ac8('0x5f')]=function(){var _0x3f7161=this[_0x4ac8('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x580b68 in _0x3f7161){if(_0x3f7161[_0x4ac8('0x60')](_0x580b68)&&(_0x3f7161[_0x580b68][_0x4ac8('0x35')]===_0x4ac8('0x7')||_0x3f7161[_0x580b68][_0x4ac8('0x35')]===_0x4ac8('0x61'))&&_0x3f7161[_0x580b68][_0x4ac8('0x28')]==='outbound'){if(this[_0x4ac8('0x18')]>0x7){this[_0x4ac8('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x3f7161[_0x4ac8('0x60')](_0x580b68)&&_0x3f7161[_0x580b68]['dialMethod']===_0x4ac8('0x7')&&_0x3f7161[_0x580b68]['type']===_0x4ac8('0x62')){if(_0x3f7161[_0x580b68][_0x4ac8('0x63')]){this[_0x4ac8('0x64')](_0x3f7161[_0x580b68]);this[_0x4ac8('0x65')](_0x3f7161[_0x580b68]);}else{notSendMessagesQueue(_0x3f7161[_0x580b68]);}}}};Preview[_0x4ac8('0x10')][_0x4ac8('0x66')]=function(_0x5f45b9){var _0xb9152b=this;this[_0x4ac8('0x67')][_0x4ac8('0x11')](function(){if(!_[_0x4ac8('0x68')](_0xb9152b['actions'][_0x5f45b9])){loggerAction['info'](_0x4ac8('0x69'),_0x5f45b9,_0x4ac8('0x6a'),_0xb9152b[_0x4ac8('0x17')][_0x5f45b9][_0x4ac8('0x6b')],_0x4ac8('0x6c'),JSON['stringify'](_0xb9152b[_0x4ac8('0x14')][_0xb9152b[_0x4ac8('0x17')][_0x5f45b9][_0x4ac8('0x6b')]][_0x4ac8('0x6d')]),_0x4ac8('0x6e'),JSON['stringify'](_0xb9152b[_0x4ac8('0x14')][_0xb9152b[_0x4ac8('0x17')][_0x5f45b9][_0x4ac8('0x6b')]][_0x4ac8('0x57')]),JSON[_0x4ac8('0x50')](_0xb9152b['actions'][_0x5f45b9][_0x4ac8('0x6f')]),JSON['stringify'](_[_0x4ac8('0x70')](_0xb9152b[_0x4ac8('0x17')][_0x5f45b9],[_0x4ac8('0x71'),_0x4ac8('0x72'),_0x4ac8('0x73'),_0x4ac8('0x74')])));return ami[_0x4ac8('0x75')]({'action':_0x4ac8('0x76'),'channel':_0xb9152b['actions'][_0x5f45b9]['channel']})[_0x4ac8('0x77')](function(_0x35e82f){if(_0x35e82f['message']===_0x4ac8('0x78')){setTimeout(function(){if(_0xb9152b[_0x4ac8('0x17')][_0x5f45b9]){ut[_0x4ac8('0x79')](_0xb9152b['campaignsPreview'][_0xb9152b[_0x4ac8('0x17')][_0x5f45b9][_0x4ac8('0x6b')]],_0x4ac8('0x7a'));if(_0xb9152b['actions'][_0x5f45b9][_0x4ac8('0x6f')]===!![]){ut[_0x4ac8('0x7b')](_0xb9152b[_0x4ac8('0x14')][_0xb9152b[_0x4ac8('0x17')][_0x5f45b9][_0x4ac8('0x6b')]],_0x4ac8('0x7a'));ut[_0x4ac8('0x7c')](_0x4ac8('0x7d')+_0x5f45b9,_0xb9152b[_0x4ac8('0x17')][_0x5f45b9][_0x4ac8('0x6b')]);}ut[_0x4ac8('0x7c')](_0x4ac8('0x7e')+_0x5f45b9,_0xb9152b['actions'][_0x5f45b9][_0x4ac8('0x6b')]);delete _0xb9152b[_0x4ac8('0x17')][_0x5f45b9];}},0x2328);}});}});};Preview[_0x4ac8('0x10')][_0x4ac8('0x7f')]=function(){var _0xa6d2d9=this;loggerAction[_0x4ac8('0x80')](_0x4ac8('0x81'),_[_0x4ac8('0x82')](this['actions']));for(var _0x366b20 in this[_0x4ac8('0x17')]){if(_0xa6d2d9[_0x4ac8('0x17')][_0x4ac8('0x60')](_0x366b20)){_0xa6d2d9[_0x4ac8('0x66')](_0x366b20);}}};Preview[_0x4ac8('0x10')][_0x4ac8('0x65')]=function(_0x6527ec){var _0x5d9541=this;rpcDb[_0x4ac8('0x83')](_0x6527ec['id'],ut['agentReadyId'](this[_0x4ac8('0x84')]))[_0x4ac8('0x85')](function(_0x177e14){if(!_[_0x4ac8('0x68')](_0x177e14)){for(var _0x1348f8=0x0;_0x1348f8<_0x177e14[_0x4ac8('0x86')];_0x1348f8+=0x1){if(ut['getDiff'](_0x177e14[_0x1348f8][_0x4ac8('0x87')])<_0x6527ec[_0x4ac8('0x88')]*0x3c){_0x5d9541[_0x4ac8('0x89')](_0x177e14[_0x1348f8]['id'])[_0x4ac8('0x85')](ut['logger2'](_0x4ac8('0x8a')))['catch'](ut[_0x4ac8('0x8b')](_0x4ac8('0x8a')));}else{var _0x145bd9=new Action(_0x177e14[_0x1348f8],_0x6527ec);_0x145bd9[_0x4ac8('0x8c')]=moment()['format'](_0x4ac8('0x8d'));_0x6527ec[_0x4ac8('0x40')]+=0x1;ut[_0x4ac8('0x8e')](_0x145bd9,0x17,_0x4ac8('0x8f'));if(_0x6527ec[_0x4ac8('0x90')]){rpcDb[_0x4ac8('0x91')](ut[_0x4ac8('0x92')](_0x177e14[_0x1348f8]));rpcDb['createCustomerHistory'](_0x145bd9,_0x4ac8('0x93'));}else{ut[_0x4ac8('0x8e')](_0x145bd9,0x16,_0x4ac8('0x94'));rpcDb[_0x4ac8('0x95')](_0x145bd9,'[HistoryRecallClose]');rpcDb[_0x4ac8('0x96')](_0x145bd9,'[HistoryRecallClose]');}}}}})[_0x4ac8('0x77')](ut[_0x4ac8('0x8b')](_0x4ac8('0x97')));};Preview[_0x4ac8('0x10')][_0x4ac8('0x64')]=function(_0x188818){_0x188818[_0x4ac8('0x56')]=!![];if(ut['IsNotLoggedIn'](_0x188818['loggedIn'])){_0x188818['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0x4ac8('0x98')](_0x188818[_0x4ac8('0x63')])){_0x188818['message']='NOT_ACTIVE';}else if(!this[_0x4ac8('0x99')](_0x188818['Trunk'])){if(!this[_0x4ac8('0x99')](_0x188818['TrunkBackup'])){_0x188818['message']=_0x4ac8('0x9a');}else{_0x188818[_0x4ac8('0x5c')]=_0x4ac8('0x9b');}}else{_0x188818[_0x4ac8('0x5c')]=_0x4ac8('0x9b');}emitCampaignPreview(_0x188818);};Preview[_0x4ac8('0x10')]['callProgressDetectingCustomer']=function(_0x43818b,_0x4897c6,_0x59f7ed){var _0x53854c=this;var _0x37ed32=this['actions'][_0x4897c6];var _0x4a455e=this[_0x4ac8('0x14')][_0x37ed32[_0x4ac8('0x6b')]];var _0x299db7;if(_0x4a455e){switch(_0x59f7ed){case'1':_0x4a455e[_0x4ac8('0x3f')]+=0x1;_0x37ed32[_0x4ac8('0x9c')]=ut[_0x4ac8('0x9d')](_0x37ed32);ut[_0x4ac8('0x8e')](_0x37ed32,0x0,_0x4ac8('0x9e'));rpcDb[_0x4ac8('0x95')](_0x37ed32,_0x4ac8('0x9f'));if(ut[_0x4ac8('0x9d')](_0x37ed32)>=_0x4a455e['dialGlobalMaxRetry']){_0x299db7=ut[_0x4ac8('0xa0')](_0x37ed32,0xf,_0x4ac8('0xa1'));rpcDb[_0x4ac8('0x96')](_0x299db7,_0x4ac8('0xa2'));}else{rpcDb[_0x4ac8('0x96')](_0x37ed32,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this['actions'][_0x43818b['linkedid']];break;case _0x4ac8('0xa3'):var _0x38dce5=moment()[_0x4ac8('0x52')](_0x4ac8('0x8d'));_0x37ed32[_0x4ac8('0xa4')]=_0x38dce5;_0x37ed32['answertime']=_0x38dce5;_0x37ed32[_0x4ac8('0x6f')]=!![];_0x4a455e[_0x4ac8('0x57')]+=0x1;logger[_0x4ac8('0x80')](_0x4ac8('0xa5'),_0x37ed32[_0x4ac8('0xa6')],_0x4ac8('0xa7'),_0x4a455e[_0x4ac8('0x29')],_0x4ac8('0x6e'),_0x4a455e[_0x4ac8('0x57')]);ami[_0x4ac8('0x27')](_0x4ac8('0xa8'),ut['buildObj'](_0x37ed32,_0x4ac8('0xa9')));if(_0x4a455e[_0x4ac8('0xaa')]){ami['emit'](_0x4ac8('0xab'),ut[_0x4ac8('0xac')](_0x37ed32));}break;case'16':ami[_0x4ac8('0x27')]('custom:agentcomplete',ut[_0x4ac8('0xad')](_0x37ed32,_0x4ac8('0xae')));emitVoiceQueueChannelRemove(ut[_0x4ac8('0xad')](_0x37ed32,_0x4ac8('0xae')));_0x4a455e[_0x4ac8('0xaf')]+=0x1;_0x4a455e[_0x4ac8('0x31')]+=0x1;_0x4a455e[_0x4ac8('0x2b')]+=0x1;ut[_0x4ac8('0x7b')](_0x4a455e,_0x4ac8('0xb0'));_0x37ed32[_0x4ac8('0x9c')]=ut[_0x4ac8('0x9d')](_0x37ed32);ut[_0x4ac8('0x8e')](_0x37ed32,0x4,_0x4ac8('0xb1'));rpcDb[_0x4ac8('0x95')](_0x37ed32,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x4ac8('0x96')](_0x37ed32,_0x4ac8('0xb2'));rpcDb[_0x4ac8('0xb3')](_0x37ed32);_0x4a455e[_0x4ac8('0x2f')]+=_0x37ed32['talktime'];_0x4a455e[_0x4ac8('0x2e')]+=_0x37ed32[_0x4ac8('0xb4')];logger['info']('[syncHangup][talking][decrement]',_0x37ed32[_0x4ac8('0xa6')],_0x4ac8('0xa7'),_0x4a455e['name'],_0x4ac8('0x6e'),_0x4a455e[_0x4ac8('0x57')]);delete this[_0x4ac8('0x17')][_0x43818b[_0x4ac8('0xb5')]];break;case _0x4ac8('0xb6'):_0x4a455e[_0x4ac8('0xb7')]+=0x1;_0x37ed32[_0x4ac8('0xb8')]+=0x1;_0x37ed32[_0x4ac8('0x9c')]=ut[_0x4ac8('0x9d')](_0x37ed32);ut[_0x4ac8('0x8e')](_0x37ed32,0x5,_0x4ac8('0xb9'));rpcDb[_0x4ac8('0x95')](_0x37ed32,_0x4ac8('0xba'));if(ut[_0x4ac8('0x9d')](_0x37ed32)>=_0x4a455e[_0x4ac8('0xbb')]){_0x299db7=ut[_0x4ac8('0xa0')](_0x37ed32,0xf,'Global');rpcDb[_0x4ac8('0x96')](_0x299db7,_0x4ac8('0xbc'));}else{if(_0x37ed32['countbusyretry']>=_0x4a455e[_0x4ac8('0xbd')]){rpcDb[_0x4ac8('0x96')](_0x37ed32,_0x4ac8('0xba'));}else{rpcDb[_0x4ac8('0xbe')](ut[_0x4ac8('0xbf')](_0x37ed32,'countbusyretry',_0x4a455e[_0x4ac8('0xc0')]),_0x37ed32[_0x4ac8('0xc1')],_0x37ed32['activeContact']);}}break;case _0x4ac8('0xc2'):_0x4a455e[_0x4ac8('0x3e')]+=0x1;_0x37ed32[_0x4ac8('0xc3')]+=0x1;_0x37ed32[_0x4ac8('0x9c')]=ut[_0x4ac8('0x9d')](_0x37ed32);ut['logCustomer'](_0x37ed32,0x3,_0x4ac8('0xc4'));rpcDb['createCustomerHistory'](_0x37ed32,_0x4ac8('0xc5'));if(ut['totalGlobal'](_0x37ed32)>=_0x4a455e[_0x4ac8('0xbb')]){_0x299db7=ut[_0x4ac8('0xa0')](_0x37ed32,0xf,_0x4ac8('0xa1'));rpcDb[_0x4ac8('0x96')](_0x299db7,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x37ed32[_0x4ac8('0xc3')]>=_0x4a455e[_0x4ac8('0xc6')]){rpcDb[_0x4ac8('0x96')](_0x37ed32,_0x4ac8('0xc5'));}else{rpcDb['rescheduleContact'](ut[_0x4ac8('0xbf')](_0x37ed32,_0x4ac8('0xc3'),_0x4a455e[_0x4ac8('0xc7')]),_0x37ed32[_0x4ac8('0xc1')],_0x37ed32[_0x4ac8('0xc8')]);}}break;case'CONGESTION':_0x4a455e[_0x4ac8('0x3b')]+=0x1;_0x37ed32[_0x4ac8('0xc9')]+=0x1;_0x37ed32[_0x4ac8('0x9c')]=ut[_0x4ac8('0x9d')](_0x37ed32);ut['logCustomer'](_0x37ed32,0x8,'Congestion');rpcDb[_0x4ac8('0x95')](_0x37ed32,_0x4ac8('0xca'));if(ut[_0x4ac8('0x9d')](_0x37ed32)>=_0x4a455e[_0x4ac8('0xbb')]){_0x299db7=ut[_0x4ac8('0xa0')](_0x37ed32,0xf,'Global');rpcDb[_0x4ac8('0x96')](_0x299db7,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x37ed32['countcongestionretry']>=_0x4a455e[_0x4ac8('0xcb')]){rpcDb[_0x4ac8('0x96')](_0x37ed32,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x4ac8('0xbe')](ut[_0x4ac8('0xbf')](_0x37ed32,_0x4ac8('0xc9'),_0x4a455e[_0x4ac8('0xc0')]),_0x37ed32[_0x4ac8('0xc1')],_0x37ed32[_0x4ac8('0xc8')]);}}break;case _0x4ac8('0xcc'):_0x4a455e[_0x4ac8('0x41')]+=0x1;_0x37ed32['countglobal']=ut[_0x4ac8('0x9d')](_0x37ed32);ut[_0x4ac8('0x8e')](_0x37ed32,0x14,_0x4ac8('0xcd'));rpcDb[_0x4ac8('0x95')](_0x37ed32,_0x4ac8('0xce'));if(_0x37ed32[_0x4ac8('0xc1')]){rpcDb[_0x4ac8('0xcf')](_0x37ed32[_0x4ac8('0xd0')]);}if(_0x37ed32[_0x4ac8('0xc8')]){rpcDb[_0x4ac8('0xd1')](_0x37ed32['idContact']);}break;default:if(_0x37ed32['dialAnswer']){ut[_0x4ac8('0x7b')](_0x4a455e,_0x4ac8('0xd2'));ut['loggerError'](_0x4ac8('0xd3')+_0x4a455e[_0x4ac8('0x29')],_0x43818b);}_0x4a455e[_0x4ac8('0x42')]+=0x1;_0x37ed32[_0x4ac8('0x9c')]=ut['totalGlobal'](_0x37ed32);ut['logCustomer'](_0x37ed32,0xc,_0x43818b['cause-txt']||_0x43818b[_0x4ac8('0xd4')]);rpcDb[_0x4ac8('0x95')](_0x37ed32,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x4ac8('0x9d')](_0x37ed32)>=_0x4a455e['dialGlobalMaxRetry']){_0x299db7=ut[_0x4ac8('0xa0')](_0x37ed32,0xf,_0x4ac8('0xa1'));rpcDb[_0x4ac8('0x96')](_0x299db7,_0x4ac8('0xd5'));}else{rpcDb[_0x4ac8('0x96')](_0x37ed32,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x43818b['linkedid']];}if(!(_0x37ed32[_0x4ac8('0x6f')]&&_0x59f7ed==='16')){ut[_0x4ac8('0x79')](_0x4a455e,_0x4ac8('0xd6'));logger['info'](_0x4ac8('0xd7'),_0x37ed32[_0x4ac8('0xa6')],_0x4ac8('0xa7'),_0x4a455e['name'],_0x4ac8('0x6c'),_0x4a455e['originated']);}if(_0x59f7ed!=='ANSWER'){delete this[_0x4ac8('0x17')][_0x43818b[_0x4ac8('0xb5')]];delete this[_0x4ac8('0x17')][_0x43818b[_0x4ac8('0xd8')]];}}};Preview[_0x4ac8('0x10')]['callProgressDetectingAgent']=function(_0x31e17f,_0x3fe59b,_0x334867){if(_[_0x4ac8('0xd9')](_0x3fe59b)&&'object'!==typeof _0x3fe59b){return;}if(_[_0x4ac8('0xd9')](_0x334867)&&'object'!==typeof _0x334867){return;}switch(_0x334867[_0x4ac8('0xda')]){case'0':ut[_0x4ac8('0xdb')](_0x31e17f,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x31e17f,_0x4ac8('0xdc'));break;case'3':ut[_0x4ac8('0xdb')](_0x31e17f,0x3,_0x4ac8('0xc4'));rpcDb['createAgentHistory'](_0x31e17f,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x31e17f,0x5,_0x4ac8('0xb9'));rpcDb[_0x4ac8('0xdd')](_0x31e17f,_0x4ac8('0xde'));break;case'8':ut[_0x4ac8('0xdb')](_0x31e17f,0x8,_0x4ac8('0xdf'));rpcDb[_0x4ac8('0xdd')](_0x31e17f,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x4ac8('0xdb')](_0x31e17f,0x16,_0x4ac8('0xe0'));rpcDb[_0x4ac8('0xdd')](_0x31e17f,_0x4ac8('0xe1'));break;default:ut['logAgent'](_0x31e17f,0xc,_0x334867[_0x4ac8('0xda')]);rpcDb[_0x4ac8('0xdd')](_0x31e17f,_0x4ac8('0xe2'));}ut[_0x4ac8('0x79')](_0x3fe59b,_0x4ac8('0xe3'));logger['info'](_0x4ac8('0xe4'),_0x31e17f[_0x4ac8('0xa6')],_0x4ac8('0xa7'),_0x3fe59b[_0x4ac8('0x29')],_0x4ac8('0x6c'),_0x3fe59b[_0x4ac8('0x6d')]);delete this[_0x4ac8('0x17')][_0x31e17f['uniqueid']];};Preview[_0x4ac8('0x10')][_0x4ac8('0xe5')]=function(_0x385193,_0x3698df,_0x17a890,_0x2888e6,_0x354bf5){var _0x1dfb04=this;return new BPromise(function(_0x1ac949,_0x20037f){if(_[_0x4ac8('0x68')](_0x3698df)||_['isNil'](_0x3698df[_0x4ac8('0xe6')])||_[_0x4ac8('0x68')](_0x3698df['Contact'][_0x4ac8('0xe7')])||_[_0x4ac8('0x68')](_0x3698df[_0x4ac8('0x73')])){_0x20037f(ut['message']('Contact\x20is\x20undefined',_0x2888e6,_0x354bf5));return;}var _0x32b098=uuid['v4']();var _0x2465dc=_0x1dfb04[_0x4ac8('0x14')][_0x3698df[_0x4ac8('0x6a')]['name']];var _0xdcb02f=_0x17a890?_0x1dfb04['agents'][_0x17a890]['id']:undefined;_0x1dfb04['actions'][_0x32b098]=new Action(_0x3698df,_0x2465dc,_0x32b098,_0x17a890,_0xdcb02f);var _0x34934=_0x1dfb04[_0x4ac8('0x17')][_0x32b098];_0x34934['unlockAgent']=_0x2888e6;_0x34934[_0x4ac8('0xc8')]=_0x354bf5;_0x34934[_0x4ac8('0xe8')]=_0x17a890;if(_['isEmpty'](_0x385193)){_0x1dfb04[_0x4ac8('0xe9')](_0x34934,_0x2465dc,_0x3698df,_0x17a890)['then'](function(_0x333025){logger[_0x4ac8('0x80')](_0x4ac8('0xea'),_0x4ac8('0xeb')+_0x34934[_0x4ac8('0x6b')]+_0x4ac8('0xec')+_0x34934['idContact'],JSON[_0x4ac8('0x50')](_0x333025));ami['emit'](_0x4ac8('0xed'),ut['buildObj'](_0x34934,'called'));_0x1ac949(ut['message'](_0x4ac8('0xee')));})[_0x4ac8('0x77')](function(_0x171459){ut[_0x4ac8('0x5a')]('[Preview][execCall][failure]',_0x171459);_0x20037f(ut[_0x4ac8('0x5c')](_0x4ac8('0xef'),_0x2888e6,_0x354bf5));});}else{_0x2465dc['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x34934);rpcDb[_0x4ac8('0xf0')](_0x34934,_0x4ac8('0xf1'));delete _0x1dfb04[_0x4ac8('0x17')][_0x32b098];_0x20037f(ut[_0x4ac8('0x5c')]('Contact\x20in\x20black\x20List',_0x2888e6,_0x354bf5));}});};Preview[_0x4ac8('0x10')][_0x4ac8('0x99')]=function(_0x3e093c){return!_['isNil'](_0x3e093c)&&!_['isNil'](_0x3e093c['name'])&&!_['isNil'](_0x3e093c['active'])&&_0x3e093c[_0x4ac8('0x4d')]&&!_[_0x4ac8('0x68')](this[_0x4ac8('0x16')][util[_0x4ac8('0x52')](_0x4ac8('0xf2'),_0x3e093c[_0x4ac8('0x29')])])&&!_['isNil'](this[_0x4ac8('0x16')][util[_0x4ac8('0x52')]('SIP/%s',_0x3e093c[_0x4ac8('0x29')])][_0x4ac8('0x76')])&&(this['trunks'][util['format']('SIP/%s',_0x3e093c[_0x4ac8('0x29')])]['status']==='reachable'||this['trunks'][util[_0x4ac8('0x52')](_0x4ac8('0xf2'),_0x3e093c[_0x4ac8('0x29')])][_0x4ac8('0x76')]===_0x4ac8('0xf3'));};Preview[_0x4ac8('0x10')]['run']=function(_0x1738c5,_0x544832){var _0x5bbe74=this;return new BPromise(function(_0x6b2d1a,_0x51cd51){_0x5bbe74[_0x4ac8('0xf4')](_0x1738c5,_0x544832)[_0x4ac8('0x85')](function(_0x1033c4){_0x6b2d1a(_[_0x4ac8('0x70')](_0x1033c4,[_0x4ac8('0x5c')]));})[_0x4ac8('0x77')](function(_0x128572){if(_0x128572[_0x4ac8('0xf5')]){rpcDb[_0x4ac8('0xcf')](_0x1738c5);}if(_0x128572[_0x4ac8('0x4d')]){rpcDb[_0x4ac8('0xd1')](_0x1738c5);}_0x51cd51(_[_0x4ac8('0x70')](_0x128572,[_0x4ac8('0x5c')]));});});};Preview['prototype'][_0x4ac8('0xf4')]=function(_0x2f06d2,_0x4342ec){var _0x262e0f=this;return new BPromise(function(_0x4c0265,_0x47fb8b){var _0x335508,_0xd1f8ac;rpcDb[_0x4ac8('0xf6')](_0x2f06d2)[_0x4ac8('0x85')](function(_0x403fff){if(!_['isNil'](_0x403fff[0x0])){_0xd1f8ac=_0x403fff[0x0]['recallme']?![]:!![];_0x335508=_0x403fff[0x0][_0x4ac8('0xf7')]?!![]:![];_0x335508=_0x4342ec?!![]:_0x335508;}var _0x5b2d57=_0x262e0f[_0x4ac8('0xf8')](_0x403fff);if(_0x5b2d57['isValid']){rpcDb['checkIsBlackList'](_[_0x4ac8('0x70')](_0x403fff[0x0],[_0x4ac8('0x73'),_0x4ac8('0xf9')]))['then'](function(_0xe9b53){_0x262e0f['checkInBlack'](_0xe9b53,_0x403fff[0x0],_0x4342ec,_0xd1f8ac,_0x335508)[_0x4ac8('0x85')](function(_0x2dd481){_0x4c0265(_0x2dd481);})[_0x4ac8('0x77')](function(_0x40dc65){_0x47fb8b(_0x40dc65);});})['catch'](function(_0x265914){ut[_0x4ac8('0x5a')](_0x4ac8('0xfa'),_0x265914);_0x47fb8b(ut[_0x4ac8('0x5c')](_0x4ac8('0xfb'),_0xd1f8ac,_0x335508));});}else{_0x47fb8b(ut[_0x4ac8('0x5c')](_0x5b2d57['message'],_0xd1f8ac,_0x335508));}})[_0x4ac8('0x77')](function(_0x45a111){ut[_0x4ac8('0x5a')](_0x4ac8('0xfc'),_0x45a111);_0x47fb8b(ut[_0x4ac8('0x5c')](_0x4ac8('0xfb'),![],!![]));});});};Preview[_0x4ac8('0x10')]['validateContact']=function(_0x383615){if(_['isNil'](_0x383615)||_[_0x4ac8('0xfd')](_0x383615)||!_[_0x4ac8('0x68')](_0x383615[0x0][_0x4ac8('0xfe')])&&_[_0x4ac8('0x68')](_0x383615[0x0]['Agent']['name'])){ut['logger'](_0x4ac8('0xff'),_0x383615);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x3aec36=this[_0x4ac8('0x14')][_0x383615[0x0][_0x4ac8('0x6a')][_0x4ac8('0x29')]];_0x3aec36[_0x4ac8('0x5c')]=_0x4ac8('0x9b');if(_[_0x4ac8('0x68')](_0x3aec36)){ut[_0x4ac8('0x5a')](_0x4ac8('0x100'),_0x3aec36);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x4ac8('0x99')](_0x3aec36[_0x4ac8('0x4c')])){ut[_0x4ac8('0x5a')](_0x4ac8('0x101'),'campaign\x20Name:\x20'+_0x3aec36[_0x4ac8('0x29')]+_0x4ac8('0x102'));if(!this[_0x4ac8('0x99')](_0x3aec36[_0x4ac8('0x103')])){ut['logger'](_0x4ac8('0x101'),_0x3aec36['name']+_0x4ac8('0x104'));return{'isValid':![],'message':_0x4ac8('0x105')};}}if(!ut[_0x4ac8('0x98')](_0x3aec36[_0x4ac8('0x63')])){ut[_0x4ac8('0x5a')](_0x4ac8('0x106'),_0x3aec36[_0x4ac8('0x29')]+_0x4ac8('0x107'));return{'isValid':![],'message':_0x4ac8('0x108')+_0x3aec36[_0x4ac8('0x29')]+_0x4ac8('0x107')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x4ac8('0x10')][_0x4ac8('0xe9')]=function(_0x40f60e,_0x1faa21,_0x2d1d68,_0x3847df){var _0x4ed10e=this;return new BPromise(function(_0x462426,_0x5b5f98){var _0x5cd3c6=_0x40f60e['uniqueid'];var _0x1609c8=_0x4ed10e[_0x4ac8('0x99')](_0x1faa21['Trunk'])?util[_0x4ac8('0x52')]('SIP/%s/%s%s',_0x1faa21['Trunk'][_0x4ac8('0x29')],_[_0x4ac8('0x68')](_0x1faa21[_0x4ac8('0x109')])?'':_0x1faa21[_0x4ac8('0x109')]['trim']()||'',_0x1faa21[_0x4ac8('0x10a')]>0x0?_0x2d1d68[_0x4ac8('0xe6')]['phone']['substring'](_0x1faa21['dialCutDigit']):_0x2d1d68[_0x4ac8('0xe6')][_0x4ac8('0xe7')]):util[_0x4ac8('0x52')](_0x4ac8('0x10b'),_[_0x4ac8('0x68')](_0x1faa21[_0x4ac8('0x103')])?_0x1faa21[_0x4ac8('0x4c')]['name']:_0x1faa21[_0x4ac8('0x103')][_0x4ac8('0x29')],_[_0x4ac8('0x68')](_0x1faa21[_0x4ac8('0x109')])?'':_0x1faa21[_0x4ac8('0x109')]['trim']()||'',_0x1faa21[_0x4ac8('0x10a')]>0x0?_0x2d1d68['Contact'][_0x4ac8('0xe7')]['substring'](_0x1faa21[_0x4ac8('0x10a')]):_0x2d1d68[_0x4ac8('0xe6')][_0x4ac8('0xe7')]);var _0xa628f5=_0x4ed10e[_0x4ac8('0x99')](_0x1faa21[_0x4ac8('0x4c')])?ut['getCallerId'](_0x1faa21[_0x4ac8('0x4c')]['callerid'],_0x1faa21[_0x4ac8('0x36')],_0x1faa21['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x4ac8('0x10c')](_0x1faa21[_0x4ac8('0x37')],_0x1faa21[_0x4ac8('0x10d')]):_0x1faa21[_0x4ac8('0x37')]):ut['getCallerId'](_[_0x4ac8('0x68')](_0x1faa21[_0x4ac8('0x103')])?_0x1faa21[_0x4ac8('0x4c')][_0x4ac8('0x4e')]:_0x1faa21['TrunkBackup'][_0x4ac8('0x4e')],_0x1faa21[_0x4ac8('0x36')],_0x1faa21[_0x4ac8('0x10d')]>0x0?ut['getCallerIdRandom'](_0x1faa21[_0x4ac8('0x37')],_0x1faa21[_0x4ac8('0x10d')]):_0x1faa21[_0x4ac8('0x37')]);if(_0xa628f5){_0x40f60e[_0x4ac8('0x10e')]=ut[_0x4ac8('0x10f')](_0xa628f5);_0x40f60e[_0x4ac8('0x110')]=ut[_0x4ac8('0x111')](_0xa628f5);}var _0x5986e8=ut['addVariables'](_0x1faa21,_0x2d1d68,_0x1609c8,_0xa628f5,_0x5cd3c6,_0x40f60e);_[_0x4ac8('0x112')](_0x40f60e,ut[_0x4ac8('0x113')](_0x5986e8));_0x40f60e[_0x4ac8('0x8c')]=moment()[_0x4ac8('0x52')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x4ac8('0x75')](ut[_0x4ac8('0x114')](_0x40f60e,_0x1faa21,_0x5986e8,_0x40f60e[_0x4ac8('0xc8')],_0x3847df))[_0x4ac8('0x85')](function(_0x1d9645){_0x1faa21[_0x4ac8('0x6d')]+=0x1;logger['info'](_0x4ac8('0x115'),_0x5cd3c6,_0x4ac8('0xa7'),_0x1faa21[_0x4ac8('0x29')],'originated:\x20',_0x1faa21[_0x4ac8('0x6d')]);_0x462426(_0x1d9645);})['catch'](function(_0x5a7bdd){ut[_0x4ac8('0xdb')](_0x40f60e,0xe,'OriginateError');rpcDb[_0x4ac8('0xdd')](_0x40f60e,_0x4ac8('0x116'));_0x5b5f98(_0x5a7bdd);});});};Preview[_0x4ac8('0x10')][_0x4ac8('0x21')]=function(_0x56f886){if(this[_0x4ac8('0x17')][_0x56f886[_0x4ac8('0xb5')]]){this['actions'][_0x56f886[_0x4ac8('0xb5')]]['channel']=_0x56f886['channel'];}};Preview[_0x4ac8('0x10')][_0x4ac8('0x1a')]=function(_0xff47d7){var _0xeb80ed=this;var _0x5ad876=this[_0x4ac8('0x17')][_0xff47d7[_0x4ac8('0x117')]];if(_0x5ad876){if(_0x5ad876[_0x4ac8('0xe8')]&&this[_0x4ac8('0x84')][_0x5ad876[_0x4ac8('0xe8')]]){ut['logLookAgent'](_0x5ad876,this['agents'][_0x5ad876['lookAgent']][_0x4ac8('0x29')],this[_0x4ac8('0x84')][_0x5ad876['lookAgent']]['id']);}var _0xef76b2=_[_0x4ac8('0x118')](_0x5ad876);_0xef76b2['responsetime']=moment()[_0x4ac8('0x52')](_0x4ac8('0x8d'));var _0x4153d1=_0xeb80ed[_0x4ac8('0x14')][_0x5ad876['queue']];if(ut['isFailure'](_0xff47d7[_0x4ac8('0x119')])){if(_0x5ad876[_0x4ac8('0xc1')]){rpcDb['unlockContact'](_0x5ad876[_0x4ac8('0xd0')]);}if(_0x5ad876[_0x4ac8('0xc8')]){rpcDb[_0x4ac8('0xd1')](_0x5ad876[_0x4ac8('0xd0')]);}ami['emit'](_0x4ac8('0x11a'),ut[_0x4ac8('0xad')](_0x5ad876,'rejected'));this[_0x4ac8('0x11b')](_0xef76b2,_0x4153d1,_0xff47d7);}else{_0x5ad876[_0x4ac8('0x8c')]=moment()[_0x4ac8('0x52')](_0x4ac8('0x8d'));ut[_0x4ac8('0xdb')](_0xef76b2,0x4,_0x4ac8('0xb1'));rpcDb[_0x4ac8('0xdd')](_0xef76b2,_0x4ac8('0x11c'));}}};Preview[_0x4ac8('0x10')]['syncHangup']=function(_0x462c12){var _0x3fa4aa=this;var _0x1252d1=this[_0x4ac8('0x17')][_0x462c12[_0x4ac8('0xb5')]];var _0x112e02;if(_0x1252d1){_0x112e02=this[_0x4ac8('0x14')][_0x1252d1[_0x4ac8('0x6b')]];logger[_0x4ac8('0x80')]('[syncHangup][talking]',_0x462c12['linkedid'],'\x20Queue',_0x112e02[_0x4ac8('0x29')],'pTalking:\x20',_0x112e02[_0x4ac8('0x57')]);}if(this[_0x4ac8('0x17')][_0x462c12[_0x4ac8('0xb5')]]&&_0x462c12[_0x4ac8('0xb5')]!==_0x462c12['uniqueid']){if(_0x462c12[_0x4ac8('0x11d')]==='16'&&this[_0x4ac8('0x17')][_0x462c12[_0x4ac8('0xb5')]][_0x4ac8('0x6f')]){this['callProgressDetectingCustomer'](_0x462c12,_0x462c12[_0x4ac8('0xb5')],_0x462c12[_0x4ac8('0x11d')]);}else if(this[_0x4ac8('0x17')][_0x462c12[_0x4ac8('0xb5')]][_0x4ac8('0x6f')]){logger[_0x4ac8('0x80')](_0x4ac8('0x11e'),_0x462c12[_0x4ac8('0xb5')],_0x462c12[_0x4ac8('0x11d')],_0x4ac8('0xa7'),_0x112e02[_0x4ac8('0x29')],'pTalking:\x20',_0x112e02[_0x4ac8('0x57')]);this['callProgressDetectingCustomer'](_0x462c12,_0x462c12[_0x4ac8('0xb5')],_0x462c12[_0x4ac8('0x11d')]);}}else if(_0x1252d1&&_[_0x4ac8('0x68')](_0x1252d1[_0x4ac8('0x11f')])&&_0x112e02[_0x4ac8('0x120')]&&_0x462c12[_0x4ac8('0xb5')]===_0x462c12[_0x4ac8('0xa6')]&&_[_0x4ac8('0x68')](_0x462c12[_0x4ac8('0xda')])&&_0x462c12[_0x4ac8('0x11d')]==='16'&&_0x462c12['channelstate']==='6'&&_[_0x4ac8('0xd9')](_0x1252d1[_0x4ac8('0x121')])){if(_0x1252d1[_0x4ac8('0xc1')]){rpcDb['unlockContact'](_0x1252d1['idContact']);}if(_0x1252d1[_0x4ac8('0xc8')]){rpcDb[_0x4ac8('0xd1')](_0x1252d1['idContact']);}_0x462c12[_0x4ac8('0xda')]='22';this[_0x4ac8('0x11b')](_0x1252d1,_0x112e02,_0x462c12);}else if(_0x1252d1&&_0x1252d1[_0x4ac8('0x121')]){if(_0x462c12[_0x4ac8('0x11d')]==='16'&&this['actions'][_0x462c12[_0x4ac8('0xb5')]][_0x4ac8('0x6f')]){logger['info'](_0x4ac8('0x122'),_0x462c12['linkedid'],_0x462c12['cause'],'\x20Queue',_0x112e02[_0x4ac8('0x29')],_0x4ac8('0x6e'),_0x112e02[_0x4ac8('0x57')]);this[_0x4ac8('0x123')](_0x462c12,_0x462c12[_0x4ac8('0xb5')],_0x462c12['cause']);}else if(this[_0x4ac8('0x17')][_0x462c12[_0x4ac8('0xb5')]][_0x4ac8('0x6f')]){logger['info']('[syncHangup][talking][cause]',_0x462c12[_0x4ac8('0xb5')],_0x462c12[_0x4ac8('0x11d')],_0x4ac8('0xa7'),_0x112e02[_0x4ac8('0x29')],_0x4ac8('0x6e'),_0x112e02['pTalking']);this[_0x4ac8('0x123')](_0x462c12,_0x462c12[_0x4ac8('0xb5')],_0x462c12[_0x4ac8('0x11d')]);}}};Preview[_0x4ac8('0x10')][_0x4ac8('0x1f')]=function(_0x2bb7c0){if(this[_0x4ac8('0x17')][_0x2bb7c0[_0x4ac8('0xd8')]]&&_0x2bb7c0[_0x4ac8('0xd8')]!==_0x2bb7c0[_0x4ac8('0x124')]){this[_0x4ac8('0x123')](_0x2bb7c0,_0x2bb7c0[_0x4ac8('0xd8')],_0x2bb7c0[_0x4ac8('0xd4')]);}};Preview['prototype'][_0x4ac8('0x1e')]=function(_0x2895e7){if(this[_0x4ac8('0x17')][_0x2895e7[_0x4ac8('0xb5')]]&&_0x2895e7[_0x4ac8('0xb5')]!==_0x2895e7[_0x4ac8('0xa6')]&&!this['actions'][_0x2895e7[_0x4ac8('0xb5')]][_0x4ac8('0x6f')]){if(_0x2895e7[_0x4ac8('0x11d')]==='1'){this[_0x4ac8('0x123')](_0x2895e7,_0x2895e7['linkedid'],_0x2895e7[_0x4ac8('0x11d')]);}}};Preview[_0x4ac8('0x10')]['addVariable']=function(_0x2c0635,_0x29c2dd,_0x1c629f){if(this[_0x4ac8('0x17')][_0x2c0635]){if(_['isNil'](this[_0x4ac8('0x17')][_0x2c0635][_0x4ac8('0x125')])){this['actions'][_0x2c0635]['variables']={};}this[_0x4ac8('0x17')][_0x2c0635][_0x4ac8('0x125')][_0x29c2dd]=_0x1c629f;}};Preview['prototype']['syncVarSet']=function(_0x4b16c6){try{if(!_[_0x4ac8('0x68')](_0x4b16c6)){if(ut[_0x4ac8('0x126')](_[_0x4ac8('0x127')](_0x4b16c6[_0x4ac8('0x128')])[0x0])){this['addVariable'](_0x4b16c6['uniqueid'],_['keys'](_0x4b16c6['variable'])[0x0],_0x4b16c6['value']);}}}catch(_0x36644c){logger[_0x4ac8('0x129')](_0x4ac8('0x12a'),util[_0x4ac8('0x12b')](_0x36644c,{'showHidden':![],'depth':null}));}};Preview[_0x4ac8('0x10')]['syncAttendedTransfer']=function(_0x307bcd){if(_0x307bcd){if(this['actions'][_0x307bcd['transfertargetlinkedid']]){this[_0x4ac8('0x17')][_0x307bcd[_0x4ac8('0x12c')]][_0x4ac8('0x121')]=!![];}}};Preview['prototype'][_0x4ac8('0x25')]=function(_0x3cd8c2){if(_0x3cd8c2){if(this[_0x4ac8('0x17')][_0x3cd8c2[_0x4ac8('0x12d')]]){this[_0x4ac8('0x17')][_0x3cd8c2[_0x4ac8('0x12d')]][_0x4ac8('0x121')]=!![];}}};module[_0x4ac8('0x12e')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 3b887f5..d4f80a9 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 _0x0ecc=['createHistory','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContact','util','bluebird','../../../config/logger','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','catch','[createHistory]\x20','then','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x0ecc,0xd4));var _0xc0ec=function(_0x122f19,_0x31c3fd){_0x122f19=_0x122f19-0x0;var _0x2f364a=_0x0ecc[_0x122f19];return _0x2f364a;};'use strict';var util=require(_0xc0ec('0x0'));var BPromise=require(_0xc0ec('0x1'));var logger=require(_0xc0ec('0x2'))('preview');var _=require(_0xc0ec('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xc0ec('0x4'));var cmHopperHistory=require(_0xc0ec('0x5'));var cmHopperBlack=require(_0xc0ec('0x6'));var voiceQueueRt=require(_0xc0ec('0x7'));var agentReportPreview=require(_0xc0ec('0x8'));var voiceQueueReport=require(_0xc0ec('0x9'));function loggerCatch(_0x4081bf){return function(_0x38facd){logger[_0xc0ec('0xa')](_0x4081bf,util[_0xc0ec('0xb')](_0x38facd,{'showHidden':![],'depth':null}));};}function create(_0x128b8a){return BPromise[_0xc0ec('0xc')]()['then'](cmHopperHistory['createHistory'](_0x128b8a))[_0xc0ec('0xd')](loggerCatch(_0xc0ec('0xe')));}function createAgent(_0x882a3f){return BPromise[_0xc0ec('0xc')]()[_0xc0ec('0xf')](agentReportPreview['createHistory'](_0x882a3f))[_0xc0ec('0xd')](loggerCatch(_0xc0ec('0xe')));}function moveContact(_0x1e1d7c){return BPromise[_0xc0ec('0xc')]()[_0xc0ec('0xf')](cmHopper[_0xc0ec('0x10')](_0x1e1d7c,!![]))[_0xc0ec('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xc0ec('0x11')]=function(_0x1ceb40){return BPromise[_0xc0ec('0xc')]()[_0xc0ec('0xf')](cmHopperBlack[_0xc0ec('0x11')](_0x1ceb40))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x315b67){return BPromise[_0xc0ec('0xc')]()[_0xc0ec('0xf')](cmHopper[_0xc0ec('0x12')](_0x315b67))[_0xc0ec('0xd')](loggerCatch(_0xc0ec('0x13')));};exports[_0xc0ec('0x14')]=function(_0x1f0fc7,_0x2a83c4){create(_0x1f0fc7)[_0xc0ec('0xd')](loggerCatch(_0x2a83c4));moveContact(_0x1f0fc7)[_0xc0ec('0xd')](loggerCatch(_0x2a83c4));};exports[_0xc0ec('0x15')]=function(_0x4478f5,_0x4e77f2){createAgent(_0x4478f5)[_0xc0ec('0xd')](loggerCatch(_0x4e77f2));};exports[_0xc0ec('0x16')]=function(_0xd457b3,_0x179c7b){create(_0xd457b3)[_0xc0ec('0xd')](loggerCatch(_0x179c7b));};exports[_0xc0ec('0x17')]=function(_0x3b1914,_0x2017c9){moveContact(_0x3b1914)[_0xc0ec('0xd')](loggerCatch(_0x2017c9));};exports['rescheduleContact']=function(_0x4fab43,_0x3e6765,_0x3950dd){if(_0x3e6765){_0x4fab43[_0xc0ec('0x18')]=null;}if(_0x3950dd){_0x4fab43[_0xc0ec('0x19')]=![];}return BPromise[_0xc0ec('0xc')]()[_0xc0ec('0xf')](cmHopper['rescheduleContact'](_0x4fab43))['catch'](loggerCatch(_0xc0ec('0x1a')));};exports[_0xc0ec('0x1b')]=function(_0x3b3915){return BPromise['resolve']()[_0xc0ec('0xf')](cmHopper[_0xc0ec('0x1b')](_0x3b3915))[_0xc0ec('0xd')](loggerCatch('[countReScheduled]\x20'));};exports[_0xc0ec('0x1c')]=function(_0x3b2bac){return BPromise[_0xc0ec('0xc')]()['then'](cmHopper[_0xc0ec('0x1c')]({'UserId':null},_0x3b2bac,0x1))[_0xc0ec('0xd')](loggerCatch(_0xc0ec('0x1d')));};exports[_0xc0ec('0x1e')]=function(_0x3fb0f8){return BPromise['resolve']()['then'](cmHopper['unlockContact']({'active':![]},_0x3fb0f8,0x1))[_0xc0ec('0xd')](loggerCatch(_0xc0ec('0x1f')));};exports[_0xc0ec('0x20')]=function(_0x4cf166){var _0x34340c={};_0x34340c[_0xc0ec('0x21')]=_0x4cf166[_0xc0ec('0x21')];_0x34340c[_0xc0ec('0x22')]=_0x4cf166[_0xc0ec('0x22')];_0x34340c[_0xc0ec('0x23')]=_0x4cf166['calleridnum'];_0x34340c[_0xc0ec('0x24')]=_0x4cf166[_0xc0ec('0x24')];_0x34340c[_0xc0ec('0x25')]=_0x4cf166['queue'];_0x34340c[_0xc0ec('0x26')]=_0x4cf166[_0xc0ec('0x27')];_0x34340c[_0xc0ec('0x28')]=_0x4cf166[_0xc0ec('0x27')];_0x34340c[_0xc0ec('0x29')]=0x1;_0x34340c[_0xc0ec('0x2a')]=_0x4cf166[_0xc0ec('0x2b')];_0x34340c['connectedlinename']=_0x4cf166[_0xc0ec('0x2c')];_0x34340c[_0xc0ec('0x2d')]=_0xc0ec('0x2e');_0x34340c[_0xc0ec('0x2f')]=_0xc0ec('0x30');_0x34340c[_0xc0ec('0x31')]=0x0;_0x34340c[_0xc0ec('0x32')]=0x1;_0x34340c[_0xc0ec('0x33')]=_0x4cf166[_0xc0ec('0x2c')];_0x34340c[_0xc0ec('0x34')]=_0xc0ec('0x35');return BPromise[_0xc0ec('0xc')]()[_0xc0ec('0xf')](voiceQueueReport[_0xc0ec('0x36')](_0x34340c))[_0xc0ec('0xd')](loggerCatch(_0xc0ec('0x37')));};exports[_0xc0ec('0x38')]=function(_0xb954a9,_0x443f61){return BPromise[_0xc0ec('0xc')]()['then'](cmHopper[_0xc0ec('0x38')](_0xb954a9,_0x443f61))[_0xc0ec('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x9bf06c){return BPromise[_0xc0ec('0xc')]()[_0xc0ec('0xf')](cmHopper[_0xc0ec('0x39')](_0x9bf06c,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xa772=['../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview'];(function(_0x1faf43,_0x54a9da){var _0x3e3bf8=function(_0x3397cb){while(--_0x3397cb){_0x1faf43['push'](_0x1faf43['shift']());}};_0x3e3bf8(++_0x54a9da);}(_0xa772,0x187));var _0x2a77=function(_0x2ceedb,_0x3d4af3){_0x2ceedb=_0x2ceedb-0x0;var _0x1eef5c=_0xa772[_0x2ceedb];return _0x1eef5c;};'use strict';var util=require(_0x2a77('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require(_0x2a77('0x1'));var cmHopper=require(_0x2a77('0x2'));var cmHopperFinal=require(_0x2a77('0x3'));var cmHopperHistory=require(_0x2a77('0x4'));var cmHopperBlack=require(_0x2a77('0x5'));var voiceQueueRt=require(_0x2a77('0x6'));var agentReportPreview=require(_0x2a77('0x7'));var voiceQueueReport=require(_0x2a77('0x8'));function loggerCatch(_0x271b3c){return function(_0x505249){logger[_0x2a77('0x9')](_0x271b3c,util['inspect'](_0x505249,{'showHidden':![],'depth':null}));};}function create(_0x43557c){return BPromise[_0x2a77('0xa')]()[_0x2a77('0xb')](cmHopperHistory[_0x2a77('0xc')](_0x43557c))[_0x2a77('0xd')](loggerCatch(_0x2a77('0xe')));}function createAgent(_0x21b889){return BPromise[_0x2a77('0xa')]()[_0x2a77('0xb')](agentReportPreview[_0x2a77('0xc')](_0x21b889))[_0x2a77('0xd')](loggerCatch(_0x2a77('0xe')));}function moveContact(_0x300f2d){return BPromise[_0x2a77('0xa')]()[_0x2a77('0xb')](cmHopper[_0x2a77('0xf')](_0x300f2d,!![]))[_0x2a77('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x2a77('0x10')]=function(_0x121e7f){return BPromise[_0x2a77('0xa')]()['then'](cmHopperBlack[_0x2a77('0x10')](_0x121e7f))[_0x2a77('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x2a77('0x11')]=function(_0x5f5569){return BPromise[_0x2a77('0xa')]()[_0x2a77('0xb')](cmHopper[_0x2a77('0x11')](_0x5f5569))[_0x2a77('0xd')](loggerCatch(_0x2a77('0x12')));};exports[_0x2a77('0xc')]=function(_0x2ec73e,_0x4a591e){create(_0x2ec73e)[_0x2a77('0xd')](loggerCatch(_0x4a591e));moveContact(_0x2ec73e)['catch'](loggerCatch(_0x4a591e));};exports[_0x2a77('0x13')]=function(_0x398a4c,_0x176e2f){createAgent(_0x398a4c)[_0x2a77('0xd')](loggerCatch(_0x176e2f));};exports[_0x2a77('0x14')]=function(_0x2459c1,_0x222874){create(_0x2459c1)[_0x2a77('0xd')](loggerCatch(_0x222874));};exports[_0x2a77('0x15')]=function(_0x2b0164,_0x34492f){moveContact(_0x2b0164)[_0x2a77('0xd')](loggerCatch(_0x34492f));};exports[_0x2a77('0x16')]=function(_0xa6d67e,_0x33ab89,_0xe9a604){if(_0x33ab89){_0xa6d67e[_0x2a77('0x17')]=null;}if(_0xe9a604){_0xa6d67e[_0x2a77('0x18')]=![];}return BPromise[_0x2a77('0xa')]()[_0x2a77('0xb')](cmHopper['rescheduleContact'](_0xa6d67e))[_0x2a77('0xd')](loggerCatch(_0x2a77('0x19')));};exports[_0x2a77('0x1a')]=function(_0x4c467c){return BPromise['resolve']()[_0x2a77('0xb')](cmHopper['countReScheduled'](_0x4c467c))['catch'](loggerCatch(_0x2a77('0x1b')));};exports['unlockContact']=function(_0x36bbe4){return BPromise['resolve']()[_0x2a77('0xb')](cmHopper[_0x2a77('0x1c')]({'UserId':null},_0x36bbe4,0x1))[_0x2a77('0xd')](loggerCatch(_0x2a77('0x1d')));};exports[_0x2a77('0x1e')]=function(_0x3c7013){return BPromise[_0x2a77('0xa')]()[_0x2a77('0xb')](cmHopper[_0x2a77('0x1c')]({'active':![]},_0x3c7013,0x1))['catch'](loggerCatch(_0x2a77('0x1f')));};exports[_0x2a77('0x20')]=function(_0x5489a5){var _0x408b84={};_0x408b84[_0x2a77('0x21')]=_0x5489a5['type'];_0x408b84[_0x2a77('0x22')]=_0x5489a5[_0x2a77('0x22')];_0x408b84[_0x2a77('0x23')]=_0x5489a5['calleridnum'];_0x408b84[_0x2a77('0x24')]=_0x5489a5[_0x2a77('0x24')];_0x408b84[_0x2a77('0x25')]=_0x5489a5[_0x2a77('0x25')];_0x408b84[_0x2a77('0x26')]=_0x5489a5[_0x2a77('0x27')];_0x408b84[_0x2a77('0x28')]=_0x5489a5[_0x2a77('0x27')];_0x408b84['queuecallercomplete']=0x1;_0x408b84[_0x2a77('0x29')]=_0x5489a5[_0x2a77('0x2a')];_0x408b84['connectedlinename']=_0x5489a5['membername'];_0x408b84['context']=_0x2a77('0x2b');_0x408b84[_0x2a77('0x2c')]=_0x2a77('0x2d');_0x408b84['holdtime']=0x0;_0x408b84[_0x2a77('0x2e')]=0x1;_0x408b84[_0x2a77('0x2f')]=_0x5489a5[_0x2a77('0x30')];_0x408b84[_0x2a77('0x31')]=_0x2a77('0x32');return BPromise[_0x2a77('0xa')]()[_0x2a77('0xb')](voiceQueueReport[_0x2a77('0x33')](_0x408b84))['catch'](loggerCatch(_0x2a77('0x34')));};exports[_0x2a77('0x35')]=function(_0x1e1f1e,_0x4fe9a9){return BPromise[_0x2a77('0xa')]()[_0x2a77('0xb')](cmHopper[_0x2a77('0x35')](_0x1e1f1e,_0x4fe9a9))[_0x2a77('0xd')](loggerCatch(_0x2a77('0x36')));};exports[_0x2a77('0x37')]=function(_0x5ea25d){return BPromise[_0x2a77('0xa')]()[_0x2a77('0xb')](cmHopper[_0x2a77('0x16')](_0x5ea25d,!![],!![]))[_0x2a77('0xd')](loggerCatch(_0x2a77('0x38')));}; \ 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 9eb2d52..be435dd 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 _0x70e1=['dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','monitor_format','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','logAgent','state','responsetime','logLookAgent','membername','logCustomer','endtime','ringtime','answertime','Failure','variablesAction','calleridname','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','buildAcw','queue','interface','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','diff','createBody','ListId','CampaignId','filterKey','idContact','campaigntype','countbusyretry','callback','callbackuniqueid','callbackat','recallme','UserId','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','seconds','error','inspect','logger','loggerError','logger2','info','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e1,0xfb));var _0x170e=function(_0x1c1566,_0x36b365){_0x1c1566=_0x1c1566-0x0;var _0x461fae=_0x70e1[_0x1c1566];return _0x461fae;};'use strict';var util=require(_0x170e('0x0'));var _=require(_0x170e('0x1'));var moment=require('moment');var logger=require(_0x170e('0x2'))('preview');var ipAgi=process[_0x170e('0x3')][_0x170e('0x4')]||_0x170e('0x5');function getSeconds(_0x156485,_0x47924c){var _0x3a0324=moment(_0x156485)['milliseconds'](0x0);var _0x44894a=moment(_0x47924c)['milliseconds'](0x0);return _0x3a0324['diff'](_0x44894a,_0x170e('0x6'));}exports['loggerCatch']=function(_0x55da4a){return function(_0x54ac8c){logger[_0x170e('0x7')](_0x55da4a,util[_0x170e('0x8')](_0x54ac8c,{'showHidden':![],'depth':null}));};};exports[_0x170e('0x9')]=function(_0x1d0f42,_0x52e273){logger['info'](_0x1d0f42,util['inspect'](_0x52e273,{'showHidden':![],'depth':null}));};exports[_0x170e('0xa')]=function(_0x1914d1,_0x1bd0d0){logger[_0x170e('0x7')](_0x1914d1,util[_0x170e('0x8')](_0x1bd0d0,{'showHidden':![],'depth':null}));};exports[_0x170e('0xb')]=function(_0x1fb9d7){return function(_0x3a2276){logger[_0x170e('0xc')](_0x1fb9d7,util[_0x170e('0x8')](_0x3a2276,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x3761a9,_0x3c82d6,_0x16417f){return{'message':_0x3761a9,'unlock':_0x3c82d6,'active':_0x16417f};};exports[_0x170e('0xd')]=function(_0x5288ac,_0xc7791,_0x33d814){if(!_[_0x170e('0xe')](_0x33d814)&&_0x170e('0xf')===typeof _0x33d814&&!_[_0x170e('0x10')](_0x33d814)){if(!_[_0x170e('0xe')](_0xc7791)&&_0x170e('0xf')===typeof _0xc7791&&!_[_0x170e('0x10')](_0xc7791)){return util[_0x170e('0x11')]('\x22%s\x22\x20<%s>',_0xc7791,_0x33d814);}return util[_0x170e('0x11')](_0x170e('0x12'),_0x33d814,_0x33d814);}if(!_[_0x170e('0xe')](_0x5288ac)&&'string'===typeof _0x5288ac&&!_[_0x170e('0x10')](_0x5288ac)){return _0x5288ac;}return _0x170e('0x13');};exports[_0x170e('0x14')]=function(_0x5bdef0){if(_[_0x170e('0x15')](_0x5bdef0)){return![];}return _0x5bdef0;};exports['addVariables']=function(_0x2238e1,_0x351c76,_0x401ccf,_0x5be6b3,_0x1efa48,_0x57931d){var _0x5e804a={'XMD-QUEUE':_0x351c76['Queue']?_0x351c76[_0x170e('0x16')][_0x170e('0x17')]:'','XMD-CALLERID':_0x5be6b3,'XMD-CALLERID-PREVIEW':_0x57931d?util['format'](_0x170e('0x12'),_0x57931d['calleridname'],_0x57931d[_0x170e('0x18')]):_0x5be6b3,'XMD-DIALID':_0x1efa48,'XMD-CONTACTID':_0x351c76[_0x170e('0x19')],'XMD-CDRTYPE':_0x170e('0x1a'),'CALLERID(all)':_0x5be6b3,'XMD-VOICEQUEUEID':_0x351c76[_0x170e('0x1b')],'XMD-DIALCHANNEL':_0x401ccf,'XMD-DIALTIMEOUT':_0x2238e1['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x170e('0x1c'),_0x2238e1[_0x170e('0x1d')]?'g':'',_[_0x170e('0x10')](_0x2238e1['monitor_format'])?'':_0x170e('0x1e')),'XMD-DIALURL':_0x2238e1['dialPreviewUrl']||'','XMD-AGI':_0x2238e1[_0x170e('0x1f')]?util[_0x170e('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2238e1[_0x170e('0x1f')]):'NONE','XMD-AGIAFTER':_0x2238e1['dialQueueProject2']?util['format'](_0x170e('0x20'),ipAgi,_0x2238e1['dialQueueProject2']):_0x170e('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x57931d?_0x57931d[_0x170e('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x57931d?_0x57931d[_0x170e('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x170e('0x10')](_0x2238e1['monitor_format'])){_0x5e804a[util[_0x170e('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x2238e1[_0x170e('0x24')];_0x5e804a[util[_0x170e('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1efa48;}if(_0x351c76&&_0x351c76[_0x170e('0x25')]){for(var _0x41d1ac in _0x351c76[_0x170e('0x25')]){if(_0x351c76[_0x170e('0x25')][_0x170e('0x26')](_0x41d1ac)){if(!_[_0x170e('0x15')](_0x351c76[_0x170e('0x25')][_0x41d1ac])&&_0x41d1ac!=='id'&&_0x41d1ac!=='tags'&&_0x41d1ac!==_0x170e('0x27')&&_0x41d1ac!==_0x170e('0x28')){_0x5e804a[util[_0x170e('0x11')](_0x170e('0x29'),_0x170e('0x2a'),_[_0x170e('0x2b')](_0x41d1ac))]=_0x351c76[_0x170e('0x25')][_0x41d1ac];}}}}return _0x5e804a;};exports[_0x170e('0x2c')]=function(_0x312b26){var _0x245caf={};for(var _0xcf815d in _0x312b26){if(_0x312b26[_0x170e('0x26')](_0xcf815d)){_0x245caf[util['format']('%s',_[_0x170e('0x2d')](_0xcf815d))]=_0x312b26[_0xcf815d];}}return{'variables':_0x245caf};};exports[_0x170e('0x2e')]=function(_0x39f1ba,_0x5b1565){if(!_['isNil'](_0x39f1ba)){if(_0x39f1ba[_0x170e('0x26')]('originated')){if(_0x39f1ba[_0x170e('0x2f')]>0x0){_0x39f1ba[_0x170e('0x2f')]-=0x1;}else{logger[_0x170e('0x7')](_0x170e('0x30'),_0x5b1565);}}}else{logger['error'](_0x170e('0x31'),_0x5b1565);}};exports[_0x170e('0x32')]=function(_0x1a3089){var _0x40337a=moment()['format'](_0x170e('0x33'));_0x1a3089['state']=0xd;_0x1a3089[_0x170e('0x34')]=_0x170e('0x35');_0x1a3089[_0x170e('0x36')]=_0x40337a;_0x1a3089['responsetime']=_0x40337a;_0x1a3089['endtime']=_0x40337a;};exports[_0x170e('0x37')]=function(_0x22c290,_0x1806b2,_0x356bbc){var _0x4f09f1=moment()['format'](_0x170e('0x33'));_0x22c290[_0x170e('0x38')]=_0x1806b2;_0x22c290['statedesc']=_0x356bbc;_0x22c290['responsetime']=_0x4f09f1;_0x22c290['ringtime']=getSeconds(_0x22c290[_0x170e('0x39')],_0x22c290[_0x170e('0x36')]);};exports[_0x170e('0x3a')]=function(_0x42d1a9,_0x2a4038,_0x253a31){_0x42d1a9[_0x170e('0x3b')]=_0x2a4038;_0x42d1a9['UserId']=_0x253a31;};exports[_0x170e('0x3c')]=function(_0x27d26c,_0x29f8,_0x4b5fc8){var _0x5b1f86=moment()[_0x170e('0x11')](_0x170e('0x33'));_0x27d26c[_0x170e('0x38')]=_0x29f8;_0x27d26c[_0x170e('0x34')]=_0x4b5fc8;_0x27d26c['responsetime']=_0x27d26c[_0x170e('0x39')]?_0x27d26c[_0x170e('0x39')]:_0x5b1f86;_0x27d26c['endtime']=_0x27d26c[_0x170e('0x3d')]?_0x27d26c[_0x170e('0x3d')]:_0x5b1f86;_0x27d26c[_0x170e('0x3e')]=getSeconds(_0x27d26c[_0x170e('0x39')]||0x0,_0x27d26c[_0x170e('0x36')]||0x0);_0x27d26c['talktime']=_0x27d26c[_0x170e('0x3f')]?getSeconds(_0x27d26c['endtime'],_0x27d26c['answertime']):0x0;};exports['isFailure']=function(_0x1ab196){return _0x1ab196===_0x170e('0x40');};exports[_0x170e('0x41')]=function(_0x331283,_0x254bf1,_0x4aeb13,_0x55ce9a,_0x27098b){var _0x4fcf7e=_0x55ce9a?'RECALL':_0x331283[_0x170e('0x42')];_0x4fcf7e=_0x27098b?_0x170e('0x43'):_0x4fcf7e;return{'actionid':_0x331283[_0x170e('0x44')],'action':_0x170e('0x45'),'channel':_0x331283[_0x170e('0x46')],'callerid':util[_0x170e('0x11')](_0x170e('0x12'),_0x4fcf7e,_0x331283[_0x170e('0x18')]),'Exten':_0x170e('0x47'),'Context':_0x170e('0x48'),'Priority':'1','variable':_0x4aeb13,'timeout':(_0x254bf1[_0x170e('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x331283[_0x170e('0x44')]};};exports['totalGlobal']=function(_0x3e0b61){return _0x3e0b61['countbusyretry']+_0x3e0b61[_0x170e('0x4a')]+_0x3e0b61[_0x170e('0x4b')];};exports[_0x170e('0x4c')]=function(_0x4148da){var _0x10b747=_[_0x170e('0x4d')](_0x4148da);_0x10b747[_0x170e('0x38')]=0xf;_0x10b747[_0x170e('0x34')]=_0x170e('0x4e');return _0x10b747;};exports[_0x170e('0x4f')]=function(_0x5d5d81,_0x1739e2,_0x21a040){var _0x38f27a={};_0x38f27a[_0x1739e2]=_0x5d5d81[_0x1739e2];_0x38f27a[_0x170e('0x50')]=![];_0x38f27a[_0x170e('0x51')]=moment()['add'](_0x21a040,_0x170e('0x52'))[_0x170e('0x11')](_0x170e('0x33'));_0x38f27a[_0x170e('0x19')]=_0x5d5d81['ContactId'];_0x38f27a['ListId']=_0x5d5d81['ListId'];_0x38f27a['VoiceQueueId']=_0x5d5d81['VoiceQueueId']||undefined;return _0x38f27a;};exports[_0x170e('0x53')]=function(_0xadbf21,_0x192a25){if(!_['isNil'](_0xadbf21)){if(_0xadbf21[_0x170e('0x54')]>0x0){_0xadbf21[_0x170e('0x54')]-=0x1;}else{logger[_0x170e('0x7')](_0x192a25,_0x170e('0x55'));}}else{logger[_0x170e('0x7')](_0x192a25,_0x170e('0x56'));}};exports[_0x170e('0x57')]=function(_0x29ccb2){if(_0x29ccb2<=0x0){return!![];}return![];};exports['buildObj']=function(_0x1b1ee2,_0x912ba8){_0x1b1ee2[_0x170e('0x58')]=_0x912ba8;_0x1b1ee2[_0x170e('0x17')]=_0x1b1ee2['queue'];_0x1b1ee2['interface']=_0x1b1ee2[_0x170e('0x46')];return _0x1b1ee2;};exports[_0x170e('0x59')]=function(_0x4efe63){var _0x49015b={};_0x49015b[_0x170e('0x5a')]=_0x4efe63[_0x170e('0x5a')];_0x49015b[_0x170e('0x5b')]=_0x4efe63[_0x170e('0x46')];_0x49015b[_0x170e('0x44')]=_0x4efe63[_0x170e('0x44')];return _0x49015b;};exports[_0x170e('0x5c')]=function(_0x26f86f){var _0x3fde8e=[];for(var _0x11e6b1 in _0x26f86f){if(_0x26f86f['hasOwnProperty'](_0x11e6b1)){if(!_[_0x170e('0x15')](_0x26f86f[_0x11e6b1])&&_0x26f86f[_0x11e6b1][_0x170e('0x38')]===_0x170e('0x5d')&&_0x26f86f[_0x11e6b1]['status']===_0x170e('0x5e')){_0x3fde8e[_0x170e('0x5f')](_0x26f86f[_0x11e6b1]['id']);}}}return _0x3fde8e;};exports[_0x170e('0x60')]=function(_0x1714da){var _0x2a2e01=moment()[_0x170e('0x61')](0x0);var _0x11ebc4=moment(_0x1714da)[_0x170e('0x61')](0x0);return _0x2a2e01[_0x170e('0x62')](_0x11ebc4,_0x170e('0x6'));};exports[_0x170e('0x63')]=function(_0x58022f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x58022f[_0x170e('0x19')],'ListId':_0x58022f[_0x170e('0x64')],'VoiceQueueId':_0x58022f[_0x170e('0x1b')]||undefined,'CampaignId':_0x58022f[_0x170e('0x65')]||undefined};};exports[_0x170e('0x66')]=function(_0x28ca77){if(_0x28ca77===_0x170e('0x44')||_0x28ca77===_0x170e('0x67')||_0x28ca77==='queue'||_0x28ca77==='type'||_0x28ca77===_0x170e('0x68')||_0x28ca77==='dialAnswer'||_0x28ca77===_0x170e('0x3b')||_0x28ca77===_0x170e('0x46')||_0x28ca77==='calleridname'||_0x28ca77===_0x170e('0x50')||_0x28ca77==='calleridnum'||_0x28ca77===_0x170e('0x51')||_0x28ca77===_0x170e('0x69')||_0x28ca77===_0x170e('0x4a')||_0x28ca77===_0x170e('0x4b')||_0x28ca77==='countglobal'||_0x28ca77===_0x170e('0x6a')||_0x28ca77===_0x170e('0x6b')||_0x28ca77===_0x170e('0x6c')||_0x28ca77===_0x170e('0x6d')||_0x28ca77===_0x170e('0x19')||_0x28ca77===_0x170e('0x64')||_0x28ca77===_0x170e('0x6e')||_0x28ca77===_0x170e('0x1b')||_0x28ca77==='sipcallid'||_0x28ca77===_0x170e('0x6f')||_0x28ca77===_0x170e('0x70')||_0x28ca77===_0x170e('0x71')||_0x28ca77===_0x170e('0x72')||_0x28ca77===_0x170e('0x73')||_0x28ca77===_0x170e('0x74')||_0x28ca77===_0x170e('0x75')||_0x28ca77===_0x170e('0x76')||_0x28ca77===_0x170e('0x77')||_0x28ca77===_0x170e('0x78')||_0x28ca77===_0x170e('0x79')||_0x28ca77==='xmd-callerid'||_0x28ca77===_0x170e('0x7a')||_0x28ca77===_0x170e('0x7b')||_0x28ca77===_0x170e('0x7c')||_0x28ca77===_0x170e('0x7d')||_0x28ca77===_0x170e('0x7e')||_0x28ca77===_0x170e('0x7f')||_0x28ca77===_0x170e('0x80')||_0x28ca77===_0x170e('0x81')||_0x28ca77===_0x170e('0x82')||_0x28ca77===_0x170e('0x83')||_0x28ca77==='rtpaudioqos'||_0x28ca77===_0x170e('0x7d')||_0x28ca77===_0x170e('0x7e')||_0x28ca77===_0x170e('0x7f')||_0x28ca77===_0x170e('0x80')||_0x28ca77===_0x170e('0x81')||_0x28ca77===_0x170e('0x82')||_0x28ca77===_0x170e('0x83')||_0x28ca77===_0x170e('0x84')||_0x28ca77==='bridgepvtcallid'||_0x28ca77==='state'||_0x28ca77===_0x170e('0x34')){return![];}return!![];};exports[_0x170e('0x85')]=function(_0x52ab77,_0xedee16){var _0x521621,_0x371500,_0x50c037;if(_0xedee16<=0x0){_0xedee16=0x1;}_0x521621=new RegExp(_0x170e('0x86')+_0xedee16+'}$');_0x371500=Math[_0x170e('0x87')](0xa,_0xedee16-0x1);_0x50c037=Math['pow'](0xa,_0xedee16)-0x1;return util[_0x170e('0x11')]('%s',_[_0x170e('0x88')](_0x52ab77,_0x521621,_[_0x170e('0x89')](_0x371500,_0x50c037)));};exports[_0x170e('0x8a')]=function(_0x59f8bf){var _0x408764=_0x59f8bf[_0x170e('0x8b')](/"(.*?)"/);return _0x408764?_0x408764[0x1]:_0x59f8bf;};exports[_0x170e('0x8c')]=function(_0x505881){var _0x51f49d=_0x505881[_0x170e('0x8b')](/<(.*?)>/);return _0x51f49d?_0x51f49d[0x1]:_0x505881;}; \ No newline at end of file +var _0xbf96=['dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','logCustomer','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','buildAcw','queue','not_inuse','status','reachable','push','getDiff','seconds','createBody','filterKey','campaigntype','calleridnum','countglobal','callback','callbackuniqueid','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','inspect','logger','info','loggerError','error','message','getCallerId','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','calleridname','ContactId','VoiceQueueId','dialOriginateTimeout','format','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xbf96,0xef));var _0x6bf9=function(_0x55e159,_0x3c91de){_0x55e159=_0x55e159-0x0;var _0x331f07=_0xbf96[_0x55e159];return _0x331f07;};'use strict';var util=require('util');var _=require(_0x6bf9('0x0'));var moment=require(_0x6bf9('0x1'));var logger=require(_0x6bf9('0x2'))(_0x6bf9('0x3'));var ipAgi=process['env'][_0x6bf9('0x4')]||_0x6bf9('0x5');function getSeconds(_0x4b51d7,_0x2ff3db){var _0x29f49c=moment(_0x4b51d7)[_0x6bf9('0x6')](0x0);var _0x2314c7=moment(_0x2ff3db)['milliseconds'](0x0);return _0x29f49c[_0x6bf9('0x7')](_0x2314c7,'seconds');}exports[_0x6bf9('0x8')]=function(_0x35146b){return function(_0x1d2b0b){logger['error'](_0x35146b,util[_0x6bf9('0x9')](_0x1d2b0b,{'showHidden':![],'depth':null}));};};exports[_0x6bf9('0xa')]=function(_0x512158,_0x345642){logger[_0x6bf9('0xb')](_0x512158,util[_0x6bf9('0x9')](_0x345642,{'showHidden':![],'depth':null}));};exports[_0x6bf9('0xc')]=function(_0x19d895,_0x52803b){logger[_0x6bf9('0xd')](_0x19d895,util[_0x6bf9('0x9')](_0x52803b,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x13c799){return function(_0x5215e1){logger['info'](_0x13c799,util['inspect'](_0x5215e1,{'showHidden':![],'depth':null}));};};exports[_0x6bf9('0xe')]=function(_0x1a035d,_0x3dd443,_0x24bfc9){return{'message':_0x1a035d,'unlock':_0x3dd443,'active':_0x24bfc9};};exports[_0x6bf9('0xf')]=function(_0x1a4bbf,_0x3b1008,_0x2a9cee){if(!_['isUndefined'](_0x2a9cee)&&_0x6bf9('0x10')===typeof _0x2a9cee&&!_[_0x6bf9('0x11')](_0x2a9cee)){if(!_[_0x6bf9('0x12')](_0x3b1008)&&_0x6bf9('0x10')===typeof _0x3b1008&&!_[_0x6bf9('0x11')](_0x3b1008)){return util['format'](_0x6bf9('0x13'),_0x3b1008,_0x2a9cee);}return util['format'](_0x6bf9('0x13'),_0x2a9cee,_0x2a9cee);}if(!_[_0x6bf9('0x12')](_0x1a4bbf)&&_0x6bf9('0x10')===typeof _0x1a4bbf&&!_[_0x6bf9('0x11')](_0x1a4bbf)){return _0x1a4bbf;}return _0x6bf9('0x14');};exports[_0x6bf9('0x15')]=function(_0x248ce7){if(_['isNil'](_0x248ce7)){return![];}return _0x248ce7;};exports[_0x6bf9('0x16')]=function(_0x2db6c6,_0x339cbb,_0x3c29a8,_0x37e955,_0x433eb2,_0x6ff6ef){var _0x170fd9={'XMD-QUEUE':_0x339cbb[_0x6bf9('0x17')]?_0x339cbb['Queue']['name']:'','XMD-CALLERID':_0x37e955,'XMD-CALLERID-PREVIEW':_0x6ff6ef?util['format']('\x22%s\x22\x20<%s>',_0x6ff6ef[_0x6bf9('0x18')],_0x6ff6ef['calleridnum']):_0x37e955,'XMD-DIALID':_0x433eb2,'XMD-CONTACTID':_0x339cbb[_0x6bf9('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x37e955,'XMD-VOICEQUEUEID':_0x339cbb[_0x6bf9('0x1a')],'XMD-DIALCHANNEL':_0x3c29a8,'XMD-DIALTIMEOUT':_0x2db6c6[_0x6bf9('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x6bf9('0x1c')](_0x6bf9('0x1d'),_0x2db6c6[_0x6bf9('0x1e')]?'g':'',_[_0x6bf9('0x11')](_0x2db6c6[_0x6bf9('0x1f')])?'':_0x6bf9('0x20')),'XMD-DIALURL':_0x2db6c6['dialPreviewUrl']||'','XMD-AGI':_0x2db6c6[_0x6bf9('0x21')]?util[_0x6bf9('0x1c')](_0x6bf9('0x22'),ipAgi,_0x2db6c6[_0x6bf9('0x21')]):'NONE','XMD-AGIAFTER':_0x2db6c6[_0x6bf9('0x1e')]?util[_0x6bf9('0x1c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2db6c6[_0x6bf9('0x1e')]):_0x6bf9('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x6ff6ef?_0x6ff6ef[_0x6bf9('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x6ff6ef?_0x6ff6ef[_0x6bf9('0x25')]:'','XMD-DESTINATION':_0x6bf9('0x26')};if(!_[_0x6bf9('0x11')](_0x2db6c6[_0x6bf9('0x1f')])){_0x170fd9[util['format']('%s',_0x6bf9('0x27'))]=_0x2db6c6[_0x6bf9('0x1f')];_0x170fd9[util[_0x6bf9('0x1c')]('%s',_0x6bf9('0x28'))]=_0x433eb2;}if(_0x339cbb&&_0x339cbb[_0x6bf9('0x29')]){for(var _0x3f64fa in _0x339cbb['Contact']){if(_0x339cbb[_0x6bf9('0x29')][_0x6bf9('0x2a')](_0x3f64fa)){if(!_[_0x6bf9('0x2b')](_0x339cbb[_0x6bf9('0x29')][_0x3f64fa])&&_0x3f64fa!=='id'&&_0x3f64fa!==_0x6bf9('0x2c')&&_0x3f64fa!==_0x6bf9('0x2d')&&_0x3f64fa!=='updatedAt'){_0x170fd9[util[_0x6bf9('0x1c')](_0x6bf9('0x2e'),_0x6bf9('0x2f'),_[_0x6bf9('0x30')](_0x3f64fa))]=_0x339cbb[_0x6bf9('0x29')][_0x3f64fa];}}}}return _0x170fd9;};exports[_0x6bf9('0x31')]=function(_0x38ee67){var _0x41572e={};for(var _0xf2baa7 in _0x38ee67){if(_0x38ee67['hasOwnProperty'](_0xf2baa7)){_0x41572e[util[_0x6bf9('0x1c')]('%s',_[_0x6bf9('0x32')](_0xf2baa7))]=_0x38ee67[_0xf2baa7];}}return{'variables':_0x41572e};};exports[_0x6bf9('0x33')]=function(_0x1ee6df,_0x29419b){if(!_[_0x6bf9('0x2b')](_0x1ee6df)){if(_0x1ee6df[_0x6bf9('0x2a')](_0x6bf9('0x34'))){if(_0x1ee6df[_0x6bf9('0x34')]>0x0){_0x1ee6df[_0x6bf9('0x34')]-=0x1;}else{logger[_0x6bf9('0xd')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x29419b);}}}else{logger[_0x6bf9('0xd')](_0x6bf9('0x35'),_0x29419b);}};exports[_0x6bf9('0x36')]=function(_0x1a681b){var _0x318d64=moment()[_0x6bf9('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');_0x1a681b[_0x6bf9('0x37')]=0xd;_0x1a681b[_0x6bf9('0x38')]='Blacklist';_0x1a681b[_0x6bf9('0x39')]=_0x318d64;_0x1a681b[_0x6bf9('0x3a')]=_0x318d64;_0x1a681b['endtime']=_0x318d64;};exports[_0x6bf9('0x3b')]=function(_0x537ac0,_0x5d52a3,_0x48bdb0){var _0x138fea=moment()['format'](_0x6bf9('0x3c'));_0x537ac0[_0x6bf9('0x37')]=_0x5d52a3;_0x537ac0['statedesc']=_0x48bdb0;_0x537ac0[_0x6bf9('0x3a')]=_0x138fea;_0x537ac0[_0x6bf9('0x3d')]=getSeconds(_0x537ac0['responsetime'],_0x537ac0[_0x6bf9('0x39')]);};exports['logLookAgent']=function(_0x1f819d,_0x363b36,_0x599207){_0x1f819d[_0x6bf9('0x3e')]=_0x363b36;_0x1f819d['UserId']=_0x599207;};exports[_0x6bf9('0x3f')]=function(_0x2daf41,_0x51d25b,_0xca8c72){var _0x25bb66=moment()[_0x6bf9('0x1c')](_0x6bf9('0x3c'));_0x2daf41[_0x6bf9('0x37')]=_0x51d25b;_0x2daf41[_0x6bf9('0x38')]=_0xca8c72;_0x2daf41[_0x6bf9('0x3a')]=_0x2daf41[_0x6bf9('0x3a')]?_0x2daf41[_0x6bf9('0x3a')]:_0x25bb66;_0x2daf41[_0x6bf9('0x40')]=_0x2daf41['endtime']?_0x2daf41[_0x6bf9('0x40')]:_0x25bb66;_0x2daf41[_0x6bf9('0x3d')]=getSeconds(_0x2daf41['responsetime']||0x0,_0x2daf41[_0x6bf9('0x39')]||0x0);_0x2daf41[_0x6bf9('0x41')]=_0x2daf41['answertime']?getSeconds(_0x2daf41['endtime'],_0x2daf41[_0x6bf9('0x42')]):0x0;};exports[_0x6bf9('0x43')]=function(_0xe896aa){return _0xe896aa===_0x6bf9('0x44');};exports[_0x6bf9('0x45')]=function(_0x94a7f5,_0x1e2a36,_0x102b5d,_0xd2400b,_0x32e42c){var _0x5d70ed=_0xd2400b?_0x6bf9('0x46'):_0x94a7f5[_0x6bf9('0x18')];_0x5d70ed=_0x32e42c?_0x6bf9('0x47'):_0x5d70ed;return{'actionid':_0x94a7f5[_0x6bf9('0x48')],'action':_0x6bf9('0x49'),'channel':_0x94a7f5[_0x6bf9('0x4a')],'callerid':util[_0x6bf9('0x1c')](_0x6bf9('0x13'),_0x5d70ed,_0x94a7f5['calleridnum']),'Exten':_0x6bf9('0x26'),'Context':_0x6bf9('0x4b'),'Priority':'1','variable':_0x102b5d,'timeout':(_0x1e2a36[_0x6bf9('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x94a7f5['uniqueid']};};exports[_0x6bf9('0x4d')]=function(_0x3f937f){return _0x3f937f[_0x6bf9('0x4e')]+_0x3f937f[_0x6bf9('0x4f')]+_0x3f937f[_0x6bf9('0x50')];};exports[_0x6bf9('0x51')]=function(_0x2afdaf){var _0x4889ae=_[_0x6bf9('0x52')](_0x2afdaf);_0x4889ae[_0x6bf9('0x37')]=0xf;_0x4889ae[_0x6bf9('0x38')]=_0x6bf9('0x53');return _0x4889ae;};exports[_0x6bf9('0x54')]=function(_0x30d5b8,_0x140f12,_0x4ab9e9){var _0x59ed37={};_0x59ed37[_0x140f12]=_0x30d5b8[_0x140f12];_0x59ed37[_0x6bf9('0x55')]=![];_0x59ed37[_0x6bf9('0x56')]=moment()['add'](_0x4ab9e9,_0x6bf9('0x57'))[_0x6bf9('0x1c')](_0x6bf9('0x3c'));_0x59ed37[_0x6bf9('0x19')]=_0x30d5b8[_0x6bf9('0x19')];_0x59ed37[_0x6bf9('0x58')]=_0x30d5b8[_0x6bf9('0x58')];_0x59ed37[_0x6bf9('0x1a')]=_0x30d5b8[_0x6bf9('0x1a')]||undefined;return _0x59ed37;};exports['decrementTalkink']=function(_0x4dcc89,_0x26c67d){if(!_[_0x6bf9('0x2b')](_0x4dcc89)){if(_0x4dcc89['pTalking']>0x0){_0x4dcc89[_0x6bf9('0x59')]-=0x1;}else{logger[_0x6bf9('0xd')](_0x26c67d,_0x6bf9('0x5a'));}}else{logger['error'](_0x26c67d,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x6bf9('0x5b')]=function(_0x5daea1){if(_0x5daea1<=0x0){return!![];}return![];};exports['buildObj']=function(_0x11a07e,_0xecbf8b){_0x11a07e[_0x6bf9('0x5c')]=_0xecbf8b;_0x11a07e['name']=_0x11a07e['queue'];_0x11a07e['interface']=_0x11a07e[_0x6bf9('0x4a')];return _0x11a07e;};exports[_0x6bf9('0x5d')]=function(_0x1235fe){var _0xe51dae={};_0xe51dae[_0x6bf9('0x5e')]=_0x1235fe['queue'];_0xe51dae['interface']=_0x1235fe[_0x6bf9('0x4a')];_0xe51dae['uniqueid']=_0x1235fe[_0x6bf9('0x48')];return _0xe51dae;};exports['agentReadyId']=function(_0x170673){var _0x1aff15=[];for(var _0x40945f in _0x170673){if(_0x170673[_0x6bf9('0x2a')](_0x40945f)){if(!_[_0x6bf9('0x2b')](_0x170673[_0x40945f])&&_0x170673[_0x40945f][_0x6bf9('0x37')]===_0x6bf9('0x5f')&&_0x170673[_0x40945f][_0x6bf9('0x60')]===_0x6bf9('0x61')){_0x1aff15[_0x6bf9('0x62')](_0x170673[_0x40945f]['id']);}}}return _0x1aff15;};exports[_0x6bf9('0x63')]=function(_0x3eb4ac){var _0x54a387=moment()['milliseconds'](0x0);var _0x11b754=moment(_0x3eb4ac)['milliseconds'](0x0);return _0x54a387[_0x6bf9('0x7')](_0x11b754,_0x6bf9('0x64'));};exports[_0x6bf9('0x65')]=function(_0x290565){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x290565[_0x6bf9('0x19')],'ListId':_0x290565[_0x6bf9('0x58')],'VoiceQueueId':_0x290565[_0x6bf9('0x1a')]||undefined,'CampaignId':_0x290565['CampaignId']||undefined};};exports[_0x6bf9('0x66')]=function(_0x26ff2d){if(_0x26ff2d==='uniqueid'||_0x26ff2d==='idContact'||_0x26ff2d===_0x6bf9('0x5e')||_0x26ff2d==='type'||_0x26ff2d===_0x6bf9('0x67')||_0x26ff2d==='dialAnswer'||_0x26ff2d==='membername'||_0x26ff2d==='channelAgent'||_0x26ff2d===_0x6bf9('0x18')||_0x26ff2d===_0x6bf9('0x55')||_0x26ff2d===_0x6bf9('0x68')||_0x26ff2d===_0x6bf9('0x56')||_0x26ff2d==='countbusyretry'||_0x26ff2d===_0x6bf9('0x4f')||_0x26ff2d===_0x6bf9('0x50')||_0x26ff2d===_0x6bf9('0x69')||_0x26ff2d===_0x6bf9('0x6a')||_0x26ff2d===_0x6bf9('0x6b')||_0x26ff2d==='callbackat'||_0x26ff2d===_0x6bf9('0x6c')||_0x26ff2d===_0x6bf9('0x19')||_0x26ff2d===_0x6bf9('0x58')||_0x26ff2d===_0x6bf9('0x6d')||_0x26ff2d==='VoiceQueueId'||_0x26ff2d===_0x6bf9('0x6e')||_0x26ff2d===_0x6bf9('0x6f')||_0x26ff2d==='xmd-queue'||_0x26ff2d===_0x6bf9('0x70')||_0x26ff2d===_0x6bf9('0x71')||_0x26ff2d===_0x6bf9('0x72')||_0x26ff2d==='xmd-dialtimeout'||_0x26ff2d===_0x6bf9('0x73')||_0x26ff2d===_0x6bf9('0x74')||_0x26ff2d===_0x6bf9('0x75')||_0x26ff2d===_0x6bf9('0x76')||_0x26ff2d==='xmd-cdrtype'||_0x26ff2d===_0x6bf9('0x77')||_0x26ff2d===_0x6bf9('0x78')||_0x26ff2d==='xmd-agi'||_0x26ff2d==='rtpaudioqos'||_0x26ff2d===_0x6bf9('0x79')||_0x26ff2d===_0x6bf9('0x7a')||_0x26ff2d==='rtpaudioqosjitterbridged'||_0x26ff2d===_0x6bf9('0x7b')||_0x26ff2d==='rtpaudioqoslossbridged'||_0x26ff2d===_0x6bf9('0x7c')||_0x26ff2d===_0x6bf9('0x7d')||_0x26ff2d===_0x6bf9('0x7e')||_0x26ff2d===_0x6bf9('0x79')||_0x26ff2d===_0x6bf9('0x7a')||_0x26ff2d==='rtpaudioqosjitterbridged'||_0x26ff2d===_0x6bf9('0x7b')||_0x26ff2d===_0x6bf9('0x7f')||_0x26ff2d==='rtpaudioqosrtt'||_0x26ff2d==='rtpaudioqosrttbridged'||_0x26ff2d===_0x6bf9('0x80')||_0x26ff2d===_0x6bf9('0x81')||_0x26ff2d===_0x6bf9('0x37')||_0x26ff2d===_0x6bf9('0x38')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2c3538,_0x70bb76){var _0x1bfd7d,_0x5613bb,_0x56afd6;if(_0x70bb76<=0x0){_0x70bb76=0x1;}_0x1bfd7d=new RegExp(_0x6bf9('0x82')+_0x70bb76+'}$');_0x5613bb=Math[_0x6bf9('0x83')](0xa,_0x70bb76-0x1);_0x56afd6=Math[_0x6bf9('0x83')](0xa,_0x70bb76)-0x1;return util[_0x6bf9('0x1c')]('%s',_['replace'](_0x2c3538,_0x1bfd7d,_[_0x6bf9('0x84')](_0x5613bb,_0x56afd6)));};exports[_0x6bf9('0x85')]=function(_0x521c3e){var _0x39bbcc=_0x521c3e[_0x6bf9('0x86')](/"(.*?)"/);return _0x39bbcc?_0x39bbcc[0x1]:_0x521c3e;};exports[_0x6bf9('0x87')]=function(_0x30a8c3){var _0x317d8=_0x30a8c3['match'](/<(.*?)>/);return _0x317d8?_0x317d8[0x1]:_0x30a8c3;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 12d6a15..06beeb9 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 _0x943c=['string','queueremove','boolean','reload','voicequeuechannel','voicequeuechannelredirect','queueadd'];(function(_0x3d0a96,_0x124348){var _0x51962a=function(_0x5baf89){while(--_0x5baf89){_0x3d0a96['push'](_0x3d0a96['shift']());}};_0x51962a(++_0x124348);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';exports[_0xc943('0x0')]={'queue':{'type':_0xc943('0x1'),'required':!![]},'interface':{'type':_0xc943('0x1'),'required':!![]},'membername':{'type':_0xc943('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xc943('0x2')]={'queue':{'type':_0xc943('0x1'),'required':!![]},'interface':{'type':_0xc943('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xc943('0x1'),'required':!![]},'paused':{'type':_0xc943('0x3')},'reason':{'type':_0xc943('0x1'),'required':![]}};exports[_0xc943('0x4')]={'module':{'type':_0xc943('0x1'),'required':![]}};exports[_0xc943('0x5')]={'uniqueid':{'type':_0xc943('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xc943('0x1'),'required':!![]},'filename':{'type':_0xc943('0x1')},'format':{'type':_0xc943('0x1')},'mixmonitorid':{'type':_0xc943('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0xc943('0x6')]={'uniqueid':{'type':_0xc943('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x04de=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','voicequeuechannel'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x04de,0x107));var _0xe04d=function(_0x1c192a,_0x473b63){_0x1c192a=_0x1c192a-0x0;var _0xa52724=_0x04de[_0x1c192a];return _0xa52724;};'use strict';exports[_0xe04d('0x0')]={'queue':{'type':_0xe04d('0x1'),'required':!![]},'interface':{'type':_0xe04d('0x1'),'required':!![]},'membername':{'type':_0xe04d('0x1'),'required':!![]},'penalty':{'type':_0xe04d('0x2'),'required':![]},'paused':{'type':_0xe04d('0x3'),'required':![]}};exports[_0xe04d('0x4')]={'queue':{'type':_0xe04d('0x1'),'required':!![]},'interface':{'type':_0xe04d('0x1'),'required':!![]}};exports[_0xe04d('0x5')]={'interface':{'type':_0xe04d('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0xe04d('0x6')]={'uniqueid':{'type':_0xe04d('0x1'),'required':!![]}};exports[_0xe04d('0x7')]={'uniqueid':{'type':_0xe04d('0x1'),'required':!![]},'filename':{'type':_0xe04d('0x1')},'format':{'type':_0xe04d('0x1')},'mixmonitorid':{'type':_0xe04d('0x1')}};exports[_0xe04d('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xe04d('0x9')]={'uniqueid':{'type':_0xe04d('0x1'),'required':!![]},'exten':{'type':_0xe04d('0x1'),'required':!![]},'context':{'type':_0xe04d('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 2c8dc3b..9cea37f 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 _0x5a01=['queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initVoiceExtensions','initCampaignHopperHistory','exports','bluebird','util','lodash','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','hasOwnProperty','mapKeys','format','name','isNil','interface','SIP/%s','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initTelephones','telephones','length','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','merge','initVoiceQueueReports','groupBy','uniqueid','queue'];(function(_0x76ccc6,_0x97748b){var _0x50eeff=function(_0x1066ea){while(--_0x1066ea){_0x76ccc6['push'](_0x76ccc6['shift']());}};_0x50eeff(++_0x97748b);}(_0x5a01,0x1af));var _0x15a0=function(_0x359d3e,_0x9d9e5b){_0x359d3e=_0x359d3e-0x0;var _0x533931=_0x5a01[_0x359d3e];return _0x533931;};'use strict';var BPromise=require(_0x15a0('0x0'));var util=require(_0x15a0('0x1'));var _=require(_0x15a0('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0x15a0('0x3'));var Trunk=require(_0x15a0('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x15a0('0x5'));var Template=require(_0x15a0('0x6'));var Campaign=require(_0x15a0('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x15a0('0x8'));var FreshdeskAccount=require(_0x15a0('0x9'));var SugarcrmAccount=require(_0x15a0('0xa'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x15a0('0xb'));var VtigerAccount=require(_0x15a0('0xc'));var ServicenowAccount=require(_0x15a0('0xd'));var Dynamics365Account=require(_0x15a0('0xe'));var FaxAccount=require(_0x15a0('0xf'));var Realtime=function(){this['agents']={};this['telephones']={};this[_0x15a0('0x10')]={};this[_0x15a0('0x11')]={};this[_0x15a0('0x12')]={};this[_0x15a0('0x13')]={};this[_0x15a0('0x14')]={};this[_0x15a0('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x15a0('0x16')]={};this[_0x15a0('0x17')]={};this[_0x15a0('0x18')]={};this[_0x15a0('0x19')]={};this[_0x15a0('0x1a')]={};this[_0x15a0('0x1b')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0x15a0('0x1c')]={};this[_0x15a0('0x1d')]={};this[_0x15a0('0x1e')]={};this[_0x15a0('0x1f')]={};this[_0x15a0('0x20')]={};this[_0x15a0('0x21')]={};this[_0x15a0('0x22')]={};};function freeIsNotKey(_0x2568ee,_0x2b8a17,_0x547d10){var _0x40d6e7=_['mapKeys'](_0x2568ee,function(_0x593f2c,_0x2805d1){return _0x593f2c[_0x547d10];});for(var _0x2896bb in _0x2b8a17){if(_0x2b8a17[_0x15a0('0x23')](_0x2896bb)){if(!_0x40d6e7[_0x2896bb]){delete _0x2b8a17[_0x2896bb];}}}}function freeIsNotKeySip(_0x29383c,_0x5d4373){var _0x5e7b01=_[_0x15a0('0x24')](_0x29383c,function(_0x33ef93,_0x56a2be){return util[_0x15a0('0x25')]('SIP/%s',_0x33ef93[_0x15a0('0x26')]);});for(var _0x427f60 in _0x5d4373){if(_0x5d4373[_0x15a0('0x23')](_0x427f60)){if(!_0x5e7b01[_0x427f60]){delete _0x5d4373[_0x427f60];}}}}function freeIsNotKeyAgent(_0xc035d3,_0x225aac){var _0xeeefcf=_[_0x15a0('0x24')](_0xc035d3,function(_0x4d076a,_0x4d4c1b){var _0x32eafd=_[_0x15a0('0x27')](_0x4d076a[_0x15a0('0x28')])?util[_0x15a0('0x25')](_0x15a0('0x29'),_0x4d076a[_0x15a0('0x26')]):_0x4d076a[_0x15a0('0x28')];return _0x32eafd;});for(var _0x53e470 in _0x225aac){if(_0x225aac['hasOwnProperty'](_0x53e470)){if(!_0xeeefcf[_0x53e470]){delete _0x225aac[_0x53e470];}}}}function clearVoiceCallReports(_0x3f251e){_0x3f251e['total']=0x0;_0x3f251e[_0x15a0('0x2a')]=0x0;_0x3f251e[_0x15a0('0x2b')]=0x0;_0x3f251e[_0x15a0('0x2c')]=0x0;_0x3f251e[_0x15a0('0x2d')]=0x0;}function clearCampaigns(_0x23a06b){if(!_[_0x15a0('0x2e')](_0x23a06b)){for(var _0x3b050f in _0x23a06b){if(_0x23a06b[_0x15a0('0x23')](_0x3b050f)){_0x23a06b[_0x3b050f][_0x15a0('0x2f')]=0x0;_0x23a06b[_0x3b050f][_0x15a0('0x30')]=0x0;}}}}function clearVoiceQueues(_0xf9781){if(!_['isEmpty'](_0xf9781)){for(var _0x21597a in _0xf9781){if(_0xf9781['hasOwnProperty'](_0x21597a)){_0xf9781[_0x21597a][_0x15a0('0x31')]=0x0;_0xf9781[_0x21597a]['answered']=0x0;_0xf9781[_0x21597a][_0x15a0('0x32')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x33')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x2b')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x2c')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x2d')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x34')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x35')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x36')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x37')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x38')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x39')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x3a')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x3b')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x3c')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x3d')]=0x0;_0xf9781[_0x21597a]['outboundRejectCallsDay']=0x0;_0xf9781[_0x21597a][_0x15a0('0x3e')]=0x0;_0xf9781[_0x21597a][_0x15a0('0x34')]=0x0;_0xf9781[_0x21597a]['outboundAnswerCallsDay']=0x0;_0xf9781[_0x21597a]['queueStatusComplete']=!![];}}}}Realtime[_0x15a0('0x3f')][_0x15a0('0x40')]=function(_0x55e3d5,_0x366133){for(var _0x3a9783 in _0x366133){if(_0x55e3d5['hasOwnProperty'](_0x3a9783)){_0x55e3d5[_0x3a9783]=_0x366133[_0x3a9783];}}};Realtime[_0x15a0('0x3f')][_0x15a0('0x41')]=function(){var _0x327177=this;return function(_0x48151d){if(_0x48151d){freeIsNotKeyAgent(_0x48151d,_0x327177[_0x15a0('0x42')]);for(var _0x161507=0x0,_0x1b8f64={},_0x1c9d4b={};_0x161507<_0x48151d['length'];_0x161507+=0x1){_0x1b8f64=_0x48151d[_0x161507];var _0x696620=_[_0x15a0('0x27')](_0x1b8f64['interface'])?util['format']('SIP/%s',_0x1b8f64[_0x15a0('0x26')]):_0x1b8f64[_0x15a0('0x28')];if(_[_0x15a0('0x43')](_0x327177[_0x15a0('0x42')][_0x696620])){_0x327177[_0x15a0('0x42')][_0x696620]=new Agent(_0x1b8f64);}else{_0x327177[_0x15a0('0x40')](_0x327177[_0x15a0('0x42')][_0x696620],_0x1b8f64);}}}return _0x327177[_0x15a0('0x42')];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x44')]=function(){var _0x111d96=this;return function(_0x320657){if(_0x320657){freeIsNotKeySip(_0x320657,_0x111d96[_0x15a0('0x45')]);for(var _0x2ac889=0x0,_0x30994e={},_0x203564={};_0x2ac889<_0x320657[_0x15a0('0x46')];_0x2ac889+=0x1){_0x30994e=_0x320657[_0x2ac889];if(_[_0x15a0('0x43')](_0x111d96[_0x15a0('0x45')][util[_0x15a0('0x25')](_0x15a0('0x29'),_0x30994e[_0x15a0('0x26')])])){_0x111d96['telephones'][util[_0x15a0('0x25')](_0x15a0('0x29'),_0x30994e[_0x15a0('0x26')])]=new Telephone(_0x30994e);}else{_0x111d96[_0x15a0('0x40')](_0x111d96[_0x15a0('0x45')][util['format'](_0x15a0('0x29'),_0x30994e[_0x15a0('0x26')])],_0x30994e);}}}return _0x111d96[_0x15a0('0x45')];};};Realtime[_0x15a0('0x3f')]['initTrunks']=function(){var _0xbe736e=this;return function(_0x42b2b4){if(_0x42b2b4){freeIsNotKeySip(_0x42b2b4,_0xbe736e[_0x15a0('0x10')]);for(var _0x28f63a=0x0,_0x22e877={},_0x470ce4={};_0x28f63a<_0x42b2b4['length'];_0x28f63a+=0x1){_0x22e877=_0x42b2b4[_0x28f63a];if(_[_0x15a0('0x43')](_0xbe736e[_0x15a0('0x10')][util[_0x15a0('0x25')](_0x15a0('0x29'),_0x22e877['name'])])){_0xbe736e[_0x15a0('0x10')][util[_0x15a0('0x25')](_0x15a0('0x29'),_0x22e877['name'])]=new Trunk(_0x22e877);}else{_0xbe736e[_0x15a0('0x40')](_0xbe736e['trunks'][util[_0x15a0('0x25')](_0x15a0('0x29'),_0x22e877[_0x15a0('0x26')])],_0x22e877);}}}return _0xbe736e[_0x15a0('0x10')];};};Realtime['prototype'][_0x15a0('0x47')]=function(){var _0x2eb628=this;return function(_0x4e4103){if(_0x4e4103){freeIsNotKey(_0x4e4103,_0x2eb628['voiceQueues'],'name');for(var _0x55703d=0x0,_0x2b33dd={},_0x125c36={};_0x55703d<_0x4e4103[_0x15a0('0x46')];_0x55703d+=0x1){_0x2b33dd=_0x4e4103[_0x55703d];if(_[_0x15a0('0x43')](_0x2eb628['voiceQueues'][_0x2b33dd[_0x15a0('0x26')]])){_0x2eb628[_0x15a0('0x11')][_0x2b33dd[_0x15a0('0x26')]]=new VoiceQueue(_0x2b33dd);}else{_0x2eb628[_0x15a0('0x40')](_0x2eb628['voiceQueues'][_0x2b33dd[_0x15a0('0x26')]],_0x2b33dd);}}}return _0x2eb628['voiceQueues'];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x48')]=function(){var _0x30dde7=this;return function(_0x37d3da){if(_0x37d3da){freeIsNotKey(_0x37d3da,_0x30dde7[_0x15a0('0x12')],'id');for(var _0x27a2b9=0x0,_0x1a7861={},_0x4f56d5={};_0x27a2b9<_0x37d3da[_0x15a0('0x46')];_0x27a2b9+=0x1){_0x1a7861=_0x37d3da[_0x27a2b9];if(_[_0x15a0('0x43')](_0x30dde7[_0x15a0('0x12')][_0x1a7861['id']])){_0x30dde7[_0x15a0('0x12')][_0x1a7861['id']]=new Trigger(_0x1a7861);}else{_0x30dde7[_0x15a0('0x40')](_0x30dde7[_0x15a0('0x12')][_0x1a7861['id']],_0x1a7861);}}}return _0x30dde7[_0x15a0('0x12')];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x49')]=function(){var _0x5cfca7=this;return function(_0x51d164){if(_0x51d164){freeIsNotKey(_0x51d164,_0x5cfca7[_0x15a0('0x14')],'id');for(var _0x22a665=0x0,_0x41bba1={},_0x1df8a2={};_0x22a665<_0x51d164[_0x15a0('0x46')];_0x22a665+=0x1){_0x41bba1=_0x51d164[_0x22a665];if(_[_0x15a0('0x43')](_0x5cfca7[_0x15a0('0x14')][_0x41bba1['id']])){_0x5cfca7[_0x15a0('0x14')][_0x41bba1['id']]=new Template(_0x41bba1);}else{_0x5cfca7[_0x15a0('0x40')](_0x5cfca7[_0x15a0('0x14')][_0x41bba1['id']],_0x41bba1);}}}return _0x5cfca7[_0x15a0('0x14')];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x4a')]=function(){var _0x1e2cba=this;return function(_0x304d80){if(_0x304d80){freeIsNotKey(_0x304d80,_0x1e2cba[_0x15a0('0x1b')],'id');for(var _0x569963=0x0,_0x2427b4={},_0x5bf69d={};_0x569963<_0x304d80[_0x15a0('0x46')];_0x569963+=0x1){_0x2427b4=_0x304d80[_0x569963];if(_[_0x15a0('0x43')](_0x1e2cba['zendeskAccounts'][_0x2427b4['id']])){_0x1e2cba[_0x15a0('0x1b')][_0x2427b4['id']]=new ZendeskAccount(_0x2427b4);}else{_0x1e2cba[_0x15a0('0x40')](_0x1e2cba[_0x15a0('0x1b')][_0x2427b4['id']],_0x2427b4);}}}return _0x1e2cba[_0x15a0('0x1b')];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x4b')]=function(){var _0xb14ccf=this;return function(_0x49dc3c){if(_0x49dc3c){freeIsNotKey(_0x49dc3c,_0xb14ccf[_0x15a0('0x4c')],'id');for(var _0x4877a2=0x0,_0x1e301f={},_0x5df39b={};_0x4877a2<_0x49dc3c['length'];_0x4877a2+=0x1){_0x1e301f=_0x49dc3c[_0x4877a2];if(_[_0x15a0('0x43')](_0xb14ccf[_0x15a0('0x4c')][_0x1e301f['id']])){_0xb14ccf[_0x15a0('0x4c')][_0x1e301f['id']]=new SalesforceAccount(_0x1e301f);}else{_0xb14ccf[_0x15a0('0x40')](_0xb14ccf[_0x15a0('0x4c')][_0x1e301f['id']],_0x1e301f);}}}return _0xb14ccf[_0x15a0('0x4c')];};};Realtime['prototype'][_0x15a0('0x4d')]=function(){var _0x4802aa=this;return function(_0x5bd058){if(_0x5bd058){freeIsNotKey(_0x5bd058,_0x4802aa[_0x15a0('0x1c')],'id');for(var _0x252cdf=0x0,_0xd35471={},_0xe9bc65={};_0x252cdf<_0x5bd058['length'];_0x252cdf+=0x1){_0xd35471=_0x5bd058[_0x252cdf];if(_[_0x15a0('0x43')](_0x4802aa[_0x15a0('0x1c')][_0xd35471['id']])){_0x4802aa[_0x15a0('0x1c')][_0xd35471['id']]=new FreshdeskAccount(_0xd35471);}else{_0x4802aa[_0x15a0('0x40')](_0x4802aa[_0x15a0('0x1c')][_0xd35471['id']],_0xd35471);}}}return _0x4802aa[_0x15a0('0x1c')];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x4e')]=function(){var _0x56a998=this;return function(_0x371b9b){if(_0x371b9b){freeIsNotKey(_0x371b9b,_0x56a998[_0x15a0('0x1d')],'id');for(var _0x25e8dc=0x0,_0x561962={},_0x5b8668={};_0x25e8dc<_0x371b9b[_0x15a0('0x46')];_0x25e8dc+=0x1){_0x561962=_0x371b9b[_0x25e8dc];if(_['isUndefined'](_0x56a998[_0x15a0('0x1d')][_0x561962['id']])){_0x56a998[_0x15a0('0x1d')][_0x561962['id']]=new ZohoAccount(_0x561962);}else{_0x56a998['mergeFromDatabase'](_0x56a998['zohoAccounts'][_0x561962['id']],_0x561962);}}}return _0x56a998[_0x15a0('0x1d')];};};Realtime['prototype'][_0x15a0('0x4f')]=function(){var _0x5ca247=this;return function(_0x23b2b6){if(_0x23b2b6){freeIsNotKey(_0x23b2b6,_0x5ca247[_0x15a0('0x1e')],'id');for(var _0x2ffb50=0x0,_0x192a76={},_0x2fba0e={};_0x2ffb50<_0x23b2b6['length'];_0x2ffb50+=0x1){_0x192a76=_0x23b2b6[_0x2ffb50];if(_[_0x15a0('0x43')](_0x5ca247[_0x15a0('0x1e')][_0x192a76['id']])){_0x5ca247[_0x15a0('0x1e')][_0x192a76['id']]=new DeskAccount(_0x192a76);}else{_0x5ca247['mergeFromDatabase'](_0x5ca247[_0x15a0('0x1e')][_0x192a76['id']],_0x192a76);}}}return _0x5ca247[_0x15a0('0x1e')];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x50')]=function(){var _0x51efa6=this;return function(_0x30805d){if(_0x30805d){freeIsNotKey(_0x30805d,_0x51efa6[_0x15a0('0x51')],'id');for(var _0x2a1d74=0x0,_0x1a0478={},_0x16503a={};_0x2a1d74<_0x30805d[_0x15a0('0x46')];_0x2a1d74+=0x1){_0x1a0478=_0x30805d[_0x2a1d74];if(_[_0x15a0('0x43')](_0x51efa6[_0x15a0('0x51')][_0x1a0478['id']])){_0x51efa6[_0x15a0('0x51')][_0x1a0478['id']]=new SugarcrmAccount(_0x1a0478);}else{_0x51efa6[_0x15a0('0x40')](_0x51efa6['sugarcrmAccounts'][_0x1a0478['id']],_0x1a0478);}}}return _0x51efa6[_0x15a0('0x51')];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x52')]=function(){var _0xe80973=this;return function(_0x332833){if(_0x332833){freeIsNotKey(_0x332833,_0xe80973['vtigerAccounts'],'id');for(var _0x160e3b=0x0,_0xfb585b={},_0x421af2={};_0x160e3b<_0x332833[_0x15a0('0x46')];_0x160e3b+=0x1){_0xfb585b=_0x332833[_0x160e3b];if(_[_0x15a0('0x43')](_0xe80973[_0x15a0('0x1f')][_0xfb585b['id']])){_0xe80973[_0x15a0('0x1f')][_0xfb585b['id']]=new VtigerAccount(_0xfb585b);}else{_0xe80973[_0x15a0('0x40')](_0xe80973[_0x15a0('0x1f')][_0xfb585b['id']],_0xfb585b);}}}return _0xe80973[_0x15a0('0x1f')];};};Realtime[_0x15a0('0x3f')]['initServicenowAccounts']=function(){var _0x292b5a=this;return function(_0x115db3){if(_0x115db3){freeIsNotKey(_0x115db3,_0x292b5a[_0x15a0('0x20')],'id');for(var _0x4ff5df=0x0,_0x9c0467={},_0x498945={};_0x4ff5df<_0x115db3[_0x15a0('0x46')];_0x4ff5df+=0x1){_0x9c0467=_0x115db3[_0x4ff5df];if(_[_0x15a0('0x43')](_0x292b5a[_0x15a0('0x20')][_0x9c0467['id']])){_0x292b5a[_0x15a0('0x20')][_0x9c0467['id']]=new ServicenowAccount(_0x9c0467);}else{_0x292b5a['mergeFromDatabase'](_0x292b5a[_0x15a0('0x20')][_0x9c0467['id']],_0x9c0467);}}}return _0x292b5a[_0x15a0('0x20')];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x53')]=function(){var _0xdfc76d=this;return function(_0x58c80d){if(_0x58c80d){freeIsNotKey(_0x58c80d,_0xdfc76d['dynamics365Accounts'],'id');for(var _0x3bc2d0=0x0,_0x5d27ef={},_0x4a40d5={};_0x3bc2d0<_0x58c80d[_0x15a0('0x46')];_0x3bc2d0+=0x1){_0x5d27ef=_0x58c80d[_0x3bc2d0];if(_[_0x15a0('0x43')](_0xdfc76d[_0x15a0('0x21')][_0x5d27ef['id']])){_0xdfc76d['dynamics365Accounts'][_0x5d27ef['id']]=new Dynamics365Account(_0x5d27ef);}else{_0xdfc76d[_0x15a0('0x40')](_0xdfc76d[_0x15a0('0x21')][_0x5d27ef['id']],_0x5d27ef);}}}return _0xdfc76d[_0x15a0('0x21')];};};Realtime[_0x15a0('0x3f')]['initVoiceQueueHopperHistory']=function(){var _0xcf0f0d=this;return function(_0x15d510){for(var _0x51a6f7=0x0;_0x51a6f7<_0x15d510[_0x15a0('0x46')];_0x51a6f7+=0x1){_[_0x15a0('0x54')](_0xcf0f0d[_0x15a0('0x11')][_0x15d510[_0x51a6f7]['name']],_0x15d510[_0x51a6f7]);}return _0xcf0f0d[_0x15a0('0x11')];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x55')]=function(){var _0x5a2926=this;return function(_0x1b246c){clearVoiceQueues(_0x5a2926['voiceQueues']);if(_0x1b246c){_0x1b246c=_[_0x15a0('0x56')](_0x1b246c,_0x15a0('0x57'));for(var _0x2be20b in _0x1b246c){if(_0x1b246c[_0x15a0('0x23')](_0x2be20b)){var _0x462b2e={};for(var _0x8829a0=0x0;_0x8829a0<_0x1b246c[_0x2be20b][_0x15a0('0x46')];_0x8829a0+=0x1){var _0x5e51b2=_0x1b246c[_0x2be20b][_0x8829a0][_0x15a0('0x58')];if(_0x5a2926[_0x15a0('0x11')][_0x5e51b2]){if(_0x1b246c[_0x2be20b][_0x8829a0][_0x15a0('0x59')]){_0x5a2926[_0x15a0('0x11')][_0x5e51b2][_0x15a0('0x32')]+=0x1;}if(_0x1b246c[_0x2be20b][_0x8829a0][_0x15a0('0x5a')]){_0x5a2926[_0x15a0('0x11')][_0x5e51b2][_0x15a0('0x33')]+=0x1;}_0x5a2926[_0x15a0('0x11')][_0x5e51b2][_0x15a0('0x2b')]+=moment(_0x1b246c[_0x2be20b][_0x8829a0]['queuecallerleaveAt'])[_0x15a0('0x5b')](moment(_0x1b246c[_0x2be20b][_0x8829a0][_0x15a0('0x5c')]),_0x15a0('0x5d'))||0x0;if(_0x8829a0===_0x1b246c[_0x2be20b][_0x15a0('0x46')]-0x1){_0x5a2926[_0x15a0('0x11')][_0x5e51b2][_0x15a0('0x2c')]+=moment(_0x1b246c[_0x2be20b][_0x8829a0][_0x15a0('0x5e')]||_0x1b246c[_0x2be20b][_0x8829a0]['queuecallerabandonAt']||_0x1b246c[_0x2be20b][_0x8829a0][_0x15a0('0x5f')])[_0x15a0('0x5b')](moment(_0x1b246c[_0x2be20b][_0x8829a0][_0x15a0('0x5c')]),_0x15a0('0x5d'))||0x0;_0x5a2926['voiceQueues'][_0x5e51b2][_0x15a0('0x31')]+=0x1;if(_0x1b246c[_0x2be20b][_0x8829a0]['queuecallercomplete']){_0x5a2926[_0x15a0('0x11')][_0x5e51b2]['answered']+=0x1;_0x5a2926['voiceQueues'][_0x5e51b2]['sumBillable']+=moment(_0x1b246c[_0x2be20b][_0x8829a0][_0x15a0('0x5e')])[_0x15a0('0x5b')](moment(_0x1b246c[_0x2be20b][_0x8829a0]['queuecallerleaveAt']),_0x15a0('0x5d'))||0x0;}}else{_0x5a2926[_0x15a0('0x11')][_0x5e51b2][_0x15a0('0x2c')]+=_0x5a2926[_0x15a0('0x11')][_0x5e51b2][_0x15a0('0x2b')]||0x0;}}}}}}return _0x5a2926[_0x15a0('0x11')];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x60')]=function(){var _0x38a5a9=this;return function(_0x548a08){clearVoiceCallReports(_0x38a5a9[_0x15a0('0x15')]);if(_0x548a08){for(var _0x1ed022=0x0;_0x1ed022<_0x548a08[_0x15a0('0x46')];_0x1ed022+=0x1){_0x38a5a9['outbound'][_0x15a0('0x31')]+=0x1;_0x38a5a9[_0x15a0('0x15')][_0x15a0('0x2c')]+=_0x548a08[_0x1ed022][_0x15a0('0x61')];if(_0x548a08[_0x1ed022][_0x15a0('0x62')]===_0x15a0('0x63')){_0x38a5a9[_0x15a0('0x15')][_0x15a0('0x2a')]+=0x1;_0x38a5a9[_0x15a0('0x15')][_0x15a0('0x2b')]+=_0x548a08[_0x1ed022]['duration']-_0x548a08[_0x1ed022][_0x15a0('0x64')]||0x0;_0x38a5a9[_0x15a0('0x15')][_0x15a0('0x2d')]+=_0x548a08[_0x1ed022][_0x15a0('0x64')];}}}return _0x38a5a9[_0x15a0('0x15')];};};Realtime['prototype']['initCampaigns']=function(){var _0xefa54c=this;return function(_0x5bd8ba){if(_0x5bd8ba){freeIsNotKey(_0x5bd8ba,_0xefa54c[_0x15a0('0x13')],_0x15a0('0x26'));for(var _0x16687f=0x0,_0x1cfe43={};_0x16687f<_0x5bd8ba[_0x15a0('0x46')];_0x16687f+=0x1){_0x1cfe43=_0x5bd8ba[_0x16687f];if(_['isUndefined'](_0xefa54c[_0x15a0('0x13')][_0x1cfe43['name']])){_0xefa54c[_0x15a0('0x13')][_0x1cfe43[_0x15a0('0x26')]]=new Campaign(_0x1cfe43);}else{_0xefa54c[_0x15a0('0x40')](_0xefa54c['campaigns'][_0x1cfe43['name']],_0x1cfe43);}}}return _0xefa54c[_0x15a0('0x13')];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x65')]=function(){var _0x429c56=this;return function(_0x14b58f){if(_0x14b58f){freeIsNotKey(_0x14b58f,_0x429c56[_0x15a0('0x16')],'id');for(var _0x42f942=0x0,_0x2c5ec8={};_0x42f942<_0x14b58f[_0x15a0('0x46')];_0x42f942+=0x1){_0x2c5ec8=_0x14b58f[_0x42f942];if(_[_0x15a0('0x43')](_0x429c56[_0x15a0('0x16')][_0x2c5ec8['id']])){_0x429c56[_0x15a0('0x16')][_0x2c5ec8['id']]=new VoiceExtension(_0x2c5ec8);}else{_0x429c56[_0x15a0('0x40')](_0x429c56[_0x15a0('0x16')][_0x2c5ec8['id']],_0x2c5ec8);}}}return _0x429c56['voiceExtensions'];};};Realtime[_0x15a0('0x3f')][_0x15a0('0x66')]=function(){var _0x1a64db=this;return function(_0x2b83bf){clearCampaigns(_0x1a64db[_0x15a0('0x13')]);for(var _0x54ff16=0x0;_0x54ff16<_0x2b83bf[_0x15a0('0x46')];_0x54ff16+=0x1){_['merge'](_0x1a64db[_0x15a0('0x13')][_0x2b83bf[_0x54ff16][_0x15a0('0x26')]],_0x2b83bf[_0x54ff16]);}return _0x1a64db['campaigns'];};};Realtime[_0x15a0('0x3f')]['initFaxAccounts']=function(){var _0x1c16eb=this;return function(_0x5dccbb){if(_0x5dccbb){freeIsNotKey(_0x5dccbb,_0x1c16eb['faxAccounts'],'id');for(var _0x284107=0x0,_0x34e7ea={},_0x5073db={};_0x284107<_0x5dccbb[_0x15a0('0x46')];_0x284107+=0x1){_0x34e7ea=_0x5dccbb[_0x284107];if(_[_0x15a0('0x43')](_0x1c16eb['faxAccounts'][_0x34e7ea['id']])){_0x1c16eb[_0x15a0('0x22')][_0x34e7ea['id']]=new FaxAccount(_0x34e7ea);}else{_0x1c16eb[_0x15a0('0x40')](_0x1c16eb['faxAccounts'][_0x34e7ea['id']],_0x34e7ea);}}}return _0x1c16eb[_0x15a0('0x22')];};};module[_0x15a0('0x67')]=Realtime; \ No newline at end of file +var _0x14de=['../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','format','name','hasOwnProperty','isNil','interface','total','answered','sumDuration','isEmpty','ivrAnswerCallsDay','abandoned','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','prototype','mergeFromDatabase','initAgents','length','SIP/%s','isUndefined','initTelephones','initTrunks','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','zohoAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','queue','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','voiceExtensions','initFaxAccounts','faxAccounts','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue'];(function(_0x491633,_0x531563){var _0x42c63d=function(_0x23fe3d){while(--_0x23fe3d){_0x491633['push'](_0x491633['shift']());}};_0x42c63d(++_0x531563);}(_0x14de,0x1ea));var _0xe14d=function(_0x4be6d7,_0x88ecc4){_0x4be6d7=_0x4be6d7-0x0;var _0x672020=_0x14de[_0x4be6d7];return _0x672020;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xe14d('0x0'));var moment=require(_0xe14d('0x1'));var Agent=require(_0xe14d('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0xe14d('0x3'));var VoiceQueue=require(_0xe14d('0x4'));var Trigger=require(_0xe14d('0x5'));var Template=require('../model/template');var Campaign=require(_0xe14d('0x6'));var VoiceExtension=require(_0xe14d('0x7'));var ZendeskAccount=require(_0xe14d('0x8'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xe14d('0x9'));var SugarcrmAccount=require(_0xe14d('0xa'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xe14d('0xb'));var VtigerAccount=require(_0xe14d('0xc'));var ServicenowAccount=require(_0xe14d('0xd'));var Dynamics365Account=require(_0xe14d('0xe'));var FaxAccount=require(_0xe14d('0xf'));var Realtime=function(){this[_0xe14d('0x10')]={};this[_0xe14d('0x11')]={};this[_0xe14d('0x12')]={};this[_0xe14d('0x13')]={};this['triggers']={};this[_0xe14d('0x14')]={};this[_0xe14d('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0xe14d('0x16')]={};this[_0xe14d('0x17')]={};this[_0xe14d('0x18')]={};this[_0xe14d('0x19')]={};this[_0xe14d('0x1a')]={};this[_0xe14d('0x1b')]={};this[_0xe14d('0x1c')]={};this['zohoAccounts']={};this[_0xe14d('0x1d')]={};this['vtigerAccounts']={};this[_0xe14d('0x1e')]={};this[_0xe14d('0x1f')]={};this['faxAccounts']={};};function freeIsNotKey(_0x3880a6,_0x48ef6b,_0x2aba14){var _0x11043c=_['mapKeys'](_0x3880a6,function(_0x29cca3,_0x2eff9f){return _0x29cca3[_0x2aba14];});for(var _0x58874a in _0x48ef6b){if(_0x48ef6b['hasOwnProperty'](_0x58874a)){if(!_0x11043c[_0x58874a]){delete _0x48ef6b[_0x58874a];}}}}function freeIsNotKeySip(_0x868d2c,_0x59fb03){var _0x2e46a3=_[_0xe14d('0x20')](_0x868d2c,function(_0x10dd04,_0x5ce352){return util[_0xe14d('0x21')]('SIP/%s',_0x10dd04[_0xe14d('0x22')]);});for(var _0x3a27a4 in _0x59fb03){if(_0x59fb03[_0xe14d('0x23')](_0x3a27a4)){if(!_0x2e46a3[_0x3a27a4]){delete _0x59fb03[_0x3a27a4];}}}}function freeIsNotKeyAgent(_0x1f7c00,_0x5a87bd){var _0x2bbe06=_['mapKeys'](_0x1f7c00,function(_0x4054de,_0xa2c8ba){var _0x1d5413=_[_0xe14d('0x24')](_0x4054de[_0xe14d('0x25')])?util[_0xe14d('0x21')]('SIP/%s',_0x4054de['name']):_0x4054de[_0xe14d('0x25')];return _0x1d5413;});for(var _0x4be70 in _0x5a87bd){if(_0x5a87bd[_0xe14d('0x23')](_0x4be70)){if(!_0x2bbe06[_0x4be70]){delete _0x5a87bd[_0x4be70];}}}}function clearVoiceCallReports(_0x2f80a2){_0x2f80a2[_0xe14d('0x26')]=0x0;_0x2f80a2[_0xe14d('0x27')]=0x0;_0x2f80a2['sumHoldTime']=0x0;_0x2f80a2[_0xe14d('0x28')]=0x0;_0x2f80a2['sumBillable']=0x0;}function clearCampaigns(_0x47763d){if(!_[_0xe14d('0x29')](_0x47763d)){for(var _0x4dd13b in _0x47763d){if(_0x47763d[_0xe14d('0x23')](_0x4dd13b)){_0x47763d[_0x4dd13b]['ivrTotalCallsDays']=0x0;_0x47763d[_0x4dd13b][_0xe14d('0x2a')]=0x0;}}}}function clearVoiceQueues(_0xfe911){if(!_[_0xe14d('0x29')](_0xfe911)){for(var _0x19a23a in _0xfe911){if(_0xfe911[_0xe14d('0x23')](_0x19a23a)){_0xfe911[_0x19a23a]['total']=0x0;_0xfe911[_0x19a23a][_0xe14d('0x27')]=0x0;_0xfe911[_0x19a23a]['unmanaged']=0x0;_0xfe911[_0x19a23a][_0xe14d('0x2b')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x2c')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x28')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x2d')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x2e')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x2f')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x30')]=0x0;_0xfe911[_0x19a23a]['outboundCongestionCallsDay']=0x0;_0xfe911[_0x19a23a][_0xe14d('0x31')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x32')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x33')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x34')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x35')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x36')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x37')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x38')]=0x0;_0xfe911[_0x19a23a][_0xe14d('0x2e')]=0x0;_0xfe911[_0x19a23a]['outboundAnswerCallsDay']=0x0;_0xfe911[_0x19a23a]['queueStatusComplete']=!![];}}}}Realtime[_0xe14d('0x39')][_0xe14d('0x3a')]=function(_0x2f4048,_0x525fb2){for(var _0x3cb06c in _0x525fb2){if(_0x2f4048['hasOwnProperty'](_0x3cb06c)){_0x2f4048[_0x3cb06c]=_0x525fb2[_0x3cb06c];}}};Realtime[_0xe14d('0x39')][_0xe14d('0x3b')]=function(){var _0xeccb60=this;return function(_0x3830e2){if(_0x3830e2){freeIsNotKeyAgent(_0x3830e2,_0xeccb60[_0xe14d('0x10')]);for(var _0x47377f=0x0,_0x6580aa={},_0x18ff41={};_0x47377f<_0x3830e2[_0xe14d('0x3c')];_0x47377f+=0x1){_0x6580aa=_0x3830e2[_0x47377f];var _0x444001=_[_0xe14d('0x24')](_0x6580aa[_0xe14d('0x25')])?util['format'](_0xe14d('0x3d'),_0x6580aa[_0xe14d('0x22')]):_0x6580aa[_0xe14d('0x25')];if(_[_0xe14d('0x3e')](_0xeccb60[_0xe14d('0x10')][_0x444001])){_0xeccb60['agents'][_0x444001]=new Agent(_0x6580aa);}else{_0xeccb60['mergeFromDatabase'](_0xeccb60[_0xe14d('0x10')][_0x444001],_0x6580aa);}}}return _0xeccb60[_0xe14d('0x10')];};};Realtime[_0xe14d('0x39')][_0xe14d('0x3f')]=function(){var _0x42facf=this;return function(_0x5128dc){if(_0x5128dc){freeIsNotKeySip(_0x5128dc,_0x42facf['telephones']);for(var _0x131c21=0x0,_0x307ffe={},_0x2e55dd={};_0x131c21<_0x5128dc['length'];_0x131c21+=0x1){_0x307ffe=_0x5128dc[_0x131c21];if(_[_0xe14d('0x3e')](_0x42facf[_0xe14d('0x11')][util[_0xe14d('0x21')](_0xe14d('0x3d'),_0x307ffe[_0xe14d('0x22')])])){_0x42facf[_0xe14d('0x11')][util[_0xe14d('0x21')](_0xe14d('0x3d'),_0x307ffe[_0xe14d('0x22')])]=new Telephone(_0x307ffe);}else{_0x42facf[_0xe14d('0x3a')](_0x42facf[_0xe14d('0x11')][util[_0xe14d('0x21')](_0xe14d('0x3d'),_0x307ffe['name'])],_0x307ffe);}}}return _0x42facf[_0xe14d('0x11')];};};Realtime['prototype'][_0xe14d('0x40')]=function(){var _0x4e63bd=this;return function(_0x47310a){if(_0x47310a){freeIsNotKeySip(_0x47310a,_0x4e63bd['trunks']);for(var _0x4b1e3d=0x0,_0x19ef74={},_0x42cbd4={};_0x4b1e3d<_0x47310a[_0xe14d('0x3c')];_0x4b1e3d+=0x1){_0x19ef74=_0x47310a[_0x4b1e3d];if(_['isUndefined'](_0x4e63bd[_0xe14d('0x12')][util['format']('SIP/%s',_0x19ef74[_0xe14d('0x22')])])){_0x4e63bd['trunks'][util[_0xe14d('0x21')]('SIP/%s',_0x19ef74[_0xe14d('0x22')])]=new Trunk(_0x19ef74);}else{_0x4e63bd[_0xe14d('0x3a')](_0x4e63bd['trunks'][util[_0xe14d('0x21')]('SIP/%s',_0x19ef74[_0xe14d('0x22')])],_0x19ef74);}}}return _0x4e63bd[_0xe14d('0x12')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0xa3075c=this;return function(_0x2ec788){if(_0x2ec788){freeIsNotKey(_0x2ec788,_0xa3075c['voiceQueues'],_0xe14d('0x22'));for(var _0x745c7e=0x0,_0x2e7d69={},_0x24c2d6={};_0x745c7e<_0x2ec788[_0xe14d('0x3c')];_0x745c7e+=0x1){_0x2e7d69=_0x2ec788[_0x745c7e];if(_['isUndefined'](_0xa3075c[_0xe14d('0x13')][_0x2e7d69[_0xe14d('0x22')]])){_0xa3075c[_0xe14d('0x13')][_0x2e7d69['name']]=new VoiceQueue(_0x2e7d69);}else{_0xa3075c[_0xe14d('0x3a')](_0xa3075c[_0xe14d('0x13')][_0x2e7d69['name']],_0x2e7d69);}}}return _0xa3075c[_0xe14d('0x13')];};};Realtime[_0xe14d('0x39')]['initTriggers']=function(){var _0x36bd3d=this;return function(_0x865b7a){if(_0x865b7a){freeIsNotKey(_0x865b7a,_0x36bd3d[_0xe14d('0x41')],'id');for(var _0x440e9c=0x0,_0x256b23={},_0x345b93={};_0x440e9c<_0x865b7a[_0xe14d('0x3c')];_0x440e9c+=0x1){_0x256b23=_0x865b7a[_0x440e9c];if(_['isUndefined'](_0x36bd3d[_0xe14d('0x41')][_0x256b23['id']])){_0x36bd3d[_0xe14d('0x41')][_0x256b23['id']]=new Trigger(_0x256b23);}else{_0x36bd3d[_0xe14d('0x3a')](_0x36bd3d[_0xe14d('0x41')][_0x256b23['id']],_0x256b23);}}}return _0x36bd3d[_0xe14d('0x41')];};};Realtime[_0xe14d('0x39')][_0xe14d('0x42')]=function(){var _0x245928=this;return function(_0x26463f){if(_0x26463f){freeIsNotKey(_0x26463f,_0x245928['templates'],'id');for(var _0x5b0cf9=0x0,_0x27bf36={},_0x5a45f2={};_0x5b0cf9<_0x26463f[_0xe14d('0x3c')];_0x5b0cf9+=0x1){_0x27bf36=_0x26463f[_0x5b0cf9];if(_[_0xe14d('0x3e')](_0x245928[_0xe14d('0x15')][_0x27bf36['id']])){_0x245928[_0xe14d('0x15')][_0x27bf36['id']]=new Template(_0x27bf36);}else{_0x245928[_0xe14d('0x3a')](_0x245928[_0xe14d('0x15')][_0x27bf36['id']],_0x27bf36);}}}return _0x245928[_0xe14d('0x15')];};};Realtime[_0xe14d('0x39')][_0xe14d('0x43')]=function(){var _0x485f3d=this;return function(_0x5d8423){if(_0x5d8423){freeIsNotKey(_0x5d8423,_0x485f3d[_0xe14d('0x19')],'id');for(var _0x800fdb=0x0,_0x493b5a={},_0x1811e9={};_0x800fdb<_0x5d8423[_0xe14d('0x3c')];_0x800fdb+=0x1){_0x493b5a=_0x5d8423[_0x800fdb];if(_[_0xe14d('0x3e')](_0x485f3d[_0xe14d('0x19')][_0x493b5a['id']])){_0x485f3d['zendeskAccounts'][_0x493b5a['id']]=new ZendeskAccount(_0x493b5a);}else{_0x485f3d['mergeFromDatabase'](_0x485f3d['zendeskAccounts'][_0x493b5a['id']],_0x493b5a);}}}return _0x485f3d[_0xe14d('0x19')];};};Realtime['prototype'][_0xe14d('0x44')]=function(){var _0xed5106=this;return function(_0x53da66){if(_0x53da66){freeIsNotKey(_0x53da66,_0xed5106['salesforceAccounts'],'id');for(var _0x43a9d2=0x0,_0x410ba4={},_0x1634fb={};_0x43a9d2<_0x53da66['length'];_0x43a9d2+=0x1){_0x410ba4=_0x53da66[_0x43a9d2];if(_[_0xe14d('0x3e')](_0xed5106[_0xe14d('0x1a')][_0x410ba4['id']])){_0xed5106[_0xe14d('0x1a')][_0x410ba4['id']]=new SalesforceAccount(_0x410ba4);}else{_0xed5106['mergeFromDatabase'](_0xed5106[_0xe14d('0x1a')][_0x410ba4['id']],_0x410ba4);}}}return _0xed5106[_0xe14d('0x1a')];};};Realtime[_0xe14d('0x39')][_0xe14d('0x45')]=function(){var _0x1460ab=this;return function(_0x2b97f2){if(_0x2b97f2){freeIsNotKey(_0x2b97f2,_0x1460ab[_0xe14d('0x1c')],'id');for(var _0x5c6747=0x0,_0x385d64={},_0x7fdef={};_0x5c6747<_0x2b97f2[_0xe14d('0x3c')];_0x5c6747+=0x1){_0x385d64=_0x2b97f2[_0x5c6747];if(_[_0xe14d('0x3e')](_0x1460ab[_0xe14d('0x1c')][_0x385d64['id']])){_0x1460ab[_0xe14d('0x1c')][_0x385d64['id']]=new FreshdeskAccount(_0x385d64);}else{_0x1460ab['mergeFromDatabase'](_0x1460ab[_0xe14d('0x1c')][_0x385d64['id']],_0x385d64);}}}return _0x1460ab[_0xe14d('0x1c')];};};Realtime[_0xe14d('0x39')]['initZohoAccounts']=function(){var _0x345501=this;return function(_0x360633){if(_0x360633){freeIsNotKey(_0x360633,_0x345501[_0xe14d('0x46')],'id');for(var _0x227317=0x0,_0xc80be={},_0x5ae1ff={};_0x227317<_0x360633['length'];_0x227317+=0x1){_0xc80be=_0x360633[_0x227317];if(_[_0xe14d('0x3e')](_0x345501[_0xe14d('0x46')][_0xc80be['id']])){_0x345501['zohoAccounts'][_0xc80be['id']]=new ZohoAccount(_0xc80be);}else{_0x345501['mergeFromDatabase'](_0x345501[_0xe14d('0x46')][_0xc80be['id']],_0xc80be);}}}return _0x345501[_0xe14d('0x46')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x15eca2=this;return function(_0x400d6b){if(_0x400d6b){freeIsNotKey(_0x400d6b,_0x15eca2[_0xe14d('0x1d')],'id');for(var _0x262226=0x0,_0x24b92c={},_0x199d2f={};_0x262226<_0x400d6b[_0xe14d('0x3c')];_0x262226+=0x1){_0x24b92c=_0x400d6b[_0x262226];if(_[_0xe14d('0x3e')](_0x15eca2[_0xe14d('0x1d')][_0x24b92c['id']])){_0x15eca2['deskAccounts'][_0x24b92c['id']]=new DeskAccount(_0x24b92c);}else{_0x15eca2[_0xe14d('0x3a')](_0x15eca2['deskAccounts'][_0x24b92c['id']],_0x24b92c);}}}return _0x15eca2[_0xe14d('0x1d')];};};Realtime['prototype'][_0xe14d('0x47')]=function(){var _0x49e25f=this;return function(_0x448bb3){if(_0x448bb3){freeIsNotKey(_0x448bb3,_0x49e25f[_0xe14d('0x1b')],'id');for(var _0x709005=0x0,_0x38322b={},_0x202181={};_0x709005<_0x448bb3['length'];_0x709005+=0x1){_0x38322b=_0x448bb3[_0x709005];if(_[_0xe14d('0x3e')](_0x49e25f[_0xe14d('0x1b')][_0x38322b['id']])){_0x49e25f[_0xe14d('0x1b')][_0x38322b['id']]=new SugarcrmAccount(_0x38322b);}else{_0x49e25f[_0xe14d('0x3a')](_0x49e25f[_0xe14d('0x1b')][_0x38322b['id']],_0x38322b);}}}return _0x49e25f[_0xe14d('0x1b')];};};Realtime['prototype'][_0xe14d('0x48')]=function(){var _0x5ad8f0=this;return function(_0x134ab0){if(_0x134ab0){freeIsNotKey(_0x134ab0,_0x5ad8f0[_0xe14d('0x49')],'id');for(var _0x2c38a4=0x0,_0x5775f9={},_0x3bba1f={};_0x2c38a4<_0x134ab0[_0xe14d('0x3c')];_0x2c38a4+=0x1){_0x5775f9=_0x134ab0[_0x2c38a4];if(_[_0xe14d('0x3e')](_0x5ad8f0[_0xe14d('0x49')][_0x5775f9['id']])){_0x5ad8f0[_0xe14d('0x49')][_0x5775f9['id']]=new VtigerAccount(_0x5775f9);}else{_0x5ad8f0[_0xe14d('0x3a')](_0x5ad8f0[_0xe14d('0x49')][_0x5775f9['id']],_0x5775f9);}}}return _0x5ad8f0[_0xe14d('0x49')];};};Realtime[_0xe14d('0x39')][_0xe14d('0x4a')]=function(){var _0x207568=this;return function(_0x57051b){if(_0x57051b){freeIsNotKey(_0x57051b,_0x207568['servicenowAccounts'],'id');for(var _0x905d91=0x0,_0x3e80c6={},_0x486b8b={};_0x905d91<_0x57051b['length'];_0x905d91+=0x1){_0x3e80c6=_0x57051b[_0x905d91];if(_[_0xe14d('0x3e')](_0x207568['servicenowAccounts'][_0x3e80c6['id']])){_0x207568[_0xe14d('0x1e')][_0x3e80c6['id']]=new ServicenowAccount(_0x3e80c6);}else{_0x207568['mergeFromDatabase'](_0x207568[_0xe14d('0x1e')][_0x3e80c6['id']],_0x3e80c6);}}}return _0x207568[_0xe14d('0x1e')];};};Realtime[_0xe14d('0x39')][_0xe14d('0x4b')]=function(){var _0x7d1ab1=this;return function(_0x5cbe11){if(_0x5cbe11){freeIsNotKey(_0x5cbe11,_0x7d1ab1[_0xe14d('0x1f')],'id');for(var _0x13d03c=0x0,_0x5eb741={},_0xba469e={};_0x13d03c<_0x5cbe11[_0xe14d('0x3c')];_0x13d03c+=0x1){_0x5eb741=_0x5cbe11[_0x13d03c];if(_[_0xe14d('0x3e')](_0x7d1ab1['dynamics365Accounts'][_0x5eb741['id']])){_0x7d1ab1[_0xe14d('0x1f')][_0x5eb741['id']]=new Dynamics365Account(_0x5eb741);}else{_0x7d1ab1['mergeFromDatabase'](_0x7d1ab1[_0xe14d('0x1f')][_0x5eb741['id']],_0x5eb741);}}}return _0x7d1ab1[_0xe14d('0x1f')];};};Realtime[_0xe14d('0x39')][_0xe14d('0x4c')]=function(){var _0x1a47b3=this;return function(_0x41dfea){for(var _0x2e4a41=0x0;_0x2e4a41<_0x41dfea[_0xe14d('0x3c')];_0x2e4a41+=0x1){_[_0xe14d('0x4d')](_0x1a47b3[_0xe14d('0x13')][_0x41dfea[_0x2e4a41]['name']],_0x41dfea[_0x2e4a41]);}return _0x1a47b3[_0xe14d('0x13')];};};Realtime['prototype'][_0xe14d('0x4e')]=function(){var _0x570abd=this;return function(_0x434d7a){clearVoiceQueues(_0x570abd[_0xe14d('0x13')]);if(_0x434d7a){_0x434d7a=_['groupBy'](_0x434d7a,'uniqueid');for(var _0x7c9f1e in _0x434d7a){if(_0x434d7a[_0xe14d('0x23')](_0x7c9f1e)){var _0x506871={};for(var _0x150046=0x0;_0x150046<_0x434d7a[_0x7c9f1e]['length'];_0x150046+=0x1){var _0x352a9e=_0x434d7a[_0x7c9f1e][_0x150046][_0xe14d('0x4f')];if(_0x570abd[_0xe14d('0x13')][_0x352a9e]){if(_0x434d7a[_0x7c9f1e][_0x150046]['queuecallerexit']){_0x570abd['voiceQueues'][_0x352a9e]['unmanaged']+=0x1;}if(_0x434d7a[_0x7c9f1e][_0x150046][_0xe14d('0x50')]){_0x570abd[_0xe14d('0x13')][_0x352a9e][_0xe14d('0x2b')]+=0x1;}_0x570abd[_0xe14d('0x13')][_0x352a9e]['sumHoldTime']+=moment(_0x434d7a[_0x7c9f1e][_0x150046][_0xe14d('0x51')])[_0xe14d('0x52')](moment(_0x434d7a[_0x7c9f1e][_0x150046]['queuecallerjoinAt']),_0xe14d('0x53'))||0x0;if(_0x150046===_0x434d7a[_0x7c9f1e]['length']-0x1){_0x570abd[_0xe14d('0x13')][_0x352a9e][_0xe14d('0x28')]+=moment(_0x434d7a[_0x7c9f1e][_0x150046][_0xe14d('0x54')]||_0x434d7a[_0x7c9f1e][_0x150046][_0xe14d('0x55')]||_0x434d7a[_0x7c9f1e][_0x150046][_0xe14d('0x56')])[_0xe14d('0x52')](moment(_0x434d7a[_0x7c9f1e][_0x150046][_0xe14d('0x57')]),_0xe14d('0x53'))||0x0;_0x570abd[_0xe14d('0x13')][_0x352a9e][_0xe14d('0x26')]+=0x1;if(_0x434d7a[_0x7c9f1e][_0x150046][_0xe14d('0x58')]){_0x570abd[_0xe14d('0x13')][_0x352a9e][_0xe14d('0x27')]+=0x1;_0x570abd['voiceQueues'][_0x352a9e]['sumBillable']+=moment(_0x434d7a[_0x7c9f1e][_0x150046][_0xe14d('0x54')])[_0xe14d('0x52')](moment(_0x434d7a[_0x7c9f1e][_0x150046][_0xe14d('0x51')]),_0xe14d('0x53'))||0x0;}}else{_0x570abd[_0xe14d('0x13')][_0x352a9e][_0xe14d('0x28')]+=_0x570abd[_0xe14d('0x13')][_0x352a9e][_0xe14d('0x2c')]||0x0;}}}}}}return _0x570abd[_0xe14d('0x13')];};};Realtime[_0xe14d('0x39')]['initVoiceCallReports']=function(){var _0x16d283=this;return function(_0x4359ad){clearVoiceCallReports(_0x16d283['outbound']);if(_0x4359ad){for(var _0x185c18=0x0;_0x185c18<_0x4359ad[_0xe14d('0x3c')];_0x185c18+=0x1){_0x16d283[_0xe14d('0x59')][_0xe14d('0x26')]+=0x1;_0x16d283['outbound']['sumDuration']+=_0x4359ad[_0x185c18][_0xe14d('0x5a')];if(_0x4359ad[_0x185c18][_0xe14d('0x5b')]===_0xe14d('0x5c')){_0x16d283[_0xe14d('0x59')][_0xe14d('0x27')]+=0x1;_0x16d283[_0xe14d('0x59')][_0xe14d('0x2c')]+=_0x4359ad[_0x185c18][_0xe14d('0x5a')]-_0x4359ad[_0x185c18][_0xe14d('0x5d')]||0x0;_0x16d283[_0xe14d('0x59')][_0xe14d('0x2d')]+=_0x4359ad[_0x185c18][_0xe14d('0x5d')];}}}return _0x16d283['outbound'];};};Realtime[_0xe14d('0x39')][_0xe14d('0x5e')]=function(){var _0x3c4552=this;return function(_0x30fa17){if(_0x30fa17){freeIsNotKey(_0x30fa17,_0x3c4552[_0xe14d('0x14')],'name');for(var _0x2a9232=0x0,_0x30e9f0={};_0x2a9232<_0x30fa17[_0xe14d('0x3c')];_0x2a9232+=0x1){_0x30e9f0=_0x30fa17[_0x2a9232];if(_[_0xe14d('0x3e')](_0x3c4552[_0xe14d('0x14')][_0x30e9f0['name']])){_0x3c4552[_0xe14d('0x14')][_0x30e9f0['name']]=new Campaign(_0x30e9f0);}else{_0x3c4552['mergeFromDatabase'](_0x3c4552[_0xe14d('0x14')][_0x30e9f0[_0xe14d('0x22')]],_0x30e9f0);}}}return _0x3c4552[_0xe14d('0x14')];};};Realtime[_0xe14d('0x39')][_0xe14d('0x5f')]=function(){var _0x3d67d0=this;return function(_0x4ab514){if(_0x4ab514){freeIsNotKey(_0x4ab514,_0x3d67d0[_0xe14d('0x60')],'id');for(var _0x5658cd=0x0,_0x3e77a7={};_0x5658cd<_0x4ab514[_0xe14d('0x3c')];_0x5658cd+=0x1){_0x3e77a7=_0x4ab514[_0x5658cd];if(_[_0xe14d('0x3e')](_0x3d67d0[_0xe14d('0x60')][_0x3e77a7['id']])){_0x3d67d0['voiceExtensions'][_0x3e77a7['id']]=new VoiceExtension(_0x3e77a7);}else{_0x3d67d0[_0xe14d('0x3a')](_0x3d67d0[_0xe14d('0x60')][_0x3e77a7['id']],_0x3e77a7);}}}return _0x3d67d0[_0xe14d('0x60')];};};Realtime[_0xe14d('0x39')]['initCampaignHopperHistory']=function(){var _0x548e37=this;return function(_0x1c9905){clearCampaigns(_0x548e37[_0xe14d('0x14')]);for(var _0x53fd1a=0x0;_0x53fd1a<_0x1c9905['length'];_0x53fd1a+=0x1){_[_0xe14d('0x4d')](_0x548e37[_0xe14d('0x14')][_0x1c9905[_0x53fd1a][_0xe14d('0x22')]],_0x1c9905[_0x53fd1a]);}return _0x548e37[_0xe14d('0x14')];};};Realtime[_0xe14d('0x39')][_0xe14d('0x61')]=function(){var _0x11c219=this;return function(_0xe91c4f){if(_0xe91c4f){freeIsNotKey(_0xe91c4f,_0x11c219[_0xe14d('0x62')],'id');for(var _0x358ae1=0x0,_0x52816d={},_0x547f1b={};_0x358ae1<_0xe91c4f[_0xe14d('0x3c')];_0x358ae1+=0x1){_0x52816d=_0xe91c4f[_0x358ae1];if(_['isUndefined'](_0x11c219[_0xe14d('0x62')][_0x52816d['id']])){_0x11c219[_0xe14d('0x62')][_0x52816d['id']]=new FaxAccount(_0x52816d);}else{_0x11c219[_0xe14d('0x3a')](_0x11c219['faxAccounts'][_0x52816d['id']],_0x52816d);}}}return _0x11c219[_0xe14d('0x62')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 616d57f..52b3304 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 _0xcfba=['destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','create','monitor','monitorFilename','monitors','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','voiceDialReport','startsWith','substring','indexOf','mobile','phone','lastIndexOf','membername','blindTransfer','attendedTransfer','exports','lodash','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','telephones','prototype','findAgent','accountcode','name','isNil','find','agents','interface','format','SIP/%s','voiceQueueReport','length','connectedlinenum','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt'];(function(_0x3485be,_0x5f3dd1){var _0x2ac6ae=function(_0xbd6baa){while(--_0xbd6baa){_0x3485be['push'](_0x3485be['shift']());}};_0x2ac6ae(++_0x5f3dd1);}(_0xcfba,0x6f));var _0xacfb=function(_0x2eaa13,_0x71e99){_0x2eaa13=_0x2eaa13-0x0;var _0x25a5b0=_0xcfba[_0x2eaa13];return _0x25a5b0;};'use strict';var BPromise=require('bluebird');var _=require(_0xacfb('0x0'));var moment=require('moment');var util=require(_0xacfb('0x1'));var logger=require(_0xacfb('0x2'))(_0xacfb('0x3'));var ami=require(_0xacfb('0x4'));var RpcVoiceAgentReport=require(_0xacfb('0x5'));var RpcVoiceCallReport=require(_0xacfb('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xacfb('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xacfb('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xacfb('0x9'));var VoiceCallReport=require(_0xacfb('0xa'));var VoiceAgentReport=require(_0xacfb('0xb'));var VoiceDialReport=require(_0xacfb('0xc'));var UserReport=require(_0xacfb('0xd'));function Report(_0x38e4f6){this[_0xacfb('0xe')]=_0x38e4f6;this['agents']=_0x38e4f6['agents'];this[_0xacfb('0xf')]=_0x38e4f6[_0xacfb('0xf')];}Report[_0xacfb('0x10')]['sync']=function(_0x46afe0){var _0x53e2c7=new VoiceQueueReport(this['realtime']);var _0x24faab=new VoiceAgentReport(this[_0xacfb('0xe')]);var _0x182f2c=new VoiceDialReport(this['realtime']);var _0x2bc66c=new VoiceCallReport(this[_0xacfb('0xe')]);var _0x34d8ff=new UserReport(this['realtime']);};Report[_0xacfb('0x10')][_0xacfb('0x11')]=function(_0xa731c){var _0x456cf7=undefined;_0x456cf7=_['find'](this['agents'],function(_0x2d3e45){return _0x2d3e45[_0xacfb('0x12')]==_0xa731c||_0x2d3e45[_0xacfb('0x13')]==_0xa731c;});if(_[_0xacfb('0x14')](_0x456cf7)){var _0x38f1b9=_[_0xacfb('0x15')](this['telephones'],function(_0x252eb2){return _0x252eb2['accountcode']==_0xa731c||_0x252eb2[_0xacfb('0x13')]==_0xa731c;});if(_0x38f1b9){_0x456cf7=_[_0xacfb('0x15')](this[_0xacfb('0x16')],function(_0x2183d5){return _0x2183d5[_0xacfb('0x17')]==util[_0xacfb('0x18')](_0xacfb('0x19'),_0x38f1b9[_0xacfb('0x13')]);});}}return _0x456cf7;};Report['prototype'][_0xacfb('0x1a')]=function(_0x5a98a7){for(var _0x3de730=0x0;_0x3de730<_0x5a98a7[_0xacfb('0x1b')];_0x3de730+=0x1){var _0x249c73=this[_0xacfb('0x11')](_0x5a98a7[_0x3de730][_0xacfb('0x1c')]);if(_0x249c73){_0x5a98a7[_0x3de730][_0xacfb('0x12')]=_0x249c73[_0xacfb('0x12')];_0x5a98a7[_0x3de730]['assigned']=!![];_0x5a98a7[_0x3de730]['lastAssignedTo']=_0x249c73[_0xacfb('0x13')];_0x5a98a7[_0x3de730][_0xacfb('0x17')]=_[_0xacfb('0x14')](_0x249c73[_0xacfb('0x17')])?util[_0xacfb('0x18')](_0xacfb('0x19'),_0x249c73['name']):_0x249c73['interface'];if(_0x5a98a7[_0x3de730][_0xacfb('0x1d')]){_0x5a98a7[_0x3de730][_0xacfb('0x1e')]=moment()[_0xacfb('0x18')](_0xacfb('0x1f'));}if(_0x5a98a7[_0x3de730]['queuecallerexit']){_0x5a98a7[_0x3de730][_0xacfb('0x20')]=moment()[_0xacfb('0x18')](_0xacfb('0x1f'));}RpcMemberReport[_0xacfb('0x1a')](_0x5a98a7[_0x3de730]);}RpcVoiceQueueReport['create'](_0x5a98a7[_0x3de730]);}};function extractCalleridNumber(_0x1ed039){var _0x40a4b6=_0x1ed039['match'](/<(.*?)>/);return _0x40a4b6?_0x40a4b6[0x1]:_0x1ed039;}Report[_0xacfb('0x10')]['voiceCallReport']=function(_0x492e48){_0x492e48[_0xacfb('0x21')]=_0x492e48[_0xacfb('0x21')]||_0x492e48[_0xacfb('0x22')];if(_0x492e48[_0xacfb('0x23')]==_0xacfb('0x24')){_0x492e48[_0xacfb('0x25')]=_0xacfb('0x26');_0x492e48[_0xacfb('0x27')]=_0x492e48['queue'];if(_0x492e48[_0xacfb('0x28')]==_0xacfb('0x29')){_0x492e48['accountcode']='';_0x492e48[_0xacfb('0x21')]=extractCalleridNumber(_0x492e48[_0xacfb('0x2a')]);}else if(_0x492e48[_0xacfb('0x28')]==_0xacfb('0x2b')){if(_0x492e48[_0xacfb('0x21')]=='xcally-motion-preview'){_0x492e48['destination']=extractCalleridNumber(_0x492e48[_0xacfb('0x2c')]);_0x492e48[_0xacfb('0x2d')]=_0x492e48[_0xacfb('0x2e')];_0x492e48[_0xacfb('0x2f')]=[_0x492e48[_0xacfb('0x30')],_0x492e48[_0xacfb('0x30')]=_0x492e48[_0xacfb('0x2f')]][0x0];_0x492e48['callerid']=_0x492e48[_0xacfb('0x2c')];}else{_0x492e48[_0xacfb('0x21')]=_0x492e48[_0xacfb('0x2d')];_0x492e48['calleridnum']=_0x492e48['originatecalleridnum'];if(_0x492e48['disposition']==_0xacfb('0x31')){_0x492e48[_0xacfb('0x12')]=_0x492e48[_0xacfb('0x1c')];}else{_0x492e48[_0xacfb('0x12')]='';}}}}else{_0x492e48[_0xacfb('0x2a')]=util[_0xacfb('0x18')](_0xacfb('0x32'),_0x492e48[_0xacfb('0x33')],_0x492e48[_0xacfb('0x2d')]);}RpcVoiceCallReport[_0xacfb('0x34')](_0x492e48);if(_0x492e48[_0xacfb('0x35')]){for(var _0x1411f1=0x0;_0x1411f1<_0x492e48['monitors'][_0xacfb('0x1b')];_0x1411f1+=0x1){_0x492e48[_0xacfb('0x36')]=_0x492e48[_0xacfb('0x37')][_0x1411f1][_0xacfb('0x38')];_0x492e48[_0xacfb('0x39')]=_0x492e48[_0xacfb('0x37')][_0x1411f1][_0xacfb('0x39')];if(_0x492e48['exten']==_0xacfb('0x3a')){_0x492e48[_0xacfb('0x2d')]=_0x492e48['connectedlinenum'];_0x492e48['calleridname']=_0x492e48[_0xacfb('0x3b')];_0x492e48[_0xacfb('0x1c')]=_0x492e48[_0xacfb('0x12')];_0x492e48[_0xacfb('0x3b')]=_0x492e48['membername'];_0x492e48[_0xacfb('0x22')]=_0x492e48[_0xacfb('0x2e')];}else if(_0x492e48[_0xacfb('0x22')]==_0xacfb('0x3c')){_0x492e48[_0xacfb('0x2d')]=_0x492e48[_0xacfb('0x21')];_0x492e48[_0xacfb('0x22')]=_0x492e48[_0xacfb('0x2e')];}RpcVoiceRecording['create'](_0x492e48);}}};Report[_0xacfb('0x10')]['voiceAgentReport']=function(_0x139df5){RpcVoiceAgentReport[_0xacfb('0x34')](_0x139df5);};Report[_0xacfb('0x10')][_0xacfb('0x3d')]=function(_0x41dd89){RpcVoiceDialReport[_0xacfb('0x34')](_0x41dd89);var _0x42d1f9=undefined;var _0x3fae37=_0x41dd89[_0xacfb('0x30')];if(_[_0xacfb('0x3e')](_0x3fae37,'Local')){var _0x22adc3=_0x3fae37[_0xacfb('0x3f')](_0x3fae37[_0xacfb('0x40')]('/')+0x1,_0x3fae37[_0xacfb('0x40')]('@'));_0x42d1f9=_[_0xacfb('0x15')](this[_0xacfb('0x16')],function(_0x40e29f){return _0x40e29f[_0xacfb('0x41')]==_0x22adc3||_0x40e29f[_0xacfb('0x42')]==_0x22adc3||_0x40e29f[_0xacfb('0x12')]==_0x22adc3;});}else{var _0x22adc3=_0x3fae37[_0xacfb('0x3f')](_0x3fae37[_0xacfb('0x40')]('/')+0x1,_0x3fae37[_0xacfb('0x43')]('-'));_0x42d1f9=this['findAgent'](_0x22adc3);}if(_0x42d1f9){_0x41dd89[_0xacfb('0x17')]=_[_0xacfb('0x14')](_0x42d1f9[_0xacfb('0x17')])?util[_0xacfb('0x18')]('SIP/%s',_0x42d1f9[_0xacfb('0x13')]):_0x42d1f9[_0xacfb('0x17')];_0x41dd89[_0xacfb('0x44')]=_0x42d1f9[_0xacfb('0x13')];_0x41dd89[_0xacfb('0x12')]=_0x42d1f9[_0xacfb('0x12')];RpcMemberReport[_0xacfb('0x3d')](_0x41dd89);}};Report[_0xacfb('0x10')][_0xacfb('0x45')]=function(_0x13b7e){RpcVoiceTransferReport['blindTransfer'](_0x13b7e);};Report[_0xacfb('0x10')][_0xacfb('0x46')]=function(_0x122699){RpcVoiceTransferReport[_0xacfb('0x46')](_0x122699);};module[_0xacfb('0x47')]=Report; \ No newline at end of file +var _0x5c30=['./voiceQueueReport','./voiceCallReport','./voiceAgentReport','realtime','telephones','prototype','sync','agents','name','find','accountcode','interface','format','SIP/%s','length','findAgent','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','voiceQueueReport','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','callerid','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','create','monitorFilename','monitors','filename','createdAt','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','blindTransfer','attendedTransfer','exports','bluebird','lodash','moment','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport'];(function(_0x58c5d1,_0x53ca13){var _0x300ebd=function(_0x391dd3){while(--_0x391dd3){_0x58c5d1['push'](_0x58c5d1['shift']());}};_0x300ebd(++_0x53ca13);}(_0x5c30,0x174));var _0x05c3=function(_0x18ff55,_0xdfc235){_0x18ff55=_0x18ff55-0x0;var _0x164630=_0x5c30[_0x18ff55];return _0x164630;};'use strict';var BPromise=require(_0x05c3('0x0'));var _=require(_0x05c3('0x1'));var moment=require(_0x05c3('0x2'));var util=require(_0x05c3('0x3'));var logger=require(_0x05c3('0x4'))(_0x05c3('0x5'));var ami=require(_0x05c3('0x6'));var RpcVoiceAgentReport=require(_0x05c3('0x7'));var RpcVoiceCallReport=require(_0x05c3('0x8'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x05c3('0x9'));var RpcVoiceQueueReport=require(_0x05c3('0xa'));var RpcVoiceRecording=require(_0x05c3('0xb'));var RpcVoiceTransferReport=require(_0x05c3('0xc'));var VoiceQueueReport=require(_0x05c3('0xd'));var VoiceCallReport=require(_0x05c3('0xe'));var VoiceAgentReport=require(_0x05c3('0xf'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x2e5143){this[_0x05c3('0x10')]=_0x2e5143;this['agents']=_0x2e5143['agents'];this[_0x05c3('0x11')]=_0x2e5143[_0x05c3('0x11')];}Report[_0x05c3('0x12')][_0x05c3('0x13')]=function(_0x253b3e){var _0x53ca4f=new VoiceQueueReport(this[_0x05c3('0x10')]);var _0x7ba03d=new VoiceAgentReport(this['realtime']);var _0x3a10d1=new VoiceDialReport(this[_0x05c3('0x10')]);var _0x577cf8=new VoiceCallReport(this[_0x05c3('0x10')]);var _0x522aea=new UserReport(this[_0x05c3('0x10')]);};Report[_0x05c3('0x12')]['findAgent']=function(_0x2f7882){var _0x209e68=undefined;_0x209e68=_['find'](this[_0x05c3('0x14')],function(_0x485e14){return _0x485e14['accountcode']==_0x2f7882||_0x485e14[_0x05c3('0x15')]==_0x2f7882;});if(_['isNil'](_0x209e68)){var _0x60c329=_[_0x05c3('0x16')](this['telephones'],function(_0x44b527){return _0x44b527[_0x05c3('0x17')]==_0x2f7882||_0x44b527[_0x05c3('0x15')]==_0x2f7882;});if(_0x60c329){_0x209e68=_[_0x05c3('0x16')](this['agents'],function(_0x3820c5){return _0x3820c5[_0x05c3('0x18')]==util[_0x05c3('0x19')](_0x05c3('0x1a'),_0x60c329[_0x05c3('0x15')]);});}}return _0x209e68;};Report[_0x05c3('0x12')]['voiceQueueReport']=function(_0xcd27c0){for(var _0x72053b=0x0;_0x72053b<_0xcd27c0[_0x05c3('0x1b')];_0x72053b+=0x1){var _0x31fffc=this[_0x05c3('0x1c')](_0xcd27c0[_0x72053b][_0x05c3('0x1d')]);if(_0x31fffc){_0xcd27c0[_0x72053b][_0x05c3('0x17')]=_0x31fffc[_0x05c3('0x17')];_0xcd27c0[_0x72053b][_0x05c3('0x1e')]=!![];_0xcd27c0[_0x72053b][_0x05c3('0x1f')]=_0x31fffc[_0x05c3('0x15')];_0xcd27c0[_0x72053b][_0x05c3('0x18')]=_['isNil'](_0x31fffc[_0x05c3('0x18')])?util[_0x05c3('0x19')]('SIP/%s',_0x31fffc[_0x05c3('0x15')]):_0x31fffc[_0x05c3('0x18')];if(_0xcd27c0[_0x72053b][_0x05c3('0x20')]){_0xcd27c0[_0x72053b][_0x05c3('0x21')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0xcd27c0[_0x72053b]['queuecallerexit']){_0xcd27c0[_0x72053b][_0x05c3('0x22')]=moment()[_0x05c3('0x19')](_0x05c3('0x23'));}RpcMemberReport[_0x05c3('0x24')](_0xcd27c0[_0x72053b]);}RpcVoiceQueueReport['create'](_0xcd27c0[_0x72053b]);}};function extractCalleridNumber(_0x4530a0){var _0x2efe72=_0x4530a0['match'](/<(.*?)>/);return _0x2efe72?_0x2efe72[0x1]:_0x4530a0;}Report[_0x05c3('0x12')][_0x05c3('0x25')]=function(_0xa8a612){_0xa8a612[_0x05c3('0x26')]=_0xa8a612['destination']||_0xa8a612[_0x05c3('0x27')];if(_0xa8a612[_0x05c3('0x28')]==_0x05c3('0x29')){_0xa8a612[_0x05c3('0x2a')]=_0x05c3('0x2b');_0xa8a612['lastdata']=_0xa8a612[_0x05c3('0x2b')];if(_0xa8a612[_0x05c3('0x2c')]==_0x05c3('0x2d')){_0xa8a612[_0x05c3('0x17')]='';_0xa8a612[_0x05c3('0x26')]=extractCalleridNumber(_0xa8a612[_0x05c3('0x2e')]);}else if(_0xa8a612[_0x05c3('0x2c')]=='from-sip'){if(_0xa8a612[_0x05c3('0x26')]=='xcally-motion-preview'){_0xa8a612[_0x05c3('0x26')]=extractCalleridNumber(_0xa8a612[_0x05c3('0x2f')]);_0xa8a612[_0x05c3('0x30')]=_0xa8a612[_0x05c3('0x31')];_0xa8a612[_0x05c3('0x32')]=[_0xa8a612[_0x05c3('0x33')],_0xa8a612['channel']=_0xa8a612['destinationchannel']][0x0];_0xa8a612[_0x05c3('0x2e')]=_0xa8a612[_0x05c3('0x2f')];}else{_0xa8a612[_0x05c3('0x26')]=_0xa8a612[_0x05c3('0x30')];_0xa8a612[_0x05c3('0x30')]=_0xa8a612['originatecalleridnum'];if(_0xa8a612[_0x05c3('0x34')]==_0x05c3('0x35')){_0xa8a612['accountcode']=_0xa8a612[_0x05c3('0x1d')];}else{_0xa8a612[_0x05c3('0x17')]='';}}}}else{_0xa8a612['callerid']=util[_0x05c3('0x19')](_0x05c3('0x36'),_0xa8a612[_0x05c3('0x37')],_0xa8a612[_0x05c3('0x30')]);}RpcVoiceCallReport[_0x05c3('0x38')](_0xa8a612);if(_0xa8a612['monitor']){for(var _0xabf462=0x0;_0xabf462<_0xa8a612['monitors'][_0x05c3('0x1b')];_0xabf462+=0x1){_0xa8a612[_0x05c3('0x39')]=_0xa8a612[_0x05c3('0x3a')][_0xabf462][_0x05c3('0x3b')];_0xa8a612['createdAt']=_0xa8a612[_0x05c3('0x3a')][_0xabf462][_0x05c3('0x3c')];if(_0xa8a612[_0x05c3('0x27')]==_0x05c3('0x3d')){_0xa8a612['calleridnum']=_0xa8a612[_0x05c3('0x1d')];_0xa8a612[_0x05c3('0x37')]=_0xa8a612[_0x05c3('0x3e')];_0xa8a612[_0x05c3('0x1d')]=_0xa8a612[_0x05c3('0x17')];_0xa8a612['connectedlinename']=_0xa8a612[_0x05c3('0x3f')];_0xa8a612['exten']=_0xa8a612[_0x05c3('0x31')];}else if(_0xa8a612[_0x05c3('0x27')]==_0x05c3('0x40')){_0xa8a612[_0x05c3('0x30')]=_0xa8a612[_0x05c3('0x26')];_0xa8a612[_0x05c3('0x27')]=_0xa8a612[_0x05c3('0x31')];}RpcVoiceRecording[_0x05c3('0x38')](_0xa8a612);}}};Report['prototype'][_0x05c3('0x41')]=function(_0x47affd){RpcVoiceAgentReport[_0x05c3('0x38')](_0x47affd);};Report[_0x05c3('0x12')][_0x05c3('0x42')]=function(_0x4cb819){RpcVoiceDialReport['create'](_0x4cb819);var _0x20d5bd=undefined;var _0x3e48ff=_0x4cb819['channel'];if(_[_0x05c3('0x43')](_0x3e48ff,_0x05c3('0x44'))){var _0x658e6=_0x3e48ff[_0x05c3('0x45')](_0x3e48ff[_0x05c3('0x46')]('/')+0x1,_0x3e48ff['indexOf']('@'));_0x20d5bd=_['find'](this[_0x05c3('0x14')],function(_0x1d2d53){return _0x1d2d53[_0x05c3('0x47')]==_0x658e6||_0x1d2d53[_0x05c3('0x48')]==_0x658e6||_0x1d2d53[_0x05c3('0x17')]==_0x658e6;});}else{var _0x658e6=_0x3e48ff['substring'](_0x3e48ff[_0x05c3('0x46')]('/')+0x1,_0x3e48ff[_0x05c3('0x49')]('-'));_0x20d5bd=this[_0x05c3('0x1c')](_0x658e6);}if(_0x20d5bd){_0x4cb819[_0x05c3('0x18')]=_['isNil'](_0x20d5bd[_0x05c3('0x18')])?util['format'](_0x05c3('0x1a'),_0x20d5bd[_0x05c3('0x15')]):_0x20d5bd[_0x05c3('0x18')];_0x4cb819[_0x05c3('0x3f')]=_0x20d5bd[_0x05c3('0x15')];_0x4cb819[_0x05c3('0x17')]=_0x20d5bd[_0x05c3('0x17')];RpcMemberReport[_0x05c3('0x42')](_0x4cb819);}};Report[_0x05c3('0x12')]['blindTransfer']=function(_0x1cc9fd){RpcVoiceTransferReport[_0x05c3('0x4a')](_0x1cc9fd);};Report[_0x05c3('0x12')][_0x05c3('0x4b')]=function(_0x1f9be7){RpcVoiceTransferReport[_0x05c3('0x4b')](_0x1f9be7);};module[_0x05c3('0x4c')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 182ff83..ea3d9df 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x151c=['telephone:save','trunk:%s','trunk:save','startsWith','Queue','Local','substring','indexOf','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','[syncPeerStatus][UserReport]','exports','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','resolve','isNotNull','isUndefined','emit','find','username','stateRegistry','state','merge','omit','actionid','format','name','[syncRegistry][UserReport]','device','local','toLowerCase','stateTime','toNumber','updateStatusRealtime'];(function(_0x91384,_0x545eef){var _0x44daa0=function(_0x5a0cc5){while(--_0x5a0cc5){_0x91384['push'](_0x91384['shift']());}};_0x44daa0(++_0x545eef);}(_0x151c,0x165));var _0xc151=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x151c[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var moment=require(_0xc151('0x0'));var BPromise=require(_0xc151('0x1'));var util=require('util');var Redis=require(_0xc151('0x2'));var config=require(_0xc151('0x3'));var logger=require(_0xc151('0x4'))(_0xc151('0x5'));var ami=require(_0xc151('0x6'));config['redis']=_['defaults'](config[_0xc151('0x7')],{'host':_0xc151('0x8'),'port':0x18eb});var io=require(_0xc151('0x9'))(new Redis(config[_0xc151('0x7')]));function UserReport(_0x428b3b){this[_0xc151('0xa')]=_0x428b3b[_0xc151('0xa')];this[_0xc151('0xb')]=_0x428b3b[_0xc151('0xb')];this[_0xc151('0xc')]=_0x428b3b[_0xc151('0xc')];ami['on'](_0xc151('0xd'),this[_0xc151('0xe')]['bind'](this));ami['on'](_0xc151('0xf'),this[_0xc151('0xe')][_0xc151('0x10')](this));ami['on'](_0xc151('0x11'),this[_0xc151('0x12')][_0xc151('0x10')](this));ami['on'](_0xc151('0x13'),this[_0xc151('0x14')][_0xc151('0x10')](this));this[_0xc151('0x15')]();return BPromise['resolve']()[_0xc151('0x16')](ami[_0xc151('0x17')]())[_0xc151('0x16')](ami[_0xc151('0x18')]())['then'](ami[_0xc151('0x19')]())[_0xc151('0x1a')](loggerCatch(_0xc151('0x1b')));}function loggerCatch(_0x46e291){return function(_0x38d4e0){logger[_0xc151('0x1c')](_0x46e291,util[_0xc151('0x1d')](_0x38d4e0,{'showHidden':![],'depth':null}));};}UserReport[_0xc151('0x1e')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0xc151('0x1f')]()['then'](ami[_0xc151('0x17')]())[_0xc151('0x16')](ami[_0xc151('0x18')]())[_0xc151('0x16')](ami['actionSipPeerStatus']())[_0xc151('0x1a')](loggerCatch(_0xc151('0x1b')));},0x32c8);};UserReport['prototype'][_0xc151('0x20')]=function(_0x45a8c5){return _0x45a8c5!==null&&!_[_0xc151('0x21')](_0x45a8c5);};UserReport[_0xc151('0x1e')]['emit']=function(_0x1dbf60,_0x10f9dd,_0x415751){io['to'](_0x1dbf60)[_0xc151('0x22')](_0x10f9dd,_0x415751);};UserReport[_0xc151('0x1e')]['syncRegistry']=function(_0x39b17a){try{if(this[_0xc151('0x20')](_0x39b17a)){var _0x5a22e9=_[_0xc151('0x23')](this[_0xc151('0xa')],{'registry':_0x39b17a[_0xc151('0x24')]});if(_0x5a22e9){_0x39b17a[_0xc151('0x25')]=_0x39b17a[_0xc151('0x26')];_[_0xc151('0x27')](_0x5a22e9,_[_0xc151('0x28')](_0x39b17a,['event',_0xc151('0x29'),_0xc151('0x24'),_0xc151('0x26')]));this[_0xc151('0x22')](util[_0xc151('0x2a')]('trunk:%s',_0x5a22e9[_0xc151('0x2b')]),'trunk:save',_0x5a22e9);}}}catch(_0x410a57){logger['error'](_0xc151('0x2c'),util[_0xc151('0x1d')](_0x410a57,{'showHidden':![],'depth':null}));}};UserReport[_0xc151('0x1e')]['syncDeviceState']=function(_0x19fafc){try{if(this['isNotNull'](_0x19fafc)){if(this[_0xc151('0xb')][_0x19fafc[_0xc151('0x2d')]]){if(!this['agents'][_0x19fafc['device']][_0xc151('0x2e')]||_0x19fafc[_0xc151('0x26')][_0xc151('0x2f')]()=='inuse'){this[_0xc151('0xb')][_0x19fafc[_0xc151('0x2d')]][_0xc151('0x2e')]=![];if(this[_0xc151('0xb')][_0x19fafc[_0xc151('0x2d')]][_0xc151('0x26')]!==_0x19fafc[_0xc151('0x26')]['toLowerCase']()){this[_0xc151('0xb')][_0x19fafc[_0xc151('0x2d')]][_0xc151('0x30')]=_[_0xc151('0x31')](moment()['format']('x'));}this[_0xc151('0xb')][_0x19fafc[_0xc151('0x2d')]][_0xc151('0x26')]=_0x19fafc[_0xc151('0x26')]['toLowerCase']();this[_0xc151('0xb')][_0x19fafc[_0xc151('0x2d')]][_0xc151('0x32')](_0x19fafc);}}else if(this[_0xc151('0xc')][_0x19fafc[_0xc151('0x2d')]]){if(this[_0xc151('0xc')][_0x19fafc['device']]['state']!==_0x19fafc[_0xc151('0x26')][_0xc151('0x2f')]()){this[_0xc151('0xc')][_0x19fafc['device']][_0xc151('0x30')]=_['toNumber'](moment()[_0xc151('0x2a')]('x'));}this[_0xc151('0xc')][_0x19fafc['device']][_0xc151('0x26')]=_0x19fafc['state'][_0xc151('0x2f')]();this[_0xc151('0x22')](util[_0xc151('0x2a')]('telephone:%s',this['telephones'][_0x19fafc[_0xc151('0x2d')]][_0xc151('0x2b')]),_0xc151('0x33'),this['telephones'][_0x19fafc[_0xc151('0x2d')]]);}else if(this[_0xc151('0xa')][_0x19fafc['device']]){if(this['trunks'][_0x19fafc[_0xc151('0x2d')]][_0xc151('0x26')]!==_0x19fafc[_0xc151('0x26')][_0xc151('0x2f')]()){this['trunks'][_0x19fafc['device']]['stateTime']=_[_0xc151('0x31')](moment()[_0xc151('0x2a')]('x'));}this[_0xc151('0xa')][_0x19fafc[_0xc151('0x2d')]]['state']=_0x19fafc[_0xc151('0x26')]['toLowerCase']();this[_0xc151('0x22')](util[_0xc151('0x2a')](_0xc151('0x34'),this['trunks'][_0x19fafc[_0xc151('0x2d')]][_0xc151('0x2b')]),_0xc151('0x35'),this[_0xc151('0xa')][_0x19fafc[_0xc151('0x2d')]]);}else if(_[_0xc151('0x36')](_0x19fafc[_0xc151('0x2d')],_0xc151('0x37'))){}else if(_['startsWith'](_0x19fafc['device'],_0xc151('0x38'))){var _0x8192b9=_0x19fafc[_0xc151('0x2d')];var _0x270261=_0x8192b9[_0xc151('0x39')](_0x8192b9[_0xc151('0x3a')]('/')+0x1,_0x8192b9[_0xc151('0x3a')]('@'));var _0x22384d=_[_0xc151('0x23')](this['agents'],function(_0x40441d){return _0x40441d['mobile']==_0x270261||_0x40441d[_0xc151('0x3b')]==_0x270261||_0x40441d[_0xc151('0x3c')]==_0x270261;});if(_0x22384d){if(_0x22384d[_0xc151('0x26')]!==_0x19fafc[_0xc151('0x26')][_0xc151('0x2f')]()){_0x22384d[_0xc151('0x30')]=_[_0xc151('0x31')](moment()[_0xc151('0x2a')]('x'));}_0x22384d[_0xc151('0x26')]=_0x19fafc['state'][_0xc151('0x2f')]();_0x22384d['local']=!![];_0x22384d[_0xc151('0x32')](_0x19fafc);}}else{}}}catch(_0x4f3f78){logger[_0xc151('0x1c')](_0xc151('0x3d'),util[_0xc151('0x1d')](_0x4f3f78,{'showHidden':![],'depth':null}));}};UserReport[_0xc151('0x1e')][_0xc151('0x14')]=function(_0x5dd44a){try{if(this[_0xc151('0x20')](_0x5dd44a)&&this[_0xc151('0x20')](_0x5dd44a['peerstatus'])){if(this['agents'][_0x5dd44a[_0xc151('0x3e')]]){if(!this[_0xc151('0xb')][_0x5dd44a[_0xc151('0x3e')]][_0xc151('0x2e')]||_0x5dd44a['peerstatus']['toLowerCase']()==_0xc151('0x3f')){this[_0xc151('0xb')][_0x5dd44a[_0xc151('0x3e')]]['local']=![];this[_0xc151('0xb')][_0x5dd44a[_0xc151('0x3e')]][_0xc151('0x40')]=_0x5dd44a[_0xc151('0x13')][_0xc151('0x2f')]();this['agents'][_0x5dd44a[_0xc151('0x3e')]]['address']=_0x5dd44a[_0xc151('0x41')];this[_0xc151('0xb')][_0x5dd44a[_0xc151('0x3e')]]['updateStatusRealtime'](_0x5dd44a);}}else if(this['telephones'][_0x5dd44a[_0xc151('0x3e')]]){this[_0xc151('0xc')][_0x5dd44a[_0xc151('0x3e')]][_0xc151('0x40')]=_0x5dd44a[_0xc151('0x13')][_0xc151('0x2f')]();this[_0xc151('0xc')][_0x5dd44a[_0xc151('0x3e')]][_0xc151('0x41')]=_0x5dd44a['address'];this[_0xc151('0x22')](util[_0xc151('0x2a')]('telephone:%s',this['telephones'][_0x5dd44a[_0xc151('0x3e')]][_0xc151('0x2b')]),_0xc151('0x33'),this['telephones'][_0x5dd44a[_0xc151('0x3e')]]);}else if(this['trunks'][_0x5dd44a[_0xc151('0x3e')]]){this[_0xc151('0xa')][_0x5dd44a[_0xc151('0x3e')]]['status']=_0x5dd44a[_0xc151('0x13')][_0xc151('0x2f')]();this[_0xc151('0xa')][_0x5dd44a[_0xc151('0x3e')]]['address']=_0x5dd44a[_0xc151('0x41')];this[_0xc151('0x22')](util[_0xc151('0x2a')]('trunk:%s',this[_0xc151('0xa')][_0x5dd44a[_0xc151('0x3e')]][_0xc151('0x2b')]),'trunk:save',this[_0xc151('0xa')][_0x5dd44a['peer']]);}else{}}}catch(_0xbd322){logger[_0xc151('0x1c')](_0xc151('0x42'),util[_0xc151('0x1d')](_0xbd322,{'showHidden':![],'depth':null}));}};module[_0xc151('0x43')]=UserReport; \ No newline at end of file +var _0xb408=['syncRegistry','devicestatechange','syncDeviceState','syncPeerStatus','loopSyncRealTimeShow','actionSipShowRegistry','then','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isNotNull','isUndefined','emit','find','username','merge','omit','actionid','state','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','toNumber','updateStatusRealtime','stateTime','telephone:%s','telephone:save','startsWith','Queue','substring','indexOf','accountcode','[syncDeviceState][UserReport]','peerstatus','peer','status','address','[syncPeerStatus][UserReport]','lodash','moment','bluebird','util','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','trunks','agents','telephones','registryentry','bind','registry'];(function(_0x1c877f,_0x3f060c){var _0x3fe5db=function(_0x54bb35){while(--_0x54bb35){_0x1c877f['push'](_0x1c877f['shift']());}};_0x3fe5db(++_0x3f060c);}(_0xb408,0x1f0));var _0x8b40=function(_0x162f62,_0x1a0ab1){_0x162f62=_0x162f62-0x0;var _0x26c56e=_0xb408[_0x162f62];return _0x26c56e;};'use strict';var _=require(_0x8b40('0x0'));var moment=require(_0x8b40('0x1'));var BPromise=require(_0x8b40('0x2'));var util=require(_0x8b40('0x3'));var Redis=require('ioredis');var config=require(_0x8b40('0x4'));var logger=require(_0x8b40('0x5'))(_0x8b40('0x6'));var ami=require('../ami');config[_0x8b40('0x7')]=_[_0x8b40('0x8')](config[_0x8b40('0x7')],{'host':_0x8b40('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8b40('0x7')]));function UserReport(_0x263db2){this[_0x8b40('0xa')]=_0x263db2['trunks'];this['agents']=_0x263db2[_0x8b40('0xb')];this[_0x8b40('0xc')]=_0x263db2[_0x8b40('0xc')];ami['on'](_0x8b40('0xd'),this['syncRegistry'][_0x8b40('0xe')](this));ami['on'](_0x8b40('0xf'),this[_0x8b40('0x10')]['bind'](this));ami['on'](_0x8b40('0x11'),this[_0x8b40('0x12')][_0x8b40('0xe')](this));ami['on']('peerstatus',this[_0x8b40('0x13')][_0x8b40('0xe')](this));this[_0x8b40('0x14')]();return BPromise['resolve']()['then'](ami[_0x8b40('0x15')]())[_0x8b40('0x16')](ami[_0x8b40('0x17')]())[_0x8b40('0x16')](ami[_0x8b40('0x18')]())[_0x8b40('0x19')](loggerCatch(_0x8b40('0x1a')));}function loggerCatch(_0x1c8b3b){return function(_0xce8c9c){logger[_0x8b40('0x1b')](_0x1c8b3b,util[_0x8b40('0x1c')](_0xce8c9c,{'showHidden':![],'depth':null}));};}UserReport[_0x8b40('0x1d')][_0x8b40('0x14')]=function(){setInterval(function(){BPromise['resolve']()[_0x8b40('0x16')](ami[_0x8b40('0x15')]())[_0x8b40('0x16')](ami['actionDeviceStateList']())[_0x8b40('0x16')](ami[_0x8b40('0x18')]())['catch'](loggerCatch(_0x8b40('0x1a')));},0x32c8);};UserReport[_0x8b40('0x1d')][_0x8b40('0x1e')]=function(_0x1b9a18){return _0x1b9a18!==null&&!_[_0x8b40('0x1f')](_0x1b9a18);};UserReport[_0x8b40('0x1d')][_0x8b40('0x20')]=function(_0x46208f,_0x17fbf8,_0xfa6d96){io['to'](_0x46208f)[_0x8b40('0x20')](_0x17fbf8,_0xfa6d96);};UserReport[_0x8b40('0x1d')]['syncRegistry']=function(_0x5f735b){try{if(this[_0x8b40('0x1e')](_0x5f735b)){var _0x26c2fc=_[_0x8b40('0x21')](this[_0x8b40('0xa')],{'registry':_0x5f735b[_0x8b40('0x22')]});if(_0x26c2fc){_0x5f735b['stateRegistry']=_0x5f735b['state'];_[_0x8b40('0x23')](_0x26c2fc,_[_0x8b40('0x24')](_0x5f735b,['event',_0x8b40('0x25'),'username',_0x8b40('0x26')]));this[_0x8b40('0x20')](util[_0x8b40('0x27')](_0x8b40('0x28'),_0x26c2fc[_0x8b40('0x29')]),_0x8b40('0x2a'),_0x26c2fc);}}}catch(_0xa70b6d){logger[_0x8b40('0x1b')](_0x8b40('0x2b'),util[_0x8b40('0x1c')](_0xa70b6d,{'showHidden':![],'depth':null}));}};UserReport[_0x8b40('0x1d')]['syncDeviceState']=function(_0x2a3e7a){try{if(this['isNotNull'](_0x2a3e7a)){if(this[_0x8b40('0xb')][_0x2a3e7a['device']]){if(!this['agents'][_0x2a3e7a[_0x8b40('0x2c')]][_0x8b40('0x2d')]||_0x2a3e7a['state'][_0x8b40('0x2e')]()==_0x8b40('0x2f')){this[_0x8b40('0xb')][_0x2a3e7a[_0x8b40('0x2c')]][_0x8b40('0x2d')]=![];if(this[_0x8b40('0xb')][_0x2a3e7a[_0x8b40('0x2c')]][_0x8b40('0x26')]!==_0x2a3e7a[_0x8b40('0x26')]['toLowerCase']()){this[_0x8b40('0xb')][_0x2a3e7a['device']]['stateTime']=_[_0x8b40('0x30')](moment()[_0x8b40('0x27')]('x'));}this[_0x8b40('0xb')][_0x2a3e7a[_0x8b40('0x2c')]][_0x8b40('0x26')]=_0x2a3e7a[_0x8b40('0x26')][_0x8b40('0x2e')]();this[_0x8b40('0xb')][_0x2a3e7a[_0x8b40('0x2c')]][_0x8b40('0x31')](_0x2a3e7a);}}else if(this[_0x8b40('0xc')][_0x2a3e7a[_0x8b40('0x2c')]]){if(this['telephones'][_0x2a3e7a['device']][_0x8b40('0x26')]!==_0x2a3e7a[_0x8b40('0x26')][_0x8b40('0x2e')]()){this[_0x8b40('0xc')][_0x2a3e7a[_0x8b40('0x2c')]][_0x8b40('0x32')]=_[_0x8b40('0x30')](moment()[_0x8b40('0x27')]('x'));}this[_0x8b40('0xc')][_0x2a3e7a[_0x8b40('0x2c')]][_0x8b40('0x26')]=_0x2a3e7a['state']['toLowerCase']();this[_0x8b40('0x20')](util[_0x8b40('0x27')](_0x8b40('0x33'),this['telephones'][_0x2a3e7a[_0x8b40('0x2c')]][_0x8b40('0x29')]),_0x8b40('0x34'),this[_0x8b40('0xc')][_0x2a3e7a[_0x8b40('0x2c')]]);}else if(this['trunks'][_0x2a3e7a[_0x8b40('0x2c')]]){if(this['trunks'][_0x2a3e7a[_0x8b40('0x2c')]][_0x8b40('0x26')]!==_0x2a3e7a['state'][_0x8b40('0x2e')]()){this[_0x8b40('0xa')][_0x2a3e7a[_0x8b40('0x2c')]][_0x8b40('0x32')]=_[_0x8b40('0x30')](moment()['format']('x'));}this[_0x8b40('0xa')][_0x2a3e7a[_0x8b40('0x2c')]]['state']=_0x2a3e7a['state'][_0x8b40('0x2e')]();this[_0x8b40('0x20')](util[_0x8b40('0x27')](_0x8b40('0x28'),this[_0x8b40('0xa')][_0x2a3e7a[_0x8b40('0x2c')]][_0x8b40('0x29')]),_0x8b40('0x2a'),this['trunks'][_0x2a3e7a[_0x8b40('0x2c')]]);}else if(_[_0x8b40('0x35')](_0x2a3e7a[_0x8b40('0x2c')],_0x8b40('0x36'))){}else if(_['startsWith'](_0x2a3e7a['device'],'Local')){var _0x44c628=_0x2a3e7a[_0x8b40('0x2c')];var _0x4e482e=_0x44c628[_0x8b40('0x37')](_0x44c628['indexOf']('/')+0x1,_0x44c628[_0x8b40('0x38')]('@'));var _0x23a8ea=_[_0x8b40('0x21')](this[_0x8b40('0xb')],function(_0x3c1b00){return _0x3c1b00['mobile']==_0x4e482e||_0x3c1b00['phone']==_0x4e482e||_0x3c1b00[_0x8b40('0x39')]==_0x4e482e;});if(_0x23a8ea){if(_0x23a8ea[_0x8b40('0x26')]!==_0x2a3e7a[_0x8b40('0x26')][_0x8b40('0x2e')]()){_0x23a8ea[_0x8b40('0x32')]=_[_0x8b40('0x30')](moment()['format']('x'));}_0x23a8ea[_0x8b40('0x26')]=_0x2a3e7a[_0x8b40('0x26')][_0x8b40('0x2e')]();_0x23a8ea[_0x8b40('0x2d')]=!![];_0x23a8ea['updateStatusRealtime'](_0x2a3e7a);}}else{}}}catch(_0x3dad00){logger[_0x8b40('0x1b')](_0x8b40('0x3a'),util[_0x8b40('0x1c')](_0x3dad00,{'showHidden':![],'depth':null}));}};UserReport[_0x8b40('0x1d')][_0x8b40('0x13')]=function(_0x4bae46){try{if(this['isNotNull'](_0x4bae46)&&this[_0x8b40('0x1e')](_0x4bae46[_0x8b40('0x3b')])){if(this[_0x8b40('0xb')][_0x4bae46[_0x8b40('0x3c')]]){if(!this[_0x8b40('0xb')][_0x4bae46[_0x8b40('0x3c')]]['local']||_0x4bae46['peerstatus'][_0x8b40('0x2e')]()=='registered'){this[_0x8b40('0xb')][_0x4bae46[_0x8b40('0x3c')]][_0x8b40('0x2d')]=![];this[_0x8b40('0xb')][_0x4bae46['peer']][_0x8b40('0x3d')]=_0x4bae46[_0x8b40('0x3b')][_0x8b40('0x2e')]();this['agents'][_0x4bae46[_0x8b40('0x3c')]][_0x8b40('0x3e')]=_0x4bae46['address'];this[_0x8b40('0xb')][_0x4bae46['peer']]['updateStatusRealtime'](_0x4bae46);}}else if(this[_0x8b40('0xc')][_0x4bae46[_0x8b40('0x3c')]]){this['telephones'][_0x4bae46[_0x8b40('0x3c')]][_0x8b40('0x3d')]=_0x4bae46[_0x8b40('0x3b')][_0x8b40('0x2e')]();this[_0x8b40('0xc')][_0x4bae46[_0x8b40('0x3c')]][_0x8b40('0x3e')]=_0x4bae46[_0x8b40('0x3e')];this['emit'](util[_0x8b40('0x27')](_0x8b40('0x33'),this['telephones'][_0x4bae46[_0x8b40('0x3c')]]['name']),'telephone:save',this[_0x8b40('0xc')][_0x4bae46[_0x8b40('0x3c')]]);}else if(this[_0x8b40('0xa')][_0x4bae46[_0x8b40('0x3c')]]){this['trunks'][_0x4bae46['peer']]['status']=_0x4bae46[_0x8b40('0x3b')]['toLowerCase']();this[_0x8b40('0xa')][_0x4bae46[_0x8b40('0x3c')]][_0x8b40('0x3e')]=_0x4bae46[_0x8b40('0x3e')];this[_0x8b40('0x20')](util['format'](_0x8b40('0x28'),this['trunks'][_0x4bae46[_0x8b40('0x3c')]]['name']),_0x8b40('0x2a'),this['trunks'][_0x4bae46[_0x8b40('0x3c')]]);}else{}}}catch(_0x2bfb80){logger[_0x8b40('0x1b')](_0x8b40('0x3f'),util[_0x8b40('0x1c')](_0x2bfb80,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 21ab176..4b4a927 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf531=['log','info','format','%s|%s','uniqueid','membername','exten','join','add','seconds','YYYY-MM-DD\x20HH:mm:ss','diff','isNil','assign','queue','calleridnum','emit','destcalleridnum','destcalleridname','destaccountcode','channel','context','priority','inbound','interface','mandatoryDisposition','agent','called','custom:agentcalled','user:%s','user:called','CALLED','destchannel','stack','holdtime','ringtime','agentconnectAt','addTime','agentcalledAt','custom:agentconnect','CONNECT','error','find','onhold','updateStatusRealtime','syncAgentRingNoAnswer','rejected','custom:agentringnoanswer','position','originalposition','abandoned','custom:agentqueuecallerabandon','talktime','transfer','reason','complete','agentcompleteAt','clear','cause','answered_elsewhere','custom:agentcomplete','HANGUP','custom:voiceAgentReport','cause-txt','recalculate','acwTimeout','diffTime','user:save','origtransfererchannel','ATTENDED','secondtransfereruniqueid','secondtransferercontext','acw','transfertargetchannel','syncBlindTransfer','transfererchannel','BLIND','extension','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','value','exports','lodash','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','voiceQueues','agents','channels','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncAttendedTransfer','blindtransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','prototype'];(function(_0x55054d,_0x35adc6){var _0x5324fa=function(_0x348b0c){while(--_0x348b0c){_0x55054d['push'](_0x55054d['shift']());}};_0x5324fa(++_0x35adc6);}(_0xf531,0x166));var _0x1f53=function(_0x2587ca,_0x231303){_0x2587ca=_0x2587ca-0x0;var _0x5aada1=_0xf531[_0x2587ca];return _0x5aada1;};'use strict';var _=require(_0x1f53('0x0'));var moment=require('moment');var util=require(_0x1f53('0x1'));var Redis=require(_0x1f53('0x2'));var config=require(_0x1f53('0x3'));var logger=require('../../../config/logger')(_0x1f53('0x4'));var ami=require(_0x1f53('0x5'));config[_0x1f53('0x6')]=_[_0x1f53('0x7')](config[_0x1f53('0x6')],{'host':_0x1f53('0x8'),'port':0x18eb});var io=require(_0x1f53('0x9'))(new Redis(config[_0x1f53('0x6')]));function VoiceAgentReport(_0x164813){this[_0x1f53('0xa')]=_0x164813[_0x1f53('0xa')];this[_0x1f53('0xb')]=_0x164813[_0x1f53('0xb')];this[_0x1f53('0xc')]={};this[_0x1f53('0xd')]={};ami['on'](_0x1f53('0xe'),this[_0x1f53('0xf')][_0x1f53('0x10')](this));ami['on'](_0x1f53('0x11'),this[_0x1f53('0x12')][_0x1f53('0x10')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x1f53('0x10')](this));ami['on']('queuecallerabandon',this[_0x1f53('0x13')][_0x1f53('0x10')](this));ami['on'](_0x1f53('0x14'),this[_0x1f53('0x15')][_0x1f53('0x10')](this));ami['on'](_0x1f53('0x16'),this[_0x1f53('0x17')][_0x1f53('0x10')](this));ami['on'](_0x1f53('0x18'),this[_0x1f53('0x19')][_0x1f53('0x10')](this));ami['on']('attendedtransfer',this[_0x1f53('0x1a')]['bind'](this));ami['on'](_0x1f53('0x1b'),this['syncBlindTransfer']['bind'](this));ami['on']('musiconholdstart',this[_0x1f53('0x1c')][_0x1f53('0x10')](this));ami['on'](_0x1f53('0x1d'),this[_0x1f53('0x1e')][_0x1f53('0x10')](this));}VoiceAgentReport[_0x1f53('0x1f')][_0x1f53('0x20')]=function(_0x490996,_0x5ae4eb){logger[_0x1f53('0x21')](util[_0x1f53('0x22')](_0x1f53('0x23'),_0x490996,[_0x5ae4eb[_0x1f53('0x24')],_0x5ae4eb[_0x1f53('0x25')],_0x5ae4eb['queue'],_0x5ae4eb[_0x1f53('0x26')],_0x5ae4eb['calleridnum']][_0x1f53('0x27')]('|')));};VoiceAgentReport['prototype']['addTime']=function(_0x418307,_0x5a86c9){return moment(_0x418307)[_0x1f53('0x28')](_0x5a86c9,_0x1f53('0x29'))[_0x1f53('0x22')](_0x1f53('0x2a'));};VoiceAgentReport[_0x1f53('0x1f')]['diffTime']=function(_0x29ed7a,_0x44a965){return moment(_0x29ed7a)[_0x1f53('0x2b')](moment(_0x44a965),_0x1f53('0x29'));};VoiceAgentReport[_0x1f53('0x1f')][_0x1f53('0xf')]=function(_0x129590){try{var _0x4f6bc6=this['agents'][_0x129590['interface']];if(!_[_0x1f53('0x2c')](_0x4f6bc6)){_0x4f6bc6=_[_0x1f53('0x2d')](_0x4f6bc6,{'queue':_0x129590[_0x1f53('0x2e')],'destconnectedlinenum':_0x129590[_0x1f53('0x2f')]});io[_0x1f53('0x30')]('user:save',_0x4f6bc6);}var _0x415411=this[_0x1f53('0xc')][_0x129590['destchannel']]={'agentcalledAt':moment()[_0x1f53('0x22')](_0x1f53('0x2a')),'calleridnum':_0x129590['calleridnum'],'calleridname':_0x129590['calleridname'],'connectedlinenum':_0x129590[_0x1f53('0x31')],'connectedlinename':_0x129590[_0x1f53('0x32')],'accountcode':_0x129590['accountcode'],'destaccountcode':_0x129590[_0x1f53('0x33')],'channel':_0x129590[_0x1f53('0x34')],'destchannel':_0x129590['destchannel'],'uniqueid':_0x129590['uniqueid'],'destuniqueid':_0x129590['destuniqueid'],'context':_0x129590[_0x1f53('0x35')],'exten':_0x129590['exten'],'priority':_0x129590[_0x1f53('0x36')],'queue':_0x129590[_0x1f53('0x2e')],'type':this[_0x1f53('0xa')][_0x129590['queue']]?this['voiceQueues'][_0x129590[_0x1f53('0x2e')]]['type']||'inbound':_0x1f53('0x37'),'interface':_0x129590[_0x1f53('0x38')],'mandatoryDisposition':this[_0x1f53('0xa')][_0x129590[_0x1f53('0x2e')]][_0x1f53('0x39')]||0x0,'membername':_0x129590[_0x1f53('0x25')],'agentconnect':![],'agentconnectAt':null,'holdtime':0x0,'ringtime':0x0,'agentcomplete':![],'agentcompleteAt':null,'talktime':0x0,'agentringnoanswer':![],'agentringnoanswerAt':null,'reason':_0x1f53('0x3a'),'transfer':![],'transferAt':null,'transfertype':null,'transferuniqueid':null,'transfercontext':null,'transferextension':null,'position':null,'originalposition':null,'cause':'','cause-txt':'','UserId':this[_0x1f53('0xb')][_0x129590[_0x1f53('0x38')]]?this['agents'][_0x129590[_0x1f53('0x38')]]['id']:null,'lastevent':_0x1f53('0x3b'),'agentacw':![],'acwtime':0x0,'variables':this[_0x1f53('0xd')][_0x129590[_0x1f53('0x34')]]?this['variables'][_0x129590[_0x1f53('0x34')]]:{}};ami[_0x1f53('0x30')](_0x1f53('0x3c'),_0x415411);io['to'](util[_0x1f53('0x22')](_0x1f53('0x3d'),_0x415411['membername']))[_0x1f53('0x30')](_0x1f53('0x3e'),_0x415411);this[_0x1f53('0x20')](_0x1f53('0x3f'),this['channels'][_0x129590[_0x1f53('0x40')]]);}catch(_0x47320e){logger['error'](_0x47320e[_0x1f53('0x41')]);}};VoiceAgentReport[_0x1f53('0x1f')][_0x1f53('0x12')]=function(_0x195561){try{var _0x2f7036=this[_0x1f53('0xc')][_0x195561[_0x1f53('0x40')]];if(!_['isNil'](_0x2f7036)){_0x2f7036=_[_0x1f53('0x2d')](_0x2f7036,{'holdtime':parseInt(_0x195561[_0x1f53('0x42')],0xa),'ringtime':parseInt(_0x195561[_0x1f53('0x43')],0xa),'agentconnect':!![],'lastevent':'connect'});_0x2f7036[_0x1f53('0x44')]=this[_0x1f53('0x45')](_0x2f7036[_0x1f53('0x46')],_0x2f7036[_0x1f53('0x43')]);ami[_0x1f53('0x30')](_0x1f53('0x47'),_0x2f7036);io['to'](util[_0x1f53('0x22')](_0x1f53('0x3d'),_0x2f7036[_0x1f53('0x25')]))[_0x1f53('0x30')]('user:agentconnect',_0x2f7036);this[_0x1f53('0x20')](_0x1f53('0x48'),_0x2f7036);}}catch(_0x4054c8){logger[_0x1f53('0x49')](_0x4054c8['stack']);}};VoiceAgentReport['prototype'][_0x1f53('0x1c')]=function(_0x513e4d){try{var _0xde9365=_[_0x1f53('0x4a')](this[_0x1f53('0xc')],{'channel':_0x513e4d[_0x1f53('0x34')],'agentconnect':!![]});if(!_[_0x1f53('0x2c')](_0xde9365)){if(!_[_0x1f53('0x2c')](this[_0x1f53('0xb')][_0xde9365['interface']])){this['agents'][_0xde9365[_0x1f53('0x38')]][_0x1f53('0x4b')]=!![];this[_0x1f53('0xb')][_0xde9365['interface']][_0x1f53('0x4c')]();}}}catch(_0x481356){logger[_0x1f53('0x49')](_0x481356[_0x1f53('0x41')]);}};VoiceAgentReport['prototype'][_0x1f53('0x1e')]=function(_0x2fe970){try{var _0x3be020=_[_0x1f53('0x4a')](this[_0x1f53('0xc')],{'channel':_0x2fe970[_0x1f53('0x34')],'agentconnect':!![]});if(!_['isNil'](_0x3be020)){if(!_['isNil'](this[_0x1f53('0xb')][_0x3be020['interface']])){this[_0x1f53('0xb')][_0x3be020['interface']][_0x1f53('0x4b')]=![];this[_0x1f53('0xb')][_0x3be020['interface']][_0x1f53('0x4c')]();}}}catch(_0x57544d){logger['error'](_0x57544d[_0x1f53('0x41')]);}};VoiceAgentReport[_0x1f53('0x1f')][_0x1f53('0x4d')]=function(_0x3ca734){try{var _0x12dac3=this[_0x1f53('0xc')][_0x3ca734[_0x1f53('0x40')]];if(!_[_0x1f53('0x2c')](_0x12dac3)){_0x12dac3=_[_0x1f53('0x2d')](_0x12dac3,{'ringtime':parseInt(_0x3ca734[_0x1f53('0x43')],0xa)/0x3e8,'agentringnoanswer':!![],'reason':_0x1f53('0x4e'),'lastevent':_0x1f53('0x4e')});_0x12dac3['agentringnoanswerAt']=this['addTime'](_0x12dac3[_0x1f53('0x46')],_0x12dac3[_0x1f53('0x43')]);ami[_0x1f53('0x30')](_0x1f53('0x4f'),_0x12dac3);this[_0x1f53('0x20')]('RINGNOANSWER',_0x12dac3);}}catch(_0x32ab5a){logger[_0x1f53('0x49')](_0x32ab5a[_0x1f53('0x41')]);}};VoiceAgentReport[_0x1f53('0x1f')][_0x1f53('0x13')]=function(_0x1fdad9){try{for(var _0x98329c in this[_0x1f53('0xc')]){var _0x5db7f9=this[_0x1f53('0xc')][_0x98329c];if(!_[_0x1f53('0x2c')](_0x5db7f9)&&_0x5db7f9['channel']==_0x1fdad9[_0x1f53('0x34')]){_0x5db7f9=_[_0x1f53('0x2d')](_0x5db7f9,{'holdtime':parseInt(_0x1fdad9['holdtime'],0xa),'position':parseInt(_0x1fdad9[_0x1f53('0x50')],0xa),'originalposition':parseInt(_0x1fdad9[_0x1f53('0x51')],0xa),'agentringnoanswer':!![],'agentringnoanswerAt':moment()[_0x1f53('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x1f53('0x52'),'lastevent':_0x1f53('0x52')});ami[_0x1f53('0x30')](_0x1f53('0x53'),_0x5db7f9);this[_0x1f53('0x20')]('CALLERABANDON',_0x5db7f9);}}}catch(_0xf2387e){logger[_0x1f53('0x49')](_0xf2387e[_0x1f53('0x41')]);}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x38cb63){try{var _0x4e6e1b=this[_0x1f53('0xc')][_0x38cb63['destchannel']];if(!_[_0x1f53('0x2c')](_0x4e6e1b)){_0x4e6e1b=_['assign'](_0x4e6e1b,{'talktime':parseInt(_0x38cb63[_0x1f53('0x54')],0xa),'reason':_0x38cb63['reason']==_0x1f53('0x55')?_0x1f53('0x3a'):_0x38cb63[_0x1f53('0x56')],'agentcomplete':!![],'lastevent':_0x1f53('0x57'),'agentacw':this[_0x1f53('0xa')][_0x4e6e1b[_0x1f53('0x2e')]]&&this[_0x1f53('0xa')][_0x4e6e1b[_0x1f53('0x2e')]]['acw']?!![]:![],'acwtime':this[_0x1f53('0xa')][_0x4e6e1b[_0x1f53('0x2e')]]&&this[_0x1f53('0xa')][_0x4e6e1b['queue']]['acw']?this[_0x1f53('0xa')][_0x4e6e1b[_0x1f53('0x2e')]]['acwTimeout']:0x0});_0x4e6e1b[_0x1f53('0x58')]=this[_0x1f53('0x45')](_0x4e6e1b[_0x1f53('0x44')],_0x4e6e1b[_0x1f53('0x54')]);this[_0x1f53('0x20')]('COMPLETE',_0x4e6e1b);}}catch(_0x36ea7e){logger[_0x1f53('0x49')](_0x36ea7e[_0x1f53('0x41')]);}};VoiceAgentReport[_0x1f53('0x1f')][_0x1f53('0x59')]=function(_0xa40aed){try{switch(_0xa40aed[_0x1f53('0x5a')]){case 0x1a:_0xa40aed=_['assign'](_0xa40aed,{'agentringnoanswer':!![],'reason':_0x1f53('0x5b'),'lastevent':_0x1f53('0x5b')});var _0x499830=_['find'](this[_0x1f53('0xc')],{'channel':_0xa40aed[_0x1f53('0x34')],'agentconnect':!![]});if(!_[_0x1f53('0x2c')](_0x499830)){_0xa40aed=_[_0x1f53('0x2d')](_0xa40aed,{'agentringnoanswerAt':_0x499830[_0x1f53('0x44')],'answeredelsewheremembername':_0x499830[_0x1f53('0x25')],'answeredelsewheredestinationuniqueid':_0x499830['destuniqueid']});}ami[_0x1f53('0x30')]('custom:agentansweredelsewhere',_0xa40aed);break;}if(_0xa40aed[_0x1f53('0x14')]){ami[_0x1f53('0x30')](_0x1f53('0x5c'),_0xa40aed);io['to'](util['format'](_0x1f53('0x3d'),_0xa40aed[_0x1f53('0x25')]))['emit']('user:agentcomplete',_0xa40aed);}this['log'](_0x1f53('0x5d'),_0xa40aed);ami[_0x1f53('0x30')](_0x1f53('0x5e'),_0xa40aed);if(this['channels'][_0xa40aed['destchannel']]){delete this['channels'][_0xa40aed['destchannel']];}}catch(_0x1ba163){logger[_0x1f53('0x49')](_0x1ba163);}};VoiceAgentReport[_0x1f53('0x1f')][_0x1f53('0x19')]=function(_0x5b3ef0){try{var _0x3b8bf7=this[_0x1f53('0xc')][_0x5b3ef0[_0x1f53('0x34')]];if(!_[_0x1f53('0x2c')](_0x3b8bf7)){_0x3b8bf7=_[_0x1f53('0x2d')](_0x3b8bf7,{'cause':parseInt(_0x5b3ef0[_0x1f53('0x5a')],0xa),'cause-txt':_0x5b3ef0[_0x1f53('0x5f')]});if(_0x3b8bf7[_0x1f53('0x60')]){_0x3b8bf7=_['assign'](_0x3b8bf7,{'agentcomplete':!![],'agentcompleteAt':moment()[_0x1f53('0x22')](_0x1f53('0x2a')),'lastevent':_0x1f53('0x57'),'agentacw':this[_0x1f53('0xa')][_0x3b8bf7[_0x1f53('0x2e')]]&&this['voiceQueues'][_0x3b8bf7['queue']]['acw']?!![]:![],'acwtime':this['voiceQueues'][_0x3b8bf7[_0x1f53('0x2e')]]&&this['voiceQueues'][_0x3b8bf7[_0x1f53('0x2e')]]['acw']?this[_0x1f53('0xa')][_0x3b8bf7[_0x1f53('0x2e')]][_0x1f53('0x61')]:0x0});_0x3b8bf7['talktime']=this[_0x1f53('0x62')](_0x3b8bf7[_0x1f53('0x58')],_0x3b8bf7[_0x1f53('0x44')]);}var _0x2bd760=this[_0x1f53('0xb')][_0x3b8bf7[_0x1f53('0x38')]];if(!_[_0x1f53('0x2c')](_0x2bd760)){_0x2bd760=_[_0x1f53('0x2d')](_0x2bd760,{'queue':null,'destconnectedlinenum':null});io[_0x1f53('0x30')](_0x1f53('0x63'),_0x2bd760);}setTimeout(this[_0x1f53('0x59')][_0x1f53('0x10')](this,_0x3b8bf7),0x3e8);}if(this[_0x1f53('0xd')][_0x5b3ef0[_0x1f53('0x34')]]){delete this[_0x1f53('0xd')][_0x5b3ef0[_0x1f53('0x34')]];}}catch(_0x13b4ad){logger['error'](_0x13b4ad[_0x1f53('0x41')]);}};VoiceAgentReport[_0x1f53('0x1f')][_0x1f53('0x1a')]=function(_0x4eceb9){try{var _0x2b7d1e=this[_0x1f53('0xc')][_0x4eceb9[_0x1f53('0x64')]];if(!_['isNil'](_0x2b7d1e)){_0x2b7d1e=_[_0x1f53('0x2d')](_0x2b7d1e,{'transfer':!![],'transferAt':moment()[_0x1f53('0x22')](_0x1f53('0x2a')),'transfertype':_0x1f53('0x65'),'agentcomplete':!![],'agentcompleteAt':moment()[_0x1f53('0x22')](_0x1f53('0x2a')),'transferuniqueid':_0x4eceb9[_0x1f53('0x66')],'transfercontext':_0x4eceb9['secondtransfererexten'],'transferextension':_0x4eceb9[_0x1f53('0x67')],'reason':_0x1f53('0x55'),'lastevent':_0x1f53('0x57'),'agentacw':this['voiceQueues'][_0x2b7d1e[_0x1f53('0x2e')]]&&this[_0x1f53('0xa')][_0x2b7d1e[_0x1f53('0x2e')]][_0x1f53('0x68')]?!![]:![],'acwtime':this[_0x1f53('0xa')][_0x2b7d1e[_0x1f53('0x2e')]]&&this['voiceQueues'][_0x2b7d1e[_0x1f53('0x2e')]][_0x1f53('0x68')]?this[_0x1f53('0xa')][_0x2b7d1e[_0x1f53('0x2e')]][_0x1f53('0x61')]:0x0});_0x2b7d1e['talktime']=this[_0x1f53('0x62')](_0x2b7d1e[_0x1f53('0x58')],_0x2b7d1e[_0x1f53('0x44')]);this[_0x1f53('0x20')](_0x1f53('0x65'),_0x2b7d1e);}if(!_[_0x1f53('0x2c')](this[_0x1f53('0xc')][_0x4eceb9['transfertargetchannel']])){this[_0x1f53('0xc')][_0x4eceb9[_0x1f53('0x69')]]['recalculate']=!![];}}catch(_0x582713){logger['error'](_0x582713[_0x1f53('0x41')]);}};VoiceAgentReport['prototype'][_0x1f53('0x6a')]=function(_0x164002){try{var _0x31fe81=this[_0x1f53('0xc')][_0x164002[_0x1f53('0x6b')]];if(!_[_0x1f53('0x2c')](_0x31fe81)){_0x31fe81=_['assign'](_0x31fe81,{'transfer':!![],'transferAt':moment()['format'](_0x1f53('0x2a')),'transfertype':_0x1f53('0x6c'),'transferuniqueid':_0x164002['transfereeuniqueid'],'transfercontext':_0x164002[_0x1f53('0x35')],'transferextension':_0x164002[_0x1f53('0x6d')],'agentcomplete':!![],'agentcompleteAt':moment()[_0x1f53('0x22')](_0x1f53('0x2a')),'reason':_0x1f53('0x55'),'lastevent':_0x1f53('0x57'),'agentacw':this['voiceQueues'][_0x31fe81[_0x1f53('0x2e')]]&&this[_0x1f53('0xa')][_0x31fe81[_0x1f53('0x2e')]][_0x1f53('0x68')]?!![]:![],'acwtime':this[_0x1f53('0xa')][_0x31fe81[_0x1f53('0x2e')]]&&this[_0x1f53('0xa')][_0x31fe81[_0x1f53('0x2e')]][_0x1f53('0x68')]?this[_0x1f53('0xa')][_0x31fe81['queue']][_0x1f53('0x61')]:0x0});_0x31fe81[_0x1f53('0x60')]=!![];this['log'](_0x1f53('0x6c'),_0x31fe81);}}catch(_0x522812){logger[_0x1f53('0x49')](_0x522812[_0x1f53('0x41')]);}};VoiceAgentReport['prototype']['syncVarSet']=function(_0x4a7f27){var _0x2a8d05=[_0x1f53('0x6e'),_0x1f53('0x6f'),_0x1f53('0x70'),_0x1f53('0x71'),_0x1f53('0x72'),_0x1f53('0x73'),_0x1f53('0x74'),'rtpaudioqosrttbridged',_0x1f53('0x75'),_0x1f53('0x76'),_0x1f53('0x77'),_0x1f53('0x78'),_0x1f53('0x79'),_0x1f53('0x7a'),_0x1f53('0x7b'),_0x1f53('0x7c'),_0x1f53('0x25'),_0x1f53('0x7d'),_0x1f53('0x7e')];try{var _0x275940=_['keys'](_0x4a7f27['variable'])[0x0];if(!_['isNil'](_0x275940)&&!_[_0x1f53('0x7f')](_0x2a8d05,_0x275940)){if(!this['variables'][_0x4a7f27['channel']]){this[_0x1f53('0xd')][_0x4a7f27['channel']]={};}this['variables'][_0x4a7f27[_0x1f53('0x34')]][_0x275940]=_0x4a7f27[_0x1f53('0x80')];}}catch(_0x20a867){logger[_0x1f53('0x49')](_0x20a867[_0x1f53('0x41')]);}};module[_0x1f53('0x81')]=VoiceAgentReport; \ No newline at end of file +var _0xc753=['defaults','localhost','socket.io-emitter','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','attendedtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','prototype','log','format','%s|%s','uniqueid','membername','exten','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','interface','isNil','assign','queue','calleridnum','emit','user:save','destchannel','calleridname','destcalleridnum','destcalleridname','accountcode','destaccountcode','channel','destuniqueid','context','priority','type','inbound','mandatoryDisposition','agent','called','custom:agentcalled','user:%s','user:called','channels','error','stack','ringtime','connect','agentconnectAt','custom:agentconnect','user:agentconnect','CONNECT','find','onhold','updateStatusRealtime','rejected','agentringnoanswerAt','agentcalledAt','custom:agentringnoanswer','RINGNOANSWER','position','originalposition','abandoned','CALLERABANDON','reason','transfer','complete','acw','acwTimeout','talktime','COMPLETE','cause','answered_elsewhere','custom:agentcomplete','user:agentcomplete','HANGUP','syncHangup','cause-txt','syncAttendedTransfer','ATTENDED','secondtransfereruniqueid','secondtransfererexten','secondtransferercontext','agentcompleteAt','transfertargetchannel','syncBlindTransfer','transfererchannel','transfereeuniqueid','recalculate','BLIND','syncVarSet','rtpaudioqosbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','keys','variable','includes','value','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis'];(function(_0x2ecb67,_0x8ec62d){var _0x168079=function(_0x56c365){while(--_0x56c365){_0x2ecb67['push'](_0x2ecb67['shift']());}};_0x168079(++_0x8ec62d);}(_0xc753,0x189));var _0x3c75=function(_0x35d3c4,_0x349d0e){_0x35d3c4=_0x35d3c4-0x0;var _0x2432cd=_0xc753[_0x35d3c4];return _0x2432cd;};'use strict';var _=require(_0x3c75('0x0'));var moment=require(_0x3c75('0x1'));var util=require(_0x3c75('0x2'));var Redis=require(_0x3c75('0x3'));var config=require(_0x3c75('0x4'));var logger=require(_0x3c75('0x5'))(_0x3c75('0x6'));var ami=require(_0x3c75('0x7'));config[_0x3c75('0x8')]=_[_0x3c75('0x9')](config[_0x3c75('0x8')],{'host':_0x3c75('0xa'),'port':0x18eb});var io=require(_0x3c75('0xb'))(new Redis(config[_0x3c75('0x8')]));function VoiceAgentReport(_0x2313fc){this[_0x3c75('0xc')]=_0x2313fc[_0x3c75('0xc')];this[_0x3c75('0xd')]=_0x2313fc[_0x3c75('0xd')];this['channels']={};this[_0x3c75('0xe')]={};ami['on'](_0x3c75('0xf'),this[_0x3c75('0x10')][_0x3c75('0x11')](this));ami['on'](_0x3c75('0x12'),this[_0x3c75('0x13')][_0x3c75('0x11')](this));ami['on'](_0x3c75('0x14'),this[_0x3c75('0x15')][_0x3c75('0x11')](this));ami['on'](_0x3c75('0x16'),this[_0x3c75('0x17')]['bind'](this));ami['on'](_0x3c75('0x18'),this[_0x3c75('0x19')][_0x3c75('0x11')](this));ami['on'](_0x3c75('0x1a'),this['syncVarSet'][_0x3c75('0x11')](this));ami['on'](_0x3c75('0x1b'),this['syncHangup'][_0x3c75('0x11')](this));ami['on'](_0x3c75('0x1c'),this['syncAttendedTransfer'][_0x3c75('0x11')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));ami['on'](_0x3c75('0x1d'),this[_0x3c75('0x1e')][_0x3c75('0x11')](this));ami['on'](_0x3c75('0x1f'),this[_0x3c75('0x20')][_0x3c75('0x11')](this));}VoiceAgentReport[_0x3c75('0x21')][_0x3c75('0x22')]=function(_0x1fb719,_0x11922a){logger['info'](util[_0x3c75('0x23')](_0x3c75('0x24'),_0x1fb719,[_0x11922a[_0x3c75('0x25')],_0x11922a[_0x3c75('0x26')],_0x11922a['queue'],_0x11922a[_0x3c75('0x27')],_0x11922a['calleridnum']]['join']('|')));};VoiceAgentReport[_0x3c75('0x21')][_0x3c75('0x28')]=function(_0x1f66bb,_0x45871c){return moment(_0x1f66bb)['add'](_0x45871c,_0x3c75('0x29'))[_0x3c75('0x23')](_0x3c75('0x2a'));};VoiceAgentReport[_0x3c75('0x21')][_0x3c75('0x2b')]=function(_0x5d1be7,_0x580d98){return moment(_0x5d1be7)[_0x3c75('0x2c')](moment(_0x580d98),'seconds');};VoiceAgentReport[_0x3c75('0x21')][_0x3c75('0x10')]=function(_0x32c836){try{var _0x74229a=this[_0x3c75('0xd')][_0x32c836[_0x3c75('0x2d')]];if(!_[_0x3c75('0x2e')](_0x74229a)){_0x74229a=_[_0x3c75('0x2f')](_0x74229a,{'queue':_0x32c836[_0x3c75('0x30')],'destconnectedlinenum':_0x32c836[_0x3c75('0x31')]});io[_0x3c75('0x32')](_0x3c75('0x33'),_0x74229a);}var _0x31c615=this['channels'][_0x32c836[_0x3c75('0x34')]]={'agentcalledAt':moment()[_0x3c75('0x23')](_0x3c75('0x2a')),'calleridnum':_0x32c836[_0x3c75('0x31')],'calleridname':_0x32c836[_0x3c75('0x35')],'connectedlinenum':_0x32c836[_0x3c75('0x36')],'connectedlinename':_0x32c836[_0x3c75('0x37')],'accountcode':_0x32c836[_0x3c75('0x38')],'destaccountcode':_0x32c836[_0x3c75('0x39')],'channel':_0x32c836[_0x3c75('0x3a')],'destchannel':_0x32c836[_0x3c75('0x34')],'uniqueid':_0x32c836[_0x3c75('0x25')],'destuniqueid':_0x32c836[_0x3c75('0x3b')],'context':_0x32c836[_0x3c75('0x3c')],'exten':_0x32c836[_0x3c75('0x27')],'priority':_0x32c836[_0x3c75('0x3d')],'queue':_0x32c836[_0x3c75('0x30')],'type':this[_0x3c75('0xc')][_0x32c836[_0x3c75('0x30')]]?this[_0x3c75('0xc')][_0x32c836['queue']][_0x3c75('0x3e')]||'inbound':_0x3c75('0x3f'),'interface':_0x32c836[_0x3c75('0x2d')],'mandatoryDisposition':this[_0x3c75('0xc')][_0x32c836[_0x3c75('0x30')]][_0x3c75('0x40')]||0x0,'membername':_0x32c836[_0x3c75('0x26')],'agentconnect':![],'agentconnectAt':null,'holdtime':0x0,'ringtime':0x0,'agentcomplete':![],'agentcompleteAt':null,'talktime':0x0,'agentringnoanswer':![],'agentringnoanswerAt':null,'reason':_0x3c75('0x41'),'transfer':![],'transferAt':null,'transfertype':null,'transferuniqueid':null,'transfercontext':null,'transferextension':null,'position':null,'originalposition':null,'cause':'','cause-txt':'','UserId':this['agents'][_0x32c836['interface']]?this[_0x3c75('0xd')][_0x32c836[_0x3c75('0x2d')]]['id']:null,'lastevent':_0x3c75('0x42'),'agentacw':![],'acwtime':0x0,'variables':this['variables'][_0x32c836[_0x3c75('0x3a')]]?this[_0x3c75('0xe')][_0x32c836[_0x3c75('0x3a')]]:{}};ami[_0x3c75('0x32')](_0x3c75('0x43'),_0x31c615);io['to'](util[_0x3c75('0x23')](_0x3c75('0x44'),_0x31c615[_0x3c75('0x26')]))['emit'](_0x3c75('0x45'),_0x31c615);this[_0x3c75('0x22')]('CALLED',this[_0x3c75('0x46')][_0x32c836[_0x3c75('0x34')]]);}catch(_0x48de81){logger[_0x3c75('0x47')](_0x48de81[_0x3c75('0x48')]);}};VoiceAgentReport[_0x3c75('0x21')][_0x3c75('0x13')]=function(_0x5af539){try{var _0x4c8a53=this[_0x3c75('0x46')][_0x5af539['destchannel']];if(!_[_0x3c75('0x2e')](_0x4c8a53)){_0x4c8a53=_[_0x3c75('0x2f')](_0x4c8a53,{'holdtime':parseInt(_0x5af539['holdtime'],0xa),'ringtime':parseInt(_0x5af539[_0x3c75('0x49')],0xa),'agentconnect':!![],'lastevent':_0x3c75('0x4a')});_0x4c8a53[_0x3c75('0x4b')]=this[_0x3c75('0x28')](_0x4c8a53['agentcalledAt'],_0x4c8a53[_0x3c75('0x49')]);ami[_0x3c75('0x32')](_0x3c75('0x4c'),_0x4c8a53);io['to'](util['format']('user:%s',_0x4c8a53[_0x3c75('0x26')]))[_0x3c75('0x32')](_0x3c75('0x4d'),_0x4c8a53);this[_0x3c75('0x22')](_0x3c75('0x4e'),_0x4c8a53);}}catch(_0x8e139e){logger[_0x3c75('0x47')](_0x8e139e['stack']);}};VoiceAgentReport[_0x3c75('0x21')][_0x3c75('0x1e')]=function(_0x53e4a5){try{var _0x168553=_[_0x3c75('0x4f')](this['channels'],{'channel':_0x53e4a5[_0x3c75('0x3a')],'agentconnect':!![]});if(!_[_0x3c75('0x2e')](_0x168553)){if(!_[_0x3c75('0x2e')](this[_0x3c75('0xd')][_0x168553[_0x3c75('0x2d')]])){this[_0x3c75('0xd')][_0x168553['interface']][_0x3c75('0x50')]=!![];this[_0x3c75('0xd')][_0x168553[_0x3c75('0x2d')]]['updateStatusRealtime']();}}}catch(_0x4ba4de){logger[_0x3c75('0x47')](_0x4ba4de[_0x3c75('0x48')]);}};VoiceAgentReport[_0x3c75('0x21')]['syncMusicOnHoldStop']=function(_0x1def57){try{var _0x3af58e=_[_0x3c75('0x4f')](this[_0x3c75('0x46')],{'channel':_0x1def57[_0x3c75('0x3a')],'agentconnect':!![]});if(!_['isNil'](_0x3af58e)){if(!_[_0x3c75('0x2e')](this[_0x3c75('0xd')][_0x3af58e['interface']])){this[_0x3c75('0xd')][_0x3af58e[_0x3c75('0x2d')]][_0x3c75('0x50')]=![];this[_0x3c75('0xd')][_0x3af58e[_0x3c75('0x2d')]][_0x3c75('0x51')]();}}}catch(_0x516d30){logger['error'](_0x516d30[_0x3c75('0x48')]);}};VoiceAgentReport[_0x3c75('0x21')][_0x3c75('0x15')]=function(_0x5ee577){try{var _0x362802=this[_0x3c75('0x46')][_0x5ee577[_0x3c75('0x34')]];if(!_['isNil'](_0x362802)){_0x362802=_[_0x3c75('0x2f')](_0x362802,{'ringtime':parseInt(_0x5ee577[_0x3c75('0x49')],0xa)/0x3e8,'agentringnoanswer':!![],'reason':'rejected','lastevent':_0x3c75('0x52')});_0x362802[_0x3c75('0x53')]=this[_0x3c75('0x28')](_0x362802[_0x3c75('0x54')],_0x362802[_0x3c75('0x49')]);ami['emit'](_0x3c75('0x55'),_0x362802);this[_0x3c75('0x22')](_0x3c75('0x56'),_0x362802);}}catch(_0x526cee){logger[_0x3c75('0x47')](_0x526cee[_0x3c75('0x48')]);}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x5d4b3f){try{for(var _0x3f7d93 in this[_0x3c75('0x46')]){var _0x2a0447=this[_0x3c75('0x46')][_0x3f7d93];if(!_[_0x3c75('0x2e')](_0x2a0447)&&_0x2a0447[_0x3c75('0x3a')]==_0x5d4b3f[_0x3c75('0x3a')]){_0x2a0447=_[_0x3c75('0x2f')](_0x2a0447,{'holdtime':parseInt(_0x5d4b3f['holdtime'],0xa),'position':parseInt(_0x5d4b3f[_0x3c75('0x57')],0xa),'originalposition':parseInt(_0x5d4b3f[_0x3c75('0x58')],0xa),'agentringnoanswer':!![],'agentringnoanswerAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x3c75('0x59'),'lastevent':_0x3c75('0x59')});ami[_0x3c75('0x32')]('custom:agentqueuecallerabandon',_0x2a0447);this[_0x3c75('0x22')](_0x3c75('0x5a'),_0x2a0447);}}}catch(_0x2fa203){logger[_0x3c75('0x47')](_0x2fa203[_0x3c75('0x48')]);}};VoiceAgentReport[_0x3c75('0x21')][_0x3c75('0x19')]=function(_0x5aa6b4){try{var _0x333f2c=this['channels'][_0x5aa6b4['destchannel']];if(!_['isNil'](_0x333f2c)){_0x333f2c=_[_0x3c75('0x2f')](_0x333f2c,{'talktime':parseInt(_0x5aa6b4['talktime'],0xa),'reason':_0x5aa6b4[_0x3c75('0x5b')]==_0x3c75('0x5c')?_0x3c75('0x41'):_0x5aa6b4[_0x3c75('0x5b')],'agentcomplete':!![],'lastevent':_0x3c75('0x5d'),'agentacw':this[_0x3c75('0xc')][_0x333f2c[_0x3c75('0x30')]]&&this[_0x3c75('0xc')][_0x333f2c['queue']][_0x3c75('0x5e')]?!![]:![],'acwtime':this[_0x3c75('0xc')][_0x333f2c['queue']]&&this[_0x3c75('0xc')][_0x333f2c[_0x3c75('0x30')]][_0x3c75('0x5e')]?this[_0x3c75('0xc')][_0x333f2c['queue']][_0x3c75('0x5f')]:0x0});_0x333f2c['agentcompleteAt']=this[_0x3c75('0x28')](_0x333f2c[_0x3c75('0x4b')],_0x333f2c[_0x3c75('0x60')]);this[_0x3c75('0x22')](_0x3c75('0x61'),_0x333f2c);}}catch(_0x5e9f14){logger[_0x3c75('0x47')](_0x5e9f14['stack']);}};VoiceAgentReport['prototype']['clear']=function(_0x286f0b){try{switch(_0x286f0b[_0x3c75('0x62')]){case 0x1a:_0x286f0b=_[_0x3c75('0x2f')](_0x286f0b,{'agentringnoanswer':!![],'reason':_0x3c75('0x63'),'lastevent':_0x3c75('0x63')});var _0x2a6d50=_[_0x3c75('0x4f')](this[_0x3c75('0x46')],{'channel':_0x286f0b[_0x3c75('0x3a')],'agentconnect':!![]});if(!_['isNil'](_0x2a6d50)){_0x286f0b=_['assign'](_0x286f0b,{'agentringnoanswerAt':_0x2a6d50[_0x3c75('0x4b')],'answeredelsewheremembername':_0x2a6d50[_0x3c75('0x26')],'answeredelsewheredestinationuniqueid':_0x2a6d50[_0x3c75('0x3b')]});}ami[_0x3c75('0x32')]('custom:agentansweredelsewhere',_0x286f0b);break;}if(_0x286f0b[_0x3c75('0x18')]){ami[_0x3c75('0x32')](_0x3c75('0x64'),_0x286f0b);io['to'](util[_0x3c75('0x23')]('user:%s',_0x286f0b['membername']))[_0x3c75('0x32')](_0x3c75('0x65'),_0x286f0b);}this['log'](_0x3c75('0x66'),_0x286f0b);ami[_0x3c75('0x32')]('custom:voiceAgentReport',_0x286f0b);if(this[_0x3c75('0x46')][_0x286f0b['destchannel']]){delete this[_0x3c75('0x46')][_0x286f0b[_0x3c75('0x34')]];}}catch(_0x515b58){logger[_0x3c75('0x47')](_0x515b58);}};VoiceAgentReport['prototype'][_0x3c75('0x67')]=function(_0x580c94){try{var _0x3375b3=this[_0x3c75('0x46')][_0x580c94[_0x3c75('0x3a')]];if(!_['isNil'](_0x3375b3)){_0x3375b3=_[_0x3c75('0x2f')](_0x3375b3,{'cause':parseInt(_0x580c94[_0x3c75('0x62')],0xa),'cause-txt':_0x580c94[_0x3c75('0x68')]});if(_0x3375b3['recalculate']){_0x3375b3=_[_0x3c75('0x2f')](_0x3375b3,{'agentcomplete':!![],'agentcompleteAt':moment()[_0x3c75('0x23')](_0x3c75('0x2a')),'lastevent':'complete','agentacw':this['voiceQueues'][_0x3375b3[_0x3c75('0x30')]]&&this[_0x3c75('0xc')][_0x3375b3[_0x3c75('0x30')]][_0x3c75('0x5e')]?!![]:![],'acwtime':this[_0x3c75('0xc')][_0x3375b3[_0x3c75('0x30')]]&&this[_0x3c75('0xc')][_0x3375b3['queue']][_0x3c75('0x5e')]?this['voiceQueues'][_0x3375b3['queue']][_0x3c75('0x5f')]:0x0});_0x3375b3[_0x3c75('0x60')]=this[_0x3c75('0x2b')](_0x3375b3['agentcompleteAt'],_0x3375b3[_0x3c75('0x4b')]);}var _0x1a5f00=this[_0x3c75('0xd')][_0x3375b3[_0x3c75('0x2d')]];if(!_[_0x3c75('0x2e')](_0x1a5f00)){_0x1a5f00=_[_0x3c75('0x2f')](_0x1a5f00,{'queue':null,'destconnectedlinenum':null});io[_0x3c75('0x32')](_0x3c75('0x33'),_0x1a5f00);}setTimeout(this['clear']['bind'](this,_0x3375b3),0x3e8);}if(this['variables'][_0x580c94[_0x3c75('0x3a')]]){delete this[_0x3c75('0xe')][_0x580c94[_0x3c75('0x3a')]];}}catch(_0x580a22){logger[_0x3c75('0x47')](_0x580a22[_0x3c75('0x48')]);}};VoiceAgentReport['prototype'][_0x3c75('0x69')]=function(_0x402523){try{var _0x1a0197=this[_0x3c75('0x46')][_0x402523['origtransfererchannel']];if(!_['isNil'](_0x1a0197)){_0x1a0197=_[_0x3c75('0x2f')](_0x1a0197,{'transfer':!![],'transferAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'transfertype':_0x3c75('0x6a'),'agentcomplete':!![],'agentcompleteAt':moment()['format'](_0x3c75('0x2a')),'transferuniqueid':_0x402523[_0x3c75('0x6b')],'transfercontext':_0x402523[_0x3c75('0x6c')],'transferextension':_0x402523[_0x3c75('0x6d')],'reason':_0x3c75('0x5c'),'lastevent':'complete','agentacw':this[_0x3c75('0xc')][_0x1a0197[_0x3c75('0x30')]]&&this['voiceQueues'][_0x1a0197[_0x3c75('0x30')]][_0x3c75('0x5e')]?!![]:![],'acwtime':this['voiceQueues'][_0x1a0197['queue']]&&this[_0x3c75('0xc')][_0x1a0197[_0x3c75('0x30')]][_0x3c75('0x5e')]?this[_0x3c75('0xc')][_0x1a0197[_0x3c75('0x30')]][_0x3c75('0x5f')]:0x0});_0x1a0197['talktime']=this[_0x3c75('0x2b')](_0x1a0197[_0x3c75('0x6e')],_0x1a0197[_0x3c75('0x4b')]);this[_0x3c75('0x22')](_0x3c75('0x6a'),_0x1a0197);}if(!_[_0x3c75('0x2e')](this[_0x3c75('0x46')][_0x402523['transfertargetchannel']])){this[_0x3c75('0x46')][_0x402523[_0x3c75('0x6f')]]['recalculate']=!![];}}catch(_0x5c0427){logger[_0x3c75('0x47')](_0x5c0427[_0x3c75('0x48')]);}};VoiceAgentReport[_0x3c75('0x21')][_0x3c75('0x70')]=function(_0x23828b){try{var _0x3529dc=this['channels'][_0x23828b[_0x3c75('0x71')]];if(!_['isNil'](_0x3529dc)){_0x3529dc=_[_0x3c75('0x2f')](_0x3529dc,{'transfer':!![],'transferAt':moment()[_0x3c75('0x23')](_0x3c75('0x2a')),'transfertype':'BLIND','transferuniqueid':_0x23828b[_0x3c75('0x72')],'transfercontext':_0x23828b[_0x3c75('0x3c')],'transferextension':_0x23828b['extension'],'agentcomplete':!![],'agentcompleteAt':moment()['format'](_0x3c75('0x2a')),'reason':_0x3c75('0x5c'),'lastevent':_0x3c75('0x5d'),'agentacw':this[_0x3c75('0xc')][_0x3529dc['queue']]&&this[_0x3c75('0xc')][_0x3529dc[_0x3c75('0x30')]][_0x3c75('0x5e')]?!![]:![],'acwtime':this['voiceQueues'][_0x3529dc[_0x3c75('0x30')]]&&this[_0x3c75('0xc')][_0x3529dc[_0x3c75('0x30')]]['acw']?this['voiceQueues'][_0x3529dc['queue']][_0x3c75('0x5f')]:0x0});_0x3529dc[_0x3c75('0x73')]=!![];this[_0x3c75('0x22')](_0x3c75('0x74'),_0x3529dc);}}catch(_0x5e2600){logger[_0x3c75('0x47')](_0x5e2600[_0x3c75('0x48')]);}};VoiceAgentReport[_0x3c75('0x21')][_0x3c75('0x75')]=function(_0x166d9d){var _0x516bdc=['rtpaudioqos',_0x3c75('0x76'),'rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0x3c75('0x77'),_0x3c75('0x78'),_0x3c75('0x79'),_0x3c75('0x7a'),'bridgepeer',_0x3c75('0x7b'),_0x3c75('0x7c'),_0x3c75('0x7d'),_0x3c75('0x7e'),_0x3c75('0x7f'),'membername','memberpenalty',_0x3c75('0x80')];try{var _0x24625e=_[_0x3c75('0x81')](_0x166d9d[_0x3c75('0x82')])[0x0];if(!_[_0x3c75('0x2e')](_0x24625e)&&!_[_0x3c75('0x83')](_0x516bdc,_0x24625e)){if(!this[_0x3c75('0xe')][_0x166d9d[_0x3c75('0x3a')]]){this[_0x3c75('0xe')][_0x166d9d['channel']]={};}this[_0x3c75('0xe')][_0x166d9d[_0x3c75('0x3a')]][_0x24625e]=_0x166d9d[_0x3c75('0x84')];}}catch(_0x4de462){logger[_0x3c75('0x47')](_0x4de462[_0x3c75('0x48')]);}};module[_0x3c75('0x85')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index c8b4f84..88e0330 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc591=['xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','originatecalleridnum','destination','calleridpreview','xmcs-queue','sipcalluniqueid','parse','sipcallid','[syncVarSet][VoiceCallReport]','syncHangup','billableseconds','answertime','omit','user:agentcomplete','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfercalleridnum','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','moment','util','path','../../../config/environment','../../../config/logger','ami','../model/channel','unknown','not_inuse','inuse','unavailable','ringing','ringinuse','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','localhost','channels','agents','syncNewExten','newexten','bind','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','log','prototype','isNotNull','isUndefined','uniqueid','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','syncNewChannel','channel','OutgoingSpoolFailed','format','toNumber','channelstate','merge','context','from-sip','split','destconnectedlinenum','exten','emit','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','linkedid','application','toLowerCase','subtract','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','applicationdata','set','cdr(','match','answered','starttime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','destinationchannel','disposition','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','replace','.WAV','monitorFilename','find','monitors','variable','mixmonitor_filename','value','xmd-phone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc591,0x1f0));var _0x1c59=function(_0x4cee17,_0xda2b5){_0x4cee17=_0x4cee17-0x0;var _0x1d3b07=_0xc591[_0x4cee17];return _0x1d3b07;};'use strict';var BPromise=require(_0x1c59('0x0'));var _=require('lodash');var moment=require(_0x1c59('0x1'));var util=require(_0x1c59('0x2'));var path=require(_0x1c59('0x3'));var Redis=require('ioredis');var config=require(_0x1c59('0x4'));var logger=require(_0x1c59('0x5'))(_0x1c59('0x6'));var ami=require('../ami');var Channel=require(_0x1c59('0x7'));var statusDesc=[_0x1c59('0x8'),_0x1c59('0x9'),_0x1c59('0xa'),'busy','invalid',_0x1c59('0xb'),_0x1c59('0xc'),_0x1c59('0xd'),'onhold'];var applications=['set',_0x1c59('0xe'),_0x1c59('0xf'),_0x1c59('0x10'),_0x1c59('0x11'),_0x1c59('0x12')];var dispositions=[_0x1c59('0x13'),_0x1c59('0x14'),_0x1c59('0x14'),_0x1c59('0x13'),_0x1c59('0x13'),_0x1c59('0x13'),_0x1c59('0x15'),'BUSY','FAILED',_0x1c59('0x14'),_0x1c59('0x14')];var actions={};config[_0x1c59('0x16')]=_[_0x1c59('0x17')](config[_0x1c59('0x16')],{'host':_0x1c59('0x18'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x5dcd79){this[_0x1c59('0x19')]=_0x5dcd79[_0x1c59('0x19')];this[_0x1c59('0x1a')]=_0x5dcd79['agents'];ami['on']('coreshowchannel',this[_0x1c59('0x1b')]['bind'](this));ami['on'](_0x1c59('0x1c'),this[_0x1c59('0x1b')][_0x1c59('0x1d')](this));ami['on'](_0x1c59('0x1e'),this['syncNewChannel'][_0x1c59('0x1d')](this));ami['on'](_0x1c59('0x1f'),this[_0x1c59('0x20')][_0x1c59('0x1d')](this));ami['on'](_0x1c59('0x21'),this[_0x1c59('0x22')][_0x1c59('0x1d')](this));ami['on'](_0x1c59('0x23'),this['syncHangup'][_0x1c59('0x1d')](this));ami['on'](_0x1c59('0x24'),this[_0x1c59('0x25')][_0x1c59('0x1d')](this));ami['on'](_0x1c59('0x26'),this['syncAttendedTransfer'][_0x1c59('0x1d')](this));ami['on']('blindtransfer',this[_0x1c59('0x27')][_0x1c59('0x1d')](this));ami['on'](_0x1c59('0x28'),this['syncMusicOnHoldStart'][_0x1c59('0x1d')](this));ami['on'](_0x1c59('0x29'),this[_0x1c59('0x2a')][_0x1c59('0x1d')](this));return BPromise[_0x1c59('0x2b')]()[_0x1c59('0x2c')](ami[_0x1c59('0x2d')]())['catch'](function(_0x35484f){console[_0x1c59('0x2e')](_0x35484f);});}VoiceCallReport[_0x1c59('0x2f')][_0x1c59('0x30')]=function(_0x3ea11d){return _0x3ea11d!==null&&!_[_0x1c59('0x31')](_0x3ea11d);};VoiceCallReport['prototype']['emit']=function(_0x264d32,_0x5145d0,_0x43d714){io['to'](_0x264d32)['emit'](_0x5145d0,_0x43d714);};VoiceCallReport[_0x1c59('0x2f')]['syncNewCallerId']=function(_0x54fdbf){try{if(this[_0x1c59('0x30')](_0x54fdbf)){if(_0x54fdbf[_0x1c59('0x32')]===_0x54fdbf['linkedid']){if(!_[_0x1c59('0x31')](this[_0x1c59('0x19')][_0x54fdbf[_0x1c59('0x32')]])){_['merge'](this['channels'][_0x54fdbf[_0x1c59('0x32')]],_[_0x1c59('0x33')](_0x54fdbf,_[_0x1c59('0x34')](this[_0x1c59('0x19')][_0x54fdbf[_0x1c59('0x32')]])));}}}}catch(_0x2935fd){logger[_0x1c59('0x35')](_0x1c59('0x36'),util[_0x1c59('0x37')](_0x2935fd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c59('0x2f')][_0x1c59('0x38')]=function(_0x531fd9){try{if(this[_0x1c59('0x30')](_0x531fd9)){if(_0x531fd9[_0x1c59('0x32')]===_0x531fd9['linkedid']&&_0x531fd9[_0x1c59('0x39')]!=_0x1c59('0x3a')){if(_[_0x1c59('0x31')](this[_0x1c59('0x19')][_0x531fd9['uniqueid']])){this['channels'][_0x531fd9[_0x1c59('0x32')]]=new Channel();this[_0x1c59('0x19')][_0x531fd9[_0x1c59('0x32')]]['starttime']=moment()[_0x1c59('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1c59('0x19')][_0x531fd9[_0x1c59('0x32')]]['disposition']=dispositions[_[_0x1c59('0x3c')](_0x531fd9[_0x1c59('0x3d')])];_[_0x1c59('0x3e')](this['channels'][_0x531fd9[_0x1c59('0x32')]],_['pick'](_0x531fd9,_[_0x1c59('0x34')](this['channels'][_0x531fd9[_0x1c59('0x32')]])));if(_0x531fd9[_0x1c59('0x3f')]===_0x1c59('0x40')){if(this['agents'][_0x531fd9['channel'][_0x1c59('0x41')]('-')[0x0]]){this['agents'][_0x531fd9[_0x1c59('0x39')]['split']('-')[0x0]][_0x1c59('0x42')]=_0x531fd9[_0x1c59('0x43')];this[_0x1c59('0x44')](util[_0x1c59('0x3b')](_0x1c59('0x45'),this['agents'][_0x531fd9[_0x1c59('0x39')][_0x1c59('0x41')]('-')[0x0]][_0x1c59('0x46')]),_0x1c59('0x47'),{'destaccountcode':this[_0x1c59('0x1a')][_0x531fd9[_0x1c59('0x39')]['split']('-')[0x0]][_0x1c59('0x48')],'destconnectedlinenum':_0x531fd9['exten']});}}}}}}catch(_0xfbe7f0){logger[_0x1c59('0x35')](_0x1c59('0x49'),util[_0x1c59('0x37')](_0xfbe7f0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1c59('0x1b')]=function(_0x5fffe2){try{if(this[_0x1c59('0x30')](_0x5fffe2)){if(_0x5fffe2[_0x1c59('0x32')]===_0x5fffe2[_0x1c59('0x4a')]&&_0x5fffe2[_0x1c59('0x43')]!='h'&&_0x5fffe2[_0x1c59('0x39')]!=_0x1c59('0x3a')){_0x5fffe2[_0x1c59('0x4b')]=_0x5fffe2[_0x1c59('0x4b')][_0x1c59('0x4c')]();_0x5fffe2['applicationdata']=(_0x5fffe2['appdata']||_0x5fffe2['applicationdata'])[_0x1c59('0x4c')]();if(_[_0x1c59('0x31')](this['channels'][_0x5fffe2['uniqueid']])){this['channels'][_0x5fffe2[_0x1c59('0x32')]]=new Channel();this['channels'][_0x5fffe2['uniqueid']]['starttime']=_0x5fffe2['duration']?moment()[_0x1c59('0x4d')](moment[_0x1c59('0x4e')](_0x5fffe2['duration'])[_0x1c59('0x4f')](),_0x1c59('0x4f'))[_0x1c59('0x3b')](_0x1c59('0x50')):moment()[_0x1c59('0x3b')](_0x1c59('0x50'));this[_0x1c59('0x19')][_0x5fffe2[_0x1c59('0x32')]]['disposition']=_0x1c59('0x13');}_['merge'](this[_0x1c59('0x19')][_0x5fffe2[_0x1c59('0x32')]],_['pick'](_0x5fffe2,_['keys'](this[_0x1c59('0x19')][_0x5fffe2[_0x1c59('0x32')]])));if(_[_0x1c59('0x51')](applications,_0x5fffe2[_0x1c59('0x4b')])){this['channels'][_0x5fffe2[_0x1c59('0x32')]][_0x1c59('0x52')]=_0x5fffe2[_0x1c59('0x4b')];this[_0x1c59('0x19')][_0x5fffe2['uniqueid']][_0x1c59('0x53')]=_0x5fffe2[_0x1c59('0x54')];if(_0x5fffe2[_0x1c59('0x4b')]===_0x1c59('0x55')&&_['startsWith'](_0x5fffe2['applicationdata'],_0x1c59('0x56'))){var _0x40fd0e=_0x5fffe2[_0x1c59('0x54')][_0x1c59('0x41')]('=');var _0x427a70=_0x40fd0e[0x0][_0x1c59('0x57')](/cdr\((.*)\)/);if(_0x427a70){this[_0x1c59('0x19')][_0x5fffe2[_0x1c59('0x32')]][_0x427a70[0x1]]=_0x40fd0e[0x1];}}else if(_0x5fffe2['application']===_0x1c59('0xe')){this[_0x1c59('0x19')][_0x5fffe2[_0x1c59('0x32')]]['queue']=_0x5fffe2[_0x1c59('0x54')]['split'](',')[0x0];}}}}}catch(_0x527660){logger['error']('[syncNewExten][VoiceCallReport]',util[_0x1c59('0x37')](_0x527660,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c59('0x2f')][_0x1c59('0x20')]=function(_0x4e1ced){try{if(this[_0x1c59('0x30')](_0x4e1ced)){if(_0x4e1ced[_0x1c59('0x32')]!==_0x4e1ced[_0x1c59('0x4a')]){if(this['channels'][_0x4e1ced[_0x1c59('0x4a')]]){if(_0x4e1ced[_0x1c59('0x3d')]==='6'){if(!this[_0x1c59('0x19')][_0x4e1ced[_0x1c59('0x4a')]]['answered']){var _0x291c91=moment();this[_0x1c59('0x19')][_0x4e1ced[_0x1c59('0x4a')]][_0x1c59('0x58')]=!![];this[_0x1c59('0x19')][_0x4e1ced[_0x1c59('0x4a')]]['answertime']=_0x291c91['format'](_0x1c59('0x50'));if(this[_0x1c59('0x19')][_0x4e1ced['linkedid']][_0x1c59('0x59')]){this[_0x1c59('0x19')][_0x4e1ced[_0x1c59('0x4a')]][_0x1c59('0x5a')]=_0x291c91[_0x1c59('0x5b')](this['channels'][_0x4e1ced[_0x1c59('0x4a')]]['starttime'],'seconds');}}this[_0x1c59('0x19')][_0x4e1ced['linkedid']][_0x1c59('0x4a')]=_0x4e1ced[_0x1c59('0x32')];if(_0x4e1ced[_0x1c59('0x5c')]!==_0x1c59('0x5d')){this[_0x1c59('0x19')][_0x4e1ced[_0x1c59('0x4a')]][_0x1c59('0x5e')]=_0x4e1ced[_0x1c59('0x5c')];}this['channels'][_0x4e1ced[_0x1c59('0x4a')]][_0x1c59('0x5f')]=_0x4e1ced['calleridname'];this[_0x1c59('0x19')][_0x4e1ced[_0x1c59('0x4a')]][_0x1c59('0x60')]=_0x4e1ced[_0x1c59('0x39')];this[_0x1c59('0x19')][_0x4e1ced[_0x1c59('0x4a')]][_0x1c59('0x61')]=dispositions[_['toNumber'](_0x4e1ced[_0x1c59('0x3d')])];if(this[_0x1c59('0x1a')][_0x4e1ced[_0x1c59('0x39')][_0x1c59('0x41')]('-')[0x0]]){this['channels'][_0x4e1ced['linkedid']][_0x1c59('0x62')]=this[_0x1c59('0x1a')][_0x4e1ced[_0x1c59('0x39')]['split']('-')[0x0]]['id'];this[_0x1c59('0x19')][_0x4e1ced[_0x1c59('0x4a')]][_0x1c59('0x63')]=this[_0x1c59('0x1a')][_0x4e1ced[_0x1c59('0x39')][_0x1c59('0x41')]('-')[0x0]][_0x1c59('0x46')];}}}}else{if(this[_0x1c59('0x19')][_0x4e1ced[_0x1c59('0x32')]]){if(_0x4e1ced['channelstate']==='6'){if(this[_0x1c59('0x1a')][_0x4e1ced[_0x1c59('0x39')][_0x1c59('0x41')]('-')[0x0]]){this[_0x1c59('0x19')][_0x4e1ced[_0x1c59('0x32')]]['UserId']=this[_0x1c59('0x1a')][_0x4e1ced[_0x1c59('0x39')][_0x1c59('0x41')]('-')[0x0]]['id'];this['channels'][_0x4e1ced[_0x1c59('0x32')]][_0x1c59('0x63')]=this['agents'][_0x4e1ced[_0x1c59('0x39')][_0x1c59('0x41')]('-')[0x0]]['name'];}}}}}}catch(_0x152fc4){logger[_0x1c59('0x35')](_0x1c59('0x64'),util[_0x1c59('0x37')](_0x152fc4,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1c59('0x65')]=function(_0x50d2a0,_0x360956){if(this[_0x1c59('0x19')][_0x50d2a0]){this[_0x1c59('0x19')][_0x50d2a0][_0x1c59('0x66')]=!![];if(_['endsWith'](_0x360956,'.wav49')){_0x360956=_0x360956[_0x1c59('0x67')]('.wav49',_0x1c59('0x68'));}this['channels'][_0x50d2a0][_0x1c59('0x69')]=_0x360956;var _0x1c9729=_[_0x1c59('0x6a')](this[_0x1c59('0x19')][_0x50d2a0][_0x1c59('0x6b')],{'filename':_0x360956});if(_['isNil'](_0x1c9729)){this[_0x1c59('0x19')][_0x50d2a0][_0x1c59('0x6b')]['push']({'filename':_0x360956,'createdAt':moment()['format'](_0x1c59('0x50')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x1c59('0x2f')]['syncVarSet']=function(_0x41c2b2){try{if(this['isNotNull'](_0x41c2b2)){if(this['channels'][_0x41c2b2['uniqueid']]&&_0x41c2b2['channel']!=_0x1c59('0x3a')){if(this['isNotNull'](_0x41c2b2[_0x1c59('0x6c')])){if(this[_0x1c59('0x30')](_0x41c2b2[_0x1c59('0x6c')][_0x1c59('0x6d')])){this[_0x1c59('0x65')](_0x41c2b2[_0x1c59('0x32')],_0x41c2b2[_0x1c59('0x6e')]);}else if(this[_0x1c59('0x30')](_0x41c2b2[_0x1c59('0x6c')][_0x1c59('0x6f')])){this[_0x1c59('0x19')][_0x41c2b2[_0x1c59('0x32')]]['calleridnum']=_0x41c2b2[_0x1c59('0x6e')];}else if(this['isNotNull'](_0x41c2b2['variable'][_0x1c59('0x70')])){this[_0x1c59('0x19')][_0x41c2b2['uniqueid']][_0x1c59('0x71')]=_0x41c2b2[_0x1c59('0x6e')];}else if(this[_0x1c59('0x30')](_0x41c2b2[_0x1c59('0x6c')][_0x1c59('0x72')])){this[_0x1c59('0x19')][_0x41c2b2['uniqueid']][_0x1c59('0x73')]=_0x41c2b2['value'];}else if(this[_0x1c59('0x30')](_0x41c2b2['variable'][_0x1c59('0x74')])){this[_0x1c59('0x19')][_0x41c2b2['uniqueid']]['queue']=_0x41c2b2[_0x1c59('0x6e')][_0x1c59('0x41')](',')[0x0];}else if(this[_0x1c59('0x30')](_0x41c2b2[_0x1c59('0x6c')]['xmd-originatecalleridnum'])){this['channels'][_0x41c2b2[_0x1c59('0x32')]][_0x1c59('0x75')]=_0x41c2b2['value'];}else if(this['isNotNull'](_0x41c2b2[_0x1c59('0x6c')]['xmd-destination'])){this['channels'][_0x41c2b2[_0x1c59('0x32')]][_0x1c59('0x76')]=_0x41c2b2[_0x1c59('0x6e')];}else if(this['isNotNull'](_0x41c2b2['variable']['xmd-callerid-preview'])){this[_0x1c59('0x19')][_0x41c2b2[_0x1c59('0x32')]][_0x1c59('0x77')]=_0x41c2b2[_0x1c59('0x6e')];}else if(this[_0x1c59('0x30')](_0x41c2b2[_0x1c59('0x6c')][_0x1c59('0x78')])){this[_0x1c59('0x19')][_0x41c2b2[_0x1c59('0x32')]]['queue']=_0x41c2b2[_0x1c59('0x6e')];}else if(this[_0x1c59('0x30')](_0x41c2b2['variable']['sipcallid'])){this[_0x1c59('0x19')][_0x41c2b2[_0x1c59('0x32')]][_0x1c59('0x79')]=_0x41c2b2['value'];}}}else if(this[_0x1c59('0x30')](_0x41c2b2[_0x1c59('0x6c')][_0x1c59('0x6d')])){if(_0x41c2b2[_0x1c59('0x6e')]){var _0x2cdeba=path[_0x1c59('0x7a')](_0x41c2b2['value'])[_0x1c59('0x46')];this[_0x1c59('0x65')](_0x2cdeba,_0x41c2b2[_0x1c59('0x6e')]);}}else if(this['channels'][_0x41c2b2[_0x1c59('0x4a')]]){if(this['isNotNull'](_0x41c2b2[_0x1c59('0x6c')])){if(this[_0x1c59('0x30')](_0x41c2b2[_0x1c59('0x6c')][_0x1c59('0x7b')])){this[_0x1c59('0x19')][_0x41c2b2[_0x1c59('0x4a')]]['sipcalllinkedid']=_0x41c2b2['value'];}}}}}catch(_0x422abb){logger[_0x1c59('0x35')](_0x1c59('0x7c'),util[_0x1c59('0x37')](_0x422abb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c59('0x2f')][_0x1c59('0x7d')]=function(_0x4a1a48){try{if(this[_0x1c59('0x30')](_0x4a1a48)){if(this[_0x1c59('0x19')][_0x4a1a48['uniqueid']]){var _0x2a7658=moment();this[_0x1c59('0x19')][_0x4a1a48[_0x1c59('0x32')]]['endtime']=_0x2a7658[_0x1c59('0x3b')](_0x1c59('0x50'));this[_0x1c59('0x19')][_0x4a1a48[_0x1c59('0x32')]][_0x1c59('0x4e')]=_0x2a7658[_0x1c59('0x5b')](this[_0x1c59('0x19')][_0x4a1a48[_0x1c59('0x32')]][_0x1c59('0x59')],_0x1c59('0x4f'));if(this[_0x1c59('0x19')][_0x4a1a48['uniqueid']][_0x1c59('0x58')]){this['channels'][_0x4a1a48[_0x1c59('0x32')]][_0x1c59('0x7e')]=_0x2a7658[_0x1c59('0x5b')](this[_0x1c59('0x19')][_0x4a1a48['uniqueid']][_0x1c59('0x7f')],_0x1c59('0x4f'));this[_0x1c59('0x19')][_0x4a1a48['uniqueid']][_0x1c59('0x5a')]=this[_0x1c59('0x19')][_0x4a1a48['uniqueid']][_0x1c59('0x4e')]-this[_0x1c59('0x19')][_0x4a1a48[_0x1c59('0x32')]][_0x1c59('0x7e')];}if(_0x4a1a48[_0x1c59('0x3f')]===_0x1c59('0x40')){if(this[_0x1c59('0x1a')][_0x4a1a48['channel'][_0x1c59('0x41')]('-')[0x0]]){this['agents'][_0x4a1a48[_0x1c59('0x39')]['split']('-')[0x0]]=_[_0x1c59('0x80')](this[_0x1c59('0x1a')][_0x4a1a48[_0x1c59('0x39')][_0x1c59('0x41')]('-')[0x0]],[_0x1c59('0x42')]);this[_0x1c59('0x44')](util[_0x1c59('0x3b')]('user:%s',this[_0x1c59('0x1a')][_0x4a1a48[_0x1c59('0x39')][_0x1c59('0x41')]('-')[0x0]][_0x1c59('0x46')]),_0x1c59('0x81'),{'destaccountcode':this[_0x1c59('0x1a')][_0x4a1a48[_0x1c59('0x39')][_0x1c59('0x41')]('-')[0x0]][_0x1c59('0x48')]});}}ami[_0x1c59('0x44')]('custom:voiceCallReport',this[_0x1c59('0x19')][_0x4a1a48['uniqueid']]);delete this[_0x1c59('0x19')][_0x4a1a48[_0x1c59('0x32')]];}}}catch(_0x3fe22e){logger[_0x1c59('0x35')](_0x1c59('0x82'),util[_0x1c59('0x37')](_0x3fe22e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c59('0x2f')][_0x1c59('0x83')]=function(_0x335697){try{if(this['isNotNull'](_0x335697)){if(this['channels'][_0x335697['transfereeuniqueid']]){this[_0x1c59('0x19')][_0x335697[_0x1c59('0x84')]]['transfercalleridnum']=_0x335697[_0x1c59('0x85')];this[_0x1c59('0x19')][_0x335697['transfereeuniqueid']][_0x1c59('0x86')]=_0x335697[_0x1c59('0x87')];if(this[_0x1c59('0x19')][_0x335697[_0x1c59('0x88')]]){var _0x4dc9cd=this['channels'][_0x335697[_0x1c59('0x88')]];this[_0x1c59('0x19')][_0x335697[_0x1c59('0x88')]]=this[_0x1c59('0x19')][_0x335697[_0x1c59('0x84')]];this[_0x1c59('0x19')][_0x335697[_0x1c59('0x84')]]=_0x4dc9cd;}}else if(this['channels'][_0x335697[_0x1c59('0x89')]]){this[_0x1c59('0x19')][_0x335697[_0x1c59('0x89')]]['transfercalleridnum']=_0x335697[_0x1c59('0x85')];this['channels'][_0x335697[_0x1c59('0x89')]][_0x1c59('0x86')]=_0x335697[_0x1c59('0x87')];if(this[_0x1c59('0x19')][_0x335697[_0x1c59('0x8a')]]){var _0x4dc9cd=this[_0x1c59('0x19')][_0x335697['origtransfereruniqueid']];this['channels'][_0x335697['origtransfereruniqueid']]=this[_0x1c59('0x19')][_0x335697[_0x1c59('0x89')]];this[_0x1c59('0x19')][_0x335697['transfertargetuniqueid']]=_0x4dc9cd;}}}}catch(_0x24ba3c){logger['error']('[syncAttendedTransfer][VoiceCallReport]',util[_0x1c59('0x37')](_0x24ba3c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncBlindTransfer']=function(_0x37e19b){try{if(this['isNotNull'](_0x37e19b)){if(this['channels'][_0x37e19b[_0x1c59('0x84')]]){this[_0x1c59('0x19')][_0x37e19b[_0x1c59('0x84')]][_0x1c59('0x8b')]=_0x37e19b[_0x1c59('0x8c')];this['channels'][_0x37e19b[_0x1c59('0x84')]][_0x1c59('0x86')]=_0x37e19b[_0x1c59('0x8d')];this[_0x1c59('0x7d')]({'event':_0x1c59('0x8e'),'uniqueid':_0x37e19b[_0x1c59('0x84')],'context':_0x37e19b['context'],'channel':_0x37e19b[_0x1c59('0x8f')]});}}}catch(_0x1344f2){logger['error'](_0x1c59('0x90'),util[_0x1c59('0x37')](_0x1344f2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1c59('0x2f')]['syncMusicOnHoldStart']=function(_0x67afa7){try{if(this['isNotNull'](_0x67afa7)){if(this[_0x1c59('0x19')][_0x67afa7[_0x1c59('0x32')]]){if(!_[_0x1c59('0x91')](this['channels'][_0x67afa7['uniqueid']][_0x1c59('0x7f')])){this[_0x1c59('0x19')][_0x67afa7[_0x1c59('0x32')]][_0x1c59('0x92')]=moment()[_0x1c59('0x3b')](_0x1c59('0x50'));}}}}catch(_0x903c7d){logger[_0x1c59('0x35')](_0x1c59('0x93'),util[_0x1c59('0x37')](_0x903c7d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1c59('0x2a')]=function(_0x238960){try{if(this[_0x1c59('0x30')](_0x238960)){if(this[_0x1c59('0x19')][_0x238960[_0x1c59('0x32')]]){if(!_[_0x1c59('0x91')](this[_0x1c59('0x19')][_0x238960[_0x1c59('0x32')]][_0x1c59('0x92')])){this[_0x1c59('0x19')][_0x238960['uniqueid']][_0x1c59('0x94')]+=moment()[_0x1c59('0x95')](0x0)[_0x1c59('0x5b')](this[_0x1c59('0x19')][_0x238960[_0x1c59('0x32')]][_0x1c59('0x92')],'seconds');delete this[_0x1c59('0x19')][_0x238960[_0x1c59('0x32')]][_0x1c59('0x92')];}}}}catch(_0x51278d){logger['error'](_0x1c59('0x96'),util[_0x1c59('0x37')](_0x51278d,{'showHidden':![],'depth':null}));}};module[_0x1c59('0x97')]=VoiceCallReport; \ No newline at end of file +var _0xff7c=['exten','user:%s','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','inspect','application','appdata','toLowerCase','duration','subtract','seconds','keys','includes','lastapplication','applicationdata','set','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','syncNewState','answered','diff','connectedlinenum','connectedlinename','calleridname','toNumber','UserId','membername','name','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','.wav49','monitorFilename','find','monitors','push','rec','variable','mixmonitor_filename','value','xmd-phone','calleridnum','xmd-callerid','callerid','xmd-cdrtype','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','billableseconds','holdtime','user:agentcomplete','custom:voiceCallReport','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','isNil','answertime','[syncMusicOnHoldStart][VoiceCallReport]','mohstarttime','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','queue','dial','voicemail','NO\x20ANSWER','FAILED','redis','localhost','socket.io-emitter','channels','agents','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','syncNewCallerId','linkedid','merge','pick','uniqueid','error','[syncNewCallerId][VoiceCallReport]','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','channelstate','context','from-sip','split','destconnectedlinenum'];(function(_0x5d4078,_0x8da411){var _0x49fb8f=function(_0x2686cf){while(--_0x2686cf){_0x5d4078['push'](_0x5d4078['shift']());}};_0x49fb8f(++_0x8da411);}(_0xff7c,0xf0));var _0xcff7=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xff7c[_0x313c96];return _0x522f53;};'use strict';var BPromise=require(_0xcff7('0x0'));var _=require('lodash');var moment=require('moment');var util=require(_0xcff7('0x1'));var path=require(_0xcff7('0x2'));var Redis=require(_0xcff7('0x3'));var config=require(_0xcff7('0x4'));var logger=require(_0xcff7('0x5'))(_0xcff7('0x6'));var ami=require(_0xcff7('0x7'));var Channel=require(_0xcff7('0x8'));var statusDesc=[_0xcff7('0x9'),_0xcff7('0xa'),_0xcff7('0xb'),_0xcff7('0xc'),_0xcff7('0xd'),_0xcff7('0xe'),_0xcff7('0xf'),_0xcff7('0x10'),_0xcff7('0x11')];var applications=['set',_0xcff7('0x12'),'agi',_0xcff7('0x13'),'playback',_0xcff7('0x14')];var dispositions=[_0xcff7('0x15'),_0xcff7('0x16'),'FAILED',_0xcff7('0x15'),_0xcff7('0x15'),'NO\x20ANSWER','ANSWERED','BUSY',_0xcff7('0x16'),_0xcff7('0x16'),'FAILED'];var actions={};config[_0xcff7('0x17')]=_['defaults'](config[_0xcff7('0x17')],{'host':_0xcff7('0x18'),'port':0x18eb});var io=require(_0xcff7('0x19'))(new Redis(config['redis']));function VoiceCallReport(_0x49cade){this[_0xcff7('0x1a')]=_0x49cade[_0xcff7('0x1a')];this[_0xcff7('0x1b')]=_0x49cade[_0xcff7('0x1b')];ami['on']('coreshowchannel',this[_0xcff7('0x1c')]['bind'](this));ami['on'](_0xcff7('0x1d'),this[_0xcff7('0x1c')][_0xcff7('0x1e')](this));ami['on'](_0xcff7('0x1f'),this[_0xcff7('0x20')][_0xcff7('0x1e')](this));ami['on'](_0xcff7('0x21'),this['syncNewState']['bind'](this));ami['on'](_0xcff7('0x22'),this[_0xcff7('0x23')][_0xcff7('0x1e')](this));ami['on'](_0xcff7('0x24'),this[_0xcff7('0x25')][_0xcff7('0x1e')](this));ami['on'](_0xcff7('0x26'),this['syncNewCallerId'][_0xcff7('0x1e')](this));ami['on'](_0xcff7('0x27'),this[_0xcff7('0x28')][_0xcff7('0x1e')](this));ami['on'](_0xcff7('0x29'),this[_0xcff7('0x2a')][_0xcff7('0x1e')](this));ami['on'](_0xcff7('0x2b'),this[_0xcff7('0x2c')]['bind'](this));ami['on'](_0xcff7('0x2d'),this[_0xcff7('0x2e')][_0xcff7('0x1e')](this));return BPromise[_0xcff7('0x2f')]()['then'](ami[_0xcff7('0x30')]())[_0xcff7('0x31')](function(_0x149e05){console[_0xcff7('0x32')](_0x149e05);});}VoiceCallReport[_0xcff7('0x33')][_0xcff7('0x34')]=function(_0x321ce3){return _0x321ce3!==null&&!_[_0xcff7('0x35')](_0x321ce3);};VoiceCallReport[_0xcff7('0x33')][_0xcff7('0x36')]=function(_0x3eb7cf,_0x438565,_0x9659ba){io['to'](_0x3eb7cf)[_0xcff7('0x36')](_0x438565,_0x9659ba);};VoiceCallReport[_0xcff7('0x33')][_0xcff7('0x37')]=function(_0x25b695){try{if(this['isNotNull'](_0x25b695)){if(_0x25b695['uniqueid']===_0x25b695[_0xcff7('0x38')]){if(!_[_0xcff7('0x35')](this['channels'][_0x25b695['uniqueid']])){_[_0xcff7('0x39')](this['channels'][_0x25b695['uniqueid']],_[_0xcff7('0x3a')](_0x25b695,_['keys'](this[_0xcff7('0x1a')][_0x25b695[_0xcff7('0x3b')]])));}}}}catch(_0x1957aa){logger[_0xcff7('0x3c')](_0xcff7('0x3d'),util['inspect'](_0x1957aa,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xcff7('0x20')]=function(_0x572fd0){try{if(this[_0xcff7('0x34')](_0x572fd0)){if(_0x572fd0[_0xcff7('0x3b')]===_0x572fd0[_0xcff7('0x38')]&&_0x572fd0[_0xcff7('0x3e')]!=_0xcff7('0x3f')){if(_[_0xcff7('0x35')](this[_0xcff7('0x1a')][_0x572fd0['uniqueid']])){this[_0xcff7('0x1a')][_0x572fd0[_0xcff7('0x3b')]]=new Channel();this[_0xcff7('0x1a')][_0x572fd0[_0xcff7('0x3b')]][_0xcff7('0x40')]=moment()[_0xcff7('0x41')](_0xcff7('0x42'));this['channels'][_0x572fd0[_0xcff7('0x3b')]]['disposition']=dispositions[_['toNumber'](_0x572fd0[_0xcff7('0x43')])];_[_0xcff7('0x39')](this[_0xcff7('0x1a')][_0x572fd0[_0xcff7('0x3b')]],_[_0xcff7('0x3a')](_0x572fd0,_['keys'](this[_0xcff7('0x1a')][_0x572fd0['uniqueid']])));if(_0x572fd0[_0xcff7('0x44')]===_0xcff7('0x45')){if(this['agents'][_0x572fd0[_0xcff7('0x3e')]['split']('-')[0x0]]){this['agents'][_0x572fd0[_0xcff7('0x3e')][_0xcff7('0x46')]('-')[0x0]][_0xcff7('0x47')]=_0x572fd0[_0xcff7('0x48')];this[_0xcff7('0x36')](util['format'](_0xcff7('0x49'),this[_0xcff7('0x1b')][_0x572fd0[_0xcff7('0x3e')][_0xcff7('0x46')]('-')[0x0]]['name']),_0xcff7('0x4a'),{'destaccountcode':this[_0xcff7('0x1b')][_0x572fd0['channel'][_0xcff7('0x46')]('-')[0x0]][_0xcff7('0x4b')],'destconnectedlinenum':_0x572fd0[_0xcff7('0x48')]});}}}}}}catch(_0x243dce){logger[_0xcff7('0x3c')](_0xcff7('0x4c'),util[_0xcff7('0x4d')](_0x243dce,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xcff7('0x1c')]=function(_0x4ecb34){try{if(this[_0xcff7('0x34')](_0x4ecb34)){if(_0x4ecb34[_0xcff7('0x3b')]===_0x4ecb34[_0xcff7('0x38')]&&_0x4ecb34[_0xcff7('0x48')]!='h'&&_0x4ecb34[_0xcff7('0x3e')]!=_0xcff7('0x3f')){_0x4ecb34[_0xcff7('0x4e')]=_0x4ecb34['application']['toLowerCase']();_0x4ecb34['applicationdata']=(_0x4ecb34[_0xcff7('0x4f')]||_0x4ecb34['applicationdata'])[_0xcff7('0x50')]();if(_[_0xcff7('0x35')](this['channels'][_0x4ecb34[_0xcff7('0x3b')]])){this[_0xcff7('0x1a')][_0x4ecb34[_0xcff7('0x3b')]]=new Channel();this[_0xcff7('0x1a')][_0x4ecb34[_0xcff7('0x3b')]][_0xcff7('0x40')]=_0x4ecb34[_0xcff7('0x51')]?moment()[_0xcff7('0x52')](moment[_0xcff7('0x51')](_0x4ecb34[_0xcff7('0x51')])[_0xcff7('0x53')](),_0xcff7('0x53'))[_0xcff7('0x41')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xcff7('0x41')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcff7('0x1a')][_0x4ecb34[_0xcff7('0x3b')]]['disposition']=_0xcff7('0x15');}_[_0xcff7('0x39')](this[_0xcff7('0x1a')][_0x4ecb34[_0xcff7('0x3b')]],_[_0xcff7('0x3a')](_0x4ecb34,_[_0xcff7('0x54')](this[_0xcff7('0x1a')][_0x4ecb34[_0xcff7('0x3b')]])));if(_[_0xcff7('0x55')](applications,_0x4ecb34['application'])){this[_0xcff7('0x1a')][_0x4ecb34[_0xcff7('0x3b')]][_0xcff7('0x56')]=_0x4ecb34[_0xcff7('0x4e')];this[_0xcff7('0x1a')][_0x4ecb34['uniqueid']]['lastdata']=_0x4ecb34[_0xcff7('0x57')];if(_0x4ecb34[_0xcff7('0x4e')]===_0xcff7('0x58')&&_[_0xcff7('0x59')](_0x4ecb34['applicationdata'],_0xcff7('0x5a'))){var _0xb23e5b=_0x4ecb34[_0xcff7('0x57')]['split']('=');var _0x1f9f80=_0xb23e5b[0x0][_0xcff7('0x5b')](/cdr\((.*)\)/);if(_0x1f9f80){this['channels'][_0x4ecb34[_0xcff7('0x3b')]][_0x1f9f80[0x1]]=_0xb23e5b[0x1];}}else if(_0x4ecb34['application']===_0xcff7('0x12')){this[_0xcff7('0x1a')][_0x4ecb34[_0xcff7('0x3b')]][_0xcff7('0x12')]=_0x4ecb34[_0xcff7('0x57')]['split'](',')[0x0];}}}}}catch(_0x53c475){logger[_0xcff7('0x3c')](_0xcff7('0x5c'),util[_0xcff7('0x4d')](_0x53c475,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcff7('0x33')][_0xcff7('0x5d')]=function(_0x4e124d){try{if(this['isNotNull'](_0x4e124d)){if(_0x4e124d[_0xcff7('0x3b')]!==_0x4e124d[_0xcff7('0x38')]){if(this[_0xcff7('0x1a')][_0x4e124d[_0xcff7('0x38')]]){if(_0x4e124d[_0xcff7('0x43')]==='6'){if(!this[_0xcff7('0x1a')][_0x4e124d[_0xcff7('0x38')]][_0xcff7('0x5e')]){var _0x2a6253=moment();this[_0xcff7('0x1a')][_0x4e124d[_0xcff7('0x38')]][_0xcff7('0x5e')]=!![];this[_0xcff7('0x1a')][_0x4e124d[_0xcff7('0x38')]]['answertime']=_0x2a6253['format']('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x4e124d[_0xcff7('0x38')]][_0xcff7('0x40')]){this[_0xcff7('0x1a')][_0x4e124d['linkedid']]['holdtime']=_0x2a6253[_0xcff7('0x5f')](this[_0xcff7('0x1a')][_0x4e124d[_0xcff7('0x38')]][_0xcff7('0x40')],'seconds');}}this[_0xcff7('0x1a')][_0x4e124d[_0xcff7('0x38')]]['linkedid']=_0x4e124d[_0xcff7('0x3b')];if(_0x4e124d['calleridnum']!=='xcally-motion-preview'){this['channels'][_0x4e124d[_0xcff7('0x38')]][_0xcff7('0x60')]=_0x4e124d['calleridnum'];}this[_0xcff7('0x1a')][_0x4e124d[_0xcff7('0x38')]][_0xcff7('0x61')]=_0x4e124d[_0xcff7('0x62')];this[_0xcff7('0x1a')][_0x4e124d['linkedid']]['destinationchannel']=_0x4e124d[_0xcff7('0x3e')];this['channels'][_0x4e124d[_0xcff7('0x38')]]['disposition']=dispositions[_[_0xcff7('0x63')](_0x4e124d[_0xcff7('0x43')])];if(this['agents'][_0x4e124d[_0xcff7('0x3e')][_0xcff7('0x46')]('-')[0x0]]){this[_0xcff7('0x1a')][_0x4e124d[_0xcff7('0x38')]][_0xcff7('0x64')]=this[_0xcff7('0x1b')][_0x4e124d[_0xcff7('0x3e')][_0xcff7('0x46')]('-')[0x0]]['id'];this[_0xcff7('0x1a')][_0x4e124d[_0xcff7('0x38')]][_0xcff7('0x65')]=this[_0xcff7('0x1b')][_0x4e124d[_0xcff7('0x3e')][_0xcff7('0x46')]('-')[0x0]][_0xcff7('0x66')];}}}}else{if(this[_0xcff7('0x1a')][_0x4e124d['uniqueid']]){if(_0x4e124d[_0xcff7('0x43')]==='6'){if(this[_0xcff7('0x1b')][_0x4e124d[_0xcff7('0x3e')]['split']('-')[0x0]]){this[_0xcff7('0x1a')][_0x4e124d[_0xcff7('0x3b')]][_0xcff7('0x64')]=this[_0xcff7('0x1b')][_0x4e124d[_0xcff7('0x3e')]['split']('-')[0x0]]['id'];this[_0xcff7('0x1a')][_0x4e124d[_0xcff7('0x3b')]][_0xcff7('0x65')]=this[_0xcff7('0x1b')][_0x4e124d[_0xcff7('0x3e')][_0xcff7('0x46')]('-')[0x0]][_0xcff7('0x66')];}}}}}}catch(_0x406f9c){logger[_0xcff7('0x3c')](_0xcff7('0x67'),util['inspect'](_0x406f9c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcff7('0x33')][_0xcff7('0x68')]=function(_0x4d802b,_0x2579ae){if(this['channels'][_0x4d802b]){this[_0xcff7('0x1a')][_0x4d802b][_0xcff7('0x69')]=!![];if(_['endsWith'](_0x2579ae,_0xcff7('0x6a'))){_0x2579ae=_0x2579ae['replace'](_0xcff7('0x6a'),'.WAV');}this[_0xcff7('0x1a')][_0x4d802b][_0xcff7('0x6b')]=_0x2579ae;var _0x5c8de8=_[_0xcff7('0x6c')](this[_0xcff7('0x1a')][_0x4d802b][_0xcff7('0x6d')],{'filename':_0x2579ae});if(_['isNil'](_0x5c8de8)){this[_0xcff7('0x1a')][_0x4d802b]['monitors'][_0xcff7('0x6e')]({'filename':_0x2579ae,'createdAt':moment()[_0xcff7('0x41')](_0xcff7('0x42')),'mixmonitorid':'','status':_0xcff7('0x6f')});}}};VoiceCallReport[_0xcff7('0x33')]['syncVarSet']=function(_0x239640){try{if(this['isNotNull'](_0x239640)){if(this[_0xcff7('0x1a')][_0x239640[_0xcff7('0x3b')]]&&_0x239640['channel']!=_0xcff7('0x3f')){if(this[_0xcff7('0x34')](_0x239640[_0xcff7('0x70')])){if(this['isNotNull'](_0x239640[_0xcff7('0x70')][_0xcff7('0x71')])){this[_0xcff7('0x68')](_0x239640['uniqueid'],_0x239640[_0xcff7('0x72')]);}else if(this[_0xcff7('0x34')](_0x239640[_0xcff7('0x70')][_0xcff7('0x73')])){this[_0xcff7('0x1a')][_0x239640[_0xcff7('0x3b')]][_0xcff7('0x74')]=_0x239640['value'];}else if(this['isNotNull'](_0x239640[_0xcff7('0x70')][_0xcff7('0x75')])){this['channels'][_0x239640[_0xcff7('0x3b')]][_0xcff7('0x76')]=_0x239640['value'];}else if(this['isNotNull'](_0x239640[_0xcff7('0x70')][_0xcff7('0x77')])){this[_0xcff7('0x1a')][_0x239640[_0xcff7('0x3b')]]['type']=_0x239640['value'];}else if(this[_0xcff7('0x34')](_0x239640['variable']['xmd-queue'])){this[_0xcff7('0x1a')][_0x239640[_0xcff7('0x3b')]][_0xcff7('0x12')]=_0x239640['value'][_0xcff7('0x46')](',')[0x0];}else if(this[_0xcff7('0x34')](_0x239640['variable'][_0xcff7('0x78')])){this[_0xcff7('0x1a')][_0x239640[_0xcff7('0x3b')]][_0xcff7('0x79')]=_0x239640[_0xcff7('0x72')];}else if(this[_0xcff7('0x34')](_0x239640[_0xcff7('0x70')][_0xcff7('0x7a')])){this['channels'][_0x239640['uniqueid']][_0xcff7('0x7b')]=_0x239640['value'];}else if(this['isNotNull'](_0x239640['variable'][_0xcff7('0x7c')])){this[_0xcff7('0x1a')][_0x239640[_0xcff7('0x3b')]][_0xcff7('0x7d')]=_0x239640[_0xcff7('0x72')];}else if(this[_0xcff7('0x34')](_0x239640[_0xcff7('0x70')][_0xcff7('0x7e')])){this[_0xcff7('0x1a')][_0x239640[_0xcff7('0x3b')]][_0xcff7('0x12')]=_0x239640[_0xcff7('0x72')];}else if(this['isNotNull'](_0x239640[_0xcff7('0x70')][_0xcff7('0x7f')])){this['channels'][_0x239640['uniqueid']]['sipcalluniqueid']=_0x239640[_0xcff7('0x72')];}}}else if(this[_0xcff7('0x34')](_0x239640['variable']['mixmonitor_filename'])){if(_0x239640[_0xcff7('0x72')]){var _0x2f3e6d=path[_0xcff7('0x80')](_0x239640['value'])['name'];this['syncMixMonitorFilename'](_0x2f3e6d,_0x239640[_0xcff7('0x72')]);}}else if(this[_0xcff7('0x1a')][_0x239640[_0xcff7('0x38')]]){if(this[_0xcff7('0x34')](_0x239640[_0xcff7('0x70')])){if(this[_0xcff7('0x34')](_0x239640[_0xcff7('0x70')][_0xcff7('0x7f')])){this[_0xcff7('0x1a')][_0x239640[_0xcff7('0x38')]][_0xcff7('0x81')]=_0x239640[_0xcff7('0x72')];}}}}}catch(_0x3a9a20){logger['error'](_0xcff7('0x82'),util[_0xcff7('0x4d')](_0x3a9a20,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcff7('0x33')][_0xcff7('0x25')]=function(_0x3f95e8){try{if(this[_0xcff7('0x34')](_0x3f95e8)){if(this[_0xcff7('0x1a')][_0x3f95e8[_0xcff7('0x3b')]]){var _0x3b627c=moment();this[_0xcff7('0x1a')][_0x3f95e8[_0xcff7('0x3b')]]['endtime']=_0x3b627c[_0xcff7('0x41')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3f95e8[_0xcff7('0x3b')]][_0xcff7('0x51')]=_0x3b627c[_0xcff7('0x5f')](this[_0xcff7('0x1a')][_0x3f95e8[_0xcff7('0x3b')]]['starttime'],_0xcff7('0x53'));if(this[_0xcff7('0x1a')][_0x3f95e8[_0xcff7('0x3b')]][_0xcff7('0x5e')]){this['channels'][_0x3f95e8['uniqueid']][_0xcff7('0x83')]=_0x3b627c['diff'](this[_0xcff7('0x1a')][_0x3f95e8[_0xcff7('0x3b')]]['answertime'],_0xcff7('0x53'));this[_0xcff7('0x1a')][_0x3f95e8[_0xcff7('0x3b')]][_0xcff7('0x84')]=this['channels'][_0x3f95e8[_0xcff7('0x3b')]][_0xcff7('0x51')]-this[_0xcff7('0x1a')][_0x3f95e8[_0xcff7('0x3b')]]['billableseconds'];}if(_0x3f95e8[_0xcff7('0x44')]===_0xcff7('0x45')){if(this[_0xcff7('0x1b')][_0x3f95e8['channel'][_0xcff7('0x46')]('-')[0x0]]){this[_0xcff7('0x1b')][_0x3f95e8['channel'][_0xcff7('0x46')]('-')[0x0]]=_['omit'](this[_0xcff7('0x1b')][_0x3f95e8[_0xcff7('0x3e')][_0xcff7('0x46')]('-')[0x0]],[_0xcff7('0x47')]);this[_0xcff7('0x36')](util[_0xcff7('0x41')]('user:%s',this[_0xcff7('0x1b')][_0x3f95e8[_0xcff7('0x3e')][_0xcff7('0x46')]('-')[0x0]]['name']),_0xcff7('0x85'),{'destaccountcode':this[_0xcff7('0x1b')][_0x3f95e8[_0xcff7('0x3e')]['split']('-')[0x0]][_0xcff7('0x4b')]});}}ami['emit'](_0xcff7('0x86'),this[_0xcff7('0x1a')][_0x3f95e8[_0xcff7('0x3b')]]);delete this['channels'][_0x3f95e8[_0xcff7('0x3b')]];}}}catch(_0x1ee781){logger[_0xcff7('0x3c')]('[syncHangup][VoiceCallReport]',util['inspect'](_0x1ee781,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcff7('0x33')][_0xcff7('0x28')]=function(_0x37cdca){try{if(this['isNotNull'](_0x37cdca)){if(this['channels'][_0x37cdca[_0xcff7('0x87')]]){this[_0xcff7('0x1a')][_0x37cdca[_0xcff7('0x87')]][_0xcff7('0x88')]=_0x37cdca[_0xcff7('0x89')];this[_0xcff7('0x1a')][_0x37cdca[_0xcff7('0x87')]]['transferconnectedlinenum']=_0x37cdca[_0xcff7('0x8a')];if(this['channels'][_0x37cdca['secondtransfereruniqueid']]){var _0x38282c=this[_0xcff7('0x1a')][_0x37cdca[_0xcff7('0x8b')]];this[_0xcff7('0x1a')][_0x37cdca['secondtransfereruniqueid']]=this[_0xcff7('0x1a')][_0x37cdca['transfereeuniqueid']];this[_0xcff7('0x1a')][_0x37cdca[_0xcff7('0x87')]]=_0x38282c;}}else if(this[_0xcff7('0x1a')][_0x37cdca['transfertargetuniqueid']]){this[_0xcff7('0x1a')][_0x37cdca[_0xcff7('0x8c')]][_0xcff7('0x88')]=_0x37cdca[_0xcff7('0x89')];this['channels'][_0x37cdca['transfertargetuniqueid']][_0xcff7('0x8d')]=_0x37cdca[_0xcff7('0x8a')];if(this[_0xcff7('0x1a')][_0x37cdca[_0xcff7('0x8e')]]){var _0x38282c=this['channels'][_0x37cdca['origtransfereruniqueid']];this[_0xcff7('0x1a')][_0x37cdca['origtransfereruniqueid']]=this[_0xcff7('0x1a')][_0x37cdca[_0xcff7('0x8c')]];this['channels'][_0x37cdca[_0xcff7('0x8c')]]=_0x38282c;}}}}catch(_0x3c5dca){logger['error'](_0xcff7('0x8f'),util[_0xcff7('0x4d')](_0x3c5dca,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcff7('0x33')][_0xcff7('0x2a')]=function(_0xbfeb5b){try{if(this[_0xcff7('0x34')](_0xbfeb5b)){if(this[_0xcff7('0x1a')][_0xbfeb5b[_0xcff7('0x87')]]){this[_0xcff7('0x1a')][_0xbfeb5b[_0xcff7('0x87')]][_0xcff7('0x88')]=_0xbfeb5b['transfereecalleridnum'];this[_0xcff7('0x1a')][_0xbfeb5b[_0xcff7('0x87')]][_0xcff7('0x8d')]=_0xbfeb5b[_0xcff7('0x90')];this[_0xcff7('0x25')]({'event':_0xcff7('0x91'),'uniqueid':_0xbfeb5b[_0xcff7('0x87')],'context':_0xbfeb5b[_0xcff7('0x44')],'channel':_0xbfeb5b[_0xcff7('0x92')]});}}}catch(_0x5f4db1){logger[_0xcff7('0x3c')](_0xcff7('0x93'),util['inspect'](_0x5f4db1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xcff7('0x2c')]=function(_0x1fd9cc){try{if(this[_0xcff7('0x34')](_0x1fd9cc)){if(this['channels'][_0x1fd9cc[_0xcff7('0x3b')]]){if(!_[_0xcff7('0x94')](this[_0xcff7('0x1a')][_0x1fd9cc['uniqueid']][_0xcff7('0x95')])){this['channels'][_0x1fd9cc[_0xcff7('0x3b')]]['mohstarttime']=moment()[_0xcff7('0x41')](_0xcff7('0x42'));}}}}catch(_0x1e29d4){logger['error'](_0xcff7('0x96'),util[_0xcff7('0x4d')](_0x1e29d4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcff7('0x33')]['syncMusicOnHoldStop']=function(_0x2f7602){try{if(this[_0xcff7('0x34')](_0x2f7602)){if(this[_0xcff7('0x1a')][_0x2f7602[_0xcff7('0x3b')]]){if(!_[_0xcff7('0x94')](this[_0xcff7('0x1a')][_0x2f7602['uniqueid']][_0xcff7('0x97')])){this[_0xcff7('0x1a')][_0x2f7602[_0xcff7('0x3b')]][_0xcff7('0x98')]+=moment()[_0xcff7('0x99')](0x0)['diff'](this[_0xcff7('0x1a')][_0x2f7602[_0xcff7('0x3b')]][_0xcff7('0x97')],'seconds');delete this['channels'][_0x2f7602['uniqueid']]['mohstarttime'];}}}}catch(_0x166dfd){logger[_0xcff7('0x3c')](_0xcff7('0x9a'),util[_0xcff7('0x4d')](_0x166dfd,{'showHidden':![],'depth':null}));}};module[_0xcff7('0x9b')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 6adc41c..84c6665 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8161=['duration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','defaults','socket.io-emitter','redis','outbound','variables','dialbegin','bind','dialend','varset','syncVarSet','hangup','isNotNull','isUndefined','emit','channels','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','voice:outbound','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','syncDialEnd','dialstatus','connectedlinenum','connectedlinename','answertime','format','connect','custom:dialconnect','voice_outbound_channel:save','error','[syncDialEnd][VoiceDialReport]','prototype','keys','variable','value','outboundrouteid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','isNil','includes','syncHangup','endtime','diff','starttime','seconds','complete','total','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration'];(function(_0x58f557,_0x3f5308){var _0x56c339=function(_0x712200){while(--_0x712200){_0x58f557['push'](_0x58f557['shift']());}};_0x56c339(++_0x3f5308);}(_0x8161,0x157));var _0x1816=function(_0x423ecb,_0x38b178){_0x423ecb=_0x423ecb-0x0;var _0x47a24c=_0x8161[_0x423ecb];return _0x47a24c;};'use strict';var _=require('lodash');var moment=require(_0x1816('0x0'));var util=require(_0x1816('0x1'));var Redis=require(_0x1816('0x2'));var config=require(_0x1816('0x3'));var logger=require(_0x1816('0x4'))(_0x1816('0x5'));var ami=require('../ami');config['redis']=_[_0x1816('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1816('0x7'))(new Redis(config[_0x1816('0x8')]));function VoiceDialReport(_0x3e6d4b){this['channels']=_0x3e6d4b['outboundChannels'];this[_0x1816('0x9')]=_0x3e6d4b[_0x1816('0x9')];this[_0x1816('0xa')]={};ami['on'](_0x1816('0xb'),this['syncDialBegin'][_0x1816('0xc')](this));ami['on'](_0x1816('0xd'),this['syncDialEnd'][_0x1816('0xc')](this));ami['on'](_0x1816('0xe'),this[_0x1816('0xf')][_0x1816('0xc')](this));ami['on'](_0x1816('0x10'),this['syncHangup'][_0x1816('0xc')](this));}VoiceDialReport['prototype'][_0x1816('0x11')]=function(_0x3d3176){return _0x3d3176!==null&&!_[_0x1816('0x12')](_0x3d3176);};VoiceDialReport['prototype'][_0x1816('0x13')]=function(_0x3d7430,_0x1a7eb5,_0x29fc59){io['to'](_0x3d7430)[_0x1816('0x13')](_0x1a7eb5,_0x29fc59);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x31c0cb){try{if(this['isNotNull'](_0x31c0cb)){if(this[_0x1816('0x14')][_0x31c0cb[_0x1816('0x15')]]){_[_0x1816('0x16')](this[_0x1816('0x14')][_0x31c0cb['uniqueid']],{'starttime':moment()['format'](_0x1816('0x17')),'lastevent':_0x1816('0x18'),'interface':_0x31c0cb[_0x1816('0x19')]['substring'](0x0,_0x31c0cb[_0x1816('0x19')]['lastIndexOf']('-')),'membername':_0x31c0cb['channel'][_0x1816('0x1a')](_0x31c0cb[_0x1816('0x19')][_0x1816('0x1b')]('/')+0x1,_0x31c0cb[_0x1816('0x19')][_0x1816('0x1b')]('-'))},_[_0x1816('0x1c')](_0x31c0cb,[_0x1816('0x1d'),'privilege']));this['emit'](_0x1816('0x1e'),'voice_outbound_channel:save',this['channels'][_0x31c0cb[_0x1816('0x15')]]);ami[_0x1816('0x13')](_0x1816('0x1f'),this['channels'][_0x31c0cb[_0x1816('0x15')]]);}}}catch(_0x4ba23a){logger['error'](_0x1816('0x20'),util[_0x1816('0x21')](_0x4ba23a,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x1816('0x22')]=function(_0x311388){try{if(this['isNotNull'](_0x311388)){if(this[_0x1816('0x14')][_0x311388[_0x1816('0x15')]]){this[_0x1816('0x14')][_0x311388['uniqueid']]['dialstatus']=_0x311388[_0x1816('0x23')];if(_0x311388['dialstatus']==='ANSWER'){this[_0x1816('0x14')][_0x311388[_0x1816('0x15')]][_0x1816('0x24')]=_0x311388[_0x1816('0x24')];this[_0x1816('0x14')][_0x311388['uniqueid']][_0x1816('0x25')]=_0x311388[_0x1816('0x25')];this['channels'][_0x311388['uniqueid']][_0x1816('0x26')]=moment()[_0x1816('0x27')](_0x1816('0x17'));this[_0x1816('0x14')][_0x311388['uniqueid']]['lastevent']=_0x1816('0x28');ami['emit'](_0x1816('0x29'),this['channels'][_0x311388[_0x1816('0x15')]]);}this[_0x1816('0x13')](_0x1816('0x1e'),_0x1816('0x2a'),this[_0x1816('0x14')][_0x311388[_0x1816('0x15')]]);}}}catch(_0x2146cf){logger[_0x1816('0x2b')](_0x1816('0x2c'),util[_0x1816('0x21')](_0x2146cf,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1816('0x2d')]['syncVarSet']=function(_0x4bd93e){try{if(this['isNotNull'](_0x4bd93e)){this['addVariable'](_0x4bd93e[_0x1816('0x15')],_[_0x1816('0x2e')](_0x4bd93e[_0x1816('0x2f')])[0x0],_0x4bd93e[_0x1816('0x30')]);if(this['isNotNull'](_0x4bd93e['variable'])&&this[_0x1816('0x11')](_0x4bd93e[_0x1816('0x2f')][_0x1816('0x31')])){if(_['isUndefined'](this['channels'][_0x4bd93e[_0x1816('0x15')]])){this[_0x1816('0x14')][_0x4bd93e[_0x1816('0x15')]]={'routeId':_0x4bd93e[_0x1816('0x30')],'variables':this[_0x1816('0xa')][_0x4bd93e[_0x1816('0x15')]]};this[_0x1816('0x13')](_0x1816('0x1e'),_0x1816('0x2a'),this[_0x1816('0x14')][_0x4bd93e[_0x1816('0x15')]]);}}}}catch(_0x2a7361){logger[_0x1816('0x2b')]('[syncVarSet][VoiceDialReport]',util[_0x1816('0x21')](_0x2a7361,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x46ac9c,_0x5b7e05,_0x460fba){var _0x5d4a1e=[_0x1816('0x32'),_0x1816('0x33'),_0x1816('0x34'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x1816('0x35'),_0x1816('0x36'),'rtpaudioqosrttbridged','sipcallid',_0x1816('0x37'),_0x1816('0x38'),_0x1816('0x39'),_0x1816('0x3a'),_0x1816('0x3b'),_0x1816('0x3c'),_0x1816('0x3d'),_0x1816('0x3e'),'memberpenalty','memberrealtime'];if(!_[_0x1816('0x3f')](_0x5b7e05)&&!_[_0x1816('0x40')](_0x5d4a1e,_0x5b7e05)){if(_[_0x1816('0x12')](this[_0x1816('0xa')][_0x46ac9c])){this[_0x1816('0xa')][_0x46ac9c]={};}this[_0x1816('0xa')][_0x46ac9c][_0x5b7e05]=_0x460fba;}};VoiceDialReport[_0x1816('0x2d')][_0x1816('0x41')]=function(_0x51c25c){try{if(this[_0x1816('0x11')](_0x51c25c)){if(this[_0x1816('0x14')][_0x51c25c[_0x1816('0x15')]]){this['channels'][_0x51c25c['uniqueid']]['endtime']=moment()['format'](_0x1816('0x17'));this['channels'][_0x51c25c[_0x1816('0x15')]]['duration']=moment(this[_0x1816('0x14')][_0x51c25c[_0x1816('0x15')]][_0x1816('0x42')])[_0x1816('0x43')](this[_0x1816('0x14')][_0x51c25c[_0x1816('0x15')]][_0x1816('0x44')],_0x1816('0x45'));this['channels'][_0x51c25c[_0x1816('0x15')]]['lastevent']=_0x1816('0x46');this[_0x1816('0x9')][_0x1816('0x47')]+=0x1;if(this[_0x1816('0x14')][_0x51c25c[_0x1816('0x15')]]['answertime']){this['outbound']['answered']+=0x1;this[_0x1816('0x14')][_0x51c25c[_0x1816('0x15')]][_0x1816('0x48')]=moment(this['channels'][_0x51c25c[_0x1816('0x15')]][_0x1816('0x26')])['diff'](this[_0x1816('0x14')][_0x51c25c[_0x1816('0x15')]]['starttime'],_0x1816('0x45'));this[_0x1816('0x14')][_0x51c25c[_0x1816('0x15')]][_0x1816('0x49')]=moment(this['channels'][_0x51c25c[_0x1816('0x15')]]['endtime'])[_0x1816('0x43')](this[_0x1816('0x14')][_0x51c25c[_0x1816('0x15')]]['answertime'],_0x1816('0x45'));this[_0x1816('0x9')][_0x1816('0x4a')]+=this[_0x1816('0x14')][_0x51c25c[_0x1816('0x15')]][_0x1816('0x48')]||0x0;this[_0x1816('0x9')][_0x1816('0x4b')]+=this['channels'][_0x51c25c['uniqueid']][_0x1816('0x49')];}this[_0x1816('0x9')][_0x1816('0x4c')]+=this['channels'][_0x51c25c[_0x1816('0x15')]][_0x1816('0x4d')];ami[_0x1816('0x13')](_0x1816('0x4e'),this['channels'][_0x51c25c[_0x1816('0x15')]]);ami['emit'](_0x1816('0x4f'),this['channels'][_0x51c25c['uniqueid']]);this[_0x1816('0x13')](_0x1816('0x1e'),_0x1816('0x50'),this['outbound']);this['emit'](_0x1816('0x1e'),_0x1816('0x51'),this[_0x1816('0x14')][_0x51c25c[_0x1816('0x15')]]);delete this[_0x1816('0x14')][_0x51c25c[_0x1816('0x15')]];}if(this[_0x1816('0xa')][_0x51c25c[_0x1816('0x15')]]){delete this['variables'][_0x51c25c[_0x1816('0x15')]];}}}catch(_0x8c4bbd){logger[_0x1816('0x2b')](_0x1816('0x52'),util[_0x1816('0x21')](_0x8c4bbd,{'showHidden':![],'depth':null}));}};module[_0x1816('0x53')]=VoiceDialReport; \ No newline at end of file +var _0x3236=['[syncDialEnd][VoiceDialReport]','syncVarSet','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','includes','syncHangup','endtime','diff','starttime','seconds','total','answered','holdtime','billableseconds','sumDuration','custom:voiceDialReport','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','lodash','util','ioredis','../../../config/logger','ami','../ami','redis','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','hangup','prototype','isUndefined','emit','isNotNull','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','substring','lastIndexOf','channel','event','privilege','voice:outbound','voice_outbound_channel:save','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','custom:dialconnect','error'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x3236,0x167));var _0x6323=function(_0x1582a6,_0xed0f80){_0x1582a6=_0x1582a6-0x0;var _0x26d7a3=_0x3236[_0x1582a6];return _0x26d7a3;};'use strict';var _=require(_0x6323('0x0'));var moment=require('moment');var util=require(_0x6323('0x1'));var Redis=require(_0x6323('0x2'));var config=require('../../../config/environment');var logger=require(_0x6323('0x3'))(_0x6323('0x4'));var ami=require(_0x6323('0x5'));config['redis']=_['defaults'](config[_0x6323('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x6323('0x7'))(new Redis(config[_0x6323('0x6')]));function VoiceDialReport(_0x391190){this[_0x6323('0x8')]=_0x391190[_0x6323('0x9')];this[_0x6323('0xa')]=_0x391190[_0x6323('0xa')];this[_0x6323('0xb')]={};ami['on'](_0x6323('0xc'),this[_0x6323('0xd')][_0x6323('0xe')](this));ami['on'](_0x6323('0xf'),this[_0x6323('0x10')]['bind'](this));ami['on'](_0x6323('0x11'),this['syncVarSet'][_0x6323('0xe')](this));ami['on'](_0x6323('0x12'),this['syncHangup'][_0x6323('0xe')](this));}VoiceDialReport[_0x6323('0x13')]['isNotNull']=function(_0x4f914b){return _0x4f914b!==null&&!_[_0x6323('0x14')](_0x4f914b);};VoiceDialReport[_0x6323('0x13')][_0x6323('0x15')]=function(_0x535de1,_0x3939d1,_0x1df658){io['to'](_0x535de1)[_0x6323('0x15')](_0x3939d1,_0x1df658);};VoiceDialReport[_0x6323('0x13')]['syncDialBegin']=function(_0x4c9f70){try{if(this[_0x6323('0x16')](_0x4c9f70)){if(this[_0x6323('0x8')][_0x4c9f70[_0x6323('0x17')]]){_[_0x6323('0x18')](this[_0x6323('0x8')][_0x4c9f70[_0x6323('0x17')]],{'starttime':moment()['format'](_0x6323('0x19')),'lastevent':_0x6323('0x1a'),'interface':_0x4c9f70['channel'][_0x6323('0x1b')](0x0,_0x4c9f70['channel'][_0x6323('0x1c')]('-')),'membername':_0x4c9f70['channel'][_0x6323('0x1b')](_0x4c9f70[_0x6323('0x1d')][_0x6323('0x1c')]('/')+0x1,_0x4c9f70[_0x6323('0x1d')][_0x6323('0x1c')]('-'))},_['omit'](_0x4c9f70,[_0x6323('0x1e'),_0x6323('0x1f')]));this[_0x6323('0x15')](_0x6323('0x20'),_0x6323('0x21'),this['channels'][_0x4c9f70[_0x6323('0x17')]]);ami['emit']('custom:dialbegin',this[_0x6323('0x8')][_0x4c9f70[_0x6323('0x17')]]);}}}catch(_0x177f56){logger['error'](_0x6323('0x22'),util[_0x6323('0x23')](_0x177f56,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6323('0x13')][_0x6323('0x10')]=function(_0x561103){try{if(this[_0x6323('0x16')](_0x561103)){if(this['channels'][_0x561103[_0x6323('0x17')]]){this['channels'][_0x561103[_0x6323('0x17')]][_0x6323('0x24')]=_0x561103[_0x6323('0x24')];if(_0x561103[_0x6323('0x24')]===_0x6323('0x25')){this[_0x6323('0x8')][_0x561103[_0x6323('0x17')]][_0x6323('0x26')]=_0x561103[_0x6323('0x26')];this[_0x6323('0x8')][_0x561103[_0x6323('0x17')]][_0x6323('0x27')]=_0x561103[_0x6323('0x27')];this[_0x6323('0x8')][_0x561103[_0x6323('0x17')]][_0x6323('0x28')]=moment()[_0x6323('0x29')](_0x6323('0x19'));this[_0x6323('0x8')][_0x561103['uniqueid']][_0x6323('0x2a')]=_0x6323('0x2b');ami['emit'](_0x6323('0x2c'),this[_0x6323('0x8')][_0x561103[_0x6323('0x17')]]);}this[_0x6323('0x15')](_0x6323('0x20'),_0x6323('0x21'),this[_0x6323('0x8')][_0x561103[_0x6323('0x17')]]);}}}catch(_0x281fe3){logger[_0x6323('0x2d')](_0x6323('0x2e'),util[_0x6323('0x23')](_0x281fe3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6323('0x13')][_0x6323('0x2f')]=function(_0x58c847){try{if(this[_0x6323('0x16')](_0x58c847)){this['addVariable'](_0x58c847[_0x6323('0x17')],_['keys'](_0x58c847[_0x6323('0x30')])[0x0],_0x58c847[_0x6323('0x31')]);if(this[_0x6323('0x16')](_0x58c847[_0x6323('0x30')])&&this[_0x6323('0x16')](_0x58c847[_0x6323('0x30')][_0x6323('0x32')])){if(_[_0x6323('0x14')](this[_0x6323('0x8')][_0x58c847[_0x6323('0x17')]])){this['channels'][_0x58c847[_0x6323('0x17')]]={'routeId':_0x58c847[_0x6323('0x31')],'variables':this[_0x6323('0xb')][_0x58c847[_0x6323('0x17')]]};this['emit'](_0x6323('0x20'),_0x6323('0x21'),this[_0x6323('0x8')][_0x58c847[_0x6323('0x17')]]);}}}}catch(_0x457303){logger['error'](_0x6323('0x33'),util[_0x6323('0x23')](_0x457303,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6323('0x13')]['addVariable']=function(_0x5801a6,_0x2b386c,_0x12b8de){var _0x46e825=[_0x6323('0x34'),'rtpaudioqosbridged',_0x6323('0x35'),'rtpaudioqosjitterbridged',_0x6323('0x36'),_0x6323('0x37'),_0x6323('0x38'),'rtpaudioqosrttbridged','sipcallid',_0x6323('0x39'),_0x6323('0x3a'),_0x6323('0x3b'),_0x6323('0x3c'),_0x6323('0x3d'),_0x6323('0x3e'),_0x6323('0x3f'),'membername',_0x6323('0x40'),'memberrealtime'];if(!_[_0x6323('0x41')](_0x2b386c)&&!_[_0x6323('0x42')](_0x46e825,_0x2b386c)){if(_['isUndefined'](this['variables'][_0x5801a6])){this[_0x6323('0xb')][_0x5801a6]={};}this[_0x6323('0xb')][_0x5801a6][_0x2b386c]=_0x12b8de;}};VoiceDialReport[_0x6323('0x13')][_0x6323('0x43')]=function(_0x21d6a4){try{if(this[_0x6323('0x16')](_0x21d6a4)){if(this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]]){this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]][_0x6323('0x44')]=moment()[_0x6323('0x29')](_0x6323('0x19'));this['channels'][_0x21d6a4[_0x6323('0x17')]]['duration']=moment(this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]][_0x6323('0x44')])[_0x6323('0x45')](this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]][_0x6323('0x46')],_0x6323('0x47'));this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]]['lastevent']='complete';this[_0x6323('0xa')][_0x6323('0x48')]+=0x1;if(this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]]['answertime']){this[_0x6323('0xa')][_0x6323('0x49')]+=0x1;this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]][_0x6323('0x4a')]=moment(this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]]['answertime'])[_0x6323('0x45')](this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]][_0x6323('0x46')],_0x6323('0x47'));this[_0x6323('0x8')][_0x21d6a4['uniqueid']][_0x6323('0x4b')]=moment(this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]]['endtime'])[_0x6323('0x45')](this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]][_0x6323('0x28')],_0x6323('0x47'));this[_0x6323('0xa')]['sumHoldTime']+=this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]][_0x6323('0x4a')]||0x0;this[_0x6323('0xa')]['sumBillable']+=this['channels'][_0x21d6a4[_0x6323('0x17')]]['billableseconds'];}this[_0x6323('0xa')][_0x6323('0x4c')]+=this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]]['duration'];ami[_0x6323('0x15')](_0x6323('0x4d'),this['channels'][_0x21d6a4[_0x6323('0x17')]]);ami[_0x6323('0x15')]('custom:dialend',this[_0x6323('0x8')][_0x21d6a4['uniqueid']]);this['emit'](_0x6323('0x20'),_0x6323('0x4e'),this[_0x6323('0xa')]);this[_0x6323('0x15')](_0x6323('0x20'),_0x6323('0x4f'),this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]]);delete this[_0x6323('0x8')][_0x21d6a4[_0x6323('0x17')]];}if(this[_0x6323('0xb')][_0x21d6a4['uniqueid']]){delete this[_0x6323('0xb')][_0x21d6a4['uniqueid']];}}}catch(_0x35e8c7){logger[_0x6323('0x2d')](_0x6323('0x50'),util['inspect'](_0x35e8c7,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index fbd4877..c75d193 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b48=['isNotNull','clearZombieChannels','[queues]','loopQueueSummary','then','flagQueueSummary','[queuesummary]','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','inspect','syncQueueSummaryComplete','syncNewExten','syncQueueCallerJoin','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','push','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','syncQueueCallerLeave','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','syncAgentConnect','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','syncAgentComplete','assigned','membername','queuecallerexit','queuecallerexitAt','reason','transfer','COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','add','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','addVariable','keys','variable','value','CONTINUE','queueposition','EXITWITHKEY','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','includes','length','diff','milliseconds','seconds','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','syncBlindTransfer','BLIND','extension','syncHangup','BlindTransfer','context','transfererchannel','syncMusicOnHoldStart','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','[syncMusicOnHoldStop][VoiceQueueReport]','moment','bluebird','md5','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','defaults','redis','socket.io-emitter','prototype','tail','finally','queueReports','agents','channels','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','varset','syncVarSet','hangup','fullybooted','musiconholdstart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','talking','pTalking','unlockRR','switch','isNil','Action','status','catch','No\x20such\x20channel','error','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','voice:queue:%s','name','format','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','Trunk','active','callerid','Interval'];(function(_0x4ed201,_0x56037b){var _0x5c78b3=function(_0x4366cd){while(--_0x4366cd){_0x4ed201['push'](_0x4ed201['shift']());}};_0x5c78b3(++_0x56037b);}(_0x8b48,0x137));var _0x88b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b48[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x88b4('0x0'));var BPromise=require(_0x88b4('0x1'));var util=require('util');var md5=require(_0x88b4('0x2'));var Redis=require('ioredis');var config=require(_0x88b4('0x3'));var logger=require(_0x88b4('0x4'))(_0x88b4('0x5'));var ami=require(_0x88b4('0x6'));var QueueReport=require(_0x88b4('0x7'));config['redis']=_[_0x88b4('0x8')](config[_0x88b4('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x88b4('0xa'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x88b4('0xb')]['enqueue']=function(_0x52e465){this[_0x88b4('0xc')]=this['tail']?this[_0x88b4('0xc')][_0x88b4('0xd')](_0x52e465):_0x52e465();};function VoiceQueueReport(_0x48e643){this['sequence']=new Sequence();this[_0x88b4('0xe')]={};this[_0x88b4('0xf')]=_0x48e643['agents'];this[_0x88b4('0x10')]=_0x48e643[_0x88b4('0x11')];this[_0x88b4('0x12')]=_0x48e643[_0x88b4('0x12')];this['flagQueueSummary']=!![];this['campaigns']=_0x48e643[_0x88b4('0x13')];this[_0x88b4('0x14')]={};ami['on'](_0x88b4('0x15'),this[_0x88b4('0x16')]['bind'](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete'][_0x88b4('0x17')](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin'][_0x88b4('0x17')](this));ami['on'](_0x88b4('0x18'),this[_0x88b4('0x19')][_0x88b4('0x17')](this));ami['on'](_0x88b4('0x1a'),this['syncQueueCallerLeave']['bind'](this));ami['on'](_0x88b4('0x1b'),this['syncAgentComplete']['bind'](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x88b4('0x17')](this));ami['on'](_0x88b4('0x1c'),this[_0x88b4('0x1d')][_0x88b4('0x17')](this));ami['on'](_0x88b4('0x1e'),this['syncHangup']['bind'](this));ami['on'](_0x88b4('0x1f'),this['syncFullyBooted'][_0x88b4('0x17')](this));ami['on'](_0x88b4('0x20'),this['syncMusicOnHoldStart'][_0x88b4('0x17')](this));ami['on']('musiconholdstop',this[_0x88b4('0x21')]['bind'](this));ami['on'](_0x88b4('0x22'),this[_0x88b4('0x23')][_0x88b4('0x17')](this));ami['on'](_0x88b4('0x24'),this['syncBlindTransfer']['bind'](this));this['loopQueueSummary']();this[_0x88b4('0x25')]();}function isNotNull(_0x5576f9){return _0x5576f9!==null&&!_[_0x88b4('0x26')](_0x5576f9);}function clearChannels(_0x41224b){if(!_['isEmpty'](_0x41224b)){for(var _0x59796f in _0x41224b){if(_0x41224b['hasOwnProperty'](_0x59796f)){delete _0x41224b[_0x59796f];}}}}function clearCampaigns(_0x1757f0){if(!_[_0x88b4('0x27')](_0x1757f0)){for(var _0xe1303f in _0x1757f0){if(_0x1757f0[_0x88b4('0x28')](_0xe1303f)){_0x1757f0[_0xe1303f][_0x88b4('0x29')]=0x0;}}}}function clearVoiceQueues(_0x5ee4dc){if(!_[_0x88b4('0x27')](_0x5ee4dc)){for(var _0x2cbc05 in _0x5ee4dc){if(_0x5ee4dc[_0x88b4('0x28')](_0x2cbc05)){_0x5ee4dc[_0x2cbc05]['originated']=0x0;_0x5ee4dc[_0x2cbc05][_0x88b4('0x2a')]=0x0;_0x5ee4dc[_0x2cbc05][_0x88b4('0x2b')]=0x0;_0x5ee4dc[_0x2cbc05]['waiting']=0x0;_0x5ee4dc[_0x2cbc05]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x873751){if(!_[_0x88b4('0x27')](_0x873751)){for(var _0x2a400b in _0x873751){if(_0x873751[_0x88b4('0x28')](_0x2a400b)){_0x873751[_0x2a400b][_0x88b4('0x2c')]=!![];}}}}VoiceQueueReport[_0x88b4('0xb')]['clearZombieChannels']=function(){var _0x1e242e=this;for(var _0x52bf62 in this[_0x88b4('0x10')]){if(this[_0x88b4('0x10')][_0x88b4('0x28')](_0x52bf62)&&!this[_0x88b4('0x10')][_0x52bf62][_0x88b4('0x2d')]){this['sequence']['enqueue'](function(){if(!_[_0x88b4('0x2e')](_0x1e242e[_0x88b4('0x10')][_0x52bf62])){return ami[_0x88b4('0x2f')]({'action':_0x88b4('0x30'),'channel':_0x1e242e[_0x88b4('0x10')][_0x52bf62]['channel']})[_0x88b4('0x31')](function(_0x407396){if(_0x407396['message']===_0x88b4('0x32')){setTimeout(function(){if(_0x1e242e[_0x88b4('0x10')][_0x52bf62]){delete _0x1e242e['channels'][_0x52bf62];logger[_0x88b4('0x33')]('[voiceQueueReport][checkChannel]',_0x52bf62);}if(_0x1e242e['queueReports'][_0x52bf62]){delete _0x1e242e['queueReports'][_0x52bf62];logger['error'](_0x88b4('0x34'),_0x52bf62);}if(_0x1e242e[_0x88b4('0x14')][_0x52bf62]){delete _0x1e242e[_0x88b4('0x14')][_0x52bf62];logger[_0x88b4('0x33')](_0x88b4('0x35'),_0x52bf62);}},0x1f40);}});}});}}};VoiceQueueReport[_0x88b4('0xb')]['syncFullyBooted']=function(){logger[_0x88b4('0x33')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x88b4('0x10')]);this[_0x88b4('0x36')](this['queueReports']);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x88b4('0x12')]);clearCampaigns(this[_0x88b4('0x13')]);};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x36')]=function(_0x4c378a){var _0x3a4aba=this;if(!_[_0x88b4('0x27')](_0x4c378a)){for(var _0x37fa7f in _0x4c378a){if(_0x4c378a[_0x88b4('0x28')](_0x37fa7f)){_0x3a4aba[_0x88b4('0x37')](_0x4c378a[_0x37fa7f]);delete _0x4c378a[_0x37fa7f];}}}};function loggerCatch(_0x15e0d8){return function(_0x274e2b){logger[_0x88b4('0x33')](_0x15e0d8,util['inspect'](_0x274e2b,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x88b4('0xb')]['emit']=function(_0x35a6d8,_0x8617bd,_0x33723a){io['to'](_0x35a6d8)[_0x88b4('0x38')](_0x8617bd,_0x33723a);};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x39')]=function(_0x3c41dd){this[_0x88b4('0x38')](util['format'](_0x88b4('0x3a'),_0x3c41dd[_0x88b4('0x3b')]),'voice_queue_channel:save',_0x3c41dd);};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x37')]=function(_0x8d4642){this[_0x88b4('0x38')](util[_0x88b4('0x3c')]('voice:queue:%s',_0x8d4642['name']),_0x88b4('0x3d'),_0x8d4642);};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x3e')]=function(_0x58e1c5){if(_0x58e1c5[_0x88b4('0x3f')]===_0x88b4('0x40')){var _0x1793bb={'id':_0x58e1c5['id'],'name':_0x58e1c5['name'],'strategy':_0x58e1c5['strategy'],'answered':_0x58e1c5[_0x88b4('0x41')],'available':_0x58e1c5[_0x88b4('0x42')],'loggedIn':_0x58e1c5[_0x88b4('0x43')],'pTalking':_0x58e1c5[_0x88b4('0x2b')],'sumBillable':_0x58e1c5[_0x88b4('0x44')],'sumDuration':_0x58e1c5[_0x88b4('0x45')],'sumHoldTime':_0x58e1c5[_0x88b4('0x46')]||0x0,'talking':_0x58e1c5['talking'],'total':_0x58e1c5[_0x88b4('0x47')],'type':_0x58e1c5[_0x88b4('0x3f')],'unmanaged':_0x58e1c5[_0x88b4('0x48')],'abandoned':_0x58e1c5[_0x88b4('0x49')],'waiting':_0x58e1c5[_0x88b4('0x4a')]};if(_0x58e1c5[_0x88b4('0x4b')]){_0x1793bb[_0x88b4('0x4b')]={'id':_0x58e1c5[_0x88b4('0x4b')]['id'],'name':_0x58e1c5[_0x88b4('0x4b')][_0x88b4('0x3b')],'active':_0x58e1c5['Trunk'][_0x88b4('0x4c')],'callerid':_0x58e1c5[_0x88b4('0x4b')][_0x88b4('0x4d')]};}if(_0x58e1c5[_0x88b4('0x4e')]){_0x1793bb[_0x88b4('0x4e')]={'id':_0x58e1c5[_0x88b4('0x4e')]['id'],'name':_0x58e1c5[_0x88b4('0x4e')][_0x88b4('0x3b')]};}var _0x59695b=md5(JSON['stringify'](_0x1793bb));if(_0x58e1c5['md5']!==_0x59695b){_0x58e1c5[_0x88b4('0x2')]=_0x59695b;this['emit'](util['format'](_0x88b4('0x3a'),_0x1793bb[_0x88b4('0x3b')]),'voice_queue:save',_0x1793bb);}}};VoiceQueueReport['prototype'][_0x88b4('0x4f')]=function(_0x28bf4c){return _0x28bf4c!==null&&!_['isUndefined'](_0x28bf4c);};VoiceQueueReport['prototype']['loopQueueShow']=function(){var _0x19e69a=this;setInterval(function(){_0x19e69a[_0x88b4('0x50')]();ami[_0x88b4('0x2f')]({'action':'queues'})[_0x88b4('0x31')](loggerCatch(_0x88b4('0x51')));},0x2710);};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x52')]=function(){var _0x50ae7f=this;setInterval(function(){if(_0x50ae7f['flagQueueSummary']){return ami[_0x88b4('0x2f')]({'action':_0x88b4('0x15')})[_0x88b4('0x53')](function(_0x5a287b){_0x50ae7f[_0x88b4('0x54')]=![];})[_0x88b4('0x31')](loggerCatch(_0x88b4('0x55')));}},0x3e8);};VoiceQueueReport['prototype'][_0x88b4('0x16')]=function(_0x16a239){try{if(this['isNotNull'](_0x16a239)&&this['isNotNull'](_0x16a239[_0x88b4('0x56')])){if(this['voiceQueues'][_0x16a239['queue']]){var _0x373111=_[_0x88b4('0x57')](this[_0x88b4('0x10')],_0x88b4('0x56'))[_0x16a239['queue']]||0x0;var _0x330aa0=_0x373111-_0x16a239[_0x88b4('0x58')];if(this['voiceQueues'][_0x16a239[_0x88b4('0x56')]]['waiting']!==_['toNumber'](_0x16a239[_0x88b4('0x58')])||this['voiceQueues'][_0x16a239['queue']][_0x88b4('0x43')]!==_[_0x88b4('0x59')](_0x16a239[_0x88b4('0x5a')])||this[_0x88b4('0x12')][_0x16a239[_0x88b4('0x56')]]['available']!==_['toNumber'](_0x16a239[_0x88b4('0x42')])||this['voiceQueues'][_0x16a239['queue']]['talking']!==_0x330aa0){this[_0x88b4('0x12')][_0x16a239[_0x88b4('0x56')]][_0x88b4('0x4a')]=_[_0x88b4('0x59')](_0x16a239[_0x88b4('0x58')]);this[_0x88b4('0x12')][_0x16a239[_0x88b4('0x56')]][_0x88b4('0x43')]=_[_0x88b4('0x59')](_0x16a239[_0x88b4('0x5a')]);this[_0x88b4('0x12')][_0x16a239['queue']][_0x88b4('0x42')]=_['toNumber'](_0x16a239['available']);this['voiceQueues'][_0x16a239['queue']][_0x88b4('0x2a')]=_0x330aa0>0x0?_0x330aa0:0x0;this[_0x88b4('0x12')][_0x16a239[_0x88b4('0x56')]][_0x88b4('0x2a')]=this['voiceQueues'][_0x16a239[_0x88b4('0x56')]][_0x88b4('0x2a')]>_['toNumber'](_0x16a239[_0x88b4('0x5a')])?_[_0x88b4('0x59')](_0x16a239['loggedin']):this[_0x88b4('0x12')][_0x16a239[_0x88b4('0x56')]][_0x88b4('0x2a')];this['emitVoiceQueueSummary'](this[_0x88b4('0x12')][_0x16a239[_0x88b4('0x56')]]);}ami[_0x88b4('0x38')](_0x88b4('0x5b'),this[_0x88b4('0x12')][_0x16a239['queue']]);}}}catch(_0x477dc4){logger[_0x88b4('0x33')](_0x88b4('0x5c'),util[_0x88b4('0x5d')](_0x477dc4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x5e')]=function(_0x179a7b){this[_0x88b4('0x54')]=!![];};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x5f')]=function(_0xd8bd9a){};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x60')]=function(_0x42a7c4){try{if(this[_0x88b4('0x4f')](_0x42a7c4)){if(_[_0x88b4('0x26')](this[_0x88b4('0xe')][_0x42a7c4[_0x88b4('0x61')]])){this[_0x88b4('0xe')][_0x42a7c4[_0x88b4('0x61')]]=[];this['channels'][_0x42a7c4[_0x88b4('0x61')]]={};}var _0x484c7d=new QueueReport();_0x484c7d['name']=_0x42a7c4[_0x88b4('0x56')];_0x484c7d[_0x88b4('0x3f')]=this[_0x88b4('0x12')][_0x484c7d[_0x88b4('0x3b')]]&&this['voiceQueues'][_0x484c7d['name']][_0x88b4('0x3f')]?this['voiceQueues'][_0x484c7d[_0x88b4('0x3b')]][_0x88b4('0x3f')]||_0x88b4('0x40'):_0x88b4('0x40');_0x484c7d[_0x88b4('0x56')]=_0x42a7c4[_0x88b4('0x56')];_0x484c7d[_0x88b4('0x62')]=moment()[_0x88b4('0x3c')](_0x88b4('0x63'));_0x484c7d[_0x88b4('0x64')]=_0x42a7c4[_0x88b4('0x64')];_0x484c7d[_0x88b4('0x65')]=_0x42a7c4['count'];_[_0x88b4('0x66')](_0x484c7d,_[_0x88b4('0x67')](_0x42a7c4,_['keys'](_0x484c7d)));this['queueReports'][_0x42a7c4[_0x88b4('0x61')]][_0x88b4('0x68')](_0x484c7d);this['channels'][_0x42a7c4[_0x88b4('0x61')]]=_0x484c7d;this[_0x88b4('0x39')](_0x484c7d);}}catch(_0x91ce91){logger[_0x88b4('0x33')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0x88b4('0x5d')](_0x91ce91,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x88b4('0x19')]=function(_0x5a1b8e){try{if(this['isNotNull'](_0x5a1b8e)){if(this['queueReports'][_0x5a1b8e[_0x88b4('0x61')]]){var _0x17bd99=_['last'](this[_0x88b4('0xe')][_0x5a1b8e['uniqueid']]);_0x17bd99[_0x88b4('0x69')]=![];_0x17bd99[_0x88b4('0x6a')]=null;_0x17bd99[_0x88b4('0x6b')]=_0x5a1b8e['holdtime'];_0x17bd99[_0x88b4('0x6c')]=_0x5a1b8e[_0x88b4('0x6c')];_0x17bd99[_0x88b4('0x18')]=!![];_0x17bd99[_0x88b4('0x6d')]=moment()[_0x88b4('0x3c')](_0x88b4('0x63'));_0x17bd99[_0x88b4('0x6e')]=_0x88b4('0x6f');_0x17bd99[_0x88b4('0x70')]=null;this[_0x88b4('0x10')][_0x5a1b8e['uniqueid']]=_0x17bd99;this[_0x88b4('0x37')](_0x17bd99);}}}catch(_0x19a9cb){logger[_0x88b4('0x33')](_0x88b4('0x71'),util[_0x88b4('0x5d')](_0x19a9cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x72')]=function(_0x345e78){try{if(this[_0x88b4('0x4f')](_0x345e78)){if(this['queueReports'][_0x345e78[_0x88b4('0x61')]]){var _0x1dfd57=_[_0x88b4('0x73')](this['queueReports'][_0x345e78['uniqueid']]);_0x1dfd57[_0x88b4('0x74')]=moment()[_0x88b4('0x3c')](_0x88b4('0x63'));_0x1dfd57['connectedlinenum']=_0x345e78[_0x88b4('0x75')];_0x1dfd57[_0x88b4('0x76')]=_0x345e78[_0x88b4('0x76')];this['channels'][_0x345e78[_0x88b4('0x61')]]=_0x1dfd57;this[_0x88b4('0x39')](_0x1dfd57);}}}catch(_0x1f8265){logger['error'](_0x88b4('0x77'),util['inspect'](_0x1f8265,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x78')]=function(_0x31f529){try{if(this[_0x88b4('0x4f')](_0x31f529)){if(this[_0x88b4('0xe')][_0x31f529[_0x88b4('0x61')]]){var _0x31f6ef=_[_0x88b4('0x73')](this[_0x88b4('0xe')][_0x31f529['uniqueid']]);_0x31f6ef[_0x88b4('0x69')]=!![];_0x31f6ef[_0x88b4('0x6e')]=_0x88b4('0x79');}}}catch(_0x344401){logger['error'](_0x88b4('0x7a'),util[_0x88b4('0x5d')](_0x344401,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x7b')]=function(_0x20c32b){try{if(this[_0x88b4('0x4f')](_0x20c32b)){if(this[_0x88b4('0xe')][_0x20c32b[_0x88b4('0x61')]]){var _0x3ff242=_[_0x88b4('0x73')](this[_0x88b4('0xe')][_0x20c32b[_0x88b4('0x61')]]);_0x3ff242[_0x88b4('0x18')]=![];_0x3ff242[_0x88b4('0x6d')]=null;_0x3ff242[_0x88b4('0x7c')]=!![];_0x3ff242['lastAssignedTo']=_0x20c32b[_0x88b4('0x7d')];_0x3ff242['holdtime']=_0x20c32b[_0x88b4('0x6b')];_0x3ff242[_0x88b4('0x69')]=!![];_0x3ff242[_0x88b4('0x7e')]=![];_0x3ff242[_0x88b4('0x7f')]=null;if(!_0x3ff242['transfer']){if(_0x20c32b[_0x88b4('0x80')]==_0x88b4('0x81')){_0x3ff242['queuecallerexitreason']=_0x88b4('0x82');}else{if(_[_0x88b4('0x83')](_0x20c32b[_0x88b4('0x84')][_0x88b4('0x85')](),_0x88b4('0x86'))){if(this[_0x88b4('0xe')][_0x20c32b[_0x88b4('0x87')]]){var _0x428d93=_[_0x88b4('0x73')](this[_0x88b4('0xe')][_0x20c32b[_0x88b4('0x87')]]);_0x428d93[_0x88b4('0x69')]=![];_0x428d93[_0x88b4('0x7e')]=!![];_0x428d93[_0x88b4('0x7f')]=moment(_0x3ff242[_0x88b4('0x62')])[_0x88b4('0x88')](_0x20c32b[_0x88b4('0x6b')],'seconds')[_0x88b4('0x3c')](_0x88b4('0x63'));_0x428d93[_0x88b4('0x6e')]=_0x88b4('0x89');_0x428d93[_0x88b4('0x81')]=!![];_0x428d93[_0x88b4('0x8a')]='FORWARD';_0x428d93[_0x88b4('0x8b')]=_0x20c32b[_0x88b4('0x8c')];_0x428d93[_0x88b4('0x8d')]=_0x20c32b[_0x88b4('0x61')];var _0x3f997c=this[_0x88b4('0xe')][_0x20c32b[_0x88b4('0x87')]];this[_0x88b4('0xe')][_0x20c32b[_0x88b4('0x87')]]=this[_0x88b4('0xe')][_0x20c32b['uniqueid']];this[_0x88b4('0xe')][_0x20c32b[_0x88b4('0x61')]]=_0x3f997c;}}else{_0x3ff242[_0x88b4('0x6e')]=_0x88b4('0x8e')+_0x20c32b['reason'][_0x88b4('0x8f')]();}}}this['channels'][_0x20c32b[_0x88b4('0x61')]]=_0x3ff242;this[_0x88b4('0x37')](_0x3ff242);}}}catch(_0x4f6bc3){logger[_0x88b4('0x33')]('[syncAgentComplete][VoiceQueueReport]',util[_0x88b4('0x5d')](_0x4f6bc3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x1d')]=function(_0x20851d){try{if(this[_0x88b4('0x4f')](_0x20851d)){this[_0x88b4('0x90')](_0x20851d[_0x88b4('0x61')],_[_0x88b4('0x91')](_0x20851d['variable'])[0x0],_0x20851d['value']);if(this['queueReports'][_0x20851d[_0x88b4('0x61')]]){var _0x36c122=_['last'](this['queueReports'][_0x20851d[_0x88b4('0x61')]]);if(_0x36c122){if(this[_0x88b4('0x4f')](_0x20851d[_0x88b4('0x92')])&&this['isNotNull'](_0x20851d['variable']['queuestatus'])){switch(_0x20851d[_0x88b4('0x93')]){case _0x88b4('0x94'):_0x36c122[_0x88b4('0x7e')]=![];_0x36c122['queuecallerexitAt']=null;break;default:_0x36c122[_0x88b4('0x7e')]=!![];_0x36c122[_0x88b4('0x7f')]=moment()[_0x88b4('0x3c')](_0x88b4('0x63'));_0x36c122[_0x88b4('0x74')]=moment()[_0x88b4('0x3c')](_0x88b4('0x63'));}_0x36c122[_0x88b4('0x18')]=![];_0x36c122[_0x88b4('0x6d')]=null;_0x36c122['queuecallerexitreason']=_0x20851d[_0x88b4('0x93')];this[_0x88b4('0x10')][_0x20851d[_0x88b4('0x61')]]=_0x36c122;this[_0x88b4('0x37')](_0x36c122);}else if(this[_0x88b4('0x4f')](_0x20851d[_0x88b4('0x92')])&&this['isNotNull'](_0x20851d[_0x88b4('0x92')][_0x88b4('0x95')])){if(!_0x36c122[_0x88b4('0x18')]){_0x36c122['queuecallerexit']=!![];_0x36c122[_0x88b4('0x7f')]=moment()[_0x88b4('0x3c')](_0x88b4('0x63'));_0x36c122[_0x88b4('0x6e')]=_0x88b4('0x96');_0x36c122['queuecallerleaveAt']=moment()[_0x88b4('0x3c')](_0x88b4('0x63'));this[_0x88b4('0x10')][_0x20851d[_0x88b4('0x61')]]=_0x36c122;}}_0x36c122['variables']=this[_0x88b4('0x14')][_0x20851d[_0x88b4('0x61')]];}}}}catch(_0x234e30){logger[_0x88b4('0x33')]('[syncVarSet][VoiceQueueReport]',util[_0x88b4('0x5d')](_0x234e30,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x88b4('0xb')][_0x88b4('0x90')]=function(_0x43e31f,_0x556714,_0x5d87c3){var _0x4372c5=[_0x88b4('0x97'),'rtpaudioqosbridged',_0x88b4('0x98'),_0x88b4('0x99'),'rtpaudioqosloss',_0x88b4('0x9a'),_0x88b4('0x9b'),_0x88b4('0x9c'),_0x88b4('0x9d'),'sipuri',_0x88b4('0x9e'),_0x88b4('0x9f'),_0x88b4('0xa0'),_0x88b4('0xa1'),'memberinterface',_0x88b4('0xa2'),_0x88b4('0x7d'),_0x88b4('0xa3'),_0x88b4('0xa4')];if(!_[_0x88b4('0x2e')](_0x556714)&&!_[_0x88b4('0xa5')](_0x4372c5,_0x556714)){if(_[_0x88b4('0x26')](this[_0x88b4('0x14')][_0x43e31f])){this['variables'][_0x43e31f]={};}this['variables'][_0x43e31f][_0x556714]=_0x5d87c3;}};VoiceQueueReport[_0x88b4('0xb')]['syncHangup']=function(_0x9592e){try{if(this['isNotNull'](_0x9592e)){if(this[_0x88b4('0xe')][_0x9592e[_0x88b4('0x61')]]){for(var _0x112aff=0x0,_0x2e4d1c={};_0x112aff0x0?_0xc0b4db:0x0;this[_0x33da('0x14')][_0x5cacb3[_0x33da('0x5c')]]['talking']=this[_0x33da('0x14')][_0x5cacb3['queue']][_0x33da('0x32')]>_['toNumber'](_0x5cacb3[_0x33da('0x60')])?_['toNumber'](_0x5cacb3[_0x33da('0x60')]):this['voiceQueues'][_0x5cacb3['queue']][_0x33da('0x32')];this[_0x33da('0x49')](this[_0x33da('0x14')][_0x5cacb3[_0x33da('0x5c')]]);}ami[_0x33da('0x43')](_0x33da('0x61'),this[_0x33da('0x14')][_0x5cacb3[_0x33da('0x5c')]]);}}}catch(_0x2c0369){logger[_0x33da('0x41')](_0x33da('0x62'),util['inspect'](_0x2c0369,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x12ddb3){this[_0x33da('0x15')]=!![];};VoiceQueueReport['prototype'][_0x33da('0x63')]=function(_0x2571c8){};VoiceQueueReport[_0x33da('0xc')]['syncQueueCallerJoin']=function(_0x5cb9b9){try{if(this[_0x33da('0x58')](_0x5cb9b9)){if(_[_0x33da('0x2e')](this[_0x33da('0x11')][_0x5cb9b9['uniqueid']])){this[_0x33da('0x11')][_0x5cb9b9[_0x33da('0x64')]]=[];this[_0x33da('0x13')][_0x5cb9b9[_0x33da('0x64')]]={};}var _0xef8aa=new QueueReport();_0xef8aa[_0x33da('0x47')]=_0x5cb9b9['queue'];_0xef8aa[_0x33da('0x65')]=this[_0x33da('0x14')][_0xef8aa['name']]&&this[_0x33da('0x14')][_0xef8aa['name']][_0x33da('0x65')]?this[_0x33da('0x14')][_0xef8aa[_0x33da('0x47')]][_0x33da('0x65')]||'inbound':_0x33da('0x4a');_0xef8aa[_0x33da('0x5c')]=_0x5cb9b9[_0x33da('0x5c')];_0xef8aa[_0x33da('0x66')]=moment()['format'](_0x33da('0x67'));_0xef8aa['position']=_0x5cb9b9[_0x33da('0x68')];_0xef8aa[_0x33da('0x69')]=_0x5cb9b9['count'];_['merge'](_0xef8aa,_['pick'](_0x5cb9b9,_[_0x33da('0x6a')](_0xef8aa)));this[_0x33da('0x11')][_0x5cb9b9['uniqueid']]['push'](_0xef8aa);this['channels'][_0x5cb9b9[_0x33da('0x64')]]=_0xef8aa;this[_0x33da('0x44')](_0xef8aa);}}catch(_0x2b56b6){logger[_0x33da('0x41')](_0x33da('0x6b'),util[_0x33da('0x42')](_0x2b56b6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x33da('0xc')][_0x33da('0x1f')]=function(_0x1d0f69){try{if(this[_0x33da('0x58')](_0x1d0f69)){if(this[_0x33da('0x11')][_0x1d0f69[_0x33da('0x64')]]){var _0x345ac4=_[_0x33da('0x6c')](this[_0x33da('0x11')][_0x1d0f69['uniqueid']]);_0x345ac4[_0x33da('0x6d')]=![];_0x345ac4[_0x33da('0x6e')]=null;_0x345ac4[_0x33da('0x6f')]=_0x1d0f69[_0x33da('0x6f')];_0x345ac4[_0x33da('0x70')]=_0x1d0f69['originalposition'];_0x345ac4[_0x33da('0x1e')]=!![];_0x345ac4[_0x33da('0x71')]=moment()[_0x33da('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x345ac4['queuecallerexitreason']='ABANDONED';_0x345ac4['lastAssignedTo']=null;this[_0x33da('0x13')][_0x1d0f69[_0x33da('0x64')]]=_0x345ac4;this[_0x33da('0x72')](_0x345ac4);}}}catch(_0xb4dc4){logger[_0x33da('0x41')](_0x33da('0x73'),util[_0x33da('0x42')](_0xb4dc4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x33da('0xc')][_0x33da('0x21')]=function(_0x2dfafd){try{if(this['isNotNull'](_0x2dfafd)){if(this[_0x33da('0x11')][_0x2dfafd[_0x33da('0x64')]]){var _0x4f4efc=_[_0x33da('0x6c')](this[_0x33da('0x11')][_0x2dfafd[_0x33da('0x64')]]);_0x4f4efc[_0x33da('0x74')]=moment()[_0x33da('0x45')](_0x33da('0x67'));_0x4f4efc['connectedlinenum']=_0x2dfafd[_0x33da('0x75')];_0x4f4efc[_0x33da('0x76')]=_0x2dfafd['connectedlinename'];this[_0x33da('0x13')][_0x2dfafd[_0x33da('0x64')]]=_0x4f4efc;this[_0x33da('0x44')](_0x4f4efc);}}}catch(_0xdfbcb2){logger[_0x33da('0x41')](_0x33da('0x77'),util[_0x33da('0x42')](_0xdfbcb2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x33da('0xc')]['syncAgentConnect']=function(_0x30a32a){try{if(this[_0x33da('0x58')](_0x30a32a)){if(this[_0x33da('0x11')][_0x30a32a[_0x33da('0x64')]]){var _0x594a69=_[_0x33da('0x6c')](this[_0x33da('0x11')][_0x30a32a[_0x33da('0x64')]]);_0x594a69[_0x33da('0x6d')]=!![];_0x594a69[_0x33da('0x78')]='COMPLETEDBYAGENT';}}}catch(_0x11bb38){logger[_0x33da('0x41')](_0x33da('0x79'),util['inspect'](_0x11bb38,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x33da('0xc')]['syncAgentComplete']=function(_0x124d9c){try{if(this[_0x33da('0x58')](_0x124d9c)){if(this[_0x33da('0x11')][_0x124d9c[_0x33da('0x64')]]){var _0x267da6=_[_0x33da('0x6c')](this[_0x33da('0x11')][_0x124d9c[_0x33da('0x64')]]);_0x267da6[_0x33da('0x1e')]=![];_0x267da6[_0x33da('0x71')]=null;_0x267da6[_0x33da('0x7a')]=!![];_0x267da6[_0x33da('0x7b')]=_0x124d9c['membername'];_0x267da6[_0x33da('0x6f')]=_0x124d9c[_0x33da('0x6f')];_0x267da6[_0x33da('0x6d')]=!![];_0x267da6[_0x33da('0x7c')]=![];_0x267da6['queuecallerexitAt']=null;if(!_0x267da6[_0x33da('0x7d')]){if(_0x124d9c[_0x33da('0x7e')]==_0x33da('0x7d')){_0x267da6['queuecallerexitreason']=_0x33da('0x7f');}else{if(_[_0x33da('0x80')](_0x124d9c[_0x33da('0x3a')][_0x33da('0x81')](),_0x33da('0x82'))){if(this[_0x33da('0x11')][_0x124d9c[_0x33da('0x83')]]){var _0x1afef1=_[_0x33da('0x6c')](this[_0x33da('0x11')][_0x124d9c[_0x33da('0x83')]]);_0x1afef1['queuecallercomplete']=![];_0x1afef1[_0x33da('0x7c')]=!![];_0x1afef1[_0x33da('0x84')]=moment(_0x267da6[_0x33da('0x66')])['add'](_0x124d9c[_0x33da('0x6f')],'seconds')[_0x33da('0x45')](_0x33da('0x67'));_0x1afef1['queuecallerexitreason']=_0x33da('0x85');_0x1afef1[_0x33da('0x7d')]=!![];_0x1afef1[_0x33da('0x86')]='FORWARD';_0x1afef1[_0x33da('0x87')]=_0x124d9c[_0x33da('0x88')];_0x1afef1['transferuniqueid']=_0x124d9c[_0x33da('0x64')];var _0x5f5a84=this[_0x33da('0x11')][_0x124d9c[_0x33da('0x83')]];this[_0x33da('0x11')][_0x124d9c[_0x33da('0x83')]]=this[_0x33da('0x11')][_0x124d9c[_0x33da('0x64')]];this['queueReports'][_0x124d9c[_0x33da('0x64')]]=_0x5f5a84;}}else{_0x267da6[_0x33da('0x78')]=_0x33da('0x89')+_0x124d9c[_0x33da('0x7e')]['toUpperCase']();}}}this[_0x33da('0x13')][_0x124d9c['uniqueid']]=_0x267da6;this[_0x33da('0x72')](_0x267da6);}}}catch(_0x5e159b){logger[_0x33da('0x41')](_0x33da('0x8a'),util[_0x33da('0x42')](_0x5e159b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x33da('0xc')][_0x33da('0x8b')]=function(_0x3de6e2){try{if(this[_0x33da('0x58')](_0x3de6e2)){this[_0x33da('0x8c')](_0x3de6e2[_0x33da('0x64')],_['keys'](_0x3de6e2[_0x33da('0x8d')])[0x0],_0x3de6e2[_0x33da('0x8e')]);if(this[_0x33da('0x11')][_0x3de6e2[_0x33da('0x64')]]){var _0x32094b=_[_0x33da('0x6c')](this[_0x33da('0x11')][_0x3de6e2[_0x33da('0x64')]]);if(_0x32094b){if(this[_0x33da('0x58')](_0x3de6e2[_0x33da('0x8d')])&&this['isNotNull'](_0x3de6e2[_0x33da('0x8d')]['queuestatus'])){switch(_0x3de6e2[_0x33da('0x8e')]){case _0x33da('0x8f'):_0x32094b[_0x33da('0x7c')]=![];_0x32094b[_0x33da('0x84')]=null;break;default:_0x32094b['queuecallerexit']=!![];_0x32094b[_0x33da('0x84')]=moment()[_0x33da('0x45')](_0x33da('0x67'));_0x32094b['queuecallerleaveAt']=moment()[_0x33da('0x45')](_0x33da('0x67'));}_0x32094b[_0x33da('0x1e')]=![];_0x32094b[_0x33da('0x71')]=null;_0x32094b[_0x33da('0x78')]=_0x3de6e2[_0x33da('0x8e')];this[_0x33da('0x13')][_0x3de6e2[_0x33da('0x64')]]=_0x32094b;this['emitVoiceQueueChannelRemove'](_0x32094b);}else if(this[_0x33da('0x58')](_0x3de6e2['variable'])&&this[_0x33da('0x58')](_0x3de6e2['variable'][_0x33da('0x90')])){if(!_0x32094b['queuecallerabandon']){_0x32094b[_0x33da('0x7c')]=!![];_0x32094b[_0x33da('0x84')]=moment()[_0x33da('0x45')](_0x33da('0x67'));_0x32094b['queuecallerexitreason']='EXITWITHKEY';_0x32094b['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3de6e2[_0x33da('0x64')]]=_0x32094b;}}_0x32094b[_0x33da('0x40')]=this[_0x33da('0x40')][_0x3de6e2[_0x33da('0x64')]];}}}}catch(_0x3ae8fb){logger[_0x33da('0x41')](_0x33da('0x91'),util[_0x33da('0x42')](_0x3ae8fb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x33da('0xc')][_0x33da('0x8c')]=function(_0x2c5a01,_0x515d0f,_0x34940d){var _0x1b54f4=[_0x33da('0x92'),_0x33da('0x93'),_0x33da('0x94'),_0x33da('0x95'),_0x33da('0x96'),_0x33da('0x97'),'rtpaudioqosrtt',_0x33da('0x98'),_0x33da('0x99'),_0x33da('0x9a'),_0x33da('0x9b'),_0x33da('0x9c'),_0x33da('0x9d'),_0x33da('0x9e'),_0x33da('0x9f'),_0x33da('0xa0'),_0x33da('0xa1'),_0x33da('0xa2'),_0x33da('0xa3')];if(!_[_0x33da('0xa4')](_0x515d0f)&&!_[_0x33da('0xa5')](_0x1b54f4,_0x515d0f)){if(_[_0x33da('0x2e')](this['variables'][_0x2c5a01])){this['variables'][_0x2c5a01]={};}this['variables'][_0x2c5a01][_0x515d0f]=_0x34940d;}};VoiceQueueReport['prototype'][_0x33da('0x26')]=function(_0x33b500){try{if(this[_0x33da('0x58')](_0x33b500)){if(this[_0x33da('0x11')][_0x33b500[_0x33da('0x64')]]){for(var _0x4b2ab8=0x0,_0x559d9b={};_0x4b2ab8=0x0?moment(_0x24c84f[_0x08ff('0x17')])[_0x08ff('0x18')](_0x24c84f['starttime'],'seconds'):null,'data1':'outbound','data2':_0x24c84f[_0x08ff('0x10')],'data3':_0x24c84f[_0x08ff('0xe')],'data4':_0x24c84f[_0x08ff('0x19')]||null,'role':_0x08ff('0x1a'),'internal':_0x24c84f[_0x08ff('0x10')]?_[_0x08ff('0x1b')](_0x24c84f[_0x08ff('0x10')]):undefined,'uniqueid':_0x24c84f[_0x08ff('0x11')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x156d=['toNumber','accountcode','uniqueid','voiceDialReport','starttime','endtime','outbound','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x156d,0xd9));var _0xd156=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x156d[_0x3ab51d];return _0x29a04e;};'use strict';var moment=require(_0xd156('0x0'));var _=require(_0xd156('0x1'));var util=require(_0xd156('0x2'));var client=require(_0xd156('0x3'));exports[_0xd156('0x4')]=function(_0x5c0011){var _0x500cdd=_0x5c0011[_0xd156('0x5')]||_0x5c0011[_0xd156('0x6')];return client[_0xd156('0x7')](_0xd156('0x8'),{'body':{'channel':_0xd156('0x9'),'membername':_0x5c0011[_0xd156('0xa')],'interface':_[_0xd156('0xb')](_0x5c0011[_0xd156('0xc')])?util[_0xd156('0xd')](_0xd156('0xe'),_0x5c0011[_0xd156('0xa')]):_0x5c0011[_0xd156('0xc')],'type':_0xd156('0xf'),'enterAt':_0x5c0011['queuecallerleaveAt'],'exitAt':_0x500cdd,'duration':moment(_0x500cdd)[_0xd156('0x10')](_0x5c0011[_0xd156('0x11')],_0xd156('0x12')),'data1':_0xd156('0x13'),'data2':_0x5c0011[_0xd156('0x14')],'data3':_0x5c0011[_0xd156('0x15')],'data4':null,'data5':_0x5c0011['queue'],'role':_0xd156('0x16'),'internal':_0x5c0011['accountcode']?_[_0xd156('0x17')](_0x5c0011[_0xd156('0x18')]):undefined,'uniqueid':_0x5c0011[_0xd156('0x19')]},'log':'CreateMemberReport'});};exports[_0xd156('0x1a')]=function(_0x5e00e4){return client[_0xd156('0x7')](_0xd156('0x8'),{'body':{'channel':'voice','membername':_0x5e00e4['membername'],'interface':_0x5e00e4[_0xd156('0xc')],'type':_0xd156('0xf'),'enterAt':_0x5e00e4[_0xd156('0x1b')],'exitAt':_0x5e00e4[_0xd156('0x1c')],'duration':moment(_0x5e00e4['endtime'])['diff'](_0x5e00e4['starttime'],_0xd156('0x12'))>=0x0?moment(_0x5e00e4[_0xd156('0x1c')])['diff'](_0x5e00e4['starttime'],_0xd156('0x12')):null,'data1':_0xd156('0x1d'),'data2':_0x5e00e4[_0xd156('0x18')],'data3':_0x5e00e4[_0xd156('0x15')],'data4':_0x5e00e4['dialstring']||null,'role':'agent','internal':_0x5e00e4[_0xd156('0x18')]?_[_0xd156('0x17')](_0x5e00e4[_0xd156('0x18')]):undefined,'uniqueid':_0x5e00e4[_0xd156('0x19')]},'log':_0xd156('0x8')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 9a922c6..08329c4 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 _0x7635=['name','html','../client','getTemplates','GetTemplate'];(function(_0x188cef,_0x5f56fb){var _0x47b2fc=function(_0x203930){while(--_0x203930){_0x188cef['push'](_0x188cef['shift']());}};_0x47b2fc(++_0x5f56fb);}(_0x7635,0x10b));var _0x5763=function(_0x53f29b,_0x22cf73){_0x53f29b=_0x53f29b-0x0;var _0x18b486=_0x7635[_0x53f29b];return _0x18b486;};'use strict';var client=require(_0x5763('0x0'));exports[_0x5763('0x1')]=function(_0x18513e){return function(_0x36d004){return client['Request'](_0x5763('0x2'),{'options':{'raw':!![],'attributes':['id',_0x5763('0x3'),_0x5763('0x4')]},'log':_0x5763('0x2')});};}; \ No newline at end of file +var _0xf2a3=['Request','name','html','GetTemplate','../client'];(function(_0x32ca56,_0x258337){var _0x41a749=function(_0x13b078){while(--_0x13b078){_0x32ca56['push'](_0x32ca56['shift']());}};_0x41a749(++_0x258337);}(_0xf2a3,0xc7));var _0x3f2a=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xf2a3[_0x2b10c6];return _0x3789d2;};'use strict';var client=require(_0x3f2a('0x0'));exports['getTemplates']=function(_0x3825d9){return function(_0x23595b){return client[_0x3f2a('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x3f2a('0x2'),_0x3f2a('0x3')]},'log':_0x3f2a('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 52dd755..668d858 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 _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x1e5922,_0x11ee34){var _0x38ac81=function(_0x2ea202){while(--_0x2ea202){_0x1e5922['push'](_0x1e5922['shift']());}};_0x38ac81(++_0x11ee34);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x17eecd,_0x39d4f3){var _0x49a2ec=function(_0x5548f5){while(--_0x5548f5){_0x17eecd['push'](_0x17eecd['shift']());}};_0x49a2ec(++_0x39d4f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'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 aad13ab..2983800 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 _0xba72=['GetTrunk','registry','../client','getTrunks','Request'];(function(_0x4473a3,_0x2080ba){var _0x240e8d=function(_0x3d1dc7){while(--_0x3d1dc7){_0x4473a3['push'](_0x4473a3['shift']());}};_0x240e8d(++_0x2080ba);}(_0xba72,0x75));var _0x2ba7=function(_0x152ef7,_0x221f4c){_0x152ef7=_0x152ef7-0x0;var _0x33b535=_0xba72[_0x152ef7];return _0x33b535;};'use strict';var client=require(_0x2ba7('0x0'));exports[_0x2ba7('0x1')]=function(_0x39eda6){return function(_0x2b315c){return client[_0x2ba7('0x2')](_0x2ba7('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x2ba7('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x472c=['GetTrunk','registry','../client','getTrunks','Request'];(function(_0x5e8e36,_0x46cace){var _0x308c60=function(_0xaf74f){while(--_0xaf74f){_0x5e8e36['push'](_0x5e8e36['shift']());}};_0x308c60(++_0x46cace);}(_0x472c,0x1a6));var _0xc472=function(_0x5691fd,_0x5ae45a){_0x5691fd=_0x5691fd-0x0;var _0x65ba8c=_0x472c[_0x5691fd];return _0x65ba8c;};'use strict';var client=require(_0xc472('0x0'));exports[_0xc472('0x1')]=function(_0x4b3ee8){return function(_0x2fc50c){return client[_0xc472('0x2')](_0xc472('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xc472('0x4')]},'log':_0xc472('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 7263f4b..23720fb 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 _0x5fc2=['fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','telephone','internal','getTelephones','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','name','../client','getAgents','Request','agent','email','accountcode'];(function(_0x5bbd8b,_0x411321){var _0x5146c2=function(_0x5b5258){while(--_0x5b5258){_0x5bbd8b['push'](_0x5bbd8b['shift']());}};_0x5146c2(++_0x411321);}(_0x5fc2,0x1c2));var _0x25fc=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x5fc2[_0x4695ba];return _0x524b7d;};'use strict';var client=require(_0x25fc('0x0'));exports[_0x25fc('0x1')]=function(){return function(){return client[_0x25fc('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x25fc('0x3')},'attributes':['id','name',_0x25fc('0x4'),_0x25fc('0x5'),_0x25fc('0x6'),_0x25fc('0x7'),_0x25fc('0x8'),_0x25fc('0x9'),_0x25fc('0xa'),_0x25fc('0xb'),_0x25fc('0xc'),_0x25fc('0xd'),_0x25fc('0xe')]},'log':_0x25fc('0x1')});};};exports['getTelephones']=function(){return function(){return client[_0x25fc('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x25fc('0xf')},'attributes':['id','name',_0x25fc('0x5'),_0x25fc('0x10')]},'log':_0x25fc('0x11')});};};exports[_0x25fc('0x12')]=function(_0x322768,_0x1fc6d1,_0x493c06){return client['Request'](_0x25fc('0x13'),{'body':{'type':_0x1fc6d1,'uniqueid':_0x493c06},'options':{'where':{'id':_0x322768['id']}},'log':_0x25fc('0x12')});};exports[_0x25fc('0x14')]=function(_0xac5ad){return client[_0x25fc('0x2')](_0x25fc('0x15'),{'body':{},'options':{'where':{'id':_0xac5ad['id']}},'log':'savePause'});};exports[_0x25fc('0x16')]=function(_0x589f6b){return client[_0x25fc('0x2')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x25fc('0x3'),'id':_0x589f6b},'attributes':['id',_0x25fc('0x17'),_0x25fc('0x4'),_0x25fc('0x5'),'fullname',_0x25fc('0x7'),'lastLoginAt','pauseType',_0x25fc('0xa'),_0x25fc('0xb'),_0x25fc('0xe')]},'log':'getAgent'});}; \ No newline at end of file +var _0x99e6=['../client','Request','GetUser','email','accountcode','lastLoginAt','pauseType','phone','mobile','interface','getAgents','telephone','name','savePause','getAgent','ShowUser','agent','online','lastPauseAt','voicePause'];(function(_0x254a06,_0x1986d2){var _0x194c99=function(_0x24c1f9){while(--_0x24c1f9){_0x254a06['push'](_0x254a06['shift']());}};_0x194c99(++_0x1986d2);}(_0x99e6,0x1b8));var _0x699e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x99e6[_0x934425];return _0x31d596;};'use strict';var client=require(_0x699e('0x0'));exports['getAgents']=function(){return function(){return client[_0x699e('0x1')](_0x699e('0x2'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id','name',_0x699e('0x3'),_0x699e('0x4'),'fullname','online',_0x699e('0x5'),_0x699e('0x6'),'lastPauseAt','voicePause',_0x699e('0x7'),_0x699e('0x8'),_0x699e('0x9')]},'log':_0x699e('0xa')});};};exports['getTelephones']=function(){return function(){return client[_0x699e('0x1')](_0x699e('0x2'),{'options':{'raw':!![],'where':{'role':_0x699e('0xb')},'attributes':['id',_0x699e('0xc'),_0x699e('0x4'),'internal']},'log':'getTelephones'});};};exports[_0x699e('0xd')]=function(_0x2cfaa8,_0x36e719,_0x2c21c2){return client['Request']('PauseUser',{'body':{'type':_0x36e719,'uniqueid':_0x2c21c2},'options':{'where':{'id':_0x2cfaa8['id']}},'log':_0x699e('0xd')});};exports['saveUnpause']=function(_0x4ba150){return client[_0x699e('0x1')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x4ba150['id']}},'log':_0x699e('0xd')});};exports[_0x699e('0xe')]=function(_0xe79cae){return client[_0x699e('0x1')](_0x699e('0xf'),{'options':{'raw':![],'where':{'role':_0x699e('0x10'),'id':_0xe79cae},'attributes':['id',_0x699e('0xc'),_0x699e('0x3'),_0x699e('0x4'),'fullname',_0x699e('0x11'),_0x699e('0x5'),'pauseType',_0x699e('0x12'),_0x699e('0x13'),'interface']},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index fa7ae2d..03d048d 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 _0xd6be=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x43ece9,_0x39dc28){var _0x11fb9d=function(_0x2670ac){while(--_0x2670ac){_0x43ece9['push'](_0x43ece9['shift']());}};_0x11fb9d(++_0x39dc28);}(_0xd6be,0xa9));var _0xed6b=function(_0x45282b,_0x50efad){_0x45282b=_0x45282b-0x0;var _0xb267d6=_0xd6be[_0x45282b];return _0xb267d6;};'use strict';var client=require(_0xed6b('0x0'));exports[_0xed6b('0x1')]=function(_0x2d3d31){return client[_0xed6b('0x2')](_0xed6b('0x3'),{'body':_0x2d3d31,'log':_0xed6b('0x3')});};exports[_0xed6b('0x4')]=function(_0x318cca,_0x1a7b8a,_0x163065){return client[_0xed6b('0x2')](_0xed6b('0x5'),{'body':_0x318cca,'options':{'where':{'uniqueid':_0x1a7b8a,'interface':_0x163065}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x8e23=['Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update'];(function(_0x5d3306,_0x6e1379){var _0x6968f7=function(_0x3f9b44){while(--_0x3f9b44){_0x5d3306['push'](_0x5d3306['shift']());}};_0x6968f7(++_0x6e1379);}(_0x8e23,0x1c4));var _0x38e2=function(_0x8a130d,_0x51079b){_0x8a130d=_0x8a130d-0x0;var _0x2ecd9c=_0x8e23[_0x8a130d];return _0x2ecd9c;};'use strict';var client=require(_0x38e2('0x0'));exports[_0x38e2('0x1')]=function(_0x2b1c7a){return client['Request'](_0x38e2('0x2'),{'body':_0x2b1c7a,'log':_0x38e2('0x2')});};exports[_0x38e2('0x3')]=function(_0x4ef131,_0x2d9f42,_0x393ca7){return client[_0x38e2('0x4')]('UpdateVoiceAgentReport',{'body':_0x4ef131,'options':{'where':{'uniqueid':_0x2d9f42,'interface':_0x393ca7}},'log':_0x38e2('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 078b72f..9396435 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 _0xb2f7=['lodash','../client','create','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','GetVoiceCallReports','moment','util'];(function(_0x438988,_0x2a86cf){var _0x1ce59f=function(_0x26f36a){while(--_0x26f36a){_0x438988['push'](_0x438988['shift']());}};_0x1ce59f(++_0x2a86cf);}(_0xb2f7,0x106));var _0x7b2f=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xb2f7[_0x4dbaad];return _0x226c72;};'use strict';var moment=require(_0x7b2f('0x0'));var util=require(_0x7b2f('0x1'));var _=require(_0x7b2f('0x2'));var client=require(_0x7b2f('0x3'));exports[_0x7b2f('0x4')]=function(_0x1002e9){return client['Request'](_0x7b2f('0x5'),{'body':_[_0x7b2f('0x6')](_0x1002e9,{'source':_0x1002e9[_0x7b2f('0x7')],'destinationcontext':_0x1002e9[_0x7b2f('0x8')],'callerid':_0x1002e9[_0x7b2f('0x9')],'amaflags':_0x7b2f('0xa')}),'log':'CreateVoiceCallReport'});};exports[_0x7b2f('0xb')]=function(){return function(){return client[_0x7b2f('0xc')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x7b2f('0xd')](_0x7b2f('0xe'))[_0x7b2f('0xf')](_0x7b2f('0x10')),moment()[_0x7b2f('0x11')](_0x7b2f('0xe'))[_0x7b2f('0xf')](_0x7b2f('0x10'))]}},'attributes':[_0x7b2f('0x12'),'disposition',_0x7b2f('0x13'),_0x7b2f('0x14')]},'log':_0x7b2f('0x15')});};}; \ No newline at end of file +var _0x8a91=['billableseconds','GetVoiceCallReports','moment','util','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration'];(function(_0x3d0b38,_0x5b4bda){var _0x5f19fb=function(_0xb9cbdb){while(--_0xb9cbdb){_0x3d0b38['push'](_0x3d0b38['shift']());}};_0x5f19fb(++_0x5b4bda);}(_0x8a91,0x1f0));var _0x18a9=function(_0x5be997,_0x5d5155){_0x5be997=_0x5be997-0x0;var _0x654474=_0x8a91[_0x5be997];return _0x654474;};'use strict';var moment=require(_0x18a9('0x0'));var util=require(_0x18a9('0x1'));var _=require('lodash');var client=require(_0x18a9('0x2'));exports['create']=function(_0x42db59){return client[_0x18a9('0x3')](_0x18a9('0x4'),{'body':_[_0x18a9('0x5')](_0x42db59,{'source':_0x42db59[_0x18a9('0x6')],'destinationcontext':_0x42db59[_0x18a9('0x7')],'callerid':_0x42db59[_0x18a9('0x8')],'amaflags':_0x18a9('0x9')}),'log':_0x18a9('0x4')});};exports[_0x18a9('0xa')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0x18a9('0xb'))[_0x18a9('0xc')](_0x18a9('0xd')),moment()[_0x18a9('0xe')](_0x18a9('0xb'))[_0x18a9('0xc')](_0x18a9('0xd'))]}},'attributes':[_0x18a9('0xf'),'disposition',_0x18a9('0x10'),_0x18a9('0x11')]},'log':_0x18a9('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 443360c..3091acb 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 _0xdd57=['CreateVoiceDialReport','../client','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd57,0x179));var _0x7dd5=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0xdd57[_0x5cc8];return _0x450661;};'use strict';var client=require(_0x7dd5('0x0'));exports[_0x7dd5('0x1')]=function(_0x317d45){return client[_0x7dd5('0x2')](_0x7dd5('0x3'),{'body':_0x317d45,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0xd6bc=['Request','CreateVoiceDialReport','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6bc,0xea));var _0xcd6b=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd6bc[_0x4c12ec];return _0x3ae42c;};'use strict';var client=require(_0xcd6b('0x0'));exports[_0xcd6b('0x1')]=function(_0x55c252){return client[_0xcd6b('0x2')](_0xcd6b('0x3'),{'body':_0x55c252,'log':_0xcd6b('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 692ba27..16eef04 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 _0x7490=['Request','GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x1980c3,_0x8eed68){var _0x49854b=function(_0x496331){while(--_0x496331){_0x1980c3['push'](_0x1980c3['shift']());}};_0x49854b(++_0x8eed68);}(_0x7490,0x164));var _0x0749=function(_0x213098,_0x3109ca){_0x213098=_0x213098-0x0;var _0x50d07a=_0x7490[_0x213098];return _0x50d07a;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x0749('0x0')](_0x0749('0x1'),{'options':{'raw':!![],'attributes':['id',_0x0749('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x0749('0x3')});};}; \ No newline at end of file +var _0x62cb=['../client','Request','GetVoiceExtension','exten','recordingFormat','getVoiceExtensions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62cb,0xe4));var _0xb62c=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x62cb[_0x11c573];return _0x6b72de;};'use strict';var client=require(_0xb62c('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xb62c('0x1')](_0xb62c('0x2'),{'options':{'raw':!![],'attributes':['id',_0xb62c('0x3'),_0xb62c('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xb62c('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 89c0827..2fc7c60 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 _0xcce8=['dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','mandatoryDisposition','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting'];(function(_0x1ede91,_0x2a620f){var _0x57ebf6=function(_0x2b8e4c){while(--_0x2b8e4c){_0x1ede91['push'](_0x1ede91['shift']());}};_0x57ebf6(++_0x2a620f);}(_0xcce8,0x1a5));var _0x8cce=function(_0x231a7e,_0x507671){_0x231a7e=_0x231a7e-0x0;var _0x38268d=_0xcce8[_0x231a7e];return _0x38268d;};'use strict';var client=require(_0x8cce('0x0'));exports[_0x8cce('0x1')]=function(){return function(){return client[_0x8cce('0x2')](_0x8cce('0x3'),{'options':{'raw':![],'attributes':['id',_0x8cce('0x4'),_0x8cce('0x5'),_0x8cce('0x6'),_0x8cce('0x7'),_0x8cce('0x8'),_0x8cce('0x9'),'dialActive',_0x8cce('0xa'),_0x8cce('0xb'),_0x8cce('0xc'),_0x8cce('0xd'),_0x8cce('0xe'),_0x8cce('0xf'),'dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x8cce('0x10'),'dialQueueOptions','dialQueueTimeout',_0x8cce('0x11'),_0x8cce('0x12'),'dialCongestionRetryFrequency',_0x8cce('0x13'),_0x8cce('0x14'),_0x8cce('0x15'),'dialNoAnswerRetryFrequency',_0x8cce('0x16'),_0x8cce('0x17'),_0x8cce('0x18'),_0x8cce('0x19'),'dialCheckDuplicateType',_0x8cce('0x1a'),_0x8cce('0x1b'),_0x8cce('0x1c'),_0x8cce('0x1d'),'dialAMDTotalAnalysisTime',_0x8cce('0x1e'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x8cce('0x1f'),'dialAMDMaximumWordLength',_0x8cce('0x20'),_0x8cce('0x21'),_0x8cce('0x22'),_0x8cce('0x23'),_0x8cce('0x24'),_0x8cce('0x25'),_0x8cce('0x26'),_0x8cce('0x8'),_0x8cce('0x27'),_0x8cce('0x28'),'dialCutDigit',_0x8cce('0x29')],'include':[{'model':_0x8cce('0x2a'),'as':'Trunk','attributes':['id',_0x8cce('0x4'),_0x8cce('0x2b'),_0x8cce('0x2c')]},{'model':_0x8cce('0x2d'),'as':_0x8cce('0x2e'),'attributes':['id','name']},{'model':_0x8cce('0x2a'),'as':_0x8cce('0x2f'),'attributes':['id',_0x8cce('0x4'),_0x8cce('0x2b'),'active']},{'model':_0x8cce('0x30'),'as':'Interval','attributes':['id',_0x8cce('0x4')],'include':[{'model':_0x8cce('0x30'),'as':_0x8cce('0x31'),'attributes':['id',_0x8cce('0x4'),'interval']}]}]},'log':_0x8cce('0x1')});};}; \ No newline at end of file +var _0x693f=['dialAgiAfterHangupClient','dialQueueProject2','mandatoryDisposition','Trunk','name','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent'];(function(_0x1b27ca,_0x59925a){var _0x245ca2=function(_0x1c7a7f){while(--_0x1c7a7f){_0x1b27ca['push'](_0x1b27ca['shift']());}};_0x245ca2(++_0x59925a);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xf693('0x0'));exports[_0xf693('0x1')]=function(){return function(){return client[_0xf693('0x2')](_0xf693('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xf693('0x4'),_0xf693('0x5'),_0xf693('0x6'),_0xf693('0x7'),_0xf693('0x8'),_0xf693('0x9'),_0xf693('0xa'),'dialLimitChannel',_0xf693('0xb'),_0xf693('0xc'),'dialPredictiveOptimization',_0xf693('0xd'),'dialPredictiveInterval',_0xf693('0xe'),'dialOriginateCallerIdNumber',_0xf693('0xf'),_0xf693('0x10'),'dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry',_0xf693('0x11'),'dialBusyMaxRetry',_0xf693('0x12'),_0xf693('0x13'),_0xf693('0x14'),_0xf693('0x15'),_0xf693('0x16'),'dialGlobalInterval','dialPrefix',_0xf693('0x17'),_0xf693('0x18'),'dialAMDInitialSilence',_0xf693('0x19'),_0xf693('0x1a'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0xf693('0x1b'),_0xf693('0x1c'),_0xf693('0x1d'),_0xf693('0x1e'),_0xf693('0x1f'),'dialRecallMeTimeout',_0xf693('0x20'),_0xf693('0x21'),_0xf693('0x22'),_0xf693('0x23'),_0xf693('0x24'),_0xf693('0x7'),'strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xf693('0x25')],'include':[{'model':_0xf693('0x26'),'as':_0xf693('0x26'),'attributes':['id',_0xf693('0x27'),_0xf693('0x28'),'active']},{'model':_0xf693('0x29'),'as':_0xf693('0x2a'),'attributes':['id',_0xf693('0x27')]},{'model':_0xf693('0x26'),'as':_0xf693('0x2b'),'attributes':['id',_0xf693('0x27'),_0xf693('0x28'),_0xf693('0x2c')]},{'model':'Interval','as':_0xf693('0x2d'),'attributes':['id',_0xf693('0x27')],'include':[{'model':_0xf693('0x2d'),'as':_0xf693('0x2e'),'attributes':['id',_0xf693('0x27'),_0xf693('0x2f')]}]}]},'log':_0xf693('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 5736ef2..a64e0e5 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 _0x7bc7=['endOf','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','moment','lodash','../client','create','CreateVoiceQueueReport','getVoiceQueueReports','Request','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x10fa70,_0x41962e){var _0x53ad16=function(_0x8d1620){while(--_0x8d1620){_0x10fa70['push'](_0x10fa70['shift']());}};_0x53ad16(++_0x41962e);}(_0x7bc7,0xf0));var _0x77bc=function(_0x9cc188,_0x33b2e2){_0x9cc188=_0x9cc188-0x0;var _0x95fa48=_0x7bc7[_0x9cc188];return _0x95fa48;};'use strict';var moment=require(_0x77bc('0x0'));var _=require(_0x77bc('0x1'));var client=require(_0x77bc('0x2'));exports[_0x77bc('0x3')]=function(_0x100c56){return client['Request'](_0x77bc('0x4'),{'body':_0x100c56,'log':'CreateVoiceQueueReport'});};exports[_0x77bc('0x5')]=function(){return function(){return client[_0x77bc('0x6')](_0x77bc('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x77bc('0x8')](_0x77bc('0x9'))[_0x77bc('0xa')](_0x77bc('0xb')),moment()[_0x77bc('0xc')](_0x77bc('0x9'))[_0x77bc('0xa')](_0x77bc('0xb'))]}},'attributes':['uniqueid',_0x77bc('0xd'),_0x77bc('0xe'),_0x77bc('0xf'),_0x77bc('0x10'),_0x77bc('0x11'),'queuecallerexit',_0x77bc('0x12'),_0x77bc('0x13'),'queuecallerabandonAt']},'log':_0x77bc('0x14')});};}; \ No newline at end of file +var _0x93f9=['getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','moment','../client','Request','CreateVoiceQueueReport'];(function(_0x1f7fd6,_0x3eb847){var _0x5ab870=function(_0x7551b1){while(--_0x7551b1){_0x1f7fd6['push'](_0x1f7fd6['shift']());}};_0x5ab870(++_0x3eb847);}(_0x93f9,0x1b4));var _0x993f=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x93f9[_0x55e08b];return _0xd1a7ff;};'use strict';var moment=require(_0x993f('0x0'));var _=require('lodash');var client=require(_0x993f('0x1'));exports['create']=function(_0x44a226){return client[_0x993f('0x2')](_0x993f('0x3'),{'body':_0x44a226,'log':_0x993f('0x3')});};exports[_0x993f('0x4')]=function(){return function(){return client[_0x993f('0x2')](_0x993f('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x993f('0x6')](_0x993f('0x7'))[_0x993f('0x8')](_0x993f('0x9')),moment()[_0x993f('0xa')]('day')[_0x993f('0x8')](_0x993f('0x9'))]}},'attributes':[_0x993f('0xb'),_0x993f('0xc'),_0x993f('0xd'),_0x993f('0xe'),'queuecallercomplete',_0x993f('0xf'),_0x993f('0x10'),_0x993f('0x11'),_0x993f('0x12'),'queuecallerabandonAt']},'log':_0x993f('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 0ac0059..b736aa8 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 _0xb30e=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x2b13ab,_0x3e916f){var _0x1c96ce=function(_0x17e515){while(--_0x17e515){_0x2b13ab['push'](_0x2b13ab['shift']());}};_0x1c96ce(++_0x3e916f);}(_0xb30e,0xf0));var _0xeb30=function(_0x5bf02f,_0x4839d4){_0x5bf02f=_0x5bf02f-0x0;var _0x5e2b7d=_0xb30e[_0x5bf02f];return _0x5e2b7d;};'use strict';var client=require(_0xeb30('0x0'));exports[_0xeb30('0x1')]=function(_0x280032){return function(){return client[_0xeb30('0x2')](_0xeb30('0x3'),{'options':{'where':{'VoiceQueueId':_0x280032,'paused':!![]},'raw':!![]},'log':_0xeb30('0x1')});};}; \ No newline at end of file +var _0xcb16=['../client','GetVoiceQueueRtPauses'];(function(_0x4b59e2,_0x59a4c9){var _0x23546a=function(_0xcea80f){while(--_0xcea80f){_0x4b59e2['push'](_0x4b59e2['shift']());}};_0x23546a(++_0x59a4c9);}(_0xcb16,0x11c));var _0x6cb1=function(_0x17cbfd,_0x5c2c18){_0x17cbfd=_0x17cbfd-0x0;var _0x272b56=_0xcb16[_0x17cbfd];return _0x272b56;};'use strict';var client=require(_0x6cb1('0x0'));exports['getVoiceQueueRtPauses']=function(_0x1e187e){return function(){return client['Request'](_0x6cb1('0x1'),{'options':{'where':{'VoiceQueueId':_0x1e187e,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 6b504af..aae04e1 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 _0xb8fb=['../client','Request','CreateVoiceRecording','merge','monitorFilename'];(function(_0x72951f,_0x2277a0){var _0x330c55=function(_0x205457){while(--_0x205457){_0x72951f['push'](_0x72951f['shift']());}};_0x330c55(++_0x2277a0);}(_0xb8fb,0xfa));var _0xbb8f=function(_0x2918ae,_0x1ef2e4){_0x2918ae=_0x2918ae-0x0;var _0x19f09d=_0xb8fb[_0x2918ae];return _0x19f09d;};'use strict';var _=require('lodash');var client=require(_0xbb8f('0x0'));exports['create']=function(_0x30fd37){return client[_0xbb8f('0x1')](_0xbb8f('0x2'),{'body':_[_0xbb8f('0x3')](_0x30fd37,{'value':_0x30fd37[_0xbb8f('0x4')]}),'log':_0xbb8f('0x2')});}; \ No newline at end of file +var _0x8204=['CreateVoiceRecording','merge','monitorFilename','../client','create','Request'];(function(_0x5361f1,_0x5ba4c1){var _0xedf77b=function(_0xa4ad57){while(--_0xa4ad57){_0x5361f1['push'](_0x5361f1['shift']());}};_0xedf77b(++_0x5ba4c1);}(_0x8204,0x9f));var _0x4820=function(_0x49d64e,_0x346016){_0x49d64e=_0x49d64e-0x0;var _0x37aacd=_0x8204[_0x49d64e];return _0x37aacd;};'use strict';var _=require('lodash');var client=require(_0x4820('0x0'));exports[_0x4820('0x1')]=function(_0x5dccb8){return client[_0x4820('0x2')](_0x4820('0x3'),{'body':_[_0x4820('0x4')](_0x5dccb8,{'value':_0x5dccb8[_0x4820('0x5')]}),'log':_0x4820('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index b443ee2..1e78fad 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 _0xf8ea=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','blindTransfer','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x42ea0a,_0x211485){var _0x358c8e=function(_0x10232e){while(--_0x10232e){_0x42ea0a['push'](_0x42ea0a['shift']());}};_0x358c8e(++_0x211485);}(_0xf8ea,0x1e0));var _0xaf8e=function(_0x42e3d3,_0x5c7256){_0x42e3d3=_0x42e3d3-0x0;var _0x2cacb4=_0xf8ea[_0x42e3d3];return _0x2cacb4;};'use strict';var client=require(_0xaf8e('0x0'));exports[_0xaf8e('0x1')]=function(_0x2630f5){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x2630f5[_0xaf8e('0x2')],'transfererchannel':_0x2630f5[_0xaf8e('0x3')],'transferercalleridnum':_0x2630f5[_0xaf8e('0x4')],'transferercalleridname':_0x2630f5[_0xaf8e('0x5')],'transfererconnectedlinenum':_0x2630f5[_0xaf8e('0x6')],'transfererconnectedlinename':_0x2630f5[_0xaf8e('0x7')],'transfereraccountcode':_0x2630f5['transfereraccountcode'],'transferercontext':_0x2630f5[_0xaf8e('0x8')],'transfererexten':_0x2630f5[_0xaf8e('0x9')],'transfererlinkedid':_0x2630f5['transfererlinkedid'],'transfereechannel':_0x2630f5[_0xaf8e('0xa')],'transfereecalleridnum':_0x2630f5[_0xaf8e('0xb')],'transfereecalleridname':_0x2630f5['transfereecalleridname'],'transfereeconnectedlinenum':_0x2630f5[_0xaf8e('0xc')],'transfereeconnectedlinename':_0x2630f5[_0xaf8e('0xd')],'transfereeaccountcode':_0x2630f5[_0xaf8e('0xe')],'transfereecontext':_0x2630f5[_0xaf8e('0xf')],'transfereeexten':_0x2630f5[_0xaf8e('0x10')],'transfereelinkedid':_0x2630f5[_0xaf8e('0x11')],'isexternal':_0x2630f5[_0xaf8e('0x12')],'context':_0x2630f5[_0xaf8e('0x13')],'extension':_0x2630f5[_0xaf8e('0x14')],'type':_0xaf8e('0x15')},'log':_0xaf8e('0x16')});};exports[_0xaf8e('0x17')]=function(_0x34c52a){return client[_0xaf8e('0x18')](_0xaf8e('0x16'),{'body':{'result':_0x34c52a['result'],'transfererchannel':_0x34c52a[_0xaf8e('0x19')],'transferercalleridnum':_0x34c52a[_0xaf8e('0x1a')],'transferercalleridname':_0x34c52a['origtransferercalleridname'],'transfererconnectedlinenum':_0x34c52a[_0xaf8e('0x1b')],'transfererconnectedlinename':_0x34c52a[_0xaf8e('0x1c')],'transfereraccountcode':_0x34c52a[_0xaf8e('0x1d')],'transferercontext':_0x34c52a[_0xaf8e('0x1e')],'transfererexten':_0x34c52a[_0xaf8e('0x1f')],'transfererlinkedid':_0x34c52a[_0xaf8e('0x20')],'transfereechannel':_0x34c52a[_0xaf8e('0x21')],'transfereecalleridnum':_0x34c52a[_0xaf8e('0x22')],'transfereecalleridname':_0x34c52a[_0xaf8e('0x23')],'transfereeconnectedlinenum':_0x34c52a[_0xaf8e('0x24')],'transfereeconnectedlinename':_0x34c52a[_0xaf8e('0x25')],'transfereeaccountcode':_0x34c52a[_0xaf8e('0x26')],'transfereecontext':_0x34c52a['transfertargetcontext'],'transfereeexten':_0x34c52a[_0xaf8e('0x27')],'transfereelinkedid':_0x34c52a[_0xaf8e('0x28')],'isexternal':_0x34c52a[_0xaf8e('0x12')],'context':_0x34c52a[_0xaf8e('0x29')],'extension':_0x34c52a[_0xaf8e('0x2a')],'type':'attended'},'log':_0xaf8e('0x16')});}; \ No newline at end of file +var _0x095f=['transfereeconnectedlinename','transfereecontext','transfereeexten','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','origtransferercontext','attended','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum'];(function(_0x1bedf4,_0x35087f){var _0x339003=function(_0x3f7a8e){while(--_0x3f7a8e){_0x1bedf4['push'](_0x1bedf4['shift']());}};_0x339003(++_0x35087f);}(_0x095f,0x169));var _0xf095=function(_0x4e7280,_0x1eb92d){_0x4e7280=_0x4e7280-0x0;var _0x968a56=_0x095f[_0x4e7280];return _0x968a56;};'use strict';var client=require('../client');exports['blindTransfer']=function(_0xb7304){return client[_0xf095('0x0')](_0xf095('0x1'),{'body':{'result':_0xb7304[_0xf095('0x2')],'transfererchannel':_0xb7304[_0xf095('0x3')],'transferercalleridnum':_0xb7304[_0xf095('0x4')],'transferercalleridname':_0xb7304[_0xf095('0x5')],'transfererconnectedlinenum':_0xb7304[_0xf095('0x6')],'transfererconnectedlinename':_0xb7304[_0xf095('0x7')],'transfereraccountcode':_0xb7304[_0xf095('0x8')],'transferercontext':_0xb7304[_0xf095('0x9')],'transfererexten':_0xb7304[_0xf095('0xa')],'transfererlinkedid':_0xb7304['transfererlinkedid'],'transfereechannel':_0xb7304[_0xf095('0xb')],'transfereecalleridnum':_0xb7304[_0xf095('0xc')],'transfereecalleridname':_0xb7304['transfereecalleridname'],'transfereeconnectedlinenum':_0xb7304['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0xb7304[_0xf095('0xd')],'transfereeaccountcode':_0xb7304['transfereeaccountcode'],'transfereecontext':_0xb7304[_0xf095('0xe')],'transfereeexten':_0xb7304[_0xf095('0xf')],'transfereelinkedid':_0xb7304['transfereelinkedid'],'isexternal':_0xb7304[_0xf095('0x10')],'context':_0xb7304[_0xf095('0x11')],'extension':_0xb7304[_0xf095('0x12')],'type':'blind'},'log':_0xf095('0x1')});};exports[_0xf095('0x13')]=function(_0x20fb14){return client['Request'](_0xf095('0x1'),{'body':{'result':_0x20fb14[_0xf095('0x2')],'transfererchannel':_0x20fb14[_0xf095('0x14')],'transferercalleridnum':_0x20fb14['origtransferercalleridnum'],'transferercalleridname':_0x20fb14[_0xf095('0x15')],'transfererconnectedlinenum':_0x20fb14['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x20fb14[_0xf095('0x16')],'transfereraccountcode':_0x20fb14[_0xf095('0x17')],'transferercontext':_0x20fb14[_0xf095('0x18')],'transfererexten':_0x20fb14[_0xf095('0x19')],'transfererlinkedid':_0x20fb14['origtransfererlinkedid'],'transfereechannel':_0x20fb14[_0xf095('0x1a')],'transfereecalleridnum':_0x20fb14[_0xf095('0x1b')],'transfereecalleridname':_0x20fb14[_0xf095('0x1c')],'transfereeconnectedlinenum':_0x20fb14['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x20fb14[_0xf095('0x1d')],'transfereeaccountcode':_0x20fb14[_0xf095('0x1e')],'transfereecontext':_0x20fb14['transfertargetcontext'],'transfereeexten':_0x20fb14['transfertargetexten'],'transfereelinkedid':_0x20fb14[_0xf095('0x1f')],'isexternal':_0x20fb14[_0xf095('0x10')],'context':_0x20fb14[_0xf095('0x20')],'extension':_0x20fb14['origtransfererexten'],'type':_0xf095('0x21')},'log':_0xf095('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index bf24495..b1fd231 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 _0xecfb=['RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','asterisk','username','ami\x20disconnected','pick','keys','then','message','error','isConnected','join','action','Command','Action','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','type','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','Interval','push','length','values','channels','map','find','channel','format','%s.%s','filename','uniqueid','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','catch','wav','stop','queueChannels','validate','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','emit','faxAccounts','checkAfterSend','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!'];(function(_0x51db32,_0x4647fc){var _0x5c779e=function(_0xaf46bb){while(--_0xaf46bb){_0x51db32['push'](_0x51db32['shift']());}};_0x5c779e(++_0x4647fc);}(_0xecfb,0x178));var _0xbecf=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0xecfb[_0x2cc8bb];return _0x140e40;};'use strict';var _=require(_0xbecf('0x0'));var util=require(_0xbecf('0x1'));var jayson=require(_0xbecf('0x2'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0xbecf('0x3'));var config=require(_0xbecf('0x4'));var properties=require(_0xbecf('0x5'));var ami=require(_0xbecf('0x6'));exports[_0xbecf('0x7')]=function(_0xf29afc,_0x5b11bf,_0x4a2d20){return new BPromise(function(_0x3f55c3,_0x30b58b){var _0x1633fd={'QueuePause':function(_0x4b8836){return new Promise(function(_0x210360,_0x5c1a0b){var _0x74a90b=util['format'](_0xbecf('0x8'),_0xbecf('0x9'),_0x4b8836[_0xbecf('0xa')]);if(_0xf29afc[_0xbecf('0xb')]&&_0xf29afc['timers'][_0x74a90b]&&_0xf29afc[_0xbecf('0xb')][_0x74a90b][_0xbecf('0xc')]){_0xf29afc[_0xbecf('0xb')][_0x74a90b][_0xbecf('0xd')]();}if(_0xf29afc[_0xbecf('0xe')][_0x74a90b]){_0xf29afc[_0xbecf('0xe')][_0x74a90b][_0xbecf('0xf')]({'statePause':_0x4b8836[_0xbecf('0x10')]?!![]:![]});}_0x210360({'code':0xc8,'message':_0xbecf('0x11')});});},'Reload':function(_0x2c0d28){var _0x52cc71=this;return new Promise(function(_0x5a7181,_0x2450c9){if(ami['isConnected']()==![]){return _0x2450c9(_0x52cc71['error'](0x1f4,[config[_0xbecf('0x12')]['ip'],config[_0xbecf('0x12')][_0xbecf('0x13')],_0xbecf('0x14')]['join']('\x20')));}_0x2c0d28=_[_0xbecf('0x15')](_0x2c0d28,_[_0xbecf('0x16')](properties['module']));_0x2c0d28['action']='Reload';return ami['Action'](_0x2c0d28)[_0xbecf('0x17')](function(_0x40f348){_0x5a7181({'code':0xc8,'message':_0x40f348[_0xbecf('0x18')]});})['catch'](function(_0x123df4){_0x2450c9(_0x52cc71[_0xbecf('0x19')](0x1f5,_0x123df4[_0xbecf('0x18')]));});});},'Command':function(_0x35f7a9){var _0x10aac2=this;return new Promise(function(_0xf162a7,_0xef7c4a){if(ami[_0xbecf('0x1a')]()==![]){return _0xef7c4a(_0x10aac2[_0xbecf('0x19')](0x1f4,[config['asterisk']['ip'],config[_0xbecf('0x12')]['username'],_0xbecf('0x14')][_0xbecf('0x1b')]('\x20')));}_0x35f7a9=_[_0xbecf('0x15')](_0x35f7a9,'command');_0x35f7a9[_0xbecf('0x1c')]=_0xbecf('0x1d');return ami[_0xbecf('0x1e')](_0x35f7a9)[_0xbecf('0x17')](function(_0x263760){_0xf162a7({'code':0xc8,'message':_0x263760[_0xbecf('0x1f')]});})['catch'](function(_0x52eba5){_0xef7c4a(_0x10aac2[_0xbecf('0x19')](0x1f5,_0x52eba5[_0xbecf('0x18')]));});});},'VoiceQueues':function(_0x17b2dd){return new Promise(function(_0x20d0bd,_0x44e9b4){var _0x2e7ead=[];for(var _0x4cbb23 in _0xf29afc[_0xbecf('0x20')]){if(_0xf29afc[_0xbecf('0x20')][_0xbecf('0x21')](_0x4cbb23)){var _0x214edb=_0xf29afc['voiceQueues'][_0x4cbb23];var _0x22173a={'id':_0x214edb['id'],'name':_0x214edb[_0xbecf('0xa')],'strategy':_0x214edb[_0xbecf('0x22')],'answered':_0x214edb[_0xbecf('0x23')],'available':_0x214edb[_0xbecf('0x24')],'loggedIn':_0x214edb[_0xbecf('0x25')],'pTalking':_0x214edb[_0xbecf('0x26')],'sumBillable':_0x214edb[_0xbecf('0x27')],'sumDuration':_0x214edb[_0xbecf('0x28')],'sumHoldTime':_0x214edb['sumHoldTime']||0x0,'talking':_0x214edb[_0xbecf('0x29')],'total':_0x214edb['total'],'type':_0x214edb[_0xbecf('0x2a')],'unmanaged':_0x214edb['unmanaged'],'abandoned':_0x214edb[_0xbecf('0x2b')],'waiting':_0x214edb['waiting'],'loggedInDb':_0x214edb[_0xbecf('0x2c')]};if(_0x214edb[_0xbecf('0x2a')]===_0xbecf('0x2d')){_0x22173a['dialActive']=_0x214edb[_0xbecf('0x2e')];_0x22173a[_0xbecf('0x2f')]=_0x214edb[_0xbecf('0x2f')];_0x22173a[_0xbecf('0x30')]=_0x214edb[_0xbecf('0x30')];_0x22173a[_0xbecf('0x31')]=_0x214edb[_0xbecf('0x31')];_0x22173a['dialOriginateTimeout']=_0x214edb[_0xbecf('0x32')];_0x22173a['dialPrefix']=_0x214edb[_0xbecf('0x33')];_0x22173a['outboundAnswerAgiCallsDay']=_0x214edb[_0xbecf('0x34')];_0x22173a[_0xbecf('0x35')]=_0x214edb[_0xbecf('0x35')];_0x22173a['outboundBlacklistCallsDay']=_0x214edb[_0xbecf('0x36')];_0x22173a[_0xbecf('0x37')]=_0x214edb['outboundBusyCallsDay'];_0x22173a[_0xbecf('0x38')]=_0x214edb[_0xbecf('0x38')];_0x22173a[_0xbecf('0x39')]=_0x214edb['outboundDropCallsDayACS'];_0x22173a[_0xbecf('0x3a')]=_0x214edb[_0xbecf('0x3a')];_0x22173a['outboundDropCallsDayTimeout']=_0x214edb['outboundDropCallsDayTimeout'];_0x22173a[_0xbecf('0x3b')]=_0x214edb[_0xbecf('0x3b')];_0x22173a[_0xbecf('0x3c')]=_0x214edb[_0xbecf('0x3c')];_0x22173a['outboundOriginateFailureCallsDay']=_0x214edb['outboundOriginateFailureCallsDay'];_0x22173a[_0xbecf('0x3d')]=_0x214edb['outboundReCallsDay'];_0x22173a['outboundRejectCallsDay']=_0x214edb[_0xbecf('0x3e')];_0x22173a[_0xbecf('0x3f')]=_0x214edb[_0xbecf('0x3f')];_0x22173a[_0xbecf('0x40')]=_0x214edb['predictiveIntervalAnsweredCalls'];_0x22173a[_0xbecf('0x41')]=_0x214edb['predictiveIntervalAvgHoldtime'];_0x22173a[_0xbecf('0x42')]=_0x214edb[_0xbecf('0x42')];_0x22173a[_0xbecf('0x43')]=_0x214edb['predictiveIntervalDroppedCallsCallersExit'];_0x22173a['predictiveIntervalDroppedCallsTimeout']=_0x214edb[_0xbecf('0x44')];_0x22173a['predictiveIntervalErlangCalls']=_0x214edb[_0xbecf('0x45')];_0x22173a[_0xbecf('0x46')]=_0x214edb[_0xbecf('0x46')];_0x22173a[_0xbecf('0x47')]=_0x214edb[_0xbecf('0x47')];_0x22173a[_0xbecf('0x48')]=_0x214edb[_0xbecf('0x48')];_0x22173a[_0xbecf('0x49')]=_0x214edb[_0xbecf('0x49')];_0x22173a[_0xbecf('0x4a')]=_0x214edb[_0xbecf('0x4a')];_0x22173a[_0xbecf('0x4b')]=_0x214edb[_0xbecf('0x4b')];_0x22173a[_0xbecf('0x18')]=_0x214edb[_0xbecf('0x18')];_0x22173a[_0xbecf('0x4c')]=_0x214edb[_0xbecf('0x4c')];}if(_0x214edb[_0xbecf('0x4d')]){_0x22173a[_0xbecf('0x4d')]={'id':_0x214edb['Trunk']['id'],'name':_0x214edb[_0xbecf('0x4d')][_0xbecf('0xa')],'active':_0x214edb[_0xbecf('0x4d')][_0xbecf('0x4e')],'callerid':_0x214edb[_0xbecf('0x4d')]['callerid']};}if(_0x214edb['Interval']){_0x22173a['Interval']={'id':_0x214edb[_0xbecf('0x4f')]['id'],'name':_0x214edb[_0xbecf('0x4f')][_0xbecf('0xa')]};}_0x2e7ead[_0xbecf('0x50')](_0x22173a);}}_0x20d0bd({'count':_0x2e7ead[_0xbecf('0x51')],'rows':_0x2e7ead});});},'VoiceChannels':function(_0x4b70b4){return new Promise(function(_0x5ad850,_0x4bb473){var _0x193a9b=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x53')]);_0x5ad850({'count':_0x193a9b[_0xbecf('0x51')],'rows':_0x193a9b});});},'VoiceChannelMixMonitor':function(_0xf08b9e){var _0x3a7261=this;return new Promise(function(_0x4d902e,_0x13a06f){if(ami[_0xbecf('0x1a')]()==![]){return _0x13a06f(_0x3a7261[_0xbecf('0x19')](0x1f4,[config[_0xbecf('0x12')]['ip'],config[_0xbecf('0x12')][_0xbecf('0x13')],_0xbecf('0x14')][_0xbecf('0x1b')]('\x20')));}var _0x2cb44=schema(properties['voicechannel'])['validate'](_0xf08b9e);if(_0x2cb44['length']>0x0){return _0x13a06f(_0x3a7261[_0xbecf('0x19')](0x1f4,_[_0xbecf('0x54')](_0x2cb44,'message')[_0xbecf('0x1b')](',\x20')));}var _0x44481e=_[_0xbecf('0x55')](_0xf29afc[_0xbecf('0x53')],{'uniqueid':_0xf08b9e['uniqueid']});if(_0x44481e&&_0x44481e[_0xbecf('0x56')]){var _0x52bfce=util[_0xbecf('0x57')](_0xbecf('0x58'),_0xf08b9e[_0xbecf('0x59')]||_0xf08b9e[_0xbecf('0x5a')],_0xf08b9e[_0xbecf('0x57')]||'wav');return ami['Action']({'action':_0xbecf('0x5b'),'channel':_0x44481e[_0xbecf('0x56')],'file':_0x52bfce,'options':_0xbecf('0x5c')})[_0xbecf('0x17')](function(_0x45b316){var _0x1dc756=_[_0xbecf('0x55')](_0x44481e[_0xbecf('0x5d')],{'filename':'/var/spool/asterisk/monitor/'+_0x52bfce[_0xbecf('0x5e')]()});if(_[_0xbecf('0x5f')](_0x1dc756)){_0x44481e[_0xbecf('0x5d')][_0xbecf('0x50')]({'filename':_0xbecf('0x60')+_0x52bfce['toLowerCase'](),'createdAt':moment()[_0xbecf('0x57')](_0xbecf('0x61')),'mixmonitorid':_0x45b316[_0xbecf('0x62')],'status':'rec'});}else{_0x1dc756['mixmonitorid']=_0x45b316['mixmonitorid'];_0x1dc756[_0xbecf('0x63')]='rec';}_0x4d902e({'code':0xc8,'message':[_0xf08b9e[_0xbecf('0x5a')],'MixMonitor\x20Success',_0x45b316[_0xbecf('0x62')]][_0xbecf('0x1b')]('\x20'),'mixmonitorid':_0x45b316[_0xbecf('0x62')]});})['catch'](function(_0x2318bc){_0x13a06f(_0x3a7261[_0xbecf('0x19')](0x1f5,[_0xf08b9e[_0xbecf('0x5a')],_0x2318bc[_0xbecf('0x18')]['toLowerCase']()][_0xbecf('0x1b')]('\x20')));});}else{return _0x13a06f(_0x3a7261['error'](0x1f5,_0xbecf('0x64')));}});},'VoiceChannelStopMixMonitor':function(_0x5d3cf4){var _0x3d1c3f=this;return new Promise(function(_0x4235b3,_0x2c24ea){if(ami['isConnected']()==![]){return _0x2c24ea(_0x3d1c3f['error'](0x1f4,[config['asterisk']['ip'],config[_0xbecf('0x12')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x319f39=schema(properties['voicechannel'])['validate'](_0x5d3cf4);if(_0x319f39[_0xbecf('0x51')]>0x0){return _0x2c24ea(_0x3d1c3f[_0xbecf('0x19')](0x1f4,_[_0xbecf('0x54')](_0x319f39,_0xbecf('0x18'))[_0xbecf('0x1b')](',\x20')));}var _0x137bcc=_['find'](_0xf29afc[_0xbecf('0x53')],{'uniqueid':_0x5d3cf4['uniqueid']});if(_0x137bcc){return BPromise['resolve']()[_0xbecf('0x17')](function(){if(_0x137bcc[_0xbecf('0x56')]){return ami[_0xbecf('0x1e')]({'action':_0xbecf('0x65'),'channel':_0x137bcc['channel'],'mixmonitorid':_0x5d3cf4[_0xbecf('0x62')]})['catch'](function(_0x485f39){});}})[_0xbecf('0x17')](function(){if(_0x137bcc[_0xbecf('0x66')]){return ami[_0xbecf('0x1e')]({'action':_0xbecf('0x65'),'channel':_0x137bcc[_0xbecf('0x66')],'mixmonitorid':_0x5d3cf4[_0xbecf('0x62')]})[_0xbecf('0x67')](function(_0x2ebc3b){});}})['then'](function(_0x5628e7){var _0x38792d=_[_0xbecf('0x55')](_0x137bcc[_0xbecf('0x5d')],{'mixmonitorid':_0x5d3cf4[_0xbecf('0x62')]});if(_0x38792d){_0x38792d['status']='stop';}})[_0xbecf('0x17')](function(){var _0x1e6035=util[_0xbecf('0x57')]('%s.%s',_0x5d3cf4[_0xbecf('0x59')]||_0x5d3cf4[_0xbecf('0x5a')],_0x5d3cf4['format']||_0xbecf('0x68'));var _0x43503f=_[_0xbecf('0x55')](_0x137bcc[_0xbecf('0x5d')],{'filename':_0xbecf('0x60')+_0x1e6035[_0xbecf('0x5e')]()});if(_0x43503f){_0x43503f[_0xbecf('0x63')]=_0xbecf('0x69');}})['then'](function(){_0x4235b3({'code':0xc8,'message':[_0x5d3cf4[_0xbecf('0x5a')],'StopMixMonitor\x20Success'][_0xbecf('0x1b')]('\x20')});})['catch'](function(_0x6a63da){_0x2c24ea(_0x3d1c3f[_0xbecf('0x19')](0x1f5,[_0x5d3cf4[_0xbecf('0x5a')],_0x6a63da['message']['toLowerCase']()][_0xbecf('0x1b')]('\x20')));});}else{return _0x2c24ea(_0x3d1c3f[_0xbecf('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x57fc0c){return new Promise(function(_0x4a0ebb,_0x5cd894){var _0x45e97f=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x6a')]);_0x4a0ebb({'count':_0x45e97f[_0xbecf('0x51')],'rows':_0x45e97f});});},'VoiceQueuesChannel':function(_0x29c803){var _0x55e32b=this;return new Promise(function(_0x454faf,_0xa739e7){var _0x245dfe=schema(properties['voicequeuechannel'])[_0xbecf('0x6b')](_0x29c803);if(_0x245dfe['length']>0x0){return _0xa739e7(_0x55e32b[_0xbecf('0x19')](0x1f4,_['map'](_0x245dfe,_0xbecf('0x18'))[_0xbecf('0x1b')](',\x20')));}var _0x33d5fa=_[_0xbecf('0x55')](_0xf29afc[_0xbecf('0x6a')],{'uniqueid':_0x29c803[_0xbecf('0x5a')]});if(_0x33d5fa){_0x454faf(_0x33d5fa);}else{return _0xa739e7(_0x55e32b[_0xbecf('0x19')](0x1f5,_0xbecf('0x64')));}});},'VoiceQueuesChannelHangup':function(_0x239317){var _0x18bd64=this;return new Promise(function(_0x43f576,_0x2143c3){if(ami['isConnected']()==![]){return _0x2143c3(_0x18bd64['error'](0x1f4,[config[_0xbecf('0x12')]['ip'],config['asterisk'][_0xbecf('0x13')],_0xbecf('0x14')][_0xbecf('0x1b')]('\x20')));}var _0x4d4e68=schema(properties[_0xbecf('0x6c')])[_0xbecf('0x6b')](_0x239317);if(_0x4d4e68[_0xbecf('0x51')]>0x0){return _0x2143c3(_0x18bd64['error'](0x1f4,_[_0xbecf('0x54')](_0x4d4e68,'message')[_0xbecf('0x1b')](',\x20')));}var _0x44a457=_['find'](_0xf29afc['queueChannels'],{'uniqueid':_0x239317['uniqueid']});if(_0x44a457&&_0x44a457[_0xbecf('0x56')]){return ami[_0xbecf('0x1e')]({'action':_0xbecf('0x6d'),'channel':_0x44a457[_0xbecf('0x56')]})[_0xbecf('0x17')](function(_0x2a29bd){_0x43f576({'code':0xc8,'message':[_0x239317[_0xbecf('0x5a')],_0x2a29bd[_0xbecf('0x18')][_0xbecf('0x5e')]()][_0xbecf('0x1b')]('\x20')});})['catch'](function(_0x3526d6){_0x2143c3(_0x18bd64[_0xbecf('0x19')](0x1f5,[_0x239317[_0xbecf('0x5a')],_0x3526d6[_0xbecf('0x18')][_0xbecf('0x5e')]()]['join']('\x20')));});}else{return _0x2143c3(_0x18bd64[_0xbecf('0x19')](0x1f5,_0xbecf('0x64')));}});},'VoiceQueuesChannelRedirect':function(_0x9c1f04){var _0x485a7c=this;return new Promise(function(_0x5d887e,_0x5f2fb3){if(ami[_0xbecf('0x1a')]()==![]){return _0x5f2fb3(_0x485a7c[_0xbecf('0x19')](0x1f4,[config[_0xbecf('0x12')]['ip'],config[_0xbecf('0x12')][_0xbecf('0x13')],_0xbecf('0x14')][_0xbecf('0x1b')]('\x20')));}var _0x34ca0c=schema(properties['voicequeuechannelredirect'])[_0xbecf('0x6b')](_0x9c1f04);if(_0x34ca0c['length']>0x0){return _0x5f2fb3(_0x485a7c[_0xbecf('0x19')](0x1f4,_[_0xbecf('0x54')](_0x34ca0c,_0xbecf('0x18'))[_0xbecf('0x1b')](',\x20')));}var _0x53dfd6=_[_0xbecf('0x55')](_0xf29afc[_0xbecf('0x6a')],{'uniqueid':_0x9c1f04[_0xbecf('0x5a')]});if(_0x53dfd6&&_0x53dfd6['channel']){return ami[_0xbecf('0x1e')]({'action':_0xbecf('0x6e'),'channel':_0x53dfd6[_0xbecf('0x56')],'exten':_0x9c1f04[_0xbecf('0x6f')],'context':_0x9c1f04[_0xbecf('0x70')]||_0x53dfd6['context'],'priority':0x1})[_0xbecf('0x17')](function(_0x51fc44){_0x5d887e({'code':0xc8,'message':[_0x9c1f04['uniqueid'],_0x51fc44[_0xbecf('0x18')][_0xbecf('0x5e')]()][_0xbecf('0x1b')]('\x20')});})['catch'](function(_0x14829e){_0x5f2fb3(_0x485a7c[_0xbecf('0x19')](0x1f5,[_0x9c1f04['uniqueid'],_0x14829e[_0xbecf('0x18')][_0xbecf('0x5e')]()][_0xbecf('0x1b')]('\x20')));});}else{return _0x5f2fb3(_0x485a7c['error'](0x1f5,_0xbecf('0x64')));}});},'Agents':function(_0x5f0e92){return new Promise(function(_0x2b9d8d,_0x59353a){var _0xb6814b=_['values'](_0xf29afc[_0xbecf('0xe')]);_0x2b9d8d({'count':_0xb6814b['length'],'rows':_0xb6814b});});},'Telephones':function(_0xe7a716){return new Promise(function(_0x56201b,_0x20cd07){var _0x4755cb=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x71')]);_0x56201b({'count':_0x4755cb[_0xbecf('0x51')],'rows':_0x4755cb});});},'Trunks':function(_0x2d9014){return new Promise(function(_0x19f29a,_0xe2ffc3){var _0x4bf11d=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x72')]);_0x19f29a({'count':_0x4bf11d[_0xbecf('0x51')],'rows':_0x4bf11d});});},'OutboundChannels':function(_0x1a3f7c){return new Promise(function(_0x573403,_0x431224){var _0x652713=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x73')]);_0x573403({'count':_0x652713['length'],'rows':_0x652713});});},'Outbound':function(_0x37db3a){return new Promise(function(_0x49b2de,_0x35cc1d){_0x49b2de(_0xf29afc['outbound']);});},'Campaigns':function(_0x58d684){return new Promise(function(_0x202e49,_0x2e77e7){var _0x11a557=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x74')]);_0x202e49({'count':_0x11a557['length'],'rows':_0x11a557});});},'VoiceQueuesPreview':function(_0xf29fee){var _0x1af7ab=this;return new Promise(function(_0x5c72ec,_0x28d637){_0x5b11bf['run'](_0xf29fee['id'])['then'](function(_0x20de3f){_0x5c72ec({'code':0xc8,'message':_0x20de3f['message']});})['catch'](function(_0x280059){_0x28d637(_0x1af7ab[_0xbecf('0x19')](0x1f4,_0x280059[_0xbecf('0x18')]));});});},'EventManager':function(_0x3fc73d){var _0x529654=this;return new Promise(function(_0x5b7461,_0x304a47){if(!_0x3fc73d[_0xbecf('0x75')]){return _0x304a47(_0x529654[_0xbecf('0x19')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xbecf('0x76')]('custom:'+_0x3fc73d[_0xbecf('0x75')],_0x3fc73d[_0xbecf('0x18')]);_0x5b7461({'code':0xc8,'message':_0x3fc73d});});},'FaxAccounts':function(_0x50a110){return new Promise(function(_0x348c54,_0x1379ea){var _0x4675b5=_[_0xbecf('0x52')](_0xf29afc[_0xbecf('0x77')]);_0x348c54({'count':_0x4675b5[_0xbecf('0x51')],'rows':_0x4675b5});});},'SendFax':function(_0x2e49a2){var _0x46711f=this;return new Promise(function(_0x589b8e,_0x4ecd31){_0x4a2d20['send'](_0x2e49a2)[_0xbecf('0x17')](function(_0x147aab){_0x589b8e({'code':0xc8,'message':_0x147aab[_0xbecf('0x18')]});})[_0xbecf('0x67')](function(_0x1c5fcc){_0x4ecd31(_0x46711f['error'](0x1f4,_0x1c5fcc[_0xbecf('0x18')]));});});},'CheckAfterSend':function(_0xa45a16){var _0x43a15a=this;return new Promise(function(_0xa20419,_0x4ff9a8){_0x4a2d20[_0xbecf('0x78')](_0xa45a16)['then'](function(_0x2aa839){_0xa20419({'code':0xc8,'message':_0x2aa839['message']});})['catch'](function(_0x1e2971){_0x4ff9a8(_0x43a15a['error'](0x1f4,_0x1e2971[_0xbecf('0x18')]));});});}};var _0x3b42be=jayson['server'](_0x1633fd)[_0xbecf('0x79')]();_0x3b42be['on'](_0xbecf('0x19'),function(_0x58b7ce){return _0x30b58b(_0x58b7ce);});_0x3b42be[_0xbecf('0x7')](0x232a,'127.0.0.1',function(){console[_0xbecf('0x7a')](_0xbecf('0x7b'),0x232a);return _0x3f55c3(_0xbecf('0x7c')+0x232a);});});}; \ No newline at end of file +var _0x4c9f=['error','asterisk','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumBillable','talking','total','abandoned','waiting','loggedInDb','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','Interval','length','values','channels','voicechannel','map','find','channel','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','push','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','%s.%s','stop','StopMixMonitor\x20Success','voicequeuechannel','voicequeuechannelhangup','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','outbound','campaigns','run','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','username','ami\x20disconnected','join','pick','keys','module','Reload','Action','then','message','catch'];(function(_0xfd1e64,_0x15dccb){var _0x1d9568=function(_0x1f4ba6){while(--_0x1f4ba6){_0xfd1e64['push'](_0xfd1e64['shift']());}};_0x1d9568(++_0x15dccb);}(_0x4c9f,0x1f4));var _0xf4c9=function(_0x27c205,_0x57413c){_0x27c205=_0x27c205-0x0;var _0x31c8e3=_0x4c9f[_0x27c205];return _0x31c8e3;};'use strict';var _=require(_0xf4c9('0x0'));var util=require(_0xf4c9('0x1'));var jayson=require(_0xf4c9('0x2'));var schema=require(_0xf4c9('0x3'));var BPromise=require(_0xf4c9('0x4'));var moment=require(_0xf4c9('0x5'));var config=require(_0xf4c9('0x6'));var properties=require(_0xf4c9('0x7'));var ami=require(_0xf4c9('0x8'));exports[_0xf4c9('0x9')]=function(_0x1f180a,_0x485e5a,_0x25e276){return new BPromise(function(_0x240f61,_0x533587){var _0x424aed={'QueuePause':function(_0x2d3682){return new Promise(function(_0x16aed0,_0x3c14c6){var _0x360edb=util[_0xf4c9('0xa')](_0xf4c9('0xb'),_0xf4c9('0xc'),_0x2d3682[_0xf4c9('0xd')]);if(_0x1f180a[_0xf4c9('0xe')]&&_0x1f180a[_0xf4c9('0xe')][_0x360edb]&&_0x1f180a[_0xf4c9('0xe')][_0x360edb][_0xf4c9('0xf')]){_0x1f180a[_0xf4c9('0xe')][_0x360edb]['updateAcw']();}if(_0x1f180a['agents'][_0x360edb]){_0x1f180a[_0xf4c9('0x10')][_0x360edb][_0xf4c9('0x11')]({'statePause':_0x2d3682[_0xf4c9('0x12')]?!![]:![]});}_0x16aed0({'code':0xc8,'message':_0xf4c9('0x13')});});},'Reload':function(_0x4f112f){var _0x445817=this;return new Promise(function(_0x5f1613,_0x5ee32d){if(ami[_0xf4c9('0x14')]()==![]){return _0x5ee32d(_0x445817['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xf4c9('0x15')],_0xf4c9('0x16')][_0xf4c9('0x17')]('\x20')));}_0x4f112f=_[_0xf4c9('0x18')](_0x4f112f,_[_0xf4c9('0x19')](properties[_0xf4c9('0x1a')]));_0x4f112f['action']=_0xf4c9('0x1b');return ami[_0xf4c9('0x1c')](_0x4f112f)[_0xf4c9('0x1d')](function(_0x3f3024){_0x5f1613({'code':0xc8,'message':_0x3f3024[_0xf4c9('0x1e')]});})[_0xf4c9('0x1f')](function(_0x2bf12c){_0x5ee32d(_0x445817['error'](0x1f5,_0x2bf12c[_0xf4c9('0x1e')]));});});},'Command':function(_0x5a4af5){var _0x5e2e8f=this;return new Promise(function(_0x3e5fdd,_0x2af0ac){if(ami['isConnected']()==![]){return _0x2af0ac(_0x5e2e8f[_0xf4c9('0x20')](0x1f4,[config[_0xf4c9('0x21')]['ip'],config['asterisk']['username'],_0xf4c9('0x16')][_0xf4c9('0x17')]('\x20')));}_0x5a4af5=_[_0xf4c9('0x18')](_0x5a4af5,_0xf4c9('0x22'));_0x5a4af5['action']=_0xf4c9('0x23');return ami['Action'](_0x5a4af5)[_0xf4c9('0x1d')](function(_0x1ba056){_0x3e5fdd({'code':0xc8,'message':_0x1ba056[_0xf4c9('0x24')]});})['catch'](function(_0x111465){_0x2af0ac(_0x5e2e8f['error'](0x1f5,_0x111465[_0xf4c9('0x1e')]));});});},'VoiceQueues':function(_0xdb020d){return new Promise(function(_0x33934d,_0x15c58f){var _0x1ecbaa=[];for(var _0x6b80d7 in _0x1f180a[_0xf4c9('0x25')]){if(_0x1f180a['voiceQueues'][_0xf4c9('0x26')](_0x6b80d7)){var _0x1ae536=_0x1f180a[_0xf4c9('0x25')][_0x6b80d7];var _0x10269c={'id':_0x1ae536['id'],'name':_0x1ae536['name'],'strategy':_0x1ae536[_0xf4c9('0x27')],'answered':_0x1ae536[_0xf4c9('0x28')],'available':_0x1ae536['available'],'loggedIn':_0x1ae536[_0xf4c9('0x29')],'pTalking':_0x1ae536[_0xf4c9('0x2a')],'sumBillable':_0x1ae536[_0xf4c9('0x2b')],'sumDuration':_0x1ae536['sumDuration'],'sumHoldTime':_0x1ae536['sumHoldTime']||0x0,'talking':_0x1ae536[_0xf4c9('0x2c')],'total':_0x1ae536[_0xf4c9('0x2d')],'type':_0x1ae536['type'],'unmanaged':_0x1ae536['unmanaged'],'abandoned':_0x1ae536[_0xf4c9('0x2e')],'waiting':_0x1ae536[_0xf4c9('0x2f')],'loggedInDb':_0x1ae536[_0xf4c9('0x30')]};if(_0x1ae536[_0xf4c9('0x31')]==='outbound'){_0x10269c[_0xf4c9('0x32')]=_0x1ae536['dialActive'];_0x10269c[_0xf4c9('0x33')]=_0x1ae536[_0xf4c9('0x33')];_0x10269c[_0xf4c9('0x34')]=_0x1ae536[_0xf4c9('0x34')];_0x10269c[_0xf4c9('0x35')]=_0x1ae536[_0xf4c9('0x35')];_0x10269c[_0xf4c9('0x36')]=_0x1ae536[_0xf4c9('0x36')];_0x10269c[_0xf4c9('0x37')]=_0x1ae536[_0xf4c9('0x37')];_0x10269c[_0xf4c9('0x38')]=_0x1ae536[_0xf4c9('0x38')];_0x10269c[_0xf4c9('0x39')]=_0x1ae536['outboundAnswerCallsDay'];_0x10269c[_0xf4c9('0x3a')]=_0x1ae536[_0xf4c9('0x3a')];_0x10269c[_0xf4c9('0x3b')]=_0x1ae536[_0xf4c9('0x3b')];_0x10269c['outboundCongestionCallsDay']=_0x1ae536[_0xf4c9('0x3c')];_0x10269c[_0xf4c9('0x3d')]=_0x1ae536[_0xf4c9('0x3d')];_0x10269c[_0xf4c9('0x3e')]=_0x1ae536[_0xf4c9('0x3e')];_0x10269c['outboundDropCallsDayTimeout']=_0x1ae536[_0xf4c9('0x3f')];_0x10269c[_0xf4c9('0x40')]=_0x1ae536[_0xf4c9('0x40')];_0x10269c['outboundNoSuchCallsDay']=_0x1ae536['outboundNoSuchCallsDay'];_0x10269c[_0xf4c9('0x41')]=_0x1ae536[_0xf4c9('0x41')];_0x10269c['outboundReCallsDay']=_0x1ae536[_0xf4c9('0x42')];_0x10269c['outboundRejectCallsDay']=_0x1ae536[_0xf4c9('0x43')];_0x10269c[_0xf4c9('0x44')]=_0x1ae536[_0xf4c9('0x44')];_0x10269c[_0xf4c9('0x45')]=_0x1ae536[_0xf4c9('0x45')];_0x10269c['predictiveIntervalAvgHoldtime']=_0x1ae536[_0xf4c9('0x46')];_0x10269c['predictiveIntervalAvgTalktime']=_0x1ae536[_0xf4c9('0x47')];_0x10269c[_0xf4c9('0x48')]=_0x1ae536['predictiveIntervalDroppedCallsCallersExit'];_0x10269c['predictiveIntervalDroppedCallsTimeout']=_0x1ae536[_0xf4c9('0x49')];_0x10269c['predictiveIntervalErlangCalls']=_0x1ae536[_0xf4c9('0x4a')];_0x10269c[_0xf4c9('0x4b')]=_0x1ae536[_0xf4c9('0x4b')];_0x10269c[_0xf4c9('0x4c')]=_0x1ae536[_0xf4c9('0x4c')];_0x10269c[_0xf4c9('0x4d')]=_0x1ae536['predictiveIntervalLowerLimit'];_0x10269c[_0xf4c9('0x4e')]=_0x1ae536[_0xf4c9('0x4e')];_0x10269c[_0xf4c9('0x4f')]=_0x1ae536[_0xf4c9('0x4f')];_0x10269c['predictiveIntervalTotalCalls']=_0x1ae536[_0xf4c9('0x50')];_0x10269c[_0xf4c9('0x1e')]=_0x1ae536[_0xf4c9('0x1e')];_0x10269c[_0xf4c9('0x51')]=_0x1ae536[_0xf4c9('0x51')];}if(_0x1ae536[_0xf4c9('0x52')]){_0x10269c[_0xf4c9('0x52')]={'id':_0x1ae536[_0xf4c9('0x52')]['id'],'name':_0x1ae536[_0xf4c9('0x52')]['name'],'active':_0x1ae536[_0xf4c9('0x52')][_0xf4c9('0x53')],'callerid':_0x1ae536[_0xf4c9('0x52')]['callerid']};}if(_0x1ae536[_0xf4c9('0x54')]){_0x10269c['Interval']={'id':_0x1ae536[_0xf4c9('0x54')]['id'],'name':_0x1ae536[_0xf4c9('0x54')][_0xf4c9('0xd')]};}_0x1ecbaa['push'](_0x10269c);}}_0x33934d({'count':_0x1ecbaa[_0xf4c9('0x55')],'rows':_0x1ecbaa});});},'VoiceChannels':function(_0x1f4654){return new Promise(function(_0x214c62,_0x3095e3){var _0x57b419=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x57')]);_0x214c62({'count':_0x57b419[_0xf4c9('0x55')],'rows':_0x57b419});});},'VoiceChannelMixMonitor':function(_0x4e7742){var _0x749a41=this;return new Promise(function(_0x523eeb,_0x37f4fd){if(ami[_0xf4c9('0x14')]()==![]){return _0x37f4fd(_0x749a41[_0xf4c9('0x20')](0x1f4,[config['asterisk']['ip'],config[_0xf4c9('0x21')][_0xf4c9('0x15')],_0xf4c9('0x16')][_0xf4c9('0x17')]('\x20')));}var _0x3d2a9e=schema(properties[_0xf4c9('0x58')])['validate'](_0x4e7742);if(_0x3d2a9e[_0xf4c9('0x55')]>0x0){return _0x37f4fd(_0x749a41['error'](0x1f4,_[_0xf4c9('0x59')](_0x3d2a9e,'message')[_0xf4c9('0x17')](',\x20')));}var _0x3d8013=_[_0xf4c9('0x5a')](_0x1f180a['channels'],{'uniqueid':_0x4e7742['uniqueid']});if(_0x3d8013&&_0x3d8013[_0xf4c9('0x5b')]){var _0x200356=util[_0xf4c9('0xa')]('%s.%s',_0x4e7742[_0xf4c9('0x5c')]||_0x4e7742[_0xf4c9('0x5d')],_0x4e7742[_0xf4c9('0xa')]||_0xf4c9('0x5e'));return ami[_0xf4c9('0x1c')]({'action':_0xf4c9('0x5f'),'channel':_0x3d8013[_0xf4c9('0x5b')],'file':_0x200356,'options':_0xf4c9('0x60')})[_0xf4c9('0x1d')](function(_0x5e185e){var _0x5ed47c=_[_0xf4c9('0x5a')](_0x3d8013['monitors'],{'filename':_0xf4c9('0x61')+_0x200356[_0xf4c9('0x62')]()});if(_[_0xf4c9('0x63')](_0x5ed47c)){_0x3d8013[_0xf4c9('0x64')][_0xf4c9('0x65')]({'filename':_0xf4c9('0x61')+_0x200356[_0xf4c9('0x62')](),'createdAt':moment()[_0xf4c9('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5e185e[_0xf4c9('0x66')],'status':_0xf4c9('0x67')});}else{_0x5ed47c['mixmonitorid']=_0x5e185e[_0xf4c9('0x66')];_0x5ed47c[_0xf4c9('0x68')]='rec';}_0x523eeb({'code':0xc8,'message':[_0x4e7742[_0xf4c9('0x5d')],'MixMonitor\x20Success',_0x5e185e['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x5e185e[_0xf4c9('0x66')]});})['catch'](function(_0x1eeeb2){_0x37f4fd(_0x749a41['error'](0x1f5,[_0x4e7742[_0xf4c9('0x5d')],_0x1eeeb2['message'][_0xf4c9('0x62')]()][_0xf4c9('0x17')]('\x20')));});}else{return _0x37f4fd(_0x749a41[_0xf4c9('0x20')](0x1f5,_0xf4c9('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x1e629c){var _0x34636c=this;return new Promise(function(_0x313456,_0x3c277b){if(ami[_0xf4c9('0x14')]()==![]){return _0x3c277b(_0x34636c[_0xf4c9('0x20')](0x1f4,[config['asterisk']['ip'],config[_0xf4c9('0x21')][_0xf4c9('0x15')],_0xf4c9('0x16')][_0xf4c9('0x17')]('\x20')));}var _0x147ccf=schema(properties[_0xf4c9('0x58')])['validate'](_0x1e629c);if(_0x147ccf[_0xf4c9('0x55')]>0x0){return _0x3c277b(_0x34636c['error'](0x1f4,_[_0xf4c9('0x59')](_0x147ccf,_0xf4c9('0x1e'))[_0xf4c9('0x17')](',\x20')));}var _0x561ff6=_[_0xf4c9('0x5a')](_0x1f180a[_0xf4c9('0x57')],{'uniqueid':_0x1e629c[_0xf4c9('0x5d')]});if(_0x561ff6){return BPromise[_0xf4c9('0x6a')]()[_0xf4c9('0x1d')](function(){if(_0x561ff6[_0xf4c9('0x5b')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x561ff6[_0xf4c9('0x5b')],'mixmonitorid':_0x1e629c[_0xf4c9('0x66')]})[_0xf4c9('0x1f')](function(_0x2f110e){});}})[_0xf4c9('0x1d')](function(){if(_0x561ff6[_0xf4c9('0x6b')]){return ami[_0xf4c9('0x1c')]({'action':'StopMixMonitor','channel':_0x561ff6['destinationchannel'],'mixmonitorid':_0x1e629c['mixmonitorid']})[_0xf4c9('0x1f')](function(_0x52a7d0){});}})[_0xf4c9('0x1d')](function(_0x31ebda){var _0x237f46=_[_0xf4c9('0x5a')](_0x561ff6['monitors'],{'mixmonitorid':_0x1e629c[_0xf4c9('0x66')]});if(_0x237f46){_0x237f46[_0xf4c9('0x68')]='stop';}})[_0xf4c9('0x1d')](function(){var _0x53b9c2=util[_0xf4c9('0xa')](_0xf4c9('0x6c'),_0x1e629c['filename']||_0x1e629c[_0xf4c9('0x5d')],_0x1e629c[_0xf4c9('0xa')]||_0xf4c9('0x5e'));var _0xec4a99=_[_0xf4c9('0x5a')](_0x561ff6[_0xf4c9('0x64')],{'filename':_0xf4c9('0x61')+_0x53b9c2[_0xf4c9('0x62')]()});if(_0xec4a99){_0xec4a99[_0xf4c9('0x68')]=_0xf4c9('0x6d');}})[_0xf4c9('0x1d')](function(){_0x313456({'code':0xc8,'message':[_0x1e629c[_0xf4c9('0x5d')],_0xf4c9('0x6e')]['join']('\x20')});})[_0xf4c9('0x1f')](function(_0x2c7a71){_0x3c277b(_0x34636c[_0xf4c9('0x20')](0x1f5,[_0x1e629c[_0xf4c9('0x5d')],_0x2c7a71[_0xf4c9('0x1e')][_0xf4c9('0x62')]()][_0xf4c9('0x17')]('\x20')));});}else{return _0x3c277b(_0x34636c[_0xf4c9('0x20')](0x1f5,_0xf4c9('0x69')));}});},'VoiceQueuesChannels':function(_0x5b5673){return new Promise(function(_0x20889d,_0x304203){var _0x1629d7=_[_0xf4c9('0x56')](_0x1f180a['queueChannels']);_0x20889d({'count':_0x1629d7[_0xf4c9('0x55')],'rows':_0x1629d7});});},'VoiceQueuesChannel':function(_0x1fa6b9){var _0x248f2a=this;return new Promise(function(_0x1d2a1c,_0x3d8385){var _0x52d01a=schema(properties[_0xf4c9('0x6f')])[_0xf4c9('0x3')](_0x1fa6b9);if(_0x52d01a[_0xf4c9('0x55')]>0x0){return _0x3d8385(_0x248f2a[_0xf4c9('0x20')](0x1f4,_[_0xf4c9('0x59')](_0x52d01a,_0xf4c9('0x1e'))[_0xf4c9('0x17')](',\x20')));}var _0x4be5da=_[_0xf4c9('0x5a')](_0x1f180a['queueChannels'],{'uniqueid':_0x1fa6b9['uniqueid']});if(_0x4be5da){_0x1d2a1c(_0x4be5da);}else{return _0x3d8385(_0x248f2a[_0xf4c9('0x20')](0x1f5,_0xf4c9('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x41777e){var _0x195be2=this;return new Promise(function(_0x4c0f1b,_0x1268b5){if(ami[_0xf4c9('0x14')]()==![]){return _0x1268b5(_0x195be2[_0xf4c9('0x20')](0x1f4,[config[_0xf4c9('0x21')]['ip'],config[_0xf4c9('0x21')]['username'],_0xf4c9('0x16')][_0xf4c9('0x17')]('\x20')));}var _0xeee2f9=schema(properties[_0xf4c9('0x70')])[_0xf4c9('0x3')](_0x41777e);if(_0xeee2f9[_0xf4c9('0x55')]>0x0){return _0x1268b5(_0x195be2['error'](0x1f4,_[_0xf4c9('0x59')](_0xeee2f9,_0xf4c9('0x1e'))['join'](',\x20')));}var _0x239d95=_[_0xf4c9('0x5a')](_0x1f180a[_0xf4c9('0x71')],{'uniqueid':_0x41777e[_0xf4c9('0x5d')]});if(_0x239d95&&_0x239d95['channel']){return ami[_0xf4c9('0x1c')]({'action':_0xf4c9('0x72'),'channel':_0x239d95['channel']})[_0xf4c9('0x1d')](function(_0x18bf34){_0x4c0f1b({'code':0xc8,'message':[_0x41777e['uniqueid'],_0x18bf34[_0xf4c9('0x1e')]['toLowerCase']()][_0xf4c9('0x17')]('\x20')});})[_0xf4c9('0x1f')](function(_0x2afc43){_0x1268b5(_0x195be2[_0xf4c9('0x20')](0x1f5,[_0x41777e['uniqueid'],_0x2afc43['message']['toLowerCase']()][_0xf4c9('0x17')]('\x20')));});}else{return _0x1268b5(_0x195be2[_0xf4c9('0x20')](0x1f5,_0xf4c9('0x69')));}});},'VoiceQueuesChannelRedirect':function(_0x30a4cb){var _0x20cb2a=this;return new Promise(function(_0x384eb5,_0x291a6e){if(ami[_0xf4c9('0x14')]()==![]){return _0x291a6e(_0x20cb2a['error'](0x1f4,[config[_0xf4c9('0x21')]['ip'],config['asterisk'][_0xf4c9('0x15')],_0xf4c9('0x16')]['join']('\x20')));}var _0x1f38a3=schema(properties[_0xf4c9('0x73')])[_0xf4c9('0x3')](_0x30a4cb);if(_0x1f38a3[_0xf4c9('0x55')]>0x0){return _0x291a6e(_0x20cb2a[_0xf4c9('0x20')](0x1f4,_[_0xf4c9('0x59')](_0x1f38a3,_0xf4c9('0x1e'))[_0xf4c9('0x17')](',\x20')));}var _0x20da17=_[_0xf4c9('0x5a')](_0x1f180a[_0xf4c9('0x71')],{'uniqueid':_0x30a4cb[_0xf4c9('0x5d')]});if(_0x20da17&&_0x20da17[_0xf4c9('0x5b')]){return ami[_0xf4c9('0x1c')]({'action':_0xf4c9('0x74'),'channel':_0x20da17['channel'],'exten':_0x30a4cb[_0xf4c9('0x75')],'context':_0x30a4cb[_0xf4c9('0x76')]||_0x20da17[_0xf4c9('0x76')],'priority':0x1})['then'](function(_0x1caf6c){_0x384eb5({'code':0xc8,'message':[_0x30a4cb[_0xf4c9('0x5d')],_0x1caf6c[_0xf4c9('0x1e')][_0xf4c9('0x62')]()][_0xf4c9('0x17')]('\x20')});})[_0xf4c9('0x1f')](function(_0x2841c4){_0x291a6e(_0x20cb2a[_0xf4c9('0x20')](0x1f5,[_0x30a4cb[_0xf4c9('0x5d')],_0x2841c4[_0xf4c9('0x1e')]['toLowerCase']()]['join']('\x20')));});}else{return _0x291a6e(_0x20cb2a[_0xf4c9('0x20')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x15607c){return new Promise(function(_0x426f82,_0x231518){var _0x37c19e=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x10')]);_0x426f82({'count':_0x37c19e[_0xf4c9('0x55')],'rows':_0x37c19e});});},'Telephones':function(_0x58654d){return new Promise(function(_0x3bac49,_0x250735){var _0x32a735=_['values'](_0x1f180a['telephones']);_0x3bac49({'count':_0x32a735[_0xf4c9('0x55')],'rows':_0x32a735});});},'Trunks':function(_0x52f457){return new Promise(function(_0xc4ae42,_0x23aa81){var _0x418791=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x77')]);_0xc4ae42({'count':_0x418791[_0xf4c9('0x55')],'rows':_0x418791});});},'OutboundChannels':function(_0x3da3ae){return new Promise(function(_0x17622f,_0x121403){var _0x297be1=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x78')]);_0x17622f({'count':_0x297be1['length'],'rows':_0x297be1});});},'Outbound':function(_0x3cbd59){return new Promise(function(_0x5ebc37,_0x2bf56a){_0x5ebc37(_0x1f180a[_0xf4c9('0x79')]);});},'Campaigns':function(_0x32e12a){return new Promise(function(_0x5a4afb,_0x123809){var _0x56f9c1=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x7a')]);_0x5a4afb({'count':_0x56f9c1['length'],'rows':_0x56f9c1});});},'VoiceQueuesPreview':function(_0x27acb2){var _0x574cf2=this;return new Promise(function(_0x39dc0e,_0x37cf11){_0x485e5a[_0xf4c9('0x7b')](_0x27acb2['id'])[_0xf4c9('0x1d')](function(_0x361443){_0x39dc0e({'code':0xc8,'message':_0x361443[_0xf4c9('0x1e')]});})[_0xf4c9('0x1f')](function(_0x16fbef){_0x37cf11(_0x574cf2[_0xf4c9('0x20')](0x1f4,_0x16fbef['message']));});});},'EventManager':function(_0x4b7cd2){var _0x305223=this;return new Promise(function(_0x5a9805,_0x1a3089){if(!_0x4b7cd2['event']){return _0x1a3089(_0x305223[_0xf4c9('0x20')](0x1f4,_0xf4c9('0x7c')));}ami['emit'](_0xf4c9('0x7d')+_0x4b7cd2['event'],_0x4b7cd2[_0xf4c9('0x1e')]);_0x5a9805({'code':0xc8,'message':_0x4b7cd2});});},'FaxAccounts':function(_0x419236){return new Promise(function(_0x13fdb9,_0x540965){var _0x58e551=_[_0xf4c9('0x56')](_0x1f180a[_0xf4c9('0x7e')]);_0x13fdb9({'count':_0x58e551['length'],'rows':_0x58e551});});},'SendFax':function(_0x2b4eb1){var _0x2dee88=this;return new Promise(function(_0x218072,_0x46bb50){_0x25e276[_0xf4c9('0x7f')](_0x2b4eb1)['then'](function(_0x1bdefe){_0x218072({'code':0xc8,'message':_0x1bdefe['message']});})[_0xf4c9('0x1f')](function(_0x2bf462){_0x46bb50(_0x2dee88[_0xf4c9('0x20')](0x1f4,_0x2bf462[_0xf4c9('0x1e')]));});});},'CheckAfterSend':function(_0x16e3a3){var _0x4dacad=this;return new Promise(function(_0x29dd31,_0x4f4924){_0x25e276[_0xf4c9('0x80')](_0x16e3a3)['then'](function(_0x312dfe){_0x29dd31({'code':0xc8,'message':_0x312dfe[_0xf4c9('0x1e')]});})[_0xf4c9('0x1f')](function(_0x13d34f){_0x4f4924(_0x4dacad[_0xf4c9('0x20')](0x1f4,_0x13d34f[_0xf4c9('0x1e')]));});});}};var _0x2babf3=jayson[_0xf4c9('0x81')](_0x424aed)[_0xf4c9('0x82')]();_0x2babf3['on'](_0xf4c9('0x20'),function(_0x238309){return _0x533587(_0x238309);});_0x2babf3[_0xf4c9('0x9')](0x232a,'127.0.0.1',function(){console[_0xf4c9('0x83')](_0xf4c9('0x84'),0x232a);return _0x240f61('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 64d034d..10e0b94 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 _0x5c3c=['bluebird','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','resolve','then','xmd-contactid2','format','user:%s','name','merge','createContact','trigger:%s','action','catch','Error\x20creating\x20contact','stringify'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x5c3c,0x94));var _0xc5c3=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x5c3c[_0x24259d];return _0x5a701;};'use strict';var BPromise=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var _=require(_0xc5c3('0x2'));var Redis=require(_0xc5c3('0x3'));var config=require(_0xc5c3('0x4'));var logger=require(_0xc5c3('0x5'))(_0xc5c3('0x6'));var cmContactRpc=require(_0xc5c3('0x7'));config[_0xc5c3('0x8')]=_['defaults'](config[_0xc5c3('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xc5c3('0x9'))(new Redis(config[_0xc5c3('0x8')]));function emit(_0x4b9d4b,_0x5e38d0,_0xee1c4a){logger[_0xc5c3('0xa')](_0x4b9d4b,_0x5e38d0,JSON['stringify'](_0xee1c4a));io['to'](_0x4b9d4b)['emit'](_0x5e38d0,_0xee1c4a);}exports[_0xc5c3('0xb')]=function(_0x83b35e,_0xaf929d,_0x2d936a){_0x2d936a[_0xc5c3('0xc')]=0x0;if(_0xaf929d[_0xc5c3('0xd')]&&parseInt(_0xaf929d[_0xc5c3('0xd')],0xa)){var _0x385e0e={'ListId':parseInt(_0xaf929d[_0xc5c3('0xe')],0xa),'phone':_0x2d936a[_0xc5c3('0xf')]};if(_[_0xc5c3('0x10')](_0x2d936a[_0xc5c3('0x11')])){_0x385e0e[_0xc5c3('0x12')]=_0x2d936a['calleridname']&&_0x2d936a[_0xc5c3('0x13')]!==_0xc5c3('0x14')?_0x2d936a['calleridname']:_0x2d936a[_0xc5c3('0xf')]||_0x2d936a[_0xc5c3('0x15')];}else{_0x385e0e['firstName']=_0x2d936a[_0xc5c3('0x16')]&&_0x2d936a[_0xc5c3('0x16')]!==_0xc5c3('0x14')?_0x2d936a[_0xc5c3('0x16')]:_0x2d936a[_0xc5c3('0x17')]||_0x2d936a[_0xc5c3('0x15')];_0x385e0e['phone']=_0x2d936a['destcalleridname']&&_0x2d936a['destcalleridname']!==_0xc5c3('0x14')?_0x2d936a['destcalleridname']:_0x2d936a[_0xc5c3('0x17')]||_0x2d936a['uniqueid'];}BPromise[_0xc5c3('0x18')]()[_0xc5c3('0x19')](cmContactRpc['showContact']({'where':_['omit'](_0x385e0e,[_0xc5c3('0x12')])}))[_0xc5c3('0x19')](function(_0x5722d4){if(_0x5722d4){_0x2d936a[_0xc5c3('0x1a')]=_0x5722d4['id'];emit(util[_0xc5c3('0x1b')](_0xc5c3('0x1c'),_0x83b35e[_0xc5c3('0x1d')]),util[_0xc5c3('0x1b')]('trigger:%s',_0xaf929d['action']['toLowerCase']()),_[_0xc5c3('0x1e')](_0x2d936a,{'ListId':parseInt(_0xaf929d[_0xc5c3('0xe')],0xa)}));return;}else{return BPromise[_0xc5c3('0x18')]()[_0xc5c3('0x19')](cmContactRpc[_0xc5c3('0x1f')](_0x385e0e));}})[_0xc5c3('0x19')](function(_0x54a92c){if(_0x54a92c){_0x2d936a[_0xc5c3('0x1a')]=_0x54a92c['id'];emit(util[_0xc5c3('0x1b')](_0xc5c3('0x1c'),_0x83b35e['name']),util[_0xc5c3('0x1b')](_0xc5c3('0x20'),_0xaf929d[_0xc5c3('0x21')]['toLowerCase']()),_[_0xc5c3('0x1e')](_0x2d936a,{'ListId':parseInt(_0xaf929d['data1'],0xa)}));}})[_0xc5c3('0x22')](function(_0x48d941){logger['error'](_0xc5c3('0x23'),JSON[_0xc5c3('0x24')](_0x48d941));});}else{if(_0x83b35e){emit(util['format'](_0xc5c3('0x1c'),_0x83b35e[_0xc5c3('0x1d')]),util[_0xc5c3('0x1b')](_0xc5c3('0x20'),_0xaf929d[_0xc5c3('0x21')]['toLowerCase']()),_['merge']({'ListId':parseInt(_0xaf929d[_0xc5c3('0xe')],0xa)},_0x2d936a));}}}; \ No newline at end of file +var _0x6bd7=['stringify','emit','exec','autoCreate','data2','data1','isNil','firstName','calleridname','','calleridnum','destcalleridname','destcalleridnum','uniqueid','resolve','showContact','omit','then','format','trigger:%s','action','toLowerCase','merge','createContact','xmd-contactid2','name','error','user:%s','bluebird','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info'];(function(_0x453862,_0xd3bb4c){var _0x17508a=function(_0x172b7e){while(--_0x172b7e){_0x453862['push'](_0x453862['shift']());}};_0x17508a(++_0xd3bb4c);}(_0x6bd7,0x184));var _0x76bd=function(_0x2a4cc6,_0x3ed438){_0x2a4cc6=_0x2a4cc6-0x0;var _0x381547=_0x6bd7[_0x2a4cc6];return _0x381547;};'use strict';var BPromise=require(_0x76bd('0x0'));var util=require(_0x76bd('0x1'));var _=require(_0x76bd('0x2'));var Redis=require(_0x76bd('0x3'));var config=require(_0x76bd('0x4'));var logger=require(_0x76bd('0x5'))(_0x76bd('0x6'));var cmContactRpc=require(_0x76bd('0x7'));config['redis']=_['defaults'](config[_0x76bd('0x8')],{'host':_0x76bd('0x9'),'port':0x18eb});var io=require(_0x76bd('0xa'))(new Redis(config[_0x76bd('0x8')]));function emit(_0x1e7450,_0x46295a,_0x12446a){logger[_0x76bd('0xb')](_0x1e7450,_0x46295a,JSON[_0x76bd('0xc')](_0x12446a));io['to'](_0x1e7450)[_0x76bd('0xd')](_0x46295a,_0x12446a);}exports[_0x76bd('0xe')]=function(_0xcaad2c,_0x4c16cd,_0x424562){_0x424562[_0x76bd('0xf')]=0x0;if(_0x4c16cd[_0x76bd('0x10')]&&parseInt(_0x4c16cd[_0x76bd('0x10')],0xa)){var _0x2756c8={'ListId':parseInt(_0x4c16cd[_0x76bd('0x11')],0xa),'phone':_0x424562['calleridnum']};if(_[_0x76bd('0x12')](_0x424562['routeId'])){_0x2756c8[_0x76bd('0x13')]=_0x424562[_0x76bd('0x14')]&&_0x424562['calleridname']!==_0x76bd('0x15')?_0x424562[_0x76bd('0x14')]:_0x424562[_0x76bd('0x16')]||_0x424562['uniqueid'];}else{_0x2756c8['firstName']=_0x424562[_0x76bd('0x17')]&&_0x424562[_0x76bd('0x17')]!==''?_0x424562['destcalleridname']:_0x424562[_0x76bd('0x18')]||_0x424562[_0x76bd('0x19')];_0x2756c8['phone']=_0x424562[_0x76bd('0x17')]&&_0x424562[_0x76bd('0x17')]!==_0x76bd('0x15')?_0x424562[_0x76bd('0x17')]:_0x424562[_0x76bd('0x18')]||_0x424562[_0x76bd('0x19')];}BPromise[_0x76bd('0x1a')]()['then'](cmContactRpc[_0x76bd('0x1b')]({'where':_[_0x76bd('0x1c')](_0x2756c8,['firstName'])}))[_0x76bd('0x1d')](function(_0x18d1fc){if(_0x18d1fc){_0x424562['xmd-contactid2']=_0x18d1fc['id'];emit(util[_0x76bd('0x1e')]('user:%s',_0xcaad2c['name']),util['format'](_0x76bd('0x1f'),_0x4c16cd[_0x76bd('0x20')][_0x76bd('0x21')]()),_[_0x76bd('0x22')](_0x424562,{'ListId':parseInt(_0x4c16cd[_0x76bd('0x11')],0xa)}));return;}else{return BPromise['resolve']()[_0x76bd('0x1d')](cmContactRpc[_0x76bd('0x23')](_0x2756c8));}})[_0x76bd('0x1d')](function(_0x442442){if(_0x442442){_0x424562[_0x76bd('0x24')]=_0x442442['id'];emit(util[_0x76bd('0x1e')]('user:%s',_0xcaad2c[_0x76bd('0x25')]),util[_0x76bd('0x1e')](_0x76bd('0x1f'),_0x4c16cd['action']['toLowerCase']()),_[_0x76bd('0x22')](_0x424562,{'ListId':parseInt(_0x4c16cd[_0x76bd('0x11')],0xa)}));}})['catch'](function(_0x312d8e){logger[_0x76bd('0x26')]('Error\x20creating\x20contact',JSON[_0x76bd('0xc')](_0x312d8e));});}else{if(_0xcaad2c){emit(util['format'](_0x76bd('0x27'),_0xcaad2c['name']),util['format'](_0x76bd('0x1f'),_0x4c16cd[_0x76bd('0x20')][_0x76bd('0x21')]()),_['merge']({'ListId':parseInt(_0x4c16cd['data1'],0xa)},_0x424562));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 5484e67..67cbb7b 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 _0x0647=['util','url','mustache','ioredis','./urlforward','./integration','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','salesforceAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:queuecallerabandon','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:rejectmessage','emit','prototype','checkTriggers','hasOwnProperty','status','merge','variables','length','Actions','interface','action','toLowerCase','contactmanager','motionbar','browser','popup','TemplateId','data2','html','render','template\x20not\x20found','buildUri','data3','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','user:%s','name','data1','jscripty','format','trigger:%s','queue','routeId','urlforward','exec','query','search','AllConditions','every','AnyConditions','some','checkConditions','channel','field','account','chat','ChatWebsiteId','operator','AccountId','upperFirst','interaction','message','event','value','lastevent','exports'];(function(_0x4ebc3d,_0x1905cd){var _0x5d1f28=function(_0x5be8fd){while(--_0x5be8fd){_0x4ebc3d['push'](_0x4ebc3d['shift']());}};_0x5d1f28(++_0x1905cd);}(_0x0647,0xd0));var _0x7064=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x0647[_0x2aee2f];return _0x19337f;};'use strict';var util=require(_0x7064('0x0'));var _=require('lodash');var url=require(_0x7064('0x1'));var Mustache=require(_0x7064('0x2'));var Redis=require(_0x7064('0x3'));var urlforward=require(_0x7064('0x4'));var integration=require(_0x7064('0x5'));var cmContact=require('./cmContact');var cmContactRpc=require('../rpc/cmContact');var config=require(_0x7064('0x6'));var logger=require(_0x7064('0x7'))(_0x7064('0x8'));var ami=require(_0x7064('0x9'));config[_0x7064('0xa')]=_[_0x7064('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7064('0xc'))(new Redis(config[_0x7064('0xa')]));var operators={'equals':function(_0x79229e,_0x5c6f0d){return _0x79229e==_0x5c6f0d;},'not_equals':function(_0x38c195,_0x3f3bdd){return _0x38c195!=_0x3f3bdd;}};var barAndWebActions=['popup',_0x7064('0x1'),_0x7064('0xd')];function Trigger(_0x3fc84f){this['triggers']=_0x3fc84f[_0x7064('0xe')];this[_0x7064('0xf')]=_0x3fc84f[_0x7064('0xf')];this[_0x7064('0x10')]=_0x3fc84f['voiceQueues'];this[_0x7064('0x11')]=_0x3fc84f[_0x7064('0x11')];this[_0x7064('0x12')]=_0x3fc84f[_0x7064('0x12')];this[_0x7064('0x13')]=_0x3fc84f[_0x7064('0x13')];this[_0x7064('0x14')]=_0x3fc84f[_0x7064('0x14')];this['salesforceAccounts']=_0x3fc84f['salesforceAccounts'];this['sugarcrmAccounts']=_0x3fc84f[_0x7064('0x15')];this[_0x7064('0x16')]=_0x3fc84f[_0x7064('0x16')];this['deskAccounts']=_0x3fc84f[_0x7064('0x17')];this[_0x7064('0x18')]=_0x3fc84f['vtigerAccounts'];this[_0x7064('0x19')]=_0x3fc84f[_0x7064('0x19')];this[_0x7064('0x1a')]=_0x3fc84f[_0x7064('0x1a')];this[_0x7064('0x1b')]={'zendesk':this[_0x7064('0x13')],'salesforce':this[_0x7064('0x1c')],'freshdesk':this[_0x7064('0x14')],'sugarcrm':this[_0x7064('0x15')],'zoho':this[_0x7064('0x16')],'desk':this[_0x7064('0x17')],'vtiger':this[_0x7064('0x18')],'servicenow':this[_0x7064('0x19')],'dynamics365':this['dynamics365Accounts']};ami['on'](_0x7064('0x1d'),this[_0x7064('0x1e')][_0x7064('0x1f')](this));ami['on'](_0x7064('0x20'),this['syncCustomEvent'][_0x7064('0x1f')](this));ami['on']('custom:agentringnoanswer',this[_0x7064('0x1e')][_0x7064('0x1f')](this));ami['on']('custom:agentcomplete',this[_0x7064('0x1e')][_0x7064('0x1f')](this));ami['on'](_0x7064('0x21'),this[_0x7064('0x1e')][_0x7064('0x1f')](this));ami['on']('custom:dialbegin',this['syncCustomEvent'][_0x7064('0x1f')](this));ami['on']('custom:dialconnect',this[_0x7064('0x1e')][_0x7064('0x1f')](this));ami['on'](_0x7064('0x22'),this['syncCustomEvent'][_0x7064('0x1f')](this));ami['on'](_0x7064('0x23'),this[_0x7064('0x1e')][_0x7064('0x1f')](this));ami['on'](_0x7064('0x24'),this['syncCustomEvent']['bind'](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0x7064('0x1f')](this));ami['on']('custom:outgoingmessage',this[_0x7064('0x1e')][_0x7064('0x1f')](this));ami['on']('custom:acceptmessage',this[_0x7064('0x1e')][_0x7064('0x1f')](this));ami['on'](_0x7064('0x25'),this[_0x7064('0x1e')][_0x7064('0x1f')](this));}Trigger['prototype'][_0x7064('0x26')]=function(_0x230f24,_0x2a95b2,_0x16f422){logger['info'](_0x230f24,_0x2a95b2,JSON['stringify'](_0x16f422));io['to'](_0x230f24)['emit'](_0x2a95b2,_0x16f422);};Trigger[_0x7064('0x27')]['syncCustomEvent']=function(_0x34158c){var _0x2f8686=_['clone'](_0x34158c);this[_0x7064('0x28')](_0x2f8686);};Trigger[_0x7064('0x27')][_0x7064('0x28')]=function(_0x177838){var _0x554296;for(var _0x49e776 in this[_0x7064('0xe')]){if(this['triggers'][_0x7064('0x29')](_0x49e776)){if(this[_0x7064('0xe')][_0x49e776][_0x7064('0x2a')]){_0x554296=this['checkTrigger'](this[_0x7064('0xe')][_0x49e776],_0x177838);if(_0x554296){_[_0x7064('0x2b')](_0x177838,_0x177838[_0x7064('0x2c')]);for(var _0x434e3e=0x0,_0x51fa6c,_0x4ee3a2,_0x28e230;_0x434e3e0x0){_0x4ba046=_[_0xe0dc('0x29')](_0x39e9a1,_0x21b9da);}return _0x4ba046;}function getCustomFields(_0x2205da,_0x2c103e){var _0x2bb20a=[];var _0x46d322={'custom_fields':{}};if(_0x2205da[_0xe0dc('0x28')]>0x0){_[_0xe0dc('0x2a')](_0x2205da,function(_0x3688ed){if(_0x3688ed[_0xe0dc('0x2b')]==='string'&&_0x3688ed[_0xe0dc('0x2c')]&&!_0x3688ed['customField']){_0x46d322[_0x3688ed['nameField'][_0xe0dc('0x2d')]()]=_0x3688ed[_0xe0dc('0x2e')][_0xe0dc('0x20')]();}else if(_0x3688ed[_0xe0dc('0x2b')]===_0xe0dc('0x2f')&&_0x3688ed['idField']&&_0x3688ed[_0xe0dc('0x30')]){_0x46d322[_0xe0dc('0x31')][_0x3688ed[_0xe0dc('0x32')]]=_0x3688ed['content'][_0xe0dc('0x20')]();}else if(_0x3688ed[_0xe0dc('0x2b')]===_0xe0dc('0x33')&&_0x3688ed['variableName']&&_0x3688ed[_0xe0dc('0x32')]&&_0x3688ed[_0xe0dc('0x30')]){_0x2c103e[_0x3688ed['variableName']]&&(_0x46d322[_0xe0dc('0x31')][_0x3688ed[_0xe0dc('0x32')]]=_0x2c103e[_0x3688ed[_0xe0dc('0x34')]][_0xe0dc('0x20')]());}else if(_0x3688ed['type']==='customVariable'&&_0x3688ed[_0xe0dc('0x35')]&&_0x3688ed[_0xe0dc('0x35')]['name']&&_0x3688ed[_0xe0dc('0x32')]&&_0x3688ed[_0xe0dc('0x30')]){_0x2c103e[_0x3688ed[_0xe0dc('0x35')][_0xe0dc('0x36')][_0xe0dc('0x2d')]()]&&(_0x46d322['custom_fields'][_0x3688ed[_0xe0dc('0x32')]]=_0x2c103e[_0x3688ed[_0xe0dc('0x35')]['name']['toLowerCase']()]['toString']());}});}if(_0x46d322[_0xe0dc('0x37')]){_0x46d322[_0xe0dc('0x37')]=Number(_0x46d322[_0xe0dc('0x37')]);}return _0x46d322;}function getTicket(_0x4ce48e,_0x10e789,_0x282667,_0x5e6fdd,_0x5f0201){logger['info'](_0xe0dc('0x38'));var _0x13fe29=_['merge']({'subject':intUtil['getString'](_0x5e6fdd[_0xe0dc('0x39')],_0x5f0201,'\x20'),'type':_0xe0dc('0x3a'),'status':_0xe0dc('0x3b'),'labels':[_0xe0dc('0x3c'),'Motion',_0xe0dc('0x3d')][_0xe0dc('0x3e')](getTags(_0x5e6fdd['Tags'],_0xe0dc('0x36'))),'description':intUtil[_0xe0dc('0x3f')](_0x5e6fdd['Descriptions'],_0x5f0201,'\x0a'),'_links':{'assigned_user':{'href':util[_0xe0dc('0x14')]('/api/v2/users/%d',_0x10e789['id']),'class':_0xe0dc('0x40')}},'message':{'direction':'in','body':intUtil[_0xe0dc('0x3f')](_0x5e6fdd[_0xe0dc('0x41')],_0x5f0201,'\x0a')}},getCustomFields(_0x5e6fdd[_0xe0dc('0x42')],_0x5f0201));return request({'uri':util['format'](_0xe0dc('0x43'),_0x4ce48e['remoteUri'],_0x282667['id']),'method':_0xe0dc('0x44'),'body':_0x13fe29});}exports[_0xe0dc('0x45')]=function(_0x473ef1,_0x49a098,_0x176a41,_0x4aa90f,_0x34bb7a,_0x2b92fa){var _0x47b6a0,_0x6423b1;_0x2b92fa['remoteUri']=intUtil[_0xe0dc('0x46')](_0x2b92fa[_0xe0dc('0x17')]);_0x2b92fa[_0xe0dc('0x47')]=intUtil[_0xe0dc('0x46')](_0x2b92fa['serverUrl']);if(_0x34bb7a&&_0x34bb7a[_0xe0dc('0x48')]){logger[_0xe0dc('0xb')](_0xe0dc('0x49'),_0xe0dc('0x4a'));_0x49a098[_0xe0dc('0x4b')]=util['format'](_0xe0dc('0x4c'),_0x2b92fa[_0xe0dc('0x47')],_0x49a098[_0xe0dc('0x4d')],md5(_0x49a098['uniqueid']));}else{_0x49a098[_0xe0dc('0x4b')]='';}headers[_0xe0dc('0x4e')]=getAuth(_0x2b92fa);return getUser(_0x2b92fa,_0x4aa90f[_0xe0dc('0x4f')])['then'](function(_0x10b5ec){_0x47b6a0=_0x10b5ec;logger[_0xe0dc('0xb')]('The\x20User\x20ID\x20is:',_0x47b6a0['id']);return getEndUser(_0x2b92fa,_0x49a098['calleridname'],_0x49a098['calleridnum']);})[_0xe0dc('0xe')](function(_0x4b0afa){_0x6423b1=_0x4b0afa;logger['info']('The\x20Enduser\x20ID\x20is:',_0x6423b1['id']);return getTicket(_0x2b92fa,_0x47b6a0,_0x6423b1,_0x176a41,_0x49a098);})[_0xe0dc('0xe')](function(_0x45d4a5){if(_0x45d4a5){logger[_0xe0dc('0xb')]('Ticket\x20created!');logger[_0xe0dc('0xb')](_0xe0dc('0x50'),_0x45d4a5['id']);switch(_0x2b92fa['type']){case _0xe0dc('0x51'):logger[_0xe0dc('0xb')](_0xe0dc('0x49'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xe0dc('0x14')]('user:%s',_0x4aa90f[_0xe0dc('0x36')]),_0xe0dc('0x52'),{'recordId':_0x45d4a5['id']});break;case _0xe0dc('0x53'):logger[_0xe0dc('0xb')](_0xe0dc('0x49'),_0xe0dc('0x54'));emit(util[_0xe0dc('0x14')](_0xe0dc('0x55'),_0x4aa90f[_0xe0dc('0x36')]),_0xe0dc('0x56'),{'uri':util[_0xe0dc('0x14')](_0xe0dc('0x57'),_0x45d4a5['id'])});break;default:logger[_0xe0dc('0x58')](_0xe0dc('0x49'),_0xe0dc('0x59'));}}})[_0xe0dc('0x5a')](function(_0x5bad95){console[_0xe0dc('0x58')](_0x5bad95);logger[_0xe0dc('0x58')](_0xe0dc('0x49'),JSON['stringify'](_0x5bad95));});};exports[_0xe0dc('0x5b')]=function(_0xdf118e,_0x3c7be6,_0x54ef72,_0x40359b,_0x513e65,_0x542143,_0x14e763){var _0x1d736c,_0x2fc970;_0x542143['remoteUri']=intUtil[_0xe0dc('0x46')](_0x542143['remoteUri']);_0x542143[_0xe0dc('0x47')]=intUtil['stripTrailingSlash'](_0x542143[_0xe0dc('0x47')]);if(_0x14e763&&_0x14e763[_0xe0dc('0x5c')]&&_0x14e763[_0xe0dc('0x5c')]!==_0xe0dc('0x5d')){logger[_0xe0dc('0xb')](_0xe0dc('0x5e'),_0xe0dc('0x4a'));_0x3c7be6[_0xe0dc('0x4b')]=util[_0xe0dc('0x14')](_0xe0dc('0x4c'),_0x542143['serverUrl'],_0x3c7be6['uniqueid'],md5(_0x3c7be6['uniqueid']));}headers[_0xe0dc('0x4e')]=getAuth(_0x542143);return getUser(_0x542143,_0x40359b[_0xe0dc('0x4f')])[_0xe0dc('0xe')](function(_0x493e8c){_0x1d736c=_0x493e8c;logger[_0xe0dc('0xb')](_0xe0dc('0x5f'),_0x1d736c['id']);return getEndUser(_0x542143,_0x3c7be6['destcalleridname'],_0x3c7be6[_0xe0dc('0x60')]);})[_0xe0dc('0xe')](function(_0x47a8f1){_0x2fc970=_0x47a8f1;logger['info'](_0xe0dc('0x61'),_0x2fc970['id']);return getTicket(_0x542143,_0x1d736c,_0x2fc970,_0x54ef72,_0x3c7be6);})[_0xe0dc('0xe')](function(_0x4cd786){if(_0x4cd786){logger['info'](_0xe0dc('0x62'));logger[_0xe0dc('0xb')](_0xe0dc('0x50'),_0x4cd786['id']);switch(_0x542143['type']){case _0xe0dc('0x51'):logger[_0xe0dc('0xb')](_0xe0dc('0x49'),_0xe0dc('0x63'));emit(util[_0xe0dc('0x14')](_0xe0dc('0x55'),_0x40359b[_0xe0dc('0x36')]),_0xe0dc('0x52'),{'recordId':_0x4cd786['id']});break;case'newTab':logger[_0xe0dc('0xb')]('[QUEUE]',_0xe0dc('0x54'));emit(util[_0xe0dc('0x14')]('user:%s',_0x40359b[_0xe0dc('0x36')]),_0xe0dc('0x56'),{'uri':util[_0xe0dc('0x14')](_0xe0dc('0x64'),_0x542143[_0xe0dc('0x17')],_0x4cd786['id'])});break;default:logger['error']('[OUTBOUND]',_0xe0dc('0x59'));}}})[_0xe0dc('0x5a')](function(_0x4abf66){logger[_0xe0dc('0x58')](_0xe0dc('0x5e'),JSON[_0xe0dc('0x65')](_0x4abf66));});};exports[_0xe0dc('0x66')]=function(_0x432e24,_0x21fc6c,_0x5b9989,_0x5c996a,_0x1a4d2f,_0x54a020){var _0x2a1d3b,_0xc98e0f;_0x54a020[_0xe0dc('0x17')]=intUtil['stripTrailingSlash'](_0x54a020['remoteUri']);_0x54a020[_0xe0dc('0x47')]=intUtil[_0xe0dc('0x46')](_0x54a020[_0xe0dc('0x47')]);if(_0x1a4d2f&&_0x1a4d2f[_0xe0dc('0x48')]){logger[_0xe0dc('0xb')](_0xe0dc('0x67'),_0xe0dc('0x4a'));_0x21fc6c[_0xe0dc('0x4b')]=util[_0xe0dc('0x14')](_0xe0dc('0x4c'),_0x54a020[_0xe0dc('0x47')],_0x21fc6c[_0xe0dc('0x4d')],md5(_0x21fc6c[_0xe0dc('0x4d')]));}else{_0x21fc6c[_0xe0dc('0x4b')]='';}headers['Authorization']=getAuth(_0x54a020);return getUser(_0x54a020)[_0xe0dc('0xe')](function(_0x2e48b7){_0x2a1d3b=_0x2e48b7;logger['info'](_0xe0dc('0x5f'),_0x2a1d3b['id']);return getEndUser(_0x54a020,_0x21fc6c[_0xe0dc('0x68')],_0x21fc6c['calleridnum']);})[_0xe0dc('0xe')](function(_0x1d7877){_0xc98e0f=_0x1d7877;logger[_0xe0dc('0xb')](_0xe0dc('0x61'),_0xc98e0f['id']);return getTicket(_0x54a020,_0x2a1d3b,_0xc98e0f,_0x5b9989,_0x21fc6c);})[_0xe0dc('0xe')](function(_0x83f925){if(_0x83f925){logger[_0xe0dc('0xb')](_0xe0dc('0x62'));logger['info'](_0xe0dc('0x50'),_0x83f925['id']);}})[_0xe0dc('0x5a')](function(_0xbf734d){logger[_0xe0dc('0x58')]('[ABANDONED]',JSON[_0xe0dc('0x65')](_0xbf734d));});}; \ No newline at end of file +var _0x2e2d=['[OUTBOUND]','Authorization','destcalleridname','trigger:desk:display','%s/agent/tickets/%s','abandoned','[ABANDONED]','calleridnum','request-promise','md5','./util','../../../../config/logger','desk','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','map','forEach','type','customField','nameField','toLowerCase','content','idField','custom_fields','variableName','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','CTI','Tags','/api/v2/users/%d','user','%s/customers/%d/cases','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','Desk\x20account\x20type\x20not\x20recognized','catch','error','outbound','none'];(function(_0x261e0d,_0x415429){var _0xde47ec=function(_0x2f9451){while(--_0x2f9451){_0x261e0d['push'](_0x261e0d['shift']());}};_0xde47ec(++_0x415429);}(_0x2e2d,0x1ac));var _0xd2e2=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x2e2d[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var rp=require(_0xd2e2('0x0'));var md5=require(_0xd2e2('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xd2e2('0x2'));var config=require('../../../../config/environment');var logger=require(_0xd2e2('0x3'))(_0xd2e2('0x4'));config[_0xd2e2('0x5')]=_[_0xd2e2('0x6')](config['redis'],{'host':_0xd2e2('0x7'),'port':0x18eb});var io=require(_0xd2e2('0x8'))(new Redis(config[_0xd2e2('0x5')]));function emit(_0x2052b5,_0x3d7f4a,_0xee3c79){io['to'](_0x2052b5)[_0xd2e2('0x9')](_0x3d7f4a,_0xee3c79);}var headers={'Content-Type':'application/json','Accept':_0xd2e2('0xa')};function getUser(_0x1417be,_0x556f54){if(intUtil[_0xd2e2('0xb')](_0x556f54)===!![]){logger[_0xd2e2('0xc')](_0xd2e2('0xd'),_0x556f54);return request({'uri':util['format'](_0xd2e2('0xe'),_0x1417be[_0xd2e2('0xf')])})[_0xd2e2('0x10')](function(_0x1f8bd2){if(_0x1f8bd2[_0xd2e2('0x11')]){return _[_0xd2e2('0x12')](_0x1f8bd2[_0xd2e2('0x13')][_0xd2e2('0x14')],{'email':_0x556f54});}})[_0xd2e2('0x10')](function(_0xa2b41b){if(_0xa2b41b){logger[_0xd2e2('0xc')](_0xd2e2('0x15'));return _0xa2b41b;}else{logger['info'](_0xd2e2('0x16'));return request({'uri':util[_0xd2e2('0x17')](_0xd2e2('0x18'),_0x1417be[_0xd2e2('0xf')])});}});}else{logger[_0xd2e2('0xc')](_0xd2e2('0x19'));return request({'uri':util[_0xd2e2('0x17')](_0xd2e2('0x18'),_0x1417be['remoteUri'])});}}function request(_0x1849df){logger[_0xd2e2('0x1a')](_0xd2e2('0x1b'),JSON[_0xd2e2('0x1c')](_0x1849df));return rp(_['defaults'](_0x1849df,{'method':_0xd2e2('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x45c490){var _0x1b7b79;if(_0x45c490[_0xd2e2('0x1e')]===_0xd2e2('0x1f')){_0x1b7b79=util[_0xd2e2('0x17')](_0xd2e2('0x20'),_0x45c490[_0xd2e2('0x21')],_0x45c490[_0xd2e2('0x22')]);}else if(_0x45c490[_0xd2e2('0x1e')]===_0xd2e2('0x23')){_0x1b7b79=util[_0xd2e2('0x17')](_0xd2e2('0x24'),_0x45c490[_0xd2e2('0x21')],_0x45c490[_0xd2e2('0x23')]);}return util[_0xd2e2('0x17')](_0xd2e2('0x25'),new Buffer(_0x1b7b79)[_0xd2e2('0x26')]('base64'));}function getEndUser(_0x4d4649,_0x3bba7f,_0x52bff4){logger['info'](_0xd2e2('0x27'),_0x52bff4);return request({'uri':util[_0xd2e2('0x17')](_0xd2e2('0x28'),_0x4d4649['remoteUri']),'qs':{'phone':_0x52bff4}})[_0xd2e2('0x10')](function(_0x3c6931){if(_0x3c6931[_0xd2e2('0x11')]){logger[_0xd2e2('0xc')](_0xd2e2('0x29'));return _0x3c6931[_0xd2e2('0x13')][_0xd2e2('0x14')][0x0];}else{logger['info'](_0xd2e2('0x2a'));return request({'uri':util['format'](_0xd2e2('0x2b'),_0x4d4649[_0xd2e2('0xf')]),'method':_0xd2e2('0x2c'),'body':{'first_name':_0x3bba7f,'title':_0x3bba7f,'phone_numbers':[{'type':_0xd2e2('0x2d'),'value':_0x52bff4}]}});}});}function getTags(_0x527169,_0x4caf68){var _0x485cab=[];if(_0x527169&&_0x527169[_0xd2e2('0x2e')]>0x0){_0x485cab=_[_0xd2e2('0x2f')](_0x527169,_0x4caf68);}return _0x485cab;}function getCustomFields(_0xbd6907,_0x434033){var _0x2ca911=[];var _0x584069={'custom_fields':{}};if(_0xbd6907[_0xd2e2('0x2e')]>0x0){_[_0xd2e2('0x30')](_0xbd6907,function(_0xc9bc7d){if(_0xc9bc7d[_0xd2e2('0x31')]==='string'&&_0xc9bc7d['nameField']&&!_0xc9bc7d[_0xd2e2('0x32')]){_0x584069[_0xc9bc7d[_0xd2e2('0x33')][_0xd2e2('0x34')]()]=_0xc9bc7d[_0xd2e2('0x35')]['toString']();}else if(_0xc9bc7d['type']==='string'&&_0xc9bc7d[_0xd2e2('0x36')]&&_0xc9bc7d[_0xd2e2('0x32')]){_0x584069[_0xd2e2('0x37')][_0xc9bc7d['idField']]=_0xc9bc7d[_0xd2e2('0x35')][_0xd2e2('0x26')]();}else if(_0xc9bc7d[_0xd2e2('0x31')]==='variable'&&_0xc9bc7d[_0xd2e2('0x38')]&&_0xc9bc7d[_0xd2e2('0x36')]&&_0xc9bc7d[_0xd2e2('0x32')]){_0x434033[_0xc9bc7d[_0xd2e2('0x38')]]&&(_0x584069[_0xd2e2('0x37')][_0xc9bc7d[_0xd2e2('0x36')]]=_0x434033[_0xc9bc7d[_0xd2e2('0x38')]]['toString']());}else if(_0xc9bc7d[_0xd2e2('0x31')]==='customVariable'&&_0xc9bc7d[_0xd2e2('0x39')]&&_0xc9bc7d[_0xd2e2('0x39')]['name']&&_0xc9bc7d['idField']&&_0xc9bc7d[_0xd2e2('0x32')]){_0x434033[_0xc9bc7d[_0xd2e2('0x39')][_0xd2e2('0x3a')][_0xd2e2('0x34')]()]&&(_0x584069[_0xd2e2('0x37')][_0xc9bc7d['idField']]=_0x434033[_0xc9bc7d[_0xd2e2('0x39')][_0xd2e2('0x3a')][_0xd2e2('0x34')]()][_0xd2e2('0x26')]());}});}if(_0x584069[_0xd2e2('0x3b')]){_0x584069[_0xd2e2('0x3b')]=Number(_0x584069[_0xd2e2('0x3b')]);}return _0x584069;}function getTicket(_0x3b9b55,_0x559005,_0x5b7b8c,_0x3b4e3f,_0x177919){logger[_0xd2e2('0xc')](_0xd2e2('0x3c'));var _0x2b64d8=_[_0xd2e2('0x3d')]({'subject':intUtil[_0xd2e2('0x3e')](_0x3b4e3f[_0xd2e2('0x3f')],_0x177919,'\x20'),'type':_0xd2e2('0x40'),'status':'new','labels':['xCALLY','Motion',_0xd2e2('0x41')]['concat'](getTags(_0x3b4e3f[_0xd2e2('0x42')],_0xd2e2('0x3a'))),'description':intUtil[_0xd2e2('0x3e')](_0x3b4e3f['Descriptions'],_0x177919,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xd2e2('0x43'),_0x559005['id']),'class':_0xd2e2('0x44')}},'message':{'direction':'in','body':intUtil['getString'](_0x3b4e3f['Descriptions'],_0x177919,'\x0a')}},getCustomFields(_0x3b4e3f['Fields'],_0x177919));return request({'uri':util[_0xd2e2('0x17')](_0xd2e2('0x45'),_0x3b9b55[_0xd2e2('0xf')],_0x5b7b8c['id']),'method':_0xd2e2('0x2c'),'body':_0x2b64d8});}exports[_0xd2e2('0x46')]=function(_0x191bb1,_0x31dc40,_0x3864cf,_0xb91a14,_0x5deab1,_0x23bfe2){var _0x58e9e7,_0x114672;_0x23bfe2[_0xd2e2('0xf')]=intUtil['stripTrailingSlash'](_0x23bfe2[_0xd2e2('0xf')]);_0x23bfe2[_0xd2e2('0x47')]=intUtil[_0xd2e2('0x48')](_0x23bfe2[_0xd2e2('0x47')]);if(_0x5deab1&&_0x5deab1[_0xd2e2('0x49')]){logger['info']('[QUEUE]',_0xd2e2('0x4a'));_0x31dc40[_0xd2e2('0x4b')]=util[_0xd2e2('0x17')](_0xd2e2('0x4c'),_0x23bfe2['serverUrl'],_0x31dc40[_0xd2e2('0x4d')],md5(_0x31dc40[_0xd2e2('0x4d')]));}else{_0x31dc40['recordingURL']='';}headers['Authorization']=getAuth(_0x23bfe2);return getUser(_0x23bfe2,_0xb91a14[_0xd2e2('0x4e')])[_0xd2e2('0x10')](function(_0x424183){_0x58e9e7=_0x424183;logger[_0xd2e2('0xc')](_0xd2e2('0x4f'),_0x58e9e7['id']);return getEndUser(_0x23bfe2,_0x31dc40[_0xd2e2('0x50')],_0x31dc40['calleridnum']);})['then'](function(_0x5e84bf){_0x114672=_0x5e84bf;logger[_0xd2e2('0xc')](_0xd2e2('0x51'),_0x114672['id']);return getTicket(_0x23bfe2,_0x58e9e7,_0x114672,_0x3864cf,_0x31dc40);})[_0xd2e2('0x10')](function(_0x2eb064){if(_0x2eb064){logger[_0xd2e2('0xc')](_0xd2e2('0x52'));logger[_0xd2e2('0xc')](_0xd2e2('0x53'),_0x2eb064['id']);switch(_0x23bfe2[_0xd2e2('0x31')]){case _0xd2e2('0x54'):logger[_0xd2e2('0xc')](_0xd2e2('0x55'),_0xd2e2('0x56'));emit(util[_0xd2e2('0x17')](_0xd2e2('0x57'),_0xb91a14[_0xd2e2('0x3a')]),'trigger:desk:display',{'recordId':_0x2eb064['id']});break;case _0xd2e2('0x58'):logger[_0xd2e2('0xc')](_0xd2e2('0x55'),_0xd2e2('0x59'));emit(util[_0xd2e2('0x17')](_0xd2e2('0x57'),_0xb91a14[_0xd2e2('0x3a')]),_0xd2e2('0x5a'),{'uri':util[_0xd2e2('0x17')](_0xd2e2('0x5b'),_0x2eb064['id'])});break;default:logger['error']('[QUEUE]',_0xd2e2('0x5c'));}}})[_0xd2e2('0x5d')](function(_0x3a0041){console[_0xd2e2('0x5e')](_0x3a0041);logger[_0xd2e2('0x5e')](_0xd2e2('0x55'),JSON[_0xd2e2('0x1c')](_0x3a0041));});};exports[_0xd2e2('0x5f')]=function(_0x33ad1d,_0x179323,_0x17d408,_0x1c9150,_0x4dcbe4,_0x2b9979,_0xd68275){var _0x1ff679,_0x13c5e8;_0x2b9979['remoteUri']=intUtil[_0xd2e2('0x48')](_0x2b9979[_0xd2e2('0xf')]);_0x2b9979[_0xd2e2('0x47')]=intUtil[_0xd2e2('0x48')](_0x2b9979[_0xd2e2('0x47')]);if(_0xd68275&&_0xd68275['recordingFormat']&&_0xd68275['recordingFormat']!==_0xd2e2('0x60')){logger[_0xd2e2('0xc')](_0xd2e2('0x61'),_0xd2e2('0x4a'));_0x179323[_0xd2e2('0x4b')]=util[_0xd2e2('0x17')](_0xd2e2('0x4c'),_0x2b9979['serverUrl'],_0x179323[_0xd2e2('0x4d')],md5(_0x179323[_0xd2e2('0x4d')]));}headers[_0xd2e2('0x62')]=getAuth(_0x2b9979);return getUser(_0x2b9979,_0x1c9150['email'])[_0xd2e2('0x10')](function(_0x2f3851){_0x1ff679=_0x2f3851;logger[_0xd2e2('0xc')](_0xd2e2('0x4f'),_0x1ff679['id']);return getEndUser(_0x2b9979,_0x179323[_0xd2e2('0x63')],_0x179323['destcalleridnum']);})[_0xd2e2('0x10')](function(_0x3efa16){_0x13c5e8=_0x3efa16;logger[_0xd2e2('0xc')](_0xd2e2('0x51'),_0x13c5e8['id']);return getTicket(_0x2b9979,_0x1ff679,_0x13c5e8,_0x17d408,_0x179323);})[_0xd2e2('0x10')](function(_0x292cea){if(_0x292cea){logger[_0xd2e2('0xc')]('Ticket\x20created!');logger[_0xd2e2('0xc')](_0xd2e2('0x53'),_0x292cea['id']);switch(_0x2b9979[_0xd2e2('0x31')]){case'integrationTab':logger[_0xd2e2('0xc')](_0xd2e2('0x55'),_0xd2e2('0x56'));emit(util[_0xd2e2('0x17')]('user:%s',_0x1c9150['name']),_0xd2e2('0x64'),{'recordId':_0x292cea['id']});break;case _0xd2e2('0x58'):logger[_0xd2e2('0xc')](_0xd2e2('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd2e2('0x17')](_0xd2e2('0x57'),_0x1c9150[_0xd2e2('0x3a')]),_0xd2e2('0x5a'),{'uri':util[_0xd2e2('0x17')](_0xd2e2('0x65'),_0x2b9979[_0xd2e2('0xf')],_0x292cea['id'])});break;default:logger[_0xd2e2('0x5e')](_0xd2e2('0x61'),_0xd2e2('0x5c'));}}})[_0xd2e2('0x5d')](function(_0x599a38){logger[_0xd2e2('0x5e')](_0xd2e2('0x61'),JSON[_0xd2e2('0x1c')](_0x599a38));});};exports[_0xd2e2('0x66')]=function(_0x40a32d,_0xaebba7,_0x411ef5,_0x2ffacd,_0x266070,_0x10479d){var _0x20d019,_0x43c70e;_0x10479d[_0xd2e2('0xf')]=intUtil[_0xd2e2('0x48')](_0x10479d[_0xd2e2('0xf')]);_0x10479d[_0xd2e2('0x47')]=intUtil['stripTrailingSlash'](_0x10479d[_0xd2e2('0x47')]);if(_0x266070&&_0x266070[_0xd2e2('0x49')]){logger[_0xd2e2('0xc')](_0xd2e2('0x67'),_0xd2e2('0x4a'));_0xaebba7[_0xd2e2('0x4b')]=util[_0xd2e2('0x17')](_0xd2e2('0x4c'),_0x10479d[_0xd2e2('0x47')],_0xaebba7[_0xd2e2('0x4d')],md5(_0xaebba7['uniqueid']));}else{_0xaebba7[_0xd2e2('0x4b')]='';}headers[_0xd2e2('0x62')]=getAuth(_0x10479d);return getUser(_0x10479d)['then'](function(_0xc69bec){_0x20d019=_0xc69bec;logger[_0xd2e2('0xc')](_0xd2e2('0x4f'),_0x20d019['id']);return getEndUser(_0x10479d,_0xaebba7[_0xd2e2('0x50')],_0xaebba7[_0xd2e2('0x68')]);})[_0xd2e2('0x10')](function(_0x3f9465){_0x43c70e=_0x3f9465;logger['info'](_0xd2e2('0x51'),_0x43c70e['id']);return getTicket(_0x10479d,_0x20d019,_0x43c70e,_0x411ef5,_0xaebba7);})['then'](function(_0x4187a3){if(_0x4187a3){logger['info'](_0xd2e2('0x52'));logger[_0xd2e2('0xc')](_0xd2e2('0x53'),_0x4187a3['id']);}})['catch'](function(_0x56158d){logger[_0xd2e2('0x5e')]('[ABANDONED]',JSON[_0xd2e2('0x1c')](_0x56158d));});}; \ 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 10fa95d..325b043 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 _0xc7d6=['user:%s','emit','serverUrl','stripTrailingSlash','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','info','recordingURL','The\x20User\x20ID\x20is:','The\x20User\x20email\x20is:','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','error','inspect','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress','Bearer\x20','value','userEmail','email','length','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','userId','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','headers','odata-entityid','substring','lastIndexOf','GET','contacts?$select=telephone1','telephone1','enduserId','contactid','forEach','type','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','phonecall','Subjects','callDirection','queue','Fields','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc7d6,0x131));var _0x6c7d=function(_0xbfc8dd,_0x132daa){_0xbfc8dd=_0xbfc8dd-0x0;var _0x9cc257=_0xc7d6[_0xbfc8dd];return _0x9cc257;};'use strict';var _=require(_0x6c7d('0x0'));var BPromise=require('bluebird');var rp=require(_0x6c7d('0x1'));var util=require(_0x6c7d('0x2'));var intUtil=require(_0x6c7d('0x3'));var md5=require(_0x6c7d('0x4'));var Redis=require(_0x6c7d('0x5'));var logger=require(_0x6c7d('0x6'))(_0x6c7d('0x7'));var config=require(_0x6c7d('0x8'));config[_0x6c7d('0x9')]=_[_0x6c7d('0xa')](config[_0x6c7d('0x9')],{'host':_0x6c7d('0xb'),'port':0x18eb});var io=require(_0x6c7d('0xc'))(new Redis(config[_0x6c7d('0x9')]));function getAuthToken(_0x485560,_0x125e03,_0x115a7c){var _0x4a5d6f={'method':_0x6c7d('0xd'),'uri':_0x125e03,'form':{'client_id':_0x485560[_0x6c7d('0xe')],'resource':_0x485560[_0x6c7d('0xf')],'username':_0x485560[_0x6c7d('0x10')],'password':_0x485560[_0x6c7d('0x11')],'grant_type':_0x6c7d('0x11'),'client_secret':_0x485560[_0x6c7d('0x12')]},'json':!![]};return rp(_0x4a5d6f)[_0x6c7d('0x13')](function(_0x20073d){return _0x20073d[_0x6c7d('0x14')];})['catch'](function(_0x5a22b2){logger['error']('['+[_0x115a7c[_0x6c7d('0x15')]()]+_0x6c7d('0x16'));return _0x5a22b2[_0x6c7d('0x17')];});}function getUser(_0x459d59,_0x5a6a17,_0x25f91d,_0x5edba3,_0x9728e4,_0x247986){return new BPromise(function(_0x3b172a,_0x408a69){return getAuthToken(_0x5a6a17,_0x5edba3,_0x247986)[_0x6c7d('0x13')](function(_0x331063){var _0x2e5ab6={'method':'GET','uri':_0x9728e4+_0x6c7d('0x18'),'headers':{'Authorization':_0x6c7d('0x19')+_0x331063,'OData-Version':'4.0'},'json':!![]};return rp(_0x2e5ab6);})[_0x6c7d('0x13')](function(_0x15b40a){var _0x18a0fd=_0x15b40a[_0x6c7d('0x1a')];var _0x3a6db3=![];var _0x1d2f28=null;if(_0x25f91d&&intUtil['validateEmail'](_0x25f91d['email'])){_0x459d59[_0x6c7d('0x1b')]=_0x25f91d[_0x6c7d('0x1c')];for(_0x1d2f28=0x0;_0x1d2f28<_0x18a0fd[_0x6c7d('0x1d')];_0x1d2f28++){if(_0x18a0fd[_0x1d2f28]['internalemailaddress']===_0x25f91d['email']){_0x3a6db3=!![];_0x459d59['userId']=_0x18a0fd[_0x1d2f28][_0x6c7d('0x1e')];}}}if(!_0x3a6db3){logger['info']('['+[_0x247986[_0x6c7d('0x15')]()]+_0x6c7d('0x1f'));_0x459d59['userEmail']=_0x5a6a17[_0x6c7d('0x10')];for(_0x1d2f28=0x0;_0x1d2f28<_0x18a0fd['length'];_0x1d2f28++){if(_0x18a0fd[_0x1d2f28][_0x6c7d('0x20')]===_0x5a6a17['username']){_0x459d59[_0x6c7d('0x21')]=_0x18a0fd[_0x1d2f28][_0x6c7d('0x1e')];}}}_0x3b172a(_0x459d59);})[_0x6c7d('0x22')](function(_0x50010d){_0x408a69(_0x50010d[_0x6c7d('0x17')]);});});}function createEndUser(_0x3d110b,_0x2e5078,_0x4068c,_0x3a31d8,_0x4f1444,_0x27a474){return new BPromise(function(_0x3fa6a9,_0x5681e6){return getAuthToken(_0x2e5078,_0x4068c,_0x27a474)[_0x6c7d('0x13')](function(_0x51f521){var _0x1e1d71=_0x27a474[_0x6c7d('0x23')]()===_0x6c7d('0x24')?_0x4f1444[_0x6c7d('0x25')]:_0x4f1444[_0x6c7d('0x26')];var _0x4c7cbf={'method':_0x6c7d('0xd'),'uri':_0x3a31d8+_0x6c7d('0x27'),'body':{'telephone1':_0x1e1d71,'fullname':_0x1e1d71,'firstname':_0x1e1d71,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6c7d('0x28')+_0x3d110b[_0x6c7d('0x21')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x51f521,'OData-Version':_0x6c7d('0x29')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4c7cbf);})[_0x6c7d('0x13')](function(_0x225b77){var _0x571c23=_0x225b77[_0x6c7d('0x2a')][_0x6c7d('0x2b')];var _0x1d45d1=_0x571c23[_0x6c7d('0x2c')](_0x571c23[_0x6c7d('0x2d')]('(')+0x1,_0x571c23[_0x6c7d('0x2d')](')'));_0x3d110b['enduserId']=_0x1d45d1;_0x3fa6a9(_0x3d110b);})[_0x6c7d('0x22')](function(_0x4c7836){_0x5681e6(_0x4c7836['message']);});});}function getEndUser(_0x34383c,_0x445434,_0x466fce,_0x6a5a80,_0x579e24,_0x2d33ad){return new BPromise(function(_0x331011,_0x37f27a){return getAuthToken(_0x445434,_0x466fce,_0x2d33ad)[_0x6c7d('0x13')](function(_0x167703){var _0x14b44c={'method':_0x6c7d('0x2e'),'uri':_0x6a5a80+_0x6c7d('0x2f'),'headers':{'Authorization':_0x6c7d('0x19')+_0x167703,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x14b44c);})[_0x6c7d('0x13')](function(_0xacb4d3){var _0x4b6b64=null;if(_0xacb4d3){var _0x337aaf=_0xacb4d3[_0x6c7d('0x1a')];var _0x249573=![];for(_0x4b6b64=0x0;_0x4b6b64<_0x337aaf[_0x6c7d('0x1d')];_0x4b6b64++){var _0x15e10f=_0x2d33ad[_0x6c7d('0x23')]()==='outbound'?_0x579e24[_0x6c7d('0x25')]:_0x579e24[_0x6c7d('0x26')];if(_0x337aaf[_0x4b6b64][_0x6c7d('0x30')]===_0x15e10f){_0x249573=!![];_0x34383c[_0x6c7d('0x31')]=_0x337aaf[_0x4b6b64][_0x6c7d('0x32')];}}if(_0x249573){_0x331011(_0x34383c);}else{return createEndUser(_0x34383c,_0x445434,_0x466fce,_0x6a5a80,_0x579e24,_0x2d33ad)[_0x6c7d('0x13')](function(_0x3ee72d){_0x331011(_0x3ee72d);});}}else{return createEndUser(_0x34383c,_0x445434,_0x466fce,_0x6a5a80,_0x579e24,_0x2d33ad)[_0x6c7d('0x13')](function(_0xd3b4fc){_0x331011(_0xd3b4fc);});}});});}function getCustomFields(_0xa7c8e5,_0x514094,_0x4d5b70){var _0x4514d5={};if(_0xa7c8e5[_0x6c7d('0x1d')]>0x0){_[_0x6c7d('0x33')](_0xa7c8e5,function(_0x37bf7c){if(_0x37bf7c[_0x6c7d('0x34')]==='string'&&_0x37bf7c['nameField']&&!_0x37bf7c[_0x6c7d('0x35')]){var _0xed277c=_0x37bf7c[_0x6c7d('0x36')][_0x6c7d('0x23')]();var _0xa4d7ca=_0xed277c[_0x6c7d('0x2c')](0x0,_0xed277c[_0x6c7d('0x37')]('_'));var _0x3b1b91=_0xed277c[_0x6c7d('0x2c')](_0xed277c[_0x6c7d('0x37')]('_')+0x1);if(_0xa4d7ca===_0x4d5b70){_0x4514d5[_0x3b1b91]=_0x37bf7c[_0x6c7d('0x38')];}}});}return _0x4514d5;}function getTicket(_0x2f4eb7,_0x17d0bf,_0x5f26bd,_0x423902,_0x1d8779,_0x27dee6,_0x14c6a2){return new BPromise(function(_0x268a9f,_0x15a4fe){var _0x36b3bd;return getAuthToken(_0x17d0bf,_0x5f26bd,_0x14c6a2)[_0x6c7d('0x13')](function(_0x30f087){if(_0x27dee6[_0x6c7d('0x39')]===_0x6c7d('0x3a')){_0x36b3bd={'method':_0x6c7d('0xd'),'uri':_0x423902+_0x6c7d('0x3b'),'body':Object[_0x6c7d('0x3c')]({},{'title':intUtil[_0x6c7d('0x3d')](_0x27dee6['Subjects'],_0x1d8779,'\x20'),'description':intUtil[_0x6c7d('0x3d')](_0x27dee6[_0x6c7d('0x3e')],_0x1d8779,'\x0a'),'customerid_contact@odata.bind':_0x6c7d('0x3f')+_0x2f4eb7[_0x6c7d('0x31')]+')','ownerid@odata.bind':_0x6c7d('0x28')+_0x2f4eb7[_0x6c7d('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x27dee6['Fields'],_0x1d8779,_0x27dee6[_0x6c7d('0x39')])),'headers':{'Authorization':_0x6c7d('0x19')+_0x30f087,'OData-Version':_0x6c7d('0x29')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x27dee6[_0x6c7d('0x39')]===_0x6c7d('0x40')){_0x36b3bd={'method':_0x6c7d('0xd'),'uri':_0x423902+'phonecalls','body':Object[_0x6c7d('0x3c')]({},{'subject':intUtil[_0x6c7d('0x3d')](_0x27dee6[_0x6c7d('0x41')],_0x1d8779,'\x20'),'phonenumber':String(_0x1d8779[_0x6c7d('0x26')]),'description':intUtil['getString'](_0x27dee6[_0x6c7d('0x3e')],_0x1d8779,'\x0a'),'regardingobjectid_contact@odata.bind':_0x6c7d('0x3f')+_0x2f4eb7[_0x6c7d('0x31')]+')','ownerid@odata.bind':_0x6c7d('0x28')+_0x2f4eb7[_0x6c7d('0x21')]+')','directioncode':_0x2f4eb7[_0x6c7d('0x42')]===_0x6c7d('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2f4eb7[_0x6c7d('0x21')]+')','participationtypemask':_0x2f4eb7['callDirection']===_0x6c7d('0x43')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x2f4eb7['enduserId']+')','participationtypemask':_0x2f4eb7[_0x6c7d('0x42')]===_0x6c7d('0x43')?0x1:0x2}]},getCustomFields(_0x27dee6[_0x6c7d('0x44')],_0x1d8779,_0x27dee6[_0x6c7d('0x39')])),'headers':{'Authorization':'Bearer\x20'+_0x30f087,'OData-Version':_0x6c7d('0x29')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x36b3bd);})[_0x6c7d('0x13')](function(_0x3b2f98){var _0x3db814=_0x3b2f98[_0x6c7d('0x2a')]['odata-entityid'];var _0x559992=_0x3db814[_0x6c7d('0x2c')](_0x3db814[_0x6c7d('0x2d')]('(')+0x1,_0x3db814[_0x6c7d('0x2d')](')'));_0x2f4eb7['ticketId']=_0x559992;_0x268a9f(_0x2f4eb7);})[_0x6c7d('0x22')](function(_0x583abe){_0x15a4fe(_0x583abe['message']);});});}function emit(_0x442cd8,_0x1155d2,_0x2e56ec,_0x3bf9a0){var _0x58d9f7={'uri':util[_0x6c7d('0x45')](_0x6c7d('0x46'),_0x442cd8,_0x2e56ec,_0x3bf9a0)};io['to'](util[_0x6c7d('0x45')](_0x6c7d('0x47'),_0x1155d2))[_0x6c7d('0x48')]('trigger:browser:url',_0x58d9f7);}exports['cs']=function(_0x4b090c,_0x38b77a,_0x4f4b5a,_0x1f3c75,_0x3a998b,_0x2af260,_0x107070,_0xecb479){var _0x593e47={};_0x2af260[_0x6c7d('0xf')]=intUtil['stripTrailingSlash'](_0x2af260[_0x6c7d('0xf')]);_0x2af260[_0x6c7d('0x49')]=intUtil[_0x6c7d('0x4a')](_0x2af260[_0x6c7d('0x49')]);_0x593e47[_0x6c7d('0x42')]=_0xecb479==='queue'||_0xecb479===_0x6c7d('0x4b')?_0x6c7d('0x43'):_0x6c7d('0x24');var _0x457365=util[_0x6c7d('0x45')](_0x6c7d('0x4c'),_0x2af260[_0x6c7d('0xf')]);var _0x364ffb=util[_0x6c7d('0x45')](_0x6c7d('0x4d'),_0x2af260['tenantId']);var _0x3fb38b=util[_0x6c7d('0x45')](_0x6c7d('0x4e'),_0x2af260['serverUrl'],_0x38b77a[_0x6c7d('0x4f')],md5(_0x38b77a[_0x6c7d('0x4f')]));if(_0x3a998b&&_0x3a998b[_0x6c7d('0x50')]){logger['info'](_0x6c7d('0x51'),_0x6c7d('0x52'));_0x38b77a['recordingURL']=_0x3fb38b;}else if(_0x107070&&_0x107070[_0x6c7d('0x53')]&&_0x107070[_0x6c7d('0x53')]!==_0x6c7d('0x54')){logger[_0x6c7d('0x55')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x38b77a['recordingURL']=_0x3fb38b;}else{_0x38b77a[_0x6c7d('0x56')]='';}return getUser(_0x593e47,_0x2af260,_0x1f3c75,_0x364ffb,_0x457365,_0xecb479)[_0x6c7d('0x13')](function(_0x1c0c09){logger['info'](_0x6c7d('0x57'),_0x1c0c09[_0x6c7d('0x21')]);logger[_0x6c7d('0x55')](_0x6c7d('0x58'),_0x1c0c09[_0x6c7d('0x1b')]);return getEndUser(_0x1c0c09,_0x2af260,_0x364ffb,_0x457365,_0x38b77a,_0xecb479);})['then'](function(_0x56488b){logger[_0x6c7d('0x55')]('The\x20Enduser\x20ID\x20is:',_0x56488b[_0x6c7d('0x31')]);logger[_0x6c7d('0x55')]('The\x20Enduser\x20phone\x20is:',_0x38b77a[_0x6c7d('0x26')]);return getTicket(_0x56488b,_0x2af260,_0x364ffb,_0x457365,_0x38b77a,_0x4f4b5a,_0xecb479);})[_0x6c7d('0x13')](function(_0x74d661){logger[_0x6c7d('0x55')](util[_0x6c7d('0x45')]('The\x20%s\x20ID\x20is:\x20%s',_0x4f4b5a['ticketType'],_0x74d661[_0x6c7d('0x59')]));logger['info'](util[_0x6c7d('0x45')](_0x6c7d('0x5a'),_0xecb479));if(_0xecb479!==_0x6c7d('0x4b')){logger[_0x6c7d('0x55')]('['+_0xecb479[_0x6c7d('0x15')]()+']',_0x6c7d('0x5b'));emit(_0x2af260[_0x6c7d('0xf')],_0x1f3c75['name'],_0x4f4b5a['ticketType'],_0x74d661['ticketId']);}})[_0x6c7d('0x22')](function(_0x3cad6d){logger[_0x6c7d('0x5c')]('['+_0xecb479[_0x6c7d('0x15')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x6c7d('0x5d')](_0x3cad6d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5c70=['request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','toUpperCase','message','GET','systemusers?$select=internalemailaddress','Bearer\x20','4.0','value','validateEmail','email','length','internalemailaddress','userId','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','catch','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','enduserId','telephone1','forEach','nameField','customField','idField','substring','indexOf','content','incidents','assign','getString','Subjects','/contacts(','Fields','ticketType','phonecalls','queue','callDirection','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','serverUrl','stripTrailingSlash','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20User\x20ID\x20is:','The\x20User\x20email\x20is:','The\x20Enduser\x20phone\x20is:','The\x20%s\x20ID\x20is:\x20%s','call\x20direction:\x20%s','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect'];(function(_0x3f2262,_0x445ffa){var _0x293f32=function(_0x2b0e64){while(--_0x2b0e64){_0x3f2262['push'](_0x3f2262['shift']());}};_0x293f32(++_0x445ffa);}(_0x5c70,0x102));var _0x05c7=function(_0xed72b7,_0x431087){_0xed72b7=_0xed72b7-0x0;var _0x4c285f=_0x5c70[_0xed72b7];return _0x4c285f;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0x05c7('0x0'));var util=require(_0x05c7('0x1'));var intUtil=require(_0x05c7('0x2'));var md5=require(_0x05c7('0x3'));var Redis=require(_0x05c7('0x4'));var logger=require(_0x05c7('0x5'))(_0x05c7('0x6'));var config=require(_0x05c7('0x7'));config[_0x05c7('0x8')]=_[_0x05c7('0x9')](config[_0x05c7('0x8')],{'host':_0x05c7('0xa'),'port':0x18eb});var io=require(_0x05c7('0xb'))(new Redis(config[_0x05c7('0x8')]));function getAuthToken(_0x524f47,_0x2bd5f3,_0x21bf1d){var _0x3bab86={'method':_0x05c7('0xc'),'uri':_0x2bd5f3,'form':{'client_id':_0x524f47[_0x05c7('0xd')],'resource':_0x524f47[_0x05c7('0xe')],'username':_0x524f47[_0x05c7('0xf')],'password':_0x524f47[_0x05c7('0x10')],'grant_type':_0x05c7('0x10'),'client_secret':_0x524f47[_0x05c7('0x11')]},'json':!![]};return rp(_0x3bab86)[_0x05c7('0x12')](function(_0x1df86b){return _0x1df86b['access_token'];})['catch'](function(_0x4f44e2){logger['error']('['+[_0x21bf1d[_0x05c7('0x13')]()]+']\x20Wrong\x20credentials!');return _0x4f44e2[_0x05c7('0x14')];});}function getUser(_0xdc29,_0x11d8c9,_0x24dc12,_0x1a9694,_0x9a9627,_0x18cf2f){return new BPromise(function(_0x310fc5,_0x15b561){return getAuthToken(_0x11d8c9,_0x1a9694,_0x18cf2f)[_0x05c7('0x12')](function(_0x354553){var _0x5bab6d={'method':_0x05c7('0x15'),'uri':_0x9a9627+_0x05c7('0x16'),'headers':{'Authorization':_0x05c7('0x17')+_0x354553,'OData-Version':_0x05c7('0x18')},'json':!![]};return rp(_0x5bab6d);})[_0x05c7('0x12')](function(_0x445ebe){var _0x2c4a3c=_0x445ebe[_0x05c7('0x19')];var _0x41cc08=![];var _0x1b9ecf=null;if(_0x24dc12&&intUtil[_0x05c7('0x1a')](_0x24dc12[_0x05c7('0x1b')])){_0xdc29['userEmail']=_0x24dc12[_0x05c7('0x1b')];for(_0x1b9ecf=0x0;_0x1b9ecf<_0x2c4a3c[_0x05c7('0x1c')];_0x1b9ecf++){if(_0x2c4a3c[_0x1b9ecf][_0x05c7('0x1d')]===_0x24dc12['email']){_0x41cc08=!![];_0xdc29[_0x05c7('0x1e')]=_0x2c4a3c[_0x1b9ecf][_0x05c7('0x1f')];}}}if(!_0x41cc08){logger[_0x05c7('0x20')]('['+[_0x18cf2f[_0x05c7('0x13')]()]+_0x05c7('0x21'));_0xdc29[_0x05c7('0x22')]=_0x11d8c9['username'];for(_0x1b9ecf=0x0;_0x1b9ecf<_0x2c4a3c[_0x05c7('0x1c')];_0x1b9ecf++){if(_0x2c4a3c[_0x1b9ecf][_0x05c7('0x1d')]===_0x11d8c9[_0x05c7('0xf')]){_0xdc29[_0x05c7('0x1e')]=_0x2c4a3c[_0x1b9ecf][_0x05c7('0x1f')];}}}_0x310fc5(_0xdc29);})[_0x05c7('0x23')](function(_0x4d2f03){_0x15b561(_0x4d2f03[_0x05c7('0x14')]);});});}function createEndUser(_0x3abcec,_0x5aba55,_0x2e0145,_0x9028ca,_0x7db51a,_0x1c2978){return new BPromise(function(_0x53c674,_0x2abc92){return getAuthToken(_0x5aba55,_0x2e0145,_0x1c2978)[_0x05c7('0x12')](function(_0x305025){var _0x792092=_0x1c2978['toLowerCase']()===_0x05c7('0x24')?_0x7db51a[_0x05c7('0x25')]:_0x7db51a[_0x05c7('0x26')];var _0x280f6c={'method':_0x05c7('0xc'),'uri':_0x9028ca+_0x05c7('0x27'),'body':{'telephone1':_0x792092,'fullname':_0x792092,'firstname':_0x792092,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x05c7('0x28')+_0x3abcec['userId']+')'},'headers':{'Authorization':_0x05c7('0x17')+_0x305025,'OData-Version':_0x05c7('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x280f6c);})[_0x05c7('0x12')](function(_0x588975){var _0x36edf5=_0x588975[_0x05c7('0x29')][_0x05c7('0x2a')];var _0x58b6cc=_0x36edf5['substring'](_0x36edf5[_0x05c7('0x2b')]('(')+0x1,_0x36edf5[_0x05c7('0x2b')](')'));_0x3abcec[_0x05c7('0x2c')]=_0x58b6cc;_0x53c674(_0x3abcec);})[_0x05c7('0x23')](function(_0x291b92){_0x2abc92(_0x291b92[_0x05c7('0x14')]);});});}function getEndUser(_0x5eeec7,_0xef4226,_0x2daf79,_0x1bd05c,_0x312222,_0x24a160){return new BPromise(function(_0x95335a,_0xaedec4){return getAuthToken(_0xef4226,_0x2daf79,_0x24a160)[_0x05c7('0x12')](function(_0x43cd02){var _0xe77be1={'method':_0x05c7('0x15'),'uri':_0x1bd05c+'contacts?$select=telephone1','headers':{'Authorization':_0x05c7('0x17')+_0x43cd02,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xe77be1);})['then'](function(_0xd570b5){var _0x2217c4=null;if(_0xd570b5){var _0x1bd15e=_0xd570b5[_0x05c7('0x19')];var _0x4e049f=![];for(_0x2217c4=0x0;_0x2217c4<_0x1bd15e[_0x05c7('0x1c')];_0x2217c4++){var _0x4683f1=_0x24a160['toLowerCase']()==='outbound'?_0x312222['destcalleridnum']:_0x312222[_0x05c7('0x26')];if(_0x1bd15e[_0x2217c4][_0x05c7('0x2d')]===_0x4683f1){_0x4e049f=!![];_0x5eeec7[_0x05c7('0x2c')]=_0x1bd15e[_0x2217c4]['contactid'];}}if(_0x4e049f){_0x95335a(_0x5eeec7);}else{return createEndUser(_0x5eeec7,_0xef4226,_0x2daf79,_0x1bd05c,_0x312222,_0x24a160)[_0x05c7('0x12')](function(_0x34f3d1){_0x95335a(_0x34f3d1);});}}else{return createEndUser(_0x5eeec7,_0xef4226,_0x2daf79,_0x1bd05c,_0x312222,_0x24a160)['then'](function(_0x32e90f){_0x95335a(_0x32e90f);});}});});}function getCustomFields(_0x3e0cd9,_0x3ed66e,_0xb6b6e0){var _0x46048d={};if(_0x3e0cd9[_0x05c7('0x1c')]>0x0){_[_0x05c7('0x2e')](_0x3e0cd9,function(_0x391719){if(_0x391719['type']==='string'&&_0x391719[_0x05c7('0x2f')]&&!_0x391719[_0x05c7('0x30')]){var _0x4df129=_0x391719[_0x05c7('0x31')]['toLowerCase']();var _0x1fd773=_0x4df129[_0x05c7('0x32')](0x0,_0x4df129['indexOf']('_'));var _0x43a813=_0x4df129['substring'](_0x4df129[_0x05c7('0x33')]('_')+0x1);if(_0x1fd773===_0xb6b6e0){_0x46048d[_0x43a813]=_0x391719[_0x05c7('0x34')];}}});}return _0x46048d;}function getTicket(_0x19d971,_0x50499a,_0x503fcd,_0x335719,_0x32ef24,_0x3d24b9,_0x148701){return new BPromise(function(_0x23403b,_0x26819e){var _0x2cff62;return getAuthToken(_0x50499a,_0x503fcd,_0x148701)[_0x05c7('0x12')](function(_0xb2d03d){if(_0x3d24b9['ticketType']==='incident'){_0x2cff62={'method':_0x05c7('0xc'),'uri':_0x335719+_0x05c7('0x35'),'body':Object[_0x05c7('0x36')]({},{'title':intUtil[_0x05c7('0x37')](_0x3d24b9[_0x05c7('0x38')],_0x32ef24,'\x20'),'description':intUtil[_0x05c7('0x37')](_0x3d24b9['Descriptions'],_0x32ef24,'\x0a'),'customerid_contact@odata.bind':_0x05c7('0x39')+_0x19d971[_0x05c7('0x2c')]+')','ownerid@odata.bind':_0x05c7('0x28')+_0x19d971[_0x05c7('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0x3d24b9[_0x05c7('0x3a')],_0x32ef24,_0x3d24b9[_0x05c7('0x3b')])),'headers':{'Authorization':_0x05c7('0x17')+_0xb2d03d,'OData-Version':_0x05c7('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3d24b9[_0x05c7('0x3b')]==='phonecall'){_0x2cff62={'method':_0x05c7('0xc'),'uri':_0x335719+_0x05c7('0x3c'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x3d24b9[_0x05c7('0x38')],_0x32ef24,'\x20'),'phonenumber':String(_0x32ef24['calleridnum']),'description':intUtil['getString'](_0x3d24b9['Descriptions'],_0x32ef24,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x19d971['enduserId']+')','ownerid@odata.bind':_0x05c7('0x28')+_0x19d971['userId']+')','directioncode':_0x19d971['callDirection']===_0x05c7('0x3d')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x05c7('0x28')+_0x19d971['userId']+')','participationtypemask':_0x19d971['callDirection']===_0x05c7('0x3d')?0x2:0x1},{'partyid_contact@odata.bind':_0x05c7('0x39')+_0x19d971[_0x05c7('0x2c')]+')','participationtypemask':_0x19d971[_0x05c7('0x3e')]===_0x05c7('0x3d')?0x1:0x2}]},getCustomFields(_0x3d24b9[_0x05c7('0x3a')],_0x32ef24,_0x3d24b9['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0xb2d03d,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2cff62);})[_0x05c7('0x12')](function(_0x1a4ea7){var _0x207806=_0x1a4ea7[_0x05c7('0x29')]['odata-entityid'];var _0x583f8c=_0x207806[_0x05c7('0x32')](_0x207806[_0x05c7('0x2b')]('(')+0x1,_0x207806[_0x05c7('0x2b')](')'));_0x19d971[_0x05c7('0x3f')]=_0x583f8c;_0x23403b(_0x19d971);})['catch'](function(_0xd48345){_0x26819e(_0xd48345[_0x05c7('0x14')]);});});}function emit(_0x3b704a,_0x4931e8,_0x5792e9,_0x40a184){var _0x11fd90={'uri':util[_0x05c7('0x40')](_0x05c7('0x41'),_0x3b704a,_0x5792e9,_0x40a184)};io['to'](util[_0x05c7('0x40')]('user:%s',_0x4931e8))[_0x05c7('0x42')](_0x05c7('0x43'),_0x11fd90);}exports['cs']=function(_0x44e7e5,_0x1069bb,_0x16ab39,_0x5476dc,_0xf29b22,_0x114c77,_0x17c239,_0x15dac0){var _0x19c646={};_0x114c77[_0x05c7('0xe')]=intUtil['stripTrailingSlash'](_0x114c77[_0x05c7('0xe')]);_0x114c77[_0x05c7('0x44')]=intUtil[_0x05c7('0x45')](_0x114c77[_0x05c7('0x44')]);_0x19c646['callDirection']=_0x15dac0===_0x05c7('0x3d')||_0x15dac0===_0x05c7('0x46')?'queue':'outbound';var _0x504c70=util['format'](_0x05c7('0x47'),_0x114c77[_0x05c7('0xe')]);var _0x590f1=util[_0x05c7('0x40')](_0x05c7('0x48'),_0x114c77['tenantId']);var _0x4e939f=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x114c77[_0x05c7('0x44')],_0x1069bb['uniqueid'],md5(_0x1069bb[_0x05c7('0x49')]));if(_0xf29b22&&_0xf29b22['monitor_format']){logger[_0x05c7('0x20')]('[QUEUE]',_0x05c7('0x4a'));_0x1069bb[_0x05c7('0x4b')]=_0x4e939f;}else if(_0x17c239&&_0x17c239[_0x05c7('0x4c')]&&_0x17c239[_0x05c7('0x4c')]!==_0x05c7('0x4d')){logger[_0x05c7('0x20')]('[OUTBOUND]',_0x05c7('0x4a'));_0x1069bb[_0x05c7('0x4b')]=_0x4e939f;}else{_0x1069bb[_0x05c7('0x4b')]='';}return getUser(_0x19c646,_0x114c77,_0x5476dc,_0x590f1,_0x504c70,_0x15dac0)['then'](function(_0x2bc786){logger['info'](_0x05c7('0x4e'),_0x2bc786[_0x05c7('0x1e')]);logger['info'](_0x05c7('0x4f'),_0x2bc786[_0x05c7('0x22')]);return getEndUser(_0x2bc786,_0x114c77,_0x590f1,_0x504c70,_0x1069bb,_0x15dac0);})[_0x05c7('0x12')](function(_0xf7353a){logger[_0x05c7('0x20')]('The\x20Enduser\x20ID\x20is:',_0xf7353a[_0x05c7('0x2c')]);logger[_0x05c7('0x20')](_0x05c7('0x50'),_0x1069bb[_0x05c7('0x26')]);return getTicket(_0xf7353a,_0x114c77,_0x590f1,_0x504c70,_0x1069bb,_0x16ab39,_0x15dac0);})['then'](function(_0x1fbbf7){logger[_0x05c7('0x20')](util[_0x05c7('0x40')](_0x05c7('0x51'),_0x16ab39[_0x05c7('0x3b')],_0x1fbbf7[_0x05c7('0x3f')]));logger[_0x05c7('0x20')](util[_0x05c7('0x40')](_0x05c7('0x52'),_0x15dac0));if(_0x15dac0!==_0x05c7('0x46')){logger[_0x05c7('0x20')]('['+_0x15dac0[_0x05c7('0x13')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x114c77[_0x05c7('0xe')],_0x5476dc['name'],_0x16ab39[_0x05c7('0x3b')],_0x1fbbf7[_0x05c7('0x3f')]);}})[_0x05c7('0x23')](function(_0x187a26){logger[_0x05c7('0x53')]('['+_0x15dac0[_0x05c7('0x13')]()+_0x05c7('0x54'),util[_0x05c7('0x55')](_0x187a26,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 934ba35..33e0aa8 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 _0xf2ee=['validateEmail','%s/api/v2/agents','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','forEach','type','string','customField','nameField','toLowerCase','content','idField','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','%s/helpdesk/tickets/%d','[ABANDONED]','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','getString','Tags','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!'];(function(_0x2796cb,_0x5c2de9){var _0x5cf33a=function(_0x1b0d2b){while(--_0x1b0d2b){_0x2796cb['push'](_0x2796cb['shift']());}};_0x5cf33a(++_0x5c2de9);}(_0xf2ee,0x1a7));var _0xef2e=function(_0x4bf6a1,_0x5a914c){_0x4bf6a1=_0x4bf6a1-0x0;var _0x50df62=_0xf2ee[_0x4bf6a1];return _0x50df62;};'use strict';var _=require('lodash');var rp=require(_0xef2e('0x0'));var md5=require(_0xef2e('0x1'));var util=require(_0xef2e('0x2'));var Redis=require(_0xef2e('0x3'));var intUtil=require('./util');var config=require(_0xef2e('0x4'));var logger=require(_0xef2e('0x5'))(_0xef2e('0x6'));config[_0xef2e('0x7')]=_['defaults'](config['redis'],{'host':_0xef2e('0x8'),'port':0x18eb});var io=require(_0xef2e('0x9'))(new Redis(config[_0xef2e('0x7')]));var headers={'Content-Type':_0xef2e('0xa'),'Accept':_0xef2e('0xa')};function emit(_0x5b6062,_0x1f32e5,_0x1e83f6){io['to'](_0x5b6062)[_0xef2e('0xb')](_0x1f32e5,_0x1e83f6);}function getTicket(_0x4540c1,_0x4bc34f,_0x5e840d,_0x59504c,_0x4ff462){logger[_0xef2e('0xc')](_0xef2e('0xd'));var _0x4a76dd=_['merge']({'responder_id':_0x4bc34f['id'],'requester_id':_0x5e840d['id'],'name':util[_0xef2e('0xe')](_0xef2e('0xf'),_0x4ff462['calleridname']),'phone':_0x4ff462['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x59504c['Subjects'],_0x4ff462,'\x20'),'description':intUtil[_0xef2e('0x10')](_0x59504c['Descriptions'],_0x4ff462,'
'),'tags':getTags(_0x59504c[_0xef2e('0x11')],'name')},getCustomFields(_0x59504c[_0xef2e('0x12')],_0x4ff462));_0x4a76dd[_0xef2e('0x13')]=_[_0xef2e('0x14')](_[_0xef2e('0x15')](_0x4a76dd[_0xef2e('0x13')],'id'),'value');return request({'uri':util[_0xef2e('0xe')](_0xef2e('0x16'),_0x4540c1[_0xef2e('0x17')]),'method':_0xef2e('0x18'),'body':_0x4a76dd})[_0xef2e('0x19')](function(_0x334061){logger[_0xef2e('0xc')](_0xef2e('0x1a'));return _0x334061;});}function getUser(_0x294283,_0x1b68ba){if(intUtil[_0xef2e('0x1b')](_0x1b68ba)){return request({'uri':util[_0xef2e('0xe')](_0xef2e('0x1c'),_0x294283[_0xef2e('0x17')]),'qs':{'email':_0x1b68ba}})['then'](function(_0x1a21dd){if(_0x1a21dd[_0xef2e('0x1d')]){logger[_0xef2e('0xc')](_0xef2e('0x1e'));return _['find'](_0x1a21dd,function(_0x3cd34e){return _0x3cd34e[_0xef2e('0x1f')][_0xef2e('0x20')]===_0x1b68ba;});}else{logger[_0xef2e('0xc')](_0xef2e('0x21'));return request({'uri':util[_0xef2e('0xe')](_0xef2e('0x22'),_0x294283['remoteUri'])})[_0xef2e('0x19')](function(_0x4edf51){logger[_0xef2e('0xc')](_0xef2e('0x23'));return _0x4edf51;});}});}else{logger['info'](_0xef2e('0x24'));return request({'uri':util['format'](_0xef2e('0x22'),_0x294283[_0xef2e('0x17')])})[_0xef2e('0x19')](function(_0xebcc0d){logger['info']('Admin\x20account\x20selected.');return _0xebcc0d;});}}function getEndUser(_0x364e55,_0x10b95d,_0x50da25){logger[_0xef2e('0xc')](_0xef2e('0x25'),_0x50da25);return request({'uri':util['format']('%s/api/v2/contacts',_0x364e55[_0xef2e('0x17')]),'qs':{'phone':_0x50da25}})[_0xef2e('0x19')](function(_0x2d7443){if(_0x2d7443['length']){logger['info'](_0xef2e('0x26'));return _['find'](_0x2d7443,{'phone':_0x50da25});}else{logger[_0xef2e('0xc')](_0xef2e('0x27'));return request({'uri':util[_0xef2e('0xe')]('%s/api/v2/contacts',_0x364e55[_0xef2e('0x17')]),'method':_0xef2e('0x18'),'body':{'name':_0x10b95d,'phone':_0x50da25}})[_0xef2e('0x19')](function(_0x569a6a){logger[_0xef2e('0xc')](_0xef2e('0x28'));return _0x569a6a;});}});}function getAuth(_0x2f6384){return util[_0xef2e('0xe')](_0xef2e('0x29'),new Buffer(_0x2f6384[_0xef2e('0x2a')]+':X')[_0xef2e('0x2b')]('base64'));}function request(_0x163a75){logger[_0xef2e('0x2c')](_0xef2e('0x2d'),JSON[_0xef2e('0x2e')](_0x163a75));return rp(_['defaults'](_0x163a75,{'method':_0xef2e('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x33c665,_0x20b1eb){var _0x3ebe8f=[];if(_0x33c665&&_0x33c665['length']>0x0){_0x3ebe8f=_['map'](_0x33c665,_0x20b1eb);}return _0x3ebe8f;}function getCustomFields(_0x41c28c,_0x3138d2){var _0x5ab643=[];var _0x121370={'custom_fields':[]};if(_0x41c28c['length']>0x0){_[_0xef2e('0x30')](_0x41c28c,function(_0x5e95d8){if(_0x5e95d8[_0xef2e('0x31')]===_0xef2e('0x32')&&_0x5e95d8['nameField']&&!_0x5e95d8[_0xef2e('0x33')]){_0x121370[_0x5e95d8[_0xef2e('0x34')][_0xef2e('0x35')]()]=_0x5e95d8[_0xef2e('0x36')][_0xef2e('0x2b')]();}else if(_0x5e95d8[_0xef2e('0x31')]===_0xef2e('0x32')&&_0x5e95d8[_0xef2e('0x37')]&&_0x5e95d8[_0xef2e('0x33')]){_0x121370[_0xef2e('0x13')][_0xef2e('0x38')]({'id':_0x5e95d8['idField'],'value':_0x5e95d8[_0xef2e('0x36')]['toString']()});}else if(_0x5e95d8[_0xef2e('0x31')]===_0xef2e('0x39')&&_0x5e95d8[_0xef2e('0x3a')]&&_0x5e95d8[_0xef2e('0x37')]&&_0x5e95d8[_0xef2e('0x33')]){_0x3138d2[_0x5e95d8[_0xef2e('0x3a')]]&&_0x121370[_0xef2e('0x13')][_0xef2e('0x38')]({'id':_0x5e95d8['idField'],'value':_0x3138d2[_0x5e95d8[_0xef2e('0x3a')]][_0xef2e('0x2b')]()});}else if(_0x5e95d8['type']===_0xef2e('0x3b')&&_0x5e95d8[_0xef2e('0x3c')]&&_0x5e95d8[_0xef2e('0x3c')][_0xef2e('0x3d')]&&_0x5e95d8[_0xef2e('0x37')]&&_0x5e95d8[_0xef2e('0x33')]){_0x3138d2[_0x5e95d8[_0xef2e('0x3c')][_0xef2e('0x3d')]['toLowerCase']()]&&_0x121370[_0xef2e('0x13')][_0xef2e('0x38')]({'id':_0x5e95d8[_0xef2e('0x37')],'value':_0x3138d2[_0x5e95d8[_0xef2e('0x3c')]['name'][_0xef2e('0x35')]()][_0xef2e('0x2b')]()});}});}return _0x121370;}exports[_0xef2e('0x3e')]=function(_0x5e93f5,_0x538bf7,_0x47dda5,_0x2bdc2e,_0x41004e,_0x2b4caa){var _0x2e6e4c,_0x6d6094;_0x2b4caa[_0xef2e('0x17')]=intUtil[_0xef2e('0x3f')](_0x2b4caa['remoteUri']);_0x2b4caa[_0xef2e('0x40')]=intUtil['stripTrailingSlash'](_0x2b4caa['serverUrl']);if(_0x41004e&&_0x41004e[_0xef2e('0x41')]){logger[_0xef2e('0xc')](_0xef2e('0x42'),_0xef2e('0x43'));_0x538bf7['recordingURL']=util[_0xef2e('0xe')](_0xef2e('0x44'),_0x2b4caa[_0xef2e('0x40')],_0x538bf7[_0xef2e('0x45')],md5(_0x538bf7[_0xef2e('0x45')]));}else{_0x538bf7[_0xef2e('0x46')]='';}headers[_0xef2e('0x47')]=getAuth(_0x2b4caa);return getUser(_0x2b4caa,_0x2bdc2e[_0xef2e('0x20')])[_0xef2e('0x19')](function(_0x262336){_0x2e6e4c=_0x262336;logger['info'](_0xef2e('0x48'),_0x2e6e4c['id']);return getEndUser(_0x2b4caa,_0x538bf7[_0xef2e('0x49')],_0x538bf7[_0xef2e('0x4a')]);})[_0xef2e('0x19')](function(_0x4cfc10){_0x6d6094=_0x4cfc10;logger[_0xef2e('0xc')](_0xef2e('0x4b'),_0x6d6094['id']);return getTicket(_0x2b4caa,_0x2e6e4c,_0x6d6094,_0x47dda5,_0x538bf7);})[_0xef2e('0x19')](function(_0x3df3e5){if(_0x3df3e5&&_0x3df3e5['id']){logger['info']('Ticket\x20created!');logger['info'](_0xef2e('0x4c'),_0x3df3e5['id']);logger['info'](_0xef2e('0x42'),_0xef2e('0x4d'));emit(util[_0xef2e('0xe')](_0xef2e('0x4e'),_0x2bdc2e[_0xef2e('0x3d')]),_0xef2e('0x4f'),{'uri':util[_0xef2e('0xe')]('%s/helpdesk/tickets/%d',_0x2b4caa[_0xef2e('0x17')],_0x3df3e5['id'])});}})[_0xef2e('0x50')](function(_0x685713){logger[_0xef2e('0x51')](_0xef2e('0x42'),JSON[_0xef2e('0x2e')](_0x685713));});};exports[_0xef2e('0x52')]=function(_0x34f458,_0x4211e6,_0x237779,_0x1d16ae,_0x578a6e,_0x4a4e64,_0x1e9ea2){var _0x49f2a5,_0x30ea7d;_0x4a4e64['remoteUri']=intUtil[_0xef2e('0x3f')](_0x4a4e64[_0xef2e('0x17')]);_0x4a4e64[_0xef2e('0x40')]=intUtil['stripTrailingSlash'](_0x4a4e64[_0xef2e('0x40')]);if(_0x1e9ea2&&_0x1e9ea2[_0xef2e('0x53')]&&_0x1e9ea2['recordingFormat']!==_0xef2e('0x54')){logger[_0xef2e('0xc')]('[OUTBOUND]',_0xef2e('0x43'));_0x4211e6['recordingURL']=util['format'](_0xef2e('0x44'),_0x4a4e64['serverUrl'],_0x4211e6['uniqueid'],md5(_0x4211e6[_0xef2e('0x45')]));}headers['Authorization']=getAuth(_0x4a4e64);return getUser(_0x4a4e64,_0x1d16ae[_0xef2e('0x20')])[_0xef2e('0x19')](function(_0x351e68){_0x49f2a5=_0x351e68;logger[_0xef2e('0xc')](_0xef2e('0x48'),_0x49f2a5['id']);return getEndUser(_0x4a4e64,_0x4211e6[_0xef2e('0x55')],_0x4211e6[_0xef2e('0x56')]);})[_0xef2e('0x19')](function(_0x2cd38d){_0x30ea7d=_0x2cd38d;logger[_0xef2e('0xc')](_0xef2e('0x4b'),_0x30ea7d['id']);return getTicket(_0x4a4e64,_0x49f2a5,_0x30ea7d,_0x237779,_0x4211e6);})[_0xef2e('0x19')](function(_0x25737b){if(_0x25737b&&_0x25737b['id']){logger[_0xef2e('0xc')]('Ticket\x20created!');logger['info'](_0xef2e('0x4c'),_0x25737b['id']);logger[_0xef2e('0xc')](_0xef2e('0x57'),_0xef2e('0x4d'));emit(util['format']('user:%s',_0x1d16ae[_0xef2e('0x3d')]),_0xef2e('0x4f'),{'uri':util[_0xef2e('0xe')](_0xef2e('0x58'),_0x4a4e64[_0xef2e('0x17')],_0x25737b['id'])});}})[_0xef2e('0x50')](function(_0x4bca89){logger[_0xef2e('0x51')](_0xef2e('0x57'),JSON['stringify'](_0x4bca89));});};exports['abandoned']=function(_0xec5d96,_0x29b663,_0x15f138,_0x87b91d,_0x2edb92,_0x5e71e3){var _0x318ff1,_0x5cde1f;_0x5e71e3['remoteUri']=intUtil['stripTrailingSlash'](_0x5e71e3[_0xef2e('0x17')]);_0x5e71e3[_0xef2e('0x40')]=intUtil[_0xef2e('0x3f')](_0x5e71e3[_0xef2e('0x40')]);if(_0x2edb92&&_0x2edb92[_0xef2e('0x41')]){logger[_0xef2e('0xc')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x29b663['recordingURL']=util[_0xef2e('0xe')](_0xef2e('0x44'),_0x5e71e3['serverUrl'],_0x29b663[_0xef2e('0x45')],md5(_0x29b663[_0xef2e('0x45')]));}else{_0x29b663[_0xef2e('0x46')]='';}headers['Authorization']=getAuth(_0x5e71e3);return getUser(_0x5e71e3,'')['then'](function(_0x4a2ef6){_0x318ff1=_0x4a2ef6;logger['info'](_0xef2e('0x48'),_0x318ff1['id']);return getEndUser(_0x5e71e3,_0x29b663[_0xef2e('0x49')],_0x29b663[_0xef2e('0x4a')]);})[_0xef2e('0x19')](function(_0x1d0984){_0x5cde1f=_0x1d0984;logger['info'](_0xef2e('0x4b'),_0x5cde1f['id']);return getTicket(_0x5e71e3,_0x318ff1,_0x5cde1f,_0x15f138,_0x29b663);})[_0xef2e('0x19')](function(_0x15d172){if(_0x15d172){logger[_0xef2e('0xc')]('Ticket\x20created!');logger[_0xef2e('0xc')]('The\x20Ticket\x20ID\x20is:',_0x15d172['id']);}})[_0xef2e('0x50')](function(_0x129058){logger[_0xef2e('0x51')](_0xef2e('0x59'),JSON['stringify'](_0x129058));});}; \ No newline at end of file +var _0x5450=['Subjects','Descriptions','name','Fields','custom_fields','mapValues','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','type','nameField','customField','toLowerCase','string','idField','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','abandoned','[ABANDONED]','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','localhost','socket.io-emitter','redis','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString'];(function(_0x590097,_0x34c41f){var _0x14fbeb=function(_0x10271a){while(--_0x10271a){_0x590097['push'](_0x590097['shift']());}};_0x14fbeb(++_0x34c41f);}(_0x5450,0x1b9));var _0x0545=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x5450[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var rp=require(_0x0545('0x0'));var md5=require(_0x0545('0x1'));var util=require('util');var Redis=require(_0x0545('0x2'));var intUtil=require(_0x0545('0x3'));var config=require(_0x0545('0x4'));var logger=require(_0x0545('0x5'))(_0x0545('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x0545('0x7'),'port':0x18eb});var io=require(_0x0545('0x8'))(new Redis(config[_0x0545('0x9')]));var headers={'Content-Type':_0x0545('0xa'),'Accept':'application/json'};function emit(_0x208e93,_0xc6b56f,_0x3a1e64){io['to'](_0x208e93)[_0x0545('0xb')](_0xc6b56f,_0x3a1e64);}function getTicket(_0x4f7c25,_0x4b5fbf,_0x2306fd,_0xf2bfff,_0x50cf0c){logger[_0x0545('0xc')](_0x0545('0xd'));var _0x5deae7=_[_0x0545('0xe')]({'responder_id':_0x4b5fbf['id'],'requester_id':_0x2306fd['id'],'name':util[_0x0545('0xf')](_0x0545('0x10'),_0x50cf0c['calleridname']),'phone':_0x50cf0c[_0x0545('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x0545('0x12')](_0xf2bfff[_0x0545('0x13')],_0x50cf0c,'\x20'),'description':intUtil[_0x0545('0x12')](_0xf2bfff[_0x0545('0x14')],_0x50cf0c,'
'),'tags':getTags(_0xf2bfff['Tags'],_0x0545('0x15'))},getCustomFields(_0xf2bfff[_0x0545('0x16')],_0x50cf0c));_0x5deae7[_0x0545('0x17')]=_[_0x0545('0x18')](_['keyBy'](_0x5deae7['custom_fields'],'id'),_0x0545('0x19'));return request({'uri':util['format'](_0x0545('0x1a'),_0x4f7c25['remoteUri']),'method':_0x0545('0x1b'),'body':_0x5deae7})[_0x0545('0x1c')](function(_0x248a18){logger[_0x0545('0xc')](_0x0545('0x1d'));return _0x248a18;});}function getUser(_0x1ad74f,_0x3c73b5){if(intUtil[_0x0545('0x1e')](_0x3c73b5)){return request({'uri':util['format'](_0x0545('0x1f'),_0x1ad74f[_0x0545('0x20')]),'qs':{'email':_0x3c73b5}})[_0x0545('0x1c')](function(_0x444728){if(_0x444728[_0x0545('0x21')]){logger[_0x0545('0xc')](_0x0545('0x22'));return _['find'](_0x444728,function(_0x3db31e){return _0x3db31e[_0x0545('0x23')][_0x0545('0x24')]===_0x3c73b5;});}else{logger[_0x0545('0xc')](_0x0545('0x25'));return request({'uri':util[_0x0545('0xf')]('%s/api/v2/agents/me',_0x1ad74f[_0x0545('0x20')])})[_0x0545('0x1c')](function(_0x2a4b7a){logger[_0x0545('0xc')](_0x0545('0x26'));return _0x2a4b7a;});}});}else{logger[_0x0545('0xc')](_0x0545('0x27'));return request({'uri':util[_0x0545('0xf')](_0x0545('0x28'),_0x1ad74f[_0x0545('0x20')])})[_0x0545('0x1c')](function(_0x27fe72){logger[_0x0545('0xc')]('Admin\x20account\x20selected.');return _0x27fe72;});}}function getEndUser(_0x2091c8,_0x3475a0,_0x22b0aa){logger[_0x0545('0xc')]('Searching\x20enduser\x20with\x20phone',_0x22b0aa);return request({'uri':util['format']('%s/api/v2/contacts',_0x2091c8[_0x0545('0x20')]),'qs':{'phone':_0x22b0aa}})[_0x0545('0x1c')](function(_0x5be970){if(_0x5be970[_0x0545('0x21')]){logger[_0x0545('0xc')](_0x0545('0x29'));return _['find'](_0x5be970,{'phone':_0x22b0aa});}else{logger['info'](_0x0545('0x2a'));return request({'uri':util[_0x0545('0xf')]('%s/api/v2/contacts',_0x2091c8['remoteUri']),'method':'POST','body':{'name':_0x3475a0,'phone':_0x22b0aa}})[_0x0545('0x1c')](function(_0x34b109){logger['info'](_0x0545('0x2b'));return _0x34b109;});}});}function getAuth(_0x5e39e2){return util[_0x0545('0xf')](_0x0545('0x2c'),new Buffer(_0x5e39e2[_0x0545('0x2d')]+':X')[_0x0545('0x2e')]('base64'));}function request(_0xed850f){logger[_0x0545('0x2f')](_0x0545('0x30'),JSON[_0x0545('0x31')](_0xed850f));return rp(_['defaults'](_0xed850f,{'method':_0x0545('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x31d1e6,_0xfc6f0f){var _0x44d105=[];if(_0x31d1e6&&_0x31d1e6['length']>0x0){_0x44d105=_[_0x0545('0x33')](_0x31d1e6,_0xfc6f0f);}return _0x44d105;}function getCustomFields(_0x11ddee,_0x499f1d){var _0x5f57c5=[];var _0x52f4d8={'custom_fields':[]};if(_0x11ddee[_0x0545('0x21')]>0x0){_[_0x0545('0x34')](_0x11ddee,function(_0x3c1f2d){if(_0x3c1f2d[_0x0545('0x35')]==='string'&&_0x3c1f2d[_0x0545('0x36')]&&!_0x3c1f2d[_0x0545('0x37')]){_0x52f4d8[_0x3c1f2d['nameField'][_0x0545('0x38')]()]=_0x3c1f2d['content'][_0x0545('0x2e')]();}else if(_0x3c1f2d[_0x0545('0x35')]===_0x0545('0x39')&&_0x3c1f2d[_0x0545('0x3a')]&&_0x3c1f2d[_0x0545('0x37')]){_0x52f4d8[_0x0545('0x17')]['push']({'id':_0x3c1f2d[_0x0545('0x3a')],'value':_0x3c1f2d['content'][_0x0545('0x2e')]()});}else if(_0x3c1f2d[_0x0545('0x35')]===_0x0545('0x3b')&&_0x3c1f2d[_0x0545('0x3c')]&&_0x3c1f2d[_0x0545('0x3a')]&&_0x3c1f2d[_0x0545('0x37')]){_0x499f1d[_0x3c1f2d[_0x0545('0x3c')]]&&_0x52f4d8[_0x0545('0x17')][_0x0545('0x3d')]({'id':_0x3c1f2d[_0x0545('0x3a')],'value':_0x499f1d[_0x3c1f2d[_0x0545('0x3c')]][_0x0545('0x2e')]()});}else if(_0x3c1f2d[_0x0545('0x35')]===_0x0545('0x3e')&&_0x3c1f2d[_0x0545('0x3f')]&&_0x3c1f2d['Variable']['name']&&_0x3c1f2d[_0x0545('0x3a')]&&_0x3c1f2d[_0x0545('0x37')]){_0x499f1d[_0x3c1f2d[_0x0545('0x3f')]['name'][_0x0545('0x38')]()]&&_0x52f4d8['custom_fields'][_0x0545('0x3d')]({'id':_0x3c1f2d[_0x0545('0x3a')],'value':_0x499f1d[_0x3c1f2d[_0x0545('0x3f')][_0x0545('0x15')]['toLowerCase']()]['toString']()});}});}return _0x52f4d8;}exports[_0x0545('0x40')]=function(_0x5c48fc,_0x34d92a,_0x1a5603,_0x1d2aa8,_0x463577,_0x5acffc){var _0x158ab8,_0x5adfb2;_0x5acffc[_0x0545('0x20')]=intUtil[_0x0545('0x41')](_0x5acffc[_0x0545('0x20')]);_0x5acffc[_0x0545('0x42')]=intUtil[_0x0545('0x41')](_0x5acffc[_0x0545('0x42')]);if(_0x463577&&_0x463577[_0x0545('0x43')]){logger['info']('[QUEUE]',_0x0545('0x44'));_0x34d92a[_0x0545('0x45')]=util[_0x0545('0xf')](_0x0545('0x46'),_0x5acffc['serverUrl'],_0x34d92a[_0x0545('0x47')],md5(_0x34d92a[_0x0545('0x47')]));}else{_0x34d92a[_0x0545('0x45')]='';}headers[_0x0545('0x48')]=getAuth(_0x5acffc);return getUser(_0x5acffc,_0x1d2aa8[_0x0545('0x24')])[_0x0545('0x1c')](function(_0x54eeee){_0x158ab8=_0x54eeee;logger[_0x0545('0xc')](_0x0545('0x49'),_0x158ab8['id']);return getEndUser(_0x5acffc,_0x34d92a[_0x0545('0x4a')],_0x34d92a[_0x0545('0x11')]);})[_0x0545('0x1c')](function(_0xf58f59){_0x5adfb2=_0xf58f59;logger[_0x0545('0xc')](_0x0545('0x4b'),_0x5adfb2['id']);return getTicket(_0x5acffc,_0x158ab8,_0x5adfb2,_0x1a5603,_0x34d92a);})[_0x0545('0x1c')](function(_0x577891){if(_0x577891&&_0x577891['id']){logger[_0x0545('0xc')](_0x0545('0x1d'));logger[_0x0545('0xc')](_0x0545('0x4c'),_0x577891['id']);logger[_0x0545('0xc')]('[QUEUE]',_0x0545('0x4d'));emit(util['format'](_0x0545('0x4e'),_0x1d2aa8['name']),_0x0545('0x4f'),{'uri':util['format'](_0x0545('0x50'),_0x5acffc[_0x0545('0x20')],_0x577891['id'])});}})[_0x0545('0x51')](function(_0x5c5dbb){logger[_0x0545('0x52')](_0x0545('0x53'),JSON[_0x0545('0x31')](_0x5c5dbb));});};exports[_0x0545('0x54')]=function(_0x45638d,_0x5d5bb9,_0x2d7ec7,_0x1a8ce1,_0x200779,_0x90603c,_0x55f61e){var _0x111e64,_0x5a0158;_0x90603c['remoteUri']=intUtil[_0x0545('0x41')](_0x90603c[_0x0545('0x20')]);_0x90603c[_0x0545('0x42')]=intUtil[_0x0545('0x41')](_0x90603c[_0x0545('0x42')]);if(_0x55f61e&&_0x55f61e[_0x0545('0x55')]&&_0x55f61e[_0x0545('0x55')]!==_0x0545('0x56')){logger[_0x0545('0xc')](_0x0545('0x57'),_0x0545('0x44'));_0x5d5bb9[_0x0545('0x45')]=util[_0x0545('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x90603c[_0x0545('0x42')],_0x5d5bb9[_0x0545('0x47')],md5(_0x5d5bb9['uniqueid']));}headers[_0x0545('0x48')]=getAuth(_0x90603c);return getUser(_0x90603c,_0x1a8ce1['email'])[_0x0545('0x1c')](function(_0x5312a8){_0x111e64=_0x5312a8;logger['info'](_0x0545('0x49'),_0x111e64['id']);return getEndUser(_0x90603c,_0x5d5bb9[_0x0545('0x58')],_0x5d5bb9[_0x0545('0x59')]);})['then'](function(_0x1af43a){_0x5a0158=_0x1af43a;logger['info'](_0x0545('0x4b'),_0x5a0158['id']);return getTicket(_0x90603c,_0x111e64,_0x5a0158,_0x2d7ec7,_0x5d5bb9);})['then'](function(_0x30d8cc){if(_0x30d8cc&&_0x30d8cc['id']){logger[_0x0545('0xc')]('Ticket\x20created!');logger[_0x0545('0xc')]('The\x20Ticket\x20ID\x20is:',_0x30d8cc['id']);logger['info'](_0x0545('0x57'),_0x0545('0x4d'));emit(util[_0x0545('0xf')](_0x0545('0x4e'),_0x1a8ce1[_0x0545('0x15')]),_0x0545('0x4f'),{'uri':util[_0x0545('0xf')](_0x0545('0x50'),_0x90603c[_0x0545('0x20')],_0x30d8cc['id'])});}})[_0x0545('0x51')](function(_0x4877a3){logger[_0x0545('0x52')](_0x0545('0x57'),JSON[_0x0545('0x31')](_0x4877a3));});};exports[_0x0545('0x5a')]=function(_0x152e55,_0x28e4f3,_0x4ad73d,_0x7ad790,_0x3fee74,_0x36ae7e){var _0x15ed3c,_0x5063d3;_0x36ae7e['remoteUri']=intUtil[_0x0545('0x41')](_0x36ae7e[_0x0545('0x20')]);_0x36ae7e[_0x0545('0x42')]=intUtil[_0x0545('0x41')](_0x36ae7e['serverUrl']);if(_0x3fee74&&_0x3fee74['monitor_format']){logger[_0x0545('0xc')](_0x0545('0x5b'),'Recording\x20is\x20enabled!');_0x28e4f3[_0x0545('0x45')]=util[_0x0545('0xf')](_0x0545('0x46'),_0x36ae7e['serverUrl'],_0x28e4f3['uniqueid'],md5(_0x28e4f3[_0x0545('0x47')]));}else{_0x28e4f3[_0x0545('0x45')]='';}headers['Authorization']=getAuth(_0x36ae7e);return getUser(_0x36ae7e,'')[_0x0545('0x1c')](function(_0x1cb426){_0x15ed3c=_0x1cb426;logger[_0x0545('0xc')]('The\x20User\x20ID\x20is:',_0x15ed3c['id']);return getEndUser(_0x36ae7e,_0x28e4f3[_0x0545('0x4a')],_0x28e4f3[_0x0545('0x11')]);})['then'](function(_0x1c5146){_0x5063d3=_0x1c5146;logger[_0x0545('0xc')](_0x0545('0x4b'),_0x5063d3['id']);return getTicket(_0x36ae7e,_0x15ed3c,_0x5063d3,_0x4ad73d,_0x28e4f3);})[_0x0545('0x1c')](function(_0x292af5){if(_0x292af5){logger[_0x0545('0xc')](_0x0545('0x1d'));logger['info'](_0x0545('0x4c'),_0x292af5['id']);}})['catch'](function(_0x562a20){logger[_0x0545('0x52')](_0x0545('0x5b'),JSON['stringify'](_0x562a20));});}; \ 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 42440e1..bf9b32d 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 _0x71f4=['./freshdesk','./zoho','./vtiger','./dynamics365','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','dynamics365','exec','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','abandoned','zendesk','unknown\x20integration','../../../../config/logger','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','data3','error','%s\x20account\x20#%s\x20not\x20found','./zendesk','./salesforce','./sugarcrm'];(function(_0x45dea6,_0x3cd507){var _0x46b25f=function(_0x7f4162){while(--_0x7f4162){_0x45dea6['push'](_0x45dea6['shift']());}};_0x46b25f(++_0x3cd507);}(_0x71f4,0xf9));var _0x471f=function(_0x35148b,_0x4b2ebc){_0x35148b=_0x35148b-0x0;var _0x1a6ba3=_0x71f4[_0x35148b];return _0x1a6ba3;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0x471f('0x0'));var salesforce=require(_0x471f('0x1'));var sugarcrm=require(_0x471f('0x2'));var freshdesk=require(_0x471f('0x3'));var zoho=require(_0x471f('0x4'));var desk=require('./desk');var vtiger=require(_0x471f('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x471f('0x6'));var integrations=['zendesk',_0x471f('0x7'),_0x471f('0x8'),_0x471f('0x9'),_0x471f('0xa'),_0x471f('0xb'),_0x471f('0xc'),_0x471f('0xd'),_0x471f('0xe')];exports[_0x471f('0xf')]=function(_0x556733,_0x51f77e,_0x519567,_0x321e48,_0x22ea73,_0x55042a){if(_0x519567){if(_[_0x471f('0x10')](integrations,_0x556733[_0x471f('0x11')][_0x471f('0x12')]())){try{var _0x4d7364=null;var _0x8b54cb='';var _0x16662a=_0x519567[_0x556733[_0x471f('0x11')][_0x471f('0x12')]()];if(_0x16662a){var _0xafc5e8=_0x16662a[_0x556733[_0x471f('0x13')]];if(_0xafc5e8){var _0xdc7747=_[_0x471f('0x14')](_0xafc5e8[_0x471f('0x15')],{'id':parseInt(_0x556733['data3'],0xa)});if(_0xdc7747){if(_0x321e48){if(_0x22ea73&&_0x51f77e[_0x471f('0x16')]){_0x8b54cb='queue';}else if(_0x51f77e[_0x471f('0x17')]){_0x8b54cb=_0x471f('0x18');}else{console[_0x471f('0x19')](_0x471f('0x1a'),_0x51f77e);}}else{_0x8b54cb=_0x471f('0x1b');}switch(_0x556733[_0x471f('0x11')][_0x471f('0x12')]()){case _0x471f('0x1c'):zendesk[_0x8b54cb](_0x556733,_0x51f77e,_0xdc7747,_0x321e48,_0x22ea73,_0xafc5e8,_0x55042a);break;case'salesforce':salesforce[_0x8b54cb](_0x556733,_0x51f77e,_0xdc7747,_0x321e48,_0x22ea73,_0xafc5e8,_0x55042a);break;case _0x471f('0x8'):sugarcrm[_0x8b54cb](_0x556733,_0x51f77e,_0xdc7747,_0x321e48,_0x22ea73,_0xafc5e8,_0x55042a);break;case _0x471f('0x9'):freshdesk[_0x8b54cb](_0x556733,_0x51f77e,_0xdc7747,_0x321e48,_0x22ea73,_0xafc5e8,_0x55042a);break;case'zoho':zoho[_0x8b54cb](_0x556733,_0x51f77e,_0xdc7747,_0x321e48,_0x22ea73,_0xafc5e8,_0x55042a);break;case _0x471f('0xb'):desk[_0x8b54cb](_0x556733,_0x51f77e,_0xdc7747,_0x321e48,_0x22ea73,_0xafc5e8,_0x55042a);break;case'vtiger':vtiger[_0x8b54cb](_0x556733,_0x51f77e,_0xdc7747,_0x321e48,_0x22ea73,_0xafc5e8,_0x55042a);break;case _0x471f('0xd'):servicenow['cs'](_0x556733,_0x51f77e,_0xdc7747,_0x321e48,_0x22ea73,_0xafc5e8,_0x55042a,_0x8b54cb);case'dynamics365':dynamics365['cs'](_0x556733,_0x51f77e,_0xdc7747,_0x321e48,_0x22ea73,_0xafc5e8,_0x55042a,_0x8b54cb);break;default:console[_0x471f('0x19')](_0x471f('0x1d'));}}else{_0x4d7364=require(_0x471f('0x1e'))(_0x556733[_0x471f('0x11')]['toLowerCase']());_0x4d7364['error'](_0x471f('0x1f'),util['format'](_0x471f('0x20'),_0x556733['data1']['toLowerCase'](),_0x556733[_0x471f('0x21')]));}}else{_0x4d7364=require(_0x471f('0x1e'))(_0x556733['data1'][_0x471f('0x12')]());_0x4d7364[_0x471f('0x22')](_0x471f('0x1f'),util['format'](_0x471f('0x23'),_0x556733[_0x471f('0x11')][_0x471f('0x12')](),_0x556733[_0x471f('0x13')]));}}else{}}catch(_0x427c53){console['error'](_0x427c53);}}}}; \ No newline at end of file +var _0x66d3=['abandoned','log','../../../../config/logger','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./sugarcrm','./freshdesk','./desk','./servicenow','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','dynamics365','exec','includes','data1','toLowerCase','data2','find','data3','queue','routeId','outbound','EVENT\x20UNKNOWN'];(function(_0xe6ce5f,_0x24a05a){var _0x2af5a9=function(_0x58e2ea){while(--_0x58e2ea){_0xe6ce5f['push'](_0xe6ce5f['shift']());}};_0x2af5a9(++_0x24a05a);}(_0x66d3,0x10f));var _0x366d=function(_0x5930f2,_0x11d6e9){_0x5930f2=_0x5930f2-0x0;var _0x32df4b=_0x66d3[_0x5930f2];return _0x32df4b;};'use strict';var _=require(_0x366d('0x0'));var util=require('util');var zendesk=require(_0x366d('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x366d('0x2'));var freshdesk=require(_0x366d('0x3'));var zoho=require('./zoho');var desk=require(_0x366d('0x4'));var vtiger=require('./vtiger');var servicenow=require(_0x366d('0x5'));var dynamics365=require('./dynamics365');var integrations=[_0x366d('0x6'),_0x366d('0x7'),_0x366d('0x8'),_0x366d('0x9'),_0x366d('0xa'),_0x366d('0xb'),_0x366d('0xc'),_0x366d('0xd'),_0x366d('0xe')];exports[_0x366d('0xf')]=function(_0x2adf49,_0x4e3ba3,_0x30ad5a,_0x38213d,_0x3b6902,_0x40cc04){if(_0x30ad5a){if(_[_0x366d('0x10')](integrations,_0x2adf49[_0x366d('0x11')][_0x366d('0x12')]())){try{var _0x29189e=null;var _0x5007a3='';var _0x58553b=_0x30ad5a[_0x2adf49[_0x366d('0x11')][_0x366d('0x12')]()];if(_0x58553b){var _0x3dd776=_0x58553b[_0x2adf49[_0x366d('0x13')]];if(_0x3dd776){var _0x1f7b59=_[_0x366d('0x14')](_0x3dd776['Configurations'],{'id':parseInt(_0x2adf49[_0x366d('0x15')],0xa)});if(_0x1f7b59){if(_0x38213d){if(_0x3b6902&&_0x4e3ba3[_0x366d('0x16')]){_0x5007a3='queue';}else if(_0x4e3ba3[_0x366d('0x17')]){_0x5007a3=_0x366d('0x18');}else{console['log'](_0x366d('0x19'),_0x4e3ba3);}}else{_0x5007a3=_0x366d('0x1a');}switch(_0x2adf49[_0x366d('0x11')]['toLowerCase']()){case _0x366d('0x6'):zendesk[_0x5007a3](_0x2adf49,_0x4e3ba3,_0x1f7b59,_0x38213d,_0x3b6902,_0x3dd776,_0x40cc04);break;case'salesforce':salesforce[_0x5007a3](_0x2adf49,_0x4e3ba3,_0x1f7b59,_0x38213d,_0x3b6902,_0x3dd776,_0x40cc04);break;case _0x366d('0x8'):sugarcrm[_0x5007a3](_0x2adf49,_0x4e3ba3,_0x1f7b59,_0x38213d,_0x3b6902,_0x3dd776,_0x40cc04);break;case _0x366d('0x9'):freshdesk[_0x5007a3](_0x2adf49,_0x4e3ba3,_0x1f7b59,_0x38213d,_0x3b6902,_0x3dd776,_0x40cc04);break;case'zoho':zoho[_0x5007a3](_0x2adf49,_0x4e3ba3,_0x1f7b59,_0x38213d,_0x3b6902,_0x3dd776,_0x40cc04);break;case _0x366d('0xb'):desk[_0x5007a3](_0x2adf49,_0x4e3ba3,_0x1f7b59,_0x38213d,_0x3b6902,_0x3dd776,_0x40cc04);break;case _0x366d('0xc'):vtiger[_0x5007a3](_0x2adf49,_0x4e3ba3,_0x1f7b59,_0x38213d,_0x3b6902,_0x3dd776,_0x40cc04);break;case _0x366d('0xd'):servicenow['cs'](_0x2adf49,_0x4e3ba3,_0x1f7b59,_0x38213d,_0x3b6902,_0x3dd776,_0x40cc04,_0x5007a3);case _0x366d('0xe'):dynamics365['cs'](_0x2adf49,_0x4e3ba3,_0x1f7b59,_0x38213d,_0x3b6902,_0x3dd776,_0x40cc04,_0x5007a3);break;default:console[_0x366d('0x1b')]('unknown\x20integration');}}else{_0x29189e=require(_0x366d('0x1c'))(_0x2adf49['data1'][_0x366d('0x12')]());_0x29189e['error']('[EXEC]',util[_0x366d('0x1d')](_0x366d('0x1e'),_0x2adf49['data1'][_0x366d('0x12')](),_0x2adf49[_0x366d('0x15')]));}}else{_0x29189e=require(_0x366d('0x1c'))(_0x2adf49[_0x366d('0x11')][_0x366d('0x12')]());_0x29189e[_0x366d('0x1f')]('[EXEC]',util[_0x366d('0x1d')](_0x366d('0x20'),_0x2adf49[_0x366d('0x11')][_0x366d('0x12')](),_0x2adf49[_0x366d('0x13')]));}}else{}}catch(_0x562038){console[_0x366d('0x1f')](_0x562038);}}}}; \ 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 064ed9d..21b77f5 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 _0x01fe=['Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','type','string','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','concat','Connection','remoteUri','clientId','clientSecret','login','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','lodash','moment','bluebird','util','ioredis','./util','../../../../config/environment','salesforce','defaults','redis','localhost','socket.io-emitter','merge','utc','getString','Subjects','Descriptions','WhoId','Task','create','validateEmail','find','execute','then','length','Email','info','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','sobject','contact','lead','Lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','format','Caller\x20-\x20%s','moduleCreate'];(function(_0x2859a4,_0x2bbd1e){var _0x11c564=function(_0x429fad){while(--_0x429fad){_0x2859a4['push'](_0x2859a4['shift']());}};_0x11c564(++_0x2bbd1e);}(_0x01fe,0x102));var _0xe01f=function(_0xbcdbca,_0x1394a7){_0xbcdbca=_0xbcdbca-0x0;var _0x7408bc=_0x01fe[_0xbcdbca];return _0x7408bc;};'use strict';var _=require(_0xe01f('0x0'));var rp=require('request-promise');var moment=require(_0xe01f('0x1'));var BPromise=require(_0xe01f('0x2'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0xe01f('0x3'));var Redis=require(_0xe01f('0x4'));var intUtil=require(_0xe01f('0x5'));var config=require(_0xe01f('0x6'));var logger=require('../../../../config/logger')(_0xe01f('0x7'));config['redis']=_[_0xe01f('0x8')](config[_0xe01f('0x9')],{'host':_0xe01f('0xa'),'port':0x18eb});var io=require(_0xe01f('0xb'))(new Redis(config[_0xe01f('0x9')]));function emit(_0x4d1775,_0x3cccd7,_0x129e5a){io['to'](_0x4d1775)['emit'](_0x3cccd7,_0x129e5a);}function getTicket(_0x1af7fc,_0x54334d,_0x10759b,_0xe54c05,_0x53577d,_0x2525ae,_0x4f409c){var _0x4caedf=_[_0xe01f('0xc')]({'OwnerId':_0x54334d['id'],'ActivityDate':moment[_0xe01f('0xd')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xe01f('0xe')](_0xe54c05[_0xe01f('0xf')],_0x53577d,'\x20'),'Description':intUtil[_0xe01f('0xe')](_0xe54c05[_0xe01f('0x10')],_0x53577d,'\x0a')},getCustomFields(_0x2525ae,_0x53577d));if(_0x10759b){_0x4caedf[_0xe01f('0x11')]=_0x10759b['id'];}return _0x4f409c['sobject'](_0xe01f('0x12'))[_0xe01f('0x13')](_0x4caedf);}function getUser(_0x2d55c8,_0x3cb8ac,_0x4e98b9){if(intUtil[_0xe01f('0x14')](_0x3cb8ac)){var _0x664fbb={'Email':_0x3cb8ac};var _0x5e5e30={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4e98b9['sobject']('User')[_0xe01f('0x15')](_0x664fbb,_0x5e5e30)[_0xe01f('0x16')]()[_0xe01f('0x17')](function(_0xc7e170){if(_0xc7e170[_0xe01f('0x18')]){var _0x3fad9a=_[_0xe01f('0x15')](_0xc7e170,function(_0x26cd4d){return _0x26cd4d[_0xe01f('0x19')]===_0x3cb8ac;});if(_0x3fad9a){logger[_0xe01f('0x1a')]('Agent\x20%s\x20found.',_0x3cb8ac);return BPromise[_0xe01f('0x1b')]({'id':_0x3fad9a['Id'],'name':_0x3fad9a['Name']});}}else{logger[_0xe01f('0x1a')](_0xe01f('0x1c'),_0x3cb8ac);return _0x4e98b9[_0xe01f('0x1d')]()[_0xe01f('0x17')](function(_0x5e9523){return BPromise[_0xe01f('0x1b')]({'id':_0x5e9523[_0xe01f('0x1e')],'name':_0x5e9523[_0xe01f('0x1f')]});});}});}else{logger[_0xe01f('0x1a')](_0xe01f('0x1c'),_0x3cb8ac);return _0x4e98b9[_0xe01f('0x1d')]()['then'](function(_0x1faeb8){return BPromise[_0xe01f('0x1b')]({'id':_0x1faeb8[_0xe01f('0x1e')],'name':_0x1faeb8[_0xe01f('0x1f')]});});}}function getEndUser(_0x2480ec,_0x38efcc,_0x1ea55b,_0x51b683,_0x11708c){var _0x4b44b6={'Phone':_0x51b683};var _0x4d54ce={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe01f('0x1b')]()[_0xe01f('0x17')](function(){logger[_0xe01f('0x1a')](_0xe01f('0x20'),_0x51b683,_0x38efcc['moduleSearch']);switch(_0x38efcc[_0xe01f('0x21')]){case _0xe01f('0x22'):return _0x11708c['sobject'](_0xe01f('0x23'))['find'](_0x4b44b6,_0x4d54ce)[_0xe01f('0x16')]()[_0xe01f('0x17')](function(_0x13dcd4){if(_0x13dcd4&&_0x13dcd4['length']){return _0x13dcd4;}else{return _0x11708c[_0xe01f('0x24')]('Lead')[_0xe01f('0x15')](_0x4b44b6,_0x4d54ce);}});case _0xe01f('0x25'):return _0x11708c[_0xe01f('0x24')](_0xe01f('0x23'))[_0xe01f('0x15')](_0x4b44b6,_0x4d54ce)[_0xe01f('0x16')]();case _0xe01f('0x26'):return _0x11708c[_0xe01f('0x24')](_0xe01f('0x27'))['find'](_0x4b44b6,_0x4d54ce);default:return null;}})[_0xe01f('0x17')](function(_0x4bc3c8){if(_0x4bc3c8&&_0x4bc3c8[_0xe01f('0x18')]){var _0x37d027=_['find'](_0x4bc3c8,function(_0x15f98f){return _0x15f98f[_0xe01f('0x28')]===_0x51b683;});if(_0x37d027){return BPromise[_0xe01f('0x1b')]({'id':_0x37d027['Id'],'name':_0x37d027['Name'],'phone':_0x37d027[_0xe01f('0x28')]});}}})[_0xe01f('0x17')](function(_0x413464){if(_0x413464){logger[_0xe01f('0x1a')](_0xe01f('0x29'),_0x51b683);return BPromise['resolve'](_0x413464);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x51b683);var _0x1dad63={'LastName':_0x1ea55b!==''?_0x1ea55b:util[_0xe01f('0x2a')](_0xe01f('0x2b'),_0x51b683),'Phone':_0x51b683};if(_0x38efcc[_0xe01f('0x2c')]){switch(_0x38efcc[_0xe01f('0x2c')]){case _0xe01f('0x25'):logger[_0xe01f('0x1a')](_0xe01f('0x2d'),_0x51b683,_0x38efcc[_0xe01f('0x2c')]);break;case'lead':logger['info'](_0xe01f('0x2d'),_0x51b683,_0x38efcc[_0xe01f('0x2c')]);_0x1dad63[_0xe01f('0x2e')]=_0xe01f('0x2f');break;default:return null;}}return _0x11708c['sobject'](_[_0xe01f('0x30')](_0x38efcc[_0xe01f('0x2c')]))[_0xe01f('0x13')](_0x1dad63);}});}function getCustomFields(_0x5179e4,_0xaea65d){var _0x3a48d2={};if(_0x5179e4[_0xe01f('0x18')]>0x0){_[_0xe01f('0x31')](_0x5179e4,function(_0xddb14b){if(_0xddb14b[_0xe01f('0x32')]===_0xe01f('0x33')&&_0xddb14b[_0xe01f('0x34')]){_0x3a48d2[_0xddb14b[_0xe01f('0x34')]]=_0xddb14b[_0xe01f('0x35')][_0xe01f('0x36')]();}else if(_0xddb14b[_0xe01f('0x32')]===_0xe01f('0x37')&&_0xddb14b[_0xe01f('0x38')]&&_0xddb14b[_0xe01f('0x34')]){_0xaea65d[_0xddb14b['variableName']]&&(_0x3a48d2[_0xddb14b[_0xe01f('0x34')]]=_0xaea65d[_0xddb14b[_0xe01f('0x38')]][_0xe01f('0x36')]());}else if(_0xddb14b[_0xe01f('0x32')]==='customVariable'&&_0xddb14b[_0xe01f('0x39')]&&_0xddb14b[_0xe01f('0x39')][_0xe01f('0x3a')]&&_0xddb14b[_0xe01f('0x34')]){_0xaea65d[_0xddb14b[_0xe01f('0x39')][_0xe01f('0x3a')]['toLowerCase']()]&&(_0x3a48d2[_0xddb14b[_0xe01f('0x34')]]=_0xaea65d[_0xddb14b[_0xe01f('0x39')][_0xe01f('0x3a')][_0xe01f('0x3b')]()][_0xe01f('0x36')]());}});}return _0x3a48d2;}function getConnection(_0x18c42e){var _0x861971=_0x18c42e[_0xe01f('0x3c')][_0xe01f('0x3d')](_0x18c42e['securityToken']);var _0x4d5886=new jsforce[(_0xe01f('0x3e'))]({'oauth2':{'loginUrl':_0x18c42e[_0xe01f('0x3f')]||'https://login.salesforce.com','clientId':_0x18c42e[_0xe01f('0x40')],'clientSecret':_0x18c42e[_0xe01f('0x41')]}});return _0x4d5886[_0xe01f('0x42')](_0x18c42e['username'],_0x861971)[_0xe01f('0x17')](function(){logger[_0xe01f('0x1a')]('Connection\x20established.');return _0x4d5886;});}exports['queue']=function(_0x4be6f4,_0xb983f7,_0x53c81b,_0x19d4ec,_0x56d74a,_0x196a1d){var _0xdf86d4,_0x1f8c3c,_0x233d83,_0x310d75;_0x196a1d[_0xe01f('0x43')]=intUtil[_0xe01f('0x44')](_0x196a1d[_0xe01f('0x43')]);_0x196a1d[_0xe01f('0x3f')]=intUtil[_0xe01f('0x44')](_0x196a1d[_0xe01f('0x3f')]);if(_0x56d74a&&_0x56d74a['monitor_format']){logger[_0xe01f('0x1a')](_0xe01f('0x45'),_0xe01f('0x46'));_0xb983f7[_0xe01f('0x47')]=util[_0xe01f('0x2a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x196a1d[_0xe01f('0x43')],_0xb983f7['uniqueid'],md5(_0xb983f7['uniqueid']));}else{_0xb983f7[_0xe01f('0x47')]='';}return getConnection(_0x196a1d)[_0xe01f('0x17')](function(_0x27443d){_0x310d75=_0x27443d;return getUser(_0x196a1d,_0x19d4ec[_0xe01f('0x48')],_0x310d75);})[_0xe01f('0x17')](function(_0x495f82){_0xdf86d4=_0x495f82;return getEndUser(_0x196a1d,_0x53c81b,_0xb983f7[_0xe01f('0x49')],_0xb983f7[_0xe01f('0x4a')],_0x310d75);})[_0xe01f('0x17')](function(_0x3deca2){_0x1f8c3c=_0x3deca2;return getTicket(_0x196a1d,_0xdf86d4,_0x1f8c3c,_0x53c81b,_0xb983f7,_0x53c81b[_0xe01f('0x4b')],_0x310d75);})[_0xe01f('0x17')](function(_0x45f412){_0x233d83=_0x45f412;logger['info'](_0xe01f('0x4c'),_0x233d83['id']);logger['info'](_0xe01f('0x4d'),_0x233d83['id'],_0x19d4ec[_0xe01f('0x3a')],_0x196a1d['type']);switch(_0x196a1d[_0xe01f('0x32')]){case _0xe01f('0x4e'):emit(util[_0xe01f('0x2a')](_0xe01f('0x4f'),_0x19d4ec[_0xe01f('0x3a')]),_0xe01f('0x50'),{'recordId':_0x233d83['id']});break;case'newTab':emit(util['format'](_0xe01f('0x4f'),_0x19d4ec[_0xe01f('0x3a')]),'trigger:browser:url',{'uri':util[_0xe01f('0x2a')](_0xe01f('0x51'),_0x310d75[_0xe01f('0x52')],_0x233d83['id'])});break;default:logger[_0xe01f('0x53')](_0xe01f('0x54'));}})[_0xe01f('0x55')](function(_0x4ffa43){logger[_0xe01f('0x53')](_0xe01f('0x45'),JSON['stringify'](_0x4ffa43));});};exports[_0xe01f('0x56')]=function(_0x259e37,_0x33b9a8,_0x47089f,_0x28b26d,_0x1c375f,_0x51572f,_0x35dc08){var _0x4b5277,_0x4874ab,_0x281924,_0x2d53cb;_0x51572f[_0xe01f('0x43')]=intUtil[_0xe01f('0x44')](_0x51572f[_0xe01f('0x43')]);_0x51572f[_0xe01f('0x3f')]=intUtil[_0xe01f('0x44')](_0x51572f[_0xe01f('0x3f')]);if(_0x35dc08&&_0x35dc08['recordingFormat']&&_0x35dc08['recordingFormat']!==_0xe01f('0x57')){logger['info'](_0xe01f('0x58'),_0xe01f('0x46'));_0x33b9a8[_0xe01f('0x47')]=util[_0xe01f('0x2a')](_0xe01f('0x59'),_0x51572f['serverUrl'],_0x33b9a8[_0xe01f('0x5a')],md5(_0x33b9a8[_0xe01f('0x5a')]));}return getConnection(_0x51572f)['then'](function(_0x3bda53){_0x2d53cb=_0x3bda53;return getUser(_0x51572f,_0x28b26d['email'],_0x2d53cb);})[_0xe01f('0x17')](function(_0x5d9683){_0x4b5277=_0x5d9683;return getEndUser(_0x51572f,_0x47089f,_0x33b9a8[_0xe01f('0x5b')],_0x33b9a8[_0xe01f('0x5c')],_0x2d53cb);})[_0xe01f('0x17')](function(_0x3fca9d){_0x4874ab=_0x3fca9d;return getTicket(_0x51572f,_0x4b5277,_0x4874ab,_0x47089f,_0x33b9a8,_0x47089f[_0xe01f('0x4b')],_0x2d53cb);})[_0xe01f('0x17')](function(_0x3dc61a){_0x281924=_0x3dc61a;logger[_0xe01f('0x1a')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x281924['id']);logger[_0xe01f('0x1a')](_0xe01f('0x5d'),_0x281924['id'],_0x28b26d['name'],_0x51572f[_0xe01f('0x32')]);switch(_0x51572f['type']){case _0xe01f('0x4e'):emit(util[_0xe01f('0x2a')]('user:%s',_0x28b26d[_0xe01f('0x3a')]),'trigger:salesforce:display',{'recordId':_0x281924['id']});break;case _0xe01f('0x5e'):emit(util['format'](_0xe01f('0x4f'),_0x28b26d[_0xe01f('0x3a')]),_0xe01f('0x5f'),{'uri':util[_0xe01f('0x2a')](_0xe01f('0x51'),_0x2d53cb[_0xe01f('0x52')],_0x281924['id'])});break;default:logger['error']('[OUTBOUND]',_0xe01f('0x60'));}})['catch'](function(_0xa1471b){logger['error'](_0xe01f('0x58'),JSON[_0xe01f('0x61')](_0xa1471b));});};exports[_0xe01f('0x62')]=function(_0x5a28cc,_0x5e26cb,_0x22cb9d,_0x5ca0b2,_0x493c13,_0x1a03c6){var _0x2e319e,_0x45ecce,_0x312b3c,_0x3e5df3;_0x1a03c6[_0xe01f('0x43')]=intUtil[_0xe01f('0x44')](_0x1a03c6[_0xe01f('0x43')]);_0x1a03c6[_0xe01f('0x3f')]=intUtil['stripTrailingSlash'](_0x1a03c6['remoteUri']);if(_0x493c13&&_0x493c13['monitor_format']){logger['info'](_0xe01f('0x63'),_0xe01f('0x46'));_0x5e26cb[_0xe01f('0x47')]=util[_0xe01f('0x2a')](_0xe01f('0x59'),_0x1a03c6['serverUrl'],_0x5e26cb[_0xe01f('0x5a')],md5(_0x5e26cb['uniqueid']));}else{_0x5e26cb[_0xe01f('0x47')]='';}return getConnection(_0x1a03c6)[_0xe01f('0x17')](function(_0x4419b1){_0x3e5df3=_0x4419b1;return getUser(_0x1a03c6,_0x5ca0b2[_0xe01f('0x48')],_0x3e5df3);})['then'](function(_0x56fbd6){_0x2e319e=_0x56fbd6;return getEndUser(_0x1a03c6,_0x22cb9d,_0x5e26cb[_0xe01f('0x49')],_0x5e26cb['calleridnum'],_0x3e5df3);})[_0xe01f('0x17')](function(_0x2a2580){_0x45ecce=_0x2a2580;return getTicket(_0x1a03c6,_0x2e319e,_0x45ecce,_0x22cb9d,_0x5e26cb,_0x22cb9d['Fields'],_0x3e5df3);})[_0xe01f('0x17')](function(_0x42d607){_0x312b3c=_0x42d607;logger[_0xe01f('0x1a')](_0xe01f('0x64'),_0x312b3c['id']);logger[_0xe01f('0x1a')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x1a03c6[_0xe01f('0x32')]);})[_0xe01f('0x55')](function(_0x5cd7bd){logger[_0xe01f('0x53')](_0xe01f('0x63'),JSON[_0xe01f('0x61')](_0x5cd7bd));});}; \ No newline at end of file +var _0x2dff=['emit','getString','Subjects','Descriptions','WhoId','sobject','create','User','find','then','length','info','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','Lead','contact','execute','lead','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','forEach','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','remoteUri','https://login.salesforce.com','clientSecret','login','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','newTab','format','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','stringify','outbound','recordingFormat','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','abandoned','monitor_format','[ABANDONED]','calleridname','[ABANDONED]\x20Ticket\x20%s\x20created.','lodash','moment','bluebird','md5','jsforce','util','ioredis','./util','salesforce','redis','defaults','socket.io-emitter'];(function(_0x511baa,_0x342006){var _0x722f41=function(_0x17b9a6){while(--_0x17b9a6){_0x511baa['push'](_0x511baa['shift']());}};_0x722f41(++_0x342006);}(_0x2dff,0x11d));var _0xf2df=function(_0x2e835b,_0x384aae){_0x2e835b=_0x2e835b-0x0;var _0x537288=_0x2dff[_0x2e835b];return _0x537288;};'use strict';var _=require(_0xf2df('0x0'));var rp=require('request-promise');var moment=require(_0xf2df('0x1'));var BPromise=require(_0xf2df('0x2'));var md5=require(_0xf2df('0x3'));var jsforce=require(_0xf2df('0x4'));var util=require(_0xf2df('0x5'));var Redis=require(_0xf2df('0x6'));var intUtil=require(_0xf2df('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xf2df('0x8'));config[_0xf2df('0x9')]=_[_0xf2df('0xa')](config[_0xf2df('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf2df('0xb'))(new Redis(config[_0xf2df('0x9')]));function emit(_0x52fba5,_0x66350e,_0x42ff31){io['to'](_0x52fba5)[_0xf2df('0xc')](_0x66350e,_0x42ff31);}function getTicket(_0x4a3972,_0x52ff6a,_0x1e4e80,_0x391906,_0x2d6120,_0x43e2bb,_0x256518){var _0x3ddf31=_['merge']({'OwnerId':_0x52ff6a['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xf2df('0xd')](_0x391906[_0xf2df('0xe')],_0x2d6120,'\x20'),'Description':intUtil['getString'](_0x391906[_0xf2df('0xf')],_0x2d6120,'\x0a')},getCustomFields(_0x43e2bb,_0x2d6120));if(_0x1e4e80){_0x3ddf31[_0xf2df('0x10')]=_0x1e4e80['id'];}return _0x256518[_0xf2df('0x11')]('Task')[_0xf2df('0x12')](_0x3ddf31);}function getUser(_0x5a5b0b,_0x1d3306,_0x449920){if(intUtil['validateEmail'](_0x1d3306)){var _0x452b5f={'Email':_0x1d3306};var _0x535932={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x449920[_0xf2df('0x11')](_0xf2df('0x13'))[_0xf2df('0x14')](_0x452b5f,_0x535932)['execute']()[_0xf2df('0x15')](function(_0x732820){if(_0x732820[_0xf2df('0x16')]){var _0x34fcd7=_[_0xf2df('0x14')](_0x732820,function(_0x64ac49){return _0x64ac49['Email']===_0x1d3306;});if(_0x34fcd7){logger[_0xf2df('0x17')](_0xf2df('0x18'),_0x1d3306);return BPromise[_0xf2df('0x19')]({'id':_0x34fcd7['Id'],'name':_0x34fcd7['Name']});}}else{logger[_0xf2df('0x17')](_0xf2df('0x1a'),_0x1d3306);return _0x449920[_0xf2df('0x1b')]()[_0xf2df('0x15')](function(_0x165ff3){return BPromise[_0xf2df('0x19')]({'id':_0x165ff3[_0xf2df('0x1c')],'name':_0x165ff3[_0xf2df('0x1d')]});});}});}else{logger['info'](_0xf2df('0x1a'),_0x1d3306);return _0x449920[_0xf2df('0x1b')]()['then'](function(_0x1ca68b){return BPromise[_0xf2df('0x19')]({'id':_0x1ca68b[_0xf2df('0x1c')],'name':_0x1ca68b[_0xf2df('0x1d')]});});}}function getEndUser(_0x520133,_0x431a65,_0x1c30ad,_0x152fd5,_0x2bb07e){var _0x5efb53={'Phone':_0x152fd5};var _0x3a9514={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xf2df('0x15')](function(){logger[_0xf2df('0x17')](_0xf2df('0x1e'),_0x152fd5,_0x431a65['moduleSearch']);switch(_0x431a65[_0xf2df('0x1f')]){case _0xf2df('0x20'):return _0x2bb07e[_0xf2df('0x11')](_0xf2df('0x21'))[_0xf2df('0x14')](_0x5efb53,_0x3a9514)['execute']()[_0xf2df('0x15')](function(_0x261ee2){if(_0x261ee2&&_0x261ee2[_0xf2df('0x16')]){return _0x261ee2;}else{return _0x2bb07e['sobject'](_0xf2df('0x22'))[_0xf2df('0x14')](_0x5efb53,_0x3a9514);}});case _0xf2df('0x23'):return _0x2bb07e[_0xf2df('0x11')]('Contact')[_0xf2df('0x14')](_0x5efb53,_0x3a9514)[_0xf2df('0x24')]();case _0xf2df('0x25'):return _0x2bb07e[_0xf2df('0x11')]('Lead')[_0xf2df('0x14')](_0x5efb53,_0x3a9514);default:return null;}})[_0xf2df('0x15')](function(_0x117150){if(_0x117150&&_0x117150['length']){var _0x20030c=_[_0xf2df('0x14')](_0x117150,function(_0x268ab){return _0x268ab[_0xf2df('0x26')]===_0x152fd5;});if(_0x20030c){return BPromise[_0xf2df('0x19')]({'id':_0x20030c['Id'],'name':_0x20030c[_0xf2df('0x27')],'phone':_0x20030c[_0xf2df('0x26')]});}}})['then'](function(_0x83e42c){if(_0x83e42c){logger[_0xf2df('0x17')](_0xf2df('0x28'),_0x152fd5);return BPromise[_0xf2df('0x19')](_0x83e42c);}else{logger[_0xf2df('0x17')](_0xf2df('0x29'),_0x152fd5);var _0xac17ce={'LastName':_0x1c30ad!==_0xf2df('0x2a')?_0x1c30ad:util['format'](_0xf2df('0x2b'),_0x152fd5),'Phone':_0x152fd5};if(_0x431a65[_0xf2df('0x2c')]){switch(_0x431a65['moduleCreate']){case _0xf2df('0x23'):logger[_0xf2df('0x17')](_0xf2df('0x2d'),_0x152fd5,_0x431a65[_0xf2df('0x2c')]);break;case _0xf2df('0x25'):logger[_0xf2df('0x17')](_0xf2df('0x2d'),_0x152fd5,_0x431a65['moduleCreate']);_0xac17ce[_0xf2df('0x2e')]=_0xf2df('0x2f');break;default:return null;}}return _0x2bb07e[_0xf2df('0x11')](_['upperFirst'](_0x431a65[_0xf2df('0x2c')]))[_0xf2df('0x12')](_0xac17ce);}});}function getCustomFields(_0x5b9ade,_0x1a9cf6){var _0x301d37={};if(_0x5b9ade[_0xf2df('0x16')]>0x0){_[_0xf2df('0x30')](_0x5b9ade,function(_0x705c88){if(_0x705c88[_0xf2df('0x31')]==='string'&&_0x705c88[_0xf2df('0x32')]){_0x301d37[_0x705c88[_0xf2df('0x32')]]=_0x705c88[_0xf2df('0x33')][_0xf2df('0x34')]();}else if(_0x705c88[_0xf2df('0x31')]===_0xf2df('0x35')&&_0x705c88[_0xf2df('0x36')]&&_0x705c88[_0xf2df('0x32')]){_0x1a9cf6[_0x705c88[_0xf2df('0x36')]]&&(_0x301d37[_0x705c88[_0xf2df('0x32')]]=_0x1a9cf6[_0x705c88[_0xf2df('0x36')]][_0xf2df('0x34')]());}else if(_0x705c88[_0xf2df('0x31')]===_0xf2df('0x37')&&_0x705c88[_0xf2df('0x38')]&&_0x705c88[_0xf2df('0x38')][_0xf2df('0x39')]&&_0x705c88[_0xf2df('0x32')]){_0x1a9cf6[_0x705c88[_0xf2df('0x38')]['name'][_0xf2df('0x3a')]()]&&(_0x301d37[_0x705c88[_0xf2df('0x32')]]=_0x1a9cf6[_0x705c88['Variable'][_0xf2df('0x39')][_0xf2df('0x3a')]()][_0xf2df('0x34')]());}});}return _0x301d37;}function getConnection(_0x30c13f){var _0x513592=_0x30c13f[_0xf2df('0x3b')][_0xf2df('0x3c')](_0x30c13f['securityToken']);var _0x18224d=new jsforce['Connection']({'oauth2':{'loginUrl':_0x30c13f[_0xf2df('0x3d')]||_0xf2df('0x3e'),'clientId':_0x30c13f['clientId'],'clientSecret':_0x30c13f[_0xf2df('0x3f')]}});return _0x18224d[_0xf2df('0x40')](_0x30c13f['username'],_0x513592)[_0xf2df('0x15')](function(){logger[_0xf2df('0x17')]('Connection\x20established.');return _0x18224d;});}exports[_0xf2df('0x41')]=function(_0x15288e,_0x36f90b,_0x33c845,_0x11425e,_0x2ac39a,_0x22d615){var _0x5645aa,_0x2ca033,_0x55dd94,_0x2bad13;_0x22d615['serverUrl']=intUtil['stripTrailingSlash'](_0x22d615[_0xf2df('0x42')]);_0x22d615[_0xf2df('0x3d')]=intUtil[_0xf2df('0x43')](_0x22d615['remoteUri']);if(_0x2ac39a&&_0x2ac39a['monitor_format']){logger['info']('[QUEUE]',_0xf2df('0x44'));_0x36f90b[_0xf2df('0x45')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x22d615[_0xf2df('0x42')],_0x36f90b[_0xf2df('0x46')],md5(_0x36f90b[_0xf2df('0x46')]));}else{_0x36f90b[_0xf2df('0x45')]='';}return getConnection(_0x22d615)[_0xf2df('0x15')](function(_0x1c63d4){_0x2bad13=_0x1c63d4;return getUser(_0x22d615,_0x11425e[_0xf2df('0x47')],_0x2bad13);})[_0xf2df('0x15')](function(_0x36c80b){_0x5645aa=_0x36c80b;return getEndUser(_0x22d615,_0x33c845,_0x36f90b['calleridname'],_0x36f90b[_0xf2df('0x48')],_0x2bad13);})[_0xf2df('0x15')](function(_0x2be37c){_0x2ca033=_0x2be37c;return getTicket(_0x22d615,_0x5645aa,_0x2ca033,_0x33c845,_0x36f90b,_0x33c845[_0xf2df('0x49')],_0x2bad13);})[_0xf2df('0x15')](function(_0x2d0450){_0x55dd94=_0x2d0450;logger[_0xf2df('0x17')](_0xf2df('0x4a'),_0x55dd94['id']);logger[_0xf2df('0x17')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x55dd94['id'],_0x11425e['name'],_0x22d615[_0xf2df('0x31')]);switch(_0x22d615[_0xf2df('0x31')]){case'integrationTab':emit(util['format'](_0xf2df('0x4b'),_0x11425e['name']),'trigger:salesforce:display',{'recordId':_0x55dd94['id']});break;case _0xf2df('0x4c'):emit(util[_0xf2df('0x4d')]('user:%s',_0x11425e['name']),_0xf2df('0x4e'),{'uri':util['format'](_0xf2df('0x4f'),_0x2bad13[_0xf2df('0x50')],_0x55dd94['id'])});break;default:logger[_0xf2df('0x51')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xf2df('0x52')](function(_0x39ae3c){logger[_0xf2df('0x51')](_0xf2df('0x53'),JSON[_0xf2df('0x54')](_0x39ae3c));});};exports[_0xf2df('0x55')]=function(_0x7e1325,_0x5b8ed0,_0x316a06,_0x299466,_0x4d06e5,_0x561365,_0x511abc){var _0x12cb6c,_0x3ad64c,_0x4af796,_0x30592a;_0x561365['serverUrl']=intUtil['stripTrailingSlash'](_0x561365['serverUrl']);_0x561365[_0xf2df('0x3d')]=intUtil[_0xf2df('0x43')](_0x561365[_0xf2df('0x3d')]);if(_0x511abc&&_0x511abc[_0xf2df('0x56')]&&_0x511abc[_0xf2df('0x56')]!=='none'){logger[_0xf2df('0x17')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5b8ed0[_0xf2df('0x45')]=util[_0xf2df('0x4d')](_0xf2df('0x57'),_0x561365[_0xf2df('0x42')],_0x5b8ed0[_0xf2df('0x46')],md5(_0x5b8ed0[_0xf2df('0x46')]));}return getConnection(_0x561365)['then'](function(_0x2f0cd9){_0x30592a=_0x2f0cd9;return getUser(_0x561365,_0x299466[_0xf2df('0x47')],_0x30592a);})[_0xf2df('0x15')](function(_0x123736){_0x12cb6c=_0x123736;return getEndUser(_0x561365,_0x316a06,_0x5b8ed0[_0xf2df('0x58')],_0x5b8ed0['destcalleridnum'],_0x30592a);})['then'](function(_0x5ae658){_0x3ad64c=_0x5ae658;return getTicket(_0x561365,_0x12cb6c,_0x3ad64c,_0x316a06,_0x5b8ed0,_0x316a06['Fields'],_0x30592a);})[_0xf2df('0x15')](function(_0x2201e9){_0x4af796=_0x2201e9;logger[_0xf2df('0x17')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x4af796['id']);logger[_0xf2df('0x17')](_0xf2df('0x59'),_0x4af796['id'],_0x299466['name'],_0x561365['type']);switch(_0x561365[_0xf2df('0x31')]){case _0xf2df('0x5a'):emit(util['format'](_0xf2df('0x4b'),_0x299466['name']),_0xf2df('0x5b'),{'recordId':_0x4af796['id']});break;case'newTab':emit(util[_0xf2df('0x4d')](_0xf2df('0x4b'),_0x299466['name']),_0xf2df('0x4e'),{'uri':util['format'](_0xf2df('0x4f'),_0x30592a[_0xf2df('0x50')],_0x4af796['id'])});break;default:logger['error']('[OUTBOUND]',_0xf2df('0x5c'));}})[_0xf2df('0x52')](function(_0x4c9a3e){logger['error'](_0xf2df('0x5d'),JSON[_0xf2df('0x54')](_0x4c9a3e));});};exports[_0xf2df('0x5e')]=function(_0x19eb07,_0x134b93,_0xb4c8dd,_0xebabb7,_0x6291e8,_0x426895){var _0x350374,_0x47cc35,_0x36f646,_0x42b705;_0x426895[_0xf2df('0x42')]=intUtil[_0xf2df('0x43')](_0x426895[_0xf2df('0x42')]);_0x426895[_0xf2df('0x3d')]=intUtil[_0xf2df('0x43')](_0x426895[_0xf2df('0x3d')]);if(_0x6291e8&&_0x6291e8[_0xf2df('0x5f')]){logger[_0xf2df('0x17')](_0xf2df('0x60'),_0xf2df('0x44'));_0x134b93[_0xf2df('0x45')]=util[_0xf2df('0x4d')](_0xf2df('0x57'),_0x426895[_0xf2df('0x42')],_0x134b93['uniqueid'],md5(_0x134b93['uniqueid']));}else{_0x134b93[_0xf2df('0x45')]='';}return getConnection(_0x426895)['then'](function(_0x3de877){_0x42b705=_0x3de877;return getUser(_0x426895,_0xebabb7[_0xf2df('0x47')],_0x42b705);})[_0xf2df('0x15')](function(_0x58435a){_0x350374=_0x58435a;return getEndUser(_0x426895,_0xb4c8dd,_0x134b93[_0xf2df('0x61')],_0x134b93['calleridnum'],_0x42b705);})[_0xf2df('0x15')](function(_0x71a82f){_0x47cc35=_0x71a82f;return getTicket(_0x426895,_0x350374,_0x47cc35,_0xb4c8dd,_0x134b93,_0xb4c8dd[_0xf2df('0x49')],_0x42b705);})[_0xf2df('0x15')](function(_0x345598){_0x36f646=_0x345598;logger[_0xf2df('0x17')](_0xf2df('0x62'),_0x36f646['id']);logger[_0xf2df('0x17')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x426895[_0xf2df('0x31')]);})[_0xf2df('0x52')](function(_0x2cb331){logger[_0xf2df('0x51')](_0xf2df('0x60'),JSON[_0xf2df('0x54')](_0x2cb331));});}; \ 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 3e0654d..52b1179 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 _0xc14c=['recordingURL','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','bluebird','request-promise','util','md5','ioredis','./util','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20entity','validateEmail','userId','sys_id','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','System','endUserNumber','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','nameField','customField','toLowerCase','content','toString','idField','variableName','type','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','getString','Descriptions','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','name','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','%s/api/now/table/','email','adminEmail','callDirection','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xc14c,0x195));var _0xcc14=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc14c[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var Promise=require(_0xcc14('0x0'));var rp=require(_0xcc14('0x1'));var util=require(_0xcc14('0x2'));var md5=require(_0xcc14('0x3'));var Redis=require(_0xcc14('0x4'));var intUtil=require(_0xcc14('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('servicenow');config[_0xcc14('0x6')]=_[_0xcc14('0x7')](config['redis'],{'host':_0xcc14('0x8'),'port':0x18eb});var io=require(_0xcc14('0x9'))(new Redis(config['redis']));function getAdminUser(_0x4aa6a8,_0x34b4c3,_0x34f11c,_0xcc1c07,_0x5617d9,_0xe1c0d4){return new Promise(function(_0x5e68ee,_0x36b0a6){var _0x701d5d={'method':_0xcc14('0xa'),'uri':_0xcc1c07+_0xcc14('0xb')+'&'+_0x5617d9+'&'+_0xe1c0d4,'auth':_0x34b4c3,'json':!![]};return rp(_0x701d5d)[_0xcc14('0xc')](function(_0x10e2cf){if(_0x10e2cf[_0xcc14('0xd')][_0xcc14('0xe')]>0x0){_0x34f11c[_0xcc14('0xf')]=_0x10e2cf[_0xcc14('0xd')][0x0]['sys_id'];}logger[_0xcc14('0x10')]('['+[_0x4aa6a8[_0xcc14('0x11')]()]+_0xcc14('0x12'),_0x34f11c);_0x5e68ee(_0x34f11c);})[_0xcc14('0x13')](function(_0x1ebb2c){logger[_0xcc14('0x14')]('['+[_0x4aa6a8[_0xcc14('0x11')]()]+']',_0x1ebb2c[_0xcc14('0x15')]);_0x36b0a6(_0x1ebb2c[_0xcc14('0x15')]);});});}function getUser(_0x1124a7,_0x4ffce4,_0xcfd282,_0x16797f,_0x45c697){return function(_0x4f5757){logger[_0xcc14('0x10')]('['+[_0x1124a7[_0xcc14('0x11')]()]+_0xcc14('0x16'),_0x4f5757);return new Promise(function(_0x422e05,_0x36b6ff){var _0x273e62={'method':_0xcc14('0xa'),'uri':_0xcfd282+_0xcc14('0x17')+_0x4f5757[_0xcc14('0x18')]+'&'+_0x16797f+'&'+_0x45c697,'auth':_0x4ffce4,'json':!![]};logger[_0xcc14('0x10')]('['+[_0x1124a7[_0xcc14('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x273e62);return rp(_0x273e62)[_0xcc14('0xc')](function(_0x54a05d){logger[_0xcc14('0x10')]('['+[_0x1124a7[_0xcc14('0x11')]()]+_0xcc14('0x19'),_0x54a05d);if(_0x54a05d['result'][_0xcc14('0xe')]>0x0&&intUtil[_0xcc14('0x1a')](_0x4f5757['userEmail'])){_0x4f5757[_0xcc14('0x1b')]=_0x54a05d[_0xcc14('0xd')][0x0][_0xcc14('0x1c')];}else{_0x4f5757[_0xcc14('0x1b')]=_0x4f5757[_0xcc14('0xf')];_0x4f5757[_0xcc14('0x18')]=_0x4f5757['adminEmail'];}logger[_0xcc14('0x10')]('['+[_0x1124a7[_0xcc14('0x11')]()]+'],\x20getUser\x20crm',_0x4f5757);_0x422e05(_0x4f5757);})[_0xcc14('0x13')](function(_0x2ea7c0){logger[_0xcc14('0x14')]('['+[_0x1124a7[_0xcc14('0x11')]()]+']',_0x2ea7c0[_0xcc14('0x15')]);_0x36b6ff(_0x2ea7c0[_0xcc14('0x15')]);});});};}function createEndUser(_0x4192c4,_0x1f1d13,_0x235527,_0x158f55,_0x440f8c){logger[_0xcc14('0x10')]('['+[_0x4192c4['toUpperCase']()]+_0xcc14('0x1d'),_0x235527);return new Promise(function(_0x9260a5,_0x2ad010){var _0x2656d4={'method':_0xcc14('0x1e'),'uri':_0x158f55+_0xcc14('0x1f')+_0x440f8c,'body':{'user_name':_0x235527['endUserNumber'],'roles':_0xcc14('0x20'),'first_name':_0x235527['endUserNumber'],'active':'true','date_format':_0xcc14('0x21'),'phone':_0x235527[_0xcc14('0x22')]},'auth':_0x1f1d13,'json':!![]};return rp(_0x2656d4)[_0xcc14('0xc')](function(_0x3c83a){logger[_0xcc14('0x10')]('['+[_0x4192c4['toUpperCase']()]+'],\x20EndUser\x20schema',_0x3c83a[_0xcc14('0xd')]);_0x235527[_0xcc14('0x23')]=_0x3c83a[_0xcc14('0xd')]['sys_id'];_0x9260a5(_0x235527);})['catch'](function(_0x17dc55){logger[_0xcc14('0x14')]('['+[_0x4192c4[_0xcc14('0x11')]()]+']',_0x17dc55[_0xcc14('0x15')]);_0x2ad010(_0x17dc55['message']);});});}function getEndUser(_0x474082,_0x343d6a,_0x499740,_0x54db18,_0x48e16b){return function(_0x5db39c){logger[_0xcc14('0x10')]('['+[_0x474082[_0xcc14('0x11')]()]+_0xcc14('0x24'),_0x5db39c);return new Promise(function(_0x25e582,_0x157ce3){var _0x243574={'method':_0xcc14('0xa'),'uri':_0x499740+'sys_user?sysparm_query=phone%3D'+_0x5db39c['endUserNumber']+'&'+_0x54db18+'&'+_0x48e16b,'auth':_0x343d6a,'json':!![]};return rp(_0x243574)[_0xcc14('0xc')](function(_0x2a8a00){if(_0x2a8a00[_0xcc14('0xd')]['length']>0x0){_0x5db39c['endUserId']=_0x2a8a00[_0xcc14('0xd')][0x0][_0xcc14('0x1c')];logger[_0xcc14('0x10')]('['+[_0x474082[_0xcc14('0x11')]()]+_0xcc14('0x25'),_0x5db39c);_0x25e582(_0x5db39c);}else{return createEndUser(_0x474082,_0x343d6a,_0x5db39c,_0x499740,_0x54db18)[_0xcc14('0xc')](function(_0x1ac7f0){logger['info']('['+[_0x474082[_0xcc14('0x11')]()]+_0xcc14('0x26'),_0x1ac7f0);_0x25e582(_0x1ac7f0);});}})[_0xcc14('0x13')](function(_0x26db7f){logger[_0xcc14('0x14')]('['+[_0x474082['toUpperCase']()]+']',_0x26db7f['message']);_0x157ce3(_0x26db7f['message']);});});};}function getCustomFields(_0x4e3c62,_0x5d8c14){var _0x5f2920={};if(_0x4e3c62[_0xcc14('0xe')]>0x0){_[_0xcc14('0x27')](_0x4e3c62,function(_0x27a721){if(_0x27a721['type']===_0xcc14('0x28')&&_0x27a721[_0xcc14('0x29')]&&!_0x27a721[_0xcc14('0x2a')]){_0x5f2920[_0x27a721['idField'][_0xcc14('0x2b')]()]=_0x27a721[_0xcc14('0x2c')][_0xcc14('0x2d')]();}else if(_0x27a721['type']===_0xcc14('0x28')&&_0x27a721[_0xcc14('0x2e')]&&_0x27a721[_0xcc14('0x2a')]){_0x5f2920[_0x27a721[_0xcc14('0x2e')][_0xcc14('0x2b')]()]=_0x27a721[_0xcc14('0x2c')]['toString']();}else if(_0x27a721['type']==='variable'&&_0x27a721[_0xcc14('0x2f')]&&_0x27a721[_0xcc14('0x2e')]&&_0x27a721[_0xcc14('0x2a')]){_0x5f2920[_0x27a721[_0xcc14('0x2e')][_0xcc14('0x2b')]()]=_0x5d8c14[_0x27a721['variableName']][_0xcc14('0x2d')]();}else if(_0x27a721[_0xcc14('0x30')]===_0xcc14('0x31')&&_0x27a721['Variable']&&_0x27a721[_0xcc14('0x32')]['name']&&_0x27a721[_0xcc14('0x2e')]&&_0x27a721[_0xcc14('0x2a')]){_0x5f2920[_0x27a721[_0xcc14('0x2e')][_0xcc14('0x2b')]()]=_0x5d8c14[_0x27a721['Variable']['name'][_0xcc14('0x2b')]()][_0xcc14('0x2d')]();}});}return _0x5f2920;}function getTicket(_0x9c07b8,_0x58cdc8,_0xd06f86,_0x555849,_0x27f5b8,_0x1d232b){return function(_0x570db4){logger[_0xcc14('0x10')]('['+[_0x9c07b8[_0xcc14('0x11')]()]+_0xcc14('0x33'),_0x570db4);return new Promise(function(_0x6d2ee6,_0x324922){var _0x44de06=_0x9c07b8[_0xcc14('0x2b')]()===_0xcc14('0x34')?_0x570db4[_0xcc14('0x1b')]:_0x570db4[_0xcc14('0x23')];var _0x5f2374={'method':_0xcc14('0x1e'),'uri':_0xd06f86+_0xcc14('0x35')+'?'+_0x1d232b,'body':Object[_0xcc14('0x36')]({},{'active':'true','caller_id':_0x44de06,'short_description':intUtil['getString'](_0x555849[_0xcc14('0x37')],_0x27f5b8,'\x20'),'description':intUtil[_0xcc14('0x38')](_0x555849[_0xcc14('0x39')],_0x27f5b8,'\x0a')},getCustomFields(_0x555849['Fields'],_0x27f5b8)),'auth':_0x58cdc8,'json':!![]};return rp(_0x5f2374)['then'](function(_0x26373b){logger[_0xcc14('0x10')]('['+[_0x9c07b8['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x26373b['result']);_0x570db4['ticketId']=_0x26373b[_0xcc14('0xd')][_0xcc14('0x1c')];_0x570db4[_0xcc14('0x3a')]=_0x26373b['result'][_0xcc14('0x3b')];logger[_0xcc14('0x10')]('['+[_0x9c07b8['toUpperCase']()]+_0xcc14('0x3c'),_0x570db4);_0x6d2ee6(_0x570db4);})['catch'](function(_0x3d5d79){logger['error']('['+[_0x9c07b8[_0xcc14('0x11')]()]+']',_0x3d5d79[_0xcc14('0x15')]);_0x324922(_0x3d5d79[_0xcc14('0x15')]);});});};}function createRemoteTag(_0x1a583e,_0x355a0a,_0x1c7a74,_0x44f73b){return new Promise(function(_0x3fe55a,_0x171abf){var _0x141e27={'method':_0xcc14('0x1e'),'uri':_0x1c7a74+_0xcc14('0x3d')+'?'+_0x44f73b,'body':{'short_description':_0x1a583e,'global':!![],'active':!![],'name':_0x1a583e},'auth':_0x355a0a,'json':!![]};return rp(_0x141e27)[_0xcc14('0xc')](function(_0x5710e6){var _0x140be8=_0x5710e6[_0xcc14('0xd')][_0xcc14('0x1c')];_0x3fe55a(_0x140be8);});});}function getRemoteTag(_0x204c0d,_0x24bef5,_0x38bc0e,_0x4e1990,_0x559b42){return new Promise(function(_0x2ddf84,_0x3d4fa6){var _0x179e11={'method':_0xcc14('0xa'),'uri':_0x38bc0e+_0xcc14('0x3d')+_0xcc14('0x3e')+_0x204c0d+'&'+_0x4e1990,'auth':_0x24bef5,'json':!![]};return rp(_0x179e11)[_0xcc14('0xc')](function(_0x2a3515){if(_0x2a3515['result'][_0xcc14('0xe')]>0x0){var _0x9a0484=_0x2a3515[_0xcc14('0xd')][0x0][_0xcc14('0x1c')];_0x2ddf84(_0x9a0484);}else{return createRemoteTag(_0x204c0d,_0x24bef5,_0x38bc0e,_0x4e1990)[_0xcc14('0xc')](function(_0x397ab4){_0x2ddf84(_0x397ab4);});}});});}function assignTagToIncident(_0x52d3f7,_0x33b739,_0x1b49e7,_0x510be3,_0x5312bb){return new Promise(function(_0x4201ce,_0x5a8819){var _0x374bce={'method':_0xcc14('0x1e'),'uri':_0x1b49e7+'label_entry'+'?'+_0x5312bb,'body':{'label':_0x52d3f7,'table':_0xcc14('0x35'),'id_type':_0xcc14('0x3f'),'table_key':_0x510be3['ticketId'],'title':'Incident\x20-\x20'+_0x510be3[_0xcc14('0x3a')],'id_display':_0x510be3[_0xcc14('0x3a')]},'auth':_0x33b739,'json':!![]};return rp(_0x374bce)[_0xcc14('0xc')](function(_0x437bf2){_0x4201ce();})['catch'](function(){_0x4201ce();});});}function manageTags(_0x210b06,_0x5e8602,_0x55d83e,_0x5c2321,_0x300fec,_0x5e997b,_0x3ad816){return new Promise(function(_0x509846,_0x2aa930){var _0xe7a054=[];_0x5e8602[_0xcc14('0x27')](function(_0x332bb0){_0xe7a054[_0xcc14('0x40')](getRemoteTag(_0x332bb0,_0x55d83e,_0x5c2321,_0x5e997b,_0x3ad816));});return Promise[_0xcc14('0x41')](_0xe7a054)[_0xcc14('0xc')](function(_0x396639){if(_0x396639[_0xcc14('0xe')]){logger['info']('['+[_0x210b06['toUpperCase']()]+_0xcc14('0x42'),_0x396639);var _0x5b4ab9=[];_0x396639['forEach'](function(_0x2fbcf6){_0x5b4ab9['push'](assignTagToIncident(_0x2fbcf6,_0x55d83e,_0x5c2321,_0x300fec,_0x5e997b));});return Promise['all'](_0x5b4ab9)[_0xcc14('0xc')](function(){_0x509846();})[_0xcc14('0x13')](function(){_0x509846();});}else{_0x509846();}});});}function getTags(_0x46841e,_0x4df71e,_0x207786,_0x343b30,_0x95e61d,_0x42350c){return function(_0xcd9cbf){return new Promise(function(_0x38ae64,_0x568b10){var _0x4fd872=[];var _0x16c7e2=_0x343b30['Tags'];if(_0x16c7e2&&_0x16c7e2[_0xcc14('0xe')]>0x0){_0x4fd872=_[_0xcc14('0x43')](_0x16c7e2,_0xcc14('0x44'));}if(_0x4fd872[_0xcc14('0xe')]>0x0){return manageTags(_0x46841e,_0x4fd872,_0x4df71e,_0x207786,_0xcd9cbf,_0x95e61d,_0x42350c)[_0xcc14('0xc')](function(){_0x38ae64(_0xcd9cbf);});}else{_0x38ae64(_0xcd9cbf);}});};}function emit(_0x11046d,_0x2670aa,_0x10983a){var _0x266326=_0xcc14('0x45')+_0xcc14('0x46')+_0xcc14('0x47')+'%255EORDERBYDESCnumber';var _0x3e6e7b={'uri':_0x11046d+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x10983a+_0x266326};io['to'](util[_0xcc14('0x48')](_0xcc14('0x49'),_0x2670aa))[_0xcc14('0x4a')](_0xcc14('0x4b'),_0x3e6e7b);}exports['cs']=function(_0x15dfea,_0x15fbac,_0x493503,_0x157bb9,_0x7f86b5,_0x5c4115,_0x75a4e4,_0xf2483d){var _0x2ab9c4={};var _0x1fe454={'user':_0x5c4115['username'],'pass':_0x5c4115[_0xcc14('0x4c')]};var _0x33e394=_0xcc14('0x4d');var _0x2c0e31=_0xcc14('0x4e');_0x5c4115[_0xcc14('0x4f')]=intUtil[_0xcc14('0x50')](_0x5c4115['remoteUri']);_0x5c4115['serverUrl']=intUtil[_0xcc14('0x50')](_0x5c4115['serverUrl']);var _0x5a0fd4=util[_0xcc14('0x48')](_0xcc14('0x51'),_0x5c4115[_0xcc14('0x4f')]);_0x2ab9c4['userEmail']=_0x157bb9[_0xcc14('0x52')];_0x2ab9c4[_0xcc14('0x53')]=_0x5c4115[_0xcc14('0x52')];_0x2ab9c4[_0xcc14('0x22')]=_0xf2483d['toLowerCase']()===_0xcc14('0x34')?_0x15fbac['destcalleridnum']:_0x15fbac['calleridnum'];_0x2ab9c4[_0xcc14('0x54')]=_0xf2483d==='queue'||_0xf2483d===_0xcc14('0x55')?'queue':_0xcc14('0x34');var _0x197d5a=util[_0xcc14('0x48')](_0xcc14('0x56'),_0x5c4115[_0xcc14('0x57')],_0x15fbac['uniqueid'],md5(_0x15fbac[_0xcc14('0x58')]));if(_0x7f86b5&&_0x7f86b5[_0xcc14('0x59')]){logger[_0xcc14('0x10')](_0xcc14('0x5a'),_0xcc14('0x5b'));_0x15fbac['recordingURL']=_0x197d5a;}else if(_0x75a4e4&&_0x75a4e4[_0xcc14('0x5c')]&&_0x75a4e4['recordingFormat']!==_0xcc14('0x5d')){logger['info'](_0xcc14('0x5e'),_0xcc14('0x5b'));_0x15fbac[_0xcc14('0x5f')]=_0x197d5a;}else{_0x15fbac['recordingURL']='';}return getAdminUser(_0xf2483d,_0x1fe454,_0x2ab9c4,_0x5a0fd4,_0x2c0e31,_0x33e394)[_0xcc14('0xc')](getUser(_0xf2483d,_0x1fe454,_0x5a0fd4,_0x2c0e31,_0x33e394))[_0xcc14('0xc')](getEndUser(_0xf2483d,_0x1fe454,_0x5a0fd4,_0x2c0e31,_0x33e394))['then'](getTicket(_0xf2483d,_0x1fe454,_0x5a0fd4,_0x493503,_0x15fbac,_0x2c0e31))[_0xcc14('0xc')](function(_0x3414c9){logger['info'](util[_0xcc14('0x48')](_0xcc14('0x60'),_0x3414c9[_0xcc14('0x61')]));logger['info'](util['format'](_0xcc14('0x62'),_0xf2483d));if(_0xf2483d!==_0xcc14('0x55')){logger[_0xcc14('0x10')]('['+[_0xf2483d[_0xcc14('0x11')]()]+']',_0xcc14('0x63'));emit(_0x5c4115[_0xcc14('0x4f')],_0x157bb9[_0xcc14('0x44')],_0x3414c9[_0xcc14('0x61')]);}})[_0xcc14('0x13')](function(_0x49022e){logger[_0xcc14('0x14')]('['+[_0xf2483d['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x49022e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa233=['sysparm_display_value=true','remoteUri','stripTrailingSlash','%s/api/now/table/','destcalleridnum','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','servicenow','defaults','redis','localhost','socket.io-emitter','GET','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','userEmail','userId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','user','endUserNumber','true','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','all','push','Tags','map','%255EORDERBYDESCnumber','format','trigger:browser:url','sysparm_limit=1'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa233,0x1a1));var _0x3a23=function(_0x269bdc,_0x86a6a0){_0x269bdc=_0x269bdc-0x0;var _0x36c6d3=_0xa233[_0x269bdc];return _0x36c6d3;};'use strict';var _=require(_0x3a23('0x0'));var Promise=require(_0x3a23('0x1'));var rp=require(_0x3a23('0x2'));var util=require(_0x3a23('0x3'));var md5=require(_0x3a23('0x4'));var Redis=require(_0x3a23('0x5'));var intUtil=require(_0x3a23('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x3a23('0x7'));config['redis']=_[_0x3a23('0x8')](config[_0x3a23('0x9')],{'host':_0x3a23('0xa'),'port':0x18eb});var io=require(_0x3a23('0xb'))(new Redis(config['redis']));function getAdminUser(_0x44f50c,_0x3dd227,_0x42a3d0,_0x534405,_0x16e2e1,_0x5c49a0){return new Promise(function(_0x29cfd7,_0x331485){var _0x101ed6={'method':_0x3a23('0xc'),'uri':_0x534405+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x16e2e1+'&'+_0x5c49a0,'auth':_0x3dd227,'json':!![]};return rp(_0x101ed6)[_0x3a23('0xd')](function(_0x480cc6){if(_0x480cc6[_0x3a23('0xe')][_0x3a23('0xf')]>0x0){_0x42a3d0[_0x3a23('0x10')]=_0x480cc6[_0x3a23('0xe')][0x0][_0x3a23('0x11')];}logger[_0x3a23('0x12')]('['+[_0x44f50c[_0x3a23('0x13')]()]+_0x3a23('0x14'),_0x42a3d0);_0x29cfd7(_0x42a3d0);})[_0x3a23('0x15')](function(_0x2bb9a1){logger[_0x3a23('0x16')]('['+[_0x44f50c[_0x3a23('0x13')]()]+']',_0x2bb9a1['message']);_0x331485(_0x2bb9a1[_0x3a23('0x17')]);});});}function getUser(_0x13fca1,_0x2cb251,_0x5d2e42,_0x230dc1,_0xb6116a){return function(_0x437159){logger[_0x3a23('0x12')]('['+[_0x13fca1['toUpperCase']()]+_0x3a23('0x18'),_0x437159);return new Promise(function(_0x4e2f58,_0x161777){var _0x4a5062={'method':_0x3a23('0xc'),'uri':_0x5d2e42+_0x3a23('0x19')+_0x437159['userEmail']+'&'+_0x230dc1+'&'+_0xb6116a,'auth':_0x2cb251,'json':!![]};logger[_0x3a23('0x12')]('['+[_0x13fca1['toUpperCase']()]+_0x3a23('0x1a'),_0x4a5062);return rp(_0x4a5062)['then'](function(_0x2acc55){logger['info']('['+[_0x13fca1[_0x3a23('0x13')]()]+'],\x20getUser\x20entity',_0x2acc55);if(_0x2acc55[_0x3a23('0xe')][_0x3a23('0xf')]>0x0&&intUtil['validateEmail'](_0x437159[_0x3a23('0x1b')])){_0x437159[_0x3a23('0x1c')]=_0x2acc55[_0x3a23('0xe')][0x0]['sys_id'];}else{_0x437159[_0x3a23('0x1c')]=_0x437159[_0x3a23('0x10')];_0x437159[_0x3a23('0x1b')]=_0x437159[_0x3a23('0x1d')];}logger['info']('['+[_0x13fca1[_0x3a23('0x13')]()]+_0x3a23('0x1e'),_0x437159);_0x4e2f58(_0x437159);})[_0x3a23('0x15')](function(_0x566e0d){logger[_0x3a23('0x16')]('['+[_0x13fca1[_0x3a23('0x13')]()]+']',_0x566e0d[_0x3a23('0x17')]);_0x161777(_0x566e0d[_0x3a23('0x17')]);});});};}function createEndUser(_0xe8b413,_0x3e8e8b,_0x40a0ed,_0x54998b,_0x1da2d8){logger[_0x3a23('0x12')]('['+[_0xe8b413[_0x3a23('0x13')]()]+_0x3a23('0x1f'),_0x40a0ed);return new Promise(function(_0x54cd87,_0x5aee98){var _0xe8ddae={'method':_0x3a23('0x20'),'uri':_0x54998b+'sys_user?'+_0x1da2d8,'body':{'user_name':_0x40a0ed['endUserNumber'],'roles':_0x3a23('0x21'),'first_name':_0x40a0ed[_0x3a23('0x22')],'active':_0x3a23('0x23'),'date_format':_0x3a23('0x24'),'phone':_0x40a0ed[_0x3a23('0x22')]},'auth':_0x3e8e8b,'json':!![]};return rp(_0xe8ddae)[_0x3a23('0xd')](function(_0x411336){logger[_0x3a23('0x12')]('['+[_0xe8b413['toUpperCase']()]+'],\x20EndUser\x20schema',_0x411336[_0x3a23('0xe')]);_0x40a0ed[_0x3a23('0x25')]=_0x411336['result'][_0x3a23('0x11')];_0x54cd87(_0x40a0ed);})[_0x3a23('0x15')](function(_0x3c45f){logger[_0x3a23('0x16')]('['+[_0xe8b413[_0x3a23('0x13')]()]+']',_0x3c45f['message']);_0x5aee98(_0x3c45f['message']);});});}function getEndUser(_0x3ed739,_0x352383,_0x2fa276,_0x305a18,_0x1b8ed9){return function(_0x1ab795){logger[_0x3a23('0x12')]('['+[_0x3ed739[_0x3a23('0x13')]()]+_0x3a23('0x26'),_0x1ab795);return new Promise(function(_0x3bc6c7,_0x15fa02){var _0x2cd999={'method':_0x3a23('0xc'),'uri':_0x2fa276+_0x3a23('0x27')+_0x1ab795[_0x3a23('0x22')]+'&'+_0x305a18+'&'+_0x1b8ed9,'auth':_0x352383,'json':!![]};return rp(_0x2cd999)[_0x3a23('0xd')](function(_0x10af10){if(_0x10af10[_0x3a23('0xe')][_0x3a23('0xf')]>0x0){_0x1ab795['endUserId']=_0x10af10[_0x3a23('0xe')][0x0][_0x3a23('0x11')];logger['info']('['+[_0x3ed739[_0x3a23('0x13')]()]+_0x3a23('0x28'),_0x1ab795);_0x3bc6c7(_0x1ab795);}else{return createEndUser(_0x3ed739,_0x352383,_0x1ab795,_0x2fa276,_0x305a18)['then'](function(_0x373f22){logger[_0x3a23('0x12')]('['+[_0x3ed739['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x373f22);_0x3bc6c7(_0x373f22);});}})['catch'](function(_0x39bb97){logger[_0x3a23('0x16')]('['+[_0x3ed739[_0x3a23('0x13')]()]+']',_0x39bb97['message']);_0x15fa02(_0x39bb97[_0x3a23('0x17')]);});});};}function getCustomFields(_0x5b8aa7,_0x3b02d6){var _0xcc022={};if(_0x5b8aa7[_0x3a23('0xf')]>0x0){_[_0x3a23('0x29')](_0x5b8aa7,function(_0x40a5ce){if(_0x40a5ce[_0x3a23('0x2a')]===_0x3a23('0x2b')&&_0x40a5ce[_0x3a23('0x2c')]&&!_0x40a5ce[_0x3a23('0x2d')]){_0xcc022[_0x40a5ce[_0x3a23('0x2e')][_0x3a23('0x2f')]()]=_0x40a5ce[_0x3a23('0x30')][_0x3a23('0x31')]();}else if(_0x40a5ce['type']===_0x3a23('0x2b')&&_0x40a5ce['idField']&&_0x40a5ce['customField']){_0xcc022[_0x40a5ce[_0x3a23('0x2e')]['toLowerCase']()]=_0x40a5ce[_0x3a23('0x30')][_0x3a23('0x31')]();}else if(_0x40a5ce[_0x3a23('0x2a')]===_0x3a23('0x32')&&_0x40a5ce[_0x3a23('0x33')]&&_0x40a5ce[_0x3a23('0x2e')]&&_0x40a5ce['customField']){_0xcc022[_0x40a5ce['idField'][_0x3a23('0x2f')]()]=_0x3b02d6[_0x40a5ce[_0x3a23('0x33')]][_0x3a23('0x31')]();}else if(_0x40a5ce[_0x3a23('0x2a')]==='customVariable'&&_0x40a5ce[_0x3a23('0x34')]&&_0x40a5ce[_0x3a23('0x34')][_0x3a23('0x35')]&&_0x40a5ce['idField']&&_0x40a5ce[_0x3a23('0x2d')]){_0xcc022[_0x40a5ce[_0x3a23('0x2e')][_0x3a23('0x2f')]()]=_0x3b02d6[_0x40a5ce[_0x3a23('0x34')]['name'][_0x3a23('0x2f')]()][_0x3a23('0x31')]();}});}return _0xcc022;}function getTicket(_0x493332,_0x3921ef,_0x495407,_0x34a822,_0x25130e,_0x5a3c56){return function(_0x3dec9c){logger[_0x3a23('0x12')]('['+[_0x493332[_0x3a23('0x13')]()]+_0x3a23('0x36'),_0x3dec9c);return new Promise(function(_0x5bda9c,_0x7a08ef){var _0x78f770=_0x493332[_0x3a23('0x2f')]()===_0x3a23('0x37')?_0x3dec9c[_0x3a23('0x1c')]:_0x3dec9c[_0x3a23('0x25')];var _0x5378e7={'method':_0x3a23('0x20'),'uri':_0x495407+_0x3a23('0x38')+'?'+_0x5a3c56,'body':Object[_0x3a23('0x39')]({},{'active':_0x3a23('0x23'),'caller_id':_0x78f770,'short_description':intUtil['getString'](_0x34a822[_0x3a23('0x3a')],_0x25130e,'\x20'),'description':intUtil['getString'](_0x34a822[_0x3a23('0x3b')],_0x25130e,'\x0a')},getCustomFields(_0x34a822[_0x3a23('0x3c')],_0x25130e)),'auth':_0x3921ef,'json':!![]};return rp(_0x5378e7)[_0x3a23('0xd')](function(_0x4c5e3e){logger[_0x3a23('0x12')]('['+[_0x493332['toUpperCase']()]+_0x3a23('0x3d'),_0x4c5e3e['result']);_0x3dec9c[_0x3a23('0x3e')]=_0x4c5e3e[_0x3a23('0xe')][_0x3a23('0x11')];_0x3dec9c[_0x3a23('0x3f')]=_0x4c5e3e[_0x3a23('0xe')][_0x3a23('0x40')];logger[_0x3a23('0x12')]('['+[_0x493332[_0x3a23('0x13')]()]+_0x3a23('0x41'),_0x3dec9c);_0x5bda9c(_0x3dec9c);})['catch'](function(_0x83b5d0){logger['error']('['+[_0x493332[_0x3a23('0x13')]()]+']',_0x83b5d0['message']);_0x7a08ef(_0x83b5d0[_0x3a23('0x17')]);});});};}function createRemoteTag(_0x1f3ad8,_0xfb21,_0x78bb19,_0x29626b){return new Promise(function(_0x17993d,_0x19e3bf){var _0x297747={'method':'POST','uri':_0x78bb19+_0x3a23('0x42')+'?'+_0x29626b,'body':{'short_description':_0x1f3ad8,'global':!![],'active':!![],'name':_0x1f3ad8},'auth':_0xfb21,'json':!![]};return rp(_0x297747)[_0x3a23('0xd')](function(_0x121308){var _0x26cd9b=_0x121308[_0x3a23('0xe')][_0x3a23('0x11')];_0x17993d(_0x26cd9b);});});}function getRemoteTag(_0x584e6e,_0x17a716,_0x4693fd,_0x56b06f,_0x319a49){return new Promise(function(_0x486957,_0x30fb6a){var _0x3420da={'method':_0x3a23('0xc'),'uri':_0x4693fd+_0x3a23('0x42')+'?sysparm_query=name%3D'+_0x584e6e+'&'+_0x56b06f,'auth':_0x17a716,'json':!![]};return rp(_0x3420da)['then'](function(_0x54a120){if(_0x54a120[_0x3a23('0xe')]['length']>0x0){var _0x27a336=_0x54a120[_0x3a23('0xe')][0x0][_0x3a23('0x11')];_0x486957(_0x27a336);}else{return createRemoteTag(_0x584e6e,_0x17a716,_0x4693fd,_0x56b06f)['then'](function(_0x124c0a){_0x486957(_0x124c0a);});}});});}function assignTagToIncident(_0x2e156a,_0x48230d,_0x13e465,_0xfc22ee,_0x30f125){return new Promise(function(_0x5a1c23,_0x4c8cf4){var _0x7d1ae1={'method':'POST','uri':_0x13e465+_0x3a23('0x43')+'?'+_0x30f125,'body':{'label':_0x2e156a,'table':_0x3a23('0x38'),'id_type':_0x3a23('0x44'),'table_key':_0xfc22ee[_0x3a23('0x3e')],'title':_0x3a23('0x45')+_0xfc22ee['ticketNumber'],'id_display':_0xfc22ee[_0x3a23('0x3f')]},'auth':_0x48230d,'json':!![]};return rp(_0x7d1ae1)[_0x3a23('0xd')](function(_0x4969d3){_0x5a1c23();})[_0x3a23('0x15')](function(){_0x5a1c23();});});}function manageTags(_0xf70fc3,_0x2f6bd1,_0x2b88e9,_0x27bedb,_0xf41d73,_0x3d36ae,_0x37c2ae){return new Promise(function(_0x4c4d71,_0xf5ca77){var _0x580bea=[];_0x2f6bd1[_0x3a23('0x29')](function(_0x312139){_0x580bea['push'](getRemoteTag(_0x312139,_0x2b88e9,_0x27bedb,_0x3d36ae,_0x37c2ae));});return Promise[_0x3a23('0x46')](_0x580bea)['then'](function(_0x206221){if(_0x206221[_0x3a23('0xf')]){logger['info']('['+[_0xf70fc3[_0x3a23('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x206221);var _0x54cda8=[];_0x206221[_0x3a23('0x29')](function(_0x88c1d9){_0x54cda8[_0x3a23('0x47')](assignTagToIncident(_0x88c1d9,_0x2b88e9,_0x27bedb,_0xf41d73,_0x3d36ae));});return Promise['all'](_0x54cda8)['then'](function(){_0x4c4d71();})[_0x3a23('0x15')](function(){_0x4c4d71();});}else{_0x4c4d71();}});});}function getTags(_0x1c4215,_0x4037a6,_0x32b8e4,_0x467799,_0x50a17f,_0x2df998){return function(_0x41a345){return new Promise(function(_0x3d01f7,_0x1fd694){var _0x4ee5c1=[];var _0x5955da=_0x467799[_0x3a23('0x48')];if(_0x5955da&&_0x5955da[_0x3a23('0xf')]>0x0){_0x4ee5c1=_[_0x3a23('0x49')](_0x5955da,'name');}if(_0x4ee5c1['length']>0x0){return manageTags(_0x1c4215,_0x4ee5c1,_0x4037a6,_0x32b8e4,_0x41a345,_0x50a17f,_0x2df998)[_0x3a23('0xd')](function(){_0x3d01f7(_0x41a345);});}else{_0x3d01f7(_0x41a345);}});};}function emit(_0x33f794,_0x1fa848,_0x195fd5){var _0x3e620f='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x3a23('0x4a');var _0x84f79d={'uri':_0x33f794+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x195fd5+_0x3e620f};io['to'](util[_0x3a23('0x4b')]('user:%s',_0x1fa848))['emit'](_0x3a23('0x4c'),_0x84f79d);}exports['cs']=function(_0x35bb61,_0x15436f,_0x26b8c2,_0x20404c,_0x554563,_0x384d0e,_0x26b72c,_0x3df547){var _0x5a3cde={};var _0x327a20={'user':_0x384d0e['username'],'pass':_0x384d0e['password']};var _0x39df46=_0x3a23('0x4d');var _0x16ac76=_0x3a23('0x4e');_0x384d0e[_0x3a23('0x4f')]=intUtil['stripTrailingSlash'](_0x384d0e['remoteUri']);_0x384d0e['serverUrl']=intUtil[_0x3a23('0x50')](_0x384d0e['serverUrl']);var _0x52514f=util[_0x3a23('0x4b')](_0x3a23('0x51'),_0x384d0e[_0x3a23('0x4f')]);_0x5a3cde[_0x3a23('0x1b')]=_0x20404c['email'];_0x5a3cde[_0x3a23('0x1d')]=_0x384d0e['email'];_0x5a3cde[_0x3a23('0x22')]=_0x3df547[_0x3a23('0x2f')]()==='outbound'?_0x15436f[_0x3a23('0x52')]:_0x15436f['calleridnum'];_0x5a3cde[_0x3a23('0x53')]=_0x3df547===_0x3a23('0x54')||_0x3df547===_0x3a23('0x55')?_0x3a23('0x54'):_0x3a23('0x37');var _0x22e155=util[_0x3a23('0x4b')](_0x3a23('0x56'),_0x384d0e[_0x3a23('0x57')],_0x15436f['uniqueid'],md5(_0x15436f['uniqueid']));if(_0x554563&&_0x554563[_0x3a23('0x58')]){logger[_0x3a23('0x12')](_0x3a23('0x59'),'Recording\x20is\x20enabled!');_0x15436f[_0x3a23('0x5a')]=_0x22e155;}else if(_0x26b72c&&_0x26b72c[_0x3a23('0x5b')]&&_0x26b72c[_0x3a23('0x5b')]!==_0x3a23('0x5c')){logger[_0x3a23('0x12')](_0x3a23('0x5d'),_0x3a23('0x5e'));_0x15436f[_0x3a23('0x5a')]=_0x22e155;}else{_0x15436f['recordingURL']='';}return getAdminUser(_0x3df547,_0x327a20,_0x5a3cde,_0x52514f,_0x16ac76,_0x39df46)[_0x3a23('0xd')](getUser(_0x3df547,_0x327a20,_0x52514f,_0x16ac76,_0x39df46))[_0x3a23('0xd')](getEndUser(_0x3df547,_0x327a20,_0x52514f,_0x16ac76,_0x39df46))[_0x3a23('0xd')](getTicket(_0x3df547,_0x327a20,_0x52514f,_0x26b8c2,_0x15436f,_0x16ac76))[_0x3a23('0xd')](function(_0x1f525c){logger[_0x3a23('0x12')](util[_0x3a23('0x4b')](_0x3a23('0x5f'),_0x1f525c['ticketId']));logger['info'](util[_0x3a23('0x4b')]('call\x20direction:\x20%s',_0x3df547));if(_0x3df547!==_0x3a23('0x55')){logger['info']('['+[_0x3df547[_0x3a23('0x13')]()]+']',_0x3a23('0x60'));emit(_0x384d0e[_0x3a23('0x4f')],_0x20404c[_0x3a23('0x35')],_0x1f525c[_0x3a23('0x3e')]);}})[_0x3a23('0x15')](function(_0x2b2c8f){logger[_0x3a23('0x16')]('['+[_0x3df547[_0x3a23('0x13')]()]+_0x3a23('0x61'),util[_0x3a23('0x62')](_0x2b2c8f,{'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 bc7e7e5..a495a39 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 _0x8232=['nameField','customField','content','string','custom_fields','variable','Variable','toLowerCase','login','username','password','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','contacts','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','user:%s','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','[OUTBOUND]','abandoned','[ABANDONED]','Fields','lodash','request-promise','bluebird','md5','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','POST','emit','info','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','description','getString','date_start','toISOString','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','format','Caller\x20-\x20%s','map','type'];(function(_0x3fcc5,_0x5771ad){var _0x3977fc=function(_0x5a0d89){while(--_0x5a0d89){_0x3fcc5['push'](_0x3fcc5['shift']());}};_0x3977fc(++_0x5771ad);}(_0x8232,0x190));var _0x2823=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8232[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x2823('0x0'));var rp=require(_0x2823('0x1'));var BPromise=require(_0x2823('0x2'));var md5=require(_0x2823('0x3'));var util=require('util');var Redis=require(_0x2823('0x4'));var intUtil=require('./util');var config=require(_0x2823('0x5'));var logger=require(_0x2823('0x6'))(_0x2823('0x7'));config[_0x2823('0x8')]=_['defaults'](config[_0x2823('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0x2823('0x9'),'json':!![]};function emit(_0x44973f,_0xf5984d,_0x1cbc2c){io['to'](_0x44973f)[_0x2823('0xa')](_0xf5984d,_0x1cbc2c);}function getTicket(_0xbbcf3e,_0x42af30,_0x17a652,_0x156fbb,_0x386fab,_0x4f9500,_0x1eb458,_0x4760a6){logger[_0x2823('0xb')](_0x2823('0xc'));var _0x50ae3a=new Date();var _0x2293b3=[{'name':_0x2823('0xd'),'value':intUtil['getString'](_0x156fbb['Subjects'],_0x386fab,'\x20')},{'name':_0x2823('0xe'),'value':_0x42af30['id']},{'name':_0x2823('0xf'),'value':_0x42af30['id']},{'name':_0x2823('0x10'),'value':intUtil[_0x2823('0x11')](_0x156fbb['Descriptions'],_0x386fab,'\x0a')},{'name':_0x2823('0x12'),'value':_0x50ae3a[_0x2823('0x13')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x2823('0x14'),'value':'0'},{'name':_0x2823('0x15'),'value':'15'},{'name':_0x2823('0x16'),'value':_0x17a652['id']},{'name':_0x2823('0x17'),'value':_0x2823('0x18')},{'name':_0x2823('0x19'),'value':_0x17a652['name']},{'name':_0x2823('0x1a'),'value':_0x4760a6}];if(_0x4f9500[_0x2823('0x1b')]){_[_0x2823('0x1c')](_0x4f9500,function(_0x28cfdc){if(_0x386fab[_0x28cfdc[_0x2823('0x1d')]]){_0x2293b3[_0x2823('0x1e')]({'name':_0x28cfdc[_0x2823('0x1f')],'value':_0x386fab[_0x28cfdc[_0x2823('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x2823('0x20'),'response_type':'JSON','rest_data':JSON[_0x2823('0x21')]({'session':_0x1eb458['id'],'module_name':_0x2823('0x22'),'name_value_list':_0x2293b3})}});}function getAuth(_0x38006b){return util['format'](_0x2823('0x23'),new Buffer(_0x38006b[_0x2823('0x24')]+':X')[_0x2823('0x25')](_0x2823('0x26')));}function getServerInfo(_0xdab665){return request({'form':{'method':_0x2823('0x27'),'input_type':_0x2823('0x20'),'response_type':'JSON','rest_data':JSON[_0x2823('0x21')]({'session':_0xdab665['id']})}});}function getUser(_0xfea567,_0x165b27,_0x350e03){if(_0x165b27){logger[_0x2823('0xb')](_0x2823('0x28'),_0x165b27);return request({'form':{'method':_0x2823('0x29'),'input_type':_0x2823('0x20'),'response_type':_0x2823('0x20'),'rest_data':JSON[_0x2823('0x21')]({'session':_0x350e03['id'],'module_name':_0x2823('0x2a'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x165b27),'order_by':'','offset':'0','select_fields':['id','name',_0x2823('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2823('0x2c')](function(_0x5b37c4){if(_0x5b37c4[_0x2823('0x2d')][_0x2823('0x1b')]){var _0x5f0d57=_[_0x2823('0x2e')](_0x5b37c4[_0x2823('0x2d')],function(_0x5cce42){return _0x5cce42[_0x2823('0x2f')][_0x2823('0x2b')]['value']===_0x165b27;});if(_0x5f0d57){logger[_0x2823('0xb')](_0x2823('0x30'));return BPromise[_0x2823('0x31')]({'id':_0x5f0d57[_0x2823('0x2f')]['id']['value'],'name':_0x5f0d57['name_value_list'][_0x2823('0xd')][_0x2823('0x32')]});}}logger[_0x2823('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x350e03[_0x2823('0x2f')][_0x2823('0x33')][_0x2823('0x32')],'name':_0x350e03[_0x2823('0x2f')]['user_name'][_0x2823('0x32')]});});}else{logger[_0x2823('0xb')](_0x2823('0x34'));return BPromise[_0x2823('0x31')]({'id':_0x350e03[_0x2823('0x2f')][_0x2823('0x33')][_0x2823('0x32')],'name':_0x350e03[_0x2823('0x2f')][_0x2823('0x2b')][_0x2823('0x32')]});}}function getEndUser(_0x1f1747,_0x1ec343,_0x574ae8,_0x3aeae3){logger['info'](_0x2823('0x35'),_0x574ae8);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x2823('0x20'),'rest_data':JSON['stringify']({'session':_0x3aeae3['id'],'module_name':_0x2823('0x18'),'query':util['format'](_0x2823('0x36'),_0x574ae8),'order_by':'','offset':'0','select_fields':['id','name',_0x2823('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2823('0x2c')](function(_0x797757){if(_0x797757['entry_list'][_0x2823('0x1b')]){var _0x11ed5a=_[_0x2823('0x2e')](_0x797757['entry_list'],function(_0x30a0db){return _0x30a0db[_0x2823('0x2f')][_0x2823('0x37')][_0x2823('0x32')]===_0x574ae8;});if(_0x11ed5a){logger[_0x2823('0xb')](_0x2823('0x38'));return BPromise[_0x2823('0x31')]({'id':_0x11ed5a[_0x2823('0x2f')]['id'][_0x2823('0x32')],'name':_0x11ed5a[_0x2823('0x2f')][_0x2823('0xd')][_0x2823('0x32')],'phone':_0x11ed5a[_0x2823('0x2f')][_0x2823('0x37')]['value']});}}else{logger[_0x2823('0xb')](_0x2823('0x39'));return request({'form':{'method':_0x2823('0x3a'),'input_type':'JSON','response_type':_0x2823('0x20'),'rest_data':JSON['stringify']({'session':_0x3aeae3['id'],'module_name':_0x2823('0x18'),'name_value_list':[{'name':_0x2823('0x3b'),'value':_0x1ec343!==''?_0x1ec343:util[_0x2823('0x3c')](_0x2823('0x3d'),_0x574ae8)},{'name':_0x2823('0x37'),'value':_0x574ae8}]})}})['then'](function(_0x46df80){logger['info']('Enduser\x20created.');return BPromise[_0x2823('0x31')]({'id':_0x46df80['id'],'name':_0x46df80[_0x2823('0x2d')][_0x2823('0x3b')][_0x2823('0x32')],'phone':_0x46df80[_0x2823('0x2d')]['phone_home'][_0x2823('0x32')]});});}});}function request(_0x50b315){logger['debug']('[HTTP]',JSON[_0x2823('0x21')](_0x50b315));return rp(_['merge'](def,_0x50b315));}function getTags(_0x5ee524,_0x2bf4c8){var _0x188e87=[];if(_0x5ee524&&_0x5ee524['length']>0x0){_0x188e87=_[_0x2823('0x3e')](_0x5ee524,_0x2bf4c8);}return _0x188e87;}function getCustomFields(_0x412030,_0x99e6f2){var _0x3d7853=[];var _0x4e0d83={'custom_fields':[]};if(_0x412030[_0x2823('0x1b')]>0x0){_['forEach'](_0x412030,function(_0xfc43f2){if(_0xfc43f2[_0x2823('0x3f')]==='string'&&_0xfc43f2[_0x2823('0x40')]&&!_0xfc43f2[_0x2823('0x41')]){_0x4e0d83[_0xfc43f2[_0x2823('0x40')]['toLowerCase']()]=_0xfc43f2[_0x2823('0x42')]['toString']();}else if(_0xfc43f2[_0x2823('0x3f')]===_0x2823('0x43')&&_0xfc43f2[_0x2823('0x1f')]&&_0xfc43f2[_0x2823('0x41')]){_0x4e0d83[_0x2823('0x44')][_0x2823('0x1e')]({'id':_0xfc43f2[_0x2823('0x1f')],'value':_0xfc43f2['content'][_0x2823('0x25')]()});}else if(_0xfc43f2[_0x2823('0x3f')]===_0x2823('0x45')&&_0xfc43f2['variableName']&&_0xfc43f2[_0x2823('0x1f')]&&_0xfc43f2[_0x2823('0x41')]){_0x99e6f2[_0xfc43f2[_0x2823('0x1d')]]&&_0x4e0d83['custom_fields'][_0x2823('0x1e')]({'id':_0xfc43f2[_0x2823('0x1f')],'value':_0x99e6f2[_0xfc43f2[_0x2823('0x1d')]][_0x2823('0x25')]()});}else if(_0xfc43f2[_0x2823('0x3f')]==='customVariable'&&_0xfc43f2[_0x2823('0x46')]&&_0xfc43f2[_0x2823('0x46')][_0x2823('0xd')]&&_0xfc43f2[_0x2823('0x1f')]&&_0xfc43f2[_0x2823('0x41')]){_0x99e6f2[_0xfc43f2['Variable'][_0x2823('0xd')][_0x2823('0x47')]()]&&_0x4e0d83['custom_fields'][_0x2823('0x1e')]({'id':_0xfc43f2[_0x2823('0x1f')],'value':_0x99e6f2[_0xfc43f2[_0x2823('0x46')][_0x2823('0xd')][_0x2823('0x47')]()][_0x2823('0x25')]()});}});}return _0x4e0d83;}function getConnection(_0x442358){return request({'method':_0x2823('0x9'),'form':{'method':_0x2823('0x48'),'input_type':'JSON','response_type':_0x2823('0x20'),'rest_data':JSON[_0x2823('0x21')]({'user_auth':{'user_name':_0x442358[_0x2823('0x49')],'password':_0x442358[_0x2823('0x4a')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x2823('0x2c')](function(_0x392600){var _0x4ce669=_0x392600;if(_0x4ce669['id']){def['sessionID']=_0x4ce669['id'];return BPromise[_0x2823('0x31')](_0x4ce669);}else{throw new Error(util['format'](_0x2823('0x4b'),_0x442358['id']));}});}function setRelationship(_0x2d843c,_0x256a6c,_0x503bad,_0x51c9da){return request({'form':{'method':_0x2823('0x4c'),'input_type':_0x2823('0x20'),'response_type':'JSON','rest_data':JSON[_0x2823('0x21')]({'session':_0x2d843c['id'],'module_name':'Calls','module_id':_0x503bad['id'],'link_field_name':_0x51c9da,'related_ids':[_0x256a6c['id']]})}});}exports[_0x2823('0x4d')]=function(_0x574c89,_0x55b86a,_0x1dbc63,_0x4302de,_0x23ca7f,_0x2bf1ab){var _0x41fda4,_0x389d09,_0x5034dc,_0x5af48b;_0x2bf1ab[_0x2823('0x4e')]=intUtil[_0x2823('0x4f')](_0x2bf1ab[_0x2823('0x4e')]);_0x2bf1ab[_0x2823('0x50')]=intUtil[_0x2823('0x4f')](_0x2bf1ab[_0x2823('0x50')]);def[_0x2823('0x51')]=util['format']('%s/service/v4_1/rest.php',_0x2bf1ab[_0x2823('0x4e')]);if(_0x23ca7f&&_0x23ca7f[_0x2823('0x52')]){logger['info'](_0x2823('0x53'),_0x2823('0x54'));_0x55b86a['recordingURL']=util[_0x2823('0x3c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2bf1ab['serverUrl'],_0x55b86a['uniqueid'],md5(_0x55b86a[_0x2823('0x55')]));}else{_0x55b86a[_0x2823('0x56')]='';}return getConnection(_0x2bf1ab)[_0x2823('0x2c')](function(_0x4cc2ab){_0x5af48b=_0x4cc2ab;return getUser(_0x2bf1ab,_0x4302de['name'],_0x5af48b);})[_0x2823('0x2c')](function(_0x121b8e){_0x41fda4=_0x121b8e;logger[_0x2823('0xb')]('The\x20User\x20ID\x20is:',_0x41fda4['id']);return getEndUser(_0x2bf1ab,_0x55b86a[_0x2823('0x57')],_0x55b86a[_0x2823('0x58')],_0x5af48b);})[_0x2823('0x2c')](function(_0x5908a6){_0x389d09=_0x5908a6;logger[_0x2823('0xb')](_0x2823('0x59'),_0x389d09['id']);return getTicket(_0x2bf1ab,_0x41fda4,_0x389d09,_0x1dbc63,_0x55b86a,_0x1dbc63['Fields'],_0x5af48b,_0x2823('0x5a'));})[_0x2823('0x2c')](function(_0x1c003e){_0x5034dc=_0x1c003e;logger[_0x2823('0xb')]('Ticket\x20created!');logger[_0x2823('0xb')]('The\x20Ticket\x20ID\x20is:',_0x5034dc['id']);return setRelationship(_0x5af48b,_0x41fda4,_0x5034dc,'users');})[_0x2823('0x2c')](function(){return setRelationship(_0x5af48b,_0x389d09,_0x5034dc,_0x2823('0x5b'));})[_0x2823('0x2c')](function(){return getServerInfo(_0x5af48b);})[_0x2823('0x2c')](function(_0x58db25){var _0x5ef594=parseInt(_0x58db25['version'][_0x2823('0x5c')](0x0));var _0x91c35f=util[_0x2823('0x3c')](_0x2823('0x5d'),_0x2bf1ab[_0x2823('0x4e')],_0x5034dc['id']);if(_0x5ef594>0x6){_0x91c35f=util[_0x2823('0x3c')](_0x2823('0x5e'),_0x2bf1ab[_0x2823('0x4e')],_0x5034dc['id']);}logger[_0x2823('0xb')](_0x2823('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2823('0x3c')](_0x2823('0x5f'),_0x4302de[_0x2823('0xd')]),_0x2823('0x60'),{'uri':_0x91c35f});})[_0x2823('0x61')](function(_0x33b288){logger[_0x2823('0x62')]('[QUEUE]',JSON[_0x2823('0x21')](_0x33b288));});};exports[_0x2823('0x63')]=function(_0x374146,_0x347912,_0x24e88a,_0x2f00e1,_0xeeb7e6,_0x4ea5fe,_0x1d85ea){var _0x5280e7,_0x5e2132,_0x1e4f64,_0x260a52;_0x4ea5fe[_0x2823('0x4e')]=intUtil['stripTrailingSlash'](_0x4ea5fe[_0x2823('0x4e')]);_0x4ea5fe['serverUrl']=intUtil[_0x2823('0x4f')](_0x4ea5fe['serverUrl']);def['uri']=util['format'](_0x2823('0x64'),_0x4ea5fe[_0x2823('0x4e')]);if(_0x1d85ea&&_0x1d85ea['recordingFormat']&&_0x1d85ea[_0x2823('0x65')]!==_0x2823('0x66')){logger[_0x2823('0xb')]('[OUTBOUND]',_0x2823('0x54'));_0x347912['recordingURL']=util[_0x2823('0x3c')](_0x2823('0x67'),_0x4ea5fe['serverUrl'],_0x347912[_0x2823('0x55')],md5(_0x347912[_0x2823('0x55')]));}return getConnection(_0x4ea5fe)[_0x2823('0x2c')](function(_0x2e8263){_0x260a52=_0x2e8263;return getUser(_0x4ea5fe,_0x2f00e1['name'],_0x260a52);})[_0x2823('0x2c')](function(_0x3a980c){_0x5280e7=_0x3a980c;logger['info'](_0x2823('0x68'),_0x5280e7['id']);return getEndUser(_0x4ea5fe,_0x347912[_0x2823('0x69')],_0x347912[_0x2823('0x6a')],_0x260a52);})['then'](function(_0xddac08){_0x5e2132=_0xddac08;logger[_0x2823('0xb')](_0x2823('0x59'),_0x5e2132['id']);return getTicket(_0x4ea5fe,_0x5280e7,_0x5e2132,_0x24e88a,_0x347912,_0x24e88a['Fields'],_0x260a52,_0x2823('0x6b'));})[_0x2823('0x2c')](function(_0x138531){_0x1e4f64=_0x138531;logger[_0x2823('0xb')](_0x2823('0x6c'));logger[_0x2823('0xb')](_0x2823('0x6d'),_0x1e4f64['id']);return setRelationship(_0x260a52,_0x5280e7,_0x1e4f64,_0x2823('0x6e'));})['then'](function(){return setRelationship(_0x260a52,_0x5e2132,_0x1e4f64,_0x2823('0x5b'));})['then'](function(){return getServerInfo(_0x260a52);})['then'](function(_0x4b65ab){var _0x3ce9e9=parseInt(_0x4b65ab[_0x2823('0x6f')][_0x2823('0x5c')](0x0));var _0x3cdac6=util['format'](_0x2823('0x5d'),_0x4ea5fe[_0x2823('0x4e')],_0x1e4f64['id']);if(_0x3ce9e9>0x6){_0x3cdac6=util[_0x2823('0x3c')](_0x2823('0x5e'),_0x4ea5fe[_0x2823('0x4e')],_0x1e4f64['id']);}logger[_0x2823('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2823('0x3c')](_0x2823('0x5f'),_0x2f00e1[_0x2823('0xd')]),_0x2823('0x60'),{'uri':_0x3cdac6});})['catch'](function(_0xfbf745){logger[_0x2823('0x62')](_0x2823('0x70'),JSON[_0x2823('0x21')](_0xfbf745));});};exports[_0x2823('0x71')]=function(_0x4f43b2,_0xfa32e,_0x522b72,_0x61ea1f,_0x31a419,_0x24c649){var _0x58d71f,_0x3e2ffb,_0x4f265b,_0x5a4194;_0x24c649[_0x2823('0x4e')]=intUtil[_0x2823('0x4f')](_0x24c649[_0x2823('0x4e')]);_0x24c649[_0x2823('0x50')]=intUtil[_0x2823('0x4f')](_0x24c649[_0x2823('0x50')]);def[_0x2823('0x51')]=util[_0x2823('0x3c')](_0x2823('0x64'),_0x24c649['remoteUri']);if(_0x31a419&&_0x31a419[_0x2823('0x52')]){logger[_0x2823('0xb')](_0x2823('0x72'),_0x2823('0x54'));_0xfa32e[_0x2823('0x56')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24c649[_0x2823('0x50')],_0xfa32e['uniqueid'],md5(_0xfa32e[_0x2823('0x55')]));}else{_0xfa32e[_0x2823('0x56')]='';}return getConnection(_0x24c649)[_0x2823('0x2c')](function(_0x362fbe){_0x5a4194=_0x362fbe;return getUser(_0x24c649,_0x61ea1f[_0x2823('0xd')],_0x5a4194);})['then'](function(_0x1ef0b3){_0x58d71f=_0x1ef0b3;logger[_0x2823('0xb')]('The\x20User\x20ID\x20is:',_0x58d71f['id']);return getEndUser(_0x24c649,_0xfa32e[_0x2823('0x57')],_0xfa32e[_0x2823('0x58')],_0x5a4194);})[_0x2823('0x2c')](function(_0x465945){_0x3e2ffb=_0x465945;logger['info'](_0x2823('0x59'),_0x3e2ffb['id']);return getTicket(_0x24c649,_0x58d71f,_0x3e2ffb,_0x522b72,_0xfa32e,_0x522b72[_0x2823('0x73')],_0x5a4194,_0x2823('0x5a'));})[_0x2823('0x2c')](function(_0x46f82f){_0x4f265b=_0x46f82f;logger['info'](_0x2823('0x6c'));logger[_0x2823('0xb')](_0x2823('0x6d'),_0x4f265b['id']);return setRelationship(_0x5a4194,_0x58d71f,_0x4f265b,'users');})['then'](function(){return setRelationship(_0x5a4194,_0x3e2ffb,_0x4f265b,'contacts');})[_0x2823('0x2c')](function(){return getServerInfo(_0x5a4194);})['catch'](function(_0xc14a34){logger[_0x2823('0x62')](_0x2823('0x72'),JSON[_0x2823('0x21')](_0xc14a34));});}; \ No newline at end of file +var _0x0c90=['[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','calleridname','The\x20Enduser\x20ID\x20is:','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','users','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','user:%s','abandoned','[ABANDONED]','calleridnum','lodash','bluebird','md5','util','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','variableName','push','idField','set_entry','JSON','stringify','Calls','apiKey','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','info','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','forEach','type','nameField','customField','toLowerCase','content','string','custom_fields','toString','variable','customVariable','Variable','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format'];(function(_0x54da57,_0x45fdcd){var _0xc0c593=function(_0x505c82){while(--_0x505c82){_0x54da57['push'](_0x54da57['shift']());}};_0xc0c593(++_0x45fdcd);}(_0x0c90,0x119));var _0x00c9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0c90[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x00c9('0x0'));var rp=require('request-promise');var BPromise=require(_0x00c9('0x1'));var md5=require(_0x00c9('0x2'));var util=require(_0x00c9('0x3'));var Redis=require(_0x00c9('0x4'));var intUtil=require(_0x00c9('0x5'));var config=require('../../../../config/environment');var logger=require(_0x00c9('0x6'))('sugarcrm');config['redis']=_[_0x00c9('0x7')](config[_0x00c9('0x8')],{'host':_0x00c9('0x9'),'port':0x18eb});var io=require(_0x00c9('0xa'))(new Redis(config[_0x00c9('0x8')]));var def={'method':_0x00c9('0xb'),'json':!![]};function emit(_0x3e444c,_0x596d04,_0x82e183){io['to'](_0x3e444c)['emit'](_0x596d04,_0x82e183);}function getTicket(_0x390693,_0x1d5444,_0xd4f4f4,_0x23998c,_0x19ad11,_0x12b265,_0x4f82bd,_0x92b7c8){logger['info'](_0x00c9('0xc'));var _0x1d1a4f=new Date();var _0x2328a8=[{'name':_0x00c9('0xd'),'value':intUtil[_0x00c9('0xe')](_0x23998c[_0x00c9('0xf')],_0x19ad11,'\x20')},{'name':_0x00c9('0x10'),'value':_0x1d5444['id']},{'name':_0x00c9('0x11'),'value':_0x1d5444['id']},{'name':_0x00c9('0x12'),'value':intUtil[_0x00c9('0xe')](_0x23998c[_0x00c9('0x13')],_0x19ad11,'\x0a')},{'name':_0x00c9('0x14'),'value':_0x1d1a4f[_0x00c9('0x15')]()['slice'](0x0,0x13)[_0x00c9('0x16')]('T','\x20')},{'name':_0x00c9('0x17'),'value':'0'},{'name':_0x00c9('0x18'),'value':'15'},{'name':_0x00c9('0x19'),'value':_0xd4f4f4['id']},{'name':_0x00c9('0x1a'),'value':_0x00c9('0x1b')},{'name':_0x00c9('0x1c'),'value':_0xd4f4f4['name']},{'name':'direction','value':_0x92b7c8}];if(_0x12b265[_0x00c9('0x1d')]){_['forEach'](_0x12b265,function(_0x39d61f){if(_0x19ad11[_0x39d61f[_0x00c9('0x1e')]]){_0x2328a8[_0x00c9('0x1f')]({'name':_0x39d61f[_0x00c9('0x20')],'value':_0x19ad11[_0x39d61f[_0x00c9('0x1e')]]});}});}return request({'form':{'method':_0x00c9('0x21'),'input_type':_0x00c9('0x22'),'response_type':_0x00c9('0x22'),'rest_data':JSON[_0x00c9('0x23')]({'session':_0x4f82bd['id'],'module_name':_0x00c9('0x24'),'name_value_list':_0x2328a8})}});}function getAuth(_0x56757a){return util['format']('Basic\x20%s',new Buffer(_0x56757a[_0x00c9('0x25')]+':X')['toString']('base64'));}function getServerInfo(_0xf13653){return request({'form':{'method':_0x00c9('0x26'),'input_type':'JSON','response_type':_0x00c9('0x22'),'rest_data':JSON['stringify']({'session':_0xf13653['id']})}});}function getUser(_0x70dd13,_0x43d9b0,_0x21106e){if(_0x43d9b0){logger['info'](_0x00c9('0x27'),_0x43d9b0);return request({'form':{'method':_0x00c9('0x28'),'input_type':_0x00c9('0x22'),'response_type':_0x00c9('0x22'),'rest_data':JSON[_0x00c9('0x23')]({'session':_0x21106e['id'],'module_name':_0x00c9('0x29'),'query':util['format'](_0x00c9('0x2a'),_0x43d9b0),'order_by':'','offset':'0','select_fields':['id',_0x00c9('0xd'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x00c9('0x2b')](function(_0x52f4a7){if(_0x52f4a7[_0x00c9('0x2c')]['length']){var _0x39400e=_[_0x00c9('0x2d')](_0x52f4a7[_0x00c9('0x2c')],function(_0x152415){return _0x152415[_0x00c9('0x2e')][_0x00c9('0x2f')]['value']===_0x43d9b0;});if(_0x39400e){logger[_0x00c9('0x30')]('Agent\x20found!');return BPromise[_0x00c9('0x31')]({'id':_0x39400e[_0x00c9('0x2e')]['id'][_0x00c9('0x32')],'name':_0x39400e[_0x00c9('0x2e')][_0x00c9('0xd')][_0x00c9('0x32')]});}}logger[_0x00c9('0x30')](_0x00c9('0x33'));return BPromise[_0x00c9('0x31')]({'id':_0x21106e[_0x00c9('0x2e')][_0x00c9('0x34')][_0x00c9('0x32')],'name':_0x21106e[_0x00c9('0x2e')]['user_name'][_0x00c9('0x32')]});});}else{logger[_0x00c9('0x30')](_0x00c9('0x35'));return BPromise[_0x00c9('0x31')]({'id':_0x21106e['name_value_list'][_0x00c9('0x34')][_0x00c9('0x32')],'name':_0x21106e[_0x00c9('0x2e')][_0x00c9('0x2f')]['value']});}}function getEndUser(_0x2c1c65,_0x3c9b2c,_0x22b009,_0xe62a55){logger[_0x00c9('0x30')](_0x00c9('0x36'),_0x22b009);return request({'form':{'method':'get_entry_list','input_type':_0x00c9('0x22'),'response_type':_0x00c9('0x22'),'rest_data':JSON[_0x00c9('0x23')]({'session':_0xe62a55['id'],'module_name':_0x00c9('0x1b'),'query':util[_0x00c9('0x37')](_0x00c9('0x38'),_0x22b009),'order_by':'','offset':'0','select_fields':['id',_0x00c9('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x00c9('0x2b')](function(_0x52500a){if(_0x52500a[_0x00c9('0x2c')][_0x00c9('0x1d')]){var _0xd9ad59=_['find'](_0x52500a[_0x00c9('0x2c')],function(_0x25615c){return _0x25615c[_0x00c9('0x2e')][_0x00c9('0x39')][_0x00c9('0x32')]===_0x22b009;});if(_0xd9ad59){logger[_0x00c9('0x30')](_0x00c9('0x3a'));return BPromise[_0x00c9('0x31')]({'id':_0xd9ad59['name_value_list']['id'][_0x00c9('0x32')],'name':_0xd9ad59[_0x00c9('0x2e')][_0x00c9('0xd')][_0x00c9('0x32')],'phone':_0xd9ad59[_0x00c9('0x2e')][_0x00c9('0x39')][_0x00c9('0x32')]});}}else{logger[_0x00c9('0x30')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0x00c9('0x22'),'response_type':_0x00c9('0x22'),'rest_data':JSON['stringify']({'session':_0xe62a55['id'],'module_name':'Contacts','name_value_list':[{'name':_0x00c9('0x3b'),'value':_0x3c9b2c!==_0x00c9('0x3c')?_0x3c9b2c:util[_0x00c9('0x37')](_0x00c9('0x3d'),_0x22b009)},{'name':'phone_home','value':_0x22b009}]})}})[_0x00c9('0x2b')](function(_0x1b9755){logger[_0x00c9('0x30')](_0x00c9('0x3e'));return BPromise[_0x00c9('0x31')]({'id':_0x1b9755['id'],'name':_0x1b9755[_0x00c9('0x2c')][_0x00c9('0x3b')][_0x00c9('0x32')],'phone':_0x1b9755[_0x00c9('0x2c')][_0x00c9('0x39')][_0x00c9('0x32')]});});}});}function request(_0x4df6b8){logger['debug'](_0x00c9('0x3f'),JSON[_0x00c9('0x23')](_0x4df6b8));return rp(_[_0x00c9('0x40')](def,_0x4df6b8));}function getTags(_0x32ae12,_0x3e0a0a){var _0x4a8e05=[];if(_0x32ae12&&_0x32ae12[_0x00c9('0x1d')]>0x0){_0x4a8e05=_[_0x00c9('0x41')](_0x32ae12,_0x3e0a0a);}return _0x4a8e05;}function getCustomFields(_0x303183,_0x58b3b1){var _0x323b33=[];var _0x52c937={'custom_fields':[]};if(_0x303183[_0x00c9('0x1d')]>0x0){_[_0x00c9('0x42')](_0x303183,function(_0x4c203a){if(_0x4c203a[_0x00c9('0x43')]==='string'&&_0x4c203a[_0x00c9('0x44')]&&!_0x4c203a[_0x00c9('0x45')]){_0x52c937[_0x4c203a[_0x00c9('0x44')][_0x00c9('0x46')]()]=_0x4c203a[_0x00c9('0x47')]['toString']();}else if(_0x4c203a[_0x00c9('0x43')]===_0x00c9('0x48')&&_0x4c203a['idField']&&_0x4c203a[_0x00c9('0x45')]){_0x52c937[_0x00c9('0x49')][_0x00c9('0x1f')]({'id':_0x4c203a[_0x00c9('0x20')],'value':_0x4c203a[_0x00c9('0x47')][_0x00c9('0x4a')]()});}else if(_0x4c203a[_0x00c9('0x43')]===_0x00c9('0x4b')&&_0x4c203a[_0x00c9('0x1e')]&&_0x4c203a[_0x00c9('0x20')]&&_0x4c203a[_0x00c9('0x45')]){_0x58b3b1[_0x4c203a[_0x00c9('0x1e')]]&&_0x52c937[_0x00c9('0x49')][_0x00c9('0x1f')]({'id':_0x4c203a['idField'],'value':_0x58b3b1[_0x4c203a['variableName']][_0x00c9('0x4a')]()});}else if(_0x4c203a['type']===_0x00c9('0x4c')&&_0x4c203a[_0x00c9('0x4d')]&&_0x4c203a[_0x00c9('0x4d')][_0x00c9('0xd')]&&_0x4c203a[_0x00c9('0x20')]&&_0x4c203a[_0x00c9('0x45')]){_0x58b3b1[_0x4c203a[_0x00c9('0x4d')][_0x00c9('0xd')][_0x00c9('0x46')]()]&&_0x52c937[_0x00c9('0x49')]['push']({'id':_0x4c203a[_0x00c9('0x20')],'value':_0x58b3b1[_0x4c203a['Variable']['name']['toLowerCase']()][_0x00c9('0x4a')]()});}});}return _0x52c937;}function getConnection(_0x3a018b){return request({'method':'POST','form':{'method':_0x00c9('0x4e'),'input_type':_0x00c9('0x22'),'response_type':_0x00c9('0x22'),'rest_data':JSON[_0x00c9('0x23')]({'user_auth':{'user_name':_0x3a018b[_0x00c9('0x4f')],'password':_0x3a018b[_0x00c9('0x50')],'encryption':_0x00c9('0x51')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x00c9('0x2b')](function(_0x53bf10){var _0x4cb0f5=_0x53bf10;if(_0x4cb0f5['id']){def[_0x00c9('0x52')]=_0x4cb0f5['id'];return BPromise['resolve'](_0x4cb0f5);}else{throw new Error(util[_0x00c9('0x37')](_0x00c9('0x53'),_0x3a018b['id']));}});}function setRelationship(_0x3ea382,_0xb99ef5,_0x591923,_0x53feaa){return request({'form':{'method':_0x00c9('0x54'),'input_type':_0x00c9('0x22'),'response_type':_0x00c9('0x22'),'rest_data':JSON[_0x00c9('0x23')]({'session':_0x3ea382['id'],'module_name':_0x00c9('0x24'),'module_id':_0x591923['id'],'link_field_name':_0x53feaa,'related_ids':[_0xb99ef5['id']]})}});}exports[_0x00c9('0x55')]=function(_0x2ab1b6,_0xc22a10,_0x998df,_0x13a02d,_0x2834ba,_0x5c42cf){var _0x358f56,_0x54d494,_0xa41d7f,_0x224708;_0x5c42cf[_0x00c9('0x56')]=intUtil['stripTrailingSlash'](_0x5c42cf[_0x00c9('0x56')]);_0x5c42cf['serverUrl']=intUtil[_0x00c9('0x57')](_0x5c42cf[_0x00c9('0x58')]);def['uri']=util[_0x00c9('0x37')](_0x00c9('0x59'),_0x5c42cf[_0x00c9('0x56')]);if(_0x2834ba&&_0x2834ba[_0x00c9('0x5a')]){logger[_0x00c9('0x30')](_0x00c9('0x5b'),_0x00c9('0x5c'));_0xc22a10['recordingURL']=util[_0x00c9('0x37')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5c42cf[_0x00c9('0x58')],_0xc22a10[_0x00c9('0x5d')],md5(_0xc22a10[_0x00c9('0x5d')]));}else{_0xc22a10[_0x00c9('0x5e')]='';}return getConnection(_0x5c42cf)[_0x00c9('0x2b')](function(_0x3fdee6){_0x224708=_0x3fdee6;return getUser(_0x5c42cf,_0x13a02d[_0x00c9('0xd')],_0x224708);})['then'](function(_0xe7a3f3){_0x358f56=_0xe7a3f3;logger[_0x00c9('0x30')]('The\x20User\x20ID\x20is:',_0x358f56['id']);return getEndUser(_0x5c42cf,_0xc22a10[_0x00c9('0x5f')],_0xc22a10['calleridnum'],_0x224708);})[_0x00c9('0x2b')](function(_0x41bf34){_0x54d494=_0x41bf34;logger[_0x00c9('0x30')](_0x00c9('0x60'),_0x54d494['id']);return getTicket(_0x5c42cf,_0x358f56,_0x54d494,_0x998df,_0xc22a10,_0x998df[_0x00c9('0x61')],_0x224708,_0x00c9('0x62'));})[_0x00c9('0x2b')](function(_0x585014){_0xa41d7f=_0x585014;logger[_0x00c9('0x30')](_0x00c9('0x63'));logger[_0x00c9('0x30')](_0x00c9('0x64'),_0xa41d7f['id']);return setRelationship(_0x224708,_0x358f56,_0xa41d7f,'users');})[_0x00c9('0x2b')](function(){return setRelationship(_0x224708,_0x54d494,_0xa41d7f,_0x00c9('0x65'));})[_0x00c9('0x2b')](function(){return getServerInfo(_0x224708);})[_0x00c9('0x2b')](function(_0x24d79c){var _0x42d435=parseInt(_0x24d79c[_0x00c9('0x66')][_0x00c9('0x67')](0x0));var _0x1cad97=util[_0x00c9('0x37')](_0x00c9('0x68'),_0x5c42cf['remoteUri'],_0xa41d7f['id']);if(_0x42d435>0x6){_0x1cad97=util[_0x00c9('0x37')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5c42cf[_0x00c9('0x56')],_0xa41d7f['id']);}logger['info'](_0x00c9('0x5b'),_0x00c9('0x69'));emit(util['format']('user:%s',_0x13a02d[_0x00c9('0xd')]),_0x00c9('0x6a'),{'uri':_0x1cad97});})[_0x00c9('0x6b')](function(_0x27d24c){logger[_0x00c9('0x6c')](_0x00c9('0x5b'),JSON['stringify'](_0x27d24c));});};exports[_0x00c9('0x6d')]=function(_0x46d2bd,_0x19f363,_0x33fb9f,_0x18625c,_0x1cf20f,_0x4ffa81,_0x223740){var _0x2f434e,_0x3bc329,_0x589fe9,_0x6ba59b;_0x4ffa81['remoteUri']=intUtil[_0x00c9('0x57')](_0x4ffa81['remoteUri']);_0x4ffa81[_0x00c9('0x58')]=intUtil[_0x00c9('0x57')](_0x4ffa81[_0x00c9('0x58')]);def[_0x00c9('0x6e')]=util[_0x00c9('0x37')]('%s/service/v4_1/rest.php',_0x4ffa81[_0x00c9('0x56')]);if(_0x223740&&_0x223740[_0x00c9('0x6f')]&&_0x223740[_0x00c9('0x6f')]!==_0x00c9('0x70')){logger['info']('[OUTBOUND]',_0x00c9('0x5c'));_0x19f363[_0x00c9('0x5e')]=util['format'](_0x00c9('0x71'),_0x4ffa81[_0x00c9('0x58')],_0x19f363['uniqueid'],md5(_0x19f363[_0x00c9('0x5d')]));}return getConnection(_0x4ffa81)[_0x00c9('0x2b')](function(_0x5090f2){_0x6ba59b=_0x5090f2;return getUser(_0x4ffa81,_0x18625c[_0x00c9('0xd')],_0x6ba59b);})[_0x00c9('0x2b')](function(_0x37b9a4){_0x2f434e=_0x37b9a4;logger[_0x00c9('0x30')](_0x00c9('0x72'),_0x2f434e['id']);return getEndUser(_0x4ffa81,_0x19f363[_0x00c9('0x73')],_0x19f363[_0x00c9('0x74')],_0x6ba59b);})['then'](function(_0x6319ab){_0x3bc329=_0x6319ab;logger[_0x00c9('0x30')](_0x00c9('0x60'),_0x3bc329['id']);return getTicket(_0x4ffa81,_0x2f434e,_0x3bc329,_0x33fb9f,_0x19f363,_0x33fb9f[_0x00c9('0x61')],_0x6ba59b,'Outbound');})['then'](function(_0x28c72a){_0x589fe9=_0x28c72a;logger[_0x00c9('0x30')](_0x00c9('0x63'));logger[_0x00c9('0x30')](_0x00c9('0x64'),_0x589fe9['id']);return setRelationship(_0x6ba59b,_0x2f434e,_0x589fe9,_0x00c9('0x75'));})[_0x00c9('0x2b')](function(){return setRelationship(_0x6ba59b,_0x3bc329,_0x589fe9,'contacts');})[_0x00c9('0x2b')](function(){return getServerInfo(_0x6ba59b);})[_0x00c9('0x2b')](function(_0x4e60dd){var _0x33851a=parseInt(_0x4e60dd['version'][_0x00c9('0x67')](0x0));var _0x358de4=util['format'](_0x00c9('0x68'),_0x4ffa81[_0x00c9('0x56')],_0x589fe9['id']);if(_0x33851a>0x6){_0x358de4=util['format'](_0x00c9('0x76'),_0x4ffa81[_0x00c9('0x56')],_0x589fe9['id']);}logger['info'](_0x00c9('0x77'),_0x00c9('0x69'));emit(util['format'](_0x00c9('0x78'),_0x18625c[_0x00c9('0xd')]),_0x00c9('0x6a'),{'uri':_0x358de4});})['catch'](function(_0x31cc23){logger['error']('[OUTBOUND]',JSON[_0x00c9('0x23')](_0x31cc23));});};exports[_0x00c9('0x79')]=function(_0x378142,_0x49c35d,_0x3e33d0,_0x6b9bd8,_0x1052cb,_0x294b83){var _0x5c3a3c,_0x1f7c5f,_0x3d97e7,_0xd691ba;_0x294b83['remoteUri']=intUtil[_0x00c9('0x57')](_0x294b83[_0x00c9('0x56')]);_0x294b83[_0x00c9('0x58')]=intUtil['stripTrailingSlash'](_0x294b83[_0x00c9('0x58')]);def['uri']=util[_0x00c9('0x37')](_0x00c9('0x59'),_0x294b83[_0x00c9('0x56')]);if(_0x1052cb&&_0x1052cb[_0x00c9('0x5a')]){logger[_0x00c9('0x30')](_0x00c9('0x7a'),'Recording\x20is\x20enabled!');_0x49c35d['recordingURL']=util[_0x00c9('0x37')](_0x00c9('0x71'),_0x294b83[_0x00c9('0x58')],_0x49c35d[_0x00c9('0x5d')],md5(_0x49c35d[_0x00c9('0x5d')]));}else{_0x49c35d[_0x00c9('0x5e')]='';}return getConnection(_0x294b83)['then'](function(_0x4e264a){_0xd691ba=_0x4e264a;return getUser(_0x294b83,_0x6b9bd8[_0x00c9('0xd')],_0xd691ba);})[_0x00c9('0x2b')](function(_0x323f9a){_0x5c3a3c=_0x323f9a;logger[_0x00c9('0x30')](_0x00c9('0x72'),_0x5c3a3c['id']);return getEndUser(_0x294b83,_0x49c35d[_0x00c9('0x5f')],_0x49c35d[_0x00c9('0x7b')],_0xd691ba);})['then'](function(_0x1e7e2b){_0x1f7c5f=_0x1e7e2b;logger[_0x00c9('0x30')]('The\x20Enduser\x20ID\x20is:',_0x1f7c5f['id']);return getTicket(_0x294b83,_0x5c3a3c,_0x1f7c5f,_0x3e33d0,_0x49c35d,_0x3e33d0['Fields'],_0xd691ba,'Inbound');})[_0x00c9('0x2b')](function(_0x557b6b){_0x3d97e7=_0x557b6b;logger[_0x00c9('0x30')](_0x00c9('0x63'));logger[_0x00c9('0x30')](_0x00c9('0x64'),_0x3d97e7['id']);return setRelationship(_0xd691ba,_0x5c3a3c,_0x3d97e7,_0x00c9('0x75'));})['then'](function(){return setRelationship(_0xd691ba,_0x1f7c5f,_0x3d97e7,_0x00c9('0x65'));})[_0x00c9('0x2b')](function(){return getServerInfo(_0xd691ba);})[_0x00c9('0x6b')](function(_0x2028e1){logger[_0x00c9('0x6c')]('[ABANDONED]',JSON[_0x00c9('0x23')](_0x2028e1));});}; \ 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 1de6722..c19243b 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 _0x1686=['variableName','customVariable','Variable','toLowerCase','name','toString','keyType','key','format','%s:\x20%s','keyContent','stripTrailingSlash','substr','validateEmail','test','lodash','util','getString','length','type','string','push','content','variable'];(function(_0x1e707b,_0x364cad){var _0x5c793c=function(_0x389eee){while(--_0x389eee){_0x1e707b['push'](_0x1e707b['shift']());}};_0x5c793c(++_0x364cad);}(_0x1686,0x147));var _0x6168=function(_0x117c6e,_0x1b1729){_0x117c6e=_0x117c6e-0x0;var _0xfe63f5=_0x1686[_0x117c6e];return _0xfe63f5;};'use strict';var _=require(_0x6168('0x0'));var util=require(_0x6168('0x1'));exports[_0x6168('0x2')]=function(_0x22587e,_0x4f30c9,_0x4c6fde){var _0x38fc83=[];if(_0x22587e[_0x6168('0x3')]>0x0){var _0x496f82=_['sortBy'](_0x22587e,['id']);for(var _0x168b15=0x0;_0x168b15<_0x496f82['length'];_0x168b15++){var _0x562d85=_0x496f82[_0x168b15];if(_0x562d85[_0x6168('0x4')]===_0x6168('0x5')){_0x38fc83[_0x6168('0x6')](_0x562d85[_0x6168('0x7')]);}else if(_0x562d85[_0x6168('0x4')]===_0x6168('0x8')&&_0x562d85['variableName']){_0x4f30c9[_0x562d85[_0x6168('0x9')]]&&_0x38fc83[_0x6168('0x6')](_0x4f30c9[_0x562d85['variableName']]['toString']());}else if(_0x562d85[_0x6168('0x4')]===_0x6168('0xa')&&_0x562d85['Variable']&&_0x562d85[_0x6168('0xb')]['name']){_0x4f30c9[_0x562d85['Variable']['name'][_0x6168('0xc')]()]&&_0x38fc83[_0x6168('0x6')](_0x4f30c9[_0x562d85[_0x6168('0xb')][_0x6168('0xd')][_0x6168('0xc')]()][_0x6168('0xe')]());}else if(_0x562d85[_0x6168('0x4')]==='keyValue'){if(_0x562d85[_0x6168('0xf')]===_0x6168('0x5')&&_0x562d85[_0x6168('0x10')]){_0x38fc83[_0x6168('0x6')](util[_0x6168('0x11')](_0x6168('0x12'),_0x562d85[_0x6168('0x10')],_0x562d85[_0x6168('0x13')]));}else if(_0x562d85[_0x6168('0xf')]==='variable'&&_0x562d85[_0x6168('0x9')]&&_0x562d85[_0x6168('0x10')]){_0x4f30c9[_0x562d85[_0x6168('0x9')]]&&_0x38fc83[_0x6168('0x6')](util['format'](_0x6168('0x12'),_0x562d85['key'],_0x4f30c9[_0x562d85[_0x6168('0x9')]]));}else if(_0x562d85[_0x6168('0xf')]===_0x6168('0xa')&&_0x562d85[_0x6168('0xb')]&&_0x562d85[_0x6168('0xb')][_0x6168('0xd')]&&_0x562d85[_0x6168('0x10')]){_0x4f30c9[_0x562d85['Variable'][_0x6168('0xd')][_0x6168('0xc')]()]&&_0x38fc83[_0x6168('0x6')](util[_0x6168('0x11')](_0x6168('0x12'),_0x562d85[_0x6168('0x10')],_0x4f30c9[_0x562d85[_0x6168('0xb')][_0x6168('0xd')]['toLowerCase']()]));}}}}return _0x38fc83['join'](_0x4c6fde);};exports[_0x6168('0x14')]=function(_0x40a265){if(_0x40a265&&_0x40a265[_0x6168('0x15')](-0x1)==='/'){return _0x40a265[_0x6168('0x15')](0x0,_0x40a265['length']-0x1);}return _0x40a265;};exports[_0x6168('0x16')]=function(_0x4addac){if(_0x4addac&&_0x4addac!==''){var _0x2b47d1=/^(([^<>()\[\]\\.,;:\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 _0x2b47d1[_0x6168('0x17')](String(_0x4addac)[_0x6168('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x6923=['format','join','substr','validateEmail','test','util','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyType','%s:\x20%s','key','keyContent'];(function(_0x497232,_0x4f1d61){var _0x5e7853=function(_0x91d282){while(--_0x91d282){_0x497232['push'](_0x497232['shift']());}};_0x5e7853(++_0x4f1d61);}(_0x6923,0x165));var _0x3692=function(_0x2df5ca,_0x8e02f9){_0x2df5ca=_0x2df5ca-0x0;var _0x101af2=_0x6923[_0x2df5ca];return _0x101af2;};'use strict';var _=require('lodash');var util=require(_0x3692('0x0'));exports['getString']=function(_0x204910,_0x150dd0,_0x51141e){var _0x39af3c=[];if(_0x204910['length']>0x0){var _0x376742=_[_0x3692('0x1')](_0x204910,['id']);for(var _0x1a56eb=0x0;_0x1a56eb<_0x376742['length'];_0x1a56eb++){var _0x2967d1=_0x376742[_0x1a56eb];if(_0x2967d1[_0x3692('0x2')]===_0x3692('0x3')){_0x39af3c[_0x3692('0x4')](_0x2967d1[_0x3692('0x5')]);}else if(_0x2967d1[_0x3692('0x2')]===_0x3692('0x6')&&_0x2967d1[_0x3692('0x7')]){_0x150dd0[_0x2967d1['variableName']]&&_0x39af3c['push'](_0x150dd0[_0x2967d1[_0x3692('0x7')]][_0x3692('0x8')]());}else if(_0x2967d1['type']===_0x3692('0x9')&&_0x2967d1[_0x3692('0xa')]&&_0x2967d1['Variable'][_0x3692('0xb')]){_0x150dd0[_0x2967d1[_0x3692('0xa')]['name'][_0x3692('0xc')]()]&&_0x39af3c[_0x3692('0x4')](_0x150dd0[_0x2967d1[_0x3692('0xa')][_0x3692('0xb')][_0x3692('0xc')]()]['toString']());}else if(_0x2967d1['type']==='keyValue'){if(_0x2967d1[_0x3692('0xd')]===_0x3692('0x3')&&_0x2967d1['key']){_0x39af3c[_0x3692('0x4')](util['format'](_0x3692('0xe'),_0x2967d1[_0x3692('0xf')],_0x2967d1[_0x3692('0x10')]));}else if(_0x2967d1[_0x3692('0xd')]===_0x3692('0x6')&&_0x2967d1[_0x3692('0x7')]&&_0x2967d1[_0x3692('0xf')]){_0x150dd0[_0x2967d1['variableName']]&&_0x39af3c['push'](util[_0x3692('0x11')](_0x3692('0xe'),_0x2967d1[_0x3692('0xf')],_0x150dd0[_0x2967d1[_0x3692('0x7')]]));}else if(_0x2967d1[_0x3692('0xd')]===_0x3692('0x9')&&_0x2967d1['Variable']&&_0x2967d1[_0x3692('0xa')]['name']&&_0x2967d1['key']){_0x150dd0[_0x2967d1['Variable'][_0x3692('0xb')][_0x3692('0xc')]()]&&_0x39af3c[_0x3692('0x4')](util['format'](_0x3692('0xe'),_0x2967d1[_0x3692('0xf')],_0x150dd0[_0x2967d1[_0x3692('0xa')][_0x3692('0xb')][_0x3692('0xc')]()]));}}}}return _0x39af3c[_0x3692('0x12')](_0x51141e);};exports['stripTrailingSlash']=function(_0x5e2580){if(_0x5e2580&&_0x5e2580[_0x3692('0x13')](-0x1)==='/'){return _0x5e2580[_0x3692('0x13')](0x0,_0x5e2580['length']-0x1);}return _0x5e2580;};exports[_0x3692('0x14')]=function(_0x258637){if(_0x258637&&_0x258637!==''){var _0x3e7eb7=/^(([^<>()\[\]\\.,;:\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 _0x3e7eb7[_0x3692('0x15')](String(_0x258637)[_0x3692('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 648cfcd..08d196d 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 _0xe027=['%s/webservice.php','remoteUri','sessionName','HelpDesk','stringify','then','success','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','admin','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','catch','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','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','lastname','phone','getEndUser','username','token','Account\x20%d\x20is\x20not\x20valid','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','serverUrl','uniqueid','recordingURL','email','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','abandoned','[ABANDONED]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','length','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','getString','POST'];(function(_0x24247c,_0x37cb1e){var _0x2bc39c=function(_0x2142f0){while(--_0x2142f0){_0x24247c['push'](_0x24247c['shift']());}};_0x2bc39c(++_0x37cb1e);}(_0xe027,0x106));var _0x7e02=function(_0x3cbbf4,_0x3e508f){_0x3cbbf4=_0x3cbbf4-0x0;var _0x2560b7=_0xe027[_0x3cbbf4];return _0x2560b7;};'use strict';var _=require(_0x7e02('0x0'));var rp=require(_0x7e02('0x1'));var BPromise=require(_0x7e02('0x2'));var md5=require(_0x7e02('0x3'));var util=require(_0x7e02('0x4'));var Redis=require(_0x7e02('0x5'));var intUtil=require(_0x7e02('0x6'));var config=require(_0x7e02('0x7'));var logger=require(_0x7e02('0x8'))(_0x7e02('0x9'));config[_0x7e02('0xa')]=_['defaults'](config['redis'],{'host':_0x7e02('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7e02('0xa')]));function emit(_0x53b91c,_0x557349,_0x1533d0){io['to'](_0x53b91c)['emit'](_0x557349,_0x1533d0);}function getCustomFields(_0x27cc57,_0x135555){var _0x1ae101={};if(_0x27cc57[_0x7e02('0xc')]>0x0){_[_0x7e02('0xd')](_0x27cc57,function(_0x103f65){if(_0x103f65['type']===_0x7e02('0xe')&&_0x103f65['idField']){_0x1ae101[_0x103f65[_0x7e02('0xf')]]=_0x103f65[_0x7e02('0x10')][_0x7e02('0x11')]();}else if(_0x103f65[_0x7e02('0x12')]===_0x7e02('0x13')&&_0x103f65[_0x7e02('0x14')]&&_0x103f65[_0x7e02('0xf')]&&_0x135555[_0x103f65['variableName']]){_0x1ae101[_0x103f65[_0x7e02('0xf')]]=_0x135555[_0x103f65['variableName']][_0x7e02('0x11')]();}else if(_0x103f65[_0x7e02('0x12')]===_0x7e02('0x15')&&_0x103f65[_0x7e02('0x16')]&&_0x103f65[_0x7e02('0x16')][_0x7e02('0x17')]&&_0x103f65['idField']&&_0x135555[_0x103f65['Variable']['name'][_0x7e02('0x18')]()]){_0x1ae101[_0x103f65['idField']]=_0x135555[_0x103f65[_0x7e02('0x16')][_0x7e02('0x17')][_0x7e02('0x18')]()][_0x7e02('0x11')]();}});}return _0x1ae101;}function createTicket(_0x52d91b,_0x25254b,_0x232c8b,_0x53d174,_0x1199ed,_0x3d9bee,_0x1d2bd2){logger[_0x7e02('0x19')](_0x7e02('0x1a'));var _0xd7c720=_['merge']({'parent_id':'','assigned_user_id':_0x25254b['id'],'ticketpriorities':_0x7e02('0x1b'),'ticketstatus':_0x7e02('0x1c'),'ticket_title':intUtil['getString'](_0x53d174[_0x7e02('0x1d')],_0x1199ed,'\x20'),'description':intUtil[_0x7e02('0x1e')](_0x53d174['Descriptions'],_0x1199ed,'\x0a'),'contact_id':_0x232c8b['id']},getCustomFields(_0x3d9bee,_0x1199ed));var _0xb1b8f9={'method':_0x7e02('0x1f'),'uri':util['format'](_0x7e02('0x20'),_0x52d91b[_0x7e02('0x21')]),'form':{'operation':'create','username':'admin','sessionName':_0x1d2bd2[_0x7e02('0x22')],'elementType':_0x7e02('0x23'),'element':JSON[_0x7e02('0x24')](_0xd7c720)},'json':!![]};return request(_0xb1b8f9)[_0x7e02('0x25')](function(_0x3b8794){if(_0x3b8794[_0x7e02('0x26')]){return BPromise['resolve']({'id':_0x3b8794['result']['id']});}else{throw new Error(util[_0x7e02('0x27')](_0x7e02('0x28'),JSON['stringify'](_0x3b8794[_0x7e02('0x29')])));}})['catch'](function(_0x216e7c){var _0xd4270e=_0x216e7c[_0x7e02('0x2a')]||0x1f4;logger['error'](_0x7e02('0x2b'),_0x7e02('0x2c'),_0xd4270e,JSON[_0x7e02('0x24')](_0x216e7c));});}function getUser(_0x5c4bbc,_0x53f966,_0x110c2e){if(intUtil[_0x7e02('0x2d')](_0x53f966)){logger['info'](_0x7e02('0x2e'),_0x53f966);return request({'method':_0x7e02('0x2f'),'uri':util[_0x7e02('0x27')](_0x7e02('0x20'),_0x5c4bbc['remoteUri']),'qs':{'operation':_0x7e02('0x30'),'username':_0x7e02('0x31'),'sessionName':_0x110c2e[_0x7e02('0x22')],'query':util[_0x7e02('0x27')](_0x7e02('0x32'),_0x53f966)},'json':!![]})[_0x7e02('0x25')](function(_0x370183){if(_0x370183[_0x7e02('0x26')]&&_0x370183[_0x7e02('0x33')][_0x7e02('0xc')]){logger[_0x7e02('0x19')](_0x7e02('0x34'));return BPromise[_0x7e02('0x35')]({'id':_0x370183[_0x7e02('0x33')][0x0]['id'],'email':_0x370183[_0x7e02('0x33')][0x0]['email1'],'name':_0x370183[_0x7e02('0x33')][0x0][_0x7e02('0x36')]+'\x20'+_0x370183[_0x7e02('0x33')][_0x7e02('0x37')]});}else{logger[_0x7e02('0x19')](_0x7e02('0x38'));return BPromise[_0x7e02('0x35')]({'id':_0x110c2e['userId'],'email':_0x5c4bbc['username'],'name':'admin'});}})['catch'](function(_0x1d1d15){var _0x1a5ad8=_0x1d1d15['statusCode']||0x1f4;logger[_0x7e02('0x29')](_0x7e02('0x2b'),'getUser',_0x1a5ad8,JSON[_0x7e02('0x24')](_0x1d1d15));});}else{logger[_0x7e02('0x19')](_0x7e02('0x38'));return BPromise[_0x7e02('0x35')]({'id':_0x110c2e[_0x7e02('0x39')],'email':_0x5c4bbc['username'],'name':'admin'})[_0x7e02('0x3a')](function(_0x59672f){var _0x212dde=_0x59672f[_0x7e02('0x2a')]||0x1f4;logger[_0x7e02('0x29')](_0x7e02('0x2b'),'getUser',_0x212dde,JSON[_0x7e02('0x24')](_0x59672f));});}}function getEndUser(_0x54b206,_0x149aad,_0x418581,_0x1f8d8f){logger[_0x7e02('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x418581);return request({'method':_0x7e02('0x2f'),'uri':util[_0x7e02('0x27')](_0x7e02('0x20'),_0x54b206[_0x7e02('0x21')]),'qs':{'operation':_0x7e02('0x30'),'username':_0x7e02('0x31'),'sessionName':_0x1f8d8f[_0x7e02('0x22')],'query':util[_0x7e02('0x27')](_0x7e02('0x3b'),_0x418581,_0x418581,_0x418581,_0x418581,_0x418581)},'json':!![]})[_0x7e02('0x25')](function(_0x4cd2ba){if(_0x4cd2ba[_0x7e02('0x26')]&&_0x4cd2ba[_0x7e02('0x33')][_0x7e02('0xc')]){logger[_0x7e02('0x19')](_0x7e02('0x3c'));return BPromise[_0x7e02('0x35')]({'id':_0x4cd2ba[_0x7e02('0x33')][0x0]['id'],'name':_0x4cd2ba[_0x7e02('0x33')][0x0][_0x7e02('0x3d')]+'\x20'+_0x4cd2ba[_0x7e02('0x33')][0x0]['lastname'],'phone':_0x418581});}else{logger[_0x7e02('0x19')](_0x7e02('0x3e'));return request({'method':_0x7e02('0x1f'),'uri':util[_0x7e02('0x27')](_0x7e02('0x20'),_0x54b206[_0x7e02('0x21')]),'form':{'operation':'create','sessionName':_0x1f8d8f[_0x7e02('0x22')],'elementType':'Contacts','element':JSON[_0x7e02('0x24')]({'lastname':_0x149aad,'phone':_0x418581,'assigned_user_id':'\x20'})},'json':!![]})[_0x7e02('0x25')](function(_0x10b9c8){logger[_0x7e02('0x19')](_0x7e02('0x3f'));return BPromise[_0x7e02('0x35')]({'id':_0x10b9c8['result']['id'],'name':_0x10b9c8[_0x7e02('0x33')][_0x7e02('0x40')],'phone':_0x10b9c8[_0x7e02('0x33')][_0x7e02('0x41')]});})[_0x7e02('0x3a')](function(_0x40ee49){var _0x4f63dc=_0x40ee49[_0x7e02('0x2a')]||0x1f4;logger[_0x7e02('0x29')](_0x7e02('0x2b'),_0x7e02('0x42'),_0x4f63dc,JSON[_0x7e02('0x24')](_0x40ee49));});}});}function getConnection(_0x4834ca){var _0x25d537=_0x4834ca[_0x7e02('0x43')];var _0x38955f=_0x4834ca['accessKey'];return request({'method':_0x7e02('0x2f'),'uri':util[_0x7e02('0x27')](_0x7e02('0x20'),_0x4834ca['remoteUri']),'qs':{'operation':'getchallenge','username':_0x25d537},'json':!![]})[_0x7e02('0x25')](function(_0x2c95d1){if(_0x2c95d1[_0x7e02('0x26')]){return request({'method':_0x7e02('0x1f'),'uri':util[_0x7e02('0x27')]('%s/webservice.php',_0x4834ca['remoteUri']),'form':{'operation':'login','username':_0x7e02('0x31'),'accessKey':md5(_0x2c95d1[_0x7e02('0x33')][_0x7e02('0x44')]+_0x38955f)},'json':!![]});}})[_0x7e02('0x25')](function(_0xef280c){if(_0xef280c['success']){return BPromise[_0x7e02('0x35')](_0xef280c[_0x7e02('0x33')]);}else{throw new Error(util[_0x7e02('0x27')](_0x7e02('0x45'),_0x4834ca['id']));}})[_0x7e02('0x3a')](function(_0xa76dd7){var _0x5e4867=_0xa76dd7[_0x7e02('0x2a')]||0x1f4;logger[_0x7e02('0x29')](_0x7e02('0x2b'),'getConnection',_0x5e4867,JSON['stringify'](_0xa76dd7));});}function request(_0x1f34f8){logger[_0x7e02('0x19')]('[HTTP]',JSON[_0x7e02('0x24')](_0x1f34f8));return rp(_0x1f34f8);}exports['queue']=function(_0x581650,_0x491b60,_0x1be030,_0xba0117,_0x27cc1c,_0x17add4){var _0x3ea710,_0x47e6d4,_0x3ba011,_0x9f5bfd;_0x17add4[_0x7e02('0x21')]=intUtil[_0x7e02('0x46')](_0x17add4[_0x7e02('0x21')]);if(_0x27cc1c&&_0x27cc1c[_0x7e02('0x47')]){logger['info']('[QUEUE]',_0x7e02('0x48'));_0x491b60['recordingURL']=util[_0x7e02('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x17add4[_0x7e02('0x49')],_0x491b60[_0x7e02('0x4a')],md5(_0x491b60[_0x7e02('0x4a')]));}else{_0x491b60[_0x7e02('0x4b')]='';}return getConnection(_0x17add4)['then'](function(_0xbb7b5a){_0x9f5bfd=_0xbb7b5a;return getUser(_0x17add4,_0xba0117[_0x7e02('0x4c')],_0x9f5bfd);})[_0x7e02('0x25')](function(_0x2e3890){_0x3ea710=_0x2e3890;logger[_0x7e02('0x19')]('The\x20User\x20ID\x20is:',_0x3ea710['id']);return getEndUser(_0x17add4,_0x491b60[_0x7e02('0x4d')],_0x491b60['calleridnum'],_0x9f5bfd);})[_0x7e02('0x25')](function(_0x3c66cd){_0x47e6d4=_0x3c66cd;logger['info'](_0x7e02('0x4e'),_0x47e6d4['id']);return createTicket(_0x17add4,_0x3ea710,_0x47e6d4,_0x1be030,_0x491b60,_0x1be030[_0x7e02('0x4f')],_0x9f5bfd);})['then'](function(_0x1d041c){_0x3ba011=_0x1d041c;logger[_0x7e02('0x19')](_0x7e02('0x50'));logger[_0x7e02('0x19')](_0x7e02('0x51'),_0x3ba011['id']);var _0x458583=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x17add4[_0x7e02('0x21')],_[_0x7e02('0x52')](_0x3ba011['id'],'x')[0x1]);logger[_0x7e02('0x19')](_0x7e02('0x53'),_0x7e02('0x54'));emit(util[_0x7e02('0x27')](_0x7e02('0x55'),_0xba0117['name']),_0x7e02('0x56'),{'uri':_0x458583});})['catch'](function(_0x4327b3){logger[_0x7e02('0x29')](_0x7e02('0x53'),JSON['stringify'](_0x4327b3));});};exports[_0x7e02('0x57')]=function(_0x3fda6c,_0x4e22c1,_0x564b8c,_0x2f9976,_0x384c80,_0x256213,_0x59c2df){var _0x2b1ecb,_0x1f0325,_0x2f4dab,_0x9f59eb;_0x256213[_0x7e02('0x21')]=intUtil['stripTrailingSlash'](_0x256213[_0x7e02('0x21')]);_0x256213[_0x7e02('0x49')]=intUtil['stripTrailingSlash'](_0x256213[_0x7e02('0x49')]);if(_0x59c2df&&_0x59c2df[_0x7e02('0x58')]&&_0x59c2df[_0x7e02('0x58')]!==_0x7e02('0x59')){logger[_0x7e02('0x19')](_0x7e02('0x5a'),'Recording\x20is\x20enabled!');_0x4e22c1['recordingURL']=util[_0x7e02('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x256213[_0x7e02('0x49')],_0x4e22c1[_0x7e02('0x4a')],md5(_0x4e22c1[_0x7e02('0x4a')]));}return getConnection(_0x256213)[_0x7e02('0x25')](function(_0x5766d8){_0x9f59eb=_0x5766d8;return getUser(_0x256213,_0x2f9976['email'],_0x9f59eb);})[_0x7e02('0x25')](function(_0x2d1549){_0x2b1ecb=_0x2d1549;logger[_0x7e02('0x19')](_0x7e02('0x5b'),_0x2b1ecb['id']);return getEndUser(_0x256213,_0x4e22c1['destcalleridname'],_0x4e22c1[_0x7e02('0x5c')],_0x9f59eb);})[_0x7e02('0x25')](function(_0x4d8aee){_0x1f0325=_0x4d8aee;logger[_0x7e02('0x19')](_0x7e02('0x4e'),_0x1f0325['id']);return createTicket(_0x256213,_0x2b1ecb,_0x1f0325,_0x564b8c,_0x4e22c1,_0x564b8c[_0x7e02('0x4f')],_0x9f59eb);})['then'](function(_0x16a970){_0x2f4dab=_0x16a970;logger[_0x7e02('0x19')](_0x7e02('0x50'));logger[_0x7e02('0x19')](_0x7e02('0x51'),_0x2f4dab['id']);var _0x407260=util[_0x7e02('0x27')](_0x7e02('0x5d'),_0x256213[_0x7e02('0x21')],_[_0x7e02('0x52')](_0x2f4dab['id'],'x')[0x1]);logger['info'](_0x7e02('0x5a'),_0x7e02('0x54'));emit(util[_0x7e02('0x27')](_0x7e02('0x55'),_0x2f9976[_0x7e02('0x17')]),'trigger:browser:url',{'uri':_0x407260});})[_0x7e02('0x3a')](function(_0x40e5d7){logger[_0x7e02('0x29')](_0x7e02('0x5a'),JSON[_0x7e02('0x24')](_0x40e5d7));});};exports[_0x7e02('0x5e')]=function(_0x47456d,_0x4161bd,_0x1c9db4,_0x466671,_0x1dbba6,_0x23f1d3){var _0x2075dc,_0x350584,_0x45cc6c,_0x59d984;_0x23f1d3[_0x7e02('0x21')]=intUtil['stripTrailingSlash'](_0x23f1d3['remoteUri']);_0x23f1d3['serverUrl']=intUtil['stripTrailingSlash'](_0x23f1d3[_0x7e02('0x49')]);if(_0x1dbba6&&_0x1dbba6['monitor_format']){logger[_0x7e02('0x19')](_0x7e02('0x5f'),_0x7e02('0x48'));_0x4161bd[_0x7e02('0x4b')]=util[_0x7e02('0x27')](_0x7e02('0x60'),_0x23f1d3['serverUrl'],_0x4161bd[_0x7e02('0x4a')],md5(_0x4161bd[_0x7e02('0x4a')]));}else{_0x4161bd['recordingURL']='';}return getConnection(_0x23f1d3)['then'](function(_0x124280){_0x59d984=_0x124280;return getUser(_0x23f1d3,'',_0x59d984);})[_0x7e02('0x25')](function(_0x2cc1f3){_0x2075dc=_0x2cc1f3;logger[_0x7e02('0x19')](_0x7e02('0x5b'),_0x2075dc['id']);return getEndUser(_0x23f1d3,_0x4161bd[_0x7e02('0x4d')],_0x4161bd[_0x7e02('0x61')],_0x59d984);})[_0x7e02('0x25')](function(_0x709540){_0x350584=_0x709540;logger[_0x7e02('0x19')](_0x7e02('0x4e'),_0x350584['id']);return createTicket(_0x23f1d3,_0x2075dc,_0x350584,_0x1c9db4,_0x4161bd,_0x1c9db4[_0x7e02('0x4f')],_0x59d984);})[_0x7e02('0x25')](function(_0x536820){_0x45cc6c=_0x536820;logger[_0x7e02('0x19')](_0x7e02('0x50'));logger[_0x7e02('0x19')]('The\x20Ticket\x20ID\x20is:',_0x45cc6c['id']);})[_0x7e02('0x3a')](function(_0xec3a00){logger[_0x7e02('0x29')](_0x7e02('0x5f'),JSON[_0x7e02('0x24')](_0xec3a00));});}; \ No newline at end of file +var _0xcc73=['then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','Getting\x20agent\x20with\x20email','GET','remoteUri','query','admin','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','last_name','userId','username','getUser','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','statusCode','Searching\x20end\x20user\x20with\x20phone','Enduser\x20found!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','Account\x20%d\x20is\x20not\x20valid','queue','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','trigger:browser:url','[QUEUE]','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','monitor_format','[ABANDONED]','calleridnum','request-promise','bluebird','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','type','string','content','variable','variableName','idField','toString','customVariable','Variable','name','toLowerCase','Normal','Open','getString','Descriptions','format','%s/webservice.php','create','sessionName','stringify'];(function(_0x12028d,_0x2a3569){var _0x29cd7f=function(_0x4747fb){while(--_0x4747fb){_0x12028d['push'](_0x12028d['shift']());}};_0x29cd7f(++_0x2a3569);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xcc73[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var rp=require(_0x3cc7('0x0'));var BPromise=require(_0x3cc7('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x3cc7('0x2'));var intUtil=require('./util');var config=require(_0x3cc7('0x3'));var logger=require('../../../../config/logger')('vTiger');config[_0x3cc7('0x4')]=_[_0x3cc7('0x5')](config[_0x3cc7('0x4')],{'host':_0x3cc7('0x6'),'port':0x18eb});var io=require(_0x3cc7('0x7'))(new Redis(config['redis']));function emit(_0x416c48,_0x37c184,_0x3f2dd7){io['to'](_0x416c48)[_0x3cc7('0x8')](_0x37c184,_0x3f2dd7);}function getCustomFields(_0x4e047d,_0x2ff7ba){var _0x44005b={};if(_0x4e047d[_0x3cc7('0x9')]>0x0){_[_0x3cc7('0xa')](_0x4e047d,function(_0x26f61a){if(_0x26f61a[_0x3cc7('0xb')]===_0x3cc7('0xc')&&_0x26f61a['idField']){_0x44005b[_0x26f61a['idField']]=_0x26f61a[_0x3cc7('0xd')]['toString']();}else if(_0x26f61a[_0x3cc7('0xb')]===_0x3cc7('0xe')&&_0x26f61a[_0x3cc7('0xf')]&&_0x26f61a[_0x3cc7('0x10')]&&_0x2ff7ba[_0x26f61a[_0x3cc7('0xf')]]){_0x44005b[_0x26f61a[_0x3cc7('0x10')]]=_0x2ff7ba[_0x26f61a[_0x3cc7('0xf')]][_0x3cc7('0x11')]();}else if(_0x26f61a[_0x3cc7('0xb')]===_0x3cc7('0x12')&&_0x26f61a[_0x3cc7('0x13')]&&_0x26f61a[_0x3cc7('0x13')][_0x3cc7('0x14')]&&_0x26f61a[_0x3cc7('0x10')]&&_0x2ff7ba[_0x26f61a[_0x3cc7('0x13')][_0x3cc7('0x14')][_0x3cc7('0x15')]()]){_0x44005b[_0x26f61a[_0x3cc7('0x10')]]=_0x2ff7ba[_0x26f61a[_0x3cc7('0x13')][_0x3cc7('0x14')][_0x3cc7('0x15')]()][_0x3cc7('0x11')]();}});}return _0x44005b;}function createTicket(_0x2a4ddf,_0xff4317,_0x118aa0,_0x2f196a,_0x1545a0,_0x2483c9,_0x382727){logger['info']('Creating\x20new\x20ticket...');var _0x2ee8f6=_['merge']({'parent_id':'','assigned_user_id':_0xff4317['id'],'ticketpriorities':_0x3cc7('0x16'),'ticketstatus':_0x3cc7('0x17'),'ticket_title':intUtil[_0x3cc7('0x18')](_0x2f196a['Subjects'],_0x1545a0,'\x20'),'description':intUtil['getString'](_0x2f196a[_0x3cc7('0x19')],_0x1545a0,'\x0a'),'contact_id':_0x118aa0['id']},getCustomFields(_0x2483c9,_0x1545a0));var _0xffbcd9={'method':'POST','uri':util[_0x3cc7('0x1a')](_0x3cc7('0x1b'),_0x2a4ddf['remoteUri']),'form':{'operation':_0x3cc7('0x1c'),'username':'admin','sessionName':_0x382727[_0x3cc7('0x1d')],'elementType':'HelpDesk','element':JSON[_0x3cc7('0x1e')](_0x2ee8f6)},'json':!![]};return request(_0xffbcd9)[_0x3cc7('0x1f')](function(_0x8f8709){if(_0x8f8709[_0x3cc7('0x20')]){return BPromise[_0x3cc7('0x21')]({'id':_0x8f8709[_0x3cc7('0x22')]['id']});}else{throw new Error(util['format'](_0x3cc7('0x23'),JSON[_0x3cc7('0x1e')](_0x8f8709[_0x3cc7('0x24')])));}})['catch'](function(_0x358c12){var _0x595e7e=_0x358c12['statusCode']||0x1f4;logger['error'](_0x3cc7('0x25'),_0x3cc7('0x26'),_0x595e7e,JSON['stringify'](_0x358c12));});}function getUser(_0x5518cf,_0xb6480e,_0x2bc904){if(intUtil[_0x3cc7('0x27')](_0xb6480e)){logger[_0x3cc7('0x28')](_0x3cc7('0x29'),_0xb6480e);return request({'method':_0x3cc7('0x2a'),'uri':util[_0x3cc7('0x1a')](_0x3cc7('0x1b'),_0x5518cf[_0x3cc7('0x2b')]),'qs':{'operation':_0x3cc7('0x2c'),'username':_0x3cc7('0x2d'),'sessionName':_0x2bc904[_0x3cc7('0x1d')],'query':util[_0x3cc7('0x1a')](_0x3cc7('0x2e'),_0xb6480e)},'json':!![]})['then'](function(_0xbd633e){if(_0xbd633e['success']&&_0xbd633e['result']['length']){logger[_0x3cc7('0x28')](_0x3cc7('0x2f'));return BPromise[_0x3cc7('0x21')]({'id':_0xbd633e[_0x3cc7('0x22')][0x0]['id'],'email':_0xbd633e[_0x3cc7('0x22')][0x0][_0x3cc7('0x30')],'name':_0xbd633e[_0x3cc7('0x22')][0x0][_0x3cc7('0x31')]+'\x20'+_0xbd633e[_0x3cc7('0x22')][_0x3cc7('0x32')]});}else{logger[_0x3cc7('0x28')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3cc7('0x21')]({'id':_0x2bc904[_0x3cc7('0x33')],'email':_0x5518cf[_0x3cc7('0x34')],'name':'admin'});}})['catch'](function(_0x15ac33){var _0x2c7795=_0x15ac33['statusCode']||0x1f4;logger[_0x3cc7('0x24')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x3cc7('0x35'),_0x2c7795,JSON[_0x3cc7('0x1e')](_0x15ac33));});}else{logger['info'](_0x3cc7('0x36'));return BPromise[_0x3cc7('0x21')]({'id':_0x2bc904[_0x3cc7('0x33')],'email':_0x5518cf[_0x3cc7('0x34')],'name':_0x3cc7('0x2d')})[_0x3cc7('0x37')](function(_0x5771c2){var _0x265c25=_0x5771c2[_0x3cc7('0x38')]||0x1f4;logger['error'](_0x3cc7('0x25'),_0x3cc7('0x35'),_0x265c25,JSON['stringify'](_0x5771c2));});}}function getEndUser(_0x3abeda,_0x53cc1d,_0x16e66a,_0xbaf57a){logger[_0x3cc7('0x28')](_0x3cc7('0x39'),_0x16e66a);return request({'method':_0x3cc7('0x2a'),'uri':util[_0x3cc7('0x1a')](_0x3cc7('0x1b'),_0x3abeda[_0x3cc7('0x2b')]),'qs':{'operation':_0x3cc7('0x2c'),'username':_0x3cc7('0x2d'),'sessionName':_0xbaf57a[_0x3cc7('0x1d')],'query':util[_0x3cc7('0x1a')]('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;',_0x16e66a,_0x16e66a,_0x16e66a,_0x16e66a,_0x16e66a)},'json':!![]})[_0x3cc7('0x1f')](function(_0x13c679){if(_0x13c679[_0x3cc7('0x20')]&&_0x13c679[_0x3cc7('0x22')][_0x3cc7('0x9')]){logger[_0x3cc7('0x28')](_0x3cc7('0x3a'));return BPromise[_0x3cc7('0x21')]({'id':_0x13c679[_0x3cc7('0x22')][0x0]['id'],'name':_0x13c679[_0x3cc7('0x22')][0x0]['firstname']+'\x20'+_0x13c679[_0x3cc7('0x22')][0x0][_0x3cc7('0x3b')],'phone':_0x16e66a});}else{logger[_0x3cc7('0x28')](_0x3cc7('0x3c'));return request({'method':_0x3cc7('0x3d'),'uri':util[_0x3cc7('0x1a')](_0x3cc7('0x1b'),_0x3abeda['remoteUri']),'form':{'operation':_0x3cc7('0x1c'),'sessionName':_0xbaf57a[_0x3cc7('0x1d')],'elementType':_0x3cc7('0x3e'),'element':JSON[_0x3cc7('0x1e')]({'lastname':_0x53cc1d,'phone':_0x16e66a,'assigned_user_id':'\x20'})},'json':!![]})[_0x3cc7('0x1f')](function(_0x111548){logger[_0x3cc7('0x28')](_0x3cc7('0x3f'));return BPromise['resolve']({'id':_0x111548[_0x3cc7('0x22')]['id'],'name':_0x111548[_0x3cc7('0x22')]['lastname'],'phone':_0x111548[_0x3cc7('0x22')][_0x3cc7('0x40')]});})[_0x3cc7('0x37')](function(_0x1a1dda){var _0x310d81=_0x1a1dda[_0x3cc7('0x38')]||0x1f4;logger[_0x3cc7('0x24')](_0x3cc7('0x25'),_0x3cc7('0x41'),_0x310d81,JSON[_0x3cc7('0x1e')](_0x1a1dda));});}});}function getConnection(_0x26d984){var _0xdd1e69=_0x26d984[_0x3cc7('0x34')];var _0x10260c=_0x26d984[_0x3cc7('0x42')];return request({'method':_0x3cc7('0x2a'),'uri':util['format'](_0x3cc7('0x1b'),_0x26d984[_0x3cc7('0x2b')]),'qs':{'operation':_0x3cc7('0x43'),'username':_0xdd1e69},'json':!![]})[_0x3cc7('0x1f')](function(_0x4ffd80){if(_0x4ffd80[_0x3cc7('0x20')]){return request({'method':_0x3cc7('0x3d'),'uri':util['format'](_0x3cc7('0x1b'),_0x26d984[_0x3cc7('0x2b')]),'form':{'operation':_0x3cc7('0x44'),'username':_0x3cc7('0x2d'),'accessKey':md5(_0x4ffd80[_0x3cc7('0x22')]['token']+_0x10260c)},'json':!![]});}})[_0x3cc7('0x1f')](function(_0x4d1c53){if(_0x4d1c53[_0x3cc7('0x20')]){return BPromise[_0x3cc7('0x21')](_0x4d1c53[_0x3cc7('0x22')]);}else{throw new Error(util[_0x3cc7('0x1a')](_0x3cc7('0x45'),_0x26d984['id']));}})['catch'](function(_0x15deb3){var _0xfb0a41=_0x15deb3[_0x3cc7('0x38')]||0x1f4;logger[_0x3cc7('0x24')](_0x3cc7('0x25'),'getConnection',_0xfb0a41,JSON[_0x3cc7('0x1e')](_0x15deb3));});}function request(_0x25d323){logger[_0x3cc7('0x28')]('[HTTP]',JSON[_0x3cc7('0x1e')](_0x25d323));return rp(_0x25d323);}exports[_0x3cc7('0x46')]=function(_0xdb8400,_0x1aaac9,_0x569774,_0x1c2003,_0x33e5fd,_0xb4997f){var _0x39e4bc,_0x326f92,_0x362b30,_0x2387c0;_0xb4997f[_0x3cc7('0x2b')]=intUtil['stripTrailingSlash'](_0xb4997f['remoteUri']);if(_0x33e5fd&&_0x33e5fd['monitor_format']){logger[_0x3cc7('0x28')]('[QUEUE]',_0x3cc7('0x47'));_0x1aaac9[_0x3cc7('0x48')]=util[_0x3cc7('0x1a')](_0x3cc7('0x49'),_0xb4997f[_0x3cc7('0x4a')],_0x1aaac9[_0x3cc7('0x4b')],md5(_0x1aaac9[_0x3cc7('0x4b')]));}else{_0x1aaac9['recordingURL']='';}return getConnection(_0xb4997f)[_0x3cc7('0x1f')](function(_0x5c9029){_0x2387c0=_0x5c9029;return getUser(_0xb4997f,_0x1c2003['email'],_0x2387c0);})[_0x3cc7('0x1f')](function(_0x181a70){_0x39e4bc=_0x181a70;logger[_0x3cc7('0x28')]('The\x20User\x20ID\x20is:',_0x39e4bc['id']);return getEndUser(_0xb4997f,_0x1aaac9[_0x3cc7('0x4c')],_0x1aaac9['calleridnum'],_0x2387c0);})['then'](function(_0xa1fed6){_0x326f92=_0xa1fed6;logger[_0x3cc7('0x28')](_0x3cc7('0x4d'),_0x326f92['id']);return createTicket(_0xb4997f,_0x39e4bc,_0x326f92,_0x569774,_0x1aaac9,_0x569774[_0x3cc7('0x4e')],_0x2387c0);})['then'](function(_0x31ebe0){_0x362b30=_0x31ebe0;logger[_0x3cc7('0x28')](_0x3cc7('0x4f'));logger[_0x3cc7('0x28')]('The\x20Ticket\x20ID\x20is:',_0x362b30['id']);var _0xee667f=util[_0x3cc7('0x1a')](_0x3cc7('0x50'),_0xb4997f[_0x3cc7('0x2b')],_[_0x3cc7('0x51')](_0x362b30['id'],'x')[0x1]);logger[_0x3cc7('0x28')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3cc7('0x1a')]('user:%s',_0x1c2003['name']),_0x3cc7('0x52'),{'uri':_0xee667f});})[_0x3cc7('0x37')](function(_0x1f8ba9){logger[_0x3cc7('0x24')](_0x3cc7('0x53'),JSON[_0x3cc7('0x1e')](_0x1f8ba9));});};exports[_0x3cc7('0x54')]=function(_0x17eea9,_0x1a5b93,_0x5e9255,_0x6e0b1f,_0x2908b2,_0x2da10b,_0x23a45d){var _0x5e506a,_0x2c972e,_0x492f5b,_0x5b0327;_0x2da10b['remoteUri']=intUtil[_0x3cc7('0x55')](_0x2da10b[_0x3cc7('0x2b')]);_0x2da10b[_0x3cc7('0x4a')]=intUtil['stripTrailingSlash'](_0x2da10b[_0x3cc7('0x4a')]);if(_0x23a45d&&_0x23a45d[_0x3cc7('0x56')]&&_0x23a45d['recordingFormat']!==_0x3cc7('0x57')){logger[_0x3cc7('0x28')](_0x3cc7('0x58'),_0x3cc7('0x47'));_0x1a5b93['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2da10b[_0x3cc7('0x4a')],_0x1a5b93[_0x3cc7('0x4b')],md5(_0x1a5b93[_0x3cc7('0x4b')]));}return getConnection(_0x2da10b)[_0x3cc7('0x1f')](function(_0x36ae55){_0x5b0327=_0x36ae55;return getUser(_0x2da10b,_0x6e0b1f[_0x3cc7('0x59')],_0x5b0327);})[_0x3cc7('0x1f')](function(_0x220dfc){_0x5e506a=_0x220dfc;logger['info'](_0x3cc7('0x5a'),_0x5e506a['id']);return getEndUser(_0x2da10b,_0x1a5b93[_0x3cc7('0x5b')],_0x1a5b93[_0x3cc7('0x5c')],_0x5b0327);})[_0x3cc7('0x1f')](function(_0xb12795){_0x2c972e=_0xb12795;logger[_0x3cc7('0x28')](_0x3cc7('0x4d'),_0x2c972e['id']);return createTicket(_0x2da10b,_0x5e506a,_0x2c972e,_0x5e9255,_0x1a5b93,_0x5e9255['Fields'],_0x5b0327);})[_0x3cc7('0x1f')](function(_0xac7bed){_0x492f5b=_0xac7bed;logger['info'](_0x3cc7('0x4f'));logger['info'](_0x3cc7('0x5d'),_0x492f5b['id']);var _0x42fbe5=util[_0x3cc7('0x1a')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x2da10b[_0x3cc7('0x2b')],_['split'](_0x492f5b['id'],'x')[0x1]);logger[_0x3cc7('0x28')](_0x3cc7('0x58'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3cc7('0x1a')](_0x3cc7('0x5e'),_0x6e0b1f[_0x3cc7('0x14')]),'trigger:browser:url',{'uri':_0x42fbe5});})['catch'](function(_0xabdab7){logger[_0x3cc7('0x24')]('[OUTBOUND]',JSON[_0x3cc7('0x1e')](_0xabdab7));});};exports['abandoned']=function(_0x3392c5,_0x2f53a8,_0x53f623,_0x4a2b8f,_0x4b1afe,_0x270552){var _0x460d49,_0x351263,_0x18cdc3,_0x51fbb8;_0x270552[_0x3cc7('0x2b')]=intUtil[_0x3cc7('0x55')](_0x270552[_0x3cc7('0x2b')]);_0x270552[_0x3cc7('0x4a')]=intUtil[_0x3cc7('0x55')](_0x270552[_0x3cc7('0x4a')]);if(_0x4b1afe&&_0x4b1afe[_0x3cc7('0x5f')]){logger[_0x3cc7('0x28')](_0x3cc7('0x60'),_0x3cc7('0x47'));_0x2f53a8['recordingURL']=util[_0x3cc7('0x1a')](_0x3cc7('0x49'),_0x270552[_0x3cc7('0x4a')],_0x2f53a8[_0x3cc7('0x4b')],md5(_0x2f53a8[_0x3cc7('0x4b')]));}else{_0x2f53a8[_0x3cc7('0x48')]='';}return getConnection(_0x270552)[_0x3cc7('0x1f')](function(_0x52b6df){_0x51fbb8=_0x52b6df;return getUser(_0x270552,'',_0x51fbb8);})[_0x3cc7('0x1f')](function(_0x39f2a4){_0x460d49=_0x39f2a4;logger[_0x3cc7('0x28')](_0x3cc7('0x5a'),_0x460d49['id']);return getEndUser(_0x270552,_0x2f53a8[_0x3cc7('0x4c')],_0x2f53a8[_0x3cc7('0x61')],_0x51fbb8);})[_0x3cc7('0x1f')](function(_0x2c6ed1){_0x351263=_0x2c6ed1;logger['info']('The\x20Enduser\x20ID\x20is:',_0x351263['id']);return createTicket(_0x270552,_0x460d49,_0x351263,_0x53f623,_0x2f53a8,_0x53f623['Fields'],_0x51fbb8);})['then'](function(_0x5198fb){_0x18cdc3=_0x5198fb;logger[_0x3cc7('0x28')](_0x3cc7('0x4f'));logger[_0x3cc7('0x28')](_0x3cc7('0x5d'),_0x18cdc3['id']);})[_0x3cc7('0x37')](function(_0x16e50d){logger[_0x3cc7('0x24')]('[ABANDONED]',JSON[_0x3cc7('0x1e')](_0x16e50d));});}; \ 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 027f2d5..9196fd3 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 _0x645f=['serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','type','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','Authorization','destcalleridnum','abandoned','[ABANDONED]','calleridname','The\x20Enduser\x20ID\x20is:','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','POST','merge','getString','Descriptions','Fields','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','length','results','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','[HTTP]','map','string','nameField','customField','toLowerCase','custom_fields','idField','content','variable','variableName','customVariable','Variable','name','push','queue','stripTrailingSlash'];(function(_0x2e8de5,_0x3473e9){var _0x418fc2=function(_0x445615){while(--_0x445615){_0x2e8de5['push'](_0x2e8de5['shift']());}};_0x418fc2(++_0x3473e9);}(_0x645f,0x15d));var _0xf645=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x645f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf645('0x0'));var rp=require(_0xf645('0x1'));var md5=require(_0xf645('0x2'));var util=require('util');var Redis=require(_0xf645('0x3'));var intUtil=require(_0xf645('0x4'));var config=require(_0xf645('0x5'));var logger=require(_0xf645('0x6'))(_0xf645('0x7'));config[_0xf645('0x8')]=_[_0xf645('0x9')](config[_0xf645('0x8')],{'host':_0xf645('0xa'),'port':0x18eb});var io=require(_0xf645('0xb'))(new Redis(config['redis']));function emit(_0x17b98c,_0x56aad2,_0x3a3ae1){io['to'](_0x17b98c)['emit'](_0x56aad2,_0x3a3ae1);}var headers={'Content-Type':_0xf645('0xc'),'Accept':'application/json'};function getTicket(_0x3a16d8,_0x107dfb,_0x122bf0,_0x1a39f5,_0x5c2da6){logger[_0xf645('0xd')](_0xf645('0xe'));return request({'uri':util[_0xf645('0xf')]('%s/tickets.json',_0x3a16d8['remoteUri']),'method':_0xf645('0x10'),'body':{'ticket':_[_0xf645('0x11')]({'requester_id':_0x122bf0['id'],'submitter_id':_0x107dfb?_0x107dfb['id']:undefined,'assignee_id':_0x107dfb?_0x107dfb['id']:undefined,'tags':getTags(_0x1a39f5['Tags'],'name'),'subject':intUtil['getString'](_0x1a39f5['Subjects'],_0x5c2da6,'\x20'),'description':intUtil[_0xf645('0x12')](_0x1a39f5['Descriptions'],_0x5c2da6,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf645('0x12')](_0x1a39f5[_0xf645('0x13')],_0x5c2da6,'\x0a')}},getCustomFields(_0x1a39f5[_0xf645('0x14')],_0x5c2da6))}})['then'](function(_0xa090e9){logger['info'](_0xf645('0x15'));return _0xa090e9['ticket'];});}function getUser(_0xf4cc6a,_0x153806){if(intUtil[_0xf645('0x16')](_0x153806)){logger[_0xf645('0xd')](_0xf645('0x17'),_0x153806);return request({'uri':util['format'](_0xf645('0x18'),_0xf4cc6a[_0xf645('0x19')]),'qs':{'query':util[_0xf645('0xf')](_0xf645('0x1a'),_0x153806)}})[_0xf645('0x1b')](function(_0x6cac56){if(_0x6cac56[_0xf645('0x1c')]){logger[_0xf645('0xd')](_0xf645('0x1d'));return _[_0xf645('0x1e')](_0x6cac56['results'],{'email':_0x153806,'role':_0xf645('0x1f')});}else{logger[_0xf645('0xd')](_0xf645('0x20'));return request({'uri':util['format']('%s/users/me.json',_0xf4cc6a[_0xf645('0x19')])})[_0xf645('0x1b')](function(_0x321705){logger[_0xf645('0xd')]('Admin\x20account\x20selected.');return _0x321705[_0xf645('0x21')];});}});}else{logger['info'](_0xf645('0x20'));return request({'uri':util['format']('%s/users/me.json',_0xf4cc6a['remoteUri'])})[_0xf645('0x1b')](function(_0x540d20){logger[_0xf645('0xd')](_0xf645('0x22'));return _0x540d20['user'];});}}function getEndUser(_0x458545,_0x3a9fc6,_0x565d47){logger[_0xf645('0xd')](_0xf645('0x23'),_0x565d47);return request({'uri':util[_0xf645('0xf')](_0xf645('0x18'),_0x458545['remoteUri']),'qs':{'query':util[_0xf645('0xf')]('type:user\x20role:end-user\x20phone:%s',_0x565d47)}})['then'](function(_0x191f8a){var _0x7d1d03;if(_0x191f8a['results'][_0xf645('0x24')]){_0x191f8a[_0xf645('0x25')]=_[_0xf645('0x26')](_0x191f8a[_0xf645('0x25')],{'suspended':![],'role':'end-user'});if(_0x191f8a['results']['length']){_0x7d1d03=_[_0xf645('0x27')](_0x191f8a['results']);}}if(_0x7d1d03){logger['info'](_0xf645('0x28'));return _0x7d1d03;}else{logger[_0xf645('0xd')](_0xf645('0x29'));return request({'uri':util[_0xf645('0xf')]('%s/users.json',_0x458545['remoteUri']),'method':_0xf645('0x10'),'body':{'user':{'role':_0xf645('0x2a'),'name':util[_0xf645('0xf')](_0xf645('0x2b'),_0x3a9fc6||_0x565d47),'phone':_0x565d47}}})[_0xf645('0x1b')](function(_0x14b7f5){logger['info'](_0xf645('0x2c'));return _0x14b7f5['user'];});}});}function getAuth(_0x3b4fc3){var _0x2a19fd;if(_0x3b4fc3[_0xf645('0x2d')]===_0xf645('0x2e')){_0x2a19fd=util['format'](_0xf645('0x2f'),_0x3b4fc3[_0xf645('0x30')],_0x3b4fc3['password']);}else if(_0x3b4fc3['authType']===_0xf645('0x31')){_0x2a19fd=util[_0xf645('0xf')](_0xf645('0x32'),_0x3b4fc3['username'],_0x3b4fc3[_0xf645('0x31')]);}return util[_0xf645('0xf')]('Basic\x20%s',new Buffer(_0x2a19fd)[_0xf645('0x33')](_0xf645('0x34')));}function request(_0x149674){logger[_0xf645('0x35')](_0xf645('0x36'),JSON['stringify'](_0x149674));return rp(_[_0xf645('0x9')](_0x149674,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x47f4e7,_0xcce7f0){var _0x2128bd=[];if(_0x47f4e7&&_0x47f4e7[_0xf645('0x24')]>0x0){_0x2128bd=_[_0xf645('0x37')](_0x47f4e7,_0xcce7f0);}return _0x2128bd;}function getCustomFields(_0x5508f3,_0x6f316c){var _0x110c6a=[];var _0x570ea0={'custom_fields':[]};if(_0x5508f3['length']>0x0){_['forEach'](_0x5508f3,function(_0x445d8a){if(_0x445d8a['type']===_0xf645('0x38')&&_0x445d8a[_0xf645('0x39')]&&!_0x445d8a[_0xf645('0x3a')]){_0x570ea0[_0x445d8a[_0xf645('0x39')][_0xf645('0x3b')]()]=_0x445d8a['content'][_0xf645('0x33')]();}else if(_0x445d8a['type']===_0xf645('0x38')&&_0x445d8a['idField']&&_0x445d8a['customField']){_0x570ea0[_0xf645('0x3c')]['push']({'id':_0x445d8a[_0xf645('0x3d')],'value':_0x445d8a[_0xf645('0x3e')][_0xf645('0x33')]()});}else if(_0x445d8a['type']===_0xf645('0x3f')&&_0x445d8a['variableName']&&_0x445d8a['idField']&&_0x445d8a[_0xf645('0x3a')]){_0x6f316c[_0x445d8a[_0xf645('0x40')]]&&_0x570ea0['custom_fields']['push']({'id':_0x445d8a[_0xf645('0x3d')],'value':_0x6f316c[_0x445d8a[_0xf645('0x40')]]['toString']()});}else if(_0x445d8a['type']===_0xf645('0x41')&&_0x445d8a[_0xf645('0x42')]&&_0x445d8a['Variable'][_0xf645('0x43')]&&_0x445d8a[_0xf645('0x3d')]&&_0x445d8a[_0xf645('0x3a')]){_0x6f316c[_0x445d8a[_0xf645('0x42')]['name'][_0xf645('0x3b')]()]&&_0x570ea0[_0xf645('0x3c')][_0xf645('0x44')]({'id':_0x445d8a[_0xf645('0x3d')],'value':_0x6f316c[_0x445d8a[_0xf645('0x42')]['name']['toLowerCase']()][_0xf645('0x33')]()});}});}return _0x570ea0;}exports[_0xf645('0x45')]=function(_0x9f1287,_0x1a152a,_0x40426d,_0x5536dd,_0x303fd9,_0x303f45){var _0x2a1206,_0x26ac78;_0x303f45[_0xf645('0x19')]=intUtil[_0xf645('0x46')](_0x303f45['remoteUri']);_0x303f45['serverUrl']=intUtil[_0xf645('0x46')](_0x303f45[_0xf645('0x47')]);if(_0x303fd9&&_0x303fd9[_0xf645('0x48')]){logger[_0xf645('0xd')]('[QUEUE]',_0xf645('0x49'));_0x1a152a[_0xf645('0x4a')]=util[_0xf645('0xf')](_0xf645('0x4b'),_0x303f45[_0xf645('0x47')],_0x1a152a['uniqueid'],md5(_0x1a152a['uniqueid']));}else{_0x1a152a[_0xf645('0x4a')]='';}headers['Authorization']=getAuth(_0x303f45);return getUser(_0x303f45,_0x5536dd[_0xf645('0x4c')])[_0xf645('0x1b')](function(_0x4c1706){_0x2a1206=_0x4c1706;logger[_0xf645('0xd')](_0xf645('0x4d'),_0x2a1206['id']);return getEndUser(_0x303f45,_0x1a152a['calleridname'],_0x1a152a[_0xf645('0x4e')]);})[_0xf645('0x1b')](function(_0x23f923){_0x26ac78=_0x23f923;logger[_0xf645('0xd')]('The\x20Enduser\x20ID\x20is:',_0x26ac78['id']);return getTicket(_0x303f45,_0x2a1206,_0x26ac78,_0x40426d,_0x1a152a);})['then'](function(_0x21a9bc){if(_0x21a9bc){logger[_0xf645('0xd')](_0xf645('0x4f'),_0x21a9bc['id']);switch(_0x303f45[_0xf645('0x50')]){case _0xf645('0x51'):logger[_0xf645('0xd')](_0xf645('0x52'),_0xf645('0x53'));return request({'uri':util[_0xf645('0xf')](_0xf645('0x54'),_0x303f45[_0xf645('0x19')],_0x2a1206['id'],_0x21a9bc['id']),'method':_0xf645('0x10')});case _0xf645('0x55'):logger[_0xf645('0xd')]('[QUEUE]',_0xf645('0x56'));emit(util[_0xf645('0xf')](_0xf645('0x57'),_0x5536dd[_0xf645('0x43')]),_0xf645('0x58'),{'uri':util[_0xf645('0xf')](_0xf645('0x59'),_0x303f45['remoteUri'],_0x21a9bc['id'])});break;default:logger[_0xf645('0x5a')]('[QUEUE]',_0xf645('0x5b'));}}})[_0xf645('0x5c')](function(_0x35688c){logger[_0xf645('0x5a')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf645('0x5d')](_0x35688c,{'showHidden':!![],'depth':null}));});};exports[_0xf645('0x5e')]=function(_0x510c8b,_0x1a1231,_0x5dd303,_0x4cf3fa,_0x2e63eb,_0x47b98d,_0x3a974f){var _0x30cff4,_0x51a144;_0x47b98d[_0xf645('0x19')]=intUtil[_0xf645('0x46')](_0x47b98d[_0xf645('0x19')]);_0x47b98d[_0xf645('0x47')]=intUtil[_0xf645('0x46')](_0x47b98d['serverUrl']);if(_0x3a974f&&_0x3a974f['recordingFormat']&&_0x3a974f[_0xf645('0x5f')]!==_0xf645('0x60')){logger[_0xf645('0xd')](_0xf645('0x61'),_0xf645('0x49'));_0x1a1231[_0xf645('0x4a')]=util[_0xf645('0xf')](_0xf645('0x4b'),_0x47b98d[_0xf645('0x47')],_0x1a1231[_0xf645('0x62')],md5(_0x1a1231['uniqueid']));}headers[_0xf645('0x63')]=getAuth(_0x47b98d);return getUser(_0x47b98d,_0x4cf3fa[_0xf645('0x4c')])['then'](function(_0x54a17f){_0x30cff4=_0x54a17f;logger[_0xf645('0xd')](_0xf645('0x4d'),_0x30cff4['id']);return getEndUser(_0x47b98d,_0x1a1231['destcalleridname'],_0x1a1231[_0xf645('0x64')]);})[_0xf645('0x1b')](function(_0x2628e1){_0x51a144=_0x2628e1;logger[_0xf645('0xd')]('The\x20Enduser\x20ID\x20is:',_0x51a144['id']);return getTicket(_0x47b98d,_0x30cff4,_0x51a144,_0x5dd303,_0x1a1231);})[_0xf645('0x1b')](function(_0x50cbcf){if(_0x50cbcf){logger[_0xf645('0xd')](_0xf645('0x4f'),_0x50cbcf['id']);switch(_0x47b98d['type']){case'integrationTab':logger['info'](_0xf645('0x61'),_0xf645('0x53'));return request({'uri':util[_0xf645('0xf')](_0xf645('0x54'),_0x47b98d[_0xf645('0x19')],_0x30cff4['id'],_0x50cbcf['id']),'method':'POST'});case'newTab':logger['info'](_0xf645('0x61'),_0xf645('0x56'));emit(util[_0xf645('0xf')](_0xf645('0x57'),_0x4cf3fa['name']),'trigger:browser:url',{'uri':util[_0xf645('0xf')](_0xf645('0x59'),_0x47b98d[_0xf645('0x19')],_0x50cbcf['id'])});break;default:logger[_0xf645('0x5a')](_0xf645('0x61'),_0xf645('0x5b'));}}})[_0xf645('0x5c')](function(_0x56625b){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x56625b,{'showHidden':!![],'depth':null}));});};exports[_0xf645('0x65')]=function(_0x3b8120,_0x3907ef,_0x30e95a,_0x59a0b2,_0x4ba199,_0x3dde74){var _0x413bcc,_0x257a19;_0x3dde74[_0xf645('0x19')]=intUtil[_0xf645('0x46')](_0x3dde74[_0xf645('0x19')]);_0x3dde74[_0xf645('0x47')]=intUtil[_0xf645('0x46')](_0x3dde74[_0xf645('0x47')]);if(_0x4ba199&&_0x4ba199[_0xf645('0x48')]){logger[_0xf645('0xd')](_0xf645('0x66'),_0xf645('0x49'));_0x3907ef[_0xf645('0x4a')]=util[_0xf645('0xf')](_0xf645('0x4b'),_0x3dde74['serverUrl'],_0x3907ef[_0xf645('0x62')],md5(_0x3907ef[_0xf645('0x62')]));}else{_0x3907ef['recordingURL']='';}headers[_0xf645('0x63')]=getAuth(_0x3dde74);return getUser(_0x3dde74)[_0xf645('0x1b')](function(_0x9b0d4e){_0x413bcc=_0x9b0d4e;logger['info'](_0xf645('0x4d'),_0x413bcc['id']);return getEndUser(_0x3dde74,_0x3907ef[_0xf645('0x67')],_0x3907ef[_0xf645('0x4e')]);})[_0xf645('0x1b')](function(_0x48cd69){_0x257a19=_0x48cd69;logger[_0xf645('0xd')](_0xf645('0x68'),_0x257a19['id']);return getTicket(_0x3dde74,_0x413bcc,_0x257a19,_0x30e95a,_0x3907ef);})['then'](function(_0x5772c5){if(_0x5772c5){logger[_0xf645('0xd')](_0xf645('0x4f'),_0x5772c5['id']);}})[_0xf645('0x5c')](function(_0x3883f5){logger[_0xf645('0x5a')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x3883f5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf95a=['variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization','email','destcalleridname','destcalleridnum','integrationTab','error','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','lodash','request-promise','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','info','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Descriptions','Fields','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','then','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','forEach','type','string','nameField','customField','toLowerCase','content','idField','custom_fields','push'];(function(_0x520723,_0x234a18){var _0x21d524=function(_0x813ee3){while(--_0x813ee3){_0x520723['push'](_0x520723['shift']());}};_0x21d524(++_0x234a18);}(_0xf95a,0x1d2));var _0xaf95=function(_0x1290ac,_0x260e25){_0x1290ac=_0x1290ac-0x0;var _0x2029de=_0xf95a[_0x1290ac];return _0x2029de;};'use strict';var _=require(_0xaf95('0x0'));var rp=require(_0xaf95('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xaf95('0x2'));var intUtil=require(_0xaf95('0x3'));var config=require('../../../../config/environment');var logger=require(_0xaf95('0x4'))(_0xaf95('0x5'));config[_0xaf95('0x6')]=_[_0xaf95('0x7')](config['redis'],{'host':_0xaf95('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x1ef42b,_0x16e4e2,_0x266c70){io['to'](_0x1ef42b)[_0xaf95('0x9')](_0x16e4e2,_0x266c70);}var headers={'Content-Type':'application/json','Accept':_0xaf95('0xa')};function getTicket(_0x3696d2,_0xd64dec,_0x2f8f16,_0x13e0ed,_0x14bf55){logger[_0xaf95('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xaf95('0xc')](_0xaf95('0xd'),_0x3696d2[_0xaf95('0xe')]),'method':'POST','body':{'ticket':_[_0xaf95('0xf')]({'requester_id':_0x2f8f16['id'],'submitter_id':_0xd64dec?_0xd64dec['id']:undefined,'assignee_id':_0xd64dec?_0xd64dec['id']:undefined,'tags':getTags(_0x13e0ed[_0xaf95('0x10')],_0xaf95('0x11')),'subject':intUtil['getString'](_0x13e0ed['Subjects'],_0x14bf55,'\x20'),'description':intUtil[_0xaf95('0x12')](_0x13e0ed[_0xaf95('0x13')],_0x14bf55,'\x0a'),'comment':{'public':![],'body':intUtil[_0xaf95('0x12')](_0x13e0ed[_0xaf95('0x13')],_0x14bf55,'\x0a')}},getCustomFields(_0x13e0ed[_0xaf95('0x14')],_0x14bf55))}})['then'](function(_0x148267){logger['info']('Ticket\x20created!');return _0x148267[_0xaf95('0x15')];});}function getUser(_0x4d95ca,_0x5f4b55){if(intUtil[_0xaf95('0x16')](_0x5f4b55)){logger['info']('Getting\x20agent\x20with\x20email',_0x5f4b55);return request({'uri':util[_0xaf95('0xc')](_0xaf95('0x17'),_0x4d95ca[_0xaf95('0xe')]),'qs':{'query':util[_0xaf95('0xc')](_0xaf95('0x18'),_0x5f4b55)}})['then'](function(_0x474b85){if(_0x474b85[_0xaf95('0x19')]){logger[_0xaf95('0xb')]('Agent\x20found!');return _[_0xaf95('0x1a')](_0x474b85[_0xaf95('0x1b')],{'email':_0x5f4b55,'role':_0xaf95('0x1c')});}else{logger[_0xaf95('0xb')](_0xaf95('0x1d'));return request({'uri':util['format'](_0xaf95('0x1e'),_0x4d95ca['remoteUri'])})[_0xaf95('0x1f')](function(_0x240c9c){logger[_0xaf95('0xb')]('Admin\x20account\x20selected.');return _0x240c9c[_0xaf95('0x20')];});}});}else{logger[_0xaf95('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xaf95('0x1e'),_0x4d95ca[_0xaf95('0xe')])})[_0xaf95('0x1f')](function(_0x1f122a){logger[_0xaf95('0xb')]('Admin\x20account\x20selected.');return _0x1f122a[_0xaf95('0x20')];});}}function getEndUser(_0x581667,_0x3dbd05,_0x12a50b){logger[_0xaf95('0xb')](_0xaf95('0x21'),_0x12a50b);return request({'uri':util[_0xaf95('0xc')]('%s/search.json',_0x581667[_0xaf95('0xe')]),'qs':{'query':util[_0xaf95('0xc')](_0xaf95('0x22'),_0x12a50b)}})[_0xaf95('0x1f')](function(_0x5b2783){var _0x474e76;if(_0x5b2783[_0xaf95('0x1b')]['length']){_0x5b2783[_0xaf95('0x1b')]=_[_0xaf95('0x23')](_0x5b2783[_0xaf95('0x1b')],{'suspended':![],'role':'end-user'});if(_0x5b2783['results'][_0xaf95('0x24')]){_0x474e76=_[_0xaf95('0x25')](_0x5b2783[_0xaf95('0x1b')]);}}if(_0x474e76){logger['info'](_0xaf95('0x26'));return _0x474e76;}else{logger[_0xaf95('0xb')](_0xaf95('0x27'));return request({'uri':util[_0xaf95('0xc')](_0xaf95('0x28'),_0x581667['remoteUri']),'method':'POST','body':{'user':{'role':'end-user','name':util[_0xaf95('0xc')]('Caller\x20-\x20%s',_0x3dbd05||_0x12a50b),'phone':_0x12a50b}}})[_0xaf95('0x1f')](function(_0xb044a8){logger[_0xaf95('0xb')](_0xaf95('0x29'));return _0xb044a8[_0xaf95('0x20')];});}});}function getAuth(_0x3d7b91){var _0x226e25;if(_0x3d7b91[_0xaf95('0x2a')]===_0xaf95('0x2b')){_0x226e25=util['format'](_0xaf95('0x2c'),_0x3d7b91[_0xaf95('0x2d')],_0x3d7b91[_0xaf95('0x2b')]);}else if(_0x3d7b91[_0xaf95('0x2a')]===_0xaf95('0x2e')){_0x226e25=util[_0xaf95('0xc')](_0xaf95('0x2f'),_0x3d7b91['username'],_0x3d7b91[_0xaf95('0x2e')]);}return util[_0xaf95('0xc')](_0xaf95('0x30'),new Buffer(_0x226e25)[_0xaf95('0x31')](_0xaf95('0x32')));}function request(_0x1fd888){logger[_0xaf95('0x33')](_0xaf95('0x34'),JSON[_0xaf95('0x35')](_0x1fd888));return rp(_[_0xaf95('0x7')](_0x1fd888,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3256d1,_0x4cfd53){var _0x707796=[];if(_0x3256d1&&_0x3256d1[_0xaf95('0x24')]>0x0){_0x707796=_['map'](_0x3256d1,_0x4cfd53);}return _0x707796;}function getCustomFields(_0x64b873,_0x311e48){var _0x492a07=[];var _0xe6b3c4={'custom_fields':[]};if(_0x64b873['length']>0x0){_[_0xaf95('0x36')](_0x64b873,function(_0x4a9507){if(_0x4a9507[_0xaf95('0x37')]===_0xaf95('0x38')&&_0x4a9507[_0xaf95('0x39')]&&!_0x4a9507[_0xaf95('0x3a')]){_0xe6b3c4[_0x4a9507[_0xaf95('0x39')][_0xaf95('0x3b')]()]=_0x4a9507[_0xaf95('0x3c')]['toString']();}else if(_0x4a9507[_0xaf95('0x37')]===_0xaf95('0x38')&&_0x4a9507[_0xaf95('0x3d')]&&_0x4a9507['customField']){_0xe6b3c4[_0xaf95('0x3e')][_0xaf95('0x3f')]({'id':_0x4a9507[_0xaf95('0x3d')],'value':_0x4a9507['content'][_0xaf95('0x31')]()});}else if(_0x4a9507[_0xaf95('0x37')]===_0xaf95('0x40')&&_0x4a9507[_0xaf95('0x41')]&&_0x4a9507[_0xaf95('0x3d')]&&_0x4a9507[_0xaf95('0x3a')]){_0x311e48[_0x4a9507[_0xaf95('0x41')]]&&_0xe6b3c4[_0xaf95('0x3e')]['push']({'id':_0x4a9507[_0xaf95('0x3d')],'value':_0x311e48[_0x4a9507[_0xaf95('0x41')]][_0xaf95('0x31')]()});}else if(_0x4a9507[_0xaf95('0x37')]===_0xaf95('0x42')&&_0x4a9507[_0xaf95('0x43')]&&_0x4a9507[_0xaf95('0x43')][_0xaf95('0x11')]&&_0x4a9507[_0xaf95('0x3d')]&&_0x4a9507['customField']){_0x311e48[_0x4a9507[_0xaf95('0x43')][_0xaf95('0x11')][_0xaf95('0x3b')]()]&&_0xe6b3c4[_0xaf95('0x3e')][_0xaf95('0x3f')]({'id':_0x4a9507[_0xaf95('0x3d')],'value':_0x311e48[_0x4a9507['Variable'][_0xaf95('0x11')][_0xaf95('0x3b')]()][_0xaf95('0x31')]()});}});}return _0xe6b3c4;}exports[_0xaf95('0x44')]=function(_0x2fb303,_0x1fa24a,_0x54ef70,_0x4c533b,_0x31af21,_0x471c8f){var _0xbcf79,_0x25c35c;_0x471c8f[_0xaf95('0xe')]=intUtil[_0xaf95('0x45')](_0x471c8f[_0xaf95('0xe')]);_0x471c8f[_0xaf95('0x46')]=intUtil[_0xaf95('0x45')](_0x471c8f[_0xaf95('0x46')]);if(_0x31af21&&_0x31af21[_0xaf95('0x47')]){logger[_0xaf95('0xb')](_0xaf95('0x48'),'Recording\x20is\x20enabled!');_0x1fa24a['recordingURL']=util[_0xaf95('0xc')](_0xaf95('0x49'),_0x471c8f['serverUrl'],_0x1fa24a[_0xaf95('0x4a')],md5(_0x1fa24a['uniqueid']));}else{_0x1fa24a[_0xaf95('0x4b')]='';}headers['Authorization']=getAuth(_0x471c8f);return getUser(_0x471c8f,_0x4c533b['email'])[_0xaf95('0x1f')](function(_0x1a9e2f){_0xbcf79=_0x1a9e2f;logger[_0xaf95('0xb')](_0xaf95('0x4c'),_0xbcf79['id']);return getEndUser(_0x471c8f,_0x1fa24a[_0xaf95('0x4d')],_0x1fa24a[_0xaf95('0x4e')]);})['then'](function(_0x17d8ef){_0x25c35c=_0x17d8ef;logger[_0xaf95('0xb')](_0xaf95('0x4f'),_0x25c35c['id']);return getTicket(_0x471c8f,_0xbcf79,_0x25c35c,_0x54ef70,_0x1fa24a);})[_0xaf95('0x1f')](function(_0x3c2783){if(_0x3c2783){logger[_0xaf95('0xb')](_0xaf95('0x50'),_0x3c2783['id']);switch(_0x471c8f[_0xaf95('0x37')]){case'integrationTab':logger['info'](_0xaf95('0x48'),_0xaf95('0x51'));return request({'uri':util[_0xaf95('0xc')](_0xaf95('0x52'),_0x471c8f[_0xaf95('0xe')],_0xbcf79['id'],_0x3c2783['id']),'method':_0xaf95('0x53')});case _0xaf95('0x54'):logger['info'](_0xaf95('0x48'),_0xaf95('0x55'));emit(util[_0xaf95('0xc')](_0xaf95('0x56'),_0x4c533b['name']),_0xaf95('0x57'),{'uri':util[_0xaf95('0xc')](_0xaf95('0x58'),_0x471c8f[_0xaf95('0xe')],_0x3c2783['id'])});break;default:logger['error']('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xaf95('0x59')](function(_0x226ece){logger['error'](_0xaf95('0x5a'),util[_0xaf95('0x5b')](_0x226ece,{'showHidden':!![],'depth':null}));});};exports[_0xaf95('0x5c')]=function(_0x519f2d,_0x11b759,_0x211666,_0x5a3bc2,_0x526cfc,_0x3a57aa,_0x47f01b){var _0x3943f9,_0xeb49c7;_0x3a57aa[_0xaf95('0xe')]=intUtil[_0xaf95('0x45')](_0x3a57aa[_0xaf95('0xe')]);_0x3a57aa[_0xaf95('0x46')]=intUtil[_0xaf95('0x45')](_0x3a57aa[_0xaf95('0x46')]);if(_0x47f01b&&_0x47f01b[_0xaf95('0x5d')]&&_0x47f01b[_0xaf95('0x5d')]!==_0xaf95('0x5e')){logger[_0xaf95('0xb')](_0xaf95('0x5f'),_0xaf95('0x60'));_0x11b759[_0xaf95('0x4b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a57aa['serverUrl'],_0x11b759[_0xaf95('0x4a')],md5(_0x11b759['uniqueid']));}headers[_0xaf95('0x61')]=getAuth(_0x3a57aa);return getUser(_0x3a57aa,_0x5a3bc2[_0xaf95('0x62')])[_0xaf95('0x1f')](function(_0x4a7459){_0x3943f9=_0x4a7459;logger['info'](_0xaf95('0x4c'),_0x3943f9['id']);return getEndUser(_0x3a57aa,_0x11b759[_0xaf95('0x63')],_0x11b759[_0xaf95('0x64')]);})[_0xaf95('0x1f')](function(_0x7333a7){_0xeb49c7=_0x7333a7;logger['info'](_0xaf95('0x4f'),_0xeb49c7['id']);return getTicket(_0x3a57aa,_0x3943f9,_0xeb49c7,_0x211666,_0x11b759);})[_0xaf95('0x1f')](function(_0x2d11a2){if(_0x2d11a2){logger[_0xaf95('0xb')](_0xaf95('0x50'),_0x2d11a2['id']);switch(_0x3a57aa[_0xaf95('0x37')]){case _0xaf95('0x65'):logger[_0xaf95('0xb')](_0xaf95('0x5f'),_0xaf95('0x51'));return request({'uri':util[_0xaf95('0xc')](_0xaf95('0x52'),_0x3a57aa[_0xaf95('0xe')],_0x3943f9['id'],_0x2d11a2['id']),'method':_0xaf95('0x53')});case _0xaf95('0x54'):logger[_0xaf95('0xb')](_0xaf95('0x5f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xaf95('0xc')]('user:%s',_0x5a3bc2[_0xaf95('0x11')]),'trigger:browser:url',{'uri':util[_0xaf95('0xc')](_0xaf95('0x58'),_0x3a57aa['remoteUri'],_0x2d11a2['id'])});break;default:logger[_0xaf95('0x66')]('[OUTBOUND]',_0xaf95('0x67'));}}})[_0xaf95('0x59')](function(_0x274108){logger[_0xaf95('0x66')](_0xaf95('0x68'),util[_0xaf95('0x5b')](_0x274108,{'showHidden':!![],'depth':null}));});};exports[_0xaf95('0x69')]=function(_0x5d6f8e,_0x3e4d61,_0x33055c,_0x596532,_0x46329b,_0xa5c89c){var _0x49e8cc,_0xcfc987;_0xa5c89c[_0xaf95('0xe')]=intUtil[_0xaf95('0x45')](_0xa5c89c[_0xaf95('0xe')]);_0xa5c89c[_0xaf95('0x46')]=intUtil['stripTrailingSlash'](_0xa5c89c[_0xaf95('0x46')]);if(_0x46329b&&_0x46329b[_0xaf95('0x47')]){logger[_0xaf95('0xb')]('[ABANDONED]',_0xaf95('0x60'));_0x3e4d61[_0xaf95('0x4b')]=util[_0xaf95('0xc')](_0xaf95('0x49'),_0xa5c89c[_0xaf95('0x46')],_0x3e4d61['uniqueid'],md5(_0x3e4d61['uniqueid']));}else{_0x3e4d61['recordingURL']='';}headers['Authorization']=getAuth(_0xa5c89c);return getUser(_0xa5c89c)[_0xaf95('0x1f')](function(_0x48e156){_0x49e8cc=_0x48e156;logger[_0xaf95('0xb')]('The\x20User\x20ID\x20is:',_0x49e8cc['id']);return getEndUser(_0xa5c89c,_0x3e4d61['calleridname'],_0x3e4d61[_0xaf95('0x4e')]);})[_0xaf95('0x1f')](function(_0x2a7083){_0xcfc987=_0x2a7083;logger[_0xaf95('0xb')](_0xaf95('0x4f'),_0xcfc987['id']);return getTicket(_0xa5c89c,_0x49e8cc,_0xcfc987,_0x33055c,_0x3e4d61);})[_0xaf95('0x1f')](function(_0x12b26a){if(_0x12b26a){logger['info'](_0xaf95('0x50'),_0x12b26a['id']);}})['catch'](function(_0x20348c){logger[_0xaf95('0x66')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0xaf95('0x5b')](_0x20348c,{'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 8deaeb5..89cdc9d 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 _0x5ad3=['Subjects','getString','Fields','Call\x20Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','talktime','answertime','endtime','utc','diff','starttime','mm:ss','CONTACTID','LEADID','SEMODULE','SEID','','%s','encodeXML','','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','authToken','crmapi','then','parse','response','Error\x20on\x20call\x20creation:\x20','GET','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','users','user','Standard','Agent\x20found!','Using\x20the\x20admin\x20account!','find','Administrator','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','Searching\x20enduser\x20with\x20phone','host','((Phone:%s))','result','Contacts','row','length','content','https://crm.%s/crm/private/json/Leads/searchRecords','Leads','val','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','recorddetail','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','type','string','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','recordingFormat','none','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','[ABANDONED]','catch','lodash','request-promise','md5','util','xml2json','entities','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','application/json','info','Creating\x20new\x20call...','merge','inbound','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x229008,_0x41acde){var _0x53a0b7=function(_0x43cc35){while(--_0x43cc35){_0x229008['push'](_0x229008['shift']());}};_0x53a0b7(++_0x41acde);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x2967c1,_0x202a72){_0x2967c1=_0x2967c1-0x0;var _0x103397=_0x5ad3[_0x2967c1];return _0x103397;};'use strict';var _=require(_0x35ad('0x0'));var rp=require(_0x35ad('0x1'));var md5=require(_0x35ad('0x2'));var util=require(_0x35ad('0x3'));var intUtil=require('./util');var parser=require(_0x35ad('0x4'));var entities=require(_0x35ad('0x5'));var moment=require(_0x35ad('0x6'));var Redis=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var logger=require(_0x35ad('0x9'))(_0x35ad('0xa'));config[_0x35ad('0xb')]=_[_0x35ad('0xc')](config[_0x35ad('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x35ad('0xd'))(new Redis(config[_0x35ad('0xb')]));function emit(_0x3f1f55,_0x5400f3,_0x2498c1){io['to'](_0x3f1f55)['emit'](_0x5400f3,_0x2498c1);}var headers={'Content-Type':'application/json','Accept':_0x35ad('0xe')};function getCall(_0x3e9830,_0x4881d1,_0x34c2cb,_0x3a70a9,_0x4ad760,_0x4b31a1){logger[_0x35ad('0xf')](_0x35ad('0x10'));var _0x4cf6bd=_[_0x35ad('0x11')]({'SMOWNERID':_0x4881d1['id'],'Call Type':_0x4b31a1||_0x35ad('0x12'),'Call Start Time':(_0x4b31a1==='outbound'?_0x4ad760['starttime']:_0x4ad760[_0x35ad('0x13')])||moment()[_0x35ad('0x14')](_0x35ad('0x15')),'Subject':intUtil['getString'](_0x3a70a9[_0x35ad('0x16')],_0x4ad760,'\x20'),'Description':intUtil[_0x35ad('0x17')](_0x3a70a9['Descriptions'],_0x4ad760,'\x0a')},getCustomFields(_0x3a70a9[_0x35ad('0x18')],_0x4ad760));switch(_0x4ad760['lastevent']){case'called':_0x4cf6bd[_0x35ad('0x19')]=_0x35ad('0x1a');break;case _0x35ad('0x1b'):case'connect':_0x4cf6bd[_0x35ad('0x19')]=_0x35ad('0x1c');break;case _0x35ad('0x1d'):_0x4cf6bd[_0x35ad('0x19')]=_0x35ad('0x1e');break;case _0x35ad('0x1f'):_0x4cf6bd['Call\x20Result']=_0x35ad('0x20');break;default:}if(_0x4ad760[_0x35ad('0x21')]){_0x4cf6bd['Call\x20Duration']=moment['utc'](parseInt(_0x4ad760[_0x35ad('0x21')])*0x3e8)[_0x35ad('0x14')]('mm:ss');}else if(_0x4ad760[_0x35ad('0x22')]&&_0x4ad760[_0x35ad('0x23')]){_0x4cf6bd['Call\x20Duration']=moment[_0x35ad('0x24')](moment(_0x4ad760[_0x35ad('0x23')],_0x35ad('0x15'))[_0x35ad('0x25')](moment(_0x4ad760[_0x35ad('0x26')],_0x35ad('0x15'))))[_0x35ad('0x14')](_0x35ad('0x27'));}if(_0x34c2cb[_0x35ad('0x28')]){_0x4cf6bd[_0x35ad('0x28')]=_0x34c2cb['CONTACTID'];}else if(_0x34c2cb[_0x35ad('0x29')]){_0x4cf6bd[_0x35ad('0x2a')]='Leads';_0x4cf6bd[_0x35ad('0x2b')]=_0x34c2cb[_0x35ad('0x29')];}var _0xa3cb9f=_0x35ad('0x2c');for(var _0x368468 in _0x4cf6bd){if(_0x4cf6bd['hasOwnProperty'](_0x368468)){_0xa3cb9f+=util[_0x35ad('0x14')](_0x35ad('0x2d'),entities[_0x35ad('0x2e')](_0x368468),entities[_0x35ad('0x2e')](_0x4cf6bd[_0x368468]));}}_0xa3cb9f+=_0x35ad('0x2f');return request({'method':_0x35ad('0x30'),'uri':util[_0x35ad('0x14')](_0x35ad('0x31'),_0x3e9830['host']),'qs':{'authtoken':_0x3e9830[_0x35ad('0x32')],'scope':_0x35ad('0x33'),'xmlData':_0xa3cb9f},'json':!![]})[_0x35ad('0x34')](function(_0x34b8b9){_0x34b8b9=JSON[_0x35ad('0x35')](parser['toJson'](_0x34b8b9));if(_0x34b8b9['response']){if(_0x34b8b9[_0x35ad('0x36')]['result']&&_0x34b8b9[_0x35ad('0x36')]['result']['recorddetail']){logger['info']('Call\x20created!');return{'id':_0x34b8b9[_0x35ad('0x36')]['result']['recorddetail']['FL'][0x0]['$t']};}}throw new Error(_0x35ad('0x37')+JSON['stringify'](_0x34b8b9));});}function getUser(_0x3d5670,_0x51cf37){return request({'method':_0x35ad('0x38'),'uri':util['format'](_0x35ad('0x39'),_0x3d5670['host']),'qs':{'type':_0x35ad('0x3a'),'authtoken':_0x3d5670[_0x35ad('0x32')],'scope':_0x35ad('0x33')},'json':!![]})['then'](function(_0x2852e2){if(_0x2852e2[_0x35ad('0x3b')]&&_0x2852e2[_0x35ad('0x3b')][_0x35ad('0x3c')]){var _0x3cb239;if(_0x51cf37){_0x3cb239=_['find'](_0x2852e2['users'][_0x35ad('0x3c')],{'email':_0x51cf37,'profile':_0x35ad('0x3d')});}if(_0x3cb239){logger[_0x35ad('0xf')](_0x35ad('0x3e'));}else{logger['info'](_0x35ad('0x3f'));_0x3cb239=_[_0x35ad('0x40')](_0x2852e2[_0x35ad('0x3b')][_0x35ad('0x3c')],{'profile':_0x35ad('0x41')});}return _0x3cb239;}else{logger[_0x35ad('0x42')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x2852e2));throw new Error(_0x35ad('0x43')+JSON[_0x35ad('0x44')](_0x2852e2));}});}function getEndUser(_0x1d24bb,_0x448abf,_0x3c9f2e){logger[_0x35ad('0xf')](_0x35ad('0x45'),_0x3c9f2e);return request({'method':_0x35ad('0x38'),'uri':util[_0x35ad('0x14')]('https://crm.%s/crm/private/json/Contacts/searchRecords',_0x1d24bb[_0x35ad('0x46')]),'qs':{'authtoken':_0x1d24bb['authToken'],'scope':_0x35ad('0x33'),'criteria':util[_0x35ad('0x14')](_0x35ad('0x47'),_0x3c9f2e)},'json':!![]})[_0x35ad('0x34')](function(_0x1ad7e6){if(_0x1ad7e6[_0x35ad('0x36')]&&_0x1ad7e6[_0x35ad('0x36')][_0x35ad('0x48')]){logger[_0x35ad('0xf')]('Enduser\x20found\x20in\x20Contacts!');var _0x200e4d={};var _0x3eda4a=_0x1ad7e6[_0x35ad('0x36')]['result'][_0x35ad('0x49')][_0x35ad('0x4a')]['no']?_0x1ad7e6[_0x35ad('0x36')][_0x35ad('0x48')][_0x35ad('0x49')][_0x35ad('0x4a')]['FL']:_0x1ad7e6[_0x35ad('0x36')][_0x35ad('0x48')][_0x35ad('0x49')][_0x35ad('0x4a')][0x0]['FL'];for(var _0x21d730=0x0,_0x557bf4=_0x3eda4a[_0x35ad('0x4b')];_0x21d730<_0x557bf4;_0x21d730++){_0x200e4d[_0x3eda4a[_0x21d730]['val']]=_0x3eda4a[_0x21d730][_0x35ad('0x4c')];}return _0x200e4d;}else{return request({'method':_0x35ad('0x38'),'uri':util[_0x35ad('0x14')](_0x35ad('0x4d'),_0x1d24bb[_0x35ad('0x46')]),'qs':{'authtoken':_0x1d24bb[_0x35ad('0x32')],'scope':_0x35ad('0x33'),'criteria':util[_0x35ad('0x14')](_0x35ad('0x47'),_0x3c9f2e)},'json':!![]})['then'](function(_0xdf7e22){if(_0xdf7e22[_0x35ad('0x36')]&&_0xdf7e22[_0x35ad('0x36')][_0x35ad('0x48')]){logger[_0x35ad('0xf')]('Enduser\x20found\x20in\x20Leads!');var _0x331cd5={};var _0x2ac7f4=_0xdf7e22['response']['result'][_0x35ad('0x4e')][_0x35ad('0x4a')]['no']?_0xdf7e22[_0x35ad('0x36')][_0x35ad('0x48')]['Leads'][_0x35ad('0x4a')]['FL']:_0xdf7e22[_0x35ad('0x36')][_0x35ad('0x48')][_0x35ad('0x4e')][_0x35ad('0x4a')][0x0]['FL'];for(var _0x2cbbdc=0x0,_0x3ea556=_0x2ac7f4['length'];_0x2cbbdc<_0x3ea556;_0x2cbbdc++){_0x331cd5[_0x2ac7f4[_0x2cbbdc][_0x35ad('0x4f')]]=_0x2ac7f4[_0x2cbbdc][_0x35ad('0x4c')];}return _0x331cd5;}else{logger[_0x35ad('0xf')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x448abf=getName(_0x448abf);return request({'method':'POST','uri':util['format'](_0x35ad('0x50'),_0x1d24bb[_0x35ad('0x46')]),'qs':{'authtoken':_0x1d24bb[_0x35ad('0x32')],'scope':_0x35ad('0x33'),'xmlData':util['format'](_0x35ad('0x51'),entities[_0x35ad('0x2e')](_0x448abf[0x0]),entities[_0x35ad('0x2e')](_0x448abf[0x1]),_0x3c9f2e)},'json':!![]})[_0x35ad('0x34')](function(_0x43d1ab){_0x43d1ab=JSON[_0x35ad('0x35')](parser['toJson'](_0x43d1ab));if(_0x43d1ab['response']){if(_0x43d1ab[_0x35ad('0x36')][_0x35ad('0x48')]&&_0x43d1ab['response']['result'][_0x35ad('0x52')]){logger[_0x35ad('0xf')](_0x35ad('0x53'));return request({'method':'GET','uri':util['format'](_0x35ad('0x54'),_0x1d24bb[_0x35ad('0x46')]),'qs':{'authtoken':_0x1d24bb[_0x35ad('0x32')],'scope':'crmapi','id':_0x43d1ab[_0x35ad('0x36')][_0x35ad('0x48')][_0x35ad('0x52')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x35ad('0x55')+JSON[_0x35ad('0x44')](_0x43d1ab));})[_0x35ad('0x34')](function(_0x53a536){if(_0x53a536[_0x35ad('0x36')]){if(_0x53a536[_0x35ad('0x36')][_0x35ad('0x48')]){var _0x5773c6={};for(var _0x325b2a=0x0,_0x2e0f1f=_0x53a536[_0x35ad('0x36')][_0x35ad('0x48')]['Leads']['row']['FL'][_0x35ad('0x4b')];_0x325b2a<_0x2e0f1f;_0x325b2a++){_0x5773c6[_0x53a536[_0x35ad('0x36')][_0x35ad('0x48')][_0x35ad('0x4e')][_0x35ad('0x4a')]['FL'][_0x325b2a]['val']]=_0x53a536[_0x35ad('0x36')][_0x35ad('0x48')][_0x35ad('0x4e')][_0x35ad('0x4a')]['FL'][_0x325b2a][_0x35ad('0x4c')];}return _0x5773c6;}}throw new Error(_0x35ad('0x56')+JSON['stringify'](_0x53a536));});}});}});}function request(_0x579090){logger[_0x35ad('0x57')](_0x35ad('0x58'),JSON[_0x35ad('0x44')](_0x579090));return rp(_0x579090);}function getCustomFields(_0x30ebff,_0x1043cd){var _0x12774d={};if(_0x30ebff[_0x35ad('0x4b')]>0x0){_['forEach'](_0x30ebff,function(_0x1da9a7){if(_0x1da9a7[_0x35ad('0x59')]===_0x35ad('0x5a')&&_0x1da9a7[_0x35ad('0x5b')]){_0x12774d[_0x1da9a7['idField']]=_0x1da9a7[_0x35ad('0x4c')][_0x35ad('0x5c')]();}else if(_0x1da9a7['type']===_0x35ad('0x5d')&&_0x1da9a7[_0x35ad('0x5e')]&&_0x1da9a7[_0x35ad('0x5b')]&&_0x1043cd[_0x1da9a7[_0x35ad('0x5e')]]){_0x12774d[_0x1da9a7[_0x35ad('0x5b')]]=_0x1043cd[_0x1da9a7[_0x35ad('0x5e')]][_0x35ad('0x5c')]();}else if(_0x1da9a7[_0x35ad('0x59')]==='customVariable'&&_0x1da9a7[_0x35ad('0x5f')]&&_0x1da9a7[_0x35ad('0x5f')][_0x35ad('0x60')]&&_0x1da9a7['idField']&&_0x1043cd[_0x1da9a7[_0x35ad('0x5f')]['name'][_0x35ad('0x61')]()]){_0x12774d[_0x1da9a7[_0x35ad('0x5b')]]=_0x1043cd[_0x1da9a7[_0x35ad('0x5f')][_0x35ad('0x60')]['toLowerCase']()][_0x35ad('0x5c')]();}});}return _0x12774d;}function getName(_0x47420e){if(_0x47420e[_0x35ad('0x62')]('\x20')>0x0){var _0x148649=_0x47420e[_0x35ad('0x63')](/ (.+)/);if(_0x148649[0x1]){return _0x148649;}}return[_0x47420e,_0x47420e];}exports['queue']=function(_0x23d9e7,_0x50fe98,_0xd4766f,_0x43b372,_0x4951dc,_0x10cab4){var _0x5ab841,_0x80e87f;_0x10cab4[_0x35ad('0x46')]=intUtil['stripTrailingSlash'](_0x10cab4[_0x35ad('0x46')]);_0x10cab4[_0x35ad('0x64')]=intUtil[_0x35ad('0x65')](_0x10cab4[_0x35ad('0x64')]);if(_0x4951dc&&_0x4951dc[_0x35ad('0x66')]){logger[_0x35ad('0xf')](_0x35ad('0x67'),'Recording\x20is\x20enabled!');_0x50fe98[_0x35ad('0x68')]=util[_0x35ad('0x14')](_0x35ad('0x69'),_0x10cab4[_0x35ad('0x64')],_0x50fe98[_0x35ad('0x6a')],md5(_0x50fe98[_0x35ad('0x6a')]));}else{_0x50fe98[_0x35ad('0x68')]='';}return getUser(_0x10cab4,_0x43b372['email'])[_0x35ad('0x34')](function(_0x42c85b){_0x5ab841=_0x42c85b;logger[_0x35ad('0xf')](_0x35ad('0x6b'),_0x5ab841['id']);return getEndUser(_0x10cab4,_0x50fe98[_0x35ad('0x6c')],_0x50fe98['calleridnum']);})[_0x35ad('0x34')](function(_0x7c15a6){_0x80e87f=_0x7c15a6;logger['info'](_0x35ad('0x6d'),_0x80e87f[_0x35ad('0x28')]||_0x80e87f[_0x35ad('0x29')]);return getCall(_0x10cab4,_0x5ab841,_0x80e87f,_0xd4766f,_0x50fe98,_0x35ad('0x6e'));})['then'](function(_0x351f14){if(_0x351f14){logger['info'](_0x35ad('0x6f'),_0x351f14['id']);logger[_0x35ad('0xf')](_0x35ad('0x67'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x35ad('0x14')]('user:%s',_0x43b372[_0x35ad('0x60')]),'trigger:browser:url',{'uri':util['format'](_0x35ad('0x70'),_0x10cab4[_0x35ad('0x46')],_0x351f14['id'])});}})['catch'](function(_0x29337b){logger[_0x35ad('0x42')](_0x35ad('0x67'),JSON['stringify'](_0x29337b));});};exports['outbound']=function(_0x54d138,_0x54a89a,_0x3f98a2,_0x1a9fbf,_0x424d69,_0x35bcc0,_0x1dc9f0){var _0xfb488c,_0x4b6f5b;_0x35bcc0[_0x35ad('0x46')]=intUtil[_0x35ad('0x65')](_0x35bcc0['host']);_0x35bcc0[_0x35ad('0x64')]=intUtil[_0x35ad('0x65')](_0x35bcc0['serverUrl']);if(_0x1dc9f0&&_0x1dc9f0[_0x35ad('0x71')]&&_0x1dc9f0[_0x35ad('0x71')]!==_0x35ad('0x72')){logger[_0x35ad('0xf')]('[OUTBOUND]',_0x35ad('0x73'));_0x54a89a[_0x35ad('0x68')]=util[_0x35ad('0x14')](_0x35ad('0x69'),_0x35bcc0[_0x35ad('0x64')],_0x54a89a[_0x35ad('0x6a')],md5(_0x54a89a[_0x35ad('0x6a')]));}return getUser(_0x35bcc0,_0x1a9fbf[_0x35ad('0x74')])[_0x35ad('0x34')](function(_0x2bc48d){_0xfb488c=_0x2bc48d;logger['info']('The\x20User\x20ID\x20is:',_0xfb488c['id']);return getEndUser(_0x35bcc0,_0x54a89a[_0x35ad('0x75')],_0x54a89a[_0x35ad('0x76')]);})['then'](function(_0x41d174){_0x4b6f5b=_0x41d174;logger[_0x35ad('0xf')](_0x35ad('0x6d'),_0x4b6f5b[_0x35ad('0x28')]||_0x4b6f5b[_0x35ad('0x29')]);return getCall(_0x35bcc0,_0xfb488c,_0x4b6f5b,_0x3f98a2,_0x54a89a,_0x35ad('0x77'));})['then'](function(_0x62e5bf){if(_0x62e5bf){logger[_0x35ad('0xf')](_0x35ad('0x6f'),_0x62e5bf['id']);logger[_0x35ad('0xf')](_0x35ad('0x78'),_0x35ad('0x79'));emit(util[_0x35ad('0x14')](_0x35ad('0x7a'),_0x1a9fbf['name']),_0x35ad('0x7b'),{'uri':util[_0x35ad('0x14')](_0x35ad('0x70'),_0x35bcc0[_0x35ad('0x46')],_0x62e5bf['id'])});}})['catch'](function(_0x44d0ff){logger['error'](_0x35ad('0x78'),JSON['stringify'](_0x44d0ff));});};exports['abandoned']=function(_0x7b2480,_0x308daf,_0x1c7558,_0x5522d8,_0x3106bf,_0x52c478){var _0x4125ed,_0x1fd4d4;_0x52c478[_0x35ad('0x46')]=intUtil[_0x35ad('0x65')](_0x52c478['host']);_0x52c478[_0x35ad('0x64')]=intUtil['stripTrailingSlash'](_0x52c478[_0x35ad('0x64')]);if(_0x3106bf&&_0x3106bf['monitor_format']){logger[_0x35ad('0xf')](_0x35ad('0x7c'),'Recording\x20is\x20enabled!');_0x308daf['recordingURL']=util['format'](_0x35ad('0x69'),_0x52c478[_0x35ad('0x64')],_0x308daf[_0x35ad('0x6a')],md5(_0x308daf[_0x35ad('0x6a')]));}else{_0x308daf[_0x35ad('0x68')]='';}return getUser(_0x52c478)['then'](function(_0x518980){_0x4125ed=_0x518980;logger[_0x35ad('0xf')]('The\x20User\x20ID\x20is:',_0x4125ed['id']);return getEndUser(_0x52c478,_0x308daf[_0x35ad('0x6c')],_0x308daf['calleridnum']);})[_0x35ad('0x34')](function(_0x343eb4){_0x1fd4d4=_0x343eb4;logger[_0x35ad('0xf')](_0x35ad('0x6d'),_0x1fd4d4['CONTACTID']||_0x1fd4d4[_0x35ad('0x29')]);return getCall(_0x52c478,_0x4125ed,_0x1fd4d4,_0x1c7558,_0x308daf,_0x35ad('0x6e'));})[_0x35ad('0x34')](function(_0x3b7c41){if(_0x3b7c41){logger[_0x35ad('0xf')](_0x35ad('0x6f'),_0x3b7c41['id']);}})[_0x35ad('0x7d')](function(_0x2a2699){logger['error'](_0x35ad('0x7c'),JSON[_0x35ad('0x44')](_0x2a2699));});}; \ No newline at end of file +var _0xb458=['[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[ABANDONED]','Inbound','lodash','request-promise','md5','xml2json','entities','moment','ioredis','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20call...','merge','outbound','starttime','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Descriptions','Fields','lastevent','called','Call\x20Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','talktime','Call\x20Duration','mm:ss','answertime','endtime','utc','CONTACTID','LEADID','SEMODULE','hasOwnProperty','%s','encodeXML','','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','host','authToken','crmapi','then','parse','toJson','response','result','recorddetail','info','Call\x20created!','stringify','GET','users','user','find','Standard','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','content','Enduser\x20found\x20in\x20Leads!','Leads','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat'];(function(_0xcf8cfc,_0x20a2e3){var _0x4899ef=function(_0x77bd9){while(--_0x77bd9){_0xcf8cfc['push'](_0xcf8cfc['shift']());}};_0x4899ef(++_0x20a2e3);}(_0xb458,0x103));var _0x8b45=function(_0x3ed203,_0x4e3a3c){_0x3ed203=_0x3ed203-0x0;var _0x558502=_0xb458[_0x3ed203];return _0x558502;};'use strict';var _=require(_0x8b45('0x0'));var rp=require(_0x8b45('0x1'));var md5=require(_0x8b45('0x2'));var util=require('util');var intUtil=require('./util');var parser=require(_0x8b45('0x3'));var entities=require(_0x8b45('0x4'));var moment=require(_0x8b45('0x5'));var Redis=require(_0x8b45('0x6'));var config=require('../../../../config/environment');var logger=require(_0x8b45('0x7'))('zoho');config['redis']=_[_0x8b45('0x8')](config[_0x8b45('0x9')],{'host':_0x8b45('0xa'),'port':0x18eb});var io=require(_0x8b45('0xb'))(new Redis(config[_0x8b45('0x9')]));function emit(_0x4d1718,_0xa54725,_0x12bea8){io['to'](_0x4d1718)[_0x8b45('0xc')](_0xa54725,_0x12bea8);}var headers={'Content-Type':_0x8b45('0xd'),'Accept':_0x8b45('0xd')};function getCall(_0x499899,_0x2a4c83,_0x7cc49b,_0x57faf9,_0x5316af,_0x5bb708){logger['info'](_0x8b45('0xe'));var _0x285728=_[_0x8b45('0xf')]({'SMOWNERID':_0x2a4c83['id'],'Call Type':_0x5bb708||'inbound','Call Start Time':(_0x5bb708===_0x8b45('0x10')?_0x5316af[_0x8b45('0x11')]:_0x5316af[_0x8b45('0x12')])||moment()[_0x8b45('0x13')](_0x8b45('0x14')),'Subject':intUtil[_0x8b45('0x15')](_0x57faf9['Subjects'],_0x5316af,'\x20'),'Description':intUtil['getString'](_0x57faf9[_0x8b45('0x16')],_0x5316af,'\x0a')},getCustomFields(_0x57faf9[_0x8b45('0x17')],_0x5316af));switch(_0x5316af[_0x8b45('0x18')]){case _0x8b45('0x19'):_0x285728[_0x8b45('0x1a')]=_0x8b45('0x1b');break;case _0x8b45('0x1c'):case _0x8b45('0x1d'):_0x285728[_0x8b45('0x1a')]=_0x8b45('0x1e');break;case _0x8b45('0x1f'):_0x285728[_0x8b45('0x1a')]=_0x8b45('0x20');break;case _0x8b45('0x21'):_0x285728[_0x8b45('0x1a')]=_0x8b45('0x22');break;default:}if(_0x5316af[_0x8b45('0x23')]){_0x285728[_0x8b45('0x24')]=moment['utc'](parseInt(_0x5316af[_0x8b45('0x23')])*0x3e8)[_0x8b45('0x13')](_0x8b45('0x25'));}else if(_0x5316af[_0x8b45('0x26')]&&_0x5316af[_0x8b45('0x27')]){_0x285728[_0x8b45('0x24')]=moment[_0x8b45('0x28')](moment(_0x5316af[_0x8b45('0x27')],'YYYY-MM-DD\x20HH:mm:ss')['diff'](moment(_0x5316af[_0x8b45('0x11')],'YYYY-MM-DD\x20HH:mm:ss')))[_0x8b45('0x13')](_0x8b45('0x25'));}if(_0x7cc49b[_0x8b45('0x29')]){_0x285728[_0x8b45('0x29')]=_0x7cc49b[_0x8b45('0x29')];}else if(_0x7cc49b[_0x8b45('0x2a')]){_0x285728[_0x8b45('0x2b')]='Leads';_0x285728['SEID']=_0x7cc49b[_0x8b45('0x2a')];}var _0x2c2c06='';for(var _0x5723a2 in _0x285728){if(_0x285728[_0x8b45('0x2c')](_0x5723a2)){_0x2c2c06+=util[_0x8b45('0x13')](_0x8b45('0x2d'),entities[_0x8b45('0x2e')](_0x5723a2),entities['encodeXML'](_0x285728[_0x5723a2]));}}_0x2c2c06+=_0x8b45('0x2f');return request({'method':_0x8b45('0x30'),'uri':util[_0x8b45('0x13')](_0x8b45('0x31'),_0x499899[_0x8b45('0x32')]),'qs':{'authtoken':_0x499899[_0x8b45('0x33')],'scope':_0x8b45('0x34'),'xmlData':_0x2c2c06},'json':!![]})[_0x8b45('0x35')](function(_0x1733a7){_0x1733a7=JSON[_0x8b45('0x36')](parser[_0x8b45('0x37')](_0x1733a7));if(_0x1733a7[_0x8b45('0x38')]){if(_0x1733a7[_0x8b45('0x38')]['result']&&_0x1733a7[_0x8b45('0x38')][_0x8b45('0x39')][_0x8b45('0x3a')]){logger[_0x8b45('0x3b')](_0x8b45('0x3c'));return{'id':_0x1733a7[_0x8b45('0x38')][_0x8b45('0x39')][_0x8b45('0x3a')]['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON[_0x8b45('0x3d')](_0x1733a7));});}function getUser(_0x3a5889,_0x50302){return request({'method':_0x8b45('0x3e'),'uri':util[_0x8b45('0x13')]('https://crm.%s/crm/private/json/Users/getUsers',_0x3a5889[_0x8b45('0x32')]),'qs':{'type':'AllUsers','authtoken':_0x3a5889['authToken'],'scope':_0x8b45('0x34')},'json':!![]})[_0x8b45('0x35')](function(_0xd3ba91){if(_0xd3ba91[_0x8b45('0x3f')]&&_0xd3ba91[_0x8b45('0x3f')][_0x8b45('0x40')]){var _0x522628;if(_0x50302){_0x522628=_[_0x8b45('0x41')](_0xd3ba91[_0x8b45('0x3f')][_0x8b45('0x40')],{'email':_0x50302,'profile':_0x8b45('0x42')});}if(_0x522628){logger['info'](_0x8b45('0x43'));}else{logger[_0x8b45('0x3b')](_0x8b45('0x44'));_0x522628=_['find'](_0xd3ba91[_0x8b45('0x3f')][_0x8b45('0x40')],{'profile':_0x8b45('0x45')});}return _0x522628;}else{logger['error'](_0x8b45('0x46'),JSON[_0x8b45('0x3d')](_0xd3ba91));throw new Error(_0x8b45('0x47')+JSON[_0x8b45('0x3d')](_0xd3ba91));}});}function getEndUser(_0x58d94f,_0x14788c,_0x1077bd){logger[_0x8b45('0x3b')](_0x8b45('0x48'),_0x1077bd);return request({'method':_0x8b45('0x3e'),'uri':util[_0x8b45('0x13')]('https://crm.%s/crm/private/json/Contacts/searchRecords',_0x58d94f['host']),'qs':{'authtoken':_0x58d94f[_0x8b45('0x33')],'scope':_0x8b45('0x34'),'criteria':util[_0x8b45('0x13')](_0x8b45('0x49'),_0x1077bd)},'json':!![]})[_0x8b45('0x35')](function(_0x4c4dbc){if(_0x4c4dbc[_0x8b45('0x38')]&&_0x4c4dbc['response'][_0x8b45('0x39')]){logger[_0x8b45('0x3b')](_0x8b45('0x4a'));var _0x280bb0={};var _0x254f17=_0x4c4dbc[_0x8b45('0x38')][_0x8b45('0x39')][_0x8b45('0x4b')][_0x8b45('0x4c')]['no']?_0x4c4dbc[_0x8b45('0x38')][_0x8b45('0x39')]['Contacts'][_0x8b45('0x4c')]['FL']:_0x4c4dbc['response'][_0x8b45('0x39')]['Contacts'][_0x8b45('0x4c')][0x0]['FL'];for(var _0x224c45=0x0,_0x117f25=_0x254f17[_0x8b45('0x4d')];_0x224c45<_0x117f25;_0x224c45++){_0x280bb0[_0x254f17[_0x224c45][_0x8b45('0x4e')]]=_0x254f17[_0x224c45][_0x8b45('0x4f')];}return _0x280bb0;}else{return request({'method':'GET','uri':util[_0x8b45('0x13')]('https://crm.%s/crm/private/json/Leads/searchRecords',_0x58d94f['host']),'qs':{'authtoken':_0x58d94f[_0x8b45('0x33')],'scope':_0x8b45('0x34'),'criteria':util[_0x8b45('0x13')]('((Phone:%s))',_0x1077bd)},'json':!![]})[_0x8b45('0x35')](function(_0x56317d){if(_0x56317d[_0x8b45('0x38')]&&_0x56317d[_0x8b45('0x38')][_0x8b45('0x39')]){logger[_0x8b45('0x3b')](_0x8b45('0x50'));var _0x4da68f={};var _0x526c90=_0x56317d[_0x8b45('0x38')][_0x8b45('0x39')][_0x8b45('0x51')][_0x8b45('0x4c')]['no']?_0x56317d[_0x8b45('0x38')][_0x8b45('0x39')][_0x8b45('0x51')][_0x8b45('0x4c')]['FL']:_0x56317d[_0x8b45('0x38')][_0x8b45('0x39')][_0x8b45('0x51')][_0x8b45('0x4c')][0x0]['FL'];for(var _0x1a87e4=0x0,_0x2cf139=_0x526c90[_0x8b45('0x4d')];_0x1a87e4<_0x2cf139;_0x1a87e4++){_0x4da68f[_0x526c90[_0x1a87e4][_0x8b45('0x4e')]]=_0x526c90[_0x1a87e4]['content'];}return _0x4da68f;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x14788c=getName(_0x14788c);return request({'method':_0x8b45('0x30'),'uri':util[_0x8b45('0x13')](_0x8b45('0x52'),_0x58d94f[_0x8b45('0x32')]),'qs':{'authtoken':_0x58d94f[_0x8b45('0x33')],'scope':_0x8b45('0x34'),'xmlData':util[_0x8b45('0x13')](_0x8b45('0x53'),entities['encodeXML'](_0x14788c[0x0]),entities[_0x8b45('0x2e')](_0x14788c[0x1]),_0x1077bd)},'json':!![]})['then'](function(_0x23b5c6){_0x23b5c6=JSON[_0x8b45('0x36')](parser[_0x8b45('0x37')](_0x23b5c6));if(_0x23b5c6[_0x8b45('0x38')]){if(_0x23b5c6['response'][_0x8b45('0x39')]&&_0x23b5c6[_0x8b45('0x38')]['result'][_0x8b45('0x3a')]){logger[_0x8b45('0x3b')]('Enduser\x20created.');return request({'method':_0x8b45('0x3e'),'uri':util[_0x8b45('0x13')](_0x8b45('0x54'),_0x58d94f[_0x8b45('0x32')]),'qs':{'authtoken':_0x58d94f[_0x8b45('0x33')],'scope':_0x8b45('0x34'),'id':_0x23b5c6['response']['result'][_0x8b45('0x3a')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x8b45('0x55')+JSON[_0x8b45('0x3d')](_0x23b5c6));})['then'](function(_0x216bf1){if(_0x216bf1[_0x8b45('0x38')]){if(_0x216bf1[_0x8b45('0x38')][_0x8b45('0x39')]){var _0x2d6b66={};for(var _0x597402=0x0,_0x34c05d=_0x216bf1[_0x8b45('0x38')]['result'][_0x8b45('0x51')]['row']['FL'][_0x8b45('0x4d')];_0x597402<_0x34c05d;_0x597402++){_0x2d6b66[_0x216bf1[_0x8b45('0x38')][_0x8b45('0x39')][_0x8b45('0x51')]['row']['FL'][_0x597402][_0x8b45('0x4e')]]=_0x216bf1[_0x8b45('0x38')][_0x8b45('0x39')][_0x8b45('0x51')][_0x8b45('0x4c')]['FL'][_0x597402][_0x8b45('0x4f')];}return _0x2d6b66;}}throw new Error(_0x8b45('0x56')+JSON[_0x8b45('0x3d')](_0x216bf1));});}});}});}function request(_0x446fe5){logger[_0x8b45('0x57')](_0x8b45('0x58'),JSON[_0x8b45('0x3d')](_0x446fe5));return rp(_0x446fe5);}function getCustomFields(_0x1405f3,_0x2a01a2){var _0x1851c2={};if(_0x1405f3['length']>0x0){_[_0x8b45('0x59')](_0x1405f3,function(_0x1477bd){if(_0x1477bd[_0x8b45('0x5a')]==='string'&&_0x1477bd[_0x8b45('0x5b')]){_0x1851c2[_0x1477bd[_0x8b45('0x5b')]]=_0x1477bd[_0x8b45('0x4f')][_0x8b45('0x5c')]();}else if(_0x1477bd['type']===_0x8b45('0x5d')&&_0x1477bd[_0x8b45('0x5e')]&&_0x1477bd[_0x8b45('0x5b')]&&_0x2a01a2[_0x1477bd[_0x8b45('0x5e')]]){_0x1851c2[_0x1477bd['idField']]=_0x2a01a2[_0x1477bd[_0x8b45('0x5e')]][_0x8b45('0x5c')]();}else if(_0x1477bd[_0x8b45('0x5a')]===_0x8b45('0x5f')&&_0x1477bd[_0x8b45('0x60')]&&_0x1477bd['Variable'][_0x8b45('0x61')]&&_0x1477bd['idField']&&_0x2a01a2[_0x1477bd[_0x8b45('0x60')][_0x8b45('0x61')][_0x8b45('0x62')]()]){_0x1851c2[_0x1477bd[_0x8b45('0x5b')]]=_0x2a01a2[_0x1477bd[_0x8b45('0x60')][_0x8b45('0x61')]['toLowerCase']()]['toString']();}});}return _0x1851c2;}function getName(_0x5ace1){if(_0x5ace1[_0x8b45('0x63')]('\x20')>0x0){var _0x592d0c=_0x5ace1[_0x8b45('0x64')](/ (.+)/);if(_0x592d0c[0x1]){return _0x592d0c;}}return[_0x5ace1,_0x5ace1];}exports[_0x8b45('0x65')]=function(_0x3503cb,_0x555796,_0x4da2dd,_0x11b405,_0x8e5a41,_0x5abc79){var _0xcb5dff,_0x4a34ce;_0x5abc79[_0x8b45('0x32')]=intUtil['stripTrailingSlash'](_0x5abc79['host']);_0x5abc79[_0x8b45('0x66')]=intUtil[_0x8b45('0x67')](_0x5abc79['serverUrl']);if(_0x8e5a41&&_0x8e5a41[_0x8b45('0x68')]){logger[_0x8b45('0x3b')](_0x8b45('0x69'),_0x8b45('0x6a'));_0x555796[_0x8b45('0x6b')]=util['format'](_0x8b45('0x6c'),_0x5abc79[_0x8b45('0x66')],_0x555796[_0x8b45('0x6d')],md5(_0x555796['uniqueid']));}else{_0x555796['recordingURL']='';}return getUser(_0x5abc79,_0x11b405[_0x8b45('0x6e')])['then'](function(_0x43f031){_0xcb5dff=_0x43f031;logger['info']('The\x20User\x20ID\x20is:',_0xcb5dff['id']);return getEndUser(_0x5abc79,_0x555796['calleridname'],_0x555796[_0x8b45('0x6f')]);})['then'](function(_0x3c31e8){_0x4a34ce=_0x3c31e8;logger[_0x8b45('0x3b')]('The\x20Enduser\x20ID\x20is:',_0x4a34ce[_0x8b45('0x29')]||_0x4a34ce[_0x8b45('0x2a')]);return getCall(_0x5abc79,_0xcb5dff,_0x4a34ce,_0x4da2dd,_0x555796,'Inbound');})[_0x8b45('0x35')](function(_0x46b686){if(_0x46b686){logger[_0x8b45('0x3b')](_0x8b45('0x70'),_0x46b686['id']);logger[_0x8b45('0x3b')](_0x8b45('0x69'),_0x8b45('0x71'));emit(util[_0x8b45('0x13')](_0x8b45('0x72'),_0x11b405[_0x8b45('0x61')]),_0x8b45('0x73'),{'uri':util[_0x8b45('0x13')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x5abc79[_0x8b45('0x32')],_0x46b686['id'])});}})[_0x8b45('0x74')](function(_0x283eb6){logger[_0x8b45('0x75')](_0x8b45('0x69'),JSON[_0x8b45('0x3d')](_0x283eb6));});};exports[_0x8b45('0x10')]=function(_0x3d3216,_0x243632,_0x1542db,_0x183c34,_0x3cbe3a,_0x8b9259,_0x25c3b8){var _0x562c5f,_0x53143d;_0x8b9259[_0x8b45('0x32')]=intUtil[_0x8b45('0x67')](_0x8b9259[_0x8b45('0x32')]);_0x8b9259[_0x8b45('0x66')]=intUtil[_0x8b45('0x67')](_0x8b9259[_0x8b45('0x66')]);if(_0x25c3b8&&_0x25c3b8[_0x8b45('0x76')]&&_0x25c3b8[_0x8b45('0x76')]!=='none'){logger[_0x8b45('0x3b')](_0x8b45('0x77'),_0x8b45('0x6a'));_0x243632[_0x8b45('0x6b')]=util[_0x8b45('0x13')](_0x8b45('0x6c'),_0x8b9259[_0x8b45('0x66')],_0x243632[_0x8b45('0x6d')],md5(_0x243632[_0x8b45('0x6d')]));}return getUser(_0x8b9259,_0x183c34[_0x8b45('0x6e')])[_0x8b45('0x35')](function(_0x5e54c6){_0x562c5f=_0x5e54c6;logger['info'](_0x8b45('0x78'),_0x562c5f['id']);return getEndUser(_0x8b9259,_0x243632[_0x8b45('0x79')],_0x243632[_0x8b45('0x7a')]);})[_0x8b45('0x35')](function(_0x6a235a){_0x53143d=_0x6a235a;logger[_0x8b45('0x3b')](_0x8b45('0x7b'),_0x53143d[_0x8b45('0x29')]||_0x53143d[_0x8b45('0x2a')]);return getCall(_0x8b9259,_0x562c5f,_0x53143d,_0x1542db,_0x243632,'Outbound');})['then'](function(_0x135e1f){if(_0x135e1f){logger[_0x8b45('0x3b')](_0x8b45('0x70'),_0x135e1f['id']);logger[_0x8b45('0x3b')]('[OUTBOUND]',_0x8b45('0x71'));emit(util[_0x8b45('0x13')](_0x8b45('0x72'),_0x183c34[_0x8b45('0x61')]),_0x8b45('0x73'),{'uri':util[_0x8b45('0x13')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x8b9259['host'],_0x135e1f['id'])});}})[_0x8b45('0x74')](function(_0x5367ce){logger['error']('[OUTBOUND]',JSON[_0x8b45('0x3d')](_0x5367ce));});};exports[_0x8b45('0x21')]=function(_0xcc1330,_0x1e7a9c,_0x430551,_0x37ef4c,_0x274902,_0xc9be77){var _0xc89fc6,_0x286b2e;_0xc9be77[_0x8b45('0x32')]=intUtil[_0x8b45('0x67')](_0xc9be77[_0x8b45('0x32')]);_0xc9be77[_0x8b45('0x66')]=intUtil[_0x8b45('0x67')](_0xc9be77['serverUrl']);if(_0x274902&&_0x274902[_0x8b45('0x68')]){logger[_0x8b45('0x3b')](_0x8b45('0x7c'),_0x8b45('0x6a'));_0x1e7a9c[_0x8b45('0x6b')]=util[_0x8b45('0x13')](_0x8b45('0x6c'),_0xc9be77[_0x8b45('0x66')],_0x1e7a9c[_0x8b45('0x6d')],md5(_0x1e7a9c[_0x8b45('0x6d')]));}else{_0x1e7a9c['recordingURL']='';}return getUser(_0xc9be77)[_0x8b45('0x35')](function(_0x420fae){_0xc89fc6=_0x420fae;logger[_0x8b45('0x3b')](_0x8b45('0x78'),_0xc89fc6['id']);return getEndUser(_0xc9be77,_0x1e7a9c['calleridname'],_0x1e7a9c[_0x8b45('0x6f')]);})['then'](function(_0x34c7dd){_0x286b2e=_0x34c7dd;logger['info'](_0x8b45('0x7b'),_0x286b2e[_0x8b45('0x29')]||_0x286b2e[_0x8b45('0x2a')]);return getCall(_0xc9be77,_0xc89fc6,_0x286b2e,_0x430551,_0x1e7a9c,_0x8b45('0x7d'));})[_0x8b45('0x35')](function(_0x45beb9){if(_0x45beb9){logger['info'](_0x8b45('0x70'),_0x45beb9['id']);}})[_0x8b45('0x74')](function(_0x17364d){logger[_0x8b45('0x75')]('[ABANDONED]',JSON[_0x8b45('0x3d')](_0x17364d));});}; \ 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 27231ef..796495f 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 _0x64b8=['POST','body','data7','then','statusCode','catch','format','%s\x20%s\x20%s\x20[%s]:%s','name','message','request-promise','mustache','data1','toUpperCase','data2','GET'];(function(_0x5df4da,_0xc5fc92){var _0x3b2e01=function(_0x46aa49){while(--_0x46aa49){_0x5df4da['push'](_0x5df4da['shift']());}};_0x3b2e01(++_0xc5fc92);}(_0x64b8,0xda));var _0x864b=function(_0x384bc9,_0x339e2c){_0x384bc9=_0x384bc9-0x0;var _0x4df509=_0x64b8[_0x384bc9];return _0x4df509;};'use strict';var rp=require(_0x864b('0x0'));var util=require('util');var Mustache=require(_0x864b('0x1'));var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x4febbf,_0x5766cf){var _0x172396={'method':_0x4febbf[_0x864b('0x2')][_0x864b('0x3')](),'uri':encodeURI(Mustache['render'](_0x4febbf[_0x864b('0x4')],_0x5766cf)),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4febbf[_0x864b('0x2')][_0x864b('0x3')]()){case _0x864b('0x5'):_0x172396['qs']=_0x5766cf;break;case _0x864b('0x6'):_0x172396[_0x864b('0x7')]=_0x4febbf[_0x864b('0x8')]?Mustache['render'](_0x4febbf[_0x864b('0x8')],_0x5766cf):_0x5766cf;break;}rp(_0x172396)[_0x864b('0x9')](function(_0x202134){logger['info'](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s',_0x4febbf[_0x864b('0x2')],_0x4febbf[_0x864b('0x4')],_0x202134[_0x864b('0xa')],_0x202134[_0x864b('0x7')]));})[_0x864b('0xb')](function(_0x51fa3f){logger['error'](util[_0x864b('0xc')](_0x864b('0xd'),_0x4febbf[_0x864b('0x2')],_0x4febbf[_0x864b('0x4')],_0x51fa3f['statusCode'],_0x51fa3f[_0x864b('0xe')],_0x51fa3f[_0x864b('0xf')]));});}; \ No newline at end of file +var _0xa542=['message','util','trigger','exec','data1','render','toUpperCase','GET','POST','body','data7','info','format','catch','error','%s\x20%s\x20%s\x20[%s]:%s','data2','statusCode','name'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0xa542,0xf8));var _0x2a54=function(_0x306ae5,_0x17f5d1){_0x306ae5=_0x306ae5-0x0;var _0x2e09a0=_0xa542[_0x306ae5];return _0x2e09a0;};'use strict';var rp=require('request-promise');var util=require(_0x2a54('0x0'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x2a54('0x1'));exports[_0x2a54('0x2')]=function(_0x13b010,_0x311c2a){var _0x24bff6={'method':_0x13b010[_0x2a54('0x3')]['toUpperCase'](),'uri':encodeURI(Mustache[_0x2a54('0x4')](_0x13b010['data2'],_0x311c2a)),'json':!![],'resolveWithFullResponse':!![]};switch(_0x13b010[_0x2a54('0x3')][_0x2a54('0x5')]()){case _0x2a54('0x6'):_0x24bff6['qs']=_0x311c2a;break;case _0x2a54('0x7'):_0x24bff6[_0x2a54('0x8')]=_0x13b010[_0x2a54('0x9')]?Mustache[_0x2a54('0x4')](_0x13b010[_0x2a54('0x9')],_0x311c2a):_0x311c2a;break;}rp(_0x24bff6)['then'](function(_0x3fade7){logger[_0x2a54('0xa')](util[_0x2a54('0xb')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s',_0x13b010[_0x2a54('0x3')],_0x13b010['data2'],_0x3fade7['statusCode'],_0x3fade7[_0x2a54('0x8')]));})[_0x2a54('0xc')](function(_0x38dd14){logger[_0x2a54('0xd')](util[_0x2a54('0xb')](_0x2a54('0xe'),_0x13b010[_0x2a54('0x3')],_0x13b010[_0x2a54('0xf')],_0x38dd14[_0x2a54('0x10')],_0x38dd14[_0x2a54('0x11')],_0x38dd14[_0x2a54('0x12')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 4d5d084..6fe8ff9 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 _0xf873=['http','Request','request','then','rpc','error','message','result','catch','exports','bluebird','../../config/logger','routing','client'];(function(_0x5710c9,_0x44780c){var _0x5dd2d5=function(_0x51213d){while(--_0x51213d){_0x5710c9['push'](_0x5710c9['shift']());}};_0x5dd2d5(++_0x44780c);}(_0xf873,0xb2));var _0x3f87=function(_0x5b14a9,_0x286a96){_0x5b14a9=_0x5b14a9-0x0;var _0x2874ce=_0xf873[_0x5b14a9];return _0x2874ce;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x3f87('0x0'));var logger=require(_0x3f87('0x1'))(_0x3f87('0x2'));var client=jayson[_0x3f87('0x3')][_0x3f87('0x4')]({'port':0x2329});client[_0x3f87('0x5')]=function(_0x2fbb4f,_0x1d68dd){return new BPromise(function(_0x3c80d6,_0x4a909e){return client[_0x3f87('0x6')](_0x2fbb4f,_0x1d68dd)[_0x3f87('0x7')](function(_0x27c03e){logger['debug'](_0x3f87('0x8'),_0x3f87('0x2'),_0x2fbb4f,_0x1d68dd,_0x27c03e);if(_0x27c03e[_0x3f87('0x9')]){logger[_0x3f87('0x9')](_0x3f87('0x8'),_0x3f87('0x2'),_0x2fbb4f,_0x27c03e['error'][_0x3f87('0xa')],_0x1d68dd);return _0x4a909e(_0x27c03e[_0x3f87('0x9')][_0x3f87('0xa')]);}else{return _0x3c80d6(_0x27c03e[_0x3f87('0xb')]);}})[_0x3f87('0xc')](function(_0xd41ca0){logger[_0x3f87('0x9')](_0x3f87('0x8'),_0x3f87('0x2'),_0x2fbb4f,_0xd41ca0,_0x1d68dd);return _0x4a909e(_0xd41ca0);});});};module[_0x3f87('0xd')]=client; \ No newline at end of file +var _0xf452=['error','message','exports','jayson/promise','bluebird','routing','client','http','Request','request','then','debug','rpc'];(function(_0x21cfb3,_0x5295f4){var _0x5327c5=function(_0x4951d8){while(--_0x4951d8){_0x21cfb3['push'](_0x21cfb3['shift']());}};_0x5327c5(++_0x5295f4);}(_0xf452,0x13b));var _0x2f45=function(_0x2b5821,_0x4c04ce){_0x2b5821=_0x2b5821-0x0;var _0x4c877b=_0xf452[_0x2b5821];return _0x4c877b;};'use strict';var jayson=require(_0x2f45('0x0'));var BPromise=require(_0x2f45('0x1'));var logger=require('../../config/logger')(_0x2f45('0x2'));var client=jayson[_0x2f45('0x3')][_0x2f45('0x4')]({'port':0x2329});client[_0x2f45('0x5')]=function(_0x602b00,_0x3f0b30){return new BPromise(function(_0x24c61d,_0xb2de8a){return client[_0x2f45('0x6')](_0x602b00,_0x3f0b30)[_0x2f45('0x7')](function(_0x1a53cf){logger[_0x2f45('0x8')](_0x2f45('0x9'),_0x2f45('0x2'),_0x602b00,_0x3f0b30,_0x1a53cf);if(_0x1a53cf[_0x2f45('0xa')]){logger[_0x2f45('0xa')](_0x2f45('0x9'),_0x2f45('0x2'),_0x602b00,_0x1a53cf[_0x2f45('0xa')][_0x2f45('0xb')],_0x3f0b30);return _0xb2de8a(_0x1a53cf[_0x2f45('0xa')][_0x2f45('0xb')]);}else{return _0x24c61d(_0x1a53cf['result']);}})['catch'](function(_0x1dc74f){logger[_0x2f45('0xa')](_0x2f45('0x9'),_0x2f45('0x2'),_0x602b00,_0x1dc74f,_0x3f0b30);return _0xb2de8a(_0x1dc74f);});});};module[_0x2f45('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index f17212d..fef2b0b 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 _0x601e=['./lib/email','./rpc/mailAccount','then','getMailAccounts','initMailAccounts','refresh','listen','log','bluebird','./server','./realtime'];(function(_0x3ce42c,_0x108445){var _0x3cf610=function(_0x44b5ed){while(--_0x44b5ed){_0x3ce42c['push'](_0x3ce42c['shift']());}};_0x3cf610(++_0x108445);}(_0x601e,0x1cb));var _0xe601=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x601e[_0xbca1b1];return _0x4e1686;};'use strict';var BPromise=require(_0xe601('0x0'));var server=require(_0xe601('0x1'));var Realtime=require(_0xe601('0x2'));var EmailChannel=require(_0xe601('0x3'));var mailAccount=require(_0xe601('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0xe601('0x5')](mailAccount[_0xe601('0x6')]())[_0xe601('0x5')](realtime[_0xe601('0x7')]())[_0xe601('0x5')](function(){email[_0xe601('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xe601('0x9')](realtime,email)[_0xe601('0x5')](function(_0x26eb77){return initRealtime();})[_0xe601('0x5')](function(_0x46ab96){return setInterval(initRealtime,0x2710);})['catch'](function(_0x1de477){console[_0xe601('0xa')](_0x1de477);});}main(); \ No newline at end of file +var _0xaca2=['./realtime','./lib/email','./rpc/mailAccount','getMailAccounts','then','initMailAccounts','mailAccounts','log','bluebird'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xaca2,0x11f));var _0x2aca=function(_0x514299,_0x44a553){_0x514299=_0x514299-0x0;var _0x453188=_0xaca2[_0x514299];return _0x453188;};'use strict';var BPromise=require(_0x2aca('0x0'));var server=require('./server');var Realtime=require(_0x2aca('0x1'));var EmailChannel=require(_0x2aca('0x2'));var mailAccount=require(_0x2aca('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()['then'](mailAccount[_0x2aca('0x4')]())[_0x2aca('0x5')](realtime[_0x2aca('0x6')]())[_0x2aca('0x5')](function(){email['refresh'](realtime[_0x2aca('0x7')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x2aca('0x5')](function(_0xe7b8df){return initRealtime();})[_0x2aca('0x5')](function(_0x1d50cf){return setInterval(initRealtime,0x2710);})['catch'](function(_0x5b8e3f){console[_0x2aca('0x8')](_0x5b8e3f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 2168bda..4ed4929 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 _0x0af5=['end','handleImapEnd','error','handleImapError','isNil','emit','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verified','verify','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','prototype','key','active','Imap','status','messageStatus','refresh','hasOwnProperty','imapAccounts','handleImapBox','bind'];(function(_0x45c262,_0x2e3ce5){var _0x4f2ba6=function(_0x4912d1){while(--_0x4912d1){_0x45c262['push'](_0x45c262['shift']());}};_0x4f2ba6(++_0x2e3ce5);}(_0x0af5,0x158));var _0x50af=function(_0x1f0082,_0x1fdc1d){_0x1f0082=_0x1f0082-0x0;var _0x55ecf9=_0x0af5[_0x1f0082];return _0x55ecf9;};'use strict';var _=require('lodash');var moment=require(_0x50af('0x0'));var BPromise=require(_0x50af('0x1'));var md5=require(_0x50af('0x2'));var Redis=require(_0x50af('0x3'));var config=require(_0x50af('0x4'));var logger=require(_0x50af('0x5'))(_0x50af('0x6'));config[_0x50af('0x7')]=_[_0x50af('0x8')](config[_0x50af('0x7')],{'host':_0x50af('0x9'),'port':0x18eb});var io=require(_0x50af('0xa'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0x50af('0xb'));var mailAccount=require(_0x50af('0xc'));var md5Accounts={};function EmailChannel(_0x4dc2b9){logger['info'](_0x50af('0xd'));this[_0x50af('0xe')]=_0x4dc2b9['mailAccounts'];this['imapAccounts']={};this[_0x50af('0xf')]=new EmailSmtp();}EmailChannel[_0x50af('0x10')]['emit']=function(_0x3ccbee){var _0x28a92c=this[_0x50af('0xe')][_0x3ccbee];var _0x3a4c2f={'id':_0x28a92c['id'],'name':_0x28a92c['name'],'key':_0x28a92c[_0x50af('0x11')],'active':_0x28a92c[_0x50af('0x12')],'Imap':{'status':_0x28a92c[_0x50af('0x13')][_0x50af('0x14')],'messageStatus':_0x28a92c[_0x50af('0x13')][_0x50af('0x15')],'total':_0x28a92c['Imap']['total']}};if(_['isNil'](md5Accounts[_0x3ccbee])){md5Accounts[_0x3ccbee]={};}var _0x620389=md5(JSON['stringify'](_0x3a4c2f));if(md5Accounts[_0x3ccbee][_0x50af('0x2')]!==_0x620389){md5Accounts[_0x3ccbee][_0x50af('0x2')]=_0x620389;io['emit']('mailAccount:update',_0x3a4c2f);}};EmailChannel[_0x50af('0x10')][_0x50af('0x16')]=function(_0x4a3106){for(var _0x4b0775 in _0x4a3106){if(_0x4a3106[_0x50af('0x17')](_0x4b0775)){if(_0x4a3106[_0x4b0775][_0x50af('0x13')]&&_0x4a3106[_0x4b0775][_0x50af('0x12')]){var _0x30e2ec=_0x4a3106[_0x4b0775][_0x50af('0x13')];if(!this[_0x50af('0x18')][_0x50af('0x17')](_0x30e2ec['id'])){this[_0x50af('0x18')][_0x30e2ec['id']]=new EmailImap(_0x30e2ec,_0x4a3106[_0x4b0775][_0x50af('0x6')]);this[_0x50af('0x18')][_0x30e2ec['id']]['on']('box',this[_0x50af('0x19')][_0x50af('0x1a')](this,_0x4b0775));this[_0x50af('0x18')][_0x30e2ec['id']]['on'](_0x50af('0x6'),this['handleImapEmail'][_0x50af('0x1a')](this,_0x4b0775));this[_0x50af('0x18')][_0x30e2ec['id']]['on'](_0x50af('0x1b'),this[_0x50af('0x1c')][_0x50af('0x1a')](this,_0x4b0775));this[_0x50af('0x18')][_0x30e2ec['id']]['on'](_0x50af('0x1d'),this[_0x50af('0x1e')][_0x50af('0x1a')](this,_0x4b0775));}}else{if(_[_0x50af('0x1f')](this['mailAccounts'][_0x4b0775][_0x50af('0x13')])){this[_0x50af('0xe')][_0x4b0775][_0x50af('0x13')]={};}this[_0x50af('0xe')][_0x4b0775][_0x50af('0x13')][_0x50af('0x14')]='disabled';this[_0x50af('0xe')][_0x4b0775][_0x50af('0x13')]['messageStatus']='';this[_0x50af('0x20')](_0x4b0775);}}}};EmailChannel[_0x50af('0x10')][_0x50af('0x19')]=function(_0x5dc58a,_0x53af9d){if(this[_0x50af('0xe')][_0x5dc58a]){this[_0x50af('0xe')][_0x5dc58a][_0x50af('0x13')][_0x50af('0x14')]=_0x50af('0x21');this[_0x50af('0xe')][_0x5dc58a][_0x50af('0x13')][_0x50af('0x15')]=_0x53af9d['name'];if(_0x53af9d[_0x50af('0x22')]){this[_0x50af('0xe')][_0x5dc58a][_0x50af('0x13')]['total']=_0x53af9d[_0x50af('0x22')]['total'];}return this[_0x50af('0x20')](_0x5dc58a);}};EmailChannel['prototype']['handleImapEmail']=function(_0x52ce35,_0x27b476){logger[_0x50af('0x23')](_0x50af('0x24'),_0x27b476[_0x50af('0x25')],_0x27b476[_0x50af('0x26')],_0x27b476[_0x50af('0x27')],_0x52ce35);if(this[_0x50af('0xe')][_0x52ce35]){return mailAccount[_0x50af('0x28')](_0x52ce35,_0x27b476)[_0x50af('0x29')](function(_0x27435d){if(_0x27435d){logger['info'](_0x50af('0x2a'));}})[_0x50af('0x2b')](function(_0x30988a){logger[_0x50af('0x1d')](_0x50af('0x2c'),JSON['stringify'](_0x30988a));});}};EmailChannel[_0x50af('0x10')]['handleImapEnd']=function(_0x5ac19f){if(this['mailAccounts'][_0x5ac19f]&&this[_0x50af('0xe')][_0x5ac19f][_0x50af('0x13')]){if(this[_0x50af('0x18')][this[_0x50af('0xe')][_0x5ac19f][_0x50af('0x13')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x5ac19f][_0x50af('0x13')]['id']];}this[_0x50af('0xe')][_0x5ac19f][_0x50af('0x13')][_0x50af('0x2d')]=moment();this[_0x50af('0x20')](_0x5ac19f);}};EmailChannel['prototype'][_0x50af('0x1e')]=function(_0x398dcf,_0x10cf90){if(this[_0x50af('0xe')][_0x398dcf]){this['mailAccounts'][_0x398dcf][_0x50af('0x13')][_0x50af('0x14')]=_0x50af('0x1d');this[_0x50af('0xe')][_0x398dcf][_0x50af('0x13')]['messageStatus']=_0x10cf90;return this['emit'](_0x398dcf);}};EmailChannel['prototype'][_0x50af('0x2e')]=function(_0x35d38f,_0x366f6b){return this[_0x50af('0xf')][_0x50af('0x2f')](_0x35d38f,_0x366f6b);};EmailChannel[_0x50af('0x10')][_0x50af('0x30')]=function(_0x1b094e){var _0x394352=this;if(this[_0x50af('0xe')][_0x1b094e['id']]){if(_[_0x50af('0x1f')](this[_0x50af('0xe')][_0x1b094e['id']][_0x50af('0x31')])){this[_0x50af('0xe')][_0x1b094e['id']][_0x50af('0x31')]={};}this[_0x50af('0xe')][_0x1b094e['id']]['Smtp'][_0x50af('0x2d')]=moment();return new BPromise(function(_0x2740fd,_0x1c5b54){return _0x394352['smtp']['verify'](_0x1b094e)[_0x50af('0x29')](function(_0x38182e){_0x394352[_0x50af('0xe')][_0x1b094e['id']][_0x50af('0x31')][_0x50af('0x14')]=_0x50af('0x32');_0x394352[_0x50af('0xe')][_0x1b094e['id']][_0x50af('0x31')]['messageStatus']='';_0x394352['emit'](_0x1b094e['id']);_0x2740fd(_0x38182e);})[_0x50af('0x2b')](function(_0x2d0750){_0x394352['mailAccounts'][_0x1b094e['id']]['Smtp'][_0x50af('0x14')]=_0x50af('0x1d');_0x394352[_0x50af('0xe')][_0x1b094e['id']]['Smtp'][_0x50af('0x15')]=_0x2d0750;_0x394352[_0x50af('0x20')](_0x1b094e['id']);_0x1c5b54(_0x2d0750);});});}return this[_0x50af('0xf')][_0x50af('0x33')](_0x1b094e);};module[_0x50af('0x34')]=EmailChannel; \ No newline at end of file +var _0x524e=['sendMail','send','verifySmtp','Smtp','verify','verified','exports','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','isNil','stringify','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','status','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','catch','lastSync'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x524e,0x15e));var _0xe524=function(_0xefa016,_0xf36638){_0xefa016=_0xefa016-0x0;var _0x1726b1=_0x524e[_0xefa016];return _0x1726b1;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xe524('0x0'));var md5=require(_0xe524('0x1'));var Redis=require(_0xe524('0x2'));var config=require(_0xe524('0x3'));var logger=require(_0xe524('0x4'))(_0xe524('0x5'));config[_0xe524('0x6')]=_[_0xe524('0x7')](config[_0xe524('0x6')],{'host':_0xe524('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe524('0x6')]));var EmailImap=require(_0xe524('0x9'));var EmailSmtp=require(_0xe524('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x384935){logger[_0xe524('0xb')](_0xe524('0xc'));this[_0xe524('0xd')]=_0x384935[_0xe524('0xd')];this[_0xe524('0xe')]={};this[_0xe524('0xf')]=new EmailSmtp();}EmailChannel[_0xe524('0x10')][_0xe524('0x11')]=function(_0x1641ec){var _0x1e4459=this[_0xe524('0xd')][_0x1641ec];var _0x1184df={'id':_0x1e4459['id'],'name':_0x1e4459[_0xe524('0x12')],'key':_0x1e4459[_0xe524('0x13')],'active':_0x1e4459[_0xe524('0x14')],'Imap':{'status':_0x1e4459['Imap']['status'],'messageStatus':_0x1e4459[_0xe524('0x15')][_0xe524('0x16')],'total':_0x1e4459[_0xe524('0x15')][_0xe524('0x17')]}};if(_[_0xe524('0x18')](md5Accounts[_0x1641ec])){md5Accounts[_0x1641ec]={};}var _0x57c1b6=md5(JSON[_0xe524('0x19')](_0x1184df));if(md5Accounts[_0x1641ec]['md5']!==_0x57c1b6){md5Accounts[_0x1641ec][_0xe524('0x1')]=_0x57c1b6;io[_0xe524('0x11')]('mailAccount:update',_0x1184df);}};EmailChannel[_0xe524('0x10')]['refresh']=function(_0x109795){for(var _0x538754 in _0x109795){if(_0x109795[_0xe524('0x1a')](_0x538754)){if(_0x109795[_0x538754]['Imap']&&_0x109795[_0x538754]['active']){var _0x5a5c0d=_0x109795[_0x538754][_0xe524('0x15')];if(!this['imapAccounts'][_0xe524('0x1a')](_0x5a5c0d['id'])){this[_0xe524('0xe')][_0x5a5c0d['id']]=new EmailImap(_0x5a5c0d,_0x109795[_0x538754][_0xe524('0x5')]);this[_0xe524('0xe')][_0x5a5c0d['id']]['on']('box',this[_0xe524('0x1b')][_0xe524('0x1c')](this,_0x538754));this['imapAccounts'][_0x5a5c0d['id']]['on'](_0xe524('0x5'),this[_0xe524('0x1d')][_0xe524('0x1c')](this,_0x538754));this[_0xe524('0xe')][_0x5a5c0d['id']]['on'](_0xe524('0x1e'),this[_0xe524('0x1f')][_0xe524('0x1c')](this,_0x538754));this[_0xe524('0xe')][_0x5a5c0d['id']]['on'](_0xe524('0x20'),this['handleImapError'][_0xe524('0x1c')](this,_0x538754));}}else{if(_['isNil'](this['mailAccounts'][_0x538754][_0xe524('0x15')])){this[_0xe524('0xd')][_0x538754][_0xe524('0x15')]={};}this[_0xe524('0xd')][_0x538754]['Imap'][_0xe524('0x21')]='disabled';this[_0xe524('0xd')][_0x538754][_0xe524('0x15')][_0xe524('0x16')]='';this[_0xe524('0x11')](_0x538754);}}}};EmailChannel[_0xe524('0x10')][_0xe524('0x1b')]=function(_0x2141db,_0x583cc3){if(this['mailAccounts'][_0x2141db]){this[_0xe524('0xd')][_0x2141db][_0xe524('0x15')][_0xe524('0x21')]=_0xe524('0x22');this[_0xe524('0xd')][_0x2141db]['Imap']['messageStatus']=_0x583cc3[_0xe524('0x12')];if(_0x583cc3[_0xe524('0x23')]){this[_0xe524('0xd')][_0x2141db][_0xe524('0x15')][_0xe524('0x17')]=_0x583cc3['messages'][_0xe524('0x17')];}return this[_0xe524('0x11')](_0x2141db);}};EmailChannel['prototype']['handleImapEmail']=function(_0x20688e,_0x376324){logger['info'](_0xe524('0x24'),_0x376324['firstName'],_0x376324[_0xe524('0x25')],_0x376324['from'],_0x20688e);if(this[_0xe524('0xd')][_0x20688e]){return mailAccount[_0xe524('0x26')](_0x20688e,_0x376324)[_0xe524('0x27')](function(_0x5600d2){if(_0x5600d2){logger[_0xe524('0xb')]('Mail\x20accepted\x20from\x20routing');}})[_0xe524('0x28')](function(_0x16eff9){logger[_0xe524('0x20')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xe524('0x19')](_0x16eff9));});}};EmailChannel[_0xe524('0x10')]['handleImapEnd']=function(_0x27817e){if(this[_0xe524('0xd')][_0x27817e]&&this[_0xe524('0xd')][_0x27817e][_0xe524('0x15')]){if(this['imapAccounts'][this[_0xe524('0xd')][_0x27817e][_0xe524('0x15')]['id']]){delete this[_0xe524('0xe')][this[_0xe524('0xd')][_0x27817e][_0xe524('0x15')]['id']];}this[_0xe524('0xd')][_0x27817e][_0xe524('0x15')][_0xe524('0x29')]=moment();this['emit'](_0x27817e);}};EmailChannel[_0xe524('0x10')]['handleImapError']=function(_0x1d463b,_0x53eeee){if(this['mailAccounts'][_0x1d463b]){this[_0xe524('0xd')][_0x1d463b]['Imap'][_0xe524('0x21')]=_0xe524('0x20');this[_0xe524('0xd')][_0x1d463b][_0xe524('0x15')][_0xe524('0x16')]=_0x53eeee;return this[_0xe524('0x11')](_0x1d463b);}};EmailChannel[_0xe524('0x10')][_0xe524('0x2a')]=function(_0x5e8e64,_0x311aec){return this[_0xe524('0xf')][_0xe524('0x2b')](_0x5e8e64,_0x311aec);};EmailChannel[_0xe524('0x10')][_0xe524('0x2c')]=function(_0x3885f6){var _0x1d9648=this;if(this[_0xe524('0xd')][_0x3885f6['id']]){if(_['isNil'](this[_0xe524('0xd')][_0x3885f6['id']][_0xe524('0x2d')])){this[_0xe524('0xd')][_0x3885f6['id']]['Smtp']={};}this[_0xe524('0xd')][_0x3885f6['id']]['Smtp'][_0xe524('0x29')]=moment();return new BPromise(function(_0x217e85,_0x43c314){return _0x1d9648[_0xe524('0xf')][_0xe524('0x2e')](_0x3885f6)[_0xe524('0x27')](function(_0xbeb2a9){_0x1d9648['mailAccounts'][_0x3885f6['id']][_0xe524('0x2d')][_0xe524('0x21')]=_0xe524('0x2f');_0x1d9648[_0xe524('0xd')][_0x3885f6['id']][_0xe524('0x2d')][_0xe524('0x16')]='';_0x1d9648['emit'](_0x3885f6['id']);_0x217e85(_0xbeb2a9);})[_0xe524('0x28')](function(_0x2982a0){_0x1d9648[_0xe524('0xd')][_0x3885f6['id']]['Smtp'][_0xe524('0x21')]='error';_0x1d9648['mailAccounts'][_0x3885f6['id']][_0xe524('0x2d')][_0xe524('0x16')]=_0x2982a0;_0x1d9648['emit'](_0x3885f6['id']);_0x43c314(_0x2982a0);});});}return this[_0xe524('0xf')][_0xe524('0x2e')](_0x3885f6);};module[_0xe524('0x30')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 60a69ea..ec84cd5 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 _0x83f0=['bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','user','password','host','tls','autotls','getHost','port','anonymous@xcally.com','handleOpenBox','emit','box','readUnseen','handleCloseBox','end','UNSEEN','length','fetch','message','handleFetchMessage','handleFetchError','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','closeBox','handleEnd','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','randomstring','simpleParser','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once'];(function(_0x2b0a86,_0x2ecebd){var _0x955940=function(_0x1988f8){while(--_0x1988f8){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x955940(++_0x2ecebd);}(_0x83f0,0x114));var _0x083f=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x83f0[_0x465a0c];return _0x1e202e;};'use strict';var fs=require('fs');var path=require(_0x083f('0x0'));var util=require(_0x083f('0x1'));var Imap=require(_0x083f('0x2'));var _=require('lodash');var rs=require(_0x083f('0x3'));var simpleParser=require('mailparser')[_0x083f('0x4')];var EventEmitter=require('events')[_0x083f('0x5')];var utils=require(_0x083f('0x6'));var logger=require(_0x083f('0x7'))(_0x083f('0x8'));function EmailImap(_0x59fb96,_0x205ea0){this[_0x083f('0x9')]=_0x083f('0xa');this[_0x083f('0xb')]=this[_0x083f('0xc')](_0x59fb96,_0x205ea0);this['imap']=new Imap(this[_0x083f('0xb')]);this[_0x083f('0x2')][_0x083f('0xd')]('ready',this['handleReady'][_0x083f('0xe')](this));this[_0x083f('0x2')][_0x083f('0xd')]('end',this['handleEnd'][_0x083f('0xe')](this));this[_0x083f('0x2')]['on'](_0x083f('0xf'),this[_0x083f('0x10')][_0x083f('0xe')](this));this[_0x083f('0x2')][_0x083f('0x11')]();}util[_0x083f('0x12')](EmailImap,EventEmitter);EmailImap[_0x083f('0x13')][_0x083f('0xc')]=function(_0x18a94d,_0x1ce714){var _0x441fc8={'connTimeout':_0x18a94d[_0x083f('0x14')]?_0x18a94d[_0x083f('0x14')]*0x3e8:0x2710,'authTimeout':_0x18a94d[_0x083f('0x15')]?_0x18a94d['authTimeout']*0x3e8:0x1388};if(_[_0x083f('0x16')](_0x18a94d[_0x083f('0x17')])){if(_0x18a94d['authentication']){_0x441fc8[_0x083f('0x18')]=_0x18a94d[_0x083f('0x18')];_0x441fc8['password']=_0x18a94d[_0x083f('0x19')];}_0x441fc8[_0x083f('0x1a')]=_0x18a94d['host'];_0x441fc8['port']=_0x18a94d['port']||0x3e1;if(_0x18a94d[_0x083f('0x1b')]){_0x441fc8[_0x083f('0x1b')]=!![];}else{_0x441fc8['tls']=![];_0x441fc8[_0x083f('0x1c')]='required';}}else{_0x441fc8['user']=_0x18a94d[_0x083f('0x18')];_0x441fc8[_0x083f('0x19')]=_0x18a94d[_0x083f('0x19')];_0x441fc8[_0x083f('0x1a')]=utils[_0x083f('0x1d')](_0x18a94d[_0x083f('0x17')]);_0x441fc8[_0x083f('0x1e')]=0x3e1;_0x441fc8[_0x083f('0x1b')]=!![];}_0x441fc8[_0x083f('0x8')]=_0x1ce714||_0x18a94d[_0x083f('0x18')]||_0x083f('0x1f');return _0x441fc8;};EmailImap[_0x083f('0x13')]['handleReady']=function(){this[_0x083f('0x2')]['openBox'](this['mailbox'],![],this[_0x083f('0x20')][_0x083f('0xe')](this));};EmailImap[_0x083f('0x13')]['handleOpenBox']=function(_0x20c992,_0x3e1d78){if(_0x20c992){this[_0x083f('0x10')](_0x20c992,!![]);}else{this[_0x083f('0x21')](_0x083f('0x22'),_0x3e1d78);this[_0x083f('0x23')]();}};EmailImap[_0x083f('0x13')][_0x083f('0x24')]=function(_0x1075f7){if(_0x1075f7){this[_0x083f('0x10')](_0x1075f7,!![]);}else{this['imap'][_0x083f('0x25')]();}};EmailImap[_0x083f('0x13')][_0x083f('0x23')]=function(){this[_0x083f('0x2')]['search']([_0x083f('0x26')],this['handleReadUnseen']['bind'](this));};EmailImap[_0x083f('0x13')]['handleReadUnseen']=function(_0x325451,_0x56236d){if(_0x325451){this[_0x083f('0x10')](_0x325451,!![]);}else{if(_0x56236d[_0x083f('0x27')]){try{var _0x330527=this[_0x083f('0x2')][_0x083f('0x28')](_0x56236d,{'bodies':'','markSeen':!![]});_0x330527['on'](_0x083f('0x29'),this[_0x083f('0x2a')][_0x083f('0xe')](this));_0x330527[_0x083f('0xd')]('error',this[_0x083f('0x2b')]['bind'](this));_0x330527[_0x083f('0xd')](_0x083f('0x25'),this['handleFetchEnd'][_0x083f('0xe')](this));}catch(_0x519e3d){logger['error'](_0x519e3d);}}else{this[_0x083f('0x2')]['closeBox'](!![],this[_0x083f('0x24')]['bind'](this));}}};EmailImap[_0x083f('0x13')][_0x083f('0x2a')]=function(_0x13b99d,_0x3b512f){_0x13b99d['on'](_0x083f('0x2c'),this[_0x083f('0x2d')][_0x083f('0xe')](this));_0x13b99d[_0x083f('0xd')](_0x083f('0x2e'),this[_0x083f('0x2f')][_0x083f('0xe')](this));_0x13b99d[_0x083f('0xd')]('end',this['handleMessageEnd'][_0x083f('0xe')](this));};EmailImap['prototype'][_0x083f('0x2d')]=function(_0x292190,_0x477ef1){simpleParser(_0x292190,this['handleSimpleParser'][_0x083f('0xe')](this));};EmailImap[_0x083f('0x13')][_0x083f('0x2f')]=function(_0x19a206){};EmailImap[_0x083f('0x13')][_0x083f('0x30')]=function(){};EmailImap[_0x083f('0x13')][_0x083f('0x31')]=function(_0x346cae,_0x11a334){if(_0x346cae){logger[_0x083f('0xf')](_0x346cae);}else{var _0x21744b=this;utils[_0x083f('0x32')](this['account'],_0x11a334,function(_0x238529){_0x21744b['emit'](_0x083f('0x8'),_0x238529);});}};EmailImap['prototype'][_0x083f('0x33')]=function(){this[_0x083f('0x2')][_0x083f('0x34')](!![],this[_0x083f('0x24')][_0x083f('0xe')](this));};EmailImap['prototype'][_0x083f('0x2b')]=function(_0x5a81a3){this[_0x083f('0x10')](_0x5a81a3);this[_0x083f('0x2')]['closeBox'](!![],this[_0x083f('0x24')][_0x083f('0xe')](this));};EmailImap['prototype'][_0x083f('0x35')]=function(){this['emit'](_0x083f('0x25'));};EmailImap[_0x083f('0x13')][_0x083f('0x10')]=function(_0x557a6b,_0x473250){logger[_0x083f('0xf')](_0x083f('0x10'),this['account'][_0x083f('0x8')],JSON['stringify'](_0x557a6b));var _0x57cb49='';if(_0x557a6b){if(_0x557a6b[_0x083f('0x36')]){_0x57cb49=_0x557a6b[_0x083f('0x36')];}else{for(var _0x47c5c2 in _0x557a6b){if(_0x557a6b[_0x083f('0x37')](_0x47c5c2)){_0x57cb49+=_[_0x083f('0x38')](_0x47c5c2)+':\x20'+_0x557a6b[_0x47c5c2]+'\x0a';}}}}if(_0x473250){this[_0x083f('0x2')]['end']();}else{this[_0x083f('0x21')]('error',_0x57cb49);this[_0x083f('0x21')](_0x083f('0x25'));}};module[_0x083f('0x39')]=EmailImap; \ No newline at end of file +var _0x09b2=['UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','path','imap','lodash','mailparser','simpleParser','events','EventEmitter','./utils','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','email','anonymous@xcally.com','openBox','handleOpenBox','box','readUnseen','handleError','search'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x09b2,0x94));var _0x209b=function(_0x2c0af1,_0x4b5709){_0x2c0af1=_0x2c0af1-0x0;var _0x53fe48=_0x09b2[_0x2c0af1];return _0x53fe48;};'use strict';var fs=require('fs');var path=require(_0x209b('0x0'));var util=require('util');var Imap=require(_0x209b('0x1'));var _=require(_0x209b('0x2'));var rs=require('randomstring');var simpleParser=require(_0x209b('0x3'))[_0x209b('0x4')];var EventEmitter=require(_0x209b('0x5'))[_0x209b('0x6')];var utils=require(_0x209b('0x7'));var logger=require('../../../config/logger')('email');function EmailImap(_0x555994,_0x500b21){this[_0x209b('0x8')]=_0x209b('0x9');this[_0x209b('0xa')]=this[_0x209b('0xb')](_0x555994,_0x500b21);this[_0x209b('0x1')]=new Imap(this[_0x209b('0xa')]);this[_0x209b('0x1')][_0x209b('0xc')](_0x209b('0xd'),this[_0x209b('0xe')][_0x209b('0xf')](this));this['imap'][_0x209b('0xc')](_0x209b('0x10'),this[_0x209b('0x11')][_0x209b('0xf')](this));this['imap']['on']('error',this['handleError'][_0x209b('0xf')](this));this[_0x209b('0x1')][_0x209b('0x12')]();}util[_0x209b('0x13')](EmailImap,EventEmitter);EmailImap[_0x209b('0x14')][_0x209b('0xb')]=function(_0x3fbca,_0x1b3331){var _0x4ab219={'connTimeout':_0x3fbca[_0x209b('0x15')]?_0x3fbca['connTimeout']*0x3e8:0x2710,'authTimeout':_0x3fbca[_0x209b('0x16')]?_0x3fbca[_0x209b('0x16')]*0x3e8:0x1388};if(_[_0x209b('0x17')](_0x3fbca[_0x209b('0x18')])){if(_0x3fbca[_0x209b('0x19')]){_0x4ab219[_0x209b('0x1a')]=_0x3fbca[_0x209b('0x1a')];_0x4ab219['password']=_0x3fbca[_0x209b('0x1b')];}_0x4ab219[_0x209b('0x1c')]=_0x3fbca[_0x209b('0x1c')];_0x4ab219[_0x209b('0x1d')]=_0x3fbca['port']||0x3e1;if(_0x3fbca['tls']){_0x4ab219['tls']=!![];}else{_0x4ab219[_0x209b('0x1e')]=![];_0x4ab219[_0x209b('0x1f')]=_0x209b('0x20');}}else{_0x4ab219[_0x209b('0x1a')]=_0x3fbca[_0x209b('0x1a')];_0x4ab219[_0x209b('0x1b')]=_0x3fbca[_0x209b('0x1b')];_0x4ab219[_0x209b('0x1c')]=utils['getHost'](_0x3fbca[_0x209b('0x18')]);_0x4ab219[_0x209b('0x1d')]=0x3e1;_0x4ab219['tls']=!![];}_0x4ab219[_0x209b('0x21')]=_0x1b3331||_0x3fbca[_0x209b('0x1a')]||_0x209b('0x22');return _0x4ab219;};EmailImap[_0x209b('0x14')][_0x209b('0xe')]=function(){this[_0x209b('0x1')][_0x209b('0x23')](this[_0x209b('0x8')],![],this[_0x209b('0x24')]['bind'](this));};EmailImap[_0x209b('0x14')]['handleOpenBox']=function(_0x4e44ef,_0x17bd8a){if(_0x4e44ef){this['handleError'](_0x4e44ef,!![]);}else{this['emit'](_0x209b('0x25'),_0x17bd8a);this[_0x209b('0x26')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x2e4a79){if(_0x2e4a79){this[_0x209b('0x27')](_0x2e4a79,!![]);}else{this[_0x209b('0x1')][_0x209b('0x10')]();}};EmailImap[_0x209b('0x14')][_0x209b('0x26')]=function(){this['imap'][_0x209b('0x28')]([_0x209b('0x29')],this['handleReadUnseen'][_0x209b('0xf')](this));};EmailImap[_0x209b('0x14')][_0x209b('0x2a')]=function(_0x21c2b9,_0x5ba6f3){if(_0x21c2b9){this[_0x209b('0x27')](_0x21c2b9,!![]);}else{if(_0x5ba6f3[_0x209b('0x2b')]){try{var _0x198806=this['imap'][_0x209b('0x2c')](_0x5ba6f3,{'bodies':'','markSeen':!![]});_0x198806['on'](_0x209b('0x2d'),this[_0x209b('0x2e')][_0x209b('0xf')](this));_0x198806[_0x209b('0xc')](_0x209b('0x2f'),this[_0x209b('0x30')][_0x209b('0xf')](this));_0x198806[_0x209b('0xc')]('end',this[_0x209b('0x31')][_0x209b('0xf')](this));}catch(_0xf918ff){logger[_0x209b('0x2f')](_0xf918ff);}}else{this[_0x209b('0x1')][_0x209b('0x32')](!![],this[_0x209b('0x33')][_0x209b('0xf')](this));}}};EmailImap[_0x209b('0x14')][_0x209b('0x2e')]=function(_0x538026,_0x4a13f6){_0x538026['on'](_0x209b('0x34'),this[_0x209b('0x35')][_0x209b('0xf')](this));_0x538026[_0x209b('0xc')](_0x209b('0x36'),this[_0x209b('0x37')][_0x209b('0xf')](this));_0x538026[_0x209b('0xc')]('end',this[_0x209b('0x38')]['bind'](this));};EmailImap[_0x209b('0x14')][_0x209b('0x35')]=function(_0x1a0eef,_0x138de9){simpleParser(_0x1a0eef,this['handleSimpleParser'][_0x209b('0xf')](this));};EmailImap[_0x209b('0x14')]['handleMessageAttributes']=function(_0x5854b1){};EmailImap[_0x209b('0x14')][_0x209b('0x38')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x2e3566,_0x222929){if(_0x2e3566){logger[_0x209b('0x2f')](_0x2e3566);}else{var _0x104e19=this;utils[_0x209b('0x39')](this[_0x209b('0xa')],_0x222929,function(_0x57d60d){_0x104e19[_0x209b('0x3a')](_0x209b('0x21'),_0x57d60d);});}};EmailImap[_0x209b('0x14')][_0x209b('0x31')]=function(){this[_0x209b('0x1')][_0x209b('0x32')](!![],this[_0x209b('0x33')][_0x209b('0xf')](this));};EmailImap['prototype'][_0x209b('0x30')]=function(_0x5ba254){this[_0x209b('0x27')](_0x5ba254);this[_0x209b('0x1')][_0x209b('0x32')](!![],this['handleCloseBox'][_0x209b('0xf')](this));};EmailImap[_0x209b('0x14')][_0x209b('0x11')]=function(){this[_0x209b('0x3a')](_0x209b('0x10'));};EmailImap[_0x209b('0x14')][_0x209b('0x27')]=function(_0x1ca6b9,_0x197f0f){logger[_0x209b('0x2f')](_0x209b('0x27'),this['account']['email'],JSON[_0x209b('0x3b')](_0x1ca6b9));var _0x49b23b='';if(_0x1ca6b9){if(_0x1ca6b9[_0x209b('0x3c')]){_0x49b23b=_0x1ca6b9[_0x209b('0x3c')];}else{for(var _0x3f2cd6 in _0x1ca6b9){if(_0x1ca6b9[_0x209b('0x3d')](_0x3f2cd6)){_0x49b23b+=_[_0x209b('0x3e')](_0x3f2cd6)+':\x20'+_0x1ca6b9[_0x3f2cd6]+'\x0a';}}}}if(_0x197f0f){this[_0x209b('0x1')][_0x209b('0x10')]();}else{this[_0x209b('0x3a')](_0x209b('0x2f'),_0x49b23b);this[_0x209b('0x3a')]('end');}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 90de973..2f40e13 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 _0x2a64=['nodemailer','bluebird','prototype','send','createTransport','use','toString','verify','Not\x20verifired','exports'];(function(_0x1d3350,_0x318d04){var _0x276af6=function(_0x1aece1){while(--_0x1aece1){_0x1d3350['push'](_0x1d3350['shift']());}};_0x276af6(++_0x318d04);}(_0x2a64,0x104));var _0x42a6=function(_0x3ffae5,_0x42ee02){_0x3ffae5=_0x3ffae5-0x0;var _0x4fcf4c=_0x2a64[_0x3ffae5];return _0x4fcf4c;};'use strict';var nodemailer=require(_0x42a6('0x0'));var BPromise=require(_0x42a6('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x42a6('0x2')][_0x42a6('0x3')]=function(_0x2f8b3e,_0xa99f75){return new BPromise(function(_0x3201cd,_0x4a17d7){var _0x506947=nodemailer[_0x42a6('0x4')](_0x2f8b3e);_0x506947[_0x42a6('0x5')]('compile',inlineBase64());_0x506947['sendMail'](_0xa99f75,function(_0x38745d,_0x1468d7){if(_0x38745d){_0x4a17d7(_0x38745d[_0x42a6('0x6')]());}else{_0x3201cd(_0x1468d7);}});});};EmailSmtp[_0x42a6('0x2')]['verify']=function(_0x28ba40){return new BPromise(function(_0x545740,_0x557976){var _0x1fcc12=nodemailer[_0x42a6('0x4')](_0x28ba40);_0x1fcc12[_0x42a6('0x7')](function(_0xfb9bd7,_0x420eb2){if(_0xfb9bd7){_0x557976(_0xfb9bd7[_0x42a6('0x6')]());}else{if(_0x420eb2){_0x545740(_0x420eb2);}else{_0x557976(_0x42a6('0x8'));}}});});};module[_0x42a6('0x9')]=EmailSmtp; \ No newline at end of file +var _0x8d4d=['use','compile','verify','createTransport','toString','Not\x20verifired','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d4d,0x10b));var _0xd8d4=function(_0x25da57,_0x158a88){_0x25da57=_0x25da57-0x0;var _0x20a089=_0x8d4d[_0x25da57];return _0x20a089;};'use strict';var nodemailer=require('nodemailer');var BPromise=require('bluebird');var inlineBase64=require(_0xd8d4('0x0'));function EmailSmtp(){}EmailSmtp[_0xd8d4('0x1')][_0xd8d4('0x2')]=function(_0x500043,_0x46feaa){return new BPromise(function(_0x35ea85,_0x60ce7c){var _0x30fd61=nodemailer['createTransport'](_0x500043);_0x30fd61[_0xd8d4('0x3')](_0xd8d4('0x4'),inlineBase64());_0x30fd61['sendMail'](_0x46feaa,function(_0x277ac3,_0x232a89){if(_0x277ac3){_0x60ce7c(_0x277ac3['toString']());}else{_0x35ea85(_0x232a89);}});});};EmailSmtp[_0xd8d4('0x1')][_0xd8d4('0x5')]=function(_0x1e07e1){return new BPromise(function(_0x46d250,_0x1b1306){var _0x21543f=nodemailer[_0xd8d4('0x6')](_0x1e07e1);_0x21543f[_0xd8d4('0x5')](function(_0x332e38,_0x3317b1){if(_0x332e38){_0x1b1306(_0x332e38[_0xd8d4('0x7')]());}else{if(_0x3317b1){_0x46d250(_0x3317b1);}else{_0x1b1306(_0xd8d4('0x8'));}}});});};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 6c219c7..a4721b4 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 _0x9fbe=['inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','messageId','parseBuffer','BodyHTML','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','randomstring','../../../config/logger','../../../config/environment','address','anonymous','generate','@xcally.com','head','value','name','split','slice','join','Anonymous','length','isEmpty','html','replace','body','textAsHtml','0x1?_0x13ada8['pop']():'';}return'';}function getMails(_0x6b2d29,_0x3a1d47){var _0x2a9b17='';for(var _0x304da1=0x0;_0x304da1<_0x3a1d47[_0xe9fb('0x8')][_0xe9fb('0xe')];_0x304da1+=0x1){if(_0x3a1d47[_0xe9fb('0x8')][_0x304da1]['address']!==_0x6b2d29){if(!_[_0xe9fb('0xf')](_0x2a9b17)){_0x2a9b17+=',';}_0x2a9b17+=_0x3a1d47[_0xe9fb('0x8')][_0x304da1][_0xe9fb('0x9')]||_0x3a1d47[_0xe9fb('0x8')][_0x304da1]['address']||'';_0x2a9b17+='\x20<';_0x2a9b17+=_0x3a1d47['value'][_0x304da1]['address']?_0x3a1d47[_0xe9fb('0x8')][_0x304da1]['address']:_0xe9fb('0x4')+random['generate'](0x6)+_0xe9fb('0x6');_0x2a9b17+='>';}}return _0x2a9b17;}function parseEmail(_0x2cdb9b,_0x3b956b,_0x5014c2){if(_0x3b956b[_0xe9fb('0x10')]){var _0x262129=/)<[^<]*)*<\/script>/gi;while(_0x262129['test'](_0x3b956b[_0xe9fb('0x10')])){_0x3b956b['html']=_0x3b956b[_0xe9fb('0x10')][_0xe9fb('0x11')](_0x262129,'');}_0x5014c2[_0xe9fb('0x12')]=_0x3b956b['html'];}else{_0x5014c2['body']=_0x3b956b[_0xe9fb('0x13')];}if(_0x5014c2[_0xe9fb('0x12')]){_0x5014c2[_0xe9fb('0x12')]=_0x5014c2[_0xe9fb('0x12')][_0xe9fb('0x11')](/Empty\x20message

';if(_0x2ab766[_0xe9fb('0x31')]){for(var _0x43b583=0x0;_0x43b583<_0x2ab766['Attachments'][_0xe9fb('0xe')];_0x43b583++){var _0x32b9bd=_0x2ab766[_0xe9fb('0x31')][_0x43b583];_0x23a877['message'][_0xe9fb('0x1a')][_0xe9fb('0x24')]({'filename':_0x32b9bd[_0xe9fb('0x32')],'content':new Buffer(_0x32b9bd[_0xe9fb('0x33')])});}}}_0x4553be(parseEmail(_0x5b0bff,_0x3bd39a,_0x23a877));});}else{_0x3bd39a['html']='

Empty\x20message

';_0x4553be(parseEmail(_0x5b0bff,_0x3bd39a,_0x23a877));}}else{_0x4553be(parseEmail(_0x5b0bff,_0x3bd39a,_0x23a877));}};exports[_0xe9fb('0x34')]=function(_0x1dfb3f){switch(_0x1dfb3f){case _0xe9fb('0x35'):return _0xe9fb('0x36');case _0xe9fb('0x37'):return'imap.mail.yahoo.com';case _0xe9fb('0x38'):return _0xe9fb('0x39');case _0xe9fb('0x3a'):return _0xe9fb('0x3b');}return'127.0.0.1';}; \ No newline at end of file +var _0x0348=['value','address','anonymous','generate','@xcally.com','name','split','length','join','Anonymous','isEmpty','html','replace','body','textAsHtml','originTo','message','originCc','includes','attachments','attach','type','attachment','filename','attachment-','%s-%s','root','server/files/attachments/','content','push','contentType','from','subject','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','moment','path','util','../../../config/logger','email','../../../config/environment','head'];(function(_0x2b6596,_0xed330a){var _0x2f49e3=function(_0x10cc8a){while(--_0x10cc8a){_0x2b6596['push'](_0x2b6596['shift']());}};_0x2f49e3(++_0xed330a);}(_0x0348,0x1e9));var _0x8034=function(_0x141749,_0x477b04){_0x141749=_0x141749-0x0;var _0x3e6932=_0x0348[_0x141749];return _0x3e6932;};'use strict';var _=require('lodash');var moment=require(_0x8034('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0x8034('0x1'));var util=require(_0x8034('0x2'));var tnef=require('node-tnef');var logger=require(_0x8034('0x3'))(_0x8034('0x4'));var config=require(_0x8034('0x5'));function getAddress(_0x18f41e){var _0x1500ae=_[_0x8034('0x6')](_0x18f41e[_0x8034('0x7')]);return _0x1500ae&&_0x1500ae[_0x8034('0x8')]?_0x1500ae['address']:_0x8034('0x9')+random[_0x8034('0xa')](0x6)+_0x8034('0xb');}function getFirstName(_0x3ffa94){var _0x326344=_[_0x8034('0x6')](_0x3ffa94[_0x8034('0x7')]);if(_0x326344&&_0x326344[_0x8034('0xc')]){var _0x236566=_0x326344[_0x8034('0xc')][_0x8034('0xd')](/\s+/);return _0x236566[_0x8034('0xe')]?_0x236566['slice'](0x0,-0x1)[_0x8034('0xf')]('\x20'):_0x326344['name'];}return _0x8034('0x10');}function getLastName(_0x50c214){var _0x362fee=_['head'](_0x50c214['value']);if(_0x362fee&&_0x362fee[_0x8034('0xc')]){var _0x308085=_0x362fee[_0x8034('0xc')]['split'](/\s+/);return _0x308085[_0x8034('0xe')]>0x1?_0x308085['pop']():'';}return'';}function getMails(_0x34161b,_0x4a2c7b){var _0x428809='';for(var _0x370827=0x0;_0x370827<_0x4a2c7b[_0x8034('0x7')][_0x8034('0xe')];_0x370827+=0x1){if(_0x4a2c7b['value'][_0x370827]['address']!==_0x34161b){if(!_[_0x8034('0x11')](_0x428809)){_0x428809+=',';}_0x428809+=_0x4a2c7b[_0x8034('0x7')][_0x370827][_0x8034('0xc')]||_0x4a2c7b[_0x8034('0x7')][_0x370827][_0x8034('0x8')]||'';_0x428809+='\x20<';_0x428809+=_0x4a2c7b[_0x8034('0x7')][_0x370827][_0x8034('0x8')]?_0x4a2c7b['value'][_0x370827][_0x8034('0x8')]:_0x8034('0x9')+random[_0x8034('0xa')](0x6)+_0x8034('0xb');_0x428809+='>';}}return _0x428809;}function parseEmail(_0x487179,_0x3d0284,_0x2e14b6){if(_0x3d0284[_0x8034('0x12')]){var _0x3bbc55=/)<[^<]*)*<\/script>/gi;while(_0x3bbc55['test'](_0x3d0284[_0x8034('0x12')])){_0x3d0284['html']=_0x3d0284[_0x8034('0x12')][_0x8034('0x13')](_0x3bbc55,'');}_0x2e14b6[_0x8034('0x14')]=_0x3d0284[_0x8034('0x12')];}else{_0x2e14b6[_0x8034('0x14')]=_0x3d0284[_0x8034('0x15')];}if(_0x2e14b6['body']){_0x2e14b6['body']=_0x2e14b6[_0x8034('0x14')][_0x8034('0x13')](/0x0){if(this[_0x3f4617+_0x43f0('0x23')]>0x0&&this[_0x3f4617+_0x43f0('0x22')]>=this[_0x3f4617+'Capacity']){return'maxcapacity';}else{return'working';}}else{return _0x43f0('0x24');}};Agent[_0x43f0('0x25')][_0x43f0('0x21')]=function(){var _0x4e54c1=[_0x43f0('0x26'),_0x43f0('0x27'),_0x43f0('0x28'),_0x43f0('0x29'),_0x43f0('0x2a')];for(var _0x3f5e08=0x0;_0x3f5e08<_0x4e54c1[_0x43f0('0x2b')];_0x3f5e08+=0x1){var _0x13b090=this['getChannelStatus'](_0x4e54c1[_0x3f5e08]);if(this[_0x4e54c1[_0x3f5e08]+_0x43f0('0x2c')]!==_0x13b090){this[_0x4e54c1[_0x3f5e08]+_0x43f0('0x2d')]=_[_0x43f0('0x2e')](moment()[_0x43f0('0x2f')]('x'));}this[_0x4e54c1[_0x3f5e08]+'Status']=_0x13b090;}var _0x14e815={'id':this['id'],'name':this[_0x43f0('0x7')],'online':this[_0x43f0('0x8')],'voicePause':this[_0x43f0('0x9')],'chatPause':this[_0x43f0('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x43f0('0xd')],'faxPause':this['faxPause'],'openchannelPause':this[_0x43f0('0xe')],'chatStatus':this[_0x43f0('0xf')],'chatStatusTime':this[_0x43f0('0x11')],'chatCapacity':this[_0x43f0('0x12')],'chatCurrentCapacity':this[_0x43f0('0x13')],'mailStatus':this[_0x43f0('0x30')],'mailStatusTime':this[_0x43f0('0x31')],'mailCapacity':this[_0x43f0('0x14')],'mailCurrentCapacity':this[_0x43f0('0x15')],'faxStatus':this[_0x43f0('0x32')],'faxStatusTime':this[_0x43f0('0x16')],'faxCapacity':this[_0x43f0('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x43f0('0x33')],'smsStatusTime':this[_0x43f0('0x34')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x43f0('0x1a')],'openchannelStatus':this[_0x43f0('0x1b')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x43f0('0x1d')],'openchannelCurrentCapacity':this[_0x43f0('0x1e')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0xee0500=md5(JSON[_0x43f0('0x35')](_0x14e815));if(this['md5']!==_0xee0500){this[_0x43f0('0x1')]=_0xee0500;io['emit'](_0x43f0('0x36'),_0x14e815);}};module['exports']=Agent; \ No newline at end of file +var _0x69ef=['working','idle','mail','openchannel','sms','length','Status','format','faxPause','chatCurrentCapacity','mailStatusTime','faxStatus','emit','user:save','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity'];(function(_0x49192,_0x2fc6fb){var _0x57d8e8=function(_0xc4ed8d){while(--_0xc4ed8d){_0x49192['push'](_0x49192['shift']());}};_0x57d8e8(++_0x2fc6fb);}(_0x69ef,0x181));var _0xf69e=function(_0x36946c,_0x4291e3){_0x36946c=_0x36946c-0x0;var _0x2fc543=_0x69ef[_0x36946c];return _0x2fc543;};'use strict';var _=require('lodash');var moment=require(_0xf69e('0x0'));var md5=require(_0xf69e('0x1'));var Redis=require(_0xf69e('0x2'));var config=require(_0xf69e('0x3'));config[_0xf69e('0x4')]=_[_0xf69e('0x5')](config[_0xf69e('0x4')],{'host':_0xf69e('0x6'),'port':0x18eb});var io=require(_0xf69e('0x7'))(new Redis(config[_0xf69e('0x4')]));function Agent(_0x5d00c9){this['id']=_0x5d00c9['id']||0x0;this[_0xf69e('0x8')]=_0x5d00c9[_0xf69e('0x8')]||'';this[_0xf69e('0x9')]=_0x5d00c9[_0xf69e('0x9')]||!![];this[_0xf69e('0xa')]=_0x5d00c9['voicePause']||![];this[_0xf69e('0xb')]=_0x5d00c9[_0xf69e('0xb')]||![];this[_0xf69e('0xc')]=_0x5d00c9['mailPause']||![];this['faxPause']=_0x5d00c9['faxPause']||![];this[_0xf69e('0xd')]=_0x5d00c9[_0xf69e('0xd')]||![];this[_0xf69e('0xe')]=_0x5d00c9['openchannelPause']||![];this[_0xf69e('0xf')]=_0xf69e('0x10');this[_0xf69e('0x11')]=0x0;this[_0xf69e('0x12')]=_0x5d00c9[_0xf69e('0x12')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xf69e('0x13')]=_0xf69e('0x10');this['mailStatusTime']=0x0;this[_0xf69e('0x14')]=_0x5d00c9[_0xf69e('0x14')]||0x0;this[_0xf69e('0x15')]=0x0;this['faxStatus']=_0xf69e('0x10');this[_0xf69e('0x16')]=0x0;this['faxCapacity']=_0x5d00c9[_0xf69e('0x17')]||0x0;this[_0xf69e('0x18')]=0x0;this['smsStatus']=_0xf69e('0x10');this[_0xf69e('0x19')]=0x0;this[_0xf69e('0x1a')]=_0x5d00c9[_0xf69e('0x1a')]||0x0;this[_0xf69e('0x1b')]=0x0;this[_0xf69e('0x1c')]=_0xf69e('0x10');this[_0xf69e('0x1d')]=0x0;this[_0xf69e('0x1e')]=_0x5d00c9[_0xf69e('0x1e')]||0x0;this[_0xf69e('0x1f')]=0x0;this[_0xf69e('0x20')]=![];this['busyQueue']=undefined;this[_0xf69e('0x1')]='';this[_0xf69e('0x21')]();}Agent[_0xf69e('0x22')][_0xf69e('0x23')]=function(_0x531dad){if(this[_0x531dad+_0xf69e('0x24')]>0x0){if(this[_0x531dad+'Capacity']>0x0&&this[_0x531dad+_0xf69e('0x24')]>=this[_0x531dad+_0xf69e('0x25')]){return _0xf69e('0x26');}else{return _0xf69e('0x27');}}else{return _0xf69e('0x28');}};Agent[_0xf69e('0x22')][_0xf69e('0x21')]=function(){var _0x56c15f=[_0xf69e('0x29'),'chat',_0xf69e('0x2a'),'fax',_0xf69e('0x2b')];for(var _0x1d5b64=0x0;_0x1d5b64<_0x56c15f[_0xf69e('0x2c')];_0x1d5b64+=0x1){var _0x4f5caa=this[_0xf69e('0x23')](_0x56c15f[_0x1d5b64]);if(this[_0x56c15f[_0x1d5b64]+_0xf69e('0x2d')]!==_0x4f5caa){this[_0x56c15f[_0x1d5b64]+'StatusTime']=_['toNumber'](moment()[_0xf69e('0x2e')]('x'));}this[_0x56c15f[_0x1d5b64]+_0xf69e('0x2d')]=_0x4f5caa;}var _0x38c046={'id':this['id'],'name':this[_0xf69e('0x8')],'online':this[_0xf69e('0x9')],'voicePause':this[_0xf69e('0xa')],'chatPause':this[_0xf69e('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0xf69e('0xd')],'faxPause':this[_0xf69e('0x2f')],'openchannelPause':this[_0xf69e('0xe')],'chatStatus':this[_0xf69e('0xf')],'chatStatusTime':this[_0xf69e('0x11')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xf69e('0x30')],'mailStatus':this[_0xf69e('0x13')],'mailStatusTime':this[_0xf69e('0x31')],'mailCapacity':this[_0xf69e('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xf69e('0x32')],'faxStatusTime':this[_0xf69e('0x16')],'faxCapacity':this[_0xf69e('0x17')],'faxCurrentCapacity':this[_0xf69e('0x18')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xf69e('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this[_0xf69e('0x1c')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xf69e('0x1f')],'busy':this[_0xf69e('0x20')],'busyQueue':this['busyQueue']};var _0x8b764c=md5(JSON['stringify'](_0x38c046));if(this[_0xf69e('0x1')]!==_0x8b764c){this[_0xf69e('0x1')]=_0x8b764c;io[_0xf69e('0x33')](_0xf69e('0x34'),_0x38c046);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 5278de7..00786a0 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 _0xd7e0=['prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','chatPause','available','stringify','format','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x237e1b,_0xb6c9e2){var _0x47e755=function(_0x426a07){while(--_0x426a07){_0x237e1b['push'](_0x237e1b['shift']());}};_0x47e755(++_0xb6c9e2);}(_0xd7e0,0xa4));var _0x0d7e=function(_0x4e59b3,_0x214b8e){_0x4e59b3=_0x4e59b3-0x0;var _0x1197f8=_0xd7e0[_0x4e59b3];return _0x1197f8;};'use strict';var _=require(_0x0d7e('0x0'));var md5=require(_0x0d7e('0x1'));var util=require(_0x0d7e('0x2'));var Redis=require(_0x0d7e('0x3'));var config=require(_0x0d7e('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x0d7e('0x5'),'port':0x18eb});var io=require(_0x0d7e('0x6'))(new Redis(config[_0x0d7e('0x7')]));function ChatQueue(_0x31b67e){this['id']=_0x31b67e['id']||0x0;this[_0x0d7e('0x8')]=_0x31b67e[_0x0d7e('0x8')]||'';this[_0x0d7e('0x9')]=_0x31b67e[_0x0d7e('0x9')]||0xa;this[_0x0d7e('0xa')]=_0x31b67e['strategy']||_0x0d7e('0xb');this[_0x0d7e('0xc')]=_0x31b67e[_0x0d7e('0xc')];this[_0x0d7e('0xd')]={};this[_0x0d7e('0xe')]=0x0;this[_0x0d7e('0x1')]='';this[_0x0d7e('0xf')]();this['updateRealtime']();}ChatQueue[_0x0d7e('0x10')][_0x0d7e('0xf')]=function(){var _0x486734=this[_0x0d7e('0xd')][_0x0d7e('0x11')];this[_0x0d7e('0xd')]=_[_0x0d7e('0x12')](this[_0x0d7e('0xc')],'id');this[_0x0d7e('0xd')][_0x0d7e('0x11')]=_0x486734;};ChatQueue[_0x0d7e('0x10')][_0x0d7e('0x13')]=function(){this[_0x0d7e('0x14')]=0x0;this[_0x0d7e('0x15')]=0x0;for(var _0x4ff671=0x0;_0x4ff671=0x0?this[_0x0d7e('0x19')]:0x0;var _0x43f786={'id':this['id'],'available':this[_0x0d7e('0x19')],'loggedIn':this[_0x0d7e('0x14')],'name':this[_0x0d7e('0x8')],'paused':this[_0x0d7e('0x15')],'waiting':this[_0x0d7e('0xe')]};var _0x1e9d46=md5(JSON[_0x0d7e('0x1a')](_0x43f786));if(this[_0x0d7e('0x1')]!==_0x1e9d46){this[_0x0d7e('0x1')]=_0x1e9d46;io['to'](util[_0x0d7e('0x1b')]('chat:queue:%s',_0x43f786['name']))[_0x0d7e('0x1c')](_0x0d7e('0x1d'),_0x43f786);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xc06f=['loggedIn','paused','length','online','chatPause','available','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr'];(function(_0x337a10,_0x5191c7){var _0x575f98=function(_0x3851cd){while(--_0x3851cd){_0x337a10['push'](_0x337a10['shift']());}};_0x575f98(++_0x5191c7);}(_0xc06f,0x1ae));var _0xfc06=function(_0x42280d,_0xfe2682){_0x42280d=_0x42280d-0x0;var _0x3707cb=_0xc06f[_0x42280d];return _0x3707cb;};'use strict';var _=require(_0xfc06('0x0'));var md5=require(_0xfc06('0x1'));var util=require(_0xfc06('0x2'));var Redis=require(_0xfc06('0x3'));var config=require(_0xfc06('0x4'));config[_0xfc06('0x5')]=_[_0xfc06('0x6')](config[_0xfc06('0x5')],{'host':_0xfc06('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x56b803){this['id']=_0x56b803['id']||0x0;this['name']=_0x56b803[_0xfc06('0x8')]||'';this[_0xfc06('0x9')]=_0x56b803[_0xfc06('0x9')]||0xa;this['strategy']=_0x56b803[_0xfc06('0xa')]||_0xfc06('0xb');this[_0xfc06('0xc')]=_0x56b803[_0xfc06('0xc')];this[_0xfc06('0xd')]={};this[_0xfc06('0xe')]=0x0;this[_0xfc06('0x1')]='';this[_0xfc06('0xf')]();this[_0xfc06('0x10')]();}ChatQueue['prototype'][_0xfc06('0xf')]=function(){var _0x1097ce=this[_0xfc06('0xd')][_0xfc06('0x11')];this[_0xfc06('0xd')]=_['map'](this[_0xfc06('0xc')],'id');this['mapAgentsId'][_0xfc06('0x11')]=_0x1097ce;};ChatQueue['prototype'][_0xfc06('0x10')]=function(){this[_0xfc06('0x12')]=0x0;this[_0xfc06('0x13')]=0x0;for(var _0x476260=0x0;_0x476260=0x0?this[_0xfc06('0x17')]:0x0;var _0x3dd592={'id':this['id'],'available':this[_0xfc06('0x17')],'loggedIn':this[_0xfc06('0x12')],'name':this[_0xfc06('0x8')],'paused':this[_0xfc06('0x13')],'waiting':this['waiting']};var _0x3896c4=md5(JSON['stringify'](_0x3dd592));if(this[_0xfc06('0x1')]!==_0x3896c4){this[_0xfc06('0x1')]=_0x3896c4;io['to'](util[_0xfc06('0x18')](_0xfc06('0x19'),_0x3dd592[_0xfc06('0x8')]))[_0xfc06('0x1a')]('chat_queue:save',_0x3dd592);}};module[_0xfc06('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 8240dc3..7344e73 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 _0x84c1=['redis','defaults','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','online','faxPause','available','stringify','md5','format','fax:queue:%s','emit','lodash','util','ioredis','../../../config/environment'];(function(_0x10d39e,_0x260735){var _0x27a17d=function(_0x1d445b){while(--_0x1d445b){_0x10d39e['push'](_0x10d39e['shift']());}};_0x27a17d(++_0x260735);}(_0x84c1,0x79));var _0x184c=function(_0x2ed779,_0x5b218a){_0x2ed779=_0x2ed779-0x0;var _0x21fa53=_0x84c1[_0x2ed779];return _0x21fa53;};'use strict';var _=require(_0x184c('0x0'));var md5=require('md5');var util=require(_0x184c('0x1'));var Redis=require(_0x184c('0x2'));var config=require(_0x184c('0x3'));config[_0x184c('0x4')]=_[_0x184c('0x5')](config[_0x184c('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x184c('0x4')]));function FaxQueue(_0x14278e){this['id']=_0x14278e['id']||0x0;this[_0x184c('0x6')]=_0x14278e[_0x184c('0x6')]||'';this[_0x184c('0x7')]=_0x14278e[_0x184c('0x7')]||0xa;this['strategy']=_0x14278e[_0x184c('0x8')]||_0x184c('0x9');this[_0x184c('0xa')]=_0x14278e[_0x184c('0xa')];this['mapAgentsId']={};this[_0x184c('0xb')]=0x0;this['md5']='';this[_0x184c('0xc')]();this[_0x184c('0xd')]();}FaxQueue[_0x184c('0xe')]['updateRouting']=function(){var _0x23af41=this['mapAgentsId'][_0x184c('0xf')];this['mapAgentsId']=_['map'](this[_0x184c('0xa')],'id');this['mapAgentsId'][_0x184c('0xf')]=_0x23af41;};FaxQueue['prototype'][_0x184c('0xd')]=function(){this[_0x184c('0x10')]=0x0;this['paused']=0x0;for(var _0x3f8b35=0x0;_0x3f8b35=0x0?this[_0x184c('0x13')]:0x0;var _0x35f831={'id':this['id'],'available':this[_0x184c('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x184c('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x394a30=md5(JSON[_0x184c('0x14')](_0x35f831));if(this[_0x184c('0x15')]!==_0x394a30){this['md5']=_0x394a30;io['to'](util[_0x184c('0x16')](_0x184c('0x17'),_0x35f831[_0x184c('0x6')]))[_0x184c('0x18')]('fax_queue:save',_0x35f831);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xe7df=['updateRouting','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','faxPause','available','format','fax_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xe7df,0xca));var _0xfe7d=function(_0x5e01f5,_0x1953f2){_0x5e01f5=_0x5e01f5-0x0;var _0x16aab4=_0xe7df[_0x5e01f5];return _0x16aab4;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xfe7d('0x0'));var Redis=require(_0xfe7d('0x1'));var config=require(_0xfe7d('0x2'));config[_0xfe7d('0x3')]=_[_0xfe7d('0x4')](config['redis'],{'host':_0xfe7d('0x5'),'port':0x18eb});var io=require(_0xfe7d('0x6'))(new Redis(config[_0xfe7d('0x3')]));function FaxQueue(_0x1571c1){this['id']=_0x1571c1['id']||0x0;this[_0xfe7d('0x7')]=_0x1571c1[_0xfe7d('0x7')]||'';this[_0xfe7d('0x8')]=_0x1571c1[_0xfe7d('0x8')]||0xa;this[_0xfe7d('0x9')]=_0x1571c1[_0xfe7d('0x9')]||_0xfe7d('0xa');this['Agents']=_0x1571c1[_0xfe7d('0xb')];this['mapAgentsId']={};this[_0xfe7d('0xc')]=0x0;this[_0xfe7d('0xd')]='';this[_0xfe7d('0xe')]();this['updateRealtime']();}FaxQueue['prototype'][_0xfe7d('0xe')]=function(){var _0x4b6d3a=this[_0xfe7d('0xf')][_0xfe7d('0x10')];this[_0xfe7d('0xf')]=_[_0xfe7d('0x11')](this[_0xfe7d('0xb')],'id');this[_0xfe7d('0xf')][_0xfe7d('0x10')]=_0x4b6d3a;};FaxQueue[_0xfe7d('0x12')]['updateRealtime']=function(){this[_0xfe7d('0x13')]=0x0;this[_0xfe7d('0x14')]=0x0;for(var _0x46a384=0x0;_0x46a384=0x0?this[_0xfe7d('0x17')]:0x0;var _0x516ef4={'id':this['id'],'available':this[_0xfe7d('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xfe7d('0x7')],'paused':this[_0xfe7d('0x14')],'waiting':this['waiting']};var _0x35af5b=md5(JSON['stringify'](_0x516ef4));if(this[_0xfe7d('0xd')]!==_0x35af5b){this[_0xfe7d('0xd')]=_0x35af5b;io['to'](util[_0xfe7d('0x18')]('fax:queue:%s',_0x516ef4[_0xfe7d('0x7')]))['emit'](_0xfe7d('0x19'),_0x516ef4);}};module[_0xfe7d('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 0dc5ffd..313588e 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 _0x4380=['name','Intervals','exports'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x4380,0x177));var _0x0438=function(_0x56853e,_0x4625f7){_0x56853e=_0x56853e-0x0;var _0x1713dc=_0x4380[_0x56853e];return _0x1713dc;};'use strict';function Interval(_0x319e3e){this['id']=_0x319e3e['id']||0x0;this[_0x0438('0x0')]=_0x319e3e[_0x0438('0x0')]||'';this[_0x0438('0x1')]=_0x319e3e[_0x0438('0x1')]||{};}module[_0x0438('0x2')]=Interval; \ No newline at end of file +var _0x065e=['name','Intervals'];(function(_0x4897de,_0xed68b9){var _0x2e08ed=function(_0x5b4678){while(--_0x5b4678){_0x4897de['push'](_0x4897de['shift']());}};_0x2e08ed(++_0xed68b9);}(_0x065e,0x98));var _0xe065=function(_0x4d3508,_0x576711){_0x4d3508=_0x4d3508-0x0;var _0x144bb9=_0x065e[_0x4d3508];return _0x144bb9;};'use strict';function Interval(_0x371611){this['id']=_0x371611['id']||0x0;this[_0xe065('0x0')]=_0x371611[_0xe065('0x0')]||'';this['Intervals']=_0x371611[_0xe065('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 559b8a7..90f8346 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 _0xbd36=['prototype','_rr','mapAgentsId','loggedIn','paused','length','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime'];(function(_0x215f9e,_0x438b14){var _0x217ce4=function(_0x2d8081){while(--_0x2d8081){_0x215f9e['push'](_0x215f9e['shift']());}};_0x217ce4(++_0x438b14);}(_0xbd36,0x65));var _0x6bd3=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xbd36[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x6bd3('0x0'));var md5=require(_0x6bd3('0x1'));var util=require(_0x6bd3('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x6bd3('0x3')]=_[_0x6bd3('0x4')](config['redis'],{'host':_0x6bd3('0x5'),'port':0x18eb});var io=require(_0x6bd3('0x6'))(new Redis(config[_0x6bd3('0x3')]));function MailQueue(_0x393ea2){this['id']=_0x393ea2['id']||0x0;this['name']=_0x393ea2[_0x6bd3('0x7')]||'';this[_0x6bd3('0x8')]=_0x393ea2[_0x6bd3('0x8')]||0xa;this[_0x6bd3('0x9')]=_0x393ea2[_0x6bd3('0x9')]||_0x6bd3('0xa');this[_0x6bd3('0xb')]=_0x393ea2['Agents'];this['mapAgentsId']={};this[_0x6bd3('0xc')]=0x0;this['md5']='';this[_0x6bd3('0xd')]();this[_0x6bd3('0xe')]();}MailQueue[_0x6bd3('0xf')][_0x6bd3('0xd')]=function(){var _0x210b5e=this['mapAgentsId'][_0x6bd3('0x10')];this[_0x6bd3('0x11')]=_['map'](this[_0x6bd3('0xb')],'id');this[_0x6bd3('0x11')][_0x6bd3('0x10')]=_0x210b5e;};MailQueue[_0x6bd3('0xf')][_0x6bd3('0xe')]=function(){this[_0x6bd3('0x12')]=0x0;this[_0x6bd3('0x13')]=0x0;for(var _0x141121=0x0;_0x141121=0x0?this['available']:0x0;var _0xa72c2d={'id':this['id'],'available':this[_0x6bd3('0x16')],'loggedIn':this[_0x6bd3('0x12')],'name':this[_0x6bd3('0x7')],'paused':this[_0x6bd3('0x13')],'waiting':this[_0x6bd3('0xc')]};var _0x1c8983=md5(JSON[_0x6bd3('0x17')](_0xa72c2d));if(this[_0x6bd3('0x1')]!==_0x1c8983){this[_0x6bd3('0x1')]=_0x1c8983;io['to'](util[_0x6bd3('0x18')](_0x6bd3('0x19'),_0xa72c2d[_0x6bd3('0x7')]))[_0x6bd3('0x1a')](_0x6bd3('0x1b'),_0xa72c2d);}};module[_0x6bd3('0x1c')]=MailQueue; \ No newline at end of file +var _0xf31b=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','mailPause','available','format','mail:queue:%s','mail_queue:save','lodash','md5','util','ioredis'];(function(_0x215929,_0x514e2a){var _0x3ef31a=function(_0x1121ad){while(--_0x1121ad){_0x215929['push'](_0x215929['shift']());}};_0x3ef31a(++_0x514e2a);}(_0xf31b,0x1a0));var _0xbf31=function(_0x202b91,_0x1d1618){_0x202b91=_0x202b91-0x0;var _0x545ccd=_0xf31b[_0x202b91];return _0x545ccd;};'use strict';var _=require(_0xbf31('0x0'));var md5=require(_0xbf31('0x1'));var util=require(_0xbf31('0x2'));var Redis=require(_0xbf31('0x3'));var config=require(_0xbf31('0x4'));config[_0xbf31('0x5')]=_[_0xbf31('0x6')](config['redis'],{'host':_0xbf31('0x7'),'port':0x18eb});var io=require(_0xbf31('0x8'))(new Redis(config['redis']));function MailQueue(_0x47a5cf){this['id']=_0x47a5cf['id']||0x0;this[_0xbf31('0x9')]=_0x47a5cf['name']||'';this[_0xbf31('0xa')]=_0x47a5cf[_0xbf31('0xa')]||0xa;this['strategy']=_0x47a5cf['strategy']||_0xbf31('0xb');this['Agents']=_0x47a5cf[_0xbf31('0xc')];this[_0xbf31('0xd')]={};this[_0xbf31('0xe')]=0x0;this[_0xbf31('0x1')]='';this[_0xbf31('0xf')]();this[_0xbf31('0x10')]();}MailQueue[_0xbf31('0x11')][_0xbf31('0xf')]=function(){var _0x363d23=this[_0xbf31('0xd')][_0xbf31('0x12')];this[_0xbf31('0xd')]=_[_0xbf31('0x13')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x363d23;};MailQueue['prototype'][_0xbf31('0x10')]=function(){this[_0xbf31('0x14')]=0x0;this[_0xbf31('0x15')]=0x0;for(var _0x15520a=0x0;_0x15520a=0x0?this[_0xbf31('0x18')]:0x0;var _0x1101e4={'id':this['id'],'available':this[_0xbf31('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xbf31('0x15')],'waiting':this[_0xbf31('0xe')]};var _0x150340=md5(JSON['stringify'](_0x1101e4));if(this[_0xbf31('0x1')]!==_0x150340){this[_0xbf31('0x1')]=_0x150340;io['to'](util[_0xbf31('0x19')](_0xbf31('0x1a'),_0x1101e4[_0xbf31('0x9')]))['emit'](_0xbf31('0x1b'),_0x1101e4);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 39c9a79..9bae142 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 _0xb49b=['online','loggedIn','openchannelPause','available','stringify','openchannel:queue:%s','emit','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','paused','length'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb49b,0x81));var _0xbb49=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xb49b[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xbb49('0x0'));var md5=require(_0xbb49('0x1'));var util=require(_0xbb49('0x2'));var Redis=require(_0xbb49('0x3'));var config=require(_0xbb49('0x4'));config['redis']=_[_0xbb49('0x5')](config[_0xbb49('0x6')],{'host':_0xbb49('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function OpenchannelQueue(_0x7962db){this['id']=_0x7962db['id']||0x0;this[_0xbb49('0x8')]=_0x7962db['name']||'';this[_0xbb49('0x9')]=_0x7962db[_0xbb49('0x9')]||0xa;this[_0xbb49('0xa')]=_0x7962db['strategy']||_0xbb49('0xb');this[_0xbb49('0xc')]=_0x7962db['Agents'];this[_0xbb49('0xd')]={};this[_0xbb49('0xe')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0xbb49('0xf')][_0xbb49('0x10')]=function(){var _0x28cb21=this[_0xbb49('0xd')][_0xbb49('0x11')];this['mapAgentsId']=_[_0xbb49('0x12')](this[_0xbb49('0xc')],'id');this['mapAgentsId'][_0xbb49('0x11')]=_0x28cb21;};OpenchannelQueue[_0xbb49('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xbb49('0x13')]=0x0;for(var _0x4f5fde=0x0;_0x4f5fde=0x0?this[_0xbb49('0x18')]:0x0;var _0x6b3ac7={'id':this['id'],'available':this[_0xbb49('0x18')],'loggedIn':this[_0xbb49('0x16')],'name':this[_0xbb49('0x8')],'paused':this[_0xbb49('0x13')],'waiting':this['waiting']};var _0x5c281e=md5(JSON[_0xbb49('0x19')](_0x6b3ac7));if(this[_0xbb49('0x1')]!==_0x5c281e){this[_0xbb49('0x1')]=_0x5c281e;io['to'](util['format'](_0xbb49('0x1a'),_0x6b3ac7[_0xbb49('0x8')]))[_0xbb49('0x1b')](_0xbb49('0x1c'),_0x6b3ac7);}};module[_0xbb49('0x1d')]=OpenchannelQueue; \ No newline at end of file +var _0xf31f=['updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','openchannelPause','available','waiting','stringify','format','emit','exports','lodash','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf31f,0xb8));var _0xff31=function(_0x4a31b2,_0xa2e5ac){_0x4a31b2=_0x4a31b2-0x0;var _0x13c785=_0xf31f[_0x4a31b2];return _0x13c785;};'use strict';var _=require(_0xff31('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0xff31('0x1'));config['redis']=_[_0xff31('0x2')](config[_0xff31('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xff31('0x4'))(new Redis(config[_0xff31('0x3')]));function OpenchannelQueue(_0x44968e){this['id']=_0x44968e['id']||0x0;this[_0xff31('0x5')]=_0x44968e[_0xff31('0x5')]||'';this[_0xff31('0x6')]=_0x44968e['timeout']||0xa;this['strategy']=_0x44968e[_0xff31('0x7')]||_0xff31('0x8');this[_0xff31('0x9')]=_0x44968e[_0xff31('0x9')];this[_0xff31('0xa')]={};this['waiting']=0x0;this[_0xff31('0xb')]='';this[_0xff31('0xc')]();this[_0xff31('0xd')]();}OpenchannelQueue[_0xff31('0xe')]['updateRouting']=function(){var _0x569b5b=this[_0xff31('0xa')][_0xff31('0xf')];this[_0xff31('0xa')]=_[_0xff31('0x10')](this[_0xff31('0x9')],'id');this[_0xff31('0xa')][_0xff31('0xf')]=_0x569b5b;};OpenchannelQueue[_0xff31('0xe')][_0xff31('0xd')]=function(){this[_0xff31('0x11')]=0x0;this[_0xff31('0x12')]=0x0;for(var _0x32b1f0=0x0;_0x32b1f0=0x0?this[_0xff31('0x16')]:0x0;var _0x37f236={'id':this['id'],'available':this[_0xff31('0x16')],'loggedIn':this[_0xff31('0x11')],'name':this['name'],'paused':this[_0xff31('0x12')],'waiting':this[_0xff31('0x17')]};var _0x31a12b=md5(JSON[_0xff31('0x18')](_0x37f236));if(this[_0xff31('0xb')]!==_0x31a12b){this['md5']=_0x31a12b;io['to'](util[_0xff31('0x19')]('openchannel:queue:%s',_0x37f236['name']))[_0xff31('0x1a')]('openchannel_queue:save',_0x37f236);}};module[_0xff31('0x1b')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index c9cc8e1..e009cd7 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 _0xfabc=['mapAgentsId','_rr','map','loggedIn','paused','length','smsPause','available','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xfabc,0x7d));var _0xcfab=function(_0x451e1f,_0x2d9427){_0x451e1f=_0x451e1f-0x0;var _0x3933c1=_0xfabc[_0x451e1f];return _0x3933c1;};'use strict';var _=require(_0xcfab('0x0'));var md5=require(_0xcfab('0x1'));var util=require('util');var Redis=require(_0xcfab('0x2'));var config=require(_0xcfab('0x3'));config[_0xcfab('0x4')]=_[_0xcfab('0x5')](config[_0xcfab('0x4')],{'host':_0xcfab('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcfab('0x4')]));function SmsQueue(_0xa5a455){this['id']=_0xa5a455['id']||0x0;this[_0xcfab('0x7')]=_0xa5a455[_0xcfab('0x7')]||'';this[_0xcfab('0x8')]=_0xa5a455['timeout']||0xa;this[_0xcfab('0x9')]=_0xa5a455[_0xcfab('0x9')]||'beepall';this[_0xcfab('0xa')]=_0xa5a455[_0xcfab('0xa')];this['mapAgentsId']={};this[_0xcfab('0xb')]=0x0;this[_0xcfab('0x1')]='';this[_0xcfab('0xc')]();this[_0xcfab('0xd')]();}SmsQueue[_0xcfab('0xe')]['updateRouting']=function(){var _0x306a0a=this[_0xcfab('0xf')][_0xcfab('0x10')];this['mapAgentsId']=_[_0xcfab('0x11')](this['Agents'],'id');this[_0xcfab('0xf')][_0xcfab('0x10')]=_0x306a0a;};SmsQueue['prototype'][_0xcfab('0xd')]=function(){this[_0xcfab('0x12')]=0x0;this[_0xcfab('0x13')]=0x0;for(var _0x33258a=0x0;_0x33258a=0x0?this[_0xcfab('0x16')]:0x0;var _0x53df8a={'id':this['id'],'available':this[_0xcfab('0x16')],'loggedIn':this[_0xcfab('0x12')],'name':this[_0xcfab('0x7')],'paused':this[_0xcfab('0x13')],'waiting':this[_0xcfab('0xb')]};var _0xaaab65=md5(JSON['stringify'](_0x53df8a));if(this[_0xcfab('0x1')]!==_0xaaab65){this[_0xcfab('0x1')]=_0xaaab65;io['to'](util[_0xcfab('0x17')](_0xcfab('0x18'),_0x53df8a[_0xcfab('0x7')]))[_0xcfab('0x19')](_0xcfab('0x1a'),_0x53df8a);}};module[_0xcfab('0x1b')]=SmsQueue; \ No newline at end of file +var _0xcfbc=['ioredis','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','_rr','mapAgentsId','map','loggedIn','paused','length','smsPause','available','stringify','sms:queue:%s','emit','lodash','md5','util'];(function(_0x59a628,_0x41988e){var _0x220f4d=function(_0x2b81fa){while(--_0x2b81fa){_0x59a628['push'](_0x59a628['shift']());}};_0x220f4d(++_0x41988e);}(_0xcfbc,0x141));var _0xccfb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcfbc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xccfb('0x0'));var md5=require(_0xccfb('0x1'));var util=require(_0xccfb('0x2'));var Redis=require(_0xccfb('0x3'));var config=require('../../../config/environment');config[_0xccfb('0x4')]=_[_0xccfb('0x5')](config[_0xccfb('0x4')],{'host':_0xccfb('0x6'),'port':0x18eb});var io=require(_0xccfb('0x7'))(new Redis(config['redis']));function SmsQueue(_0x49a845){this['id']=_0x49a845['id']||0x0;this[_0xccfb('0x8')]=_0x49a845['name']||'';this['timeout']=_0x49a845['timeout']||0xa;this[_0xccfb('0x9')]=_0x49a845[_0xccfb('0x9')]||_0xccfb('0xa');this['Agents']=_0x49a845[_0xccfb('0xb')];this['mapAgentsId']={};this[_0xccfb('0xc')]=0x0;this[_0xccfb('0x1')]='';this['updateRouting']();this[_0xccfb('0xd')]();}SmsQueue[_0xccfb('0xe')][_0xccfb('0xf')]=function(){var _0x3127e8=this['mapAgentsId'][_0xccfb('0x10')];this[_0xccfb('0x11')]=_[_0xccfb('0x12')](this[_0xccfb('0xb')],'id');this[_0xccfb('0x11')][_0xccfb('0x10')]=_0x3127e8;};SmsQueue['prototype']['updateRealtime']=function(){this[_0xccfb('0x13')]=0x0;this[_0xccfb('0x14')]=0x0;for(var _0x142a14=0x0;_0x142a14=0x0?this['available']:0x0;var _0x4b2802={'id':this['id'],'available':this[_0xccfb('0x17')],'loggedIn':this[_0xccfb('0x13')],'name':this[_0xccfb('0x8')],'paused':this[_0xccfb('0x14')],'waiting':this[_0xccfb('0xc')]};var _0xe839d=md5(JSON[_0xccfb('0x18')](_0x4b2802));if(this[_0xccfb('0x1')]!==_0xe839d){this[_0xccfb('0x1')]=_0xe839d;io['to'](util['format'](_0xccfb('0x19'),_0x4b2802['name']))[_0xccfb('0x1a')]('sms_queue:save',_0x4b2802);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index cd0fbea..63e1748 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 _0xfee8=['chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','mapKeys','hasOwnProperty','length','isUndefined','mergeFromDatabase','prototype','initIntervals','openchannelQueues','updateRouting','updateRealtime','initChatQueues','initFaxQueues','exports','util','lodash','moment','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','chatQueues','smsQueues','mailQueues','faxQueues'];(function(_0x3b19c4,_0x2fefcf){var _0x309b7c=function(_0x3ca719){while(--_0x3ca719){_0x3b19c4['push'](_0x3b19c4['shift']());}};_0x309b7c(++_0x2fefcf);}(_0xfee8,0x195));var _0x8fee=function(_0xb82940,_0x530318){_0xb82940=_0xb82940-0x0;var _0x2e152a=_0xfee8[_0xb82940];return _0x2e152a;};'use strict';var BPromise=require('bluebird');var util=require(_0x8fee('0x0'));var _=require(_0x8fee('0x1'));var moment=require(_0x8fee('0x2'));var Agent=require('../model/agent');var Interval=require(_0x8fee('0x3'));var OpenchannelQueue=require(_0x8fee('0x4'));var ChatQueue=require(_0x8fee('0x5'));var SmsQueue=require(_0x8fee('0x6'));var MailQueue=require(_0x8fee('0x7'));var FaxQueue=require(_0x8fee('0x8'));var Realtime=function(){this[_0x8fee('0x9')]={};this[_0x8fee('0xa')]={};this['openchannelQueues']={};this[_0x8fee('0xb')]={};this[_0x8fee('0xc')]={};this[_0x8fee('0xd')]={};this[_0x8fee('0xe')]={};this[_0x8fee('0xf')]={};this[_0x8fee('0x10')]={};this['openchannelQueuesWaitingInteractions']={};this['smsQueuesWaitingInteractions']={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x290941,_0x2cfc9b,_0x2ae9d8){var _0x55ac9e=_[_0x8fee('0x11')](_0x290941,function(_0x31983a,_0x3e6953){return _0x31983a[_0x2ae9d8];});for(var _0x5cafab in _0x2cfc9b){if(_0x2cfc9b[_0x8fee('0x12')](_0x5cafab)){if(!_0x55ac9e[_0x5cafab]){delete _0x2cfc9b[_0x5cafab];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x596431,_0x462166){for(var _0x4e93dd in _0x462166){if(_0x596431[_0x8fee('0x12')](_0x4e93dd)){_0x596431[_0x4e93dd]=_0x462166[_0x4e93dd];}}};Realtime['prototype']['initAgents']=function(){var _0x21b591=this;return function(_0x42ed35){if(_0x42ed35){freeIsNotKey(_0x42ed35,_0x21b591[_0x8fee('0x9')],'id');for(var _0x2fc2c7=0x0,_0x597a17={},_0x49bcc6={};_0x2fc2c7<_0x42ed35[_0x8fee('0x13')];_0x2fc2c7+=0x1){_0x597a17=_0x42ed35[_0x2fc2c7];if(_[_0x8fee('0x14')](_0x21b591[_0x8fee('0x9')][_0x597a17['id']])){_0x21b591[_0x8fee('0x9')][_0x597a17['id']]=new Agent(_0x597a17);}else{_0x21b591[_0x8fee('0x15')](_0x21b591[_0x8fee('0x9')][_0x597a17['id']],_0x597a17);}}}return _0x21b591[_0x8fee('0x9')];};};Realtime[_0x8fee('0x16')][_0x8fee('0x17')]=function(){var _0x42cb46=this;return function(_0x234acf){if(_0x234acf){freeIsNotKey(_0x234acf,_0x42cb46[_0x8fee('0xa')],'id');for(var _0xa2c525=0x0,_0x3a5289={},_0x2cca1d={};_0xa2c525<_0x234acf[_0x8fee('0x13')];_0xa2c525+=0x1){_0x3a5289=_0x234acf[_0xa2c525];if(_['isUndefined'](_0x42cb46[_0x8fee('0xa')][_0x3a5289['id']])){_0x42cb46[_0x8fee('0xa')][_0x3a5289['id']]=new Interval(_0x3a5289);}else{_0x42cb46[_0x8fee('0x15')](_0x42cb46[_0x8fee('0xa')][_0x3a5289['id']],_0x3a5289);}}}return _0x42cb46[_0x8fee('0xa')];};};Realtime[_0x8fee('0x16')]['initOpenchannelQueues']=function(){var _0x57b715=this;return function(_0x561c4e){if(_0x561c4e){freeIsNotKey(_0x561c4e,_0x57b715[_0x8fee('0x18')],'id');for(var _0x1bd368=0x0,_0x38c3d2={},_0x281917={};_0x1bd368<_0x561c4e[_0x8fee('0x13')];_0x1bd368+=0x1){_0x38c3d2=_0x561c4e[_0x1bd368];if(_[_0x8fee('0x14')](_0x57b715[_0x8fee('0x18')][_0x38c3d2['id']])){_0x57b715[_0x8fee('0x18')][_0x38c3d2['id']]=new OpenchannelQueue(_0x38c3d2);}else{_0x57b715['mergeFromDatabase'](_0x57b715[_0x8fee('0x18')][_0x38c3d2['id']],_0x38c3d2);}_0x57b715[_0x8fee('0x18')][_0x38c3d2['id']][_0x8fee('0x19')]();_0x57b715[_0x8fee('0x18')][_0x38c3d2['id']][_0x8fee('0x1a')]();}}return _0x57b715[_0x8fee('0x18')];};};Realtime[_0x8fee('0x16')][_0x8fee('0x1b')]=function(){var _0xecaf8=this;return function(_0x1369ab){if(_0x1369ab){freeIsNotKey(_0x1369ab,_0xecaf8['chatQueues'],'id');for(var _0x3cb652=0x0,_0xe2efe0={},_0x33f5c9={};_0x3cb652<_0x1369ab[_0x8fee('0x13')];_0x3cb652+=0x1){_0xe2efe0=_0x1369ab[_0x3cb652];if(_[_0x8fee('0x14')](_0xecaf8[_0x8fee('0xb')][_0xe2efe0['id']])){_0xecaf8['chatQueues'][_0xe2efe0['id']]=new ChatQueue(_0xe2efe0);}else{_0xecaf8['mergeFromDatabase'](_0xecaf8[_0x8fee('0xb')][_0xe2efe0['id']],_0xe2efe0);}_0xecaf8[_0x8fee('0xb')][_0xe2efe0['id']][_0x8fee('0x19')]();_0xecaf8[_0x8fee('0xb')][_0xe2efe0['id']]['updateRealtime']();}}return _0xecaf8[_0x8fee('0xb')];};};Realtime['prototype']['initSmsQueues']=function(){var _0x1561c5=this;return function(_0x5a895c){if(_0x5a895c){freeIsNotKey(_0x5a895c,_0x1561c5[_0x8fee('0xc')],'id');for(var _0xd5157e=0x0,_0x529d07={},_0x27dd15={};_0xd5157e<_0x5a895c[_0x8fee('0x13')];_0xd5157e+=0x1){_0x529d07=_0x5a895c[_0xd5157e];if(_[_0x8fee('0x14')](_0x1561c5[_0x8fee('0xc')][_0x529d07['id']])){_0x1561c5['smsQueues'][_0x529d07['id']]=new SmsQueue(_0x529d07);}else{_0x1561c5[_0x8fee('0x15')](_0x1561c5[_0x8fee('0xc')][_0x529d07['id']],_0x529d07);}_0x1561c5[_0x8fee('0xc')][_0x529d07['id']][_0x8fee('0x19')]();_0x1561c5['smsQueues'][_0x529d07['id']][_0x8fee('0x1a')]();}}return _0x1561c5[_0x8fee('0xc')];};};Realtime[_0x8fee('0x16')]['initMailQueues']=function(){var _0x5d3ffb=this;return function(_0x74d300){if(_0x74d300){freeIsNotKey(_0x74d300,_0x5d3ffb['mailQueues'],'id');for(var _0x3bbbe2=0x0,_0x1eec24={},_0x30dd29={};_0x3bbbe2<_0x74d300['length'];_0x3bbbe2+=0x1){_0x1eec24=_0x74d300[_0x3bbbe2];if(_[_0x8fee('0x14')](_0x5d3ffb[_0x8fee('0xd')][_0x1eec24['id']])){_0x5d3ffb[_0x8fee('0xd')][_0x1eec24['id']]=new MailQueue(_0x1eec24);}else{_0x5d3ffb[_0x8fee('0x15')](_0x5d3ffb[_0x8fee('0xd')][_0x1eec24['id']],_0x1eec24);}_0x5d3ffb['mailQueues'][_0x1eec24['id']][_0x8fee('0x19')]();_0x5d3ffb[_0x8fee('0xd')][_0x1eec24['id']][_0x8fee('0x1a')]();}}return _0x5d3ffb[_0x8fee('0xd')];};};Realtime[_0x8fee('0x16')][_0x8fee('0x1c')]=function(){var _0x2621eb=this;return function(_0x4f9824){if(_0x4f9824){freeIsNotKey(_0x4f9824,_0x2621eb[_0x8fee('0xe')],'id');for(var _0x182eca=0x0,_0x168aa4={},_0xbc9904={};_0x182eca<_0x4f9824['length'];_0x182eca+=0x1){_0x168aa4=_0x4f9824[_0x182eca];if(_[_0x8fee('0x14')](_0x2621eb[_0x8fee('0xe')][_0x168aa4['id']])){_0x2621eb[_0x8fee('0xe')][_0x168aa4['id']]=new FaxQueue(_0x168aa4);}else{_0x2621eb['mergeFromDatabase'](_0x2621eb[_0x8fee('0xe')][_0x168aa4['id']],_0x168aa4);}_0x2621eb[_0x8fee('0xe')][_0x168aa4['id']]['updateRouting']();_0x2621eb[_0x8fee('0xe')][_0x168aa4['id']][_0x8fee('0x1a')]();}}return _0x2621eb[_0x8fee('0xe')];};};module[_0x8fee('0x1d')]=Realtime; \ No newline at end of file +var _0x56b8=['chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','mergeFromDatabase','prototype','initAgents','agents','length','isUndefined','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','smsQueues','initFaxQueues','bluebird','util','lodash','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','intervals','openchannelQueues','chatQueues','mailQueues','faxQueues'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x56b8,0x73));var _0x856b=function(_0xc9396b,_0x734ceb){_0xc9396b=_0xc9396b-0x0;var _0x56d6ee=_0x56b8[_0xc9396b];return _0x56d6ee;};'use strict';var BPromise=require(_0x856b('0x0'));var util=require(_0x856b('0x1'));var _=require(_0x856b('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require('../model/interval');var OpenchannelQueue=require(_0x856b('0x3'));var ChatQueue=require(_0x856b('0x4'));var SmsQueue=require(_0x856b('0x5'));var MailQueue=require(_0x856b('0x6'));var FaxQueue=require(_0x856b('0x7'));var Realtime=function(){this['agents']={};this[_0x856b('0x8')]={};this[_0x856b('0x9')]={};this[_0x856b('0xa')]={};this['smsQueues']={};this[_0x856b('0xb')]={};this[_0x856b('0xc')]={};this[_0x856b('0xd')]={};this[_0x856b('0xe')]={};this[_0x856b('0xf')]={};this[_0x856b('0x10')]={};this[_0x856b('0x11')]={};};function freeIsNotKey(_0x379da1,_0xfae325,_0x16e1ad){var _0x2c6016=_['mapKeys'](_0x379da1,function(_0x40355e,_0x2223d5){return _0x40355e[_0x16e1ad];});for(var _0x5837d6 in _0xfae325){if(_0xfae325[_0x856b('0x12')](_0x5837d6)){if(!_0x2c6016[_0x5837d6]){delete _0xfae325[_0x5837d6];}}}}Realtime['prototype'][_0x856b('0x13')]=function(_0x518b8f,_0x57f762){for(var _0x228134 in _0x57f762){if(_0x518b8f['hasOwnProperty'](_0x228134)){_0x518b8f[_0x228134]=_0x57f762[_0x228134];}}};Realtime[_0x856b('0x14')][_0x856b('0x15')]=function(){var _0x4a0e56=this;return function(_0x54e63b){if(_0x54e63b){freeIsNotKey(_0x54e63b,_0x4a0e56[_0x856b('0x16')],'id');for(var _0x166a57=0x0,_0x118d98={},_0x2eea55={};_0x166a57<_0x54e63b[_0x856b('0x17')];_0x166a57+=0x1){_0x118d98=_0x54e63b[_0x166a57];if(_[_0x856b('0x18')](_0x4a0e56['agents'][_0x118d98['id']])){_0x4a0e56[_0x856b('0x16')][_0x118d98['id']]=new Agent(_0x118d98);}else{_0x4a0e56['mergeFromDatabase'](_0x4a0e56[_0x856b('0x16')][_0x118d98['id']],_0x118d98);}}}return _0x4a0e56[_0x856b('0x16')];};};Realtime[_0x856b('0x14')][_0x856b('0x19')]=function(){var _0x3415ef=this;return function(_0x9fe9b0){if(_0x9fe9b0){freeIsNotKey(_0x9fe9b0,_0x3415ef['intervals'],'id');for(var _0x2fcb6b=0x0,_0x444839={},_0x22c5c4={};_0x2fcb6b<_0x9fe9b0[_0x856b('0x17')];_0x2fcb6b+=0x1){_0x444839=_0x9fe9b0[_0x2fcb6b];if(_[_0x856b('0x18')](_0x3415ef[_0x856b('0x8')][_0x444839['id']])){_0x3415ef['intervals'][_0x444839['id']]=new Interval(_0x444839);}else{_0x3415ef[_0x856b('0x13')](_0x3415ef['intervals'][_0x444839['id']],_0x444839);}}}return _0x3415ef[_0x856b('0x8')];};};Realtime[_0x856b('0x14')][_0x856b('0x1a')]=function(){var _0x2ac30d=this;return function(_0x331095){if(_0x331095){freeIsNotKey(_0x331095,_0x2ac30d[_0x856b('0x9')],'id');for(var _0x1b57cb=0x0,_0x980978={},_0xd5a7f6={};_0x1b57cb<_0x331095[_0x856b('0x17')];_0x1b57cb+=0x1){_0x980978=_0x331095[_0x1b57cb];if(_[_0x856b('0x18')](_0x2ac30d[_0x856b('0x9')][_0x980978['id']])){_0x2ac30d[_0x856b('0x9')][_0x980978['id']]=new OpenchannelQueue(_0x980978);}else{_0x2ac30d[_0x856b('0x13')](_0x2ac30d[_0x856b('0x9')][_0x980978['id']],_0x980978);}_0x2ac30d[_0x856b('0x9')][_0x980978['id']][_0x856b('0x1b')]();_0x2ac30d[_0x856b('0x9')][_0x980978['id']][_0x856b('0x1c')]();}}return _0x2ac30d['openchannelQueues'];};};Realtime[_0x856b('0x14')][_0x856b('0x1d')]=function(){var _0x77278e=this;return function(_0x182d26){if(_0x182d26){freeIsNotKey(_0x182d26,_0x77278e[_0x856b('0xa')],'id');for(var _0x4213a4=0x0,_0x59b8f7={},_0x295e84={};_0x4213a4<_0x182d26[_0x856b('0x17')];_0x4213a4+=0x1){_0x59b8f7=_0x182d26[_0x4213a4];if(_[_0x856b('0x18')](_0x77278e[_0x856b('0xa')][_0x59b8f7['id']])){_0x77278e['chatQueues'][_0x59b8f7['id']]=new ChatQueue(_0x59b8f7);}else{_0x77278e[_0x856b('0x13')](_0x77278e[_0x856b('0xa')][_0x59b8f7['id']],_0x59b8f7);}_0x77278e[_0x856b('0xa')][_0x59b8f7['id']][_0x856b('0x1b')]();_0x77278e['chatQueues'][_0x59b8f7['id']][_0x856b('0x1c')]();}}return _0x77278e['chatQueues'];};};Realtime[_0x856b('0x14')]['initSmsQueues']=function(){var _0x279ba3=this;return function(_0x1ee385){if(_0x1ee385){freeIsNotKey(_0x1ee385,_0x279ba3[_0x856b('0x1e')],'id');for(var _0x4772ad=0x0,_0x5287c6={},_0x9af777={};_0x4772ad<_0x1ee385[_0x856b('0x17')];_0x4772ad+=0x1){_0x5287c6=_0x1ee385[_0x4772ad];if(_[_0x856b('0x18')](_0x279ba3[_0x856b('0x1e')][_0x5287c6['id']])){_0x279ba3[_0x856b('0x1e')][_0x5287c6['id']]=new SmsQueue(_0x5287c6);}else{_0x279ba3[_0x856b('0x13')](_0x279ba3[_0x856b('0x1e')][_0x5287c6['id']],_0x5287c6);}_0x279ba3['smsQueues'][_0x5287c6['id']]['updateRouting']();_0x279ba3[_0x856b('0x1e')][_0x5287c6['id']][_0x856b('0x1c')]();}}return _0x279ba3['smsQueues'];};};Realtime[_0x856b('0x14')]['initMailQueues']=function(){var _0x1242c2=this;return function(_0x7afcbe){if(_0x7afcbe){freeIsNotKey(_0x7afcbe,_0x1242c2['mailQueues'],'id');for(var _0x4fbf49=0x0,_0x3a42fc={},_0x27a387={};_0x4fbf49<_0x7afcbe[_0x856b('0x17')];_0x4fbf49+=0x1){_0x3a42fc=_0x7afcbe[_0x4fbf49];if(_['isUndefined'](_0x1242c2[_0x856b('0xb')][_0x3a42fc['id']])){_0x1242c2[_0x856b('0xb')][_0x3a42fc['id']]=new MailQueue(_0x3a42fc);}else{_0x1242c2['mergeFromDatabase'](_0x1242c2[_0x856b('0xb')][_0x3a42fc['id']],_0x3a42fc);}_0x1242c2['mailQueues'][_0x3a42fc['id']][_0x856b('0x1b')]();_0x1242c2[_0x856b('0xb')][_0x3a42fc['id']][_0x856b('0x1c')]();}}return _0x1242c2[_0x856b('0xb')];};};Realtime[_0x856b('0x14')][_0x856b('0x1f')]=function(){var _0x2b843e=this;return function(_0x4781e5){if(_0x4781e5){freeIsNotKey(_0x4781e5,_0x2b843e[_0x856b('0xc')],'id');for(var _0x347639=0x0,_0x307062={},_0x1dc469={};_0x347639<_0x4781e5['length'];_0x347639+=0x1){_0x307062=_0x4781e5[_0x347639];if(_[_0x856b('0x18')](_0x2b843e[_0x856b('0xc')][_0x307062['id']])){_0x2b843e[_0x856b('0xc')][_0x307062['id']]=new FaxQueue(_0x307062);}else{_0x2b843e[_0x856b('0x13')](_0x2b843e[_0x856b('0xc')][_0x307062['id']],_0x307062);}_0x2b843e['faxQueues'][_0x307062['id']][_0x856b('0x1b')]();_0x2b843e[_0x856b('0xc')][_0x307062['id']][_0x856b('0x1c')]();}}return _0x2b843e['faxQueues'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 64e18cd..abfea20 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 _0x5fab=['UpdateChatInteraction','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x5fab,0x15d));var _0xb5fa=function(_0x412376,_0x482fc2){_0x412376=_0x412376-0x0;var _0xae59bf=_0x5fab[_0x412376];return _0xae59bf;};'use strict';var client=require(_0xb5fa('0x0'));exports['update']=function(_0x31b3c7,_0x2da5c2){return client['Request'](_0xb5fa('0x1'),{'body':_0x2da5c2,'options':{'where':{'id':_0x31b3c7}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x262cb7,_0x1df9a5){return client[_0xb5fa('0x2')](_0xb5fa('0x3'),{'body':_0x1df9a5,'options':{'where':{'id':_0x262cb7}},'log':_0xb5fa('0x4')});}; \ No newline at end of file +var _0xeb32=['updateChatInteraction','addTags','AddTagsToChatInteraction','Request'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xeb32,0x1b3));var _0x2eb3=function(_0x1eb570,_0x49610d){_0x1eb570=_0x1eb570-0x0;var _0x434cc1=_0xeb32[_0x1eb570];return _0x434cc1;};'use strict';var client=require('../client');exports['update']=function(_0x3c2cd5,_0x4b9834){return client[_0x2eb3('0x0')]('UpdateChatInteraction',{'body':_0x4b9834,'options':{'where':{'id':_0x3c2cd5}},'log':_0x2eb3('0x1')});};exports[_0x2eb3('0x2')]=function(_0x401664,_0x22ea03){return client['Request'](_0x2eb3('0x3'),{'body':_0x22ea03,'options':{'where':{'id':_0x401664}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 693008d..0a35728 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 _0x7a09=['create','Request','CreateChatMessage','createChatMessage'];(function(_0x3ddc08,_0x394e4a){var _0x3984a3=function(_0x1094d2){while(--_0x1094d2){_0x3ddc08['push'](_0x3ddc08['shift']());}};_0x3984a3(++_0x394e4a);}(_0x7a09,0x180));var _0x97a0=function(_0x440464,_0xb7afd8){_0x440464=_0x440464-0x0;var _0x2f4043=_0x7a09[_0x440464];return _0x2f4043;};'use strict';var client=require('../client');exports[_0x97a0('0x0')]=function(_0x199735){return client[_0x97a0('0x1')](_0x97a0('0x2'),{'body':_0x199735,'log':_0x97a0('0x3')});}; \ No newline at end of file +var _0x8123=['create','Request','createChatMessage'];(function(_0x341569,_0x1edec3){var _0x2cb5c7=function(_0x50dafc){while(--_0x50dafc){_0x341569['push'](_0x341569['shift']());}};_0x2cb5c7(++_0x1edec3);}(_0x8123,0x198));var _0x3812=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x8123[_0x1b4b23];return _0x2a325b;};'use strict';var client=require('../client');exports[_0x3812('0x0')]=function(_0x159bce){return client[_0x3812('0x1')]('CreateChatMessage',{'body':_0x159bce,'log':_0x3812('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index a94023a..29bc794 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 _0xccae=['timeout','strategy','User','online','chatPause','../client','getChatQueues','GetChatQueue','name'];(function(_0x3db4bd,_0x2ade34){var _0xa31e89=function(_0x4c8c46){while(--_0x4c8c46){_0x3db4bd['push'](_0x3db4bd['shift']());}};_0xa31e89(++_0x2ade34);}(_0xccae,0xd4));var _0xecca=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xccae[_0x4ff09b];return _0x3f5c2e;};'use strict';var client=require(_0xecca('0x0'));exports[_0xecca('0x1')]=function(){return function(){return client['Request'](_0xecca('0x2'),{'options':{'raw':![],'attributes':['id',_0xecca('0x3'),_0xecca('0x4'),_0xecca('0x5')],'include':[{'model':_0xecca('0x6'),'as':'Agents','attributes':['id',_0xecca('0x3'),_0xecca('0x7'),_0xecca('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x9d88=['online','getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy','User','Agents'];(function(_0x1fa447,_0x2c7d2e){var _0x31b39e=function(_0x1e7dd7){while(--_0x1e7dd7){_0x1fa447['push'](_0x1fa447['shift']());}};_0x31b39e(++_0x2c7d2e);}(_0x9d88,0x1d8));var _0x89d8=function(_0x1109c3,_0x12f183){_0x1109c3=_0x1109c3-0x0;var _0x3d206d=_0x9d88[_0x1109c3];return _0x3d206d;};'use strict';var client=require(_0x89d8('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x89d8('0x1')](_0x89d8('0x2'),{'options':{'raw':![],'attributes':['id',_0x89d8('0x3'),_0x89d8('0x4'),_0x89d8('0x5')],'include':[{'model':_0x89d8('0x6'),'as':_0x89d8('0x7'),'attributes':['id','name',_0x89d8('0x8'),'chatPause']}]},'log':_0x89d8('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 9fa81e8..892f609 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 _0x94dc=['Request','UpdateChatQueueReport','DESC','../client','CreateChatQueueReport','update'];(function(_0x2f41dd,_0x5bd3a1){var _0x3b377d=function(_0x3bd677){while(--_0x3bd677){_0x2f41dd['push'](_0x2f41dd['shift']());}};_0x3b377d(++_0x5bd3a1);}(_0x94dc,0xb1));var _0xc94d=function(_0x5a51bc,_0x1bbba){_0x5a51bc=_0x5a51bc-0x0;var _0x582cf5=_0x94dc[_0x5a51bc];return _0x582cf5;};'use strict';var client=require(_0xc94d('0x0'));exports['create']=function(_0x2d9149){return client['Request'](_0xc94d('0x1'),{'body':_0x2d9149,'log':_0xc94d('0x1')});};exports[_0xc94d('0x2')]=function(_0x4b2dcc,_0x306706){return client[_0xc94d('0x3')](_0xc94d('0x4'),{'body':_0x306706,'options':{'where':{'uniqueid':_0x4b2dcc},'order':[['id',_0xc94d('0x5')]],'limit':0x1},'log':_0xc94d('0x4')});}; \ No newline at end of file +var _0x562d=['update','Request','UpdateChatQueueReport','../client','create','CreateChatQueueReport'];(function(_0x5b386b,_0x3b27cc){var _0x3716e5=function(_0x5c9141){while(--_0x5c9141){_0x5b386b['push'](_0x5b386b['shift']());}};_0x3716e5(++_0x3b27cc);}(_0x562d,0xe1));var _0xd562=function(_0x4f256c,_0x5f45bf){_0x4f256c=_0x4f256c-0x0;var _0x4d059d=_0x562d[_0x4f256c];return _0x4d059d;};'use strict';var client=require(_0xd562('0x0'));exports[_0xd562('0x1')]=function(_0x41a5c7){return client['Request']('CreateChatQueueReport',{'body':_0x41a5c7,'log':_0xd562('0x2')});};exports[_0xd562('0x3')]=function(_0x73c3fa,_0x4c6430){return client[_0xd562('0x4')]('UpdateChatQueueReport',{'body':_0x4c6430,'options':{'where':{'uniqueid':_0x73c3fa},'order':[['id','DESC']],'limit':0x1},'log':_0xd562('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index b8a13f0..48a2ff4 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 _0xb892=['addTagsToFaxInteraction','../client','update','Request','AddTagsToFaxInteraction'];(function(_0x4697f2,_0x1de28e){var _0x147729=function(_0x1f4241){while(--_0x1f4241){_0x4697f2['push'](_0x4697f2['shift']());}};_0x147729(++_0x1de28e);}(_0xb892,0x141));var _0x2b89=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xb892[_0x101e7b];return _0x4995c0;};'use strict';var client=require(_0x2b89('0x0'));exports[_0x2b89('0x1')]=function(_0xff1f14,_0x83ce94){return client[_0x2b89('0x2')]('UpdateFaxInteraction',{'body':_0x83ce94,'options':{'where':{'id':_0xff1f14}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x532062,_0x9dce7e){return client[_0x2b89('0x2')](_0x2b89('0x3'),{'body':_0x9dce7e,'options':{'where':{'id':_0x532062}},'log':_0x2b89('0x4')});}; \ No newline at end of file +var _0xfa92=['addTagsToFaxInteraction','../client','update','Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction'];(function(_0x1d9bea,_0x5b9813){var _0x51b5b4=function(_0x2adcd9){while(--_0x2adcd9){_0x1d9bea['push'](_0x1d9bea['shift']());}};_0x51b5b4(++_0x5b9813);}(_0xfa92,0xcc));var _0x2fa9=function(_0xc77439,_0x2ea48d){_0xc77439=_0xc77439-0x0;var _0x3e2655=_0xfa92[_0xc77439];return _0x3e2655;};'use strict';var client=require(_0x2fa9('0x0'));exports[_0x2fa9('0x1')]=function(_0x554b92,_0x482c36){return client[_0x2fa9('0x2')](_0x2fa9('0x3'),{'body':_0x482c36,'options':{'where':{'id':_0x554b92}},'log':'updateFaxInteraction'});};exports[_0x2fa9('0x4')]=function(_0x1b1649,_0x4a4e53){return client[_0x2fa9('0x2')](_0x2fa9('0x5'),{'body':_0x4a4e53,'options':{'where':{'id':_0x1b1649}},'log':_0x2fa9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 2b918a9..e55a496 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 _0x1d94=['createFaxMessage','../client','Request','CreateFaxMessage'];(function(_0x4e7ae4,_0x434fc4){var _0x50fd9c=function(_0xcb64ec){while(--_0xcb64ec){_0x4e7ae4['push'](_0x4e7ae4['shift']());}};_0x50fd9c(++_0x434fc4);}(_0x1d94,0x165));var _0x41d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d94[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x41d9('0x0'));exports['create']=function(_0x2b40c4){return client[_0x41d9('0x1')](_0x41d9('0x2'),{'body':_0x2b40c4,'log':_0x41d9('0x3')});}; \ No newline at end of file +var _0x9d7e=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x401d37,_0xff8d27){var _0x511606=function(_0x3bf5d0){while(--_0x3bf5d0){_0x401d37['push'](_0x401d37['shift']());}};_0x511606(++_0xff8d27);}(_0x9d7e,0x193));var _0xe9d7=function(_0x1fc99c,_0x290e7d){_0x1fc99c=_0x1fc99c-0x0;var _0x199774=_0x9d7e[_0x1fc99c];return _0x199774;};'use strict';var client=require(_0xe9d7('0x0'));exports[_0xe9d7('0x1')]=function(_0x4b5ebb){return client[_0xe9d7('0x2')](_0xe9d7('0x3'),{'body':_0x4b5ebb,'log':_0xe9d7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 67dd052..ef724a8 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 _0x1abe=['faxPause','getFaxQueues','Request','name','timeout','User','Agents','online'];(function(_0x5d897a,_0x1c11ad){var _0x48ecc6=function(_0x46777e){while(--_0x46777e){_0x5d897a['push'](_0x5d897a['shift']());}};_0x48ecc6(++_0x1c11ad);}(_0x1abe,0x181));var _0xe1ab=function(_0x3cc118,_0x15354a){_0x3cc118=_0x3cc118-0x0;var _0x398fb0=_0x1abe[_0x3cc118];return _0x398fb0;};'use strict';var client=require('../client');exports[_0xe1ab('0x0')]=function(){return function(){return client[_0xe1ab('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xe1ab('0x2'),_0xe1ab('0x3'),'strategy'],'include':[{'model':_0xe1ab('0x4'),'as':_0xe1ab('0x5'),'attributes':['id',_0xe1ab('0x2'),_0xe1ab('0x6'),_0xe1ab('0x7')]}]},'log':_0xe1ab('0x0')});};}; \ No newline at end of file +var _0xe513=['faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','User','Agents','online'];(function(_0x197d72,_0x19b07b){var _0x1e3507=function(_0x34e0b6){while(--_0x34e0b6){_0x197d72['push'](_0x197d72['shift']());}};_0x1e3507(++_0x19b07b);}(_0xe513,0x6f));var _0x3e51=function(_0x20c385,_0x5aa716){_0x20c385=_0x20c385-0x0;var _0x5e5e69=_0xe513[_0x20c385];return _0x5e5e69;};'use strict';var client=require(_0x3e51('0x0'));exports[_0x3e51('0x1')]=function(){return function(){return client[_0x3e51('0x2')](_0x3e51('0x3'),{'options':{'raw':![],'attributes':['id',_0x3e51('0x4'),_0x3e51('0x5'),'strategy'],'include':[{'model':_0x3e51('0x6'),'as':_0x3e51('0x7'),'attributes':['id',_0x3e51('0x4'),_0x3e51('0x8'),_0x3e51('0x9')]}]},'log':_0x3e51('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index cc1b6d9..561dedd 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 _0xed39=['CreateFaxQueueReport','update','../client','create','Request'];(function(_0x46390e,_0x39d20f){var _0x4db91c=function(_0x2bd91e){while(--_0x2bd91e){_0x46390e['push'](_0x46390e['shift']());}};_0x4db91c(++_0x39d20f);}(_0xed39,0xa7));var _0x9ed3=function(_0x5976bc,_0x4d0857){_0x5976bc=_0x5976bc-0x0;var _0x5d6df5=_0xed39[_0x5976bc];return _0x5d6df5;};'use strict';var client=require(_0x9ed3('0x0'));exports[_0x9ed3('0x1')]=function(_0x431f0c){return client[_0x9ed3('0x2')](_0x9ed3('0x3'),{'body':_0x431f0c,'log':'CreateFaxQueueReport'});};exports[_0x9ed3('0x4')]=function(_0x4af642,_0x4d7d13){return client[_0x9ed3('0x2')]('UpdateFaxQueueReport',{'body':_0x4d7d13,'options':{'where':{'uniqueid':_0x4af642},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x5af9=['CreateFaxQueueReport','Request','DESC','UpdateFaxQueueReport','../client','create'];(function(_0x16fd68,_0x3d394d){var _0x12cf8e=function(_0x4728c1){while(--_0x4728c1){_0x16fd68['push'](_0x16fd68['shift']());}};_0x12cf8e(++_0x3d394d);}(_0x5af9,0xdc));var _0x95af=function(_0x3f465d,_0xbd2037){_0x3f465d=_0x3f465d-0x0;var _0x121ad1=_0x5af9[_0x3f465d];return _0x121ad1;};'use strict';var client=require(_0x95af('0x0'));exports[_0x95af('0x1')]=function(_0x2684a9){return client['Request'](_0x95af('0x2'),{'body':_0x2684a9,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x3fe14a,_0x111852){return client[_0x95af('0x3')]('UpdateFaxQueueReport',{'body':_0x111852,'options':{'where':{'uniqueid':_0x3fe14a},'order':[['id',_0x95af('0x4')]],'limit':0x1},'log':_0x95af('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 28e3021..857f7d6 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 _0xcae2=['Interval','Intervals','interval','../client','getIntervals','Request','GetInterval','name'];(function(_0x2c4d9f,_0x266437){var _0x3c558a=function(_0xe83d03){while(--_0xe83d03){_0x2c4d9f['push'](_0x2c4d9f['shift']());}};_0x3c558a(++_0x266437);}(_0xcae2,0x143));var _0x2cae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcae2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x2cae('0x0'));exports[_0x2cae('0x1')]=function(){return function(){return client[_0x2cae('0x2')](_0x2cae('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2cae('0x4')],'include':[{'model':_0x2cae('0x5'),'as':_0x2cae('0x6'),'attributes':['id','name',_0x2cae('0x7')]}]},'log':_0x2cae('0x1')});};}; \ No newline at end of file +var _0xb9a7=['name','interval','getIntervals','Interval'];(function(_0x2d2f5b,_0x183036){var _0x338eae=function(_0x239742){while(--_0x239742){_0x2d2f5b['push'](_0x2d2f5b['shift']());}};_0x338eae(++_0x183036);}(_0xb9a7,0x112));var _0x7b9a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xb9a7[_0xaa1b3e];return _0x454d7d;};'use strict';var client=require('../client');exports[_0x7b9a('0x0')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x7b9a('0x1'),'as':'Intervals','attributes':['id',_0x7b9a('0x2'),_0x7b9a('0x3')]}]},'log':_0x7b9a('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 126cab4..f344036 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 _0xc0e8=['updateMailInteraction','addTags','Request','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update'];(function(_0x173b24,_0x441c58){var _0x16c677=function(_0x4c37ef){while(--_0x4c37ef){_0x173b24['push'](_0x173b24['shift']());}};_0x16c677(++_0x441c58);}(_0xc0e8,0x91));var _0x8c0e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc0e8[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x8c0e('0x0'));exports[_0x8c0e('0x1')]=function(_0x31623d,_0x593dd7){return client['Request']('UpdateMailInteraction',{'body':_0x593dd7,'options':{'where':{'id':_0x31623d}},'log':_0x8c0e('0x2')});};exports[_0x8c0e('0x3')]=function(_0x2f657e,_0x2385d7){return client[_0x8c0e('0x4')](_0x8c0e('0x5'),{'body':_0x2385d7,'options':{'where':{'id':_0x2f657e}},'log':_0x8c0e('0x6')});}; \ No newline at end of file +var _0x59a9=['UpdateMailInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x1fae4c,_0x838a24){var _0x2c8527=function(_0x44d238){while(--_0x44d238){_0x1fae4c['push'](_0x1fae4c['shift']());}};_0x2c8527(++_0x838a24);}(_0x59a9,0x1af));var _0x959a=function(_0x164d9b,_0x11157a){_0x164d9b=_0x164d9b-0x0;var _0x3f52f2=_0x59a9[_0x164d9b];return _0x3f52f2;};'use strict';var client=require(_0x959a('0x0'));exports['update']=function(_0x5a07cf,_0x35b78e){return client['Request'](_0x959a('0x1'),{'body':_0x35b78e,'options':{'where':{'id':_0x5a07cf}},'log':'updateMailInteraction'});};exports[_0x959a('0x2')]=function(_0x3d2e4e,_0xa07682){return client['Request']('AddTagsToMailInteraction',{'body':_0xa07682,'options':{'where':{'id':_0x3d2e4e}},'log':_0x959a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 49c7eb0..450258e 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 _0xfb2c=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x3b7a0c,_0xf1a4c2){var _0x3bb70f=function(_0x248b52){while(--_0x248b52){_0x3b7a0c['push'](_0x3b7a0c['shift']());}};_0x3bb70f(++_0xf1a4c2);}(_0xfb2c,0x141));var _0xcfb2=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xfb2c[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0xcfb2('0x0'));exports[_0xcfb2('0x1')]=function(_0x54ae1f){return client[_0xcfb2('0x2')](_0xcfb2('0x3'),{'body':_0x54ae1f,'log':_0xcfb2('0x4')});}; \ No newline at end of file +var _0xfc12=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x1b8dfe,_0x219e70){var _0x36644c=function(_0x5d8b6f){while(--_0x5d8b6f){_0x1b8dfe['push'](_0x1b8dfe['shift']());}};_0x36644c(++_0x219e70);}(_0xfc12,0x1f2));var _0x2fc1=function(_0x222ab8,_0x4b95f2){_0x222ab8=_0x222ab8-0x0;var _0x52fba9=_0xfc12[_0x222ab8];return _0x52fba9;};'use strict';var client=require(_0x2fc1('0x0'));exports[_0x2fc1('0x1')]=function(_0x33234d){return client[_0x2fc1('0x2')](_0x2fc1('0x3'),{'body':_0x33234d,'log':_0x2fc1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 87d317d..e2da6ea 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 _0x30c9=['name','online','../client','getMailQueues','Request','GetMailQueue','timeout','Agents'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x30c9,0x11a));var _0x930c=function(_0x3361cf,_0x2a6ccc){_0x3361cf=_0x3361cf-0x0;var _0x5471aa=_0x30c9[_0x3361cf];return _0x5471aa;};'use strict';var client=require(_0x930c('0x0'));exports[_0x930c('0x1')]=function(){return function(){return client[_0x930c('0x2')](_0x930c('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x930c('0x4'),'strategy'],'include':[{'model':'User','as':_0x930c('0x5'),'attributes':['id',_0x930c('0x6'),_0x930c('0x7'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x6932=['mailPause','../client','getMailQueues','Request','GetMailQueue','timeout','strategy','User','name'];(function(_0x2073f9,_0x187ba5){var _0x24cbab=function(_0x46d76c){while(--_0x46d76c){_0x2073f9['push'](_0x2073f9['shift']());}};_0x24cbab(++_0x187ba5);}(_0x6932,0x76));var _0x2693=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6932[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x2693('0x0'));exports[_0x2693('0x1')]=function(){return function(){return client[_0x2693('0x2')](_0x2693('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2693('0x4'),_0x2693('0x5')],'include':[{'model':_0x2693('0x6'),'as':'Agents','attributes':['id',_0x2693('0x7'),'online',_0x2693('0x8')]}]},'log':_0x2693('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 13e2923..084f324 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 _0xb444=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xb444,0x9b));var _0x4b44=function(_0x15a4d4,_0x58ce35){_0x15a4d4=_0x15a4d4-0x0;var _0x898fbf=_0xb444[_0x15a4d4];return _0x898fbf;};'use strict';var client=require(_0x4b44('0x0'));exports[_0x4b44('0x1')]=function(_0x5e1618){return client[_0x4b44('0x2')](_0x4b44('0x3'),{'body':_0x5e1618,'log':_0x4b44('0x3')});};exports[_0x4b44('0x4')]=function(_0x5861a5,_0x44755f){return client[_0x4b44('0x2')](_0x4b44('0x5'),{'body':_0x44755f,'options':{'where':{'uniqueid':_0x5861a5},'order':[['id',_0x4b44('0x6')]],'limit':0x1},'log':_0x4b44('0x5')});}; \ No newline at end of file +var _0xd92c=['../client','Request','CreateMailQueueReport','DESC','UpdateMailQueueReport'];(function(_0x24e913,_0xb081ec){var _0x549f17=function(_0xf94a72){while(--_0xf94a72){_0x24e913['push'](_0x24e913['shift']());}};_0x549f17(++_0xb081ec);}(_0xd92c,0xcd));var _0xcd92=function(_0x52d209,_0xe84ae){_0x52d209=_0x52d209-0x0;var _0x317ddc=_0xd92c[_0x52d209];return _0x317ddc;};'use strict';var client=require(_0xcd92('0x0'));exports['create']=function(_0x1036d4){return client[_0xcd92('0x1')](_0xcd92('0x2'),{'body':_0x1036d4,'log':_0xcd92('0x2')});};exports['update']=function(_0x3e0abb,_0x35101c){return client[_0xcd92('0x1')]('UpdateMailQueueReport',{'body':_0x35101c,'options':{'where':{'uniqueid':_0x3e0abb},'order':[['id',_0xcd92('0x3')]],'limit':0x1},'log':_0xcd92('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 1360416..a6f59d8 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 _0x1606=['Request','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x1606,0xa4));var _0x6160=function(_0x2ac697,_0x33c334){_0x2ac697=_0x2ac697-0x0;var _0xcf7a73=_0x1606[_0x2ac697];return _0xcf7a73;};'use strict';var client=require('../client');exports[_0x6160('0x0')]=function(_0x3925e7,_0x1821ac){return client[_0x6160('0x1')]('UpdateOpenchannelInteraction',{'body':_0x1821ac,'options':{'where':{'id':_0x3925e7}},'log':_0x6160('0x2')});};exports['addTags']=function(_0x56886b,_0x58bdcf){return client[_0x6160('0x1')](_0x6160('0x3'),{'body':_0x58bdcf,'options':{'where':{'id':_0x56886b}},'log':_0x6160('0x4')});}; \ No newline at end of file +var _0xf34c=['addTags','addTagsToChatInteraction','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x98265b,_0x351b24){var _0x420891=function(_0x21ced6){while(--_0x21ced6){_0x98265b['push'](_0x98265b['shift']());}};_0x420891(++_0x351b24);}(_0xf34c,0x1d8));var _0xcf34=function(_0x47d2ee,_0x50d75b){_0x47d2ee=_0x47d2ee-0x0;var _0xc4b095=_0xf34c[_0x47d2ee];return _0xc4b095;};'use strict';var client=require('../client');exports['update']=function(_0xfff8f,_0x2cf70e){return client[_0xcf34('0x0')](_0xcf34('0x1'),{'body':_0x2cf70e,'options':{'where':{'id':_0xfff8f}},'log':_0xcf34('0x2')});};exports[_0xcf34('0x3')]=function(_0x2a331c,_0x5e2601){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x5e2601,'options':{'where':{'id':_0x2a331c}},'log':_0xcf34('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 9fa04d9..5c985e8 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 _0xb4e6=['../client','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x2e60b5,_0x138fb4){var _0x460b39=function(_0x4a0678){while(--_0x4a0678){_0x2e60b5['push'](_0x2e60b5['shift']());}};_0x460b39(++_0x138fb4);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xb4e6[_0x35485a];return _0x5148e6;};'use strict';var client=require(_0x6b4e('0x0'));exports['create']=function(_0x2708ca){return client[_0x6b4e('0x1')](_0x6b4e('0x2'),{'body':_0x2708ca,'log':_0x6b4e('0x3')});}; \ No newline at end of file +var _0x0bb5=['../client','create','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x54bb2b,_0x449c21){var _0x905fbf=function(_0x1370b1){while(--_0x1370b1){_0x54bb2b['push'](_0x54bb2b['shift']());}};_0x905fbf(++_0x449c21);}(_0x0bb5,0x148));var _0x50bb=function(_0x3e5c71,_0x1f70bc){_0x3e5c71=_0x3e5c71-0x0;var _0x36a99a=_0x0bb5[_0x3e5c71];return _0x36a99a;};'use strict';var client=require(_0x50bb('0x0'));exports[_0x50bb('0x1')]=function(_0x5e61cf){return client['Request'](_0x50bb('0x2'),{'body':_0x5e61cf,'log':_0x50bb('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index a552801..9dfba08 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 _0x29fe=['Request','GetOpenchannelQueue','timeout','strategy','Agents','name','online','getOpenchannelQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x29fe,0x15f));var _0xe29f=function(_0x55b842,_0x41c19c){_0x55b842=_0x55b842-0x0;var _0x44942b=_0x29fe[_0x55b842];return _0x44942b;};'use strict';var client=require('../client');exports[_0xe29f('0x0')]=function(){return function(){return client[_0xe29f('0x1')](_0xe29f('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xe29f('0x3'),_0xe29f('0x4')],'include':[{'model':'User','as':_0xe29f('0x5'),'attributes':['id',_0xe29f('0x6'),_0xe29f('0x7'),'openchannelPause']}]},'log':_0xe29f('0x0')});};}; \ No newline at end of file +var _0x8baf=['timeout','strategy','User','Agents','online','getOpenchannelQueues','../client','Request','name'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x8baf,0x11d));var _0xf8ba=function(_0xecc200,_0x2a4694){_0xecc200=_0xecc200-0x0;var _0x50ae57=_0x8baf[_0xecc200];return _0x50ae57;};'use strict';var client=require(_0xf8ba('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xf8ba('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xf8ba('0x2'),_0xf8ba('0x3'),_0xf8ba('0x4')],'include':[{'model':_0xf8ba('0x5'),'as':_0xf8ba('0x6'),'attributes':['id',_0xf8ba('0x2'),_0xf8ba('0x7'),'openchannelPause']}]},'log':_0xf8ba('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index e0016db..0816600 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 _0xa415=['DESC','../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x4facf5,_0x5c1718){var _0x4db975=function(_0x43144a){while(--_0x43144a){_0x4facf5['push'](_0x4facf5['shift']());}};_0x4db975(++_0x5c1718);}(_0xa415,0xa3));var _0x5a41=function(_0x598962,_0x2c6198){_0x598962=_0x598962-0x0;var _0x509e7e=_0xa415[_0x598962];return _0x509e7e;};'use strict';var client=require(_0x5a41('0x0'));exports['create']=function(_0x4d46e5){return client[_0x5a41('0x1')]('CreateOpenchannelQueueReport',{'body':_0x4d46e5,'log':_0x5a41('0x2')});};exports[_0x5a41('0x3')]=function(_0x357c59,_0x4d7359){return client[_0x5a41('0x1')](_0x5a41('0x4'),{'body':_0x4d7359,'options':{'where':{'uniqueid':_0x357c59},'order':[['id',_0x5a41('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xab24=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0xab24,0x142));var _0x4ab2=function(_0x1bd4e4,_0x36e230){_0x1bd4e4=_0x1bd4e4-0x0;var _0x5a3f8f=_0xab24[_0x1bd4e4];return _0x5a3f8f;};'use strict';var client=require(_0x4ab2('0x0'));exports[_0x4ab2('0x1')]=function(_0x4dbe9f){return client[_0x4ab2('0x2')](_0x4ab2('0x3'),{'body':_0x4dbe9f,'log':_0x4ab2('0x3')});};exports['update']=function(_0x3fefa6,_0x26c34c){return client['Request'](_0x4ab2('0x4'),{'body':_0x26c34c,'options':{'where':{'uniqueid':_0x3fefa6},'order':[['id','DESC']],'limit':0x1},'log':_0x4ab2('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index c39b88d..179e8b8 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 _0xb168=['../client','Request','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x1b981e,_0x25213a){var _0x34d4d2=function(_0x4ed16b){while(--_0x4ed16b){_0x1b981e['push'](_0x1b981e['shift']());}};_0x34d4d2(++_0x25213a);}(_0xb168,0x14a));var _0x8b16=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xb168[_0x9dfc10];return _0x4f938a;};'use strict';var client=require(_0x8b16('0x0'));exports['update']=function(_0x14e62a,_0x22917b){return client[_0x8b16('0x1')]('UpdateSmsInteraction',{'body':_0x22917b,'options':{'where':{'id':_0x14e62a}},'log':'updateSmsInteraction'});};exports[_0x8b16('0x2')]=function(_0x2535fe,_0x281d4d){return client[_0x8b16('0x1')](_0x8b16('0x3'),{'body':_0x281d4d,'options':{'where':{'id':_0x2535fe}},'log':_0x8b16('0x4')});}; \ No newline at end of file +var _0x8514=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction'];(function(_0x1f0fe2,_0x129728){var _0x571c9d=function(_0x3be341){while(--_0x3be341){_0x1f0fe2['push'](_0x1f0fe2['shift']());}};_0x571c9d(++_0x129728);}(_0x8514,0x93));var _0x4851=function(_0x2d1901,_0x26e6b9){_0x2d1901=_0x2d1901-0x0;var _0x35f2c6=_0x8514[_0x2d1901];return _0x35f2c6;};'use strict';var client=require(_0x4851('0x0'));exports[_0x4851('0x1')]=function(_0x1dd45e,_0xb70d2b){return client[_0x4851('0x2')](_0x4851('0x3'),{'body':_0xb70d2b,'options':{'where':{'id':_0x1dd45e}},'log':_0x4851('0x4')});};exports[_0x4851('0x5')]=function(_0x546b08,_0x5a7429){return client['Request']('AddTagsToSmsInteraction',{'body':_0x5a7429,'options':{'where':{'id':_0x546b08}},'log':_0x4851('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 9a04d54..cd0df0f 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 _0xdb96=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x20ec80,_0x1e716a){var _0x2a00a1=function(_0x251b09){while(--_0x251b09){_0x20ec80['push'](_0x20ec80['shift']());}};_0x2a00a1(++_0x1e716a);}(_0xdb96,0x187));var _0x6db9=function(_0x3c8d56,_0x18477b){_0x3c8d56=_0x3c8d56-0x0;var _0x300301=_0xdb96[_0x3c8d56];return _0x300301;};'use strict';var client=require(_0x6db9('0x0'));exports[_0x6db9('0x1')]=function(_0x2ac264){return client[_0x6db9('0x2')](_0x6db9('0x3'),{'body':_0x2ac264,'log':_0x6db9('0x4')});}; \ No newline at end of file +var _0xae90=['CreateSmsMessage','../client','create','Request'];(function(_0x176ea4,_0x3810e3){var _0x308ffd=function(_0x46f6ac){while(--_0x46f6ac){_0x176ea4['push'](_0x176ea4['shift']());}};_0x308ffd(++_0x3810e3);}(_0xae90,0x1e5));var _0x0ae9=function(_0xe98b4f,_0x53664d){_0xe98b4f=_0xe98b4f-0x0;var _0x2810ce=_0xae90[_0xe98b4f];return _0x2810ce;};'use strict';var client=require(_0x0ae9('0x0'));exports[_0x0ae9('0x1')]=function(_0x4f1c3f){return client[_0x0ae9('0x2')](_0x0ae9('0x3'),{'body':_0x4f1c3f,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 25ec202..8b50b90 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 _0x0b5b=['User','Agents','smsPause','getSmsQueues','Request','GetSmsQueue','name','timeout','strategy'];(function(_0x1ced86,_0x4161f4){var _0x113973=function(_0x2cabe0){while(--_0x2cabe0){_0x1ced86['push'](_0x1ced86['shift']());}};_0x113973(++_0x4161f4);}(_0x0b5b,0x147));var _0xb0b5=function(_0x393736,_0x1593db){_0x393736=_0x393736-0x0;var _0x474ad7=_0x0b5b[_0x393736];return _0x474ad7;};'use strict';var client=require('../client');exports[_0xb0b5('0x0')]=function(){return function(){return client[_0xb0b5('0x1')](_0xb0b5('0x2'),{'options':{'raw':![],'attributes':['id',_0xb0b5('0x3'),_0xb0b5('0x4'),_0xb0b5('0x5')],'include':[{'model':_0xb0b5('0x6'),'as':_0xb0b5('0x7'),'attributes':['id',_0xb0b5('0x3'),'online',_0xb0b5('0x8')]}]},'log':_0xb0b5('0x0')});};}; \ No newline at end of file +var _0x973f=['GetSmsQueue','name','timeout','strategy','Agents','online','smsPause','../client','getSmsQueues','Request'];(function(_0x345a51,_0x316640){var _0x443487=function(_0x5f3511){while(--_0x5f3511){_0x345a51['push'](_0x345a51['shift']());}};_0x443487(++_0x316640);}(_0x973f,0x18d));var _0xf973=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x973f[_0x1f36bb];return _0xaf97fa;};'use strict';var client=require(_0xf973('0x0'));exports[_0xf973('0x1')]=function(){return function(){return client[_0xf973('0x2')](_0xf973('0x3'),{'options':{'raw':![],'attributes':['id',_0xf973('0x4'),_0xf973('0x5'),_0xf973('0x6')],'include':[{'model':'User','as':_0xf973('0x7'),'attributes':['id','name',_0xf973('0x8'),_0xf973('0x9')]}]},'log':_0xf973('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index e45552d..d80e6ac 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 _0x81b8=['../client','create','Request','CreateSmsQueueReport','DESC','UpdateSmsQueueReport'];(function(_0x2da11c,_0x1e43a7){var _0x431e2b=function(_0x4309c2){while(--_0x4309c2){_0x2da11c['push'](_0x2da11c['shift']());}};_0x431e2b(++_0x1e43a7);}(_0x81b8,0x1ce));var _0x881b=function(_0x549735,_0x548997){_0x549735=_0x549735-0x0;var _0x41c1fa=_0x81b8[_0x549735];return _0x41c1fa;};'use strict';var client=require(_0x881b('0x0'));exports[_0x881b('0x1')]=function(_0x41d0eb){return client[_0x881b('0x2')](_0x881b('0x3'),{'body':_0x41d0eb,'log':_0x881b('0x3')});};exports['update']=function(_0x4d826b,_0x5c5898){return client[_0x881b('0x2')]('UpdateSmsQueueReport',{'body':_0x5c5898,'options':{'where':{'uniqueid':_0x4d826b},'order':[['id',_0x881b('0x4')]],'limit':0x1},'log':_0x881b('0x5')});}; \ No newline at end of file +var _0xbc36=['CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0xbc36,0x166));var _0x6bc3=function(_0x948fe3,_0x549936){_0x948fe3=_0x948fe3-0x0;var _0x287e65=_0xbc36[_0x948fe3];return _0x287e65;};'use strict';var client=require(_0x6bc3('0x0'));exports['create']=function(_0x583dfa){return client[_0x6bc3('0x1')](_0x6bc3('0x2'),{'body':_0x583dfa,'log':_0x6bc3('0x2')});};exports[_0x6bc3('0x3')]=function(_0xfb08bd,_0x490f00){return client[_0x6bc3('0x1')](_0x6bc3('0x4'),{'body':_0x490f00,'options':{'where':{'uniqueid':_0xfb08bd},'order':[['id',_0x6bc3('0x5')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index e77d505..649924b 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 _0xc747=['chatPause','mailPause','faxPause','smsPause','openchannelPause','faxCapacity','smsCapacity','openchannelCapacity','getAgents','Request','GetUser','agent','name','online','lastPauseAt','voicePause'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0xc747,0xf9));var _0x7c74=function(_0x3f553b,_0x49a9c2){_0x3f553b=_0x3f553b-0x0;var _0x183c4e=_0xc747[_0x3f553b];return _0x183c4e;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x7c74('0x0')](_0x7c74('0x1'),{'options':{'raw':!![],'where':{'role':_0x7c74('0x2')},'attributes':['id',_0x7c74('0x3'),_0x7c74('0x4'),'pauseType',_0x7c74('0x5'),_0x7c74('0x6'),_0x7c74('0x7'),_0x7c74('0x8'),_0x7c74('0x9'),_0x7c74('0xa'),_0x7c74('0xb'),'chatCapacity','mailCapacity',_0x7c74('0xc'),_0x7c74('0xd'),_0x7c74('0xe')]},'log':_0x7c74('0xf')});};}; \ No newline at end of file +var _0xbdd5=['online','pauseType','lastPauseAt','chatPause','mailPause','faxPause','smsPause','openchannelPause','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','agent','name'];(function(_0x2d00b0,_0x2cea53){var _0x8a1c30=function(_0x5e8870){while(--_0x5e8870){_0x2d00b0['push'](_0x2d00b0['shift']());}};_0x8a1c30(++_0x2cea53);}(_0xbdd5,0x171));var _0x5bdd=function(_0x150b42,_0x54db33){_0x150b42=_0x150b42-0x0;var _0x1b8306=_0xbdd5[_0x150b42];return _0x1b8306;};'use strict';var client=require(_0x5bdd('0x0'));exports[_0x5bdd('0x1')]=function(){return function(){return client[_0x5bdd('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x5bdd('0x3')},'attributes':['id',_0x5bdd('0x4'),_0x5bdd('0x5'),_0x5bdd('0x6'),_0x5bdd('0x7'),'voicePause',_0x5bdd('0x8'),_0x5bdd('0x9'),_0x5bdd('0xa'),_0x5bdd('0xb'),_0x5bdd('0xc'),'chatCapacity',_0x5bdd('0xd'),_0x5bdd('0xe'),_0x5bdd('0xf'),_0x5bdd('0x10')]},'log':_0x5bdd('0x1')});};}; \ 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 a260314..5bc9db9 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 _0x2522=['../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','stop','find','agents','timeout','atimeout','channel','START:%s','rules','end','close','[%s][AGENT]\x20ROUTING\x20STOPPED','info','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x2522,0x1b7));var _0x2252=function(_0x229292,_0x45db6b){_0x229292=_0x229292-0x0;var _0x4152d2=_0x2522[_0x229292];return _0x4152d2;};'use strict';var schema=require('validate');var _=require(_0x2252('0x0'));var util=require(_0x2252('0x1'));var seqqueue=require(_0x2252('0x2'));var logger=require(_0x2252('0x3'))(_0x2252('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x2252('0x5'),'required':!![],'message':_0x2252('0x6')},'timeout':{'type':_0x2252('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x4ea83f,_0x1b10af,_0x2cfb38){return logger['info'](util[_0x2252('0x8')](_0x2252('0x9'),_0x4ea83f,_0x1b10af[_0x2252('0xa')],_0x2cfb38));}function handleFindAgent(_0x4102ba){return function(_0x172c06){return _0x172c06[_0x2252('0xa')][_0x2252('0xb')]()===_0x4102ba[_0x2252('0xb')]();};}exports[_0x2252('0xc')]=function(_0x5da2e4,_0x3e5f5a,_0x3b71b6,_0x530176){return function(_0x3227a4){try{var _0x3c6571={'name':_0x3e5f5a[0x0],'timeout':_0x3e5f5a[0x1]};var _0x33c901=queue['validate'](_0x3c6571,{'typecast':!![]});if(_0x33c901[_0x2252('0xd')]){logger[_0x2252('0xe')](_0x2252('0xf'),_0x5da2e4,_['map'](_0x33c901,'message')['join'](',\x20'));_0x3227a4[_0x2252('0x10')]();}else{var _0x3286d5=_[_0x2252('0x11')](_0x3b71b6[_0x2252('0x12')],handleFindAgent(_0x3c6571['name']));if(_0x3286d5){var _0x16989e=(_0x3c6571[_0x2252('0x13')]||0xa)*0x3e8;var _0x132c59,_0x295d94;var _0xf330a=seqqueue['createQueue'](_0x16989e);_0xf330a['id']=_0x5da2e4;_0xf330a[_0x2252('0x14')]=_0x16989e;_0xf330a['channel']=_0x530176[_0x2252('0x15')];writeLog(_0x5da2e4,_0x3286d5,util['format'](_0x2252('0x16'),_0x16989e));_0x3b71b6[_0x2252('0x17')][_0x5da2e4]['on'](_0x2252('0x18'),function(){_0xf330a[_0x2252('0x19')]();clearTimeout(_0x295d94);_0x295d94=undefined;if(_0x3b71b6['rules'][_0x5da2e4]){delete _0x3b71b6[_0x2252('0x17')][_0x5da2e4];}logger['info'](_0x2252('0x1a'),_0x5da2e4);_0x3227a4[_0x2252('0x10')]();});_0x295d94=setTimeout(function(){clearTimeout(_0x295d94);_0xf330a[_0x2252('0x19')]();logger[_0x2252('0x1b')](_0x2252('0x1c'),_0x5da2e4);_0x3227a4[_0x2252('0x1d')]();},_0x16989e);strategy[_0x2252('0x1e')](_0xf330a,_0x3286d5,_0x3b71b6,_0x530176);}else{logger[_0x2252('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x5da2e4,_0x3c6571[_0x2252('0xa')]);_0x3227a4[_0x2252('0x10')]();}}}catch(_0x34152d){console[_0x2252('0x1f')](_0x34152d);logger[_0x2252('0xe')](_0x2252('0x20'),_0x5da2e4,_0x34152d[_0x2252('0x21')]);_0x3227a4[_0x2252('0x10')]();}};}; \ No newline at end of file +var _0xc5f4=['[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','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','map','message','join','stop','find','agents','timeout','atimeout','channel','START:%s','rules','end','close','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc5f4,0x173));var _0x4c5f=function(_0x4f310,_0x5e0026){_0x4f310=_0x4f310-0x0;var _0x13796b=_0xc5f4[_0x4f310];return _0x13796b;};'use strict';var schema=require(_0x4c5f('0x0'));var _=require(_0x4c5f('0x1'));var util=require(_0x4c5f('0x2'));var seqqueue=require(_0x4c5f('0x3'));var logger=require(_0x4c5f('0x4'))(_0x4c5f('0x5'));var strategy=require(_0x4c5f('0x6'));var queue=schema({'name':{'type':_0x4c5f('0x7'),'required':!![],'message':_0x4c5f('0x8')},'timeout':{'type':_0x4c5f('0x9'),'message':_0x4c5f('0xa')}});function writeLog(_0x439226,_0x57bb44,_0x404f36){return logger[_0x4c5f('0xb')](util[_0x4c5f('0xc')](_0x4c5f('0xd'),_0x439226,_0x57bb44['name'],_0x404f36));}function handleFindAgent(_0x301d6e){return function(_0x2b0c83){return _0x2b0c83[_0x4c5f('0xe')]['toLowerCase']()===_0x301d6e[_0x4c5f('0xf')]();};}exports[_0x4c5f('0x10')]=function(_0x2d17e3,_0x511338,_0x34c073,_0x5cbb34){return function(_0x540fc8){try{var _0x25bccd={'name':_0x511338[0x0],'timeout':_0x511338[0x1]};var _0x248b78=queue[_0x4c5f('0x0')](_0x25bccd,{'typecast':!![]});if(_0x248b78[_0x4c5f('0x11')]){logger[_0x4c5f('0x12')](_0x4c5f('0x13'),_0x2d17e3,_[_0x4c5f('0x14')](_0x248b78,_0x4c5f('0x15'))[_0x4c5f('0x16')](',\x20'));_0x540fc8[_0x4c5f('0x17')]();}else{var _0x3f0c46=_[_0x4c5f('0x18')](_0x34c073[_0x4c5f('0x19')],handleFindAgent(_0x25bccd['name']));if(_0x3f0c46){var _0x289263=(_0x25bccd[_0x4c5f('0x1a')]||0xa)*0x3e8;var _0x33ca0d,_0x4f14c1;var _0x2b81d1=seqqueue['createQueue'](_0x289263);_0x2b81d1['id']=_0x2d17e3;_0x2b81d1[_0x4c5f('0x1b')]=_0x289263;_0x2b81d1['channel']=_0x5cbb34[_0x4c5f('0x1c')];writeLog(_0x2d17e3,_0x3f0c46,util[_0x4c5f('0xc')](_0x4c5f('0x1d'),_0x289263));_0x34c073[_0x4c5f('0x1e')][_0x2d17e3]['on'](_0x4c5f('0x1f'),function(){_0x2b81d1[_0x4c5f('0x20')]();clearTimeout(_0x4f14c1);_0x4f14c1=undefined;if(_0x34c073[_0x4c5f('0x1e')][_0x2d17e3]){delete _0x34c073[_0x4c5f('0x1e')][_0x2d17e3];}logger[_0x4c5f('0xb')](_0x4c5f('0x21'),_0x2d17e3);_0x540fc8[_0x4c5f('0x17')]();});_0x4f14c1=setTimeout(function(){clearTimeout(_0x4f14c1);_0x2b81d1[_0x4c5f('0x20')]();logger[_0x4c5f('0xb')](_0x4c5f('0x22'),_0x2d17e3);_0x540fc8[_0x4c5f('0x23')]();},_0x289263);strategy[_0x4c5f('0x24')](_0x2b81d1,_0x3f0c46,_0x34c073,_0x5cbb34);}else{logger[_0x4c5f('0x12')](_0x4c5f('0x25'),_0x2d17e3,_0x25bccd['name']);_0x540fc8[_0x4c5f('0x17')]();}}}catch(_0x3f1779){console[_0x4c5f('0x26')](_0x3f1779);logger[_0x4c5f('0x12')](_0x4c5f('0x27'),_0x2d17e3,_0x3f1779[_0x4c5f('0x28')]);_0x540fc8[_0x4c5f('0x17')]();}};}; \ 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 70e488b..45561ee 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 _0x06ff=['InteractionId','created','isEmpty','body','getMustacheRender','Message','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','create','dialogState','Failed','error','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x06ff,0x18e));var _0xf06f=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x06ff[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xf06f('0x0'));var moment=require(_0xf06f('0x1'));var AWS=require(_0xf06f('0x2'));var utils=require(_0xf06f('0x3'));var logger=require(_0xf06f('0x4'))(_0xf06f('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf06f('0x6')),'mailMessage':require(_0xf06f('0x7')),'smsMessage':require(_0xf06f('0x8')),'faxMessage':require('../../rpc/faxMessage')};exports[_0xf06f('0x9')]=function(_0x28980b,_0x146198){return function(_0x292abc){try{if(!_[_0xf06f('0xa')](this[_0xf06f('0xb')]['UserId'])){logger[_0xf06f('0xc')](_0xf06f('0xd'),_0x28980b,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x292abc[_0xf06f('0xe')]();}var _0x667fa5={'ContactId':this[_0xf06f('0xf')]['id'],'sentAt':moment()[_0xf06f('0x10')](_0xf06f('0x11')),'direction':_0xf06f('0x12')};var _0x4e1ad6=this[_0xf06f('0x13')];if(_0x4e1ad6===_0xf06f('0x14')){_0x667fa5[_0xf06f('0x15')]=this[_0xf06f('0x16')]['id'];}else{_0x667fa5[_[_0xf06f('0x17')](_0x4e1ad6)+_0xf06f('0x18')]=this[_0xf06f('0x16')]['id'];}_0x667fa5[_[_0xf06f('0x17')](_0x4e1ad6)+_0xf06f('0x19')]=this[_0xf06f('0xb')]['id'];if(this['interaction'][_0xf06f('0x1a')]){var _0x4ea971=_0x146198[0x4];if(!_[_0xf06f('0x1b')](_0x4ea971)){_0x667fa5[_0xf06f('0x1c')]=utils[_0xf06f('0x1d')](_0x4ea971,this);return rpc[_0x4e1ad6+_0xf06f('0x1e')]['create'](_0x667fa5)[_0xf06f('0x1f')](function(_0x4c2ead){logger[_0xf06f('0xc')](_0xf06f('0xd'),_0x28980b,_0x667fa5['body']);})[_0xf06f('0x20')](function(_0x268f30){logger['error'](_0xf06f('0xd'),_0x28980b,JSON[_0xf06f('0x21')](_0x268f30));})[_0xf06f('0x22')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x28980b);_0x292abc['stop']();});}else{logger[_0xf06f('0xc')](_0xf06f('0x23'),_0x28980b);_0x292abc[_0xf06f('0x24')]();}}else{var _0xb696c2=this;var _0x4d550e=new AWS[(_0xf06f('0x25'))]({'accessKeyId':_0x146198[0x0],'secretAccessKey':_0x146198[0x1],'region':_0x146198[0x2]});var _0x4d56b1={'botAlias':_0xf06f('0x26'),'botName':_0x146198[0x3],'inputText':this[_0xf06f('0x27')][_0xf06f('0x1c')],'userId':this['interaction']['id'][_0xf06f('0x28')]()};_0x4d550e[_0xf06f('0x29')](_0x4d56b1,function(_0x5593a9,_0x268284){if(_0x5593a9){logger['error'](_0xf06f('0xd'),_0x28980b,_0x5593a9[_0xf06f('0x27')]);_0x292abc[_0xf06f('0xe')]();}else if(_0x268284&&_0x268284[_0xf06f('0x27')]){_0xb696c2['body'][_0xf06f('0x2a')]=_0x268284;_0x667fa5[_0xf06f('0x1c')]=_0x268284[_0xf06f('0x27')];return rpc[_0x4e1ad6+'Message'][_0xf06f('0x2b')](_0x667fa5)[_0xf06f('0x1f')](function(_0x31aeab){logger['info'](_0xf06f('0xd'),_0x28980b,_0x667fa5[_0xf06f('0x1c')]);if(_0x268284[_0xf06f('0x2c')]==_0xf06f('0x2d')){_0x292abc[_0xf06f('0xe')]();}else{_0x292abc[_0xf06f('0x24')]();}})[_0xf06f('0x20')](function(_0x456b48){logger['error']('[%s][AMAZONLEX]\x20%s',_0x28980b,JSON[_0xf06f('0x21')](_0x456b48));_0x292abc[_0xf06f('0xe')]();});}else{_0x292abc['next']();}});}}catch(_0x37a10b){logger[_0xf06f('0x2e')]('[%s][AMAZONLEX]\x20%s',_0x28980b,JSON[_0xf06f('0x21')](_0x37a10b));_0x292abc[_0xf06f('0x24')]();}};}; \ No newline at end of file +var _0x27db=['then','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','LexRuntime','body','toString','postText','message','amazonlex','create','dialogState','Failed','catch','stop','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','chat','account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message'];(function(_0x3e3c35,_0x161c94){var _0x17f2d0=function(_0x29e6ef){while(--_0x29e6ef){_0x3e3c35['push'](_0x3e3c35['shift']());}};_0x17f2d0(++_0x161c94);}(_0x27db,0x170));var _0xb27d=function(_0x51f9a1,_0x181d54){_0x51f9a1=_0x51f9a1-0x0;var _0x14b1d3=_0x27db[_0x51f9a1];return _0x14b1d3;};'use strict';var _=require(_0xb27d('0x0'));var moment=require(_0xb27d('0x1'));var AWS=require(_0xb27d('0x2'));var utils=require(_0xb27d('0x3'));var logger=require('../../../../config/logger')(_0xb27d('0x4'));var rpc={'chatMessage':require(_0xb27d('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb27d('0x6')),'smsMessage':require(_0xb27d('0x7')),'faxMessage':require('../../rpc/faxMessage')};exports[_0xb27d('0x8')]=function(_0x5aa6e1,_0x4b9015){return function(_0x1d5e6a){try{if(!_[_0xb27d('0x9')](this[_0xb27d('0xa')][_0xb27d('0xb')])){logger[_0xb27d('0xc')](_0xb27d('0xd'),_0x5aa6e1,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1d5e6a[_0xb27d('0xe')]();}var _0x1a0ebb={'ContactId':this[_0xb27d('0xf')]['id'],'sentAt':moment()[_0xb27d('0x10')](_0xb27d('0x11')),'direction':_0xb27d('0x12')};var _0x23c248=this['channel'];if(_0x23c248===_0xb27d('0x13')){_0x1a0ebb['ChatWebsiteId']=this[_0xb27d('0x14')]['id'];}else{_0x1a0ebb[_['upperFirst'](_0x23c248)+_0xb27d('0x15')]=this[_0xb27d('0x14')]['id'];}_0x1a0ebb[_[_0xb27d('0x16')](_0x23c248)+_0xb27d('0x17')]=this[_0xb27d('0xa')]['id'];if(this['interaction'][_0xb27d('0x18')]){var _0x2d76aa=_0x4b9015[0x4];if(!_[_0xb27d('0x19')](_0x2d76aa)){_0x1a0ebb['body']=utils[_0xb27d('0x1a')](_0x2d76aa,this);return rpc[_0x23c248+_0xb27d('0x1b')]['create'](_0x1a0ebb)[_0xb27d('0x1c')](function(_0x53bf75){logger[_0xb27d('0xc')](_0xb27d('0xd'),_0x5aa6e1,_0x1a0ebb['body']);})['catch'](function(_0x514d50){logger[_0xb27d('0x1d')](_0xb27d('0xd'),_0x5aa6e1,JSON[_0xb27d('0x1e')](_0x514d50));})[_0xb27d('0x1f')](function(){logger[_0xb27d('0xc')](_0xb27d('0x20'),_0x5aa6e1);_0x1d5e6a['stop']();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5aa6e1);_0x1d5e6a['stop']();}}else{var _0x1fbbf7=this;var _0x583884=new AWS[(_0xb27d('0x21'))]({'accessKeyId':_0x4b9015[0x0],'secretAccessKey':_0x4b9015[0x1],'region':_0x4b9015[0x2]});var _0x89b7c7={'botAlias':'$LATEST','botName':_0x4b9015[0x3],'inputText':this['message'][_0xb27d('0x22')],'userId':this[_0xb27d('0xa')]['id'][_0xb27d('0x23')]()};_0x583884[_0xb27d('0x24')](_0x89b7c7,function(_0x114c42,_0x3c64d9){if(_0x114c42){logger[_0xb27d('0x1d')](_0xb27d('0xd'),_0x5aa6e1,_0x114c42[_0xb27d('0x25')]);_0x1d5e6a[_0xb27d('0xe')]();}else if(_0x3c64d9&&_0x3c64d9[_0xb27d('0x25')]){_0x1fbbf7[_0xb27d('0x22')][_0xb27d('0x26')]=_0x3c64d9;_0x1a0ebb[_0xb27d('0x22')]=_0x3c64d9[_0xb27d('0x25')];return rpc[_0x23c248+_0xb27d('0x1b')][_0xb27d('0x27')](_0x1a0ebb)['then'](function(_0x285013){logger['info'](_0xb27d('0xd'),_0x5aa6e1,_0x1a0ebb[_0xb27d('0x22')]);if(_0x3c64d9[_0xb27d('0x28')]==_0xb27d('0x29')){_0x1d5e6a['next']();}else{_0x1d5e6a['stop']();}})[_0xb27d('0x2a')](function(_0x143177){logger[_0xb27d('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x5aa6e1,JSON[_0xb27d('0x1e')](_0x143177));_0x1d5e6a[_0xb27d('0xe')]();});}else{_0x1d5e6a['next']();}});}}catch(_0x277c46){logger['error'](_0xb27d('0xd'),_0x5aa6e1,JSON['stringify'](_0x277c46));_0x1d5e6a[_0xb27d('0x2b')]();}};}; \ 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 9291387..111d779 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 _0xe706=['next','channel','getMustacheRender','YYYY-MM-DD\x20HH:mm:ss','out','message','from','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','body','';return mailRpc[_0x6e70('0x33')](_0x228350,_0x37b3e0)['then'](function(_0x259486){logger['info'](_0x6e70('0x34'),_0x1b0389);_0x37b3e0[_0x6e70('0x2c')]=_0x259486[_0x6e70('0x16')]['messageId'];return rpc[_0x743eb5+_0x6e70('0x22')][_0x6e70('0x35')](_0x37b3e0);})['then'](function(_0x13d673){logger[_0x6e70('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1b0389,JSON[_0x6e70('0x36')](_0x13d673));})[_0x6e70('0x37')](function(_0x2d52bd){logger[_0x6e70('0x38')](_0x6e70('0x39'),_0x1b0389,JSON[_0x6e70('0x36')](_0x2d52bd));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}else{return rpc[this[_0x6e70('0x12')]+_0x6e70('0x22')]['create'](_0x37b3e0)[_0x6e70('0x3b')](function(_0x4795a0){logger[_0x6e70('0xe')](_0x6e70('0xf'),_0x1b0389,_0x37b3e0[_0x6e70('0x30')]);})[_0x6e70('0x37')](function(_0x233a83){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON[_0x6e70('0x36')](_0x233a83));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}}}catch(_0x2a5444){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON['stringify'](_0x2a5444));_0x36357b['stop']();}};}; \ No newline at end of file +var _0xedd9=['catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','next','create','[%s][AUTOREPLY]\x20%s','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc','consequence','isNil','created','interaction','info','Autoreply\x20already\x20sent','channel','getMustacheRender','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','upperFirst','InteractionId','Message','account','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','messageId','','replace','body','','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify'];(function(_0x25d060,_0x418736){var _0x106892=function(_0x4aa250){while(--_0x4aa250){_0x25d060['push'](_0x25d060['shift']());}};_0x106892(++_0x418736);}(_0xedd9,0xfc));var _0x9edd=function(_0x24bff3,_0x12adbf){_0x24bff3=_0x24bff3-0x0;var _0x45a2e1=_0xedd9[_0x24bff3];return _0x45a2e1;};'use strict';var _=require('lodash');var moment=require(_0x9edd('0x0'));var utils=require(_0x9edd('0x1'));var logger=require(_0x9edd('0x2'))(_0x9edd('0x3'));var rpc={'chatMessage':require(_0x9edd('0x4')),'openchannelMessage':require(_0x9edd('0x5')),'mailMessage':require(_0x9edd('0x6')),'smsMessage':require(_0x9edd('0x7')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x9edd('0x8'));exports[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return function(_0x5319f7){try{if(_0x34c1a7[0x0]==='1'&&(_[_0x9edd('0xa')](this['interaction'][_0x9edd('0xb')])||!this[_0x9edd('0xc')][_0x9edd('0xb')])){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x9edd('0xe'));return _0x5319f7['next']();}var _0x2076fc=this[_0x9edd('0xf')];var _0x523026={'body':utils[_0x9edd('0x10')](_0x34c1a7[0x1],this),'ContactId':this[_0x9edd('0x11')]['id'],'sentAt':moment()['format'](_0x9edd('0x12')),'direction':_0x9edd('0x13')};if(this[_0x9edd('0x14')]){_0x523026['to']=this[_0x9edd('0x14')][_0x9edd('0x15')]||'';_0x523026['cc']=this[_0x9edd('0x14')]['cc']||'';_0x523026[_0x9edd('0x15')]=this[_0x9edd('0x14')]['to']||'';_0x523026['phone']=this[_0x9edd('0x14')][_0x9edd('0x16')]||'';_0x523026[_0x9edd('0x17')]=!![];if(this[_0x9edd('0x14')][_0x9edd('0x18')]){_0x523026[_0x9edd('0x18')]='';_0x523026[_0x9edd('0x18')]+=_[_0x9edd('0x19')](this['message'][_0x9edd('0x18')],_0x9edd('0x1a'))?'':_0x9edd('0x1b');_0x523026['subject']+=this[_0x9edd('0x14')][_0x9edd('0x18')];}}if(this[_0x9edd('0xf')]==='chat'){_0x523026[_0x9edd('0x1c')]=this['account']['id'];}else{_0x523026[_[_0x9edd('0x1d')](this[_0x9edd('0xf')])+'AccountId']=this['account']['id'];}_0x523026[_[_0x9edd('0x1d')](this['channel'])+_0x9edd('0x1e')]=this['interaction']['id'];if(rpc[this['channel']+_0x9edd('0x1f')]){if(this[_0x9edd('0xf')]==='mail'){var _0x5823bc={'tls':{'rejectUnauthorized':![]}};if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')]){_0x5823bc['service']=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')];}else{_0x5823bc[_0x9edd('0x23')]=this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x23')];_0x5823bc[_0x9edd('0x24')]=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x24')];_0x5823bc['secure']=this['account'][_0x9edd('0x21')][_0x9edd('0x25')];}if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x26')]){_0x5823bc['auth']={'user':this['account'][_0x9edd('0x21')][_0x9edd('0x27')],'pass':this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x28')]};}_0x523026[_0x9edd('0x29')]=this[_0x9edd('0x14')][_0x9edd('0x2a')];_0x523026['html']=_0x9edd('0x2b')+_[_0x9edd('0x2c')](_0x523026[_0x9edd('0x2d')],_0x9edd('0x2e'),_0x9edd('0x2f'))+_0x9edd('0x30');return mailRpc[_0x9edd('0x31')](_0x5823bc,_0x523026)[_0x9edd('0x32')](function(_0x19b6c1){logger[_0x9edd('0xd')](_0x9edd('0x33'),_0x268f9e);_0x523026[_0x9edd('0x2a')]=_0x19b6c1[_0x9edd('0x14')][_0x9edd('0x2a')];return rpc[_0x2076fc+_0x9edd('0x1f')]['create'](_0x523026);})[_0x9edd('0x32')](function(_0x259259){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,JSON[_0x9edd('0x34')](_0x259259));})[_0x9edd('0x35')](function(_0xde9b13){logger[_0x9edd('0x36')](_0x9edd('0x37'),_0x268f9e,JSON[_0x9edd('0x34')](_0xde9b13));})[_0x9edd('0x38')](function(){_0x5319f7[_0x9edd('0x39')]();});}else{return rpc[this[_0x9edd('0xf')]+_0x9edd('0x1f')][_0x9edd('0x3a')](_0x523026)[_0x9edd('0x32')](function(_0x27eb7e){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x523026[_0x9edd('0x2d')]);})['catch'](function(_0x968303){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x968303));})[_0x9edd('0x38')](function(){_0x5319f7['next']();});}}}catch(_0x6de835){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x6de835));_0x5319f7[_0x9edd('0x3c')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index b7f4713..fb38a72 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f9b=['error','[%s][CLOSE]\x20%s','stop','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x1626c4,_0x1d4694){var _0x3b5725=function(_0x52f549){while(--_0x52f549){_0x1626c4['push'](_0x1626c4['shift']());}};_0x3b5725(++_0x1d4694);}(_0x4f9b,0x6d));var _0xb4f9=function(_0x35c584,_0x5c3a8d){_0x35c584=_0x35c584-0x0;var _0x234b3b=_0x4f9b[_0x35c584];return _0x234b3b;};'use strict';var moment=require(_0xb4f9('0x0'));var logger=require(_0xb4f9('0x1'))(_0xb4f9('0x2'));var rpc={'chatInteraction':require(_0xb4f9('0x3')),'openchannelInteraction':require(_0xb4f9('0x4')),'smsInteraction':require(_0xb4f9('0x5')),'mailInteraction':require(_0xb4f9('0x6')),'faxInteraction':require(_0xb4f9('0x7'))};exports['consequence']=function(_0x59803f,_0x572714,_0x25947a,_0x38c813){return function(_0x2fa71b){try{logger[_0xb4f9('0x8')](_0xb4f9('0x9'),_0x59803f,_0x572714[0x0]);var _0xfb58e5={'closed':0x1,'closedAt':moment()['format'](_0xb4f9('0xa')),'closeReason':_0xb4f9('0xb'),'disposition':_0x572714[0x0]};if(rpc[_0x38c813[_0xb4f9('0xc')]+'Interaction']){rpc[_0x38c813[_0xb4f9('0xc')]+'Interaction'][_0xb4f9('0xd')](_0x38c813[_0xb4f9('0xe')]['id'],_0xfb58e5)[_0xb4f9('0xf')](function(_0x300299){logger[_0xb4f9('0x8')](_0xb4f9('0x10'),_0x59803f,_0x38c813[_0xb4f9('0xe')]['id']);})['catch'](function(_0x1bb8b0){logger[_0xb4f9('0x11')](_0xb4f9('0x12'),_0x59803f,JSON['stringify'](_0x1bb8b0));})['finally'](function(){_0x2fa71b[_0xb4f9('0x13')]();});}}catch(_0x3d8bac){logger[_0xb4f9('0x11')](_0xb4f9('0x12'),_0x59803f,JSON[_0xb4f9('0x14')](_0x3d8bac));_0x2fa71b[_0xb4f9('0x13')]();}};}; \ No newline at end of file +var _0xab26=['finally','stop','error','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify'];(function(_0x2201c1,_0x13ef09){var _0x58891c=function(_0x1b4852){while(--_0x1b4852){_0x2201c1['push'](_0x2201c1['shift']());}};_0x58891c(++_0x13ef09);}(_0xab26,0xd2));var _0x6ab2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xab26[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x6ab2('0x0'));var logger=require(_0x6ab2('0x1'))(_0x6ab2('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x6ab2('0x3')),'smsInteraction':require(_0x6ab2('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction')};exports[_0x6ab2('0x5')]=function(_0x51bdcd,_0x332458,_0xb15094,_0x31c9f1){return function(_0x56dc80){try{logger[_0x6ab2('0x6')](_0x6ab2('0x7'),_0x51bdcd,_0x332458[0x0]);var _0x54bf93={'closed':0x1,'closedAt':moment()[_0x6ab2('0x8')](_0x6ab2('0x9')),'closeReason':_0x6ab2('0xa'),'disposition':_0x332458[0x0]};if(rpc[_0x31c9f1[_0x6ab2('0xb')]+_0x6ab2('0xc')]){rpc[_0x31c9f1[_0x6ab2('0xb')]+_0x6ab2('0xc')][_0x6ab2('0xd')](_0x31c9f1[_0x6ab2('0xe')]['id'],_0x54bf93)[_0x6ab2('0xf')](function(_0x2f317c){logger['info'](_0x6ab2('0x10'),_0x51bdcd,_0x31c9f1[_0x6ab2('0xe')]['id']);})[_0x6ab2('0x11')](function(_0x5b7e6d){logger['error'](_0x6ab2('0x12'),_0x51bdcd,JSON[_0x6ab2('0x13')](_0x5b7e6d));})[_0x6ab2('0x14')](function(){_0x56dc80[_0x6ab2('0x15')]();});}}catch(_0x46cff3){logger[_0x6ab2('0x16')](_0x6ab2('0x12'),_0x51bdcd,JSON[_0x6ab2('0x13')](_0x46cff3));_0x56dc80['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 06ac2ec..9471544 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2496=['textRequest','message','dialogflow','result','fulfillment','speech','catch','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','UserId','info','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','stop'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x2496,0x1b5));var _0x6249=function(_0xde054,_0x4498fa){_0xde054=_0xde054-0x0;var _0x3bf09=_0x2496[_0xde054];return _0x3bf09;};'use strict';var _=require(_0x6249('0x0'));var moment=require(_0x6249('0x1'));var apiai=require(_0x6249('0x2'));var md5=require(_0x6249('0x3'));var utils=require(_0x6249('0x4'));var logger=require(_0x6249('0x5'))(_0x6249('0x6'));var rpc={'chatMessage':require(_0x6249('0x7')),'openchannelMessage':require(_0x6249('0x8')),'mailMessage':require(_0x6249('0x9')),'smsMessage':require(_0x6249('0xa')),'faxMessage':require(_0x6249('0xb'))};exports['consequence']=function(_0x2bf410,_0x3be8fa){return function(_0x1d8ee7){try{if(!_['isNil'](this[_0x6249('0xc')][_0x6249('0xd')])){logger[_0x6249('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x2bf410,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1d8ee7[_0x6249('0xf')]();}var _0x16c202={'ContactId':this['contact']['id'],'sentAt':moment()[_0x6249('0x10')](_0x6249('0x11')),'direction':'out'};var _0x16f534=this[_0x6249('0x12')];if(_0x16f534===_0x6249('0x13')){_0x16c202[_0x6249('0x14')]=this[_0x6249('0x15')]['id'];}else{_0x16c202[_[_0x6249('0x16')](_0x16f534)+_0x6249('0x17')]=this['account']['id'];}_0x16c202[_[_0x6249('0x16')](_0x16f534)+'InteractionId']=this['interaction']['id'];if(this[_0x6249('0xc')][_0x6249('0x18')]){var _0x22a35a=_0x3be8fa[0x2];if(!_[_0x6249('0x19')](_0x22a35a)){_0x16c202[_0x6249('0x1a')]=utils[_0x6249('0x1b')](_0x22a35a,this);return rpc[_0x16f534+_0x6249('0x1c')][_0x6249('0x1d')](_0x16c202)[_0x6249('0x1e')](function(_0x511746){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x2bf410,_0x16c202[_0x6249('0x1a')]);})['catch'](function(_0x2038e6){logger[_0x6249('0x1f')](_0x6249('0x20'),_0x2bf410,JSON[_0x6249('0x21')](_0x2038e6));})[_0x6249('0x22')](function(){logger[_0x6249('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2bf410);_0x1d8ee7[_0x6249('0x23')]();});}else{logger[_0x6249('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2bf410);_0x1d8ee7[_0x6249('0x23')]();}}else{var _0x45fc50=this;var _0x1e2105=apiai(_0x3be8fa[0x0],{'language':_0x3be8fa[0x1]||'en'});return _0x1e2105[_0x6249('0x24')](this[_0x6249('0x25')]['body'],{'sessionId':md5(this['interaction']['id'])})[_0x6249('0x1e')](function(_0x4b1b7f){_0x45fc50[_0x6249('0x1a')][_0x6249('0x26')]=_0x4b1b7f;_0x16c202[_0x6249('0x1a')]=_0x4b1b7f[_0x6249('0x27')][_0x6249('0x28')][_0x6249('0x29')];return rpc[_0x16f534+_0x6249('0x1c')][_0x6249('0x1d')](_0x16c202)[_0x6249('0x1e')](function(_0x47c703){logger[_0x6249('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x2bf410,_0x16c202['body']);if(_0x4b1b7f[_0x6249('0x27')]['metadata']['endConversation']){_0x1d8ee7[_0x6249('0xf')]();}else{_0x1d8ee7['stop']();}})[_0x6249('0x2a')](function(_0x1b6074){logger[_0x6249('0x1f')](_0x6249('0x20'),_0x2bf410,JSON[_0x6249('0x21')](_0x1b6074));_0x1d8ee7[_0x6249('0xf')]();});})[_0x6249('0x2a')](function(_0x395908){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x2bf410,_0x395908[_0x6249('0x25')]);_0x1d8ee7[_0x6249('0xf')]();});}}catch(_0x599402){logger[_0x6249('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x2bf410,JSON[_0x6249('0x21')](_0x599402));_0x1d8ee7[_0x6249('0x23')]();}};}; \ No newline at end of file +var _0x984a=['apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','UserId','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','chat','account','upperFirst','created','body','getMustacheRender','Message','create','then','info','error','[%s][DIALOGFLOW]\x20%s','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','result','fulfillment','speech','metadata','endConversation','catch','moment'];(function(_0x2216ef,_0x38c333){var _0x311a25=function(_0x584eb3){while(--_0x584eb3){_0x2216ef['push'](_0x2216ef['shift']());}};_0x311a25(++_0x38c333);}(_0x984a,0x1df));var _0xa984=function(_0x49432b,_0x23f4e3){_0x49432b=_0x49432b-0x0;var _0x4ad662=_0x984a[_0x49432b];return _0x4ad662;};'use strict';var _=require('lodash');var moment=require(_0xa984('0x0'));var apiai=require(_0xa984('0x1'));var md5=require(_0xa984('0x2'));var utils=require(_0xa984('0x3'));var logger=require('../../../../config/logger')(_0xa984('0x4'));var rpc={'chatMessage':require(_0xa984('0x5')),'openchannelMessage':require(_0xa984('0x6')),'mailMessage':require(_0xa984('0x7')),'smsMessage':require(_0xa984('0x8')),'faxMessage':require(_0xa984('0x9'))};exports['consequence']=function(_0x3b27b2,_0x47b7a4){return function(_0x52678b){try{if(!_['isNil'](this[_0xa984('0xa')][_0xa984('0xb')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x3b27b2,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x52678b[_0xa984('0xc')]();}var _0x1a0d9b={'ContactId':this['contact']['id'],'sentAt':moment()[_0xa984('0xd')](_0xa984('0xe')),'direction':'out'};var _0x5d1929=this[_0xa984('0xf')];if(_0x5d1929===_0xa984('0x10')){_0x1a0d9b['ChatWebsiteId']=this[_0xa984('0x11')]['id'];}else{_0x1a0d9b[_[_0xa984('0x12')](_0x5d1929)+'AccountId']=this[_0xa984('0x11')]['id'];}_0x1a0d9b[_['upperFirst'](_0x5d1929)+'InteractionId']=this[_0xa984('0xa')]['id'];if(this['interaction'][_0xa984('0x13')]){var _0x21d572=_0x47b7a4[0x2];if(!_['isEmpty'](_0x21d572)){_0x1a0d9b[_0xa984('0x14')]=utils[_0xa984('0x15')](_0x21d572,this);return rpc[_0x5d1929+_0xa984('0x16')][_0xa984('0x17')](_0x1a0d9b)[_0xa984('0x18')](function(_0x4e116f){logger[_0xa984('0x19')]('[%s][DIALOGFLOW]\x20%s',_0x3b27b2,_0x1a0d9b[_0xa984('0x14')]);})['catch'](function(_0xed18cf){logger[_0xa984('0x1a')](_0xa984('0x1b'),_0x3b27b2,JSON['stringify'](_0xed18cf));})[_0xa984('0x1c')](function(){logger[_0xa984('0x19')](_0xa984('0x1d'),_0x3b27b2);_0x52678b[_0xa984('0x1e')]();});}else{logger[_0xa984('0x19')](_0xa984('0x1f'),_0x3b27b2);_0x52678b[_0xa984('0x1e')]();}}else{var _0x983ef2=this;var _0x57eafe=apiai(_0x47b7a4[0x0],{'language':_0x47b7a4[0x1]||'en'});return _0x57eafe['textRequest'](this[_0xa984('0x20')][_0xa984('0x14')],{'sessionId':md5(this[_0xa984('0xa')]['id'])})[_0xa984('0x18')](function(_0x102f9a){_0x983ef2[_0xa984('0x14')][_0xa984('0x21')]=_0x102f9a;_0x1a0d9b[_0xa984('0x14')]=_0x102f9a[_0xa984('0x22')][_0xa984('0x23')][_0xa984('0x24')];return rpc[_0x5d1929+_0xa984('0x16')][_0xa984('0x17')](_0x1a0d9b)[_0xa984('0x18')](function(_0x18f7f7){logger['info'](_0xa984('0x1b'),_0x3b27b2,_0x1a0d9b[_0xa984('0x14')]);if(_0x102f9a[_0xa984('0x22')][_0xa984('0x25')][_0xa984('0x26')]){_0x52678b[_0xa984('0xc')]();}else{_0x52678b['stop']();}})['catch'](function(_0x341d33){logger[_0xa984('0x1a')](_0xa984('0x1b'),_0x3b27b2,JSON['stringify'](_0x341d33));_0x52678b[_0xa984('0xc')]();});})[_0xa984('0x27')](function(_0xd38319){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x3b27b2,_0xd38319[_0xa984('0x20')]);_0x52678b['next']();});}}catch(_0x10fd46){logger[_0xa984('0x1a')]('[%s][DIALOGFLOW]\x20%s',_0x3b27b2,JSON['stringify'](_0x10fd46));_0x52678b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index e47f86f..3d171d9 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31fb=['join','condition','priorityTrue','priorityFalse','info','next','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','message','[%s][GOTOIF]\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','consequence','fromString','getMustacheRender','replace','length','error','map'];(function(_0x363ce6,_0x1a9a21){var _0x15ff2d=function(_0x3e6938){while(--_0x3e6938){_0x363ce6['push'](_0x363ce6['shift']());}};_0x15ff2d(++_0x1a9a21);}(_0x31fb,0x105));var _0xb31f=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x31fb[_0x102e37];return _0x35a07c;};'use strict';var schema=require(_0xb31f('0x0'));var _=require(_0xb31f('0x1'));var htmlToText=require(_0xb31f('0x2'));var utils=require(_0xb31f('0x3'));var logger=require(_0xb31f('0x4'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xb31f('0x5')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xb31f('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xb31f('0x7')]=function(_0x338e1e,_0x11d99e){return function(_0x2b4b41){try{var _0x55312d={'condition':htmlToText[_0xb31f('0x8')](utils[_0xb31f('0x9')](_0x11d99e[0x0],this),{'wordwrap':![]})[_0xb31f('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x11d99e[0x1],'priorityFalse':_0x11d99e[0x2]};var _0x2a1d15=gotoif[_0xb31f('0x0')](_0x55312d,{'typecast':!![]});if(_0x2a1d15[_0xb31f('0xb')]){logger[_0xb31f('0xc')]('[%s][GOTOIF]\x20%s',_0x338e1e,_[_0xb31f('0xd')](_0x2a1d15,'message')[_0xb31f('0xe')](',\x20'));_0x2b4b41['stop']();}else{try{var _0xf103dc=eval('('+_0x55312d[_0xb31f('0xf')]+')');var _0x3ec7dc=_0xf103dc?_0x55312d[_0xb31f('0x10')]:_0x55312d[_0xb31f('0x11')];logger[_0xb31f('0x12')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x338e1e,_0x55312d['condition'],_0xf103dc,_0x3ec7dc||_0xb31f('0x13'));if(_0x3ec7dc){var _0x28ff5e=_['findIndex'](_0x2b4b41['rules'](),{'p':_0x3ec7dc});if(_0x28ff5e>=0x0){logger[_0xb31f('0x12')](_0xb31f('0x14'),_0x338e1e,_0x3ec7dc||_0xb31f('0x13'),_0x28ff5e);_0x2b4b41['next'](_0x28ff5e);}else{logger[_0xb31f('0x12')](_0xb31f('0x15'),_0x338e1e,_0x3ec7dc||_0xb31f('0x13'));_0x2b4b41[_0xb31f('0x16')]();}}else{_0x2b4b41[_0xb31f('0x13')]();}}catch(_0x1282dd){logger[_0xb31f('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x338e1e,_0x1282dd[_0xb31f('0x17')]);_0x2b4b41[_0xb31f('0x16')]();}}}catch(_0x28bd1d){logger[_0xb31f('0xc')](_0xb31f('0x18'),_0x338e1e,JSON['stringify'](_0x28bd1d));_0x2b4b41[_0xb31f('0x16')]();}};}; \ No newline at end of file +var _0x55f8=['map','join','stop','condition','priorityTrue','priorityFalse','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s'];(function(_0x3da8f7,_0x30b82a){var _0x4a6ed1=function(_0x1a51ac){while(--_0x1a51ac){_0x3da8f7['push'](_0x3da8f7['shift']());}};_0x4a6ed1(++_0x30b82a);}(_0x55f8,0x194));var _0x855f=function(_0x1471ce,_0x30b3da){_0x1471ce=_0x1471ce-0x0;var _0x12dae8=_0x55f8[_0x1471ce];return _0x12dae8;};'use strict';var schema=require(_0x855f('0x0'));var _=require(_0x855f('0x1'));var htmlToText=require(_0x855f('0x2'));var utils=require(_0x855f('0x3'));var logger=require(_0x855f('0x4'))('routing');var gotoif=schema({'condition':{'type':_0x855f('0x5'),'required':!![],'message':_0x855f('0x6')},'priorityTrue':{'type':'number','message':_0x855f('0x7')},'priorityFalse':{'type':_0x855f('0x8'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x855f('0x9')]=function(_0x2fa73e,_0x91dc13){return function(_0x48790f){try{var _0xc5c794={'condition':htmlToText[_0x855f('0xa')](utils[_0x855f('0xb')](_0x91dc13[0x0],this),{'wordwrap':![]})[_0x855f('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x91dc13[0x1],'priorityFalse':_0x91dc13[0x2]};var _0x4188da=gotoif['validate'](_0xc5c794,{'typecast':!![]});if(_0x4188da[_0x855f('0xd')]){logger[_0x855f('0xe')](_0x855f('0xf'),_0x2fa73e,_[_0x855f('0x10')](_0x4188da,'message')[_0x855f('0x11')](',\x20'));_0x48790f[_0x855f('0x12')]();}else{try{var _0xba479f=eval('('+_0xc5c794[_0x855f('0x13')]+')');var _0x24c8ff=_0xba479f?_0xc5c794[_0x855f('0x14')]:_0xc5c794[_0x855f('0x15')];logger[_0x855f('0x16')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2fa73e,_0xc5c794['condition'],_0xba479f,_0x24c8ff||_0x855f('0x17'));if(_0x24c8ff){var _0x251b1c=_[_0x855f('0x18')](_0x48790f[_0x855f('0x19')](),{'p':_0x24c8ff});if(_0x251b1c>=0x0){logger[_0x855f('0x16')](_0x855f('0x1a'),_0x2fa73e,_0x24c8ff||_0x855f('0x17'),_0x251b1c);_0x48790f[_0x855f('0x17')](_0x251b1c);}else{logger[_0x855f('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x2fa73e,_0x24c8ff||_0x855f('0x17'));_0x48790f[_0x855f('0x12')]();}}else{_0x48790f[_0x855f('0x17')]();}}catch(_0x238a54){logger[_0x855f('0xe')](_0x855f('0x1b'),_0x2fa73e,_0x238a54[_0x855f('0x1c')]);_0x48790f[_0x855f('0x12')]();}}}catch(_0x572dbe){logger['error'](_0x855f('0xf'),_0x2fa73e,JSON[_0x855f('0x1d')](_0x572dbe));_0x48790f['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 624d952..1165649 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 _0xb884=['[%s][GOTOP]\x20priority\x20%s','priority','rules','info','next','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','message','stop'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb884,0x1e5));var _0x4b88=function(_0x480a51,_0x3aecea){_0x480a51=_0x480a51-0x0;var _0x19673b=_0xb884[_0x480a51];return _0x19673b;};'use strict';var schema=require(_0x4b88('0x0'));var _=require(_0x4b88('0x1'));var logger=require(_0x4b88('0x2'))('routing');var gotop=schema({'priority':{'type':_0x4b88('0x3'),'required':!![],'message':_0x4b88('0x4')}});exports[_0x4b88('0x5')]=function(_0x2a4f78,_0x276b6e){return function(_0x152122){try{var _0x19b6de={'priority':_0x276b6e[0x0]};var _0x3229ec=gotop[_0x4b88('0x0')](_0x19b6de,{'typecast':!![]});if(_0x3229ec[_0x4b88('0x6')]){logger[_0x4b88('0x7')](_0x4b88('0x8'),_0x2a4f78,_['map'](_0x3229ec,_0x4b88('0x9'))['join'](',\x20'));_0x152122[_0x4b88('0xa')]();}else{logger['info'](_0x4b88('0xb'),_0x2a4f78,_0x19b6de[_0x4b88('0xc')]);if(_0x19b6de[_0x4b88('0xc')]){var _0x3b72c0=_['findIndex'](_0x152122[_0x4b88('0xd')](),{'p':_0x19b6de[_0x4b88('0xc')]});if(_0x3b72c0>=0x0){logger[_0x4b88('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2a4f78,_0x19b6de[_0x4b88('0xc')]||_0x4b88('0xf'),_0x3b72c0);_0x152122[_0x4b88('0xf')](_0x3b72c0);}else{logger[_0x4b88('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x2a4f78,_0x19b6de[_0x4b88('0xc')]||_0x4b88('0xf'));_0x152122[_0x4b88('0xa')]();}}else{_0x152122[_0x4b88('0xf')]();}}}catch(_0x342db7){logger[_0x4b88('0x7')](_0x4b88('0x8'),_0x2a4f78,JSON['stringify'](_0x342db7));_0x152122['stop']();}};}; \ No newline at end of file +var _0x9cca=['[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','validate','lodash','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x114984,_0x5c9593){var _0x44822b=function(_0x10af37){while(--_0x10af37){_0x114984['push'](_0x114984['shift']());}};_0x44822b(++_0x5c9593);}(_0x9cca,0x116));var _0xa9cc=function(_0x3f0b15,_0x29a0c6){_0x3f0b15=_0x3f0b15-0x0;var _0x371196=_0x9cca[_0x3f0b15];return _0x371196;};'use strict';var schema=require(_0xa9cc('0x0'));var _=require(_0xa9cc('0x1'));var logger=require('../../../../config/logger')(_0xa9cc('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xa9cc('0x3')}});exports[_0xa9cc('0x4')]=function(_0x55c3c8,_0x4bc16f){return function(_0x313332){try{var _0xf948f9={'priority':_0x4bc16f[0x0]};var _0x41143f=gotop[_0xa9cc('0x0')](_0xf948f9,{'typecast':!![]});if(_0x41143f[_0xa9cc('0x5')]){logger[_0xa9cc('0x6')](_0xa9cc('0x7'),_0x55c3c8,_[_0xa9cc('0x8')](_0x41143f,_0xa9cc('0x9'))[_0xa9cc('0xa')](',\x20'));_0x313332[_0xa9cc('0xb')]();}else{logger[_0xa9cc('0xc')](_0xa9cc('0xd'),_0x55c3c8,_0xf948f9[_0xa9cc('0xe')]);if(_0xf948f9[_0xa9cc('0xe')]){var _0x4b01a3=_[_0xa9cc('0xf')](_0x313332['rules'](),{'p':_0xf948f9[_0xa9cc('0xe')]});if(_0x4b01a3>=0x0){logger[_0xa9cc('0xc')](_0xa9cc('0x10'),_0x55c3c8,_0xf948f9[_0xa9cc('0xe')]||'next',_0x4b01a3);_0x313332['next'](_0x4b01a3);}else{logger[_0xa9cc('0xc')](_0xa9cc('0x11'),_0x55c3c8,_0xf948f9[_0xa9cc('0xe')]||'next');_0x313332[_0xa9cc('0xb')]();}}else{_0x313332[_0xa9cc('0x12')]();}}}catch(_0x597089){logger[_0xa9cc('0x6')](_0xa9cc('0x7'),_0x55c3c8,JSON['stringify'](_0x597089));_0x313332['stop']();}};}; \ 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 e3f7ae5..aa1bcba 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 _0xa441=['lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop'];(function(_0x528c3f,_0xc8918c){var _0x3292b8=function(_0x134f1e){while(--_0x134f1e){_0x528c3f['push'](_0x528c3f['shift']());}};_0x3292b8(++_0xc8918c);}(_0xa441,0x11e));var _0x1a44=function(_0x3a8931,_0x36e7a7){_0x3a8931=_0x3a8931-0x0;var _0x34dd86=_0xa441[_0x3a8931];return _0x34dd86;};'use strict';var _=require(_0x1a44('0x0'));var utils=require(_0x1a44('0x1'));var logger=require('../../../../config/logger')(_0x1a44('0x2'));var rpc={'chatMessage':require(_0x1a44('0x3')),'openchannelMessage':require(_0x1a44('0x4')),'mailMessage':require(_0x1a44('0x5')),'smsMessage':require(_0x1a44('0x6')),'faxMessage':require(_0x1a44('0x7'))};exports[_0x1a44('0x8')]=function(_0x12ed61,_0x1a5293){return function(_0x2e2cb9){try{var _0x5a50cb={'body':utils[_0x1a44('0x9')](_0x1a5293[0x0],this),'ContactId':this['contact']['id']};if(this[_0x1a44('0xa')]===_0x1a44('0xb')){_0x5a50cb[_0x1a44('0xc')]=this[_0x1a44('0xd')]['id'];}else{_0x5a50cb[_['upperFirst'](this[_0x1a44('0xa')])+'AccountId']=this[_0x1a44('0xd')]['id'];}_0x5a50cb[_[_0x1a44('0xe')](this[_0x1a44('0xa')])+_0x1a44('0xf')]=this[_0x1a44('0x10')]['id'];if(rpc[this[_0x1a44('0xa')]+_0x1a44('0x11')]){return rpc[this[_0x1a44('0xa')]+_0x1a44('0x11')][_0x1a44('0x12')](_0x5a50cb)[_0x1a44('0x13')](function(_0x3f3455){logger['info'](_0x1a44('0x14'),_0x12ed61,_0x5a50cb[_0x1a44('0x15')]);_0x2e2cb9['next']();})[_0x1a44('0x16')](function(_0x5326ef){logger[_0x1a44('0x17')]('[%s][MESSAGE]\x20%s',_0x12ed61,JSON[_0x1a44('0x18')](_0x5326ef));_0x2e2cb9[_0x1a44('0x19')]();});}}catch(_0x13732f){logger[_0x1a44('0x17')](_0x1a44('0x14'),_0x12ed61,JSON[_0x1a44('0x18')](_0x13732f));_0x2e2cb9['stop']();}};}; \ No newline at end of file +var _0x01b6=['error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','account','upperFirst','AccountId','InteractionId','interaction','Message','create','info','next'];(function(_0x131c1d,_0x1ab929){var _0x2abafa=function(_0x4049fd){while(--_0x4049fd){_0x131c1d['push'](_0x131c1d['shift']());}};_0x2abafa(++_0x1ab929);}(_0x01b6,0x156));var _0x601b=function(_0x31147e,_0x2ff5b9){_0x31147e=_0x31147e-0x0;var _0x395bf8=_0x01b6[_0x31147e];return _0x395bf8;};'use strict';var _=require(_0x601b('0x0'));var utils=require('./utils');var logger=require(_0x601b('0x1'))(_0x601b('0x2'));var rpc={'chatMessage':require(_0x601b('0x3')),'openchannelMessage':require(_0x601b('0x4')),'mailMessage':require(_0x601b('0x5')),'smsMessage':require(_0x601b('0x6')),'faxMessage':require(_0x601b('0x7'))};exports[_0x601b('0x8')]=function(_0x104d70,_0x5cbf5f){return function(_0x50fd07){try{var _0x3e941e={'body':utils[_0x601b('0x9')](_0x5cbf5f[0x0],this),'ContactId':this[_0x601b('0xa')]['id']};if(this[_0x601b('0xb')]===_0x601b('0xc')){_0x3e941e['ChatWebsiteId']=this[_0x601b('0xd')]['id'];}else{_0x3e941e[_[_0x601b('0xe')](this['channel'])+_0x601b('0xf')]=this[_0x601b('0xd')]['id'];}_0x3e941e[_[_0x601b('0xe')](this[_0x601b('0xb')])+_0x601b('0x10')]=this[_0x601b('0x11')]['id'];if(rpc[this[_0x601b('0xb')]+_0x601b('0x12')]){return rpc[this[_0x601b('0xb')]+_0x601b('0x12')][_0x601b('0x13')](_0x3e941e)['then'](function(_0x4ca802){logger[_0x601b('0x14')]('[%s][MESSAGE]\x20%s',_0x104d70,_0x3e941e['body']);_0x50fd07[_0x601b('0x15')]();})['catch'](function(_0x368248){logger[_0x601b('0x16')](_0x601b('0x17'),_0x104d70,JSON[_0x601b('0x18')](_0x368248));_0x50fd07[_0x601b('0x19')]();});}}catch(_0x258267){logger[_0x601b('0x16')](_0x601b('0x17'),_0x104d70,JSON[_0x601b('0x18')](_0x258267));_0x50fd07['stop']();}};}; \ 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 b7d6768..fe41b73 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 _0x3835=['stop','./utils','routing','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify'];(function(_0x5dc807,_0x56cd01){var _0x4096d1=function(_0x2a8a4b){while(--_0x2a8a4b){_0x5dc807['push'](_0x5dc807['shift']());}};_0x4096d1(++_0x56cd01);}(_0x3835,0x64));var _0x5383=function(_0x210333,_0x2db9be){_0x210333=_0x210333-0x0;var _0x37ea98=_0x3835[_0x210333];return _0x37ea98;};'use strict';var utils=require(_0x5383('0x0'));var logger=require('../../../../config/logger')(_0x5383('0x1'));exports['consequence']=function(_0x2fc7db,_0x22507e){return function(_0x1b095b){try{logger[_0x5383('0x2')](_0x5383('0x3'),_0x2fc7db,utils[_0x5383('0x4')](_0x22507e[0x0],this));_0x1b095b[_0x5383('0x5')]();}catch(_0x3dbc08){logger[_0x5383('0x6')](_0x5383('0x3'),_0x2fc7db,JSON[_0x5383('0x7')](_0x3dbc08));_0x1b095b[_0x5383('0x8')]();}};}; \ No newline at end of file +var _0x3a6a=['stringify','stop','./utils','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x591053,_0x523072){var _0x31ab80=function(_0x4a543f){while(--_0x4a543f){_0x591053['push'](_0x591053['shift']());}};_0x31ab80(++_0x523072);}(_0x3a6a,0x106));var _0xa3a6=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x3a6a[_0x5756f8];return _0x3bb749;};'use strict';var utils=require(_0xa3a6('0x0'));var logger=require(_0xa3a6('0x1'))('routing');exports[_0xa3a6('0x2')]=function(_0x46a9df,_0x2220ac){return function(_0x289537){try{logger[_0xa3a6('0x3')](_0xa3a6('0x4'),_0x46a9df,utils[_0xa3a6('0x5')](_0x2220ac[0x0],this));_0x289537[_0xa3a6('0x6')]();}catch(_0x3f03e0){logger[_0xa3a6('0x7')](_0xa3a6('0x4'),_0x46a9df,JSON[_0xa3a6('0x8')](_0x3f03e0));_0x289537[_0xa3a6('0x9')]();}};}; \ 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 8ee9244..9640a67 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 _0x270b=['routing','redis','defaults','localhost','queue_id','account','queue','from','joinAt','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','waiting','accepted','update','catch','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','stop','find','Queues','qtimeout','rules','end','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','util','moment','ioredis','../../../../config/logger'];(function(_0x340daf,_0x3d2cd3){var _0xd415fa=function(_0x18a857){while(--_0x18a857){_0x340daf['push'](_0x340daf['shift']());}};_0xd415fa(++_0x3d2cd3);}(_0x270b,0xd0));var _0xb270=function(_0x4973e5,_0x5bcf56){_0x4973e5=_0x4973e5-0x0;var _0x331ed3=_0x270b[_0x4973e5];return _0x331ed3;};'use strict';var schema=require(_0xb270('0x0'));var _=require('lodash');var util=require(_0xb270('0x1'));var seqqueue=require('seq-queue');var moment=require(_0xb270('0x2'));var Redis=require(_0xb270('0x3'));var config=require('../../../../config/environment');var logger=require(_0xb270('0x4'))(_0xb270('0x5'));var strategy=require('./strategy');config[_0xb270('0x6')]=_[_0xb270('0x7')](config[_0xb270('0x6')],{'host':_0xb270('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb270('0x6')]));var attributes=['id',_0xb270('0x9'),_0xb270('0xa'),_0xb270('0xb'),_0xb270('0xc'),_0xb270('0xd')];function emit(_0x19ec57,_0x455a31,_0x3df0f8){io['to'](_0x19ec57)['emit'](_0x455a31,_0x3df0f8);}function emitChannelQueueInteraction(_0x2c96ce,_0x3e1a58,_0x283290,_0x3aa9fc,_0x32402f,_0x463333,_0x57feb2,_0x52b8f7){_0x283290[_0xb270('0x9')]=_0x52b8f7;_0x283290[_0xb270('0xb')]=_0x3e1a58;_0x283290['account']=_0x3aa9fc;_0x283290['id']=_0x32402f;if(_0x463333){_0x57feb2[util[_0xb270('0xe')](_0xb270('0xf'),_0x2c96ce)][_0x32402f]=_[_0xb270('0x10')](_0x283290,attributes);}else{delete _0x57feb2[util[_0xb270('0xe')](_0xb270('0xf'),_0x2c96ce)][_0x32402f];}emit(util['format']('%s:queue:%s',_0x2c96ce,_0x3e1a58),util[_0xb270('0xe')](_0xb270('0x11'),_0x2c96ce,_0x463333?_0xb270('0x12'):_0xb270('0x13')),_[_0xb270('0x10')](_0x283290,attributes));}var rpc={'openchannelQueueReport':require(_0xb270('0x14')),'mailQueueReport':require(_0xb270('0x15')),'chatQueueReport':require(_0xb270('0x16')),'smsQueueReport':require(_0xb270('0x17')),'faxQueueReport':require(_0xb270('0x18'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xb270('0x19')},'timeout':{'type':'number','message':_0xb270('0x1a')}});function startRouting(_0x193d6b,_0xaed59,_0x1fa60c,_0x456b16){if(_0x193d6b&&_0xaed59&&_0x1fa60c){_0xaed59['waiting']+=0x1;var _0x344b99={'uniqueid':_0x193d6b,'from':_0x1fa60c[_0xb270('0x1b')]?_0x1fa60c[_0xb270('0x1b')][_0xb270('0xc')]:'','joinAt':moment()['format'](_0xb270('0x1c')),'ContactId':_0x1fa60c[_0xb270('0x1d')]?_0x1fa60c[_0xb270('0x1d')]['id']:null,'ListId':_0x1fa60c[_0xb270('0x1e')]?_0x1fa60c[_0xb270('0x1e')]['id']:null};_0x344b99[_[_0xb270('0x1f')](_0x1fa60c[_0xb270('0x20')])+_0xb270('0x21')]=_0xaed59['id']||null;_0x344b99[_[_0xb270('0x1f')](_0x1fa60c[_0xb270('0x20')])+_0xb270('0x22')]=_0x1fa60c[_0xb270('0x23')]?_0x1fa60c['interaction']['id']:null;_0x344b99[_[_0xb270('0x1f')](_0x1fa60c[_0xb270('0x20')])+'MessageId']=_0x1fa60c[_0xb270('0x24')]?_0x1fa60c['message']['id']:null;_0x344b99[_[_0xb270('0x1f')](_0x1fa60c[_0xb270('0x20')])+(_0x1fa60c[_0xb270('0x20')]!==_0xb270('0x25')?_0xb270('0x26'):_0xb270('0x27'))]=_0x1fa60c[_0xb270('0xa')]?_0x1fa60c['account']['id']:null;logger[_0xb270('0x28')](util[_0xb270('0xe')](_0xb270('0x29'),_0x193d6b,_0xaed59[_0xb270('0x2a')]));emitChannelQueueInteraction(_0x1fa60c[_0xb270('0x20')],_0xaed59[_0xb270('0x2a')],_0x344b99,_0x1fa60c[_0xb270('0xa')][_0xb270('0x2a')],_0x1fa60c[_0xb270('0x24')]['id'],!![],_0x456b16,_0xaed59['id']);if(rpc[_0x1fa60c[_0xb270('0x20')]+_0xb270('0x2b')]){return rpc[_0x1fa60c[_0xb270('0x20')]+_0xb270('0x2b')][_0xb270('0x2c')](_0x344b99)['catch'](function(_0x3da172){logger[_0xb270('0x2d')]('create\x20queue\x20report');});}}}function stopRouting(_0x50c991,_0x5c3e69,_0x502c87,_0x569ee8){if(_0x50c991&&_0x5c3e69){_0x5c3e69[_0xb270('0x2e')]-=0x1;var _0x8f04b={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xb270('0xe')](_0xb270('0x1c')),'reason':_0xb270('0x2f')};logger['info'](util[_0xb270('0xe')]('[%s][STOP:QUEUE][NAME:%s]',_0x50c991,_0x5c3e69[_0xb270('0x2a')]));emitChannelQueueInteraction(_0x502c87[_0xb270('0x20')],_0x5c3e69[_0xb270('0x2a')],_0x502c87[_0xb270('0x1b')],_0x502c87[_0xb270('0xa')][_0xb270('0x2a')],_0x502c87[_0xb270('0x24')]['id'],![],_0x569ee8,_0x5c3e69['id']);if(rpc[_0x502c87[_0xb270('0x20')]+_0xb270('0x2b')]){return rpc[_0x502c87[_0xb270('0x20')]+_0xb270('0x2b')][_0xb270('0x30')](_0x50c991,_0x8f04b)[_0xb270('0x31')](function(_0x1264bc){logger[_0xb270('0x2d')]('update\x20queue\x20report');});}}}function endRouting(_0x1433e1,_0x795133,_0x44c7c3,_0x30032c){if(_0x1433e1&&_0x795133){_0x795133[_0xb270('0x2e')]-=0x1;var _0x5d7612={'leaveAt':moment()[_0xb270('0xe')](_0xb270('0x1c')),'exitAt':moment()['format'](_0xb270('0x1c')),'reason':_0xb270('0x32')};logger[_0xb270('0x28')](util['format'](_0xb270('0x33'),_0x1433e1,_0x795133[_0xb270('0x2a')]));emitChannelQueueInteraction(_0x44c7c3[_0xb270('0x20')],_0x795133[_0xb270('0x2a')],_0x44c7c3[_0xb270('0x1b')],_0x44c7c3[_0xb270('0xa')][_0xb270('0x2a')],_0x44c7c3[_0xb270('0x24')]['id'],![],_0x30032c);if(rpc[_0x44c7c3[_0xb270('0x20')]+_0xb270('0x2b')]){return rpc[_0x44c7c3[_0xb270('0x20')]+_0xb270('0x2b')][_0xb270('0x30')](_0x1433e1,_0x5d7612)[_0xb270('0x31')](function(_0x29e430){logger[_0xb270('0x2d')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x4e6c73){return function(_0x356b2c){return _0x356b2c[_0xb270('0x2a')][_0xb270('0x34')]()===_0x4e6c73[_0xb270('0x34')]();};}exports[_0xb270('0x35')]=function(_0xb12483,_0x524a8b,_0x3444b6,_0x4b4cb6){return function(_0x1969a8){try{var _0xd67398={'name':_0x524a8b[0x0],'timeout':_0x524a8b[0x1]};var _0x823807=queue[_0xb270('0x0')](_0xd67398,{'typecast':!![]});if(_0x823807[_0xb270('0x36')]){logger[_0xb270('0x2d')]('[%s][QUEUE]\x20%s',_0xb12483,_[_0xb270('0x37')](_0x823807,'message')['join'](',\x20'));_0x1969a8[_0xb270('0x38')]();}else{var _0x3f4c12=_[_0xb270('0x39')](_0x3444b6[_0x4b4cb6['channel']+_0xb270('0x3a')],handleFindQueue(_0xd67398[_0xb270('0x2a')]));if(_0x3f4c12){startRouting(_0xb12483,_0x3f4c12,_0x4b4cb6,_0x3444b6);var _0x439a3b=(_0x3f4c12[_0xb270('0x32')]||0xa)*0x3e8;var _0x5f4a40=(_0xd67398['timeout']||0x14)*0x3e8;var _0x210910,_0x1175f8;if(_0x439a3b>_0x5f4a40){_0x5f4a40=_0x439a3b;}var _0xab8a66=seqqueue['createQueue'](_0x439a3b);_0xab8a66['id']=_0xb12483;_0xab8a66['atimeout']=_0x439a3b;_0xab8a66[_0xb270('0x3b')]=_0x5f4a40;_0xab8a66[_0xb270('0x20')]=_0x4b4cb6[_0xb270('0x20')];_0x3444b6[_0xb270('0x3c')][_0xb12483]['on'](_0xb270('0x3d'),function(){stopRouting(_0xb12483,_0x3f4c12,_0x4b4cb6,_0x3444b6);_0xab8a66[_0xb270('0x3e')](!![]);clearTimeout(_0x210910);_0x210910=undefined;if(_0x3444b6[_0xb270('0x3c')][_0xb12483]){delete _0x3444b6[_0xb270('0x3c')][_0xb12483];}logger['info'](_0xb270('0x3f'),_0xb12483);_0x1969a8[_0xb270('0x38')]();});_0x210910=setTimeout(function(){endRouting(_0xb12483,_0x3f4c12,_0x4b4cb6,_0x3444b6);clearTimeout(_0x210910);_0xab8a66['close'](!![]);logger[_0xb270('0x28')](_0xb270('0x40'),_0xb12483);_0x1969a8[_0xb270('0x41')]();},_0x5f4a40);switch(_0x3f4c12[_0xb270('0x42')]){case _0xb270('0x43'):strategy[_0xb270('0x43')](_0xab8a66,_0x3f4c12,_0x3444b6,_0x4b4cb6);break;default:strategy['beepall'](_0xab8a66,_0x3f4c12,_0x3444b6,_0x4b4cb6);}}else{logger[_0xb270('0x2d')](_0xb270('0x44'),_0xb12483,_0xd67398[_0xb270('0x2a')]);_0x1969a8[_0xb270('0x38')]();}}}catch(_0xde98e9){console[_0xb270('0x45')](_0xde98e9);logger[_0xb270('0x2d')](_0xb270('0x46'),_0xb12483,_0xde98e9['stack']);_0x1969a8[_0xb270('0x38')]();}};}; \ No newline at end of file +var _0x21ad=['./strategy','defaults','redis','localhost','queue_id','account','queue','from','emit','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/chatQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','qtimeout','rules','end','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','routing'];(function(_0x2d2b3c,_0x4a5142){var _0x79dd16=function(_0x1068c3){while(--_0x1068c3){_0x2d2b3c['push'](_0x2d2b3c['shift']());}};_0x79dd16(++_0x4a5142);}(_0x21ad,0x8c));var _0xd21a=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x21ad[_0x599e60];return _0x468e19;};'use strict';var schema=require(_0xd21a('0x0'));var _=require(_0xd21a('0x1'));var util=require(_0xd21a('0x2'));var seqqueue=require(_0xd21a('0x3'));var moment=require(_0xd21a('0x4'));var Redis=require(_0xd21a('0x5'));var config=require(_0xd21a('0x6'));var logger=require('../../../../config/logger')(_0xd21a('0x7'));var strategy=require(_0xd21a('0x8'));config['redis']=_[_0xd21a('0x9')](config[_0xd21a('0xa')],{'host':_0xd21a('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd21a('0xa')]));var attributes=['id',_0xd21a('0xc'),_0xd21a('0xd'),_0xd21a('0xe'),_0xd21a('0xf'),'joinAt'];function emit(_0x26f30a,_0x406bf6,_0x4598a1){io['to'](_0x26f30a)[_0xd21a('0x10')](_0x406bf6,_0x4598a1);}function emitChannelQueueInteraction(_0x3e8592,_0x346701,_0x427d01,_0xfc6566,_0x4dcaab,_0x90984a,_0x35632e,_0x289660){_0x427d01['queue_id']=_0x289660;_0x427d01[_0xd21a('0xe')]=_0x346701;_0x427d01[_0xd21a('0xd')]=_0xfc6566;_0x427d01['id']=_0x4dcaab;if(_0x90984a){_0x35632e[util[_0xd21a('0x11')](_0xd21a('0x12'),_0x3e8592)][_0x4dcaab]=_[_0xd21a('0x13')](_0x427d01,attributes);}else{delete _0x35632e[util['format'](_0xd21a('0x12'),_0x3e8592)][_0x4dcaab];}emit(util[_0xd21a('0x11')]('%s:queue:%s',_0x3e8592,_0x346701),util[_0xd21a('0x11')](_0xd21a('0x14'),_0x3e8592,_0x90984a?_0xd21a('0x15'):_0xd21a('0x16')),_[_0xd21a('0x13')](_0x427d01,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xd21a('0x17')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0xd21a('0x18'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xd21a('0x19'),'message':_0xd21a('0x1a')}});function startRouting(_0x4300fa,_0x440987,_0x5902a1,_0xac167){if(_0x4300fa&&_0x440987&&_0x5902a1){_0x440987[_0xd21a('0x1b')]+=0x1;var _0x59040d={'uniqueid':_0x4300fa,'from':_0x5902a1[_0xd21a('0x1c')]?_0x5902a1[_0xd21a('0x1c')][_0xd21a('0xf')]:'','joinAt':moment()[_0xd21a('0x11')](_0xd21a('0x1d')),'ContactId':_0x5902a1[_0xd21a('0x1e')]?_0x5902a1[_0xd21a('0x1e')]['id']:null,'ListId':_0x5902a1[_0xd21a('0x1f')]?_0x5902a1[_0xd21a('0x1f')]['id']:null};_0x59040d[_['upperFirst'](_0x5902a1[_0xd21a('0x20')])+_0xd21a('0x21')]=_0x440987['id']||null;_0x59040d[_[_0xd21a('0x22')](_0x5902a1[_0xd21a('0x20')])+_0xd21a('0x23')]=_0x5902a1[_0xd21a('0x24')]?_0x5902a1[_0xd21a('0x24')]['id']:null;_0x59040d[_[_0xd21a('0x22')](_0x5902a1[_0xd21a('0x20')])+_0xd21a('0x25')]=_0x5902a1[_0xd21a('0x26')]?_0x5902a1['message']['id']:null;_0x59040d[_[_0xd21a('0x22')](_0x5902a1['channel'])+(_0x5902a1[_0xd21a('0x20')]!==_0xd21a('0x27')?_0xd21a('0x28'):'WebsiteId')]=_0x5902a1[_0xd21a('0xd')]?_0x5902a1[_0xd21a('0xd')]['id']:null;logger[_0xd21a('0x29')](util[_0xd21a('0x11')](_0xd21a('0x2a'),_0x4300fa,_0x440987[_0xd21a('0x2b')]));emitChannelQueueInteraction(_0x5902a1[_0xd21a('0x20')],_0x440987[_0xd21a('0x2b')],_0x59040d,_0x5902a1[_0xd21a('0xd')][_0xd21a('0x2b')],_0x5902a1[_0xd21a('0x26')]['id'],!![],_0xac167,_0x440987['id']);if(rpc[_0x5902a1['channel']+_0xd21a('0x2c')]){return rpc[_0x5902a1[_0xd21a('0x20')]+_0xd21a('0x2c')][_0xd21a('0x2d')](_0x59040d)[_0xd21a('0x2e')](function(_0x4000a9){logger[_0xd21a('0x2f')](_0xd21a('0x30'));});}}}function stopRouting(_0x312a20,_0x5353a4,_0x481e64,_0x8c37ed){if(_0x312a20&&_0x5353a4){_0x5353a4['waiting']-=0x1;var _0x30e7fb={'leaveAt':moment()[_0xd21a('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0xd21a('0x1d')),'reason':_0xd21a('0x31')};logger[_0xd21a('0x29')](util[_0xd21a('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x312a20,_0x5353a4[_0xd21a('0x2b')]));emitChannelQueueInteraction(_0x481e64['channel'],_0x5353a4['name'],_0x481e64[_0xd21a('0x1c')],_0x481e64[_0xd21a('0xd')][_0xd21a('0x2b')],_0x481e64[_0xd21a('0x26')]['id'],![],_0x8c37ed,_0x5353a4['id']);if(rpc[_0x481e64[_0xd21a('0x20')]+_0xd21a('0x2c')]){return rpc[_0x481e64['channel']+_0xd21a('0x2c')][_0xd21a('0x32')](_0x312a20,_0x30e7fb)[_0xd21a('0x2e')](function(_0x163749){logger[_0xd21a('0x2f')]('update\x20queue\x20report');});}}}function endRouting(_0x526aba,_0x435d9b,_0x3559e2,_0x4e330b){if(_0x526aba&&_0x435d9b){_0x435d9b['waiting']-=0x1;var _0x1a29ae={'leaveAt':moment()[_0xd21a('0x11')](_0xd21a('0x1d')),'exitAt':moment()[_0xd21a('0x11')](_0xd21a('0x1d')),'reason':_0xd21a('0x33')};logger[_0xd21a('0x29')](util[_0xd21a('0x11')](_0xd21a('0x34'),_0x526aba,_0x435d9b[_0xd21a('0x2b')]));emitChannelQueueInteraction(_0x3559e2[_0xd21a('0x20')],_0x435d9b[_0xd21a('0x2b')],_0x3559e2[_0xd21a('0x1c')],_0x3559e2[_0xd21a('0xd')]['name'],_0x3559e2[_0xd21a('0x26')]['id'],![],_0x4e330b);if(rpc[_0x3559e2['channel']+_0xd21a('0x2c')]){return rpc[_0x3559e2[_0xd21a('0x20')]+_0xd21a('0x2c')]['update'](_0x526aba,_0x1a29ae)[_0xd21a('0x2e')](function(_0xaf0a0a){logger[_0xd21a('0x2f')](_0xd21a('0x35'));});}}}function handleFindQueue(_0xdb202){return function(_0x173dbb){return _0x173dbb[_0xd21a('0x2b')]['toLowerCase']()===_0xdb202['toLowerCase']();};}exports[_0xd21a('0x36')]=function(_0x20264b,_0x4b868c,_0x39e279,_0x5111ae){return function(_0x5e371b){try{var _0xa0d7f4={'name':_0x4b868c[0x0],'timeout':_0x4b868c[0x1]};var _0x2de67b=queue['validate'](_0xa0d7f4,{'typecast':!![]});if(_0x2de67b[_0xd21a('0x37')]){logger['error'](_0xd21a('0x38'),_0x20264b,_[_0xd21a('0x39')](_0x2de67b,'message')['join'](',\x20'));_0x5e371b[_0xd21a('0x3a')]();}else{var _0x4cf5a0=_[_0xd21a('0x3b')](_0x39e279[_0x5111ae['channel']+_0xd21a('0x3c')],handleFindQueue(_0xa0d7f4[_0xd21a('0x2b')]));if(_0x4cf5a0){startRouting(_0x20264b,_0x4cf5a0,_0x5111ae,_0x39e279);var _0x302e4d=(_0x4cf5a0[_0xd21a('0x33')]||0xa)*0x3e8;var _0x57cb5f=(_0xa0d7f4[_0xd21a('0x33')]||0x14)*0x3e8;var _0x5e3b9d,_0x5168e6;if(_0x302e4d>_0x57cb5f){_0x57cb5f=_0x302e4d;}var _0x2c8bcc=seqqueue[_0xd21a('0x3d')](_0x302e4d);_0x2c8bcc['id']=_0x20264b;_0x2c8bcc['atimeout']=_0x302e4d;_0x2c8bcc[_0xd21a('0x3e')]=_0x57cb5f;_0x2c8bcc['channel']=_0x5111ae[_0xd21a('0x20')];_0x39e279[_0xd21a('0x3f')][_0x20264b]['on'](_0xd21a('0x40'),function(){stopRouting(_0x20264b,_0x4cf5a0,_0x5111ae,_0x39e279);_0x2c8bcc[_0xd21a('0x41')](!![]);clearTimeout(_0x5e3b9d);_0x5e3b9d=undefined;if(_0x39e279[_0xd21a('0x3f')][_0x20264b]){delete _0x39e279[_0xd21a('0x3f')][_0x20264b];}logger[_0xd21a('0x29')](_0xd21a('0x42'),_0x20264b);_0x5e371b[_0xd21a('0x3a')]();});_0x5e3b9d=setTimeout(function(){endRouting(_0x20264b,_0x4cf5a0,_0x5111ae,_0x39e279);clearTimeout(_0x5e3b9d);_0x2c8bcc[_0xd21a('0x41')](!![]);logger[_0xd21a('0x29')](_0xd21a('0x43'),_0x20264b);_0x5e371b[_0xd21a('0x44')]();},_0x57cb5f);switch(_0x4cf5a0[_0xd21a('0x45')]){case _0xd21a('0x46'):strategy[_0xd21a('0x46')](_0x2c8bcc,_0x4cf5a0,_0x39e279,_0x5111ae);break;default:strategy[_0xd21a('0x47')](_0x2c8bcc,_0x4cf5a0,_0x39e279,_0x5111ae);}}else{logger[_0xd21a('0x2f')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x20264b,_0xa0d7f4[_0xd21a('0x2b')]);_0x5e371b['stop']();}}}catch(_0x1c19b6){console[_0xd21a('0x48')](_0x1c19b6);logger[_0xd21a('0x2f')]('[%s][QUEUE]\x20%s',_0x20264b,_0x1c19b6[_0xd21a('0x49')]);_0x5e371b[_0xd21a('0x3a')]();}};}; \ 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 acaa051..1905dd8 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 _0x64e6=['exports','uuid','./util','../../../../../config/logger','routing','agent','squeue','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT'];(function(_0x106c88,_0x1de8f1){var _0x264319=function(_0x52d235){while(--_0x52d235){_0x106c88['push'](_0x106c88['shift']());}};_0x264319(++_0x1de8f1);}(_0x64e6,0xcd));var _0x664e=function(_0x49e7af,_0x2b9474){_0x49e7af=_0x49e7af-0x0;var _0x5e8ffc=_0x64e6[_0x49e7af];return _0x5e8ffc;};'use strict';var _=require('lodash');var uuid=require(_0x664e('0x0'));var util=require(_0x664e('0x1'));var logger=require(_0x664e('0x2'))(_0x664e('0x3'));var Agent=function(_0x5839ff,_0x20d915,_0x274b2e,_0x4df447){this['notificationId']=uuid['v4']();this['squeue']=_0x5839ff;this[_0x664e('0x4')]=_0x20d915;this['realtime']=_0x274b2e;this[_0x664e('0x3')]=_0x4df447;this[_0x664e('0x5')]['push'](this[_0x664e('0x6')][_0x664e('0x7')](this),this[_0x664e('0x8')][_0x664e('0x7')](this));this[_0x664e('0x5')]['on'](_0x664e('0x9'),this['handleTimeout']['bind'](this));this[_0x664e('0x5')]['on'](_0x664e('0xa'),this[_0x664e('0xb')][_0x664e('0x7')](this));};Agent[_0x664e('0xc')][_0x664e('0xd')]=function(){this['squeue'][_0x664e('0xd')](this[_0x664e('0x6')]['bind'](this),this[_0x664e('0x8')]['bind'](this));};Agent[_0x664e('0xc')][_0x664e('0xb')]=function(){this[_0x664e('0x8')](!![]);};Agent['prototype'][_0x664e('0x6')]=function(_0x4837bd){logger[_0x664e('0xe')](_0x664e('0xf'),this[_0x664e('0x5')]['id'],this[_0x664e('0x4')]['id']);if(_[_0x664e('0x10')](this[_0x664e('0x11')][_0x664e('0x12')][this[_0x664e('0x4')]['id']])){logger['info'](_0x664e('0x13'),this[_0x664e('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x664e('0xd')]['bind'](this),0x3e8);}else{if(this[_0x664e('0x3')][_0x664e('0x14')]||util[_0x664e('0x15')](this[_0x664e('0x5')]['id'],this[_0x664e('0x11')]['agents'][this[_0x664e('0x4')]['id']],this[_0x664e('0x5')]['channel'],![])){this[_0x664e('0x11')]['agents'][this[_0x664e('0x4')]['id']][_0x664e('0x16')]=!![];this[_0x664e('0x11')][_0x664e('0x12')][this['agent']['id']][_0x664e('0x17')]=undefined;util[_0x664e('0x18')](this[_0x664e('0x19')],this[_0x664e('0x5')]['id'],this[_0x664e('0x11')]['agents'][this[_0x664e('0x4')]['id']],null,this[_0x664e('0x3')]);util[_0x664e('0x1a')](this[_0x664e('0x5')]['id'],this[_0x664e('0x11')][_0x664e('0x12')][this['agent']['id']],_0x664e('0x1b')+(this[_0x664e('0x3')][_0x664e('0x14')]?_0x664e('0x1c'):''));}else{logger[_0x664e('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x664e('0x5')]['id'],this[_0x664e('0x4')]['id']);setTimeout(this['push'][_0x664e('0x7')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x7138f3){if(_[_0x664e('0x10')](this[_0x664e('0x11')]['agents'][this[_0x664e('0x4')]['id']])){return logger[_0x664e('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x664e('0x5')]['id'],this['agent']['id']);}else{logger[_0x664e('0xe')](_0x664e('0x1d'),this[_0x664e('0x5')]['id'],this[_0x664e('0x4')]['id']);util[_0x664e('0x1e')](this['notificationId'],this['squeue']['id'],this['realtime'][_0x664e('0x12')][this[_0x664e('0x4')]['id']],null,this[_0x664e('0x3')]);this[_0x664e('0x11')]['agents'][this[_0x664e('0x4')]['id']]['busy']=![];this[_0x664e('0x11')][_0x664e('0x12')][this[_0x664e('0x4')]['id']][_0x664e('0x17')]=undefined;util['writeLog'](this[_0x664e('0x5')]['id'],this[_0x664e('0x11')]['agents'][this[_0x664e('0x4')]['id']],_0x7138f3?_0x664e('0x1f'):_0x664e('0x20'));}if(!_0x7138f3){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x5353b4,_0x20165c,_0x56695e,_0x560279){return new Agent(_0x5353b4,_0x20165c,_0x56695e,_0x560279);}module[_0x664e('0x21')]=agent; \ No newline at end of file +var _0x54a1=['STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','notificationId','agent','realtime','squeue','push','handleRun','handleTimeout','bind','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog'];(function(_0x50d0a3,_0xaa920e){var _0x1e4131=function(_0x27e84e){while(--_0x27e84e){_0x50d0a3['push'](_0x50d0a3['shift']());}};_0x1e4131(++_0xaa920e);}(_0x54a1,0xf1));var _0x154a=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x54a1[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x154a('0x0'));var uuid=require('uuid');var util=require(_0x154a('0x1'));var logger=require(_0x154a('0x2'))('routing');var Agent=function(_0x4de882,_0x57f29b,_0x1ee76d,_0x5de25e){this[_0x154a('0x3')]=uuid['v4']();this['squeue']=_0x4de882;this[_0x154a('0x4')]=_0x57f29b;this[_0x154a('0x5')]=_0x1ee76d;this['routing']=_0x5de25e;this[_0x154a('0x6')][_0x154a('0x7')](this[_0x154a('0x8')]['bind'](this),this[_0x154a('0x9')][_0x154a('0xa')](this));this['squeue']['on']('timeout',this[_0x154a('0x9')]['bind'](this));this[_0x154a('0x6')]['on']('drained',this[_0x154a('0xb')][_0x154a('0xa')](this));};Agent[_0x154a('0xc')][_0x154a('0x7')]=function(){this['squeue']['push'](this[_0x154a('0x8')][_0x154a('0xa')](this),this[_0x154a('0x9')]['bind'](this));};Agent[_0x154a('0xc')][_0x154a('0xb')]=function(){this[_0x154a('0x9')](!![]);};Agent['prototype'][_0x154a('0x8')]=function(_0x19af84){logger[_0x154a('0xd')](_0x154a('0xe'),this['squeue']['id'],this[_0x154a('0x4')]['id']);if(_[_0x154a('0xf')](this[_0x154a('0x5')][_0x154a('0x10')][this['agent']['id']])){logger[_0x154a('0xd')](_0x154a('0x11'),this[_0x154a('0x6')]['id'],this[_0x154a('0x4')]['id']);setTimeout(this[_0x154a('0x7')][_0x154a('0xa')](this),0x3e8);}else{if(this[_0x154a('0x12')][_0x154a('0x13')]||util[_0x154a('0x14')](this['squeue']['id'],this['realtime'][_0x154a('0x10')][this['agent']['id']],this[_0x154a('0x6')][_0x154a('0x15')],![])){this[_0x154a('0x5')][_0x154a('0x10')][this[_0x154a('0x4')]['id']][_0x154a('0x16')]=!![];this['realtime'][_0x154a('0x10')][this[_0x154a('0x4')]['id']][_0x154a('0x17')]=undefined;util[_0x154a('0x18')](this[_0x154a('0x3')],this[_0x154a('0x6')]['id'],this[_0x154a('0x5')]['agents'][this[_0x154a('0x4')]['id']],null,this[_0x154a('0x12')]);util['writeLog'](this[_0x154a('0x6')]['id'],this[_0x154a('0x5')]['agents'][this[_0x154a('0x4')]['id']],_0x154a('0x19')+(this[_0x154a('0x12')][_0x154a('0x13')]?_0x154a('0x1a'):''));}else{logger[_0x154a('0xd')](_0x154a('0x1b'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x154a('0x7')]['bind'](this),0x3e8);}}};Agent[_0x154a('0xc')][_0x154a('0x9')]=function(_0x743f6c){if(_[_0x154a('0xf')](this[_0x154a('0x5')]['agents'][this[_0x154a('0x4')]['id']])){return logger[_0x154a('0xd')](_0x154a('0x11'),this[_0x154a('0x6')]['id'],this[_0x154a('0x4')]['id']);}else{logger[_0x154a('0xd')](_0x154a('0x1c'),this[_0x154a('0x6')]['id'],this[_0x154a('0x4')]['id']);util[_0x154a('0x1d')](this[_0x154a('0x3')],this[_0x154a('0x6')]['id'],this['realtime'][_0x154a('0x10')][this['agent']['id']],null,this[_0x154a('0x12')]);this[_0x154a('0x5')][_0x154a('0x10')][this[_0x154a('0x4')]['id']][_0x154a('0x16')]=![];this[_0x154a('0x5')][_0x154a('0x10')][this['agent']['id']][_0x154a('0x17')]=undefined;util[_0x154a('0x1e')](this['squeue']['id'],this[_0x154a('0x5')]['agents'][this[_0x154a('0x4')]['id']],_0x743f6c?_0x154a('0x1f'):_0x154a('0x20'));}if(!_0x743f6c){setTimeout(this[_0x154a('0x7')][_0x154a('0xa')](this),0x3e8);}};function agent(_0x348512,_0x24fdc5,_0x112b52,_0x3a7b7a){return new Agent(_0x348512,_0x24fdc5,_0x112b52,_0x3a7b7a);}module[_0x154a('0x21')]=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 4bcf906..70805ea 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 _0x498e=['RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','routing','notificationId','squeue','queue','realtime','handleRun','handleTimeout','bind','timeout','handleDrained','push','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog'];(function(_0x356829,_0x374856){var _0x4b8eaf=function(_0x3cfe9e){while(--_0x3cfe9e){_0x356829['push'](_0x356829['shift']());}};_0x4b8eaf(++_0x374856);}(_0x498e,0x100));var _0xe498=function(_0x400417,_0x1d0fb8){_0x400417=_0x400417-0x0;var _0x2a4204=_0x498e[_0x400417];return _0x2a4204;};'use strict';var _=require(_0xe498('0x0'));var uuid=require(_0xe498('0x1'));var util=require(_0xe498('0x2'));var logger=require('../../../../../config/logger')(_0xe498('0x3'));var Beepall=function(_0x45773f,_0x45bf4d,_0x2bc9a8,_0x3ae90c){this[_0xe498('0x4')]=uuid['v4']();this[_0xe498('0x5')]=_0x45773f;this[_0xe498('0x6')]=_0x45bf4d;this[_0xe498('0x7')]=_0x2bc9a8;this[_0xe498('0x3')]=_0x3ae90c;this[_0xe498('0x5')]['push'](this[_0xe498('0x8')]['bind'](this),this[_0xe498('0x9')][_0xe498('0xa')](this));this[_0xe498('0x5')]['on'](_0xe498('0xb'),this[_0xe498('0x9')][_0xe498('0xa')](this));this[_0xe498('0x5')]['on']('drained',this[_0xe498('0xc')][_0xe498('0xa')](this));};Beepall['prototype'][_0xe498('0xd')]=function(){this[_0xe498('0x5')][_0xe498('0xd')](this[_0xe498('0x8')]['bind'](this),this['handleTimeout']['bind'](this));};Beepall[_0xe498('0xe')][_0xe498('0xc')]=function(_0x445c22){this[_0xe498('0x9')](!![]);};Beepall[_0xe498('0xe')]['handleRun']=function(_0x3ffda0){var _0x3c83d9=!![];if(!_['isNil'](this[_0xe498('0x6')])&&!_[_0xe498('0xf')](this[_0xe498('0x6')]['Agents'])&&this['queue'][_0xe498('0x10')][_0xe498('0x11')]>0x0){for(var _0x5d8f90=0x0,_0x10641b;_0x5d8f900x0){for(var _0x1e40f8=0x0,_0x583499;_0x1e40f80x0&&_0x385490[_0x17ad7d+_0x0dbe('0x22')]>=_0x385490[_0x17ad7d+_0x0dbe('0x21')]){writeLog(_0x5db440,_0x385490,_0x17ad7d[_0x0dbe('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x0dbe('0x24')]=function(_0x21d702,_0x52d556,_0x264135,_0x236a51,_0x12459f){return sendNotification(!![],_0x21d702,_0x52d556,_0x264135,_0x236a51,_0x12459f);};exports['hideNotification']=function(_0x4dfb55,_0x5b3036,_0x3edddb,_0x155fa3,_0x4ae291){return sendNotification(![],_0x4dfb55,_0x5b3036,_0x3edddb,_0x155fa3,_0x4ae291);};exports[_0x0dbe('0x25')]=writeLog; \ No newline at end of file +var _0x95a7=['\x20MAXCAPACITY','showNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','format','user:%s','emit','user:save','split','\x20interaction','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','message','name','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase'];(function(_0x4953dc,_0x383cde){var _0x4caa29=function(_0x460f00){while(--_0x460f00){_0x4953dc['push'](_0x4953dc['shift']());}};_0x4caa29(++_0x383cde);}(_0x95a7,0xda));var _0x795a=function(_0x28c2b8,_0xc7ad37){_0x28c2b8=_0x28c2b8-0x0;var _0x504aae=_0x95a7[_0x28c2b8];return _0x504aae;};'use strict';var _=require(_0x795a('0x0'));var util=require('util');var utils=require(_0x795a('0x1'));var Mustache=require('mustache');var Redis=require(_0x795a('0x2'));var config=require(_0x795a('0x3'));var logger=require(_0x795a('0x4'))(_0x795a('0x5'));config[_0x795a('0x6')]=_[_0x795a('0x7')](config[_0x795a('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x795a('0x8'))(new Redis(config[_0x795a('0x6')]));function emit(_0x34479b,_0x245210,_0x56b226){io['to'](_0x34479b)['emit'](_0x245210,_0x56b226);}function sendNotification(_0x1c3831,_0x345411,_0x13b579,_0x1b2735,_0x5554eb,_0x247889){io['to'](util[_0x795a('0x9')](_0x795a('0xa'),_0x1b2735['name']))[_0x795a('0xb')](_0x795a('0xc'),_0x1b2735);var _0x31a353=_0x247889||{};var _0x1d2e17=_0x13b579[_0x795a('0xd')]('.');var _0x3859d8={'uniqueid':_0x345411,'channel':_0x1d2e17[0x0],'id':_0x1d2e17[0x1],'title':_0x1d2e17[0x0]+_0x795a('0xe'),'interactionId':_0x1d2e17[0x2],'queue':_0x5554eb?_0x5554eb['name']:null,'sound':_0x31a353['account']['notificationSound'],'shake':_0x31a353[_0x795a('0xf')][_0x795a('0x10')]};try{if(!_0x31a353['body']){_0x31a353[_0x795a('0x11')]={};}if(_0x5554eb){_0x31a353[_0x795a('0x11')][_0x795a('0x12')]=_0x5554eb;}else if(_0x31a353[_0x795a('0x11')][_0x795a('0x12')]){delete _0x31a353[_0x795a('0x11')][_0x795a('0x12')];}_0x3859d8[_0x795a('0x13')]=utils[_0x795a('0x14')](_0x31a353[_0x795a('0xf')][_0x795a('0x15')],_0x31a353);}catch(_0x366aba){_0x3859d8[_0x795a('0x13')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x795a('0x16')](util[_0x795a('0x9')](_0x795a('0x17'),_0x345411,_0x366aba[_0x795a('0x18')]));}io['to'](util[_0x795a('0x9')](_0x795a('0xa'),_0x1b2735[_0x795a('0x19')]))['emit'](util[_0x795a('0x9')](_0x795a('0x1a'),_0x1c3831?'save':_0x795a('0x1b')),_0x3859d8);}function writeLog(_0x1cefc2,_0x3febd3,_0x466cc1){return logger[_0x795a('0x1c')](util[_0x795a('0x9')](_0x795a('0x1d'),_0x1cefc2,_0x3febd3[_0x795a('0x19')],_0x466cc1));}exports['isAgentAvailable']=function(_0x488329,_0x11774a,_0xc36aa7,_0x42f442){if(_0x11774a[_0x795a('0x1e')]){writeLog(_0x488329,_0x11774a,_0x795a('0x1f'));return![];}if(!_0x11774a[_0x795a('0x20')]){writeLog(_0x488329,_0x11774a,_0x795a('0x21'));return![];}if(_0x11774a[_0xc36aa7+_0x795a('0x22')]){writeLog(_0x488329,_0x11774a,_0x795a('0x23'));return![];}if(_0x42f442&&_0x11774a[_0x795a('0x24')](_0xc36aa7+_0x795a('0x25'))&&_0x11774a['hasOwnProperty'](_0xc36aa7+_0x795a('0x26'))){if(_0x11774a[_0xc36aa7+'Capacity']>0x0&&_0x11774a[_0xc36aa7+_0x795a('0x26')]>=_0x11774a[_0xc36aa7+_0x795a('0x25')]){writeLog(_0x488329,_0x11774a,_0xc36aa7[_0x795a('0x27')]()+_0x795a('0x28'));return![];}}return!![];};exports[_0x795a('0x29')]=function(_0x5a0eeb,_0x2d3b70,_0x4c1a71,_0x146ce9,_0x21f28d){return sendNotification(!![],_0x5a0eeb,_0x2d3b70,_0x4c1a71,_0x146ce9,_0x21f28d);};exports['hideNotification']=function(_0xfb5516,_0xae223b,_0x58b6f1,_0x3c2b60,_0xcddc97){return sendNotification(![],_0xfb5516,_0xae223b,_0x58b6f1,_0x3c2b60,_0xcddc97);};exports[_0x795a('0x2a')]=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 dfd3ddd..d0be519 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 _0xc12e=['map','message','join','info','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x3bead7,_0x5a1733){var _0x1f3885=function(_0x3c23fb){while(--_0x3c23fb){_0x3bead7['push'](_0x3bead7['shift']());}};_0x1f3885(++_0x5a1733);}(_0xc12e,0x155));var _0xec12=function(_0x4b330e,_0x5689b8){_0x4b330e=_0x4b330e-0x0;var _0x35d675=_0xc12e[_0x4b330e];return _0x35d675;};'use strict';var schema=require(_0xec12('0x0'));var sh=require(_0xec12('0x1'));var _=require(_0xec12('0x2'));var utils=require(_0xec12('0x3'));var logger=require(_0xec12('0x4'))(_0xec12('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0xec12('0x6')}});exports[_0xec12('0x7')]=function(_0x33e3b6,_0x1f596e){return function(_0x1c2d82){try{var _0x1cbd8e={'command':_0x1f596e[0x0]};var _0x7b6c44=system[_0xec12('0x0')](_0x1cbd8e,{'typecast':!![]});if(_0x7b6c44[_0xec12('0x8')]){logger[_0xec12('0x9')]('[%s][SYSTEM]\x20%s',_0x33e3b6,_[_0xec12('0xa')](_0x7b6c44,_0xec12('0xb'))[_0xec12('0xc')](',\x20'));logger[_0xec12('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x33e3b6);_0x1c2d82[_0xec12('0xe')]();}else{var _0x33263c=this;var _0x1d7504=utils[_0xec12('0xf')](_0x1f596e[0x0],this);logger[_0xec12('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x33e3b6,_0x1d7504);sh[_0xec12('0x10')](_[_0xec12('0x11')](_0x1d7504),function(_0x4f8fc5,_0x3ec7d6){logger[_0xec12('0xd')](_0xec12('0x12'),_0x33e3b6,_0x4f8fc5);if(_0x4f8fc5==0x0){var _0x413223=_0x3ec7d6[_0xec12('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xec12('0x14')](_0x1f596e[0x1])||_[_0xec12('0x15')](_0x1f596e[0x1])){logger['info'](_0xec12('0x16'),_0x33e3b6);_0x33263c[_0xec12('0x17')][_0x1f596e[0x1]]=_0x413223;}else{logger['info'](_0xec12('0x18'),_0x33e3b6,_0x1f596e[0x1],_0x413223);_0x33263c[_0xec12('0x17')][_0x1f596e[0x1]]=_0x413223;}}_0x1c2d82[_0xec12('0xe')]();});}}catch(_0x58f00e){logger[_0xec12('0x9')](_0xec12('0x19'),_0x33e3b6,_[_0xec12('0x1a')](_0x58f00e)?JSON['stringify'](_0x58f00e):_0x58f00e);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x33e3b6);_0x1c2d82[_0xec12('0xe')]();}};}; \ No newline at end of file +var _0xadcb=['isObject','stringify','shelljs','lodash','./utils','../../../../config/logger','validate','length','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body','next','error'];(function(_0x49b306,_0x4e7bc5){var _0x32a58b=function(_0x66dda6){while(--_0x66dda6){_0x49b306['push'](_0x49b306['shift']());}};_0x32a58b(++_0x4e7bc5);}(_0xadcb,0x6b));var _0xbadc=function(_0x5f5124,_0x333451){_0x5f5124=_0x5f5124-0x0;var _0x2c82c5=_0xadcb[_0x5f5124];return _0x2c82c5;};'use strict';var schema=require('validate');var sh=require(_0xbadc('0x0'));var _=require(_0xbadc('0x1'));var utils=require(_0xbadc('0x2'));var logger=require(_0xbadc('0x3'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x22471f,_0x1c722a){return function(_0x1cc2a3){try{var _0x142278={'command':_0x1c722a[0x0]};var _0x1b832d=system[_0xbadc('0x4')](_0x142278,{'typecast':!![]});if(_0x1b832d[_0xbadc('0x5')]){logger['error'](_0xbadc('0x6'),_0x22471f,_[_0xbadc('0x7')](_0x1b832d,_0xbadc('0x8'))[_0xbadc('0x9')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x22471f);_0x1cc2a3['next']();}else{var _0x5c1b6c=this;var _0x3e93be=utils['getMustacheRender'](_0x1c722a[0x0],this);logger[_0xbadc('0xa')](_0xbadc('0xb'),_0x22471f,_0x3e93be);sh[_0xbadc('0xc')](_['trim'](_0x3e93be),function(_0x3e6c00,_0x42aeb6){logger[_0xbadc('0xa')](_0xbadc('0xd'),_0x22471f,_0x3e6c00);if(_0x3e6c00==0x0){var _0x2f6687=_0x42aeb6[_0xbadc('0xe')](/(\r\n|\n|\r)/gm,'');if(_[_0xbadc('0xf')](_0x1c722a[0x1])||_['isEmpty'](_0x1c722a[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x22471f);_0x5c1b6c[_0xbadc('0x10')][_0x1c722a[0x1]]=_0x2f6687;}else{logger[_0xbadc('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x22471f,_0x1c722a[0x1],_0x2f6687);_0x5c1b6c[_0xbadc('0x10')][_0x1c722a[0x1]]=_0x2f6687;}}_0x1cc2a3[_0xbadc('0x11')]();});}}catch(_0x3f7c03){logger[_0xbadc('0x12')](_0xbadc('0x6'),_0x22471f,_[_0xbadc('0x13')](_0x3f7c03)?JSON[_0xbadc('0x14')](_0x3f7c03):_0x3f7c03);logger[_0xbadc('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x22471f);_0x1cc2a3[_0xbadc('0x11')]();}};}; \ 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 127ea56..efbbe4a 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x4e9994,_0x14ed5c){var _0x5a1cd9=function(_0x5d5a9f){while(--_0x5d5a9f){_0x4e9994['push'](_0x4e9994['shift']());}};_0x5a1cd9(++_0x14ed5c);}(_0x7a54,0x106));var _0x47a5=function(_0x1df81b,_0x5149e5){_0x1df81b=_0x1df81b-0x0;var _0x176776=_0x7a54[_0x1df81b];return _0x176776;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x2a312b,_0x73ed01){var _0x1a575a=function(_0x1feffb){while(--_0x1feffb){_0x2a312b['push'](_0x2a312b['shift']());}};_0x1a575a(++_0x73ed01);}(_0x7a54,0x106));var _0x47a5=function(_0x5c233c,_0x42980c){_0x5c233c=_0x5c233c-0x0;var _0x561431=_0x7a54[_0x5c233c];return _0x561431;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 7b4230f..7ac2b87 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 _0xfa2b=['lodash','exports','render','merge','body','contact','message','account','interaction','list','mustache'];(function(_0x4be3d1,_0x51d733){var _0x772ab2=function(_0x4acfe3){while(--_0x4acfe3){_0x4be3d1['push'](_0x4be3d1['shift']());}};_0x772ab2(++_0x51d733);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x3e4c8b,_0x408382){_0x3e4c8b=_0x3e4c8b-0x0;var _0x374caf=_0xfa2b[_0x3e4c8b];return _0x374caf;};'use strict';var Mustache=require(_0xbfa2('0x0'));var _=require(_0xbfa2('0x1'));module[_0xbfa2('0x2')]={'getMustacheRender':function(_0x9a9b55,_0x237b3e){return Mustache[_0xbfa2('0x3')](_0x9a9b55,_[_0xbfa2('0x4')](_0x237b3e[_0xbfa2('0x5')],{'contact':_0x237b3e[_0xbfa2('0x6')],'message':_0x237b3e[_0xbfa2('0x7')],'account':_0x237b3e[_0xbfa2('0x8')],'interaction':_0x237b3e[_0xbfa2('0x9')],'list':_0x237b3e[_0xbfa2('0xa')]}))||'';}}; \ No newline at end of file +var _0x9224=['list','lodash','exports','render','merge','account'];(function(_0x5874e5,_0x4fa301){var _0x31d66f=function(_0x413029){while(--_0x413029){_0x5874e5['push'](_0x5874e5['shift']());}};_0x31d66f(++_0x4fa301);}(_0x9224,0xa3));var _0x4922=function(_0x58f16f,_0xec9439){_0x58f16f=_0x58f16f-0x0;var _0x283f39=_0x9224[_0x58f16f];return _0x283f39;};'use strict';var Mustache=require('mustache');var _=require(_0x4922('0x0'));module[_0x4922('0x1')]={'getMustacheRender':function(_0x29fbd7,_0x472129){return Mustache[_0x4922('0x2')](_0x29fbd7,_[_0x4922('0x3')](_0x472129['body'],{'contact':_0x472129['contact'],'message':_0x472129['message'],'account':_0x472129[_0x4922('0x4')],'interaction':_0x472129['interaction'],'list':_0x472129[_0x4922('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 70703ee..fcb450a 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 _0x2fec=['condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','matchPath','emit','end','stack','routing\x20is\x20empty','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','openchannelQueues','smsQueues','faxQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','path','jayson/promise','uuid','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','existsSync','join','app','autoreply','appdata','split','push','dialogflow','slice','tag','TagId','format','./interval'];(function(_0x4fee31,_0x6905e3){var _0x27d650=function(_0x583e4e){while(--_0x583e4e){_0x4fee31['push'](_0x4fee31['shift']());}};_0x27d650(++_0x6905e3);}(_0x2fec,0x8b));var _0xc2fe=function(_0x4cc1eb,_0x30cd2d){_0x4cc1eb=_0x4cc1eb-0x0;var _0x28159e=_0x2fec[_0x4cc1eb];return _0x28159e;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0xc2fe('0x0'));var fs=require('fs');var jayson=require(_0xc2fe('0x1'));var BPromise=require('bluebird');var uuid=require(_0xc2fe('0x2'));var config=require(_0xc2fe('0x3'));var logger=require(_0xc2fe('0x4'))('routing');var rpc={'openchannelQueueReport':require(_0xc2fe('0x5'))};var rpc={'openchannelQueueReport':require(_0xc2fe('0x5')),'mailQueueReport':require(_0xc2fe('0x6')),'chatQueueReport':require(_0xc2fe('0x7')),'smsQueueReport':require(_0xc2fe('0x8')),'faxQueueReport':require(_0xc2fe('0x9'))};var RuleEngine=require(_0xc2fe('0xa'));function getId(_0x45dee6,_0x2a6886,_0x3a0bce){return util['format'](_0xc2fe('0xb'),_0x45dee6,_0x2a6886||0x0,_0x3a0bce||0x0);}function getIntervals(_0x5caf93,_0x43a08c){var _0x4afbec=[];if(!_['isNil'](_0x43a08c[_0xc2fe('0xc')])&&!_[_0xc2fe('0xd')](_0x5caf93[_0x43a08c['IntervalId']])&&!_[_0xc2fe('0xd')](_0x5caf93[_0x43a08c['IntervalId']][_0xc2fe('0xe')])){_0x4afbec=_[_0xc2fe('0xf')](_0x5caf93[_0x43a08c[_0xc2fe('0xc')]]['Intervals'],_0xc2fe('0x10'));}else if(!_['isNil'](_0x43a08c[_0xc2fe('0x10')])){_0x4afbec=[_0x43a08c[_0xc2fe('0x10')]];}return _0x4afbec;}exports[_0xc2fe('0x11')]=function(_0x2464db){_0x2464db[_0xc2fe('0x12')]={};return new BPromise(function(_0x548e08,_0x4c4687){var _0x6fa543={'Start':function(_0x4fbfbf){var _0x4fd7d4=this;return new Promise(function(_0x5cef56,_0x11e1e3){if(_0x4fbfbf){try{var _0x3ae691=[];var _0x2d03bb=getId(_0x4fbfbf[_0xc2fe('0x13')],_0x4fbfbf[_0xc2fe('0x14')]?_0x4fbfbf[_0xc2fe('0x14')]['id']:0x0,_0x4fbfbf[_0xc2fe('0x15')]?_0x4fbfbf[_0xc2fe('0x15')]['id']:0x0);if(_0x4fbfbf[_0xc2fe('0x16')]&&_['isArray'](_0x4fbfbf[_0xc2fe('0x16')])&&_0x4fbfbf[_0xc2fe('0x16')][_0xc2fe('0x17')]){for(var _0x59d5e3=0x0;_0x59d5e3<_0x4fbfbf[_0xc2fe('0x16')][_0xc2fe('0x17')];_0x59d5e3+=0x1){var _0x25f0b7=_0x4fbfbf[_0xc2fe('0x16')][_0x59d5e3];if(fs[_0xc2fe('0x18')](path[_0xc2fe('0x19')](__dirname,_0xc2fe('0x16'),_0x25f0b7['app']+'.js'))){var _0x2f391e=[];switch(_0x25f0b7[_0xc2fe('0x1a')]['toLowerCase']()){case _0xc2fe('0x1b'):var _0x312029=_0x25f0b7[_0xc2fe('0x1c')][_0xc2fe('0x1d')](',');_0x2f391e[_0xc2fe('0x1e')](_0x312029[0x0]);_0x2f391e[_0xc2fe('0x1e')](_0x312029['slice'](0x1,_0x312029[_0xc2fe('0x17')])['join'](','));break;case _0xc2fe('0x1f'):var _0x312029=_0x25f0b7[_0xc2fe('0x1c')][_0xc2fe('0x1d')](',');_0x2f391e[_0xc2fe('0x1e')](_0x312029[0x0]);_0x2f391e[_0xc2fe('0x1e')](_0x312029[0x1]);_0x2f391e[_0xc2fe('0x1e')](_0x312029[_0xc2fe('0x20')](0x2,_0x312029[_0xc2fe('0x17')])[_0xc2fe('0x19')](','));break;case'amazonlex':var _0x312029=_0x25f0b7[_0xc2fe('0x1c')][_0xc2fe('0x1d')](',');_0x2f391e['push'](_0x312029[0x0]);_0x2f391e['push'](_0x312029[0x1]);_0x2f391e[_0xc2fe('0x1e')](_0x312029[0x2]);_0x2f391e['push'](_0x312029[0x3]);_0x2f391e[_0xc2fe('0x1e')](_0x312029[_0xc2fe('0x20')](0x4,_0x312029[_0xc2fe('0x17')])[_0xc2fe('0x19')](','));break;case _0xc2fe('0x14'):_0x2f391e[_0xc2fe('0x1e')](_0x25f0b7[_0xc2fe('0x1c')]);break;case _0xc2fe('0x21'):_0x2f391e[_0xc2fe('0x1e')](_0x25f0b7[_0xc2fe('0x22')]);_0x2f391e[_0xc2fe('0x1e')](_0x25f0b7[_0xc2fe('0x1c')]);break;default:_0x2f391e=_[_0xc2fe('0xd')](_0x25f0b7[_0xc2fe('0x1c')])?[]:_0x25f0b7[_0xc2fe('0x1c')]['split'](',');}var _0x910e24={'id':util[_0xc2fe('0x23')]('%s:%s:%s',_0x2d03bb,_0x25f0b7['id'],_0x25f0b7[_0xc2fe('0x1a')]),'condition':require(_0xc2fe('0x24'))[_0xc2fe('0x25')](_0x2d03bb,getIntervals(_0x2464db[_0xc2fe('0x26')],_0x25f0b7),_0x2464db),'consequence':require('./applications/'+_0x25f0b7['app'])[_0xc2fe('0x27')](_0x2d03bb,_0x2f391e,_0x2464db,_0x4fbfbf),'p':_0x25f0b7[_0xc2fe('0x28')]||0x0};logger[_0xc2fe('0x29')](_0xc2fe('0x2a'),_0x910e24['id'],_0xc2fe('0x2b'),getIntervals(_0x2464db['intervals'],_0x25f0b7)[_0xc2fe('0x19')](_0xc2fe('0x2c')));_0x3ae691[_0xc2fe('0x1e')](_0x910e24);}else{logger[_0xc2fe('0x2d')](_0xc2fe('0x2e'),path[_0xc2fe('0x19')](__dirname,_0xc2fe('0x16'),_0x25f0b7['app']+_0xc2fe('0x2f')));}}_0x2464db[_0xc2fe('0x12')][_0x2d03bb]=new RuleEngine(_0x3ae691);_0x2464db[_0xc2fe('0x12')][_0x2d03bb][_0xc2fe('0x30')](_0x4fbfbf,function(_0x49cae4){logger['info'](_0xc2fe('0x31'),JSON['stringify'](_0x49cae4[_0xc2fe('0x32')]));if(_0x2464db['rules'][_0x2d03bb]){_0x2464db[_0xc2fe('0x12')][_0x2d03bb][_0xc2fe('0x33')](_0xc2fe('0x34'));}});return _0x5cef56({'code':0xc8,'message':_0x4fbfbf});}else{logger[_0xc2fe('0x29')]('No\x20applications\x20to\x20execute');return _0x5cef56({'code':0xc8,'message':_0x4fbfbf});}}catch(_0x32ab95){logger['error'](_0x32ab95[_0xc2fe('0x35')]);return _0x11e1e3(_0x4fd7d4[_0xc2fe('0x2d')](0x1f4,_0x32ab95));}}return _0x11e1e3(_0xc2fe('0x36'));});},'AcceptMessage':function(_0x3eb171){var _0x12b0f8=this;return new Promise(function(_0x581fdd,_0x5c68c0){if(_0x3eb171[_0xc2fe('0x14')]&&_0x3eb171[_0xc2fe('0x14')]['id']){try{var _0x3db53c=getId(_0x3eb171[_0xc2fe('0x13')],_0x3eb171[_0xc2fe('0x14')]?_0x3eb171['message']['id']:0x0,_0x3eb171[_0xc2fe('0x15')]?_0x3eb171['interaction']['id']:0x0);if(_0x2464db[_0xc2fe('0x12')][_0x3db53c]){_0x2464db['rules'][_0x3db53c][_0xc2fe('0x33')]('end');if(rpc[_0x3eb171[_0xc2fe('0x13')]+_0xc2fe('0x37')]){rpc[_0x3eb171[_0xc2fe('0x13')]+_0xc2fe('0x37')][_0xc2fe('0x38')](_0x3db53c,{'UserId':_0x3eb171[_0xc2fe('0x14')][_0xc2fe('0x39')]})['catch'](function(_0x5129d6){logger[_0xc2fe('0x2d')](_0xc2fe('0x3a'));});}}return _0x581fdd({'code':0xc8,'message':_0x3eb171});}catch(_0x445677){logger['error'](_0x445677[_0xc2fe('0x35')]);return _0x5c68c0(_0x12b0f8[_0xc2fe('0x2d')](0x1f4,_0x445677));}}logger[_0xc2fe('0x2d')]('message\x20is\x20empty');return _0x5c68c0(_0x12b0f8[_0xc2fe('0x2d')](0x1f4,_0xc2fe('0x3b')));});},'RejectMessage':function(_0x305bc7){var _0x3c5cf8=this;return new Promise(function(_0x201cf0,_0x209e06){if(_0x305bc7[_0xc2fe('0x3c')]&&_0x305bc7[_0xc2fe('0x3c')]['id']){try{if(_0x2464db[_0xc2fe('0x3d')][_0x305bc7['agent']['id']]){_0x2464db[_0xc2fe('0x3d')][_0x305bc7[_0xc2fe('0x3c')]['id']][_0xc2fe('0x3e')]=![];_0x2464db['agents'][_0x305bc7[_0xc2fe('0x3c')]['id']][_0xc2fe('0x3f')]=undefined;}return _0x201cf0({'code':0xc8,'message':_0x305bc7});}catch(_0x5b8112){logger[_0xc2fe('0x2d')](_0x5b8112[_0xc2fe('0x35')]);return _0x209e06(_0x3c5cf8[_0xc2fe('0x2d')](0x1f4,_0x5b8112));}}logger[_0xc2fe('0x2d')]('message\x20is\x20empty');return _0x209e06(_0x3c5cf8['error'](0x1f4,_0xc2fe('0x3b')));});},'AbandonInteraction':function(_0x1885d0){var _0x4922cd=this;return new Promise(function(_0x413778,_0x54ddf3){if(_0x1885d0[_0xc2fe('0x13')]&&_0x1885d0[_0xc2fe('0x15')]&&_0x1885d0[_0xc2fe('0x15')]['id']){try{var _0xef8101=getId(_0x1885d0[_0xc2fe('0x13')],_0x1885d0[_0xc2fe('0x14')]?_0x1885d0['message']['id']:0x0,_0x1885d0['interaction']?_0x1885d0[_0xc2fe('0x15')]['id']:0x0);if(_0x2464db['rules'][_0xef8101]){_0x2464db[_0xc2fe('0x12')][_0xef8101]['emit']('end');}return _0x413778({'code':0xc8,'message':_0x1885d0});}catch(_0x6cbc28){logger['error'](_0x6cbc28[_0xc2fe('0x35')]);return _0x54ddf3(_0x4922cd[_0xc2fe('0x2d')](0x1f4,_0x6cbc28));}}logger[_0xc2fe('0x2d')]('message\x20is\x20empty');return _0x54ddf3(_0x4922cd[_0xc2fe('0x2d')](0x1f4,_0xc2fe('0x3b')));});},'AgentCapacity':function(_0x501226){var _0x7e31a0=this;return new Promise(function(_0xe9384b,_0x327b67){if(_0x2464db[_0xc2fe('0x3d')][_0xc2fe('0x40')](_0x501226['id'])){for(var _0x327971 in _0x501226[_0xc2fe('0x41')]){if(_0x501226[_0xc2fe('0x41')][_0xc2fe('0x40')](_0x327971)){if(_0x2464db[_0xc2fe('0x3d')][_0x501226['id']][_0xc2fe('0x40')](_0x327971+_0xc2fe('0x42'))){_0x2464db[_0xc2fe('0x3d')][_0x501226['id']][_0x327971+_0xc2fe('0x42')]=parseInt(_0x501226[_0xc2fe('0x41')][_0x327971],0xa);}}}_0x2464db['agents'][_0x501226['id']][_0xc2fe('0x43')]();return _0xe9384b({'code':0xc8,'message':_0x2464db[_0xc2fe('0x3d')][_0x501226['id']]});}else{return _0x327b67(_0x7e31a0[_0xc2fe('0x2d')](0x1f4,_0xc2fe('0x44')));}});},'Agents':function(_0x412b84){return new Promise(function(_0x241b46,_0x3b7012){var _0x352a41=_[_0xc2fe('0x45')](_0x2464db[_0xc2fe('0x3d')]);_0x241b46({'count':_0x352a41[_0xc2fe('0x17')],'rows':_0x352a41});});},'ChatQueues':function(_0x9e2991){return new Promise(function(_0x52ab96,_0x1af6c5){var _0x2c2409=[];for(var _0xb7d532 in _0x2464db[_0xc2fe('0x46')]){if(_0x2464db[_0xc2fe('0x46')][_0xc2fe('0x40')](_0xb7d532)){var _0x1272e1=_0x2464db[_0xc2fe('0x46')][_0xb7d532];var _0x5c3ce8={'id':_0x1272e1['id'],'available':_0x1272e1[_0xc2fe('0x47')],'loggedIn':_0x1272e1[_0xc2fe('0x48')],'name':_0x1272e1[_0xc2fe('0x49')],'paused':_0x1272e1[_0xc2fe('0x4a')],'waiting':_0x1272e1[_0xc2fe('0x4b')]};_0x2c2409[_0xc2fe('0x1e')](_0x5c3ce8);}}_0x52ab96({'count':_0x2c2409[_0xc2fe('0x17')],'rows':_0x2c2409});});},'MailQueues':function(_0xb3c229){return new Promise(function(_0x323135,_0x17fd88){var _0x7b2c70=[];for(var _0x1592cf in _0x2464db['mailQueues']){if(_0x2464db['mailQueues'][_0xc2fe('0x40')](_0x1592cf)){var _0x17a057=_0x2464db['mailQueues'][_0x1592cf];var _0x115331={'id':_0x17a057['id'],'available':_0x17a057[_0xc2fe('0x47')],'loggedIn':_0x17a057[_0xc2fe('0x48')],'name':_0x17a057[_0xc2fe('0x49')],'paused':_0x17a057[_0xc2fe('0x4a')],'waiting':_0x17a057['waiting']};_0x7b2c70[_0xc2fe('0x1e')](_0x115331);}}_0x323135({'count':_0x7b2c70[_0xc2fe('0x17')],'rows':_0x7b2c70});});},'OpenchannelQueues':function(_0x36068b){return new Promise(function(_0x14c6ff,_0x36e0c4){var _0x4fae1d=[];for(var _0x2a625a in _0x2464db['openchannelQueues']){if(_0x2464db[_0xc2fe('0x4c')]['hasOwnProperty'](_0x2a625a)){var _0x230aca=_0x2464db['openchannelQueues'][_0x2a625a];var _0x3e9422={'id':_0x230aca['id'],'available':_0x230aca[_0xc2fe('0x47')],'loggedIn':_0x230aca[_0xc2fe('0x48')],'name':_0x230aca[_0xc2fe('0x49')],'paused':_0x230aca[_0xc2fe('0x4a')],'waiting':_0x230aca[_0xc2fe('0x4b')]};_0x4fae1d['push'](_0x3e9422);}}_0x14c6ff({'count':_0x4fae1d['length'],'rows':_0x4fae1d});});},'SmsQueues':function(_0x3c8975){return new Promise(function(_0x517e34,_0x30b6d9){var _0x454027=[];for(var _0x4c5619 in _0x2464db[_0xc2fe('0x4d')]){if(_0x2464db[_0xc2fe('0x4d')][_0xc2fe('0x40')](_0x4c5619)){var _0x3f5e02=_0x2464db[_0xc2fe('0x4d')][_0x4c5619];var _0x12e19f={'id':_0x3f5e02['id'],'available':_0x3f5e02[_0xc2fe('0x47')],'loggedIn':_0x3f5e02[_0xc2fe('0x48')],'name':_0x3f5e02['name'],'paused':_0x3f5e02['paused'],'waiting':_0x3f5e02[_0xc2fe('0x4b')]};_0x454027['push'](_0x12e19f);}}_0x517e34({'count':_0x454027[_0xc2fe('0x17')],'rows':_0x454027});});},'FaxQueues':function(_0x257c86){return new Promise(function(_0x547e14,_0x53e5fe){var _0x4d7d29=[];for(var _0x10967a in _0x2464db['faxQueues']){if(_0x2464db[_0xc2fe('0x4e')][_0xc2fe('0x40')](_0x10967a)){var _0x229395=_0x2464db[_0xc2fe('0x4e')][_0x10967a];var _0xf5d12={'id':_0x229395['id'],'available':_0x229395[_0xc2fe('0x47')],'loggedIn':_0x229395[_0xc2fe('0x48')],'name':_0x229395[_0xc2fe('0x49')],'paused':_0x229395['paused'],'waiting':_0x229395[_0xc2fe('0x4b')]};_0x4d7d29[_0xc2fe('0x1e')](_0xf5d12);}}_0x547e14({'count':_0x4d7d29[_0xc2fe('0x17')],'rows':_0x4d7d29});});},'ChatQueuesWaitingInteractions':function(_0x7401e5){return new Promise(function(_0xd35727,_0x3c0ba7){var _0x5164af=_[_0xc2fe('0x45')](_0x2464db['chatQueuesWaitingInteractions']);_0xd35727({'count':_0x5164af[_0xc2fe('0x17')],'rows':_0x5164af});});},'MailQueuesWaitingInteractions':function(_0x2faaa7){return new Promise(function(_0x2fefca,_0x4a843b){var _0x53a03e=_['values'](_0x2464db[_0xc2fe('0x4f')]);_0x2fefca({'count':_0x53a03e[_0xc2fe('0x17')],'rows':_0x53a03e});});},'OpenchannelQueuesWaitingInteractions':function(_0x373155){return new Promise(function(_0x3ebd29,_0x181238){var _0x24bb85=_[_0xc2fe('0x45')](_0x2464db['openchannelQueuesWaitingInteractions']);_0x3ebd29({'count':_0x24bb85[_0xc2fe('0x17')],'rows':_0x24bb85});});},'SmsQueuesWaitingInteractions':function(_0x5b1039){return new Promise(function(_0x4a2f35,_0x55e337){var _0x65d2c=_[_0xc2fe('0x45')](_0x2464db[_0xc2fe('0x50')]);_0x4a2f35({'count':_0x65d2c[_0xc2fe('0x17')],'rows':_0x65d2c});});},'FaxQueuesWaitingInteractions':function(_0x330d8b){return new Promise(function(_0x56d951,_0x12a63a){var _0x1af93c=_[_0xc2fe('0x45')](_0x2464db[_0xc2fe('0x51')]);_0x56d951({'count':_0x1af93c[_0xc2fe('0x17')],'rows':_0x1af93c});});}};var _0x544cf0=jayson['server'](_0x6fa543)[_0xc2fe('0x52')]();_0x544cf0['on']('error',function(_0x7fc597){logger[_0xc2fe('0x2d')](JSON[_0xc2fe('0x53')](_0x7fc597));return _0x4c4687(_0x7fc597);});_0x544cf0[_0xc2fe('0x11')](0x232c,_0xc2fe('0x54'),function(){console[_0xc2fe('0x55')](_0xc2fe('0x56'),0x232c);return _0x548e08(_0xc2fe('0x57')+0x232c);});});}; \ No newline at end of file +var _0xb27e=['loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','listen','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','interval','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','split','push','slice','appdata','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','matchPath','error','stack','routing\x20is\x20empty','emit','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available'];(function(_0x52b0b2,_0xf6dbf9){var _0x322769=function(_0x3ad9da){while(--_0x3ad9da){_0x52b0b2['push'](_0x52b0b2['shift']());}};_0x322769(++_0xf6dbf9);}(_0xb27e,0xc0));var _0xeb27=function(_0x58010e,_0x7e9c78){_0x58010e=_0x58010e-0x0;var _0x5883c1=_0xb27e[_0x58010e];return _0x5883c1;};'use strict';var _=require('lodash');var util=require(_0xeb27('0x0'));var path=require(_0xeb27('0x1'));var fs=require('fs');var jayson=require(_0xeb27('0x2'));var BPromise=require(_0xeb27('0x3'));var uuid=require(_0xeb27('0x4'));var config=require(_0xeb27('0x5'));var logger=require(_0xeb27('0x6'))(_0xeb27('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require(_0xeb27('0x8')),'mailQueueReport':require(_0xeb27('0x9')),'chatQueueReport':require(_0xeb27('0xa')),'smsQueueReport':require(_0xeb27('0xb')),'faxQueueReport':require(_0xeb27('0xc'))};var RuleEngine=require(_0xeb27('0xd'));function getId(_0xdba55,_0x56228d,_0x5f136f){return util[_0xeb27('0xe')](_0xeb27('0xf'),_0xdba55,_0x56228d||0x0,_0x5f136f||0x0);}function getIntervals(_0xee3d73,_0x438435){var _0x3494a8=[];if(!_[_0xeb27('0x10')](_0x438435[_0xeb27('0x11')])&&!_['isNil'](_0xee3d73[_0x438435[_0xeb27('0x11')]])&&!_[_0xeb27('0x10')](_0xee3d73[_0x438435['IntervalId']]['Intervals'])){_0x3494a8=_[_0xeb27('0x12')](_0xee3d73[_0x438435[_0xeb27('0x11')]]['Intervals'],_0xeb27('0x13'));}else if(!_['isNil'](_0x438435['interval'])){_0x3494a8=[_0x438435['interval']];}return _0x3494a8;}exports['listen']=function(_0x509edb){_0x509edb[_0xeb27('0x14')]={};return new BPromise(function(_0x169cbb,_0x86497f){var _0x4dde93={'Start':function(_0x3c8420){var _0x5afbaa=this;return new Promise(function(_0x2f7fbb,_0x2a86db){if(_0x3c8420){try{var _0xb4d5ba=[];var _0x42b9ff=getId(_0x3c8420[_0xeb27('0x15')],_0x3c8420[_0xeb27('0x16')]?_0x3c8420[_0xeb27('0x16')]['id']:0x0,_0x3c8420[_0xeb27('0x17')]?_0x3c8420[_0xeb27('0x17')]['id']:0x0);if(_0x3c8420[_0xeb27('0x18')]&&_[_0xeb27('0x19')](_0x3c8420[_0xeb27('0x18')])&&_0x3c8420['applications'][_0xeb27('0x1a')]){for(var _0x1a84c6=0x0;_0x1a84c6<_0x3c8420[_0xeb27('0x18')]['length'];_0x1a84c6+=0x1){var _0x1dbb0b=_0x3c8420[_0xeb27('0x18')][_0x1a84c6];if(fs[_0xeb27('0x1b')](path[_0xeb27('0x1c')](__dirname,_0xeb27('0x18'),_0x1dbb0b[_0xeb27('0x1d')]+_0xeb27('0x1e')))){var _0x33785c=[];switch(_0x1dbb0b[_0xeb27('0x1d')][_0xeb27('0x1f')]()){case _0xeb27('0x20'):var _0x492e3f=_0x1dbb0b['appdata'][_0xeb27('0x21')](',');_0x33785c[_0xeb27('0x22')](_0x492e3f[0x0]);_0x33785c['push'](_0x492e3f[_0xeb27('0x23')](0x1,_0x492e3f[_0xeb27('0x1a')])[_0xeb27('0x1c')](','));break;case'dialogflow':var _0x492e3f=_0x1dbb0b['appdata'][_0xeb27('0x21')](',');_0x33785c[_0xeb27('0x22')](_0x492e3f[0x0]);_0x33785c[_0xeb27('0x22')](_0x492e3f[0x1]);_0x33785c[_0xeb27('0x22')](_0x492e3f['slice'](0x2,_0x492e3f[_0xeb27('0x1a')])[_0xeb27('0x1c')](','));break;case'amazonlex':var _0x492e3f=_0x1dbb0b[_0xeb27('0x24')][_0xeb27('0x21')](',');_0x33785c[_0xeb27('0x22')](_0x492e3f[0x0]);_0x33785c[_0xeb27('0x22')](_0x492e3f[0x1]);_0x33785c[_0xeb27('0x22')](_0x492e3f[0x2]);_0x33785c[_0xeb27('0x22')](_0x492e3f[0x3]);_0x33785c[_0xeb27('0x22')](_0x492e3f[_0xeb27('0x23')](0x4,_0x492e3f[_0xeb27('0x1a')])['join'](','));break;case'message':_0x33785c['push'](_0x1dbb0b[_0xeb27('0x24')]);break;case _0xeb27('0x25'):_0x33785c[_0xeb27('0x22')](_0x1dbb0b[_0xeb27('0x26')]);_0x33785c['push'](_0x1dbb0b['appdata']);break;default:_0x33785c=_[_0xeb27('0x10')](_0x1dbb0b['appdata'])?[]:_0x1dbb0b[_0xeb27('0x24')][_0xeb27('0x21')](',');}var _0x292ab1={'id':util[_0xeb27('0xe')](_0xeb27('0x27'),_0x42b9ff,_0x1dbb0b['id'],_0x1dbb0b[_0xeb27('0x1d')]),'condition':require(_0xeb27('0x28'))[_0xeb27('0x29')](_0x42b9ff,getIntervals(_0x509edb[_0xeb27('0x2a')],_0x1dbb0b),_0x509edb),'consequence':require(_0xeb27('0x2b')+_0x1dbb0b[_0xeb27('0x1d')])[_0xeb27('0x2c')](_0x42b9ff,_0x33785c,_0x509edb,_0x3c8420),'p':_0x1dbb0b[_0xeb27('0x2d')]||0x0};logger[_0xeb27('0x2e')](_0xeb27('0x2f'),_0x292ab1['id'],_0xeb27('0x30'),getIntervals(_0x509edb['intervals'],_0x1dbb0b)[_0xeb27('0x1c')]('\x20|\x20'));_0xb4d5ba[_0xeb27('0x22')](_0x292ab1);}else{logger['error'](_0xeb27('0x31'),path[_0xeb27('0x1c')](__dirname,'applications',_0x1dbb0b['app']+_0xeb27('0x1e')));}}_0x509edb['rules'][_0x42b9ff]=new RuleEngine(_0xb4d5ba);_0x509edb[_0xeb27('0x14')][_0x42b9ff]['execute'](_0x3c8420,function(_0x3dbd87){logger[_0xeb27('0x2e')](_0xeb27('0x32'),JSON['stringify'](_0x3dbd87[_0xeb27('0x33')]));if(_0x509edb[_0xeb27('0x14')][_0x42b9ff]){_0x509edb[_0xeb27('0x14')][_0x42b9ff]['emit']('end');}});return _0x2f7fbb({'code':0xc8,'message':_0x3c8420});}else{logger[_0xeb27('0x2e')]('No\x20applications\x20to\x20execute');return _0x2f7fbb({'code':0xc8,'message':_0x3c8420});}}catch(_0x484dee){logger[_0xeb27('0x34')](_0x484dee[_0xeb27('0x35')]);return _0x2a86db(_0x5afbaa[_0xeb27('0x34')](0x1f4,_0x484dee));}}return _0x2a86db(_0xeb27('0x36'));});},'AcceptMessage':function(_0x34deda){var _0x2d6c47=this;return new Promise(function(_0x164feb,_0x535b76){if(_0x34deda[_0xeb27('0x16')]&&_0x34deda[_0xeb27('0x16')]['id']){try{var _0x435928=getId(_0x34deda[_0xeb27('0x15')],_0x34deda[_0xeb27('0x16')]?_0x34deda['message']['id']:0x0,_0x34deda[_0xeb27('0x17')]?_0x34deda[_0xeb27('0x17')]['id']:0x0);if(_0x509edb[_0xeb27('0x14')][_0x435928]){_0x509edb[_0xeb27('0x14')][_0x435928][_0xeb27('0x37')]('end');if(rpc[_0x34deda[_0xeb27('0x15')]+_0xeb27('0x38')]){rpc[_0x34deda[_0xeb27('0x15')]+_0xeb27('0x38')]['update'](_0x435928,{'UserId':_0x34deda[_0xeb27('0x16')][_0xeb27('0x39')]})[_0xeb27('0x3a')](function(_0xb38f76){logger[_0xeb27('0x34')](_0xeb27('0x3b'));});}}return _0x164feb({'code':0xc8,'message':_0x34deda});}catch(_0x349f75){logger['error'](_0x349f75['stack']);return _0x535b76(_0x2d6c47[_0xeb27('0x34')](0x1f4,_0x349f75));}}logger[_0xeb27('0x34')](_0xeb27('0x3c'));return _0x535b76(_0x2d6c47[_0xeb27('0x34')](0x1f4,_0xeb27('0x3c')));});},'RejectMessage':function(_0x563d6d){var _0x5e750f=this;return new Promise(function(_0x1ba614,_0x5ddc9f){if(_0x563d6d[_0xeb27('0x3d')]&&_0x563d6d['agent']['id']){try{if(_0x509edb[_0xeb27('0x3e')][_0x563d6d[_0xeb27('0x3d')]['id']]){_0x509edb[_0xeb27('0x3e')][_0x563d6d['agent']['id']][_0xeb27('0x3f')]=![];_0x509edb['agents'][_0x563d6d[_0xeb27('0x3d')]['id']][_0xeb27('0x40')]=undefined;}return _0x1ba614({'code':0xc8,'message':_0x563d6d});}catch(_0x25bfd3){logger['error'](_0x25bfd3[_0xeb27('0x35')]);return _0x5ddc9f(_0x5e750f[_0xeb27('0x34')](0x1f4,_0x25bfd3));}}logger[_0xeb27('0x34')](_0xeb27('0x3c'));return _0x5ddc9f(_0x5e750f[_0xeb27('0x34')](0x1f4,_0xeb27('0x3c')));});},'AbandonInteraction':function(_0x3005dd){var _0x33516a=this;return new Promise(function(_0x9dd9a6,_0x615667){if(_0x3005dd[_0xeb27('0x15')]&&_0x3005dd['interaction']&&_0x3005dd[_0xeb27('0x17')]['id']){try{var _0x24f1df=getId(_0x3005dd[_0xeb27('0x15')],_0x3005dd[_0xeb27('0x16')]?_0x3005dd[_0xeb27('0x16')]['id']:0x0,_0x3005dd[_0xeb27('0x17')]?_0x3005dd[_0xeb27('0x17')]['id']:0x0);if(_0x509edb[_0xeb27('0x14')][_0x24f1df]){_0x509edb[_0xeb27('0x14')][_0x24f1df]['emit'](_0xeb27('0x41'));}return _0x9dd9a6({'code':0xc8,'message':_0x3005dd});}catch(_0x1762b6){logger[_0xeb27('0x34')](_0x1762b6['stack']);return _0x615667(_0x33516a['error'](0x1f4,_0x1762b6));}}logger['error'](_0xeb27('0x3c'));return _0x615667(_0x33516a[_0xeb27('0x34')](0x1f4,_0xeb27('0x3c')));});},'AgentCapacity':function(_0x5d68cb){var _0x3ec020=this;return new Promise(function(_0x49eadb,_0x2914f1){if(_0x509edb[_0xeb27('0x3e')][_0xeb27('0x42')](_0x5d68cb['id'])){for(var _0x126139 in _0x5d68cb['capacity']){if(_0x5d68cb[_0xeb27('0x43')]['hasOwnProperty'](_0x126139)){if(_0x509edb[_0xeb27('0x3e')][_0x5d68cb['id']][_0xeb27('0x42')](_0x126139+'CurrentCapacity')){_0x509edb[_0xeb27('0x3e')][_0x5d68cb['id']][_0x126139+_0xeb27('0x44')]=parseInt(_0x5d68cb[_0xeb27('0x43')][_0x126139],0xa);}}}_0x509edb[_0xeb27('0x3e')][_0x5d68cb['id']]['updateRealtime']();return _0x49eadb({'code':0xc8,'message':_0x509edb[_0xeb27('0x3e')][_0x5d68cb['id']]});}else{return _0x2914f1(_0x3ec020['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x1f8b74){return new Promise(function(_0x18571e,_0x4b55b6){var _0x4c9bfc=_[_0xeb27('0x45')](_0x509edb[_0xeb27('0x3e')]);_0x18571e({'count':_0x4c9bfc[_0xeb27('0x1a')],'rows':_0x4c9bfc});});},'ChatQueues':function(_0x214913){return new Promise(function(_0x4a2710,_0x18ac11){var _0x4d8294=[];for(var _0x2efa8f in _0x509edb['chatQueues']){if(_0x509edb[_0xeb27('0x46')]['hasOwnProperty'](_0x2efa8f)){var _0x5ec346=_0x509edb[_0xeb27('0x46')][_0x2efa8f];var _0xdef718={'id':_0x5ec346['id'],'available':_0x5ec346[_0xeb27('0x47')],'loggedIn':_0x5ec346[_0xeb27('0x48')],'name':_0x5ec346['name'],'paused':_0x5ec346[_0xeb27('0x49')],'waiting':_0x5ec346[_0xeb27('0x4a')]};_0x4d8294[_0xeb27('0x22')](_0xdef718);}}_0x4a2710({'count':_0x4d8294['length'],'rows':_0x4d8294});});},'MailQueues':function(_0x5a450c){return new Promise(function(_0x2f5af2,_0x5e19a6){var _0x2da0d3=[];for(var _0x5284b7 in _0x509edb[_0xeb27('0x4b')]){if(_0x509edb[_0xeb27('0x4b')][_0xeb27('0x42')](_0x5284b7)){var _0x46dd9b=_0x509edb[_0xeb27('0x4b')][_0x5284b7];var _0x324662={'id':_0x46dd9b['id'],'available':_0x46dd9b[_0xeb27('0x47')],'loggedIn':_0x46dd9b[_0xeb27('0x48')],'name':_0x46dd9b[_0xeb27('0x4c')],'paused':_0x46dd9b[_0xeb27('0x49')],'waiting':_0x46dd9b['waiting']};_0x2da0d3[_0xeb27('0x22')](_0x324662);}}_0x2f5af2({'count':_0x2da0d3[_0xeb27('0x1a')],'rows':_0x2da0d3});});},'OpenchannelQueues':function(_0x4546be){return new Promise(function(_0x508e7f,_0x17789a){var _0x42c024=[];for(var _0x5df87c in _0x509edb[_0xeb27('0x4d')]){if(_0x509edb[_0xeb27('0x4d')]['hasOwnProperty'](_0x5df87c)){var _0x5f32e5=_0x509edb[_0xeb27('0x4d')][_0x5df87c];var _0x2a52af={'id':_0x5f32e5['id'],'available':_0x5f32e5[_0xeb27('0x47')],'loggedIn':_0x5f32e5['loggedIn'],'name':_0x5f32e5[_0xeb27('0x4c')],'paused':_0x5f32e5[_0xeb27('0x49')],'waiting':_0x5f32e5['waiting']};_0x42c024['push'](_0x2a52af);}}_0x508e7f({'count':_0x42c024[_0xeb27('0x1a')],'rows':_0x42c024});});},'SmsQueues':function(_0x3c404e){return new Promise(function(_0x42ec36,_0x3d3168){var _0x9adf1c=[];for(var _0x38ac27 in _0x509edb['smsQueues']){if(_0x509edb[_0xeb27('0x4e')][_0xeb27('0x42')](_0x38ac27)){var _0x25750a=_0x509edb[_0xeb27('0x4e')][_0x38ac27];var _0x17e01f={'id':_0x25750a['id'],'available':_0x25750a['available'],'loggedIn':_0x25750a['loggedIn'],'name':_0x25750a[_0xeb27('0x4c')],'paused':_0x25750a[_0xeb27('0x49')],'waiting':_0x25750a[_0xeb27('0x4a')]};_0x9adf1c[_0xeb27('0x22')](_0x17e01f);}}_0x42ec36({'count':_0x9adf1c[_0xeb27('0x1a')],'rows':_0x9adf1c});});},'FaxQueues':function(_0x469387){return new Promise(function(_0x7d3565,_0x54b516){var _0x589216=[];for(var _0x322cfc in _0x509edb[_0xeb27('0x4f')]){if(_0x509edb['faxQueues'][_0xeb27('0x42')](_0x322cfc)){var _0x5a2f12=_0x509edb[_0xeb27('0x4f')][_0x322cfc];var _0x49f769={'id':_0x5a2f12['id'],'available':_0x5a2f12[_0xeb27('0x47')],'loggedIn':_0x5a2f12[_0xeb27('0x48')],'name':_0x5a2f12['name'],'paused':_0x5a2f12[_0xeb27('0x49')],'waiting':_0x5a2f12[_0xeb27('0x4a')]};_0x589216[_0xeb27('0x22')](_0x49f769);}}_0x7d3565({'count':_0x589216[_0xeb27('0x1a')],'rows':_0x589216});});},'ChatQueuesWaitingInteractions':function(_0x12cc25){return new Promise(function(_0x314b1d,_0x39a5c1){var _0x515c15=_[_0xeb27('0x45')](_0x509edb['chatQueuesWaitingInteractions']);_0x314b1d({'count':_0x515c15[_0xeb27('0x1a')],'rows':_0x515c15});});},'MailQueuesWaitingInteractions':function(_0x21a822){return new Promise(function(_0x391639,_0x416789){var _0x171ba0=_[_0xeb27('0x45')](_0x509edb['mailQueuesWaitingInteractions']);_0x391639({'count':_0x171ba0[_0xeb27('0x1a')],'rows':_0x171ba0});});},'OpenchannelQueuesWaitingInteractions':function(_0x496c5f){return new Promise(function(_0x5a3e54,_0x4c8c90){var _0x5d3a53=_['values'](_0x509edb[_0xeb27('0x50')]);_0x5a3e54({'count':_0x5d3a53[_0xeb27('0x1a')],'rows':_0x5d3a53});});},'SmsQueuesWaitingInteractions':function(_0x20fb7d){return new Promise(function(_0x14c46e,_0x2865ff){var _0x448c21=_[_0xeb27('0x45')](_0x509edb[_0xeb27('0x51')]);_0x14c46e({'count':_0x448c21[_0xeb27('0x1a')],'rows':_0x448c21});});},'FaxQueuesWaitingInteractions':function(_0x1e2d2d){return new Promise(function(_0x11b2e3,_0xd43068){var _0x3acb0b=_['values'](_0x509edb['faxQueuesWaitingInteractions']);_0x11b2e3({'count':_0x3acb0b[_0xeb27('0x1a')],'rows':_0x3acb0b});});}};var _0x50f312=jayson[_0xeb27('0x52')](_0x4dde93)[_0xeb27('0x53')]();_0x50f312['on'](_0xeb27('0x34'),function(_0x255598){logger[_0xeb27('0x34')](JSON['stringify'](_0x255598));return _0x86497f(_0x255598);});_0x50f312[_0xeb27('0x54')](0x232c,'127.0.0.1',function(){console[_0xeb27('0x55')](_0xeb27('0x56'),0x232c);return _0x169cbb(_0xeb27('0x57')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 762373b..0ec311e 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 _0x0b19=['http','then','error','message','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','some','join','\x20|\x20','when','log','stack','bluebird','jayson/promise','../../../config/logger','routing','client'];(function(_0x2b57fc,_0x4b3658){var _0x5bf238=function(_0x21661a){while(--_0x21661a){_0x2b57fc['push'](_0x2b57fc['shift']());}};_0x5bf238(++_0x4b3658);}(_0x0b19,0x190));var _0x90b1=function(_0x2d015c,_0x31bb7e){_0x2d015c=_0x2d015c-0x0;var _0x403093=_0x0b19[_0x2d015c];return _0x403093;};'use strict';var util=require('util');var BPromise=require(_0x90b1('0x0'));var jayson=require(_0x90b1('0x1'));var _=require('lodash');var logger=require(_0x90b1('0x2'))(_0x90b1('0x3'));var client=jayson[_0x90b1('0x4')][_0x90b1('0x5')]({'port':0x232a});function request(_0x3fbd1c,_0x5052fd){return new BPromise(function(_0x2de5e1,_0x1f1402){return client['request'](_0x3fbd1c,_0x5052fd)[_0x90b1('0x6')](function(_0x450f5d){if(_0x450f5d['error']){return _0x1f1402(_0x450f5d[_0x90b1('0x7')][_0x90b1('0x8')]);}else{return _0x2de5e1(_0x450f5d['result']);}})[_0x90b1('0x9')](function(_0x69b3f3){return _0x1f1402(_0x69b3f3);});});}exports['condition']=function(_0x3e0177,_0x59c8f9,_0x2be798){return function(_0x4893fd){if(_0x2be798[_0x90b1('0xa')]&&!_0x2be798[_0x90b1('0xa')][_0x3e0177]){logger[_0x90b1('0xb')](_0x90b1('0xc'),_0x3e0177);return _0x4893fd[_0x90b1('0xd')]();}var _0x218274=[];for(var _0x1b9415=0x0;_0x1b9415<_0x59c8f9[_0x90b1('0xe')];_0x1b9415+=0x1){_0x218274[_0x90b1('0xf')](request(_0x90b1('0x10'),{'command':util['format'](_0x90b1('0x11'),_0x59c8f9[_0x1b9415])})[_0x90b1('0x6')](function(_0x28b3a6){return _0x28b3a6&&_0x28b3a6[_0x90b1('0x8')]&&_0x28b3a6[_0x90b1('0x8')][_0x90b1('0x12')]('true')>=0x0?!![]:![];})['catch'](function(_0x3b0fa3){logger[_0x90b1('0x7')](_0x90b1('0x13'),_0x3e0177,_0x59c8f9[_0x1b9415]);}));}BPromise[_0x90b1('0x14')](_0x218274)['then'](function(_0x351efb){var _0x272016=_[_0x90b1('0x15')](_0x351efb);logger[_0x90b1('0xb')]('[%s][INTERVAL]\x20%s\x20%s',_0x3e0177,_0x59c8f9[_0x90b1('0x16')](_0x90b1('0x17')),_0x272016);_0x4893fd[_0x90b1('0x18')](_0x272016);})[_0x90b1('0x9')](function(_0x326a60){console[_0x90b1('0x19')](_0x326a60);logger[_0x90b1('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x3e0177,_0x59c8f9[_0x90b1('0x16')](_0x90b1('0x17')),_0x326a60[_0x90b1('0x1a')]);_0x4893fd[_0x90b1('0xd')]();});};}; \ No newline at end of file +var _0xf81c=['all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','then','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s'];(function(_0x2ae57a,_0x4cd176){var _0x34e0f8=function(_0x27d85d){while(--_0x27d85d){_0x2ae57a['push'](_0x2ae57a['shift']());}};_0x34e0f8(++_0x4cd176);}(_0xf81c,0x8d));var _0xcf81=function(_0x4b43c0,_0x3a8091){_0x4b43c0=_0x4b43c0-0x0;var _0x574c13=_0xf81c[_0x4b43c0];return _0x574c13;};'use strict';var util=require(_0xcf81('0x0'));var BPromise=require(_0xcf81('0x1'));var jayson=require(_0xcf81('0x2'));var _=require(_0xcf81('0x3'));var logger=require(_0xcf81('0x4'))(_0xcf81('0x5'));var client=jayson[_0xcf81('0x6')][_0xcf81('0x7')]({'port':0x232a});function request(_0x4ef231,_0x18b7c2){return new BPromise(function(_0x49876f,_0x16c6c0){return client['request'](_0x4ef231,_0x18b7c2)[_0xcf81('0x8')](function(_0x2b7454){if(_0x2b7454[_0xcf81('0x9')]){return _0x16c6c0(_0x2b7454[_0xcf81('0x9')][_0xcf81('0xa')]);}else{return _0x49876f(_0x2b7454[_0xcf81('0xb')]);}})[_0xcf81('0xc')](function(_0x4d7839){return _0x16c6c0(_0x4d7839);});});}exports[_0xcf81('0xd')]=function(_0x1f2876,_0x22fe0f,_0x51bfe4){return function(_0x279657){if(_0x51bfe4[_0xcf81('0xe')]&&!_0x51bfe4[_0xcf81('0xe')][_0x1f2876]){logger['info'](_0xcf81('0xf'),_0x1f2876);return _0x279657[_0xcf81('0x10')]();}var _0x55ead7=[];for(var _0x21a563=0x0;_0x21a563<_0x22fe0f['length'];_0x21a563+=0x1){_0x55ead7[_0xcf81('0x11')](request(_0xcf81('0x12'),{'command':util[_0xcf81('0x13')](_0xcf81('0x14'),_0x22fe0f[_0x21a563])})[_0xcf81('0x8')](function(_0x339dbf){return _0x339dbf&&_0x339dbf[_0xcf81('0xa')]&&_0x339dbf[_0xcf81('0xa')][_0xcf81('0x15')](_0xcf81('0x16'))>=0x0?!![]:![];})[_0xcf81('0xc')](function(_0x3eaae8){logger[_0xcf81('0x9')](_0xcf81('0x17'),_0x1f2876,_0x22fe0f[_0x21a563]);}));}BPromise[_0xcf81('0x18')](_0x55ead7)['then'](function(_0x3377ce){var _0x3598cc=_[_0xcf81('0x19')](_0x3377ce);logger[_0xcf81('0x1a')](_0xcf81('0x1b'),_0x1f2876,_0x22fe0f[_0xcf81('0x1c')](_0xcf81('0x1d')),_0x3598cc);_0x279657[_0xcf81('0x1e')](_0x3598cc);})[_0xcf81('0xc')](function(_0xe6e36a){console[_0xcf81('0x1f')](_0xe6e36a);logger[_0xcf81('0x9')](_0xcf81('0x1b'),_0x1f2876,_0x22fe0f[_0xcf81('0x1c')]('\x20|\x20'),_0xe6e36a[_0xcf81('0x20')]);_0x279657[_0xcf81('0x10')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b9da19b..753df59 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 _0x6fb8=['agentringnoanswer','isNil','rejected','forIn','channel','abandon','agentconnect','answered_elsewhere','destuniqueid','complete','blindtransfer','cdr','attendedtransfer','transfertargetconnectedlinenum','secondtransfererchannel','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','destinationchannel','agentconnectAt','endtime','diffTime','agentcalledAt','agentringnoanswerAt','answertime','starttime','connect','lodash','util','./utils','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','membername','interface','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destchannel','assign','now','called'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0x6fb8,0x1ab));var _0x86fb=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0x6fb8[_0x12e3e3];return _0x26602e;};'use strict';var _=require(_0x86fb('0x0'));var util=require(_0x86fb('0x1'));var utils=require(_0x86fb('0x2'));var agents={};var transfers={};function writeDB(_0x4eb2b6){utils['info'](util[_0x86fb('0x3')](_0x86fb('0x4'),_0x4eb2b6['uniqueid'],_0x4eb2b6['channel'],_0x4eb2b6['queue'],_0x4eb2b6[_0x86fb('0x5')],_0x4eb2b6[_0x86fb('0x6')],_0x4eb2b6['calleridnum'],_0x4eb2b6['connectedlinenum'],_0x4eb2b6[_0x86fb('0x7')]));if(_0x4eb2b6[_0x86fb('0x8')]){utils[_0x86fb('0x9')](_0x4eb2b6[_0x86fb('0x8')])[_0x86fb('0xa')](function(_0x1ffbda){if(_0x1ffbda){_0x4eb2b6[_0x86fb('0xb')]=_0x1ffbda[_0x86fb('0xb')];_0x4eb2b6[_0x86fb('0xc')]=_0x4eb2b6[_0x86fb('0xd')]?_0x1ffbda[_0x86fb('0xe')]:![];_0x4eb2b6[_0x86fb('0xf')]=_0x4eb2b6['agentacw']?_0x1ffbda[_0x86fb('0x10')]:null;}utils[_0x86fb('0x11')](_0x86fb('0x12'),_0x4eb2b6);});}else{utils['request']('CreateVoiceAgentReport',_0x4eb2b6);}delete agents[_0x4eb2b6[_0x86fb('0x13')]];}function isClosed(_0x566525){return _0x566525['agentringnoanswer']||_0x566525['agentconnect']||_0x566525[_0x86fb('0xd')];}exports['agentcalled']=function(_0x563fbc){agents[_0x563fbc[_0x86fb('0x13')]]=_[_0x86fb('0x14')](_0x563fbc,{'agentcalled':!![],'agentcalledAt':utils[_0x86fb('0x15')](),'lastevent':_0x86fb('0x16')});};exports[_0x86fb('0x17')]=function(_0x147b0f){if(!_[_0x86fb('0x18')](agents[_0x147b0f[_0x86fb('0x13')]])){agents[_0x147b0f[_0x86fb('0x13')]]=_[_0x86fb('0x14')](agents[_0x147b0f[_0x86fb('0x13')]],_0x147b0f,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0x86fb('0x15')](),'lastevent':'rejected','reason':_0x86fb('0x19')});}};exports['queuecallerabandon']=function(_0x2261b5){_[_0x86fb('0x1a')](agents,function(_0x29733d,_0x2c9095){if(_0x29733d[_0x86fb('0x1b')]==_0x2261b5['channel']){if(!isClosed(_0x29733d)){_0x29733d=_[_0x86fb('0x14')](_0x29733d,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0x86fb('0x15')](),'lastevent':_0x86fb('0x1c'),'reason':_0x86fb('0x1c')});}}});};exports[_0x86fb('0x1d')]=function(_0x4a3f10){if(!_[_0x86fb('0x18')](agents[_0x4a3f10['destchannel']])){agents[_0x4a3f10[_0x86fb('0x13')]]=_['assign'](agents[_0x4a3f10[_0x86fb('0x13')]],_0x4a3f10,{'agentconnect':!![],'agentconnectAt':utils['now'](),'lastevent':'connect'});_[_0x86fb('0x1a')](agents,function(_0x2c53ca,_0x5a9bea){if(_0x2c53ca[_0x86fb('0x1b')]==_0x4a3f10[_0x86fb('0x1b')]){if(!isClosed(_0x2c53ca)){_0x2c53ca=_[_0x86fb('0x14')](_0x2c53ca,{'agentringnoanswer':!![],'agentringnoanswerAt':utils['now'](),'lastevent':'answered_elsewhere','reason':_0x86fb('0x1e'),'answeredelsewheredestinationuniqueid':_0x4a3f10[_0x86fb('0x1f')],'answeredelsewheremembername':_0x4a3f10['membername']});}}});}};exports['agentcomplete']=function(_0x58f469){if(!_[_0x86fb('0x18')](agents[_0x58f469['destchannel']])){agents[_0x58f469[_0x86fb('0x13')]]=_[_0x86fb('0x14')](agents[_0x58f469[_0x86fb('0x13')]],_0x58f469,{'agentcomplete':!![],'agentcompleteAt':utils['now'](),'lastevent':_0x86fb('0x20')});}};exports[_0x86fb('0x21')]=function(_0x3a4d32){if(!_[_0x86fb('0x18')](agents[_0x3a4d32['transfererchannel']])){this[_0x86fb('0x22')]({'destinationchannel':_0x3a4d32['transfererchannel']});}};exports[_0x86fb('0x23')]=function(_0x48f20f){_['forIn'](agents,function(_0x459c14){if(_0x459c14[_0x86fb('0x1b')]==_0x48f20f['origtransfererchannel']){transfers[_0x459c14[_0x86fb('0x13')]]=_['clone'](_0x459c14);transfers[_0x459c14[_0x86fb('0x13')]]=_[_0x86fb('0x14')](transfers[_0x459c14[_0x86fb('0x13')]],{'channel':_0x48f20f['transfertargetchannel'],'calleridname':_0x48f20f['transfertargetcalleridname'],'calleridnum':_0x48f20f[_0x86fb('0x24')]});}else if(_0x459c14['channel']==_0x48f20f[_0x86fb('0x25')]){transfers[_0x459c14[_0x86fb('0x13')]]=_['clone'](_0x459c14);transfers[_0x459c14[_0x86fb('0x13')]]=_[_0x86fb('0x14')](transfers[_0x459c14['destchannel']],{'channel':_0x48f20f[_0x86fb('0x26')],'calleridname':_0x48f20f[_0x86fb('0x27')],'calleridnum':_0x48f20f[_0x86fb('0x28')]});}});};exports['cdr']=function(_0x1f6a1a){if(!_['isNil'](agents[_0x1f6a1a[_0x86fb('0x29')]])){if(!_[_0x86fb('0x18')](agents[_0x1f6a1a['destinationchannel']][_0x86fb('0x2a')])){agents[_0x1f6a1a[_0x86fb('0x29')]]=_[_0x86fb('0x14')](agents[_0x1f6a1a[_0x86fb('0x29')]],{'agentcomplete':!![],'agentcompleteAt':_0x1f6a1a[_0x86fb('0x2b')],'holdtime':utils[_0x86fb('0x2c')](agents[_0x1f6a1a[_0x86fb('0x29')]][_0x86fb('0x2a')],agents[_0x1f6a1a[_0x86fb('0x29')]][_0x86fb('0x2d')]),'talktime':utils['diffTime'](_0x1f6a1a['endtime'],agents[_0x1f6a1a[_0x86fb('0x29')]]['agentconnectAt']),'lastevent':'complete'});}else if(_[_0x86fb('0x18')](agents[_0x1f6a1a['destinationchannel']][_0x86fb('0x2e')])){agents[_0x1f6a1a[_0x86fb('0x29')]]=_[_0x86fb('0x14')](agents[_0x1f6a1a[_0x86fb('0x29')]],{'agentringnoanswer':!![],'agentringnoanswerAt':_0x1f6a1a[_0x86fb('0x2f')]||_0x1f6a1a[_0x86fb('0x30')],'reason':'unknown'});}writeDB(agents[_0x1f6a1a[_0x86fb('0x29')]]);if(!_[_0x86fb('0x18')](transfers[_0x1f6a1a[_0x86fb('0x29')]])){agents[_0x1f6a1a[_0x86fb('0x29')]]=_[_0x86fb('0x14')](transfers[_0x1f6a1a[_0x86fb('0x29')]],{'agentcalledAt':utils['now'](),'agentconnectAt':transfers[_0x1f6a1a[_0x86fb('0x29')]][_0x86fb('0x1d')]?utils[_0x86fb('0x15')]():null,'lastevent':_0x86fb('0x31'),'reason':'transfer'});delete transfers[_0x1f6a1a[_0x86fb('0x29')]];}}}; \ No newline at end of file +var _0x7d86=['attendedtransfer','origtransfererchannel','clone','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','secondtransfererchannel','transfereechannel','transfereecalleridname','destinationchannel','diffTime','agentconnectAt','endtime','agentringnoanswerAt','starttime','transfer','util','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','interface','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acwTimeout','request','CreateVoiceAgentReport','agentringnoanswer','agentconnect','agentcalled','assign','now','isNil','destchannel','rejected','queuecallerabandon','forIn','abandon','connect','answered_elsewhere','destuniqueid','membername','agentcomplete','complete','blindtransfer','transfererchannel','cdr'];(function(_0x15f71b,_0x4b59d1){var _0x42c087=function(_0x673f59){while(--_0x673f59){_0x15f71b['push'](_0x15f71b['shift']());}};_0x42c087(++_0x4b59d1);}(_0x7d86,0xaf));var _0x67d8=function(_0x10bb17,_0x215125){_0x10bb17=_0x10bb17-0x0;var _0x35a412=_0x7d86[_0x10bb17];return _0x35a412;};'use strict';var _=require('lodash');var util=require(_0x67d8('0x0'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x289666){utils[_0x67d8('0x1')](util[_0x67d8('0x2')](_0x67d8('0x3'),_0x289666[_0x67d8('0x4')],_0x289666[_0x67d8('0x5')],_0x289666[_0x67d8('0x6')],_0x289666['membername'],_0x289666[_0x67d8('0x7')],_0x289666['calleridnum'],_0x289666[_0x67d8('0x8')],_0x289666[_0x67d8('0x9')]));if(_0x289666['queue']){utils[_0x67d8('0xa')](_0x289666[_0x67d8('0x6')])[_0x67d8('0xb')](function(_0x206dbc){if(_0x206dbc){_0x289666[_0x67d8('0xc')]=_0x206dbc[_0x67d8('0xc')];_0x289666['agentacw']=_0x289666['agentcomplete']?_0x206dbc['acw']:![];_0x289666['acwtime']=_0x289666[_0x67d8('0xd')]?_0x206dbc[_0x67d8('0xe')]:null;}utils[_0x67d8('0xf')](_0x67d8('0x10'),_0x289666);});}else{utils[_0x67d8('0xf')]('CreateVoiceAgentReport',_0x289666);}delete agents[_0x289666['destchannel']];}function isClosed(_0x2e729e){return _0x2e729e[_0x67d8('0x11')]||_0x2e729e[_0x67d8('0x12')]||_0x2e729e['agentcomplete'];}exports[_0x67d8('0x13')]=function(_0x34fff6){agents[_0x34fff6['destchannel']]=_[_0x67d8('0x14')](_0x34fff6,{'agentcalled':!![],'agentcalledAt':utils[_0x67d8('0x15')](),'lastevent':'called'});};exports['agentringnoanswer']=function(_0x4a805e){if(!_[_0x67d8('0x16')](agents[_0x4a805e[_0x67d8('0x17')]])){agents[_0x4a805e[_0x67d8('0x17')]]=_[_0x67d8('0x14')](agents[_0x4a805e['destchannel']],_0x4a805e,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0x67d8('0x15')](),'lastevent':_0x67d8('0x18'),'reason':'rejected'});}};exports[_0x67d8('0x19')]=function(_0x5aeaab){_[_0x67d8('0x1a')](agents,function(_0x19ed35,_0x13f293){if(_0x19ed35['channel']==_0x5aeaab[_0x67d8('0x5')]){if(!isClosed(_0x19ed35)){_0x19ed35=_['assign'](_0x19ed35,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0x67d8('0x15')](),'lastevent':'abandon','reason':_0x67d8('0x1b')});}}});};exports[_0x67d8('0x12')]=function(_0xf7a3a5){if(!_[_0x67d8('0x16')](agents[_0xf7a3a5[_0x67d8('0x17')]])){agents[_0xf7a3a5[_0x67d8('0x17')]]=_[_0x67d8('0x14')](agents[_0xf7a3a5[_0x67d8('0x17')]],_0xf7a3a5,{'agentconnect':!![],'agentconnectAt':utils[_0x67d8('0x15')](),'lastevent':_0x67d8('0x1c')});_[_0x67d8('0x1a')](agents,function(_0x2868d9,_0x192992){if(_0x2868d9[_0x67d8('0x5')]==_0xf7a3a5[_0x67d8('0x5')]){if(!isClosed(_0x2868d9)){_0x2868d9=_['assign'](_0x2868d9,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0x67d8('0x15')](),'lastevent':'answered_elsewhere','reason':_0x67d8('0x1d'),'answeredelsewheredestinationuniqueid':_0xf7a3a5[_0x67d8('0x1e')],'answeredelsewheremembername':_0xf7a3a5[_0x67d8('0x1f')]});}}});}};exports[_0x67d8('0x20')]=function(_0x3802b1){if(!_[_0x67d8('0x16')](agents[_0x3802b1['destchannel']])){agents[_0x3802b1[_0x67d8('0x17')]]=_[_0x67d8('0x14')](agents[_0x3802b1[_0x67d8('0x17')]],_0x3802b1,{'agentcomplete':!![],'agentcompleteAt':utils[_0x67d8('0x15')](),'lastevent':_0x67d8('0x21')});}};exports[_0x67d8('0x22')]=function(_0x27595f){if(!_['isNil'](agents[_0x27595f[_0x67d8('0x23')]])){this[_0x67d8('0x24')]({'destinationchannel':_0x27595f[_0x67d8('0x23')]});}};exports[_0x67d8('0x25')]=function(_0x607959){_[_0x67d8('0x1a')](agents,function(_0x314565){if(_0x314565[_0x67d8('0x5')]==_0x607959[_0x67d8('0x26')]){transfers[_0x314565[_0x67d8('0x17')]]=_[_0x67d8('0x27')](_0x314565);transfers[_0x314565[_0x67d8('0x17')]]=_['assign'](transfers[_0x314565[_0x67d8('0x17')]],{'channel':_0x607959[_0x67d8('0x28')],'calleridname':_0x607959[_0x67d8('0x29')],'calleridnum':_0x607959[_0x67d8('0x2a')]});}else if(_0x314565['channel']==_0x607959[_0x67d8('0x2b')]){transfers[_0x314565[_0x67d8('0x17')]]=_[_0x67d8('0x27')](_0x314565);transfers[_0x314565[_0x67d8('0x17')]]=_[_0x67d8('0x14')](transfers[_0x314565[_0x67d8('0x17')]],{'channel':_0x607959[_0x67d8('0x2c')],'calleridname':_0x607959[_0x67d8('0x2d')],'calleridnum':_0x607959['transfereeconnectedlinenum']});}});};exports['cdr']=function(_0x38676d){if(!_[_0x67d8('0x16')](agents[_0x38676d['destinationchannel']])){if(!_[_0x67d8('0x16')](agents[_0x38676d[_0x67d8('0x2e')]]['agentconnectAt'])){agents[_0x38676d[_0x67d8('0x2e')]]=_[_0x67d8('0x14')](agents[_0x38676d['destinationchannel']],{'agentcomplete':!![],'agentcompleteAt':_0x38676d['endtime'],'holdtime':utils[_0x67d8('0x2f')](agents[_0x38676d[_0x67d8('0x2e')]][_0x67d8('0x30')],agents[_0x38676d['destinationchannel']]['agentcalledAt']),'talktime':utils[_0x67d8('0x2f')](_0x38676d[_0x67d8('0x31')],agents[_0x38676d[_0x67d8('0x2e')]]['agentconnectAt']),'lastevent':_0x67d8('0x21')});}else if(_['isNil'](agents[_0x38676d[_0x67d8('0x2e')]][_0x67d8('0x32')])){agents[_0x38676d['destinationchannel']]=_['assign'](agents[_0x38676d[_0x67d8('0x2e')]],{'agentringnoanswer':!![],'agentringnoanswerAt':_0x38676d['answertime']||_0x38676d[_0x67d8('0x33')],'reason':'unknown'});}writeDB(agents[_0x38676d[_0x67d8('0x2e')]]);if(!_[_0x67d8('0x16')](transfers[_0x38676d[_0x67d8('0x2e')]])){agents[_0x38676d[_0x67d8('0x2e')]]=_[_0x67d8('0x14')](transfers[_0x38676d['destinationchannel']],{'agentcalledAt':utils[_0x67d8('0x15')](),'agentconnectAt':transfers[_0x38676d['destinationchannel']][_0x67d8('0x12')]?utils[_0x67d8('0x15')]():null,'lastevent':'connect','reason':_0x67d8('0x34')});delete transfers[_0x38676d[_0x67d8('0x2e')]];}}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 770b96e..8516c72 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 _0x1f04=['now','musiconholdstop','mohtime','diffTime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','xmd-callerid-preview','xmd-callerid','xmd-queue','lastapplication','lastdata','xmd-contactid','ContactId','newexten','application','toLowerCase','set','startsWith','cdr','appdata','substring','agentcomplete','assign','isBefore','starttime','isAfter','endtime','destinationchannel','Local/_attended@transfer','duration','billableseconds','hangup','lodash','util','./utils','answertime','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','accountcode','source','disposition','getUserByInternal','then','UserId','CreateVoiceCallReport','request','channel','newchannel','isNil','musiconholdstart','musiconholdstartAt'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1f04,0x13b));var _0x41f0=function(_0x2de7cd,_0x1fe61f){_0x2de7cd=_0x2de7cd-0x0;var _0x31d7cb=_0x1f04[_0x2de7cd];return _0x31d7cb;};'use strict';var _=require(_0x41f0('0x0'));var util=require(_0x41f0('0x1'));var utils=require(_0x41f0('0x2'));var channels={};var timeouts={};function writeDB(_0x3dd0de){return function(){_0x3dd0de[_0x41f0('0x3')]=_0x3dd0de[_0x41f0('0x3')]||null;utils[_0x41f0('0x4')](util[_0x41f0('0x5')](_0x41f0('0x6'),_0x3dd0de[_0x41f0('0x7')],_0x3dd0de['channel'],_0x3dd0de['type'],_0x3dd0de[_0x41f0('0x8')],_0x3dd0de[_0x41f0('0x9')],_0x3dd0de['destination'],_0x3dd0de['callerid'],_0x3dd0de[_0x41f0('0xa')]));if(_0x3dd0de[_0x41f0('0x8')]){utils[_0x41f0('0xb')](_0x3dd0de[_0x41f0('0x8')])[_0x41f0('0xc')](function(_0x3d07eb){if(_0x3d07eb){_0x3dd0de[_0x41f0('0xd')]=_0x3d07eb['id'];}utils['request'](_0x41f0('0xe'),_0x3dd0de);});}else{utils[_0x41f0('0xf')](_0x41f0('0xe'),_0x3dd0de);}if(channels[_0x3dd0de[_0x41f0('0x10')]]){delete channels[_0x3dd0de['channel']];}if(timeouts[_0x3dd0de['channel']]){delete timeouts[_0x3dd0de[_0x41f0('0x10')]];}};}exports[_0x41f0('0x11')]=function(_0x3f8cdc){if(_[_0x41f0('0x12')](channels[_0x3f8cdc[_0x41f0('0x10')]])&&_0x3f8cdc[_0x41f0('0x7')]==_0x3f8cdc['linkedid']){channels[_0x3f8cdc['channel']]={'mohtime':0x0};if(_0x3f8cdc[_0x41f0('0x8')]){channels[_0x3f8cdc[_0x41f0('0x10')]]['accountcode']=_0x3f8cdc[_0x41f0('0x8')];}}};exports[_0x41f0('0x13')]=function(_0x13a4b4){if(!_[_0x41f0('0x12')](channels[_0x13a4b4[_0x41f0('0x10')]])){channels[_0x13a4b4[_0x41f0('0x10')]][_0x41f0('0x14')]=utils[_0x41f0('0x15')]();}};exports[_0x41f0('0x16')]=function(_0x20d3b7){if(!_[_0x41f0('0x12')](channels[_0x20d3b7[_0x41f0('0x10')]])){if(!_[_0x41f0('0x12')](channels[_0x20d3b7[_0x41f0('0x10')]]['musiconholdstartAt'])){channels[_0x20d3b7[_0x41f0('0x10')]][_0x41f0('0x17')]+=utils[_0x41f0('0x18')](utils[_0x41f0('0x15')](),channels[_0x20d3b7[_0x41f0('0x10')]][_0x41f0('0x14')]);delete channels[_0x20d3b7[_0x41f0('0x10')]][_0x41f0('0x14')];}}};exports[_0x41f0('0x19')]=function(_0x452ec4){if(!_['isNil'](channels[_0x452ec4[_0x41f0('0x10')]])){if(!_[_0x41f0('0x12')](_0x452ec4[_0x41f0('0x1a')][_0x41f0('0x1b')])){channels[_0x452ec4[_0x41f0('0x10')]][_0x41f0('0x9')]=_0x452ec4[_0x41f0('0x1c')];}if(!_[_0x41f0('0x12')](_0x452ec4[_0x41f0('0x1a')][_0x41f0('0x1d')])){channels[_0x452ec4[_0x41f0('0x10')]]['destination']=_0x452ec4[_0x41f0('0x1c')];}if(!_[_0x41f0('0x12')](_0x452ec4[_0x41f0('0x1a')][_0x41f0('0x1e')])||!_[_0x41f0('0x12')](_0x452ec4[_0x41f0('0x1a')][_0x41f0('0x1f')])){channels[_0x452ec4[_0x41f0('0x10')]]['callerid']=_0x452ec4[_0x41f0('0x1c')];}if(!_[_0x41f0('0x12')](_0x452ec4[_0x41f0('0x1a')][_0x41f0('0x20')])){channels[_0x452ec4[_0x41f0('0x10')]][_0x41f0('0x21')]='Queue';channels[_0x452ec4[_0x41f0('0x10')]][_0x41f0('0x22')]=_0x452ec4[_0x41f0('0x1c')];channels[_0x452ec4[_0x41f0('0x10')]]['queue']=!![];}if(!_[_0x41f0('0x12')](_0x452ec4[_0x41f0('0x1a')][_0x41f0('0x23')])){channels[_0x452ec4[_0x41f0('0x10')]][_0x41f0('0x24')]=_0x452ec4[_0x41f0('0x1c')];}if(!_[_0x41f0('0x12')](_0x452ec4[_0x41f0('0x1a')]['outboundrouteid'])){channels[_0x452ec4[_0x41f0('0x10')]]['routeid']=_0x452ec4[_0x41f0('0x1c')];}}};exports[_0x41f0('0x25')]=function(_0xdb8c92){if(!_[_0x41f0('0x12')](channels[_0xdb8c92[_0x41f0('0x10')]])){if(_0xdb8c92[_0x41f0('0x26')][_0x41f0('0x27')]()==_0x41f0('0x28')&&_[_0x41f0('0x29')](_0xdb8c92['appdata'][_0x41f0('0x27')](),_0x41f0('0x2a'))){var _0x1d8057=_0xdb8c92[_0x41f0('0x2b')]['split']('=');var _0x3ff5b8=_0x1d8057[0x0][_0x41f0('0x2c')](_0x1d8057[0x0]['lastIndexOf']('(')+0x1,_0x1d8057[0x0]['lastIndexOf'](')'));var _0xebdbd=_0x1d8057[0x1];channels[_0xdb8c92[_0x41f0('0x10')]][_0x3ff5b8]=_0xebdbd;}}};exports[_0x41f0('0x2d')]=function(_0x1b4079){if(!_[_0x41f0('0x12')](channels[_0x1b4079['channel']])){channels[_0x1b4079[_0x41f0('0x10')]][_0x41f0('0x8')]=_0x1b4079['destaccountcode'];}};function handleCDR(_0x56b043){if(_['isNil'](timeouts[_0x56b043[_0x41f0('0x10')]])){channels[_0x56b043[_0x41f0('0x10')]]=_[_0x41f0('0x2e')](_0x56b043,channels[_0x56b043[_0x41f0('0x10')]]);}else{clearTimeout(timeouts[_0x56b043[_0x41f0('0x10')]]);channels[_0x56b043[_0x41f0('0x10')]]=_[_0x41f0('0x2e')](channels[_0x56b043['channel']],{'starttime':utils[_0x41f0('0x2f')](_0x56b043['starttime'],channels[_0x56b043[_0x41f0('0x10')]]['starttime'])?_0x56b043[_0x41f0('0x30')]:channels[_0x56b043[_0x41f0('0x10')]][_0x41f0('0x30')],'answertime':utils['isBefore'](_0x56b043[_0x41f0('0x3')],channels[_0x56b043[_0x41f0('0x10')]][_0x41f0('0x3')])?_0x56b043[_0x41f0('0x3')]:channels[_0x56b043[_0x41f0('0x10')]][_0x41f0('0x3')]});if(utils[_0x41f0('0x31')](_0x56b043[_0x41f0('0x32')],channels[_0x56b043['channel']][_0x41f0('0x32')])){channels[_0x56b043[_0x41f0('0x10')]]=_[_0x41f0('0x2e')](channels[_0x56b043[_0x41f0('0x10')]],{'endtime':_0x56b043['endtime'],'destinationchannel':_[_0x41f0('0x29')](_0x56b043[_0x41f0('0x33')],_0x41f0('0x34'))?channels[_0x56b043[_0x41f0('0x10')]]['destinationchannel']:_0x56b043['destinationchannel']});}channels[_0x56b043[_0x41f0('0x10')]][_0x41f0('0x35')]=utils['diffTime'](channels[_0x56b043[_0x41f0('0x10')]][_0x41f0('0x32')],channels[_0x56b043['channel']]['starttime']);channels[_0x56b043['channel']][_0x41f0('0x36')]=utils[_0x41f0('0x18')](channels[_0x56b043[_0x41f0('0x10')]][_0x41f0('0x32')],channels[_0x56b043[_0x41f0('0x10')]][_0x41f0('0x3')]);if(_0x56b043[_0x41f0('0x21')][_0x41f0('0x27')]()!=_0x41f0('0x37')){channels[_0x56b043[_0x41f0('0x10')]][_0x41f0('0x22')]=_0x56b043[_0x41f0('0x22')];channels[_0x56b043[_0x41f0('0x10')]]['lastapplication']=_0x56b043['lastapplication'];}}timeouts[_0x56b043['channel']]=setTimeout(writeDB(channels[_0x56b043[_0x41f0('0x10')]]),0x3e8);}exports[_0x41f0('0x2a')]=function(_0x2a2716){if(!_[_0x41f0('0x12')](channels[_0x2a2716['channel']])){handleCDR(_0x2a2716);}else if(!_[_0x41f0('0x12')](channels[_0x2a2716[_0x41f0('0x33')]])){_0x2a2716[_0x41f0('0x10')]=_0x2a2716[_0x41f0('0x33')];handleCDR(_0x2a2716);}}; \ No newline at end of file +var _0xe756=['destaccountcode','assign','isBefore','starttime','isAfter','endtime','Local/_attended@transfer','destinationchannel','duration','billableseconds','lastdata','lodash','util','./utils','answertime','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','type','accountcode','source','callerid','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','channel','newchannel','isNil','uniqueid','linkedid','musiconholdstartAt','now','musiconholdstop','mohtime','diffTime','varset','variable','xmd-phone','value','xmd-callerid-preview','xmd-queue','lastapplication','Queue','queue','xmd-contactid','ContactId','routeid','newexten','application','set','startsWith','toLowerCase','cdr','appdata','split','substring','lastIndexOf','agentcomplete'];(function(_0x45fd89,_0x57f39a){var _0xa0dc0=function(_0x2e4955){while(--_0x2e4955){_0x45fd89['push'](_0x45fd89['shift']());}};_0xa0dc0(++_0x57f39a);}(_0xe756,0x1b6));var _0x6e75=function(_0x45cf8e,_0x43d33c){_0x45cf8e=_0x45cf8e-0x0;var _0x1416ef=_0xe756[_0x45cf8e];return _0x1416ef;};'use strict';var _=require(_0x6e75('0x0'));var util=require(_0x6e75('0x1'));var utils=require(_0x6e75('0x2'));var channels={};var timeouts={};function writeDB(_0x3c1320){return function(){_0x3c1320[_0x6e75('0x3')]=_0x3c1320['answertime']||null;utils[_0x6e75('0x4')](util[_0x6e75('0x5')](_0x6e75('0x6'),_0x3c1320['uniqueid'],_0x3c1320['channel'],_0x3c1320[_0x6e75('0x7')],_0x3c1320[_0x6e75('0x8')],_0x3c1320[_0x6e75('0x9')],_0x3c1320['destination'],_0x3c1320[_0x6e75('0xa')],_0x3c1320[_0x6e75('0xb')]));if(_0x3c1320[_0x6e75('0x8')]){utils[_0x6e75('0xc')](_0x3c1320['accountcode'])[_0x6e75('0xd')](function(_0x39d119){if(_0x39d119){_0x3c1320[_0x6e75('0xe')]=_0x39d119['id'];}utils[_0x6e75('0xf')](_0x6e75('0x10'),_0x3c1320);});}else{utils[_0x6e75('0xf')](_0x6e75('0x10'),_0x3c1320);}if(channels[_0x3c1320[_0x6e75('0x11')]]){delete channels[_0x3c1320[_0x6e75('0x11')]];}if(timeouts[_0x3c1320[_0x6e75('0x11')]]){delete timeouts[_0x3c1320[_0x6e75('0x11')]];}};}exports[_0x6e75('0x12')]=function(_0x121a24){if(_[_0x6e75('0x13')](channels[_0x121a24[_0x6e75('0x11')]])&&_0x121a24[_0x6e75('0x14')]==_0x121a24[_0x6e75('0x15')]){channels[_0x121a24['channel']]={'mohtime':0x0};if(_0x121a24[_0x6e75('0x8')]){channels[_0x121a24['channel']][_0x6e75('0x8')]=_0x121a24[_0x6e75('0x8')];}}};exports['musiconholdstart']=function(_0x49c00b){if(!_[_0x6e75('0x13')](channels[_0x49c00b[_0x6e75('0x11')]])){channels[_0x49c00b[_0x6e75('0x11')]][_0x6e75('0x16')]=utils[_0x6e75('0x17')]();}};exports[_0x6e75('0x18')]=function(_0x3e58b8){if(!_[_0x6e75('0x13')](channels[_0x3e58b8[_0x6e75('0x11')]])){if(!_[_0x6e75('0x13')](channels[_0x3e58b8[_0x6e75('0x11')]]['musiconholdstartAt'])){channels[_0x3e58b8['channel']][_0x6e75('0x19')]+=utils[_0x6e75('0x1a')](utils[_0x6e75('0x17')](),channels[_0x3e58b8[_0x6e75('0x11')]]['musiconholdstartAt']);delete channels[_0x3e58b8[_0x6e75('0x11')]][_0x6e75('0x16')];}}};exports[_0x6e75('0x1b')]=function(_0x40a2ef){if(!_['isNil'](channels[_0x40a2ef['channel']])){if(!_[_0x6e75('0x13')](_0x40a2ef['variable']['xmd-originatecalleridnum'])){channels[_0x40a2ef[_0x6e75('0x11')]][_0x6e75('0x9')]=_0x40a2ef['value'];}if(!_['isNil'](_0x40a2ef[_0x6e75('0x1c')][_0x6e75('0x1d')])){channels[_0x40a2ef[_0x6e75('0x11')]]['destination']=_0x40a2ef[_0x6e75('0x1e')];}if(!_['isNil'](_0x40a2ef[_0x6e75('0x1c')][_0x6e75('0x1f')])||!_[_0x6e75('0x13')](_0x40a2ef['variable']['xmd-callerid'])){channels[_0x40a2ef['channel']]['callerid']=_0x40a2ef['value'];}if(!_[_0x6e75('0x13')](_0x40a2ef[_0x6e75('0x1c')][_0x6e75('0x20')])){channels[_0x40a2ef[_0x6e75('0x11')]][_0x6e75('0x21')]=_0x6e75('0x22');channels[_0x40a2ef[_0x6e75('0x11')]]['lastdata']=_0x40a2ef[_0x6e75('0x1e')];channels[_0x40a2ef[_0x6e75('0x11')]][_0x6e75('0x23')]=!![];}if(!_[_0x6e75('0x13')](_0x40a2ef[_0x6e75('0x1c')][_0x6e75('0x24')])){channels[_0x40a2ef[_0x6e75('0x11')]][_0x6e75('0x25')]=_0x40a2ef[_0x6e75('0x1e')];}if(!_[_0x6e75('0x13')](_0x40a2ef[_0x6e75('0x1c')]['outboundrouteid'])){channels[_0x40a2ef[_0x6e75('0x11')]][_0x6e75('0x26')]=_0x40a2ef[_0x6e75('0x1e')];}}};exports[_0x6e75('0x27')]=function(_0x31a353){if(!_[_0x6e75('0x13')](channels[_0x31a353[_0x6e75('0x11')]])){if(_0x31a353[_0x6e75('0x28')]['toLowerCase']()==_0x6e75('0x29')&&_[_0x6e75('0x2a')](_0x31a353['appdata'][_0x6e75('0x2b')](),_0x6e75('0x2c'))){var _0x1a310b=_0x31a353[_0x6e75('0x2d')][_0x6e75('0x2e')]('=');var _0x46a510=_0x1a310b[0x0][_0x6e75('0x2f')](_0x1a310b[0x0]['lastIndexOf']('(')+0x1,_0x1a310b[0x0][_0x6e75('0x30')](')'));var _0x133038=_0x1a310b[0x1];channels[_0x31a353['channel']][_0x46a510]=_0x133038;}}};exports[_0x6e75('0x31')]=function(_0x265257){if(!_[_0x6e75('0x13')](channels[_0x265257[_0x6e75('0x11')]])){channels[_0x265257[_0x6e75('0x11')]][_0x6e75('0x8')]=_0x265257[_0x6e75('0x32')];}};function handleCDR(_0x5deb04){if(_[_0x6e75('0x13')](timeouts[_0x5deb04[_0x6e75('0x11')]])){channels[_0x5deb04[_0x6e75('0x11')]]=_[_0x6e75('0x33')](_0x5deb04,channels[_0x5deb04['channel']]);}else{clearTimeout(timeouts[_0x5deb04[_0x6e75('0x11')]]);channels[_0x5deb04[_0x6e75('0x11')]]=_[_0x6e75('0x33')](channels[_0x5deb04[_0x6e75('0x11')]],{'starttime':utils[_0x6e75('0x34')](_0x5deb04[_0x6e75('0x35')],channels[_0x5deb04[_0x6e75('0x11')]][_0x6e75('0x35')])?_0x5deb04['starttime']:channels[_0x5deb04[_0x6e75('0x11')]]['starttime'],'answertime':utils[_0x6e75('0x34')](_0x5deb04[_0x6e75('0x3')],channels[_0x5deb04[_0x6e75('0x11')]]['answertime'])?_0x5deb04[_0x6e75('0x3')]:channels[_0x5deb04[_0x6e75('0x11')]]['answertime']});if(utils[_0x6e75('0x36')](_0x5deb04[_0x6e75('0x37')],channels[_0x5deb04['channel']]['endtime'])){channels[_0x5deb04[_0x6e75('0x11')]]=_[_0x6e75('0x33')](channels[_0x5deb04[_0x6e75('0x11')]],{'endtime':_0x5deb04['endtime'],'destinationchannel':_['startsWith'](_0x5deb04['destinationchannel'],_0x6e75('0x38'))?channels[_0x5deb04['channel']][_0x6e75('0x39')]:_0x5deb04[_0x6e75('0x39')]});}channels[_0x5deb04[_0x6e75('0x11')]][_0x6e75('0x3a')]=utils[_0x6e75('0x1a')](channels[_0x5deb04[_0x6e75('0x11')]][_0x6e75('0x37')],channels[_0x5deb04[_0x6e75('0x11')]]['starttime']);channels[_0x5deb04['channel']][_0x6e75('0x3b')]=utils[_0x6e75('0x1a')](channels[_0x5deb04[_0x6e75('0x11')]][_0x6e75('0x37')],channels[_0x5deb04[_0x6e75('0x11')]][_0x6e75('0x3')]);if(_0x5deb04['lastapplication'][_0x6e75('0x2b')]()!='hangup'){channels[_0x5deb04[_0x6e75('0x11')]][_0x6e75('0x3c')]=_0x5deb04[_0x6e75('0x3c')];channels[_0x5deb04[_0x6e75('0x11')]][_0x6e75('0x21')]=_0x5deb04['lastapplication'];}}timeouts[_0x5deb04[_0x6e75('0x11')]]=setTimeout(writeDB(channels[_0x5deb04['channel']]),0x3e8);}exports[_0x6e75('0x2c')]=function(_0x58e79c){if(!_[_0x6e75('0x13')](channels[_0x58e79c[_0x6e75('0x11')]])){handleCDR(_0x58e79c);}else if(!_['isNil'](channels[_0x58e79c[_0x6e75('0x39')]])){_0x58e79c[_0x6e75('0x11')]=_0x58e79c['destinationchannel'];handleCDR(_0x58e79c);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 9518cdd..6d660e7 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 _0x14c3=['CLOSE','managerevent','./utils','connect','info','CONNECTED','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','close'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x14c3,0x1ca));var _0x314c=function(_0x373946,_0x1f8dc7){_0x373946=_0x373946-0x0;var _0x1350ec=_0x14c3[_0x373946];return _0x1350ec;};'use strict';var utils=require(_0x314c('0x0'));exports[_0x314c('0x1')]=function(){utils[_0x314c('0x2')](_0x314c('0x3'));};exports[_0x314c('0x4')]=function(){utils[_0x314c('0x2')](_0x314c('0x5'));};exports[_0x314c('0x6')]=function(){utils['info'](_0x314c('0x7'));};exports[_0x314c('0x8')]=function(_0x522e00){utils['error'](_0x522e00);};exports[_0x314c('0x9')]=function(){utils[_0x314c('0x2')](_0x314c('0xa'));};exports[_0x314c('0xb')]=function(_0x5d073a){}; \ No newline at end of file +var _0x2882=['info','shutdown','fullybooted','FULLYBOOTED','error','close','CLOSE','connect'];(function(_0x30f8ec,_0x362d6a){var _0x27d341=function(_0x154815){while(--_0x154815){_0x30f8ec['push'](_0x30f8ec['shift']());}};_0x27d341(++_0x362d6a);}(_0x2882,0x19f));var _0x2288=function(_0x596293,_0x1398b0){_0x596293=_0x596293-0x0;var _0x44803e=_0x2882[_0x596293];return _0x44803e;};'use strict';var utils=require('./utils');exports[_0x2288('0x0')]=function(){utils[_0x2288('0x1')]('CONNECTED');};exports[_0x2288('0x2')]=function(){utils[_0x2288('0x1')]('SHUTDOWN');};exports[_0x2288('0x3')]=function(){utils[_0x2288('0x1')](_0x2288('0x4'));};exports[_0x2288('0x5')]=function(_0x4eaa90){utils[_0x2288('0x5')](_0x4eaa90);};exports[_0x2288('0x6')]=function(){utils[_0x2288('0x1')](_0x2288('0x7'));};exports['managerevent']=function(_0x185965){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 646a81f..81ba60c 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 _0xa9e0=['application','toLowerCase','cdr(routeid)','appdata','split','routeid','variable','outboundrouteid','dialbegin','destcontext','from-voip-provider','assign','called','dialend','dialstatus','ANSWER','now','connect','complete','duration','diffTime','starttime','holdtime','billableseconds','answertime','lodash','util','./utils','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','isNil','newexten'];(function(_0x559da0,_0x371559){var _0x284239=function(_0xee9b8c){while(--_0xee9b8c){_0x559da0['push'](_0x559da0['shift']());}};_0x284239(++_0x371559);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var utils=require(_0x0a9e('0x2'));var dials={};var channels={};function writeDB(_0x5dd881){utils['info'](util[_0x0a9e('0x3')]('DIAL|%s|%s|%s|%s|%s|%s',_0x5dd881[_0x0a9e('0x4')],_0x5dd881[_0x0a9e('0x5')],_0x5dd881[_0x0a9e('0x6')],_0x5dd881[_0x0a9e('0x7')],_0x5dd881[_0x0a9e('0x8')],_0x5dd881['dialstatus']));utils[_0x0a9e('0x9')](_0x0a9e('0xa'),_0x5dd881);delete dials[_0x5dd881[_0x0a9e('0x5')]];}exports['newchannel']=function(_0x503809){if(_[_0x0a9e('0xb')](channels[_0x503809['channel']])){channels[_0x503809['channel']]={'routeid':null};}};exports[_0x0a9e('0xc')]=function(_0xf81284){if(!_[_0x0a9e('0xb')](channels[_0xf81284[_0x0a9e('0x5')]])){if(_0xf81284[_0x0a9e('0xd')][_0x0a9e('0xe')]()=='set'&&_['startsWith'](_0xf81284['appdata']['toLowerCase'](),_0x0a9e('0xf'))){var _0x36471c=_0xf81284[_0x0a9e('0x10')][_0x0a9e('0x11')]('=');channels[_0xf81284[_0x0a9e('0x5')]][_0x0a9e('0x12')]=_0x36471c[0x1];}}};exports['varset']=function(_0x4283ce){if(!_[_0x0a9e('0xb')](channels[_0x4283ce[_0x0a9e('0x5')]])){if(!_[_0x0a9e('0xb')](_0x4283ce[_0x0a9e('0x13')][_0x0a9e('0x14')])){channels[_0x4283ce['channel']][_0x0a9e('0x12')]=_0x4283ce['value'];}}};exports[_0x0a9e('0x15')]=function(_0x519dfd){if(_0x519dfd[_0x0a9e('0x16')]==_0x0a9e('0x17')){dials[_0x519dfd['channel']]=_[_0x0a9e('0x18')](_0x519dfd,{'starttime':utils['now'](),'lastevent':_0x0a9e('0x19')});}};exports[_0x0a9e('0x1a')]=function(_0x106033){if(!_[_0x0a9e('0xb')](dials[_0x106033[_0x0a9e('0x5')]])){dials[_0x106033[_0x0a9e('0x5')]]=_[_0x0a9e('0x18')](dials[_0x106033[_0x0a9e('0x5')]],_0x106033,{'answertime':_0x106033[_0x0a9e('0x1b')]==_0x0a9e('0x1c')?utils[_0x0a9e('0x1d')]():null,'lastevent':_0x106033[_0x0a9e('0x1b')]=='ANSWER'?_0x0a9e('0x1e'):_0x0a9e('0x19')});}};exports['cdr']=function(_0x20f109){if(!_['isNil'](channels[_0x20f109['channel']])){if(!_[_0x0a9e('0xb')](dials[_0x20f109[_0x0a9e('0x5')]])){dials[_0x20f109[_0x0a9e('0x5')]]=_[_0x0a9e('0x18')](dials[_0x20f109['channel']],{'endtime':utils[_0x0a9e('0x1d')](),'routeId':channels[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x12')],'lastevent':_0x0a9e('0x1f')});dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x20')]=utils[_0x0a9e('0x21')](dials[_0x20f109['channel']]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x22')]);dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x23')]=utils['diffTime'](dials[_0x20f109[_0x0a9e('0x5')]]['answertime']||dials[_0x20f109[_0x0a9e('0x5')]]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x22')]);dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x24')]=dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x25')]?utils[_0x0a9e('0x21')](dials[_0x20f109[_0x0a9e('0x5')]]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x25')]):0x0;writeDB(dials[_0x20f109[_0x0a9e('0x5')]]);}delete channels[_0x20f109[_0x0a9e('0x5')]];}}; \ No newline at end of file +var _0xa9e0=['application','toLowerCase','cdr(routeid)','appdata','split','routeid','variable','outboundrouteid','dialbegin','destcontext','from-voip-provider','assign','called','dialend','dialstatus','ANSWER','now','connect','complete','duration','diffTime','starttime','holdtime','billableseconds','answertime','lodash','util','./utils','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','isNil','newexten'];(function(_0x5816bf,_0x3f0cd7){var _0x1cd8a3=function(_0x410f91){while(--_0x410f91){_0x5816bf['push'](_0x5816bf['shift']());}};_0x1cd8a3(++_0x3f0cd7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var utils=require(_0x0a9e('0x2'));var dials={};var channels={};function writeDB(_0x5dd881){utils['info'](util[_0x0a9e('0x3')]('DIAL|%s|%s|%s|%s|%s|%s',_0x5dd881[_0x0a9e('0x4')],_0x5dd881[_0x0a9e('0x5')],_0x5dd881[_0x0a9e('0x6')],_0x5dd881[_0x0a9e('0x7')],_0x5dd881[_0x0a9e('0x8')],_0x5dd881['dialstatus']));utils[_0x0a9e('0x9')](_0x0a9e('0xa'),_0x5dd881);delete dials[_0x5dd881[_0x0a9e('0x5')]];}exports['newchannel']=function(_0x503809){if(_[_0x0a9e('0xb')](channels[_0x503809['channel']])){channels[_0x503809['channel']]={'routeid':null};}};exports[_0x0a9e('0xc')]=function(_0xf81284){if(!_[_0x0a9e('0xb')](channels[_0xf81284[_0x0a9e('0x5')]])){if(_0xf81284[_0x0a9e('0xd')][_0x0a9e('0xe')]()=='set'&&_['startsWith'](_0xf81284['appdata']['toLowerCase'](),_0x0a9e('0xf'))){var _0x36471c=_0xf81284[_0x0a9e('0x10')][_0x0a9e('0x11')]('=');channels[_0xf81284[_0x0a9e('0x5')]][_0x0a9e('0x12')]=_0x36471c[0x1];}}};exports['varset']=function(_0x4283ce){if(!_[_0x0a9e('0xb')](channels[_0x4283ce[_0x0a9e('0x5')]])){if(!_[_0x0a9e('0xb')](_0x4283ce[_0x0a9e('0x13')][_0x0a9e('0x14')])){channels[_0x4283ce['channel']][_0x0a9e('0x12')]=_0x4283ce['value'];}}};exports[_0x0a9e('0x15')]=function(_0x519dfd){if(_0x519dfd[_0x0a9e('0x16')]==_0x0a9e('0x17')){dials[_0x519dfd['channel']]=_[_0x0a9e('0x18')](_0x519dfd,{'starttime':utils['now'](),'lastevent':_0x0a9e('0x19')});}};exports[_0x0a9e('0x1a')]=function(_0x106033){if(!_[_0x0a9e('0xb')](dials[_0x106033[_0x0a9e('0x5')]])){dials[_0x106033[_0x0a9e('0x5')]]=_[_0x0a9e('0x18')](dials[_0x106033[_0x0a9e('0x5')]],_0x106033,{'answertime':_0x106033[_0x0a9e('0x1b')]==_0x0a9e('0x1c')?utils[_0x0a9e('0x1d')]():null,'lastevent':_0x106033[_0x0a9e('0x1b')]=='ANSWER'?_0x0a9e('0x1e'):_0x0a9e('0x19')});}};exports['cdr']=function(_0x20f109){if(!_['isNil'](channels[_0x20f109['channel']])){if(!_[_0x0a9e('0xb')](dials[_0x20f109[_0x0a9e('0x5')]])){dials[_0x20f109[_0x0a9e('0x5')]]=_[_0x0a9e('0x18')](dials[_0x20f109['channel']],{'endtime':utils[_0x0a9e('0x1d')](),'routeId':channels[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x12')],'lastevent':_0x0a9e('0x1f')});dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x20')]=utils[_0x0a9e('0x21')](dials[_0x20f109['channel']]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x22')]);dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x23')]=utils['diffTime'](dials[_0x20f109[_0x0a9e('0x5')]]['answertime']||dials[_0x20f109[_0x0a9e('0x5')]]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x22')]);dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x24')]=dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x25')]?utils[_0x0a9e('0x21')](dials[_0x20f109[_0x0a9e('0x5')]]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x25')]):0x0;writeDB(dials[_0x20f109[_0x0a9e('0x5')]]);}delete channels[_0x20f109[_0x0a9e('0x5')]];}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 064b28f..768c82e 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 _0x79a8=['./members.controller','./transfers.controller','./core.controller','./utils','asterisk','port','username','password','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','./agents.controller','./calls.controller','./queues.controller'];(function(_0x3a4bba,_0x307dbb){var _0x23bae3=function(_0x316fab){while(--_0x316fab){_0x3a4bba['push'](_0x3a4bba['shift']());}};_0x23bae3(++_0x307dbb);}(_0x79a8,0x1d0));var _0x879a=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x79a8[_0x4695ba];return _0x524b7d;};var AsteriskManager=require(_0x879a('0x0'));var config=require('../../config/environment');var agents=require(_0x879a('0x1'));var calls=require(_0x879a('0x2'));var queues=require(_0x879a('0x3'));var recordings=require('./recordings.controller');var members=require(_0x879a('0x4'));var dials=require('./dials.controller');var transfers=require(_0x879a('0x5'));var core=require(_0x879a('0x6'));var utils=require(_0x879a('0x7'));var ami=new AsteriskManager(config[_0x879a('0x8')][_0x879a('0x9')],config[_0x879a('0x8')]['ip'],config[_0x879a('0x8')][_0x879a('0xa')],config['asterisk'][_0x879a('0xb')],!![]);ami['keepConnected']();ami['on'](_0x879a('0xc'),core[_0x879a('0xc')]);ami['on']('shutdown',core[_0x879a('0xd')]);ami['on'](_0x879a('0xe'),core[_0x879a('0xe')]);ami['on']('error',core[_0x879a('0xf')]);ami['on'](_0x879a('0x10'),core['close']);ami['on']('managerevent',core[_0x879a('0x11')]);ami['on'](_0x879a('0x12'),function(_0x3391c8){try{members[_0x879a('0x12')](_0x3391c8);}catch(_0x54a9b6){utils[_0x879a('0xf')](_0x54a9b6);}});ami['on'](_0x879a('0x13'),function(_0xaaa1e1){try{agents[_0x879a('0x13')](_0xaaa1e1);}catch(_0x1a20c5){utils[_0x879a('0xf')](_0x1a20c5);}});ami['on'](_0x879a('0x14'),function(_0x5527a8){try{agents[_0x879a('0x14')](_0x5527a8);}catch(_0x16b649){utils['error'](_0x16b649);}});ami['on']('agentconnect',function(_0x3b8680){try{agents[_0x879a('0x15')](_0x3b8680);recordings['agentconnect'](_0x3b8680);queues[_0x879a('0x15')](_0x3b8680);}catch(_0x1dba3b){utils[_0x879a('0xf')](_0x1dba3b);}});ami['on'](_0x879a('0x16'),function(_0x32d9f5){try{agents[_0x879a('0x16')](_0x32d9f5);queues[_0x879a('0x16')](_0x32d9f5);members[_0x879a('0x16')](_0x32d9f5);calls[_0x879a('0x16')](_0x32d9f5);}catch(_0x12b1f9){utils[_0x879a('0xf')](_0x12b1f9);}});ami['on'](_0x879a('0x17'),function(_0x18b3d2){try{agents[_0x879a('0x17')](_0x18b3d2);queues['queuecallerabandon'](_0x18b3d2);}catch(_0x830b36){utils[_0x879a('0xf')](_0x830b36);}});ami['on']('queuecallerjoin',function(_0x25a57d){try{queues[_0x879a('0x18')](_0x25a57d);}catch(_0x4dd092){utils['error'](_0x4dd092);}});ami['on']('queuecallerleave',function(_0x28c401){try{queues[_0x879a('0x19')](_0x28c401);}catch(_0x79b806){utils[_0x879a('0xf')](_0x79b806);}});ami['on']('musiconholdstart',function(_0x5c21e2){try{queues[_0x879a('0x1a')](_0x5c21e2);calls[_0x879a('0x1a')](_0x5c21e2);}catch(_0x2b69be){utils[_0x879a('0xf')](_0x2b69be);}});ami['on'](_0x879a('0x1b'),function(_0x1dd818){try{queues[_0x879a('0x1b')](_0x1dd818);calls[_0x879a('0x1b')](_0x1dd818);}catch(_0x358f0e){utils[_0x879a('0xf')](_0x358f0e);}});ami['on'](_0x879a('0x1c'),function(_0x3510cc){try{calls[_0x879a('0x1c')](_0x3510cc);agents['cdr'](_0x3510cc);queues[_0x879a('0x1c')](_0x3510cc);recordings[_0x879a('0x1c')](_0x3510cc);dials[_0x879a('0x1c')](_0x3510cc);members[_0x879a('0x1c')](_0x3510cc);}catch(_0x20b1d5){utils[_0x879a('0xf')](_0x20b1d5);}});ami['on'](_0x879a('0x1d'),function(_0x2d9ed3){try{queues[_0x879a('0x1d')](_0x2d9ed3);agents[_0x879a('0x1d')](_0x2d9ed3);transfers[_0x879a('0x1d')](_0x2d9ed3);}catch(_0x1c06f8){utils[_0x879a('0xf')](_0x1c06f8);}});ami['on'](_0x879a('0x1e'),function(_0x99559){try{queues[_0x879a('0x1e')](_0x99559);transfers[_0x879a('0x1e')](_0x99559);agents[_0x879a('0x1e')](_0x99559);}catch(_0x4db7dd){utils[_0x879a('0xf')](_0x4db7dd);}});ami['on']('varset',function(_0x3ac306){try{queues[_0x879a('0x1f')](_0x3ac306);recordings[_0x879a('0x1f')](_0x3ac306);calls['varset'](_0x3ac306);dials[_0x879a('0x1f')](_0x3ac306);}catch(_0x4d8dcc){utils['error'](_0x4d8dcc);}});ami['on']('newexten',function(_0x54bd34){try{calls[_0x879a('0x20')](_0x54bd34);dials[_0x879a('0x20')](_0x54bd34);}catch(_0x4dcf18){utils[_0x879a('0xf')](_0x4dcf18);}});ami['on'](_0x879a('0x21'),function(_0x146fbc){try{calls['newchannel'](_0x146fbc);dials[_0x879a('0x21')](_0x146fbc);}catch(_0x92f79d){utils[_0x879a('0xf')](_0x92f79d);}});ami['on'](_0x879a('0x22'),function(_0x58037e){try{dials[_0x879a('0x22')](_0x58037e);}catch(_0x236766){utils[_0x879a('0xf')](_0x236766);}});ami['on'](_0x879a('0x23'),function(_0x49e6f5){try{dials[_0x879a('0x23')](_0x49e6f5);}catch(_0x4bbddc){utils[_0x879a('0xf')](_0x4bbddc);}}); \ No newline at end of file +var _0x544f=['port','username','keepConnected','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','asterisk'];(function(_0x129d25,_0x5ac403){var _0x4fcea1=function(_0x42a4c4){while(--_0x42a4c4){_0x129d25['push'](_0x129d25['shift']());}};_0x4fcea1(++_0x5ac403);}(_0x544f,0x14c));var _0xf544=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x544f[_0x5a776b];return _0xbbef59;};var AsteriskManager=require(_0xf544('0x0'));var config=require('../../config/environment');var agents=require('./agents.controller');var calls=require(_0xf544('0x1'));var queues=require(_0xf544('0x2'));var recordings=require(_0xf544('0x3'));var members=require(_0xf544('0x4'));var dials=require('./dials.controller');var transfers=require(_0xf544('0x5'));var core=require(_0xf544('0x6'));var utils=require('./utils');var ami=new AsteriskManager(config[_0xf544('0x7')][_0xf544('0x8')],config['asterisk']['ip'],config[_0xf544('0x7')][_0xf544('0x9')],config[_0xf544('0x7')]['password'],!![]);ami[_0xf544('0xa')]();ami['on']('connect',core[_0xf544('0xb')]);ami['on']('shutdown',core[_0xf544('0xc')]);ami['on']('fullybooted',core[_0xf544('0xd')]);ami['on']('error',core[_0xf544('0xe')]);ami['on'](_0xf544('0xf'),core[_0xf544('0xf')]);ami['on'](_0xf544('0x10'),core[_0xf544('0x10')]);ami['on'](_0xf544('0x11'),function(_0x452d0a){try{members[_0xf544('0x11')](_0x452d0a);}catch(_0x580c7f){utils[_0xf544('0xe')](_0x580c7f);}});ami['on'](_0xf544('0x12'),function(_0x56c8d4){try{agents['agentcalled'](_0x56c8d4);}catch(_0x542d90){utils[_0xf544('0xe')](_0x542d90);}});ami['on']('agentringnoanswer',function(_0x3f6d9e){try{agents['agentringnoanswer'](_0x3f6d9e);}catch(_0x1c4731){utils['error'](_0x1c4731);}});ami['on'](_0xf544('0x13'),function(_0x262779){try{agents[_0xf544('0x13')](_0x262779);recordings['agentconnect'](_0x262779);queues[_0xf544('0x13')](_0x262779);}catch(_0x3fe118){utils[_0xf544('0xe')](_0x3fe118);}});ami['on'](_0xf544('0x14'),function(_0x7f64f4){try{agents[_0xf544('0x14')](_0x7f64f4);queues[_0xf544('0x14')](_0x7f64f4);members[_0xf544('0x14')](_0x7f64f4);calls[_0xf544('0x14')](_0x7f64f4);}catch(_0x194dda){utils[_0xf544('0xe')](_0x194dda);}});ami['on']('queuecallerabandon',function(_0xb1c0aa){try{agents[_0xf544('0x15')](_0xb1c0aa);queues[_0xf544('0x15')](_0xb1c0aa);}catch(_0x332995){utils['error'](_0x332995);}});ami['on']('queuecallerjoin',function(_0x27caf0){try{queues[_0xf544('0x16')](_0x27caf0);}catch(_0x3ced73){utils[_0xf544('0xe')](_0x3ced73);}});ami['on'](_0xf544('0x17'),function(_0x4ac9b0){try{queues['queuecallerleave'](_0x4ac9b0);}catch(_0x2e1c7a){utils[_0xf544('0xe')](_0x2e1c7a);}});ami['on'](_0xf544('0x18'),function(_0x5b49ba){try{queues[_0xf544('0x18')](_0x5b49ba);calls[_0xf544('0x18')](_0x5b49ba);}catch(_0x8592d8){utils[_0xf544('0xe')](_0x8592d8);}});ami['on'](_0xf544('0x19'),function(_0x1aa869){try{queues['musiconholdstop'](_0x1aa869);calls[_0xf544('0x19')](_0x1aa869);}catch(_0x52959c){utils[_0xf544('0xe')](_0x52959c);}});ami['on'](_0xf544('0x1a'),function(_0x2e3c4d){try{calls[_0xf544('0x1a')](_0x2e3c4d);agents[_0xf544('0x1a')](_0x2e3c4d);queues[_0xf544('0x1a')](_0x2e3c4d);recordings[_0xf544('0x1a')](_0x2e3c4d);dials[_0xf544('0x1a')](_0x2e3c4d);members[_0xf544('0x1a')](_0x2e3c4d);}catch(_0x85371b){utils[_0xf544('0xe')](_0x85371b);}});ami['on'](_0xf544('0x1b'),function(_0x5c5fe6){try{queues[_0xf544('0x1b')](_0x5c5fe6);agents[_0xf544('0x1b')](_0x5c5fe6);transfers[_0xf544('0x1b')](_0x5c5fe6);}catch(_0x415c64){utils[_0xf544('0xe')](_0x415c64);}});ami['on']('attendedtransfer',function(_0x43b3b9){try{queues[_0xf544('0x1c')](_0x43b3b9);transfers[_0xf544('0x1c')](_0x43b3b9);agents[_0xf544('0x1c')](_0x43b3b9);}catch(_0x5b2067){utils[_0xf544('0xe')](_0x5b2067);}});ami['on']('varset',function(_0x2169af){try{queues['varset'](_0x2169af);recordings[_0xf544('0x1d')](_0x2169af);calls[_0xf544('0x1d')](_0x2169af);dials[_0xf544('0x1d')](_0x2169af);}catch(_0x565bd9){utils['error'](_0x565bd9);}});ami['on'](_0xf544('0x1e'),function(_0x4c8a0f){try{calls[_0xf544('0x1e')](_0x4c8a0f);dials[_0xf544('0x1e')](_0x4c8a0f);}catch(_0x48ee41){utils['error'](_0x48ee41);}});ami['on'](_0xf544('0x1f'),function(_0xb4c403){try{calls[_0xf544('0x1f')](_0xb4c403);dials[_0xf544('0x1f')](_0xb4c403);}catch(_0x287509){utils[_0xf544('0xe')](_0x287509);}});ami['on'](_0xf544('0x20'),function(_0x8e90fa){try{dials[_0xf544('0x20')](_0x8e90fa);}catch(_0xa984ba){utils[_0xf544('0xe')](_0xa984ba);}});ami['on'](_0xf544('0x21'),function(_0x3f2dda){try{dials[_0xf544('0x21')](_0x3f2dda);}catch(_0x304c32){utils['error'](_0x304c32);}}); \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 2a6de5d..f73d700 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 _0x8145=['source','data3','destinationchannel','type','destination','lodash','util','./utils','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','membername','name','internal','request','CreateMemberReport','getUserByName','split','then','catch','some','startsWith','devicestatechange','state','INUSE','BUSY','device','voice','TALKING','NOT_INUSE','isNil','exitAt','now','duration','diffTime','enterAt','agentcomplete','assign','queue','data1','data2'];(function(_0x54f0e0,_0x4df509){var _0x203031=function(_0x328c38){while(--_0x328c38){_0x54f0e0['push'](_0x54f0e0['shift']());}};_0x203031(++_0x4df509);}(_0x8145,0x1b3));var _0x5814=function(_0x5a1f58,_0xec180a){_0x5a1f58=_0x5a1f58-0x0;var _0x14d0fd=_0x8145[_0x5a1f58];return _0x14d0fd;};'use strict';var _=require(_0x5814('0x0'));var util=require(_0x5814('0x1'));var utils=require(_0x5814('0x2'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x1c8ed2){utils['info'](util[_0x5814('0x3')](_0x5814('0x4'),_0x1c8ed2[_0x5814('0x5')],_0x1c8ed2[_0x5814('0x6')],_0x1c8ed2[_0x5814('0x7')],_0x1c8ed2['data2'],_0x1c8ed2[_0x5814('0x8')],_0x1c8ed2['type']));if(_0x1c8ed2[_0x5814('0x6')]){utils['getUserByInterface'](_0x1c8ed2[_0x5814('0x6')])['then'](function(_0x982eca){if(_0x982eca){_0x1c8ed2[_0x5814('0x8')]=_0x982eca[_0x5814('0x9')];_0x1c8ed2[_0x5814('0xa')]=_0x982eca[_0x5814('0xa')];utils[_0x5814('0xb')](_0x5814('0xc'),_0x1c8ed2);}else{utils[_0x5814('0xd')](_0x1c8ed2[_0x5814('0x6')][_0x5814('0xe')]('/')[0x1])[_0x5814('0xf')](function(_0x6f31d7){if(_0x6f31d7){_0x1c8ed2[_0x5814('0x8')]=_0x6f31d7[_0x5814('0x9')];_0x1c8ed2[_0x5814('0xa')]=_0x6f31d7[_0x5814('0xa')];utils[_0x5814('0xb')](_0x5814('0xc'),_0x1c8ed2);}});}})[_0x5814('0x10')](function(_0x1a8ae6){utils['error'](_0x1a8ae6);});}delete members[_0x1c8ed2['interface']];}function startsWith(_0x14e43c,_0x3a3aae){return _[_0x5814('0x11')](_0x14e43c,function(_0x2fd263){return _[_0x5814('0x12')](_0x3a3aae,_0x2fd263);});}exports[_0x5814('0x13')]=function(_0x526c6c){switch(_0x526c6c[_0x5814('0x14')]){case _0x5814('0x15'):case _0x5814('0x16'):if(!startsWith(exclude,_0x526c6c[_0x5814('0x17')])){members[_0x526c6c[_0x5814('0x17')]]={'channel':_0x5814('0x18'),'interface':_0x526c6c['device'],'type':_0x5814('0x19'),'enterAt':utils['now'](),'role':'agent'};}break;case _0x5814('0x1a'):if(!_[_0x5814('0x1b')](members[_0x526c6c[_0x5814('0x17')]])){members[_0x526c6c[_0x5814('0x17')]][_0x5814('0x1c')]=utils[_0x5814('0x1d')]();members[_0x526c6c[_0x5814('0x17')]][_0x5814('0x1e')]=utils[_0x5814('0x1f')](members[_0x526c6c[_0x5814('0x17')]][_0x5814('0x1c')],members[_0x526c6c[_0x5814('0x17')]][_0x5814('0x20')]);if(members[_0x526c6c[_0x5814('0x17')]][_0x5814('0x5')]){writeDB(members[_0x526c6c[_0x5814('0x17')]]);}}default:break;}};exports[_0x5814('0x21')]=function(_0x99d199){if(!_[_0x5814('0x1b')](members[_0x99d199[_0x5814('0x6')]])){members[_0x99d199[_0x5814('0x6')]]=_[_0x5814('0x22')](members[_0x99d199[_0x5814('0x6')]],{'data4':_0x99d199[_0x5814('0x23')]});}};exports['cdr']=function(_0x2d37ad){if(_0x2d37ad[_0x5814('0x7')]){var _0x5978e3=_0x2d37ad[_0x5814('0x7')][_0x5814('0xe')]('-')[0x0];if(!_[_0x5814('0x1b')](members[_0x5978e3])){members[_0x5978e3]=_['assign'](members[_0x5978e3],{'data1':members[_0x5978e3][_0x5814('0x24')]||_0x2d37ad['type'],'data2':members[_0x5978e3][_0x5814('0x25')]||_0x2d37ad[_0x5814('0x26')],'data3':members[_0x5978e3][_0x5814('0x27')]||_0x2d37ad['destination'],'uniqueid':members[_0x5978e3][_0x5814('0x5')]||_0x2d37ad[_0x5814('0x5')]});if(members[_0x5978e3]['exitAt']){writeDB(members[_0x5978e3]);}}}if(_0x2d37ad[_0x5814('0x28')]){var _0x5ba2c7=_0x2d37ad[_0x5814('0x28')][_0x5814('0xe')]('-')[0x0];if(!_['isNil'](members[_0x5ba2c7])){members[_0x5ba2c7]=_[_0x5814('0x22')](members[_0x5ba2c7],{'data1':members[_0x5ba2c7][_0x5814('0x24')]||_0x2d37ad[_0x5814('0x29')],'data2':members[_0x5ba2c7][_0x5814('0x25')]||_0x2d37ad[_0x5814('0x26')],'data3':members[_0x5ba2c7][_0x5814('0x27')]||_0x2d37ad[_0x5814('0x2a')],'uniqueid':members[_0x5ba2c7][_0x5814('0x5')]||_0x2d37ad[_0x5814('0x5')]});if(members[_0x5ba2c7]['exitAt']){writeDB(members[_0x5ba2c7]);}}}}; \ No newline at end of file +var _0xe19b=['membername','name','internal','request','CreateMemberReport','getUserByName','interface','split','catch','error','some','startsWith','devicestatechange','state','INUSE','BUSY','device','now','agent','NOT_INUSE','diffTime','exitAt','enterAt','assign','queue','cdr','isNil','data1','source','data3','destination','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','format','uniqueid','channel','data2','type','getUserByInterface','then'];(function(_0x3d95d7,_0x1e6106){var _0xfe00a9=function(_0x295e41){while(--_0x295e41){_0x3d95d7['push'](_0x3d95d7['shift']());}};_0xfe00a9(++_0x1e6106);}(_0xe19b,0x178));var _0xbe19=function(_0x1a70d6,_0xc6be69){_0x1a70d6=_0x1a70d6-0x0;var _0x5071e9=_0xe19b[_0x1a70d6];return _0x5071e9;};'use strict';var _=require(_0xbe19('0x0'));var util=require(_0xbe19('0x1'));var utils=require('./utils');var members={};var exclude=[_0xbe19('0x2'),_0xbe19('0x3')];function writeDB(_0x4f6bc1){utils['info'](util[_0xbe19('0x4')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x4f6bc1[_0xbe19('0x5')],_0x4f6bc1['interface'],_0x4f6bc1[_0xbe19('0x6')],_0x4f6bc1[_0xbe19('0x7')],_0x4f6bc1['membername'],_0x4f6bc1[_0xbe19('0x8')]));if(_0x4f6bc1['interface']){utils[_0xbe19('0x9')](_0x4f6bc1['interface'])[_0xbe19('0xa')](function(_0x59cdfd){if(_0x59cdfd){_0x4f6bc1[_0xbe19('0xb')]=_0x59cdfd[_0xbe19('0xc')];_0x4f6bc1[_0xbe19('0xd')]=_0x59cdfd['internal'];utils[_0xbe19('0xe')](_0xbe19('0xf'),_0x4f6bc1);}else{utils[_0xbe19('0x10')](_0x4f6bc1[_0xbe19('0x11')][_0xbe19('0x12')]('/')[0x1])[_0xbe19('0xa')](function(_0x26d0c6){if(_0x26d0c6){_0x4f6bc1['membername']=_0x26d0c6[_0xbe19('0xc')];_0x4f6bc1[_0xbe19('0xd')]=_0x26d0c6[_0xbe19('0xd')];utils['request'](_0xbe19('0xf'),_0x4f6bc1);}});}})[_0xbe19('0x13')](function(_0x30e1d4){utils[_0xbe19('0x14')](_0x30e1d4);});}delete members[_0x4f6bc1[_0xbe19('0x11')]];}function startsWith(_0x2c485f,_0x3d2398){return _[_0xbe19('0x15')](_0x2c485f,function(_0x5b8c11){return _[_0xbe19('0x16')](_0x3d2398,_0x5b8c11);});}exports[_0xbe19('0x17')]=function(_0x5f47a2){switch(_0x5f47a2[_0xbe19('0x18')]){case _0xbe19('0x19'):case _0xbe19('0x1a'):if(!startsWith(exclude,_0x5f47a2[_0xbe19('0x1b')])){members[_0x5f47a2[_0xbe19('0x1b')]]={'channel':'voice','interface':_0x5f47a2[_0xbe19('0x1b')],'type':'TALKING','enterAt':utils[_0xbe19('0x1c')](),'role':_0xbe19('0x1d')};}break;case _0xbe19('0x1e'):if(!_['isNil'](members[_0x5f47a2[_0xbe19('0x1b')]])){members[_0x5f47a2[_0xbe19('0x1b')]]['exitAt']=utils[_0xbe19('0x1c')]();members[_0x5f47a2['device']]['duration']=utils[_0xbe19('0x1f')](members[_0x5f47a2['device']][_0xbe19('0x20')],members[_0x5f47a2['device']][_0xbe19('0x21')]);if(members[_0x5f47a2['device']][_0xbe19('0x5')]){writeDB(members[_0x5f47a2['device']]);}}default:break;}};exports['agentcomplete']=function(_0x11e4ee){if(!_['isNil'](members[_0x11e4ee[_0xbe19('0x11')]])){members[_0x11e4ee['interface']]=_[_0xbe19('0x22')](members[_0x11e4ee[_0xbe19('0x11')]],{'data4':_0x11e4ee[_0xbe19('0x23')]});}};exports[_0xbe19('0x24')]=function(_0x53b197){if(_0x53b197[_0xbe19('0x6')]){var _0x46a88=_0x53b197[_0xbe19('0x6')][_0xbe19('0x12')]('-')[0x0];if(!_[_0xbe19('0x25')](members[_0x46a88])){members[_0x46a88]=_[_0xbe19('0x22')](members[_0x46a88],{'data1':members[_0x46a88][_0xbe19('0x26')]||_0x53b197[_0xbe19('0x8')],'data2':members[_0x46a88][_0xbe19('0x7')]||_0x53b197[_0xbe19('0x27')],'data3':members[_0x46a88][_0xbe19('0x28')]||_0x53b197[_0xbe19('0x29')],'uniqueid':members[_0x46a88][_0xbe19('0x5')]||_0x53b197['uniqueid']});if(members[_0x46a88][_0xbe19('0x20')]){writeDB(members[_0x46a88]);}}}if(_0x53b197[_0xbe19('0x2a')]){var _0x112704=_0x53b197['destinationchannel'][_0xbe19('0x12')]('-')[0x0];if(!_[_0xbe19('0x25')](members[_0x112704])){members[_0x112704]=_[_0xbe19('0x22')](members[_0x112704],{'data1':members[_0x112704][_0xbe19('0x26')]||_0x53b197[_0xbe19('0x8')],'data2':members[_0x112704][_0xbe19('0x7')]||_0x53b197[_0xbe19('0x27')],'data3':members[_0x112704][_0xbe19('0x28')]||_0x53b197[_0xbe19('0x29')],'uniqueid':members[_0x112704][_0xbe19('0x5')]||_0x53b197[_0xbe19('0x5')]});if(members[_0x112704][_0xbe19('0x20')]){writeDB(members[_0x112704]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 34edf58..002f27e 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 _0x5ccd=['CONTINUE','toUpperCase','queuecallerabandon','ABANDONED','queuecallerleave','queuecallerjoinAt','connectedlinenum','connectedlinename','membername','reason','queuecallerexitreason','COMPLETEDBY','blindtransfer','transfereechannel','BLIND','extension','BLINDTRANSFER','attendedtransfer','forIn','origtransfererchannel','transfertargetchannel','transfertargetcalleridname','transfertargetcalleridnum','ATTENDED','origtransfererexten','origtransfereruniqueid','secondtransfererchannel','transfereecalleridname','transfereecalleridnum','ATTENDEDTRANSFER','secondtransfererexten','secondtransfereruniqueid','musiconholdstartAt','musiconholdstop','mohtime','cdr','assigned','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','channel','lastAssignedTo','calleridnum','accountcode','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','clone','assign','position','now','varset','isNil','variable','queuestatus','value'];(function(_0x607ced,_0x2e9d91){var _0x2c31d5=function(_0x57f983){while(--_0x57f983){_0x607ced['push'](_0x607ced['shift']());}};_0x2c31d5(++_0x2e9d91);}(_0x5ccd,0x1d7));var _0xd5cc=function(_0x3e4285,_0x83a4f0){_0x3e4285=_0x3e4285-0x0;var _0xce09e7=_0x5ccd[_0x3e4285];return _0xce09e7;};'use strict';var _=require(_0xd5cc('0x0'));var util=require(_0xd5cc('0x1'));var utils=require(_0xd5cc('0x2'));var queues={};var transfers={};function writeDB(_0x577064,_0x3b59b9){utils[_0xd5cc('0x3')](util[_0xd5cc('0x4')](_0xd5cc('0x5'),_0x577064['uniqueid'],_0x577064[_0xd5cc('0x6')],_0x577064['queue'],_0x577064[_0xd5cc('0x7')],_0x577064[_0xd5cc('0x8')],_0x577064[_0xd5cc('0x9')],_0x577064['queuecallerexitreason']));if(_0x577064[_0xd5cc('0xa')]){utils[_0xd5cc('0xb')](_0x577064[_0xd5cc('0xa')])[_0xd5cc('0xc')](function(_0x5e2330){if(_0x5e2330){_0x577064[_0xd5cc('0xd')]=_0x5e2330[_0xd5cc('0xd')];}utils[_0xd5cc('0xe')](_0xd5cc('0xf'),_0x577064);});}else{utils['request'](_0xd5cc('0xf'),_0x577064);}if(_0x3b59b9){delete queues[_0x577064['channel']];}}exports['queuecallerjoin']=function(_0x30dcb6){if(!_['isNil'](queues[_0x30dcb6[_0xd5cc('0x6')]])){writeDB(_[_0xd5cc('0x10')](queues[_0x30dcb6['channel']]),![]);}queues[_0x30dcb6[_0xd5cc('0x6')]]=_[_0xd5cc('0x11')](_0x30dcb6,{'originalposition':_0x30dcb6[_0xd5cc('0x12')],'queuecallerjoinAt':utils[_0xd5cc('0x13')](),'mohtime':0x0});};exports[_0xd5cc('0x14')]=function(_0x3a41ba){if(!_['isNil'](queues[_0x3a41ba[_0xd5cc('0x6')]])){if(!_[_0xd5cc('0x15')](_0x3a41ba[_0xd5cc('0x16')][_0xd5cc('0x17')])){if(_0x3a41ba[_0xd5cc('0x18')]!=_0xd5cc('0x19')){queues[_0x3a41ba['channel']]=_[_0xd5cc('0x11')](queues[_0x3a41ba['channel']],{'queuecallerabandon':![],'queuecallerabandonAt':null,'queuecallerexit':!![],'queuecallerexitAt':utils[_0xd5cc('0x13')](),'queuecallerexitreason':_0x3a41ba[_0xd5cc('0x18')][_0xd5cc('0x1a')]()});}}}};exports[_0xd5cc('0x1b')]=function(_0x496f09){var _0x438985={'queuecallerabandon':!![],'queuecallerabandonAt':utils[_0xd5cc('0x13')](),'queuecallerexitreason':_0xd5cc('0x1c')};if(!_['isNil'](queues[_0x496f09[_0xd5cc('0x6')]])){queues[_0x496f09[_0xd5cc('0x6')]]=_[_0xd5cc('0x11')](queues[_0x496f09['channel']],_0x438985);}if(!_[_0xd5cc('0x15')](transfers[_0x496f09['channel']])){transfers[_0x496f09[_0xd5cc('0x6')]]=_[_0xd5cc('0x11')](transfers[_0x496f09['channel']],_0x438985);}};exports[_0xd5cc('0x1d')]=function(_0x9a8c13){if(!_[_0xd5cc('0x15')](queues[_0x9a8c13[_0xd5cc('0x6')]])){queues[_0x9a8c13[_0xd5cc('0x6')]]=_[_0xd5cc('0x11')](queues[_0x9a8c13['channel']],{'queuecallerleave':!![],'queuecallerleaveAt':utils['now'](),'holdtime':utils['diffTime'](utils[_0xd5cc('0x13')](),queues[_0x9a8c13[_0xd5cc('0x6')]][_0xd5cc('0x1e')])});}if(!_[_0xd5cc('0x15')](transfers[_0x9a8c13[_0xd5cc('0x6')]])){transfers[_0x9a8c13[_0xd5cc('0x6')]]=_[_0xd5cc('0x11')](transfers[_0x9a8c13[_0xd5cc('0x6')]],{'queuecallerleave':!![],'queuecallerleaveAt':utils[_0xd5cc('0x13')](),'holdtime':utils['diffTime'](utils['now'](),transfers[_0x9a8c13['channel']]['queuecallerjoinAt'])});}};exports['agentconnect']=function(_0x40141a){var _0x3e7a59={'connectedlinenum':_0x40141a[_0xd5cc('0x1f')],'connectedlinename':_0x40141a[_0xd5cc('0x20')],'assigned':!![],'lastAssignedTo':_0x40141a[_0xd5cc('0x21')]};if(!_['isNil'](queues[_0x40141a[_0xd5cc('0x6')]])){queues[_0x40141a[_0xd5cc('0x6')]]=_[_0xd5cc('0x11')](queues[_0x40141a[_0xd5cc('0x6')]],_0x3e7a59);}if(!_[_0xd5cc('0x15')](transfers[_0x40141a[_0xd5cc('0x6')]])){transfers[_0x40141a['channel']]=_[_0xd5cc('0x11')](transfers[_0x40141a[_0xd5cc('0x6')]],_0x3e7a59);}};exports['agentcomplete']=function(_0x547be5){var _0x5322fc={'queuecallercomplete':!![],'queuecallercompleteAt':utils[_0xd5cc('0x13')]()};if(_0x547be5[_0xd5cc('0x22')]!='transfer'){_0x5322fc[_0xd5cc('0x23')]=_0xd5cc('0x24')+_0x547be5[_0xd5cc('0x22')][_0xd5cc('0x1a')]();}if(!_['isNil'](queues[_0x547be5[_0xd5cc('0x6')]])){queues[_0x547be5[_0xd5cc('0x6')]]=_[_0xd5cc('0x11')](queues[_0x547be5['channel']],_0x5322fc);writeDB(queues[_0x547be5[_0xd5cc('0x6')]],!![]);}};exports[_0xd5cc('0x25')]=function(_0xa568bb){if(!_[_0xd5cc('0x15')](queues[_0xa568bb[_0xd5cc('0x26')]])){queues[_0xa568bb[_0xd5cc('0x26')]]=_[_0xd5cc('0x11')](queues[_0xa568bb[_0xd5cc('0x26')]],{'transfer':!![],'transfertype':_0xd5cc('0x27'),'transferexten':_0xa568bb[_0xd5cc('0x28')],'transferuniqueid':_0xa568bb['transfereeuniqueid'],'queuecallerexitreason':_0xd5cc('0x29')});}};exports[_0xd5cc('0x2a')]=function(_0x5aa416){_[_0xd5cc('0x2b')](queues,function(_0x25eb11){if(_0x25eb11[_0xd5cc('0x6')]==_0x5aa416[_0xd5cc('0x2c')]){transfers[_0x5aa416[_0xd5cc('0x2d')]]=_[_0xd5cc('0x10')](_0x25eb11);transfers[_0x5aa416[_0xd5cc('0x2d')]]=_[_0xd5cc('0x11')](transfers[_0x5aa416[_0xd5cc('0x2d')]],{'queuecallerjoinAt':utils[_0xd5cc('0x13')](),'queuecallerleaveAt':utils[_0xd5cc('0x13')](),'channel':_0x5aa416[_0xd5cc('0x2d')],'calleridname':_0x5aa416[_0xd5cc('0x2e')],'calleridnum':_0x5aa416[_0xd5cc('0x2f')],'queuecallerenterreason':0x2});queues[_0x5aa416['transfertargetchannel']]=_[_0xd5cc('0x11')](queues[_0x5aa416[_0xd5cc('0x2d')]],{'transfer':!![],'transfertype':_0xd5cc('0x30'),'queuecallerexitreason':'ATTENDEDTRANSFER','transferexten':_0x5aa416[_0xd5cc('0x31')],'transferuniqueid':_0x5aa416[_0xd5cc('0x32')]});queues[_0x5aa416['origtransfererchannel']]=_[_0xd5cc('0x11')](queues[_0x5aa416[_0xd5cc('0x2c')]],{'queuecallerexitreason':_0xd5cc('0x30'),'queuecallerenterreason':0x1});}else if(_0x25eb11['channel']==_0x5aa416[_0xd5cc('0x33')]){transfers[_0x5aa416[_0xd5cc('0x26')]]=_[_0xd5cc('0x10')](_0x25eb11);transfers[_0x5aa416['transfereechannel']]=_[_0xd5cc('0x11')](transfers[_0x5aa416[_0xd5cc('0x26')]],{'queuecallerjoinAt':utils[_0xd5cc('0x13')](),'queuecallerleaveAt':utils[_0xd5cc('0x13')](),'channel':_0x5aa416[_0xd5cc('0x26')],'calleridname':_0x5aa416[_0xd5cc('0x34')],'calleridnum':_0x5aa416[_0xd5cc('0x35')],'queuecallerenterreason':0x2});queues[_0x5aa416['transfereechannel']]=_[_0xd5cc('0x11')](queues[_0x5aa416['transfereechannel']],{'transfer':!![],'transfertype':_0xd5cc('0x30'),'queuecallerexitreason':_0xd5cc('0x36'),'transferexten':_0x5aa416[_0xd5cc('0x37')],'transferuniqueid':_0x5aa416[_0xd5cc('0x38')]});queues[_0x5aa416['secondtransfererchannel']]=_['assign'](queues[_0x5aa416[_0xd5cc('0x33')]],{'queuecallerexitreason':'ATTENDED','queuecallerenterreason':0x1});}});};exports['musiconholdstart']=function(_0x3f1ab9){if(!_[_0xd5cc('0x15')](queues[_0x3f1ab9[_0xd5cc('0x6')]])){queues[_0x3f1ab9[_0xd5cc('0x6')]][_0xd5cc('0x39')]=utils[_0xd5cc('0x13')]();}};exports[_0xd5cc('0x3a')]=function(_0x4930d9){if(!_['isNil'](queues[_0x4930d9[_0xd5cc('0x6')]])){if(!_[_0xd5cc('0x15')](queues[_0x4930d9[_0xd5cc('0x6')]][_0xd5cc('0x39')])){queues[_0x4930d9[_0xd5cc('0x6')]][_0xd5cc('0x3b')]+=utils['diffTime'](utils['now'](),queues[_0x4930d9['channel']][_0xd5cc('0x39')]);delete queues[_0x4930d9[_0xd5cc('0x6')]][_0xd5cc('0x39')];}}};exports[_0xd5cc('0x3c')]=function(_0x215910){if(!_['isNil'](queues[_0x215910[_0xd5cc('0x6')]])){writeDB(queues[_0x215910['channel']],!![]);}if(!_[_0xd5cc('0x15')](transfers[_0x215910[_0xd5cc('0x6')]])){if(transfers[_0x215910[_0xd5cc('0x6')]][_0xd5cc('0x3d')]){transfers[_0x215910[_0xd5cc('0x6')]]=_['assign'](transfers[_0x215910[_0xd5cc('0x6')]],{'queuecallercomplete':!![],'queuecallercompleteAt':utils[_0xd5cc('0x13')](),'queuecallerexitreason':'COMPLETED'});}writeDB(transfers[_0x215910[_0xd5cc('0x6')]],![]);delete transfers[_0x215910[_0xd5cc('0x6')]];}}; \ No newline at end of file +var _0x4a7c=['extension','BLINDTRANSFER','attendedtransfer','forIn','transfertargetchannel','transfertargetcalleridname','transfertargetcalleridnum','ATTENDED','origtransfererexten','origtransfereruniqueid','origtransfererchannel','transfereecalleridname','transfereecalleridnum','secondtransfererexten','secondtransfereruniqueid','secondtransfererchannel','musiconholdstart','musiconholdstop','musiconholdstartAt','cdr','COMPLETED','lodash','util','./utils','format','queue','lastAssignedTo','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','channel','isNil','clone','position','now','varset','variable','queuestatus','CONTINUE','value','toUpperCase','queuecallerabandon','ABANDONED','assign','queuecallerleave','diffTime','queuecallerjoinAt','agentconnect','connectedlinenum','connectedlinename','membername','agentcomplete','reason','transfer','COMPLETEDBY','blindtransfer','transfereechannel','BLIND'];(function(_0x32a552,_0x32af32){var _0xa2c2b9=function(_0x39f2b5){while(--_0x39f2b5){_0x32a552['push'](_0x32a552['shift']());}};_0xa2c2b9(++_0x32af32);}(_0x4a7c,0x183));var _0xc4a7=function(_0x292818,_0x190de0){_0x292818=_0x292818-0x0;var _0x146eb6=_0x4a7c[_0x292818];return _0x146eb6;};'use strict';var _=require(_0xc4a7('0x0'));var util=require(_0xc4a7('0x1'));var utils=require(_0xc4a7('0x2'));var queues={};var transfers={};function writeDB(_0x18331a,_0x568524){utils['info'](util[_0xc4a7('0x3')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x18331a['uniqueid'],_0x18331a['channel'],_0x18331a[_0xc4a7('0x4')],_0x18331a[_0xc4a7('0x5')],_0x18331a['calleridnum'],_0x18331a['accountcode'],_0x18331a[_0xc4a7('0x6')]));if(_0x18331a[_0xc4a7('0x4')]){utils[_0xc4a7('0x7')](_0x18331a[_0xc4a7('0x4')])[_0xc4a7('0x8')](function(_0x5bd81a){if(_0x5bd81a){_0x18331a[_0xc4a7('0x9')]=_0x5bd81a[_0xc4a7('0x9')];}utils['request'](_0xc4a7('0xa'),_0x18331a);});}else{utils[_0xc4a7('0xb')](_0xc4a7('0xa'),_0x18331a);}if(_0x568524){delete queues[_0x18331a[_0xc4a7('0xc')]];}}exports['queuecallerjoin']=function(_0x2ca8af){if(!_[_0xc4a7('0xd')](queues[_0x2ca8af['channel']])){writeDB(_[_0xc4a7('0xe')](queues[_0x2ca8af['channel']]),![]);}queues[_0x2ca8af['channel']]=_['assign'](_0x2ca8af,{'originalposition':_0x2ca8af[_0xc4a7('0xf')],'queuecallerjoinAt':utils[_0xc4a7('0x10')](),'mohtime':0x0});};exports[_0xc4a7('0x11')]=function(_0x1ebc09){if(!_[_0xc4a7('0xd')](queues[_0x1ebc09[_0xc4a7('0xc')]])){if(!_['isNil'](_0x1ebc09[_0xc4a7('0x12')][_0xc4a7('0x13')])){if(_0x1ebc09['value']!=_0xc4a7('0x14')){queues[_0x1ebc09['channel']]=_['assign'](queues[_0x1ebc09[_0xc4a7('0xc')]],{'queuecallerabandon':![],'queuecallerabandonAt':null,'queuecallerexit':!![],'queuecallerexitAt':utils[_0xc4a7('0x10')](),'queuecallerexitreason':_0x1ebc09[_0xc4a7('0x15')][_0xc4a7('0x16')]()});}}}};exports[_0xc4a7('0x17')]=function(_0x462bbf){var _0x547fe8={'queuecallerabandon':!![],'queuecallerabandonAt':utils[_0xc4a7('0x10')](),'queuecallerexitreason':_0xc4a7('0x18')};if(!_['isNil'](queues[_0x462bbf[_0xc4a7('0xc')]])){queues[_0x462bbf[_0xc4a7('0xc')]]=_['assign'](queues[_0x462bbf[_0xc4a7('0xc')]],_0x547fe8);}if(!_[_0xc4a7('0xd')](transfers[_0x462bbf['channel']])){transfers[_0x462bbf['channel']]=_[_0xc4a7('0x19')](transfers[_0x462bbf[_0xc4a7('0xc')]],_0x547fe8);}};exports[_0xc4a7('0x1a')]=function(_0x4ae23c){if(!_['isNil'](queues[_0x4ae23c[_0xc4a7('0xc')]])){queues[_0x4ae23c[_0xc4a7('0xc')]]=_[_0xc4a7('0x19')](queues[_0x4ae23c['channel']],{'queuecallerleave':!![],'queuecallerleaveAt':utils['now'](),'holdtime':utils[_0xc4a7('0x1b')](utils['now'](),queues[_0x4ae23c[_0xc4a7('0xc')]]['queuecallerjoinAt'])});}if(!_[_0xc4a7('0xd')](transfers[_0x4ae23c[_0xc4a7('0xc')]])){transfers[_0x4ae23c[_0xc4a7('0xc')]]=_[_0xc4a7('0x19')](transfers[_0x4ae23c['channel']],{'queuecallerleave':!![],'queuecallerleaveAt':utils[_0xc4a7('0x10')](),'holdtime':utils[_0xc4a7('0x1b')](utils[_0xc4a7('0x10')](),transfers[_0x4ae23c['channel']][_0xc4a7('0x1c')])});}};exports[_0xc4a7('0x1d')]=function(_0x2e7aa9){var _0x3740ec={'connectedlinenum':_0x2e7aa9[_0xc4a7('0x1e')],'connectedlinename':_0x2e7aa9[_0xc4a7('0x1f')],'assigned':!![],'lastAssignedTo':_0x2e7aa9[_0xc4a7('0x20')]};if(!_['isNil'](queues[_0x2e7aa9[_0xc4a7('0xc')]])){queues[_0x2e7aa9[_0xc4a7('0xc')]]=_[_0xc4a7('0x19')](queues[_0x2e7aa9[_0xc4a7('0xc')]],_0x3740ec);}if(!_['isNil'](transfers[_0x2e7aa9['channel']])){transfers[_0x2e7aa9[_0xc4a7('0xc')]]=_[_0xc4a7('0x19')](transfers[_0x2e7aa9[_0xc4a7('0xc')]],_0x3740ec);}};exports[_0xc4a7('0x21')]=function(_0x195fa2){var _0x3d9c24={'queuecallercomplete':!![],'queuecallercompleteAt':utils['now']()};if(_0x195fa2[_0xc4a7('0x22')]!=_0xc4a7('0x23')){_0x3d9c24[_0xc4a7('0x6')]=_0xc4a7('0x24')+_0x195fa2[_0xc4a7('0x22')][_0xc4a7('0x16')]();}if(!_[_0xc4a7('0xd')](queues[_0x195fa2[_0xc4a7('0xc')]])){queues[_0x195fa2[_0xc4a7('0xc')]]=_['assign'](queues[_0x195fa2[_0xc4a7('0xc')]],_0x3d9c24);writeDB(queues[_0x195fa2[_0xc4a7('0xc')]],!![]);}};exports[_0xc4a7('0x25')]=function(_0x573624){if(!_[_0xc4a7('0xd')](queues[_0x573624[_0xc4a7('0x26')]])){queues[_0x573624[_0xc4a7('0x26')]]=_[_0xc4a7('0x19')](queues[_0x573624[_0xc4a7('0x26')]],{'transfer':!![],'transfertype':_0xc4a7('0x27'),'transferexten':_0x573624[_0xc4a7('0x28')],'transferuniqueid':_0x573624['transfereeuniqueid'],'queuecallerexitreason':_0xc4a7('0x29')});}};exports[_0xc4a7('0x2a')]=function(_0x437cb7){_[_0xc4a7('0x2b')](queues,function(_0x59b703){if(_0x59b703[_0xc4a7('0xc')]==_0x437cb7['origtransfererchannel']){transfers[_0x437cb7[_0xc4a7('0x2c')]]=_['clone'](_0x59b703);transfers[_0x437cb7['transfertargetchannel']]=_[_0xc4a7('0x19')](transfers[_0x437cb7[_0xc4a7('0x2c')]],{'queuecallerjoinAt':utils[_0xc4a7('0x10')](),'queuecallerleaveAt':utils['now'](),'channel':_0x437cb7[_0xc4a7('0x2c')],'calleridname':_0x437cb7[_0xc4a7('0x2d')],'calleridnum':_0x437cb7[_0xc4a7('0x2e')],'queuecallerenterreason':0x2});queues[_0x437cb7[_0xc4a7('0x2c')]]=_[_0xc4a7('0x19')](queues[_0x437cb7['transfertargetchannel']],{'transfer':!![],'transfertype':_0xc4a7('0x2f'),'queuecallerexitreason':'ATTENDEDTRANSFER','transferexten':_0x437cb7[_0xc4a7('0x30')],'transferuniqueid':_0x437cb7[_0xc4a7('0x31')]});queues[_0x437cb7['origtransfererchannel']]=_['assign'](queues[_0x437cb7[_0xc4a7('0x32')]],{'queuecallerexitreason':'ATTENDED','queuecallerenterreason':0x1});}else if(_0x59b703[_0xc4a7('0xc')]==_0x437cb7['secondtransfererchannel']){transfers[_0x437cb7[_0xc4a7('0x26')]]=_['clone'](_0x59b703);transfers[_0x437cb7[_0xc4a7('0x26')]]=_[_0xc4a7('0x19')](transfers[_0x437cb7[_0xc4a7('0x26')]],{'queuecallerjoinAt':utils[_0xc4a7('0x10')](),'queuecallerleaveAt':utils[_0xc4a7('0x10')](),'channel':_0x437cb7[_0xc4a7('0x26')],'calleridname':_0x437cb7[_0xc4a7('0x33')],'calleridnum':_0x437cb7[_0xc4a7('0x34')],'queuecallerenterreason':0x2});queues[_0x437cb7[_0xc4a7('0x26')]]=_[_0xc4a7('0x19')](queues[_0x437cb7[_0xc4a7('0x26')]],{'transfer':!![],'transfertype':'ATTENDED','queuecallerexitreason':'ATTENDEDTRANSFER','transferexten':_0x437cb7[_0xc4a7('0x35')],'transferuniqueid':_0x437cb7[_0xc4a7('0x36')]});queues[_0x437cb7[_0xc4a7('0x37')]]=_['assign'](queues[_0x437cb7[_0xc4a7('0x37')]],{'queuecallerexitreason':_0xc4a7('0x2f'),'queuecallerenterreason':0x1});}});};exports[_0xc4a7('0x38')]=function(_0x5f2dd4){if(!_[_0xc4a7('0xd')](queues[_0x5f2dd4[_0xc4a7('0xc')]])){queues[_0x5f2dd4['channel']]['musiconholdstartAt']=utils[_0xc4a7('0x10')]();}};exports[_0xc4a7('0x39')]=function(_0xac240b){if(!_['isNil'](queues[_0xac240b['channel']])){if(!_[_0xc4a7('0xd')](queues[_0xac240b[_0xc4a7('0xc')]][_0xc4a7('0x3a')])){queues[_0xac240b[_0xc4a7('0xc')]]['mohtime']+=utils[_0xc4a7('0x1b')](utils[_0xc4a7('0x10')](),queues[_0xac240b[_0xc4a7('0xc')]]['musiconholdstartAt']);delete queues[_0xac240b['channel']]['musiconholdstartAt'];}}};exports[_0xc4a7('0x3b')]=function(_0x5e023d){if(!_[_0xc4a7('0xd')](queues[_0x5e023d[_0xc4a7('0xc')]])){writeDB(queues[_0x5e023d[_0xc4a7('0xc')]],!![]);}if(!_[_0xc4a7('0xd')](transfers[_0x5e023d[_0xc4a7('0xc')]])){if(transfers[_0x5e023d['channel']]['assigned']){transfers[_0x5e023d['channel']]=_[_0xc4a7('0x19')](transfers[_0x5e023d[_0xc4a7('0xc')]],{'queuecallercomplete':!![],'queuecallercompleteAt':utils['now'](),'queuecallerexitreason':_0xc4a7('0x3c')});}writeDB(transfers[_0x5e023d[_0xc4a7('0xc')]],![]);delete transfers[_0x5e023d[_0xc4a7('0xc')]];}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 08d1298..9e903b4 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 _0x1d5b=['varset','variable','isNil','value','.wav49','replace','.WAV','agentconnect','assign','queue','connectedlinenum','type','destinationchannel','dialer','uniqueid','destinationcontext','lastdata','calleridnum','calleridname','lodash','./utils','accountcode','then','membername','request','CreateVoiceRecording','channel'];(function(_0x15884f,_0x26355d){var _0x31073c=function(_0x3417d5){while(--_0x3417d5){_0x15884f['push'](_0x15884f['shift']());}};_0x31073c(++_0x26355d);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x142cb5,_0x1a7750){_0x142cb5=_0x142cb5-0x0;var _0x321de3=_0x1d5b[_0x142cb5];return _0x321de3;};'use strict';var _=require(_0xb1d5('0x0'));var utils=require(_0xb1d5('0x1'));var recordings={};function writeDB(_0x1a1089){utils['debug'](_0x1a1089);if(_0x1a1089[_0xb1d5('0x2')]){utils['getUserByInternal'](_0x1a1089[_0xb1d5('0x2')])[_0xb1d5('0x3')](function(_0xa12a1e){if(_0xa12a1e){_0x1a1089[_0xb1d5('0x4')]=_0xa12a1e['name'];_0x1a1089['UserId']=_0xa12a1e['id'];}utils[_0xb1d5('0x5')](_0xb1d5('0x6'),_0x1a1089);});}else{utils[_0xb1d5('0x5')](_0xb1d5('0x6'),_0x1a1089);}if(recordings[_0x1a1089[_0xb1d5('0x7')]]){delete recordings[_0x1a1089[_0xb1d5('0x7')]];}}exports[_0xb1d5('0x8')]=function(_0xc3f315){if(!_['isNil'](_0xc3f315[_0xb1d5('0x9')])&&!_[_0xb1d5('0xa')](_0xc3f315['variable']['mixmonitor_filename'])){if(!_[_0xb1d5('0xa')](recordings[_0xc3f315[_0xb1d5('0x7')]])){writeDB(recordings[_0xc3f315[_0xb1d5('0x7')]]);}if(_['endsWith'](_0xc3f315[_0xb1d5('0xb')],_0xb1d5('0xc'))){_0xc3f315[_0xb1d5('0xb')]=_0xc3f315['value'][_0xb1d5('0xd')](_0xb1d5('0xc'),_0xb1d5('0xe'));}recordings[_0xc3f315[_0xb1d5('0x7')]]=_['assign'](_0xc3f315,{});}};exports[_0xb1d5('0xf')]=function(_0x31a2b6){if(!_[_0xb1d5('0xa')](recordings[_0x31a2b6['channel']])){recordings[_0x31a2b6[_0xb1d5('0x7')]]=_[_0xb1d5('0x10')](recordings[_0x31a2b6[_0xb1d5('0x7')]],{'membername':_0x31a2b6[_0xb1d5('0x4')],'queue':_0x31a2b6[_0xb1d5('0x11')],'accountcode':_0x31a2b6[_0xb1d5('0x12')]});}};exports['cdr']=function(_0x199deb){if(!_['isNil'](recordings[_0x199deb[_0xb1d5('0x7')]])){recordings[_0x199deb[_0xb1d5('0x7')]]=_['assign'](recordings[_0x199deb[_0xb1d5('0x7')]],{'type':_0x199deb[_0xb1d5('0x13')]});writeDB(recordings[_0x199deb[_0xb1d5('0x7')]]);}else if(!_['isNil'](recordings[_0x199deb[_0xb1d5('0x14')]])){recordings[_0x199deb[_0xb1d5('0x7')]]=recordings[_0x199deb['destinationchannel']];delete recordings[_0x199deb[_0xb1d5('0x14')]];if(_0x199deb[_0xb1d5('0x13')]==_0xb1d5('0x15')){recordings[_0x199deb[_0xb1d5('0x7')]]=_[_0xb1d5('0x10')](recordings[_0x199deb['channel']],{'type':_0x199deb[_0xb1d5('0x13')],'uniqueid':_0x199deb[_0xb1d5('0x16')],'context':_0x199deb[_0xb1d5('0x17')],'queue':_0x199deb[_0xb1d5('0x18')],'connectedlinenum':_0x199deb[_0xb1d5('0x2')],'connectedlinename':'','calleridnum':_0x199deb['destination'],'exten':recordings[_0x199deb[_0xb1d5('0x7')]]['calleridnum']});}else{recordings[_0x199deb[_0xb1d5('0x7')]]=_['assign'](recordings[_0x199deb[_0xb1d5('0x7')]],{'type':_0x199deb[_0xb1d5('0x13')],'channel':_0x199deb[_0xb1d5('0x7')],'exten':_0x199deb['destination'],'context':_0x199deb['destinationcontext'],'uniqueid':_0x199deb[_0xb1d5('0x16')],'calleridnum':recordings[_0x199deb[_0xb1d5('0x7')]][_0xb1d5('0x12')],'calleridname':recordings[_0x199deb[_0xb1d5('0x7')]]['connectedlinename'],'connectedlinenum':recordings[_0x199deb[_0xb1d5('0x7')]][_0xb1d5('0x19')],'connectedlinename':recordings[_0x199deb[_0xb1d5('0x7')]][_0xb1d5('0x1a')]});}writeDB(recordings[_0x199deb[_0xb1d5('0x7')]]);}}; \ No newline at end of file +var _0xb28a=['type','destinationchannel','dialer','uniqueid','lastdata','destination','destinationcontext','connectedlinename','calleridnum','calleridname','./utils','accountcode','membername','name','UserId','request','CreateVoiceRecording','varset','isNil','variable','channel','endsWith','value','.wav49','replace','assign','agentconnect','queue','connectedlinenum'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xb28a,0x166));var _0xab28=function(_0x311ffc,_0x4dfbb8){_0x311ffc=_0x311ffc-0x0;var _0x53be23=_0xb28a[_0x311ffc];return _0x53be23;};'use strict';var _=require('lodash');var utils=require(_0xab28('0x0'));var recordings={};function writeDB(_0xeef1fd){utils['debug'](_0xeef1fd);if(_0xeef1fd[_0xab28('0x1')]){utils['getUserByInternal'](_0xeef1fd['accountcode'])['then'](function(_0x451fc9){if(_0x451fc9){_0xeef1fd[_0xab28('0x2')]=_0x451fc9[_0xab28('0x3')];_0xeef1fd[_0xab28('0x4')]=_0x451fc9['id'];}utils[_0xab28('0x5')](_0xab28('0x6'),_0xeef1fd);});}else{utils[_0xab28('0x5')](_0xab28('0x6'),_0xeef1fd);}if(recordings[_0xeef1fd['channel']]){delete recordings[_0xeef1fd['channel']];}}exports[_0xab28('0x7')]=function(_0x32635b){if(!_[_0xab28('0x8')](_0x32635b[_0xab28('0x9')])&&!_[_0xab28('0x8')](_0x32635b[_0xab28('0x9')]['mixmonitor_filename'])){if(!_[_0xab28('0x8')](recordings[_0x32635b['channel']])){writeDB(recordings[_0x32635b[_0xab28('0xa')]]);}if(_[_0xab28('0xb')](_0x32635b[_0xab28('0xc')],_0xab28('0xd'))){_0x32635b[_0xab28('0xc')]=_0x32635b[_0xab28('0xc')][_0xab28('0xe')](_0xab28('0xd'),'.WAV');}recordings[_0x32635b[_0xab28('0xa')]]=_[_0xab28('0xf')](_0x32635b,{});}};exports[_0xab28('0x10')]=function(_0x389fc3){if(!_[_0xab28('0x8')](recordings[_0x389fc3[_0xab28('0xa')]])){recordings[_0x389fc3['channel']]=_['assign'](recordings[_0x389fc3[_0xab28('0xa')]],{'membername':_0x389fc3[_0xab28('0x2')],'queue':_0x389fc3[_0xab28('0x11')],'accountcode':_0x389fc3[_0xab28('0x12')]});}};exports['cdr']=function(_0x28ebe2){if(!_['isNil'](recordings[_0x28ebe2[_0xab28('0xa')]])){recordings[_0x28ebe2['channel']]=_[_0xab28('0xf')](recordings[_0x28ebe2[_0xab28('0xa')]],{'type':_0x28ebe2[_0xab28('0x13')]});writeDB(recordings[_0x28ebe2[_0xab28('0xa')]]);}else if(!_[_0xab28('0x8')](recordings[_0x28ebe2[_0xab28('0x14')]])){recordings[_0x28ebe2[_0xab28('0xa')]]=recordings[_0x28ebe2[_0xab28('0x14')]];delete recordings[_0x28ebe2['destinationchannel']];if(_0x28ebe2[_0xab28('0x13')]==_0xab28('0x15')){recordings[_0x28ebe2[_0xab28('0xa')]]=_[_0xab28('0xf')](recordings[_0x28ebe2[_0xab28('0xa')]],{'type':_0x28ebe2[_0xab28('0x13')],'uniqueid':_0x28ebe2[_0xab28('0x16')],'context':_0x28ebe2['destinationcontext'],'queue':_0x28ebe2[_0xab28('0x17')],'connectedlinenum':_0x28ebe2['accountcode'],'connectedlinename':'','calleridnum':_0x28ebe2[_0xab28('0x18')],'exten':recordings[_0x28ebe2[_0xab28('0xa')]]['calleridnum']});}else{recordings[_0x28ebe2[_0xab28('0xa')]]=_[_0xab28('0xf')](recordings[_0x28ebe2[_0xab28('0xa')]],{'type':_0x28ebe2[_0xab28('0x13')],'channel':_0x28ebe2[_0xab28('0xa')],'exten':_0x28ebe2[_0xab28('0x18')],'context':_0x28ebe2[_0xab28('0x19')],'uniqueid':_0x28ebe2['uniqueid'],'calleridnum':recordings[_0x28ebe2[_0xab28('0xa')]]['connectedlinenum'],'calleridname':recordings[_0x28ebe2[_0xab28('0xa')]][_0xab28('0x1a')],'connectedlinenum':recordings[_0x28ebe2['channel']][_0xab28('0x1b')],'connectedlinename':recordings[_0x28ebe2['channel']][_0xab28('0x1c')]});}writeDB(recordings[_0x28ebe2[_0xab28('0xa')]]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index b65a0aa..3fd3d55 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 _0x0a38=['origtransfererlinkedid','origtransfererexten','attended','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','TRANSFER|%s','type','request','blindtransfer','blind','assign','origtransfereraccountcode','secondtransferercontext','secondtransfererexten'];(function(_0x3b8d37,_0x248eda){var _0xd7bc71=function(_0x1910ef){while(--_0x1910ef){_0x3b8d37['push'](_0x3b8d37['shift']());}};_0xd7bc71(++_0x248eda);}(_0x0a38,0xab));var _0x80a3=function(_0x4ecab4,_0x16b971){_0x4ecab4=_0x4ecab4-0x0;var _0x5170db=_0x0a38[_0x4ecab4];return _0x5170db;};'use strict';var _=require(_0x80a3('0x0'));var util=require(_0x80a3('0x1'));var utils=require(_0x80a3('0x2'));function writeDB(_0x1fb1ab){utils[_0x80a3('0x3')](util['format'](_0x80a3('0x4'),_0x1fb1ab[_0x80a3('0x5')]));utils[_0x80a3('0x6')]('CreateVoiceTransferReport',_0x1fb1ab);}exports[_0x80a3('0x7')]=function(_0x1aa4d2){_0x1aa4d2[_0x80a3('0x5')]=_0x80a3('0x8');writeDB(_0x1aa4d2);};exports['attendedtransfer']=function(_0x4b2482){_0x4b2482=_[_0x80a3('0x9')](_0x4b2482,{'transfererchannel':_0x4b2482['origtransfererchannel'],'transferercalleridnum':_0x4b2482['origtransferercalleridnum'],'transferercalleridname':_0x4b2482['origtransferercalleridname'],'transfererconnectedlinenum':_0x4b2482['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4b2482['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4b2482[_0x80a3('0xa')],'transferercontext':_0x4b2482[_0x80a3('0xb')],'transfererexten':_0x4b2482[_0x80a3('0xc')],'transfererlinkedid':_0x4b2482[_0x80a3('0xd')],'context':_0x4b2482['origtransferercontext'],'extension':_0x4b2482[_0x80a3('0xe')],'type':_0x80a3('0xf')});if(_[_0x80a3('0x10')](_0x4b2482[_0x80a3('0x11')])){_0x4b2482=_[_0x80a3('0x9')](_0x4b2482,{'transfereechannel':_0x4b2482['transfertargetchannel'],'transfereecalleridnum':_0x4b2482[_0x80a3('0x12')],'transfereecalleridname':_0x4b2482['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x4b2482[_0x80a3('0x13')],'transfereeconnectedlinename':_0x4b2482[_0x80a3('0x14')],'transfereeaccountcode':_0x4b2482['transfertargetaccountcode'],'transfereecontext':_0x4b2482[_0x80a3('0x15')],'transfereeexten':_0x4b2482[_0x80a3('0x16')],'transfereelinkedid':_0x4b2482['transfertargetlinkedid']});}writeDB(_0x4b2482);}; \ No newline at end of file +var _0x4aa2=['origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','util','./utils','format','TRANSFER|%s','type','request','blindtransfer','blind','assign','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename'];(function(_0x1f566f,_0x389d8f){var _0x3b0ea3=function(_0x550988){while(--_0x550988){_0x1f566f['push'](_0x1f566f['shift']());}};_0x3b0ea3(++_0x389d8f);}(_0x4aa2,0x120));var _0x24aa=function(_0x533fd1,_0x4feb85){_0x533fd1=_0x533fd1-0x0;var _0x371104=_0x4aa2[_0x533fd1];return _0x371104;};'use strict';var _=require('lodash');var util=require(_0x24aa('0x0'));var utils=require(_0x24aa('0x1'));function writeDB(_0x2df854){utils['info'](util[_0x24aa('0x2')](_0x24aa('0x3'),_0x2df854[_0x24aa('0x4')]));utils[_0x24aa('0x5')]('CreateVoiceTransferReport',_0x2df854);}exports[_0x24aa('0x6')]=function(_0x1b1ce0){_0x1b1ce0['type']=_0x24aa('0x7');writeDB(_0x1b1ce0);};exports['attendedtransfer']=function(_0x454bd7){_0x454bd7=_[_0x24aa('0x8')](_0x454bd7,{'transfererchannel':_0x454bd7['origtransfererchannel'],'transferercalleridnum':_0x454bd7['origtransferercalleridnum'],'transferercalleridname':_0x454bd7[_0x24aa('0x9')],'transfererconnectedlinenum':_0x454bd7[_0x24aa('0xa')],'transfererconnectedlinename':_0x454bd7[_0x24aa('0xb')],'transfereraccountcode':_0x454bd7[_0x24aa('0xc')],'transferercontext':_0x454bd7[_0x24aa('0xd')],'transfererexten':_0x454bd7[_0x24aa('0xe')],'transfererlinkedid':_0x454bd7['origtransfererlinkedid'],'context':_0x454bd7[_0x24aa('0xf')],'extension':_0x454bd7[_0x24aa('0x10')],'type':'attended'});if(_['isNil'](_0x454bd7['transfereechannel'])){_0x454bd7=_[_0x24aa('0x8')](_0x454bd7,{'transfereechannel':_0x454bd7[_0x24aa('0x11')],'transfereecalleridnum':_0x454bd7[_0x24aa('0x12')],'transfereecalleridname':_0x454bd7[_0x24aa('0x13')],'transfereeconnectedlinenum':_0x454bd7[_0x24aa('0x14')],'transfereeconnectedlinename':_0x454bd7[_0x24aa('0x15')],'transfereeaccountcode':_0x454bd7[_0x24aa('0x16')],'transfereecontext':_0x454bd7[_0x24aa('0x17')],'transfereeexten':_0x454bd7[_0x24aa('0x18')],'transfereelinkedid':_0x454bd7['transfertargetlinkedid']});}writeDB(_0x454bd7);}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 272b854..06b6e8d 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 _0x7a0a=['isBefore','moment','bluebird','http','../../config/logger','info','debug','stringify','error','then','catch','request','GetUser','internal','name','result','NOTFOUND','length','getUserByInternal','stack','getUserByInterface','getVoiceQueueByName','GetVoiceQueue','acw','GETVOICEQUEUEBYNAME|','FOUND','addTime','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff'];(function(_0x280761,_0xaeaab9){var _0x3438cc=function(_0x5d2b7c){while(--_0x5d2b7c){_0x280761['push'](_0x280761['shift']());}};_0x3438cc(++_0xaeaab9);}(_0x7a0a,0x1dd));var _0xa7a0=function(_0x879642,_0x48f3b1){_0x879642=_0x879642-0x0;var _0x5b39bb=_0x7a0a[_0x879642];return _0x5b39bb;};'use strict';var jayson=require('jayson/promise');var moment=require(_0xa7a0('0x0'));var BPromise=require(_0xa7a0('0x1'));var client=jayson['client'][_0xa7a0('0x2')]({'port':0x2329});var logger=require(_0xa7a0('0x3'))('xdr');exports[_0xa7a0('0x4')]=function(_0x3892b9){logger[_0xa7a0('0x4')](_0x3892b9);};exports[_0xa7a0('0x5')]=function(_0x1d041e){logger[_0xa7a0('0x5')](JSON[_0xa7a0('0x6')](_0x1d041e));};exports[_0xa7a0('0x7')]=function(_0x44166e){logger[_0xa7a0('0x7')](_0x44166e['stack']);};exports['request']=function(_0x479d6f,_0x50eba2){return client['request'](_0x479d6f,{'body':_0x50eba2})[_0xa7a0('0x8')](function(_0x580895){logger['debug'](JSON[_0xa7a0('0x6')](_0x580895));})[_0xa7a0('0x9')](function(_0x59a1bf){logger['error'](_0x59a1bf['stack']);});};function getUser(_0x40dec2){return client[_0xa7a0('0xa')](_0xa7a0('0xb'),{'options':{'raw':!![],'attributes':['id',_0xa7a0('0xc'),_0xa7a0('0xd'),'interface'],'where':_0x40dec2,'limit':0x1}})[_0xa7a0('0x8')](function(_0xde46a){logger['info']('GETUSER|'+JSON['stringify'](_0x40dec2)+'|'+(_0xde46a[_0xa7a0('0xe')]['length']?'FOUND':_0xa7a0('0xf')));return _0xde46a[_0xa7a0('0xe')][_0xa7a0('0x10')]?_0xde46a[_0xa7a0('0xe')][0x0]:null;});}exports[_0xa7a0('0x11')]=function(_0x9b5a54){return new BPromise(function(_0x2c8e9d,_0x2d455e){if(_0x9b5a54){return getUser({'internal':_0x9b5a54})[_0xa7a0('0x8')](function(_0x4bf15a){return _0x2c8e9d(_0x4bf15a);})[_0xa7a0('0x9')](function(_0x7abaec){logger[_0xa7a0('0x7')](_0x7abaec[_0xa7a0('0x12')]);return _0x2c8e9d(null);});}else{return _0x2c8e9d(null);}});};exports[_0xa7a0('0x13')]=function(_0x549302){return new BPromise(function(_0x298f98,_0x9a91d6){if(_0x549302){return getUser({'interface':_0x549302})[_0xa7a0('0x8')](function(_0x418551){return _0x298f98(_0x418551);})[_0xa7a0('0x9')](function(_0x113af0){logger['error'](_0x113af0[_0xa7a0('0x12')]);return _0x298f98(null);});}else{return _0x298f98(null);}});};exports['getUserByName']=function(_0x19dd86){return new BPromise(function(_0x1e155c,_0x1e24af){if(_0x19dd86){return getUser({'name':_0x19dd86})[_0xa7a0('0x8')](function(_0x5a5572){return _0x1e155c(_0x5a5572);})[_0xa7a0('0x9')](function(_0x5507e7){logger['error'](_0x5507e7['stack']);return _0x1e155c(null);});}else{return _0x1e155c(null);}});};exports[_0xa7a0('0x14')]=function(_0x449159){return new BPromise(function(_0x29fd05,_0x2a3acd){if(_0x449159){return client[_0xa7a0('0xa')](_0xa7a0('0x15'),{'options':{'raw':!![],'attributes':['id',_0xa7a0('0xd'),'type',_0xa7a0('0x16'),'acwTimeout'],'where':{'name':_0x449159},'limit':0x1}})[_0xa7a0('0x8')](function(_0x1ae4c1){logger[_0xa7a0('0x4')](_0xa7a0('0x17')+_0x449159+'|'+(_0x1ae4c1['result']['length']?_0xa7a0('0x18'):_0xa7a0('0xf')));return _0x29fd05(_0x1ae4c1[_0xa7a0('0xe')][_0xa7a0('0x10')]?_0x1ae4c1[_0xa7a0('0xe')][0x0]:null);})[_0xa7a0('0x9')](function(_0x37c1b0){logger[_0xa7a0('0x7')](_0x37c1b0[_0xa7a0('0x12')]);return _0x29fd05(null);});}else{return _0x29fd05(null);}});};exports[_0xa7a0('0x19')]=function(_0x424c3d,_0x4573a1){return moment(_0x424c3d)['add'](_0x4573a1,_0xa7a0('0x1a'))[_0xa7a0('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa7a0('0x1c')]=function(_0x1ae82b,_0x15d2a5){return moment(_0x1ae82b)[_0xa7a0('0x1d')](_0x15d2a5,_0xa7a0('0x1a'))['format'](_0xa7a0('0x1e'));};exports[_0xa7a0('0x1f')]=function(_0x2f40e6,_0x1e11fa){return moment(_0x2f40e6)[_0xa7a0('0x20')](moment(_0x1e11fa),_0xa7a0('0x1a'));};exports['sumTime']=function(_0x5372ad,_0x2ef873){return parseInt(_0x5372ad,0xa)+parseInt(_0x2ef873,0xa);};exports['now']=function(){return moment()[_0xa7a0('0x1b')](_0xa7a0('0x1e'));};exports['isAfter']=function(_0xeb904c,_0x437f27){if(_0x437f27){return moment(_0xeb904c)['isAfter'](_0x437f27);}else{return!![];}};exports[_0xa7a0('0x21')]=function(_0x154d10,_0x86751e){if(_0x86751e){return moment(_0x154d10)[_0xa7a0('0x21')](_0x86751e);}else if(_0x154d10){return!![];}else{return![];}}; \ No newline at end of file +var _0x5182=['GetUser','internal','name','interface','GETUSER|','length','result','getUserByInternal','getVoiceQueueByName','type','acw','GETVOICEQUEUEBYNAME|','FOUND','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','info','debug','stringify','error','stack','request','then','catch'];(function(_0x2ff88e,_0x1341bd){var _0x18fcc6=function(_0x188f26){while(--_0x188f26){_0x2ff88e['push'](_0x2ff88e['shift']());}};_0x18fcc6(++_0x1341bd);}(_0x5182,0x67));var _0x2518=function(_0x546a88,_0x48d512){_0x546a88=_0x546a88-0x0;var _0x60ec43=_0x5182[_0x546a88];return _0x60ec43;};'use strict';var jayson=require(_0x2518('0x0'));var moment=require(_0x2518('0x1'));var BPromise=require(_0x2518('0x2'));var client=jayson[_0x2518('0x3')][_0x2518('0x4')]({'port':0x2329});var logger=require(_0x2518('0x5'))('xdr');exports[_0x2518('0x6')]=function(_0x4695b1){logger['info'](_0x4695b1);};exports['debug']=function(_0x556399){logger[_0x2518('0x7')](JSON[_0x2518('0x8')](_0x556399));};exports[_0x2518('0x9')]=function(_0x25a7d5){logger[_0x2518('0x9')](_0x25a7d5[_0x2518('0xa')]);};exports[_0x2518('0xb')]=function(_0x378980,_0x4bf3aa){return client[_0x2518('0xb')](_0x378980,{'body':_0x4bf3aa})[_0x2518('0xc')](function(_0x416e30){logger[_0x2518('0x7')](JSON[_0x2518('0x8')](_0x416e30));})[_0x2518('0xd')](function(_0xf5df02){logger[_0x2518('0x9')](_0xf5df02['stack']);});};function getUser(_0x2063b1){return client[_0x2518('0xb')](_0x2518('0xe'),{'options':{'raw':!![],'attributes':['id',_0x2518('0xf'),_0x2518('0x10'),_0x2518('0x11')],'where':_0x2063b1,'limit':0x1}})[_0x2518('0xc')](function(_0x18dfdf){logger['info'](_0x2518('0x12')+JSON[_0x2518('0x8')](_0x2063b1)+'|'+(_0x18dfdf['result'][_0x2518('0x13')]?'FOUND':'NOTFOUND'));return _0x18dfdf[_0x2518('0x14')][_0x2518('0x13')]?_0x18dfdf[_0x2518('0x14')][0x0]:null;});}exports[_0x2518('0x15')]=function(_0x352c75){return new BPromise(function(_0x3c55fc,_0x5d03e3){if(_0x352c75){return getUser({'internal':_0x352c75})['then'](function(_0x1f74a5){return _0x3c55fc(_0x1f74a5);})[_0x2518('0xd')](function(_0x40bde9){logger['error'](_0x40bde9[_0x2518('0xa')]);return _0x3c55fc(null);});}else{return _0x3c55fc(null);}});};exports['getUserByInterface']=function(_0x36a6cc){return new BPromise(function(_0x172468,_0x381900){if(_0x36a6cc){return getUser({'interface':_0x36a6cc})[_0x2518('0xc')](function(_0x2486fc){return _0x172468(_0x2486fc);})[_0x2518('0xd')](function(_0x4b9bf2){logger['error'](_0x4b9bf2[_0x2518('0xa')]);return _0x172468(null);});}else{return _0x172468(null);}});};exports['getUserByName']=function(_0x3d85bd){return new BPromise(function(_0x3b08a7,_0x251254){if(_0x3d85bd){return getUser({'name':_0x3d85bd})[_0x2518('0xc')](function(_0x306dd4){return _0x3b08a7(_0x306dd4);})[_0x2518('0xd')](function(_0x50bb7a){logger['error'](_0x50bb7a[_0x2518('0xa')]);return _0x3b08a7(null);});}else{return _0x3b08a7(null);}});};exports[_0x2518('0x16')]=function(_0x1afb2b){return new BPromise(function(_0x46b5b6,_0x5a2cfd){if(_0x1afb2b){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x2518('0x10'),_0x2518('0x17'),_0x2518('0x18'),'acwTimeout'],'where':{'name':_0x1afb2b},'limit':0x1}})[_0x2518('0xc')](function(_0x81e902){logger['info'](_0x2518('0x19')+_0x1afb2b+'|'+(_0x81e902[_0x2518('0x14')]['length']?_0x2518('0x1a'):'NOTFOUND'));return _0x46b5b6(_0x81e902[_0x2518('0x14')][_0x2518('0x13')]?_0x81e902[_0x2518('0x14')][0x0]:null);})[_0x2518('0xd')](function(_0x5079c6){logger[_0x2518('0x9')](_0x5079c6[_0x2518('0xa')]);return _0x46b5b6(null);});}else{return _0x46b5b6(null);}});};exports[_0x2518('0x1b')]=function(_0x54d88e,_0x5b3abc){return moment(_0x54d88e)[_0x2518('0x1c')](_0x5b3abc,'seconds')[_0x2518('0x1d')](_0x2518('0x1e'));};exports[_0x2518('0x1f')]=function(_0xbf17ee,_0x465684){return moment(_0xbf17ee)[_0x2518('0x20')](_0x465684,_0x2518('0x21'))[_0x2518('0x1d')](_0x2518('0x1e'));};exports[_0x2518('0x22')]=function(_0x5d1a4f,_0x1c97cb){return moment(_0x5d1a4f)[_0x2518('0x23')](moment(_0x1c97cb),_0x2518('0x21'));};exports['sumTime']=function(_0x32eea7,_0xe67417){return parseInt(_0x32eea7,0xa)+parseInt(_0xe67417,0xa);};exports[_0x2518('0x24')]=function(){return moment()[_0x2518('0x1d')](_0x2518('0x1e'));};exports[_0x2518('0x25')]=function(_0x51132a,_0x26f4d1){if(_0x26f4d1){return moment(_0x51132a)['isAfter'](_0x26f4d1);}else{return!![];}};exports['isBefore']=function(_0x5802dd,_0x181c35){if(_0x181c35){return moment(_0x5802dd)[_0x2518('0x26')](_0x181c35);}else if(_0x5802dd){return!![];}else{return![];}}; \ No newline at end of file diff --git a/snippet/1.0.11/index.html b/snippet/1.0.11/index.html index f78a433..a591aff 100644 --- a/snippet/1.0.11/index.html +++ b/snippet/1.0.11/index.html @@ -1,77 +1,80 @@ + - - xCally Motion Chat + + xCally Motion Chat - + - + - + + - -
+ +
-
- - CHAT -
+
+ + CHAT +
+ +
+ + + + + + + + +
+
+ logo +
-
- - - - - - - - -
-
- logo -
- - - {{settings.defaultTitle ? settings.defaultTitle : (status === 'online' ? settings.header_online : settings.header_offline)}} - - - - - - - -
- -
- - - -
- -
- -
-
- -
- -
- - CHAT + + {{settings.defaultTitle ? settings.defaultTitle : (status === 'online' ? settings.header_online : settings.header_offline)}} + + + + + + + +
+ +
+ + + +
+ +
+ +
+ + +
+ +
+ + CHAT +
-
- - - + - + + + - + + \ No newline at end of file diff --git a/snippet/1.0.11/scripts/app.js b/snippet/1.0.11/scripts/app.js index 6d53f1a..ca4dae9 100644 --- a/snippet/1.0.11/scripts/app.js +++ b/snippet/1.0.11/scripts/app.js @@ -1 +1,658 @@ -!function(){"use strict";angular.module("motion",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").directive("ngEnter",function(){return function(t,e,n){e.bind("keydown keypress",function(e){13===e.which&&(t.$apply(function(){t.$eval(n.ngEnter)}),e.preventDefault())})}}).directive("ngPrint",function(){function i(e,t){for(var n,i=document.createElement("div"),o=t.visitor,s=t.settings,a=0;a"+document.title+""),m.document.write(""),m.document.write("

Website: "+s.referer+"

"),m.document.write("

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

"),m.document.write("

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

"),m.document.write(i.innerHTML),m.document.write(""),m.document.close(),m.focus(),m.print(),m.close()}return{link:function(t,e,n){e.on("click",function(){var e=document.getElementById("chatContent1");e&&i(e,t)})},restrict:"A"}})}(),function(){"use strict";function e(e,s,t,n,i,o,a,r,l,c){var d,m,g,u,p=this;function f(){s.settings.online?o.go("app.online",null,{location:"replace"}):o.go("app.offline",null,{location:"replace"})}function v(){s.visitor&&s.visitor.interaction&&s.visitor.interaction.id&&r.chatInteraction.get({id:s.visitor.interaction.id}).$promise.then(function(e){delete p.errors.getInteraction,e.closed&&(s.visitor.interaction.closed=!0,s.updateStorage(l,s.visitor),"unmanaged"===e.disposition?o.go("app.unmanaged",null,{location:"replace"}):o.go("app.closing",null,{location:"replace"}))}).catch(function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 404:s.updateStorage(l,null,!0),s.updateStorage(c,null,!0),f();break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}})}function h(t){return function(e){p.errors[t]=e.data,w()}}function x(e){var t=d[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==t&&b(_.merge({body:t},s.visitor))}function b(e){r.chatWebsite.notify(e).$promise.then(function(e){delete p.errors.chatMessageError,_.isNil(s.visitor.interaction)&&(s.visitor.interaction={id:e.interaction.id},s.updateStorage(l,s.visitor)),d[0].emojioneArea.setText(""),w()}).catch(h("chatMessageError"))}function y(){s.visitor&&s.visitor.interaction&&s.visitor.interaction.id&&r.chatInteraction.getMessages({intid:s.visitor.interaction.id,includeAgent:!0,id:u||void 0}).$promise.then(function(e){if(delete p.errors.interaction,e.count){for(var t=0,n=!1;t'+e.name+"",AttachmentId:e.id},s.visitor))):h("sendAttachment")},h("sendAttachment"))},e.$on("$destroy",function(){n.cancel(m),n.cancel(g),g=m=null}),s.$on("$download",function(e,t){t&&t(_.values(s.messages))})}e.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","api","STORAGE_VISITOR","STORAGE_LAYOUT"],angular.module("motion").controller("ChatController",e)}(),function(){"use strict";function e(i,e,o,t,n,s){var a=this;function r(){i.settings.online?e.go("app.online",null,{location:"replace"}):e.go("app.offline",null,{location:"replace"})}function l(){a.form={},a.upColor=null,a.downColor=null,a.userForm.$setPristine(),a.userForm.$setUntouched(),delete i.visitor.interaction,i.enableDownload=!1}function c(n){return function(e){a.errors[n]=e.data;var t=o.simple().textContent(i.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");o.show(t)}}function d(){i.loading=!1}a.$onInit=function(){i.status="closing",i.updateStorage(n,null,!0),i.updateStorage(s,null,!0),i.loading=!1},a.submit=function(){i.loading=!0,i.visitor.interaction&&i.visitor.interaction.id?t.chatInteraction.close(_.merge({id:i.visitor.interaction.id,ratingType:i.settings.ratingType,customer:i.settings.customerAlias||i.visitor.from},a.form)).$promise.then(function(){delete a.errors.submit;var e=o.simple().textContent(i.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));o.show(e)}).then(l).then(r).catch(c("submit")).finally(d):(d(),c("submit"))},a.skip=function(){l(),r()},a.form={},a.errors={}}e.$inject=["$rootScope","$state","$mdToast","api","STORAGE_VISITOR","STORAGE_LAYOUT"],angular.module("motion").controller("ClosingController",e)}(),function(){"use strict";function e(a,n,r,i,o,l,s,c,d){var e=this;function m(e,t,n){var i=l.get(e)||{};n?delete i[a.location]:i[a.location]=t,l.set(e,i)}function g(e){var t;a.layout.up=e,m(c,a.layout),t=e?"show":"hide",n.parent.postMessage({cmd:t},"*")}a.location=a.settings.location,e.$onInit=function(){a.status="init";var e=!1,t=l.get(d)||{},n=l.get(c)||{};a.visitor=t[a.location]?t[a.location]:{},a.layout=n[a.location]?n[a.location]:{},a.visitor.interaction&&a.layout.up?e=!0:a.layout.up=!1;g(e),r.go((i=a.settings.online,o=!!(a.visitor&&a.visitor.interaction&&a.visitor.interaction.id),s=Number(a.settings.maxInteractions)&&Number(a.settings.openedInteractions)>=Number(a.settings.maxInteractions),o||!s&&i?"app.online":"app.offline"),null,{location:"replace"});var i,o,s},e.close=function(){var e=a.visitor.interaction;if(e&&e.id){var t=i.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(a.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");i.show(t).then(function(){return s.chatInteraction.customUpdate({id:e.id,closed:!0,closeReason:"contact",closedAt:moment().format("YYYY-MM-DD HH:mm:ss")}).$promise}).then(function(){r.go("app.closing",null,{location:"replace"})}).catch(function(e){console.error("keep open",e)})}},e.toggle=g,e.download=function(e){var t=o.defer(),n=a.visitor.interaction;n&&n.id&&s.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then(function(e){t.resolve(_.map(e.rows.slice(1),function(e){var t;if("in"===e.direction&&(t=a.settings.customerAlias||a.visitor.from||"Visitor"+e.ContactId),"out"===e.direction)switch(a.settings.agentIdentifier){case"website_alias":t=e.UserId?a.settings.agentAlias+e.UserId:"System";break;case"agent_alias":t=e.UserId?e.User.alias||e.User.fullname:"System";break;case"agent_fullname":t=e.UserId?e.User.fullname:"System";break;default:t=e.UserId?a.settings.agentAlias+e.UserId:"System"}return{sender:t,message:e.body,createdAt:moment(e.createdAt).format("MM/DD/YYYY HH:mm:ss")}}))}).catch(function(e){console.error(e)});return t.promise},e.getHeaderShape=function(){return"rounded"===a.settings.header_shape?"15px":"0px"},a.updateStorage=m,window.addEventListener("message",function(e){g("show"===e.data.evt)},!1)}e.$inject=["$rootScope","$window","$state","$mdDialog","$q","localStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR"],angular.module("motion").controller("IndexController",e)}(),function(){"use strict";function e(e,t){var n={baseUrl:e.settings.remote+"/api/"},i={id:"@id",token:e.settings.token};return n.chatWebsite=t(n.baseUrl+"chat/websites/:id",i,{notify:{method:"POST",url:n.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:n.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:n.baseUrl+"chat/websites/:id/fields"}}),n.chatInteraction=t(n.baseUrl+"chat/interactions/:id",i,{update:{method:"PUT",url:n.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:n.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:n.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:n.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:n.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:n.baseUrl+"chat/interactions/:id/attachment_download"}}),n.chatMessage=t(n.baseUrl+"chat/messages/:id",i,{update:{method:"PUT",url:n.baseUrl+"chat/messages/:id"}}),n}e.$inject=["$rootScope","$resource"],angular.module("motion").factory("api",e)}(),function(){"use strict";function e(n,e){var t=e.search();n.settings={cursor:"pointer",hide:!0},_.forIn(t,function(e,t){""===e||_.isNil(e)||("true"===e&&(e=!0),"false"===e&&(e=!1),n.settings[t]=e)})}function t(e,t,n,i,o,s){n.html5Mode(!0),i.defaults.headers.get||(i.defaults.headers.get={}),i.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",i.defaults.headers.get["Cache-Control"]="no-cache",i.defaults.headers.get.Pragma="no-cache",o.setPrefix(s),e.state("app",{url:"/app",abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:"app/waiting/index.html",controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:"app/online/index.html",controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:"app/offline/index.html",controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:"app/chat/index.html",controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:"app/unmanaged/index.html",controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:"app/closing/index.html",controller:"ClosingController as vm"})}e.$inject=["$rootScope","$location"],t.$inject=["$stateProvider","$urlRouterProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],angular.module("motion").config(t).run(e)}(),function(){"use strict";function e(i,o,s){var a=this,r=null;function l(){i.loading=!1}a.$onInit=function(){i.status="offline",a.visitor={id:i.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+_.random(1,1e6)},i.settings.showMenu=!1,i.loading=!1,o.chatWebsite.getFields({id:i.settings.id,online:!1}).$promise.then(function(e){e.count&&(r=e.fromKey,a.fields=e.rows)}).catch(function(e){console.error(e)})},a.submit=function(){i.loading=!0;for(var e=0;e\n
\n \"system\"\n \"agent\"\n \"customer\"\n\n
\n
\n
\n \n {{message.direction === 'out' ? (message.UserId ? (settings.agentAlias + message.UserId) : settings.systemAlias) : (settings.customerAlias || visitor.from || 'Visitor' + message.ContactId)}} - {{message.createdAt | date : 'h:mm'}}\n \n \n {{message.direction === 'out' ? (message.UserId ? (message.User.alias || message.User.fullname) : settings.systemAlias) : (settings.customerAlias || visitor.from || 'Visitor' + message.ContactId)}} - {{message.createdAt | date : 'h:mm'}}\n \n \n {{message.direction === 'out' ? (message.UserId ? message.User.fullname : settings.systemAlias) : (settings.customerAlias || visitor.from || 'Visitor' + message.ContactId)}} - {{message.createdAt | date : 'h:mm'}}\n \n \n {{message.direction === 'out' ? (message.UserId ? ((settings.agentAlias || 'Agent') + message.UserId) : settings.systemAlias) : (settings.customerAlias || visitor.from || 'Visitor' + message.ContactId)}} - {{message.createdAt | date : 'h:mm'}}\n \n
\n
\n \n \n
\n
\n
\n"+'
\n
\n
\n
\n
\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n\x3c!-- / CHAT CONTENT --\x3e\n\n\x3c!-- CHAT FOOTER --\x3e\n\n\x3c!-- / CHAT FOOTER --\x3e'),e.put("app/closing/index.html",'\x3c!-- CHAT CONTENT --\x3e\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n \n {{ settings.closingMessage }}\n \n\n
\n \n \x3c!-- START thumb rating --\x3e\n \n \n
\n \n
\n
\n \n
\n \n
\n
\n
\n \x3c!-- END thumb rating --\x3e\n\n \x3c!-- START star rating --\x3e\n
\n \n
\n \x3c!-- END star rating --\x3e\n
\n\n \n \x3c!-- START textarea --\x3e\n Feedback\n \n \x3c!-- END textarea --\x3e\n \n\n \n {{settings.forwardTranscriptMessage}}\n Email\n \x3c!-- START email --\x3e\n \n
\n
\n Email must be a valid e-mail address\n
\n
\n \x3c!-- END email --\x3e\n
\n\n
\n \n {{settings.closingMessageButton}}\n \n \n {{settings.skipMessageButton}}\n \n
\n
\n\n \n'+" {{ (settings.custom && !settings.defaultWhiteLabel) ? settings.whiteLabel : 'Powered By XCALLY' }}\n \n\n
\n\x3c!-- / CHAT CONTENT --\x3e\n"),e.put("app/offline/index.html",'\x3c!-- CHAT CONTENT --\x3e\n\n\n
\n\n
\n
\n {{field.props.title + (field.config.required ? \'*\' : \'\')}}\n\n \n
\n
\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n \n \x3c!-- START label --\x3e\n
\n \n {{field.value}}\n \n
\n \x3c!-- END label --\x3e\n\n \x3c!-- START textinput --\x3e\n
\n \n
\n \x3c!-- END textinput --\x3e\n\n \x3c!-- START textarea --\x3e\n
\n \n
\n \x3c!-- END textarea --\x3e\n\n \x3c!-- START select --\x3e\n
\n \n {{option.value}}\n \n
\n \x3c!-- END select --\x3e\n\n \x3c!-- START radio --\x3e\n
\n \n {{option.value}}\n \n
\n \x3c!-- END radio --\x3e\n\n \x3c!-- START checkbox --\x3e\n
\n
\n \n {{option.value}}\n \n
\n
\n \x3c!-- END checkbox --\x3e\n\n \x3c!-- START agreement --\x3e\n
\n \n {{field.options[0].value}}\n \n
\n \x3c!-- END agreement --\x3e\n\n
\n
\n Required Field\n
\n
\n Wrong type field\n
\n
\n
\n
\n\n \n {{settings.offline_chat_button}}\n \n
\n\n \n'+" {{ (settings.custom && !settings.defaultWhiteLabel) ? settings.whiteLabel : 'Powered By XCALLY' }}\n \n
\n\x3c!-- / CHAT CONTENT --\x3e\n"),e.put("app/online/index.html",'\x3c!-- CHAT CONTENT --\x3e\n\n
\n
\n {{field.props.title + (field.config.required ? \'*\' : \'\')}}\n\n \n
\n
\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n \n \x3c!-- START label --\x3e\n
\n \n {{field.value}}\n \n
\n \x3c!-- END label --\x3e\n\n \x3c!-- START textinput --\x3e\n
\n \n
\n \x3c!-- END textinput --\x3e\n\n \x3c!-- START textarea --\x3e\n
\n \n
\n \x3c!-- END textarea --\x3e\n\n \x3c!-- START select --\x3e\n
\n \n {{option.value}}\n \n
\n \x3c!-- END select --\x3e\n\n \x3c!-- START radio --\x3e\n
\n \n {{option.value}}\n \n
\n \x3c!-- END radio --\x3e\n\n \x3c!-- START checkbox --\x3e\n
\n \n {{option.value}}\n \n
\n \x3c!-- END checkbox --\x3e\n\n \x3c!-- START agreement --\x3e\n
\n \n {{field.options[0].value}}\n \n
\n \x3c!-- END agreement --\x3e\n\n
\n
\n Required Field\n
\n
\n Wrong type field\n
\n
\n
\n
\n\n \n {{settings.start_chat_button}}\n \n
\n\n \n'+" {{ (settings.custom && !settings.defaultWhiteLabel) ? settings.whiteLabel : 'Powered By XCALLY' }}\n \n
\n\x3c!-- / CHAT CONTENT --\x3e\n"),e.put("app/unmanaged/index.html",'\x3c!-- CHAT CONTENT --\x3e\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n \n {{ settings.unmanagedMessage }}\n \n\n
\n {{ settings.noteTitle || \'Note\' }}\n\n \n \x3c!-- START textarea --\x3e\n \n \x3c!-- END textarea --\x3e\n \n\n
\n \n {{settings.sendUnmanaged}}\n \n \n {{settings.skipUnmanaged}}\n \n
\n
\n\n \n'+" {{ (settings.custom && !settings.defaultWhiteLabel) ? settings.whiteLabel : 'Powered By XCALLY' }}\n \n
\n\x3c!-- / CHAT CONTENT --\x3e\n"),e.put("app/waiting/index.html",'\x3c!-- WAITING CONTENT --\x3e\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n {{settings.waitingTitle}}\n
\n
\n {{settings.waitingMessage}}\n
\n
\n\x3c!-- / WAITING CONTENT --\x3e\n')}]); \ No newline at end of file +! function() { + "use strict"; + angular.module("motion", ["ngAnimate", "ngAria", "ngMessages", "ngMaterial", "ngResource", "ngSanitize", "ngCsv", "ngEmbed", "ui.router", "LocalStorageModule", "ngRateIt", "flow"]).constant("STORAGE_PREFIX", "motion_chat").constant("STORAGE_VISITOR", "visitor").constant("STORAGE_LAYOUT", "layout").directive("ngEnter", function() { + return function(t, e, n) { + e.bind("keydown keypress", function(e) { + 13 === e.which && (t.$apply(function() { + t.$eval(n.ngEnter) + }), e.preventDefault()) + }) + } + }).directive("ngPrint", function() { + function i(e, t) { + for (var n, i = document.createElement("div"), o = t.visitor, s = t.settings, a = 0; a < t.messages.length; a++) { + var r = t.messages[a], + l = "Sender: ", + c = "Message: " + r.body, + d = "Sent At: " + moment(r.createdAt).format("YYYY-MM-DD HH:mm:ss"); + if (0 !== a) { + switch (t.settings.agentIdentifier) { + case "website_alias": + l += "out" === r.direction ? r.UserId ? s.agentAlias + r.UserId : "System" : s.customerAlias || o.from || "Visitor" + r.ContactId; + break; + case "agent_alias": + l += "out" === r.direction ? r.UserId ? r.User.alias || r.User.fullname : "System" : s.customerAlias || o.from || "Visitor" + r.ContactId; + break; + case "agent_fullname": + l += "out" === r.direction ? r.UserId ? r.User.fullname : "System" : s.customerAlias || o.from || "Visitor" + r.ContactId; + break; + default: + l += "out" === r.direction ? r.UserId ? (s.agentAlias || "Agent") + r.UserId : "System" : s.customerAlias || o.from || "Visitor" + r.ContactId + } + i.appendChild(document.createTextNode(l)), i.appendChild(document.createElement("br")), i.appendChild(document.createTextNode(c)), i.appendChild(document.createElement("br")), i.appendChild(document.createTextNode(d)), i.appendChild(document.createElement("br")), i.appendChild(document.createElement("br")) + } else n = r.createdAt + } + var m = window.open(); + m.document.write("" + document.title + ""), m.document.write(""), m.document.write("

Website: " + s.referer + "

"), m.document.write("

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

"), m.document.write("

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

"), m.document.write(i.innerHTML), m.document.write(""), m.document.close(), m.focus(), m.print(), m.close() + } + return { + link: function(t, e, n) { + e.on("click", function() { + var e = document.getElementById("chatContent1"); + e && i(e, t) + }) + }, + restrict: "A" + } + }) +}(), +function() { + "use strict"; + + function e(e, s, t, n, i, o, a, r, l, c) { + var d, m, g, u, p = this; + + function f() { + s.settings.online ? o.go("app.online", null, { + location: "replace" + }) : o.go("app.offline", null, { + location: "replace" + }) + } + + function v() { + s.visitor && s.visitor.interaction && s.visitor.interaction.id && r.chatInteraction.get({ + id: s.visitor.interaction.id + }).$promise.then(function(e) { + delete p.errors.getInteraction, e.closed && (s.visitor.interaction.closed = !0, s.updateStorage(l, s.visitor), "unmanaged" === e.disposition ? o.go("app.unmanaged", null, { + location: "replace" + }) : o.go("app.closing", null, { + location: "replace" + })) + }).catch(function(e) { + switch (e.status) { + case 403: + o.go("app.closing", null, { + location: "replace" + }); + break; + case 404: + s.updateStorage(l, null, !0), s.updateStorage(c, null, !0), f(); + break; + case 405: + o.go("app.unmanaged", null, { + location: "replace" + }); + break; + default: + console.error(e) + } + }) + } + + function h(t) { + return function(e) { + p.errors[t] = e.data, w() + } + } + + function x(e) { + var t = d[0].emojioneArea.getText(); + e && 13 === e.keyCode && e.shiftKey || e && 13 !== e.keyCode || "" !== t && b(_.merge({ + body: t + }, s.visitor)) + } + + function b(e) { + r.chatWebsite.notify(e).$promise.then(function(e) { + delete p.errors.chatMessageError, _.isNil(s.visitor.interaction) && (s.visitor.interaction = { + id: e.interaction.id + }, s.updateStorage(l, s.visitor)), d[0].emojioneArea.setText(""), w() + }).catch(h("chatMessageError")) + } + + function y() { + s.visitor && s.visitor.interaction && s.visitor.interaction.id && r.chatInteraction.getMessages({ + intid: s.visitor.interaction.id, + includeAgent: !0, + id: u || void 0 + }).$promise.then(function(e) { + if (delete p.errors.interaction, e.count) { + for (var t = 0, n = !1; t < e.rows.length; t++) { + var i = _.find(s.messages, { + id: e.rows[t].id + }); + i ? e.rows[t].read && (i.read = !0) : (n = !0, s.messages.push(e.rows[t])), "out" !== e.rows[t].direction || e.rows[t].read || (o = e.rows[t].id, r.chatMessage.update({ + id: o, + read: !0 + }).$promise.catch(function(e) { + console.error(e) + })) + } + n && w(), e.rows[t - 1].read && (u = e.rows[t - 1].id) + } + var o + }).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 w() { + t(function() { + var e = i[0].getElementsByClassName("chat-messages")[0]; + e && (e.scrollTop = e.scrollHeight) + }) + } + p.errors = {}, s.messages = [], p.emojiOptions = { + watchEmbedData: !1, + fontSmiley: !1, + emoji: !0, + link: !0, + linkTarget: "_blank" + }, p.$onInit = function() { + s.status = "chat", s.loading = !1, s.settings.showMenu = !0, p.replyMessage = "", s.visitor.interaction && s.visitor.interaction.closed ? (s.updateStorage(l, null, !0), s.updateStorage(c, null, !0), f()) : (v(), m = n(y, 2e3), g = n(v, 3e3)); + d = $("#emojionearea").emojioneArea({ + placeholder: s.settings.placeholderMessage || "Type a message", + events: { + keyup: function(e, t) { + x(t) + } + } + }) + }, p.reply = x, p.fileAdded = function(e) { + var t = new FormData; + t.append("file", e.file), a.post(s.settings.remote + "/api/chat/interactions/" + s.visitor.interaction.id + "/attachment_upload?token=" + s.settings.token, t, { + transformRequest: angular.identity, + headers: { + "Content-Type": void 0 + } + }).then(function(e) { + (e = e.data).id ? (delete p.errors.sendAttachment, b(_.merge({ + body: '' + e.name + "", + AttachmentId: e.id + }, s.visitor))) : h("sendAttachment") + }, h("sendAttachment")) + }, e.$on("$destroy", function() { + n.cancel(m), n.cancel(g), g = m = null + }), s.$on("$download", function(e, t) { + t && t(_.values(s.messages)) + }) + } + e.$inject = ["$scope", "$rootScope", "$timeout", "$interval", "$document", "$state", "$http", "api", "STORAGE_VISITOR", "STORAGE_LAYOUT"], angular.module("motion").controller("ChatController", e) +}(), +function() { + "use strict"; + + function e(i, e, o, t, n, s) { + var a = this; + + function r() { + i.settings.online ? e.go("app.online", null, { + location: "replace" + }) : e.go("app.offline", null, { + location: "replace" + }) + } + + function l() { + a.form = {}, a.upColor = null, a.downColor = null, a.userForm.$setPristine(), a.userForm.$setUntouched(), delete i.visitor.interaction, i.enableDownload = !1 + } + + function c(n) { + return function(e) { + a.errors[n] = e.data; + var t = o.simple().textContent(i.settings.formSubmitFailureMessage || "Form submission error").toastClass("md-failure-toast").position("top"); + o.show(t) + } + } + + function d() { + i.loading = !1 + } + a.$onInit = function() { + i.status = "closing", i.updateStorage(n, null, !0), i.updateStorage(s, null, !0), i.loading = !1 + }, a.submit = function() { + i.loading = !0, i.visitor.interaction && i.visitor.interaction.id ? t.chatInteraction.close(_.merge({ + id: i.visitor.interaction.id, + ratingType: i.settings.ratingType, + customer: i.settings.customerAlias || i.visitor.from + }, a.form)).$promise.then(function() { + delete a.errors.submit; + var e = o.simple().textContent(i.settings.formSubmitSuccessMessage || "Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar"))); + o.show(e) + }).then(l).then(r).catch(c("submit")).finally(d) : (d(), c("submit")) + }, a.skip = function() { + l(), r() + }, a.form = {}, a.errors = {} + } + e.$inject = ["$rootScope", "$state", "$mdToast", "api", "STORAGE_VISITOR", "STORAGE_LAYOUT"], angular.module("motion").controller("ClosingController", e) +}(), +function() { + "use strict"; + + function e(a, n, r, i, o, l, s, c, d) { + var e = this; + + function m(e, t, n) { + var i = l.get(e) || {}; + n ? delete i[a.location] : i[a.location] = t, l.set(e, i) + } + + function g(e) { + var t; + a.layout.up = e, m(c, a.layout), t = e ? "show" : "hide", n.parent.postMessage({ + cmd: t + }, "*") + } + a.location = a.settings.location, e.$onInit = function() { + a.status = "init"; + var e = !1, + t = l.get(d) || {}, + n = l.get(c) || {}; + a.visitor = t[a.location] ? t[a.location] : {}, a.layout = n[a.location] ? n[a.location] : {}, a.visitor.interaction && a.layout.up ? e = !0 : a.layout.up = !1; + g(e), r.go((i = a.settings.online, o = !!(a.visitor && a.visitor.interaction && a.visitor.interaction.id), s = Number(a.settings.maxInteractions) && Number(a.settings.openedInteractions) >= Number(a.settings.maxInteractions), o || !s && i ? "app.online" : "app.offline"), null, { + location: "replace" + }); + var i, o, s + }, e.close = function() { + var e = a.visitor.interaction; + if (e && e.id) { + var t = i.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(a.settings.closingQuestion || "Do you want to close the interaction?").ok("Ok").cancel("Cancel"); + i.show(t).then(function() { + return s.chatInteraction.customUpdate({ + id: e.id, + closed: !0, + closeReason: "contact", + closedAt: moment().format("YYYY-MM-DD HH:mm:ss") + }).$promise + }).then(function() { + r.go("app.closing", null, { + location: "replace" + }) + }).catch(function(e) { + console.error("keep open", e) + }) + } + }, e.toggle = g, e.download = function(e) { + var t = o.defer(), + n = a.visitor.interaction; + n && n.id && s.chatInteraction.getMessages({ + intid: n.id, + includeAll: !0 + }).$promise.then(function(e) { + t.resolve(_.map(e.rows.slice(1), function(e) { + var t; + if ("in" === e.direction && (t = a.settings.customerAlias || a.visitor.from || "Visitor" + e.ContactId), "out" === e.direction) switch (a.settings.agentIdentifier) { + case "website_alias": + t = e.UserId ? a.settings.agentAlias + e.UserId : "System"; + break; + case "agent_alias": + t = e.UserId ? e.User.alias || e.User.fullname : "System"; + break; + case "agent_fullname": + t = e.UserId ? e.User.fullname : "System"; + break; + default: + t = e.UserId ? a.settings.agentAlias + e.UserId : "System" + } + return { + sender: t, + message: e.body, + createdAt: moment(e.createdAt).format("MM/DD/YYYY HH:mm:ss") + } + })) + }).catch(function(e) { + console.error(e) + }); + return t.promise + }, e.getHeaderShape = function() { + return "rounded" === a.settings.header_shape ? "15px" : "0px" + }, a.updateStorage = m, window.addEventListener("message", function(e) { + g("show" === e.data.evt) + }, !1) + } + e.$inject = ["$rootScope", "$window", "$state", "$mdDialog", "$q", "localStorageService", "api", "STORAGE_LAYOUT", "STORAGE_VISITOR"], angular.module("motion").controller("IndexController", e) +}(), +function() { + "use strict"; + + function e(e, t) { + var n = { + baseUrl: e.settings.remote + "/api/" + }, + i = { + id: "@id", + token: e.settings.token + }; + return n.chatWebsite = t(n.baseUrl + "chat/websites/:id", i, { + notify: { + method: "POST", + url: n.baseUrl + "chat/websites/:id/notify" + }, + offline: { + method: "POST", + url: n.baseUrl + "chat/websites/:id/offline" + }, + getFields: { + method: "GET", + url: n.baseUrl + "chat/websites/:id/fields" + } + }), n.chatInteraction = t(n.baseUrl + "chat/interactions/:id", i, { + update: { + method: "PUT", + url: n.baseUrl + "chat/interactions/:id" + }, + customUpdate: { + method: "PUT", + url: n.baseUrl + "chat/interactions/:id/custom_update" + }, + close: { + method: "PUT", + url: n.baseUrl + "chat/interactions/:id/close" + }, + getMessages: { + method: "GET", + url: n.baseUrl + "chat/interactions/:intid/my_messages" + }, + uploadAttachment: { + method: "POST", + url: n.baseUrl + "chat/interactions/:id/attachment_upload", + headers: { + "Content-Type": void 0 + }, + transformRequest: angular.identity + }, + downloadAttachment: { + method: "GET", + url: n.baseUrl + "chat/interactions/:id/attachment_download" + } + }), n.chatMessage = t(n.baseUrl + "chat/messages/:id", i, { + update: { + method: "PUT", + url: n.baseUrl + "chat/messages/:id" + } + }), n + } + e.$inject = ["$rootScope", "$resource"], angular.module("motion").factory("api", e) +}(), +function() { + "use strict"; + + function e(n, e) { + var t = e.search(); + n.settings = { + cursor: "pointer", + hide: !0 + }, _.forIn(t, function(e, t) { + "" === e || _.isNil(e) || ("true" === e && (e = !0), "false" === e && (e = !1), n.settings[t] = e) + }) + } + + function t(e, t, n, i, o, s) { + n.html5Mode(!0), i.defaults.headers.get || (i.defaults.headers.get = {}), i.defaults.headers.get["If-Modified-Since"] = "Mon, 26 Jul 1997 05:00:00 GMT", i.defaults.headers.get["Cache-Control"] = "no-cache", i.defaults.headers.get.Pragma = "no-cache", o.setPrefix(s), e.state("app", { + url: "/app", + abstract: !0 + }).state("app.waiting", { + url: "/waiting", + templateUrl: "app/waiting/index.html", + controller: "WaitingController as vm" + }).state("app.online", { + url: "/online", + templateUrl: "app/online/index.html", + controller: "OnlineController as vm" + }).state("app.offline", { + url: "/offline", + templateUrl: "app/offline/index.html", + controller: "OfflineController as vm" + }).state("app.chat", { + url: "/chat", + templateUrl: "app/chat/index.html", + controller: "ChatController as vm" + }).state("app.unmanaged", { + url: "/unmanaged", + templateUrl: "app/unmanaged/index.html", + controller: "UnmanagedController as vm" + }).state("app.closing", { + url: "/closing", + templateUrl: "app/closing/index.html", + controller: "ClosingController as vm" + }) + } + e.$inject = ["$rootScope", "$location"], t.$inject = ["$stateProvider", "$urlRouterProvider", "$locationProvider", "$httpProvider", "localStorageServiceProvider", "STORAGE_PREFIX"], angular.module("motion").config(t).run(e) +}(), +function() { + "use strict"; + + function e(i, o, s) { + var a = this, + r = null; + + function l() { + i.loading = !1 + } + a.$onInit = function() { + i.status = "offline", a.visitor = { + id: i.settings.id, + mapKeyOffline: "firstName", + from: "Anonymous" + _.random(1, 1e6) + }, i.settings.showMenu = !1, i.loading = !1, o.chatWebsite.getFields({ + id: i.settings.id, + online: !1 + }).$promise.then(function(e) { + e.count && (r = e.fromKey, a.fields = e.rows) + }).catch(function(e) { + console.error(e) + }) + }, a.submit = function() { + i.loading = !0; + for (var e = 0; e < a.fields.length; e++) { + var t = a.fields[e]; + t.props && a.form.hasOwnProperty(t.props.title) && (_.isNil(t.cmField) || (a.visitor[t.cmField] = _.isArray(a.form[t.props.title]) ? a.form[t.props.title].join() : a.form[t.props.title]), e === r && (_.isNil(i.settings.mapKeyOffline) || (a.visitor.mapKeyOffline = i.settings.mapKeyOffline, a.visitor.from = _.isArray(a.form[t.props.title]) ? a.form[t.props.title].join() : a.form[t.props.title]))) + } + o.chatWebsite.offline(_.merge({ + body: a.form + }, a.visitor)).$promise.then(function() { + delete a.errors.submit, i.$emit("hide"), a.form = {}, a.userForm.$setPristine(), a.userForm.$setUntouched(); + var e = s.simple().textContent(i.settings.formSubmitSuccessMessage || "Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar"))); + s.show(e) + }).catch((n = "submit", function(e) { + var t = s.simple().textContent(i.settings.formSubmitFailureMessage || "Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar"))); + s.show(t), a.errors[n] = e.data + })).finally(l); + var n + }, a.toggle = function(e, t) { + a.form[e] || (a.form[e] = []); + var n = a.form[e].indexOf(t); - 1 < n ? a.form[e].splice(n, 1) : a.form[e].push(t) + }, a.exists = function(e, t) { + a.form[e] || (a.form[e] = []); + return -1 < a.form[e].indexOf(t) + }, a.form = {}, a.errors = {}, a.userForm = {} + } + e.$inject = ["$rootScope", "api", "$mdToast"], angular.module("motion").controller("OfflineController", e) +}(), +function() { + "use strict"; + + function e(o, s, a, r) { + var l = this, + c = null; + l.$onInit = function() { + o.status = "online", o.visitor && o.visitor.interaction ? o.visitor.interaction.id ? s.go("app.chat", null, { + location: "replace" + }) : s.go("app.waiting", null, { + location: "replace" + }) : (o.visitor = { + id: o.settings.id, + mapKey: "firstName", + from: "Anonymous" + _.random(1, 1e6) + }, o.settings.showMenu = !1, o.updateStorage(r, o.visitor), a.chatWebsite.getFields({ + id: o.settings.id, + online: !0 + }).$promise.then(function(e) { + e.count && (c = e.fromKey, l.fields = e.rows) + }).catch(function(e) { + console.error(e) + })) + }, l.submit = function() { + for (var e = "", t = 0; t < l.fields.length; t++) { + var n = l.fields[t]; + n.props && l.form.hasOwnProperty(n.props.title) && (_.isNil(n.variable) || (o.visitor[n.variable] = _.isArray(l.form[n.props.title]) ? l.form[n.props.title].join() : l.form[n.props.title]), _.isNil(n.cmField) || (o.visitor[n.cmField] = _.isArray(l.form[n.props.title]) ? l.form[n.props.title].join() : l.form[n.props.title]), t === c && (_.isNil(o.settings.mapKey) || (o.visitor.mapKey = o.settings.mapKey, o.visitor.from = _.isArray(l.form[n.props.title]) ? l.form[n.props.title].join() : l.form[n.props.title])), e += n.props.title + ": " + l.form[n.props.title] + "\n") + } + i = _.merge({ + body: e, + referer: o.settings.referer, + customerIp: o.settings.customerIp + }, o.visitor), l.disableItem = !0, a.chatWebsite.notify(i).$promise.then(function(e) { + delete l.errors.chatMessageError, o.visitor.message = { + id: e.message.id + }, o.visitor.interaction = { + id: e.interaction.id + }, o.updateStorage(r, o.visitor), l.disableItem = !1, o.settings.enableCustomerWriting ? s.go("app.chat", null, { + location: "replace" + }) : s.go("app.waiting", null, { + location: "replace" + }) + }).catch(function(e) { + l.disableItem = !1, console.error(e) + }); + var i + }, l.toggle = function(e, t) { + l.form[e] || (l.form[e] = []); + var n = l.form[e].indexOf(t); - 1 < n ? l.form[e].splice(n, 1) : l.form[e].push(t) + }, l.exists = function(e, t) { + l.form[e] || (l.form[e] = []); + return -1 < l.form[e].indexOf(t) + }, l.form = {}, l.errors = {}, l.userForm = {}, l.disableItem = !1 + } + e.$inject = ["$rootScope", "$state", "api", "STORAGE_VISITOR"], angular.module("motion").controller("OnlineController", e) +}(), +function() { + "use strict"; + + function e(i, e, o, t, n, s) { + var a = this; + + function r() { + i.settings.online ? e.go("app.online", null, { + location: "replace" + }) : e.go("app.offline", null, { + location: "replace" + }) + } + + function l() { + a.form = {}, a.upColor = null, a.downColor = null, a.userForm.$setPristine(), a.userForm.$setUntouched(), i.visitor = {}, i.enableDownload = !1, i.$emit("hide") + } + + function c(n) { + return function(e) { + a.errors[n] = e.data; + var t = o.simple().textContent(i.settings.formSubmitFailureMessage || "Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar"))); + o.show(t) + } + } + + function d() { + i.loading = !1 + } + a.form = {}, a.errors = {}, a.$onInit = function() { + i.status = "unmanaged", i.updateStorage(n, null, !0), i.updateStorage(s, null, !0), i.loading = !1 + }, a.submit = function() { + i.loading = !0, i.visitor.interaction && i.visitor.interaction.id ? t.chatInteraction.customUpdate({ + id: i.visitor.interaction.id, + note: a.form.note + }).$promise.then(function() { + delete a.errors.submit; + var e = o.simple().textContent(i.settings.formSubmitSuccessMessage || "Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar"))); + o.show(e) + }).then(l).then(r).catch(c("submit")).finally(d) : (d(), c("submit")) + }, a.skip = function() { + l(), r() + } + } + e.$inject = ["$rootScope", "$state", "$mdToast", "api", "STORAGE_VISITOR", "STORAGE_LAYOUT"], angular.module("motion").controller("UnmanagedController", e) +}(), +function() { + "use strict"; + + function e(i, e, t, o, n, s, a, r) { + var l, c = !1; + + function d() { + var t = {}, + n = !1; + s.chatInteraction.get({ + id: i.visitor.interaction.id + }).$promise.then(function(e) { + return t = e, s.chatInteraction.getMessages({ + intid: i.visitor.interaction.id + }).$promise + }).then(function(e) { + n = 1 < e.rows.length, t.closed ? (i.visitor.interaction.closed = !0, i.updateStorage(a, i.visitor), "unmanaged" === t.disposition && o.go("app.unmanaged", null, { + location: "replace" + })) : t.UserId ? (i.visitor.interaction.UserId = t.UserId, i.updateStorage(a, i.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 m() { + if (i.visitor && i.visitor.interaction && i.visitor.interaction.id && !c) { + c = !0; + var e = new XMLHttpRequest; + e.open("PUT", i.settings.remote + "/api/chat/interactions/" + i.visitor.interaction.id + "/abandon?token=" + i.settings.token, !1), e.setRequestHeader("Content-type", "application/json; charset=utf-8"), e.send(JSON.stringify({ + channel: "chat", + interaction: { + id: i.visitor.interaction.id + }, + message: { + id: i.visitor.message.id + }, + disposition: "abandoned", + closed: !0, + closeReason: "contact", + closedAt: moment().format("YYYY-MM-DD HH:mm:ss") + })), 4 === e.readyState && 200 === e.status && (i.updateStorage(a, null, !0), i.updateStorage(r, null, !0)) + } + } + this.$onInit = function() { + i.status = "waiting", i.visitor && i.visitor.interaction && i.visitor.interaction.id && (l = t(d, 3e3)) + }, e.$on("$destroy", function() { + n.removeEventListener("beforeunload", m), n.removeEventListener("unload", m), t.cancel(l) + }), n.addEventListener("beforeunload", m), n.addEventListener("unload", m) + } + e.$inject = ["$rootScope", "$scope", "$interval", "$state", "$window", "api", "STORAGE_VISITOR", "STORAGE_LAYOUT"], angular.module("motion").controller("WaitingController", e) +}(), angular.module("motion").run(["$templateCache", function(e) { + "use strict"; + e.put("app/chat/index.html", "\x3c!-- CHAT CONTENT --\x3e\n\n
\n \"system\"\n \"agent\"\n \"customer\"\n\n
\n
\n
\n \n {{message.direction === 'out' ? (message.UserId ? (settings.agentAlias + message.UserId) : settings.systemAlias) : (settings.customerAlias || visitor.from || 'Visitor' + message.ContactId)}} - {{message.createdAt | date : 'h:mm'}}\n \n \n {{message.direction === 'out' ? (message.UserId ? (message.User.alias || message.User.fullname) : settings.systemAlias) : (settings.customerAlias || visitor.from || 'Visitor' + message.ContactId)}} - {{message.createdAt | date : 'h:mm'}}\n \n \n {{message.direction === 'out' ? (message.UserId ? message.User.fullname : settings.systemAlias) : (settings.customerAlias || visitor.from || 'Visitor' + message.ContactId)}} - {{message.createdAt | date : 'h:mm'}}\n \n \n {{message.direction === 'out' ? (message.UserId ? ((settings.agentAlias || 'Agent') + message.UserId) : settings.systemAlias) : (settings.customerAlias || visitor.from || 'Visitor' + message.ContactId)}} - {{message.createdAt | date : 'h:mm'}}\n \n
\n
\n \n \n
\n
\n
\n" + '
\n
\n
\n
\n
\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n
\n\x3c!-- / CHAT CONTENT --\x3e\n\n\x3c!-- CHAT FOOTER --\x3e\n\n\x3c!-- / CHAT FOOTER --\x3e'), e.put("app/closing/index.html", '\x3c!-- CHAT CONTENT --\x3e\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n \n {{ settings.closingMessage }}\n \n\n
\n \n \x3c!-- START thumb rating --\x3e\n \n \n
\n \n
\n
\n \n
\n \n
\n
\n
\n \x3c!-- END thumb rating --\x3e\n\n \x3c!-- START star rating --\x3e\n
\n \n
\n \x3c!-- END star rating --\x3e\n
\n\n \n \x3c!-- START textarea --\x3e\n Feedback\n \n \x3c!-- END textarea --\x3e\n \n\n \n {{settings.forwardTranscriptMessage}}\n Email\n \x3c!-- START email --\x3e\n \n
\n
\n Email must be a valid e-mail address\n
\n
\n \x3c!-- END email --\x3e\n
\n\n
\n \n {{settings.closingMessageButton}}\n \n \n {{settings.skipMessageButton}}\n \n
\n
\n\n \n' + " {{ (settings.custom && !settings.defaultWhiteLabel) ? settings.whiteLabel : 'Powered By XCALLY' }}\n \n\n
\n\x3c!-- / CHAT CONTENT --\x3e\n"), e.put("app/offline/index.html", '\x3c!-- CHAT CONTENT --\x3e\n\n\n
\n\n
\n
\n {{field.props.title + (field.config.required ? \'*\' : \'\')}}\n\n \n
\n
\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n \n \x3c!-- START label --\x3e\n
\n \n {{field.value}}\n \n
\n \x3c!-- END label --\x3e\n\n \x3c!-- START textinput --\x3e\n
\n \n
\n \x3c!-- END textinput --\x3e\n\n \x3c!-- START textarea --\x3e\n
\n \n
\n \x3c!-- END textarea --\x3e\n\n \x3c!-- START select --\x3e\n
\n \n {{option.value}}\n \n
\n \x3c!-- END select --\x3e\n\n \x3c!-- START radio --\x3e\n
\n \n {{option.value}}\n \n
\n \x3c!-- END radio --\x3e\n\n \x3c!-- START checkbox --\x3e\n
\n
\n \n {{option.value}}\n \n
\n
\n \x3c!-- END checkbox --\x3e\n\n \x3c!-- START agreement --\x3e\n
\n \n {{field.options[0].value}}\n \n
\n \x3c!-- END agreement --\x3e\n\n
\n
\n Required Field\n
\n
\n Wrong type field\n
\n
\n
\n
\n\n \n {{settings.offline_chat_button}}\n \n
\n\n \n' + " {{ (settings.custom && !settings.defaultWhiteLabel) ? settings.whiteLabel : 'Powered By XCALLY' }}\n \n
\n\x3c!-- / CHAT CONTENT --\x3e\n"), e.put("app/online/index.html", '\x3c!-- CHAT CONTENT --\x3e\n\n
\n
\n {{field.props.title + (field.config.required ? \'*\' : \'\')}}\n\n \n
\n
\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n \n \x3c!-- START label --\x3e\n
\n \n {{field.value}}\n \n
\n \x3c!-- END label --\x3e\n\n \x3c!-- START textinput --\x3e\n
\n \n
\n \x3c!-- END textinput --\x3e\n\n \x3c!-- START textarea --\x3e\n
\n \n
\n \x3c!-- END textarea --\x3e\n\n \x3c!-- START select --\x3e\n
\n \n {{option.value}}\n \n
\n \x3c!-- END select --\x3e\n\n \x3c!-- START radio --\x3e\n
\n \n {{option.value}}\n \n
\n \x3c!-- END radio --\x3e\n\n \x3c!-- START checkbox --\x3e\n
\n \n {{option.value}}\n \n
\n \x3c!-- END checkbox --\x3e\n\n \x3c!-- START agreement --\x3e\n
\n \n {{field.options[0].value}}\n \n
\n \x3c!-- END agreement --\x3e\n\n
\n
\n Required Field\n
\n
\n Wrong type field\n
\n
\n
\n
\n\n \n {{settings.start_chat_button}}\n \n
\n\n \n' + " {{ (settings.custom && !settings.defaultWhiteLabel) ? settings.whiteLabel : 'Powered By XCALLY' }}\n \n
\n\x3c!-- / CHAT CONTENT --\x3e\n"), e.put("app/unmanaged/index.html", '\x3c!-- CHAT CONTENT --\x3e\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n \n {{ settings.unmanagedMessage }}\n \n\n
\n {{ settings.noteTitle || \'Note\' }}\n\n \n \x3c!-- START textarea --\x3e\n \n \x3c!-- END textarea --\x3e\n \n\n
\n \n {{settings.sendUnmanaged}}\n \n \n {{settings.skipUnmanaged}}\n \n
\n
\n\n \n' + " {{ (settings.custom && !settings.defaultWhiteLabel) ? settings.whiteLabel : 'Powered By XCALLY' }}\n \n
\n\x3c!-- / CHAT CONTENT --\x3e\n"), e.put("app/waiting/index.html", '\x3c!-- WAITING CONTENT --\x3e\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n {{settings.waitingTitle}}\n
\n
\n {{settings.waitingMessage}}\n
\n
\n\x3c!-- / WAITING CONTENT --\x3e\n') +}]); \ No newline at end of file diff --git a/snippet/1.0.11/scripts/vendor.js b/snippet/1.0.11/scripts/vendor.js index a37476a..6fe7582 100644 --- a/snippet/1.0.11/scripts/vendor.js +++ b/snippet/1.0.11/scripts/vendor.js @@ -1 +1,37298 @@ -!function(de){"use strict";var u={objectMaxDepth:5,urlErrorParamsEnabled:!0};function e(e){if(!Ee(e))return u;O(e.objectMaxDepth)&&(u.objectMaxDepth=c(e.objectMaxDepth)?e.objectMaxDepth:NaN),O(e.urlErrorParamsEnabled)&&Ae(e.urlErrorParamsEnabled)&&(u.urlErrorParamsEnabled=e.urlErrorParamsEnabled)}function c(e){return E(e)&&0
").append(e).html();try{return e[0].nodeType===Ue?me(t):t.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(e,t){return"<"+me(t)})}catch(e){return me(t)}}function K(e){try{return decodeURIComponent(e)}catch(e){}}function Z(e){var i={};return ve((e||"").split("&"),function(e){var t,n,r;e&&(n=e=e.replace(/\+/g,"%20"),-1!==(t=e.indexOf("="))&&(n=e.substring(0,t),r=e.substring(t+1)),O(n=K(n))&&(r=!O(r)||K(r),pe.call(i,n)?ke(i[n])?i[n].push(r):i[n]=[i[n],r]:i[n]=r))}),i}function X(e){return Q(e,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Q(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,t?"%20":"+")}var J=["ng-","data-ng-","ng:","x-ng-"];var ee=function(n){var e=n.currentScript;if(!e)return!0;if(!(e instanceof de.HTMLScriptElement||e instanceof de.SVGScriptElement))return!1;var t=e.attributes;return[t.getNamedItem("src"),t.getNamedItem("href"),t.getNamedItem("xlink:href")].every(function(e){if(!e)return!0;if(!e.value)return!1;var t=n.createElement("a");if(t.href=e.value,n.location.origin===t.origin)return!0;switch(t.protocol){case"http:":case"https:":case"ftp:":case"blob:":case"file:":case"data:":return!0;default:return!1}})}(de.document);function te(r,e){var i,o,t={};if(ve(J,function(e){var t=e+"app";!i&&r.hasAttribute&&r.hasAttribute(t)&&(o=(i=r).getAttribute(t))}),ve(J,function(e){var t,n=e+"app";!i&&(t=r.querySelector("["+n.replace(":","\\:")+"]"))&&(o=(i=t).getAttribute(n))}),i){if(!ee)return void de.console.error("AngularJS: disabling automatic bootstrap.